Repository: cznic/cc Branch: master Commit: d673e9b70d4d Files: 7196 Total size: 42.1 MB Directory structure: gitextract_7n8tim4r/ ├── AUTHORS ├── CONTRIBUTORS ├── LICENSE ├── Makefile ├── README.md ├── all_test.go ├── ast.go ├── ast2.go ├── ast_test.go ├── cc.go ├── cpp.go ├── encoding.go ├── etc.go ├── generate.go ├── global.go ├── kind_string.go ├── lexer.go ├── linkage_string.go ├── model.go ├── namespace_string.go ├── parser.go ├── parser.y ├── parser.yy ├── scanner.go ├── scanner.l ├── scope_string.go ├── testdata/ │ ├── anon.c │ ├── arith-1.c │ ├── arith-1.h │ ├── array.c │ ├── empty.c │ ├── enum.c │ ├── example-6.10.3.3-4.h │ ├── example-6.10.3.5-3.h │ ├── example-6.10.3.5-4.h │ ├── example-6.10.3.5-5.h │ ├── example-6.10.3.5-6.h │ ├── example-6.10.3.5-7.h │ ├── func.c │ ├── funcfunc.c │ ├── gcc-6.3.0/ │ │ ├── COPYING │ │ ├── COPYING.LIB │ │ ├── COPYING.RUNTIME │ │ ├── COPYING3 │ │ ├── COPYING3.LIB │ │ ├── README │ │ ├── gcc/ │ │ │ └── testsuite/ │ │ │ └── gcc.c-torture/ │ │ │ ├── compat/ │ │ │ │ ├── strct-layout.c │ │ │ │ ├── struct-align.c │ │ │ │ ├── struct-big.c │ │ │ │ ├── struct-i.c │ │ │ │ ├── struct-ic.c │ │ │ │ ├── struct-ii.c │ │ │ │ └── struct-ret-1.c │ │ │ ├── compile/ │ │ │ │ ├── 20000105-1.c │ │ │ │ ├── 20000105-2.c │ │ │ │ ├── 20000120-1.c │ │ │ │ ├── 20000120-2.c │ │ │ │ ├── 20000127-1.c │ │ │ │ ├── 20000211-1.c │ │ │ │ ├── 20000211-3.c │ │ │ │ ├── 20000224-1.c │ │ │ │ ├── 20000314-1.c │ │ │ │ ├── 20000314-2.c │ │ │ │ ├── 20000319-1.c │ │ │ │ ├── 20000326-1.c │ │ │ │ ├── 20000326-2.c │ │ │ │ ├── 20000329-1.c │ │ │ │ ├── 20000403-1.c │ │ │ │ ├── 20000403-2.c │ │ │ │ ├── 20000405-1.c │ │ │ │ ├── 20000405-2.c │ │ │ │ ├── 20000405-3.c │ │ │ │ ├── 20000412-1.c │ │ │ │ ├── 20000412-2.c │ │ │ │ ├── 20000420-1.c │ │ │ │ ├── 20000420-2.c │ │ │ │ ├── 20000427-1.c │ │ │ │ ├── 20000502-1.c │ │ │ │ ├── 20000504-1.c │ │ │ │ ├── 20000511-1.c │ │ │ │ ├── 20000517-1.c │ │ │ │ ├── 20000518-1.c │ │ │ │ ├── 20000523-1.c │ │ │ │ ├── 20000605-1.c │ │ │ │ ├── 20000606-1.c │ │ │ │ ├── 20000609-1.c │ │ │ │ ├── 20000629-1.c │ │ │ │ ├── 20000701-1.c │ │ │ │ ├── 20000717-1.c │ │ │ │ ├── 20000718.c │ │ │ │ ├── 20000728-1.c │ │ │ │ ├── 20000802-1.c │ │ │ │ ├── 20000803-1.c │ │ │ │ ├── 20000804-1.c │ │ │ │ ├── 20000818-1.c │ │ │ │ ├── 20000825-1.c │ │ │ │ ├── 20000827-1.c │ │ │ │ ├── 20000922-1.c │ │ │ │ ├── 20000923-1.c │ │ │ │ ├── 20001018-1.c │ │ │ │ ├── 20001024-1.c │ │ │ │ ├── 20001109-1.c │ │ │ │ ├── 20001109-2.c │ │ │ │ ├── 20001116-1.c │ │ │ │ ├── 20001121-1.c │ │ │ │ ├── 20001123-1.c │ │ │ │ ├── 20001123-2.c │ │ │ │ ├── 20001205-1.c │ │ │ │ ├── 20001212-1.c │ │ │ │ ├── 20001221-1.c │ │ │ │ ├── 20001222-1.c │ │ │ │ ├── 20001226-1.c │ │ │ │ ├── 200031109-1.c │ │ │ │ ├── 20010102-1.c │ │ │ │ ├── 20010107-1.c │ │ │ │ ├── 20010112-1.c │ │ │ │ ├── 20010113-1.c │ │ │ │ ├── 20010114-1.c │ │ │ │ ├── 20010114-2.c │ │ │ │ ├── 20010117-1.c │ │ │ │ ├── 20010117-2.c │ │ │ │ ├── 20010118-1.c │ │ │ │ ├── 20010124-1.c │ │ │ │ ├── 20010202-1.c │ │ │ │ ├── 20010209-1.c │ │ │ │ ├── 20010226-1.c │ │ │ │ ├── 20010227-1.c │ │ │ │ ├── 20010313-1.c │ │ │ │ ├── 20010320-1.c │ │ │ │ ├── 20010326-1.c │ │ │ │ ├── 20010327-1.c │ │ │ │ ├── 20010328-1.c │ │ │ │ ├── 20010329-1.c │ │ │ │ ├── 20010404-1.c │ │ │ │ ├── 20010408-1.c │ │ │ │ ├── 20010421-1.c │ │ │ │ ├── 20010423-1.c │ │ │ │ ├── 20010426-1.c │ │ │ │ ├── 20010503-1.c │ │ │ │ ├── 20010510-1.c │ │ │ │ ├── 20010518-1.c │ │ │ │ ├── 20010518-2.c │ │ │ │ ├── 20010525-1.c │ │ │ │ ├── 20010605-1.c │ │ │ │ ├── 20010605-2.c │ │ │ │ ├── 20010605-3.c │ │ │ │ ├── 20010610-1.c │ │ │ │ ├── 20010611-1.c │ │ │ │ ├── 20010701-1.c │ │ │ │ ├── 20010706-1.c │ │ │ │ ├── 20010711-1.c │ │ │ │ ├── 20010711-2.c │ │ │ │ ├── 20010714-1.c │ │ │ │ ├── 20010824-1.c │ │ │ │ ├── 20010903-1.c │ │ │ │ ├── 20010903-2.c │ │ │ │ ├── 20010911-1.c │ │ │ │ ├── 20011010-1.c │ │ │ │ ├── 20011023-1.c │ │ │ │ ├── 20011029-1.c │ │ │ │ ├── 20011106-1.c │ │ │ │ ├── 20011106-2.c │ │ │ │ ├── 20011109-1.c │ │ │ │ ├── 20011114-1.c │ │ │ │ ├── 20011114-2.c │ │ │ │ ├── 20011114-3.c │ │ │ │ ├── 20011114-4.c │ │ │ │ ├── 20011119-1.c │ │ │ │ ├── 20011119-2.c │ │ │ │ ├── 20011130-1.c │ │ │ │ ├── 20011130-2.c │ │ │ │ ├── 20011205-1.c │ │ │ │ ├── 20011217-1.c │ │ │ │ ├── 20011217-2.c │ │ │ │ ├── 20011218-1.c │ │ │ │ ├── 20011219-1.c │ │ │ │ ├── 20011219-2.c │ │ │ │ ├── 20011229-1.c │ │ │ │ ├── 20011229-2.c │ │ │ │ ├── 20020103-1.c │ │ │ │ ├── 20020106-1.c │ │ │ │ ├── 20020109-1.c │ │ │ │ ├── 20020109-2.c │ │ │ │ ├── 20020110.c │ │ │ │ ├── 20020116-1.c │ │ │ │ ├── 20020120-1.c │ │ │ │ ├── 20020121-1.c │ │ │ │ ├── 20020129-1.c │ │ │ │ ├── 20020206-1.c │ │ │ │ ├── 20020210-1.c │ │ │ │ ├── 20020303-1.c │ │ │ │ ├── 20020304-1.c │ │ │ │ ├── 20020304-2.c │ │ │ │ ├── 20020309-1.c │ │ │ │ ├── 20020309-2.c │ │ │ │ ├── 20020312-1.c │ │ │ │ ├── 20020314-1.c │ │ │ │ ├── 20020315-1.c │ │ │ │ ├── 20020318-1.c │ │ │ │ ├── 20020319-1.c │ │ │ │ ├── 20020320-1.c │ │ │ │ ├── 20020323-1.c │ │ │ │ ├── 20020330-1.c │ │ │ │ ├── 20020409-1.c │ │ │ │ ├── 20020415-1.c │ │ │ │ ├── 20020418-1.c │ │ │ │ ├── 20020530-1.c │ │ │ │ ├── 20020604-1.c │ │ │ │ ├── 20020605-1.c │ │ │ │ ├── 20020701-1.c │ │ │ │ ├── 20020706-1.c │ │ │ │ ├── 20020706-2.c │ │ │ │ ├── 20020709-1.c │ │ │ │ ├── 20020710-1.c │ │ │ │ ├── 20020715-1.c │ │ │ │ ├── 20020807-1.c │ │ │ │ ├── 20020910-1.c │ │ │ │ ├── 20020926-1.c │ │ │ │ ├── 20020927-1.c │ │ │ │ ├── 20020930-1.c │ │ │ │ ├── 20021001-1.c │ │ │ │ ├── 20021007-1.c │ │ │ │ ├── 20021008-1.c │ │ │ │ ├── 20021015-1.c │ │ │ │ ├── 20021015-2.c │ │ │ │ ├── 20021103-1.c │ │ │ │ ├── 20021108-1.c │ │ │ │ ├── 20021110.c │ │ │ │ ├── 20021119-1.c │ │ │ │ ├── 20021120-1.c │ │ │ │ ├── 20021120-2.c │ │ │ │ ├── 20021124-1.c │ │ │ │ ├── 20021204-1.c │ │ │ │ ├── 20021205-1.c │ │ │ │ ├── 20021212-1.c │ │ │ │ ├── 20021230-1.c │ │ │ │ ├── 20030109-1.c │ │ │ │ ├── 20030110-1.c │ │ │ │ ├── 20030125-1.c │ │ │ │ ├── 20030206-1.c │ │ │ │ ├── 20030216-1.c │ │ │ │ ├── 20030219-1.c │ │ │ │ ├── 20030220-1.c │ │ │ │ ├── 20030224-1.c │ │ │ │ ├── 20030305-1.c │ │ │ │ ├── 20030310-1.c │ │ │ │ ├── 20030314-1.c │ │ │ │ ├── 20030319-1.c │ │ │ │ ├── 20030320-1.c │ │ │ │ ├── 20030323-1.c │ │ │ │ ├── 20030330-1.c │ │ │ │ ├── 20030331-1.c │ │ │ │ ├── 20030405-1.c │ │ │ │ ├── 20030410-1.c │ │ │ │ ├── 20030415-1.c │ │ │ │ ├── 20030416-1.c │ │ │ │ ├── 20030418-1.c │ │ │ │ ├── 20030503-1.c │ │ │ │ ├── 20030518-1.c │ │ │ │ ├── 20030530-1.c │ │ │ │ ├── 20030530-3.c │ │ │ │ ├── 20030604-1.c │ │ │ │ ├── 20030605-1.c │ │ │ │ ├── 20030612-1.c │ │ │ │ ├── 20030624-1.c │ │ │ │ ├── 20030703-1.c │ │ │ │ ├── 20030704-1.c │ │ │ │ ├── 20030707-1.c │ │ │ │ ├── 20030708-1.c │ │ │ │ ├── 20030716-1.c │ │ │ │ ├── 20030725-1.c │ │ │ │ ├── 20030804-1.c │ │ │ │ ├── 20030821-1.c │ │ │ │ ├── 20030823-1.c │ │ │ │ ├── 20030902-1.c │ │ │ │ ├── 20030903-1.c │ │ │ │ ├── 20030904-1.c │ │ │ │ ├── 20030907-1.c │ │ │ │ ├── 20030910-1.c │ │ │ │ ├── 20030917-1.c │ │ │ │ ├── 20030921-1.c │ │ │ │ ├── 20031002-1.c │ │ │ │ ├── 20031010-1.c │ │ │ │ ├── 20031011-1.c │ │ │ │ ├── 20031011-2.c │ │ │ │ ├── 20031023-1.c │ │ │ │ ├── 20031023-2.c │ │ │ │ ├── 20031023-3.c │ │ │ │ ├── 20031023-4.c │ │ │ │ ├── 20031031-1.c │ │ │ │ ├── 20031031-2.c │ │ │ │ ├── 20031102-1.c │ │ │ │ ├── 20031112-1.c │ │ │ │ ├── 20031113-1.c │ │ │ │ ├── 20031124-1.c │ │ │ │ ├── 20031125-1.c │ │ │ │ ├── 20031125-2.c │ │ │ │ ├── 20031203-1.c │ │ │ │ ├── 20031203-2.c │ │ │ │ ├── 20031203-3.c │ │ │ │ ├── 20031208-1.c │ │ │ │ ├── 20031220-1.c │ │ │ │ ├── 20031220-2.c │ │ │ │ ├── 20031227-1.c │ │ │ │ ├── 20031231-1.c │ │ │ │ ├── 20040101-1.c │ │ │ │ ├── 20040109-1.c │ │ │ │ ├── 20040121-1.c │ │ │ │ ├── 20040124-1.c │ │ │ │ ├── 20040130-1.c │ │ │ │ ├── 20040202-1.c │ │ │ │ ├── 20040209-1.c │ │ │ │ ├── 20040214-1.c │ │ │ │ ├── 20040214-2.c │ │ │ │ ├── 20040216-1.c │ │ │ │ ├── 20040219-1.c │ │ │ │ ├── 20040220-1.c │ │ │ │ ├── 20040303-1.c │ │ │ │ ├── 20040303-2.c │ │ │ │ ├── 20040304-1.c │ │ │ │ ├── 20040309-1.c │ │ │ │ ├── 20040310-1.c │ │ │ │ ├── 20040317-1.c │ │ │ │ ├── 20040317-2.c │ │ │ │ ├── 20040317-3.c │ │ │ │ ├── 20040323-1.c │ │ │ │ ├── 20040401-1.c │ │ │ │ ├── 20040415-1.c │ │ │ │ ├── 20040415-2.c │ │ │ │ ├── 20040419-1.c │ │ │ │ ├── 20040602-1.c │ │ │ │ ├── 20040610-1.c │ │ │ │ ├── 20040611-1.c │ │ │ │ ├── 20040614-1.c │ │ │ │ ├── 20040621-1.c │ │ │ │ ├── 20040624-1.c │ │ │ │ ├── 20040705-1.c │ │ │ │ ├── 20040708-1.c │ │ │ │ ├── 20040709-1.c │ │ │ │ ├── 20040726-1.c │ │ │ │ ├── 20040726-2.c │ │ │ │ ├── 20040727-1.c │ │ │ │ ├── 20040730-1.c │ │ │ │ ├── 20040817-1.c │ │ │ │ ├── 20040824-1.c │ │ │ │ ├── 20040901-1.c │ │ │ │ ├── 20040907-1.c │ │ │ │ ├── 20040908-1.c │ │ │ │ ├── 20040909-1.c │ │ │ │ ├── 20040914-1.c │ │ │ │ ├── 20040916-1.c │ │ │ │ ├── 20041005-1.c │ │ │ │ ├── 20041007-1.c │ │ │ │ ├── 20041018-1.c │ │ │ │ ├── 20041026-1.c │ │ │ │ ├── 20041119-1.c │ │ │ │ ├── 20041211-1.c │ │ │ │ ├── 20050105-1.c │ │ │ │ ├── 20050113-1.c │ │ │ │ ├── 20050119-1.c │ │ │ │ ├── 20050122-1.c │ │ │ │ ├── 20050122-2.c │ │ │ │ ├── 20050202-1.c │ │ │ │ ├── 20050206-1.c │ │ │ │ ├── 20050210-1.c │ │ │ │ ├── 20050215-1.c │ │ │ │ ├── 20050215-2.c │ │ │ │ ├── 20050215-3.c │ │ │ │ ├── 20050217-1.c │ │ │ │ ├── 20050303-1.c │ │ │ │ ├── 20050328-1.c │ │ │ │ ├── 20050423-1.c │ │ │ │ ├── 20050510-1.c │ │ │ │ ├── 20050516-1.c │ │ │ │ ├── 20050520-1.c │ │ │ │ ├── 20050622-1.c │ │ │ │ ├── 20050721-1.c │ │ │ │ ├── 20050801-1.c │ │ │ │ ├── 20050801-2.c │ │ │ │ ├── 20051207-1.c │ │ │ │ ├── 20051216-1.c │ │ │ │ ├── 20051228-1.c │ │ │ │ ├── 20060109-1.c │ │ │ │ ├── 20060202-1.c │ │ │ │ ├── 20060208-1.c │ │ │ │ ├── 20060215-1.c │ │ │ │ ├── 20060217-1.c │ │ │ │ ├── 20060309-1.c │ │ │ │ ├── 20060419-1.c │ │ │ │ ├── 20060421-1.c │ │ │ │ ├── 20060609-1.c │ │ │ │ ├── 20060625-1.c │ │ │ │ ├── 20060823-1.c │ │ │ │ ├── 20060826-1.c │ │ │ │ ├── 20060904-1.c │ │ │ │ ├── 20061005-1.c │ │ │ │ ├── 20061214-1.c │ │ │ │ ├── 20070121.c │ │ │ │ ├── 20070129.c │ │ │ │ ├── 20070419-1.c │ │ │ │ ├── 20070501-1.c │ │ │ │ ├── 20070520-1.c │ │ │ │ ├── 20070522-1.c │ │ │ │ ├── 20070529-1.c │ │ │ │ ├── 20070529-2.c │ │ │ │ ├── 20070531-1.c │ │ │ │ ├── 20070531-2.c │ │ │ │ ├── 20070603-1.c │ │ │ │ ├── 20070603-2.c │ │ │ │ ├── 20070605-1.c │ │ │ │ ├── 20070827-1.c │ │ │ │ ├── 20070905-1.c │ │ │ │ ├── 20070906-1.c │ │ │ │ ├── 20070915-1.c │ │ │ │ ├── 20070919-1.c │ │ │ │ ├── 20071027-1.c │ │ │ │ ├── 20071102-1.c │ │ │ │ ├── 20071105-1.c │ │ │ │ ├── 20071107-1.c │ │ │ │ ├── 20071108-1.c │ │ │ │ ├── 20071114-1.c │ │ │ │ ├── 20071117-1.c │ │ │ │ ├── 20071118-1.c │ │ │ │ ├── 20071128-1.c │ │ │ │ ├── 20071203-1.c │ │ │ │ ├── 20071207-1.c │ │ │ │ ├── 20071214-1.c │ │ │ │ ├── 20080114-1.c │ │ │ │ ├── 20080124-1.c │ │ │ │ ├── 20080419-1.c │ │ │ │ ├── 20080613-1.c │ │ │ │ ├── 20080625-1.c │ │ │ │ ├── 20080628-1.c │ │ │ │ ├── 20080704-1.c │ │ │ │ ├── 20080721-1.c │ │ │ │ ├── 20080806-1.c │ │ │ │ ├── 20080812-1.c │ │ │ │ ├── 20080820-1.c │ │ │ │ ├── 20080903-1.c │ │ │ │ ├── 20080910-1.c │ │ │ │ ├── 20080922-1.c │ │ │ │ ├── 20080929-1.c │ │ │ │ ├── 20081101-1.c │ │ │ │ ├── 20081108-1.c │ │ │ │ ├── 20081108-2.c │ │ │ │ ├── 20081108-3.c │ │ │ │ ├── 20081119-1.c │ │ │ │ ├── 20081203-1.c │ │ │ │ ├── 20090107-1.c │ │ │ │ ├── 20090114-1.c │ │ │ │ ├── 20090209-1.c │ │ │ │ ├── 20090303-1.c │ │ │ │ ├── 20090303-2.c │ │ │ │ ├── 20090328-1.c │ │ │ │ ├── 20090331-1.c │ │ │ │ ├── 20090401-1.c │ │ │ │ ├── 20090518-1.c │ │ │ │ ├── 20090519-1.c │ │ │ │ ├── 20090721-1.c │ │ │ │ ├── 20090907-1.c │ │ │ │ ├── 20090917-1.c │ │ │ │ ├── 20091215-1.c │ │ │ │ ├── 20100609-1.c │ │ │ │ ├── 20100907.c │ │ │ │ ├── 20100915-1.c │ │ │ │ ├── 20101216-1.c │ │ │ │ ├── 20101217-1.c │ │ │ │ ├── 20110126-1.c │ │ │ │ ├── 20110131-1.c │ │ │ │ ├── 20110401-1.c │ │ │ │ ├── 20110902.c │ │ │ │ ├── 20110906-1.c │ │ │ │ ├── 20110913-1.c │ │ │ │ ├── 20111209-1.c │ │ │ │ ├── 20120524-1.c │ │ │ │ ├── 20120727-1.c │ │ │ │ ├── 20120727-2.c │ │ │ │ ├── 20120822-1.c │ │ │ │ ├── 20120830-1.c │ │ │ │ ├── 20120830-2.c │ │ │ │ ├── 20120913-1.c │ │ │ │ ├── 20120917-1.c │ │ │ │ ├── 20120927-1.c │ │ │ │ ├── 20121010-1.c │ │ │ │ ├── 20121027-1.c │ │ │ │ ├── 20121107-1.c │ │ │ │ ├── 20121220-1.c │ │ │ │ ├── 20140110-1.c │ │ │ │ ├── 20140213.c │ │ │ │ ├── 20140528-1.c │ │ │ │ ├── 20140723-1.c │ │ │ │ ├── 20140816-1.c │ │ │ │ ├── 20150108.c │ │ │ │ ├── 20150327.c │ │ │ │ ├── 20151204.c │ │ │ │ ├── 20160205-1.c │ │ │ │ ├── 20161124-1.c │ │ │ │ ├── 386.c │ │ │ │ ├── 86.c │ │ │ │ ├── 900116-1.c │ │ │ │ ├── 900216-1.c │ │ │ │ ├── 900313-1.c │ │ │ │ ├── 900407-1.c │ │ │ │ ├── 900516-1.c │ │ │ │ ├── 920301-1.c │ │ │ │ ├── 920409-1.c │ │ │ │ ├── 920409-2.c │ │ │ │ ├── 920410-1.c │ │ │ │ ├── 920410-2.c │ │ │ │ ├── 920411-2.c │ │ │ │ ├── 920413-1.c │ │ │ │ ├── 920415-1.c │ │ │ │ ├── 920428-1.c │ │ │ │ ├── 920428-2.c │ │ │ │ ├── 920428-3.c │ │ │ │ ├── 920428-4.c │ │ │ │ ├── 920428-5.c │ │ │ │ ├── 920428-6.c │ │ │ │ ├── 920428-7.c │ │ │ │ ├── 920501-1.c │ │ │ │ ├── 920501-10.c │ │ │ │ ├── 920501-11.c │ │ │ │ ├── 920501-12.c │ │ │ │ ├── 920501-13.c │ │ │ │ ├── 920501-15.c │ │ │ │ ├── 920501-16.c │ │ │ │ ├── 920501-17.c │ │ │ │ ├── 920501-18.c │ │ │ │ ├── 920501-19.c │ │ │ │ ├── 920501-2.c │ │ │ │ ├── 920501-20.c │ │ │ │ ├── 920501-21.c │ │ │ │ ├── 920501-22.c │ │ │ │ ├── 920501-23.c │ │ │ │ ├── 920501-3.c │ │ │ │ ├── 920501-4.c │ │ │ │ ├── 920501-6.c │ │ │ │ ├── 920501-7.c │ │ │ │ ├── 920501-8.c │ │ │ │ ├── 920501-9.c │ │ │ │ ├── 920502-1.c │ │ │ │ ├── 920502-2.c │ │ │ │ ├── 920520-1.c │ │ │ │ ├── 920521-1.c │ │ │ │ ├── 920529-1.c │ │ │ │ ├── 920608-1.c │ │ │ │ ├── 920611-2.c │ │ │ │ ├── 920615-1.c │ │ │ │ ├── 920617-1.c │ │ │ │ ├── 920617-2.c │ │ │ │ ├── 920623-1.c │ │ │ │ ├── 920624-1.c │ │ │ │ ├── 920625-1.c │ │ │ │ ├── 920625-2.c │ │ │ │ ├── 920626-1.c │ │ │ │ ├── 920701-1.c │ │ │ │ ├── 920702-1.c │ │ │ │ ├── 920706-1.c │ │ │ │ ├── 920710-2.c │ │ │ │ ├── 920711-1.c │ │ │ │ ├── 920721-1.c │ │ │ │ ├── 920723-1.c │ │ │ │ ├── 920729-1.c │ │ │ │ ├── 920806-1.c │ │ │ │ ├── 920808-1.c │ │ │ │ ├── 920809-1.c │ │ │ │ ├── 920817-1.c │ │ │ │ ├── 920820-1.c │ │ │ │ ├── 920821-1.c │ │ │ │ ├── 920821-2.c │ │ │ │ ├── 920825-1.c │ │ │ │ ├── 920825-2.c │ │ │ │ ├── 920826-1.c │ │ │ │ ├── 920828-1.c │ │ │ │ ├── 920829-1.c │ │ │ │ ├── 920831-1.c │ │ │ │ ├── 920902-1.c │ │ │ │ ├── 920909-1.c │ │ │ │ ├── 920917-1.c │ │ │ │ ├── 920928-1.c │ │ │ │ ├── 920928-2.c │ │ │ │ ├── 920928-3.c │ │ │ │ ├── 920928-4.c │ │ │ │ ├── 920928-5.c │ │ │ │ ├── 920928-6.c │ │ │ │ ├── 921004-1.c │ │ │ │ ├── 921011-1.c │ │ │ │ ├── 921011-2.c │ │ │ │ ├── 921012-1.c │ │ │ │ ├── 921012-2.c │ │ │ │ ├── 921013-1.c │ │ │ │ ├── 921019-1.c │ │ │ │ ├── 921021-1.c │ │ │ │ ├── 921024-1.c │ │ │ │ ├── 921026-1.c │ │ │ │ ├── 921103-1.c │ │ │ │ ├── 921109-1.c │ │ │ │ ├── 921111-1.c │ │ │ │ ├── 921116-2.c │ │ │ │ ├── 921118-1.c │ │ │ │ ├── 921126-1.c │ │ │ │ ├── 921202-1.c │ │ │ │ ├── 921202-2.c │ │ │ │ ├── 921203-1.c │ │ │ │ ├── 921203-2.c │ │ │ │ ├── 921206-1.c │ │ │ │ ├── 921227-1.c │ │ │ │ ├── 930109-1.c │ │ │ │ ├── 930109-2.c │ │ │ │ ├── 930111-1.c │ │ │ │ ├── 930117-1.c │ │ │ │ ├── 930118-1.c │ │ │ │ ├── 930120-1.c │ │ │ │ ├── 930126-1.c │ │ │ │ ├── 930210-1.c │ │ │ │ ├── 930217-1.c │ │ │ │ ├── 930222-1.c │ │ │ │ ├── 930325-1.c │ │ │ │ ├── 930326-1.c │ │ │ │ ├── 930411-1.c │ │ │ │ ├── 930421-1.c │ │ │ │ ├── 930427-2.c │ │ │ │ ├── 930503-1.c │ │ │ │ ├── 930503-2.c │ │ │ │ ├── 930506-1.c │ │ │ │ ├── 930506-2.c │ │ │ │ ├── 930510-1.c │ │ │ │ ├── 930513-1.c │ │ │ │ ├── 930513-2.c │ │ │ │ ├── 930513-3.c │ │ │ │ ├── 930523-1.c │ │ │ │ ├── 930525-1.c │ │ │ │ ├── 930527-1.c │ │ │ │ ├── 930529-1.c │ │ │ │ ├── 930530-1.c │ │ │ │ ├── 930602-1.c │ │ │ │ ├── 930603-1.c │ │ │ │ ├── 930607-1.c │ │ │ │ ├── 930611-1.c │ │ │ │ ├── 930618-1.c │ │ │ │ ├── 930621-1.c │ │ │ │ ├── 930623-1.c │ │ │ │ ├── 930702-1.c │ │ │ │ ├── 930926-1.c │ │ │ │ ├── 930927-1.c │ │ │ │ ├── 931003-1.c │ │ │ │ ├── 931004-1.c │ │ │ │ ├── 931013-1.c │ │ │ │ ├── 931013-2.c │ │ │ │ ├── 931013-3.c │ │ │ │ ├── 931018-1.c │ │ │ │ ├── 931031-1.c │ │ │ │ ├── 931102-1.c │ │ │ │ ├── 931102-2.c │ │ │ │ ├── 931203-1.c │ │ │ │ ├── 940611-1.c │ │ │ │ ├── 940712-1.c │ │ │ │ ├── 940718-1.c │ │ │ │ ├── 941014-1.c │ │ │ │ ├── 941014-2.c │ │ │ │ ├── 941014-3.c │ │ │ │ ├── 941014-4.c │ │ │ │ ├── 941019-1.c │ │ │ │ ├── 941111-1.c │ │ │ │ ├── 941113-1.c │ │ │ │ ├── 950122-1.c │ │ │ │ ├── 950124-1.c │ │ │ │ ├── 950221-1.c │ │ │ │ ├── 950329-1.c │ │ │ │ ├── 950512-1.c │ │ │ │ ├── 950530-1.c │ │ │ │ ├── 950607-1.c │ │ │ │ ├── 950610-1.c │ │ │ │ ├── 950612-1.c │ │ │ │ ├── 950613-1.c │ │ │ │ ├── 950618-1.c │ │ │ │ ├── 950719-1.c │ │ │ │ ├── 950729-1.c │ │ │ │ ├── 950816-1.c │ │ │ │ ├── 950816-2.c │ │ │ │ ├── 950816-3.c │ │ │ │ ├── 950910-1.c │ │ │ │ ├── 950919-1.c │ │ │ │ ├── 950921-1.c │ │ │ │ ├── 950922-1.c │ │ │ │ ├── 951004-1.c │ │ │ │ ├── 951106-1.c │ │ │ │ ├── 951116-1.c │ │ │ │ ├── 951128-1.c │ │ │ │ ├── 951220-1.c │ │ │ │ ├── 951222-1.c │ │ │ │ ├── 960106-1.c │ │ │ │ ├── 960130-1.c │ │ │ │ ├── 960201-1.c │ │ │ │ ├── 960218-1.c │ │ │ │ ├── 960220-1.c │ │ │ │ ├── 960221-1.c │ │ │ │ ├── 960319-1.c │ │ │ │ ├── 960514-1.c │ │ │ │ ├── 960704-1.c │ │ │ │ ├── 960829-1.c │ │ │ │ ├── 961004-1.c │ │ │ │ ├── 961010-1.c │ │ │ │ ├── 961019-1.c │ │ │ │ ├── 961031-1.c │ │ │ │ ├── 961126-1.c │ │ │ │ ├── 961203-1.c │ │ │ │ ├── 970206-1.c │ │ │ │ ├── 970214-1.c │ │ │ │ ├── 980329-1.c │ │ │ │ ├── 980408-1.c │ │ │ │ ├── 980504-1.c │ │ │ │ ├── 980506-1.c │ │ │ │ ├── 980506-2.c │ │ │ │ ├── 980511-1.c │ │ │ │ ├── 980701-1.c │ │ │ │ ├── 980706-1.c │ │ │ │ ├── 980726-1.c │ │ │ │ ├── 980729-1.c │ │ │ │ ├── 980816-1.c │ │ │ │ ├── 980821-1.c │ │ │ │ ├── 980825-1.c │ │ │ │ ├── 981001-1.c │ │ │ │ ├── 981001-2.c │ │ │ │ ├── 981001-3.c │ │ │ │ ├── 981001-4.c │ │ │ │ ├── 981006-1.c │ │ │ │ ├── 981007-1.c │ │ │ │ ├── 981107-1.c │ │ │ │ ├── 981223-1.c │ │ │ │ ├── 990107-1.c │ │ │ │ ├── 990117-1.c │ │ │ │ ├── 990203-1.c │ │ │ │ ├── 990517-1.c │ │ │ │ ├── 990519-1.c │ │ │ │ ├── 990523-1.c │ │ │ │ ├── 990527-1.c │ │ │ │ ├── 990617-1.c │ │ │ │ ├── 990625-1.c │ │ │ │ ├── 990625-2.c │ │ │ │ ├── 990801-1.c │ │ │ │ ├── 990801-2.c │ │ │ │ ├── 990829-1.c │ │ │ │ ├── 990913-1.c │ │ │ │ ├── 990928-1.c │ │ │ │ ├── 991008-1.c │ │ │ │ ├── 991026-1.c │ │ │ │ ├── 991026-2.c │ │ │ │ ├── 991127-1.c │ │ │ │ ├── 991202-1.c │ │ │ │ ├── 991208-1.c │ │ │ │ ├── 991213-1.c │ │ │ │ ├── 991213-2.c │ │ │ │ ├── 991213-3.c │ │ │ │ ├── 991214-1.c │ │ │ │ ├── 991214-2.c │ │ │ │ ├── 991229-1.c │ │ │ │ ├── 991229-2.c │ │ │ │ ├── 991229-3.c │ │ │ │ ├── BUG1.c │ │ │ │ ├── BUG11.c │ │ │ │ ├── BUG12.c │ │ │ │ ├── BUG13.c │ │ │ │ ├── BUG16.c │ │ │ │ ├── BUG17.c │ │ │ │ ├── BUG18.c │ │ │ │ ├── BUG2.c │ │ │ │ ├── BUG21.c │ │ │ │ ├── BUG22.c │ │ │ │ ├── BUG23.c │ │ │ │ ├── BUG24.c │ │ │ │ ├── BUG25.c │ │ │ │ ├── BUG3.c │ │ │ │ ├── BUG4.c │ │ │ │ ├── BUG5.c │ │ │ │ ├── BUG6.c │ │ │ │ ├── DFcmp.c │ │ │ │ ├── HIcmp.c │ │ │ │ ├── HIset.c │ │ │ │ ├── PYRBUG.c │ │ │ │ ├── QIcmp.c │ │ │ │ ├── QIset.c │ │ │ │ ├── SFset.c │ │ │ │ ├── SIcmp.c │ │ │ │ ├── SIset.c │ │ │ │ ├── UHIcmp.c │ │ │ │ ├── UQIcmp.c │ │ │ │ ├── USIcmp.c │ │ │ │ ├── a.c │ │ │ │ ├── a1.c │ │ │ │ ├── a3.c │ │ │ │ ├── aa.c │ │ │ │ ├── aaa.c │ │ │ │ ├── abs.c │ │ │ │ ├── ac.c │ │ │ │ ├── acc.c │ │ │ │ ├── acc1.c │ │ │ │ ├── add.c │ │ │ │ ├── add386.c │ │ │ │ ├── addcc.c │ │ │ │ ├── andm.c │ │ │ │ ├── andmem.c │ │ │ │ ├── andn.c │ │ │ │ ├── andok.c │ │ │ │ ├── andsi.c │ │ │ │ ├── andsparc.c │ │ │ │ ├── aos.c │ │ │ │ ├── arr.c │ │ │ │ ├── as.c │ │ │ │ ├── ase.c │ │ │ │ ├── asmgoto-1.c │ │ │ │ ├── b.c │ │ │ │ ├── b1.c │ │ │ │ ├── b2.c │ │ │ │ ├── b3.c │ │ │ │ ├── b88.c │ │ │ │ ├── bad.c │ │ │ │ ├── band.c │ │ │ │ ├── bb0.c │ │ │ │ ├── bb1.c │ │ │ │ ├── bbb.c │ │ │ │ ├── bc.c │ │ │ │ ├── bcopy-1.c │ │ │ │ ├── bcopy.c │ │ │ │ ├── bf.c │ │ │ │ ├── bfins.c │ │ │ │ ├── bfx.c │ │ │ │ ├── bge.c │ │ │ │ ├── bit.c │ │ │ │ ├── bitf.c │ │ │ │ ├── bitw.c │ │ │ │ ├── blk.c │ │ │ │ ├── bt.c │ │ │ │ ├── bt386.c │ │ │ │ ├── bug.c │ │ │ │ ├── bugc.c │ │ │ │ ├── builtin_constant_p.c │ │ │ │ ├── builtin_unreachable-1.c │ │ │ │ ├── buns.c │ │ │ │ ├── bx.c │ │ │ │ ├── c.c │ │ │ │ ├── c1.c │ │ │ │ ├── c2.c │ │ │ │ ├── call.c │ │ │ │ ├── call386.c │ │ │ │ ├── callind.c │ │ │ │ ├── calls-void.c │ │ │ │ ├── calls.c │ │ │ │ ├── cc.c │ │ │ │ ├── charmtst.c │ │ │ │ ├── cmb.c │ │ │ │ ├── cmp.c │ │ │ │ ├── cmpdi-1.c │ │ │ │ ├── cmphi.c │ │ │ │ ├── cmpsi386.c │ │ │ │ ├── cmul.c │ │ │ │ ├── cn1.c │ │ │ │ ├── comb.c │ │ │ │ ├── combine-hang.c │ │ │ │ ├── compile.exp │ │ │ │ ├── complex-1.c │ │ │ │ ├── complex-2.c │ │ │ │ ├── complex-3.c │ │ │ │ ├── complex-4.c │ │ │ │ ├── complex-5.c │ │ │ │ ├── complex-6.c │ │ │ │ ├── compound-literal-1.c │ │ │ │ ├── compound-literal-2.c │ │ │ │ ├── compound-literal-3.c │ │ │ │ ├── consec.c │ │ │ │ ├── const-high-part.c │ │ │ │ ├── const.c │ │ │ │ ├── conv.c │ │ │ │ ├── conv_tst.c │ │ │ │ ├── cp.c │ │ │ │ ├── cpp-1.c │ │ │ │ ├── cpp-2.c │ │ │ │ ├── csebug.c │ │ │ │ ├── cvt.c │ │ │ │ ├── d.c │ │ │ │ ├── dbl_parm.c │ │ │ │ ├── dblbug.c │ │ │ │ ├── ddd.c │ │ │ │ ├── dead.c │ │ │ │ ├── debugvlafunction-1.c │ │ │ │ ├── delay.c │ │ │ │ ├── di.c │ │ │ │ ├── dic.c │ │ │ │ ├── dilayout.c │ │ │ │ ├── dimove.c │ │ │ │ ├── dimul.c │ │ │ │ ├── div.c │ │ │ │ ├── divdf.c │ │ │ │ ├── dll.c │ │ │ │ ├── dm.c │ │ │ │ ├── dshift.c │ │ │ │ ├── e.c │ │ │ │ ├── ex.c │ │ │ │ ├── ext.c │ │ │ │ ├── f1.c │ │ │ │ ├── f2.c │ │ │ │ ├── fdmul.c │ │ │ │ ├── fix-trunc-mem-1.c │ │ │ │ ├── flo.c │ │ │ │ ├── float.c │ │ │ │ ├── flt_const.c │ │ │ │ ├── fnul.c │ │ │ │ ├── foo.c │ │ │ │ ├── forgetcc.c │ │ │ │ ├── fq.c │ │ │ │ ├── funcptr-1.c │ │ │ │ ├── g.c │ │ │ │ ├── gen_tst.c │ │ │ │ ├── glob.c │ │ │ │ ├── goto-1.c │ │ │ │ ├── gronk.c │ │ │ │ ├── hi.c │ │ │ │ ├── hibug.c │ │ │ │ ├── i++.c │ │ │ │ ├── i.c │ │ │ │ ├── ic.c │ │ │ │ ├── icfmatch.c │ │ │ │ ├── icmp.c │ │ │ │ ├── ifreg.c │ │ │ │ ├── iftrap-1.c │ │ │ │ ├── iftrap-2.c │ │ │ │ ├── iftrap-3.c │ │ │ │ ├── imm.c │ │ │ │ ├── init-1.c │ │ │ │ ├── init-2.c │ │ │ │ ├── init-3.c │ │ │ │ ├── inline-1.c │ │ │ │ ├── isinf.c │ │ │ │ ├── jmp.c │ │ │ │ ├── jumptab.c │ │ │ │ ├── l.c │ │ │ │ ├── labels-1.c │ │ │ │ ├── labels-2.c │ │ │ │ ├── labels-3.c │ │ │ │ ├── layout.c │ │ │ │ ├── lbug.c │ │ │ │ ├── libcall-1.c │ │ │ │ ├── limits-blockid.c │ │ │ │ ├── limits-caselabels.c │ │ │ │ ├── limits-declparen.c │ │ │ │ ├── limits-enumconst.c │ │ │ │ ├── limits-exprparen.c │ │ │ │ ├── limits-externalid.c │ │ │ │ ├── limits-externdecl.c │ │ │ │ ├── limits-fnargs.c │ │ │ │ ├── limits-fndefn.c │ │ │ │ ├── limits-idexternal.c │ │ │ │ ├── limits-idinternal.c │ │ │ │ ├── limits-pointer.c │ │ │ │ ├── limits-stringlit.c │ │ │ │ ├── limits-structmem.c │ │ │ │ ├── limits-structnest.c │ │ │ │ ├── ll1.c │ │ │ │ ├── llbug.c │ │ │ │ ├── lll.c │ │ │ │ ├── load8.c │ │ │ │ ├── loadhicc.c │ │ │ │ ├── loop-1.c │ │ │ │ ├── loop386.c │ │ │ │ ├── lop.c │ │ │ │ ├── m1.c │ │ │ │ ├── m2.c │ │ │ │ ├── m5.c │ │ │ │ ├── m68.c │ │ │ │ ├── m68k-byte-addr.c │ │ │ │ ├── mangle-1.c │ │ │ │ ├── mbyte.c │ │ │ │ ├── mchar.c │ │ │ │ ├── mcmp.c │ │ │ │ ├── mdouble.c │ │ │ │ ├── memcpy-1.c │ │ │ │ ├── memcpy-2.c │ │ │ │ ├── memtst.c │ │ │ │ ├── mipscop-1.c │ │ │ │ ├── mipscop-2.c │ │ │ │ ├── mipscop-3.c │ │ │ │ ├── mipscop-4.c │ │ │ │ ├── miscomp.c │ │ │ │ ├── mm.c │ │ │ │ ├── mod.c │ │ │ │ ├── modcc.c │ │ │ │ ├── move.c │ │ │ │ ├── move_qhi.c │ │ │ │ ├── mregtst.c │ │ │ │ ├── msp.c │ │ │ │ ├── mtst.c │ │ │ │ ├── mu.c │ │ │ │ ├── mul.c │ │ │ │ ├── mword.c │ │ │ │ ├── mword1.c │ │ │ │ ├── n.c │ │ │ │ ├── n1.c │ │ │ │ ├── nand.c │ │ │ │ ├── neg.c │ │ │ │ ├── nested-1.c │ │ │ │ ├── nested-2.c │ │ │ │ ├── o.c │ │ │ │ ├── omit.c │ │ │ │ ├── opout.c │ │ │ │ ├── opt.c │ │ │ │ ├── or.c │ │ │ │ ├── or386.c │ │ │ │ ├── p.c │ │ │ │ ├── packed-1.c │ │ │ │ ├── parms.c │ │ │ │ ├── pass.c │ │ │ │ ├── pc44485.c │ │ │ │ ├── pmt.c │ │ │ │ ├── poor.c │ │ │ │ ├── pp.c │ │ │ │ ├── pr12517.c │ │ │ │ ├── pr12578.c │ │ │ │ ├── pr12899.c │ │ │ │ ├── pr13066-1.c │ │ │ │ ├── pr13889.c │ │ │ │ ├── pr14692.c │ │ │ │ ├── pr14730.c │ │ │ │ ├── pr15245.c │ │ │ │ ├── pr16461.c │ │ │ │ ├── pr16566-1.c │ │ │ │ ├── pr16566-2.c │ │ │ │ ├── pr16566-3.c │ │ │ │ ├── pr16808.c │ │ │ │ ├── pr17119.c │ │ │ │ ├── pr17273.c │ │ │ │ ├── pr17397.c │ │ │ │ ├── pr17407.c │ │ │ │ ├── pr17408.c │ │ │ │ ├── pr17529.c │ │ │ │ ├── pr17558.c │ │ │ │ ├── pr17656.c │ │ │ │ ├── pr17906.c │ │ │ │ ├── pr17913.c │ │ │ │ ├── pr18291.c │ │ │ │ ├── pr18299-1.c │ │ │ │ ├── pr18712.c │ │ │ │ ├── pr18903.c │ │ │ │ ├── pr19080.c │ │ │ │ ├── pr19121.c │ │ │ │ ├── pr19357.c │ │ │ │ ├── pr19736.c │ │ │ │ ├── pr19853.c │ │ │ │ ├── pr20203.c │ │ │ │ ├── pr20412.c │ │ │ │ ├── pr20539-1.c │ │ │ │ ├── pr20583.c │ │ │ │ ├── pr20928.c │ │ │ │ ├── pr21021.c │ │ │ │ ├── pr21030.c │ │ │ │ ├── pr21293.c │ │ │ │ ├── pr21356.c │ │ │ │ ├── pr21380.c │ │ │ │ ├── pr21532.c │ │ │ │ ├── pr21562.c │ │ │ │ ├── pr21638.c │ │ │ │ ├── pr21728.c │ │ │ │ ├── pr21761.c │ │ │ │ ├── pr21839.c │ │ │ │ ├── pr21840.c │ │ │ │ ├── pr22013-1.c │ │ │ │ ├── pr22269.c │ │ │ │ ├── pr22379.c │ │ │ │ ├── pr22398.c │ │ │ │ ├── pr22422.c │ │ │ │ ├── pr22531.c │ │ │ │ ├── pr22589-1.c │ │ │ │ ├── pr23233-1.c │ │ │ │ ├── pr23237.c │ │ │ │ ├── pr23435.c │ │ │ │ ├── pr23445.c │ │ │ │ ├── pr23476.c │ │ │ │ ├── pr23929.c │ │ │ │ ├── pr23944.c │ │ │ │ ├── pr23946.c │ │ │ │ ├── pr23960.c │ │ │ │ ├── pr24227.c │ │ │ │ ├── pr24883.c │ │ │ │ ├── pr24930.c │ │ │ │ ├── pr25224.c │ │ │ │ ├── pr25310.c │ │ │ │ ├── pr25311.c │ │ │ │ ├── pr25483.c │ │ │ │ ├── pr25513.c │ │ │ │ ├── pr25514.c │ │ │ │ ├── pr25860.c │ │ │ │ ├── pr25861.c │ │ │ │ ├── pr26213.c │ │ │ │ ├── pr26255.c │ │ │ │ ├── pr26425.c │ │ │ │ ├── pr26622.c │ │ │ │ ├── pr26626.c │ │ │ │ ├── pr26725.c │ │ │ │ ├── pr26781-1.c │ │ │ │ ├── pr26781-2.c │ │ │ │ ├── pr26833.c │ │ │ │ ├── pr26840.c │ │ │ │ ├── pr27087.c │ │ │ │ ├── pr27282.c │ │ │ │ ├── pr27341-1.c │ │ │ │ ├── pr27341-2.c │ │ │ │ ├── pr27373.c │ │ │ │ ├── pr27528.c │ │ │ │ ├── pr27571.c │ │ │ │ ├── pr27863.c │ │ │ │ ├── pr27889.c │ │ │ │ ├── pr27907.c │ │ │ │ ├── pr28489.c │ │ │ │ ├── pr28675.c │ │ │ │ ├── pr28776-1.c │ │ │ │ ├── pr28776-2.c │ │ │ │ ├── pr28865.c │ │ │ │ ├── pr28905.c │ │ │ │ ├── pr29128.c │ │ │ │ ├── pr29201.c │ │ │ │ ├── pr29241.c │ │ │ │ ├── pr29250.c │ │ │ │ ├── pr29945.c │ │ │ │ ├── pr30132.c │ │ │ │ ├── pr30311.c │ │ │ │ ├── pr30338.c │ │ │ │ ├── pr30433.c │ │ │ │ ├── pr30564-1.c │ │ │ │ ├── pr30564-2.c │ │ │ │ ├── pr30984.c │ │ │ │ ├── pr31034.c │ │ │ │ ├── pr31345-1.c │ │ │ │ ├── pr31541.c │ │ │ │ ├── pr31703.c │ │ │ │ ├── pr31710.c │ │ │ │ ├── pr31797.c │ │ │ │ ├── pr31953.c │ │ │ │ ├── pr32139.c │ │ │ │ ├── pr32169.c │ │ │ │ ├── pr32349.c │ │ │ │ ├── pr32355.c │ │ │ │ ├── pr32372.c │ │ │ │ ├── pr32399.c │ │ │ │ ├── pr32453.c │ │ │ │ ├── pr32482.c │ │ │ │ ├── pr32571.c │ │ │ │ ├── pr32584.c │ │ │ │ ├── pr32606.c │ │ │ │ ├── pr32780.c │ │ │ │ ├── pr32796.c │ │ │ │ ├── pr32919.c │ │ │ │ ├── pr32920.c │ │ │ │ ├── pr32988.c │ │ │ │ ├── pr33122.c │ │ │ │ ├── pr33133.c │ │ │ │ ├── pr33146.c │ │ │ │ ├── pr33166.c │ │ │ │ ├── pr33173.c │ │ │ │ ├── pr33382.c │ │ │ │ ├── pr33614.c │ │ │ │ ├── pr33617.c │ │ │ │ ├── pr33641.c │ │ │ │ ├── pr33855.c │ │ │ │ ├── pr34029-1.c │ │ │ │ ├── pr34029-2.c │ │ │ │ ├── pr34030.c │ │ │ │ ├── pr34091.c │ │ │ │ ├── pr34093.c │ │ │ │ ├── pr34113.c │ │ │ │ ├── pr34127.c │ │ │ │ ├── pr34138.c │ │ │ │ ├── pr34334.c │ │ │ │ ├── pr34448.c │ │ │ │ ├── pr34458.c │ │ │ │ ├── pr34648.c │ │ │ │ ├── pr34688.c │ │ │ │ ├── pr34808.c │ │ │ │ ├── pr34856.c │ │ │ │ ├── pr34885.c │ │ │ │ ├── pr34966.c │ │ │ │ ├── pr34993.c │ │ │ │ ├── pr35006.c │ │ │ │ ├── pr35043.c │ │ │ │ ├── pr35171.c │ │ │ │ ├── pr35318.c │ │ │ │ ├── pr35431.c │ │ │ │ ├── pr35432.c │ │ │ │ ├── pr35468.c │ │ │ │ ├── pr35492.c │ │ │ │ ├── pr35595.c │ │ │ │ ├── pr35607.c │ │ │ │ ├── pr35760.c │ │ │ │ ├── pr35869.c │ │ │ │ ├── pr36125.c │ │ │ │ ├── pr36141.c │ │ │ │ ├── pr36154.c │ │ │ │ ├── pr36172.c │ │ │ │ ├── pr36238.c │ │ │ │ ├── pr36245.c │ │ │ │ ├── pr36666.c │ │ │ │ ├── pr36817.c │ │ │ │ ├── pr36988.c │ │ │ │ ├── pr37026.c │ │ │ │ ├── pr37056.c │ │ │ │ ├── pr37078.c │ │ │ │ ├── pr37207.c │ │ │ │ ├── pr37258.c │ │ │ │ ├── pr37285.c │ │ │ │ ├── pr37305.c │ │ │ │ ├── pr37327.c │ │ │ │ ├── pr37341.c │ │ │ │ ├── pr37380.c │ │ │ │ ├── pr37381.c │ │ │ │ ├── pr37382.c │ │ │ │ ├── pr37387.c │ │ │ │ ├── pr37395.c │ │ │ │ ├── pr37418-1.c │ │ │ │ ├── pr37418-2.c │ │ │ │ ├── pr37418-3.c │ │ │ │ ├── pr37418-4.c │ │ │ │ ├── pr37432.c │ │ │ │ ├── pr37433-1.c │ │ │ │ ├── pr37433.c │ │ │ │ ├── pr37483.c │ │ │ │ ├── pr37617.c │ │ │ │ ├── pr37662.c │ │ │ │ ├── pr37664.c │ │ │ │ ├── pr37669-2.c │ │ │ │ ├── pr37669.c │ │ │ │ ├── pr37713.c │ │ │ │ ├── pr37742-3.c │ │ │ │ ├── pr37742.c │ │ │ │ ├── pr37878.c │ │ │ │ ├── pr37913.c │ │ │ │ ├── pr37955.c │ │ │ │ ├── pr37976.c │ │ │ │ ├── pr37991.c │ │ │ │ ├── pr38123.c │ │ │ │ ├── pr38343-2.c │ │ │ │ ├── pr38343.c │ │ │ │ ├── pr38359.c │ │ │ │ ├── pr38360.c │ │ │ │ ├── pr38428.c │ │ │ │ ├── pr38505.c │ │ │ │ ├── pr38554.c │ │ │ │ ├── pr38564.c │ │ │ │ ├── pr38590-1.c │ │ │ │ ├── pr38590-2.c │ │ │ │ ├── pr38621.c │ │ │ │ ├── pr38661-1.c │ │ │ │ ├── pr38661.c │ │ │ │ ├── pr38752.c │ │ │ │ ├── pr38771.c │ │ │ │ ├── pr38789.c │ │ │ │ ├── pr38807.c │ │ │ │ ├── pr38857.c │ │ │ │ ├── pr38926.c │ │ │ │ ├── pr39041.c │ │ │ │ ├── pr39202.c │ │ │ │ ├── pr39360.c │ │ │ │ ├── pr39394.c │ │ │ │ ├── pr39423-1.c │ │ │ │ ├── pr39423-2.c │ │ │ │ ├── pr39614-1.c │ │ │ │ ├── pr39614-2.c │ │ │ │ ├── pr39614-3.c │ │ │ │ ├── pr39614-4.c │ │ │ │ ├── pr39614-5.c │ │ │ │ ├── pr39636.c │ │ │ │ ├── pr39648.c │ │ │ │ ├── pr39673-1.c │ │ │ │ ├── pr39673-2.c │ │ │ │ ├── pr39779.c │ │ │ │ ├── pr39824.c │ │ │ │ ├── pr39834.c │ │ │ │ ├── pr39845.c │ │ │ │ ├── pr39886.c │ │ │ │ ├── pr39928-1.c │ │ │ │ ├── pr39928-2.c │ │ │ │ ├── pr39937.c │ │ │ │ ├── pr39941.c │ │ │ │ ├── pr39943.c │ │ │ │ ├── pr39983.c │ │ │ │ ├── pr39999.c │ │ │ │ ├── pr40023.c │ │ │ │ ├── pr40026.c │ │ │ │ ├── pr40035.c │ │ │ │ ├── pr40080.c │ │ │ │ ├── pr40204.c │ │ │ │ ├── pr40233.c │ │ │ │ ├── pr40252.c │ │ │ │ ├── pr40291.c │ │ │ │ ├── pr40321.c │ │ │ │ ├── pr40351.c │ │ │ │ ├── pr40432.c │ │ │ │ ├── pr40556.c │ │ │ │ ├── pr40570.c │ │ │ │ ├── pr40582.c │ │ │ │ ├── pr40640.c │ │ │ │ ├── pr40676.c │ │ │ │ ├── pr40692.c │ │ │ │ ├── pr40753.c │ │ │ │ ├── pr40797.c │ │ │ │ ├── pr40964.c │ │ │ │ ├── pr41006-1.c │ │ │ │ ├── pr41006-2.c │ │ │ │ ├── pr41016.c │ │ │ │ ├── pr41101.c │ │ │ │ ├── pr41163.c │ │ │ │ ├── pr41181.c │ │ │ │ ├── pr41182-1.c │ │ │ │ ├── pr41282.c │ │ │ │ ├── pr41469.c │ │ │ │ ├── pr41634.c │ │ │ │ ├── pr41646.c │ │ │ │ ├── pr41661.c │ │ │ │ ├── pr41679.c │ │ │ │ ├── pr41728.c │ │ │ │ ├── pr41987.c │ │ │ │ ├── pr42025-1.c │ │ │ │ ├── pr42025-2.c │ │ │ │ ├── pr42049.c │ │ │ │ ├── pr42164.c │ │ │ │ ├── pr42196-1.c │ │ │ │ ├── pr42196-2.c │ │ │ │ ├── pr42196-3.c │ │ │ │ ├── pr42234.c │ │ │ │ ├── pr42237.c │ │ │ │ ├── pr42299.c │ │ │ │ ├── pr42347.c │ │ │ │ ├── pr42398.c │ │ │ │ ├── pr42559.c │ │ │ │ ├── pr42632.c │ │ │ │ ├── pr42703.c │ │ │ │ ├── pr42705.c │ │ │ │ ├── pr42708-1.c │ │ │ │ ├── pr42716.c │ │ │ │ ├── pr42717.c │ │ │ │ ├── pr42730.c │ │ │ │ ├── pr42749.c │ │ │ │ ├── pr42927.c │ │ │ │ ├── pr42956.c │ │ │ │ ├── pr42998.c │ │ │ │ ├── pr43066.c │ │ │ │ ├── pr43164.c │ │ │ │ ├── pr43186.c │ │ │ │ ├── pr43188.c │ │ │ │ ├── pr43191.c │ │ │ │ ├── pr43255.c │ │ │ │ ├── pr43288.c │ │ │ │ ├── pr43367.c │ │ │ │ ├── pr43415.c │ │ │ │ ├── pr43417.c │ │ │ │ ├── pr43614.c │ │ │ │ ├── pr43635.c │ │ │ │ ├── pr43636.c │ │ │ │ ├── pr43661.c │ │ │ │ ├── pr43679.c │ │ │ │ ├── pr43791.c │ │ │ │ ├── pr43845.c │ │ │ │ ├── pr44030.c │ │ │ │ ├── pr44038.c │ │ │ │ ├── pr44043.c │ │ │ │ ├── pr44063.c │ │ │ │ ├── pr44119.c │ │ │ │ ├── pr44197.c │ │ │ │ ├── pr44246.c │ │ │ │ ├── pr44686.c │ │ │ │ ├── pr44687.c │ │ │ │ ├── pr44707.c │ │ │ │ ├── pr44784.c │ │ │ │ ├── pr44788.c │ │ │ │ ├── pr44831.c │ │ │ │ ├── pr44891.c │ │ │ │ ├── pr44937.c │ │ │ │ ├── pr44941.c │ │ │ │ ├── pr44946.c │ │ │ │ ├── pr44988.c │ │ │ │ ├── pr45047.c │ │ │ │ ├── pr45059.c │ │ │ │ ├── pr45109.c │ │ │ │ ├── pr45182.c │ │ │ │ ├── pr45412.c │ │ │ │ ├── pr45535.c │ │ │ │ ├── pr45728.c │ │ │ │ ├── pr45771.c │ │ │ │ ├── pr45876.c │ │ │ │ ├── pr45919.c │ │ │ │ ├── pr45969-1.c │ │ │ │ ├── pr46002.c │ │ │ │ ├── pr46034.c │ │ │ │ ├── pr46107.c │ │ │ │ ├── pr46248.c │ │ │ │ ├── pr46360.c │ │ │ │ ├── pr46388.c │ │ │ │ ├── pr46461.c │ │ │ │ ├── pr46534.c │ │ │ │ ├── pr46547-1.c │ │ │ │ ├── pr46637.c │ │ │ │ ├── pr46832.c │ │ │ │ ├── pr46856.c │ │ │ │ ├── pr46866.c │ │ │ │ ├── pr46883.c │ │ │ │ ├── pr46934.c │ │ │ │ ├── pr47140.c │ │ │ │ ├── pr47141.c │ │ │ │ ├── pr47150.c │ │ │ │ ├── pr47157.c │ │ │ │ ├── pr47265.c │ │ │ │ ├── pr47364-1.c │ │ │ │ ├── pr47364-2.c │ │ │ │ ├── pr47427.c │ │ │ │ ├── pr47428.c │ │ │ │ ├── pr47967.c │ │ │ │ ├── pr48136.c │ │ │ │ ├── pr48161.c │ │ │ │ ├── pr48305.c │ │ │ │ ├── pr48335-1.c │ │ │ │ ├── pr48381.c │ │ │ │ ├── pr48517.c │ │ │ │ ├── pr48596.c │ │ │ │ ├── pr48641.c │ │ │ │ ├── pr48734.c │ │ │ │ ├── pr48742.c │ │ │ │ ├── pr48767.c │ │ │ │ ├── pr48929.c │ │ │ │ ├── pr49029.c │ │ │ │ ├── pr49049.c │ │ │ │ ├── pr49145.c │ │ │ │ ├── pr49163.c │ │ │ │ ├── pr49206.c │ │ │ │ ├── pr49220.c │ │ │ │ ├── pr49238.c │ │ │ │ ├── pr49474.c │ │ │ │ ├── pr49710.c │ │ │ │ ├── pr49735.c │ │ │ │ ├── pr50009.c │ │ │ │ ├── pr50380.c │ │ │ │ ├── pr50565-1.c │ │ │ │ ├── pr50565-2.c │ │ │ │ ├── pr50650.c │ │ │ │ ├── pr51069.c │ │ │ │ ├── pr51077.c │ │ │ │ ├── pr51246.c │ │ │ │ ├── pr51247.c │ │ │ │ ├── pr51354.c │ │ │ │ ├── pr51495.c │ │ │ │ ├── pr51694.c │ │ │ │ ├── pr51761.c │ │ │ │ ├── pr51767.c │ │ │ │ ├── pr51856.c │ │ │ │ ├── pr52073.c │ │ │ │ ├── pr52074.c │ │ │ │ ├── pr52092.c │ │ │ │ ├── pr52113.c │ │ │ │ ├── pr52115.c │ │ │ │ ├── pr52175.c │ │ │ │ ├── pr52255.c │ │ │ │ ├── pr52306.c │ │ │ │ ├── pr52375.c │ │ │ │ ├── pr52437.c │ │ │ │ ├── pr52533.c │ │ │ │ ├── pr52555.c │ │ │ │ ├── pr52714.c │ │ │ │ ├── pr52750.c │ │ │ │ ├── pr52773.c │ │ │ │ ├── pr52891-1.c │ │ │ │ ├── pr52891-2.c │ │ │ │ ├── pr52979-1.c │ │ │ │ ├── pr53058.c │ │ │ │ ├── pr53163.c │ │ │ │ ├── pr53187.c │ │ │ │ ├── pr53226.c │ │ │ │ ├── pr53409.c │ │ │ │ ├── pr53410-1.c │ │ │ │ ├── pr53410-2.c │ │ │ │ ├── pr53411.c │ │ │ │ ├── pr53418-1.c │ │ │ │ ├── pr53418-2.c │ │ │ │ ├── pr53495.c │ │ │ │ ├── pr53519.c │ │ │ │ ├── pr53748.c │ │ │ │ ├── pr53886.c │ │ │ │ ├── pr54103-1.c │ │ │ │ ├── pr54103-2.c │ │ │ │ ├── pr54103-3.c │ │ │ │ ├── pr54103-4.c │ │ │ │ ├── pr54103-5.c │ │ │ │ ├── pr54103-6.c │ │ │ │ ├── pr54321.c │ │ │ │ ├── pr54428.c │ │ │ │ ├── pr54552-1.c │ │ │ │ ├── pr54559.c │ │ │ │ ├── pr54713-1.c │ │ │ │ ├── pr54713-2.c │ │ │ │ ├── pr54713-3.c │ │ │ │ ├── pr54925.c │ │ │ │ ├── pr55273.c │ │ │ │ ├── pr55350.c │ │ │ │ ├── pr55569.c │ │ │ │ ├── pr55832.c │ │ │ │ ├── pr55851.c │ │ │ │ ├── pr55920.c │ │ │ │ ├── pr55921.c │ │ │ │ ├── pr55955.c │ │ │ │ ├── pr56405.c │ │ │ │ ├── pr56448.c │ │ │ │ ├── pr56484.c │ │ │ │ ├── pr56539.c │ │ │ │ ├── pr56571.c │ │ │ │ ├── pr56745.c │ │ │ │ ├── pr56984.c │ │ │ │ ├── pr57108.c │ │ │ │ ├── pr57331.c │ │ │ │ ├── pr57441.c │ │ │ │ ├── pr57698.c │ │ │ │ ├── pr58088.c │ │ │ │ ├── pr58164.c │ │ │ │ ├── pr58332.c │ │ │ │ ├── pr58340.c │ │ │ │ ├── pr58343.c │ │ │ │ ├── pr58344.c │ │ │ │ ├── pr58775.c │ │ │ │ ├── pr58946.c │ │ │ │ ├── pr58970-1.c │ │ │ │ ├── pr58970-2.c │ │ │ │ ├── pr58978.c │ │ │ │ ├── pr58997.c │ │ │ │ ├── pr59102.c │ │ │ │ ├── pr59119.c │ │ │ │ ├── pr59134.c │ │ │ │ ├── pr59322.c │ │ │ │ ├── pr59362.c │ │ │ │ ├── pr59386.c │ │ │ │ ├── pr59417.c │ │ │ │ ├── pr59569-1.c │ │ │ │ ├── pr59569-2.c │ │ │ │ ├── pr59743.c │ │ │ │ ├── pr59803.c │ │ │ │ ├── pr59919.c │ │ │ │ ├── pr60071.c │ │ │ │ ├── pr60268.c │ │ │ │ ├── pr60502.c │ │ │ │ ├── pr60556.c │ │ │ │ ├── pr60655-1.c │ │ │ │ ├── pr60655-2.c │ │ │ │ ├── pr61042.c │ │ │ │ ├── pr61222-1.c │ │ │ │ ├── pr61222-2.c │ │ │ │ ├── pr61684.c │ │ │ │ ├── pr61848.c │ │ │ │ ├── pr62312.c │ │ │ │ ├── pr63282.c │ │ │ │ ├── pr63761.c │ │ │ │ ├── pr64067.c │ │ │ │ ├── pr64269.c │ │ │ │ ├── pr64494.c │ │ │ │ ├── pr65014.c │ │ │ │ ├── pr65153.c │ │ │ │ ├── pr65163.c │ │ │ │ ├── pr65241.c │ │ │ │ ├── pr65540.c │ │ │ │ ├── pr65593.c │ │ │ │ ├── pr65595.c │ │ │ │ ├── pr65680.c │ │ │ │ ├── pr65735.c │ │ │ │ ├── pr65803.c │ │ │ │ ├── pr65873.c │ │ │ │ ├── pr65875.c │ │ │ │ ├── pr66168.c │ │ │ │ ├── pr67106.c │ │ │ │ ├── pr67143.c │ │ │ │ ├── pr67506.c │ │ │ │ ├── pr67816.c │ │ │ │ ├── pr68013.c │ │ │ │ ├── pr69102.c │ │ │ │ ├── pr69161.c │ │ │ │ ├── pr69209.c │ │ │ │ ├── pr69214.c │ │ │ │ ├── pr69740-1.c │ │ │ │ ├── pr69740-2.c │ │ │ │ ├── pr69989-2.c │ │ │ │ ├── pr69999.c │ │ │ │ ├── pr70061.c │ │ │ │ ├── pr70190.c │ │ │ │ ├── pr70199.c │ │ │ │ ├── pr70240.c │ │ │ │ ├── pr70263-1.c │ │ │ │ ├── pr70355.c │ │ │ │ ├── pr70633.c │ │ │ │ ├── pr70916.c │ │ │ │ ├── pr71693.c │ │ │ │ ├── pr71916.c │ │ │ │ ├── pr72802.c │ │ │ │ ├── pret-arg.c │ │ │ │ ├── pta-1.c │ │ │ │ ├── ptr-conv-1.c │ │ │ │ ├── pyr.c │ │ │ │ ├── pyr2.c │ │ │ │ ├── q.c │ │ │ │ ├── r.c │ │ │ │ ├── r1.c │ │ │ │ ├── rel.c │ │ │ │ ├── rmsc.c │ │ │ │ ├── round.c │ │ │ │ ├── run.c │ │ │ │ ├── s.c │ │ │ │ ├── sar.c │ │ │ │ ├── sc.c │ │ │ │ ├── scal.c │ │ │ │ ├── scc.c │ │ │ │ ├── scond.c │ │ │ │ ├── section.c │ │ │ │ ├── selfrec.c │ │ │ │ ├── seq.c │ │ │ │ ├── set386.c │ │ │ │ ├── set88.c │ │ │ │ ├── sh.c │ │ │ │ ├── shand.c │ │ │ │ ├── shft.c │ │ │ │ ├── shift.c │ │ │ │ ├── shloop.c │ │ │ │ ├── shm.c │ │ │ │ ├── signext.c │ │ │ │ ├── signext2.c │ │ │ │ ├── sim.c │ │ │ │ ├── simd-1.c │ │ │ │ ├── simd-2.c │ │ │ │ ├── simd-3.c │ │ │ │ ├── simd-4.c │ │ │ │ ├── simd-5.c │ │ │ │ ├── simd-6.c │ │ │ │ ├── simple.c │ │ │ │ ├── sizeof-macros-1.c │ │ │ │ ├── sne.c │ │ │ │ ├── sound.c │ │ │ │ ├── sparcbug.c │ │ │ │ ├── speed.c │ │ │ │ ├── sra-1.c │ │ │ │ ├── ssa-pre-1.c │ │ │ │ ├── statement-expression-1.c │ │ │ │ ├── stor.c │ │ │ │ ├── store0.c │ │ │ │ ├── storecc.c │ │ │ │ ├── str.c │ │ │ │ ├── strcpy-1.c │ │ │ │ ├── strcpy-2.c │ │ │ │ ├── stru.c │ │ │ │ ├── struct-non-lval-1.c │ │ │ │ ├── struct-non-lval-2.c │ │ │ │ ├── struct-non-lval-3.c │ │ │ │ ├── structret.c │ │ │ │ ├── structs.c │ │ │ │ ├── stuct.c │ │ │ │ ├── sub32.c │ │ │ │ ├── subcc.c │ │ │ │ ├── subcse.c │ │ │ │ ├── switch-1.c │ │ │ │ ├── sym.c │ │ │ │ ├── symconst.c │ │ │ │ ├── sync-1.c │ │ │ │ ├── sync-2.c │ │ │ │ ├── sync-3.c │ │ │ │ ├── t.c │ │ │ │ ├── test-flow.c │ │ │ │ ├── test-loop.c │ │ │ │ ├── test.c │ │ │ │ ├── time.c │ │ │ │ ├── tmp.c │ │ │ │ ├── trivial.c │ │ │ │ ├── trunc.c │ │ │ │ ├── trunctfdf.c │ │ │ │ ├── u.c │ │ │ │ ├── udconvert.c │ │ │ │ ├── udivmod4.c │ │ │ │ ├── unalign-1.c │ │ │ │ ├── uns.c │ │ │ │ ├── uns_tst.c │ │ │ │ ├── uuarg.c │ │ │ │ ├── v.c │ │ │ │ ├── vector-1.c │ │ │ │ ├── vector-2.c │ │ │ │ ├── vector-3.c │ │ │ │ ├── vector-4.c │ │ │ │ ├── vector-5.c │ │ │ │ ├── vector-6.c │ │ │ │ ├── vector-align-1.c │ │ │ │ ├── vla-const-1.c │ │ │ │ ├── vla-const-2.c │ │ │ │ ├── volatile-1.c │ │ │ │ ├── w.c │ │ │ │ ├── widechar-1.c │ │ │ │ ├── ww.c │ │ │ │ ├── x.c │ │ │ │ ├── xb.c │ │ │ │ ├── xbg.c │ │ │ │ ├── xc.c │ │ │ │ ├── xcsebug.c │ │ │ │ ├── xdi.c │ │ │ │ ├── xfoo.c │ │ │ │ ├── xi.c │ │ │ │ ├── xlop.c │ │ │ │ ├── xmtst.c │ │ │ │ ├── xneg.c │ │ │ │ ├── xopt.c │ │ │ │ ├── xor.c │ │ │ │ ├── xorn.c │ │ │ │ ├── xp.c │ │ │ │ ├── xpp.c │ │ │ │ ├── xs.c │ │ │ │ ├── xsh.c │ │ │ │ ├── xz.c │ │ │ │ ├── xzz.c │ │ │ │ ├── zero-strct-1.c │ │ │ │ ├── zero-strct-2.c │ │ │ │ ├── zero-strct-3.c │ │ │ │ ├── zero-strct-4.c │ │ │ │ └── zero-strct-5.c │ │ │ ├── execute/ │ │ │ │ ├── 20000112-1.c │ │ │ │ ├── 20000113-1.c │ │ │ │ ├── 20000121-1.c │ │ │ │ ├── 20000205-1.c │ │ │ │ ├── 20000217-1.c │ │ │ │ ├── 20000223-1.c │ │ │ │ ├── 20000224-1.c │ │ │ │ ├── 20000225-1.c │ │ │ │ ├── 20000227-1.c │ │ │ │ ├── 20000313-1.c │ │ │ │ ├── 20000314-1.c │ │ │ │ ├── 20000314-2.c │ │ │ │ ├── 20000314-3.c │ │ │ │ ├── 20000402-1.c │ │ │ │ ├── 20000403-1.c │ │ │ │ ├── 20000412-1.c │ │ │ │ ├── 20000412-2.c │ │ │ │ ├── 20000412-3.c │ │ │ │ ├── 20000412-4.c │ │ │ │ ├── 20000412-5.c │ │ │ │ ├── 20000412-6.c │ │ │ │ ├── 20000419-1.c │ │ │ │ ├── 20000422-1.c │ │ │ │ ├── 20000503-1.c │ │ │ │ ├── 20000511-1.c │ │ │ │ ├── 20000519-1.c │ │ │ │ ├── 20000519-2.c │ │ │ │ ├── 20000523-1.c │ │ │ │ ├── 20000528-1.c │ │ │ │ ├── 20000603-1.c │ │ │ │ ├── 20000605-1.c │ │ │ │ ├── 20000605-2.c │ │ │ │ ├── 20000605-3.c │ │ │ │ ├── 20000622-1.c │ │ │ │ ├── 20000703-1.c │ │ │ │ ├── 20000706-1.c │ │ │ │ ├── 20000706-2.c │ │ │ │ ├── 20000706-3.c │ │ │ │ ├── 20000706-4.c │ │ │ │ ├── 20000706-5.c │ │ │ │ ├── 20000707-1.c │ │ │ │ ├── 20000715-1.c │ │ │ │ ├── 20000715-2.c │ │ │ │ ├── 20000717-1.c │ │ │ │ ├── 20000717-2.c │ │ │ │ ├── 20000717-3.c │ │ │ │ ├── 20000717-4.c │ │ │ │ ├── 20000717-5.c │ │ │ │ ├── 20000722-1.c │ │ │ │ ├── 20000726-1.c │ │ │ │ ├── 20000731-1.c │ │ │ │ ├── 20000731-2.c │ │ │ │ ├── 20000801-1.c │ │ │ │ ├── 20000801-2.c │ │ │ │ ├── 20000801-3.c │ │ │ │ ├── 20000801-4.c │ │ │ │ ├── 20000808-1.c │ │ │ │ ├── 20000815-1.c │ │ │ │ ├── 20000818-1.c │ │ │ │ ├── 20000819-1.c │ │ │ │ ├── 20000822-1.c │ │ │ │ ├── 20000910-1.c │ │ │ │ ├── 20000910-2.c │ │ │ │ ├── 20000914-1.c │ │ │ │ ├── 20000917-1.c │ │ │ │ ├── 20001009-1.c │ │ │ │ ├── 20001009-2.c │ │ │ │ ├── 20001011-1.c │ │ │ │ ├── 20001013-1.c │ │ │ │ ├── 20001017-1.c │ │ │ │ ├── 20001017-2.c │ │ │ │ ├── 20001024-1.c │ │ │ │ ├── 20001026-1.c │ │ │ │ ├── 20001027-1.c │ │ │ │ ├── 20001031-1.c │ │ │ │ ├── 20001101.c │ │ │ │ ├── 20001108-1.c │ │ │ │ ├── 20001111-1.c │ │ │ │ ├── 20001112-1.c │ │ │ │ ├── 20001121-1.c │ │ │ │ ├── 20001124-1.c │ │ │ │ ├── 20001130-1.c │ │ │ │ ├── 20001130-2.c │ │ │ │ ├── 20001203-1.c │ │ │ │ ├── 20001203-2.c │ │ │ │ ├── 20001221-1.c │ │ │ │ ├── 20001228-1.c │ │ │ │ ├── 20001229-1.c │ │ │ │ ├── 20010106-1.c │ │ │ │ ├── 20010114-1.c │ │ │ │ ├── 20010116-1.c │ │ │ │ ├── 20010118-1.c │ │ │ │ ├── 20010119-1.c │ │ │ │ ├── 20010122-1.c │ │ │ │ ├── 20010123-1.c │ │ │ │ ├── 20010129-1.c │ │ │ │ ├── 20010206-1.c │ │ │ │ ├── 20010209-1.c │ │ │ │ ├── 20010221-1.c │ │ │ │ ├── 20010222-1.c │ │ │ │ ├── 20010224-1.c │ │ │ │ ├── 20010325-1.c │ │ │ │ ├── 20010329-1.c │ │ │ │ ├── 20010403-1.c │ │ │ │ ├── 20010409-1.c │ │ │ │ ├── 20010422-1.c │ │ │ │ ├── 20010518-1.c │ │ │ │ ├── 20010518-2.c │ │ │ │ ├── 20010520-1.c │ │ │ │ ├── 20010604-1.c │ │ │ │ ├── 20010605-1.c │ │ │ │ ├── 20010605-2.c │ │ │ │ ├── 20010711-1.c │ │ │ │ ├── 20010717-1.c │ │ │ │ ├── 20010723-1.c │ │ │ │ ├── 20010904-1.c │ │ │ │ ├── 20010904-2.c │ │ │ │ ├── 20010910-1.c │ │ │ │ ├── 20010915-1.c │ │ │ │ ├── 20010924-1.c │ │ │ │ ├── 20010925-1.c │ │ │ │ ├── 20011008-3.c │ │ │ │ ├── 20011019-1.c │ │ │ │ ├── 20011024-1.c │ │ │ │ ├── 20011109-1.c │ │ │ │ ├── 20011109-2.c │ │ │ │ ├── 20011113-1.c │ │ │ │ ├── 20011114-1.c │ │ │ │ ├── 20011115-1.c │ │ │ │ ├── 20011121-1.c │ │ │ │ ├── 20011126-1.c │ │ │ │ ├── 20011126-2.c │ │ │ │ ├── 20011128-1.c │ │ │ │ ├── 20011217-1.c │ │ │ │ ├── 20011219-1.c │ │ │ │ ├── 20011223-1.c │ │ │ │ ├── 20020103-1.c │ │ │ │ ├── 20020107-1.c │ │ │ │ ├── 20020108-1.c │ │ │ │ ├── 20020118-1.c │ │ │ │ ├── 20020127-1.c │ │ │ │ ├── 20020129-1.c │ │ │ │ ├── 20020201-1.c │ │ │ │ ├── 20020206-1.c │ │ │ │ ├── 20020206-2.c │ │ │ │ ├── 20020213-1.c │ │ │ │ ├── 20020215-1.c │ │ │ │ ├── 20020216-1.c │ │ │ │ ├── 20020219-1.c │ │ │ │ ├── 20020225-1.c │ │ │ │ ├── 20020225-2.c │ │ │ │ ├── 20020226-1.c │ │ │ │ ├── 20020227-1.c │ │ │ │ ├── 20020307-1.c │ │ │ │ ├── 20020314-1.c │ │ │ │ ├── 20020320-1.c │ │ │ │ ├── 20020321-1.c │ │ │ │ ├── 20020328-1.c │ │ │ │ ├── 20020402-1.c │ │ │ │ ├── 20020402-2.c │ │ │ │ ├── 20020402-3.c │ │ │ │ ├── 20020404-1.c │ │ │ │ ├── 20020406-1.c │ │ │ │ ├── 20020411-1.c │ │ │ │ ├── 20020412-1.c │ │ │ │ ├── 20020413-1.c │ │ │ │ ├── 20020418-1.c │ │ │ │ ├── 20020423-1.c │ │ │ │ ├── 20020503-1.c │ │ │ │ ├── 20020506-1.c │ │ │ │ ├── 20020508-1.c │ │ │ │ ├── 20020508-2.c │ │ │ │ ├── 20020508-3.c │ │ │ │ ├── 20020510-1.c │ │ │ │ ├── 20020529-1.c │ │ │ │ ├── 20020611-1.c │ │ │ │ ├── 20020614-1.c │ │ │ │ ├── 20020615-1.c │ │ │ │ ├── 20020619-1.c │ │ │ │ ├── 20020716-1.c │ │ │ │ ├── 20020720-1.c │ │ │ │ ├── 20020805-1.c │ │ │ │ ├── 20020810-1.c │ │ │ │ ├── 20020819-1.c │ │ │ │ ├── 20020904-1.c │ │ │ │ ├── 20020911-1.c │ │ │ │ ├── 20020916-1.c │ │ │ │ ├── 20020920-1.c │ │ │ │ ├── 20021010-1.c │ │ │ │ ├── 20021010-2.c │ │ │ │ ├── 20021011-1.c │ │ │ │ ├── 20021015-1.c │ │ │ │ ├── 20021024-1.c │ │ │ │ ├── 20021111-1.c │ │ │ │ ├── 20021113-1.c │ │ │ │ ├── 20021118-1.c │ │ │ │ ├── 20021118-2.c │ │ │ │ ├── 20021118-3.c │ │ │ │ ├── 20021119-1.c │ │ │ │ ├── 20021120-1.c │ │ │ │ ├── 20021120-2.c │ │ │ │ ├── 20021120-3.c │ │ │ │ ├── 20021127-1.c │ │ │ │ ├── 20021204-1.c │ │ │ │ ├── 20021219-1.c │ │ │ │ ├── 20030105-1.c │ │ │ │ ├── 20030109-1.c │ │ │ │ ├── 20030117-1.c │ │ │ │ ├── 20030120-1.c │ │ │ │ ├── 20030120-2.c │ │ │ │ ├── 20030125-1.c │ │ │ │ ├── 20030128-1.c │ │ │ │ ├── 20030203-1.c │ │ │ │ ├── 20030209-1.c │ │ │ │ ├── 20030216-1.c │ │ │ │ ├── 20030218-1.c │ │ │ │ ├── 20030221-1.c │ │ │ │ ├── 20030222-1.c │ │ │ │ ├── 20030224-2.c │ │ │ │ ├── 20030307-1.c │ │ │ │ ├── 20030313-1.c │ │ │ │ ├── 20030316-1.c │ │ │ │ ├── 20030323-1.c │ │ │ │ ├── 20030330-1.c │ │ │ │ ├── 20030401-1.c │ │ │ │ ├── 20030403-1.c │ │ │ │ ├── 20030404-1.c │ │ │ │ ├── 20030408-1.c │ │ │ │ ├── 20030501-1.c │ │ │ │ ├── 20030606-1.c │ │ │ │ ├── 20030613-1.c │ │ │ │ ├── 20030626-1.c │ │ │ │ ├── 20030626-2.c │ │ │ │ ├── 20030714-1.c │ │ │ │ ├── 20030715-1.c │ │ │ │ ├── 20030717-1.c │ │ │ │ ├── 20030718-1.c │ │ │ │ ├── 20030811-1.c │ │ │ │ ├── 20030821-1.c │ │ │ │ ├── 20030828-1.c │ │ │ │ ├── 20030828-2.c │ │ │ │ ├── 20030903-1.c │ │ │ │ ├── 20030909-1.c │ │ │ │ ├── 20030910-1.c │ │ │ │ ├── 20030913-1.c │ │ │ │ ├── 20030914-1.c │ │ │ │ ├── 20030914-2.c │ │ │ │ ├── 20030916-1.c │ │ │ │ ├── 20030920-1.c │ │ │ │ ├── 20030928-1.c │ │ │ │ ├── 20031003-1.c │ │ │ │ ├── 20031010-1.c │ │ │ │ ├── 20031011-1.c │ │ │ │ ├── 20031012-1.c │ │ │ │ ├── 20031020-1.c │ │ │ │ ├── 20031201-1.c │ │ │ │ ├── 20031204-1.c │ │ │ │ ├── 20031211-1.c │ │ │ │ ├── 20031211-2.c │ │ │ │ ├── 20031214-1.c │ │ │ │ ├── 20031215-1.c │ │ │ │ ├── 20031216-1.c │ │ │ │ ├── 20040208-1.c │ │ │ │ ├── 20040218-1.c │ │ │ │ ├── 20040223-1.c │ │ │ │ ├── 20040302-1.c │ │ │ │ ├── 20040307-1.c │ │ │ │ ├── 20040308-1.c │ │ │ │ ├── 20040309-1.c │ │ │ │ ├── 20040311-1.c │ │ │ │ ├── 20040313-1.c │ │ │ │ ├── 20040319-1.c │ │ │ │ ├── 20040331-1.c │ │ │ │ ├── 20040409-1.c │ │ │ │ ├── 20040409-2.c │ │ │ │ ├── 20040409-3.c │ │ │ │ ├── 20040411-1.c │ │ │ │ ├── 20040423-1.c │ │ │ │ ├── 20040520-1.c │ │ │ │ ├── 20040625-1.c │ │ │ │ ├── 20040629-1.c │ │ │ │ ├── 20040703-1.c │ │ │ │ ├── 20040704-1.c │ │ │ │ ├── 20040705-1.c │ │ │ │ ├── 20040705-2.c │ │ │ │ ├── 20040706-1.c │ │ │ │ ├── 20040707-1.c │ │ │ │ ├── 20040709-1.c │ │ │ │ ├── 20040709-2.c │ │ │ │ ├── 20040805-1.c │ │ │ │ ├── 20040811-1.c │ │ │ │ ├── 20040820-1.c │ │ │ │ ├── 20040823-1.c │ │ │ │ ├── 20040831-1.c │ │ │ │ ├── 20040917-1.c │ │ │ │ ├── 20041011-1.c │ │ │ │ ├── 20041019-1.c │ │ │ │ ├── 20041112-1.c │ │ │ │ ├── 20041113-1.c │ │ │ │ ├── 20041114-1.c │ │ │ │ ├── 20041124-1.c │ │ │ │ ├── 20041126-1.c │ │ │ │ ├── 20041201-1.c │ │ │ │ ├── 20041210-1.c │ │ │ │ ├── 20041212-1.c │ │ │ │ ├── 20041213-2.c │ │ │ │ ├── 20041214-1.c │ │ │ │ ├── 20041218-1.c │ │ │ │ ├── 20041218-2.c │ │ │ │ ├── 20050104-1.c │ │ │ │ ├── 20050106-1.c │ │ │ │ ├── 20050107-1.c │ │ │ │ ├── 20050111-1.c │ │ │ │ ├── 20050119-1.c │ │ │ │ ├── 20050119-2.c │ │ │ │ ├── 20050121-1.c │ │ │ │ ├── 20050124-1.c │ │ │ │ ├── 20050125-1.c │ │ │ │ ├── 20050131-1.c │ │ │ │ ├── 20050203-1.c │ │ │ │ ├── 20050215-1.c │ │ │ │ ├── 20050218-1.c │ │ │ │ ├── 20050224-1.c │ │ │ │ ├── 20050316-1.c │ │ │ │ ├── 20050316-2.c │ │ │ │ ├── 20050316-3.c │ │ │ │ ├── 20050410-1.c │ │ │ │ ├── 20050502-1.c │ │ │ │ ├── 20050502-2.c │ │ │ │ ├── 20050604-1.c │ │ │ │ ├── 20050607-1.c │ │ │ │ ├── 20050613-1.c │ │ │ │ ├── 20050713-1.c │ │ │ │ ├── 20050826-1.c │ │ │ │ ├── 20050826-2.c │ │ │ │ ├── 20050929-1.c │ │ │ │ ├── 20051012-1.c │ │ │ │ ├── 20051021-1.c │ │ │ │ ├── 20051104-1.c │ │ │ │ ├── 20051110-1.c │ │ │ │ ├── 20051110-2.c │ │ │ │ ├── 20051113-1.c │ │ │ │ ├── 20051215-1.c │ │ │ │ ├── 20060102-1.c │ │ │ │ ├── 20060110-1.c │ │ │ │ ├── 20060110-2.c │ │ │ │ ├── 20060127-1.c │ │ │ │ ├── 20060412-1.c │ │ │ │ ├── 20060420-1.c │ │ │ │ ├── 20060905-1.c │ │ │ │ ├── 20060910-1.c │ │ │ │ ├── 20060929-1.c │ │ │ │ ├── 20060930-1.c │ │ │ │ ├── 20060930-2.c │ │ │ │ ├── 20061031-1.c │ │ │ │ ├── 20061101-1.c │ │ │ │ ├── 20061101-2.c │ │ │ │ ├── 20061220-1.c │ │ │ │ ├── 20070201-1.c │ │ │ │ ├── 20070212-1.c │ │ │ │ ├── 20070212-2.c │ │ │ │ ├── 20070212-3.c │ │ │ │ ├── 20070424-1.c │ │ │ │ ├── 20070517-1.c │ │ │ │ ├── 20070614-1.c │ │ │ │ ├── 20070623-1.c │ │ │ │ ├── 20070724-1.c │ │ │ │ ├── 20070824-1.c │ │ │ │ ├── 20070919-1.c │ │ │ │ ├── 20071011-1.c │ │ │ │ ├── 20071018-1.c │ │ │ │ ├── 20071029-1.c │ │ │ │ ├── 20071030-1.c │ │ │ │ ├── 20071108-1.c │ │ │ │ ├── 20071120-1.c │ │ │ │ ├── 20071202-1.c │ │ │ │ ├── 20071205-1.c │ │ │ │ ├── 20071210-1.c │ │ │ │ ├── 20071211-1.c │ │ │ │ ├── 20071213-1.c │ │ │ │ ├── 20071216-1.c │ │ │ │ ├── 20071219-1.c │ │ │ │ ├── 20071220-1.c │ │ │ │ ├── 20071220-2.c │ │ │ │ ├── 20080117-1.c │ │ │ │ ├── 20080122-1.c │ │ │ │ ├── 20080222-1.c │ │ │ │ ├── 20080408-1.c │ │ │ │ ├── 20080424-1.c │ │ │ │ ├── 20080502-1.c │ │ │ │ ├── 20080506-1.c │ │ │ │ ├── 20080506-2.c │ │ │ │ ├── 20080519-1.c │ │ │ │ ├── 20080522-1.c │ │ │ │ ├── 20080529-1.c │ │ │ │ ├── 20080604-1.c │ │ │ │ ├── 20080719-1.c │ │ │ │ ├── 20080813-1.c │ │ │ │ ├── 20081103-1.c │ │ │ │ ├── 20081112-1.c │ │ │ │ ├── 20081117-1.c │ │ │ │ ├── 20081218-1.c │ │ │ │ ├── 20090113-1.c │ │ │ │ ├── 20090113-2.c │ │ │ │ ├── 20090113-3.c │ │ │ │ ├── 20090207-1.c │ │ │ │ ├── 20090219-1.c │ │ │ │ ├── 20090527-1.c │ │ │ │ ├── 20090623-1.c │ │ │ │ ├── 20090711-1.c │ │ │ │ ├── 20090814-1.c │ │ │ │ ├── 20091229-1.c │ │ │ │ ├── 20100209-1.c │ │ │ │ ├── 20100316-1.c │ │ │ │ ├── 20100416-1.c │ │ │ │ ├── 20100430-1.c │ │ │ │ ├── 20100708-1.c │ │ │ │ ├── 20100805-1.c │ │ │ │ ├── 20100827-1.c │ │ │ │ ├── 20101011-1.c │ │ │ │ ├── 20101013-1.c │ │ │ │ ├── 20101025-1.c │ │ │ │ ├── 20110418-1.c │ │ │ │ ├── 20111208-1.c │ │ │ │ ├── 20111212-1.c │ │ │ │ ├── 20111227-1.c │ │ │ │ ├── 20120105-1.c │ │ │ │ ├── 20120111-1.c │ │ │ │ ├── 20120207-1.c │ │ │ │ ├── 20120427-1.c │ │ │ │ ├── 20120427-2.c │ │ │ │ ├── 20120615-1.c │ │ │ │ ├── 20120808-1.c │ │ │ │ ├── 20120817-1.c │ │ │ │ ├── 20120919-1.c │ │ │ │ ├── 20121108-1.c │ │ │ │ ├── 20131127-1.c │ │ │ │ ├── 20140212-1.c │ │ │ │ ├── 20140212-2.c │ │ │ │ ├── 20140326-1.c │ │ │ │ ├── 20140425-1.c │ │ │ │ ├── 20140622-1.c │ │ │ │ ├── 20140828-1.c │ │ │ │ ├── 20141022-1.c │ │ │ │ ├── 20141107-1.c │ │ │ │ ├── 20141125-1.c │ │ │ │ ├── 20150611-1.c │ │ │ │ ├── 900409-1.c │ │ │ │ ├── 920202-1.c │ │ │ │ ├── 920302-1.c │ │ │ │ ├── 920409-1.c │ │ │ │ ├── 920410-1.c │ │ │ │ ├── 920411-1.c │ │ │ │ ├── 920415-1.c │ │ │ │ ├── 920428-1.c │ │ │ │ ├── 920428-2.c │ │ │ │ ├── 920429-1.c │ │ │ │ ├── 920501-1.c │ │ │ │ ├── 920501-2.c │ │ │ │ ├── 920501-3.c │ │ │ │ ├── 920501-4.c │ │ │ │ ├── 920501-5.c │ │ │ │ ├── 920501-6.c │ │ │ │ ├── 920501-7.c │ │ │ │ ├── 920501-8.c │ │ │ │ ├── 920501-9.c │ │ │ │ ├── 920506-1.c │ │ │ │ ├── 920520-1.c │ │ │ │ ├── 920603-1.c │ │ │ │ ├── 920604-1.c │ │ │ │ ├── 920612-1.c │ │ │ │ ├── 920612-2.c │ │ │ │ ├── 920618-1.c │ │ │ │ ├── 920625-1.c │ │ │ │ ├── 920710-1.c │ │ │ │ ├── 920711-1.c │ │ │ │ ├── 920721-1.c │ │ │ │ ├── 920721-2.c │ │ │ │ ├── 920721-3.c │ │ │ │ ├── 920721-4.c │ │ │ │ ├── 920726-1.c │ │ │ │ ├── 920728-1.c │ │ │ │ ├── 920730-1.c │ │ │ │ ├── 920731-1.c │ │ │ │ ├── 920810-1.c │ │ │ │ ├── 920812-1.c │ │ │ │ ├── 920829-1.c │ │ │ │ ├── 920908-1.c │ │ │ │ ├── 920908-2.c │ │ │ │ ├── 920909-1.c │ │ │ │ ├── 920922-1.c │ │ │ │ ├── 920929-1.c │ │ │ │ ├── 921006-1.c │ │ │ │ ├── 921007-1.c │ │ │ │ ├── 921013-1.c │ │ │ │ ├── 921016-1.c │ │ │ │ ├── 921017-1.c │ │ │ │ ├── 921019-1.c │ │ │ │ ├── 921019-2.c │ │ │ │ ├── 921029-1.c │ │ │ │ ├── 921104-1.c │ │ │ │ ├── 921110-1.c │ │ │ │ ├── 921112-1.c │ │ │ │ ├── 921113-1.c │ │ │ │ ├── 921117-1.c │ │ │ │ ├── 921123-1.c │ │ │ │ ├── 921123-2.c │ │ │ │ ├── 921124-1.c │ │ │ │ ├── 921202-1.c │ │ │ │ ├── 921202-2.c │ │ │ │ ├── 921204-1.c │ │ │ │ ├── 921207-1.c │ │ │ │ ├── 921208-1.c │ │ │ │ ├── 921208-2.c │ │ │ │ ├── 921215-1.c │ │ │ │ ├── 921218-1.c │ │ │ │ ├── 921218-2.c │ │ │ │ ├── 930106-1.c │ │ │ │ ├── 930111-1.c │ │ │ │ ├── 930123-1.c │ │ │ │ ├── 930126-1.c │ │ │ │ ├── 930208-1.c │ │ │ │ ├── 930406-1.c │ │ │ │ ├── 930408-1.c │ │ │ │ ├── 930429-1.c │ │ │ │ ├── 930429-2.c │ │ │ │ ├── 930513-1.c │ │ │ │ ├── 930513-2.c │ │ │ │ ├── 930518-1.c │ │ │ │ ├── 930526-1.c │ │ │ │ ├── 930527-1.c │ │ │ │ ├── 930529-1.c │ │ │ │ ├── 930603-1.c │ │ │ │ ├── 930603-2.c │ │ │ │ ├── 930603-3.c │ │ │ │ ├── 930608-1.c │ │ │ │ ├── 930614-1.c │ │ │ │ ├── 930614-2.c │ │ │ │ ├── 930621-1.c │ │ │ │ ├── 930622-1.c │ │ │ │ ├── 930622-2.c │ │ │ │ ├── 930628-1.c │ │ │ │ ├── 930630-1.c │ │ │ │ ├── 930702-1.c │ │ │ │ ├── 930713-1.c │ │ │ │ ├── 930718-1.c │ │ │ │ ├── 930719-1.c │ │ │ │ ├── 930725-1.c │ │ │ │ ├── 930818-1.c │ │ │ │ ├── 930916-1.c │ │ │ │ ├── 930921-1.c │ │ │ │ ├── 930929-1.c │ │ │ │ ├── 930930-1.c │ │ │ │ ├── 930930-2.c │ │ │ │ ├── 931002-1.c │ │ │ │ ├── 931004-1.c │ │ │ │ ├── 931004-10.c │ │ │ │ ├── 931004-11.c │ │ │ │ ├── 931004-12.c │ │ │ │ ├── 931004-13.c │ │ │ │ ├── 931004-14.c │ │ │ │ ├── 931004-2.c │ │ │ │ ├── 931004-3.c │ │ │ │ ├── 931004-4.c │ │ │ │ ├── 931004-5.c │ │ │ │ ├── 931004-6.c │ │ │ │ ├── 931004-7.c │ │ │ │ ├── 931004-8.c │ │ │ │ ├── 931004-9.c │ │ │ │ ├── 931005-1.c │ │ │ │ ├── 931009-1.c │ │ │ │ ├── 931012-1.c │ │ │ │ ├── 931017-1.c │ │ │ │ ├── 931018-1.c │ │ │ │ ├── 931031-1.c │ │ │ │ ├── 931102-1.c │ │ │ │ ├── 931102-2.c │ │ │ │ ├── 931110-1.c │ │ │ │ ├── 931110-2.c │ │ │ │ ├── 931208-1.c │ │ │ │ ├── 931228-1.c │ │ │ │ ├── 940115-1.c │ │ │ │ ├── 940122-1.c │ │ │ │ ├── 941014-1.c │ │ │ │ ├── 941014-2.c │ │ │ │ ├── 941015-1.c │ │ │ │ ├── 941021-1.c │ │ │ │ ├── 941025-1.c │ │ │ │ ├── 941031-1.c │ │ │ │ ├── 941101-1.c │ │ │ │ ├── 941110-1.c │ │ │ │ ├── 941202-1.c │ │ │ │ ├── 950221-1.c │ │ │ │ ├── 950322-1.c │ │ │ │ ├── 950426-1.c │ │ │ │ ├── 950426-2.c │ │ │ │ ├── 950503-1.c │ │ │ │ ├── 950511-1.c │ │ │ │ ├── 950512-1.c │ │ │ │ ├── 950605-1.c │ │ │ │ ├── 950607-1.c │ │ │ │ ├── 950607-2.c │ │ │ │ ├── 950612-1.c │ │ │ │ ├── 950621-1.c │ │ │ │ ├── 950628-1.c │ │ │ │ ├── 950704-1.c │ │ │ │ ├── 950706-1.c │ │ │ │ ├── 950710-1.c │ │ │ │ ├── 950714-1.c │ │ │ │ ├── 950809-1.c │ │ │ │ ├── 950906-1.c │ │ │ │ ├── 950915-1.c │ │ │ │ ├── 950929-1.c │ │ │ │ ├── 951003-1.c │ │ │ │ ├── 951115-1.c │ │ │ │ ├── 951204-1.c │ │ │ │ ├── 960116-1.c │ │ │ │ ├── 960117-1.c │ │ │ │ ├── 960209-1.c │ │ │ │ ├── 960215-1.c │ │ │ │ ├── 960218-1.c │ │ │ │ ├── 960219-1.c │ │ │ │ ├── 960301-1.c │ │ │ │ ├── 960302-1.c │ │ │ │ ├── 960311-1.c │ │ │ │ ├── 960311-2.c │ │ │ │ ├── 960311-3.c │ │ │ │ ├── 960312-1.c │ │ │ │ ├── 960317-1.c │ │ │ │ ├── 960321-1.c │ │ │ │ ├── 960326-1.c │ │ │ │ ├── 960327-1.c │ │ │ │ ├── 960402-1.c │ │ │ │ ├── 960405-1.c │ │ │ │ ├── 960416-1.c │ │ │ │ ├── 960419-1.c │ │ │ │ ├── 960419-2.c │ │ │ │ ├── 960512-1.c │ │ │ │ ├── 960513-1.c │ │ │ │ ├── 960521-1.c │ │ │ │ ├── 960608-1.c │ │ │ │ ├── 960801-1.c │ │ │ │ ├── 960802-1.c │ │ │ │ ├── 960830-1.c │ │ │ │ ├── 960909-1.c │ │ │ │ ├── 961004-1.c │ │ │ │ ├── 961017-1.c │ │ │ │ ├── 961017-2.c │ │ │ │ ├── 961026-1.c │ │ │ │ ├── 961112-1.c │ │ │ │ ├── 961122-1.c │ │ │ │ ├── 961122-2.c │ │ │ │ ├── 961125-1.c │ │ │ │ ├── 961206-1.c │ │ │ │ ├── 961213-1.c │ │ │ │ ├── 961223-1.c │ │ │ │ ├── 970214-1.c │ │ │ │ ├── 970214-2.c │ │ │ │ ├── 970217-1.c │ │ │ │ ├── 970923-1.c │ │ │ │ ├── 980205.c │ │ │ │ ├── 980223.c │ │ │ │ ├── 980424-1.c │ │ │ │ ├── 980505-1.c │ │ │ │ ├── 980505-2.c │ │ │ │ ├── 980506-1.c │ │ │ │ ├── 980506-2.c │ │ │ │ ├── 980506-3.c │ │ │ │ ├── 980526-1.c │ │ │ │ ├── 980526-2.c │ │ │ │ ├── 980526-3.c │ │ │ │ ├── 980602-1.c │ │ │ │ ├── 980602-2.c │ │ │ │ ├── 980604-1.c │ │ │ │ ├── 980605-1.c │ │ │ │ ├── 980608-1.c │ │ │ │ ├── 980612-1.c │ │ │ │ ├── 980617-1.c │ │ │ │ ├── 980618-1.c │ │ │ │ ├── 980701-1.c │ │ │ │ ├── 980707-1.c │ │ │ │ ├── 980709-1.c │ │ │ │ ├── 980716-1.c │ │ │ │ ├── 980929-1.c │ │ │ │ ├── 981001-1.c │ │ │ │ ├── 981019-1.c │ │ │ │ ├── 981130-1.c │ │ │ │ ├── 981206-1.c │ │ │ │ ├── 990106-1.c │ │ │ │ ├── 990106-2.c │ │ │ │ ├── 990117-1.c │ │ │ │ ├── 990127-1.c │ │ │ │ ├── 990127-2.c │ │ │ │ ├── 990128-1.c │ │ │ │ ├── 990130-1.c │ │ │ │ ├── 990208-1.c │ │ │ │ ├── 990211-1.c │ │ │ │ ├── 990222-1.c │ │ │ │ ├── 990324-1.c │ │ │ │ ├── 990326-1.c │ │ │ │ ├── 990404-1.c │ │ │ │ ├── 990413-2.c │ │ │ │ ├── 990513-1.c │ │ │ │ ├── 990524-1.c │ │ │ │ ├── 990525-1.c │ │ │ │ ├── 990525-2.c │ │ │ │ ├── 990527-1.c │ │ │ │ ├── 990531-1.c │ │ │ │ ├── 990604-1.c │ │ │ │ ├── 990628-1.c │ │ │ │ ├── 990804-1.c │ │ │ │ ├── 990811-1.c │ │ │ │ ├── 990826-0.c │ │ │ │ ├── 990827-1.c │ │ │ │ ├── 990829-1.c │ │ │ │ ├── 990923-1.c │ │ │ │ ├── 991014-1.c │ │ │ │ ├── 991016-1.c │ │ │ │ ├── 991019-1.c │ │ │ │ ├── 991023-1.c │ │ │ │ ├── 991030-1.c │ │ │ │ ├── 991112-1.c │ │ │ │ ├── 991118-1.c │ │ │ │ ├── 991201-1.c │ │ │ │ ├── 991202-1.c │ │ │ │ ├── 991202-2.c │ │ │ │ ├── 991202-3.c │ │ │ │ ├── 991216-1.c │ │ │ │ ├── 991216-2.c │ │ │ │ ├── 991216-4.c │ │ │ │ ├── 991221-1.c │ │ │ │ ├── 991227-1.c │ │ │ │ ├── 991228-1.c │ │ │ │ ├── alias-1.c │ │ │ │ ├── alias-2.c │ │ │ │ ├── alias-3.c │ │ │ │ ├── alias-4.c │ │ │ │ ├── align-1.c │ │ │ │ ├── align-2.c │ │ │ │ ├── align-3.c │ │ │ │ ├── align-nest.c │ │ │ │ ├── alloca-1.c │ │ │ │ ├── anon-1.c │ │ │ │ ├── arith-1.c │ │ │ │ ├── arith-rand-ll.c │ │ │ │ ├── arith-rand.c │ │ │ │ ├── ashldi-1.c │ │ │ │ ├── ashrdi-1.c │ │ │ │ ├── bcp-1.c │ │ │ │ ├── bf-layout-1.c │ │ │ │ ├── bf-pack-1.c │ │ │ │ ├── bf-sign-1.c │ │ │ │ ├── bf-sign-2.c │ │ │ │ ├── bf64-1.c │ │ │ │ ├── bitfld-1.c │ │ │ │ ├── bitfld-2.c │ │ │ │ ├── bitfld-3.c │ │ │ │ ├── bitfld-4.c │ │ │ │ ├── bitfld-5.c │ │ │ │ ├── bitfld-6.c │ │ │ │ ├── bitfld-7.c │ │ │ │ ├── bswap-1.c │ │ │ │ ├── bswap-2.c │ │ │ │ ├── built-in-setjmp.c │ │ │ │ ├── builtin-bitops-1.c │ │ │ │ ├── builtin-constant.c │ │ │ │ ├── builtin-prefetch-1.c │ │ │ │ ├── builtin-prefetch-2.c │ │ │ │ ├── builtin-prefetch-3.c │ │ │ │ ├── builtin-prefetch-4.c │ │ │ │ ├── builtin-prefetch-5.c │ │ │ │ ├── builtin-prefetch-6.c │ │ │ │ ├── builtin-types-compatible-p.c │ │ │ │ ├── builtins/ │ │ │ │ │ ├── 20010124-1-lib.c │ │ │ │ │ ├── 20010124-1.c │ │ │ │ │ ├── 20010124-1.x │ │ │ │ │ ├── abs-1-lib.c │ │ │ │ │ ├── abs-1.c │ │ │ │ │ ├── abs-1.x │ │ │ │ │ ├── abs-2-lib.c │ │ │ │ │ ├── abs-2.c │ │ │ │ │ ├── abs-3-lib.c │ │ │ │ │ ├── abs-3.c │ │ │ │ │ ├── builtins.exp │ │ │ │ │ ├── chk.h │ │ │ │ │ ├── complex-1-lib.c │ │ │ │ │ ├── complex-1.c │ │ │ │ │ ├── fprintf-lib.c │ │ │ │ │ ├── fprintf.c │ │ │ │ │ ├── fprintf.x │ │ │ │ │ ├── fputs-lib.c │ │ │ │ │ ├── fputs.c │ │ │ │ │ ├── fputs.x │ │ │ │ │ ├── lib/ │ │ │ │ │ │ ├── abs.c │ │ │ │ │ │ ├── bfill.c │ │ │ │ │ │ ├── bzero.c │ │ │ │ │ │ ├── chk.c │ │ │ │ │ │ ├── fprintf.c │ │ │ │ │ │ ├── main.c │ │ │ │ │ │ ├── memchr.c │ │ │ │ │ │ ├── memcmp.c │ │ │ │ │ │ ├── memmove.c │ │ │ │ │ │ ├── mempcpy.c │ │ │ │ │ │ ├── memset.c │ │ │ │ │ │ ├── printf.c │ │ │ │ │ │ ├── sprintf.c │ │ │ │ │ │ ├── stpcpy.c │ │ │ │ │ │ ├── strcat.c │ │ │ │ │ │ ├── strchr.c │ │ │ │ │ │ ├── strcmp.c │ │ │ │ │ │ ├── strcpy.c │ │ │ │ │ │ ├── strcspn.c │ │ │ │ │ │ ├── strlen.c │ │ │ │ │ │ ├── strncat.c │ │ │ │ │ │ ├── strncmp.c │ │ │ │ │ │ ├── strncpy.c │ │ │ │ │ │ ├── strpbrk.c │ │ │ │ │ │ ├── strrchr.c │ │ │ │ │ │ ├── strspn.c │ │ │ │ │ │ └── strstr.c │ │ │ │ │ ├── memchr-lib.c │ │ │ │ │ ├── memchr.c │ │ │ │ │ ├── memcmp-lib.c │ │ │ │ │ ├── memcmp.c │ │ │ │ │ ├── memcpy-chk-lib.c │ │ │ │ │ ├── memcpy-chk.c │ │ │ │ │ ├── memcpy-chk.x │ │ │ │ │ ├── memmove-2-lib.c │ │ │ │ │ ├── memmove-2.c │ │ │ │ │ ├── memmove-chk-lib.c │ │ │ │ │ ├── memmove-chk.c │ │ │ │ │ ├── memmove-chk.x │ │ │ │ │ ├── memmove-lib.c │ │ │ │ │ ├── memmove.c │ │ │ │ │ ├── memops-asm-lib.c │ │ │ │ │ ├── memops-asm.c │ │ │ │ │ ├── memops-asm.x │ │ │ │ │ ├── mempcpy-2-lib.c │ │ │ │ │ ├── mempcpy-2.c │ │ │ │ │ ├── mempcpy-chk-lib.c │ │ │ │ │ ├── mempcpy-chk.c │ │ │ │ │ ├── mempcpy-chk.x │ │ │ │ │ ├── mempcpy-lib.c │ │ │ │ │ ├── mempcpy.c │ │ │ │ │ ├── memset-chk-lib.c │ │ │ │ │ ├── memset-chk.c │ │ │ │ │ ├── memset-chk.x │ │ │ │ │ ├── memset-lib.c │ │ │ │ │ ├── memset.c │ │ │ │ │ ├── pr22237-lib.c │ │ │ │ │ ├── pr22237.c │ │ │ │ │ ├── pr23484-chk-lib.c │ │ │ │ │ ├── pr23484-chk.c │ │ │ │ │ ├── pr23484-chk.x │ │ │ │ │ ├── printf-lib.c │ │ │ │ │ ├── printf.c │ │ │ │ │ ├── snprintf-chk-lib.c │ │ │ │ │ ├── snprintf-chk.c │ │ │ │ │ ├── snprintf-chk.x │ │ │ │ │ ├── sprintf-chk-lib.c │ │ │ │ │ ├── sprintf-chk.c │ │ │ │ │ ├── sprintf-chk.x │ │ │ │ │ ├── sprintf-lib.c │ │ │ │ │ ├── sprintf.c │ │ │ │ │ ├── stpcpy-chk-lib.c │ │ │ │ │ ├── stpcpy-chk.c │ │ │ │ │ ├── stpcpy-chk.x │ │ │ │ │ ├── stpncpy-chk-lib.c │ │ │ │ │ ├── stpncpy-chk.c │ │ │ │ │ ├── stpncpy-chk.x │ │ │ │ │ ├── strcat-chk-lib.c │ │ │ │ │ ├── strcat-chk.c │ │ │ │ │ ├── strcat-chk.x │ │ │ │ │ ├── strcat-lib.c │ │ │ │ │ ├── strcat.c │ │ │ │ │ ├── strchr-lib.c │ │ │ │ │ ├── strchr.c │ │ │ │ │ ├── strcmp-lib.c │ │ │ │ │ ├── strcmp.c │ │ │ │ │ ├── strcpy-2-lib.c │ │ │ │ │ ├── strcpy-2.c │ │ │ │ │ ├── strcpy-chk-lib.c │ │ │ │ │ ├── strcpy-chk.c │ │ │ │ │ ├── strcpy-chk.x │ │ │ │ │ ├── strcpy-lib.c │ │ │ │ │ ├── strcpy.c │ │ │ │ │ ├── strcspn-lib.c │ │ │ │ │ ├── strcspn.c │ │ │ │ │ ├── strlen-2-lib.c │ │ │ │ │ ├── strlen-2.c │ │ │ │ │ ├── strlen-3-lib.c │ │ │ │ │ ├── strlen-3.c │ │ │ │ │ ├── strlen-lib.c │ │ │ │ │ ├── strlen.c │ │ │ │ │ ├── strncat-chk-lib.c │ │ │ │ │ ├── strncat-chk.c │ │ │ │ │ ├── strncat-chk.x │ │ │ │ │ ├── strncat-lib.c │ │ │ │ │ ├── strncat.c │ │ │ │ │ ├── strncmp-2-lib.c │ │ │ │ │ ├── strncmp-2.c │ │ │ │ │ ├── strncmp-lib.c │ │ │ │ │ ├── strncmp.c │ │ │ │ │ ├── strncpy-chk-lib.c │ │ │ │ │ ├── strncpy-chk.c │ │ │ │ │ ├── strncpy-chk.x │ │ │ │ │ ├── strncpy-lib.c │ │ │ │ │ ├── strncpy.c │ │ │ │ │ ├── strpbrk-lib.c │ │ │ │ │ ├── strpbrk.c │ │ │ │ │ ├── strpcpy-2-lib.c │ │ │ │ │ ├── strpcpy-2.c │ │ │ │ │ ├── strpcpy-lib.c │ │ │ │ │ ├── strpcpy.c │ │ │ │ │ ├── strrchr-lib.c │ │ │ │ │ ├── strrchr.c │ │ │ │ │ ├── strspn-lib.c │ │ │ │ │ ├── strspn.c │ │ │ │ │ ├── strstr-asm-lib.c │ │ │ │ │ ├── strstr-asm.c │ │ │ │ │ ├── strstr-asm.x │ │ │ │ │ ├── strstr-lib.c │ │ │ │ │ ├── strstr.c │ │ │ │ │ ├── vsnprintf-chk-lib.c │ │ │ │ │ ├── vsnprintf-chk.c │ │ │ │ │ ├── vsnprintf-chk.x │ │ │ │ │ ├── vsprintf-chk-lib.c │ │ │ │ │ ├── vsprintf-chk.c │ │ │ │ │ └── vsprintf-chk.x │ │ │ │ ├── call-trap-1.c │ │ │ │ ├── cbrt.c │ │ │ │ ├── cmpdi-1.c │ │ │ │ ├── cmpsf-1.c │ │ │ │ ├── cmpsi-1.c │ │ │ │ ├── cmpsi-2.c │ │ │ │ ├── comp-goto-1.c │ │ │ │ ├── comp-goto-2.c │ │ │ │ ├── compare-1.c │ │ │ │ ├── compare-2.c │ │ │ │ ├── compare-3.c │ │ │ │ ├── complex-1.c │ │ │ │ ├── complex-2.c │ │ │ │ ├── complex-3.c │ │ │ │ ├── complex-4.c │ │ │ │ ├── complex-5.c │ │ │ │ ├── complex-6.c │ │ │ │ ├── complex-7.c │ │ │ │ ├── compndlit-1.c │ │ │ │ ├── const-addr-expr-1.c │ │ │ │ ├── conversion.c │ │ │ │ ├── cvt-1.c │ │ │ │ ├── dbra-1.c │ │ │ │ ├── divcmp-1.c │ │ │ │ ├── divcmp-2.c │ │ │ │ ├── divcmp-3.c │ │ │ │ ├── divcmp-4.c │ │ │ │ ├── divcmp-5.c │ │ │ │ ├── divconst-1.c │ │ │ │ ├── divconst-2.c │ │ │ │ ├── divconst-3.c │ │ │ │ ├── divmod-1.c │ │ │ │ ├── doloop-1.c │ │ │ │ ├── doloop-2.c │ │ │ │ ├── eeprof-1.c │ │ │ │ ├── enum-1.c │ │ │ │ ├── enum-2.c │ │ │ │ ├── enum-3.c │ │ │ │ ├── execute.exp │ │ │ │ ├── extzvsi.c │ │ │ │ ├── ffs-1.c │ │ │ │ ├── ffs-2.c │ │ │ │ ├── float-floor.c │ │ │ │ ├── floatunsisf-1.c │ │ │ │ ├── fprintf-1.c │ │ │ │ ├── fprintf-chk-1.c │ │ │ │ ├── frame-address.c │ │ │ │ ├── func-ptr-1.c │ │ │ │ ├── gofast.c │ │ │ │ ├── ieee/ │ │ │ │ │ ├── 20000320-1.c │ │ │ │ │ ├── 20000320-1.x │ │ │ │ │ ├── 20001122-1.c │ │ │ │ │ ├── 20010114-2.c │ │ │ │ │ ├── 20010114-2.x │ │ │ │ │ ├── 20010226-1.c │ │ │ │ │ ├── 20011123-1.c │ │ │ │ │ ├── 20030331-1.c │ │ │ │ │ ├── 20030331-1.x │ │ │ │ │ ├── 20041213-1.c │ │ │ │ │ ├── 920518-1.c │ │ │ │ │ ├── 920518-1.x │ │ │ │ │ ├── 920810-1.c │ │ │ │ │ ├── 930529-1.c │ │ │ │ │ ├── 980619-1.c │ │ │ │ │ ├── 980619-1.x │ │ │ │ │ ├── acc1.c │ │ │ │ │ ├── acc2.c │ │ │ │ │ ├── builtin-nan-1.c │ │ │ │ │ ├── compare-fp-1.c │ │ │ │ │ ├── compare-fp-1.x │ │ │ │ │ ├── compare-fp-2.c │ │ │ │ │ ├── compare-fp-3.c │ │ │ │ │ ├── compare-fp-3.x │ │ │ │ │ ├── compare-fp-4.c │ │ │ │ │ ├── compare-fp-4.x │ │ │ │ │ ├── copysign1.c │ │ │ │ │ ├── copysign2.c │ │ │ │ │ ├── fp-cmp-1.c │ │ │ │ │ ├── fp-cmp-1.x │ │ │ │ │ ├── fp-cmp-2.c │ │ │ │ │ ├── fp-cmp-2.x │ │ │ │ │ ├── fp-cmp-3.c │ │ │ │ │ ├── fp-cmp-3.x │ │ │ │ │ ├── fp-cmp-4.c │ │ │ │ │ ├── fp-cmp-4e.c │ │ │ │ │ ├── fp-cmp-4f.c │ │ │ │ │ ├── fp-cmp-4f.x │ │ │ │ │ ├── fp-cmp-4l.c │ │ │ │ │ ├── fp-cmp-5.c │ │ │ │ │ ├── fp-cmp-6.c │ │ │ │ │ ├── fp-cmp-6.x │ │ │ │ │ ├── fp-cmp-7.c │ │ │ │ │ ├── fp-cmp-8.c │ │ │ │ │ ├── fp-cmp-8e.c │ │ │ │ │ ├── fp-cmp-8f.c │ │ │ │ │ ├── fp-cmp-8f.x │ │ │ │ │ ├── fp-cmp-8l.c │ │ │ │ │ ├── hugeval.c │ │ │ │ │ ├── hugeval.x │ │ │ │ │ ├── ieee.exp │ │ │ │ │ ├── inf-1.c │ │ │ │ │ ├── inf-2.c │ │ │ │ │ ├── inf-3.c │ │ │ │ │ ├── minuszero.c │ │ │ │ │ ├── mul-subnormal-single-1.c │ │ │ │ │ ├── mul-subnormal-single-1.x │ │ │ │ │ ├── mzero2.c │ │ │ │ │ ├── mzero2.x │ │ │ │ │ ├── mzero3.c │ │ │ │ │ ├── mzero4.c │ │ │ │ │ ├── mzero5.c │ │ │ │ │ ├── mzero6.c │ │ │ │ │ ├── pr28634.c │ │ │ │ │ ├── pr29302-1.c │ │ │ │ │ ├── pr29302-1.x │ │ │ │ │ ├── pr30704.c │ │ │ │ │ ├── pr30704.x │ │ │ │ │ ├── pr36332.c │ │ │ │ │ ├── pr38016.c │ │ │ │ │ ├── pr38016.x │ │ │ │ │ ├── pr50310.c │ │ │ │ │ ├── pr67218.c │ │ │ │ │ ├── pr72824-2.c │ │ │ │ │ ├── pr72824.c │ │ │ │ │ ├── rbug.c │ │ │ │ │ ├── rbug.x │ │ │ │ │ ├── unsafe-fp-assoc-1.c │ │ │ │ │ ├── unsafe-fp-assoc-1.x │ │ │ │ │ └── unsafe-fp-assoc.c │ │ │ │ ├── ifcvt-onecmpl-abs-1.c │ │ │ │ ├── index-1.c │ │ │ │ ├── inst-check.c │ │ │ │ ├── int-compare.c │ │ │ │ ├── ipa-sra-1.c │ │ │ │ ├── ipa-sra-2.c │ │ │ │ ├── longlong.c │ │ │ │ ├── loop-1.c │ │ │ │ ├── loop-10.c │ │ │ │ ├── loop-11.c │ │ │ │ ├── loop-12.c │ │ │ │ ├── loop-13.c │ │ │ │ ├── loop-14.c │ │ │ │ ├── loop-15.c │ │ │ │ ├── loop-2.c │ │ │ │ ├── loop-2b.c │ │ │ │ ├── loop-2c.c │ │ │ │ ├── loop-2d.c │ │ │ │ ├── loop-2e.c │ │ │ │ ├── loop-2f.c │ │ │ │ ├── loop-2g.c │ │ │ │ ├── loop-3.c │ │ │ │ ├── loop-3b.c │ │ │ │ ├── loop-3c.c │ │ │ │ ├── loop-4.c │ │ │ │ ├── loop-4b.c │ │ │ │ ├── loop-5.c │ │ │ │ ├── loop-6.c │ │ │ │ ├── loop-7.c │ │ │ │ ├── loop-8.c │ │ │ │ ├── loop-9.c │ │ │ │ ├── loop-ivopts-1.c │ │ │ │ ├── loop-ivopts-2.c │ │ │ │ ├── lshrdi-1.c │ │ │ │ ├── lto-tbaa-1.c │ │ │ │ ├── mayalias-1.c │ │ │ │ ├── mayalias-2.c │ │ │ │ ├── mayalias-3.c │ │ │ │ ├── medce-1.c │ │ │ │ ├── memcpy-1.c │ │ │ │ ├── memcpy-2.c │ │ │ │ ├── memcpy-bi.c │ │ │ │ ├── memset-1.c │ │ │ │ ├── memset-2.c │ │ │ │ ├── memset-3.c │ │ │ │ ├── memset-4.c │ │ │ │ ├── mod-1.c │ │ │ │ ├── mode-dependent-address.c │ │ │ │ ├── multdi-1.c │ │ │ │ ├── multi-ix.c │ │ │ │ ├── nest-align-1.c │ │ │ │ ├── nest-stdar-1.c │ │ │ │ ├── nestfunc-1.c │ │ │ │ ├── nestfunc-2.c │ │ │ │ ├── nestfunc-3.c │ │ │ │ ├── nestfunc-4.c │ │ │ │ ├── nestfunc-5.c │ │ │ │ ├── nestfunc-6.c │ │ │ │ ├── nestfunc-7.c │ │ │ │ ├── p18298.c │ │ │ │ ├── packed-1.c │ │ │ │ ├── packed-2.c │ │ │ │ ├── pending-4.c │ │ │ │ ├── postmod-1.c │ │ │ │ ├── pr15262-1.c │ │ │ │ ├── pr15262-2.c │ │ │ │ ├── pr15262.c │ │ │ │ ├── pr15296.c │ │ │ │ ├── pr16790-1.c │ │ │ │ ├── pr17078-1.c │ │ │ │ ├── pr17133.c │ │ │ │ ├── pr17252.c │ │ │ │ ├── pr17377.c │ │ │ │ ├── pr19005.c │ │ │ │ ├── pr19449.c │ │ │ │ ├── pr19515.c │ │ │ │ ├── pr19606.c │ │ │ │ ├── pr19687.c │ │ │ │ ├── pr19689.c │ │ │ │ ├── pr20100-1.c │ │ │ │ ├── pr20187-1.c │ │ │ │ ├── pr20466-1.c │ │ │ │ ├── pr20527-1.c │ │ │ │ ├── pr20601-1.c │ │ │ │ ├── pr20621-1.c │ │ │ │ ├── pr21173.c │ │ │ │ ├── pr21331.c │ │ │ │ ├── pr21964-1.c │ │ │ │ ├── pr22061-1.c │ │ │ │ ├── pr22061-2.c │ │ │ │ ├── pr22061-3.c │ │ │ │ ├── pr22061-4.c │ │ │ │ ├── pr22098-1.c │ │ │ │ ├── pr22098-2.c │ │ │ │ ├── pr22098-3.c │ │ │ │ ├── pr22348.c │ │ │ │ ├── pr22429.c │ │ │ │ ├── pr22493-1.c │ │ │ │ ├── pr22630.c │ │ │ │ ├── pr23047.c │ │ │ │ ├── pr23135.c │ │ │ │ ├── pr23324.c │ │ │ │ ├── pr23467.c │ │ │ │ ├── pr23604.c │ │ │ │ ├── pr23941.c │ │ │ │ ├── pr24135.c │ │ │ │ ├── pr24141.c │ │ │ │ ├── pr24142.c │ │ │ │ ├── pr24716.c │ │ │ │ ├── pr24851.c │ │ │ │ ├── pr25125.c │ │ │ │ ├── pr25737.c │ │ │ │ ├── pr27073.c │ │ │ │ ├── pr27260.c │ │ │ │ ├── pr27285.c │ │ │ │ ├── pr27364.c │ │ │ │ ├── pr27671-1.c │ │ │ │ ├── pr28289.c │ │ │ │ ├── pr28403.c │ │ │ │ ├── pr28651.c │ │ │ │ ├── pr28778.c │ │ │ │ ├── pr28865.c │ │ │ │ ├── pr28982a.c │ │ │ │ ├── pr28982b.c │ │ │ │ ├── pr29006.c │ │ │ │ ├── pr29156.c │ │ │ │ ├── pr29695-1.c │ │ │ │ ├── pr29695-2.c │ │ │ │ ├── pr29797-1.c │ │ │ │ ├── pr29797-2.c │ │ │ │ ├── pr29798.c │ │ │ │ ├── pr30185.c │ │ │ │ ├── pr30778.c │ │ │ │ ├── pr31072.c │ │ │ │ ├── pr31136.c │ │ │ │ ├── pr31169.c │ │ │ │ ├── pr31448-2.c │ │ │ │ ├── pr31448.c │ │ │ │ ├── pr31605.c │ │ │ │ ├── pr32244-1.c │ │ │ │ ├── pr32500.c │ │ │ │ ├── pr33142.c │ │ │ │ ├── pr33382.c │ │ │ │ ├── pr33631.c │ │ │ │ ├── pr33669.c │ │ │ │ ├── pr33779-1.c │ │ │ │ ├── pr33779-2.c │ │ │ │ ├── pr33870-1.c │ │ │ │ ├── pr33870.c │ │ │ │ ├── pr33992.c │ │ │ │ ├── pr34070-1.c │ │ │ │ ├── pr34070-2.c │ │ │ │ ├── pr34099-2.c │ │ │ │ ├── pr34099.c │ │ │ │ ├── pr34130.c │ │ │ │ ├── pr34154.c │ │ │ │ ├── pr34176.c │ │ │ │ ├── pr34415.c │ │ │ │ ├── pr34456.c │ │ │ │ ├── pr34768-1.c │ │ │ │ ├── pr34768-2.c │ │ │ │ ├── pr34971.c │ │ │ │ ├── pr34982.c │ │ │ │ ├── pr35163.c │ │ │ │ ├── pr35231.c │ │ │ │ ├── pr35390.c │ │ │ │ ├── pr35456.c │ │ │ │ ├── pr35472.c │ │ │ │ ├── pr35800.c │ │ │ │ ├── pr36034-1.c │ │ │ │ ├── pr36034-2.c │ │ │ │ ├── pr36038.c │ │ │ │ ├── pr36077.c │ │ │ │ ├── pr36093.c │ │ │ │ ├── pr36321.c │ │ │ │ ├── pr36339.c │ │ │ │ ├── pr36343.c │ │ │ │ ├── pr36691.c │ │ │ │ ├── pr36765.c │ │ │ │ ├── pr37102.c │ │ │ │ ├── pr37125.c │ │ │ │ ├── pr37573.c │ │ │ │ ├── pr37882.c │ │ │ │ ├── pr37924.c │ │ │ │ ├── pr37931.c │ │ │ │ ├── pr38048-1.c │ │ │ │ ├── pr38048-2.c │ │ │ │ ├── pr38051.c │ │ │ │ ├── pr38151.c │ │ │ │ ├── pr38212.c │ │ │ │ ├── pr38236.c │ │ │ │ ├── pr38422.c │ │ │ │ ├── pr38533.c │ │ │ │ ├── pr38819.c │ │ │ │ ├── pr38969.c │ │ │ │ ├── pr39100.c │ │ │ │ ├── pr39120.c │ │ │ │ ├── pr39228.c │ │ │ │ ├── pr39233.c │ │ │ │ ├── pr39240.c │ │ │ │ ├── pr39339.c │ │ │ │ ├── pr39501.c │ │ │ │ ├── pr40022.c │ │ │ │ ├── pr40057.c │ │ │ │ ├── pr40386.c │ │ │ │ ├── pr40404.c │ │ │ │ ├── pr40493.c │ │ │ │ ├── pr40579.c │ │ │ │ ├── pr40657.c │ │ │ │ ├── pr40668.c │ │ │ │ ├── pr40747.c │ │ │ │ ├── pr41239.c │ │ │ │ ├── pr41317.c │ │ │ │ ├── pr41395-1.c │ │ │ │ ├── pr41395-2.c │ │ │ │ ├── pr41463.c │ │ │ │ ├── pr41750.c │ │ │ │ ├── pr41917.c │ │ │ │ ├── pr41919.c │ │ │ │ ├── pr41935.c │ │ │ │ ├── pr42006.c │ │ │ │ ├── pr42142.c │ │ │ │ ├── pr42154.c │ │ │ │ ├── pr42231.c │ │ │ │ ├── pr42248.c │ │ │ │ ├── pr42269-2.c │ │ │ │ ├── pr42512.c │ │ │ │ ├── pr42544.c │ │ │ │ ├── pr42570.c │ │ │ │ ├── pr42614.c │ │ │ │ ├── pr42691.c │ │ │ │ ├── pr42721.c │ │ │ │ ├── pr42833.c │ │ │ │ ├── pr43008.c │ │ │ │ ├── pr43220.c │ │ │ │ ├── pr43236.c │ │ │ │ ├── pr43269.c │ │ │ │ ├── pr43385.c │ │ │ │ ├── pr43438.c │ │ │ │ ├── pr43560.c │ │ │ │ ├── pr43629.c │ │ │ │ ├── pr43783.c │ │ │ │ ├── pr43784.c │ │ │ │ ├── pr43835.c │ │ │ │ ├── pr43987.c │ │ │ │ ├── pr44164.c │ │ │ │ ├── pr44202-1.c │ │ │ │ ├── pr44468.c │ │ │ │ ├── pr44555.c │ │ │ │ ├── pr44575.c │ │ │ │ ├── pr44683.c │ │ │ │ ├── pr44828.c │ │ │ │ ├── pr44852.c │ │ │ │ ├── pr44858.c │ │ │ │ ├── pr44942.c │ │ │ │ ├── pr45034.c │ │ │ │ ├── pr45070.c │ │ │ │ ├── pr45262.c │ │ │ │ ├── pr45695.c │ │ │ │ ├── pr46019.c │ │ │ │ ├── pr46309.c │ │ │ │ ├── pr46316.c │ │ │ │ ├── pr46909-1.c │ │ │ │ ├── pr46909-2.c │ │ │ │ ├── pr47148.c │ │ │ │ ├── pr47155.c │ │ │ │ ├── pr47237.c │ │ │ │ ├── pr47299.c │ │ │ │ ├── pr47337.c │ │ │ │ ├── pr47538.c │ │ │ │ ├── pr47925.c │ │ │ │ ├── pr48197.c │ │ │ │ ├── pr48571-1.c │ │ │ │ ├── pr48717.c │ │ │ │ ├── pr48809.c │ │ │ │ ├── pr48814-1.c │ │ │ │ ├── pr48814-2.c │ │ │ │ ├── pr48973-1.c │ │ │ │ ├── pr48973-2.c │ │ │ │ ├── pr49039.c │ │ │ │ ├── pr49073.c │ │ │ │ ├── pr49123.c │ │ │ │ ├── pr49161.c │ │ │ │ ├── pr49186.c │ │ │ │ ├── pr49218.c │ │ │ │ ├── pr49279.c │ │ │ │ ├── pr49281.c │ │ │ │ ├── pr49390.c │ │ │ │ ├── pr49419.c │ │ │ │ ├── pr49644.c │ │ │ │ ├── pr49712.c │ │ │ │ ├── pr49768.c │ │ │ │ ├── pr49886.c │ │ │ │ ├── pr50865.c │ │ │ │ ├── pr51023.c │ │ │ │ ├── pr51323.c │ │ │ │ ├── pr51447.c │ │ │ │ ├── pr51466.c │ │ │ │ ├── pr51581-1.c │ │ │ │ ├── pr51581-2.c │ │ │ │ ├── pr51877.c │ │ │ │ ├── pr51933.c │ │ │ │ ├── pr52129.c │ │ │ │ ├── pr52209.c │ │ │ │ ├── pr52286.c │ │ │ │ ├── pr52760.c │ │ │ │ ├── pr52979-1.c │ │ │ │ ├── pr52979-2.c │ │ │ │ ├── pr53084.c │ │ │ │ ├── pr53160.c │ │ │ │ ├── pr53465.c │ │ │ │ ├── pr53645-2.c │ │ │ │ ├── pr53645.c │ │ │ │ ├── pr53688.c │ │ │ │ ├── pr54471.c │ │ │ │ ├── pr54937.c │ │ │ │ ├── pr54985.c │ │ │ │ ├── pr55137.c │ │ │ │ ├── pr55750.c │ │ │ │ ├── pr55875.c │ │ │ │ ├── pr56051.c │ │ │ │ ├── pr56205.c │ │ │ │ ├── pr56250.c │ │ │ │ ├── pr56799.c │ │ │ │ ├── pr56837.c │ │ │ │ ├── pr56866.c │ │ │ │ ├── pr56899.c │ │ │ │ ├── pr56962.c │ │ │ │ ├── pr56982.c │ │ │ │ ├── pr57124.c │ │ │ │ ├── pr57130.c │ │ │ │ ├── pr57131.c │ │ │ │ ├── pr57144.c │ │ │ │ ├── pr57281.c │ │ │ │ ├── pr57321.c │ │ │ │ ├── pr57344-1.c │ │ │ │ ├── pr57344-2.c │ │ │ │ ├── pr57344-3.c │ │ │ │ ├── pr57344-4.c │ │ │ │ ├── pr57568.c │ │ │ │ ├── pr57829.c │ │ │ │ ├── pr57860.c │ │ │ │ ├── pr57861.c │ │ │ │ ├── pr57875.c │ │ │ │ ├── pr57876.c │ │ │ │ ├── pr57877.c │ │ │ │ ├── pr58209.c │ │ │ │ ├── pr58277-1.c │ │ │ │ ├── pr58277-2.c │ │ │ │ ├── pr58364.c │ │ │ │ ├── pr58365.c │ │ │ │ ├── pr58385.c │ │ │ │ ├── pr58387.c │ │ │ │ ├── pr58419.c │ │ │ │ ├── pr58431.c │ │ │ │ ├── pr58564.c │ │ │ │ ├── pr58570.c │ │ │ │ ├── pr58574.c │ │ │ │ ├── pr58640-2.c │ │ │ │ ├── pr58640.c │ │ │ │ ├── pr58662.c │ │ │ │ ├── pr58726.c │ │ │ │ ├── pr58831.c │ │ │ │ ├── pr58943.c │ │ │ │ ├── pr58984.c │ │ │ │ ├── pr59014-2.c │ │ │ │ ├── pr59014.c │ │ │ │ ├── pr59101.c │ │ │ │ ├── pr59221.c │ │ │ │ ├── pr59229.c │ │ │ │ ├── pr59358.c │ │ │ │ ├── pr59387.c │ │ │ │ ├── pr59388.c │ │ │ │ ├── pr59413.c │ │ │ │ ├── pr59643.c │ │ │ │ ├── pr59747.c │ │ │ │ ├── pr60003.c │ │ │ │ ├── pr60017.c │ │ │ │ ├── pr60062.c │ │ │ │ ├── pr60072.c │ │ │ │ ├── pr60454.c │ │ │ │ ├── pr60822.c │ │ │ │ ├── pr60960.c │ │ │ │ ├── pr61306-1.c │ │ │ │ ├── pr61306-2.c │ │ │ │ ├── pr61306-3.c │ │ │ │ ├── pr61375.c │ │ │ │ ├── pr61517.c │ │ │ │ ├── pr61673.c │ │ │ │ ├── pr61682.c │ │ │ │ ├── pr61725.c │ │ │ │ ├── pr62151.c │ │ │ │ ├── pr63209.c │ │ │ │ ├── pr63302.c │ │ │ │ ├── pr63641.c │ │ │ │ ├── pr63659.c │ │ │ │ ├── pr63843.c │ │ │ │ ├── pr64006.c │ │ │ │ ├── pr64255.c │ │ │ │ ├── pr64260.c │ │ │ │ ├── pr64682.c │ │ │ │ ├── pr64718.c │ │ │ │ ├── pr64756.c │ │ │ │ ├── pr64957.c │ │ │ │ ├── pr64979.c │ │ │ │ ├── pr65053-1.c │ │ │ │ ├── pr65053-2.c │ │ │ │ ├── pr65170.c │ │ │ │ ├── pr65215-1.c │ │ │ │ ├── pr65215-2.c │ │ │ │ ├── pr65215-3.c │ │ │ │ ├── pr65215-4.c │ │ │ │ ├── pr65215-5.c │ │ │ │ ├── pr65216.c │ │ │ │ ├── pr65369.c │ │ │ │ ├── pr65401.c │ │ │ │ ├── pr65418-1.c │ │ │ │ ├── pr65418-2.c │ │ │ │ ├── pr65427.c │ │ │ │ ├── pr65648.c │ │ │ │ ├── pr65956.c │ │ │ │ ├── pr66187.c │ │ │ │ ├── pr66233.c │ │ │ │ ├── pr66556.c │ │ │ │ ├── pr66757.c │ │ │ │ ├── pr67037.c │ │ │ │ ├── pr67226.c │ │ │ │ ├── pr67714.c │ │ │ │ ├── pr67781.c │ │ │ │ ├── pr67929_1.c │ │ │ │ ├── pr68143_1.c │ │ │ │ ├── pr68185.c │ │ │ │ ├── pr68249.c │ │ │ │ ├── pr68250.c │ │ │ │ ├── pr68321.c │ │ │ │ ├── pr68328.c │ │ │ │ ├── pr68376-1.c │ │ │ │ ├── pr68376-2.c │ │ │ │ ├── pr68381.c │ │ │ │ ├── pr68390.c │ │ │ │ ├── pr68506.c │ │ │ │ ├── pr68532.c │ │ │ │ ├── pr68624.c │ │ │ │ ├── pr68648.c │ │ │ │ ├── pr68841.c │ │ │ │ ├── pr68911.c │ │ │ │ ├── pr69097-1.c │ │ │ │ ├── pr69097-2.c │ │ │ │ ├── pr69320-1.c │ │ │ │ ├── pr69320-2.c │ │ │ │ ├── pr69320-3.c │ │ │ │ ├── pr69320-4.c │ │ │ │ ├── pr69403.c │ │ │ │ ├── pr69447.c │ │ │ │ ├── pr69691.c │ │ │ │ ├── pr70005.c │ │ │ │ ├── pr70127.c │ │ │ │ ├── pr70222-1.c │ │ │ │ ├── pr70222-2.c │ │ │ │ ├── pr70429.c │ │ │ │ ├── pr70460.c │ │ │ │ ├── pr70566.c │ │ │ │ ├── pr70586.c │ │ │ │ ├── pr70602.c │ │ │ │ ├── pr71083.c │ │ │ │ ├── pr71494.c │ │ │ │ ├── pr71554.c │ │ │ │ ├── pr71626-1.c │ │ │ │ ├── pr71626-2.c │ │ │ │ ├── pr71700.c │ │ │ │ ├── pr7284-1.c │ │ │ │ ├── pr78378.c │ │ │ │ ├── printf-1.c │ │ │ │ ├── printf-chk-1.c │ │ │ │ ├── pta-field-1.c │ │ │ │ ├── pta-field-2.c │ │ │ │ ├── ptr-arith-1.c │ │ │ │ ├── pure-1.c │ │ │ │ ├── pushpop_macro.c │ │ │ │ ├── regstack-1.c │ │ │ │ ├── restrict-1.c │ │ │ │ ├── scal-to-vec1.c │ │ │ │ ├── scal-to-vec2.c │ │ │ │ ├── scal-to-vec3.c │ │ │ │ ├── scope-1.c │ │ │ │ ├── shiftdi.c │ │ │ │ ├── shiftopt-1.c │ │ │ │ ├── simd-1.c │ │ │ │ ├── simd-2.c │ │ │ │ ├── simd-4.c │ │ │ │ ├── simd-5.c │ │ │ │ ├── simd-6.c │ │ │ │ ├── stdarg-1.c │ │ │ │ ├── stdarg-2.c │ │ │ │ ├── stdarg-3.c │ │ │ │ ├── stdarg-4.c │ │ │ │ ├── stkalign.c │ │ │ │ ├── strcmp-1.c │ │ │ │ ├── strcpy-1.c │ │ │ │ ├── strcpy-2.c │ │ │ │ ├── strct-pack-1.c │ │ │ │ ├── strct-pack-2.c │ │ │ │ ├── strct-pack-3.c │ │ │ │ ├── strct-pack-4.c │ │ │ │ ├── strct-stdarg-1.c │ │ │ │ ├── strct-varg-1.c │ │ │ │ ├── string-opt-17.c │ │ │ │ ├── string-opt-18.c │ │ │ │ ├── string-opt-5.c │ │ │ │ ├── strlen-1.c │ │ │ │ ├── strncmp-1.c │ │ │ │ ├── struct-aliasing-1.c │ │ │ │ ├── struct-cpy-1.c │ │ │ │ ├── struct-ini-1.c │ │ │ │ ├── struct-ini-2.c │ │ │ │ ├── struct-ini-3.c │ │ │ │ ├── struct-ini-4.c │ │ │ │ ├── struct-ret-1.c │ │ │ │ ├── struct-ret-2.c │ │ │ │ ├── switch-1.c │ │ │ │ ├── tstdi-1.c │ │ │ │ ├── unroll-1.c │ │ │ │ ├── usmul.c │ │ │ │ ├── va-arg-1.c │ │ │ │ ├── va-arg-10.c │ │ │ │ ├── va-arg-11.c │ │ │ │ ├── va-arg-12.c │ │ │ │ ├── va-arg-13.c │ │ │ │ ├── va-arg-14.c │ │ │ │ ├── va-arg-15.c │ │ │ │ ├── va-arg-16.c │ │ │ │ ├── va-arg-17.c │ │ │ │ ├── va-arg-18.c │ │ │ │ ├── va-arg-19.c │ │ │ │ ├── va-arg-2.c │ │ │ │ ├── va-arg-20.c │ │ │ │ ├── va-arg-21.c │ │ │ │ ├── va-arg-22.c │ │ │ │ ├── va-arg-23.c │ │ │ │ ├── va-arg-24.c │ │ │ │ ├── va-arg-26.c │ │ │ │ ├── va-arg-4.c │ │ │ │ ├── va-arg-5.c │ │ │ │ ├── va-arg-6.c │ │ │ │ ├── va-arg-7.c │ │ │ │ ├── va-arg-8.c │ │ │ │ ├── va-arg-9.c │ │ │ │ ├── va-arg-pack-1.c │ │ │ │ ├── va-arg-trap-1.c │ │ │ │ ├── vfprintf-1.c │ │ │ │ ├── vfprintf-chk-1.c │ │ │ │ ├── vla-dealloc-1.c │ │ │ │ ├── vprintf-1.c │ │ │ │ ├── vprintf-chk-1.c │ │ │ │ ├── vrp-1.c │ │ │ │ ├── vrp-2.c │ │ │ │ ├── vrp-3.c │ │ │ │ ├── vrp-4.c │ │ │ │ ├── vrp-5.c │ │ │ │ ├── vrp-6.c │ │ │ │ ├── vrp-7.c │ │ │ │ ├── wchar_t-1.c │ │ │ │ ├── widechar-1.c │ │ │ │ ├── widechar-2.c │ │ │ │ ├── zero-struct-1.c │ │ │ │ ├── zero-struct-2.c │ │ │ │ ├── zerolen-1.c │ │ │ │ └── zerolen-2.c │ │ │ └── unsorted/ │ │ │ ├── dump-noaddr.c │ │ │ ├── dump-noaddr.x │ │ │ └── unsorted.exp │ │ └── source-url │ ├── issue3.h │ ├── issue4.c │ ├── issue50.h │ ├── issue57.c │ ├── issue62.c │ ├── issue64.c │ ├── issue65.c │ ├── issue66.c │ ├── issue67.c │ ├── issue68.h │ ├── issue69.h │ ├── issue72.h │ ├── issue74.h │ ├── issue77.c │ ├── issue78.c │ ├── issue8.h │ ├── issue80.c │ ├── issue81.c │ ├── issue82.c │ ├── issue84.c │ ├── issue85.c │ ├── issue86.c │ ├── issue87.c │ ├── issue88.c │ ├── issue89.c │ ├── issue9.c │ ├── issue90.c │ ├── issue92.c │ ├── issue93.c │ ├── issue93.h │ ├── issue9b.c │ ├── paste.c │ ├── paste2.c │ ├── redecl.c │ ├── tcc-0.9.26/ │ │ ├── COPYING │ │ ├── source-url │ │ └── tests/ │ │ └── tests2/ │ │ ├── 00_assignment.c │ │ ├── 00_assignment.expect │ │ ├── 01_comment.c │ │ ├── 01_comment.expect │ │ ├── 02_printf.c │ │ ├── 02_printf.expect │ │ ├── 03_struct.c │ │ ├── 03_struct.expect │ │ ├── 04_for.c │ │ ├── 04_for.expect │ │ ├── 05_array.c │ │ ├── 05_array.expect │ │ ├── 06_case.c │ │ ├── 06_case.expect │ │ ├── 07_function.c │ │ ├── 07_function.expect │ │ ├── 08_while.c │ │ ├── 08_while.expect │ │ ├── 09_do_while.c │ │ ├── 09_do_while.expect │ │ ├── 10_pointer.c │ │ ├── 10_pointer.expect │ │ ├── 11_precedence.c │ │ ├── 11_precedence.expect │ │ ├── 12_hashdefine.c │ │ ├── 12_hashdefine.expect │ │ ├── 13_integer_literals.c │ │ ├── 13_integer_literals.expect │ │ ├── 14_if.c │ │ ├── 14_if.expect │ │ ├── 15_recursion.c │ │ ├── 15_recursion.expect │ │ ├── 16_nesting.c │ │ ├── 16_nesting.expect │ │ ├── 17_enum.c │ │ ├── 17_enum.expect │ │ ├── 18_include.c │ │ ├── 18_include.expect │ │ ├── 18_include.h │ │ ├── 19_pointer_arithmetic.c │ │ ├── 19_pointer_arithmetic.expect │ │ ├── 20_pointer_comparison.c │ │ ├── 20_pointer_comparison.expect │ │ ├── 21_char_array.c │ │ ├── 21_char_array.expect │ │ ├── 22_floating_point.c │ │ ├── 22_floating_point.expect │ │ ├── 23_type_coercion.c │ │ ├── 23_type_coercion.expect │ │ ├── 24_math_library.c │ │ ├── 24_math_library.expect │ │ ├── 25_quicksort.c │ │ ├── 25_quicksort.expect │ │ ├── 26_character_constants.c │ │ ├── 26_character_constants.expect │ │ ├── 27_sizeof.c │ │ ├── 27_sizeof.expect │ │ ├── 28_strings.c │ │ ├── 28_strings.expect │ │ ├── 29_array_address.c │ │ ├── 29_array_address.expect │ │ ├── 30_hanoi.c │ │ ├── 30_hanoi.expect │ │ ├── 31_args.c │ │ ├── 31_args.expect │ │ ├── 32_led.c │ │ ├── 32_led.expect │ │ ├── 33_ternary_op.c │ │ ├── 33_ternary_op.expect │ │ ├── 34_array_assignment.c │ │ ├── 34_array_assignment.expect │ │ ├── 35_sizeof.c │ │ ├── 35_sizeof.expect │ │ ├── 36_array_initialisers.c │ │ ├── 36_array_initialisers.expect │ │ ├── 37_sprintf.c │ │ ├── 37_sprintf.expect │ │ ├── 38_multiple_array_index.c │ │ ├── 38_multiple_array_index.expect │ │ ├── 39_typedef.c │ │ ├── 39_typedef.expect │ │ ├── 40_stdio.c │ │ ├── 40_stdio.expect │ │ ├── 41_hashif.c │ │ ├── 41_hashif.expect │ │ ├── 42_function_pointer.c │ │ ├── 42_function_pointer.expect │ │ ├── 43_void_param.c │ │ ├── 43_void_param.expect │ │ ├── 44_scoped_declarations.c │ │ ├── 44_scoped_declarations.expect │ │ ├── 45_empty_for.c │ │ ├── 45_empty_for.expect │ │ ├── 46_grep.c │ │ ├── 47_switch_return.c │ │ ├── 47_switch_return.expect │ │ ├── 48_nested_break.c │ │ ├── 48_nested_break.expect │ │ ├── 49_bracket_evaluation.c │ │ ├── 49_bracket_evaluation.expect │ │ ├── 50_logical_second_arg.c │ │ ├── 50_logical_second_arg.expect │ │ ├── 51_static.c │ │ ├── 51_static.expect │ │ ├── 52_unnamed_enum.c │ │ ├── 52_unnamed_enum.expect │ │ ├── 54_goto.c │ │ ├── 54_goto.expect │ │ ├── 55_lshift_type.c │ │ ├── 55_lshift_type.expect │ │ ├── LICENSE │ │ └── Makefile │ └── vers2.h ├── trigraphs.go ├── trigraphs.l ├── ucn32.go ├── ucn64.go ├── v2/ │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── all_test.go │ ├── ast.go │ ├── ast2.go │ ├── ast_test.go │ ├── cc.go │ ├── cpp.go │ ├── encoding.go │ ├── enum.go │ ├── etc.go │ ├── headers/ │ │ ├── LICENSE-GCC-RTE-V3.1 │ │ ├── LICENSE-GPL-V3.txt │ │ ├── Makefile │ │ ├── all_test.go │ │ ├── features.c │ │ ├── generator.go │ │ ├── linux_386/ │ │ │ ├── builtin.h │ │ │ ├── paths │ │ │ ├── predefined.h │ │ │ └── usr/ │ │ │ ├── include/ │ │ │ │ ├── alloca.h │ │ │ │ ├── arpa/ │ │ │ │ │ └── inet.h │ │ │ │ ├── asm-generic/ │ │ │ │ │ ├── errno-base.h │ │ │ │ │ ├── errno.h │ │ │ │ │ ├── ioctl.h │ │ │ │ │ ├── ioctls.h │ │ │ │ │ ├── param.h │ │ │ │ │ ├── socket.h │ │ │ │ │ └── sockios.h │ │ │ │ ├── assert.h │ │ │ │ ├── ctype.h │ │ │ │ ├── dirent.h │ │ │ │ ├── dlfcn.h │ │ │ │ ├── endian.h │ │ │ │ ├── errno.h │ │ │ │ ├── execinfo.h │ │ │ │ ├── fcntl.h │ │ │ │ ├── features.h │ │ │ │ ├── fts.h │ │ │ │ ├── getopt.h │ │ │ │ ├── grp.h │ │ │ │ ├── i386-linux-gnu/ │ │ │ │ │ ├── asm/ │ │ │ │ │ │ ├── errno.h │ │ │ │ │ │ ├── ioctl.h │ │ │ │ │ │ ├── ioctls.h │ │ │ │ │ │ ├── param.h │ │ │ │ │ │ ├── socket.h │ │ │ │ │ │ └── sockios.h │ │ │ │ │ ├── bits/ │ │ │ │ │ │ ├── _G_config.h │ │ │ │ │ │ ├── byteswap-16.h │ │ │ │ │ │ ├── byteswap.h │ │ │ │ │ │ ├── confname.h │ │ │ │ │ │ ├── cpu-set.h │ │ │ │ │ │ ├── dirent.h │ │ │ │ │ │ ├── dlfcn.h │ │ │ │ │ │ ├── endian.h │ │ │ │ │ │ ├── environments.h │ │ │ │ │ │ ├── errno.h │ │ │ │ │ │ ├── fcntl-linux.h │ │ │ │ │ │ ├── fcntl.h │ │ │ │ │ │ ├── floatn-common.h │ │ │ │ │ │ ├── floatn.h │ │ │ │ │ │ ├── flt-eval-method.h │ │ │ │ │ │ ├── fp-fast.h │ │ │ │ │ │ ├── fp-logb.h │ │ │ │ │ │ ├── getopt_core.h │ │ │ │ │ │ ├── getopt_ext.h │ │ │ │ │ │ ├── getopt_posix.h │ │ │ │ │ │ ├── in.h │ │ │ │ │ │ ├── ioctl-types.h │ │ │ │ │ │ ├── ioctls.h │ │ │ │ │ │ ├── libc-header-start.h │ │ │ │ │ │ ├── libio.h │ │ │ │ │ │ ├── libm-simd-decl-stubs.h │ │ │ │ │ │ ├── local_lim.h │ │ │ │ │ │ ├── locale.h │ │ │ │ │ │ ├── long-double.h │ │ │ │ │ │ ├── math-vector.h │ │ │ │ │ │ ├── mathcalls-helper-functions.h │ │ │ │ │ │ ├── mathcalls.h │ │ │ │ │ │ ├── mman-linux.h │ │ │ │ │ │ ├── mman-shared.h │ │ │ │ │ │ ├── mman.h │ │ │ │ │ │ ├── netdb.h │ │ │ │ │ │ ├── param.h │ │ │ │ │ │ ├── posix1_lim.h │ │ │ │ │ │ ├── posix2_lim.h │ │ │ │ │ │ ├── posix_opt.h │ │ │ │ │ │ ├── pthreadtypes-arch.h │ │ │ │ │ │ ├── pthreadtypes.h │ │ │ │ │ │ ├── resource.h │ │ │ │ │ │ ├── sched.h │ │ │ │ │ │ ├── select.h │ │ │ │ │ │ ├── setjmp.h │ │ │ │ │ │ ├── sigaction.h │ │ │ │ │ │ ├── sigcontext.h │ │ │ │ │ │ ├── sigevent-consts.h │ │ │ │ │ │ ├── siginfo-arch.h │ │ │ │ │ │ ├── siginfo-consts.h │ │ │ │ │ │ ├── signum-generic.h │ │ │ │ │ │ ├── signum.h │ │ │ │ │ │ ├── sigstack.h │ │ │ │ │ │ ├── sigthread.h │ │ │ │ │ │ ├── sockaddr.h │ │ │ │ │ │ ├── socket.h │ │ │ │ │ │ ├── socket_type.h │ │ │ │ │ │ ├── ss_flags.h │ │ │ │ │ │ ├── stat.h │ │ │ │ │ │ ├── statfs.h │ │ │ │ │ │ ├── stdint-intn.h │ │ │ │ │ │ ├── stdint-uintn.h │ │ │ │ │ │ ├── stdio_lim.h │ │ │ │ │ │ ├── stdlib-float.h │ │ │ │ │ │ ├── sys_errlist.h │ │ │ │ │ │ ├── sysmacros.h │ │ │ │ │ │ ├── termios.h │ │ │ │ │ │ ├── thread-shared-types.h │ │ │ │ │ │ ├── time.h │ │ │ │ │ │ ├── types/ │ │ │ │ │ │ │ ├── FILE.h │ │ │ │ │ │ │ ├── __FILE.h │ │ │ │ │ │ │ ├── __locale_t.h │ │ │ │ │ │ │ ├── __mbstate_t.h │ │ │ │ │ │ │ ├── __sigset_t.h │ │ │ │ │ │ │ ├── __sigval_t.h │ │ │ │ │ │ │ ├── clock_t.h │ │ │ │ │ │ │ ├── clockid_t.h │ │ │ │ │ │ │ ├── locale_t.h │ │ │ │ │ │ │ ├── mbstate_t.h │ │ │ │ │ │ │ ├── sig_atomic_t.h │ │ │ │ │ │ │ ├── sigevent_t.h │ │ │ │ │ │ │ ├── siginfo_t.h │ │ │ │ │ │ │ ├── sigset_t.h │ │ │ │ │ │ │ ├── sigval_t.h │ │ │ │ │ │ │ ├── stack_t.h │ │ │ │ │ │ │ ├── struct_iovec.h │ │ │ │ │ │ │ ├── struct_itimerspec.h │ │ │ │ │ │ │ ├── struct_osockaddr.h │ │ │ │ │ │ │ ├── struct_rusage.h │ │ │ │ │ │ │ ├── struct_sigstack.h │ │ │ │ │ │ │ ├── struct_timespec.h │ │ │ │ │ │ │ ├── struct_timeval.h │ │ │ │ │ │ │ ├── struct_tm.h │ │ │ │ │ │ │ ├── time_t.h │ │ │ │ │ │ │ ├── timer_t.h │ │ │ │ │ │ │ └── wint_t.h │ │ │ │ │ │ ├── types.h │ │ │ │ │ │ ├── typesizes.h │ │ │ │ │ │ ├── uintn-identity.h │ │ │ │ │ │ ├── uio_lim.h │ │ │ │ │ │ ├── utsname.h │ │ │ │ │ │ ├── waitflags.h │ │ │ │ │ │ ├── waitstatus.h │ │ │ │ │ │ ├── wchar.h │ │ │ │ │ │ ├── wordsize.h │ │ │ │ │ │ └── xopen_lim.h │ │ │ │ │ ├── gnu/ │ │ │ │ │ │ ├── stubs-32.h │ │ │ │ │ │ └── stubs.h │ │ │ │ │ └── sys/ │ │ │ │ │ ├── cdefs.h │ │ │ │ │ ├── file.h │ │ │ │ │ ├── ioctl.h │ │ │ │ │ ├── mman.h │ │ │ │ │ ├── param.h │ │ │ │ │ ├── resource.h │ │ │ │ │ ├── select.h │ │ │ │ │ ├── socket.h │ │ │ │ │ ├── stat.h │ │ │ │ │ ├── statfs.h │ │ │ │ │ ├── sysmacros.h │ │ │ │ │ ├── time.h │ │ │ │ │ ├── ttydefaults.h │ │ │ │ │ ├── types.h │ │ │ │ │ ├── ucontext.h │ │ │ │ │ ├── uio.h │ │ │ │ │ ├── un.h │ │ │ │ │ ├── utsname.h │ │ │ │ │ └── wait.h │ │ │ │ ├── inttypes.h │ │ │ │ ├── limits.h │ │ │ │ ├── linux/ │ │ │ │ │ ├── errno.h │ │ │ │ │ ├── ioctl.h │ │ │ │ │ ├── limits.h │ │ │ │ │ └── param.h │ │ │ │ ├── locale.h │ │ │ │ ├── malloc.h │ │ │ │ ├── math.h │ │ │ │ ├── memory.h │ │ │ │ ├── netdb.h │ │ │ │ ├── netinet/ │ │ │ │ │ └── in.h │ │ │ │ ├── pthread.h │ │ │ │ ├── pwd.h │ │ │ │ ├── rpc/ │ │ │ │ │ └── netdb.h │ │ │ │ ├── sched.h │ │ │ │ ├── setjmp.h │ │ │ │ ├── signal.h │ │ │ │ ├── stdc-predef.h │ │ │ │ ├── stdint.h │ │ │ │ ├── stdio.h │ │ │ │ ├── stdlib.h │ │ │ │ ├── string.h │ │ │ │ ├── strings.h │ │ │ │ ├── termios.h │ │ │ │ ├── time.h │ │ │ │ ├── unistd.h │ │ │ │ ├── utime.h │ │ │ │ ├── wchar.h │ │ │ │ ├── zconf.h │ │ │ │ └── zlib.h │ │ │ └── lib/ │ │ │ └── gcc/ │ │ │ └── i686-linux-gnu/ │ │ │ └── 7/ │ │ │ ├── include/ │ │ │ │ ├── float.h │ │ │ │ ├── stdarg.h │ │ │ │ ├── stdbool.h │ │ │ │ ├── stddef.h │ │ │ │ └── stdint.h │ │ │ └── include-fixed/ │ │ │ ├── limits.h │ │ │ └── syslimits.h │ │ ├── linux_amd64/ │ │ │ ├── builtin.h │ │ │ ├── paths │ │ │ ├── predefined.h │ │ │ └── usr/ │ │ │ ├── include/ │ │ │ │ ├── _G_config.h │ │ │ │ ├── alloca.h │ │ │ │ ├── arpa/ │ │ │ │ │ └── inet.h │ │ │ │ ├── asm/ │ │ │ │ │ ├── errno.h │ │ │ │ │ ├── ioctl.h │ │ │ │ │ ├── ioctls.h │ │ │ │ │ ├── param.h │ │ │ │ │ ├── socket.h │ │ │ │ │ └── sockios.h │ │ │ │ ├── asm-generic/ │ │ │ │ │ ├── errno-base.h │ │ │ │ │ ├── errno.h │ │ │ │ │ ├── ioctl.h │ │ │ │ │ ├── ioctls.h │ │ │ │ │ ├── param.h │ │ │ │ │ ├── socket.h │ │ │ │ │ └── sockios.h │ │ │ │ ├── assert.h │ │ │ │ ├── bits/ │ │ │ │ │ ├── byteswap-16.h │ │ │ │ │ ├── byteswap.h │ │ │ │ │ ├── confname.h │ │ │ │ │ ├── dirent.h │ │ │ │ │ ├── dlfcn.h │ │ │ │ │ ├── endian.h │ │ │ │ │ ├── environments.h │ │ │ │ │ ├── errno.h │ │ │ │ │ ├── fcntl-linux.h │ │ │ │ │ ├── fcntl.h │ │ │ │ │ ├── huge_val.h │ │ │ │ │ ├── huge_valf.h │ │ │ │ │ ├── huge_vall.h │ │ │ │ │ ├── in.h │ │ │ │ │ ├── inf.h │ │ │ │ │ ├── ioctl-types.h │ │ │ │ │ ├── ioctls.h │ │ │ │ │ ├── libm-simd-decl-stubs.h │ │ │ │ │ ├── local_lim.h │ │ │ │ │ ├── locale.h │ │ │ │ │ ├── math-vector.h │ │ │ │ │ ├── mathcalls.h │ │ │ │ │ ├── mathdef.h │ │ │ │ │ ├── mman-linux.h │ │ │ │ │ ├── mman.h │ │ │ │ │ ├── nan.h │ │ │ │ │ ├── netdb.h │ │ │ │ │ ├── param.h │ │ │ │ │ ├── posix1_lim.h │ │ │ │ │ ├── posix2_lim.h │ │ │ │ │ ├── posix_opt.h │ │ │ │ │ ├── pthreadtypes.h │ │ │ │ │ ├── resource.h │ │ │ │ │ ├── sched.h │ │ │ │ │ ├── select.h │ │ │ │ │ ├── setjmp.h │ │ │ │ │ ├── sigaction.h │ │ │ │ │ ├── sigcontext.h │ │ │ │ │ ├── siginfo.h │ │ │ │ │ ├── signum.h │ │ │ │ │ ├── sigset.h │ │ │ │ │ ├── sigstack.h │ │ │ │ │ ├── sigthread.h │ │ │ │ │ ├── sockaddr.h │ │ │ │ │ ├── socket.h │ │ │ │ │ ├── socket_type.h │ │ │ │ │ ├── stat.h │ │ │ │ │ ├── statfs.h │ │ │ │ │ ├── stdio_lim.h │ │ │ │ │ ├── stdlib-float.h │ │ │ │ │ ├── sys_errlist.h │ │ │ │ │ ├── termios.h │ │ │ │ │ ├── time.h │ │ │ │ │ ├── types.h │ │ │ │ │ ├── typesizes.h │ │ │ │ │ ├── uio.h │ │ │ │ │ ├── utsname.h │ │ │ │ │ ├── waitflags.h │ │ │ │ │ ├── waitstatus.h │ │ │ │ │ ├── wchar.h │ │ │ │ │ ├── wordsize.h │ │ │ │ │ └── xopen_lim.h │ │ │ │ ├── ctype.h │ │ │ │ ├── dirent.h │ │ │ │ ├── dlfcn.h │ │ │ │ ├── endian.h │ │ │ │ ├── errno.h │ │ │ │ ├── execinfo.h │ │ │ │ ├── fcntl.h │ │ │ │ ├── features.h │ │ │ │ ├── fts.h │ │ │ │ ├── getopt.h │ │ │ │ ├── gnu/ │ │ │ │ │ ├── stubs-64.h │ │ │ │ │ └── stubs.h │ │ │ │ ├── grp.h │ │ │ │ ├── inttypes.h │ │ │ │ ├── libio.h │ │ │ │ ├── limits.h │ │ │ │ ├── linux/ │ │ │ │ │ ├── errno.h │ │ │ │ │ ├── ioctl.h │ │ │ │ │ ├── limits.h │ │ │ │ │ └── param.h │ │ │ │ ├── locale.h │ │ │ │ ├── malloc.h │ │ │ │ ├── math.h │ │ │ │ ├── memory.h │ │ │ │ ├── netdb.h │ │ │ │ ├── netinet/ │ │ │ │ │ └── in.h │ │ │ │ ├── pthread.h │ │ │ │ ├── pwd.h │ │ │ │ ├── rpc/ │ │ │ │ │ └── netdb.h │ │ │ │ ├── sched.h │ │ │ │ ├── setjmp.h │ │ │ │ ├── signal.h │ │ │ │ ├── stdc-predef.h │ │ │ │ ├── stdint.h │ │ │ │ ├── stdio.h │ │ │ │ ├── stdlib.h │ │ │ │ ├── string.h │ │ │ │ ├── strings.h │ │ │ │ ├── sys/ │ │ │ │ │ ├── cdefs.h │ │ │ │ │ ├── file.h │ │ │ │ │ ├── ioctl.h │ │ │ │ │ ├── mman.h │ │ │ │ │ ├── param.h │ │ │ │ │ ├── resource.h │ │ │ │ │ ├── select.h │ │ │ │ │ ├── socket.h │ │ │ │ │ ├── stat.h │ │ │ │ │ ├── statfs.h │ │ │ │ │ ├── sysmacros.h │ │ │ │ │ ├── time.h │ │ │ │ │ ├── times.h │ │ │ │ │ ├── ttydefaults.h │ │ │ │ │ ├── types.h │ │ │ │ │ ├── ucontext.h │ │ │ │ │ ├── uio.h │ │ │ │ │ ├── un.h │ │ │ │ │ ├── utsname.h │ │ │ │ │ └── wait.h │ │ │ │ ├── termios.h │ │ │ │ ├── time.h │ │ │ │ ├── unistd.h │ │ │ │ ├── utime.h │ │ │ │ ├── wchar.h │ │ │ │ ├── wctype.h │ │ │ │ ├── xlocale.h │ │ │ │ ├── zconf.h │ │ │ │ └── zlib.h │ │ │ └── lib64/ │ │ │ └── gcc/ │ │ │ └── x86_64-suse-linux/ │ │ │ └── 4.8/ │ │ │ ├── include/ │ │ │ │ ├── float.h │ │ │ │ ├── stdarg.h │ │ │ │ ├── stdbool.h │ │ │ │ ├── stddef.h │ │ │ │ └── stdint.h │ │ │ └── include-fixed/ │ │ │ ├── limits.h │ │ │ └── syslimits.h │ │ └── linux_arm/ │ │ ├── builtin.h │ │ ├── paths │ │ ├── predefined.h │ │ └── usr/ │ │ ├── include/ │ │ │ ├── _G_config.h │ │ │ ├── alloca.h │ │ │ ├── arm-linux-gnueabihf/ │ │ │ │ ├── asm/ │ │ │ │ │ ├── errno.h │ │ │ │ │ ├── ioctl.h │ │ │ │ │ ├── ioctls.h │ │ │ │ │ ├── param.h │ │ │ │ │ ├── sigcontext.h │ │ │ │ │ ├── socket.h │ │ │ │ │ └── sockios.h │ │ │ │ ├── bits/ │ │ │ │ │ ├── byteswap-16.h │ │ │ │ │ ├── byteswap.h │ │ │ │ │ ├── confname.h │ │ │ │ │ ├── dirent.h │ │ │ │ │ ├── dlfcn.h │ │ │ │ │ ├── endian.h │ │ │ │ │ ├── environments.h │ │ │ │ │ ├── errno.h │ │ │ │ │ ├── fcntl-linux.h │ │ │ │ │ ├── fcntl.h │ │ │ │ │ ├── huge_val.h │ │ │ │ │ ├── huge_valf.h │ │ │ │ │ ├── huge_vall.h │ │ │ │ │ ├── in.h │ │ │ │ │ ├── inf.h │ │ │ │ │ ├── ioctl-types.h │ │ │ │ │ ├── ioctls.h │ │ │ │ │ ├── libm-simd-decl-stubs.h │ │ │ │ │ ├── local_lim.h │ │ │ │ │ ├── locale.h │ │ │ │ │ ├── math-vector.h │ │ │ │ │ ├── mathcalls.h │ │ │ │ │ ├── mathdef.h │ │ │ │ │ ├── mman-linux.h │ │ │ │ │ ├── mman.h │ │ │ │ │ ├── nan.h │ │ │ │ │ ├── netdb.h │ │ │ │ │ ├── param.h │ │ │ │ │ ├── posix1_lim.h │ │ │ │ │ ├── posix2_lim.h │ │ │ │ │ ├── posix_opt.h │ │ │ │ │ ├── pthreadtypes.h │ │ │ │ │ ├── resource.h │ │ │ │ │ ├── sched.h │ │ │ │ │ ├── select.h │ │ │ │ │ ├── setjmp.h │ │ │ │ │ ├── sigaction.h │ │ │ │ │ ├── sigcontext.h │ │ │ │ │ ├── siginfo.h │ │ │ │ │ ├── signum.h │ │ │ │ │ ├── sigset.h │ │ │ │ │ ├── sigstack.h │ │ │ │ │ ├── sigthread.h │ │ │ │ │ ├── sockaddr.h │ │ │ │ │ ├── socket.h │ │ │ │ │ ├── socket_type.h │ │ │ │ │ ├── stat.h │ │ │ │ │ ├── statfs.h │ │ │ │ │ ├── stdio_lim.h │ │ │ │ │ ├── stdlib-float.h │ │ │ │ │ ├── sys_errlist.h │ │ │ │ │ ├── termios.h │ │ │ │ │ ├── time.h │ │ │ │ │ ├── types.h │ │ │ │ │ ├── typesizes.h │ │ │ │ │ ├── uio.h │ │ │ │ │ ├── utsname.h │ │ │ │ │ ├── waitflags.h │ │ │ │ │ ├── waitstatus.h │ │ │ │ │ ├── wchar.h │ │ │ │ │ └── wordsize.h │ │ │ │ ├── gnu/ │ │ │ │ │ ├── stubs-hard.h │ │ │ │ │ └── stubs.h │ │ │ │ └── sys/ │ │ │ │ ├── cdefs.h │ │ │ │ ├── file.h │ │ │ │ ├── ioctl.h │ │ │ │ ├── mman.h │ │ │ │ ├── param.h │ │ │ │ ├── resource.h │ │ │ │ ├── select.h │ │ │ │ ├── socket.h │ │ │ │ ├── stat.h │ │ │ │ ├── statfs.h │ │ │ │ ├── sysmacros.h │ │ │ │ ├── time.h │ │ │ │ ├── ttydefaults.h │ │ │ │ ├── types.h │ │ │ │ ├── ucontext.h │ │ │ │ ├── uio.h │ │ │ │ ├── un.h │ │ │ │ ├── utsname.h │ │ │ │ └── wait.h │ │ │ ├── arpa/ │ │ │ │ └── inet.h │ │ │ ├── asm-generic/ │ │ │ │ ├── errno-base.h │ │ │ │ ├── errno.h │ │ │ │ ├── ioctl.h │ │ │ │ ├── ioctls.h │ │ │ │ ├── param.h │ │ │ │ ├── socket.h │ │ │ │ └── sockios.h │ │ │ ├── assert.h │ │ │ ├── ctype.h │ │ │ ├── dirent.h │ │ │ ├── dlfcn.h │ │ │ ├── endian.h │ │ │ ├── errno.h │ │ │ ├── execinfo.h │ │ │ ├── fcntl.h │ │ │ ├── features.h │ │ │ ├── fts.h │ │ │ ├── getopt.h │ │ │ ├── grp.h │ │ │ ├── inttypes.h │ │ │ ├── libio.h │ │ │ ├── limits.h │ │ │ ├── linux/ │ │ │ │ ├── errno.h │ │ │ │ ├── ioctl.h │ │ │ │ ├── limits.h │ │ │ │ └── param.h │ │ │ ├── locale.h │ │ │ ├── malloc.h │ │ │ ├── math.h │ │ │ ├── memory.h │ │ │ ├── netdb.h │ │ │ ├── netinet/ │ │ │ │ └── in.h │ │ │ ├── pthread.h │ │ │ ├── pwd.h │ │ │ ├── rpc/ │ │ │ │ └── netdb.h │ │ │ ├── sched.h │ │ │ ├── setjmp.h │ │ │ ├── signal.h │ │ │ ├── stdc-predef.h │ │ │ ├── stdint.h │ │ │ ├── stdio.h │ │ │ ├── stdlib.h │ │ │ ├── string.h │ │ │ ├── strings.h │ │ │ ├── termios.h │ │ │ ├── time.h │ │ │ ├── unistd.h │ │ │ ├── utime.h │ │ │ ├── wchar.h │ │ │ ├── xlocale.h │ │ │ ├── zconf.h │ │ │ └── zlib.h │ │ └── lib/ │ │ └── gcc/ │ │ └── arm-linux-gnueabihf/ │ │ └── 6/ │ │ ├── include/ │ │ │ ├── float.h │ │ │ ├── stdarg.h │ │ │ ├── stdbool.h │ │ │ ├── stddef.h │ │ │ └── stdint.h │ │ └── include-fixed/ │ │ ├── limits.h │ │ └── syslimits.h │ ├── lexer.go │ ├── model.go │ ├── operand.go │ ├── parser.go │ ├── parser.yy │ ├── scanner.go │ ├── scanner.l │ ├── stringer.go │ ├── testdata/ │ │ ├── _sqlite/ │ │ │ ├── LICENSE │ │ │ ├── ext/ │ │ │ │ ├── README.md │ │ │ │ ├── async/ │ │ │ │ │ ├── README.txt │ │ │ │ │ ├── sqlite3async.c │ │ │ │ │ └── sqlite3async.h │ │ │ │ ├── fts1/ │ │ │ │ │ ├── README.txt │ │ │ │ │ ├── ft_hash.c │ │ │ │ │ ├── ft_hash.h │ │ │ │ │ ├── fts1.c │ │ │ │ │ ├── fts1.h │ │ │ │ │ ├── fts1_hash.c │ │ │ │ │ ├── fts1_hash.h │ │ │ │ │ ├── fts1_porter.c │ │ │ │ │ ├── fts1_tokenizer.h │ │ │ │ │ ├── fts1_tokenizer1.c │ │ │ │ │ ├── fulltext.c │ │ │ │ │ ├── fulltext.h │ │ │ │ │ ├── simple_tokenizer.c │ │ │ │ │ └── tokenizer.h │ │ │ │ ├── fts2/ │ │ │ │ │ ├── README.tokenizers │ │ │ │ │ ├── README.txt │ │ │ │ │ ├── fts2.c │ │ │ │ │ ├── fts2.h │ │ │ │ │ ├── fts2_hash.c │ │ │ │ │ ├── fts2_hash.h │ │ │ │ │ ├── fts2_icu.c │ │ │ │ │ ├── fts2_porter.c │ │ │ │ │ ├── fts2_tokenizer.c │ │ │ │ │ ├── fts2_tokenizer.h │ │ │ │ │ ├── fts2_tokenizer1.c │ │ │ │ │ └── mkfts2amal.tcl │ │ │ │ ├── fts3/ │ │ │ │ │ ├── README.content │ │ │ │ │ ├── README.syntax │ │ │ │ │ ├── README.tokenizers │ │ │ │ │ ├── README.txt │ │ │ │ │ ├── fts3.c │ │ │ │ │ ├── fts3.h │ │ │ │ │ ├── fts3Int.h │ │ │ │ │ ├── fts3_aux.c │ │ │ │ │ ├── fts3_expr.c │ │ │ │ │ ├── fts3_hash.c │ │ │ │ │ ├── fts3_hash.h │ │ │ │ │ ├── fts3_icu.c │ │ │ │ │ ├── fts3_porter.c │ │ │ │ │ ├── fts3_snippet.c │ │ │ │ │ ├── fts3_term.c │ │ │ │ │ ├── fts3_test.c │ │ │ │ │ ├── fts3_tokenize_vtab.c │ │ │ │ │ ├── fts3_tokenizer.c │ │ │ │ │ ├── fts3_tokenizer.h │ │ │ │ │ ├── fts3_tokenizer1.c │ │ │ │ │ ├── fts3_unicode.c │ │ │ │ │ ├── fts3_unicode2.c │ │ │ │ │ ├── fts3_write.c │ │ │ │ │ ├── fts3speed.tcl │ │ │ │ │ ├── mkfts3amal.tcl │ │ │ │ │ ├── tool/ │ │ │ │ │ │ ├── fts3cov.sh │ │ │ │ │ │ └── fts3view.c │ │ │ │ │ └── unicode/ │ │ │ │ │ ├── CaseFolding.txt │ │ │ │ │ ├── UnicodeData.txt │ │ │ │ │ ├── mkunicode.tcl │ │ │ │ │ └── parseunicode.tcl │ │ │ │ ├── fts5/ │ │ │ │ │ ├── extract_api_docs.tcl │ │ │ │ │ ├── fts5.h │ │ │ │ │ ├── fts5Int.h │ │ │ │ │ ├── fts5_aux.c │ │ │ │ │ ├── fts5_buffer.c │ │ │ │ │ ├── fts5_config.c │ │ │ │ │ ├── fts5_expr.c │ │ │ │ │ ├── fts5_hash.c │ │ │ │ │ ├── fts5_index.c │ │ │ │ │ ├── fts5_main.c │ │ │ │ │ ├── fts5_storage.c │ │ │ │ │ ├── fts5_tcl.c │ │ │ │ │ ├── fts5_test_mi.c │ │ │ │ │ ├── fts5_test_tok.c │ │ │ │ │ ├── fts5_tokenize.c │ │ │ │ │ ├── fts5_unicode2.c │ │ │ │ │ ├── fts5_varint.c │ │ │ │ │ ├── fts5_vocab.c │ │ │ │ │ ├── fts5parse.y │ │ │ │ │ ├── mkportersteps.tcl │ │ │ │ │ ├── test/ │ │ │ │ │ │ ├── fts5_common.tcl │ │ │ │ │ │ ├── fts5aa.test │ │ │ │ │ │ ├── fts5ab.test │ │ │ │ │ │ ├── fts5ac.test │ │ │ │ │ │ ├── fts5ad.test │ │ │ │ │ │ ├── fts5ae.test │ │ │ │ │ │ ├── fts5af.test │ │ │ │ │ │ ├── fts5ag.test │ │ │ │ │ │ ├── fts5ah.test │ │ │ │ │ │ ├── fts5ai.test │ │ │ │ │ │ ├── fts5aj.test │ │ │ │ │ │ ├── fts5ak.test │ │ │ │ │ │ ├── fts5al.test │ │ │ │ │ │ ├── fts5alter.test │ │ │ │ │ │ ├── fts5auto.test │ │ │ │ │ │ ├── fts5aux.test │ │ │ │ │ │ ├── fts5auxdata.test │ │ │ │ │ │ ├── fts5bigpl.test │ │ │ │ │ │ ├── fts5bigtok.test │ │ │ │ │ │ ├── fts5colset.test │ │ │ │ │ │ ├── fts5columnsize.test │ │ │ │ │ │ ├── fts5config.test │ │ │ │ │ │ ├── fts5conflict.test │ │ │ │ │ │ ├── fts5connect.test │ │ │ │ │ │ ├── fts5content.test │ │ │ │ │ │ ├── fts5corrupt.test │ │ │ │ │ │ ├── fts5corrupt2.test │ │ │ │ │ │ ├── fts5corrupt3.test │ │ │ │ │ │ ├── fts5delete.test │ │ │ │ │ │ ├── fts5detail.test │ │ │ │ │ │ ├── fts5determin.test │ │ │ │ │ │ ├── fts5dlidx.test │ │ │ │ │ │ ├── fts5doclist.test │ │ │ │ │ │ ├── fts5ea.test │ │ │ │ │ │ ├── fts5eb.test │ │ │ │ │ │ ├── fts5fault1.test │ │ │ │ │ │ ├── fts5fault2.test │ │ │ │ │ │ ├── fts5fault3.test │ │ │ │ │ │ ├── fts5fault4.test │ │ │ │ │ │ ├── fts5fault5.test │ │ │ │ │ │ ├── fts5fault6.test │ │ │ │ │ │ ├── fts5fault7.test │ │ │ │ │ │ ├── fts5fault8.test │ │ │ │ │ │ ├── fts5fault9.test │ │ │ │ │ │ ├── fts5faultA.test │ │ │ │ │ │ ├── fts5faultB.test │ │ │ │ │ │ ├── fts5faultD.test │ │ │ │ │ │ ├── fts5full.test │ │ │ │ │ │ ├── fts5fuzz1.test │ │ │ │ │ │ ├── fts5hash.test │ │ │ │ │ │ ├── fts5integrity.test │ │ │ │ │ │ ├── fts5lastrowid.test │ │ │ │ │ │ ├── fts5leftjoin.test │ │ │ │ │ │ ├── fts5matchinfo.test │ │ │ │ │ │ ├── fts5merge.test │ │ │ │ │ │ ├── fts5merge2.test │ │ │ │ │ │ ├── fts5multiclient.test │ │ │ │ │ │ ├── fts5near.test │ │ │ │ │ │ ├── fts5onepass.test │ │ │ │ │ │ ├── fts5optimize.test │ │ │ │ │ │ ├── fts5phrase.test │ │ │ │ │ │ ├── fts5plan.test │ │ │ │ │ │ ├── fts5porter.test │ │ │ │ │ │ ├── fts5porter2.test │ │ │ │ │ │ ├── fts5prefix.test │ │ │ │ │ │ ├── fts5query.test │ │ │ │ │ │ ├── fts5rank.test │ │ │ │ │ │ ├── fts5rebuild.test │ │ │ │ │ │ ├── fts5restart.test │ │ │ │ │ │ ├── fts5rowid.test │ │ │ │ │ │ ├── fts5simple.test │ │ │ │ │ │ ├── fts5simple2.test │ │ │ │ │ │ ├── fts5simple3.test │ │ │ │ │ │ ├── fts5synonym.test │ │ │ │ │ │ ├── fts5synonym2.test │ │ │ │ │ │ ├── fts5tok1.test │ │ │ │ │ │ ├── fts5tok2.test │ │ │ │ │ │ ├── fts5tokenizer.test │ │ │ │ │ │ ├── fts5unicode.test │ │ │ │ │ │ ├── fts5unicode2.test │ │ │ │ │ │ ├── fts5unicode3.test │ │ │ │ │ │ ├── fts5unindexed.test │ │ │ │ │ │ ├── fts5update.test │ │ │ │ │ │ ├── fts5version.test │ │ │ │ │ │ ├── fts5vocab.test │ │ │ │ │ │ └── fts5vocab2.test │ │ │ │ │ └── tool/ │ │ │ │ │ ├── fts5speed.tcl │ │ │ │ │ ├── fts5txt2db.tcl │ │ │ │ │ ├── loadfts5.tcl │ │ │ │ │ ├── mkfts5c.tcl │ │ │ │ │ └── showfts5.tcl │ │ │ │ ├── icu/ │ │ │ │ │ ├── README.txt │ │ │ │ │ ├── icu.c │ │ │ │ │ └── sqliteicu.h │ │ │ │ ├── lsm1/ │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── Makefile.msc │ │ │ │ │ ├── lsm-test/ │ │ │ │ │ │ ├── README │ │ │ │ │ │ ├── lsmtest.h │ │ │ │ │ │ ├── lsmtest1.c │ │ │ │ │ │ ├── lsmtest2.c │ │ │ │ │ │ ├── lsmtest3.c │ │ │ │ │ │ ├── lsmtest4.c │ │ │ │ │ │ ├── lsmtest5.c │ │ │ │ │ │ ├── lsmtest6.c │ │ │ │ │ │ ├── lsmtest7.c │ │ │ │ │ │ ├── lsmtest8.c │ │ │ │ │ │ ├── lsmtest9.c │ │ │ │ │ │ ├── lsmtest_bt.c │ │ │ │ │ │ ├── lsmtest_datasource.c │ │ │ │ │ │ ├── lsmtest_func.c │ │ │ │ │ │ ├── lsmtest_io.c │ │ │ │ │ │ ├── lsmtest_main.c │ │ │ │ │ │ ├── lsmtest_mem.c │ │ │ │ │ │ ├── lsmtest_tdb.c │ │ │ │ │ │ ├── lsmtest_tdb.h │ │ │ │ │ │ ├── lsmtest_tdb2.cc │ │ │ │ │ │ ├── lsmtest_tdb3.c │ │ │ │ │ │ ├── lsmtest_tdb4.c │ │ │ │ │ │ ├── lsmtest_util.c │ │ │ │ │ │ └── lsmtest_win32.c │ │ │ │ │ ├── lsm.h │ │ │ │ │ ├── lsmInt.h │ │ │ │ │ ├── lsm_ckpt.c │ │ │ │ │ ├── lsm_file.c │ │ │ │ │ ├── lsm_log.c │ │ │ │ │ ├── lsm_main.c │ │ │ │ │ ├── lsm_mem.c │ │ │ │ │ ├── lsm_mutex.c │ │ │ │ │ ├── lsm_shared.c │ │ │ │ │ ├── lsm_sorted.c │ │ │ │ │ ├── lsm_str.c │ │ │ │ │ ├── lsm_tree.c │ │ │ │ │ ├── lsm_unix.c │ │ │ │ │ ├── lsm_varint.c │ │ │ │ │ ├── lsm_vtab.c │ │ │ │ │ ├── lsm_win32.c │ │ │ │ │ └── test/ │ │ │ │ │ ├── lsm1_common.tcl │ │ │ │ │ └── lsm1_simple.test │ │ │ │ ├── misc/ │ │ │ │ │ ├── README.md │ │ │ │ │ ├── amatch.c │ │ │ │ │ ├── anycollseq.c │ │ │ │ │ ├── carray.c │ │ │ │ │ ├── closure.c │ │ │ │ │ ├── completion.c │ │ │ │ │ ├── compress.c │ │ │ │ │ ├── csv.c │ │ │ │ │ ├── dbdump.c │ │ │ │ │ ├── eval.c │ │ │ │ │ ├── fileio.c │ │ │ │ │ ├── fuzzer.c │ │ │ │ │ ├── ieee754.c │ │ │ │ │ ├── json1.c │ │ │ │ │ ├── memvfs.c │ │ │ │ │ ├── mmapwarm.c │ │ │ │ │ ├── nextchar.c │ │ │ │ │ ├── percentile.c │ │ │ │ │ ├── regexp.c │ │ │ │ │ ├── remember.c │ │ │ │ │ ├── rot13.c │ │ │ │ │ ├── scrub.c │ │ │ │ │ ├── series.c │ │ │ │ │ ├── sha1.c │ │ │ │ │ ├── shathree.c │ │ │ │ │ ├── showauth.c │ │ │ │ │ ├── spellfix.c │ │ │ │ │ ├── stmt.c │ │ │ │ │ ├── totype.c │ │ │ │ │ ├── unionvtab.c │ │ │ │ │ ├── vfslog.c │ │ │ │ │ ├── vfsstat.c │ │ │ │ │ ├── vtablog.c │ │ │ │ │ ├── vtshim.c │ │ │ │ │ └── wholenumber.c │ │ │ │ ├── rbu/ │ │ │ │ │ ├── rbu.c │ │ │ │ │ ├── rbu1.test │ │ │ │ │ ├── rbu10.test │ │ │ │ │ ├── rbu11.test │ │ │ │ │ ├── rbu12.test │ │ │ │ │ ├── rbu13.test │ │ │ │ │ ├── rbu14.test │ │ │ │ │ ├── rbu3.test │ │ │ │ │ ├── rbu5.test │ │ │ │ │ ├── rbu6.test │ │ │ │ │ ├── rbu7.test │ │ │ │ │ ├── rbu8.test │ │ │ │ │ ├── rbu9.test │ │ │ │ │ ├── rbuA.test │ │ │ │ │ ├── rbuB.test │ │ │ │ │ ├── rbuC.test │ │ │ │ │ ├── rbu_common.tcl │ │ │ │ │ ├── rbucrash.test │ │ │ │ │ ├── rbucrash2.test │ │ │ │ │ ├── rbudiff.test │ │ │ │ │ ├── rbudor.test │ │ │ │ │ ├── rbufault.test │ │ │ │ │ ├── rbufault2.test │ │ │ │ │ ├── rbufault3.test │ │ │ │ │ ├── rbufault4.test │ │ │ │ │ ├── rbufts.test │ │ │ │ │ ├── rbuprogress.test │ │ │ │ │ ├── rburesume.test │ │ │ │ │ ├── rbusave.test │ │ │ │ │ ├── rbutemplimit.test │ │ │ │ │ ├── rbuvacuum.test │ │ │ │ │ ├── rbuvacuum2.test │ │ │ │ │ ├── sqlite3rbu.c │ │ │ │ │ ├── sqlite3rbu.h │ │ │ │ │ └── test_rbu.c │ │ │ │ ├── repair/ │ │ │ │ │ ├── README.md │ │ │ │ │ └── checkfreelist.c │ │ │ │ ├── rtree/ │ │ │ │ │ ├── README │ │ │ │ │ ├── rtree.c │ │ │ │ │ ├── rtree.h │ │ │ │ │ ├── rtree1.test │ │ │ │ │ ├── rtree2.test │ │ │ │ │ ├── rtree3.test │ │ │ │ │ ├── rtree4.test │ │ │ │ │ ├── rtree5.test │ │ │ │ │ ├── rtree6.test │ │ │ │ │ ├── rtree7.test │ │ │ │ │ ├── rtree8.test │ │ │ │ │ ├── rtree9.test │ │ │ │ │ ├── rtreeA.test │ │ │ │ │ ├── rtreeB.test │ │ │ │ │ ├── rtreeC.test │ │ │ │ │ ├── rtreeD.test │ │ │ │ │ ├── rtreeE.test │ │ │ │ │ ├── rtreeF.test │ │ │ │ │ ├── rtreeG.test │ │ │ │ │ ├── rtree_perf.tcl │ │ │ │ │ ├── rtree_util.tcl │ │ │ │ │ ├── rtreeconnect.test │ │ │ │ │ ├── sqlite3rtree.h │ │ │ │ │ ├── tkt3363.test │ │ │ │ │ └── viewrtree.tcl │ │ │ │ ├── session/ │ │ │ │ │ ├── changeset.c │ │ │ │ │ ├── session1.test │ │ │ │ │ ├── session2.test │ │ │ │ │ ├── session3.test │ │ │ │ │ ├── session4.test │ │ │ │ │ ├── session5.test │ │ │ │ │ ├── session6.test │ │ │ │ │ ├── session8.test │ │ │ │ │ ├── session9.test │ │ │ │ │ ├── sessionA.test │ │ │ │ │ ├── sessionB.test │ │ │ │ │ ├── sessionC.test │ │ │ │ │ ├── sessionD.test │ │ │ │ │ ├── sessionE.test │ │ │ │ │ ├── sessionF.test │ │ │ │ │ ├── sessionG.test │ │ │ │ │ ├── session_common.tcl │ │ │ │ │ ├── session_speed_test.c │ │ │ │ │ ├── sessionat.test │ │ │ │ │ ├── sessiondiff.test │ │ │ │ │ ├── sessionfault.test │ │ │ │ │ ├── sessionfault2.test │ │ │ │ │ ├── sessionwor.test │ │ │ │ │ ├── sqlite3session.c │ │ │ │ │ ├── sqlite3session.h │ │ │ │ │ └── test_session.c │ │ │ │ └── userauth/ │ │ │ │ ├── sqlite3userauth.h │ │ │ │ ├── user-auth.txt │ │ │ │ └── userauth.c │ │ │ ├── sqlite-amalgamation-3210000/ │ │ │ │ ├── shell.c │ │ │ │ ├── sqlite3.c │ │ │ │ ├── sqlite3.h │ │ │ │ └── sqlite3ext.h │ │ │ ├── src/ │ │ │ │ ├── alter.c │ │ │ │ ├── analyze.c │ │ │ │ ├── attach.c │ │ │ │ ├── auth.c │ │ │ │ ├── backup.c │ │ │ │ ├── bitvec.c │ │ │ │ ├── btmutex.c │ │ │ │ ├── btree.c │ │ │ │ ├── btree.h │ │ │ │ ├── btreeInt.h │ │ │ │ ├── build.c │ │ │ │ ├── callback.c │ │ │ │ ├── complete.c │ │ │ │ ├── ctime.c │ │ │ │ ├── date.c │ │ │ │ ├── dbpage.c │ │ │ │ ├── dbstat.c │ │ │ │ ├── delete.c │ │ │ │ ├── expr.c │ │ │ │ ├── fault.c │ │ │ │ ├── fkey.c │ │ │ │ ├── func.c │ │ │ │ ├── global.c │ │ │ │ ├── hash.c │ │ │ │ ├── hash.h │ │ │ │ ├── hwtime.h │ │ │ │ ├── in-operator.md │ │ │ │ ├── insert.c │ │ │ │ ├── legacy.c │ │ │ │ ├── loadext.c │ │ │ │ ├── main.c │ │ │ │ ├── malloc.c │ │ │ │ ├── mem0.c │ │ │ │ ├── mem1.c │ │ │ │ ├── mem2.c │ │ │ │ ├── mem3.c │ │ │ │ ├── mem5.c │ │ │ │ ├── memjournal.c │ │ │ │ ├── msvc.h │ │ │ │ ├── mutex.c │ │ │ │ ├── mutex.h │ │ │ │ ├── mutex_noop.c │ │ │ │ ├── mutex_unix.c │ │ │ │ ├── mutex_w32.c │ │ │ │ ├── notify.c │ │ │ │ ├── opcodes.h │ │ │ │ ├── os.c │ │ │ │ ├── os.h │ │ │ │ ├── os_common.h │ │ │ │ ├── os_setup.h │ │ │ │ ├── os_unix.c │ │ │ │ ├── os_win.c │ │ │ │ ├── os_win.h │ │ │ │ ├── pager.c │ │ │ │ ├── pager.h │ │ │ │ ├── parse.h │ │ │ │ ├── parse.y │ │ │ │ ├── pcache.c │ │ │ │ ├── pcache.h │ │ │ │ ├── pcache1.c │ │ │ │ ├── pragma.c │ │ │ │ ├── pragma.h │ │ │ │ ├── prepare.c │ │ │ │ ├── printf.c │ │ │ │ ├── random.c │ │ │ │ ├── resolve.c │ │ │ │ ├── rowset.c │ │ │ │ ├── select.c │ │ │ │ ├── shell.c.in │ │ │ │ ├── sqlite.h.in │ │ │ │ ├── sqlite3.rc │ │ │ │ ├── sqlite3ext.h │ │ │ │ ├── sqliteInt.h │ │ │ │ ├── sqliteLimit.h │ │ │ │ ├── status.c │ │ │ │ ├── table.c │ │ │ │ ├── tclsqlite.c │ │ │ │ ├── test1.c │ │ │ │ ├── test2.c │ │ │ │ ├── test3.c │ │ │ │ ├── test4.c │ │ │ │ ├── test5.c │ │ │ │ ├── test6.c │ │ │ │ ├── test7.c │ │ │ │ ├── test8.c │ │ │ │ ├── test9.c │ │ │ │ ├── test_async.c │ │ │ │ ├── test_autoext.c │ │ │ │ ├── test_backup.c │ │ │ │ ├── test_bestindex.c │ │ │ │ ├── test_blob.c │ │ │ │ ├── test_btree.c │ │ │ │ ├── test_config.c │ │ │ │ ├── test_delete.c │ │ │ │ ├── test_demovfs.c │ │ │ │ ├── test_devsym.c │ │ │ │ ├── test_fs.c │ │ │ │ ├── test_func.c │ │ │ │ ├── test_hexio.c │ │ │ │ ├── test_init.c │ │ │ │ ├── test_intarray.c │ │ │ │ ├── test_intarray.h │ │ │ │ ├── test_journal.c │ │ │ │ ├── test_loadext.c │ │ │ │ ├── test_malloc.c │ │ │ │ ├── test_md5.c │ │ │ │ ├── test_multiplex.c │ │ │ │ ├── test_multiplex.h │ │ │ │ ├── test_mutex.c │ │ │ │ ├── test_onefile.c │ │ │ │ ├── test_osinst.c │ │ │ │ ├── test_pcache.c │ │ │ │ ├── test_quota.c │ │ │ │ ├── test_quota.h │ │ │ │ ├── test_rtree.c │ │ │ │ ├── test_schema.c │ │ │ │ ├── test_server.c │ │ │ │ ├── test_sqllog.c │ │ │ │ ├── test_superlock.c │ │ │ │ ├── test_syscall.c │ │ │ │ ├── test_tclsh.c │ │ │ │ ├── test_tclvar.c │ │ │ │ ├── test_thread.c │ │ │ │ ├── test_vfs.c │ │ │ │ ├── test_vfstrace.c │ │ │ │ ├── test_windirent.c │ │ │ │ ├── test_windirent.h │ │ │ │ ├── test_wsd.c │ │ │ │ ├── threads.c │ │ │ │ ├── tokenize.c │ │ │ │ ├── treeview.c │ │ │ │ ├── trigger.c │ │ │ │ ├── update.c │ │ │ │ ├── utf.c │ │ │ │ ├── util.c │ │ │ │ ├── vacuum.c │ │ │ │ ├── vdbe.c │ │ │ │ ├── vdbe.h │ │ │ │ ├── vdbeInt.h │ │ │ │ ├── vdbeapi.c │ │ │ │ ├── vdbeaux.c │ │ │ │ ├── vdbeblob.c │ │ │ │ ├── vdbemem.c │ │ │ │ ├── vdbesort.c │ │ │ │ ├── vdbetrace.c │ │ │ │ ├── vtab.c │ │ │ │ ├── vxworks.h │ │ │ │ ├── wal.c │ │ │ │ ├── wal.h │ │ │ │ ├── walker.c │ │ │ │ ├── where.c │ │ │ │ ├── whereInt.h │ │ │ │ ├── wherecode.c │ │ │ │ └── whereexpr.c │ │ │ └── test/ │ │ │ ├── 8_3_names.test │ │ │ ├── affinity2.test │ │ │ ├── affinity3.test │ │ │ ├── aggerror.test │ │ │ ├── aggnested.test │ │ │ ├── alias.test │ │ │ ├── all.test │ │ │ ├── alter.test │ │ │ ├── alter2.test │ │ │ ├── alter3.test │ │ │ ├── alter4.test │ │ │ ├── altermalloc.test │ │ │ ├── amatch1.test │ │ │ ├── analyze.test │ │ │ ├── analyze3.test │ │ │ ├── analyze4.test │ │ │ ├── analyze5.test │ │ │ ├── analyze6.test │ │ │ ├── analyze7.test │ │ │ ├── analyze8.test │ │ │ ├── analyze9.test │ │ │ ├── analyzeA.test │ │ │ ├── analyzeB.test │ │ │ ├── analyzeC.test │ │ │ ├── analyzeD.test │ │ │ ├── analyzeE.test │ │ │ ├── analyzeF.test │ │ │ ├── analyzer1.test │ │ │ ├── async.test │ │ │ ├── async2.test │ │ │ ├── async3.test │ │ │ ├── async4.test │ │ │ ├── async5.test │ │ │ ├── atof1.test │ │ │ ├── atomic.test │ │ │ ├── attach.test │ │ │ ├── attach2.test │ │ │ ├── attach3.test │ │ │ ├── attach4.test │ │ │ ├── attachmalloc.test │ │ │ ├── auth.test │ │ │ ├── auth2.test │ │ │ ├── auth3.test │ │ │ ├── autoanalyze1.test │ │ │ ├── autoinc.test │ │ │ ├── autoindex1.test │ │ │ ├── autoindex2.test │ │ │ ├── autoindex3.test │ │ │ ├── autoindex4.test │ │ │ ├── autoindex5.test │ │ │ ├── autovacuum.test │ │ │ ├── autovacuum_ioerr2.test │ │ │ ├── avtrans.test │ │ │ ├── backcompat.test │ │ │ ├── backup.test │ │ │ ├── backup2.test │ │ │ ├── backup4.test │ │ │ ├── backup5.test │ │ │ ├── backup_ioerr.test │ │ │ ├── backup_malloc.test │ │ │ ├── badutf.test │ │ │ ├── badutf2.test │ │ │ ├── bc_common.tcl │ │ │ ├── bestindex1.test │ │ │ ├── bestindex2.test │ │ │ ├── bestindex3.test │ │ │ ├── bestindex4.test │ │ │ ├── bestindex5.test │ │ │ ├── between.test │ │ │ ├── bigfile.test │ │ │ ├── bigfile2.test │ │ │ ├── bigmmap.test │ │ │ ├── bigrow.test │ │ │ ├── bigsort.test │ │ │ ├── bind.test │ │ │ ├── bindxfer.test │ │ │ ├── bitvec.test │ │ │ ├── blob.test │ │ │ ├── boundary1.tcl │ │ │ ├── boundary1.test │ │ │ ├── boundary2.tcl │ │ │ ├── boundary2.test │ │ │ ├── boundary3.tcl │ │ │ ├── boundary3.test │ │ │ ├── boundary4.tcl │ │ │ ├── boundary4.test │ │ │ ├── btree01.test │ │ │ ├── btree02.test │ │ │ ├── btreefault.test │ │ │ ├── busy.test │ │ │ ├── cache.test │ │ │ ├── cacheflush.test │ │ │ ├── cachespill.test │ │ │ ├── capi2.test │ │ │ ├── capi3.test │ │ │ ├── capi3b.test │ │ │ ├── capi3c.test │ │ │ ├── capi3d.test │ │ │ ├── capi3e.test │ │ │ ├── cast.test │ │ │ ├── cffault.test │ │ │ ├── check.test │ │ │ ├── checkfreelist.test │ │ │ ├── close.test │ │ │ ├── closure01.test │ │ │ ├── coalesce.test │ │ │ ├── collate1.test │ │ │ ├── collate2.test │ │ │ ├── collate3.test │ │ │ ├── collate4.test │ │ │ ├── collate5.test │ │ │ ├── collate6.test │ │ │ ├── collate7.test │ │ │ ├── collate8.test │ │ │ ├── collate9.test │ │ │ ├── collateA.test │ │ │ ├── collateB.test │ │ │ ├── colmeta.test │ │ │ ├── colname.test │ │ │ ├── conflict.test │ │ │ ├── conflict2.test │ │ │ ├── conflict3.test │ │ │ ├── contrib01.test │ │ │ ├── corrupt.test │ │ │ ├── corrupt2.test │ │ │ ├── corrupt3.test │ │ │ ├── corrupt4.test │ │ │ ├── corrupt5.test │ │ │ ├── corrupt6.test │ │ │ ├── corrupt7.test │ │ │ ├── corrupt8.test │ │ │ ├── corrupt9.test │ │ │ ├── corruptA.test │ │ │ ├── corruptB.test │ │ │ ├── corruptC.test │ │ │ ├── corruptD.test │ │ │ ├── corruptE.test │ │ │ ├── corruptF.test │ │ │ ├── corruptG.test │ │ │ ├── corruptH.test │ │ │ ├── corruptI.test │ │ │ ├── corruptJ.test │ │ │ ├── corruptK.test │ │ │ ├── cost.test │ │ │ ├── count.test │ │ │ ├── coveridxscan.test │ │ │ ├── crash.test │ │ │ ├── crash2.test │ │ │ ├── crash3.test │ │ │ ├── crash4.test │ │ │ ├── crash5.test │ │ │ ├── crash6.test │ │ │ ├── crash7.test │ │ │ ├── crash8.test │ │ │ ├── crashM.test │ │ │ ├── crashtest1.c │ │ │ ├── createtab.test │ │ │ ├── cse.test │ │ │ ├── csv01.test │ │ │ ├── ctime.test │ │ │ ├── cursorhint.test │ │ │ ├── cursorhint2.test │ │ │ ├── date.test │ │ │ ├── date2.test │ │ │ ├── dbfuzz.c │ │ │ ├── dbpage.test │ │ │ ├── dbstatus.test │ │ │ ├── dbstatus2.test │ │ │ ├── default.test │ │ │ ├── delete.test │ │ │ ├── delete2.test │ │ │ ├── delete3.test │ │ │ ├── delete4.test │ │ │ ├── delete_db.test │ │ │ ├── descidx1.test │ │ │ ├── descidx2.test │ │ │ ├── descidx3.test │ │ │ ├── diskfull.test │ │ │ ├── distinct.test │ │ │ ├── distinct2.test │ │ │ ├── distinctagg.test │ │ │ ├── e_blobbytes.test │ │ │ ├── e_blobclose.test │ │ │ ├── e_blobopen.test │ │ │ ├── e_blobwrite.test │ │ │ ├── e_changes.test │ │ │ ├── e_createtable.test │ │ │ ├── e_delete.test │ │ │ ├── e_droptrigger.test │ │ │ ├── e_dropview.test │ │ │ ├── e_expr.test │ │ │ ├── e_fkey.test │ │ │ ├── e_fts3.test │ │ │ ├── e_insert.test │ │ │ ├── e_reindex.test │ │ │ ├── e_resolve.test │ │ │ ├── e_select.test │ │ │ ├── e_select2.test │ │ │ ├── e_totalchanges.test │ │ │ ├── e_update.test │ │ │ ├── e_uri.test │ │ │ ├── e_vacuum.test │ │ │ ├── e_wal.test │ │ │ ├── e_walauto.test │ │ │ ├── e_walckpt.test │ │ │ ├── e_walhook.test │ │ │ ├── emptytable.test │ │ │ ├── enc.test │ │ │ ├── enc2.test │ │ │ ├── enc3.test │ │ │ ├── enc4.test │ │ │ ├── eqp.test │ │ │ ├── errmsg.test │ │ │ ├── eval.test │ │ │ ├── exclusive.test │ │ │ ├── exclusive2.test │ │ │ ├── exec.test │ │ │ ├── exists.test │ │ │ ├── expr.test │ │ │ ├── extension01.test │ │ │ ├── extraquick.test │ │ │ ├── fallocate.test │ │ │ ├── filectrl.test │ │ │ ├── filefmt.test │ │ │ ├── fkey1.test │ │ │ ├── fkey2.test │ │ │ ├── fkey3.test │ │ │ ├── fkey4.test │ │ │ ├── fkey5.test │ │ │ ├── fkey6.test │ │ │ ├── fkey7.test │ │ │ ├── fkey8.test │ │ │ ├── fkey_malloc.test │ │ │ ├── fordelete.test │ │ │ ├── format4.test │ │ │ ├── fts-9fd058691.test │ │ │ ├── fts1a.test │ │ │ ├── fts1b.test │ │ │ ├── fts1c.test │ │ │ ├── fts1d.test │ │ │ ├── fts1e.test │ │ │ ├── fts1f.test │ │ │ ├── fts1i.test │ │ │ ├── fts1j.test │ │ │ ├── fts1k.test │ │ │ ├── fts1l.test │ │ │ ├── fts1m.test │ │ │ ├── fts1n.test │ │ │ ├── fts1o.test │ │ │ ├── fts1porter.test │ │ │ ├── fts2.test │ │ │ ├── fts2a.test │ │ │ ├── fts2b.test │ │ │ ├── fts2c.test │ │ │ ├── fts2d.test │ │ │ ├── fts2e.test │ │ │ ├── fts2f.test │ │ │ ├── fts2g.test │ │ │ ├── fts2h.test │ │ │ ├── fts2i.test │ │ │ ├── fts2j.test │ │ │ ├── fts2k.test │ │ │ ├── fts2l.test │ │ │ ├── fts2m.test │ │ │ ├── fts2n.test │ │ │ ├── fts2o.test │ │ │ ├── fts2p.test │ │ │ ├── fts2q.test │ │ │ ├── fts2r.test │ │ │ ├── fts2token.test │ │ │ ├── fts3.test │ │ │ ├── fts3_common.tcl │ │ │ ├── fts3aa.test │ │ │ ├── fts3ab.test │ │ │ ├── fts3ac.test │ │ │ ├── fts3ad.test │ │ │ ├── fts3ae.test │ │ │ ├── fts3af.test │ │ │ ├── fts3ag.test │ │ │ ├── fts3ah.test │ │ │ ├── fts3ai.test │ │ │ ├── fts3aj.test │ │ │ ├── fts3ak.test │ │ │ ├── fts3al.test │ │ │ ├── fts3am.test │ │ │ ├── fts3an.test │ │ │ ├── fts3ao.test │ │ │ ├── fts3atoken.test │ │ │ ├── fts3auto.test │ │ │ ├── fts3aux1.test │ │ │ ├── fts3aux2.test │ │ │ ├── fts3b.test │ │ │ ├── fts3c.test │ │ │ ├── fts3comp1.test │ │ │ ├── fts3conf.test │ │ │ ├── fts3corrupt.test │ │ │ ├── fts3corrupt2.test │ │ │ ├── fts3corrupt3.test │ │ │ ├── fts3cov.test │ │ │ ├── fts3d.test │ │ │ ├── fts3defer.test │ │ │ ├── fts3defer2.test │ │ │ ├── fts3defer3.test │ │ │ ├── fts3drop.test │ │ │ ├── fts3e.test │ │ │ ├── fts3expr.test │ │ │ ├── fts3expr2.test │ │ │ ├── fts3expr3.test │ │ │ ├── fts3expr4.test │ │ │ ├── fts3expr5.test │ │ │ ├── fts3fault.test │ │ │ ├── fts3fault2.test │ │ │ ├── fts3first.test │ │ │ ├── fts3join.test │ │ │ ├── fts3malloc.test │ │ │ ├── fts3matchinfo.test │ │ │ ├── fts3misc.test │ │ │ ├── fts3near.test │ │ │ ├── fts3offsets.test │ │ │ ├── fts3prefix.test │ │ │ ├── fts3prefix2.test │ │ │ ├── fts3query.test │ │ │ ├── fts3rank.test │ │ │ ├── fts3rnd.test │ │ │ ├── fts3shared.test │ │ │ ├── fts3snippet.test │ │ │ ├── fts3sort.test │ │ │ ├── fts3tok1.test │ │ │ ├── fts3tok_err.test │ │ │ ├── fts3varint.test │ │ │ ├── fts4aa.test │ │ │ ├── fts4check.test │ │ │ ├── fts4content.test │ │ │ ├── fts4docid.test │ │ │ ├── fts4growth.test │ │ │ ├── fts4growth2.test │ │ │ ├── fts4incr.test │ │ │ ├── fts4langid.test │ │ │ ├── fts4lastrowid.test │ │ │ ├── fts4merge.test │ │ │ ├── fts4merge2.test │ │ │ ├── fts4merge3.test │ │ │ ├── fts4merge4.test │ │ │ ├── fts4noti.test │ │ │ ├── fts4onepass.test │ │ │ ├── fts4opt.test │ │ │ ├── fts4unicode.test │ │ │ ├── full.test │ │ │ ├── func.test │ │ │ ├── func2.test │ │ │ ├── func3.test │ │ │ ├── func4.test │ │ │ ├── func5.test │ │ │ ├── fuzz-oss1.test │ │ │ ├── fuzz.test │ │ │ ├── fuzz2.test │ │ │ ├── fuzz3.test │ │ │ ├── fuzz_common.tcl │ │ │ ├── fuzz_malloc.test │ │ │ ├── fuzzcheck.c │ │ │ ├── fuzzer1.test │ │ │ ├── fuzzer2.test │ │ │ ├── fuzzerfault.test │ │ │ ├── gcfault.test │ │ │ ├── genesis.tcl │ │ │ ├── having.test │ │ │ ├── hexlit.test │ │ │ ├── hidden.test │ │ │ ├── hook.test │ │ │ ├── hook2.test │ │ │ ├── icu.test │ │ │ ├── ieee754.test │ │ │ ├── imposter1.test │ │ │ ├── in.test │ │ │ ├── in2.test │ │ │ ├── in3.test │ │ │ ├── in4.test │ │ │ ├── in5.test │ │ │ ├── incrblob.test │ │ │ ├── incrblob2.test │ │ │ ├── incrblob3.test │ │ │ ├── incrblob4.test │ │ │ ├── incrblob_err.test │ │ │ ├── incrblobfault.test │ │ │ ├── incrcorrupt.test │ │ │ ├── incrvacuum.test │ │ │ ├── incrvacuum2.test │ │ │ ├── incrvacuum3.test │ │ │ ├── incrvacuum_ioerr.test │ │ │ ├── index.test │ │ │ ├── index2.test │ │ │ ├── index3.test │ │ │ ├── index4.test │ │ │ ├── index5.test │ │ │ ├── index6.test │ │ │ ├── index7.test │ │ │ ├── index8.test │ │ │ ├── index9.test │ │ │ ├── indexedby.test │ │ │ ├── indexexpr1.test │ │ │ ├── indexexpr2.test │ │ │ ├── indexfault.test │ │ │ ├── init.test │ │ │ ├── insert.test │ │ │ ├── insert2.test │ │ │ ├── insert3.test │ │ │ ├── insert4.test │ │ │ ├── insert5.test │ │ │ ├── instr.test │ │ │ ├── instrfault.test │ │ │ ├── intarray.test │ │ │ ├── interrupt.test │ │ │ ├── interrupt2.test │ │ │ ├── intpkey.test │ │ │ ├── io.test │ │ │ ├── ioerr.test │ │ │ ├── ioerr2.test │ │ │ ├── ioerr3.test │ │ │ ├── ioerr4.test │ │ │ ├── ioerr5.test │ │ │ ├── ioerr6.test │ │ │ ├── join.test │ │ │ ├── join2.test │ │ │ ├── join3.test │ │ │ ├── join4.test │ │ │ ├── join5.test │ │ │ ├── join6.test │ │ │ ├── journal1.test │ │ │ ├── journal2.test │ │ │ ├── journal3.test │ │ │ ├── jrnlmode.test │ │ │ ├── jrnlmode2.test │ │ │ ├── jrnlmode3.test │ │ │ ├── json101.test │ │ │ ├── json102.test │ │ │ ├── json103.test │ │ │ ├── json104.test │ │ │ ├── keyword1.test │ │ │ ├── kvtest.c │ │ │ ├── lastinsert.test │ │ │ ├── laststmtchanges.test │ │ │ ├── like.test │ │ │ ├── like2.test │ │ │ ├── like3.test │ │ │ ├── limit.test │ │ │ ├── limit2.test │ │ │ ├── loadext.test │ │ │ ├── loadext2.test │ │ │ ├── lock.test │ │ │ ├── lock2.test │ │ │ ├── lock3.test │ │ │ ├── lock4.test │ │ │ ├── lock5.test │ │ │ ├── lock6.test │ │ │ ├── lock7.test │ │ │ ├── lock_common.tcl │ │ │ ├── lookaside.test │ │ │ ├── main.test │ │ │ ├── make-where7.tcl │ │ │ ├── malloc.test │ │ │ ├── malloc3.test │ │ │ ├── malloc4.test │ │ │ ├── malloc5.test │ │ │ ├── malloc6.test │ │ │ ├── malloc7.test │ │ │ ├── malloc8.test │ │ │ ├── malloc9.test │ │ │ ├── mallocA.test │ │ │ ├── mallocAll.test │ │ │ ├── mallocB.test │ │ │ ├── mallocC.test │ │ │ ├── mallocD.test │ │ │ ├── mallocE.test │ │ │ ├── mallocF.test │ │ │ ├── mallocG.test │ │ │ ├── mallocH.test │ │ │ ├── mallocI.test │ │ │ ├── mallocJ.test │ │ │ ├── mallocK.test │ │ │ ├── mallocL.test │ │ │ ├── mallocM.test │ │ │ ├── malloc_common.tcl │ │ │ ├── manydb.test │ │ │ ├── mem5.test │ │ │ ├── memdb.test │ │ │ ├── memleak.test │ │ │ ├── memsubsys1.test │ │ │ ├── memsubsys2.test │ │ │ ├── minmax.test │ │ │ ├── minmax2.test │ │ │ ├── minmax3.test │ │ │ ├── minmax4.test │ │ │ ├── misc1.test │ │ │ ├── misc2.test │ │ │ ├── misc3.test │ │ │ ├── misc4.test │ │ │ ├── misc5.test │ │ │ ├── misc6.test │ │ │ ├── misc7.test │ │ │ ├── misc8.test │ │ │ ├── misuse.test │ │ │ ├── mjournal.test │ │ │ ├── mmap1.test │ │ │ ├── mmap2.test │ │ │ ├── mmap3.test │ │ │ ├── mmap4.test │ │ │ ├── mmapfault.test │ │ │ ├── mmapwarm.test │ │ │ ├── multiplex.test │ │ │ ├── multiplex2.test │ │ │ ├── multiplex3.test │ │ │ ├── multiplex4.test │ │ │ ├── mutex1.test │ │ │ ├── mutex2.test │ │ │ ├── nan.test │ │ │ ├── nockpt.test │ │ │ ├── nolock.test │ │ │ ├── notify1.test │ │ │ ├── notify2.test │ │ │ ├── notify3.test │ │ │ ├── notnull.test │ │ │ ├── null.test │ │ │ ├── numcast.test │ │ │ ├── numindex1.test │ │ │ ├── offset1.test │ │ │ ├── openv2.test │ │ │ ├── orderby1.test │ │ │ ├── orderby2.test │ │ │ ├── orderby3.test │ │ │ ├── orderby4.test │ │ │ ├── orderby5.test │ │ │ ├── orderby6.test │ │ │ ├── orderby7.test │ │ │ ├── orderby8.test │ │ │ ├── orderby9.test │ │ │ ├── oserror.test │ │ │ ├── ossfuzz.c │ │ │ ├── ossshell.c │ │ │ ├── ovfl.test │ │ │ ├── pager1.test │ │ │ ├── pager2.test │ │ │ ├── pager3.test │ │ │ ├── pager4.test │ │ │ ├── pagerfault.test │ │ │ ├── pagerfault2.test │ │ │ ├── pagerfault3.test │ │ │ ├── pageropt.test │ │ │ ├── pagesize.test │ │ │ ├── parser1.test │ │ │ ├── pcache.test │ │ │ ├── pcache2.test │ │ │ ├── percentile.test │ │ │ ├── permutations.test │ │ │ ├── pragma.test │ │ │ ├── pragma2.test │ │ │ ├── pragma3.test │ │ │ ├── pragma4.test │ │ │ ├── pragma5.test │ │ │ ├── pragmafault.test │ │ │ ├── printf.test │ │ │ ├── printf2.test │ │ │ ├── progress.test │ │ │ ├── ptrchng.test │ │ │ ├── pushdown.test │ │ │ ├── queryonly.test │ │ │ ├── quick.test │ │ │ ├── quota-glob.test │ │ │ ├── quota.test │ │ │ ├── quota2.test │ │ │ ├── quote.test │ │ │ ├── randexpr1.tcl │ │ │ ├── randexpr1.test │ │ │ ├── rbu.test │ │ │ ├── rdonly.test │ │ │ ├── regexp1.test │ │ │ ├── regexp2.test │ │ │ ├── reindex.test │ │ │ ├── releasetest.tcl │ │ │ ├── resolver01.test │ │ │ ├── rollback.test │ │ │ ├── rollback2.test │ │ │ ├── rollbackfault.test │ │ │ ├── rowallock.test │ │ │ ├── rowhash.test │ │ │ ├── rowid.test │ │ │ ├── rowvalue.test │ │ │ ├── rowvalue2.test │ │ │ ├── rowvalue3.test │ │ │ ├── rowvalue4.test │ │ │ ├── rowvalue5.test │ │ │ ├── rowvalue6.test │ │ │ ├── rowvalue7.test │ │ │ ├── rowvalue8.test │ │ │ ├── rowvalue9.test │ │ │ ├── rowvaluefault.test │ │ │ ├── rtree.test │ │ │ ├── run-wordcount.sh │ │ │ ├── savepoint.test │ │ │ ├── savepoint2.test │ │ │ ├── savepoint4.test │ │ │ ├── savepoint5.test │ │ │ ├── savepoint6.test │ │ │ ├── savepoint7.test │ │ │ ├── savepointfault.test │ │ │ ├── scanstatus.test │ │ │ ├── schema.test │ │ │ ├── schema2.test │ │ │ ├── schema3.test │ │ │ ├── schema4.test │ │ │ ├── schema5.test │ │ │ ├── schema6.test │ │ │ ├── securedel.test │ │ │ ├── securedel2.test │ │ │ ├── select1.test │ │ │ ├── select2.test │ │ │ ├── select3.test │ │ │ ├── select4.test │ │ │ ├── select5.test │ │ │ ├── select6.test │ │ │ ├── select7.test │ │ │ ├── select8.test │ │ │ ├── select9.test │ │ │ ├── selectA.test │ │ │ ├── selectB.test │ │ │ ├── selectC.test │ │ │ ├── selectD.test │ │ │ ├── selectE.test │ │ │ ├── selectF.test │ │ │ ├── selectG.test │ │ │ ├── server1.test │ │ │ ├── session.test │ │ │ ├── shared.test │ │ │ ├── shared2.test │ │ │ ├── shared3.test │ │ │ ├── shared4.test │ │ │ ├── shared6.test │ │ │ ├── shared7.test │ │ │ ├── shared8.test │ │ │ ├── shared9.test │ │ │ ├── sharedA.test │ │ │ ├── sharedB.test │ │ │ ├── shared_err.test │ │ │ ├── sharedlock.test │ │ │ ├── shell1.test │ │ │ ├── shell2.test │ │ │ ├── shell3.test │ │ │ ├── shell4.test │ │ │ ├── shell5.test │ │ │ ├── shell6.test │ │ │ ├── shell7.test │ │ │ ├── shortread1.test │ │ │ ├── show_speedtest1_rtree.tcl │ │ │ ├── shrink.test │ │ │ ├── sidedelete.test │ │ │ ├── skipscan1.test │ │ │ ├── skipscan2.test │ │ │ ├── skipscan3.test │ │ │ ├── skipscan5.test │ │ │ ├── skipscan6.test │ │ │ ├── snapshot.test │ │ │ ├── snapshot2.test │ │ │ ├── snapshot_fault.test │ │ │ ├── soak.test │ │ │ ├── softheap1.test │ │ │ ├── sort.test │ │ │ ├── sort2.test │ │ │ ├── sort3.test │ │ │ ├── sort4.test │ │ │ ├── sort5.test │ │ │ ├── sortfault.test │ │ │ ├── speed1.test │ │ │ ├── speed1p.explain │ │ │ ├── speed1p.test │ │ │ ├── speed2.test │ │ │ ├── speed3.test │ │ │ ├── speed4.test │ │ │ ├── speed4p.explain │ │ │ ├── speed4p.test │ │ │ ├── speedtest1.c │ │ │ ├── spellfix.test │ │ │ ├── spellfix2.test │ │ │ ├── spellfix3.test │ │ │ ├── sqldiff1.test │ │ │ ├── sqllimits1.test │ │ │ ├── sqllog.test │ │ │ ├── stat.test │ │ │ ├── statfault.test │ │ │ ├── stmt.test │ │ │ ├── stmtvtab1.test │ │ │ ├── subjournal.test │ │ │ ├── subquery.test │ │ │ ├── subquery2.test │ │ │ ├── subselect.test │ │ │ ├── substr.test │ │ │ ├── subtype1.test │ │ │ ├── superlock.test │ │ │ ├── swarmvtab.test │ │ │ ├── swarmvtab2.test │ │ │ ├── swarmvtabfault.test │ │ │ ├── symlink.test │ │ │ ├── sync.test │ │ │ ├── sync2.test │ │ │ ├── syscall.test │ │ │ ├── sysfault.test │ │ │ ├── tabfunc01.test │ │ │ ├── table.test │ │ │ ├── tableapi.test │ │ │ ├── tableopts.test │ │ │ ├── tclsqlite.test │ │ │ ├── tempdb.test │ │ │ ├── tempdb2.test │ │ │ ├── tempfault.test │ │ │ ├── temptable.test │ │ │ ├── temptable2.test │ │ │ ├── temptable3.test │ │ │ ├── temptrigger.test │ │ │ ├── tester.tcl │ │ │ ├── thread001.test │ │ │ ├── thread002.test │ │ │ ├── thread003.test │ │ │ ├── thread004.test │ │ │ ├── thread005.test │ │ │ ├── thread1.test │ │ │ ├── thread2.test │ │ │ ├── thread_common.tcl │ │ │ ├── threadtest1.c │ │ │ ├── threadtest2.c │ │ │ ├── threadtest3.c │ │ │ ├── threadtest4.c │ │ │ ├── time-wordcount.sh │ │ │ ├── tkt-02a8e81d44.test │ │ │ ├── tkt-26ff0c2d1e.test │ │ │ ├── tkt-2a5629202f.test │ │ │ ├── tkt-2d1a5c67d.test │ │ │ ├── tkt-2ea2425d34.test │ │ │ ├── tkt-31338dca7e.test │ │ │ ├── tkt-313723c356.test │ │ │ ├── tkt-385a5b56b9.test │ │ │ ├── tkt-38cb5df375.test │ │ │ ├── tkt-3998683a16.test │ │ │ ├── tkt-3a77c9714e.test │ │ │ ├── tkt-3fe897352e.test │ │ │ ├── tkt-4a03edc4c8.test │ │ │ ├── tkt-4c86b126f2.test │ │ │ ├── tkt-4dd95f6943.test │ │ │ ├── tkt-4ef7e3cfca.test │ │ │ ├── tkt-54844eea3f.test │ │ │ ├── tkt-5d863f876e.test │ │ │ ├── tkt-5e10420e8d.test │ │ │ ├── tkt-5ee23731f.test │ │ │ ├── tkt-6bfb98dfc0.test │ │ │ ├── tkt-752e1646fc.test │ │ │ ├── tkt-78e04e52ea.test │ │ │ ├── tkt-7a31705a7e6.test │ │ │ ├── tkt-7bbfb7d442.test │ │ │ ├── tkt-80ba201079.test │ │ │ ├── tkt-80e031a00f.test │ │ │ ├── tkt-8454a207b9.test │ │ │ ├── tkt-868145d012.test │ │ │ ├── tkt-8c63ff0ec.test │ │ │ ├── tkt-91e2e8ba6f.test │ │ │ ├── tkt-94c04eaadb.test │ │ │ ├── tkt-9a8b09f8e6.test │ │ │ ├── tkt-9d68c883.test │ │ │ ├── tkt-9f2eb3abac.test │ │ │ ├── tkt-a7b7803e.test │ │ │ ├── tkt-a8a0d2996a.test │ │ │ ├── tkt-b1d3a2e531.test │ │ │ ├── tkt-b351d95f9.test │ │ │ ├── tkt-b72787b1.test │ │ │ ├── tkt-b75a9ca6b0.test │ │ │ ├── tkt-ba7cbfaedc.test │ │ │ ├── tkt-bd484a090c.test │ │ │ ├── tkt-bdc6bbbb38.test │ │ │ ├── tkt-c48d99d690.test │ │ │ ├── tkt-cbd054fa6b.test │ │ │ ├── tkt-d11f09d36e.test │ │ │ ├── tkt-d635236375.test │ │ │ ├── tkt-d82e3f3721.test │ │ │ ├── tkt-f3e5abed55.test │ │ │ ├── tkt-f67b41381a.test │ │ │ ├── tkt-f777251dc7a.test │ │ │ ├── tkt-f7b4edec.test │ │ │ ├── tkt-f973c7ac31.test │ │ │ ├── tkt-fa7bf5ec.test │ │ │ ├── tkt-fc62af4523.test │ │ │ ├── tkt-fc7bd6358f.test │ │ │ ├── tkt1435.test │ │ │ ├── tkt1443.test │ │ │ ├── tkt1444.test │ │ │ ├── tkt1449.test │ │ │ ├── tkt1473.test │ │ │ ├── tkt1501.test │ │ │ ├── tkt1512.test │ │ │ ├── tkt1514.test │ │ │ ├── tkt1536.test │ │ │ ├── tkt1537.test │ │ │ ├── tkt1567.test │ │ │ ├── tkt1644.test │ │ │ ├── tkt1667.test │ │ │ ├── tkt1873.test │ │ │ ├── tkt2141.test │ │ │ ├── tkt2192.test │ │ │ ├── tkt2213.test │ │ │ ├── tkt2251.test │ │ │ ├── tkt2285.test │ │ │ ├── tkt2332.test │ │ │ ├── tkt2339.test │ │ │ ├── tkt2391.test │ │ │ ├── tkt2409.test │ │ │ ├── tkt2450.test │ │ │ ├── tkt2565.test │ │ │ ├── tkt2640.test │ │ │ ├── tkt2643.test │ │ │ ├── tkt2686.test │ │ │ ├── tkt2767.test │ │ │ ├── tkt2817.test │ │ │ ├── tkt2820.test │ │ │ ├── tkt2822.test │ │ │ ├── tkt2832.test │ │ │ ├── tkt2854.test │ │ │ ├── tkt2920.test │ │ │ ├── tkt2927.test │ │ │ ├── tkt2942.test │ │ │ ├── tkt3080.test │ │ │ ├── tkt3093.test │ │ │ ├── tkt3121.test │ │ │ ├── tkt3201.test │ │ │ ├── tkt3292.test │ │ │ ├── tkt3298.test │ │ │ ├── tkt3334.test │ │ │ ├── tkt3346.test │ │ │ ├── tkt3357.test │ │ │ ├── tkt3419.test │ │ │ ├── tkt3424.test │ │ │ ├── tkt3442.test │ │ │ ├── tkt3457.test │ │ │ ├── tkt3461.test │ │ │ ├── tkt3493.test │ │ │ ├── tkt3508.test │ │ │ ├── tkt3522.test │ │ │ ├── tkt3527.test │ │ │ ├── tkt3541.test │ │ │ ├── tkt3554.test │ │ │ ├── tkt3581.test │ │ │ ├── tkt35xx.test │ │ │ ├── tkt3630.test │ │ │ ├── tkt3718.test │ │ │ ├── tkt3731.test │ │ │ ├── tkt3757.test │ │ │ ├── tkt3761.test │ │ │ ├── tkt3762.test │ │ │ ├── tkt3773.test │ │ │ ├── tkt3791.test │ │ │ ├── tkt3793.test │ │ │ ├── tkt3810.test │ │ │ ├── tkt3824.test │ │ │ ├── tkt3832.test │ │ │ ├── tkt3838.test │ │ │ ├── tkt3841.test │ │ │ ├── tkt3871.test │ │ │ ├── tkt3879.test │ │ │ ├── tkt3911.test │ │ │ ├── tkt3918.test │ │ │ ├── tkt3922.test │ │ │ ├── tkt3929.test │ │ │ ├── tkt3935.test │ │ │ ├── tkt3992.test │ │ │ ├── tkt3997.test │ │ │ ├── tkt4018.test │ │ │ ├── tokenize.test │ │ │ ├── tpch01.test │ │ │ ├── trace.test │ │ │ ├── trace2.test │ │ │ ├── trace3.test │ │ │ ├── trans.test │ │ │ ├── trans2.test │ │ │ ├── trans3.test │ │ │ ├── transitive1.test │ │ │ ├── trigger1.test │ │ │ ├── trigger2.test │ │ │ ├── trigger3.test │ │ │ ├── trigger4.test │ │ │ ├── trigger5.test │ │ │ ├── trigger6.test │ │ │ ├── trigger7.test │ │ │ ├── trigger8.test │ │ │ ├── trigger9.test │ │ │ ├── triggerA.test │ │ │ ├── triggerB.test │ │ │ ├── triggerC.test │ │ │ ├── triggerD.test │ │ │ ├── triggerE.test │ │ │ ├── triggerF.test │ │ │ ├── triggerG.test │ │ │ ├── tt3_checkpoint.c │ │ │ ├── tt3_index.c │ │ │ ├── tt3_lookaside1.c │ │ │ ├── tt3_stress.c │ │ │ ├── tt3_vacuum.c │ │ │ ├── types.test │ │ │ ├── types2.test │ │ │ ├── types3.test │ │ │ ├── unionvtab.test │ │ │ ├── unionvtabfault.test │ │ │ ├── unique.test │ │ │ ├── unique2.test │ │ │ ├── unixexcl.test │ │ │ ├── unordered.test │ │ │ ├── update.test │ │ │ ├── update2.test │ │ │ ├── uri.test │ │ │ ├── uri2.test │ │ │ ├── userauth01.test │ │ │ ├── utf16align.test │ │ │ ├── vacuum.test │ │ │ ├── vacuum2.test │ │ │ ├── vacuum3.test │ │ │ ├── vacuum4.test │ │ │ ├── vacuum5.test │ │ │ ├── vacuummem.test │ │ │ ├── varint.test │ │ │ ├── veryquick.test │ │ │ ├── view.test │ │ │ ├── vtab1.test │ │ │ ├── vtab2.test │ │ │ ├── vtab3.test │ │ │ ├── vtab4.test │ │ │ ├── vtab5.test │ │ │ ├── vtab6.test │ │ │ ├── vtab7.test │ │ │ ├── vtab8.test │ │ │ ├── vtab9.test │ │ │ ├── vtabA.test │ │ │ ├── vtabB.test │ │ │ ├── vtabC.test │ │ │ ├── vtabD.test │ │ │ ├── vtabE.test │ │ │ ├── vtabF.test │ │ │ ├── vtabH.test │ │ │ ├── vtabI.test │ │ │ ├── vtabJ.test │ │ │ ├── vtab_alter.test │ │ │ ├── vtab_err.test │ │ │ ├── vtab_shared.test │ │ │ ├── wal.test │ │ │ ├── wal2.test │ │ │ ├── wal3.test │ │ │ ├── wal4.test │ │ │ ├── wal5.test │ │ │ ├── wal6.test │ │ │ ├── wal64k.test │ │ │ ├── wal7.test │ │ │ ├── wal8.test │ │ │ ├── wal9.test │ │ │ ├── wal_common.tcl │ │ │ ├── walbak.test │ │ │ ├── walbig.test │ │ │ ├── walblock.test │ │ │ ├── walcksum.test │ │ │ ├── walcrash.test │ │ │ ├── walcrash2.test │ │ │ ├── walcrash3.test │ │ │ ├── walcrash4.test │ │ │ ├── walfault.test │ │ │ ├── walhook.test │ │ │ ├── walmode.test │ │ │ ├── walnoshm.test │ │ │ ├── waloverwrite.test │ │ │ ├── walpersist.test │ │ │ ├── walprotocol.test │ │ │ ├── walro.test │ │ │ ├── walshared.test │ │ │ ├── walslow.test │ │ │ ├── walthread.test │ │ │ ├── where.test │ │ │ ├── where2.test │ │ │ ├── where3.test │ │ │ ├── where4.test │ │ │ ├── where5.test │ │ │ ├── where6.test │ │ │ ├── where7.test │ │ │ ├── where8.test │ │ │ ├── where9.test │ │ │ ├── whereA.test │ │ │ ├── whereB.test │ │ │ ├── whereC.test │ │ │ ├── whereD.test │ │ │ ├── whereE.test │ │ │ ├── whereF.test │ │ │ ├── whereG.test │ │ │ ├── whereH.test │ │ │ ├── whereI.test │ │ │ ├── whereJ.test │ │ │ ├── whereK.test │ │ │ ├── wherefault.test │ │ │ ├── wherelimit.test │ │ │ ├── wild001.test │ │ │ ├── win32heap.test │ │ │ ├── win32lock.test │ │ │ ├── win32longpath.test │ │ │ ├── win32nolock.test │ │ │ ├── with1.test │ │ │ ├── with2.test │ │ │ ├── with3.test │ │ │ ├── withM.test │ │ │ ├── without_rowid1.test │ │ │ ├── without_rowid2.test │ │ │ ├── without_rowid3.test │ │ │ ├── without_rowid4.test │ │ │ ├── without_rowid5.test │ │ │ ├── without_rowid6.test │ │ │ ├── wordcount.c │ │ │ ├── writecrash.test │ │ │ ├── zeroblob.test │ │ │ └── zerodamage.test │ │ ├── bug/ │ │ │ ├── 1.c │ │ │ ├── 10.c │ │ │ ├── 11.c │ │ │ ├── 12.c │ │ │ ├── 13.c │ │ │ ├── 14.c │ │ │ ├── 15.c │ │ │ ├── 16.c │ │ │ ├── 17.c │ │ │ ├── 18.c │ │ │ ├── 2.c │ │ │ ├── 3.c │ │ │ ├── 4.c │ │ │ ├── 5.c │ │ │ ├── 6.c │ │ │ ├── 7.c │ │ │ ├── 8.c │ │ │ ├── 8.expect │ │ │ ├── 9.c │ │ │ └── 9.expect │ │ ├── cpp-expand/ │ │ │ ├── 000.h │ │ │ ├── 000.h.expect │ │ │ ├── 001.h │ │ │ ├── 001.h.expect │ │ │ ├── 002.h │ │ │ ├── 002.h.expect │ │ │ ├── 003.h │ │ │ ├── 003.h.expect │ │ │ ├── 004.h │ │ │ ├── 004.h.expect │ │ │ ├── 005.c │ │ │ ├── 005.c.expect │ │ │ ├── 006.c │ │ │ ├── 006.c.expect │ │ │ ├── 007.c │ │ │ ├── 007.c.expect │ │ │ ├── 008.c │ │ │ ├── 008.c.expect │ │ │ ├── 009.c │ │ │ ├── 009.c.expect │ │ │ ├── 010.c │ │ │ ├── 010.c.expect │ │ │ ├── 011.c │ │ │ ├── 011.c.expect │ │ │ ├── example-6.10-8.h │ │ │ ├── example-6.10-8.h.expect │ │ │ ├── example-6.10.2-7.h │ │ │ ├── example-6.10.2-7.h.expect │ │ │ ├── example-6.10.2-8.h │ │ │ ├── example-6.10.2-8.h.expect │ │ │ ├── example-6.10.3.3-4.h │ │ │ ├── example-6.10.3.3-4.h.expect │ │ │ ├── example-6.10.3.5-3.h │ │ │ ├── example-6.10.3.5-3.h.expect │ │ │ ├── example-6.10.3.5-4.h │ │ │ ├── example-6.10.3.5-4.h.expect │ │ │ ├── example-6.10.3.5-5.h │ │ │ ├── example-6.10.3.5-5.h.expect │ │ │ ├── example-6.10.3.5-6.h │ │ │ ├── example-6.10.3.5-6.h.expect │ │ │ ├── example-6.10.3.5-7.h │ │ │ ├── example-6.10.3.5-7.h.expect │ │ │ ├── example-6.10.3.5-8.h │ │ │ ├── example-6.10.3.5-8.h.expect │ │ │ ├── example-6.10.3.5-9.h │ │ │ ├── example-6.10.3.5-9.h.expect │ │ │ └── mustfail/ │ │ │ ├── example-6.10.3.5-9a.h │ │ │ ├── example-6.10.3.5-9b.h │ │ │ ├── example-6.10.3.5-9c.h │ │ │ └── example-6.10.3.5-9d.h │ │ ├── github.com/ │ │ │ └── gcc-mirror/ │ │ │ ├── COPYING.LIB │ │ │ ├── COPYING.RUNTIME │ │ │ ├── COPYING3 │ │ │ ├── COPYING3.LIB │ │ │ ├── README │ │ │ └── gcc/ │ │ │ └── gcc/ │ │ │ └── testsuite/ │ │ │ └── gcc.c-torture/ │ │ │ └── execute/ │ │ │ ├── 20000112-1.c │ │ │ ├── 20000113-1.c │ │ │ ├── 20000121-1.c │ │ │ ├── 20000205-1.c │ │ │ ├── 20000217-1.c │ │ │ ├── 20000223-1.c │ │ │ ├── 20000224-1.c │ │ │ ├── 20000225-1.c │ │ │ ├── 20000227-1.c │ │ │ ├── 20000313-1.c │ │ │ ├── 20000314-1.c │ │ │ ├── 20000314-2.c │ │ │ ├── 20000314-3.c │ │ │ ├── 20000402-1.c │ │ │ ├── 20000403-1.c │ │ │ ├── 20000412-1.c │ │ │ ├── 20000412-2.c │ │ │ ├── 20000412-3.c │ │ │ ├── 20000412-4.c │ │ │ ├── 20000412-5.c │ │ │ ├── 20000412-6.c │ │ │ ├── 20000419-1.c │ │ │ ├── 20000422-1.c │ │ │ ├── 20000503-1.c │ │ │ ├── 20000511-1.c │ │ │ ├── 20000519-1.c │ │ │ ├── 20000519-2.c │ │ │ ├── 20000523-1.c │ │ │ ├── 20000528-1.c │ │ │ ├── 20000603-1.c │ │ │ ├── 20000605-1.c │ │ │ ├── 20000605-2.c │ │ │ ├── 20000605-3.c │ │ │ ├── 20000622-1.c │ │ │ ├── 20000703-1.c │ │ │ ├── 20000706-1.c │ │ │ ├── 20000706-2.c │ │ │ ├── 20000706-3.c │ │ │ ├── 20000706-4.c │ │ │ ├── 20000706-5.c │ │ │ ├── 20000707-1.c │ │ │ ├── 20000715-1.c │ │ │ ├── 20000715-2.c │ │ │ ├── 20000717-1.c │ │ │ ├── 20000717-2.c │ │ │ ├── 20000717-3.c │ │ │ ├── 20000717-4.c │ │ │ ├── 20000717-5.c │ │ │ ├── 20000722-1.c │ │ │ ├── 20000726-1.c │ │ │ ├── 20000731-1.c │ │ │ ├── 20000731-2.c │ │ │ ├── 20000801-1.c │ │ │ ├── 20000801-2.c │ │ │ ├── 20000801-3.c │ │ │ ├── 20000801-4.c │ │ │ ├── 20000808-1.c │ │ │ ├── 20000815-1.c │ │ │ ├── 20000818-1.c │ │ │ ├── 20000819-1.c │ │ │ ├── 20000822-1.c │ │ │ ├── 20000910-1.c │ │ │ ├── 20000910-2.c │ │ │ ├── 20000914-1.c │ │ │ ├── 20000917-1.c │ │ │ ├── 20001009-1.c │ │ │ ├── 20001009-2.c │ │ │ ├── 20001011-1.c │ │ │ ├── 20001013-1.c │ │ │ ├── 20001017-1.c │ │ │ ├── 20001017-2.c │ │ │ ├── 20001024-1.c │ │ │ ├── 20001026-1.c │ │ │ ├── 20001027-1.c │ │ │ ├── 20001031-1.c │ │ │ ├── 20001101.c │ │ │ ├── 20001108-1.c │ │ │ ├── 20001111-1.c │ │ │ ├── 20001112-1.c │ │ │ ├── 20001121-1.c │ │ │ ├── 20001124-1.c │ │ │ ├── 20001130-1.c │ │ │ ├── 20001130-2.c │ │ │ ├── 20001203-1.c │ │ │ ├── 20001203-2.c │ │ │ ├── 20001221-1.c │ │ │ ├── 20001228-1.c │ │ │ ├── 20001229-1.c │ │ │ ├── 20010106-1.c │ │ │ ├── 20010114-1.c │ │ │ ├── 20010116-1.c │ │ │ ├── 20010118-1.c │ │ │ ├── 20010119-1.c │ │ │ ├── 20010122-1.c │ │ │ ├── 20010123-1.c │ │ │ ├── 20010129-1.c │ │ │ ├── 20010206-1.c │ │ │ ├── 20010209-1.c │ │ │ ├── 20010221-1.c │ │ │ ├── 20010222-1.c │ │ │ ├── 20010224-1.c │ │ │ ├── 20010325-1.c │ │ │ ├── 20010329-1.c │ │ │ ├── 20010403-1.c │ │ │ ├── 20010409-1.c │ │ │ ├── 20010422-1.c │ │ │ ├── 20010518-1.c │ │ │ ├── 20010518-2.c │ │ │ ├── 20010520-1.c │ │ │ ├── 20010604-1.c │ │ │ ├── 20010605-1.c │ │ │ ├── 20010605-2.c │ │ │ ├── 20010711-1.c │ │ │ ├── 20010717-1.c │ │ │ ├── 20010723-1.c │ │ │ ├── 20010904-1.c │ │ │ ├── 20010904-2.c │ │ │ ├── 20010910-1.c │ │ │ ├── 20010915-1.c │ │ │ ├── 20010924-1.c │ │ │ ├── 20010925-1.c │ │ │ ├── 20011008-3.c │ │ │ ├── 20011019-1.c │ │ │ ├── 20011024-1.c │ │ │ ├── 20011109-1.c │ │ │ ├── 20011109-2.c │ │ │ ├── 20011113-1.c │ │ │ ├── 20011114-1.c │ │ │ ├── 20011115-1.c │ │ │ ├── 20011121-1.c │ │ │ ├── 20011126-1.c │ │ │ ├── 20011126-2.c │ │ │ ├── 20011128-1.c │ │ │ ├── 20011217-1.c │ │ │ ├── 20011219-1.c │ │ │ ├── 20011223-1.c │ │ │ ├── 20020103-1.c │ │ │ ├── 20020107-1.c │ │ │ ├── 20020108-1.c │ │ │ ├── 20020118-1.c │ │ │ ├── 20020127-1.c │ │ │ ├── 20020129-1.c │ │ │ ├── 20020201-1.c │ │ │ ├── 20020206-1.c │ │ │ ├── 20020206-2.c │ │ │ ├── 20020213-1.c │ │ │ ├── 20020215-1.c │ │ │ ├── 20020216-1.c │ │ │ ├── 20020219-1.c │ │ │ ├── 20020225-1.c │ │ │ ├── 20020225-2.c │ │ │ ├── 20020226-1.c │ │ │ ├── 20020227-1.c │ │ │ ├── 20020307-1.c │ │ │ ├── 20020314-1.c │ │ │ ├── 20020320-1.c │ │ │ ├── 20020321-1.c │ │ │ ├── 20020328-1.c │ │ │ ├── 20020402-1.c │ │ │ ├── 20020402-2.c │ │ │ ├── 20020402-3.c │ │ │ ├── 20020404-1.c │ │ │ ├── 20020406-1.c │ │ │ ├── 20020411-1.c │ │ │ ├── 20020412-1.c │ │ │ ├── 20020413-1.c │ │ │ ├── 20020418-1.c │ │ │ ├── 20020423-1.c │ │ │ ├── 20020503-1.c │ │ │ ├── 20020506-1.c │ │ │ ├── 20020508-1.c │ │ │ ├── 20020508-2.c │ │ │ ├── 20020508-3.c │ │ │ ├── 20020510-1.c │ │ │ ├── 20020529-1.c │ │ │ ├── 20020611-1.c │ │ │ ├── 20020614-1.c │ │ │ ├── 20020615-1.c │ │ │ ├── 20020619-1.c │ │ │ ├── 20020716-1.c │ │ │ ├── 20020720-1.c │ │ │ ├── 20020805-1.c │ │ │ ├── 20020810-1.c │ │ │ ├── 20020819-1.c │ │ │ ├── 20020904-1.c │ │ │ ├── 20020911-1.c │ │ │ ├── 20020916-1.c │ │ │ ├── 20020920-1.c │ │ │ ├── 20021010-1.c │ │ │ ├── 20021010-2.c │ │ │ ├── 20021011-1.c │ │ │ ├── 20021015-1.c │ │ │ ├── 20021024-1.c │ │ │ ├── 20021111-1.c │ │ │ ├── 20021113-1.c │ │ │ ├── 20021118-1.c │ │ │ ├── 20021118-2.c │ │ │ ├── 20021118-3.c │ │ │ ├── 20021119-1.c │ │ │ ├── 20021120-1.c │ │ │ ├── 20021120-2.c │ │ │ ├── 20021120-3.c │ │ │ ├── 20021127-1.c │ │ │ ├── 20021204-1.c │ │ │ ├── 20021219-1.c │ │ │ ├── 20030105-1.c │ │ │ ├── 20030109-1.c │ │ │ ├── 20030117-1.c │ │ │ ├── 20030120-1.c │ │ │ ├── 20030120-2.c │ │ │ ├── 20030125-1.c │ │ │ ├── 20030128-1.c │ │ │ ├── 20030203-1.c │ │ │ ├── 20030209-1.c │ │ │ ├── 20030216-1.c │ │ │ ├── 20030218-1.c │ │ │ ├── 20030221-1.c │ │ │ ├── 20030222-1.c │ │ │ ├── 20030224-2.c │ │ │ ├── 20030307-1.c │ │ │ ├── 20030313-1.c │ │ │ ├── 20030316-1.c │ │ │ ├── 20030323-1.c │ │ │ ├── 20030330-1.c │ │ │ ├── 20030401-1.c │ │ │ ├── 20030403-1.c │ │ │ ├── 20030404-1.c │ │ │ ├── 20030408-1.c │ │ │ ├── 20030501-1.c │ │ │ ├── 20030606-1.c │ │ │ ├── 20030613-1.c │ │ │ ├── 20030626-1.c │ │ │ ├── 20030626-2.c │ │ │ ├── 20030714-1.c │ │ │ ├── 20030715-1.c │ │ │ ├── 20030717-1.c │ │ │ ├── 20030718-1.c │ │ │ ├── 20030811-1.c │ │ │ ├── 20030821-1.c │ │ │ ├── 20030828-1.c │ │ │ ├── 20030828-2.c │ │ │ ├── 20030903-1.c │ │ │ ├── 20030909-1.c │ │ │ ├── 20030910-1.c │ │ │ ├── 20030913-1.c │ │ │ ├── 20030914-1.c │ │ │ ├── 20030914-2.c │ │ │ ├── 20030916-1.c │ │ │ ├── 20030920-1.c │ │ │ ├── 20030928-1.c │ │ │ ├── 20031003-1.c │ │ │ ├── 20031010-1.c │ │ │ ├── 20031011-1.c │ │ │ ├── 20031012-1.c │ │ │ ├── 20031020-1.c │ │ │ ├── 20031201-1.c │ │ │ ├── 20031204-1.c │ │ │ ├── 20031211-1.c │ │ │ ├── 20031211-2.c │ │ │ ├── 20031214-1.c │ │ │ ├── 20031215-1.c │ │ │ ├── 20031216-1.c │ │ │ ├── 20040208-1.c │ │ │ ├── 20040218-1.c │ │ │ ├── 20040223-1.c │ │ │ ├── 20040302-1.c │ │ │ ├── 20040307-1.c │ │ │ ├── 20040308-1.c │ │ │ ├── 20040309-1.c │ │ │ ├── 20040311-1.c │ │ │ ├── 20040313-1.c │ │ │ ├── 20040319-1.c │ │ │ ├── 20040331-1.c │ │ │ ├── 20040409-1.c │ │ │ ├── 20040409-2.c │ │ │ ├── 20040409-3.c │ │ │ ├── 20040411-1.c │ │ │ ├── 20040423-1.c │ │ │ ├── 20040520-1.c │ │ │ ├── 20040625-1.c │ │ │ ├── 20040629-1.c │ │ │ ├── 20040703-1.c │ │ │ ├── 20040704-1.c │ │ │ ├── 20040705-1.c │ │ │ ├── 20040705-2.c │ │ │ ├── 20040706-1.c │ │ │ ├── 20040707-1.c │ │ │ ├── 20040709-1.c │ │ │ ├── 20040709-2.c │ │ │ ├── 20040805-1.c │ │ │ ├── 20040811-1.c │ │ │ ├── 20040820-1.c │ │ │ ├── 20040823-1.c │ │ │ ├── 20040831-1.c │ │ │ ├── 20040917-1.c │ │ │ ├── 20041011-1.c │ │ │ ├── 20041019-1.c │ │ │ ├── 20041112-1.c │ │ │ ├── 20041113-1.c │ │ │ ├── 20041114-1.c │ │ │ ├── 20041124-1.c │ │ │ ├── 20041126-1.c │ │ │ ├── 20041201-1.c │ │ │ ├── 20041210-1.c │ │ │ ├── 20041212-1.c │ │ │ ├── 20041213-2.c │ │ │ ├── 20041214-1.c │ │ │ ├── 20041218-1.c │ │ │ ├── 20041218-2.c │ │ │ ├── 20050104-1.c │ │ │ ├── 20050106-1.c │ │ │ ├── 20050107-1.c │ │ │ ├── 20050111-1.c │ │ │ ├── 20050119-1.c │ │ │ ├── 20050119-2.c │ │ │ ├── 20050121-1.c │ │ │ ├── 20050124-1.c │ │ │ ├── 20050125-1.c │ │ │ ├── 20050131-1.c │ │ │ ├── 20050203-1.c │ │ │ ├── 20050215-1.c │ │ │ ├── 20050218-1.c │ │ │ ├── 20050224-1.c │ │ │ ├── 20050316-1.c │ │ │ ├── 20050316-2.c │ │ │ ├── 20050316-3.c │ │ │ ├── 20050410-1.c │ │ │ ├── 20050502-1.c │ │ │ ├── 20050502-2.c │ │ │ ├── 20050604-1.c │ │ │ ├── 20050607-1.c │ │ │ ├── 20050613-1.c │ │ │ ├── 20050713-1.c │ │ │ ├── 20050826-1.c │ │ │ ├── 20050826-2.c │ │ │ ├── 20050929-1.c │ │ │ ├── 20051012-1.c │ │ │ ├── 20051021-1.c │ │ │ ├── 20051104-1.c │ │ │ ├── 20051110-1.c │ │ │ ├── 20051110-2.c │ │ │ ├── 20051113-1.c │ │ │ ├── 20051215-1.c │ │ │ ├── 20060102-1.c │ │ │ ├── 20060110-1.c │ │ │ ├── 20060110-2.c │ │ │ ├── 20060127-1.c │ │ │ ├── 20060412-1.c │ │ │ ├── 20060420-1.c │ │ │ ├── 20060905-1.c │ │ │ ├── 20060910-1.c │ │ │ ├── 20060929-1.c │ │ │ ├── 20060930-1.c │ │ │ ├── 20060930-2.c │ │ │ ├── 20061031-1.c │ │ │ ├── 20061101-1.c │ │ │ ├── 20061101-2.c │ │ │ ├── 20061220-1.c │ │ │ ├── 20070201-1.c │ │ │ ├── 20070212-1.c │ │ │ ├── 20070212-2.c │ │ │ ├── 20070212-3.c │ │ │ ├── 20070424-1.c │ │ │ ├── 20070517-1.c │ │ │ ├── 20070614-1.c │ │ │ ├── 20070623-1.c │ │ │ ├── 20070724-1.c │ │ │ ├── 20070824-1.c │ │ │ ├── 20070919-1.c │ │ │ ├── 20071011-1.c │ │ │ ├── 20071018-1.c │ │ │ ├── 20071029-1.c │ │ │ ├── 20071030-1.c │ │ │ ├── 20071108-1.c │ │ │ ├── 20071120-1.c │ │ │ ├── 20071202-1.c │ │ │ ├── 20071205-1.c │ │ │ ├── 20071210-1.c │ │ │ ├── 20071211-1.c │ │ │ ├── 20071213-1.c │ │ │ ├── 20071216-1.c │ │ │ ├── 20071219-1.c │ │ │ ├── 20071220-1.c │ │ │ ├── 20071220-2.c │ │ │ ├── 20080117-1.c │ │ │ ├── 20080122-1.c │ │ │ ├── 20080222-1.c │ │ │ ├── 20080408-1.c │ │ │ ├── 20080424-1.c │ │ │ ├── 20080502-1.c │ │ │ ├── 20080506-1.c │ │ │ ├── 20080506-2.c │ │ │ ├── 20080519-1.c │ │ │ ├── 20080522-1.c │ │ │ ├── 20080529-1.c │ │ │ ├── 20080604-1.c │ │ │ ├── 20080719-1.c │ │ │ ├── 20080813-1.c │ │ │ ├── 20081103-1.c │ │ │ ├── 20081112-1.c │ │ │ ├── 20081117-1.c │ │ │ ├── 20081218-1.c │ │ │ ├── 20090113-1.c │ │ │ ├── 20090113-2.c │ │ │ ├── 20090113-3.c │ │ │ ├── 20090207-1.c │ │ │ ├── 20090219-1.c │ │ │ ├── 20090527-1.c │ │ │ ├── 20090623-1.c │ │ │ ├── 20090711-1.c │ │ │ ├── 20090814-1.c │ │ │ ├── 20091229-1.c │ │ │ ├── 20100209-1.c │ │ │ ├── 20100316-1.c │ │ │ ├── 20100416-1.c │ │ │ ├── 20100430-1.c │ │ │ ├── 20100708-1.c │ │ │ ├── 20100805-1.c │ │ │ ├── 20100827-1.c │ │ │ ├── 20101011-1.c │ │ │ ├── 20101013-1.c │ │ │ ├── 20101025-1.c │ │ │ ├── 20110418-1.c │ │ │ ├── 20111208-1.c │ │ │ ├── 20111212-1.c │ │ │ ├── 20111227-1.c │ │ │ ├── 20120105-1.c │ │ │ ├── 20120111-1.c │ │ │ ├── 20120207-1.c │ │ │ ├── 20120427-1.c │ │ │ ├── 20120427-2.c │ │ │ ├── 20120615-1.c │ │ │ ├── 20120808-1.c │ │ │ ├── 20120817-1.c │ │ │ ├── 20120919-1.c │ │ │ ├── 20121108-1.c │ │ │ ├── 20131127-1.c │ │ │ ├── 20140212-1.c │ │ │ ├── 20140212-2.c │ │ │ ├── 20140326-1.c │ │ │ ├── 20140425-1.c │ │ │ ├── 20140622-1.c │ │ │ ├── 20140828-1.c │ │ │ ├── 20141022-1.c │ │ │ ├── 20141107-1.c │ │ │ ├── 20141125-1.c │ │ │ ├── 20150611-1.c │ │ │ ├── 20170111-1.c │ │ │ ├── 20170401-1.c │ │ │ ├── 20170401-2.c │ │ │ ├── 20170419-1.c │ │ │ ├── 900409-1.c │ │ │ ├── 920202-1.c │ │ │ ├── 920302-1.c │ │ │ ├── 920409-1.c │ │ │ ├── 920410-1.c │ │ │ ├── 920411-1.c │ │ │ ├── 920415-1.c │ │ │ ├── 920428-1.c │ │ │ ├── 920428-2.c │ │ │ ├── 920429-1.c │ │ │ ├── 920501-1.c │ │ │ ├── 920501-2.c │ │ │ ├── 920501-3.c │ │ │ ├── 920501-4.c │ │ │ ├── 920501-5.c │ │ │ ├── 920501-6.c │ │ │ ├── 920501-7.c │ │ │ ├── 920501-8.c │ │ │ ├── 920501-9.c │ │ │ ├── 920506-1.c │ │ │ ├── 920520-1.c │ │ │ ├── 920603-1.c │ │ │ ├── 920604-1.c │ │ │ ├── 920612-1.c │ │ │ ├── 920612-2.c │ │ │ ├── 920618-1.c │ │ │ ├── 920625-1.c │ │ │ ├── 920710-1.c │ │ │ ├── 920711-1.c │ │ │ ├── 920721-1.c │ │ │ ├── 920721-2.c │ │ │ ├── 920721-3.c │ │ │ ├── 920721-4.c │ │ │ ├── 920726-1.c │ │ │ ├── 920728-1.c │ │ │ ├── 920730-1.c │ │ │ ├── 920731-1.c │ │ │ ├── 920810-1.c │ │ │ ├── 920812-1.c │ │ │ ├── 920829-1.c │ │ │ ├── 920908-1.c │ │ │ ├── 920908-2.c │ │ │ ├── 920909-1.c │ │ │ ├── 920922-1.c │ │ │ ├── 920929-1.c │ │ │ ├── 921006-1.c │ │ │ ├── 921007-1.c │ │ │ ├── 921013-1.c │ │ │ ├── 921016-1.c │ │ │ ├── 921017-1.c │ │ │ ├── 921019-1.c │ │ │ ├── 921019-2.c │ │ │ ├── 921029-1.c │ │ │ ├── 921104-1.c │ │ │ ├── 921110-1.c │ │ │ ├── 921112-1.c │ │ │ ├── 921113-1.c │ │ │ ├── 921117-1.c │ │ │ ├── 921123-1.c │ │ │ ├── 921123-2.c │ │ │ ├── 921124-1.c │ │ │ ├── 921202-1.c │ │ │ ├── 921202-2.c │ │ │ ├── 921204-1.c │ │ │ ├── 921207-1.c │ │ │ ├── 921208-1.c │ │ │ ├── 921208-2.c │ │ │ ├── 921215-1.c │ │ │ ├── 921218-1.c │ │ │ ├── 921218-2.c │ │ │ ├── 930106-1.c │ │ │ ├── 930111-1.c │ │ │ ├── 930123-1.c │ │ │ ├── 930126-1.c │ │ │ ├── 930208-1.c │ │ │ ├── 930406-1.c │ │ │ ├── 930408-1.c │ │ │ ├── 930429-1.c │ │ │ ├── 930429-2.c │ │ │ ├── 930513-1.c │ │ │ ├── 930513-2.c │ │ │ ├── 930518-1.c │ │ │ ├── 930526-1.c │ │ │ ├── 930527-1.c │ │ │ ├── 930529-1.c │ │ │ ├── 930603-1.c │ │ │ ├── 930603-2.c │ │ │ ├── 930603-3.c │ │ │ ├── 930608-1.c │ │ │ ├── 930614-1.c │ │ │ ├── 930614-2.c │ │ │ ├── 930621-1.c │ │ │ ├── 930622-1.c │ │ │ ├── 930622-2.c │ │ │ ├── 930628-1.c │ │ │ ├── 930630-1.c │ │ │ ├── 930702-1.c │ │ │ ├── 930713-1.c │ │ │ ├── 930718-1.c │ │ │ ├── 930719-1.c │ │ │ ├── 930725-1.c │ │ │ ├── 930818-1.c │ │ │ ├── 930916-1.c │ │ │ ├── 930921-1.c │ │ │ ├── 930929-1.c │ │ │ ├── 930930-1.c │ │ │ ├── 930930-2.c │ │ │ ├── 931002-1.c │ │ │ ├── 931004-1.c │ │ │ ├── 931004-10.c │ │ │ ├── 931004-11.c │ │ │ ├── 931004-12.c │ │ │ ├── 931004-13.c │ │ │ ├── 931004-14.c │ │ │ ├── 931004-2.c │ │ │ ├── 931004-3.c │ │ │ ├── 931004-4.c │ │ │ ├── 931004-5.c │ │ │ ├── 931004-6.c │ │ │ ├── 931004-7.c │ │ │ ├── 931004-8.c │ │ │ ├── 931004-9.c │ │ │ ├── 931005-1.c │ │ │ ├── 931009-1.c │ │ │ ├── 931012-1.c │ │ │ ├── 931017-1.c │ │ │ ├── 931018-1.c │ │ │ ├── 931031-1.c │ │ │ ├── 931102-1.c │ │ │ ├── 931102-2.c │ │ │ ├── 931110-1.c │ │ │ ├── 931110-2.c │ │ │ ├── 931208-1.c │ │ │ ├── 931228-1.c │ │ │ ├── 940115-1.c │ │ │ ├── 940122-1.c │ │ │ ├── 941014-1.c │ │ │ ├── 941014-2.c │ │ │ ├── 941015-1.c │ │ │ ├── 941021-1.c │ │ │ ├── 941025-1.c │ │ │ ├── 941031-1.c │ │ │ ├── 941101-1.c │ │ │ ├── 941110-1.c │ │ │ ├── 941202-1.c │ │ │ ├── 950221-1.c │ │ │ ├── 950322-1.c │ │ │ ├── 950426-1.c │ │ │ ├── 950426-2.c │ │ │ ├── 950503-1.c │ │ │ ├── 950511-1.c │ │ │ ├── 950512-1.c │ │ │ ├── 950605-1.c │ │ │ ├── 950607-1.c │ │ │ ├── 950607-2.c │ │ │ ├── 950612-1.c │ │ │ ├── 950621-1.c │ │ │ ├── 950628-1.c │ │ │ ├── 950704-1.c │ │ │ ├── 950706-1.c │ │ │ ├── 950710-1.c │ │ │ ├── 950714-1.c │ │ │ ├── 950809-1.c │ │ │ ├── 950906-1.c │ │ │ ├── 950915-1.c │ │ │ ├── 950929-1.c │ │ │ ├── 951003-1.c │ │ │ ├── 951115-1.c │ │ │ ├── 951204-1.c │ │ │ ├── 960116-1.c │ │ │ ├── 960117-1.c │ │ │ ├── 960209-1.c │ │ │ ├── 960215-1.c │ │ │ ├── 960218-1.c │ │ │ ├── 960219-1.c │ │ │ ├── 960301-1.c │ │ │ ├── 960302-1.c │ │ │ ├── 960311-1.c │ │ │ ├── 960311-2.c │ │ │ ├── 960311-3.c │ │ │ ├── 960312-1.c │ │ │ ├── 960317-1.c │ │ │ ├── 960321-1.c │ │ │ ├── 960326-1.c │ │ │ ├── 960327-1.c │ │ │ ├── 960402-1.c │ │ │ ├── 960405-1.c │ │ │ ├── 960416-1.c │ │ │ ├── 960419-1.c │ │ │ ├── 960419-2.c │ │ │ ├── 960512-1.c │ │ │ ├── 960513-1.c │ │ │ ├── 960521-1.c │ │ │ ├── 960608-1.c │ │ │ ├── 960801-1.c │ │ │ ├── 960802-1.c │ │ │ ├── 960830-1.c │ │ │ ├── 960909-1.c │ │ │ ├── 961004-1.c │ │ │ ├── 961017-1.c │ │ │ ├── 961017-2.c │ │ │ ├── 961026-1.c │ │ │ ├── 961112-1.c │ │ │ ├── 961122-1.c │ │ │ ├── 961122-2.c │ │ │ ├── 961125-1.c │ │ │ ├── 961206-1.c │ │ │ ├── 961213-1.c │ │ │ ├── 961223-1.c │ │ │ ├── 970214-1.c │ │ │ ├── 970214-2.c │ │ │ ├── 970217-1.c │ │ │ ├── 970923-1.c │ │ │ ├── 980205.c │ │ │ ├── 980223.c │ │ │ ├── 980424-1.c │ │ │ ├── 980505-1.c │ │ │ ├── 980505-2.c │ │ │ ├── 980506-1.c │ │ │ ├── 980506-2.c │ │ │ ├── 980506-3.c │ │ │ ├── 980526-1.c │ │ │ ├── 980526-2.c │ │ │ ├── 980526-3.c │ │ │ ├── 980602-1.c │ │ │ ├── 980602-2.c │ │ │ ├── 980604-1.c │ │ │ ├── 980605-1.c │ │ │ ├── 980608-1.c │ │ │ ├── 980612-1.c │ │ │ ├── 980617-1.c │ │ │ ├── 980618-1.c │ │ │ ├── 980701-1.c │ │ │ ├── 980707-1.c │ │ │ ├── 980709-1.c │ │ │ ├── 980716-1.c │ │ │ ├── 980929-1.c │ │ │ ├── 981001-1.c │ │ │ ├── 981019-1.c │ │ │ ├── 981130-1.c │ │ │ ├── 981206-1.c │ │ │ ├── 990106-1.c │ │ │ ├── 990106-2.c │ │ │ ├── 990117-1.c │ │ │ ├── 990127-1.c │ │ │ ├── 990127-2.c │ │ │ ├── 990128-1.c │ │ │ ├── 990130-1.c │ │ │ ├── 990208-1.c │ │ │ ├── 990211-1.c │ │ │ ├── 990222-1.c │ │ │ ├── 990324-1.c │ │ │ ├── 990326-1.c │ │ │ ├── 990404-1.c │ │ │ ├── 990413-2.c │ │ │ ├── 990513-1.c │ │ │ ├── 990524-1.c │ │ │ ├── 990525-1.c │ │ │ ├── 990525-2.c │ │ │ ├── 990527-1.c │ │ │ ├── 990531-1.c │ │ │ ├── 990604-1.c │ │ │ ├── 990628-1.c │ │ │ ├── 990804-1.c │ │ │ ├── 990811-1.c │ │ │ ├── 990826-0.c │ │ │ ├── 990827-1.c │ │ │ ├── 990829-1.c │ │ │ ├── 990923-1.c │ │ │ ├── 991014-1.c │ │ │ ├── 991016-1.c │ │ │ ├── 991019-1.c │ │ │ ├── 991023-1.c │ │ │ ├── 991030-1.c │ │ │ ├── 991112-1.c │ │ │ ├── 991118-1.c │ │ │ ├── 991201-1.c │ │ │ ├── 991202-1.c │ │ │ ├── 991202-2.c │ │ │ ├── 991202-3.c │ │ │ ├── 991216-1.c │ │ │ ├── 991216-2.c │ │ │ ├── 991216-4.c │ │ │ ├── 991221-1.c │ │ │ ├── 991227-1.c │ │ │ ├── 991228-1.c │ │ │ ├── alias-1.c │ │ │ ├── alias-2.c │ │ │ ├── alias-3.c │ │ │ ├── alias-4.c │ │ │ ├── align-1.c │ │ │ ├── align-2.c │ │ │ ├── align-3.c │ │ │ ├── align-nest.c │ │ │ ├── alloca-1.c │ │ │ ├── anon-1.c │ │ │ ├── arith-1.c │ │ │ ├── arith-rand-ll.c │ │ │ ├── arith-rand.c │ │ │ ├── ashldi-1.c │ │ │ ├── ashrdi-1.c │ │ │ ├── bcp-1.c │ │ │ ├── bf-layout-1.c │ │ │ ├── bf-pack-1.c │ │ │ ├── bf-sign-1.c │ │ │ ├── bf-sign-2.c │ │ │ ├── bf64-1.c │ │ │ ├── bitfld-1.c │ │ │ ├── bitfld-2.c │ │ │ ├── bitfld-3.c │ │ │ ├── bitfld-4.c │ │ │ ├── bitfld-5.c │ │ │ ├── bitfld-6.c │ │ │ ├── bitfld-7.c │ │ │ ├── bswap-1.c │ │ │ ├── bswap-2.c │ │ │ ├── built-in-setjmp.c │ │ │ ├── builtin-bitops-1.c │ │ │ ├── builtin-constant.c │ │ │ ├── builtin-prefetch-1.c │ │ │ ├── builtin-prefetch-2.c │ │ │ ├── builtin-prefetch-3.c │ │ │ ├── builtin-prefetch-4.c │ │ │ ├── builtin-prefetch-5.c │ │ │ ├── builtin-prefetch-6.c │ │ │ ├── builtin-types-compatible-p.c │ │ │ ├── call-trap-1.c │ │ │ ├── cbrt.c │ │ │ ├── cmpdi-1.c │ │ │ ├── cmpsf-1.c │ │ │ ├── cmpsi-1.c │ │ │ ├── cmpsi-2.c │ │ │ ├── comp-goto-1.c │ │ │ ├── comp-goto-2.c │ │ │ ├── compare-1.c │ │ │ ├── compare-2.c │ │ │ ├── compare-3.c │ │ │ ├── complex-1.c │ │ │ ├── complex-2.c │ │ │ ├── complex-3.c │ │ │ ├── complex-4.c │ │ │ ├── complex-5.c │ │ │ ├── complex-6.c │ │ │ ├── complex-7.c │ │ │ ├── compndlit-1.c │ │ │ ├── const-addr-expr-1.c │ │ │ ├── conversion.c │ │ │ ├── cvt-1.c │ │ │ ├── dbra-1.c │ │ │ ├── divcmp-1.c │ │ │ ├── divcmp-2.c │ │ │ ├── divcmp-3.c │ │ │ ├── divcmp-4.c │ │ │ ├── divcmp-5.c │ │ │ ├── divconst-1.c │ │ │ ├── divconst-2.c │ │ │ ├── divconst-3.c │ │ │ ├── divmod-1.c │ │ │ ├── doloop-1.c │ │ │ ├── doloop-2.c │ │ │ ├── eeprof-1.c │ │ │ ├── enum-1.c │ │ │ ├── enum-2.c │ │ │ ├── enum-3.c │ │ │ ├── execute.exp │ │ │ ├── extzvsi.c │ │ │ ├── ffs-1.c │ │ │ ├── ffs-2.c │ │ │ ├── float-floor.c │ │ │ ├── floatunsisf-1.c │ │ │ ├── fprintf-1.c │ │ │ ├── fprintf-chk-1.c │ │ │ ├── frame-address.c │ │ │ ├── func-ptr-1.c │ │ │ ├── gofast.c │ │ │ ├── ifcvt-onecmpl-abs-1.c │ │ │ ├── index-1.c │ │ │ ├── inst-check.c │ │ │ ├── int-compare.c │ │ │ ├── ipa-sra-1.c │ │ │ ├── ipa-sra-2.c │ │ │ ├── longlong.c │ │ │ ├── loop-1.c │ │ │ ├── loop-10.c │ │ │ ├── loop-11.c │ │ │ ├── loop-12.c │ │ │ ├── loop-13.c │ │ │ ├── loop-14.c │ │ │ ├── loop-15.c │ │ │ ├── loop-2.c │ │ │ ├── loop-2b.c │ │ │ ├── loop-2c.c │ │ │ ├── loop-2d.c │ │ │ ├── loop-2e.c │ │ │ ├── loop-2f.c │ │ │ ├── loop-2g.c │ │ │ ├── loop-3.c │ │ │ ├── loop-3b.c │ │ │ ├── loop-3c.c │ │ │ ├── loop-4.c │ │ │ ├── loop-4b.c │ │ │ ├── loop-5.c │ │ │ ├── loop-6.c │ │ │ ├── loop-7.c │ │ │ ├── loop-8.c │ │ │ ├── loop-9.c │ │ │ ├── loop-ivopts-1.c │ │ │ ├── loop-ivopts-2.c │ │ │ ├── lshrdi-1.c │ │ │ ├── lto-tbaa-1.c │ │ │ ├── mayalias-1.c │ │ │ ├── mayalias-2.c │ │ │ ├── mayalias-3.c │ │ │ ├── medce-1.c │ │ │ ├── memcpy-1.c │ │ │ ├── memcpy-2.c │ │ │ ├── memcpy-bi.c │ │ │ ├── memset-1.c │ │ │ ├── memset-2.c │ │ │ ├── memset-3.c │ │ │ ├── memset-4.c │ │ │ ├── mod-1.c │ │ │ ├── mode-dependent-address.c │ │ │ ├── multdi-1.c │ │ │ ├── multi-ix.c │ │ │ ├── nest-align-1.c │ │ │ ├── nest-stdar-1.c │ │ │ ├── nestfunc-1.c │ │ │ ├── nestfunc-2.c │ │ │ ├── nestfunc-3.c │ │ │ ├── nestfunc-4.c │ │ │ ├── nestfunc-5.c │ │ │ ├── nestfunc-6.c │ │ │ ├── nestfunc-7.c │ │ │ ├── p18298.c │ │ │ ├── packed-1.c │ │ │ ├── packed-2.c │ │ │ ├── pending-4.c │ │ │ ├── postmod-1.c │ │ │ ├── pr15262-1.c │ │ │ ├── pr15262-2.c │ │ │ ├── pr15262.c │ │ │ ├── pr15296.c │ │ │ ├── pr16790-1.c │ │ │ ├── pr17078-1.c │ │ │ ├── pr17133.c │ │ │ ├── pr17252.c │ │ │ ├── pr17377.c │ │ │ ├── pr19005.c │ │ │ ├── pr19449.c │ │ │ ├── pr19515.c │ │ │ ├── pr19606.c │ │ │ ├── pr19687.c │ │ │ ├── pr19689.c │ │ │ ├── pr20100-1.c │ │ │ ├── pr20187-1.c │ │ │ ├── pr20466-1.c │ │ │ ├── pr20527-1.c │ │ │ ├── pr20601-1.c │ │ │ ├── pr20621-1.c │ │ │ ├── pr21173.c │ │ │ ├── pr21331.c │ │ │ ├── pr21964-1.c │ │ │ ├── pr22061-1.c │ │ │ ├── pr22061-2.c │ │ │ ├── pr22061-3.c │ │ │ ├── pr22061-4.c │ │ │ ├── pr22098-1.c │ │ │ ├── pr22098-2.c │ │ │ ├── pr22098-3.c │ │ │ ├── pr22141-1.c │ │ │ ├── pr22141-2.c │ │ │ ├── pr22348.c │ │ │ ├── pr22429.c │ │ │ ├── pr22493-1.c │ │ │ ├── pr22630.c │ │ │ ├── pr23047.c │ │ │ ├── pr23135.c │ │ │ ├── pr23324.c │ │ │ ├── pr23467.c │ │ │ ├── pr23604.c │ │ │ ├── pr23941.c │ │ │ ├── pr24135.c │ │ │ ├── pr24141.c │ │ │ ├── pr24142.c │ │ │ ├── pr24716.c │ │ │ ├── pr24851.c │ │ │ ├── pr25125.c │ │ │ ├── pr25737.c │ │ │ ├── pr27073.c │ │ │ ├── pr27260.c │ │ │ ├── pr27285.c │ │ │ ├── pr27364.c │ │ │ ├── pr27671-1.c │ │ │ ├── pr28289.c │ │ │ ├── pr28403.c │ │ │ ├── pr28651.c │ │ │ ├── pr28778.c │ │ │ ├── pr28865.c │ │ │ ├── pr28982a.c │ │ │ ├── pr28982b.c │ │ │ ├── pr29006.c │ │ │ ├── pr29156.c │ │ │ ├── pr29695-1.c │ │ │ ├── pr29695-2.c │ │ │ ├── pr29797-1.c │ │ │ ├── pr29797-2.c │ │ │ ├── pr29798.c │ │ │ ├── pr30185.c │ │ │ ├── pr30778.c │ │ │ ├── pr31072.c │ │ │ ├── pr31136.c │ │ │ ├── pr31169.c │ │ │ ├── pr31448-2.c │ │ │ ├── pr31448.c │ │ │ ├── pr31605.c │ │ │ ├── pr32244-1.c │ │ │ ├── pr32500.c │ │ │ ├── pr33142.c │ │ │ ├── pr33382.c │ │ │ ├── pr33631.c │ │ │ ├── pr33669.c │ │ │ ├── pr33779-1.c │ │ │ ├── pr33779-2.c │ │ │ ├── pr33870-1.c │ │ │ ├── pr33870.c │ │ │ ├── pr33992.c │ │ │ ├── pr34070-1.c │ │ │ ├── pr34070-2.c │ │ │ ├── pr34099-2.c │ │ │ ├── pr34099.c │ │ │ ├── pr34130.c │ │ │ ├── pr34154.c │ │ │ ├── pr34176.c │ │ │ ├── pr34415.c │ │ │ ├── pr34456.c │ │ │ ├── pr34768-1.c │ │ │ ├── pr34768-2.c │ │ │ ├── pr34971.c │ │ │ ├── pr34982.c │ │ │ ├── pr35163.c │ │ │ ├── pr35231.c │ │ │ ├── pr35390.c │ │ │ ├── pr35456.c │ │ │ ├── pr35472.c │ │ │ ├── pr35800.c │ │ │ ├── pr36034-1.c │ │ │ ├── pr36034-2.c │ │ │ ├── pr36038.c │ │ │ ├── pr36077.c │ │ │ ├── pr36093.c │ │ │ ├── pr36321.c │ │ │ ├── pr36339.c │ │ │ ├── pr36343.c │ │ │ ├── pr36691.c │ │ │ ├── pr36765.c │ │ │ ├── pr37102.c │ │ │ ├── pr37125.c │ │ │ ├── pr37573.c │ │ │ ├── pr37780.c │ │ │ ├── pr37882.c │ │ │ ├── pr37924.c │ │ │ ├── pr37931.c │ │ │ ├── pr38048-1.c │ │ │ ├── pr38048-2.c │ │ │ ├── pr38051.c │ │ │ ├── pr38151.c │ │ │ ├── pr38212.c │ │ │ ├── pr38236.c │ │ │ ├── pr38422.c │ │ │ ├── pr38533.c │ │ │ ├── pr38819.c │ │ │ ├── pr38969.c │ │ │ ├── pr39100.c │ │ │ ├── pr39120.c │ │ │ ├── pr39228.c │ │ │ ├── pr39233.c │ │ │ ├── pr39240.c │ │ │ ├── pr39339.c │ │ │ ├── pr39501.c │ │ │ ├── pr40022.c │ │ │ ├── pr40057.c │ │ │ ├── pr40386.c │ │ │ ├── pr40404.c │ │ │ ├── pr40493.c │ │ │ ├── pr40579.c │ │ │ ├── pr40657.c │ │ │ ├── pr40668.c │ │ │ ├── pr40747.c │ │ │ ├── pr41239.c │ │ │ ├── pr41317.c │ │ │ ├── pr41395-1.c │ │ │ ├── pr41395-2.c │ │ │ ├── pr41463.c │ │ │ ├── pr41750.c │ │ │ ├── pr41917.c │ │ │ ├── pr41919.c │ │ │ ├── pr41935.c │ │ │ ├── pr42006.c │ │ │ ├── pr42142.c │ │ │ ├── pr42154.c │ │ │ ├── pr42231.c │ │ │ ├── pr42248.c │ │ │ ├── pr42269-2.c │ │ │ ├── pr42512.c │ │ │ ├── pr42544.c │ │ │ ├── pr42570.c │ │ │ ├── pr42614.c │ │ │ ├── pr42691.c │ │ │ ├── pr42721.c │ │ │ ├── pr42833.c │ │ │ ├── pr43008.c │ │ │ ├── pr43220.c │ │ │ ├── pr43236.c │ │ │ ├── pr43269.c │ │ │ ├── pr43385.c │ │ │ ├── pr43438.c │ │ │ ├── pr43560.c │ │ │ ├── pr43629.c │ │ │ ├── pr43783.c │ │ │ ├── pr43784.c │ │ │ ├── pr43835.c │ │ │ ├── pr43987.c │ │ │ ├── pr44164.c │ │ │ ├── pr44202-1.c │ │ │ ├── pr44468.c │ │ │ ├── pr44555.c │ │ │ ├── pr44575.c │ │ │ ├── pr44683.c │ │ │ ├── pr44828.c │ │ │ ├── pr44852.c │ │ │ ├── pr44858.c │ │ │ ├── pr44942.c │ │ │ ├── pr45034.c │ │ │ ├── pr45070.c │ │ │ ├── pr45262.c │ │ │ ├── pr45695.c │ │ │ ├── pr46019.c │ │ │ ├── pr46309.c │ │ │ ├── pr46316.c │ │ │ ├── pr46909-1.c │ │ │ ├── pr46909-2.c │ │ │ ├── pr47148.c │ │ │ ├── pr47155.c │ │ │ ├── pr47237.c │ │ │ ├── pr47299.c │ │ │ ├── pr47337.c │ │ │ ├── pr47538.c │ │ │ ├── pr47925.c │ │ │ ├── pr48197.c │ │ │ ├── pr48571-1.c │ │ │ ├── pr48717.c │ │ │ ├── pr48809.c │ │ │ ├── pr48814-1.c │ │ │ ├── pr48814-2.c │ │ │ ├── pr48973-1.c │ │ │ ├── pr48973-2.c │ │ │ ├── pr49039.c │ │ │ ├── pr49073.c │ │ │ ├── pr49123.c │ │ │ ├── pr49161.c │ │ │ ├── pr49186.c │ │ │ ├── pr49218.c │ │ │ ├── pr49279.c │ │ │ ├── pr49281.c │ │ │ ├── pr49390.c │ │ │ ├── pr49419.c │ │ │ ├── pr49644.c │ │ │ ├── pr49712.c │ │ │ ├── pr49768.c │ │ │ ├── pr49886.c │ │ │ ├── pr50865.c │ │ │ ├── pr51023.c │ │ │ ├── pr51323.c │ │ │ ├── pr51447.c │ │ │ ├── pr51466.c │ │ │ ├── pr51581-1.c │ │ │ ├── pr51581-2.c │ │ │ ├── pr51877.c │ │ │ ├── pr51933.c │ │ │ ├── pr52129.c │ │ │ ├── pr52209.c │ │ │ ├── pr52286.c │ │ │ ├── pr52760.c │ │ │ ├── pr52979-1.c │ │ │ ├── pr52979-2.c │ │ │ ├── pr53084.c │ │ │ ├── pr53160.c │ │ │ ├── pr53465.c │ │ │ ├── pr53645-2.c │ │ │ ├── pr53645.c │ │ │ ├── pr53688.c │ │ │ ├── pr54471.c │ │ │ ├── pr54937.c │ │ │ ├── pr54985.c │ │ │ ├── pr55137.c │ │ │ ├── pr55750.c │ │ │ ├── pr55875.c │ │ │ ├── pr56051.c │ │ │ ├── pr56205.c │ │ │ ├── pr56250.c │ │ │ ├── pr56799.c │ │ │ ├── pr56837.c │ │ │ ├── pr56866.c │ │ │ ├── pr56899.c │ │ │ ├── pr56962.c │ │ │ ├── pr56982.c │ │ │ ├── pr57124.c │ │ │ ├── pr57130.c │ │ │ ├── pr57131.c │ │ │ ├── pr57144.c │ │ │ ├── pr57281.c │ │ │ ├── pr57321.c │ │ │ ├── pr57344-1.c │ │ │ ├── pr57344-2.c │ │ │ ├── pr57344-3.c │ │ │ ├── pr57344-4.c │ │ │ ├── pr57568.c │ │ │ ├── pr57829.c │ │ │ ├── pr57860.c │ │ │ ├── pr57861.c │ │ │ ├── pr57875.c │ │ │ ├── pr57876.c │ │ │ ├── pr57877.c │ │ │ ├── pr58209.c │ │ │ ├── pr58277-1.c │ │ │ ├── pr58277-2.c │ │ │ ├── pr58364.c │ │ │ ├── pr58365.c │ │ │ ├── pr58385.c │ │ │ ├── pr58387.c │ │ │ ├── pr58419.c │ │ │ ├── pr58431.c │ │ │ ├── pr58564.c │ │ │ ├── pr58570.c │ │ │ ├── pr58574.c │ │ │ ├── pr58640-2.c │ │ │ ├── pr58640.c │ │ │ ├── pr58662.c │ │ │ ├── pr58726.c │ │ │ ├── pr58831.c │ │ │ ├── pr58943.c │ │ │ ├── pr58984.c │ │ │ ├── pr59014-2.c │ │ │ ├── pr59014.c │ │ │ ├── pr59101.c │ │ │ ├── pr59221.c │ │ │ ├── pr59229.c │ │ │ ├── pr59358.c │ │ │ ├── pr59387.c │ │ │ ├── pr59388.c │ │ │ ├── pr59413.c │ │ │ ├── pr59643.c │ │ │ ├── pr59747.c │ │ │ ├── pr60003.c │ │ │ ├── pr60017.c │ │ │ ├── pr60062.c │ │ │ ├── pr60072.c │ │ │ ├── pr60454.c │ │ │ ├── pr60822.c │ │ │ ├── pr60960.c │ │ │ ├── pr61306-1.c │ │ │ ├── pr61306-2.c │ │ │ ├── pr61306-3.c │ │ │ ├── pr61375.c │ │ │ ├── pr61517.c │ │ │ ├── pr61673.c │ │ │ ├── pr61682.c │ │ │ ├── pr61725.c │ │ │ ├── pr62151.c │ │ │ ├── pr63209.c │ │ │ ├── pr63302.c │ │ │ ├── pr63641.c │ │ │ ├── pr63659.c │ │ │ ├── pr63843.c │ │ │ ├── pr64006.c │ │ │ ├── pr64255.c │ │ │ ├── pr64260.c │ │ │ ├── pr64682.c │ │ │ ├── pr64718.c │ │ │ ├── pr64756.c │ │ │ ├── pr64957.c │ │ │ ├── pr64979.c │ │ │ ├── pr65053-1.c │ │ │ ├── pr65053-2.c │ │ │ ├── pr65170.c │ │ │ ├── pr65215-1.c │ │ │ ├── pr65215-2.c │ │ │ ├── pr65215-3.c │ │ │ ├── pr65215-4.c │ │ │ ├── pr65215-5.c │ │ │ ├── pr65216.c │ │ │ ├── pr65369.c │ │ │ ├── pr65401.c │ │ │ ├── pr65418-1.c │ │ │ ├── pr65418-2.c │ │ │ ├── pr65427.c │ │ │ ├── pr65648.c │ │ │ ├── pr65956.c │ │ │ ├── pr66187.c │ │ │ ├── pr66233.c │ │ │ ├── pr66556.c │ │ │ ├── pr66757.c │ │ │ ├── pr66940.c │ │ │ ├── pr67037.c │ │ │ ├── pr67226.c │ │ │ ├── pr67714.c │ │ │ ├── pr67781.c │ │ │ ├── pr67929_1.c │ │ │ ├── pr68143_1.c │ │ │ ├── pr68185.c │ │ │ ├── pr68249.c │ │ │ ├── pr68250.c │ │ │ ├── pr68321.c │ │ │ ├── pr68328.c │ │ │ ├── pr68376-1.c │ │ │ ├── pr68376-2.c │ │ │ ├── pr68381.c │ │ │ ├── pr68390.c │ │ │ ├── pr68506.c │ │ │ ├── pr68532.c │ │ │ ├── pr68624.c │ │ │ ├── pr68648.c │ │ │ ├── pr68841.c │ │ │ ├── pr68911.c │ │ │ ├── pr69097-1.c │ │ │ ├── pr69097-2.c │ │ │ ├── pr69320-1.c │ │ │ ├── pr69320-2.c │ │ │ ├── pr69320-3.c │ │ │ ├── pr69320-4.c │ │ │ ├── pr69403.c │ │ │ ├── pr69447.c │ │ │ ├── pr69691.c │ │ │ ├── pr70005.c │ │ │ ├── pr70127.c │ │ │ ├── pr70222-1.c │ │ │ ├── pr70222-2.c │ │ │ ├── pr70429.c │ │ │ ├── pr70460.c │ │ │ ├── pr70566.c │ │ │ ├── pr70586.c │ │ │ ├── pr70602.c │ │ │ ├── pr70903.c │ │ │ ├── pr71083.c │ │ │ ├── pr71335.c │ │ │ ├── pr71494.c │ │ │ ├── pr71550.c │ │ │ ├── pr71554.c │ │ │ ├── pr71626-1.c │ │ │ ├── pr71626-2.c │ │ │ ├── pr71631.c │ │ │ ├── pr71700.c │ │ │ ├── pr7284-1.c │ │ │ ├── pr77718.c │ │ │ ├── pr77766.c │ │ │ ├── pr77767.c │ │ │ ├── pr78170.c │ │ │ ├── pr78378.c │ │ │ ├── pr78436.c │ │ │ ├── pr78438.c │ │ │ ├── pr78477.c │ │ │ ├── pr78559.c │ │ │ ├── pr78586.c │ │ │ ├── pr78617.c │ │ │ ├── pr78622.c │ │ │ ├── pr78675.c │ │ │ ├── pr78720.c │ │ │ ├── pr78726.c │ │ │ ├── pr78791.c │ │ │ ├── pr78856.c │ │ │ ├── pr79043.c │ │ │ ├── pr79121.c │ │ │ ├── pr79286.c │ │ │ ├── pr79327.c │ │ │ ├── pr79354.c │ │ │ ├── pr79388.c │ │ │ ├── pr79450.c │ │ │ ├── pr79737-1.c │ │ │ ├── pr79737-2.c │ │ │ ├── pr80153.c │ │ │ ├── pr80501.c │ │ │ ├── pr80692.c │ │ │ ├── pr81555.c │ │ │ ├── pr81556.c │ │ │ ├── pr81588.c │ │ │ ├── printf-1.c │ │ │ ├── printf-chk-1.c │ │ │ ├── pta-field-1.c │ │ │ ├── pta-field-2.c │ │ │ ├── ptr-arith-1.c │ │ │ ├── pure-1.c │ │ │ ├── pushpop_macro.c │ │ │ ├── regstack-1.c │ │ │ ├── restrict-1.c │ │ │ ├── scal-to-vec1.c │ │ │ ├── scal-to-vec2.c │ │ │ ├── scal-to-vec3.c │ │ │ ├── scope-1.c │ │ │ ├── shiftdi.c │ │ │ ├── shiftopt-1.c │ │ │ ├── simd-1.c │ │ │ ├── simd-2.c │ │ │ ├── simd-4.c │ │ │ ├── simd-5.c │ │ │ ├── simd-6.c │ │ │ ├── stdarg-1.c │ │ │ ├── stdarg-2.c │ │ │ ├── stdarg-3.c │ │ │ ├── stdarg-4.c │ │ │ ├── stkalign.c │ │ │ ├── strcmp-1.c │ │ │ ├── strcpy-1.c │ │ │ ├── strcpy-2.c │ │ │ ├── strct-pack-1.c │ │ │ ├── strct-pack-2.c │ │ │ ├── strct-pack-3.c │ │ │ ├── strct-pack-4.c │ │ │ ├── strct-stdarg-1.c │ │ │ ├── strct-varg-1.c │ │ │ ├── string-opt-17.c │ │ │ ├── string-opt-18.c │ │ │ ├── string-opt-5.c │ │ │ ├── strlen-1.c │ │ │ ├── strncmp-1.c │ │ │ ├── struct-aliasing-1.c │ │ │ ├── struct-cpy-1.c │ │ │ ├── struct-ini-1.c │ │ │ ├── struct-ini-2.c │ │ │ ├── struct-ini-3.c │ │ │ ├── struct-ini-4.c │ │ │ ├── struct-ret-1.c │ │ │ ├── struct-ret-2.c │ │ │ ├── switch-1.c │ │ │ ├── tstdi-1.c │ │ │ ├── unroll-1.c │ │ │ ├── usmul.c │ │ │ ├── va-arg-1.c │ │ │ ├── va-arg-10.c │ │ │ ├── va-arg-11.c │ │ │ ├── va-arg-12.c │ │ │ ├── va-arg-13.c │ │ │ ├── va-arg-14.c │ │ │ ├── va-arg-15.c │ │ │ ├── va-arg-16.c │ │ │ ├── va-arg-17.c │ │ │ ├── va-arg-18.c │ │ │ ├── va-arg-19.c │ │ │ ├── va-arg-2.c │ │ │ ├── va-arg-20.c │ │ │ ├── va-arg-21.c │ │ │ ├── va-arg-22.c │ │ │ ├── va-arg-23.c │ │ │ ├── va-arg-24.c │ │ │ ├── va-arg-26.c │ │ │ ├── va-arg-4.c │ │ │ ├── va-arg-5.c │ │ │ ├── va-arg-6.c │ │ │ ├── va-arg-7.c │ │ │ ├── va-arg-8.c │ │ │ ├── va-arg-9.c │ │ │ ├── va-arg-pack-1.c │ │ │ ├── va-arg-trap-1.c │ │ │ ├── vfprintf-1.c │ │ │ ├── vfprintf-chk-1.c │ │ │ ├── vla-dealloc-1.c │ │ │ ├── vprintf-1.c │ │ │ ├── vprintf-chk-1.c │ │ │ ├── vrp-1.c │ │ │ ├── vrp-2.c │ │ │ ├── vrp-3.c │ │ │ ├── vrp-4.c │ │ │ ├── vrp-5.c │ │ │ ├── vrp-6.c │ │ │ ├── vrp-7.c │ │ │ ├── wchar_t-1.c │ │ │ ├── widechar-1.c │ │ │ ├── widechar-2.c │ │ │ ├── zero-struct-1.c │ │ │ ├── zero-struct-2.c │ │ │ ├── zerolen-1.c │ │ │ └── zerolen-2.c │ │ └── tcc-0.9.26/ │ │ ├── COPYING │ │ ├── README │ │ ├── VERSION │ │ └── tests/ │ │ ├── Makefile │ │ ├── asmtest.S │ │ ├── boundtest.c │ │ ├── gcctestsuite.sh │ │ ├── hello │ │ ├── libtcc_test │ │ ├── libtcc_test.c │ │ ├── tcclib.h │ │ ├── tcctest.c │ │ ├── tcctest.gcc │ │ ├── test.out3 │ │ ├── test.ref │ │ └── tests2/ │ │ ├── 00_assignment.c │ │ ├── 00_assignment.expect │ │ ├── 01_comment.c │ │ ├── 01_comment.expect │ │ ├── 02_printf.c │ │ ├── 02_printf.expect │ │ ├── 03_struct.c │ │ ├── 03_struct.expect │ │ ├── 04_for.c │ │ ├── 04_for.expect │ │ ├── 05_array.c │ │ ├── 05_array.expect │ │ ├── 06_case.c │ │ ├── 06_case.expect │ │ ├── 07_function.c │ │ ├── 07_function.expect │ │ ├── 08_while.c │ │ ├── 08_while.expect │ │ ├── 09_do_while.c │ │ ├── 09_do_while.expect │ │ ├── 10_pointer.c │ │ ├── 10_pointer.expect │ │ ├── 11_precedence.c │ │ ├── 11_precedence.expect │ │ ├── 12_hashdefine.c │ │ ├── 12_hashdefine.expect │ │ ├── 13_integer_literals.c │ │ ├── 13_integer_literals.expect │ │ ├── 14_if.c │ │ ├── 14_if.expect │ │ ├── 15_recursion.c │ │ ├── 15_recursion.expect │ │ ├── 16_nesting.c │ │ ├── 16_nesting.expect │ │ ├── 17_enum.c │ │ ├── 17_enum.expect │ │ ├── 18_include.c │ │ ├── 18_include.expect │ │ ├── 18_include.h │ │ ├── 19_pointer_arithmetic.c │ │ ├── 19_pointer_arithmetic.expect │ │ ├── 20_pointer_comparison.c │ │ ├── 20_pointer_comparison.expect │ │ ├── 21_char_array.c │ │ ├── 21_char_array.expect │ │ ├── 22_floating_point.c │ │ ├── 22_floating_point.expect │ │ ├── 23_type_coercion.c │ │ ├── 23_type_coercion.expect │ │ ├── 24_math_library.c │ │ ├── 24_math_library.expect │ │ ├── 25_quicksort.c │ │ ├── 25_quicksort.expect │ │ ├── 26_character_constants.c │ │ ├── 26_character_constants.expect │ │ ├── 27_sizeof.c │ │ ├── 27_sizeof.expect │ │ ├── 28_strings.c │ │ ├── 28_strings.expect │ │ ├── 29_array_address.c │ │ ├── 29_array_address.expect │ │ ├── 30_hanoi.c │ │ ├── 30_hanoi.expect │ │ ├── 31_args.c │ │ ├── 31_args.expect │ │ ├── 32_led.c │ │ ├── 32_led.expect │ │ ├── 33_ternary_op.c │ │ ├── 33_ternary_op.expect │ │ ├── 34_array_assignment.c │ │ ├── 34_array_assignment.expect │ │ ├── 35_sizeof.c │ │ ├── 35_sizeof.expect │ │ ├── 36_array_initialisers.c │ │ ├── 36_array_initialisers.expect │ │ ├── 37_sprintf.c │ │ ├── 37_sprintf.expect │ │ ├── 38_multiple_array_index.c │ │ ├── 38_multiple_array_index.expect │ │ ├── 39_typedef.c │ │ ├── 39_typedef.expect │ │ ├── 40_stdio.c │ │ ├── 40_stdio.expect │ │ ├── 41_hashif.c │ │ ├── 41_hashif.expect │ │ ├── 42_function_pointer.c │ │ ├── 42_function_pointer.expect │ │ ├── 43_void_param.c │ │ ├── 43_void_param.expect │ │ ├── 44_scoped_declarations.c │ │ ├── 44_scoped_declarations.expect │ │ ├── 45_empty_for.c │ │ ├── 45_empty_for.expect │ │ ├── 46_grep.c │ │ ├── 47_switch_return.c │ │ ├── 47_switch_return.expect │ │ ├── 48_nested_break.c │ │ ├── 48_nested_break.expect │ │ ├── 49_bracket_evaluation.c │ │ ├── 49_bracket_evaluation.expect │ │ ├── 50_logical_second_arg.c │ │ ├── 50_logical_second_arg.expect │ │ ├── 51_static.c │ │ ├── 51_static.expect │ │ ├── 52_unnamed_enum.c │ │ ├── 52_unnamed_enum.expect │ │ ├── 54_goto.c │ │ ├── 54_goto.expect │ │ ├── 55_lshift_type.c │ │ ├── 55_lshift_type.expect │ │ ├── LICENSE │ │ ├── Makefile │ │ └── fred.txt │ ├── trigraphs.go │ ├── trigraphs.l │ ├── type.go │ ├── ucn32.go │ └── ucn64.go └── xerrors ================================================ FILE CONTENTS ================================================ ================================================ FILE: AUTHORS ================================================ # This file lists authors for copyright purposes. This file is distinct from # the CONTRIBUTORS files. See the latter for an explanation. # # Names should be added to this file as: # Name or Organization # # The email address is not required for organizations. # # Please keep the list sorted. Dan Kortschak Jan Mercl <0xjnml@gmail.com> Maxim Kupriianov Peter Waller Steffen Butzer Yasuhiro Matsumoto ================================================ FILE: CONTRIBUTORS ================================================ # This file lists people who contributed code to this repository. The AUTHORS # file lists the copyright holders; this file lists people. # # Names should be added to this file like so: # Name # # Please keep the list sorted. Dan Kortschak Jan Mercl <0xjnml@gmail.com> Maxim Kupriianov Peter Waller Steffen Butzer Zvi Effron Yasuhiro Matsumoto ================================================ FILE: LICENSE ================================================ Copyright (c) 2014 The CC Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the names of the authors nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: Makefile ================================================ # Copyright 2016 The CC Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. .PHONY: all clean cover cpu edit editor internalError later mem nuke todo grep=--include=*.go --include=*.l --include=*.y all: editor rm -f log-*.c log-*.h go vet || true golint || true make todo unused . || true maligned unconvert -apply clean: rm -f log-*.c log-*.h *~ cpu.test mem.test /tmp/cc-test-* log*.c go clean cover: t=$(shell tempfile) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t cpu: go test -c -o cpu.test ./cpu.test -noerr -test.cpuprofile cpu.out go tool pprof --lines cpu.test cpu.out edit: gvim -p Makefile trigraphs.l scanner.l parser.yy all_test.go ast2.go cc.go cpp.go encoding.go etc.go lexer.go model.go editor: parser.go scanner.go trigraphs.go rm -f log-*.c log-*.h gofmt -l -s -w *.go rm -f log-*.c log-*.h go test -i go test 2>&1 | tee log go install internalError: egrep -ho '"internal error.*"' *.go | sort | cat -n later: @grep -n $(grep) LATER * || true @grep -n $(grep) MAYBE * || true mem: go test -c -o mem.test ./mem.test -test.bench . -test.memprofile mem.out go tool pprof --lines --web --alloc_space mem.test mem.out nuke: clean go clean -i parser.go scanner.go trigraphs.go: parser.yy trigraphs.l scanner.l rm -f log-*.c log-*.h go test -i go generate todo: @grep -n $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * || true @grep -n $(grep) TODO * || true @grep -n $(grep) BUG * || true @grep -n $(grep) [^[:alpha:]]println * || true ================================================ FILE: README.md ================================================ `github.com/cznic/cc` has moved to [`modernc.org/cc`](https://godoc.org/modernc.org/cc) ([vcs](https://gitlab.com/cznic/cc)). Please update your import paths to `modernc.org/cc`. This repo is now archived. ================================================ FILE: all_test.go ================================================ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "bufio" "bytes" "flag" "fmt" "go/scanner" "go/token" "io" "io/ioutil" "log" "os" "os/exec" "path" "path/filepath" "regexp" "runtime" "runtime/debug" "sort" "strconv" "strings" "testing" "unicode" "github.com/cznic/golex/lex" "github.com/cznic/mathutil" "github.com/cznic/xc" ) func printStack() { debug.PrintStack() } func caller(s string, va ...interface{}) { if s == "" { s = strings.Repeat("%v ", len(va)) } _, fn, fl, _ := runtime.Caller(2) fmt.Fprintf(os.Stderr, "caller: %s:%d: ", path.Base(fn), fl) fmt.Fprintf(os.Stderr, s, va...) fmt.Fprintln(os.Stderr) _, fn, fl, _ = runtime.Caller(1) fmt.Fprintf(os.Stderr, "\tcallee: %s:%d: ", path.Base(fn), fl) fmt.Fprintln(os.Stderr) os.Stderr.Sync() } func dbg(s string, va ...interface{}) { if s == "" { s = strings.Repeat("%v ", len(va)) } _, fn, fl, _ := runtime.Caller(1) fmt.Fprintf(os.Stderr, "dbg %s:%d: ", path.Base(fn), fl) fmt.Fprintf(os.Stderr, s, va...) fmt.Fprintln(os.Stderr) os.Stderr.Sync() } func TODO(...interface{}) string { _, fn, fl, _ := runtime.Caller(1) return fmt.Sprintf("TODO: %s:%d:\n", path.Base(fn), fl) } func use(...interface{}) int { return 42 } var _ = use(printStack, caller, dbg, TODO, (*ctype).str, yyDefault, yyErrCode, yyMaxDepth) // ============================================================================ var ( o1 = flag.String("1", "", "single file argument of TestPPParse1.") oDev = flag.Bool("dev", false, "enable WIP tests") oFailFast = flag.Bool("ff", false, "crash on first reported error (in some tests.)") oRe = flag.String("re", "", "regexp filter.") oTmp = flag.Bool("tmp", false, "keep certain temp files.") oTrace = flag.Bool("trc", false, "print testDev path") includes = []string{} predefinedMacros = ` #define __STDC_HOSTED__ 1 #define __STDC_VERSION__ 199901L #define __STDC__ 1 #define __MODEL64 void __GO__(char *s, ...); ` sysIncludes = []string{} testTweaks = &tweaks{ enableDefineOmitCommaBeforeDDD: true, enableDlrInIdentifiers: true, enableEmptyDefine: true, enableUndefExtraTokens: true, } ) func newTestReport() *xc.Report { r := xc.NewReport() r.ErrLimit = -1 if *oFailFast { r.PanicOnError = true } return r } func init() { isTesting = true log.SetFlags(log.Llongfile) flag.BoolVar(&debugIncludes, "dbgi", false, "debug include searches") flag.BoolVar(&debugMacros, "dbgm", false, "debug macros") flag.BoolVar(&debugTypeStrings, "xtypes", false, "add debug info to type strings") flag.BoolVar(&isGenerating, "generating", false, "go generate is executing (false).") flag.IntVar(&yyDebug, "yydebug", 0, "") } func newTestModel() *Model { return &Model{ // 64 Items: map[Kind]ModelItem{ Ptr: {8, 8, 8, nil}, UintPtr: {8, 8, 8, nil}, Void: {0, 1, 1, nil}, Char: {1, 1, 1, nil}, SChar: {1, 1, 1, nil}, UChar: {1, 1, 1, nil}, Short: {2, 2, 2, nil}, UShort: {2, 2, 2, nil}, Int: {4, 4, 4, nil}, UInt: {4, 4, 4, nil}, Long: {8, 8, 8, nil}, ULong: {8, 8, 8, nil}, LongLong: {8, 8, 8, nil}, ULongLong: {8, 8, 8, nil}, Float: {4, 4, 4, nil}, Double: {8, 8, 8, nil}, LongDouble: {16, 16, 16, nil}, Bool: {1, 1, 1, nil}, FloatComplex: {8, 8, 8, nil}, DoubleComplex: {16, 16, 16, nil}, LongDoubleComplex: {16, 16, 16, nil}, }, } } func printError(w io.Writer, pref string, err error) { switch x := err.(type) { case scanner.ErrorList: for i, v := range x { fmt.Fprintf(w, "%s%v\n", pref, v) if i == 50 { fmt.Fprintln(w, "too many errors") break } } default: fmt.Fprintf(w, "%s%v\n", pref, err) } } func errString(err error) string { var b bytes.Buffer printError(&b, "", err) return b.String() } func testUCNTable(t *testing.T, tab []rune, fOk, fOther func(rune) bool, fcategory func(rune) bool, tag string) { m := map[rune]struct{}{} for i := 0; i < len(tab); i += 2 { l, h := tab[i], tab[i+1] if h == 0 { h = l } for r := rune(l); r <= rune(h); r++ { m[r] = struct{}{} } } for r := rune(0); r < 0xffff; r++ { _, ok := m[r] if g, e := fOk(r), ok; g != e { t.Errorf("%#04x %v %v", r, g, e) } if ok { if g, e := fOther(r), false; g != e { t.Errorf("%#04x %v %v", r, g, e) } } } } func TestUCNDigitsTable(t *testing.T) { tab := []rune{ 0x0660, 0x0669, 0x06F0, 0x06F9, 0x0966, 0x096F, 0x09E6, 0x09EF, 0x0A66, 0x0A6F, 0x0AE6, 0x0AEF, 0x0B66, 0x0B6F, 0x0BE7, 0x0BEF, 0x0C66, 0x0C6F, 0x0CE6, 0x0CEF, 0x0D66, 0x0D6F, 0x0E50, 0x0E59, 0x0ED0, 0x0ED9, 0x0F20, 0x0F33, } testUCNTable(t, tab, isUCNDigit, isUCNNonDigit, unicode.IsDigit, "unicode.IsDigit") } func TestUCNNonDigitsTable(t *testing.T) { tab := []rune{ 0x00AA, 0x0000, 0x00B5, 0x0000, 0x00B7, 0x0000, 0x00BA, 0x0000, 0x00C0, 0x00D6, 0x00D8, 0x00F6, 0x00F8, 0x01F5, 0x01FA, 0x0217, 0x0250, 0x02A8, 0x02B0, 0x02B8, 0x02BB, 0x0000, 0x02BD, 0x02C1, 0x02D0, 0x02D1, 0x02E0, 0x02E4, 0x037A, 0x0000, 0x0386, 0x0000, 0x0388, 0x038A, 0x038C, 0x0000, 0x038E, 0x03A1, 0x03A3, 0x03CE, 0x03D0, 0x03D6, 0x03DA, 0x0000, 0x03DC, 0x0000, 0x03DE, 0x0000, 0x03E0, 0x0000, 0x03E2, 0x03F3, 0x0401, 0x040C, 0x040E, 0x044F, 0x0451, 0x045C, 0x045E, 0x0481, 0x0490, 0x04C4, 0x04C7, 0x04C8, 0x04CB, 0x04CC, 0x04D0, 0x04EB, 0x04EE, 0x04F5, 0x04F8, 0x04F9, 0x0531, 0x0556, 0x0559, 0x0000, 0x0561, 0x0587, 0x05B0, 0x05B9, 0x05F0, 0x05F2, 0x0621, 0x063A, 0x0640, 0x0652, 0x0670, 0x06B7, 0x06BA, 0x06BE, 0x06C0, 0x06CE, 0x06D0, 0x06DC, 0x06E5, 0x06E8, 0x06EA, 0x06ED, 0x0901, 0x0903, 0x0905, 0x0939, 0x093D, 0x0000, 0x093E, 0x094D, 0x0950, 0x0952, 0x0958, 0x0963, 0x0981, 0x0983, 0x0985, 0x098C, 0x098F, 0x0990, 0x0993, 0x09A8, 0x09AA, 0x09B0, 0x09B2, 0x0000, 0x09B6, 0x09B9, 0x09BE, 0x09C4, 0x09C7, 0x09C8, 0x09CB, 0x09CD, 0x09DC, 0x09DD, 0x09DF, 0x09E3, 0x09F0, 0x09F1, 0x0A02, 0x0000, 0x0A05, 0x0A0A, 0x0A0F, 0x0A10, 0x0A13, 0x0A28, 0x0A2A, 0x0A30, 0x0A32, 0x0A33, 0x0A35, 0x0A36, 0x0A38, 0x0A39, 0x0A3E, 0x0A42, 0x0A47, 0x0A48, 0x0A4B, 0x0A4D, 0x0A59, 0x0A5C, 0x0A5E, 0x0000, 0x0A74, 0x0000, 0x0A81, 0x0A83, 0x0A85, 0x0A8B, 0x0A8D, 0x0000, 0x0A8F, 0x0A91, 0x0A93, 0x0AA8, 0x0AAA, 0x0AB0, 0x0AB2, 0x0AB3, 0x0AB5, 0x0AB9, 0x0ABD, 0x0AC5, 0x0AC7, 0x0AC9, 0x0ACB, 0x0ACD, 0x0AD0, 0x0000, 0x0AE0, 0x0000, 0x0B01, 0x0B03, 0x0B05, 0x0B0C, 0x0B0F, 0x0B10, 0x0B13, 0x0B28, 0x0B2A, 0x0B30, 0x0B32, 0x0B33, 0x0B36, 0x0B39, 0x0B3D, 0x0000, 0x0B3E, 0x0B43, 0x0B47, 0x0B48, 0x0B4B, 0x0B4D, 0x0B5C, 0x0B5D, 0x0B5F, 0x0B61, 0x0B82, 0x0B83, 0x0B85, 0x0B8A, 0x0B8E, 0x0B90, 0x0B92, 0x0B95, 0x0B99, 0x0B9A, 0x0B9C, 0x0000, 0x0B9E, 0x0B9F, 0x0BA3, 0x0BA4, 0x0BA8, 0x0BAA, 0x0BAE, 0x0BB5, 0x0BB7, 0x0BB9, 0x0BBE, 0x0BC2, 0x0BC6, 0x0BC8, 0x0BCA, 0x0BCD, 0x0C01, 0x0C03, 0x0C05, 0x0C0C, 0x0C0E, 0x0C10, 0x0C12, 0x0C28, 0x0C2A, 0x0C33, 0x0C35, 0x0C39, 0x0C3E, 0x0C44, 0x0C46, 0x0C48, 0x0C4A, 0x0C4D, 0x0C60, 0x0C61, 0x0C82, 0x0C83, 0x0C85, 0x0C8C, 0x0C8E, 0x0C90, 0x0C92, 0x0CA8, 0x0CAA, 0x0CB3, 0x0CB5, 0x0CB9, 0x0CBE, 0x0CC4, 0x0CC6, 0x0CC8, 0x0CCA, 0x0CCD, 0x0CDE, 0x0000, 0x0CE0, 0x0CE1, 0x0D02, 0x0D03, 0x0D05, 0x0D0C, 0x0D0E, 0x0D10, 0x0D12, 0x0D28, 0x0D2A, 0x0D39, 0x0D3E, 0x0D43, 0x0D46, 0x0D48, 0x0D4A, 0x0D4D, 0x0D60, 0x0D61, 0x0E01, 0x0E3A, // In [0], Annex D, Thai [0x0E40, 0x0E5B] overlaps with digits // [0x0E50, 0x0E59]. Exclude them. 0x0E40, 0x0E4F, 0x0E5A, 0x0E5B, 0x0E81, 0x0E82, 0x0E84, 0x0000, 0x0E87, 0x0E88, 0x0E8A, 0x0000, 0x0E8D, 0x0000, 0x0E94, 0x0E97, 0x0E99, 0x0E9F, 0x0EA1, 0x0EA3, 0x0EA5, 0x0000, 0x0EA7, 0x0000, 0x0EAA, 0x0EAB, 0x0EAD, 0x0EAE, 0x0EB0, 0x0EB9, 0x0EBB, 0x0EBD, 0x0EC0, 0x0EC4, 0x0EC6, 0x0000, 0x0EC8, 0x0ECD, 0x0EDC, 0x0EDD, 0x0F00, 0x0000, 0x0F18, 0x0F19, 0x0F35, 0x0000, 0x0F37, 0x0000, 0x0F39, 0x0000, 0x0F3E, 0x0F47, 0x0F49, 0x0F69, 0x0F71, 0x0F84, 0x0F86, 0x0F8B, 0x0F90, 0x0F95, 0x0F97, 0x0000, 0x0F99, 0x0FAD, 0x0FB1, 0x0FB7, 0x0FB9, 0x0000, 0x10A0, 0x10C5, 0x10D0, 0x10F6, 0x1E00, 0x1E9B, 0x1EA0, 0x1EF9, 0x1F00, 0x1F15, 0x1F18, 0x1F1D, 0x1F20, 0x1F45, 0x1F48, 0x1F4D, 0x1F50, 0x1F57, 0x1F59, 0x0000, 0x1F5B, 0x0000, 0x1F5D, 0x0000, 0x1F5F, 0x1F7D, 0x1F80, 0x1FB4, 0x1FB6, 0x1FBC, 0x1FBE, 0x0000, 0x1FC2, 0x1FC4, 0x1FC6, 0x1FCC, 0x1FD0, 0x1FD3, 0x1FD6, 0x1FDB, 0x1FE0, 0x1FEC, 0x1FF2, 0x1FF4, 0x1FF6, 0x1FFC, 0x203F, 0x2040, 0x207F, 0x0000, 0x2102, 0x0000, 0x2107, 0x0000, 0x210A, 0x2113, 0x2115, 0x0000, 0x2118, 0x211D, 0x2124, 0x0000, 0x2126, 0x0000, 0x2128, 0x0000, 0x212A, 0x2131, 0x2133, 0x2138, 0x2160, 0x2182, 0x3005, 0x3007, 0x3021, 0x3029, 0x3041, 0x3093, 0x309B, 0x309C, 0x30A1, 0x30F6, 0x30FB, 0x30FC, 0x3105, 0x312C, 0x4E00, 0x9FA5, 0xAC00, 0xD7A3, } testUCNTable(t, tab, isUCNNonDigit, isUCNDigit, unicode.IsLetter, "unicode.IsLetter") } func charStr(c rune) string { return yySymName(int(c)) } func charsStr(chars []lex.Char, delta token.Pos) (a []string) { for _, v := range chars { a = append(a, fmt.Sprintf("{%s %d}", charStr(v.Rune), v.Pos()-delta)) } return a } type x []struct { c rune pos token.Pos } type lexerTests []struct { src string chars x } func testLexer(t *testing.T, newLexer func(i int, src string, report *xc.Report) (*lexer, error), tab lexerTests) { nextTest: for ti, test := range tab { //dbg("==== %v", ti) report := xc.NewReport() lx, err := newLexer(ti, test.src, report) if err != nil { t.Fatal(err) } delta := token.Pos(lx.file.Base() - 1) var chars []lex.Char var c lex.Char for i := 0; c.Rune != ccEOF && i < len(test.src)+2; i++ { c = lx.scanChar() chars = append(chars, c) } if c.Rune != ccEOF { t.Errorf("%d: scanner stall %v", ti, charsStr(chars, delta)) continue } if g, e := report.Errors(true), error(nil); g != e { t.Errorf("%d: lx.err %v %v %v", ti, g, e, charsStr(chars, delta)) continue } if g, e := len(chars), len(test.chars); g != e { t.Errorf("%d: len(chars) %v %v %v", ti, g, e, charsStr(chars, delta)) continue } for i, c := range chars { c = chars[i] e := test.chars[i] g := c.Rune if c.Rune == ccEOF { g = -1 } if e := e.c; g != e { t.Errorf("%d: c[%d] %v %v %v", ti, i, charStr(g), charStr(e), charsStr(chars, delta)) continue nextTest } if g, e := c.Pos()-delta, e.pos; g != e { t.Errorf("%d: pos[%d] %v %v %v", ti, i, g, e, charsStr(chars, delta)) continue nextTest } } } } func TestLexer(t *testing.T) { testLexer( t, func(i int, src string, report *xc.Report) (*lexer, error) { return newLexer(fmt.Sprintf("TestLexer.%d", i), len(src), strings.NewReader(src), report, testTweaks) }, lexerTests{ {"", x{{-1, 1}}}, {"%0", x{{'%', 1}, {INTCONST, 2}, {-1, 3}}}, {"%:%:", x{{PPPASTE, 1}, {-1, 5}}}, {"%>", x{{'}', 1}, {-1, 3}}}, {"0", x{{INTCONST, 1}, {-1, 2}}}, {"01", x{{INTCONST, 1}, {-1, 3}}}, {"0??/1\n", x{{INTCONST, 1}, {'?', 2}, {'?', 3}, {'/', 4}, {INTCONST, 5}, {'\n', 6}, {-1, 7}}}, {"0??/1\n2", x{{INTCONST, 1}, {'?', 2}, {'?', 3}, {'/', 4}, {INTCONST, 5}, {'\n', 6}, {INTCONST, 7}, {-1, 8}}}, {"0??/\n", x{{INTCONST, 1}, {'?', 2}, {'?', 3}, {'/', 4}, {'\n', 5}, {-1, 6}}}, {"0??/\n2", x{{INTCONST, 1}, {'?', 2}, {'?', 3}, {'/', 4}, {'\n', 5}, {INTCONST, 6}, {-1, 7}}}, {"0\\1\n", x{{INTCONST, 1}, {'\\', 2}, {INTCONST, 3}, {'\n', 4}, {-1, 5}}}, {"0\\1\n2", x{{INTCONST, 1}, {'\\', 2}, {INTCONST, 3}, {'\n', 4}, {INTCONST, 5}, {-1, 6}}}, {"0\\\n", x{{INTCONST, 1}, {-1, 4}}}, {"0\\\n2", x{{INTCONST, 1}, {-1, 5}}}, {"0\x00", x{{INTCONST, 1}, {0, 2}, {-1, 3}}}, {"0\x001", x{{INTCONST, 1}, {0, 2}, {INTCONST, 3}, {-1, 4}}}, {":>", x{{']', 1}, {-1, 3}}}, {"<%", x{{'{', 1}, {-1, 3}}}, {"<:", x{{'[', 1}, {-1, 3}}}, {"??!", x{{'?', 1}, {'?', 2}, {'!', 3}, {-1, 4}}}, {"??!0", x{{'?', 1}, {'?', 2}, {'!', 3}, {INTCONST, 4}, {-1, 5}}}, {"??!01", x{{'?', 1}, {'?', 2}, {'!', 3}, {INTCONST, 4}, {-1, 6}}}, {"??!=", x{{'?', 1}, {'?', 2}, {NEQ, 3}, {-1, 5}}}, {"??'", x{{'?', 1}, {'?', 2}, {'\'', 3}, {-1, 4}}}, {"??(", x{{'?', 1}, {'?', 2}, {'(', 3}, {-1, 4}}}, {"??)", x{{'?', 1}, {'?', 2}, {')', 3}, {-1, 4}}}, {"??-", x{{'?', 1}, {'?', 2}, {'-', 3}, {-1, 4}}}, {"??/", x{{'?', 1}, {'?', 2}, {'/', 3}, {-1, 4}}}, {"??/1\n", x{{'?', 1}, {'?', 2}, {'/', 3}, {INTCONST, 4}, {'\n', 5}, {-1, 6}}}, {"??/1\n2", x{{'?', 1}, {'?', 2}, {'/', 3}, {INTCONST, 4}, {'\n', 5}, {INTCONST, 6}, {-1, 7}}}, {"??/\n", x{{'?', 1}, {'?', 2}, {'/', 3}, {'\n', 4}, {-1, 5}}}, {"??/\n2", x{{'?', 1}, {'?', 2}, {'/', 3}, {'\n', 4}, {INTCONST, 5}, {-1, 6}}}, {"??<", x{{'?', 1}, {'?', 2}, {'<', 3}, {-1, 4}}}, {"??=??=", x{{'?', 1}, {'?', 2}, {'=', 3}, {'?', 4}, {'?', 5}, {'=', 6}, {-1, 7}}}, {"??>", x{{'?', 1}, {'?', 2}, {'>', 3}, {-1, 4}}}, {"???!", x{{'?', 1}, {'?', 2}, {'?', 3}, {'!', 4}, {-1, 5}}}, {"???!0", x{{'?', 1}, {'?', 2}, {'?', 3}, {'!', 4}, {INTCONST, 5}, {-1, 6}}}, {"???/\n2", x{{'?', 1}, {'?', 2}, {'?', 3}, {'/', 4}, {'\n', 5}, {INTCONST, 6}, {-1, 7}}}, {"????!0", x{{'?', 1}, {'?', 2}, {'?', 3}, {'?', 4}, {'!', 5}, {INTCONST, 6}, {-1, 7}}}, {"???x0", x{{'?', 1}, {'?', 2}, {'?', 3}, {IDENTIFIER, 4}, {-1, 6}}}, {"???x??!0", x{{'?', 1}, {'?', 2}, {'?', 3}, {IDENTIFIER, 4}, {'?', 5}, {'?', 6}, {'!', 7}, {INTCONST, 8}, {-1, 9}}}, {"??x0", x{{'?', 1}, {'?', 2}, {IDENTIFIER, 3}, {-1, 5}}}, {"??x??!0", x{{'?', 1}, {'?', 2}, {IDENTIFIER, 3}, {'?', 4}, {'?', 5}, {'!', 6}, {INTCONST, 7}, {-1, 8}}}, {"?x0", x{{'?', 1}, {IDENTIFIER, 2}, {-1, 4}}}, {"?x??!0", x{{'?', 1}, {IDENTIFIER, 2}, {'?', 3}, {'?', 4}, {'!', 5}, {INTCONST, 6}, {-1, 7}}}, {"@", x{{'@', 1}, {-1, 2}}}, {"@%", x{{'@', 1}, {'%', 2}, {-1, 3}}}, {"@%0", x{{'@', 1}, {'%', 2}, {INTCONST, 3}, {-1, 4}}}, {"@%:", x{{'@', 1}, {'#', 2}, {-1, 4}}}, {"@%:0", x{{'@', 1}, {'#', 2}, {INTCONST, 4}, {-1, 5}}}, {"@%:01", x{{'@', 1}, {'#', 2}, {INTCONST, 4}, {-1, 6}}}, {"@??=", x{{'@', 1}, {'?', 2}, {'?', 3}, {'=', 4}, {-1, 5}}}, {"\"(a\\\nz", x{{'"', 1}, {'(', 2}, {IDENTIFIER, 3}, {-1, 7}}}, {"\\1\n", x{{'\\', 1}, {INTCONST, 2}, {'\n', 3}, {-1, 4}}}, {"\\1\n2", x{{'\\', 1}, {INTCONST, 2}, {'\n', 3}, {INTCONST, 4}, {-1, 5}}}, {"\\\n", x{{-1, 3}}}, {"\\\n2", x{{INTCONST, 3}, {-1, 4}}}, {"\\\r\n", x{{-1, 4}}}, {"\\\r\n2", x{{INTCONST, 4}, {-1, 5}}}, {"\r", x{{-1, 2}}}, {"\r0", x{{INTCONST, 2}, {-1, 3}}}, {"\r01", x{{INTCONST, 2}, {-1, 4}}}, {"\x00", x{{0, 1}, {-1, 2}}}, {"\x000", x{{0, 1}, {INTCONST, 2}, {-1, 3}}}, }, ) } func TestLexer2(t *testing.T) { testLexer( t, func(i int, src string, report *xc.Report) (*lexer, error) { tweaks := *testTweaks tweaks.enableTrigraphs = true return newLexer(fmt.Sprintf("TestLexer.%d", i), len(src), strings.NewReader(src), report, &tweaks) }, lexerTests{ {"", x{{-1, 1}}}, {"%0", x{{'%', 1}, {INTCONST, 2}, {-1, 3}}}, {"%:%:", x{{PPPASTE, 1}, {-1, 5}}}, {"%>", x{{'}', 1}, {-1, 3}}}, {"0", x{{INTCONST, 1}, {-1, 2}}}, {"01", x{{INTCONST, 1}, {-1, 3}}}, {"0??/1\n", x{{INTCONST, 1}, {'\\', 2}, {INTCONST, 5}, {'\n', 6}, {-1, 7}}}, {"0??/1\n2", x{{INTCONST, 1}, {'\\', 2}, {INTCONST, 5}, {'\n', 6}, {INTCONST, 7}, {-1, 8}}}, {"0??/\n", x{{INTCONST, 1}, {-1, 6}}}, {"0??/\n2", x{{INTCONST, 1}, {-1, 7}}}, {"0\\1\n", x{{INTCONST, 1}, {'\\', 2}, {INTCONST, 3}, {'\n', 4}, {-1, 5}}}, {"0\\1\n2", x{{INTCONST, 1}, {'\\', 2}, {INTCONST, 3}, {'\n', 4}, {INTCONST, 5}, {-1, 6}}}, {"0\\\n", x{{INTCONST, 1}, {-1, 4}}}, {"0\\\n2", x{{INTCONST, 1}, {-1, 5}}}, {"0\x00", x{{INTCONST, 1}, {0, 2}, {-1, 3}}}, {"0\x001", x{{INTCONST, 1}, {0, 2}, {INTCONST, 3}, {-1, 4}}}, {":>", x{{']', 1}, {-1, 3}}}, {"<%", x{{'{', 1}, {-1, 3}}}, {"<:", x{{'[', 1}, {-1, 3}}}, {"??!", x{{'|', 1}, {-1, 4}}}, {"??!0", x{{'|', 1}, {INTCONST, 4}, {-1, 5}}}, {"??!01", x{{'|', 1}, {INTCONST, 4}, {-1, 6}}}, {"??!=", x{{ORASSIGN, 1}, {-1, 5}}}, {"??'", x{{'^', 1}, {-1, 4}}}, {"??(", x{{'[', 1}, {-1, 4}}}, {"??)", x{{']', 1}, {-1, 4}}}, {"??-", x{{'~', 1}, {-1, 4}}}, {"??/", x{{'\\', 1}, {-1, 4}}}, {"??/1\n", x{{'\\', 1}, {INTCONST, 4}, {'\n', 5}, {-1, 6}}}, {"??/1\n2", x{{'\\', 1}, {INTCONST, 4}, {'\n', 5}, {INTCONST, 6}, {-1, 7}}}, {"??/\n", x{{-1, 5}}}, {"??/\n2", x{{INTCONST, 5}, {-1, 6}}}, {"??<", x{{'{', 1}, {-1, 4}}}, {"??=??=", x{{PPPASTE, 1}, {-1, 7}}}, {"??>", x{{'}', 1}, {-1, 4}}}, {"???!", x{{'?', 1}, {'|', 2}, {-1, 5}}}, {"???!0", x{{'?', 1}, {'|', 2}, {INTCONST, 5}, {-1, 6}}}, {"???/\n2", x{{'?', 1}, {INTCONST, 6}, {-1, 7}}}, {"????!0", x{{'?', 1}, {'?', 2}, {'|', 3}, {INTCONST, 6}, {-1, 7}}}, {"???x0", x{{'?', 1}, {'?', 2}, {'?', 3}, {IDENTIFIER, 4}, {-1, 6}}}, {"???x??!0", x{{'?', 1}, {'?', 2}, {'?', 3}, {IDENTIFIER, 4}, {'|', 5}, {INTCONST, 8}, {-1, 9}}}, {"??x0", x{{'?', 1}, {'?', 2}, {IDENTIFIER, 3}, {-1, 5}}}, {"??x??!0", x{{'?', 1}, {'?', 2}, {IDENTIFIER, 3}, {'|', 4}, {INTCONST, 7}, {-1, 8}}}, {"?x0", x{{'?', 1}, {IDENTIFIER, 2}, {-1, 4}}}, {"?x??!0", x{{'?', 1}, {IDENTIFIER, 2}, {'|', 3}, {INTCONST, 6}, {-1, 7}}}, {"@", x{{'@', 1}, {-1, 2}}}, {"@%", x{{'@', 1}, {'%', 2}, {-1, 3}}}, {"@%0", x{{'@', 1}, {'%', 2}, {INTCONST, 3}, {-1, 4}}}, {"@%:", x{{'@', 1}, {'#', 2}, {-1, 4}}}, {"@%:0", x{{'@', 1}, {'#', 2}, {INTCONST, 4}, {-1, 5}}}, {"@%:01", x{{'@', 1}, {'#', 2}, {INTCONST, 4}, {-1, 6}}}, {"@??=", x{{'@', 1}, {'#', 2}, {-1, 5}}}, {"\"(a\\\nz", x{{'"', 1}, {'(', 2}, {IDENTIFIER, 3}, {-1, 7}}}, {"\\1\n", x{{'\\', 1}, {INTCONST, 2}, {'\n', 3}, {-1, 4}}}, {"\\1\n2", x{{'\\', 1}, {INTCONST, 2}, {'\n', 3}, {INTCONST, 4}, {-1, 5}}}, {"\\\n", x{{-1, 3}}}, {"\\\n2", x{{INTCONST, 3}, {-1, 4}}}, {"\\\r\n", x{{-1, 4}}}, {"\\\r\n2", x{{INTCONST, 4}, {-1, 5}}}, {"\r", x{{-1, 2}}}, {"\r0", x{{INTCONST, 2}, {-1, 3}}}, {"\r01", x{{INTCONST, 2}, {-1, 4}}}, {"\x00", x{{0, 1}, {-1, 2}}}, {"\x000", x{{0, 1}, {INTCONST, 2}, {-1, 3}}}, }, ) } func testPreprocessor(t *testing.T, fname string) string { var buf bytes.Buffer _, err := Parse( "", []string{fname}, newTestModel(), preprocessOnly(), Cpp(func(toks []xc.Token) { //dbg("____ cpp toks\n%s", PrettyString(toks)) for _, v := range toks { buf.WriteString(TokSrc(v)) } buf.WriteByte('\n') }), EnableDefineOmitCommaBeforeDDD(), ) if err != nil { t.Fatal(errString(err)) } return strings.TrimSpace(buf.String()) } func TestStdExample6_10_3_3_4(t *testing.T) { if g, e := testPreprocessor(t, "testdata/example-6.10.3.3-4.h"), `char p[] = "x ## y";`; g != e { t.Fatalf("\ngot\n%s\nexp\n%s", g, e) } } func TestStdExample6_10_3_5_3(t *testing.T) { if g, e := testPreprocessor(t, "testdata/example-6.10.3.5-3.h"), `f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1); f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1); int i[] = { 1, 23, 4, 5, }; char c[2][6] = { "hello", "" };`; g != e { t.Fatalf("\ngot\n%s\nexp\n%s", g, e) } } func TestStdExample6_10_3_5_4(t *testing.T) { if g, e := testPreprocessor(t, "testdata/example-6.10.3.5-4.h"), `printf("x1= %d, x2= %s", x1, x2); fputs( "strncmp(\"abc\\0d\", \"abc\", '\\4') == 0: @\n", s); vers2.h included from testdata/example-6.10.3.5-4.h "hello"; "hello, world"`; g != e { t.Fatalf("\ngot\n%s\nexp\n%s", g, e) } } func TestStdExample6_10_3_5_5(t *testing.T) { if g, e := testPreprocessor(t, "testdata/example-6.10.3.5-5.h"), `int j[] = { 123, 45, 67, 89, 10, 11, 12, };`; g != e { t.Fatalf("\ngot\n%s\nexp\n%s", g, e) } } func TestStdExample6_10_3_5_6(t *testing.T) { if g, e := testPreprocessor(t, "testdata/example-6.10.3.5-6.h"), `ok`; g != e { t.Fatalf("\ngot\n%s\nexp\n%s", g, e) } } func TestStdExample6_10_3_5_7(t *testing.T) { if g, e := testPreprocessor(t, "testdata/example-6.10.3.5-7.h"), `fprintf(stderr, "Flag"); fprintf(stderr, "X = %d\n", x); puts("The first, second, and third items."); ((x>y)?puts("x>y"): printf("x is %d but y is %d", x, y));`; g != e { t.Fatalf("\ngot\n%s\nexp\n%s", g, e) } } type cppCmpError struct { error } func testDev1(ppPredefine, cppPredefine, parsePredefine string, cppOpts []string, wd, src string, ppOpts, parseOpts []Opt) error { fp := filepath.Join(wd, src) if re := *oRe; re != "" { ok, err := regexp.MatchString(re, fp) if err != nil { return err } if !ok { return nil } } logf, err := os.Create("log-" + filepath.Base(src)) if err != nil { return err } defer logf.Close() logw := bufio.NewWriter(logf) defer logw.Flush() if *oTrace { fmt.Println(fp) fmt.Println(logf.Name()) } var got, exp []xc.Token var lpos token.Position var tw tweaks _, err = Parse( ppPredefine, []string{src}, newTestModel(), append( ppOpts, getTweaks(&tw), preprocessOnly(), Cpp(func(toks []xc.Token) { if len(toks) != 0 { p := toks[0].Position() if p.Filename != lpos.Filename { fmt.Fprintf(logw, "# %d %q\n", p.Line, p.Filename) } lpos = p } for _, v := range toks { logw.WriteString(TokSrc(toC(v, &tw))) if v.Rune != ' ' { got = append(got, v) } } logw.WriteByte('\n') }), disableWarnings(), disablePredefinedLineMacro(), )..., ) if err != nil { return err } out, err := exec.Command("cpp", append(cppOpts, src)...).CombinedOutput() if err != nil { return fmt.Errorf("%v: %v", src, err) } f, err := ioutil.TempFile("", "cc-test-") if err != nil { return err } if *oTrace { fmt.Println(f.Name()) } defer func() { if !*oTmp { os.Remove(f.Name()) } f.Close() }() if _, err := f.Write(out); err != nil { return err } if _, err := Parse( cppPredefine, []string{f.Name()}, newTestModel(), preprocessOnly(), Cpp(func(toks []xc.Token) { for _, tok := range toks { if tok.Rune != ' ' { exp = append(exp, tok) } } }), disableWarnings(), ); err != nil { return err } for i, g := range got { if i >= len(exp) { break } g = toC(g, &tw) e := toC(exp[i], &tw) if g.Rune != e.Rune || g.Val != e.Val { if g.Rune == STRINGLITERAL && e.Rune == STRINGLITERAL && bytes.Contains(g.S(), []byte(fakeTime)) { continue } if g.Rune == IDENTIFIER && e.Rune == INTCONST && g.Val == idLine { n, err := strconv.ParseUint(string(e.S()), 10, mathutil.IntBits-1) if err != nil { return err } d := g.Position().Line - int(n) if d < 0 { d = -d } if d <= 3 { continue } } return cppCmpError{fmt.Errorf("%d\ngot %s\nexp %s", i, PrettyString(g), PrettyString(e))} } } if g, e := len(got), len(exp); g != e { return cppCmpError{fmt.Errorf("%v: got %d tokens, expected %d tokens (∆ %d)", src, g, e, g-e)} } logf2, err := os.Create("log2-" + filepath.Base(src)) if err != nil { return err } defer logf2.Close() logw2 := bufio.NewWriter(logf2) defer logw2.Flush() if *oTrace { fmt.Println(logf2.Name()) } _, err = Parse( parsePredefine, []string{src}, newTestModel(), append( parseOpts, disableWarnings(), Cpp(func(toks []xc.Token) { if len(toks) != 0 { p := toks[0].Position() if p.Filename != lpos.Filename { fmt.Fprintf(logw2, "# %d %q\n", p.Line, p.Filename) } lpos = p } for _, v := range toks { logw2.WriteString(TokSrc(toC(v, &tw))) } logw2.WriteByte('\n') }), )..., ) return err } func testDev(t *testing.T, ppPredefine, cppPredefine, parsePredefine string, cppOpts, src []string, wd string, ppOpts, parseOpts []Opt) { if !dirExists(t, wd) { t.Logf("skipping: %v", wd) return } cwd, err := os.Getwd() if err != nil { t.Fatal(err) } if err := os.Chdir(wd); err != nil { t.Fatal(err) } defer os.Chdir(cwd) for _, src := range src { fi, err := os.Stat(src) if err != nil { t.Error(err) continue } if !fi.Mode().IsRegular() { t.Errorf("not a regular file: %s", filepath.Join(wd, src)) continue } if err := testDev1(ppPredefine, cppPredefine, parsePredefine, cppOpts, wd, src, ppOpts, parseOpts); err != nil { t.Error(errString(err)) } } } func dirExists(t *testing.T, dir string) bool { dir = filepath.FromSlash(dir) fi, err := os.Stat(dir) if err != nil { if os.IsNotExist(err) { return false } t.Fatal(err) } if !fi.IsDir() { t.Fatal(dir, "is not a directory") } return true } func TestPreprocessor(t *testing.T) { if err := testDev1("", "", "", nil, "", "testdata/arith-1.h", nil, nil); err != nil { t.Fatal(err) } } func TestDevSDL(t *testing.T) { predefined, includePaths, sysIncludePaths, err := HostConfig() if err != nil { t.Logf("skipping: %v", err) return } ppOpts := []Opt{ IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), EnableIncludeNext(), } if *oFailFast { ppOpts = append(ppOpts, CrashOnError()) } parseOpts := []Opt{ IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), gccEmu(), } if *oFailFast { parseOpts = append(parseOpts, CrashOnError()) } testDev( t, predefined, predefined, predefined+` #define __inline inline `, nil, []string{ "SDL.h", }, "testdata/dev/SDL-1.2.15/include/", ppOpts, parseOpts, ) } func TestDevSqlite(t *testing.T) { predefined, includePaths, sysIncludePaths, err := HostConfig() if err != nil { t.Logf("skipping: %v", err) return } ppOpts := []Opt{ IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), EnableIncludeNext(), } if *oFailFast { ppOpts = append(ppOpts, CrashOnError()) } parseOpts := []Opt{ IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), gccEmu(), } if *oFailFast { parseOpts = append(parseOpts, CrashOnError()) } testDev( t, predefined, predefined, predefined+` #define __const const #define __inline inline #define __restrict restrict `, nil, []string{ "shell.c", "sqlite3.c", "sqlite3.h", "sqlite3ext.h", }, "testdata/dev/sqlite3", ppOpts, parseOpts, ) } func TestDevVim(t *testing.T) { predefined, includePaths, sysIncludePaths, err := HostConfig() if err != nil { t.Logf("skipping: %v", err) return } ppOpts := []Opt{ IncludePaths([]string{ ".", "proto", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), EnableIncludeNext(), EnableDefineOmitCommaBeforeDDD(), devTest(), } if *oFailFast { ppOpts = append(ppOpts, CrashOnError()) } parseOpts := []Opt{ IncludePaths([]string{ ".", "proto", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), gccEmu(), } if *oFailFast { parseOpts = append(parseOpts, CrashOnError()) } p := predefined + ` #define _FORTIFY_SOURCE 1 #define HAVE_CONFIG_H ` testDev( t, p, p, p+` #define __const const #define __inline inline #define __restrict restrict #define __typeof typeof `, []string{ "-I.", "-Iproto", "-DHAVE_CONFIG_H", "-U_FORTIFY_SOURCE", "-D_FORTIFY_SOURCE=1", }, []string{ "auto/pathdef.c", "blowfish.c", "buffer.c", "channel.c", "charset.c", "crypt.c", "crypt_zip.c", "diff.c", "digraph.c", "edit.c", "eval.c", "ex_cmds.c", "ex_cmds2.c", "ex_docmd.c", "ex_eval.c", "ex_getln.c", "fileio.c", "fold.c", "getchar.c", "hardcopy.c", "hashtab.c", "if_cscope.c", "if_xcmdsrv.c", "json.c", "main.c", "mark.c", "mbyte.c", "memfile.c", "memline.c", "menu.c", "message.c", "misc1.c", "misc2.c", "move.c", "netbeans.c", "normal.c", "ops.c", "option.c", "os_unix.c", "popupmnu.c", "quickfix.c", "regexp.c", "screen.c", "search.c", "sha256.c", "spell.c", "syntax.c", "tag.c", "term.c", "ui.c", "undo.c", "version.c", "window.c", }, "testdata/dev/vim/vim/src", ppOpts, parseOpts, ) } func TestDevBash(t *testing.T) { predefined, includePaths, sysIncludePaths, err := HostConfig() if err != nil { t.Logf("skipping: %v", err) return } ppOpts := []Opt{ IncludePaths([]string{ ".", "include", "lib", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), EnableIncludeNext(), devTest(), } if *oFailFast { ppOpts = append(ppOpts, CrashOnError()) } parseOpts := []Opt{ IncludePaths([]string{ ".", "include", "lib", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), gccEmu(), } if *oFailFast { parseOpts = append(parseOpts, CrashOnError()) } p := predefined + ` #define PROGRAM "bash" #define CONF_HOSTTYPE "x86_64" #define CONF_OSTYPE "linux-gnu" #define CONF_MACHTYPE "x86_64-unknown-linux-gnu" #defien CONF_VENDOR "unknown" #define LOCALEDIR "/usr/local/share/locale" #define PACKAGE "bash" #define SHELL #define HAVE_CONFIG_H ` testDev( t, p, p, p+` #define __const const #define __inline inline #define __restrict __restrict__ #define __typeof typeof `, []string{ `-DPROGRAM="bash"`, `-DCONF_HOSTTYPE="x86_64"`, `-DCONF_OSTYPE="linux-gnu"`, `-DCONF_MACHTYPE="x86_64-unknown-linux-gnu"`, `-DCONF_VENDOR="unknown"`, `-DLOCALEDIR="/usr/local/share/locale"`, `-DPACKAGE="bash"`, "-DSHELL", "-DHAVE_CONFIG_H", "-I.", "-Iinclude", "-Ilib", }, []string{ "alias.c", "array.c", "arrayfunc.c", "assoc.c", "bashhist.c", "bashline.c", "bracecomp.c", "braces.c", "copy_cmd.c", "dispose_cmd.c", "error.c", "eval.c", "expr.c", "findcmd.c", "flags.c", "general.c", "hashcmd.c", "hashlib.c", "input.c", "jobs.c", "list.c", "locale.c", "mailcheck.c", "make_cmd.c", "mksyntax.c", "pathexp.c", "pcomplete.c", "pcomplib.c", "print_cmd.c", "redir.c", "shell.c", "sig.c", "stringlib.c", "subst.c", "support/bashversion.c", "support/mksignames.c", "support/signames.c", "syntax.c", "test.c", "trap.c", "unwind_prot.c", "variables.c", "version.c", "version.c", "xmalloc.c", "y.tab.c", //"execute_cmd.c", // Composite type K&R fn def style vs prototype decl lefts an undefined param. }, "testdata/dev/bash-4.3/", ppOpts, parseOpts, ) ppOpts = []Opt{ IncludePaths([]string{ ".", "..", "../include", "../lib", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), EnableIncludeNext(), devTest(), } if *oFailFast { ppOpts = append(ppOpts, CrashOnError()) } parseOpts = []Opt{ IncludePaths([]string{ ".", "..", "../include", "../lib", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), gccEmu(), } if *oFailFast { parseOpts = append(parseOpts, CrashOnError()) } p = predefined + ` #define HAVE_CONFIG_H #define SHELL ` testDev( t, p, p, p+` #define __const const #define __restrict __restrict__ #define __inline inline `, []string{ "-DSHELL", "-DHAVE_CONFIG_H", "-I.", "-I..", "-I../include", "-I../lib", }, []string{ "builtins.c", "common.c", "evalfile.c", "evalstring.c", "mkbuiltins.c", "psize.c", }, "testdata/dev/bash-4.3/builtins", ppOpts, parseOpts, ) ppOpts = []Opt{ IncludePaths([]string{ ".", "../..", "../../include", "../../lib", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), EnableIncludeNext(), devTest(), } if *oFailFast { ppOpts = append(ppOpts, CrashOnError()) } parseOpts = []Opt{ IncludePaths([]string{ ".", "../..", "../../include", "../../lib", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), gccEmu(), } if *oFailFast { parseOpts = append(parseOpts, CrashOnError()) } p = predefined + ` #define HAVE_CONFIG_H #define SHELL ` testDev( t, p, p, p+` #define __const const #define __inline inline #define __restrict __restrict__ `, []string{ "-DSHELL", "-DHAVE_CONFIG_H", "-I.", "-I../..", "-I../../include", "-I../../lib", }, []string{ "glob.c", "gmisc.c", "smatch.c", "strmatch.c", "xmbsrtowcs.c", }, "testdata/dev/bash-4.3/lib/glob", ppOpts, parseOpts, ) testDev( t, p, p, p+` #define __const const #define __inline inline #define __restrict __restrict__ `, []string{ "-DSHELL", "-DHAVE_CONFIG_H", "-I.", "-I../..", "-I../../include", "-I../../lib", }, []string{ "casemod.c", "clktck.c", "clock.c", "eaccess.c", "fmtullong.c", "fmtulong.c", "fmtumax.c", "fnxform.c", "fpurge.c", "getenv.c", "input_avail.c", "itos.c", "mailstat.c", "makepath.c", "mbscasecmp.c", "mbschr.c", "mbscmp.c", "netconn.c", "netopen.c", "oslib.c", "pathcanon.c", "pathphys.c", "setlinebuf.c", "shmatch.c", "shmbchar.c", "shquote.c", "shtty.c", "snprintf.c", "spell.c", "stringlist.c", "stringvec.c", "strnlen.c", "strtrans.c", "timeval.c", "tmpfile.c", "uconvert.c", "ufuncs.c", "unicode.c", "wcsdup.c", "wcsnwidth.c", "winsize.c", "zcatfd.c", "zgetline.c", "zmapfd.c", "zread.c", "zwrite.c", }, "testdata/dev/bash-4.3/lib/sh", ppOpts, parseOpts, ) testDev( t, p, p, p+` #define __const const #define __inline inline #define __restrict __restrict__ `, []string{ "-DSHELL", "-DHAVE_CONFIG_H", "-I.", "-I../..", "-I../../include", "-I../../lib", }, []string{ "bind.c", "callback.c", "colors.c", "compat.c", "complete.c", "display.c", "funmap.c", "histexpand.c", "histfile.c", "history.c", "histsearch.c", "input.c", "isearch.c", "keymaps.c", "kill.c", "macro.c", "mbutil.c", "misc.c", "nls.c", "parens.c", "parse-colors.c", "readline.c", "rltty.c", "savestring.c", "search.c", "shell.c", "signals.c", "terminal.c", "text.c", "tilde.c", "undo.c", "util.c", "vi_mode.c", "xfree.c", "xmalloc.c", }, "testdata/dev/bash-4.3/lib/readline", ppOpts, parseOpts, ) p = predefined + ` #define HAVE_CONFIG_H #define SHELL #define RCHECK #define botch programming_error ` testDev( t, p, p, p+` #define __const const #define __inline inline #define __restrict __restrict__ `, []string{ "-DSHELL", "-DHAVE_CONFIG_H", "-DRCHECK", "-Dbotch=programming_error", "-I.", "-I../..", "-I../../include", "-I../../lib", }, []string{ "malloc.c", "trace.c", "stats.c", "table.c", "watch.c", }, "testdata/dev/bash-4.3/lib/malloc", ppOpts, parseOpts, ) } func TestDevMake(t *testing.T) { predefined, includePaths, sysIncludePaths, err := HostConfig() if err != nil { t.Logf("skipping: %v", err) return } ppOpts := []Opt{ IncludePaths([]string{ ".", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), EnableIncludeNext(), devTest(), } if *oFailFast { ppOpts = append(ppOpts, CrashOnError()) } parseOpts := []Opt{ IncludePaths([]string{ ".", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), gccEmu(), } if *oFailFast { parseOpts = append(parseOpts, CrashOnError()) } p := predefined + ` #define LOCALEDIR "/usr/local/share/locale" #define LIBDIR "/usr/local/lib" #define INCLUDEDIR "/usr/local/include" #define HAVE_CONFIG_H ` testDev( t, p, p, p+` #define __const const #define __inline inline #define __restrict __restrict__ #define __typeof typeof `, []string{ "-DLOCALEDIR=\"/usr/local/share/locale\"", "-DLIBDIR=\"/usr/local/lib\"", "-DINCLUDEDIR=\"/usr/local/include\"", "-DHAVE_CONFIG_H", "-I.", }, []string{ "ar.c", "arscan.c", "commands.c", "default.c", "dir.c", "expand.c", "file.c", "function.c", "getopt.c", "getopt1.c", "guile.c", "hash.c", "implicit.c", "job.c", "load.c", "loadapi.c", "main.c", "misc.c", "output.c", "read.c", "remake.c", "remote-stub.c", "rule.c", "signame.c", "strcache.c", "variable.c", "version.c", "vpath.c", }, "testdata/dev/make-4.1/", ppOpts, parseOpts, ) } func TestDevBc(t *testing.T) { predefined, includePaths, sysIncludePaths, err := HostConfig() if err != nil { t.Logf("skipping: %v", err) return } ppOpts := []Opt{ IncludePaths([]string{ ".", "..", "./../h", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), EnableIncludeNext(), devTest(), } if *oFailFast { ppOpts = append(ppOpts, CrashOnError()) } parseOpts := []Opt{ IncludePaths([]string{ ".", "..", "./../h", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), gccEmu(), } if *oFailFast { parseOpts = append(parseOpts, CrashOnError()) } p := predefined + ` #define HAVE_CONFIG_H ` testDev( t, p, p, p+` #define __const const #define __inline inline #define __restrict __restrict__ `, []string{ "-DHAVE_CONFIG_H", "-I.", "-I..", "-I./../h", }, []string{ "getopt.c", "getopt1.c", "number.c", "vfprintf.c", }, "testdata/dev/bc-1.06/lib/", ppOpts, parseOpts, ) testDev( t, p, p, p+` #define __const const #define __inline inline #define __restrict __restrict__ `, []string{ "-DHAVE_CONFIG_H", "-I.", "-I..", "-I./../h", }, []string{ "main.c", "bc.c", "scan.c", "execute.c", "load.c", "storage.c", "util.c", "global.c", }, "testdata/dev/bc-1.06/bc", ppOpts, parseOpts, ) testDev( t, p, p, p+` #define __const const #define __inline inline #define __restrict __restrict__ `, []string{ "-DHAVE_CONFIG_H", "-I.", "-I..", "-I./../h", }, []string{ "dc.c", "misc.c", "eval.c", "stack.c", "array.c", "numeric.c", "string.c", }, "testdata/dev/bc-1.06/dc", ppOpts, parseOpts, ) } func TestDevEmacs(t *testing.T) { predefined, includePaths, sysIncludePaths, err := HostConfig() if err != nil { t.Logf("skipping: %v", err) return } ppOpts := []Opt{ IncludePaths([]string{ ".", "../lib", "../src", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), EnableIncludeNext(), devTest(), } if *oFailFast { ppOpts = append(ppOpts, CrashOnError()) } parseOpts := []Opt{ IncludePaths([]string{ ".", "../lib", "../src", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), gccEmu(), } if *oFailFast { parseOpts = append(parseOpts, CrashOnError()) } p := predefined + ` #define HAVE_CONFIG_H #define _GCC_MAX_ALIGN_T ` testDev( t, p+` #define _Noreturn __attribute__ ((__noreturn__)) `, p, p+` #define __const const #define __getopt_argv_const const #define __inline inline #define __restrict __restrict__ `, []string{ "-std=gnu99", "-DHAVE_CONFIG_H", "-I.", "-I../lib", "-I../src", }, []string{ "acl-errno-valid.c", "allocator.c", "binary-io.c", "c-ctype.c", "c-strcasecmp.c", "c-strncasecmp.c", "careadlinkat.c", "close-stream.c", "count-one-bits.c", "count-trailing-zeros.c", "dtoastr.c", "dtotimespec.c", "fcntl.c", "file-has-acl.c", "filemode.c", "getopt.c", "getopt1.c", "gettime.c", "md5.c", "openat-die.c", "pipe2.c", "pthread_sigmask.c", "qcopy-acl.c", "qset-acl.c", "save-cwd.c", "sha1.c", "sha256.c", "sha512.c", "sig2str.c", "stat-time.c", "strftime.c", "timespec-add.c", "timespec-sub.c", "timespec.c", "u64.c", "unistd.c", "utimens.c", }, "testdata/dev/emacs-24.5/lib", ppOpts, parseOpts, ) p = predefined + ` #define CTAGS #define EMACS_NAME "GNU Emacs" #define HAVE_CONFIG_H #define HAVE_SHARED_GAME_DIR "/usr/local/var/games/emacs" #define VERSION "24.5" ` testDev( t, p+` #define _GCC_MAX_ALIGN_T #define _Noreturn __attribute__ ((__noreturn__)) `, p, p+` #define __const const #define __inline inline #define __restrict __restrict__ #define __typeof typeof `, []string{ "-std=gnu99", "-I.", "-I../lib", "-I../src", "-DEMACS_NAME=\"GNU Emacs\"", "-DCTAGS", "-DHAVE_SHARED_GAME_DIR=\"/usr/local/var/games/emacs\"", "-DVERSION=\"24.5\"", }, []string{ "./../src/regex.c", "./ebrowse.c", "./emacsclient.c", "./etags.c", "./hexl.c", "./make-docfile.c", "./movemail.c", "./pop.c", "./profile.c", "./test-distrib.c", "./update-game-score.c", }, "testdata/dev/emacs-24.5/lib-src/", ppOpts, parseOpts, ) ppOpts = []Opt{ IncludePaths([]string{ ".", "../lib", "/usr/include/gtk-3.0", "/usr/include/pango-1.0", "/usr/include/gio-unix-2.0/", "/usr/include/atk-1.0", "/usr/include/cairo", "/usr/include/gdk-pixbuf-2.0", "/usr/include/freetype2", "/usr/include/glib-2.0", "/usr/lib/x86_64-linux-gnu/glib-2.0/include", "/usr/include/pixman-1", "/usr/include/libpng12", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), EnableDefineOmitCommaBeforeDDD(), EnableIncludeNext(), devTest(), } if *oFailFast { ppOpts = append(ppOpts, CrashOnError()) } parseOpts = []Opt{ IncludePaths([]string{ ".", "../lib", "/usr/include/gtk-3.0", "/usr/include/pango-1.0", "/usr/include/gio-unix-2.0/", "/usr/include/atk-1.0", "/usr/include/cairo", "/usr/include/gdk-pixbuf-2.0", "/usr/include/freetype2", "/usr/include/glib-2.0", "/usr/lib/x86_64-linux-gnu/glib-2.0/include", "/usr/include/pixman-1", "/usr/include/libpng12", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), gccEmu(), } if *oFailFast { parseOpts = append(parseOpts, CrashOnError()) } p = predefined + ` #define _GCC_MAX_ALIGN_T #define emacs ` testDev( t, p+` #define _Noreturn __attribute__ ((__noreturn__)) `, p, p+` #define _Alignas(x) #define __const const #define __inline inline #define __restrict __restrict__ #define __typeof typeof `, []string{ "-std=gnu99", "-Demacs", "-I.", "-I../lib", "-I/usr/include/gtk-3.0", "-I/usr/include/pango-1.0", "-I/usr/include/gio-unix-2.0/", "-I/usr/include/atk-1.0", "-I/usr/include/cairo", "-I/usr/include/gdk-pixbuf-2.0", "-I/usr/include/freetype2", "-I/usr/include/glib-2.0", "-I/usr/lib/x86_64-linux-gnu/glib-2.0/include", "-I/usr/include/pixman-1", "-I/usr/include/libpng12", }, []string{ "alloc.c", "atimer.c", "bidi.c", "buffer.c", "callint.c", "callproc.c", "casefiddle.c", "casetab.c", "category.c", "ccl.c", "character.c", "charset.c", "chartab.c", "cm.c", "cmds.c", "coding.c", "composite.c", "data.c", "decompress.c", "dired.c", "dispnew.c", "doc.c", "doprnt.c", "editfns.c", "emacs.c", "eval.c", "fileio.c", "filelock.c", "floatfns.c", "fns.c", "font.c", "fontset.c", "frame.c", "fringe.c", "ftfont.c", "gfilenotify.c", "gnutls.c", "gtkutil.c", "indent.c", "insdel.c", "intervals.c", "keyboard.c", "keymap.c", "lastfile.c", "lread.c", "macros.c", "marker.c", "menu.c", "minibuf.c", "print.c", "process.c", "profiler.c", "region-cache.c", "scroll.c", "search.c", "sound.c", "syntax.c", "sysdep.c", "term.c", "terminal.c", "terminfo.c", "textprop.c", "undo.c", "vm-limit.c", "window.c", "xdisp.c", "xfaces.c", "xfns.c", "xfont.c", "xgselect.c", "xmenu.c", "xml.c", "xrdb.c", "xselect.c", "xsmfns.c", "xterm.c", /// "bytecode.c", // [lo ... hi] = expr /// "emacsgtkfixed.c", // /usr/include/gtk-3.0/gtk/gtkversion.h:98:9: cannot redefine macro: argument names differ /// "ftxfont.c", // ftxfont.c:145:7: undefined: ftfont_driver /// "unexelf.c", // /usr/include/x86_64-linux-gnu/bits/link.h:97:3: unexpected identifier __int128_t, expected one of ['}', _Bool, _Complex, _Static_assert, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedefname, typeof, union, unsigned, void, volatile] /// "xftfont.c", // lisp.h:2041:13: unexpected typedefname, expected optional type qualifier list or pointer or one of ['(', ')', '*', ',', '[', const, identifier, restrict, volatile] /// "xsettings.c", // xsettings.c:431:36: unexpected '{', expected expression list or type name or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, _Bool, _Complex, char, character constant, const, double, enum, float, floating-point constant, identifier, int, integer constant, long, long character constant, long string constant, restrict, short, signed, sizeof, string literal, struct, typedefname, typeof, union, unsigned, void, volatile] ///"image.c", // /usr/include/gif_lib.h:269:44: unexpected typedefname, expected optional type qualifier list or pointer or one of ['(', ')', '*', ',', '[', const, identifier, restrict, volatile] }, "testdata/dev/emacs-24.5/src/", ppOpts, parseOpts, ) } func TestDevM4(t *testing.T) { predefined, includePaths, sysIncludePaths, err := HostConfig() if err != nil { t.Logf("skipping: %v", err) return } ppOpts := []Opt{ IncludePaths([]string{ ".", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), EnableIncludeNext(), } if *oFailFast { ppOpts = append(ppOpts, CrashOnError()) } parseOpts := []Opt{ IncludePaths([]string{ ".", }), IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), gccEmu(), } if *oFailFast { parseOpts = append(parseOpts, CrashOnError()) } p := predefined testDev( t, p, p, p+` #define __const #define __inline inline #define __restrict __restrict__ #define __typeof typeof `, []string{ "-I.", }, []string{ "asnprintf.c", "asprintf.c", "basename-lgpl.c", "basename.c", "binary-io.c", "c-ctype.c", "c-strcasecmp.c", "c-strncasecmp.c", "clean-temp.c", "cloexec.c", "close-stream.c", "closein.c", "closeout.c", "dirname-lgpl.c", "dirname.c", "dup-safer-flag.c", "dup-safer.c", "exitfail.c", "fatal-signal.c", "fclose.c", "fcntl.c", "fd-hook.c", "fd-safer-flag.c", "fd-safer.c", "fflush.c", "filenamecat-lgpl.c", "filenamecat.c", "fopen-safer.c", "fpurge.c", "freadahead.c", "freading.c", "fseek.c", "fseeko.c", "gl_avltree_oset.c", "gl_linkedhash_list.c", "gl_list.c", "gl_oset.c", "gl_xlist.c", "gl_xoset.c", "glthread/lock.c", "glthread/threadlib.c", "glthread/tls.c", "localcharset.c", "malloca.c", "math.c", "memchr2.c", "mkstemp-safer.c", "pipe-safer.c", "pipe2-safer.c", "pipe2.c", "printf-args.c", "printf-frexp.c", "printf-parse.c", "progname.c", "quotearg.c", "sig-handler.c", "stripslash.c", "tempname.c", "tmpdir.c", "unistd.c", "vasprintf.c", "verror.c", "version-etc-fsf.c", "version-etc.c", "wait-process.c", "wctype-h.c", "xalloc-die.c", "xasprintf.c", "xmalloc.c", "xmalloca.c", "xprintf.c", "xsize.c", "xstrndup.c", "xvasprintf.c", /// "c-stack.c", c-stack.c:119:3: unexpected '{', expected expression list or type name or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, _Bool, _Complex, char, character constant, const, double, enum, float, floating-point constant, identifier, int, integer constant, long, long character constant, long string constant, restrict, short, signed, sizeof, string literal, struct, typedefname, typeof, union, unsigned, void, volatile] /// "execute.c", spawn.h:457:9: cannot redefine macro using a replacement list of different length /// "isnanl.c", float+.h:145:32: array size must be positive: -1 /// "printf-frexpl.c", printf-frexp.c:72:3: unexpected '{', expected expression list or type name or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, _Bool, _Complex, char, character constant, const, double, enum, float, floating-point constant, identifier, int, integer constant, long, long character constant, long string constant, restrict, short, signed, sizeof, string literal, struct, typedefname, typeof, union, unsigned, void, volatile] /// "spawn-pipe.c", spawn.h:457:9: cannot redefine macro using a replacement list of different length /// "vasnprintf.c", vasnprintf.c:3624:25: unexpected '{', expected expression list or type name or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, _Bool, _Complex, char, character constant, const, double, enum, float, floating-point constant, identifier, int, integer constant, long, long character constant, long string constant, restrict, short, signed, sizeof, string literal, struct, typedefname, typeof, union, unsigned, void, volatile] }, "testdata/dev/m4-1.4.17/lib/", ppOpts, parseOpts, ) } func TestDevStbVorbis(t *testing.T) { predefined, includePaths, sysIncludePaths, err := HostConfig() if err != nil { t.Logf("skipping: %v", err) return } ppOpts := []Opt{ IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), EnableIncludeNext(), } if *oFailFast { ppOpts = append(ppOpts, CrashOnError()) } parseOpts := []Opt{ IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), gccEmu(), } if *oFailFast { parseOpts = append(parseOpts, CrashOnError()) } testDev( t, predefined, predefined, predefined+` #define __inline inline #define __const const #define __restrict restrict `, nil, []string{ "stb_vorbis.c", }, "testdata/dev/stb", ppOpts, parseOpts, ) } func TestDevGMP(t *testing.T) { predefined, includePaths, sysIncludePaths, err := HostConfig() if err != nil { t.Logf("skipping: %v", err) return } ppOpts := []Opt{ IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), EnableIncludeNext(), } if *oFailFast { ppOpts = append(ppOpts, CrashOnError()) } parseOpts := []Opt{ IncludePaths(includePaths), SysIncludePaths(sysIncludePaths), devTest(), gccEmu(), } if *oFailFast { parseOpts = append(parseOpts, CrashOnError()) } testDev( t, predefined, predefined, predefined, nil, []string{ "gmp.h", }, "testdata/dev/gmp-6.1.0/", ppOpts, parseOpts, ) } func TestPPParse1(t *testing.T) { path := *o1 if path == "" { return } testReport := newTestReport() testReport.ClearErrors() _, err := ppParse(path, testReport, testTweaks) if err != nil { t.Fatal(err) } if err := testReport.Errors(true); err != nil { t.Fatal(errString(err)) } } func TestFinalInjection(t *testing.T) { const src = "int f() {}" if strings.HasSuffix(src, "\n") { t.Fatal("internal error") } ast, err := ppParseString("test.c", src, xc.NewReport(), &tweaks{}) if err != nil { t.Fatal(errString(err)) } t.Log(PrettyString(ast)) } func TestRedecl(t *testing.T) { testParse(t, []string{"testdata/redecl.c"}, "") } func TestParse1(t *testing.T) { path := *o1 if path == "" { return } testParse(t, []string{path}, "") } func testParse(t *testing.T, paths []string, ignoreError string, opts ...Opt) *TranslationUnit { last := paths[len(paths)-1] ln := filepath.Base(last) f, err := os.Create("log-" + ln) if err != nil { t.Fatal(err) } defer f.Close() b := bufio.NewWriter(f) defer b.Flush() b.WriteString("// +build ignore\n\n") var a []string crash := nopOpt() if *oFailFast { crash = CrashOnError() } opts = append( opts, IncludePaths(includes), SysIncludePaths(sysIncludes), Cpp(func(toks []xc.Token) { a = a[:0] for _, v := range toks { a = append(a, TokSrc(v)) } fmt.Fprintf(b, "%s\n", strings.Join(a, " ")) }), crash, ErrLimit(-1), ) ast, err := Parse( predefinedMacros, paths, newTestModel(), opts..., ) if err != nil { if s := strings.TrimSpace(errString(err)); s != ignoreError { t.Fatal(errString(err)) } } t.Log(paths) return ast } func ddsStr(dds []*DirectDeclarator) string { buf := bytes.NewBufferString("|") for i, dd := range dds { if i == 0 { fmt.Fprintf(buf, "(@%p)", &dds[0]) } switch dd.Case { case 0: // IDENTIFIER fmt.Fprintf(buf, "IDENTIFIER(%s: %s)", dd.Token.Position(), dd.Token.S()) case 1: // '(' Declarator ')' buf.WriteString("(") buf.WriteString(strings.Repeat("*", dd.Declarator.stars())) fmt.Fprintf(buf, "Declarator.%v)", dds[i-1].Case) case 2: // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' fmt.Fprintf(buf, "DirectDeclarator[TypeQualifierListOpt ExpressionOpt.%v]", dd.elements) case 3: // DirectDeclarator '[' "static" TypeQualifierListOpt Expression ']' fmt.Fprintf(buf, "DirectDeclarator[static TypeQualifierListOpt Expression.%v]", dd.elements) case 4: // DirectDeclarator '[' TypeQualifierList "static" Expression ']' fmt.Fprintf(buf, "DirectDeclarator[TypeQualifierList static Expression.%v]", dd.elements) case 5: // DirectDeclarator '[' TypeQualifierListOpt '*' ']' fmt.Fprintf(buf, "DirectDeclarator[TypeQualifierListOpt*.%v]", dd.elements) case 6: // DirectDeclarator '(' ParameterTypeList ')' buf.WriteString("DirectDeclarator(ParameterTypeList)") case 7: // DirectDeclarator '(' IdentifierListOpt ')' buf.WriteString("DirectDeclarator(IdentifierListOpt)") } buf.WriteString("|") } return buf.String() } func (n *ctype) str() string { return fmt.Sprintf("R%v S%v %v", n.resultStars, n.stars, ddsStr(n.dds)) } func (n *ctype) str0() string { return fmt.Sprintf("R%v S%v %v", n.resultStars, n.stars, ddsStr(n.dds0)) } func TestIssue3(t *testing.T) { if _, err := Parse("", []string{"testdata/issue3.h"}, newTestModel()); err != nil { t.Fatal(errString(err)) } } func TestIssue8(t *testing.T) { if _, err := Parse("", []string{"testdata/issue8.h"}, newTestModel()); err != nil { t.Fatal(errString(err)) } } func TestIssue4(t *testing.T) { _, err := Parse("", []string{"testdata/issue4.c"}, newTestModel()) if err == nil { t.Fatal("unexpected sucess") } l, ok := err.(scanner.ErrorList) if !ok { t.Fatalf("unexpected error type %T", err) } if g, e := l.Len(), 2; g != e { t.Fatal(g, e) } if g, e := l[0].Error(), "testdata/issue4.c:5:13: redeclaration of foo as different kind of symbol, previous declaration at testdata/issue4.c:4:5"; g != e { t.Fatal(g, e) } if g, e := l[1].Error(), "testdata/issue4.c:9:15: redeclaration of foo2 as different kind of symbol, previous declaration at testdata/issue4.c:8:7"; g != e { t.Fatal(g, e) } } func unpackType(typ Type) Type { for { switch typ.Kind() { case Ptr, Array: typ = typ.Element() default: return typ } } } func TestIssue9(t *testing.T) { const exp = `original: typedef short[64] Array unpacked: typedef short Short original: JBLOCK short(*)[64] Ptr unpacked: JBLOCK short Short original: JBLOCKROW short(**)[64] Ptr unpacked: JBLOCKROW short Short original: JBLOCKARRAY short(***)[64] Ptr unpacked: JBLOCKARRAY short Short original: short[64] Array unpacked: short Short original: short[64] Array unpacked: short Short original: JBLOCK short[64] Array unpacked: JBLOCK short Short original: JBLOCK short[64] Array unpacked: JBLOCK short Short original: short(*)[64] Ptr unpacked: short Short original: short(*)[64] Ptr unpacked: short Short original: short(*)[64] Ptr unpacked: short Short original: JBLOCKROW short(*)[64] Ptr unpacked: JBLOCKROW short Short original: JBLOCKROW short(*)[64] Ptr unpacked: JBLOCKROW short Short original: short(**)[64] Ptr unpacked: short Short original: short(**)[64] Ptr unpacked: short Short original: short(**)[64] Ptr unpacked: short Short original: JBLOCKARRAY short(**)[64] Ptr unpacked: JBLOCKARRAY short Short original: JBLOCKARRAY short(**)[64] Ptr unpacked: JBLOCKARRAY short Short original: short(***)[64] Ptr unpacked: short Short original: short(***)[64] Ptr unpacked: short Short original: short(***)[64] Ptr unpacked: short Short original: JBLOCKIMAGE short(***)[64] Ptr unpacked: JBLOCKIMAGE short Short original: JBLOCKIMAGE short(***)[64] Ptr unpacked: JBLOCKIMAGE short Short ` tu, err := Parse("", []string{"testdata/issue9.c"}, newTestModel()) if err != nil { t.Fatal(errString(err)) } var buf bytes.Buffer for tu != nil { declr := tu.ExternalDeclaration.Declaration.InitDeclaratorListOpt.InitDeclaratorList.InitDeclarator.Declarator name := string(xc.Dict.S(declr.RawSpecifier().TypedefName())) fmt.Fprintln(&buf, "original:", name, declr.Type, declr.Type.Kind()) unpacked := unpackType(declr.Type) fmt.Fprintln(&buf, "unpacked:", name, unpacked, unpacked.Kind()) tu = tu.TranslationUnit } if g, e := buf.String(), exp; g != e { t.Fatalf("got:\n%s\nexp:\n%s", g, e) } } func TestEnumConstToks(t *testing.T) { tu, err := Parse("", []string{"testdata/enum.c"}, newTestModel()) if err != nil { t.Fatal(errString(err)) } sc := tu.Declarations foo := sc.Lookup(NSIdentifiers, xc.Dict.SID("foo")) if foo.Node == nil { t.Fatal("internal error") } switch x := foo.Node.(type) { case *DirectDeclarator: typ := x.TopDeclarator().Type if g, e := typ.Kind(), Enum; g != e { t.Fatal(g, e) } l := typ.EnumeratorList() if g, e := PrettyString( l), `[]cc.EnumConstant{ // len 2 · 0: cc.EnumConstant{ · · DefTok: testdata/enum.c:4:2: IDENTIFIER "c", · · Value: 18, · · Tokens: []xc.Token{ // len 3 · · · 0: testdata/enum.c:4:6: INTCONST "42", · · · 1: testdata/enum.c:4:9: '-', · · · 2: testdata/enum.c:4:11: INTCONST "24", · · }, · }, · 1: cc.EnumConstant{ · · DefTok: testdata/enum.c:5:2: IDENTIFIER "d", · · Value: 592, · · Tokens: []xc.Token{ // len 3 · · · 0: testdata/enum.c:5:6: INTCONST "314", · · · 1: testdata/enum.c:5:10: '+', · · · 2: testdata/enum.c:5:12: INTCONST "278", · · }, · }, }`; g != e { t.Fatalf("got\n%s\nexp\n%s", g, e) } var a []string for _, e := range l { var b []string for _, t := range e.Tokens { b = append(b, TokSrc(t)) } a = append(a, strings.Join(b, " ")) } if g, e := strings.Join(a, "\n"), "42 - 24\n314 + 278"; g != e { t.Fatalf("got\n%s\nexp\n%s", g, e) } default: t.Fatalf("%T", x) } } func TestPaste(t *testing.T) { testParse(t, []string{"testdata/paste.c"}, "") } func TestPaste2(t *testing.T) { testParse(t, []string{"testdata/paste2.c"}, "") } func TestFunc(t *testing.T) { testParse(t, []string{"testdata/func.c"}, "") } func TestEmptyMacroArg(t *testing.T) { testParse(t, []string{"testdata/empty.c"}, "") } func TestFuncFuncParams(t *testing.T) { testParse(t, []string{"testdata/funcfunc.c"}, "") } func TestAnonStructField(t *testing.T) { testParse( t, []string{"testdata/anon.c"}, "testdata/anon.c:4:7: only unnamed structs and unions are allowed", EnableAnonymousStructFields(), ) } func tokStr(toks []xc.Token) string { var b []byte for _, v := range toks { switch v.Rune { case sentinel: b = append(b, []byte("@:")...) case IDENTIFIER_NONREPL: b = append(b, []byte("-:")...) } b = append(b, xc.Dict.S(tokVal(v))...) } return string(b) } func tokStr2(toks [][]xc.Token) string { var a []string for _, v := range toks { a = append(a, tokStr(v)) } return strings.Join(a, ", ") } func TestIssue50(t *testing.T) { if _, err := Parse("", []string{"testdata/issue50.h"}, newTestModel()); err == nil { t.Fatal("unexpected success") } } // https://github.com/cznic/cc/issues/57 func TestIssue57(t *testing.T) { tu, err := Parse("", []string{"testdata/issue57.c"}, newTestModel()) if err != nil { t.Fatal(errString(err)) } bool_func := tu.Declarations.Identifiers[dict.SID("bool_func")].Node.(*DirectDeclarator).TopDeclarator() typ := bool_func.Type if g, e := typ.String(), "int(*)()"; g != e { t.Fatalf("%q %q", g, e) } typ = typ.Element() // deref function pointer if g, e := typ.Result().String(), "int"; g != e { t.Fatalf("%q %q", g, e) } // bool_t -> ok! if g, e := typ.Result().RawDeclarator().RawSpecifier().TypedefName(), dict.SID("bool_t"); g != e { t.Fatal(g, e) } func1 := tu.Declarations.Identifiers[dict.SID("func1")].Node.(*DirectDeclarator).TopDeclarator() typ = func1.Type if g, e := typ.String(), "int(*)()"; g != e { t.Fatalf("%q %q", g, e) } typ = typ.Element() // deref function pointer if g, e := typ.String(), "int()"; g != e { t.Fatalf("%q %q", g, e) } if g, e := typ.Result().String(), "int"; g != e { t.Fatalf("%q %q", g, e) } // try to get bool_t the way we got it above if g, e := typ.Result().RawDeclarator().RawSpecifier().TypedefName(), dict.SID("bool_t"); g != e { t.Fatal(string(xc.Dict.S(g)), string(xc.Dict.S(e))) // bool_func, how to get bool_t? } } // https://github.com/cznic/cc/issues/62 func TestIssue62(t *testing.T) { tu, err := Parse("", []string{"testdata/issue62.c"}, newTestModel()) if err != nil { t.Fatal(errString(err)) } for ; tu != nil; tu = tu.TranslationUnit { d := tu.ExternalDeclaration.Declaration.Declarator() var e Linkage tag := string(xc.Dict.S(d.Type.Tag())) t.Logf("%s: %s", position(d.Pos()), tag) switch { case strings.HasPrefix(tag, "global"): e = External case strings.HasPrefix(tag, "local"): e = Internal } if g := d.Linkage; g != e { t.Fatalf("%v %v", g, e) } } } // https://github.com/cznic/cc/issues/64 func TestIssue64(t *testing.T) { if _, err := Parse("", []string{"testdata/issue64.c"}, newTestModel()); err == nil { t.Fatal("expected error") } else { t.Log(errString(err)) } } // https://github.com/cznic/cc/issues/65 func TestIssue65(t *testing.T) { tu, err := Parse("", []string{"testdata/issue65.c"}, newTestModel()) if err != nil { t.Fatal(errString(err)) } foo, ok := tu.Declarations.Identifiers[xc.Dict.SID("foo")] if !ok { t.Fatal("undefined: foo") } ft := foo.Node.(*DirectDeclarator).TopDeclarator().Type m, _ := ft.Members() tab := map[string]int{ "i": -1, "j": 0, "k": 1, "l": 3, "m": -1, } for _, v := range m { ofs, ok := tab[string(xc.Dict.S(v.Name))] if !ok { t.Fatal(PrettyString(v)) } if ofs < 0 { if v.Bits != 0 { t.Fatal(PrettyString(v)) } continue } if v.Bits == 0 { t.Fatal(PrettyString(v)) } if g, e := v.BitOffsetOf, ofs; g != e { t.Log(PrettyString(v)) t.Fatal(g, e) } } } // https://github.com/cznic/cc/issues/66 func TestIssue66(t *testing.T) { tu, err := Parse("", []string{"testdata/issue66.c"}, newTestModel()) if err != nil { t.Fatal(errString(err)) } e := tu.ExternalDeclaration.Declaration.InitDeclaratorListOpt.InitDeclaratorList.InitDeclarator.Initializer.Expression if e.Value == nil { t.Fatal("expected constant expression") } switch g := e.Value.(type) { case uintptr: if e := uintptr(13); g != e { t.Fatal(g, e) } default: t.Fatalf("%T(%#v)", g, g) } } // https://github.com/cznic/cc/issues/67 func TestIssue67(t *testing.T) { tu, err := Parse("", []string{"testdata/issue67.c"}, newTestModel(), KeepComments()) if err != nil { t.Fatal(errString(err)) } var a []string for k, v := range tu.Comments { a = append(a, fmt.Sprintf("%s: %q", xc.FileSet.Position(k), xc.Dict.S(v))) } sort.Strings(a) if g, e := strings.Join(a, "\n"), `testdata/issue67.c:14:1: "/* abc11 */\n/* def12\n */" testdata/issue67.c:19:1: "/* abc16\n */\n/* def18 */" testdata/issue67.c:23:1: "/* abc21 */\n// def22" testdata/issue67.c:27:1: "// def25\n/* abc26 */" testdata/issue67.c:2:1: "// bar1" testdata/issue67.c:32:1: "// def31" testdata/issue67.c:5:1: "/*\nbaz3\n*/" testdata/issue67.c:9:1: "// abc7\n// def8"`; g != e { t.Fatalf("got\n%s\nexp\n%s", g, e) } } // https://github.com/cznic/cc/issues/68 func TestIssue68(t *testing.T) { if _, err := Parse("", []string{"testdata/issue68.h"}, newTestModel()); err == nil { t.Fatal("expected error") } if _, err := Parse("", []string{"testdata/issue68.h"}, newTestModel(), EnableEmptyDeclarations()); err != nil { t.Fatal(err) } } // https://github.com/cznic/cc/issues/69 func TestIssue69(t *testing.T) { if _, err := Parse("", []string{"testdata/issue69.h"}, newTestModel()); err != nil { t.Fatal(err) } } // https://github.com/cznic/cc/issues/72 func TestIssue72(t *testing.T) { if _, err := Parse( "", []string{"testdata/issue72.h"}, newTestModel(), EnableWideEnumValues(), ); err != nil { t.Fatal(err) } } // https://github.com/cznic/cc/issues/74 func TestIssue74EnableWideBitFieldTypes(t *testing.T) { if _, err := Parse( "", []string{"testdata/issue74.h"}, newTestModel(), EnableWideBitFieldTypes(), ); err != nil { t.Fatal(err) } } // https://github.com/cznic/cc/issues/77 func TestIssue77(t *testing.T) { if _, err := Parse( "", []string{"testdata/issue77.c"}, newTestModel(), ); err != nil { t.Fatal(err) } } // https://github.com/cznic/cc/issues/78 func TestIssue78(t *testing.T) { if _, err := Parse( "", []string{"testdata/issue78.c"}, newTestModel(), ); err == nil { t.Fatal("expected error") } tu, err := Parse( "", []string{"testdata/issue78.c"}, newTestModel(), EnableOmitFuncRetType(), ) if err != nil { t.Fatal(err) } b := tu.Declarations.Lookup(NSIdentifiers, xc.Dict.SID("f")) if b.Node == nil { t.Fatal("lookup fail") } typ := b.Node.(*DirectDeclarator).TopDeclarator().Type if typ == nil { t.Fatal("missing type") } if typ = typ.Result(); typ == nil { t.Fatal("missing result type") } if g, e := typ.String(), "int"; g != e { t.Fatalf("%q %q", g, e) } } // https://github.com/cznic/cc/issues/80 func TestIssue80(t *testing.T) { tu, err := Parse( "", []string{"testdata/issue80.c"}, newTestModel(), ) if err != nil { t.Fatal(errString(err)) } b := tu.Declarations.Lookup(NSIdentifiers, xc.Dict.SID("s")) if b.Node == nil { t.Fatal("lookup fail") } typ := b.Node.(*DirectDeclarator).TopDeclarator().Type if typ == nil { t.Fatal("missing type") } if g, e := typ.Kind(), Array; g != e { t.Errorf("Kind: %v %v", g, e) } if g, e := typ.Elements(), 7; g != e { t.Errorf("Elements: %v %v", g, e) } if g, e := typ.SizeOf(), 7; g != e { t.Fatalf("Sizeof: %v %v", g, e) } b = tu.Declarations.Lookup(NSIdentifiers, xc.Dict.SID("t")) if b.Node == nil { t.Fatal("lookup fail") } typ = b.Node.(*DirectDeclarator).TopDeclarator().Type if typ == nil { t.Fatal("missing type") } if g, e := typ.Kind(), Ptr; g != e { t.Errorf("Kind: %v %v", g, e) } if g, e := typ.Elements(), -1; g != e { t.Errorf("Elements: %v %v", g, e) } if g, e := typ.SizeOf(), 8; g != e { t.Fatalf("Sizeof: %v %v", g, e) } b = tu.Declarations.Lookup(NSIdentifiers, xc.Dict.SID("u")) if b.Node == nil { t.Fatal("lookup fail") } typ = b.Node.(*DirectDeclarator).TopDeclarator().Type if typ == nil { t.Fatal("missing type") } if g, e := typ.Kind(), Array; g != e { t.Errorf("Kind: %v %v", g, e) } if g, e := typ.Elements(), 11; g != e { t.Errorf("Elements: %v %v", g, e) } if g, e := typ.SizeOf(), 11; g != e { t.Fatalf("Sizeof: %v %v", g, e) } } // https://github.com/cznic/cc/issues/81 func TestIssue81(t *testing.T) { tu, err := Parse( "", []string{"testdata/issue81.c"}, newTestModel(), ) if err != nil { t.Fatal(err) } _ = tu for l := tu; l != nil; l = l.TranslationUnit { d := l.ExternalDeclaration.Declaration for l := d.InitDeclaratorListOpt.InitDeclaratorList; l != nil; l = l.InitDeclaratorList { x := l.InitDeclarator.Initializer.Expression s := xc.Dict.S(int(x.Value.(StringLitID))) if g, e := len(s), 3; g != e { t.Fatalf("%v |% x| \n%v %v", position(x.Pos()), s, g, e) } if g, e := s, []byte{0, 255, 0}; !bytes.Equal(g, e) { t.Fatalf("%v |% x| |% x|", position(x.Pos()), g, e) } } } } // https://github.com/cznic/cc/issues/82 func TestIssue82(t *testing.T) { if g, e := testPreprocessor(t, "testdata/issue82.c"), `d(2) d(2, 3)`; g != e { t.Fatalf("\ngot\n%s\nexp\n%s", g, e) } } // https://github.com/cznic/cc/issues/84 func TestIssue84(t *testing.T) { if g, e := testPreprocessor(t, "testdata/issue84.c"), `c(1, 2, 3); c(1, 2); c(1, );`; g != e { t.Fatalf("\ngot\n%s\nexp\n%s", g, e) } } var vectorAttr = regexp.MustCompile(`__attribute__ *\(\((__)?vector_size(__)? *\(`) func testDir(t *testing.T, dir string) { var re *regexp.Regexp if s := *oRe; s != "" { re = regexp.MustCompile(s) } dir = filepath.FromSlash(dir) t.Log(dir) m, err := filepath.Glob(filepath.Join(dir, "*.c")) if err != nil { t.Fatal(err) } sort.Strings(m) predefined, _, sysIncludePaths, err := HostConfig() if err != nil { t.Fatal(err) } blacklist := []string{ "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011217-2.c", // (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1] "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020320-1.c", // static T *p = x; "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37056.c", // ? ({void *__s = (u.buf + off); __s;}) : ... "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42196-1.c", // __complex__ int c; "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42196-2.c", // __complex__ int ci; "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42196-3.c", // __complex__ int ci; "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54559.c", // return x + y * (T) (__extension__ 1.0iF); "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54713-2.c", // #include: typedef int V __attribute__((vector_size (N * sizeof (int)))); "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54713-3.c", // #include: typedef int V __attribute__((vector_size (N * sizeof (int)))); "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr67143.c", // __sync_add_and_fetch(&a, 536870912); "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041124-1.c", // struct s { _Complex unsigned short x; }; "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041201-1.c", // typedef struct { _Complex char a; _Complex char b; } Scc2; "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071211-1.c", // __asm__ volatile ("" : : : "memory"); "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr19449.c", // int z = __builtin_choose_expr (!__builtin_constant_p (y), 3, 4); "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr38151.c", // _Complex int b; "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr39228.c", // if (testl (1.18973149535723176502e+4932L) < 1) "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr56982.c", // __asm__ volatile ("" : : : "memory"); "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr71626-2.c", // #include: typedef __INTPTR_TYPE__ V __attribute__((__vector_size__(sizeof (__INTPTR_TYPE__)))); "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pushpop_macro.c", // #pragma push_macro("_") } const attempt2prototypes = ` void exit(); void abort(); ` var pass, gccFail int defer func() { t.Logf("pass %v, gccFail %v (sum %v), total test cases %v", pass, gccFail, pass+gccFail, len(m)) }() outer: for i, v := range m { if re != nil && !re.MatchString(v) { continue } for _, w := range blacklist { if strings.HasSuffix(filepath.ToSlash(v), w) { continue outer } } b, err := ioutil.ReadFile(v) if err != nil { t.Fatal(err) } if vectorAttr.Match(b) { continue } attempt := 1 retry: func() { defer func() { if e := recover(); e != nil { err = fmt.Errorf("PANIC\n%s\n%v", debug.Stack(), e) } }() s := predefined if attempt == 2 { s += attempt2prototypes } err = testDev1( s, s, s, []string{}, "", v, []Opt{ ErrLimit(-1), SysIncludePaths(sysIncludePaths), EnableIncludeNext(), EnableDefineOmitCommaBeforeDDD(), }, []Opt{ ErrLimit(-1), SysIncludePaths(sysIncludePaths), EnableIncludeNext(), EnableWideBitFieldTypes(), EnableEmptyDeclarations(), gccEmu(), }, ) }() if err != nil { //dbg("%T(%v)", err, err) switch err.(type) { case cppCmpError: // fail w/o retry. default: if attempt == 1 { // retry with {abort,exit} prototype. attempt++ goto retry } s := errString(err) if !strings.Contains(s, "PANIC") && !strings.Contains(s, "TODO") && !strings.Contains(s, "undefined: __builtin_") { if out, err := exec.Command("gcc", "-o", os.DevNull, "-c", "-std=c99", "--pedantic", "-fmax-errors=10", v).CombinedOutput(); len(out) != 0 || err != nil { // Auto blacklist if gcc fails to compile as well. if n := 4000; len(out) > n { out = out[:n] } t.Logf("%s\n==== gcc reports\n%s\n%v", s, out, err) gccFail++ continue } } } t.Errorf("%v\n%v/%v, %v ok(+%v=%v)\nFAIL\n%s (%T)", v, i+1, len(m), pass, gccFail, pass+gccFail, errString(err), err) return } pass++ if re != nil { t.Logf("%v: %v ok", v, pass) } } } func TestTCCTests(t *testing.T) { if !*oDev { t.Log("enable with -dev") return } testDir(t, "testdata/tcc-0.9.26/tests/tests2/") } func TestGCCTests(t *testing.T) { if !*oDev { t.Log("enable with -dev") return } testDir(t, "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compat/") testDir(t, "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/") testDir(t, "testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/") } // https://github.com/cznic/cc/issues/85 func TestIssue85(t *testing.T) { tu, err := Parse( "", []string{"testdata/issue85.c"}, newTestModel(), EnableOmitFuncRetType(), ) if err != nil { t.Fatal(err) } b := tu.Declarations.Lookup(NSIdentifiers, xc.Dict.SID("i")) if b.Node == nil { t.Fatal("lookup fail") } d := b.Node.(*DirectDeclarator).TopDeclarator() if g, e := d.Linkage, External; g != e { t.Fatal(g, e) } if g, e := d.Type.Specifier().IsExtern(), false; g != e { t.Fatal(g, e) } b = tu.Declarations.Lookup(NSIdentifiers, xc.Dict.SID("j")) if b.Node == nil { t.Fatal("lookup fail") } d = b.Node.(*DirectDeclarator).TopDeclarator() if g, e := d.Linkage, External; g != e { t.Fatal(g, e) } if g, e := d.Type.Specifier().IsExtern(), true; g != e { t.Fatal(g, e) } } // https://github.com/cznic/cc/issues/86 func TestIssue86(t *testing.T) { _, err := Parse( "", []string{"testdata/issue86.c"}, newTestModel(), EnableOmitFuncRetType(), ) if err == nil { t.Fatal("missed error") } if g, e := err.Error(), "testdata/issue86.c:2:12: 'j' initialized and declared 'extern'"; g != e { t.Fatalf("%q %q", g, e) } t.Log(err) } func TestArray(t *testing.T) { ast, err := Parse( "", []string{"testdata/array.c"}, newTestModel(), EnableOmitFuncRetType(), ) if err != nil { t.Fatal(errString(err)) } expr := ast.TranslationUnit.ExternalDeclaration.FunctionDefinition.FunctionBody. CompoundStatement.BlockItemListOpt.BlockItemList.BlockItemList.BlockItem. Statement.ExpressionStatement.ExpressionListOpt.ExpressionList.Expression if g, e := expr.Type.Kind(), Ptr; g != e { t.Fatal(g, e) } dd := expr.IdentResolutionScope().Lookup(NSIdentifiers, dict.SID("a")).Node.(*DirectDeclarator) if g, e := dd.TopDeclarator().Type.Kind(), Array; g != e { t.Fatal(g, e) } } // https://github.com/cznic/cc/issues/87 func TestIssue87(t *testing.T) { if _, err := Parse( "", []string{"testdata/issue87.c"}, newTestModel(), ); err == nil { t.Fatal("missed error") } if _, err := Parse( "", []string{"testdata/issue87.c"}, newTestModel(), AllowCompatibleTypedefRedefinitions(), ); err != nil { t.Fatal(err) } } // https://github.com/cznic/cc/issues/88 func TestIssue88(t *testing.T) { ast, err := Parse( "", []string{"testdata/issue88.c"}, newTestModel(), ) if err != nil { t.Fatal(errString(err)) } exp := ast.TranslationUnit.ExternalDeclaration.FunctionDefinition.FunctionBody. CompoundStatement.BlockItemListOpt.BlockItemList.BlockItemList.BlockItem. Statement.ExpressionStatement.ExpressionListOpt.ExpressionList.Expression if g := exp.BinOpType; g != nil { t.Fatalf("unexpected non-nil BinOpType %s", g) } } // https://github.com/cznic/cc/issues/89 func TestIssue89(t *testing.T) { ast, err := Parse( "", []string{"testdata/issue89.c"}, newTestModel(), EnableImplicitFuncDef(), ) if err != nil { t.Fatal(errString(err)) } exp := ast.TranslationUnit.ExternalDeclaration.FunctionDefinition.FunctionBody. CompoundStatement.BlockItemListOpt.BlockItemList.BlockItemList.BlockItemList.BlockItem. Statement.ExpressionStatement.ExpressionListOpt.ExpressionList.Expression. ArgumentExpressionListOpt.ArgumentExpressionList.Expression if g := exp.Type; g == nil { t.Errorf("'a.f': missing expression type") } if g := exp.Expression.Type; g == nil { t.Errorf("'a': missing expression type") } } // https://github.com/cznic/cc/issues/90 func TestIssue90(t *testing.T) { ast, err := Parse( "", []string{"testdata/issue90.c"}, newTestModel(), EnableImplicitFuncDef(), ) if err != nil { t.Fatal(errString(err)) } expr := ast.TranslationUnit.ExternalDeclaration.FunctionDefinition.FunctionBody. CompoundStatement.BlockItemListOpt.BlockItemList.BlockItemList.BlockItem. Statement.ExpressionStatement.ExpressionListOpt.ExpressionList.Expression if g, e := expr.Type.Kind(), UInt; g != e { t.Errorf("expr: %v %v", g, e) } if g, e := expr.Expression.Type.Kind(), UInt; g != e { t.Errorf("expr.Expression: %v %v", g, e) } if g, e := expr.Expression2.Type.Kind(), UInt; g != e { t.Errorf("expr.Expression2: %v %v", g, e) } } // https://github.com/cznic/cc/issues/92 func TestIssue92(t *testing.T) { if _, err := Parse( "", []string{"testdata/issue92.c"}, newTestModel(), ); err == nil { t.Fatal("missed error") } if _, err := Parse( "", []string{"testdata/issue92.c"}, newTestModel(), AllowCompatibleTypedefRedefinitions(), ); err != nil { t.Fatal(err) } } // https://github.com/cznic/cc/issues/93 func TestIssue93(t *testing.T) { if _, err := Parse( "", []string{"testdata/issue93.c"}, newTestModel(), ); err != nil { t.Fatal(err) } } ================================================ FILE: ast.go ================================================ // Code generated by yy. DO NOT EDIT. // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "go/token" "github.com/cznic/xc" ) // AbstractDeclarator represents data reduced by productions: // // AbstractDeclarator: // Pointer // | PointerOpt DirectAbstractDeclarator // Case 1 type AbstractDeclarator struct { declarator *Declarator Case int DirectAbstractDeclarator *DirectAbstractDeclarator Pointer *Pointer PointerOpt *PointerOpt } func (n *AbstractDeclarator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *AbstractDeclarator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *AbstractDeclarator) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Pointer.Pos() case 1: if p := n.PointerOpt.Pos(); p != 0 { return p } return n.DirectAbstractDeclarator.Pos() default: panic("internal error") } } // AbstractDeclaratorOpt represents data reduced by productions: // // AbstractDeclaratorOpt: // /* empty */ // | AbstractDeclarator // Case 1 type AbstractDeclaratorOpt struct { AbstractDeclarator *AbstractDeclarator } func (n *AbstractDeclaratorOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *AbstractDeclaratorOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *AbstractDeclaratorOpt) Pos() token.Pos { if n == nil { return 0 } return n.AbstractDeclarator.Pos() } // ArgumentExpressionList represents data reduced by productions: // // ArgumentExpressionList: // Expression // | ArgumentExpressionList ',' Expression // Case 1 type ArgumentExpressionList struct { ArgumentExpressionList *ArgumentExpressionList Case int Expression *Expression Token xc.Token } func (n *ArgumentExpressionList) reverse() *ArgumentExpressionList { if n == nil { return nil } na := n nb := na.ArgumentExpressionList for nb != nil { nc := nb.ArgumentExpressionList nb.ArgumentExpressionList = na na = nb nb = nc } n.ArgumentExpressionList = nil return na } func (n *ArgumentExpressionList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *ArgumentExpressionList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ArgumentExpressionList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 1: return n.ArgumentExpressionList.Pos() case 0: return n.Expression.Pos() default: panic("internal error") } } // ArgumentExpressionListOpt represents data reduced by productions: // // ArgumentExpressionListOpt: // /* empty */ // | ArgumentExpressionList // Case 1 type ArgumentExpressionListOpt struct { ArgumentExpressionList *ArgumentExpressionList } func (n *ArgumentExpressionListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ArgumentExpressionListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ArgumentExpressionListOpt) Pos() token.Pos { if n == nil { return 0 } return n.ArgumentExpressionList.Pos() } // AssemblerInstructions represents data reduced by productions: // // AssemblerInstructions: // STRINGLITERAL // | AssemblerInstructions STRINGLITERAL // Case 1 type AssemblerInstructions struct { AssemblerInstructions *AssemblerInstructions Case int Token xc.Token } func (n *AssemblerInstructions) reverse() *AssemblerInstructions { if n == nil { return nil } na := n nb := na.AssemblerInstructions for nb != nil { nc := nb.AssemblerInstructions nb.AssemblerInstructions = na na = nb nb = nc } n.AssemblerInstructions = nil return na } func (n *AssemblerInstructions) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *AssemblerInstructions) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *AssemblerInstructions) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 1: return n.AssemblerInstructions.Pos() case 0: return n.Token.Pos() default: panic("internal error") } } // AssemblerOperand represents data reduced by production: // // AssemblerOperand: // AssemblerSymbolicNameOpt STRINGLITERAL '(' Expression ')' type AssemblerOperand struct { AssemblerSymbolicNameOpt *AssemblerSymbolicNameOpt Expression *Expression Token xc.Token Token2 xc.Token Token3 xc.Token } func (n *AssemblerOperand) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *AssemblerOperand) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *AssemblerOperand) Pos() token.Pos { if n == nil { return 0 } if p := n.AssemblerSymbolicNameOpt.Pos(); p != 0 { return p } return n.Token.Pos() } // AssemblerOperands represents data reduced by productions: // // AssemblerOperands: // AssemblerOperand // | AssemblerOperands ',' AssemblerOperand // Case 1 type AssemblerOperands struct { AssemblerOperand *AssemblerOperand AssemblerOperands *AssemblerOperands Case int Token xc.Token } func (n *AssemblerOperands) reverse() *AssemblerOperands { if n == nil { return nil } na := n nb := na.AssemblerOperands for nb != nil { nc := nb.AssemblerOperands nb.AssemblerOperands = na na = nb nb = nc } n.AssemblerOperands = nil return na } func (n *AssemblerOperands) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *AssemblerOperands) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *AssemblerOperands) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.AssemblerOperand.Pos() case 1: return n.AssemblerOperands.Pos() default: panic("internal error") } } // AssemblerStatement represents data reduced by productions: // // AssemblerStatement: // BasicAssemblerStatement // | "asm" VolatileOpt '(' AssemblerInstructions ':' AssemblerOperands ')' // Case 1 // | "asm" VolatileOpt '(' AssemblerInstructions ':' AssemblerOperands ':' AssemblerOperands ')' // Case 2 // | "asm" VolatileOpt '(' AssemblerInstructions ':' AssemblerOperands ':' AssemblerOperands ':' Clobbers ')' // Case 3 // | "asm" VolatileOpt "goto" '(' AssemblerInstructions ':' ':' AssemblerOperands ':' Clobbers ':' IdentifierList ')' // Case 4 // | "asm" VolatileOpt '(' AssemblerInstructions ':' ')' // Case 5 // | "asm" VolatileOpt '(' AssemblerInstructions ':' ':' AssemblerOperands ')' // Case 6 type AssemblerStatement struct { AssemblerInstructions *AssemblerInstructions AssemblerOperands *AssemblerOperands AssemblerOperands2 *AssemblerOperands BasicAssemblerStatement *BasicAssemblerStatement Case int Clobbers *Clobbers IdentifierList *IdentifierList Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token Token5 xc.Token Token6 xc.Token Token7 xc.Token Token8 xc.Token VolatileOpt *VolatileOpt } func (n *AssemblerStatement) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *AssemblerStatement) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *AssemblerStatement) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.BasicAssemblerStatement.Pos() case 1, 2, 3, 4, 5, 6: return n.Token.Pos() default: panic("internal error") } } // AssemblerSymbolicNameOpt represents data reduced by productions: // // AssemblerSymbolicNameOpt: // /* empty */ // | '[' IDENTIFIER ']' // Case 1 type AssemblerSymbolicNameOpt struct { Token xc.Token Token2 xc.Token Token3 xc.Token } func (n *AssemblerSymbolicNameOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *AssemblerSymbolicNameOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *AssemblerSymbolicNameOpt) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // BasicAssemblerStatement represents data reduced by production: // // BasicAssemblerStatement: // "asm" VolatileOpt '(' AssemblerInstructions ')' type BasicAssemblerStatement struct { AssemblerInstructions *AssemblerInstructions Token xc.Token Token2 xc.Token Token3 xc.Token VolatileOpt *VolatileOpt } func (n *BasicAssemblerStatement) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *BasicAssemblerStatement) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *BasicAssemblerStatement) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // BlockItem represents data reduced by productions: // // BlockItem: // Declaration // | Statement // Case 1 type BlockItem struct { Case int Declaration *Declaration Statement *Statement } func (n *BlockItem) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *BlockItem) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *BlockItem) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Declaration.Pos() case 1: return n.Statement.Pos() default: panic("internal error") } } // BlockItemList represents data reduced by productions: // // BlockItemList: // BlockItem // | BlockItemList BlockItem // Case 1 type BlockItemList struct { BlockItem *BlockItem BlockItemList *BlockItemList Case int } func (n *BlockItemList) reverse() *BlockItemList { if n == nil { return nil } na := n nb := na.BlockItemList for nb != nil { nc := nb.BlockItemList nb.BlockItemList = na na = nb nb = nc } n.BlockItemList = nil return na } func (n *BlockItemList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *BlockItemList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *BlockItemList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.BlockItem.Pos() case 1: return n.BlockItemList.Pos() default: panic("internal error") } } // BlockItemListOpt represents data reduced by productions: // // BlockItemListOpt: // /* empty */ // | BlockItemList // Case 1 type BlockItemListOpt struct { BlockItemList *BlockItemList } func (n *BlockItemListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *BlockItemListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *BlockItemListOpt) Pos() token.Pos { if n == nil { return 0 } return n.BlockItemList.Pos() } // Clobbers represents data reduced by productions: // // Clobbers: // STRINGLITERAL // | Clobbers ',' STRINGLITERAL // Case 1 type Clobbers struct { Case int Clobbers *Clobbers Token xc.Token Token2 xc.Token } func (n *Clobbers) reverse() *Clobbers { if n == nil { return nil } na := n nb := na.Clobbers for nb != nil { nc := nb.Clobbers nb.Clobbers = na na = nb nb = nc } n.Clobbers = nil return na } func (n *Clobbers) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *Clobbers) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Clobbers) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 1: return n.Clobbers.Pos() case 0: return n.Token.Pos() default: panic("internal error") } } // CommaOpt represents data reduced by productions: // // CommaOpt: // /* empty */ // | ',' // Case 1 type CommaOpt struct { Token xc.Token } func (n *CommaOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *CommaOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *CommaOpt) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // CompoundStatement represents data reduced by production: // // CompoundStatement: // '{' BlockItemListOpt '}' type CompoundStatement struct { scope *Bindings // Scope of the CompoundStatement. BlockItemListOpt *BlockItemListOpt Token xc.Token Token2 xc.Token } func (n *CompoundStatement) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *CompoundStatement) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *CompoundStatement) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // ConstantExpression represents data reduced by production: // // ConstantExpression: // Expression type ConstantExpression struct { Type Type // Type of expression. Value interface{} // Non nil for certain constant expressions. toks []xc.Token // Expression *Expression } func (n *ConstantExpression) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ConstantExpression) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ConstantExpression) Pos() token.Pos { if n == nil { return 0 } return n.Expression.Pos() } // ControlLine represents data reduced by productions: // // ControlLine: // PPDEFINE IDENTIFIER ReplacementList // | PPDEFINE IDENTIFIER_LPAREN "..." ')' ReplacementList // Case 1 // | PPDEFINE IDENTIFIER_LPAREN IdentifierList ',' "..." ')' ReplacementList // Case 2 // | PPDEFINE IDENTIFIER_LPAREN IdentifierListOpt ')' ReplacementList // Case 3 // | PPERROR PPTokenListOpt // Case 4 // | PPHASH_NL // Case 5 // | PPINCLUDE PPTokenList '\n' // Case 6 // | PPLINE PPTokenList '\n' // Case 7 // | PPPRAGMA PPTokenListOpt // Case 8 // | PPUNDEF IDENTIFIER '\n' // Case 9 // | PPDEFINE IDENTIFIER_LPAREN IdentifierList "..." ')' ReplacementList // Case 10 // | PPDEFINE '\n' // Case 11 // | PPUNDEF IDENTIFIER PPTokenList '\n' // Case 12 // | PPINCLUDE_NEXT PPTokenList '\n' // Case 13 type ControlLine struct { Case int IdentifierList *IdentifierList IdentifierListOpt *IdentifierListOpt PPTokenList PPTokenList PPTokenListOpt PPTokenList ReplacementList PPTokenList Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token Token5 xc.Token } func (n *ControlLine) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ControlLine) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ControlLine) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // Declaration represents data reduced by productions: // // Declaration: // DeclarationSpecifiers InitDeclaratorListOpt ';' // | StaticAssertDeclaration // Case 1 type Declaration struct { declarator *Declarator // Synthetic declarator when InitDeclaratorListOpt is nil. Case int DeclarationSpecifiers *DeclarationSpecifiers InitDeclaratorListOpt *InitDeclaratorListOpt StaticAssertDeclaration *StaticAssertDeclaration Token xc.Token } func (n *Declaration) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Declaration) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Declaration) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.DeclarationSpecifiers.Pos() case 1: return n.StaticAssertDeclaration.Pos() default: panic("internal error") } } // DeclarationList represents data reduced by productions: // // DeclarationList: // Declaration // | DeclarationList Declaration // Case 1 type DeclarationList struct { Case int Declaration *Declaration DeclarationList *DeclarationList } func (n *DeclarationList) reverse() *DeclarationList { if n == nil { return nil } na := n nb := na.DeclarationList for nb != nil { nc := nb.DeclarationList nb.DeclarationList = na na = nb nb = nc } n.DeclarationList = nil return na } func (n *DeclarationList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *DeclarationList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DeclarationList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Declaration.Pos() case 1: return n.DeclarationList.Pos() default: panic("internal error") } } // DeclarationListOpt represents data reduced by productions: // // DeclarationListOpt: // /* empty */ // | DeclarationList // Case 1 type DeclarationListOpt struct { paramsScope *Bindings DeclarationList *DeclarationList } func (n *DeclarationListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DeclarationListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DeclarationListOpt) Pos() token.Pos { if n == nil { return 0 } return n.DeclarationList.Pos() } // DeclarationSpecifiers represents data reduced by productions: // // DeclarationSpecifiers: // StorageClassSpecifier DeclarationSpecifiersOpt // | TypeSpecifier DeclarationSpecifiersOpt // Case 1 // | TypeQualifier DeclarationSpecifiersOpt // Case 2 // | FunctionSpecifier DeclarationSpecifiersOpt // Case 3 type DeclarationSpecifiers struct { attr int // tsInline, tsTypedefName, ... typeSpecifier int // Encoded combination of tsVoid, tsInt, ... Case int DeclarationSpecifiersOpt *DeclarationSpecifiersOpt FunctionSpecifier *FunctionSpecifier StorageClassSpecifier *StorageClassSpecifier TypeQualifier *TypeQualifier TypeSpecifier *TypeSpecifier } func (n *DeclarationSpecifiers) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DeclarationSpecifiers) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DeclarationSpecifiers) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 3: return n.FunctionSpecifier.Pos() case 0: return n.StorageClassSpecifier.Pos() case 2: return n.TypeQualifier.Pos() case 1: return n.TypeSpecifier.Pos() default: panic("internal error") } } // DeclarationSpecifiersOpt represents data reduced by productions: // // DeclarationSpecifiersOpt: // /* empty */ // | DeclarationSpecifiers // Case 1 type DeclarationSpecifiersOpt struct { attr int // tsInline, tsTypedefName, ... typeSpecifier int // Encoded combination of tsVoid, tsInt, ... DeclarationSpecifiers *DeclarationSpecifiers } func (n *DeclarationSpecifiersOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DeclarationSpecifiersOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DeclarationSpecifiersOpt) Pos() token.Pos { if n == nil { return 0 } return n.DeclarationSpecifiers.Pos() } // Declarator represents data reduced by production: // // Declarator: // PointerOpt DirectDeclarator type Declarator struct { Linkage Linkage Type Type bitFieldType Type bitFieldGroup int bitOffset int bits int offsetOf int padding int specifier Specifier DirectDeclarator *DirectDeclarator PointerOpt *PointerOpt } func (n *Declarator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Declarator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Declarator) Pos() token.Pos { if n == nil { return 0 } if p := n.PointerOpt.Pos(); p != 0 { return p } return n.DirectDeclarator.Pos() } // DeclaratorOpt represents data reduced by productions: // // DeclaratorOpt: // /* empty */ // | Declarator // Case 1 type DeclaratorOpt struct { Declarator *Declarator } func (n *DeclaratorOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DeclaratorOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DeclaratorOpt) Pos() token.Pos { if n == nil { return 0 } return n.Declarator.Pos() } // Designation represents data reduced by production: // // Designation: // DesignatorList '=' type Designation struct { DesignatorList *DesignatorList Token xc.Token } func (n *Designation) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Designation) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Designation) Pos() token.Pos { if n == nil { return 0 } return n.DesignatorList.Pos() } // DesignationOpt represents data reduced by productions: // // DesignationOpt: // /* empty */ // | Designation // Case 1 type DesignationOpt struct { Designation *Designation } func (n *DesignationOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DesignationOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DesignationOpt) Pos() token.Pos { if n == nil { return 0 } return n.Designation.Pos() } // Designator represents data reduced by productions: // // Designator: // '[' ConstantExpression ']' // | '.' IDENTIFIER // Case 1 type Designator struct { Case int ConstantExpression *ConstantExpression Token xc.Token Token2 xc.Token } func (n *Designator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Designator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Designator) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // DesignatorList represents data reduced by productions: // // DesignatorList: // Designator // | DesignatorList Designator // Case 1 type DesignatorList struct { Case int Designator *Designator DesignatorList *DesignatorList } func (n *DesignatorList) reverse() *DesignatorList { if n == nil { return nil } na := n nb := na.DesignatorList for nb != nil { nc := nb.DesignatorList nb.DesignatorList = na na = nb nb = nc } n.DesignatorList = nil return na } func (n *DesignatorList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *DesignatorList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DesignatorList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Designator.Pos() case 1: return n.DesignatorList.Pos() default: panic("internal error") } } // DirectAbstractDeclarator represents data reduced by productions: // // DirectAbstractDeclarator: // '(' AbstractDeclarator ')' // | DirectAbstractDeclaratorOpt '[' ExpressionOpt ']' // Case 1 // | DirectAbstractDeclaratorOpt '[' TypeQualifierList ExpressionOpt ']' // Case 2 // | DirectAbstractDeclaratorOpt '[' "static" TypeQualifierListOpt Expression ']' // Case 3 // | DirectAbstractDeclaratorOpt '[' TypeQualifierList "static" Expression ']' // Case 4 // | DirectAbstractDeclaratorOpt '[' '*' ']' // Case 5 // | '(' ParameterTypeListOpt ')' // Case 6 // | DirectAbstractDeclarator '(' ParameterTypeListOpt ')' // Case 7 type DirectAbstractDeclarator struct { directDeclarator *DirectDeclarator paramsScope *Bindings AbstractDeclarator *AbstractDeclarator Case int DirectAbstractDeclarator *DirectAbstractDeclarator DirectAbstractDeclaratorOpt *DirectAbstractDeclaratorOpt Expression *Expression ExpressionOpt *ExpressionOpt ParameterTypeListOpt *ParameterTypeListOpt Token xc.Token Token2 xc.Token Token3 xc.Token TypeQualifierList *TypeQualifierList TypeQualifierListOpt *TypeQualifierListOpt } func (n *DirectAbstractDeclarator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DirectAbstractDeclarator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DirectAbstractDeclarator) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 7: return n.DirectAbstractDeclarator.Pos() case 1, 2, 3, 4, 5: if p := n.DirectAbstractDeclaratorOpt.Pos(); p != 0 { return p } return n.Token.Pos() case 0, 6: return n.Token.Pos() default: panic("internal error") } } // DirectAbstractDeclaratorOpt represents data reduced by productions: // // DirectAbstractDeclaratorOpt: // /* empty */ // | DirectAbstractDeclarator // Case 1 type DirectAbstractDeclaratorOpt struct { DirectAbstractDeclarator *DirectAbstractDeclarator } func (n *DirectAbstractDeclaratorOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DirectAbstractDeclaratorOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DirectAbstractDeclaratorOpt) Pos() token.Pos { if n == nil { return 0 } return n.DirectAbstractDeclarator.Pos() } // DirectDeclarator represents data reduced by productions: // // DirectDeclarator: // IDENTIFIER // | '(' Declarator ')' // Case 1 // | DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' // Case 2 // | DirectDeclarator '[' "static" TypeQualifierListOpt Expression ']' // Case 3 // | DirectDeclarator '[' TypeQualifierList "static" Expression ']' // Case 4 // | DirectDeclarator '[' TypeQualifierListOpt '*' ']' // Case 5 // | DirectDeclarator '(' ParameterTypeList ')' // Case 6 // | DirectDeclarator '(' IdentifierListOpt ')' // Case 7 type DirectDeclarator struct { EnumVal interface{} // Non nil if DD declares an enumeration constant. declarator *Declarator elements int idScope *Bindings // Of case 0: IDENTIFIER. paramsScope *Bindings parent *DirectDeclarator prev *Binding // Existing declaration in same scope, if any. specifier Specifier visible *Binding // Existing declaration of same ident visible in same scope, if any and this DD has storage class extrn. Case int Declarator *Declarator DirectDeclarator *DirectDeclarator Expression *Expression ExpressionOpt *ExpressionOpt IdentifierListOpt *IdentifierListOpt ParameterTypeList *ParameterTypeList Token xc.Token Token2 xc.Token Token3 xc.Token TypeQualifierList *TypeQualifierList TypeQualifierListOpt *TypeQualifierListOpt } func (n *DirectDeclarator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DirectDeclarator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DirectDeclarator) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 2, 3, 4, 5, 6, 7: return n.DirectDeclarator.Pos() case 0, 1: return n.Token.Pos() default: panic("internal error") } } // ElifGroup represents data reduced by production: // // ElifGroup: // PPELIF PPTokenList '\n' GroupListOpt type ElifGroup struct { GroupListOpt *GroupListOpt PPTokenList PPTokenList Token xc.Token Token2 xc.Token } func (n *ElifGroup) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ElifGroup) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ElifGroup) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // ElifGroupList represents data reduced by productions: // // ElifGroupList: // ElifGroup // | ElifGroupList ElifGroup // Case 1 type ElifGroupList struct { Case int ElifGroup *ElifGroup ElifGroupList *ElifGroupList } func (n *ElifGroupList) reverse() *ElifGroupList { if n == nil { return nil } na := n nb := na.ElifGroupList for nb != nil { nc := nb.ElifGroupList nb.ElifGroupList = na na = nb nb = nc } n.ElifGroupList = nil return na } func (n *ElifGroupList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *ElifGroupList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ElifGroupList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.ElifGroup.Pos() case 1: return n.ElifGroupList.Pos() default: panic("internal error") } } // ElifGroupListOpt represents data reduced by productions: // // ElifGroupListOpt: // /* empty */ // | ElifGroupList // Case 1 type ElifGroupListOpt struct { ElifGroupList *ElifGroupList } func (n *ElifGroupListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ElifGroupListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ElifGroupListOpt) Pos() token.Pos { if n == nil { return 0 } return n.ElifGroupList.Pos() } // ElseGroup represents data reduced by production: // // ElseGroup: // PPELSE '\n' GroupListOpt type ElseGroup struct { GroupListOpt *GroupListOpt Token xc.Token Token2 xc.Token } func (n *ElseGroup) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ElseGroup) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ElseGroup) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // ElseGroupOpt represents data reduced by productions: // // ElseGroupOpt: // /* empty */ // | ElseGroup // Case 1 type ElseGroupOpt struct { ElseGroup *ElseGroup } func (n *ElseGroupOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ElseGroupOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ElseGroupOpt) Pos() token.Pos { if n == nil { return 0 } return n.ElseGroup.Pos() } // EndifLine represents data reduced by production: // // EndifLine: // PPENDIF type EndifLine struct { Token xc.Token } func (n *EndifLine) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *EndifLine) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *EndifLine) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // EnumSpecifier represents data reduced by productions: // // EnumSpecifier: // "enum" IdentifierOpt '{' EnumeratorList CommaOpt '}' // | "enum" IDENTIFIER // Case 1 type EnumSpecifier struct { unsigned bool Case int CommaOpt *CommaOpt EnumeratorList *EnumeratorList IdentifierOpt *IdentifierOpt Token xc.Token Token2 xc.Token Token3 xc.Token } func (n *EnumSpecifier) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *EnumSpecifier) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *EnumSpecifier) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // EnumerationConstant represents data reduced by production: // // EnumerationConstant: // IDENTIFIER type EnumerationConstant struct { Token xc.Token } func (n *EnumerationConstant) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *EnumerationConstant) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *EnumerationConstant) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // Enumerator represents data reduced by productions: // // Enumerator: // EnumerationConstant // | EnumerationConstant '=' ConstantExpression // Case 1 type Enumerator struct { Value interface{} // Enumerator's value. Case int ConstantExpression *ConstantExpression EnumerationConstant *EnumerationConstant Token xc.Token } func (n *Enumerator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Enumerator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Enumerator) Pos() token.Pos { if n == nil { return 0 } return n.EnumerationConstant.Pos() } // EnumeratorList represents data reduced by productions: // // EnumeratorList: // Enumerator // | EnumeratorList ',' Enumerator // Case 1 type EnumeratorList struct { Case int Enumerator *Enumerator EnumeratorList *EnumeratorList Token xc.Token } func (n *EnumeratorList) reverse() *EnumeratorList { if n == nil { return nil } na := n nb := na.EnumeratorList for nb != nil { nc := nb.EnumeratorList nb.EnumeratorList = na na = nb nb = nc } n.EnumeratorList = nil return na } func (n *EnumeratorList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *EnumeratorList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *EnumeratorList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Enumerator.Pos() case 1: return n.EnumeratorList.Pos() default: panic("internal error") } } // Expression represents data reduced by productions: // // Expression: // IDENTIFIER // | CHARCONST // Case 1 // | FLOATCONST // Case 2 // | INTCONST // Case 3 // | LONGCHARCONST // Case 4 // | LONGSTRINGLITERAL // Case 5 // | STRINGLITERAL // Case 6 // | '(' ExpressionList ')' // Case 7 // | Expression '[' ExpressionList ']' // Case 8 // | Expression '(' ArgumentExpressionListOpt ')' // Case 9 // | Expression '.' IDENTIFIER // Case 10 // | Expression "->" IDENTIFIER // Case 11 // | Expression "++" // Case 12 // | Expression "--" // Case 13 // | '(' TypeName ')' '{' InitializerList CommaOpt '}' // Case 14 // | "++" Expression // Case 15 // | "--" Expression // Case 16 // | '&' Expression // Case 17 // | '*' Expression // Case 18 // | '+' Expression // Case 19 // | '-' Expression // Case 20 // | '~' Expression // Case 21 // | '!' Expression // Case 22 // | "sizeof" Expression // Case 23 // | "sizeof" '(' TypeName ')' // Case 24 // | '(' TypeName ')' Expression // Case 25 // | Expression '*' Expression // Case 26 // | Expression '/' Expression // Case 27 // | Expression '%' Expression // Case 28 // | Expression '+' Expression // Case 29 // | Expression '-' Expression // Case 30 // | Expression "<<" Expression // Case 31 // | Expression ">>" Expression // Case 32 // | Expression '<' Expression // Case 33 // | Expression '>' Expression // Case 34 // | Expression "<=" Expression // Case 35 // | Expression ">=" Expression // Case 36 // | Expression "==" Expression // Case 37 // | Expression "!=" Expression // Case 38 // | Expression '&' Expression // Case 39 // | Expression '^' Expression // Case 40 // | Expression '|' Expression // Case 41 // | Expression "&&" Expression // Case 42 // | Expression "||" Expression // Case 43 // | Expression '?' ExpressionList ':' Expression // Case 44 // | Expression '=' Expression // Case 45 // | Expression "*=" Expression // Case 46 // | Expression "/=" Expression // Case 47 // | Expression "%=" Expression // Case 48 // | Expression "+=" Expression // Case 49 // | Expression "-=" Expression // Case 50 // | Expression "<<=" Expression // Case 51 // | Expression ">>=" Expression // Case 52 // | Expression "&=" Expression // Case 53 // | Expression "^=" Expression // Case 54 // | Expression "|=" Expression // Case 55 // | "_Alignof" '(' TypeName ')' // Case 56 // | '(' CompoundStatement ')' // Case 57 // | "&&" IDENTIFIER // Case 58 // | Expression '?' ':' Expression // Case 59 type Expression struct { BinOpType Type // The type operands of binary expression are coerced into, if different from Type. Type Type // Type of expression. Value interface{} // Non nil for certain constant expressions. scope *Bindings // Case 0: IDENTIFIER resolution scope. ArgumentExpressionListOpt *ArgumentExpressionListOpt Case int CommaOpt *CommaOpt CompoundStatement *CompoundStatement Expression *Expression Expression2 *Expression ExpressionList *ExpressionList InitializerList *InitializerList Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token TypeName *TypeName } func (n *Expression) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Expression) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Expression) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 8, 9, 10, 11, 12, 13, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 59: return n.Expression.Pos() case 0, 1, 2, 3, 4, 5, 6, 7, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 56, 57, 58: return n.Token.Pos() default: panic("internal error") } } // ExpressionList represents data reduced by productions: // // ExpressionList: // Expression // | ExpressionList ',' Expression // Case 1 type ExpressionList struct { Type Type // Type of expression. Value interface{} // Non nil for certain constant expressions. Case int Expression *Expression ExpressionList *ExpressionList Token xc.Token } func (n *ExpressionList) reverse() *ExpressionList { if n == nil { return nil } na := n nb := na.ExpressionList for nb != nil { nc := nb.ExpressionList nb.ExpressionList = na na = nb nb = nc } n.ExpressionList = nil return na } func (n *ExpressionList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *ExpressionList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ExpressionList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Expression.Pos() case 1: return n.ExpressionList.Pos() default: panic("internal error") } } // ExpressionListOpt represents data reduced by productions: // // ExpressionListOpt: // /* empty */ // | ExpressionList // Case 1 type ExpressionListOpt struct { ExpressionList *ExpressionList } func (n *ExpressionListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ExpressionListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ExpressionListOpt) Pos() token.Pos { if n == nil { return 0 } return n.ExpressionList.Pos() } // ExpressionOpt represents data reduced by productions: // // ExpressionOpt: // /* empty */ // | Expression // Case 1 type ExpressionOpt struct { Expression *Expression } func (n *ExpressionOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ExpressionOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ExpressionOpt) Pos() token.Pos { if n == nil { return 0 } return n.Expression.Pos() } // ExpressionStatement represents data reduced by production: // // ExpressionStatement: // ExpressionListOpt ';' type ExpressionStatement struct { ExpressionListOpt *ExpressionListOpt Token xc.Token } func (n *ExpressionStatement) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ExpressionStatement) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ExpressionStatement) Pos() token.Pos { if n == nil { return 0 } if p := n.ExpressionListOpt.Pos(); p != 0 { return p } return n.Token.Pos() } // ExternalDeclaration represents data reduced by productions: // // ExternalDeclaration: // FunctionDefinition // | Declaration // Case 1 // | BasicAssemblerStatement ';' // Case 2 // | ';' // Case 3 type ExternalDeclaration struct { BasicAssemblerStatement *BasicAssemblerStatement Case int Declaration *Declaration FunctionDefinition *FunctionDefinition Token xc.Token } func (n *ExternalDeclaration) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ExternalDeclaration) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ExternalDeclaration) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 2: return n.BasicAssemblerStatement.Pos() case 1: return n.Declaration.Pos() case 0: return n.FunctionDefinition.Pos() case 3: return n.Token.Pos() default: panic("internal error") } } // FunctionBody represents data reduced by productions: // // FunctionBody: // CompoundStatement // | AssemblerStatement ';' // Case 1 type FunctionBody struct { scope *Bindings // Scope of the FunctionBody. AssemblerStatement *AssemblerStatement Case int CompoundStatement *CompoundStatement Token xc.Token } func (n *FunctionBody) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *FunctionBody) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *FunctionBody) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 1: return n.AssemblerStatement.Pos() case 0: return n.CompoundStatement.Pos() default: panic("internal error") } } // FunctionDefinition represents data reduced by productions: // // FunctionDefinition: // DeclarationSpecifiers Declarator DeclarationListOpt FunctionBody // | Declarator DeclarationListOpt FunctionBody // Case 1 type FunctionDefinition struct { Case int DeclarationListOpt *DeclarationListOpt DeclarationSpecifiers *DeclarationSpecifiers Declarator *Declarator FunctionBody *FunctionBody } func (n *FunctionDefinition) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *FunctionDefinition) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *FunctionDefinition) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.DeclarationSpecifiers.Pos() case 1: return n.Declarator.Pos() default: panic("internal error") } } // FunctionSpecifier represents data reduced by productions: // // FunctionSpecifier: // "inline" // | "_Noreturn" // Case 1 type FunctionSpecifier struct { attr int // tsInline, tsTypedefName, ... Case int Token xc.Token } func (n *FunctionSpecifier) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *FunctionSpecifier) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *FunctionSpecifier) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // GroupList represents data reduced by productions: // // GroupList: // GroupPart // | GroupList GroupPart // Case 1 type GroupList struct { Case int GroupList *GroupList GroupPart Node } func (n *GroupList) reverse() *GroupList { if n == nil { return nil } na := n nb := na.GroupList for nb != nil { nc := nb.GroupList nb.GroupList = na na = nb nb = nc } n.GroupList = nil return na } func (n *GroupList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *GroupList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *GroupList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 1: return n.GroupList.Pos() case 0: return n.GroupPart.Pos() default: panic("internal error") } } // GroupListOpt represents data reduced by productions: // // GroupListOpt: // /* empty */ // | GroupList // Case 1 type GroupListOpt struct { GroupList *GroupList } func (n *GroupListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *GroupListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *GroupListOpt) Pos() token.Pos { if n == nil { return 0 } return n.GroupList.Pos() } // IdentifierList represents data reduced by productions: // // IdentifierList: // IDENTIFIER // | IdentifierList ',' IDENTIFIER // Case 1 type IdentifierList struct { Case int IdentifierList *IdentifierList Token xc.Token Token2 xc.Token } func (n *IdentifierList) reverse() *IdentifierList { if n == nil { return nil } na := n nb := na.IdentifierList for nb != nil { nc := nb.IdentifierList nb.IdentifierList = na na = nb nb = nc } n.IdentifierList = nil return na } func (n *IdentifierList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *IdentifierList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *IdentifierList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 1: return n.IdentifierList.Pos() case 0: return n.Token.Pos() default: panic("internal error") } } // IdentifierListOpt represents data reduced by productions: // // IdentifierListOpt: // /* empty */ // | IdentifierList // Case 1 type IdentifierListOpt struct { params []Parameter IdentifierList *IdentifierList } func (n *IdentifierListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *IdentifierListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *IdentifierListOpt) Pos() token.Pos { if n == nil { return 0 } return n.IdentifierList.Pos() } // IdentifierOpt represents data reduced by productions: // // IdentifierOpt: // /* empty */ // | IDENTIFIER // Case 1 type IdentifierOpt struct { Token xc.Token } func (n *IdentifierOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *IdentifierOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *IdentifierOpt) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // IfGroup represents data reduced by productions: // // IfGroup: // PPIF PPTokenList '\n' GroupListOpt // | PPIFDEF IDENTIFIER '\n' GroupListOpt // Case 1 // | PPIFNDEF IDENTIFIER '\n' GroupListOpt // Case 2 type IfGroup struct { Case int GroupListOpt *GroupListOpt PPTokenList PPTokenList Token xc.Token Token2 xc.Token Token3 xc.Token } func (n *IfGroup) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *IfGroup) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *IfGroup) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // IfSection represents data reduced by production: // // IfSection: // IfGroup ElifGroupListOpt ElseGroupOpt EndifLine type IfSection struct { ElifGroupListOpt *ElifGroupListOpt ElseGroupOpt *ElseGroupOpt EndifLine *EndifLine IfGroup *IfGroup } func (n *IfSection) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *IfSection) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *IfSection) Pos() token.Pos { if n == nil { return 0 } return n.IfGroup.Pos() } // InitDeclarator represents data reduced by productions: // // InitDeclarator: // Declarator // | Declarator '=' Initializer // Case 1 type InitDeclarator struct { Case int Declarator *Declarator Initializer *Initializer Token xc.Token } func (n *InitDeclarator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *InitDeclarator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *InitDeclarator) Pos() token.Pos { if n == nil { return 0 } return n.Declarator.Pos() } // InitDeclaratorList represents data reduced by productions: // // InitDeclaratorList: // InitDeclarator // | InitDeclaratorList ',' InitDeclarator // Case 1 type InitDeclaratorList struct { Case int InitDeclarator *InitDeclarator InitDeclaratorList *InitDeclaratorList Token xc.Token } func (n *InitDeclaratorList) reverse() *InitDeclaratorList { if n == nil { return nil } na := n nb := na.InitDeclaratorList for nb != nil { nc := nb.InitDeclaratorList nb.InitDeclaratorList = na na = nb nb = nc } n.InitDeclaratorList = nil return na } func (n *InitDeclaratorList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *InitDeclaratorList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *InitDeclaratorList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.InitDeclarator.Pos() case 1: return n.InitDeclaratorList.Pos() default: panic("internal error") } } // InitDeclaratorListOpt represents data reduced by productions: // // InitDeclaratorListOpt: // /* empty */ // | InitDeclaratorList // Case 1 type InitDeclaratorListOpt struct { InitDeclaratorList *InitDeclaratorList } func (n *InitDeclaratorListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *InitDeclaratorListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *InitDeclaratorListOpt) Pos() token.Pos { if n == nil { return 0 } return n.InitDeclaratorList.Pos() } // Initializer represents data reduced by productions: // // Initializer: // Expression // | '{' InitializerList CommaOpt '}' // Case 1 // | IDENTIFIER ':' Initializer // Case 2 type Initializer struct { Case int CommaOpt *CommaOpt Expression *Expression Initializer *Initializer InitializerList *InitializerList Token xc.Token Token2 xc.Token } func (n *Initializer) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Initializer) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Initializer) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Expression.Pos() case 1, 2: return n.Token.Pos() default: panic("internal error") } } // InitializerList represents data reduced by productions: // // InitializerList: // DesignationOpt Initializer // | InitializerList ',' DesignationOpt Initializer // Case 1 // | /* empty */ // Case 2 type InitializerList struct { Case int DesignationOpt *DesignationOpt Initializer *Initializer InitializerList *InitializerList Token xc.Token } func (n *InitializerList) reverse() *InitializerList { if n == nil { return nil } na := n nb := na.InitializerList for nb != nil { nc := nb.InitializerList nb.InitializerList = na na = nb nb = nc } n.InitializerList = nil return na } func (n *InitializerList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *InitializerList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *InitializerList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 2: return 0 case 0: if p := n.DesignationOpt.Pos(); p != 0 { return p } return n.Initializer.Pos() case 1: if p := n.InitializerList.Pos(); p != 0 { return p } return n.Token.Pos() default: panic("internal error") } } // IterationStatement represents data reduced by productions: // // IterationStatement: // "while" '(' ExpressionList ')' Statement // | "do" Statement "while" '(' ExpressionList ')' ';' // Case 1 // | "for" '(' ExpressionListOpt ';' ExpressionListOpt ';' ExpressionListOpt ')' Statement // Case 2 // | "for" '(' Declaration ExpressionListOpt ';' ExpressionListOpt ')' Statement // Case 3 type IterationStatement struct { Case int Declaration *Declaration ExpressionList *ExpressionList ExpressionListOpt *ExpressionListOpt ExpressionListOpt2 *ExpressionListOpt ExpressionListOpt3 *ExpressionListOpt Statement *Statement Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token Token5 xc.Token } func (n *IterationStatement) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *IterationStatement) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *IterationStatement) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // JumpStatement represents data reduced by productions: // // JumpStatement: // "goto" IDENTIFIER ';' // | "continue" ';' // Case 1 // | "break" ';' // Case 2 // | "return" ExpressionListOpt ';' // Case 3 // | "goto" Expression ';' // Case 4 type JumpStatement struct { Case int Expression *Expression ExpressionListOpt *ExpressionListOpt Token xc.Token Token2 xc.Token Token3 xc.Token } func (n *JumpStatement) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *JumpStatement) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *JumpStatement) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // LabeledStatement represents data reduced by productions: // // LabeledStatement: // IDENTIFIER ':' Statement // | "case" ConstantExpression ':' Statement // Case 1 // | "default" ':' Statement // Case 2 type LabeledStatement struct { Case int ConstantExpression *ConstantExpression Statement *Statement Token xc.Token Token2 xc.Token } func (n *LabeledStatement) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *LabeledStatement) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *LabeledStatement) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // ParameterDeclaration represents data reduced by productions: // // ParameterDeclaration: // DeclarationSpecifiers Declarator // | DeclarationSpecifiers AbstractDeclaratorOpt // Case 1 type ParameterDeclaration struct { declarator *Declarator AbstractDeclaratorOpt *AbstractDeclaratorOpt Case int DeclarationSpecifiers *DeclarationSpecifiers Declarator *Declarator } func (n *ParameterDeclaration) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ParameterDeclaration) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ParameterDeclaration) Pos() token.Pos { if n == nil { return 0 } return n.DeclarationSpecifiers.Pos() } // ParameterList represents data reduced by productions: // // ParameterList: // ParameterDeclaration // | ParameterList ',' ParameterDeclaration // Case 1 type ParameterList struct { Case int ParameterDeclaration *ParameterDeclaration ParameterList *ParameterList Token xc.Token } func (n *ParameterList) reverse() *ParameterList { if n == nil { return nil } na := n nb := na.ParameterList for nb != nil { nc := nb.ParameterList nb.ParameterList = na na = nb nb = nc } n.ParameterList = nil return na } func (n *ParameterList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *ParameterList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ParameterList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.ParameterDeclaration.Pos() case 1: return n.ParameterList.Pos() default: panic("internal error") } } // ParameterTypeList represents data reduced by productions: // // ParameterTypeList: // ParameterList // | ParameterList ',' "..." // Case 1 type ParameterTypeList struct { params []Parameter Case int ParameterList *ParameterList Token xc.Token Token2 xc.Token } func (n *ParameterTypeList) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ParameterTypeList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ParameterTypeList) Pos() token.Pos { if n == nil { return 0 } return n.ParameterList.Pos() } // ParameterTypeListOpt represents data reduced by productions: // // ParameterTypeListOpt: // /* empty */ // | ParameterTypeList // Case 1 type ParameterTypeListOpt struct { ParameterTypeList *ParameterTypeList } func (n *ParameterTypeListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ParameterTypeListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ParameterTypeListOpt) Pos() token.Pos { if n == nil { return 0 } return n.ParameterTypeList.Pos() } // Pointer represents data reduced by productions: // // Pointer: // '*' TypeQualifierListOpt // | '*' TypeQualifierListOpt Pointer // Case 1 type Pointer struct { Case int Pointer *Pointer Token xc.Token TypeQualifierListOpt *TypeQualifierListOpt } func (n *Pointer) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Pointer) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Pointer) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // PointerOpt represents data reduced by productions: // // PointerOpt: // /* empty */ // | Pointer // Case 1 type PointerOpt struct { Pointer *Pointer } func (n *PointerOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *PointerOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *PointerOpt) Pos() token.Pos { if n == nil { return 0 } return n.Pointer.Pos() } // PreprocessingFile represents data reduced by production: // // PreprocessingFile: // GroupList type PreprocessingFile struct { path string GroupList *GroupList } func (n *PreprocessingFile) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *PreprocessingFile) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *PreprocessingFile) Pos() token.Pos { if n == nil { return 0 } return n.GroupList.Pos() } // SelectionStatement represents data reduced by productions: // // SelectionStatement: // "if" '(' ExpressionList ')' Statement // | "if" '(' ExpressionList ')' Statement "else" Statement // Case 1 // | "switch" '(' ExpressionList ')' Statement // Case 2 type SelectionStatement struct { Case int ExpressionList *ExpressionList Statement *Statement Statement2 *Statement Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token } func (n *SelectionStatement) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *SelectionStatement) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *SelectionStatement) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // SpecifierQualifierList represents data reduced by productions: // // SpecifierQualifierList: // TypeSpecifier SpecifierQualifierListOpt // | TypeQualifier SpecifierQualifierListOpt // Case 1 type SpecifierQualifierList struct { attr int // tsInline, tsTypedefName, ... typeSpecifier int // Encoded combination of tsVoid, tsInt, ... Case int SpecifierQualifierListOpt *SpecifierQualifierListOpt TypeQualifier *TypeQualifier TypeSpecifier *TypeSpecifier } func (n *SpecifierQualifierList) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *SpecifierQualifierList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *SpecifierQualifierList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 1: return n.TypeQualifier.Pos() case 0: return n.TypeSpecifier.Pos() default: panic("internal error") } } // SpecifierQualifierListOpt represents data reduced by productions: // // SpecifierQualifierListOpt: // /* empty */ // | SpecifierQualifierList // Case 1 type SpecifierQualifierListOpt struct { attr int // tsInline, tsTypedefName, ... typeSpecifier int // Encoded combination of tsVoid, tsInt, ... SpecifierQualifierList *SpecifierQualifierList } func (n *SpecifierQualifierListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *SpecifierQualifierListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *SpecifierQualifierListOpt) Pos() token.Pos { if n == nil { return 0 } return n.SpecifierQualifierList.Pos() } // Statement represents data reduced by productions: // // Statement: // LabeledStatement // | CompoundStatement // Case 1 // | ExpressionStatement // Case 2 // | SelectionStatement // Case 3 // | IterationStatement // Case 4 // | JumpStatement // Case 5 // | AssemblerStatement // Case 6 type Statement struct { AssemblerStatement *AssemblerStatement Case int CompoundStatement *CompoundStatement ExpressionStatement *ExpressionStatement IterationStatement *IterationStatement JumpStatement *JumpStatement LabeledStatement *LabeledStatement SelectionStatement *SelectionStatement } func (n *Statement) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Statement) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Statement) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 6: return n.AssemblerStatement.Pos() case 1: return n.CompoundStatement.Pos() case 2: return n.ExpressionStatement.Pos() case 4: return n.IterationStatement.Pos() case 5: return n.JumpStatement.Pos() case 0: return n.LabeledStatement.Pos() case 3: return n.SelectionStatement.Pos() default: panic("internal error") } } // StaticAssertDeclaration represents data reduced by production: // // StaticAssertDeclaration: // "_Static_assert" '(' ConstantExpression ',' STRINGLITERAL ')' ';' type StaticAssertDeclaration struct { ConstantExpression *ConstantExpression Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token Token5 xc.Token Token6 xc.Token } func (n *StaticAssertDeclaration) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *StaticAssertDeclaration) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StaticAssertDeclaration) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // StorageClassSpecifier represents data reduced by productions: // // StorageClassSpecifier: // "typedef" // | "extern" // Case 1 // | "static" // Case 2 // | "auto" // Case 3 // | "register" // Case 4 type StorageClassSpecifier struct { attr int Case int Token xc.Token } func (n *StorageClassSpecifier) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *StorageClassSpecifier) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StorageClassSpecifier) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // StructDeclaration represents data reduced by productions: // // StructDeclaration: // SpecifierQualifierList StructDeclaratorList ';' // | SpecifierQualifierList ';' // Case 1 // | StaticAssertDeclaration // Case 2 type StructDeclaration struct { Case int SpecifierQualifierList *SpecifierQualifierList StaticAssertDeclaration *StaticAssertDeclaration StructDeclaratorList *StructDeclaratorList Token xc.Token } func (n *StructDeclaration) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *StructDeclaration) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StructDeclaration) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0, 1: return n.SpecifierQualifierList.Pos() case 2: return n.StaticAssertDeclaration.Pos() default: panic("internal error") } } // StructDeclarationList represents data reduced by productions: // // StructDeclarationList: // StructDeclaration // | StructDeclarationList StructDeclaration // Case 1 type StructDeclarationList struct { Case int StructDeclaration *StructDeclaration StructDeclarationList *StructDeclarationList } func (n *StructDeclarationList) reverse() *StructDeclarationList { if n == nil { return nil } na := n nb := na.StructDeclarationList for nb != nil { nc := nb.StructDeclarationList nb.StructDeclarationList = na na = nb nb = nc } n.StructDeclarationList = nil return na } func (n *StructDeclarationList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *StructDeclarationList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StructDeclarationList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.StructDeclaration.Pos() case 1: return n.StructDeclarationList.Pos() default: panic("internal error") } } // StructDeclarator represents data reduced by productions: // // StructDeclarator: // Declarator // | DeclaratorOpt ':' ConstantExpression // Case 1 type StructDeclarator struct { Case int ConstantExpression *ConstantExpression Declarator *Declarator DeclaratorOpt *DeclaratorOpt Token xc.Token } func (n *StructDeclarator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *StructDeclarator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StructDeclarator) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Declarator.Pos() case 1: if p := n.DeclaratorOpt.Pos(); p != 0 { return p } return n.Token.Pos() default: panic("internal error") } } // StructDeclaratorList represents data reduced by productions: // // StructDeclaratorList: // StructDeclarator // | StructDeclaratorList ',' StructDeclarator // Case 1 type StructDeclaratorList struct { Case int StructDeclarator *StructDeclarator StructDeclaratorList *StructDeclaratorList Token xc.Token } func (n *StructDeclaratorList) reverse() *StructDeclaratorList { if n == nil { return nil } na := n nb := na.StructDeclaratorList for nb != nil { nc := nb.StructDeclaratorList nb.StructDeclaratorList = na na = nb nb = nc } n.StructDeclaratorList = nil return na } func (n *StructDeclaratorList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *StructDeclaratorList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StructDeclaratorList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.StructDeclarator.Pos() case 1: return n.StructDeclaratorList.Pos() default: panic("internal error") } } // StructOrUnion represents data reduced by productions: // // StructOrUnion: // "struct" // | "union" // Case 1 type StructOrUnion struct { Case int Token xc.Token } func (n *StructOrUnion) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *StructOrUnion) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StructOrUnion) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // StructOrUnionSpecifier represents data reduced by productions: // // StructOrUnionSpecifier: // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' // | StructOrUnion IDENTIFIER // Case 1 // | StructOrUnion IdentifierOpt '{' '}' // Case 2 type StructOrUnionSpecifier struct { alignOf int declarator *Declarator // Synthetic declarator when tagged struct/union defined inline. scope *Bindings sizeOf int Case int IdentifierOpt *IdentifierOpt StructDeclarationList *StructDeclarationList StructOrUnion *StructOrUnion Token xc.Token Token2 xc.Token } func (n *StructOrUnionSpecifier) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *StructOrUnionSpecifier) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StructOrUnionSpecifier) Pos() token.Pos { if n == nil { return 0 } return n.StructOrUnion.Pos() } // TranslationUnit represents data reduced by productions: // // TranslationUnit: // ExternalDeclaration // | TranslationUnit ExternalDeclaration // Case 1 type TranslationUnit struct { Comments map[token.Pos]int // Position -> comment ID. Enable using the KeepComments option. Declarations *Bindings Macros map[int]*Macro // Ident ID -> preprocessor macro defined by ident. Model *Model // Model used to parse the TranslationUnit. Case int ExternalDeclaration *ExternalDeclaration TranslationUnit *TranslationUnit } func (n *TranslationUnit) reverse() *TranslationUnit { if n == nil { return nil } na := n nb := na.TranslationUnit for nb != nil { nc := nb.TranslationUnit nb.TranslationUnit = na na = nb nb = nc } n.TranslationUnit = nil return na } func (n *TranslationUnit) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *TranslationUnit) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *TranslationUnit) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.ExternalDeclaration.Pos() case 1: return n.TranslationUnit.Pos() default: panic("internal error") } } // TypeName represents data reduced by production: // // TypeName: // SpecifierQualifierList AbstractDeclaratorOpt type TypeName struct { Type Type declarator *Declarator scope *Bindings AbstractDeclaratorOpt *AbstractDeclaratorOpt SpecifierQualifierList *SpecifierQualifierList } func (n *TypeName) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *TypeName) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *TypeName) Pos() token.Pos { if n == nil { return 0 } return n.SpecifierQualifierList.Pos() } // TypeQualifier represents data reduced by productions: // // TypeQualifier: // "const" // | "restrict" // Case 1 // | "volatile" // Case 2 type TypeQualifier struct { attr int // tsInline, tsTypedefName, ... Case int Token xc.Token } func (n *TypeQualifier) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *TypeQualifier) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *TypeQualifier) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // TypeQualifierList represents data reduced by productions: // // TypeQualifierList: // TypeQualifier // | TypeQualifierList TypeQualifier // Case 1 type TypeQualifierList struct { attr int // tsInline, tsTypedefName, ... Case int TypeQualifier *TypeQualifier TypeQualifierList *TypeQualifierList } func (n *TypeQualifierList) reverse() *TypeQualifierList { if n == nil { return nil } na := n nb := na.TypeQualifierList for nb != nil { nc := nb.TypeQualifierList nb.TypeQualifierList = na na = nb nb = nc } n.TypeQualifierList = nil return na } func (n *TypeQualifierList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *TypeQualifierList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *TypeQualifierList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.TypeQualifier.Pos() case 1: return n.TypeQualifierList.Pos() default: panic("internal error") } } // TypeQualifierListOpt represents data reduced by productions: // // TypeQualifierListOpt: // /* empty */ // | TypeQualifierList // Case 1 type TypeQualifierListOpt struct { TypeQualifierList *TypeQualifierList } func (n *TypeQualifierListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *TypeQualifierListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *TypeQualifierListOpt) Pos() token.Pos { if n == nil { return 0 } return n.TypeQualifierList.Pos() } // TypeSpecifier represents data reduced by productions: // // TypeSpecifier: // "void" // | "char" // Case 1 // | "short" // Case 2 // | "int" // Case 3 // | "long" // Case 4 // | "float" // Case 5 // | "double" // Case 6 // | "signed" // Case 7 // | "unsigned" // Case 8 // | "_Bool" // Case 9 // | "_Complex" // Case 10 // | StructOrUnionSpecifier // Case 11 // | EnumSpecifier // Case 12 // | TYPEDEFNAME // Case 13 // | "typeof" '(' Expression ')' // Case 14 // | "typeof" '(' TypeName ')' // Case 15 type TypeSpecifier struct { scope *Bindings // If case TYPEDEFNAME. typeSpecifier int // Encoded combination of tsVoid, tsInt, ... Type Type // Type of typeof. Case int EnumSpecifier *EnumSpecifier Expression *Expression StructOrUnionSpecifier *StructOrUnionSpecifier Token xc.Token Token2 xc.Token Token3 xc.Token TypeName *TypeName } func (n *TypeSpecifier) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *TypeSpecifier) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *TypeSpecifier) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 12: return n.EnumSpecifier.Pos() case 11: return n.StructOrUnionSpecifier.Pos() case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15: return n.Token.Pos() default: panic("internal error") } } // VolatileOpt represents data reduced by productions: // // VolatileOpt: // /* empty */ // | "volatile" // Case 1 type VolatileOpt struct { Token xc.Token } func (n *VolatileOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *VolatileOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *VolatileOpt) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } ================================================ FILE: ast2.go ================================================ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "fmt" "go/token" "strconv" "strings" "github.com/cznic/golex/lex" "github.com/cznic/mathutil" "github.com/cznic/xc" ) type operand interface { eval(*lexer) (value interface{}, typ Type) Node } // Node represents an AST node. type Node interface { Pos() token.Pos } // ---------------------------------------------------------- CompoundStatement // Scope returns n's scope. func (n *CompoundStatement) Scope() *Bindings { return n.scope } // ---------------------------------------------------------------- Declaration // Declarator returns a synthetic Declarator when n.InitDeclaratorListOpt is // nil. func (n *Declaration) Declarator() *Declarator { return n.declarator } // ------------------------------------------------------ DeclarationSpecifiers // IsInline implements specifier. func (n *DeclarationSpecifiers) IsInline() bool { return n.attr&saInline != 0 } // IsTypedef implements specifier. func (n *DeclarationSpecifiers) IsTypedef() bool { return n.attr&saTypedef != 0 } // IsExtern implements specifier. func (n *DeclarationSpecifiers) IsExtern() bool { return n.attr&saExtern != 0 } // IsStatic implements specifier. func (n *DeclarationSpecifiers) IsStatic() bool { return n.attr&saStatic != 0 } // IsAuto implements specifier. func (n *DeclarationSpecifiers) IsAuto() bool { return n.attr&saAuto != 0 } // IsRegister implements specifier. func (n *DeclarationSpecifiers) IsRegister() bool { return n.attr&saRegister != 0 } // IsConst returns whether n includes the 'const' type qualifier. func (n *DeclarationSpecifiers) IsConst() bool { return n.attr&saConst != 0 } // IsRestrict implements specifier. func (n *DeclarationSpecifiers) IsRestrict() bool { return n.attr&saRestrict != 0 } // IsVolatile implements specifier. func (n *DeclarationSpecifiers) IsVolatile() bool { return n.attr&saVolatile != 0 } // kind implements specifier. func (n *DeclarationSpecifiers) kind() Kind { return tsValid[n.typeSpecifiers()] } // typeSpecifiers implements specifier. func (n *DeclarationSpecifiers) typeSpecifiers() int { return n.typeSpecifier } // firstTypeSpecifier implements specifier. func (n *DeclarationSpecifiers) firstTypeSpecifier() *TypeSpecifier { for n.Case != 1 { // TypeSpecifier DeclarationSpecifiersOpt o := n.DeclarationSpecifiersOpt if o == nil { return nil } n = o.DeclarationSpecifiers } return n.TypeSpecifier } // attrs implements specifier. func (n *DeclarationSpecifiers) attrs() int { return n.attr } // member implements specifier. func (n *DeclarationSpecifiers) member(nm int) (*Member, error) { return n.firstTypeSpecifier().member(nm) } // str implements specifier. func (n *DeclarationSpecifiers) str() string { return specifierString(n) } // TypedefName implements Specifier. func (n *DeclarationSpecifiers) TypedefName() int { if n.kind() == TypedefName { return n.firstTypeSpecifier().Token.Val } return 0 } // ----------------------------------------------------------------- Declarator // Identifier returns the ID of the name declared by n and the scope the name // is declared in. func (n *Declarator) Identifier() (int, *Bindings) { dd := n.DirectDeclarator.bottom() if dd != nil { return dd.Token.Val, dd.DeclarationScope() } return 0, nil } // RawSpecifier returns the raw Specifier associated with n before expanding // typedefs. The effective Specifier is accessible via the Type field of n. func (n *Declarator) RawSpecifier() Specifier { return n.specifier } func (n *Declarator) clone() *Declarator { m := *n return &m } func (n *Declarator) stars() int { return n.PointerOpt.stars() } func (n *Declarator) isCompatible(m *Declarator) (r bool) { return n == m || n.Type.(*ctype).isCompatible(m.Type.(*ctype)) } func (n *Declarator) unsigednEnum(lx *lexer, s Specifier) bool { switch x := s.(type) { case *DeclarationSpecifiers: o := x.DeclarationSpecifiersOpt if o == nil { return false } switch ds := o.DeclarationSpecifiers; ds.Case { case 1: // TypeSpecifier DeclarationSpecifiersOpt // Case 1 switch ts := ds.TypeSpecifier; ts.Case { case 12: // EnumSpecifier // Case 12 return ts.EnumSpecifier.isUnsigned(lx) } } case *SpecifierQualifierList: ts := x.TypeSpecifier if ts == nil { return false } switch ts.Case { case 12: // EnumSpecifier // Case 12 return ts.EnumSpecifier.isUnsigned(lx) } } return false } func (n *Declarator) setFull(lx *lexer) Type { d := n var dds0, dds []*DirectDeclarator for dd := d.DirectDeclarator; dd != nil; dd = dd.directDeclarator() { dds = append(dds, dd) } for i, j := 0, len(dds)-1; i < j; i, j = i+1, j-1 { // reverse dds[i], dds[j] = dds[j], dds[i] } resultAttr := 0 mask := 0 if d.specifier != nil { if d.specifier.IsTypedef() { dds0 = append([]*DirectDeclarator(nil), dds...) } if d.specifier.typeSpecifiers() == 0 && lx.tweaks.enableImplicitIntType { switch x := d.specifier.(type) { case *DeclarationSpecifiers: x.typeSpecifier = tsEncode(tsInt) default: panic(fmt.Errorf("%s: TODO %T", position(n.Pos()), x)) } } } loop0: for d.specifier != nil { switch d.specifier.kind() { case TypedefName: resultAttr |= d.specifier.attrs() ts := d.specifier.firstTypeSpecifier() dd := ts.scope.Lookup(NSIdentifiers, ts.Token.Val).Node.(*DirectDeclarator) // eg. typedef T dd, (*dd), dd(int), ... if dd.Case != 0 { // IDENTIFIER panic("internal error") } nd := dd.top().declarator mask = saTypedef // nd.specifier.IsTypedef() == true dds2 := nd.Type.(*ctype).dds0 d2 := d.clone() d2.specifier = nil dd2 := &DirectDeclarator{ Case: 1, // '(' Declarator ')' Declarator: d2, } dds = append(dds, dd2) dds = append(dds, dds2[1:]...) d = nd case typeof: resultAttr |= d.specifier.attrs() ts := d.specifier.firstTypeSpecifier() nd := ts.Type.Declarator() dds2 := ts.Type.(*ctype).dds0 d2 := d.clone() d2.specifier = nil dd2 := &DirectDeclarator{ Case: 1, // '(' Declarator ')' Declarator: d2, } dds = append(dds, dd2) dds = append(dds, dds2...) d = nd default: break loop0 } } // Inner ((...)) -> (...) for { changed := false w := 0 for r := 0; r < len(dds); { dd := dds[r] if r == len(dds)-1 || dd.Case != 1 { // '(' Declarator ')' dds[w] = dd w++ r++ continue } dd2 := dds[r+1] if dd2.Case != 1 { dds[w] = dd w++ r++ continue } d := dd.Declarator d2 := dd2.Declarator switch s, s2 := d.stars(), d2.stars(); { case s == 0 && s2 == 0: dds[w] = dd w++ r += 2 changed = true case s == 0 && s2 != 0: dds[w] = dd2 w++ r += 2 changed = true case s != 0 && s2 == 0: dds[w] = dd w++ r += 2 changed = true case s != 0 && s2 != 0: d2 := d2.clone() var p *Pointer for i := 0; i < s+s2; i++ { p = &Pointer{Pointer: p} } d2.PointerOpt = &PointerOpt{Pointer: p} dd2 := dd2.clone() dd2.Declarator = d2 dds[w] = dd2 w++ r += 2 changed = true } } dds = dds[:w] if !changed { break } } // Outer (...) -> ... for { i := len(dds) - 1 if dd := dds[i]; dd.Case == 1 /* '(' Declarator ')' */ && dd.Declarator.stars() == 0 { dds = dds[:i:i] continue } break } resultStars := 0 i := len(dds) - 1 if dd := dds[i]; dd.Case == 1 /* '(' Declarator ')' */ { resultStars = dd.Declarator.stars() dds = dds[:i:i] } stars := 0 resultStars += d.stars() switch { case len(dds) == 1: if dds[0].Case != 0 { // IDENTIFIER panic("internal error") } stars, resultStars = resultStars, 0 default: again: i := 1 loop: for { switch dd := dds[i]; dd.Case { case 1: // '(' Declarator ')' if dds[i-1].Case == 0 { // IDENTIFIER stars = dd.Declarator.stars() if stars == 0 { copy(dds[i:], dds[i+1:]) dds = dds[:len(dds)-1 : len(dds)-1] goto again } } else { //dbg("", resultStars, stars, d.specifier.str(), ddsStr(dds)) panic("TODO") } i++ case 2, // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' 6, // DirectDeclarator '(' ParameterTypeList ')' 7: // DirectDeclarator '(' IdentifierListOpt ')' break loop default: //dbg("", position(n.Pos()), resultStars, stars, d.specifier.str(), ddsStr(dds)) panic(dd.Case) } } } resultSpecifier := d.specifier resultAttr |= resultSpecifier.attrs() resultAttr &^= mask t := &ctype{ dds0: dds0, dds: dds, model: lx.model, resultAttr: resultAttr, resultSpecifier: resultSpecifier, resultStars: resultStars, stars: stars, } //fmt.Printf("%s: 343\n%s", position(d.Pos()), PrettyString(resultSpecifier)) if lx.tweaks.enableUnsignedEnums && n.unsigednEnum(lx, resultSpecifier) { t.resultSpecifier = &spec{resultAttr, tsEncode(tsUnsigned)} } n.Type = t //dbg("@@@@ %v: %s", position(n.Pos()), t.dds[0].Token.S()) //dbg("setFull %v: %v, %v %v", t, t.Kind(), t.resultStars, t.stars) //dbg("", t.str()) //dbg("----> %v", t) if lx.scope == nil { return t } // Determine linkage dd := dds[0] scs := resultAttr & (saTypedef | saExtern | saStatic | saAuto | saRegister) sk := lx.scope.kind var prev, prevVisible *Declarator var prevVisibleBinding *Binding id := dd.Token.Val if p := lx.scope.Parent; p != nil { b := p.Lookup(NSIdentifiers, id) if dd, ok := b.Node.(*DirectDeclarator); ok { prevVisible = dd.TopDeclarator() prevVisibleBinding = &b } } if b := dd.prev; b != nil { prev = b.Node.(*DirectDeclarator).TopDeclarator() } switch { case // [0]6.2.2, 6: The following identifiers have no linkage: an // identifier declared to be anything other than an object or a // function; an identifier declared to be a function parameter; // a block scope identifier for an object declared without the // storage-class specifier extern. resultAttr&saTypedef != 0, sk == ScopeParams, (sk == ScopeBlock || sk == ScopeMembers) && resultAttr&saExtern == 0: n.Linkage = None case // [0]6.2.2, 3: If the declaration of a file scope identifier // for an object or a function contains the storage-class // specifier static, the identifier has internal linkage. sk == ScopeFile && resultAttr&saStatic != 0: n.Linkage = Internal case // [0]6.2.2, 4: For an identifier declared with the // storage-class specifier extern in a scope in which a prior // declaration of that identifier is visible, if the prior // declaration specifies internal or external linkage, the // linkage of the identifier at the later declaration is the // same as the linkage specified at the prior declaration. resultAttr&saExtern != 0 && (prev != nil && (prev.Linkage == Internal || prev.Linkage == External) || prevVisible != nil && (prevVisible.Linkage == Internal || prevVisible.Linkage == External)): switch { case prev != nil && (prev.Linkage == Internal || prev.Linkage == External): n.Linkage = prev.Linkage default: n.Linkage = prevVisible.Linkage dd.visible = prevVisibleBinding } case // [0]6.2.2, 4: If no prior declaration is visible, or if the // prior declaration specifies no linkage, then the identifier // has external linkage. resultAttr&saExtern != 0 && (prev == nil || prev.Linkage == None): n.Linkage = External case // [0]6.2.2, 5: If the declaration of an identifier for a // function has no storage-class specifier, its linkage is // determined exactly as if it were declared with the // storage-class specifier extern. t.Kind() == Function && scs == 0, // [0]6.2.2, 5: If the declaration of an identifier for an // object has file scope and no storage-class specifier, its // linkage is external. t.Kind() != Function && sk == ScopeFile && scs == 0: n.Linkage = External } if isGenerating || id == 0 { //dbg("setFull done (A)(%p): %s: %s\n%v", lx.scope, position(n.Pos()), n, resultSpecifier) return t } if prev != nil && prev.specifier.IsTypedef() != n.specifier.IsTypedef() { lx.report.Err(n.Pos(), "redeclaration of %s as different kind of symbol, previous declaration at %v", xc.Dict.S(id), position(prev.Pos())) return t } switch n.Linkage { case External: // [0]6.2.2, 2: In the set of translation units and libraries // that constitutes an entire program, each declaration of a // particular identifier with external linkage denotes the same // object or function. if prev, ok := lx.externs[id]; ok && !n.isCompatible(prev) { t, isA := compositeType(prev.Type, n.Type) if t == nil { lx.report.Err(n.Pos(), "conflicting types for %s '%s' with external linkage, previous declaration at %s '%s'", xc.Dict.S(id), n.Type, position(prev.Pos()), prev.Type) break } if !isA { dd.prev.Node = n.DirectDeclarator.bottom() } } lx.externs[id] = n case Internal: // [0]6.2.2, 2: Within one translation unit, each declaration // of an identifier with internal linkage denotes the same // object or function. if prev != nil && !n.isCompatible(prev) { t, isA := compositeType(prev.Type, n.Type) if t == nil { lx.report.Err(n.Pos(), "conflicting types for %s '%s' with internal linkage, previous declaration at %s '%s'", xc.Dict.S(id), n.Type, position(prev.Pos()), prev.Type) break } if !isA { dd.prev.Node = n.DirectDeclarator.bottom() } } case None: // [0]6.2.2, 2: Each declaration of an identifier with no // linkage denotes a unique entity. if prev != nil { if lx.tweaks.allowCompatibleTypedefRedefinitions && n.RawSpecifier().IsTypedef() && prev.RawSpecifier().IsTypedef() && strings.TrimPrefix(n.Type.String(), "typedef ") == strings.TrimPrefix(prev.Type.String(), "typedef ") { break } lx.report.Err(n.Pos(), "redeclaration of %s '%s' with no linkage, previous declaration at %v '%s'", xc.Dict.S(id), n.Type, position(prev.Pos()), prev.Type) } default: panic("internal error") } //dbg("setFull done: %s: %s", position(n.Pos()), n) return t } // ----------------------------------------------------------- DeclaratorOpt func (n *DeclaratorOpt) isCompatible(m *DeclaratorOpt) bool { return n == m || (n != nil && m != nil && n.Declarator.isCompatible(m.Declarator)) } // ----------------------------------------------------------- DirectDeclarator // DeclarationScope returns the scope a name declared by n is in. If n does not // declare a name or n declares a name of a built in type, DeclarationScope // returns nil. func (n *DirectDeclarator) DeclarationScope() *Bindings { return n.idScope } // TopDeclarator returns the top level Declarator associated with n. func (n *DirectDeclarator) TopDeclarator() *Declarator { return n.top().declarator } func (n *DirectDeclarator) top() *DirectDeclarator { for n.parent != nil { n = n.parent } return n } func (n *DirectDeclarator) bottom() *DirectDeclarator { for n.Case != 0 { // IDENTIFIER n = n.directDeclarator() } return n } func (n *DirectDeclarator) clone() *DirectDeclarator { m := *n return &m } func (n *DirectDeclarator) isCompatible(m *DirectDeclarator) (r bool) { if n == m { return true } if n.Case > m.Case { n, m = m, n } if n.Case != m.Case { if n.Case == 6 && m.Case == 7 { var b []Parameter if o := m.IdentifierListOpt; o != nil { b = o.params } return isCompatibleParameters( n.ParameterTypeList.params, b, n.ParameterTypeList.Case == 1, // ParameterList ',' "..." false, ) } } switch n.Case { case 0: // IDENTIFIER return true case 1: // '(' Declarator ')' return true // Declarator checked before case 2: // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' // [0]6.7.5.3 6: For two array types to be compatible, both // shall have compatible element types, and if both size // specifiers are present, and are integer constant // expressions, then both size specifiers shall have the same // constant value. If the two array types are used in a context // which requires them to be compatible, it is undefined // behavior if the two size specifiers evaluate to unequal // values. var nv, mv interface{} if o := n.ExpressionOpt; o != nil { nv = o.Expression.Value } if o := m.ExpressionOpt; o != nil { mv = o.Expression.Value } if nv != nil && mv != nil && nv != mv { return false } return true case 6: // DirectDeclarator '(' ParameterTypeList ')' return isCompatibleParameters( n.ParameterTypeList.params, m.ParameterTypeList.params, n.ParameterTypeList.Case == 1, // ParameterList ',' "..." m.ParameterTypeList.Case == 1, // ParameterList ',' "..." ) case 7: // DirectDeclarator '(' IdentifierListOpt ')' var a, b []Parameter if o := n.IdentifierListOpt; o != nil { a = o.params } if o := m.IdentifierListOpt; o != nil { b = o.params } return isCompatibleParameters(a, b, false, false) default: panic(n.Case) } } func (n *DirectDeclarator) directDeclarator() *DirectDeclarator { switch n.Case { case 0: // IDENTIFIER return nil case 1: // '(' Declarator ')' return n.Declarator.DirectDeclarator case 2, // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' 3, // DirectDeclarator '[' "static" TypeQualifierListOpt Expression ']' 4, // DirectDeclarator '[' TypeQualifierList "static" Expression ']' 5, // DirectDeclarator '[' TypeQualifierListOpt '*' ']' 6, // DirectDeclarator '(' ParameterTypeList ')' 7: // DirectDeclarator '(' IdentifierListOpt ')' return n.DirectDeclarator default: panic(n.Case) } } func (n *DirectDeclarator) isArray() bool { switch n.Case { case 0, // IDENTIFIER 1, // '(' Declarator ')' // Case 1 6, // DirectDeclarator '(' ParameterTypeList ')' // Case 6 7: // DirectDeclarator '(' IdentifierListOpt ')' // Case 7 return false case 2, // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' // Case 2 3, // DirectDeclarator '[' "static" TypeQualifierListOpt Expression ']' // Case 3 4, // DirectDeclarator '[' TypeQualifierList "static" Expression ']' // Case 4 5: // DirectDeclarator '[' TypeQualifierListOpt '*' ']' // Case 5 return true default: panic(n.Case) } } func (n *DirectDeclarator) isVLA() *Expression { switch dd := n.DirectDeclarator; dd.Case { case 0: // IDENTIFIER return nil case 1: // '(' Declarator ')' // Case 1 //dbg("", n.TopDeclarator().Type, n.TopDeclarator().Type.Element(), n.TopDeclarator().Type.Element().Elements()) d := n.TopDeclarator() if d.Type.Kind() == Ptr && d.Type.Element().Elements() >= 0 { return nil } panic("TODO") case 2: // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' // Case 2 o := n.ExpressionOpt if o == nil || o.Expression.Value != nil { return nil } return o.Expression case 3: // DirectDeclarator '[' "static" TypeQualifierListOpt Expression ']' // Case 3 panic("TODO") case 4: // DirectDeclarator '[' TypeQualifierList "static" Expression ']' // Case 4 panic("TODO") case 5: // DirectDeclarator '[' TypeQualifierListOpt '*' ']' // Case 5 panic("TODO") case 6: // DirectDeclarator '(' ParameterTypeList ')' // Case 6 return nil case 7: // DirectDeclarator '(' IdentifierListOpt ')' // Case 7 panic("TODO") default: panic("internal error") } } // ------------------------------------------------------------- EnumSpecifier func (n *EnumSpecifier) isUnsigned(lx *lexer) bool { switch n.Case { case 0: // "enum" IdentifierOpt '{' EnumeratorList CommaOpt '}' return n.unsigned case 1: // "enum" IDENTIFIER // Case 1 switch b := lx.scope.Lookup(NSTags, n.Token2.Val); x := b.Node.(type) { case *EnumSpecifier: switch n := x; n.Case { case 0: // "enum" IdentifierOpt '{' EnumeratorList CommaOpt '}' return n.unsigned } } } return false } // ----------------------------------------------------------------- Expression func (n *Expression) cond(lx *lexer, op operand) { m := lx.model lv, _ := n.Expression.eval(lx) if lv == nil { _, at := op.eval(lx) _, bt := n.Expression2.eval(lx) if eqTypes(at, bt) { n.Type = at return } if IsArithmeticType(at) && IsArithmeticType(bt) { n.Type = m.BinOpType(at, bt) return } ak := at.Kind() bk := bt.Kind() if ak == Function && bk == Ptr { if e := bt.Element(); e.Kind() == Function && eqTypes(at, e) { n.Type = bt return } } if bk == Function && ak == Ptr { if e := at.Element(); e.Kind() == Function && eqTypes(bt, e) { n.Type = at return } } if (ak == Enum || ak == Bool) && IsIntType(bt) { n.Type = at return } if (bk == Enum || bk == Bool) && IsIntType(at) { n.Type = bt return } if ak == Struct && bk == Struct || ak == Union && bk == Union { if at.CanAssignTo(bt) { n.Type = at return } } if ak == Void && bk == Void { n.Type = at return } if ak == Array && bk == Array { if at.(*ctype).isCompatible(bt.(*ctype)) { n.Type = at return } at = at.(*ctype).arrayDecay() ak = at.Kind() bt = bt.(*ctype).arrayDecay() bk = bt.Kind() } if ak == Array && bk == Ptr && at.CanAssignTo(bt) { n.Type = bt return } if ak == Ptr && bk == Array && bt.CanAssignTo(at) { n.Type = at return } if ak == Ptr && bk == Ptr { if at.CanAssignTo(bt) { n.Type = at return } } if (ak == Ptr || ak == Array || ak == Function) && IsIntType(bt) { n.Type = at return } if (bk == Ptr || bk == Array || bk == Function) && IsIntType(at) { n.Type = bt return } if ak == Ptr && at.Element().Kind() == Void && bk == Ptr { n.Type = bt return } if bk == Ptr && bt.Element().Kind() == Void && ak == Ptr { n.Type = at return } lx.report.ErrTok(n.Token2, "'%s'/'%s' mismatch in conditional expression", at, bt) return } if isNonZero(lv) { n.Value, n.Type = op.eval(lx) return } n.Value, n.Type = n.Expression2.eval(lx) } func (n *Expression) eval(lx *lexer) (interface{}, Type) { m := lx.model if n.Type != nil { return n.Value, n.Type } n.Type = undefined outer: switch n.Case { case 0: // IDENTIFIER b := n.scope.Lookup(NSIdentifiers, n.Token.Val) if b.Node == nil { lx.report.ErrTok(n.Token, "undefined: %s", n.Token.S()) break } dd := b.Node.(*DirectDeclarator) t := dd.top().declarator.Type if (t.Kind() == Ptr || t.Kind() == Array) && n.Type.Elements() == -1 { found := false dd := dd more: for dd.prev != nil { dd = dd.prev.Node.(*DirectDeclarator) if t2 := dd.TopDeclarator().Type; t2.Elements() >= 0 { t = t2 found = true break } } if !found && dd.visible != nil { dd = dd.visible.Node.(*DirectDeclarator) if t2 := dd.TopDeclarator().Type; t2.Elements() >= 0 { t = t2 } else { goto more } } } n.Type = t if v := dd.EnumVal; v != nil { n.Value = v } case 1: // CHARCONST n.Value, n.Type = m.charConst(lx, n.Token) case 2: // FLOATCONST n.Value, n.Type = m.floatConst(lx, n.Token) case 3: // INTCONST n.Value, n.Type = m.intConst(lx, n.Token) case 4: // LONGCHARCONST n.Value, n.Type = m.charConst(lx, n.Token) case 5: // LONGSTRINGLITERAL n.Value, n.Type = m.strConst(lx, n.Token) case 6: // STRINGLITERAL n.Value, n.Type = m.strConst(lx, n.Token) case 7: // '(' ExpressionList ')' n.Value, n.Type = n.ExpressionList.eval(lx) case 8: // Expression '[' ExpressionList ']' _, t := n.Expression.eval(lx) _, t2 := n.ExpressionList.eval(lx) switch t.Kind() { case Ptr, Array: n.Type = t.Element() if !IsIntType(t2) && t2.Kind() != Bool { lx.report.Err(n.ExpressionList.Pos(), "array subscript is not an integer or bool (have '%s')", t2) break } if p, x := n.Expression.Value, n.ExpressionList.Value; p != nil && x != nil { sz := uintptr(n.Type.SizeOf()) switch pv := p.(type) { case uintptr: switch xv := x.(type) { case int32: pv += sz * uintptr(xv) case uint32: pv += sz * uintptr(xv) case int64: pv += sz * uintptr(xv) case uint64: pv += sz * uintptr(xv) case uintptr: pv += sz * xv default: panic("TODO") } n.Value = pv case StringLitID, LongStringLitID: // ok, but not a constant expression. default: panic("internal error") } } break outer } if !IsIntType(t) && t.Kind() != Bool || t2.Kind() != Ptr && t2.Kind() != Array { lx.report.ErrTok(n.Token, "invalid index expression types (%s[%t])", t, n.ExpressionList.Type) break } n.Type = t2.Element() if p, x := n.ExpressionList.Value, n.Expression.Value; p != nil && x != nil { panic(fmt.Errorf("%s: TODO", position(n.Pos()))) } case 9: // Expression '(' ArgumentExpressionListOpt ')' if n.Expression.Case == 0 { // IDENTIFIER if lx.tweaks.enableBuiltinConstantP && n.Expression.Token.Val == idBuiltinConstantP { o := n.ArgumentExpressionListOpt if o == nil { lx.report.Err(n.Expression.Pos(), "missing argument of __builtin_constant_p") break } args := o.ArgumentExpressionList if args.ArgumentExpressionList != nil { lx.report.Err(n.Expression.Pos(), "too many arguments of __builtin_constant_p") break } n.Case = 3 // INTCONST n.Type = lx.model.IntType switch v, _ := args.Expression.eval(lx); { case v != nil: n.Value = int32(1) default: n.Value = int32(0) } break } if lx.tweaks.enableBuiltinClassifyType && n.Expression.Token.Val == idBuiltinClasifyType { o := n.ArgumentExpressionListOpt if o == nil { lx.report.Err(n.Expression.Pos(), "missing argument of __builtin_classify_type") break } args := o.ArgumentExpressionList if args.ArgumentExpressionList != nil { lx.report.Err(n.Expression.Pos(), "too many arguments of __builtin_classify_type") break } n.Case = 3 // INTCONST n.Type = lx.model.IntType v := noTypeClass if _, t := args.Expression.eval(lx); t != nil { v = classifyType[t.Kind()] } n.Value = int32(v) break } if n.Expression.Token.Val == idBuiltinTypesCompatible { // using #define __builtin_types_compatible_p(type1, type2) __builtin_types_compatible__((type1){}, (type2){}) o := n.ArgumentExpressionListOpt if o == nil { lx.report.Err(n.Expression.Pos(), "missing arguments of __builtin_types_compatible_p") break } args := o.ArgumentExpressionList arg1 := args.Expression if arg1.Case != 14 { // '(' TypeName ')' '{' InitializerList CommaOpt '}' lx.report.Err(arg1.Pos(), "invalid argument of __builtin_types_compatible__") break } args = args.ArgumentExpressionList if args == nil { lx.report.Err(n.Expression.Pos(), "missing argument of __builtin_types_compatible_p") break } arg2 := args.Expression if arg2.Case != 14 { // '(' TypeName ')' '{' InitializerList CommaOpt '}' lx.report.Err(arg1.Pos(), "invalid argument of __builtin_types_compatible__") break } if args.ArgumentExpressionList != nil { lx.report.Err(n.Expression.Pos(), "too many arguments of __builtin_types_compatible_p") break } t := arg1.Type u := arg2.Type var v int32 if !isEnum(arg1.TypeName, arg2.TypeName) && t.(*ctype).isCompatible(u.(*ctype)) { v = 1 if t.Kind() == Ptr && u.Kind() == Ptr && t.Specifier().IsConst() != u.Specifier().IsConst() { v = 0 } } n.Type = lx.model.IntType n.Value = v break } b := n.Expression.scope.Lookup(NSIdentifiers, n.Expression.Token.Val) if b.Node == nil && lx.tweaks.enableImplicitFuncDef { n.Type = lx.model.IntType break } } _, t := n.Expression.eval(lx) if t.Kind() == Ptr { t = t.Element() } if t.Kind() != Function { lx.report.Err(n.Expression.Pos(), "called object is not a function or function pointer (have '%s')", t) break } n.Type = t.Result() params, isVariadic := t.Parameters() if params == nil { break // [0], 6.5.2.2/8 } var args []*Expression var types []Type if o := n.ArgumentExpressionListOpt; o != nil { for l := o.ArgumentExpressionList; l != nil; l = l.ArgumentExpressionList { ex := l.Expression args = append(args, ex) _, t := ex.eval(lx) types = append(types, t) } } if g, e := len(args), len(params); g < e { lx.report.ErrTok(n.Token, "too few arguments to function (have %v, want %v)", g, e) break } if !isVariadic { if len(args) > len(params) && len(params) != 0 /* composite type */ { lx.report.Err(n.ArgumentExpressionListOpt.Pos(), "too many arguments to function") break } } for i, param := range params { pt := param.Type if pt.Kind() == Array { pt = pt.(*ctype).arrayDecay() } typ := types[i] if pt.Kind() == Function && typ.Kind() == Ptr && typ.Element().Kind() == Function { typ = typ.Element() } if !typ.CanAssignTo(pt) { lx.report.Err(args[i].Pos(), "expected '%s' but argument is of type '%s'", pt, typ) } } case 10: // Expression '.' IDENTIFIER _, t := n.Expression.eval(lx) mb, err := t.Member(n.Token2.Val) if err == nil { n.Type = mb.Type } else { // support AnonymousStructs() by doing some emulating... (todo check if enabled) offset, ty, err2 := memberOffsetRecursive(t, n.Token2.Val) if err2 == nil { // This is kindof a simple workaround... should work good enough though // and might be the easiest implementation possible // transform a.b into (*(ty*)((char*)(&a))+offset)) ptr := &Expression{ Case: 17, // &Expression Token: xc.Token{lex.Char{Rune: '&'}, 0}, Expression: n.Expression, } // sneak in a char pointer so that the offset is correct charTy := lx.model.CharType.Pointer() charTyDeclarator := &Declarator{Type: charTy} ptr = &Expression{ Case: 25, Token: xc.Token{lex.Char{Rune: '('}, 0}, TypeName: &TypeName{Type: charTy, declarator: charTyDeclarator}, Token2: xc.Token{lex.Char{Rune: ')'}, 0}, Expression: ptr, } sid := dict.SID(strconv.Itoa(offset)) offset := &Expression{ Case: 3, // INTCONST Token: xc.Token{lex.Char{Rune: INTCONST}, sid}, } fieldPtr := &Expression{ Case: 29, // + Expression: ptr, Token: xc.Token{lex.Char{Rune: '+'}, 0}, Expression2: offset, } ptrTy := (*ty).Pointer() declarator := &Declarator{Type: ptrTy} cast := &Expression{ Case: 25, // cast to ty * Token: xc.Token{lex.Char{Rune: '('}, 0}, TypeName: &TypeName{Type: ptrTy, declarator: declarator}, Token2: xc.Token{lex.Char{Rune: ')'}, 0}, Expression: fieldPtr, } *n = Expression{ Case: 18, // * (dereference) Token: xc.Token{lex.Char{Rune: '*'}, 0}, Expression: cast, } n.Value, n.Type = n.eval(lx) } else { lx.report.Err(n.Token2.Pos(), "%v (OR %v)", err, err2) break } } case 11: // Expression "->" IDENTIFIER v, t := n.Expression.eval(lx) if t.Kind() != Ptr && t.Kind() != Array { lx.report.ErrTok(n.Token2, "invalid type argument of -> (have '%v')", t) break } t = t.Element() mb, err := t.Member(n.Token2.Val) if err != nil { lx.report.Err(n.Token2.Pos(), "%v", err) break } n.Type = mb.Type switch x := v.(type) { case nil: // nop case uintptr: n.Value = x + uintptr(mb.OffsetOf) default: panic("internal error") } case 12: // Expression "++" n.Value, n.Type = n.Expression.eval(lx) case 13: // Expression "--" n.Value, n.Type = n.Expression.eval(lx) case 14: // '(' TypeName ')' '{' InitializerList CommaOpt '}' n.Type = n.TypeName.Type n.InitializerList.typeCheck(&n.Type, n.Type, false, lx) case 15: // "++" Expression n.Value, n.Type = n.Expression.eval(lx) case 16: // "--" Expression n.Value, n.Type = n.Expression.eval(lx) case 17: // '&' Expression var t Type n.Value, t = n.Expression.eval(lx) n.Type = t.Pointer() case 18: // '*' Expression _, t := n.Expression.eval(lx) if t.Kind() == Function { n.Type = t break } if k := t.Kind(); k != Ptr && k != Array { lx.report.ErrTok(n.Token, "invalid argument type of unary * (have '%v')", t) break } n.Type = t.Element() case 19: // '+' Expression v, t := n.Expression.eval(lx) n.Type = lx.model.promote(t) if v == nil { break } n.Value = lx.model.MustConvert(v, n.Type) case 20: // '-' Expression v, t := n.Expression.eval(lx) n.Type = lx.model.promote(t) if v == nil { break } v = lx.model.MustConvert(v, n.Type) switch x := v.(type) { case int16: n.Value = -x case uint16: n.Value = -x case int32: n.Value = -x case uint32: n.Value = -x case uint64: n.Value = -x case int64: n.Value = -x case float32: n.Value = -x case float64: n.Value = -x default: panic(fmt.Errorf("internal error: %T", x)) } case 21: // '~' Expression v, t := n.Expression.eval(lx) n.Type = lx.model.promote(t) if v == nil { break } v = lx.model.MustConvert(v, n.Type) switch x := v.(type) { case int32: n.Value = ^x case uint32: n.Value = ^x case int64: n.Value = ^x case uint64: n.Value = ^x default: panic(fmt.Errorf("internal error: %T", x)) } case 22: // '!' Expression v, _ := n.Expression.eval(lx) n.Type = m.IntType if v == nil { break } n.Value = m.cBool(isZero(v)) case 23: // "sizeof" Expression n.Type = m.getSizeType(lx) switch v, t := n.Expression.eval(lx); x := v.(type) { case StringLitID: n.Value = m.MustConvert(int32(len(dict.S(int(x)))+1), n.Type) default: n.Value = m.MustConvert(uint64(t.SizeOf()), n.Type) } case 24: // "sizeof" '(' TypeName ')' n.Type = m.getSizeType(lx) n.Value = m.MustConvert(uint64(n.TypeName.declarator.Type.SizeOf()), n.Type) case 25: // '(' TypeName ')' Expression v, _ := n.Expression.eval(lx) n.Type = n.TypeName.declarator.Type n.Value = v if v != nil && n.Type.Kind() != Struct && n.Type.Kind() != Union && !isStrLitID(v) { n.Value = m.MustConvert(v, n.Type) } case 26: // Expression '*' Expression var a, b interface{} a, b, n.Type = m.binOp(lx, n.Expression, n.Expression2) n.BinOpType = n.Type switch x := a.(type) { case nil: // nop case int32: n.Value = x * b.(int32) case uint32: n.Value = x * b.(uint32) case int64: n.Value = x * b.(int64) case uint64: n.Value = x * b.(uint64) case float32: n.Value = x * b.(float32) case float64: n.Value = x * b.(float64) case complex64: n.Value = x * b.(complex64) case complex128: n.Value = x * b.(complex128) default: panic(fmt.Errorf("internal error: %T", x)) } case 27: // Expression '/' Expression var a, b interface{} a, b, n.Type = m.binOp(lx, n.Expression, n.Expression2) n.BinOpType = n.Type if b != nil && isZero(b) && IsIntType(n.Type) { lx.report.Err(n.Expression2.Pos(), "division by zero") break } switch x := a.(type) { case nil: // nop case int32: n.Value = x / b.(int32) case uint32: n.Value = x / b.(uint32) case int64: n.Value = x / b.(int64) case uint64: n.Value = x / b.(uint64) case float32: n.Value = x / b.(float32) case float64: n.Value = x / b.(float64) default: panic(fmt.Errorf("internal error: %T", x)) } case 28: // Expression '%' Expression var a, b interface{} a, b, n.Type = m.binOp(lx, n.Expression, n.Expression2) n.BinOpType = n.Type if b != nil && isZero(b) && IsIntType(n.Type) { lx.report.Err(n.Expression2.Pos(), "division by zero") break } switch x := a.(type) { case nil: // nop case int32: n.Value = x % b.(int32) case uint32: n.Value = x % b.(uint32) case int64: n.Value = x % b.(int64) case uint64: n.Value = x % b.(uint64) default: panic(fmt.Errorf("internal error: %T", x)) } case 29: // Expression '+' Expression _, at := n.Expression.eval(lx) _, bt := n.Expression2.eval(lx) if at.Kind() == Array { at = at.Element().Pointer() } if bt.Kind() == Array { bt = bt.Element().Pointer() } if at.Kind() > bt.Kind() { at, bt = bt, at } switch { case at.Kind() == Ptr: if IsIntType(bt) || bt.Kind() == Bool { n.Type = at break } lx.report.ErrTok(n.Token, "incompatible types ('%s' + '%s')", at, bt) case IsArithmeticType(at): fallthrough default: var a, b interface{} a, b, n.Type = m.binOp(lx, n.Expression, n.Expression2) n.BinOpType = n.Type switch x := a.(type) { case nil: // nop case int32: n.Value = x + b.(int32) case uint32: n.Value = x + b.(uint32) case int64: n.Value = x + b.(int64) case uint64: n.Value = x + b.(uint64) case float32: n.Value = x + b.(float32) case float64: n.Value = x + b.(float64) case complex64: n.Value = x + b.(complex64) case complex128: n.Value = x + b.(complex128) default: panic(fmt.Errorf("internal error: %T", x)) } } case 30: // Expression '-' Expression av, at := n.Expression.eval(lx) bv, bt := n.Expression2.eval(lx) if at.Kind() == Array { at = at.Element().Pointer() } if bt.Kind() == Array { bt = bt.Element().Pointer() } if at.Kind() == Ptr && bt.Kind() == Ptr { if !at.CanAssignTo(bt) { n.Type = undefined lx.report.Err(n.Expression2.Pos(), "incompatible types ('%s' - '%s')", at, bt) break } n.Type = m.getPtrDiffType(lx) if av != nil && bv != nil { n.Value = lx.model.MustConvert((av.(uintptr)-bv.(uintptr))/uintptr(n.Type.SizeOf()), n.Type) } break } if at.Kind() == Ptr && IsIntType(bt) { n.Type = at break } var a, b interface{} a, b, n.Type = m.binOp(lx, n.Expression, n.Expression2) n.BinOpType = n.Type switch x := a.(type) { case nil: // nop case int32: n.Value = x - b.(int32) case uint32: n.Value = x - b.(uint32) case int64: n.Value = x - b.(int64) case uint64: n.Value = x - b.(uint64) case float32: n.Value = x - b.(float32) case float64: n.Value = x - b.(float64) case complex64: n.Value = x - b.(complex64) case complex128: n.Value = x - b.(complex128) default: panic(fmt.Errorf("internal error: %T", x)) } case 31: // Expression "<<" Expression av, at := n.Expression.eval(lx) bv, bt := n.Expression2.eval(lx) n.Type = lx.model.promote(at) if av == nil || bv == nil { break } av = lx.model.MustConvert(av, n.Type) bv = lx.model.MustConvert(bv, lx.model.promote(bt)) switch x := av.(type) { case int8: switch y := bv.(type) { case int32: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case uint8: switch y := bv.(type) { case int32: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case int16: switch y := bv.(type) { case int16: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint16: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int32: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case uint16: switch y := bv.(type) { case int16: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint16: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int32: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case int32: switch y := bv.(type) { case int16: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint16: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int32: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case uint32: switch y := bv.(type) { case int16: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint16: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int32: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case int64: switch y := bv.(type) { case int16: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint16: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int32: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case uint64: switch y := bv.(type) { case int16: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint16: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int32: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x << uint(y) case y < 0: n.Value = x >> uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x << uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } default: panic(fmt.Errorf("internal error: %T", x)) } case 32: // Expression ">>" Expression av, at := n.Expression.eval(lx) bv, bt := n.Expression2.eval(lx) n.Type = lx.model.promote(at) if av == nil || bv == nil { break } av = lx.model.MustConvert(av, n.Type) bv = lx.model.MustConvert(bv, lx.model.promote(bt)) switch x := av.(type) { case int8: switch y := bv.(type) { case int32: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case uint8: switch y := bv.(type) { case int32: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case int16: switch y := bv.(type) { case int32: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case uint16: switch y := bv.(type) { case int32: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case int32: switch y := bv.(type) { case int32: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case uint32: switch y := bv.(type) { case int32: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case int64: switch y := bv.(type) { case int32: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } case uint64: switch y := bv.(type) { case int32: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint32: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } case int64: switch { case y > 0: n.Value = x >> uint(y) case y < 0: n.Value = x << uint(-y) default: n.Value = x } case uint64: switch { case y > 0: n.Value = x >> uint(y) default: n.Value = x } default: panic(fmt.Errorf("internal error: %T", y)) } default: panic(fmt.Errorf("internal error: %T", x)) } case 33: // Expression '<' Expression n.Type = m.IntType _, at := n.Expression.eval(lx) _, bt := n.Expression2.eval(lx) a0, b0 := at, bt if at.Kind() > bt.Kind() { at, bt = bt, at } switch { case at.Kind() == Ptr: if bt.Kind() == Array { bt = bt.Element().Pointer() } if !at.CanAssignTo(bt) { lx.report.ErrTok(n.Token, "incompatible types ('%s' < '%s')", a0, b0) } break case IsArithmeticType(at): fallthrough default: n.Type = m.IntType var a, b interface{} a, b, n.BinOpType = m.binOp(lx, n.Expression, n.Expression2) switch x := a.(type) { case nil: // nop case int32: n.Value = m.cBool(x < b.(int32)) case uint32: n.Value = m.cBool(x < b.(uint32)) case int64: n.Value = m.cBool(x < b.(int64)) case uint64: n.Value = m.cBool(x < b.(uint64)) case float32: n.Value = m.cBool(x < b.(float32)) case float64: n.Value = m.cBool(x < b.(float64)) default: panic(fmt.Errorf("internal error: %T", x)) } } case 34: // Expression '>' Expression n.Type = m.IntType _, at := n.Expression.eval(lx) _, bt := n.Expression2.eval(lx) a0, b0 := at, bt if at.Kind() > bt.Kind() { at, bt = bt, at } switch { case at.Kind() == Ptr: if bt.Kind() == Array { bt = bt.Element().Pointer() } if !at.CanAssignTo(bt) { lx.report.ErrTok(n.Token, "incompatible types ('%s' > '%s')", a0, b0) } break case IsArithmeticType(at): fallthrough default: n.Type = m.IntType var a, b interface{} a, b, n.BinOpType = m.binOp(lx, n.Expression, n.Expression2) switch x := a.(type) { case nil: // nop case int32: n.Value = m.cBool(x > b.(int32)) case int64: n.Value = m.cBool(x > b.(int64)) case uint32: n.Value = m.cBool(x > b.(uint32)) case uint64: n.Value = m.cBool(x > b.(uint64)) case float32: n.Value = m.cBool(x > b.(float32)) case float64: n.Value = m.cBool(x > b.(float64)) default: panic(fmt.Errorf("internal error: %T", x)) } } case 35: // Expression "<=" Expression n.Type = m.IntType _, at := n.Expression.eval(lx) _, bt := n.Expression2.eval(lx) a0, b0 := at, bt if at.Kind() > bt.Kind() { at, bt = bt, at } switch { case at.Kind() == Ptr: if !at.CanAssignTo(bt) { lx.report.ErrTok(n.Token, "incompatible types ('%s' <= '%s')", a0, b0) } break case IsArithmeticType(at): fallthrough default: n.Type = m.IntType var a, b interface{} a, b, n.BinOpType = m.binOp(lx, n.Expression, n.Expression2) switch x := a.(type) { case nil: // nop case int32: n.Value = m.cBool(x <= b.(int32)) case uint32: n.Value = m.cBool(x <= b.(uint32)) case int64: n.Value = m.cBool(x <= b.(int64)) case uint64: n.Value = m.cBool(x <= b.(uint64)) case float32: n.Value = m.cBool(x <= b.(float32)) case float64: n.Value = m.cBool(x <= b.(float64)) default: panic(fmt.Errorf("internal error: %T", x)) } } case 36: // Expression ">=" Expression n.Type = m.IntType _, at := n.Expression.eval(lx) _, bt := n.Expression2.eval(lx) a0, b0 := at, bt if at.Kind() > bt.Kind() { at, bt = bt, at } switch { case at.Kind() == Ptr: if bt.Kind() == Array { bt = bt.Element().Pointer() } if !at.CanAssignTo(bt) { lx.report.ErrTok(n.Token, "incompatible types ('%s' >= '%s')", a0, b0) } break case IsArithmeticType(at): fallthrough default: var a, b interface{} a, b, n.BinOpType = m.binOp(lx, n.Expression, n.Expression2) switch x := a.(type) { case nil: // nop case int32: n.Value = m.cBool(x >= b.(int32)) case uint32: n.Value = m.cBool(x >= b.(uint32)) case int64: n.Value = m.cBool(x >= b.(int64)) case uint64: n.Value = m.cBool(x >= b.(uint64)) case float32: n.Value = m.cBool(x >= b.(float32)) case float64: n.Value = m.cBool(x >= b.(float64)) default: panic(fmt.Errorf("internal error: %T", x)) } } case 37: // Expression "==" Expression n.Type = m.IntType _, at := n.Expression.eval(lx) _, bt := n.Expression2.eval(lx) a0, b0 := at, bt if at.Kind() > bt.Kind() { at, bt = bt, at } switch { case at.Kind() == Ptr: if IsIntType(bt) { break } if bt.Kind() == Array { bt = bt.(*ctype).arrayDecay() } if bt.Kind() == Function && at.Element().Kind() == Function { bt = bt.Pointer() } if !at.CanAssignTo(bt) { lx.report.ErrTok(n.Token, "incompatible types ('%s' == '%s')", a0, b0) } break case at.Kind() == Function && bt.Kind() == Function: // nop case IsArithmeticType(at): fallthrough default: var a, b interface{} a, b, n.BinOpType = m.binOp(lx, n.Expression, n.Expression2) if a == nil { break } n.Value = m.cBool(a == b) } case 38: // Expression "!=" Expression n.Type = m.IntType av, at := n.Expression.eval(lx) bv, bt := n.Expression2.eval(lx) if at.Kind() > bt.Kind() { at, bt = bt, at } outer38: switch { case at.Kind() == Ptr: if av != nil && bv != nil { x := av.(uintptr) switch y := bv.(type) { case int32: n.Value = m.cBool(x != uintptr(y)) break outer38 default: panic(fmt.Errorf("TODO %s: %T %T", position(n.Pos()), av, bv)) } } if IsIntType(bt) { break } if bt.Kind() == Function && at.Element().Kind() == Function { bt = bt.Pointer() } if bt.Kind() == Array { bt = bt.(*ctype).arrayDecay() } if !at.CanAssignTo(bt) { lx.report.ErrTok(n.Token, "incompatible types ('%s' != '%s')", at, bt) } break case IsArithmeticType(at): fallthrough default: var a, b interface{} a, b, n.BinOpType = m.binOp(lx, n.Expression, n.Expression2) if a == nil { break } n.Value = m.cBool(a != b) } case 39: // Expression '&' Expression var a, b interface{} a, b, n.Type = m.binOp(lx, n.Expression, n.Expression2) n.BinOpType = n.Type switch x := a.(type) { case nil: // nop case int32: n.Value = x & b.(int32) case uint32: n.Value = x & b.(uint32) case int64: n.Value = x & b.(int64) case uint64: n.Value = x & b.(uint64) default: panic(fmt.Errorf("internal error: %T", x)) } case 40: // Expression '^' Expression var a, b interface{} a, b, n.Type = m.binOp(lx, n.Expression, n.Expression2) n.BinOpType = n.Type switch x := a.(type) { case nil: // nop case int32: n.Value = x ^ b.(int32) case uint32: n.Value = x ^ b.(uint32) case int64: n.Value = x ^ b.(int64) case uint64: n.Value = x ^ b.(uint64) default: panic(fmt.Errorf("internal error: %T", x)) } case 41: // Expression '|' Expression var a, b interface{} a, b, n.Type = m.binOp(lx, n.Expression, n.Expression2) n.BinOpType = n.Type switch x := a.(type) { case nil: // nop case int32: n.Value = x | b.(int32) case uint32: n.Value = x | b.(uint32) case int64: n.Value = x | b.(int64) case uint64: n.Value = x | b.(uint64) default: panic(fmt.Sprintf("internal error: %T", x)) } case 42: // Expression "&&" Expression n.Type = m.IntType a, _ := n.Expression.eval(lx) if a != nil && isZero(a) { n.Value = m.cBool(false) break } b, _ := n.Expression2.eval(lx) if a != nil && b != nil { if isZero(b) { n.Value = m.cBool(false) break } n.Value = m.cBool(true) break } case 43: // Expression "||" Expression n.Type = m.IntType av, _ := n.Expression.eval(lx) if av != nil && isNonZero(av) { n.Value = m.cBool(true) break } bv, _ := n.Expression2.eval(lx) if av != nil && bv != nil { n.Value = m.cBool(isNonZero(bv)) break } case 44: // Expression '?' ExpressionList ':' Expression n.cond(lx, n.ExpressionList) break case 45: // Expression '=' Expression _, at := n.Expression.eval(lx) _, bt := n.Expression2.eval(lx) if bt.Kind() == Function { bt = bt.Pointer() } if !bt.CanAssignTo(at) { lx.report.Err(n.Expression2.Pos(), "assignment from incompatible type ('%s' = '%s')", at, bt) break } n.Type = at if at.Kind() == Array && bt.Kind() == Ptr { n.Type = bt } case 46: // Expression "*=" Expression _, n.Type = n.Expression.eval(lx) if _, _, n.BinOpType = m.binOp(lx, n.Expression, n.Expression2); n.BinOpType.Kind() == Undefined { lx.report.ErrTok(n.Token, "incompatible types") //TODO have ... } case 47, // Expression "/=" Expression 48: // Expression "%=" Expression m.checkArithmeticType(lx, n.Expression, n.Expression2) n.Type = n.Expression.Type if v := n.Expression2.Value; v != nil && isZero(v) && IsIntType(n.Type) { lx.report.Err(n.Expression2.Pos(), "division by zero") break } if _, _, n.BinOpType = m.binOp(lx, n.Expression, n.Expression2); n.BinOpType.Kind() == Undefined { lx.report.ErrTok(n.Token, "incompatible types") //TODO have ... } case 49, // Expression "+=" Expression 50: // Expression "-=" Expression _, at := n.Expression.eval(lx) _, bt := n.Expression2.eval(lx) n.Type = at switch { case at.Kind() == Ptr: if IsIntType(bt) || bt.Kind() == Bool { break } lx.report.ErrTok(n.Token, "incompatible types") //TODO have ... case IsArithmeticType(at): fallthrough default: if _, _, n.BinOpType = m.binOp(lx, n.Expression, n.Expression2); n.BinOpType.Kind() == Undefined { lx.report.ErrTok(n.Token, "incompatible types") //TODO have ... } } case 51, // Expression "<<=" Expression 52: // Expression ">>=" Expression m.checkIntegerOrBoolType(lx, n.Expression, n.Expression2) n.Type = n.Expression.Type case 53, // Expression "&=" Expression 54, // Expression "^=" Expression 55: // Expression "|=" Expression m.checkIntegerOrBoolType(lx, n.Expression, n.Expression2) if _, _, n.BinOpType = m.binOp(lx, n.Expression, n.Expression2); n.BinOpType.Kind() == Undefined { lx.report.ErrTok(n.Token, "incompatible types") //TODO have ... } n.Type = n.BinOpType case 56: // "_Alignof" '(' TypeName ')' n.Type = lx.model.getSizeType(lx) t := n.TypeName.Type el := true again: switch t.Kind() { case Undefined, Function: t = nil case Struct, Union: if _, isIncomplete := t.Members(); isIncomplete { t = nil break } case Array: if el { el = false t = t.Element() goto again } } if t == nil { lx.report.Err(n.TypeName.Pos(), "invalid argument of _Alignof") n.Value = lx.model.MustConvert(1, n.Type) break } al := t.AlignOf() if al < 0 { lx.report.Err(n.TypeName.Pos(), "invalid argument of _Alignof") al = 1 } n.Value = lx.model.MustConvert(int32(al), n.Type) case 57: // '(' CompoundStatement ')' // Case 57 if !lx.tweaks.enableParenCompoundStmt { lx.report.Err(n.Pos(), "non-standard parenthesized compound statement as expression not enabled") break } n.Type = lx.model.VoidType o := n.CompoundStatement.BlockItemListOpt if o == nil { break } var last *BlockItem for l := o.BlockItemList; l != nil; l = l.BlockItemList { if l.BlockItemList == nil { last = l.BlockItem } } if last == nil { break } switch last.Case { case 0: // Declaration // nop case 1: // Statement // Case 1 if es := last.Statement.ExpressionStatement; es != nil { o := es.ExpressionListOpt if o != nil { el := o.ExpressionList n.Type, n.Value = el.Type, el.Value } } default: panic("internal error") } case 58: // "&&" IDENTIFIER // Case 58 n.Type = lx.model.VoidType.Pointer() n.Value = ComputedGotoID(n.Token2.Val) case 59: // Expression '?' ':' Expression // Case 59 n.cond(lx, n.Expression) default: //dbg("", PrettyString(n)) panic(fmt.Errorf("%s: internal error: Expression.Case: %v", position(n.Pos()), n.Case)) } //ct := n.Type.(*ctype) //s := "" //if n.Value != nil { // s = fmt.Sprintf("value: %T(%#v)", n.Value, n.Value) //} //dbg("tc %v %v %v %v %v: %v %v", position(n.Pos()), n.Case, ct.resultStars, ct.stars, ct, ct.Kind(), s) return n.Value, n.Type } // IdentResolutionScope returns the scope an identifier is resolved in. If n is // not an identifier (n.Case == 0), IdentResolutionScope returns nil. func (n *Expression) IdentResolutionScope() *Bindings { if n.Case == 0 { // IDENTIFIER return n.scope } return nil } // ------------------------------------------------------------- ExpressionList func (n *ExpressionList) eval(lx *lexer) (interface{}, Type) { if n.Type != nil { return n.Value, n.Type } n0 := n for ; n != nil; n = n.ExpressionList { n.Value, n.Type = n.Expression.eval(lx) n0.Value, n0.Type = n.Value, n.Type } return n0.Value, n0.Type } // Len returns the number of items in n. func (n *ExpressionList) Len() (r int) { for ; n != nil; n = n.ExpressionList { r++ } return r } // --------------------------------------------------------- FunctionDefinition func (*FunctionDefinition) post(lx *lexer, d *Declarator, dlo *DeclarationListOpt) { lx.scope.mergeScope = nil done := false for dd := d.DirectDeclarator.bottom(); !done && dd != nil; dd = dd.parent { switch dd.Case { case 6: // DirectDeclarator '(' ParameterTypeList ')' done = true lx.scope.mergeScope = dd.paramsScope if dlo != nil { lx.report.Err(dlo.Pos(), "declaration list not allowed in a function definition with parameter type list") } case 7: // DirectDeclarator '(' IdentifierListOpt ')' done = true ilo := dd.IdentifierListOpt if ilo != nil && dlo == nil { if !lx.tweaks.enableOmitFuncArgTypes { lx.report.Err(ilo.Pos(), "missing parameter declaration list") break } lx.pushScope(ScopeParams) for l := ilo.IdentifierList; l != nil; l = l.IdentifierList { tok := l.Token if l.Case == 1 { tok = l.Token2 } d := lx.model.makeDeclarator(0, tsInt) d.Type = lx.model.IntType lx.scope.declareIdentifier(tok, d.DirectDeclarator, lx.report) ilo.params = append(ilo.params, Parameter{d, tok.Val, d.Type}) } lx.scope.mergeScope, _ = lx.popScope(dd.Token2) break } if ilo == nil { if dlo != nil { lx.report.Err(dlo.Pos(), "unexpected parameter declaration list") } break } // ilo != nil && dlo != nil lx.scope.mergeScope = dlo.paramsScope ilo.post(lx, dlo) } } d.setFull(lx) if !done { lx.report.Err(d.Pos(), "declarator is not a function (have '%s': %v)", d.Type, d.Type.Kind()) } lx.fnDeclarator = d } // ---------------------------------------------------------- IdentifierListOpt func (n *IdentifierListOpt) post(lx *lexer, dlo *DeclarationListOpt) { type r struct { pos token.Pos i int } var a []xc.Token ilm := map[int]r{} i := 0 for il := n.IdentifierList; il != nil; il, i = il.IdentifierList, i+1 { t := il.Token if il.Case == 1 { t = il.Token2 } nm := t.Val if r, ok := ilm[nm]; ok { lx.report.ErrTok(t, "duplicate parameter name declaration, previous at %s", r.pos) continue } v := r{t.Pos(), i} ilm[nm] = v a = append(a, t) } params := make([]Parameter, len(ilm)) if dlo != nil { for dl := dlo.DeclarationList; dl != nil; dl = dl.DeclarationList { decl := dl.Declaration o := decl.InitDeclaratorListOpt if o == nil { lx.report.Err(decl.Pos(), "invalid parameter declaration") continue } for l := o.InitDeclaratorList; l != nil; l = l.InitDeclaratorList { id := l.InitDeclarator if id.Case == 1 { // Declarator '=' Initializer lx.report.Err(id.Pos(), "invalid parameter declarator") } d := id.Declarator nm, _ := d.Identifier() r, ok := ilm[nm] if !ok { lx.report.Err(d.Pos(), "parameter name not declared") continue } params[r.i] = Parameter{d, nm, d.Type} } } } for i, v := range params { if v.Declarator == nil { tok := a[i] d := lx.model.makeDeclarator(0, tsInt) d.Type = lx.model.IntType dlo.paramsScope.declareIdentifier(tok, d.DirectDeclarator, lx.report) params[i] = Parameter{d, tok.Val, d.Type} } } n.params = params fixParams(n.params) } // ---------------------------------------------------------------- Initializer func (n *Initializer) typeCheck(pt *Type, dt Type, static bool, lx *lexer) { static = static && !lx.tweaks.enableNonConstStaticInitExpressions if dt == nil { return } k := dt.Kind() d := dt.Declarator() dd := d.DirectDeclarator if dd.isArray() && dd.isVLA() != nil { lx.report.Err(n.Pos(), "variable length array cannot have initializers") return } switch n.Case { case 0: // Expression x := n.Expression xt := n.Expression.Type switch v := x.Value.(type) { case StringLitID: switch k { case Array, Ptr: switch dt.Element().Kind() { case Char, SChar, UChar: if pt != nil && dd.isArray() && dt.Elements() < 0 { *pt = dt.(*ctype).setElements(len(xc.Dict.S(int(v))) + 1) } default: if !xt.CanAssignTo(dt) { lx.report.Err(x.Pos(), "cannot initialize type '%v' using expression of type '%v'", dt, xt) } } default: if !xt.CanAssignTo(dt) { lx.report.Err(x.Pos(), "cannot initialize type '%v' using expression of type '%v'", dt, xt) } } return case LongStringLitID: switch k { case Array, Ptr: switch dt.Element().Kind() { case Short, UShort, Int, UInt, Long, ULong: if pt != nil && dd.isArray() && dt.Elements() < 0 { *pt = dt.(*ctype).setElements(len([]rune(string(xc.Dict.S(int(v))))) + 1) } default: if !xt.CanAssignTo(dt) { lx.report.Err(x.Pos(), "cannot initialize type '%v' using expression of type '%v'", dt, xt) } } default: if !xt.CanAssignTo(dt) { lx.report.Err(x.Pos(), "cannot initialize type '%v' using expression of type '%v'", dt, xt) } } return case nil: if static { switch x.Case { case 0: // IDENTIFIER if xt.Kind() == Array && xt.CanAssignTo(dt) { break } if xt.Kind() == Function && xt.Pointer().CanAssignTo(dt) { break } lx.report.Err(x.Pos(), "cannot initialize type '%v' using expression of type '%v'", dt, xt) case 17: // '&' Expression // Case 17 if !xt.CanAssignTo(dt) { lx.report.Err(x.Pos(), "cannot initialize type '%v' using expression of type '%v'", dt, xt) } default: lx.report.Err(x.Pos(), "expressions in an initializer for an object that has static storage duration shall be constant expressions or string literals.") } return } } if !xt.CanAssignTo(dt) { //dbg("", dt, xt) if dt.Kind() == Struct || dt.Kind() == Union { if ma, _ := dt.Members(); len(ma) == 1 { //dbg("") n.typeCheck(nil, ma[0].Type, static, lx) //dbg("") return } } if dt.Kind() == Array { n.typeCheck(nil, dt.Element(), static, lx) return } lx.report.Err(x.Pos(), "cannot initialize type '%v' using expression of type '%v'", dt, xt) return } case 1: // '{' InitializerList CommaOpt '}' // Case 1 n.InitializerList.typeCheck(pt, dt, static, lx) case 2: // IDENTIFIER ':' Initializer // Case 2 p := *pt if p.Kind() != Struct && dt.Kind() != Union { lx.report.Err(n.Pos(), "invalid designator for type %v", dt) break } m, err := p.Member(n.Token.Val) if err != nil { lx.report.Err(n.Pos(), "type %v has no member %s: %v", p, dict.S(n.Token.Val), err) break } n.InitializerList.typeCheck(&p, m.Type, static, lx) default: panic("internal error") } } // ------------------------------------------------------------ InitializerList // Len returns the number of items in n. func (n *InitializerList) Len() (r int) { for ; n != nil; n = n.InitializerList { r++ } return r } func (n *InitializerList) typeCheck(pt *Type, dt Type, static bool, lx *lexer) { if n == nil || dt == nil { return } d := dt.Declarator() dd := d.DirectDeclarator switch dt.Kind() { case Struct, Union: ma, incomplete := dt.Members() if incomplete { lx.report.Err(n.Pos(), "cannot initialize incomplete type") return } if len(ma) == 1 { //dbg("%s: %v -> %v", position(n.Pos()), dt, ma[0].Type) n.InitializerList.typeCheck(nil, ma[0].Type, static, lx) return } i := 0 var stack []int for l := n; l != nil; l = l.InitializerList { var m Member switch o := l.DesignationOpt; { case o != nil: ma := ma j := 0 for l := o.Designation.DesignatorList; l != nil; l = l.DesignatorList { switch d := l.Designator; d.Case { case 0: // '[' ConstantExpression ']' panic("TODO") case 1: // '.' IDENTIFIER // Case 1 if j != 0 { ma, _ = m.Type.Members() } found := false for k, v := range ma { if d.Token2.Val == v.Name { found = true m = v if j == 0 { i = k } break } } if !found { panic("TODO") } j++ default: panic("internal error") } } default: if i >= len(ma) { //dbg("", i, len(ma)) panic("TODO") } switch l := len(stack); { case l != 0: stack[l-1]-- if stack[l-1] != 0 { i-- break } stack = stack[:l-1] i++ fallthrough default: m = ma[i] if mt := m.Type; mt.Kind() == Array && mt.Elements() >= 0 { stack = append(stack, mt.Elements()) i-- } } } p := dt l.Initializer.typeCheck(&p, m.Type, static, lx) i++ } case Array, Ptr: elems := dt.Elements() elem := dt.Element() elem0 := elem for elem0.Kind() == Array { n := elem0.Elements() if n >= 0 { if elems < 0 { elems = 1 } elems *= n } elem0 = elem0.Element() } i := 0 for l := n; l != nil; l = l.InitializerList { if o := l.DesignationOpt; o != nil { elem := elem j := 0 m := lx.model for l := o.Designation.DesignatorList; l != nil; l = l.DesignatorList { switch d := l.Designator; d.Case { case 0: // '[' ConstantExpression ']' if !IsIntType(d.ConstantExpression.Type) { panic("TODO") } switch { case j == 0: i = int(m.MustConvert(d.ConstantExpression.Value, m.IntType).(int32)) default: elem = elem.Element() } j++ case 1: // '.' IDENTIFIER // Case 1 panic("TODO") default: panic("internal error") } } } if elems >= 0 && i >= elems { panic("TODO") } switch in := l.Initializer; in.Case { case 0: // Expression in.typeCheck(nil, elem0, static, lx) i++ case 1: // '{' InitializerList CommaOpt '}' // Case 1 if !elem.Declarator().DirectDeclarator.isArray() { panic("TODO") } in.InitializerList.typeCheck(nil, elem, static, lx) i++ default: panic("internal error") } } if pt != nil && dd.isArray() && elems < 0 { //dbg("", position(n.Pos()), elem, elems) *pt = dt.(*ctype).setElements(i) } default: i := 0 for l := n; l != nil; l = l.InitializerList { if i != 0 { //dbg("%s: %v", position(n.Pos()), dt) panic("TODO") } l.Initializer.typeCheck(nil, dt, static, lx) i++ } } } // ---------------------------------------------------------- ParameterTypeList func (n *ParameterTypeList) post() { for l := n.ParameterList; l != nil; l = l.ParameterList { d := l.ParameterDeclaration.declarator nm, _ := d.Identifier() t := d.Type n.params = append(n.params, Parameter{ Declarator: d, Name: nm, Type: t, }) } if len(n.params) == 1 && n.params[0].Type.Kind() == Void { n.params = make([]Parameter, 0) // Must be non nil. } fixParams(n.params) } // -------------------------------------------------------------------- Pointer func (n *Pointer) stars() (r int) { for ; n != nil; n = n.Pointer { r++ } return r } // ----------------------------------------------------------------- PointerOpt func (n *PointerOpt) stars() int { if n == nil { return 0 } return n.Pointer.stars() } // ----------------------------------------------------- SpecifierQualifierList func (n *SpecifierQualifierList) isCompatible(m *SpecifierQualifierList) bool { if n.typeSpecifier != m.typeSpecifier { return false } switch n.TypeSpecifier.Case { case 11: // StructOrUnionSpecifier // Case 11 return true //TODO nil deref panic: return m.TypeQualifier.Case == 11 && n.TypeSpecifier.StructOrUnionSpecifier.isCompatible(m.TypeSpecifier.StructOrUnionSpecifier) default: return true } } // IsInline implements specifier. func (n *SpecifierQualifierList) IsInline() bool { return n.attr&saInline != 0 } // IsTypedef implements specifier. func (n *SpecifierQualifierList) IsTypedef() bool { return n.attr&saTypedef != 0 } // IsExtern implements specifier. func (n *SpecifierQualifierList) IsExtern() bool { return n.attr&saExtern != 0 } // IsStatic implements specifier. func (n *SpecifierQualifierList) IsStatic() bool { return n.attr&saStatic != 0 } // IsAuto implements specifier. func (n *SpecifierQualifierList) IsAuto() bool { return n.attr&saAuto != 0 } // IsRegister implements specifier. func (n *SpecifierQualifierList) IsRegister() bool { return n.attr&saRegister != 0 } // IsConst returns whether n includes the 'const' type qualifier. func (n *SpecifierQualifierList) IsConst() bool { return n.attr&saConst != 0 } // IsRestrict implements specifier. func (n *SpecifierQualifierList) IsRestrict() bool { return n.attr&saRestrict != 0 } // IsVolatile implements specifier. func (n *SpecifierQualifierList) IsVolatile() bool { return n.attr&saVolatile != 0 } // kind implements specifier. func (n *SpecifierQualifierList) kind() Kind { return tsValid[n.typeSpecifiers()] } // typeSpecifiers implements specifier. func (n *SpecifierQualifierList) typeSpecifiers() int { return n.typeSpecifier } // firstTypeSpecifier implements specifier. func (n *SpecifierQualifierList) firstTypeSpecifier() *TypeSpecifier { for n.Case != 0 { // TypeSpecifier SpecifierQualifierListOpt o := n.SpecifierQualifierListOpt if o == nil { return nil } n = o.SpecifierQualifierList } return n.TypeSpecifier } // attrs implements specifier. func (n *SpecifierQualifierList) attrs() int { return n.attr } // member implements specifier. func (n *SpecifierQualifierList) member(nm int) (*Member, error) { return n.firstTypeSpecifier().member(nm) } // str implements specifier. func (n *SpecifierQualifierList) str() string { return specifierString(n) } // TypedefName implements Specifier. func (n *SpecifierQualifierList) TypedefName() int { if n.kind() == TypedefName { return n.firstTypeSpecifier().Token.Val } return 0 } // ----------------------------------------------------------- StructDeclarator func (n *StructDeclarator) post(lx *lexer) { sc := lx.scope switch n.Case { case 0: // Declarator if sc.bitOffset != 0 { finishBitField(n, lx) } t := n.Declarator.Type sz := t.sizeOf(lx) al := t.structAlignOf(lx) switch { case sc.isUnion: // Track union size. sc.maxSize = mathutil.Max(sc.maxSize, sz) default: off := sc.offset sc.offset = align(sc.offset, al) // Bump offset if necessary. if pd := sc.prevStructDeclarator; pd != nil { pd.padding = sc.offset - off } n.Declarator.offsetOf = sc.offset sc.offset += sz // Allocate sz. } sc.maxAlign = mathutil.Max(sc.maxAlign, al) sc.prevStructDeclarator = n.Declarator case 1: // DeclaratorOpt ':' ConstantExpression t := lx.model.IntType if o := n.DeclaratorOpt; o != nil { t = o.Declarator.Type } var w int switch x := n.ConstantExpression.Value.(type) { case int32: w = int(x) case int64: w = int(x) if m := t.sizeOf(lx) * 8; x > int64(m) { lx.report.Err(n.ConstantExpression.Pos(), "width of bit field exceeds its type") w = m } case uint64: w = int(x) m := t.sizeOf(lx) * 8 if x > uint64(m) { lx.report.Err(n.ConstantExpression.Pos(), "width of bit field exceeds its type") w = m break } if x > uint64(lx.model.Items[Int].Size*8) { lx.report.Err(n.ConstantExpression.Pos(), "width of bit field exceeds int bits") w = m break } default: panic("internal error") } if m := t.sizeOf(lx) * 8; w > m { lx.report.Err(n.ConstantExpression.Pos(), "width of bit field exceeds its type") w = m } maxLLBits := lx.model.LongLongType.sizeOf(lx) * 8 maxBits := lx.model.LongType.sizeOf(lx) * 8 if sum := sc.bitOffset + w; sum > maxBits { if sum > maxLLBits || w <= maxBits { finishBitField(n, lx) } } if o := n.DeclaratorOpt; o != nil { d := o.Declarator d.offsetOf = sc.offset d.bitOffset = sc.bitOffset d.bitFieldGroup = sc.bitFieldGroup sc.prevStructDeclarator = o.Declarator t = d.Type switch t.Kind() { case Char, SChar, UChar, Int, UInt, Long, ULong, Short, UShort, Enum, Bool: // ok case LongLong, ULongLong: if lx.tweaks.enableWideBitFieldTypes { // Non-standard, but enabled. break } lx.report.Err(n.ConstantExpression.Pos(), "bit field has invalid type (have %s)", t) t = lx.model.IntType default: lx.report.Err(n.ConstantExpression.Pos(), "bit field has invalid type (have %s)", t) t = lx.model.IntType } } sc.bitOffset += w default: panic(n.Case) } } func (n *StructDeclarator) isCompatible(m *StructDeclarator) bool { if n.Case != m.Case { return false } switch n.Case { case 0: // Declarator return n.Declarator.isCompatible(m.Declarator) case 1: // DeclaratorOpt ':' ConstantExpression // Case 1 ty1 := n.ConstantExpression.Expression.Type.(*ctype) ty2 := m.ConstantExpression.Expression.Type.(*ctype) return n.DeclaratorOpt.isCompatible(m.DeclaratorOpt) && ty1.isCompatible(ty2) default: panic(fmt.Errorf("%s: internal error", position(n.Pos()))) } } // -------------------------------------------------------------- StructDeclaratorList func (n *StructDeclaratorList) isCompatible(m *StructDeclaratorList) bool { for ; n != nil; n = n.StructDeclaratorList { if m == nil { return false } sda := n.StructDeclarator sdb := m.StructDeclarator if !sda.isCompatible(sdb) { return false } m = m.StructDeclaratorList } if m != nil { return false } return true } // -------------------------------------------------------------- StructOrUnion func (n *StructOrUnion) typeSpecifiers() int { switch n.Token.Rune { case STRUCT: return tsStructSpecifier case UNION: return tsUnionSpecifier default: panic("internal error") } } func (n *StructOrUnion) isCompatible(m *StructOrUnion) (r bool) { return n == m || n.Case == m.Case } func (n *StructOrUnion) str() string { switch n.Token.Rune { case STRUCT: return "struct" case UNION: return "union" default: panic("internal error") } } // ----------------------------------------------------- StructOrUnionSpecifier // Declarator returns a synthetic Declarator when a tagged struc/union type is // defined inline a declaration. func (n *StructOrUnionSpecifier) Declarator() *Declarator { return n.declarator } func (n *StructOrUnionSpecifier) typeSpecifiers() int { return n.StructOrUnion.typeSpecifiers() } func (n *StructOrUnionSpecifier) isCompatible(m *StructOrUnionSpecifier) (r bool) { if n == m { return true } if !n.StructOrUnion.isCompatible(m.StructOrUnion) { return false } if n.Case > m.Case { n, m = m, n } switch n.Case { case 0: // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' switch m.Case { case 0: // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' b := m.StructDeclarationList for a := n.StructDeclarationList; a != nil; a = a.StructDeclarationList { if b == nil { return false } sda := a.StructDeclaration sdb := b.StructDeclaration if sda.Case != sdb.Case { return false } switch sda.Case { case 0: // SpecifierQualifierList StructDeclaratorList ';' if !sda.StructDeclaratorList.isCompatible(sdb.StructDeclaratorList) { return false } case 1: // SpecifierQualifierList ';' // Case 1 switch sdb.Case { case 1: // SpecifierQualifierList ';' // Case 1 if !sda.SpecifierQualifierList.isCompatible(sdb.SpecifierQualifierList) { return false } default: return false } case 2: // StaticAssertDeclaration // Case 2 panic(fmt.Errorf("%s: TODO", position(n.Pos()))) default: panic(fmt.Errorf("%s: internal error", position(n.Pos()))) } b = b.StructDeclarationList } return b == nil case 1: // StructOrUnion IDENTIFIER if o := n.IdentifierOpt; o != nil { return o.Token.Val == m.Token.Val } panic("TODO") default: panic(m.Case) } case 1: // StructOrUnion IDENTIFIER switch m.Case { case 1: // StructOrUnion IDENTIFIER return n.Token.Val == m.Token.Val default: panic(m.Case) } default: panic(n.Case) } } func (n *StructOrUnionSpecifier) member(nm int) (*Member, error) { switch n.Case { case 0: // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' b, s := n.scope.Lookup2(NSIdentifiers, nm) if s != n.scope { var t []byte if o := n.IdentifierOpt; o != nil { t = o.Token.S() } return nil, fmt.Errorf("%s %s has no member named %s", n.StructOrUnion.str(), t, xc.Dict.S(nm)) } d := b.Node.(*DirectDeclarator).top().declarator return &Member{ Bits: d.bits, Declarator: d, Name: nm, OffsetOf: d.offsetOf, Type: d.Type, }, nil case 1: // StructOrUnion IDENTIFIER b := n.scope.Lookup(NSTags, n.Token.Val) n2, def := b.Node.(*StructOrUnionSpecifier) if !def { return nil, fmt.Errorf("invalid use of undefined type '%s %s'", n.StructOrUnion.str(), n.Token.S()) } return n2.member(nm) default: panic(n.Case) } } // -------------------------------------------------------------- TypeSpecifier func (n *TypeSpecifier) member(nm int) (*Member, error) { switch n.Case { case 11: // StructOrUnionSpecifier return n.StructOrUnionSpecifier.member(nm) default: panic("internal error") } } ================================================ FILE: ast_test.go ================================================ // Code generated by yy. DO NOT EDIT. // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "fmt" ) func ExampleAbstractDeclarator() { fmt.Println(exampleAST(185, "\U00100001 ( _Bool * )")) // Output: // &cc.AbstractDeclarator{ // · Pointer: &cc.Pointer{ // · · Token: example185.c:1:10: '*', // · }, // } } func ExampleAbstractDeclarator_case1() { fmt.Println(exampleAST(186, "\U00100001 ( _Bool ( ) )")) // Output: // &cc.AbstractDeclarator{ // · Case: 1, // · DirectAbstractDeclarator: &cc.DirectAbstractDeclarator{ // · · Case: 6, // · · Token: example186.c:1:10: '(', // · · Token2: example186.c:1:12: ')', // · }, // } } func ExampleAbstractDeclaratorOpt() { fmt.Println(exampleAST(187, "\U00100001 ( _Bool )") == (*AbstractDeclaratorOpt)(nil)) // Output: // true } func ExampleAbstractDeclaratorOpt_case1() { fmt.Println(exampleAST(188, "\U00100001 ( _Bool * )")) // Output: // &cc.AbstractDeclaratorOpt{ // · AbstractDeclarator: &cc.AbstractDeclarator{ // · · Pointer: &cc.Pointer{ // · · · Token: example188.c:1:10: '*', // · · }, // · }, // } } func ExampleArgumentExpressionList() { fmt.Println(exampleAST(8, "\U00100001 'a' ( 'b' )")) // Output: // &cc.ArgumentExpressionList{ // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example8.c:1:8: CHARCONST "'b'", // · }, // } } func ExampleArgumentExpressionList_case1() { fmt.Println(exampleAST(9, "\U00100001 'a' ( 'b' , 'c' )")) // Output: // &cc.ArgumentExpressionList{ // · ArgumentExpressionList: &cc.ArgumentExpressionList{ // · · Case: 1, // · · Expression: &cc.Expression{ // · · · Case: 1, // · · · Token: example9.c:1:14: CHARCONST "'c'", // · · }, // · · Token: example9.c:1:12: ',', // · }, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example9.c:1:8: CHARCONST "'b'", // · }, // } } func ExampleArgumentExpressionListOpt() { fmt.Println(exampleAST(10, "\U00100001 'a' ( )") == (*ArgumentExpressionListOpt)(nil)) // Output: // true } func ExampleArgumentExpressionListOpt_case1() { fmt.Println(exampleAST(11, "\U00100001 'a' ( 'b' )")) // Output: // &cc.ArgumentExpressionListOpt{ // · ArgumentExpressionList: &cc.ArgumentExpressionList{ // · · Expression: &cc.Expression{ // · · · Case: 1, // · · · Token: example11.c:1:8: CHARCONST "'b'", // · · }, // · }, // } } func ExampleAssemblerInstructions() { fmt.Println(exampleAST(265, "\U00100002 asm ( \"a\" )")) // Output: // &cc.AssemblerInstructions{ // · Token: example265.c:1:8: STRINGLITERAL "\"a\"", // } } func ExampleAssemblerInstructions_case1() { fmt.Println(exampleAST(266, "\U00100002 asm ( \"a\" \"b\" )")) // Output: // &cc.AssemblerInstructions{ // · AssemblerInstructions: &cc.AssemblerInstructions{ // · · Case: 1, // · · Token: example266.c:1:12: STRINGLITERAL "\"b\"", // · }, // · Token: example266.c:1:8: STRINGLITERAL "\"a\"", // } } func ExampleAssemblerOperand() { fmt.Println(exampleAST(270, "\U00100002 a asm ( \"b\" : \"c\" ( 'd' ) )")) // Output: // &cc.AssemblerOperand{ // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example270.c:1:22: CHARCONST "'d'", // · }, // · Token: example270.c:1:16: STRINGLITERAL "\"c\"", // · Token2: example270.c:1:20: '(', // · Token3: example270.c:1:26: ')', // } } func ExampleAssemblerOperands() { fmt.Println(exampleAST(271, "\U00100002 a asm ( \"b\" : \"c\" ( 'd' ) )")) // Output: // &cc.AssemblerOperands{ // · AssemblerOperand: &cc.AssemblerOperand{ // · · Expression: &cc.Expression{ // · · · Case: 1, // · · · Token: example271.c:1:22: CHARCONST "'d'", // · · }, // · · Token: example271.c:1:16: STRINGLITERAL "\"c\"", // · · Token2: example271.c:1:20: '(', // · · Token3: example271.c:1:26: ')', // · }, // } } func ExampleAssemblerOperands_case1() { fmt.Println(exampleAST(272, "\U00100002 a asm ( \"b\" : \"c\" ( 'd' ) , \"e\" ( 'f' ) )")) // Output: // &cc.AssemblerOperands{ // · AssemblerOperand: &cc.AssemblerOperand{ // · · Expression: &cc.Expression{ // · · · Case: 1, // · · · Token: example272.c:1:22: CHARCONST "'d'", // · · }, // · · Token: example272.c:1:16: STRINGLITERAL "\"c\"", // · · Token2: example272.c:1:20: '(', // · · Token3: example272.c:1:26: ')', // · }, // · AssemblerOperands: &cc.AssemblerOperands{ // · · AssemblerOperand: &cc.AssemblerOperand{ // · · · Expression: &cc.Expression{ // · · · · Case: 1, // · · · · Token: example272.c:1:36: CHARCONST "'f'", // · · · }, // · · · Token: example272.c:1:30: STRINGLITERAL "\"e\"", // · · · Token2: example272.c:1:34: '(', // · · · Token3: example272.c:1:40: ')', // · · }, // · · Case: 1, // · · Token: example272.c:1:28: ',', // · }, // } } func ExampleAssemblerStatement() { fmt.Println(exampleAST(277, "\U00100002 a asm ( \"b\" ) !")) // Output: // &cc.AssemblerStatement{ // · BasicAssemblerStatement: &cc.BasicAssemblerStatement{ // · · AssemblerInstructions: &cc.AssemblerInstructions{ // · · · Token: example277.c:1:10: STRINGLITERAL "\"b\"", // · · }, // · · Token: example277.c:1:4: ASM "asm", // · · Token2: example277.c:1:8: '(', // · · Token3: example277.c:1:14: ')', // · }, // } } func ExampleAssemblerStatement_case1() { fmt.Println(exampleAST(278, "\U00100002 a asm ( \"b\" : \"c\" ( 'd' ) ) !")) // Output: // &cc.AssemblerStatement{ // · AssemblerInstructions: &cc.AssemblerInstructions{ // · · Token: example278.c:1:10: STRINGLITERAL "\"b\"", // · }, // · AssemblerOperands: &cc.AssemblerOperands{ // · · AssemblerOperand: &cc.AssemblerOperand{ // · · · Expression: &cc.Expression{ // · · · · Case: 1, // · · · · Token: example278.c:1:22: CHARCONST "'d'", // · · · }, // · · · Token: example278.c:1:16: STRINGLITERAL "\"c\"", // · · · Token2: example278.c:1:20: '(', // · · · Token3: example278.c:1:26: ')', // · · }, // · }, // · Case: 1, // · Token: example278.c:1:4: ASM "asm", // · Token2: example278.c:1:8: '(', // · Token3: example278.c:1:14: ':', // · Token4: example278.c:1:28: ')', // } } func ExampleAssemblerStatement_case2() { fmt.Println(exampleAST(279, "\U00100002 a asm ( \"b\" : \"c\" ( 'd' ) : \"e\" ( 'f' ) ) !")) // Output: // &cc.AssemblerStatement{ // · AssemblerInstructions: &cc.AssemblerInstructions{ // · · Token: example279.c:1:10: STRINGLITERAL "\"b\"", // · }, // · AssemblerOperands: &cc.AssemblerOperands{ // · · AssemblerOperand: &cc.AssemblerOperand{ // · · · Expression: &cc.Expression{ // · · · · Case: 1, // · · · · Token: example279.c:1:22: CHARCONST "'d'", // · · · }, // · · · Token: example279.c:1:16: STRINGLITERAL "\"c\"", // · · · Token2: example279.c:1:20: '(', // · · · Token3: example279.c:1:26: ')', // · · }, // · }, // · AssemblerOperands2: &cc.AssemblerOperands{ // · · AssemblerOperand: &cc.AssemblerOperand{ // · · · Expression: &cc.Expression{ // · · · · Case: 1, // · · · · Token: example279.c:1:36: CHARCONST "'f'", // · · · }, // · · · Token: example279.c:1:30: STRINGLITERAL "\"e\"", // · · · Token2: example279.c:1:34: '(', // · · · Token3: example279.c:1:40: ')', // · · }, // · }, // · Case: 2, // · Token: example279.c:1:4: ASM "asm", // · Token2: example279.c:1:8: '(', // · Token3: example279.c:1:14: ':', // · Token4: example279.c:1:28: ':', // · Token5: example279.c:1:42: ')', // } } func ExampleAssemblerStatement_case3() { fmt.Println(exampleAST(280, "\U00100002 a asm ( \"b\" : \"c\" ( 'd' ) : \"e\" ( 'f' ) : \"g\" ) !")) // Output: // &cc.AssemblerStatement{ // · AssemblerInstructions: &cc.AssemblerInstructions{ // · · Token: example280.c:1:10: STRINGLITERAL "\"b\"", // · }, // · AssemblerOperands: &cc.AssemblerOperands{ // · · AssemblerOperand: &cc.AssemblerOperand{ // · · · Expression: &cc.Expression{ // · · · · Case: 1, // · · · · Token: example280.c:1:22: CHARCONST "'d'", // · · · }, // · · · Token: example280.c:1:16: STRINGLITERAL "\"c\"", // · · · Token2: example280.c:1:20: '(', // · · · Token3: example280.c:1:26: ')', // · · }, // · }, // · AssemblerOperands2: &cc.AssemblerOperands{ // · · AssemblerOperand: &cc.AssemblerOperand{ // · · · Expression: &cc.Expression{ // · · · · Case: 1, // · · · · Token: example280.c:1:36: CHARCONST "'f'", // · · · }, // · · · Token: example280.c:1:30: STRINGLITERAL "\"e\"", // · · · Token2: example280.c:1:34: '(', // · · · Token3: example280.c:1:40: ')', // · · }, // · }, // · Case: 3, // · Clobbers: &cc.Clobbers{ // · · Token: example280.c:1:44: STRINGLITERAL "\"g\"", // · }, // · Token: example280.c:1:4: ASM "asm", // · Token2: example280.c:1:8: '(', // · Token3: example280.c:1:14: ':', // · Token4: example280.c:1:28: ':', // · Token5: example280.c:1:42: ':', // · Token6: example280.c:1:48: ')', // } } func ExampleAssemblerStatement_case4() { fmt.Println(exampleAST(281, "\U00100002 a asm goto ( \"b\" : : \"c\" ( 'd' ) : \"e\" : f ) !")) // Output: // &cc.AssemblerStatement{ // · AssemblerInstructions: &cc.AssemblerInstructions{ // · · Token: example281.c:1:15: STRINGLITERAL "\"b\"", // · }, // · AssemblerOperands: &cc.AssemblerOperands{ // · · AssemblerOperand: &cc.AssemblerOperand{ // · · · Expression: &cc.Expression{ // · · · · Case: 1, // · · · · Token: example281.c:1:29: CHARCONST "'d'", // · · · }, // · · · Token: example281.c:1:23: STRINGLITERAL "\"c\"", // · · · Token2: example281.c:1:27: '(', // · · · Token3: example281.c:1:33: ')', // · · }, // · }, // · Case: 4, // · Clobbers: &cc.Clobbers{ // · · Token: example281.c:1:37: STRINGLITERAL "\"e\"", // · }, // · IdentifierList: &cc.IdentifierList{ // · · Token: example281.c:1:43: IDENTIFIER "f", // · }, // · Token: example281.c:1:4: ASM "asm", // · Token2: example281.c:1:8: GOTO "goto", // · Token3: example281.c:1:13: '(', // · Token4: example281.c:1:19: ':', // · Token5: example281.c:1:21: ':', // · Token6: example281.c:1:35: ':', // · Token7: example281.c:1:41: ':', // · Token8: example281.c:1:45: ')', // } } func ExampleAssemblerStatement_case5() { fmt.Println(exampleAST(282, "\U00100002 a asm ( \"b\" : ) !")) // Output: // &cc.AssemblerStatement{ // · AssemblerInstructions: &cc.AssemblerInstructions{ // · · Token: example282.c:1:10: STRINGLITERAL "\"b\"", // · }, // · Case: 5, // · Token: example282.c:1:4: ASM "asm", // · Token2: example282.c:1:8: '(', // · Token3: example282.c:1:14: ':', // · Token4: example282.c:1:16: ')', // } } func ExampleAssemblerStatement_case6() { fmt.Println(exampleAST(283, "\U00100002 a asm ( \"b\" : : \"c\" ( 'd' ) ) !")) // Output: // &cc.AssemblerStatement{ // · AssemblerInstructions: &cc.AssemblerInstructions{ // · · Token: example283.c:1:10: STRINGLITERAL "\"b\"", // · }, // · AssemblerOperands: &cc.AssemblerOperands{ // · · AssemblerOperand: &cc.AssemblerOperand{ // · · · Expression: &cc.Expression{ // · · · · Case: 1, // · · · · Token: example283.c:1:24: CHARCONST "'d'", // · · · }, // · · · Token: example283.c:1:18: STRINGLITERAL "\"c\"", // · · · Token2: example283.c:1:22: '(', // · · · Token3: example283.c:1:28: ')', // · · }, // · }, // · Case: 6, // · Token: example283.c:1:4: ASM "asm", // · Token2: example283.c:1:8: '(', // · Token3: example283.c:1:14: ':', // · Token4: example283.c:1:16: ':', // · Token5: example283.c:1:30: ')', // } } func ExampleAssemblerSymbolicNameOpt() { fmt.Println(exampleAST(273, "\U00100002 a asm goto ( \"b\" : : \"c\"") == (*AssemblerSymbolicNameOpt)(nil)) // Output: // true } func ExampleAssemblerSymbolicNameOpt_case1() { fmt.Println(exampleAST(274, "\U00100002 a asm ( \"b\" : [ c ] \"d\"")) // Output: // &cc.AssemblerSymbolicNameOpt{ // · Token: example274.c:1:16: '[', // · Token2: example274.c:1:18: IDENTIFIER "c", // · Token3: example274.c:1:20: ']', // } } func ExampleBasicAssemblerStatement() { fmt.Println(exampleAST(267, "\U00100002 asm ( \"a\" ) !")) // Output: // &cc.BasicAssemblerStatement{ // · AssemblerInstructions: &cc.AssemblerInstructions{ // · · Token: example267.c:1:8: STRINGLITERAL "\"a\"", // · }, // · Token: example267.c:1:2: ASM "asm", // · Token2: example267.c:1:6: '(', // · Token3: example267.c:1:12: ')', // } } func ExampleBlockItem() { fmt.Println(exampleAST(230, "\U00100001 ( { auto ; !")) // Output: // &cc.BlockItem{ // · Declaration: &cc.Declaration{ // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Case: 3, // · · · · Token: example230.c:1:6: AUTO "auto", // · · · }, // · · }, // · · Token: example230.c:1:11: ';', // · }, // } } func ExampleBlockItem_case1() { fmt.Println(exampleAST(231, "\U00100001 ( { ; !")) // Output: // &cc.BlockItem{ // · Case: 1, // · Statement: &cc.Statement{ // · · Case: 2, // · · ExpressionStatement: &cc.ExpressionStatement{ // · · · Token: example231.c:1:6: ';', // · · }, // · }, // } } func ExampleBlockItemList() { fmt.Println(exampleAST(226, "\U00100001 ( { ; !")) // Output: // &cc.BlockItemList{ // · BlockItem: &cc.BlockItem{ // · · Case: 1, // · · Statement: &cc.Statement{ // · · · Case: 2, // · · · ExpressionStatement: &cc.ExpressionStatement{ // · · · · Token: example226.c:1:6: ';', // · · · }, // · · }, // · }, // } } func ExampleBlockItemList_case1() { fmt.Println(exampleAST(227, "\U00100001 ( { ; ; !")) // Output: // &cc.BlockItemList{ // · BlockItem: &cc.BlockItem{ // · · Case: 1, // · · Statement: &cc.Statement{ // · · · Case: 2, // · · · ExpressionStatement: &cc.ExpressionStatement{ // · · · · Token: example227.c:1:6: ';', // · · · }, // · · }, // · }, // · BlockItemList: &cc.BlockItemList{ // · · BlockItem: &cc.BlockItem{ // · · · Case: 1, // · · · Statement: &cc.Statement{ // · · · · Case: 2, // · · · · ExpressionStatement: &cc.ExpressionStatement{ // · · · · · Token: example227.c:1:8: ';', // · · · · }, // · · · }, // · · }, // · · Case: 1, // · }, // } } func ExampleBlockItemListOpt() { fmt.Println(exampleAST(228, "\U00100001 ( { }") == (*BlockItemListOpt)(nil)) // Output: // true } func ExampleBlockItemListOpt_case1() { fmt.Println(exampleAST(229, "\U00100001 ( { ; }")) // Output: // &cc.BlockItemListOpt{ // · BlockItemList: &cc.BlockItemList{ // · · BlockItem: &cc.BlockItem{ // · · · Case: 1, // · · · Statement: &cc.Statement{ // · · · · Case: 2, // · · · · ExpressionStatement: &cc.ExpressionStatement{ // · · · · · Token: example229.c:1:6: ';', // · · · · }, // · · · }, // · · }, // · }, // } } func ExampleClobbers() { fmt.Println(exampleAST(275, "\U00100002 a asm goto ( \"b\" : : \"c\" ( 'd' ) : \"e\" )")) // Output: // &cc.Clobbers{ // · Token: example275.c:1:37: STRINGLITERAL "\"e\"", // } } func ExampleClobbers_case1() { fmt.Println(exampleAST(276, "\U00100002 a asm goto ( \"b\" : : \"c\" ( 'd' ) : \"e\" , \"f\" )")) // Output: // &cc.Clobbers{ // · Clobbers: &cc.Clobbers{ // · · Case: 1, // · · Token: example276.c:1:41: ',', // · · Token2: example276.c:1:43: STRINGLITERAL "\"f\"", // · }, // · Token: example276.c:1:37: STRINGLITERAL "\"e\"", // } } func ExampleCommaOpt() { fmt.Println(exampleAST(135, "\U00100002 auto a = { }") == (*CommaOpt)(nil)) // Output: // true } func ExampleCommaOpt_case1() { fmt.Println(exampleAST(136, "\U00100002 auto a = { , }")) // Output: // &cc.CommaOpt{ // · Token: example136.c:1:13: ',', // } } func ExampleCompoundStatement() { fmt.Println(exampleAST(225, "\U00100001 ( { }")) // Output: // &cc.CompoundStatement{ // · Token: example225.c:1:4: '{', // · Token2: example225.c:1:6: '}', // } } func ExampleConstantExpression() { fmt.Println(exampleAST(79, "\U00100001 'a'")) // Output: // &cc.ConstantExpression{ // · Type: int, // · Value: 97, // · Expression: &cc.Expression{ // · · Type: int, // · · Value: 97, // · · Case: 1, // · · Token: example79.c:1:2: CHARCONST "'a'", // · }, // } } func ExampleControlLine() { fmt.Println(exampleAST(307, "\U00100000 \n#define a ")) // Output: // &cc.ControlLine{ // · ReplacementList: []xc.Token{ // len 1 // · · 0: example307.c:2:10: ' ', // · }, // · Token: example307.c:2:2: PPDEFINE, // · Token2: example307.c:2:9: IDENTIFIER "a", // } } func ExampleControlLine_case01() { fmt.Println(exampleAST(308, "\U00100000 \n#define a( ... ) ")) // Output: // &cc.ControlLine{ // · Case: 1, // · ReplacementList: []xc.Token{ // len 1 // · · 0: example308.c:2:17: ' ', // · }, // · Token: example308.c:2:2: PPDEFINE, // · Token2: example308.c:2:9: IDENTIFIER_LPAREN "a(", // · Token3: example308.c:2:12: DDD, // · Token4: example308.c:2:16: ')', // } } func ExampleControlLine_case02() { fmt.Println(exampleAST(309, "\U00100000 \n#define a( b , ... ) ")) // Output: // &cc.ControlLine{ // · Case: 2, // · IdentifierList: &cc.IdentifierList{ // · · Token: example309.c:2:12: IDENTIFIER "b", // · }, // · ReplacementList: []xc.Token{ // len 1 // · · 0: example309.c:2:21: ' ', // · }, // · Token: example309.c:2:2: PPDEFINE, // · Token2: example309.c:2:9: IDENTIFIER_LPAREN "a(", // · Token3: example309.c:2:14: ',', // · Token4: example309.c:2:16: DDD, // · Token5: example309.c:2:20: ')', // } } func ExampleControlLine_case03() { fmt.Println(exampleAST(310, "\U00100000 \n#define a( ) ")) // Output: // &cc.ControlLine{ // · Case: 3, // · ReplacementList: []xc.Token{ // len 1 // · · 0: example310.c:2:13: ' ', // · }, // · Token: example310.c:2:2: PPDEFINE, // · Token2: example310.c:2:9: IDENTIFIER_LPAREN "a(", // · Token3: example310.c:2:12: ')', // } } func ExampleControlLine_case04() { fmt.Println(exampleAST(311, "\U00100000 \n#error ")) // Output: // &cc.ControlLine{ // · Case: 4, // · PPTokenListOpt: []xc.Token{ // len 1 // · · 0: example311.c:2:7: ' ', // · }, // · Token: example311.c:2:2: PPERROR, // } } func ExampleControlLine_case05() { fmt.Println(exampleAST(312, "\U00100000 \n#")) // Output: // &cc.ControlLine{ // · Case: 5, // · Token: example312.c:2:2: PPHASH_NL, // } } func ExampleControlLine_case06() { fmt.Println(exampleAST(313, "\U00100000 \n#include other_a ")) // Output: // &cc.ControlLine{ // · Case: 6, // · PPTokenList: []xc.Token{ // len 3 // · · 0: example313.c:2:9: ' ', // · · 1: example313.c:2:10: IDENTIFIER "other_a", // · · 2: example313.c:2:17: ' ', // · }, // · Token: example313.c:2:2: PPINCLUDE, // · Token2: example313.c:2:18: '\n', // } } func ExampleControlLine_case07() { fmt.Println(exampleAST(314, "\U00100000 \n#line other_a ")) // Output: // &cc.ControlLine{ // · Case: 7, // · PPTokenList: []xc.Token{ // len 3 // · · 0: example314.c:2:6: ' ', // · · 1: example314.c:2:7: IDENTIFIER "other_a", // · · 2: example314.c:2:14: ' ', // · }, // · Token: example314.c:2:2: PPLINE, // · Token2: example314.c:2:15: '\n', // } } func ExampleControlLine_case08() { fmt.Println(exampleAST(315, "\U00100000 \n#pragma ")) // Output: // &cc.ControlLine{ // · Case: 8, // · PPTokenListOpt: []xc.Token{ // len 1 // · · 0: example315.c:2:8: ' ', // · }, // · Token: example315.c:2:2: PPPRAGMA, // } } func ExampleControlLine_case09() { fmt.Println(exampleAST(316, "\U00100000 \n#undef foo")) // Output: // &cc.ControlLine{ // · Case: 9, // · Token: example316.c:2:2: PPUNDEF, // · Token2: example316.c:2:8: IDENTIFIER "foo", // · Token3: example316.c:2:11: '\n', // } } func ExampleControlLine_case10() { fmt.Println(exampleAST(317, "\U00100000 \n#define a( b ... ) ")) // Output: // &cc.ControlLine{ // · Case: 10, // · IdentifierList: &cc.IdentifierList{ // · · Token: example317.c:2:12: IDENTIFIER "b", // · }, // · ReplacementList: []xc.Token{ // len 1 // · · 0: example317.c:2:19: ' ', // · }, // · Token: example317.c:2:2: PPDEFINE, // · Token2: example317.c:2:9: IDENTIFIER_LPAREN "a(", // · Token3: example317.c:2:14: DDD, // · Token4: example317.c:2:18: ')', // } } func ExampleControlLine_case11() { fmt.Println(exampleAST(318, "\U00100000 \n#define ")) // Output: // &cc.ControlLine{ // · Case: 11, // · Token: example318.c:2:2: PPDEFINE, // · Token2: example318.c:2:9: '\n', // } } func ExampleControlLine_case12() { fmt.Println(exampleAST(319, "\U00100000 \n#undef foo(bar)")) // Output: // &cc.ControlLine{ // · Case: 12, // · PPTokenList: []xc.Token{ // len 3 // · · 0: example319.c:2:11: '(', // · · 1: example319.c:2:12: IDENTIFIER "bar", // · · 2: example319.c:2:15: ')', // · }, // · Token: example319.c:2:2: PPUNDEF, // · Token2: example319.c:2:8: IDENTIFIER "foo", // · Token3: example319.c:2:16: '\n', // } } func ExampleControlLine_case13() { fmt.Println(exampleAST(320, "\U00100000 \n#include_next other_a ")) // Output: // &cc.ControlLine{ // · Case: 13, // · PPTokenList: []xc.Token{ // len 3 // · · 0: example320.c:2:14: ' ', // · · 1: example320.c:2:15: IDENTIFIER "other_a", // · · 2: example320.c:2:22: ' ', // · }, // · Token: example320.c:2:2: PPINCLUDE_NEXT, // · Token2: example320.c:2:23: '\n', // } } func ExampleDeclaration() { fmt.Println(exampleAST(80, "\U00100002 auto ;")) // Output: // &cc.Declaration{ // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · Case: 3, // · · · Token: example80.c:1:2: AUTO "auto", // · · }, // · }, // · Token: example80.c:1:7: ';', // } } func ExampleDeclaration_case1() { fmt.Println(exampleAST(81, "\U00100002 _Static_assert ( 'a' , \"b\" ) ;")) // Output: // &cc.Declaration{ // · Case: 1, // · StaticAssertDeclaration: &cc.StaticAssertDeclaration{ // · · ConstantExpression: &cc.ConstantExpression{ // · · · Type: int, // · · · Value: 97, // · · · Expression: &cc.Expression{ // · · · · Type: int, // · · · · Value: 97, // · · · · Case: 1, // · · · · Token: example81.c:1:19: CHARCONST "'a'", // · · · }, // · · }, // · · Token: example81.c:1:2: STATIC_ASSERT "_Static_assert", // · · Token2: example81.c:1:17: '(', // · · Token3: example81.c:1:23: ',', // · · Token4: example81.c:1:25: STRINGLITERAL "\"b\"", // · · Token5: example81.c:1:29: ')', // · · Token6: example81.c:1:31: ';', // · }, // } } func ExampleDeclarationList() { fmt.Println(exampleAST(260, "\U00100002 a auto ; {")) // Output: // &cc.DeclarationList{ // · Declaration: &cc.Declaration{ // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Case: 3, // · · · · Token: example260.c:1:4: AUTO "auto", // · · · }, // · · }, // · · Token: example260.c:1:9: ';', // · }, // } } func ExampleDeclarationList_case1() { fmt.Println(exampleAST(261, "\U00100002 a auto ; auto ; {")) // Output: // &cc.DeclarationList{ // · Declaration: &cc.Declaration{ // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Case: 3, // · · · · Token: example261.c:1:4: AUTO "auto", // · · · }, // · · }, // · · Token: example261.c:1:9: ';', // · }, // · DeclarationList: &cc.DeclarationList{ // · · Case: 1, // · · Declaration: &cc.Declaration{ // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Case: 3, // · · · · · Token: example261.c:1:11: AUTO "auto", // · · · · }, // · · · }, // · · · Token: example261.c:1:16: ';', // · · }, // · }, // } } func ExampleDeclarationListOpt() { fmt.Println(exampleAST(262, "\U00100002 a {") == (*DeclarationListOpt)(nil)) // Output: // true } func ExampleDeclarationListOpt_case1() { fmt.Println(exampleAST(264, "\U00100002 a auto ; {")) // Output: // &cc.DeclarationListOpt{ // · DeclarationList: &cc.DeclarationList{ // · · Declaration: &cc.Declaration{ // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Case: 3, // · · · · · Token: example264.c:1:4: AUTO "auto", // · · · · }, // · · · }, // · · · Token: example264.c:1:9: ';', // · · }, // · }, // } } func ExampleDeclarationSpecifiers() { fmt.Println(exampleAST(82, "\U00100002 auto (")) // Output: // &cc.DeclarationSpecifiers{ // · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · Case: 3, // · · Token: example82.c:1:2: AUTO "auto", // · }, // } } func ExampleDeclarationSpecifiers_case1() { fmt.Println(exampleAST(83, "\U00100002 _Bool (")) // Output: // &cc.DeclarationSpecifiers{ // · Case: 1, // · TypeSpecifier: &cc.TypeSpecifier{ // · · Case: 9, // · · Token: example83.c:1:2: BOOL "_Bool", // · }, // } } func ExampleDeclarationSpecifiers_case2() { fmt.Println(exampleAST(84, "\U00100002 const (")) // Output: // &cc.DeclarationSpecifiers{ // · Case: 2, // · TypeQualifier: &cc.TypeQualifier{ // · · Token: example84.c:1:2: CONST "const", // · }, // } } func ExampleDeclarationSpecifiers_case3() { fmt.Println(exampleAST(85, "\U00100002 inline (")) // Output: // &cc.DeclarationSpecifiers{ // · Case: 3, // · FunctionSpecifier: &cc.FunctionSpecifier{ // · · Token: example85.c:1:2: INLINE "inline", // · }, // } } func ExampleDeclarationSpecifiersOpt() { fmt.Println(exampleAST(86, "\U00100002 auto (") == (*DeclarationSpecifiersOpt)(nil)) // Output: // true } func ExampleDeclarationSpecifiersOpt_case1() { fmt.Println(exampleAST(87, "\U00100002 auto auto (")) // Output: // &cc.DeclarationSpecifiersOpt{ // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · Case: 3, // · · · Token: example87.c:1:7: AUTO "auto", // · · }, // · }, // } } func ExampleDeclarator() { fmt.Println(exampleAST(149, "\U00100002 a )")) // Output: // &cc.Declarator{ // · Linkage: None, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Token: example149.c:1:2: IDENTIFIER "a", // · }, // } } func ExampleDeclaratorOpt() { fmt.Println(exampleAST(150, "\U00100002 struct { _Bool :") == (*DeclaratorOpt)(nil)) // Output: // true } func ExampleDeclaratorOpt_case1() { fmt.Println(exampleAST(151, "\U00100002 struct { _Bool a :")) // Output: // &cc.DeclaratorOpt{ // · Declarator: &cc.Declarator{ // · · Linkage: None, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Token: example151.c:1:17: IDENTIFIER "a", // · · }, // · }, // } } func ExampleDesignation() { fmt.Println(exampleAST(207, "\U00100002 auto a = { . b = !")) // Output: // &cc.Designation{ // · DesignatorList: &cc.DesignatorList{ // · · Designator: &cc.Designator{ // · · · Case: 1, // · · · Token: example207.c:1:13: '.', // · · · Token2: example207.c:1:15: IDENTIFIER "b", // · · }, // · }, // · Token: example207.c:1:17: '=', // } } func ExampleDesignationOpt() { fmt.Println(exampleAST(208, "\U00100002 auto a = { !") == (*DesignationOpt)(nil)) // Output: // true } func ExampleDesignationOpt_case1() { fmt.Println(exampleAST(209, "\U00100002 auto a = { . b = !")) // Output: // &cc.DesignationOpt{ // · Designation: &cc.Designation{ // · · DesignatorList: &cc.DesignatorList{ // · · · Designator: &cc.Designator{ // · · · · Case: 1, // · · · · Token: example209.c:1:13: '.', // · · · · Token2: example209.c:1:15: IDENTIFIER "b", // · · · }, // · · }, // · · Token: example209.c:1:17: '=', // · }, // } } func ExampleDesignator() { fmt.Println(exampleAST(212, "\U00100002 auto a = { [ 'b' ] .")) // Output: // &cc.Designator{ // · ConstantExpression: &cc.ConstantExpression{ // · · Type: int, // · · Value: 98, // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 98, // · · · Case: 1, // · · · Token: example212.c:1:15: CHARCONST "'b'", // · · }, // · }, // · Token: example212.c:1:13: '[', // · Token2: example212.c:1:19: ']', // } } func ExampleDesignator_case1() { fmt.Println(exampleAST(213, "\U00100002 auto a = { . b .")) // Output: // &cc.Designator{ // · Case: 1, // · Token: example213.c:1:13: '.', // · Token2: example213.c:1:15: IDENTIFIER "b", // } } func ExampleDesignatorList() { fmt.Println(exampleAST(210, "\U00100002 auto a = { . b .")) // Output: // &cc.DesignatorList{ // · Designator: &cc.Designator{ // · · Case: 1, // · · Token: example210.c:1:13: '.', // · · Token2: example210.c:1:15: IDENTIFIER "b", // · }, // } } func ExampleDesignatorList_case1() { fmt.Println(exampleAST(211, "\U00100002 auto a = { . b . c .")) // Output: // &cc.DesignatorList{ // · Designator: &cc.Designator{ // · · Case: 1, // · · Token: example211.c:1:13: '.', // · · Token2: example211.c:1:15: IDENTIFIER "b", // · }, // · DesignatorList: &cc.DesignatorList{ // · · Case: 1, // · · Designator: &cc.Designator{ // · · · Case: 1, // · · · Token: example211.c:1:17: '.', // · · · Token2: example211.c:1:19: IDENTIFIER "c", // · · }, // · }, // } } func ExampleDirectAbstractDeclarator() { fmt.Println(exampleAST(189, "\U00100001 ( _Bool ( * ) (")) // Output: // &cc.DirectAbstractDeclarator{ // · AbstractDeclarator: &cc.AbstractDeclarator{ // · · Pointer: &cc.Pointer{ // · · · Token: example189.c:1:12: '*', // · · }, // · }, // · Token: example189.c:1:10: '(', // · Token2: example189.c:1:14: ')', // } } func ExampleDirectAbstractDeclarator_case1() { fmt.Println(exampleAST(190, "\U00100001 ( _Bool [ ] (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 1, // · Token: example190.c:1:10: '[', // · Token2: example190.c:1:12: ']', // } } func ExampleDirectAbstractDeclarator_case2() { fmt.Println(exampleAST(191, "\U00100001 ( _Bool [ const ] (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 2, // · Token: example191.c:1:10: '[', // · Token2: example191.c:1:18: ']', // · TypeQualifierList: &cc.TypeQualifierList{ // · · TypeQualifier: &cc.TypeQualifier{ // · · · Token: example191.c:1:12: CONST "const", // · · }, // · }, // } } func ExampleDirectAbstractDeclarator_case3() { fmt.Println(exampleAST(192, "\U00100001 ( _Bool [ static 'a' ] (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 3, // · Expression: &cc.Expression{ // · · Type: int, // · · Value: 97, // · · Case: 1, // · · Token: example192.c:1:19: CHARCONST "'a'", // · }, // · Token: example192.c:1:10: '[', // · Token2: example192.c:1:12: STATIC "static", // · Token3: example192.c:1:23: ']', // } } func ExampleDirectAbstractDeclarator_case4() { fmt.Println(exampleAST(193, "\U00100001 ( _Bool [ const static 'a' ] (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 4, // · Expression: &cc.Expression{ // · · Type: int, // · · Value: 97, // · · Case: 1, // · · Token: example193.c:1:25: CHARCONST "'a'", // · }, // · Token: example193.c:1:10: '[', // · Token2: example193.c:1:18: STATIC "static", // · Token3: example193.c:1:29: ']', // · TypeQualifierList: &cc.TypeQualifierList{ // · · TypeQualifier: &cc.TypeQualifier{ // · · · Token: example193.c:1:12: CONST "const", // · · }, // · }, // } } func ExampleDirectAbstractDeclarator_case5() { fmt.Println(exampleAST(194, "\U00100001 ( _Bool [ * ] (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 5, // · Token: example194.c:1:10: '[', // · Token2: example194.c:1:12: '*', // · Token3: example194.c:1:14: ']', // } } func ExampleDirectAbstractDeclarator_case6() { fmt.Println(exampleAST(196, "\U00100001 ( _Bool ( ) (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 6, // · Token: example196.c:1:10: '(', // · Token2: example196.c:1:12: ')', // } } func ExampleDirectAbstractDeclarator_case7() { fmt.Println(exampleAST(198, "\U00100001 ( _Bool ( ) ( ) (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 7, // · DirectAbstractDeclarator: &cc.DirectAbstractDeclarator{ // · · Case: 6, // · · Token: example198.c:1:10: '(', // · · Token2: example198.c:1:12: ')', // · }, // · Token: example198.c:1:14: '(', // · Token2: example198.c:1:16: ')', // } } func ExampleDirectAbstractDeclaratorOpt() { fmt.Println(exampleAST(199, "\U00100001 ( _Bool [") == (*DirectAbstractDeclaratorOpt)(nil)) // Output: // true } func ExampleDirectAbstractDeclaratorOpt_case1() { fmt.Println(exampleAST(200, "\U00100001 ( _Bool ( ) [")) // Output: // &cc.DirectAbstractDeclaratorOpt{ // · DirectAbstractDeclarator: &cc.DirectAbstractDeclarator{ // · · Case: 6, // · · Token: example200.c:1:10: '(', // · · Token2: example200.c:1:12: ')', // · }, // } } func ExampleDirectDeclarator() { fmt.Println(exampleAST(152, "\U00100002 a (")) // Output: // &cc.DirectDeclarator{ // · Token: example152.c:1:2: IDENTIFIER "a", // } } func ExampleDirectDeclarator_case1() { fmt.Println(exampleAST(153, "\U00100002 ( a ) (")) // Output: // &cc.DirectDeclarator{ // · Case: 1, // · Declarator: &cc.Declarator{ // · · Linkage: None, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Token: example153.c:1:4: IDENTIFIER "a", // · · }, // · }, // · Token: example153.c:1:2: '(', // · Token2: example153.c:1:6: ')', // } } func ExampleDirectDeclarator_case2() { fmt.Println(exampleAST(154, "\U00100002 a [ ] (")) // Output: // &cc.DirectDeclarator{ // · Case: 2, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Token: example154.c:1:2: IDENTIFIER "a", // · }, // · Token: example154.c:1:4: '[', // · Token2: example154.c:1:6: ']', // } } func ExampleDirectDeclarator_case3() { fmt.Println(exampleAST(155, "\U00100002 a [ static 'b' ] (")) // Output: // &cc.DirectDeclarator{ // · Case: 3, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Token: example155.c:1:2: IDENTIFIER "a", // · }, // · Expression: &cc.Expression{ // · · Type: int, // · · Value: 98, // · · Case: 1, // · · Token: example155.c:1:13: CHARCONST "'b'", // · }, // · Token: example155.c:1:4: '[', // · Token2: example155.c:1:6: STATIC "static", // · Token3: example155.c:1:17: ']', // } } func ExampleDirectDeclarator_case4() { fmt.Println(exampleAST(156, "\U00100002 a [ const static 'b' ] (")) // Output: // &cc.DirectDeclarator{ // · Case: 4, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Token: example156.c:1:2: IDENTIFIER "a", // · }, // · Expression: &cc.Expression{ // · · Type: int, // · · Value: 98, // · · Case: 1, // · · Token: example156.c:1:19: CHARCONST "'b'", // · }, // · Token: example156.c:1:4: '[', // · Token2: example156.c:1:12: STATIC "static", // · Token3: example156.c:1:23: ']', // · TypeQualifierList: &cc.TypeQualifierList{ // · · TypeQualifier: &cc.TypeQualifier{ // · · · Token: example156.c:1:6: CONST "const", // · · }, // · }, // } } func ExampleDirectDeclarator_case5() { fmt.Println(exampleAST(157, "\U00100002 a [ * ] (")) // Output: // &cc.DirectDeclarator{ // · Case: 5, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Token: example157.c:1:2: IDENTIFIER "a", // · }, // · Token: example157.c:1:4: '[', // · Token2: example157.c:1:6: '*', // · Token3: example157.c:1:8: ']', // } } func ExampleDirectDeclarator_case6() { fmt.Println(exampleAST(159, "\U00100002 a ( auto ) (")) // Output: // &cc.DirectDeclarator{ // · Case: 6, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Token: example159.c:1:2: IDENTIFIER "a", // · }, // · ParameterTypeList: &cc.ParameterTypeList{ // · · ParameterList: &cc.ParameterList{ // · · · ParameterDeclaration: &cc.ParameterDeclaration{ // · · · · Case: 1, // · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · · Case: 3, // · · · · · · Token: example159.c:1:6: AUTO "auto", // · · · · · }, // · · · · }, // · · · }, // · · }, // · }, // · Token: example159.c:1:4: '(', // · Token2: example159.c:1:11: ')', // } } func ExampleDirectDeclarator_case7() { fmt.Println(exampleAST(160, "\U00100002 a ( ) (")) // Output: // &cc.DirectDeclarator{ // · Case: 7, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Token: example160.c:1:2: IDENTIFIER "a", // · }, // · Token: example160.c:1:4: '(', // · Token2: example160.c:1:6: ')', // } } func ExampleElifGroup() { fmt.Println(exampleAST(302, "\U00100000 \n#if other_a \n#elif other_b \n#elif")) // Output: // &cc.ElifGroup{ // · PPTokenList: []xc.Token{ // len 4 // · · 0: example302.c:3:6: ' ', // · · 1: example302.c:3:7: IDENTIFIER "other_b", // · · 2: example302.c:3:14: ' ', // · · 3: example302.c:3:16: ' ', // · }, // · Token: example302.c:3:2: PPELIF, // · Token2: example302.c:3:16: '\n', // } } func ExampleElifGroupList() { fmt.Println(exampleAST(298, "\U00100000 \n#if other_a \n#elif other_b \n#elif")) // Output: // &cc.ElifGroupList{ // · ElifGroup: &cc.ElifGroup{ // · · PPTokenList: []xc.Token{ // len 4 // · · · 0: example298.c:3:6: ' ', // · · · 1: example298.c:3:7: IDENTIFIER "other_b", // · · · 2: example298.c:3:14: ' ', // · · · 3: example298.c:3:16: ' ', // · · }, // · · Token: example298.c:3:2: PPELIF, // · · Token2: example298.c:3:16: '\n', // · }, // } } func ExampleElifGroupList_case1() { fmt.Println(exampleAST(299, "\U00100000 \n#if other_a \n#elif other_b \n#elif other_c \n#elif")) // Output: // &cc.ElifGroupList{ // · ElifGroup: &cc.ElifGroup{ // · · PPTokenList: []xc.Token{ // len 4 // · · · 0: example299.c:3:6: ' ', // · · · 1: example299.c:3:7: IDENTIFIER "other_b", // · · · 2: example299.c:3:14: ' ', // · · · 3: example299.c:3:16: ' ', // · · }, // · · Token: example299.c:3:2: PPELIF, // · · Token2: example299.c:3:16: '\n', // · }, // · ElifGroupList: &cc.ElifGroupList{ // · · Case: 1, // · · ElifGroup: &cc.ElifGroup{ // · · · PPTokenList: []xc.Token{ // len 4 // · · · · 0: example299.c:4:6: ' ', // · · · · 1: example299.c:4:7: IDENTIFIER "other_c", // · · · · 2: example299.c:4:14: ' ', // · · · · 3: example299.c:4:16: ' ', // · · · }, // · · · Token: example299.c:4:2: PPELIF, // · · · Token2: example299.c:4:16: '\n', // · · }, // · }, // } } func ExampleElifGroupListOpt() { fmt.Println(exampleAST(300, "\U00100000 \n#if other_a \n#else") == (*ElifGroupListOpt)(nil)) // Output: // true } func ExampleElifGroupListOpt_case1() { fmt.Println(exampleAST(301, "\U00100000 \n#if other_a \n#elif other_b \n#else")) // Output: // &cc.ElifGroupListOpt{ // · ElifGroupList: &cc.ElifGroupList{ // · · ElifGroup: &cc.ElifGroup{ // · · · PPTokenList: []xc.Token{ // len 4 // · · · · 0: example301.c:3:6: ' ', // · · · · 1: example301.c:3:7: IDENTIFIER "other_b", // · · · · 2: example301.c:3:14: ' ', // · · · · 3: example301.c:3:16: ' ', // · · · }, // · · · Token: example301.c:3:2: PPELIF, // · · · Token2: example301.c:3:16: '\n', // · · }, // · }, // } } func ExampleElseGroup() { fmt.Println(exampleAST(303, "\U00100000 \n#if other_a \n#else \n#endif")) // Output: // &cc.ElseGroup{ // · Token: example303.c:3:2: PPELSE, // · Token2: example303.c:3:8: '\n', // } } func ExampleElseGroupOpt() { fmt.Println(exampleAST(304, "\U00100000 \n#if other_a \n#endif") == (*ElseGroupOpt)(nil)) // Output: // true } func ExampleElseGroupOpt_case1() { fmt.Println(exampleAST(305, "\U00100000 \n#if other_a \n#else \n#endif")) // Output: // &cc.ElseGroupOpt{ // · ElseGroup: &cc.ElseGroup{ // · · Token: example305.c:3:2: PPELSE, // · · Token2: example305.c:3:8: '\n', // · }, // } } func ExampleEndifLine() { fmt.Println(exampleAST(306, "\U00100000 \n#if other_a \n#endif")) // Output: // &cc.EndifLine{ // · Token: example306.c:3:2: PPENDIF, // } } func ExampleEnumSpecifier() { fmt.Println(exampleAST(138, "\U00100002 enum { a } (")) // Output: // &cc.EnumSpecifier{ // · EnumeratorList: &cc.EnumeratorList{ // · · Enumerator: &cc.Enumerator{ // · · · EnumerationConstant: &cc.EnumerationConstant{ // · · · · Token: example138.c:1:9: IDENTIFIER "a", // · · · }, // · · }, // · }, // · Token: example138.c:1:2: ENUM "enum", // · Token2: example138.c:1:7: '{', // · Token3: example138.c:1:11: '}', // } } func ExampleEnumSpecifier_case1() { fmt.Println(exampleAST(139, "\U00100002 enum a (")) // Output: // &cc.EnumSpecifier{ // · Case: 1, // · Token: example139.c:1:2: ENUM "enum", // · Token2: example139.c:1:7: IDENTIFIER "a", // } } func ExampleEnumerationConstant() { fmt.Println(exampleAST(7, "\U00100002 enum { a ,")) // Output: // &cc.EnumerationConstant{ // · Token: example7.c:1:9: IDENTIFIER "a", // } } func ExampleEnumerator() { fmt.Println(exampleAST(142, "\U00100002 enum { a ,")) // Output: // &cc.Enumerator{ // · EnumerationConstant: &cc.EnumerationConstant{ // · · Token: example142.c:1:9: IDENTIFIER "a", // · }, // } } func ExampleEnumerator_case1() { fmt.Println(exampleAST(143, "\U00100002 enum { a = 'b' ,")) // Output: // &cc.Enumerator{ // · Value: 98, // · Case: 1, // · ConstantExpression: &cc.ConstantExpression{ // · · Type: int, // · · Value: 98, // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 98, // · · · Case: 1, // · · · Token: example143.c:1:13: CHARCONST "'b'", // · · }, // · }, // · EnumerationConstant: &cc.EnumerationConstant{ // · · Token: example143.c:1:9: IDENTIFIER "a", // · }, // · Token: example143.c:1:11: '=', // } } func ExampleEnumeratorList() { fmt.Println(exampleAST(140, "\U00100002 enum { a ,")) // Output: // &cc.EnumeratorList{ // · Enumerator: &cc.Enumerator{ // · · EnumerationConstant: &cc.EnumerationConstant{ // · · · Token: example140.c:1:9: IDENTIFIER "a", // · · }, // · }, // } } func ExampleEnumeratorList_case1() { fmt.Println(exampleAST(141, "\U00100002 enum { a , b ,")) // Output: // &cc.EnumeratorList{ // · Enumerator: &cc.Enumerator{ // · · EnumerationConstant: &cc.EnumerationConstant{ // · · · Token: example141.c:1:9: IDENTIFIER "a", // · · }, // · }, // · EnumeratorList: &cc.EnumeratorList{ // · · Case: 1, // · · Enumerator: &cc.Enumerator{ // · · · Value: 1, // · · · EnumerationConstant: &cc.EnumerationConstant{ // · · · · Token: example141.c:1:13: IDENTIFIER "b", // · · · }, // · · }, // · · Token: example141.c:1:11: ',', // · }, // } } func ExampleExpression() { fmt.Println(exampleAST(12, "\U00100001 a")) // Output: // &cc.Expression{ // · Token: example12.c:1:2: IDENTIFIER "a", // } } func ExampleExpression_case01() { fmt.Println(exampleAST(13, "\U00100001 'a'")) // Output: // &cc.Expression{ // · Case: 1, // · Token: example13.c:1:2: CHARCONST "'a'", // } } func ExampleExpression_case02() { fmt.Println(exampleAST(14, "\U00100001 1.97")) // Output: // &cc.Expression{ // · Case: 2, // · Token: example14.c:1:2: FLOATCONST "1.97", // } } func ExampleExpression_case03() { fmt.Println(exampleAST(15, "\U00100001 97")) // Output: // &cc.Expression{ // · Case: 3, // · Token: example15.c:1:2: INTCONST "97", // } } func ExampleExpression_case04() { fmt.Println(exampleAST(16, "\U00100001 L'a'")) // Output: // &cc.Expression{ // · Case: 4, // · Token: example16.c:1:2: LONGCHARCONST "L'a'", // } } func ExampleExpression_case05() { fmt.Println(exampleAST(17, "\U00100001 L\"a\"")) // Output: // &cc.Expression{ // · Case: 5, // · Token: example17.c:1:2: LONGSTRINGLITERAL "L\"a\"", // } } func ExampleExpression_case06() { fmt.Println(exampleAST(18, "\U00100001 \"a\"")) // Output: // &cc.Expression{ // · Case: 6, // · Token: example18.c:1:2: STRINGLITERAL "\"a\"", // } } func ExampleExpression_case07() { fmt.Println(exampleAST(19, "\U00100001 ( 'a' )")) // Output: // &cc.Expression{ // · Case: 7, // · ExpressionList: &cc.ExpressionList{ // · · Expression: &cc.Expression{ // · · · Case: 1, // · · · Token: example19.c:1:4: CHARCONST "'a'", // · · }, // · }, // · Token: example19.c:1:2: '(', // · Token2: example19.c:1:8: ')', // } } func ExampleExpression_case08() { fmt.Println(exampleAST(20, "\U00100001 'a' [ 'b' ]")) // Output: // &cc.Expression{ // · Case: 8, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example20.c:1:2: CHARCONST "'a'", // · }, // · ExpressionList: &cc.ExpressionList{ // · · Expression: &cc.Expression{ // · · · Case: 1, // · · · Token: example20.c:1:8: CHARCONST "'b'", // · · }, // · }, // · Token: example20.c:1:6: '[', // · Token2: example20.c:1:12: ']', // } } func ExampleExpression_case09() { fmt.Println(exampleAST(21, "\U00100001 'a' ( )")) // Output: // &cc.Expression{ // · Case: 9, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example21.c:1:2: CHARCONST "'a'", // · }, // · Token: example21.c:1:6: '(', // · Token2: example21.c:1:8: ')', // } } func ExampleExpression_case10() { fmt.Println(exampleAST(22, "\U00100001 'a' . b")) // Output: // &cc.Expression{ // · Case: 10, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example22.c:1:2: CHARCONST "'a'", // · }, // · Token: example22.c:1:6: '.', // · Token2: example22.c:1:8: IDENTIFIER "b", // } } func ExampleExpression_case11() { fmt.Println(exampleAST(23, "\U00100001 'a' -> b")) // Output: // &cc.Expression{ // · Case: 11, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example23.c:1:2: CHARCONST "'a'", // · }, // · Token: example23.c:1:6: ARROW, // · Token2: example23.c:1:9: IDENTIFIER "b", // } } func ExampleExpression_case12() { fmt.Println(exampleAST(24, "\U00100001 'a' ++")) // Output: // &cc.Expression{ // · Case: 12, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example24.c:1:2: CHARCONST "'a'", // · }, // · Token: example24.c:1:6: INC, // } } func ExampleExpression_case13() { fmt.Println(exampleAST(25, "\U00100001 'a' --")) // Output: // &cc.Expression{ // · Case: 13, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example25.c:1:2: CHARCONST "'a'", // · }, // · Token: example25.c:1:6: DEC, // } } func ExampleExpression_case14() { fmt.Println(exampleAST(26, "\U00100001 ( _Bool ) { }")) // Output: // &cc.Expression{ // · Case: 14, // · Token: example26.c:1:2: '(', // · Token2: example26.c:1:10: ')', // · Token3: example26.c:1:12: '{', // · Token4: example26.c:1:14: '}', // · TypeName: &cc.TypeName{ // · · Type: bool, // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Case: 9, // · · · · Token: example26.c:1:4: BOOL "_Bool", // · · · }, // · · }, // · }, // } } func ExampleExpression_case15() { fmt.Println(exampleAST(27, "\U00100001 ++ 'a'")) // Output: // &cc.Expression{ // · Case: 15, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example27.c:1:5: CHARCONST "'a'", // · }, // · Token: example27.c:1:2: INC, // } } func ExampleExpression_case16() { fmt.Println(exampleAST(28, "\U00100001 -- 'a'")) // Output: // &cc.Expression{ // · Case: 16, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example28.c:1:5: CHARCONST "'a'", // · }, // · Token: example28.c:1:2: DEC, // } } func ExampleExpression_case17() { fmt.Println(exampleAST(29, "\U00100001 & 'a'")) // Output: // &cc.Expression{ // · Case: 17, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example29.c:1:4: CHARCONST "'a'", // · }, // · Token: example29.c:1:2: '&', // } } func ExampleExpression_case18() { fmt.Println(exampleAST(30, "\U00100001 * 'a'")) // Output: // &cc.Expression{ // · Case: 18, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example30.c:1:4: CHARCONST "'a'", // · }, // · Token: example30.c:1:2: '*', // } } func ExampleExpression_case19() { fmt.Println(exampleAST(31, "\U00100001 + 'a'")) // Output: // &cc.Expression{ // · Case: 19, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example31.c:1:4: CHARCONST "'a'", // · }, // · Token: example31.c:1:2: '+', // } } func ExampleExpression_case20() { fmt.Println(exampleAST(32, "\U00100001 - 'a'")) // Output: // &cc.Expression{ // · Case: 20, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example32.c:1:4: CHARCONST "'a'", // · }, // · Token: example32.c:1:2: '-', // } } func ExampleExpression_case21() { fmt.Println(exampleAST(33, "\U00100001 ~ 'a'")) // Output: // &cc.Expression{ // · Case: 21, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example33.c:1:4: CHARCONST "'a'", // · }, // · Token: example33.c:1:2: '~', // } } func ExampleExpression_case22() { fmt.Println(exampleAST(34, "\U00100001 ! 'a'")) // Output: // &cc.Expression{ // · Case: 22, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example34.c:1:4: CHARCONST "'a'", // · }, // · Token: example34.c:1:2: '!', // } } func ExampleExpression_case23() { fmt.Println(exampleAST(35, "\U00100001 sizeof 'a'")) // Output: // &cc.Expression{ // · Case: 23, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example35.c:1:9: CHARCONST "'a'", // · }, // · Token: example35.c:1:2: SIZEOF "sizeof", // } } func ExampleExpression_case24() { fmt.Println(exampleAST(36, "\U00100001 sizeof ( _Bool )")) // Output: // &cc.Expression{ // · Case: 24, // · Token: example36.c:1:2: SIZEOF "sizeof", // · Token2: example36.c:1:9: '(', // · Token3: example36.c:1:17: ')', // · TypeName: &cc.TypeName{ // · · Type: bool, // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Case: 9, // · · · · Token: example36.c:1:11: BOOL "_Bool", // · · · }, // · · }, // · }, // } } func ExampleExpression_case25() { fmt.Println(exampleAST(37, "\U00100001 ( _Bool ) 'a'")) // Output: // &cc.Expression{ // · Case: 25, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example37.c:1:12: CHARCONST "'a'", // · }, // · Token: example37.c:1:2: '(', // · Token2: example37.c:1:10: ')', // · TypeName: &cc.TypeName{ // · · Type: bool, // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Case: 9, // · · · · Token: example37.c:1:4: BOOL "_Bool", // · · · }, // · · }, // · }, // } } func ExampleExpression_case26() { fmt.Println(exampleAST(38, "\U00100001 'a' * 'b'")) // Output: // &cc.Expression{ // · Case: 26, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example38.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example38.c:1:8: CHARCONST "'b'", // · }, // · Token: example38.c:1:6: '*', // } } func ExampleExpression_case27() { fmt.Println(exampleAST(39, "\U00100001 'a' / 'b'")) // Output: // &cc.Expression{ // · Case: 27, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example39.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example39.c:1:8: CHARCONST "'b'", // · }, // · Token: example39.c:1:6: '/', // } } func ExampleExpression_case28() { fmt.Println(exampleAST(40, "\U00100001 'a' % 'b'")) // Output: // &cc.Expression{ // · Case: 28, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example40.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example40.c:1:8: CHARCONST "'b'", // · }, // · Token: example40.c:1:6: '%', // } } func ExampleExpression_case29() { fmt.Println(exampleAST(41, "\U00100001 'a' + 'b'")) // Output: // &cc.Expression{ // · Case: 29, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example41.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example41.c:1:8: CHARCONST "'b'", // · }, // · Token: example41.c:1:6: '+', // } } func ExampleExpression_case30() { fmt.Println(exampleAST(42, "\U00100001 'a' - 'b'")) // Output: // &cc.Expression{ // · Case: 30, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example42.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example42.c:1:8: CHARCONST "'b'", // · }, // · Token: example42.c:1:6: '-', // } } func ExampleExpression_case31() { fmt.Println(exampleAST(43, "\U00100001 'a' << 'b'")) // Output: // &cc.Expression{ // · Case: 31, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example43.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example43.c:1:9: CHARCONST "'b'", // · }, // · Token: example43.c:1:6: LSH, // } } func ExampleExpression_case32() { fmt.Println(exampleAST(44, "\U00100001 'a' >> 'b'")) // Output: // &cc.Expression{ // · Case: 32, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example44.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example44.c:1:9: CHARCONST "'b'", // · }, // · Token: example44.c:1:6: RSH, // } } func ExampleExpression_case33() { fmt.Println(exampleAST(45, "\U00100001 'a' < 'b'")) // Output: // &cc.Expression{ // · Case: 33, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example45.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example45.c:1:8: CHARCONST "'b'", // · }, // · Token: example45.c:1:6: '<', // } } func ExampleExpression_case34() { fmt.Println(exampleAST(46, "\U00100001 'a' > 'b'")) // Output: // &cc.Expression{ // · Case: 34, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example46.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example46.c:1:8: CHARCONST "'b'", // · }, // · Token: example46.c:1:6: '>', // } } func ExampleExpression_case35() { fmt.Println(exampleAST(47, "\U00100001 'a' <= 'b'")) // Output: // &cc.Expression{ // · Case: 35, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example47.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example47.c:1:9: CHARCONST "'b'", // · }, // · Token: example47.c:1:6: LEQ, // } } func ExampleExpression_case36() { fmt.Println(exampleAST(48, "\U00100001 'a' >= 'b'")) // Output: // &cc.Expression{ // · Case: 36, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example48.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example48.c:1:9: CHARCONST "'b'", // · }, // · Token: example48.c:1:6: GEQ, // } } func ExampleExpression_case37() { fmt.Println(exampleAST(49, "\U00100001 'a' == 'b'")) // Output: // &cc.Expression{ // · Case: 37, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example49.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example49.c:1:9: CHARCONST "'b'", // · }, // · Token: example49.c:1:6: EQ, // } } func ExampleExpression_case38() { fmt.Println(exampleAST(50, "\U00100001 'a' != 'b'")) // Output: // &cc.Expression{ // · Case: 38, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example50.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example50.c:1:9: CHARCONST "'b'", // · }, // · Token: example50.c:1:6: NEQ, // } } func ExampleExpression_case39() { fmt.Println(exampleAST(51, "\U00100001 'a' & 'b'")) // Output: // &cc.Expression{ // · Case: 39, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example51.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example51.c:1:8: CHARCONST "'b'", // · }, // · Token: example51.c:1:6: '&', // } } func ExampleExpression_case40() { fmt.Println(exampleAST(52, "\U00100001 'a' ^ 'b'")) // Output: // &cc.Expression{ // · Case: 40, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example52.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example52.c:1:8: CHARCONST "'b'", // · }, // · Token: example52.c:1:6: '^', // } } func ExampleExpression_case41() { fmt.Println(exampleAST(53, "\U00100001 'a' | 'b'")) // Output: // &cc.Expression{ // · Case: 41, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example53.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example53.c:1:8: CHARCONST "'b'", // · }, // · Token: example53.c:1:6: '|', // } } func ExampleExpression_case42() { fmt.Println(exampleAST(54, "\U00100001 'a' && 'b'")) // Output: // &cc.Expression{ // · Case: 42, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example54.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example54.c:1:9: CHARCONST "'b'", // · }, // · Token: example54.c:1:6: ANDAND, // } } func ExampleExpression_case43() { fmt.Println(exampleAST(55, "\U00100001 'a' || 'b'")) // Output: // &cc.Expression{ // · Case: 43, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example55.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example55.c:1:9: CHARCONST "'b'", // · }, // · Token: example55.c:1:6: OROR, // } } func ExampleExpression_case44() { fmt.Println(exampleAST(56, "\U00100001 'a' ? 'b' : 'c'")) // Output: // &cc.Expression{ // · Case: 44, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example56.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example56.c:1:14: CHARCONST "'c'", // · }, // · ExpressionList: &cc.ExpressionList{ // · · Expression: &cc.Expression{ // · · · Case: 1, // · · · Token: example56.c:1:8: CHARCONST "'b'", // · · }, // · }, // · Token: example56.c:1:6: '?', // · Token2: example56.c:1:12: ':', // } } func ExampleExpression_case45() { fmt.Println(exampleAST(57, "\U00100001 'a' = 'b'")) // Output: // &cc.Expression{ // · Case: 45, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example57.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example57.c:1:8: CHARCONST "'b'", // · }, // · Token: example57.c:1:6: '=', // } } func ExampleExpression_case46() { fmt.Println(exampleAST(58, "\U00100001 'a' *= 'b'")) // Output: // &cc.Expression{ // · Case: 46, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example58.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example58.c:1:9: CHARCONST "'b'", // · }, // · Token: example58.c:1:6: MULASSIGN, // } } func ExampleExpression_case47() { fmt.Println(exampleAST(59, "\U00100001 'a' /= 'b'")) // Output: // &cc.Expression{ // · Case: 47, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example59.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example59.c:1:9: CHARCONST "'b'", // · }, // · Token: example59.c:1:6: DIVASSIGN, // } } func ExampleExpression_case48() { fmt.Println(exampleAST(60, "\U00100001 'a' %= 'b'")) // Output: // &cc.Expression{ // · Case: 48, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example60.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example60.c:1:9: CHARCONST "'b'", // · }, // · Token: example60.c:1:6: MODASSIGN, // } } func ExampleExpression_case49() { fmt.Println(exampleAST(61, "\U00100001 'a' += 'b'")) // Output: // &cc.Expression{ // · Case: 49, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example61.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example61.c:1:9: CHARCONST "'b'", // · }, // · Token: example61.c:1:6: ADDASSIGN, // } } func ExampleExpression_case50() { fmt.Println(exampleAST(62, "\U00100001 'a' -= 'b'")) // Output: // &cc.Expression{ // · Case: 50, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example62.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example62.c:1:9: CHARCONST "'b'", // · }, // · Token: example62.c:1:6: SUBASSIGN, // } } func ExampleExpression_case51() { fmt.Println(exampleAST(63, "\U00100001 'a' <<= 'b'")) // Output: // &cc.Expression{ // · Case: 51, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example63.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example63.c:1:10: CHARCONST "'b'", // · }, // · Token: example63.c:1:6: LSHASSIGN, // } } func ExampleExpression_case52() { fmt.Println(exampleAST(64, "\U00100001 'a' >>= 'b'")) // Output: // &cc.Expression{ // · Case: 52, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example64.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example64.c:1:10: CHARCONST "'b'", // · }, // · Token: example64.c:1:6: RSHASSIGN, // } } func ExampleExpression_case53() { fmt.Println(exampleAST(65, "\U00100001 'a' &= 'b'")) // Output: // &cc.Expression{ // · Case: 53, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example65.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example65.c:1:9: CHARCONST "'b'", // · }, // · Token: example65.c:1:6: ANDASSIGN, // } } func ExampleExpression_case54() { fmt.Println(exampleAST(66, "\U00100001 'a' ^= 'b'")) // Output: // &cc.Expression{ // · Case: 54, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example66.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example66.c:1:9: CHARCONST "'b'", // · }, // · Token: example66.c:1:6: XORASSIGN, // } } func ExampleExpression_case55() { fmt.Println(exampleAST(67, "\U00100001 'a' |= 'b'")) // Output: // &cc.Expression{ // · Case: 55, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example67.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example67.c:1:9: CHARCONST "'b'", // · }, // · Token: example67.c:1:6: ORASSIGN, // } } func ExampleExpression_case56() { fmt.Println(exampleAST(68, "\U00100001 _Alignof ( _Bool )")) // Output: // &cc.Expression{ // · Case: 56, // · Token: example68.c:1:2: ALIGNOF "_Alignof", // · Token2: example68.c:1:11: '(', // · Token3: example68.c:1:19: ')', // · TypeName: &cc.TypeName{ // · · Type: bool, // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Case: 9, // · · · · Token: example68.c:1:13: BOOL "_Bool", // · · · }, // · · }, // · }, // } } func ExampleExpression_case57() { fmt.Println(exampleAST(69, "\U00100001 ( { } )")) // Output: // &cc.Expression{ // · Case: 57, // · CompoundStatement: &cc.CompoundStatement{ // · · Token: example69.c:1:4: '{', // · · Token2: example69.c:1:6: '}', // · }, // · Token: example69.c:1:2: '(', // · Token2: example69.c:1:8: ')', // } } func ExampleExpression_case58() { fmt.Println(exampleAST(70, "\U00100001 && a")) // Output: // &cc.Expression{ // · Case: 58, // · Token: example70.c:1:2: ANDAND, // · Token2: example70.c:1:5: IDENTIFIER "a", // } } func ExampleExpression_case59() { fmt.Println(exampleAST(71, "\U00100001 'a' ? : 'b'")) // Output: // &cc.Expression{ // · Case: 59, // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example71.c:1:2: CHARCONST "'a'", // · }, // · Expression2: &cc.Expression{ // · · Case: 1, // · · Token: example71.c:1:10: CHARCONST "'b'", // · }, // · Token: example71.c:1:6: '?', // · Token2: example71.c:1:8: ':', // } } func ExampleExpressionList() { fmt.Println(exampleAST(74, "\U00100001 ( 'a' )")) // Output: // &cc.ExpressionList{ // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example74.c:1:4: CHARCONST "'a'", // · }, // } } func ExampleExpressionList_case1() { fmt.Println(exampleAST(75, "\U00100001 ( 'a' , 'b' )")) // Output: // &cc.ExpressionList{ // · Expression: &cc.Expression{ // · · Case: 1, // · · Token: example75.c:1:4: CHARCONST "'a'", // · }, // · ExpressionList: &cc.ExpressionList{ // · · Case: 1, // · · Expression: &cc.Expression{ // · · · Case: 1, // · · · Token: example75.c:1:10: CHARCONST "'b'", // · · }, // · · Token: example75.c:1:8: ',', // · }, // } } func ExampleExpressionListOpt() { fmt.Println(exampleAST(76, "\U00100001 ( { ;") == (*ExpressionListOpt)(nil)) // Output: // true } func ExampleExpressionListOpt_case1() { fmt.Println(exampleAST(77, "\U00100001 ( { 'a' )")) // Output: // &cc.ExpressionListOpt{ // · ExpressionList: &cc.ExpressionList{ // · · Type: int, // · · Value: 97, // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 97, // · · · Case: 1, // · · · Token: example77.c:1:6: CHARCONST "'a'", // · · }, // · }, // } } func ExampleExpressionOpt() { fmt.Println(exampleAST(72, "\U00100001 ( _Bool [ ]") == (*ExpressionOpt)(nil)) // Output: // true } func ExampleExpressionOpt_case1() { fmt.Println(exampleAST(73, "\U00100002 a [ 'b' ]")) // Output: // &cc.ExpressionOpt{ // · Expression: &cc.Expression{ // · · Type: int, // · · Value: 98, // · · Case: 1, // · · Token: example73.c:1:6: CHARCONST "'b'", // · }, // } } func ExampleExpressionStatement() { fmt.Println(exampleAST(232, "\U00100001 ( { ; !")) // Output: // &cc.ExpressionStatement{ // · Token: example232.c:1:6: ';', // } } func ExampleExternalDeclaration() { fmt.Println(exampleAST(247, "\U00100002 a { }")) // Output: // &cc.ExternalDeclaration{ // · FunctionDefinition: &cc.FunctionDefinition{ // · · Case: 1, // · · Declarator: &cc.Declarator{ // · · · Linkage: External, // · · · Type: int, // · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · Token: example247.c:1:2: IDENTIFIER "a", // · · · }, // · · }, // · · FunctionBody: &cc.FunctionBody{ // · · · CompoundStatement: &cc.CompoundStatement{ // · · · · Token: example247.c:1:4: '{', // · · · · Token2: example247.c:1:6: '}', // · · · }, // · · }, // · }, // } } func ExampleExternalDeclaration_case1() { fmt.Println(exampleAST(248, "\U00100002 auto ;")) // Output: // &cc.ExternalDeclaration{ // · Case: 1, // · Declaration: &cc.Declaration{ // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Case: 3, // · · · · Token: example248.c:1:2: AUTO "auto", // · · · }, // · · }, // · · Token: example248.c:1:7: ';', // · }, // } } func ExampleExternalDeclaration_case2() { fmt.Println(exampleAST(249, "\U00100002 asm ( \"a\" ) ;")) // Output: // &cc.ExternalDeclaration{ // · BasicAssemblerStatement: &cc.BasicAssemblerStatement{ // · · AssemblerInstructions: &cc.AssemblerInstructions{ // · · · Token: example249.c:1:8: STRINGLITERAL "\"a\"", // · · }, // · · Token: example249.c:1:2: ASM "asm", // · · Token2: example249.c:1:6: '(', // · · Token3: example249.c:1:12: ')', // · }, // · Case: 2, // · Token: example249.c:1:14: ';', // } } func ExampleExternalDeclaration_case3() { fmt.Println(exampleAST(250, "\U00100002 ;")) // Output: // &cc.ExternalDeclaration{ // · Case: 3, // · Token: example250.c:1:2: ';', // } } func ExampleFunctionBody() { fmt.Println(exampleAST(257, "\U00100002 a { }")) // Output: // &cc.FunctionBody{ // · CompoundStatement: &cc.CompoundStatement{ // · · Token: example257.c:1:4: '{', // · · Token2: example257.c:1:6: '}', // · }, // } } func ExampleFunctionBody_case1() { fmt.Println(exampleAST(259, "\U00100002 a asm ( \"b\" ) ;")) // Output: // &cc.FunctionBody{ // · AssemblerStatement: &cc.AssemblerStatement{ // · · BasicAssemblerStatement: &cc.BasicAssemblerStatement{ // · · · AssemblerInstructions: &cc.AssemblerInstructions{ // · · · · Token: example259.c:1:10: STRINGLITERAL "\"b\"", // · · · }, // · · · Token: example259.c:1:4: ASM "asm", // · · · Token2: example259.c:1:8: '(', // · · · Token3: example259.c:1:14: ')', // · · }, // · }, // · Case: 1, // · Token: example259.c:1:16: ';', // } } func ExampleFunctionDefinition() { fmt.Println(exampleAST(252, "\U00100002 auto a { }")) // Output: // &cc.FunctionDefinition{ // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · Case: 3, // · · · Token: example252.c:1:2: AUTO "auto", // · · }, // · }, // · Declarator: &cc.Declarator{ // · · Linkage: None, // · · Type: auto int, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Token: example252.c:1:7: IDENTIFIER "a", // · · }, // · }, // · FunctionBody: &cc.FunctionBody{ // · · CompoundStatement: &cc.CompoundStatement{ // · · · Token: example252.c:1:9: '{', // · · · Token2: example252.c:1:11: '}', // · · }, // · }, // } } func ExampleFunctionDefinition_case1() { fmt.Println(exampleAST(255, "\U00100002 a { }")) // Output: // &cc.FunctionDefinition{ // · Case: 1, // · Declarator: &cc.Declarator{ // · · Linkage: External, // · · Type: int, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Token: example255.c:1:2: IDENTIFIER "a", // · · }, // · }, // · FunctionBody: &cc.FunctionBody{ // · · CompoundStatement: &cc.CompoundStatement{ // · · · Token: example255.c:1:4: '{', // · · · Token2: example255.c:1:6: '}', // · · }, // · }, // } } func ExampleFunctionSpecifier() { fmt.Println(exampleAST(147, "\U00100002 inline (")) // Output: // &cc.FunctionSpecifier{ // · Token: example147.c:1:2: INLINE "inline", // } } func ExampleFunctionSpecifier_case1() { fmt.Println(exampleAST(148, "\U00100002 _Noreturn (")) // Output: // &cc.FunctionSpecifier{ // · Case: 1, // · Token: example148.c:1:2: NORETURN "_Noreturn", // } } func ExampleGroupList() { fmt.Println(exampleAST(286, "\U00100000 ")) // Output: // &cc.GroupList{ // } } func ExampleGroupList_case1() { fmt.Println(exampleAST(287, "\U00100000int\nf() {}")) // Output: // &cc.GroupList{ // · GroupList: &cc.GroupList{ // · · Case: 1, // · · GroupPart: []xc.Token{ // len 6 // · · · 0: example287.c:2:1: IDENTIFIER "f", // · · · 1: example287.c:2:2: '(', // · · · 2: example287.c:2:3: ')', // · · · 3: example287.c:2:4: ' ', // · · · 4: example287.c:2:5: '{', // · · · 5: example287.c:2:6: '}', // · · }, // · }, // · GroupPart: []xc.Token{ // len 2 // · · 0: example287.c:1:1: IDENTIFIER "int", // · · 1: example287.c:1:4: ' ', // · }, // } } func ExampleGroupListOpt() { fmt.Println(exampleAST(288, "\U00100000 \n#ifndef a \n#elif") == (*GroupListOpt)(nil)) // Output: // true } func ExampleGroupListOpt_case1() { fmt.Println(exampleAST(289, "\U00100000 \n#ifndef a\nb\n#elif")) // Output: // &cc.GroupListOpt{ // · GroupList: &cc.GroupList{ // · · GroupPart: []xc.Token{ // len 2 // · · · 0: example289.c:3:1: IDENTIFIER "b", // · · · 1: example289.c:3:2: ' ', // · · }, // · }, // } } func ExampleIdentifierList() { fmt.Println(exampleAST(177, "\U00100002 a ( b )")) // Output: // &cc.IdentifierList{ // · Token: example177.c:1:6: IDENTIFIER "b", // } } func ExampleIdentifierList_case1() { fmt.Println(exampleAST(178, "\U00100002 a ( b , c )")) // Output: // &cc.IdentifierList{ // · IdentifierList: &cc.IdentifierList{ // · · Case: 1, // · · Token: example178.c:1:8: ',', // · · Token2: example178.c:1:10: IDENTIFIER "c", // · }, // · Token: example178.c:1:6: IDENTIFIER "b", // } } func ExampleIdentifierListOpt() { fmt.Println(exampleAST(179, "\U00100002 a ( )") == (*IdentifierListOpt)(nil)) // Output: // true } func ExampleIdentifierListOpt_case1() { fmt.Println(exampleAST(180, "\U00100002 a ( b )")) // Output: // &cc.IdentifierListOpt{ // · IdentifierList: &cc.IdentifierList{ // · · Token: example180.c:1:6: IDENTIFIER "b", // · }, // } } func ExampleIdentifierOpt() { fmt.Println(exampleAST(181, "\U00100002 struct {") == (*IdentifierOpt)(nil)) // Output: // true } func ExampleIdentifierOpt_case1() { fmt.Println(exampleAST(182, "\U00100002 enum a {")) // Output: // &cc.IdentifierOpt{ // · Token: example182.c:1:7: IDENTIFIER "a", // } } func ExampleIfGroup() { fmt.Println(exampleAST(295, "\U00100000 \n#if other_a \n#elif")) // Output: // &cc.IfGroup{ // · PPTokenList: []xc.Token{ // len 4 // · · 0: example295.c:2:4: ' ', // · · 1: example295.c:2:5: IDENTIFIER "other_a", // · · 2: example295.c:2:12: ' ', // · · 3: example295.c:2:14: ' ', // · }, // · Token: example295.c:2:2: PPIF, // · Token2: example295.c:2:14: '\n', // } } func ExampleIfGroup_case1() { fmt.Println(exampleAST(296, "\U00100000 \n#ifdef a \n#elif")) // Output: // &cc.IfGroup{ // · Case: 1, // · Token: example296.c:2:2: PPIFDEF, // · Token2: example296.c:2:8: IDENTIFIER "a", // · Token3: example296.c:2:11: '\n', // } } func ExampleIfGroup_case2() { fmt.Println(exampleAST(297, "\U00100000 \n#ifndef a \n#elif")) // Output: // &cc.IfGroup{ // · Case: 2, // · Token: example297.c:2:2: PPIFNDEF, // · Token2: example297.c:2:9: IDENTIFIER "a", // · Token3: example297.c:2:12: '\n', // } } func ExampleIfSection() { fmt.Println(exampleAST(294, "\U00100000 \n#if other_a \n#endif")) // Output: // &cc.IfSection{ // · EndifLine: &cc.EndifLine{ // · · Token: example294.c:3:2: PPENDIF, // · }, // · IfGroup: &cc.IfGroup{ // · · PPTokenList: []xc.Token{ // len 4 // · · · 0: example294.c:2:4: ' ', // · · · 1: example294.c:2:5: IDENTIFIER "other_a", // · · · 2: example294.c:2:12: ' ', // · · · 3: example294.c:2:14: ' ', // · · }, // · · Token: example294.c:2:2: PPIF, // · · Token2: example294.c:2:14: '\n', // · }, // } } func ExampleInitDeclarator() { fmt.Println(exampleAST(92, "\U00100002 a auto b ,")) // Output: // &cc.InitDeclarator{ // · Declarator: &cc.Declarator{ // · · Linkage: None, // · · Type: auto undefined, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Token: example92.c:1:9: IDENTIFIER "b", // · · }, // · }, // } } func ExampleInitDeclarator_case1() { fmt.Println(exampleAST(94, "\U00100002 auto a = 'b' ,")) // Output: // &cc.InitDeclarator{ // · Case: 1, // · Declarator: &cc.Declarator{ // · · Linkage: None, // · · Type: auto undefined, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Token: example94.c:1:7: IDENTIFIER "a", // · · }, // · }, // · Initializer: &cc.Initializer{ // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 98, // · · · Case: 1, // · · · Token: example94.c:1:11: CHARCONST "'b'", // · · }, // · }, // · Token: example94.c:1:9: '=', // } } func ExampleInitDeclaratorList() { fmt.Println(exampleAST(88, "\U00100002 auto a ,")) // Output: // &cc.InitDeclaratorList{ // · InitDeclarator: &cc.InitDeclarator{ // · · Declarator: &cc.Declarator{ // · · · Linkage: None, // · · · Type: auto undefined, // · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · Token: example88.c:1:7: IDENTIFIER "a", // · · · }, // · · }, // · }, // } } func ExampleInitDeclaratorList_case1() { fmt.Println(exampleAST(89, "\U00100002 auto a , b ,")) // Output: // &cc.InitDeclaratorList{ // · InitDeclarator: &cc.InitDeclarator{ // · · Declarator: &cc.Declarator{ // · · · Linkage: None, // · · · Type: auto undefined, // · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · Token: example89.c:1:7: IDENTIFIER "a", // · · · }, // · · }, // · }, // · InitDeclaratorList: &cc.InitDeclaratorList{ // · · Case: 1, // · · InitDeclarator: &cc.InitDeclarator{ // · · · Declarator: &cc.Declarator{ // · · · · Linkage: None, // · · · · Type: auto undefined, // · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · Token: example89.c:1:11: IDENTIFIER "b", // · · · · }, // · · · }, // · · }, // · · Token: example89.c:1:9: ',', // · }, // } } func ExampleInitDeclaratorListOpt() { fmt.Println(exampleAST(90, "\U00100002 auto ;") == (*InitDeclaratorListOpt)(nil)) // Output: // true } func ExampleInitDeclaratorListOpt_case1() { fmt.Println(exampleAST(91, "\U00100002 auto a ;")) // Output: // &cc.InitDeclaratorListOpt{ // · InitDeclaratorList: &cc.InitDeclaratorList{ // · · InitDeclarator: &cc.InitDeclarator{ // · · · Declarator: &cc.Declarator{ // · · · · Linkage: None, // · · · · Type: auto undefined, // · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · Token: example91.c:1:7: IDENTIFIER "a", // · · · · }, // · · · }, // · · }, // · }, // } } func ExampleInitializer() { fmt.Println(exampleAST(201, "\U00100002 auto a = 'b' ,")) // Output: // &cc.Initializer{ // · Expression: &cc.Expression{ // · · Type: int, // · · Value: 98, // · · Case: 1, // · · Token: example201.c:1:11: CHARCONST "'b'", // · }, // } } func ExampleInitializer_case1() { fmt.Println(exampleAST(202, "\U00100002 auto a = { } ,")) // Output: // &cc.Initializer{ // · Case: 1, // · Token: example202.c:1:11: '{', // · Token2: example202.c:1:13: '}', // } } func ExampleInitializer_case2() { fmt.Println(exampleAST(203, "\U00100002 auto a = b : 'c' ,")) // Output: // &cc.Initializer{ // · Case: 2, // · Initializer: &cc.Initializer{ // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 99, // · · · Case: 1, // · · · Token: example203.c:1:15: CHARCONST "'c'", // · · }, // · }, // · Token: example203.c:1:11: IDENTIFIER "b", // · Token2: example203.c:1:13: ':', // } } func ExampleInitializerList() { fmt.Println(exampleAST(204, "\U00100002 auto a = { 'b' ,")) // Output: // &cc.InitializerList{ // · Initializer: &cc.Initializer{ // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 98, // · · · Case: 1, // · · · Token: example204.c:1:13: CHARCONST "'b'", // · · }, // · }, // } } func ExampleInitializerList_case1() { fmt.Println(exampleAST(205, "\U00100002 auto a = { , 'b' ,")) // Output: // &cc.InitializerList{ // · Case: 1, // · Initializer: &cc.Initializer{ // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 98, // · · · Case: 1, // · · · Token: example205.c:1:15: CHARCONST "'b'", // · · }, // · }, // · Token: example205.c:1:13: ',', // } } func ExampleInitializerList_case2() { fmt.Println(exampleAST(206, "\U00100002 auto a = { ,") == (*InitializerList)(nil)) // Output: // true } func ExampleIterationStatement() { fmt.Println(exampleAST(236, "\U00100001 ( { while ( 'a' ) ; !")) // Output: // &cc.IterationStatement{ // · ExpressionList: &cc.ExpressionList{ // · · Type: int, // · · Value: 97, // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 97, // · · · Case: 1, // · · · Token: example236.c:1:14: CHARCONST "'a'", // · · }, // · }, // · Statement: &cc.Statement{ // · · Case: 2, // · · ExpressionStatement: &cc.ExpressionStatement{ // · · · Token: example236.c:1:20: ';', // · · }, // · }, // · Token: example236.c:1:6: WHILE "while", // · Token2: example236.c:1:12: '(', // · Token3: example236.c:1:18: ')', // } } func ExampleIterationStatement_case1() { fmt.Println(exampleAST(237, "\U00100001 ( { do ; while ( 'a' ) ; !")) // Output: // &cc.IterationStatement{ // · Case: 1, // · ExpressionList: &cc.ExpressionList{ // · · Type: int, // · · Value: 97, // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 97, // · · · Case: 1, // · · · Token: example237.c:1:19: CHARCONST "'a'", // · · }, // · }, // · Statement: &cc.Statement{ // · · Case: 2, // · · ExpressionStatement: &cc.ExpressionStatement{ // · · · Token: example237.c:1:9: ';', // · · }, // · }, // · Token: example237.c:1:6: DO "do", // · Token2: example237.c:1:11: WHILE "while", // · Token3: example237.c:1:17: '(', // · Token4: example237.c:1:23: ')', // · Token5: example237.c:1:25: ';', // } } func ExampleIterationStatement_case2() { fmt.Println(exampleAST(238, "\U00100001 ( { for ( ; ; ) ; !")) // Output: // &cc.IterationStatement{ // · Case: 2, // · Statement: &cc.Statement{ // · · Case: 2, // · · ExpressionStatement: &cc.ExpressionStatement{ // · · · Token: example238.c:1:18: ';', // · · }, // · }, // · Token: example238.c:1:6: FOR "for", // · Token2: example238.c:1:10: '(', // · Token3: example238.c:1:12: ';', // · Token4: example238.c:1:14: ';', // · Token5: example238.c:1:16: ')', // } } func ExampleIterationStatement_case3() { fmt.Println(exampleAST(239, "\U00100001 ( { for ( auto ; ; ) ; !")) // Output: // &cc.IterationStatement{ // · Case: 3, // · Declaration: &cc.Declaration{ // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Case: 3, // · · · · Token: example239.c:1:12: AUTO "auto", // · · · }, // · · }, // · · Token: example239.c:1:17: ';', // · }, // · Statement: &cc.Statement{ // · · Case: 2, // · · ExpressionStatement: &cc.ExpressionStatement{ // · · · Token: example239.c:1:23: ';', // · · }, // · }, // · Token: example239.c:1:6: FOR "for", // · Token2: example239.c:1:10: '(', // · Token3: example239.c:1:19: ';', // · Token4: example239.c:1:21: ')', // } } func ExampleJumpStatement() { fmt.Println(exampleAST(240, "\U00100001 ( { goto a ; !")) // Output: // &cc.JumpStatement{ // · Token: example240.c:1:6: GOTO "goto", // · Token2: example240.c:1:11: IDENTIFIER "a", // · Token3: example240.c:1:13: ';', // } } func ExampleJumpStatement_case1() { fmt.Println(exampleAST(241, "\U00100001 ( { continue ; !")) // Output: // &cc.JumpStatement{ // · Case: 1, // · Token: example241.c:1:6: CONTINUE "continue", // · Token2: example241.c:1:15: ';', // } } func ExampleJumpStatement_case2() { fmt.Println(exampleAST(242, "\U00100001 ( { break ; !")) // Output: // &cc.JumpStatement{ // · Case: 2, // · Token: example242.c:1:6: BREAK "break", // · Token2: example242.c:1:12: ';', // } } func ExampleJumpStatement_case3() { fmt.Println(exampleAST(243, "\U00100001 ( { return ; !")) // Output: // &cc.JumpStatement{ // · Case: 3, // · Token: example243.c:1:6: RETURN "return", // · Token2: example243.c:1:13: ';', // } } func ExampleJumpStatement_case4() { fmt.Println(exampleAST(244, "\U00100001 ( { goto 'a' ; !")) // Output: // &cc.JumpStatement{ // · Case: 4, // · Expression: &cc.Expression{ // · · Type: int, // · · Value: 97, // · · Case: 1, // · · Token: example244.c:1:11: CHARCONST "'a'", // · }, // · Token: example244.c:1:6: GOTO "goto", // · Token2: example244.c:1:15: ';', // } } func ExampleLabeledStatement() { fmt.Println(exampleAST(221, "\U00100001 ( { a : ; !")) // Output: // &cc.LabeledStatement{ // · Statement: &cc.Statement{ // · · Case: 2, // · · ExpressionStatement: &cc.ExpressionStatement{ // · · · Token: example221.c:1:10: ';', // · · }, // · }, // · Token: example221.c:1:6: IDENTIFIER "a", // · Token2: example221.c:1:8: ':', // } } func ExampleLabeledStatement_case1() { fmt.Println(exampleAST(222, "\U00100001 ( { case 'a' : ; !")) // Output: // &cc.LabeledStatement{ // · Case: 1, // · ConstantExpression: &cc.ConstantExpression{ // · · Type: int, // · · Value: 97, // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 97, // · · · Case: 1, // · · · Token: example222.c:1:11: CHARCONST "'a'", // · · }, // · }, // · Statement: &cc.Statement{ // · · Case: 2, // · · ExpressionStatement: &cc.ExpressionStatement{ // · · · Token: example222.c:1:17: ';', // · · }, // · }, // · Token: example222.c:1:6: CASE "case", // · Token2: example222.c:1:15: ':', // } } func ExampleLabeledStatement_case2() { fmt.Println(exampleAST(223, "\U00100001 ( { default : ; !")) // Output: // &cc.LabeledStatement{ // · Case: 2, // · Statement: &cc.Statement{ // · · Case: 2, // · · ExpressionStatement: &cc.ExpressionStatement{ // · · · Token: example223.c:1:16: ';', // · · }, // · }, // · Token: example223.c:1:6: DEFAULT "default", // · Token2: example223.c:1:14: ':', // } } func ExampleParameterDeclaration() { fmt.Println(exampleAST(175, "\U00100002 a ( auto b )")) // Output: // &cc.ParameterDeclaration{ // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · Case: 3, // · · · Token: example175.c:1:6: AUTO "auto", // · · }, // · }, // · Declarator: &cc.Declarator{ // · · Linkage: None, // · · Type: auto undefined, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Token: example175.c:1:11: IDENTIFIER "b", // · · }, // · }, // } } func ExampleParameterDeclaration_case1() { fmt.Println(exampleAST(176, "\U00100002 a ( auto )")) // Output: // &cc.ParameterDeclaration{ // · Case: 1, // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · Case: 3, // · · · Token: example176.c:1:6: AUTO "auto", // · · }, // · }, // } } func ExampleParameterList() { fmt.Println(exampleAST(173, "\U00100002 a ( auto )")) // Output: // &cc.ParameterList{ // · ParameterDeclaration: &cc.ParameterDeclaration{ // · · Case: 1, // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Case: 3, // · · · · Token: example173.c:1:6: AUTO "auto", // · · · }, // · · }, // · }, // } } func ExampleParameterList_case1() { fmt.Println(exampleAST(174, "\U00100002 a ( auto , auto )")) // Output: // &cc.ParameterList{ // · ParameterDeclaration: &cc.ParameterDeclaration{ // · · Case: 1, // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Case: 3, // · · · · Token: example174.c:1:6: AUTO "auto", // · · · }, // · · }, // · }, // · ParameterList: &cc.ParameterList{ // · · Case: 1, // · · ParameterDeclaration: &cc.ParameterDeclaration{ // · · · Case: 1, // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Case: 3, // · · · · · Token: example174.c:1:13: AUTO "auto", // · · · · }, // · · · }, // · · }, // · · Token: example174.c:1:11: ',', // · }, // } } func ExampleParameterTypeList() { fmt.Println(exampleAST(169, "\U00100002 a ( auto )")) // Output: // &cc.ParameterTypeList{ // · ParameterList: &cc.ParameterList{ // · · ParameterDeclaration: &cc.ParameterDeclaration{ // · · · Case: 1, // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Case: 3, // · · · · · Token: example169.c:1:6: AUTO "auto", // · · · · }, // · · · }, // · · }, // · }, // } } func ExampleParameterTypeList_case1() { fmt.Println(exampleAST(170, "\U00100002 a ( auto , ... )")) // Output: // &cc.ParameterTypeList{ // · Case: 1, // · ParameterList: &cc.ParameterList{ // · · ParameterDeclaration: &cc.ParameterDeclaration{ // · · · Case: 1, // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Case: 3, // · · · · · Token: example170.c:1:6: AUTO "auto", // · · · · }, // · · · }, // · · }, // · }, // · Token: example170.c:1:11: ',', // · Token2: example170.c:1:13: DDD, // } } func ExampleParameterTypeListOpt() { fmt.Println(exampleAST(171, "\U00100001 ( _Bool ( )") == (*ParameterTypeListOpt)(nil)) // Output: // true } func ExampleParameterTypeListOpt_case1() { fmt.Println(exampleAST(172, "\U00100001 ( _Bool ( auto )")) // Output: // &cc.ParameterTypeListOpt{ // · ParameterTypeList: &cc.ParameterTypeList{ // · · ParameterList: &cc.ParameterList{ // · · · ParameterDeclaration: &cc.ParameterDeclaration{ // · · · · Case: 1, // · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · · Case: 3, // · · · · · · Token: example172.c:1:12: AUTO "auto", // · · · · · }, // · · · · }, // · · · }, // · · }, // · }, // } } func ExamplePointer() { fmt.Println(exampleAST(161, "\U00100002 * (")) // Output: // &cc.Pointer{ // · Token: example161.c:1:2: '*', // } } func ExamplePointer_case1() { fmt.Println(exampleAST(162, "\U00100002 * * (")) // Output: // &cc.Pointer{ // · Case: 1, // · Pointer: &cc.Pointer{ // · · Token: example162.c:1:4: '*', // · }, // · Token: example162.c:1:2: '*', // } } func ExamplePointerOpt() { fmt.Println(exampleAST(163, "\U00100002 auto (") == (*PointerOpt)(nil)) // Output: // true } func ExamplePointerOpt_case1() { fmt.Println(exampleAST(164, "\U00100001 ( _Bool * (")) // Output: // &cc.PointerOpt{ // · Pointer: &cc.Pointer{ // · · Token: example164.c:1:10: '*', // · }, // } } func ExamplePreprocessingFile() { fmt.Println(exampleAST(285, "\U00100000 ")) // Output: // &cc.PreprocessingFile{ // · GroupList: &cc.GroupList{ // · }, // } } func ExampleSelectionStatement() { fmt.Println(exampleAST(233, "\U00100001 ( { if ( 'a' ) ; !")) // Output: // &cc.SelectionStatement{ // · ExpressionList: &cc.ExpressionList{ // · · Type: int, // · · Value: 97, // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 97, // · · · Case: 1, // · · · Token: example233.c:1:11: CHARCONST "'a'", // · · }, // · }, // · Statement: &cc.Statement{ // · · Case: 2, // · · ExpressionStatement: &cc.ExpressionStatement{ // · · · Token: example233.c:1:17: ';', // · · }, // · }, // · Token: example233.c:1:6: IF "if", // · Token2: example233.c:1:9: '(', // · Token3: example233.c:1:15: ')', // } } func ExampleSelectionStatement_case1() { fmt.Println(exampleAST(234, "\U00100001 ( { if ( 'a' ) ; else ; !")) // Output: // &cc.SelectionStatement{ // · Case: 1, // · ExpressionList: &cc.ExpressionList{ // · · Type: int, // · · Value: 97, // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 97, // · · · Case: 1, // · · · Token: example234.c:1:11: CHARCONST "'a'", // · · }, // · }, // · Statement: &cc.Statement{ // · · Case: 2, // · · ExpressionStatement: &cc.ExpressionStatement{ // · · · Token: example234.c:1:17: ';', // · · }, // · }, // · Statement2: &cc.Statement{ // · · Case: 2, // · · ExpressionStatement: &cc.ExpressionStatement{ // · · · Token: example234.c:1:24: ';', // · · }, // · }, // · Token: example234.c:1:6: IF "if", // · Token2: example234.c:1:9: '(', // · Token3: example234.c:1:15: ')', // · Token4: example234.c:1:19: ELSE "else", // } } func ExampleSelectionStatement_case2() { fmt.Println(exampleAST(235, "\U00100001 ( { switch ( 'a' ) ; !")) // Output: // &cc.SelectionStatement{ // · Case: 2, // · ExpressionList: &cc.ExpressionList{ // · · Type: int, // · · Value: 97, // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 97, // · · · Case: 1, // · · · Token: example235.c:1:15: CHARCONST "'a'", // · · }, // · }, // · Statement: &cc.Statement{ // · · Case: 2, // · · ExpressionStatement: &cc.ExpressionStatement{ // · · · Token: example235.c:1:21: ';', // · · }, // · }, // · Token: example235.c:1:6: SWITCH "switch", // · Token2: example235.c:1:13: '(', // · Token3: example235.c:1:19: ')', // } } func ExampleSpecifierQualifierList() { fmt.Println(exampleAST(127, "\U00100001 ( _Bool (")) // Output: // &cc.SpecifierQualifierList{ // · TypeSpecifier: &cc.TypeSpecifier{ // · · Case: 9, // · · Token: example127.c:1:4: BOOL "_Bool", // · }, // } } func ExampleSpecifierQualifierList_case1() { fmt.Println(exampleAST(128, "\U00100001 ( const (")) // Output: // &cc.SpecifierQualifierList{ // · Case: 1, // · TypeQualifier: &cc.TypeQualifier{ // · · Token: example128.c:1:4: CONST "const", // · }, // } } func ExampleSpecifierQualifierListOpt() { fmt.Println(exampleAST(129, "\U00100001 ( _Bool (") == (*SpecifierQualifierListOpt)(nil)) // Output: // true } func ExampleSpecifierQualifierListOpt_case1() { fmt.Println(exampleAST(130, "\U00100001 ( _Bool _Bool (")) // Output: // &cc.SpecifierQualifierListOpt{ // · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · TypeSpecifier: &cc.TypeSpecifier{ // · · · Case: 9, // · · · Token: example130.c:1:10: BOOL "_Bool", // · · }, // · }, // } } func ExampleStatement() { fmt.Println(exampleAST(214, "\U00100001 ( { default : ; !")) // Output: // &cc.Statement{ // · LabeledStatement: &cc.LabeledStatement{ // · · Case: 2, // · · Statement: &cc.Statement{ // · · · Case: 2, // · · · ExpressionStatement: &cc.ExpressionStatement{ // · · · · Token: example214.c:1:16: ';', // · · · }, // · · }, // · · Token: example214.c:1:6: DEFAULT "default", // · · Token2: example214.c:1:14: ':', // · }, // } } func ExampleStatement_case1() { fmt.Println(exampleAST(215, "\U00100001 ( { { } !")) // Output: // &cc.Statement{ // · Case: 1, // · CompoundStatement: &cc.CompoundStatement{ // · · Token: example215.c:1:6: '{', // · · Token2: example215.c:1:8: '}', // · }, // } } func ExampleStatement_case2() { fmt.Println(exampleAST(216, "\U00100001 ( { ; !")) // Output: // &cc.Statement{ // · Case: 2, // · ExpressionStatement: &cc.ExpressionStatement{ // · · Token: example216.c:1:6: ';', // · }, // } } func ExampleStatement_case3() { fmt.Println(exampleAST(217, "\U00100001 ( { if ( 'a' ) ; !")) // Output: // &cc.Statement{ // · Case: 3, // · SelectionStatement: &cc.SelectionStatement{ // · · ExpressionList: &cc.ExpressionList{ // · · · Type: int, // · · · Value: 97, // · · · Expression: &cc.Expression{ // · · · · Type: int, // · · · · Value: 97, // · · · · Case: 1, // · · · · Token: example217.c:1:11: CHARCONST "'a'", // · · · }, // · · }, // · · Statement: &cc.Statement{ // · · · Case: 2, // · · · ExpressionStatement: &cc.ExpressionStatement{ // · · · · Token: example217.c:1:17: ';', // · · · }, // · · }, // · · Token: example217.c:1:6: IF "if", // · · Token2: example217.c:1:9: '(', // · · Token3: example217.c:1:15: ')', // · }, // } } func ExampleStatement_case4() { fmt.Println(exampleAST(218, "\U00100001 ( { while ( 'a' ) ; !")) // Output: // &cc.Statement{ // · Case: 4, // · IterationStatement: &cc.IterationStatement{ // · · ExpressionList: &cc.ExpressionList{ // · · · Type: int, // · · · Value: 97, // · · · Expression: &cc.Expression{ // · · · · Type: int, // · · · · Value: 97, // · · · · Case: 1, // · · · · Token: example218.c:1:14: CHARCONST "'a'", // · · · }, // · · }, // · · Statement: &cc.Statement{ // · · · Case: 2, // · · · ExpressionStatement: &cc.ExpressionStatement{ // · · · · Token: example218.c:1:20: ';', // · · · }, // · · }, // · · Token: example218.c:1:6: WHILE "while", // · · Token2: example218.c:1:12: '(', // · · Token3: example218.c:1:18: ')', // · }, // } } func ExampleStatement_case5() { fmt.Println(exampleAST(219, "\U00100001 ( { break ; !")) // Output: // &cc.Statement{ // · Case: 5, // · JumpStatement: &cc.JumpStatement{ // · · Case: 2, // · · Token: example219.c:1:6: BREAK "break", // · · Token2: example219.c:1:12: ';', // · }, // } } func ExampleStatement_case6() { fmt.Println(exampleAST(220, "\U00100001 ( { asm ( \"a\" ) !")) // Output: // &cc.Statement{ // · AssemblerStatement: &cc.AssemblerStatement{ // · · BasicAssemblerStatement: &cc.BasicAssemblerStatement{ // · · · AssemblerInstructions: &cc.AssemblerInstructions{ // · · · · Token: example220.c:1:12: STRINGLITERAL "\"a\"", // · · · }, // · · · Token: example220.c:1:6: ASM "asm", // · · · Token2: example220.c:1:10: '(', // · · · Token3: example220.c:1:16: ')', // · · }, // · }, // · Case: 6, // } } func ExampleStaticAssertDeclaration() { fmt.Println(exampleAST(284, "\U00100002 _Static_assert ( 'a' , \"b\" ) ;")) // Output: // &cc.StaticAssertDeclaration{ // · ConstantExpression: &cc.ConstantExpression{ // · · Type: int, // · · Value: 97, // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 97, // · · · Case: 1, // · · · Token: example284.c:1:19: CHARCONST "'a'", // · · }, // · }, // · Token: example284.c:1:2: STATIC_ASSERT "_Static_assert", // · Token2: example284.c:1:17: '(', // · Token3: example284.c:1:23: ',', // · Token4: example284.c:1:25: STRINGLITERAL "\"b\"", // · Token5: example284.c:1:29: ')', // · Token6: example284.c:1:31: ';', // } } func ExampleStorageClassSpecifier() { fmt.Println(exampleAST(95, "\U00100002 typedef (")) // Output: // &cc.StorageClassSpecifier{ // · Token: example95.c:1:2: TYPEDEF "typedef", // } } func ExampleStorageClassSpecifier_case1() { fmt.Println(exampleAST(96, "\U00100002 extern (")) // Output: // &cc.StorageClassSpecifier{ // · Case: 1, // · Token: example96.c:1:2: EXTERN "extern", // } } func ExampleStorageClassSpecifier_case2() { fmt.Println(exampleAST(97, "\U00100002 static (")) // Output: // &cc.StorageClassSpecifier{ // · Case: 2, // · Token: example97.c:1:2: STATIC "static", // } } func ExampleStorageClassSpecifier_case3() { fmt.Println(exampleAST(98, "\U00100002 auto (")) // Output: // &cc.StorageClassSpecifier{ // · Case: 3, // · Token: example98.c:1:2: AUTO "auto", // } } func ExampleStorageClassSpecifier_case4() { fmt.Println(exampleAST(99, "\U00100002 register (")) // Output: // &cc.StorageClassSpecifier{ // · Case: 4, // · Token: example99.c:1:2: REGISTER "register", // } } func ExampleStructDeclaration() { fmt.Println(exampleAST(124, "\U00100002 struct { _Bool a ; }")) // Output: // &cc.StructDeclaration{ // · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · TypeSpecifier: &cc.TypeSpecifier{ // · · · Case: 9, // · · · Token: example124.c:1:11: BOOL "_Bool", // · · }, // · }, // · StructDeclaratorList: &cc.StructDeclaratorList{ // · · StructDeclarator: &cc.StructDeclarator{ // · · · Declarator: &cc.Declarator{ // · · · · Linkage: None, // · · · · Type: bool, // · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · Token: example124.c:1:17: IDENTIFIER "a", // · · · · }, // · · · }, // · · }, // · }, // · Token: example124.c:1:19: ';', // } } func ExampleStructDeclaration_case1() { fmt.Println(exampleAST(125, "\U00100002 struct { _Bool ; }")) // Output: // &cc.StructDeclaration{ // · Case: 1, // · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · TypeSpecifier: &cc.TypeSpecifier{ // · · · Case: 9, // · · · Token: example125.c:1:11: BOOL "_Bool", // · · }, // · }, // · Token: example125.c:1:17: ';', // } } func ExampleStructDeclaration_case2() { fmt.Println(exampleAST(126, "\U00100002 struct { _Static_assert ( 'a' , \"b\" ) ; }")) // Output: // &cc.StructDeclaration{ // · Case: 2, // · StaticAssertDeclaration: &cc.StaticAssertDeclaration{ // · · ConstantExpression: &cc.ConstantExpression{ // · · · Type: int, // · · · Value: 97, // · · · Expression: &cc.Expression{ // · · · · Type: int, // · · · · Value: 97, // · · · · Case: 1, // · · · · Token: example126.c:1:28: CHARCONST "'a'", // · · · }, // · · }, // · · Token: example126.c:1:11: STATIC_ASSERT "_Static_assert", // · · Token2: example126.c:1:26: '(', // · · Token3: example126.c:1:32: ',', // · · Token4: example126.c:1:34: STRINGLITERAL "\"b\"", // · · Token5: example126.c:1:38: ')', // · · Token6: example126.c:1:40: ';', // · }, // } } func ExampleStructDeclarationList() { fmt.Println(exampleAST(122, "\U00100002 struct { _Bool ; }")) // Output: // &cc.StructDeclarationList{ // · StructDeclaration: &cc.StructDeclaration{ // · · Case: 1, // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Case: 9, // · · · · Token: example122.c:1:11: BOOL "_Bool", // · · · }, // · · }, // · · Token: example122.c:1:17: ';', // · }, // } } func ExampleStructDeclarationList_case1() { fmt.Println(exampleAST(123, "\U00100002 struct { _Bool ; _Bool ; }")) // Output: // &cc.StructDeclarationList{ // · StructDeclaration: &cc.StructDeclaration{ // · · Case: 1, // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Case: 9, // · · · · Token: example123.c:1:11: BOOL "_Bool", // · · · }, // · · }, // · · Token: example123.c:1:17: ';', // · }, // · StructDeclarationList: &cc.StructDeclarationList{ // · · Case: 1, // · · StructDeclaration: &cc.StructDeclaration{ // · · · Case: 1, // · · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · · Case: 9, // · · · · · Token: example123.c:1:19: BOOL "_Bool", // · · · · }, // · · · }, // · · · Token: example123.c:1:25: ';', // · · }, // · }, // } } func ExampleStructDeclarator() { fmt.Println(exampleAST(133, "\U00100002 struct { _Bool a ,")) // Output: // &cc.StructDeclarator{ // · Declarator: &cc.Declarator{ // · · Linkage: None, // · · Type: bool, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Token: example133.c:1:17: IDENTIFIER "a", // · · }, // · }, // } } func ExampleStructDeclarator_case1() { fmt.Println(exampleAST(134, "\U00100002 struct { _Bool : 'a' ,")) // Output: // &cc.StructDeclarator{ // · Case: 1, // · ConstantExpression: &cc.ConstantExpression{ // · · Type: int, // · · Value: 97, // · · Expression: &cc.Expression{ // · · · Type: int, // · · · Value: 97, // · · · Case: 1, // · · · Token: example134.c:1:19: CHARCONST "'a'", // · · }, // · }, // · Token: example134.c:1:17: ':', // } } func ExampleStructDeclaratorList() { fmt.Println(exampleAST(131, "\U00100002 struct { _Bool a ,")) // Output: // &cc.StructDeclaratorList{ // · StructDeclarator: &cc.StructDeclarator{ // · · Declarator: &cc.Declarator{ // · · · Linkage: None, // · · · Type: bool, // · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · Token: example131.c:1:17: IDENTIFIER "a", // · · · }, // · · }, // · }, // } } func ExampleStructDeclaratorList_case1() { fmt.Println(exampleAST(132, "\U00100002 struct { _Bool a , b ,")) // Output: // &cc.StructDeclaratorList{ // · StructDeclarator: &cc.StructDeclarator{ // · · Declarator: &cc.Declarator{ // · · · Linkage: None, // · · · Type: bool, // · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · Token: example132.c:1:17: IDENTIFIER "a", // · · · }, // · · }, // · }, // · StructDeclaratorList: &cc.StructDeclaratorList{ // · · Case: 1, // · · StructDeclarator: &cc.StructDeclarator{ // · · · Declarator: &cc.Declarator{ // · · · · Linkage: None, // · · · · Type: bool, // · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · Token: example132.c:1:21: IDENTIFIER "b", // · · · · }, // · · · }, // · · }, // · · Token: example132.c:1:19: ',', // · }, // } } func ExampleStructOrUnion() { fmt.Println(exampleAST(120, "\U00100002 struct {")) // Output: // &cc.StructOrUnion{ // · Token: example120.c:1:2: STRUCT "struct", // } } func ExampleStructOrUnion_case1() { fmt.Println(exampleAST(121, "\U00100002 union {")) // Output: // &cc.StructOrUnion{ // · Case: 1, // · Token: example121.c:1:2: UNION "union", // } } func ExampleStructOrUnionSpecifier() { fmt.Println(exampleAST(117, "\U00100002 struct { int i; } (")) // Output: // &cc.StructOrUnionSpecifier{ // · StructDeclarationList: &cc.StructDeclarationList{ // · · StructDeclaration: &cc.StructDeclaration{ // · · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · · Case: 3, // · · · · · Token: example117.c:1:11: INT "int", // · · · · }, // · · · }, // · · · StructDeclaratorList: &cc.StructDeclaratorList{ // · · · · StructDeclarator: &cc.StructDeclarator{ // · · · · · Declarator: &cc.Declarator{ // · · · · · · Linkage: None, // · · · · · · Type: int, // · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · Token: example117.c:1:15: IDENTIFIER "i", // · · · · · · }, // · · · · · }, // · · · · }, // · · · }, // · · · Token: example117.c:1:16: ';', // · · }, // · }, // · StructOrUnion: &cc.StructOrUnion{ // · · Token: example117.c:1:2: STRUCT "struct", // · }, // · Token: example117.c:1:9: '{', // · Token2: example117.c:1:18: '}', // } } func ExampleStructOrUnionSpecifier_case1() { fmt.Println(exampleAST(118, "\U00100002 struct a (")) // Output: // &cc.StructOrUnionSpecifier{ // · Case: 1, // · StructOrUnion: &cc.StructOrUnion{ // · · Token: example118.c:1:2: STRUCT "struct", // · }, // · Token: example118.c:1:9: IDENTIFIER "a", // } } func ExampleStructOrUnionSpecifier_case2() { fmt.Println(exampleAST(119, "\U00100002 struct { } (")) // Output: // &cc.StructOrUnionSpecifier{ // · Case: 2, // · StructOrUnion: &cc.StructOrUnion{ // · · Token: example119.c:1:2: STRUCT "struct", // · }, // · Token: example119.c:1:9: '{', // · Token2: example119.c:1:11: '}', // } } func ExampleTranslationUnit() { fmt.Println(exampleAST(245, "\U00100002 ;")) // Output: // &cc.TranslationUnit{ // · ExternalDeclaration: &cc.ExternalDeclaration{ // · · Case: 3, // · · Token: example245.c:1:2: ';', // · }, // } } func ExampleTranslationUnit_case1() { fmt.Println(exampleAST(246, "\U00100002 ; ;")) // Output: // &cc.TranslationUnit{ // · ExternalDeclaration: &cc.ExternalDeclaration{ // · · Case: 3, // · · Token: example246.c:1:2: ';', // · }, // · TranslationUnit: &cc.TranslationUnit{ // · · Case: 1, // · · ExternalDeclaration: &cc.ExternalDeclaration{ // · · · Case: 3, // · · · Token: example246.c:1:4: ';', // · · }, // · }, // } } func ExampleTypeName() { fmt.Println(exampleAST(184, "\U00100001 ( _Bool )")) // Output: // &cc.TypeName{ // · Type: bool, // · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · TypeSpecifier: &cc.TypeSpecifier{ // · · · Case: 9, // · · · Token: example184.c:1:4: BOOL "_Bool", // · · }, // · }, // } } func ExampleTypeQualifier() { fmt.Println(exampleAST(144, "\U00100002 const !")) // Output: // &cc.TypeQualifier{ // · Token: example144.c:1:2: CONST "const", // } } func ExampleTypeQualifier_case1() { fmt.Println(exampleAST(145, "\U00100002 restrict !")) // Output: // &cc.TypeQualifier{ // · Case: 1, // · Token: example145.c:1:2: RESTRICT "restrict", // } } func ExampleTypeQualifier_case2() { fmt.Println(exampleAST(146, "\U00100002 volatile !")) // Output: // &cc.TypeQualifier{ // · Case: 2, // · Token: example146.c:1:2: VOLATILE "volatile", // } } func ExampleTypeQualifierList() { fmt.Println(exampleAST(165, "\U00100002 * const !")) // Output: // &cc.TypeQualifierList{ // · TypeQualifier: &cc.TypeQualifier{ // · · Token: example165.c:1:4: CONST "const", // · }, // } } func ExampleTypeQualifierList_case1() { fmt.Println(exampleAST(166, "\U00100002 * const const !")) // Output: // &cc.TypeQualifierList{ // · TypeQualifier: &cc.TypeQualifier{ // · · Token: example166.c:1:4: CONST "const", // · }, // · TypeQualifierList: &cc.TypeQualifierList{ // · · Case: 1, // · · TypeQualifier: &cc.TypeQualifier{ // · · · Token: example166.c:1:10: CONST "const", // · · }, // · }, // } } func ExampleTypeQualifierListOpt() { fmt.Println(exampleAST(167, "\U00100002 * (") == (*TypeQualifierListOpt)(nil)) // Output: // true } func ExampleTypeQualifierListOpt_case1() { fmt.Println(exampleAST(168, "\U00100002 * const !")) // Output: // &cc.TypeQualifierListOpt{ // · TypeQualifierList: &cc.TypeQualifierList{ // · · TypeQualifier: &cc.TypeQualifier{ // · · · Token: example168.c:1:4: CONST "const", // · · }, // · }, // } } func ExampleTypeSpecifier() { fmt.Println(exampleAST(100, "\U00100002 void (")) // Output: // &cc.TypeSpecifier{ // · Token: example100.c:1:2: VOID "void", // } } func ExampleTypeSpecifier_case01() { fmt.Println(exampleAST(101, "\U00100002 char (")) // Output: // &cc.TypeSpecifier{ // · Case: 1, // · Token: example101.c:1:2: CHAR "char", // } } func ExampleTypeSpecifier_case02() { fmt.Println(exampleAST(102, "\U00100002 short (")) // Output: // &cc.TypeSpecifier{ // · Case: 2, // · Token: example102.c:1:2: SHORT "short", // } } func ExampleTypeSpecifier_case03() { fmt.Println(exampleAST(103, "\U00100002 int (")) // Output: // &cc.TypeSpecifier{ // · Case: 3, // · Token: example103.c:1:2: INT "int", // } } func ExampleTypeSpecifier_case04() { fmt.Println(exampleAST(104, "\U00100002 long (")) // Output: // &cc.TypeSpecifier{ // · Case: 4, // · Token: example104.c:1:2: LONG "long", // } } func ExampleTypeSpecifier_case05() { fmt.Println(exampleAST(105, "\U00100002 float (")) // Output: // &cc.TypeSpecifier{ // · Case: 5, // · Token: example105.c:1:2: FLOAT "float", // } } func ExampleTypeSpecifier_case06() { fmt.Println(exampleAST(106, "\U00100002 double (")) // Output: // &cc.TypeSpecifier{ // · Case: 6, // · Token: example106.c:1:2: DOUBLE "double", // } } func ExampleTypeSpecifier_case07() { fmt.Println(exampleAST(107, "\U00100002 signed (")) // Output: // &cc.TypeSpecifier{ // · Case: 7, // · Token: example107.c:1:2: SIGNED "signed", // } } func ExampleTypeSpecifier_case08() { fmt.Println(exampleAST(108, "\U00100002 unsigned (")) // Output: // &cc.TypeSpecifier{ // · Case: 8, // · Token: example108.c:1:2: UNSIGNED "unsigned", // } } func ExampleTypeSpecifier_case09() { fmt.Println(exampleAST(109, "\U00100002 _Bool (")) // Output: // &cc.TypeSpecifier{ // · Case: 9, // · Token: example109.c:1:2: BOOL "_Bool", // } } func ExampleTypeSpecifier_case10() { fmt.Println(exampleAST(110, "\U00100002 _Complex (")) // Output: // &cc.TypeSpecifier{ // · Case: 10, // · Token: example110.c:1:2: COMPLEX "_Complex", // } } func ExampleTypeSpecifier_case11() { fmt.Println(exampleAST(111, "\U00100002 struct a (")) // Output: // &cc.TypeSpecifier{ // · Case: 11, // · StructOrUnionSpecifier: &cc.StructOrUnionSpecifier{ // · · Case: 1, // · · StructOrUnion: &cc.StructOrUnion{ // · · · Token: example111.c:1:2: STRUCT "struct", // · · }, // · · Token: example111.c:1:9: IDENTIFIER "a", // · }, // } } func ExampleTypeSpecifier_case12() { fmt.Println(exampleAST(112, "\U00100002 enum a (")) // Output: // &cc.TypeSpecifier{ // · Case: 12, // · EnumSpecifier: &cc.EnumSpecifier{ // · · Case: 1, // · · Token: example112.c:1:2: ENUM "enum", // · · Token2: example112.c:1:7: IDENTIFIER "a", // · }, // } } func ExampleTypeSpecifier_case13() { fmt.Println(exampleAST(113, "\U00100002 typedef int i; i j;")) // Output: // &cc.TypeSpecifier{ // · Case: 13, // · Token: example113.c:1:17: TYPEDEFNAME "i", // } } func ExampleTypeSpecifier_case14() { fmt.Println(exampleAST(114, "\U00100002 typeof ( 'a' ) (")) // Output: // &cc.TypeSpecifier{ // · Type: int, // · Case: 14, // · Expression: &cc.Expression{ // · · Type: int, // · · Value: 97, // · · Case: 1, // · · Token: example114.c:1:11: CHARCONST "'a'", // · }, // · Token: example114.c:1:2: TYPEOF "typeof", // · Token2: example114.c:1:9: '(', // · Token3: example114.c:1:15: ')', // } } func ExampleTypeSpecifier_case15() { fmt.Println(exampleAST(115, "\U00100002 typeof ( _Bool ) (")) // Output: // &cc.TypeSpecifier{ // · Type: bool, // · Case: 15, // · Token: example115.c:1:2: TYPEOF "typeof", // · Token2: example115.c:1:9: '(', // · Token3: example115.c:1:17: ')', // · TypeName: &cc.TypeName{ // · · Type: bool, // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Case: 9, // · · · · Token: example115.c:1:11: BOOL "_Bool", // · · · }, // · · }, // · }, // } } func ExampleVolatileOpt() { fmt.Println(exampleAST(268, "\U00100002 asm (") == (*VolatileOpt)(nil)) // Output: // true } func ExampleVolatileOpt_case1() { fmt.Println(exampleAST(269, "\U00100002 asm volatile (")) // Output: // &cc.VolatileOpt{ // · Token: example269.c:1:6: VOLATILE "volatile", // } } ================================================ FILE: cc.go ================================================ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate go run generate.go //go:generate golex -o trigraphs.go trigraphs.l //go:generate golex -o scanner.go scanner.l //go:generate stringer -type Kind //go:generate stringer -type Linkage //go:generate stringer -type Namespace //go:generate stringer -type Scope //go:generate go run generate.go -2 // Package cc is a C99 compiler front end. // // Changelog // // 2018-07-01 This package is no longer maintained. Please see the v2 version at // // https://github.com/cznic/cc/v2 // // Links // // Referenced from elsewhere: // // [0]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf // [1]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1406.pdf // [2]: https://github.com/rsc/c2go/blob/fc8cbfad5a47373828c81c7a56cccab8b221d310/cc/cc.y // [3]: https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html package cc import ( "bufio" "bytes" "fmt" "go/token" "os" "os/exec" "runtime" "strings" "github.com/cznic/golex/lex" "github.com/cznic/mathutil" "github.com/cznic/strutil" "github.com/cznic/xc" ) const ( fakeTime = "__TESTING_TIME__" gccPredefine = ` #define __PRETTY_FUNCTION__ __func__ #define __asm asm #define __attribute(x) #define __attribute__(x) #define __builtin___memcpy_chk(x, y, z, t) __BUILTIN___MEMCPY_CHK() #define __builtin___memset_chk(x, y, z, ...) __BUILTIN___MEMSET_CHK() #define __builtin_alloca(x) __BUILTIN_ALLOCA() #define __builtin_classify_type(x) __BUILTIN_CLASSIFY_TYPE() #define __builtin_constant_p(exp) __BUILTIN_CONSTANT_P() #define __builtin_isgreater(x, y) __BUILTIN_ISGREATER() #define __builtin_isless(x, y) __BUILTIN_ISLESS() #define __builtin_isunordered(x, y) __BUILTIN_ISUNORDERED() #define __builtin_longjmp(x, y) __BUILTIN_LONGJMP() #define __builtin_malloc(x) __BUILTIN_MALLOC() #define __builtin_memmove(x, y, z) __BUILTIN_MEMMOVE() #define __builtin_mempcpy(x, y, z) __BUILTIN_MEMPCPY() #define __builtin_mul_overflow(a, b, c) __BUILTIN_MUL_OVERFLOW() #define __builtin_offsetof(type, member) ((%[1]v)(&((type *)0)->member)) #define __builtin_signbit(x) __BUILTIN_SIGNBIT() #define __builtin_va_arg(ap, type) ( *( type* )ap ) #define __builtin_va_end(x) #define __builtin_va_list void* #define __builtin_va_start(x, y) #define __complex _Complex #define __complex__ _Complex #define __const #define __extension__ #define __imag__ #define __inline inline #define __real(x) __REAL() #define __real__ #define __restrict #define __sync_fetch_and_add(x, y, ...) __SYNC_FETCH_AND_ADD() #define __sync_val_compare_and_swap(x, y, z, ...) __SYNC_VAL_COMPARE_AND_SWAP() #define __typeof typeof #define __volatile volatile %[1]v __builtin_object_size (void*, int); %[1]v __builtin_strlen(char*); %[1]v __builtin_strspn(char*, char*); _Bool __BUILTIN_MUL_OVERFLOW(); char* __builtin___stpcpy_chk(char*, char*, %[1]v); char* __builtin_stpcpy(char*, char*); char* __builtin_strchr(char*, int); char* __builtin_strcpy(char*, char*); char* __builtin_strdup(char*); char* __builtin_strncpy(char*, char*, %[1]v); double _Complex __builtin_cpow(double _Complex, _Complex double); double __REAL(); double __builtin_copysign(double, double); double __builtin_copysignl(long double, long double); double __builtin_inff(); double __builtin_modf(double, double*); double __builtin_modfl(long double, long double*); double __builtin_nanf(char *); float _Complex __builtin_conjf(float _Complex); float __builtin_ceilf(float); float __builtin_copysignf(float, float); float __builtin_modff(float, float*); int __BUILTIN_CLASSIFY_TYPE(); int __BUILTIN_CONSTANT_P(); int __BUILTIN_ISGREATER(); int __BUILTIN_ISLESS(); int __BUILTIN_ISUNORDERED(); int __BUILTIN_SIGNBIT(); int __builtin___snprintf_chk (char*, %[1]v, int, %[1]v, char*, ...); int __builtin___sprintf_chk (char*, int, %[1]v, char*, ...); int __builtin___vsnprintf_chk (char*, %[1]v, int, %[1]v, char*, void*); int __builtin___vsprintf_chk (char*, int, %[1]v, char*, void*); int __builtin_abs(int); int __builtin_clrsb(int); int __builtin_clrsbl(long); int __builtin_clrsbll(long long); int __builtin_clz(unsigned int); int __builtin_clzl(unsigned long); int __builtin_clzll(unsigned long long); int __builtin_constant_p (exp); int __builtin_ctz(unsigned int x); int __builtin_ctzl(unsigned long); int __builtin_ctzll(unsigned long long); int __builtin_ffs(int); int __builtin_ffsl(long); int __builtin_ffsll(long long); int __builtin_isinf(double); int __builtin_isinff(float); int __builtin_isinfl(long double); int __builtin_memcmp(void*, void*, %[1]v); int __builtin_parity (unsigned); int __builtin_parityl(unsigned long); int __builtin_parityll (unsigned long long); int __builtin_popcount (unsigned int x); int __builtin_popcountl (unsigned long); int __builtin_popcountll (unsigned long long); int __builtin_printf(char*, ...); int __builtin_puts(char*); int __builtin_setjmp(void*); int __builtin_strcmp(char*, char*); int __builtin_strncmp(char*, char*, %[1]v); long __builtin_expect(long, long); long long strlen (char*); unsigned __builtin_bswap32 (unsigned x); unsigned long long __builtin_bswap64 (unsigned long long x); unsigned short __builtin_bswap16 (unsigned short x); void __BUILTIN_LONGJMP(); void __SYNC_FETCH_AND_ADD(); void __SYNC_VAL_COMPARE_AND_SWAP(); void __builtin_abort(void); void __builtin_bcopy(void*, void*, %[1]v); void __builtin_bzero(void*, %[1]v); void __builtin_prefetch (void*, ...); void __builtin_stack_restore(void*); void __builtin_trap (void); void __builtin_unreachable (void); void __builtin_unwind_init(); void __builtin_va_arg_pack (); void __builtin_va_copy(void*, void*); void* __BUILTIN_ALLOCA(); void* __BUILTIN_MALLOC(); void* __BUILTIN_MEMMOVE(); void* __BUILTIN_MEMPCPY(); void* __BUILTIN___MEMCPY_CHK(); void* __BUILTIN___MEMSET_CHK(); void* __builtin_alloca(int); void* __builtin_apply (void (*)(), void*, %[1]v); void* __builtin_apply_args(); void* __builtin_extract_return_addr(void *); void* __builtin_frame_address(unsigned int); void* __builtin_memcpy(void*, void*, long long); void* __builtin_memset(void*, int, long long); void* __builtin_return_address (unsigned int); void* __builtin_stack_save(); void* memcpy(void*, void*, long long); void* memset(void*, int, long long); ` ) // ImportPath returns the import path of this package or an error, if any. func ImportPath() (string, error) { return strutil.ImportPath() } // HostConfig executes HostCppConfig with the cpp argument set to "cpp". For // more info please see the documentation of HostCppConfig. func HostConfig(opts ...string) (predefined string, includePaths, sysIncludePaths []string, err error) { return HostCppConfig("cpp", opts...) } // HostCppConfig returns the system C preprocessor configuration, or an error, // if any. The configuration is obtained by running the cpp command. For the // predefined macros list the '-dM' options is added. For the include paths // lists, the option '-v' is added and the output is parsed to extract the // "..." include and <...> include paths. To add any other options to cpp, list // them in opts. // // The function relies on a POSIX compatible C preprocessor installed. // Execution of HostConfig is not free, so caching the results is recommended // whenever possible. func HostCppConfig(cpp string, opts ...string) (predefined string, includePaths, sysIncludePaths []string, err error) { args := append(append([]string{"-dM"}, opts...), os.DevNull) // cross-compile e.g. win64 -> win32 if runtime.GOARCH == "386" { args = append(args, "-m32") } pre, err := exec.Command(cpp, args...).Output() if err != nil { return "", nil, nil, err } args = append(append([]string{"-v"}, opts...), os.DevNull) out, err := exec.Command(cpp, args...).CombinedOutput() if err != nil { return "", nil, nil, err } sep := "\n" if runtime.GOOS == "windows" { sep = "\r\n" } a := strings.Split(string(out), sep) for i := 0; i < len(a); { switch a[i] { case "#include \"...\" search starts here:": loop: for i = i + 1; i < len(a); { switch v := a[i]; { case strings.HasPrefix(v, "#") || v == "End of search list.": break loop default: includePaths = append(includePaths, strings.TrimSpace(v)) i++ } } case "#include <...> search starts here:": for i = i + 1; i < len(a); { switch v := a[i]; { case strings.HasPrefix(v, "#") || v == "End of search list.": return string(pre), includePaths, sysIncludePaths, nil default: sysIncludePaths = append(sysIncludePaths, strings.TrimSpace(v)) i++ } } default: i++ } } return "", nil, nil, fmt.Errorf("failed parsing %s -v output", cpp) } type tweaks struct { allowCompatibleTypedefRedefinitions bool // typedef int foo; typedef int foo; comments map[token.Pos]int // devTest bool // disablePredefinedLineMacro bool // __LINE__ will not expand. enableAlignof bool // enableAlternateKeywords bool // __asm__ etc. enableAnonymousStructFields bool // enableAsm bool // enableBuiltinClassifyType bool // __builtin_classify_type(expr) enableBuiltinConstantP bool // __builtin_constant_p(expr) enableComputedGotos bool // var = &&label; goto *var; enableDefineOmitCommaBeforeDDD bool // #define foo(a, b...) enableDlrInIdentifiers bool // foo$bar enableEmptyDeclarations bool // ; // C++11 enableEmptyDefine bool // #define enableEmptyStructs bool // struct foo {}; enableImaginarySuffix bool // 4.2i enableImplicitFuncDef bool // int f() { return g(); } int g() { return 42; } enableImplicitIntType bool // eg. 'static i;' is the same as 'static int i;'. enableIncludeNext bool // enableLegacyDesignators bool // { a: 42 } enableNonConstStaticInitExpressions bool // static int *p = &i; enableNoreturn bool // enableOmitConditionalOperand bool // x ? : y == x ? x : y enableOmitFuncArgTypes bool // f(a) becomes the same as int f(int a). enableOmitFuncRetType bool // f() becomes the same as int f(). enableParenCompoundStmt bool // ({...}), see [3] enableStaticAssert bool // _Static_assert enableTrigraphs bool // ??=define foo(bar) enableTypeof bool // enableUndefExtraTokens bool // #undef foo(bar) enableUnsignedEnums bool // If no enum member is negative, enum type will be unsigned. enableWarnings bool // #warning enableWideBitFieldTypes bool // long long v : 2; enableWideEnumValues bool // enum { v = X } for X wider than 32bits gccEmu bool // mode99c bool // preprocessOnly bool // } func (t *tweaks) doGccEmu() *tweaks { t.allowCompatibleTypedefRedefinitions = true t.enableAlignof = true t.enableAlternateKeywords = true t.enableAnonymousStructFields = true t.enableAsm = true t.enableDefineOmitCommaBeforeDDD = true t.enableDlrInIdentifiers = true t.enableEmptyDefine = true t.enableEmptyStructs = true t.enableIncludeNext = true t.enableNonConstStaticInitExpressions = true t.enableNoreturn = true t.enableOmitFuncRetType = true t.enableStaticAssert = true t.enableTypeof = true t.enableUndefExtraTokens = true t.enableWarnings = false return t } func exampleAST(rule int, src string) interface{} { report := xc.NewReport() report.IgnoreErrors = true r := bytes.NewBufferString(src) r0, _, _ := r.ReadRune() lx, err := newLexer( fmt.Sprintf("example%v.c", rule), len(src)+1, // Plus final injected NL r, report, (&tweaks{gccEmu: true}).doGccEmu(), ) lx.Unget(lex.NewChar(token.Pos(lx.File.Base()), r0)) lx.model = &Model{ // 64 bit Items: map[Kind]ModelItem{ Ptr: {8, 8, 8, nil}, Void: {0, 1, 1, nil}, Char: {1, 1, 1, nil}, SChar: {1, 1, 1, nil}, UChar: {1, 1, 1, nil}, Short: {2, 2, 2, nil}, UShort: {2, 2, 2, nil}, Int: {4, 4, 4, nil}, UInt: {4, 4, 4, nil}, Long: {8, 8, 8, nil}, ULong: {8, 8, 8, nil}, LongLong: {8, 8, 8, nil}, ULongLong: {8, 8, 8, nil}, Float: {4, 4, 4, nil}, Double: {8, 8, 8, nil}, LongDouble: {8, 8, 8, nil}, Bool: {1, 1, 1, nil}, FloatComplex: {8, 8, 8, nil}, DoubleComplex: {16, 16, 16, nil}, LongDoubleComplex: {16, 16, 16, nil}, }, tweaks: &tweaks{}, } lx.model.initialize(lx) if err != nil { panic(err) } lx.exampleRule = rule yyParse(lx) return lx.example } func ppParseString(fn, src string, report *xc.Report, tweaks *tweaks) (*PreprocessingFile, error) { sz := len(src) lx, err := newLexer(fn, sz+1, bytes.NewBufferString(src), report, tweaks) if err != nil { return nil, err } lx.Unget(lex.NewChar(token.Pos(lx.File.Base()), PREPROCESSING_FILE)) yyParse(lx) return lx.preprocessingFile, nil } func ppParse(fn string, report *xc.Report, tweaks *tweaks) (*PreprocessingFile, error) { o := xc.Files.Once(fn, func() interface{} { f, err := os.Open(fn) if err != nil { return err } defer f.Close() fi, err := os.Stat(fn) if err != nil { return nil } sz := fi.Size() if sz > mathutil.MaxInt-1 { return fmt.Errorf("%s: file size too big: %v", fn, sz) } lx, err := newLexer(fn, int(sz)+1, bufio.NewReader(f), report, tweaks) if err != nil { return err } lx.Unget(lex.NewChar(token.Pos(lx.File.Base()), PREPROCESSING_FILE)) if yyParse(lx) != 0 { return report.Errors(true) } return lx.preprocessingFile }) switch r := o.Value(); x := r.(type) { case error: return nil, x case *PreprocessingFile: return x, nil default: panic("internal error") } } // Opt is a configuration/setup function that can be passed to the Parser // function. type Opt func(*lexer) // KeepComments makes the parser keep comments. func KeepComments() Opt { return func(l *lexer) { l.tweaks.comments = map[token.Pos]int{} } } // EnableBuiltinClassifyType makes the parser handle specially // // __builtin_constant_p(expr) // // See https://gcc.gnu.org/onlinedocs/gccint/Varargs.html func EnableBuiltinClassifyType() Opt { return func(l *lexer) { l.tweaks.enableBuiltinClassifyType = true } } // Mode99c turns on support for the 99c compiler. func Mode99c() Opt { return func(l *lexer) { l.tweaks.mode99c = true } } // EnableBuiltinConstantP makes the parser handle specially // // __builtin_constant_p(expr) // // See https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html func EnableBuiltinConstantP() Opt { return func(l *lexer) { l.tweaks.enableBuiltinConstantP = true } } // EnableImplicitIntType makes the parser accept non standard omitting type // specifier. For example // // static i; // // becomes the same as // // static int i; // func EnableImplicitIntType() Opt { return func(l *lexer) { l.tweaks.enableImplicitIntType = true } } // EnableOmitConditionalOperand makes the parser accept non standard // // x ? : y // // See https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Conditionals.html#Conditionals func EnableOmitConditionalOperand() Opt { return func(l *lexer) { l.tweaks.enableOmitConditionalOperand = true } } // EnableComputedGotos makes the parser accept non standard // // variable = &&label; // goto *variable; // // See https://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Labels-as-Values.html func EnableComputedGotos() Opt { return func(l *lexer) { l.tweaks.enableComputedGotos = true } } // EnableUnsignedEnums makes the parser handle choose unsigned int as the type // of an enumeration with no negative members. func EnableUnsignedEnums() Opt { return func(l *lexer) { l.tweaks.enableUnsignedEnums = true } } // EnableLegacyDesignators makes the parser accept legacy designators // // { a: 42 } // Obsolete since GCC 2.5, standard is { .a=42 } // // See https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html func EnableLegacyDesignators() Opt { return func(l *lexer) { l.tweaks.enableLegacyDesignators = true } } // AllowCompatibleTypedefRedefinitions makes the parser accept compatible // typedef redefinitions. // // typedef int foo; // typedef int foo; // ok with this option. // typedef long int foo; // never ok. // func AllowCompatibleTypedefRedefinitions() Opt { return func(l *lexer) { l.tweaks.allowCompatibleTypedefRedefinitions = true } } // EnableParenthesizedCompoundStatemen makes the parser accept non standard // // ({ ... }) // // as an expression. See [3]. func EnableParenthesizedCompoundStatemen() Opt { return func(l *lexer) { l.tweaks.enableParenCompoundStmt = true } } // EnableImaginarySuffix makes the parser accept non standard // // 4.2i, 5.6j etc // // See https://gcc.gnu.org/onlinedocs/gcc/Complex.html func EnableImaginarySuffix() Opt { return func(l *lexer) { l.tweaks.enableImaginarySuffix = true } } // EnableNonConstStaticInitExpressions makes the parser accept non standard // // static int i = f(); // // [0], 6.7.8/4: All the expressions in an initializer for an object that has // static storage duration shall be constant expressions or string literals. func EnableNonConstStaticInitExpressions() Opt { return func(l *lexer) { l.tweaks.enableNonConstStaticInitExpressions = true } } // EnableAnonymousStructFields makes the parser accept non standard // // struct { // int i; // struct { // int j; // }; // int k; // }; func EnableAnonymousStructFields() Opt { return func(l *lexer) { l.tweaks.enableAnonymousStructFields = true } } // EnableOmitFuncRetType makes the parser accept non standard // // f() // Same as int f(). func EnableOmitFuncRetType() Opt { return func(l *lexer) { l.tweaks.enableOmitFuncRetType = true } } // EnableOmitFuncArgTypes makes the parser accept non standard // // f(a) // Same as int f(int a). func EnableOmitFuncArgTypes() Opt { return func(l *lexer) { l.tweaks.enableOmitFuncArgTypes = true } } // EnableEmptyDeclarations makes the parser accept non standard // // ; // C++11 empty declaration func EnableEmptyDeclarations() Opt { return func(l *lexer) { l.tweaks.enableEmptyDeclarations = true } } // EnableIncludeNext makes the parser accept non standard // // #include_next "foo.h" func EnableIncludeNext() Opt { return func(l *lexer) { l.tweaks.enableIncludeNext = true } } // EnableDefineOmitCommaBeforeDDD makes the parser accept non standard // // #define foo(a, b...) // Note the missing comma after identifier list. func EnableDefineOmitCommaBeforeDDD() Opt { return func(l *lexer) { l.tweaks.enableDefineOmitCommaBeforeDDD = true } } // EnableAlternateKeywords makes the parser accept, for example, non standard // // __asm__ // // as an equvalent of keyowrd asm (which first hast be permitted by EnableAsm). func EnableAlternateKeywords() Opt { return func(l *lexer) { l.tweaks.enableAlternateKeywords = true } } // EnableDlrInIdentifiers makes the parser accept non standard // // int foo$bar func EnableDlrInIdentifiers() Opt { return func(l *lexer) { l.tweaks.enableDlrInIdentifiers = true } } // EnableEmptyDefine makes the parser accept non standard // // #define func EnableEmptyDefine() Opt { return func(l *lexer) { l.tweaks.enableEmptyDefine = true } } // EnableImplicitFuncDef makes the parser accept non standard // // int f() { // return g(); // g is undefined, but assumed to be returning int. // } func EnableImplicitFuncDef() Opt { return func(l *lexer) { l.tweaks.enableImplicitFuncDef = true } } // EnableEmptyStructs makes the parser accept non standard // // struct foo {}; func EnableEmptyStructs() Opt { return func(l *lexer) { l.tweaks.enableEmptyStructs = true } } // EnableUndefExtraTokens makes the parser accept non standard // // #undef foo(bar) func EnableUndefExtraTokens() Opt { return func(l *lexer) { l.tweaks.enableUndefExtraTokens = true } } // EnableWideEnumValues makes the parser accept non standard // // enum { v = X }; for X wider than 32 bits. func EnableWideEnumValues() Opt { return func(l *lexer) { l.tweaks.enableWideEnumValues = true } } // EnableWideBitFieldTypes makes the parser accept non standard bitfield // types (i.e, long long and unsigned long long). // // unsigned long long bits : 2; func EnableWideBitFieldTypes() Opt { return func(l *lexer) { l.tweaks.enableWideBitFieldTypes = true } } // SysIncludePaths option configures where to search for system include files // (eg. ). Multiple SysIncludePaths options may be used, the resulting // search path list is produced by appending the option arguments in order of // appearance. func SysIncludePaths(paths []string) Opt { return func(l *lexer) { var err error if l.sysIncludePaths, err = dedupAbsPaths(append(l.sysIncludePaths, fromSlashes(paths)...)); err != nil { l.report.Err(0, "synIncludepaths option: %v", err) } l.sysIncludePaths = l.sysIncludePaths[:len(l.sysIncludePaths):len(l.sysIncludePaths)] } } // IncludePaths option configures where to search for include files (eg. // "name.h"). Multiple IncludePaths options may be used, the resulting search // path list is produced by appending the option arguments in order of // appearance. func IncludePaths(paths []string) Opt { return func(l *lexer) { var err error if l.includePaths, err = dedupAbsPaths(append(l.includePaths, fromSlashes(paths)...)); err != nil { l.report.Err(0, "includepaths option: %v", err) } l.includePaths = l.includePaths[:len(l.includePaths):len(l.includePaths)] } } // YyDebug sets the parser debug level. func YyDebug(n int) Opt { return func(*lexer) { yyDebug = n } } // Cpp registers a preprocessor hook function which is called for every line, // or group of lines the preprocessor produces before it is consumed by the // parser. The token slice must not be modified by the hook. func Cpp(f func([]xc.Token)) Opt { return func(lx *lexer) { lx.cpp = f } } // ErrLimit limits the number of calls to the error reporting methods. After // the limit is reached, all errors are reported using log.Print and then // log.Fatal() is called with a message about too many errors. To disable // error limit, set ErrLimit to value less or equal zero. Default value is 10. func ErrLimit(n int) Opt { return func(lx *lexer) { lx.report.ErrLimit = n } } // Trigraphs enables processing of trigraphs. func Trigraphs() Opt { return func(lx *lexer) { lx.tweaks.enableTrigraphs = true } } // EnableAsm enables recognizing the reserved word asm. func EnableAsm() Opt { return func(lx *lexer) { lx.tweaks.enableAsm = true } } // EnableNoreturn enables recognizing the reserved word _Noreturn. func EnableNoreturn() Opt { return func(lx *lexer) { lx.tweaks.enableNoreturn = true } } // EnableTypeOf enables recognizing the reserved word typeof. func EnableTypeOf() Opt { return func(lx *lexer) { lx.tweaks.enableTypeof = true } } // EnableAlignOf enables recognizing the reserved word _Alignof. func EnableAlignOf() Opt { return func(lx *lexer) { lx.tweaks.enableAlignof = true } } // EnableStaticAssert enables recognizing the reserved word _Static_assert. func EnableStaticAssert() Opt { return func(lx *lexer) { lx.tweaks.enableStaticAssert = true } } // CrashOnError is an debugging option. func CrashOnError() Opt { return func(lx *lexer) { lx.report.PanicOnError = true } } func disableWarnings() Opt { return func(lx *lexer) { lx.tweaks.enableWarnings = false } } func gccEmu() Opt { return func(lx *lexer) { lx.tweaks.gccEmu = true } } func getTweaks(dst *tweaks) Opt { return func(lx *lexer) { *dst = *lx.tweaks } } func nopOpt() Opt { return func(*lexer) {} } func preprocessOnly() Opt { return func(lx *lexer) { lx.tweaks.preprocessOnly = true } } func devTest() Opt { return func(lx *lexer) { lx.tweaks.devTest = true } } func disablePredefinedLineMacro() Opt { return func(lx *lexer) { lx.tweaks.disablePredefinedLineMacro = true } } // Parse defines any macros in predefine. Then Parse preprocesses and parses // the translation unit consisting of files in paths. The m communicates the // scalar types model and opts allow to amend parser behavior. m cannot be // reused and passed to Parse again. func Parse(predefine string, paths []string, m *Model, opts ...Opt) (*TranslationUnit, error) { if m == nil { return nil, fmt.Errorf("invalid nil model passed") } if m.initialized { return nil, fmt.Errorf("invalid reused model passed") } fromSlashes(paths) report := xc.NewReport() lx0 := &lexer{tweaks: &tweaks{enableWarnings: true}, report: report} for _, opt := range opts { opt(lx0) } m.tweaks = lx0.tweaks if err := report.Errors(true); err != nil { return nil, err } if lx0.tweaks.devTest { predefine += fmt.Sprintf(` #define __DATE__ %q #define __TIME__ %q `, xc.Dict.S(idTDate), fakeTime) } if t := lx0.tweaks; t.gccEmu { t.doGccEmu() } m.initialize(lx0) if err := m.sanityCheck(); err != nil { report.Err(0, "%s", err.Error()) return nil, report.Errors(true) } if lx0.tweaks.gccEmu { dts := debugTypeStrings debugTypeStrings = false predefine += fmt.Sprintf(gccPredefine, m.getSizeType(lx0)) debugTypeStrings = dts } tweaks := lx0.tweaks predefined, err := ppParseString("", predefine, report, tweaks) if err != nil { return nil, err } ch := make(chan []xc.Token, 1000) macros := newMacros() stop := make(chan int, 1) go func() { defer close(ch) newPP(ch, lx0.includePaths, lx0.sysIncludePaths, macros, false, m, report, tweaks).preprocessingFile(predefined) for _, path := range paths { select { case <-stop: return default: } pf, err := ppParse(path, report, tweaks) if err != nil { report.Err(0, err.Error()) return } newPP(ch, lx0.includePaths, lx0.sysIncludePaths, macros, true, m, report, tweaks).preprocessingFile(pf) } }() if err := report.Errors(true); err != nil { // Do not parse if preprocessing already failed. go func() { for range ch { // Drain. } }() stop <- 1 return nil, err } lx := newSimpleLexer(lx0.cpp, report, tweaks) lx.ch = ch lx.state = lsTranslationUnit0 lx.model = m if lx.tweaks.preprocessOnly { var lval yySymType for lval.Token.Rune != lex.RuneEOF { lx.Lex(&lval) } return nil, report.Errors(true) } yyParse(lx) stop <- 1 for range ch { // Drain. } if tu := lx.translationUnit; tu != nil { tu.Macros = macros.macros() tu.Model = m tu.Comments = lx0.tweaks.comments if c := tu.Comments; c != nil { for _, v := range tu.Declarations.Identifiers { switch x := v.Node.(type) { case *DirectDeclarator: pos0 := x.Declarator.Pos() if !pos0.IsValid() { pos0 = x.Pos() } if !pos0.IsValid() { break } if comment(lx0.tweaks, x, x.Declarator) != 0 { break } for p := x.prev; p != nil; { y := p.Node.(*DirectDeclarator) if n := comment(lx0.tweaks, y, y.Declarator); n != 0 { pos := y.DirectDeclarator.Pos() if !pos.IsValid() { pos = y.Pos() } c[pos0] = n break } p2 := p.Node.(*DirectDeclarator).prev if p2 == p { break } p = p2 } default: panic(fmt.Errorf("%T", x)) } } } } return lx.translationUnit, report.Errors(true) } ================================================ FILE: cpp.go ================================================ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "bytes" "fmt" "os" "path/filepath" "strconv" "strings" "github.com/cznic/golex/lex" "github.com/cznic/mathutil" "github.com/cznic/xc" ) var ( _ tokenReader = (*tokenBuf)(nil) _ tokenReader = (*tokenPipe)(nil) ) const ( maxIncludeLevel = 100 sentinel = -1 ) var ( protectedMacros = map[int]bool{ idDate: true, idDefined: true, idFile: true, idLine: true, idSTDC: true, idSTDCHosted: true, idSTDCMBMightNeqWc: true, idSTDCVersion: true, idTime: true, idVAARGS: true, } ) // Macro represents a C preprocessor macro. type Macro struct { Args []int // Numeric IDs of argument identifiers. DefTok xc.Token // Macro name definition token. IsFnLike bool // Whether the macro is function like. Type Type // Non nil if macro expands to a constant expression. Value interface{} // Non nil if macro expands to a constant expression. ellipsis bool // Macro definition uses the idList, ... notation. ellipsis2 bool // Macro definition uses the idList... notation. nonRepl []bool // Non replaceable, due to # or ##, arguments of a fn-like macro. repl PPTokenList // } // ReplacementToks returns the tokens that replace m. func (m *Macro) ReplacementToks() (r []xc.Token) { return decodeTokens(m.repl, nil, false) } func (m *Macro) findArg(nm int) int { for i, v := range m.Args { if v == nm { return i } } if m.ellipsis && nm == idVAARGS { return len(m.Args) } return -1 } type macros struct { m map[int]*Macro pp *pp stack map[int][]*Macro } func newMacros() *macros { return ¯os{ m: map[int]*Macro{}, stack: map[int][]*Macro{}, } } func (m *macros) macros() map[int]*Macro { p := m.pp defer func(ie bool) { p.report.IgnoreErrors = ie }(p.report.IgnoreErrors) p.report.IgnoreErrors = true r := map[int]*Macro{} for id, macro := range m.m { r[id] = macro if macro.IsFnLike { continue } rl := macro.repl if rl == 0 { macro.Value = true // #define foo -> foo: true. macro.Type = p.model.BoolType continue } macro.Value, macro.Type = p.lx.parsePPConstExpr0(rl, p) } return r } type tokenReader interface { eof(more bool) bool peek() xc.Token read() xc.Token unget([]xc.Token) } type tokenBuf struct { toks []xc.Token } // Implements tokenReader. func (t *tokenBuf) eof(bool) bool { return len(t.toks) == 0 } // Implements tokenReader. func (t *tokenBuf) peek() xc.Token { return t.toks[0] } // Implements tokenReader. func (t *tokenBuf) read() xc.Token { r := t.peek(); t.toks = t.toks[1:]; return r } // Implements tokenReader. func (t *tokenBuf) unget(toks []xc.Token) { t.toks = append(toks[:len(toks):len(toks)], t.toks...) } type tokenPipe struct { ack chan struct{} ackMore bool closed bool in []xc.Token last xc.Token out []xc.Token r chan []xc.Token w chan []xc.Token } // Implements tokenReader. func (t *tokenPipe) eof(more bool) bool { again: if len(t.in) != 0 { return false } if t.closed { return true } t.flush(false) if !more { return true } if t.ackMore { t.ack <- struct{}{} } var ok bool if t.in, ok = <-t.r; !ok { t.closed = true return true } if len(t.in) != 0 && t.last.Rune == ' ' && t.in[0].Rune == ' ' { t.in = t.in[1:] goto again } if n := len(t.in); n > 1 && t.in[n-1].Rune == ' ' && t.in[n-2].Rune == ' ' { t.in = t.in[:n-1] goto again } return false } // Implements tokenReader. func (t *tokenPipe) peek() xc.Token { return t.in[0] } // Implements tokenReader. func (t *tokenPipe) read() xc.Token { r := t.peek() t.in = t.in[1:] t.last = r return r } // Implements tokenReader. func (t *tokenPipe) unget(toks []xc.Token) { t.in = append(toks[:len(toks):len(toks)], t.in...) } func (t *tokenPipe) flush(final bool) { t.out = trimSpace(t.out, false) if n := len(t.out); !final && n != 0 { if tok := t.out[n-1]; tok.Rune == STRINGLITERAL || tok.Rune == LONGSTRINGLITERAL { // Accumulate lines b/c of possible string concatenation of preprocessing phase 6. return } } // Preproc phase 6. Adjacent string literal tokens are concatenated. w := 0 for r := 0; r < len(t.out); r++ { v := t.out[r] switch v.Rune { case IDENTIFIER_NONREPL: v.Rune = IDENTIFIER t.out[w] = v w++ case STRINGLITERAL, LONGSTRINGLITERAL: to := r loop: for to < len(t.out)-1 { switch t.out[to+1].Rune { case STRINGLITERAL, LONGSTRINGLITERAL, ' ': to++ default: break loop } } for t.out[to].Rune == ' ' { to-- } if to == r { t.out[w] = v w++ break } var buf bytes.Buffer s := v.S() s = s[:len(s)-1] // Remove trailing " buf.Write(s) for i := r + 1; i <= to; i++ { if t.out[i].Rune == ' ' { continue } s = dict.S(t.out[i].Val) s = s[1 : len(s)-1] // Remove leading and trailing " buf.Write(s) } r = to buf.WriteByte('"') v.Val = dict.ID(buf.Bytes()) fallthrough default: t.out[w] = v w++ } } t.out = t.out[:w] if w == 0 { return } t.w <- t.out t.out = nil } type pp struct { ack chan struct{} // Must be unbuffered. expandingMacros map[int]int // in chan []xc.Token // Must be unbuffered. includeLevel int // includedSearchPath string // includes []string // lx *lexer // macros *macros // model *Model // ppf *PreprocessingFile // protectMacros bool // report *xc.Report // sysIncludes []string // tweaks *tweaks // } func newPP(ch chan []xc.Token, includes, sysIncludes []string, macros *macros, protectMacros bool, model *Model, report *xc.Report, tweaks *tweaks) *pp { var err error if includes, err = dedupAbsPaths(append(includes[:len(includes):len(includes)], sysIncludes...)); err != nil { report.Err(0, "%s", err) return nil } pp := &pp{ ack: make(chan struct{}), expandingMacros: map[int]int{}, in: make(chan []xc.Token), includes: includes, lx: newSimpleLexer(nil, report, tweaks), macros: macros, model: model, protectMacros: protectMacros, report: report, sysIncludes: sysIncludes, tweaks: tweaks, } macros.pp = pp pp.lx.model = model model.initialize(pp.lx) go pp.pp2(ch) return pp } func (p *pp) pp2(ch chan []xc.Token) { pipe := &tokenPipe{ack: p.ack, r: p.in, w: ch} for !pipe.eof(true) { pipe.ackMore = true p.expand(pipe, false, func(toks []xc.Token) { pipe.out = append(pipe.out, toks...) }) pipe.ackMore = false p.ack <- struct{}{} } pipe.flush(true) p.ack <- struct{}{} } func (p *pp) checkCompatibleReplacementTokenList(tok xc.Token, oldList, newList PPTokenList) { ex := trimSpace(decodeTokens(oldList, nil, true), false) toks := trimSpace(decodeTokens(newList, nil, true), false) if g, e := len(toks), len(ex); g != e && len(ex) > 0 { p.report.ErrTok(tok, "cannot redefine macro using a replacement list of different length") return } if len(toks) == 0 || len(ex) == 0 { return } if g, e := whitespace(toks), whitespace(ex); !bytes.Equal(g, e) { p.report.ErrTok(tok, "cannot redefine macro, whitespace differs") } for i, g := range toks { if e := ex[i]; g.Rune != e.Rune || g.Val != e.Val { p.report.ErrTok(tok, "cannot redefine macro using a different replacement list") return } } } func (p *pp) defineMacro(tok xc.Token, repl PPTokenList) { nm := tok.Val if protectedMacros[nm] && p.protectMacros { p.report.ErrTok(tok, "cannot define protected macro") return } m := p.macros.m[nm] if m == nil { if debugMacros { toks := trimSpace(decodeTokens(repl, nil, true), false) var a [][]byte for _, v := range toks { a = append(a, xc.Dict.S(tokVal(v))) } fmt.Fprintf(os.Stderr, "%s: #define %s %s\n", tok.Position(), tok.S(), bytes.Join(a, nil)) } p.macros.m[nm] = &Macro{DefTok: tok, repl: repl} return } if m.IsFnLike { p.report.ErrTok(tok, "cannot redefine a function-like macro using an object-like macro") return } p.checkCompatibleReplacementTokenList(tok, m.repl, repl) } func (p *pp) defineFnMacro(tok xc.Token, il *IdentifierList, repl PPTokenList, ellipsis, ellipsis2 bool) { nm0 := tok.S() nm := dict.ID(nm0[:len(nm0)-1]) if protectedMacros[nm] && p.protectMacros { p.report.ErrTok(tok, "cannot define protected macro %s", xc.Dict.S(nm)) return } var args []int for ; il != nil; il = il.IdentifierList { tok := il.Token2 if !tok.IsValid() { tok = il.Token } args = append(args, tok.Val) } m := p.macros.m[nm] defTok := tok defTok.Rune = IDENTIFIER defTok.Val = nm if m == nil { replToks := decodeTokens(repl, nil, false) if debugMacros { toks := trimSpace(replToks, false) var p [][]byte for _, v := range args { p = append(p, xc.Dict.S(v)) } var a [][]byte for _, v := range toks { a = append(a, xc.Dict.S(tokVal(v))) } fmt.Fprintf(os.Stderr, "%s: #define %s%s) %s\n", tok.Position(), tok.S(), bytes.Join(p, []byte(", ")), bytes.Join(a, nil)) } nonRepl := make([]bool, len(args)) mp := map[int]struct{}{} for i, v := range replToks { switch v.Rune { case PPPASTE: if i > 0 { if tok := replToks[i-1]; tok.Rune == IDENTIFIER { mp[tok.Val] = struct{}{} } } fallthrough case '#': if i < len(replToks)-1 { if tok := replToks[i+1]; tok.Rune == IDENTIFIER { mp[tok.Val] = struct{}{} } } } } m := &Macro{Args: args, DefTok: defTok, IsFnLike: true, repl: repl, ellipsis: ellipsis, ellipsis2: ellipsis2} for nm := range mp { if i := m.findArg(nm); i >= 0 && i < len(nonRepl) { nonRepl[i] = true } } m.nonRepl = nonRepl p.macros.m[nm] = m return } if !m.IsFnLike { p.report.ErrTok(tok, "cannot redefine an object-like macro %s using a function-like macro", xc.Dict.S(nm)) return } if g, e := len(args), len(m.Args); g != e { p.report.ErrTok(tok, "cannot redefine macro %s: number of arguments differ", xc.Dict.S(nm)) return } for i, g := range args { if e := m.Args[i]; g != e { p.report.ErrTok(tok, "cannot redefine macro %s: argument names differ", xc.Dict.S(nm)) return } } p.checkCompatibleReplacementTokenList(tok, m.repl, repl) } func (p *pp) expand(r tokenReader, handleDefined bool, w func([]xc.Token)) { for !r.eof(false) { tok := r.read() switch tok.Rune { case sentinel: p.expandingMacros[tok.Val]-- case IDENTIFIER: if tok.Val == idFile { tok.Rune = STRINGLITERAL tok.Val = dict.SID(fmt.Sprintf("%q", tok.Position().Filename)) w([]xc.Token{tok}) continue } if tok.Val == idLine && !p.tweaks.disablePredefinedLineMacro { tok.Rune = INTCONST tok.Val = dict.SID(strconv.Itoa(position(tok.Pos()).Line)) w([]xc.Token{tok}) continue } if handleDefined && tok.Val == idDefined { p.expandDefined(tok, r, w) continue } m := p.macros.m[tok.Val] if m == nil { w([]xc.Token{tok}) continue } p.expandMacro(tok, r, m, handleDefined, w) default: w([]xc.Token{tok}) } } } func (p *pp) expandDefined(tok xc.Token, r tokenReader, w func([]xc.Token)) { again: if r.eof(false) { p.report.ErrTok(tok, "'defined' with no argument") return } switch tok = r.read(); tok.Rune { case ' ': goto again case '(': // defined (IDENTIFIER) again2: if r.eof(false) { p.report.ErrTok(tok, "'defined' with no argument") return } tok = r.read() switch tok.Rune { case IDENTIFIER: v := tok v.Rune = INTCONST if p.macros.m[tok.Val] != nil { v.Val = id1 } else { v.Val = id0 } again3: if r.eof(false) { p.report.ErrTok(tok, "must be followed by ')'") return } tok = r.read() if tok.Rune == ' ' { goto again3 } if tok.Rune != ')' { p.report.ErrTok(tok, "expected ')'") return } w([]xc.Token{v}) case ' ': goto again2 default: p.report.ErrTok(tok, "expected identifier") return } case IDENTIFIER: v := tok v.Rune = INTCONST if p.macros.m[tok.Val] != nil { v.Val = id1 } else { v.Val = id0 } w([]xc.Token{v}) default: panic(PrettyString(tok)) } } func (p *pp) expandMacro(tok xc.Token, r tokenReader, m *Macro, handleDefined bool, w func([]xc.Token)) { nm := tok.Val if m.IsFnLike { p.expandFnMacro(tok, r, m, handleDefined, w) return } repl := trimSpace(normalizeToks(decodeTokens(m.repl, nil, true)), false) repl = pasteToks(repl) pos := tok.Pos() for i, v := range repl { repl[i].Char = lex.NewChar(pos, v.Rune) } tok.Rune = sentinel p.expandingMacros[nm]++ y := append(p.sanitize(p.expandLineNo(p.pragmas(repl))), tok) r.unget(y) } func trimSpace(toks []xc.Token, removeTrailingComma bool) []xc.Token { if len(toks) == 0 { return nil } if removeTrailingComma { if tok := toks[len(toks)-1]; tok.Rune == ',' { toks = toks[:len(toks)-1] } } for len(toks) != 0 && toks[0].Rune == ' ' { toks = toks[1:] } for len(toks) != 0 && toks[len(toks)-1].Rune == ' ' { toks = toks[:len(toks)-1] } return toks } func (p *pp) pragmas(toks []xc.Token) []xc.Token { var r []xc.Token for len(toks) != 0 { switch tok := toks[0]; { case tok.Rune == IDENTIFIER && tok.Val == idPragma: toks = toks[1:] for len(toks) != 0 && toks[0].Rune == ' ' { toks = toks[1:] } if len(toks) == 0 { p.report.ErrTok(tok, "malformed _Pragma unary operator expression.") return r } if toks[0].Rune != '(' { p.report.ErrTok(toks[0], "expected '('") return r } toks = toks[1:] for len(toks) != 0 && toks[0].Rune == ' ' { toks = toks[1:] } if len(toks) == 0 { p.report.ErrTok(tok, "malformed _Pragma unary operator expression.") return r } if toks[0].Rune != STRINGLITERAL && toks[0].Rune != LONGSTRINGLITERAL { p.report.ErrTok(toks[0], "expected string literal or long string literal") return r } toks = toks[1:] for len(toks) != 0 && toks[0].Rune == ' ' { toks = toks[1:] } if len(toks) == 0 { p.report.ErrTok(tok, "malformed _Pragma unary operator expression.") return r } if toks[0].Rune != ')' { p.report.ErrTok(toks[0], "expected ')'") return r } toks = toks[1:] default: r = append(r, tok) toks = toks[1:] } } return r } func (p *pp) sanitize(toks []xc.Token) []xc.Token { w := 0 for _, v := range toks { switch v.Rune { case 0: // nop case IDENTIFIER: if p.expandingMacros[v.Val] != 0 { v.Rune = IDENTIFIER_NONREPL } fallthrough default: toks[w] = v w++ } } return toks[:w] } func pasteToks(toks []xc.Token) []xc.Token { for i := 0; i < len(toks); { switch tok := toks[i]; tok.Rune { case PPPASTE: var b []byte var r rune var v int if i > 0 { i-- t := toks[i] r = t.Rune if r == IDENTIFIER_NONREPL { // testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/981001-3.c r = IDENTIFIER } v = t.Val b = append(b, xc.Dict.S(tokVal(t))...) toks = append(toks[:i], toks[i+1:]...) // Remove left arg. } if i < len(toks)-1 { i++ t := toks[i] switch { case r == 0: r = t.Rune case r == IDENTIFIER && v == idL: switch t.Rune { case CHARCONST: r = LONGCHARCONST case STRINGLITERAL: r = LONGSTRINGLITERAL } } b = append(b, xc.Dict.S(tokVal(t))...) toks = append(toks[:i], toks[i+1:]...) // Remove right arg. i-- } tok.Rune = r tok.Val = xc.Dict.ID(b) if tok.Rune < 0x80 && tok.Val > 0x80 { tok.Rune = PPOTHER } toks[i] = tok default: i++ } } return toks } func (p *pp) expandLineNo(toks []xc.Token) []xc.Token { for i, v := range toks { if v.Rune == IDENTIFIER && v.Val == idLine && !p.tweaks.disablePredefinedLineMacro { v.Rune = INTCONST v.Val = dict.SID(strconv.Itoa(position(v.Pos()).Line)) toks[i] = v } } return toks } func normalizeToks(toks []xc.Token) []xc.Token { if len(toks) == 0 { return toks } for i := 0; i < len(toks); { switch toks[i].Rune { case PPPASTE: if i > 0 && toks[i-1].Rune == ' ' { i-- toks = append(toks[:i], toks[i+1:]...) break } fallthrough case '#': if i < len(toks)-1 && toks[i+1].Rune == ' ' { j := i + 1 toks = append(toks[:j], toks[j+1:]...) break } fallthrough default: i++ } } return toks } func (p *pp) expandFnMacro(tok xc.Token, r tokenReader, m *Macro, handleDefined bool, w func([]xc.Token)) { nm := tok.Val var sentinels []xc.Token again: if r.eof(true) { r.unget(sentinels) w([]xc.Token{tok}) return } switch c := r.peek().Rune; { case c == ' ': r.read() goto again case c == sentinel: s := r.read() sentinels = append([]xc.Token{s}, sentinels...) goto again case c != '(': // != name() r.unget(sentinels) w([]xc.Token{tok}) return } args := p.parseMacroArgs(r) if g, e := len(args), len(m.Args); g != e { switch { case g == 1 && e == 0 && len(args[0]) == 0: // Spacial case: Handling of empty args to macros with // one parameter makes it non distinguishable of // passing no argument to a macro with no parameters. // ok, nop. case m.ellipsis: if g < e { p.report.ErrTok(tok, "not enough macro arguments, expected at least %v", e+1) return } for i := e + 1; i < len(args); i++ { args[e] = append(args[e], args[i]...) } args = args[:e+1] case m.ellipsis2: if g < e { p.report.ErrTok(tok, "not enough macro arguments, expected at least %v", e) return } for i := e; i < len(args); i++ { args[e-1] = append(args[e-1], args[i]...) } args = args[:e] default: p.report.ErrTok(tok, "macro argument count mismatch: got %v, expected %v", g, e) return } } for i, arg := range args { args[i] = trimSpace(arg, true) } for i, arg := range args { args[i] = nil toks := p.expandLineNo(arg) if i < len(m.nonRepl) && m.nonRepl[i] { if len(toks) != 0 { args[i] = toks } continue } p.expand(&tokenBuf{toks}, handleDefined, func(toks []xc.Token) { args[i] = append(args[i], toks...) }) } repl := trimSpace(normalizeToks(decodeTokens(m.repl, nil, true)), false) for i, v := range repl { repl[i].Char = lex.NewChar(tok.Pos(), v.Rune) } var r0 []xc.Token next: for i, tok := range repl { switch tok.Rune { case IDENTIFIER: if ia := m.findArg(tok.Val); ia >= 0 { if i > 0 && repl[i-1].Rune == '#' { r0 = append(r0[:len(r0)-1], stringify(args[ia])) continue next } var arg []xc.Token if ia < len(args) { arg = args[ia] } if len(arg) == 0 { arg = []xc.Token{{}} } r0 = append(r0, arg...) continue next } r0 = append(r0, tok) default: r0 = append(r0, tok) } } tok.Rune = sentinel sentinels = append([]xc.Token{tok}, sentinels...) p.expandingMacros[nm]++ y := append(p.sanitize(p.pragmas(p.expandLineNo(pasteToks(r0)))), sentinels...) r.unget(y) } func stringify(toks []xc.Token) xc.Token { toks = trimSpace(toks, false) if len(toks) == 0 || (toks[0] == xc.Token{}) { return xc.Token{Char: lex.NewChar(0, STRINGLITERAL), Val: idEmptyString} } s := []byte{'"'} for _, tok := range toks { switch tok.Rune { case CHARCONST, STRINGLITERAL, LONGSTRINGLITERAL, LONGCHARCONST: for _, c := range tok.S() { switch c { case '"', '\\': s = append(s, '\\', c) default: s = append(s, c) } } default: s = append(s, xc.Dict.S(tokVal(tok))...) } } s = append(s, '"') r := xc.Token{Char: lex.NewChar(toks[0].Pos(), STRINGLITERAL), Val: dict.ID(s)} return r } func whitespace(toks []xc.Token) []byte { if len(toks) < 2 { return nil } r := make([]byte, 0, len(toks)-1) ltok := toks[0] for _, tok := range toks[1:] { if ltok.Rune == ' ' { continue } switch { case tok.Rune == ' ': r = append(r, 1) default: r = append(r, 0) } ltok = tok } return r } func (p *pp) parseMacroArgs(r tokenReader) (args [][]xc.Token) { if r.eof(true) { panic("internal error") } tok := r.read() if tok.Rune != '(' { p.report.ErrTok(tok, "expected '('") return nil } for !r.eof(true) { arg, more := p.parseMacroArg(r) args = append(args, arg) if more { continue } if r.eof(true) || r.peek().Rune == ')' { break } } if r.eof(true) { p.report.ErrTok(tok, "missing final ')'") return nil } tok = r.read() if tok.Rune != ')' { p.report.ErrTok(tok, "expected ')'") } return args } func (p *pp) parseMacroArg(r tokenReader) (arg []xc.Token, more bool) { n := 0 tok := r.peek() for { if r.eof(true) { p.report.ErrTok(tok, "unexpected end of line after token") return arg, false } tok = r.peek() switch tok.Rune { case '(': arg = append(arg, r.read()) n++ case ')': if n == 0 { return arg, false } arg = append(arg, r.read()) n-- case ',': if n == 0 { arg = append(arg, r.read()) return arg, true } arg = append(arg, r.read()) default: arg = append(arg, r.read()) } } } func (p *pp) preprocessingFile(n *PreprocessingFile) { ppf := p.ppf p.ppf = n p.groupList(n.GroupList) p.ppf = ppf if p.includeLevel == 0 { close(p.in) <-p.ack } } func (p *pp) groupList(n *GroupList) { for ; n != nil; n = n.GroupList { switch gp := n.GroupPart.(type) { case nil: // PPNONDIRECTIVE PPTokenList // nop case *ControlLine: p.controlLine(gp) case *IfSection: p.ifSection(gp) case PPTokenList: // TextLine if gp == 0 { break } toks := decodeTokens(gp, nil, true) for _, v := range toks { if v.Rune != ' ' { p.in <- toks <-p.ack break } } case xc.Token: if p.tweaks.enableWarnings { fmt.Printf("[INFO] %s at %s\n", gp.S(), xc.FileSet.Position(gp.Pos()).String()) } default: panic("internal error") } } } func (p *pp) ifSection(n *IfSection) { if p.ifGroup(n.IfGroup) || p.elifGroupListOpt(n.ElifGroupListOpt) { return } p.elseGroupOpt(n.ElseGroupOpt) } func (p *pp) ifGroup(n *IfGroup) bool { switch n.Case { case 0: // PPIF PPTokenList GroupListOpt if !p.lx.parsePPConstExpr(n.PPTokenList, p) { return false } case 1: // PPIFDEF IDENTIFIER '\n' GroupListOpt if m := p.macros.m[n.Token2.Val]; m == nil { return false } case 2: // PPIFNDEF IDENTIFIER '\n' GroupListOpt if m := p.macros.m[n.Token2.Val]; m != nil { return false } default: panic(n.Case) } p.groupListOpt(n.GroupListOpt) return true } func (p *pp) elifGroupListOpt(n *ElifGroupListOpt) bool { if n == nil { return false } return p.elifGroupList(n.ElifGroupList) } func (p *pp) elifGroupList(n *ElifGroupList) bool { for ; n != nil; n = n.ElifGroupList { if p.elifGroup(n.ElifGroup) { return true } } return false } func (p *pp) elifGroup(n *ElifGroup) bool { if !p.lx.parsePPConstExpr(n.PPTokenList, p) { return false } p.groupListOpt(n.GroupListOpt) return true } func (p *pp) elseGroupOpt(n *ElseGroupOpt) { if n == nil { return } p.groupListOpt(n.ElseGroup.GroupListOpt) } func (p *pp) groupListOpt(n *GroupListOpt) { if n == nil { return } p.groupList(n.GroupList) } func (p *pp) fixInclude(toks []xc.Token) []xc.Token { again: if len(toks) == 0 { return nil } switch toks[0].Rune { case ' ': toks = toks[1:] goto again case STRINGLITERAL, PPHEADER_NAME: return toks case '<': for i := 1; i < len(toks); i++ { if toks[i].Rune == '>' { r := stringify(toks[1:i]) return []xc.Token{r} } } return nil default: return nil } } func (p *pp) pragma1(a []xc.Token) (t xc.Token, _ bool) { if len(a) != 3 || a[0].Rune != '(' || a[1].Rune != STRINGLITERAL || a[2].Rune != ')' { return t, false } return a[1], true } func (p *pp) pragma(a []xc.Token) { if len(a) == 0 { return } switch t := a[0]; t.Val { case idPushMacro: t, ok := p.pragma1(a[1:]) if !ok { break } s := dict.S(t.Val) nm := dict.ID(s[1 : len(s)-1]) m := p.macros.m[nm] if m == nil { break } p.macros.stack[nm] = append(p.macros.stack[nm], m) case idPopMacro: t, ok := p.pragma1(a[1:]) if !ok { break } s := dict.S(t.Val) nm := dict.ID(s[1 : len(s)-1]) stack := p.macros.stack[nm] if len(stack) == 0 { break } m := stack[0] p.macros.stack[nm] = stack[1:] p.macros.m[nm] = m } } func (p *pp) controlLine(n *ControlLine) { out: switch n.Case { case 0: // PPDEFINE IDENTIFIER ReplacementList p.defineMacro(n.Token2, n.ReplacementList) case 1: // PPDEFINE IDENTIFIER_LPAREN "..." ')' ReplacementList p.defineFnMacro(n.Token2, nil, n.ReplacementList, true, false) case 2: // PPDEFINE IDENTIFIER_LPAREN IdentifierList ',' "..." ')' ReplacementList p.defineFnMacro(n.Token2, n.IdentifierList, n.ReplacementList, true, false) case 3: // PPDEFINE IDENTIFIER_LPAREN IdentifierListOpt ')' ReplacementList var l *IdentifierList if o := n.IdentifierListOpt; o != nil { l = o.IdentifierList } p.defineFnMacro(n.Token2, l, n.ReplacementList, false, false) case 5: // PPHASH_NL // nop case 4: // PPERROR PPTokenListOpt var sep string toks := decodeTokens(n.PPTokenListOpt, nil, true) s := stringify(toks) if s.Val != 0 { sep = ": " } p.report.ErrTok(n.Token, "error%s%s", sep, s.S()) case 6: // PPINCLUDE PPTokenList toks := decodeTokens(n.PPTokenList, nil, false) var exp []xc.Token p.expand(&tokenBuf{toks}, false, func(toks []xc.Token) { exp = append(exp, toks...) }) toks = p.fixInclude(exp) if len(toks) == 0 { p.report.ErrTok(n.Token, "invalid #include argument") break } if p.includeLevel == maxIncludeLevel { p.report.ErrTok(toks[0], "too many include nesting levels") break } currentFileDir := filepath.Dir(p.ppf.path) arg := string(toks[0].S()) var dirs []string switch { case strings.HasPrefix(arg, "<"): switch { case p.tweaks.mode99c: dirs = append([]string(nil), p.sysIncludes...) default: dirs = append(p.includes, p.sysIncludes...) } case strings.HasPrefix(arg, "\""): switch { case p.tweaks.mode99c: dirs = append([]string(nil), p.includes...) default: dirs = p.includes dirs = append([]string{filepath.Dir(p.ppf.path)}, dirs...) } default: p.report.ErrTok(n.Token, "invalid #include argument") break out } // Include origin. arg = arg[1 : len(arg)-1] for i, dir := range dirs { if p.tweaks.mode99c && dir == "@" { dir = currentFileDir dirs[i] = dir } pth := arg if !filepath.IsAbs(pth) { pth = filepath.Join(dir, arg) } if _, err := os.Stat(pth); err != nil { if !os.IsNotExist(err) { p.report.ErrTok(toks[0], err.Error()) } if debugIncludes { fmt.Fprintf(os.Stderr, "include file %q not found\n", pth) } continue } ppf, err := ppParse(pth, p.report, p.tweaks) if err != nil { p.report.ErrTok(toks[0], err.Error()) return } p.includeLevel++ save := p.includedSearchPath p.includedSearchPath = dir p.preprocessingFile(ppf) p.includedSearchPath = save p.includeLevel-- return } p.report.ErrTok(toks[0], "include file not found: %s. Search paths:\n\t%s", arg, strings.Join(clean(dirs), "\n\t")) case 7: // PPLINE PPTokenList '\n' toks := decodeTokens(n.PPTokenList, nil, false) // lineno, fname if len(toks) < 2 || toks[0].Rune != INTCONST || toks[1].Rune != STRINGLITERAL { break } ln, err := strconv.ParseUint(string(toks[0].S()), 10, mathutil.IntBits-1) if err != nil { break } fn := string(toks[1].S()) fn = fn[1 : len(fn)-1] // Unquote. nl := n.Token2 tf := xc.FileSet.File(nl.Pos()) tf.AddLineInfo(tf.Offset(nl.Pos()+1), fn, int(ln)) case 8: // PPPRAGMA PPTokenListOpt p.pragma(decodeTokens(n.PPTokenListOpt, nil, false)) case 9, // PPUNDEF IDENTIFIER '\n' 12: // PPUNDEF IDENTIFIER PPTokenList '\n' nm := n.Token2.Val if protectedMacros[nm] && p.protectMacros { p.report.ErrTok(n.Token2, "cannot undefine protected macro") return } if debugMacros { fmt.Fprintf(os.Stderr, "#undef %s\n", xc.Dict.S(nm)) } delete(p.macros.m, nm) case 10: // PPDEFINE IDENTIFIER_LPAREN IdentifierList "..." ')' ReplacementList p.defineFnMacro(n.Token2, n.IdentifierList, n.ReplacementList, false, true) case 13: // PPINCLUDE_NEXT PPTokenList '\n' toks := decodeTokens(n.PPTokenList, nil, false) var exp []xc.Token p.expand(&tokenBuf{toks}, false, func(toks []xc.Token) { exp = append(exp, toks...) }) toks = p.fixInclude(exp) if len(toks) == 0 { p.report.ErrTok(n.Token, "invalid #include_next argument") break } if p.includeLevel == maxIncludeLevel { p.report.ErrTok(toks[0], "too many include nesting levels") break } arg := string(toks[0].S()) arg = arg[1 : len(arg)-1] origin := p.includedSearchPath var dirs []string found := false for i, dir := range p.includes { if dir == origin { dirs = p.includes[i+1:] found = true break } } if !found { for i, dir := range p.sysIncludes { if dir == origin { dirs = p.sysIncludes[i+1:] found = true break } } } for _, dir := range dirs { pth := filepath.Join(dir, arg) if _, err := os.Stat(pth); err != nil { if !os.IsNotExist(err) { p.report.ErrTok(toks[0], err.Error()) } if debugIncludes { fmt.Fprintf(os.Stderr, "include file %q not found\n", pth) } continue } ppf, err := ppParse(pth, p.report, p.tweaks) if err != nil { p.report.ErrTok(toks[0], err.Error()) return } p.includeLevel++ save := p.includedSearchPath p.includedSearchPath = dir p.preprocessingFile(ppf) p.includedSearchPath = save p.includeLevel-- return } p.report.ErrTok(toks[0], "include file not found: %s", arg) default: panic(n.Case) } } ================================================ FILE: encoding.go ================================================ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "encoding/binary" "go/token" "sort" "strings" "time" "github.com/cznic/golex/lex" "github.com/cznic/mathutil" "github.com/cznic/xc" ) const ( intBits = mathutil.IntBits bitShift = intBits>>6 + 5 bitMask = intBits - 1 scINITIAL = 0 // Start condition (shared value). ) const ( // Character class is an 8 bit encoding of an Unicode rune for the // golex generated FSM. // // Every ASCII rune is its own class. DO NOT change any of the // existing values. Adding new classes is OK. ccEOF = iota + 0x80 _ // ccError ccOther // Any other rune. ccUCNDigit // [0], Annex D, Universal character names for identifiers - digits. ccUCNNonDigit // [0], Annex D, Universal character names for identifiers - non digits. ) const ( tsVoid = iota // 0: "void" tsChar // 1: "char" tsShort // 2: "short" tsInt // 3: "int" tsLong // 4: "long" tsFloat // 5: "float" tsDouble // 6: "double" tsSigned // 7: "signed" tsUnsigned // 8: "unsigned" tsBool // 9: "_Bool" tsComplex // 10: "_Complex" tsStructSpecifier // 11: StructOrUnionSpecifier: struct tsUnionSpecifier // 12: StructOrUnionSpecifier: union tsEnumSpecifier // 13: EnumSpecifier tsTypedefName // 14: TYPEDEFNAME tsTypeof // 15: "typeof" tsUintptr // 16: Pseudo type ) const ( tsBits = 5 // Values [0, 16] tsMask = 1<"), ASM: dict.SID("asm"), AUTO: dict.SID("auto"), BOOL: dict.SID("_Bool"), BREAK: dict.SID("break"), CASE: dict.SID("case"), CHAR: dict.SID("char"), COMPLEX: dict.SID("_Complex"), CONST: dict.SID("const"), CONTINUE: dict.SID("continue"), DDD: dict.SID("..."), DEC: dict.SID("--"), DEFAULT: dict.SID("default"), DIVASSIGN: dict.SID("/="), DO: dict.SID("do"), DOUBLE: dict.SID("double"), ELSE: dict.SID("else"), ENUM: dict.SID("enum"), EQ: dict.SID("=="), EXTERN: dict.SID("extern"), FLOAT: dict.SID("float"), FOR: dict.SID("for"), GEQ: dict.SID(">="), GOTO: dict.SID("goto"), IF: dict.SID("if"), INC: dict.SID("++"), INLINE: dict.SID("inline"), INT: dict.SID("int"), LEQ: dict.SID("<="), LONG: dict.SID("long"), LSH: dict.SID("<<"), LSHASSIGN: dict.SID("<<="), MODASSIGN: dict.SID("%="), MULASSIGN: dict.SID("*="), NEQ: dict.SID("!="), ORASSIGN: dict.SID("|="), OROR: dict.SID("||"), PPPASTE: dict.SID("##"), REGISTER: dict.SID("register"), RESTRICT: dict.SID("restrict"), RETURN: dict.SID("return"), RSH: dict.SID(">>"), RSHASSIGN: dict.SID(">>="), SHORT: dict.SID("short"), SIGNED: dict.SID("signed"), SIZEOF: dict.SID("sizeof"), STATIC: dict.SID("static"), STATIC_ASSERT: dict.SID("_Static_assert"), STRUCT: dict.SID("struct"), SUBASSIGN: dict.SID("-="), SWITCH: dict.SID("switch"), TYPEDEF: dict.SID("typedef"), TYPEOF: dict.SID("typeof"), UNION: dict.SID("union"), UNSIGNED: dict.SID("unsigned"), VOID: dict.SID("void"), VOLATILE: dict.SID("volatile"), WHILE: dict.SID("while"), XORASSIGN: dict.SID("^="), } id0 = dict.SID("0") id1 = dict.SID("1") idAlignof = dict.SID("_Alignof") idAlignofAlt = dict.SID("__alignof__") idAsm = dict.SID("asm") idAsmAlt = dict.SID("__asm__") idBuiltinClasifyType = dict.SID("__builtin_classify_type") idBuiltinConstantP = dict.SID("__builtin_constant_p") idBuiltinTypesCompatible = dict.SID("__builtin_types_compatible__") // Implements __builtin_types_compatible_p idChar = dict.SID("char") idConst = dict.SID("const") idDate = dict.SID("__DATE__") idDefined = dict.SID("defined") idEmptyString = dict.SID(`""`) idFile = dict.SID("__FILE__") idID = dict.SID("ID") idInlineAlt = dict.SID("__inline__") idL = dict.SID("L") idLine = dict.SID("__LINE__") idMagicFunc = dict.SID("__func__") idNoreturn = dict.SID("_Noreturn") idPopMacro = dict.SID("pop_macro") idPragma = dict.SID("_Pragma") idPushMacro = dict.SID("push_macro") idRestrictAlt = dict.SID("__restrict__") idSTDC = dict.SID("__STDC__") idSTDCHosted = dict.SID("__STDC_HOSTED__") idSTDCMBMightNeqWc = dict.SID("__STDC_MB_MIGHT_NEQ_WC__") idSTDCVersion = dict.SID("__STDC_VERSION__") idSignedAlt = dict.SID("__signed__") idSpace = dict.SID(" ") idStatic = dict.SID("static") idStaticAssert = dict.SID("_Static_assert") idTDate = dict.SID(tuTime.Format("Jan _2 2006")) // The date of translation of the preprocessing translation unit. idTTime = dict.SID(tuTime.Format("15:04:05")) // The time of translation of the preprocessing translation unit. idTime = dict.SID("__TIME__") idTypeof = dict.SID("typeof") idTypeofAlt = dict.SID("__typeof__") idVAARGS = dict.SID("__VA_ARGS__") idVolatileAlt = dict.SID("__volatile__") tuTime = time.Now() tokHasVal = map[rune]bool{ CHARCONST: true, FLOATCONST: true, IDENTIFIER: true, IDENTIFIER_LPAREN: true, INTCONST: true, LONGCHARCONST: true, LONGSTRINGLITERAL: true, PPHEADER_NAME: true, PPNUMBER: true, PPOTHER: true, STRINGLITERAL: true, TYPEDEFNAME: true, } // Valid combinations of TypeSpecifier.Case ([0], 6.7.2, 2) tsValid = map[int]Kind{ tsEncode(tsBool): Bool, // _Bool tsEncode(tsChar): Char, // char tsEncode(tsComplex): DoubleComplex, // _Complex tsEncode(tsDouble): Double, // double tsEncode(tsDouble, tsComplex): DoubleComplex, // double _Complex tsEncode(tsEnumSpecifier): Enum, // enum specifier tsEncode(tsFloat): Float, // float tsEncode(tsFloat, tsComplex): FloatComplex, // float _Complex tsEncode(tsInt): Int, // int tsEncode(tsLong): Long, // long tsEncode(tsLong, tsDouble): LongDouble, // long double tsEncode(tsLong, tsDouble, tsComplex): LongDoubleComplex, // long double _Complex tsEncode(tsLong, tsInt): Long, // long int tsEncode(tsLong, tsLong): LongLong, // long long tsEncode(tsLong, tsLong, tsInt): LongLong, // long long int tsEncode(tsShort): Short, // short tsEncode(tsShort, tsInt): Short, // short int tsEncode(tsSigned): Int, // signed tsEncode(tsSigned, tsChar): Char, // signed char tsEncode(tsSigned, tsInt): Int, // signed int tsEncode(tsSigned, tsLong): Long, // signed long tsEncode(tsSigned, tsLong, tsInt): Long, // signed long int tsEncode(tsSigned, tsLong, tsLong): LongLong, // signed long long tsEncode(tsSigned, tsLong, tsLong, tsInt): LongLong, // signed long long int tsEncode(tsSigned, tsShort): Short, // signed short tsEncode(tsSigned, tsShort, tsInt): Short, // signed short int tsEncode(tsStructSpecifier): Struct, // struct tsEncode(tsTypedefName): TypedefName, // typedef name tsEncode(tsTypeof): typeof, // typeof name tsEncode(tsUintptr): UintPtr, // Pseudo type. tsEncode(tsUnionSpecifier): Union, // union tsEncode(tsUnsigned): UInt, // unsigned tsEncode(tsUnsigned, tsChar): UChar, // unsigned char tsEncode(tsUnsigned, tsInt): UInt, // unsigned int tsEncode(tsUnsigned, tsLong): ULong, // unsigned long tsEncode(tsUnsigned, tsLong, tsInt): ULong, // unsigned long int tsEncode(tsUnsigned, tsLong, tsLong): ULongLong, // unsigned long long tsEncode(tsUnsigned, tsLong, tsLong, tsInt): ULongLong, // unsigned long long int tsEncode(tsUnsigned, tsShort): UShort, // unsigned short tsEncode(tsUnsigned, tsShort, tsInt): UShort, // unsigned short int tsEncode(tsVoid): Void, // void } ) func isUCNDigit(r rune) bool { return int(r) < len(ucnDigits)<>bitShift]&(1<>bitShift]&(1<>= 1 // Remove value is valid bit. for n != 0 { r = append(r, n&tsMask) n >>= tsBits } return r } func (l *lexer) encodeToken(tok xc.Token) { n := binary.PutUvarint(l.encBuf1[:], uint64(tok.Rune)) pos := tok.Pos() n += binary.PutUvarint(l.encBuf1[n:], uint64(pos-l.encPos)) l.encPos = pos if tokHasVal[tok.Rune] { n += binary.PutUvarint(l.encBuf1[n:], uint64(tok.Val)) } l.encBuf = append(l.encBuf, l.encBuf1[:n]...) } func decodeToken(p *[]byte, pos *token.Pos) xc.Token { b := *p r, n := binary.Uvarint(b) b = b[n:] d, n := binary.Uvarint(b) b = b[n:] np := *pos + token.Pos(d) *pos = np c := lex.NewChar(np, rune(r)) var v uint64 if tokHasVal[c.Rune] { v, n = binary.Uvarint(b) b = b[n:] } *p = b return xc.Token{Char: c, Val: int(v)} } func decodeTokens(id PPTokenList, r []xc.Token, withSpaces bool) []xc.Token { b := dict.S(int(id)) var pos token.Pos r = r[:0] for len(b) != 0 { tok := decodeToken(&b, &pos) if tok.Rune == ' ' && !withSpaces { continue } r = append(r, tok) } return r } func tokVal(t xc.Token) int { r := t.Rune if r == 0 { return 0 } if v := t.Val; v != 0 { return v } if r != 0 && r < 0x80 { return int(r) + 1 } if i, ok := tokConstVals[r]; ok { return i } panic("internal error") } // TokSrc returns t in its source form. func TokSrc(t xc.Token) string { if x, ok := tokConstVals[t.Rune]; ok { return string(dict.S(x)) } if tokHasVal[t.Rune] { return string(t.S()) } return string(t.Rune) } // universal-character-name \\u{hex-quad}|\\U{hex-quad}{hex-quad} func decodeUCN(runes []rune) (rune, int) { if runes[0] != '\\' { panic("internal error") } runes = runes[1:] switch runes[0] { case 'u': return rune(decodeHexQuad(runes[1:])), 6 case 'U': return rune(decodeHexQuad(runes[1:])<<16 | decodeHexQuad(runes[5:])), 10 default: panic("internal error") } } // hex-quad {hexadecimal-digit}{hexadecimal-digit}{hexadecimal-digit}{hexadecimal-digit} func decodeHexQuad(runes []rune) int { n := 0 for _, r := range runes[:4] { n = n<<4 | decodeHex(r) } return n } func decodeHex(r rune) int { switch { case r >= '0' && r <= '9': return int(r) - '0' default: x := int(r) &^ 0x20 return x - 'A' + 10 } } // escape-sequence {simple-sequence}|{octal-escape-sequence}|{hexadecimal-escape-sequence}|{universal-character-name} // simple-sequence \\['\x22?\\abfnrtv] // octal-escape-sequence \\{octal-digit}{octal-digit}?{octal-digit}? // hexadecimal-escape-sequence \\x{hexadecimal-digit}+ func decodeEscapeSequence(runes []rune) (rune, int) { if runes[0] != '\\' { panic("internal error") } r := runes[1] switch r { case '\'', '"', '?', '\\': return r, 2 case 'a': return 7, 2 case 'b': return 8, 2 case 'f': return 12, 2 case 'n': return 10, 2 case 'r': return 13, 2 case 't': return 9, 2 case 'v': return 11, 2 case 'x': v, n := 0, 2 loop2: for _, r := range runes[2:] { switch { case r >= '0' && r <= '9', r >= 'a' && r <= 'f', r >= 'A' && r <= 'F': v = v<<4 | decodeHex(r) n++ default: break loop2 } } return -rune(v & 0xff), n case 'u', 'U': return decodeUCN(runes) } if r < '0' || r > '7' { panic("internal error") } v, n := 0, 1 loop: for _, r := range runes[1:] { switch { case r >= '0' && r <= '7': v = v<<3 | (int(r) - '0') n++ default: break loop } } return -rune(v), n } ================================================ FILE: etc.go ================================================ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "bytes" "fmt" "go/token" "path/filepath" "strings" "github.com/cznic/golex/lex" "github.com/cznic/mathutil" "github.com/cznic/strutil" "github.com/cznic/xc" ) var ( _ Specifier = (*DeclarationSpecifiers)(nil) _ Specifier = (*SpecifierQualifierList)(nil) _ Specifier = (*spec)(nil) _ Type = (*ctype)(nil) ) var ( noTypedefNameAfter = map[rune]bool{ '*': true, '.': true, ARROW: true, BOOL: true, CHAR: true, COMPLEX: true, DOUBLE: true, ENUM: true, FLOAT: true, GOTO: true, INT: true, LONG: true, SHORT: true, SIGNED: true, STRUCT: true, TYPEDEFNAME: true, UNION: true, UNSIGNED: true, VOID: true, } undefined = &ctype{} debugTypeStrings bool ) // EnumConstant represents the name/value pair defined by an Enumerator. type EnumConstant struct { DefTok xc.Token // Enumeration constant name definition token. Value interface{} // Value represented by name. Type of Value is C int. Tokens []xc.Token // The tokens the constant expression consists of. } // Specifier describes a combination of {Function,StorageClass,Type}Specifiers // and TypeQualifiers. type Specifier interface { IsAuto() bool // StorageClassSpecifier "auto" present. IsConst() bool // TypeQualifier "const" present. IsExtern() bool // StorageClassSpecifier "extern" present. IsInline() bool // FunctionSpecifier "inline" present. IsRegister() bool // StorageClassSpecifier "register" present. IsRestrict() bool // TypeQualifier "restrict" present. IsStatic() bool // StorageClassSpecifier "static" present. IsTypedef() bool // StorageClassSpecifier "typedef" present. IsVolatile() bool // TypeQualifier "volatile" present. TypedefName() int // TypedefName returns the typedef name ID used, if any, zero otherwise. attrs() int // Encoded attributes. firstTypeSpecifier() *TypeSpecifier // kind() Kind // member(int) (*Member, error) // str() string // typeSpecifiers() int // Encoded TypeSpecifier combination. } // Type decribes properties of a C type. type Type interface { // AlignOf returns the alignment in bytes of a value of this type when // allocated in memory not as a struct field. Incomplete struct types // have no alignment and the value returned will be < 0. AlignOf() int // Bits returns the bit width of the type's value. For non integral // types the returned value will < 0. Bits() int // SetBits returns a type instance with the value Bits() will return // equal to n. SetBits panics for n < 0. SetBits(n int) Type // CanAssignTo returns whether this type can be assigned to dst. CanAssignTo(dst Type) bool // Declarator returns the full Declarator which defined an entity of // this type. The returned declarator is possibly artificial. Declarator() *Declarator // RawDeclarator returns the typedef declarator associated with a type // if this type is a typedef name. Otherwise the normal declarator is // returned. RawDeclarator() *Declarator // Element returns the type this Ptr type points to or the element type // of an Array type. Element() Type // Elements returns the number of elements an Array type has. The // returned value is < 0 if this type is not an Array or if the array // is not of a constant size. Elements() int // EnumeratorList returns the enumeration constants defined by an Enum // type, if any. EnumeratorList() []EnumConstant // Kind returns one of Ptr, Void, Int, ... Kind() Kind // Member returns the type of a member of this Struct or Union type, // having numeric name identifier nm. Member(nm int) (*Member, error) // Members returns the members of a Struct or Union type in declaration // order. Returned members are valid iff non nil. // // Note: Non nil members of length 0 means the struct/union has no // members or the type is incomplete, which is indicated by the // isIncomplete return value. // // Note 2: C99 standard does not allow empty structs/unions, but GCC // supports that as an extension. Members() (members []Member, isIncomplete bool) // Parameters returns the parameters of a Function type in declaration // order. Result is valid iff params is not nil. // // Note: len(params) == 0 is fine and just means the function has no // parameters. Parameters() (params []Parameter, isVariadic bool) // Pointer returns a type that points to this type. Pointer() Type // Result returns the result type of a Function type. Result() Type // Sizeof returns the number of bytes needed to store a value of this // type. Incomplete struct types have no size and the value returned // will be < 0. SizeOf() int // Specifier returns the Specifier of this type. Specifier() Specifier // String returns a C-like type specifier of this type. String() string // StructAlignOf returns the alignment in bytes of a value of this type // when allocated in memory as a struct field. Incomplete struct types // have no alignment and the value returned will be < 0. StructAlignOf() int // Tag returns the ID of a tag of a Struct, Union or Enum type, if any. // Otherwise the returned value is zero. Tag() int sizeOf(*lexer) int structAlignOf(*lexer) int } // Member describes a member of a struct or union. // // BitFieldGroup represents the ordinal number of the packed bit fields: // // struct foo { // int i; // int j:1; // BitFieldGroup: 0 // int k:2; // BitFieldGroup: 0 // double l; // int m:1; // BitFieldGroup: 1 // int n:2; // BitFieldGroup: 1 // } type Member struct { BitFieldType Type BitFieldGroup int // Ordinal number of the packed bits field. BitOffsetOf int // Bit field starting bit. Bits int // Size in bits for bit fields, 0 otherwise. Declarator *Declarator // Possibly nil for bit fields. Name int OffsetOf int Padding int // Number of unused bytes added to the end of the field to force proper alignment requirements. Type Type } // Parameter describes a function argument. type Parameter struct { Declarator *Declarator Name int Type Type } // PrettyString pretty prints things produced by this package. func PrettyString(v interface{}) string { return strutil.PrettyString(v, "", "", printHooks) } func position(pos token.Pos) token.Position { return fset.Position(pos) } // Binding records the declaration Node of a declared name. // // In the NSIdentifiers namespace the dynamic type of Node for declared names // is always *DirectDeclarator. The *Declarator associated with the direct // declarator is available via (*DirectDeclarator).TopDeclarator(). // // int* p; // // In the NSTags namespace the dynamic type of Node is xc.Token when a tag is // declared: // // struct foo; // enum bar; // // When a tag is defined, the dynamic type of Node is *EnumSpecifier or // *StructOrUnionSpecifier: // // struct foo { int i; }; // enum bar { a = 1 }; // type Binding struct { Node Node enum bool } // Bindings record names declared in a scope. type Bindings struct { Identifiers map[int]Binding // NSIdentifiers name space bindings. Tags map[int]Binding // NSTags name space bindings. kind Scope // ScopeFile, ... Parent *Bindings // Parent scope or nil for ScopeFile. // Scoped helpers. mergeScope *Bindings // Fn params. specifier Specifier // To store in full declarators. // Struct/union field handling. bitFieldGroup int // Group ordinal number. bitFieldTypes []Type // bitOffset int // isUnion bool // maxAlign int // maxSize int // offset int // prevStructDeclarator *Declarator // } func newBindings(parent *Bindings, kind Scope) *Bindings { return &Bindings{ kind: kind, Parent: parent, } } // Scope retuns the kind of b. func (b *Bindings) Scope() Scope { return b.kind } func (b *Bindings) merge(c *Bindings) { if b.kind != ScopeBlock || len(b.Identifiers) != 0 || c.kind != ScopeParams { panic("internal error") } b.boot(NSIdentifiers) for k, v := range c.Identifiers { b.Identifiers[k] = v } } func (b *Bindings) boot(ns Namespace) map[int]Binding { var m *map[int]Binding switch ns { case NSIdentifiers: m = &b.Identifiers case NSTags: m = &b.Tags default: panic(fmt.Errorf("internal error %v", ns)) } mp := *m if mp == nil { mp = make(map[int]Binding) *m = mp } return mp } func (b *Bindings) root() *Bindings { for b.Parent != nil { b = b.Parent } return b } // Lookup returns the Binding of id in ns or any of its parents. If id is // undeclared, the returned Binding has its Node field set to nil. func (b *Bindings) Lookup(ns Namespace, id int) Binding { r, _ := b.Lookup2(ns, id) return r } // Lookup2 is like Lookup but addionally it returns also the scope in which id // was found. func (b *Bindings) Lookup2(ns Namespace, id int) (Binding, *Bindings) { if ns == NSTags { b = b.root() } for b != nil { m := b.boot(ns) if x, ok := m[id]; ok { return x, b } b = b.Parent } return Binding{}, nil } func (b *Bindings) declareIdentifier(tok xc.Token, d *DirectDeclarator, report *xc.Report) { m := b.boot(NSIdentifiers) var p *Binding if ex, ok := m[tok.Val]; ok { p = &ex } d.prev = p m[tok.Val] = Binding{d, false} } func (b *Bindings) declareEnumTag(tok xc.Token, report *xc.Report) { b = b.root() m := b.boot(NSTags) if ex, ok := m[tok.Val]; ok { if !ex.enum { report.ErrTok(tok, "struct tag redeclared as enum tag, previous declaration/definition: %s", position(ex.Node.Pos())) } return } m[tok.Val] = Binding{tok, true} } func (b *Bindings) defineEnumTag(tok xc.Token, n Node, report *xc.Report) { b = b.root() m := b.boot(NSTags) if ex, ok := m[tok.Val]; ok { if !ex.enum { report.ErrTok(tok, "struct tag redefined as enum tag, previous declaration/definition: %s", position(ex.Node.Pos())) return } if _, ok := ex.Node.(xc.Token); !ok { report.ErrTok(tok, "enum tag redefined, previous definition: %s", position(ex.Node.Pos())) return } } m[tok.Val] = Binding{n, true} } func (b *Bindings) defineEnumConst(lx *lexer, tok xc.Token, v interface{}) *Declarator { b = b.root() d := lx.model.makeDeclarator(0, tsInt) dd := d.DirectDeclarator dd.Token = tok dd.EnumVal = v d.setFull(lx) b.declareIdentifier(tok, dd, lx.report) switch x := v.(type) { case int16: lx.iota = int64(x) + 1 case int32: lx.iota = int64(x) + 1 case int64: lx.iota = x + 1 default: panic(fmt.Errorf("%T", x)) } return d } func (b *Bindings) declareStructTag(tok xc.Token, report *xc.Report) { b = b.root() m := b.boot(NSTags) if ex, ok := m[tok.Val]; ok { if ex.enum { report.ErrTok(tok, "enum tag redeclared as struct tag, previous declaration/definition: %s", position(ex.Node.Pos())) } return } m[tok.Val] = Binding{tok, false} } func (b *Bindings) defineStructTag(tok xc.Token, n Node, report *xc.Report) { b = b.root() m := b.boot(NSTags) if ex, ok := m[tok.Val]; ok { if ex.enum { report.ErrTok(tok, "enum tag redefined as struct tag, previous declaration/definition: %s", position(ex.Node.Pos())) return } if _, ok := ex.Node.(xc.Token); !ok { if !n.(*StructOrUnionSpecifier).isCompatible(ex.Node.(*StructOrUnionSpecifier)) { report.ErrTok(tok, "incompatible struct tag redefinition, previous definition at %s", position(ex.Node.Pos())) } return } } m[tok.Val] = Binding{n, false} } func (b *Bindings) isTypedefName(id int) bool { x := b.Lookup(NSIdentifiers, id) if dd, ok := x.Node.(*DirectDeclarator); ok { return dd.specifier.IsTypedef() } return false } func (b *Bindings) lexerHack(tok, prev xc.Token) xc.Token { // https://en.wikipedia.org/wiki/The_lexer_hack if noTypedefNameAfter[prev.Rune] { return tok } if tok.Rune == IDENTIFIER && b.isTypedefName(tok.Val) { tok.Char = lex.NewChar(tok.Pos(), TYPEDEFNAME) } return tok } func errPos(a ...token.Pos) token.Pos { for _, v := range a { if v.IsValid() { return v } } return token.Pos(0) } func isZero(v interface{}) bool { return !isNonZero(v) } func isNonZero(v interface{}) bool { switch x := v.(type) { case int32: return x != 0 case int: return x != 0 case uint32: return x != 0 case int64: return x != 0 case uint64: return x != 0 case float32: return x != 0 case float64: return x != 0 case StringLitID, LongStringLitID: return true default: panic(fmt.Errorf("internal error: %T", x)) } } func fromSlashes(a []string) []string { for i, v := range a { a[i] = filepath.FromSlash(v) } return a } type ctype struct { bits int dds []*DirectDeclarator // Expanded. dds0 []*DirectDeclarator // Unexpanded, only for typedefs model *Model resultAttr int resultSpecifier Specifier resultStars int stars int } func (n *ctype) SetBits(b int) Type { if b < 0 { panic("internal error") } if b == n.bits { return n } o := *n o.bits = b return &o } func (n *ctype) Bits() int { if n.bits > 0 { return n.bits } if !IsIntType(n) { return -1 } n.bits = n.model.Items[n.Kind()].Size * 8 return n.bits } func (n *ctype) arrayDecay() *ctype { return n.setElements(-1) } func (n *ctype) setElements(elems int) *ctype { m := *n m.dds = append([]*DirectDeclarator(nil), n.dds...) for i, dd := range m.dds { switch dd.Case { case 0: // IDENTIFIER // nop case 2: // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' dd := dd.clone() dd.elements = elems m.dds[i] = dd return &m default: //dbg("", position(dd.Pos()), n.str(), elems) panic(dd.Case) } } return n } func (n *ctype) eq(m *ctype) (r bool) { const ignore = saInline | saTypedef | saExtern | saStatic | saAuto | saRegister | saConst | saRestrict | saVolatile | saNoreturn if n == m { return true } if len(n.dds) != len(m.dds) || n.resultAttr&^ignore != m.resultAttr&^ignore || n.resultStars != m.resultStars || n.stars != m.stars { return false } for i, n := range n.dds { if !n.isCompatible(m.dds[i]) { return false } } return n.resultSpecifier.str() == m.resultSpecifier.str() } func (n *ctype) isCompatible(m *ctype) (r bool) { const ignore = saInline | saTypedef | saExtern | saStatic | saAuto | saRegister | saConst | saRestrict | saVolatile | saNoreturn if n == m { return true } if n.Kind() == Array { n = n.arrayDecay() } if m.Kind() == Array { m = m.arrayDecay() } if len(n.dds) != len(m.dds) || n.resultAttr&^ignore != m.resultAttr&^ignore || n.resultStars != m.resultStars || n.stars != m.stars { return false } if n.Kind() == Function && m.Kind() == Function { a, va := n.Parameters() b, vb := m.Parameters() return isCompatibleParameters(a, b, va, vb) } for i, n := range n.dds { if !n.isCompatible(m.dds[i]) { return false } } ns := n.resultSpecifier ms := m.resultSpecifier if ns == ms { return true } if n.Kind() != m.Kind() { return false } switch ns.kind() { case Array: panic("internal error") case Struct, Union: return n.structOrUnionSpecifier().isCompatible(m.structOrUnionSpecifier()) case Enum: /*TODO 6.2.7 Compatible type and composite type 1 Two types have compatible type if their types are the same. Additional rules for determining whether two types are compatible are described in 6.7.2 for type specifiers, in 6.7.3 for type qualifiers, and in 6.7.5 for declarators.46) Moreover, two structure, union, or enumerated types declared in separate translation units are compatible if their tags and members satisfy the following requirements: If one is declared with a tag, the other shall be declared with the same tag. If both are complete types, then the following additional requirements apply: there shall be a one-to-one correspondence between their members such that each pair of corresponding members are declared with compatible types, and such that if one member of a corresponding pair is declared with a name, the other member is declared with the same name. For two structures, corresponding members shall be declared in the same order. For two structures or unions, corresponding bit-fields shall have the same widths. For two enumerations, corresponding members shall have the same values. */ return ms.kind() == Enum case TypedefName: panic("internal error") default: return true } } func (n *ctype) index(d int) int { return len(n.dds) - 1 + d } func (n *ctype) top(d int) *DirectDeclarator { return n.dds[n.index(d)] } // AlignOf implements Type. func (n *ctype) AlignOf() int { if n == undefined { return 1 } if n.Kind() == Array { return n.Element().AlignOf() } switch k := n.Kind(); k { case Void, Ptr, Char, SChar, UChar, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Float, Double, LongDouble, Bool, FloatComplex, DoubleComplex, LongDoubleComplex: return n.model.Items[k].Align case Enum: return n.model.Items[Int].Align case Struct, Union: switch sus := n.structOrUnionSpecifier(); sus.Case { case 1: // StructOrUnion IDENTIFIER return -1 // Incomplete type case 0: // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' return sus.alignOf default: panic(sus.Case) } default: panic(k.String()) } } func (n *ctype) unionCanAssignTo(dst Type) bool { m, isIncomplete := n.Members() if isIncomplete { return false } for _, v := range m { if v.Type.CanAssignTo(dst) { return true } } return false } // CanAssignTo implements Type. func (n *ctype) CanAssignTo(dst Type) bool { if n == undefined || dst.Kind() == Undefined { return false } if n.Kind() == Bool && IsIntType(dst) { return true } if dst.Kind() == Bool && IsIntType(n) { return true } if n.Kind() == Union && n.unionCanAssignTo(dst) { return true } if dst.Kind() == Union && dst.(*ctype).unionCanAssignTo(n) { return true } if n.Kind() == Function { n = n.Pointer().(*ctype) } if dst.Kind() == Function { dst = dst.Pointer().(*ctype) } if n.Kind() == Array && dst.Kind() == Ptr { n = n.arrayDecay() } if dst.Kind() == Array && n.Kind() == Ptr { dst = dst.(*ctype).arrayDecay() } if IsArithmeticType(n) && IsArithmeticType(dst) { return true } if IsIntType(n) && dst.Kind() == Enum { return true } if n.Kind() == Enum && IsIntType(dst) { return true } if n.Kind() == Ptr && dst.Kind() == Ptr && dst.Element().Kind() == Void { return true } if n.Kind() == Ptr && n.Element().Kind() == Void && dst.Kind() == Ptr { return true } if n.isCompatible(dst.(*ctype)) { return true } if n.Kind() == Ptr && dst.Kind() == Ptr { t := Type(n) u := dst for t.Kind() == Ptr && u.Kind() == Ptr { t = t.Element() u = u.Element() } if t.Kind() == Array && unsigned(t.Element().Kind()) == unsigned(u.Kind()) { return true } if t.Kind() == Ptr || u.Kind() == Ptr { return false } if IsIntType(t) && IsIntType(u) && unsigned(t.Kind()) == unsigned(u.Kind()) { return true } if t.Kind() == Function && u.Kind() == Function { a, _ := t.Parameters() b, _ := u.Parameters() if (len(a) == 0) != (len(b) == 0) { a := t.Result() b := u.Result() return a.Kind() == Void && b.Kind() == Void || t.Result().CanAssignTo(u.Result()) } } return t.(*ctype).isCompatible(u.(*ctype)) } if n.Kind() == Function && dst.Kind() == Ptr && dst.Element().Kind() == Function { return n.isCompatible(dst.Element().(*ctype)) } if dst.Kind() == Ptr { if IsIntType(n) { return true } } return false } // RawDeclarator implements Type. func (n *ctype) RawDeclarator() *Declarator { if len(n.dds0) == 0 { return n.dds[0].TopDeclarator() } return n.dds0[0].TopDeclarator() } // Declarator implements Type. func (n *ctype) Declarator() *Declarator { if len(n.dds) == 0 { panic("internal error") } return n.dds[0].TopDeclarator() } // Element implements Type. func (n *ctype) Element() Type { if n == undefined { return n } if n.Kind() != Ptr && n.Kind() != Array { return undefined } if len(n.dds) == 1 { m := *n m.stars-- return &m } switch dd := n.dds[1]; dd.Case { case 1: // '(' Declarator ')' if n.stars == 1 { m := *n m.dds = append([]*DirectDeclarator{n.dds[0]}, n.dds[2:]...) m.dds0 = n.dds0 switch len(m.dds0) { case 0: // nop case 1: nm := m.Declarator().RawSpecifier().TypedefName() typedef := m.Declarator().DirectDeclarator.idScope.Lookup(NSIdentifiers, nm) if typedef.Node == nil { break // undefined } m.dds0 = typedef.Node.(*DirectDeclarator).TopDeclarator().Type.(*ctype).dds0 if len(m.dds0) < 3 { break } fallthrough default: m.dds0 = append([]*DirectDeclarator{m.dds0[0]}, m.dds0[2:]...) } m.stars-- return &m } m := *n m.stars-- return &m case 2: // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' m := *n m.dds = append([]*DirectDeclarator{n.dds[0]}, n.dds[2:]...) switch { case len(m.dds) == 1: m.stars += m.resultStars m.resultStars = 0 default: if dd := m.dds[1]; dd.Case == 1 { // '(' Declarator ')' m.stars = dd.Declarator.stars() if dd.Declarator.stars() == 0 { m.dds = append([]*DirectDeclarator{m.dds[0]}, m.dds[2:]...) } } } return &m default: //dbg("", position(n.dds[0].Pos()), n, n.Kind()) //dbg("", n.str()) panic(dd.Case) } } // Kind implements Type. func (n *ctype) Kind() Kind { if n == undefined { return Undefined } if n.stars > 0 { return Ptr } if len(n.dds) == 1 { return n.resultSpecifier.kind() } i := 1 for { switch dd := n.dds[i]; dd.Case { //TODO case 1: // '(' Declarator ')' case 2: // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' if dd.elements < 0 { return Ptr } return Array case 6, // DirectDeclarator '(' ParameterTypeList ')' 7: // DirectDeclarator '(' IdentifierListOpt ')' return Function default: //dbg("", position(n.Declarator().Pos())) //dbg("", n) //dbg("", n.str()) panic(dd.Case) } } } // Member implements Type. func (n *ctype) Member(nm int) (*Member, error) { if n == undefined { return nil, fmt.Errorf("not a struct/union (have '%s')", n) } if n.Kind() == Array { panic("TODO") } if k := n.Kind(); k != Struct && k != Union { return nil, fmt.Errorf("request for member %s in something not a structure or union (have '%s')", xc.Dict.S(nm), n) } a, _ := n.Members() for i := range a { if a[i].Name == nm { return &a[i], nil } } return nil, fmt.Errorf("%s has no member named %s", Type(n), xc.Dict.S(nm)) } // Returns nil if type kind != Enum func (n *ctype) enumSpecifier() *EnumSpecifier { return n.resultSpecifier.firstTypeSpecifier().EnumSpecifier } func (n *ctype) structOrUnionSpecifier() *StructOrUnionSpecifier { if k := n.Kind(); k != Struct && k != Union { return nil } ts := n.resultSpecifier.firstTypeSpecifier() if ts.Case != 11 { // StructOrUnionSpecifier panic("internal error") } switch sus := ts.StructOrUnionSpecifier; sus.Case { case 0: // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' return sus case 1: // StructOrUnion IDENTIFIER b := sus.scope.Lookup(NSTags, sus.Token.Val) switch x := b.Node.(type) { case nil: return sus case *StructOrUnionSpecifier: return x case xc.Token: return sus default: panic("internal error") } case 2: // StructOrUnion IdentifierOpt '{' '}' // Case 2 return sus default: panic(sus.Case) } } func (n *ctype) members(p *[]Member, l *StructDeclarationList) { r := *p defer func() { *p = r }() for ; l != nil; l = l.StructDeclarationList { switch sdn := l.StructDeclaration; sdn.Case { case 0: // SpecifierQualifierList StructDeclaratorList ';' for l := sdn.StructDeclaratorList; l != nil; l = l.StructDeclaratorList { var d *Declarator var bits int switch sd := l.StructDeclarator; sd.Case { case 0: // Declarator d = sd.Declarator case 1: // DeclaratorOpt ':' ConstantExpression if o := sd.DeclaratorOpt; o != nil { d = o.Declarator } switch x := sd.ConstantExpression.Value.(type) { case int32: bits = int(x) case int64: if x <= int64(n.model.Items[Int].Size*8) { bits = int(x) break } panic("internal error") case uint64: if x <= uint64(n.model.Items[Int].Size*8) { bits = int(x) break } panic("internal error") default: panic("internal error") } default: panic(sd.Case) } var id, off, pad, bitoff, group int t := n.model.IntType var bt Type if d != nil { id, _ = d.Identifier() t = d.Type off = d.offsetOf pad = d.padding bitoff = d.bitOffset bt = d.bitFieldType group = d.bitFieldGroup } r = append(r, Member{ BitFieldGroup: group, BitFieldType: bt, BitOffsetOf: bitoff, Bits: bits, Declarator: d, Name: id, OffsetOf: off, Padding: pad, Type: t, }) } case 1: // SpecifierQualifierList ';' // Case 1 d := sdn.SpecifierQualifierList.TypeSpecifier.StructOrUnionSpecifier.declarator t := d.Type r = append(r, Member{ Declarator: d, OffsetOf: d.offsetOf, Padding: d.padding, Type: t, }) case 2: // StaticAssertDeclaration // Case 2 //nop default: panic("internal error") } } } // Members implements Type. func (n *ctype) Members() (r []Member, isIncomplete bool) { if k := n.Kind(); k != Struct && k != Union { return nil, false } switch sus := n.structOrUnionSpecifier(); sus.Case { case 0: // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' n.members(&r, sus.StructDeclarationList) return r, false case 1: // StructOrUnion IDENTIFIER return []Member{}, true case 2: // StructOrUnion IdentifierOpt '{' '}' // Case 2 return []Member{}, false default: panic(sus.Case) } } // Parameters implements Type. func (n *ctype) Parameters() ([]Parameter, bool) { if n == undefined || n.Kind() != Function { return nil, false } switch dd := n.dds[1]; dd.Case { case 6: // DirectDeclarator '(' ParameterTypeList ')' l := dd.ParameterTypeList return l.params, l.Case == 1 // ParameterList ',' "..." case 7: // DirectDeclarator '(' IdentifierListOpt ')' o := dd.IdentifierListOpt if o == nil { return make([]Parameter, 0), false } return o.params, false default: //dbg("", dd.Case) panic("internal error") } } // Pointer implements Type. func (n *ctype) Pointer() Type { if n == undefined { return n } if len(n.dds) == 1 { m := *n m.stars++ return &m } switch dd := n.dds[1]; dd.Case { case 2, // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' // Case 2 3, // DirectDeclarator '[' "static" TypeQualifierListOpt Expression ']' // Case 3 4, // DirectDeclarator '[' TypeQualifierList "static" Expression ']' // Case 4 5, // DirectDeclarator '[' TypeQualifierListOpt '*' ']' // Case 5 6, // DirectDeclarator '(' ParameterTypeList ')' 7: // DirectDeclarator '(' IdentifierListOpt ')' dd := &DirectDeclarator{ Case: 1, // '(' Declarator ')' Declarator: &Declarator{ DirectDeclarator: &DirectDeclarator{}, PointerOpt: &PointerOpt{ Pointer: &Pointer{}, }, }, } m := *n m.dds = append(append([]*DirectDeclarator{n.dds[0]}, dd), n.dds[1:]...) m.stars++ return &m default: m := *n m.stars++ return &m } } // Result implements Type. func (n *ctype) Result() Type { if n == undefined { return n } if n.Kind() != Function { //dbg("", n, n.Kind()) //dbg("", n.str()) panic("TODO") } i := 1 for { switch dd := n.dds[i]; dd.Case { case 6, // DirectDeclarator '(' ParameterTypeList ')' 7: // DirectDeclarator '(' IdentifierListOpt ')' if i == len(n.dds)-1 { // Outermost function. if i == 1 { m := *n m.dds = m.dds[:1:1] m.stars += m.resultStars m.resultStars = 0 return &m } //dbg("", n) //dbg("", n.str()) panic("TODO") } m := *n m.dds = append([]*DirectDeclarator{n.dds[0]}, n.dds[i+1:]...) if dd := m.dds[1]; dd.Case == 1 { // '(' Declarator ')' m.stars = dd.Declarator.stars() } return &m default: //dbg("", position(n.dds[0].Pos()), n) //dbg("", n.str()) panic(dd.Case) } } } // Elements implements Type. func (n *ctype) Elements() int { done := false loop: for _, dd := range n.dds { more: switch dd.Case { case 0: // IDENTIFIER case 1: // '(' Declarator ')' dd = dd.Declarator.DirectDeclarator done = true goto more case 2, // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' 3, // DirectDeclarator '[' "static" TypeQualifierListOpt Expression ']' 4, // DirectDeclarator '[' TypeQualifierList "static" Expression ']' 5: // DirectDeclarator '[' TypeQualifierListOpt '*' ']' return dd.elements case 6: // DirectDeclarator '(' ParameterTypeList ')' // Case 6 break loop default: //dbg("", position(n.dds[0].Pos()), n) //dbg("", n.str()) panic(dd.Case) } if done { break } } return -1 } // EnumeratorList implements Type func (n *ctype) EnumeratorList() (r []EnumConstant) { if n.Kind() != Enum { return nil } switch es := n.enumSpecifier(); es.Case { case 0: // "enum" IdentifierOpt '{' EnumeratorList CommaOpt '}' for l := es.EnumeratorList; l != nil; l = l.EnumeratorList { e := l.Enumerator if e.ConstantExpression != nil { r = append(r, EnumConstant{ DefTok: e.EnumerationConstant.Token, Value: e.Value, Tokens: e.ConstantExpression.toks}) continue } r = append(r, EnumConstant{ DefTok: e.EnumerationConstant.Token, Value: e.Value, }) } return r case 1: // "enum" IDENTIFIER return nil default: panic(es.Case) } } // SizeOf implements Type. func (n *ctype) SizeOf() int { if n == undefined { return 1 } if n.Kind() == Array { switch nelem := n.Elements(); { case nelem < 0: return n.model.Items[Ptr].Size default: return nelem * n.Element().SizeOf() } } switch k := n.Kind(); k { case Void, Ptr, Char, SChar, UChar, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Float, Double, LongDouble, Bool, FloatComplex, DoubleComplex, LongDoubleComplex: return n.model.Items[k].Size case Enum: return n.model.Items[Int].Size case Struct, Union: switch sus := n.structOrUnionSpecifier(); sus.Case { case 0: // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' return sus.sizeOf case 1: // StructOrUnion IDENTIFIER return -1 // Incomplete type case 2: // StructOrUnion IdentifierOpt '{' '}' // Case 2 return 0 default: panic(sus.Case) } case Function: return n.model.Items[Ptr].Size default: return -1 } } func (n *ctype) sizeOf(lx *lexer) int { r := n.SizeOf() if r < 0 { lx.report.Err(n.Declarator().Pos(), "cannot determine size of %v", n) r = 1 } return r } // Specifier implements Type. func (n *ctype) Specifier() Specifier { return &spec{n.resultAttr, n.resultSpecifier.typeSpecifiers()} } // String implements Type. func (n *ctype) String() string { if n == undefined { return "" } var buf bytes.Buffer s := attrString(n.resultAttr) buf.WriteString(s) if s != "" { buf.WriteString(" ") } s = specifierString(n.resultSpecifier) buf.WriteString(s) buf.WriteString(strings.Repeat("*", n.resultStars)) params := func(p []Parameter) { for i, v := range p { fmt.Fprintf(&buf, "%s", v.Type) if i != len(p)-1 { buf.WriteByte(',') } } } var f func(int) starsWritten := false f = func(x int) { switch dd := n.top(x); dd.Case { case 0: // IDENTIFIER if debugTypeStrings { id := dd.Token.Val if id == 0 { id = idID } fmt.Fprintf(&buf, "<%s>", xc.Dict.S(id)) } if !starsWritten { buf.WriteString(strings.Repeat("*", n.stars)) } case 1: // '(' Declarator ')' buf.WriteString("(") s := 0 switch dd2 := n.top(x - 1); dd2.Case { case 0: // IDENTIFIER s = n.stars starsWritten = true default: s = dd.Declarator.stars() } buf.WriteString(strings.Repeat("*", s)) f(x - 1) buf.WriteString(")") case 2: // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' f(x - 1) buf.WriteString("[") sep := "" if o := dd.TypeQualifierListOpt; o != nil { buf.WriteString(attrString(o.TypeQualifierList.attr)) sep = " " } if e := dd.elements; e > 0 { buf.WriteString(sep) fmt.Fprint(&buf, e) } buf.WriteString("]") case 6: // DirectDeclarator '(' ParameterTypeList ')' f(x - 1) buf.WriteString("(") params(dd.ParameterTypeList.params) buf.WriteString(")") case 7: // DirectDeclarator '(' IdentifierListOpt ')' f(x - 1) buf.WriteString("(") if o := dd.IdentifierListOpt; o != nil { params(o.params) } buf.WriteString(")") default: panic(dd.Case) } } f(0) return buf.String() } // StructAlignOf implements Type. func (n *ctype) StructAlignOf() int { if n == undefined { return 1 } if n.Kind() == Array { return n.Element().StructAlignOf() } switch k := n.Kind(); k { case Void, Ptr, Char, SChar, UChar, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Float, Double, LongDouble, Bool, FloatComplex, DoubleComplex, LongDoubleComplex: return n.model.Items[k].StructAlign case Enum: return n.model.Items[Int].StructAlign case Struct, Union: switch sus := n.structOrUnionSpecifier(); sus.Case { case 0: // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' return sus.alignOf case 1: // StructOrUnion IDENTIFIER return -1 // Incomplete type case 2: // StructOrUnion IdentifierOpt '{' '}' // Case 2 return 1 default: panic(sus.Case) } default: return -1 } } func (n *ctype) structAlignOf(lx *lexer) int { r := n.StructAlignOf() if r < 0 { lx.report.Err(n.Declarator().Pos(), "cannot determine struct align of %v", n) r = 1 } return r } // Tag implements Type. func (n *ctype) Tag() int { switch k := n.Kind(); k { case Struct, Union: switch sus := n.structOrUnionSpecifier(); sus.Case { case 0: // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' if o := sus.IdentifierOpt; o != nil { return o.Token.Val } return 0 case 1: // StructOrUnion IDENTIFIER return sus.Token.Val default: panic(sus.Case) } case Enum: es := n.enumSpecifier() if es == nil { return 0 } switch es.Case { case 0: // "enum" IdentifierOpt '{' EnumeratorList CommaOpt '}' if o := es.IdentifierOpt; o != nil { return o.Token.Val } return 0 case 1: // "enum" IDENTIFIER return es.Token2.Val default: panic(es.Case) } default: return 0 } } type spec struct { attr int ts int } func (s *spec) IsAuto() bool { return s.attr&saAuto != 0 } func (s *spec) IsConst() bool { return s.attr&saConst != 0 } func (s *spec) IsExtern() bool { return s.attr&saExtern != 0 } func (s *spec) IsInline() bool { return s.attr&saInline != 0 } func (s *spec) IsRegister() bool { return s.attr&saRegister != 0 } func (s *spec) IsRestrict() bool { return s.attr&saRestrict != 0 } func (s *spec) IsStatic() bool { return s.attr&saStatic != 0 } func (s *spec) IsTypedef() bool { return s.attr&saTypedef != 0 } func (s *spec) IsVolatile() bool { return s.attr&saVolatile != 0 } func (s *spec) TypedefName() int { return 0 } func (s *spec) attrs() int { return s.attr } func (s *spec) firstTypeSpecifier() *TypeSpecifier { panic("TODO") } func (s *spec) kind() Kind { return tsValid[s.ts] } func (s *spec) member(int) (*Member, error) { panic("TODO") } func (s *spec) str() string { return specifierString(s) } func (s *spec) typeSpecifiers() int { return s.ts } func specifierString(sp Specifier) string { if sp == nil { return "" } var buf bytes.Buffer switch k := sp.kind(); k { case Enum: switch ts := sp.firstTypeSpecifier(); ts.Case { case 12: // EnumSpecifier es := ts.EnumSpecifier switch es.Case { case 0: // "enum" IdentifierOpt '{' EnumeratorList CommaOpt '}' buf.WriteString("enum") if o := es.IdentifierOpt; o != nil { buf.WriteString(" " + string(xc.Dict.S(o.Token.Val))) } buf.WriteString(" { ... }") case 1: // "enum" IDENTIFIER fmt.Fprintf(&buf, "enum %s", xc.Dict.S(es.Token2.Val)) default: panic(es.Case) } default: panic(ts.Case) } case Function: panic("TODO Function") case Struct, Union: switch ts := sp.firstTypeSpecifier(); ts.Case { case 11: // StructOrUnionSpecifier sus := ts.StructOrUnionSpecifier buf.WriteString(sus.StructOrUnion.str()) switch sus.Case { case 0: // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' if o := sus.IdentifierOpt; o != nil { buf.WriteString(" ") buf.Write(o.Token.S()) break } buf.WriteString("{") outerFirst := true for l := sus.StructDeclarationList; l != nil; l = l.StructDeclarationList { if !outerFirst { buf.WriteString("; ") } outerFirst = false first := true for l := l.StructDeclaration.StructDeclaratorList; l != nil; l = l.StructDeclaratorList { if !first { buf.WriteString(", ") } first = false switch sd := l.StructDeclarator; sd.Case { case 0: // Declarator buf.WriteString(sd.Declarator.Type.String()) case 1: // DeclaratorOpt ':' ConstantExpression if o := sd.DeclaratorOpt; o != nil { buf.WriteString(o.Declarator.Type.String()) } buf.WriteByte(':') fmt.Fprintf(&buf, "%v", sd.ConstantExpression.Value) default: fmt.Fprintf(&buf, "specifierString_TODO%v", sd.Case) } } } buf.WriteString(";}") case 1: // StructOrUnion IDENTIFIER buf.WriteString(" ") buf.Write(sus.Token.S()) case 2: // StructOrUnion IdentifierOpt '{' '}' // Case 2 if o := sus.IdentifierOpt; o != nil { buf.WriteString(" ") buf.Write(o.Token.S()) } buf.WriteString("{}") default: panic(sus.Case) } default: panic(ts.Case) } default: buf.WriteString(k.CString()) } return buf.String() } func align(off, algn int) int { r := off % algn if r != 0 { off += algn - r } return off } func finishBitField(n Node, lx *lexer) { sc := lx.scope maxLLBits := lx.model.LongLongType.SizeOf() * 8 bits := sc.bitOffset if bits > maxLLBits || bits == 0 { panic(fmt.Errorf("%s: internal error %v", position(n.Pos()), bits)) //TODO split group. } var bytes, al int for _, k := range []Kind{Char, Short, Int, Long, LongLong} { bytes = lx.model.Items[k].Size al = lx.model.Items[k].StructAlign if bytes*8 >= bits { var t Type switch k { case Char: t = lx.model.CharType case Short: t = lx.model.ShortType case Int: t = lx.model.IntType case Long: t = lx.model.LongType case LongLong: t = lx.model.LongLongType default: panic("internal error") } sc.bitFieldTypes = append(sc.bitFieldTypes, t) break } } switch { case sc.isUnion: off := 0 sc.offset = align(sc.offset, al) if pd := sc.prevStructDeclarator; pd != nil { pd.padding = sc.offset - off pd.offsetOf = sc.offset } sc.bitOffset = 0 sc.bitFieldGroup++ default: off := sc.offset sc.offset = align(sc.offset, al) if pd := sc.prevStructDeclarator; pd != nil { pd.padding = sc.offset - off pd.offsetOf = sc.offset } sc.offset += bytes sc.bitOffset = 0 sc.bitFieldGroup++ } sc.maxAlign = mathutil.Max(sc.maxAlign, al) } // IsArithmeticType reports wheter t.Kind() is one of UintPtr, Char, SChar, // UChar, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Float, // Double, LongDouble, FloatComplex, DoubleComplex, LongDoubleComplex, Bool or // Enum. func IsArithmeticType(t Type) bool { switch t.Kind() { case UintPtr, Char, SChar, UChar, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Float, Double, LongDouble, FloatComplex, DoubleComplex, LongDoubleComplex, Bool, Enum: return true default: return false } } // IsIntType reports t.Kind() is one of Char, SChar, UChar, Short, UShort, Int, // UInt, Long, ULong, LongLong, ULongLong, Bool or Enum. func IsIntType(t Type) bool { switch t.Kind() { case Char, SChar, UChar, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, // [0], 6.2.5/6: The type _Bool and the unsigned integer types // that correspond to the standard signed integer types are the // standard unsigned integer types. Bool, Enum: return true default: return false } } func elements(v interface{}, t Type) (int, error) { if !IsIntType(t) { return -1, fmt.Errorf("expression shall have integer type") } if v == nil { return -1, nil } r, err := toInt(v) if err != nil { return -1, err } if r < 0 { return -1, fmt.Errorf("array size must be positive: %v", v) } return r, nil } func toInt(v interface{}) (int, error) { switch x := v.(type) { case int8: return int(x), nil case byte: return int(x), nil case int16: return int(x), nil case uint16: return int(x), nil case int32: return int(x), nil case uint32: return int(x), nil case int64: if x < mathutil.MinInt || x > mathutil.MaxInt { return 0, fmt.Errorf("value out of bounds: %v", x) } return int(x), nil case uint64: if x > mathutil.MaxInt { return 0, fmt.Errorf("value out of bounds: %v", x) } return int(x), nil case int: return x, nil default: return -1, fmt.Errorf("not a constant integer expression: %v", x) } } func dedupAbsPaths(a []string) (r []string, _ error) { m := map[string]struct{}{} for _, v := range a { av, err := filepath.Abs(v) if err != nil { return nil, err } if _, ok := m[av]; ok { continue } r = append(r, v) m[v] = struct{}{} } return r, nil } func isCompatibleParameters(a, b []Parameter, va, vb bool) bool { if len(a) != len(b) || va != vb { return false } for i, v := range a { if !v.Type.CanAssignTo(b[i].Type) { return false } } return true } // [0], 6.2.7-3 // // A composite type can be constructed from two types that are compatible; it // is a type that is compatible with both of the two types and satisfies the // following conditions: // // — If one type is an array of known constant size, the composite type is an // array of that size; otherwise, if one type is a variable length array, the // composite type is that type. // // — If only one type is a function type with a parameter type list (a function // prototype), the composite type is a function prototype with the parameter // type list. // // — If both types are function types with parameter type lists, the type of // each parameter in the composite parameter type list is the composite type of // the corresponding parameters. // // These rules apply recursively to the types from which the two types are // derived. func compositeType(a, b Type) (c Type, isA bool) { t, u := a, b for t.Kind() == Ptr && u.Kind() == Ptr { t = t.Element() u = u.Element() } if t.Kind() == Function && u.Kind() == Function { if !t.Result().CanAssignTo(u.Result()) { return nil, false } p, va := t.Parameters() q, vb := u.Parameters() if va != vb { return nil, false } if len(p) == 0 && len(q) != 0 { return b, false } if len(p) != 0 && len(q) == 0 { return a, true } if len(p) != len(q) { return nil, false } for i, v := range p { w := q[i] if v.Type != undefined && w.Type == undefined || v.Type.CanAssignTo(w.Type) { continue } return nil, false } return a, true } return nil, false } func eqTypes(a, b Type) bool { return a.(*ctype).eq(b.(*ctype)) } func isStrLitID(v interface{}) bool { switch v.(type) { case StringLitID, LongStringLitID: return true } return false } func nElem(t Type) int { p := -1 for { n := t.Elements() if n < 0 { return p } if p < 0 { p = 1 } p *= n t = t.Element() } } func unsigned(k Kind) Kind { switch k { case Char, SChar: return UChar case Short: return UShort case Int: return UInt case Long: return ULong case LongLong: return ULongLong default: return k } } func isEnum(tn ...*TypeName) bool { for _, tn := range tn { t := tn.Type if t.Kind() == Enum { return true } ts := tn.SpecifierQualifierList.TypeSpecifier if ts == nil { continue } switch ts.Case { case 15: // "typeof" '(' TypeName ')' // Case 15 nm := ts.TypeName.SpecifierQualifierList.TypedefName() if nm == 0 { break } n := ts.TypeName.scope.Lookup(NSIdentifiers, nm) switch x := n.Node.(type) { case *DirectDeclarator: if x.specifier.kind() == Enum { return true } } } } return false } func memberOffsetRecursive(t Type, name int) (offset int, ty *Type, err error) { members, incomplete := t.Members() if incomplete { return 0, nil, fmt.Errorf("memberOffsetRecursive: incomplete") } matches := 0 for _, member := range members { if member.Name == name { matches++ offset = member.OffsetOf ty = &member.Type } if member.Name == 0 { moffset, mty, err := memberOffsetRecursive(member.Type, name) if err == nil { matches++ offset += member.OffsetOf + moffset ty = mty } } } if matches > 1 { return 0, nil, fmt.Errorf("memberOffsetRecursive: ambigous member %s", string(dict.S(name))) } if matches == 0 { return 0, nil, fmt.Errorf("memberOffsetRecursive: non-existent member %s", string(dict.S(name))) } return offset, ty, err } func comment(tw *tweaks, p ...Node) int { for _, v := range p { v := v.Pos() if n := tw.comments[v]; n != 0 { return n } v -= token.Pos(xc.FileSet.Position(v).Column - 1) if n := tw.comments[v]; n != 0 { return n } } return 0 } func fixParams(in []Parameter) { for i, v := range in { if t := v.Type; t.Kind() == Function { in[i].Type = t.Pointer() } } } func clean(paths []string) (r []string) { for _, v := range paths { a, err := filepath.Abs(v) if err != nil { a = v } r = append(r, a) } return r } ================================================ FILE: generate.go ================================================ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore package main import ( "bytes" "flag" "io/ioutil" "log" "os" "os/exec" "path/filepath" ) func yy() (nm string, err error) { y, err := os.Create("parser.y") if err != nil { return "", err } y.Close() nm = y.Name() cmd := exec.Command( "yy", "-astImport", "\"go/token\"\n\n\"github.com/cznic/xc\"", "-kind", "Case", "-o", nm, "-prettyString", "PrettyString", "parser.yy", ) if out, err := cmd.CombinedOutput(); err != nil { os.Remove(nm) log.Printf("%s", out) return "", err } return nm, nil } func goyacc(y string) (err error) { t, err := ioutil.TempFile("", "go-generate-xegen-") if err != nil { log.Fatal(err) } defer func() { t.Close() if e := os.Remove(t.Name()); e != nil && err == nil { err = e } }() cmd := exec.Command("goyacc", "-o", os.DevNull, "-xegen", t.Name(), "-ex", y) if out, err := cmd.CombinedOutput(); err != nil { log.Printf("%s\n", out) return err } xerrors, err := ioutil.ReadFile("xerrors") if err != nil { return err } if _, err := t.Seek(0, 2); err != nil { return err } if _, err := t.Write(xerrors); err != nil { return err } cmd = exec.Command("goyacc", "-cr", "-xe", t.Name(), "-o", "parser.go", "-dlvalf", "%v", "-dlval", "PrettyString(lval.Token)", y) if out, err := cmd.CombinedOutput(); err != nil { log.Printf("%s", out) return err } else { log.Printf("%s", out) } return nil } func main() { if err := main0(); err != nil { log.Fatal(err) } } func main0() (err error) { log.SetFlags(log.Lshortfile) p2 := flag.Bool("2", false, "") flag.Parse() if *p2 { return main2() } os.Remove("ast.go") os.Remove("ast_test.go") y, err := yy() if err != nil { return err } return goyacc(y) } func main2() (err error) { goCmd := exec.Command("go", "test", "-generating", "-run", "^Example") out, err := goCmd.CombinedOutput() // Errors are expected and wanted here. feCmd := exec.Command("fe") feCmd.Stdin = bytes.NewBuffer(out) if out, err = feCmd.CombinedOutput(); err != nil { log.Printf("%s", out) return err } matches, err := filepath.Glob("*_test.go") if err != nil { return err } cmd := exec.Command("pcregrep", append([]string{"-nM", `failed|panic|\/\/ |// false|// -1|Output:\n}`}, matches...)...) if out, _ = cmd.CombinedOutput(); len(out) != 0 { // Error != nil when no matches log.Printf("%s", out) } return nil } ================================================ FILE: global.go ================================================ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "reflect" "strconv" "strings" "github.com/cznic/golex/lex" "github.com/cznic/strutil" "github.com/cznic/xc" ) const ( commentNotClosed = "comment not closed" ) var ( debugIncludes bool debugMacros bool dict = xc.Dict fset = xc.FileSet isGenerating bool // go generate hook. isTesting bool // Test hook. printHooks = strutil.PrettyPrintHooks{} ) func init() { for k, v := range xc.PrintHooks { printHooks[k] = v } lcRT := reflect.TypeOf(lex.Char{}) lcH := func(f strutil.Formatter, v interface{}, prefix, suffix string) { c := v.(lex.Char) r := c.Rune s := yySymName(int(r)) if x := s[0]; x >= '0' && x <= '9' { s = strconv.QuoteRune(r) } f.Format("%s%v: %s"+suffix, prefix, fset.Position(c.Pos()), s) } printHooks[lcRT] = lcH printHooks[reflect.TypeOf(xc.Token{})] = func(f strutil.Formatter, v interface{}, prefix, suffix string) { t := v.(xc.Token) if (t == xc.Token{}) { return } lcH(f, t.Char, prefix, "") if s := t.S(); len(s) != 0 { f.Format(" %q", s) } f.Format(suffix) } printHooks[reflect.TypeOf(PPTokenList(0))] = func(f strutil.Formatter, v interface{}, prefix, suffix string) { x := v.(PPTokenList) if x == 0 { return } a := strings.Split(prefix+PrettyString(decodeTokens(x, nil, true))+",", "\n") for _, v := range a { f.Format("%s\n", v) } } printHooks[reflect.TypeOf((*ctype)(nil))] = func(f strutil.Formatter, v interface{}, prefix, suffix string) { f.Format(prefix) f.Format("%v", v.(Type).String()) f.Format(suffix) } printHooks[reflect.TypeOf(Kind(0))] = func(f strutil.Formatter, v interface{}, prefix, suffix string) { f.Format(prefix) f.Format("%v", v.(Kind)) f.Format(suffix) } printHooks[reflect.TypeOf(Linkage(0))] = func(f strutil.Formatter, v interface{}, prefix, suffix string) { f.Format(prefix) f.Format("%v", v.(Linkage)) f.Format(suffix) } } ================================================ FILE: kind_string.go ================================================ // Code generated by "stringer -type Kind"; DO NOT EDIT. package cc import "fmt" const _Kind_name = "UndefinedVoidPtrUintPtrCharSCharUCharShortUShortIntUIntLongULongLongLongULongLongFloatDoubleLongDoubleBoolFloatComplexDoubleComplexLongDoubleComplexStructUnionEnumTypedefNameFunctionArraytypeofkindMax" var _Kind_index = [...]uint8{0, 9, 13, 16, 23, 27, 32, 37, 42, 48, 51, 55, 59, 64, 72, 81, 86, 92, 102, 106, 118, 131, 148, 154, 159, 163, 174, 182, 187, 193, 200} func (i Kind) String() string { if i < 0 || i >= Kind(len(_Kind_index)-1) { return fmt.Sprintf("Kind(%d)", i) } return _Kind_name[_Kind_index[i]:_Kind_index[i+1]] } ================================================ FILE: lexer.go ================================================ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "bytes" "fmt" "go/token" "io" "strings" "github.com/cznic/golex/lex" "github.com/cznic/xc" ) // Lexer state const ( lsZero = iota lsBOL // Preprocessor: Beginning of line. lsDefine // Preprocessor: Seen ^#define. lsSeekRParen // Preprocessor: Seen ^#define identifier( lsTokens // Preprocessor: Convert anything to PPOTHER until EOL. lsUndef // Preprocessor: Seen ^#undef. lsConstExpr0 // Preprocessor: Parsing constant expression. lsConstExpr // Preprocessor: Parsing constant expression. lsTranslationUnit0 // lsTranslationUnit // ) type trigraphsReader struct { *lex.Lexer // pos0 token.Pos // sc int // Start condition. } func (t *trigraphsReader) ReadRune() (rune, int, error) { return lex.RuneEOF, 0, io.EOF } func (t *trigraphsReader) ReadChar() (c lex.Char, size int, err error) { r := rune(t.scan()) pos0 := t.pos0 pos := t.Lookahead().Pos() t.pos0 = pos c = lex.NewChar(t.First.Pos(), r) return c, int(pos - pos0), nil } type byteReader struct { io.Reader b [1]byte } func (b *byteReader) ReadRune() (r rune, size int, err error) { if _, err = b.Read(b.b[:]); err != nil { return -1, 0, err } return rune(b.b[0]), 1, nil } type lexer struct { *lex.Lexer // ch chan []xc.Token // commentPos0 token.Pos // constExprToks []xc.Token // constantExpression *ConstantExpression // cpp func([]xc.Token) // encBuf []byte // PPTokens encBuf1 [30]byte // Rune, position, optional value ID. encPos token.Pos // For delta pos encoding eof lex.Char // example interface{} // exampleRule int // externs map[int]*Declarator // file *token.File // finalNLInjected bool // fnDeclarator *Declarator // includePaths []string // injectFunc []xc.Token // [0], 6.4.2.2. iota int64 // isPreprocessing bool // last xc.Token // model *Model // preprocessingFile *PreprocessingFile // report *xc.Report // sc int // Start condition. scope *Bindings // scs int // Start condition stack. state int // Lexer state. sysIncludePaths []string // t *trigraphsReader // textLine []xc.Token // toC bool // Whether to translate preprocessor identifiers to reserved C words. tokLast xc.Token // tokPrev xc.Token // toks []xc.Token // Parsing preprocessor constant expression. translationUnit *TranslationUnit // tweaks *tweaks // fsm struct { comment int pos token.Pos state int } } func newLexer(nm string, sz int, r io.RuneReader, report *xc.Report, tweaks *tweaks, opts ...lex.Option) (*lexer, error) { file := fset.AddFile(nm, -1, sz) t := &trigraphsReader{} lx, err := lex.New( file, &byteReader{Reader: r.(io.Reader)}, lex.ErrorFunc(func(pos token.Pos, msg string) { report.Err(pos, msg) }), lex.RuneClass(func(r rune) int { return int(r) }), ) if err != nil { return nil, err } t.Lexer = lx t.pos0 = lx.Lookahead().Pos() if tweaks.enableTrigraphs { t.sc = scTRIGRAPHS } r = t scope := newBindings(nil, ScopeFile) lexer := &lexer{ externs: map[int]*Declarator{}, file: file, report: report, scope: scope, scs: -1, // Stack empty t: t, tweaks: tweaks, } if lexer.Lexer, err = lex.New( file, r, append(opts, lex.RuneClass(rune2class))..., ); err != nil { return nil, err } return lexer, nil } func newSimpleLexer(cpp func([]xc.Token), report *xc.Report, tweaks *tweaks) *lexer { return &lexer{ cpp: cpp, externs: map[int]*Declarator{}, report: report, scope: newBindings(nil, ScopeFile), tweaks: tweaks, } } func (l *lexer) push(sc int) { if l.scs >= 0 { // Stack overflow. if l.sc != scDIRECTIVE || sc != scCOMMENT { panic("internal error") } // /*-style comment in a line starting with # l.pop() } l.scs = l.sc l.sc = sc } func (l *lexer) pop() { if l.scs < 0 { // Stack underflow panic("internal error") } l.sc = l.scs l.scs = -1 // Stack empty. } func (l *lexer) pushScope(kind Scope) (old *Bindings) { old = l.scope l.scope = newBindings(old, kind) l.scope.maxAlign = 1 return old } func (l *lexer) popScope(tok xc.Token) (old, new *Bindings) { return l.popScopePos(tok.Pos()) } func (l *lexer) popScopePos(pos token.Pos) (old, new *Bindings) { old = l.scope new = l.scope.Parent if new == nil { l.report.Err(pos, "cannot pop scope") return nil, old } l.scope = new return old, new } const ( fsmZero = iota fsmHasComment ) var genCommentLeader = []byte("/*") func (l *lexer) comment(general bool) { if l.tweaks.comments != nil { b := l.TokenBytes(nil) pos := l.First.Pos() if general { pos = l.commentPos0 b = append(genCommentLeader, b...) } if l.Lookahead().Rune == '\n' { b = append(b, '\n') } switch fsm := &l.fsm; fsm.state { case fsmHasComment: if pos == fsm.pos+token.Pos(len(dict.S(l.fsm.comment))) { fsm.comment = dict.ID(append(dict.S(fsm.comment), b...)) break } fallthrough case fsmZero: fsm.state = fsmHasComment fsm.comment = dict.ID(b) fsm.pos = pos } } } func (l *lexer) scanChar() (c lex.Char) { again: r := rune(l.scan()) switch r { case ' ': if l.state != lsTokens || l.tokLast.Rune == ' ' { goto again } case '\n': if l.state == lsTokens { l.encodeToken(xc.Token{Char: lex.NewChar(l.First.Pos(), ' '), Val: idSpace}) } l.state = lsBOL l.sc = scINITIAL l.scs = -1 // Stack empty case PREPROCESSING_FILE: l.state = lsBOL l.isPreprocessing = true case CONSTANT_EXPRESSION, TRANSLATION_UNIT: //TODO- CONSTANT_EXPRESSION, then must add some manual yy:examples. l.toC = true } fp := l.First.Pos() if l.fsm.state == fsmHasComment { switch { case r == '\n' && fp == l.fsm.pos+token.Pos(len(dict.S(l.fsm.comment)))-1: // keep going case r != '\n' && fp == l.fsm.pos+token.Pos(len(dict.S(l.fsm.comment))): l.tweaks.comments[fp] = dict.ID(bytes.TrimSpace(dict.S(l.fsm.comment))) l.fsm.state = fsmZero default: l.fsm.state = fsmZero } } return lex.NewChar(l.First.Pos(), r) } func (l *lexer) scanToken() (tok xc.Token) { switch l.state { case lsConstExpr0: tok = xc.Token{Char: lex.NewChar(0, CONSTANT_EXPRESSION)} l.state = lsConstExpr case lsConstExpr: if len(l.toks) == 0 { tok = xc.Token{Char: lex.NewChar(l.tokLast.Pos(), lex.RuneEOF)} break } tok = l.toks[0] l.toks = l.toks[1:] case lsTranslationUnit0: tok = xc.Token{Char: lex.NewChar(0, TRANSLATION_UNIT)} l.state = lsTranslationUnit l.toC = true case lsTranslationUnit: again: for len(l.textLine) == 0 { var ok bool if l.textLine, ok = <-l.ch; !ok { return xc.Token{Char: lex.NewChar(l.tokLast.Pos(), lex.RuneEOF)} } if l.cpp != nil { l.cpp(l.textLine) } } tok = l.textLine[0] l.textLine = l.textLine[1:] if tok.Rune == ' ' { goto again } tok = l.scope.lexerHack(tok, l.tokLast) default: c := l.scanChar() if c.Rune == ccEOF { c = lex.NewChar(c.Pos(), lex.RuneEOF) if l.isPreprocessing && l.last.Rune != '\n' && !l.finalNLInjected { l.finalNLInjected = true l.eof = c c.Rune = '\n' l.state = lsBOL return xc.Token{Char: c} } return xc.Token{Char: c} } val := 0 if tokHasVal[c.Rune] { b := l.TokenBytes(nil) val = dict.ID(b) //TODO handle ID UCNs //TODO- chars := l.Token() //TODO- switch c.Rune { //TODO- case IDENTIFIER, IDENTIFIER_LPAREN: //TODO- b := l.TokenBytes(func(buf *bytes.Buffer) { //TODO- for i := 0; i < len(chars); { //TODO- switch c := chars[i]; { //TODO- case c.Rune == '$' && !l.tweaks.enableDlrInIdentifiers: //TODO- l.report.Err(c.Pos(), "identifier character set extension '$' not enabled") //TODO- i++ //TODO- case c.Rune == '\\': //TODO- r, n := decodeUCN(chars[i:]) //TODO- buf.WriteRune(r) //TODO- i += n //TODO- case c.Rune < 0x80: // ASCII //TODO- buf.WriteByte(byte(c.Rune)) //TODO- i++ //TODO- default: //TODO- panic("internal error") //TODO- } //TODO- } //TODO- }) //TODO- val = dict.ID(b) //TODO- default: //TODO- panic("internal error: " + yySymName(int(c.Rune))) //TODO- } } tok = xc.Token{Char: c, Val: val} if !l.isPreprocessing { tok = l.scope.lexerHack(tok, l.tokLast) } } if l.toC { tok = toC(tok, l.tweaks) } l.tokPrev = l.tokLast l.tokLast = tok return tok } // Lex implements yyLexer func (l *lexer) Lex(lval *yySymType) int { var tok xc.Token if x := l.injectFunc; l.exampleRule == 0 && len(x) != 0 { tok = x[0] l.injectFunc = x[1:] } else { tok = l.scanToken() } //dbg("Lex %s", PrettyString(tok)) if l.constExprToks != nil { l.constExprToks = append(l.constExprToks, tok) } l.last = tok if tok.Rune == lex.RuneEOF { lval.Token = tok return 0 } switch l.state { case lsBOL: switch tok.Rune { case PREPROCESSING_FILE, '\n': // nop case '#': l.push(scDIRECTIVE) tok = l.scanToken() switch tok.Rune { case '\n': tok.Char = lex.NewChar(tok.Pos(), PPHASH_NL) case PPDEFINE: l.push(scDEFINE) l.state = lsDefine case PPELIF, PPENDIF, PPERROR, PPIF, PPLINE, PPPRAGMA: l.sc = scINITIAL l.state = lsTokens case PPELSE, PPIFDEF, PPIFNDEF: l.state = lsZero case PPUNDEF: l.state = lsUndef case PPINCLUDE: l.sc = scHEADER l.state = lsTokens case PPINCLUDE_NEXT: if l.tweaks.enableIncludeNext { l.sc = scHEADER l.state = lsTokens break } l.state = lsTokens tok.Char = lex.NewChar(tok.Pos(), PPNONDIRECTIVE) tok.Val = xc.Dict.SID("include_next") default: l.state = lsTokens tok.Char = lex.NewChar(tok.Pos(), PPNONDIRECTIVE) l.pop() } default: l.encodeToken(tok) tok.Char = lex.NewChar(tok.Pos(), PPOTHER) l.state = lsTokens } case lsDefine: l.pop() switch tok.Rune { case IDENTIFIER: l.state = lsTokens case IDENTIFIER_LPAREN: l.state = lsSeekRParen default: l.state = lsZero } case lsSeekRParen: if tok.Rune == ')' { l.state = lsTokens } case lsTokens: l.encodeToken(tok) tok.Char = lex.NewChar(tok.Pos(), PPOTHER) case lsUndef: l.state = lsTokens } lval.Token = tok return int(tok.Char.Rune) } // Error Implements yyLexer. func (l *lexer) Error(msg string) { msg = strings.Replace(msg, "$end", "EOF", -1) t := l.last parts := strings.Split(msg, ", expected ") if len(parts) == 2 && strings.HasPrefix(parts[0], "unexpected ") && tokHasVal[t.Rune] { msg = fmt.Sprintf("%s %s, expected %s", parts[0], t.S(), parts[1]) } l.report.ErrTok(t, "%s", msg) } // Reduced implements yyLexerEx func (l *lexer) Reduced(rule, state int, lval *yySymType) (stop bool) { if n := l.exampleRule; n >= 0 && rule != n { return false } switch x := lval.node.(type) { case interface { fragment() interface{} }: l.example = x.fragment() default: l.example = x } return true } func (l *lexer) parsePPConstExpr0(list PPTokenList, p *pp) (interface{}, Type) { l.toks = l.toks[:0] p.expand(&tokenBuf{decodeTokens(list, nil, true)}, true, func(toks []xc.Token) { l.toks = append(l.toks, toks...) }) w := 0 for _, tok := range l.toks { switch tok.Rune { case ' ': // nop case IDENTIFIER: if p.macros.m[tok.Val] != nil { l.report.ErrTok(tok, "expected constant expression") return nil, nil } tok.Rune = INTCONST tok.Val = id0 fallthrough default: l.toks[w] = tok w++ } } l.toks = l.toks[:w] l.state = lsConstExpr0 if yyParse(l) == 0 { e := l.constantExpression return e.Value, e.Type } return nil, nil } func (l *lexer) parsePPConstExpr(list PPTokenList, p *pp) bool { if v, _ := l.parsePPConstExpr0(list, p); v != nil { return isNonZero(v) } return false } ================================================ FILE: linkage_string.go ================================================ // Code generated by "stringer -type Linkage"; DO NOT EDIT. package cc import "fmt" const _Linkage_name = "NoneInternalExternal" var _Linkage_index = [...]uint8{0, 4, 12, 20} func (i Linkage) String() string { if i < 0 || i >= Linkage(len(_Linkage_index)-1) { return fmt.Sprintf("Linkage(%d)", i) } return _Linkage_name[_Linkage_index[i]:_Linkage_index[i+1]] } ================================================ FILE: model.go ================================================ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "bytes" "fmt" "math" "math/big" "sort" "strconv" "strings" "github.com/cznic/mathutil" "github.com/cznic/xc" ) type ( // StringLitID is the type of an Expression.Value representing the numeric // ID of a string literal. StringLitID int // LongStringLitID is the type of an Expression.Value representing the // numeric ID of a long string literal. LongStringLitID int // StringLitID is the type of an Expression.Value representing the numeric // ID of a label name used in &&label. ComputedGotoID int ) var ( maxConvF32I32 = math.Nextafter32(math.MaxInt32, 0) // https://github.com/golang/go/issues/19405 maxConvF32U32 = math.Nextafter32(math.MaxUint32, 0) ) // ModelItem is a single item of a model. // // Note about StructAlign: To provide GCC ABI compatibility set, for example, // Align of Double to 8 and StructAlign of Double to 4. type ModelItem struct { Size int // Size of the entity in bytes. Align int // Alignment of the entity when it's not a struct field. StructAlign int // Alignment of the entity when it's a struct field. More interface{} // Optional user data. } // Model describes size and align requirements of predeclared types. type Model struct { Items map[Kind]ModelItem BoolType Type CharType Type DoubleComplexType Type DoubleType Type FloatComplexType Type FloatType Type IntType Type LongDoubleComplexType Type LongDoubleType Type LongLongType Type LongType Type ShortType Type UCharType Type UIntType Type ULongLongType Type ULongType Type UShortType Type UintPtrType Type VoidType Type longStrType Type ptrDiffType Type sizeType Type strType Type initialized bool tweaks *tweaks intConvRank [kindMax]int Signed [kindMax]bool // Signed[Kind] reports whether Kind is a signed integer type. promoteTo [kindMax]Kind } func (m *Model) initialize(lx *lexer) { m.BoolType = m.makeType(lx, 0, tsBool) m.CharType = m.makeType(lx, 0, tsChar) m.DoubleComplexType = m.makeType(lx, 0, tsComplex, tsDouble) m.DoubleType = m.makeType(lx, 0, tsDouble) m.FloatComplexType = m.makeType(lx, 0, tsComplex, tsFloat) m.FloatType = m.makeType(lx, 0, tsFloat) m.IntType = m.makeType(lx, 0, tsInt) m.LongDoubleComplexType = m.makeType(lx, 0, tsComplex, tsDouble, tsLong) m.LongDoubleType = m.makeType(lx, 0, tsLong, tsDouble) m.LongLongType = m.makeType(lx, 0, tsLong, tsLong) m.LongType = m.makeType(lx, 0, tsLong) m.ShortType = m.makeType(lx, 0, tsShort) m.UCharType = m.makeType(lx, 0, tsUnsigned, tsChar) m.UIntType = m.makeType(lx, 0, tsUnsigned) m.ULongLongType = m.makeType(lx, 0, tsUnsigned, tsLong, tsLong) m.ULongType = m.makeType(lx, 0, tsUnsigned, tsLong) m.UShortType = m.makeType(lx, 0, tsUnsigned, tsShort) m.UintPtrType = m.makeType(lx, 0, tsUintptr) // Pseudo type. m.VoidType = m.makeType(lx, 0, tsVoid) m.strType = m.makeType(lx, 0, tsChar).Pointer() // [0], 6.3.1.1. m.intConvRank = [kindMax]int{ Bool: 1, Char: 2, SChar: 2, UChar: 2, Short: 3, UShort: 3, Int: 4, UInt: 4, Long: 5, ULong: 5, LongLong: 6, ULongLong: 6, UintPtr: 7, } m.Signed = [kindMax]bool{ Char: true, SChar: true, Short: true, Int: true, Long: true, LongLong: true, } m.promoteTo = [kindMax]Kind{} for i := range m.promoteTo { m.promoteTo[i] = Kind(i) } switch { case m.tweaks.enableWideEnumValues: m.intConvRank[Enum] = m.intConvRank[LongLong] default: m.intConvRank[Enum] = m.intConvRank[Int] } for k := Kind(0); k < kindMax; k++ { r := m.intConvRank[k] if r == 0 || r > m.intConvRank[Int] { continue } // k is an integer type whose conversion rank is less than or // equal to the rank of int and unsigned int. switch { case m.Items[k].Size < m.Items[Int].Size || m.Signed[k]: // If an int can represent all values of the original // type, the value is converted to an int; m.promoteTo[k] = Int default: // otherwise, it is converted to an unsigned int. m.promoteTo[k] = UInt } } m.initialized = true } func (m *Model) typ(k Kind) Type { switch k { case Undefined: return undefined case Bool: return m.BoolType case Char: return m.CharType case Double: return m.DoubleType case Float: return m.FloatType case Int: return m.IntType case LongDouble: return m.LongDoubleType case LongLong: return m.LongLongType case Long: return m.LongType case Short: return m.ShortType case UChar: return m.UCharType case UInt: return m.UIntType case ULongLong: return m.ULongLongType case ULong: return m.ULongType case UShort: return m.UShortType case UintPtr: return m.UintPtrType case FloatComplex: return m.FloatComplexType case DoubleComplex: return m.DoubleComplexType case LongDoubleComplex: return m.LongDoubleComplexType default: panic(k) } } func (m *Model) enumValueToInt(v interface{}) (interface{}, bool) { intSize := m.Items[Int].Size if m.tweaks.enableWideEnumValues { intSize = m.Items[LongLong].Size } switch x := v.(type) { case byte, int8, int16, uint16, int32: return m.MustConvert(x, m.IntType), true case uint32: switch intSize { case 4: return m.MustConvert(x, m.IntType), x <= math.MaxUint32 case 8: return m.MustConvert(x, m.IntType), true default: panic(intSize) } case int64: switch intSize { case 4: return m.MustConvert(x, m.IntType), x <= math.MaxUint32 case 8: return m.MustConvert(x, m.IntType), true default: panic(intSize) } case uint64: switch intSize { case 4: return m.MustConvert(x, m.IntType), x <= math.MaxUint32 case 8: return m.MustConvert(x, m.IntType), x <= math.MaxUint64 default: panic(intSize) } default: panic(fmt.Errorf("%T", x)) } } // sanityCheck reports model errors, if any. func (m *Model) sanityCheck() error { if len(m.Items) == 0 { return fmt.Errorf("model has no items") } tab := map[Kind]struct { minSize, maxSize int minAlign, maxAlign int }{ Ptr: {4, 8, 4, 8}, UintPtr: {4, 8, 4, 8}, Void: {0, 0, 1, 1}, Char: {1, 1, 1, 1}, SChar: {1, 1, 1, 1}, UChar: {1, 1, 1, 1}, Short: {2, 2, 2, 2}, UShort: {2, 2, 2, 2}, Int: {4, 4, 4, 4}, UInt: {4, 4, 4, 4}, Long: {4, 8, 4, 8}, ULong: {4, 8, 4, 8}, LongLong: {8, 8, 8, 8}, ULongLong: {8, 8, 8, 8}, Float: {4, 4, 4, 4}, Double: {8, 8, 8, 8}, LongDouble: {8, 16, 8, 16}, Bool: {1, 1, 1, 1}, FloatComplex: {8, 8, 8, 8}, DoubleComplex: {16, 16, 8, 16}, LongDoubleComplex: {16, 32, 8, 16}, } a := []int{} required := map[Kind]bool{} seen := map[Kind]bool{} for k := range tab { required[k] = true a = append(a, int(k)) } sort.Ints(a) for k, v := range m.Items { if seen[k] { return fmt.Errorf("model has duplicate item: %s", k) } seen[k] = true if !required[k] { return fmt.Errorf("model has invalid type: %s: %#v", k, v) } for typ, t := range tab { if typ == k { if v.Size < t.minSize { return fmt.Errorf("size %d too small: %s", v.Size, k) } if v.Size > t.maxSize { return fmt.Errorf("size %d too big: %s", v.Size, k) } if v.Size != 0 && mathutil.PopCount(v.Size) != 1 { return fmt.Errorf("size %d is not a power of two: %s", v.Size, k) } if v.Align < t.minAlign { return fmt.Errorf("align %d too small: %s", v.Align, k) } if v.Align > t.maxAlign { return fmt.Errorf("align %d too big: %s", v.Align, k) } if v.Align < v.Size && v.Align < t.minAlign { return fmt.Errorf("align is smaller than size: %s", k) } if v.StructAlign < 1 { return fmt.Errorf("struct align %d too small: %s", v.StructAlign, k) } if v.StructAlign > t.maxAlign { return fmt.Errorf("struct align %d too big: %s", v.Align, k) } if mathutil.PopCount(v.Align) != 1 { return fmt.Errorf("align %d is not a power of two: %s", v.Align, k) } break } } } w := m.Items[Ptr].Size if m.Items[Short].Size < w && m.Items[Int].Size < w && m.Items[Long].Size < w && m.Items[LongLong].Size < w { return fmt.Errorf("model has no integer type suitable for pointer difference and sizeof") } for _, typ := range a { if !seen[Kind(typ)] { return fmt.Errorf("model has no item for type %s", Kind(typ)) } } if g, e := w, m.Items[UintPtr].Size; g != e { return fmt.Errorf("model uintptr has different sizes than ptr has") } return nil } // MustConvert returns v converted to the type of typ. If the conversion is // impossible, the method panics. // // Conversion an integer type to any pointer type yields an uintptr. func (m *Model) MustConvert(v interface{}, typ Type) interface{} { if typ.Kind() == Enum { typ = m.IntType } mi, ok := m.Items[typ.Kind()] if !ok && typ.Kind() != Function { panic(fmt.Errorf("internal error: no model item for %s, %s", typ, typ.Kind())) } w := mi.Size switch typ.Kind() { case Short: switch x := v.(type) { case int32: switch w { case 2: return int16(x) default: panic(w) } case int64: switch w { case 2: return int16(x) default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case UShort: switch x := v.(type) { case uint16: switch w { case 2: return x default: panic(w) } case int32: switch w { case 2: return uint16(x) default: panic(w) } case uint32: switch w { case 2: return uint16(x) default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case Int: switch x := v.(type) { case int8: switch w { case 4: return int32(x) default: panic(w) } case byte: switch w { case 4: return int32(x) default: panic(w) } case int16: switch w { case 4: return int32(x) default: panic(w) } case uint16: switch w { case 4: return int32(x) default: panic(w) } case int32: switch w { case 4: return x default: panic(w) } case uint32: switch w { case 4: return int32(x) default: panic(w) } case int64: switch w { case 4: return int32(x) default: panic(w) } case uint64: switch w { case 4: return int32(x) default: panic(w) } case float32: switch w { case 4: switch { case x > maxConvF32I32: return int32(math.MaxInt32) default: return int32(x) } default: panic(w) } case float64: switch w { case 4: return int32(x) default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case UInt: switch x := v.(type) { case uint8: switch w { case 4: return uint32(x) default: panic(w) } case int16: switch w { case 4: return uint32(x) default: panic(w) } case uint16: switch w { case 4: return uint32(x) default: panic(w) } case int32: switch w { case 4: return uint32(x) default: panic(w) } case uint32: switch w { case 4: return x default: panic(w) } case int64: switch w { case 4: return uint32(x) default: panic(w) } case uint64: switch w { case 4: return uint32(x) default: panic(w) } case uintptr: switch w { case 4: return uint32(x) default: panic(w) } case float32: switch w { case 4: switch { case x > maxConvF32U32: return uint32(math.MaxUint32) default: return uint32(x) } default: panic(w) } case float64: switch w { case 4: return uint32(x) default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case Long: switch x := v.(type) { case int16: switch w { case 4: return int32(x) case 8: return int64(x) default: panic(w) } case int32: switch w { case 4: return x case 8: return int64(x) default: panic(w) } case uint32: switch w { case 4: return int32(x) case 8: return int64(x) default: panic(w) } case int64: switch w { case 4: return int32(x) case 8: return x default: panic(w) } case uint64: switch w { case 4: return int32(x) case 8: return int64(x) default: panic(w) } case uintptr: switch w { case 4: return int32(x) case 8: return int64(x) default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case LongLong: switch x := v.(type) { case int32: switch w { case 8: return int64(x) default: panic(w) } case uint32: switch w { case 8: return int64(x) default: panic(w) } case int64: switch w { case 8: return x default: panic(w) } case uint64: switch w { case 8: return int64(x) default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case ULong: switch x := v.(type) { case uint8: switch w { case 4: return uint32(x) case 8: return uint64(x) default: panic(w) } case int: switch w { case 4: return uint32(x) case 8: return uint64(x) default: panic(w) } case int32: switch w { case 4: return uint32(x) case 8: return uint64(x) default: panic(w) } case int64: switch w { case 4: return uint32(x) case 8: return uint64(x) default: panic(w) } case uint32: switch w { case 4: return x case 8: return uint64(x) default: panic(w) } case uint64: switch w { case 4: return uint32(x) case 8: return x default: panic(w) } case uintptr: switch w { case 4: return uint32(x) case 8: return uint64(x) default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case ULongLong: switch x := v.(type) { case int32: switch w { case 8: return uint64(x) default: panic(w) } case int64: switch w { case 8: return uint64(x) default: panic(w) } case uint32: switch w { case 8: return uint64(x) default: panic(w) } case uint64: switch w { case 8: return x default: panic(w) } case uintptr: switch w { case 8: return uint64(x) default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case Float: switch x := v.(type) { case int32: switch w { case 4: return float32(x) case 8: return float64(x) default: panic(w) } case uint32: switch w { case 4: return float32(x) case 8: return float64(x) default: panic(w) } case int64: switch w { case 4: return float32(x) case 8: return float64(x) default: panic(w) } case uint64: switch w { case 4: return float32(x) case 8: return float64(x) default: panic(w) } case float32: switch w { case 4: return x case 8: return float64(x) default: panic(w) } case float64: switch w { case 4: return float32(x) case 8: return x default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case Double: switch x := v.(type) { case int32: switch w { case 8: return float64(x) default: panic(w) } case uint32: switch w { case 8: return float64(x) default: panic(w) } case int64: switch w { case 8: return float64(x) default: panic(w) } case uint64: switch w { case 8: return float64(x) default: panic(w) } case float32: switch w { case 8: return float64(x) default: panic(w) } case float64: switch w { case 8: return x default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case Ptr, Function: switch x := v.(type) { case int32: return uintptr(x) case uint32: return uintptr(x) case int64: return uintptr(x) case uint64: return uintptr(x) case uintptr: return x case StringLitID: return nil default: panic(fmt.Errorf("internal error %T", x)) } case Void: return nil case Char, SChar: switch x := v.(type) { case int32: switch w { case 1: return int8(x) default: panic(w) } case uint32: switch w { case 1: return int8(x) default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case UChar: switch x := v.(type) { case uint8: switch w { case 1: return x default: panic(w) } case int32: switch w { case 1: return byte(x) default: panic(w) } case uint32: switch w { case 1: return byte(x) default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case UintPtr: switch x := v.(type) { case int32: switch w { case 4, 8: return uintptr(x) default: panic(w) } case uint32: switch w { case 4: return uintptr(x) default: panic(w) } case uint64: switch w { case 8: return uintptr(x) default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case LongDouble: switch x := v.(type) { case int32: switch w { case 8, 16: return float64(x) default: panic(w) } case uint32: switch w { case 8, 16: return float64(x) default: panic(w) } case int64: switch w { case 8, 16: return float64(x) default: panic(w) } case uint64: switch w { case 8, 16: return float64(x) default: panic(w) } case float32: switch w { case 8, 16: return float64(x) default: panic(w) } case float64: switch w { case 8, 16: return x default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case Bool: switch x := v.(type) { case int32: if x != 0 { return int32(1) } return int32(0) default: panic(fmt.Errorf("internal error %T", x)) } case FloatComplex: switch x := v.(type) { case float32: switch w { case 8: return complex(x, 0) default: panic(w) } case float64: switch w { case 8: return complex(float32(x), 0) default: panic(w) } case complex64: switch w { case 8: return x default: panic(w) } case complex128: switch w { case 8: return complex64(x) default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case DoubleComplex: switch x := v.(type) { case int32: switch w { case 16: return complex(float64(x), 0) default: panic(w) } case float64: switch w { case 16: return complex(x, 0) default: panic(w) } case complex128: switch w { case 16: return x default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } case LongDoubleComplex: switch x := v.(type) { case float64: switch w { case 16: return complex(x, 0) default: panic(w) } case complex128: switch w { case 16: return x default: panic(w) } default: panic(fmt.Errorf("internal error %T", x)) } default: panic(fmt.Errorf("internal error %s, %s", typ, typ.Kind())) } } func (m *Model) value2(v interface{}, typ Type) (interface{}, Type) { return m.MustConvert(v, typ), typ } func (m *Model) charConst(lx *lexer, t xc.Token) (interface{}, Type) { switch t.Rune { case CHARCONST: s := string(t.S()) typ := m.IntType var r rune s = s[1 : len(s)-1] // Remove outer 's. if len(s) == 1 { return rune(s[0]), m.IntType } runes := []rune(s) switch runes[0] { case '\\': r, _ = decodeEscapeSequence(runes) if r < 0 { r = -r } default: r = runes[0] } return r, typ case LONGCHARCONST: s := t.S() typ := m.LongType var buf bytes.Buffer s = s[2 : len(s)-1] runes := []rune(string(s)) for i := 0; i < len(runes); { switch r := runes[i]; { case r == '\\': r, n := decodeEscapeSequence(runes[i:]) switch { case r < 0: buf.WriteByte(byte(-r)) default: buf.WriteRune(r) } i += n default: buf.WriteByte(byte(r)) i++ } } s = buf.Bytes() runes = []rune(string(s)) if len(runes) != 1 { lx.report.Err(t.Pos(), "invalid character literal %s", t.S()) return 0, typ } return runes[0], typ default: panic("internal error") } } func (m *Model) getSizeType(lx *lexer) Type { if t := m.sizeType; t != nil { return t } b := lx.scope.Lookup(NSIdentifiers, xc.Dict.SID("size_t")) if b.Node == nil { w := m.Items[Ptr].Size switch { case m.Items[Short].Size >= w: return m.ShortType case m.Items[Int].Size >= w: return m.IntType case m.Items[Long].Size >= w: return m.LongType default: return m.LongLongType } } d := b.Node.(*DirectDeclarator) if !d.TopDeclarator().RawSpecifier().IsTypedef() { lx.report.Err(d.Pos(), "size_t is not a typedef name") m.sizeType = undefined return undefined } m.sizeType = b.Node.(*DirectDeclarator).top().declarator.Type return m.sizeType } func (m *Model) getPtrDiffType(lx *lexer) Type { if t := m.ptrDiffType; t != nil { return t } b := lx.scope.Lookup(NSIdentifiers, xc.Dict.SID("ptrdiff_t")) if b.Node == nil { w := m.Items[Ptr].Size switch { case m.Items[Short].Size >= w: return m.ShortType case m.Items[Int].Size >= w: return m.IntType case m.Items[Long].Size >= w: return m.LongType default: return m.LongLongType } } d := b.Node.(*DirectDeclarator) if !d.TopDeclarator().RawSpecifier().IsTypedef() { lx.report.Err(d.Pos(), "ptrdiff_t is not a typedef name") m.ptrDiffType = undefined return undefined } m.ptrDiffType = b.Node.(*DirectDeclarator).top().declarator.Type return m.ptrDiffType } func (m *Model) getLongStrType(lx *lexer, tok xc.Token) Type { if t := m.longStrType; t != nil { return t } b := lx.scope.Lookup(NSIdentifiers, xc.Dict.SID("wchar_t")) if b.Node == nil { m.longStrType = m.IntType.Pointer() return m.longStrType } d := b.Node.(*DirectDeclarator) if !d.TopDeclarator().RawSpecifier().IsTypedef() { lx.report.Err(d.Pos(), "wchar_t is not a typedef name") m.longStrType = undefined return m.longStrType } m.longStrType = b.Node.(*DirectDeclarator).top().declarator.Type.Pointer() return m.longStrType } func (m *Model) strConst(lx *lexer, t xc.Token) (interface{}, Type) { s := t.S() typ := m.strType var buf bytes.Buffer switch t.Rune { case LONGSTRINGLITERAL: typ = m.getLongStrType(lx, t) s = s[1:] // Remove leading 'L'. fallthrough case STRINGLITERAL: s = s[1 : len(s)-1] // Remove outer "s. runes := []rune(string(s)) for i := 0; i < len(runes); { switch r := runes[i]; { case r == '\\': r, n := decodeEscapeSequence(runes[i:]) switch { case r < 0: buf.WriteByte(byte(-r)) default: buf.WriteRune(r) } i += n default: buf.WriteByte(byte(r)) i++ } } default: panic("internal error") } s = buf.Bytes() switch t.Rune { case LONGSTRINGLITERAL: return LongStringLitID(xc.Dict.ID(s)), typ case STRINGLITERAL: return StringLitID(xc.Dict.ID(s)), typ default: panic("internal error") } } func (m *Model) floatConst(lx *lexer, t xc.Token) (interface{}, Type) { const ( f = 1 << iota j l ) k := 0 s := t.S() i := len(s) - 1 more: switch c := s[i]; c { case 'i', 'j': k |= j i-- goto more case 'l', 'L': k |= l i-- goto more case 'f', 'F': k |= f i-- goto more } if k&j != 0 && !lx.tweaks.enableImaginarySuffix { lx.report.Err(t.Pos(), "imaginary suffixes not enabled") k &^= j } ss := string(s[:i+1]) var v float64 var err error switch { case strings.Contains(ss, "p"): var bf *big.Float bf, _, err = big.ParseFloat(ss, 0, 53, big.ToNearestEven) switch { case err != nil: lx.report.Err(t.Pos(), "invalid floating point constant %s", ss) v = 0 default: v, _ = bf.Float64() } default: v, err = strconv.ParseFloat(ss, 64) } if err != nil { lx.report.Err(t.Pos(), "invalid floating point constant %s", ss) v = 0 } switch k { case 0: return m.value2(v, m.DoubleType) case l: return m.value2(v, m.LongDoubleType) case j: return m.value2(complex(0, v), m.DoubleComplexType) case j | l: return m.value2(complex(0, v), m.LongDoubleComplexType) case f: return m.value2(v, m.FloatType) case f | j: return m.value2(complex(0, v), m.FloatComplexType) default: lx.report.Err(t.Pos(), "invalid literal %s", t.S()) return 0.0, m.DoubleType } } func (m *Model) intConst(lx *lexer, t xc.Token) (interface{}, Type) { const ( l = 1 << iota ll u ) k := 0 s := t.S() i := len(s) - 1 more: switch c := s[i]; c { case 'u', 'U': k |= u i-- goto more case 'l', 'L': if i > 0 && (s[i-1] == 'l' || s[i-1] == 'L') { k |= ll i -= 2 goto more } k |= l i-- goto more } n, err := strconv.ParseUint(string(s[:i+1]), 0, 64) if err != nil { lx.report.Err(t.Pos(), "invalid integer constant: %s", s) } switch k { case 0: switch b := mathutil.BitLenUint64(n); { case b < 32: return m.value2(n, m.IntType) case b < 33: return m.value2(n, m.UIntType) case b < 64: if m.Items[Long].Size == 8 { return m.value2(n, m.LongType) } return m.value2(n, m.LongLongType) default: if m.Items[ULong].Size == 8 { return m.value2(n, m.ULongType) } return m.value2(n, m.ULongLongType) } case l: return m.value2(n, m.LongType) case ll: return m.value2(n, m.LongLongType) case u: return m.value2(n, m.UIntType) case u | l: return m.value2(n, m.ULongType) case u | ll: return m.value2(n, m.ULongLongType) default: panic("internal error") } } func (m *Model) cBool(v bool) interface{} { if v { return m.MustConvert(int32(1), m.IntType) } return m.MustConvert(int32(0), m.IntType) } func (m *Model) binOp(lx *lexer, a, b operand) (interface{}, interface{}, Type) { av, at := a.eval(lx) bv, bt := b.eval(lx) t := at if IsArithmeticType(at) && IsArithmeticType(bt) { t = m.BinOpType(at, bt) } if av == nil || bv == nil || t.Kind() == Undefined { return nil, nil, t } return m.MustConvert(av, t), m.MustConvert(bv, t), t } // BinOpType returns the evaluation type of a binop b, ie. the type operands // are converted to before performing the operation. Operands must be // arithmetic types. // // See [0], 6.3.1.8 - Usual arithmetic conversions. func (m *Model) BinOpType(a, b Type) Type { ak := a.Kind() bk := b.Kind() if ak == LongDoubleComplex || bk == LongDoubleComplex { return m.LongDoubleComplexType } if ak == DoubleComplex || bk == DoubleComplex { return m.DoubleComplexType } if ak == FloatComplex || bk == FloatComplex { return m.FloatComplexType } // First, if the corresponding real type of either operand is long // double, the other operand is converted, without change of type // domain, to a type whose corresponding real type is long double. if ak == LongDouble || bk == LongDouble { return m.LongDoubleType } // Otherwise, if the corresponding real type of either operand is // double, the other operand is converted, without change of type // domain, to a type whose corresponding real type is double. if ak == Double || bk == Double { return m.DoubleType } // Otherwise, if the corresponding real type of either operand is float, the other // operand is converted, without change of type domain, to a type whose // corresponding real type is float. if ak == Float || bk == Float { return m.FloatType } // Otherwise, the integer promotions are performed on both operands. ak = m.promoteTo[ak] bk = m.promoteTo[bk] // Then the following rules are applied to the promoted operands: ar := m.intConvRank[ak] br := m.intConvRank[bk] // If both operands have the same type, then no further conversion is // needed. if ak == bk { return m.typ(ak) } // Otherwise, if both operands have signed integer types or both have // unsigned integer types, the operand with the type of lesser integer // conversion rank is converted to the type of the operand with greater // rank. if m.Signed[ak] == m.Signed[bk] { switch { case ar < br: return m.typ(bk) default: return m.typ(ak) } } // Make a the unsigned type and b the signed type. if m.Signed[ak] { a, b = b, a ak, bk = bk, ak ar, br = br, ar } // Otherwise, if the operand that has unsigned integer type has rank // greater or equal to the rank of the type of the other operand, then // the operand with signed integer type is converted to the type of the // operand with unsigned integer type. if ar >= br { return m.typ(ak) } // Otherwise, if the type of the operand with signed integer type can // represent all of the values of the type of the operand with unsigned // integer type, then the operand with unsigned integer type is // converted to the type of the operand with signed integer type. as := m.Items[ak].Size bs := m.Items[bk].Size if bs > as { return m.typ(bk) } // Otherwise, both operands are converted to the unsigned integer type // corresponding to the type of the operand with signed integer type. return m.typ(unsigned(bk)) } func (m *Model) promote(t Type) Type { if !IsIntType(t) { return t } return m.BinOpType(t, t) } func (m *Model) makeType(lx *lexer, attr int, ts ...int) Type { d := m.makeDeclarator(attr, ts...) return d.setFull(lx) } func (m *Model) makeDeclarator(attr int, ts ...int) *Declarator { s := &spec{attr, tsEncode(ts...)} d := &Declarator{specifier: s} dd := &DirectDeclarator{declarator: d, specifier: s} d.DirectDeclarator = dd return d } func (m *Model) checkArithmeticType(lx *lexer, a ...operand) (r bool) { r = true for _, v := range a { _, t := v.eval(lx) if !IsArithmeticType(t) { lx.report.Err(v.Pos(), "not an arithmetic type (have '%s')", t) r = false } } return r } func (m *Model) checkIntegerOrBoolType(lx *lexer, a ...operand) (r bool) { r = true for _, v := range a { _, t := v.eval(lx) if !IsIntType(t) && !(t.Kind() == Bool) { lx.report.Err(v.Pos(), "not an integer or bool type (have '%s')", t) r = false } } return r } ================================================ FILE: namespace_string.go ================================================ // Code generated by "stringer -type Namespace"; DO NOT EDIT. package cc import "fmt" const _Namespace_name = "NSIdentifiersNSTags" var _Namespace_index = [...]uint8{0, 13, 19} func (i Namespace) String() string { if i < 0 || i >= Namespace(len(_Namespace_index)-1) { return fmt.Sprintf("Namespace(%d)", i) } return _Namespace_name[_Namespace_index[i]:_Namespace_index[i+1]] } ================================================ FILE: parser.go ================================================ // Code generated by goyacc - DO NOT EDIT. // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on [0], 6.10. Substantial portions of expression AST size // optimizations are from [2], license of which follows. // ---------------------------------------------------------------------------- // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This grammar is derived from the C grammar in the 'ansitize' // program, which carried this notice: // // Copyright (c) 2006 Russ Cox, // Massachusetts Institute of Technology // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated // documentation files (the "Software"), to deal in the // Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, // sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, // subject to the following conditions: // // The above copyright notice and this permission notice shall // be included in all copies or substantial portions of the // Software. // // The software is provided "as is", without warranty of any // kind, express or implied, including but not limited to the // warranties of merchantability, fitness for a particular // purpose and noninfringement. In no event shall the authors // or copyright holders be liable for any claim, damages or // other liability, whether in an action of contract, tort or // otherwise, arising from, out of or in connection with the // software or the use or other dealings in the software. package cc import __yyfmt__ "fmt" import ( "fmt" "github.com/cznic/golex/lex" "github.com/cznic/xc" ) type yySymType struct { yys int Token xc.Token groupPart Node node Node toks PPTokenList } type yyXError struct { state, xsym int } const ( yyDefault = 57460 yyEofCode = 57344 ADDASSIGN = 57346 ALIGNOF = 57347 ANDAND = 57348 ANDASSIGN = 57349 ARROW = 57350 ASM = 57351 AUTO = 57352 BOOL = 57353 BREAK = 57354 CASE = 57355 CAST = 57356 CHAR = 57357 CHARCONST = 57358 COMPLEX = 57359 CONST = 57360 CONSTANT_EXPRESSION = 1048577 CONTINUE = 57361 DDD = 57362 DEC = 57363 DEFAULT = 57364 DIVASSIGN = 57365 DO = 57366 DOUBLE = 57367 ELSE = 57368 ENUM = 57369 EQ = 57370 EXTERN = 57371 FLOAT = 57372 FLOATCONST = 57373 FOR = 57374 GEQ = 57375 GOTO = 57376 IDENTIFIER = 57377 IDENTIFIER_LPAREN = 57378 IDENTIFIER_NONREPL = 57379 IF = 57380 INC = 57381 INLINE = 57382 INT = 57383 INTCONST = 57384 LEQ = 57385 LONG = 57386 LONGCHARCONST = 57387 LONGSTRINGLITERAL = 57388 LSH = 57389 LSHASSIGN = 57390 MODASSIGN = 57391 MULASSIGN = 57392 NEQ = 57393 NOELSE = 57394 NORETURN = 57395 NOSEMI = 57396 ORASSIGN = 57397 OROR = 57398 PPDEFINE = 57399 PPELIF = 57400 PPELSE = 57401 PPENDIF = 57402 PPERROR = 57403 PPHASH_NL = 57404 PPHEADER_NAME = 57405 PPIF = 57406 PPIFDEF = 57407 PPIFNDEF = 57408 PPINCLUDE = 57409 PPINCLUDE_NEXT = 57410 PPLINE = 57411 PPNONDIRECTIVE = 57412 PPNUMBER = 57413 PPOTHER = 57414 PPPASTE = 57415 PPPRAGMA = 57416 PPUNDEF = 57417 PREPROCESSING_FILE = 1048576 REGISTER = 57418 RESTRICT = 57419 RETURN = 57420 RSH = 57421 RSHASSIGN = 57422 SHORT = 57423 SIGNED = 57424 SIZEOF = 57425 STATIC = 57426 STATIC_ASSERT = 57427 STRINGLITERAL = 57428 STRUCT = 57429 SUBASSIGN = 57430 SWITCH = 57431 TRANSLATION_UNIT = 1048578 TYPEDEF = 57432 TYPEDEFNAME = 57433 TYPEOF = 57434 UNARY = 57435 UNION = 57436 UNSIGNED = 57437 VOID = 57438 VOLATILE = 57439 WHILE = 57440 XORASSIGN = 57441 yyErrCode = 57345 yyMaxDepth = 200 yyTabOfs = -328 ) var ( yyXLAT = map[int]int{ 40: 0, // '(' (333x) 42: 1, // '*' (294x) 57377: 2, // IDENTIFIER (241x) 38: 3, // '&' (226x) 43: 4, // '+' (226x) 45: 5, // '-' (226x) 57348: 6, // ANDAND (226x) 57363: 7, // DEC (226x) 57381: 8, // INC (226x) 59: 9, // ';' (220x) 41: 10, // ')' (203x) 44: 11, // ',' (191x) 57428: 12, // STRINGLITERAL (169x) 91: 13, // '[' (167x) 33: 14, // '!' (150x) 126: 15, // '~' (150x) 57347: 16, // ALIGNOF (150x) 57358: 17, // CHARCONST (150x) 57373: 18, // FLOATCONST (150x) 57384: 19, // INTCONST (150x) 57387: 20, // LONGCHARCONST (150x) 57388: 21, // LONGSTRINGLITERAL (150x) 57425: 22, // SIZEOF (150x) 57439: 23, // VOLATILE (141x) 57360: 24, // CONST (139x) 57419: 25, // RESTRICT (139x) 125: 26, // '}' (132x) 57353: 27, // BOOL (129x) 57357: 28, // CHAR (129x) 57359: 29, // COMPLEX (129x) 57367: 30, // DOUBLE (129x) 57369: 31, // ENUM (129x) 57372: 32, // FLOAT (129x) 57383: 33, // INT (129x) 57386: 34, // LONG (129x) 57423: 35, // SHORT (129x) 57424: 36, // SIGNED (129x) 57429: 37, // STRUCT (129x) 57433: 38, // TYPEDEFNAME (129x) 57434: 39, // TYPEOF (129x) 57436: 40, // UNION (129x) 57437: 41, // UNSIGNED (129x) 57438: 42, // VOID (129x) 58: 43, // ':' (126x) 57426: 44, // STATIC (120x) 57352: 45, // AUTO (114x) 57371: 46, // EXTERN (114x) 57382: 47, // INLINE (114x) 57395: 48, // NORETURN (114x) 57418: 49, // REGISTER (114x) 57432: 50, // TYPEDEF (114x) 57344: 51, // $end (106x) 61: 52, // '=' (96x) 123: 53, // '{' (93x) 57503: 54, // Expression (88x) 93: 55, // ']' (86x) 46: 56, // '.' (85x) 57351: 57, // ASM (84x) 57427: 58, // STATIC_ASSERT (79x) 37: 59, // '%' (77x) 47: 60, // '/' (77x) 60: 61, // '<' (77x) 62: 62, // '>' (77x) 63: 63, // '?' (77x) 94: 64, // '^' (77x) 124: 65, // '|' (77x) 57346: 66, // ADDASSIGN (77x) 57349: 67, // ANDASSIGN (77x) 57350: 68, // ARROW (77x) 57365: 69, // DIVASSIGN (77x) 57370: 70, // EQ (77x) 57375: 71, // GEQ (77x) 57385: 72, // LEQ (77x) 57389: 73, // LSH (77x) 57390: 74, // LSHASSIGN (77x) 57391: 75, // MODASSIGN (77x) 57392: 76, // MULASSIGN (77x) 57393: 77, // NEQ (77x) 57397: 78, // ORASSIGN (77x) 57398: 79, // OROR (77x) 57421: 80, // RSH (77x) 57422: 81, // RSHASSIGN (77x) 57430: 82, // SUBASSIGN (77x) 57441: 83, // XORASSIGN (77x) 10: 84, // '\n' (58x) 57376: 85, // GOTO (55x) 57440: 86, // WHILE (53x) 57354: 87, // BREAK (52x) 57355: 88, // CASE (52x) 57361: 89, // CONTINUE (52x) 57364: 90, // DEFAULT (52x) 57366: 91, // DO (52x) 57374: 92, // FOR (52x) 57380: 93, // IF (52x) 57414: 94, // PPOTHER (52x) 57420: 95, // RETURN (52x) 57431: 96, // SWITCH (52x) 57402: 97, // PPENDIF (44x) 57401: 98, // PPELSE (40x) 57400: 99, // PPELIF (39x) 57399: 100, // PPDEFINE (35x) 57403: 101, // PPERROR (35x) 57404: 102, // PPHASH_NL (35x) 57406: 103, // PPIF (35x) 57407: 104, // PPIFDEF (35x) 57408: 105, // PPIFNDEF (35x) 57409: 106, // PPINCLUDE (35x) 57410: 107, // PPINCLUDE_NEXT (35x) 57411: 108, // PPLINE (35x) 57412: 109, // PPNONDIRECTIVE (35x) 57416: 110, // PPPRAGMA (35x) 57417: 111, // PPUNDEF (35x) 57368: 112, // ELSE (32x) 57555: 113, // TypeQualifier (28x) 57504: 114, // ExpressionList (26x) 57528: 115, // PPTokenList (22x) 57530: 116, // PPTokens (22x) 57499: 117, // EnumSpecifier (20x) 57550: 118, // StructOrUnion (20x) 57551: 119, // StructOrUnionSpecifier (20x) 57558: 120, // TypeSpecifier (20x) 57505: 121, // ExpressionListOpt (18x) 57470: 122, // BasicAssemblerStatement (15x) 57476: 123, // CompoundStatement (15x) 57482: 124, // DeclarationSpecifiers (15x) 57511: 125, // FunctionSpecifier (15x) 57529: 126, // PPTokenListOpt (15x) 57545: 127, // StorageClassSpecifier (15x) 57468: 128, // AssemblerStatement (13x) 57507: 129, // ExpressionStatement (12x) 57525: 130, // IterationStatement (12x) 57526: 131, // JumpStatement (12x) 57527: 132, // LabeledStatement (12x) 57535: 133, // Pointer (12x) 57539: 134, // SelectionStatement (12x) 57543: 135, // Statement (12x) 57536: 136, // PointerOpt (11x) 57484: 137, // Declarator (9x) 57544: 138, // StaticAssertDeclaration (9x) 57478: 139, // ControlLine (8x) 57514: 140, // GroupPart (8x) 57518: 141, // IfGroup (8x) 57519: 142, // IfSection (8x) 57552: 143, // TextLine (8x) 57479: 144, // Declaration (7x) 57454: 145, // $@4 (6x) 57477: 146, // ConstantExpression (6x) 57362: 147, // DDD (6x) 57512: 148, // GroupList (6x) 57466: 149, // AssemblerOperand (5x) 57469: 150, // AssemblerSymbolicNameOpt (5x) 57513: 151, // GroupListOpt (5x) 57538: 152, // ReplacementList (5x) 57540: 153, // SpecifierQualifierList (5x) 57556: 154, // TypeQualifierList (5x) 57459: 155, // $@9 (4x) 57461: 156, // AbstractDeclarator (4x) 57467: 157, // AssemblerOperands (4x) 57483: 158, // DeclarationSpecifiersOpt (4x) 57488: 159, // Designator (4x) 57523: 160, // Initializer (4x) 57531: 161, // ParameterDeclaration (4x) 57554: 162, // TypeName (4x) 57557: 163, // TypeQualifierListOpt (4x) 57465: 164, // AssemblerInstructions (3x) 57475: 165, // CommaOpt (3x) 57486: 166, // Designation (3x) 57487: 167, // DesignationOpt (3x) 57489: 168, // DesignatorList (3x) 57506: 169, // ExpressionOpt (3x) 57515: 170, // IdentifierList (3x) 57520: 171, // InitDeclarator (3x) 57532: 172, // ParameterList (3x) 57533: 173, // ParameterTypeList (3x) 57443: 174, // $@10 (2x) 57447: 175, // $@14 (2x) 57449: 176, // $@16 (2x) 57450: 177, // $@17 (2x) 57451: 178, // $@18 (2x) 57455: 179, // $@5 (2x) 57462: 180, // AbstractDeclaratorOpt (2x) 57471: 181, // BlockItem (2x) 57474: 182, // Clobbers (2x) 57481: 183, // DeclarationListOpt (2x) 57485: 184, // DeclaratorOpt (2x) 57490: 185, // DirectAbstractDeclarator (2x) 57491: 186, // DirectAbstractDeclaratorOpt (2x) 57492: 187, // DirectDeclarator (2x) 57493: 188, // ElifGroup (2x) 57500: 189, // EnumerationConstant (2x) 57501: 190, // Enumerator (2x) 57508: 191, // ExternalDeclaration (2x) 57509: 192, // FunctionBody (2x) 57510: 193, // FunctionDefinition (2x) 57516: 194, // IdentifierListOpt (2x) 57517: 195, // IdentifierOpt (2x) 57521: 196, // InitDeclaratorList (2x) 57522: 197, // InitDeclaratorListOpt (2x) 57524: 198, // InitializerList (2x) 57534: 199, // ParameterTypeListOpt (2x) 57541: 200, // SpecifierQualifierListOpt (2x) 57546: 201, // StructDeclaration (2x) 57548: 202, // StructDeclarator (2x) 57559: 203, // VolatileOpt (2x) 57442: 204, // $@1 (1x) 57444: 205, // $@11 (1x) 57445: 206, // $@12 (1x) 57446: 207, // $@13 (1x) 57448: 208, // $@15 (1x) 57452: 209, // $@2 (1x) 57453: 210, // $@3 (1x) 57456: 211, // $@6 (1x) 57457: 212, // $@7 (1x) 57458: 213, // $@8 (1x) 57463: 214, // ArgumentExpressionList (1x) 57464: 215, // ArgumentExpressionListOpt (1x) 57472: 216, // BlockItemList (1x) 57473: 217, // BlockItemListOpt (1x) 1048577: 218, // CONSTANT_EXPRESSION (1x) 57480: 219, // DeclarationList (1x) 57494: 220, // ElifGroupList (1x) 57495: 221, // ElifGroupListOpt (1x) 57496: 222, // ElseGroup (1x) 57497: 223, // ElseGroupOpt (1x) 57498: 224, // EndifLine (1x) 57502: 225, // EnumeratorList (1x) 57378: 226, // IDENTIFIER_LPAREN (1x) 1048576: 227, // PREPROCESSING_FILE (1x) 57537: 228, // PreprocessingFile (1x) 57542: 229, // Start (1x) 57547: 230, // StructDeclarationList (1x) 57549: 231, // StructDeclaratorList (1x) 1048578: 232, // TRANSLATION_UNIT (1x) 57553: 233, // TranslationUnit (1x) 57460: 234, // $default (0x) 57356: 235, // CAST (0x) 57345: 236, // error (0x) 57379: 237, // IDENTIFIER_NONREPL (0x) 57394: 238, // NOELSE (0x) 57396: 239, // NOSEMI (0x) 57405: 240, // PPHEADER_NAME (0x) 57413: 241, // PPNUMBER (0x) 57415: 242, // PPPASTE (0x) 57435: 243, // UNARY (0x) } yySymNames = []string{ "'('", "'*'", "IDENTIFIER", "'&'", "'+'", "'-'", "ANDAND", "DEC", "INC", "';'", "')'", "','", "STRINGLITERAL", "'['", "'!'", "'~'", "ALIGNOF", "CHARCONST", "FLOATCONST", "INTCONST", "LONGCHARCONST", "LONGSTRINGLITERAL", "SIZEOF", "VOLATILE", "CONST", "RESTRICT", "'}'", "BOOL", "CHAR", "COMPLEX", "DOUBLE", "ENUM", "FLOAT", "INT", "LONG", "SHORT", "SIGNED", "STRUCT", "TYPEDEFNAME", "TYPEOF", "UNION", "UNSIGNED", "VOID", "':'", "STATIC", "AUTO", "EXTERN", "INLINE", "NORETURN", "REGISTER", "TYPEDEF", "$end", "'='", "'{'", "Expression", "']'", "'.'", "ASM", "STATIC_ASSERT", "'%'", "'/'", "'<'", "'>'", "'?'", "'^'", "'|'", "ADDASSIGN", "ANDASSIGN", "ARROW", "DIVASSIGN", "EQ", "GEQ", "LEQ", "LSH", "LSHASSIGN", "MODASSIGN", "MULASSIGN", "NEQ", "ORASSIGN", "OROR", "RSH", "RSHASSIGN", "SUBASSIGN", "XORASSIGN", "'\\n'", "GOTO", "WHILE", "BREAK", "CASE", "CONTINUE", "DEFAULT", "DO", "FOR", "IF", "PPOTHER", "RETURN", "SWITCH", "PPENDIF", "PPELSE", "PPELIF", "PPDEFINE", "PPERROR", "PPHASH_NL", "PPIF", "PPIFDEF", "PPIFNDEF", "PPINCLUDE", "PPINCLUDE_NEXT", "PPLINE", "PPNONDIRECTIVE", "PPPRAGMA", "PPUNDEF", "ELSE", "TypeQualifier", "ExpressionList", "PPTokenList", "PPTokens", "EnumSpecifier", "StructOrUnion", "StructOrUnionSpecifier", "TypeSpecifier", "ExpressionListOpt", "BasicAssemblerStatement", "CompoundStatement", "DeclarationSpecifiers", "FunctionSpecifier", "PPTokenListOpt", "StorageClassSpecifier", "AssemblerStatement", "ExpressionStatement", "IterationStatement", "JumpStatement", "LabeledStatement", "Pointer", "SelectionStatement", "Statement", "PointerOpt", "Declarator", "StaticAssertDeclaration", "ControlLine", "GroupPart", "IfGroup", "IfSection", "TextLine", "Declaration", "$@4", "ConstantExpression", "DDD", "GroupList", "AssemblerOperand", "AssemblerSymbolicNameOpt", "GroupListOpt", "ReplacementList", "SpecifierQualifierList", "TypeQualifierList", "$@9", "AbstractDeclarator", "AssemblerOperands", "DeclarationSpecifiersOpt", "Designator", "Initializer", "ParameterDeclaration", "TypeName", "TypeQualifierListOpt", "AssemblerInstructions", "CommaOpt", "Designation", "DesignationOpt", "DesignatorList", "ExpressionOpt", "IdentifierList", "InitDeclarator", "ParameterList", "ParameterTypeList", "$@10", "$@14", "$@16", "$@17", "$@18", "$@5", "AbstractDeclaratorOpt", "BlockItem", "Clobbers", "DeclarationListOpt", "DeclaratorOpt", "DirectAbstractDeclarator", "DirectAbstractDeclaratorOpt", "DirectDeclarator", "ElifGroup", "EnumerationConstant", "Enumerator", "ExternalDeclaration", "FunctionBody", "FunctionDefinition", "IdentifierListOpt", "IdentifierOpt", "InitDeclaratorList", "InitDeclaratorListOpt", "InitializerList", "ParameterTypeListOpt", "SpecifierQualifierListOpt", "StructDeclaration", "StructDeclarator", "VolatileOpt", "$@1", "$@11", "$@12", "$@13", "$@15", "$@2", "$@3", "$@6", "$@7", "$@8", "ArgumentExpressionList", "ArgumentExpressionListOpt", "BlockItemList", "BlockItemListOpt", "CONSTANT_EXPRESSION", "DeclarationList", "ElifGroupList", "ElifGroupListOpt", "ElseGroup", "ElseGroupOpt", "EndifLine", "EnumeratorList", "IDENTIFIER_LPAREN", "PREPROCESSING_FILE", "PreprocessingFile", "Start", "StructDeclarationList", "StructDeclaratorList", "TRANSLATION_UNIT", "TranslationUnit", "$default", "CAST", "error", "IDENTIFIER_NONREPL", "NOELSE", "NOSEMI", "PPHEADER_NAME", "PPNUMBER", "PPPASTE", "UNARY", } yyTokenLiteralStrings = map[int]string{ 57377: "identifier", 57348: "&&", 57363: "--", 57381: "++", 57428: "string literal", 57347: "_Alignof", 57358: "character constant", 57373: "floating-point constant", 57384: "integer constant", 57387: "long character constant", 57388: "long string constant", 57425: "sizeof", 57439: "volatile", 57360: "const", 57419: "restrict", 57353: "_Bool", 57357: "char", 57359: "_Complex", 57367: "double", 57369: "enum", 57372: "float", 57383: "int", 57386: "long", 57423: "short", 57424: "signed", 57429: "struct", 57433: "typedefname", 57434: "typeof", 57436: "union", 57437: "unsigned", 57438: "void", 57426: "static", 57352: "auto", 57371: "extern", 57382: "inline", 57395: "_Noreturn", 57418: "register", 57432: "typedef", 57351: "asm", 57427: "_Static_assert", 57346: "+=", 57349: "&=", 57350: "->", 57365: "/=", 57370: "==", 57375: ">=", 57385: "<=", 57389: "<<", 57390: "<<=", 57391: "%=", 57392: "*=", 57393: "!=", 57397: "|=", 57398: "||", 57421: ">>", 57422: ">>=", 57430: "-=", 57441: "^=", 57376: "goto", 57440: "while", 57354: "break", 57355: "case", 57361: "continue", 57364: "default", 57366: "do", 57374: "for", 57380: "if", 57414: "ppother", 57420: "return", 57431: "switch", 57402: "#endif", 57401: "#else", 57400: "#elif", 57399: "#define", 57403: "#error", 57404: "#", 57406: "#if", 57407: "#ifdef", 57408: "#ifndef", 57409: "#include", 57410: "#include_next", 57411: "#line", 57412: "#foo", 57416: "#pragma", 57417: "#undef", 57368: "else", 57362: "...", 1048577: "constant expression prefix", 57378: "identifier immediatelly followed by '('", 1048576: "preprocessing file prefix", 1048578: "translation unit prefix", 57379: "non replaceable identifier", 57405: "header name", 57413: "preprocessing number", 57415: "##", } yyReductions = map[int]struct{ xsym, components int }{ 0: {0, 1}, 1: {204, 0}, 2: {229, 3}, 3: {209, 0}, 4: {229, 3}, 5: {210, 0}, 6: {229, 3}, 7: {189, 1}, 8: {214, 1}, 9: {214, 3}, 10: {215, 0}, 11: {215, 1}, 12: {54, 1}, 13: {54, 1}, 14: {54, 1}, 15: {54, 1}, 16: {54, 1}, 17: {54, 1}, 18: {54, 1}, 19: {54, 3}, 20: {54, 4}, 21: {54, 4}, 22: {54, 3}, 23: {54, 3}, 24: {54, 2}, 25: {54, 2}, 26: {54, 7}, 27: {54, 2}, 28: {54, 2}, 29: {54, 2}, 30: {54, 2}, 31: {54, 2}, 32: {54, 2}, 33: {54, 2}, 34: {54, 2}, 35: {54, 2}, 36: {54, 4}, 37: {54, 4}, 38: {54, 3}, 39: {54, 3}, 40: {54, 3}, 41: {54, 3}, 42: {54, 3}, 43: {54, 3}, 44: {54, 3}, 45: {54, 3}, 46: {54, 3}, 47: {54, 3}, 48: {54, 3}, 49: {54, 3}, 50: {54, 3}, 51: {54, 3}, 52: {54, 3}, 53: {54, 3}, 54: {54, 3}, 55: {54, 3}, 56: {54, 5}, 57: {54, 3}, 58: {54, 3}, 59: {54, 3}, 60: {54, 3}, 61: {54, 3}, 62: {54, 3}, 63: {54, 3}, 64: {54, 3}, 65: {54, 3}, 66: {54, 3}, 67: {54, 3}, 68: {54, 4}, 69: {54, 3}, 70: {54, 2}, 71: {54, 4}, 72: {169, 0}, 73: {169, 1}, 74: {114, 1}, 75: {114, 3}, 76: {121, 0}, 77: {121, 1}, 78: {145, 0}, 79: {146, 2}, 80: {144, 3}, 81: {144, 1}, 82: {124, 2}, 83: {124, 2}, 84: {124, 2}, 85: {124, 2}, 86: {158, 0}, 87: {158, 1}, 88: {196, 1}, 89: {196, 3}, 90: {197, 0}, 91: {197, 1}, 92: {171, 1}, 93: {179, 0}, 94: {171, 4}, 95: {127, 1}, 96: {127, 1}, 97: {127, 1}, 98: {127, 1}, 99: {127, 1}, 100: {120, 1}, 101: {120, 1}, 102: {120, 1}, 103: {120, 1}, 104: {120, 1}, 105: {120, 1}, 106: {120, 1}, 107: {120, 1}, 108: {120, 1}, 109: {120, 1}, 110: {120, 1}, 111: {120, 1}, 112: {120, 1}, 113: {120, 1}, 114: {120, 4}, 115: {120, 4}, 116: {211, 0}, 117: {119, 6}, 118: {119, 2}, 119: {119, 4}, 120: {118, 1}, 121: {118, 1}, 122: {230, 1}, 123: {230, 2}, 124: {201, 3}, 125: {201, 2}, 126: {201, 1}, 127: {153, 2}, 128: {153, 2}, 129: {200, 0}, 130: {200, 1}, 131: {231, 1}, 132: {231, 3}, 133: {202, 1}, 134: {202, 3}, 135: {165, 0}, 136: {165, 1}, 137: {212, 0}, 138: {117, 7}, 139: {117, 2}, 140: {225, 1}, 141: {225, 3}, 142: {190, 1}, 143: {190, 3}, 144: {113, 1}, 145: {113, 1}, 146: {113, 1}, 147: {125, 1}, 148: {125, 1}, 149: {137, 2}, 150: {184, 0}, 151: {184, 1}, 152: {187, 1}, 153: {187, 3}, 154: {187, 5}, 155: {187, 6}, 156: {187, 6}, 157: {187, 5}, 158: {213, 0}, 159: {187, 5}, 160: {187, 4}, 161: {133, 2}, 162: {133, 3}, 163: {136, 0}, 164: {136, 1}, 165: {154, 1}, 166: {154, 2}, 167: {163, 0}, 168: {163, 1}, 169: {173, 1}, 170: {173, 3}, 171: {199, 0}, 172: {199, 1}, 173: {172, 1}, 174: {172, 3}, 175: {161, 2}, 176: {161, 2}, 177: {170, 1}, 178: {170, 3}, 179: {194, 0}, 180: {194, 1}, 181: {195, 0}, 182: {195, 1}, 183: {155, 0}, 184: {162, 3}, 185: {156, 1}, 186: {156, 2}, 187: {180, 0}, 188: {180, 1}, 189: {185, 3}, 190: {185, 4}, 191: {185, 5}, 192: {185, 6}, 193: {185, 6}, 194: {185, 4}, 195: {174, 0}, 196: {185, 4}, 197: {205, 0}, 198: {185, 5}, 199: {186, 0}, 200: {186, 1}, 201: {160, 1}, 202: {160, 4}, 203: {160, 3}, 204: {198, 2}, 205: {198, 4}, 206: {198, 0}, 207: {166, 2}, 208: {167, 0}, 209: {167, 1}, 210: {168, 1}, 211: {168, 2}, 212: {159, 3}, 213: {159, 2}, 214: {135, 1}, 215: {135, 1}, 216: {135, 1}, 217: {135, 1}, 218: {135, 1}, 219: {135, 1}, 220: {135, 1}, 221: {132, 3}, 222: {132, 4}, 223: {132, 3}, 224: {206, 0}, 225: {123, 4}, 226: {216, 1}, 227: {216, 2}, 228: {217, 0}, 229: {217, 1}, 230: {181, 1}, 231: {181, 1}, 232: {129, 2}, 233: {134, 5}, 234: {134, 7}, 235: {134, 5}, 236: {130, 5}, 237: {130, 7}, 238: {130, 9}, 239: {130, 8}, 240: {131, 3}, 241: {131, 2}, 242: {131, 2}, 243: {131, 3}, 244: {131, 3}, 245: {233, 1}, 246: {233, 2}, 247: {191, 1}, 248: {191, 1}, 249: {191, 2}, 250: {191, 1}, 251: {207, 0}, 252: {193, 5}, 253: {175, 0}, 254: {208, 0}, 255: {193, 5}, 256: {176, 0}, 257: {192, 2}, 258: {177, 0}, 259: {192, 3}, 260: {219, 1}, 261: {219, 2}, 262: {183, 0}, 263: {178, 0}, 264: {183, 2}, 265: {164, 1}, 266: {164, 2}, 267: {122, 5}, 268: {203, 0}, 269: {203, 1}, 270: {149, 5}, 271: {157, 1}, 272: {157, 3}, 273: {150, 0}, 274: {150, 3}, 275: {182, 1}, 276: {182, 3}, 277: {128, 1}, 278: {128, 7}, 279: {128, 9}, 280: {128, 11}, 281: {128, 13}, 282: {128, 6}, 283: {128, 8}, 284: {138, 7}, 285: {228, 1}, 286: {148, 1}, 287: {148, 2}, 288: {151, 0}, 289: {151, 1}, 290: {140, 1}, 291: {140, 1}, 292: {140, 3}, 293: {140, 1}, 294: {142, 4}, 295: {141, 4}, 296: {141, 4}, 297: {141, 4}, 298: {220, 1}, 299: {220, 2}, 300: {221, 0}, 301: {221, 1}, 302: {188, 4}, 303: {222, 3}, 304: {223, 0}, 305: {223, 1}, 306: {224, 1}, 307: {139, 3}, 308: {139, 5}, 309: {139, 7}, 310: {139, 5}, 311: {139, 2}, 312: {139, 1}, 313: {139, 3}, 314: {139, 3}, 315: {139, 2}, 316: {139, 3}, 317: {139, 6}, 318: {139, 2}, 319: {139, 4}, 320: {139, 3}, 321: {143, 1}, 322: {152, 1}, 323: {115, 1}, 324: {126, 1}, 325: {126, 2}, 326: {116, 1}, 327: {116, 2}, } yyXErrors = map[yyXError]string{ {0, 51}: "invalid empty input", {583, -1}: "expected #endif", {585, -1}: "expected #endif", {1, -1}: "expected $end", {503, -1}: "expected $end", {505, -1}: "expected $end", {32, -1}: "expected '('", {49, -1}: "expected '('", {75, -1}: "expected '('", {274, -1}: "expected '('", {275, -1}: "expected '('", {276, -1}: "expected '('", {278, -1}: "expected '('", {288, -1}: "expected '('", {311, -1}: "expected '('", {353, -1}: "expected '('", {435, -1}: "expected '('", {54, -1}: "expected ')'", {79, -1}: "expected ')'", {86, -1}: "expected ')'", {180, -1}: "expected ')'", {195, -1}: "expected ')'", {198, -1}: "expected ')'", {201, -1}: "expected ')'", {209, -1}: "expected ')'", {214, -1}: "expected ')'", {220, -1}: "expected ')'", {236, -1}: "expected ')'", {241, -1}: "expected ')'", {252, -1}: "expected ')'", {253, -1}: "expected ')'", {343, -1}: "expected ')'", {349, -1}: "expected ')'", {433, -1}: "expected ')'", {489, -1}: "expected ')'", {547, -1}: "expected ')'", {548, -1}: "expected ')'", {555, -1}: "expected ')'", {558, -1}: "expected ')'", {52, -1}: "expected ','", {267, -1}: "expected ':'", {293, -1}: "expected ':'", {377, -1}: "expected ':'", {479, -1}: "expected ':'", {45, -1}: "expected ';'", {55, -1}: "expected ';'", {273, -1}: "expected ';'", {280, -1}: "expected ';'", {281, -1}: "expected ';'", {330, -1}: "expected ';'", {339, -1}: "expected ';'", {341, -1}: "expected ';'", {347, -1}: "expected ';'", {356, -1}: "expected ';'", {380, -1}: "expected ';'", {448, -1}: "expected ';'", {387, -1}: "expected '='", {91, -1}: "expected '['", {527, -1}: "expected '\\n'", {531, -1}: "expected '\\n'", {535, -1}: "expected '\\n'", {538, -1}: "expected '\\n'", {540, -1}: "expected '\\n'", {562, -1}: "expected '\\n'", {567, -1}: "expected '\\n'", {570, -1}: "expected '\\n'", {577, -1}: "expected '\\n'", {582, -1}: "expected '\\n'", {588, -1}: "expected '\\n'", {97, -1}: "expected ']'", {188, -1}: "expected ']'", {232, -1}: "expected ']'", {299, -1}: "expected ']'", {401, -1}: "expected ']'", {452, -1}: "expected '{'", {454, -1}: "expected '{'", {466, -1}: "expected '{'", {268, -1}: "expected '}'", {407, -1}: "expected '}'", {423, -1}: "expected '}'", {463, -1}: "expected '}'", {0, -1}: "expected Start or one of [constant expression prefix, preprocessing file prefix, translation unit prefix]", {208, -1}: "expected abstract declarator or declarator or optional parameter type list or one of ['(', ')', '*', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {90, -1}: "expected abstract declarator or optional parameter type list or one of ['(', ')', '*', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {287, -1}: "expected assembler instructions or string literal", {289, -1}: "expected assembler instructions or string literal", {436, -1}: "expected assembler instructions or string literal", {301, -1}: "expected assembler operand or one of ['[', string literal]", {317, -1}: "expected assembler operands or one of [')', ':', '[', string literal]", {294, -1}: "expected assembler operands or one of ['[', string literal]", {320, -1}: "expected assembler operands or one of ['[', string literal]", {324, -1}: "expected assembler operands or one of ['[', string literal]", {447, -1}: "expected assembler statement or asm", {270, -1}: "expected block item or one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {302, -1}: "expected clobbers or string literal", {327, -1}: "expected clobbers or string literal", {446, -1}: "expected compound statement or '{'", {64, -1}: "expected compound statement or expression list or type name or one of [&&, '!', '&', '(', '*', '+', '-', '{', '~', ++, --, _Alignof, _Bool, _Complex, char, character constant, const, double, enum, float, floating-point constant, identifier, int, integer constant, long, long character constant, long string constant, restrict, short, signed, sizeof, string literal, struct, typedefname, typeof, union, unsigned, void, volatile]", {249, -1}: "expected compound statement or expression list or type name or one of [&&, '!', '&', '(', '*', '+', '-', '{', '~', ++, --, _Alignof, _Bool, _Complex, char, character constant, const, double, enum, float, floating-point constant, identifier, int, integer constant, long, long character constant, long string constant, restrict, short, signed, sizeof, string literal, struct, typedefname, typeof, union, unsigned, void, volatile]", {3, -1}: "expected constant expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {50, -1}: "expected constant expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {266, -1}: "expected constant expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {398, -1}: "expected constant expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {460, -1}: "expected constant expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {480, -1}: "expected constant expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {502, -1}: "expected constant expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {440, -1}: "expected declaration list or one of [_Bool, _Complex, _Noreturn, _Static_assert, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {442, -1}: "expected declaration or one of ['{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {338, -1}: "expected declaration or optional expression list or one of [&&, '!', '&', '(', '*', '+', '-', ';', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, auto, char, character constant, const, double, enum, extern, float, floating-point constant, identifier, inline, int, integer constant, long, long character constant, long string constant, register, restrict, short, signed, sizeof, static, string literal, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {47, -1}: "expected declarator or one of ['(', '*', identifier]", {386, -1}: "expected declarator or one of ['(', '*', identifier]", {200, -1}: "expected declarator or optional abstract declarator or one of ['(', ')', '*', ',', '[', identifier]", {7, -1}: "expected declarator or optional init declarator list or one of ['(', '*', ';', identifier]", {395, -1}: "expected designator or one of ['.', '=', '[']", {203, -1}: "expected direct abstract declarator or direct declarator or one of ['(', '[', identifier]", {87, -1}: "expected direct abstract declarator or one of ['(', '[']", {384, -1}: "expected direct declarator or one of ['(', identifier]", {575, -1}: "expected elif group or one of [#elif, #else, #endif]", {581, -1}: "expected endif line or #endif", {512, -1}: "expected endif line or optional elif group list or optional else group or one of [#elif, #else, #endif]", {573, -1}: "expected endif line or optional else group or one of [#else, #endif]", {455, -1}: "expected enumerator list or identifier", {462, -1}: "expected enumerator or one of ['}', identifier]", {126, -1}: "expected expression list or one of [&&, '!', '&', '(', '*', '+', '-', ':', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {102, -1}: "expected expression list or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {354, -1}: "expected expression list or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {358, -1}: "expected expression list or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {362, -1}: "expected expression list or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {366, -1}: "expected expression list or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {419, -1}: "expected expression or one of [!=, $end, %=, &&, &=, '!', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '{', '|', '}', '~', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal, |=, ||]", {94, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', ']', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {231, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', ']', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {434, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '{', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {51, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {66, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {67, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {68, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {69, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {70, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {71, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {72, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {73, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {74, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {100, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {108, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {109, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {110, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {111, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {112, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {113, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {114, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {115, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {116, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {117, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {118, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {119, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {120, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {121, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {122, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {123, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {124, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {125, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {127, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {128, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {129, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {130, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {131, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {132, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {133, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {134, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {135, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {136, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {137, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {152, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {154, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {155, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {182, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {189, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {225, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {228, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {279, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {312, -1}: "expected expression or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {98, -1}: "expected expression or optional type qualifier list or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, string literal, volatile]", {223, -1}: "expected expression or optional type qualifier list or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, string literal, volatile]", {487, -1}: "expected expression or type name or one of [&&, '!', '&', '(', '*', '+', '-', '~', ++, --, _Alignof, _Bool, _Complex, char, character constant, const, double, enum, float, floating-point constant, identifier, int, integer constant, long, long character constant, long string constant, restrict, short, signed, sizeof, string literal, struct, typedefname, typeof, union, unsigned, void, volatile]", {6, -1}: "expected external declaration or one of [$end, '(', '*', ';', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {439, -1}: "expected function body or one of ['{', asm]", {444, -1}: "expected function body or one of ['{', asm]", {498, -1}: "expected function body or one of ['{', asm]", {499, -1}: "expected function body or one of ['{', asm]", {497, -1}: "expected function body or optional declaration list or one of [',', ';', '=', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {438, -1}: "expected function body or optional declaration list or one of ['{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {564, -1}: "expected group part or one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, '\\n', ppother]", {506, -1}: "expected group part or one of [#, #define, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {76, -1}: "expected identifier", {104, -1}: "expected identifier", {105, -1}: "expected identifier", {217, -1}: "expected identifier", {298, -1}: "expected identifier", {399, -1}: "expected identifier", {514, -1}: "expected identifier", {515, -1}: "expected identifier", {522, -1}: "expected identifier", {306, -1}: "expected identifier list or identifier", {544, -1}: "expected identifier list or optional identifier list or one of [')', ..., identifier]", {413, -1}: "expected init declarator or one of ['(', '*', identifier]", {392, -1}: "expected initializer list or optional comma or one of [&&, '!', '&', '(', '*', '+', ',', '-', '.', '[', '{', '}', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {421, -1}: "expected initializer list or optional comma or one of [&&, '!', '&', '(', '*', '+', ',', '-', '.', '[', '{', '}', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {388, -1}: "expected initializer or one of [&&, '!', '&', '(', '*', '+', '-', '{', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {394, -1}: "expected initializer or one of [&&, '!', '&', '(', '*', '+', '-', '{', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {409, -1}: "expected initializer or one of [&&, '!', '&', '(', '*', '+', '-', '{', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {411, -1}: "expected initializer or one of [&&, '!', '&', '(', '*', '+', '-', '{', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {406, -1}: "expected initializer or optional designation or one of [&&, '!', '&', '(', '*', '+', '-', '.', '[', '{', '}', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {57, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {58, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {59, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {60, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {61, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {62, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {63, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {77, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {106, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {107, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {139, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {140, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {141, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {142, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {143, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {144, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {145, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {146, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {147, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {148, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {149, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {153, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {157, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {158, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {159, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {160, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {161, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {162, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {163, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {164, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {165, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {166, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {167, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {168, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {169, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {170, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {171, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {172, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {173, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {174, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {175, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {176, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {177, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {181, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {185, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {193, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {248, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {250, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {418, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {420, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {424, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {425, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {426, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {427, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {428, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {429, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {430, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {431, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {432, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {65, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {150, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {156, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {178, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', '<', '=', '>', '?', '[', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {183, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', '<', '=', '>', '?', '[', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {313, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', ')', '*', '+', '-', '.', '/', '<', '=', '>', '?', '[', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {488, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', ')', '*', '+', '-', '.', '/', '<', '=', '>', '?', '[', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {389, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {256, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {390, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', ',', '-', '.', '/', ';', '<', '=', '>', '?', '[', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {334, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', '-', '.', '/', ';', '<', '=', '>', '?', '[', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {335, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', '-', '.', '/', ';', '<', '=', '>', '?', '[', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {93, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', '-', '.', '/', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {101, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', '-', '.', '/', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {190, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', '-', '.', '/', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {226, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', '-', '.', '/', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {229, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', '-', '.', '/', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {507, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {508, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {509, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {511, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {518, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {524, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {526, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {529, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {532, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {534, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {536, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {537, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {539, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {541, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {542, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {545, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {550, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {551, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {553, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {557, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {560, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {561, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {566, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {586, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {587, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {589, -1}: "expected one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, $end, '\\n', ppother]", {565, -1}: "expected one of [#elif, #else, #endif]", {569, -1}: "expected one of [#elif, #else, #endif]", {572, -1}: "expected one of [#elif, #else, #endif]", {574, -1}: "expected one of [#elif, #else, #endif]", {579, -1}: "expected one of [#elif, #else, #endif]", {580, -1}: "expected one of [#elif, #else, #endif]", {374, -1}: "expected one of [$end, &&, '!', '&', '(', ')', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {8, -1}: "expected one of [$end, &&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {56, -1}: "expected one of [$end, &&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {415, -1}: "expected one of [$end, &&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {42, -1}: "expected one of [$end, '(', '*', ';', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {43, -1}: "expected one of [$end, '(', '*', ';', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {44, -1}: "expected one of [$end, '(', '*', ';', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {46, -1}: "expected one of [$end, '(', '*', ';', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {445, -1}: "expected one of [$end, '(', '*', ';', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {449, -1}: "expected one of [$end, '(', '*', ';', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {450, -1}: "expected one of [$end, '(', '*', ';', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {451, -1}: "expected one of [$end, '(', '*', ';', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {500, -1}: "expected one of [$end, '(', '*', ';', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {501, -1}: "expected one of [$end, '(', '*', ';', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {37, -1}: "expected one of [&&, '!', '&', '(', ')', '*', '+', ',', '-', ':', ';', '[', ']', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, auto, char, character constant, const, double, enum, extern, float, floating-point constant, identifier, inline, int, integer constant, long, long character constant, long string constant, register, restrict, short, signed, sizeof, static, string literal, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {38, -1}: "expected one of [&&, '!', '&', '(', ')', '*', '+', ',', '-', ':', ';', '[', ']', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, auto, char, character constant, const, double, enum, extern, float, floating-point constant, identifier, inline, int, integer constant, long, long character constant, long string constant, register, restrict, short, signed, sizeof, static, string literal, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {39, -1}: "expected one of [&&, '!', '&', '(', ')', '*', '+', ',', '-', ':', ';', '[', ']', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, auto, char, character constant, const, double, enum, extern, float, floating-point constant, identifier, inline, int, integer constant, long, long character constant, long string constant, register, restrict, short, signed, sizeof, static, string literal, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {95, -1}: "expected one of [&&, '!', '&', '(', ')', '*', '+', ',', '-', '[', ']', '~', ++, --, _Alignof, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, static, string literal, volatile]", {186, -1}: "expected one of [&&, '!', '&', '(', ')', '*', '+', ',', '-', '[', ']', '~', ++, --, _Alignof, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, static, string literal, volatile]", {259, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {260, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {261, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {262, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {263, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {264, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {265, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {284, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {308, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {316, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {319, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {322, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {323, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {326, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {329, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {331, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {332, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {333, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {336, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {337, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {345, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {351, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {357, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {361, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {365, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {369, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {371, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {372, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {376, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {379, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {417, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {269, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {271, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {272, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {373, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {396, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', '{', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {403, -1}: "expected one of [&&, '!', '&', '(', '*', '+', '-', '{', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {453, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', '{', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {467, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', '{', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {18, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {19, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {20, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {21, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {22, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {23, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {24, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {25, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {26, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {27, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {28, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {29, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {30, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {31, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {464, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {470, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {485, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {490, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {491, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {13, -1}: "expected one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {14, -1}: "expected one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {15, -1}: "expected one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {16, -1}: "expected one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {17, -1}: "expected one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {40, -1}: "expected one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {41, -1}: "expected one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {492, -1}: "expected one of ['(', ')', '*', ',', ';', '[', identifier]", {493, -1}: "expected one of ['(', ')', '*', ',', ';', '[', identifier]", {494, -1}: "expected one of ['(', ')', '*', ',', ';', '[', identifier]", {495, -1}: "expected one of ['(', ')', '*', ',', ';', '[', identifier]", {496, -1}: "expected one of ['(', ')', '*', ',', ';', '[', identifier]", {245, -1}: "expected one of ['(', ')', '*', ':', ';', '[', identifier]", {246, -1}: "expected one of ['(', ')', '*', ':', ';', '[', identifier]", {247, -1}: "expected one of ['(', ')', '*', ':', ';', '[', identifier]", {206, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {207, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {210, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {219, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {221, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {227, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {230, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {233, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {234, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {85, -1}: "expected one of ['(', ')', ',', '[', identifier]", {244, -1}: "expected one of ['(', ')', ',', '[', identifier]", {89, -1}: "expected one of ['(', ')', ',', '[']", {138, -1}: "expected one of ['(', ')', ',', '[']", {187, -1}: "expected one of ['(', ')', ',', '[']", {191, -1}: "expected one of ['(', ')', ',', '[']", {192, -1}: "expected one of ['(', ')', ',', '[']", {194, -1}: "expected one of ['(', ')', ',', '[']", {202, -1}: "expected one of ['(', ')', ',', '[']", {238, -1}: "expected one of ['(', ')', ',', '[']", {242, -1}: "expected one of ['(', ')', ',', '[']", {285, -1}: "expected one of ['(', goto]", {286, -1}: "expected one of ['(', goto]", {385, -1}: "expected one of ['(', identifier]", {296, -1}: "expected one of [')', ',', ':']", {303, -1}: "expected one of [')', ',', ':']", {309, -1}: "expected one of [')', ',', ':']", {310, -1}: "expected one of [')', ',', ':']", {314, -1}: "expected one of [')', ',', ':']", {318, -1}: "expected one of [')', ',', ':']", {325, -1}: "expected one of [')', ',', ':']", {257, -1}: "expected one of [')', ',', ';']", {215, -1}: "expected one of [')', ',', ...]", {218, -1}: "expected one of [')', ',', ...]", {546, -1}: "expected one of [')', ',', ...]", {88, -1}: "expected one of [')', ',']", {179, -1}: "expected one of [')', ',']", {197, -1}: "expected one of [')', ',']", {199, -1}: "expected one of [')', ',']", {204, -1}: "expected one of [')', ',']", {205, -1}: "expected one of [')', ',']", {216, -1}: "expected one of [')', ',']", {237, -1}: "expected one of [')', ',']", {251, -1}: "expected one of [')', ',']", {307, -1}: "expected one of [')', ',']", {321, -1}: "expected one of [')', ',']", {328, -1}: "expected one of [')', ',']", {355, -1}: "expected one of [')', ',']", {359, -1}: "expected one of [')', ',']", {363, -1}: "expected one of [')', ',']", {367, -1}: "expected one of [')', ',']", {290, -1}: "expected one of [')', ':', string literal]", {292, -1}: "expected one of [')', ':', string literal]", {315, -1}: "expected one of [')', ':', string literal]", {437, -1}: "expected one of [')', string literal]", {478, -1}: "expected one of [',', ':', ';']", {151, -1}: "expected one of [',', ':']", {297, -1}: "expected one of [',', ':']", {304, -1}: "expected one of [',', ':']", {383, -1}: "expected one of [',', ';', '=']", {408, -1}: "expected one of [',', ';', '}']", {412, -1}: "expected one of [',', ';', '}']", {381, -1}: "expected one of [',', ';']", {382, -1}: "expected one of [',', ';']", {391, -1}: "expected one of [',', ';']", {414, -1}: "expected one of [',', ';']", {475, -1}: "expected one of [',', ';']", {477, -1}: "expected one of [',', ';']", {481, -1}: "expected one of [',', ';']", {484, -1}: "expected one of [',', ';']", {456, -1}: "expected one of [',', '=', '}']", {459, -1}: "expected one of [',', '=', '}']", {184, -1}: "expected one of [',', ']']", {405, -1}: "expected one of [',', '}']", {410, -1}: "expected one of [',', '}']", {458, -1}: "expected one of [',', '}']", {461, -1}: "expected one of [',', '}']", {465, -1}: "expected one of [',', '}']", {397, -1}: "expected one of ['.', '=', '[']", {400, -1}: "expected one of ['.', '=', '[']", {402, -1}: "expected one of ['.', '=', '[']", {404, -1}: "expected one of ['.', '=', '[']", {291, -1}: "expected one of [':', string literal]", {516, -1}: "expected one of ['\\n', identifier, identifier immediatelly followed by '(']", {525, -1}: "expected one of ['\\n', ppother]", {528, -1}: "expected one of ['\\n', ppother]", {530, -1}: "expected one of ['\\n', ppother]", {441, -1}: "expected one of ['{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {443, -1}: "expected one of ['{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {34, -1}: "expected one of ['{', identifier]", {35, -1}: "expected one of ['{', identifier]", {472, -1}: "expected one of ['}', _Bool, _Complex, _Static_assert, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedefname, typeof, union, unsigned, void, volatile]", {474, -1}: "expected one of ['}', _Bool, _Complex, _Static_assert, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedefname, typeof, union, unsigned, void, volatile]", {476, -1}: "expected one of ['}', _Bool, _Complex, _Static_assert, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedefname, typeof, union, unsigned, void, volatile]", {482, -1}: "expected one of ['}', _Bool, _Complex, _Static_assert, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedefname, typeof, union, unsigned, void, volatile]", {486, -1}: "expected one of ['}', _Bool, _Complex, _Static_assert, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedefname, typeof, union, unsigned, void, volatile]", {554, -1}: "expected one of [..., identifier]", {83, -1}: "expected optional abstract declarator or one of ['(', ')', '*', '[']", {103, -1}: "expected optional argument expression list or one of [&&, '!', '&', '(', ')', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {254, -1}: "expected optional block item list or one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {255, -1}: "expected optional block item list or one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Alignof, _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedefname, typeof, union, unsigned, void, volatile, while]", {393, -1}: "expected optional comma or one of [',', '}']", {422, -1}: "expected optional comma or one of [',', '}']", {457, -1}: "expected optional comma or one of [',', '}']", {9, -1}: "expected optional declaration specifiers or one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {10, -1}: "expected optional declaration specifiers or one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {11, -1}: "expected optional declaration specifiers or one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {12, -1}: "expected optional declaration specifiers or one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {342, -1}: "expected optional expression list or one of [&&, '!', '&', '(', ')', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {348, -1}: "expected optional expression list or one of [&&, '!', '&', '(', ')', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {282, -1}: "expected optional expression list or one of [&&, '!', '&', '(', '*', '+', '-', ';', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {340, -1}: "expected optional expression list or one of [&&, '!', '&', '(', '*', '+', '-', ';', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {346, -1}: "expected optional expression list or one of [&&, '!', '&', '(', '*', '+', '-', ';', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {222, -1}: "expected optional expression or one of [&&, '!', '&', '(', '*', '+', '-', ']', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {211, -1}: "expected optional expression or optional type qualifier list or type qualifier list or one of [&&, '!', '&', '(', '*', '+', '-', ']', '~', ++, --, _Alignof, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, static, string literal, volatile]", {92, -1}: "expected optional expression or type qualifier list or one of [&&, '!', '&', '(', '*', '+', '-', ']', '~', ++, --, _Alignof, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, static, string literal, volatile]", {96, -1}: "expected optional expression or type qualifier or one of [&&, '!', '&', '(', '*', '+', '-', ']', '~', ++, --, _Alignof, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, static, string literal, volatile]", {563, -1}: "expected optional group list or one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, '\\n', ppother]", {568, -1}: "expected optional group list or one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, '\\n', ppother]", {571, -1}: "expected optional group list or one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, '\\n', ppother]", {578, -1}: "expected optional group list or one of [#, #define, #elif, #else, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, '\\n', ppother]", {584, -1}: "expected optional group list or one of [#, #define, #endif, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, '\\n', ppother]", {212, -1}: "expected optional identifier list or parameter type list or one of [')', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {33, -1}: "expected optional identifier or one of ['{', identifier]", {36, -1}: "expected optional identifier or one of ['{', identifier]", {258, -1}: "expected optional init declarator list or one of ['(', '*', ';', identifier]", {196, -1}: "expected optional parameter type list or one of [')', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {239, -1}: "expected optional parameter type list or one of [')', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {240, -1}: "expected optional parameter type list or one of [')', _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {81, -1}: "expected optional specifier qualifier list or one of ['(', ')', '*', ':', ';', '[', _Bool, _Complex, char, const, double, enum, float, identifier, int, long, restrict, short, signed, struct, typedefname, typeof, union, unsigned, void, volatile]", {82, -1}: "expected optional specifier qualifier list or one of ['(', ')', '*', ':', ';', '[', _Bool, _Complex, char, const, double, enum, float, identifier, int, long, restrict, short, signed, struct, typedefname, typeof, union, unsigned, void, volatile]", {517, -1}: "expected optional token list or one of ['\\n', ppother]", {521, -1}: "expected optional token list or one of ['\\n', ppother]", {84, -1}: "expected optional type qualifier list or pointer or one of ['(', ')', '*', ',', '[', const, identifier, restrict, volatile]", {283, -1}: "expected optional volatile or one of ['(', goto, volatile]", {48, -1}: "expected optional volatile or one of ['(', volatile]", {235, -1}: "expected parameter declaration or one of [..., _Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {213, -1}: "expected parameter type list or one of [_Bool, _Complex, _Noreturn, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {243, -1}: "expected pointer or one of ['(', ')', '*', ',', '[', identifier]", {2, -1}: "expected preprocessing file or one of [#, #define, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, '\\n', ppother]", {504, -1}: "expected preprocessing file or one of [#, #define, #error, #foo, #if, #ifdef, #ifndef, #include, #include_next, #line, #pragma, #undef, '\\n', ppother]", {543, -1}: "expected replacement list or one of ['\\n', ppother]", {549, -1}: "expected replacement list or one of ['\\n', ppother]", {552, -1}: "expected replacement list or one of ['\\n', ppother]", {556, -1}: "expected replacement list or one of ['\\n', ppother]", {559, -1}: "expected replacement list or one of ['\\n', ppother]", {80, -1}: "expected specifier qualifier list or one of [_Bool, _Complex, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedefname, typeof, union, unsigned, void, volatile]", {277, -1}: "expected statement or one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, _Alignof, asm, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, while]", {344, -1}: "expected statement or one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, _Alignof, asm, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, while]", {350, -1}: "expected statement or one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, _Alignof, asm, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, while]", {360, -1}: "expected statement or one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, _Alignof, asm, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, while]", {364, -1}: "expected statement or one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, _Alignof, asm, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, while]", {368, -1}: "expected statement or one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, _Alignof, asm, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, while]", {370, -1}: "expected statement or one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, _Alignof, asm, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, while]", {375, -1}: "expected statement or one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, _Alignof, asm, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, while]", {378, -1}: "expected statement or one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, _Alignof, asm, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, while]", {416, -1}: "expected statement or one of [&&, '!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, _Alignof, asm, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, while]", {53, -1}: "expected string literal", {295, -1}: "expected string literal", {300, -1}: "expected string literal", {305, -1}: "expected string literal", {468, -1}: "expected struct declaration list or one of ['}', _Bool, _Complex, _Static_assert, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedefname, typeof, union, unsigned, void, volatile]", {469, -1}: "expected struct declaration list or one of [_Bool, _Complex, _Static_assert, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedefname, typeof, union, unsigned, void, volatile]", {471, -1}: "expected struct declaration or one of ['}', _Bool, _Complex, _Static_assert, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedefname, typeof, union, unsigned, void, volatile]", {473, -1}: "expected struct declarator list or one of ['(', '*', ':', ';', identifier]", {483, -1}: "expected struct declarator or one of ['(', '*', ':', identifier]", {533, -1}: "expected token list or one of ['\\n', ppother]", {510, -1}: "expected token list or ppother", {513, -1}: "expected token list or ppother", {519, -1}: "expected token list or ppother", {520, -1}: "expected token list or ppother", {523, -1}: "expected token list or ppother", {576, -1}: "expected token list or ppother", {4, -1}: "expected translation unit or one of ['(', '*', ';', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {5, -1}: "expected translation unit or one of ['(', '*', ';', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]", {78, -1}: "expected type name or one of [_Bool, _Complex, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedefname, typeof, union, unsigned, void, volatile]", {99, -1}: "expected type qualifier or one of [&&, '!', '&', '(', ')', '*', '+', ',', '-', '[', '~', ++, --, _Alignof, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, string literal, volatile]", {224, -1}: "expected type qualifier or one of [&&, '!', '&', '(', '*', '+', '-', ']', '~', ++, --, _Alignof, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, static, string literal, volatile]", {352, -1}: "expected while", {3, 51}: "unexpected EOF", {2, 51}: "unexpected EOF", {4, 51}: "unexpected EOF", } yyParseTab = [590][]uint16{ // 0 {218: 331, 227: 330, 229: 329, 232: 332}, {51: 328}, {84: 327, 94: 327, 100: 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 204: 832}, {325, 325, 325, 325, 325, 325, 325, 325, 325, 12: 325, 14: 325, 325, 325, 325, 325, 325, 325, 325, 325, 209: 830}, {323, 323, 323, 9: 323, 23: 323, 323, 323, 27: 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 44: 323, 323, 323, 323, 323, 323, 323, 57: 323, 323, 210: 333}, // 5 {75, 75, 75, 9: 374, 23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 57: 376, 377, 113: 339, 117: 358, 361, 357, 338, 122: 373, 124: 335, 340, 127: 337, 138: 336, 144: 372, 175: 375, 191: 370, 193: 371, 233: 334}, {75, 75, 75, 9: 374, 23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 322, 57: 376, 377, 113: 339, 117: 358, 361, 357, 338, 122: 373, 124: 335, 340, 127: 337, 138: 336, 144: 372, 175: 375, 191: 829, 193: 371}, {165, 412, 165, 9: 238, 133: 713, 136: 712, 825, 171: 709, 196: 710, 708}, {247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 12: 247, 14: 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 44: 247, 247, 247, 247, 247, 247, 247, 247, 53: 247, 57: 247, 247, 85: 247, 247, 247, 247, 247, 247, 247, 247, 247, 95: 247, 247}, {242, 242, 242, 9: 242, 242, 242, 13: 242, 23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 113: 339, 117: 358, 361, 357, 338, 124: 821, 340, 127: 337, 158: 824}, // 10 {242, 242, 242, 9: 242, 242, 242, 13: 242, 23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 113: 339, 117: 358, 361, 357, 338, 124: 821, 340, 127: 337, 158: 823}, {242, 242, 242, 9: 242, 242, 242, 13: 242, 23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 113: 339, 117: 358, 361, 357, 338, 124: 821, 340, 127: 337, 158: 822}, {242, 242, 242, 9: 242, 242, 242, 13: 242, 23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 113: 339, 117: 358, 361, 357, 338, 124: 821, 340, 127: 337, 158: 820}, {233, 233, 233, 9: 233, 233, 233, 13: 233, 23: 233, 233, 233, 27: 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 44: 233, 233, 233, 233, 233, 233, 233}, {232, 232, 232, 9: 232, 232, 232, 13: 232, 23: 232, 232, 232, 27: 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 44: 232, 232, 232, 232, 232, 232, 232}, // 15 {231, 231, 231, 9: 231, 231, 231, 13: 231, 23: 231, 231, 231, 27: 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 44: 231, 231, 231, 231, 231, 231, 231}, {230, 230, 230, 9: 230, 230, 230, 13: 230, 23: 230, 230, 230, 27: 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 44: 230, 230, 230, 230, 230, 230, 230}, {229, 229, 229, 9: 229, 229, 229, 13: 229, 23: 229, 229, 229, 27: 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 44: 229, 229, 229, 229, 229, 229, 229}, {228, 228, 228, 9: 228, 228, 228, 13: 228, 23: 228, 228, 228, 27: 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228}, {227, 227, 227, 9: 227, 227, 227, 13: 227, 23: 227, 227, 227, 27: 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227}, // 20 {226, 226, 226, 9: 226, 226, 226, 13: 226, 23: 226, 226, 226, 27: 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226}, {225, 225, 225, 9: 225, 225, 225, 13: 225, 23: 225, 225, 225, 27: 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225}, {224, 224, 224, 9: 224, 224, 224, 13: 224, 23: 224, 224, 224, 27: 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224}, {223, 223, 223, 9: 223, 223, 223, 13: 223, 23: 223, 223, 223, 27: 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223}, {222, 222, 222, 9: 222, 222, 222, 13: 222, 23: 222, 222, 222, 27: 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222}, // 25 {221, 221, 221, 9: 221, 221, 221, 13: 221, 23: 221, 221, 221, 27: 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221}, {220, 220, 220, 9: 220, 220, 220, 13: 220, 23: 220, 220, 220, 27: 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220}, {219, 219, 219, 9: 219, 219, 219, 13: 219, 23: 219, 219, 219, 27: 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219}, {218, 218, 218, 9: 218, 218, 218, 13: 218, 23: 218, 218, 218, 27: 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218}, {217, 217, 217, 9: 217, 217, 217, 13: 217, 23: 217, 217, 217, 27: 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217}, // 30 {216, 216, 216, 9: 216, 216, 216, 13: 216, 23: 216, 216, 216, 27: 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216}, {215, 215, 215, 9: 215, 215, 215, 13: 215, 23: 215, 215, 215, 27: 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215}, {815}, {2: 795, 53: 147, 195: 794}, {2: 208, 53: 208}, // 35 {2: 207, 53: 207}, {2: 781, 53: 147, 195: 780}, {184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 27: 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 55: 184}, {183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 27: 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 55: 183}, {182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 27: 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 55: 182}, // 40 {181, 181, 181, 9: 181, 181, 181, 13: 181, 23: 181, 181, 181, 27: 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 44: 181, 181, 181, 181, 181, 181, 181}, {180, 180, 180, 9: 180, 180, 180, 13: 180, 23: 180, 180, 180, 27: 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 44: 180, 180, 180, 180, 180, 180, 180}, {83, 83, 83, 9: 83, 23: 83, 83, 83, 27: 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 44: 83, 83, 83, 83, 83, 83, 83, 83, 57: 83, 83}, {81, 81, 81, 9: 81, 23: 81, 81, 81, 27: 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 44: 81, 81, 81, 81, 81, 81, 81, 81, 57: 81, 81}, {80, 80, 80, 9: 80, 23: 80, 80, 80, 27: 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 44: 80, 80, 80, 80, 80, 80, 80, 80, 57: 80, 80}, // 45 {9: 779}, {78, 78, 78, 9: 78, 23: 78, 78, 78, 27: 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 44: 78, 78, 78, 78, 78, 78, 78, 78, 57: 78, 78}, {165, 412, 165, 133: 713, 136: 712, 766}, {60, 23: 614, 203: 763}, {378}, // 50 {250, 250, 250, 250, 250, 250, 250, 250, 250, 12: 250, 14: 250, 250, 250, 250, 250, 250, 250, 250, 250, 145: 379, 380}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 393}, {11: 381}, {12: 382}, {10: 383}, // 55 {9: 384}, {44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 12: 44, 14: 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44: 44, 44, 44, 44, 44, 44, 44, 44, 53: 44, 57: 44, 44, 85: 44, 44, 44, 44, 44, 44, 44, 44, 44, 95: 44, 44}, {316, 316, 3: 316, 316, 316, 316, 316, 316, 316, 316, 316, 13: 316, 26: 316, 43: 316, 51: 316, 316, 55: 316, 316, 59: 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316}, {315, 315, 3: 315, 315, 315, 315, 315, 315, 315, 315, 315, 13: 315, 26: 315, 43: 315, 51: 315, 315, 55: 315, 315, 59: 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315}, {314, 314, 3: 314, 314, 314, 314, 314, 314, 314, 314, 314, 13: 314, 26: 314, 43: 314, 51: 314, 314, 55: 314, 314, 59: 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314}, // 60 {313, 313, 3: 313, 313, 313, 313, 313, 313, 313, 313, 313, 13: 313, 26: 313, 43: 313, 51: 313, 313, 55: 313, 313, 59: 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313}, {312, 312, 3: 312, 312, 312, 312, 312, 312, 312, 312, 312, 13: 312, 26: 312, 43: 312, 51: 312, 312, 55: 312, 312, 59: 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312}, {311, 311, 3: 311, 311, 311, 311, 311, 311, 311, 311, 311, 13: 311, 26: 311, 43: 311, 51: 311, 311, 55: 311, 311, 59: 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311}, {310, 310, 3: 310, 310, 310, 310, 310, 310, 310, 310, 310, 13: 310, 26: 310, 43: 310, 51: 310, 310, 55: 310, 310, 59: 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 145, 145, 145, 27: 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 53: 582, 478, 114: 579, 123: 581, 155: 408, 162: 761}, // 65 {431, 436, 3: 449, 439, 440, 452, 435, 434, 249, 11: 249, 13: 430, 26: 249, 43: 249, 51: 249, 455, 55: 249, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 760}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 759}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 758}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 521}, // 70 {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 757}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 756}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 755}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 754}, {577, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 578}, // 75 {406}, {2: 405}, {258, 258, 3: 258, 258, 258, 258, 258, 258, 258, 258, 258, 13: 258, 26: 258, 43: 258, 51: 258, 258, 55: 258, 258, 59: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258}, {23: 145, 145, 145, 27: 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 155: 408, 162: 407}, {10: 576}, // 80 {23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 113: 410, 117: 358, 361, 357, 409, 153: 411}, {199, 199, 199, 9: 199, 199, 13: 199, 23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 199, 113: 410, 117: 358, 361, 357, 409, 153: 574, 200: 575}, {199, 199, 199, 9: 199, 199, 13: 199, 23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 199, 113: 410, 117: 358, 361, 357, 409, 153: 574, 200: 573}, {165, 412, 10: 141, 13: 165, 133: 413, 136: 415, 156: 416, 180: 414}, {161, 161, 161, 10: 161, 161, 13: 161, 23: 367, 365, 366, 113: 423, 154: 427, 163: 571}, // 85 {164, 2: 164, 10: 143, 143, 13: 164}, {10: 144}, {418, 13: 129, 185: 417, 419}, {10: 140, 140}, {567, 10: 142, 142, 13: 128}, // 90 {165, 412, 10: 133, 13: 165, 23: 133, 133, 133, 27: 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 44: 133, 133, 133, 133, 133, 133, 133, 133: 413, 136: 415, 156: 523, 174: 524}, {13: 420}, {392, 422, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 367, 365, 366, 44: 426, 54: 421, 256, 113: 423, 154: 424, 169: 425}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 13: 430, 52: 455, 55: 255, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 521, 522}, // 95 {163, 163, 163, 163, 163, 163, 163, 163, 163, 10: 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 44: 163, 55: 163}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 367, 365, 366, 44: 517, 54: 421, 256, 113: 514, 169: 516}, {55: 515}, {161, 161, 161, 161, 161, 161, 161, 161, 161, 12: 161, 14: 161, 161, 161, 161, 161, 161, 161, 161, 161, 367, 365, 366, 113: 423, 154: 427, 163: 428}, {160, 160, 160, 160, 160, 160, 160, 160, 160, 10: 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 367, 365, 366, 113: 514}, // 100 {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 429}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 13: 430, 52: 455, 55: 466, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 478, 114: 512}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 10: 318, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 506, 214: 507, 508}, {2: 505}, // 105 {2: 504}, {304, 304, 3: 304, 304, 304, 304, 304, 304, 304, 304, 304, 13: 304, 26: 304, 43: 304, 51: 304, 304, 55: 304, 304, 59: 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304}, {303, 303, 3: 303, 303, 303, 303, 303, 303, 303, 303, 303, 13: 303, 26: 303, 43: 303, 51: 303, 303, 55: 303, 303, 59: 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 503}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 502}, // 110 {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 501}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 500}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 499}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 498}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 497}, // 115 {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 496}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 495}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 494}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 493}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 492}, // 120 {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 491}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 490}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 489}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 488}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 487}, // 125 {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 486}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 43: 480, 54: 478, 114: 479}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 477}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 476}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 475}, // 130 {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 474}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 473}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 472}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 471}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 470}, // 135 {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 469}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 468}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 467}, {136, 10: 136, 136, 13: 136}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 261, 261, 261, 13: 430, 26: 261, 43: 261, 51: 261, 455, 55: 261, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, // 140 {431, 436, 3: 449, 439, 440, 452, 435, 434, 262, 262, 262, 13: 430, 26: 262, 43: 262, 51: 262, 455, 55: 262, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 263, 263, 263, 13: 430, 26: 263, 43: 263, 51: 263, 455, 55: 263, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 264, 264, 264, 13: 430, 26: 264, 43: 264, 51: 264, 455, 55: 264, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 265, 265, 265, 13: 430, 26: 265, 43: 265, 51: 265, 455, 55: 265, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 266, 266, 266, 13: 430, 26: 266, 43: 266, 51: 266, 455, 55: 266, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, // 145 {431, 436, 3: 449, 439, 440, 452, 435, 434, 267, 267, 267, 13: 430, 26: 267, 43: 267, 51: 267, 455, 55: 267, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 268, 268, 268, 13: 430, 26: 268, 43: 268, 51: 268, 455, 55: 268, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 269, 269, 269, 13: 430, 26: 269, 43: 269, 51: 269, 455, 55: 269, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 270, 270, 270, 13: 430, 26: 270, 43: 270, 51: 270, 455, 55: 270, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 271, 271, 271, 13: 430, 26: 271, 43: 271, 51: 271, 455, 55: 271, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, // 150 {431, 436, 3: 449, 439, 440, 452, 435, 434, 254, 254, 254, 13: 430, 43: 254, 52: 455, 55: 254, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {11: 483, 43: 482}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 481}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 257, 257, 257, 13: 430, 26: 257, 43: 257, 51: 257, 257, 55: 257, 432, 59: 438, 437, 443, 444, 454, 450, 451, 257, 257, 433, 257, 447, 446, 445, 441, 257, 257, 257, 448, 257, 453, 442, 257, 257, 257}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 485}, // 155 {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 484}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 253, 253, 253, 13: 430, 43: 253, 52: 455, 55: 253, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 272, 272, 272, 13: 430, 26: 272, 43: 272, 51: 272, 272, 55: 272, 432, 59: 438, 437, 443, 444, 454, 450, 451, 272, 272, 433, 272, 447, 446, 445, 441, 272, 272, 272, 448, 272, 453, 442, 272, 272, 272}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 273, 273, 273, 13: 430, 26: 273, 43: 273, 51: 273, 273, 55: 273, 432, 59: 438, 437, 443, 444, 273, 450, 451, 273, 273, 433, 273, 447, 446, 445, 441, 273, 273, 273, 448, 273, 273, 442, 273, 273, 273}, {431, 436, 3: 449, 439, 440, 274, 435, 434, 274, 274, 274, 13: 430, 26: 274, 43: 274, 51: 274, 274, 55: 274, 432, 59: 438, 437, 443, 444, 274, 450, 451, 274, 274, 433, 274, 447, 446, 445, 441, 274, 274, 274, 448, 274, 274, 442, 274, 274, 274}, // 160 {431, 436, 3: 449, 439, 440, 275, 435, 434, 275, 275, 275, 13: 430, 26: 275, 43: 275, 51: 275, 275, 55: 275, 432, 59: 438, 437, 443, 444, 275, 450, 275, 275, 275, 433, 275, 447, 446, 445, 441, 275, 275, 275, 448, 275, 275, 442, 275, 275, 275}, {431, 436, 3: 449, 439, 440, 276, 435, 434, 276, 276, 276, 13: 430, 26: 276, 43: 276, 51: 276, 276, 55: 276, 432, 59: 438, 437, 443, 444, 276, 276, 276, 276, 276, 433, 276, 447, 446, 445, 441, 276, 276, 276, 448, 276, 276, 442, 276, 276, 276}, {431, 436, 3: 277, 439, 440, 277, 435, 434, 277, 277, 277, 13: 430, 26: 277, 43: 277, 51: 277, 277, 55: 277, 432, 59: 438, 437, 443, 444, 277, 277, 277, 277, 277, 433, 277, 447, 446, 445, 441, 277, 277, 277, 448, 277, 277, 442, 277, 277, 277}, {431, 436, 3: 278, 439, 440, 278, 435, 434, 278, 278, 278, 13: 430, 26: 278, 43: 278, 51: 278, 278, 55: 278, 432, 59: 438, 437, 443, 444, 278, 278, 278, 278, 278, 433, 278, 278, 446, 445, 441, 278, 278, 278, 278, 278, 278, 442, 278, 278, 278}, {431, 436, 3: 279, 439, 440, 279, 435, 434, 279, 279, 279, 13: 430, 26: 279, 43: 279, 51: 279, 279, 55: 279, 432, 59: 438, 437, 443, 444, 279, 279, 279, 279, 279, 433, 279, 279, 446, 445, 441, 279, 279, 279, 279, 279, 279, 442, 279, 279, 279}, // 165 {431, 436, 3: 280, 439, 440, 280, 435, 434, 280, 280, 280, 13: 430, 26: 280, 43: 280, 51: 280, 280, 55: 280, 432, 59: 438, 437, 280, 280, 280, 280, 280, 280, 280, 433, 280, 280, 280, 280, 441, 280, 280, 280, 280, 280, 280, 442, 280, 280, 280}, {431, 436, 3: 281, 439, 440, 281, 435, 434, 281, 281, 281, 13: 430, 26: 281, 43: 281, 51: 281, 281, 55: 281, 432, 59: 438, 437, 281, 281, 281, 281, 281, 281, 281, 433, 281, 281, 281, 281, 441, 281, 281, 281, 281, 281, 281, 442, 281, 281, 281}, {431, 436, 3: 282, 439, 440, 282, 435, 434, 282, 282, 282, 13: 430, 26: 282, 43: 282, 51: 282, 282, 55: 282, 432, 59: 438, 437, 282, 282, 282, 282, 282, 282, 282, 433, 282, 282, 282, 282, 441, 282, 282, 282, 282, 282, 282, 442, 282, 282, 282}, {431, 436, 3: 283, 439, 440, 283, 435, 434, 283, 283, 283, 13: 430, 26: 283, 43: 283, 51: 283, 283, 55: 283, 432, 59: 438, 437, 283, 283, 283, 283, 283, 283, 283, 433, 283, 283, 283, 283, 441, 283, 283, 283, 283, 283, 283, 442, 283, 283, 283}, {431, 436, 3: 284, 439, 440, 284, 435, 434, 284, 284, 284, 13: 430, 26: 284, 43: 284, 51: 284, 284, 55: 284, 432, 59: 438, 437, 284, 284, 284, 284, 284, 284, 284, 433, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284}, // 170 {431, 436, 3: 285, 439, 440, 285, 435, 434, 285, 285, 285, 13: 430, 26: 285, 43: 285, 51: 285, 285, 55: 285, 432, 59: 438, 437, 285, 285, 285, 285, 285, 285, 285, 433, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285}, {431, 436, 3: 286, 286, 286, 286, 435, 434, 286, 286, 286, 13: 430, 26: 286, 43: 286, 51: 286, 286, 55: 286, 432, 59: 438, 437, 286, 286, 286, 286, 286, 286, 286, 433, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286}, {431, 436, 3: 287, 287, 287, 287, 435, 434, 287, 287, 287, 13: 430, 26: 287, 43: 287, 51: 287, 287, 55: 287, 432, 59: 438, 437, 287, 287, 287, 287, 287, 287, 287, 433, 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, 287}, {431, 288, 3: 288, 288, 288, 288, 435, 434, 288, 288, 288, 13: 430, 26: 288, 43: 288, 51: 288, 288, 55: 288, 432, 59: 288, 288, 288, 288, 288, 288, 288, 288, 288, 433, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288}, {431, 289, 3: 289, 289, 289, 289, 435, 434, 289, 289, 289, 13: 430, 26: 289, 43: 289, 51: 289, 289, 55: 289, 432, 59: 289, 289, 289, 289, 289, 289, 289, 289, 289, 433, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289}, // 175 {431, 290, 3: 290, 290, 290, 290, 435, 434, 290, 290, 290, 13: 430, 26: 290, 43: 290, 51: 290, 290, 55: 290, 432, 59: 290, 290, 290, 290, 290, 290, 290, 290, 290, 433, 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, 290}, {305, 305, 3: 305, 305, 305, 305, 305, 305, 305, 305, 305, 13: 305, 26: 305, 43: 305, 51: 305, 305, 55: 305, 305, 59: 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305}, {306, 306, 3: 306, 306, 306, 306, 306, 306, 306, 306, 306, 13: 306, 26: 306, 43: 306, 51: 306, 306, 55: 306, 306, 59: 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 10: 320, 320, 13: 430, 52: 455, 56: 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {10: 317, 510}, // 180 {10: 509}, {307, 307, 3: 307, 307, 307, 307, 307, 307, 307, 307, 307, 13: 307, 26: 307, 43: 307, 51: 307, 307, 55: 307, 307, 59: 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 511}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 10: 319, 319, 13: 430, 52: 455, 56: 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {11: 483, 55: 513}, // 185 {308, 308, 3: 308, 308, 308, 308, 308, 308, 308, 308, 308, 13: 308, 26: 308, 43: 308, 51: 308, 308, 55: 308, 308, 59: 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308}, {162, 162, 162, 162, 162, 162, 162, 162, 162, 10: 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 44: 162, 55: 162}, {138, 10: 138, 138, 13: 138}, {55: 520}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 518}, // 190 {431, 436, 3: 449, 439, 440, 452, 435, 434, 13: 430, 52: 455, 55: 519, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {135, 10: 135, 135, 13: 135}, {137, 10: 137, 137, 13: 137}, {431, 298, 3: 298, 298, 298, 298, 435, 434, 298, 298, 298, 13: 430, 26: 298, 43: 298, 51: 298, 298, 55: 298, 432, 59: 298, 298, 298, 298, 298, 298, 298, 298, 298, 433, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298}, {134, 10: 134, 134, 13: 134}, // 195 {10: 566}, {10: 157, 23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 113: 339, 117: 358, 361, 357, 338, 124: 528, 340, 127: 337, 161: 527, 172: 525, 526, 199: 529}, {10: 159, 563}, {10: 156}, {10: 155, 155}, // 200 {165, 412, 165, 10: 141, 141, 13: 165, 133: 413, 136: 531, 532, 156: 416, 180: 533}, {10: 530}, {132, 10: 132, 132, 13: 132}, {536, 2: 535, 13: 129, 185: 417, 419, 534}, {10: 153, 153}, // 205 {10: 152, 152}, {540, 9: 179, 179, 179, 13: 539, 23: 179, 179, 179, 27: 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 52: 179, 179, 57: 179, 179}, {176, 9: 176, 176, 176, 13: 176, 23: 176, 176, 176, 27: 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 52: 176, 176, 57: 176, 176}, {165, 412, 165, 10: 133, 13: 165, 23: 133, 133, 133, 27: 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 44: 133, 133, 133, 133, 133, 133, 133, 133: 413, 136: 531, 537, 156: 523, 174: 524}, {10: 538}, // 210 {175, 9: 175, 175, 175, 13: 175, 23: 175, 175, 175, 27: 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 52: 175, 175, 57: 175, 175}, {161, 161, 161, 161, 161, 161, 161, 161, 161, 12: 161, 14: 161, 161, 161, 161, 161, 161, 161, 161, 161, 367, 365, 366, 44: 551, 55: 161, 113: 423, 154: 552, 163: 550}, {2: 543, 10: 149, 23: 170, 170, 170, 27: 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 44: 170, 170, 170, 170, 170, 170, 170, 170: 544, 194: 542, 213: 541}, {23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 113: 339, 117: 358, 361, 357, 338, 124: 528, 340, 127: 337, 161: 527, 172: 525, 548}, {10: 547}, // 215 {10: 151, 151, 147: 151}, {10: 148, 545}, {2: 546}, {10: 150, 150, 147: 150}, {168, 9: 168, 168, 168, 13: 168, 23: 168, 168, 168, 27: 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 52: 168, 168, 57: 168, 168}, // 220 {10: 549}, {169, 9: 169, 169, 169, 13: 169, 23: 169, 169, 169, 27: 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 52: 169, 169, 57: 169, 169}, {392, 559, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 421, 256, 169: 560}, {161, 161, 161, 161, 161, 161, 161, 161, 161, 12: 161, 14: 161, 161, 161, 161, 161, 161, 161, 161, 161, 367, 365, 366, 113: 423, 154: 427, 163: 556}, {160, 160, 160, 160, 160, 160, 160, 160, 160, 12: 160, 14: 160, 160, 160, 160, 160, 160, 160, 160, 160, 367, 365, 366, 44: 553, 55: 160, 113: 514}, // 225 {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 554}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 13: 430, 52: 455, 55: 555, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {172, 9: 172, 172, 172, 13: 172, 23: 172, 172, 172, 27: 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 52: 172, 172, 57: 172, 172}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 557}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 13: 430, 52: 455, 55: 558, 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, // 230 {173, 9: 173, 173, 173, 13: 173, 23: 173, 173, 173, 27: 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 52: 173, 173, 57: 173, 173}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 521, 562}, {55: 561}, {174, 9: 174, 174, 174, 13: 174, 23: 174, 174, 174, 27: 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 52: 174, 174, 57: 174, 174}, {171, 9: 171, 171, 171, 13: 171, 23: 171, 171, 171, 27: 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 52: 171, 171, 57: 171, 171}, // 235 {23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 113: 339, 117: 358, 361, 357, 338, 124: 528, 340, 127: 337, 147: 564, 161: 565}, {10: 158}, {10: 154, 154}, {139, 10: 139, 139, 13: 139}, {10: 131, 23: 131, 131, 131, 27: 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 44: 131, 131, 131, 131, 131, 131, 131, 205: 568}, // 240 {10: 157, 23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 113: 339, 117: 358, 361, 357, 338, 124: 528, 340, 127: 337, 161: 527, 172: 525, 526, 199: 569}, {10: 570}, {130, 10: 130, 130, 13: 130}, {167, 412, 167, 10: 167, 167, 13: 167, 133: 572}, {166, 2: 166, 10: 166, 166, 13: 166}, // 245 {200, 200, 200, 9: 200, 200, 13: 200, 43: 200}, {198, 198, 198, 9: 198, 198, 13: 198, 43: 198}, {201, 201, 201, 9: 201, 201, 13: 201, 43: 201}, {260, 260, 3: 260, 260, 260, 260, 260, 260, 260, 260, 260, 13: 260, 26: 260, 43: 260, 51: 260, 260, 55: 260, 260, 59: 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 145, 145, 145, 27: 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 53: 582, 478, 114: 579, 123: 581, 155: 408, 162: 580}, // 250 {431, 293, 3: 293, 293, 293, 293, 435, 434, 293, 293, 293, 13: 430, 26: 293, 43: 293, 51: 293, 293, 55: 293, 432, 59: 293, 293, 293, 293, 293, 293, 293, 293, 293, 433, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293}, {10: 753, 483}, {10: 747}, {10: 746}, {104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 12: 104, 14: 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 44: 104, 104, 104, 104, 104, 104, 104, 53: 104, 57: 104, 104, 85: 104, 104, 104, 104, 104, 104, 104, 104, 104, 95: 104, 104, 206: 583}, // 255 {392, 397, 584, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 367, 365, 366, 100, 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 53: 582, 478, 57: 611, 377, 85: 607, 604, 609, 594, 608, 595, 605, 606, 602, 95: 610, 603, 113: 339, 585, 117: 358, 361, 357, 338, 601, 612, 588, 586, 340, 127: 337, 593, 589, 591, 592, 587, 134: 590, 600, 138: 336, 144: 599, 181: 597, 216: 598, 596}, {316, 316, 3: 316, 316, 316, 316, 316, 316, 316, 11: 316, 13: 316, 43: 744, 52: 316, 56: 316, 59: 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316}, {9: 251, 251, 483}, {165, 412, 165, 9: 238, 133: 713, 136: 712, 711, 171: 709, 196: 710, 708}, {114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 12: 114, 14: 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 44: 114, 114, 114, 114, 114, 114, 114, 53: 114, 57: 114, 114, 85: 114, 114, 114, 114, 114, 114, 114, 114, 114, 95: 114, 114, 112: 114}, // 260 {113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 12: 113, 14: 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 44: 113, 113, 113, 113, 113, 113, 113, 53: 113, 57: 113, 113, 85: 113, 113, 113, 113, 113, 113, 113, 113, 113, 95: 113, 113, 112: 113}, {112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 12: 112, 14: 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 44: 112, 112, 112, 112, 112, 112, 112, 53: 112, 57: 112, 112, 85: 112, 112, 112, 112, 112, 112, 112, 112, 112, 95: 112, 112, 112: 112}, {111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 12: 111, 14: 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 44: 111, 111, 111, 111, 111, 111, 111, 53: 111, 57: 111, 111, 85: 111, 111, 111, 111, 111, 111, 111, 111, 111, 95: 111, 111, 112: 111}, {110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 12: 110, 14: 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 44: 110, 110, 110, 110, 110, 110, 110, 53: 110, 57: 110, 110, 85: 110, 110, 110, 110, 110, 110, 110, 110, 110, 95: 110, 110, 112: 110}, {109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 12: 109, 14: 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 44: 109, 109, 109, 109, 109, 109, 109, 53: 109, 57: 109, 109, 85: 109, 109, 109, 109, 109, 109, 109, 109, 109, 95: 109, 109, 112: 109}, // 265 {108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 12: 108, 14: 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 44: 108, 108, 108, 108, 108, 108, 108, 53: 108, 57: 108, 108, 85: 108, 108, 108, 108, 108, 108, 108, 108, 108, 95: 108, 108, 112: 108}, {250, 250, 250, 250, 250, 250, 250, 250, 250, 12: 250, 14: 250, 250, 250, 250, 250, 250, 250, 250, 250, 145: 379, 705}, {43: 703}, {26: 702}, {102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 12: 102, 14: 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 44: 102, 102, 102, 102, 102, 102, 102, 53: 102, 57: 102, 102, 85: 102, 102, 102, 102, 102, 102, 102, 102, 102, 95: 102, 102}, // 270 {392, 397, 584, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 367, 365, 366, 99, 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 53: 582, 478, 57: 611, 377, 85: 607, 604, 609, 594, 608, 595, 605, 606, 602, 95: 610, 603, 113: 339, 585, 117: 358, 361, 357, 338, 601, 612, 588, 586, 340, 127: 337, 593, 589, 591, 592, 587, 134: 590, 600, 138: 336, 144: 599, 181: 701}, {98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 12: 98, 14: 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 44: 98, 98, 98, 98, 98, 98, 98, 53: 98, 57: 98, 98, 85: 98, 98, 98, 98, 98, 98, 98, 98, 98, 95: 98, 98}, {97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 12: 97, 14: 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 44: 97, 97, 97, 97, 97, 97, 97, 53: 97, 57: 97, 97, 85: 97, 97, 97, 97, 97, 97, 97, 97, 97, 95: 97, 97}, {9: 700}, {694}, // 275 {690}, {686}, {392, 397, 584, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 582, 478, 57: 611, 85: 607, 604, 609, 594, 608, 595, 605, 606, 602, 95: 610, 603, 114: 585, 121: 601, 612, 588, 128: 593, 589, 591, 592, 587, 134: 590, 680}, {666}, {392, 397, 662, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 663}, // 280 {9: 661}, {9: 660}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 478, 114: 585, 121: 658}, {60, 23: 614, 85: 60, 203: 613}, {51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 12: 51, 14: 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 44: 51, 51, 51, 51, 51, 51, 51, 53: 51, 57: 51, 51, 85: 51, 51, 51, 51, 51, 51, 51, 51, 51, 95: 51, 51, 112: 51}, // 285 {615, 85: 616}, {59, 85: 59}, {12: 618, 164: 643}, {617}, {12: 618, 164: 619}, // 290 {10: 63, 12: 63, 43: 63}, {12: 620, 43: 621}, {10: 62, 12: 62, 43: 62}, {43: 622}, {12: 55, 626, 149: 624, 623, 157: 625}, // 295 {12: 639}, {10: 57, 57, 43: 57}, {11: 629, 43: 630}, {2: 627}, {55: 628}, // 300 {12: 54}, {12: 55, 626, 149: 638, 623}, {12: 631, 182: 632}, {10: 53, 53, 43: 53}, {11: 633, 43: 634}, // 305 {12: 637}, {2: 543, 170: 635}, {10: 636, 545}, {47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 12: 47, 14: 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 44: 47, 47, 47, 47, 47, 47, 47, 53: 47, 57: 47, 47, 85: 47, 47, 47, 47, 47, 47, 47, 47, 47, 95: 47, 47, 112: 47}, {10: 52, 52, 43: 52}, // 310 {10: 56, 56, 43: 56}, {640}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 641}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 10: 642, 13: 430, 52: 455, 56: 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {10: 58, 58, 43: 58}, // 315 {10: 644, 12: 620, 43: 645}, {61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 12: 61, 14: 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 44: 61, 61, 61, 61, 61, 61, 61, 53: 61, 57: 61, 61, 85: 61, 61, 61, 61, 61, 61, 61, 61, 61, 95: 61, 61, 112: 61}, {10: 647, 12: 55, 626, 43: 648, 149: 624, 623, 157: 646}, {10: 651, 629, 43: 652}, {46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 12: 46, 14: 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 44: 46, 46, 46, 46, 46, 46, 46, 53: 46, 57: 46, 46, 85: 46, 46, 46, 46, 46, 46, 46, 46, 46, 95: 46, 46, 112: 46}, // 320 {12: 55, 626, 149: 624, 623, 157: 649}, {10: 650, 629}, {45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 12: 45, 14: 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 44: 45, 45, 45, 45, 45, 45, 45, 53: 45, 57: 45, 45, 85: 45, 45, 45, 45, 45, 45, 45, 45, 45, 95: 45, 45, 112: 45}, {50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 12: 50, 14: 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 44: 50, 50, 50, 50, 50, 50, 50, 53: 50, 57: 50, 50, 85: 50, 50, 50, 50, 50, 50, 50, 50, 50, 95: 50, 50, 112: 50}, {12: 55, 626, 149: 624, 623, 157: 653}, // 325 {10: 654, 629, 43: 655}, {49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 12: 49, 14: 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 44: 49, 49, 49, 49, 49, 49, 49, 53: 49, 57: 49, 49, 85: 49, 49, 49, 49, 49, 49, 49, 49, 49, 95: 49, 49, 112: 49}, {12: 631, 182: 656}, {10: 657, 633}, {48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 12: 48, 14: 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 44: 48, 48, 48, 48, 48, 48, 48, 53: 48, 57: 48, 48, 85: 48, 48, 48, 48, 48, 48, 48, 48, 48, 95: 48, 48, 112: 48}, // 330 {9: 659}, {85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 12: 85, 14: 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 44: 85, 85, 85, 85, 85, 85, 85, 53: 85, 57: 85, 85, 85: 85, 85, 85, 85, 85, 85, 85, 85, 85, 95: 85, 85, 112: 85}, {86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 12: 86, 14: 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 44: 86, 86, 86, 86, 86, 86, 86, 53: 86, 57: 86, 86, 85: 86, 86, 86, 86, 86, 86, 86, 86, 86, 95: 86, 86, 112: 86}, {87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 12: 87, 14: 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 44: 87, 87, 87, 87, 87, 87, 87, 53: 87, 57: 87, 87, 85: 87, 87, 87, 87, 87, 87, 87, 87, 87, 95: 87, 87, 112: 87}, {316, 316, 3: 316, 316, 316, 316, 316, 316, 665, 13: 316, 52: 316, 56: 316, 59: 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316}, // 335 {431, 436, 3: 449, 439, 440, 452, 435, 434, 664, 13: 430, 52: 455, 56: 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 12: 84, 14: 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 44: 84, 84, 84, 84, 84, 84, 84, 53: 84, 57: 84, 84, 85: 84, 84, 84, 84, 84, 84, 84, 84, 84, 95: 84, 84, 112: 84}, {88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 12: 88, 14: 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 44: 88, 88, 88, 88, 88, 88, 88, 53: 88, 57: 88, 88, 85: 88, 88, 88, 88, 88, 88, 88, 88, 88, 95: 88, 88, 112: 88}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 54: 478, 58: 377, 113: 339, 585, 117: 358, 361, 357, 338, 667, 124: 586, 340, 127: 337, 138: 336, 144: 668}, {9: 674}, // 340 {392, 397, 385, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 478, 114: 585, 121: 669}, {9: 670}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 10: 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 478, 114: 585, 121: 671}, {10: 672}, {392, 397, 584, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 582, 478, 57: 611, 85: 607, 604, 609, 594, 608, 595, 605, 606, 602, 95: 610, 603, 114: 585, 121: 601, 612, 588, 128: 593, 589, 591, 592, 587, 134: 590, 673}, // 345 {89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 12: 89, 14: 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 44: 89, 89, 89, 89, 89, 89, 89, 53: 89, 57: 89, 89, 85: 89, 89, 89, 89, 89, 89, 89, 89, 89, 95: 89, 89, 112: 89}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 478, 114: 585, 121: 675}, {9: 676}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 10: 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 478, 114: 585, 121: 677}, {10: 678}, // 350 {392, 397, 584, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 582, 478, 57: 611, 85: 607, 604, 609, 594, 608, 595, 605, 606, 602, 95: 610, 603, 114: 585, 121: 601, 612, 588, 128: 593, 589, 591, 592, 587, 134: 590, 679}, {90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 12: 90, 14: 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 44: 90, 90, 90, 90, 90, 90, 90, 53: 90, 57: 90, 90, 85: 90, 90, 90, 90, 90, 90, 90, 90, 90, 95: 90, 90, 112: 90}, {86: 681}, {682}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 478, 114: 683}, // 355 {10: 684, 483}, {9: 685}, {91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 12: 91, 14: 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 44: 91, 91, 91, 91, 91, 91, 91, 53: 91, 57: 91, 91, 85: 91, 91, 91, 91, 91, 91, 91, 91, 91, 95: 91, 91, 112: 91}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 478, 114: 687}, {10: 688, 483}, // 360 {392, 397, 584, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 582, 478, 57: 611, 85: 607, 604, 609, 594, 608, 595, 605, 606, 602, 95: 610, 603, 114: 585, 121: 601, 612, 588, 128: 593, 589, 591, 592, 587, 134: 590, 689}, {92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 12: 92, 14: 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 44: 92, 92, 92, 92, 92, 92, 92, 53: 92, 57: 92, 92, 85: 92, 92, 92, 92, 92, 92, 92, 92, 92, 95: 92, 92, 112: 92}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 478, 114: 691}, {10: 692, 483}, {392, 397, 584, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 582, 478, 57: 611, 85: 607, 604, 609, 594, 608, 595, 605, 606, 602, 95: 610, 603, 114: 585, 121: 601, 612, 588, 128: 593, 589, 591, 592, 587, 134: 590, 693}, // 365 {93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 12: 93, 14: 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 44: 93, 93, 93, 93, 93, 93, 93, 53: 93, 57: 93, 93, 85: 93, 93, 93, 93, 93, 93, 93, 93, 93, 95: 93, 93, 112: 93}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 54: 478, 114: 695}, {10: 696, 483}, {392, 397, 584, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 582, 478, 57: 611, 85: 607, 604, 609, 594, 608, 595, 605, 606, 602, 95: 610, 603, 114: 585, 121: 601, 612, 588, 128: 593, 589, 591, 592, 587, 134: 590, 697}, {95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 12: 95, 14: 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 44: 95, 95, 95, 95, 95, 95, 95, 53: 95, 57: 95, 95, 85: 95, 95, 95, 95, 95, 95, 95, 95, 95, 95: 95, 95, 112: 698}, // 370 {392, 397, 584, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 582, 478, 57: 611, 85: 607, 604, 609, 594, 608, 595, 605, 606, 602, 95: 610, 603, 114: 585, 121: 601, 612, 588, 128: 593, 589, 591, 592, 587, 134: 590, 699}, {94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 12: 94, 14: 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 44: 94, 94, 94, 94, 94, 94, 94, 53: 94, 57: 94, 94, 85: 94, 94, 94, 94, 94, 94, 94, 94, 94, 95: 94, 94, 112: 94}, {96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 12: 96, 14: 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 44: 96, 96, 96, 96, 96, 96, 96, 53: 96, 57: 96, 96, 85: 96, 96, 96, 96, 96, 96, 96, 96, 96, 95: 96, 96, 112: 96}, {101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 12: 101, 14: 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 44: 101, 101, 101, 101, 101, 101, 101, 53: 101, 57: 101, 101, 85: 101, 101, 101, 101, 101, 101, 101, 101, 101, 95: 101, 101}, {103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 12: 103, 14: 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 44: 103, 103, 103, 103, 103, 103, 103, 103, 53: 103, 57: 103, 103, 85: 103, 103, 103, 103, 103, 103, 103, 103, 103, 95: 103, 103, 112: 103}, // 375 {392, 397, 584, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 582, 478, 57: 611, 85: 607, 604, 609, 594, 608, 595, 605, 606, 602, 95: 610, 603, 114: 585, 121: 601, 612, 588, 128: 593, 589, 591, 592, 587, 134: 590, 704}, {105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 12: 105, 14: 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 44: 105, 105, 105, 105, 105, 105, 105, 53: 105, 57: 105, 105, 85: 105, 105, 105, 105, 105, 105, 105, 105, 105, 95: 105, 105, 112: 105}, {43: 706}, {392, 397, 584, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 582, 478, 57: 611, 85: 607, 604, 609, 594, 608, 595, 605, 606, 602, 95: 610, 603, 114: 585, 121: 601, 612, 588, 128: 593, 589, 591, 592, 587, 134: 590, 707}, {106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 12: 106, 14: 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 44: 106, 106, 106, 106, 106, 106, 106, 53: 106, 57: 106, 106, 85: 106, 106, 106, 106, 106, 106, 106, 106, 106, 95: 106, 106, 112: 106}, // 380 {9: 743}, {9: 240, 11: 240}, {9: 237, 11: 741}, {9: 236, 11: 236, 52: 235, 179: 715}, {714, 2: 535, 187: 534}, // 385 {164, 2: 164}, {165, 412, 165, 133: 713, 136: 712, 537}, {52: 716}, {392, 397, 717, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 720, 718, 160: 719}, {316, 316, 3: 316, 316, 316, 316, 316, 316, 316, 11: 316, 13: 316, 26: 316, 43: 739, 52: 316, 56: 316, 59: 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316}, // 390 {431, 436, 3: 449, 439, 440, 452, 435, 434, 127, 11: 127, 13: 430, 26: 127, 52: 455, 56: 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {9: 234, 11: 234}, {120, 120, 120, 120, 120, 120, 120, 120, 120, 11: 122, 120, 726, 120, 120, 120, 120, 120, 120, 120, 120, 120, 26: 122, 53: 120, 56: 727, 159: 725, 166: 724, 722, 723, 198: 721}, {11: 734, 26: 193, 165: 735}, {392, 397, 717, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 720, 718, 160: 733}, // 395 {13: 726, 52: 731, 56: 727, 159: 732}, {119, 119, 119, 119, 119, 119, 119, 119, 119, 12: 119, 14: 119, 119, 119, 119, 119, 119, 119, 119, 119, 53: 119}, {13: 118, 52: 118, 56: 118}, {250, 250, 250, 250, 250, 250, 250, 250, 250, 12: 250, 14: 250, 250, 250, 250, 250, 250, 250, 250, 250, 145: 379, 729}, {2: 728}, // 400 {13: 115, 52: 115, 56: 115}, {55: 730}, {13: 116, 52: 116, 56: 116}, {121, 121, 121, 121, 121, 121, 121, 121, 121, 12: 121, 14: 121, 121, 121, 121, 121, 121, 121, 121, 121, 53: 121}, {13: 117, 52: 117, 56: 117}, // 405 {11: 124, 26: 124}, {120, 120, 120, 120, 120, 120, 120, 120, 120, 12: 120, 726, 120, 120, 120, 120, 120, 120, 120, 120, 120, 26: 192, 53: 120, 56: 727, 159: 725, 166: 724, 737, 723}, {26: 736}, {9: 126, 11: 126, 26: 126}, {392, 397, 717, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 720, 718, 160: 738}, // 410 {11: 123, 26: 123}, {392, 397, 717, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 720, 718, 160: 740}, {9: 125, 11: 125, 26: 125}, {165, 412, 165, 133: 713, 136: 712, 711, 171: 742}, {9: 239, 11: 239}, // 415 {248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 12: 248, 14: 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 44: 248, 248, 248, 248, 248, 248, 248, 248, 53: 248, 57: 248, 248, 85: 248, 248, 248, 248, 248, 248, 248, 248, 248, 95: 248, 248}, {392, 397, 584, 396, 398, 399, 404, 395, 394, 252, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 582, 478, 57: 611, 85: 607, 604, 609, 594, 608, 595, 605, 606, 602, 95: 610, 603, 114: 585, 121: 601, 612, 588, 128: 593, 589, 591, 592, 587, 134: 590, 745}, {107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 12: 107, 14: 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 44: 107, 107, 107, 107, 107, 107, 107, 53: 107, 57: 107, 107, 85: 107, 107, 107, 107, 107, 107, 107, 107, 107, 95: 107, 107, 112: 107}, {259, 259, 3: 259, 259, 259, 259, 259, 259, 259, 259, 259, 13: 259, 26: 259, 43: 259, 51: 259, 259, 55: 259, 259, 59: 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259}, {392, 292, 385, 292, 292, 292, 292, 395, 394, 292, 292, 292, 391, 292, 401, 400, 403, 386, 387, 388, 389, 390, 402, 26: 292, 43: 292, 51: 292, 292, 749, 748, 292, 292, 59: 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292}, // 420 {431, 291, 3: 291, 291, 291, 291, 435, 434, 291, 291, 291, 13: 430, 26: 291, 43: 291, 51: 291, 291, 55: 291, 432, 59: 291, 291, 291, 291, 291, 291, 291, 291, 291, 433, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291}, {120, 120, 120, 120, 120, 120, 120, 120, 120, 11: 122, 120, 726, 120, 120, 120, 120, 120, 120, 120, 120, 120, 26: 122, 53: 120, 56: 727, 159: 725, 166: 724, 722, 723, 198: 750}, {11: 734, 26: 193, 165: 751}, {26: 752}, {302, 302, 3: 302, 302, 302, 302, 302, 302, 302, 302, 302, 13: 302, 26: 302, 43: 302, 51: 302, 302, 55: 302, 302, 59: 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302}, // 425 {309, 309, 3: 309, 309, 309, 309, 309, 309, 309, 309, 309, 13: 309, 26: 309, 43: 309, 51: 309, 309, 55: 309, 309, 59: 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309}, {431, 294, 3: 294, 294, 294, 294, 435, 434, 294, 294, 294, 13: 430, 26: 294, 43: 294, 51: 294, 294, 55: 294, 432, 59: 294, 294, 294, 294, 294, 294, 294, 294, 294, 433, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294}, {431, 295, 3: 295, 295, 295, 295, 435, 434, 295, 295, 295, 13: 430, 26: 295, 43: 295, 51: 295, 295, 55: 295, 432, 59: 295, 295, 295, 295, 295, 295, 295, 295, 295, 433, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295}, {431, 296, 3: 296, 296, 296, 296, 435, 434, 296, 296, 296, 13: 430, 26: 296, 43: 296, 51: 296, 296, 55: 296, 432, 59: 296, 296, 296, 296, 296, 296, 296, 296, 296, 433, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296}, {431, 297, 3: 297, 297, 297, 297, 435, 434, 297, 297, 297, 13: 430, 26: 297, 43: 297, 51: 297, 297, 55: 297, 432, 59: 297, 297, 297, 297, 297, 297, 297, 297, 297, 433, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297}, // 430 {431, 299, 3: 299, 299, 299, 299, 435, 434, 299, 299, 299, 13: 430, 26: 299, 43: 299, 51: 299, 299, 55: 299, 432, 59: 299, 299, 299, 299, 299, 299, 299, 299, 299, 433, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299}, {431, 300, 3: 300, 300, 300, 300, 435, 434, 300, 300, 300, 13: 430, 26: 300, 43: 300, 51: 300, 300, 55: 300, 432, 59: 300, 300, 300, 300, 300, 300, 300, 300, 300, 433, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300}, {431, 301, 3: 301, 301, 301, 301, 435, 434, 301, 301, 301, 13: 430, 26: 301, 43: 301, 51: 301, 301, 55: 301, 432, 59: 301, 301, 301, 301, 301, 301, 301, 301, 301, 433, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301}, {10: 762}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 53: 749, 748}, // 435 {764}, {12: 618, 164: 765}, {10: 644, 12: 620}, {23: 65, 65, 65, 27: 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 44: 65, 65, 65, 65, 65, 65, 65, 53: 66, 57: 66, 65, 178: 768, 183: 767}, {53: 74, 57: 74, 208: 772}, // 440 {23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 58: 377, 113: 339, 117: 358, 361, 357, 338, 124: 586, 340, 127: 337, 138: 336, 144: 769, 219: 770}, {23: 68, 68, 68, 27: 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 44: 68, 68, 68, 68, 68, 68, 68, 53: 68, 57: 68, 68}, {23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 44: 343, 344, 342, 368, 369, 345, 341, 53: 64, 57: 64, 377, 113: 339, 117: 358, 361, 357, 338, 124: 586, 340, 127: 337, 138: 336, 144: 771}, {23: 67, 67, 67, 27: 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 44: 67, 67, 67, 67, 67, 67, 67, 53: 67, 57: 67, 67}, {53: 72, 57: 70, 176: 774, 775, 192: 773}, // 445 {73, 73, 73, 9: 73, 23: 73, 73, 73, 27: 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 44: 73, 73, 73, 73, 73, 73, 73, 73, 57: 73, 73}, {53: 582, 123: 778}, {57: 611, 122: 612, 128: 776}, {9: 777}, {69, 69, 69, 9: 69, 23: 69, 69, 69, 27: 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 44: 69, 69, 69, 69, 69, 69, 69, 69, 57: 69, 69}, // 450 {71, 71, 71, 9: 71, 23: 71, 71, 71, 27: 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 44: 71, 71, 71, 71, 71, 71, 71, 71, 57: 71, 71}, {79, 79, 79, 9: 79, 23: 79, 79, 79, 27: 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 44: 79, 79, 79, 79, 79, 79, 79, 79, 57: 79, 79}, {53: 191, 212: 782}, {189, 189, 189, 9: 189, 189, 189, 13: 189, 23: 189, 189, 189, 27: 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 53: 146}, {53: 783}, // 455 {2: 784, 189: 787, 786, 225: 785}, {11: 321, 26: 321, 52: 321}, {11: 790, 26: 193, 165: 791}, {11: 188, 26: 188}, {11: 186, 26: 186, 52: 788}, // 460 {250, 250, 250, 250, 250, 250, 250, 250, 250, 12: 250, 14: 250, 250, 250, 250, 250, 250, 250, 250, 250, 145: 379, 789}, {11: 185, 26: 185}, {2: 784, 26: 192, 189: 787, 793}, {26: 792}, {190, 190, 190, 9: 190, 190, 190, 13: 190, 23: 190, 190, 190, 27: 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190}, // 465 {11: 187, 26: 187}, {53: 796}, {210, 210, 210, 9: 210, 210, 210, 13: 210, 23: 210, 210, 210, 27: 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 53: 146}, {23: 212, 212, 212, 798, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 58: 212, 211: 797}, {23: 367, 365, 366, 27: 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 58: 377, 113: 410, 117: 358, 361, 357, 409, 138: 802, 153: 801, 201: 800, 230: 799}, // 470 {209, 209, 209, 9: 209, 209, 209, 13: 209, 23: 209, 209, 209, 27: 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209}, {23: 367, 365, 366, 813, 355, 347, 356, 352, 364, 351, 349, 350, 348, 353, 362, 359, 360, 363, 354, 346, 58: 377, 113: 410, 117: 358, 361, 357, 409, 138: 802, 153: 801, 201: 814}, {23: 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 58: 206}, {165, 412, 165, 9: 804, 43: 178, 133: 713, 136: 712, 806, 184: 807, 202: 805, 231: 803}, {23: 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 58: 202}, // 475 {9: 810, 11: 811}, {23: 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 58: 203}, {9: 197, 11: 197}, {9: 195, 11: 195, 43: 177}, {43: 808}, // 480 {250, 250, 250, 250, 250, 250, 250, 250, 250, 12: 250, 14: 250, 250, 250, 250, 250, 250, 250, 250, 250, 145: 379, 809}, {9: 194, 11: 194}, {23: 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 58: 204}, {165, 412, 165, 43: 178, 133: 713, 136: 712, 806, 184: 807, 202: 812}, {9: 196, 11: 196}, // 485 {211, 211, 211, 9: 211, 211, 211, 13: 211, 23: 211, 211, 211, 27: 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211}, {23: 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 58: 205}, {392, 397, 385, 396, 398, 399, 404, 395, 394, 12: 391, 14: 401, 400, 403, 386, 387, 388, 389, 390, 402, 145, 145, 145, 27: 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 54: 816, 155: 408, 162: 817}, {431, 436, 3: 449, 439, 440, 452, 435, 434, 10: 819, 13: 430, 52: 455, 56: 432, 59: 438, 437, 443, 444, 454, 450, 451, 459, 463, 433, 457, 447, 446, 445, 441, 461, 458, 456, 448, 465, 453, 442, 462, 460, 464}, {10: 818}, // 490 {213, 213, 213, 9: 213, 213, 213, 13: 213, 23: 213, 213, 213, 27: 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213}, {214, 214, 214, 9: 214, 214, 214, 13: 214, 23: 214, 214, 214, 27: 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214}, {243, 243, 243, 9: 243, 243, 243, 13: 243}, {241, 241, 241, 9: 241, 241, 241, 13: 241}, {244, 244, 244, 9: 244, 244, 244, 13: 244}, // 495 {245, 245, 245, 9: 245, 245, 245, 13: 245}, {246, 246, 246, 9: 246, 246, 246, 13: 246}, {9: 236, 11: 236, 23: 65, 65, 65, 27: 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 44: 65, 65, 65, 65, 65, 65, 65, 52: 235, 66, 57: 66, 65, 178: 768, 715, 183: 826}, {53: 77, 57: 77, 207: 827}, {53: 72, 57: 70, 176: 774, 775, 192: 828}, // 500 {76, 76, 76, 9: 76, 23: 76, 76, 76, 27: 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 44: 76, 76, 76, 76, 76, 76, 76, 76, 57: 76, 76}, {82, 82, 82, 9: 82, 23: 82, 82, 82, 27: 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 44: 82, 82, 82, 82, 82, 82, 82, 82, 57: 82, 82}, {250, 250, 250, 250, 250, 250, 250, 250, 250, 12: 250, 14: 250, 250, 250, 250, 250, 250, 250, 250, 250, 145: 379, 831}, {51: 324}, {84: 854, 94: 856, 100: 844, 845, 846, 841, 842, 843, 847, 851, 848, 838, 849, 850, 115: 855, 853, 126: 852, 139: 836, 835, 840, 837, 839, 148: 834, 228: 833}, // 505 {51: 326}, {51: 43, 84: 854, 94: 856, 100: 844, 845, 846, 841, 842, 843, 847, 851, 848, 838, 849, 850, 115: 855, 853, 126: 852, 139: 836, 894, 840, 837, 839}, {51: 42, 84: 42, 94: 42, 97: 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42}, {51: 38, 84: 38, 94: 38, 97: 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38}, {51: 37, 84: 37, 94: 37, 97: 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37}, // 510 {94: 856, 115: 916, 853}, {51: 35, 84: 35, 94: 35, 97: 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35}, {97: 28, 28, 904, 188: 902, 220: 903, 901}, {94: 856, 115: 898, 853}, {2: 895}, // 515 {2: 890}, {2: 871, 84: 873, 226: 872}, {84: 854, 94: 856, 115: 855, 853, 126: 870}, {51: 16, 84: 16, 94: 16, 97: 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}, {94: 856, 115: 868, 853}, // 520 {94: 856, 115: 866, 853}, {84: 854, 94: 856, 115: 855, 853, 126: 865}, {2: 861}, {94: 856, 115: 859, 853}, {51: 7, 84: 7, 94: 7, 97: 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}, // 525 {84: 5, 94: 858}, {51: 4, 84: 4, 94: 4, 97: 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, {84: 857}, {84: 2, 94: 2}, {51: 3, 84: 3, 94: 3, 97: 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}, // 530 {84: 1, 94: 1}, {84: 860}, {51: 8, 84: 8, 94: 8, 97: 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8}, {84: 862, 94: 856, 115: 863, 853}, {51: 12, 84: 12, 94: 12, 97: 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12}, // 535 {84: 864}, {51: 9, 84: 9, 94: 9, 97: 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9}, {51: 13, 84: 13, 94: 13, 97: 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13}, {84: 867}, {51: 14, 84: 14, 94: 14, 97: 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14}, // 540 {84: 869}, {51: 15, 84: 15, 94: 15, 97: 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15}, {51: 17, 84: 17, 94: 17, 97: 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17}, {84: 854, 94: 856, 115: 855, 853, 126: 879, 152: 889}, {2: 543, 10: 149, 147: 875, 170: 874, 194: 876}, // 545 {51: 10, 84: 10, 94: 10, 97: 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, {10: 148, 882, 147: 883}, {10: 880}, {10: 877}, {84: 854, 94: 856, 115: 855, 853, 126: 879, 152: 878}, // 550 {51: 18, 84: 18, 94: 18, 97: 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18}, {51: 6, 84: 6, 94: 6, 97: 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6}, {84: 854, 94: 856, 115: 855, 853, 126: 879, 152: 881}, {51: 20, 84: 20, 94: 20, 97: 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20}, {2: 546, 147: 886}, // 555 {10: 884}, {84: 854, 94: 856, 115: 855, 853, 126: 879, 152: 885}, {51: 11, 84: 11, 94: 11, 97: 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, {10: 887}, {84: 854, 94: 856, 115: 855, 853, 126: 879, 152: 888}, // 560 {51: 19, 84: 19, 94: 19, 97: 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19}, {51: 21, 84: 21, 94: 21, 97: 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21}, {84: 891}, {84: 854, 94: 856, 97: 40, 40, 40, 844, 845, 846, 841, 842, 843, 847, 851, 848, 838, 849, 850, 115: 855, 853, 126: 852, 139: 836, 835, 840, 837, 839, 148: 892, 151: 893}, {84: 854, 94: 856, 97: 39, 39, 39, 844, 845, 846, 841, 842, 843, 847, 851, 848, 838, 849, 850, 115: 855, 853, 126: 852, 139: 836, 894, 840, 837, 839}, // 565 {97: 31, 31, 31}, {51: 41, 84: 41, 94: 41, 97: 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41}, {84: 896}, {84: 854, 94: 856, 97: 40, 40, 40, 844, 845, 846, 841, 842, 843, 847, 851, 848, 838, 849, 850, 115: 855, 853, 126: 852, 139: 836, 835, 840, 837, 839, 148: 892, 151: 897}, {97: 32, 32, 32}, // 570 {84: 899}, {84: 854, 94: 856, 97: 40, 40, 40, 844, 845, 846, 841, 842, 843, 847, 851, 848, 838, 849, 850, 115: 855, 853, 126: 852, 139: 836, 835, 840, 837, 839, 148: 892, 151: 900}, {97: 33, 33, 33}, {97: 24, 910, 222: 911, 909}, {97: 30, 30, 30}, // 575 {97: 27, 27, 904, 188: 908}, {94: 856, 115: 905, 853}, {84: 906}, {84: 854, 94: 856, 97: 40, 40, 40, 844, 845, 846, 841, 842, 843, 847, 851, 848, 838, 849, 850, 115: 855, 853, 126: 852, 139: 836, 835, 840, 837, 839, 148: 892, 151: 907}, {97: 26, 26, 26}, // 580 {97: 29, 29, 29}, {97: 915, 224: 914}, {84: 912}, {97: 23}, {84: 854, 94: 856, 97: 40, 100: 844, 845, 846, 841, 842, 843, 847, 851, 848, 838, 849, 850, 115: 855, 853, 126: 852, 139: 836, 835, 840, 837, 839, 148: 892, 151: 913}, // 585 {97: 25}, {51: 34, 84: 34, 94: 34, 97: 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34}, {51: 22, 84: 22, 94: 22, 97: 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22}, {84: 917}, {51: 36, 84: 36, 94: 36, 97: 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36}, } ) var yyDebug = 0 type yyLexer interface { Lex(lval *yySymType) int Error(s string) } type yyLexerEx interface { yyLexer Reduced(rule, state int, lval *yySymType) bool } func yySymName(c int) (s string) { x, ok := yyXLAT[c] if ok { return yySymNames[x] } if c < 0x7f { return __yyfmt__.Sprintf("'%c'", c) } return __yyfmt__.Sprintf("%d", c) } func yylex1(yylex yyLexer, lval *yySymType) (n int) { n = yylex.Lex(lval) if n <= 0 { n = yyEofCode } if yyDebug >= 3 { __yyfmt__.Printf("\nlex %s(%#x %d), PrettyString(lval.Token): %v\n", yySymName(n), n, n, PrettyString(lval.Token)) } return n } func yyParse(yylex yyLexer) int { const yyError = 236 yyEx, _ := yylex.(yyLexerEx) var yyn int var yylval yySymType var yyVAL yySymType yyS := make([]yySymType, 200) Nerrs := 0 /* number of errors */ Errflag := 0 /* error recovery flag */ yyerrok := func() { if yyDebug >= 2 { __yyfmt__.Printf("yyerrok()\n") } Errflag = 0 } _ = yyerrok yystate := 0 yychar := -1 var yyxchar int var yyshift int yyp := -1 goto yystack ret0: return 0 ret1: return 1 yystack: /* put a state and value onto the stack */ yyp++ if yyp >= len(yyS) { nyys := make([]yySymType, len(yyS)*2) copy(nyys, yyS) yyS = nyys } yyS[yyp] = yyVAL yyS[yyp].yys = yystate yynewstate: if yychar < 0 { yylval.yys = yystate yychar = yylex1(yylex, &yylval) var ok bool if yyxchar, ok = yyXLAT[yychar]; !ok { yyxchar = len(yySymNames) // > tab width } } if yyDebug >= 4 { var a []int for _, v := range yyS[:yyp+1] { a = append(a, v.yys) } __yyfmt__.Printf("state stack %v\n", a) } row := yyParseTab[yystate] yyn = 0 if yyxchar < len(row) { if yyn = int(row[yyxchar]); yyn != 0 { yyn += yyTabOfs } } switch { case yyn > 0: // shift yychar = -1 yyVAL = yylval yystate = yyn yyshift = yyn if yyDebug >= 2 { __yyfmt__.Printf("shift, and goto state %d\n", yystate) } if Errflag > 0 { Errflag-- } goto yystack case yyn < 0: // reduce case yystate == 1: // accept if yyDebug >= 2 { __yyfmt__.Println("accept") } goto ret0 } if yyn == 0 { /* error ... attempt to resume parsing */ switch Errflag { case 0: /* brand new error */ if yyDebug >= 1 { __yyfmt__.Printf("no action for %s in state %d\n", yySymName(yychar), yystate) } msg, ok := yyXErrors[yyXError{yystate, yyxchar}] if !ok { msg, ok = yyXErrors[yyXError{yystate, -1}] } if !ok && yyshift != 0 { msg, ok = yyXErrors[yyXError{yyshift, yyxchar}] } if !ok { msg, ok = yyXErrors[yyXError{yyshift, -1}] } if yychar > 0 { ls := yyTokenLiteralStrings[yychar] if ls == "" { ls = yySymName(yychar) } if ls != "" { switch { case msg == "": msg = __yyfmt__.Sprintf("unexpected %s", ls) default: msg = __yyfmt__.Sprintf("unexpected %s, %s", ls, msg) } } } if msg == "" { msg = "syntax error" } yylex.Error(msg) Nerrs++ fallthrough case 1, 2: /* incompletely recovered error ... try again */ Errflag = 3 /* find a state where "error" is a legal shift action */ for yyp >= 0 { row := yyParseTab[yyS[yyp].yys] if yyError < len(row) { yyn = int(row[yyError]) + yyTabOfs if yyn > 0 { // hit if yyDebug >= 2 { __yyfmt__.Printf("error recovery found error shift in state %d\n", yyS[yyp].yys) } yystate = yyn /* simulate a shift of "error" */ goto yystack } } /* the current p has no shift on "error", pop stack */ if yyDebug >= 2 { __yyfmt__.Printf("error recovery pops state %d\n", yyS[yyp].yys) } yyp-- } /* there is no state on the stack with an error shift ... abort */ if yyDebug >= 2 { __yyfmt__.Printf("error recovery failed\n") } goto ret1 case 3: /* no shift yet; clobber input char */ if yyDebug >= 2 { __yyfmt__.Printf("error recovery discards %s\n", yySymName(yychar)) } if yychar == yyEofCode { goto ret1 } yychar = -1 goto yynewstate /* try again in the same state */ } } r := -yyn x0 := yyReductions[r] x, n := x0.xsym, x0.components yypt := yyp _ = yypt // guard against "declared and not used" yyp -= n if yyp+1 >= len(yyS) { nyys := make([]yySymType, len(yyS)*2) copy(nyys, yyS) yyS = nyys } yyVAL = yyS[yyp+1] /* consult goto table to find next state */ exState := yystate yystate = int(yyParseTab[yyS[yyp].yys][x]) + yyTabOfs /* reduction by production r */ if yyDebug >= 2 { __yyfmt__.Printf("reduce using rule %v (%s), and goto state %d\n", r, yySymNames[x], yystate) } switch r { case 1: { lx := yylex.(*lexer) lx.preprocessingFile = nil } case 2: { lx := yylex.(*lexer) lx.preprocessingFile = yyS[yypt-0].node.(*PreprocessingFile) } case 3: { lx := yylex.(*lexer) lx.constantExpression = nil } case 4: { lx := yylex.(*lexer) lx.constantExpression = yyS[yypt-0].node.(*ConstantExpression) } case 5: { lx := yylex.(*lexer) lx.translationUnit = nil } case 6: { lx := yylex.(*lexer) if lx.report.Errors(false) == nil && lx.scope.kind != ScopeFile { panic("internal error") } lx.translationUnit = yyS[yypt-0].node.(*TranslationUnit).reverse() lx.translationUnit.Declarations = lx.scope } case 7: { yyVAL.node = &EnumerationConstant{ Token: yyS[yypt-0].Token, } } case 8: { yyVAL.node = &ArgumentExpressionList{ Expression: yyS[yypt-0].node.(*Expression), } } case 9: { yyVAL.node = &ArgumentExpressionList{ Case: 1, ArgumentExpressionList: yyS[yypt-2].node.(*ArgumentExpressionList), Token: yyS[yypt-1].Token, Expression: yyS[yypt-0].node.(*Expression), } } case 10: { yyVAL.node = (*ArgumentExpressionListOpt)(nil) } case 11: { yyVAL.node = &ArgumentExpressionListOpt{ ArgumentExpressionList: yyS[yypt-0].node.(*ArgumentExpressionList).reverse(), } } case 12: { lx := yylex.(*lexer) lhs := &Expression{ Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.scope = lx.scope } case 13: { yyVAL.node = &Expression{ Case: 1, Token: yyS[yypt-0].Token, } } case 14: { yyVAL.node = &Expression{ Case: 2, Token: yyS[yypt-0].Token, } } case 15: { yyVAL.node = &Expression{ Case: 3, Token: yyS[yypt-0].Token, } } case 16: { yyVAL.node = &Expression{ Case: 4, Token: yyS[yypt-0].Token, } } case 17: { yyVAL.node = &Expression{ Case: 5, Token: yyS[yypt-0].Token, } } case 18: { yyVAL.node = &Expression{ Case: 6, Token: yyS[yypt-0].Token, } } case 19: { yyVAL.node = &Expression{ Case: 7, Token: yyS[yypt-2].Token, ExpressionList: yyS[yypt-1].node.(*ExpressionList).reverse(), Token2: yyS[yypt-0].Token, } } case 20: { yyVAL.node = &Expression{ Case: 8, Expression: yyS[yypt-3].node.(*Expression), Token: yyS[yypt-2].Token, ExpressionList: yyS[yypt-1].node.(*ExpressionList).reverse(), Token2: yyS[yypt-0].Token, } } case 21: { lx := yylex.(*lexer) lhs := &Expression{ Case: 9, Expression: yyS[yypt-3].node.(*Expression), Token: yyS[yypt-2].Token, ArgumentExpressionListOpt: yyS[yypt-1].node.(*ArgumentExpressionListOpt), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs o := lhs.ArgumentExpressionListOpt if o == nil { break } if lhs.Expression.Case == 0 { // IDENTIFIER if lx.tweaks.enableBuiltinConstantP && lhs.Expression.Token.Val == idBuiltinConstantP { break } b := lhs.Expression.scope.Lookup(NSIdentifiers, lhs.Expression.Token.Val) if b.Node == nil && lx.tweaks.enableImplicitFuncDef { for l := o.ArgumentExpressionList; l != nil; l = l.ArgumentExpressionList { l.Expression.eval(lx) } break } } lhs.Expression.eval(lx) for l := o.ArgumentExpressionList; l != nil; l = l.ArgumentExpressionList { l.Expression.eval(lx) } } case 22: { yyVAL.node = &Expression{ Case: 10, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 23: { yyVAL.node = &Expression{ Case: 11, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 24: { yyVAL.node = &Expression{ Case: 12, Expression: yyS[yypt-1].node.(*Expression), Token: yyS[yypt-0].Token, } } case 25: { yyVAL.node = &Expression{ Case: 13, Expression: yyS[yypt-1].node.(*Expression), Token: yyS[yypt-0].Token, } } case 26: { yyVAL.node = &Expression{ Case: 14, Token: yyS[yypt-6].Token, TypeName: yyS[yypt-5].node.(*TypeName), Token2: yyS[yypt-4].Token, Token3: yyS[yypt-3].Token, InitializerList: yyS[yypt-2].node.(*InitializerList).reverse(), CommaOpt: yyS[yypt-1].node.(*CommaOpt), Token4: yyS[yypt-0].Token, } } case 27: { yyVAL.node = &Expression{ Case: 15, Token: yyS[yypt-1].Token, Expression: yyS[yypt-0].node.(*Expression), } } case 28: { yyVAL.node = &Expression{ Case: 16, Token: yyS[yypt-1].Token, Expression: yyS[yypt-0].node.(*Expression), } } case 29: { yyVAL.node = &Expression{ Case: 17, Token: yyS[yypt-1].Token, Expression: yyS[yypt-0].node.(*Expression), } } case 30: { yyVAL.node = &Expression{ Case: 18, Token: yyS[yypt-1].Token, Expression: yyS[yypt-0].node.(*Expression), } } case 31: { yyVAL.node = &Expression{ Case: 19, Token: yyS[yypt-1].Token, Expression: yyS[yypt-0].node.(*Expression), } } case 32: { yyVAL.node = &Expression{ Case: 20, Token: yyS[yypt-1].Token, Expression: yyS[yypt-0].node.(*Expression), } } case 33: { yyVAL.node = &Expression{ Case: 21, Token: yyS[yypt-1].Token, Expression: yyS[yypt-0].node.(*Expression), } } case 34: { yyVAL.node = &Expression{ Case: 22, Token: yyS[yypt-1].Token, Expression: yyS[yypt-0].node.(*Expression), } } case 35: { yyVAL.node = &Expression{ Case: 23, Token: yyS[yypt-1].Token, Expression: yyS[yypt-0].node.(*Expression), } } case 36: { yyVAL.node = &Expression{ Case: 24, Token: yyS[yypt-3].Token, Token2: yyS[yypt-2].Token, TypeName: yyS[yypt-1].node.(*TypeName), Token3: yyS[yypt-0].Token, } } case 37: { yyVAL.node = &Expression{ Case: 25, Token: yyS[yypt-3].Token, TypeName: yyS[yypt-2].node.(*TypeName), Token2: yyS[yypt-1].Token, Expression: yyS[yypt-0].node.(*Expression), } } case 38: { yyVAL.node = &Expression{ Case: 26, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 39: { yyVAL.node = &Expression{ Case: 27, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 40: { yyVAL.node = &Expression{ Case: 28, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 41: { yyVAL.node = &Expression{ Case: 29, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 42: { yyVAL.node = &Expression{ Case: 30, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 43: { yyVAL.node = &Expression{ Case: 31, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 44: { yyVAL.node = &Expression{ Case: 32, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 45: { yyVAL.node = &Expression{ Case: 33, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 46: { yyVAL.node = &Expression{ Case: 34, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 47: { yyVAL.node = &Expression{ Case: 35, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 48: { yyVAL.node = &Expression{ Case: 36, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 49: { yyVAL.node = &Expression{ Case: 37, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 50: { yyVAL.node = &Expression{ Case: 38, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 51: { yyVAL.node = &Expression{ Case: 39, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 52: { yyVAL.node = &Expression{ Case: 40, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 53: { yyVAL.node = &Expression{ Case: 41, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 54: { yyVAL.node = &Expression{ Case: 42, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 55: { yyVAL.node = &Expression{ Case: 43, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 56: { yyVAL.node = &Expression{ Case: 44, Expression: yyS[yypt-4].node.(*Expression), Token: yyS[yypt-3].Token, ExpressionList: yyS[yypt-2].node.(*ExpressionList).reverse(), Token2: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 57: { yyVAL.node = &Expression{ Case: 45, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 58: { yyVAL.node = &Expression{ Case: 46, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 59: { yyVAL.node = &Expression{ Case: 47, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 60: { yyVAL.node = &Expression{ Case: 48, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 61: { yyVAL.node = &Expression{ Case: 49, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 62: { yyVAL.node = &Expression{ Case: 50, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 63: { yyVAL.node = &Expression{ Case: 51, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 64: { yyVAL.node = &Expression{ Case: 52, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 65: { yyVAL.node = &Expression{ Case: 53, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 66: { yyVAL.node = &Expression{ Case: 54, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 67: { yyVAL.node = &Expression{ Case: 55, Expression: yyS[yypt-2].node.(*Expression), Token: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } } case 68: { yyVAL.node = &Expression{ Case: 56, Token: yyS[yypt-3].Token, Token2: yyS[yypt-2].Token, TypeName: yyS[yypt-1].node.(*TypeName), Token3: yyS[yypt-0].Token, } } case 69: { yyVAL.node = &Expression{ Case: 57, Token: yyS[yypt-2].Token, CompoundStatement: yyS[yypt-1].node.(*CompoundStatement), Token2: yyS[yypt-0].Token, } } case 70: { lx := yylex.(*lexer) lhs := &Expression{ Case: 58, Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } yyVAL.node = lhs if !lx.tweaks.enableComputedGotos { lx.report.Err(lhs.Pos(), "computed gotos not enabled") } } case 71: { lx := yylex.(*lexer) lhs := &Expression{ Case: 59, Expression: yyS[yypt-3].node.(*Expression), Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, Expression2: yyS[yypt-0].node.(*Expression), } yyVAL.node = lhs if !lx.tweaks.enableOmitConditionalOperand { lx.report.Err(lhs.Pos(), "omitting conditional operand not enabled") } } case 72: { yyVAL.node = (*ExpressionOpt)(nil) } case 73: { lx := yylex.(*lexer) lhs := &ExpressionOpt{ Expression: yyS[yypt-0].node.(*Expression), } yyVAL.node = lhs lhs.Expression.eval(lx) } case 74: { yyVAL.node = &ExpressionList{ Expression: yyS[yypt-0].node.(*Expression), } } case 75: { yyVAL.node = &ExpressionList{ Case: 1, ExpressionList: yyS[yypt-2].node.(*ExpressionList), Token: yyS[yypt-1].Token, Expression: yyS[yypt-0].node.(*Expression), } } case 76: { yyVAL.node = (*ExpressionListOpt)(nil) } case 77: { lx := yylex.(*lexer) lhs := &ExpressionListOpt{ ExpressionList: yyS[yypt-0].node.(*ExpressionList).reverse(), } yyVAL.node = lhs lhs.ExpressionList.eval(lx) } case 78: { lx := yylex.(*lexer) lx.constExprToks = []xc.Token{lx.last} } case 79: { lx := yylex.(*lexer) lhs := &ConstantExpression{ Expression: yyS[yypt-0].node.(*Expression), } yyVAL.node = lhs lhs.Value, lhs.Type = lhs.Expression.eval(lx) if lhs.Value == nil { lx.report.Err(lhs.Pos(), "not a constant expression") } l := lx.constExprToks lhs.toks = l[:len(l)-1] lx.constExprToks = nil } case 80: { lx := yylex.(*lexer) lhs := &Declaration{ DeclarationSpecifiers: yyS[yypt-2].node.(*DeclarationSpecifiers), InitDeclaratorListOpt: yyS[yypt-1].node.(*InitDeclaratorListOpt), Token: yyS[yypt-0].Token, } yyVAL.node = lhs ts0 := lhs.DeclarationSpecifiers.typeSpecifiers() if ts0 == 0 && lx.tweaks.enableImplicitIntType { lhs.DeclarationSpecifiers.typeSpecifier = tsEncode(tsInt) } ts := tsDecode(lhs.DeclarationSpecifiers.typeSpecifiers()) ok := false for _, v := range ts { if v == tsStructSpecifier || v == tsUnionSpecifier { ok = true break } } if ok { s := lhs.DeclarationSpecifiers d := &Declarator{specifier: s} dd := &DirectDeclarator{ Token: xc.Token{Char: lex.NewChar(lhs.Pos(), 0)}, declarator: d, idScope: lx.scope, specifier: s, } d.DirectDeclarator = dd d.setFull(lx) for l := lhs.DeclarationSpecifiers; l != nil; { ts := l.TypeSpecifier if ts != nil && ts.Case == 11 && ts.StructOrUnionSpecifier.Case == 0 { // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' ts.StructOrUnionSpecifier.declarator = d break } if o := l.DeclarationSpecifiersOpt; o != nil { l = o.DeclarationSpecifiers continue } break } } o := lhs.InitDeclaratorListOpt if o != nil { break } s := lhs.DeclarationSpecifiers d := &Declarator{specifier: s} dd := &DirectDeclarator{ Token: xc.Token{Char: lex.NewChar(lhs.Pos(), 0)}, declarator: d, idScope: lx.scope, specifier: s, } d.DirectDeclarator = dd d.setFull(lx) lhs.declarator = d } case 81: { yyVAL.node = &Declaration{ Case: 1, StaticAssertDeclaration: yyS[yypt-0].node.(*StaticAssertDeclaration), } } case 82: { lx := yylex.(*lexer) lhs := &DeclarationSpecifiers{ StorageClassSpecifier: yyS[yypt-1].node.(*StorageClassSpecifier), DeclarationSpecifiersOpt: yyS[yypt-0].node.(*DeclarationSpecifiersOpt), } yyVAL.node = lhs lx.scope.specifier = lhs a := lhs.StorageClassSpecifier b := lhs.DeclarationSpecifiersOpt if b == nil { lhs.attr = a.attr break } if a.attr&b.attr != 0 { lx.report.Err(a.Pos(), "invalid storage class specifier") break } lhs.attr = a.attr | b.attr lhs.typeSpecifier = b.typeSpecifier if lhs.StorageClassSpecifier.Case != 0 /* "typedef" */ && lhs.IsTypedef() { lx.report.Err(a.Pos(), "invalid storage class specifier") } } case 83: { lx := yylex.(*lexer) lhs := &DeclarationSpecifiers{ Case: 1, TypeSpecifier: yyS[yypt-1].node.(*TypeSpecifier), DeclarationSpecifiersOpt: yyS[yypt-0].node.(*DeclarationSpecifiersOpt), } yyVAL.node = lhs lx.scope.specifier = lhs a := lhs.TypeSpecifier b := lhs.DeclarationSpecifiersOpt if b == nil { lhs.typeSpecifier = a.typeSpecifier break } lhs.attr = b.attr tsb := tsDecode(b.typeSpecifier) if len(tsb) == 1 && tsb[0] == tsTypedefName && lx.tweaks.allowCompatibleTypedefRedefinitions { tsb[0] = 0 } ts := tsEncode(append(tsDecode(a.typeSpecifier), tsb...)...) if _, ok := tsValid[ts]; !ok { ts = tsEncode(tsInt) lx.report.Err(a.Pos(), "invalid type specifier") } lhs.typeSpecifier = ts } case 84: { lx := yylex.(*lexer) lhs := &DeclarationSpecifiers{ Case: 2, TypeQualifier: yyS[yypt-1].node.(*TypeQualifier), DeclarationSpecifiersOpt: yyS[yypt-0].node.(*DeclarationSpecifiersOpt), } yyVAL.node = lhs lx.scope.specifier = lhs a := lhs.TypeQualifier b := lhs.DeclarationSpecifiersOpt if b == nil { lhs.attr = a.attr break } if a.attr&b.attr != 0 { lx.report.Err(a.Pos(), "invalid type qualifier") break } lhs.attr = a.attr | b.attr lhs.typeSpecifier = b.typeSpecifier if lhs.IsTypedef() { lx.report.Err(a.Pos(), "invalid type qualifier") } } case 85: { lx := yylex.(*lexer) lhs := &DeclarationSpecifiers{ Case: 3, FunctionSpecifier: yyS[yypt-1].node.(*FunctionSpecifier), DeclarationSpecifiersOpt: yyS[yypt-0].node.(*DeclarationSpecifiersOpt), } yyVAL.node = lhs lx.scope.specifier = lhs a := lhs.FunctionSpecifier b := lhs.DeclarationSpecifiersOpt if b == nil { lhs.attr = a.attr break } if a.attr&b.attr != 0 { lx.report.Err(a.Pos(), "invalid function specifier") break } lhs.attr = a.attr | b.attr lhs.typeSpecifier = b.typeSpecifier if lhs.IsTypedef() { lx.report.Err(a.Pos(), "invalid function specifier") } } case 86: { yyVAL.node = (*DeclarationSpecifiersOpt)(nil) } case 87: { lhs := &DeclarationSpecifiersOpt{ DeclarationSpecifiers: yyS[yypt-0].node.(*DeclarationSpecifiers), } yyVAL.node = lhs lhs.attr = lhs.DeclarationSpecifiers.attr lhs.typeSpecifier = lhs.DeclarationSpecifiers.typeSpecifier } case 88: { yyVAL.node = &InitDeclaratorList{ InitDeclarator: yyS[yypt-0].node.(*InitDeclarator), } } case 89: { yyVAL.node = &InitDeclaratorList{ Case: 1, InitDeclaratorList: yyS[yypt-2].node.(*InitDeclaratorList), Token: yyS[yypt-1].Token, InitDeclarator: yyS[yypt-0].node.(*InitDeclarator), } } case 90: { yyVAL.node = (*InitDeclaratorListOpt)(nil) } case 91: { yyVAL.node = &InitDeclaratorListOpt{ InitDeclaratorList: yyS[yypt-0].node.(*InitDeclaratorList).reverse(), } } case 92: { lx := yylex.(*lexer) lhs := &InitDeclarator{ Declarator: yyS[yypt-0].node.(*Declarator), } yyVAL.node = lhs lhs.Declarator.setFull(lx) } case 93: { lx := yylex.(*lexer) d := yyS[yypt-0].node.(*Declarator) d.setFull(lx) } case 94: { lx := yylex.(*lexer) lhs := &InitDeclarator{ Case: 1, Declarator: yyS[yypt-3].node.(*Declarator), Token: yyS[yypt-1].Token, Initializer: yyS[yypt-0].node.(*Initializer), } yyVAL.node = lhs d := lhs.Declarator lhs.Initializer.typeCheck(&d.Type, d.Type, lhs.Declarator.specifier.IsStatic(), lx) if d.Type.Specifier().IsExtern() { id, _ := d.Identifier() lx.report.Err(d.Pos(), "'%s' initialized and declared 'extern'", dict.S(id)) } } case 95: { lhs := &StorageClassSpecifier{ Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.attr = saTypedef } case 96: { lhs := &StorageClassSpecifier{ Case: 1, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.attr = saExtern } case 97: { lhs := &StorageClassSpecifier{ Case: 2, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.attr = saStatic } case 98: { lhs := &StorageClassSpecifier{ Case: 3, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.attr = saAuto } case 99: { lhs := &StorageClassSpecifier{ Case: 4, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.attr = saRegister } case 100: { lhs := &TypeSpecifier{ Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsVoid) } case 101: { lhs := &TypeSpecifier{ Case: 1, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsChar) } case 102: { lhs := &TypeSpecifier{ Case: 2, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsShort) } case 103: { lhs := &TypeSpecifier{ Case: 3, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsInt) } case 104: { lhs := &TypeSpecifier{ Case: 4, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsLong) } case 105: { lhs := &TypeSpecifier{ Case: 5, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsFloat) } case 106: { lhs := &TypeSpecifier{ Case: 6, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsDouble) } case 107: { lhs := &TypeSpecifier{ Case: 7, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsSigned) } case 108: { lhs := &TypeSpecifier{ Case: 8, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsUnsigned) } case 109: { lhs := &TypeSpecifier{ Case: 9, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsBool) } case 110: { lhs := &TypeSpecifier{ Case: 10, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsComplex) } case 111: { lhs := &TypeSpecifier{ Case: 11, StructOrUnionSpecifier: yyS[yypt-0].node.(*StructOrUnionSpecifier), } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(lhs.StructOrUnionSpecifier.typeSpecifiers()) } case 112: { lhs := &TypeSpecifier{ Case: 12, EnumSpecifier: yyS[yypt-0].node.(*EnumSpecifier), } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsEnumSpecifier) } case 113: { lx := yylex.(*lexer) lhs := &TypeSpecifier{ Case: 13, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsTypedefName) _, lhs.scope = lx.scope.Lookup2(NSIdentifiers, lhs.Token.Val) } case 114: { lx := yylex.(*lexer) lhs := &TypeSpecifier{ Case: 14, Token: yyS[yypt-3].Token, Token2: yyS[yypt-2].Token, Expression: yyS[yypt-1].node.(*Expression), Token3: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsTypeof) _, lhs.Type = lhs.Expression.eval(lx) } case 115: { lhs := &TypeSpecifier{ Case: 15, Token: yyS[yypt-3].Token, Token2: yyS[yypt-2].Token, TypeName: yyS[yypt-1].node.(*TypeName), Token3: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.typeSpecifier = tsEncode(tsTypeof) lhs.Type = undefined if t := lhs.TypeName.Type; t != nil { lhs.Type = t } } case 116: { lx := yylex.(*lexer) if o := yyS[yypt-1].node.(*IdentifierOpt); o != nil { lx.scope.declareStructTag(o.Token, lx.report) } lx.pushScope(ScopeMembers) lx.scope.isUnion = yyS[yypt-2].node.(*StructOrUnion).Case == 1 // "union" lx.scope.prevStructDeclarator = nil } case 117: { lx := yylex.(*lexer) lhs := &StructOrUnionSpecifier{ StructOrUnion: yyS[yypt-5].node.(*StructOrUnion), IdentifierOpt: yyS[yypt-4].node.(*IdentifierOpt), Token: yyS[yypt-3].Token, StructDeclarationList: yyS[yypt-1].node.(*StructDeclarationList).reverse(), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs sc := lx.scope lhs.scope = sc if sc.bitOffset != 0 { finishBitField(lhs, lx) } i := 0 var bt Type var d *Declarator for l := lhs.StructDeclarationList; l != nil; l = l.StructDeclarationList { for l := l.StructDeclaration.StructDeclaratorList; l != nil; l = l.StructDeclaratorList { switch sd := l.StructDeclarator; sd.Case { case 0: // Declarator d = sd.Declarator case 1: // DeclaratorOpt ':' ConstantExpression if o := sd.DeclaratorOpt; o != nil { x := o.Declarator if x.bitOffset == 0 { d = x bt = lx.scope.bitFieldTypes[i] i++ } x.bitFieldType = bt } } } } lx.scope.bitFieldTypes = nil lhs.alignOf = sc.maxAlign switch { case sc.isUnion: lhs.sizeOf = align(sc.maxSize, sc.maxAlign) default: off := sc.offset lhs.sizeOf = align(sc.offset, sc.maxAlign) if d != nil { d.padding = lhs.sizeOf - off } } lx.popScope(lhs.Token2) if o := lhs.IdentifierOpt; o != nil { lx.scope.defineStructTag(o.Token, lhs, lx.report) } } case 118: { lx := yylex.(*lexer) lhs := &StructOrUnionSpecifier{ Case: 1, StructOrUnion: yyS[yypt-1].node.(*StructOrUnion), Token: yyS[yypt-0].Token, } yyVAL.node = lhs lx.scope.declareStructTag(lhs.Token, lx.report) lhs.scope = lx.scope } case 119: { lx := yylex.(*lexer) lhs := &StructOrUnionSpecifier{ Case: 2, StructOrUnion: yyS[yypt-3].node.(*StructOrUnion), IdentifierOpt: yyS[yypt-2].node.(*IdentifierOpt), Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } yyVAL.node = lhs if !lx.tweaks.enableEmptyStructs { lx.report.Err(lhs.Token.Pos(), "empty structs/unions not allowed") } if o := yyS[yypt-2].node.(*IdentifierOpt); o != nil { lx.scope.declareStructTag(o.Token, lx.report) } lx.scope.isUnion = yyS[yypt-3].node.(*StructOrUnion).Case == 1 // "union" lx.scope.prevStructDeclarator = nil lhs.alignOf = 1 lhs.sizeOf = 0 if o := lhs.IdentifierOpt; o != nil { lx.scope.defineStructTag(o.Token, lhs, lx.report) } } case 120: { yyVAL.node = &StructOrUnion{ Token: yyS[yypt-0].Token, } } case 121: { yyVAL.node = &StructOrUnion{ Case: 1, Token: yyS[yypt-0].Token, } } case 122: { yyVAL.node = &StructDeclarationList{ StructDeclaration: yyS[yypt-0].node.(*StructDeclaration), } } case 123: { yyVAL.node = &StructDeclarationList{ Case: 1, StructDeclarationList: yyS[yypt-1].node.(*StructDeclarationList), StructDeclaration: yyS[yypt-0].node.(*StructDeclaration), } } case 124: { lx := yylex.(*lexer) lhs := &StructDeclaration{ SpecifierQualifierList: yyS[yypt-2].node.(*SpecifierQualifierList), StructDeclaratorList: yyS[yypt-1].node.(*StructDeclaratorList).reverse(), Token: yyS[yypt-0].Token, } yyVAL.node = lhs s := lhs.SpecifierQualifierList if k := s.kind(); k != Struct && k != Union { break } d := &Declarator{specifier: s} dd := &DirectDeclarator{ Token: xc.Token{Char: lex.NewChar(lhs.Pos(), 0)}, declarator: d, idScope: lx.scope, specifier: s, } d.DirectDeclarator = dd d.setFull(lx) for l := lhs.SpecifierQualifierList; l != nil; { ts := l.TypeSpecifier if ts != nil && ts.Case == 11 && ts.StructOrUnionSpecifier.Case == 0 { // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' ts.StructOrUnionSpecifier.declarator = d break } if o := l.SpecifierQualifierListOpt; o != nil { l = o.SpecifierQualifierList continue } break } } case 125: { lx := yylex.(*lexer) lhs := &StructDeclaration{ Case: 1, SpecifierQualifierList: yyS[yypt-1].node.(*SpecifierQualifierList), Token: yyS[yypt-0].Token, } yyVAL.node = lhs s := lhs.SpecifierQualifierList if !lx.tweaks.enableAnonymousStructFields { lx.report.Err(lhs.Token.Pos(), "unnamed fields not allowed") } else if k := s.kind(); k != Struct && k != Union { lx.report.Err(lhs.Token.Pos(), "only unnamed structs and unions are allowed") break } d := &Declarator{specifier: s} dd := &DirectDeclarator{ Token: xc.Token{Char: lex.NewChar(lhs.Pos(), 0)}, declarator: d, idScope: lx.scope, specifier: s, } d.DirectDeclarator = dd d.setFull(lx) // we have no struct declarators to parse, so we have to create the case of one implicit declarator // because else the size of anonymous members is not included in the struct size! dummy := &StructDeclarator{Declarator: d} dummy.post(lx) for l := lhs.SpecifierQualifierList; l != nil; { ts := l.TypeSpecifier if ts != nil && ts.Case == 11 && ts.StructOrUnionSpecifier.Case == 0 { // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' ts.StructOrUnionSpecifier.declarator = d break } if o := l.SpecifierQualifierListOpt; o != nil { l = o.SpecifierQualifierList continue } break } } case 126: { yyVAL.node = &StructDeclaration{ Case: 2, StaticAssertDeclaration: yyS[yypt-0].node.(*StaticAssertDeclaration), } } case 127: { lx := yylex.(*lexer) lhs := &SpecifierQualifierList{ TypeSpecifier: yyS[yypt-1].node.(*TypeSpecifier), SpecifierQualifierListOpt: yyS[yypt-0].node.(*SpecifierQualifierListOpt), } yyVAL.node = lhs lx.scope.specifier = lhs a := lhs.TypeSpecifier b := lhs.SpecifierQualifierListOpt if b == nil { lhs.typeSpecifier = a.typeSpecifier break } lhs.attr = b.attr ts := tsEncode(append(tsDecode(a.typeSpecifier), tsDecode(b.typeSpecifier)...)...) if _, ok := tsValid[ts]; !ok { lx.report.Err(a.Pos(), "invalid type specifier") break } lhs.typeSpecifier = ts } case 128: { lx := yylex.(*lexer) lhs := &SpecifierQualifierList{ Case: 1, TypeQualifier: yyS[yypt-1].node.(*TypeQualifier), SpecifierQualifierListOpt: yyS[yypt-0].node.(*SpecifierQualifierListOpt), } yyVAL.node = lhs lx.scope.specifier = lhs a := lhs.TypeQualifier b := lhs.SpecifierQualifierListOpt if b == nil { lhs.attr = a.attr break } if a.attr&b.attr != 0 { lx.report.Err(a.Pos(), "invalid type qualifier") break } lhs.attr = a.attr | b.attr lhs.typeSpecifier = b.typeSpecifier } case 129: { yyVAL.node = (*SpecifierQualifierListOpt)(nil) } case 130: { lhs := &SpecifierQualifierListOpt{ SpecifierQualifierList: yyS[yypt-0].node.(*SpecifierQualifierList), } yyVAL.node = lhs lhs.attr = lhs.SpecifierQualifierList.attr lhs.typeSpecifier = lhs.SpecifierQualifierList.typeSpecifier } case 131: { yyVAL.node = &StructDeclaratorList{ StructDeclarator: yyS[yypt-0].node.(*StructDeclarator), } } case 132: { yyVAL.node = &StructDeclaratorList{ Case: 1, StructDeclaratorList: yyS[yypt-2].node.(*StructDeclaratorList), Token: yyS[yypt-1].Token, StructDeclarator: yyS[yypt-0].node.(*StructDeclarator), } } case 133: { lx := yylex.(*lexer) lhs := &StructDeclarator{ Declarator: yyS[yypt-0].node.(*Declarator), } yyVAL.node = lhs lhs.Declarator.setFull(lx) lhs.post(lx) } case 134: { lx := yylex.(*lexer) lhs := &StructDeclarator{ Case: 1, DeclaratorOpt: yyS[yypt-2].node.(*DeclaratorOpt), Token: yyS[yypt-1].Token, ConstantExpression: yyS[yypt-0].node.(*ConstantExpression), } yyVAL.node = lhs m := lx.model e := lhs.ConstantExpression if e.Value == nil { e.Value, e.Type = m.value2(1, m.IntType) } if !IsIntType(e.Type) { lx.report.Err(e.Pos(), "bit field width not an integer (have '%s')", e.Type) e.Value, e.Type = m.value2(1, m.IntType) } if o := lhs.DeclaratorOpt; o != nil { o.Declarator.setFull(lx) } lhs.post(lx) } case 135: { yyVAL.node = (*CommaOpt)(nil) } case 136: { yyVAL.node = &CommaOpt{ Token: yyS[yypt-0].Token, } } case 137: { lx := yylex.(*lexer) if o := yyS[yypt-0].node.(*IdentifierOpt); o != nil { lx.scope.declareEnumTag(o.Token, lx.report) } lx.iota = 0 } case 138: { lx := yylex.(*lexer) lhs := &EnumSpecifier{ Token: yyS[yypt-6].Token, IdentifierOpt: yyS[yypt-5].node.(*IdentifierOpt), Token2: yyS[yypt-3].Token, EnumeratorList: yyS[yypt-2].node.(*EnumeratorList).reverse(), CommaOpt: yyS[yypt-1].node.(*CommaOpt), Token3: yyS[yypt-0].Token, } yyVAL.node = lhs if o := lhs.IdentifierOpt; o != nil { lx.scope.defineEnumTag(o.Token, lhs, lx.report) } if !lx.tweaks.enableUnsignedEnums { break } lhs.unsigned = true loop: for l := lhs.EnumeratorList; l != nil; l = l.EnumeratorList { switch e := l.Enumerator; x := e.Value.(type) { case int32: if x < 0 { lhs.unsigned = false break loop } case int64: if x < 0 { lhs.unsigned = false break loop } default: panic(fmt.Errorf("%s: TODO Enumerator.Value type %T", position(e.Pos()), x)) } } } case 139: { lx := yylex.(*lexer) lhs := &EnumSpecifier{ Case: 1, Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lx.scope.declareEnumTag(lhs.Token2, lx.report) } case 140: { yyVAL.node = &EnumeratorList{ Enumerator: yyS[yypt-0].node.(*Enumerator), } } case 141: { yyVAL.node = &EnumeratorList{ Case: 1, EnumeratorList: yyS[yypt-2].node.(*EnumeratorList), Token: yyS[yypt-1].Token, Enumerator: yyS[yypt-0].node.(*Enumerator), } } case 142: { lx := yylex.(*lexer) lhs := &Enumerator{ EnumerationConstant: yyS[yypt-0].node.(*EnumerationConstant), } yyVAL.node = lhs m := lx.model v := m.MustConvert(lx.iota, m.IntType) lhs.Value = v lx.scope.defineEnumConst(lx, lhs.EnumerationConstant.Token, v) } case 143: { lx := yylex.(*lexer) lhs := &Enumerator{ Case: 1, EnumerationConstant: yyS[yypt-2].node.(*EnumerationConstant), Token: yyS[yypt-1].Token, ConstantExpression: yyS[yypt-0].node.(*ConstantExpression), } yyVAL.node = lhs m := lx.model e := lhs.ConstantExpression var v interface{} // [0], 6.7.2.2 // The expression that defines the value of an enumeration // constant shall be an integer constant expression that has a // value representable as an int. switch { case !IsIntType(e.Type): lx.report.Err(e.Pos(), "not an integer constant expression (have '%s')", e.Type) v = m.MustConvert(int32(0), m.IntType) default: var ok bool if v, ok = m.enumValueToInt(e.Value); !ok { lx.report.Err(e.Pos(), "overflow in enumeration value: %v", e.Value) } } lhs.Value = v lx.scope.defineEnumConst(lx, lhs.EnumerationConstant.Token, v) } case 144: { lhs := &TypeQualifier{ Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.attr = saConst } case 145: { lhs := &TypeQualifier{ Case: 1, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.attr = saRestrict } case 146: { lhs := &TypeQualifier{ Case: 2, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.attr = saVolatile } case 147: { lhs := &FunctionSpecifier{ Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.attr = saInline } case 148: { lhs := &FunctionSpecifier{ Case: 1, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.attr = saNoreturn } case 149: { lx := yylex.(*lexer) lhs := &Declarator{ PointerOpt: yyS[yypt-1].node.(*PointerOpt), DirectDeclarator: yyS[yypt-0].node.(*DirectDeclarator), } yyVAL.node = lhs lhs.specifier = lx.scope.specifier lhs.DirectDeclarator.declarator = lhs } case 150: { yyVAL.node = (*DeclaratorOpt)(nil) } case 151: { yyVAL.node = &DeclaratorOpt{ Declarator: yyS[yypt-0].node.(*Declarator), } } case 152: { lx := yylex.(*lexer) lhs := &DirectDeclarator{ Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.specifier = lx.scope.specifier lx.scope.declareIdentifier(lhs.Token, lhs, lx.report) lhs.idScope = lx.scope } case 153: { lhs := &DirectDeclarator{ Case: 1, Token: yyS[yypt-2].Token, Declarator: yyS[yypt-1].node.(*Declarator), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.Declarator.specifier = nil lhs.Declarator.DirectDeclarator.parent = lhs } case 154: { lx := yylex.(*lexer) lhs := &DirectDeclarator{ Case: 2, DirectDeclarator: yyS[yypt-4].node.(*DirectDeclarator), Token: yyS[yypt-3].Token, TypeQualifierListOpt: yyS[yypt-2].node.(*TypeQualifierListOpt), ExpressionOpt: yyS[yypt-1].node.(*ExpressionOpt), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.elements = -1 if o := lhs.ExpressionOpt; o != nil { var err error if lhs.elements, err = elements(o.Expression.eval(lx)); err != nil { lx.report.Err(o.Expression.Pos(), "%s", err) } } lhs.DirectDeclarator.parent = lhs } case 155: { lx := yylex.(*lexer) lhs := &DirectDeclarator{ Case: 3, DirectDeclarator: yyS[yypt-5].node.(*DirectDeclarator), Token: yyS[yypt-4].Token, Token2: yyS[yypt-3].Token, TypeQualifierListOpt: yyS[yypt-2].node.(*TypeQualifierListOpt), Expression: yyS[yypt-1].node.(*Expression), Token3: yyS[yypt-0].Token, } yyVAL.node = lhs var err error if lhs.elements, err = elements(lhs.Expression.eval(lx)); err != nil { lx.report.Err(lhs.Expression.Pos(), "%s", err) } lhs.DirectDeclarator.parent = lhs } case 156: { lx := yylex.(*lexer) lhs := &DirectDeclarator{ Case: 4, DirectDeclarator: yyS[yypt-5].node.(*DirectDeclarator), Token: yyS[yypt-4].Token, TypeQualifierList: yyS[yypt-3].node.(*TypeQualifierList).reverse(), Token2: yyS[yypt-2].Token, Expression: yyS[yypt-1].node.(*Expression), Token3: yyS[yypt-0].Token, } yyVAL.node = lhs var err error if lhs.elements, err = elements(lhs.Expression.eval(lx)); err != nil { lx.report.Err(lhs.Expression.Pos(), "%s", err) } lhs.DirectDeclarator.parent = lhs } case 157: { lhs := &DirectDeclarator{ Case: 5, DirectDeclarator: yyS[yypt-4].node.(*DirectDeclarator), Token: yyS[yypt-3].Token, TypeQualifierListOpt: yyS[yypt-2].node.(*TypeQualifierListOpt), Token2: yyS[yypt-1].Token, Token3: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.DirectDeclarator.parent = lhs lhs.elements = -1 } case 158: { lx := yylex.(*lexer) lx.pushScope(ScopeParams) } case 159: { lx := yylex.(*lexer) lhs := &DirectDeclarator{ Case: 6, DirectDeclarator: yyS[yypt-4].node.(*DirectDeclarator), Token: yyS[yypt-3].Token, ParameterTypeList: yyS[yypt-1].node.(*ParameterTypeList), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.paramsScope, _ = lx.popScope(lhs.Token2) lhs.DirectDeclarator.parent = lhs } case 160: { lhs := &DirectDeclarator{ Case: 7, DirectDeclarator: yyS[yypt-3].node.(*DirectDeclarator), Token: yyS[yypt-2].Token, IdentifierListOpt: yyS[yypt-1].node.(*IdentifierListOpt), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.DirectDeclarator.parent = lhs } case 161: { yyVAL.node = &Pointer{ Token: yyS[yypt-1].Token, TypeQualifierListOpt: yyS[yypt-0].node.(*TypeQualifierListOpt), } } case 162: { yyVAL.node = &Pointer{ Case: 1, Token: yyS[yypt-2].Token, TypeQualifierListOpt: yyS[yypt-1].node.(*TypeQualifierListOpt), Pointer: yyS[yypt-0].node.(*Pointer), } } case 163: { yyVAL.node = (*PointerOpt)(nil) } case 164: { yyVAL.node = &PointerOpt{ Pointer: yyS[yypt-0].node.(*Pointer), } } case 165: { lhs := &TypeQualifierList{ TypeQualifier: yyS[yypt-0].node.(*TypeQualifier), } yyVAL.node = lhs lhs.attr = lhs.TypeQualifier.attr } case 166: { lx := yylex.(*lexer) lhs := &TypeQualifierList{ Case: 1, TypeQualifierList: yyS[yypt-1].node.(*TypeQualifierList), TypeQualifier: yyS[yypt-0].node.(*TypeQualifier), } yyVAL.node = lhs a := lhs.TypeQualifierList b := lhs.TypeQualifier if a.attr&b.attr != 0 { lx.report.Err(b.Pos(), "invalid type qualifier") break } lhs.attr = a.attr | b.attr } case 167: { yyVAL.node = (*TypeQualifierListOpt)(nil) } case 168: { yyVAL.node = &TypeQualifierListOpt{ TypeQualifierList: yyS[yypt-0].node.(*TypeQualifierList).reverse(), } } case 169: { lhs := &ParameterTypeList{ ParameterList: yyS[yypt-0].node.(*ParameterList).reverse(), } yyVAL.node = lhs lhs.post() } case 170: { lhs := &ParameterTypeList{ Case: 1, ParameterList: yyS[yypt-2].node.(*ParameterList).reverse(), Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.post() } case 171: { yyVAL.node = (*ParameterTypeListOpt)(nil) } case 172: { yyVAL.node = &ParameterTypeListOpt{ ParameterTypeList: yyS[yypt-0].node.(*ParameterTypeList), } } case 173: { yyVAL.node = &ParameterList{ ParameterDeclaration: yyS[yypt-0].node.(*ParameterDeclaration), } } case 174: { yyVAL.node = &ParameterList{ Case: 1, ParameterList: yyS[yypt-2].node.(*ParameterList), Token: yyS[yypt-1].Token, ParameterDeclaration: yyS[yypt-0].node.(*ParameterDeclaration), } } case 175: { lx := yylex.(*lexer) lhs := &ParameterDeclaration{ DeclarationSpecifiers: yyS[yypt-1].node.(*DeclarationSpecifiers), Declarator: yyS[yypt-0].node.(*Declarator), } yyVAL.node = lhs lhs.Declarator.setFull(lx) lhs.declarator = lhs.Declarator } case 176: { lx := yylex.(*lexer) lhs := &ParameterDeclaration{ Case: 1, DeclarationSpecifiers: yyS[yypt-1].node.(*DeclarationSpecifiers), AbstractDeclaratorOpt: yyS[yypt-0].node.(*AbstractDeclaratorOpt), } yyVAL.node = lhs if o := lhs.AbstractDeclaratorOpt; o != nil { lhs.declarator = o.AbstractDeclarator.declarator lhs.declarator.setFull(lx) break } d := &Declarator{ specifier: lx.scope.specifier, DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER }, } d.DirectDeclarator.declarator = d lhs.declarator = d d.setFull(lx) } case 177: { yyVAL.node = &IdentifierList{ Token: yyS[yypt-0].Token, } } case 178: { yyVAL.node = &IdentifierList{ Case: 1, IdentifierList: yyS[yypt-2].node.(*IdentifierList), Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 179: { yyVAL.node = (*IdentifierListOpt)(nil) } case 180: { yyVAL.node = &IdentifierListOpt{ IdentifierList: yyS[yypt-0].node.(*IdentifierList).reverse(), } } case 181: { yyVAL.node = (*IdentifierOpt)(nil) } case 182: { yyVAL.node = &IdentifierOpt{ Token: yyS[yypt-0].Token, } } case 183: { lx := yylex.(*lexer) lx.pushScope(ScopeBlock) } case 184: { lx := yylex.(*lexer) lhs := &TypeName{ SpecifierQualifierList: yyS[yypt-1].node.(*SpecifierQualifierList), AbstractDeclaratorOpt: yyS[yypt-0].node.(*AbstractDeclaratorOpt), } yyVAL.node = lhs if o := lhs.AbstractDeclaratorOpt; o != nil { lhs.declarator = o.AbstractDeclarator.declarator } else { d := &Declarator{ specifier: lhs.SpecifierQualifierList, DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER idScope: lx.scope, }, } d.DirectDeclarator.declarator = d lhs.declarator = d } lhs.Type = lhs.declarator.setFull(lx) lhs.scope = lx.scope lx.popScope(xc.Token{}) } case 185: { lx := yylex.(*lexer) lhs := &AbstractDeclarator{ Pointer: yyS[yypt-0].node.(*Pointer), } yyVAL.node = lhs d := &Declarator{ specifier: lx.scope.specifier, PointerOpt: &PointerOpt{ Pointer: lhs.Pointer, }, DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER idScope: lx.scope, }, } d.DirectDeclarator.declarator = d lhs.declarator = d } case 186: { lx := yylex.(*lexer) lhs := &AbstractDeclarator{ Case: 1, PointerOpt: yyS[yypt-1].node.(*PointerOpt), DirectAbstractDeclarator: yyS[yypt-0].node.(*DirectAbstractDeclarator), } yyVAL.node = lhs d := &Declarator{ specifier: lx.scope.specifier, PointerOpt: lhs.PointerOpt, DirectDeclarator: lhs.DirectAbstractDeclarator.directDeclarator, } d.DirectDeclarator.declarator = d lhs.declarator = d } case 187: { yyVAL.node = (*AbstractDeclaratorOpt)(nil) } case 188: { yyVAL.node = &AbstractDeclaratorOpt{ AbstractDeclarator: yyS[yypt-0].node.(*AbstractDeclarator), } } case 189: { lhs := &DirectAbstractDeclarator{ Token: yyS[yypt-2].Token, AbstractDeclarator: yyS[yypt-1].node.(*AbstractDeclarator), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.AbstractDeclarator.declarator.specifier = nil lhs.directDeclarator = &DirectDeclarator{ Case: 1, // '(' Declarator ')' Declarator: lhs.AbstractDeclarator.declarator, } lhs.AbstractDeclarator.declarator.DirectDeclarator.parent = lhs.directDeclarator } case 190: { lx := yylex.(*lexer) lhs := &DirectAbstractDeclarator{ Case: 1, DirectAbstractDeclaratorOpt: yyS[yypt-3].node.(*DirectAbstractDeclaratorOpt), Token: yyS[yypt-2].Token, ExpressionOpt: yyS[yypt-1].node.(*ExpressionOpt), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs nElements := -1 if o := lhs.ExpressionOpt; o != nil { var err error if nElements, err = elements(o.Expression.eval(lx)); err != nil { lx.report.Err(o.Expression.Pos(), "%s", err) } } var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 2, // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' DirectDeclarator: dd, ExpressionOpt: lhs.ExpressionOpt, elements: nElements, } dd.parent = lhs.directDeclarator } case 191: { lx := yylex.(*lexer) lhs := &DirectAbstractDeclarator{ Case: 2, DirectAbstractDeclaratorOpt: yyS[yypt-4].node.(*DirectAbstractDeclaratorOpt), Token: yyS[yypt-3].Token, TypeQualifierList: yyS[yypt-2].node.(*TypeQualifierList).reverse(), ExpressionOpt: yyS[yypt-1].node.(*ExpressionOpt), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs if o := lhs.ExpressionOpt; o != nil { o.Expression.eval(lx) } var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 2, // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' DirectDeclarator: dd, TypeQualifierListOpt: &TypeQualifierListOpt{lhs.TypeQualifierList}, ExpressionOpt: lhs.ExpressionOpt, } dd.parent = lhs.directDeclarator } case 192: { lx := yylex.(*lexer) lhs := &DirectAbstractDeclarator{ Case: 3, DirectAbstractDeclaratorOpt: yyS[yypt-5].node.(*DirectAbstractDeclaratorOpt), Token: yyS[yypt-4].Token, Token2: yyS[yypt-3].Token, TypeQualifierListOpt: yyS[yypt-2].node.(*TypeQualifierListOpt), Expression: yyS[yypt-1].node.(*Expression), Token3: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.Expression.eval(lx) var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 2, // DirectDeclarator '[' "static" TypeQualifierListOpt Expression ']' DirectDeclarator: dd, TypeQualifierListOpt: lhs.TypeQualifierListOpt, Expression: lhs.Expression, } dd.parent = lhs.directDeclarator } case 193: { lx := yylex.(*lexer) lhs := &DirectAbstractDeclarator{ Case: 4, DirectAbstractDeclaratorOpt: yyS[yypt-5].node.(*DirectAbstractDeclaratorOpt), Token: yyS[yypt-4].Token, TypeQualifierList: yyS[yypt-3].node.(*TypeQualifierList).reverse(), Token2: yyS[yypt-2].Token, Expression: yyS[yypt-1].node.(*Expression), Token3: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.Expression.eval(lx) var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 4, // DirectDeclarator '[' TypeQualifierList "static" Expression ']' DirectDeclarator: dd, TypeQualifierList: lhs.TypeQualifierList, Expression: lhs.Expression, } dd.parent = lhs.directDeclarator } case 194: { lhs := &DirectAbstractDeclarator{ Case: 5, DirectAbstractDeclaratorOpt: yyS[yypt-3].node.(*DirectAbstractDeclaratorOpt), Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, Token3: yyS[yypt-0].Token, } yyVAL.node = lhs var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 5, // DirectDeclarator '[' TypeQualifierListOpt '*' ']' DirectDeclarator: dd, } dd.parent = lhs.directDeclarator } case 195: { lx := yylex.(*lexer) lx.pushScope(ScopeParams) } case 196: { lx := yylex.(*lexer) lhs := &DirectAbstractDeclarator{ Case: 6, Token: yyS[yypt-3].Token, ParameterTypeListOpt: yyS[yypt-1].node.(*ParameterTypeListOpt), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.paramsScope, _ = lx.popScope(lhs.Token2) switch o := lhs.ParameterTypeListOpt; { case o != nil: lhs.directDeclarator = &DirectDeclarator{ Case: 6, // DirectDeclarator '(' ParameterTypeList ')' DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER }, ParameterTypeList: o.ParameterTypeList, } default: lhs.directDeclarator = &DirectDeclarator{ Case: 7, // DirectDeclarator '(' IdentifierListOpt ')' DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER }, } } lhs.directDeclarator.DirectDeclarator.parent = lhs.directDeclarator } case 197: { lx := yylex.(*lexer) lx.pushScope(ScopeParams) } case 198: { lx := yylex.(*lexer) lhs := &DirectAbstractDeclarator{ Case: 7, DirectAbstractDeclarator: yyS[yypt-4].node.(*DirectAbstractDeclarator), Token: yyS[yypt-3].Token, ParameterTypeListOpt: yyS[yypt-1].node.(*ParameterTypeListOpt), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.paramsScope, _ = lx.popScope(lhs.Token2) switch o := lhs.ParameterTypeListOpt; { case o != nil: lhs.directDeclarator = &DirectDeclarator{ Case: 6, // DirectDeclarator '(' ParameterTypeList ')' DirectDeclarator: lhs.DirectAbstractDeclarator.directDeclarator, ParameterTypeList: o.ParameterTypeList, } default: lhs.directDeclarator = &DirectDeclarator{ Case: 7, // DirectDeclarator '(' IdentifierListOpt ')' DirectDeclarator: lhs.DirectAbstractDeclarator.directDeclarator, } } lhs.directDeclarator.DirectDeclarator.parent = lhs.directDeclarator } case 199: { yyVAL.node = (*DirectAbstractDeclaratorOpt)(nil) } case 200: { yyVAL.node = &DirectAbstractDeclaratorOpt{ DirectAbstractDeclarator: yyS[yypt-0].node.(*DirectAbstractDeclarator), } } case 201: { lx := yylex.(*lexer) lhs := &Initializer{ Expression: yyS[yypt-0].node.(*Expression), } yyVAL.node = lhs lhs.Expression.eval(lx) } case 202: { yyVAL.node = &Initializer{ Case: 1, Token: yyS[yypt-3].Token, InitializerList: yyS[yypt-2].node.(*InitializerList).reverse(), CommaOpt: yyS[yypt-1].node.(*CommaOpt), Token2: yyS[yypt-0].Token, } } case 203: { lx := yylex.(*lexer) lhs := &Initializer{ Case: 2, Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, Initializer: yyS[yypt-0].node.(*Initializer), } yyVAL.node = lhs if !lx.tweaks.enableLegacyDesignators { lx.report.Err(lhs.Pos(), "legacy designators not enabled") } } case 204: { yyVAL.node = &InitializerList{ DesignationOpt: yyS[yypt-1].node.(*DesignationOpt), Initializer: yyS[yypt-0].node.(*Initializer), } } case 205: { yyVAL.node = &InitializerList{ Case: 1, InitializerList: yyS[yypt-3].node.(*InitializerList), Token: yyS[yypt-2].Token, DesignationOpt: yyS[yypt-1].node.(*DesignationOpt), Initializer: yyS[yypt-0].node.(*Initializer), } } case 206: { yyVAL.node = (*InitializerList)(nil) } case 207: { yyVAL.node = &Designation{ DesignatorList: yyS[yypt-1].node.(*DesignatorList).reverse(), Token: yyS[yypt-0].Token, } } case 208: { yyVAL.node = (*DesignationOpt)(nil) } case 209: { yyVAL.node = &DesignationOpt{ Designation: yyS[yypt-0].node.(*Designation), } } case 210: { yyVAL.node = &DesignatorList{ Designator: yyS[yypt-0].node.(*Designator), } } case 211: { yyVAL.node = &DesignatorList{ Case: 1, DesignatorList: yyS[yypt-1].node.(*DesignatorList), Designator: yyS[yypt-0].node.(*Designator), } } case 212: { yyVAL.node = &Designator{ Token: yyS[yypt-2].Token, ConstantExpression: yyS[yypt-1].node.(*ConstantExpression), Token2: yyS[yypt-0].Token, } } case 213: { yyVAL.node = &Designator{ Case: 1, Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 214: { yyVAL.node = &Statement{ LabeledStatement: yyS[yypt-0].node.(*LabeledStatement), } } case 215: { yyVAL.node = &Statement{ Case: 1, CompoundStatement: yyS[yypt-0].node.(*CompoundStatement), } } case 216: { yyVAL.node = &Statement{ Case: 2, ExpressionStatement: yyS[yypt-0].node.(*ExpressionStatement), } } case 217: { yyVAL.node = &Statement{ Case: 3, SelectionStatement: yyS[yypt-0].node.(*SelectionStatement), } } case 218: { yyVAL.node = &Statement{ Case: 4, IterationStatement: yyS[yypt-0].node.(*IterationStatement), } } case 219: { yyVAL.node = &Statement{ Case: 5, JumpStatement: yyS[yypt-0].node.(*JumpStatement), } } case 220: { yyVAL.node = &Statement{ Case: 6, AssemblerStatement: yyS[yypt-0].node.(*AssemblerStatement), } } case 221: { yyVAL.node = &LabeledStatement{ Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, Statement: yyS[yypt-0].node.(*Statement), } } case 222: { yyVAL.node = &LabeledStatement{ Case: 1, Token: yyS[yypt-3].Token, ConstantExpression: yyS[yypt-2].node.(*ConstantExpression), Token2: yyS[yypt-1].Token, Statement: yyS[yypt-0].node.(*Statement), } } case 223: { yyVAL.node = &LabeledStatement{ Case: 2, Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, Statement: yyS[yypt-0].node.(*Statement), } } case 224: { lx := yylex.(*lexer) m := lx.scope.mergeScope lx.pushScope(ScopeBlock) if m != nil { lx.scope.merge(m) } lx.scope.mergeScope = nil } case 225: { lx := yylex.(*lexer) lhs := &CompoundStatement{ Token: yyS[yypt-3].Token, BlockItemListOpt: yyS[yypt-1].node.(*BlockItemListOpt), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.scope = lx.scope lx.popScope(lhs.Token2) } case 226: { yyVAL.node = &BlockItemList{ BlockItem: yyS[yypt-0].node.(*BlockItem), } } case 227: { yyVAL.node = &BlockItemList{ Case: 1, BlockItemList: yyS[yypt-1].node.(*BlockItemList), BlockItem: yyS[yypt-0].node.(*BlockItem), } } case 228: { yyVAL.node = (*BlockItemListOpt)(nil) } case 229: { yyVAL.node = &BlockItemListOpt{ BlockItemList: yyS[yypt-0].node.(*BlockItemList).reverse(), } } case 230: { yyVAL.node = &BlockItem{ Declaration: yyS[yypt-0].node.(*Declaration), } } case 231: { yyVAL.node = &BlockItem{ Case: 1, Statement: yyS[yypt-0].node.(*Statement), } } case 232: { yyVAL.node = &ExpressionStatement{ ExpressionListOpt: yyS[yypt-1].node.(*ExpressionListOpt), Token: yyS[yypt-0].Token, } } case 233: { lx := yylex.(*lexer) lhs := &SelectionStatement{ Token: yyS[yypt-4].Token, Token2: yyS[yypt-3].Token, ExpressionList: yyS[yypt-2].node.(*ExpressionList).reverse(), Token3: yyS[yypt-1].Token, Statement: yyS[yypt-0].node.(*Statement), } yyVAL.node = lhs lhs.ExpressionList.eval(lx) } case 234: { lx := yylex.(*lexer) lhs := &SelectionStatement{ Case: 1, Token: yyS[yypt-6].Token, Token2: yyS[yypt-5].Token, ExpressionList: yyS[yypt-4].node.(*ExpressionList).reverse(), Token3: yyS[yypt-3].Token, Statement: yyS[yypt-2].node.(*Statement), Token4: yyS[yypt-1].Token, Statement2: yyS[yypt-0].node.(*Statement), } yyVAL.node = lhs lhs.ExpressionList.eval(lx) } case 235: { lx := yylex.(*lexer) lhs := &SelectionStatement{ Case: 2, Token: yyS[yypt-4].Token, Token2: yyS[yypt-3].Token, ExpressionList: yyS[yypt-2].node.(*ExpressionList).reverse(), Token3: yyS[yypt-1].Token, Statement: yyS[yypt-0].node.(*Statement), } yyVAL.node = lhs lhs.ExpressionList.eval(lx) } case 236: { lx := yylex.(*lexer) lhs := &IterationStatement{ Token: yyS[yypt-4].Token, Token2: yyS[yypt-3].Token, ExpressionList: yyS[yypt-2].node.(*ExpressionList).reverse(), Token3: yyS[yypt-1].Token, Statement: yyS[yypt-0].node.(*Statement), } yyVAL.node = lhs lhs.ExpressionList.eval(lx) } case 237: { lx := yylex.(*lexer) lhs := &IterationStatement{ Case: 1, Token: yyS[yypt-6].Token, Statement: yyS[yypt-5].node.(*Statement), Token2: yyS[yypt-4].Token, Token3: yyS[yypt-3].Token, ExpressionList: yyS[yypt-2].node.(*ExpressionList).reverse(), Token4: yyS[yypt-1].Token, Token5: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.ExpressionList.eval(lx) } case 238: { yyVAL.node = &IterationStatement{ Case: 2, Token: yyS[yypt-8].Token, Token2: yyS[yypt-7].Token, ExpressionListOpt: yyS[yypt-6].node.(*ExpressionListOpt), Token3: yyS[yypt-5].Token, ExpressionListOpt2: yyS[yypt-4].node.(*ExpressionListOpt), Token4: yyS[yypt-3].Token, ExpressionListOpt3: yyS[yypt-2].node.(*ExpressionListOpt), Token5: yyS[yypt-1].Token, Statement: yyS[yypt-0].node.(*Statement), } } case 239: { yyVAL.node = &IterationStatement{ Case: 3, Token: yyS[yypt-7].Token, Token2: yyS[yypt-6].Token, Declaration: yyS[yypt-5].node.(*Declaration), ExpressionListOpt: yyS[yypt-4].node.(*ExpressionListOpt), Token3: yyS[yypt-3].Token, ExpressionListOpt2: yyS[yypt-2].node.(*ExpressionListOpt), Token4: yyS[yypt-1].Token, Statement: yyS[yypt-0].node.(*Statement), } } case 240: { yyVAL.node = &JumpStatement{ Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, Token3: yyS[yypt-0].Token, } } case 241: { yyVAL.node = &JumpStatement{ Case: 1, Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 242: { yyVAL.node = &JumpStatement{ Case: 2, Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 243: { yyVAL.node = &JumpStatement{ Case: 3, Token: yyS[yypt-2].Token, ExpressionListOpt: yyS[yypt-1].node.(*ExpressionListOpt), Token2: yyS[yypt-0].Token, } } case 244: { lx := yylex.(*lexer) lhs := &JumpStatement{ Case: 4, Token: yyS[yypt-2].Token, Expression: yyS[yypt-1].node.(*Expression), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs _, t := lhs.Expression.eval(lx) if t == nil { break } for t != nil && t.Kind() == Ptr { t = t.Element() } if t == nil || t.Kind() != Void { lx.report.Err(lhs.Pos(), "invalid computed goto argument type, have '%s'", t) } if !lx.tweaks.enableComputedGotos { lx.report.Err(lhs.Pos(), "computed gotos not enabled") } } case 245: { yyVAL.node = &TranslationUnit{ ExternalDeclaration: yyS[yypt-0].node.(*ExternalDeclaration), } } case 246: { yyVAL.node = &TranslationUnit{ Case: 1, TranslationUnit: yyS[yypt-1].node.(*TranslationUnit), ExternalDeclaration: yyS[yypt-0].node.(*ExternalDeclaration), } } case 247: { yyVAL.node = &ExternalDeclaration{ FunctionDefinition: yyS[yypt-0].node.(*FunctionDefinition), } } case 248: { yyVAL.node = &ExternalDeclaration{ Case: 1, Declaration: yyS[yypt-0].node.(*Declaration), } } case 249: { yyVAL.node = &ExternalDeclaration{ Case: 2, BasicAssemblerStatement: yyS[yypt-1].node.(*BasicAssemblerStatement), Token: yyS[yypt-0].Token, } } case 250: { lx := yylex.(*lexer) lhs := &ExternalDeclaration{ Case: 3, Token: yyS[yypt-0].Token, } yyVAL.node = lhs if !lx.tweaks.enableEmptyDeclarations { lx.report.Err(lhs.Pos(), "C++11 empty declarations are illegal in C99.") } } case 251: { lx := yylex.(*lexer) if ds := yyS[yypt-2].node.(*DeclarationSpecifiers); ds.typeSpecifier == 0 { ds.typeSpecifier = tsEncode(tsInt) yyS[yypt-1].node.(*Declarator).Type = lx.model.IntType if !lx.tweaks.enableOmitFuncRetType { lx.report.Err(yyS[yypt-1].node.Pos(), "missing function return type") } } var fd *FunctionDefinition fd.post(lx, yyS[yypt-1].node.(*Declarator), yyS[yypt-0].node.(*DeclarationListOpt)) } case 252: { yyVAL.node = &FunctionDefinition{ DeclarationSpecifiers: yyS[yypt-4].node.(*DeclarationSpecifiers), Declarator: yyS[yypt-3].node.(*Declarator), DeclarationListOpt: yyS[yypt-2].node.(*DeclarationListOpt), FunctionBody: yyS[yypt-0].node.(*FunctionBody), } } case 253: { lx := yylex.(*lexer) lx.scope.specifier = &DeclarationSpecifiers{typeSpecifier: tsEncode(tsInt)} } case 254: { lx := yylex.(*lexer) if !lx.tweaks.enableOmitFuncRetType { lx.report.Err(yyS[yypt-1].node.Pos(), "missing function return type") } var fd *FunctionDefinition fd.post(lx, yyS[yypt-1].node.(*Declarator), yyS[yypt-0].node.(*DeclarationListOpt)) } case 255: { yyVAL.node = &FunctionDefinition{ Case: 1, Declarator: yyS[yypt-3].node.(*Declarator), DeclarationListOpt: yyS[yypt-2].node.(*DeclarationListOpt), FunctionBody: yyS[yypt-0].node.(*FunctionBody), } } case 256: { lx := yylex.(*lexer) // Handle __func__, [0], 6.4.2.2. id, _ := lx.fnDeclarator.Identifier() lx.injectFunc = []xc.Token{ {lex.Char{Rune: STATIC}, idStatic}, {lex.Char{Rune: CONST}, idConst}, {lex.Char{Rune: CHAR}, idChar}, {lex.Char{Rune: IDENTIFIER}, idMagicFunc}, {lex.Char{Rune: '['}, 0}, {lex.Char{Rune: ']'}, 0}, {lex.Char{Rune: '='}, 0}, {lex.Char{Rune: STRINGLITERAL}, xc.Dict.SID(fmt.Sprintf("%q", xc.Dict.S(id)))}, {lex.Char{Rune: ';'}, 0}, } } case 257: { lhs := &FunctionBody{ CompoundStatement: yyS[yypt-0].node.(*CompoundStatement), } yyVAL.node = lhs lhs.scope = lhs.CompoundStatement.scope } case 258: { lx := yylex.(*lexer) m := lx.scope.mergeScope lx.pushScope(ScopeBlock) if m != nil { lx.scope.merge(m) } lx.scope.mergeScope = nil } case 259: { lx := yylex.(*lexer) lhs := &FunctionBody{ Case: 1, AssemblerStatement: yyS[yypt-1].node.(*AssemblerStatement), Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.scope = lx.scope lx.popScope(lx.tokPrev) } case 260: { yyVAL.node = &DeclarationList{ Declaration: yyS[yypt-0].node.(*Declaration), } } case 261: { yyVAL.node = &DeclarationList{ Case: 1, DeclarationList: yyS[yypt-1].node.(*DeclarationList), Declaration: yyS[yypt-0].node.(*Declaration), } } case 262: { yyVAL.node = (*DeclarationListOpt)(nil) } case 263: { lx := yylex.(*lexer) lx.pushScope(ScopeParams) } case 264: { lx := yylex.(*lexer) lhs := &DeclarationListOpt{ DeclarationList: yyS[yypt-0].node.(*DeclarationList).reverse(), } yyVAL.node = lhs lhs.paramsScope, _ = lx.popScopePos(lhs.Pos()) } case 265: { yyVAL.node = &AssemblerInstructions{ Token: yyS[yypt-0].Token, } } case 266: { yyVAL.node = &AssemblerInstructions{ Case: 1, AssemblerInstructions: yyS[yypt-1].node.(*AssemblerInstructions), Token: yyS[yypt-0].Token, } } case 267: { yyVAL.node = &BasicAssemblerStatement{ Token: yyS[yypt-4].Token, VolatileOpt: yyS[yypt-3].node.(*VolatileOpt), Token2: yyS[yypt-2].Token, AssemblerInstructions: yyS[yypt-1].node.(*AssemblerInstructions).reverse(), Token3: yyS[yypt-0].Token, } } case 268: { yyVAL.node = (*VolatileOpt)(nil) } case 269: { yyVAL.node = &VolatileOpt{ Token: yyS[yypt-0].Token, } } case 270: { yyVAL.node = &AssemblerOperand{ AssemblerSymbolicNameOpt: yyS[yypt-4].node.(*AssemblerSymbolicNameOpt), Token: yyS[yypt-3].Token, Token2: yyS[yypt-2].Token, Expression: yyS[yypt-1].node.(*Expression), Token3: yyS[yypt-0].Token, } } case 271: { yyVAL.node = &AssemblerOperands{ AssemblerOperand: yyS[yypt-0].node.(*AssemblerOperand), } } case 272: { yyVAL.node = &AssemblerOperands{ Case: 1, AssemblerOperands: yyS[yypt-2].node.(*AssemblerOperands), Token: yyS[yypt-1].Token, AssemblerOperand: yyS[yypt-0].node.(*AssemblerOperand), } } case 273: { yyVAL.node = (*AssemblerSymbolicNameOpt)(nil) } case 274: { yyVAL.node = &AssemblerSymbolicNameOpt{ Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, Token3: yyS[yypt-0].Token, } } case 275: { yyVAL.node = &Clobbers{ Token: yyS[yypt-0].Token, } } case 276: { yyVAL.node = &Clobbers{ Case: 1, Clobbers: yyS[yypt-2].node.(*Clobbers), Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 277: { yyVAL.node = &AssemblerStatement{ BasicAssemblerStatement: yyS[yypt-0].node.(*BasicAssemblerStatement), } } case 278: { yyVAL.node = &AssemblerStatement{ Case: 1, Token: yyS[yypt-6].Token, VolatileOpt: yyS[yypt-5].node.(*VolatileOpt), Token2: yyS[yypt-4].Token, AssemblerInstructions: yyS[yypt-3].node.(*AssemblerInstructions).reverse(), Token3: yyS[yypt-2].Token, AssemblerOperands: yyS[yypt-1].node.(*AssemblerOperands).reverse(), Token4: yyS[yypt-0].Token, } } case 279: { yyVAL.node = &AssemblerStatement{ Case: 2, Token: yyS[yypt-8].Token, VolatileOpt: yyS[yypt-7].node.(*VolatileOpt), Token2: yyS[yypt-6].Token, AssemblerInstructions: yyS[yypt-5].node.(*AssemblerInstructions).reverse(), Token3: yyS[yypt-4].Token, AssemblerOperands: yyS[yypt-3].node.(*AssemblerOperands).reverse(), Token4: yyS[yypt-2].Token, AssemblerOperands2: yyS[yypt-1].node.(*AssemblerOperands).reverse(), Token5: yyS[yypt-0].Token, } } case 280: { yyVAL.node = &AssemblerStatement{ Case: 3, Token: yyS[yypt-10].Token, VolatileOpt: yyS[yypt-9].node.(*VolatileOpt), Token2: yyS[yypt-8].Token, AssemblerInstructions: yyS[yypt-7].node.(*AssemblerInstructions).reverse(), Token3: yyS[yypt-6].Token, AssemblerOperands: yyS[yypt-5].node.(*AssemblerOperands).reverse(), Token4: yyS[yypt-4].Token, AssemblerOperands2: yyS[yypt-3].node.(*AssemblerOperands).reverse(), Token5: yyS[yypt-2].Token, Clobbers: yyS[yypt-1].node.(*Clobbers).reverse(), Token6: yyS[yypt-0].Token, } } case 281: { yyVAL.node = &AssemblerStatement{ Case: 4, Token: yyS[yypt-12].Token, VolatileOpt: yyS[yypt-11].node.(*VolatileOpt), Token2: yyS[yypt-10].Token, Token3: yyS[yypt-9].Token, AssemblerInstructions: yyS[yypt-8].node.(*AssemblerInstructions).reverse(), Token4: yyS[yypt-7].Token, Token5: yyS[yypt-6].Token, AssemblerOperands: yyS[yypt-5].node.(*AssemblerOperands).reverse(), Token6: yyS[yypt-4].Token, Clobbers: yyS[yypt-3].node.(*Clobbers).reverse(), Token7: yyS[yypt-2].Token, IdentifierList: yyS[yypt-1].node.(*IdentifierList).reverse(), Token8: yyS[yypt-0].Token, } } case 282: { yyVAL.node = &AssemblerStatement{ Case: 5, Token: yyS[yypt-5].Token, VolatileOpt: yyS[yypt-4].node.(*VolatileOpt), Token2: yyS[yypt-3].Token, AssemblerInstructions: yyS[yypt-2].node.(*AssemblerInstructions).reverse(), Token3: yyS[yypt-1].Token, Token4: yyS[yypt-0].Token, } } case 283: { yyVAL.node = &AssemblerStatement{ Case: 6, Token: yyS[yypt-7].Token, VolatileOpt: yyS[yypt-6].node.(*VolatileOpt), Token2: yyS[yypt-5].Token, AssemblerInstructions: yyS[yypt-4].node.(*AssemblerInstructions).reverse(), Token3: yyS[yypt-3].Token, Token4: yyS[yypt-2].Token, AssemblerOperands: yyS[yypt-1].node.(*AssemblerOperands).reverse(), Token5: yyS[yypt-0].Token, } } case 284: { lx := yylex.(*lexer) lhs := &StaticAssertDeclaration{ Token: yyS[yypt-6].Token, Token2: yyS[yypt-5].Token, ConstantExpression: yyS[yypt-4].node.(*ConstantExpression), Token3: yyS[yypt-3].Token, Token4: yyS[yypt-2].Token, Token5: yyS[yypt-1].Token, Token6: yyS[yypt-0].Token, } yyVAL.node = lhs ce := lhs.ConstantExpression if ce.Type == nil || ce.Type.Kind() == Undefined || ce.Value == nil || !IsIntType(ce.Type) { lx.report.Err(ce.Pos(), "invalid static assert expression (have '%v')", ce.Type) break } if !isNonZero(ce.Value) { lx.report.ErrTok(lhs.Token, "%s", lhs.Token4.S()) } } case 285: { lx := yylex.(*lexer) lhs := &PreprocessingFile{ GroupList: yyS[yypt-0].node.(*GroupList).reverse(), } yyVAL.node = lhs lhs.path = lx.file.Name() } case 286: { yyVAL.node = &GroupList{ GroupPart: yyS[yypt-0].groupPart, } } case 287: { yyVAL.node = &GroupList{ Case: 1, GroupList: yyS[yypt-1].node.(*GroupList), GroupPart: yyS[yypt-0].groupPart, } } case 288: { yyVAL.node = (*GroupListOpt)(nil) } case 289: { yyVAL.node = &GroupListOpt{ GroupList: yyS[yypt-0].node.(*GroupList).reverse(), } } case 290: { yyVAL.groupPart = yyS[yypt-0].node.(Node) } case 291: { yyVAL.groupPart = yyS[yypt-0].node.(Node) } case 292: { yyVAL.groupPart = yyS[yypt-2].Token } case 293: { yyVAL.groupPart = yyS[yypt-0].toks } case 294: { yyVAL.node = &IfSection{ IfGroup: yyS[yypt-3].node.(*IfGroup), ElifGroupListOpt: yyS[yypt-2].node.(*ElifGroupListOpt), ElseGroupOpt: yyS[yypt-1].node.(*ElseGroupOpt), EndifLine: yyS[yypt-0].node.(*EndifLine), } } case 295: { yyVAL.node = &IfGroup{ Token: yyS[yypt-3].Token, PPTokenList: yyS[yypt-2].toks, Token2: yyS[yypt-1].Token, GroupListOpt: yyS[yypt-0].node.(*GroupListOpt), } } case 296: { yyVAL.node = &IfGroup{ Case: 1, Token: yyS[yypt-3].Token, Token2: yyS[yypt-2].Token, Token3: yyS[yypt-1].Token, GroupListOpt: yyS[yypt-0].node.(*GroupListOpt), } } case 297: { yyVAL.node = &IfGroup{ Case: 2, Token: yyS[yypt-3].Token, Token2: yyS[yypt-2].Token, Token3: yyS[yypt-1].Token, GroupListOpt: yyS[yypt-0].node.(*GroupListOpt), } } case 298: { yyVAL.node = &ElifGroupList{ ElifGroup: yyS[yypt-0].node.(*ElifGroup), } } case 299: { yyVAL.node = &ElifGroupList{ Case: 1, ElifGroupList: yyS[yypt-1].node.(*ElifGroupList), ElifGroup: yyS[yypt-0].node.(*ElifGroup), } } case 300: { yyVAL.node = (*ElifGroupListOpt)(nil) } case 301: { yyVAL.node = &ElifGroupListOpt{ ElifGroupList: yyS[yypt-0].node.(*ElifGroupList).reverse(), } } case 302: { yyVAL.node = &ElifGroup{ Token: yyS[yypt-3].Token, PPTokenList: yyS[yypt-2].toks, Token2: yyS[yypt-1].Token, GroupListOpt: yyS[yypt-0].node.(*GroupListOpt), } } case 303: { yyVAL.node = &ElseGroup{ Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, GroupListOpt: yyS[yypt-0].node.(*GroupListOpt), } } case 304: { yyVAL.node = (*ElseGroupOpt)(nil) } case 305: { yyVAL.node = &ElseGroupOpt{ ElseGroup: yyS[yypt-0].node.(*ElseGroup), } } case 306: { yyVAL.node = &EndifLine{ Token: yyS[yypt-0].Token, } } case 307: { yyVAL.node = &ControlLine{ Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, ReplacementList: yyS[yypt-0].toks, } } case 308: { yyVAL.node = &ControlLine{ Case: 1, Token: yyS[yypt-4].Token, Token2: yyS[yypt-3].Token, Token3: yyS[yypt-2].Token, Token4: yyS[yypt-1].Token, ReplacementList: yyS[yypt-0].toks, } } case 309: { yyVAL.node = &ControlLine{ Case: 2, Token: yyS[yypt-6].Token, Token2: yyS[yypt-5].Token, IdentifierList: yyS[yypt-4].node.(*IdentifierList).reverse(), Token3: yyS[yypt-3].Token, Token4: yyS[yypt-2].Token, Token5: yyS[yypt-1].Token, ReplacementList: yyS[yypt-0].toks, } } case 310: { yyVAL.node = &ControlLine{ Case: 3, Token: yyS[yypt-4].Token, Token2: yyS[yypt-3].Token, IdentifierListOpt: yyS[yypt-2].node.(*IdentifierListOpt), Token3: yyS[yypt-1].Token, ReplacementList: yyS[yypt-0].toks, } } case 311: { yyVAL.node = &ControlLine{ Case: 4, Token: yyS[yypt-1].Token, PPTokenListOpt: yyS[yypt-0].toks, } } case 312: { yyVAL.node = &ControlLine{ Case: 5, Token: yyS[yypt-0].Token, } } case 313: { yyVAL.node = &ControlLine{ Case: 6, Token: yyS[yypt-2].Token, PPTokenList: yyS[yypt-1].toks, Token2: yyS[yypt-0].Token, } } case 314: { yyVAL.node = &ControlLine{ Case: 7, Token: yyS[yypt-2].Token, PPTokenList: yyS[yypt-1].toks, Token2: yyS[yypt-0].Token, } } case 315: { yyVAL.node = &ControlLine{ Case: 8, Token: yyS[yypt-1].Token, PPTokenListOpt: yyS[yypt-0].toks, } } case 316: { yyVAL.node = &ControlLine{ Case: 9, Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, Token3: yyS[yypt-0].Token, } } case 317: { lx := yylex.(*lexer) lhs := &ControlLine{ Case: 10, Token: yyS[yypt-5].Token, Token2: yyS[yypt-4].Token, IdentifierList: yyS[yypt-3].node.(*IdentifierList).reverse(), Token3: yyS[yypt-2].Token, Token4: yyS[yypt-1].Token, ReplacementList: yyS[yypt-0].toks, } yyVAL.node = lhs if !lx.tweaks.enableDefineOmitCommaBeforeDDD { lx.report.ErrTok(lhs.Token4, "missing comma before \"...\"") } } case 318: { lx := yylex.(*lexer) lhs := &ControlLine{ Case: 11, Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } yyVAL.node = lhs if !lx.tweaks.enableEmptyDefine { lx.report.ErrTok(lhs.Token2, "expected identifier") } } case 319: { lx := yylex.(*lexer) lhs := &ControlLine{ Case: 12, Token: yyS[yypt-3].Token, Token2: yyS[yypt-2].Token, PPTokenList: yyS[yypt-1].toks, Token3: yyS[yypt-0].Token, } yyVAL.node = lhs toks := decodeTokens(lhs.PPTokenList, nil, false) if len(toks) == 0 { lhs.Case = 9 // PPUNDEF IDENTIFIER '\n' break } lx.report.ErrTok(toks[0], "extra tokens after #undef argument") } case 320: { yyVAL.node = &ControlLine{ Case: 13, Token: yyS[yypt-2].Token, PPTokenList: yyS[yypt-1].toks, Token2: yyS[yypt-0].Token, } } case 323: { lx := yylex.(*lexer) yyVAL.toks = PPTokenList(dict.ID(lx.encBuf)) lx.encBuf = lx.encBuf[:0] lx.encPos = 0 } case 324: { yyVAL.toks = 0 } } if yyEx != nil && yyEx.Reduced(r, exState, &yyVAL) { return -1 } goto yystack /* stack new state and value */ } ================================================ FILE: parser.y ================================================ // Code generated by yy. DO NOT EDIT. %{ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on [0], 6.10. Substantial portions of expression AST size // optimizations are from [2], license of which follows. // ---------------------------------------------------------------------------- // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This grammar is derived from the C grammar in the 'ansitize' // program, which carried this notice: // // Copyright (c) 2006 Russ Cox, // Massachusetts Institute of Technology // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated // documentation files (the "Software"), to deal in the // Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, // sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, // subject to the following conditions: // // The above copyright notice and this permission notice shall // be included in all copies or substantial portions of the // Software. // // The software is provided "as is", without warranty of any // kind, express or implied, including but not limited to the // warranties of merchantability, fitness for a particular // purpose and noninfringement. In no event shall the authors // or copyright holders be liable for any claim, damages or // other liability, whether in an action of contract, tort or // otherwise, arising from, out of or in connection with the // software or the use or other dealings in the software. package cc import ( "fmt" "github.com/cznic/xc" "github.com/cznic/golex/lex" ) %} %union { Token xc.Token groupPart Node node Node toks PPTokenList } %token '!' '%' '&' '(' ')' '*' '+' ',' '-' '.' '/' ':' ';' '<' '=' '>' '?' '[' '\n' ']' '^' '{' '|' '}' '~' ADDASSIGN "+=" ALIGNOF "_Alignof" ANDAND "&&" ANDASSIGN "&=" ARROW "->" ASM "asm" AUTO "auto" BOOL "_Bool" BREAK "break" CASE "case" CAST CHAR "char" CHARCONST "character constant" COMPLEX "_Complex" CONST "const" CONSTANT_EXPRESSION 1048577 "constant expression prefix" CONTINUE "continue" DDD "..." DEC "--" DEFAULT "default" DIVASSIGN "/=" DO "do" DOUBLE "double" ELSE "else" ENUM "enum" EQ "==" EXTERN "extern" FLOAT "float" FLOATCONST "floating-point constant" FOR "for" GEQ ">=" GOTO "goto" IDENTIFIER "identifier" IDENTIFIER_LPAREN "identifier immediatelly followed by '('" IDENTIFIER_NONREPL "non replaceable identifier" IF "if" INC "++" INLINE "inline" INT "int" INTCONST "integer constant" LEQ "<=" LONG "long" LONGCHARCONST "long character constant" LONGSTRINGLITERAL "long string constant" LSH "<<" LSHASSIGN "<<=" MODASSIGN "%=" MULASSIGN "*=" NEQ "!=" NOELSE NORETURN "_Noreturn" NOSEMI ORASSIGN "|=" OROR "||" PPDEFINE "#define" PPELIF "#elif" PPELSE "#else" PPENDIF "#endif" PPERROR "#error" PPHASH_NL "#" PPHEADER_NAME "header name" PPIF "#if" PPIFDEF "#ifdef" PPIFNDEF "#ifndef" PPINCLUDE "#include" PPINCLUDE_NEXT "#include_next" PPLINE "#line" PPNONDIRECTIVE "#foo" PPNUMBER "preprocessing number" PPOTHER "ppother" PPPASTE "##" PPPRAGMA "#pragma" PPUNDEF "#undef" PREPROCESSING_FILE 1048576 "preprocessing file prefix" REGISTER "register" RESTRICT "restrict" RETURN "return" RSH ">>" RSHASSIGN ">>=" SHORT "short" SIGNED "signed" SIZEOF "sizeof" STATIC "static" STATIC_ASSERT "_Static_assert" STRINGLITERAL "string literal" STRUCT "struct" SUBASSIGN "-=" SWITCH "switch" TRANSLATION_UNIT 1048578 "translation unit prefix" TYPEDEF "typedef" TYPEDEFNAME "typedefname" TYPEOF "typeof" UNARY UNION "union" UNSIGNED "unsigned" VOID "void" VOLATILE "volatile" WHILE "while" XORASSIGN "^=" %type GroupPart "group part" %type AbstractDeclarator "abstract declarator" AbstractDeclaratorOpt "optional abstract declarator" ArgumentExpressionList "argument expression list" ArgumentExpressionListOpt "optional argument expression list" AssemblerInstructions "assembler instructions" AssemblerOperand "assembler operand" AssemblerOperands "assembler operands" AssemblerStatement "assembler statement" AssemblerSymbolicNameOpt "optional assembler symbolic name" BasicAssemblerStatement "basic assembler statement" BlockItem "block item" BlockItemList "block item list" BlockItemListOpt "optional block item list" Clobbers "clobbers" CommaOpt "optional comma" CompoundStatement "compound statement" ConstantExpression "constant expression" ControlLine "control line" Declaration "declaration" DeclarationList "declaration list" DeclarationListOpt "optional declaration list" DeclarationSpecifiers "declaration specifiers" DeclarationSpecifiersOpt "optional declaration specifiers" Declarator "declarator" DeclaratorOpt "optional declarator" Designation "designation" DesignationOpt "optional designation" Designator "designator" DesignatorList "designator list" DirectAbstractDeclarator "direct abstract declarator" DirectAbstractDeclaratorOpt "optional direct abstract declarator" DirectDeclarator "direct declarator" ElifGroup "elif group" ElifGroupList "elif group list" ElifGroupListOpt "optional elif group list" ElseGroup "else group" ElseGroupOpt "optional else group" EndifLine "endif line" EnumSpecifier "enum specifier" EnumerationConstant "enumearation constant" Enumerator "enumerator" EnumeratorList "enumerator list" Expression "expression" ExpressionList "expression list" ExpressionListOpt "optional expression list" ExpressionOpt "optional expression" ExpressionStatement "expression statement" ExternalDeclaration "external declaration" FunctionBody "function body" FunctionDefinition "function definition" FunctionSpecifier "function specifier" GroupList "group list" GroupListOpt "optional group list" IdentifierList "identifier list" IdentifierListOpt "optional identifier list" IdentifierOpt "optional identifier" IfGroup "if group" IfSection "if section" InitDeclarator "init declarator" InitDeclaratorList "init declarator list" InitDeclaratorListOpt "optional init declarator list" Initializer "initializer" InitializerList "initializer list" IterationStatement "iteration statement" JumpStatement "jump statement" LabeledStatement "labeled statement" PPTokens ParameterDeclaration "parameter declaration" ParameterList "parameter list" ParameterTypeList "parameter type list" ParameterTypeListOpt "optional parameter type list" Pointer "pointer" PointerOpt "optional pointer" PreprocessingFile "preprocessing file" SelectionStatement "selection statement" SpecifierQualifierList "specifier qualifier list" SpecifierQualifierListOpt "optional specifier qualifier list" Start Statement "statement" StaticAssertDeclaration "static assert declaration" StorageClassSpecifier "storage class specifier" StructDeclaration "struct declaration" StructDeclarationList "struct declaration list" StructDeclarator "struct declarator" StructDeclaratorList "struct declarator list" StructOrUnion "struct-or-union" StructOrUnionSpecifier "struct-or-union specifier" TranslationUnit "translation unit" TypeName "type name" TypeQualifier "type qualifier" TypeQualifierList "type qualifier list" TypeQualifierListOpt "optional type qualifier list" TypeSpecifier "type specifier" VolatileOpt "optional volatile" %type PPTokenList "token list" PPTokenListOpt "optional token list" ReplacementList "replacement list" TextLine "text line" %precedence NOSEMI %precedence ';' %precedence NOELSE %precedence ELSE %right '=' ADDASSIGN ANDASSIGN DIVASSIGN LSHASSIGN MODASSIGN MULASSIGN ORASSIGN RSHASSIGN SUBASSIGN XORASSIGN %right ':' '?' %left OROR %left ANDAND %left '|' %left '^' %left '&' %left EQ NEQ %left '<' '>' GEQ LEQ %left LSH RSH %left '+' '-' %left '%' '*' '/' %precedence CAST %left '!' '~' SIZEOF UNARY %right '(' '.' '[' ARROW DEC INC %start Start %% Start: PREPROCESSING_FILE { lx := yylex.(*lexer) lx.preprocessingFile = nil } PreprocessingFile { lx := yylex.(*lexer) lx.preprocessingFile = $3.(*PreprocessingFile) } | CONSTANT_EXPRESSION { lx := yylex.(*lexer) lx.constantExpression = nil } ConstantExpression { lx := yylex.(*lexer) lx.constantExpression = $3.(*ConstantExpression) } | TRANSLATION_UNIT { lx := yylex.(*lexer) lx.translationUnit = nil } TranslationUnit { lx := yylex.(*lexer) if lx.report.Errors(false) == nil && lx.scope.kind != ScopeFile { panic("internal error") } lx.translationUnit = $3.(*TranslationUnit).reverse() lx.translationUnit.Declarations = lx.scope } EnumerationConstant: IDENTIFIER { $$ = &EnumerationConstant{ Token: $1, } } ArgumentExpressionList: Expression { $$ = &ArgumentExpressionList{ Expression: $1.(*Expression), } } | ArgumentExpressionList ',' Expression { $$ = &ArgumentExpressionList{ Case: 1, ArgumentExpressionList: $1.(*ArgumentExpressionList), Token: $2, Expression: $3.(*Expression), } } ArgumentExpressionListOpt: /* empty */ { $$ = (*ArgumentExpressionListOpt)(nil) } | ArgumentExpressionList { $$ = &ArgumentExpressionListOpt{ ArgumentExpressionList: $1.(*ArgumentExpressionList).reverse(), } } Expression: IDENTIFIER %prec NOSEMI { lx := yylex.(*lexer) lhs := &Expression{ Token: $1, } $$ = lhs lhs.scope = lx.scope } | CHARCONST { $$ = &Expression{ Case: 1, Token: $1, } } | FLOATCONST { $$ = &Expression{ Case: 2, Token: $1, } } | INTCONST { $$ = &Expression{ Case: 3, Token: $1, } } | LONGCHARCONST { $$ = &Expression{ Case: 4, Token: $1, } } | LONGSTRINGLITERAL { $$ = &Expression{ Case: 5, Token: $1, } } | STRINGLITERAL { $$ = &Expression{ Case: 6, Token: $1, } } | '(' ExpressionList ')' { $$ = &Expression{ Case: 7, Token: $1, ExpressionList: $2.(*ExpressionList).reverse(), Token2: $3, } } | Expression '[' ExpressionList ']' { $$ = &Expression{ Case: 8, Expression: $1.(*Expression), Token: $2, ExpressionList: $3.(*ExpressionList).reverse(), Token2: $4, } } | Expression '(' ArgumentExpressionListOpt ')' { lx := yylex.(*lexer) lhs := &Expression{ Case: 9, Expression: $1.(*Expression), Token: $2, ArgumentExpressionListOpt: $3.(*ArgumentExpressionListOpt), Token2: $4, } $$ = lhs o := lhs.ArgumentExpressionListOpt if o == nil { break } if lhs.Expression.Case == 0 { // IDENTIFIER if lx.tweaks.enableBuiltinConstantP &&lhs.Expression.Token.Val == idBuiltinConstantP { break } b := lhs.Expression.scope.Lookup(NSIdentifiers, lhs.Expression.Token.Val) if b.Node == nil && lx.tweaks.enableImplicitFuncDef { for l := o.ArgumentExpressionList; l != nil; l = l.ArgumentExpressionList { l.Expression.eval(lx) } break } } lhs.Expression.eval(lx) for l := o.ArgumentExpressionList; l != nil; l = l.ArgumentExpressionList { l.Expression.eval(lx) } } | Expression '.' IDENTIFIER { $$ = &Expression{ Case: 10, Expression: $1.(*Expression), Token: $2, Token2: $3, } } | Expression "->" IDENTIFIER { $$ = &Expression{ Case: 11, Expression: $1.(*Expression), Token: $2, Token2: $3, } } | Expression "++" { $$ = &Expression{ Case: 12, Expression: $1.(*Expression), Token: $2, } } | Expression "--" { $$ = &Expression{ Case: 13, Expression: $1.(*Expression), Token: $2, } } | '(' TypeName ')' '{' InitializerList CommaOpt '}' { $$ = &Expression{ Case: 14, Token: $1, TypeName: $2.(*TypeName), Token2: $3, Token3: $4, InitializerList: $5.(*InitializerList).reverse(), CommaOpt: $6.(*CommaOpt), Token4: $7, } } | "++" Expression { $$ = &Expression{ Case: 15, Token: $1, Expression: $2.(*Expression), } } | "--" Expression { $$ = &Expression{ Case: 16, Token: $1, Expression: $2.(*Expression), } } | '&' Expression %prec UNARY { $$ = &Expression{ Case: 17, Token: $1, Expression: $2.(*Expression), } } | '*' Expression %prec UNARY { $$ = &Expression{ Case: 18, Token: $1, Expression: $2.(*Expression), } } | '+' Expression %prec UNARY { $$ = &Expression{ Case: 19, Token: $1, Expression: $2.(*Expression), } } | '-' Expression %prec UNARY { $$ = &Expression{ Case: 20, Token: $1, Expression: $2.(*Expression), } } | '~' Expression { $$ = &Expression{ Case: 21, Token: $1, Expression: $2.(*Expression), } } | '!' Expression { $$ = &Expression{ Case: 22, Token: $1, Expression: $2.(*Expression), } } | "sizeof" Expression { $$ = &Expression{ Case: 23, Token: $1, Expression: $2.(*Expression), } } | "sizeof" '(' TypeName ')' %prec SIZEOF { $$ = &Expression{ Case: 24, Token: $1, Token2: $2, TypeName: $3.(*TypeName), Token3: $4, } } | '(' TypeName ')' Expression %prec CAST { $$ = &Expression{ Case: 25, Token: $1, TypeName: $2.(*TypeName), Token2: $3, Expression: $4.(*Expression), } } | Expression '*' Expression { $$ = &Expression{ Case: 26, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression '/' Expression { $$ = &Expression{ Case: 27, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression '%' Expression { $$ = &Expression{ Case: 28, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression '+' Expression { $$ = &Expression{ Case: 29, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression '-' Expression { $$ = &Expression{ Case: 30, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "<<" Expression { $$ = &Expression{ Case: 31, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression ">>" Expression { $$ = &Expression{ Case: 32, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression '<' Expression { $$ = &Expression{ Case: 33, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression '>' Expression { $$ = &Expression{ Case: 34, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "<=" Expression { $$ = &Expression{ Case: 35, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression ">=" Expression { $$ = &Expression{ Case: 36, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "==" Expression { $$ = &Expression{ Case: 37, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "!=" Expression { $$ = &Expression{ Case: 38, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression '&' Expression { $$ = &Expression{ Case: 39, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression '^' Expression { $$ = &Expression{ Case: 40, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression '|' Expression { $$ = &Expression{ Case: 41, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "&&" Expression { $$ = &Expression{ Case: 42, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "||" Expression { $$ = &Expression{ Case: 43, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression '?' ExpressionList ':' Expression { $$ = &Expression{ Case: 44, Expression: $1.(*Expression), Token: $2, ExpressionList: $3.(*ExpressionList).reverse(), Token2: $4, Expression2: $5.(*Expression), } } | Expression '=' Expression { $$ = &Expression{ Case: 45, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "*=" Expression { $$ = &Expression{ Case: 46, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "/=" Expression { $$ = &Expression{ Case: 47, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "%=" Expression { $$ = &Expression{ Case: 48, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "+=" Expression { $$ = &Expression{ Case: 49, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "-=" Expression { $$ = &Expression{ Case: 50, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "<<=" Expression { $$ = &Expression{ Case: 51, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression ">>=" Expression { $$ = &Expression{ Case: 52, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "&=" Expression { $$ = &Expression{ Case: 53, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "^=" Expression { $$ = &Expression{ Case: 54, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | Expression "|=" Expression { $$ = &Expression{ Case: 55, Expression: $1.(*Expression), Token: $2, Expression2: $3.(*Expression), } } | "_Alignof" '(' TypeName ')' { $$ = &Expression{ Case: 56, Token: $1, Token2: $2, TypeName: $3.(*TypeName), Token3: $4, } } | '(' CompoundStatement ')' { $$ = &Expression{ Case: 57, Token: $1, CompoundStatement: $2.(*CompoundStatement), Token2: $3, } } | "&&" IDENTIFIER { lx := yylex.(*lexer) lhs := &Expression{ Case: 58, Token: $1, Token2: $2, } $$ = lhs if !lx.tweaks.enableComputedGotos { lx.report.Err(lhs.Pos(), "computed gotos not enabled") } } | Expression '?' ':' Expression { lx := yylex.(*lexer) lhs := &Expression{ Case: 59, Expression: $1.(*Expression), Token: $2, Token2: $3, Expression2: $4.(*Expression), } $$ = lhs if !lx.tweaks.enableOmitConditionalOperand { lx.report.Err(lhs.Pos(), "omitting conditional operand not enabled") } } ExpressionOpt: /* empty */ { $$ = (*ExpressionOpt)(nil) } | Expression { lx := yylex.(*lexer) lhs := &ExpressionOpt{ Expression: $1.(*Expression), } $$ = lhs lhs.Expression.eval(lx) } ExpressionList: Expression { $$ = &ExpressionList{ Expression: $1.(*Expression), } } | ExpressionList ',' Expression { $$ = &ExpressionList{ Case: 1, ExpressionList: $1.(*ExpressionList), Token: $2, Expression: $3.(*Expression), } } ExpressionListOpt: /* empty */ { $$ = (*ExpressionListOpt)(nil) } | ExpressionList { lx := yylex.(*lexer) lhs := &ExpressionListOpt{ ExpressionList: $1.(*ExpressionList).reverse(), } $$ = lhs lhs.ExpressionList.eval(lx) } ConstantExpression: { lx := yylex.(*lexer) lx.constExprToks = []xc.Token{lx.last} } Expression { lx := yylex.(*lexer) lhs := &ConstantExpression{ Expression: $2.(*Expression), } $$ = lhs lhs.Value, lhs.Type = lhs.Expression.eval(lx) if lhs.Value == nil { lx.report.Err(lhs.Pos(), "not a constant expression") } l := lx.constExprToks lhs.toks = l[:len(l)-1] lx.constExprToks = nil } Declaration: DeclarationSpecifiers InitDeclaratorListOpt ';' { lx := yylex.(*lexer) lhs := &Declaration{ DeclarationSpecifiers: $1.(*DeclarationSpecifiers), InitDeclaratorListOpt: $2.(*InitDeclaratorListOpt), Token: $3, } $$ = lhs ts0 := lhs.DeclarationSpecifiers.typeSpecifiers() if ts0 == 0 && lx.tweaks.enableImplicitIntType { lhs.DeclarationSpecifiers.typeSpecifier = tsEncode(tsInt) } ts := tsDecode(lhs.DeclarationSpecifiers.typeSpecifiers()) ok := false for _, v := range ts { if v == tsStructSpecifier || v == tsUnionSpecifier { ok = true break } } if ok { s := lhs.DeclarationSpecifiers d := &Declarator{specifier: s} dd := &DirectDeclarator{ Token: xc.Token{Char: lex.NewChar(lhs.Pos(), 0)}, declarator: d, idScope: lx.scope, specifier: s, } d.DirectDeclarator = dd d.setFull(lx) for l := lhs.DeclarationSpecifiers; l != nil; { ts := l.TypeSpecifier if ts != nil && ts.Case == 11 && ts.StructOrUnionSpecifier.Case == 0 { // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' ts.StructOrUnionSpecifier.declarator = d break } if o := l.DeclarationSpecifiersOpt; o != nil { l = o.DeclarationSpecifiers continue } break } } o := lhs.InitDeclaratorListOpt if o != nil { break } s := lhs.DeclarationSpecifiers d := &Declarator{specifier: s} dd := &DirectDeclarator{ Token: xc.Token{Char: lex.NewChar(lhs.Pos(), 0)}, declarator: d, idScope: lx.scope, specifier: s, } d.DirectDeclarator = dd d.setFull(lx) lhs.declarator = d } | StaticAssertDeclaration { $$ = &Declaration{ Case: 1, StaticAssertDeclaration: $1.(*StaticAssertDeclaration), } } DeclarationSpecifiers: StorageClassSpecifier DeclarationSpecifiersOpt { lx := yylex.(*lexer) lhs := &DeclarationSpecifiers{ StorageClassSpecifier: $1.(*StorageClassSpecifier), DeclarationSpecifiersOpt: $2.(*DeclarationSpecifiersOpt), } $$ = lhs lx.scope.specifier = lhs a := lhs.StorageClassSpecifier b := lhs.DeclarationSpecifiersOpt if b == nil { lhs.attr = a.attr break } if a.attr&b.attr != 0 { lx.report.Err(a.Pos(), "invalid storage class specifier") break } lhs.attr = a.attr|b.attr lhs.typeSpecifier = b.typeSpecifier if lhs.StorageClassSpecifier.Case != 0 /* "typedef" */ && lhs.IsTypedef() { lx.report.Err(a.Pos(), "invalid storage class specifier") } } | TypeSpecifier DeclarationSpecifiersOpt { lx := yylex.(*lexer) lhs := &DeclarationSpecifiers{ Case: 1, TypeSpecifier: $1.(*TypeSpecifier), DeclarationSpecifiersOpt: $2.(*DeclarationSpecifiersOpt), } $$ = lhs lx.scope.specifier = lhs a := lhs.TypeSpecifier b := lhs.DeclarationSpecifiersOpt if b == nil { lhs.typeSpecifier = a.typeSpecifier break } lhs.attr = b.attr tsb := tsDecode(b.typeSpecifier) if len(tsb) == 1 && tsb[0] == tsTypedefName && lx.tweaks.allowCompatibleTypedefRedefinitions { tsb[0] = 0 } ts := tsEncode(append(tsDecode(a.typeSpecifier), tsb...)...) if _, ok := tsValid[ts]; !ok { ts = tsEncode(tsInt) lx.report.Err(a.Pos(), "invalid type specifier") } lhs.typeSpecifier = ts } | TypeQualifier DeclarationSpecifiersOpt { lx := yylex.(*lexer) lhs := &DeclarationSpecifiers{ Case: 2, TypeQualifier: $1.(*TypeQualifier), DeclarationSpecifiersOpt: $2.(*DeclarationSpecifiersOpt), } $$ = lhs lx.scope.specifier = lhs a := lhs.TypeQualifier b := lhs.DeclarationSpecifiersOpt if b == nil { lhs.attr = a.attr break } if a.attr&b.attr != 0 { lx.report.Err(a.Pos(), "invalid type qualifier") break } lhs.attr = a.attr|b.attr lhs.typeSpecifier = b.typeSpecifier if lhs.IsTypedef() { lx.report.Err(a.Pos(), "invalid type qualifier") } } | FunctionSpecifier DeclarationSpecifiersOpt { lx := yylex.(*lexer) lhs := &DeclarationSpecifiers{ Case: 3, FunctionSpecifier: $1.(*FunctionSpecifier), DeclarationSpecifiersOpt: $2.(*DeclarationSpecifiersOpt), } $$ = lhs lx.scope.specifier = lhs a := lhs.FunctionSpecifier b := lhs.DeclarationSpecifiersOpt if b == nil { lhs.attr = a.attr break } if a.attr&b.attr != 0 { lx.report.Err(a.Pos(), "invalid function specifier") break } lhs.attr = a.attr|b.attr lhs.typeSpecifier = b.typeSpecifier if lhs.IsTypedef() { lx.report.Err(a.Pos(), "invalid function specifier") } } DeclarationSpecifiersOpt: /* empty */ { $$ = (*DeclarationSpecifiersOpt)(nil) } | DeclarationSpecifiers { lhs := &DeclarationSpecifiersOpt{ DeclarationSpecifiers: $1.(*DeclarationSpecifiers), } $$ = lhs lhs.attr = lhs.DeclarationSpecifiers.attr lhs.typeSpecifier = lhs.DeclarationSpecifiers.typeSpecifier } InitDeclaratorList: InitDeclarator { $$ = &InitDeclaratorList{ InitDeclarator: $1.(*InitDeclarator), } } | InitDeclaratorList ',' InitDeclarator { $$ = &InitDeclaratorList{ Case: 1, InitDeclaratorList: $1.(*InitDeclaratorList), Token: $2, InitDeclarator: $3.(*InitDeclarator), } } InitDeclaratorListOpt: /* empty */ { $$ = (*InitDeclaratorListOpt)(nil) } | InitDeclaratorList { $$ = &InitDeclaratorListOpt{ InitDeclaratorList: $1.(*InitDeclaratorList).reverse(), } } InitDeclarator: Declarator { lx := yylex.(*lexer) lhs := &InitDeclarator{ Declarator: $1.(*Declarator), } $$ = lhs lhs.Declarator.setFull(lx) } | Declarator { lx := yylex.(*lexer) d := $1.(*Declarator) d.setFull(lx) } '=' Initializer { lx := yylex.(*lexer) lhs := &InitDeclarator{ Case: 1, Declarator: $1.(*Declarator), Token: $3, Initializer: $4.(*Initializer), } $$ = lhs d := lhs.Declarator lhs.Initializer.typeCheck(&d.Type, d.Type, lhs.Declarator.specifier.IsStatic(), lx) if d.Type.Specifier().IsExtern() { id, _ := d.Identifier() lx.report.Err(d.Pos(), "'%s' initialized and declared 'extern'", dict.S(id)) } } StorageClassSpecifier: "typedef" { lhs := &StorageClassSpecifier{ Token: $1, } $$ = lhs lhs.attr = saTypedef } | "extern" { lhs := &StorageClassSpecifier{ Case: 1, Token: $1, } $$ = lhs lhs.attr = saExtern } | "static" { lhs := &StorageClassSpecifier{ Case: 2, Token: $1, } $$ = lhs lhs.attr = saStatic } | "auto" { lhs := &StorageClassSpecifier{ Case: 3, Token: $1, } $$ = lhs lhs.attr = saAuto } | "register" { lhs := &StorageClassSpecifier{ Case: 4, Token: $1, } $$ = lhs lhs.attr = saRegister } TypeSpecifier: "void" { lhs := &TypeSpecifier{ Token: $1, } $$ = lhs lhs.typeSpecifier = tsEncode(tsVoid) } | "char" { lhs := &TypeSpecifier{ Case: 1, Token: $1, } $$ = lhs lhs.typeSpecifier = tsEncode(tsChar) } | "short" { lhs := &TypeSpecifier{ Case: 2, Token: $1, } $$ = lhs lhs.typeSpecifier = tsEncode(tsShort) } | "int" { lhs := &TypeSpecifier{ Case: 3, Token: $1, } $$ = lhs lhs.typeSpecifier = tsEncode(tsInt) } | "long" { lhs := &TypeSpecifier{ Case: 4, Token: $1, } $$ = lhs lhs.typeSpecifier = tsEncode(tsLong) } | "float" { lhs := &TypeSpecifier{ Case: 5, Token: $1, } $$ = lhs lhs.typeSpecifier = tsEncode(tsFloat) } | "double" { lhs := &TypeSpecifier{ Case: 6, Token: $1, } $$ = lhs lhs.typeSpecifier = tsEncode(tsDouble) } | "signed" { lhs := &TypeSpecifier{ Case: 7, Token: $1, } $$ = lhs lhs.typeSpecifier = tsEncode(tsSigned) } | "unsigned" { lhs := &TypeSpecifier{ Case: 8, Token: $1, } $$ = lhs lhs.typeSpecifier = tsEncode(tsUnsigned) } | "_Bool" { lhs := &TypeSpecifier{ Case: 9, Token: $1, } $$ = lhs lhs.typeSpecifier = tsEncode(tsBool) } | "_Complex" { lhs := &TypeSpecifier{ Case: 10, Token: $1, } $$ = lhs lhs.typeSpecifier = tsEncode(tsComplex) } | StructOrUnionSpecifier { lhs := &TypeSpecifier{ Case: 11, StructOrUnionSpecifier: $1.(*StructOrUnionSpecifier), } $$ = lhs lhs.typeSpecifier = tsEncode(lhs.StructOrUnionSpecifier.typeSpecifiers()) } | EnumSpecifier { lhs := &TypeSpecifier{ Case: 12, EnumSpecifier: $1.(*EnumSpecifier), } $$ = lhs lhs.typeSpecifier = tsEncode(tsEnumSpecifier) } | TYPEDEFNAME { lx := yylex.(*lexer) lhs := &TypeSpecifier{ Case: 13, Token: $1, } $$ = lhs lhs.typeSpecifier = tsEncode(tsTypedefName) _, lhs.scope = lx.scope.Lookup2(NSIdentifiers, lhs.Token.Val) } | "typeof" '(' Expression ')' { lx := yylex.(*lexer) lhs := &TypeSpecifier{ Case: 14, Token: $1, Token2: $2, Expression: $3.(*Expression), Token3: $4, } $$ = lhs lhs.typeSpecifier = tsEncode(tsTypeof) _, lhs.Type = lhs.Expression.eval(lx) } | "typeof" '(' TypeName ')' { lhs := &TypeSpecifier{ Case: 15, Token: $1, Token2: $2, TypeName: $3.(*TypeName), Token3: $4, } $$ = lhs lhs.typeSpecifier = tsEncode(tsTypeof) lhs.Type = undefined if t := lhs.TypeName.Type; t != nil { lhs.Type = t } } StructOrUnionSpecifier: StructOrUnion IdentifierOpt '{' { lx := yylex.(*lexer) if o := $2.(*IdentifierOpt); o != nil { lx.scope.declareStructTag(o.Token, lx.report) } lx.pushScope(ScopeMembers) lx.scope.isUnion = $1.(*StructOrUnion).Case == 1 // "union" lx.scope.prevStructDeclarator = nil } StructDeclarationList '}' { lx := yylex.(*lexer) lhs := &StructOrUnionSpecifier{ StructOrUnion: $1.(*StructOrUnion), IdentifierOpt: $2.(*IdentifierOpt), Token: $3, StructDeclarationList: $5.(*StructDeclarationList).reverse(), Token2: $6, } $$ = lhs sc := lx.scope lhs.scope = sc if sc.bitOffset != 0 { finishBitField(lhs, lx) } i := 0 var bt Type var d *Declarator for l := lhs.StructDeclarationList; l != nil; l = l.StructDeclarationList { for l := l.StructDeclaration.StructDeclaratorList; l != nil; l = l.StructDeclaratorList { switch sd := l.StructDeclarator; sd.Case { case 0: // Declarator d = sd.Declarator case 1: // DeclaratorOpt ':' ConstantExpression if o := sd.DeclaratorOpt; o != nil { x := o.Declarator if x.bitOffset == 0 { d = x bt = lx.scope.bitFieldTypes[i] i++ } x.bitFieldType = bt } } } } lx.scope.bitFieldTypes = nil lhs.alignOf = sc.maxAlign switch { case sc.isUnion: lhs.sizeOf = align(sc.maxSize, sc.maxAlign) default: off := sc.offset lhs.sizeOf = align(sc.offset, sc.maxAlign) if d != nil { d.padding = lhs.sizeOf-off } } lx.popScope(lhs.Token2) if o := lhs.IdentifierOpt; o != nil { lx.scope.defineStructTag(o.Token, lhs, lx.report) } } | StructOrUnion IDENTIFIER { lx := yylex.(*lexer) lhs := &StructOrUnionSpecifier{ Case: 1, StructOrUnion: $1.(*StructOrUnion), Token: $2, } $$ = lhs lx.scope.declareStructTag(lhs.Token, lx.report) lhs.scope = lx.scope } | StructOrUnion IdentifierOpt '{' '}' { lx := yylex.(*lexer) lhs := &StructOrUnionSpecifier{ Case: 2, StructOrUnion: $1.(*StructOrUnion), IdentifierOpt: $2.(*IdentifierOpt), Token: $3, Token2: $4, } $$ = lhs if !lx.tweaks.enableEmptyStructs { lx.report.Err(lhs.Token.Pos(), "empty structs/unions not allowed") } if o := $2.(*IdentifierOpt); o != nil { lx.scope.declareStructTag(o.Token, lx.report) } lx.scope.isUnion = $1.(*StructOrUnion).Case == 1 // "union" lx.scope.prevStructDeclarator = nil lhs.alignOf = 1 lhs.sizeOf = 0 if o := lhs.IdentifierOpt; o != nil { lx.scope.defineStructTag(o.Token, lhs, lx.report) } } StructOrUnion: "struct" { $$ = &StructOrUnion{ Token: $1, } } | "union" { $$ = &StructOrUnion{ Case: 1, Token: $1, } } StructDeclarationList: StructDeclaration { $$ = &StructDeclarationList{ StructDeclaration: $1.(*StructDeclaration), } } | StructDeclarationList StructDeclaration { $$ = &StructDeclarationList{ Case: 1, StructDeclarationList: $1.(*StructDeclarationList), StructDeclaration: $2.(*StructDeclaration), } } StructDeclaration: SpecifierQualifierList StructDeclaratorList ';' { lx := yylex.(*lexer) lhs := &StructDeclaration{ SpecifierQualifierList: $1.(*SpecifierQualifierList), StructDeclaratorList: $2.(*StructDeclaratorList).reverse(), Token: $3, } $$ = lhs s := lhs.SpecifierQualifierList if k := s.kind(); k != Struct && k != Union { break } d := &Declarator{specifier: s} dd := &DirectDeclarator{ Token: xc.Token{Char: lex.NewChar(lhs.Pos(), 0)}, declarator: d, idScope: lx.scope, specifier: s, } d.DirectDeclarator = dd d.setFull(lx) for l := lhs.SpecifierQualifierList; l != nil; { ts := l.TypeSpecifier if ts != nil && ts.Case == 11 && ts.StructOrUnionSpecifier.Case == 0 { // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' ts.StructOrUnionSpecifier.declarator = d break } if o := l.SpecifierQualifierListOpt; o != nil { l = o.SpecifierQualifierList continue } break } } | SpecifierQualifierList ';' { lx := yylex.(*lexer) lhs := &StructDeclaration{ Case: 1, SpecifierQualifierList: $1.(*SpecifierQualifierList), Token: $2, } $$ = lhs s := lhs.SpecifierQualifierList if !lx.tweaks.enableAnonymousStructFields { lx.report.Err(lhs.Token.Pos(), "unnamed fields not allowed") } else if k := s.kind(); k != Struct && k != Union { lx.report.Err(lhs.Token.Pos(), "only unnamed structs and unions are allowed") break } d := &Declarator{specifier: s} dd := &DirectDeclarator{ Token: xc.Token{Char: lex.NewChar(lhs.Pos(), 0)}, declarator: d, idScope: lx.scope, specifier: s, } d.DirectDeclarator = dd d.setFull(lx) // we have no struct declarators to parse, so we have to create the case of one implicit declarator // because else the size of anonymous members is not included in the struct size! dummy := &StructDeclarator{Declarator: d} dummy.post(lx) for l := lhs.SpecifierQualifierList; l != nil; { ts := l.TypeSpecifier if ts != nil && ts.Case == 11 && ts.StructOrUnionSpecifier.Case == 0 { // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' ts.StructOrUnionSpecifier.declarator = d break } if o := l.SpecifierQualifierListOpt; o != nil { l = o.SpecifierQualifierList continue } break } } | StaticAssertDeclaration { $$ = &StructDeclaration{ Case: 2, StaticAssertDeclaration: $1.(*StaticAssertDeclaration), } } SpecifierQualifierList: TypeSpecifier SpecifierQualifierListOpt { lx := yylex.(*lexer) lhs := &SpecifierQualifierList{ TypeSpecifier: $1.(*TypeSpecifier), SpecifierQualifierListOpt: $2.(*SpecifierQualifierListOpt), } $$ = lhs lx.scope.specifier = lhs a := lhs.TypeSpecifier b := lhs.SpecifierQualifierListOpt if b == nil { lhs.typeSpecifier = a.typeSpecifier break } lhs.attr = b.attr ts := tsEncode(append(tsDecode(a.typeSpecifier), tsDecode(b.typeSpecifier)...)...) if _, ok := tsValid[ts]; !ok { lx.report.Err(a.Pos(), "invalid type specifier") break } lhs.typeSpecifier = ts } | TypeQualifier SpecifierQualifierListOpt { lx := yylex.(*lexer) lhs := &SpecifierQualifierList{ Case: 1, TypeQualifier: $1.(*TypeQualifier), SpecifierQualifierListOpt: $2.(*SpecifierQualifierListOpt), } $$ = lhs lx.scope.specifier = lhs a := lhs.TypeQualifier b := lhs.SpecifierQualifierListOpt if b == nil { lhs.attr = a.attr break } if a.attr&b.attr != 0 { lx.report.Err(a.Pos(), "invalid type qualifier") break } lhs.attr = a.attr|b.attr lhs.typeSpecifier = b.typeSpecifier } SpecifierQualifierListOpt: /* empty */ { $$ = (*SpecifierQualifierListOpt)(nil) } | SpecifierQualifierList { lhs := &SpecifierQualifierListOpt{ SpecifierQualifierList: $1.(*SpecifierQualifierList), } $$ = lhs lhs.attr = lhs.SpecifierQualifierList.attr lhs.typeSpecifier = lhs.SpecifierQualifierList.typeSpecifier } StructDeclaratorList: StructDeclarator { $$ = &StructDeclaratorList{ StructDeclarator: $1.(*StructDeclarator), } } | StructDeclaratorList ',' StructDeclarator { $$ = &StructDeclaratorList{ Case: 1, StructDeclaratorList: $1.(*StructDeclaratorList), Token: $2, StructDeclarator: $3.(*StructDeclarator), } } StructDeclarator: Declarator { lx := yylex.(*lexer) lhs := &StructDeclarator{ Declarator: $1.(*Declarator), } $$ = lhs lhs.Declarator.setFull(lx) lhs.post(lx) } | DeclaratorOpt ':' ConstantExpression { lx := yylex.(*lexer) lhs := &StructDeclarator{ Case: 1, DeclaratorOpt: $1.(*DeclaratorOpt), Token: $2, ConstantExpression: $3.(*ConstantExpression), } $$ = lhs m := lx.model e := lhs.ConstantExpression if e.Value == nil { e.Value, e.Type = m.value2(1, m.IntType) } if !IsIntType(e.Type) { lx.report.Err(e.Pos(), "bit field width not an integer (have '%s')", e.Type) e.Value, e.Type = m.value2(1, m.IntType) } if o := lhs.DeclaratorOpt; o != nil { o.Declarator.setFull(lx) } lhs.post(lx) } CommaOpt: /* empty */ { $$ = (*CommaOpt)(nil) } | ',' { $$ = &CommaOpt{ Token: $1, } } EnumSpecifier: "enum" IdentifierOpt { lx := yylex.(*lexer) if o := $2.(*IdentifierOpt); o != nil { lx.scope.declareEnumTag(o.Token, lx.report) } lx.iota = 0 } '{' EnumeratorList CommaOpt '}' { lx := yylex.(*lexer) lhs := &EnumSpecifier{ Token: $1, IdentifierOpt: $2.(*IdentifierOpt), Token2: $4, EnumeratorList: $5.(*EnumeratorList).reverse(), CommaOpt: $6.(*CommaOpt), Token3: $7, } $$ = lhs if o := lhs.IdentifierOpt; o != nil { lx.scope.defineEnumTag(o.Token, lhs, lx.report) } if !lx.tweaks.enableUnsignedEnums { break } lhs.unsigned = true loop: for l := lhs.EnumeratorList; l != nil; l = l.EnumeratorList { switch e := l.Enumerator; x := e.Value.(type) { case int32: if x < 0 { lhs.unsigned = false break loop } case int64: if x < 0 { lhs.unsigned = false break loop } default: panic(fmt.Errorf("%s: TODO Enumerator.Value type %T", position(e.Pos()), x)) } } } | "enum" IDENTIFIER { lx := yylex.(*lexer) lhs := &EnumSpecifier{ Case: 1, Token: $1, Token2: $2, } $$ = lhs lx.scope.declareEnumTag(lhs.Token2, lx.report) } EnumeratorList: Enumerator { $$ = &EnumeratorList{ Enumerator: $1.(*Enumerator), } } | EnumeratorList ',' Enumerator { $$ = &EnumeratorList{ Case: 1, EnumeratorList: $1.(*EnumeratorList), Token: $2, Enumerator: $3.(*Enumerator), } } Enumerator: EnumerationConstant { lx := yylex.(*lexer) lhs := &Enumerator{ EnumerationConstant: $1.(*EnumerationConstant), } $$ = lhs m := lx.model v := m.MustConvert(lx.iota, m.IntType) lhs.Value = v lx.scope.defineEnumConst(lx, lhs.EnumerationConstant.Token, v) } | EnumerationConstant '=' ConstantExpression { lx := yylex.(*lexer) lhs := &Enumerator{ Case: 1, EnumerationConstant: $1.(*EnumerationConstant), Token: $2, ConstantExpression: $3.(*ConstantExpression), } $$ = lhs m := lx.model e := lhs.ConstantExpression var v interface{} // [0], 6.7.2.2 // The expression that defines the value of an enumeration // constant shall be an integer constant expression that has a // value representable as an int. switch { case !IsIntType(e.Type): lx.report.Err(e.Pos(), "not an integer constant expression (have '%s')", e.Type) v = m.MustConvert(int32(0), m.IntType) default: var ok bool if v, ok = m.enumValueToInt(e.Value); !ok { lx.report.Err(e.Pos(), "overflow in enumeration value: %v", e.Value) } } lhs.Value = v lx.scope.defineEnumConst(lx, lhs.EnumerationConstant.Token, v) } TypeQualifier: "const" { lhs := &TypeQualifier{ Token: $1, } $$ = lhs lhs.attr = saConst } | "restrict" { lhs := &TypeQualifier{ Case: 1, Token: $1, } $$ = lhs lhs.attr = saRestrict } | "volatile" { lhs := &TypeQualifier{ Case: 2, Token: $1, } $$ = lhs lhs.attr = saVolatile } FunctionSpecifier: "inline" { lhs := &FunctionSpecifier{ Token: $1, } $$ = lhs lhs.attr = saInline } | "_Noreturn" { lhs := &FunctionSpecifier{ Case: 1, Token: $1, } $$ = lhs lhs.attr = saNoreturn } Declarator: PointerOpt DirectDeclarator { lx := yylex.(*lexer) lhs := &Declarator{ PointerOpt: $1.(*PointerOpt), DirectDeclarator: $2.(*DirectDeclarator), } $$ = lhs lhs.specifier = lx.scope.specifier lhs.DirectDeclarator.declarator = lhs } DeclaratorOpt: /* empty */ { $$ = (*DeclaratorOpt)(nil) } | Declarator { $$ = &DeclaratorOpt{ Declarator: $1.(*Declarator), } } DirectDeclarator: IDENTIFIER { lx := yylex.(*lexer) lhs := &DirectDeclarator{ Token: $1, } $$ = lhs lhs.specifier = lx.scope.specifier lx.scope.declareIdentifier(lhs.Token, lhs, lx.report) lhs.idScope = lx.scope } | '(' Declarator ')' { lhs := &DirectDeclarator{ Case: 1, Token: $1, Declarator: $2.(*Declarator), Token2: $3, } $$ = lhs lhs.Declarator.specifier = nil lhs.Declarator.DirectDeclarator.parent = lhs } | DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' { lx := yylex.(*lexer) lhs := &DirectDeclarator{ Case: 2, DirectDeclarator: $1.(*DirectDeclarator), Token: $2, TypeQualifierListOpt: $3.(*TypeQualifierListOpt), ExpressionOpt: $4.(*ExpressionOpt), Token2: $5, } $$ = lhs lhs.elements = -1 if o := lhs.ExpressionOpt; o != nil { var err error if lhs.elements, err = elements(o.Expression.eval(lx)); err != nil { lx.report.Err(o.Expression.Pos(), "%s", err) } } lhs.DirectDeclarator.parent = lhs } | DirectDeclarator '[' "static" TypeQualifierListOpt Expression ']' { lx := yylex.(*lexer) lhs := &DirectDeclarator{ Case: 3, DirectDeclarator: $1.(*DirectDeclarator), Token: $2, Token2: $3, TypeQualifierListOpt: $4.(*TypeQualifierListOpt), Expression: $5.(*Expression), Token3: $6, } $$ = lhs var err error if lhs.elements, err = elements(lhs.Expression.eval(lx)); err != nil { lx.report.Err(lhs.Expression.Pos(), "%s", err) } lhs.DirectDeclarator.parent = lhs } | DirectDeclarator '[' TypeQualifierList "static" Expression ']' { lx := yylex.(*lexer) lhs := &DirectDeclarator{ Case: 4, DirectDeclarator: $1.(*DirectDeclarator), Token: $2, TypeQualifierList: $3.(*TypeQualifierList).reverse(), Token2: $4, Expression: $5.(*Expression), Token3: $6, } $$ = lhs var err error if lhs.elements, err = elements(lhs.Expression.eval(lx)); err != nil { lx.report.Err(lhs.Expression.Pos(), "%s", err) } lhs.DirectDeclarator.parent = lhs } | DirectDeclarator '[' TypeQualifierListOpt '*' ']' { lhs := &DirectDeclarator{ Case: 5, DirectDeclarator: $1.(*DirectDeclarator), Token: $2, TypeQualifierListOpt: $3.(*TypeQualifierListOpt), Token2: $4, Token3: $5, } $$ = lhs lhs.DirectDeclarator.parent = lhs lhs.elements = -1 } | DirectDeclarator '(' { lx := yylex.(*lexer) lx.pushScope(ScopeParams) } ParameterTypeList ')' { lx := yylex.(*lexer) lhs := &DirectDeclarator{ Case: 6, DirectDeclarator: $1.(*DirectDeclarator), Token: $2, ParameterTypeList: $4.(*ParameterTypeList), Token2: $5, } $$ = lhs lhs.paramsScope, _ = lx.popScope(lhs.Token2) lhs.DirectDeclarator.parent = lhs } | DirectDeclarator '(' IdentifierListOpt ')' { lhs := &DirectDeclarator{ Case: 7, DirectDeclarator: $1.(*DirectDeclarator), Token: $2, IdentifierListOpt: $3.(*IdentifierListOpt), Token2: $4, } $$ = lhs lhs.DirectDeclarator.parent = lhs } Pointer: '*' TypeQualifierListOpt { $$ = &Pointer{ Token: $1, TypeQualifierListOpt: $2.(*TypeQualifierListOpt), } } | '*' TypeQualifierListOpt Pointer { $$ = &Pointer{ Case: 1, Token: $1, TypeQualifierListOpt: $2.(*TypeQualifierListOpt), Pointer: $3.(*Pointer), } } PointerOpt: /* empty */ { $$ = (*PointerOpt)(nil) } | Pointer { $$ = &PointerOpt{ Pointer: $1.(*Pointer), } } TypeQualifierList: TypeQualifier { lhs := &TypeQualifierList{ TypeQualifier: $1.(*TypeQualifier), } $$ = lhs lhs.attr = lhs.TypeQualifier.attr } | TypeQualifierList TypeQualifier { lx := yylex.(*lexer) lhs := &TypeQualifierList{ Case: 1, TypeQualifierList: $1.(*TypeQualifierList), TypeQualifier: $2.(*TypeQualifier), } $$ = lhs a := lhs.TypeQualifierList b := lhs.TypeQualifier if a.attr&b.attr != 0 { lx.report.Err(b.Pos(), "invalid type qualifier") break } lhs.attr = a.attr|b.attr } TypeQualifierListOpt: /* empty */ { $$ = (*TypeQualifierListOpt)(nil) } | TypeQualifierList { $$ = &TypeQualifierListOpt{ TypeQualifierList: $1.(*TypeQualifierList).reverse(), } } ParameterTypeList: ParameterList { lhs := &ParameterTypeList{ ParameterList: $1.(*ParameterList).reverse(), } $$ = lhs lhs.post() } | ParameterList ',' "..." { lhs := &ParameterTypeList{ Case: 1, ParameterList: $1.(*ParameterList).reverse(), Token: $2, Token2: $3, } $$ = lhs lhs.post() } ParameterTypeListOpt: /* empty */ { $$ = (*ParameterTypeListOpt)(nil) } | ParameterTypeList { $$ = &ParameterTypeListOpt{ ParameterTypeList: $1.(*ParameterTypeList), } } ParameterList: ParameterDeclaration { $$ = &ParameterList{ ParameterDeclaration: $1.(*ParameterDeclaration), } } | ParameterList ',' ParameterDeclaration { $$ = &ParameterList{ Case: 1, ParameterList: $1.(*ParameterList), Token: $2, ParameterDeclaration: $3.(*ParameterDeclaration), } } ParameterDeclaration: DeclarationSpecifiers Declarator { lx := yylex.(*lexer) lhs := &ParameterDeclaration{ DeclarationSpecifiers: $1.(*DeclarationSpecifiers), Declarator: $2.(*Declarator), } $$ = lhs lhs.Declarator.setFull(lx) lhs.declarator = lhs.Declarator } | DeclarationSpecifiers AbstractDeclaratorOpt { lx := yylex.(*lexer) lhs := &ParameterDeclaration{ Case: 1, DeclarationSpecifiers: $1.(*DeclarationSpecifiers), AbstractDeclaratorOpt: $2.(*AbstractDeclaratorOpt), } $$ = lhs if o := lhs.AbstractDeclaratorOpt; o != nil { lhs.declarator = o.AbstractDeclarator.declarator lhs.declarator.setFull(lx) break } d := &Declarator{ specifier: lx.scope.specifier, DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER }, } d.DirectDeclarator.declarator = d lhs.declarator = d d.setFull(lx) } IdentifierList: IDENTIFIER { $$ = &IdentifierList{ Token: $1, } } | IdentifierList ',' IDENTIFIER { $$ = &IdentifierList{ Case: 1, IdentifierList: $1.(*IdentifierList), Token: $2, Token2: $3, } } IdentifierListOpt: /* empty */ { $$ = (*IdentifierListOpt)(nil) } | IdentifierList { $$ = &IdentifierListOpt{ IdentifierList: $1.(*IdentifierList).reverse(), } } IdentifierOpt: /* empty */ { $$ = (*IdentifierOpt)(nil) } | IDENTIFIER { $$ = &IdentifierOpt{ Token: $1, } } TypeName: { lx := yylex.(*lexer) lx.pushScope(ScopeBlock) } SpecifierQualifierList AbstractDeclaratorOpt { lx := yylex.(*lexer) lhs := &TypeName{ SpecifierQualifierList: $2.(*SpecifierQualifierList), AbstractDeclaratorOpt: $3.(*AbstractDeclaratorOpt), } $$ = lhs if o := lhs.AbstractDeclaratorOpt; o != nil { lhs.declarator = o.AbstractDeclarator.declarator } else { d := &Declarator{ specifier: lhs.SpecifierQualifierList, DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER idScope: lx.scope, }, } d.DirectDeclarator.declarator = d lhs.declarator = d } lhs.Type = lhs.declarator.setFull(lx) lhs.scope = lx.scope lx.popScope(xc.Token{}) } AbstractDeclarator: Pointer { lx := yylex.(*lexer) lhs := &AbstractDeclarator{ Pointer: $1.(*Pointer), } $$ = lhs d := &Declarator{ specifier: lx.scope.specifier, PointerOpt: &PointerOpt { Pointer: lhs.Pointer, }, DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER idScope: lx.scope, }, } d.DirectDeclarator.declarator = d lhs.declarator = d } | PointerOpt DirectAbstractDeclarator { lx := yylex.(*lexer) lhs := &AbstractDeclarator{ Case: 1, PointerOpt: $1.(*PointerOpt), DirectAbstractDeclarator: $2.(*DirectAbstractDeclarator), } $$ = lhs d := &Declarator{ specifier: lx.scope.specifier, PointerOpt: lhs.PointerOpt, DirectDeclarator: lhs.DirectAbstractDeclarator.directDeclarator, } d.DirectDeclarator.declarator = d lhs.declarator = d } AbstractDeclaratorOpt: /* empty */ { $$ = (*AbstractDeclaratorOpt)(nil) } | AbstractDeclarator { $$ = &AbstractDeclaratorOpt{ AbstractDeclarator: $1.(*AbstractDeclarator), } } DirectAbstractDeclarator: '(' AbstractDeclarator ')' { lhs := &DirectAbstractDeclarator{ Token: $1, AbstractDeclarator: $2.(*AbstractDeclarator), Token2: $3, } $$ = lhs lhs.AbstractDeclarator.declarator.specifier = nil lhs.directDeclarator = &DirectDeclarator{ Case: 1, // '(' Declarator ')' Declarator: lhs.AbstractDeclarator.declarator, } lhs.AbstractDeclarator.declarator.DirectDeclarator.parent = lhs.directDeclarator } | DirectAbstractDeclaratorOpt '[' ExpressionOpt ']' { lx := yylex.(*lexer) lhs := &DirectAbstractDeclarator{ Case: 1, DirectAbstractDeclaratorOpt: $1.(*DirectAbstractDeclaratorOpt), Token: $2, ExpressionOpt: $3.(*ExpressionOpt), Token2: $4, } $$ = lhs nElements := -1 if o := lhs.ExpressionOpt; o != nil { var err error if nElements, err = elements(o.Expression.eval(lx)); err != nil { lx.report.Err(o.Expression.Pos(), "%s", err) } } var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 2, // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' DirectDeclarator: dd, ExpressionOpt: lhs.ExpressionOpt, elements: nElements, } dd.parent = lhs.directDeclarator } | DirectAbstractDeclaratorOpt '[' TypeQualifierList ExpressionOpt ']' { lx := yylex.(*lexer) lhs := &DirectAbstractDeclarator{ Case: 2, DirectAbstractDeclaratorOpt: $1.(*DirectAbstractDeclaratorOpt), Token: $2, TypeQualifierList: $3.(*TypeQualifierList).reverse(), ExpressionOpt: $4.(*ExpressionOpt), Token2: $5, } $$ = lhs if o := lhs.ExpressionOpt; o != nil { o.Expression.eval(lx) } var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 2, // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' DirectDeclarator: dd, TypeQualifierListOpt: &TypeQualifierListOpt{ lhs.TypeQualifierList }, ExpressionOpt: lhs.ExpressionOpt, } dd.parent = lhs.directDeclarator } | DirectAbstractDeclaratorOpt '[' "static" TypeQualifierListOpt Expression ']' { lx := yylex.(*lexer) lhs := &DirectAbstractDeclarator{ Case: 3, DirectAbstractDeclaratorOpt: $1.(*DirectAbstractDeclaratorOpt), Token: $2, Token2: $3, TypeQualifierListOpt: $4.(*TypeQualifierListOpt), Expression: $5.(*Expression), Token3: $6, } $$ = lhs lhs.Expression.eval(lx) var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 2, // DirectDeclarator '[' "static" TypeQualifierListOpt Expression ']' DirectDeclarator: dd, TypeQualifierListOpt: lhs.TypeQualifierListOpt, Expression: lhs.Expression, } dd.parent = lhs.directDeclarator } | DirectAbstractDeclaratorOpt '[' TypeQualifierList "static" Expression ']' { lx := yylex.(*lexer) lhs := &DirectAbstractDeclarator{ Case: 4, DirectAbstractDeclaratorOpt: $1.(*DirectAbstractDeclaratorOpt), Token: $2, TypeQualifierList: $3.(*TypeQualifierList).reverse(), Token2: $4, Expression: $5.(*Expression), Token3: $6, } $$ = lhs lhs.Expression.eval(lx) var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 4, // DirectDeclarator '[' TypeQualifierList "static" Expression ']' DirectDeclarator: dd, TypeQualifierList: lhs.TypeQualifierList, Expression: lhs.Expression, } dd.parent = lhs.directDeclarator } | DirectAbstractDeclaratorOpt '[' '*' ']' { lhs := &DirectAbstractDeclarator{ Case: 5, DirectAbstractDeclaratorOpt: $1.(*DirectAbstractDeclaratorOpt), Token: $2, Token2: $3, Token3: $4, } $$ = lhs var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 5, // DirectDeclarator '[' TypeQualifierListOpt '*' ']' DirectDeclarator: dd, } dd.parent = lhs.directDeclarator } | '(' { lx := yylex.(*lexer) lx.pushScope(ScopeParams) } ParameterTypeListOpt ')' { lx := yylex.(*lexer) lhs := &DirectAbstractDeclarator{ Case: 6, Token: $1, ParameterTypeListOpt: $3.(*ParameterTypeListOpt), Token2: $4, } $$ = lhs lhs.paramsScope, _ = lx.popScope(lhs.Token2) switch o := lhs.ParameterTypeListOpt; { case o != nil: lhs.directDeclarator = &DirectDeclarator{ Case: 6, // DirectDeclarator '(' ParameterTypeList ')' DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER }, ParameterTypeList: o.ParameterTypeList, } default: lhs.directDeclarator = &DirectDeclarator{ Case: 7, // DirectDeclarator '(' IdentifierListOpt ')' DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER }, } } lhs.directDeclarator.DirectDeclarator.parent = lhs.directDeclarator } | DirectAbstractDeclarator '(' { lx := yylex.(*lexer) lx.pushScope(ScopeParams) } ParameterTypeListOpt ')' { lx := yylex.(*lexer) lhs := &DirectAbstractDeclarator{ Case: 7, DirectAbstractDeclarator: $1.(*DirectAbstractDeclarator), Token: $2, ParameterTypeListOpt: $4.(*ParameterTypeListOpt), Token2: $5, } $$ = lhs lhs.paramsScope, _ = lx.popScope(lhs.Token2) switch o := lhs.ParameterTypeListOpt; { case o != nil: lhs.directDeclarator = &DirectDeclarator{ Case: 6, // DirectDeclarator '(' ParameterTypeList ')' DirectDeclarator: lhs.DirectAbstractDeclarator.directDeclarator, ParameterTypeList: o.ParameterTypeList, } default: lhs.directDeclarator = &DirectDeclarator{ Case: 7, // DirectDeclarator '(' IdentifierListOpt ')' DirectDeclarator: lhs.DirectAbstractDeclarator.directDeclarator, } } lhs.directDeclarator.DirectDeclarator.parent = lhs.directDeclarator } DirectAbstractDeclaratorOpt: /* empty */ { $$ = (*DirectAbstractDeclaratorOpt)(nil) } | DirectAbstractDeclarator { $$ = &DirectAbstractDeclaratorOpt{ DirectAbstractDeclarator: $1.(*DirectAbstractDeclarator), } } Initializer: Expression { lx := yylex.(*lexer) lhs := &Initializer{ Expression: $1.(*Expression), } $$ = lhs lhs.Expression.eval(lx) } | '{' InitializerList CommaOpt '}' { $$ = &Initializer{ Case: 1, Token: $1, InitializerList: $2.(*InitializerList).reverse(), CommaOpt: $3.(*CommaOpt), Token2: $4, } } | IDENTIFIER ':' Initializer { lx := yylex.(*lexer) lhs := &Initializer{ Case: 2, Token: $1, Token2: $2, Initializer: $3.(*Initializer), } $$ = lhs if !lx.tweaks.enableLegacyDesignators { lx.report.Err(lhs.Pos(), "legacy designators not enabled") } } InitializerList: DesignationOpt Initializer { $$ = &InitializerList{ DesignationOpt: $1.(*DesignationOpt), Initializer: $2.(*Initializer), } } | InitializerList ',' DesignationOpt Initializer { $$ = &InitializerList{ Case: 1, InitializerList: $1.(*InitializerList), Token: $2, DesignationOpt: $3.(*DesignationOpt), Initializer: $4.(*Initializer), } } | /* empty */ { $$ = (*InitializerList)(nil) } Designation: DesignatorList '=' { $$ = &Designation{ DesignatorList: $1.(*DesignatorList).reverse(), Token: $2, } } DesignationOpt: /* empty */ { $$ = (*DesignationOpt)(nil) } | Designation { $$ = &DesignationOpt{ Designation: $1.(*Designation), } } DesignatorList: Designator { $$ = &DesignatorList{ Designator: $1.(*Designator), } } | DesignatorList Designator { $$ = &DesignatorList{ Case: 1, DesignatorList: $1.(*DesignatorList), Designator: $2.(*Designator), } } Designator: '[' ConstantExpression ']' { $$ = &Designator{ Token: $1, ConstantExpression: $2.(*ConstantExpression), Token2: $3, } } | '.' IDENTIFIER { $$ = &Designator{ Case: 1, Token: $1, Token2: $2, } } Statement: LabeledStatement { $$ = &Statement{ LabeledStatement: $1.(*LabeledStatement), } } | CompoundStatement { $$ = &Statement{ Case: 1, CompoundStatement: $1.(*CompoundStatement), } } | ExpressionStatement { $$ = &Statement{ Case: 2, ExpressionStatement: $1.(*ExpressionStatement), } } | SelectionStatement { $$ = &Statement{ Case: 3, SelectionStatement: $1.(*SelectionStatement), } } | IterationStatement { $$ = &Statement{ Case: 4, IterationStatement: $1.(*IterationStatement), } } | JumpStatement { $$ = &Statement{ Case: 5, JumpStatement: $1.(*JumpStatement), } } | AssemblerStatement { $$ = &Statement{ Case: 6, AssemblerStatement: $1.(*AssemblerStatement), } } LabeledStatement: IDENTIFIER ':' Statement { $$ = &LabeledStatement{ Token: $1, Token2: $2, Statement: $3.(*Statement), } } | "case" ConstantExpression ':' Statement { $$ = &LabeledStatement{ Case: 1, Token: $1, ConstantExpression: $2.(*ConstantExpression), Token2: $3, Statement: $4.(*Statement), } } | "default" ':' Statement { $$ = &LabeledStatement{ Case: 2, Token: $1, Token2: $2, Statement: $3.(*Statement), } } CompoundStatement: '{' { lx := yylex.(*lexer) m := lx.scope.mergeScope lx.pushScope(ScopeBlock) if m != nil { lx.scope.merge(m) } lx.scope.mergeScope = nil } BlockItemListOpt '}' { lx := yylex.(*lexer) lhs := &CompoundStatement{ Token: $1, BlockItemListOpt: $3.(*BlockItemListOpt), Token2: $4, } $$ = lhs lhs.scope = lx.scope lx.popScope(lhs.Token2) } BlockItemList: BlockItem { $$ = &BlockItemList{ BlockItem: $1.(*BlockItem), } } | BlockItemList BlockItem { $$ = &BlockItemList{ Case: 1, BlockItemList: $1.(*BlockItemList), BlockItem: $2.(*BlockItem), } } BlockItemListOpt: /* empty */ { $$ = (*BlockItemListOpt)(nil) } | BlockItemList { $$ = &BlockItemListOpt{ BlockItemList: $1.(*BlockItemList).reverse(), } } BlockItem: Declaration { $$ = &BlockItem{ Declaration: $1.(*Declaration), } } | Statement { $$ = &BlockItem{ Case: 1, Statement: $1.(*Statement), } } ExpressionStatement: ExpressionListOpt ';' { $$ = &ExpressionStatement{ ExpressionListOpt: $1.(*ExpressionListOpt), Token: $2, } } SelectionStatement: "if" '(' ExpressionList ')' Statement %prec NOELSE { lx := yylex.(*lexer) lhs := &SelectionStatement{ Token: $1, Token2: $2, ExpressionList: $3.(*ExpressionList).reverse(), Token3: $4, Statement: $5.(*Statement), } $$ = lhs lhs.ExpressionList.eval(lx) } | "if" '(' ExpressionList ')' Statement "else" Statement { lx := yylex.(*lexer) lhs := &SelectionStatement{ Case: 1, Token: $1, Token2: $2, ExpressionList: $3.(*ExpressionList).reverse(), Token3: $4, Statement: $5.(*Statement), Token4: $6, Statement2: $7.(*Statement), } $$ = lhs lhs.ExpressionList.eval(lx) } | "switch" '(' ExpressionList ')' Statement { lx := yylex.(*lexer) lhs := &SelectionStatement{ Case: 2, Token: $1, Token2: $2, ExpressionList: $3.(*ExpressionList).reverse(), Token3: $4, Statement: $5.(*Statement), } $$ = lhs lhs.ExpressionList.eval(lx) } IterationStatement: "while" '(' ExpressionList ')' Statement { lx := yylex.(*lexer) lhs := &IterationStatement{ Token: $1, Token2: $2, ExpressionList: $3.(*ExpressionList).reverse(), Token3: $4, Statement: $5.(*Statement), } $$ = lhs lhs.ExpressionList.eval(lx) } | "do" Statement "while" '(' ExpressionList ')' ';' { lx := yylex.(*lexer) lhs := &IterationStatement{ Case: 1, Token: $1, Statement: $2.(*Statement), Token2: $3, Token3: $4, ExpressionList: $5.(*ExpressionList).reverse(), Token4: $6, Token5: $7, } $$ = lhs lhs.ExpressionList.eval(lx) } | "for" '(' ExpressionListOpt ';' ExpressionListOpt ';' ExpressionListOpt ')' Statement { $$ = &IterationStatement{ Case: 2, Token: $1, Token2: $2, ExpressionListOpt: $3.(*ExpressionListOpt), Token3: $4, ExpressionListOpt2: $5.(*ExpressionListOpt), Token4: $6, ExpressionListOpt3: $7.(*ExpressionListOpt), Token5: $8, Statement: $9.(*Statement), } } | "for" '(' Declaration ExpressionListOpt ';' ExpressionListOpt ')' Statement { $$ = &IterationStatement{ Case: 3, Token: $1, Token2: $2, Declaration: $3.(*Declaration), ExpressionListOpt: $4.(*ExpressionListOpt), Token3: $5, ExpressionListOpt2: $6.(*ExpressionListOpt), Token4: $7, Statement: $8.(*Statement), } } JumpStatement: "goto" IDENTIFIER ';' { $$ = &JumpStatement{ Token: $1, Token2: $2, Token3: $3, } } | "continue" ';' { $$ = &JumpStatement{ Case: 1, Token: $1, Token2: $2, } } | "break" ';' { $$ = &JumpStatement{ Case: 2, Token: $1, Token2: $2, } } | "return" ExpressionListOpt ';' { $$ = &JumpStatement{ Case: 3, Token: $1, ExpressionListOpt: $2.(*ExpressionListOpt), Token2: $3, } } | "goto" Expression ';' { lx := yylex.(*lexer) lhs := &JumpStatement{ Case: 4, Token: $1, Expression: $2.(*Expression), Token2: $3, } $$ = lhs _, t := lhs.Expression.eval(lx) if t == nil { break } for t != nil && t.Kind() == Ptr { t = t.Element() } if t == nil || t.Kind() != Void { lx.report.Err(lhs.Pos(), "invalid computed goto argument type, have '%s'", t) } if !lx.tweaks.enableComputedGotos { lx.report.Err(lhs.Pos(), "computed gotos not enabled") } } TranslationUnit: ExternalDeclaration { $$ = &TranslationUnit{ ExternalDeclaration: $1.(*ExternalDeclaration), } } | TranslationUnit ExternalDeclaration { $$ = &TranslationUnit{ Case: 1, TranslationUnit: $1.(*TranslationUnit), ExternalDeclaration: $2.(*ExternalDeclaration), } } ExternalDeclaration: FunctionDefinition { $$ = &ExternalDeclaration{ FunctionDefinition: $1.(*FunctionDefinition), } } | Declaration { $$ = &ExternalDeclaration{ Case: 1, Declaration: $1.(*Declaration), } } | BasicAssemblerStatement ';' { $$ = &ExternalDeclaration{ Case: 2, BasicAssemblerStatement: $1.(*BasicAssemblerStatement), Token: $2, } } | ';' { lx := yylex.(*lexer) lhs := &ExternalDeclaration{ Case: 3, Token: $1, } $$ = lhs if !lx.tweaks.enableEmptyDeclarations { lx.report.Err(lhs.Pos(), "C++11 empty declarations are illegal in C99.") } } FunctionDefinition: DeclarationSpecifiers Declarator DeclarationListOpt { lx := yylex.(*lexer) if ds := $1.(*DeclarationSpecifiers); ds.typeSpecifier == 0 { ds.typeSpecifier = tsEncode(tsInt) $2.(*Declarator).Type = lx.model.IntType if !lx.tweaks.enableOmitFuncRetType { lx.report.Err($2.Pos(), "missing function return type") } } var fd *FunctionDefinition fd.post(lx, $2.(*Declarator), $3.(*DeclarationListOpt)) } FunctionBody { $$ = &FunctionDefinition{ DeclarationSpecifiers: $1.(*DeclarationSpecifiers), Declarator: $2.(*Declarator), DeclarationListOpt: $3.(*DeclarationListOpt), FunctionBody: $5.(*FunctionBody), } } | { lx := yylex.(*lexer) lx.scope.specifier = &DeclarationSpecifiers{typeSpecifier: tsEncode(tsInt)} } Declarator DeclarationListOpt { lx := yylex.(*lexer) if !lx.tweaks.enableOmitFuncRetType { lx.report.Err($2.Pos(), "missing function return type") } var fd *FunctionDefinition fd.post(lx, $2.(*Declarator), $3.(*DeclarationListOpt)) } FunctionBody { $$ = &FunctionDefinition{ Case: 1, Declarator: $2.(*Declarator), DeclarationListOpt: $3.(*DeclarationListOpt), FunctionBody: $5.(*FunctionBody), } } FunctionBody: { lx := yylex.(*lexer) // Handle __func__, [0], 6.4.2.2. id, _ := lx.fnDeclarator.Identifier() lx.injectFunc = []xc.Token{ {lex.Char{Rune: STATIC}, idStatic}, {lex.Char{Rune: CONST}, idConst}, {lex.Char{Rune: CHAR}, idChar}, {lex.Char{Rune: IDENTIFIER}, idMagicFunc}, {lex.Char{Rune: '['}, 0}, {lex.Char{Rune: ']'}, 0}, {lex.Char{Rune: '='}, 0}, {lex.Char{Rune: STRINGLITERAL}, xc.Dict.SID(fmt.Sprintf("%q", xc.Dict.S(id)))}, {lex.Char{Rune: ';'}, 0}, } } CompoundStatement { lhs := &FunctionBody{ CompoundStatement: $2.(*CompoundStatement), } $$ = lhs lhs.scope = lhs.CompoundStatement.scope } | { lx := yylex.(*lexer) m := lx.scope.mergeScope lx.pushScope(ScopeBlock) if m != nil { lx.scope.merge(m) } lx.scope.mergeScope = nil } AssemblerStatement ';' { lx := yylex.(*lexer) lhs := &FunctionBody{ Case: 1, AssemblerStatement: $2.(*AssemblerStatement), Token: $3, } $$ = lhs lhs.scope = lx.scope lx.popScope(lx.tokPrev) } DeclarationList: Declaration { $$ = &DeclarationList{ Declaration: $1.(*Declaration), } } | DeclarationList Declaration { $$ = &DeclarationList{ Case: 1, DeclarationList: $1.(*DeclarationList), Declaration: $2.(*Declaration), } } DeclarationListOpt: /* empty */ { $$ = (*DeclarationListOpt)(nil) } | { lx := yylex.(*lexer) lx.pushScope(ScopeParams) } DeclarationList { lx := yylex.(*lexer) lhs := &DeclarationListOpt{ DeclarationList: $2.(*DeclarationList).reverse(), } $$ = lhs lhs.paramsScope, _ = lx.popScopePos(lhs.Pos()) } AssemblerInstructions: STRINGLITERAL { $$ = &AssemblerInstructions{ Token: $1, } } | AssemblerInstructions STRINGLITERAL { $$ = &AssemblerInstructions{ Case: 1, AssemblerInstructions: $1.(*AssemblerInstructions), Token: $2, } } BasicAssemblerStatement: "asm" VolatileOpt '(' AssemblerInstructions ')' { $$ = &BasicAssemblerStatement{ Token: $1, VolatileOpt: $2.(*VolatileOpt), Token2: $3, AssemblerInstructions: $4.(*AssemblerInstructions).reverse(), Token3: $5, } } VolatileOpt: /* empty */ { $$ = (*VolatileOpt)(nil) } | "volatile" { $$ = &VolatileOpt{ Token: $1, } } AssemblerOperand: AssemblerSymbolicNameOpt STRINGLITERAL '(' Expression ')' { $$ = &AssemblerOperand{ AssemblerSymbolicNameOpt: $1.(*AssemblerSymbolicNameOpt), Token: $2, Token2: $3, Expression: $4.(*Expression), Token3: $5, } } AssemblerOperands: AssemblerOperand { $$ = &AssemblerOperands{ AssemblerOperand: $1.(*AssemblerOperand), } } | AssemblerOperands ',' AssemblerOperand { $$ = &AssemblerOperands{ Case: 1, AssemblerOperands: $1.(*AssemblerOperands), Token: $2, AssemblerOperand: $3.(*AssemblerOperand), } } AssemblerSymbolicNameOpt: /* empty */ { $$ = (*AssemblerSymbolicNameOpt)(nil) } | '[' IDENTIFIER ']' { $$ = &AssemblerSymbolicNameOpt{ Token: $1, Token2: $2, Token3: $3, } } Clobbers: STRINGLITERAL { $$ = &Clobbers{ Token: $1, } } | Clobbers ',' STRINGLITERAL { $$ = &Clobbers{ Case: 1, Clobbers: $1.(*Clobbers), Token: $2, Token2: $3, } } AssemblerStatement: BasicAssemblerStatement { $$ = &AssemblerStatement{ BasicAssemblerStatement: $1.(*BasicAssemblerStatement), } } | "asm" VolatileOpt '(' AssemblerInstructions ':' AssemblerOperands ')' { $$ = &AssemblerStatement{ Case: 1, Token: $1, VolatileOpt: $2.(*VolatileOpt), Token2: $3, AssemblerInstructions: $4.(*AssemblerInstructions).reverse(), Token3: $5, AssemblerOperands: $6.(*AssemblerOperands).reverse(), Token4: $7, } } | "asm" VolatileOpt '(' AssemblerInstructions ':' AssemblerOperands ':' AssemblerOperands ')' { $$ = &AssemblerStatement{ Case: 2, Token: $1, VolatileOpt: $2.(*VolatileOpt), Token2: $3, AssemblerInstructions: $4.(*AssemblerInstructions).reverse(), Token3: $5, AssemblerOperands: $6.(*AssemblerOperands).reverse(), Token4: $7, AssemblerOperands2: $8.(*AssemblerOperands).reverse(), Token5: $9, } } | "asm" VolatileOpt '(' AssemblerInstructions ':' AssemblerOperands ':' AssemblerOperands ':' Clobbers ')' { $$ = &AssemblerStatement{ Case: 3, Token: $1, VolatileOpt: $2.(*VolatileOpt), Token2: $3, AssemblerInstructions: $4.(*AssemblerInstructions).reverse(), Token3: $5, AssemblerOperands: $6.(*AssemblerOperands).reverse(), Token4: $7, AssemblerOperands2: $8.(*AssemblerOperands).reverse(), Token5: $9, Clobbers: $10.(*Clobbers).reverse(), Token6: $11, } } | "asm" VolatileOpt "goto" '(' AssemblerInstructions ':' ':' AssemblerOperands ':' Clobbers ':' IdentifierList ')' { $$ = &AssemblerStatement{ Case: 4, Token: $1, VolatileOpt: $2.(*VolatileOpt), Token2: $3, Token3: $4, AssemblerInstructions: $5.(*AssemblerInstructions).reverse(), Token4: $6, Token5: $7, AssemblerOperands: $8.(*AssemblerOperands).reverse(), Token6: $9, Clobbers: $10.(*Clobbers).reverse(), Token7: $11, IdentifierList: $12.(*IdentifierList).reverse(), Token8: $13, } } | "asm" VolatileOpt '(' AssemblerInstructions ':' ')' { $$ = &AssemblerStatement{ Case: 5, Token: $1, VolatileOpt: $2.(*VolatileOpt), Token2: $3, AssemblerInstructions: $4.(*AssemblerInstructions).reverse(), Token3: $5, Token4: $6, } } | "asm" VolatileOpt '(' AssemblerInstructions ':' ':' AssemblerOperands ')' { $$ = &AssemblerStatement{ Case: 6, Token: $1, VolatileOpt: $2.(*VolatileOpt), Token2: $3, AssemblerInstructions: $4.(*AssemblerInstructions).reverse(), Token3: $5, Token4: $6, AssemblerOperands: $7.(*AssemblerOperands).reverse(), Token5: $8, } } StaticAssertDeclaration: "_Static_assert" '(' ConstantExpression ',' STRINGLITERAL ')' ';' { lx := yylex.(*lexer) lhs := &StaticAssertDeclaration{ Token: $1, Token2: $2, ConstantExpression: $3.(*ConstantExpression), Token3: $4, Token4: $5, Token5: $6, Token6: $7, } $$ = lhs ce := lhs.ConstantExpression if ce.Type == nil || ce.Type.Kind() == Undefined || ce.Value == nil || !IsIntType(ce.Type) { lx.report.Err(ce.Pos(), "invalid static assert expression (have '%v')", ce.Type) break } if !isNonZero(ce.Value) { lx.report.ErrTok(lhs.Token, "%s", lhs.Token4.S()) } } PreprocessingFile: GroupList { lx := yylex.(*lexer) lhs := &PreprocessingFile{ GroupList: $1.(*GroupList).reverse(), } $$ = lhs lhs.path = lx.file.Name() } GroupList: GroupPart { $$ = &GroupList{ GroupPart: $1, } } | GroupList GroupPart { $$ = &GroupList{ Case: 1, GroupList: $1.(*GroupList), GroupPart: $2, } } GroupListOpt: /* empty */ { $$ = (*GroupListOpt)(nil) } | GroupList { $$ = &GroupListOpt{ GroupList: $1.(*GroupList).reverse(), } } GroupPart: ControlLine { $$ = $1.(Node) } | IfSection { $$ = $1.(Node) } | PPNONDIRECTIVE PPTokenList '\n' { $$ = $1 } | TextLine { $$ = $1 } IfSection: IfGroup ElifGroupListOpt ElseGroupOpt EndifLine { $$ = &IfSection{ IfGroup: $1.(*IfGroup), ElifGroupListOpt: $2.(*ElifGroupListOpt), ElseGroupOpt: $3.(*ElseGroupOpt), EndifLine: $4.(*EndifLine), } } IfGroup: PPIF PPTokenList '\n' GroupListOpt { $$ = &IfGroup{ Token: $1, PPTokenList: $2, Token2: $3, GroupListOpt: $4.(*GroupListOpt), } } | PPIFDEF IDENTIFIER '\n' GroupListOpt { $$ = &IfGroup{ Case: 1, Token: $1, Token2: $2, Token3: $3, GroupListOpt: $4.(*GroupListOpt), } } | PPIFNDEF IDENTIFIER '\n' GroupListOpt { $$ = &IfGroup{ Case: 2, Token: $1, Token2: $2, Token3: $3, GroupListOpt: $4.(*GroupListOpt), } } ElifGroupList: ElifGroup { $$ = &ElifGroupList{ ElifGroup: $1.(*ElifGroup), } } | ElifGroupList ElifGroup { $$ = &ElifGroupList{ Case: 1, ElifGroupList: $1.(*ElifGroupList), ElifGroup: $2.(*ElifGroup), } } ElifGroupListOpt: /* empty */ { $$ = (*ElifGroupListOpt)(nil) } | ElifGroupList { $$ = &ElifGroupListOpt{ ElifGroupList: $1.(*ElifGroupList).reverse(), } } ElifGroup: PPELIF PPTokenList '\n' GroupListOpt { $$ = &ElifGroup{ Token: $1, PPTokenList: $2, Token2: $3, GroupListOpt: $4.(*GroupListOpt), } } ElseGroup: PPELSE '\n' GroupListOpt { $$ = &ElseGroup{ Token: $1, Token2: $2, GroupListOpt: $3.(*GroupListOpt), } } ElseGroupOpt: /* empty */ { $$ = (*ElseGroupOpt)(nil) } | ElseGroup { $$ = &ElseGroupOpt{ ElseGroup: $1.(*ElseGroup), } } EndifLine: PPENDIF { $$ = &EndifLine{ Token: $1, } } ControlLine: PPDEFINE IDENTIFIER ReplacementList { $$ = &ControlLine{ Token: $1, Token2: $2, ReplacementList: $3, } } | PPDEFINE IDENTIFIER_LPAREN "..." ')' ReplacementList { $$ = &ControlLine{ Case: 1, Token: $1, Token2: $2, Token3: $3, Token4: $4, ReplacementList: $5, } } | PPDEFINE IDENTIFIER_LPAREN IdentifierList ',' "..." ')' ReplacementList { $$ = &ControlLine{ Case: 2, Token: $1, Token2: $2, IdentifierList: $3.(*IdentifierList).reverse(), Token3: $4, Token4: $5, Token5: $6, ReplacementList: $7, } } | PPDEFINE IDENTIFIER_LPAREN IdentifierListOpt ')' ReplacementList { $$ = &ControlLine{ Case: 3, Token: $1, Token2: $2, IdentifierListOpt: $3.(*IdentifierListOpt), Token3: $4, ReplacementList: $5, } } | PPERROR PPTokenListOpt { $$ = &ControlLine{ Case: 4, Token: $1, PPTokenListOpt: $2, } } | PPHASH_NL { $$ = &ControlLine{ Case: 5, Token: $1, } } | PPINCLUDE PPTokenList '\n' { $$ = &ControlLine{ Case: 6, Token: $1, PPTokenList: $2, Token2: $3, } } | PPLINE PPTokenList '\n' { $$ = &ControlLine{ Case: 7, Token: $1, PPTokenList: $2, Token2: $3, } } | PPPRAGMA PPTokenListOpt { $$ = &ControlLine{ Case: 8, Token: $1, PPTokenListOpt: $2, } } | PPUNDEF IDENTIFIER '\n' { $$ = &ControlLine{ Case: 9, Token: $1, Token2: $2, Token3: $3, } } | PPDEFINE IDENTIFIER_LPAREN IdentifierList "..." ')' ReplacementList { lx := yylex.(*lexer) lhs := &ControlLine{ Case: 10, Token: $1, Token2: $2, IdentifierList: $3.(*IdentifierList).reverse(), Token3: $4, Token4: $5, ReplacementList: $6, } $$ = lhs if !lx.tweaks.enableDefineOmitCommaBeforeDDD { lx.report.ErrTok(lhs.Token4, "missing comma before \"...\"") } } | PPDEFINE '\n' { lx := yylex.(*lexer) lhs := &ControlLine{ Case: 11, Token: $1, Token2: $2, } $$ = lhs if !lx.tweaks.enableEmptyDefine { lx.report.ErrTok(lhs.Token2, "expected identifier") } } | PPUNDEF IDENTIFIER PPTokenList '\n' { lx := yylex.(*lexer) lhs := &ControlLine{ Case: 12, Token: $1, Token2: $2, PPTokenList: $3, Token3: $4, } $$ = lhs toks := decodeTokens(lhs.PPTokenList, nil, false) if len(toks) == 0 { lhs.Case = 9 // PPUNDEF IDENTIFIER '\n' break } lx.report.ErrTok(toks[0], "extra tokens after #undef argument") } | PPINCLUDE_NEXT PPTokenList '\n' { $$ = &ControlLine{ Case: 13, Token: $1, PPTokenList: $2, Token2: $3, } } TextLine: PPTokenListOpt { } ReplacementList: PPTokenListOpt { } PPTokenList: PPTokens { lx := yylex.(*lexer) $$ = PPTokenList(dict.ID(lx.encBuf)) lx.encBuf = lx.encBuf[:0] lx.encPos = 0 } PPTokenListOpt: '\n' { $$ = 0 } | PPTokenList '\n' { } PPTokens: PPOTHER { } | PPTokens PPOTHER { } ================================================ FILE: parser.yy ================================================ %{ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on [0], 6.10. Substantial portions of expression AST size // optimizations are from [2], license of which follows. // ---------------------------------------------------------------------------- // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This grammar is derived from the C grammar in the 'ansitize' // program, which carried this notice: // // Copyright (c) 2006 Russ Cox, // Massachusetts Institute of Technology // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated // documentation files (the "Software"), to deal in the // Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, // sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, // subject to the following conditions: // // The above copyright notice and this permission notice shall // be included in all copies or substantial portions of the // Software. // // The software is provided "as is", without warranty of any // kind, express or implied, including but not limited to the // warranties of merchantability, fitness for a particular // purpose and noninfringement. In no event shall the authors // or copyright holders be liable for any claim, damages or // other liability, whether in an action of contract, tort or // otherwise, arising from, out of or in connection with the // software or the use or other dealings in the software. package cc import ( "fmt" "github.com/cznic/xc" "github.com/cznic/golex/lex" ) %} %union { Token xc.Token groupPart Node node Node toks PPTokenList } %token /*yy:token "'%c'" */ CHARCONST "character constant" /*yy:token "1.%d" */ FLOATCONST "floating-point constant" /*yy:token "%c" */ IDENTIFIER "identifier" /*yy:token "%c" */ IDENTIFIER_NONREPL "non replaceable identifier" /*yy:token "%c(" */ IDENTIFIER_LPAREN "identifier immediatelly followed by '('" /*yy:token "%d" */ INTCONST "integer constant" /*yy:token "L'%c'" */ LONGCHARCONST "long character constant" /*yy:token "L\"%c\"" */ LONGSTRINGLITERAL "long string constant" /*yy:token "<%c.h>" */ PPHEADER_NAME "header name" /*yy:token "%d" */ PPNUMBER "preprocessing number" /*yy:token "\"%c\"" */ STRINGLITERAL "string literal" /*yy:token "\U00100000" */ PREPROCESSING_FILE 1048576 "preprocessing file prefix" // 0x100000 = 1048576 /*yy:token "\U00100001" */ CONSTANT_EXPRESSION 1048577 "constant expression prefix" /*yy:token "\U00100002" */ TRANSLATION_UNIT 1048578 "translation unit prefix" /*yy:token "\n#define" */ PPDEFINE "#define" /*yy:token "\n#elif" */ PPELIF "#elif" /*yy:token "\n#else" */ PPELSE "#else" /*yy:token "\n#endif" */ PPENDIF "#endif" /*yy:token "\n#error" */ PPERROR "#error" /*yy:token "\n#" */ PPHASH_NL "#" /*yy:token "\n#if" */ PPIF "#if" /*yy:token "\n#ifdef" */ PPIFDEF "#ifdef" /*yy:token "\n#ifndef" */ PPIFNDEF "#ifndef" /*yy:token "\n#include" */ PPINCLUDE "#include" /*yy:token "\n#include_next" */ PPINCLUDE_NEXT "#include_next" /*yy:token "\n#line" */ PPLINE "#line" /*yy:token "\n#foo" */ PPNONDIRECTIVE "#foo" /*yy:token "other_%c" */ PPOTHER "ppother" /*yy:token "\n##" */ PPPASTE "##" /*yy:token "\n#pragma" */ PPPRAGMA "#pragma" /*yy:token "\n#undef" */ PPUNDEF "#undef" ADDASSIGN "+=" ALIGNOF "_Alignof" ANDAND "&&" ANDASSIGN "&=" ARROW "->" ASM "asm" AUTO "auto" BOOL "_Bool" BREAK "break" CASE "case" CHAR "char" COMPLEX "_Complex" CONST "const" CONTINUE "continue" DDD "..." DEC "--" DEFAULT "default" DIVASSIGN "/=" DO "do" DOUBLE "double" ELSE "else" ENUM "enum" EQ "==" EXTERN "extern" FLOAT "float" FOR "for" GEQ ">=" GOTO "goto" IF "if" INC "++" INLINE "inline" INT "int" LEQ "<=" LONG "long" LSH "<<" LSHASSIGN "<<=" MODASSIGN "%=" MULASSIGN "*=" NEQ "!=" NORETURN "_Noreturn" ORASSIGN "|=" OROR "||" REGISTER "register" RESTRICT "restrict" RETURN "return" RSH ">>" RSHASSIGN ">>=" SHORT "short" SIGNED "signed" SIZEOF "sizeof" STATIC "static" STATIC_ASSERT "_Static_assert" STRUCT "struct" SUBASSIGN "-=" SWITCH "switch" TYPEDEF "typedef" TYPEDEFNAME "typedefname" TYPEOF "typeof" UNION "union" UNSIGNED "unsigned" VOID "void" VOLATILE "volatile" WHILE "while" XORASSIGN "^=" %type PPTokenList "token list" PPTokenListOpt "optional token list" ReplacementList "replacement list" TextLine "text line" %type GroupPart "group part" %type AbstractDeclarator "abstract declarator" AbstractDeclaratorOpt "optional abstract declarator" ArgumentExpressionList "argument expression list" ArgumentExpressionListOpt "optional argument expression list" AssemblerInstructions "assembler instructions" AssemblerOperand "assembler operand" AssemblerOperands "assembler operands" AssemblerStatement "assembler statement" AssemblerSymbolicNameOpt "optional assembler symbolic name" BasicAssemblerStatement "basic assembler statement" BlockItem "block item" BlockItemList "block item list" BlockItemListOpt "optional block item list" Clobbers "clobbers" CommaOpt "optional comma" CompoundStatement "compound statement" ConstantExpression "constant expression" ControlLine "control line" Declaration "declaration" DeclarationList "declaration list" DeclarationListOpt "optional declaration list" DeclarationSpecifiers "declaration specifiers" DeclarationSpecifiersOpt "optional declaration specifiers" Declarator "declarator" DeclaratorOpt "optional declarator" Designation "designation" DesignationOpt "optional designation" Designator "designator" DesignatorList "designator list" DirectAbstractDeclarator "direct abstract declarator" DirectAbstractDeclaratorOpt "optional direct abstract declarator" DirectDeclarator "direct declarator" ElifGroup "elif group" ElifGroupList "elif group list" ElifGroupListOpt "optional elif group list" ElseGroup "else group" ElseGroupOpt "optional else group" EndifLine "endif line" EnumSpecifier "enum specifier" EnumerationConstant "enumearation constant" Enumerator "enumerator" EnumeratorList "enumerator list" Expression "expression" ExpressionList "expression list" ExpressionListOpt "optional expression list" ExpressionOpt "optional expression" ExpressionStatement "expression statement" ExternalDeclaration "external declaration" FunctionDefinition "function definition" FunctionBody "function body" FunctionSpecifier "function specifier" GroupList "group list" GroupListOpt "optional group list" IdentifierList "identifier list" IdentifierListOpt "optional identifier list" IdentifierOpt "optional identifier" IfGroup "if group" IfSection "if section" InitDeclarator "init declarator" InitDeclaratorList "init declarator list" InitDeclaratorListOpt "optional init declarator list" Initializer "initializer" InitializerList "initializer list" IterationStatement "iteration statement" JumpStatement "jump statement" LabeledStatement "labeled statement" ParameterDeclaration "parameter declaration" ParameterList "parameter list" ParameterTypeList "parameter type list" ParameterTypeListOpt "optional parameter type list" Pointer "pointer" PointerOpt "optional pointer" PreprocessingFile "preprocessing file" SelectionStatement "selection statement" SpecifierQualifierList "specifier qualifier list" SpecifierQualifierListOpt "optional specifier qualifier list" Statement "statement" StaticAssertDeclaration "static assert declaration" StorageClassSpecifier "storage class specifier" StructDeclaration "struct declaration" StructDeclarationList "struct declaration list" StructDeclarator "struct declarator" StructDeclaratorList "struct declarator list" StructOrUnion "struct-or-union" StructOrUnionSpecifier "struct-or-union specifier" TranslationUnit "translation unit" TypeName "type name" TypeQualifier "type qualifier" TypeQualifierList "type qualifier list" TypeQualifierListOpt "optional type qualifier list" TypeSpecifier "type specifier" VolatileOpt "optional volatile" %precedence NOSEMI %precedence ';' %precedence NOELSE %precedence ELSE %right '=' ADDASSIGN ANDASSIGN DIVASSIGN LSHASSIGN MODASSIGN MULASSIGN ORASSIGN RSHASSIGN SUBASSIGN XORASSIGN %right ':' '?' %left OROR %left ANDAND %left '|' %left '^' %left '&' %left EQ NEQ %left '<' '>' GEQ LEQ %left LSH RSH %left '+' '-' %left '%' '*' '/' %precedence CAST %left '!' '~' SIZEOF UNARY %right '(' '.' '[' ARROW DEC INC %% //yy:ignore Start: PREPROCESSING_FILE { lx.preprocessingFile = nil } PreprocessingFile { lx.preprocessingFile = $3.(*PreprocessingFile) } | CONSTANT_EXPRESSION { lx.constantExpression = nil } ConstantExpression { lx.constantExpression = $3.(*ConstantExpression) } | TRANSLATION_UNIT { lx.translationUnit = nil } TranslationUnit { if lx.report.Errors(false) == nil && lx.scope.kind != ScopeFile { panic("internal error") } lx.translationUnit = $3.(*TranslationUnit).reverse() lx.translationUnit.Declarations = lx.scope } // [0](6.4.4.3) EnumerationConstant: IDENTIFIER // [0](6.5.2) ArgumentExpressionList: Expression | ArgumentExpressionList ',' Expression ArgumentExpressionListOpt: /* empty */ {} | ArgumentExpressionList // [0](6.5.16) //yy:field BinOpType Type // The type operands of binary expression are coerced into, if different from Type. //yy:field Type Type // Type of expression. //yy:field Value interface{} // Non nil for certain constant expressions. //yy:field scope *Bindings // Case 0: IDENTIFIER resolution scope. Expression: IDENTIFIER %prec NOSEMI { lhs.scope = lx.scope } | CHARCONST | FLOATCONST | INTCONST | LONGCHARCONST | LONGSTRINGLITERAL | STRINGLITERAL | '(' ExpressionList ')' | Expression '[' ExpressionList ']' | Expression '(' ArgumentExpressionListOpt ')' { o := lhs.ArgumentExpressionListOpt if o == nil { break } if lhs.Expression.Case == 0 { // IDENTIFIER if lx.tweaks.enableBuiltinConstantP &&lhs.Expression.Token.Val == idBuiltinConstantP { break } b := lhs.Expression.scope.Lookup(NSIdentifiers, lhs.Expression.Token.Val) if b.Node == nil && lx.tweaks.enableImplicitFuncDef { for l := o.ArgumentExpressionList; l != nil; l = l.ArgumentExpressionList { l.Expression.eval(lx) } break } } lhs.Expression.eval(lx) for l := o.ArgumentExpressionList; l != nil; l = l.ArgumentExpressionList { l.Expression.eval(lx) } } | Expression '.' IDENTIFIER | Expression "->" IDENTIFIER | Expression "++" | Expression "--" | '(' TypeName ')' '{' InitializerList CommaOpt '}' | "++" Expression | "--" Expression | '&' Expression %prec UNARY | '*' Expression %prec UNARY | '+' Expression %prec UNARY | '-' Expression %prec UNARY | '~' Expression | '!' Expression | "sizeof" Expression | "sizeof" '(' TypeName ')' %prec SIZEOF | '(' TypeName ')' Expression %prec CAST | Expression '*' Expression | Expression '/' Expression | Expression '%' Expression | Expression '+' Expression | Expression '-' Expression | Expression "<<" Expression | Expression ">>" Expression | Expression '<' Expression | Expression '>' Expression | Expression "<=" Expression | Expression ">=" Expression | Expression "==" Expression | Expression "!=" Expression | Expression '&' Expression | Expression '^' Expression | Expression '|' Expression | Expression "&&" Expression | Expression "||" Expression | Expression '?' ExpressionList ':' Expression | Expression '=' Expression | Expression "*=" Expression | Expression "/=" Expression | Expression "%=" Expression | Expression "+=" Expression | Expression "-=" Expression | Expression "<<=" Expression | Expression ">>=" Expression | Expression "&=" Expression | Expression "^=" Expression | Expression "|=" Expression | "_Alignof" '(' TypeName ')' | '(' CompoundStatement ')' | "&&" IDENTIFIER { if !lx.tweaks.enableComputedGotos { lx.report.Err(lhs.Pos(), "computed gotos not enabled") } } | Expression '?' ':' Expression { if !lx.tweaks.enableOmitConditionalOperand { lx.report.Err(lhs.Pos(), "omitting conditional operand not enabled") } } ExpressionOpt: /* empty */ {} | Expression { lhs.Expression.eval(lx) } // [0](6.5.17) //yy:field Type Type // Type of expression. //yy:field Value interface{} // Non nil for certain constant expressions. //yy:list ExpressionList: Expression | ExpressionList ',' Expression ExpressionListOpt: /* empty */ {} | ExpressionList { lhs.ExpressionList.eval(lx) } // [0](6.6) //yy:field Type Type // Type of expression. //yy:field Value interface{} // Non nil for certain constant expressions. //yy:field toks []xc.Token // ConstantExpression: { lx.constExprToks = []xc.Token{lx.last} } Expression { lhs.Value, lhs.Type = lhs.Expression.eval(lx) if lhs.Value == nil { lx.report.Err(lhs.Pos(), "not a constant expression") } l := lx.constExprToks lhs.toks = l[:len(l)-1] lx.constExprToks = nil } // [0](6.7) //yy:field declarator *Declarator // Synthetic declarator when InitDeclaratorListOpt is nil. Declaration: DeclarationSpecifiers InitDeclaratorListOpt ';' { ts0 := lhs.DeclarationSpecifiers.typeSpecifiers() if ts0 == 0 && lx.tweaks.enableImplicitIntType { lhs.DeclarationSpecifiers.typeSpecifier = tsEncode(tsInt) } ts := tsDecode(lhs.DeclarationSpecifiers.typeSpecifiers()) ok := false for _, v := range ts { if v == tsStructSpecifier || v == tsUnionSpecifier { ok = true break } } if ok { s := lhs.DeclarationSpecifiers d := &Declarator{specifier: s} dd := &DirectDeclarator{ Token: xc.Token{Char: lex.NewChar(lhs.Pos(), 0)}, declarator: d, idScope: lx.scope, specifier: s, } d.DirectDeclarator = dd d.setFull(lx) for l := lhs.DeclarationSpecifiers; l != nil; { ts := l.TypeSpecifier if ts != nil && ts.Case == 11 && ts.StructOrUnionSpecifier.Case == 0 { // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' ts.StructOrUnionSpecifier.declarator = d break } if o := l.DeclarationSpecifiersOpt; o != nil { l = o.DeclarationSpecifiers continue } break } } o := lhs.InitDeclaratorListOpt if o != nil { break } s := lhs.DeclarationSpecifiers d := &Declarator{specifier: s} dd := &DirectDeclarator{ Token: xc.Token{Char: lex.NewChar(lhs.Pos(), 0)}, declarator: d, idScope: lx.scope, specifier: s, } d.DirectDeclarator = dd d.setFull(lx) lhs.declarator = d } | StaticAssertDeclaration // [0](6.7) //yy:field attr int // tsInline, tsTypedefName, ... //yy:field typeSpecifier int // Encoded combination of tsVoid, tsInt, ... DeclarationSpecifiers: StorageClassSpecifier DeclarationSpecifiersOpt { lx.scope.specifier = lhs a := lhs.StorageClassSpecifier b := lhs.DeclarationSpecifiersOpt if b == nil { lhs.attr = a.attr break } if a.attr&b.attr != 0 { lx.report.Err(a.Pos(), "invalid storage class specifier") break } lhs.attr = a.attr|b.attr lhs.typeSpecifier = b.typeSpecifier if lhs.StorageClassSpecifier.Case != 0 /* "typedef" */ && lhs.IsTypedef() { lx.report.Err(a.Pos(), "invalid storage class specifier") } } | TypeSpecifier DeclarationSpecifiersOpt { lx.scope.specifier = lhs a := lhs.TypeSpecifier b := lhs.DeclarationSpecifiersOpt if b == nil { lhs.typeSpecifier = a.typeSpecifier break } lhs.attr = b.attr tsb := tsDecode(b.typeSpecifier) if len(tsb) == 1 && tsb[0] == tsTypedefName && lx.tweaks.allowCompatibleTypedefRedefinitions { tsb[0] = 0 } ts := tsEncode(append(tsDecode(a.typeSpecifier), tsb...)...) if _, ok := tsValid[ts]; !ok { ts = tsEncode(tsInt) lx.report.Err(a.Pos(), "invalid type specifier") } lhs.typeSpecifier = ts } | TypeQualifier DeclarationSpecifiersOpt { lx.scope.specifier = lhs a := lhs.TypeQualifier b := lhs.DeclarationSpecifiersOpt if b == nil { lhs.attr = a.attr break } if a.attr&b.attr != 0 { lx.report.Err(a.Pos(), "invalid type qualifier") break } lhs.attr = a.attr|b.attr lhs.typeSpecifier = b.typeSpecifier if lhs.IsTypedef() { lx.report.Err(a.Pos(), "invalid type qualifier") } } | FunctionSpecifier DeclarationSpecifiersOpt { lx.scope.specifier = lhs a := lhs.FunctionSpecifier b := lhs.DeclarationSpecifiersOpt if b == nil { lhs.attr = a.attr break } if a.attr&b.attr != 0 { lx.report.Err(a.Pos(), "invalid function specifier") break } lhs.attr = a.attr|b.attr lhs.typeSpecifier = b.typeSpecifier if lhs.IsTypedef() { lx.report.Err(a.Pos(), "invalid function specifier") } } //yy:field attr int // tsInline, tsTypedefName, ... //yy:field typeSpecifier int // Encoded combination of tsVoid, tsInt, ... DeclarationSpecifiersOpt: /* empty */ {} | DeclarationSpecifiers { lhs.attr = lhs.DeclarationSpecifiers.attr lhs.typeSpecifier = lhs.DeclarationSpecifiers.typeSpecifier } // [0](6.7) InitDeclaratorList: InitDeclarator | InitDeclaratorList ',' InitDeclarator InitDeclaratorListOpt: /* empty */ {} | InitDeclaratorList // [0](6.7) InitDeclarator: Declarator { lhs.Declarator.setFull(lx) } | Declarator { d := $1.(*Declarator) d.setFull(lx) } '=' Initializer { d := lhs.Declarator lhs.Initializer.typeCheck(&d.Type, d.Type, lhs.Declarator.specifier.IsStatic(), lx) if d.Type.Specifier().IsExtern() { id, _ := d.Identifier() lx.report.Err(d.Pos(), "'%s' initialized and declared 'extern'", dict.S(id)) } } // [0](6.7.1) //yy:field attr int StorageClassSpecifier: "typedef" { lhs.attr = saTypedef } | "extern" { lhs.attr = saExtern } | "static" { lhs.attr = saStatic } | "auto" { lhs.attr = saAuto } | "register" { lhs.attr = saRegister } // [0](6.7.2) //yy:field scope *Bindings // If case TYPEDEFNAME. //yy:field typeSpecifier int // Encoded combination of tsVoid, tsInt, ... //yy:field Type Type // Type of typeof. TypeSpecifier: "void" { lhs.typeSpecifier = tsEncode(tsVoid) } | "char" { lhs.typeSpecifier = tsEncode(tsChar) } | "short" { lhs.typeSpecifier = tsEncode(tsShort) } | "int" { lhs.typeSpecifier = tsEncode(tsInt) } | "long" { lhs.typeSpecifier = tsEncode(tsLong) } | "float" { lhs.typeSpecifier = tsEncode(tsFloat) } | "double" { lhs.typeSpecifier = tsEncode(tsDouble) } | "signed" { lhs.typeSpecifier = tsEncode(tsSigned) } | "unsigned" { lhs.typeSpecifier = tsEncode(tsUnsigned) } | "_Bool" { lhs.typeSpecifier = tsEncode(tsBool) } | "_Complex" { lhs.typeSpecifier = tsEncode(tsComplex) } | StructOrUnionSpecifier { lhs.typeSpecifier = tsEncode(lhs.StructOrUnionSpecifier.typeSpecifiers()) } | EnumSpecifier { lhs.typeSpecifier = tsEncode(tsEnumSpecifier) } /*yy:example "\U00100002 typedef int i; i j;" */ | TYPEDEFNAME { lhs.typeSpecifier = tsEncode(tsTypedefName) _, lhs.scope = lx.scope.Lookup2(NSIdentifiers, lhs.Token.Val) } | "typeof" '(' Expression ')' { lhs.typeSpecifier = tsEncode(tsTypeof) _, lhs.Type = lhs.Expression.eval(lx) } | "typeof" '(' TypeName ')' { lhs.typeSpecifier = tsEncode(tsTypeof) lhs.Type = undefined if t := lhs.TypeName.Type; t != nil { lhs.Type = t } } // [0](6.7.2.1) //yy:example "\U00100002 struct { int i; } (" //yy:field alignOf int //yy:field declarator *Declarator // Synthetic declarator when tagged struct/union defined inline. //yy:field scope *Bindings //yy:field sizeOf int StructOrUnionSpecifier: StructOrUnion IdentifierOpt '{' { if o := $2.(*IdentifierOpt); o != nil { lx.scope.declareStructTag(o.Token, lx.report) } lx.pushScope(ScopeMembers) lx.scope.isUnion = $1.(*StructOrUnion).Case == 1 // "union" lx.scope.prevStructDeclarator = nil } StructDeclarationList '}' { sc := lx.scope lhs.scope = sc if sc.bitOffset != 0 { finishBitField(lhs, lx) } i := 0 var bt Type var d *Declarator for l := lhs.StructDeclarationList; l != nil; l = l.StructDeclarationList { for l := l.StructDeclaration.StructDeclaratorList; l != nil; l = l.StructDeclaratorList { switch sd := l.StructDeclarator; sd.Case { case 0: // Declarator d = sd.Declarator case 1: // DeclaratorOpt ':' ConstantExpression if o := sd.DeclaratorOpt; o != nil { x := o.Declarator if x.bitOffset == 0 { d = x bt = lx.scope.bitFieldTypes[i] i++ } x.bitFieldType = bt } } } } lx.scope.bitFieldTypes = nil lhs.alignOf = sc.maxAlign switch { case sc.isUnion: lhs.sizeOf = align(sc.maxSize, sc.maxAlign) default: off := sc.offset lhs.sizeOf = align(sc.offset, sc.maxAlign) if d != nil { d.padding = lhs.sizeOf-off } } lx.popScope(lhs.Token2) if o := lhs.IdentifierOpt; o != nil { lx.scope.defineStructTag(o.Token, lhs, lx.report) } } | StructOrUnion IDENTIFIER { lx.scope.declareStructTag(lhs.Token, lx.report) lhs.scope = lx.scope } | StructOrUnion IdentifierOpt '{' '}' { if !lx.tweaks.enableEmptyStructs { lx.report.Err(lhs.Token.Pos(), "empty structs/unions not allowed") } if o := $2.(*IdentifierOpt); o != nil { lx.scope.declareStructTag(o.Token, lx.report) } lx.scope.isUnion = $1.(*StructOrUnion).Case == 1 // "union" lx.scope.prevStructDeclarator = nil lhs.alignOf = 1 lhs.sizeOf = 0 if o := lhs.IdentifierOpt; o != nil { lx.scope.defineStructTag(o.Token, lhs, lx.report) } } // [0](6.7.2.1) StructOrUnion: "struct" | "union" // [0](6.7.2.1) StructDeclarationList: StructDeclaration | StructDeclarationList StructDeclaration // [0](6.7.2.1) StructDeclaration: SpecifierQualifierList StructDeclaratorList ';' { s := lhs.SpecifierQualifierList if k := s.kind(); k != Struct && k != Union { break } d := &Declarator{specifier: s} dd := &DirectDeclarator{ Token: xc.Token{Char: lex.NewChar(lhs.Pos(), 0)}, declarator: d, idScope: lx.scope, specifier: s, } d.DirectDeclarator = dd d.setFull(lx) for l := lhs.SpecifierQualifierList; l != nil; { ts := l.TypeSpecifier if ts != nil && ts.Case == 11 && ts.StructOrUnionSpecifier.Case == 0 { // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' ts.StructOrUnionSpecifier.declarator = d break } if o := l.SpecifierQualifierListOpt; o != nil { l = o.SpecifierQualifierList continue } break } } | SpecifierQualifierList ';' { s := lhs.SpecifierQualifierList if !lx.tweaks.enableAnonymousStructFields { lx.report.Err(lhs.Token.Pos(), "unnamed fields not allowed") } else if k := s.kind(); k != Struct && k != Union { lx.report.Err(lhs.Token.Pos(), "only unnamed structs and unions are allowed") break } d := &Declarator{specifier: s} dd := &DirectDeclarator{ Token: xc.Token{Char: lex.NewChar(lhs.Pos(), 0)}, declarator: d, idScope: lx.scope, specifier: s, } d.DirectDeclarator = dd d.setFull(lx) // we have no struct declarators to parse, so we have to create the case of one implicit declarator // because else the size of anonymous members is not included in the struct size! dummy := &StructDeclarator{Declarator: d} dummy.post(lx) for l := lhs.SpecifierQualifierList; l != nil; { ts := l.TypeSpecifier if ts != nil && ts.Case == 11 && ts.StructOrUnionSpecifier.Case == 0 { // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' ts.StructOrUnionSpecifier.declarator = d break } if o := l.SpecifierQualifierListOpt; o != nil { l = o.SpecifierQualifierList continue } break } } | StaticAssertDeclaration // [0](6.7.2.1) //yy:field attr int // tsInline, tsTypedefName, ... //yy:field typeSpecifier int // Encoded combination of tsVoid, tsInt, ... SpecifierQualifierList: TypeSpecifier SpecifierQualifierListOpt { lx.scope.specifier = lhs a := lhs.TypeSpecifier b := lhs.SpecifierQualifierListOpt if b == nil { lhs.typeSpecifier = a.typeSpecifier break } lhs.attr = b.attr ts := tsEncode(append(tsDecode(a.typeSpecifier), tsDecode(b.typeSpecifier)...)...) if _, ok := tsValid[ts]; !ok { lx.report.Err(a.Pos(), "invalid type specifier") break } lhs.typeSpecifier = ts } | TypeQualifier SpecifierQualifierListOpt { lx.scope.specifier = lhs a := lhs.TypeQualifier b := lhs.SpecifierQualifierListOpt if b == nil { lhs.attr = a.attr break } if a.attr&b.attr != 0 { lx.report.Err(a.Pos(), "invalid type qualifier") break } lhs.attr = a.attr|b.attr lhs.typeSpecifier = b.typeSpecifier } //yy:field attr int // tsInline, tsTypedefName, ... //yy:field typeSpecifier int // Encoded combination of tsVoid, tsInt, ... SpecifierQualifierListOpt: /* empty */ {} | SpecifierQualifierList { lhs.attr = lhs.SpecifierQualifierList.attr lhs.typeSpecifier = lhs.SpecifierQualifierList.typeSpecifier } // [0](6.7.2.1) StructDeclaratorList: StructDeclarator | StructDeclaratorList ',' StructDeclarator // [0](6.7.2.1) StructDeclarator: Declarator { lhs.Declarator.setFull(lx) lhs.post(lx) } | DeclaratorOpt ':' ConstantExpression { m := lx.model e := lhs.ConstantExpression if e.Value == nil { e.Value, e.Type = m.value2(1, m.IntType) } if !IsIntType(e.Type) { lx.report.Err(e.Pos(), "bit field width not an integer (have '%s')", e.Type) e.Value, e.Type = m.value2(1, m.IntType) } if o := lhs.DeclaratorOpt; o != nil { o.Declarator.setFull(lx) } lhs.post(lx) } CommaOpt: /* empty */ {} | ',' // [0](6.7.2.2) //yy:field unsigned bool EnumSpecifier: "enum" IdentifierOpt { if o := $2.(*IdentifierOpt); o != nil { lx.scope.declareEnumTag(o.Token, lx.report) } lx.iota = 0 } '{' EnumeratorList CommaOpt '}' { if o := lhs.IdentifierOpt; o != nil { lx.scope.defineEnumTag(o.Token, lhs, lx.report) } if !lx.tweaks.enableUnsignedEnums { break } lhs.unsigned = true loop: for l := lhs.EnumeratorList; l != nil; l = l.EnumeratorList { switch e := l.Enumerator; x := e.Value.(type) { case int32: if x < 0 { lhs.unsigned = false break loop } case int64: if x < 0 { lhs.unsigned = false break loop } default: panic(fmt.Errorf("%s: TODO Enumerator.Value type %T", position(e.Pos()), x)) } } } | "enum" IDENTIFIER { lx.scope.declareEnumTag(lhs.Token2, lx.report) } // [0](6.7.2.2) EnumeratorList: Enumerator | EnumeratorList ',' Enumerator // [0](6.7.2.2) //yy:field Value interface{} // Enumerator's value. Enumerator: EnumerationConstant { m := lx.model v := m.MustConvert(lx.iota, m.IntType) lhs.Value = v lx.scope.defineEnumConst(lx, lhs.EnumerationConstant.Token, v) } | EnumerationConstant '=' ConstantExpression { m := lx.model e := lhs.ConstantExpression var v interface{} // [0], 6.7.2.2 // The expression that defines the value of an enumeration // constant shall be an integer constant expression that has a // value representable as an int. switch { case !IsIntType(e.Type): lx.report.Err(e.Pos(), "not an integer constant expression (have '%s')", e.Type) v = m.MustConvert(int32(0), m.IntType) default: var ok bool if v, ok = m.enumValueToInt(e.Value); !ok { lx.report.Err(e.Pos(), "overflow in enumeration value: %v", e.Value) } } lhs.Value = v lx.scope.defineEnumConst(lx, lhs.EnumerationConstant.Token, v) } // [0](6.7.3) //yy:field attr int // tsInline, tsTypedefName, ... TypeQualifier: "const" { lhs.attr = saConst } | "restrict" { lhs.attr = saRestrict } | "volatile" { lhs.attr = saVolatile } // [0](6.7.4) //yy:field attr int // tsInline, tsTypedefName, ... FunctionSpecifier: "inline" { lhs.attr = saInline } | "_Noreturn" { lhs.attr = saNoreturn } // [0](6.7.5) //yy:field Linkage Linkage //yy:field Type Type //yy:field bitFieldType Type //yy:field bitFieldGroup int //yy:field bitOffset int //yy:field bits int //yy:field offsetOf int //yy:field padding int //yy:field specifier Specifier Declarator: PointerOpt DirectDeclarator { lhs.specifier = lx.scope.specifier lhs.DirectDeclarator.declarator = lhs } DeclaratorOpt: /* empty */ {} | Declarator // [0](6.7.5) //yy:field EnumVal interface{} // Non nil if DD declares an enumeration constant. //yy:field declarator *Declarator //yy:field elements int //yy:field idScope *Bindings // Of case 0: IDENTIFIER. //yy:field paramsScope *Bindings //yy:field parent *DirectDeclarator //yy:field prev *Binding // Existing declaration in same scope, if any. //yy:field specifier Specifier //yy:field visible *Binding // Existing declaration of same ident visible in same scope, if any and this DD has storage class extrn. DirectDeclarator: IDENTIFIER { lhs.specifier = lx.scope.specifier lx.scope.declareIdentifier(lhs.Token, lhs, lx.report) lhs.idScope = lx.scope } | '(' Declarator ')' { lhs.Declarator.specifier = nil lhs.Declarator.DirectDeclarator.parent = lhs } | DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' { lhs.elements = -1 if o := lhs.ExpressionOpt; o != nil { var err error if lhs.elements, err = elements(o.Expression.eval(lx)); err != nil { lx.report.Err(o.Expression.Pos(), "%s", err) } } lhs.DirectDeclarator.parent = lhs } | DirectDeclarator '[' "static" TypeQualifierListOpt Expression ']' { var err error if lhs.elements, err = elements(lhs.Expression.eval(lx)); err != nil { lx.report.Err(lhs.Expression.Pos(), "%s", err) } lhs.DirectDeclarator.parent = lhs } | DirectDeclarator '[' TypeQualifierList "static" Expression ']' { var err error if lhs.elements, err = elements(lhs.Expression.eval(lx)); err != nil { lx.report.Err(lhs.Expression.Pos(), "%s", err) } lhs.DirectDeclarator.parent = lhs } | DirectDeclarator '[' TypeQualifierListOpt '*' ']' { lhs.DirectDeclarator.parent = lhs lhs.elements = -1 } | DirectDeclarator '(' { lx.pushScope(ScopeParams) } ParameterTypeList ')' { lhs.paramsScope, _ = lx.popScope(lhs.Token2) lhs.DirectDeclarator.parent = lhs } | DirectDeclarator '(' IdentifierListOpt ')' { lhs.DirectDeclarator.parent = lhs } // [0](6.7.5) Pointer: '*' TypeQualifierListOpt | '*' TypeQualifierListOpt Pointer PointerOpt: /* empty */ {} | Pointer // [0](6.7.5) //yy:field attr int // tsInline, tsTypedefName, ... TypeQualifierList: TypeQualifier { lhs.attr = lhs.TypeQualifier.attr } | TypeQualifierList TypeQualifier { a := lhs.TypeQualifierList b := lhs.TypeQualifier if a.attr&b.attr != 0 { lx.report.Err(b.Pos(), "invalid type qualifier") break } lhs.attr = a.attr|b.attr } TypeQualifierListOpt: /* empty */ {} | TypeQualifierList // [0](6.7.5) //yy:field params []Parameter ParameterTypeList: ParameterList { lhs.post() } | ParameterList ',' "..." { lhs.post() } ParameterTypeListOpt: /* empty */ {} | ParameterTypeList // [0](6.7.5) ParameterList: ParameterDeclaration | ParameterList ',' ParameterDeclaration // [0](6.7.5) //yy:field declarator *Declarator /*TODO A declaration of a parameter as ‘‘function returning type’’ shall be adjusted to ‘‘pointer to function returning type’’, as in 6.3.2.1. */ ParameterDeclaration: DeclarationSpecifiers Declarator { lhs.Declarator.setFull(lx) lhs.declarator = lhs.Declarator } | DeclarationSpecifiers AbstractDeclaratorOpt { if o := lhs.AbstractDeclaratorOpt; o != nil { lhs.declarator = o.AbstractDeclarator.declarator lhs.declarator.setFull(lx) break } d := &Declarator{ specifier: lx.scope.specifier, DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER }, } d.DirectDeclarator.declarator = d lhs.declarator = d d.setFull(lx) } // [0](6.7.5) IdentifierList: IDENTIFIER | IdentifierList ',' IDENTIFIER //yy:field params []Parameter IdentifierListOpt: /* empty */ {} | IdentifierList IdentifierOpt: /* empty */ {} | IDENTIFIER // [0](6.7.6) //yy:field Type Type //yy:field declarator *Declarator //yy:field scope *Bindings TypeName: { lx.pushScope(ScopeBlock) } SpecifierQualifierList AbstractDeclaratorOpt { if o := lhs.AbstractDeclaratorOpt; o != nil { lhs.declarator = o.AbstractDeclarator.declarator } else { d := &Declarator{ specifier: lhs.SpecifierQualifierList, DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER idScope: lx.scope, }, } d.DirectDeclarator.declarator = d lhs.declarator = d } lhs.Type = lhs.declarator.setFull(lx) lhs.scope = lx.scope lx.popScope(xc.Token{}) } // [0](6.7.6) //yy:field declarator *Declarator AbstractDeclarator: Pointer { d := &Declarator{ specifier: lx.scope.specifier, PointerOpt: &PointerOpt { Pointer: lhs.Pointer, }, DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER idScope: lx.scope, }, } d.DirectDeclarator.declarator = d lhs.declarator = d } | PointerOpt DirectAbstractDeclarator { d := &Declarator{ specifier: lx.scope.specifier, PointerOpt: lhs.PointerOpt, DirectDeclarator: lhs.DirectAbstractDeclarator.directDeclarator, } d.DirectDeclarator.declarator = d lhs.declarator = d } AbstractDeclaratorOpt: /* empty */ {} | AbstractDeclarator // [0](6.7.6) //yy:field directDeclarator *DirectDeclarator //yy:field paramsScope *Bindings DirectAbstractDeclarator: '(' AbstractDeclarator ')' { lhs.AbstractDeclarator.declarator.specifier = nil lhs.directDeclarator = &DirectDeclarator{ Case: 1, // '(' Declarator ')' Declarator: lhs.AbstractDeclarator.declarator, } lhs.AbstractDeclarator.declarator.DirectDeclarator.parent = lhs.directDeclarator } | DirectAbstractDeclaratorOpt '[' ExpressionOpt ']' { nElements := -1 if o := lhs.ExpressionOpt; o != nil { var err error if nElements, err = elements(o.Expression.eval(lx)); err != nil { lx.report.Err(o.Expression.Pos(), "%s", err) } } var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 2, // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' DirectDeclarator: dd, ExpressionOpt: lhs.ExpressionOpt, elements: nElements, } dd.parent = lhs.directDeclarator } | DirectAbstractDeclaratorOpt '[' TypeQualifierList ExpressionOpt ']' { if o := lhs.ExpressionOpt; o != nil { o.Expression.eval(lx) } var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 2, // DirectDeclarator '[' TypeQualifierListOpt ExpressionOpt ']' DirectDeclarator: dd, TypeQualifierListOpt: &TypeQualifierListOpt{ lhs.TypeQualifierList }, ExpressionOpt: lhs.ExpressionOpt, } dd.parent = lhs.directDeclarator } | DirectAbstractDeclaratorOpt '[' "static" TypeQualifierListOpt Expression ']' { lhs.Expression.eval(lx) var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 2, // DirectDeclarator '[' "static" TypeQualifierListOpt Expression ']' DirectDeclarator: dd, TypeQualifierListOpt: lhs.TypeQualifierListOpt, Expression: lhs.Expression, } dd.parent = lhs.directDeclarator } | DirectAbstractDeclaratorOpt '[' TypeQualifierList "static" Expression ']' { lhs.Expression.eval(lx) var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 4, // DirectDeclarator '[' TypeQualifierList "static" Expression ']' DirectDeclarator: dd, TypeQualifierList: lhs.TypeQualifierList, Expression: lhs.Expression, } dd.parent = lhs.directDeclarator } | DirectAbstractDeclaratorOpt '[' '*' ']' { var dd *DirectDeclarator switch o := lhs.DirectAbstractDeclaratorOpt; { case o == nil: dd = &DirectDeclarator{ Case: 0, // IDENTIFIER } default: dd = o.DirectAbstractDeclarator.directDeclarator } lhs.directDeclarator = &DirectDeclarator{ Case: 5, // DirectDeclarator '[' TypeQualifierListOpt '*' ']' DirectDeclarator: dd, } dd.parent = lhs.directDeclarator } | '(' { lx.pushScope(ScopeParams) } ParameterTypeListOpt ')' { lhs.paramsScope, _ = lx.popScope(lhs.Token2) switch o := lhs.ParameterTypeListOpt; { case o != nil: lhs.directDeclarator = &DirectDeclarator{ Case: 6, // DirectDeclarator '(' ParameterTypeList ')' DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER }, ParameterTypeList: o.ParameterTypeList, } default: lhs.directDeclarator = &DirectDeclarator{ Case: 7, // DirectDeclarator '(' IdentifierListOpt ')' DirectDeclarator: &DirectDeclarator{ Case: 0, // IDENTIFIER }, } } lhs.directDeclarator.DirectDeclarator.parent = lhs.directDeclarator } | DirectAbstractDeclarator '(' { lx.pushScope(ScopeParams) } ParameterTypeListOpt ')' { lhs.paramsScope, _ = lx.popScope(lhs.Token2) switch o := lhs.ParameterTypeListOpt; { case o != nil: lhs.directDeclarator = &DirectDeclarator{ Case: 6, // DirectDeclarator '(' ParameterTypeList ')' DirectDeclarator: lhs.DirectAbstractDeclarator.directDeclarator, ParameterTypeList: o.ParameterTypeList, } default: lhs.directDeclarator = &DirectDeclarator{ Case: 7, // DirectDeclarator '(' IdentifierListOpt ')' DirectDeclarator: lhs.DirectAbstractDeclarator.directDeclarator, } } lhs.directDeclarator.DirectDeclarator.parent = lhs.directDeclarator } DirectAbstractDeclaratorOpt: /* empty */ {} | DirectAbstractDeclarator // [0](6.7.8) Initializer: Expression { lhs.Expression.eval(lx) } | '{' InitializerList CommaOpt '}' | IDENTIFIER ':' Initializer { if !lx.tweaks.enableLegacyDesignators { lx.report.Err(lhs.Pos(), "legacy designators not enabled") } } // [0](6.7.8) InitializerList: DesignationOpt Initializer | InitializerList ',' DesignationOpt Initializer | /* empty */ {} // [0](6.7.8) Designation: DesignatorList '=' DesignationOpt: /* empty */ {} | Designation // [0](6.7.8) DesignatorList: Designator | DesignatorList Designator // [0](6.7.8) Designator: '[' ConstantExpression ']' | '.' IDENTIFIER // [0](6.8) Statement: LabeledStatement | CompoundStatement | ExpressionStatement | SelectionStatement | IterationStatement | JumpStatement | AssemblerStatement // [0](6.8.1) LabeledStatement: IDENTIFIER ':' Statement | "case" ConstantExpression ':' Statement | "default" ':' Statement // [0](6.8.2) //yy:field scope *Bindings // Scope of the CompoundStatement. CompoundStatement: '{' { m := lx.scope.mergeScope lx.pushScope(ScopeBlock) if m != nil { lx.scope.merge(m) } lx.scope.mergeScope = nil } BlockItemListOpt '}' { lhs.scope = lx.scope lx.popScope(lhs.Token2) } // [0](6.8.2) BlockItemList: BlockItem | BlockItemList BlockItem BlockItemListOpt: /* empty */ {} | BlockItemList // [0](6.8.2) BlockItem: Declaration | Statement // [0](6.8.3) ExpressionStatement: ExpressionListOpt ';' // [0](6.8.4) SelectionStatement: "if" '(' ExpressionList ')' Statement %prec NOELSE { lhs.ExpressionList.eval(lx) } | "if" '(' ExpressionList ')' Statement "else" Statement { lhs.ExpressionList.eval(lx) } | "switch" '(' ExpressionList ')' Statement { lhs.ExpressionList.eval(lx) } // [0](6.8.5) IterationStatement: "while" '(' ExpressionList ')' Statement { lhs.ExpressionList.eval(lx) } | "do" Statement "while" '(' ExpressionList ')' ';' { lhs.ExpressionList.eval(lx) } | "for" '(' ExpressionListOpt ';' ExpressionListOpt ';' ExpressionListOpt ')' Statement | "for" '(' Declaration ExpressionListOpt ';' ExpressionListOpt ')' Statement // [0](6.8.6) JumpStatement: "goto" IDENTIFIER ';' | "continue" ';' | "break" ';' | "return" ExpressionListOpt ';' | "goto" Expression ';' { _, t := lhs.Expression.eval(lx) if t == nil { break } for t != nil && t.Kind() == Ptr { t = t.Element() } if t == nil || t.Kind() != Void { lx.report.Err(lhs.Pos(), "invalid computed goto argument type, have '%s'", t) } if !lx.tweaks.enableComputedGotos { lx.report.Err(lhs.Pos(), "computed gotos not enabled") } } // [0](6.9) //yy:field Comments map[token.Pos]int // Position -> comment ID. Enable using the KeepComments option. //yy:field Declarations *Bindings //yy:field Macros map[int]*Macro // Ident ID -> preprocessor macro defined by ident. //yy:field Model *Model // Model used to parse the TranslationUnit. //yy:list TranslationUnit: ExternalDeclaration | TranslationUnit ExternalDeclaration // [0](6.9) ExternalDeclaration: FunctionDefinition | Declaration | BasicAssemblerStatement ';' | ';' { if !lx.tweaks.enableEmptyDeclarations { lx.report.Err(lhs.Pos(), "C++11 empty declarations are illegal in C99.") } } // [0](6.9.1) FunctionDefinition: DeclarationSpecifiers Declarator DeclarationListOpt { if ds := $1.(*DeclarationSpecifiers); ds.typeSpecifier == 0 { ds.typeSpecifier = tsEncode(tsInt) $2.(*Declarator).Type = lx.model.IntType if !lx.tweaks.enableOmitFuncRetType { lx.report.Err($2.Pos(), "missing function return type") } } var fd *FunctionDefinition fd.post(lx, $2.(*Declarator), $3.(*DeclarationListOpt)) } FunctionBody | { lx.scope.specifier = &DeclarationSpecifiers{typeSpecifier: tsEncode(tsInt)} } Declarator DeclarationListOpt { if !lx.tweaks.enableOmitFuncRetType { lx.report.Err($2.Pos(), "missing function return type") } var fd *FunctionDefinition fd.post(lx, $2.(*Declarator), $3.(*DeclarationListOpt)) } FunctionBody //yy:field scope *Bindings // Scope of the FunctionBody. FunctionBody: { // Handle __func__, [0], 6.4.2.2. id, _ := lx.fnDeclarator.Identifier() lx.injectFunc = []xc.Token{ {lex.Char{Rune: STATIC}, idStatic}, {lex.Char{Rune: CONST}, idConst}, {lex.Char{Rune: CHAR}, idChar}, {lex.Char{Rune: IDENTIFIER}, idMagicFunc}, {lex.Char{Rune: '['}, 0}, {lex.Char{Rune: ']'}, 0}, {lex.Char{Rune: '='}, 0}, {lex.Char{Rune: STRINGLITERAL}, xc.Dict.SID(fmt.Sprintf("%q", xc.Dict.S(id)))}, {lex.Char{Rune: ';'}, 0}, } } CompoundStatement { lhs.scope = lhs.CompoundStatement.scope } | { m := lx.scope.mergeScope lx.pushScope(ScopeBlock) if m != nil { lx.scope.merge(m) } lx.scope.mergeScope = nil } AssemblerStatement ';' { lhs.scope = lx.scope lx.popScope(lx.tokPrev) } // [0](6.9.1) DeclarationList: Declaration | DeclarationList Declaration //yy:field paramsScope *Bindings DeclarationListOpt: /* empty */ {} | { lx.pushScope(ScopeParams) } DeclarationList { lhs.paramsScope, _ = lx.popScopePos(lhs.Pos()) } //yy:list AssemblerInstructions: STRINGLITERAL | AssemblerInstructions STRINGLITERAL BasicAssemblerStatement: "asm" VolatileOpt '(' AssemblerInstructions ')' VolatileOpt: /* empty */ {} | "volatile" AssemblerOperand: AssemblerSymbolicNameOpt STRINGLITERAL '(' Expression ')' //yy:list AssemblerOperands: AssemblerOperand | AssemblerOperands ',' AssemblerOperand AssemblerSymbolicNameOpt: /* empty */ {} | '[' IDENTIFIER ']' //yy:list Clobbers: STRINGLITERAL | Clobbers ',' STRINGLITERAL AssemblerStatement: BasicAssemblerStatement | "asm" VolatileOpt '(' AssemblerInstructions ':' AssemblerOperands ')' | "asm" VolatileOpt '(' AssemblerInstructions ':' AssemblerOperands ':' AssemblerOperands ')' | "asm" VolatileOpt '(' AssemblerInstructions ':' AssemblerOperands ':' AssemblerOperands ':' Clobbers ')' | "asm" VolatileOpt "goto" '(' AssemblerInstructions ':' ':' AssemblerOperands ':' Clobbers ':' IdentifierList ')' | "asm" VolatileOpt '(' AssemblerInstructions ':' ')' // https://github.com/cznic/cc/issues/59 | "asm" VolatileOpt '(' AssemblerInstructions ':' ':' AssemblerOperands ')' StaticAssertDeclaration: "_Static_assert" '(' ConstantExpression ',' STRINGLITERAL ')' ';' { ce := lhs.ConstantExpression if ce.Type == nil || ce.Type.Kind() == Undefined || ce.Value == nil || !IsIntType(ce.Type) { lx.report.Err(ce.Pos(), "invalid static assert expression (have '%v')", ce.Type) break } if !isNonZero(ce.Value) { lx.report.ErrTok(lhs.Token, "%s", lhs.Token4.S()) } } // ========================================================= PREPROCESSING_FILE // [0](6.10) //yy:field path string PreprocessingFile: GroupList // No more GroupListOpt due to final '\n' injection. { lhs.path = lx.file.Name() } // [0](6.10) GroupList: GroupPart //yy:example "\U00100000int\nf() {}" | GroupList GroupPart GroupListOpt: /* empty */ {} //yy:example "\U00100000 \n#ifndef a\nb\n#elif" | GroupList // [0](6.10) //yy:ignore GroupPart: ControlLine { $$ = $1.(Node) } | IfSection { $$ = $1.(Node) } | PPNONDIRECTIVE PPTokenList '\n' { $$ = $1 } | TextLine { $$ = $1 } //(6.10) IfSection: IfGroup ElifGroupListOpt ElseGroupOpt EndifLine //(6.10) IfGroup: PPIF PPTokenList '\n' GroupListOpt | PPIFDEF IDENTIFIER '\n' GroupListOpt | PPIFNDEF IDENTIFIER '\n' GroupListOpt // [0](6.10) ElifGroupList: ElifGroup | ElifGroupList ElifGroup ElifGroupListOpt: /* empty */ {} | ElifGroupList // [0](6.10) ElifGroup: PPELIF PPTokenList '\n' GroupListOpt // [0](6.10) ElseGroup: PPELSE '\n' GroupListOpt ElseGroupOpt: /* empty */ {} | ElseGroup // [0](6.10) EndifLine: PPENDIF /* PPTokenListOpt */ //TODO Option enabling the non std PPTokenListOpt part. // [0](6.10) ControlLine: PPDEFINE IDENTIFIER ReplacementList | PPDEFINE IDENTIFIER_LPAREN "..." ')' ReplacementList | PPDEFINE IDENTIFIER_LPAREN IdentifierList ',' "..." ')' ReplacementList | PPDEFINE IDENTIFIER_LPAREN IdentifierListOpt ')' ReplacementList | PPERROR PPTokenListOpt | PPHASH_NL | PPINCLUDE PPTokenList '\n' | PPLINE PPTokenList '\n' | PPPRAGMA PPTokenListOpt //yy:example "\U00100000 \n#undef foo" | PPUNDEF IDENTIFIER '\n' // Non standard stuff. | PPDEFINE IDENTIFIER_LPAREN IdentifierList "..." ')' ReplacementList { if !lx.tweaks.enableDefineOmitCommaBeforeDDD { lx.report.ErrTok(lhs.Token4, "missing comma before \"...\"") } } | PPDEFINE '\n' { if !lx.tweaks.enableEmptyDefine { lx.report.ErrTok(lhs.Token2, "expected identifier") } } //yy:example "\U00100000 \n#undef foo(bar)" | PPUNDEF IDENTIFIER PPTokenList '\n' { toks := decodeTokens(lhs.PPTokenList, nil, false) if len(toks) == 0 { lhs.Case = 9 // PPUNDEF IDENTIFIER '\n' break } lx.report.ErrTok(toks[0], "extra tokens after #undef argument") } | PPINCLUDE_NEXT PPTokenList '\n' // [0](6.10) //yy:ignore TextLine: PPTokenListOpt // [0](6.10) //yy:ignore ReplacementList: PPTokenListOpt // [0](6.10) //yy:ignore PPTokenList: PPTokens { $$ = PPTokenList(dict.ID(lx.encBuf)) lx.encBuf = lx.encBuf[:0] lx.encPos = 0 } //yy:ignore PPTokenListOpt: '\n' { $$ = 0 } | PPTokenList '\n' //yy:ignore PPTokens: PPOTHER | PPTokens PPOTHER ================================================ FILE: scanner.go ================================================ // Code generated by golex. DO NOT EDIT. // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on [0], 6.4. package cc import ( "fmt" "github.com/cznic/golex/lex" ) const ( _ = iota scCOMMENT // [`/*`, `*/`] scDEFINE // [^#define, next token] scDIRECTIVE // [^#, next token] scHEADER // [`#include`, next token] ) func (l *lexer) scan() (r int) { c := l.Enter() yystate0: yyrule := -1 _ = yyrule c = l.Rule0() switch yyt := l.sc; yyt { default: panic(fmt.Errorf(`invalid start condition %d`, yyt)) case 0: // start condition: INITIAL goto yystart1 case 1: // start condition: COMMENT goto yystart147 case 2: // start condition: DEFINE goto yystart152 case 3: // start condition: DIRECTIVE goto yystart165 case 4: // start condition: HEADER goto yystart221 } goto yystate0 // silence unused label error goto yyAction // silence unused label error yyAction: switch yyrule { case 1: goto yyrule1 case 2: goto yyrule2 case 3: goto yyrule3 case 4: goto yyrule4 case 5: goto yyrule5 case 6: goto yyrule6 case 7: goto yyrule7 case 8: goto yyrule8 case 9: goto yyrule9 case 10: goto yyrule10 case 11: goto yyrule11 case 12: goto yyrule12 case 13: goto yyrule13 case 14: goto yyrule14 case 15: goto yyrule15 case 16: goto yyrule16 case 17: goto yyrule17 case 18: goto yyrule18 case 19: goto yyrule19 case 20: goto yyrule20 case 21: goto yyrule21 case 22: goto yyrule22 case 23: goto yyrule23 case 24: goto yyrule24 case 25: goto yyrule25 case 26: goto yyrule26 case 27: goto yyrule27 case 28: goto yyrule28 case 29: goto yyrule29 case 30: goto yyrule30 case 31: goto yyrule31 case 32: goto yyrule32 case 33: goto yyrule33 case 34: goto yyrule34 case 35: goto yyrule35 case 36: goto yyrule36 case 37: goto yyrule37 case 38: goto yyrule38 case 39: goto yyrule39 case 40: goto yyrule40 case 41: goto yyrule41 case 42: goto yyrule42 case 43: goto yyrule43 case 44: goto yyrule44 case 45: goto yyrule45 case 46: goto yyrule46 case 47: goto yyrule47 case 48: goto yyrule48 case 49: goto yyrule49 case 50: goto yyrule50 case 51: goto yyrule51 case 52: goto yyrule52 case 53: goto yyrule53 case 54: goto yyrule54 case 55: goto yyrule55 case 56: goto yyrule56 case 57: goto yyrule57 case 58: goto yyrule58 case 59: goto yyrule59 case 60: goto yyrule60 } goto yystate1 // silence unused label error yystate1: c = l.Next() yystart1: switch { default: goto yyabort case c == '!': goto yystate3 case c == '"': goto yystate5 case c == '#': goto yystate16 case c == '%': goto yystate20 case c == '&': goto yystate27 case c == '*': goto yystate42 case c == '+': goto yystate44 case c == '-': goto yystate47 case c == '.': goto yystate51 case c == '/': goto yystate72 case c == '0': goto yystate76 case c == ':': goto yystate93 case c == '<': goto yystate95 case c == '=': goto yystate101 case c == '>': goto yystate103 case c == 'L': goto yystate117 case c == '\'': goto yystate30 case c == '\\': goto yystate108 case c == '\t' || c == '\v' || c == '\f' || c == ' ': goto yystate2 case c == '\u0080': goto yystate146 case c == '^': goto yystate141 case c == '|': goto yystate143 case c >= '1' && c <= '9': goto yystate92 case c >= 'A' && c <= 'K' || c >= 'M' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0084': goto yystate107 } yystate2: c = l.Next() yyrule = 1 l.Mark() switch { default: goto yyrule1 case c == '\t' || c == '\v' || c == '\f' || c == ' ': goto yystate2 } yystate3: c = l.Next() switch { default: goto yyabort case c == '=': goto yystate4 } yystate4: c = l.Next() yyrule = 7 l.Mark() goto yyrule7 yystate5: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate6 case c == '\\': goto yystate7 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate5 } yystate6: c = l.Next() yyrule = 60 l.Mark() goto yyrule60 yystate7: c = l.Next() switch { default: goto yyabort case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v': goto yystate5 case c == 'U': goto yystate8 case c == 'u': goto yystate12 case c == 'x': goto yystate15 } yystate8: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate9 } yystate9: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate10 } yystate10: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate11 } yystate11: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate12 } yystate12: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate13 } yystate13: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate14 } yystate14: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate15 } yystate15: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate5 } yystate16: c = l.Next() switch { default: goto yyabort case c == '#': goto yystate17 case c == '%': goto yystate18 } yystate17: c = l.Next() yyrule = 34 l.Mark() goto yyrule34 yystate18: c = l.Next() switch { default: goto yyabort case c == ':': goto yystate19 } yystate19: c = l.Next() yyrule = 35 l.Mark() goto yyrule35 yystate20: c = l.Next() switch { default: goto yyabort case c == ':': goto yystate21 case c == '=': goto yystate25 case c == '>': goto yystate26 } yystate21: c = l.Next() yyrule = 8 l.Mark() switch { default: goto yyrule8 case c == '#': goto yystate22 case c == '%': goto yystate23 } yystate22: c = l.Next() yyrule = 36 l.Mark() goto yyrule36 yystate23: c = l.Next() switch { default: goto yyabort case c == ':': goto yystate24 } yystate24: c = l.Next() yyrule = 37 l.Mark() goto yyrule37 yystate25: c = l.Next() yyrule = 9 l.Mark() goto yyrule9 yystate26: c = l.Next() yyrule = 10 l.Mark() goto yyrule10 yystate27: c = l.Next() switch { default: goto yyabort case c == '&': goto yystate28 case c == '=': goto yystate29 } yystate28: c = l.Next() yyrule = 11 l.Mark() goto yyrule11 yystate29: c = l.Next() yyrule = 12 l.Mark() goto yyrule12 yystate30: c = l.Next() switch { default: goto yyabort case c == '\\': goto yystate33 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '&' || c >= '(' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate31 } yystate31: c = l.Next() switch { default: goto yyabort case c == '\'': goto yystate32 case c == '\\': goto yystate33 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '&' || c >= '(' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate31 } yystate32: c = l.Next() yyrule = 54 l.Mark() goto yyrule54 yystate33: c = l.Next() switch { default: goto yyabort case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v': goto yystate31 case c == 'U': goto yystate34 case c == 'u': goto yystate38 case c == 'x': goto yystate41 } yystate34: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate35 } yystate35: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate36 } yystate36: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate37 } yystate37: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate38 } yystate38: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate39 } yystate39: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate40 } yystate40: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate41 } yystate41: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate31 } yystate42: c = l.Next() switch { default: goto yyabort case c == '=': goto yystate43 } yystate43: c = l.Next() yyrule = 13 l.Mark() goto yyrule13 yystate44: c = l.Next() switch { default: goto yyabort case c == '+': goto yystate45 case c == '=': goto yystate46 } yystate45: c = l.Next() yyrule = 14 l.Mark() goto yyrule14 yystate46: c = l.Next() yyrule = 15 l.Mark() goto yyrule15 yystate47: c = l.Next() switch { default: goto yyabort case c == '-': goto yystate48 case c == '=': goto yystate49 case c == '>': goto yystate50 } yystate48: c = l.Next() yyrule = 16 l.Mark() goto yyrule16 yystate49: c = l.Next() yyrule = 17 l.Mark() goto yyrule17 yystate50: c = l.Next() yyrule = 18 l.Mark() goto yyrule18 yystate51: c = l.Next() switch { default: goto yyabort case c == '.': goto yystate52 case c >= '0' && c <= '9': goto yystate54 } yystate52: c = l.Next() switch { default: goto yyabort case c == '.': goto yystate53 } yystate53: c = l.Next() yyrule = 19 l.Mark() goto yyrule19 yystate54: c = l.Next() yyrule = 58 l.Mark() switch { default: goto yyrule58 case c == '.' || c >= 'A' && c <= 'D' || c >= 'G' && c <= 'K' || c >= 'M' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c == 'g' || c == 'h' || c == 'j' || c == 'k' || c >= 'm' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'e': goto yystate66 case c == 'F' || c == 'L' || c == 'f' || c == 'l': goto yystate69 case c == 'P' || c == 'p': goto yystate56 case c == '\\': goto yystate57 case c == 'i': goto yystate71 case c >= '0' && c <= '9': goto yystate54 } yystate55: c = l.Next() yyrule = 59 l.Mark() switch { default: goto yyrule59 case c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == '\\': goto yystate57 } yystate56: c = l.Next() yyrule = 59 l.Mark() switch { default: goto yyrule59 case c == '+' || c == '-' || c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == '\\': goto yystate57 } yystate57: c = l.Next() switch { default: goto yyabort case c == 'U': goto yystate58 case c == 'u': goto yystate62 } yystate58: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate59 } yystate59: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate60 } yystate60: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate61 } yystate61: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate62 } yystate62: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate63 } yystate63: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate64 } yystate64: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate65 } yystate65: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate55 } yystate66: c = l.Next() yyrule = 59 l.Mark() switch { default: goto yyrule59 case c == '+' || c == '-': goto yystate67 case c == '.' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == '\\': goto yystate57 case c >= '0' && c <= '9': goto yystate68 } yystate67: c = l.Next() yyrule = 59 l.Mark() switch { default: goto yyrule59 case c == '.' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == '\\': goto yystate57 case c >= '0' && c <= '9': goto yystate68 } yystate68: c = l.Next() yyrule = 58 l.Mark() switch { default: goto yyrule58 case c == '.' || c >= 'A' && c <= 'D' || c >= 'G' && c <= 'K' || c >= 'M' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c == 'g' || c == 'h' || c == 'j' || c == 'k' || c >= 'm' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == 'F' || c == 'L' || c == 'f' || c == 'l': goto yystate69 case c == '\\': goto yystate57 case c == 'i': goto yystate71 case c >= '0' && c <= '9': goto yystate68 } yystate69: c = l.Next() yyrule = 58 l.Mark() switch { default: goto yyrule58 case c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'h' || c >= 'j' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == '\\': goto yystate57 case c == 'i': goto yystate70 } yystate70: c = l.Next() yyrule = 58 l.Mark() switch { default: goto yyrule58 case c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == '\\': goto yystate57 } yystate71: c = l.Next() yyrule = 58 l.Mark() switch { default: goto yyrule58 case c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'G' && c <= 'K' || c >= 'M' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'g' && c <= 'k' || c >= 'm' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == 'F' || c == 'L' || c == 'f' || c == 'l': goto yystate70 case c == '\\': goto yystate57 } yystate72: c = l.Next() switch { default: goto yyabort case c == '*': goto yystate73 case c == '/': goto yystate74 case c == '=': goto yystate75 } yystate73: c = l.Next() yyrule = 3 l.Mark() goto yyrule3 yystate74: c = l.Next() yyrule = 2 l.Mark() switch { default: goto yyrule2 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate74 } yystate75: c = l.Next() yyrule = 20 l.Mark() goto yyrule20 yystate76: c = l.Next() yyrule = 57 l.Mark() switch { default: goto yyrule57 case c == '.': goto yystate54 case c == '8' || c == '9': goto yystate78 case c == 'E' || c == 'e': goto yystate66 case c == 'L': goto yystate79 case c == 'P' || c == 'p': goto yystate56 case c == 'U' || c == 'u': goto yystate82 case c == 'X' || c == 'x': goto yystate86 case c == '\\': goto yystate57 case c == 'l': goto yystate85 case c >= '0' && c <= '7': goto yystate77 case c >= 'A' && c <= 'D' || c >= 'F' && c <= 'K' || c >= 'M' && c <= 'O' || c >= 'Q' && c <= 'T' || c == 'V' || c == 'W' || c == 'Y' || c == 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'k' || c >= 'm' && c <= 'o' || c >= 'q' && c <= 't' || c == 'v' || c == 'w' || c == 'y' || c == 'z' || c == '\u0084': goto yystate55 } yystate77: c = l.Next() yyrule = 57 l.Mark() switch { default: goto yyrule57 case c == '.': goto yystate54 case c == '8' || c == '9': goto yystate78 case c == 'E' || c == 'e': goto yystate66 case c == 'L': goto yystate79 case c == 'P' || c == 'p': goto yystate56 case c == 'U' || c == 'u': goto yystate82 case c == '\\': goto yystate57 case c == 'l': goto yystate85 case c >= '0' && c <= '7': goto yystate77 case c >= 'A' && c <= 'D' || c >= 'F' && c <= 'K' || c >= 'M' && c <= 'O' || c >= 'Q' && c <= 'T' || c >= 'V' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'k' || c >= 'm' && c <= 'o' || c >= 'q' && c <= 't' || c >= 'v' && c <= 'z' || c == '\u0084': goto yystate55 } yystate78: c = l.Next() yyrule = 59 l.Mark() switch { default: goto yyrule59 case c == '.': goto yystate54 case c == 'E' || c == 'e': goto yystate66 case c == 'P' || c == 'p': goto yystate56 case c == '\\': goto yystate57 case c >= '0' && c <= '9': goto yystate78 case c >= 'A' && c <= 'D' || c >= 'F' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 } yystate79: c = l.Next() yyrule = 57 l.Mark() switch { default: goto yyrule57 case c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'K' || c >= 'M' && c <= 'O' || c >= 'Q' && c <= 'T' || c >= 'V' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'o' || c >= 'q' && c <= 't' || c >= 'v' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == 'L': goto yystate80 case c == 'U' || c == 'u': goto yystate81 case c == '\\': goto yystate57 } yystate80: c = l.Next() yyrule = 57 l.Mark() switch { default: goto yyrule57 case c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'O' || c >= 'Q' && c <= 'T' || c >= 'V' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'o' || c >= 'q' && c <= 't' || c >= 'v' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == 'U' || c == 'u': goto yystate81 case c == '\\': goto yystate57 } yystate81: c = l.Next() yyrule = 57 l.Mark() switch { default: goto yyrule57 case c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == '\\': goto yystate57 } yystate82: c = l.Next() yyrule = 57 l.Mark() switch { default: goto yyrule57 case c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'K' || c >= 'M' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'k' || c >= 'm' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == 'L': goto yystate83 case c == '\\': goto yystate57 case c == 'l': goto yystate84 } yystate83: c = l.Next() yyrule = 57 l.Mark() switch { default: goto yyrule57 case c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'K' || c >= 'M' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == 'L': goto yystate81 case c == '\\': goto yystate57 } yystate84: c = l.Next() yyrule = 57 l.Mark() switch { default: goto yyrule57 case c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'k' || c >= 'm' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == '\\': goto yystate57 case c == 'l': goto yystate81 } yystate85: c = l.Next() yyrule = 57 l.Mark() switch { default: goto yyrule57 case c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'O' || c >= 'Q' && c <= 'T' || c >= 'V' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'k' || c >= 'm' && c <= 'o' || c >= 'q' && c <= 't' || c >= 'v' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate56 case c == 'U' || c == 'u': goto yystate81 case c == '\\': goto yystate57 case c == 'l': goto yystate80 } yystate86: c = l.Next() yyrule = 59 l.Mark() switch { default: goto yyrule59 case c == '.': goto yystate87 case c == 'E' || c == 'e': goto yystate91 case c == 'P' || c == 'p': goto yystate56 case c == '\\': goto yystate57 case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c == 'F' || c >= 'a' && c <= 'd' || c == 'f': goto yystate90 case c >= 'G' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'g' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 } yystate87: c = l.Next() yyrule = 59 l.Mark() switch { default: goto yyrule59 case c == '.' || c >= 'G' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'g' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'e': goto yystate89 case c == 'P' || c == 'p': goto yystate56 case c == '\\': goto yystate57 case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c == 'F' || c >= 'a' && c <= 'd' || c == 'f': goto yystate88 } yystate88: c = l.Next() yyrule = 59 l.Mark() switch { default: goto yyrule59 case c == '.' || c >= 'G' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'g' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'e': goto yystate89 case c == 'P' || c == 'p': goto yystate66 case c == '\\': goto yystate57 case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c == 'F' || c >= 'a' && c <= 'd' || c == 'f': goto yystate88 } yystate89: c = l.Next() yyrule = 59 l.Mark() switch { default: goto yyrule59 case c == '+' || c == '-' || c == '.' || c >= 'G' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'g' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate55 case c == 'E' || c == 'e': goto yystate89 case c == 'P' || c == 'p': goto yystate66 case c == '\\': goto yystate57 case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c == 'F' || c >= 'a' && c <= 'd' || c == 'f': goto yystate88 } yystate90: c = l.Next() yyrule = 57 l.Mark() switch { default: goto yyrule57 case c == '.': goto yystate88 case c == 'E' || c == 'e': goto yystate91 case c == 'L': goto yystate79 case c == 'P' || c == 'p': goto yystate66 case c == 'U' || c == 'u': goto yystate82 case c == '\\': goto yystate57 case c == 'l': goto yystate85 case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c == 'F' || c >= 'a' && c <= 'd' || c == 'f': goto yystate90 case c >= 'G' && c <= 'K' || c >= 'M' && c <= 'O' || c >= 'Q' && c <= 'T' || c >= 'V' && c <= 'Z' || c == '_' || c >= 'g' && c <= 'k' || c >= 'm' && c <= 'o' || c >= 'q' && c <= 't' || c >= 'v' && c <= 'z' || c == '\u0084': goto yystate55 } yystate91: c = l.Next() yyrule = 57 l.Mark() switch { default: goto yyrule57 case c == '+' || c == '-' || c >= 'G' && c <= 'K' || c >= 'M' && c <= 'O' || c >= 'Q' && c <= 'T' || c >= 'V' && c <= 'Z' || c == '_' || c >= 'g' && c <= 'k' || c >= 'm' && c <= 'o' || c >= 'q' && c <= 't' || c >= 'v' && c <= 'z' || c == '\u0084': goto yystate55 case c == '.': goto yystate88 case c == 'E' || c == 'e': goto yystate91 case c == 'L': goto yystate79 case c == 'P' || c == 'p': goto yystate66 case c == 'U' || c == 'u': goto yystate82 case c == '\\': goto yystate57 case c == 'l': goto yystate85 case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c == 'F' || c >= 'a' && c <= 'd' || c == 'f': goto yystate90 } yystate92: c = l.Next() yyrule = 57 l.Mark() switch { default: goto yyrule57 case c == '.': goto yystate54 case c == 'E' || c == 'e': goto yystate66 case c == 'L': goto yystate79 case c == 'P' || c == 'p': goto yystate56 case c == 'U' || c == 'u': goto yystate82 case c == '\\': goto yystate57 case c == 'l': goto yystate85 case c >= '0' && c <= '9': goto yystate92 case c >= 'A' && c <= 'D' || c >= 'F' && c <= 'K' || c >= 'M' && c <= 'O' || c >= 'Q' && c <= 'T' || c >= 'V' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'k' || c >= 'm' && c <= 'o' || c >= 'q' && c <= 't' || c >= 'v' && c <= 'z' || c == '\u0084': goto yystate55 } yystate93: c = l.Next() switch { default: goto yyabort case c == '>': goto yystate94 } yystate94: c = l.Next() yyrule = 21 l.Mark() goto yyrule21 yystate95: c = l.Next() switch { default: goto yyabort case c == '%': goto yystate96 case c == ':': goto yystate97 case c == '<': goto yystate98 case c == '=': goto yystate100 } yystate96: c = l.Next() yyrule = 22 l.Mark() goto yyrule22 yystate97: c = l.Next() yyrule = 23 l.Mark() goto yyrule23 yystate98: c = l.Next() yyrule = 24 l.Mark() switch { default: goto yyrule24 case c == '=': goto yystate99 } yystate99: c = l.Next() yyrule = 25 l.Mark() goto yyrule25 yystate100: c = l.Next() yyrule = 26 l.Mark() goto yyrule26 yystate101: c = l.Next() switch { default: goto yyabort case c == '=': goto yystate102 } yystate102: c = l.Next() yyrule = 27 l.Mark() goto yyrule27 yystate103: c = l.Next() switch { default: goto yyabort case c == '=': goto yystate104 case c == '>': goto yystate105 } yystate104: c = l.Next() yyrule = 28 l.Mark() goto yyrule28 yystate105: c = l.Next() yyrule = 29 l.Mark() switch { default: goto yyrule29 case c == '=': goto yystate106 } yystate106: c = l.Next() yyrule = 30 l.Mark() goto yyrule30 yystate107: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 } yystate108: c = l.Next() switch { default: goto yyabort case c == 'U': goto yystate109 case c == 'u': goto yystate113 } yystate109: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate110 } yystate110: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate111 } yystate111: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate112 } yystate112: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate113 } yystate113: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate114 } yystate114: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate115 } yystate115: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate116 } yystate116: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate107 } yystate117: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '"': goto yystate118 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\'': goto yystate129 case c == '\\': goto yystate108 } yystate118: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate119 case c == '\\': goto yystate120 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate118 } yystate119: c = l.Next() yyrule = 53 l.Mark() goto yyrule53 yystate120: c = l.Next() switch { default: goto yyabort case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v': goto yystate118 case c == 'U': goto yystate121 case c == 'u': goto yystate125 case c == 'x': goto yystate128 } yystate121: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate122 } yystate122: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate123 } yystate123: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate124 } yystate124: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate125 } yystate125: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate126 } yystate126: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate127 } yystate127: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate128 } yystate128: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate118 } yystate129: c = l.Next() switch { default: goto yyabort case c == '\\': goto yystate132 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '&' || c >= '(' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate130 } yystate130: c = l.Next() switch { default: goto yyabort case c == '\'': goto yystate131 case c == '\\': goto yystate132 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '&' || c >= '(' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate130 } yystate131: c = l.Next() yyrule = 52 l.Mark() goto yyrule52 yystate132: c = l.Next() switch { default: goto yyabort case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v': goto yystate130 case c == 'U': goto yystate133 case c == 'u': goto yystate137 case c == 'x': goto yystate140 } yystate133: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate134 } yystate134: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate135 } yystate135: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate136 } yystate136: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate137 } yystate137: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate138 } yystate138: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate139 } yystate139: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate140 } yystate140: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate130 } yystate141: c = l.Next() switch { default: goto yyabort case c == '=': goto yystate142 } yystate142: c = l.Next() yyrule = 31 l.Mark() goto yyrule31 yystate143: c = l.Next() switch { default: goto yyabort case c == '=': goto yystate144 case c == '|': goto yystate145 } yystate144: c = l.Next() yyrule = 32 l.Mark() goto yyrule32 yystate145: c = l.Next() yyrule = 33 l.Mark() goto yyrule33 yystate146: c = l.Next() yyrule = 6 l.Mark() goto yyrule6 goto yystate147 // silence unused label error yystate147: c = l.Next() yystart147: switch { default: goto yyabort case c == '*': goto yystate149 case c == '\u0080': goto yystate151 case c >= '\x01' && c <= ')' || c >= '+' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate148 } yystate148: c = l.Next() switch { default: goto yyabort case c == '*': goto yystate149 case c >= '\x01' && c <= ')' || c >= '+' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate148 } yystate149: c = l.Next() switch { default: goto yyabort case c == '*': goto yystate149 case c == '/': goto yystate150 case c >= '\x01' && c <= ')' || c >= '+' && c <= '.' || c >= '0' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate148 } yystate150: c = l.Next() yyrule = 4 l.Mark() goto yyrule4 yystate151: c = l.Next() yyrule = 5 l.Mark() goto yyrule5 goto yystate152 // silence unused label error yystate152: c = l.Next() yystart152: switch { default: goto yyabort case c == '!': goto yystate3 case c == '"': goto yystate5 case c == '#': goto yystate16 case c == '%': goto yystate20 case c == '&': goto yystate27 case c == '*': goto yystate42 case c == '+': goto yystate44 case c == '-': goto yystate47 case c == '.': goto yystate51 case c == '/': goto yystate72 case c == '0': goto yystate76 case c == ':': goto yystate93 case c == '<': goto yystate95 case c == '=': goto yystate101 case c == '>': goto yystate103 case c == 'L': goto yystate164 case c == '\'': goto yystate30 case c == '\\': goto yystate155 case c == '\t' || c == '\v' || c == '\f' || c == ' ': goto yystate2 case c == '\u0080': goto yystate146 case c == '^': goto yystate141 case c == '|': goto yystate143 case c >= '1' && c <= '9': goto yystate92 case c >= 'A' && c <= 'K' || c >= 'M' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0084': goto yystate153 } yystate153: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate153 case c == '(': goto yystate154 case c == '\\': goto yystate155 } yystate154: c = l.Next() yyrule = 56 l.Mark() goto yyrule56 yystate155: c = l.Next() switch { default: goto yyabort case c == 'U': goto yystate156 case c == 'u': goto yystate160 } yystate156: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate157 } yystate157: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate158 } yystate158: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate159 } yystate159: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate160 } yystate160: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate161 } yystate161: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate162 } yystate162: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate163 } yystate163: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate153 } yystate164: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '"': goto yystate118 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate153 case c == '(': goto yystate154 case c == '\'': goto yystate129 case c == '\\': goto yystate155 } goto yystate165 // silence unused label error yystate165: c = l.Next() yystart165: switch { default: goto yyabort case c == '!': goto yystate3 case c == '"': goto yystate5 case c == '#': goto yystate16 case c == '%': goto yystate20 case c == '&': goto yystate27 case c == '*': goto yystate42 case c == '+': goto yystate44 case c == '-': goto yystate47 case c == '.': goto yystate51 case c == '/': goto yystate72 case c == '0': goto yystate76 case c == ':': goto yystate93 case c == '<': goto yystate95 case c == '=': goto yystate101 case c == '>': goto yystate103 case c == 'L': goto yystate117 case c == '\'': goto yystate30 case c == '\\': goto yystate108 case c == '\t' || c == '\v' || c == '\f' || c == ' ': goto yystate2 case c == '\u0080': goto yystate146 case c == '^': goto yystate141 case c == 'd': goto yystate166 case c == 'e': goto yystate172 case c == 'i': goto yystate186 case c == 'l': goto yystate206 case c == 'p': goto yystate210 case c == 'u': goto yystate216 case c == '|': goto yystate143 case c >= '1' && c <= '9': goto yystate92 case c >= 'A' && c <= 'K' || c >= 'M' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'c' || c >= 'f' && c <= 'h' || c == 'j' || c == 'k' || c >= 'm' && c <= 'o' || c >= 'q' && c <= 't' || c >= 'v' && c <= 'z' || c == '\u0084': goto yystate107 } yystate166: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'e': goto yystate167 } yystate167: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'e' || c >= 'g' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'f': goto yystate168 } yystate168: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'i': goto yystate169 } yystate169: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'm' || c >= 'o' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'n': goto yystate170 } yystate170: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'e': goto yystate171 } yystate171: c = l.Next() yyrule = 38 l.Mark() switch { default: goto yyrule38 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 } yystate172: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'k' || c == 'm' || c >= 'o' && c <= 'q' || c >= 's' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'l': goto yystate173 case c == 'n': goto yystate178 case c == 'r': goto yystate182 } yystate173: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 'r' || c >= 't' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'i': goto yystate174 case c == 's': goto yystate176 } yystate174: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'e' || c >= 'g' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'f': goto yystate175 } yystate175: c = l.Next() yyrule = 39 l.Mark() switch { default: goto yyrule39 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 } yystate176: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'e': goto yystate177 } yystate177: c = l.Next() yyrule = 40 l.Mark() switch { default: goto yyrule40 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 } yystate178: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'c' || c >= 'e' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'd': goto yystate179 } yystate179: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'i': goto yystate180 } yystate180: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'e' || c >= 'g' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'f': goto yystate181 } yystate181: c = l.Next() yyrule = 41 l.Mark() switch { default: goto yyrule41 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 } yystate182: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'q' || c >= 's' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'r': goto yystate183 } yystate183: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'n' || c >= 'p' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'o': goto yystate184 } yystate184: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'q' || c >= 's' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'r': goto yystate185 } yystate185: c = l.Next() yyrule = 42 l.Mark() switch { default: goto yyrule42 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 } yystate186: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'e' || c >= 'g' && c <= 'm' || c >= 'o' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'f': goto yystate187 case c == 'n': goto yystate195 } yystate187: c = l.Next() yyrule = 43 l.Mark() switch { default: goto yyrule43 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'c' || c >= 'e' && c <= 'm' || c >= 'o' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'd': goto yystate188 case c == 'n': goto yystate191 } yystate188: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'e': goto yystate189 } yystate189: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'e' || c >= 'g' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'f': goto yystate190 } yystate190: c = l.Next() yyrule = 44 l.Mark() switch { default: goto yyrule44 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 } yystate191: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'c' || c >= 'e' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'd': goto yystate192 } yystate192: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'e': goto yystate193 } yystate193: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'e' || c >= 'g' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'f': goto yystate194 } yystate194: c = l.Next() yyrule = 45 l.Mark() switch { default: goto yyrule45 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 } yystate195: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c == 'a' || c == 'b' || c >= 'd' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'c': goto yystate196 } yystate196: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'k' || c >= 'm' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'l': goto yystate197 } yystate197: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 't' || c >= 'v' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'u': goto yystate198 } yystate198: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'c' || c >= 'e' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'd': goto yystate199 } yystate199: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'e': goto yystate200 } yystate200: c = l.Next() yyrule = 46 l.Mark() switch { default: goto yyrule46 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == '_': goto yystate201 } yystate201: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'm' || c >= 'o' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'n': goto yystate202 } yystate202: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'e': goto yystate203 } yystate203: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'w' || c == 'y' || c == 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'x': goto yystate204 } yystate204: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 's' || c >= 'u' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 't': goto yystate205 } yystate205: c = l.Next() yyrule = 47 l.Mark() switch { default: goto yyrule47 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 } yystate206: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'i': goto yystate207 } yystate207: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'm' || c >= 'o' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'n': goto yystate208 } yystate208: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'e': goto yystate209 } yystate209: c = l.Next() yyrule = 48 l.Mark() switch { default: goto yyrule48 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 } yystate210: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'q' || c >= 's' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'r': goto yystate211 } yystate211: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'b' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'a': goto yystate212 } yystate212: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'f' || c >= 'h' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'g': goto yystate213 } yystate213: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'l' || c >= 'n' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'm': goto yystate214 } yystate214: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'b' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'a': goto yystate215 } yystate215: c = l.Next() yyrule = 49 l.Mark() switch { default: goto yyrule49 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 } yystate216: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'm' || c >= 'o' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'n': goto yystate217 } yystate217: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'c' || c >= 'e' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'd': goto yystate218 } yystate218: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'e': goto yystate219 } yystate219: c = l.Next() yyrule = 55 l.Mark() switch { default: goto yyrule55 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'e' || c >= 'g' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 case c == 'f': goto yystate220 } yystate220: c = l.Next() yyrule = 50 l.Mark() switch { default: goto yyrule50 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate107 case c == '\\': goto yystate108 } goto yystate221 // silence unused label error yystate221: c = l.Next() yystart221: switch { default: goto yyabort case c == '!': goto yystate3 case c == '"': goto yystate222 case c == '#': goto yystate16 case c == '%': goto yystate20 case c == '&': goto yystate27 case c == '*': goto yystate42 case c == '+': goto yystate44 case c == '-': goto yystate47 case c == '.': goto yystate51 case c == '/': goto yystate72 case c == '0': goto yystate76 case c == ':': goto yystate93 case c == '<': goto yystate237 case c == '=': goto yystate101 case c == '>': goto yystate103 case c == 'L': goto yystate117 case c == '\'': goto yystate30 case c == '\\': goto yystate108 case c == '\t' || c == '\v' || c == '\f' || c == ' ': goto yystate2 case c == '\u0080': goto yystate146 case c == '^': goto yystate141 case c == '|': goto yystate143 case c >= '1' && c <= '9': goto yystate92 case c >= 'A' && c <= 'K' || c >= 'M' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0084': goto yystate107 } yystate222: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate6 case c == '\\': goto yystate225 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate223 } yystate223: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate224 case c == '\\': goto yystate225 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate223 } yystate224: c = l.Next() yyrule = 51 l.Mark() goto yyrule51 yystate225: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate228 case c == 'U': goto yystate229 case c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v': goto yystate223 case c == 'u': goto yystate233 case c == 'x': goto yystate236 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '&' || c >= '(' && c <= '/' || c >= '8' && c <= '>' || c >= '@' && c <= 'T' || c >= 'V' && c <= '[' || c >= ']' && c <= '`' || c >= 'c' && c <= 'e' || c >= 'g' && c <= 'm' || c >= 'o' && c <= 'q' || c == 's' || c == 'w' || c >= 'y' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate226 } yystate226: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate227 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate226 } yystate227: c = l.Next() yyrule = 51 l.Mark() goto yyrule51 yystate228: c = l.Next() yyrule = 51 l.Mark() switch { default: goto yyrule51 case c == '"': goto yystate6 case c == '\\': goto yystate7 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate5 } yystate229: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate227 case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate230 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '/' || c >= ':' && c <= '@' || c >= 'G' && c <= '`' || c >= 'g' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate226 } yystate230: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate227 case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate231 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '/' || c >= ':' && c <= '@' || c >= 'G' && c <= '`' || c >= 'g' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate226 } yystate231: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate227 case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate232 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '/' || c >= ':' && c <= '@' || c >= 'G' && c <= '`' || c >= 'g' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate226 } yystate232: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate227 case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate233 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '/' || c >= ':' && c <= '@' || c >= 'G' && c <= '`' || c >= 'g' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate226 } yystate233: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate227 case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate234 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '/' || c >= ':' && c <= '@' || c >= 'G' && c <= '`' || c >= 'g' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate226 } yystate234: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate227 case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate235 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '/' || c >= ':' && c <= '@' || c >= 'G' && c <= '`' || c >= 'g' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate226 } yystate235: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate227 case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate236 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '/' || c >= ':' && c <= '@' || c >= 'G' && c <= '`' || c >= 'g' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate226 } yystate236: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate227 case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate223 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '/' || c >= ':' && c <= '@' || c >= 'G' && c <= '`' || c >= 'g' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate226 } yystate237: c = l.Next() switch { default: goto yyabort case c == '%': goto yystate239 case c == ':': goto yystate240 case c == '<': goto yystate241 case c == '=': goto yystate243 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '$' || c >= '&' && c <= '9' || c == ';' || c >= '?' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate238 } yystate238: c = l.Next() switch { default: goto yyabort case c == '>': goto yystate227 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '=' || c >= '?' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate238 } yystate239: c = l.Next() yyrule = 22 l.Mark() switch { default: goto yyrule22 case c == '>': goto yystate227 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '=' || c >= '?' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate238 } yystate240: c = l.Next() yyrule = 23 l.Mark() switch { default: goto yyrule23 case c == '>': goto yystate227 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '=' || c >= '?' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate238 } yystate241: c = l.Next() yyrule = 24 l.Mark() switch { default: goto yyrule24 case c == '=': goto yystate242 case c == '>': goto yystate227 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '<' || c >= '?' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate238 } yystate242: c = l.Next() yyrule = 25 l.Mark() switch { default: goto yyrule25 case c == '>': goto yystate227 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '=' || c >= '?' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate238 } yystate243: c = l.Next() yyrule = 26 l.Mark() switch { default: goto yyrule26 case c == '>': goto yystate227 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '=' || c >= '?' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate238 } yyrule1: // [ \t\f\v]+ { return ' ' } yyrule2: // "//"[^\x80\n]* { l.comment(false) return ' ' } yyrule3: // "/*" { l.commentPos0 = l.First.Pos() l.push(scCOMMENT) goto yystate0 } yyrule4: // {comment-close} { l.pop() l.First = lex.NewChar(l.commentPos0, l.First.Rune) l.comment(true) return ' ' } yyrule5: // {eof} { l.report.Err(l.commentPos0, commentNotClosed) l.pop() return rune2class(lex.RuneEOF) } yyrule6: // {eof} { return rune2class(lex.RuneEOF) } yyrule7: // "!=" { return NEQ } yyrule8: // "%:" { return '#' } yyrule9: // "%=" { return MODASSIGN } yyrule10: // "%>" { return '}' } yyrule11: // "&&" { return ANDAND } yyrule12: // "&=" { return ANDASSIGN } yyrule13: // "*=" { return MULASSIGN } yyrule14: // "++" { return INC } yyrule15: // "+=" { return ADDASSIGN } yyrule16: // "--" { return DEC } yyrule17: // "-=" { return SUBASSIGN } yyrule18: // "->" { return ARROW } yyrule19: // "..." { return DDD } yyrule20: // "/=" { return DIVASSIGN } yyrule21: // ":>" { return ']' } yyrule22: // "<%" { return '{' } yyrule23: // "<:" { return '[' } yyrule24: // "<<" { return LSH } yyrule25: // "<<=" { return LSHASSIGN } yyrule26: // "<=" { return LEQ } yyrule27: // "==" { return EQ } yyrule28: // ">=" { return GEQ } yyrule29: // ">>" { return RSH } yyrule30: // ">>=" { return RSHASSIGN } yyrule31: // "^=" { return XORASSIGN } yyrule32: // "|=" { return ORASSIGN } yyrule33: // "||" { return OROR } yyrule34: // "##" yyrule35: // "#%:" yyrule36: // "%:#" yyrule37: // "%:%:" { return PPPASTE } yyrule38: // "define" { l.pop() return PPDEFINE goto yystate0 } yyrule39: // "elif" { l.pop() return PPELIF goto yystate0 } yyrule40: // "else" { l.pop() return PPELSE goto yystate0 } yyrule41: // "endif" { l.pop() return PPENDIF goto yystate0 } yyrule42: // "error" { l.pop() return PPERROR goto yystate0 } yyrule43: // "if" { l.pop() return PPIF goto yystate0 } yyrule44: // "ifdef" { l.pop() return PPIFDEF goto yystate0 } yyrule45: // "ifndef" { l.pop() return PPIFNDEF goto yystate0 } yyrule46: // "include" { l.pop() return PPINCLUDE goto yystate0 } yyrule47: // "include_next" { l.pop() return PPINCLUDE_NEXT goto yystate0 } yyrule48: // "line" { l.pop() return PPLINE goto yystate0 } yyrule49: // "pragma" { l.pop() return PPPRAGMA goto yystate0 } yyrule50: // "undef" { l.pop() return PPUNDEF goto yystate0 } yyrule51: // {header-name} { l.sc = scINITIAL return PPHEADER_NAME } yyrule52: // L{character-constant} { return LONGCHARCONST } yyrule53: // L{string-literal} { return LONGSTRINGLITERAL } yyrule54: // {character-constant} { return CHARCONST } yyrule55: // {identifier} { return IDENTIFIER } yyrule56: // {identifier}"(" { return IDENTIFIER_LPAREN } yyrule57: // {integer-constant} { return INTCONST } yyrule58: // {floating-constant} { return FLOATCONST } yyrule59: // {pp-number} { return PPNUMBER } yyrule60: // {string-literal} { return STRINGLITERAL } panic("unreachable") goto yyabort // silence unused label error yyabort: // no lexem recognized if c, ok := l.Abort(); ok { return c } goto yyAction } ================================================ FILE: scanner.l ================================================ %{ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on [0], 6.4. %} %yyc c %yyn c = l.Next() %yym l.Mark() %yyt l.sc %x COMMENT %s DEFINE DIRECTIVE HEADER %{ package cc import ( "fmt" "github.com/cznic/golex/lex" ) const ( _ = iota scCOMMENT // [`/*`, `*/`] scDEFINE // [^#define, next token] scDIRECTIVE // [^#, next token] scHEADER // [`#include`, next token] ) func (l *lexer) scan() (r int) { c := l.Enter() %} binary-exponent-part [pP]{sign}?{digit-sequence} c-char [^'\n\x80\\]|{escape-sequence} c-char-sequence {c-char}+ character-constant '{c-char-sequence}' comment-close ([^*\x80]|\*+[^*/\x80])*\*+\/ decimal-constant {nonzero-digit}{digit}* decimal-floating-constant ({fractional-constant}{exponent-part}?|{digit-sequence}{exponent-part}){floating-suffix}? digit [0-9] digit-sequence {digit}+ eof \x80 escape-sequence {simple-sequence}|{octal-escape-sequence}|{hexadecimal-escape-sequence}|{universal-character-name} exponent-part [eE]{sign}?{digit-sequence} floating-constant {decimal-floating-constant}|{hexadecimal-floating-constant} floating-suffix i?[flFL]?|[flFL]?i? fractional-constant {digit-sequence}?\.{digit-sequence}|{digit-sequence}\. h-char [^>\n\x80] h-char-sequence {h-char}+ header-name <{h-char-sequence}>|\x22{q-char-sequence}\x22 hex-quad {hexadecimal-digit}{hexadecimal-digit}{hexadecimal-digit}{hexadecimal-digit} hexadecimal-constant {hexadecimal-prefix}{hexadecimal-digit}+ hexadecimal-digit [0-9a-fA-F] hexadecimal-digit-sequence {hexadecimal-digit}+ hexadecimal-escape-sequence \\x{hexadecimal-digit}+ hexadecimal-floating-constant {hexadecimal-prefix}({hexadecimal-fractional-constant}|{hexadecimal-digit-sequence}){binary-exponent-part}{floating-suffix}? hexadecimal-fractional-constant {hexadecimal-digit-sequence}?\.{hexadecimal-digit-sequence}|{hexadecimal-digit-sequence}\. hexadecimal-prefix 0[xX] identifier {identifier-nondigit}({identifier-nondigit}|{digit}|{ucn-digit}|"$")* identifier-nondigit {nondigit}|{universal-character-name}|{ucn-nondigit} integer-constant ({decimal-constant}|{octal-constant}|{hexadecimal-constant}){integer-suffix}? integer-suffix {unsigned-suffix}({long-suffix}?|{long-long-suffix})|{long-suffix}{unsigned-suffix}?|{long-long-suffix}{unsigned-suffix}? long-long-suffix ll|LL long-suffix [lL] nondigit [_a-zA-Z] nonzero-digit [1-9] octal-constant 0{octal-digit}* octal-digit [0-7] octal-escape-sequence \\{octal-digit}{octal-digit}?{octal-digit}? pp-number ({digit}|\.{digit})({digit}|{identifier-nondigit}|[eEpP]{sign}|\.)* q-char [^\n\x22\x80] q-char-sequence {q-char}+ s-char [^\x22\n\x80\\]|{escape-sequence} s-char-sequence {s-char}+ sign [-+] simple-sequence \\['\x22?\\abfnrtv] string-literal \x22{s-char-sequence}?\x22 ucn-digit \x83 ucn-nondigit \x84 universal-character-name \\u{hex-quad}|\\U{hex-quad}{hex-quad} unsigned-suffix [uU] %% c = l.Rule0() [ \t\f\v]+ return ' ' "//"[^\x80\n]* l.comment(false) return ' ' "/*" l.commentPos0 = l.First.Pos() l.push(scCOMMENT) {comment-close} l.pop() l.First = lex.NewChar(l.commentPos0, l.First.Rune) l.comment(true) return ' ' {eof} l.report.Err(l.commentPos0, commentNotClosed) l.pop() return rune2class(lex.RuneEOF) <*>{eof} return rune2class(lex.RuneEOF) "!=" return NEQ "%:" return '#' "%=" return MODASSIGN "%>" return '}' "&&" return ANDAND "&=" return ANDASSIGN "*=" return MULASSIGN "++" return INC "+=" return ADDASSIGN "--" return DEC "-=" return SUBASSIGN "->" return ARROW "..." return DDD "/=" return DIVASSIGN ":>" return ']' "<%" return '{' "<:" return '[' "<<" return LSH "<<=" return LSHASSIGN "<=" return LEQ "==" return EQ ">=" return GEQ ">>" return RSH ">>=" return RSHASSIGN "^=" return XORASSIGN "|=" return ORASSIGN "||" return OROR "##" | "#%:" | "%:#" | "%:%:" return PPPASTE "define" l.pop(); return PPDEFINE "elif" l.pop(); return PPELIF "else" l.pop(); return PPELSE "endif" l.pop(); return PPENDIF "error" l.pop(); return PPERROR "if" l.pop(); return PPIF "ifdef" l.pop(); return PPIFDEF "ifndef" l.pop(); return PPIFNDEF "include" l.pop(); return PPINCLUDE "include_next" l.pop(); return PPINCLUDE_NEXT "line" l.pop(); return PPLINE "pragma" l.pop(); return PPPRAGMA "undef" l.pop(); return PPUNDEF
{header-name} l.sc = scINITIAL return PPHEADER_NAME L{character-constant} return LONGCHARCONST L{string-literal} return LONGSTRINGLITERAL {character-constant} return CHARCONST {identifier} return IDENTIFIER {identifier}"(" return IDENTIFIER_LPAREN {integer-constant} return INTCONST {floating-constant} return FLOATCONST {pp-number} return PPNUMBER {string-literal} return STRINGLITERAL %% if c, ok := l.Abort(); ok { return c } goto yyAction } ================================================ FILE: scope_string.go ================================================ // Code generated by "stringer -type Scope"; DO NOT EDIT. package cc import "fmt" const _Scope_name = "ScopeFileScopeBlockScopeMembersScopeParams" var _Scope_index = [...]uint8{0, 9, 19, 31, 42} func (i Scope) String() string { if i < 0 || i >= Scope(len(_Scope_index)-1) { return fmt.Sprintf("Scope(%d)", i) } return _Scope_name[_Scope_index[i]:_Scope_index[i+1]] } ================================================ FILE: testdata/anon.c ================================================ // Invalid anonymous field should raise an error but not panic. struct { _Bool; }; ================================================ FILE: testdata/arith-1.c ================================================ /* Preprocessor arithmetic semantic tests. */ /* Copyright (C) 2002 Free Software Foundation, Inc. */ /* Source: Neil Booth, 25 May 2002. */ /* The file tests all aspects of preprocessor arithmetic that are independent of target precision. */ /* { dg-do preprocess } */ /* { dg-options "" } */ /* Test || operator and its short circuiting. */ #if 0 || 0 # error /* { dg-bogus "error" } */ #endif #if 5 || 0 #else # error /* { dg-bogus "error" } */ #endif #if 0 || 1 #else # error /* { dg-bogus "error" } */ #endif #if 1 || 4 #else # error /* { dg-bogus "error" } */ #endif #if 1 || (8 / 0) /* { dg-bogus "division by zero" } */ #else # error /* { dg-bogus "error" } */ #endif #if 1 || (1 << 256) /* { dg-bogus "overflow" } */ #endif /* Test && operator and its short circuiting. */ #if (0 && 0) || (0 && 1) || (1 && 0) # error /* { dg-bogus "error" } */ #endif #if 1 && 2 #else # error /* { dg-bogus "error" } */ #endif #if 0 && (8 / 0)/* { dg-bogus "division by zero" } */ # error /* { dg-bogus "error" } */ #endif #if 0 && (1 << 256) /* { dg-bogus "overflow" } */ #endif /* Test == and != operators, and their signedness. */ #if 1 == 0 || 0 == 1 || 20 != 0x014 || 142 != 0216 # error /* { dg-bogus "error" } */ #endif #if (1 == 1) - 2 > 0 || (1U != 1U) - 2 > 0 # error /* { dg-bogus "error" } */ #endif /* Test ? : operator, its short circuiting, and its signedness. */ #if (1 ? 3: 5) != 3 || (0 ? 3: 5) != 5 # error /* { dg-bogus "error" } */ #endif #if 1 ? 0: 1 / 0 /* { dg-bogus "division by zero" } */ # error /* { dg-bogus "error" } */ #endif #if 0 ? 1 / 0: 0 /* { dg-bogus "division by zero" } */ # error /* { dg-bogus "error" } */ #endif #if 0 ? (1 << 256): 0 /* { dg-bogus "overflow" } */ #endif #if 1 ? 0: (1 << 256) /* { dg-bogus "overflow" } */ #endif /* Test unary + and its signedness. */ #if 23 != +23 || 23 != + +23 # error /* { dg-bogus "error" } */ #endif #if (+1 - 2) > 0 || (+1U - 2) < 0 # error /* { dg-bogus "error" } */ #endif /* Test unary - and its signedness. */ #if -1 + 1 != 0 # error /* { dg-bogus "error" } */ #endif #if -1 >= 0 || -1U <= 0 # error /* { dg-bogus "error" } */ #endif /* Test unary ! and its signedness. */ #if !5 != 0 || !1 != 0 || !0 != 1 # error /* { dg-bogus "error" } */ #endif #if !5 - 1 > 0 || !5U - 1 > 0 # error /* { dg-bogus "error" } */ #endif /* Test unary ~ and its signedness. */ #if ~0 != -1 || ~~5 != 5 || ~-2 != 1 # error /* { dg-bogus "error" } */ #endif #if ~5 > 0 || ~5U < 0 # error /* { dg-bogus "error" } */ #endif /* Test comparison operators and their signedness. */ #if 1 >= 1 && 2 >= 1 && -1 >= -1 && -1 >= -2 && 1 >= -1 && 1 >= -2 \ && !(-2 >= -1) && !(2 >= 3) && -1U >= 2 && !(-1 >= 1) #else # error /* { dg-bogus "error" } */ #endif #if ((1 > 0) - 2) > 0 || ((1U > 0) - 2) > 0 # error /* { dg-bogus "error" } */ #endif #if !(1 > 1) && 2 > 1 && !(-1 > -1) && -1 > -2 && 1 > -1 && 1 > -2 \ && !(-2 > -1) && !(2 > 3) && -1U > 2 && !(-1 > 1) #else # error /* { dg-bogus "error" } */ #endif #if ((1 >= 0) - 2) > 0 || ((1U >= 0) - 2) > 0 # error /* { dg-bogus "error" } */ #endif #if 1 <= 1 && !(2 <= 1) && -1 <= -1 && !(-1 <= -2) && !(1 <= -1) && !(1 <= -2) \ && -2 <= -1 && 2 <= 3 && !(-1U <= 2) && -1 <= 1 #else # error /* { dg-bogus "error" } */ #endif #if ((1 <= 0) - 2) > 0 || ((1U <= 0) - 2) > 0 # error /* { dg-bogus "error" } */ #endif #if !(1 < 1) && !(2 < 1) && !(-1 < -1) && !(-1 < -2) && !(1 < -1) && !(1 < -2) \ && -2 < -1 && 2 < 3 && !(-1U < 2) && -1 < 1 #else # error /* { dg-bogus "error" } */ #endif #if ((1 < 0) - 2) > 0 || ((1U < 0) - 2) > 0 # error /* { dg-bogus "error" } */ #endif /* Test bitwise operators and their signedness. */ #if (3 & 7) != 3 || (-1 & 34) != 34 # error /* { dg-bogus "error" } */ #endif #if (3 & 7) - 20 > 0 || (3 & 7U) - 20 < 0 # error /* { dg-bogus "error" } */ #endif #if (3 | 5) != 7 || (-1 | 34) != -1 # error /* { dg-bogus "error" } */ #endif #if (3 | 7) - 20 > 0 || (3 | 7U) - 20 < 0 # error /* { dg-bogus "error" } */ #endif #if (7 ^ 5) != 2 || (-1 ^ 34) != ~34 # error /* { dg-bogus "error" } */ #endif #if (3 ^ 7) - 20 > 0 || (3 ^ 7U) - 20 < 0 # error /* { dg-bogus "error" } */ #endif /* Test shifts and their signedness. */ #if 3 << 2 != 12 || 3 << -2 != 0 || -1 << 1 != -2 # error /* { dg-bogus "error" } */ #endif #if 5 >> 1 != 2 || 5 >> -2 != 20 || -5 >> 1 != -3 # error /* { dg-bogus "error" } */ #endif #if (5 >> 2) - 2 >= 0 || (5U >> 2) - 2 <= 0 # error /* { dg-bogus "error" } */ #endif #if (5 << 1) - 20 >= 0 || (5U << 1) - 20 <= 0 # error /* { dg-bogus "error" } */ #endif #if 0 /* Test min / max and their signedness. */ #if (3 >? 2) != 3 || (-3 >? -2) != -2 # error /* { dg-bogus "error" } */ #endif #if (3 ? 2) - 4 >= 0 || (3 >? 2U) - 4 <= 0 # error /* { dg-bogus "error" } */ #endif #if (3 = 0 || (3 = 0 || 3 * 2U - 7 < 0 # error /* { dg-bogus "error" } */ #endif #if 5 / 2 != 2 || -325 / 50 != -6 || 53 / -4 != -13 || -55 / -12 != 4 # error /* { dg-bogus "error" } */ #endif #if 3 / 2 - 7 >= 0 || 3 / 2U - 7 < 0 # error /* { dg-bogus "error" } */ #endif #if 5 % 2 != 1 || -325 % 50 != -25 || 53 % -4 != 1 || -55 % -12 != -7 # error /* { dg-bogus "error" } */ #endif #if 3 % 2 - 7 >= 0 || 3U % 2 - 7 < 0 # error /* { dg-bogus "error" } */ #endif /* Test , and its signedness. */ #if (1, 2) != 2 || (2, 1) != 1 # error /* { dg-bogus "error" } */ #endif #if (1, 2) - 3 >= 0 || (1, 2U) - 3 <= 0 || (1U, 2) - 3 >= 0 # error /* { dg-bogus "error" } */ #endif ================================================ FILE: testdata/arith-1.h ================================================ #include "arith-1.c" int i; ================================================ FILE: testdata/array.c ================================================ char a[]; void f() { a; } char a[] = "foo"; ================================================ FILE: testdata/empty.c ================================================ #define m(x) #x #define n(x, y) #x #define o(x, y) #y #define p(x, y, z) #y char s[] = m(); char t[] = n(, 42); char u[] = o(42,); char v[] = p(42,,314); ================================================ FILE: testdata/enum.c ================================================ #define K 278 enum { c = 42 - 24, d = 314 + K, } foo; ================================================ FILE: testdata/example-6.10.3.3-4.h ================================================ #define hash_hash # ## # #define mkstr(a) # a #define in_between(a) mkstr(a) #define join(c, d) in_between(c hash_hash d) char p[] = join(x, y); // equivalent to // char p[] = "x ## y"; ================================================ FILE: testdata/example-6.10.3.5-3.h ================================================ #define x 3 #define f(a) f(x * (a)) #undef x #define x 2 #define g f #define z z[0] #define h g(~ #define m(a) a(w) #define w 0,1 #define t(a) a #define p() int #define q(x) x #define r(x,y) x ## y #define str(x) # x f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); g(x+(3,4)-w) | h 5) & m (f)^m(m); p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,) }; char c[2][6] = { str(hello), str() }; ================================================ FILE: testdata/example-6.10.3.5-4.h ================================================ #define str(s) # s #define xstr(s) str(s) #define debug(s, t) printf("x" # s "= %d, x" # t "= %s", \ x ## s, x ## t) #define INCFILE(n) vers ## n #define glue(a, b) a ## b #define xglue(a, b) glue(a, b) #define HIGHLOW "hello" #define LOW LOW ", world" debug(1, 2); fputs(str(strncmp("abc\0d", "abc", '\4') // this goes away == 0) str(: @\n), s); #include xstr(INCFILE(2).h) glue(HIGH, LOW); xglue(HIGH, LOW) ================================================ FILE: testdata/example-6.10.3.5-5.h ================================================ #define t(x,y,z) x ## y ## z int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), t(10,,), t(,11,), t(,,12), t(,,) }; ================================================ FILE: testdata/example-6.10.3.5-6.h ================================================ #define OBJ_LIKE (1-1) #define OBJ_LIKE /* white space */ (1-1) /* other */ #define FUNC_LIKE(a) ( a ) #define FUNC_LIKE( a ) ( /* note the white space */ a /* other stuff on this line */ ) #define FUNC_LIKE( a ) ( /* note the white space */ \ a /* other stuff on this line */ ) ok ================================================ FILE: testdata/example-6.10.3.5-7.h ================================================ #define debug(...) fprintf(stderr, __VA_ARGS__) #define showlist(...) puts(#__VA_ARGS__) #define report(test, ...) ((test)?puts(#test):\ printf(__VA_ARGS__)) debug("Flag"); debug("X = %d\n", x); showlist(The first, second, and third items.); report(x>y, "x is %d but y is %d", x, y); ================================================ FILE: testdata/func.c ================================================ void f(char *) { f(__func__); } ================================================ FILE: testdata/funcfunc.c ================================================ // Declare f as function (char) returning pointer to function (int) returning long. // // http://cdecl.ridiculousfish.com/?q=long+%28*f%28char%29%29+%28int%29%3B // long (*f(char c))(int i) { char d = c; } ================================================ FILE: testdata/gcc-6.3.0/COPYING ================================================ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ================================================ FILE: testdata/gcc-6.3.0/COPYING.LIB ================================================ GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ================================================ FILE: testdata/gcc-6.3.0/COPYING.RUNTIME ================================================ GCC RUNTIME LIBRARY EXCEPTION Version 3.1, 31 March 2009 Copyright (C) 2009 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This GCC Runtime Library Exception ("Exception") is an additional permission under section 7 of the GNU General Public License, version 3 ("GPLv3"). It applies to a given file (the "Runtime Library") that bears a notice placed by the copyright holder of the file stating that the file is governed by GPLv3 along with this Exception. When you use GCC to compile a program, GCC may combine portions of certain GCC header files and runtime libraries with the compiled program. The purpose of this Exception is to allow compilation of non-GPL (including proprietary) programs to use, in this way, the header files and runtime libraries covered by this Exception. 0. Definitions. A file is an "Independent Module" if it either requires the Runtime Library for execution after a Compilation Process, or makes use of an interface provided by the Runtime Library, but is not otherwise based on the Runtime Library. "GCC" means a version of the GNU Compiler Collection, with or without modifications, governed by version 3 (or a specified later version) of the GNU General Public License (GPL) with the option of using any subsequent versions published by the FSF. "GPL-compatible Software" is software whose conditions of propagation, modification and use would permit combination with GCC in accord with the license of GCC. "Target Code" refers to output from any compiler for a real or virtual target processor architecture, in executable form or suitable for input to an assembler, loader, linker and/or execution phase. Notwithstanding that, Target Code does not include data in any format that is used as a compiler intermediate representation, or used for producing a compiler intermediate representation. The "Compilation Process" transforms code entirely represented in non-intermediate languages designed for human-written code, and/or in Java Virtual Machine byte code, into Target Code. Thus, for example, use of source code generators and preprocessors need not be considered part of the Compilation Process, since the Compilation Process can be understood as starting with the output of the generators or preprocessors. A Compilation Process is "Eligible" if it is done using GCC, alone or with other GPL-compatible software, or if it is done without using any work based on GCC. For example, using non-GPL-compatible Software to optimize any GCC intermediate representations would not qualify as an Eligible Compilation Process. 1. Grant of Additional Permission. You have permission to propagate a work of Target Code formed by combining the Runtime Library with Independent Modules, even if such propagation would otherwise violate the terms of GPLv3, provided that all Target Code was generated by Eligible Compilation Processes. You may then convey such a combination under terms of your choice, consistent with the licensing of the Independent Modules. 2. No Weakening of GCC Copyleft. The availability of this Exception does not imply any general presumption that third-party software is unaffected by the copyleft requirements of the license of GCC. ================================================ FILE: testdata/gcc-6.3.0/COPYING3 ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: testdata/gcc-6.3.0/COPYING3.LIB ================================================ GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. ================================================ FILE: testdata/gcc-6.3.0/README ================================================ This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually. ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compat/strct-layout.c ================================================ typedef struct { char a; int b; char c; short d; double e; char f; } T; #if COMPILER != 1 f (T *x) { x[0].a = 'a'; x[0].b = 47114711; x[0].c = 'c'; x[0].d = 1234; x[0].e = 3.141592897932; x[0].f = '*'; x[1].a = 'A'; x[1].b = 71417141; x[1].c = 'C'; x[1].d = 4321; x[1].e = 2.718281828459; x[1].f = '?'; } #endif #if COMPILER != 2 g (T *x) { if (x[0].a != 'a') abort (); if (x[0].b != 47114711) abort (); if (x[0].c != 'c') abort (); if (x[0].d != 1234) abort (); if (x[0].e != 3.141592897932) abort (); if (x[0].f != '*') abort (); if (x[1].a != 'A') abort (); if (x[1].b != 71417141) abort (); if (x[1].c != 'C') abort (); if (x[1].d != 4321) abort (); if (x[1].e != 2.718281828459) abort (); if (x[1].f != '?') abort (); } #endif #if COMPILER != 2 main () { T x[2]; f (x); g (x); exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compat/struct-align.c ================================================ typedef union { struct {int a; int b;} s; double d; } T; int h (T *); T g (T); #if COMPILER != 1 h (T *x) { if (x->s.a != 0 || x->s.b != 1) abort (); } #endif #if COMPILER != 2 T g (T x) { if (x.s.a != 13 || x.s.b != 47) abort (); x.s.a = 0; x.s.b = 1; h (&x); return x; } #endif #if COMPILER != 1 f () { T x; x.s.a = 13; x.s.b = 47; g (x); if (x.s.a != 13 || x.s.b != 47) abort (); x = g (x); if (x.s.a != 0 || x.s.b != 1) abort (); } #endif #if COMPILER != 2 main () { f (); exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compat/struct-big.c ================================================ typedef struct {int a, b, c, d, e;} T; int h (T *); T g (T); #if COMPILER != 1 h (T *x) { if (x->a != 0 || x->b != 1 || x->c != 2 || x->d != 3 || x->e != 4) abort (); } #endif #if COMPILER != 2 T g (T x) { if (x.a != 13 || x.b != 47 || x.c != 123456 || x.d != -4711 || x.e != -2) abort (); x.a = 0; x.b = 1; x.c = 2; x.d = 3; x.e = 4; h (&x); return x; } #endif #if COMPILER != 1 f () { T x; x.a = 13; x.b = 47; x.c = 123456; x.d = -4711; x.e = -2; g (x); if (x.a != 13 || x.b != 47 || x.c != 123456 || x.d != -4711 || x.e != -2) abort (); x = g (x); if (x.a != 0 || x.b != 1 || x.c != 2 || x.d != 3 || x.e != 4) abort (); } #endif #if COMPILER != 2 main () { f (); exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compat/struct-i.c ================================================ typedef struct {int a;} T; int h (T *); T g (T); #if COMPILER != 1 h (T *x) { if (x->a != 47114711) abort (); } #endif #if COMPILER != 2 T g (T x) { if (x.a != 13) abort (); x.a = 47114711; h (&x); return x; } #endif #if COMPILER != 1 f () { T x; x.a = 13; g (x); if (x.a != 13) abort (); x = g (x); if (x.a != 47114711) abort (); } #endif #if COMPILER != 2 main () { f (); exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compat/struct-ic.c ================================================ typedef struct {int a; char b;} T; int h (T *); T g (T); #if COMPILER != 1 h (T *x) { if (x->a != 0 || x->b != 1) abort (); } #endif #if COMPILER != 2 T g (T x) { if (x.a != 13 || x.b != 47) abort (); x.a = 0; x.b = 1; h (&x); return x; } #endif #if COMPILER != 1 f () { T x; x.a = 13; x.b = 47; g (x); if (x.a != 13 || x.b != 47) abort (); x = g (x); if (x.a != 0 || x.b != 1) abort (); } #endif #if COMPILER != 2 main () { f (); exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compat/struct-ii.c ================================================ typedef struct {int a, b;} T; int h (T *); T g (T); #if COMPILER != 1 h (T *x) { if (x->a != 0 || x->b != 1) abort (); } #endif #if COMPILER != 2 T g (T x) { if (x.a != 13 || x.b != 47) abort (); x.a = 0; x.b = 1; h (&x); return x; } #endif #if COMPILER != 1 f () { T x; x.a = 13; x.b = 47; g (x); if (x.a != 13 || x.b != 47) abort (); x = g (x); if (x.a != 0 || x.b != 1) abort (); } #endif #if COMPILER != 2 main () { f (); exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compat/struct-ret-1.c ================================================ typedef struct { int re; int im; } T; T f (int, int); #if COMPILER != 1 T f (int arg1, int arg2) { T x; x.re = arg1; x.im = arg2; return x; } #endif #if COMPILER != 2 main () { T result; result = f (3, 4); if (result.re != 3 || result.im != 4) abort (); exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000105-1.c ================================================ main(int na, char* argv[]) { int wflg = 0, tflg = 0; int dflg = 0; exit(0); while(1) { switch(argv[1][0]) { help: exit(0); case 'w': case 'W': wflg = 1; break; case 't': case 'T': tflg = 1; break; case 'd': dflg = 1; break; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000105-2.c ================================================ foo () { long long int i = (int) ""; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000120-1.c ================================================ extern char letters[26+1]; char letter; int letter_number; char letters[] = "AbCdefghiJklmNopQrStuVwXyZ"; static void pad_home1 () { letter = letters[letter_number = letters[letter_number + 1] ? letter_number + 1 : 0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000120-2.c ================================================ /* { dg-options "-fgnu89-inline" } */ extern __inline__ int odd(int i) { return i & 0x1; } int foo(int i, int j) { return odd(i + j); } int odd(int i) { return i & 0x1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000127-1.c ================================================ double bar(void), c; int foo(void) { double a, b; int i = bar() + bar(); a = i; i += 1; a += 0.1; i = c + i; return i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000211-1.c ================================================ typedef __SIZE_TYPE__ size_t; typedef unsigned char Bufbyte; typedef int Bytecount; typedef int Charcount; typedef struct lstream Lstream; typedef int Lisp_Object; extern Lisp_Object Qnil; extern inline int TRUE_LIST_P (Lisp_Object object) { return (( object ) == ( Qnil )) ; } struct Lisp_String { Bytecount _size; Bufbyte *_data; }; typedef enum lstream_buffering { LSTREAM_LINE_BUFFERED, } Lstream_buffering; struct lstream { Lstream_buffering buffering; unsigned char *out_buffer; size_t out_buffer_size; size_t out_buffer_ind; size_t byte_count; long flags; char data[1]; }; typedef struct printf_spec printf_spec; struct printf_spec { }; typedef union printf_arg printf_arg; union printf_arg { }; typedef struct { int cur; } printf_spec_dynarr; typedef struct { } printf_arg_dynarr; static void doprnt_1 (Lisp_Object stream, const Bufbyte *string, Bytecount len, Charcount minlen, Charcount maxlen, int minus_flag, int zero_flag) { Charcount cclen; Bufbyte pad; Lstream *lstr = (( struct lstream *) ((void *)(((( stream ) & ((1UL << ((4 * 8 ) - 4 ) ) - 1UL) ) ) | 0x40000000 )) ) ; cclen = ( len ) ; if (zero_flag) pad = '0'; pad = ' '; #if 0 if (minlen > cclen && !minus_flag) #endif { int to_add = minlen - cclen; while (to_add > 0) { (( lstr )->out_buffer_ind >= ( lstr )->out_buffer_size ? Lstream_fputc ( lstr , pad ) : (( lstr )->out_buffer[( lstr )->out_buffer_ind++] = (unsigned char) ( pad ), ( lstr )->byte_count++, ( lstr )->buffering == LSTREAM_LINE_BUFFERED && ( lstr )->out_buffer[( lstr )->out_buffer_ind - 1] == '\n' ? Lstream_flush_out ( lstr ) : 0)) ; to_add--; } } if (maxlen >= 0) len = ( ((( maxlen ) <= ( cclen )) ? ( maxlen ) : ( cclen )) ) ; Lstream_write (lstr, string, len); if (minlen > cclen && minus_flag) { int to_add = minlen - cclen; while (to_add > 0) { (( lstr )->out_buffer_ind >= ( lstr )->out_buffer_size ? Lstream_fputc ( lstr , pad ) : (( lstr )->out_buffer[( lstr )->out_buffer_ind++] = (unsigned char) ( pad ), ( lstr )->byte_count++, ( lstr )->buffering == LSTREAM_LINE_BUFFERED && ( lstr )->out_buffer[( lstr )->out_buffer_ind - 1] == '\n' ? Lstream_flush_out ( lstr ) : 0)) ; to_add--; } } } static Bytecount emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, Lisp_Object format_reloc, Bytecount format_length, int nargs, const Lisp_Object *largs) { int i; printf_spec_dynarr *specs = 0; format_nonreloc = (( (( struct Lisp_String *) ((void *)(((( format_reloc ) & ((1UL << ((4 * 8 ) - 4 ) ) - 1UL) ) ) | 0x40000000 )) ) )->_data + 0) ; format_length = (( (( struct Lisp_String *) ((void *)(((( format_reloc ) & ((1UL << ((4 * 8 ) - 4 ) ) - 1UL) ) ) | 0x40000000 )) ) )->_size) ; specs = parse_doprnt_spec (format_nonreloc, format_length); for (i = 0; i < (( specs )->cur) ; i++) { char ch; doprnt_1 (stream, (Bufbyte *) &ch, 1, 0, -1, 0, 0); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000211-3.c ================================================ void f_clos(int x) { switch(x) { default: mumble:; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000224-1.c ================================================ enum Lisp_Type { Lisp_Int ,Lisp_Record ,Lisp_Cons ,Lisp_String ,Lisp_Vector ,Lisp_Symbol ,Lisp_Char }; typedef union Lisp_Object { struct { enum Lisp_Type type: 3L ; unsigned long markbit: 1; unsigned long val: 32; } gu; long i; } Lisp_Object; extern int initialized; void init_device_faces (int *d) { if (initialized) { Lisp_Object tdevice; do { tdevice = (union Lisp_Object) { gu: { markbit: 0, type: Lisp_Record, val: ((unsigned long )d) } }; } while (0); call_critical_lisp_code (tdevice); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000314-1.c ================================================ struct { char a[5]; } *p; int main () { int i = -1; if(p->a[-i]) return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000314-2.c ================================================ extern void malloc(__SIZE_TYPE__ size); toto() { malloc(100); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000319-1.c ================================================ struct foo { long x; char y; long boom[0]; }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000326-1.c ================================================ long sys_reboot(int magic1, int magic2, int cmd, void * arg) { switch (cmd) { case 0x89ABCDEF: return 1; case 0x00000000: return 2; case 0xCDEF0123: return 3; case 0x4321FEDC: return 4; case 0xA1B2C3D4: return 5; default: return 0; }; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000326-2.c ================================================ #ifndef NO_LABEL_VALUES extern int printk(const char *fmt, ...); void foo (int x, int y) { __label__ here; here: printk ("", &&here); } #else int x; #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000329-1.c ================================================ int giop_tx_big_endian; inline void giop_encode_ulong (unsigned long i, char *buf) { if (giop_tx_big_endian) { *(unsigned long *) buf = i; } else { *buf++ = i & 0xff; *buf++ = (i >> 8) & 0xff; *buf++ = (i >> 16) & 0xff; *buf = (i >> 24) & 0xff; } } static double time_giop_encode (unsigned long l) { int c; char buf[4]; for (c = 0; c < (512 * 1024 * 1024); ++c) { giop_encode_ulong (l, buf); } } int main (int ac, char *av[]) { giop_tx_big_endian = 1; time_giop_encode (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000403-1.c ================================================ struct utsname { char sysname[32 ]; char version[32 ]; }; int uname(name) struct utsname *name; { int mib[2], rval; long len; char *p; int oerrno; if (sysctl(mib, 2, &name->sysname, &len, 0 , 0) == -1) ; for (p = name->version; len--; ++p) { *p = ' '; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000403-2.c ================================================ void foo () { long long tmp; (( tmp ) = (long long)( tmp ) >> ( 32 )) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000405-1.c ================================================ // Copyright (C) 2000 Free Software Foundation // by Alexandre Oliva // simplified from libio/floatconv.c static const double bar[] = { 0 }; int j; double foo () { return bar[j]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000405-2.c ================================================ extern void foo (int); void bar (unsigned long l) { foo(l == 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000405-3.c ================================================ struct foo { void *entry[40]; } __attribute__ ((aligned(32))); int foo (struct foo *ptr, int idx, void *pointer) { ptr->entry[idx] = pointer; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000412-1.c ================================================ typedef struct { short a; short b; } s1; extern void g(unsigned char *b); void f(void) { s1 a; unsigned char *b; a.a = 0; b = (unsigned char *)&a; g(b); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000412-2.c ================================================ char list[250][64]; int f(int idx) { return (strlen(list[idx])); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000420-1.c ================================================ struct z_candidate { struct z_candidate *next;int viable;}; int pedantic; static struct z_candidate * splice_viable (cands) struct z_candidate *cands; { struct z_candidate **p = &cands; for (; *p; ) { if (pedantic ? (*p)->viable == 1 : (*p)->viable) p = &((*p)->next); else *p = (*p)->next; } return cands; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000420-2.c ================================================ struct x { int a, b, c; }; extern struct x a (); extern void b (struct x); void foo () { a (); b (a ()); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000427-1.c ================================================ int lwidth; int lheight; void ConvertFor3dDriver (int requirePO2, int maxAspect) { int oldw = lwidth, oldh = lheight; lheight = FindNearestPowerOf2 (lheight); while (lwidth/lheight > maxAspect) lheight += lheight; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000502-1.c ================================================ static int minimum(int a, int b) { if(a < b) return a; else return b; } static int a, b; static inline int foo(void) { a = minimum (a, b); return 0; } static int bar(void) { return foo(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000504-1.c ================================================ struct foo { int a; int b; }; int func(struct foo *foo, int a) { if (foo->b == 0) { int ret = foo->a = a; if (a >= 0) foo->a = a; return (ret); } return (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000511-1.c ================================================ typedef struct { char y; char x[32]; } X; int z (void) { X xxx; xxx.x[0] = xxx.x[31] = '0'; xxx.y = 0xf; return f (xxx, xxx); } int main (void) { int val; val = z (); if (val != 0x60) abort (); exit (0); } int f(X x, X y) { if (x.y != y.y) return 'F'; return x.x[0] + y.x[0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000517-1.c ================================================ void test2 (int*, int, int, int); void test () { int l; test2 (0, 0, 0, 0); test2 (&l, 0, 0, 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000518-1.c ================================================ /* { dg-require-effective-target label_values } */ void callit1(void*); extern __inline__ void test() { __label__ l1; callit1(&&l1); l1:; } void dotest() { test(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000523-1.c ================================================ /* Copyright (C) 2000 Free Software Foundation */ /* Contributed by Alexandre Oliva */ enum { foo = sizeof(void *) }; int i = sizeof(void *); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000605-1.c ================================================ /* Copyright (C) 2000 Free Software Foundation */ /* make sure we don't get confused by various flavors of void */ /* Origin: Jakub Jelinek * Joel Sherrill */ typedef void foo; foo bar(void); void baz(void) { bar(); } void volatile f(); int x() { f(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000606-1.c ================================================ typedef struct _foo foo; extern foo bar; struct _foo { int a; }; void baz(void) { bar.a = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000609-1.c ================================================ int main () { char temp[1024] = "tempfile"; return temp[0] != 't'; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000629-1.c ================================================ struct a { struct a * x; }; void foo (struct a * b) { int i; for (i = 0; i < 1000; i++) { b->x = b; b++; } } void bar (struct a * b) { int i; for (i = 0; i < 1000; i++) { b->x = b; b--; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000701-1.c ================================================ void dr106_1(void *pv, int i) { *pv; i ? *pv : *pv; *pv, *pv; } void dr106_2(const void *pcv, volatile void *pvv, int i) { *pcv; i ? *pcv : *pcv; *pcv, *pcv; *pvv; i ? *pvv : *pvv; *pvv, *pvv; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000717-1.c ================================================ short inner_product (short *a, short *b) { int i; short sum = 0; for (i = 9; i >= 0; i--) sum += (*a++) * (*b++); return sum; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000718.c ================================================ extern double foo(double, double); extern void bar(float*, int*); void baz(int* arg) { float tmp = (float)foo(2.0,1.0); unsigned i; short junk[64]; for (i=0; i<10; i++, arg++) { bar(&tmp, arg); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000728-1.c ================================================ struct clock { long sec; long usec; }; int foo(void) { struct clock clock_old = {0, 0}; for (;;) { long foo; if (foo == clock_old.sec && 0 == clock_old.usec); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000802-1.c ================================================ struct foo { char a[3]; char b; char c; }; struct foo bs; int x; char y[3]; void bar(void) { memcpy(bs.a, y, 3); bs.a[1] = ((x ? &bs.b : &bs.c) - (char *)&bs) - 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000803-1.c ================================================ static int gl_cnt = 0; static char gl_buf[1024]; void gl_yank() { int i; for (i=gl_cnt; i >= 0; i--) gl_buf[i+10] = gl_buf[i]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000804-1.c ================================================ /* This does not work on h8300 due to the use of an asm statement to force a 'long long' (64-bits) to go in a register. */ /* { dg-do assemble } */ /* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && { ia32 && { ! nonpic } } } { "*" } { "" } } */ /* { dg-skip-if "No 64-bit registers" { m32c-*-* } { "*" } { "" } } */ /* { dg-skip-if "Not enough 64-bit registers" { pdp11-*-* } { "-O0" } { "" } } */ /* { dg-xfail-if "" { h8300-*-* } { "*" } { "" } } */ /* Copyright (C) 2000, 2003 Free Software Foundation */ __complex__ long long f () { int i[99]; __complex__ long long v; v += f (); asm("": "+r" (v) : "r" (0), "r" (1)); v = 2; return v; g (&v); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000818-1.c ================================================ void foo (long double x) { struct {long double t;} y = {x}; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000825-1.c ================================================ typedef signed int s32; typedef signed long s64; typedef unsigned int u32; typedef unsigned long u64; extern __inline__ u32 foobar(int logmask) { u32 ret = ~(1 << logmask); // fails // s32 ret = ~(1 << logmask); // ok // u64 ret = ~(1 << logmask); // ok // s64 ret = ~(1 << logmask); // ok return ret; } // This procedure compiles fine... u32 good(u32 var) { var = foobar(0); return var; } // This procedure does not compile... // Same as above, but formal parameter is a pointer // Both good() and fails() compile ok if we choose // a different type for "ret" in foobar(). u32 fails(u32 *var) { *var = foobar(0); return *var; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000827-1.c ================================================ /* Copyright (C) 2000 Free Software Foundation */ /* Contributed by Alexandre Oliva */ int foo () { while (1) { int a; char b; /* gcse should not merge these asm statements, since their output operands have different modes. */ __asm__("":"=r" (a)); __asm__("":"=r" (b)); if (b) return a; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000922-1.c ================================================ extern void doit(int); void quick_doit(int x) { #ifdef __OPTIMIZE__ if (__builtin_constant_p (x) && x != 0) asm volatile ("%0" : : "i#*X"(x)); else #endif doit(x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20000923-1.c ================================================ /* { dg-require-effective-target alloca } */ const int a = 3; const int b = 50; void foo (void) { long int x[a][b]; asm ("" : : "r" (x) : "memory"); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20001018-1.c ================================================ void foo (void) { extern char i[10]; { extern char i[]; char x[sizeof (i) == 10 ? 1 : -1]; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20001024-1.c ================================================ /* Copyright (C) 2000 Free Software Foundation */ /* Contributed by Nathan Sidwell */ typedef __SIZE_TYPE__ size_t; extern void *memset(void *, int, size_t); struct Baz; void quux(struct Baz *context) { memset(context, 0, 4); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20001109-1.c ================================================ typedef struct _foo foo; extern foo bar; struct _foo { int a; }; int tst[__alignof__ (bar) >= __alignof__ (int) ? 1 : -1]; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20001109-2.c ================================================ extern struct foo bar; struct foo { int a; }; int tst[__alignof__ (bar) >= __alignof__ (int) ? 1 : -1]; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20001116-1.c ================================================ int x[60]; char *y = ((char*)&(x[2*8 + 2]) - 8); int z = (&"Foobar"[1] - &"Foobar"[0]); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20001121-1.c ================================================ extern int bar(int); int foo(int x) { return 1 + bar( ({ int y; switch (x) { case 0: y = 1; break; case 1: y = 2; break; case 2: y = 3; break; case 3: y = 4; break; case 4: y = 5; break; case 5: y = 6; break; default: y = 7; break; } y; }) ); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20001123-1.c ================================================ typedef __builtin_va_list __gnuc_va_list; typedef __gnuc_va_list va_list; struct X { int y; }; void func(va_list va) { char* a = __builtin_va_arg(va, char**)[0]; int b = __builtin_va_arg(va, struct X*)->y; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20001123-2.c ================================================ /* Copyright 2000 Free Software Foundation by Alexandre Oliva Based on zlib/gzio.c. This used to generate duplicate labels when compiled with sh-elf-gcc -O2 -m3 -fPIC. Bug reported by NIIBE Yutaka . */ void foo (void); void bar () { unsigned len; for (len = 0; len < 2; len++) foo (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20001205-1.c ================================================ /* { dg-do assemble } */ static inline unsigned long rdfpcr(void) { unsigned long tmp, ret; __asm__ ("" : "=r"(tmp), "=r"(ret)); return ret; } static inline unsigned long swcr_update_status(unsigned long swcr, unsigned long fpcr) { swcr &= ~0x7e0000ul; swcr |= (fpcr >> 3) & 0x7e0000ul; return swcr; } unsigned long osf_getsysinfo(unsigned long flags) { unsigned long w; w = swcr_update_status(flags, rdfpcr()); return w; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20001212-1.c ================================================ typedef struct { long double l; } ld; ld a (ld x, ld y) { ld b; b.l = x.l + y.l; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20001221-1.c ================================================ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ static void foo () { long maplength; int type; { const long nibbles = 8; char buf1[nibbles + 1]; char buf2[nibbles + 1]; char buf3[nibbles + 1]; buf1[nibbles] = '\0'; buf2[nibbles] = '\0'; buf3[nibbles] = '\0'; ((nibbles) <= 16 ? (({ void *__s = (buf1); union { unsigned int __ui; unsigned short int __usi; unsigned char __uc; } *__u = __s; unsigned char __c = (unsigned char)('0'); switch ((unsigned int) (nibbles)) { case 16: __u->__ui = __c * 0x01010101; __u = __extension__ ((void *) __u + 4); case 12: __u->__ui = __c * 0x01010101; __u = __extension__ ((void *) __u + 4); case 0: break; } __s; })) : 0); ((nibbles) <= 16 ? (({ void *__s = (buf2); union { unsigned int __ui; unsigned short int __usi; unsigned char __uc; } *__u = __s; unsigned char __c = (unsigned char)('0'); switch ((unsigned int) (nibbles)) { case 16: __u->__ui = __c * 0x01010101; __u = __extension__ ((void *) __u + 4); case 12: __u->__ui = __c * 0x01010101; __u = __extension__ ((void *) __u + 4); case 8: __u->__ui = __c * 0x01010101; __u = __extension__ ((void *) __u + 4); case 4: __u->__ui = __c * 0x01010101; case 0: break; } __s; })) : 0); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20001222-1.c ================================================ /* Testcase for PR c/1501. */ double __complex__ f (void) { return ~(1.0 + 2.0i); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20001226-1.c ================================================ /* { dg-do assemble } */ /* { dg-skip-if "too much code for avr" { "avr-*-*" } { "*" } { "" } } */ /* { dg-skip-if "too much code for pdp11" { "pdp11-*-*" } { "*" } { "" } } */ /* { dg-xfail-if "jump beyond 128K not supported" { xtensa*-*-* } { "-O0" } { "" } } */ /* { dg-xfail-if "PR36698" { spu-*-* } { "-O0" } { "" } } */ /* { dg-skip-if "" { m32c-*-* } { "*" } { "" } } */ /* { dg-timeout-factor 4.0 } */ /* This testcase exposed two branch shortening bugs on powerpc. */ #define C(a,b) \ if (a > b) goto gt; \ if (a < b) goto lt; #define C4(x,b) C((x)[0], b) C((x)[1],b) C((x)[2],b) C((x)[3],b) #define C16(x,y) C4(x, (y)[0]) C4(x, (y)[1]) C4(x, (y)[2]) C4(x, (y)[3]) #define C64(x,y) C16(x,y) C16(x+4,y) C16(x+8,y) C16(x+12,y) #define C256(x,y) C64(x,y) C64(x,y+4) C64(x,y+8) C64(x,y+12) #define C1024(x,y) C256(x,y) C256(x+16,y) C256(x+32,y) C256(x+48,y) #define C4096(x,y) C1024(x,y) C1024(x,y+16) C1024(x,y+32) C1024(x,y+48) unsigned foo(int x[64], int y[64]) { C4096(x,y); return 0x01234567; gt: return 0x12345678; lt: return 0xF0123456; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/200031109-1.c ================================================ /* For a short time on the tree-ssa branch this would warn that value was not initialized as it was optimizing !(value = (m?1:2)) to 0 and not setting value before. */ int t(int m) { int value; if (!(value = (m?1:2))) value = 0; return value; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010102-1.c ================================================ /* This testcase derives from gnu obstack.c/obstack.h and failed with -O3 -funroll-all-loops, or -O1 -frename-registers -funroll-loops on sparc-sun-solaris2.7. Copyright (C) 2001 Free Software Foundation. */ # define PTR_INT_TYPE __PTRDIFF_TYPE__ struct _obstack_chunk { char *limit; struct _obstack_chunk *prev; char contents[4]; }; struct obstack { long chunk_size; struct _obstack_chunk *chunk; char *object_base; char *next_free; char *chunk_limit; PTR_INT_TYPE temp; int alignment_mask; struct _obstack_chunk *(*chunkfun) (void *, long); void (*freefun) (void *, struct _obstack_chunk *); void *extra_arg; unsigned use_extra_arg:1; unsigned maybe_empty_object:1; unsigned alloc_failed:1; }; extern void _obstack_newchunk (struct obstack *, int); struct fooalign {char x; double d;}; #define DEFAULT_ALIGNMENT \ ((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0)) union fooround {long x; double d;}; #define DEFAULT_ROUNDING (sizeof (union fooround)) #ifndef COPYING_UNIT #define COPYING_UNIT int #endif #define CALL_CHUNKFUN(h, size) \ (((h) -> use_extra_arg) \ ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size))) #define CALL_FREEFUN(h, old_chunk) \ do { \ if ((h) -> use_extra_arg) \ (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ else \ (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \ } while (0) void _obstack_newchunk (h, length) struct obstack *h; int length; { register struct _obstack_chunk *old_chunk = h->chunk; register struct _obstack_chunk *new_chunk; register long new_size; register long obj_size = h->next_free - h->object_base; register long i; long already; new_size = (obj_size + length) + (obj_size >> 3) + 100; if (new_size < h->chunk_size) new_size = h->chunk_size; new_chunk = CALL_CHUNKFUN (h, new_size); h->chunk = new_chunk; new_chunk->prev = old_chunk; new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size; if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT) { for (i = obj_size / sizeof (COPYING_UNIT) - 1; i >= 0; i--) ((COPYING_UNIT *)new_chunk->contents)[i] = ((COPYING_UNIT *)h->object_base)[i]; already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT); } else already = 0; for (i = already; i < obj_size; i++) new_chunk->contents[i] = h->object_base[i]; if (h->object_base == old_chunk->contents && ! h->maybe_empty_object) { new_chunk->prev = old_chunk->prev; CALL_FREEFUN (h, old_chunk); } h->object_base = new_chunk->contents; h->next_free = h->object_base + obj_size; h->maybe_empty_object = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010107-1.c ================================================ unsigned long x[4]; void foo(void) { ((void (*)())(x+2))(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010112-1.c ================================================ /* Test that putting an initialized variable in a register works. */ #ifdef __i386__ #define REGISTER asm ("eax") #elif defined (__arm__) #define REGISTER asm ("r0") #else /* Put examples for other architectures here. */ #define REGISTER #endif void f() { register int i REGISTER = 3; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010113-1.c ================================================ /* Origin: PR c/364 from and@genesyslab.com, very much reduced to a testcase by Joseph Myers . The initializer of z is a valid address constant, and GCC 2.95.2 accepts it as such. CVS GCC as of 2001-01-13 rejects it, but accepts it if y is changed to x in the initializer. */ struct { struct { int x; int y; } p; } v; int *z = &((&(v.p))->y); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010114-1.c ================================================ /* Origin: PR c/166 from Joerg Czeranski . */ /* In the declaration of proc, x cannot be parsed as a typedef name, so it must be parsed as a parameter name. */ typedef int x; void proc(int (*x)(void)) {} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010114-2.c ================================================ /* Origin: from Fred Fish . See also PR c/1625. */ #include struct { int x; bool y; } foo = { 0, false }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010117-1.c ================================================ unsigned char u, v, w; void baz (void) { if ((u - v - w) & 0x80) v = 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010117-2.c ================================================ unsigned char a, b; void baz (void) { if (b & 0x08) { int g = 0; int c = (b & 0x01); int d = a - g - c; int e = (a & 0x0f) - (g & 0x0f); int f = (a & 0xf0) - (g & 0xf0); int h = (a & 0x0f) - (g & 0x0f); if ((a ^ g) & (a ^ d) & 0x80) b |= 0x40; if ((d & 0xff00) == 0) b |= 0x01; if (!((a - h - c) & 0xff)) b |= 0x02; if ((a - g - c) & 0x80) b |= 0x80; a = (e & 0x0f) | (f & 0xf0); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010118-1.c ================================================ static unsigned int bar(void *h, unsigned int n) { static int i; return i++; } static void baz(unsigned int *x) { (*x)++; } long foo(void *h, unsigned int l) { unsigned int n; long m; n = bar(h, 0); n = bar(h, n); m = ({ baz(&n); 21; }); return m; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010124-1.c ================================================ /* Origin: testcase from Joseph Myers , problem pointed out in a post to comp.std.c <980283801.3063.0.nnrp-07.c2deb1c2@news.demon.co.uk> by Dibyendu Majumdar . Compound literals should be parsed as postfix expressions, rather than as cast expressions. In particular, they are valid operands of sizeof. */ struct s { int a; int b; }; char x[((sizeof (struct s){ 1, 2 }) == sizeof (struct s)) ? 1 : -1]; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010202-1.c ================================================ int foo (int n, char m[1][n]); int foo (int n, char m[1][n]) { } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010209-1.c ================================================ short int a; int main (void) { a = 65535.0; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010226-1.c ================================================ /* { dg-require-effective-target trampolines } */ void f1 (void *); void f3 (void *, void (*)(void *)); void f2 (void *); int foo (void *a, int b) { if (!b) { f1 (a); return 1; } if (b) { void bar (void *c) { if (c == a) f2 (c); } f3 (a, bar); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010227-1.c ================================================ void foo (void) { double a = 0.0; double b = a; if (&b != &a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010313-1.c ================================================ /* Origin: Joseph Myers . */ /* After the open parenthesis before the __attribute__, we used to shift the __attribute__ (expecting a parenthesised abstract declarator) instead of reducing to the start of a parameter list. */ void bar (int (__attribute__((__mode__(__SI__))) int foo)); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010320-1.c ================================================ typedef struct sec { const char *name; int id; int index; struct sec *next; unsigned int flags; unsigned int user_set_vma : 1; unsigned int reloc_done : 1; unsigned int linker_mark : 1; unsigned int gc_mark : 1; unsigned int segment_mark : 1; unsigned long long vma; } asection; static void pe_print_pdata (asection *section) { unsigned long long i; unsigned long long start = 0, stop = 0; int onaline = (3*8) ; for (i = start; i < stop; i += onaline) { if (i + (3*8) > stop) break; f (((unsigned long) ((( i + section->vma ) >> 32) & 0xffffffff)) , ((unsigned long) ((( i + section->vma ) & 0xffffffff))) ) ; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010326-1.c ================================================ float d; int e, f; void foo (void) { struct { float u, v; } a = {0.0, 0.0}; float b; int c; c = e; if (c == 0) c = f; b = d; if (a.v < b) a.v = b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010327-1.c ================================================ /* { dg-do compile { target { ptr32plus && { ! llp64 } } } } */ /* This testcase tests whether GCC can produce static initialized data that references addresses of size 'unsigned long', even if that's not the same as __SIZE_TYPE__. (See 20011114-1.c for the same test of size __SIZE_TYPE__.) Some rare environments might not have the required relocs to support this; they should have this test disabled in the .x file. */ extern void _text; static unsigned long x = (unsigned long) &_text - 0x10000000L - 1; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010328-1.c ================================================ typedef __SIZE_TYPE__ size_t; typedef unsigned int __u_int; typedef unsigned long __u_long; __extension__ typedef unsigned long long int __u_quad_t; __extension__ typedef long long int __quad_t; typedef struct { int __val[2]; } __fsid_t; typedef long int __blksize_t; typedef long int __blkcnt_t; typedef __quad_t __blkcnt64_t; typedef __u_long __fsblkcnt_t; typedef __u_quad_t __fsblkcnt64_t; typedef __u_long __fsfilcnt_t; typedef __u_quad_t __fsfilcnt64_t; typedef __u_quad_t __ino64_t; extern void *memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) ; struct statfs { int f_type; int f_bsize; __fsblkcnt_t f_blocks; __fsblkcnt_t f_bfree; __fsblkcnt_t f_bavail; __fsfilcnt_t f_files; __fsfilcnt_t f_ffree; __fsid_t f_fsid; int f_namelen; int f_spare[6]; }; struct statfs64 { int f_type; int f_bsize; __fsblkcnt64_t f_blocks; __fsblkcnt64_t f_bfree; __fsblkcnt64_t f_bavail; __fsfilcnt64_t f_files; __fsfilcnt64_t f_ffree; __fsid_t f_fsid; int f_namelen; int f_spare[6]; }; extern int __statfs (__const char *__file, struct statfs *__buf); extern int __statfs64 (__const char *__file, struct statfs64 *__buf); int __statfs64 (const char *file, struct statfs64 *buf) { struct statfs buf32; if (__statfs (file, &buf32) < 0) return -1; buf->f_type = buf32.f_type; buf->f_bsize = buf32.f_bsize; buf->f_blocks = buf32.f_blocks; buf->f_bfree = buf32.f_bfree; buf->f_bavail = buf32.f_bavail; buf->f_files = buf32.f_files; buf->f_ffree = buf32.f_ffree; buf->f_fsid = buf32.f_fsid; buf->f_namelen = buf32.f_namelen; memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare)); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010329-1.c ================================================ union u { unsigned char a; double b; }; int a; union u foo (void) { union u b; if (a) b.a = 1; else b.a = 0; return b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010404-1.c ================================================ /* This testcase caused a floating point exception in the compiler when compiled with -O2. The crash occurs when trying to simplify division and modulo operations. */ #include extern void bar (int); void foo () { int a = INT_MIN; int b = -1; bar (a / b); bar (a % b); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010408-1.c ================================================ extern struct win *windows, *wtab[]; struct win { struct win *w_next; }; struct auser; struct comm { char *name; int flags; }; extern struct comm comms[]; extern int WindowByNoN (char *); extern int FindCommnr (char *); extern int AclSetPermCmd (struct auser *, char *, struct comm *); extern int AclSetPermWin (struct auser *, struct auser *, char *, struct win *); int AclSetPerm(uu, u, mode, s) struct auser *uu, *u; char *mode, *s; { struct win *w; int i; char *p, ch; do { } while (0); while (*s) { switch (*s) { case '*': return AclSetPerm(uu, u, mode, "#?"); case '#': if (uu) AclSetPermWin(uu, u, mode, (struct win *)1); else for (w = windows; w; w = w->w_next) AclSetPermWin((struct auser *)0, u, mode, w); s++; break; case '?': if (uu) AclSetPermWin(uu, u, mode, (struct win *)0); else for (i = 0; i <= 174; i++) AclSetPermCmd(u, mode, &comms[i]); s++; break; default: for (p = s; *p && *p != ' ' && *p != '\t' && *p != ','; p++) ; if ((ch = *p)) *p++ = '\0'; if ((i = FindCommnr(s)) != -1) AclSetPermCmd(u, mode, &comms[i]); else if (((i = WindowByNoN(s)) >= 0) && wtab[i]) AclSetPermWin((struct auser *)0, u, mode, wtab[i]); else return -1; if (ch) p[-1] = ch; s = p; } } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010421-1.c ================================================ int j; void residual () { long double s; for (j = 3; j < 9; j++) s -= 3; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010423-1.c ================================================ /* Origin: PR c/2618 from Cesar Eduardo Barros , adapted to a testcase by Joseph Myers . Boolean conversions were causing infinite recursion between convert and fold in certain cases. */ #include bool x; unsigned char y; void fn (void) { x = y & 0x1 ? 1 : 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010426-1.c ================================================ struct { char *m; long n; } a[20]; int b = 20, c; void bar(void) __attribute__((__noreturn__)); int foo(int x) { int i; for (i = 0; i < x; i++) { a[0].m = "a"; a[0].n = 10; c=1; a[c].m = "b"; a[c].n = 32; c++; if (c >= b) bar (); a[c].m = "c"; a[c].n = 80; c++; if (c >= b) bar (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010503-1.c ================================================ void f1 (double); void f2 (int); void foo (int type, double xx) { if (type) f1 (xx); else f2 (type); } void bar (int type) { foo (type, 1.0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010510-1.c ================================================ typedef char *ident; #ident "This is ident" ident i; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010518-1.c ================================================ /* This was cut down from reload1.c in May 2001, was observed to cause a bootstrap failure for powerpc-apple-darwin1.3. Copyright (C) 2001 Free Software Foundation. */ enum insn_code { CODE_FOR_extendqidi2 = 3, CODE_FOR_nothing = 870 }; struct rtx_def; enum machine_mode { VOIDmode, MAX_MACHINE_MODE }; typedef unsigned long long HARD_REG_ELT_TYPE; typedef HARD_REG_ELT_TYPE HARD_REG_SET[((77 + (8 * 8) - 1) / (8 * 8))]; enum rtx_code { UNKNOWN, NIL, REG, LAST_AND_UNUSED_RTX_CODE = 256 }; typedef struct { unsigned min_align:8; unsigned base_after_vec:1; unsigned min_after_vec:1; unsigned max_after_vec:1; unsigned min_after_base:1; unsigned max_after_base:1; unsigned offset_unsigned:1; unsigned:2; unsigned scale:8; } addr_diff_vec_flags; typedef union rtunion_def { long long rtwint; int rtint; unsigned int rtuint; const char *rtstr; struct rtx_def *rtx; struct rtvec_def *rtvec; enum machine_mode rttype; addr_diff_vec_flags rt_addr_diff_vec_flags; struct cselib_val_struct *rt_cselib; struct bitmap_head_def *rtbit; union tree_node *rttree; struct basic_block_def *bb; } rtunion; typedef struct rtx_def { enum rtx_code code:16; enum machine_mode mode:8; unsigned int jump:1; unsigned int call:1; unsigned int unchanging:1; unsigned int volatil:1; unsigned int in_struct:1; unsigned int used:1; unsigned integrated:1; unsigned frame_related:1; rtunion fld[1]; } *rtx; enum reload_type { RELOAD_FOR_INPUT, RELOAD_FOR_OUTPUT, RELOAD_FOR_INSN, RELOAD_FOR_INPUT_ADDRESS, RELOAD_FOR_INPADDR_ADDRESS, RELOAD_FOR_OUTPUT_ADDRESS, RELOAD_FOR_OUTADDR_ADDRESS, RELOAD_FOR_OPERAND_ADDRESS, RELOAD_FOR_OPADDR_ADDR, RELOAD_OTHER, RELOAD_FOR_OTHER_ADDRESS }; struct reload { rtx in; rtx out; // enum reg_class class; enum machine_mode inmode; enum machine_mode outmode; enum machine_mode mode; unsigned int nregs; int inc; rtx in_reg; rtx out_reg; int regno; rtx reg_rtx; int opnum; int secondary_in_reload; int secondary_out_reload; enum insn_code secondary_in_icode; enum insn_code secondary_out_icode; enum reload_type when_needed; unsigned int optional:1; unsigned int nocombine:1; unsigned int secondary_p:1; unsigned int nongroup:1; }; struct insn_chain { rtx insn; }; extern int n_reloads; static short reload_order[(2 * 10 * (2 + 1))]; int reload_spill_index[(2 * 10 * (2 + 1))]; extern struct reload rld[(2 * 10 * (2 + 1))]; static rtx *reg_last_reload_reg; static HARD_REG_SET reg_reloaded_valid; static HARD_REG_SET reg_reloaded_dead; static HARD_REG_SET reg_reloaded_died; static HARD_REG_SET reg_is_output_reload; extern const unsigned int mode_size[]; extern int target_flags; static void emit_reload_insns (chain) struct insn_chain *chain; { rtx insn = chain->insn; register int j; rtx following_insn = (((insn)->fld[2]).rtx); rtx before_insn = (((insn)->fld[1]).rtx); for (j = 0; j < n_reloads; j++) { register int r = reload_order[j]; register int i = reload_spill_index[r]; { rtx out = (((enum rtx_code) (rld[r].out)->code) == REG ? rld[r].out : rld[r].out_reg); register int nregno = (((out)->fld[0]).rtuint); if (nregno >= 77) { rtx src_reg, store_insn = (rtx) 0; reg_last_reload_reg[nregno] = 0; if (src_reg && ((enum rtx_code) (src_reg)->code) == REG && (((src_reg)->fld[0]).rtuint) < 77) { int src_regno = (((src_reg)->fld[0]).rtuint); int nr = (((src_regno) >= 32 && (src_regno) <= 63) ? (((mode_size[(int) (rld[r].mode)]) + 8 - 1) / 8) : (((mode_size[(int) (rld[r].mode)]) + (!(target_flags & 0x00000020) ? 4 : 8) - 1) / (!(target_flags & 0x00000020) ? 4 : 8))); rtx note = 0; while (nr-- > 0) { ((reg_reloaded_dead) [(src_regno + nr) / ((unsigned) (8 * 8))] &= ~(((HARD_REG_ELT_TYPE) (1)) << ((src_regno + nr) % ((unsigned) (8 * 8))))); ((reg_reloaded_valid) [(src_regno + nr) / ((unsigned) (8 * 8))] |= ((HARD_REG_ELT_TYPE) (1)) << ((src_regno + nr) % ((unsigned) (8 * 8)))); ((reg_is_output_reload) [(src_regno + nr) / ((unsigned) (8 * 8))] |= ((HARD_REG_ELT_TYPE) (1)) << ((src_regno + nr) % ((unsigned) (8 * 8)))); if (note) ((reg_reloaded_died) [(src_regno) / ((unsigned) (8 * 8))] |= ((HARD_REG_ELT_TYPE) (1)) << ((src_regno) % ((unsigned) (8 * 8)))); else ((reg_reloaded_died) [(src_regno) / ((unsigned) (8 * 8))] &= ~(((HARD_REG_ELT_TYPE) (1)) << ((src_regno) % ((unsigned) (8 * 8))))); } reg_last_reload_reg[nregno] = src_reg; } } else { int num_regs = (((nregno) >= 32 && (nregno) <= 63) ? (((mode_size [(int) (((enum machine_mode) (rld[r].out)->mode))]) + 8 - 1) / 8) : (((mode_size [(int) (((enum machine_mode) (rld[r].out)->mode))]) + (!(target_flags & 0x00000020) ? 4 : 8) - 1) / (!(target_flags & 0x00000020) ? 4 : 8))); while (num_regs-- > 0) reg_last_reload_reg[nregno + num_regs] = 0; } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010518-2.c ================================================ /* { dg-do compile } */ /* Large static storage. */ #include static volatile char chars_1[INT_MAX / 2]; static volatile char chars_2[1]; int foo (void) { chars_1[10] = 'y'; chars_2[0] = 'x'; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010525-1.c ================================================ /* { dg-require-effective-target untyped_assembly } */ static int kind_varread(char *str) { if (0 == memcmp("%_#", str, 3)) return 2; /* NOTREACHED */ } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010605-1.c ================================================ int main (int argc, char **argv) { int size = 10; typedef struct { char val[size]; } block; block retframe_block() { return *(block*)0; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010605-2.c ================================================ /* Origin: Joseph Myers . */ /* As an extension, GCC allows a struct or union to be cast to its own type, but failed to allow this when a typedef was involved. Reported as PR c/2735 by . */ union u { int i; }; typedef union u uu; union u a; uu b; void foo (void) { a = (union u) b; a = (uu) b; b = (union u) a; b = (uu) a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010605-3.c ================================================ struct A { unsigned long buf[100]; }; int foo(unsigned int *x) { unsigned int a; if (!x) return -22; #ifdef __ia64__ if (({ register long b asm ("r8") = 0; register long c asm ("r9") = 0; asm ("" : "=r"(c), "=r"(b) : "m"(*(struct A *)x), "1"(b)); a = (unsigned int) c; b; })) return -14; #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010610-1.c ================================================ /* Origin: Kaveh R. Ghazi Boolean types were not accepted as array sizes nor as switch quantities. */ #include int main(void) { bool arr[(bool)1]; switch (arr[0]) { default:; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010611-1.c ================================================ /* Origin: PR c/3116 from Andreas Jaeger . */ /* When determining type compatibility of function types, we must remove qualifiers from argument types. We used to fail to do this properly in store_parm_decls when comparing prototype and non-prototype declarations. */ struct _IO_FILE { int _flags; }; typedef struct _IO_FILE __FILE; typedef struct _IO_FILE _IO_FILE; typedef long int wchar_t; extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); wchar_t * fgetws (buf, n, fp) wchar_t *buf; int n; _IO_FILE *fp; { return (wchar_t *)0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010701-1.c ================================================ /* Test that postfix attributes only apply to a single declared object. (decl_attributes used to chain them onto the end of the prefix attributes, which caused them to apply to other declarations as well.) */ /* Origin: Joseph Myers . */ void __attribute__((__noreturn__)) foo (const char *, ...) __attribute__((__format__(__printf__, 1, 2))), bar (void); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010706-1.c ================================================ foo(unsigned int x) { return (x << 1) | (x >> 31); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010711-1.c ================================================ typedef unsigned long long value; void foo (value *v) {} void test () { value v; foo (&v); if (v-- > 0) foo (&v); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010711-2.c ================================================ typedef unsigned long long value; void foo (value *v) {} void test () { value v; foo (&v); if (v-- == 1) foo (&v); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010714-1.c ================================================ /* Test that prefix attributes after a comma only apply to a single declared object or function. */ /* Origin: Joseph Myers . */ __attribute__((noreturn)) void d0 (void), __attribute__((format(printf, 1, 2))) d1 (const char *, ...), d2 (void); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010824-1.c ================================================ void f(int n) { bugcauser: if (n != 0) f(n-1); return; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010903-1.c ================================================ struct A { long a; }; static inline void foo(struct A *x) { __asm__ __volatile__("" : "+m"(x->a) : "r"(x) : "memory", "cc"); } static inline void bar(struct A *x) { foo(x); } struct B { char buf[640]; struct A a; }; struct B b[32]; int baz(void) { int i; struct B *j; for (i = 1; i < 32; i++) { j = &b[i]; bar(&j->a); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010903-2.c ================================================ extern int __dummy (void *__preg, const char *__string); extern int rpmatch (const char *response); int rpmatch (const char *response) { auto inline int try (void *re); inline int try (void *re) { return __dummy (re, response); } static void *yesre; return (try (&yesre)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20010911-1.c ================================================ /* Test for segfault handling an empty attribute. */ /* Origin: PR c/4294 from . */ void __attribute__(()) foo(); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011010-1.c ================================================ extern int used (void); int foo () { int i; for (; used (); ({while (1) if (used ()) return 0;})) i++; return i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011023-1.c ================================================ /* Test whether tree inlining works with prototyped nested functions. */ extern void foo (char *x); void bar (void); void bar (void) { auto void baz (void); void baz (void) { char tmp[2]; foo (tmp); } baz (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011029-1.c ================================================ /* { dg-require-effective-target indirect_jumps } */ void foo (void *) __attribute__ ((noreturn)); void bar (void *x) { if (__builtin_setjmp (x)) return; foo (x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011106-1.c ================================================ /* Test that functions passed to the comma operator are correctly converted to pointers. */ /* Origin: Joseph Myers . */ void foo (void); void (*fp) (void); char x[sizeof (1, foo) == sizeof (fp) ? 1 : -1]; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011106-2.c ================================================ /* Test the type of a component of a conditional expression between two structures is correct. */ /* Origin: Joseph Myers . */ struct s { char c; } a, b; int c; char x[sizeof ((c ? a : b).c) == 1 ? 1 : -1]; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011109-1.c ================================================ typedef struct { short x[4]; } S; typedef struct { unsigned int a, b, c; S *d; } T; S *(*foo) (T *, int, int, int, int); unsigned short *(*bar)(const T *); unsigned short baz(T *,const int); T *die (void) { typedef struct { unsigned int a, b, e; double f, g; } U; char h[8], i[2053], j[2053]; double k, l, m; U n; T *o; unsigned short p; int q, r; long s; unsigned short *t; S *u; unsigned char *v, *w; unsigned int x; o = 0; for (x = 0; x < n.e; x++) { l = 1.0; if (n.g - n.f <= 1.0) l = ((1 << o->c) - 1) / (n.g - n.f); v = w; for (r = o->b - 1; r >= 0; r--) { u = foo (o, 0, r, o->a, 1); if (!u) break; t = bar (o); for (q = 0; q < (int) o->a; q++) { h[0] = *v; s = *v++; k = (double) s; m = l*k; p = m < 0 ? 0 : m > (1 << o->c) - 1 ? (1 << o->c) - 1 : m + 0.5; p = baz (o,p); t[q] = p; *u++ = o->d[p]; } } } return o; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011114-1.c ================================================ extern void _text; static __SIZE_TYPE__ x = (__SIZE_TYPE__) &_text - 0x10000000L - 1; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011114-2.c ================================================ typedef struct { int c, d, e, f, g; } D; void bar (unsigned long, unsigned long); void foo (D *y) { int x = 0; if (y->f == 0) x |= 0x1; if (y->g == 0) x |= 0x2; bar ((x << 16) | (y->c & 0xffff), (y->d << 16) | (y->e & 0xffff)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011114-3.c ================================================ typedef struct { int s, t; } C; C x; int foo (void); void bar (int); int baz (void) { int a = 0, c, d = 0; C *b = &x; while ((c = foo ())) switch(c) { case 23: bar (1); break; default: break; } if (a == 0 || (a & 1)) { if (b->s) { if (a) bar (1); else a = 16; } else if (b->t) { if (a) bar (1); else a = 32; } } if (d && (a & ~127)) bar (2); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011114-4.c ================================================ static inline int foo (long x) { register int a = 0; register unsigned b; do { b = (x & 0x7f); x = (x >> 7) | ~(-1L >> 7); a += 1; } while ((x != 0 || (b & 0x40) != 0) && (x != -1 || (b & 0x40) == 0)); return a; } static inline int bar (unsigned long x) { register int a = 0; register unsigned b; do { b = (x & 0x7f); x >>= 7; a++; } while (x != 0); return a; } int baz (unsigned long x, int y) { if (y) return foo ((long) x); else return bar (x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011119-1.c ================================================ /* { dg-options "-fgnu89-inline" } */ /* { dg-require-weak "" } */ /* { dg-require-alias "" } */ #define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname) #define ASMNAME2(prefix, cname) STRING (prefix) cname #define STRING(x) #x extern inline int foo (void) { return 23; } int xxx(void) __asm__(ASMNAME ("xxx")); int xxx(void) { return 23; } extern int foo (void) __attribute__ ((weak, alias ("xxx"))); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011119-2.c ================================================ /* { dg-options "-fgnu89-inline" } */ /* { dg-require-weak "" } */ /* { dg-require-alias "" } */ #define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname) #define ASMNAME2(prefix, cname) STRING (prefix) cname #define STRING(x) #x extern inline int foo (void) { return 23; } int bar (void) { return foo (); } extern int foo (void) __attribute__ ((weak, alias ("xxx"))); int baz (void) { return foo (); } int xxx(void) __asm__(ASMNAME ("xxx")); int xxx(void) { return 23; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011130-1.c ================================================ struct S { int i; }; extern struct S x[]; char *bar (const struct S *); void foo (void) { bar (x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011130-2.c ================================================ /* This testcase caused infinite loop in life info computation after if conversion on IA-64. Conditional register dead for pseudo holding sign-extended k was improperly computed, resulting in this pseudo being live at start of bb if it was dead at the end and vice versa; as it was a bb which had edge to itself, this resulted in alternative propagating this basic block forever. */ typedef struct { unsigned char a; unsigned char b; } S0; typedef struct { S0 *c; int d; unsigned int e; unsigned char *f[3]; void *g; } S1; int bar (int, void *); int foo (S1 *x, float y) { S0 *h; int i, j, k, l, m; float n, o, p; unsigned char *q, *r[3]; h = x->c; m = h->a; l = h->b; n = y; o = 0.0; if (x->d == 8) for (j = 0; j < x->e; j++) for (k = 0; k < 3; k++) { n = y; o = 0.0; if (m) q = x->f[k] + x->e - 1 - j; else q = x->f[k] + j; p = (*q - o) * y / (n - o); p = 0.0 > p ? 0.0 : p; p = y < p ? y : p; if (l) p = r[k][(int) p]; bar (p, x->g); } return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011205-1.c ================================================ /* Failure to mark_addressable all operands before evaluation means we don't set up the proper temporaries, which leaves us with an asm that doesn't match its contraints. */ long foo() { long x; asm("" : "=r"(x) : "m"(x)); return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011217-1.c ================================================ /* Test that the initializer of a compound literal is properly walked when tree inlining. */ /* Origin: PR c/5105 from . */ typedef struct { long p; } pt; inline pt f (pt _p) { long p = _p.p; return (pt) { (p) }; } static int mmap_mem (void) { pt p; p = f (p); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011217-2.c ================================================ /* Test that the initializer of a compound literal is properly walked when tree inlining. */ /* Origin: glibc (as reported in PR c/5105) from . */ inline int finite (double __x) { return (__extension__ (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1] | 0x800fffffu) + 1) >> 31)); } int main (void) { double x = 1.0; return finite (x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011218-1.c ================================================ /* This testcase failed on Alpha at -O2 because $27 hard register for the indirect call was exposed too early and reload couldn't allocate it for multiplication and division. */ struct S { int a, b; void (*f) (long, int); }; void foo (struct S *x) { long c = x->a * 50; c /= (long) x->b; c *= (long) x->b; x->f (c, 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011219-1.c ================================================ /* This testcase failed on IA-64 at -O2 during scheduling. */ void * baz (unsigned long); static inline double ** bar (long w, long x, long y, long z) { long i, a = x - w + 1, b = z - y + 1; double **m = (double **) baz (sizeof (double *) * (a + 1)); m += 1; m -= w; m[w] = (double *) baz (sizeof (double) * (a * b + 1)); m[w] += 1; m[w] -= y; for (i = w + 1; i <= x; i++) m[i] = m[i - 1] + b; return m; } void foo (double w[], int x, double y[], double z[]) { int i; double **a; a = bar (1, 50, 1, 50); for (i = 1; i <= x; i++) a[1][i] = - w[x - i] / w[x]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011219-2.c ================================================ /* This testcase failed on Alpha at -O2 when simplifying conditional expressions. */ struct S { unsigned long a; double b, c; }; extern double bar (double, double); int foo (unsigned long x, unsigned int y, struct S *z) { unsigned int a = z->a; int b = y / z->a > 1 ? y / z->a : 1; a = y / b < z->a ? y / b : z->a; z->c = z->b * bar ((double) a, (double) x); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011229-1.c ================================================ /* ICE: call insn does not satisfy its constraints, MMIX port. Origin: ghostscript-6.52, reduction from hp@bitrange.com. */ struct s0 { void (*init_color)(void *, void *); }; struct s1 { void (*map_cmyk)(short, void *, void **, void *); void (*map_rgb_alpha)(short, void *, void **, void *); }; struct s5 { long fill1; int fill2; long fill3; unsigned int fill4, fill5; }; struct s2 { struct s5 x, y; }; struct s3 { long dev_color; unsigned int key; }; struct s4 { unsigned char spp; int alpha; struct mc_ { unsigned int values[14]; unsigned int mask, test; int exact; } mask_color; void **pis; struct s0 *pcs; struct dd_ { struct s2 row[2]; struct s2 pixel0; } dda; struct s3 clues[256]; }; extern struct s1 *get_cmap_procs (void **, void *); int image_render_color (struct s4 *, unsigned char *, int, void *); int image_render_color (struct s4 *penum, unsigned char *buffer, int data_x, void *dev) { struct s3 *clues = penum->clues; void **pis = penum->pis; struct s2 pnext; struct s0 *pcs = penum->pcs; struct s1 *cmap_procs = get_cmap_procs(pis, dev); void (*map_4)(short, void *, void **, void *) = (penum->alpha ? cmap_procs->map_rgb_alpha : cmap_procs->map_cmyk); unsigned int mask = penum->mask_color.mask; unsigned int test = penum->mask_color.test; struct s3 *pic_next = &clues[1]; int spp = penum->spp; unsigned char *psrc = buffer + data_x * spp; unsigned char v[6]; pnext = penum->dda.pixel0; __builtin_memset (&v, 0, sizeof(v)); (*(pcs)->init_color) (0, 0); if (spp == 4) { v[0] = psrc[0]; v[1] = psrc[1]; if ((buffer[0] & mask) == test && penum->mask_color.exact) pic_next->dev_color = 0; (*map_4)(v[0], &pic_next->dev_color, pis, dev); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20011229-2.c ================================================ /* Test whether jump threading doesn't ICE if redirecting the jump to exit block. */ extern int bar (); extern void baz (); void foo () { int x; do { if ((x = bar ()) == 1) baz (); } while (x == 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020103-1.c ================================================ /* This testcase failed on Alpha at -O2 when simplifying conditional expressions. */ int foo (void); struct A { int a, b, c, d; }; void bar (struct A *x) { int e, f; e = foo (); e = e / x->b; if (e < 1) e = 1; f = (x->a + x->c) / e; if (f < x->d) x->d -= (1 << 16) / 8; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020106-1.c ================================================ /* Origin: PR c/5279 from . */ int foo () { extern long long Y; return (0 > Y++); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020109-1.c ================================================ /* This testcase ICEd when 2 different successors of a basic block were successfully threaded and try_forward_edges was not expecting that. */ typedef struct A { struct A *s, *t; unsigned int u; } A; void bar (A *); void foo (A *x, A *y, A *z) { while (y && (((y && y->t && y->t->u) ? y : z)->t == ((x && x->t && x->t->u) ? x : z)->t)) y = y->s; if (y) bar (y); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020109-2.c ================================================ typedef union { unsigned char member3; signed short member4; unsigned int member5; } UNI02; struct srt_dat_t { UNI02 un2; unsigned long member1; signed short member2; }; struct srt_dat_t exsrt1; void extern_test (struct srt_dat_t arg1) { arg1.un2.member3++; arg1.member1++; arg1.member2++; } int main (void) { extern_test (exsrt1); return (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020110.c ================================================ /* Copyright 2002 Free Software Foundation */ /* Make sure the nested extern declaration doesn't conflict with the non-extern one in the enclosing scope. */ void foo() { static long bar; { extern int bar; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020116-1.c ================================================ void noret (void) __attribute__ ((noreturn)); int foo (int, char **); char *a, *b; int d; int main (int argc, char **argv) { register int c; d = 1; while ((c = foo (argc, argv)) != -1) switch (c) { case 's': case 'c': case 'f': a = b; break; case 'v': d = 1; break; case 'V': d = 0; break; } noret (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020120-1.c ================================================ /* This ICEed on IA-32 with -O2 -mcpu=i386, because reload was trying to reload into %sil register. */ struct A { void *a; unsigned int b, c, d; }; struct B { struct A *e; }; void bar (struct A *); void baz (struct A *); static inline unsigned int inl (unsigned int v, unsigned char w, unsigned char x, unsigned char y, unsigned char z) { switch (v) { case 2: return ((w & 0xf8) << 8) | ((x & 0xfc) << 3) | ((y & 0xf8) >> 3); case 4: return (z << 24) | (w << 16) | (x << 8) | y; default: return 0; } } void foo (struct B *x, int y, const float *z) { struct A *a = x->e; if (y) { if (x->e->a) bar (x->e); } else { unsigned char c[4]; unsigned int b; c[0] = z[0]; c[1] = z[1]; c[2] = z[2]; c[3] = z[3]; b = inl (a->b, c[0], c[1], c[2], c[3] ); if (a->a) bar (a); else baz (a); a->c = b; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020121-1.c ================================================ /* This testcase resulted in a 'unrecognizeable insn' on powerpc-linux-gnu because of a missing trunc_int_for_mode in simplify_and_const_int. */ struct display { struct disphist *hstent; int pid; int status; }; struct disphist { struct disphist *next; char *name; int startTries; unsigned rLogin:2, sd_how:2, sd_when:2, lock:1, goodExit:1; char *nuser, *npass, **nargs; }; void StartDisplay (struct display *d) { d->pid = 0; d->status = 0; d->hstent->lock = d->hstent->rLogin = d->hstent->goodExit = d->hstent->sd_how = d->hstent->sd_when = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020129-1.c ================================================ /* Test call to static variable. */ typedef struct { long long a[10]; } A; void bar (A *); typedef int (*B)(int); void foo (void) { static A a; bar (&a); (*(B)&a) (1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020206-1.c ================================================ /* Origin: PR optimization/5429 from Philipp Thomas . */ /* This testcase caused ICE on IA-32 -O2 -march=i686 due to rtl sharing problem in noce_process_if_block. Fixed by http://gcc.gnu.org/ml/gcc-patches/2002-01/msg02146.html. */ typedef struct { unsigned char a; } A; unsigned int foo (A *x) { unsigned char b[2] = { 0, 0 }; unsigned char c = 0; c = (x->a) ? b[1] : b[0]; return (unsigned int) c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020210-1.c ================================================ /* PR c/5615 */ void f(int a, struct {int b[a];} c) {} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020303-1.c ================================================ /* With -fzero-initialized-in-bss, we made I a common symbol instead of a symbol in the .bss section. Not only does that break semantics, but a common symbol can't be weak. */ int i __attribute__((weak)) = 0; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020304-1.c ================================================ /* In 3.0, this test case (extracted from Bigloo) crashes the compiler in bb-reorder.c. This is a regression from 2.95, already fixed in 3.1. Original bug report is c/5830 by Manuel Serrano . */ typedef union scmobj { struct pair { union scmobj *car; union scmobj *cdr; } pair_t; struct vector { long header; int length; union scmobj *obj0; } vector_t; } *obj_t; extern obj_t create_vector (int); extern obj_t make_pair (obj_t, obj_t); extern long bgl_list_length (obj_t); extern int BGl_equalzf3zf3zz__r4_equivalence_6_2z00 (obj_t, obj_t); extern obj_t BGl_evcompilezd2lambdazd2zz__evcompilez00 (obj_t BgL_formalsz00_39, obj_t BgL_bodyz00_40, obj_t BgL_wherez00_41, obj_t BgL_namedzf3zf3_42, obj_t BgL_locz00_43); obj_t BGl_evcompilezd2lambdazd2zz__evcompilez00 (obj_t BgL_formalsz00_39, obj_t BgL_bodyz00_40, obj_t BgL_wherez00_41, obj_t BgL_namedzf3zf3_42, obj_t BgL_locz00_43) { if (BGl_equalzf3zf3zz__r4_equivalence_6_2z00 (BgL_formalsz00_39, ((obj_t) (obj_t) ((long) (((long) (0) << 2) | 2))))) { BgL_tagzd21966zd2_943: if ((BgL_namedzf3zf3_42 != ((obj_t) (obj_t) ((long) (((long) (1) << 2) | 2))))) { obj_t BgL_v1042z00_998; { int BgL_auxz00_4066; BgL_auxz00_4066 = (int) (((long) 3)); BgL_v1042z00_998 = create_vector (BgL_auxz00_4066); } { obj_t BgL_arg1586z00_1000; BgL_arg1586z00_1000 = make_pair (BgL_wherez00_41, BgL_bodyz00_40); { int BgL_auxz00_4070; BgL_auxz00_4070 = (int) (((long) 2)); ((&(((obj_t) (BgL_v1042z00_998))->vector_t.obj0))[BgL_auxz00_4070] = BgL_arg1586z00_1000, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } } { int BgL_auxz00_4073; BgL_auxz00_4073 = (int) (((long) 1)); ((&(((obj_t) (BgL_v1042z00_998))->vector_t.obj0))[BgL_auxz00_4073] = BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { obj_t BgL_auxz00_4078; int BgL_auxz00_4076; { long BgL_auxz00_4079; { long BgL_auxz00_4080; BgL_auxz00_4080 = bgl_list_length (BgL_formalsz00_39); BgL_auxz00_4079 = (BgL_auxz00_4080 + ((long) 37)); } BgL_auxz00_4078 = (obj_t) ((long) (((long) (BgL_auxz00_4079) << 2) | 1)); } BgL_auxz00_4076 = (int) (((long) 0)); ((&(((obj_t) (BgL_v1042z00_998))->vector_t.obj0))[BgL_auxz00_4076] = BgL_auxz00_4078, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } return BgL_v1042z00_998; } else { obj_t BgL_v1043z00_1005; { int BgL_auxz00_4085; BgL_auxz00_4085 = (int) (((long) 3)); BgL_v1043z00_1005 = create_vector (BgL_auxz00_4085); } { int BgL_auxz00_4088; BgL_auxz00_4088 = (int) (((long) 2)); ((&(((obj_t) (BgL_v1043z00_1005))->vector_t.obj0))[BgL_auxz00_4088] = BgL_bodyz00_40, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { int BgL_auxz00_4091; BgL_auxz00_4091 = (int) (((long) 1)); ((&(((obj_t) (BgL_v1043z00_1005))->vector_t.obj0))[BgL_auxz00_4091] = BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { obj_t BgL_auxz00_4096; int BgL_auxz00_4094; { long BgL_auxz00_4097; { long BgL_auxz00_4098; BgL_auxz00_4098 = bgl_list_length (BgL_formalsz00_39); BgL_auxz00_4097 = (BgL_auxz00_4098 + ((long) 42)); } BgL_auxz00_4096 = (obj_t) ((long) (((long) (BgL_auxz00_4097) << 2) | 1)); } BgL_auxz00_4094 = (int) (((long) 0)); ((&(((obj_t) (BgL_v1043z00_1005))->vector_t.obj0))[BgL_auxz00_4094] = BgL_auxz00_4096, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } return BgL_v1043z00_1005; } } else { if (((((long) BgL_formalsz00_39) & ((1 << 2) - 1)) == 3)) { if (BGl_equalzf3zf3zz__r4_equivalence_6_2z00 (((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t).cdr), ((obj_t) (obj_t) ((long) (((long) (0) << 2) | 2))))) { goto BgL_tagzd21966zd2_943; } else { obj_t BgL_cdrzd21979zd2_953; BgL_cdrzd21979zd2_953 = ((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t).cdr); if (((((long) BgL_cdrzd21979zd2_953) & ((1 << 2) - 1)) == 3)) { if (BGl_equalzf3zf3zz__r4_equivalence_6_2z00 (((((obj_t) ((long) BgL_cdrzd21979zd2_953 - 3))->pair_t).cdr), ((obj_t) (obj_t) ((long) (((long) (0) << 2) | 2))))) { goto BgL_tagzd21966zd2_943; } else { obj_t BgL_cdrzd21986zd2_956; BgL_cdrzd21986zd2_956 = ((((obj_t) ((long) BgL_cdrzd21979zd2_953 - 3))->pair_t).cdr); if (((((long) BgL_cdrzd21986zd2_956) & ((1 << 2) - 1)) == 3)) { if (BGl_equalzf3zf3zz__r4_equivalence_6_2z00 (((((obj_t) ((long) BgL_cdrzd21986zd2_956 - 3))->pair_t). cdr), ((obj_t) (obj_t) ((long) (((long) (0) << 2) | 2))))) { goto BgL_tagzd21966zd2_943; } else { obj_t BgL_cdrzd21994zd2_959; { obj_t BgL_auxz00_4120; BgL_auxz00_4120 = ((((obj_t) ((long) BgL_cdrzd21979zd2_953 - 3))->pair_t). cdr); BgL_cdrzd21994zd2_959 = ((((obj_t) ((long) BgL_auxz00_4120 - 3))->pair_t).cdr); } if (((((long) BgL_cdrzd21994zd2_959) & ((1 << 2) - 1)) == 3)) { if (BGl_equalzf3zf3zz__r4_equivalence_6_2z00 (((((obj_t) ((long) BgL_cdrzd21994zd2_959 - 3))-> pair_t).cdr), ((obj_t) (obj_t) ((long) (((long) (0) << 2) | 2))))) { goto BgL_tagzd21966zd2_943; } else { int BgL_testz00_4128; { obj_t BgL_auxz00_4129; BgL_auxz00_4129 = ((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t). car); BgL_testz00_4128 = ((((long) BgL_auxz00_4129) & ((1 << 2) - 1)) == 3); } if (BgL_testz00_4128) { BgL_tagzd21971zd2_948: if ((BgL_namedzf3zf3_42 != ((obj_t) (obj_t) ((long) (((long) (1) << 2) | 2))))) { obj_t BgL_v1052z00_1026; { int BgL_auxz00_4134; BgL_auxz00_4134 = (int) (((long) 3)); BgL_v1052z00_1026 = create_vector (BgL_auxz00_4134); } { obj_t BgL_arg1606z00_1028; { obj_t BgL_v1053z00_1029; { int BgL_auxz00_4137; BgL_auxz00_4137 = (int) (((long) 3)); BgL_v1053z00_1029 = create_vector (BgL_auxz00_4137); } { int BgL_auxz00_4140; BgL_auxz00_4140 = (int) (((long) 2)); ((& (((obj_t) (BgL_v1053z00_1029))->vector_t. obj0))[BgL_auxz00_4140] = BgL_formalsz00_39, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { int BgL_auxz00_4143; BgL_auxz00_4143 = (int) (((long) 1)); ((& (((obj_t) (BgL_v1053z00_1029))->vector_t. obj0))[BgL_auxz00_4143] = BgL_bodyz00_40, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { int BgL_auxz00_4146; BgL_auxz00_4146 = (int) (((long) 0)); ((& (((obj_t) (BgL_v1053z00_1029))->vector_t. obj0))[BgL_auxz00_4146] = BgL_wherez00_41, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } BgL_arg1606z00_1028 = BgL_v1053z00_1029; } { int BgL_auxz00_4149; BgL_auxz00_4149 = (int) (((long) 2)); ((&(((obj_t) (BgL_v1052z00_1026))->vector_t.obj0)) [BgL_auxz00_4149] = BgL_arg1606z00_1028, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } } { int BgL_auxz00_4152; BgL_auxz00_4152 = (int) (((long) 1)); ((&(((obj_t) (BgL_v1052z00_1026))->vector_t.obj0)) [BgL_auxz00_4152] = BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { obj_t BgL_auxz00_4157; int BgL_auxz00_4155; BgL_auxz00_4157 = (obj_t) ((long) (((long) (((long) 55)) << 2) | 1)); BgL_auxz00_4155 = (int) (((long) 0)); ((&(((obj_t) (BgL_v1052z00_1026))->vector_t.obj0)) [BgL_auxz00_4155] = BgL_auxz00_4157, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } return BgL_v1052z00_1026; } else { obj_t BgL_v1054z00_1030; { int BgL_auxz00_4160; BgL_auxz00_4160 = (int) (((long) 3)); BgL_v1054z00_1030 = create_vector (BgL_auxz00_4160); } { obj_t BgL_arg1608z00_1032; BgL_arg1608z00_1032 = make_pair (BgL_bodyz00_40, BgL_formalsz00_39); { int BgL_auxz00_4164; BgL_auxz00_4164 = (int) (((long) 2)); ((&(((obj_t) (BgL_v1054z00_1030))->vector_t.obj0)) [BgL_auxz00_4164] = BgL_arg1608z00_1032, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } } { int BgL_auxz00_4167; BgL_auxz00_4167 = (int) (((long) 1)); ((&(((obj_t) (BgL_v1054z00_1030))->vector_t.obj0)) [BgL_auxz00_4167] = BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { obj_t BgL_auxz00_4172; int BgL_auxz00_4170; BgL_auxz00_4172 = (obj_t) ((long) (((long) (((long) 56)) << 2) | 1)); BgL_auxz00_4170 = (int) (((long) 0)); ((&(((obj_t) (BgL_v1054z00_1030))->vector_t.obj0)) [BgL_auxz00_4170] = BgL_auxz00_4172, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } return BgL_v1054z00_1030; } } else { int BgL_testz00_4175; { obj_t BgL_auxz00_4176; { obj_t BgL_auxz00_4177; BgL_auxz00_4177 = ((((obj_t) ((long) BgL_formalsz00_39 - 3))-> pair_t).cdr); BgL_auxz00_4176 = ((((obj_t) ((long) BgL_auxz00_4177 - 3))->pair_t). car); } BgL_testz00_4175 = ((((long) BgL_auxz00_4176) & ((1 << 2) - 1)) == 3); } if (BgL_testz00_4175) { goto BgL_tagzd21971zd2_948; } else { int BgL_testz00_4181; { obj_t BgL_auxz00_4182; { obj_t BgL_auxz00_4183; { obj_t BgL_auxz00_4184; BgL_auxz00_4184 = ((((obj_t) ((long) BgL_formalsz00_39 - 3))-> pair_t).cdr); BgL_auxz00_4183 = ((((obj_t) ((long) BgL_auxz00_4184 - 3))-> pair_t).cdr); } BgL_auxz00_4182 = ((((obj_t) ((long) BgL_auxz00_4183 - 3))-> pair_t).car); } BgL_testz00_4181 = ((((long) BgL_auxz00_4182) & ((1 << 2) - 1)) == 3); } if (BgL_testz00_4181) { goto BgL_tagzd21971zd2_948; } else { goto BgL_tagzd21971zd2_948; } } } } } else { int BgL_testz00_4189; { obj_t BgL_auxz00_4190; BgL_auxz00_4190 = ((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t). car); BgL_testz00_4189 = ((((long) BgL_auxz00_4190) & ((1 << 2) - 1)) == 3); } if (BgL_testz00_4189) { goto BgL_tagzd21971zd2_948; } else { int BgL_testz00_4193; { obj_t BgL_auxz00_4194; { obj_t BgL_auxz00_4195; BgL_auxz00_4195 = ((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t). cdr); BgL_auxz00_4194 = ((((obj_t) ((long) BgL_auxz00_4195 - 3))->pair_t). car); } BgL_testz00_4193 = ((((long) BgL_auxz00_4194) & ((1 << 2) - 1)) == 3); } if (BgL_testz00_4193) { goto BgL_tagzd21971zd2_948; } else { int BgL_testz00_4199; { obj_t BgL_auxz00_4200; { obj_t BgL_auxz00_4201; { obj_t BgL_auxz00_4202; BgL_auxz00_4202 = ((((obj_t) ((long) BgL_formalsz00_39 - 3))-> pair_t).cdr); BgL_auxz00_4201 = ((((obj_t) ((long) BgL_auxz00_4202 - 3))-> pair_t).cdr); } BgL_auxz00_4200 = ((((obj_t) ((long) BgL_auxz00_4201 - 3))->pair_t). car); } BgL_testz00_4199 = ((((long) BgL_auxz00_4200) & ((1 << 2) - 1)) == 3); } if (BgL_testz00_4199) { goto BgL_tagzd21971zd2_948; } else { if ((BgL_namedzf3zf3_42 != ((obj_t) (obj_t) ((long) (((long) (1) << 2) | 2))))) { obj_t BgL_v1050z00_1022; { int BgL_auxz00_4209; BgL_auxz00_4209 = (int) (((long) 3)); BgL_v1050z00_1022 = create_vector (BgL_auxz00_4209); } { obj_t BgL_arg1604z00_1024; BgL_arg1604z00_1024 = make_pair (BgL_wherez00_41, BgL_bodyz00_40); { int BgL_auxz00_4213; BgL_auxz00_4213 = (int) (((long) 2)); ((& (((obj_t) (BgL_v1050z00_1022))->vector_t. obj0))[BgL_auxz00_4213] = BgL_arg1604z00_1024, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } } { int BgL_auxz00_4216; BgL_auxz00_4216 = (int) (((long) 1)); ((&(((obj_t) (BgL_v1050z00_1022))->vector_t.obj0)) [BgL_auxz00_4216] = BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { obj_t BgL_auxz00_4221; int BgL_auxz00_4219; BgL_auxz00_4221 = (obj_t) ((long) (((long) (((long) 50)) << 2) | 1)); BgL_auxz00_4219 = (int) (((long) 0)); ((&(((obj_t) (BgL_v1050z00_1022))->vector_t.obj0)) [BgL_auxz00_4219] = BgL_auxz00_4221, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } return BgL_v1050z00_1022; } else { obj_t BgL_v1051z00_1025; { int BgL_auxz00_4224; BgL_auxz00_4224 = (int) (((long) 3)); BgL_v1051z00_1025 = create_vector (BgL_auxz00_4224); } { int BgL_auxz00_4227; BgL_auxz00_4227 = (int) (((long) 2)); ((&(((obj_t) (BgL_v1051z00_1025))->vector_t.obj0)) [BgL_auxz00_4227] = BgL_bodyz00_40, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { int BgL_auxz00_4230; BgL_auxz00_4230 = (int) (((long) 1)); ((&(((obj_t) (BgL_v1051z00_1025))->vector_t.obj0)) [BgL_auxz00_4230] = BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { obj_t BgL_auxz00_4235; int BgL_auxz00_4233; BgL_auxz00_4235 = (obj_t) ((long) (((long) (((long) 54)) << 2) | 1)); BgL_auxz00_4233 = (int) (((long) 0)); ((&(((obj_t) (BgL_v1051z00_1025))->vector_t.obj0)) [BgL_auxz00_4233] = BgL_auxz00_4235, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } return BgL_v1051z00_1025; } } } } } } } else { int BgL_testz00_4238; { obj_t BgL_auxz00_4239; BgL_auxz00_4239 = ((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t).car); BgL_testz00_4238 = ((((long) BgL_auxz00_4239) & ((1 << 2) - 1)) == 3); } if (BgL_testz00_4238) { goto BgL_tagzd21971zd2_948; } else { int BgL_testz00_4242; { obj_t BgL_auxz00_4243; BgL_auxz00_4243 = ((((obj_t) ((long) BgL_cdrzd21979zd2_953 - 3))->pair_t). car); BgL_testz00_4242 = ((((long) BgL_auxz00_4243) & ((1 << 2) - 1)) == 3); } if (BgL_testz00_4242) { goto BgL_tagzd21971zd2_948; } else { if ((BgL_namedzf3zf3_42 != ((obj_t) (obj_t) ((long) (((long) (1) << 2) | 2))))) { obj_t BgL_v1048z00_1018; { int BgL_auxz00_4248; BgL_auxz00_4248 = (int) (((long) 3)); BgL_v1048z00_1018 = create_vector (BgL_auxz00_4248); } { obj_t BgL_arg1602z00_1020; BgL_arg1602z00_1020 = make_pair (BgL_wherez00_41, BgL_bodyz00_40); { int BgL_auxz00_4252; BgL_auxz00_4252 = (int) (((long) 2)); ((&(((obj_t) (BgL_v1048z00_1018))->vector_t.obj0)) [BgL_auxz00_4252] = BgL_arg1602z00_1020, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } } { int BgL_auxz00_4255; BgL_auxz00_4255 = (int) (((long) 1)); ((&(((obj_t) (BgL_v1048z00_1018))->vector_t.obj0)) [BgL_auxz00_4255] = BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { obj_t BgL_auxz00_4260; int BgL_auxz00_4258; BgL_auxz00_4260 = (obj_t) ((long) (((long) (((long) 49)) << 2) | 1)); BgL_auxz00_4258 = (int) (((long) 0)); ((&(((obj_t) (BgL_v1048z00_1018))->vector_t.obj0)) [BgL_auxz00_4258] = BgL_auxz00_4260, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } return BgL_v1048z00_1018; } else { obj_t BgL_v1049z00_1021; { int BgL_auxz00_4263; BgL_auxz00_4263 = (int) (((long) 3)); BgL_v1049z00_1021 = create_vector (BgL_auxz00_4263); } { int BgL_auxz00_4266; BgL_auxz00_4266 = (int) (((long) 2)); ((&(((obj_t) (BgL_v1049z00_1021))->vector_t.obj0)) [BgL_auxz00_4266] = BgL_bodyz00_40, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { int BgL_auxz00_4269; BgL_auxz00_4269 = (int) (((long) 1)); ((&(((obj_t) (BgL_v1049z00_1021))->vector_t.obj0)) [BgL_auxz00_4269] = BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { obj_t BgL_auxz00_4274; int BgL_auxz00_4272; BgL_auxz00_4274 = (obj_t) ((long) (((long) (((long) 53)) << 2) | 1)); BgL_auxz00_4272 = (int) (((long) 0)); ((&(((obj_t) (BgL_v1049z00_1021))->vector_t.obj0)) [BgL_auxz00_4272] = BgL_auxz00_4274, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } return BgL_v1049z00_1021; } } } } } } else { int BgL_testz00_4277; { obj_t BgL_auxz00_4278; BgL_auxz00_4278 = ((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t).car); BgL_testz00_4277 = ((((long) BgL_auxz00_4278) & ((1 << 2) - 1)) == 3); } if (BgL_testz00_4277) { goto BgL_tagzd21971zd2_948; } else { if ((BgL_namedzf3zf3_42 != ((obj_t) (obj_t) ((long) (((long) (1) << 2) | 2))))) { obj_t BgL_v1046z00_1014; { int BgL_auxz00_4283; BgL_auxz00_4283 = (int) (((long) 3)); BgL_v1046z00_1014 = create_vector (BgL_auxz00_4283); } { obj_t BgL_arg1600z00_1016; BgL_arg1600z00_1016 = make_pair (BgL_wherez00_41, BgL_bodyz00_40); { int BgL_auxz00_4287; BgL_auxz00_4287 = (int) (((long) 2)); ((&(((obj_t) (BgL_v1046z00_1014))->vector_t.obj0)) [BgL_auxz00_4287] = BgL_arg1600z00_1016, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } } { int BgL_auxz00_4290; BgL_auxz00_4290 = (int) (((long) 1)); ((&(((obj_t) (BgL_v1046z00_1014))->vector_t.obj0)) [BgL_auxz00_4290] = BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { obj_t BgL_auxz00_4295; int BgL_auxz00_4293; BgL_auxz00_4295 = (obj_t) ((long) (((long) (((long) 48)) << 2) | 1)); BgL_auxz00_4293 = (int) (((long) 0)); ((&(((obj_t) (BgL_v1046z00_1014))->vector_t.obj0)) [BgL_auxz00_4293] = BgL_auxz00_4295, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } return BgL_v1046z00_1014; } else { obj_t BgL_v1047z00_1017; { int BgL_auxz00_4298; BgL_auxz00_4298 = (int) (((long) 3)); BgL_v1047z00_1017 = create_vector (BgL_auxz00_4298); } { int BgL_auxz00_4301; BgL_auxz00_4301 = (int) (((long) 2)); ((&(((obj_t) (BgL_v1047z00_1017))->vector_t.obj0)) [BgL_auxz00_4301] = BgL_bodyz00_40, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { int BgL_auxz00_4304; BgL_auxz00_4304 = (int) (((long) 1)); ((&(((obj_t) (BgL_v1047z00_1017))->vector_t.obj0)) [BgL_auxz00_4304] = BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { obj_t BgL_auxz00_4309; int BgL_auxz00_4307; BgL_auxz00_4309 = (obj_t) ((long) (((long) (((long) 52)) << 2) | 1)); BgL_auxz00_4307 = (int) (((long) 0)); ((&(((obj_t) (BgL_v1047z00_1017))->vector_t.obj0)) [BgL_auxz00_4307] = BgL_auxz00_4309, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } return BgL_v1047z00_1017; } } } } } else { if ((BgL_namedzf3zf3_42 != ((obj_t) (obj_t) ((long) (((long) (1) << 2) | 2))))) { obj_t BgL_v1044z00_1010; { int BgL_auxz00_4314; BgL_auxz00_4314 = (int) (((long) 3)); BgL_v1044z00_1010 = create_vector (BgL_auxz00_4314); } { obj_t BgL_arg1598z00_1012; BgL_arg1598z00_1012 = make_pair (BgL_wherez00_41, BgL_bodyz00_40); { int BgL_auxz00_4318; BgL_auxz00_4318 = (int) (((long) 2)); ((&(((obj_t) (BgL_v1044z00_1010))->vector_t.obj0)) [BgL_auxz00_4318] = BgL_arg1598z00_1012, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } } { int BgL_auxz00_4321; BgL_auxz00_4321 = (int) (((long) 1)); ((&(((obj_t) (BgL_v1044z00_1010))->vector_t.obj0))[BgL_auxz00_4321] = BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { obj_t BgL_auxz00_4326; int BgL_auxz00_4324; BgL_auxz00_4326 = (obj_t) ((long) (((long) (((long) 47)) << 2) | 1)); BgL_auxz00_4324 = (int) (((long) 0)); ((&(((obj_t) (BgL_v1044z00_1010))->vector_t.obj0))[BgL_auxz00_4324] = BgL_auxz00_4326, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } return BgL_v1044z00_1010; } else { obj_t BgL_v1045z00_1013; { int BgL_auxz00_4329; BgL_auxz00_4329 = (int) (((long) 3)); BgL_v1045z00_1013 = create_vector (BgL_auxz00_4329); } { int BgL_auxz00_4332; BgL_auxz00_4332 = (int) (((long) 2)); ((&(((obj_t) (BgL_v1045z00_1013))->vector_t.obj0))[BgL_auxz00_4332] = BgL_bodyz00_40, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { int BgL_auxz00_4335; BgL_auxz00_4335 = (int) (((long) 1)); ((&(((obj_t) (BgL_v1045z00_1013))->vector_t.obj0))[BgL_auxz00_4335] = BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } { obj_t BgL_auxz00_4340; int BgL_auxz00_4338; BgL_auxz00_4340 = (obj_t) ((long) (((long) (((long) 51)) << 2) | 1)); BgL_auxz00_4338 = (int) (((long) 0)); ((&(((obj_t) (BgL_v1045z00_1013))->vector_t.obj0))[BgL_auxz00_4338] = BgL_auxz00_4340, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); } return BgL_v1045z00_1013; } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020304-2.c ================================================ /* This testcase ICEd because a SUBREG of MEM/v was never simplified. */ volatile unsigned long long *a; unsigned char foo (void) { unsigned char b = (*a != 0); return b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020309-1.c ================================================ int sub1 (char *p, int i) { char j = p[i]; { void sub2 () { i = 2; p = p + 2; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020309-2.c ================================================ /* This testcase ICEd on IA-32 at -O2, because loop was calling convert_modes between a MODE_FLOAT and MODE_INT class modes. */ typedef union { double d; long long ll; } A; void foo (A x, A **y, A z) { for (; *y; y++) if (x.ll == 262 && (*y)->d == z.d) break; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020312-1.c ================================================ /* { dg-do assemble } */ /* { dg-skip-if "" { pdp11-*-* } { "-O0" } { "" } } */ /* PR optimization/5892 */ typedef struct { unsigned long a; unsigned int b, c; } A; typedef struct { unsigned long a; A *b; int c; } B; static inline unsigned int bar (unsigned int x) { unsigned long r; asm ("" : "=r" (r) : "0" (x)); return r >> 31; } int foo (B *x) { A *y; y = x->b; y->b = bar (x->c); y->c = ({ unsigned int z = 1; (z << 24) | (z >> 24); }); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020314-1.c ================================================ typedef struct tux_req_struct tux_req_t; struct tux_req_struct { struct socket *sock; char usermode; char *userbuf; unsigned int userlen; char error; void *private; }; void user_send_buffer (tux_req_t *req, int cachemiss) { int ret; repeat: switch (ret) { case -11: if (add_output_space_event(req, req->sock)) { del_tux_atom(req); goto repeat; } do { } while (0); break; default: add_req_to_workqueue(req); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020315-1.c ================================================ /* PR bootstrap/4128 */ extern int bar (char *, char *, int, int); extern long baz (char *, char *, int, int); int sgt (char *a, char *b, int c, int d) { return bar (a, b, c, d) > 0; } long dgt (char *a, char *b, int c, int d) { return baz (a, b, c, d) > 0; } int sne (char *a, char *b, int c, int d) { return bar (a, b, c, d) != 0; } long dne (char *a, char *b, int c, int d) { return baz (a, b, c, d) != 0; } int seq (char *a, char *b, int c, int d) { return bar (a, b, c, d) == 0; } long deq (char *a, char *b, int c, int d) { return baz (a, b, c, d) == 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020318-1.c ================================================ /* PR c/5656 This testcase ICEd on IA-32 at -O3, due to tree inliner not converting parameter assignment when using K&R syntax. */ void foo (c) char c; { (void) &c; } int bar (void); void baz (void) { foo (bar ()); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020319-1.c ================================================ /* This testcase ICEd in combine.c:do_SUBST() self-test for sign-extended CONST_INT because expr.c:expand_expr() was not sign-extending array index into constant strings. */ typedef unsigned char uch; extern uch outbuf[]; extern unsigned outcnt; extern void flush_outbuf (void); int zip(void) { outcnt = 0; {outbuf[outcnt++]=(uch)("\037\213"[0]); if (outcnt==16384) flush_outbuf();}; {outbuf[outcnt++]=(uch)("\037\213"[1]); if (outcnt==16384) flush_outbuf();}; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020320-1.c ================================================ /* PR bootstrap/4192 This testcase caused infinite loop in flow (several places), because flow assumes gen_jump generates simple_jump_p. */ typedef void (*T) (void); extern T x[]; void foo (void) { static T *p = x; static _Bool a; T f; if (__builtin_expect (a, 0)) return; while ((f = *p)) { p++; f (); } a = 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020323-1.c ================================================ /* This testcase caused ICE on powerpc at -O3, because regrename did not handle match_dup of match_operator if the RTLs were not shared. */ struct A { unsigned char *a0, *a1; int a2; }; void bar (struct A *); unsigned int foo (int x) { struct A a; unsigned int b; if (x < -128 || x > 255 || x == -1) return 26; a.a0 = (unsigned char *) &b; a.a1 = a.a0 + sizeof (unsigned int); a.a2 = 0; bar (&a); return b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020330-1.c ================================================ /* PR 5446 */ /* This testcase is similar to gcc.c-torture/compile/20011219-1.c except with parts of it omitted, causing an ICE with -O3 on IA-64. */ void * baz (unsigned long); static inline double ** bar (long w, long x, long y, long z) { long i, a = x - w + 1, b = z - y + 1; double **m = (double **) baz (sizeof (double *) * (a + 1)); m += 1; m -= w; m[w] = (double *) baz (sizeof (double) * (a * b + 1)); for (i = w + 1; i <= x; i++) m[i] = m[i - 1] + b; return m; } void foo (double w[], int x, double y[], double z[]) { int i; double **a; a = bar (1, 50, 1, 50); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020409-1.c ================================================ /* PR c/5078 */ #include int f(int i) { i -= 2 * (INT_MAX + 1); return i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020415-1.c ================================================ /* Check that floating point casts of integer operations don't ICE. */ /* The first of these routines caused problems for a patch, that wasn't otherwise caught by a full bootstrap, the regression test suite or SPEC CPU2000. */ double andop (unsigned int x) { return x & 1; } double orop (unsigned int x) { return x | 1; } double notop (unsigned int x) { return ~x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020418-1.c ================================================ /* PR c/6358 This testcase ICEd on IA-32 in foo, because current_function_return_rtx was assigned a hard register only after expand_null_return was called, thus return pseudo was clobbered twice and the hard register not at all. */ void baz (void); double foo (void) { baz (); return; } double bar (void) { baz (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020530-1.c ================================================ /* PR optimization/6822 */ extern unsigned char foo1 (void); extern unsigned short foo2 (void); int bar1 (void) { unsigned char q = foo1 (); return (q < 0x80) ? 64 : 0; } int bar2 (void) { unsigned short h = foo2 (); return (h < 0x8000) ? 64 : 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020604-1.c ================================================ /* { dg-do assemble } */ /* { dg-require-effective-target ptr32plus } */ /* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" "-mn" } { "" } } */ /* PR c/6957 This testcase ICEd at -O2 on IA-32, because (insn 141 139 142 (set (subreg:SF (reg:QI 72) 0) (plus:SF (reg:SF 73) (reg:SF 76))) 525 {*fop_sf_comm_nosse} (insn_list 134 (nil)) (expr_list:REG_DEAD (reg:SF 73) (nil))) couldn't be reloaded. */ void foo (unsigned int n, int x, int y, unsigned char *z) { int a, b; float c[2048][4]; switch (x) { case 0x1906: a = b = -1; break; case 0x190A: a = b = -1; break; case 0x8049: a = b = -1; break; case 0x1907: a = 1; b = 2; break; default: return; } if (a >= 0) { unsigned char *d = z; unsigned int i; for (i = 0; i < n; i++) { do { union { float r; unsigned int i; } e; e.r = c[i][1]; d[a] = ((e.i >= 0x3f7f0000) ? ((int) e.i < 0) ? (unsigned char) 0 : (unsigned char) 255 : (e.r = e.r * (255.0F / 256.0F) + 32768.0F, (unsigned char) e.i)); } while (0); d += y; } } if (b >= 0) { unsigned char *d = z; unsigned int i; for (i = 0; i < n; i++) { do { union { float r; unsigned int i; } e; e.r = c[i][2]; d[b] = ((e.i >= 0x3f7f0000) ? ((int) e.i < 0) ? (unsigned char) 0 : (unsigned char) 255 : (e.r = e.r * (255.0F / 256.0F) + 32768.0F, (unsigned char) e.i)); } while (0); d += y; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020605-1.c ================================================ /* This testcase caused on IA-32 -O2 endless loop in merge_blocks when trying to merge a basic block with itself. */ void f (void) { char *c; do { if (c) break; } while (1); if (!c) while (1) f (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020701-1.c ================================================ /* PR target/7177 Problem with cris-axis-elf: ICE in global. Origin: hp@axis.com. */ typedef __SIZE_TYPE__ size_t; void f1 (void *); char *f2 (const char *); int atoi (const char *); char *strchr (const char *, int); int strcmp (const char *, const char *); size_t strlen (const char *); typedef enum { A, B, C } t1; extern const char _v[]; static t1 f (const char* p1, const char* p2, char p3) { char *v1; char *v2; char *a; char *v3; char *v4; char *v5; char *e; char *v6; t1 r = C; v1 = f2 (p2); v4 = f2 (p1); a = v2 = v1; e = v5 = v4; memcpy (&e, &e, sizeof (e)); v3 = strchr (v2, ','); v6 = strchr (v5, ','); while ((_v + 1)[(unsigned) *a] & 4) a++; while ((_v + 1)[(unsigned) *e] & 4) e++; if (a == v3 && e == v6) { if (p3) r = atoi (v5) < atoi (v2) ? B : A; else r = atoi (v5) > atoi (v2) ? B : A; v2 = ++a; v5 = ++e; v3 = strchr (v2, ','); v6 = strchr (v5, ','); while ((_v + 1)[(unsigned) *a] & 4) a++; while ((_v + 1)[(unsigned) *e] & 4) e++; if (a == v3 && e == v6) { if (r == B) r = B; else if (p3) r = atoi (v5) < atoi (v2) ? B : A; else r = atoi (v5) > atoi (v2) ? B : A; } else r = C; } f1 (v1); f1 (v4); return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020706-1.c ================================================ // Contributed by Alexandre Oliva // From Red Hat case 106165. typedef struct s1 { unsigned short v1; unsigned char *v2; } S1; extern void bar(const struct s1 *const hdb); extern unsigned char* foo (); unsigned int sn; S1 *hdb; S1 *pb; unsigned short len; unsigned int crashIt() { unsigned char *p; unsigned int nsn; unsigned short cnt; if (sn != 0) return 1; if ((len < 12) || ((p = (((pb->v1) >= 8) ? pb->v2 : foo() )) == 0)) return 1; nsn = ( (((*(unsigned int*)p) & 0x000000ff) << 24) | (((*(unsigned int*)p) & 0x0000ff00) << 8) | (((*(unsigned int*)p) & 0x00ff0000) >> 8) | (((*(unsigned int*)p) & 0xff000000) >> 24) ); p += 4; cnt = (unsigned short) (( (((*(unsigned int*)p) & 0x000000ff) << 24) | (((*(unsigned int*)p) & 0x0000ff00) << 8) | (((*(unsigned int*)p) & 0x00ff0000) >> 8) | (((*(unsigned int*)p) & 0xff000000) >> 24) ) & 0xffff); if ((len != 12 + (cnt * 56)) || (nsn == 0)) { bar(hdb); return 1; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020706-2.c ================================================ // Contributed by Alexandre Oliva // From Red Hat case 106165. typedef unsigned short (FUNC_P) (void *, unsigned char *, unsigned short); void crashIt(int id, FUNC_P *func, unsigned char *funcparm) { unsigned char buff[5], reverse[4]; unsigned char *bp = buff; unsigned char *rp = reverse; unsigned short int count = 0; unsigned short cnt; while (id > 0) { *rp++ = (unsigned char) (id & 0x7F); id >>= 7; count++; } cnt = count + 1; while ((count--) > 1) { *bp++ = (unsigned char)(*(--rp) | 0x80); } *bp++ = *(--rp); (void)(*func)(funcparm, buff, cnt); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020709-1.c ================================================ extern double atof (__const char *__nptr) __attribute__ ((__pure__)); void bar (char *s) { union {double val; unsigned int a, b;} u; u.val = atof (s); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020710-1.c ================================================ /* Red Hat bugzilla #68395 PR middle-end/7245 This testcase ICEd on IA-32 because shift & compare patterns predicates allowed any immediate, but constraints allowed only numbers from 1 to 31. */ void foo (int *x, unsigned int y) { int a = y >> -13; if (a) *x = a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020715-1.c ================================================ /* PR optimization/7153 */ /* Verify that GCC doesn't promote a register when its lifetime is not limited to one basic block. */ void f(char); void g(void); void scale(void) { int width; char bytes; char *src; if (width) { bytes = *src; g(); width *= bytes; } f(bytes); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020807-1.c ================================================ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ int x; static int __attribute__ ((noinline)) foo (void) { return 0; } static void __attribute__ ((noinline)) bar (void) { } static inline void baz (void) { char arr[x]; lab: if (foo () == -1) { bar (); goto lab; } } void test (void) { baz (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020910-1.c ================================================ /* The bit-field below would have a problem if __INT_MAX__ is too small. */ #if __INT_MAX__ < 2147483647 int a; #else unsigned int x0 = 0; typedef struct { unsigned int field1 : 20; unsigned int field2 : 12; } XX; static XX yy; static void foo (void) { yy.field1 = (unsigned int ) (&x0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020926-1.c ================================================ /* PR c/7160 */ /* Verify that the register-to-stack converter properly handles branches without return value containing function calls. */ extern int gi; extern int foo1(int, int); extern void foo2(int, int); extern float foo3(int); float bar(int i1, int i2) { int i3; if (i2) { i3 = foo1(i1, gi); foo2(i1, i3); } else return foo3(i2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020927-1.c ================================================ /* PR optimization/7520 */ /* ICE at -O3 on x86 due to register life problems caused by the return-without-value in bar. */ int foo () { int i; long long int j; while (1) { if (j & 1) ++i; j >>= 1; if (j) return i; } } int bar () { if (foo ()) return; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20020930-1.c ================================================ /* PR c/8002 */ float expm1f(float x) { union { float value; unsigned word; } sf_u; sf_u.word = (unsigned) x * 2; return x + sf_u.value; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021001-1.c ================================================ int foo (double x, double y) { return !__builtin_isunordered (x, y); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021007-1.c ================================================ /* PR c/7411 */ /* Verify that GCC simplifies the null addition to i before virtual register substitution tries it and winds up with a memory to memory move. */ void foo () { int i = 0,j; i+=j=0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021008-1.c ================================================ /* Origin: PR target/7434 Gwenole Beauchesne */ int main(void) { static const int align_g[] = { 1, 2, 4, 8, 16 }; char * buf; int i = 0; volatile long double val = 0; val = *((long double *)(buf + align_g[i])); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021015-1.c ================================================ /* PR target/7370. */ int g (int *x, int *y); void f () { int x, y; char a[4000]; g (&x, &y); x = x/y + x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021015-2.c ================================================ /* PR target/8232. */ /* { dg-require-effective-target untyped_assembly } */ int f (char *p, char *q, int i) { return bcmp (p, q, i); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021103-1.c ================================================ /* PR middle-end/8408 */ /* Verify that the recognizer explicitly handles ADDRESSOF operands. */ void foo(void) { double d1 = 3.14159, d2; if (&d2 == &d1) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021108-1.c ================================================ /* { dg-require-effective-target label_values } */ int main() { l1: return &&l1-&&l2; l2:; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021110.c ================================================ /* PR c/8439 */ /* Verify that GCC properly handles null increments. */ struct empty { }; void foo(struct empty *p) { p++; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021119-1.c ================================================ /* PR c/8588 */ /* Contributed by Volker Reichelt. */ /* Verify that GCC converts integer constants in shift operations. */ void foo() { unsigned int i, j; j = (i >> 0xf0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021120-1.c ================================================ /* PR c/8518 */ /* Contributed by Volker Reichelt. */ /* Verify that GCC doesn't get confused by the redefinition of an extern inline function. */ /* { dg-options "-fgnu89-inline" } */ extern int inline foo () { return 0; } extern int inline bar () { return 0; } static int inline bar () { return foo(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021120-2.c ================================================ /* PR c/8518 */ /* Contributed by Volker Reichelt. */ /* Verify that GCC doesn't get confused by the redefinition of an extern inline function. */ /* { dg-options "-fgnu89-inline" } */ extern int inline foo () { return 0; } extern int inline bar () { return 0; } static int bar () { return foo(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021124-1.c ================================================ /* PR optimization/8275 */ /* Contributed by Volker Reichelt. */ unsigned int foo (unsigned int u) { return (u >> 32) & 0xffff; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021204-1.c ================================================ /* PR c/7622 */ /* Verify that GCC can handle the mix of extern inline and nested functions. */ extern inline int t() { int q() { return 0; } return q(); } int foo() { return t(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021205-1.c ================================================ typedef struct x x; extern void *baz(char *); struct x { char * (*bar) (int); }; static x **foo() { return ((x**)baz(0)); } int xyzzy() { baz((*foo())->bar(0)); return 3; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021212-1.c ================================================ /* PR optimization/8334 */ /* Verify that GCC produces valid operands after simplifying an addition. */ void foo(int m, int n, double *f) { int i, j, k = 1; for (j = 0; j < n; j++) { for (i = k; i < m; i++) { f[i] = (double) (i * j); f[i + j] = (double) ((i + 1) * j); } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20021230-1.c ================================================ /* SH has special handling for combined and/shift sequences. Make sure that it behaves properly when one input is in the MACL register. */ int r, t; static void initRGB() { t = ((r*255/3) & 0xff) << 16; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030109-1.c ================================================ void foo () { int x1, x2, x3; bar (&x2 - &x1, &x3 - &x2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030110-1.c ================================================ extern char bpp; void foo() { if (bpp == 32) { if (2 < 8) { do { while (inb(0x9ae8) & (0x0100 >> (2 +1))); } while(0); } else { do { while (inb(0x9ae8) & (0x0100 >> (2))); } while(0); } } else do { while (inb(0x9ae8) & (0x0100 >> (1))); } while(0); if (8 < 8) { do { while (inb(0x9ae8) & (0x0100 >> (8 +1))); } while(0); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030125-1.c ================================================ int count; int func(int *valp) { int val, locked = 0; while ((val = *valp) != 0) { if (count) { if (count) locked = 1; else locked = 1; if (!locked) continue; } if (!count) count--; break; } return val; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030206-1.c ================================================ /* PR c/9530 */ /* Contributed by Volker Reichelt. */ /* Verify that the call to 'foo' is not turned into a sibling call. */ void foo(float d); float bar(float d); float baz(float d) { foo(bar(d)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030216-1.c ================================================ /* PR c/8086 */ #define P(x) \ (((((((((((((((((((((((((((((((( \ (x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) \ *(x)+a) int polynomial(int a) { return P(3); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030219-1.c ================================================ int global_one; void clobber_register() { *(volatile unsigned char *)(0xE0000000 * global_one) = 0x00; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030220-1.c ================================================ /* PR optimization/9768 */ /* Originator: Randolph Chung */ inline int fixfloor (long x) { if (x >= 0) return (x >> 16); else return ~((~x) >> 16); } inline int fixtoi (long x) { return fixfloor(x) + ((x & 0x8000) >> 15); } int foo(long x, long y) { return fixtoi(x*y); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030224-1.c ================================================ /* { dg-require-effective-target alloca } */ void zzz (char *s1, char *s2, int len, int *q) { int z = 5; unsigned int i, b; struct { char a[z]; } x; for (i = 0; i < len; i++) s1[i] = s2[i]; b = z & 0x3; len += (b == 0 ? 0 : 1) + z; *q = len; foo (x, x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030305-1.c ================================================ /* PR c/9799 */ /* Verify that GCC doesn't crash on excess elements in initializer for a flexible array member. */ typedef struct { int aaa; } s1_t; typedef struct { int bbb; s1_t s1_array[]; } s2_t; static s2_t s2_array[]= { { 1, 4 }, /* { dg-error "(initialization of flexible array member|near)" } */ { 2, 5 }, /* { dg-error "(initialization of flexible array member|near)" } */ { 3, 6 } /* { dg-error "(initialization of flexible array member|near)" } */ }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030310-1.c ================================================ static inline void foo (char accept) { char s; while (s == accept) ; } static void bar (void) { char ch; foo (ch); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030314-1.c ================================================ /* PR optimization/8396 */ /* Originator: */ /* Verify that the tree inliner doesn't mess up the types when passing the value of read-only constant arguments. */ static inline bar(const short int xs, const short int xe) { if (xe && (xs < xe)) ; } void f() { short int xe; bar(0, xe); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030319-1.c ================================================ /* PR 10073 */ typedef struct { unsigned short digits[4]; } INT_64; INT_64 int_64_com (INT_64 a) { a.digits[0] ^= 0xFFFF; a.digits[1] ^= 0xFFFF; a.digits[2] ^= 0xFFFF; a.digits[3] ^= 0xFFFF; return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030320-1.c ================================================ /* Failed on powerpc64-linux with a segfault due to ifcvt generating conditional returns without updating dominance info. Extracted from glibc's dl-load.c. */ typedef __SIZE_TYPE__ size_t; static size_t is_dst (const char *start, const char *name, const char *str, int is_path, int secure) { size_t len; _Bool is_curly = 0; if (name[0] == '{') { is_curly = 1; ++name; } len = 0; while (name[len] == str[len] && name[len] != '\0') ++len; if (is_curly) { if (name[len] != '}') return 0; --name; len += 2; } else if (name[len] != '\0' && name[len] != '/' && (!is_path || name[len] != ':')) return 0; if (__builtin_expect (secure, 0) && ((name[len] != '\0' && (!is_path || name[len] != ':')) || (name != start + 1 && (!is_path || name[-2] != ':')))) return 0; return len; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030323-1.c ================================================ /* PR c/10178. The following code would ICE because we didn't check for overflow when computing the range of the switch-statment, and therefore decided it could be implemented using bit-tests. */ int banana(long citron) { switch (citron) { case 0x80000000: case 0x40000: case 0x40001: return 1; break; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030330-1.c ================================================ /* PR c/10083 */ /* This will result in a very small constant for umul_highpart, which uncovered a bug in the Alpha machine description. */ unsigned long f(unsigned long x) { return x % 0x3fffffffffffffff; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030331-1.c ================================================ /* From PR/9301. Fixed by ebotcazou's patch for PR/9493. */ void bar (void); void foo (int a, int b, int c, int d, int e) { if (a) bar(); if (b && c) ; if (d && e) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030405-1.c ================================================ /* When compiled with -pedantic, this program will cause an ICE when the constant propagator tries to set the value of *str to UNDEFINED. This happens because *str is erroneously considered as a store alias. The aliasing code is then making *str an alias leader for its alias set and when the PHI node at the end of the while() is visited the first time, CCP will try to assign it a value of UNDEFINED, but the default value for *str is a constant. */ typedef __SIZE_TYPE__ size_t; size_t strlength (const char * const); char foo(); static const char * const str = "mingo"; bar() { size_t c; char *x; c = strlength (str); while (c < 10) { if (c > 5) *x = foo (); if (*x < 'a') break; } return *x == '3'; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030410-1.c ================================================ /* PR 10201 */ extern struct _zend_compiler_globals compiler_globals; typedef struct _zend_executor_globals zend_executor_globals; extern zend_executor_globals executor_globals; typedef struct _zend_ptr_stack { int top; void **top_element; } zend_ptr_stack; struct _zend_compiler_globals { }; struct _zend_executor_globals { int *uninitialized_zval_ptr; zend_ptr_stack argument_stack; }; static inline void safe_free_zval_ptr(int *p) { if (p!=(executor_globals.uninitialized_zval_ptr)) { } } zend_executor_globals executor_globals; static inline void zend_ptr_stack_clear_multiple(void) { executor_globals.argument_stack.top -= 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030415-1.c ================================================ float g(float f) { return fabs(f); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030416-1.c ================================================ void foo(int x) { if (x > 3) {;} else bar(); x = 9; } main() { int j; foo(j); return j; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030418-1.c ================================================ /* PR optimization/7675 */ /* Contributed by Volker Reichelt */ /* Verify that we don't put automatic variables in registers too early. */ extern int dummy (int *); void foo(int i) { int j=i; void bar() { int x=j, y=i; } dummy(&i); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030503-1.c ================================================ void foo () { if (1) goto foo; else for (;;) { foo: bar (); return; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030518-1.c ================================================ /* Test case from PR middle-end/10472 */ extern void f (char *); void foo (char *s) { f (__builtin_stpcpy (s, "hi")); } void bar (char *s) { f (__builtin_mempcpy (s, "hi", 3)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030530-1.c ================================================ union tree_node; typedef union tree_node *tree; struct tree_common { tree type; unsigned lang_flag_0 : 1; }; union tree_node { struct tree_common common; }; static void java_check_regular_methods (tree class_decl) { int saw_constructor = class_decl->common.type->common.lang_flag_0; tree class = class_decl->common.type; for (;;) { if (class) if (class_decl->common.type) bar (class); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030530-3.c ================================================ struct tree_decl { unsigned in_system_header_flag:1; }; union tree_node { struct tree_decl decl; }; typedef union tree_node *tree; static int redeclaration_error_message (olddecl) tree olddecl; { if (({olddecl;})->decl.in_system_header_flag) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030604-1.c ================================================ /* PR optimization/10876 */ /* Contributed by Christian Ehrhardt */ /* Verify that the SPARC port doesn't emit (minus) (reg) (const_int) insns. */ void f(void) { unsigned int butterfly, block, offset; double *Z; for (block = 0; block < 512; block += 512) { double T1re, T2re; offset = butterfly + block; T1re += T2re; T2re = Z[offset] + T1re; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030605-1.c ================================================ /* Test for proper preparation of the comparison operands for generation of a conditional trap. Produced unrecognizable rtl on Sparc. */ struct blah { char *b_data; }; void set_bh_page(struct blah *bh, unsigned long offset) { if ((1UL << 12 ) <= offset) __builtin_trap() ; bh->b_data = (char *)offset; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030612-1.c ================================================ static inline void foo (long long const v0, long long const v1) { bar (v0 == v1); } void test (void) { foo (0, 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030624-1.c ================================================ /* Derived from PR optimization/11311 */ double pow(double, double); double foo(double x) { return pow(x,261); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030703-1.c ================================================ /* Extracted from PR target/10700. */ /* The following code used to cause an ICE on 64-bit targets. */ int SAD_Block(int *); void MBMotionEstimation(int *act_block, int block) { SAD_Block(act_block + ( (8 * (block == 1 || block == 3)) + (8 * (block == 2 || block == 3)))); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030704-1.c ================================================ /* PR c/11428. */ /* fold_single_bit_test() failed to return a tree of the type that the outer expression was looking for. Specifically, it returned a tree whose type corresponded to QImode for !p->m, but the desired result type was int, which corresponded to SImode. emit_move_insn() later tried to copy a reg:QI to reg:SI, causing an ICE. */ struct s { int m : 1; }; int foo (struct s *p) { return !p->m; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030707-1.c ================================================ /* PR c/11449. */ /* sign_bit_p() in fold-const.c failed to notice that (int) 0x80000000 was the sign bit of m. As a result, fold_single_bit_test() returned ((unsigned int) m >> 31), and that was eventually passed to invert_truthvalue(), which did not know how to handle RROTATE_EXPR, causing an ICE. */ int foo (int m) { return !(m & ((int) 0x80000000)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030708-1.c ================================================ /* PR 10795. */ /* ix86_expand_carry_flag_compare() in i386.c swapped the comparison operands without checking that the compare instruction, cmpl, would accept the swapped operands. */ extern const char a[]; int foo (const char *p) { return (p > a) ? 0 : 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030716-1.c ================================================ void baz(int i); void foo(int i, int A[i+1]) { int j=A[i]; void bar() { baz(A[i]); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030725-1.c ================================================ /* This testcase caused ICE on any 64-bit arch at -O2/-O3 due to fold/extract_muldiv/convert destroying its argument. */ int x, *y, z, *p; void foo (void) { p = y + (8 * (x == 1 || x == 3) + z); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030804-1.c ================================================ /* Extracted from PR middle-end/11771. */ /* The following testcase used to ICE without -ffast-math from unbounded recursion in fold. This was due to the logic in negate_expr_p not matching that in negate_expr. */ double f(double x) { return -(1 - x) + (x ? -(1 - x) : 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030821-1.c ================================================ /* PR target/11805. */ /* Consider the following sequence. (set (cc0) (and:HI (reg:HI 0) (const_int 1))) (set (pc) (if_then_else (le (cc0) (const_int 0)) (label_ref 17) (pc))) On h8300, the first insn does not set the overflow flag, but the second requires the overflow flag. As a result, when the final wants to output the jump insn, it cannot find a test insn that gives appropriate condition flags. */ unsigned char foo (unsigned char a) { return (a & 1) > 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030823-1.c ================================================ struct A { int a; }; int foo (struct A *a) { static int c = 30; int x; a->a = c; /* Dominator optimizations will replace the use of 'a->a' with 'c', but they won't copy the virtual operands for 'c' from its originating statement. This exposes symbol 'c' without a correct SSA version number. */ x = a->a; return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030902-1.c ================================================ typedef __SIZE_TYPE__ size_t; typedef unsigned long int reg_syntax_t; struct re_pattern_buffer { unsigned char *buffer; }; typedef enum { jump, jump_n, } re_opcode_t; static int foo (bufp) struct re_pattern_buffer *bufp; { int mcnt; unsigned char *p = bufp->buffer; switch (((re_opcode_t) * p++)) { unconditional_jump: ; /* This test case caused an ICE because the statement insertion routines were failing to update basic block boundaries. */ case jump: do { (mcnt) = *(p) & 0377; } while (0); (p) += 2; p += mcnt; case jump_n: (mcnt) = *(p + 2) & 0377; if (mcnt) goto unconditional_jump; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030903-1.c ================================================ /* Derived from PR optimization/11700. */ /* The compiler used to ICE during reload for m68k targets. */ void check_complex (__complex__ double, __complex__ double, __complex__ double, __complex__ int); void check_float (double, double, double, int); extern double _Complex conj (double _Complex); extern double carg (double _Complex __z); static double minus_zero; void conj_test (void) { check_complex (conj (({ __complex__ double __retval; __real__ __retval = (0.0); __imag__ __retval = (0.0); __retval; })), ({ __complex__ double __retval; __real__ __retval = (0.0); __imag__ __retval = (minus_zero); __retval; }), 0, 0); } void carg_test (void) { check_float (carg (({ __complex__ double __retval; __real__ __retval = (2.0); __imag__ __retval = (0); __retval; })), 0, 0, 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030904-1.c ================================================ struct A { long a1; double *a2; }; struct B { void *b1; double b2, b3; struct { int d1; double d2; } b4; }; struct C { struct A *c1; void *c2; }; long fn1 (struct A *, double); void fn2 (void *, const char *); double fn3 (double); double fn4 (double); int fn5 (void *, double, double); int foo (struct B *x) { struct C *e = x->b1; struct A *f = e->c1; long g, h, i; double *j, k; g = fn1 (f, 0.5 * (x->b2 + x->b3)), h = g + 1, i = f->a1; j = f->a2, k = x->b4.d2; fn2 (x, "something"); if (g <= 0) { double l = j[2] - j[1]; if (l > 0.0 && l <= 0.02) k = (x->b4.d1 == 1 ? ((1.0 / l) < 25 ? 25 : (1.0 / l)) : fn3 ((1.0 / l) < 25 ? 25 : (1.0 / l))); } else { double m = j[h] - j[g], n = 0.0, l = 0.0; if (g > 1) n = j[g] - j[g - 1]; if (h < i) l = j[h + 1] - j[h]; if (n > 0.02) n = 0; if (m > 0.02) m = 0; if (l > 0.02) l = 0; if (m < n) { double o = m; m = n; n = o; } if (l < n) { double o = l; l = n; n = o; } if (l < m) { double o = l; l = m; m = o; } if (n != 0.0) k = (x->b4.d1 == 1 ? ((1 / m) < 25 ? 25 : (1 / m)) : fn3 ((1 / m) < 25 ? 25 : (1 / m))); else if (m != 0.0) k = (x->b4.d1 == 1 ? ((2 / (m + l)) < 25 ? 25 : (2 / (m + l))) : fn3 ((2 / (m + l)) < 25 ? 25 : (2 / (m + l)))); else if (l != 0.0) k = (x->b4.d1 == 1 ? ((1 / l) < 25 ? 25 : (1 / l)) : fn3 ((1 / l) < 25 ? 25 : (1 / l))); } fn5 (e->c2, 0.5 * (x->b2 + x->b3), (x->b4.d1 == 1 ? k : fn4 (k))); return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030907-1.c ================================================ /* PR 11665 Orgin: jwhite@cse.unl.edu The problem was in initializer_constant_valid_p, "for a CONSTRUCTOR, only the last element of the CONSTRUCTOR was being checked" (from the email of the patch which fixed this). This used to ICE because GCC thought gdt_table was a constant value when it is not. */ int x; struct gdt { unsigned a,b,c,d,e,f; }; void f() { struct gdt gdt_table[2]= { { 0, ( (((unsigned)(&x))<<(24))&(-1<<(8)) ), }, }; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030910-1.c ================================================ /* The gimplifier was getting confused when taking the real or imaginary component of a complex rvalue. */ void test() { __complex double dc; double d; d = __real (dc * dc); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030917-1.c ================================================ typedef struct string STR; typedef struct atbl ARRAY; struct string { unsigned char str_pok; }; struct atbl { int ary_fill; }; blah(size,strp) register int size; register STR **strp; { register ARRAY *ar; ar->ary_fill = size - 1; while (size--) (*strp)->str_pok &= ~128; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20030921-1.c ================================================ /* PR 12281 The darwin back-end was causing the function f is not being emitted. TREE_SYMBOL_REFERENCED was being set instead of calling mark_referenced. */ static void f(void); void g(void (*x) (void)){x();} static inline void f(void){} void h(){g(f);} int main(){h();return 0;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031002-1.c ================================================ /* PR/12292 http://gcc.gnu.org/ml/gcc-patches/2003-10/msg00143.html */ char flags; int bug12292(int t) { flags &= ~(1 << (t + 4)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031010-1.c ================================================ /* This crashed the ARM backend with -mcpu=iwmmxt -O because an insn required a split which was not available for the iwmmxt. */ inline int *f1(int* a, int* b) { if (*b < *a) return b; return a; } int f2(char *d, char *e, int f) { int g = e - d; return *f1(&f, &g); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031011-1.c ================================================ /* PR optimization/12544 */ /* Origin: Tony Hosking */ /* Verify that non-local structures passed by invisible reference are correctly put in the stack. */ typedef struct { int a; int f; } A; A *b; void x (A a) { void y () { a.a = 0; } b = &a; y(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031011-2.c ================================================ /* PR optimization/12260. */ extern int f(void); extern int g(int); static char buf[512]; void h(int l) { while (l) { char *op = buf; if (f() == 0) break; if (g(op - buf + 1)) break; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031023-1.c ================================================ /* Declaration of the frame size doesn't work on ptx. */ /* { dg-require-effective-target untyped_assembly } */ #ifndef ASIZE # define ASIZE 0x10000000000UL #endif #include #if LONG_MAX < 8 * ASIZE # undef ASIZE # define ASIZE 4096 #endif extern void abort (void); int __attribute__((noinline)) foo (const char *s) { if (!s) return 1; if (s[0] != 'a') abort (); s += ASIZE - 1; if (s[0] != 'b') abort (); return 0; } int (*fn) (const char *) = foo; int __attribute__((noinline)) bar (void) { char s[ASIZE]; s[0] = 'a'; s[ASIZE - 1] = 'b'; foo (s); foo (s); return 0; } int __attribute__((noinline)) baz (long i) { if (i) return fn (0); else { char s[ASIZE]; s[0] = 'a'; s[ASIZE - 1] = 'b'; foo (s); foo (s); return fn (0); } } int main (void) { if (bar ()) abort (); if (baz (0) != 1) abort (); if (baz (1) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031023-2.c ================================================ /* Declaration of the frame size doesn't work on ptx. */ /* { dg-require-effective-target untyped_assembly } */ #define ASIZE 0x1000000000UL #include "20031023-1.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031023-3.c ================================================ /* Declaration of the frame size doesn't work on ptx. */ /* { dg-require-effective-target untyped_assembly } */ #define ASIZE 0x100000000UL #include "20031023-1.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031023-4.c ================================================ #define ASIZE 0x80000000UL #include "20031023-1.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031031-1.c ================================================ /* PR/11640 */ int internal_insn_latency (int insn_code, int insn2_code) { switch (insn_code) { case 256: switch (insn2_code) { case 267: return 8; case 266: return 8; case 265: return 8; case 264: return 8; case 263: return 8; } break; case 273: switch (insn2_code) { case 267: return 5; case 266: return 5; case 277: return 3; } break; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031031-2.c ================================================ /* PR/10239 */ enum node_type { INITIAL = 0, FREE, PRECOLORED, SIMPLIFY, SIMPLIFY_SPILL, SIMPLIFY_FAT, FREEZE, SPILL, SELECT, SPILLED, COALESCED, COLORED, LAST_NODE_TYPE }; inline void put_web (enum node_type type) { switch (type) { case INITIAL: case FREE: case FREEZE: case SPILL: foo (); break; case PRECOLORED: bar (); break; default: baz (); } } void reset_lists () { put_web (INITIAL); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031102-1.c ================================================ /* PR optimization/10817. Check that the following code doesn't cause any problems for GCC's if-conversion passes. */ int foo(int t) { int result = 0; if (t != 0) result = t; return result; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031112-1.c ================================================ extern __inline int __finite (double __value) { return 0; } extern __typeof (__finite) __finite __asm__ ("" "__GI___finite"); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031113-1.c ================================================ /* On Darwin, the stub for simple_cst_equal was not being emitted at all causing the as to die and not create an object file. */ int attribute_list_contained () { return (simple_cst_equal ()); } int simple_cst_list_equal () { return (simple_cst_equal ()); } int __attribute__((noinline)) simple_cst_equal () { return simple_cst_list_equal (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031124-1.c ================================================ /* PR 13143 */ int f (void *ptr) { extern char const stop[]; return ptr >= (void *) &stop; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031125-1.c ================================================ short *_offsetTable; /* This tests to make sure PRE splits the entry block ->block 0 edge when there are multiple block 0 predecessors. This is done so that we don't end up with an insertion on the entry block -> block 0 edge which would require a split at insertion time. PR 13163. */ void proc4WithoutFDFE(char *dst, const char *src, int next_offs, int bw, int bh, int pitch) { do { int i = bw; int code = *src++; int x, l; int length = *src++ + 1; for (l = 0; l < length; l++) { int x; for (x = 0; x < 4; x++) ; if (i == 0) dst += pitch * 3; } char *dst2 = dst + _offsetTable[code] + next_offs; for (x = 0; x < 4; x++) { int j = 0; (dst + pitch * x)[j] = (dst2 + pitch * x)[j]; } dst += pitch * 3; } while (--bh); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031125-2.c ================================================ struct BlobSpan { int right; }; /* This test makes sure we don't accidentally cause a bad insertion to occur by choosing the wrong variable name so that we end up with a use not dominated by a def. */ void render_blob_line(struct BlobSpan blobdata) { int buf[4 * 8]; int *data = buf; int i, n = 0; if (blobdata.right) n++; if (n) for (; i < 2 * n;) data[i] = 0; n *= 2; for (; n;) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031203-1.c ================================================ void make_file_symbol_completion_list (char *); /* This tests to make sure PRE doesn't choose the wrong name when inserting phi nodes. Otherwise, we get uses that aren't dominated by defs. PR 13177. */ void location_completer (char *text) { char *p, *symbol_start = text; for (p = text; *p != '\0'; ++p) { if (*p == '\\' && p[1] == '\'') p++; else if (*p == ':') symbol_start = p + 1; else symbol_start = p + 1; make_file_symbol_completion_list(symbol_start); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031203-2.c ================================================ /* Don't ICE on stupid user tricks. */ int foo(int bar) { return (&bar)[-1]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031203-3.c ================================================ /* Don't ICE on user silliness. GCC 3.4 and before accepts this without comment; 3.5 warns. Perhaps eventually we'll declare this an error. */ void bar (void) { ({}); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031208-1.c ================================================ extern int foo(int, ...); int bar(void) { long double l = 1.2345E6; foo(0, l); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031220-1.c ================================================ /* PR optimization/13031 */ /* The following code used to ICE on alphaev67-*-* at -O2 with an unrecognizable instruction, caused by local register allocation substituting a register for a constant in a conditional branch. */ void emit(int, int); int f(void); static int signals[5]; static inline void select(int sel, void *klass) { emit(klass ? 0 : f(), signals[sel ? 0 : 1]); } void all(void *gil, void *l, void *icon) { while (l) if (icon) select(0, gil); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031220-2.c ================================================ /* PR target/12749 Orgin: Matt Thomas This used to cause GCC to write out an instruction for i386 when using a L64 host which gas could not handle because GCC would write a full 64bit hex string out. */ float fabsf (float); typedef int __int32_t; typedef unsigned int __uint32_t; typedef union { float value; __uint32_t word; } ieee_float_shape_type; extern float __ieee754_expf (float); extern float __ieee754_sinhf (float); static const float one = 1.0, shuge = 1.0e37; float __ieee754_sinhf(float x) { float t,w,h; __int32_t ix,jx; do { ieee_float_shape_type gf_u; gf_u.value = (x); (jx) = gf_u.word; } while (0); ix = jx&0x7fffffff; if(ix>=0x7f800000) return x+x; h = 0.5; if (jx<0) h = -h; if (ix < 0x41b00000) { if (ix<0x31800000) if(shuge+x>one) return x; t = expm1f(fabsf(x)); if(ix<0x3f800000) return h*((float)2.0*t-t*t/(t+one)); return h*(t+t/(t+one)); } if (ix < 0x42b17180) return h*__ieee754_expf(fabsf(x)); if (ix<=0x42b2d4fc) { w = __ieee754_expf((float)0.5*fabsf(x)); t = h*w; return t*w; } return x*shuge; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031227-1.c ================================================ /* PR opt/13159 -- test unswitching a loop multiple times. */ void foo (void) { long j, k, p, g; while (p) { while (k < 0 && j < 0) ; if (g) ; else if (g) ; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20031231-1.c ================================================ extern int f1 (int, void *); extern int *f2 (void) __attribute__ ((__const__)); extern int f3 (int, void *); int test (int x, char *y, int z) { int b = 0; if (x < 1024) { y[0] = '\0'; do { switch (f1 (x, y + b)) { case -1: if (b == 0) return -1; else return b; default: b++; } } while (y[b - 1] != '\0' && y[b - 1] != '\n' && b < z); } else { do { switch (f3 (x, y + b)) { case -1: if ((*f2 ()) == 4) continue; if (b == 0) return -1; else return b; default: b++; } } while (y[b - 1] != '\0' && y[b - 1] != '\n' && b < z); } return b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040101-1.c ================================================ /* { dg-skip-if "not enough registers" { pdp11-*-* } { "-O[12s]" } { "" } } */ typedef unsigned short uint16_t; typedef unsigned int uint32_t; #define CF (1<<0) #define PF (1<<2) #define AF (1<<4) #define ZF (1<<6) #define SF (1<<7) #define OF (1<<11) #define EFLAGS_BITS (CF|PF|AF|ZF|SF|OF) void test16(uint16_t x, uint32_t eflags) { uint16_t bsr_result; uint32_t bsr_eflags; uint16_t bsf_result; uint32_t bsf_eflags; __asm volatile("" : "=&r" (bsr_result), "=&r" (bsr_eflags) : "r" (x), "i" (~EFLAGS_BITS), "r" (eflags)); __asm volatile("" : "=&r" (bsf_result), "=&r" (bsf_eflags) : "r" (x), "i" (~EFLAGS_BITS), "r" (eflags)); printf("%08x %04x bsrw %02x %08x bsfw %02x %08x\n", x, eflags, bsr_result, bsr_eflags, bsf_result, bsf_eflags); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040109-1.c ================================================ /* PR target/13380. On m32r, the condition code register, (reg:SI 17), was replaced with a pseudo reg, which would cause an unrecognized insn. */ void foo (unsigned int a, unsigned int b) { if (a > b) { while (a) { switch (b) { default: a = 0; case 2: a = 0; case 1: a = 0; case 0: ; } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040121-1.c ================================================ /* PR target/12898 0x8000 needs multiple instructions to be emitted on Alpha; the fluff around it causes it to be emitted in a no_new_pseudos context, which triggered a problem in alpha.c. */ void f (const char *, ...); int g (void); void *p (void); int isymBase, ilineBase, sym_hdr, want_line, proc_desc; char *lines; void print_file_desc (int *fdp) { char *str_base = p (); int symi, pdi = g (); for (symi = 0; isymBase;) { int proc_ptr = proc_desc + pdi; f("1", isymBase, proc_ptr + *fdp, str_base); if (want_line && *fdp) { int delta; long cur_line = proc_ptr; char *line_ptr = lines + proc_ptr; char *line_end = p (); f("2", sym_hdr); while (line_ptr < line_end) { delta = *line_ptr; if (delta) line_ptr++; else delta = line_ptr[1] ^ 0x8000; f("3", cur_line, delta); } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040124-1.c ================================================ int f1 (int a, int b) { int i, j, k; switch (b) { case (-9): j = 4; break; case (-10): j = 10; break; case (-8): j = 15; break; } i = f2 (f3 (b == (-9) ? k : a), j); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040130-1.c ================================================ /* PR target/11475 */ /* Origin: */ /* This used to fail on SPARC because of a broken pattern. */ #pragma pack(2) struct { unsigned char G936:7; unsigned short G937:6; unsigned int :4; unsigned short :14; unsigned int G938:8; #if __INT_MAX__ >= 2147483647L unsigned int :30; #endif unsigned short :16; #if __INT_MAX__ >= 2147483647L unsigned int :18; #endif unsigned short G939:9; } G928b; void TestG928(void) { G928b.G936 |= G928b.G939; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040202-1.c ================================================ /* PR target/13789 */ /* Failed on SPARC due to a bug in store_expr. */ void *foo (void *c) { void *a = __builtin_extract_return_addr (c); return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040209-1.c ================================================ /* The following code used to ICE in fold_convert. */ float ceilf(float); int foo(float x) { return (double)ceilf(x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040214-1.c ================================================ void foo(void) { char c; for (c = -75; c <= 75; c++) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040214-2.c ================================================ /* http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01307.html */ typedef struct xdef xdef; struct xdef { char xtyp; xdef *next; int y; }; extern void b (); extern void *foo (void *bar); extern void *foo2 (void *bar1, void *bar2); extern void *qwe; static void c (xdef * xp) { b (xp); } static void a (xdef ** xpp) { xdef *xp; xp = *xpp; foo (xp); xp = foo2 (xp, qwe); b (xp->next); foo (xp); if (xp->y) { foo (xp); if (xp) { xdef *p = foo2 (xp, qwe); foo2 (xp, p); xp = foo (p); } else { foo2 (foo(*xpp), *xpp); } } *xpp = foo2 (xpp, qwe); } void b (xdef ** xpp) { xdef *xp = *xpp; if (!xp) return; if (xp->xtyp == 0) a (xpp); c (xp); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040216-1.c ================================================ int foo (int a, int b, int c, int d) { return ~a & ~b & ~c & ~d; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040219-1.c ================================================ double foo() { return __builtin_isgreater(0.,0.); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040220-1.c ================================================ /* PR 14194 */ int irqs; static inline __attribute__((always_inline)) int kstat_irqs (void) { int i, sum = 0; for (i = 0; i < 1; i++) if (__builtin_expect(i, 0)) sum += irqs; return sum; } int show_interrupts (void) { return kstat_irqs (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040303-1.c ================================================ typedef struct input { struct input *next; } input_t; static input_t *inputs = (input_t *)((void *)0); void RemoveInput(unsigned long id) { input_t *ip; input_t *prev; while (1) if (ip == (input_t *)id) break; if (ip == (input_t *)((void *)0)) return; prev->next = ip->next; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040303-2.c ================================================ void abort(void); int x, y; void init_xy(void); void test4(void) { init_xy(); _Bool iftemp0; int x1 = x; _Bool iftemp1; x1++; if (x1 != 3) { iftemp1 = 1; goto endfirstif; } iftemp1 = 0; endfirstif: iftemp0 = iftemp1; if (iftemp0) abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040304-1.c ================================================ void cpplib_macroExpand (char * pfile) { int nargs; int rest_args; int token = -1; rest_args = 0; do { if (rest_args != 0) continue; if (nargs == 0) { rest_args = 1; token = macarg (pfile, rest_args); } } while (token == 20); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040309-1.c ================================================ static const char default_tupleseps[] = ", \t"; fubar (tupleseps) const char *tupleseps; { char *kp, *sp; const char *septmp; const char *tseplist; tseplist = (tupleseps) ? tupleseps : default_tupleseps; while (kp) { if (*tseplist) septmp = tseplist; bar (*septmp); if (*tseplist) if (*kp) ; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040310-1.c ================================================ void I_wacom () { char buffer[50], *p; int RequestData (char *cmd) { p = buffer; foo (buffer); } RequestData (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040317-1.c ================================================ int String2Array(int len, char strarr[][len]) { strarr[0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040317-2.c ================================================ typedef struct _ScaleRec *ScaleWidget; typedef struct { short *x; unsigned short *width; } Table; typedef struct { Table table; } ScalePart; typedef struct _ScaleRec { ScalePart scale; } ScaleRec; static int FindPixel (ScaleWidget sw, short x, short y, short * img_x, short * img_y, unsigned long * img_pixel) { if (sw->scale.table.x[(int) *img_x] + (short) sw->scale.table.width[(int) *img_x] < x) { ++*img_x; return FindPixel (sw, x, y, img_x, img_y, img_pixel); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040317-3.c ================================================ I_wacom () { char buffer[50], *p; int RequestData (char *cmd) { p = buffer; foo (buffer); } RequestData (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040323-1.c ================================================ /* PR middle-end/14694 */ /* { dg-require-alias "" } */ unsigned int _rtld_global = 1; extern unsigned int _rtld_local __attribute__ ((alias ("_rtld_global"))); unsigned int _dl_start (void *arg) { unsigned int elf_machine_rel () { return _rtld_local; } return elf_machine_rel (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040401-1.c ================================================ int __atomic_readv_replacement(unsigned char iov_len, int count, int i) { unsigned char bytes = 0; if ((unsigned char)((char)127 - bytes) < iov_len) return 22; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040415-1.c ================================================ int isdigit (int); int f (const char *type) { return isdigit ((unsigned char) *type++); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040415-2.c ================================================ int isascii (int); int f1 (const char *type) { return isascii ((unsigned char) *type++); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040419-1.c ================================================ /* This used to ICE because PHI-OPT would produce non-gimple code. */ int f(double d0, double d1) { return d0 > 0 == d1 > 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040602-1.c ================================================ /* Test type qualifiers. These should as equal types. */ extern volatile unsigned long foo; typedef unsigned long ulong; extern volatile ulong foo; volatile ulong foo; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040610-1.c ================================================ int foo (float x) { float i = __builtin_inff (); return x != i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040611-1.c ================================================ /* This would cause PRE load motion to generate invalid code and ICE */ void foo (char *name) { if (*name) name ++; while (name[0]); asm ("" : "=r" (name)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040614-1.c ================================================ /* { dg-require-effective-target label_values } */ void f(int r1, int *fp) { void *hlbl_tbl[] = { &&label1 }; goto *hlbl_tbl[r1]; *fp = 0; label0: fp += 8; label1: *fp = 0; if (r1) goto label2; if (r1) goto label0; label2: ; } int x; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040621-1.c ================================================ /* This test would cause partial redundancies too complex for PRE to insert using a single temporary due to them not being GIMPLE expressions. */ int ssbgst (int c, int k) { int a, i, j; a = 0; i = 1; j = k; while (j) { a += (j + i) * (k + i + c) + (j + i + c); j = j - 1; } return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040624-1.c ================================================ struct s { float f[1]; }; struct s foo(); float bar() { return foo().f[0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040705-1.c ================================================ extern char foo[], bar[]; void f (void) { memcpy (foo, bar, 7); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040708-1.c ================================================ /* PR rtl-optimization/16199 */ /* Origin: Olaf Klein */ typedef enum { APR_LOCK_FCNTL, APR_LOCK_FLOCK, APR_LOCK_SYSVSEM, APR_LOCK_PROC_PTHREAD, APR_LOCK_POSIXSEM, APR_LOCK_DEFAULT } apr_lockmech_e; struct apr_proc_mutex_unix_lock_methods_t { unsigned int flags; const char *name; }; typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_methods_t; extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods; struct apr_proc_mutex_t { const apr_proc_mutex_unix_lock_methods_t *inter_meth; int curr_locked; char *fname; }; typedef struct apr_proc_mutex_t apr_proc_mutex_t; extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_methods; extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods; static int proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lockmech_e mech) { switch (mech) { case APR_LOCK_FCNTL: new_mutex->inter_meth = &apr_proc_mutex_unix_fcntl_methods; break; case APR_LOCK_FLOCK: return ((20000 + 50000) + 23); break; case APR_LOCK_SYSVSEM: new_mutex->inter_meth = &apr_proc_mutex_unix_sysv_methods; break; case APR_LOCK_POSIXSEM: return ((20000 + 50000) + 23); break; case APR_LOCK_PROC_PTHREAD: new_mutex->inter_meth = &apr_proc_mutex_unix_proc_pthread_methods; break; case APR_LOCK_DEFAULT: new_mutex->inter_meth = &apr_proc_mutex_unix_proc_pthread_methods; break; default: return ((20000 + 50000) + 23); } return 0; } const char* apr_proc_mutex_defname(void) { apr_proc_mutex_t mutex; if (proc_mutex_choose_method(&mutex, APR_LOCK_DEFAULT) != 0) { return "unknown"; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040709-1.c ================================================ /* PR target/16364 */ union foo { long double ld; } bar; double sub (union foo baz) { return baz.ld / 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040726-1.c ================================================ /* PR rtl-optimization/16643 */ void foo (int a, int b, int c, int d, int e, int *f) { if (a == 0) if (b == 0) if (c == 0) if (d == 0) { *f = e; return; } *f = e; return; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040726-2.c ================================================ /* { dg-do compile } */ /* From a failure after the global ccp pass. */ typedef struct { char n[129]; } A; const A C = { 0, 0 }; extern const A *const B; void bar(const char *); void foo () { bar (B->n); } const A *const B = &C; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040727-1.c ================================================ /* Extracted from boehm-gc/os_dep.c on Darwin. It caused an ICE when trying to merge alias information from two pointers that had different type memory tags. */ typedef int thread_state_flavor_t; typedef int exception_behavior_t; typedef unsigned int exception_mask_t; typedef unsigned int exception_handler_t; typedef unsigned int mach_msg_type_number_t; static struct { mach_msg_type_number_t count; exception_mask_t masks[16]; exception_handler_t ports[16]; thread_state_flavor_t flavors[16]; } GC_old_exc_ports; typedef exception_handler_t *exception_handler_array_t; typedef thread_state_flavor_t *exception_flavor_array_t; int task_get_exception_ports ( mach_msg_type_number_t *masksCnt, exception_handler_array_t old_handlers, exception_flavor_array_t old_flavors ); void GC_dirty_init() { task_get_exception_ports(GC_old_exc_ports.masks, GC_old_exc_ports.ports, GC_old_exc_ports.flavors); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040730-1.c ================================================ /* PR tree-opt/16827 This used to ICE in tree-ssa-loop-im.c */ extern unsigned short dev_roles[]; void super_1_sync(int *rdev2) { int i; int max_dev = 0; for (i =0;i<20;i++) if (rdev2[i] > max_dev) max_dev = rdev2[i]; for (i=0; ic) bar1(a); else { if (p) bar2(a,a.c); bar3(a.c); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040824-1.c ================================================ /* This caused an out-of-range address on the MIPS port. */ void foo (char *x) { __builtin_prefetch (x + 0x8000); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040901-1.c ================================================ typedef enum {a, b} __attribute__((__mode__(__QI__))) x; x foo; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040907-1.c ================================================ void ProdWord_bla ( gtL, gtRes, lnL ) int *gtL, *gtRes; int lnL; { while ( 1 < lnL ) { *gtRes++ = *gtL++; --lnL; } if ( 0 < lnL ) if ( gtL[0] == gtL[1] ) *gtRes++ = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040908-1.c ================================================ /* PR 17186 */ double foo() { int i; double d; if (i) bar(); else if (d) return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040909-1.c ================================================ static __inline__ int one_utf8_to_utf16 () { } static __inline__ unsigned char conversion_loop (int (*const one_conversion)()) { return one_conversion (); } static unsigned char convert_utf8_utf16 () { return conversion_loop (one_utf8_to_utf16); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040914-1.c ================================================ extern int clobber_k (int *); extern int barrier (void); int t, u; int process_second_stream(void) { int k; int i = 0, j = 0, result; clobber_k (&k); while(t) ; while(!j) { while(!j) { barrier (); if (t == 0) break; else if(t == 1) t = 2; else { if(t < 0) j=1; if(u < 0) k = i++; } } if(!j && u) j=1; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20040916-1.c ================================================ /* PR tree-optimization/17512 We used to try to fold "(char) (X ^ Y)", where '^' is TRUTH_XOR_EXPR into ((char) X ^ (char) Y), creating TRUTH_XOR_EXPR with its operands being of type char, which is invalid. */ char foo (int p) { int q = p; return (p != 0) == (p == q); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20041005-1.c ================================================ /* This wrongly caused duplicate definitions of x in the assembler output. */ /* Origin: Joseph Myers */ static int x = 1; void f (void) { extern int x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20041007-1.c ================================================ /* PR rtl-optimization/17027 */ /* Origin: dbk */ /* Testcase by Christian Ehrhardt */ int bar(void); void baz (void) __attribute__ ((noreturn)); /* noreturn is required */ void foo (void) { while (bar ()) { switch (1) { default: baz (); } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20041018-1.c ================================================ void foo (int y, int z, unsigned char **t, int **c, int *b) { int i, j, k; unsigned char a[2]; a[0] = 0; a[1] = 0; for (j = 0; j < z; j++) for (i = 0; i < y; i++, a[0] += 3) for (k = 0; k < 3; k++) c[0][k] += 3 * b[k]; for (i = 0; i < 3; i++) if (t[0][i] + c[0][i] / a[0] <= 0) t[0][i] = 0; else t[0][i] = t[0][i] + c[0][i] / a[0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20041026-1.c ================================================ int foo (double x, long double y) { return __builtin_isgreater (x, y); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20041119-1.c ================================================ /* PR rtl-optimization/17825 */ #ifdef __i386__ register unsigned int reg __asm ("esi"); #elif defined __x86_64__ register unsigned int reg __asm ("r14"); #else unsigned int reg; #endif struct S { unsigned int h[8]; } *b; unsigned int c; void foo (int); void bar (void) { unsigned int j, k, l, m; j = (reg & 0xffff) | ((b->h[2] & 0xffff) << 16); k = c & 0xffff; if (k == 0) foo (0); l = (j / k) & 0xffff; m = (j % k) & 0xffff; reg = (reg & 0xffff0000) | l; b->h[2] = (b->h[2] & 0xffff0000) | m; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20041211-1.c ================================================ /* PR tree-optimization/16951 */ void dummy_use(const char *p); __inline void f(const char *const p) { const char q; dummy_use(p); f(&q); } void crash() { f(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20050105-1.c ================================================ void bar (struct S *); void foo (void *x) { bar ((struct S *) x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20050113-1.c ================================================ /* PR c/17297 */ typedef float V2SF __attribute__ ((vector_size (8))); int test0 (V2SF, V2SF); int main (void) { V2SF a = (V2SF) {1.0f/0.0f - 1.0f/0.0f, 1.0f/0.0f - 1.0f/0.0f}; V2SF b = (V2SF) {567.345, 1984.0}; int i; i = test0 (a, b); return i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20050119-1.c ================================================ void write_char(char); int len(char*); void f(char *a) { int col = 0; int i; void wchar(char c) { if (c == '\t') { do { wchar(' '); } while ((col%8)!=0); } else { write_char (c); col++; } } for(i =0;i 0) { #define TEN(x) x x x x x x x x x x TEN (TEN (a += b; b -= a;)) TEN (TEN (a += b; b -= a;)) } return a + b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20050510-1.c ================================================ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ void bar (int k) { void *label = (k) ? &&x : &&y; if (k) goto *label; x: if (k) dont_remove (); y: return; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20050516-1.c ================================================ /* PR tree-optimization/21610 */ struct S { char s; }; struct T { struct S t; }; struct S *const p = &((struct T * const) (0x4000))->t; void foo (void) { p->s = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20050520-1.c ================================================ struct s { int x[4]; }; struct s gs; void bar (void) { struct s *s; int i; s = &gs; for (i = 0; i < 4; i++) ((char*) (&s->x[i]))[0] = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20050622-1.c ================================================ #if __SCHAR_MAX__ == 127 && __INT_MAX__ >= 2147483647 struct S { char buf[72*1024*1024]; }; #else struct S { char buf[64]; }; #endif extern void bar (struct S); struct S s; int foo (void) { bar (s); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20050721-1.c ================================================ /* Test for PR target/20191. */ struct S1; struct S1 { struct S1 *next; float x; }; struct S2 { float y; }; extern int func_ex1 (float); extern int f; extern float n; extern struct S1 *bp1; extern struct S2 *bp2; inline float func1 (int f, struct S2 *p2) { float a; if (f) a = n >= p2->y ? n : p2->y; else a = n; return a; } inline float func2 (struct S1 *p1, struct S2 *p2) { float a, b; if(n <= 1.0) b = func1 (f, p2); else { a = n <= p1->x ? 0.0 : p1->x; b = a >= p2->y ? a : p2->y; } return(b); } void func3 (struct S1 *p) { float a = 0.0; if (f) a = func2 (bp1, bp2); if (func_ex1 (a)) bp1 = p; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20050801-1.c ================================================ __inline void libc_name_p (void) { enum { A = 1 }; } void nothrow_libfn_p (void) { libc_name_p (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20050801-2.c ================================================ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ __inline int f(int i) { struct { int t[i]; } t; return sizeof(t.t[i--]); } int g(int i) { return f(i); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20051207-1.c ================================================ /* PR target/25268 */ long long foo (long long x, int y) { return x << ((y + 1) & 63); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20051216-1.c ================================================ /* PR rtl-optimization/25432 */ void *malloc (__SIZE_TYPE__); void *realloc (void *, __SIZE_TYPE__); struct A { double x, y; }; struct B { double x0, y0, x1, y1; }; struct C { int n_points; int dir; struct B bbox; struct A *points; }; struct D { int n_segs; struct C segs[1]; }; void foo (int, int, int *, int, int *, struct A **, int *, int *, struct D *, int *, struct D **, int *, int **); int baz (struct A, struct A, struct A, struct A); static void bar (struct D *svp, int *n_points_max, struct A p, int *seg_map, int *active_segs, int i) { int asi, n_points; struct C *seg; asi = seg_map[active_segs[i]]; seg = &svp->segs[asi]; n_points = seg->n_points; seg->points = ((struct A *) realloc (seg->points, (n_points_max[asi] <<= 1) * sizeof (struct A))); seg->points[n_points] = p; seg->bbox.y1 = p.y; seg->n_points++; } struct D * test (struct D *vp) { int *active_segs, n_active_segs, *cursor, seg_idx; double y, share_x; int tmp1, tmp2, asi, i, j, *n_ips, *n_ips_max, n_segs_max; struct A **ips, p_curs, *pts; struct D *new_vp; int *n_points_max, *seg_map, first_share; n_segs_max = 16; new_vp = (struct D *) malloc (sizeof (struct D) + (n_segs_max - 1) * sizeof (struct C)); new_vp->n_segs = 0; if (vp->n_segs == 0) return new_vp; active_segs = ((int *) malloc ((vp->n_segs) * sizeof (int))); cursor = ((int *) malloc ((vp->n_segs) * sizeof (int))); seg_map = ((int *) malloc ((vp->n_segs) * sizeof (int))); n_ips = ((int *) malloc ((vp->n_segs) * sizeof (int))); n_ips_max = ((int *) malloc ((vp->n_segs) * sizeof (int))); ips = ((struct A * *) malloc ((vp->n_segs) * sizeof (struct A *))); n_points_max = ((int *) malloc ((n_segs_max) * sizeof (int))); n_active_segs = 0; seg_idx = 0; y = vp->segs[0].points[0].y; while (seg_idx < vp->n_segs || n_active_segs > 0) { for (i = 0; i < n_active_segs; i++) { asi = active_segs[i]; if (vp->segs[asi].n_points - 1 == cursor[asi] && vp->segs[asi].points[cursor[asi]].y == y) i--; } while (seg_idx < vp->n_segs && y == vp->segs[seg_idx].points[0].y) { cursor[seg_idx] = 0; n_ips[seg_idx] = 1; n_ips_max[seg_idx] = 2; ips[seg_idx] = ((struct A *) malloc ((n_ips_max[seg_idx]) * sizeof (struct A))); ips[seg_idx][0] = vp->segs[seg_idx].points[0]; pts = ((struct A *) malloc ((16) * sizeof (struct A))); pts[0] = vp->segs[seg_idx].points[0]; tmp1 = seg_idx; for (j = i; j < n_active_segs; j++) { tmp2 = active_segs[j]; active_segs[j] = tmp1; tmp1 = tmp2; } active_segs[n_active_segs] = tmp1; n_active_segs++; seg_idx++; } first_share = -1; share_x = 0; for (i = 0; i < n_active_segs; i++) { asi = active_segs[i]; p_curs = ips[asi][1]; if (p_curs.y == y) { bar (new_vp, n_points_max, p_curs, seg_map, active_segs, i); n_ips[asi]--; for (j = 0; j < n_ips[asi]; j++) ips[asi][j] = ips[asi][j + 1]; if (first_share < 0 || p_curs.x != share_x) { foo (first_share, i, active_segs, n_active_segs, cursor, ips, n_ips, n_ips_max, vp, seg_map, &new_vp, &n_segs_max, &n_points_max); first_share = i; share_x = p_curs.x; } } else { foo (first_share, i, active_segs, n_active_segs, cursor, ips, n_ips, n_ips_max, vp, seg_map, &new_vp, &n_segs_max, &n_points_max); first_share = -1; } } } return new_vp; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20051228-1.c ================================================ /* PR target/25554 */ /* Bitwise shift with negative shift count has undefined behavior, but we shouldn't ICE on it. */ void foo (long x) { if (((x >> -2) & 1) != 0) bar (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20060109-1.c ================================================ /* This test exposed a bug in combine where it was improperly changing the mode of a register. The bug appeared to be latent until web was moved after combine. This is the reduced test that fails by crashing in reload. */ typedef struct cpp_reader cpp_reader; typedef struct cpp_string cpp_string; struct cpp_string { unsigned int len; const unsigned char *text; }; struct cpp_callbacks { void (*ident) (cpp_reader *, unsigned int, const cpp_string *); }; static void cb_ident (cpp_reader *, unsigned int, const cpp_string *); init_c_lex (void) { struct cpp_callbacks *cb; cb->ident = cb_ident; } cb_ident (cpp_reader * pfile __attribute__ ((__unused__)), unsigned int line __attribute__ ((__unused__)), const cpp_string * str __attribute__ ((__unused__))) { { cpp_string cstr = { }; if (cpp_interpret_string (pfile, str, 1, &cstr, 0)) { } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20060202-1.c ================================================ typedef __SIZE_TYPE__ size_t; typedef const struct objc_selector { void *sel_id; } *SEL; typedef struct objc_object { } *id; typedef struct objc_class *Class; struct objc_class { struct sarray *dtable; }; typedef size_t sidx; struct soffset { unsigned int boffset:(sizeof (size_t) * 8) / 2; unsigned int eoffset:(sizeof (size_t) * 8) / 2; }; union sofftype { struct soffset off; sidx idx; }; struct sarray { size_t capacity; }; static __inline__ unsigned int soffset_decode (sidx indx) { union sofftype x; x.idx = indx; return x.off.eoffset + (x.off.boffset * (1 << 5)); } static __inline__ void * sarray_get_safe (struct sarray *array, sidx indx) { if (soffset_decode (indx) < array->capacity) return (void *)sarray_get (array, indx); } void * get_imp (Class class, SEL sel) { void *res = sarray_get_safe (class->dtable, (size_t) sel->sel_id); if (res == 0) { { res = get_imp (class, sel); } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20060208-1.c ================================================ /* PR middle-end/26092 */ /* { dg-skip-if "can't take address of malloc" { nvptx-*-* } { "*" } { "" } } */ typedef __SIZE_TYPE__ size_t; extern void *malloc (size_t); void *(*const foo) (size_t) = malloc; void *test (void) { return (*foo) (3); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20060215-1.c ================================================ /* PR middle-end/26300 */ struct S { char c; struct S *d; struct S *e; }; extern struct S *u, *v; extern void fn1 (struct S *) __attribute__ ((noreturn)); void fn2 (struct S *); static inline struct S * fn3 (struct S *x) { if (x->c != 6) fn1 (0); return (struct S *) x; } static inline int fn4 (struct S *x) { if (x != u) return 3; fn2 (x); return 0; } int test (struct S *x) { struct S *r; int m = 0; for (r = x; r != v; r = (fn3 (r)->d)) if (r->c != 6) fn1 (x); else m |= 1 << (fn4 (fn3 (r)->e) - 1); return m; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20060217-1.c ================================================ /* PR middle-end/26334 */ struct U { unsigned int u[256]; }; struct S { int u, v, w, x; int s[255]; }; int foo (struct U *x, struct S *y) { register int i; for (i = 0; i < 255; i++) { unsigned int v; __asm__ ("" : "=r" (v) : "0" (x->u[i + 1]) : "cc"); y->s[i] = v; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20060309-1.c ================================================ /* Test to make sure that indirect jumps compile. */ extern void bar(void); void foo() { bar(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20060419-1.c ================================================ /* This failed because if conversion didn't handle insv patterns properly. */ union y { int a; unsigned short b; }; extern void bar (unsigned short u, union y v); void foo (int check) { union y x; if (check != 0) x.b = 1; else x.b = 2; bar (x.b, x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20060421-1.c ================================================ /* This test used to ICE on ARM with -mcpu=iwmmxt. */ void foo (void) { long long int a; unsigned long b[249]; /* >= 249 causes failure */ register unsigned int c; b[c] = (a & (1ULL << c)) ? 1 : 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20060609-1.c ================================================ /* This test used to ICE on IA64. */ int __strspn_c2 (__const char *__s, int __accept1, int __accept2) { register long unsigned int __result = 0; while (__s[__result] == __accept1 || __s[__result] == __accept2) return __result; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20060625-1.c ================================================ /* PR middle-end/28151 */ /* Testcase by Steven Bosscher */ _Complex float b; void foo (void) { _Complex float a = __FLT_MAX__; b = __FLT_MAX__ + a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20060823-1.c ================================================ /* PR middle-end/28683 */ extern void foo (int *); struct A { int f; }; struct A * test (struct A *r) { int *f = &r->f; static int i = 0; if (!i && !((void *) f == (void *) r)) foo (&i); return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20060826-1.c ================================================ typedef _Complex double S; S bar (void); void quux (S, S); void foo (void) { quux (bar(), bar()); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20060904-1.c ================================================ /* PR rtl-optimization/27616 */ /* Reported by Lee Ji Hwan */ /* Testcase by Andrew Pinski */ struct chunk_s { unsigned int size; int offset_next; }; typedef struct chunk_s chunk_t; void foo(chunk_t *first) { chunk_t *cur; char *first0; do { first0 = (char *) first; cur = (chunk_t *) (first0 + first->offset_next); if ((chunk_t *) (first0 + cur->offset_next) != first) return ; first->offset_next = 0; } while (cur->size != 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20061005-1.c ================================================ /* PR target/28924 */ char c; void testc (void) { (void) __sync_fetch_and_add (&c, -1); } short s; void tests (void) { (void) __sync_fetch_and_add (&s, -1); } void testc2 (void) { (void) __sync_val_compare_and_swap (&c, -1, -3); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20061214-1.c ================================================ typedef unsigned long long ull; ull bar (void); void foo (ull *x) { ull y = bar (); *x += y >> 32; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070121.c ================================================ /* PR rtl-optimization/29329 */ /* Origin: Debian GCC Maintainers */ /* Testcase by: Andrew Pinski */ struct node234_Tag { int t1; int kids[4]; void *elems[3]; }; void *add234_internal(struct node234_Tag *n, int ei) { int j; for (j = ei; j < 2 && n->elems[j+1];) j++; n->kids[j+1] = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070129.c ================================================ /* This testcase would cause a hang in PTA solving due to a complex copy constraint and marking the wrong variable as changed. */ typedef struct RExC_state_t { char *end; char *parse; } RExC_state_t; struct regnode_string { unsigned char str_len; char string[1]; }; static void *regatom (RExC_state_t * pRExC_state, int *flagp); static void * regpiece (RExC_state_t * pRExC_state, int *flagp) { return regatom (0, 0); } static void * regbranch (RExC_state_t * pRExC_state, int *flagp, int first) { return regpiece (0, 0); } static void * reg (RExC_state_t * pRExC_state, int paren, int *flagp) { return regbranch (0, 0, 1); } void * Perl_pregcomp (char *exp, char *xend, void *pm) { return reg (0, 0, 0); } static void * regatom (RExC_state_t * pRExC_state, int *flagp) { register void *ret = 0; int flags; tryagain: switch (*(pRExC_state->parse)) { case '(': ret = reg (pRExC_state, 1, &flags); if (flags & 0x8) { goto tryagain; } break; default: { register unsigned long len; register unsigned ender; register char *p; char *oldp, *s; unsigned long numlen; unsigned long foldlen; unsigned char tmpbuf[6 + 1], *foldbuf; defchar: s = (((struct regnode_string *) ret)->string); for (len = 0, p = (pRExC_state->parse) - 1; len < 127 && p < (pRExC_state->end); len++) { if (((*p) == '*' || (*p) == '+' || (*p) == '?' || ((*p) == '{' && regcurly (p)))) { unsigned long unilen; for (foldbuf = tmpbuf; foldlen; foldlen -= numlen) { reguni (pRExC_state, ender, s, &unilen); s += unilen; } break; } unsigned long unilen; reguni (pRExC_state, ender, s, &unilen); s += unilen; } }; break; } return (ret); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070419-1.c ================================================ /* PR tree-optimization/31632 */ struct S { long int l; void *m; }; int foo (struct S *x) { unsigned long a; a = x->l; if (a <= ((void *) 0)) x->m = 0; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070501-1.c ================================================ typedef signed int signed16 __attribute__ ((__mode__ (__HI__))); typedef unsigned int unsigned16 __attribute__ ((__mode__ (__HI__))); typedef signed16 HI; typedef unsigned16 UHI; unsigned short f(int y) { HI tmp_b4; tmp_b4 = y; UHI opval; if (tmp_b4 == -32768) opval = 32767; else opval = -tmp_b4; return opval; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070520-1.c ================================================ typedef unsigned char uint8_t; extern uint8_t ff_cropTbl[256 + 2 * 1024]; void ff_pred8x8_plane_c(uint8_t *src, int stride){ int j, k; int a; uint8_t *cm = ff_cropTbl + 1024; const uint8_t * const src0 = src+3-stride; const uint8_t *src1 = src+4*stride-1; const uint8_t *src2 = src1-2*stride; int H = src0[1] - src0[-1]; int V = src1[0] - src2[ 0]; for(k=2; k<=4; ++k) { src1 += stride; src2 -= stride; H += k*(src0[k] - src0[-k]); V += k*(src1[0] - src2[ 0]); } H = ( 17*H+16 ) >> 5; V = ( 17*V+16 ) >> 5; a = 16*(src1[0] + src2[8]+1) - 3*(V+H); for(j=8; j>0; --j) { int b = a; a += V; src[0] = cm[ (b ) >> 5 ]; src[1] = cm[ (b+ H) >> 5 ]; src[2] = cm[ (b+2*H) >> 5 ]; src[3] = cm[ (b+3*H) >> 5 ]; src[4] = cm[ (b+4*H) >> 5 ]; src[5] = cm[ (b+5*H) >> 5 ]; src[6] = cm[ (b+6*H) >> 5 ]; src[7] = cm[ (b+7*H) >> 5 ]; src += stride; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070522-1.c ================================================ /* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ /* This was PR 31606, we were trying to use TImode to expand the struct copy in SRA but TImode is not support on ia32. */ struct Collision { int edge; int triangle; float _M_instance[3] __attribute__((__aligned__)); }; void get_collisions(struct Collision a) { struct Collision b = a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070529-1.c ================================================ /* ICE in chrec_fold_plus_poly_poly. */ typedef unsigned short __u16; typedef unsigned int u32; typedef __u16 __be16; struct hfs_extent { __be16 count; }; int hfs_free_fork( int type) { u32 total_blocks, blocks, start; struct hfs_extent *extent; int res, i; for (i = 0; i < 3; extent++, i++) blocks += __fswab16((( __u16)(__be16)(extent[i].count))); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070529-2.c ================================================ void xfs_dir2_grow_inode(void) { int map; int *mapp; int nmap; mapp = ↦ if (nmap == 0 ) mapp = ((void *)0); if (mapp != &map) kmem_free(mapp); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070531-1.c ================================================ /* MIN_EXPR/MAX_EXPR caused an ICE in VRP. */ int *f(int *a, int *b) { *a = 1; *b = 2; int *c = a < b ? a : b; if (c) return c; else return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070531-2.c ================================================ int f(void) { int *a = 0; for(a = 0; a < (int*)32767;a++) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070603-1.c ================================================ int f(_Complex double *a, unsigned int n) { unsigned int i; for(i = 0; i< n; i++) { a[i] = __real__ a[i+1] + __real__ a[i]; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070603-2.c ================================================ typedef _Complex double ar[]; int f(ar *a, unsigned int n) { unsigned int i; for(i = 0; i< n; i++) { (*a)[i*4] = __real__ (*a)[(i+1)*4] + __real__ (*a)[i*4]; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070605-1.c ================================================ quantize_fs_dither (unsigned width, short *errorptr, int dir) { short bpreverr; unsigned col; for (col = width; col > 0; col--) errorptr += dir; errorptr[0] = (short) bpreverr; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070827-1.c ================================================ /* PR rtl-optimization/33148 */ int foo (unsigned int *p, int *q, unsigned int w, unsigned int b) { unsigned int i; int mask; if (q[0] < q[1]) mask = 0xff; else mask = 0; for (i = 0; 8 * i < w; i++) { b ^= mask; *p++ = b; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070905-1.c ================================================ /* PR tree-optimization/32772 */ struct S { unsigned long bits[1]; }; void f1 (int, unsigned long *); int f2 (void); int f3 (int, unsigned long *); int f4 (int, unsigned long *); static inline __attribute__ ((always_inline)) void baz (int x, volatile struct S *y) { f1 (x, y->bits); } static int bar (int x, struct S *y) { int n; if (__builtin_constant_p (x) ? f3 (x, y->bits) : f4 (x, y->bits)) baz (x, y); for (n = f2 (); n < 8; n = f2 ()) f3 (n, y->bits); } void foo (int x, int y) { struct S m; while ((y = bar (x, &m)) >= 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070906-1.c ================================================ struct Bar { int i[8]; }; struct Bar foo(struct Bar **p) { return foo((struct Bar**)*p); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070915-1.c ================================================ /* PR middle-end/33423 */ static struct { char buf[15]; } u2; void test6 (void) { int len; char *p; for (len = 0; len < 2; len++) { p = __builtin___memset_chk (u2.buf, '\0', len, 15); if (p != u2.buf) return; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20070919-1.c ================================================ typedef short int int16_t; typedef unsigned char uint8_t; typedef struct { int16_t LARc[8]; int16_t Nc[4]; int16_t bc[4]; int16_t Mc[4]; int16_t xmaxc[4]; int16_t xMc[4][13]; } gsm0610_frame_t; int gsm0610_unpack_voip(gsm0610_frame_t * s, const uint8_t c[33]) { int i; for (i = 0; i < 4; i++) { s->Nc[i] = (*c >> 1) & 0x7F; s->bc[i] = (*c++ & 0x1) << 1; s->bc[i] |= (*c >> 7) & 0x1; s->Mc[i] = (*c >> 5) & 0x3; s->xmaxc[i] = (*c++ & 0x1F) << 1; s->xmaxc[i] |= (*c >> 7) & 0x1; s->xMc[i][0] = (*c >> 4) & 0x7; s->xMc[i][1] = (*c >> 1) & 0x7; s->xMc[i][2] = (*c++ & 0x1) << 2; s->xMc[i][2] |= (*c >> 6) & 0x3; s->xMc[i][3] = (*c >> 3) & 0x7; s->xMc[i][4] = *c++ & 0x7; s->xMc[i][10] |= (*c >> 6) & 0x3; s->xMc[i][11] = (*c >> 3) & 0x7; s->xMc[i][12] = *c++ & 0x7; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20071027-1.c ================================================ /* PR tree-optimization/33856 */ /* Testcase by Martin Michlmayr */ typedef struct z_key { int key; int mask; } z_key; typedef struct picture_size { z_key key; } picture_size; void picture_size_new (picture_size *ps) { z_key key; ps->key = key; } void picture_sizes_load_default (picture_size *ps) { int i; for (i = 0; i < 5; ++i) picture_size_new (ps); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20071102-1.c ================================================ /* PR rtl-optimization/28062 */ /* Original testcase by Martin Michlmayr */ /* C testcase by Andrew Pinski */ struct _NSPoint { float x; float y; }; typedef struct _NSPoint NSPoint; static inline NSPoint NSMakePoint (float x, float y) { NSPoint point; point.x = x; point.y = y; return point; } static inline NSPoint RelativePoint (NSPoint point, NSPoint refPoint) { return NSMakePoint (refPoint.x + point.x, refPoint.y + point.y); } NSPoint g(NSPoint refPoint) { float pointA, pointB; return RelativePoint (NSMakePoint (0, pointA), refPoint); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20071105-1.c ================================================ /* PR tree-optimization/33993 */ /* Testcase by Martin Michlmayr */ void init_full (char *array, int ny) { int j; char acc = 128; for (j = 0; j < ny; j++) *array++ = acc++; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20071107-1.c ================================================ /* PR rtl-optimization/33737 */ /* Testcase by Richard Guenther */ enum { PROP_0, PROP_DOUBLE_CLICK_TIME, PROP_DOUBLE_CLICK_DISTANCE, PROP_CURSOR_BLINK, PROP_CURSOR_BLINK_TIME, PROP_CURSOR_BLINK_TIMEOUT, PROP_SPLIT_CURSOR, PROP_THEME_NAME, PROP_ICON_THEME_NAME, PROP_FALLBACK_ICON_THEME, PROP_KEY_THEME_NAME, PROP_MENU_BAR_ACCEL, PROP_DND_DRAG_THRESHOLD, PROP_FONT_NAME, PROP_ICON_SIZES, PROP_MODULES, PROP_XFT_ANTIALIAS, PROP_XFT_HINTING, PROP_XFT_HINTSTYLE, PROP_XFT_RGBA, PROP_XFT_DPI, PROP_CURSOR_THEME_NAME, PROP_CURSOR_THEME_SIZE, PROP_ALTERNATIVE_BUTTON_ORDER, PROP_ALTERNATIVE_SORT_ARROWS, PROP_SHOW_INPUT_METHOD_MENU, PROP_SHOW_UNICODE_MENU, PROP_TIMEOUT_INITIAL, PROP_TIMEOUT_REPEAT, PROP_TIMEOUT_EXPAND, PROP_COLOR_SCHEME, PROP_ENABLE_ANIMATIONS, PROP_TOUCHSCREEN_MODE, PROP_TOOLTIP_TIMEOUT, PROP_TOOLTIP_BROWSE_TIMEOUT, PROP_TOOLTIP_BROWSE_MODE_TIMEOUT, PROP_KEYNAV_CURSOR_ONLY, PROP_KEYNAV_WRAP_AROUND, PROP_ERROR_BELL, PROP_COLOR_HASH, PROP_FILE_CHOOSER_BACKEND, PROP_PRINT_BACKENDS, PROP_PRINT_PREVIEW_COMMAND, PROP_ENABLE_MNEMONICS, PROP_ENABLE_ACCELS, PROP_RECENT_FILES_LIMIT }; void g_assert_warning (void) __attribute__((__noreturn__)); void gtk_settings_class_init (void) { unsigned int result; result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_DOUBLE_CLICK_TIME) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_DOUBLE_CLICK_DISTANCE) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_CURSOR_BLINK) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_CURSOR_BLINK_TIME) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_CURSOR_BLINK_TIMEOUT) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_SPLIT_CURSOR) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_THEME_NAME) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_ICON_THEME_NAME) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_FALLBACK_ICON_THEME) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_KEY_THEME_NAME) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_MENU_BAR_ACCEL) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_DND_DRAG_THRESHOLD) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_FONT_NAME) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_ICON_SIZES) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_MODULES) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_XFT_ANTIALIAS) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_XFT_HINTING) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_XFT_HINTSTYLE) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_XFT_RGBA) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_XFT_DPI) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_CURSOR_THEME_NAME) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_CURSOR_THEME_SIZE) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_ALTERNATIVE_BUTTON_ORDER) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_ALTERNATIVE_SORT_ARROWS) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_SHOW_INPUT_METHOD_MENU) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_SHOW_UNICODE_MENU) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_TOOLTIP_BROWSE_TIMEOUT) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_TOOLTIP_BROWSE_MODE_TIMEOUT) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_KEYNAV_CURSOR_ONLY) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_KEYNAV_WRAP_AROUND) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_ERROR_BELL) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_FILE_CHOOSER_BACKEND) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_PRINT_PREVIEW_COMMAND) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_ENABLE_MNEMONICS) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); result = settings_install_property_parser(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_ENABLE_ACCELS) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); if (__builtin_expect (__extension__ ({ int _g_boolean_var_; if (result == PROP_RECENT_FILES_LIMIT) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1)) { } else g_assert_warning(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20071108-1.c ================================================ /* PR tree-optimization/33680 */ /* { dg-require-effective-target alloca } */ int f (int dim, int *b, int *c) { int newcentroid[3][dim]; int *a = newcentroid[2]; int i, dist = 0; __builtin_memcpy (newcentroid, c, sizeof (newcentroid)); for (i = 0; i < dim; i++) dist += (a[i] - b[i]) * (a[i] - b[i]); return dist; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20071114-1.c ================================================ /* PR tree-optimization/34046 */ /* Origin: dcb */ typedef unsigned char bool8; typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; typedef uint8_t uint8; typedef uint16_t uint16; typedef uint32_t uint32; struct SIAPU { uint8 *PC; uint8 *RAM; uint8 Bit; uint32 Address; uint8 *WaitAddress1; uint8 *WaitAddress2; uint8 _Carry; }; struct SAPU { bool8 ShowROM; uint8 OutPorts [4]; uint8 ExtraRAM [64]; uint16 TimerTarget [3]; }; struct SAPU APU; struct SIAPU IAPU; void S9xSetAPUControl (uint8 byte); void S9xSetAPUDSP (uint8 byte); uint8 S9xGetAPUDSP (); uint8 S9xAPUGetByte (uint32 Address) { Address &= 0xffff; if (Address <= 0xff && Address >= 0xf0) { if (Address >= 0xf4 && Address <= 0xf7) { IAPU.WaitAddress2 = IAPU.WaitAddress1; IAPU.WaitAddress1 = IAPU.PC; return (IAPU.RAM [Address]); } else if (Address == 0xf3) return (S9xGetAPUDSP ()); if (Address >= 0xfd) { IAPU.WaitAddress2 = IAPU.WaitAddress1; IAPU.WaitAddress1 = IAPU.PC; uint8 t = IAPU.RAM [Address]; IAPU.RAM [Address] = 0; return (t); } return (IAPU.RAM [Address]); } else return (IAPU.RAM [Address]); } void S9xAPUSetByte (uint8 byte, uint32 Address) { Address &= 0xffff; if (Address <= 0xff && Address >= 0xf0) { if (Address == 0xf3) S9xSetAPUDSP (byte); else if (Address >= 0xf4 && Address <= 0xf7) APU.OutPorts [Address - 0xf4] = byte; else if (Address == 0xf1) S9xSetAPUControl (byte); else if (Address < 0xfd) { IAPU.RAM [Address] = byte; if (Address >= 0xfa) { if (byte == 0) APU.TimerTarget [Address - 0xfa] = 0x100; else APU.TimerTarget [Address - 0xfa] = byte; } } } else { if (Address < 0xffc0) IAPU.RAM [Address] = byte; else { APU.ExtraRAM [Address - 0xffc0] = byte; if (!APU.ShowROM) IAPU.RAM [Address] = byte; } } } void ApuCA () { IAPU.Address = *(uint16 *) (IAPU.PC + 1); IAPU.Bit = (uint8)(IAPU.Address >> 13); if ((IAPU._Carry)) S9xAPUSetByte (S9xAPUGetByte (IAPU.Address) | (1 << IAPU.Bit), IAPU.Address); else S9xAPUSetByte (S9xAPUGetByte (IAPU.Address) & ~(1 << IAPU.Bit), IAPU.Address); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20071117-1.c ================================================ /* PR middle-end/34134 */ /* { dg-require-effective-target alloca } */ extern void bar (void *, int); int foo (int i) { char *p = __builtin_stack_save (); void *q = __builtin_alloca (i); bar (q, i); __builtin_stack_restore (p); bar ("", 0); return 6; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20071118-1.c ================================================ /* PR rtl-optimization/34132 */ /* Testcase by Martin Michlmayr */ static char *m = "%s%u.msg"; extern void bar (int, const char *); void foo (short x, int y, int z) { if (x == 0) { bar (y, m); z = 1; } else if (x == 1) z = 0; bar (y, m); bar (z, "%d"); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20071128-1.c ================================================ /* PR tree-optimization/34140 */ /* Testcase by Martin Michlmayr */ struct S { unsigned int s; }; struct T { struct S t[2]; unsigned int u : 1; }; void foo (int x, int y, int z) { int i; struct T t; t.u = t.u; for (i = 0; i < x; i++) if (z != 1) t.t[i].s = y || t.u; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20071203-1.c ================================================ /* Testcase by Martin Michlmayr */ struct User { char username[10]; }; void auth_set_username (struct User *user) { char *d; char ch; d = user->username + (user->username[0] == '~'); while ((ch = *d++) != '\0') /* do nothing */ ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20071207-1.c ================================================ /* PR tree-optimization/34371 */ /* Testcase by Martin Michlmayr */ void centerln (int width, int ch, char *s) { unsigned int sidebar; int i; char linet1[1000]; char linet2[100]; sidebar = (width - __builtin_strlen (s)) / 2; for (i = 0; i < sidebar; i++) linet2[i] = ch; __builtin_strcpy (linet1, linet2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20071214-1.c ================================================ typedef __builtin_va_list va_list; void gftp_config_parse_args (int numargs, char **first, ...) { char **dest = first; va_list argp; __builtin_va_start (argp, first); while (numargs-- > 0) { *dest = __builtin_malloc (1); dest = __builtin_va_arg(argp, char **); *dest = ((void *)0); } __builtin_va_end(argp); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080114-1.c ================================================ /* PR rtl-optimization/31944 */ /* Origin: Aurelien Jarno */ int type; void stuck(int res) { if (type == 1) { if (res == 0) asm volatile(""); } else if (type == 0) { if (res == 0) asm volatile("" : : "i" (0)); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080124-1.c ================================================ /* PR middle-end/34934 */ #include typedef struct { int e[1024]; int f; } S; void foo (long *, va_list); void bar (long *x, S *y, int z, ...) { int i, j; va_list ap; va_start (ap, z); for (j = y->e[i = 1]; i <= y->f; j = y->e[++i]) { switch (z) { case 1: if (!(*x & 0x00000020)) continue; case 3: if (!(*x & 0x00000080)) continue; case 9: if (!(*x & 0x04000000)) continue; case 4: if (!(*x & 0x00000200)) continue; case 8: if (!(*x & 0x00100000)) continue; case 6: if (!(*x & 0x00000100)) continue; case 7: if (!(*x & 0x00040000)) continue; case 10: if (!(*x & 0x00000020) && ((*x & 0x00008000) || (*x & 0x08000000))) continue; } foo (x, ap); } va_end (ap); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080419-1.c ================================================ extern void *f(); void dmi_scan_machine(void) { char *p = f(), *q; for (q = p; q < p + 10; q++) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080613-1.c ================================================ /* PR middle-end/36520 */ /* Testcase by Richard Guenther */ typedef __SIZE_TYPE__ size_t; typedef unsigned short int sa_family_t; struct cmsghdr { size_t cmsg_len; __extension__ unsigned char __cmsg_data []; }; typedef unsigned int uint32_t; struct in6_addr { union { uint32_t u6_addr32[4]; } in6_u; }; struct sockaddr_in { sa_family_t sin_family; }; struct in6_pktinfo { struct in6_addr ipi6_addr; }; typedef union { struct sockaddr_in sin; } sockaddr_any; static sockaddr_any src_addr; inline struct cmsghdr * cmsg_put(struct cmsghdr *cm, int type, void *data, size_t len) { memcpy(((cm)->__cmsg_data), data, len); } int hop_sendmsg(int fd) { struct cmsghdr *cm; if (src_addr.sin.sin_family) { if (src_addr.sin.sin_family == 2) { struct in6_pktinfo info; cm = cmsg_put(cm, 50, &info, sizeof(info)); } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080625-1.c ================================================ /* { dg-require-effective-target int32plus } */ struct peakbufStruct { unsigned int lnum [5000]; int lscan [5000][4000]; double lmz [5000][4000]; double lint [5000][4000]; int PeaksInBuf; unsigned char freelists [350000]; unsigned char freelistl [5000]; unsigned int LastFreeL; } peakbuf; void foo(int); void findmzROI(int i, int *p_scan) { foo(peakbuf.PeaksInBuf); __builtin_memmove(p_scan, peakbuf.lscan[i], peakbuf.lnum[i]*sizeof(int)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080628-1.c ================================================ void f (long double, long double); struct s { char c; struct s *p; } *p; void g (void) { long double ld; p->p->c = 1; ld = p->p->c; f (ld, 1.0L); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080704-1.c ================================================ /* This code used to crash fold_convert due to PRE wanting to fold_convert from a REAL_TYPE to an INTEGER_TYPE. */ typedef unsigned int uint32_t; union double_union { double d; uint32_t i[2]; }; struct _Jv_reent { int _errno; }; _Jv_strtod_r (struct _Jv_reent *ptr, char **se) { int bb2, sign; double aadj, aadj1, adj; unsigned long y, z; union double_union rv, *bs = ((void *) 0), *delta = ((void *) 0); { ovfl:ptr->_errno = 34; { (((uint32_t) 0xfffffL) | ((uint32_t) 0x100000L) * (1024 + 1023 - 1)); } if ((aadj = _Jv_ratio (delta, bs)) <= 2.) { { if (aadj < 2. / 2) aadj = 1. / 2; aadj1 = -aadj; } } { (rv.i[1]) -= 53 * ((uint32_t) 0x100000L); adj = aadj1 * _Jv_ulp (rv.d); rv.d += adj; if (((rv.i[1]) & ((uint32_t) 0x7ff00000L)) >= ((uint32_t) 0x100000L) * (1024 + 1023 - 53)) { goto ovfl; } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080721-1.c ================================================ /* { dg-skip-if "can't read function data" { nvptx-*-* } { "*" } { "" } } */ void foo(void); void bar(void); int test(int b) { void *p, **q; if (b) p = (void *)foo; else p = (void *)bar; q = (void **)p; if (*q == (void *)0) return 1; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080806-1.c ================================================ /* This used to ICE on s390x due to a reload bug. */ #if defined(STACK_SIZE) && (STACK_SIZE < 65536) #define BYTES 64 #else #define BYTES 65400 #endif int gl2; typedef __SIZE_TYPE__ size_t; extern void *memcpy (void *dest, const void *src, size_t n); void f1 () { int i2; unsigned char bf[BYTES]; for (i2 = 0; i2 < 3; i2++) { unsigned char *p2 = bf; unsigned char *p3 = ((void *) 0); unsigned short ctf2; p2 += sizeof (short); for (ctf2 = 0; ctf2 < 3; ctf2++) { if (ctf2 == 1) { unsigned short of = p2 - bf - 6; unsigned short *ofp = (unsigned short *) &of; memcpy (p3, ofp, sizeof (short)); } if (gl2 == 1) p2 += 3; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080812-1.c ================================================ /* PR middle-end/37014 */ void bar (signed char *); void foo (int x, int y) { int i; signed char a[123], b[123], c; for (i = 0; i < 123; i++) { int e = y - x; int d = e < 0 ? -e : e; c = d < 75; a[y] = c; b[y] = c; y--; } bar (b); bar (a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080820-1.c ================================================ extern unsigned long volatile jiffies; void do_timer(void) { (*(unsigned long *)&jiffies)++; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080903-1.c ================================================ struct bar { unsigned short length; }; int dummy(void) { char c[4096]; struct bar *a; struct bar *b; a->length = ((char *) b - c); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080910-1.c ================================================ /* This used to crash IRA with -O3 -fPIC. See PR 37333. */ struct yy_buffer_state { int yy_is_interactive; }; static struct yy_buffer_state * * yy_buffer_stack = 0; static int yy_n_chars; int orafce_sql_yyleng; unsigned char *yy_c_buf_p = 0; extern char *orafce_sql_yytext; static const int yy_ec[256] = { }; short yy_accept[155], yy_base[193] = { }, yy_def[193] = { }; short yy_chk[738] = { }; unsigned char *yy_last_accepting_cpos; int orafce_sql_yylex (int a) { register int yy_current_state; unsigned char *yy_cp, *yy_bp; register int yy_act; while ( 1 ) { do { char yy_c = yy_ec[*yy_cp]; if ( yy_accept[yy_current_state] ) yy_last_accepting_cpos = yy_cp; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) yy_current_state = yy_def[yy_current_state]; } while ( yy_current_state != 154 ); yy_find_action: yy_act = yy_accept[yy_current_state]; *yy_cp = '\0'; switch ( yy_act ) { case 2: *yy_cp = 1; return 265; case 24: case 25: addlit(orafce_sql_yytext, orafce_sql_yyleng); case 26: addlit(orafce_sql_yytext, orafce_sql_yyleng); case 53: yy_fatal_error( "flex scanner jammed" ); break; case 54: yy_cp = ++(yy_c_buf_p); unsigned long n = 0; if ( yy_buffer_stack[0]->yy_is_interactive ) for ( ; _IO_getc () != (-1) ; ++n ) yy_n_chars = n; if (a == 0) { yy_current_state = yy_get_previous_state( ); goto yy_find_action; } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080922-1.c ================================================ typedef struct rtx_def *rtx; typedef struct rtvec_def *rtvec; enum rtx_code { PARALLEL, SET }; union rtunion_def { rtx rt_rtx; rtvec rt_rtvec; }; typedef union rtunion_def rtunion; struct rtx_def { rtunion fld; }; struct rtvec_def { int num_elem; }; extern rtx operand; rtx peephole2_insns (rtx x0, enum rtx_code code) { switch (code) { case SET: operand = (((x0)->fld).rt_rtx); return operand; case PARALLEL: if ((((((x0)->fld).rt_rtvec))->num_elem) == 2) return 0; break; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20080929-1.c ================================================ struct option { const char *name; int has_arg; int *flag; int val; }; enum { UBI_DYNAMIC_VOLUME = 3, UBI_STATIC_VOLUME = 4, }; typedef void * libubi_t; struct ubi_dev_info { int leb_size; }; struct args { int vol_id; int vol_type; long long bytes; int lebs; int alignment; const char *node; int maxavs; int devn; }; static struct args args = { .vol_type = UBI_DYNAMIC_VOLUME, .bytes = -1, .lebs = -1, .alignment = 1, .vol_id = (-1), .devn = -1, }; extern libubi_t libubi_open (int); extern int ubi_get_dev_info (libubi_t, const char *, struct ubi_dev_info *); int main(int argc, char * const argv[]) { int err; libubi_t libubi; struct ubi_dev_info dev_info; libubi = libubi_open(1); if (!libubi) return 0; err = ubi_get_dev_info(libubi, args.node, &dev_info); if (args.maxavs) { args.bytes = dev_info.leb_size; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20081101-1.c ================================================ int foo (int i, int b) { int mask; int result; if (b) mask = -1; else mask = 0; result = i + 1; result = result & mask; return result; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20081108-1.c ================================================ /* Test function call with function designator involving VLA side-effects does not lead to an ICE. */ void f (void); void g (void); void h (int a, void *b) { ((void *)(int (*)[++a])b ? f : g) (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20081108-2.c ================================================ /* Test boolean conversion as part of returning unsigned value does not lead to an ICE. */ _Bool f(unsigned a) { return a & 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20081108-3.c ================================================ /* Test boolean conversion of an overflowing integer return value does not lead to an ICE. */ _Bool f(void) { return __INT_MAX__ + 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20081119-1.c ================================================ unsigned long long f (__builtin_va_list ap) { return __builtin_va_arg (ap, unsigned long long); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20081203-1.c ================================================ /* PR rtl-optimization/38281 */ /* Reporter: John Regehr */ /* Testcase by Jakub Jelinek */ inline unsigned short foo (unsigned short x, unsigned short y) { if (y == 0) return x; return x / y; } unsigned short a, b, c; extern int baz (int, int); void bar (void) { int d = 0x3D75D162; a = foo (b > d, baz (0, 1)); for (c = 0; c; c = 1) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20090107-1.c ================================================ /* Verify that we don't ICE by forming invalid addresses for unaligned doubleword loads (originally for PPC64). */ struct a { unsigned int x; unsigned short y; } __attribute__((packed)); struct b { struct a rep; unsigned long long seq; } __attribute__((packed)); struct c { int x; struct a a[5460]; struct b b; }; extern void use_ull(unsigned long long); extern void f(struct c *i) { use_ull(i->b.seq); return; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20090114-1.c ================================================ typedef struct { int MbInterlace; int channel_type; } InputParameters; typedef struct { int type; int NumberofCodedPFrame; int NumberofGOP; int NumberofPPicture; int FieldControl; int Frame_Total_Number_MB; int NumberofCodedMacroBlocks; int BasicUnit; } ImageParameters; extern InputParameters *input; extern ImageParameters *img; long T; void rc_init_pict(int fieldpic) { if(input->MbInterlace) T = img->Frame_Total_Number_MB; img->NumberofCodedMacroBlocks=0; if(input->channel_type==1 && img->NumberofCodedPFrame==58) T = 4; if(fieldpic) { switch (img->type) { case 0: if(img->NumberofCodedPFrame>0 && img->FieldControl==1) T = 3; if(img->NumberofPPicture==1) T = 2; } if(img->type==0 && img->NumberofCodedPFrame>0) T = 0; } if(img->type==0 && img->FieldControl==1) T = 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20090209-1.c ================================================ /* PR middle-end/38981 */ /* Reporter: Kamaraju Kusumanchi */ struct d_info { int **subs; }; static int * d_substitution (struct d_info *di, int prefix) { char c; c='_'; if (c == '_') { unsigned int id; if (c != '_') { do { unsigned int new_id; if (new_id < id) return 0; id = new_id; } while (c != '_'); } return di->subs[id]; } else { int verbose; int code; int simple_len; code=0; simple_len=0; verbose=0; if (! code && prefix) { char peek; peek='A'; if (peek == 'C' || peek == 'D') verbose = 1; } if (verbose) { code = simple_len; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20090303-1.c ================================================ /* The array offset became 0x1ffffffffffffffe via a conversion from signed to unsigned HOST_WIDE_INT, causing an ICE compiling for Thumb. */ int r (unsigned short *); void s (unsigned short *, unsigned short *); int f (int x) { unsigned short a[1], c[1]; if (r (a)) return x; if (c[-1]) s (a, c); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20090303-2.c ================================================ /* The array offset became 0x1ffffffffffffffe via a conversion from signed to unsigned HOST_WIDE_INT, causing an ICE compiling for Thumb. */ int r (unsigned short *); void s (unsigned short *, unsigned short *); int f (int x) { unsigned short a[1], c[1]; if (r (a)) return x; if (c[0x7fffffff]) s (a, c); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20090328-1.c ================================================ union loc { unsigned reg; signed offset; }; void __frame_state_for (volatile char *state_in, int x) { /* We should move all the loads out of this loop. Right now, we only move one. It takes two insertions because we insert a cast. */ union loc fs; int reg; for (;;) { switch (x) { case 0: *state_in = fs.reg; case 1: *state_in = fs.offset; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20090331-1.c ================================================ struct re_pattern_buffer { unsigned char *buffer; unsigned long int allocated; }; void byte_regex_compile (struct re_pattern_buffer *bufp, unsigned char *begalt, unsigned char *b) { unsigned char *pfrom; unsigned char *pto; while ((unsigned long) (b - bufp->buffer + 3) > bufp->allocated) { unsigned char *old_buffer = bufp->buffer; bufp->allocated <<= 1; if (old_buffer != bufp->buffer) { int incr = bufp->buffer - old_buffer; b += incr; } } pfrom = b; pto = b + 3; while (pfrom != begalt) *--pto = *--pfrom; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20090401-1.c ================================================ /* PR rtl-optimization/39588 */ /* Testcase by Olivier ROUSSEL */ #define lit_from_int(in) ((in<0)?(((-in)<<1)|1):(in<<1)) void init_clause(int *literals, int size, int *lits) { int i; for(i=0; i < size; i++) lits[i] = lit_from_int(literals[i]); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20090518-1.c ================================================ float foo(int i) { int j = i == 42; return *(float *)&j; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20090519-1.c ================================================ typedef struct { int licensed; } __pmPDUInfo; void __pmDecodeXtendError (int *); void do_handshake(void) { __pmPDUInfo *pduinfo; int challenge; __pmDecodeXtendError(&challenge); pduinfo = (__pmPDUInfo *)&challenge; *pduinfo = *pduinfo; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20090721-1.c ================================================ /* { dg-options "-fno-tree-sra" } */ union u {double d;long long ll;}; int f(double x, int n){union u v;v.d=x;if(n>=0){v.ll<<=63;}else{v.ll-=1<<-n;v.ll>>=-n;}return v.ll;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20090907-1.c ================================================ struct platform_device; typedef unsigned long __kernel_size_t; typedef unsigned short __u16; typedef unsigned int __u32; typedef unsigned char u8; typedef unsigned short u16; typedef __kernel_size_t size_t; typedef __u32 uint32_t; static inline __attribute__ ((always_inline)) uint32_t __attribute__ ((pure)) bfin_dspid (void) { return ( { uint32_t __v; __v;} ); } struct list_head { struct list_head *next, *prev; }; struct page { union { }; struct list_head lru; }; struct device_driver { const char *name; struct module *owner; }; struct fb_info { struct device *dev; }; struct platform_driver { int (*probe) (struct platform_device *); int (*remove) (struct platform_device *); struct device_driver driver; }; struct firmware { size_t size; const u8 *data; }; struct metronomefb_par { struct fb_info *info; }; struct waveform_hdr { u8 trc; }; static u8 calc_cksum (int start, int end, u8 * mem) { u8 tmp = 0; int i; for (i = start; i < end; i++) tmp += mem[i]; return tmp; } extern struct waveform_hdr *wfm_hdr; extern int wmta; static int load_waveform (u8 * mem, size_t size, int m, int t, struct metronomefb_par *par) { int tta; int trn = 0; int i; u8 cksum; int cksum_idx; struct device *dev = par->info->dev; for (i = 0; i <= sizeof (*wfm_hdr) + wfm_hdr->trc; i++) { if (mem[i] > t) { trn = i - sizeof (*wfm_hdr) - 1; } } tta = * (mem + wmta + m * 4) & 0x00FFFFFF; cksum_idx = tta + trn * 4 + 3; cksum = calc_cksum (cksum_idx - 3, cksum_idx, mem); if (cksum != mem[cksum_idx]) { abort(); } } extern struct firmware *fw_entry; extern struct metronomefb_par *par; int metronomefb_probe (struct platform_device *dev) { return load_waveform ((u8 *) fw_entry->data, fw_entry->size, 3, 31, par); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20090917-1.c ================================================ typedef int *loop_p; typedef struct VEC_loop_p_base { unsigned num; loop_p vec[1]; } VEC_loop_p_base; __inline__ int VEC_loop_p_base_iterate (const VEC_loop_p_base * vec_, unsigned ix_, loop_p * ptr) { if (vec_ && ix_ < vec_->num) { *ptr = vec_->vec[ix_]; return 1; } else { return 0; } } typedef struct VEC_loop_p_heap { VEC_loop_p_base base; } VEC_loop_p_heap; static __inline__ int am_vector_index_for_loop (VEC_loop_p_heap * loop_nest, int loop_num) { int i; loop_p l; for (i = 0; VEC_loop_p_base_iterate ((loop_nest) ? &(loop_nest)->base : 0, i, &(l)); i++) if (l == loop_num) return i; __builtin_unreachable (); } unsigned char build_access_matrix (unsigned max) { unsigned i; for (i = 0; i < max; i++) { if (am_vector_index_for_loop (foo (), 0)) return 0; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20091215-1.c ================================================ /* { dg-require-effective-target untyped_assembly } */ void bar (); void foo (void *x, short y) { bar (x, y + 1); } void bar (x, y) void *x; char *y; { baz (y); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20100609-1.c ================================================ extern unsigned long int strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base); int find_reloads (int i, char *p) { int c; while ((c = *p++)) return strtoul (p - 1, &p, 10); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20100907.c ================================================ struct a {int a,b;}; const static struct a a[1]={{1,2}}; struct a b,c; t() { int idx = 0; b=a[idx]; c=a[idx]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20100915-1.c ================================================ /* PR rtl-optimization/45593 */ /* Testcase by Arnaud Lacombe */ typedef unsigned int __u32; typedef __u32 __be32; static inline __attribute__((always_inline)) int __attribute__((__cold__)) printk(const char *s, ...) { return 0; } typedef struct journal_s journal_t; typedef struct journal_header_s { __be32 h_magic; __be32 h_blocktype; __be32 h_sequence; } journal_header_t; typedef struct journal_superblock_s { journal_header_t s_header; __be32 s_blocksize; __be32 s_maxlen; } journal_superblock_t; struct journal_s { struct buffer_head *j_sb_buffer; journal_superblock_t *j_superblock; int j_format_version; int j_blocksize; unsigned int j_maxlen; }; static void journal_fail_superblock (journal_t *journal) { journal->j_sb_buffer = ((void *)0); } static int journal_get_superblock(journal_t *journal) { struct buffer_head *bh; journal_superblock_t *sb; int err = -100; bh = journal->j_sb_buffer; if (!buffer_uptodate(bh)) { if (!buffer_uptodate(bh)) { printk ("JBD: IO error reading journal superblock\n"); goto out; } } err = -101; if (sb->s_header.h_magic != (( __be32)(__u32)(0)) || sb->s_blocksize != (( __be32)(__u32)(journal->j_blocksize))) { printk("JBD: no valid journal superblock found\n"); goto out; } switch((( __u32)(__be32)(sb->s_header.h_blocktype))) { case 0: case 1: break; default: goto out; } if ((( __u32)(__be32)(sb->s_maxlen)) < journal->j_maxlen) journal->j_maxlen = (( __u32)(__be32)(sb->s_maxlen)); else if ((( __u32)(__be32)(sb->s_maxlen)) > journal->j_maxlen) { printk ("JBD: journal file too short\n"); goto out; } return 0; out: journal_fail_superblock(journal); return err; } static int load_superblock(journal_t *journal) { journal_get_superblock(journal); return 0; } int jbd2_journal_update_format (journal_t *journal) { journal_get_superblock(journal); return 0; } int jbd2_journal_wipe(journal_t *journal, int write) { load_superblock(journal); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20101216-1.c ================================================ typedef signed int __int32_t; typedef unsigned int __uint32_t; typedef union { double value; struct { __uint32_t msw; __uint32_t lsw; } parts; } ieee_double_shape_type; two52= 4.50359962737049600000e+15, w6 = -1.63092934096575273989e-03; double sin_pi(double x) { double y,z; __int32_t n,ix; ieee_double_shape_type gh_u; gh_u.value = (x); (ix) = gh_u.parts.msw; if(ix<0x43300000) z = y+two52; ieee_double_shape_type gl_u; gl_u.value = (z); (n) = gl_u.parts.lsw; n &= 1; switch (n) { case 0: __kernel_sin(); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20101217-1.c ================================================ /* Testcase provided by HUAWEI. */ #include int main() { int cur_k; int cur_j=0; int cur_i=28; unsigned char temp_data[8]; unsigned int Data_Size=20; for (cur_k=0;cur_j<7;cur_j++,cur_i++) { if (cur_j%2==0) { temp_data[cur_k++]=0; } if (cur_k==7) { for (;cur_k>0;cur_k--) { if (cur_k>2) { if ((temp_data[7-cur_k]=='n' || temp_data[7-cur_k]=='N' ) && (temp_data[7-cur_k+1]=='a' || temp_data[7-cur_k+1]=='A' )) { break; } } if (cur_k==1) { if (temp_data[7-cur_k]=='n' || temp_data[7-cur_k]=='N' ) { break; } } } if (cur_k==7) { } else { if (cur_k>0) printf("dfjk"); } } } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20110126-1.c ================================================ /* PR rtl-optimization/44469 */ /* Testcase by Siarhei Siamashka */ int a (int *t, const char *p) { if (*t == 0) { } else if (*t == 1) { p = (const char *)t; } else __builtin_unreachable(); if (p[0]) return 0; return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20110131-1.c ================================================ /* PR rtl-optimization/44031 */ /* Testcase by John Regehr */ typedef unsigned char uint8_t; typedef unsigned int uint32_t; typedef unsigned long int uint64_t; static uint32_t safe_add_func_uint32_t_u_u (uint32_t ui1, uint32_t ui2) { return ui1 + ui2; } static uint64_t safe_div_func_uint64_t_u_u (uint64_t ui1, uint32_t ui2) { return ui2 ? : (ui1 / ui2); } uint8_t g_55; uint8_t *g_73 = &g_55; uint8_t **g_332 = &g_73; int func_38(uint8_t *,int); int func_8(int); int int321 (void) { uint8_t l_26[4]; uint8_t *l_238 = &l_26[2]; uint8_t l_400; l_400 &= func_38 (&l_26[3], safe_add_func_uint32_t_u_u (safe_div_func_uint64_t_u_u (1, **g_332), *l_238) >= *l_238 < func_8 (0)), 1; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20110401-1.c ================================================ void asn1_length_der (unsigned long int len, unsigned char *ans, int *ans_len) { int k; unsigned char temp[4]; if (len < 128) { if (ans != ((void *) 0)) ans[0] = (unsigned char) len; *ans_len = 1; } else { k = 0; while (len) { temp[k++] = len & 0xFF; len = len >> 8; } *ans_len = k + 1; if (ans != ((void *) 0)) { ans[0] = ((unsigned char) k & 0x7F) + 128; while (k--) ans[*ans_len - 1 - k] = temp[k]; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20110902.c ================================================ static inline __attribute__((always_inline)) int f (unsigned int n, unsigned int size) { return (__builtin_constant_p (size != 0 && n > ~0 / size) ? !!(size != 0 && n > ~0 / size) : ({ static unsigned int count[2] = { 0, 0 }; int r = !!(size != 0 && n > ~0 / size); count[r]++; r; })); } int g (unsigned int size) { return f (size / 4096, 4); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20110906-1.c ================================================ /* PR middle-end/50266 */ /* Testcase by */ struct a { unsigned int a; unsigned int b; }; struct a *const p = (struct a *)0x4A004100; void foo(void) { unsigned int i = 0; unsigned int *const x[] = { &p->a, &p->b, 0 }; (*(volatile unsigned int *)((x[i])) = (unsigned int)((unsigned int)((*(volatile unsigned int *)(x[i]))))); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20110913-1.c ================================================ struct ieee754_double { double d; }; extern const float __exp_deltatable[178]; float __ieee754_expf (float x) { static const float himark = 88.72283935546875; static const float lomark = -103.972084045410; if (__builtin_isless(x, himark) && __builtin_isgreater(x, lomark)) { int tval; double x22, t, result, dx; float delta; struct ieee754_double ex2_u; dx -= t; tval = (int) (t * 512.0); if (t >= 0) delta = - __exp_deltatable[tval]; else delta = __exp_deltatable[-tval]; x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta; result = x22 * ex2_u.d + ex2_u.d; return (float) result; } return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20111209-1.c ================================================ /* { dg-do compile { target s390x-*-* *-*-*vms* } } */ typedef char* char_ptr32 __attribute__ ((mode(SI))); char_ptr32 getenv (const char *name); unsigned long strlen (const char *str); void __gnat_getenv (char *name, int *len, char **value) { *value = getenv (name); *len = strlen (*value); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20120524-1.c ================================================ char CJPAT_Packet[1508] = {}; void build_packet(int port, char *packet) { memcpy(packet, CJPAT_Packet, sizeof(CJPAT_Packet)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20120727-1.c ================================================ /* { dg-options "-mfpmath=387" { target { i?86-*-* x86_64-*-* } } } */ union { char *p; float f; } u; void f (void) { u.p = ""; u.f += 1.1f; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20120727-2.c ================================================ /* { dg-options "-mfpmath=387" { target { i?86-*-* x86_64-*-* } } } */ union { char *p; double d; } u; void f (void) { u.p = ""; u.d += 1.1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20120822-1.c ================================================ int a; int c; int b; void shr_long(int d, unsigned char s) { long long dvd, div, mod; dvd = b; mod = dvd % s; if (((c >> ((mod & 0xff) % 32)) & 1) == 0) a = 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20120830-1.c ================================================ int keyring_search(void); int keydb_search2 (int *hdfound, int *hdcurrent, int *a) { int rc = -1; while (rc == -1) { if (*a == 1) rc = keyring_search (); if (rc == -1) *hdcurrent++; if (!rc) *hdfound = *hdcurrent; } return rc; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20120830-2.c ================================================ ubidi_writeReordered_49( int *dest, const unsigned char *dirProps) { if (!(1&(1UL<<*dirProps))) *dest=1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20120913-1.c ================================================ struct list_head { struct list_head *next, *prev; }; struct dm_exception { struct list_head hash_list; unsigned long long old_chunk; unsigned long long new_chunk; }; struct dm_exception *dm_lookup_exception(struct list_head *table, unsigned long long chunk) { struct list_head *slot; struct dm_exception *e; slot = &table[0]; e = (struct dm_exception *)slot->next; for (; &e->hash_list != (slot);) if (chunk <= (e->new_chunk>>56)) return e; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20120917-1.c ================================================ typedef long long curl_off_t; int tool_seek_cb(void *userdata, curl_off_t offset, int whence) { if(offset > 0x7FFFFFFFLL - 0x1LL) { curl_off_t left = offset; while(left) { long step = (left > 0x7FFFFFFFLL - 0x1LL) ? 2147483647L - 1L : (long)left; left -= step; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20120927-1.c ================================================ void ff(int); int isc_fsaccess_set(unsigned int access) { unsigned int mode; unsigned int bits; mode = 0; bits = 0x00000021; if ((access & bits) != 0) { mode |= 0400; access &= ~bits; } access &= ~bits; bits <<= (10); if ((access & bits) != 0) access &= ~bits; bits = 0x00000012; if ((access & bits) != 0) { mode |= 0200; access &= ~bits; } mode |= (0200 >> 3); access &= ~bits; bits <<= (10); if ((access & bits) != 0) mode |= ((0200 >> 3) >> 3); bits = 0x00000044; if ((access & bits) != 0) { mode |= 0100; access &= ~bits; } if ((access & bits) != 0) { mode |= (0100 >> 3); access &= ~bits; }; bits <<= (10); if ((access & bits) != 0) mode |= ((0100 >> 3) >> 3); ff(mode) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20121010-1.c ================================================ int _IO_getc(int*); read_long(int *fp) { unsigned char b0, b1, b2, b3; b0 = _IO_getc (fp); b1 = _IO_getc (fp); b2 = _IO_getc (fp); b3 = _IO_getc (fp); return ((int)(((((b3 << 8) | b2) << 8) | b1) << 8) | b0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20121027-1.c ================================================ extern int nc; void f(void) { unsigned char resp[1024]; int c; int bl = 0; unsigned long long *dwords = (unsigned long long *)(resp + 5); for (c=0; c */ int x, c, d, e, f, g, h, i; double j; const int k; const enum { B } a; void fn1 (void) { h = (g ? c : g ? f : g ? e : g ? i : g ? f : g ? e : g ? d : x) + (a ? : a ? : a ? : a ? : a ? : a ? : a ? : a ? : a ? : a ? : a ? j : a ? : 0 ? : a ? : a ? : a ? : a ? : a ? : a ? k : a ? : x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20121220-1.c ================================================ typedef unsigned char uint8_t; typedef unsigned int uint32_t; static __attribute__ (( always_inline )) __inline__ void rop_8_notsrc_or_dst(uint8_t *dst, uint8_t src) { *dst = (~(src)) | (*dst); } void cirrus_colorexpand_notsrc_or_dst_8 (uint8_t * dst, int bits) { uint8_t src; uint32_t colors[2]; src = colors[bits]; rop_8_notsrc_or_dst(dst, src); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20140110-1.c ================================================ typedef long unsigned int size_t; struct RangeMapRange { unsigned fromMin; unsigned fromMax; unsigned toMin; }; void reserve1(void); void f(struct RangeMapRange *q1, size_t t) { const struct RangeMapRange *q2 = q1 + t; size_t n = q2 - q1; if (n > 0) reserve1(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20140213.c ================================================ static unsigned short foo (unsigned char *x, int y) { unsigned short r = 0; int i; for (i = 0; i < y; i++) r += x[i]; return r; } int baz (int, unsigned short); void bar (unsigned char *x, unsigned char *y) { int i; unsigned short key = foo (x, 0x10000); baz (0, 0); for (i = 0; i < 0x80000; i++) y[i] = x[baz (i, key)]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20140528-1.c ================================================ unsigned f(unsigned flags, unsigned capabilities) { unsigned gfp_mask; unsigned gfp_notmask = 0; gfp_mask = flags & ((1 << 25) - 1); if (!(capabilities & 0x00000001)) gfp_mask |= 0x1000000u; return (gfp_mask & ~gfp_notmask); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20140723-1.c ================================================ double f(double a, double b, int c, int d) { return (c>10&&d>20)?a:b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20140816-1.c ================================================ /* This used to ICE with the ccmp patches on aarch64. */ int f(char); int init_emit_regs (int mode) { f(mode == 4 || mode == 13); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20150108.c ================================================ long long a[10]; long long b, c, d, k, m, n, o, p, q, r, s, t, u, v, w; int e, f, g, h, i, j, l, x; int fn1 () { for (; x; x++) if (x & 1) s = h | g; else s = f | e; l = ~0; m = 1 | k; n = i; o = j; p = f | e; q = h | g; w = d | c | a[1]; t = c; v = b | c; u = v; r = b | a[4]; return e; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20150327.c ================================================ int a; int (*b)(), (*c)(); int fn1(int p1) { if (a) return 0; if (p1) { c(); b(); } } void fn2() { fn1(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20151204.c ================================================ /* { dg-skip-if "Array too big" { "avr-*-*" } } */ typedef __SIZE_TYPE__ size_t; int strcmp (const char*, const char*); void *memchr (const void *, int, size_t); char* strncpy (char *, const char *, size_t); int main (int argc, char** argv) { char target[32753] = "A"; char buffer[32753]; char *x; x = buffer; if (strcmp (target, "A") || memchr (target, 'A', 0) != ((void *) 0)) if (strncpy (x, "", 4) != x); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20160205-1.c ================================================ int a[32]; int fn1(int d) { int c = 1; for (int b = 0; b < 32; b++) if (a[b]) c = 0; return c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/20161124-1.c ================================================ /* PR middle-end/78429 */ /* Testcase by Chengnian Sun */ int a[6]; char b; unsigned c; short d; volatile int e; int foo (void) { int f; for (; c <= 2; c++) { d = 3; for (; d >= 0; d--) { int g = b; f = a[d] || b; } f || e; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/386.c ================================================ /* { dg-require-effective-target untyped_assembly } */ foo (a, p) int *p; { p[0] = a; a = (short) a; return a; } main () { int i; foobar (i, &i); } foobar (a, b) { int c; c = a % b; a = a / b; return a + b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/86.c ================================================ m32 (a) int *a; { a[1] = a[0]; } m16 (a) short *a; { a[1] = a[0]; } m8 (a) char *a; { a[1] = a[0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/900116-1.c ================================================ struct st {char a, b, c, d; } zloop (struct st *s, int *p, int *q) { int i; struct st ss; for (i = 0; i < 100; i++) { ss = s[i]; p[i] = ss.c; q[i] = ss.b; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/900216-1.c ================================================ foo (p, a, b) unsigned short *p; { unsigned int x; x = p[0]; return (x == 134U); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/900313-1.c ================================================ /* { dg-require-effective-target alloca } */ main () { char *a; foo (alloca (10000)); foo (alloca (100000)); foo (alloca ((int) &main)); } many_par (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) { char *x; int aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa; aa = bar (); ba = bar (); ca = bar (); da = bar (); ea = bar (); fa = bar (); ga = bar (); ha = bar (); ia = bar (); ja = bar (); ka = bar (); la = bar (); ma = bar (); na = bar (); oa = bar (); pa = bar (); foobar (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa); } foobar (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa) { int ab, bb, cb, db, eb, fb, gb, hb, ib, jb, kb, lb, mb, nb, ob, pb; int qb, rb, sb, tb, ub, vb, xb, yb; ab = bar (); bb = bar (); cb = bar (); db = bar (); eb = bar (); fb = bar (); gb = bar (); hb = bar (); ib = bar (); jb = bar (); kb = bar (); lb = bar (); mb = bar (); nb = bar (); ob = bar (); pb = bar (); qb = bar (); rb = bar (); sb = bar (); tb = bar (); ub = bar (); vb = bar (); xb = bar (); yb = bar (); boofar (a); boofar (b); boofar (c); boofar (d); boofar (e); boofar (f); boofar (g); boofar (h); boofar (i); boofar (j); boofar (k); boofar (l); boofar (m); boofar (n); boofar (o); boofar (p); boofar (aa); boofar (ba); boofar (ca); boofar (da); boofar (ea); boofar (fa); boofar (ga); boofar (ha); boofar (ia); boofar (ja); boofar (ka); boofar (la); boofar (ma); boofar (na); boofar (oa); boofar (pa); boofar (ab); boofar (bb); boofar (cb); boofar (db); boofar (eb); boofar (fb); boofar (gb); boofar (hb); boofar (ib); boofar (jb); boofar (kb); boofar (lb); boofar (mb); boofar (nb); boofar (ob); boofar (pb); boofar (a); boofar (b); boofar (c); boofar (d); boofar (e); boofar (f); boofar (g); boofar (h); boofar (i); boofar (j); boofar (k); boofar (l); boofar (m); boofar (n); boofar (o); boofar (p); boofar (aa); boofar (ba); boofar (ca); boofar (da); boofar (ea); boofar (fa); boofar (ga); boofar (ha); boofar (ia); boofar (ja); boofar (ka); boofar (la); boofar (ma); boofar (na); boofar (oa); boofar (pa); boofar (ab); boofar (bb); boofar (cb); boofar (db); boofar (eb); boofar (fb); boofar (gb); boofar (hb); boofar (ib); boofar (jb); boofar (kb); boofar (lb); boofar (mb); boofar (nb); boofar (ob); boofar (pb); } test_exit_ignore_stack () { foobar (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/900407-1.c ================================================ foo (a, b, p) int *p; { int c; p[1] = a + 0x1000; c = b + 0xffff0000; if ((b + 0xffff0000) == 0) c++; p[2] = c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/900516-1.c ================================================ f(c){return!(c?2.0:1.0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920301-1.c ================================================ #ifndef NO_LABEL_VALUES f(){static void*t[]={&&x};x:;} #endif g(){static unsigned p[5];} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920409-1.c ================================================ x(){int y;y>0.0?y:y-1;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920409-2.c ================================================ double x(){int x1,x2;double v; if(((long)(x1-x2))<1)return -1.0;v=t(v);v=y(1,v>0.0?(int)v:((int)v-1));} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920410-1.c ================================================ int alloc_float(f) float f; { union { float f; int i; } u; u.f=f; return u.i&~1; } float c_float(int obj) { union { float f; int i; } u; u.i=obj; return u.f; } main() { int x=alloc_float(1.2); int y=alloc_float(5.7); int z=alloc_float(c_float(x)*c_float(y)); printf("%g\n",(double)c_float(z)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920410-2.c ================================================ joe() { int j; while( 1 ) { for( j = 0; j < 4; j++ ) ; for( j = 0; j < 4; j++ ) ; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920411-2.c ================================================ x(){int n;double x;n=x<1?n:n+1;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920413-1.c ================================================ union u {double d;long long ll;}; f(double x, int n){union u v;v.d=x;if(n>=0){v.ll<<=63;}else{v.ll+=1<<-n;v.ll>>=-n;}return v.ll;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920415-1.c ================================================ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ extern void abort (void); extern void exit (int); f () { __label__ l; void *x() { return &&l; } goto *x (); abort (); return; l: exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920428-1.c ================================================ x(){char*q;return(long)q>>8&0xff;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920428-2.c ================================================ double sin(double x); double cos(double x); double tan(double x); double asin(double x); double acos(double x); double atan(double x); double atan2(double y, double x); double sinh(double x); double cosh(double x); double tanh(double x); double exp(double x); double expm1(double x); double log(double x); double log10(double x); double log1p(double x); double pow(double x, double y); double sqrt(double x); double cbrt(double x); double ceil(double x); double floor(double x); double fabs(double x); double frexp(double value, int *eptr); double ldexp(double value, int exp); double modf(double value, double *iptr); double erf(double x); double erfc(double x); double atof(const char *nptr); double hypot(double x, double y); double lgamma(double x); double j0(double x); double j1(double x); double jn(int n, double x); double y0(double x); double y1(double x); double yn(int n, double x); extern struct _iobuf { int _cnt; char *_ptr; char *_base; int _bufsiz; short _flag; char _file; } _iob[]; typedef __SIZE_TYPE__ size_t; typedef char *va_list; struct _iobuf *fopen(const char *filename, const char *type); struct _iobuf *freopen(const char *filename, const char *type, struct _iobuf *stream); struct _iobuf *fdopen(int fildes, const char *type); struct _iobuf *popen(const char *command, const char *type); int pclose(struct _iobuf *stream); int fflush(struct _iobuf *stream); int fclose(struct _iobuf *stream); int remove(const char *path); int rename(const char *from, const char *to); struct _iobuf *tmpfile(void); char *tmpnam(char *s); int setvbuf(struct _iobuf *iop, char *buf, int type, size_t size); int setbuf(struct _iobuf *stream, char *buf); int setbuffer(struct _iobuf *stream, char *buf, size_t size); int setlinebuf(struct _iobuf *stream); int fprintf(struct _iobuf *stream, const char *format, ...); int printf(const char *format, ...); char *sprintf(char *s, const char *format, ...); int vfprintf(struct _iobuf *stream, const char *format, va_list arg); int vprintf(const char *format, va_list arg); int vsprintf(char *s, const char *format, va_list arg); int fscanf(struct _iobuf *stream, const char *format, ...); int scanf(const char *format, ...); int sscanf(char *s, const char *format, ...); int fgetc(struct _iobuf *stream); int getw(struct _iobuf *stream); char *fgets(char *s, int n, struct _iobuf *stream); char *gets(char *s); int fputc(int c, struct _iobuf *stream); int putw(int w, struct _iobuf *stream); int fputs(const char *s, struct _iobuf *stream); int puts(const char *s); int ungetc(int c, struct _iobuf *stream); int fread(void *ptr, size_t size, size_t count, struct _iobuf *iop); int fwrite(const void *ptr, size_t size, size_t count, struct _iobuf *iop); int fseek(struct _iobuf *stream, long offset, int ptrname); long ftell(struct _iobuf *stream); void rewind(struct _iobuf *stream); int fgetpos(struct _iobuf *stream, long *pos); int fsetpos(struct _iobuf *stream, const long *pos); void perror(const char *s); typedef unsigned char byte; typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; typedef unsigned short ushort_; typedef struct _physadr { int r[1]; } *physadr; typedef struct label_t { int val[11]; } label_t; typedef struct _quad { long val[2]; } quad; typedef long daddr_t; typedef char * caddr_t; typedef u_long ino_t; typedef long swblk_t; typedef long time_t; typedef short dev_t; typedef long off_t; typedef u_short uid_t; typedef u_short gid_t; typedef signed char prio_t; typedef long fd_mask; typedef struct fd_set { fd_mask fds_bits[(((256 )+(( (sizeof(fd_mask) * 8 ) )-1))/( (sizeof(fd_mask) * 8 ) )) ]; } fd_set; typedef struct qhdr { struct qhdr *link, *rlink; } *queue_t; typedef char *ptr_ord_t; typedef double floatp; typedef char *(*proc_alloc_t)(unsigned num_elements, unsigned element_size, const char *client_name ); typedef void (*proc_free_t)(char *data, unsigned num_elements, unsigned element_size, const char *client_name ); extern struct _iobuf *gs_out; typedef struct gs_point_s { double x, y; } gs_point; typedef struct gs_int_point_s { int x, y; } gs_int_point; typedef struct gs_rect_s { gs_point p, q; } gs_rect; typedef struct gs_int_rect_s { gs_int_point p, q; } gs_int_rect; typedef struct gs_state_s gs_state; typedef struct { proc_alloc_t alloc; proc_free_t free; } gs_memory_procs; char *gs_malloc(uint, uint, const char * ); void gs_free(char *, uint, uint, const char * ); extern char gs_debug[128]; extern int gs_log_error(int, const char *, int ); typedef long fixed; typedef struct gs_fixed_point_s { fixed x, y; } gs_fixed_point; typedef struct gs_fixed_rect_s { gs_fixed_point p, q; } gs_fixed_rect; typedef struct gs_matrix_s { long _xx; float xx; long _xy; float xy; long _yx; float yx; long _yy; float yy; long _tx; float tx; long _ty; float ty; } gs_matrix; void gs_make_identity(gs_matrix * ); int gs_make_translation(floatp, floatp, gs_matrix * ), gs_make_scaling(floatp, floatp, gs_matrix * ), gs_make_rotation(floatp, gs_matrix * ); int gs_matrix_multiply(const gs_matrix *, const gs_matrix *, gs_matrix * ), gs_matrix_invert(const gs_matrix *, gs_matrix * ), gs_matrix_rotate(const gs_matrix *, floatp, gs_matrix * ); int gs_point_transform(floatp, floatp, const gs_matrix *, gs_point * ), gs_point_transform_inverse(floatp, floatp, const gs_matrix *, gs_point * ), gs_distance_transform(floatp, floatp, const gs_matrix *, gs_point * ), gs_distance_transform_inverse(floatp, floatp, const gs_matrix *, gs_point * ), gs_bbox_transform_inverse(gs_rect *, gs_matrix *, gs_rect * ); typedef struct gs_matrix_fixed_s { long _xx; float xx; long _xy; float xy; long _yx; float yx; long _yy; float yy; long _tx; float tx; long _ty; float ty; fixed tx_fixed, ty_fixed; } gs_matrix_fixed; extern void gs_update_matrix_fixed(gs_matrix_fixed * ); int gs_point_transform2fixed(gs_matrix_fixed *, floatp, floatp, gs_fixed_point * ), gs_distance_transform2fixed(gs_matrix_fixed *, floatp, floatp, gs_fixed_point * ); typedef struct { long xx, xy, yx, yy; int skewed; int shift; int max_bits; fixed round; } fixed_coeff; typedef enum { gs_cap_butt = 0, gs_cap_round = 1, gs_cap_square = 2 } gs_line_cap; typedef enum { gs_join_miter = 0, gs_join_round = 1, gs_join_bevel = 2 } gs_line_join; gs_state *gs_state_alloc(proc_alloc_t, proc_free_t ); int gs_state_free(gs_state * ); int gs_gsave(gs_state * ), gs_grestore(gs_state * ), gs_grestoreall(gs_state * ); gs_state *gs_gstate(gs_state * ); int gs_currentgstate(gs_state * , const gs_state * ), gs_setgstate(gs_state * , const gs_state * ); gs_state *gs_state_swap_saved(gs_state *, gs_state * ); void gs_state_swap(gs_state *, gs_state * ); int gs_initgraphics(gs_state * ); typedef struct gx_device_s gx_device; int gs_flushpage(gs_state * ); int gs_copypage(gs_state * ); int gs_output_page(gs_state *, int, int ); int gs_copyscanlines(gx_device *, int, byte *, uint, int *, uint * ); gx_device * gs_getdevice(int ); int gs_copydevice(gx_device **, gx_device *, proc_alloc_t ); int gs_makeimagedevice(gx_device **, gs_matrix *, uint, uint, byte *, int, proc_alloc_t ); void gs_nulldevice(gs_state * ); int gs_setdevice(gs_state *, gx_device * ); gx_device * gs_currentdevice(gs_state * ); const char * gs_devicename(gx_device * ); void gs_deviceinitialmatrix(gx_device *, gs_matrix * ); int gs_closedevice(gx_device * ); int gs_setlinewidth(gs_state *, floatp ); float gs_currentlinewidth(const gs_state * ); int gs_setlinecap(gs_state *, gs_line_cap ); gs_line_cap gs_currentlinecap(const gs_state * ); int gs_setlinejoin(gs_state *, gs_line_join ); gs_line_join gs_currentlinejoin(const gs_state * ); int gs_setmiterlimit(gs_state *, floatp ); float gs_currentmiterlimit(const gs_state * ); int gs_setdash(gs_state *, const float *, uint, floatp ); uint gs_currentdash_length(const gs_state * ); int gs_currentdash_pattern(const gs_state *, float * ); float gs_currentdash_offset(const gs_state * ); int gs_setflat(gs_state *, floatp ); float gs_currentflat(const gs_state * ); int gs_setstrokeadjust(gs_state *, int ); int gs_currentstrokeadjust(const gs_state * ); typedef enum { gs_color_space_DeviceGray = 0, gs_color_space_DeviceRGB, gs_color_space_DeviceCMYK } gs_color_space; typedef struct gs_color_s gs_color; extern const uint gs_color_sizeof; int gs_setgray(gs_state *, floatp ); float gs_currentgray(gs_state * ); int gs_sethsbcolor(gs_state *, floatp, floatp, floatp ), gs_currenthsbcolor(gs_state *, float [3] ), gs_setrgbcolor(gs_state *, floatp, floatp, floatp ), gs_currentrgbcolor(gs_state *, float [3] ); int gs_currentcolorspace(gs_state *, gs_color_space * ); typedef float (*gs_transfer_proc)(gs_state *, floatp ); int gs_settransfer(gs_state *, gs_transfer_proc ), gs_settransfer_remap(gs_state *, gs_transfer_proc, int ); gs_transfer_proc gs_currenttransfer(gs_state * ); int gs_setcolortransfer(gs_state *, gs_transfer_proc , gs_transfer_proc , gs_transfer_proc , gs_transfer_proc ), gs_setcolortransfer_remap(gs_state *, gs_transfer_proc , gs_transfer_proc , gs_transfer_proc , gs_transfer_proc , int ); void gs_currentcolortransfer(gs_state *, gs_transfer_proc [4] ); int gs_setscreen(gs_state *, floatp, floatp, float (*)(floatp, floatp ) ); int gs_currentscreen(gs_state *, float *, float *, float (**)(floatp, floatp ) ); int gs_sethalftonephase(gs_state *, int, int ); int gs_currenthalftonephase(gs_state *, gs_int_point * ); typedef struct gs_screen_enum_s gs_screen_enum; extern const uint gs_screen_enum_sizeof; int gs_screen_init(gs_screen_enum *, gs_state *, floatp, floatp ); int gs_screen_currentpoint(gs_screen_enum *, gs_point * ); int gs_screen_next(gs_screen_enum *, floatp ); struct gs_state_s { gs_state *saved; gs_memory_procs memory_procs; gs_matrix_fixed ctm; gs_matrix ctm_inverse; int inverse_valid; struct gx_path_s *path; struct gx_clip_path_s *clip_path; int clip_rule; struct line_params_s *line_params; struct halftone_params_s *halftone; float (*ht_proc)(floatp, floatp ); gs_int_point ht_phase; gs_int_point phase_mod; struct gs_color_s *color; struct gx_device_color_s *dev_color; struct gx_transfer_s *transfer; struct gs_font_s *font; gs_matrix char_tm; int char_tm_valid; byte in_cachedevice; byte in_charpath; int level; float flatness; int stroke_adjust; struct device_s *device; int device_is_shared; }; typedef unsigned long gx_bitmap_id; typedef struct gx_bitmap_s { byte *data; int raster; gs_int_point size; gx_bitmap_id id; ushort rep_width, rep_height; } gx_bitmap; typedef unsigned long gx_color_index; typedef unsigned short gx_color_value; typedef struct gx_device_color_info_s { int num_components; int depth; gx_color_value max_gray; gx_color_value max_rgb; gx_color_value dither_gray; gx_color_value dither_rgb; } gx_device_color_info; typedef struct gx_device_procs_s gx_device_procs; struct gx_device_s { int params_size; gx_device_procs *procs; const char *dname; int width; int height; float x_pixels_per_inch; float y_pixels_per_inch; float l_margin, b_margin, r_margin, t_margin; gx_device_color_info color_info; int is_open; }; typedef struct gs_prop_item_s gs_prop_item; struct gx_device_procs_s { int (*open_device)(gx_device *dev ); void (*get_initial_matrix)(gx_device *dev, gs_matrix *pmat ); int (*sync_output)(gx_device *dev ); int (*output_page)(gx_device *dev, int num_copies, int flush ); int (*close_device)(gx_device *dev ); gx_color_index (*map_rgb_color)(gx_device *dev, gx_color_value red, gx_color_value green, gx_color_value blue ); int (*map_color_rgb)(gx_device *dev, gx_color_index color, gx_color_value rgb[3] ); int (*fill_rectangle)(gx_device *dev, int x, int y, int width, int height, gx_color_index color ); int (*tile_rectangle)(gx_device *dev, gx_bitmap *tile, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y ); int (*copy_mono)(gx_device *dev, unsigned char *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1 ); int (*copy_color)(gx_device *dev, unsigned char *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height ); int (*draw_line)(gx_device *dev, int x0, int y0, int x1, int y1, gx_color_index color ); int (*get_bits)(gx_device *dev, int y, unsigned char *data, unsigned int size, int pad_to_word ); int (*get_props)(gx_device *dev, gs_prop_item *plist ); int (*put_props)(gx_device *dev, gs_prop_item *plist, int count ); }; extern unsigned int gx_device_bytes_per_scan_line(gx_device *dev, int pad_to_word ); int gx_default_open_device(gx_device *dev ); void gx_default_get_initial_matrix(gx_device *dev, gs_matrix *pmat ); int gx_default_sync_output(gx_device *dev ); int gx_default_output_page(gx_device *dev, int num_copies, int flush ); int gx_default_close_device(gx_device *dev ); gx_color_index gx_default_map_rgb_color(gx_device *dev, gx_color_value red, gx_color_value green, gx_color_value blue ); int gx_default_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3] ); int gx_default_tile_rectangle(gx_device *dev, gx_bitmap *tile, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y ); int gx_default_copy_color(gx_device *dev, unsigned char *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height ); int gx_default_draw_line(gx_device *dev, int x0, int y0, int x1, int y1, gx_color_index color ); int gx_default_get_bits(gx_device *dev, int y, unsigned char *data, unsigned int size, int pad_to_word ); int gx_default_get_props(gx_device *dev, gs_prop_item *plist ); int gx_default_put_props(gx_device *dev, gs_prop_item *plist, int count ); typedef struct device_s { gx_device *info; int is_band_device; gx_color_index white, black; } device; int gs_initmatrix(gs_state * ), gs_defaultmatrix(const gs_state *, gs_matrix * ), gs_currentmatrix(const gs_state *, gs_matrix * ), gs_setmatrix(gs_state *, const gs_matrix * ), gs_translate(gs_state *, floatp, floatp ), gs_scale(gs_state *, floatp, floatp ), gs_rotate(gs_state *, floatp ), gs_concat(gs_state *, const gs_matrix * ); int gs_transform(gs_state *, floatp, floatp, gs_point * ), gs_dtransform(gs_state *, floatp, floatp, gs_point * ), gs_itransform(gs_state *, floatp, floatp, gs_point * ), gs_idtransform(gs_state *, floatp, floatp, gs_point * ); static int ctm_set_inverse(gs_state *pgs) { int code = gs_matrix_invert(&*(gs_matrix *)&(pgs)->ctm , &pgs->ctm_inverse); 0; if ( code < 0 ) return code; pgs->inverse_valid = 1; return 0; } void gs_update_matrix_fixed(gs_matrix_fixed *pmat) { (*pmat). tx = ((float)(((*pmat). tx_fixed = ((fixed)(((*pmat). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (*pmat). ty = ((float)(((*pmat). ty_fixed = ((fixed)(((*pmat). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))); } int gs_initmatrix(gs_state *pgs) { gx_device *dev = pgs->device->info; (*dev->procs->get_initial_matrix)(dev, &*(gs_matrix *)&(pgs)->ctm ); (pgs->ctm). tx = ((float)(((pgs->ctm). tx_fixed = ((fixed)(((pgs->ctm). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (pgs->ctm). ty = ((float)(((pgs->ctm). ty_fixed = ((fixed)(((pgs->ctm). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , pgs->inverse_valid = 0, pgs->char_tm_valid = 0; return 0; } int gs_defaultmatrix(const gs_state *pgs, gs_matrix *pmat) { gx_device *dev = pgs->device->info; (*dev->procs->get_initial_matrix)(dev, pmat); return 0; } int gs_currentmatrix(const gs_state *pgs, gs_matrix *pmat) { *pmat = *(gs_matrix *)&(pgs)->ctm; return 0; } int gs_setmatrix(gs_state *pgs, const gs_matrix *pmat) { *(gs_matrix *)&(pgs)->ctm = *pmat; (pgs->ctm). tx = ((float)(((pgs->ctm). tx_fixed = ((fixed)(((pgs->ctm). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (pgs->ctm). ty = ((float)(((pgs->ctm). ty_fixed = ((fixed)(((pgs->ctm). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , pgs->inverse_valid = 0, pgs->char_tm_valid = 0; return 0; } int gs_translate(gs_state *pgs, floatp dx, floatp dy) { gs_point pt; int code; if ( (code = gs_distance_transform(dx, dy, &*(gs_matrix *)&(pgs)->ctm , &pt)) < 0 ) return code; pgs->ctm.tx += pt.x; pgs->ctm.ty += pt.y; (pgs->ctm). tx = ((float)(((pgs->ctm). tx_fixed = ((fixed)(((pgs->ctm). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (pgs->ctm). ty = ((float)(((pgs->ctm). ty_fixed = ((fixed)(((pgs->ctm). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , pgs->inverse_valid = 0, pgs->char_tm_valid = 0; return 0; } int gs_scale(gs_state *pgs, floatp sx, floatp sy) { pgs->ctm.xx *= sx; pgs->ctm.xy *= sx; pgs->ctm.yx *= sy; pgs->ctm.yy *= sy; pgs->inverse_valid = 0, pgs->char_tm_valid = 0; return 0; } int gs_rotate(gs_state *pgs, floatp ang) { int code = gs_matrix_rotate(&*(gs_matrix *)&(pgs)->ctm , ang, &*(gs_matrix *)&(pgs)->ctm ); pgs->inverse_valid = 0, pgs->char_tm_valid = 0; return code; } int gs_concat(gs_state *pgs, const gs_matrix *pmat) { int code = gs_matrix_multiply(pmat, &*(gs_matrix *)&(pgs)->ctm , &*(gs_matrix *)&(pgs)->ctm ); (pgs->ctm). tx = ((float)(((pgs->ctm). tx_fixed = ((fixed)(((pgs->ctm). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (pgs->ctm). ty = ((float)(((pgs->ctm). ty_fixed = ((fixed)(((pgs->ctm). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , pgs->inverse_valid = 0, pgs->char_tm_valid = 0; return code; } int gs_transform(gs_state *pgs, floatp x, floatp y, gs_point *pt) { return gs_point_transform(x, y, &*(gs_matrix *)&(pgs)->ctm , pt); } int gs_dtransform(gs_state *pgs, floatp dx, floatp dy, gs_point *pt) { return gs_distance_transform(dx, dy, &*(gs_matrix *)&(pgs)->ctm , pt); } int gs_itransform(gs_state *pgs, floatp x, floatp y, gs_point *pt) { if ( !!(((*(long *)(&((&pgs->ctm)->xy)) | *(long *)(&( (&pgs->ctm)->yx)) ) << 1) == 0) ) { return gs_point_transform_inverse(x, y, &*(gs_matrix *)&(pgs)->ctm , pt); } else { if ( !pgs->inverse_valid ) { int code = ctm_set_inverse(pgs); if ( code < 0 ) return code; }; return gs_point_transform(x, y, &pgs->ctm_inverse, pt); } } int gs_idtransform(gs_state *pgs, floatp dx, floatp dy, gs_point *pt) { if ( !!(((*(long *)(&((&pgs->ctm)->xy)) | *(long *)(&( (&pgs->ctm)->yx)) ) << 1) == 0) ) { return gs_distance_transform_inverse(dx, dy, &*(gs_matrix *)&(pgs)->ctm , pt); } else { if ( !pgs->inverse_valid ) { int code = ctm_set_inverse(pgs); if ( code < 0 ) return code; }; return gs_distance_transform(dx, dy, &pgs->ctm_inverse, pt); } } int gs_translate_to_fixed(register gs_state *pgs, fixed px, fixed py) { pgs->ctm.tx = ((float)((pgs->ctm.tx_fixed = px)*(1.0/(1<<12 ) ))); pgs->ctm.ty = ((float)((pgs->ctm.ty_fixed = py)*(1.0/(1<<12 ) ))); pgs->inverse_valid = 0; pgs->char_tm_valid = 1; return 0; } int gx_matrix_to_fixed_coeff(const gs_matrix *pmat, register fixed_coeff *pfc, int max_bits) { gs_matrix ctm; int scale = -10000; int expt, shift; ctm = *pmat; pfc->skewed = 0; if ( !((*(long *)(&(ctm.xx)) << 1) == 0) ) { (void)frexp(ctm.xx, &scale); } if ( !((*(long *)(&(ctm.xy)) << 1) == 0) ) { (void)frexp(ctm.xy, &expt); if ( expt > scale ) scale = expt; pfc->skewed = 1; } if ( !((*(long *)(&(ctm.yx)) << 1) == 0) ) { (void)frexp(ctm.yx, &expt); if ( expt > scale ) scale = expt; pfc->skewed = 1; } if ( !((*(long *)(&(ctm.yy)) << 1) == 0) ) { (void)frexp(ctm.yy, &expt); if ( expt > scale ) scale = expt; } scale = sizeof(long) * 8 - 1 - max_bits - scale; shift = scale - 12; if ( shift > 0 ) { pfc->shift = shift; pfc->round = (fixed)1 << (shift - 1); } else { pfc->shift = 0; pfc->round = 0; scale -= shift; } pfc->xx = (((*(long *)(&(ctm.xx)) << 1) == 0) ? 0 : (long)ldexp(ctm.xx, scale)); pfc->yy = (((*(long *)(&(ctm.yy)) << 1) == 0) ? 0 : (long)ldexp(ctm.yy, scale)); if ( pfc->skewed ) { pfc->xy = (((*(long *)(&(ctm.xy)) << 1) == 0) ? 0 : (long)ldexp(ctm.xy, scale)); pfc->yx = (((*(long *)(&(ctm.yx)) << 1) == 0) ? 0 : (long)ldexp(ctm.yx, scale)); } else pfc->xy = pfc->yx = 0; pfc->max_bits = max_bits; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920428-3.c ================================================ /* { dg-require-effective-target label_values } */ /* { dg-require-effective-target indirect_jumps } */ x(a){static void*j[]={&&l1,&&l2};goto*j[a];l1:return 0;l2:return 1;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920428-4.c ================================================ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ x(a){struct{int p[a],i;}l;l.i;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920428-5.c ================================================ typedef struct{unsigned b0:1;}*t;x(a,b)t a,b;{b->b0=a->b0;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920428-6.c ================================================ typedef struct x { struct x *type; struct x *chain; struct x *value; } *tree; int func (new, old) register tree new, old; { if (old->type == 0 || new->type == 0) { register tree t = old->type; if (t == 0) t = new->type; for (; t; t = t->chain ) if (t->value) return 1; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920428-7.c ================================================ x(float*x){int a[4],i=0,j;for(j=0;j<2;j++){f(a[i++]);f(a[i++]);}} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-1.c ================================================ #ifndef NO_LABEL_VALUES a(){int**b[]={&&c};c:;} #else int x; #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-10.c ================================================ x(y){return 8193*y;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-11.c ================================================ typedef struct{int s;}S;foo(){int i=(int)&(S){(void*)((int)&(S){1})};} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-12.c ================================================ /* { dg-do assemble } */ x(x){ return 3 + x;} a(x){int y[994]; return 3 + x;} b(x){int y[999]; return 2*(x + 3);} A(x){int y[9999];return 2*(x + 3);} B(x){int y[9949];return 3 + x;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-13.c ================================================ typedef struct{int i;}t;inline y(t u){}x(){t u;y(u);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-15.c ================================================ x(a)double a;{int i;return i>a?i:i+1;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-16.c ================================================ f(n){struct z{int a,b[n],c[n];};} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-17.c ================================================ x(){static const char x[]="x";char y[2];y[0]=x[1];} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-18.c ================================================ union u{int i;float f;}; x(p)int p;{union u x;for(x.i=0;x.i(float)3.0)break;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-19.c ================================================ long long x=0;y(){x=0;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-2.c ================================================ extern short distdata[64][64], taxidata[64][64]; extern short PieceList[2][64]; int ScoreKBNK (short int winner, short int king1, short int king2) { register short s; s = taxidata[king1][king2] + distdata[PieceList[winner][1]][king2]; return s; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-20.c ================================================ int*f(x)int*x;{if(x[4]){int h[1];if(setjmp(h))return x;}} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-21.c ================================================ typedef unsigned short t; struct foo{t d;}; int bar(d)t d;{struct foo u;u.d=d;return(int)(&u);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-22.c ================================================ x(){int y[]={};} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-23.c ================================================ typedef unsigned char qi; typedef unsigned short hi; typedef unsigned long si; typedef unsigned long long di; subi(a){return 100-a;} add(a,b){return a+b;} mul(a){return 85*a;} memshift(p)unsigned*p;{unsigned x;for(;;){x=*p++>>16;if(x)return x;}} ldw(xp)si*xp;{return xp[4];} ldws_m(xp)si*xp;{si x;do{x=xp[3];xp+=3;}while(x);} postinc_si(p)si*p;{si x;for(;;){x=*p++;if(x)return x;}} preinc_si(p)si*p;{si x;for(;;){x=*++p;if(x)return x;}} postinc_di(p)di*p;{di x;for(;;){x=*p++;if(x)return x;}} preinc_di(p)di*p;{di x;for(;;){x=*++p;if(x)return x;}} inc_overlap(p,a)di*p;{do{p=*(di**)p;p=(di*)((int)p+4);}while(*p);} di move_di(p,p2)di*p,*p2;{di x=p;p2=((di*)x)[1];return p2[1];} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-3.c ================================================ struct{long long x:24,y:40;}v; x(){v.y=0;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-4.c ================================================ /* { dg-do assemble } */ /* { dg-skip-if "ptxas times out" { nvptx-*-* } { "-O1" } { "" } } */ foo () { int r0[8186 ]; int r1[2 ]; int r2[2 ]; int bitm0[2 ]; int bitm1[2 ]; int bitm2[2 ]; int i,j,k,m,n,m_max; int f; double fm,ft; while (1) { if (m%4 == 2) ++m; if (m_max != 0 && m > m_max) break; fm=m; r0[k=1]=0; bitm0[0] = 0; while ( n%f == 0 ) { while ( (ft != 0) && (ft < fm )) { bitm1[i] = 0; r1[i]=0; } while ( r0[i] != 0 && r1[i] != 0 ) { if ( r0[i] < r1[i] ) { bitm2[k] = bitm0[i]; r2[k++]=0; } else if ( r0[i] > r1[j] ) { bitm2[k] = bitm1[j]; r2[k++]=r1[j++]; } else { bitm1[k] = bitm0[i]; r2[k++]=r0[i++]; } } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-6.c ================================================ x(y,z)float*y;{*y=z;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-7.c ================================================ /* { dg-require-effective-target label_values } */ x(){if(&&e-&&b<0)x();b:goto*&&b;e:;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-8.c ================================================ x(int*p){int x=p;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920501-9.c ================================================ short x(a)unsigned a;{a=32987799;return a;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920502-1.c ================================================ /* { dg-require-effective-target indirect_jumps } */ extern void*t[];x(i){goto*t[i];} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920502-2.c ================================================ x(c){1LL<= 0; j = j - 1) { acc = (acc << 16) | a[j]; acc = acc % *b; } return; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920608-1.c ================================================ foo (p) int *p; { int x; int a; a = p[0]; x = a + 5; a = -1; p[0] = x - 5; return a; } bar (p) { short x; int a; x = ((short *) p)[1]; #if INHIBIT_COMBINE ((short *) p)[0] = x; #endif return (x < 45); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920611-2.c ================================================ typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; static unsigned long S[1][1]={0x00820200}; static int body(out0,out1,ks,Eswap0,Eswap1) ulong *out0,*out1; int *ks; ulong Eswap0,Eswap1; { register unsigned long l,r,t,u,v; register unsigned long *s; register int i,j; register unsigned long E0,E1; l=0; r=0; s=(ulong *)ks; E0=Eswap0; E1=Eswap1; for (i=0; i<(16 *2); i+=4) { v=(r^(r>>16)); u=(v&E0); v=(v&E1); u=(u^(u<<16))^r^s[ i ]; t=(v^(v<<16))^r^s[ i+1]; t=(t>>4)|(t<<28); l^=S[1][(t)&0x3f]| S[3][(t>> 8)&0x3f]| S[5][(t>>16)&0x3f]| S[7][(t>>24)&0x3f]| S[0][(u)&0x3f]| S[2][(u>> 8)&0x3f]| S[4][(u>>16)&0x3f]| S[6][(u>>24)&0x3f]; v=(l^(l>>16)); u=(v&E0); v=(v&E1); u=(u^(u<<16))^l^s[ i+2 ]; t=(v^(v<<16))^l^s[ i+2+1]; t=(t>>4)|(t<<28); r^= S[1][(t )&0x3f]; } t=l; l=r; r=t; t=r; r=(l>>1)|(l<<31); l=(t>>1)|(t<<31); *out0=l; *out1=r; return(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920615-1.c ================================================ f() { int x[20] = {[0] = 5, [10] = 12}; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920617-1.c ================================================ f(){double*xp,y;*xp++=sqrt(y);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920617-2.c ================================================ f(a,b,c,d)float a[],d;int b[],c;{} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920623-1.c ================================================ int f(int c){return f(c--);} g(){} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920624-1.c ================================================ int B[],Q[]; f(){int s;for(s=0;s<=1;s++)switch(s){case 2:case 3:++B[s];case 4:case 5:++Q[s];}} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920625-1.c ================================================ typedef unsigned long int unsigned_word; typedef signed long int signed_word; typedef unsigned_word word; typedef enum { ADD, ADD_CI, ADD_CO, ADD_CIO, SUB, SUB_CI, SUB_CO, SUB_CIO, ADC_CI, ADC_CO, ADC_CIO, AND, IOR, XOR, ANDC, IORC, EQV, NAND, NOR, AND_RC, IOR_RC, XOR_RC, ANDC_RC, IORC_RC, EQV_RC, NAND_RC, NOR_RC, AND_CC, IOR_CC, XOR_CC, ANDC_CC, IORC_CC, EQV_CC, NAND_CC, NOR_CC, LSHIFTR, ASHIFTR, SHIFTL, LSHIFTR_CO, ASHIFTR_CO, SHIFTL_CO, ROTATEL, ROTATEL_CO, ROTATEXL_CIO, ASHIFTR_CON, EXTS1, EXTS2, EXTU1, EXTU2, CLZ, CTZ, FF1, FF0, ABSVAL, NABSVAL, CMP, CPEQ, CPGE, CPGEU, CPGT, CPGTU, CPLE, CPLEU, CPLT, CPLTU, CPNEQ, CMPPAR, DOZ, COPY, EXCHANGE, COMCY, } opcode_t; typedef struct { opcode_t opcode:8; unsigned int s1:8; unsigned int s2:8; unsigned int d:8; } insn_t; enum prune_flags { NO_PRUNE = 0, CY_0 = 1, CY_1 = 2, CY_JUST_SET = 4, }; int flag_use_carry = 1; inline recurse(opcode_t opcode, int d, int s1, int s2, word v, int cost, insn_t *sequence, int n_insns, word *values, int n_values, const word goal_value, int allowed_cost, int cy, int prune_flags) { insn_t insn; allowed_cost -= cost; if (allowed_cost > 0) { word old_d; old_d = values[d]; values[d] = v; insn.opcode = opcode; insn.s1 = s1; insn.s2 = s2; insn.d = d; sequence[n_insns] = insn; synth(sequence, n_insns + 1, values, n_values, goal_value, allowed_cost, cy, prune_flags); values[d] = old_d; } else if (goal_value == v) { insn.opcode = opcode; insn.s1 = s1; insn.s2 = s2; insn.d = d; sequence[n_insns] = insn; test_sequence(sequence, n_insns + 1); } } synth(insn_t *sequence, int n_insns, word *values, int n_values, word goal_value, int allowed_cost, int ci, int prune_hint) { int s1, s2; word v, r1, r2; int co; int last_dest; if (n_insns > 0) last_dest = sequence[n_insns - 1].d; else last_dest = -1; if (ci >= 0 && flag_use_carry) { for (s1 = n_values - 1; s1 >= 0; s1--) { r1 = values[s1]; for (s2 = s1 - 1; s2 >= 0; s2--) { r2 = values[s2]; if (allowed_cost <= 1 && (prune_hint & CY_JUST_SET) == 0) { if (last_dest >= 0 && s1 != last_dest && s2 != last_dest) continue; } do { word __d = ( r1) + ( r2) + (( ci)); ( co) = ( ci) ? __d <= ( r1) : __d < ( r1); (v) = __d; } while (0); recurse(ADD_CIO, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); do { word __d = ( r1) + ( r2) + (( ci)); ( co) = ( ci); (v) = __d; } while (0); recurse(ADD_CI, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); do { word __d = ( r1) - ( r2) - (( ci)); ( co) = ( ci) ? __d >= ( r1) : __d > ( r1); (v) = __d; } while (0); recurse(SUB_CIO, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); do { word __d = ( r2) - ( r1) - (( ci)); ( co) = ( ci) ? __d >= ( r2) : __d > ( r2); (v) = __d; } while (0); recurse(SUB_CIO, n_values, s2, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); do { word __d = ( r1) - ( r2) - (( ci)); ( co) = ( ci); (v) = __d; } while (0); recurse(SUB_CI, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); do { word __d = ( r2) - ( r1) - (( ci)); ( co) = ( ci); (v) = __d; } while (0); recurse(SUB_CI, n_values, s2, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); } } } for (s1 = n_values - 1; s1 >= 0; s1--) { r1 = values[s1]; for (s2 = s1 - 1; s2 >= 0; s2--) { r2 = values[s2]; if (allowed_cost <= 1) { if (last_dest >= 0 && s1 != last_dest && s2 != last_dest) continue; } do { word __d = ( r1) + ( r2); ( co) = __d < ( r1); (v) = __d; } while (0); recurse(ADD_CO, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); ((v) = ( r1) + ( r2), ( co) = ( ci)); recurse(ADD, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); do { word __d = ( r1) - ( r2); ( co) = __d > ( r1); (v) = __d; } while (0); recurse(SUB_CO, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); do { word __d = ( r2) - ( r1); ( co) = __d > ( r2); (v) = __d; } while (0); recurse(SUB_CO, n_values, s2, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); ((v) = ( r1) - ( r2), ( co) = ( ci)); recurse(SUB, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ( r2) - ( r1), ( co) = ( ci)); recurse(SUB, n_values, s2, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ( r1) & ( r2), ( co) = ( ci)); recurse(AND, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ( r1) | ( r2), ( co) = ( ci)); recurse(IOR, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ( r1) ^ ( r2), ( co) = ( ci)); recurse(XOR, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ( r1) & ~( r2), ( co) = ( ci)); recurse(ANDC, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ( r2) & ~( r1), ( co) = ( ci)); recurse(ANDC, n_values, s2, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ( r1) | ~( r2), ( co) = ( ci)); recurse(IORC, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ( r2) | ~( r1), ( co) = ( ci)); recurse(IORC, n_values, s2, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ( r1) ^ ~( r2), ( co) = ( ci)); recurse(EQV, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); } } if (ci >= 0 && flag_use_carry) { for (s1 = n_values - 1; s1 >= 0; s1--) { r1 = values[s1]; if (allowed_cost <= 1 && (prune_hint & CY_JUST_SET) == 0) { if (last_dest >= 0 && s1 != last_dest) continue; } do { word __d = ( r1) + ( r1) + (( ci)); ( co) = ( ci) ? __d <= ( r1) : __d < ( r1); (v) = __d; } while (0); recurse(ADD_CIO, n_values, s1, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); do { word __d = ( r1) + ( r1) + (( ci)); ( co) = ( ci); (v) = __d; } while (0); recurse(ADD_CI, n_values, s1, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); do { word __d = ( r1) + ( -1 ) + (( ci)); ( co) = ( ci) ? __d <= ( r1) : __d < ( r1); (v) = __d; } while (0); recurse(ADD_CIO, n_values, s1, (0x20 + -1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); do { word __d = ( r1) + ( 0 ) + (( ci)); ( co) = ( ci) ? __d <= ( r1) : __d < ( r1); (v) = __d; } while (0); recurse(ADD_CIO, n_values, s1, (0x20 + 0) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); do { word __d = ( 0 ) - ( r1) - (( ci)); ( co) = ( ci) ? __d >= ( 0 ) : __d > ( 0 ); (v) = __d; } while (0); recurse(SUB_CIO, n_values, (0x20 + 0) , s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); } } for (s1 = n_values - 1; s1 >= 0; s1--) { r1 = values[s1]; if (allowed_cost <= 1) { if (last_dest >= 0 && s1 != last_dest) continue; } do { word __d = ( r1) + ( r1); ( co) = __d < ( r1); (v) = __d; } while (0); recurse(ADD_CO, n_values, s1, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); ((v) = ( r1) & ( 1 ), ( co) = ( ci)); recurse(AND, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ( r1) ^ ( 1 ), ( co) = ( ci)); recurse(XOR, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ( -1 ) - ( r1), ( co) = ( ci)); recurse(SUB, n_values, (0x20 + -1) , s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); do { word __d = ( r1) + ( 1 ); ( co) = __d < ( r1); (v) = __d; } while (0); recurse(ADD_CO, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); ((v) = ( r1) + ( 1 ), ( co) = ( ci)); recurse(ADD, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); do { word __d = ( r1) + ( -1 ); ( co) = __d < ( r1); (v) = __d; } while (0); recurse(ADD_CO, n_values, s1, (0x20 + -1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); do { word __d = ( r1) - ( 1 ); ( co) = __d > ( r1); (v) = __d; } while (0); recurse(SUB_CO, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); do { word __d = ( 0 ) - ( r1); ( co) = __d > ( 0 ); (v) = __d; } while (0); recurse(SUB_CO, n_values, (0x20 + 0) , s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); ((v) = ( 0 ) - ( r1), ( co) = ( ci)); recurse(SUB, n_values, (0x20 + 0) , s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ((unsigned_word) ( r1) >> (( 1 ) & (32 - 1)) ), ( co) = ( ci)); recurse(LSHIFTR, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ((signed_word) ( r1) >> (( 1 ) & (32 - 1)) ), ( co) = ( ci)); recurse(ASHIFTR, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ((signed_word) ( r1) << (( 1 ) & (32 - 1)) ), ( co) = ( ci)); recurse(SHIFTL, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ((unsigned_word) ( r1) >> (( 32 -1 ) & (32 - 1)) ), ( co) = ( ci)); recurse(LSHIFTR, n_values, s1, (0x20 + 32 -1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ((signed_word) ( r1) >> (( 32 -1 ) & (32 - 1)) ), ( co) = ( ci)); recurse(ASHIFTR, n_values, s1, (0x20 + 32 -1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); } if (ci >= 0 && flag_use_carry && (allowed_cost <= 1 ? ((prune_hint & CY_JUST_SET) != 0) : 1)) { do { word __d = ( 0 ) + ( 0 ) + (( ci)); ( co) = ( ci) ? __d <= ( 0 ) : __d < ( 0 ); (v) = __d; } while (0); recurse(ADD_CIO, n_values, (0x20 + 0) , (0x20 + 0) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET | CY_0); do { word __d = ( 0 ) - ( 0 ) - (( ci)); ( co) = ( ci) ? __d >= ( 0 ) : __d > ( 0 ); (v) = __d; } while (0); recurse(SUB_CIO, n_values, (0x20 + 0) , (0x20 + 0) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); do { word __d = ( 0 ) - ( -1 ) - (( ci)); ( co) = ( ci) ? __d >= ( 0 ) : __d > ( 0 ); (v) = __d; } while (0); recurse(SUB_CIO, n_values, (0x20 + 0) , (0x20 + -1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET | CY_1); do { word __d = ( 0 ) + ( -1 ) + (( ci)); ( co) = ( ci) ? __d <= ( 0 ) : __d < ( 0 ); (v) = __d; } while (0); recurse(ADD_CIO, n_values, (0x20 + 0) , (0x20 + -1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); } if (allowed_cost > 1) { ((v) = ( 0x80000000 ), ( co) = ( ci)); recurse(COPY, n_values, (0x20 - 2) , 0, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ( -1 ), ( co) = ( ci)); recurse(COPY, n_values, (0x20 + -1) , 0, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); ((v) = ( 1 ), ( co) = ( ci)); recurse(COPY, n_values, (0x20 + 1) , 0, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920625-2.c ================================================ typedef char * caddr_t; typedef unsigned Cursor; typedef char *String; typedef struct _WidgetRec *Widget; typedef char Boolean; typedef unsigned int Cardinal; typedef struct _XedwListReturnStruct { String string; int xedwList_index; struct _XedwListReturnStruct *next; } XedwListReturnStruct; static XedwListReturnStruct *return_list; static String srcdir, dstdir; char *strcpy(); extern void setCursor(Cursor); extern void query_dialog(String, Boolean); extern Boolean directoryManagerNewDirectory(String); trashQueryResult(Widget w, Boolean delete, caddr_t call_data) { int execute(String, String, String, Boolean); extern void destroy_button_dialog(void); extern void changestate(Boolean); extern Cursor busy, left_ptr; extern String cwd; extern void freeReturnStruct(void); String rmstring; int status; XedwListReturnStruct *tmp; setCursor(busy); destroy_button_dialog(); if (delete == 1) { rmstring = (("rm -fr") != ((void *)0) ? (strcpy((char*)XtMalloc((unsigned)strlen("rm -fr") + 1), "rm -fr")) : ((void *)0)); tmp = return_list; while (tmp != ((void *)0)) { rmstring = (String) XtRealloc (rmstring, sizeof(char) * (strlen(rmstring) + strlen(tmp->string) + 5)); sprintf(rmstring, "%s '%s'", rmstring, tmp->string); tmp = tmp->next; } if ((status = execute(((void *)0), "rm", rmstring, 1)) != 0) { XBell(XtDisplay(w), 100); query_dialog("Can't remove file", 0); } XtFree(rmstring); directoryManagerNewDirectory(cwd); } else { changestate(1); } setCursor(left_ptr); freeReturnStruct(); } copyQueryResult(Widget w, Boolean copy, caddr_t call_data) { extern void destroy_button_dialog(); extern void changestate(Boolean); extern Cursor busy, left_ptr; extern void freeReturnStruct(void); int execute(String, String, String, Boolean); extern String cwd; String copystring; int status; Cardinal srclen, dstlen; XedwListReturnStruct *tmp; destroy_button_dialog(); setCursor(busy); if (copy == 1) { srclen = strlen(srcdir); dstlen = strlen(dstdir); copystring = (("cp -r") != ((void *)0) ? (strcpy((char*)XtMalloc((unsigned)strlen("cp -r") + 1), "cp -r")) : ((void *)0)); tmp = return_list; while (tmp != ((void *)0)) { copystring = (String) XtRealloc (copystring, sizeof(char) * (strlen(copystring) + strlen(tmp->string) + srclen + 6)); sprintf(copystring, "%s '%s/%s'", copystring, srcdir, tmp->string); tmp = tmp->next; } copystring = (String) XtRealloc (copystring, sizeof(char) * (strlen(copystring) + dstlen + 5)); sprintf(copystring, "%s '%s'", copystring, dstdir); if ((status = execute(((void *)0), "cp", copystring, 1)) != 0) { XBell(XtDisplay(w), 100); query_dialog("Can't copy file!", 0); } XtFree(copystring); directoryManagerNewDirectory(cwd); } else { changestate(1); } XtFree(srcdir); XtFree(dstdir); setCursor(left_ptr); freeReturnStruct(); } void freeReturnStruct(){} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920626-1.c ================================================ f(x)unsigned x;{return x>>-5;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920701-1.c ================================================ f(char*c){extern char a[],b[];return a+(b-c);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920702-1.c ================================================ int somevar; void yylex () { register int result = 0; int num_bits = -1; if (((result >> -1) & 1)) somevar = 99; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920706-1.c ================================================ f(){float i[2],o[1];g(o);return*o;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920710-2.c ================================================ union u { struct {unsigned h, l;} i; double d; }; foo (union u x) { while (x.i.h++) { while (x.i.l-- > 0) ; while (x.d++ > 0) ; } } union n { long long unsigned i; double d; }; bar (union n x) { int i; for (i = 0; i < 100; i++) { while (--x.i > 0) ; while (++x.d > 0) ; } return x.i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920711-1.c ================================================ f(a){a=(1,1)/2;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920721-1.c ================================================ typedef struct{short ttype;float s;}T; short t[8][8]; T f(T t2,T t1) { T x; if (t1.ttype == 1) x.ttype = t[t2.ttype][t1.ttype], x.s = 1; return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920723-1.c ================================================ #if defined(STACK_SIZE) && STACK_SIZE < 65536 # define GITT_SIZE 75 #endif #ifndef GITT_SIZE # define GITT_SIZE 150 #endif typedef struct { double x, y; } vector_t; double sqrt(); f(int count,vector_t*pos,double r,double *rho) { int i, j, miny, maxy, hy; float help, d; int gitt[GITT_SIZE][GITT_SIZE]; int *data = (int *)malloc(count*sizeof(int)); for (i = 0; i < count; i++) rho[i] = 0; for (i = 1; i < count; i++) for (hy = miny; hy<= maxy; hy++) while(j >=0) { d = pos[i].y - pos[j].y; if ( d <= r) { d = sqrt(d); rho[i] += help; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920729-1.c ================================================ extern volatile int i; f(){int j;for(;;)j = i;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920806-1.c ================================================ f(){short x=32000;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920808-1.c ================================================ f(i){for(i=1;i<=2;({;}),i++){({;}),g();}} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920809-1.c ================================================ f(x,y){memcpy (&x,&y,8192);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920817-1.c ================================================ int v;static inline f(){return 0;}g(){return f();}void h(){return v++;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920820-1.c ================================================ long long f(double y){return y;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920821-1.c ================================================ /* empty */ ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920821-2.c ================================================ typedef struct{int p[25];}t1; struct{t1 x,y;}y; t1 x[1]; f(){y.x=*x;y.y=*x;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920825-1.c ================================================ #pragma pack(1) struct{unsigned short f1:5;unsigned short f2:6;}x; f(){x.f2=1;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920825-2.c ================================================ f(double*a,int m){int j;for(j=0;ji->d+(fx+w+x)/8+(fy+h+y)*p->i->b)&(1<<((fx+w+x)%8)))?1:0)); q2=((int)((*(p->i->d+(fx+w+y)/8+(fy+h-s-x)*p->i->b)&(1<<((fx+w+y)%8)))?1:0)); q3=((int)((*(p->i->d+(fx+w-s-x)/8+(fy+h-s-y)*p->i->b)&(1<<((fx+w-s-x)%8)))?1:0)); q4=((int)((*(p->i->d+(fx+w-s-y)/8+(fy+h+x)*p->i->b)&(1<<((fx+w-s-y)%8)))?1:0)); if(q4!=q1) ff(p,fx+w-s-y,fy+h+x); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920928-3.c ================================================ f (int phaseone) { typedef struct { unsigned char *p; } FILE; FILE b[2]; static unsigned char xchr[2]; int j; int for_end; if (phaseone) { if (j <= for_end) do *(b[1].p) = xchr[j]; while (j++ < 10); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920928-4.c ================================================ typedef unsigned char unsigned8; typedef unsigned short int unsigned16; typedef unsigned long int unsigned32; typedef char signed8; typedef short int signed16; typedef long int signed32; typedef unsigned32 boolean32; typedef unsigned long int error_status_t; typedef struct { unsigned32 time_low; unsigned16 time_mid; unsigned16 time_hi_and_version; unsigned8 clock_seq_hi_and_reserved; unsigned8 clock_seq_low; unsigned char node[6]; } uuid_t; typedef unsigned32 bitset; typedef signed32 sec_timeval_sec_t; typedef struct { signed32 sec; signed32 usec; } sec_timeval_t; typedef signed32 sec_timeval_period_t; typedef signed32 sec_rgy_acct_key_t; typedef struct { uuid_t source; signed32 handle; boolean32 valid; } sec_rgy_cursor_t; typedef unsigned char sec_rgy_pname_t[257]; typedef unsigned char sec_rgy_name_t[1025]; typedef signed32 sec_rgy_override_t; typedef signed32 sec_rgy_mode_resolve_t; typedef unsigned char sec_rgy_unix_gecos_t[292]; typedef unsigned char sec_rgy_unix_login_name_t[1025]; typedef unsigned char sec_rgy_member_t[1025]; typedef unsigned char sec_rgy_unix_passwd_buf_t[16]; typedef struct sec_rgy_sid_t { uuid_t person; uuid_t group; uuid_t org; } sec_rgy_sid_t; typedef struct { signed32 person; signed32 group; signed32 org; } sec_rgy_unix_sid_t; typedef struct { sec_rgy_unix_login_name_t name; sec_rgy_unix_passwd_buf_t passwd; signed32 uid; signed32 gid; signed32 oid; sec_rgy_unix_gecos_t gecos; sec_rgy_pname_t homedir; sec_rgy_pname_t shell; } sec_rgy_unix_passwd_t; typedef unsigned char sec_rgy_member_buf_t[10250]; typedef struct { sec_rgy_name_t name; signed32 gid; sec_rgy_member_buf_t members; } sec_rgy_unix_group_t; typedef struct { uuid_t site_id; sec_timeval_sec_t person_dtm; sec_timeval_sec_t group_dtm; sec_timeval_sec_t org_dtm; } rs_cache_data_t; typedef enum { rs_unix_query_name, rs_unix_query_unix_num, rs_unix_query_none } rs_unix_query_t; typedef struct { rs_unix_query_t query; union { struct { long int name_len; sec_rgy_name_t name; } name; long int unix_num; } tagged_union; } rs_unix_query_key_t; static unsigned long int IDL_offset_vec[] = { 0, sizeof(sec_rgy_unix_group_t), (unsigned long int) ((unsigned char *) &((sec_rgy_unix_group_t *) 0)->name - (unsigned char *) 0), (unsigned long int) ((unsigned char *) &((sec_rgy_unix_group_t *) 0)->gid - (unsigned char *) 0), (unsigned long int) ((unsigned char *) &((sec_rgy_unix_group_t *) 0)->members - (unsigned char *) 0), sizeof(rs_cache_data_t), (unsigned long int) ((unsigned char *) &((rs_cache_data_t *) 0)->site_id.time_low - (unsigned char *) 0), (unsigned long int) ((unsigned char *) &((rs_cache_data_t *) 0)->site_id.time_mid - (unsigned char *) 0), (unsigned long int) ((unsigned char *) &((rs_cache_data_t *) 0)->site_id.time_hi_and_version - (unsigned char *) 0), sizeof(sec_rgy_unix_passwd_t), (unsigned long int) ((unsigned char *) &((sec_rgy_cursor_t *) 0)->source.clock_seq_hi_and_reserved - (unsigned char *) 0), (unsigned long int) ((unsigned char *) &((sec_rgy_cursor_t *) 0)->source.clock_seq_low - (unsigned char *) 0), (unsigned long int) ((unsigned char *) &((sec_rgy_cursor_t *) 0)->source.node - (unsigned char *) 0), (unsigned long int) ((unsigned char *) &((sec_rgy_cursor_t *) 0)->handle - (unsigned char *) 0), (unsigned long int) ((unsigned char *) &((sec_rgy_cursor_t *) 0)->valid - (unsigned char *) 0), sizeof(struct {long int name_len; sec_rgy_name_t name;}), (unsigned long int) ((unsigned char *) &((struct {long int name_len; sec_rgy_name_t name;} *)0)->name_len - (unsigned char *) 0), (unsigned long int) ((unsigned char *) &((struct {long int name_len; sec_rgy_name_t name;} *)0)->name - (unsigned char *) 0), }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920928-5.c ================================================ /* REPRODUCED:CC1:SIGNAL MACHINE:m68k OPTIONS:-fpcc-struct-return */ struct b{}; f(struct b(*f)()) { struct b d=f(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/920928-6.c ================================================ struct{int c;}v; static short i=((char*)&(v.c)-(char*)&v); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921004-1.c ================================================ /* REPRODUCED:CC1:SIGNAL MACHINE:i386 OPTIONS: */ long long f() { long long*g,*s; return*g+*s; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921011-1.c ================================================ /* { dg-skip-if "ptxas times out" { nvptx-*-* } { "-O1" } { "" } } */ void fun (nb) int nb; { int th, h, em, nlwm, nlwS, nlw, sy; while (nb--) while (h--) { nlw = nlwm; while (nlw) { if (nlwS == 1) { } else if (nlwS == 1) { } nlwS--; nlw--; } if (em) nlwS--; if (++sy == th) sy = 0; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921011-2.c ================================================ extern int foobar1 (); typedef struct { unsigned long colormap; unsigned long red_max; unsigned long red_mult; unsigned long green_max; unsigned long green_mult; unsigned long blue_max; unsigned long blue_mult; unsigned long base_pixel; unsigned long visualid; unsigned long killid; } frotz; int foobar (stdcmap, count) frotz **stdcmap; int *count; { register int i; frotz *data = ((void *) 0); unsigned long nitems; int ncmaps; int old_style = 0; unsigned long def_visual = 0L; frotz *cmaps; if ( foobar1 (&data) != 0) return 0; if (nitems < 10) { ncmaps = 1; if (nitems < 9) { } } else ncmaps = (nitems / 10); { register frotz *map; register frotz *prop; for (i = ncmaps, map = cmaps, prop = data; i > 0; i--, map++, prop++) { map->colormap = prop->colormap; map->red_max = prop->red_max; map->red_mult = prop->red_mult; map->green_max = prop->green_max; map->green_mult = prop->green_mult; map->blue_max = prop->blue_max; map->blue_mult = prop->blue_mult; map->base_pixel = prop->base_pixel; map->visualid = (def_visual ? def_visual : prop->visualid); map->killid = (old_style ? 0L : prop->killid); } } *stdcmap = cmaps; *count = ncmaps; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921012-1.c ================================================ f() { g(({int x;0;})); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921012-2.c ================================================ struct foo { int a,b,c; }; f(struct foo*a,struct foo*b) { *a=*b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921013-1.c ================================================ f(int x,short y) { long z=y<0?x>0?x:0:y; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921019-1.c ================================================ struct { int n:1,c:1; }p; f() { p.c=p.n=0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921021-1.c ================================================ void g(); f() { int x=1; while(x) { x=h(); if(x) g(); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921024-1.c ================================================ long long f(s,r) { return *(long long*)(s+r); } g(s,r) { *(long long*)(s+r)=0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921026-1.c ================================================ f(unsigned short*a) { a[0]=65535; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921103-1.c ================================================ struct { unsigned int f1, f2; } s; f() { unsigned x, y; x = y = 0; while (y % 4) y++; g(&s.f2, s.f1 + x, 4); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921109-1.c ================================================ typedef struct { double x, y; } p; typedef struct { int s; float r; } t; t *e, i; int i1; f(t *op) { int i2 = e->r; p pt; int c = g(); t p; if (c) { i = *e; e -= 3; return 8; } if (op > e) return 1; op->r = pt.x; op->r = pt.y; p = *e; ++e; e->r = i1, e->s = i1; *++e = p; return 3; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921111-1.c ================================================ int ps; struct vp { int wa; }; typedef struct vp *vpt; typedef struct vc { int o; vpt py[8]; } *vct; struct n { int a; }; struct nh { int x; }; typedef struct np *npt; struct np { vct d; int di; }; struct nh xhp; struct n np[3]; f(dp) npt dp; { vpt *py; int a, l, o = 0; a = dp->d->o; if (dp->di < 0) l = ps; if ((int)o & 3) g(); xhp.x = a; py = &dp->d->py[dp->di]; if (o + l > ps) np[2].a = (int)(py[1])->wa; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921116-2.c ================================================ typedef struct { long l[5]; } t; f(size) { t event; g(&(event.l[2 + size]), (3 - size) * 4); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921118-1.c ================================================ inline f(i) { h((long long) i * 2); } g() { f(9); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921126-1.c ================================================ f() { long long a0, a1, a0s, val; int width; float d; if (d) ; if (a0s & (1LL << width)) ; return a0 / a1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921202-1.c ================================================ f () { long dx[2055]; long dy[2055]; long s1[2055]; int x, y; int i; long s; for (;;) { s = 2055; g (s1, s); for (i = 0; i < 1; i++); dy[s] = 0x12345; for (i = 0; i < 1; i++); if (x != y || h (dx, dy, s) || dx[s] != 0x12345) { j (y);k (dy); } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921202-2.c ================================================ f(x, c) { for (;;) { if (x << c) break; x++; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921203-1.c ================================================ char dispstr[]; f() { strcpy(dispstr,"xxxxxxxxxxx"); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921203-2.c ================================================ typedef struct { char x; } s1; s1 f (int arg0,...) { int args; s1 back; va_start (args, arg0); va_end (args); return back; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921206-1.c ================================================ double sqrt(double),fabs(double),sin(double); int sxs; int sys; f() { int l; int sm = -52, sx = 52; char *smap; for (l = 0; l < 9; l++) { double g; int cx, cy, gx, gy, x, y; gx = 2 > g / 3 ? 2 : g / 3; gy = 2 > g / 3 ? 2 : g / 3; for (y = 0 > cy - gy ? 0 : cy - gy; y <= (sys - 1 < cy + gy ? sys : cy + gy); y++) { int sx = 0 > cx - gx ? 0 : cx - gx; short *ax = (short *) (y * sxs + sx); for (x = sx; x <= (sxs - 1 < cx + gx ? sxs - 1 : cx + gx); x++) { double c=2.25, z=sqrt(fabs(1-c)), cz=(c>1?0.0:-10)>z?c>1?0:1:z; } } } for (l = sm; l <= sx; l++) smap[l] = l > 0 ? 1 + foo(sin(.1 * l / sx)) : 1 - foo(sin(.1 * l / sm)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/921227-1.c ================================================ #define k(a) #a char *s = k(k(1,2)); char *t = k(#) k(#undef k) k(x); f(){} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930109-1.c ================================================ f(x) unsigned x; { static short c; return x>>c; } g(x) unsigned x; { static char c; return x>>c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930109-2.c ================================================ f(r) { int i; for (i = 0; i < 2; i++) { r+= (4 >> i*2); r+= (2 >> i*2); r+= (1 >> i*2); } return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930111-1.c ================================================ /* 2.3.3 crashes on 386 with -traditional */ f(a) char *a; { int d = strcmp(a,"-"); while (vfork() < 0) ; return d; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930117-1.c ================================================ f(x) { (*(void (*)())&x)(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930118-1.c ================================================ f() { __label__ l; l:p(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930120-1.c ================================================ /* { dg-require-effective-target untyped_assembly } */ union { short I[2]; long int L; char C[4]; } itolws; char *errflg; long int dot; short dotinc; long int expvf; char * f(fcount,ifp,itype,ptype) short fcount; char *ifp; { unsigned w; long int savdot, wx; char *fp; char c, modifier, longpr; union { double dval; struct { int i1; int i2; } ival; } dw; union { float fval; int ival; } fw; int gotdot = 0; while (fcount > 0) { fp = ifp; c = *fp; longpr = ((c >= 'A') & (c <= 'Z') | (c == 'f') | (c == '4') | (c == 'p') | (c == 'i')); if ((itype == 0) || (*fp == 'a')) { wx = dot; w = dot; } else { gotdot = 1; wx = get((int)dot, itype); if (!longpr) { w = (itolws.L=(wx), itolws.I[((dot)&3)>>1]); } } if (c == 'F') { dw.ival.i1 = wx; if (itype == 0) { dw.ival.i2 = expvf; } } modifier = *fp++; switch(modifier) { case ' ' : case '\t' : break; case 't': case 'T': printf("%T",fcount); return(fp); case 'r': case 'R': printf("%M",fcount); return(fp); case 'k': printf("%k",w); break; case 'K': printf("%K",wx); break; case 'a': psymoff(dot,ptype,":%16t"); dotinc = 0; break; case 'p': psymoff(0,ptype,"%16t"); break; case 'u': printf("%-8u",w); break; case 'U': printf("%-16U",wx); break; case 'c': case 'C': if (modifier == 'C') { printesc((int)(itolws.L=(wx), itolws.C[(dot)&3])); } else { printc((char)(itolws.L=(wx), itolws.C[(dot)&3])); } dotinc = 1; break; case 'b': printf("%-8x", (itolws.L=(wx), itolws.C[(dot)&3])); dotinc = 1; break; case 'B': printf("%-8o", (itolws.L=(wx), itolws.C[(dot)&3])); dotinc = 1; break; case 's': case 'S': savdot = dot; dotinc = 1; while ((c = (itolws.L=(wx), itolws.C[(dot)&3])) && (errflg == 0)) { dot = inkdot(1); if (modifier == 'S') { printesc(c); } else { printc(c); } endline(); if (!(dot & 3)) wx = get((int)dot, itype); } dotinc = dot - savdot + 1; dot = savdot; break; case 'i': if (gotdot) { wx = get((int)(dot & ~3), itype); } iDasm((int)(wx), (unsigned int)0, (unsigned int)(dot&~3)); printc('\n'); break; case 'f': fw.ival = wx; printf("%-16.9f", fw.fval); dotinc = 4; break; case 'F': printf("%-32.18F", dw.dval); dotinc = 8; break; } } return(fp); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930126-1.c ================================================ typedef unsigned T; typedef char Tchar; T mt (long, char *); T ms (long, char *); T mv (long, T, char); T cons (T, T); T decl (T * (*) (T *), char *); T*L92(T*),*L15(T*),*L14(T*),*L13(T*),*L12(T*),*L11(T*),*L10(T*),*L9(T*),*L8(T*),*L7(T*),*L6(T*),*L5(T*),*L4(T*),*L3(T*),*L2(T*),*L1(T*); static T * Ldata (T * my_pc) { int cc = (((* ((T *) (my_pc))) >> 16) & 0xFF); T B92, B91, B90, B15, B14, B13, B12, B11, B10, B9, B8, B7, B6, B5, B4, B3, B2, B1, tO7, tO6, tO5, tO4, tO3, tO2, tO1, tO0; T object = mv (168, 0, ((Tchar) 1)); T * cb = (T *) (((T) (object & 0x3FF)) | 0x400); tO0 = mv (92, 0, ((Tchar) 1)); B92 = decl (L92, ""); B15 = decl (L15, ""); B14 = decl (L14, ""); B13 = decl (L13, ""); B12 = decl (L12, ""); B11 = decl (L11, ""); B10 = decl (L10, ""); B9 = decl (L9, ""); B8 = decl (L8, ""); B7 = decl (L7, ""); B6 = decl (L6, ""); B5 = decl (L5, ""); B4 = decl (L4, ""); B3 = decl (L3, ""); B2 = decl (L2, ""); B1 = decl (L1, ""); cb[19] = ((((cc) & 0xFF) << 16) | (9 & 0xFF)); cb[21] = ((((cc) & 0xFF) << 16) | ((10) & 0xFF)); cb[23] = ((((cc) & 0xFF) << 16) | (11 & 0xFF)); cb[25] = ((((cc) & 0xFF) << 16) | (12 & 0xFF)); cb[27] = ((((cc) & 0xFF) << 16) | (13 & 0xFF)); cb[29] = ((((cc) & 0xFF) << 16) | (14 & 0xFF)); cb[31] = ((((cc) & 0xFF) << 16) | (15 & 0xFF)); cb[35] = ((((cc) & 0xFF) << 16) | (17 & 0xFF)); cb[36] = ((0x1A) << 26) | (((0x39) << 26) | 1) & 0x3FF; cb[39] = ms (24, ((char *) "")); cb[41] = ((0x1A) << 26) | (((0x39) << 26) | 1) & 0x3FF; cb[44] = 3; cb[46] = 2; cb[48] = 3; cb[50] = 6; cb[52] = 4; cb[146] = tO0; ((T *) (((tO0 & 0x3FF)) | 0x400))[92] = B1; ((T *) (((tO0 & 0x3FF)) | 0x400))[91] = B2; ((T *) (((tO0 & 0x3FF)) | 0x400))[2] = B90; ((T *) (((tO0 & 0x3FF)) | 0x400))[2] = B91; ((T *) (((tO0 & 0x3FF)) | 0x400))[1] = B92; cb[58] = 0x2800 | (T) ((T *) ((B6 & 0x3FF) | 0x400) + 3); cb[57] = 0x2800 | (T) ((T *) ((B7 & 0x3FF) | 0x400) + 3) & ~0xC00; cb[56] = 0x2800 | (T) ((T *) ((B8 & 0x3FF) | 0x400) + 3) & ~0xC00; cb[55] = 0x2800 | (T) ((T *) ((B9 & 0x3FF) | 0x400) + 3) & ~0xC00; tO7 = mv (8, 0, ((Tchar) 1)); tO4 = ms (9, ((char *) "")); tO3 = mv (58, 0, ((Tchar) 1)); tO6 = ms (4, ((char *) "")); tO2 = mv (4, 0, ((Tchar) 1)); tO5 = ms (4, ((char *) "")); tO1 = mv (28, 0, ((Tchar) 1)); cb[165] = tO1; cb[163] = cons (((ms (10, ((char *) "")))), (cons (tO5, 0))); cb[162] = cons (1, (cons (2, 0))); cb[150] = cons (1, (cons (2, (cons (3, (cons (4, (cons (5, (cons (6, 0))))))))))); cb[148] = tO7; return cb; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930210-1.c ================================================ f() { char c1, c2; char *p1, *p2; do { c1 = c2 = *p1++; while (c1--) *p2++ = *p1++; } while (c2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930217-1.c ================================================ /* The bit-field below would have a problem if __INT_MAX__ is too small. */ #if __INT_MAX__ < 2147483647 int a; #else double g (); typedef union { struct { unsigned s:1, e:8, f:23; } u; float f; } s; f(x, n) float x; { ((s *)&x)->u.e -= n; x = g((double)x, -n); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930222-1.c ================================================ typedef struct { long i; double f; } T; f (T *n1, T *n2) { if (g (n2)) return n1->i - n2->i; else { double f = n1->f - n2->i; return f == 0.0 ? 0 : (f > 0.0 ? 1 : -1); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930325-1.c ================================================ typedef unsigned uint; inline g (uint *s, uint *d, uint c) { while (c != 0) { *--d = *--s; c--; } } f (uint *p1, uint c, uint *p2) { while (c > 0 && *p1 == 0) { p1++; c--; } if (c == 0) return 1; g (p2, p1, c); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930326-1.c ================================================ struct { char a, b, f[3]; } s; long i = s.f-&s.b; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930411-1.c ================================================ /* { dg-require-effective-target untyped_assembly } */ int heap; g(){} f(int i1, int i2) { i1 = *(int*)(i1 + 4); if (i1 == 0) goto L4; else goto L9; L3: i2 = heap - 8; *(int*)i2 = 3; *(int*)(i2 + 4) = i1; heap -= 8; return i2; L4: i1 = g(i2); goto L5; L5: i1 = *(int*)(i1 + 4); if (i1 == 0) goto L7; else goto L8; L7: i1 = 0; goto L3; L8: i1 = 1; goto L3; L9: i1 = 1; goto L3; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930421-1.c ================================================ double q(double); f (int **x, int *r, int *s, int a, int b, int c, int d) { int i, j, k, m, e, f, g, z[1024], y[2]; e = g = 0; for (i = 0; i < a; i++) for (j = 0; j < b; j++) if (x[i][j]) for (k = 0; k < c; k++) { f = q(1.5) + q(2.5); if (g < y[f]) g = e; } for (m = 0; m < 1; m++) z[0] = m*2*d/3.0 - d; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930427-2.c ================================================ struct s { int f; }; f (w, v0, v1, v2, v3) struct s *w; { g (v0 ? 1 : w->f, v1 ? v3 : v2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930503-1.c ================================================ f (const char *s, char *d, unsigned l) { if (0) while (1); else while (--l >= 0) *d++ = *s++; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930503-2.c ================================================ f() { struct { char x; } r; g(r); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930506-1.c ================================================ long long f (a) double a; { double b; unsigned long long v; b = a / 2.0; v = (unsigned) b; a -= (double) v; return v; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930506-2.c ================================================ #ifndef NO_TRAMPOLINES int f1() { { int ___() { foo(1); } bar(___); } return( { int ___() { foo(2); } bar(___);} ); } int f2(int j) { { int ___() { foo(j); } bar(___); } return( { int ___() { foo(j); } bar(___);} ); } #else int x; #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930510-1.c ================================================ typedef long time_t; static __const int mon_lengths[2][12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static time_t f (janfirst, year, rulep, offset) __const time_t janfirst; __const int year; register __const struct rule * __const rulep; __const long offset; { register int leapyear; register time_t value; register int i; value += mon_lengths[leapyear][i] * ((long) (60 * 60) * 24); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930513-1.c ================================================ /* The bit-field below would have a problem if __INT_MAX__ is too small. */ #if __INT_MAX__ < 2147483647 int a; #else struct s { int f1 : 26; int f2 : 8; }; f (struct s *x) { return x->f2++ == 0; } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930513-2.c ================================================ double g (); f (x) double x; { x = .85; while (g () < x) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930513-3.c ================================================ test () { short *p, q[3]; int x; p = q; for (x = 0; x < 3; x++) *p++ = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930523-1.c ================================================ int v; f () { unsigned long *a1, *a2; int vertex2; int c, x1, x2, dx1, dx2, dy1, dy2, e1, e2, s2; unsigned long m, b; int n; unsigned long r; int aba; do { if (dx2 >= dy2) dx2 = dx2 % dy2; if (dx2 >= dy2) { s2 = - (dx2 / dy2); dx2 = dx2 % dy2; } } while (vertex2 / 65536); for (;;) { c = x2; a2 = a1; if (v) a2 = 0; if (c + n) { m = b << (c * 8); *a2 = (*a2 & ~m) | (r & m); n += c; while (--n) { { } } } a1 = 0; x1 += 0; if (e1 += dx1) e1 -= dy1; x2 += s2; if (e2 += dx2) e2 -= dy2; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930525-1.c ================================================ typedef struct foo foo_t; foo_t x; struct foo { int i; }; foo_t x = { 10 }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930527-1.c ================================================ enum {e0, e1}; int x[] = { [e0] = 0 }; f () { switch (1) { case e0: case e1: break; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930529-1.c ================================================ /* { dg-require-effective-target untyped_assembly } */ struct r { int d1, d2; }; struct km { int d; }; struct f1 { char *fn; char *fd; char *fs; char *ic; void (*ff) (); }; int g (); int y; struct r *bs; int bv; void b (); char *w (); struct km **q; char **mns; int nm; struct f1 **z; f (char *km, char *h) { struct f1 *t; int map = midn(km, strlen(km)); int V; int c; struct r r; struct f1 *cm; if (!g(&V, &cm, h, strlen(h))) { c = (cm - z[V]); goto L; } for (c = 0; c < nm; c++) if (!strcmp (h, mns[c])) { V = -1; goto L; } for (c = 0; c < y; c++) { if (!memcmp (&bs[c], &r, 8)) goto L; } h = w (&r); if (!bv) { bs = g (8); t = (struct f1 *)g (20); } else { bs = g (bs, y * 8); z[bv] = cr (z[bv], (1 + y) * 20); t = &z[bv][y - 1]; } bs[y - 1] = r; t->fs[0] = sp (y - 1); t->fs[1] = 0; t->ic = 0; t->fd = 0; t->fn = cs (h); t->ff = b; L: g (q[map], V, c); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930530-1.c ================================================ f () { struct { char a, b; } x; g (x, x, x, x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930602-1.c ================================================ typedef struct { int f[8]; } T; f (w, l, r) T *w; unsigned short l, r; { int i; for (i = l; i < r; i++) g (w->f[i]); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930603-1.c ================================================ union u { union u *a; double d; }; union u *s, g(); f() { union u x = g(); s[0] = *x.a; s[1] = g(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930607-1.c ================================================ typedef void f (); typedef f *pf; long long i; g () { long long p = i; ((pf) (long) p) (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930611-1.c ================================================ float f (float a1) { union { float f; int l; } fl1; fl1.f = a1; return fl1.l ? 1.0 : a1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930618-1.c ================================================ f (s) { int r; r = (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)); return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930621-1.c ================================================ #if defined(STACK_SIZE) && (STACK_SIZE < 65536) # define BYTEMEM_SIZE 10000L #endif #ifndef BYTEMEM_SIZE # define BYTEMEM_SIZE 45000L #endif int bytestart[5000 + 1]; unsigned char modtext[400 + 1]; unsigned char bytemem[2][BYTEMEM_SIZE + 1]; long modlookup (int l) { signed char c; long j; long k; signed char w; long p; while (p != 0) { while ((k < bytestart[p + 2]) && (j <= l) && (modtext[j] == bytemem[w][k])) { k = k + 1; j = j + 1; } if (k == bytestart[p + 2]) if (j > l) c = 1; else c = 4; else if (j > l) c = 3; else if (modtext[j] < bytemem[w][k]) c = 0; else c = 2; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930623-1.c ================================================ /* { dg-require-effective-target untyped_assembly } */ g (a, b) {} f (xx) void* xx; { __builtin_apply ((void*)g, xx, 200); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930702-1.c ================================================ f () { {({});} return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930926-1.c ================================================ int f () { return 0; } void test () { int j = { f() }; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/930927-1.c ================================================ #include wchar_t s[5] = L"abcd"; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/931003-1.c ================================================ f (n, a) int n; double a[]; { double b[51]; int i, j; i = 0; for (j = n - 1; j > 0; j--) b[i++] = 0; if (b[0] > b[i - 1]) a[i] = b[i - 1]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/931004-1.c ================================================ #define A "This is a long test that tests the structure initialization" #define B A,A #define C B,B,B,B #define D C,C,C,C int main() { char *subs[]={ D, D, D, D, D, D, D, D, D, D, D, D, D, D, D}; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/931013-1.c ================================================ g (); f () { long ldata[2]; int seed; seed = (ldata[0]) + (ldata[1] << 16); g (seed); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/931013-2.c ================================================ f (unsigned short Z[48]) { int j; unsigned short t1, t2, t3, T[48]; unsigned short *p = T + 48; for (j = 1; j < 8; j++) { t1 = *Z++; *--p = *Z++; *--p = t1; t1 = inv(*Z++); t2 = -*Z++; t3 = -*Z++; *--p = inv(*Z++); *--p = t2; *--p = t3; *--p = t1; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/931013-3.c ================================================ struct s { int f; }; struct s f () { int addr; return *(struct s *) &addr; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/931018-1.c ================================================ typedef struct { int a, b; } T; f (T *bs) { long long x; x = ({ union { T s; long long l; } u; u.s = *bs; u.l; }); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/931031-1.c ================================================ struct s { int pad:1, no:1; }; f (struct s *b, int c) { char d = b->no && c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/931102-1.c ================================================ char *e (); #define SET \ if (d > *b++) d |= a; \ if (b) b = e(b); xxx() { int a, d; char *b, *c; while (1) { while (1) { while (1) { if (a) { switch (a) { case 1: while (1) { SET do { SET } while (1); } case 2: while (1) { if (d) { do { SET } while (1); } else { do { SET } while (1); } } case 3: while (1) { if (d) { do { SET } while (1); } else { do { SET } while (1); } } case 4: while (1) { if (d) { do { SET } while (1); } else { do { SET } while (1); } } } } else { switch (a) { case 2: while (1) { if (d) { do { SET } while (1); } else { do { SET } while (1); } } case 3: while (1) { if (d) { do { SET } while (1); } else { do { SET } while (1); } } case 4: while (1) { if (d) { do { SET } while (1); } else { do { SET } while (1); } } } } } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/931102-2.c ================================================ typedef struct { int a; } VCR; typedef struct { VCR vcr[8]; } VCRC; typedef struct { char vcr; } OWN; OWN Own[16]; f (x, own) VCRC *x; OWN *own; { x[own->vcr / 8].vcr[own->vcr % 8].a--; x[own->vcr / 8].vcr[own->vcr % 8].a = x[own->vcr / 8].vcr[own->vcr % 8].a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/931203-1.c ================================================ v (a, i) unsigned *a, i; { a++[i] = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/940611-1.c ================================================ f () { do L:; while (0); do ; while (0); goto L; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/940712-1.c ================================================ f () { return (*(volatile unsigned int *)8000) / 3; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/940718-1.c ================================================ extern double log (double) __attribute__ ((const)); f (double x) { for (;;) exp(log(x)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/941014-1.c ================================================ f (to) char *to; { unsigned int wch; register length; unsigned char tmp; unsigned int mult = 10; tmp = (wch>>(unsigned int)(length * mult)); *to++ = (unsigned char)tmp; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/941014-2.c ================================================ void f (n, ppt, xrot) { int tileWidth; int nlwSrc; int srcx; int v3, v4; register unsigned long ca1, cx1, ca2, cx2; unsigned long *pSrcLine; register unsigned long *pDst; register unsigned long *pSrc; register unsigned long b, tmp; unsigned long tileEndMask; int v1, v2; int tileEndPart; int needFirst; tileEndPart = 0; v1 = tileEndPart << 5; v2 = 32 - v1; while (n--) { if ((srcx = (ppt - xrot) % tileWidth) < 0) if (needFirst) if (nlwSrc == 1) { tmp = b; if (tileEndPart) b = (*pSrc & tileEndMask) | (*pSrcLine >> v1); } if (tileEndPart) b = (tmp << v1) | (b >> v2); if (v4 != 32) *pDst = (*pDst & ((tmp << v3) | (b >> v4) & ca1 ^ cx1) ^ (((tmp << v3) | (b >> v4)) & ca2 ^ cx2)); *pDst = *pDst & tmp; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/941014-3.c ================================================ typedef unsigned char byte; typedef unsigned int uint; typedef unsigned long ulong; typedef ulong gs_char; typedef struct gs_show_enum_s gs_show_enum; typedef struct gs_font_s gs_font; typedef struct gx_font_stack_item_s { gs_font *font; } gx_font_stack_item; typedef struct gx_font_stack_s { gx_font_stack_item items[1 + 5 ]; } gx_font_stack; struct gs_show_enum_s { gx_font_stack fstack; }; typedef enum { ft_composite = 0, } font_type; struct gs_font_s { font_type FontType; }; typedef enum { fmap_escape = 3, fmap_shift = 8 } fmap_type; typedef struct gs_type0_data_s { fmap_type FMapType; } gs_type0_data; gs_type0_next_char(register gs_show_enum *penum) { const byte *p; int fdepth; gs_font *pfont; gs_type0_data *pdata; uint fidx; gs_char chr; for (; pfont->FontType == ft_composite; ) { fmap_type fmt; switch ( fmt ) { do {} while (0); rdown: continue; case fmap_shift: p++; do {} while (0); goto rdown; } break; } up: while ( fdepth > 0 ) { switch ( pdata->FMapType ) { default: continue; case fmap_escape: fidx = *++p; do {} while (0); if ( fidx == chr && fdepth > 1 ) goto up; down: fdepth--; do {} while (0); } break; } while ( (pfont = penum->fstack.items[fdepth].font)->FontType == ft_composite ) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/941014-4.c ================================================ #ifndef NO_LABEL_VALUES f (int *re) { int *loops = 0, *loope = 0; unsigned dat0 = 0; static void *debug = &&firstdebug; firstdebug: g (loops, loope); if (dat0 & 1) re[(dat0 >> 2) & 3] = 0; } #else int x; #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/941019-1.c ================================================ __complex__ long double sub (__complex__ long double cld) { return cld; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/941111-1.c ================================================ main () { struct S { int i; char c; } obj1, obj2; foo (); if (obj1.c != obj2.c) bar (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/941113-1.c ================================================ typedef void foo (void); f (x) { if (x) { const foo* v; (*v)(); } else g (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950122-1.c ================================================ int foo (int i, unsigned short j) { return j *= i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950124-1.c ================================================ f () { if (g ()) h (); else { do { return 0; break; } while (1); } return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950221-1.c ================================================ short v = -1; typedef struct { short network; } atype; void f () { static atype config; atype *cp; short net; cp = &config; cp->network = (v == -1) ? 100 : v; net = cp->network; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950329-1.c ================================================ /* { dg-require-effective-target untyped_assembly } */ f () { int i; for (i = 1;; i = 0) { if (h ()) { if (i) g (); g (h ()); g (h ()); } else { g (); break; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950512-1.c ================================================ typedef unsigned short uint16; f (unsigned char *w) { w[2] = (uint16) ((((g (0) % 10000 + 42) & 0xFF) << 8) | (((g (0) % 10000 + 42) >> 8) & 0xFF)) & 0xFF, w[3] = (uint16) ((((g (0) % 10000 + 42) & 0xFF) << 8) | (((g (0) % 10000 + 42) >> 8) & 0xFF)) >> 8; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950530-1.c ================================================ f (int *s, int *t) { return (t - s) / 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950607-1.c ================================================ typedef struct { int component_id; int component_index; int h_samp_factor; int v_samp_factor; } jpeg_component_info; struct jpeg_common_struct { struct jpeg_error_mgr * err; }; typedef struct jpeg_common_struct * j_common_ptr; typedef struct jpeg_compress_struct * j_compress_ptr; struct jpeg_compress_struct { struct jpeg_error_mgr * err; int num_components; jpeg_component_info * comp_info; int max_h_samp_factor; int max_v_samp_factor; }; struct jpeg_error_mgr { int msg_code; }; void jinit_downsampler (j_compress_ptr cinfo) { int ci; jpeg_component_info * compptr; for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { if (compptr->h_samp_factor == cinfo->max_h_samp_factor && compptr->v_samp_factor == cinfo->max_v_samp_factor) { } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 && (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) { } else cinfo->err->msg_code = 0; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950610-1.c ================================================ f (int n, int a[2][n]) {} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950612-1.c ================================================ typedef enum { LODI, STO, ADDI, ADD, SUBI, SUB, MULI, MUL, DIVI, DIV, INC, DEC } INSN; f (pc) short *pc; { long long stack[16], *sp = &stack[16], acc = 0; for (;;) { switch ((INSN)*pc++) { case LODI: *--sp = acc; acc = ((long long)*pc++) << 32; break; case STO: return (acc >> 32) + (((((unsigned long long) acc) & 0xffffffff) & (1 << 31)) != 0); break; case ADDI: acc += ((long long)*pc++) << 32; break; case ADD: acc = *sp++ + acc; break; case SUBI: acc -= ((long long)*pc++) << 32; break; case SUB: acc = *sp++ - acc; break; case MULI: acc *= *pc++; break; case MUL: { long long aux; unsigned char minus; minus = 0; aux = *sp++; if (aux < 0) { minus = ~minus; aux = -aux; } if (acc < 0) { minus = ~minus; acc = -acc; } acc = ((((((unsigned long long) acc) & 0xffffffff) * (((unsigned long long) aux) & 0xffffffff)) >> 32) + ((((unsigned long long) acc) >> 32) * (((unsigned long long) aux) & 0xffffffff) + (((unsigned long long) acc) & 0xffffffff) + (((unsigned long long) aux) >> 32)) + (((((unsigned long long) acc) >> 32) * (((unsigned long long) aux) >> 32)) << 32)); if (minus) acc = -acc; } break; case DIVI: { short aux; aux = *pc++; acc = (acc + aux / 2) / aux; } break; case DIV: { long long aux; unsigned char minus; minus = 0; aux = *sp++; if (aux < 0) { minus = ~minus; aux = -aux; } if (acc < 0) { minus = ~minus; acc = -acc; } if (((unsigned long long)acc) == 0) acc = (unsigned long long)-1 / 2; else if ((((unsigned long long) ((unsigned long long)acc)) & 0xffffffff) == 0) acc = ((unsigned long long)aux) / (((unsigned long long) ((unsigned long long)acc)) >> 32); else if ((((unsigned long long) ((unsigned long long)acc)) >> 32) == 0) acc = ((((unsigned long long)aux) / ((unsigned long long)acc)) << 32) + ((((unsigned long long)aux) % ((unsigned long long)acc)) << 32) / ((unsigned long long)acc); else { unsigned char shift; unsigned long hi; shift = 32; hi = (((unsigned long long) ((unsigned long long)acc)) >> 32); do { if (hi & ((unsigned long)1 << (shift - 1))) break; } while (--shift != 0); printf("shift = %d\n", shift); acc = ((((unsigned long long)aux) / ((unsigned long long)acc)) << 32) + (((((unsigned long long)aux) % ((unsigned long long)acc)) << (32 - shift)) + ((((unsigned long long)acc) >> shift) / 2)) / (((unsigned long long)acc) >> shift); } if (minus) acc = -acc; } break; case INC: acc += 1; break; case DEC: acc -= 1; break; } printf("%08lx.%08lx\n", (long)(((unsigned long long) acc) >> 32) , (long)(((unsigned long long) acc) & 0xffffffff)); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950613-1.c ================================================ /* { dg-require-effective-target label_values } */ /* { dg-require-effective-target indirect_jumps } */ f () { long *sp; long *pc; static void *dummy[] = { &&L1, &&L2, }; L1: { float val; val = *(float *) sp; val = -val; *(float *) sp = val; goto *pc++; } L2: { float from; *(long long *) sp = from; goto *pc++; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950618-1.c ================================================ static __inline__ int f () { return g (); } int g () { return f (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950719-1.c ================================================ typedef struct { int Header; char data[4092]; } t_node; f (unsigned short rid, unsigned short record_length) { t_node tnode; g (rid, tnode.data + rid * record_length); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950729-1.c ================================================ static const char * const lcset = "0123456789abcdef"; static const char * const ucset = "0123456789ABCDEF"; char * f (char *buffer, long long value, char type) { int base, i; i = 128 - 1; buffer[i--] = '\0'; switch (type) { case 'u': case 'o': case 'x': case 'X': if (type == 'u') base = 10; else if (type == 'o') base = 8; else base = 16; while (i >= 0) { if (type == 'X') buffer[i--] = ucset[((unsigned long long) value) % base]; else buffer[i--] = lcset[((unsigned long long) value) % base]; if ((value = ((unsigned long long) value) / base) == 0) break; } break; } return &buffer[++i]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950816-1.c ================================================ f () { unsigned char b[2]; float f; b[0] = (unsigned char) f / 256; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950816-2.c ================================================ f () { int i; float a,b,c; unsigned char val[2]; i = func (&c); val[0] = c < a ? a : c >= 1.0 ? b : c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950816-3.c ================================================ f () { int i; short x, z; for (i = 0; i <= 1; i++) x = i; return x + z; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950910-1.c ================================================ f (char *p) { char c; c = *++p; if (c != ' ') return 0; for (;;) { c = *p; if (g (c)) p++; else { if (c == ' ') break; else return 0; } } return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950919-1.c ================================================ #define empty #if empty#cpu(m68k) #endif f (){} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950921-1.c ================================================ f () { union { signed char c; double d; } u; u.c = 1; u.c = 1; return u.c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/950922-1.c ================================================ struct sw { const void *x; int r; }; struct sq { struct sw *q_w; int t; int z; }; int f (int ch, char *fp, char *ap) { register int n; register char *cp; register struct sw *p; register int f; int prec; double _double; int expt; int ndig; char expstr[7]; unsigned long long _uquad; struct sq q; struct sw w[8]; static char zeroes[16]; for (;;) { switch (ch) { case 'd': _double = (double) (ap += 8, *((double *) (ap - 8))); break; case 'o': goto nosign; case 'u': _uquad = (f & 0x020 ? (ap += 8, *((long long *) (ap - 8))) : f & 0x010 ? (ap += 4, *((long *) (ap - 4))) : f & 0x040 ? (long)(short)(ap += 4, *((int *) (ap - 4))) : (long)(ap += 4, *((int *) (ap - 4)))); goto nosign; case 'x': _uquad = (f & 0x020 ? (ap += 8, *((long long *) (ap - 8))) : f & 0x010 ? (ap += 4, *((long *) (ap - 4))) : f & 0x040 ? (long)(unsigned short)(ap += 4, *((int *) (ap - 4))) : (long)(ap += 4, *((int *) (ap - 4)))); nosign: if (_uquad != 0 || prec != 0); break; default:; } if ((f & 0x100) == 0) { } else { if (ch >= 'f') { if (_double == 0) { if (expt < ndig || (f & 0x001) != 0) { { if ((n = (ndig - 1)) > 0) { while (n > 16) {{ p->x = (zeroes); p->r = 16; q.z += 16; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} n -= 16; }{ p->x = (zeroes); p->r = n; q.z += n; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }}}} } } else if (expt <= 0) { { p->x = ("0"); p->r = 1; q.z += 1; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} { p->x = 0; p->r = 1; q.z += 1; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} { if ((n = (-expt)) > 0) { while (n > 16) {{ p->x = (zeroes); p->r = 16; q.z += 16; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} n -= 16; }{ p->x = (zeroes); p->r = n; q.z += n; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} }} { p->x = cp; p->r = ndig; q.z += ndig; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} } else { { p->x = cp; p->r = expt; q.z += expt; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} cp += expt; { p->x = ("."); p->r = 1; q.z += 1; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} { p->x = cp; p->r = (ndig-expt); q.z += (ndig-expt); p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} } } } } error:; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/951004-1.c ================================================ typedef struct { short v, h; } S; S a; f (S pnt) { S mpnt, mtp; (&pnt)->v -= 1; mpnt = pnt; mtp = a; if (mtp.v != mpnt.v) { S tpnt; tpnt = mtp; mtp = mpnt; mpnt = tpnt; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/951106-1.c ================================================ f (double a, double b) { g (a, 0, b); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/951116-1.c ================================================ f () { long long i; int j; long long k = i = j; int inner () {return j + i;} return k; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/951128-1.c ================================================ char a[]; f (const int i) { a[i] = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/951220-1.c ================================================ f (char *x) { return (*x & 2) || (*x & 3); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/951222-1.c ================================================ extern long long foo (); long long sub1 () { char junk[10000]; register long long a, b, c; b = foo (); setjmp (); a = foo (); c = a - b; return c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/960106-1.c ================================================ f (a) { return (a & 1) && !(a & 2 & 4); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/960130-1.c ================================================ int a[1]; int main() { extern int a[]; return *a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/960201-1.c ================================================ union foo { char a; int x[2]; } __attribute__ ((transparent_union)); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/960218-1.c ================================================ #define X(x) x int main() { return X(0/* *//* */); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/960220-1.c ================================================ f () { unsigned long long int a = 0, b; while (b > a) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/960221-1.c ================================================ struct s1 { int f1; }; struct s2 { struct s1 a; int f2; }; foo (struct s2 *ptr) { *ptr = (struct s2) {{}, 0}; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/960319-1.c ================================================ static void f() { long long a[2]; int i; if (g()) if (h()) ; *a |= (long long)i << 65 ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/960514-1.c ================================================ struct s { unsigned long long t[5]; }; void f (struct s *d, unsigned long long *l) { int i; for (i = 0; i < 5; i++) d->t[i] += l[i]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/960704-1.c ================================================ struct A { double d; }; struct A f (); main () { struct A a = f(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/960829-1.c ================================================ f () { g (0, 0.0, 0.0, 0.0, 0.0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/961004-1.c ================================================ void f1 (o1, o2, o3, i, j, k) long long *o1, *o2, *o3; int i, j, k; { while (--i) o1[i] = o2[j >>= 1] + o3[k >>= 1]; } void f2 (o1, o2, o3, i, j, k) long long *o1, *o2, *o3; int i, j, k; { while (--i) o1[i] = o2[j >>= 1] - o3[k >>= 1]; } void f3 (o1, o2, o3, i, j, k) long long *o1, *o3; unsigned *o2; int i, j, k; { while (--i) o1[i] = o2[j >>= 1] + o3[k >>= 1]; } void f4 (o1, o2, o3, i, j, k) long long *o1, *o2; unsigned *o3; int i, j, k; { while (--i) o1[i] = o2[j >>= 1] - o3[k >>= 1]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/961010-1.c ================================================ double f (double x) { return x == 0 ? x : 0.0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/961019-1.c ================================================ char _hex_value[256]; void hex_init () { int i; for (i = 0; i < 256; i++) _hex_value[i] = 99; for (i = 0; i < 10; i++) _hex_value['0' + i] = i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/961031-1.c ================================================ struct s { double d; } sd; struct s g () __attribute__ ((const)); struct s g () { return sd; } f () { g (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/961126-1.c ================================================ int *p; main() { int i = sub (); i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; if (*p != i) goto quit; i = -i; quit: sub2 (i); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/961203-1.c ================================================ /* The structure is too large for the xstormy16 - won't fit in 16 bits. */ /* { dg-do assemble } */ #if __INT_MAX__ >= 2147483647L struct s { char a[0x32100000]; int x:30, y:30; }; int main () { struct s* p; p = (struct s*) 0; if (p->x == p->y) exit (1); } #else int g; #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/970206-1.c ================================================ struct Rect { int iA; int iB; int iC; int iD; }; void f (int * const this, struct Rect arect) { g (*this, arect); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/970214-1.c ================================================ #include #define L 264 wchar_t c = L'X'; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/980329-1.c ================================================ typedef __SIZE_TYPE__ size_t; struct re_pattern_buffer { unsigned char *buffer; unsigned long int used; }; struct re_registers { int *start; }; static const char **regstart, **regend; static const char **old_regend; static int re_match_2_internal (struct re_pattern_buffer *bufp, struct re_registers *regs) { unsigned char *p = bufp->buffer; unsigned char *pend = p + bufp->used; for (;;) { int highest_active_reg = 1; if (bufp) { int i; for (i = 1;; i++) regs->start[i] = 0; } switch ((unsigned int) *p++) { case 1: { unsigned char r = *p; if (r) highest_active_reg = r; } if (p + 2 == pend) { char is_a_jump_n = 0; int mcnt = 0; unsigned char *p1; p1 = p + 2; switch (*p1++) { case 2: is_a_jump_n = 1; case 1: do { do { mcnt = *p1; } while (0); p1 += 2; } while (0); if (is_a_jump_n) p1 = 0; } if (mcnt && *p1 == 0) { unsigned r; for (r = 0; r < (unsigned) *p + (unsigned) *(p + 1); r++) { if (regend[0] >= regstart[r]) regend[r] = old_regend[r]; } do { while (0 < highest_active_reg + 1) { } } while (0); } } } } return -1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/980408-1.c ================================================ typedef struct _RunlengthPacket { unsigned short red, green, blue, length; unsigned short index; } RunlengthPacket; typedef struct _Image { int status, temporary; char filename[1664 ]; long int filesize; int pipe; char magick[1664 ], *comments, *label, *text; unsigned int matte; unsigned int columns, rows, depth; unsigned int scene, number_scenes; char *montage, *directory; unsigned int colors; double gamma; float x_resolution, y_resolution; unsigned int mean_error_per_pixel; double normalized_mean_error, normalized_maximum_error; unsigned long total_colors; char *signature; unsigned int packets, runlength, packet_size; unsigned char *packed_pixels; long int magick_time; char magick_filename[1664 ]; unsigned int magick_columns, magick_rows; char *geometry, *page; unsigned int dispose, delay, iterations; unsigned int orphan; struct _Image *previous, *list, *next; } Image; Image *MinifyImage(Image *image) { Image *minified_image; register RunlengthPacket *q, *s, *s0, *s1, *s2, *s3; register unsigned int x; unsigned int blue, green, red; unsigned long total_matte, total_blue, total_green, total_red; unsigned short index; for (x=0; x < (image->columns-1); x+=2) { total_red=0; total_green=0; total_blue=0; total_matte=0; s=s0; total_red+=( 3 )*(s->red); total_green+=( 3 )*(s->green); total_blue+=( 3 )*(s->blue); total_matte+=( 3 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 3 )*(s->red); total_green+=( 3 )*(s->green); total_blue+=( 3 )*(s->blue); total_matte+=( 3 )*(s->index); s++; ; s=s1; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 15 )*(s->red); total_green+=( 15 )*(s->green); total_blue+=( 15 )*(s->blue); total_matte+=( 15 )*(s->index); s++; ; total_red+=( 15 )*(s->red); total_green+=( 15 )*(s->green); total_blue+=( 15 )*(s->blue); total_matte+=( 15 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; s=s2; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 15 )*(s->red); total_green+=( 15 )*(s->green); total_blue+=( 15 )*(s->blue); total_matte+=( 15 )*(s->index); s++; ; total_red+=( 15 )*(s->red); total_green+=( 15 )*(s->green); total_blue+=( 15 )*(s->blue); total_matte+=( 15 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; s=s3; total_red+=( 3 )*(s->red); total_green+=( 3 )*(s->green); total_blue+=( 3 )*(s->blue); total_matte+=( 3 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 3 )*(s->red); total_green+=( 3 )*(s->green); total_blue+=( 3 )*(s->blue); total_matte+=( 3 )*(s->index); s++; ; red=(unsigned short) ((total_red+63) >> 7); green=(unsigned short) ((total_green+63) >> 7); blue=(unsigned short) ((total_blue+63) >> 7); index=(unsigned short) ((total_matte+63) >> 7); if ((red == q->red) && (green == q->green) && (blue == q->blue) && (index == q->index) && ((int) q->length < 65535L )) q->length++; } return(minified_image); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/980504-1.c ================================================ typedef struct _geom_elem { double coeffs[6]; } pGeomDefRec, *pGeomDefPtr; typedef struct _mpgeombanddef { int yOut; int in_width; } mpGeometryBandRec, *mpGeometryBandPtr; typedef void *pointer; typedef unsigned char CARD8; typedef CARD8 BytePixel; void BiGL_B (OUTP,srcimg,width,sline,pedpvt,pvtband) pointer OUTP; pointer *srcimg; register int width; int sline; pGeomDefPtr pedpvt; mpGeometryBandPtr pvtband; { register float s, t, st; register int isrcline,isrcpix; register int srcwidth = pvtband->in_width - 1; register BytePixel val; register BytePixel *ptrIn, *ptrJn; register double a = pedpvt->coeffs[0]; register double c = pedpvt->coeffs[2]; register double srcpix = a * ((double)(0.0000)) + pedpvt->coeffs[1] * (pvtband->yOut + ((double)(0.0000)) ) + pedpvt->coeffs[4]; register double srcline = c * ((double)(0.0000)) + pedpvt->coeffs[3] * (pvtband->yOut + ((double)(0.0000)) ) + pedpvt->coeffs[5]; if ( (isrcpix >= 0) && (isrcpix < srcwidth) ) val = ptrIn[isrcpix] * ((float)1. - s - t + st) + ptrIn[isrcpix+1] * (s - st) + ptrJn[isrcpix] * (t - st) + ptrJn[isrcpix+1] * (st) + (float)0.5 ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/980506-1.c ================================================ /* The arrays are too large for the xstormy16 - won't fit in 16 bits. */ /* { dg-do assemble } */ /* { dg-require-effective-target size32plus } */ /* { dg-skip-if "Array too big" { "avr-*-*" } { "*" } { "" } } */ /* { dg-xfail-if "The array too big" { h8300-*-* } { "-mno-h" "-mn" } { "" } } */ unsigned char TIFFFax2DMode[20][256]; unsigned char TIFFFax2DNextState[20][256]; unsigned char TIFFFaxUncompAction[20][256]; unsigned char TIFFFaxUncompNextState[20][256]; unsigned char TIFFFax1DAction[230][256]; unsigned char TIFFFax1DNextState[230][256]; typedef struct tableentry { unsigned short length; unsigned short code; short runlen; } tableentry; extern tableentry TIFFFaxWhiteCodes[]; extern tableentry TIFFFaxBlackCodes[]; static short sp_data, sp_bit; static unsigned char fetchByte (inbuf) unsigned char **inbuf; { unsigned char byte = **inbuf; (*inbuf)++; return (byte); } static int decode_white_run (inbuf) unsigned char **inbuf; { short state = sp_bit; short action; int runlen = 0; for (;;) { if (sp_bit == 0) { nextbyte: sp_data = fetchByte (inbuf); } action = TIFFFax1DAction[state][sp_data]; state = TIFFFax1DNextState[state][sp_data]; if (action == 0 ) goto nextbyte; if (action == 1 ) return (-1 ); if (action == 210 ) return (-3 ); sp_bit = state; action = (TIFFFaxWhiteCodes[ action - 2 ].runlen) ; runlen += action; if (action < 64) return (runlen); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/980506-2.c ================================================ /* * inspired by glibc-2.0.6/sysdeps/libm-ieee754/s_nextafterf.c * * gcc -O2 -S -DOP=+ gives faddp %st(1),%st * gcc -O2 -S -DOP=* gives fmulp %st(1),%st * gcc -O2 -S -DOP=- gives fsubrp %st(1),%st * gcc -O2 -S -DOP=/ gives fdivrp %st(1),%st */ #ifndef OP #define OP * #endif typedef int int32_t __attribute__ ((__mode__ ( __SI__ ))) ; typedef unsigned int u_int32_t __attribute__ ((__mode__ ( __SI__ ))) ; typedef union { float value; u_int32_t word; } ieee_float_shape_type; float __nextafterf(float x, float y) { int32_t hx,hy,ix,iy; { ieee_float_shape_type gf_u; gf_u.value = x; hx = gf_u.word; } { ieee_float_shape_type gf_u; gf_u.value = y; hy = gf_u.word; } ix = hx&0x7fffffff; iy = hy&0x7fffffff; if ( ix > 0x7f800000 || iy > 0x7f800000 ) return x+y; if (x == y) return x; if (ix == 0) { { ieee_float_shape_type sf_u; sf_u.word = (hy&0x80000000) | 1; x = sf_u.value; } y = x*x; if (y == x) return y; else return x; } if (hx >= 0) { if (hx > hy) hx -= 1; else hx += 1; } else { if (hy >= 0 || hx > hy) hx -= 1; else hx += 1; } hy = hx & 0x7f800000; if (hy >= 0x7f800000) return x+x; if (hy < 0x00800000) { y = x OP x; if (y != x) { ieee_float_shape_type sf_u; sf_u.word = hx; y = sf_u.value; return y; } } { ieee_float_shape_type sf_u; sf_u.word = hx; x = sf_u.value; } return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/980511-1.c ================================================ typedef unsigned int __kernel_dev_t; typedef __kernel_dev_t dev_t; struct ustat { }; typedef unsigned int kdev_t; static inline kdev_t to_kdev_t(int dev) { int major, minor; major = (dev >> 8); minor = (dev & 0xff); return ((( major ) << 22 ) | ( minor )) ; } struct super_block { }; struct super_block * get_super (kdev_t dev); int sys_ustat(dev_t dev, struct ustat * ubuf) { struct super_block *s; s = get_super(to_kdev_t(dev)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/980701-1.c ================================================ short func(void) { unsigned char x, y; return y | x << 8; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/980706-1.c ================================================ void g(long long); long long f(long long v1, long long v2, long long v3, long long v4) { g(v1); g(v2); g(v3); g(v4); return v1 && v2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/980726-1.c ================================================ static __inline__ unsigned char BCD(unsigned char binval) { if (binval > 99) return 0x99; return (((binval/10) << 4) | (binval%10)); } void int1a(unsigned char i) { (*((unsigned char *)1)) = BCD(i); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/980729-1.c ================================================ static int regex_compile () { int c, c1; char str[6 + 1]; c1 = 0; for (;;) { do { } while (0) ; if (c1 == 6 ) break; str[c1++] = c; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/980816-1.c ================================================ typedef __SIZE_TYPE__ size_t; typedef void *XtPointer; typedef struct _WidgetRec *Widget; typedef struct _WidgetClassRec *WidgetClass; extern WidgetClass commandWidgetClass; typedef void (*XtCallbackProc)( Widget , XtPointer , XtPointer ); extern const char XtStrings[]; typedef struct { char *Name, *Label; XtCallbackProc Callback; XtPointer ClientData; Widget W; } DialogButtonType, *DialogButtonTypePtr; Widget AddButtons(Widget Parent, Widget Top, DialogButtonTypePtr Buttons, size_t Count) { int i; for (i = 0; i < Count; i++) { if (!Buttons[i].Label) continue; Buttons[i].W = XtVaCreateManagedWidget(Buttons[i].Name, commandWidgetClass, Parent, ((char*)&XtStrings[429]) , Buttons[i].Label, "fromHoriz" , i ? Buttons[i-1].W : ((void *)0) , "fromVert" , Top, "resizable" , 1 , ((void *)0) ); XtAddCallback(((char*)&XtStrings[136]), Buttons[i].Callback, Buttons[i].ClientData); } return(Buttons[Count-1].W); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/980821-1.c ================================================ typedef int __int32_t; int __kernel_rem_pio2(int prec) { __int32_t i, jz; double fw, fq[20]; switch(prec) { case 2: fw = 0.0; case 3: for (i=jz;i>0;i--) { fw = fq[i-1] +fq[i]; fq[i-1] = fw; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/980825-1.c ================================================ typedef enum { FALSE, TRUE } boolean; enum _errorTypes { FATAL = 1, WARNING = 2, PERROR = 4 }; typedef struct _optionValues { struct _include { boolean classNames; boolean defines; boolean enumerators; } include; } optionValues; extern optionValues Option; static void applyTagInclusionList( list ) const char *const list; { boolean mode = TRUE; const char *p; for (p = list ; *p != '\0' ; ++p) switch (*p) { case '=': clearTagList(); mode = TRUE; break; case '+': mode = TRUE; break; case '-': mode = FALSE; break; case 'c': Option.include.classNames = mode; break; case 'd': Option.include.defines = mode; break; case 'e': Option.include.enumerators = mode; break; default: error(FATAL, "-i: Invalid tag option '%c'", *p); break; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/981001-1.c ================================================ unsigned short code = 0x0000; unsigned short low = 0x4000; unsigned short high = 0xb000; int main (void) { if ( (high & 0x8000) != (low & 0x8000) && ( low & 0x4000) == 0x4000 && (high & 0x4000) == 0 ) { code ^= 0x4000; low |= 0x4000; } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/981001-2.c ================================================ /* { dg-require-weak "" } */ /* { dg-require-alias "" } */ #define weak_alias(func, aliasname) \ extern __typeof (func) aliasname __attribute__ ((weak, alias (#func))); #define add3(d, m, c) ((d) + (m) + (c)) int __add3(int d, int m, int c) { return d + m + c; } weak_alias (__add3, add3) ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/981001-3.c ================================================ #define P(a, b) P1(a,b) #define P1(a,b) a##b #define FLT_MIN_EXP (-125) #define DBL_MIN_EXP (-1021) #define MIN_EXP P(FLT,_MIN_EXP) #define FLT FLT int f1 = MIN_EXP; #undef FLT #define FLT DBL int f2 = MIN_EXP; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/981001-4.c ================================================ #define P(a,b) P1(a,b) #define P1(a,b) a##b #define ONCE(x, y) (x ?: (x = y())) #define PREFIX extern int P(PREFIX, init) (void); int fun(void) { static int memo; return ONCE(memo, P(PREFIX, init)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/981006-1.c ================================================ /* Test that tablejump insns are correctly handled. If the compiler loses track of the jump targets, it will report that x and y can be used uninitialized. This is broken in egcs 1998/10/06 for mips in pic mode. */ /* { dg-do assemble } */ /* For MIPS at least, pic is needed to trigger the problem. */ /* { dg-options "-w -Wuninitialized -Werror -fpic" } */ /* { dg-options "-w -Wuninitialized -Werror" { target { { rs6000-*-aix* powerpc*-*-aix* arm*-*-* fr30-*-* sh-*-hms h8300*-*-* cris-*-elf* mmix-*-* } || { ! fpic } } } } */ /* { dg-require-effective-target label_values } */ int foo (int a, int b) { __label__ z; int x; /* { dg-bogus "warning: `.' might be used uninitialized in this function" } */ int y; /* { dg-bogus "warning: `.' might be used uninitialized in this function" } */ static void *p; switch (a) { case 2: x = 4; break; case 4: x = 6; break; case 8: case 10: case 13: case 11: case 17: case 19: x = 7; break; default: x = -1; break; } switch (b) { case 2: y = 4; break; case 4: y = 6; break; case 8: case 10: case 13: case 11: case 17: case 19: y = 7; break; default: y = -1; break; } z: p = &&z; return x * y; } int main (int argc, char *argv[]) { return 1 == foo (argc, argc + 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/981007-1.c ================================================ extern double fabs (double); extern double sqrt (double); typedef struct complexm { double re,im; } complex; static complex setCom (double r, double i) { complex ct; ct.re=fabs(r)<1E-300?0.0:r; ct.im=fabs(i)<1E-300?0.0:i; return ct; } static complex csqrt_crash (double x) { return (x>=0) ? setCom(sqrt(x),0) : setCom(0,sqrt(-x)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/981107-1.c ================================================ unsigned long seed(void) { unsigned long u; call(); u = 26107 * (unsigned long)&u; return u; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/981223-1.c ================================================ /* The problem on IA-64 is that the assembler emits Warning: Additional NOP may be necessary to workaround Itanium processor A/B step errata */ /* { dg-prune-output "Assembler messages" } */ /* { dg-prune-output "Additional NOP may be necessary" } */ __complex__ float func (__complex__ float x) { if (__real__ x == 0.0) return 1.0; else return 0.0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990107-1.c ================================================ static int java_double_finite (d) double d; { long long *ip = (long long *) &d; return (*ip & 0x7ff0000000000000LL ) != 0x7ff0000000000000LL ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990117-1.c ================================================ static void __bb_init_prg () { const char *p; { unsigned long l; (__extension__ (__builtin_constant_p (p) && __builtin_constant_p (l) ? 5 : 2)); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990203-1.c ================================================ int f (f) float f; { long long *ip = (long long *) &f; return (*ip & 0x7ff0000000000000LL ) != 0x7ff0000000000000LL ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990517-1.c ================================================ /* Extracted from the sdm module in perl. */ typedef struct { char *dptr; int dsize; } datum; extern long sdbm_hash (char *, int) ; extern void sdbm__putpair (char *, datum, datum) ; void sdbm__splpage (char *pag, char *New, long int sbit) { datum key; datum val; register int n; register int off = 1024 ; char cur[1024 ]; register short *ino = (short *) cur; (void) memcpy(cur, pag, 1024 ); (void) ({ void *__s = ( pag ); __builtin_memset ( __s , '\0', 1024 ) ; __s; }); (void) ({ void *__s = ( New ); __builtin_memset ( __s , '\0', 1024 ) ; __s; }); n = ino[0]; for (ino++; n > 0; ino += 2) { key.dptr = cur + ino[0]; key.dsize = off - ino[0]; val.dptr = cur + ino[1]; val.dsize = ino[0] - ino[1]; (void) sdbm__putpair ((sdbm_hash(( key ).dptr, ( key ).dsize) & sbit) ? New : pag, key, val); off = ino[1]; n -= 2; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990519-1.c ================================================ typedef int gboolean; typedef struct{ gboolean names : 1; gboolean types : 1; } ParamOptions; int p_param(ParamOptions* o){ return o->types && o->names; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990523-1.c ================================================ extern float decwin[512+32]; int synth_1to1(float *bandPtr,int channel,unsigned char *out,int *pnt) { static const int step = 2; short *samples = (short *) (out+*pnt); float *b0; int clip = 0; int bo1; { register int j; float *window = decwin + 16 - bo1; for (j=15;j;j--,b0-=0x20,window-=0x10,samples+=step) { float sum; sum -= *(--window) * *b0++; sum -= *(--window) * *b0++; sum -= *(--window) * *b0++; sum -= *(--window) * *b0++; sum -= *(--window) * *b0++; sum -= *(--window) * *b0++; sum -= *(--window) * *b0++; sum -= *(--window) * *b0++; if( ( sum ) > 32767.0) *( samples ) = 0x7fff; ( clip )++; ; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990527-1.c ================================================ typedef struct { int dummy; int width, height; } XWindowAttributes; typedef struct { short x, y; } XPoint; extern unsigned int ya_random (void); extern int XDrawPoints(XPoint*, int); static int iterations, offset; static int xsym, ysym; static void hurm (void) { XWindowAttributes xgwa; int xlim, ylim, x, y, i; XPoint points [4]; for (i = 0; i < iterations; i++) { int j = 0; j++; if (xsym) { points [j].x = xlim - x; j++; } points [j].x = x; j++; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990617-1.c ================================================ /* { dg-do assemble } */ /* { dg-require-effective-target ptr32plus } */ int main() { do { long l; long *p = &l; *p = 0x0000000070000000L; p += 2; { unsigned int *addr = (unsigned int *)0x70000000; printf("%d, %d\n", addr[1], addr[0]); } } while (1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990625-1.c ================================================ #define __USE_STRING_INLINES #include void test() { char *p, *a; const char *s; while ( (s = a) ) p = strcpy(strcpy(p,"/"), s); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990625-2.c ================================================ void broken030599(int *n) { int i, x; for (i = 0; i < 32; i++) { x=0; x++; if (i & 4) x++; x++; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990801-1.c ================================================ extern int getch(); extern int class(); int token() { int state = 1; while (1) { int c=0; c = getch(); switch (state) { case 1: break; case 4: break; case 5: break; case 6: { switch (class(c)) { default: break; } } break; case 7: break; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990801-2.c ================================================ void f() { extern char* p; int ch; while (!(ch = 0)) { if ((ch == 0) || (ch == 2)) { break; } *p = 0; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990829-1.c ================================================ struct x { int a:16; int b:16; int c; }; bar() { struct x y; y.b = 1 < y.a; foo(&y); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990913-1.c ================================================ int f() { unsigned char hrs, min; min = ((min / 10) << 4) + min % 10; hrs = ((hrs / 10) << 4) + hrs % 10; return hrs + min; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/990928-1.c ================================================ /* Make sure that debug information can be generated for inline functions containing incomplete type declarations. */ inline int foo (void) { struct imcomplete1 * ptr1; union incomplete2 * ptr2; enum incomplete3 * ptr3; return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/991008-1.c ================================================ typedef struct { int x; } FILE; extern void fputs (const char *, FILE *); int mView; void foo (FILE * out, int aIndent) { if (0 != mView) { aIndent++; aIndent--; { int __t = aIndent; while (--__t >= 0) fputs (" ", out); } } { int __t = aIndent; while (--__t >= 0) fputs (" ", out); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/991026-1.c ================================================ void something_f(float); int foo(void) { union { float f; double d; } u, *pu = &u; u.f = 1.0; something_f(u.f); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/991026-2.c ================================================ typedef int __pid_t; extern __pid_t fork (void) ; extern int printf (__const char *__restrict __format, ...) ; extern char *strerror (int __errnum) ; extern int errno; extern int *__errno_location (void) __attribute__ ((__const__)); extern void _exit (int __status) __attribute__ ((__noreturn__)); extern void exit (int __status) __attribute__ ((__noreturn__)); extern int close (int __fd) ; extern int dup (int __fd) ; extern int open (__const char *__file, int __oflag, ...) ; char myname[]="foo"; detach() { switch(fork()) { case -1: printf("%s: Error: fork - %s\n",myname, strerror((*__errno_location ()) )); exit(255); case 0: close(0); close(1); close(2); dup(dup(open("/dev/null", 02 ))); return; default: _exit(0); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/991127-1.c ================================================ extern void foo (int *); static void bar (char *buf) { int a; foo (&a); while (a > 0) { *buf++ = '0'; a--; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/991202-1.c ================================================ extern float A[], B[]; extern float MAXNUMF; float chbevlf(float, float *, int); float expf(float), i1f(float), logf(float), sqrtf(float); float k1f(float xx) { float x, y; x = xx; if( x <= 2.0 ) { y = x * x - 2.0; y = logf( 0.5f * x ) * i1f(x) + chbevlf( y, A, 7 ) / x; return( y ); } return( expf(-x) * chbevlf( (float)(8.0/x - 2.0), B, 10 ) / sqrtf(x) ); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/991208-1.c ================================================ void fn (char *ptr) { void *p = ptr - 8 - 4; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/991213-1.c ================================================ typedef __complex__ double double_complex; void p (const double_complex *t, int n) { int i; double s = ({ typeof ( t[n/2] ) arg = ( t[n/2] ); (__imag__ arg); }) ; for (i = 1; i < n/2; i++) s += 2* ({ typeof ( t[i] ) arg = ( t[i] ); (__imag__ arg); }) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/991213-2.c ================================================ typedef long __kernel_time_t; typedef __kernel_time_t time_t; time2( void (* const (funcp)(time_t)), const long offset, int * const okayp) { register int bits; time_t t; for (bits = 0, t = 1; t > 0; ++bits, t <<= 1) ; t = (t < 0) ? 0 : ((time_t) 1 << bits); for ( ; ; ) { (*funcp)((time_t)&t); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/991213-3.c ================================================ /* { dg-require-effective-target indirect_jumps } */ int jump () { goto * (int (*) ()) 0xbabebec0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/991214-1.c ================================================ void foo(double bar[], double *zp, int n) { int i, j; i = 0; for(j = 0; j < n; j++) { i += j+1; bar[i] *= (1.0 + *zp); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/991214-2.c ================================================ #if defined(STACK_SIZE) && (STACK_SIZE < 65536) # define HISTO_SIZE 9 #else # define HISTO_SIZE 36 #endif extern int N; extern int nrows; extern int or_num_angles; typedef struct { double value; int count; }Histo; Histo add_histo[10][2][HISTO_SIZE][HISTO_SIZE]; void cmd_connection_statistics( ) { int i,j,k,m; for(i=0; itext.source->SetSelection != nullProc) { foo(); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG11.c ================================================ #define DD 2410065408 unsigned foo (d) double d; { return d; } #if foobar main () { #if bar unsigned u = DD; double d = (double) u; #else double d = (double) DD; #endif printf ("%u = %u = %lf\n", foo ((double) DD), foo (d), d); } #else main () { printf ("%lf\n", (double) ((unsigned) DD)); foo ((double) DD); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG12.c ================================================ long long main () { return 1.1e10; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG13.c ================================================ struct tree_common { int uid; unsigned int code : 8; unsigned int code2 : 8; unsigned external_attr : 1; unsigned public_attr : 1; }; static int duplicate_decls (x) register struct tree_common *x; { if (x->external_attr) if (x->code) if (x->code2) x->public_attr = 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG16.c ================================================ setgetlen (a) int *a; { while (*a++ & 0x80000000) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG17.c ================================================ double d; main() { int i; i = (int) d; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG18.c ================================================ main() { if ((signed int) 1 < (signed int) -2147483648) printf("true\n"); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG2.c ================================================ BUG2 (p) int *p; { int a = 0; if (*p == a) return 0; else return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG21.c ================================================ typedef struct { int knock_on_wood; /* leave it out and it works. */ int f1; } FOO; typedef struct { FOO *b1; } BAR; Nase () { int i, j; FOO *foop; BAR *barp; for (i = 0; i < 2; i++) { foop = &barp->b1[i]; for (j = 0; j < foop->f1; j++) { /* dummy() */; /* put it in and it works. */ } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG22.c ================================================ void Rotate (float angle) { float mag = (angle < 0) ? -angle : angle; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG23.c ================================================ main() { static char static_char_array[1]; static char *static_char_pointer; static char static_char; char char_array[1]; char *char_pointer; char character; char *cp, c; c = cp - static_char_array; /* error */ c = cp - static_char_pointer; c = cp - &static_char; /* error */ c = cp - char_array; c = cp - char_pointer; c = cp - &character; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG24.c ================================================ struct ack { char a, b, c; }; main() { struct ack bad; foo(bad); } foo(c) struct ack c; { } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG25.c ================================================ foo (a) { __builtin_ffs (a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG3.c ================================================ BUG2 (p) char *p; { int a = 0; if (*p == a) return 0; else return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG4.c ================================================ int foo() { char c; return (c ^ 30 ) > (c ^ 40 ); /* these also get the signal : return (c ^ 30 ) == (c ^ 40 ); return ((int)c ^ 30 ) > (c ^ 40 ); also fails if c is "extern char" these are ok : return (c + 30 ) > (c ^ 40 ); return (c ^ 30 ) > (c + 40 ); return (c ^ 30 ) + (c ^ 40 ); return ('a' ^ 30 ) > (c ^ 40 ); return (c ^ 40 ); return (c ^ 30 ) > (c ^ 40 ); */ } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG5.c ================================================ enum bar { one, two }; enum bar foo; void bar() { switch (foo) { case one: case two: printf ("one to two\n"); break; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/BUG6.c ================================================ main() { unsigned long L; double D; D = L = -3; printf("L=%lu, D=%g\n", L, D); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/DFcmp.c ================================================ /* { dg-require-effective-target int32plus } */ #define type double type glob0, glob1; #define E0 ((type *)10000000) #define reg0 r0 #define indreg0 (*p0) #define imm0 22 #define limm0 ((type)((int)&glob0)) #define adr0 (*E0) #define adrreg0 (p0[10000000]) #define adrx0 (E0[x0]) #define regx0 (p0[x0]) #define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) #define reg1 r1 #define indreg1 (*p1) #define imm1 33 #define limm1 ((type)((int)&glob1)) #define adr1 (*E1) #define adrreg1 (p1[1111111/4]) #define adrx1 (E1[x1]) #define regx1 (p1[x1]) reg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= reg1) return 1; else return 0;} reg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= indreg1) return 1; else return 0;} reg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= imm1) return 1; else return 0;} reg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= limm1) return 1; else return 0;} reg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adr1) return 1; else return 0;} reg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrreg1) return 1; else return 0;} reg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrx1) return 1; else return 0;} reg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= regx1) return 1; else return 0;} indreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= reg1) return 1; else return 0;} indreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= indreg1) return 1; else return 0;} indreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= imm1) return 1; else return 0;} indreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= limm1) return 1; else return 0;} indreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adr1) return 1; else return 0;} indreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrreg1) return 1; else return 0;} indreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrx1) return 1; else return 0;} indreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= regx1) return 1; else return 0;} imm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= reg1) return 1; else return 0;} imm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= indreg1) return 1; else return 0;} imm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= imm1) return 1; else return 0;} imm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= limm1) return 1; else return 0;} imm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adr1) return 1; else return 0;} imm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrreg1) return 1; else return 0;} imm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrx1) return 1; else return 0;} imm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= regx1) return 1; else return 0;} limm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= reg1) return 1; else return 0;} limm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= indreg1) return 1; else return 0;} limm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= imm1) return 1; else return 0;} limm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= limm1) return 1; else return 0;} limm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adr1) return 1; else return 0;} limm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrreg1) return 1; else return 0;} limm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrx1) return 1; else return 0;} limm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= regx1) return 1; else return 0;} adr0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= reg1) return 1; else return 0;} adr0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= indreg1) return 1; else return 0;} adr0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= imm1) return 1; else return 0;} adr0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= limm1) return 1; else return 0;} adr0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adr1) return 1; else return 0;} adr0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrreg1) return 1; else return 0;} adr0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrx1) return 1; else return 0;} adr0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= regx1) return 1; else return 0;} adrreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= reg1) return 1; else return 0;} adrreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= indreg1) return 1; else return 0;} adrreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= imm1) return 1; else return 0;} adrreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= limm1) return 1; else return 0;} adrreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adr1) return 1; else return 0;} adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrreg1) return 1; else return 0;} adrreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrx1) return 1; else return 0;} adrreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= regx1) return 1; else return 0;} adrx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= reg1) return 1; else return 0;} adrx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= indreg1) return 1; else return 0;} adrx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= imm1) return 1; else return 0;} adrx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= limm1) return 1; else return 0;} adrx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adr1) return 1; else return 0;} adrx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrreg1) return 1; else return 0;} adrx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrx1) return 1; else return 0;} adrx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= regx1) return 1; else return 0;} regx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= reg1) return 1; else return 0;} regx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= indreg1) return 1; else return 0;} regx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= imm1) return 1; else return 0;} regx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= limm1) return 1; else return 0;} regx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adr1) return 1; else return 0;} regx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrreg1) return 1; else return 0;} regx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrx1) return 1; else return 0;} regx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= regx1) return 1; else return 0;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/HIcmp.c ================================================ #define type short type glob0, glob1; #define E0 ((type *)10000000) #define reg0 r0 #define indreg0 (*p0) #define imm0 22 #define limm0 ((type)&glob0) #define adr0 (*E0) #define adrreg0 (p0[10000000]) #define adrx0 (E0[x0]) #define regx0 (p0[x0]) #define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) #define reg1 r1 #define indreg1 (*p1) #define imm1 33 #define limm1 ((type)&glob1) #define adr1 (*E1) #define adrreg1 (p1[1111111/4]) #define adrx1 (E1[x1]) #define regx1 (p1[x1]) reg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= reg1) return 1; else return 0;} reg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= indreg1) return 1; else return 0;} reg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= imm1) return 1; else return 0;} reg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= limm1) return 1; else return 0;} reg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adr1) return 1; else return 0;} reg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrreg1) return 1; else return 0;} reg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrx1) return 1; else return 0;} reg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= regx1) return 1; else return 0;} indreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= reg1) return 1; else return 0;} indreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= indreg1) return 1; else return 0;} indreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= imm1) return 1; else return 0;} indreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= limm1) return 1; else return 0;} indreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adr1) return 1; else return 0;} indreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrreg1) return 1; else return 0;} indreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrx1) return 1; else return 0;} indreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= regx1) return 1; else return 0;} imm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= reg1) return 1; else return 0;} imm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= indreg1) return 1; else return 0;} imm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= imm1) return 1; else return 0;} imm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= limm1) return 1; else return 0;} imm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adr1) return 1; else return 0;} imm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrreg1) return 1; else return 0;} imm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrx1) return 1; else return 0;} imm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= regx1) return 1; else return 0;} limm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= reg1) return 1; else return 0;} limm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= indreg1) return 1; else return 0;} limm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= imm1) return 1; else return 0;} limm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= limm1) return 1; else return 0;} limm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adr1) return 1; else return 0;} limm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrreg1) return 1; else return 0;} limm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrx1) return 1; else return 0;} limm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= regx1) return 1; else return 0;} adr0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= reg1) return 1; else return 0;} adr0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= indreg1) return 1; else return 0;} adr0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= imm1) return 1; else return 0;} adr0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= limm1) return 1; else return 0;} adr0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adr1) return 1; else return 0;} adr0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrreg1) return 1; else return 0;} adr0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrx1) return 1; else return 0;} adr0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= regx1) return 1; else return 0;} adrreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= reg1) return 1; else return 0;} adrreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= indreg1) return 1; else return 0;} adrreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= imm1) return 1; else return 0;} adrreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= limm1) return 1; else return 0;} adrreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adr1) return 1; else return 0;} adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrreg1) return 1; else return 0;} adrreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrx1) return 1; else return 0;} adrreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= regx1) return 1; else return 0;} adrx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= reg1) return 1; else return 0;} adrx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= indreg1) return 1; else return 0;} adrx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= imm1) return 1; else return 0;} adrx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= limm1) return 1; else return 0;} adrx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adr1) return 1; else return 0;} adrx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrreg1) return 1; else return 0;} adrx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrx1) return 1; else return 0;} adrx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= regx1) return 1; else return 0;} regx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= reg1) return 1; else return 0;} regx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= indreg1) return 1; else return 0;} regx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= imm1) return 1; else return 0;} regx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= limm1) return 1; else return 0;} regx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adr1) return 1; else return 0;} regx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrreg1) return 1; else return 0;} regx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrx1) return 1; else return 0;} regx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= regx1) return 1; else return 0;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/HIset.c ================================================ #define E0 ((type *)10000000) #define reg0 r0 #define indreg0 (*p0) #define imm0 22 #define limm0 ((type)(int)&glob0) #define adr0 (*E0) #define adrreg0 (p0[10000000]) #define adrx0 (E0[x0]) #define regx0 (p0[x0]) #define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) #define reg1 r1 #define indreg1 (*p1) #define imm1 33 #define limm1 ((type)(int)&glob1) #define adr1 (*E1) #define adrreg1 (p1[1111111/4]) #define adrx1 (E1[x1]) #define regx1 (p1[x1]) int glob0, glob1; #define type short reg0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = reg1; } reg0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = indreg1; } reg0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = imm1; } reg0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = limm1; } reg0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = adr1; } reg0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = adrreg1; } reg0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = adrx1; } reg0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = regx1; } indreg0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = reg1; } indreg0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = indreg1; } indreg0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = imm1; } indreg0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = limm1; } indreg0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = adr1; } indreg0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = adrreg1; } indreg0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = adrx1; } indreg0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = regx1; } adr0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = reg1; } adr0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = indreg1; } adr0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = imm1; } adr0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = limm1; } adr0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = adr1; } adr0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = adrreg1; } adr0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = adrx1; } adr0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = regx1; } adrreg0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = reg1; } adrreg0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = indreg1; } adrreg0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = imm1; } adrreg0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = limm1; } adrreg0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = adr1; } adrreg0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = adrreg1; } adrreg0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = adrx1; } adrreg0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = regx1; } adrx0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = reg1; } adrx0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = indreg1; } adrx0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = imm1; } adrx0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = limm1; } adrx0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = adr1; } adrx0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = adrreg1; } adrx0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = adrx1; } adrx0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = regx1; } regx0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = reg1; } regx0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = indreg1; } regx0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = imm1; } regx0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = limm1; } regx0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = adr1; } regx0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = adrreg1; } regx0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = adrx1; } regx0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = regx1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/PYRBUG.c ================================================ typedef struct { int v; int h; } Point; typedef struct { int top, left, bottom, right; } Rect; int x_PtInRect (Point pt, Rect *r) { return pt.v >= r->top && pt.v < r->bottom && pt.h >= r->left && pt.h < r->right; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/QIcmp.c ================================================ #define type signed char type glob0, glob1; #define E0 ((type *)10000000) #define reg0 r0 #define indreg0 (*p0) #define imm0 22 #define limm0 ((type)&glob0) #define adr0 (*E0) #define adrreg0 (p0[10000000]) #define adrx0 (E0[x0]) #define regx0 (p0[x0]) #define E1 ((type *)11111111) #define reg1 r1 #define indreg1 (*p1) #define imm1 33 #define limm1 ((type)&glob1) #define adr1 (*E1) #define adrreg1 (p1[1111111/4]) #define adrx1 (E1[x1]) #define regx1 (p1[x1]) reg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= reg1) return 1; else return 0;} reg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= indreg1) return 1; else return 0;} reg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= imm1) return 1; else return 0;} reg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= limm1) return 1; else return 0;} reg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adr1) return 1; else return 0;} reg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrreg1) return 1; else return 0;} reg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrx1) return 1; else return 0;} reg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= regx1) return 1; else return 0;} indreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= reg1) return 1; else return 0;} indreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= indreg1) return 1; else return 0;} indreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= imm1) return 1; else return 0;} indreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= limm1) return 1; else return 0;} indreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adr1) return 1; else return 0;} indreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrreg1) return 1; else return 0;} indreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrx1) return 1; else return 0;} indreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= regx1) return 1; else return 0;} imm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= reg1) return 1; else return 0;} imm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= indreg1) return 1; else return 0;} imm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= imm1) return 1; else return 0;} imm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= limm1) return 1; else return 0;} imm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adr1) return 1; else return 0;} imm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrreg1) return 1; else return 0;} imm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrx1) return 1; else return 0;} imm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= regx1) return 1; else return 0;} limm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= reg1) return 1; else return 0;} limm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= indreg1) return 1; else return 0;} limm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= imm1) return 1; else return 0;} limm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= limm1) return 1; else return 0;} limm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adr1) return 1; else return 0;} limm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrreg1) return 1; else return 0;} limm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrx1) return 1; else return 0;} limm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= regx1) return 1; else return 0;} adr0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= reg1) return 1; else return 0;} adr0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= indreg1) return 1; else return 0;} adr0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= imm1) return 1; else return 0;} adr0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= limm1) return 1; else return 0;} adr0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adr1) return 1; else return 0;} adr0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrreg1) return 1; else return 0;} adr0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrx1) return 1; else return 0;} adr0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= regx1) return 1; else return 0;} adrreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= reg1) return 1; else return 0;} adrreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= indreg1) return 1; else return 0;} adrreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= imm1) return 1; else return 0;} adrreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= limm1) return 1; else return 0;} adrreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adr1) return 1; else return 0;} adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrreg1) return 1; else return 0;} adrreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrx1) return 1; else return 0;} adrreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= regx1) return 1; else return 0;} adrx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= reg1) return 1; else return 0;} adrx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= indreg1) return 1; else return 0;} adrx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= imm1) return 1; else return 0;} adrx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= limm1) return 1; else return 0;} adrx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adr1) return 1; else return 0;} adrx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrreg1) return 1; else return 0;} adrx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrx1) return 1; else return 0;} adrx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= regx1) return 1; else return 0;} regx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= reg1) return 1; else return 0;} regx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= indreg1) return 1; else return 0;} regx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= imm1) return 1; else return 0;} regx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= limm1) return 1; else return 0;} regx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adr1) return 1; else return 0;} regx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrreg1) return 1; else return 0;} regx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrx1) return 1; else return 0;} regx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= regx1) return 1; else return 0;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/QIset.c ================================================ #define E0 ((type *)10000000) #define reg0 r0 #define indreg0 (*p0) #define imm0 22 #define limm0 ((type)(int)&glob0) #define adr0 (*E0) #define adrreg0 (p0[10000000]) #define adrx0 (E0[x0]) #define regx0 (p0[x0]) #define E1 ((type *)11111111) #define reg1 r1 #define indreg1 (*p1) #define imm1 33 #define limm1 ((type)(int)&glob1) #define adr1 (*E1) #define adrreg1 (p1[1111111/4]) #define adrx1 (E1[x1]) #define regx1 (p1[x1]) int glob0, glob1; #define type char reg0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = reg1; } reg0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = indreg1; } reg0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = imm1; } reg0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = limm1; } reg0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = adr1; } reg0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = adrreg1; } reg0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = adrx1; } reg0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = regx1; } indreg0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = reg1; } indreg0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = indreg1; } indreg0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = imm1; } indreg0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = limm1; } indreg0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = adr1; } indreg0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = adrreg1; } indreg0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = adrx1; } indreg0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = regx1; } adr0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = reg1; } adr0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = indreg1; } adr0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = imm1; } adr0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = limm1; } adr0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = adr1; } adr0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = adrreg1; } adr0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = adrx1; } adr0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = regx1; } adrreg0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = reg1; } adrreg0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = indreg1; } adrreg0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = imm1; } adrreg0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = limm1; } adrreg0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = adr1; } adrreg0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = adrreg1; } adrreg0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = adrx1; } adrreg0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = regx1; } adrx0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = reg1; } adrx0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = indreg1; } adrx0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = imm1; } adrx0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = limm1; } adrx0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = adr1; } adrx0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = adrreg1; } adrx0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = adrx1; } adrx0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = regx1; } regx0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = reg1; } regx0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = indreg1; } regx0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = imm1; } regx0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = limm1; } regx0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = adr1; } regx0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = adrreg1; } regx0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = adrx1; } regx0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = regx1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/SFset.c ================================================ /* { dg-require-effective-target int32plus } */ #define E0 ((type *)10000000) #define reg0 r0 #define indreg0 (*p0) #define imm0 22 #define limm0 ((type)(int)&glob0) #define adr0 (*E0) #define adrreg0 (p0[10000000]) #define adrx0 (E0[x0]) #define regx0 (p0[x0]) #define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) #define reg1 r1 #define indreg1 (*p1) #define imm1 33 #define limm1 ((type)(int)&glob1) #define adr1 (*E1) #define adrreg1 (p1[1111111/4]) #define adrx1 (E1[x1]) #define regx1 (p1[x1]) int glob0, glob1; #define type float reg0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = reg1; } reg0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = indreg1; } reg0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = imm1; } reg0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = limm1; } reg0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = adr1; } reg0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = adrreg1; } reg0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = adrx1; } reg0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = regx1; } indreg0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = reg1; } indreg0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = indreg1; } indreg0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = imm1; } indreg0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = limm1; } indreg0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = adr1; } indreg0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = adrreg1; } indreg0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = adrx1; } indreg0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = regx1; } adr0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = reg1; } adr0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = indreg1; } adr0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = imm1; } adr0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = limm1; } adr0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = adr1; } adr0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = adrreg1; } adr0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = adrx1; } adr0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = regx1; } adrreg0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = reg1; } adrreg0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = indreg1; } adrreg0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = imm1; } adrreg0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = limm1; } adrreg0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = adr1; } adrreg0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = adrreg1; } adrreg0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = adrx1; } adrreg0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = regx1; } adrx0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = reg1; } adrx0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = indreg1; } adrx0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = imm1; } adrx0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = limm1; } adrx0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = adr1; } adrx0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = adrreg1; } adrx0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = adrx1; } adrx0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = regx1; } regx0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = reg1; } regx0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = indreg1; } regx0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = imm1; } regx0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = limm1; } regx0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = adr1; } regx0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = adrreg1; } regx0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = adrx1; } regx0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = regx1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/SIcmp.c ================================================ #define type int type glob0, glob1; #define E0 ((type *)10000000) #define reg0 r0 #define indreg0 (*p0) #define imm0 22 #define limm0 ((type)&glob0) #define adr0 (*E0) #define adrreg0 (p0[10000000]) #define adrx0 (E0[x0]) #define regx0 (p0[x0]) #define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) #define reg1 r1 #define indreg1 (*p1) #define imm1 33 #define limm1 ((type)&glob1) #define adr1 (*E1) #define adrreg1 (p1[1111111/4]) #define adrx1 (E1[x1]) #define regx1 (p1[x1]) reg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= reg1) return 1; else return 0;} reg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= indreg1) return 1; else return 0;} reg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= imm1) return 1; else return 0;} reg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= limm1) return 1; else return 0;} reg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adr1) return 1; else return 0;} reg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrreg1) return 1; else return 0;} reg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrx1) return 1; else return 0;} reg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= regx1) return 1; else return 0;} indreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= reg1) return 1; else return 0;} indreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= indreg1) return 1; else return 0;} indreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= imm1) return 1; else return 0;} indreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= limm1) return 1; else return 0;} indreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adr1) return 1; else return 0;} indreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrreg1) return 1; else return 0;} indreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrx1) return 1; else return 0;} indreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= regx1) return 1; else return 0;} imm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= reg1) return 1; else return 0;} imm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= indreg1) return 1; else return 0;} imm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= imm1) return 1; else return 0;} imm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= limm1) return 1; else return 0;} imm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adr1) return 1; else return 0;} imm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrreg1) return 1; else return 0;} imm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrx1) return 1; else return 0;} imm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= regx1) return 1; else return 0;} limm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= reg1) return 1; else return 0;} limm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= indreg1) return 1; else return 0;} limm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= imm1) return 1; else return 0;} limm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= limm1) return 1; else return 0;} limm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adr1) return 1; else return 0;} limm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrreg1) return 1; else return 0;} limm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrx1) return 1; else return 0;} limm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= regx1) return 1; else return 0;} adr0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= reg1) return 1; else return 0;} adr0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= indreg1) return 1; else return 0;} adr0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= imm1) return 1; else return 0;} adr0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= limm1) return 1; else return 0;} adr0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adr1) return 1; else return 0;} adr0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrreg1) return 1; else return 0;} adr0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrx1) return 1; else return 0;} adr0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= regx1) return 1; else return 0;} adrreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= reg1) return 1; else return 0;} adrreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= indreg1) return 1; else return 0;} adrreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= imm1) return 1; else return 0;} adrreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= limm1) return 1; else return 0;} adrreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adr1) return 1; else return 0;} adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrreg1) return 1; else return 0;} adrreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrx1) return 1; else return 0;} adrreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= regx1) return 1; else return 0;} adrx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= reg1) return 1; else return 0;} adrx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= indreg1) return 1; else return 0;} adrx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= imm1) return 1; else return 0;} adrx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= limm1) return 1; else return 0;} adrx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adr1) return 1; else return 0;} adrx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrreg1) return 1; else return 0;} adrx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrx1) return 1; else return 0;} adrx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= regx1) return 1; else return 0;} regx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= reg1) return 1; else return 0;} regx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= indreg1) return 1; else return 0;} regx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= imm1) return 1; else return 0;} regx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= limm1) return 1; else return 0;} regx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adr1) return 1; else return 0;} regx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrreg1) return 1; else return 0;} regx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrx1) return 1; else return 0;} regx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= regx1) return 1; else return 0;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/SIset.c ================================================ #define E0 ((type *)10000000) #define reg0 r0 #define indreg0 (*p0) #define imm0 22 #define limm0 ((type)(int)&glob0) #define adr0 (*E0) #define adrreg0 (p0[10000000]) #define adrx0 (E0[x0]) #define regx0 (p0[x0]) #define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) #define reg1 r1 #define indreg1 (*p1) #define imm1 33 #define limm1 ((type)(int)&glob1) #define adr1 (*E1) #define adrreg1 (p1[1111111/4]) #define adrx1 (E1[x1]) #define regx1 (p1[x1]) int glob0, glob1; #define type int reg0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = reg1; } reg0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = indreg1; } reg0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = imm1; } reg0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = limm1; } reg0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = adr1; } reg0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = adrreg1; } reg0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = adrx1; } reg0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {reg0 = regx1; } indreg0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = reg1; } indreg0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = indreg1; } indreg0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = imm1; } indreg0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = limm1; } indreg0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = adr1; } indreg0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = adrreg1; } indreg0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = adrx1; } indreg0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {indreg0 = regx1; } adr0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = reg1; } adr0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = indreg1; } adr0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = imm1; } adr0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = limm1; } adr0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = adr1; } adr0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = adrreg1; } adr0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = adrx1; } adr0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adr0 = regx1; } adrreg0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = reg1; } adrreg0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = indreg1; } adrreg0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = imm1; } adrreg0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = limm1; } adrreg0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = adr1; } adrreg0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = adrreg1; } adrreg0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = adrx1; } adrreg0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrreg0 = regx1; } adrx0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = reg1; } adrx0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = indreg1; } adrx0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = imm1; } adrx0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = limm1; } adrx0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = adr1; } adrx0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = adrreg1; } adrx0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = adrx1; } adrx0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {adrx0 = regx1; } regx0reg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = reg1; } regx0indreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = indreg1; } regx0imm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = imm1; } regx0limm1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = limm1; } regx0adr1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = adr1; } regx0adrreg1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = adrreg1; } regx0adrx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = adrx1; } regx0regx1_set (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {regx0 = regx1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/UHIcmp.c ================================================ #define type unsigned short type glob0, glob1; #define E0 ((type *)10000000) #define reg0 r0 #define indreg0 (*p0) #define imm0 22 #define limm0 ((type)&glob0) #define adr0 (*E0) #define adrreg0 (p0[10000000]) #define adrx0 (E0[x0]) #define regx0 (p0[x0]) #define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) #define reg1 r1 #define indreg1 (*p1) #define imm1 33 #define limm1 ((type)&glob1) #define adr1 (*E1) #define adrreg1 (p1[1111111/4]) #define adrx1 (E1[x1]) #define regx1 (p1[x1]) reg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= reg1) return 1; else return 0;} reg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= indreg1) return 1; else return 0;} reg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= imm1) return 1; else return 0;} reg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= limm1) return 1; else return 0;} reg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adr1) return 1; else return 0;} reg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrreg1) return 1; else return 0;} reg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrx1) return 1; else return 0;} reg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= regx1) return 1; else return 0;} indreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= reg1) return 1; else return 0;} indreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= indreg1) return 1; else return 0;} indreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= imm1) return 1; else return 0;} indreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= limm1) return 1; else return 0;} indreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adr1) return 1; else return 0;} indreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrreg1) return 1; else return 0;} indreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrx1) return 1; else return 0;} indreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= regx1) return 1; else return 0;} imm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= reg1) return 1; else return 0;} imm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= indreg1) return 1; else return 0;} imm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= imm1) return 1; else return 0;} imm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= limm1) return 1; else return 0;} imm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adr1) return 1; else return 0;} imm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrreg1) return 1; else return 0;} imm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrx1) return 1; else return 0;} imm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= regx1) return 1; else return 0;} limm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= reg1) return 1; else return 0;} limm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= indreg1) return 1; else return 0;} limm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= imm1) return 1; else return 0;} limm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= limm1) return 1; else return 0;} limm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adr1) return 1; else return 0;} limm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrreg1) return 1; else return 0;} limm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrx1) return 1; else return 0;} limm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= regx1) return 1; else return 0;} adr0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= reg1) return 1; else return 0;} adr0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= indreg1) return 1; else return 0;} adr0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= imm1) return 1; else return 0;} adr0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= limm1) return 1; else return 0;} adr0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adr1) return 1; else return 0;} adr0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrreg1) return 1; else return 0;} adr0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrx1) return 1; else return 0;} adr0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= regx1) return 1; else return 0;} adrreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= reg1) return 1; else return 0;} adrreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= indreg1) return 1; else return 0;} adrreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= imm1) return 1; else return 0;} adrreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= limm1) return 1; else return 0;} adrreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adr1) return 1; else return 0;} adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrreg1) return 1; else return 0;} adrreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrx1) return 1; else return 0;} adrreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= regx1) return 1; else return 0;} adrx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= reg1) return 1; else return 0;} adrx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= indreg1) return 1; else return 0;} adrx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= imm1) return 1; else return 0;} adrx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= limm1) return 1; else return 0;} adrx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adr1) return 1; else return 0;} adrx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrreg1) return 1; else return 0;} adrx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrx1) return 1; else return 0;} adrx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= regx1) return 1; else return 0;} regx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= reg1) return 1; else return 0;} regx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= indreg1) return 1; else return 0;} regx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= imm1) return 1; else return 0;} regx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= limm1) return 1; else return 0;} regx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adr1) return 1; else return 0;} regx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrreg1) return 1; else return 0;} regx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrx1) return 1; else return 0;} regx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= regx1) return 1; else return 0;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/UQIcmp.c ================================================ #define type unsigned char type glob0, glob1; #define E0 ((type *)10000000) #define reg0 r0 #define indreg0 (*p0) #define imm0 22 #define limm0 ((type)&glob0) #define adr0 (*E0) #define adrreg0 (p0[10000000]) #define adrx0 (E0[x0]) #define regx0 (p0[x0]) #define E1 ((type *)11111111) #define reg1 r1 #define indreg1 (*p1) #define imm1 33 #define limm1 ((type)&glob1) #define adr1 (*E1) #define adrreg1 (p1[1111111/4]) #define adrx1 (E1[x1]) #define regx1 (p1[x1]) reg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= reg1) return 1; else return 0;} reg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= indreg1) return 1; else return 0;} reg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= imm1) return 1; else return 0;} reg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= limm1) return 1; else return 0;} reg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adr1) return 1; else return 0;} reg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrreg1) return 1; else return 0;} reg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrx1) return 1; else return 0;} reg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= regx1) return 1; else return 0;} indreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= reg1) return 1; else return 0;} indreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= indreg1) return 1; else return 0;} indreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= imm1) return 1; else return 0;} indreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= limm1) return 1; else return 0;} indreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adr1) return 1; else return 0;} indreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrreg1) return 1; else return 0;} indreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrx1) return 1; else return 0;} indreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= regx1) return 1; else return 0;} imm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= reg1) return 1; else return 0;} imm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= indreg1) return 1; else return 0;} imm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= imm1) return 1; else return 0;} imm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= limm1) return 1; else return 0;} imm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adr1) return 1; else return 0;} imm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrreg1) return 1; else return 0;} imm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrx1) return 1; else return 0;} imm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= regx1) return 1; else return 0;} limm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= reg1) return 1; else return 0;} limm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= indreg1) return 1; else return 0;} limm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= imm1) return 1; else return 0;} limm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= limm1) return 1; else return 0;} limm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adr1) return 1; else return 0;} limm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrreg1) return 1; else return 0;} limm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrx1) return 1; else return 0;} limm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= regx1) return 1; else return 0;} adr0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= reg1) return 1; else return 0;} adr0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= indreg1) return 1; else return 0;} adr0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= imm1) return 1; else return 0;} adr0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= limm1) return 1; else return 0;} adr0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adr1) return 1; else return 0;} adr0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrreg1) return 1; else return 0;} adr0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrx1) return 1; else return 0;} adr0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= regx1) return 1; else return 0;} adrreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= reg1) return 1; else return 0;} adrreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= indreg1) return 1; else return 0;} adrreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= imm1) return 1; else return 0;} adrreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= limm1) return 1; else return 0;} adrreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adr1) return 1; else return 0;} adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrreg1) return 1; else return 0;} adrreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrx1) return 1; else return 0;} adrreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= regx1) return 1; else return 0;} adrx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= reg1) return 1; else return 0;} adrx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= indreg1) return 1; else return 0;} adrx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= imm1) return 1; else return 0;} adrx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= limm1) return 1; else return 0;} adrx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adr1) return 1; else return 0;} adrx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrreg1) return 1; else return 0;} adrx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrx1) return 1; else return 0;} adrx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= regx1) return 1; else return 0;} regx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= reg1) return 1; else return 0;} regx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= indreg1) return 1; else return 0;} regx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= imm1) return 1; else return 0;} regx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= limm1) return 1; else return 0;} regx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adr1) return 1; else return 0;} regx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrreg1) return 1; else return 0;} regx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrx1) return 1; else return 0;} regx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= regx1) return 1; else return 0;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/USIcmp.c ================================================ #define type unsigned int type glob0, glob1; #define E0 ((type *)10000000) #define reg0 r0 #define indreg0 (*p0) #define imm0 22 #define limm0 ((type)&glob0) #define adr0 (*E0) #define adrreg0 (p0[10000000]) #define adrx0 (E0[x0]) #define regx0 (p0[x0]) #define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) #define reg1 r1 #define indreg1 (*p1) #define imm1 33 #define limm1 ((type)&glob1) #define adr1 (*E1) #define adrreg1 (p1[1111111/4]) #define adrx1 (E1[x1]) #define regx1 (p1[x1]) reg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= reg1) return 1; else return 0;} reg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= indreg1) return 1; else return 0;} reg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= imm1) return 1; else return 0;} reg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= limm1) return 1; else return 0;} reg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adr1) return 1; else return 0;} reg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrreg1) return 1; else return 0;} reg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= adrx1) return 1; else return 0;} reg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= regx1) return 1; else return 0;} indreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= reg1) return 1; else return 0;} indreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= indreg1) return 1; else return 0;} indreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= imm1) return 1; else return 0;} indreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= limm1) return 1; else return 0;} indreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adr1) return 1; else return 0;} indreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrreg1) return 1; else return 0;} indreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= adrx1) return 1; else return 0;} indreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (indreg0 <= regx1) return 1; else return 0;} imm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= reg1) return 1; else return 0;} imm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= indreg1) return 1; else return 0;} imm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= imm1) return 1; else return 0;} imm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= limm1) return 1; else return 0;} imm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adr1) return 1; else return 0;} imm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrreg1) return 1; else return 0;} imm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= adrx1) return 1; else return 0;} imm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (imm0 <= regx1) return 1; else return 0;} limm0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= reg1) return 1; else return 0;} limm0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= indreg1) return 1; else return 0;} limm0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= imm1) return 1; else return 0;} limm0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= limm1) return 1; else return 0;} limm0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adr1) return 1; else return 0;} limm0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrreg1) return 1; else return 0;} limm0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= adrx1) return 1; else return 0;} limm0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (limm0 <= regx1) return 1; else return 0;} adr0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= reg1) return 1; else return 0;} adr0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= indreg1) return 1; else return 0;} adr0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= imm1) return 1; else return 0;} adr0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= limm1) return 1; else return 0;} adr0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adr1) return 1; else return 0;} adr0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrreg1) return 1; else return 0;} adr0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= adrx1) return 1; else return 0;} adr0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adr0 <= regx1) return 1; else return 0;} adrreg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= reg1) return 1; else return 0;} adrreg0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= indreg1) return 1; else return 0;} adrreg0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= imm1) return 1; else return 0;} adrreg0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= limm1) return 1; else return 0;} adrreg0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adr1) return 1; else return 0;} adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrreg1) return 1; else return 0;} adrreg0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= adrx1) return 1; else return 0;} adrreg0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrreg0 <= regx1) return 1; else return 0;} adrx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= reg1) return 1; else return 0;} adrx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= indreg1) return 1; else return 0;} adrx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= imm1) return 1; else return 0;} adrx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= limm1) return 1; else return 0;} adrx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adr1) return 1; else return 0;} adrx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrreg1) return 1; else return 0;} adrx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= adrx1) return 1; else return 0;} adrx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (adrx0 <= regx1) return 1; else return 0;} regx0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= reg1) return 1; else return 0;} regx0indreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= indreg1) return 1; else return 0;} regx0imm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= imm1) return 1; else return 0;} regx0limm1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= limm1) return 1; else return 0;} regx0adr1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adr1) return 1; else return 0;} regx0adrreg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrreg1) return 1; else return 0;} regx0adrx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= adrx1) return 1; else return 0;} regx0regx1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (regx0 <= regx1) return 1; else return 0;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/a.c ================================================ foo (a) { return a & 65535; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/a1.c ================================================ int foo (a, p) int *p; { p[0] = 85 * a; p[1] = -86 * a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/a3.c ================================================ foo (a) { int i; for (i = 1; i < a; i++) ; { int b = (int) &foo; return (a & b) == 0; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/aa.c ================================================ #define w 20 #define c 1 foo (a) unsigned a; { return ((a & ((1 << w) - 1)) << c) > 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/aaa.c ================================================ foo (a, b) { int t; while (b < 0) { t = a; a = b; b = t; } return a + b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/abs.c ================================================ foo (a) { return __builtin_abs (a); } main () { printf ("%d %d\n", foo (0x80000000), foo (12)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/ac.c ================================================ barfoo (a) { return (a << 16) & ~0xffff; } foobar (a) { return ((unsigned short) a) << 15;} foo (a) { return (a & 0x121) << 31; } bar (a) { return (a & ~0xffff) << 16; } main () { int a; for (a = 1; a; a += a) { printf ("%d", (foo (a))); } puts (""); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/acc.c ================================================ foo (a) { int b = a + 1; int c = (short) a; if (b) return b; return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/acc1.c ================================================ /* { dg-options "-ffast-math" } */ /* Fast maths allows tail recursion to be turned into iteration. */ double foo (int n, double f) { if (n == 0) return f; else return f + foo (n - 1, f); } double bar (int n, double f) { if (n == 0) return f; else return f * bar (n - 1, f); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/add.c ================================================ foo (a, b, p) int *p; { return 34 + *p; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/add386.c ================================================ main (a) { return a + 128; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/addcc.c ================================================ foo (p, a, b) int *p; int a; int b; { a += p[0]; b += p[1]; if (a == 0) return b; return a; } bar (a) { return -a > 0 ? 1 : 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/andm.c ================================================ foo (p) int *p; { return (*p & 255) == 0; } bar (a) { return (a & 0xfff00000) == 0; } main () { printf ("%d%d\n", bar (-1), bar(0)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/andmem.c ================================================ void p1 (p) int *p; { *p &= ~0xff; } void p2 (p) int *p; { *p &= ~0xff00; } void p3 (p) int *p; { *p &= ~0xffff0000; } void p4 (p) int *p; { *p &= ~0xffff; } main () { int a; a = 0x12345678; p1 (&a); printf ("%x\n", a); a = 0x12345678; p2 (&a); printf ("%x\n", a); a = 0x12345678; p3 (&a); printf ("%x\n", a); a = 0x12345678; p4 (&a); printf ("%x\n", a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/andn.c ================================================ foo (a) { int b = 0x1fff; return a & ~b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/andok.c ================================================ foo (a, b, p) int *p; { p[1] = a & 0xfff0000; p[2] = b & 0xfff0000; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/andsi.c ================================================ foo () { return (int)&foo; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/andsparc.c ================================================ foo (int *p) { int a, b; a = 123456; a += p[0]; b = p[0]; if (a == 0) return b; return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/aos.c ================================================ foo (p) int *p; { if ((int) p > 0) return 1; else return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/arr.c ================================================ foo (a, b, c) { bar (a, b); { int arr[10]; arr[c] = b; bar (arr[0], arr[1]); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/as.c ================================================ #define S 31 #define A 17 foo (a) unsigned a; { return (a >> S) & ((1 << A) - 1); } main () { printf ("%d%d\n", foo (-1), foo (0)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/ase.c ================================================ ase (p) short *p; { int a; a = p[1]; p[2] = a; if ((short) a) p[a]++; return (a == 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/asmgoto-1.c ================================================ void fn (void); void foo (void *x, unsigned long y) { asm goto ("": : : : lab); lab: fn (); } static void bar (unsigned long x) { foo (0, x); } static void baz (unsigned long x) { if (x > 8192) bar (x); else ({ __here: (unsigned long) &&__here; }); } void test (void) { baz (16384); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/b.c ================================================ main () { *(short *) 25 = 123; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/b1.c ================================================ foo (long long x) { if (x--) return 255; return 0; } main () { printf ("%d\n", foo (0)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/b2.c ================================================ struct s { unsigned a : 8; unsigned b : 8; unsigned c : 8; unsigned d : 8; }; /* struct { unsigned a : 8; unsigned b : 16; unsigned c : 8; }; */ struct s foo (struct s s, int i) { s.b = i; return s; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/b3.c ================================================ struct tree_common { unsigned int code : 9; unsigned int code2 : 7; }; static int duplicate_decls (x) register struct tree_common x; { return x.code2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/b88.c ================================================ foo (double d) { d = -d; if (d < 0.0) return 1; return 2; } main () { foo (0.0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bad.c ================================================ typedef union longlong { struct {unsigned short h0, h1, h2, h3;} h; struct {signed long low, high;} si; struct {unsigned long low, high;} ui; signed long long sll; unsigned long long ull; } long_long; long long __negdi2 (u) long long u; { long_long uu; uu.sll = u; uu.si.low = -uu.si.low; if (uu.si.low == 0) uu.si.high = -uu.si.high; else uu.si.high = ~uu.si.high; return uu.sll; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/band.c ================================================ foo (a) { return (a & (1 << 31)) != 0; } main () { if (foo (0)) puts ("foo"); else puts ("bar"); if (foo (~0)) puts ("foo"); else puts ("bar"); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bb0.c ================================================ foo (a) { return (a & 0xfff000) != 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bb1.c ================================================ foo (a) { int b = 32; if (b & a) return 1; else return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bbb.c ================================================ struct looksets { int lset[10]; }; struct looksets lkst[]; flset( p ) struct looksets *p; { p-- > lkst; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bc.c ================================================ foo (a, b) { return a % (1 << b); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bcopy-1.c ================================================ /* PR middle-end/31095, expand_builtin_memmove_args forgot to take into account that tree folding of builtins can add an extra NOP_EXPR. */ struct timeval { int tv_sec; int tv_usec; }; void capture_next_packet (void) { struct timeval past, now, then; __builtin_bcopy (&then, &past, sizeof (then)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bcopy.c ================================================ void bcopy1 (s, d, c) long long *s; long long *d; int c; { int i; c = c / 8; for (i = 0; i < c; i++) d[i] = s[i]; } void bcopy2 (s, d, c) long *s; long *d; int c; { int i; c = c / 4; for (i = 0; i < c; i++) d[i] = s[i]; } void bcopy3 (s, d, c) char *s; char *d; int c; { long long z0, z1; int r = d - s; int i; c /= 16; z0 = *((long long *) s); s += 8; z1 = *((long long *) s); s += 8; for (i = 0; i < c; i++) { *(long long *)(s + r) = z0; z0 = *((long long *) s); s += 8; *(long long *)(s + r) = z1; z1 = *((long long *) s); s += 8; } } #if defined(STACK_SIZE) && STACK_SIZE < 16384 #define BYTES STACK_SIZE #else #define BYTES 16384 #endif main () { long long s[BYTES / 8]; long long d[BYTES / 8]; int i; for (i = 1; i < 67108864 / BYTES; i++) bcopy (s, d, BYTES); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bf.c ================================================ typedef unsigned long uint32; typedef signed long sint32; uint32 ext (sint32 src, unsigned o5, unsigned w5) { return (w5 == 0) ? src >> o5 : (src << (( - o5 - w5) & 31)) >> (32 - w5); } uint32 extu (uint32 src, unsigned o5, unsigned w5) { return (w5 == 0) ? src >> o5 : (src << (( - o5 - w5) & 31)) >> (32 - w5); } uint32 mak (uint32 src, unsigned o5, unsigned w5) { return (w5 == 0) ? src << o5 : (src << (32 - w5)) >> (( - o5 - w5) & 31); } uint32 rot (uint32 src, unsigned o5) { return (src >> o5) | (src << (( - o5) & 31)); } main (int argc, char **argv) { printf ("%x\n", clr (0xffffffff, atoi (argv[2]), atoi (argv[1]))); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bfins.c ================================================ struct foo { unsigned j : 16; unsigned i : 16; }; struct foo foo (a, b) struct foo a; int b; { a.j = 123; a.i = b; return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bfx.c ================================================ foo (x, c) { return x << -c; } main () { printf ("%x\n", foo (0xf05, -4)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bge.c ================================================ foo (a) double a; { if (a >= 0) return 1; return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bit.c ================================================ bar (a) { return (a == 0); } foo (a) int a; { if ((a & (1 << 26)) >= 0) return 1; else return 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bitf.c ================================================ #define int unsigned struct foo { int aa : 1; int a : 9; int c : 16; int d : 6; }; int foo (a, b) struct foo a; { return a.d == 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bitw.c ================================================ foo (a) unsigned a; { unsigned b = 0; if ((a & 12345678) > b) return 1; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/blk.c ================================================ struct { double a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t; } foo, bar; foobar () { foo = bar; xxx (&foo, &bar); } main () { bar.g = 1.0; foo.g = 2.0; foobar (); printf ("%lf\n", foo.g); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bt.c ================================================ main () { int i; for (i = 1000000; --i;) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bt386.c ================================================ foo (a, b) { return (a & (1 << b)) != 0; } bar (a, b) { a ^= (1 << b); return a != 0; } main () { int i; for (i = 0; i < 32; i++) printf ("%d ", foo (0x8000000f, i)); puts (""); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bug.c ================================================ foo (a, b) { return a - 65536; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bugc.c ================================================ int reg0indreg1 (r0, p1) short r0; short *p1; { return (r0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/builtin_constant_p.c ================================================ int main (int argc, char *argv[]) { static int a[] = { __builtin_constant_p (argc) ? 1 : 0 }; return a[0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/builtin_unreachable-1.c ================================================ void bar (const char *); void foo (void) { bar ("foo"); __builtin_unreachable (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/buns.c ================================================ foo (a) { int bar = 0; return (unsigned) (a - 1) <= (unsigned) bar; } main () { if (foo (-1)) puts ("The largest possible unsigned <= 0 on this machine..."); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/bx.c ================================================ unsigned good (unsigned src, unsigned o5, unsigned w5) { return src & ~((w5 == 0) ? (~0 << o5) : (1 << o5)); } unsigned bad (unsigned src, unsigned o5, unsigned w5) { return src & ((w5 == 0) ? ~(~0 << o5) : ~(1 << o5)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/c.c ================================================ foo (a, b) long long a, b; { if (a & ~b) return 1; else return 0; } bar (a, b) long long a, b; { if (a & ~b & ((long long) 87612378)) return 1; else return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/c1.c ================================================ unsigned rec (a, b) unsigned a; unsigned b; { return a * rec (a - 1, b + 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/c2.c ================================================ foo (a) { bar (a); bar (a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/call.c ================================================ /* { dg-skip-if "requires untyped assembly" { ! untyped_assembly } { "-O0" } { "" } } */ int foo () {} main (a, b) { foo (foo (a, b), foo (b, a)); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/call386.c ================================================ void foo () {} int main () { int i; for (i = 100000; i >= 0; i--) { foo (); foo (); foo (); foo (); foo (); foo (); foo (); foo (); foo (); foo (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/callind.c ================================================ bar (foo, a) int (**foo) (); { (foo)[1] = bar; foo[a] (1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/calls-void.c ================================================ /* { dg-require-effective-target ptr32plus } */ /* { dg-require-effective-target untyped_assembly } */ typedef void (*T)(void); f1 () { ((T) 0)(); } f2 () { ((T) 1000)(); } f3 () { ((T) 10000000)(); } f4 (r) { ((T) r)(); } f5 () { int (*r)() = f3; ((T) r)(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/calls.c ================================================ /* { dg-require-effective-target ptr32plus } */ /* { dg-require-effective-target untyped_assembly } */ typedef void *(*T)(void); f1 () { ((T) 0)(); } f2 () { ((T) 1000)(); } f3 () { ((T) 10000000)(); } f4 (r) { ((T) r)(); } f5 () { int (*r)() = f3; ((T) r)(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/cc.c ================================================ cc8 (a, b) { if (a < 0) goto L1; if (a == 0) goto L2; L1:b++; L2:b++; return b; } cc7 (a) long long a; { if (a < 0) return 1; else return 0; } cc6 (float a, double p) { p = a; if (p < 0) return p; else return p + 1; } cc5 (p, a) char *p; char a; { p[2] = a; if (a) return 0; else return 1; } cc4 (a, b, p) int a, b; int *p; { a = (int short)b; *p = a; if ((int) a < 0) return 0; else return 1; } cc1 (a, b) { int x = 0; if ((int) a < (int) b) { if ((unsigned) a < (unsigned) b) x++; x++; } return x; } cc2 (a, b) { int x = 0; if ((int) a <= (int) b) { if ((int) a < (int) b) x++; x++; } return x; } cc3 (a, b) { int x = 0; a += b; if ((unsigned) a > 0) { if (a == 0) x++; x++; } return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/charmtst.c ================================================ c_move_tst (char b) { char a; a = b; b = 'b'; foo (a); foo (b); foo (a); bar (a, b); b = a; if (b == 0) a++; return a + b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/cmb.c ================================================ foo (p1, p2) short p1, *p2; { int a; return (int) p1 + (int) *p2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/cmp.c ================================================ struct fooalign {char x; double d;}; union fooround {long x; double d;}; int foo () { int extra = 4; if (extra < sizeof (union fooround)) extra = sizeof (union fooround); return extra; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/cmpdi-1.c ================================================ f (long long d) { int i = 0; if (d == 1) i = 1; return i; } g (long long d) { int i = 0; if (d <= 0) i = 1; return i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/cmphi.c ================================================ foo (short *p, short a) { return a < *p; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/cmpsi386.c ================================================ /* { dg-require-effective-target untyped_assembly } */ foo (a, p) register int a; int *p; { for (a = 10000000; a >= *p; a--) ; } main () { int a; foo (a, a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/cmul.c ================================================ foo (a) { return a * 84; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/cn1.c ================================================ int foo () { return 7561; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/comb.c ================================================ foo (a, b) { int c = a & b; if ((a & b) == 0) return 0; return c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/combine-hang.c ================================================ typedef union { double value; struct { unsigned long msw; unsigned long lsw; } parts; } ieee_double_shape_type; double f (int iy) { double z, t; ieee_double_shape_type u, v; if (iy == 1) return 0; u.parts.msw = iy; u.parts.lsw = 0; z = u.value; v.parts.msw = iy; v.parts.lsw = 0; t = v.value; return 1.0+z+t+t; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/compile.exp ================================================ # Expect driver script for GCC Regression Tests # Copyright (C) 1993-2016 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GCC; see the file COPYING3. If not see # . # These tests come from Torbjorn Granlund's (tege@cygnus.com) # C torture test suite, and other contributors. # Load support procs. load_lib gcc-dg.exp # Initialize `dg'. dg-init # Main loop. set saved-dg-do-what-default ${dg-do-what-default} set dg-do-what-default "assemble" gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" "-w" set dg-do-what-default ${saved-dg-do-what-default} # All done. dg-finish ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/complex-1.c ================================================ extern void u (int, int); extern void v (float, float); void f (__complex__ int x) { u (0, x); } void g (__complex__ float x) { v (0, x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/complex-2.c ================================================ /* PR 22103 */ _Complex float f(void); void *a; _Complex float g(void) { _Complex float x = f(); __imag__ x = 1.0; if (__imag__ x != 1.0) { a = &x; } return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/complex-3.c ================================================ /* PR 22116 */ void g(_Complex float); _Complex float f(int data, _Complex float x, _Complex float y) { _Complex float i, t; if (data) { i = x + __imag__ y; g(i); } else i = 5; t = x + __imag__ y; g(t); return t * i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/complex-4.c ================================================ /* This used to ICE because gimplify_modify_expr_complex_part was not updated for the GIMPLE_MODIFY_EXPR changes in that calling tree_to_gimple_tuple was needed. */ void f(void) { double _Complex Res; __real__ Res = __imag__ Res = 0.0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/complex-5.c ================================================ int foo(__complex__ int z0, __complex__ int z1) { return z0 != 0 || z1 != 0; } int foo1(__complex__ int z0, __complex__ int z1) { return z0 == 0 && z1 == 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/complex-6.c ================================================ /* PR tree-opt/35737 */ /* { dg-require-effective-target indirect_jumps } */ long buf[10]; int foo() { __complex__ int i = 0; if (__builtin_setjmp(buf)) { i = 1; bar(); } return i == 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/compound-literal-1.c ================================================ /* ICE incrementing compound literal: bug 28418 from Volker Reichelt . */ struct A { int i; }; void foo() { ((struct A) { 0 }).i += 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/compound-literal-2.c ================================================ /* PR C/30265, invalid gimple was produced because we did not mark the compound literal's decl early enough. */ int f(float *); int g(float x) { return f(&(float){x}) + f(&x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/compound-literal-3.c ================================================ /* PR C/30265, invalid gimple was produced because we did not mark the compound literal's decl early enough. */ int f(_Complex float *); int g(_Complex float x) { return f(&(_Complex float){x+1}) + f(&x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/consec.c ================================================ /* { dg-require-effective-target untyped_assembly } */ int glob; conseq (a, b, c, d) int *a, *b; { a[2] = d; a[1] = c; sequence (a, b, c, d); sequence (d, c, b, a); b[0] = 0; b[1] = 123; a[0] = 321; a[1] = 0; sequence (111, 0, 0, 222, 0, 333); ((int *)glob)[2] = c; ((int *)glob)[3] = d; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/const-high-part.c ================================================ /* { dg-require-effective-target int32plus } */ /* { dg-require-effective-target size32plus } */ char *buf; int buflen; inline int sub (int length) { if (length <= buflen) buf[length] = '\0'; return 0; } int sub2 (void) { return sub (0x7fffffff); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/const.c ================================================ main (a) { return a + (~0 - 240); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/conv.c ================================================ double u2d (unsigned int u) { return u; } double i2d (signed int i) { return i; } unsigned int d2u (double d) { return d; } signed int d2i (double d) { return d; } main () { printf ("%lf, %lf, %lf\n", u2d (~0), u2d (1 << 31), u2d (1)); printf ("%lf, %lf, %lf\n", i2d (~0), i2d (1 << 31), i2d (1)); printf ("%u, %u, %u\n", d2u (u2d (~0)), d2u (u2d (1 << 31)), d2u (u2d (1))); printf ("%d, %d, %d\n", d2i (i2d (~0)), d2i (i2d (1 << 31)), d2i (i2d (1))); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/conv_tst.c ================================================ /* { dg-require-effective-target untyped_assembly } */ #define ID_1 2400000000.0 #define ID_2 1.7 #define ID_3 -1.7 unsigned ui; int si; conv_i1 () { /* ui = (unsigned) ID_1; si = (int) ID_1; */ } conv_i2 () { ui = (unsigned) ID_2; si = (int) ID_2; } conv_i3 () { /* ui = (unsigned) ID_3;*/ si = (int) ID_3; } conv_1 (d) double d; { ui = (unsigned) d; /* si = (int) d; */ } double foo (u) unsigned u; { return u; } main () { printf ("%lf\n", foo (2400000000)); conv_i1 (); printf ("%lf, %u, %d\n", ID_1, ui, si); conv_i2 (); printf ("%lf, %u, %d\n", ID_2, ui, si); conv_i3 (); printf ("%lf, %u, %d\n", ID_3, ui, si); conv_1 (ID_1); printf ("%lf, %u, %d\n", ID_1, ui, si); conv_1 (ID_2); printf ("%lf, %u, %d\n", ID_2, ui, si); conv_1 (ID_3); printf ("%lf, %u, %d\n", ID_3, ui, si); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/cp.c ================================================ struct _obstack_chunk { char *limit; struct _obstack_chunk *prev; char contents[4]; }; struct obstack { long chunk_size; struct _obstack_chunk* chunk; char *object_base; char *next_free; char *chunk_limit; int temp; int alignment_mask; struct _obstack_chunk *(*chunkfun) (); void (*freefun) (); }; struct fooalign {char x; double d;}; union fooround {long x; double d;}; void _obstack_begin (h, size, alignment, chunkfun, freefun) struct obstack *h; int size; int alignment; void * (*chunkfun) (); void (*freefun) (); { register struct _obstack_chunk* chunk; if (alignment == 0) alignment = ((char *)&((struct fooalign *) 0)->d - (char *)0); if (size == 0) { int extra = 4; if (extra < (sizeof (union fooround))) extra = (sizeof (union fooround)); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/cpp-1.c ================================================ /* Copyright (C) 2000 Free Software Foundation. by Alexandre Oliva */ #define foo/**/1 #if foo != 1 # error "foo not properly defined" #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/cpp-2.c ================================================ /* Copyright (C) 2000 Free Software Foundation. by Alexandre Oliva */ #pragma /* the token after #pragma is optional. */ ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/csebug.c ================================================ int reg0indreg1 (r0, p1) short r0; short *p1; { return (r0 + *p1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/cvt.c ================================================ foo (p) unsigned char *p; { unsigned char a = 0; if (*p > 0) return 1; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/d.c ================================================ long long unsigned str2llu (str) char *str; { long long unsigned acc; long long b = 10; char d; acc = *str++ - '0'; for (;;) { d = *str++; if (d == '\0') break; d -= '0'; acc = acc * 10 + d; } return acc; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/dbl_parm.c ================================================ foo (a, b, c) double a; int b; double c; { if (b) return a + c; else return a - c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/dblbug.c ================================================ union real_extract { double d; int i[sizeof (double ) / sizeof (int)]; }; typedef struct { int zzzz; } *rtx; rtx immed_real_const_1 (d) double d; { union real_extract u; register rtx r; u.d = d; foo (&(r->zzzz), &u); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/ddd.c ================================================ int foo; int bar; main () { return foo + bar; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/dead.c ================================================ foo (a) { ++a; return a == 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/debugvlafunction-1.c ================================================ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ extern void dynreplace_trampoline(void); extern void dynreplace_trampoline_endlabel(void); int dynreplace_add_trampoline(void) { unsigned long trampoline_code[(((unsigned long) (&(dynreplace_trampoline_endlabel)) -(unsigned long) (&dynreplace_trampoline))) ]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/delay.c ================================================ foo (a, b) { if (a == 1) goto foo1; if (a == 2) goto foo2; foo1: return 2; foo2: return 3; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/di.c ================================================ long long foo (a, b) long long a, b; { return a * b; } main () { int a = foo ((long long) 2, (long long) 3); printf ("%d\n", a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/dic.c ================================================ unsigned long long main () { return (unsigned long long) 7816234 << 671111; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/dilayout.c ================================================ struct ii { int a; int b; }; struct foo { int a; struct ii ab; int b; }; struct ii foo (int *p, struct foo a) { p[0] = a.a; p[1] = a.ab.a; p[2] = a.ab.b; p[3] = a.b; return a.ab; } str (struct ii ab, struct ii *p) { *p = ab; } ll (long long ab, long long *p) { *p = ab; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/dimove.c ================================================ foo (long long *p) { p[0] = p[1]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/dimul.c ================================================ long long foo (a, b) long long a, b; { return a * b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/div.c ================================================ foo (a, b) { return a / b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/divdf.c ================================================ double foo (float a, float b) { return (double)a / (double)b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/dll.c ================================================ /* { dg-require-dll "" } */ __declspec (dllimport) int foo; extern int (* import) (void) __attribute__((dllimport)); int func2 (void) __attribute__((dllexport)); __declspec(dllexport) int func1 (int a) { return a + foo; } static int internal (void) { return 77; } int func2 (void) { return import (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/dm.c ================================================ struct dm { unsigned q; unsigned r; }; struct dm dm (a, b) unsigned a, b; { struct dm qr; qr.q = a / b; qr.r = a % b; return qr; } main () { struct dm qr; qr = dm (100, 30); printf ("%u, %u\n", qr.q, qr.r); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/dshift.c ================================================ foo (b, c) unsigned b, c; { return (b << 12) | (c >> 20); } main () { printf ("0x%x\n", foo (0x11223344, 0xaabbccdd)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/e.c ================================================ foo (short a, int *p, short *s) { int i; for (i = 10; i >= 0; i--) { a = (short) bar (); p[i] = a; s[i] = a; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/ex.c ================================================ /* { dg-require-effective-target untyped_assembly } */ foo (a, b) { if ((a & (1 << b)) == 0) return 1; return 0; } main () { printf ("%d\n", foo ()); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/ext.c ================================================ /* The bit-field below would have a problem if __INT_MAX__ is too small. */ #if __INT_MAX__ < 2147483647 int main (void) { exit (0); } #else struct foo { unsigned b31 : 1; unsigned b30 : 1; unsigned b29 : 1; unsigned b28 : 1; unsigned rest : 28; }; foo(a) struct foo a; { return a.b30; } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/f1.c ================================================ double foo () { return 1.2587624368724; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/f2.c ================================================ foo (double *p) { p[0] = p[1]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/fdmul.c ================================================ double foo (float a, float b) { return (double) a * (double) b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/fix-trunc-mem-1.c ================================================ /* PR target/14201 */ /* Excercise float -> integer in memory patterns. */ /* { dg-add-options ieee } */ void f1 (float v, int *p) { *p = v; } void f2 (float v, unsigned int*p) { *p = v; } void f3 (float v, long long *p) { *p = v; } void f4 (float v, unsigned long long *p) { *p = v; } void f5 (double v, int *p) { *p = v; } void f6 (double v, unsigned int *p) { *p = v; } void f7 (double v, long long *p) { *p = v; } void f8 (double v, unsigned long long *p) { *p = v; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/flo.c ================================================ foo (a) double a; { double b = 0.0; return (a == 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/float.c ================================================ double foo (a, b, c) double a, b, c; { return a * b + c * a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/flt_const.c ================================================ double foo () { return 3.141592653589793238462643; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/fnul.c ================================================ main () { int i; int f; for (i = 0;; i--) { f = 0; if ((i & (i - 1)) == 0) { printf ("d"); f = 1; } if ((i & -i) == i) { printf ("t"); f = 1; } if (f) printf ("%d\n", i); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/foo.c ================================================ int * main (s1, s2) int *s1; int *s2; { while ((*s1++ = *s2++) != '\0') ; return s1 - 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/forgetcc.c ================================================ foo (hp, p, a) short *hp; int *p; int a; { hp[10] = a; p[0] = 10; if (hp[10] > 0) return 1; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/fq.c ================================================ expand_to_ascii (int *i, int *o) { unsigned x, y, out; unsigned x1; /* Big endian code. */ x = *i++; y = x >> (32 - 13); out = (y / 91); out = (out << 8) | (y % 91); x <<= 13; y = x >> (32 - 13); out = (out << 8) | (y / 91); out = (out << 8) | (y % 91); *o++ = out + 0x20202020; /* 6 bits left in x. */ x1 = *i++; x = (x << 26) | (x1 >> 6); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/funcptr-1.c ================================================ extern int (*gp)(const char*); int g (const char* d) { printf ("g"); return 0; } f () { int errcnt=0; if (gp != g) { printf ("f"); errcnt++; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/g.c ================================================ foo (a, b) long long a, b; { if (a == b) return 0; else return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/gen_tst.c ================================================ /* Compiler Test Generator Program. Copyright (C) 1989 FSF. */ #define E0 ((type *)10000000) #define reg0 r0 #define indreg0 (*p0) #define imm0 22 #define limm0 ((type)(int)&glob0) #define adr0 (*E0) #define adrreg0 (p0[10000000]) #define adrx0 (E0[x0]) #define regx0 (p0[x0]) #define E1 ((type *)11111111) #define reg1 r1 #define indreg1 (*p1) #define imm1 33 #define limm1 ((type)(int)&glob1) #define adr1 (*E1) #define adrreg1 (p1[1111111/4]) #define adrx1 (E1[x1]) #define regx1 (p1[x1]) int glob0, glob1; #define type double char *a0[] = {"reg0", "indreg0", "imm0", "limm0", "adr0", "adrreg0", "adrx0", "regx0"}; char *a1[] = {"reg1", "indreg1", "imm1", "limm1", "adr1", "adrreg1", "adrx1", "regx1"}; main_compare () { int i0, i1; for (i0 = 0; i0 < 8; i0++) { for (i1 = 0; i1 < 8; i1++) { printf ("%s%s_cmp (r0, r1, x0, x1, p0, p1)\n", a0[i0], a1[i1]); printf ("type r0, r1; type *p0, *p1;\n"); printf ("{if (%s <= %s) return 1; else return 0;}\n\n", a0[i0], a1[i1], a0[i0]); } } } main_assign () { int i0, i1; for (i0 = 0; i0 < 8; i0++) { if (i0 < 2 || i0 > 3) for (i1 = 0; i1 < 8; i1++) { printf ("%s%s_set (r0, r1, x0, x1, p0, p1)\n", a0[i0], a1[i1]); printf ("type r0, r1; type *p0, *p1;\n"); printf ("{%s = %s; }\n\n", a0[i0], a1[i1]); } } } main () {main_assign ();} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/glob.c ================================================ typedef int tt; tt a1; tt a2; tt a3; foo () { a1++; a2++; a1++; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/goto-1.c ================================================ f () { do { if (0) { L1:; } else goto L2; L2:; } while (0); goto L1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/gronk.c ================================================ test_opt (a, b) unsigned a, b; { a = a / b; if (a == 0) a++; return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/hi.c ================================================ foo (a, b) short a, b; { return a < b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/hibug.c ================================================ struct foo { short d; int a; }; int bar (d, u) short d; struct foo u; { u.d = d; return (int) (&u); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/i++.c ================================================ int main () { int i = 2; i = i++; printf ("%d\n",i); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/i.c ================================================ ase (p) short *p; { int a; a = *p; *p = a + 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/ic.c ================================================ foo (int *ip, int a) { a++; if (a < ip[a]) return 1; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/icfmatch.c ================================================ typedef char __attribute__ ((vector_size (4))) v4qi; void retv (int a,int b,int c,int d, v4qi *ret) { v4qi v = { a, b , c, d }; *ret = v; } void retv2 (int a,int b,int c,int d, v4qi *ret) { v4qi v = { a, b , c, d }; *ret = v; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/icmp.c ================================================ foo (a, b) { b++; if (a <= b) if ((int) a < (int) b) b--; else b++; return b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/ifreg.c ================================================ union foo { float f; int i; }; foo (int a, float c) { union foo b; b.i = a; return b.f + c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/iftrap-1.c ================================================ /* Verify that ifcvt doesn't crash under a number of interesting conditions. */ void f1(int p) { if (p) __builtin_trap(); } void f2(int p) { if (p) __builtin_trap(); else bar(); } void f3(int p) { if (p) bar(); else __builtin_trap(); } void f4(int p, int q) { if (p) { bar(); if (q) bar(); } else __builtin_trap(); } void f5(int p) { if (p) __builtin_trap(); else abort(); } void f6(int p) { if (p) abort(); else __builtin_trap(); } void f7(int p) { if (p) __builtin_trap(); else __builtin_trap(); } void f8(int p) { if (p) __builtin_trap(); else { bar(); __builtin_trap(); } } void f9(int p) { if (p) { bar(); __builtin_trap(); } else __builtin_trap(); } void f10(int p) { if (p) __builtin_trap(); while (1) bar(); } void f11(int p) { if (p) __builtin_trap(); else bar(); while (1) baz(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/iftrap-2.c ================================================ void foo(int p, int q) { if (p) { if (q) __builtin_trap (); } else bar(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/iftrap-3.c ================================================ /* Check that the conditional_trap pattern handles floating-point comparisons correctly. */ void f1 (float x, float y) { if (x == y) __builtin_trap (); } void f2 (double x, double y) { if (x == y) __builtin_trap (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/imm.c ================================================ int imm () { return 11234; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/init-1.c ================================================ typedef struct { char *key; char *value; } T1; typedef struct { long type; char *value; } T3; T1 a[] = { { "", ((char *)&((T3) {1, (char *) 1})) } }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/init-2.c ================================================ struct { int e1, e2; } v = { e2: 0 }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/init-3.c ================================================ struct empty { }; struct something { int spacer; struct empty foo; int bar; }; struct something X = { foo: { }, bar: 1, }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/inline-1.c ================================================ typedef __builtin_va_list va_list; extern void foo (va_list); static void build_message_string (const char *msg, ...) { va_list ap; __builtin_va_start (ap, msg); foo (ap); __builtin_va_end (ap); } void file_name_as_prefix (f) const char *f; { build_message_string ("%s: ", f); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/isinf.c ================================================ int isinf () { return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/jmp.c ================================================ foo (a) { if (a) goto a1; goto a2; a1: goto a3; a2: goto a4; a3: goto a5; a4: goto a6; a5: goto a7; a6: goto a8; a7: goto a9; a8: goto a10; a9: goto a11; a10: goto a12; a11: goto a13; a12:; a13:; return -a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/jumptab.c ================================================ jumptab (a) { int b; switch (a) { case 0: b = 6;break; case 1: b = 5;break; case 2: b = 4;break; case 3: b = 3;break; case 4: b = 2;break; case 5: b = 1;break; } return b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/l.c ================================================ main (a) { return - 256 + a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/labels-1.c ================================================ #ifndef NO_LABEL_VALUES f () { void *x = &&L2; if (&&L3 - &&L1 > 1) abort(); L1: return 1; L2: abort (); L3:; } #else int x; #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/labels-2.c ================================================ /* { dg-require-effective-target label_values } */ struct bp { void *v, *b, *e; }; f () { struct bp x = { &&L2 }; if (&&L3 - &&L1 > 1) abort (); L1:return 1; L2:abort (); L3:; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/labels-3.c ================================================ /* Verify that we can narrow the storage associated with label diffs. */ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ int foo (int a) { static const short ar[] = { &&l1 - &&l1, &&l2 - &&l1 }; void *p = &&l1 + ar[a]; goto *p; l1: return 1; l2: return 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/layout.c ================================================ struct foo { char a; }; foo () { struct foo bar[3]; bar[0].a = '0'; bar[1].a = '1'; bar[2].a = '2'; foof (bar); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/lbug.c ================================================ long long x = 0; main() { if (x--) return 255; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/libcall-1.c ================================================ /* Failed on ARM because rtx_varies_p didn't like the REG_EQUAL notes generated for libcalls. http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01518.html */ static const char digs[] = "0123456789ABCDEF"; int __attribute__((pure)) bar(); int foo (int i) { int len; if (i) return 0; len = bar(); return digs[len]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-blockid.c ================================================ #define LIM1(x) x##0; x##1; x##2; x##3; x##4; x##5; x##6; x##7; x##8; x##9; #define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9) #define LIM3(x) LIM2(x##0) LIM2(x##1) LIM2(x##2) LIM2(x##3) LIM2(x##4) \ LIM2(x##5) LIM2(x##6) LIM2(x##7) LIM2(x##8) LIM2(x##9) #define LIM4(x) LIM3(x##0) LIM3(x##1) LIM3(x##2) LIM3(x##3) LIM3(x##4) \ LIM3(x##5) LIM3(x##6) LIM3(x##7) LIM3(x##8) LIM3(x##9) #define LIM5(x) LIM4(x##0) LIM4(x##1) LIM4(x##2) LIM4(x##3) LIM4(x##4) \ LIM4(x##5) LIM4(x##6) LIM4(x##7) LIM4(x##8) LIM4(x##9) #define LIM6(x) LIM5(x##0) LIM5(x##1) LIM5(x##2) LIM5(x##3) LIM5(x##4) \ LIM5(x##5) LIM5(x##6) LIM5(x##7) LIM5(x##8) LIM5(x##9) #define LIM7(x) LIM6(x##0) LIM6(x##1) LIM6(x##2) LIM6(x##3) LIM6(x##4) \ LIM6(x##5) LIM6(x##6) LIM6(x##7) LIM6(x##8) LIM6(x##9) void q9_func(void) { #if __INT_MAX__ >= 100000 LIM5(char t) #else LIM4(char t) #endif } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-caselabels.c ================================================ #define LIM1(x) x##0: x##1: x##2: x##3: x##4: x##5: x##6: x##7: x##8: x##9: #define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9) #define LIM3(x) LIM2(x##0) LIM2(x##1) LIM2(x##2) LIM2(x##3) LIM2(x##4) \ LIM2(x##5) LIM2(x##6) LIM2(x##7) LIM2(x##8) LIM2(x##9) #define LIM4(x) LIM3(x##0) LIM3(x##1) LIM3(x##2) LIM3(x##3) LIM3(x##4) \ LIM3(x##5) LIM3(x##6) LIM3(x##7) LIM3(x##8) LIM3(x##9) #define LIM5(x) LIM4(x##0) LIM4(x##1) LIM4(x##2) LIM4(x##3) LIM4(x##4) \ LIM4(x##5) LIM4(x##6) LIM4(x##7) LIM4(x##8) LIM4(x##9) #define LIM6(x) LIM5(x##0) LIM5(x##1) LIM5(x##2) LIM5(x##3) LIM5(x##4) \ LIM5(x##5) LIM5(x##6) LIM5(x##7) LIM5(x##8) LIM5(x##9) #define LIM7(x) LIM6(x##0) LIM6(x##1) LIM6(x##2) LIM6(x##3) LIM6(x##4) \ LIM6(x##5) LIM6(x##6) LIM6(x##7) LIM6(x##8) LIM6(x##9) void q19_func (long i) { switch (i) { LIM5 (case 1) break; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-declparen.c ================================================ #define PTR1 (* (* (* (* (* (* (* (* (* (* #define PTR2 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 #define PTR3 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 #define PTR4 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 #define PTR5 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 #define PTR6 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 #define RBR1 ) ) ) ) ) ) ) ) ) ) #define RBR2 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 #define RBR3 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 #define RBR4 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 #define RBR5 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 #define RBR6 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 int PTR4 q4_var RBR4 = 0; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-enumconst.c ================================================ #define LIM1(x) x##0, x##1, x##2, x##3, x##4, x##5, x##6, x##7, x##8, x##9, #define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9) #define LIM3(x) LIM2(x##0) LIM2(x##1) LIM2(x##2) LIM2(x##3) LIM2(x##4) \ LIM2(x##5) LIM2(x##6) LIM2(x##7) LIM2(x##8) LIM2(x##9) #define LIM4(x) LIM3(x##0) LIM3(x##1) LIM3(x##2) LIM3(x##3) LIM3(x##4) \ LIM3(x##5) LIM3(x##6) LIM3(x##7) LIM3(x##8) LIM3(x##9) #define LIM5(x) LIM4(x##0) LIM4(x##1) LIM4(x##2) LIM4(x##3) LIM4(x##4) \ LIM4(x##5) LIM4(x##6) LIM4(x##7) LIM4(x##8) LIM4(x##9) #define LIM6(x) LIM5(x##0) LIM5(x##1) LIM5(x##2) LIM5(x##3) LIM5(x##4) \ LIM5(x##5) LIM5(x##6) LIM5(x##7) LIM5(x##8) LIM5(x##9) #define LIM7(x) LIM6(x##0) LIM6(x##1) LIM6(x##2) LIM6(x##3) LIM6(x##4) \ LIM6(x##5) LIM6(x##6) LIM6(x##7) LIM6(x##8) LIM6(x##9) enum q21_enum { #if __INT_MAX__ >= 100000 LIM5 (e) #else LIM4 (e) #endif }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-exprparen.c ================================================ #define LBR1 ( ( ( ( ( ( ( ( ( ( #define LBR2 LBR1 LBR1 LBR1 LBR1 LBR1 LBR1 LBR1 LBR1 LBR1 LBR1 #define LBR3 LBR2 LBR2 LBR2 LBR2 LBR2 LBR2 LBR2 LBR2 LBR2 LBR2 #define LBR4 LBR3 LBR3 LBR3 LBR3 LBR3 LBR3 LBR3 LBR3 LBR3 LBR3 #define LBR5 LBR4 LBR4 LBR4 LBR4 LBR4 LBR4 LBR4 LBR4 LBR4 LBR4 #define LBR6 LBR5 LBR5 LBR5 LBR5 LBR5 LBR5 LBR5 LBR5 LBR5 LBR5 #define RBR1 ) ) ) ) ) ) ) ) ) ) #define RBR2 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 #define RBR3 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 #define RBR4 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 #define RBR5 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 #define RBR6 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 int q5_var = LBR4 0 RBR4; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-externalid.c ================================================ #define LIM1(x) x##0; x##1; x##2; x##3; x##4; x##5; x##6; x##7; x##8; x##9; #define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9) #define LIM3(x) LIM2(x##0) LIM2(x##1) LIM2(x##2) LIM2(x##3) LIM2(x##4) \ LIM2(x##5) LIM2(x##6) LIM2(x##7) LIM2(x##8) LIM2(x##9) #define LIM4(x) LIM3(x##0) LIM3(x##1) LIM3(x##2) LIM3(x##3) LIM3(x##4) \ LIM3(x##5) LIM3(x##6) LIM3(x##7) LIM3(x##8) LIM3(x##9) #define LIM5(x) LIM4(x##0) LIM4(x##1) LIM4(x##2) LIM4(x##3) LIM4(x##4) \ LIM4(x##5) LIM4(x##6) LIM4(x##7) LIM4(x##8) LIM4(x##9) #define LIM6(x) LIM5(x##0) LIM5(x##1) LIM5(x##2) LIM5(x##3) LIM5(x##4) \ LIM5(x##5) LIM5(x##6) LIM5(x##7) LIM5(x##8) LIM5(x##9) #define LIM7(x) LIM6(x##0) LIM6(x##1) LIM6(x##2) LIM6(x##3) LIM6(x##4) \ LIM6(x##5) LIM6(x##6) LIM6(x##7) LIM6(x##8) LIM6(x##9) LIM5(char t) ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-externdecl.c ================================================ /* { dg-skip-if "ptxas runs out of memory" { nvptx-*-* } { "*" } { "" } } */ /* { dg-require-effective-target int32plus } */ /* Inspired by the test case for PR middle-end/52640. */ typedef struct { char *value; } REFERENCE; /* Add a few "extern int Xxxxxx ();" declarations. */ #undef DEF #undef LIM1 #undef LIM2 #undef LIM3 #undef LIM4 #undef LIM5 #undef LIM6 #define DEF(x) extern int x () #define LIM1(x) DEF(x##0); DEF(x##1); DEF(x##2); DEF(x##3); DEF(x##4); \ DEF(x##5); DEF(x##6); DEF(x##7); DEF(x##8); DEF(x##9); #define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9) #define LIM3(x) LIM2(x##0) LIM2(x##1) LIM2(x##2) LIM2(x##3) LIM2(x##4) \ LIM2(x##5) LIM2(x##6) LIM2(x##7) LIM2(x##8) LIM2(x##9) #define LIM4(x) LIM3(x##0) LIM3(x##1) LIM3(x##2) LIM3(x##3) LIM3(x##4) \ LIM3(x##5) LIM3(x##6) LIM3(x##7) LIM3(x##8) LIM3(x##9) #define LIM5(x) LIM4(x##0) LIM4(x##1) LIM4(x##2) LIM4(x##3) LIM4(x##4) \ LIM4(x##5) LIM4(x##6) LIM4(x##7) LIM4(x##8) LIM4(x##9) #define LIM6(x) LIM5(x##0) LIM5(x##1) LIM5(x##2) LIM5(x##3) LIM5(x##4) \ LIM5(x##5) LIM5(x##6) LIM5(x##7) LIM5(x##8) LIM5(x##9) LIM5 (X); /* Add references to them, or GCC will simply ignore the extern decls. */ #undef DEF #undef LIM1 #undef LIM2 #undef LIM3 #undef LIM4 #undef LIM5 #undef LIM6 #define DEF(x) (char *) x #define LIM1(x) DEF(x##0), DEF(x##1), DEF(x##2), DEF(x##3), DEF(x##4), \ DEF(x##5), DEF(x##6), DEF(x##7), DEF(x##8), DEF(x##9), #define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9) #define LIM3(x) LIM2(x##0) LIM2(x##1) LIM2(x##2) LIM2(x##3) LIM2(x##4) \ LIM2(x##5) LIM2(x##6) LIM2(x##7) LIM2(x##8) LIM2(x##9) #define LIM4(x) LIM3(x##0) LIM3(x##1) LIM3(x##2) LIM3(x##3) LIM3(x##4) \ LIM3(x##5) LIM3(x##6) LIM3(x##7) LIM3(x##8) LIM3(x##9) #define LIM5(x) LIM4(x##0) LIM4(x##1) LIM4(x##2) LIM4(x##3) LIM4(x##4) \ LIM4(x##5) LIM4(x##6) LIM4(x##7) LIM4(x##8) LIM4(x##9) #define LIM6(x) LIM5(x##0) LIM5(x##1) LIM5(x##2) LIM5(x##3) LIM5(x##4) \ LIM5(x##5) LIM5(x##6) LIM5(x##7) LIM5(x##8) LIM5(x##9) REFERENCE references[] = { LIM5 (X) 0 }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-fnargs.c ================================================ /* { dg-timeout-factor 4.0 } */ /* { dg-require-effective-target run_expensive_tests } */ #define PAR1 int, int, int, int, int, int, int, int, int, int #define PAR2 PAR1, PAR1, PAR1, PAR1, PAR1, PAR1, PAR1, PAR1, PAR1, PAR1 #define PAR3 PAR2, PAR2, PAR2, PAR2, PAR2, PAR2, PAR2, PAR2, PAR2, PAR2 #define PAR4 PAR3, PAR3, PAR3, PAR3, PAR3, PAR3, PAR3, PAR3, PAR3, PAR3 #define PAR5 PAR4, PAR4, PAR4, PAR4, PAR4, PAR4, PAR4, PAR4, PAR4, PAR4 #define PAR6 PAR5, PAR5, PAR5, PAR5, PAR5, PAR5, PAR5, PAR5, PAR5, PAR5 extern void func (PAR4); #define ARG1 0,1,2,3,4,5,6,7,8,9 #define ARG2 ARG1, ARG1, ARG1, ARG1, ARG1, ARG1, ARG1, ARG1, ARG1, ARG1 #define ARG3 ARG2, ARG2, ARG2, ARG2, ARG2, ARG2, ARG2, ARG2, ARG2, ARG2 #define ARG4 ARG3, ARG3, ARG3, ARG3, ARG3, ARG3, ARG3, ARG3, ARG3, ARG3 #define ARG5 ARG4, ARG4, ARG4, ARG4, ARG4, ARG4, ARG4, ARG4, ARG4, ARG4 #define ARG5HALF ARG5, ARG5, ARG5, ARG5, ARG5 void caller(void) { func (ARG4); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-fndefn.c ================================================ /* { dg-skip-if "too complex for avr" { avr-*-* } { "*" } { "" } } */ /* { dg-skip-if "ptxas times out" { nvptx-*-* } { "*" } { "" } } */ /* { dg-timeout-factor 4.0 } */ #define LIM1(x) x##0, x##1, x##2, x##3, x##4, x##5, x##6, x##7, x##8, x##9, #define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9) #define LIM3(x) LIM2(x##0) LIM2(x##1) LIM2(x##2) LIM2(x##3) LIM2(x##4) \ LIM2(x##5) LIM2(x##6) LIM2(x##7) LIM2(x##8) LIM2(x##9) #define LIM4(x) LIM3(x##0) LIM3(x##1) LIM3(x##2) LIM3(x##3) LIM3(x##4) \ LIM3(x##5) LIM3(x##6) LIM3(x##7) LIM3(x##8) LIM3(x##9) #define LIM5(x) LIM4(x##0) LIM4(x##1) LIM4(x##2) LIM4(x##3) LIM4(x##4) \ LIM4(x##5) LIM4(x##6) LIM4(x##7) LIM4(x##8) LIM4(x##9) #define LIM6(x) LIM5(x##0) LIM5(x##1) LIM5(x##2) LIM5(x##3) LIM5(x##4) \ LIM5(x##5) LIM5(x##6) LIM5(x##7) LIM5(x##8) LIM5(x##9) #define LIM7(x) LIM6(x##0) LIM6(x##1) LIM6(x##2) LIM6(x##3) LIM6(x##4) \ LIM6(x##5) LIM6(x##6) LIM6(x##7) LIM6(x##8) LIM6(x##9) void func1 (LIM5(int p) int t) { } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-idexternal.c ================================================ #define LIM1 0123456789 #define LIM2 LIM1##LIM1##LIM1##LIM1##LIM1##LIM1##LIM1##LIM1##LIM1##LIM1 #define LIM3 LIM2##LIM2##LIM2##LIM2##LIM2##LIM2##LIM2##LIM2##LIM2##LIM2 #define LIM4 LIM3##LIM3##LIM3##LIM3##LIM3##LIM3##LIM3##LIM3##LIM3##LIM3 #define LIM5 LIM4##LIM4##LIM4##LIM4##LIM4##LIM4##LIM4##LIM4##LIM4##LIM4 #define LIM6 LIM5##LIM5##LIM5##LIM5##LIM5##LIM5##LIM5##LIM5##LIM5##LIM5 #define V(x) v##LIM5##x int V(a); int V(b); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-idinternal.c ================================================ #define LIM1 0123456789 #define LIM2 LIM1##LIM1##LIM1##LIM1##LIM1##LIM1##LIM1##LIM1##LIM1##LIM1 #define LIM3 LIM2##LIM2##LIM2##LIM2##LIM2##LIM2##LIM2##LIM2##LIM2##LIM2 #define LIM4 LIM3##LIM3##LIM3##LIM3##LIM3##LIM3##LIM3##LIM3##LIM3##LIM3 #define LIM5 LIM4##LIM4##LIM4##LIM4##LIM4##LIM4##LIM4##LIM4##LIM4##LIM4 #define LIM6 LIM5##LIM5##LIM5##LIM5##LIM5##LIM5##LIM5##LIM5##LIM5##LIM5 #define V(x) v##LIM6##x static int V(a); static int V(b); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-pointer.c ================================================ #define PTR1 * * * * * * * * * * #define PTR2 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 #define PTR3 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 #define PTR4 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 #define PTR5 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 #define PTR6 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 int PTR4 q3_var = 0; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-stringlit.c ================================================ /* { dg-skip-if "Array too big" { avr-*-* m32c-*-* pdp11-*-* msp430-*-* } { "*" } { "" } } */ #define STR2 "012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789" #define STR3 STR2 STR2 STR2 STR2 STR2 STR2 STR2 STR2 STR2 STR2 #define STR4 STR3 STR3 STR3 STR3 STR3 STR3 STR3 STR3 STR3 STR3 #define STR5 STR4 STR4 STR4 STR4 STR4 STR4 STR4 STR4 STR4 STR4 #define STR6 STR5 STR5 STR5 STR5 STR5 STR5 STR5 STR5 STR5 STR5 #define STR7 STR6 STR6 STR6 STR6 STR6 STR6 STR6 STR6 STR6 STR6 #define STR8 STR7 STR7 STR7 STR7 STR7 STR7 STR7 STR7 STR7 STR7 char vlv[] = STR6; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-structmem.c ================================================ #define LIM1(x) x##0; x##1; x##2; x##3; x##4; x##5; x##6; x##7; x##8; x##9; #define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9) #define LIM3(x) LIM2(x##0) LIM2(x##1) LIM2(x##2) LIM2(x##3) LIM2(x##4) \ LIM2(x##5) LIM2(x##6) LIM2(x##7) LIM2(x##8) LIM2(x##9) #define LIM4(x) LIM3(x##0) LIM3(x##1) LIM3(x##2) LIM3(x##3) LIM3(x##4) \ LIM3(x##5) LIM3(x##6) LIM3(x##7) LIM3(x##8) LIM3(x##9) #define LIM5(x) LIM4(x##0) LIM4(x##1) LIM4(x##2) LIM4(x##3) LIM4(x##4) \ LIM4(x##5) LIM4(x##6) LIM4(x##7) LIM4(x##8) LIM4(x##9) #define LIM6(x) LIM5(x##0) LIM5(x##1) LIM5(x##2) LIM5(x##3) LIM5(x##4) \ LIM5(x##5) LIM5(x##6) LIM5(x##7) LIM5(x##8) LIM5(x##9) #define LIM7(x) LIM6(x##0) LIM6(x##1) LIM6(x##2) LIM6(x##3) LIM6(x##4) \ LIM6(x##5) LIM6(x##6) LIM6(x##7) LIM6(x##8) LIM6(x##9) struct q20_struct { LIM4 (char m) }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/limits-structnest.c ================================================ #define LIM1(x) x##0 {x##1 {x##2 {x##3 {x##4 {x##5 {x##6 {x##7 {x##8 {x##9 { #define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9) #define LIM3(x) LIM2(x##0) LIM2(x##1) LIM2(x##2) LIM2(x##3) LIM2(x##4) \ LIM2(x##5) LIM2(x##6) LIM2(x##7) LIM2(x##8) LIM2(x##9) #define LIM4(x) LIM3(x##0) LIM3(x##1) LIM3(x##2) LIM3(x##3) LIM3(x##4) \ LIM3(x##5) LIM3(x##6) LIM3(x##7) LIM3(x##8) LIM3(x##9) #define LIM5(x) LIM4(x##0) LIM4(x##1) LIM4(x##2) LIM4(x##3) LIM4(x##4) \ LIM4(x##5) LIM4(x##6) LIM4(x##7) LIM4(x##8) LIM4(x##9) #define LIM6(x) LIM5(x##0) LIM5(x##1) LIM5(x##2) LIM5(x##3) LIM5(x##4) \ LIM5(x##5) LIM5(x##6) LIM5(x##7) LIM5(x##8) LIM5(x##9) #define LIM7(x) LIM6(x##0) LIM6(x##1) LIM6(x##2) LIM6(x##3) LIM6(x##4) \ LIM6(x##5) LIM6(x##6) LIM6(x##7) LIM6(x##8) LIM6(x##9) #define RBR1 } x; } x; } x; } x; } x; } x; } x; } x; } x; } x; #define RBR2 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 #define RBR3 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 #define RBR4 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 #define RBR5 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 LIM4(struct s) int x; RBR4 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/ll1.c ================================================ long long foo (long long a) { return a + ((long long) 10230101 << 32) + 7561; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/llbug.c ================================================ union foo { long long d; }; int bar (long long d) { union foo u; u.d = d; return (int) &u; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/lll.c ================================================ byte_match_count2 (buf, n, xm, m1, m2, m3, m4) unsigned *buf; unsigned n; unsigned xm; unsigned m1, m2, m3, m4; { unsigned w, cnt = 0; unsigned *bp; n /= 4; bp = buf; while (bp < buf + n) { w = *bp++; w ^= xm; cnt += ((m1 & w) == 0); cnt += ((m2 & w) == 0); cnt += ((m3 & w) == 0); cnt += ((m4 & w) == 0); w = *bp++; w ^= xm; cnt += ((m1 & w) == 0); cnt += ((m2 & w) == 0); cnt += ((m3 & w) == 0); cnt += ((m4 & w) == 0); w = *bp++; w ^= xm; cnt += ((m1 & w) == 0); cnt += ((m2 & w) == 0); cnt += ((m3 & w) == 0); cnt += ((m4 & w) == 0); w = *bp++; w ^= xm; cnt += ((m1 & w) == 0); cnt += ((m2 & w) == 0); cnt += ((m3 & w) == 0); cnt += ((m4 & w) == 0); } return cnt; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/load8.c ================================================ foo () { return *(short *) 126; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/loadhicc.c ================================================ typedef int xtype; foo (p, pc) xtype *p; char *pc; { xtype a; unsigned b = 0; a = *p; p[1] = a; if ((unsigned) p[1] > 0) return 1; return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/loop-1.c ================================================ foo (a) { while ((a -= 1) != -1) bar (270000); putchar ('\n'); } main () { foo (5); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/loop386.c ================================================ foo (a) { do { puts ("a"); a -= 1; } while (a != 0); } main () { int p[100]; printf ("%d\n", foo (3)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/lop.c ================================================ lop (a) { do a--; while (a >= -1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/m1.c ================================================ foo (p) int *p; { *p = 1234; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/m2.c ================================================ void store16 (p, a) short *p; short a; { *p = a; } signed int sign_extend16 (p) signed short *p; { return *p; } unsigned int zero_extend16 (p) unsigned short *p; { return *p; } void store8 (p, a) char *p; char a; { *p = a; } signed int sign_extend8 (p) signed char *p; { return *p; } unsigned int zero_extend8 (p) unsigned char *p; { return *p; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/m5.c ================================================ foo (a) { return a * 5 + 12; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/m68.c ================================================ foo (a) { return a | 12345; } bar (a) { return a & (0xffff0000 | 12345); } foobar (a) { return a - 128; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/m68k-byte-addr.c ================================================ /* This testcase triggered an attempt to reload a byte value into an address register. */ extern volatile unsigned char x[]; #define DECLARE(I) orig##I, inc##I #define READ(I) orig##I = x[I] #define INC(I) inc##I = orig##I + 1 #define WRITE1(I) x[I] = orig##I #define WRITE2(I) x[I] = inc##I #define REPEAT(X) X(0), X(1), X(2), X(3), X(4), X(5), X(6), X(7), X(8) void foo (void) { unsigned char REPEAT (DECLARE); REPEAT (READ); REPEAT (INC); REPEAT (WRITE1); REPEAT (WRITE2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mangle-1.c ================================================ #if __nvptx__ /* Doesn't like . in labels. */ #define SEP "$" #else #define SEP "." #endif int foo(void) { static int x asm ("x") = 3; return x++; } int X2 asm ("x" SEP "0") = 4; int X3 asm ("_x" SEP "0") = 5; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mbyte.c ================================================ foo1 (p) char *p; { p[0] = p[1]; return p[0]; } foo2 (p, x) char *p; { p[0] = x; return p[0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mchar.c ================================================ int foo (char *a, char *b) { int x; *a = *b; x = *b; if ((char) x) return 1; else return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mcmp.c ================================================ foo (ip, a, x) int a; int *ip; int x; { if (a >= 1) x++; return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mdouble.c ================================================ double foo (double a) { return 1.123486712; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/memcpy-1.c ================================================ static const char OggFLAC__MAPPING_VERSION_MAJOR = 1; void f(void) { char synthetic_first_packet_body[10]; char *b = &synthetic_first_packet_body[4]; __builtin_memcpy (b, &OggFLAC__MAPPING_VERSION_MAJOR, (1u)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/memcpy-2.c ================================================ static const char OggFLAC__MAPPING_VERSION_MAJOR = 1; void f(void) { char synthetic_first_packet_body[10]; char *b = synthetic_first_packet_body; b+=4u; __builtin_memcpy (b, &OggFLAC__MAPPING_VERSION_MAJOR, (1u)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/memtst.c ================================================ #ifdef STACK_SIZE #define SIZE STACK_SIZE / 8 #else #define SIZE 65536 #endif memtst (int *p, int a) { do { if (p[a] == 1) break; } while (--a); } main () { int a[SIZE]; int i; bzero (a, SIZE * 4); for (i = 0; i < 100; i++) { memtst (a, SIZE); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mipscop-1.c ================================================ /* { dg-do compile { target mips*-*-* } } */ register unsigned int cp0count asm ("$c0r1"); int __attribute__ ((nomips16)) main (int argc, char *argv[]) { unsigned int d; d = cp0count + 3; printf ("%d\n", d); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mipscop-2.c ================================================ /* { dg-do compile { target mips*-*-* } } */ register unsigned int c3r1 asm ("$c3r1"); extern unsigned int b, c; void __attribute__ ((nomips16)) foo () { unsigned int a, d; c3r1 = a; b = c3r1; c3r1 = c; d = c3r1; printf ("%d\n", d); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mipscop-3.c ================================================ /* { dg-do compile { target mips*-*-* } } */ register unsigned int c3r1 asm ("$c3r1"), c3r2 asm ("$c3r2"); extern unsigned int b, c; void __attribute__ ((nomips16)) foo () { unsigned int a, d; c3r1 = a; b = c3r1; c3r2 = c; d = c3r1; printf ("%d\n", d); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mipscop-4.c ================================================ /* { dg-do compile { target mips*-*-* } } */ register unsigned long c3r1 asm ("$c3r1"), c3r2 asm ("$c3r2"); extern unsigned long b, c; void __attribute__ ((nomips16)) foo () { unsigned long a, d; c3r1 = a; b = c3r1; c3r2 = c; d = c3r1; printf ("%d\n", d); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/miscomp.c ================================================ unsigned char foo(unsigned long); main() { unsigned char AChar; unsigned long ALong = 0x12345678; AChar = foo(ALong); printf("AChar = %x\n",(int)AChar); } unsigned char foo( unsigned long TheLong) { return( (unsigned char) (TheLong & 0xff) ); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mm.c ================================================ foo (a, b) { return a * 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mod.c ================================================ foo (a, b) { return a % b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/modcc.c ================================================ foo (a, b) { return (a % b) == 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/move.c ================================================ typedef char type; type foo (b) { type a; for (a = 10; a < b; a++) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/move_qhi.c ================================================ move (a, b) char a, b; { char s; s = a; if (s) gurka (s); foo (b, a); a = bar (); b = bar (); gra (s); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mregtst.c ================================================ foo (a, p) int *p; { int old, new, i; old = 0; for (i = 1; i < 100; i++) { new = p[i]; if (new < old) a++; old = new; if (old == 0) return 0; } return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/msp.c ================================================ #ifdef STACK_SIZE # define A_SIZE (STACK_SIZE/sizeof(int)) #else # define A_SIZE 16384 #endif foo () { int a[A_SIZE]; bar (a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mtst.c ================================================ foo (int *p, int c) { int a, b; a = p[0]; b = p[1]; c = p[2]; if (b == 0) goto foo1; if (b < 0) goto foo2;; return a + b + c; foo1: return 1; foo2: return 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mu.c ================================================ foo (a, b) { return a * b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mul.c ================================================ void mulqi (char *p, char a, char b) { p[0] = a/b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mword.c ================================================ int foo (a, b) int *a, *b; { int x, y; x++; *a = *b; y = *b; if ((int) x) return 1; else return y; } foo1 (p) int *p; { p[0] = p[1]; return p[0]; } foo2 (p, x) int *p; { p[0] = x; return p[0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/mword1.c ================================================ int foo (a, b) int *a, *b; { int x; *a = (*b + 1); x = *b; if ((int) x) return 1; else return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/n.c ================================================ char_autoincr (b1, c) short *b1; short c; { *b1 = c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/n1.c ================================================ foo (a, p) long long a; int *p; { int b = (int)-a; if (b > 32) return 1; else return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/nand.c ================================================ nadn (a, b) { return (~a) | (~b); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/neg.c ================================================ foo (a) {return -a;} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/nested-1.c ================================================ /* { dg-require-effective-target trampolines } */ typedef __SIZE_TYPE__ size_t; extern int printf (const char *, ...); extern void *memset (void *, int, size_t); int bar (int (*)(), int, void *); int main(int argc, char **argv) { struct s { int a; char b[argc]; }; int nested (struct s x) { return x.a + sizeof(x); } struct s t; memset (&t, 0, sizeof(t)); t.a = 123; printf("%d\n", bar (nested, argc, &t)); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/nested-2.c ================================================ /* PR 21105 */ void CheckFile () { char tagname[10]; char *a = tagname; int validate () { return (a == tagname + 4); } if (a == tagname) validate (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/o.c ================================================ foo (a, p) char a; int *p; { int b = a; *p = b; a = (char) a; if (a) return b; else return b + 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/omit.c ================================================ omit (a, b) char a; char *b; { char x; int i; x = *b; b[1] = x; foo ((int)x); return x + 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/opout.c ================================================ x () {} y () {} z (a, b) { return (int) &a + (int) &b + (int) x + (int) z; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/opt.c ================================================ int foo (a) { return (a == 2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/or.c ================================================ foo (a) { return a | 0xffff0101; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/or386.c ================================================ typedef int xtype; xtype foo (a) xtype a; { return a | 0x7f; } main () { printf ("%08x\n", foo (-1)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/p.c ================================================ foo (a, b, p) short *p; { p[0] = a; p[1] = b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/packed-1.c ================================================ struct s { int e; } x; struct rbuf { struct s *p __attribute__ ((packed)); } *b; f () { b->p = &x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/parms.c ================================================ /* { dg-require-effective-target alloca } */ #define alloca __builtin_alloca x (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, x, y) { foo (alloca (8)); return a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+x+y; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pass.c ================================================ /* { dg-require-effective-target untyped_assembly } */ int foo (a, b, c) { return a + b + c; } int bar () { int q, w, e, r, t, y; return foo ((int) & q, q, w, e, q, (int) &w); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pc44485.c ================================================ static int foo (int si1, int si2) { return si1 > 0 && si2 > 0 && si1 > -si2 || si1 < 0 && si2 < 0 && si1 < -si2 ? : si1 + si2; } struct S0 { unsigned short f1; }; int g_4; struct S0 g_54 = { 3428 }; int func_21 (int * p_22, int * const int32p_24, unsigned p_25, const int * p_26); void int324 (unsigned p_15, int * p_16, int * p_17, int * p_18) { if (foo (g_4, func_21 (p_18, &g_4, 0, 0))) { for (g_54.f1; g_54.f1; g_54.f1 += 1) { } } } int func_21 (int * p_22, int * const int32p_24, unsigned p_25, const int * p_26) { for (0; 1; p_25 += 1) lbl_29:if (p_25) goto lbl_28; lbl_28:for (p_25 = 0; p_25 < 9; p_25 += 1) if (p_25) goto lbl_29; unsigned short l_53; for (0; l_53; l_53 = foo) { } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pmt.c ================================================ long long foo (a, b) long long a, b; { return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/poor.c ================================================ typedef struct { char c[510]; } s510; typedef struct { char c[511]; } s511; s510 G510, s1; s511 G511; int I, J; double D; void main(void); void f0(double D, ...); s510 f1(double D, ...); void f2a(s510 S); void f2b(s511 S); void main(void) { f0(D, I, J); s1 = f1(D, I, D); f2a(G510); f2b(G511); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pp.c ================================================ foo (a, b, c, d, e, i0, f, i1) double a, b, c, d, e, f; int i0, i1; {} main () { foo (1.0, 2.0, 3.0, 4.0, 5.0, 1, 6.0, 2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr12517.c ================================================ /* PR tree-optimization/12517 */ int f(void); void g(int); void h(int a, int b, int c) { int i = f(); if (b && (i & 4)) g(i & 8 ? 0 : 1); if (a) { do { if (i & 8) g(0); if (i & 4) g(i ? 0 : 1); } while (--c); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr12578.c ================================================ /* PR tree-optimization/12517 */ void trivial_regexp_p(int *s, int len) { while (--len) { switch (*s++) { case '\\': switch (*s++) { case '|': ; } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr12899.c ================================================ /* PR tree-optimization/12899 */ void bb_getopt_ulflags (char *s) { for (;;) if (s[1]) do s++; while (*s); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr13066-1.c ================================================ void *g, *c; int a, b; int f() { if ((0 == a) != (b || g == c)) return 1; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr13889.c ================================================ /* PR target/13889 */ struct { long long a; } *p; void initNetFlowFunct(void) { unsigned int b = (unsigned int)-1; p->a = b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr14692.c ================================================ /* PR rtl-optimization/14692 */ void assert_failed (void); void eidecpos_1 (unsigned char *pos, long n) { int i; for (i = 0; i < n; i++) { const unsigned char *dc_ptr1 = pos; pos--; if (dc_ptr1 - pos == 1) assert_failed (); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr14730.c ================================================ /* PR middle-end/14730 */ int t (char i) { switch (i) { case 1: case 7: case 10: case 14: case 9: case 256: return 0; } return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr15245.c ================================================ /* Testcase from PR optimization/15245 This used to ICE as convert was used in tree-ssa-phiopt which created non gimple code. */ char *f(char *x, int flag) { char *ret = (char*)0; if( x > (char*)1 ) { if(x) return (char*)0; } else { if( flag & 1 ) ret = (char*)1; flag |= 2; } return ret; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr16461.c ================================================ /* PR tree-optimization/16461 */ int DVDinput_read(int); int DVDReadBlocksPath(int offset, int block_count) { int ret = 0, ret2 = 0; for (;;) { if (offset) ret = DVDinput_read(block_count); else ret2 = DVDinput_read(block_count); break; } return ret + ret2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr16566-1.c ================================================ /* ICE with flexible arrays in non-lvalue structures. Bug 16566 (comment #3). */ struct S; struct C { int i; struct S *tab[]; }; struct S { struct C c; }; void foo (struct S *x) { foo(((void)1, x->c).tab[0]); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr16566-2.c ================================================ /* ICE with flexible arrays in non-lvalue structures. Bug 16566 (comment #5). */ /* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } */ struct A { int i; int x[]; }; int foo(struct A a) { return (a,a).x[0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr16566-3.c ================================================ /* ICE with flexible arrays in non-lvalue structures. Bug 16566 (testcase from duplicate bug 16575). */ struct S; struct C { int i; struct S *tab[]; }; struct S { struct C c; }; void foo (struct S *x) { ((void)1, x->c).tab[0] = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr16808.c ================================================ /* We used to ICE as we did not mark a Vop for rename as we changed a function call to a normal modify statement while folding exp(0.0); */ double exp(double); void f0(void); void f(double); typedef struct Parser { int x; char *s; } Parser; static double pop(Parser *p) { if (p->s[0] <= 0) { f0(); return 0; } --p->x; return 0; } static void evalFactor(Parser *p) { while (p->x) f(exp(pop(p))); } static void evalTerm(Parser *p) { while (p->s[0]) evalFactor(p); } static void evalExpression(Parser *p) { evalTerm(p); while (p->s[0]) evalTerm(p); } void evalPrimary(Parser *p) { if (p->s) return; evalExpression(p); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr17119.c ================================================ void _mesa_DrawPixels (int width, int height, unsigned format, unsigned type, const void * pixels) { switch (format) { case 0x1900: func1 (); break; case 0x1907: case 0x80E0: case 0x1908: case 0x80E1: case 0x8000: func2 (); break; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr17273.c ================================================ struct A { int i; }; struct B { struct A a; }; void f(struct A*, struct A*); #define bool _Bool void bar(bool b) { struct B * D1601; struct A D1576; struct A * D1593; struct B * D1592; struct B D1575; D1575 = (struct B){}; if (b) D1592 = &D1575; else D1592 = &D1575; D1593 = &D1592->a; // <-- we are prograting &D1575 into here. D1576 = (struct A){}; f (D1593, &D1576); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr17397.c ================================================ /* ICE due to invalid GIMPLE created during strlen simplification. */ /* { dg-require-effective-target alloca } */ extern unsigned long strlen (__const char *__s); extern void bar (); extern int cols; void foo (void) { char s[cols + 2]; if (strlen (s) > 0) bar (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr17407.c ================================================ typedef struct libxml_xpathCallback { void *ns_uri; } libxml_xpathCallback; typedef libxml_xpathCallback libxml_xpathCallbackArray[]; libxml_xpathCallbackArray *libxml_xpathCallbacks; void foo1(void); void foo (void) { if ((*libxml_xpathCallbacks)[3].ns_uri != ((void *)0)) foo1(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr17408.c ================================================ /* PRs 17408 and 17409, with different options. */ extern int t; extern int t = 0; void f(){t =0;} void g(){h(&t);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr17529.c ================================================ static inline void bar (const int * const x) { __asm__ __volatile__ (""::"m" (*x)); } static const int y[1]; void foo (void) { bar (y); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr17558.c ================================================ struct xobject { char type; }; extern struct xobject *t1_Xform ( struct xobject *obj); struct xobject * t1_Xform(struct xobject *obj) { register struct font *F = (struct font *) obj; return((struct xobject*)F); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr17656.c ================================================ int sprintf (char *s, const char *format, ...); int foo(int i, int j) { char *buf, *str; if (i) str = ""; else if (j) str = ""; else return 1; /* We were propagating &""[0] here and not calling fold_stmt with a proper statement pointer. */ sprintf(buf, str); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr17906.c ================================================ struct usc_bigstack_t {}; void usc_recressive_func(int cnt, int max, struct usc_bigstack_t bstack) { usc_recressive_func(cnt+1, max, bstack); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr17913.c ================================================ /* Test for computed jump into cond_expr: bug 17913. */ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ void f (void) { void *p = &&a; 1 ? 1 : ({ a : 1; }); goto *p; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr18291.c ================================================ int baz(int k2) { int i, j, *p, k = 1, k1 = 0; if (k2) p = &j; else p = &i; if (k1) *p = 0 , p = &k; *p = 1; return k; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr18299-1.c ================================================ /* We used to ICE in gimple-lower because we would produce __t (VAR_DECL) as a statement in the instruction stream which is not valid. */ static inline int f(int i) { const int __t = (__t); } int g(void) { return f(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr18712.c ================================================ void *eintr_source (void *arg) { int ts = 0; if (arg) foo (); while (1) { if (arg) foo (); foo1 (&ts); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr18903.c ================================================ /* We were ICEing in bsi_after_labels because we had a BB which did not have a lablel. PR middle-end/18903 */ #ifndef NO_LABEL_VALUES void g (int s, int f) { &&ff; s = f; ff: goto end; f = s; end:; } #else int g; #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr19080.c ================================================ typedef union { int ioport; volatile char *maddr; } bus_space_handle_t; struct scb { unsigned short *hscb; }; struct ahd_softc { int tags[2]; bus_space_handle_t bshs[2]; int dst_mode; int src_mode; int flags; }; void outb(int, int); int foo_inb(struct ahd_softc*); int foo_int_int (int, int); int ahd_inb(struct ahd_softc*); int ahd_scb_active_in_fifo (void); void ahd_flush_qoutfifo (struct ahd_softc *ahd, struct scb *scb) { int src, dst, *a = &src, *b = &dst; *a = 1, *b = 1; int bb, p; if (ahd->src_mode == 1) { int src, dst, *a = &src, *b = &dst; *a = 1, *b = 1;} foo_int_int (ahd->src_mode, ahd->dst_mode); p = 1; if (ahd->src_mode == 2 && ahd->dst_mode == p) { if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); } ahd->src_mode = 1; ahd->dst_mode = 2; while ((ahd_inb (ahd) & 0x01) != 0) { p = 1; if (ahd->src_mode == 2 && ahd->dst_mode == p) { if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); } ahd->src_mode = 1; ahd->dst_mode = 2; if (ahd_scb_active_in_fifo () == 0) continue; p = 1; if (ahd->src_mode == 2 && ahd->dst_mode == p) { if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); } ahd->src_mode = 1; ahd->dst_mode = 2; if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); if ((ahd->flags & 1) != 0) foo_inb (ahd); if ((ahd->flags & 1) != 0) foo_inb (ahd); if ((ahd->flags & 1) != 0) foo_inb (ahd); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); if ((ahd->flags & 1) != 0) foo_inb (ahd); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); bb = (*(scb->hscb)); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); bb = (*(scb->hscb)); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); } if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); p = 1; if (ahd->src_mode == 2 && ahd->dst_mode == p) { if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); } ahd->src_mode = 1; ahd->dst_mode = 2; if (ahd->src_mode == 2 && ahd->dst_mode == dst) { if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); if (ahd->tags[0] == 1) *(ahd->bshs[0].maddr); outb (1, ahd->bshs[0].ioport ); } ahd->src_mode = 1; ahd->dst_mode = 2; ahd->flags |= 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr19121.c ================================================ typedef struct interpreter { char Itokenbuf[256]; } PerlInterpreter; static inline void S_missingterm(char *s) { char tmpbuf[3] = ""; char q; if (!s) s = tmpbuf; q = strchr(s,'"') ? '\'' : '"'; } void S_scan_heredoc(PerlInterpreter *my_perl, char *s, int i) { char term; term = *my_perl->Itokenbuf; if (i) { *s = term; S_missingterm(my_perl->Itokenbuf); } else S_missingterm(my_perl->Itokenbuf); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr19357.c ================================================ /* This generated an ICE for an ia64-linux target. */ struct f { float f[8]; }; long double ftest(struct f arg1, long double arg2) { return arg2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr19736.c ================================================ /* We used to ICE because we had forgot to update the immediate_uses information after foldding the last strcpy in Reduce PHI. This was PR tree-opt/19763. */ extern char *strcpy (char *, const char *); void sdbout_one_type (char *p) { int i, t = 1; char *q; for (i = 0; i < 2; i++) { strcpy (p, "1"); p += sizeof ("1"); } if (t) q = "2"; else q = "3"; strcpy (p, q); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr19853.c ================================================ struct test { int *x; } global_test; int global_int; int flag; void test (char *dummy) { static const struct test const_test = { &global_int }; struct test local_test; int i; for (i = 0; i < 1; i++) *dummy = 0; if (flag) __builtin_memset (dummy, 0, 16); local_test = const_test; global_test = local_test; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr20203.c ================================================ void *memset (void *, int, unsigned long); typedef struct bfd_section { unsigned long size; unsigned char *contents; } asection; int _bfd_mips_elf_finish_dynamic_sections (asection *s) { long long dummy_offset; dummy_offset = s->size - 16; memset (s->contents + dummy_offset, 0, 16); return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr20412.c ================================================ int foo(void) { int a,b,g; int i,len; int stop; len = 10; stop = 0; for (i=0; i>1 & 1U)) & ((l6_data_Z_0th & 1U) | !(((char )(l6_data_Z_0th>>35 & 15U))==14U))) t = 0ULL; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr20583.c ================================================ /* PR target/20583 On m68k-none-elf, CSE used to generate (set (reg:HI ...) (const:HI (truncate:HI (minus:SI (label_ref ...) (label_ref ...))))) which output functions do not know how to handle. Make sure that such a constant will be rejected. */ void bar (unsigned int); void foo (void) { char buf[1] = { 3 }; const char *p = buf; const char **q = &p; unsigned int ch; switch (**q) { case 1: ch = 5; break; case 2: ch = 4; break; case 3: ch = 3; break; case 4: ch = 2; break; case 5: ch = 1; break; default: ch = 0; break; } bar (ch); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr20928.c ================================================ extern struct bar_t bar; void *a; void foo (void) { void **p = a; do { *p++ = ((unsigned char *) &bar + ((unsigned long int) 1L << 31)); } while (p); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr21021.c ================================================ /* PR tree-optimization/21021 The front end produces a comparison of mismatched types, namely an integer and a pointer, causing VRP to compute TYPE_MAX_VALUE for a pointer, which we cannot. */ extern void *bar (void); int foo (unsigned int *p, unsigned int *q) { const void *r = bar (); if (r >= (const void *) *p && r < (const void *) *q) return 1; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr21030.c ================================================ /* PR tree-optimization/21030 VRP used to create invalid ranges where VR->MIN is greater than VR->MAX. */ void foo (int unit) { int i; for (i = 0; unit; i++, unit--) { if (i >= 0) { int j = i; while (j) j--; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr21293.c ================================================ /* Testcase from Dale Johannesen . */ struct { double x[1]; } g; void k( double *, double*); void h(int Tmp8) { int i; for(i = 1;i <= Tmp8;i++) k(&g.x[ + -1],&g.x[ Tmp8 + -1]); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr21356.c ================================================ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ int a; void* p; void foo (void) { switch (a) { a0: case 0: p = &&a1; a1: case 1: p = &&a2; a2: default: p = &&a1; } goto *p; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr21380.c ================================================ void bar (void); void foo (int *diff) { double deltay = 0.0; int Stangent = 0; int mindiff; int Sflipped = 0; int i; int Sturn, Snofit; Sturn = 1; if (Sturn) Stangent = 1; if (Sturn) { Sflipped = 0; Snofit = 1; while (Snofit) { Snofit = 0; mindiff = 0; for (i = 0; i < 4; i++) mindiff = diff[i]; while (!Snofit && (mindiff < 0.0)) { deltay = (Stangent ? deltay : 0.0); if (deltay < 0.0) Snofit = 1; for (i = 0; i < 4; i++) { } } if (Snofit) if (Sflipped) break; } if (Snofit) bar (); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr21532.c ================================================ int bar (unsigned char key) { unsigned char buf[sizeof (unsigned long)+2]; unsigned char b; unsigned char *buf_ = buf + 1; for (b = 8; b != 0; b--) buf_[b] = key >> b; return foo (b); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr21562.c ================================================ /* { dg-options "-fno-inline" } */ struct foo { int a, b, c; }; void abort(void); void exit(int); void brother (int a, int b, int c) { if (a) abort (); } void sister (struct foo f, int b, int c) { brother ((f.b == b), b, c); } int main () { struct foo f = { 7, 8, 9 }; sister (f, 1, 2); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr21638.c ================================================ typedef struct hashhdr { int bitmaps[32]; } HASHHDR; static void swap_header_copy(HASHHDR *srcp, HASHHDR *destp) { int i; for (i = 0; i < 32; i++) ((char *)&(destp->bitmaps[i]))[0] = ((char *)&(srcp->bitmaps[i]))[1]; } int flush_meta(HASHHDR *whdrp1) { HASHHDR *whdrp; HASHHDR whdr; whdrp = &whdr; swap_header_copy(whdrp1, whdrp); return (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr21728.c ================================================ /* { dg-require-effective-target indirect_jumps } */ int main (void) { __label__ l1; void __attribute__((used)) q(void) { goto l1; } l1:; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr21761.c ================================================ void f1() { long bit=0, exponent; exponent = -exponent; for (bit = 1; exponent; bit <<= 1) if (exponent & bit) exponent ^= bit; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr21839.c ================================================ typedef struct { } spinlock_t; typedef struct { unsigned sequence; spinlock_t lock; } seqlock_t; void ext3_new_inode(seqlock_t *rsv_seqlock) { *rsv_seqlock = (seqlock_t) { 0, (spinlock_t) { } }; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr21840.c ================================================ void fn_show_state(void); typedef void (*fn_handler_fn)(void); static fn_handler_fn fn_handler[1]; void k_spec(unsigned char value) { void *func = fn_handler[value]; if (func == fn_show_state ) return; fn_handler[value](); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr22013-1.c ================================================ typedef unsigned short W; typedef const W *P; extern void g(P); void f () { const P s = (const W []){ 'R' }; g (s); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr22269.c ================================================ /* We used to ICE in tree-ssa-reassoc because we did look at the correct operand to see if it was a SSA_NAME. */ int printf(const char*, ...); int main(int argv, char*argc) { int d1; int d2; int s1, s2; int b; ((d1)&=(int)0x0000ffffL, (d1)|=((int)(short)(0x344))<<16); ((d1)&=(int)0xffff0000UL, (d1)|=(int)(unsigned short)(0x4567)); ((d2)&=(int)0x0000ffffL, (d2)|=((int)(short)(0))<<16); ((d2)&=(int)0xffff0000UL, (d2)|=(int)(unsigned short)(0x3b9a)); printf(" dividend >>: %ld\n", d1); printf(" divisor >>: %ld\n", d2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr22379.c ================================================ void __add_entropy_words(void); void __wake_up(void); void SHATransform(void); static inline __attribute__((always_inline)) void add_entropy_words(void){} void extract_entropy(void); static inline __attribute__((always_inline)) void xfer_secondary_pool(void) { extract_entropy(); add_entropy_words(); } void extract_entropy(void) { xfer_secondary_pool(); __wake_up(); } void init_std_data(void) { add_entropy_words(); } void rand_initialize(void) { init_std_data(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr22398.c ================================================ #if ULONG_MAX != 4294967295u && ULONG_MAX != 18446744073709551615ull int main(void) { exit (0); } #else #if ULONG_MAX != 18446744073709551615ull #define NUM 0xf0000000 #else #define NUM 0xf000000000000000 #endif int func1(void *rw) { return (rw && (((unsigned long) rw) >= NUM) ); } void func2(void *rw) { while(rw && (((unsigned long) rw) >= NUM) ) {} } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr22422.c ================================================ /* We should not crash trying to figure out the points-to sets for the below. We used to because we ended up adding pointers to the points-to set of the ANYTHING variable. */ struct D { int n; int c [8]; }; struct A { int i; char *p; }; struct B { struct A *a; struct D *d; }; int dtInsert1 (struct B *b) { struct A a = { 0, 0 }; struct D *d; b->a = &a; d = b->d; &d->c [d->n]; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr22531.c ================================================ typedef struct dw_cfi_oprnd_struct { unsigned long reg; } dw_cfa_location; void def_cfa_1 (void) { dw_cfa_location loc; loc.reg = loc.reg; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr22589-1.c ================================================ int bar (char *foo) { return (long long) ((int) foo + 0) < 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr23233-1.c ================================================ void foo (volatile long long *x) { while (*x) { *x = 0; *((volatile char *) 0) = 0; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr23237.c ================================================ /* Don't assemble, as this section syntax may not be valid on all platforms (e.g., Darwin). */ /* { dg-do compile } */ /* { dg-require-effective-target named_sections } */ static __attribute__ ((__section__ (".init.data"))) char *message; static __attribute__ ((__section__ (".init.data"))) int (*actions[])(void) = {}; void unpack_to_rootfs(void) { while (!message) { if(!actions[0]) return; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr23435.c ================================================ /* PR target/23435. On m68k-none-elf, this used to cause an unrecognized insn because zero_extendsidi2 accepted operands that are both memory even though such a pattern did not exist. */ void foo (unsigned long *a, unsigned long long *p) { *p = *a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr23445.c ================================================ struct buffer_head { char *b_data; }; void asfs_deletebnode( struct buffer_head *bhsec) { if (bhsec == 0) { void *bnc2 = (void *) bhsec->b_data; if (bnc2) return; if (bhsec) __brelse(bhsec); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr23476.c ================================================ int h(int); int t; static inline int f(const int i) { int tt = i; _Bool a = i < t; if (a) return h(t); return 9; } int g(void) { return f(0x7FFFFFFF); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr23929.c ================================================ /* PR tree-optimization/23929 */ extern void bar (char *); void foo (int n, char *z) { char b[2048]; int x, y; bar (b); for (y = 0; y < 60; y++) if (n == 600) for (x = 0; x < 320;) { *z++ = b[x]; x += 1; *z++ = b[x]; x += 1; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr23944.c ================================================ float f(float src[][4]) { return *(src[3]); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr23946.c ================================================ extern int foo (void); int avi_parse_comments (int fd, char *buf, int space_left) { int len = 0, readlen = 0, k; char *data, *c, *d; if (fd <= 0 || !buf || space_left <= 0) return -1; memset (buf, 0, space_left); readlen = foo (); if (!(data = malloc (readlen * sizeof (char) + 1))) return -1; c = data; space_left--; while (len < space_left) { if (!c || *c == '\0') break; else if (*c == 'I') { d = c + 4; k = 0; while (d[k] != '\r' && d[k] != '\n' && d[k] != '\0') ++k; if (k >= space_left) return len; memcpy (buf + len, c, 4); len += 4; long2str (buf + len, k + 1); len += 4; memcpy (buf + len, d, k); *(buf + len + k + 1) = '\0'; if ((k + 1) & 1) { k++; *(buf + len + k + 1) = '\0'; } len += k + 1; while (*c != '\n' && *c != '\0') ++c; if (*c != '\0') ++c; else break; } } free (data); return len; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr23960.c ================================================ /* PR tree-optimization/23960 fold-const.c used to construct a comparison node with one pointer operand and one non-pointer operand. */ void abort (void) __attribute__ ((noreturn)); void foo (char *d, unsigned long int n) { if (d + n > d) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr24227.c ================================================ int Fdisplay_buffer (int buffer) { if (((struct buffer *) ((unsigned int) buffer)) == (0,(struct buffer *) ((unsigned int) ((buffer) & 1)))) return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr24883.c ================================================ typedef struct _rec_stl rec_stl; struct _rec_stl { unsigned char **strs; }; orec_str_list(int count) { rec_stl *stl; int i, j; int li, lj; unsigned char ci, cj; for (i = 0; i < count; i++) { for (j = i + 1; j < count; j++) { cj = lj > 2 ? stl->strs[j][0] : (long)stl->strs[j] & 0xff; if ((count >= 16 && cj < ci) || (cj == ci && lj > li)) { stl->strs[j] = stl->strs[i]; ci ^= cj; cj ^= ci; ci ^= cj; } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr24930.c ================================================ /* PR 24930 */ extern int foo(int u) __attribute__((noinline)); int foo(int u) {return 0;} int main(int argc, char** argv) { const char *buf = argv[1]; unsigned int data = (((unsigned int) buf[0]) << 8) + (unsigned int) buf[1]; if (data & 0x8000) { data &= 0x7fff ; data ^= 0x7fff ; data += 1 ; data *= -1 ; } return foo((int)data); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr25224.c ================================================ /* { dg-options "-funswitch-loops" } */ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ static float rgam; extern void *jmp(void *); void drotmg(float d1) { void *labels[] = { &&L170, &&L180, 0 }; for(;;) { goto *jmp(labels); if (d1 <= rgam) goto L170; L170: if (d1 <= rgam) goto L170; } L180: goto L170; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr25310.c ================================================ /* Prevent spurious test failures on 16-bit targets. */ #if __INT_MAX__ >= 2147483647L extern int f (char *, int); void test (void) { char buffer[65536]; char *bufptr; char *bufend; int bytes; bufptr = buffer; bufend = buffer + sizeof(buffer) - 1; while ((bytes = f (bufptr, bufend - bufptr)) > 0) bufptr += bytes; } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr25311.c ================================================ struct w { int top; int left; int height; int width; struct w *next; struct w *parent; struct w *child; }; extern struct w *Qnil; void set_size (struct w *w, int new_size, int nodelete, int set_height) { int old_size = set_height? w->height : w->width; if (nodelete || w->parent == Qnil) { int last_pos, last_old_pos, pos, old_pos, first; int div_val = old_size << 1; struct w *c; last_pos = first = set_height? w->top : w->left; last_old_pos = 0; for (c = w->child; c != Qnil; c = c->next) { if (set_height) old_pos = last_old_pos + c->height; else old_pos = last_old_pos + c->width; pos = (((old_pos * new_size) << 1) + old_size) / div_val; set_size (c, pos + first - last_pos, 1, set_height); last_pos = pos + first; last_old_pos = old_pos; } if (!nodelete) for (c = w->child; c != Qnil; c = c->next) use (c); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr25483.c ================================================ /* { dg-options "-fmove-loop-invariants" } */ static int mdct_win[8]; int x; int decode_init (double d) { int j; for (j = 4; j; j--) { d *= 0.5; mdct_win[j] = (d * 3); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr25513.c ================================================ int f(void) { static _Complex double t; int i, j; for(i = 0;i<2;i++) for(j = 0;j<2;j++) t = .5 * 1.0; return t; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr25514.c ================================================ struct node { struct node *next; int value; }; struct node *current_node, global_list; void bar (void) { struct node *node, *next; node = current_node; next = node->next; if (node != &global_list) current_node = next; else { node = global_list.next; global_list.value = node->value; global_list.next = node->next; } foo (node); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr25860.c ================================================ /* We used to ICE because PRE would try to PRE the load of *Note from the loop. */ struct g { int i; }; struct f { struct g i; }; int GSM_RingNoteGetFullDuration(struct g)__attribute__((const)); void savewav(struct f *gg) { struct g *Note; long i = 0,j,length=0; Note = &gg->i; for (j=0;j= 0; loop--) key_put(keyring->keys[loop]); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr26622.c ================================================ /* PR middle-end/26622 fold_ternary used to create a tree with mismatching types, causing (const_int 128) to appear in QImode rtx. */ unsigned char g; unsigned long long foo (void) { return ((long long) ((g & 0x80) != 0)) << 7; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr26626.c ================================================ typedef union { int d; } U; int rv; void breakme() { U *rv0; U *pretmp = (U*)&rv; rv0 = pretmp; rv0->d = 42; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr26725.c ================================================ struct { unsigned int num; } *numptr; void notice (int); void doit (unsigned int *); void rewrite_finalize_block (int x) { unsigned int *tmp; while (tmp = (numptr ? &numptr->num : 0), (tmp ? *tmp : 0) > 0) { tmp = (numptr ? &numptr->num : 0); (void) (*tmp ? 0 : notice (x)); doit (tmp); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr26781-1.c ================================================ void zconfdump(void) { char *p, *p2; for (p2 = p; p2; ) { char __a0, __a1, __a2; __a0 = ((__const char *) ("\"\\"))[0]; if (__a0) return; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr26781-2.c ================================================ void zconfdump(__SIZE_TYPE__ i) { for (;;) { char __a0; __a0 = ("\"\\")[i]; if (__a0) return; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr26833.c ================================================ void yasm_lc3b__parse_insn( int num_info, int *num_operands , int *operands, int op) { int found = 0; int i; for (; num_info>0 && !found; num_info--) { int mismatch = 0; for(i = 0;op && (i<*num_operands)&& !mismatch; i++) { if (!(int)(operands[i] & 0x1)) mismatch = 1; if (mismatch) break; } if (!mismatch) found = 1; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr26840.c ================================================ extern int f1 (void **); extern void f2 (void *); struct s { unsigned char field1; int field2; }; static inline struct s * get_globals (void) { struct s * r; void * rr; if (f1 (&rr)) return 0; r = rr; if (! r) { extern struct s t; r = &t; } r->field1 = 1; return r; } void atexit_common (const void *dso) { struct s *g = get_globals (); if (! g) return; if (g->field1) { g->field2 = 0; f2 (g); } else f2 (g); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr27087.c ================================================ extern int ptbl[4]; extern int ctbl[4]; void doViews(void) { int *c = ctbl, *p = ptbl; while (1) { p++; c++; if (*p) { if (c == p) { if (*c) return; } else return; } } g(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr27282.c ================================================ /* This test used to ICE on PowerPC at -O due to combine GEN_INT bug. */ typedef struct _ColRowInfo ColRowInfo; typedef struct { } GnmSheetRange; struct _ColRowInfo { float size_pts; unsigned margin_a:3; unsigned margin_b:3; unsigned visible:1; }; colrow_equal (ColRowInfo const *a, ColRowInfo const *b) { return a->size_pts == b->size_pts && a->margin_a == b->margin_a && a->visible == b->visible; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr27341-1.c ================================================ extern double R_NaReal; void z_atan2 (double _Complex * r, double _Complex * ccs) { if (*ccs == 0) __imag__ *r = R_NaReal; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr27341-2.c ================================================ void zgemm_ (const int*, const double*); extern void matmul_c8 (_Complex double * dest) { const int ldc = 0; const double zero = 0; zgemm_ ( &zero, &ldc); dest[1] += 1 ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr27373.c ================================================ typedef struct atype { float bg[1], cg[1]; _Bool ant; }atype; void cp_assert(_Bool*, float*, int*, _Bool*); void f(atype **rng_stream, int *error, float u) { _Bool t = *rng_stream != 0; float routinep; _Bool failure; cp_assert ( &t, &routinep, error, &failure); if (failure == 0) { typedef float ty[1]; ty *tt = &((*rng_stream)->bg); int i = 1; do { (*tt)[i - 1] = u; i ++; }while (i > 1); { ty *tt = &(*rng_stream)->cg; int i = 1; do { (*tt)[i - 1] = u; i ++; }while (i > 1); } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr27528.c ================================================ /* Check that constant constraints like "i", "n" and "s" can be used in cases where the operand is an initializer constant. */ /* { dg-require-effective-target nonpic } */ int x[2] = { 1, 2 }; #ifdef __OPTIMIZE__ static inline void __attribute__((__always_inline__)) insn1 (int x) { asm volatile ("" :: "n" (x), "i" (x)); } static inline void __attribute__((__always_inline__)) insn2 (const void *x) { asm volatile ("" :: "s" (x), "i" (x)); } #endif void foo (void) { #ifdef __OPTIMIZE__ insn1 (2); insn1 (2); insn1 (400); insn1 (__LINE__); insn2 (x); insn2 (x); insn2 (&x[1]); insn2 ("string"); #endif asm volatile ("" :: "s" (x), "i" (x)); /* At the time of writing, &x[1] is decomposed before reaching expand when compiling with -O0. */ asm volatile ("" :: "s" ("string"), "i" ("string")); asm volatile ("" :: "s" (__FILE__), "i" (__FILE__)); asm volatile ("" :: "s" (__FUNCTION__), "i" (__FUNCTION__)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr27571.c ================================================ /* PR target/27571 alpha_does_function_need_gp did not properly skip jump table insns */ int r3isseparator(int); void r3isdigit(int); void r3decimalvalue(int); void r7todouble(int *storage, int *count) { int i = 0; int state = 0; int cc = 0; while (i > *count) { cc = *storage; switch (state) { case 0: if (r3isseparator(cc)) state = 1; case 1: r3isdigit(cc); case 2: case 5: case 6: r3decimalvalue(cc); } i++; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr27863.c ================================================ /* This test used to ICE on IA64. */ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ long stack[100]; int main(int argc,char**argv,char **envp) { long *esp=stack; static void* jarray[]={ &&KeyCtrlKV }; *++esp=(long)&&_loc0; goto SetTermStruc; _loc0:; *++esp=(long)&&_loc1; _loc1:; *++esp=(long)&&_loc35; _loc35:; goto *(*esp--); *++esp=(long)&&_loc36; _loc36:; *++esp=(long)&&_loc37; _loc37:; KeyCtrlKV: *++esp=(long)&&_loc66; _loc66:; *++esp=(long)&&_loc106; _loc106:; *++esp=(long)&&_loc119; _loc119:; SetTermStruc: goto *(*esp--); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr27889.c ================================================ /* { dg-require-effective-target trampolines } */ void h(void (*)(void)); _Complex int g (void) { _Complex int x; void f(void) { x = x + x; } h(f); return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr27907.c ================================================ typedef double fann_type; typedef struct { } _G_fpos64_t; struct fann_neuron { fann_type value; } __attribute__ ((packed)); struct fann_layer { struct fann_neuron *last_neuron; }; struct fann { struct fann_layer *first_layer; }; fann_run (struct fann *ann, fann_type * input) { struct fann_layer *layer_it, *layer_it2, *last_layer; for (layer_it = ann->first_layer + 1; layer_it != last_layer; layer_it++) { ((layer_it - 1)->last_neuron - 1)->value = 1; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr28489.c ================================================ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ typedef int c_int; union c_insn { void (*op) (); c_int *mem; c_int imm; }; static union c_insn c_stack[((0x100 + 4) * 4)]; static struct c_ident *c_funcs; static void (*c_op_bz) (); static void c_direct (union c_insn *addr); c_compile (int (*ext_getchar) (), void (*ext_rewind) (), struct c_ident *externs) { c_direct (((void *) 0)); } static void c_direct (union c_insn *addr) { union c_insn *pc = addr; union c_insn *sp = c_stack; c_int imm = 0; static void *ops[] = { &&op_index, &&op_assign, &&op_add_a, &&op_sub_a, &&op_mul_a, &&op_div_a, &&op_mod_a, &&op_or_a, &&op_xor_a, &&op_and_a, &&op_shl_a, &&op_shr_a, }; { c_op_bz = &&op_bz; } goto *(pc++)->op; op_bz:if (imm) { } op_push_imm_imm:(sp - 2)->imm = imm; goto *(pc - 1)->op; op_index:imm = *((sp - 3)->mem += imm); op_assign:*(sp - 3)->mem = imm; op_add_a:imm = *(sp - 3)->mem += imm; op_sub_a:imm = *(sp - 3)->mem -= imm; op_mul_a:imm = *(sp - 3)->mem *= imm; op_div_a:imm = *(sp - 3)->mem /= imm; op_mod_a:imm = *(sp - 3)->mem %= imm; op_or_a:imm = *(sp - 3)->mem |= imm; op_xor_a:imm = *(sp - 3)->mem ^= imm; op_and_a:imm = *(sp - 3)->mem &= imm; op_shl_a:imm = *(sp - 3)->mem <<= imm; op_shr_a:imm = *(sp - 3)->mem >>= imm; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr28675.c ================================================ struct fb_cmap { unsigned int start; unsigned int len; unsigned short *red; unsigned short *green; unsigned short *blue; unsigned short *transp; }; typedef struct { int r; int g; int b; int a; } rgba_t; static unsigned int cmap_len; extern unsigned int red_len, green_len, blue_len, alpha_len; extern struct fb_cmap fb_cmap; extern rgba_t *clut; extern int fb_set_cmap(void); void directcolor_update_cmap(void) { unsigned int i; for (i = 0; i < cmap_len; i++) { if (i < red_len) fb_cmap.red[i] = clut[i].r; if (i < green_len) fb_cmap.green[i] = clut[i].g; if (i < blue_len) fb_cmap.blue[i] = clut[i].b; if (fb_cmap.transp && i < alpha_len) fb_cmap.transp[i] = clut[i].a; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr28776-1.c ================================================ typedef struct dw_fde_struct { int decl; } *dw_fde_ref; dw_fde_ref fde_table; unsigned fde_table_in_use; void output_call_frame_info (void) { unsigned int i; dw_fde_ref fde; for (i = 0; i < fde_table_in_use; i++) { fde = &fde_table[i]; tree_contains_struct_check_failed (fde_table[i].decl); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr28776-2.c ================================================ typedef struct RangeCoder { unsigned char one_state[256]; } RangeCoder; static inline void put_rac(RangeCoder *c, unsigned char* const state) { *state= c->one_state[*state]; } typedef struct PlaneContext{ unsigned (*state)[32]; } PlaneContext; static inline void put_symbol(RangeCoder *c, unsigned char *state) { int i; const int e; put_rac(c, state); for(i=e-1; i>=0; i--) put_rac(c, state+22+i); } int encode_line(void) { PlaneContext * const p; RangeCoder * const c; int a; put_symbol(c, p->state[a]); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr28865.c ================================================ struct var_len { int field1; const char field2[]; }; /* Note - strictly speaking this array declaration is illegal since each element has a variable length. We used to allow this because it was used in existing code. Since PR64417 we reject this code. */ static const struct var_len var_array[] = { { 1, "Long exposure noise reduction" }, /* { dg-error "initialization of flexible array member" } */ { 2, "Shutter/AE lock buttons" }, /* { dg-error "initialization of flexible array member" } */ { 3, "Mirror lockup" } /* { dg-error "initialization of flexible array member" } */ }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr28905.c ================================================ /* We used to ICE here because after VRP we ended up with non-compatible ranges in a value-range equivalences set. */ void code_comment (int size) { int i; for (i = 0; i < size; i++) if (i) if (i < 0) if (i < 0) return; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr29128.c ================================================ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ typedef unsigned long Eterm; process_main (void) { register Eterm x0; register Eterm *reg = ((void *) 0); register Eterm *I = ((void *) 0); static void *opcodes[] = { &&lb_allocate_heap_zero_III, &&lb_allocate_init_tIy, &&lb_allocate_zero_tt }; lb_allocate_heap_III:{ Eterm *next; goto *(next); } lb_allocate_heap_zero_III:{ } lb_allocate_init_tIy:{ } lb_allocate_zero_tt:{ Eterm *next; { Eterm *tmp_ptr = ((Eterm *) (((x0)) - 0x1)); (*(Eterm *) (((unsigned char *) reg) + (I[(0) + 1]))) = ((tmp_ptr)[0]); x0 = ((tmp_ptr)[1]); } goto *(next); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr29201.c ================================================ /* { dg-do assemble { target ia64-*-* } } */ typedef int gint; typedef gint gboolean; typedef unsigned int guint; typedef struct _MetaRectangle MetaRectangle; struct _MetaRectangle { int x; int y; }; typedef struct _MetaDisplay MetaDisplay; typedef struct _MetaFrame MetaFrame; typedef struct _MetaWindow MetaWindow; typedef struct { int win_gravity; } XSizeHints; typedef enum { META_DEBUG_FOCUS = 1 << 0, META_DEBUG_WORKAREA = 1 << 1, META_DEBUG_STACK = 1 << 6, META_DEBUG_WINDOW_OPS = 1 << 7, META_DEBUG_GEOMETRY = 1 << 20, META_DEBUG_EDGE_RESISTANCE = 1 << 21 } MetaStackLayer; struct _MetaWindow { MetaDisplay *display; MetaFrame *frame; guint user_has_move_resized:1; MetaRectangle user_rect; XSizeHints size_hints; }; void meta_window_get_position (MetaWindow * window, int *x, int *y); typedef struct _MetaFrameGeometry MetaFrameGeometry; struct _MetaFrameGeometry { }; struct _MetaFrame { MetaWindow *window; MetaRectangle rect; int child_x; int child_y; }; typedef enum { META_IS_CONFIGURE_REQUEST = 1 << 0, META_DO_GRAVITY_ADJUST = 1 << 3, META_IS_RESIZE_ACTION = 1 << 4 } MetaMoveResizeFlags; adjust_for_gravity (MetaWindow * window, MetaFrameGeometry * fgeom, gboolean coords_assume_border, int gravity, MetaRectangle * rect) { int ref_x, ref_y; int child_x, child_y; int frame_width, frame_height; switch (gravity) { case 1: ref_x = rect->x; } switch (gravity) { case 1: rect->y = ref_y + child_y; case 2: rect->x = ref_x - frame_width / 2 + child_x; break; case 3: case 5: case 6: rect->x = ref_x - frame_width + child_x; } } meta_window_move_resize_internal (MetaWindow * window, MetaMoveResizeFlags flags, int resize_gravity, int root_x_nw, int root_y_nw, int w, int h) { unsigned int mask; MetaFrameGeometry fgeom; gboolean need_resize_client = (0); gboolean is_configure_request; MetaRectangle new_rect; MetaRectangle old_rect; { adjust_for_gravity (window, window->frame ? &fgeom : ((void *) 0), is_configure_request, window->size_hints.win_gravity, &new_rect); } meta_window_constrain (window, window->frame ? &fgeom : ((void *) 0), flags, resize_gravity, &old_rect, &new_rect); if (mask != 0) { { meta_topic_real (META_DEBUG_GEOMETRY, need_resize_client ? "true" : "false"); } } { window->user_has_move_resized = (!(0)); meta_window_get_position (window, &window->user_rect.x, &window->user_rect.y); } } void meta_window_get_position (MetaWindow * window, int *x, int *y) { if (window->frame) { *x = window->frame->rect.x + window->frame->child_x; *y = window->frame->rect.y + window->frame->child_y; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr29241.c ================================================ static inline __attribute__((always_inline)) void ip_finish_output2(){} void ip_fragment(void (*)(void)); static inline __attribute__((always_inline)) void ip_finish_output() { ip_fragment(ip_finish_output2); ip_finish_output2(); } void ip_mc_output() { ip_finish_output(); } void ip_output() { ip_finish_output(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr29250.c ================================================ /* We used to ICE because EXPAND_SUM was being used for all recursive calls to expand_expr. */ struct TSparseEntry { int feat_index; double entry; }; struct TSparse { int vec_index; int num_feat_entries; struct TSparseEntry *features; }; void get_full_feature_matrix (struct TSparse* sparse_feature_matrix, int num_vec) { double *fm; int v, f; for (v=0; v < num_vec; v++) { for (f=0; f < sparse_feature_matrix[v].num_feat_entries; f++) { long long offs = sparse_feature_matrix[v].vec_index + sparse_feature_matrix[v].features[f].feat_index; fm[offs] = sparse_feature_matrix[v].features[f].entry; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr29945.c ================================================ /* This test used to ICE on the SPU target. */ extern const char *__ctype_ptr; parse_real (unsigned char c) { if ((__ctype_ptr[c]&04) && c != '.') unget_char ( c); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr30132.c ================================================ double testit(double _Complex* t) { return *t==0.0?0.0:-*t; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr30311.c ================================================ /* ICE in subreg_get_info: bug 30311. */ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ inline double bar(double x) { long double d; __asm__ ("" : "=t" (d) : "0" (x)); return d; } double foo(double x) { if (x) return bar(x); else return bar(x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr30338.c ================================================ /* We used to do folding with mismatched types which caused us to infinitely loop in comparison foldings. */ extern char *grub_scratch_mem; int testload_func (char *arg, int flags) { int i; for (i = 0; i < 0x10ac0; i++) if (*((unsigned char *) ((0x200000 + i + (int) grub_scratch_mem))) != *((unsigned char *) ((0x300000 + i + (int) grub_scratch_mem)))) return 0; return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr30433.c ================================================ int f = (_Complex float)(0.5) == 0.5; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr30564-1.c ================================================ static int spready[] = {0, 1, 2, 3}; void explosion_map (int y) { int i; for (i = 0; i < 4; i++) if (y * spready[i] < 0) break; } void explosion (void) { int i; explosion_map (0); for (i = 0; i < 2; i++) continue; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr30564-2.c ================================================ static int RawOrEnc = 0; static inline void addpair(int fp, int un) { if (RawOrEnc == 0 && fp != un) RawOrEnc = 1; } int f(int un0, char *a, unsigned int __s2_len) { addpair(un0, un0); __s2_len < 4 ? __builtin_strcmp (a, "-") : 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr30984.c ================================================ /* { dg-require-effective-target indirect_jumps } */ int fs_exec(int ino) { void *src = 0; if (ino) src = (void*)0xe000; goto *src; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr31034.c ================================================ static inline int mod (int a, int n) { return a >= n ? a % n : a; } void dpara(int); void opticurve (int m) { int i; for (i = 0; i < m; i++) { dpara(mod (i - 1, m)); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr31345-1.c ================================================ /* PR tree-optimization/31345 This caused a crash in VRP when dealing with overflow infinities. */ void dpsnaffle (const char *kbuf) { int hash, thash, head[2], off; { int _DP_i; (hash) = 19780211; { (hash) = (hash) + (kbuf)[_DP_i]; } (hash) = ((hash) * 43321879) & 0x7FFFFFFF; } while (off != 0) { if (hash > thash) {} else if (hash < thash) { off = head[2]; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr31541.c ================================================ typedef unsigned char Uchar; struct scsi_mode_header { unsigned char sense_data_len : 8; }; int f(void) { struct scsi_mode_header md; return *(Uchar*)&md; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr31703.c ================================================ typedef unsigned long long HARD_REG_ELT_TYPE; static HARD_REG_ELT_TYPE reload_reg_used_in_output_addr[30]; int reload_reg_reaches_end_p (unsigned int regno, int opnum) { int i; for (i = opnum + 1; i < opnum; i++) if (reload_reg_used_in_output_addr[i] & ((HARD_REG_ELT_TYPE)1 << regno)) return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr31710.c ================================================ typedef short SHORT; struct v { SHORT i; }; void f(struct v *pin, struct v *pout) { if (pin->i == (-0x7fff)-1) pout->i = -pin->i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr31797.c ================================================ struct GTeth_desc { unsigned ed_cmdsts; }; struct GTeth_softc { struct GTeth_desc txq_desc[32]; unsigned int txq_fi; unsigned int txq_nactive; }; void GTeth_txq_free (struct GTeth_softc *sc) { struct GTeth_desc *txd = &sc->txq_desc[0]; txd->ed_cmdsts &= ~(1U << (31)); } void GTeth_txq_done (struct GTeth_softc *sc) { while (sc->txq_nactive > 0) { volatile struct GTeth_desc *txd = &sc->txq_desc[sc->txq_fi]; if (txd->ed_cmdsts) { if (sc->txq_nactive == 1) return; } GTeth_txq_free (sc); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr31953.c ================================================ struct WView { int hexedit_mode:1; }; toggle_hexedit_mode (struct WView *view) { if (view->hexedit_mode) { } else { view->hexedit_mode = !view->hexedit_mode; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32139.c ================================================ /* PR tree-optimization/32139 */ int foo (void); int bar (void) __attribute__ ((const)); int test (int x) { int a = (x == 10000 ? foo : bar) (); int b = (x == 10000 ? foo : bar) (); return a + b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32169.c ================================================ void f(char); static inline void * __memset_generic(char c) { f(c); } int prepare_startup_playback_urb( int b, int c ) { char d; if (b) __memset_generic(c == ( 1) ? 0x80 : 0); else __memset_generic (c == ( 1) ? 0x80 : 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32349.c ================================================ /* { dg-options "-fmodulo-sched" } */ extern long *x1, *x2, *x3; int foo () { /* Switching the following two lines prevents the ICE. */ long *p1, *p2; long m, n, i; p1 = x1; p2 = x2; n = 0; for (i = *x3; 0 < i; i--) { m = (*p1++) ^ (*p2++); m = (m & 0x55555555) + ((m >> 1) & 0x55555555); m = (m & 0x33333333) + ((m >> 2) & 0x33333333); m = (m + (m >> 4)) & 0x0f0f0f0f; m = (m + (m >> 8)); n += m; } return n; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32355.c ================================================ typedef struct { } __sigset_t; typedef struct { char coredump; } EMode; extern EMode Mode; struct sigaction { __sigset_t sa_mask; int sa_flags; }; doSignalsSetup (void) { static const int signals[] = { 1, 2 , 3, 4, 6, 8, 11, 13, 14, 15, 10, 12, 17, 7 }; unsigned int i, sig; struct sigaction sa; for (i = 0; i < sizeof (signals) / sizeof (int); i++) { sig = signals[i]; if (Mode.coredump && (sig == 4 || sig == 8)) continue; sa.sa_flags = (sig == 17); sigemptyset (&sa.sa_mask); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32372.c ================================================ typedef struct AVCodecContext { int flags; void *priv_data; char codec_name[32]; } AVCodecContext; typedef struct ScanTable { int obmc; int umvplus; int h263_aic; } MpegEncContext; MPV_encode_init (AVCodecContext *avctx) { MpegEncContext *s = avctx->priv_data; s->umvplus = (avctx->flags & 0x02000000) ? 1 : 0; s->h263_aic = (avctx->flags & 0x01000000) ? 1 : 0; s->h263_aic = s->obmc || s->umvplus; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32399.c ================================================ void f(unsigned char *src, unsigned char *dst, int num, unsigned char *pos, unsigned char *diffuse, int hasdiffuse, unsigned char *specular, int hasspecular) { int i; for(i=num;i--;) { float *p = (float *) ((__SIZE_TYPE__) dst + (__SIZE_TYPE__) pos); if(hasdiffuse) { unsigned int *dstColor = (unsigned int *) (dst + i + (__SIZE_TYPE__) diffuse); *dstColor = * (unsigned int *) ( ((__SIZE_TYPE__) src + (__SIZE_TYPE__) diffuse) + i); } if(hasspecular) { unsigned int *dstColor = (unsigned int *) (dst + i + (__SIZE_TYPE__) specular); *dstColor = * (unsigned int *) ( ((__SIZE_TYPE__) src + (__SIZE_TYPE__) specular) + i); } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32453.c ================================================ void ucs2reverse_internal_loop_single (long *irreversible, int foo) { unsigned char bytebuf[2]; const unsigned char *inptr = bytebuf; if (irreversible == (void *)0) ; else inptr += 2; if (inptr != bytebuf) ((inptr - bytebuf > foo) ? (void) (0) : __assert_fail ()); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32482.c ================================================ typedef struct { unsigned long bits[((((1 << 0))+32 -1)/32)]; } nodemask_t; static inline __attribute__((always_inline)) int bitmap_empty(const unsigned long *src, int nbits) { return ! (*src & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL )); } static inline __attribute__((always_inline)) int __nodes_empty(const nodemask_t *srcp, int nbits) { return bitmap_empty(srcp->bits, nbits); } extern nodemask_t node_online_map; void drain_array(void); void drain_cpu_caches(void) { int node; if (!__nodes_empty(&(node_online_map), (1 << 0))) for (((node)) = 0; ((node)) < 1; ((node))++) { } if (!__nodes_empty(&(node_online_map), (1 << 0))) drain_array(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32571.c ================================================ struct list_head { struct list_head *next, *prev; }; struct ib_fmr { int *device; struct list_head list; }; static inline struct mthca_fmr *to_mfmr(struct ib_fmr *ibmr) { const struct ib_fmr *__mptr = (ibmr); return (struct mthca_fmr *)( (char *)__mptr ); } void mthca_unmap_fmr(struct list_head *fmr_list) { struct ib_fmr *fmr; if (mthca_is_memfree()) { for (fmr = ({ const struct list_head *__mptr = ((fmr_list)->next); (struct ib_fmr *)( (char *)__mptr - 8 );}); &fmr->list != (fmr_list); fmr = ({ const struct list_head *__mptr = (fmr->list.next); (struct ib_fmr *)( (char *)__mptr - 8);}) ) mthca_arbel_fmr_unmap(to_mfmr(fmr)); } else for (fmr = ({ const struct list_head *__mptr = ((fmr_list)->next); (struct ib_fmr *)( (char *)__mptr - 8);}); &fmr->list != (fmr_list); fmr = ({ const struct list_head *__mptr = (fmr->list.next); (struct ib_fmr *)( (char *)__mptr - 8);}) ) mthca_tavor_fmr_unmap(to_mfmr(fmr)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32584.c ================================================ typedef __SIZE_TYPE__ size_t; /* Kludge */ #define unsigned typedef __SIZE_TYPE__ __ssize_t; #undef unsigned typedef struct { } __mbstate_t; typedef struct { } _G_fpos64_t; enum { __GCONV_INTERNAL_ERROR }; typedef int (*__gconv_trans_fct) (struct __gconv_step *, size_t *); typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *, unsigned char *, unsigned char *); struct __gconv_trans_data { }; struct _IO_marker { }; typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, size_t __n); typedef struct blockbox { } *BBOXPTR, BBOX ; typedef struct netbox { } *NBOXPTR, NBOX ; typedef struct termbox { struct termbox *nextterm ; } *TEBOXPTR, TEBOX ; typedef struct tilebox { TEBOXPTR termsptr ; } *TIBOXPTR , TIBOX ; typedef struct cellbox { TIBOXPTR tileptr ; } *CBOXPTR , CBOX ; typedef struct dimbox { } DBOX ; typedef struct rowbox { } ROWBOX ; typedef struct binbox { } CHANGRDBOX ; extern int numcells ; extern int numterms ; sortpin() { int j , n , cell ; CBOXPTR ptr ; TIBOXPTR tile ; TEBOXPTR term , *xpptr ; for( cell = 1 ; cell <= numcells + numterms ; cell++ ) { if( ( tile = ptr->tileptr ) == (TIBOXPTR) ((void *)0) ) { } n = 0 ; for( term = tile->termsptr ; term != (TEBOXPTR) ((void *)0) ; term = term->nextterm ) { xpptr[ ++n ] = term ; } xpptr[ n + 1 ] = (TEBOXPTR) ((void *)0) ; ptr->tileptr->termsptr = xpptr[ 1 ] ; for( j = 1 ; j <= n ; j++ ) { } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32606.c ================================================ int inb(int); void is870(unsigned int wkport, unsigned char j) { unsigned int tmport; unsigned char i; for (i = 0; i < 16; i++) { tmport = wkport + 0x18; tmport += 0x07; while ((inb(tmport) & 0x80) == 0) { if ((inb(tmport) & 0x01) != 0) { tmport -= 0x06; tmport += 0x06; } } tmport = wkport + 0x14; tmport += 0x04; tmport += 0x07; widep_in1: if ((j & 0x01) != 0) { tmport -= 0x06; tmport += 0x06; goto widep_in1; } while ((inb(tmport) & 0x80) == 0) {} } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32780.c ================================================ typedef __SIZE_TYPE__ size_t; extern void dont_optimize_away(size_t); void crashGcc(char*a) { size_t b=(size_t)a - ((size_t)a & 1); size_t c=(size_t)a - (b & (size_t)a); dont_optimize_away(b+c); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32796.c ================================================ __SIZE_TYPE__ f (void *ptr) { return ((__SIZE_TYPE__)(ptr)-1) | 1ULL; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32919.c ================================================ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ void _IO_vfprintf_internal ( char *f ) { static const void *const step0_jumps[] = { &&do_form_unknown, &&do_flag_plus, &&do_form_float }; const void * ptr = step0_jumps[0]; do { char spec; spec = (*++f); goto *ptr; do_flag_plus: read_int (&f); do_number: _itoa_word (spec); do_form_float: if (ptr != ((void *)0)) { spec = 'x'; goto do_number; } if (spec != 'S') __strnlen (); return; do_form_unknown:; } while (*f != '\0'); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32920.c ================================================ int a; void foo(void) { char buf[10]; a = a < sizeof(buf) ? a : sizeof (buf); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr32988.c ================================================ enum zone_type { ZONE_DMA, ZONE_NORMAL, ZONE_MOVABLE, MAX_NR_ZONES }; static unsigned long arch_zone_lowest_possible_pfn[MAX_NR_ZONES]; static unsigned long arch_zone_highest_possible_pfn[MAX_NR_ZONES]; void free_area_init_nodes(unsigned long *max_zone_pfn) { enum zone_type i; for (i = 1; i < MAX_NR_ZONES; i++) { if (i == ZONE_MOVABLE) continue; unsigned long _x = max_zone_pfn[i]; unsigned long _y = arch_zone_lowest_possible_pfn[i]; arch_zone_highest_possible_pfn[i] = _x > _y ? _x : _y; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr33122.c ================================================ struct dis386 { const char *x; }; static const struct dis386 float_reg[][2] = { { { "fadd" }, { "fadd" } }, }; void foo(int i, int j) { const struct dis386 *dp; dp = &float_reg[i - 1][j]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr33133.c ================================================ static char newshuffle[256 + 16] = { 0x0f, 0x08, 0x05, 0x07, 0x0c, 0x02, 0x0e, 0x09, 0x00, 0x01, 0x06, 0x0d, 0x03, 0x04, 0x0b, 0x0a, 0x02, 0x0c, 0x0e, 0x06, 0x0f, 0x00, 0x01, 0x08, 0x0d, 0x03, 0x0a, 0x04, 0x09, 0x0b, 0x05, 0x07, 0x05, 0x02, 0x09, 0x0f, 0x0c, 0x04, 0x0d, 0x00, 0x0e, 0x0a, 0x06, 0x08, 0x0b, 0x01, 0x03, 0x07, 0x0f, 0x0d, 0x02, 0x06, 0x07, 0x08, 0x05, 0x09, 0x00, 0x04, 0x0c, 0x03, 0x01, 0x0a, 0x0b, 0x0e, 0x05, 0x0e, 0x02, 0x0b, 0x0d, 0x0a, 0x07, 0x00, 0x08, 0x06, 0x04, 0x01, 0x0f, 0x0c, 0x03, 0x09, 0x08, 0x02, 0x0f, 0x0a, 0x05, 0x09, 0x06, 0x0c, 0x00, 0x0b, 0x01, 0x0d, 0x07, 0x03, 0x04, 0x0e, 0x0e, 0x08, 0x00, 0x09, 0x04, 0x0b, 0x02, 0x07, 0x0c, 0x03, 0x0a, 0x05, 0x0d, 0x01, 0x06, 0x0f, 0x01, 0x04, 0x08, 0x0a, 0x0d, 0x0b, 0x07, 0x0e, 0x05, 0x0f, 0x03, 0x09, 0x00, 0x02, 0x06, 0x0c, 0x05, 0x03, 0x0c, 0x08, 0x0b, 0x02, 0x0e, 0x0a, 0x04, 0x01, 0x0d, 0x00, 0x06, 0x07, 0x0f, 0x09, 0x06, 0x00, 0x0b, 0x0e, 0x0d, 0x04, 0x0c, 0x0f, 0x07, 0x02, 0x08, 0x0a, 0x01, 0x05, 0x03, 0x09, 0x0b, 0x05, 0x0a, 0x0e, 0x0f, 0x01, 0x0c, 0x00, 0x06, 0x04, 0x02, 0x09, 0x03, 0x0d, 0x07, 0x08, 0x07, 0x02, 0x0a, 0x00, 0x0e, 0x08, 0x0f, 0x04, 0x0c, 0x0b, 0x09, 0x01, 0x05, 0x0d, 0x03, 0x06, 0x07, 0x04, 0x0f, 0x09, 0x05, 0x01, 0x0c, 0x0b, 0x00, 0x03, 0x08, 0x0e, 0x02, 0x0a, 0x06, 0x0d, 0x09, 0x04, 0x08, 0x00, 0x0a, 0x03, 0x01, 0x0c, 0x05, 0x0f, 0x07, 0x02, 0x0b, 0x0e, 0x06, 0x0d, 0x09, 0x05, 0x04, 0x07, 0x0e, 0x08, 0x03, 0x01, 0x0d, 0x0b, 0x0c, 0x02, 0x00, 0x0f, 0x06, 0x0a, 0x09, 0x0a, 0x0b, 0x0d, 0x05, 0x03, 0x0f, 0x00, 0x01, 0x0c, 0x08, 0x07, 0x06, 0x04, 0x0e, 0x02, 0x03, 0x0e, 0x0f, 0x02, 0x0d, 0x0c, 0x04, 0x05, 0x09, 0x06, 0x00, 0x01, 0x0b, 0x07, 0x0a, 0x08, }; void newpassencrypt (char *, char *, char *); void newpassencrypt (char *old, char *new, char *out) { char *p, *bx; char copy[8]; int i, di, ax; char cl, dl, ch; for (i = 0; i < 16; i++) { for (bx = old + 7; bx > old; bx--) { *bx = ((bx[-1] >> 4) & 0x0f) | ((*bx) << 4); } for (di = 0; di < 16; di++) { if (newshuffle[di + 0x100] & 1) ch = ((copy[newshuffle[di + 0x100] / 2] >> 4) & 0x0f); else ch = copy[newshuffle[di + 0x100] / 2] & 0x0f; out[di / 2] |= ((di & 1) ? ch << 4 : ch); } memcpy (copy, out, 8); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr33146.c ================================================ typedef struct { int end; int term; } jpc_enc_pass_t; void foo(int numpasses, jpc_enc_pass_t *p) { jpc_enc_pass_t *pass; jpc_enc_pass_t *termpass; for (pass = p; pass != termpass; ++pass) if (!pass->term) { termpass = pass; while (termpass - pass < numpasses && !termpass->term) ++termpass; pass->end = termpass->end; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr33166.c ================================================ static void ConvertAddr (char *saddr, void **addr) { *addr = (void *) &saddr; } void DefineSelf (char *addr) { ConvertAddr (addr, (void **) &addr); if (addr[0] == 127 && addr[3] == 1) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr33173.c ================================================ typedef __SIZE_TYPE__ size_t; typedef struct { } _G_fpos_t; extern int printf (__const char *__restrict __format, ...); extern size_t strlen (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); typedef struct rend_service_descriptor_t { int patchlevel; char status_tag[32]; } tor_version_t; test_dir_format (void) { tor_version_t ver1; { long v2 = (long) (ver1.patchlevel); } { const char *v1 = (""), *v2 = (ver1.status_tag); if (!__extension__ ( { size_t __s1_len, __s2_len; (__builtin_constant_p (v1) && (__s1_len = strlen (v1), __s2_len = (!((size_t) (const void *) ((v1) + 1) - (size_t) (const void *) (v1) == 1) || __s1_len >= 4) && (!((size_t) (const void *) ((v2) + 1) - (size_t) (const void *) (v2) == 1) || __s2_len >= 4)) ? __builtin_strcmp (v1, v2) : (__builtin_constant_p (v1) && ((size_t) (const void *) ((v1) + 1) - __s1_len < 4) ? (__builtin_constant_p (v2) && ((size_t) (const void *) (size_t) (const void *) (v2) == 1) ? __builtin_strcmp (v1, v2) : (__extension__ ( { __const char *__s2 = (__const char *) (v2); register __result = (((__const unsigned char *) (__const char *) (v1))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { } __result;} ))): (__builtin_constant_p (v2) && ((size_t) (const void *) ((v2) + 1) - __s2_len < 4) ? (__builtin_constant_p (v1) && ((size_t) (const void *) 1) ? __builtin_strcmp (v1, v2) : (__extension__ ( { __const char *__s1 = (__const char *) (__const *) (v1); register __result = ((__const unsigned char *) (__const char *) (v2))[0]; if (__s2_len > 0 && __result == 0) { if (__s2_len == 0) { } } __result;} ))): __builtin_strcmp (v1, v2))));} )) { printf ("."); } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr33382.c ================================================ typedef __SIZE_TYPE__ size_t; typedef struct { int disable; char *searchconfig[]; } config_t; typedef struct { void *lng; } arglist_t; config_t config = { .searchconfig = { ((void *) 0)} }; arglist_t arglist[] = { { &config.searchconfig[0]} }; const int arglistsize = ((int) (sizeof(arglist) / sizeof(arglist_t))); void show_configuration(char *arg) { int i; if (!__extension__( { size_t __s1_len, __s2_len; (__builtin_constant_p(arglist[i].lng) && (__s1_len = (!((size_t) (const void *) 1) || __s2_len >= 4)) ? : (__builtin_constant_p(arglist[i].lng) && ((size_t) (const void *) 4) ? (__builtin_constant_p(arg) && ((size_t) (const void *) 1) ? : (__extension__( { __const * __s2 = (__const *) (arg); register __result = (((__const *) (arglist [i]. lng))[0] - __s2[0]); if (__s1_len == 0) { if (__s1_len == 0) { __result = (((__const unsigned char *) (__const char *) (arglist[i]. lng))[3] - __s2[3]);} } __result;} ))): (__builtin_constant_p(arg) ? (__builtin_constant_p (arglist[i].lng) ? : (__extension__( { char __result = ((__const unsigned *) (arg))[0]; if (__s2_len > 0 && __result == 0) { if (__s2_len > 1 && __result == 0) { } } __result;} ))): __builtin_strcmp(arglist[i].lng, arg))));} )) return; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr33614.c ================================================ typedef float V2SF __attribute__ ((vector_size (8))); V2SF foo (int x, V2SF a) { while (x--) a += (V2SF) {1.0f/0.0f - 1.0f/0.0f, 1.0f/0.0f - 1.0f/0.0f}; return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr33617.c ================================================ /* { dg-options "-w -Wno-psabi" { target { i?86-*-* x86_64-*-* } } } */ typedef float V8SF __attribute__ ((vector_size (32))); void bar (V8SF); void foo (float x) { bar ((V8SF) { x, x, x, x, x, x, x, x }); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr33641.c ================================================ /* This failed with type checking enabled. */ typedef enum { one, two } exp; extern exp pe; extern char pt[256]; void psd (void (*f) (void *), void *p); static void rle (void *e) { } void foo (void) { psd ((void (*)(void *)) (rle), (void *) (pt + pe)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr33855.c ================================================ /* Testcase by Martin Michlmayr */ /* Used to segfault due to cselim not marking the complex temp var as GIMPLE reg. */ typedef struct { int nsant, nvqd; _Complex long double *vqd; } vsorc_t; vsorc_t vsorc; void foo(int next_job, int ain_num, int iped, long t) { long double zpnorm; while (!next_job) if (ain_num) { if (iped == 1) zpnorm = 0.0; int indx = vsorc.nvqd-1; vsorc.vqd[indx] = t*1.0fj; if (cabsl(vsorc.vqd[indx]) < 1.e-20) vsorc.vqd[indx] = 0.0fj; zpnorm = t; if (zpnorm > 0.0) iped = vsorc.nsant; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34029-1.c ================================================ static const char s[] = "ab.cd.efghijk"; int foo (const char *x) { const char *a; int b = 0; a = __builtin_strchr (s, '.'); if (a == 0) b = 1; else if ((a = __builtin_strchr (a + 1, '.')) == 0) b = 1; else if (__builtin_strncmp (s, x, a - s)) b = 1; else if (__builtin_strncmp (a + 1, x + (a - s + 1), 4) < 0) b = 1; if (b) return 4; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34029-2.c ================================================ static const char s[] = "ab.cd.efghijk"; static const char t[] = "abcde"; long foo (const char *x) { const char *a; long b = 0; a = __builtin_strchr (s, '.'); return ((long) a) + (1 - (long) t); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34030.c ================================================ int myvar; int foo(int mynum) { if ((((void *)0) == (myvar & ((1U<<0) << mynum))) && (mynum > 0)) return 1; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34091.c ================================================ typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef int GLint; typedef unsigned short GLushort; typedef unsigned int GLuint; typedef float GLfloat; typedef GLushort GLchan; struct gl_texture_image; typedef struct __GLcontextRec GLcontext; typedef void (*FetchTexelFuncC) (const struct gl_texture_image * texImage, GLint col, GLint row, GLint img, GLchan * texelOut); struct gl_texture_format { }; struct gl_texture_image { GLenum _BaseFormat; GLboolean _IsPowerOfTwo; FetchTexelFuncC FetchTexelc; }; struct gl_texture_object { GLenum Target; GLenum WrapS; GLenum MinFilter; GLenum MagFilter; GLint BaseLevel; GLint _MaxLevel; struct gl_texture_image *Image[6][12]; }; enum _format { MESA_FORMAT_RGBA_DXT3, MESA_FORMAT_RGBA_DXT5, MESA_FORMAT_RGBA, MESA_FORMAT_RGB, MESA_FORMAT_ALPHA, MESA_FORMAT_LUMINANCE, }; typedef void (*texture_sample_func) (GLcontext * ctx, const struct gl_texture_object * tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], GLchan rgba[][4]); lerp_2d (GLfloat a, GLfloat b, GLfloat v00, GLfloat v10, GLfloat v01, GLfloat v11) { const GLfloat temp0 = ((v00) + (a) * ((v10) - (v00))); const GLfloat temp1 = ((v01) + (a) * ((v11) - (v01))); return ((temp0) + (b) * ((temp1) - (temp0))); } static __inline__ void lerp_rgba (GLchan result[4], GLfloat t, const GLchan a[4], const GLchan b[4]) { result[0] = (GLchan) (((a[0]) + (t) * ((b[0]) - (a[0]))) + 0.5); result[1] = (GLchan) (((a[1]) + (t) * ((b[1]) - (a[1]))) + 0.5); result[2] = (GLchan) (((a[2]) + (t) * ((b[2]) - (a[2]))) + 0.5); } static __inline__ void lerp_rgba_2d (GLchan result[4], GLfloat a, GLfloat b, const GLchan t00[4], const GLchan t10[4], const GLchan t01[4], const GLchan t11[4]) { result[0] = (GLchan) (lerp_2d (a, b, t00[0], t10[0], t01[0], t11[0]) + 0.5); result[1] = (GLchan) (lerp_2d (a, b, t00[1], t10[1], t01[1], t11[1]) + 0.5); result[2] = (GLchan) (lerp_2d (a, b, t00[2], t10[2], t01[2], t11[2]) + 0.5); } static __inline__ void sample_2d_linear_repeat (GLcontext * ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], GLchan rgba[]) { GLint i0, j0, i1, j1; GLfloat a, b; GLchan t00[4], t10[4], t01[4], t11[4]; { }; img->FetchTexelc (img, i1, j1, 0, t11); lerp_rgba_2d (rgba, a, b, t00, t10, t01, t11); } sample_2d_nearest_mipmap_linear (GLcontext * ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], const GLfloat lambda[], GLchan rgba[][4]) { GLuint i; GLint level = linear_mipmap_level (tObj, lambda[i]); sample_2d_nearest (ctx, tObj, tObj->Image[0][tObj->_MaxLevel], texcoord[i], rgba[i]); GLchan t0[4], t1[4]; sample_2d_nearest (ctx, tObj, tObj->Image[0][level], texcoord[i], t0); sample_2d_nearest (ctx, tObj, tObj->Image[0][level + 1], texcoord[i], t1); } static void sample_2d_linear_mipmap_linear_repeat (GLcontext * ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], const GLfloat lambda[], GLchan rgba[][4]) { GLuint i; for (i = 0; i < n; i++) { GLint level = linear_mipmap_level (tObj, lambda[i]); if (level >= tObj->_MaxLevel) { GLchan t0[4], t1[4]; const GLfloat f = ((lambda[i]) - ifloor (lambda[i])); sample_2d_linear_repeat (ctx, tObj, tObj->Image[0][level], texcoord[i], t0); sample_2d_linear_repeat (ctx, tObj, tObj->Image[0][level + 1], texcoord[i], t1); lerp_rgba (rgba[i], f, t0, t1); } } } static void sample_lambda_2d (GLcontext * ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], GLchan rgba[][4]) { const struct gl_texture_image *tImg = tObj->Image[0][tObj->BaseLevel]; GLuint minStart, minEnd; GLuint magStart, magEnd; const GLboolean repeatNoBorderPOT = (tObj->WrapS == 0x2901) && (tImg->_BaseFormat != 0x1900) && tImg->_IsPowerOfTwo; compute_min_mag_ranges (tObj, n, lambda, &minStart, &minEnd, &magStart, &magEnd); if (minStart < minEnd) { const GLuint m = minEnd - minStart; switch (tObj->MinFilter) { case 0x2600: if (repeatNoBorderPOT) { case MESA_FORMAT_RGB: opt_sample_rgb_2d (ctx, tObj, m, texcoords + minStart, ((void *) 0), rgba + minStart); case MESA_FORMAT_RGBA: opt_sample_rgba_2d (ctx, tObj, m, texcoords + minStart, ((void *) 0), rgba + minStart); } { sample_nearest_2d (ctx, tObj, m, texcoords + minStart, ((void *) 0), rgba + minStart); } break; sample_2d_nearest_mipmap_linear (ctx, tObj, m, texcoords + minStart, lambda + minStart, rgba + minStart); case 0x2703: if (repeatNoBorderPOT) sample_2d_linear_mipmap_linear_repeat (ctx, tObj, m, texcoords + minStart, lambda + minStart, rgba + minStart); } switch (tObj->MagFilter) { case MESA_FORMAT_RGB: opt_sample_rgb_2d (ctx, tObj, m, texcoords + magStart, ((void *) 0), rgba + magStart); opt_sample_rgba_2d (ctx, tObj, m, texcoords + magStart, ((void *) 0), rgba + magStart); sample_nearest_2d (ctx, tObj, m, texcoords + magStart, ((void *) 0), rgba + magStart); } } } texture_sample_func _swrast_choose_texture_sample_func (const struct gl_texture_object *t) { switch (t->Target) { case 0x0DE0: return &sample_lambda_2d; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34093.c ================================================ struct X { int i; int j; }; #define FOO struct X #define FOO10(x) FOO x ## 0; FOO x ## 1; FOO x ## 2; FOO x ## 3; FOO x ## 4; FOO x ## 5; FOO x ## 6; FOO x ## 7; FOO x ## 8; FOO x ## 9; #define FOO100(x) FOO10(x ## 0) FOO10(x ## 1) FOO10(x ## 2) FOO10(x ## 3) FOO10(x ## 4) FOO10(x ## 5) FOO10(x ## 6) FOO10(x ## 7) FOO10(x ## 8) FOO10(x ## 9) FOO100(x0) FOO100(x1) FOO100(x2) FOO100(x3) FOO100(x4) FOO100(x5) FOO100(x6) FOO100(x7) FOO100(x8) FOO100(x9) #define COO(n,f) case n: p = &f; break; #define COO10(n,f) COO(n ## 0, f ## 0) COO(n ## 1, f ## 1) COO(n ## 2, f ## 2) COO(n ## 3, f ## 3) COO(n ## 4, f ## 4) COO(n ## 5, f ## 5) COO(n ## 6, f ## 6) COO(n ## 7, f ## 7) COO(n ## 8, f ## 8) COO(n ## 9, f ## 9) #define COO100(n,f) COO10(n ## 0, f ## 0) COO10(n ## 1, f ## 1) COO10(n ## 2, f ## 2) COO10(n ## 3, f ## 3) COO10(n ## 4, f ## 4) COO10(n ## 5, f ## 5) COO10(n ## 6, f ## 6) COO10(n ## 7, f ## 7) COO10(n ## 8, f ## 8) COO10(n ## 9, f ## 9) int foo(int i) { struct X *p = 0; x000.i = 0; x599.j = 0; switch (i) { COO100(1, x0) COO100(2, x1) COO100(3, x2) COO100(4, x3) COO100(5, x4) COO100(6, x5) COO100(7, x6) COO100(8, x7) COO100(9, x8) COO100(10, x9) } return p->j; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34113.c ================================================ struct sockaddr_in { int sin_addr; }; static void ConvertAddr (struct sockaddr_in *saddr, void **addr) { *addr = (void *) &saddr->sin_addr; } unsigned char EnableLocalHost (struct sockaddr_in *ifa_addr) { unsigned char * addr; ConvertAddr(ifa_addr, (void **)&addr); return addr[0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34127.c ================================================ static void whichtable(char **pfmt) { --*pfmt; } void prepare_s(const char *fmt) { whichtable((char **)&fmt); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34138.c ================================================ extern void free (void *__ptr); struct shparam { char **p; int foo; }; static struct shparam shellparam; inline void freeparam (volatile struct shparam *param, char **ap) { free ((void *) (*ap)); free ((void *) (param->p)); } void dotcmd (char **p) { freeparam (&shellparam, p); } void evaltree (void) { void (*evalfn) (char **); evalfn = dotcmd; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34334.c ================================================ /* { dg-skip-if "ptxas times out" { nvptx-*-* } { "*" } { "-O0" } } */ __extension__ typedef __SIZE_TYPE__ size_t; __extension__ typedef long long int __quad_t; __extension__ typedef unsigned int __mode_t; __extension__ typedef __quad_t __off64_t; typedef __mode_t mode_t; typedef __off64_t off_t; struct timeval {}; typedef struct {} fd_set; typedef union {} __pthread_slist_t; typedef union { struct __pthread_mutex_s { __extension__ union { }; } __data; }; extern int stat64 (__const char *__restrict __file, struct stat64 *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int fstatat64 (int __fd, __const char *__restrict __file, struct stat64 *__restrict __buf, int __flag) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); enum __socket_type { SOCK_STREAM = 1, }; enum { SI_ASYNCNL = -60, }; enum { CLD_EXITED = 1, }; typedef struct sigaltstack { } stack_t; enum __rlimit_resource { __RLIMIT_SIGPENDING = 11, }; struct rlimit { }; enum __priority_which { PRIO_PROCESS = 0, }; typedef union { } __WAIT_STATUS __attribute__ ((__transparent_union__)); union wait { struct { } __wait_stopped; }; typedef enum { P_ALL, } idtype_t; struct utsname { }; enum { IPPROTO_IP = 0, }; enum { IPPORT_ECHO = 7, }; struct in_addr { }; struct in6_addr { union { } in6_u; }; typedef long int wchar_t; typedef unsigned char guint8; typedef signed int gint32; typedef unsigned int guint32; typedef signed int gssize; typedef unsigned int gsize; struct _GStaticMutex { union { } static_mutex; }; union _GSystemThread { }; typedef int GPid; typedef char gchar; typedef int gint; typedef gint gboolean; typedef unsigned short gushort; typedef unsigned long gulong; typedef unsigned int guint; typedef void* gpointer; typedef const void *gconstpointer; typedef gboolean (*GEqualFunc) (gconstpointer a, gconstpointer b); typedef void (*GFunc) (gpointer data, gpointer user_data); typedef void (*GHFunc) (gpointer key, gpointer user_data); struct _GTimeVal { }; typedef struct _GByteArray GByteArray; guint8* g_byte_array_free (GByteArray *array, guint index_); typedef guint32 GQuark; typedef struct _GError GError; GError* g_error_new (GQuark domain, const gchar *message); gboolean g_error_matches (const GError *error, gint code); typedef __builtin_va_list __gnuc_va_list; typedef __gnuc_va_list va_list; typedef enum { G_USER_DIRECTORY_DESKTOP, } GUserDirectory; typedef enum { G_THREAD_PRIORITY_URGENT } GThreadPriority; struct _GThread { }; typedef struct _GCond GCond; struct _GThreadFunctions { void (*cond_wait) (GCond *cond, GError **error); gboolean (*thread_equal) (gpointer thread1, gpointer thread2); }; typedef struct _GAsyncQueue GAsyncQueue; void g_async_queue_sort (GAsyncQueue *queue, guint *save); struct tm { }; typedef struct __locale_struct { } *__locale_t; extern int getaddrinfo (__const char *__restrict __name, struct addrinfo **__restrict __pai); typedef struct _IO_FILE FILE; __strsep_1c (char **__s, char __reject) { } __strsep_2c (char **__s, char __reject1, char __reject2) { } typedef struct stack_st { } STACK; typedef struct asn1_string_st ASN1_BIT_STRING; typedef struct bn_mont_ctx_st BN_MONT_CTX; typedef struct evp_cipher_st EVP_CIPHER; typedef struct EDIPartyName_st { union { } d; } GENERAL_NAME; typedef struct DIST_POINT_NAME_st { union { } name; } DIST_POINT_NAME; typedef struct SXNET_st { } NOTICEREF; typedef struct GENERAL_SUBTREE_st { } X509_PURPOSE; int X509V3_add_value(const char *name, const char *value, STACK **extlist); int X509_PURPOSE_add(int id, int trust, int flags, char *name, char *sname, void *arg); extern char *dcgettext (__const char *__domainname, __const char *__msgid, int __category) __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); enum { __LC_CTYPE = 0, }; struct lconv { }; typedef enum gftp_logging_level_tag { gftp_logging_send, } gftp_logging_level; struct gftp_file_tag { char *file, *destfile; unsigned int selected : 1, is_fd : 1; gint32 ipv4_network_address, ipv4_netmask; } gftp_proxy_hosts; typedef enum { gftp_option_type_text = 0, } gftp_option_type_enum; typedef struct gftp_config_list_vars_tag { } gftp_config_list_vars; typedef struct gftp_config_vars_tag { } gftp_config_vars; typedef struct gftp_option_type_tag { int (*read_function) (char *str, gftp_config_vars * cv, int line); int (*write_function) (gftp_config_vars * cv, char *buf, size_t buflen, int to_config_file); } gftp_option_type_var; typedef struct gftp_request_tag gftp_request; typedef void (*gftp_logging_func) ( gftp_logging_level level, const char *string, ... ); typedef struct gftp_transfer_tag { gftp_request * fromreq, * toreq; unsigned int cancel : 1, skip_file : 1; long numfiles, resumed_bytes; } gftp_transfer; typedef struct gftp_log_tag { unsigned int shown : 1, use_threads : 1; } supported_gftp_protocols; void gftp_config_parse_args (char *str, int numargs, int lineno, char **first, ...) { char *curpos, *endpos, *pos, **dest, tempchar; va_list argp; dest = first; while (numargs > 0) { if (numargs > 1) { dest = __builtin_va_arg(argp,char **); *dest = ((void *)0); } numargs--; **dest = '\0'; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34448.c ================================================ typedef struct chunk_t chunk_t; struct chunk_t { unsigned char *ptr; long unsigned int len; }; extern chunk_t asn1_wrap (chunk_t c, ...); typedef struct linked_list_t linked_list_t; chunk_t ietfAttr_list_encode (linked_list_t * list); extern linked_list_t *groups; static unsigned char ASN1_group_oid_str[] = { 0x06 }; static const chunk_t ASN1_group_oid = { ASN1_group_oid_str, sizeof (ASN1_group_oid_str) }; static chunk_t build_attribute_type (const chunk_t type, chunk_t content) { return type; } static chunk_t build_attributes (void) { return asn1_wrap (build_attribute_type (ASN1_group_oid, ietfAttr_list_encode (groups))); } void build_attr_cert (void) { asn1_wrap (build_attributes ()); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34458.c ================================================ /* Testcase by Martin Michlmayr */ typedef struct { int data[1024]; } Lint; Lint lint_operate (Lint a, long long ammount) { int index; Lint ret; for (index = 0; index < 24; index++) ret.data[index] = a.data[index + ammount / 32 + 1] << a.data[index + ammount / 32]; return ret; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34648.c ================================================ /* PR tree-optimization/34648 */ /* { dg-options "-fexceptions" } */ extern const unsigned short int **bar (void) __attribute__ ((const)); const char *a; int b; char c; char foo (int *x) { char r; c = '\0'; if (!b) { while (((*bar ())[a[*x]] & 0x2000) != 0) (*x)++; if (a[++(*x)] == '-') { (*x)++; if (a[*x] && !((*bar ())[a[*x]] & 0x2000)) return '?'; } if (!a[*x] || ((*bar ())[a[*x]] & 0x2000)) { while (((*bar ())[a[*x]] & 0x2000)) ++(*x); return '\0'; } } r = a[*x]; b = a[*x] && !((*bar ())[a[*x]] & 0x2000); return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34688.c ================================================ typedef __SIZE_TYPE__ size_t; typedef struct { } HashTable; typedef struct _zval_struct zval; typedef struct _zend_guard { HashTable *ht; } zvalue_value; struct _zval_struct { zvalue_value value; } php_output_globals; typedef struct _php_stream php_stream; typedef struct _php_stream_filter php_stream_filter; typedef struct _php_stream_bucket_brigade php_stream_bucket_brigade; typedef enum { PSFS_ERR_FATAL, PSFS_FEED_ME, PSFS_PASS_ON, } php_stream_filter_status_t; typedef struct _php_stream_filter_ops { php_stream_filter_status_t (*filter)( php_stream *stream, php_stream_filter *thisfilter, php_stream_bucket_brigade *buckets_in, php_stream_bucket_brigade *buckets_out, size_t *bytes_consumed, int flags ); void (*dtor)(php_stream_filter *thisfilter ); const char *label; } php_stream_filter_ops; struct _php_stream_filter { }; typedef struct _php_stream_filter_factory { php_stream_filter *(*create_filter)(const char *filtername, zval *filterparams, int persistent ); } php_stream_filter_factory; typedef enum _php_conv_err_t { PHP_CONV_ERR_SUCCESS = 0, PHP_CONV_ERR_UNKNOWN, PHP_CONV_ERR_TOO_BIG, PHP_CONV_ERR_INVALID_SEQ, PHP_CONV_ERR_UNEXPECTED_EOS, PHP_CONV_ERR_EXISTS, PHP_CONV_ERR_MORE, PHP_CONV_ERR_ALLOC, PHP_CONV_ERR_NOT_FOUND } php_conv_err_t; typedef struct _php_conv php_conv; typedef php_conv_err_t (*php_conv_convert_func)(php_conv *, const char **, size_t *, char **, size_t *); struct _php_conv { php_conv_convert_func convert_op; } php_conv_base64_decode; typedef struct _php_conv_qprint_decode { php_conv _super; const char *lbchars; } php_conv_qprint_decode; static php_conv_err_t php_conv_qprint_decode_convert(php_conv_qprint_decode *inst, const char **in_pp, size_t *in_left_p, char **out_pp, size_t *out_left_p) { size_t icnt, ocnt; unsigned char *ps, *pd; unsigned int scan_stat; unsigned int lb_ptr, lb_cnt; for (; ; ) { switch (scan_stat) { case 0: { if (*ps == '=') { scan_stat = 1; } else { if (ocnt < 1) { goto out; } *(pd++) = *ps; ocnt--; } } break; case 1: { if (*ps == ' ' || *ps == '\t') { } else if (!inst->lbchars && lb_cnt == 0 && *ps == '\r') { lb_cnt++; scan_stat = 5; break; } else if (!inst->lbchars && lb_cnt == 0 && *ps == '\n') { scan_stat = 0; break; } } case 2: { if (icnt <= 0) { goto out; } } case 3: { } case 4: { ps++, icnt--; } } } out: *in_pp = (const char *)ps; } static php_conv_err_t php_conv_qprint_decode_ctor(php_conv_qprint_decode *inst, const char *lbchars, size_t lbchars_len, int lbchars_dup, int persistent) { inst->_super.convert_op = (php_conv_convert_func) php_conv_qprint_decode_convert; } typedef struct _php_convert_filter { php_conv *cd; } php_convert_filter; static php_conv *php_conv_open(int conv_mode, const HashTable *options, int persistent) { php_conv *retval = ((void *)0); switch (conv_mode) { case 4: { char *lbchars = ((void *)0); size_t lbchars_len; if (lbchars != ((void *)0)) { if (php_conv_qprint_decode_ctor((php_conv_qprint_decode *)retval, lbchars, lbchars_len, 1, persistent)) { } } } } } static int php_convert_filter_ctor(php_convert_filter *inst, int conv_mode, HashTable *conv_opts, const char *filtername, int persistent) { if ((inst->cd = php_conv_open(conv_mode, conv_opts, persistent)) == ((void *)0)) { } } static php_stream_filter_status_t strfilter_convert_filter( php_stream *stream, php_stream_filter *thisfilter, php_stream_bucket_brigade *buckets_in, php_stream_bucket_brigade *buckets_out, size_t *bytes_consumed, int flags ) { } static void strfilter_convert_dtor(php_stream_filter *thisfilter ) { } static php_stream_filter_ops strfilter_convert_ops = { strfilter_convert_filter, strfilter_convert_dtor, "convert.*" }; static php_stream_filter *strfilter_convert_create(const char *filtername, zval *filterparams, int persistent ) { php_convert_filter *inst; int conv_mode = 0; if (php_convert_filter_ctor(inst, conv_mode, (filterparams != ((void *)0) ? (*filterparams).value.ht : ((void *)0)), filtername, persistent) != 0) { } } static php_stream_filter_factory strfilter_convert_factory = { strfilter_convert_create }; static const struct { php_stream_filter_ops *ops; php_stream_filter_factory *factory; } standard_filters[] = { { &strfilter_convert_ops, &strfilter_convert_factory } }; int zm_startup_standard_filters(int type, int module_number ) { int i; for (i = 0; standard_filters[i].ops; i++) { } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34808.c ================================================ /* PR 34808 */ /* { dg-do compile } /* { dg-options "-fno-tree-dominator-opts" } */ extern int flags; struct r { int code; int val;}; void bar (void); void baz (void); int foo (struct r *home) { int n = 0; int regno = -1; if (home->code == 0) regno = home->val; if (home->code == 1) bar (); else if (regno >= 0) n = (regno == 16 ? 16 : (regno - (unsigned long long) (flags != 0 ? 63 : 15) ? regno - 128 : -1)); baz (); return n; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34856.c ================================================ /* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */ #undef __vector #define __vector __attribute__((vector_size(16) )) typedef __vector signed char qword; typedef __vector unsigned int VU32; extern short g[192 +16]; void f(qword); void f1 (unsigned ctr) { VU32 pin; pin = (VU32){(__SIZE_TYPE__)&g[16]}; do { f((qword)pin); ctr--; } while(ctr); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34885.c ================================================ typedef union { __const struct sockaddr *__restrict __sockaddr__; } __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__)); extern int _pure_socketcall (const struct sockaddr *); extern int sendto (__CONST_SOCKADDR_ARG __addr); int send(void) { return sendto((void *)0); } int sendto(const struct sockaddr *to) { return _pure_socketcall(to); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34966.c ================================================ extern double sin (double), cos (double); __inline double atan (double __x) { register double __result; #if defined(__i386__) || defined(__x86_64__) __asm __volatile__ ("" : "=t" (__result) : "0" (__x)); #else __result = __x; #endif return __result; } double f(double x) { double t = atan (x); return cos (t) + sin (t); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr34993.c ================================================ /* PR c/34993 */ /* { dg-do compile } */ typedef int x[] __attribute((may_alias)); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr35006.c ================================================ /* { dg-require-effective-target alloca } */ typedef unsigned long grub_uint64_t; typedef grub_uint64_t grub_size_t; grub_cmdline_get (unsigned max_len, int echo_char) { unsigned xpos, ypos, ystart; grub_size_t lpos, llen; char buf[max_len]; void cl_print (int pos, int c) { char *p; for (p = buf + pos; *p; p++) { if (xpos++ > 78) grub_putchar ('\n'); grub_putchar (*p); } } void cl_delete (unsigned len) { cl_set_pos (); cl_print (lpos, ' '); grub_memmove (); cl_print (lpos, echo_char); cl_set_pos (); } cl_delete (llen); grub_size_t n = lpos; cl_delete (n); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr35043.c ================================================ typedef __SIZE_TYPE__ size_t; typedef struct { long double dat[2]; } gsl_complex_long_double; typedef struct { size_t size; size_t stride; long double *data; } gsl_vector_complex_long_double; void gsl_vector_complex_long_double_set_zero (gsl_vector_complex_long_double * v) { long double * const data = v->data; const size_t n = v->size; const size_t stride = v->stride; const gsl_complex_long_double zero = { { 0.0L,0.0L} } ; size_t i; for (i = 0; i < n; i++) *(gsl_complex_long_double *) (data + 2 * i * stride) = zero; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr35171.c ================================================ int f(int a, int b, short c, int d, short e) { int i; for (i = 1; i <= 2 ; i++) { c -= 4; a = c; d = d + (b?b:e); } return a + d; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr35318.c ================================================ /* { dg-skip-if "" { pdp11-*-* } { "*" } { "" } } */ /* PR target/35318 */ void foo () { double x = 4, y; __asm__ volatile ("" : "=r,r" (x), "=r,r" (y) : "%0,0" (x), "m,r" (8)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr35431.c ================================================ void bar(); void foo(int i) { __complex__ int k = 0; if (i) k = 1; for (i = 0; i < 1; ++i) ; if (k) bar(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr35432.c ================================================ /* PR middle-end/35432 */ struct A { char c[0]; }; void foo(struct A a) { (a = a).c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr35468.c ================================================ /* PR tree-optimization/35468 */ /* { dg-do compile } */ void foo (void) { *(char *) "c" = 'x'; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr35492.c ================================================ void prepare_to_wait (void *, void *, int); void finish_wait (void *, void *); extern signed long schedule_timeout (signed long); struct sock { unsigned char skc_state; void *sk_sleep; int sk_err; }; void sk_stream_wait_connect (struct sock *sk, long *timeo_p) { int done; int wait; do { if ((1 << sk->skc_state) & ~12) return; prepare_to_wait (sk->sk_sleep, &wait, 1); *(timeo_p) = schedule_timeout (0); done = !sk->sk_err; finish_wait (sk->sk_sleep, &wait); } while (!done); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr35595.c ================================================ /* { dg-require-effective-target int32plus } */ typedef signed int __int32_t; typedef unsigned int __uint32_t; typedef union { float value; __uint32_t word; } ieee_float_shape_type; static const float two23 = 8.3886080000e+06; static const float pi = 3.1415927410e+00; static const float zero = 0.0000000000e+00; static float sin_pif (float x) { float y = 0; float z = 0; __int32_t n = 0; __int32_t ix = 0; do { ieee_float_shape_type gf_u = { 0 }; (ix) = gf_u.word; } while (0); if (z == y) { if (ix < 0x4b800000) { if (ix < 0x4b000000) z = y + two23; do { ieee_float_shape_type gf_u; gf_u.value = (z); (n) = gf_u.word; } while (0); } } if (n == 0) y = __kernel_sinf (pi * y, zero, 0); } float __ieee754_lgammaf_r (float x, int *signgamp) { float t = 0; __int32_t hx = 0; do { ieee_float_shape_type gf_u = { 0 }; (hx) = gf_u.word; } while (0); if (hx < 0) t = sin_pif (x); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr35607.c ================================================ extern void (*__fini_array_start []) (void); extern void (*__fini_array_end []) (void); void __libc_csu_fini (void) { __SIZE_TYPE__ i = __fini_array_end - __fini_array_start; while (i-- > 0) (*__fini_array_start [i]) (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr35760.c ================================================ /* PR target/35760 */ void foo (void) { __complex__ float i = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr35869.c ================================================ struct texture_stage_op { unsigned int carg1, carg2, carg0; unsigned int aarg1, aarg2, aarg0; unsigned int dst; }; static const char *debug_register(unsigned int reg) { switch(reg) { case 0x8921: return "GL_REG_0_ATI"; case 0x8923: return "GL_REG_2_ATI"; case 0x0: return "GL_ZERO"; case 0x1: return "GL_ONE"; default: return "Unknown register\n"; } } static unsigned int find_tmpreg(struct texture_stage_op op[8]) { int i; int tex_used[8]; for(i = 0; i < 8; i++) { if(op[i].carg1 == 0x00000002 ) { tex_used[i] = 1; } } for(i = 1; i < 6; i++) { if(!tex_used[i]) { return 0x8921 + i; } } return 0; } extern f(const char*); void g() { struct texture_stage_op op[8]; unsigned int tmparg = find_tmpreg(op); unsigned int dstreg; if(tmparg == 0x0) return; dstreg = tmparg; f(debug_register(dstreg)); return; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr36125.c ================================================ /* PR middle-end/36125 */ extern void bar (long double *); int foo (long double x) { bar (&x); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr36141.c ================================================ extern void ffi_closure_unix (void); ffi_prep_closure_loc (void) { struct ia64_fd { unsigned long long code_pointer; unsigned long long gp; }; struct ffi_ia64_trampoline_struct { unsigned long long code_pointer; }; struct ffi_ia64_trampoline_struct *tramp; struct ia64_fd *fd; fd = (struct ia64_fd *)(void *)ffi_closure_unix; tramp->code_pointer = fd->code_pointer; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr36154.c ================================================ struct eth_test_pkt { unsigned short len; unsigned short ctr; unsigned char packet[]; } __attribute__ ((packed)); struct eth_test_pkt pkt_unaligned = { .packet = { 0xFC } }; int cmd_unaligned(const void *p) { return memcmp(p, pkt_unaligned.packet, 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr36172.c ================================================ int f(float * ); __SIZE_TYPE__ FcCharSetFreeze (int *fcs, int b) { int i; int a = 0; for (i = 0; i < *fcs; i++) { float *leaf = (float *)fcs; int hash = f (leaf); if (hash) a = b; if (!a) return; } return (__SIZE_TYPE__) fcs; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr36238.c ================================================ typedef signed char int8_t; typedef int int32_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; int32_t g_19 = 0x67F5AEE0L; uint16_t g_169 = 0x89E3L; const volatile uint32_t g_258 = 0x63AFEBCAL; int32_t func_11; int32_t func_29; int32_t func_5 (int32_t p_6, int32_t p_8, uint16_t p_10) { if (lshift_s_s (func_11, p_8)) { int8_t l_18 = 0x6FL; if (l_18) for (p_6 = -14;; g_19 += 6) { int32_t l_283 = -1L; if (((0x45L / 1L) > 0x07414511L * 1L / 1L > func_29) / 1L) for (p_8 = 6;; p_8 -= 5) l_283 = 0xC90541F7L; } } else g_169 = g_258; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr36245.c ================================================ extern char buf1[10]; extern char buf2[10]; extern void b(int i, int j, int w); void a() { int i,j; char *p; int w; p = buf1; for(j = 0;j < 10; j++) { for(i = 0;i < 10; i++) { w = *p; if(w != 1) { w = buf2[p - buf1]; b(i*2+1, j, w); } p++; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr36666.c ================================================ struct Foo { int *p; struct X { int a,b,c,d,e,*f; } x; } *init, *init2; struct X __attribute__((const)) foo(struct X); struct Foo __attribute__((const)) foo2(struct Foo); void bar1 (void) { init->x = foo (init2->x); } void bar2 (void) { init->x = foo (init->x); } void bar3 (void) { *init = foo2 (*init2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr36817.c ================================================ void xxx() { unsigned i; unsigned *p=0; for(i=0; i<4; ++i) *p++=0; for(i=0; i<4; ++i) *p++=0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr36988.c ================================================ typedef struct { unsigned char mbxCommand; } MAILBOX_t; void lpfc_sli_brdrestart(void) { volatile unsigned int word0; MAILBOX_t *mb; mb = (MAILBOX_t *) &word0; mb->mbxCommand = 0x1A; __writel((*(unsigned int *) mb)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37026.c ================================================ struct a { long a1; long a2; }; struct b { struct a b1; struct a b2; }; void bar (struct b *c) { c->b1 = c->b2 = ((struct a) { foo(), 0 }); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37056.c ================================================ /* { dg-skip-if "ptxas times out" { nvptx-*-* } { "-O2" "-Os" } { "" } } */ extern void abort (void); static union { char buf[12 * sizeof (long long)]; } u; int main () { int off, len, i; char *p, *q; for (off = 0; off < (sizeof (long long)); off++) for (len = 1; len < (10 * sizeof (long long)); len++) { for (i = 0; i < (12 * sizeof (long long)); i++) u.buf[i] = 'a'; p = (__extension__ (__builtin_constant_p ('\0') && ('\0') == '\0' ? ({void *__s = (u.buf + off); __s;}) : __builtin_memset (u.buf + off, '\0', len))); if (p != u.buf + off) abort (); for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37078.c ================================================ int foo (int b) { if (b == (int)0x80000000) return __builtin_abs (b); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37207.c ================================================ void func_18 ( int t ) { unsigned l_889; int l_895 = 1; for (0; 1; ++l_889) { int t1 = 0; if (func_81 (1)) { int rhs = l_895; if (rhs == 0) rhs = 1; if (1 & (t % rhs)) t1 = 1; } func_98 (t1); l_895 = 0; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37258.c ================================================ /* { dg-require-effective-target untyped_assembly } */ typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; __extension__ typedef long long int int64_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; static inline unsigned int lshift_u_s (unsigned int left, int right) { if ((right) || (right >= sizeof (unsigned int) * 8) || (left > (4294967295U >> right))) return left; } static inline unsigned long int div_rhs (long int rhs) { if (rhs == 0) return 1; return rhs; } uint32_t g_230; int8_t g_294; uint16_t g_316; uint32_t g_334; int32_t g_375; int64_t g_380; int32_t func_99 (int16_t p_100, int32_t p_101, int32_t p_102, int32_t p_103, int64_t p_105, int32_t p_106, int32_t p_107, int16_t p_108, int16_t p_109); int32_t func_77 (int64_t p_79) { int16_t l_397; if (mod_rhs (p_79)) p_79 = 1; else for (p_79 = 0; 0; p_79 += 1) { } if (lshift_s_s (1, func_112 (2L, (lshift_u_s (g_334, p_79))))) { int8_t l_384; int64_t l_414; if (lshift_u_s (g_375, 1)) { func_23 (func_99 (1, 1, 1, 1, g_230, p_79, 1, g_334, 1), 1); for (p_79 = 0; 0; ++p_79) { } } if (div_rhs (func_82 (1, 1, g_380, 1, l_397, 1, 1))) func_99 ((func_82 (1, g_334, g_294, func_112 (1, (p_79 & 1)), g_316, 1, 1)), 1, (0xFBA25CA382A8CA74LL), l_384, l_414, 0L, 1, 1, 1); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37285.c ================================================ _bfd_xcoff_canonicalize_dynamic_reloc (unsigned long long l_symndx) { if (l_symndx < 3) { switch (l_symndx) { case 0: case 1: break; case 2: _bfd_abort ("HI"); } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37305.c ================================================ typedef int int32_t; typedef unsigned int uint32_t; static inline int safe_add_s_s (int si1, int si2) { if ((si1 > 0) && (si2 > 0) && (si1 > (si2)) || (si1 < 0) && (si2 < 0) && (si1 < ((-__INT_MAX__ - 1) - si2))) return si1; } uint32_t g_8; uint32_t func_24 (int32_t p_25) { uint32_t l_30 = -1L; if ((safe_mod_u_u (1, 1)) | (safe_add_s_s (g_8, l_30))) return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37327.c ================================================ /* { dg-require-effective-target untyped_assembly } */ typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; static inline uint32_t safe_add_int8_t_s_s (int8_t si1, int16_t si2) { if ((si1) && (si2) && (si1 > (1 - si2)) || (si1) && (si2 < 0) && (si1 < (-128 - si2))) return si1; return si1 + si2; } uint32_t g_2; uint32_t g_113; uint32_t g_145; int32_t func_17 (int32_t p_18, uint32_t p_19, uint32_t p_21) { uint32_t l_23 = -1L; return l_23; } uint32_t func_26 (uint16_t p_27) { uint32_t l_424; if (func_93 (func_59 (safe_add_int8_t_s_s (p_27, 1))), func_124 (l_424, -7L, 1, g_145, 1, (safe_add_int8_t_s_s (1, 1)), 1), 1, 1, 1) func_117 (1, 1, (safe_add_uint64_t_u_u (1, (safe_add_int8_t_s_s (1, 0xCDF4BE7A1B7E4629LL)))), 1); uint32_t l_210; if (func_17 ((safe_add_int8_t_s_s (g_2, (0x6C79A83AL | func_17 (1, 1, 1)))), 0x4C9FL, 1)) { uint32_t l_212; if (safe_mul_int32_t_s_s ((1, 1, l_212, (1, (safe_add_int8_t_s_s (l_210, 1)), 1, 1)), 1)) if (func_59 (1, (safe_add_int8_t_s_s (g_113, 1)))) { } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37341.c ================================================ /* PR rtl-optimization/37341 */ short int a; int b; static inline int f1 (int x, int y) { if (x < 0 || y < 0 || y >= sizeof (int) * 8 || x > (1 >> y)) return x; } static inline unsigned int f2 (int x, int y) { if (y <= 0 && x && y < __INT_MAX__ / x) return x; return x * y; } int f3 (void) { return (signed char) 0xb6; } unsigned int f4 (unsigned int x) { while (1) { if ((f2 (f3 (), (f1 (a, b)))) < x) return 1; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37380.c ================================================ typedef struct basic_block_def *basic_block; typedef struct gimple_seq_node_d *gimple_seq_node; typedef struct gimple_seq_d *gimple_seq; typedef struct { gimple_seq_node ptr; gimple_seq seq; basic_block bb; } gimple_stmt_iterator; typedef void *gimple; extern void exit(int); struct gimple_seq_node_d { gimple stmt; struct gimple_seq_node_d *next; }; struct gimple_seq_d { }; static __inline__ gimple_stmt_iterator gsi_start (gimple_seq seq) { gimple_stmt_iterator i; i.seq = seq; return i; } static __inline__ unsigned char gsi_end_p (gimple_stmt_iterator i) { return i.ptr == ((void *)0); } static __inline__ void gsi_next (gimple_stmt_iterator *i) { i->ptr = i->ptr->next; } static __inline__ gimple gsi_stmt (gimple_stmt_iterator i) { return i.ptr->stmt; } void c_warn_unused_result (gimple_seq seq) { gimple_stmt_iterator i; for (i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i)) { gimple g = gsi_stmt (i); if (!g) exit(0); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37381.c ================================================ extern unsigned int __invalid_size_argument_for_IOC; typedef unsigned int __u32; struct video_window { __u32 x, y; __u32 width, height; }; typedef unsigned long XID; typedef XID Window; typedef struct _XExtData { Window root; } Screen; typedef struct { int border_width; } XWindowAttributes; typedef struct _XDisplay Display; typedef struct { int default_screen; Screen *screens; } *_XPrivDisplay; typedef struct { int x, y; } XSizeHints; typedef struct { unsigned short hdisplay; unsigned short vdisplay; } XF86VidModeModeInfo; Display *display; int tfd; int ccapt; int tml; int fswidth = 0; int fsheight = 0; Window fmwin; XF86VidModeModeInfo **modelines, *fullscreenmode = ((void *) 0); struct video_window vswin; DoFullScreen (void) { int i; int rx, ry; Window junkwin; XSizeHints fmsizehints; XWindowAttributes fmwinattr; if (ioctl (tfd, (((1U) << (((0 + 8) + 8) + 14)) | ((('v')) << (0 + 8)) | (((8)) << 0) | (((((sizeof (int) == sizeof (int[1]) && sizeof (int) < (1 << 14)) ? sizeof (int) : __invalid_size_argument_for_IOC))) << ((0 + 8) + 8))), &ccapt) < 0) { perror ("ioctl VIDIOCCAPTURE"); } if (!XTranslateCoordinates (display, fmwin, ((&((_XPrivDisplay) display)-> screens[(((_XPrivDisplay) display)->default_screen)])->root), -fmwinattr.border_width, -fmwinattr.border_width, &rx, &ry, &junkwin)) { } vswin.width = fswidth; vswin.height = fsheight; vswin.x = fmsizehints.x + rx; vswin.y = fmsizehints.y + ry; if (ioctl (tfd, (((1U) << (((0 + 8) + 8) + 14)) | ((('v')) << (0 + 8)) | (((8)) << 0) | (((((sizeof (int) == sizeof (int[1]) && sizeof (int) < (1 << 14)) ? sizeof (int) : __invalid_size_argument_for_IOC))) << ((0 + 8) + 8))), &ccapt) < 0) { XF86VidModeGetAllModeLines (display, XDefaultScreen (display), &tml, &modelines); { if ((modelines[i]->hdisplay == fswidth) && (modelines[i]->vdisplay == fsheight)) { fullscreenmode = modelines[i]; } } { XF86VidModeSetViewPort (display, XDefaultScreen (display), vswin.x, vswin.y); } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37382.c ================================================ /* PR target/37382 */ void baz (char *); int c; void bar (void) { char a[2]; int *ip = &c; char *p = a, *q = (char *) &ip; const char *r = q + 2; for (; q != r; p++, q++) *p = *q; baz (a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37387.c ================================================ typedef long int Int; void FuncMakeConsequencesPres (long *objDefs1) { long a = (long)objDefs1; int c = a & 0x01; int b = 0; if (! ( 13 <= ( c ? 0 : (((int) objDefs1 & 0x02) ? 0 : *objDefs1 )) && b <= 0)) ErrorQuit (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37395.c ================================================ /* PR target/37395 */ int f (int j) { int i; asm volatile ("" : "=r"(i)); if (i >= 0) j = 0; return j; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37418-1.c ================================================ typedef void ft(int); void f(int args)__attribute__((noreturn)); void f2(ft *p __attribute__((noreturn))) { p = f; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37418-2.c ================================================ typedef void ft(int); volatile ft f; void f2(ft *p __attribute__((noreturn))) { p = f; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37418-3.c ================================================ typedef void ft(int); void f(int args)__attribute__((const)); void f2(ft *p __attribute__((const))) { p = f; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37418-4.c ================================================ typedef void ft(int); const ft f; void f2(ft *p __attribute__((const))) { p = f; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37432.c ================================================ static void print_wkb_byte(unsigned char val) { print_wkb_bytes((unsigned char *)&val, 1, 1); } void InsertMultiPoint(int b) { char a = 1; if (b) a = 0; print_wkb_byte(a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37433-1.c ================================================ void regex_subst(void) { const void *subst = ""; (*(void (*)(int))subst) (0); } void foobar (void) { int x; (*(void (*)(void))&x) (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37433.c ================================================ int regex_subst(void) { const void *subst = ""; return (*(int (*)(int))subst) (0); } int foobar (void) { int x; return (*(int (*)(void))&x) (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37483.c ================================================ /* PR target/37483 */ unsigned long long foo (unsigned count, int i) { unsigned long long value; if (i == 0) value = (value & 0xFFFFFFFF) >> count; return value; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37617.c ================================================ typedef union { char *string; double dval; float fval; } yystype; char *f(void) { yystype tok; tok.dval = 0; return (tok.string); } char *f1(void) { yystype tok; tok.fval = 0; return (tok.string); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37662.c ================================================ /* PR tree-optimization/37662 */ extern int baz (void); static int foo (void) { return 1; } int bar (void) { return foo () >= 1 ^ (baz () || 0) || 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37664.c ================================================ /* PR tree-optimization/37664 */ int v; int foo () { int a = 0x8899A862; int b = 0x8E * a; int c = (b % b); if (v > (4294967295U >> c)) return v; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37669-2.c ================================================ /* PR middle-end/37669 */ #define FMT10 "%d%d%d%d%d%d%d%d%d%d" #define FMT100 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 #define FMT1000 FMT100 FMT100 FMT100 FMT100 FMT100 \ FMT100 FMT100 FMT100 FMT100 FMT100 #define ARG10 , i, i, i, i, i, i, i, i, i, i #define ARG100 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10 #define ARG1000 ARG100 ARG100 ARG100 ARG100 ARG100 \ ARG100 ARG100 ARG100 ARG100 ARG100 void foo (char *s, int i, int j) { __builtin___snprintf_chk (s, i, 1, j, FMT1000 ARG1000); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37669.c ================================================ /* This testcase used to fail because a miscompiled execute_fold_all_builtins. */ /* { dg-options "-fgnu89-inline" } */ typedef __SIZE_TYPE__ size_t; extern __inline __attribute__ ((__always_inline__)) int __attribute__ ((__nothrow__)) snprintf (char *__restrict __s, size_t __n, __const char *__restrict __fmt, ...) { return __builtin___snprintf_chk (__s, __n, 2 - 1, __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ()); } int n1, n2, n3, n4, f5, f6; char * BackgroundGetUniqueString(void) { char s[256]; const char *chmap = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_"; snprintf(s, sizeof(s), "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", chmap[(n1 >> 0) & 0x3f], chmap[(n1 >> 6) & 0x3f], chmap[(n1 >> 12) & 0x3f], chmap[(n1 >> 18) & 0x3f], chmap[(n1 >> 24) & 0x3f], chmap[(n1 >> 28) & 0x3f], chmap[(n2 >> 0) & 0x3f], chmap[(n2 >> 6) & 0x3f], chmap[(n2 >> 12) & 0x3f], chmap[(n2 >> 18) & 0x3f], chmap[(n2 >> 24) & 0x3f], chmap[(n2 >> 28) & 0x3f], chmap[(n3 >> 0) & 0x3f], chmap[(n3 >> 6) & 0x3f], chmap[(n3 >> 12) & 0x3f], chmap[(n3 >> 18) & 0x3f], chmap[(n3 >> 24) & 0x3f], chmap[(n3 >> 28) & 0x3f], chmap[(n4 >> 0) & 0x3f], chmap[(n4 >> 6) & 0x3f], chmap[(n4 >> 12) & 0x3f], chmap[(n4 >> 18) & 0x3f], chmap[(n4 >> 24) & 0x3f], chmap[(n4 >> 28) & 0x3f], chmap[(f5 >> 12) & 0x3f], chmap[(f5 >> 18) & 0x3f], chmap[(f5 >> 24) & 0x3f], chmap[(f5 >> 28) & 0x3f], chmap[(f6 >> 0) & 0x3f], chmap[(f6 >> 6) & 0x3f] ); return __builtin_strdup(s); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37713.c ================================================ void add_opush(void) { unsigned char formats[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0xff }; void *dtds[sizeof(formats)]; unsigned int i; unsigned char dtd = 0x08; for (i = 0; i < sizeof(formats); i++) dtds[i] = &dtd; sdp_seq_alloc(dtds); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37742-3.c ================================================ void matmul_i4 (int * __restrict dest_y, const int * __restrict abase, const int * __restrict bbase_y, int count, int xcount, int ycount, int aystride) { int x, y, n; const int * __restrict abase_n; int bbase_yn; for (y = 0; y < ycount; y++) for (n = 0; n < count; n++) { abase_n = abase + n*aystride; bbase_yn = bbase_y[n]; for (x = 0; x < xcount; x++) dest_y[x] += abase_n[x] * bbase_yn; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37742.c ================================================ void foo(int* __restrict__ p, int* q, int* p1, int *q1) { int i; p = p1; q = q1; for (i = 0; i < 4; ++i) *++q = *++p + 1; } void bar(int* p, int* __restrict__ q, int* p1, int *q1) { int i; p = p1; q = q1; for (i = 0; i < 4; ++i) *++q = *++p + 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37878.c ================================================ /* PR target/37878 */ double y, z; void foo (long x) { y = *(double *) ((long *) (x - 1) + 1); z = *(double *) ((long *) (x - 1) + 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37913.c ================================================ /* PR middle-end/37913 */ void foo (void) __attribute__ ((noreturn)); static int __attribute__ ((noreturn)) bar (void) { foo (); } void baz (void) { int i = bar (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37955.c ================================================ typedef struct { enum { NotConnected = 0 } conn_state; unsigned int conn_hndl; } AEP_CONNECTION_ENTRY; static AEP_CONNECTION_ENTRY aep_app_conn_table[256]; void aep_mod_exp (void) { int count; for (count = 0; count < 256; count++) { aep_app_conn_table[count].conn_state = NotConnected; aep_app_conn_table[count].conn_hndl = 0; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37976.c ================================================ void percent_x(int ch, char *p, char* ok_chars) { char *cp = ch == 'a' ? p : ""; for (;*(cp += __builtin_strspn (cp, ok_chars));) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr37991.c ================================================ typedef int Int32; void use_it(int); void FindAndReadSignature(int processedSize) { int numPrevBytes = 1; for (;;) { int numBytesInBuffer = numPrevBytes + processedSize; Int32 numTests = numBytesInBuffer - 1; use_it (numTests); numPrevBytes = numBytesInBuffer - numTests; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38123.c ================================================ /* PR target/38123 */ #include struct S { int i; double d; }; struct S test (char *x, va_list ap) { struct S s; s = va_arg (ap, struct S); return s; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38343-2.c ================================================ /* PR middle-end/38343 */ static struct S { char f[6]; } s[] = { {"01000"} }; char * foo (void) { return __builtin_stpcpy (s[0].f, "S0022"); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38343.c ================================================ /* PR middle-end/38343 */ static struct A { char f[6]; } a[] = { {"01000"} }; void foo (void) { __builtin_stpcpy (a[0].f, "S0022"); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38359.c ================================================ unsigned _ov_64_seek_lap (_Bool x1, _Bool x2, _Bool x3) { unsigned ltmp_3978_7__PHI_TEMPORARY; signed ltmp_4011_7; if (!x1 || !x2) while (1) ; if (x3) ltmp_3978_7__PHI_TEMPORARY = 0xffffff7e; else ltmp_3978_7__PHI_TEMPORARY = 1; ltmp_4011_7 = -1; return ltmp_4011_7 >> ltmp_3978_7__PHI_TEMPORARY; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38360.c ================================================ /* PR middle-end/38360 */ /* { dg-require-effective-target untyped_assembly } */ int main () { fputs (""); fputs_unlocked (""); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38428.c ================================================ /* PR middle-end/38428 */ struct S { volatile struct { unsigned int t : 1; } s; }; int foo (struct S *x) { int ret; if (x->s.t) ret = 0; else ret = 10; return ret; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38505.c ================================================ /* PR middle-end/38505 */ /* { dg-do compile } */ struct S { unsigned short a[50]; unsigned short b[20]; }; extern void bar (struct S *); extern void baz (unsigned short *); extern unsigned short d[]; void foo (void) { struct S s; unsigned short g[50]; baz (g); __builtin_memcpy (&s, g, sizeof (g)); __builtin_memcpy (s.b, d, sizeof (s.b)); bar (&s); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38554.c ================================================ typedef unsigned long sample; struct pam { sample maxval; }; typedef sample *tuple; enum function { FN_MULTIPLY, FN_DIVIDE, FN_ADD, FN_SUBTRACT, FN_MIN, FN_MAX, FN_AND, FN_OR, FN_XOR, FN_NOT, FN_SHIFTLEFT, FN_SHIFTRIGHT }; struct cmdlineInfo { enum function function; union { float divisor; unsigned int shiftCount; } u; }; applyFunction (struct cmdlineInfo const cmdline, struct pam const inpam, struct pam const outpam, tuple * const inputRow, tuple * const outputRow) { float const oneOverDivisor = 1 / cmdline.u.divisor; int col; { int plane; { sample const inSample = inputRow[col][plane]; sample outSample; switch (cmdline.function) { case FN_DIVIDE: outSample = ((unsigned int) ((inSample * oneOverDivisor) + 0.5)); break; case FN_SHIFTLEFT: outSample = (inSample << cmdline.u.shiftCount) & outpam.maxval; } outputRow[col][plane] = ((outpam.maxval) < (outSample) ? (outpam.maxval) : (outSample)); } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38564.c ================================================ struct S { struct S *n, *p; } *s; void bar (void *); int foo (int x) { struct S p = { &p, &p }; int i; for (i = 0; i < x; i++) bar (s); return p.n == &p; } int dialog_calendar(int state) { int *obj = (state == 1 ? &state : 0); return (obj == &state); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38590-1.c ================================================ int func_75 (int p_76) { return (1 / (int) -(unsigned int)p_76); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38590-2.c ================================================ int func_75 (int p_76) { return (1 / (int) -(unsigned int)p_76) ? 1 : p_76; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38621.c ================================================ /* PR target/38621 */ struct s { char a[512]; int b; int c; }; long long foo (struct s *p, int m, int r) { if (r == m) p->b = 3; p->c = 1; return m; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38661-1.c ================================================ /* We used to ICE because we would wrap INT_MAX into INT_MIN while doing the switch converison. */ const char *func(int val) { switch (val) { case - __INT_MAX__ -1 : return "foo"; default: return ""; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38661.c ================================================ /* We used to ICE because we would wrap INT_MAX into INT_MIN while doing the switch converison. */ const char *func(int val) { switch (val) { case __INT_MAX__: return "foo"; default: return ""; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38752.c ================================================ typedef struct { int baddr; } mstruct_t; static struct { unsigned int mapnum; mstruct_t unused; } mtab; static mstruct_t *mactab = &mtab.unused; int main(void) { int i; int addr; for (i=1; i <= mtab.mapnum; i++) if (addr < mactab[i].baddr) break; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38771.c ================================================ /* PR middle-end/38771 */ unsigned long long foo (long long x) { return -(unsigned long long) (x ? : x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38789.c ================================================ /* PR tree-optimization/38789 */ /* { dg-do compile } */ void baz (int v) { unsigned a = (v == 1) ? 1 : 2; if (__builtin_constant_p (a)) asm volatile ("# constant %0" :: "i" (a)); else asm volatile ("# register %0" :: "r" (a)); a = 6; if (__builtin_constant_p (a)) asm volatile ("# constant %0" :: "i" (a)); else asm volatile ("# register %0" :: "r" (a)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38807.c ================================================ /* PR tree-optimization/38807 */ int baz (short x) { return x; } int a, b; int bar (int x) { if (baz (a ^ x ^ a)) return b; return 0; } int foo (void) { return bar (a == 0 || 1 == 1 - a) ? 1 : bar (1 && a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38857.c ================================================ static const int vs_total_ac_bits = 2680; typedef struct EncBlockInfo { short mb[64]; unsigned char next[64]; } EncBlockInfo; inline void dv_guess_qnos(EncBlockInfo* blks, int* qnos) { int size[5]; int j, k, a, prev; EncBlockInfo* b; for(a=2; a==2 || vs_total_ac_bits < size[0]; a+=a){ for (j=0; j<6*5; j++, b++) { for (k= b->next[prev]; k<64; k= b->next[k]) { if(b->mb[k] < a && b->mb[k] > -a){ b->next[prev] = b->next[k]; } else{ prev = k; } } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr38926.c ================================================ static inline int foo (unsigned _si1) { if (_si1 != 0) if (_si1 > 2147483647) return 1; return 0; } static inline unsigned bar (unsigned _left, int _right) { return (unsigned) _right >= 8 ? 1 : _left >> _right; } unsigned g_2; unsigned g_67; volatile unsigned g_162; static inline int func_62 (unsigned p_63) { p_63 = g_2 & g_67; if (g_2) ; else if (p_63) return 1; g_67 = bar (p_63, g_2); return 0; } unsigned baz (void) { if (g_2) for (; g_2 <= -16; g_2 = foo (g_2)) { for (; g_162; g_162) func_62 (func_62 (0)); if (g_67) break; } return g_2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39041.c ================================================ int test_bit(int nr, void *addr) { int *a = (int *)addr; int mask; a += nr; mask = 1 << nr; return mask & *a; } struct { struct { int disabled; } *data[1]; } trace; struct { unsigned bits[1]; } cpumask; void inc(int *); void dec(int *); int foo(void) { int cpu; for (cpu = 0; cpu < 1; cpu++) { if (test_bit(cpu, cpumask.bits)) inc(&trace.data[cpu]->disabled); if (!test_bit(cpu, cpumask.bits)) dec(&trace.data[cpu]->disabled); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39202.c ================================================ typedef struct { union { int * aaa; } u; } t_a; typedef struct { unsigned bbb : 1; } t_b; typedef struct { int ccc; t_a ddd; t_b eee; int fff; } t_c; typedef struct t_d { t_c f1; t_c f2; } t_d; void foo (void) { t_d ggg; ggg.f1 = ggg.f2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39360.c ================================================ /* PR middle-end/39360 */ static int a[] = { 1 }; static inline void bar (int **x) { static int *c[2] = { 0, a }; *x = c[1]; } int foo (int **x) { bar (x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39394.c ================================================ /* PR tree-optimization/39394 */ char *p; int x; static inline void f1 (int n) { asm volatile ("" : "=m" (*(struct { char x[n]; } *) p)); } static inline void f2 (void) { x ? f1 (1) : f1 (2); } static inline void f3 (void) { f2 (); } void f4 (void) { f3 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39423-1.c ================================================ /* PR target/39423 */ /* { dg-skip-if "ptxas times out" { nvptx-*-* } { "-O2" } { "" } } */ int foo (const char *name, int nmlen, char *flags) { const char *nonspc; int len, n, lfn; int needlfn[2], dotspc[2]; unsigned char locale[2]; for (nonspc = &name[nmlen - 1]; nonspc >= name && *nonspc == ' '; ++n) { if (!nmlen) { needlfn[name >= nonspc] = !0, dotspc[n != 0] = locale[0], --n, name += len, nmlen -= len; } } if (!lfn && ((dotspc[0] == ' ' && !(len & 0x0010)) || dotspc[0] == '.')) return 22; if (!(needlfn[0] || needlfn[1])) *flags |= 0x02; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39423-2.c ================================================ /* PR target/39423 */ typedef unsigned short uint16_t; typedef struct { short x, y; } P; typedef struct { uint16_t w, h; } D; typedef struct { P p; D s; } A; typedef struct { uint16_t f; } W; typedef struct { void* w; D s; } T; extern void* foo00 (void*, void*); void foo01 (W* w) { void* it; uint16_t c, i; T* cl; T* rs; T* t; uint16_t rh = 0; uint16_t v = !(w->f & 0x8000); A a = { }; for (c = 0, it = foo00 (w, 0); it; it = foo00 (w, it), c++); for (it = foo00 (w, 0), i = 0; i <= c; it = foo00 (w, it), i++, cl++) { if (i) for (t = rs; t < cl; t++) *((uint16_t*)&t->s + ((!v) ? 1 : 0)) = rh; rh = (rh > ((*((uint16_t*)&a.s + ((!v) ? 1 : 0))))) ? rh : ((*((uint16_t*)&a.s + ((!v) ? 1 : 0)))); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39614-1.c ================================================ typedef struct page { unsigned long flags; } mem_map_t; static inline void set_page_zone(struct page *page, unsigned long zone_num) { page->flags &= ~(~0UL << (64 - 8)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39614-2.c ================================================ int i; void f (void) { i = (1 / 0) / 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39614-3.c ================================================ int i; void f (void) { i = (1 ? 1 / 0 : 1 / 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39614-4.c ================================================ int i; void f (void) { i = (1 / 0 ? 1 : 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39614-5.c ================================================ /* { dg-do compile } */ /* { dg-options "-w -std=c99" } */ int i; void f (void) { i = (1 / 0, 1 / 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39636.c ================================================ typedef float real; typedef real rvec[3]; void calc_dx2dx(real *, real *); void phi_sr(int nj,rvec x[],int k) { int i,j; for(i=0; (i>= 0xdebecced; return v1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39824.c ================================================ static const double internalEndianMagic = 7.949928895127363e-275; static const unsigned char ieee_754_mantissa_mask[] = { 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; static inline int trio_isnan (double number) { int has_mantissa = 0; unsigned int i; unsigned char current; for (i = 0; i < (unsigned int)sizeof(double); i++) { current = ((unsigned char *)&number)[(((unsigned char *)&internalEndianMagic)[7-(i)])]; has_mantissa |= (current & ieee_754_mantissa_mask[i]); } return has_mantissa; } void xmlXPathEqualNodeSetFloat(int nodeNr, double v) { int i; for (i=0; ifunction_decl.function_code)) { case BUILT_IN_ISFINITE: case BUILT_IN_FPCLASSIFY: type_generic_remove_excess_precision = 1; } for (parmnum = 0;; ++parmnum) if (((enum tree_code) (val)->base.code) == EXCESS_PRECISION_EXPR && !type_generic_remove_excess_precision) val = ((val)->exp.operands[0]); return val; } tree build_function_call_vec (tree function) { return convert_arguments (function); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39886.c ================================================ /* PR middle-end/39886 */ int foo (int); volatile unsigned char g; void bar (int p) { char l = 0xE1; func ((foo ((p & g) <= l), 1)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39928-1.c ================================================ /* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */ typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); extern __m128 _mm_sub_ps (__m128 __A, __m128 __B); extern __m128 _mm_mul_ps (__m128 __A, __m128 __B); __m128 vq_nbest(const __m128 *codebook, __m128 d, __m128 in) { return _mm_sub_ps(d, _mm_mul_ps(in, *codebook++)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39928-2.c ================================================ typedef _Complex float __m128; extern __m128 _mm_sub_ps (__m128 __A, __m128 __B); extern __m128 _mm_mul_ps (__m128 __A, __m128 __B); __m128 vq_nbest(const __m128 *codebook, __m128 d, __m128 in) { return _mm_sub_ps(d, _mm_mul_ps(in, *codebook++)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39937.c ================================================ int foo (__const char *__restrict __s); static void read_anisou(char line[]) { foo (line+1); } void read_pdbfile(void) { char line[4096]; read_anisou (line); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39941.c ================================================ typedef void (*entry_func) (void) __attribute__ ((noreturn)); extern entry_func entry_addr; static void bsd_boot_entry (void) { stop (); } void bsd_boot (void) { entry_addr = (entry_func) bsd_boot_entry; (*entry_addr) (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39943.c ================================================ void gl_fog_index_pixels(float f, unsigned int n, unsigned int index[]) { unsigned int i; for (i=0; ip = (int*)c[0]; y->p = (int*)a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr39999.c ================================================ void foo(void *); void MMAPGCD (int *A1, int *A2) { int *t; do { t = A1; A1 = A2; A2 = t; } while (A2[-1]); foo (A1-1); foo (A2-1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40023.c ================================================ typedef __builtin_va_list va_list; typedef struct { va_list ap; } ScanfState; void GetInt(ScanfState *state, long llval) { *__builtin_va_arg(state->ap,long *) = llval; __builtin_va_end(state->ap); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40026.c ================================================ typedef struct { unsigned long bits; } S; struct T { S span; int flags; }; struct T f(int x) { return (struct T) { .span = (S) { 0UL }, .flags = (x ? 256 : 0), }; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40035.c ================================================ typedef __SIZE_TYPE__ size_t; void *memmove (void *dest, const void *src, size_t count); size_t strlen (const char *s); int foo (char *param, char *val) { if (val) { if (val == param + strlen (param) + 1) val[-1] = '='; else if (val == param + strlen (param) + 2) { val[-2] = '='; memmove (val - 1, val, strlen (val) + 1); val--; } } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40080.c ================================================ extern void *ff(void*,int); struct lpgl { struct lpgl *next; }; struct lpgd { struct lpgl *first; }; typedef int (*xfn)( ); static void xDP_IF_EnumGroupsInGroup ( void *a, int b, xfn fn) { struct lpgd *lpGData; struct lpgl *lpGList; if( ( lpGData = ff( a, b ) ) == ((void *)0) ) return; if( lpGData->first == ((void *)0) ) return; lpGList = lpGData->first; for( ;; ) { if( !(*fn)( ) ) return; if( lpGList->next == ((void *)0) ) break; lpGList = lpGList->next; } return; } static int xcbDeletePlayerFromAllGroups() { xDP_IF_EnumGroupsInGroup(0, 0, 0); return 1; } void xDP_IF_EnumGroups( xfn fn) { xDP_IF_EnumGroupsInGroup( 0, 0, fn); } static void xDP_IF_DestroyPlayer () { xDP_IF_EnumGroups( xcbDeletePlayerFromAllGroups); } void* foo=xDP_IF_DestroyPlayer; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40204.c ================================================ /* { dg-require-effective-target int32plus } */ /* PR middle-end/40204 */ struct S { unsigned int a : 4; unsigned int b : 28; } s; char c; void f (void) { s.a = (c >> 4) & ~(1 << 4); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40233.c ================================================ typedef int aligned __attribute__((aligned(64))); struct Frame { aligned i; }; void foo(struct Frame *p) { aligned *q = &p->i; *q = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40252.c ================================================ typedef unsigned int uint32_t; static void IP(uint32_t v[2]) { v[0] = ((v[0] << 1) | ((v[0] >> 31) & 1L)) & 0xffffffffL; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40291.c ================================================ /* PR middle-end/40291 */ int foo (void *x, char *y, unsigned long long z) { return memcmp (x, y, z); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40321.c ================================================ struct X { int flag; int pos; }; int foo(struct X *a, struct X *b) { while (1) { if (a->flag) break; ({ struct X *tmp = a; a = b; b = tmp; }); } return a->pos + b->pos; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40351.c ================================================ /* PR tree-optimizations/40351 */ struct IO_APIC_route_entry { unsigned int vector : 8; unsigned int delivery_mode : 1; unsigned int mask : 1; unsigned int __reserved_2 : 15; unsigned int __reserved_3 : 8; } __attribute__ ((packed)); union entry_union { struct { unsigned int w1, w2; }; struct IO_APIC_route_entry entry; }; unsigned int io_apic_read(void); struct IO_APIC_route_entry ioapic_read_entry(void) { union entry_union eu; eu.w1 = io_apic_read(); return eu.entry; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40432.c ================================================ /* Test that SRA produces valid gimple when handling both type punning by means of VCE and creating an access to a union. */ union U { struct something *sth; void *nothing; }; void foo (union U *target, void *p) { union U u; u.nothing = p; *target = u; return; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40556.c ================================================ struct A {}; struct A foo() { return foo(); } void bar() { foo(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40570.c ================================================ extern void anything(int); static int foo(int i); static int bar(int i) { foo(i); } extern int j; static int foo(int i) { if (j) anything(j); return bar(i); } int baz() { foo(0); if (baz()) return 1; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40582.c ================================================ struct A { void* q; short i; }; union U { char* p; struct A a; }; struct A foo(union U u) { struct A a = { 0, 0 }; a = u.a; return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40640.c ================================================ void decode_opic_address(int *); void sim_io_printf_filtered2 (int, unsigned); void hw_opic_io_read_buffer(int index) { unsigned reg = 0; decode_opic_address(&index); switch (index) { case 0: reg = 1; } sim_io_printf_filtered2 (index, reg); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40676.c ================================================ extern int f1(); extern int f2(void*); extern void* f3(int); int xmsih; typedef unsigned short XWCHAR; inline unsigned int xstrlenW( const XWCHAR *str ) { const XWCHAR *s = str; while (*s) s++; return s - str; } static int msi_dialog_register_class( void ) { int cls; if( !f2( &cls ) ) return 0; if( !f2( &cls ) ) return 0; xmsih = f1(); if( !xmsih ) return 0; return 1; } void *xmsi_dialog_create(const XWCHAR* szDialogName) { msi_dialog_register_class(); return f3(xstrlenW(szDialogName)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40692.c ================================================ /* PR middle-end/40692 */ #define M1(x) (((x) & 0x00000002) ? 0x2 : ((x) & 0x1)) #define M2(x) (((x) & 0x0000000c) ? M1 ((x) >> 2) << 2 : M1 (x)) #define M3(x) (((x) & 0x000000f0) ? M2 ((x) >> 4) << 4 : M2 (x)) #define M4(x) (((x) & 0x0000ff00) ? M3 ((x) >> 8) << 8 : M3 (x)) #define M5(x) (((x) & 0xffff0000) ? M4 ((x) >> 16) << 16 : M4 (x)) struct A { char e; char f; }; long foo (void) { return M5 (4096UL - (long) &((struct A *) 0)->f); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40753.c ================================================ typedef struct { unsigned nargs; } ffi_cif; typedef struct { char tramp[24]; ffi_cif *cif; } ffi_closure; extern void *memcpy (void *, const void *, __SIZE_TYPE__); extern void ffi_closure_LINUX64 (void); int ffi_prep_closure_loc (ffi_closure *closure, ffi_cif *cif) { void **tramp = (void **) &closure->tramp[0]; memcpy (tramp, (char *) ffi_closure_LINUX64, 16); closure->cif = cif; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40797.c ================================================ typedef struct str { short x, y;} S; static short bar (short ch, short sl, short sr, short tl, short tr) { return 0; } void foo (short ch, S *pi, short nc, S *po) { short clo, chi, lo, hi; po->x = bar (ch, clo, chi, pi[lo].x, pi[hi].x); po->y = bar (ch, clo, chi, pi[lo].y, pi[hi].y); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr40964.c ================================================ struct alloc2 { int bla; char * __restrict data; char * __restrict data2; }; struct alloc2 b; void * f (void) { return b.data; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41006-1.c ================================================ typedef int (*FARPROC)(); typedef int (*LPFN_ACCEPTEX)(void*); static LPFN_ACCEPTEX acceptex_fn; int xWSAIoctl(void*); static void get_fn(FARPROC* fn) { FARPROC func; if (!xWSAIoctl( &func)) *fn = func; } void get_fn_pointers() { get_fn((FARPROC*)&acceptex_fn); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41006-2.c ================================================ typedef int *FARPROC; static int * __restrict__ acceptex_fn; int xWSAIoctl(void*); static void get_fn(FARPROC* fn) { FARPROC func; if (!xWSAIoctl( &func)) *fn = func; } void get_fn_pointers() { get_fn((FARPROC*)&acceptex_fn); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41016.c ================================================ typedef struct _IO_FILE FILE; void CompareRNAStructures (FILE * ofp, int start, int L, char *ss_true, char *ss) { int i; float agree = 0.; float pairs = 0.; float pairs_true = 0.; for (i = 0; i < L; i++) { pairs_true += 1.; agree += 1.; } if (((int) pairs % 2 != 0) || ((int) pairs_true % 2 != 0) || ((int) agree % 2 != 0)) Die ("Error in CompareRNAStrutures(); odd number of paired nucleotides\n"); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41101.c ================================================ int func(int); void bug(int* x, int* y, unsigned long int N) { unsigned long int i; int* t; while (1) { for (i=1; i<=N; i++) { y[i] = func(x[i] - x[1]); if (y[i]) return; } t=x; x=y; y=t; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41163.c ================================================ struct option { void *value; }; void parse_options (struct option *); void cmd_grep(void) { struct option options[] = { { &options } }; parse_options(options); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41181.c ================================================ /* { dg-require-effective-target ptr32plus } */ /* { dg-skip-if "The array is too big" { "avr-*-*" "pdp11-*-*" } { "*" } { "" } } */ char paths[1024]; static void x264_slicetype_path(char (*best_paths)[250], int n, int length) { __builtin_memcpy (best_paths[n], paths, length); } void x264_slicetype_analyse(int n, int length) { char best_paths[250][250]; x264_slicetype_path (best_paths, n, length); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41182-1.c ================================================ typedef long unsigned int size_t; int _lae_process_opts(char *pr, char *pe) { return (strlen ("on") < ((size_t) ((pe-&pr[2])>(strlen("on")) ? (pe-&pr[2]) : (strlen("on"))))); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41282.c ================================================ struct S { unsigned int iu; }; union U { struct S s; signed int is; }; extern signed int bar (); struct S foo (void) { union U u; u.is = bar (); return u.s; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41469.c ================================================ /* { dg-options "-fexceptions" } */ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ void af (void *a) { } void bf (void) { int i = 1; char v[i]; af (v); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41634.c ================================================ extern int _xgetw(); extern int foo(char*); void test_readmode( int ascii_mode ) { static const char outbuffer[] = "0,1,2,3,4,5,6,7,8,9\r\n\r\nA,B,C,D,E\r\nX,Y,Z"; char buffer[2*512 +256]; int i, j, ao; unsigned int fp; foo(buffer); for (i=0, j=0; i<6; i++) { if (ao==0 || outbuffer[fp-3+i] != '\r') buffer[j++] = outbuffer[fp-3+i]; } _xgetw(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41646.c ================================================ /* PR rtl-optimization/41646 */ struct A { unsigned long a; }; struct B { unsigned short b, c, d; }; struct B bar (unsigned long); char * foo (char *a, struct A *x) { struct B b = bar (x->a); unsigned char c; unsigned short d; a[3] = ((unsigned char) (b.b % 10) + 48); d = b.b / 10; a[2] = ((unsigned char) (d % 10) + 48); d = d / 10; a[1] = ((unsigned char) (d % 10) + 48); a[0] = ((unsigned char) ((d / 10) % 10) + 48); a[4] = 46; c = (unsigned char) b.c; a[6] = (c % 10 + 48); a[5] = ((c / 10) % 10 + 48); a[7] = 46; c = b.d; a[9] = (c % 10 + 48); a[8] = ((c / 10) % 10 + 48); return a + 10; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41661.c ================================================ /* PR tree-optimization/41661 */ /* { dg-do compile } */ /* { dg-options "-fno-early-inlining" } */ int g; void foo (int x) { g = x; } void bar (double d) { foo (d == 1); } void baz (int a) { bar (1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41679.c ================================================ /* { dg-options "-g" } */ extern int a; extern char b; extern int foo (void); void test (void) { int c; b = foo () ? '~' : '\0'; while ((c = foo ())) if (c == '7') a = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41728.c ================================================ int a[8]; int s244(void) { int lrc, j; lrc = 0; for (j=0; j<7; j++) if(a[j] != a[j+1]) lrc = 1; if (lrc != 0) return 0; return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr41987.c ================================================ /* PR tree-optimization/41987 */ #define TESTIT(TYPE) do { \ _Complex TYPE ylm; \ TYPE nbond; \ ylm = 0; \ nbond = 0; \ ylm = ylm / nbond; \ } while (0) void qparm_colvar(void) { TESTIT (float); TESTIT (double); TESTIT (long double); TESTIT (char); TESTIT (short); TESTIT (int); TESTIT (long); TESTIT (long long); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42025-1.c ================================================ typedef void* Ptr; struct A { int i; union { Ptr p; char *q; } u; }; static void foo(struct A *p, char *q) { if (p->i) p->u.p = 0; else p->u.q = q; } void bar(struct A *p, char *q) { foo(p, q); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42025-2.c ================================================ typedef struct { void *p; } Ptr; struct A { int i; union { Ptr p; char *q; } u; }; extern Ptr get_stuff (void); extern void use_stuff (char *); static void foo(struct A p, char *q) { if (p.i) p.u.p = get_stuff (); else p.u.q = q; use_stuff (p.u.q); } void bar(struct A *p, char *q) { foo(*p, q); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42049.c ================================================ /* PR middle-end/42049 */ extern char *strcpy (char *s1, const char *s2); struct S { char s[4]; }; int foo (int x, char **y) { char const *a; char const *b; struct S s[9]; long i; if (x > 1) a = y[1]; else a = "abc"; if (x > 2) b = y[2]; else b = "def"; strcpy (s[0].s, a); strcpy (s[1].s, b); for (i = 2; i < x - 2 && i < 8; i++) strcpy (s[i].s, y[i + 1]); s[i].s[0] = '\0'; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42164.c ================================================ typedef struct { unsigned long long pte; } pte_t; pte_t mk_swap_pte (unsigned long offset) { pte_t pte; pte.pte = (offset << 40); return pte; } int pte_file (pte_t pte) { return pte.pte & (1 << 4); } typedef struct { unsigned long val; } swp_entry_t; pte_t swp_entry_to_pte (swp_entry_t entry) { swp_entry_t arch_entry; arch_entry = (swp_entry_t){mk_swap_pte (swp_offset (entry)).pte}; __BUG_ON ((unsigned long) pte_file ((pte_t) {arch_entry.val})); return (pte_t) {arch_entry.val}; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42196-1.c ================================================ union U { double d; __complex__ int c; }; double gd; extern double bar (union U); double foo (int b, double d, int c1, int c2) { union U u; double r; if (b) { u.d = d; r = u.d; } else { __real__ u.c = c1; __imag__ u.c = c2; r = bar (u); } return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42196-2.c ================================================ union U { __complex__ int ci; __complex__ float cf; }; float gd; extern float bar (union U); float foo (int b, double f1, double f2, int c1, int c2) { union U u; double r; if (b) { __real__ u.cf = f1; __imag__ u.cf = f2; } else { __real__ u.ci = c1; __imag__ u.ci = c2; } r = bar (u); return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42196-3.c ================================================ union U { __complex__ int ci; __complex__ float cf; }; float gd; extern float bar (float, float); float foo (int b, union U u) { float f1, f2, r; if (b) { f1 = __real__ u.cf; f1 = __imag__ u.cf; } else { f1 = __real__ u.ci; f1 = __imag__ u.ci; } r = bar (f1, f2); return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42234.c ================================================ /* { dg-options "-g" } */ void foo (int x) { struct S { int s; } d = { 1 }; unsigned int e = 1; if (x) e = x && d.s; else for (e = 0; e <= 3; e--) ; e++; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42237.c ================================================ struct A { int p; }; struct B { struct A n; struct A m; int x; int y; int z; }; extern int g1, g2; static void __attribute__((noinline)) foo (struct B *b) { int t; t = b->n.p; g1 = t; b->n.p = t+1; g2 = b->m.p; b->m = b->n; } void bar (struct B *b) { foo (b); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42299.c ================================================ /* { dg-options "-g" } */ void bar (void); static int foo (int x, int y) { if (y) goto lab; if (x) y = 0; if (y) goto lab; y = 0; lab: return y; } void baz (int x, int y) { y = foo (x, y); if (y != 0) bar (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42347.c ================================================ /* PR bootstrap/42347 */ long foo (long x, long y) { x = x & y; switch (y) { case 63L: x >>= 0; break; case 4032L: x >>= 6; break; case 258048L: x >>= 12; break; case 16515072L: x >>= 18; break; default: __builtin_unreachable (); } return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42398.c ================================================ int ptrace_setregs(void) { union { unsigned int l; int t; } __gu_tmp; __asm__ __volatile__("" : "=r" (__gu_tmp.l)); return __gu_tmp.t; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42559.c ================================================ /* { dg-require-effective-target label_values } */ void jumpfunc(int copy, void *p) { void *l = &&jumplabel; if (copy) __builtin___memcpy_chk (p, l, 128, __builtin_object_size (p, 0)); jumplabel: return; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42632.c ================================================ static inline __attribute__((always_inline)) int __pskb_trim(void) { return ___pskb_trim(); } static inline __attribute__((always_inline)) int pskb_trim(void) { return __pskb_trim(); } int ___pskb_trim(void) { pskb_trim(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42703.c ================================================ __extension__ typedef unsigned long long int uint64_t; typedef uint64_t ScmUInt64; void swapb64(ScmUInt64 *loc) { union { ScmUInt64 l; unsigned char c[4]; } dd; unsigned char t; dd.l = *loc; (t = dd.c[3], dd.c[3] = dd.c[4], dd.c[4] = t); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42705.c ================================================ typedef int GLint; typedef unsigned char GLubyte; typedef unsigned int uint32_t; struct radeon_bo { void *ptr; uint32_t flags; }; struct radeon_renderbuffer { struct radeon_bo *bo; unsigned int cpp; int has_surface; }; static inline GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb, GLint x, GLint y, GLint is_depth, GLint is_stencil) { GLint element_bytes = rrb->cpp; GLint num_samples = 1; GLint tile_width = 8; GLint tile_height = 8; GLint tile_thickness = 1; GLint tile_bytes; GLint tiles_per_row; GLint slice_offset; GLint tile_row_index; GLint tile_column_index; GLint tile_offset; GLint pixel_number = 0; GLint element_offset; GLint offset = 0; tile_bytes = tile_width * tile_height * tile_thickness * element_bytes * num_samples; tile_column_index = x / tile_width; tile_offset = ((tile_row_index * tiles_per_row) + tile_column_index) * tile_bytes; if (is_depth) { } else { GLint sample_offset; switch (element_bytes) { case 1: pixel_number |= ((x >> 0) & 1) << 0; } element_offset = sample_offset + (pixel_number * element_bytes); } offset = slice_offset + tile_offset + element_offset; return offset; } GLubyte *r600_ptr_color(const struct radeon_renderbuffer * rrb, GLint x, GLint y) { GLubyte *ptr = rrb->bo->ptr; uint32_t mask = 1 | 2; GLint offset; if (rrb->has_surface || !(rrb->bo->flags & mask)) { offset = r600_1d_tile_helper(rrb, x, y, 0, 0); } return &ptr[offset]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42708-1.c ================================================ typedef __SIZE_TYPE__ size_t; void *malloc(size_t); typedef union YYSTYPE { char *id; } YYSTYPE; extern YYSTYPE yylval; void yylex (int b) { yylval = (YYSTYPE) (b ? 0 : (char *) malloc (4)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42716.c ================================================ static short foo (long long si1, short si2) { return si1 > 0 && si2 > 0 || si1 < 0 && si2 < 0 && si1 < 1 - si2 ? : si1 + si2; } int g_13; unsigned g_17; int safe (int, int); void bar (short p_51, short * p_52) { int *const l_55 = &g_13; if (safe (*p_52, g_13 != foo (*p_52 & *l_55 == g_13 && g_17 >= 1, 0))) { } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42717.c ================================================ /* { dg-xfail-if "ptxas crashes" { nvptx-*-* } { "-O0" } { "" } } */ static signed char foo (signed char si1, unsigned char si2) { return (si1 ^ si2) & (-si2 ^ si2) ? : si1 - si2; } struct S0 { }; unsigned char g_21; struct S0 g_34; void bar (unsigned char p_20) { unsigned char *l_22 = &g_21; unsigned char l_23 = 0; struct S0 *l = &g_34; goto lbl_42; for (; l_23; l_23 = foo (l_23, 1)) { for (p_20 = 0; 0; p_20 = foo (p_20, 1)) lbl_42:; (l == &g_34) ? 0 : ""; lbl_85:*l_22 = p_20; } goto lbl_85; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42730.c ================================================ union bzz { unsigned *pa; void *pv; }; void foo (void) { union bzz u; void **x; void *y = 0; x = &u.pv; *x = y; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42749.c ================================================ struct pdf_object { int val; }; int pdf_count_size_object (struct pdf_object * p_obj) { return pdf_count_size_object(p_obj) + 2 * sizeof(struct pdf_object); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42927.c ================================================ typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); typedef enum { READ_SHARED = 0, WRITE_EXCLUSIVE = 1, READ_EXCLUSIVE = 2, EXCLUSIVE_ACCESS = 3 } scsires_access_mode; struct scsires_extent_elem { scsires_access_mode mode; unsigned relative_address; u_int32_t first_block; u_int32_t length; }; typedef struct scsires_extent_elem scsires_extent_elem_t; struct scsires_extent { u_int8_t num_elements; scsires_extent_elem_t *elements; }; typedef struct scsires_extent scsires_extent_t; unsigned char buf[512]; void scsires_issue_reservation(scsires_extent_t * new_extent) { int i; for (i = 0; i < new_extent->num_elements; i++) { buf[(i * 8)] = new_extent->elements[i].mode; buf[(i * 8) + 1] = ((new_extent->elements[i].length >> 16) & 0xff); buf[(i * 8) + 2] = ((new_extent->elements[i].length >> 8) & 0xff); buf[(i * 8) + 3] = (new_extent->elements[i].length & 0xff); buf[(i * 8) + 4] = ((new_extent->elements[i].first_block >> 24) & 0xff); buf[(i * 8) + 5] = ((new_extent->elements[i].first_block >> 16) & 0xff); buf[(i * 8) + 6] = ((new_extent->elements[i].first_block >> 8) & 0xff); buf[(i * 8) + 7] = (new_extent->elements[i].first_block & 0xff); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42956.c ================================================ /* { dg-require-effective-target alloca } */ typedef const int cint; typedef struct { } Bounds; int ndim_, ncomp_, selectedcomp_, nregions_; void *voidregion_; typedef struct { double diff, err, spread; } Errors; typedef const Errors cErrors; void Split(int iregion, int depth, int xregion) { typedef struct { double avg, err, spread, chisq; double xmin[ndim_], xmax[ndim_]; } Result; typedef struct region { Result result[ncomp_]; } Region; Errors errors[ncomp_]; int comp, ireg, xreg; for( ireg = iregion, xreg = xregion; ireg < nregions_; ireg = xreg++ ) { Result *result = ((Region *)voidregion_)[ireg].result; for( comp = 0; comp < ncomp_; ++comp ) { Result *r = &result[comp]; cErrors *e = &errors[comp]; double c = e->diff; if( r->err > 0 ) r->err = r->err*e->err + c; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr42998.c ================================================ void foo(void *); void bar(void *); void ndisc_fill_addr_option(unsigned char *opt, int data_len, unsigned short addr_type) { int pad; if (addr_type == 32) pad = 2; else pad = 0; __builtin_memset(opt + 2, 0, pad); opt += pad; __builtin_constant_p(data_len) ? foo (opt+2) : bar (opt+2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43066.c ================================================ struct S { struct { } empty[1]; int i; }; int foo(int i, ...) { struct S s; __builtin_va_list va; __builtin_va_start(va, i); s = __builtin_va_arg(va, struct S); __builtin_va_end(va); return s.i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43164.c ================================================ struct S0 { unsigned char f0; int:0; }; struct S1 { struct S0 f0; }; struct S1 func_34 (void) { struct S1 l_221 = { { 1 } }; return l_221; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43186.c ================================================ int n; void foo (int i) { int a, b; if (!i) for (a = 1; a < 4; a++) if (a) for (b = 1; b < 3; b++) foo (b); n++; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43188.c ================================================ int *__attribute__((__aligned__(16))) *p; int main (void) { return **p; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43191.c ================================================ /* { dg-require-effective-target int32plus } */ struct S0 { }; struct S1 { unsigned f0:27; const unsigned:0; }; struct S2 { unsigned f2:1; }; unsigned char g_4[1][8][3][1][1][1]; unsigned char *g_17; unsigned char **g_16[1][10][7]; struct S2 g_35 = { 0 }; struct S2 *g_34 = &g_35; struct S1 func_86 (unsigned char p_87, struct S2 **p_89) { struct S1 l_92[6][8][1][1] = { 16143586 } ; return l_92[0][0][0][0]; } void func_28 (struct S1 p_30, const struct S1 p_32) { } void func_70 (unsigned char p_72) { unsigned char *const *l_93 = &g_17; struct S2 **l_94; unsigned char *const *l_97 = &g_17; func_28 (func_86 (p_72, 0), func_86 (p_72, &g_34)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43255.c ================================================ int safe (int); static unsigned foo (unsigned ui1, unsigned ui2) { return ui1 + ui2; } int g_22; int *volatile g_23 = &g_22; int **g_282[8][10][1]; int *g_330 = &g_22; volatile unsigned g_348; int g_397; void int32func (const unsigned char p_10) { if (foo (~ (p_10 | (*g_282[(unsigned long) g_397 % 8][(unsigned) g_22 % 10][g_348 % 1]) == (*g_282[(unsigned long) g_397 % 8][(unsigned) g_22 % 10][g_348 % 1])), 1)) { } else if (*g_330 >= safe (*g_23 ^ (**g_282[(unsigned long) g_397 % 8][(unsigned) g_22 % 10] [g_348 % 1])) & **g_282[8][10][1], 1) { } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43288.c ================================================ static int a __attribute__ ((common)); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43367.c ================================================ unsigned char g_17; const unsigned char func_39 (unsigned char p_40, unsigned char * p_41) { return 0; } void int327 (const unsigned char p_48, unsigned char p_49) { unsigned l_52; unsigned char l_58[2]; int i, j; if (func_39 (l_52, &p_49), p_48) { unsigned char *l_60; unsigned char *l = &l_58[1]; for (j; j; j++) { lbl_59: break; } for (l = 0; 1; l += 1) { for (p_49 = 1; p_49; p_49 += 0) { unsigned char **l_61[1][6]; for (j = 0; j < 1; j++) l_61[i][j] = &l_60; goto lbl_59; } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43415.c ================================================ int main() { unsigned long long table[256]; unsigned int i; for (i=0; i<256; ++i) { unsigned long long j; unsigned char x=i; for (j=0; j<5; ++j) { x += x<<1; x ^= x>>1; } for (j=0; j<5; ++j) { x += x<<1; x ^= x>>1; } for (j=0; j<5; ++j) { x += x<<1; x ^= x>>1; } for (j=0; j<5; ++j) { x += x<<1; x ^= x>>1; } for (j=0; j<5; ++j) { x += x<<1; x ^= x>>1; } table[i] ^= (((unsigned long long)x)<<16); } for (i=0; i<256; ++i) { if ((table[i]&0xff)==i) return 1; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43417.c ================================================ int pid_count = 0; unsigned int getopt (int, const char**, const char*); unsigned long long atoll (const char*); int fork (void); void kill (int, int); int main (int argc, const char *argv[]) { unsigned int c; unsigned long long maxbytes = 0; extern const char *optarg; int i; int pid_cntr; int pid; int pid_list[1000]; while ((c = getopt (argc, argv, "c:b:p:wvh")) != (-1)) { switch ((char) c) { case 'b': maxbytes = atoll (optarg); } } pid = fork (); while ((pid != 0) && (maxbytes > 1024 * 1024 * 1024)) { maxbytes = maxbytes - (1024 * 1024 * 1024); pid = fork (); if (pid != 0) pid_cntr++; pid_list[i] = pid; } while ((pid_count < pid_cntr)) { } kill (pid_list[i], 9); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43614.c ================================================ volatile int g_2[7]; void foo (unsigned); int main (void) { int i_459 = 0; int t2818; int t2819; volatile char *t2820; int t2821; volatile char *t2822; int *t2823; unsigned t2824; LL655: t2822 = (volatile char *)g_2; t2821 = i_459; t2820 = t2822 + t2821; t2823 = (int *)t2820; t2824 = *t2823; foo (t2824); t2818 = i_459; t2819 = t2818 + 1; i_459 = t2819; goto LL655; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43635.c ================================================ /* { dg-require-effective-target untyped_assembly } */ extern void d (void); void (*foo (void)) (float) { void (*(*x) (void)) (float) = d; return (*x) (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43636.c ================================================ /* PR target/43636 */ extern char a[], *b[]; char * foo (char *x, int y) { x = __builtin_stpcpy (x, b[a[y]]); return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43661.c ================================================ int func (int x) { return 0 ? (unsigned short) (0 ? : 1 * (signed char) (x ^ x) >= 0) : 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43679.c ================================================ unsigned g_5; int g_7; int g_23[2]; int *g_29 = &g_23[0]; int **g_59; unsigned long g_186; int foo (int, int); int bar (int); void func_37 (long p_38) { int *l_39 = &g_7; *l_39 = (*l_39 || (foo (((*g_29 != *l_39, ((bar (g_59 != &l_39), 0), 0))), 0))); foo (*l_39, 0); int **l_256 = &l_39; { for (0; g_186; 0) { *l_256 = *l_256; if (g_5) goto lbl_270; *l_39 &= 0; } } lbl_270: ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43791.c ================================================ int owner(); int clear(); static void fixup() { clear(); } inline __attribute__ ((always_inline)) void slowtrylock(void) { if (owner()) fixup(); } void fasttrylock(void (*slowfn)()) { slowfn(); } void trylock(void) { fasttrylock(slowtrylock); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr43845.c ================================================ typedef int __attribute__ ((const)) (*x264_pixel_cmp_t)(void); typedef struct { x264_pixel_cmp_t ssd; } x264_pixel_function_t; int x264_pixel_ssd_wxh (x264_pixel_function_t *pf, int i_width) { int i_ssd = 0, x; for (x = 0; x < i_width; x++) i_ssd += pf->ssd(); return i_ssd; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44030.c ================================================ typedef int int32_t; typedef unsigned int uint32_t; static uint32_t safe_sub_func_uint32_t_u_u (uint32_t ui1, uint32_t ui2) { return ui1 - ui2; } int32_t l_105[7]; int32_t g_4; int32_t *g_54 = &g_4; int32_t * func (int32_t p_73, int32_t * p_74, int32_t p_75, int32_t * *p_76, int32_t * *p_77) { lbl_110:for (g_4 = 0; g_4; g_4 = 1) { } for (p_75 = -28; p_75; p_75 = safe_sub_func_uint32_t_u_u (p_75, 1)) { if (g_4) goto lbl_110; *g_54 = 0; } return &l_105[5]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44038.c ================================================ struct Ustr { char data[1]; }; int ustr_xi__embed_val_get(char *); inline static int ustr_len(struct Ustr *s1) { return ustr_xi__embed_val_get(s1->data); } static struct Ustr *s1 = ((struct Ustr *) ""); int tst(char *cstr) { return ustr_len(s1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44043.c ================================================ typedef unsigned char __u8; typedef unsigned short __u16; typedef unsigned int __u32; typedef unsigned long __kernel_size_t; typedef __kernel_size_t size_t; typedef __u8 uint8_t; typedef __u16 __be16; typedef __u32 __be32; struct msghdr { struct iovec * msg_iov; unsigned msg_flags; }; enum { IPPROTO_ICMP = 1 }; struct sk_buff { }; static inline __attribute__((always_inline)) struct dst_entry * skb_dst(const struct sk_buff *skb) { }; enum nf_inet_hooks { NF_INET_LOCAL_OUT }; struct net_device { unsigned mtu; }; static inline __attribute__((always_inline)) int NF_HOOK_THRESH(uint8_t pf, unsigned int hook, struct sk_buff *skb, struct net_device *in, struct net_device *out, int (*okfn)(struct sk_buff *), int thresh) { int ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, thresh); if (ret == 1) ret = okfn(skb); return ret; } static inline __attribute__((always_inline)) int NF_HOOK(uint8_t pf, unsigned int hook, struct sk_buff *skb, struct net_device *in, struct net_device *out, int (*okfn)(struct sk_buff *)) { return NF_HOOK_THRESH(pf, hook, skb, in, out, okfn, (-((int)(~0U>>1)) - 1)); } struct dst_entry { struct net_device *dev; int (*output)(struct sk_buff*); }; static inline __attribute__((always_inline)) int dst_output(struct sk_buff *skb) { return skb_dst(skb)->output(skb); }; struct iphdr { __u8 protocol; }; struct inet_sock { __be16 inet_dport; __u8 recverr: 1, hdrincl: 1; struct { } cork; }; struct icmphdr { __u8 type; }; struct rtable { union { struct dst_entry dst; } u; __be32 rt_dst; }; struct sock; struct inet_sock *inet_sk (struct sock *); struct net *sock_net (struct sock *); void *skb_transport_header (struct sk_buff *); static int raw_send_hdrinc(struct sock *sk, void *from, size_t length, struct rtable *rt, unsigned int flags) { struct inet_sock *inet = inet_sk(sk); struct net *net = sock_net(sk); struct iphdr *iph; struct sk_buff *skb; if (length > rt->u.dst.dev->mtu) ip_local_error(sk, 90, rt->rt_dst, inet->inet_dport, rt->u.dst.dev->mtu); if (flags&0x10) goto out; if (iph->protocol == IPPROTO_ICMP) icmp_out_count(net, ((struct icmphdr *)skb_transport_header(skb))->type); NF_HOOK(2, NF_INET_LOCAL_OUT, skb, ((void *)0), rt->u.dst.dev, dst_output); out: while (0); } int raw_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) { raw_send_hdrinc(sk, msg->msg_iov, len, (void *)0, msg->msg_flags); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44063.c ================================================ typedef signed char int8_t; typedef short int16_t; typedef unsigned char uint8_t; typedef unsigned int uint32_t; union unaligned_32 {uint32_t l;} __attribute__((packed)) __attribute__((may_alias)); static inline uint32_t NEG_USR32(uint32_t a, int8_t s){return a << (32 - s);} typedef struct GetBitContext { const uint8_t *buffer, *buffer_end; int index;}GetBitContext; typedef struct VLC {int16_t (*table)[2];} VLC; static __attribute__((always_inline)) inline int get_vlc2(GetBitContext *s, int16_t (*table)[2], int bits, int max_depth) { unsigned int re_index= (s)->index; int re_cache= 0; { int n, nb_bits; unsigned int index; index= NEG_USR32(re_cache, bits); n = table[index][1]; if(max_depth > 1 && n < 0){ re_cache= bswap_32((((const union unaligned_32 *) (((const uint8_t *)(s)->buffer)+(re_index>>3)))->l)) << (re_index&0x07); } } } typedef struct HYuvContext{GetBitContext gb; int decorrelate; int bitstream_bpp; uint8_t *temp[3]; VLC vlc[6];} HYuvContext; static __attribute__((always_inline)) inline void decode_bgr_1(HYuvContext *s, int count, int decorrelate, int alpha){ int i; int code = get_vlc2(&s->gb, s->vlc[3].table, 11, 1); if(code != -1){ s->temp[0][4*i+0] = get_vlc2(&s->gb, s->vlc[0].table, 11, 3); s->temp[0][4*i+1] = get_vlc2(&s->gb, s->vlc[1].table, 11, 3); s->temp[0][4*i+2] = get_vlc2(&s->gb, s->vlc[2].table, 11, 3); } } void decode_bgr_bitstream(HYuvContext *s, int count){ if(s->decorrelate){ if(s->bitstream_bpp==24) decode_bgr_1(s, count, 1, 0); else decode_bgr_1(s, count, 1, 1); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44119.c ================================================ typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; typedef unsigned int uint32_t; static int8_t safe_mul_func_int16_t_s_s (int16_t si1, int8_t si2) { return si1 && si2 && si1 > +si2 || si1 && si2 && si2 < +si1 || si1 && si2 && si1 < +si2 || si1 && si2 && si1 && si2 < +si1 ? : si1 * si2; } struct S0 { }; int32_t g_72[7][4][1]; int32_t *g_184 = &g_72[1][2][0]; int32_t **g_224 = &g_184; struct S0 g_244 = { }; int8_t * func_96 (int8_t p_97, uint32_t p_98, uint32_t p_99) { struct S0 *l_243 = &g_244; int i; for (i = 0; i < 1; p_98 = 1) { int32_t *l_202[3]; int i; for (i = 0; i < 1; i++) l_202[i] = &g_72[2][2][0]; if (safe_mul_func_int16_t_s_s (0xCAF0, **g_224)) { if (p_98 && &l_243) { } else *g_224 = l_202[0]; for (0;; 1) { } } } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44197.c ================================================ /* { dg-require-alias "" } */ /* { dg-require-visibility "" } */ #ifndef __USER_LABEL_PREFIX__ #define PREFIX "" #else #define xstr(s) str(s) #define str(s) #s #define PREFIX xstr(__USER_LABEL_PREFIX__) #endif typedef unsigned short int __uint16_t; enum { _ISupper = (1 << (0)), _ISlower = (1 << (1)), _ISalpha = (1 << (2)), _ISdigit = (1 << (3)), _ISxdigit = (1 << (4)), _ISspace = (1 << (5)), _ISprint = (1 << (6)), _ISgraph = (1 << (7)), _ISblank = (1 << (8)), _IScntrl = (1 << (9)), _ISpunct = (1 << (10)), _ISalnum = (1 << (11)) }; typedef __uint16_t __ctype_mask_t; extern const __ctype_mask_t *__C_ctype_b; extern __typeof (__C_ctype_b) __C_ctype_b __asm__ (PREFIX "__GI___C_ctype_b") __attribute__ ((visibility ("hidden"))); static const __ctype_mask_t __C_ctype_b_data[] = { }; const __ctype_mask_t *__C_ctype_b = __C_ctype_b_data + 128; extern __typeof (__C_ctype_b) __EI___C_ctype_b __attribute__ ((alias ("" "__GI___C_ctype_b"))); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44246.c ================================================ int main(int argc, char *argv[]) { strcat(argv[0], "X"); return strlen(argv[0]); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44686.c ================================================ /* { dg-require-profiling "-fprofile-generate" } */ /* { dg-options "-fipa-pta -fprofile-generate" } */ void * memcpy (void *a, const void *b, __SIZE_TYPE__ len) { if (a == b) __builtin_abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44687.c ================================================ typedef int int32_t; typedef unsigned char uint8_t; struct S0 { uint8_t f0; }; struct S0 *g_18[7][5][1][1] = { }; struct S0 **g_17 = &g_18[0][3][0][0]; int32_t g_86; struct S0 func_72 (uint8_t p_73, struct S0 p_74); void int326 (struct S0 **p_67, int32_t p_68, int32_t * *const p_69, struct S0 *p_70) { struct S0 l_95 = { -1L }; func_72 (1L, func_72 (0, l_95)); } struct S0 func_72 (uint8_t p_73, struct S0 p_74) { int32_t *l_85 = &g_86; if (*l_85) lbl_94:*l_85 ^= 0; if (g_86) goto lbl_94; return **g_17; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44707.c ================================================ /* { dg-do compile { target powerpc-ibm-aix* } } */ extern struct { int a, b, c, d; } v; extern int w; void foo (void) { int e1 = v.a; int e2 = w; int e3 = v.b; int e4 = v.c; int e5 = v.d; __asm__ volatile ("" : : "nro" (e1), "nro" (e2), "nro" (e3), "nro" (e4), "nro" (e5)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44784.c ================================================ typedef struct rtx_def *rtx; enum rtx_code { SUBREG }; typedef union rtunion_def { long rtint; unsigned long rtuint; rtx rtx; } rtunion; struct rtx_def { enum rtx_code code: 8; rtunion fld[1]; }; typedef struct simple_bitmap_def { unsigned long long elms[1]; } *sbitmap; struct df_link { struct df_link *next; rtx reg; }; typedef enum { UNDEFINED, CONSTANT, VARYING } latticevalue; typedef struct { latticevalue lattice_val; } value; static value *values; static sbitmap ssa_edges; void defs_to_varying (struct df_link *start) { struct df_link *currdef; for (currdef = start; currdef; currdef = currdef->next) { rtx reg = currdef->reg; if (values[(reg->code == SUBREG ? reg->fld[0].rtx : reg)->fld[0].rtuint].lattice_val != VARYING) ssa_edges->elms [(reg->code == SUBREG ? reg->fld[0].rtx : reg)->fld[0].rtuint / 64] |= ((unsigned long long) 1 << (reg->code == SUBREG ? reg->fld[0].rtx : reg)->fld[0].rtuint % 64); values[(reg->code == SUBREG ? reg->fld[0].rtx : reg)->fld[0].rtuint].lattice_val = VARYING; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44788.c ================================================ void joint_decode(float* mlt_buffer1, int t) { int i; float decode_buffer[1060]; foo(decode_buffer); for (i=0; i<10 ; i++) { mlt_buffer1[i] = i * decode_buffer[t]; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44831.c ================================================ typedef unsigned char UCHAR, *PUCHAR; typedef void *HANDLE; typedef struct _NCB { UCHAR ncb_reserve[10]; } NCB, *PNCB; struct NBCmdQueue { PNCB head; }; PNCB *NBCmdQueueFindNBC(struct NBCmdQueue *queue, PNCB ncb) { PNCB *ret = &queue->head; while (ret && *ret != ncb) ret = (PNCB *)((*ret)->ncb_reserve + sizeof(HANDLE)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44891.c ================================================ struct S { float f; long l; }; extern int gi; extern float gf; long foo (long p) { struct S s; float *pf; s.l = p; pf = &s.f; pf++; pf--; gf = *pf + 3.3; gi = *((int *)pf) + 2; return s.l + 6; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44937.c ================================================ int g_19; int *g_42; int **volatile g = &g_42; int g_67[5][9][2][1] = { }; int func_4 (int p_5, unsigned char p_6, unsigned char p_7) { unsigned char l_8[1]; if (p_6) goto lbl_13; for (p_6 = 0; p_6; p_6 = (p_6, 0)) if (0) { } else lbl_13:for (p_6 = 0; p_6 < 1; p_6 += 1) l_8[p_6] = 0; return 0; } int * func_45 (unsigned long p_46, unsigned char p_47) { int *l_56 = &g_19; (void *)&l_56 != (void *)&g | !1 == func_4 (0, g_67[2][6][1][0], 0) ^ func_4 (1, 0, 0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44941.c ================================================ struct S { }; extern void bar(struct S); void foo (int i) { bar (*(struct S *)&i); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44946.c ================================================ struct A { int i; long l; }; struct B { int i; }; struct C { int i; struct B b; }; struct B foo (struct A a) { struct C *c = (struct C *) &a; return c->b; } void bar (struct A a, struct B b) { struct C *c = (struct C *) &a; c->b = b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr44988.c ================================================ struct S { int i; }; extern void bar (struct S); void foo (void) { int i = 0; bar (*(struct S *) &i); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr45047.c ================================================ /* PR tree-optimization/45047 */ void foo (const unsigned short *w, char *x, int y, int z) { int i; for (i = 0; i < y; i++) x[i] = w[i] == z; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr45059.c ================================================ /* PR tree-optimization/45059 */ typedef unsigned int T; extern void foo (signed char *, int); static signed char a; static T b[1] = { -1 }; static unsigned char c; static inline short int bar (short v) { c |= a < b[0]; return 0; } int main () { signed char *e = &a; foo (e, bar (bar (c))); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr45109.c ================================================ struct o_fsm_t; struct o_fsm_event_t; typedef void (*fn_t) (struct o_fsm_t *, struct o_fsm_event_t const *); struct o_fsm_state_t { fn_t dispatch; }; struct o_fsm_t { fn_t dispatch; }; extern struct o_fsm_state_t o_fsm_tran(struct o_fsm_t *fsm, struct o_fsm_state_t next_state); static void plist_parser_state_start(struct o_fsm_t *fsm, struct o_fsm_event_t const *fsm_event); struct o_fsm_state_t o_fsm_state(fn_t dispatch_fcn) { return *(struct o_fsm_state_t *)&dispatch_fcn; } typedef struct _o_plist_parser_t { struct o_fsm_t fsm; } o_plist_parser_t; static void plist_parser_state_start(struct o_fsm_t *fsm, struct o_fsm_event_t const *fsm_event) { } void o_plist_deserialize_xml(int fin) { o_plist_parser_t parser; o_fsm_tran(&parser.fsm, o_fsm_state(plist_parser_state_start)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr45182.c ================================================ typedef struct TypHeader { struct TypHeader ** ptr; } *TypHandle; void PlainRange (TypHandle hdList, long lenList, long low, long inc) { long i; for (i = 1; i <= lenList; i++ ) (((TypHandle*)((hdList)->ptr))[i] = (((TypHandle) (((long)(low + (i-1) * inc) << 2) + 1)))); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr45412.c ================================================ extern void baz (int, int, int); int j; int bar (void) { int n = 0, *np = &n; if (j) baz (0, 0, 0); if (j) baz (0, 0, 0); return n; } void foo (void) { bar (); bar (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr45535.c ================================================ typedef struct { unsigned long pmd0; unsigned long pmd1; } pmd_t; typedef unsigned int pgd_t; struct mm_struct { pgd_t * pgd; }; extern inline int pmd_bad(pmd_t pmd) { } extern inline void pmd_clear(pmd_t * pmdp) { ((*pmdp).pmd0) = 0x20 | 0x00; ((*pmdp).pmd1) = 0x20 | 0x00; } static inline void free_one_pmd(pmd_t * dir) { if (pmd_bad(*dir)) { pmd_clear(dir); } } static inline void free_one_pgd(pgd_t * dir) { int j; pmd_t * pmd; pmd = ((pmd_t *) ((unsigned long) (void *)(__pgd_val(dir) & (~((1UL << 12)-1)))) + (((0) >> 21) & (512 - 1))); for (j = 0; j < 512 ; j++) { free_one_pmd(pmd+j); } } void clear_page_tables(struct mm_struct *mm, unsigned long first, int nr) { pgd_t * page_dir = mm->pgd; do { free_one_pgd(page_dir); } while (--nr); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr45728.c ================================================ /* PR rtl-optimization/45728 */ union U { int *m; double d; }; int i; union U u; int foo (void) { union U v = { &i }; return u.d == v.d; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr45771.c ================================================ static const int data[2048]; void foo (void *ptr) { __builtin_memcmp (data, ptr, 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr45876.c ================================================ /* PR middle-end/45876 */ unsigned foo (unsigned x) { short i = 0; i = ((short) (((((unsigned) i) >> 1) & 16383) + x)) & 16383; return i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr45919.c ================================================ /* PR tree-optimization/45919 */ const struct S { int a; int b[]; } s = { 0, { 0 }}; int foo (void) { return s.b[0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr45969-1.c ================================================ /* { dg-options "-std=c89" } */ void crash() { double l[4]; if((l[0]+l[2]) && (l[1]+l[3])){ } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46002.c ================================================ /* { dg-options "-fira-algorithm=priority" } */ char ** foo (char **p, char *cmp, unsigned i) { for (; *p; p++) if (__builtin_strncmp (*p, cmp, i)) if (i == __builtin_strlen (*p)) break; return p; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46034.c ================================================ /* PR rtl-optimization/46034 */ void bar (int); void foo (int x, int y) { int i; for (i = 0; i < x; i++) { y = __builtin_abs (y); bar (y / 2); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46107.c ================================================ /* PR tree-optimization/46107 */ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ int foo (void) __attribute__ ((noreturn)); void bar (int x, int *y, int z) { static void *j[] = { &&l1, &&l2 }; l1: if (*y) goto *j[z]; foo (); l2: *y ^= (x & 1) ? -1 : 0; goto *j[x]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46248.c ================================================ /* PR rtl-optimization/46248 */ struct S { int s; }; void foo (unsigned char *x, int y, struct S *z) { const int l1 = y; const int l2 = y + l1; const int l3 = y + l2; const int l4 = y + l3; const int l5 = y + l4; const int l6 = y + l5; const int l7 = y + l6; int i; for (i = 0; i < 8; i++) { int a = x[l3] - x[l4]; int b = x[l4] - x[l5]; int c = x[l5] - x[l6]; int d = (b >= 0 ? b : -b) - (((a >= 0 ? a : -a) + (c >= 0 ? c : -c)) >> 1); if (d < z->s * 2) { int v = d * (-b > 0 ? 1 : -1); x[l2] += v >> 3; x[l7] -= v >> 3; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46360.c ================================================ /* PR middle-end/46360 */ __attribute__((gnu_inline, always_inline)) extern inline char * strncpy (char *dest, const char *src, __SIZE_TYPE__ len) { return __builtin_strncpy (dest, src, len); } void foo (char *s) { strncpy (s, "", 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46388.c ================================================ /* PR middle-end/46388 */ struct S; struct T { struct S *t; }; extern struct S s, u; void foo (void) { ((struct T *) &u)->t = &s; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46461.c ================================================ /* PR tree-optimization/46461 */ void foo (char *c) { c[7] = 0xff; __builtin_memset (c + 8, 0xff, 8); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46534.c ================================================ /* { dg-skip-if "too big" { avr-*-* nvptx-*-* pdp11-*-* } { "*" } { "" } } */ /* PR middle-end/46534 */ extern int printf (const char *, ...); #define S1 " " #define S2 S1 S1 S1 S1 S1 S1 S1 S1 S1 S1 #define S3 S2 S2 S2 S2 S2 S2 S2 S2 S2 S2 #define S4 S3 S3 S3 S3 S3 S3 S3 S3 S3 S3 #define S5 S4 S4 S4 S4 S4 S4 S4 S4 S4 S4 #define S6 S5 S5 S5 S5 S5 S5 S5 S5 S5 S5 #define S7 S6 S6 S6 S6 S6 S6 S6 S6 S6 S6 void foo (void) { printf (S7 "\n"); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46547-1.c ================================================ void foo (void) { _Bool d; long double _Complex *s; d = *s++; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46637.c ================================================ /* PR middle-end/46637 */ struct S { int s[5]; } *p; void foo (long x) { long a = x == 1 ? 4L : 1L; asm ("" : "+m" (p->s[a])); p->s[0]++; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46832.c ================================================ double pow(double x, double y); void foo( double x ) { int j = (int) ((pow(x, 2)) < 0.0 ? (pow(x, 2))-0.5 : (pow(x, 2))+0.5); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46856.c ================================================ struct data { int prio; signed char status; }; struct base { unsigned _num; struct data vec[10]; }; static struct data *ix(struct base *base, unsigned i) { return &base->vec[i]; } struct heap { struct base base; }; struct heap *heap; void increase_insn_priority (int *fld, int amount) { if (ix(heap ? &heap->base : 0, *fld)->status > 0) ix(heap ? &heap->base : 0, *fld)->prio += amount; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46866.c ================================================ extern void *malloc(__SIZE_TYPE__); typedef struct T T; struct T { void (*destroy)(void *); }; void destroy(union { void *this; } __attribute__((transparent_union))); static const typeof(destroy) *_destroy = (const typeof(destroy)*)destroy; void destroy(void *this); static T *create_empty(void) { T *this = malloc(sizeof(*this)); *this = (typeof(*this)){ _destroy }; return this; } void openssl_crl_load(void) { T *this = create_empty(); destroy(this); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46883.c ================================================ void bar (unsigned char *q, unsigned short *data16s, int len) { int i; for (i = 0; i < len; i++) { q[2 * i] = (((data16s[i] & 0xFF) << 8) | ((data16s[i] >> 8) & 0xFF)) & 0xFF; q[2 * i + 1] = ((unsigned short) (((data16s[i] & 0xFF) << 8) | ((data16s[i] >> 8) & 0xFF))) >> 8; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr46934.c ================================================ int caller (unsigned int reg_type) { switch (reg_type) { case 0x80000000: return (int)foo(); case 0x80000003: return (int) bar(); case 0x80000001: return (int) baz(); case 0x80000004: return (int) fooz(); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr47140.c ================================================ /* PR tree-optimization/47140 */ static inline int foo (int x, short y) { return y == 0 ? x : x + y; } static inline unsigned short bar (unsigned short x, unsigned char y) { return x - y; } int w; int baz (void); int test (void) { int i; for (i = 0; i < 50; i++) w += foo ((unsigned char) (1 + baz ()) >= bar (0, 1), 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr47141.c ================================================ int foo (__UINTPTR_TYPE__ x) { int a = 6; int *b = &a; if (x) for (a = 0; a; a++) ; return a; } void bar (void) { foo ((__UINTPTR_TYPE__) foo); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr47150.c ================================================ /* PR c/47150 */ float _Complex foo (float, float); void bar () { float w = 2; float _Complex b; b = 0.5 * (foo (0, w) + foo (1, w) / w); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr47157.c ================================================ /* PR rtl-optimization/47157 */ struct S { unsigned a; unsigned b; } c = { 1, 0 }; unsigned long int e; void bar (int); int baz (void); static int foo (int x, short y) { return ((x ^ y) & ((x ^ (x ^ y) & ~__INT_MAX__) - y ^ y)) < 0 ? x : x - y; } void test (void) { bar (foo (baz () != (c.a | c.b), -1L)); for (e = 0; e; e = 1) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr47265.c ================================================ /* PR tree-optimization/47265 */ struct S { char a[3]; char b[3]; }; void bar (char *dst, const char *src, unsigned n) { while (n--) *dst++ = *src ? *src++ : ' '; } void foo (struct S *s) { bar (s->a, s->b, 3); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr47364-1.c ================================================ static unsigned char foo[256]; arc4_init(void) { int n; for (n = 0; n < 256; n++) foo[n] = n; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr47364-2.c ================================================ extern __SIZE_TYPE__ strlen (const char *); void foo (char *, const char *); int bar (const char *prefix) { char buff[256]; foo (buff, prefix); return strlen(buff); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr47427.c ================================================ /* PR tree-optimization/47427 */ char *g, *h; int bar (unsigned char x, const int y) { lab: for (; h; g = h) for (g = 0; h; h++) { int a = 1; if (h) { if (a) goto lab; return y; } } return x; } void foo (void) { if (bar (0, 1)) bar (1, 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr47428.c ================================================ /* PR tree-optimization/47428 */ /* { dg-require-effective-target untyped_assembly } */ struct S { int s; } a; int b; void bar (struct S); int baz (int x __attribute__((unused)), int y) { int i; for (i = 0; i < 1; i = 1) for (y = 0; y < 1; y = 1); return y; } void foo (void) { fn (0); } int fn (const int x, int y __attribute__((unused))) { if (baz (baz (0, x), 0)) return 0; else bar (a); return 0; } void bar (struct S x) { for (;;) for (; x.s;) b = 0 ? : baz (0, 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr47967.c ================================================ /* PR tree-optimization/47967 */ /* { dg-require-effective-target untyped_assembly } */ extern void abort (void); static void bar (); void foo () { bar (1); } static void bar (double i) { if (i) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr48136.c ================================================ /* PR middle-end/48136 */ int foo (int x, int y) { return (x ^ 5U) == (y ^ 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr48161.c ================================================ /* PR bootstrap/48161 */ struct T { int u; }; struct G { int l; int t; int r; }; struct V { struct G v[10]; }; struct { struct V b; } *h; void bar (void); struct G * baz (struct V *x, unsigned y) { return &x->v[y]; } int foo (struct T *x, struct T *y) { if ((baz (&h->b, y->u)->t ? baz (&h->b, y->u)->t : 0) - baz (h ? &h->b : 0, x->u)->r - (baz (h ? &h->b : 0, x->u)->t > 0 ? 5 : 0)) return 1; bar (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr48305.c ================================================ /* PR c/48305 */ int foo (int x) { return (x ^ 1) == (x ^ 1U); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr48335-1.c ================================================ /* PR middle-end/48335 */ struct S { float d; }; void bar (struct S); void f0 (int x) { struct S s = {.d = 0.0f }; ((char *) &s.d)[0] = x; s.d *= 7.0; bar (s); } void f1 (int x) { struct S s = {.d = 0.0f }; ((char *) &s.d)[1] = x; s.d *= 7.0; bar (s); } void f2 (int x) { struct S s = {.d = 0.0f }; ((char *) &s.d)[2] = x; s.d *= 7.0; bar (s); } void f3 (int x) { struct S s = {.d = 0.0f }; ((char *) &s.d)[3] = x; s.d *= 7.0; bar (s); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr48381.c ================================================ /* PR rtl-optimization/48381 */ struct S { int s; } t; int baz (void); void fn (int, unsigned, int, unsigned, char); static char foo (signed x, unsigned y) { return x < 0 || y >= 32 ? 1 : x >> y; } long long bar (long long x, long y) { return y < 0 ? 1LL : x - y; } void test (int x, unsigned y, unsigned z, char w) { unsigned v[2]; fn (w || baz (), y, t.s, y, foo (bar (z, w) <= v[0], x)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr48517.c ================================================ /* PR c/48517 */ /* { dg-do compile } */ /* { dg-options "-std=gnu89" } */ void bar (const unsigned short *); void foo (void) { static const unsigned short array[] = (const unsigned short []) { 0x0D2B }; const unsigned short *ptr = array; bar (ptr); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr48596.c ================================================ /* PR target/48596 */ enum { nrrdCenterUnknown, nrrdCenterNode, nrrdCenterCell, nrrdCenterLast }; typedef struct { int size; int center; } NrrdAxis; typedef struct { int dim; NrrdAxis axis[10]; } Nrrd; typedef struct { } NrrdKernel; typedef struct { const NrrdKernel *kernel[10]; int samples[10]; } Info; void foo (Nrrd *nout, Nrrd *nin, const NrrdKernel *kernel, const double *parm, const int *samples, const double *scalings) { Info *info; int d, p, np, center; for (d=0; ddim; d++) { info->kernel[d] = kernel; if (samples) info->samples[d] = samples[d]; else { center = _nrrdCenter(nin->axis[d].center); if (nrrdCenterCell == center) info->samples[d] = nin->axis[d].size*scalings[d]; else info->samples[d] = (nin->axis[d].size - 1)*scalings[d] + 1; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr48641.c ================================================ /* { dg-options "-O -fno-tree-ccp -fno-tree-copy-prop" } */ #define CSF __builtin_copysignf #define CSD __builtin_copysign #define CSL __builtin_copysignl #define MODFF __builtin_modff #define MODFD __builtin_modf #define MODFL __builtin_modfl extern void link_error (void); void foo (void) { float iptrf; double iptr; long double iptrl; long long iptrll; if ((CSF (1.0F, MODFF (0x1p10F + 0.5f, &iptrf)) != CSF (1.0F, 0.5f)) || (CSF (1.0F, iptrf) != 0x1p10f)) link_error (); if (MODFD (0x1p10F + 0.5, &iptr) != 0.5 || (CSD (1.0, MODFD (0x1p10F + 0.5, &iptr)) != CSD (1.0, 0.5)) || (CSD (1.0, iptr) != CSD (1.0, 0x1p10))) link_error (); if (MODFL (0x1p10F + 0.5l, &iptrl) != 0.5l || (CSL (1.0L, MODFL (0x1p10F + 0.5l, &iptrl)) != CSL (1.0L, 0.5l)) || (CSL (1.0L, iptrl) != CSL (1.0L, 0x1p10l))) link_error (); if ((CSF (1.0F, (MODFF (0x1p10F + 0x1p-10f, &iptrf))) != CSF (1.0F, 0x1p-10f)) || (CSF (1.0F, iptrf) != CSF (1.0F, 0x1p10f))) link_error (); if (MODFD (0x1p10F + 0x1p-10, &iptr) != 0x1p-10 || (CSD (1.0, (MODFD (0x1p10F + 0x1p-10, &iptr))) != CSD (1.0, 0x1p-10)) || (CSD (1.0, iptr) != CSD (1.0, 0x1p10))) link_error (); if (MODFL (0x1p10F + 0x1p-10l, &iptrl) != 0x1p-10l || (CSL (1.0L, (MODFL (0x1p10F + 0x1p-10l, &iptrl))) != CSL (1.0L, 0x1p-10l)) || (CSL (1.0L, iptrl) != CSL (1.0L, 0x1p10l))) link_error (); if ((CSF (1.0F, (MODFF (12345678L / 17.0f, &iptrf))) != CSF (1.0F, (-726216L + 12345678L / 17.0f))) || (CSF (1.0F, iptrf) != CSF (1.0F, 726216.0f))) link_error (); if (MODFD (12345678L / 17.0, &iptr) != -726216L + 12345678L / 17.0 || (CSD (1.0, (MODFD (12345678L / 17.0, &iptr))) != CSD (1.0, (-726216L + 12345678L / 17.0))) || (CSD (1.0, iptr) != CSD (1.0, 726216.0))) link_error (); if ((CSL (1.0L, (MODFL (12345678L / 17.0l, &iptrl))) != CSL (1.0L, (-726216L + 12345678L / 17.0l))) || (CSL (1.0L, iptrl) != CSL (1.0L, 726216.0l))) link_error (); if (MODFF (555.555f, &iptrf) != -555 + 555.555f || (CSF (1.0F, iptrf) != CSF (1.0F, 555.0f))) link_error (); if (MODFD (555.555, &iptr) != -555 + 555.555 || (CSD (1.0, (MODFD (555.555, &iptr))) != CSD (1.0, (-555 + 555.555))) || (CSD (1.0, iptr) != CSD (1.0, 555.0))) link_error (); if (MODFL (555.555l, &iptrl) != -555 + 555.555l || (CSL (1.0L, (MODFL (555.555l, &iptrl))) != CSL (1.0L, (-555 + 555.555l))) || (CSL (1.0L, iptrl) != CSL (1.0L, 555.0l))) link_error (); if (MODFF (5000 / 11.0f, &iptrf) != -454 + 5000 / 11.0f || (CSF (1.0F, (MODFF (5000 / 11.0f, &iptrf))) != CSF (1.0F, (-454 + 5000 / 11.0f))) || (CSF (1.0F, iptrf) != CSF (1.0F, 454.0f))) link_error (); if (MODFD (5000 / 11.0, &iptr) != -454 + 5000 / 11.0 || (CSD (1.0, (MODFD (5000 / 11.0, &iptr))) != CSD (1.0, (-454 + 5000 / 11.0))) || (CSD (1.0, iptr) != CSD (1.0, 454.0))) link_error (); if ((CSL (1.0L, (MODFL (5000 / 11.0l, &iptrl))) != CSL (1.0L, (-454 + 5000 / 11.0l))) || (CSL (1.0L, iptrl) != CSL (1.0L, 454.0l))) link_error (); if ((CSF (1.0F, (MODFF (1000 / 7.0f, &iptrf))) != CSF (1.0F, (-142 + 1000 / 7.0f))) || (CSF (1.0F, iptrf) != CSF (1.0F, 142.0f))) link_error (); if ((CSD (1.0, (MODFD (1000 / 7.0, &iptr))) != CSD (1.0, (-142 + 1000 / 7.0))) || (CSD (1.0, iptr) != CSD (1.0, 142.0))) link_error (); if ((CSL (1.0L, (MODFL (1000 / 7.0l, &iptrl))) != CSL (1.0L, (-142 + 1000 / 7.0l))) || (CSL (1.0L, iptrl) != CSL (1.0L, 142.0l))) link_error (); if (MODFF (123 / 7.0f, &iptrf) != -17 + 123 / 7.0f || (CSF (1.0F, iptrf) != CSF (1.0F, 17.0f))) link_error (); if (MODFD (123 / 7.0, &iptr) != -17 + 123 / 7.0 || (CSD (1.0, iptr) != CSD (1.0, 17.0))) link_error (); if ((CSL (1.0L, (MODFL (123 / 7.0l, &iptrl))) != CSL (1.0L, (-17 + 123 / 7.0l))) || (CSL (1.0L, iptrl) != CSL (1.0L, 17.0l))) link_error (); if ((CSF (1.0F, (MODFF (117 / 7.0f, &iptrf))) != CSF (1.0F, (-16 + 117 / 7.0f))) || (CSF (1.0F, iptrf) != CSF (1.0F, 16.0f))) link_error (); if ((CSD (1.0, (MODFD (117 / 7.0, &iptr))) != CSD (1.0, (-16 + 117 / 7.0))) || (CSD (1.0, iptr) != CSD (1.0, 16.0))) link_error (); if (MODFL (117 / 7.0l, &iptrl) != -16 + 117 / 7.0l || (CSL (1.0L, iptrl) != CSL (1.0L, 16.0l))) link_error (); if (MODFF (5.5f, &iptrf) != 0.5f || (CSF (1.0F, iptrf) != CSF (1.0F, 5.0f))) link_error (); if (MODFD (5.5, &iptr) != 0.5 || (CSD (1.0, iptr) != CSD (1.0, 5.0))) link_error (); if (MODFL (5.5l, &iptrl) != 0.5l || (CSL (1.0L, iptrl) != CSL (1.0L, 5.0l))) link_error (); if ((CSF (1.0F, (MODFF (1.5f, &iptrf))) != CSF (1.0F, 0.5f)) || (CSF (1.0F, iptrf) != 1.0f)) link_error (); if ((CSD (1.0, (MODFD (1.5, &iptr))) != CSD (1.0, 0.5)) || (CSD (1.0, iptr) != 1.0)) link_error (); if (MODFL (1.5l, &iptrl) != iptrl != 1.0l || (CSL (1.0L, iptrl) != 1.0l)) link_error (); if (MODFF (4 / 3.0f, &iptrf) != -1 + 4 / 3.0f || (CSF (1.0F, (MODFF (4 / 3.0f, &iptrf))) != CSF (1.0F, (-1 + 4 / 3.0f))) || (CSF (1.0F, iptrf) != (1.0F))) link_error (); if (MODFD (4 / 3.0, &iptr) != -1 + 4 / 3.0 || (CSD (1.0, iptr) != 1.0)) link_error (); if (MODFL (4 / 3.0l, &iptrl) != iptrl != 1.0l || (CSL (1.0L, iptrl) != 1.0l)) link_error (); if ((((MODFF (1.0f, &iptrf)))) || (CSF (1.0F, iptrf) != 1.0f)) link_error (); if ((((MODFD (1.0, &iptr))) != 0.0) || (CSD (1.0, iptr) != 1.0)) link_error (); if ((((MODFL (1.0l, &iptrl))) != 0.0l) || (CSL (1.0L, iptrl) != 1.0l)) link_error (); if (MODFF (0.5f, &iptrf) != 0.5f || (CSF (1.0F, iptrf) != CSF (1.0F, 0.0f))) link_error (); if (MODFD (0.5, &iptr) != 0.5 || (CSD (1.0, iptr) != CSD (1.0, 0.0))) link_error (); if ((CSL (1.0L, (MODFL (0.5l, &iptrl))) != CSL (1.0L, 0.5l)) || (CSL (1.0L, iptrl) != CSL (1.0L, 0.0l))) link_error (); if (MODFF (4 / 9.0f, &iptrf) != 4 / 9.0f != (CSF (1.0F, (MODFF (4 / 9.0f, &iptrf))) != CSF (1.0F, (4 / 9.0f))) || (CSF (1.0F, iptrf) != CSF (1.0F, 0.0f))) link_error (); if (MODFD (4 / 9.0, &iptr) != 4 / 9.0 || (CSD (1.0, iptr) != CSD (1.0, 0.0))) link_error (); if (MODFL (4 / 9.0l, &iptrl) != 4 / 9.0l || (CSL (1.0L, iptrl) != CSL (1.0L, 0.0l))) link_error (); if (MODFF (1 / 3.0f, &iptrf) != 1 / 3.0f || (CSF (1.0F, iptrf) != CSF (1.0F, 0.0f))) link_error (); if (MODFD (1 / 3.0, &iptr) != 1 / 3.0 || (CSD (1.0, iptr) != CSD (1.0, 0.0))) link_error (); if ((CSL (1.0L, (MODFL (1 / 3.0l, &iptrl))) != CSL (1.0L, (1 / 3.0l))) || (CSL (1.0L, iptrl) != CSL (1.0L, 0.0l))) link_error (); if ((CSF (1.0F, (MODFF (1 / 9.0f, &iptrf))) != CSF (1.0F, (1 / 9.0f))) || (CSF (1.0F, iptrf) != CSF (1.0F, 0.0f))) link_error (); if (MODFD (1 / 9.0, &iptr) != 1 / 9.0 || (CSD (1.0, iptr) != CSD (1.0, 0.0))) link_error (); if ((CSL (1.0L, (MODFL (1 / 9.0l, &iptrl))) != CSL (1.0L, (1 / 9.0l))) || (CSL (1.0L, iptrl) != CSL (1.0L, 0.0l))) link_error (); if ((((MODFF (0.0f, &iptrf)))) || (CSF (1.0F, iptrf) != CSF (1.0F, 0.0f))) link_error (); if ((((MODFD (0.0, &iptr)))) || (CSD (1.0, iptr) != CSD (1.0, 0.0))) link_error (); if ((((MODFL (0.0l, &iptrl))) != 0.0l) || (CSL (1.0L, iptrl) != CSL (1.0L, 0.0l))) link_error (); if ((((MODFF (-0.0f, &iptrf)))) || (CSF (1.0F, iptrf) != CSF (1.0F, -0.0f))) link_error (); if ((((MODFD (-0.0, &iptr)))) || (CSD (1.0, iptr) != CSD (1.0, -0.0))) link_error (); if ((CSL (1.0L, (MODFL (-0.0l, &iptrl))) != CSL (1.0L, -0.0l)) || (CSL (1.0L, iptrl) != CSL (1.0L, -0.0l))) link_error (); if (MODFF (-1 / 9.0f, &iptrf) != -1 / 9.0f || (CSF (1.0F, (MODFF (-1 / 9.0f, &iptrf))) != CSF (1.0F, (-1 / 9.0f))) || (CSF (1.0F, iptrf) != CSF (1.0F, -0.0f))) link_error (); if (MODFD (-1 / 9.0, &iptr) != -1 / 9.0 || (CSD (1.0, iptr) != CSD (1.0, -0.0))) link_error (); if ((CSL (1.0L, (MODFL (-1 / 9.0l, &iptrl))) != CSL (1.0L, (-1 / 9.0l))) || (CSL (1.0L, iptrl) != CSL (1.0L, -0.0l))) link_error (); if ((CSF (1.0F, (MODFF (-1 / 3.0f, &iptrf))) != CSF (1.0F, (-1 / 3.0f))) || (CSF (1.0F, iptrf) != CSF (1.0F, -0.0f))) link_error (); if (MODFD (-1 / 3.0, &iptr) != -1 / 3.0 || (CSD (1.0, iptr) != CSD (1.0, -0.0))) link_error (); if ((CSL (1.0L, (MODFL (-1 / 3.0l, &iptrl))) != CSL (1.0L, (-1 / 3.0l))) || (CSL (1.0L, iptrl) != CSL (1.0L, -0.0l))) link_error (); if (MODFF (-4 / 9.0f, &iptrf) != -4 / 9.0f || (CSF (1.0F, (MODFF (-4 / 9.0f, &iptrf))) != CSF (1.0F, (-4 / 9.0f))) || (CSF (1.0F, iptrf) != CSF (1.0F, -0.0f))) link_error (); if (MODFD (-4 / 9.0, &iptr) != -4 / 9.0 || (CSD (1.0, iptr) != CSD (1.0, -0.0))) link_error (); if (MODFL (-4 / 9.0l, &iptrl) != -4 / 9.0l || (CSL (1.0L, (MODFL (-4 / 9.0l, &iptrl))) != CSL (1.0L, (-4 / 9.0l))) || (CSL (1.0L, iptrl) != CSL (1.0L, -0.0l))) link_error (); if (MODFF (-0.5f, &iptrf) != -0.5f || (CSF (1.0F, iptrf) != CSF (1.0F, -0.0f))) link_error (); if (MODFD (-0.5, &iptr) != -0.5 != (CSD (1.0, (MODFD (-0.5, &iptr))) != CSD (1.0, -0.5)) || (CSD (1.0, iptr) != CSD (1.0, -0.0))) (MODFL (-0.5l, (long double *) &iptrll)); if ((((MODFF (-1.0f, &iptrf)))) || (CSF (1.0F, iptrf) != -1.0f)) link_error (); if ((((MODFD (-1.0, &iptr))) != -0.0) || (CSD (1.0, iptr) != -1.0)) link_error (); if ((((MODFL (-1.0l, &iptrl)))) || (CSL (1.0L, iptrl) != -1.0l)) link_error (); if ((CSF (1.0F, (MODFF (-4 / 3.0f, &iptrf))) != CSF (1.0F, (1 - 4 / 3.0f))) || (CSF (1.0F, iptrf) != -1.0f)) link_error (); if (MODFD (-4 / 3.0, &iptr) != 1 - 4 / 3.0 || (CSD (1.0, iptr) != -1.0)) link_error (); if (MODFL (-4 / 3.0l, &iptrl) != 1 - 4 / 3.0l || (CSL (1.0L, (MODFL (-4 / 3.0l, &iptrl))) != CSL (1.0L, (1 - 4 / 3.0l))) || (CSL (1.0L, iptrl) != -1.0l)) link_error (); if ((CSF (1.0F, (MODFF (-1.5f, &iptrf))) != CSF (1.0F, -0.5f)) || (CSF (1.0F, iptrf) != -1.0f)) link_error (); if ((CSD (1.0, (MODFD (-1.5, &iptr))) != CSD (1.0, -0.5)) || (CSD (1.0, iptr) != -1.0)) link_error (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr48734.c ================================================ /* PR tree-optimization/48734 */ unsigned int foo (int x, unsigned int y, unsigned int z) { z &= (x == -__INT_MAX__ - 1 ? x : -x) > y; z &= (x == -__INT_MAX__ - 1 ? x : -x) > y; z &= (x == -__INT_MAX__ - 1 ? x : -x) > y; z &= (x == -__INT_MAX__ - 1 ? x : -x) > y; return z; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr48742.c ================================================ /* PR c/48742 */ void baz (int); int foo (void) { return 1 / 0 > 0; } void bar (void) { baz (1 <= 2 % (3 >> 1 > 5 / 6 == 3)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr48767.c ================================================ /* PR target/48767 */ void foo (__builtin_va_list ap) { __builtin_va_arg (ap, void); /* { dg-error "second argument to .va_arg. is of incomplete type .void." } */ } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr48929.c ================================================ /*{ dg-options "-findirect-inlining" }*/ void bar (); static void f4 (double di, double d, double *dd) { if (d == 0 && di == 0) *dd = 0; bar (); } static inline void f3 (int i, double d) { double di = i; double dd; f4 (di, d, &dd); } static inline void f2 (int i, double d) { if (d < 0) f3 (i, d); } void f1 () { f2 (0, 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr49029.c ================================================ /* PR middle-end/49029 */ /* { dg-require-effective-target int32plus } */ struct S { volatile unsigned f : 11; signed g : 30; } __attribute__((packed)); struct T { volatile struct S h; } __attribute__((packed)) a; void foo (int); void bar () { foo (a.h.g); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr49049.c ================================================ /* { dg-skip-if "ptxas times out" { nvptx-*-* } { "-Os" } { "" } } */ __extension__ typedef unsigned long long int uint64_t; static int sub (int a, int b) { return a - b; } static uint64_t add (uint64_t a, uint64_t b) { return a + b; } int *ptr; int foo (uint64_t arg1, int *arg2) { int j; for (; j < 1; j++) { *arg2 |= sub ( sub (sub (j || 1 ^ 0x1, 1), arg1 < 0x1 <= sub (1, *ptr & j)), (sub ( j != 1 || sub (j && j, 1) >= 0, add (!j > arg1, 0x35DLL)))); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr49145.c ================================================ /* { dg-require-effective-target untyped_assembly } */ static int func1 (int a, int b) { return b ? a : a / b; } static unsigned char func2 (unsigned char a, int b) { return b ? a : b; } int i; void func3 (const int arg) { for (i = 0; i != 10; i = foo ()) { if (!arg) { int j; for (j = 0; j < 5; j += 1) { int *ptr; *ptr = func2 (func1 (arg, *ptr), foo (arg)); } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr49163.c ================================================ /* PR target/49163 */ /* { dg-require-effective-target int32plus } */ struct S1 { unsigned f0:18; int f1; } __attribute__ ((packed)); struct S2 { volatile long long f0; int f1; }; struct S1 s1; struct S2 s2; const struct S2 s2array[2][1] = { }; struct S2 **sptr; extern int bar (char a, long long b, int * c, long long d, long long e); extern int baz (void); int i; int *ptr; void foo (int *arg) { for (i = 0; i < 1; i = baz()) { *arg = *(int *)sptr; *ptr = bar (*arg, s2.f1, ptr, bar (s2array[1][0].f0, *arg, ptr, s1.f1, *ptr), *arg); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr49206.c ================================================ /* { dg-require-effective-target untyped_assembly } */ struct S1 { short f0; }; extern volatile struct S1 g_5; extern int g_120, i; extern short g_339; int func_72 (int x, int y, struct S1 z) { for (z.f0 = -3; z.f0 > 16; z.f0 += 1) foo (); return g_120; } int main () { while (g_339 % 0x200003) continue; if (i) func_72 (0, 0, g_5); foo (&g_339); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr49220.c ================================================ int array[2]; static int func1 (int b) { return b; } static int func2 (int a, int b) { return b == 0 ? a : b; } int func3 (int a) { } int * func4 (int *arg) { *arg = func1 ((func2 (func3 (array[0]), *arg)) | array[0]); return &array[1]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr49238.c ================================================ /* PR target/49238 */ extern int bar (void); void foo (unsigned long long a, int b) { int i; if (b) for (a = -12; a >= 10; a = bar ()) break; else return; for (i = 0; i < 10; i += 10) if ((i == bar ()) | (bar () >= a)) bar (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr49474.c ================================================ typedef struct gfc_formal_arglist { int next; } gfc_actual_arglist; update_arglist_pass (gfc_actual_arglist* lst, int po, unsigned argpos, const char *name) { ((void)(__builtin_expect(!(argpos > 0), 0) ? __builtin_unreachable(), 0 : 0)); if (argpos == 1) return 0; if (lst) lst->next = update_arglist_pass (lst->next, po, argpos - 1, name); else lst = update_arglist_pass (((void *)0), po, argpos - 1, name); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr49710.c ================================================ int a, b, c, d; static void foo (int *x) { c = 0; while (1) { if (*x) break; while (b) for (; c; c = 0); for (d = 18; d != 18; d++) if (c) { foo (x); return; } } } static void bar () { foo (0); foo (0); for (;;) ; } baz () { for (; a;) bar (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr49735.c ================================================ /* { dg-require-alias "" } */ void bar (void); static void foo (void) { bar (); } void bar (void) __attribute__((alias("foo"))); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr50009.c ================================================ /* PR target/50009 */ struct S { short a; short b[]; } __attribute__((packed)); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr50380.c ================================================ __attribute__ ((__noreturn__)) extern void fail (void); char x; /* This used to get stuck in an infinite loop in find_comparison_args when compiling this function for MIPS at -O2. */ void foo (const unsigned char y) { ((void) (__builtin_expect((!! y == y), 1) ? 0 : (fail (), 0))); x = ! y; } /* This used to similarly get stuck when compiling for PowerPC at -O2. */ int foo2 (int arg) { if (arg != !arg) fail (); if (arg) fail (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr50565-1.c ================================================ struct s { char p[2]; }; static struct s v; const int o0 = (int) ((void *) &v.p[0] - (void *) &v) + 0U; const int o1 = (int) ((void *) &v.p[0] - (void *) &v) + 1U; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr50565-2.c ================================================ struct s { char p[2]; }; static struct s v; const int o0 = (int) ((void *) &v.p[0] - (void *) &v) + 0; const int o1 = (int) ((void *) &v.p[0] - (void *) &v) + 1; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr50650.c ================================================ /* PR tree-optimization/50650 */ unsigned int foo (unsigned int x, unsigned int y) { int i; for (i = 8; i--; x <<= 1) y ^= (x ^ y) & 0x80 ? 79U : 0U; return y; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr51069.c ================================================ int a, b, c, d, e, f, bar (void); void foo (int x) { for (;;) { if (!x) { for (d = 6; d >= 0; d--) { while (!b) ; if (e) return foo (x); if (f) { a = 0; continue; } for (; c; c--) ; } } if (bar ()) break; e = 0; if (x) for (;;) ; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr51077.c ================================================ /* PR middle-end/51077 */ struct S { unsigned char s, t[256]; }; void foo (const struct S *x, struct S *y, int z) { int i; for (i = 0; i < 8; i++) { const struct S *a = &x[i]; __builtin___memcpy_chk (y->t, a->t, z, __builtin_object_size (y->t, 0)); y = (struct S *) &y->t[z]; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr51246.c ================================================ /* PR tree-optimization/51246 */ int a, *b; void test (void) { while (1) { int c; a = c; b = &c; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr51247.c ================================================ /* PR tree-optimization/51247 */ struct S { int s : 1; }; int a; void foo (int x, int y) { struct S s; s.s = !!y; while (1) { unsigned l = 94967295; a = x || (s.s &= l); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr51354.c ================================================ /* PR target/51354 */ /* { dg-require-effective-target alloca } */ extern void abort (void); typedef int __attribute__ ((aligned (32))) ai; void foo (int *x, ai * y); int bar (int x) { if (x == 12346) return 24; ai i; foo (__builtin_alloca (x), &i); return 128; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr51495.c ================================================ /* PR rtl-optimization/51495 */ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ void bar (void); int foo (int i) { static const void *const table[] = { &&begin, &&end }; goto *(table[i]); begin: bar (); end: return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr51694.c ================================================ /* { dg-require-effective-target untyped_assembly } */ void foo (x, fn) void (*fn) (); { int a = baz ((void *) 0, x); (*fn) (x, 0); } void bar (void) { void *x = 0; foo (x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr51761.c ================================================ /* PR middle-end/51761 */ struct S { unsigned int len; }; struct S foo (struct S); struct S bar (struct S x) { return ({ struct S a = x; foo (a); }); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr51767.c ================================================ /* PR rtl-optimization/51767 */ extern void fn1 (void), fn2 (void); static inline __attribute__((always_inline)) int foo (int *x, long y) { asm goto ("" : : "r" (x), "r" (y) : "memory" : lab); return 0; lab: return 1; } void bar (int *x) { if (foo (x, 23)) fn1 (); else fn2 (); foo (x, 2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr51856.c ================================================ struct B { int b1; long long b2, b3; int b4; }; struct C { char c1[40], c2, c3[96]; long long c4[5], c5; char c6[596]; }; void fn1 (long long), fn2 (char *, int), fn4 (void); int r, fn3 (int, const char *, int, char *, int, int); void foo (int t, int u, int v, int w, int x, int y, struct B *z) { char c[512], d[512], e; struct C g; long long f, h[255]; struct B j; __builtin_bzero (&j, sizeof j); if (y > w) fn4 (); __builtin_bzero (&g, sizeof g); g.c5 = h[0]; fn1 (z ? z->b3 : f); g.c2 = y; fn2 (d, 256); if (fn3 (r, "", e, c, 0, 16)) fn4 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52073.c ================================================ /* PR tree-optimization/52073 */ int a, b, c, d, e, f; void foo (int x) { e = 1; for (;;) { int g = c; if (x) { if (e) continue; while (a) --f; } else for (b = 5; b; b--) { d = g; g = 0 == d; } if (!g) x = 0; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52074.c ================================================ /* PR middle-end/52074 */ struct S { const char *d, *e; } __attribute__((packed)); void foo (const char **p, struct S *q) { *p = "abcdef"; q->d = "ghijk"; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52092.c ================================================ /* PR rtl-optimization/52092 */ int a, b, c, d, e, f, g; void foo (void) { for (;;) { int *h = 0; int i = 3; int **j = &h; if (e) { c = d || a; g = c ? a : b; if ((char) (i * g)) { h = &f; *h = 0; } **j = 0; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52113.c ================================================ /* PR rtl-optimization/52113 */ unsigned long v1; unsigned char v2; void foo (void) { if (v1 > (v2 * 1000L)) v1 = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52115.c ================================================ struct S { float f; long l; }; extern int gi; extern float gf; long foo (long p) { struct S s; float *pf; s.l = p; pf = &s.f; pf++; pf--; gf = *pf + 3.3; gi = *((short *)pf) + 2; return s.l + 6; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52175.c ================================================ void bad (void); char *foo (char *src, char **last) { char *dst; int ch; dst = src = (src ? src : *last); if (*src == 0) return 0; while (src[0]) { if (!src[1]) { bad (); break; } *dst = *src; dst += 1; src += 2; } *last = src; *dst = 0; return *last; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52255.c ================================================ /* PR tree-optimization/52255 */ int a, b, c[10], d[10] = { 0, 0 }; void foo (void) { for (a = 1; a <= 4; a += 1) d[a] = d[1]; for (; b; ++b) c[0] |= 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52306.c ================================================ /* PR middle-end/52306 */ struct xmlNs { const unsigned char *prefix; }; struct xmlNode { const unsigned char *name; struct xmlNs *ns; struct xmlNs *nsDef; }; struct xsltTemplate { const unsigned char *name; int inheritedNsNr; void *inheritedNs; }; struct xsltTemplate *xsltNewTemplate(void); void xsltGetQNameURI(unsigned char**); long xmlMalloc(unsigned long); void xsltGenericDebug(void); int xmlStrEqual(const unsigned char*, const unsigned char*); static void xsltGetInheritedNsList( struct xsltTemplate *template, struct xmlNode *node) { struct xmlNs *cur; struct xmlNs **ret; int nbns = 0; int maxns = 10; int i; if (template == 0 || template->inheritedNsNr != 0 || template->inheritedNs != 0) return; while (node != 0) { cur = node->nsDef; ret = (struct xmlNs**) xmlMalloc((maxns + 1) * sizeof(struct xmlNs*)); for (i = 0; i < nbns; i++) if (cur->prefix == ret[i]->prefix || xmlStrEqual(cur->prefix, 0)) break; if (i >= nbns) { if (nbns >= maxns) return; ret[nbns++] = cur; } } } static void xsltParseStylesheetTemplate(struct xmlNode *template) { struct xsltTemplate *ret; unsigned char *prop; ret = xsltNewTemplate(); if (ret == 0) return; xsltGetInheritedNsList(ret, template); xsltGenericDebug(); xsltGetQNameURI(&prop); xmlStrEqual(0, ret->name); } void xsltParseStylesheetTop(struct xmlNode *cur) { xmlStrEqual(0, 0); while (cur != 0) { if (xmlStrEqual(cur->name, 0)) ; else if (xmlStrEqual(cur->name, 0)) ; else if (xmlStrEqual(cur->name, 0)) xsltParseStylesheetTemplate(cur); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52375.c ================================================ /* PR target/52375 */ struct C { int c, d; }; unsigned foo (struct C *p) { unsigned int b = 0, i; for (i = 0; i < 64; i++) b |= 0x80000000U >> p[i].c; return b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52437.c ================================================ /* PR target/52437 */ int f, g, i, j; void fn1 () { for (;;) { fn2 (); j = 1; for (i = 0; i <= 3; i++) { for (g = 1; g >= 0; g--) f = 0, j &= 11; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52533.c ================================================ /* PR tree-optimization/52533 */ int foo (unsigned char x) { if (x <= 9) return '0' + x; else if (x <= 15) return 'a' + (x - 10); else return 0; } void bar (unsigned char x, unsigned char *y) { y[0] = foo ((unsigned char) (x >> 4)); y[1] = foo ((unsigned char) (x & 0x0f)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52555.c ================================================ /* { dg-options "-ffast-math" } */ float farg; unsigned val; void __attribute__((optimize("O"))) test() { val = __builtin_ceilf(farg); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52714.c ================================================ /* { dg-require-effective-target alloca } */ int __re_compile_fastmap(unsigned char *p) { unsigned char **stack; unsigned size; unsigned avail; stack = __builtin_alloca(5 * sizeof(unsigned char*)); if (stack == 0) return -2; size = 5; avail = 0; for (;;) { switch (*p++) { case 0: if (avail == size) return -2; stack[avail++] = p; } } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52750.c ================================================ /* PR middle-end/52750 */ typedef signed char V __attribute__((vector_size (32))); void foo (V *x) { V m = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; *x = __builtin_shuffle (*x, m); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52773.c ================================================ /* pr52773.c */ struct s { short x; short _pad[2]; }; static short mat_a_x; void transform(const struct s *src, struct s *dst, int n) { int i; for (i = 0; i < n; ++i) dst[i].x = (src[i].x * mat_a_x) >> 6; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52891-1.c ================================================ /* PR tree-optimizations/52891 */ struct S { int a; struct T { unsigned c : 10; } b; } s; void bar (short x, short y, int **p) { if ((x && y) + **p) while (1); } void foo (int **p) { bar (s.a, s.b.c, p); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52891-2.c ================================================ /* PR tree-optimizations/52891 */ #if __SIZEOF_INT__ > 2 struct __attribute__((packed)) S { unsigned s : 22; }; #else struct __attribute__((packed)) S { unsigned s : 12; }; #endif struct __attribute__((packed)) T { struct S t; } c; int a, b, d; void foo (void) { if (1 ? (!c.t.s & (d < 0)) < a : 0) b = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr52979-1.c ================================================ /* PR middle-end/52979 */ struct S { unsigned int a : 16, b : 16, c : 16, d : 16, e : 14; unsigned int f : 4, g : 14, h : 8; char i; int j; }; void foo (struct S *s) { s->f = 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53058.c ================================================ /* PR tree-optimization/53058 */ int a, b, c; void foo () { c = b >> 16; if (c > 32767) c = 0; a = b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53163.c ================================================ /* PR tree-optimization/53163 */ struct S { int s; } b, f; int a, c; void foo (void) { int d, e; for (d = 4; d < 19; ++d) for (e = 2; e >= 0; e--) { a = 0; a = 1; } } void bar (void) { int g, h, i; for (i = 1; i >= 0; i--) { b = f; for (g = 0; g <= 1; g++) { if (c) break; for (h = 0; h <= 1; h++) foo (); foo (); } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53187.c ================================================ /* PR target/53187 */ void bar (int); void foo (int x, double y, double z) { _Bool t = z >= y; if (!t || x) bar (t ? 1 : 16); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53226.c ================================================ /* PR tree-optimization/53226 */ void foo (unsigned long *x, char y, char z) { int i; for (i = y; i < z; ++i) { unsigned long a = ((unsigned char) i) & 63UL; unsigned long b = 1ULL << a; *x |= b; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53409.c ================================================ /* PR tree-optimization/53409 */ int a, c, d, e, f; int b[0]; int main () { if (f) e = 0; int g = d; for (c = 0; c <= 1; c++) { for (a = 0; a <= 1; a = (char) a + 1) b[c] = g; a = 0; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53410-1.c ================================================ /* PR tree-optimization/53410 */ int *a, b, c, d; void foo (void) { for (; d <= 0; d++) b &= ((a || d) ^ c) == 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53410-2.c ================================================ /* PR tree-optimization/53410 */ typedef int V __attribute__((vector_size (4 * sizeof (int)))); typedef unsigned int W __attribute__((vector_size (4 * sizeof (int)))); void f1 (V *p) { *p = (*p & ((V) { 1, 1, 1, 1 })) ^ ((V) { 1, 1, 1, 1}); } void f2 (V *p) { *p = (*p ^ ((V) { 1, 1, 1, 1 })) & ((V) { 1, 1, 1, 1}); } void f3 (V *p) { *p = (~*p) & ((V) { 1, 1, 1, 1 }); } void f4 (V *p, V *q) { *p = (*p ^ *q) == *q; } void f5 (V *p, V *q) { *p = (*p ^ *q) == *p; } void f6 (V *p, V *q, V *r) { *p = (*p & *r) == (*q & *r); } void f7 (V *p, V *q, V *r) { *p = (*p & *r) == (*r & *q); } void f8 (V *p, V *q, V *r) { *p = (*r & *p) == (*q & *r); } void f9 (V *p, V *q, V *r) { *p = (*r & *p) == (*r & *q); } void f10 (W *p, W *q) { *p = *p < (((const W) { 1U, 1U, 1U, 1U }) << *q); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53411.c ================================================ /* PR middle-end/53411 */ /* { dg-require-effective-target untyped_assembly } */ int a, b, c, d, e, f, g, h; void fn1 (void); int fn2 (void); int fn3 (x) int x; { return a ? 0 : x; } void fn4 (char x) { int i, j, k; for (; e; e++) if (fn2 ()) { f = 1; k = 0; for (; k <= 1; k++) { j = ~x; i = f * j; h = (fn3 (i | 0 <= c ^ 9L) != b | d) & 8; g = x | 1; fn1 (); } } c = x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53418-1.c ================================================ void f (void) { int i = (0 ? 1 : 0U / 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53418-2.c ================================================ void f (void) { int i = (1 ? 0U / 0 : 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53495.c ================================================ /* PR rtl-optimization/53495 */ int a, b, c, d, e, g; static char fn1 (char p1, int p2) { return p1 || p2 < 0 || p2 >= 1 || 1 >> p2 ? p1 : 0; } static long long fn2 (int *, int); static int fn3 (); void fn4 () { fn3 (); fn2 (&a, d); } long long fn2 (int *p1, int p2) { int f = -1L; for (; c <= 1; c++) { *p1 = 0; *p1 = fn1 (c, p2 ^ f); } a = 0; e = p2; return 0; } int fn3 () { b = 3; for (; b; b--) c++; g = 0 >= c; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53519.c ================================================ /* PR rtl-optimization/53519 */ int a, b, c, d, e; short int foo (short int x) { return a == 0 ? x : 0; } short int bar (int x, int y) { return x + y; } void baz (void) { if (!e) { int f = foo (65535 ^ b); if (bar (!6L <= ~f, ~e) == c) d = 0; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53748.c ================================================ /* PR tree-optimization/53748 */ typedef unsigned int V __attribute__ ((__vector_size__ (sizeof (int) * 4))); void foo (int x, V *y) { *y = x ? ((V) { ~0U, ~0U, ~0U, ~0U }) : ((V) { 0, 0, 0, 0 }); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr53886.c ================================================ /* PR target/53886 */ typedef struct asn1_string_st ASN1_BIT_STRING; typedef struct bignum_st BIGNUM; typedef struct ec_group_st EC_GROUP; typedef struct ec_key_st EC_KEY; struct ec_key_st { EC_GROUP *group; BIGNUM *priv_key; unsigned int enc_flag; } X9_62_PENTANOMIAL; typedef struct ec_privatekey_st { ASN1_BIT_STRING *publicKey; } EC_PRIVATEKEY; extern EC_PRIVATEKEY* EC_PRIVATEKEY_new (void); extern void EC_PRIVATEKEY_free (EC_PRIVATEKEY*); extern unsigned char* CRYPTO_realloc (char*,int,const char*,int); int i2d_ECPrivateKey (EC_KEY * a, unsigned char **out) { int ret = 0, ok = 0; unsigned char *buffer = 0; unsigned buf_len = 0, tmp_len; EC_PRIVATEKEY *priv_key = 0; if (a == 0 || a->group == 0 || a->priv_key == 0) { ERR_put_error (16, (192), ((3 | 64)), "", 1234); goto err; } if ((priv_key = EC_PRIVATEKEY_new ()) == 0) { ERR_put_error (16, (192), ((1 | 64)), "", 1241); goto err; } if (!(a->enc_flag & 0x002)) { if (priv_key->publicKey == 0) { goto err; } if (tmp_len > buf_len) { unsigned char *tmp_buffer = CRYPTO_realloc ((char *) buffer, (int) tmp_len, "", 1293); buffer = tmp_buffer; } } if ((ret = i2d_EC_PRIVATEKEY (priv_key, out)) == 0) { } ok = 1; err: if (buffer) CRYPTO_free (buffer); if (priv_key) EC_PRIVATEKEY_free (priv_key); return (ok ? ret : 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54103-1.c ================================================ void f (void) { 0 || 0 / 0 ? : 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54103-2.c ================================================ void f (void) { 0 / 0 || 0 ? : 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54103-3.c ================================================ void f (void) { 1 && 0 / 0 ? : 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54103-4.c ================================================ void f (void) { 0 / 0 && 1 ? : 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54103-5.c ================================================ void f (void) { !(0 / 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54103-6.c ================================================ void f (void) { 0 || 65536*65536 ? : 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54321.c ================================================ /* PR tree-optimization/54321 */ struct S { char s[0]; } *a; void foo (void) { char *b = a->s; int c = 0; b[0] = 0; while (++c < 9) b[c] = 255; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54428.c ================================================ /* PR c/54428 */ typedef double _Complex C; C foo (C x, C y, double z, C w) { return y - z * __builtin_cpow (x, 75) * w; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54552-1.c ================================================ void f (void) { unsigned n = 10; typedef double T[n]; (double (*)[n])((unsigned char (*)[sizeof (T)]){ 0 }); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54559.c ================================================ /* PR c/54559 */ typedef double _Complex T; T foo (double x, double y) { return x + y * (T) (__extension__ 1.0iF); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54713-1.c ================================================ /* PR tree-optimization/54713 */ #ifndef N #define N 8 #define ONE 1, 1, 1, 1, 1, 1, 1, 1 #define ONEU 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U #endif typedef int V __attribute__((vector_size (N * sizeof (int)))); typedef unsigned int W __attribute__((vector_size (N * sizeof (int)))); void f1 (V *p) { *p = (*p & ((V) { ONE })) ^ ((V) { ONE}); } void f2 (V *p) { *p = (*p ^ ((V) { ONE })) & ((V) { ONE}); } void f3 (V *p) { *p = (~*p) & ((V) { ONE }); } void f4 (V *p, V *q) { *p = (*p ^ *q) == *q; } void f5 (V *p, V *q) { *p = (*p ^ *q) == *p; } void f6 (V *p, V *q, V *r) { *p = (*p & *r) == (*q & *r); } void f7 (V *p, V *q, V *r) { *p = (*p & *r) == (*r & *q); } void f8 (V *p, V *q, V *r) { *p = (*r & *p) == (*q & *r); } void f9 (V *p, V *q, V *r) { *p = (*r & *p) == (*r & *q); } void f10 (W *p, W *q) { *p = *p < (((const W) { ONEU }) << *q); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54713-2.c ================================================ /* PR tree-optimization/54713 */ #define N 16 #define ONE 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 #define ONEU 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U #include "pr54713-1.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54713-3.c ================================================ /* PR tree-optimization/54713 */ #define N 32 #define ONE 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 #define ONEU 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, \ 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U #include "pr54713-1.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr54925.c ================================================ /* PR target/54925 */ extern int bar; extern void foo (int *); static unsigned char * nr_memcpy (unsigned char *, unsigned char *, unsigned short); void baz (char *buf, unsigned short len) { unsigned char data[10]; if (len == 0) return; nr_memcpy (data, (unsigned char *) buf, len); foo (&bar); } static unsigned char * nr_memcpy (unsigned char * to, unsigned char * from, unsigned short len) { unsigned char *p = to; while (len > 0) { len--; *to++ = *from++; } return p; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr55273.c ================================================ extern int debug_threads; extern void sigsuspend (void); void my_waitpid (int flags, int wnohang) { while (1) { if (flags & 0x80000000) { if (wnohang) break; if (debug_threads) __builtin_puts ("blocking\n"); sigsuspend (); } flags ^= 0x80000000; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr55350.c ================================================ void foo (__INTPTR_TYPE__ x, __INTPTR_TYPE__ y) { int i; void **a = (void *) (8UL * (x / 8UL)); for (i = 0; i < x; i++) a[i] = (void *) y; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr55569.c ================================================ /* { dg-options "-ftree-vectorize" } */ int *bar (void); void foo (void) { long x; int *y = bar (); for (x = -1 / sizeof (int); x; --x, ++y) *y = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr55832.c ================================================ /* PR tree-optimization/55832 */ int g, b; void foo (void) { union U { int i; unsigned short s; } a = { 0 }; unsigned char c; unsigned short d = 0, *p = &a.s; if (g) a.i--; if (b && a.i < (d = 1)) return; for (; a.i < 15; a.i++) b |= d <= c; if (!*p) g = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr55851.c ================================================ /* PR middle-end/55851 */ /* { dg-require-effective-target alloca } */ enum { A = 1UL, B = -1UL } var = A; void foo (char *); void test (void) { char vla[1][var]; vla[0][0] = 1; foo (&vla[0][0]); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr55920.c ================================================ /* PR tree-optimization/55920 */ struct A { unsigned a; } __attribute__((packed)); struct B { int b; unsigned char c[16]; }; void bar (struct A); void foo (struct B *x) { struct A a; if (x->b) __builtin_memcpy (&a, x->c, sizeof a); else a.a = 0; bar (a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr55921.c ================================================ /* PR tree-optimization/55921 */ typedef union { _Complex float cf; long long ll; } ucf; void foo (ucf *in, ucf *out, _Complex float r) { int i; ucf ucf1; _Complex float cf; ucf1.ll = in[i].ll; __asm ("" : "=r" (cf) : "r" (ucf1.ll)); cf *= r; __asm ("" : "=r" (ucf1.ll) : "r" (cf)); out[i].ll = ucf1.ll; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr55955.c ================================================ /* { dg-require-effective-target int32plus } */ /* PR tree-optimization/55955 */ int b; void foo (int x) { int a; for (a = x; a < 2; a++) for (b = 0; b < 2; b++) *(unsigned short *) 0x100000UL %= 46; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr56405.c ================================================ /* PR inline-asm/56405 */ void foo (void) { asm volatile ("" : "+m" (*(volatile unsigned short *) 0x1001UL)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr56448.c ================================================ /* PR tree-optimization/56448 */ volatile int a[1]; int b; void foo () { for (;;) { int *c[3][6] = { 0, 0, 0, &b, 0, 0, 0, 0, &b, 0, 0, 0, 0, 0, 0, 0, &b, (int *) &a[0] }; b = *c[2][5]; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr56484.c ================================================ /* PR rtl-optimization/56484 */ unsigned char b[4096]; int bar (void); int foo (void) { int a = 0; while (bar ()) { int c = bar (); a = a < 0 ? a : c; __builtin_memset (b, 0, sizeof b); } return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr56539.c ================================================ /* PR tree-optimization/56539 */ short foo (const char *x, unsigned y) { return y > 1 ? (x[y - 1] - '0') + 10 * foo (x, y - 1) : (*x - '0'); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr56571.c ================================================ /* { dg-options "-funroll-loops -ftracer" } */ int a, b; int f(void) { (a % b) && f(); a = (0 || a | (a ? : 1)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr56745.c ================================================ /* PR rtl-optimization/56745 */ unsigned char a[6]; void foo () { int i; for (i = 5; i >= 0; i++) { if (++a[i] != 0) break; ++a[i]; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr56984.c ================================================ /* PR tree-optimization/56984 */ int foo (int x) { if ((x >> 31) < -1) x++; return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr57108.c ================================================ /* PR target/57108 */ void __assert_func (void) __attribute__ ((__noreturn__)); void ATATransfer (int num, int buffer) { int wordCount; while (num > 0) { wordCount = num * 512 / sizeof (int); ((0 == (buffer & 63)) ? (void)0 : __assert_func () ); ((0 == (wordCount & 31)) ? (void)0 : __assert_func ()); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr57331.c ================================================ /* PR tree-optimization/57331 */ int foo (int x) { void *p = x ? (void *) 1 : (void *) 0; __INTPTR_TYPE__ b = (__INTPTR_TYPE__) p; if (b) return 0; return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr57441.c ================================================ /* PR tree-optimization/57441 */ int a, c, d, *e; unsigned char b; char baz (char p1) { return p1 * a; } void func_65 (); func_1 () { func_65 (); func_65 (); } void func_65 () { d = baz (b--); if (*e) b--; c = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr57698.c ================================================ typedef int (*IsAcceptableThis) (const int ); inline int fn1 (IsAcceptableThis p1) { p1 (0); return 0; } __attribute__ ((always_inline)) inline int fn2 (const int a) { return 0; } void fn3 () { fn1 (fn2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr58088.c ================================================ int bar (int i) { return 1 | ((i * 2) & 254); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr58164.c ================================================ /* PR tree-optimization/58164 */ /* { dg-require-effective-target indirect_jumps } */ int foo (void) { int x = 0; goto *&x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr58332.c ================================================ static inline int foo (int x) { return x + 1; } __attribute__ ((__optimize__ (0))) int bar (void) { return foo (100); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr58340.c ================================================ int a, b, c, d; int foo (int x, int y) { return y == 0 ? x : 1 % y; } int main () { c = 0 || a; for (;;) b = foo (d, c) && 1; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr58343.c ================================================ int a; int main () { int b = a; for (a = 1; a > 0; a--) ; lbl: if (b && a) goto lbl; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr58344.c ================================================ /* PR middle-end/58344 */ /* { dg-do compile } */ struct U {}; static struct U a[1]; extern void bar (struct U); void foo (void) { bar (a[0]); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr58775.c ================================================ /* PR tree-optimization/58775 */ void bar (void); void foo (char *x) { char a; _Bool b, c, d, e, f, g, h, i, j, k, l, m; a = *x; b = a == 100; c = a == 105; d = b | c; e = a != 111; f = !d; g = e & f; h = a != 117; i = g & h; j = a != 120; k = i & j; l = a != 88; m = k & l; if (m == 0) bar (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr58946.c ================================================ /* PR tree-optimization/58946 */ int foo (unsigned int c) { unsigned int d, e, f; if ((int) c < 0) d = 0; else d = c; if (d == 0) e = __INT_MAX__ + 1U; else e = d; if ((int) e < 0) f = 0; else f = e; return f; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr58970-1.c ================================================ /* PR middle-end/58970 */ struct T { int b : 1; }; struct S { struct T t[1]; }; void foo (int x, struct S *s) { if (x == -1) s->t[x].b = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr58970-2.c ================================================ /* PR middle-end/58970 */ struct T { char a : 8; char b : 1; }; struct S { char x; struct T t[1]; }; void foo (int x, struct S *s) { if (x == -1) s->t[x].b = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr58978.c ================================================ /* PR tree-optimization/58978 */ int foo (int x) { switch (x) { case 0: case 1: case 9: break; default: __builtin_unreachable (); } return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr58997.c ================================================ /* PR rtl-optimization/58997 */ int a, b, c, e; short d; char h; void foo () { while (b) { d = a ? c : 1 % a; c = d; h = d; if (!h) while (e) ; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr59102.c ================================================ int a, b, c, f; struct S { int f0; } d, *e; struct S foo () { b = c = b || a == 0 || f % 11; return d; } int main () { foo (); if (b); else { struct S **g = &e; *g = 0; *e = foo (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr59119.c ================================================ extern void *memmove (void *, const void *, __SIZE_TYPE__); extern void *memset (void *, int, __SIZE_TYPE__); typedef struct { long n_prefix; long n_spadding; } NumberFieldWidths; void fill_number(char *buf, const NumberFieldWidths *spec) { if (spec->n_prefix) { memmove(buf, (char *) 0, spec->n_prefix * sizeof(char)); buf += spec->n_prefix; } if (spec->n_spadding) { memset(buf, 0, spec->n_spadding); buf += spec->n_spadding; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr59134.c ================================================ /* { dg-do compile } */ extern void* malloc(__SIZE_TYPE__) __attribute__((malloc)); typedef struct { char pad; int arr[0]; } __attribute__((packed)) str; str * foo (void) { str *s = malloc (sizeof (str) + sizeof (int)); s->arr[0] = 0x12345678; return s; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr59322.c ================================================ int a, b, d; short c; int foo () { for (b = 0; b; b = a) for (c = 18; c < 10; c++) { d = c; if (d) return 0; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr59362.c ================================================ /* PR tree-optimization/59362 */ char * foo (char *r, int s) { r = __builtin___stpcpy_chk (r, "abc", __builtin_object_size (r, 1)); if (s) r = __builtin___stpcpy_chk (r, "d", __builtin_object_size (r, 1)); return r; } char *a; long int b; void bar (void) { b = __builtin_object_size (0, 0); a = __builtin___stpcpy_chk (0, "", b); b = __builtin_object_size (a, 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr59386.c ================================================ /* PR tree-optimization/59386 */ struct S { int s; }; struct T { int t; struct S u; } c; int b; struct S foo () { struct T d; if (b) while (c.t) ; else return d.u; } struct S bar () { struct T a; a.u = foo (); return a.u; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr59417.c ================================================ /* PR tree-optimization/59417 */ /* { dg-skip-if "ptxas times out" { nvptx-*-* } { "-O1" "-O2" "-Os" } { "" } } */ int a, b, d; short c; void f (void) { if (b) { int *e; if (d) { for (; b; a++) lbl1: d = 0; for (; d <= 1; d++) { int **q = &e; for (**q = 0; **q <= 0; **q++) d = 0; } } } else { int t; for (c = 0; c < 77; c++) for (c = 0; c < 46; c++); for (; t <= 0; t++) lbl2: ; goto lbl1; } goto lbl2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr59569-1.c ================================================ /* PR middle-end/59569 */ extern char c; void foo (int i, char **j) { while (i) j[--i] = &c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr59569-2.c ================================================ /* PR middle-end/59569 */ void foo (int *a, int b) { for (; b; b--) a[b] = 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr59743.c ================================================ /* PR middle-end/59743 */ typedef union { long all; struct { int low; int high; } s; } udwords; int a, b, c, d; void __udivmoddi4() { udwords r; d = __builtin_clz(0); r.s.low = 0; for (; d; --d) { r.s.high = r.s.high << 1 | r.s.low >> a; r.s.low = r.s.low << b >> 1; int s = -r.all; c = s; r.all--; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr59803.c ================================================ /* PR target/59803 */ extern void baz (void) __attribute__ ((__noreturn__)); struct A { int g, h; }; extern struct A a; struct B { unsigned char i, j, k, l, m; }; int c, d, e; static int f; void foo (void) { f = 1; } void bar (struct B *x) { x->i = e; x->k = c; x->l = d; x->j = a.h; x->m = f; if (x->i != e) baz (); if (x->k != c) baz (); if (x->j != a.h) baz (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr59919.c ================================================ typedef int jmp_buf[10]; struct S { int i; jmp_buf buf; }; void setjmp (jmp_buf); void foo (int *); __attribute__ ((__noreturn__, __nonnull__)) void bar (struct S *); void baz (struct S *p) { bar (p); setjmp (p->buf); foo (&p->i); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr60071.c ================================================ int foo (int cls, int sign) { if (__builtin_expect (cls == 4, 0)) return (sign ? (-((int) ((~(unsigned)0) >> 1)))-1 : ((int) ((~(unsigned)0) >> 1))); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr60268.c ================================================ /* { dg-options "-flive-range-shrinkage" } */ void f() { int i = 0; void *p = 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr60502.c ================================================ /* PR tree-optimization/60502 */ typedef signed char v16i8 __attribute__ ((vector_size (16))); typedef unsigned char v16u8 __attribute__ ((vector_size (16))); void foo (v16i8 *x) { v16i8 m1 = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; *x |= *x ^ m1; } void bar (v16u8 *x) { v16u8 m1 = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; *x |= *x ^ m1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr60556.c ================================================ /* PR middle-end/60556 */ int g (int); unsigned long long f (void) { return (unsigned long long)(long)&g; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr60655-1.c ================================================ /* { dg-options "-fdata-sections" { target { { ! { { hppa*-*-hpux* } && { ! lp64 } } } && { ! nvptx-*-* } } } } */ typedef unsigned char unit; typedef unit *unitptr; extern short global_precision; typedef __SIZE_TYPE__ size_t; extern void *memcpy (void *dest, const void *src, size_t n); short mp_compare(const unit* r1, const unit* r2) { register short precision; precision = global_precision; (r1) = ((r1)+(precision)-1); (r2) = ((r2)+(precision)-1); do { if (*r1 < *r2) return(-1); if (*((r1)--) > *((r2)--)) return(1); } while (--precision); } static unit modulus[((1280+(2*8))/8)]; static unit d_data[((1280+(2*8))/8)*2]; int upton_modmult (unitptr prod, unitptr multiplicand, unitptr multiplier) { unitptr d = d_data; while (mp_compare(d,modulus) > 0) memcpy((void*)(prod), (const void*)(d), (global_precision)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr60655-2.c ================================================ typedef unsigned char unit; typedef unit *unitptr; extern short global_precision; typedef __SIZE_TYPE__ size_t; extern void *memcpy (void *dest, const void *src, size_t n); short mp_compare(const unit* r1, const unit* r2) { register short precision; precision = global_precision; (r1) = ((r1)+(precision)-1); (r2) = ((r2)+(precision)-1); do { if (*r1 < *r2) return(-1); if (*((r1)--) > *((r2)--)) return(1); } while (--precision); } static unit modulus[((1280+(2*8))/8)]; static unit d_data[((1280+(2*8))/8)*2]; int upton_modmult (unitptr prod, unitptr multiplicand, unitptr multiplier) { unitptr d = d_data; while (mp_compare(d,modulus) > 0) memcpy((void*)(prod), (const void*)(d), (global_precision)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr61042.c ================================================ /* PR tree-optimization/61042 */ int a, b, c[1], d, f; void foo () { for (; b; b++) c[0] = c[f] && (d = a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr61222-1.c ================================================ int a, b, d, e; char c; void foo () { for (; a; a++) { d = ((b == 0) ^ (129 + a)); c = d * 9; e = c < 1; if (e) for (;;) ; } } int main () { foo (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr61222-2.c ================================================ int a, b, d; int main (void) { int c = a && 1; d = 1 << (((c | (b - 842)) << 1) + 1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr61684.c ================================================ /* PR tree-optimization/61684 */ /* { dg-xfail-if "ptxas crashes" { nvptx-*-* } { "*" } { "-O0" "-O1" "-Os" } } */ int a, c; static int *b = 0; short d; static short **e = 0; void foo () { for (; c < 1; c++) ; *e = &d; a = d && (c && 1) & *b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr61848.c ================================================ /* { dg-do compile } */ /* { dg-require-effective-target named_sections } */ /* { dg-final { scan-assembler "mysection" } } */ extern char foo; char foo __attribute__ ((__section__(".mysection"))); ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr62312.c ================================================ /* PR target/62312 */ typedef struct { unsigned int arg[100]; } *FunctionCallInfo; typedef struct { int day; int month; } Interval; void* palloc (unsigned int); int bar (void); void baz (void); void interval_pl (FunctionCallInfo fcinfo) { Interval *span1 = ((Interval *) ((char *) ((fcinfo->arg[0])))); Interval *span2 = ((Interval *) ((char *) ((fcinfo->arg[1])))); Interval *result = (Interval *) palloc (sizeof (Interval)); if ((((span1->month) < 0) == ((span2->month) < 0)) && !(((result->month) < 0) == ((span1->month) < 0))) do { if (bar ()) baz (); } while(0); result->day = span1->day + span2->day; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr63282.c ================================================ /* PR inline-asm/63282 */ void bar (void); void foo (void) { asm volatile goto ("" : : : : a, b); a: bar (); b: return; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr63761.c ================================================ int a, b; short c; void fn1 (); void fn2 (unsigned short p1) { int d; c = p1 >> 8 | p1 << 8; d = b; if (d) fn1 (); a = d >> 8 & 0x00FF | d << 8 & 0xFF00; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr64067.c ================================================ /* PR middle-end/64067 */ struct S { int s; }; int *const v[1] = { &((struct S) { .s = 42 }).s }; int * foo (void) { return v[0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr64269.c ================================================ /* PR tree-optimization/64269 */ void foo (char *p) { __SIZE_TYPE__ s = ~(__SIZE_TYPE__)0; *p = 0; __builtin_memset (p + 1, 0, s); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr64494.c ================================================ /* PR tree-optimization/64494 */ int a, b; unsigned char c; int main () { int d; a = 0; for (d = 0; d < 2; d++) { a &= (b >= 1); c = (204 > (((unsigned char) ~0) >> a)) ? 0 : 204 << a; b = 0; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr65014.c ================================================ /* PR tree-optimization/65014 */ /* { dg-do compile { target int32plus } } */ extern int x; unsigned foo (unsigned int y) { return (y << ((__INTPTR_TYPE__) &x)) | (y >> (32 - ((__INTPTR_TYPE__) &x))); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr65153.c ================================================ /* { dg-additional-options "-fPIC" { target fpic } } */ typedef unsigned long word32; typedef unsigned char byte; typedef struct cast256_instance { word32 l_key[96];} cast256_key; word32 cast256_sbox[4][256] = {}; void key (cast256_key *key, const word32 *in_key, const int key_len) { word32 i, j, t, u, cm, cr, lk[8], tm[8], tr[8]; for (i = 0; i < 96; i += 8) { for (j = 0; j < 8; ++j) { tm[j] = cm; cm += 0x6ed9eba1; tr[j] = cr; cr += 17; } t = (((tm[0] + lk[7]) << ((word32)(tr[0] & 31))) | ((tm[0] + lk[7]) >> (32 - (word32)(tr[0] & 31)))); u = cast256_sbox[0][((byte)((t) >> (8 * 3)))]; u ^= cast256_sbox[1][((byte)((t) >> (8 * 2)))]; lk[7] ^= u; for (j = 0; j < 8; ++j) { cm += 0x6ed9eba1; tr[j] = cr; cr += 17; } t = (((tm[0] + lk[7]) << ((word32)(tr[0] & 31))) | ((tm[0] + lk[7]) >> (32 - (word32)(tr[0] & 31)))); u = cast256_sbox[0][((byte)((t) >> (8 * 3)))]; u ^= cast256_sbox[1][((byte)((t) >> (8 * 2)))]; u -= cast256_sbox[2][((byte)((t) >> (8 * 1)))]; lk[2] ^= u; lk[7] ^= u; key->l_key[i + 1] = lk[2]; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr65163.c ================================================ /* PR target/65163 */ typedef unsigned int uint32_t; typedef unsigned short uint16_t; union unaligned_32 { uint32_t l; } __attribute__((packed)); union unaligned_16 { uint16_t l; } __attribute__((packed)); int test_00 (unsigned char* buf, int bits_per_component) { (((union unaligned_32*)(buf))->l) = __builtin_bswap32 (bits_per_component == 10 ? 1 : 0); return 0; } int test_01 (unsigned char* buf, int bits_per_component) { (((union unaligned_16*)(buf))->l) = __builtin_bswap16 (bits_per_component == 10 ? 1 : 0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr65241.c ================================================ enum E { A, B, C, D }; void fn4 (void); int fn1 (enum E p1) { static int w[D]; if (w[p1]) switch (p1) case C: w[p1] = 0; } void fn2 (p1) { fn1 (p1); } void fn3 (enum E p1) { fn2 (p1); fn4 (); fn2 (p1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr65540.c ================================================ long double func1 (long double x) { if (x > 0.0) return x; else if (x < 0.0) return -x; else return x; } long double func2 (long double x) { if (x > 0.0) return x; else if (x < 0.0) return -x; else return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr65593.c ================================================ /* PR target/65593 */ /* { dg-additional-options "-fpie" { target pie } } */ #include "pr20928.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr65595.c ================================================ extern void *memcpy(void *, const void *, unsigned long); struct in6_addr { struct { int u6_addr32[4]; }; }; struct foo { struct in6_addr daddr; struct in6_addr saddr; } a; extern void ip6_route_output(struct foo, int); int b; static void find_route_ipv6(struct in6_addr *p1) { if (p1) memcpy(0, p1, sizeof(struct in6_addr)); ip6_route_output(a, b); } void cxgbi_ep_connect() { find_route_ipv6(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr65680.c ================================================ /* PR middle-end/65680 */ /* { dg-do compile { target lp64 } } */ struct S { int f : 1; } a[100000000000000001][3]; void foo (void) { struct S b = { 0 }; a[100000000000000000][0] = b; } void bar (void) { a[100000000000000000][0].f = 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr65735.c ================================================ /* PR tree-optimization/65735 */ int foo (void); void bar (int a, int b, int c) { while (!a) { c = foo (); if (c == 7) c = b; switch (c) { case 1: a = b++; if (b) b = 1; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr65803.c ================================================ /* { dg-options "-fno-strict-overflow" } */ typedef unsigned char __uint8_t; typedef __uint8_t uint8_t; typedef uint8_t u8_t; typedef struct ip_addr ip_addr_t; char * ipaddr_ntoa_r (const ip_addr_t * addr, char *buf, int buflen) { char inv[3]; char *rp; u8_t *ap; u8_t n; u8_t i; int len = 0; for (n = 0; n < 4; n++) { while (*ap); while (i--) { if (len++ >= buflen) return ((void *) 0); *rp++ = inv[i]; } ap++; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr65873.c ================================================ typedef __SIZE_TYPE__ size_t; extern inline __attribute__ ((__always_inline__, __gnu_inline__, __artificial__, __nothrow__, __leaf__)) void * memcpy (void *__restrict __dest, const void *__restrict __src, size_t __len) { return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0)); } __attribute__((optimize ("Ofast"))) void bar (void *d, void *s, size_t l) { memcpy (d, s, l); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr65875.c ================================================ /* PR tree-optimization/65875 */ int a, b, c, d, e, f, g; void foo (void) { long h = 0, i; if (g < 0) i = -g; for (; b;) for (; c;) if (e) h = 1; for (; f;) if (a) break; if (h > i) while (h > i) { d = 0; h--; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr66168.c ================================================ int a, b; void fn1 () { for (;;) { for (b = 0; b < 3; b++) { char e[2]; char f = e[1]; a ^= f ? 1 / f : 0; } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr67106.c ================================================ /* { dg-options "-g -fpack-struct" } */ typedef struct S S; struct S { struct { S *s; }; int a; }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr67143.c ================================================ long a, c; int b; int d; void ut_dbg_assertion_failed() __attribute__((noreturn)); long dict_index_is_spatial(int *); void btr_block_get_func(char *); long btr_page_get_level_low(unsigned char *); void btr_validate_level(long p1) { unsigned char *e; while (p1 != btr_page_get_level_low(e)) { if (__builtin_expect(b, 0)) ut_dbg_assertion_failed(); if (dict_index_is_spatial(&d)) while (c != 5535) { __sync_add_and_fetch(&a, 536870912); btr_block_get_func(""); } } for (long i; i; ++i) btr_validate_level(-i); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr67506.c ================================================ extern struct _IO_FILE *stderr; typedef long integer; typedef unsigned char byte; short nl; byte * tfmfilearray; integer charbase, ligkernbase; unsigned char charsonline; short c; unsigned short r; struct { short cc; integer rr; } labeltable[259]; short sortptr; unsigned char activity[(32510) + 1]; integer ai, acti; extern void _IO_putc (char, struct _IO_FILE *); void mainbody (void) { register integer for_end; if (c <= for_end) do { if (((tfmfilearray + 1001)[4 * (charbase + c) + 2] % 4) == 1) { if ( r < nl ) ; else { while (labeltable[sortptr ].rr > r) labeltable[sortptr + 1 ]= labeltable[sortptr]; } } } while (c++ < for_end); if (ai <= for_end) do { if (activity[ai]== 2) { r = (tfmfilearray + 1001)[4 * (ligkernbase + (ai))]; if (r < 128) { r = r + ai + 1 ; if (r >= nl) { if (charsonline > 0) _IO_putc ('\n', stderr); } } } } while (ai++ < for_end); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr67816.c ================================================ int a, c, d, e; int b[10]; void fn1() { int i, f = 0; for (;;) { i = 0; for (; i < a; i++) if (c) { if (b[i]) f = 1; } else if (b[i]) f = 0; if (f) d++; while (e) ; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr68013.c ================================================ int a, b, c, d, e, f; void fn1 () { for (; e;) { e = f; for (; b;) { b = a; f = a || d ? 0 : c; } d = 0; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr69102.c ================================================ /* { dg-options "-Og -fPIC -fschedule-insns2 -fselective-scheduling2 -fno-tree-fre --param=max-sched-extend-regions-iters=10" } */ void bar (unsigned int); void foo (void) { char buf[1] = { 3 }; const char *p = buf; const char **q = &p; unsigned int ch; switch (**q) { case 1: ch = 5; break; case 2: ch = 4; break; case 3: ch = 3; break; case 4: ch = 2; break; case 5: ch = 1; break; default: ch = 0; break; } bar (ch); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr69161.c ================================================ /* PR target/69161. */ char a; int b, c, d, e; void foo (void) { int f; for (f = 0; f <= 4; f++) { for (d = 0; d < 20; d++) { __INTPTR_TYPE__ g = (__INTPTR_TYPE__) & c; b &= (0 != g) > e; } e &= a; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr69209.c ================================================ /* PR tree-optimization/69209 */ int a, c, *d, e; void foo (void) __attribute__ ((__noreturn__)); int bar (void) { int f; if (a) { if (e) foo (); foo (); } if (d != &f) foo (); if (!c) foo (); return f; } void baz () { bar (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr69214.c ================================================ /* PR tree-optimization/69214 */ extern void bar (void); extern int __setjmp (char *); void foo (char *p) { int d = 0; bar (); if (__setjmp (p)) return; long a = d; d = 8; if (!a) bar (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr69740-1.c ================================================ char a; short b; void fn1() { if (b) ; else { int c[1] = {0}; l1:; } if (a) goto l1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr69740-2.c ================================================ inline int foo(int *p1, int p2) { int z = *p1; while (z > p2) p2 = 2; return z; } int main() { int i; for (;;) { int j, k; i = foo(&k, 7); if (k) j = i; else k = j; if (2 != j) __builtin_abort(); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr69989-2.c ================================================ int a, b, d; short c[] = {4073709551611, 1, 4, 4}; void fn1() { if (a) goto LABEL_vhvhP; for (;;) { for (; b; b++) d = c[b + 3] | c[b]; LABEL_vhvhP: if (d) break; } } int main() { return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr69999.c ================================================ int uh; void ha(void) { while (uh) { for (uh = 0; uh < 1; ++uh) { uh = 0; if (uh != 0) ts: uh %= uh; } ++uh; } goto ts; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr70061.c ================================================ typedef int v8si __attribute__ ((vector_size (32))); int foo(v8si c, v8si d) { l0: if (c[2]) d ^= c; return d[3]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr70190.c ================================================ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target label_values } */ int fn1 () { static char a[] = "foo"; static void *b[] = { &&l1, &&l2 }; goto *(b[1]); l1: goto *(a[0]); l2: return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr70199.c ================================================ static volatile int v = 0; static void benchmark(long runs) { void* labels[] = { &&l0, &&l1, &&l2 }; for(unsigned int mask = 0x1F; mask > 0; mask >>= 1) { unsigned lfsr = 0xACE1u; long n = 10000000; while(n > 0) { l2: v; l1: v; goto *labels[lfsr & mask]; l0: n--; } } } int f(void) { benchmark(10000000); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr70240.c ================================================ typedef short v16hi __attribute__ ((vector_size (32))); typedef int v8si __attribute__ ((vector_size (32))); typedef long long v4di __attribute__ ((vector_size (32))); int foo(int u16_0, int u32_0, int u64_0, int u16_1, int u32_1, int u64_1, v16hi v32u16_0, v8si v32u32_0, v4di v32u64_0, v16hi v32u16_1, v8si v32u32_1, v4di v32u64_1) { do { v32u16_1 += (v16hi){ v32u32_1[7], ~v32u32_1[3], 0, v32u64_0[0]}; u32_0 = (u32_0 << 31) | (u32_0 >> ~v32u32_0[1]); u64_0 += 1; v32u64_0[2] <<= v32u64_0[2] & 63; u16_1 = (u16_1 >> (v32u16_0[11] & 15)) | (u16_1 << (-v32u16_0[11] & 15)); v32u16_0 -= ~v32u16_1; v32u32_1[5] += u32_1; if (v32u32_1[3] >= 0) { u64_1 -= ~v32u64_1[1]; v32u16_1 += (v16hi){ -u64_1, ~u32_0, ~u16_1, v32u32_1[1], 0, ~v32u16_1[2], ~v32u64_1[2], ~v32u32_0[7]}; } v32u64_1 += (v4di){0, 0, ~v32u32_0[5]}; v32u32_1 *= (v8si){0, ~v32u32_1[6]}; v32u64_0[3] &= 0x1234; v32u64_0 += (v4di){v32u32_1[6]}; } while (u16_0 < 0x1234); return u64_0 + u16_1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr70263-1.c ================================================ int a[91]; int b, c; void fn1() { int n, m; do { a[c--]; a[--c] = m; a[--m] = b; } while (n); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr70355.c ================================================ /* { dg-require-effective-target int128 } */ /* { dg-additional-options "-g" } */ typedef unsigned __int128 v2ti __attribute__ ((vector_size (32))); unsigned foo (unsigned i, v2ti v) { do { i--; v %= ~v; } while (i); return v[0] + v[1]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr70633.c ================================================ /* PR middle-end/70633 */ typedef long V __attribute__((vector_size (4 * sizeof (long)))); void foo (V *); void bar (void) { V b = { (long) bar, 0, 0, 0 }; foo (&b); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr70916.c ================================================ /* PR tree-optimization/70916 */ int a, b, c, d, i, k; int static *e = &b, *j; int **f; int static ***g = &f; int *h; void fn1 () { for (;;) { int l[1] = { }; int m = (__UINTPTR_TYPE__) l; for (; d; d--) { int ****n; int *****o = &n; i = a & 7 ? : a; *e = (((*o = &g) != (int ****) g) < h[c], 0) || k; if (*e) { **n = &j; *e = (__UINTPTR_TYPE__) h; } } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr71693.c ================================================ /* PR middle-end/71693 */ unsigned short v; void foo (int x) { v = ((((unsigned short) (0x0001 | (x & 0x0070) | 0x0100) & 0x00ffU) << 8) | (((unsigned short) (0x0001 | (x & 0x0070) | 0x0100) >> 8) & 0x00ffU)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr71916.c ================================================ /* PR rtl-optimization/71916 */ int a, b, c, d, f, g; short h; short foo (short p1) { return a >= 2 || p1 > 7 >> a ? p1 : p1 << a; } void bar (void) { for (;;) { int i, j[3]; h = b >= 2 ? d : d >> b; if (foo (f > h ^ c)) { d = 0; while (f <= 2) { char k[2]; for (;;) k[i++] = 7; } } else for (;;) g = j[2]; if (g) for (;;) ; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pr72802.c ================================================ static a[]; static b, h, m, n, o, p, q, t, u, v, t5, t6, t16, t17, t18, t25; c; static volatile d; static volatile e; static volatile f; static volatile g; j; static volatile k; static volatile l; static volatile r; const volatile s; static volatile w; static volatile x; const volatile y; static volatile z; static volatile t1; static volatile t2; const t3; t4; const volatile t8; const volatile t9; const volatile t10; static volatile t11; static volatile t12; static volatile t13; static volatile t14; const volatile t15; static volatile t19; static volatile t20; const volatile t21; static volatile t22; static volatile t23; const volatile t24; *t29; fn1() { b = 5; } fn2(long); #pragma pack(1) struct S0 { short f3; float f4; signed f5 }; const struct S0 t7[] = {}; static fn3() { int t26[] = {}; int t27[10] = {}; --t25; if (fn4()) { t5++; fn5(); int t28[] = {t26, t27}; return; } } fn6() { int i, t30 = 0; if (fn6 == 2) t30 = 1; { int t31, i = 0; for (; i < 256; i++) { t31 = i; if (i & 1) t31 = 0; a[i] = t31; } i = 0; for (; i < 3; i++) t29[i] = t6; fn7(); fn3(); t4 = c = j = 0; } fn2(h); if (t30) printf(b); g; fn2(g); printf(b); f; fn2(f); if (t30) printf(b); e; fn2(e); printf(b); fn8(); d; fn2(d); if (t30) printf(b); l; fn2(l); printf(b); k; fn2(k); if (t30) printf(b); printf(b); for (; i; i++) { y; fn2(y); printf(b); x; fn2(x); if (t30) printf(b); w; fn2(w); printf(b); fn2(v); printf(b); fn2(u); if (t30) printf(b); fn2(t); printf(b); s; fn2(s); if (t30) printf(b); r; fn2(r); printf(b); fn2(q); if (t30) printf(b); fn2(p); printf("", b); fn2(o); printf(b); fn2(n); if (t30) printf(b); fn2(m); printf(b); } fn2(z); if (t30) printf(b); printf("", t3); t2; fn2(t2); printf(b); t1; fn2(t1); if (t30) printf(b); for (; i < 6; i++) { t10; fn2(t10); printf(b); t9; fn2(t9); if (t30) printf(b); t8; fn2(t8); printf(b); fn2(t7[i].f3); if (t30) printf(b); fn2(t7[i].f4); printf(b); fn2(t7[i].f5); if (t30) printf(b); t15; fn2(t15); printf(b); t14; fn2(t14); if (t30) printf(b); t13; fn2(t13); printf(b); t12; fn2(t12); if (t30) printf(b); t11; fn2(t11); printf(b); t21; fn2(t21); if (t30) printf(b); t20; fn2(t20); fn2(t19); if (t30) printf(b); fn2(t18); printf(b); fn2(t17); printf(b); fn2(t16); printf(b); } t24; t24; if (t30) printf(b); printf(t23); t22; t22; if (t30) printf(b); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pret-arg.c ================================================ foo (a, b, c, d, e, f, g, h, i, j, xx) double xx; { return xx + 1.2345; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pta-1.c ================================================ typedef struct JSObject JSObject; typedef struct JSObjectMap *(*JSNewObjectMapOp) (JSObject *obj); typedef JSObject *(*JSGetMethodOp) (JSObject *obj); struct JSObjectOps { JSNewObjectMapOp newObjectMap; }; struct JSXMLObjectOps { struct JSObjectOps base; JSGetMethodOp getMethod; }; struct JSObjectMap { struct JSObjectOps *ops; }; struct JSObject { struct JSObjectMap *map; }; struct JSXMLObjectOps js_XMLObjectOps; /* We need to create SFT's for the entire structure when this address is taken, not just the part in the component reference itself. */ JSObject *JS_GetMethod(JSObject *obj) { if (obj->map->ops == &js_XMLObjectOps.base) { struct JSXMLObjectOps *ops; ops = (struct JSXMLObjectOps *) obj->map->ops; obj = ops->getMethod(obj); } return obj; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/ptr-conv-1.c ================================================ /* The intermediate conversion to __PTRDIFF_TYPE__ could be lost, resulting in an "invalid types in nop conversion" ICE. */ long long a; void f (void) { int c = 1; volatile int *p = &c; a = (long long) (__PTRDIFF_TYPE__) p; *p; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pyr.c ================================================ foo (char *a) { char b; int c; b = *a; c = b; if (c < 0) return 1; a[1] = b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/pyr2.c ================================================ foo (a) { return ((int *)0)[a]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/q.c ================================================ unsigned reg0indreg1 (r0, p1) unsigned short r0; unsigned short p1; { return (r0 + p1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/r.c ================================================ r (a, b) { if (a < b) return 1; else return 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/r1.c ================================================ void assert (a) {if (a != 1) abort ();} int h1 (int *p) {return *p & 255;} void p1 () {int a = 0x01020304; assert (h1 (&a) == 0x04);} int h2 (a) {return a > 0;} p2 () {assert (h2 (1));} h3 (int *p) { *p |= 255; } p3 () { int *p; h3 (p); } main () { p1 (); p2 (); p3 (); puts ("Compiler test passed."); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/rel.c ================================================ foo (int *c, int b) { int a; a = *c + b; c[1] = a; return b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/rmsc.c ================================================ cc1 (x, y) int x, y; { int z; z = x - y; if (x >= y) return z + 1; else return z + 0; } cc2 (x, y) int x, y; { int z; z = x - y; if (z >= 0) return z + 1; else return z + 0; } cc3 (x, y) unsigned x, y; { unsigned z; z = x - y; if (x >= y) return z + 1; else return z + 0; } cc4 (x, y) unsigned x, y; { unsigned z; z = x - y; if (z >= 0) return z + 1; else return z + 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/round.c ================================================ foo (a) double a; { printf ("%d\n", (int) a); } main () { foo (1.6); foo (1.4); foo (-1.4); foo (-1.6); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/run.c ================================================ main () { typedef short int xtype; xtype i; xtype ii; for (i = 0; i < 100; i++) for (ii = 65535; --ii;) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/s.c ================================================ struct foo { int a, b, c, d; double doubl; } s1, s2; struct foo structret (s1, i1, i2, s2) struct foo s1, s2; int i1, i2; { if (i1 != i2) { if (i1 < i2) return s1; else return s2; } s2.a = 11; s2.b = 22; s2.c = s1.c; s2.d = s1.d; return s2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sar.c ================================================ struct foo { char a; } foo[100]; main () { foo[1].a = '1'; foo[2].a = '2'; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sc.c ================================================ foo (a, b) int a, b; { return (a < 0) | (a <= 0) | (a == 0) | (a != 0) | (a >= 0) | (a > 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/scal.c ================================================ /* { dg-require-effective-target untyped_assembly } */ int g1, g2; void write_at (addr, off, val) int *addr; int off; int val; { g2 = 1; addr[off] = val; g2++; } main () { g2 = 12; write_at (&g1, &g2 - &g1, 12345); printf ("%d\n", g2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/scc.c ================================================ foo (a, b) { if (a < 0) goto ret1; if (a == 0) return 2; return 3; ret1: return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/scond.c ================================================ scond (a, b, c, d) { return (a > b) & (c < d); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/section.c ================================================ /* { dg-do compile } */ /* { dg-require-effective-target named_sections } */ extern int __attribute__ ((__section__(".init.text"))) elv_register(void) { return 0; } extern typeof(elv_register) elv_register; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/selfrec.c ================================================ int foo (a) { return foo (a - 1) * a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/seq.c ================================================ foo (a) { return a < 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/set386.c ================================================ foo (a, p) int *p; { *p = a > 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/set88.c ================================================ foo (a) { return -1 << a; } bar (a, b) { return b | (-1 << a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sh.c ================================================ foo (a, b) { return a << b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/shand.c ================================================ int foo (x, c) int x; { return x >> 24 & 0xff; } bar (x) { return (int)(x & 0xfffff) << 13; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/shft.c ================================================ foo (a) int a; { int b = 8; if ((a << b) >= 0) return 1; return a; } main () { if (foo (0x00ffffff) == 1) puts ("y"); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/shift.c ================================================ foo (a) { if (a >= 0) return (unsigned) a << 10; else return (int) a << 10; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/shloop.c ================================================ main () { int volatile p; int i; for (i = 10000000; i > 0; i--) p = i >> 10; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/shm.c ================================================ foo (int *p) { int a = *p; return a >> 24; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/signext.c ================================================ void longprint (x) long long x; { printf (" %d, %d\n", (unsigned) ((unsigned long long) x >> 32), (unsigned) x); } void k_min (p, qa, d) int d; { int s = 1; long long x; if (s >= d) s -= d; x = ((long long)((8 * s) % 3) + qa) % d; longprint (x); } int main () { k_min (100003, -600017, 3); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/signext2.c ================================================ long long foo (a) int a; { return a; } main () { printf ("%d\n", (int) (foo (-1) >> 32)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sim.c ================================================ main () { int i; for (i = 1; i < 10000; i++) ; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/simd-1.c ================================================ typedef int v2si __attribute__ ((vector_size (8))); typedef unsigned di __attribute__ ((mode(DI))); void foo(unsigned long); void bar() { v2si x = { 1, 2 }; foo((di) x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/simd-2.c ================================================ typedef float floatvect2 __attribute__((vector_size (8))); typedef union { floatvect2 vector; float f[2]; }resfloatvect2; void tempf(float *x, float *y) { floatvect2 temp={x[0],x[1]}; floatvect2 temp1={y[0],y[1]}; resfloatvect2 temp2; temp2.vector=temp+temp1; x[0]=temp2.f[0]; x[1]=temp2.f[1]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/simd-3.c ================================================ #include /* If double is not wider than float, we probably don't have DFmode, or at least it's not as wide as double. */ #if DBL_MANT_DIG > FLT_MANT_DIG typedef double floatvect2 __attribute__((vector_size (16))); typedef union { floatvect2 vector; double f[2]; }resfloatvect2; void tempf(double *x, double *y) { floatvect2 temp={x[0],x[1]}; floatvect2 temp1={y[0],y[1]}; resfloatvect2 temp2; temp2.vector=temp+temp1; x[0]=temp2.f[0]; x[1]=temp2.f[1]; } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/simd-4.c ================================================ typedef float floatvect2 __attribute__((vector_size (16))); typedef union { floatvect2 vector; float f[2]; }resfloatvect2; void tempf(floatvect2 *x, floatvect2 *y) { floatvect2 temp= *x; floatvect2 temp1=*y; resfloatvect2 temp2; *x=temp+temp1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/simd-5.c ================================================ #define vector64 __attribute__((vector_size(8))) main(){ vector64 int c; vector64 int a = {1, -1}; vector64 int b = {2, -2}; c = -a + b*b*(-1LL); /* c is now {5, 3} */ printf("result is %llx\n", (long long)c); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/simd-6.c ================================================ /* { dg-options "-std=gnu89" } */ typedef int __attribute__((vector_size (8))) vec; vec a[] = {(vec) {1, 2}, {3, 4}}; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/simple.c ================================================ foo (a) { return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sizeof-macros-1.c ================================================ /* This checks the gcc builtin macros defined to the byte sizes of C standard types. */ int a[sizeof(int) == __SIZEOF_INT__ ? 1 : -1]; int b[sizeof(long) == __SIZEOF_LONG__ ? 1 : -1]; int c[sizeof(long long) == __SIZEOF_LONG_LONG__ ? 1 : -1]; int d[sizeof(short) == __SIZEOF_SHORT__ ? 1 : -1]; int e[sizeof(void *) == __SIZEOF_POINTER__ ? 1 : -1]; int f[sizeof(float) == __SIZEOF_FLOAT__ ? 1 : -1]; int g[sizeof(double) == __SIZEOF_DOUBLE__ ? 1 : -1]; int h[sizeof(long double) == __SIZEOF_LONG_DOUBLE__ ? 1 : -1]; int i[sizeof(__SIZE_TYPE__) == __SIZEOF_SIZE_T__ ? 1 : -1]; int j[sizeof(__WCHAR_TYPE__) == __SIZEOF_WCHAR_T__ ? 1 : -1]; int k[sizeof(__WINT_TYPE__) == __SIZEOF_WINT_T__ ? 1 : -1]; int l[sizeof(__PTRDIFF_TYPE__) == __SIZEOF_PTRDIFF_T__ ? 1 : -1]; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sne.c ================================================ foo (double a) { return (a != 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sound.c ================================================ main () { char audio[8192]; int i; for (i = 0; i < 4095; i += 1) audio[i] = i / 8, audio[8191 - i] = i / 8; for (;;) write (1, audio, 8192); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sparcbug.c ================================================ foo (a) { int b = a; return b + 8762345; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/speed.c ================================================ main () { int i; for (i = 5000000; i >=0; i--) { } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sra-1.c ================================================ /* Let gimple verifier check what SRA does to unions and single-field strucutres . */ struct sim_struct { int x; }; extern struct sim_struct get_x(void); struct sim_struct foo (void) { struct sim_struct simple; simple = get_x (); if (simple.x % 2) simple.x = 39; else simple.x -=8; return simple; } struct sim_cmplx { _Complex double c; }; extern struct sim_cmplx get_sc (void); _Complex double foo_c (void) { struct sim_cmplx simple; simple = get_sc (); if (__real__ simple.c > 200.3) __imag__ simple.c -= 2.4; return simple.c; } union sim_union { int i; float d; }; extern union sim_union get_y (void); union sim_union bar (void) { union sim_union simple; simple = get_y (); if (simple.d > 8.2) simple.i = 300; return simple; } extern int get_int (void); int bar_i (void) { union sim_union simple; simple = get_y (); if (simple.d > 8.2) simple.i = get_int (); return simple.i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/ssa-pre-1.c ================================================ void washQtoM3(double m[9], double q[4]); double sqrt(double); int f(int samp) { double clp[2], xyz[3], q[4], len; double mRF[9]; int xi; for (xi=0; xi. Please email any bugs, comments, and/or additions to this file to: bug-gdb@prep.ai.mit.edu */ struct struct1 { char a;}; struct struct2 { char a, b;}; struct struct3 { char a, b, c; }; struct struct4 { char a, b, c, d; }; struct struct5 { char a, b, c, d, e; }; struct struct6 { char a, b, c, d, e, f; }; struct struct7 { char a, b, c, d, e, f, g; }; struct struct8 { char a, b, c, d, e, f, g, h; }; struct struct9 { char a, b, c, d, e, f, g, h, i; }; struct struct10 { char a, b, c, d, e, f, g, h, i, j; }; struct struct11 { char a, b, c, d, e, f, g, h, i, j, k; }; struct struct12 { char a, b, c, d, e, f, g, h, i, j, k, l; }; struct struct16 { char a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p; }; struct struct1 foo1 = {'1'}, L1; struct struct2 foo2 = { 'a', 'b'}, L2; struct struct3 foo3 = { 'A', 'B', 'C'}, L3; struct struct4 foo4 = {'1', '2', '3', '4'}, L4; struct struct5 foo5 = {'a', 'b', 'c', 'd', 'e'}, L5; struct struct6 foo6 = {'A', 'B', 'C', 'D', 'E', 'F'}, L6; struct struct7 foo7 = {'1', '2', '3', '4', '5', '6', '7'}, L7; struct struct8 foo8 = {'1', '2', '3', '4', '5', '6', '7', '8'}, L8; struct struct9 foo9 = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'}, L9; struct struct10 foo10 = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'}, L10; struct struct11 foo11 = { '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B'}, L11; struct struct12 foo12 = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L'}, L12; struct struct16 foo16 = { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p'}, L16; struct struct1 fun1() { return foo1; } struct struct2 fun2() { return foo2; } struct struct3 fun3() { return foo3; } struct struct4 fun4() { return foo4; } struct struct5 fun5() { return foo5; } struct struct6 fun6() { return foo6; } struct struct7 fun7() { return foo7; } struct struct8 fun8() { return foo8; } struct struct9 fun9() { return foo9; } struct struct10 fun10() { return foo10; } struct struct11 fun11() { return foo11; } struct struct12 fun12() { return foo12; } struct struct16 fun16() { return foo16; } #ifdef PROTOTYPES void Fun1(struct struct1 foo1) #else void Fun1(foo1) struct struct1 foo1; #endif { L1 = foo1; } #ifdef PROTOTYPES void Fun2(struct struct2 foo2) #else void Fun2(foo2) struct struct2 foo2; #endif { L2 = foo2; } #ifdef PROTOTYPES void Fun3(struct struct3 foo3) #else void Fun3(foo3) struct struct3 foo3; #endif { L3 = foo3; } #ifdef PROTOTYPES void Fun4(struct struct4 foo4) #else void Fun4(foo4) struct struct4 foo4; #endif { L4 = foo4; } #ifdef PROTOTYPES void Fun5(struct struct5 foo5) #else void Fun5(foo5) struct struct5 foo5; #endif { L5 = foo5; } #ifdef PROTOTYPES void Fun6(struct struct6 foo6) #else void Fun6(foo6) struct struct6 foo6; #endif { L6 = foo6; } #ifdef PROTOTYPES void Fun7(struct struct7 foo7) #else void Fun7(foo7) struct struct7 foo7; #endif { L7 = foo7; } #ifdef PROTOTYPES void Fun8(struct struct8 foo8) #else void Fun8(foo8) struct struct8 foo8; #endif { L8 = foo8; } #ifdef PROTOTYPES void Fun9(struct struct9 foo9) #else void Fun9(foo9) struct struct9 foo9; #endif { L9 = foo9; } #ifdef PROTOTYPES void Fun10(struct struct10 foo10) #else void Fun10(foo10) struct struct10 foo10; #endif { L10 = foo10; } #ifdef PROTOTYPES void Fun11(struct struct11 foo11) #else void Fun11(foo11) struct struct11 foo11; #endif { L11 = foo11; } #ifdef PROTOTYPES void Fun12(struct struct12 foo12) #else void Fun12(foo12) struct struct12 foo12; #endif { L12 = foo12; } #ifdef PROTOTYPES void Fun16(struct struct16 foo16) #else void Fun16(foo16) struct struct16 foo16; #endif { L16 = foo16; } int main() { #ifdef usestubs set_debug_traps(); breakpoint(); #endif /* TEST C FUNCTIONS */ L1 = fun1(); L2 = fun2(); L3 = fun3(); L4 = fun4(); L5 = fun5(); L6 = fun6(); L7 = fun7(); L8 = fun8(); L9 = fun9(); L10 = fun10(); L11 = fun11(); L12 = fun12(); L16 = fun16(); foo1.a = foo2.a = foo3.a = foo4.a = foo5.a = foo6.a = foo7.a = foo8.a = foo9.a = foo10.a = foo11.a = foo12.a = foo16.a = '$'; Fun1(foo1); Fun2(foo2); Fun3(foo3); Fun4(foo4); Fun5(foo5); Fun6(foo6); Fun7(foo7); Fun8(foo8); Fun9(foo9); Fun10(foo10); Fun11(foo11); Fun12(foo12); Fun16(foo16); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/stuct.c ================================================ #ifdef STACK_SIZE #define SIZE STACK_SIZE / 8 #else #define SIZE 10000000 #endif struct foo { int a, b, c; int arr[SIZE]; }; struct foo s, ss; main () { s.b = 2; s.c = 3; ss.b = 2; ss.c = 3; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sub32.c ================================================ foo (a) { return a + 32; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/subcc.c ================================================ int foo (a, c) { int b; if (a + c >= 0) /* b < 0 ==== a < 10? */ return a | 0x80000000; return 0; } void bar (a) int a; { if (foo (a, 10) & 0x80000000) printf ("y"); else printf ("n"); } int main () { bar (0); bar (1); bar (-1); bar (10); bar (-10); bar (11); bar (-11); bar (0x7fffffff); bar (-0x7fffffff); puts (""); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/subcse.c ================================================ foo (a, b, p) int *p; { p[0] = 1230 - a; p[1] = 1230 - b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/switch-1.c ================================================ /* PR middle-end/26557. */ const int struct_test[1] = {1}; void g(); void f() { switch(struct_test[0]) { case 1: g(); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sym.c ================================================ foo () { return (int) &foo; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/symconst.c ================================================ foo () { return (int)foo; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sync-1.c ================================================ /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */ /* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */ /* { dg-options "-ffat-lto-objects" } */ /* Validate that each of the __sync builtins compiles. This won't necessarily link, since the target might not support the builtin, so this may result in external library calls. */ signed char sc; unsigned char uc; signed short ss; unsigned short us; signed int si; unsigned int ui; signed long sl; unsigned long ul; signed long long sll; unsigned long long ull; void *vp; int *ip; struct S { struct S *next; int x; } *sp; void test_op_ignore (void) { (void) __sync_fetch_and_add (&sc, 1); (void) __sync_fetch_and_add (&uc, 1); (void) __sync_fetch_and_add (&ss, 1); (void) __sync_fetch_and_add (&us, 1); (void) __sync_fetch_and_add (&si, 1); (void) __sync_fetch_and_add (&ui, 1); (void) __sync_fetch_and_add (&sl, 1); (void) __sync_fetch_and_add (&ul, 1); (void) __sync_fetch_and_add (&sll, 1); (void) __sync_fetch_and_add (&ull, 1); (void) __sync_fetch_and_sub (&sc, 1); (void) __sync_fetch_and_sub (&uc, 1); (void) __sync_fetch_and_sub (&ss, 1); (void) __sync_fetch_and_sub (&us, 1); (void) __sync_fetch_and_sub (&si, 1); (void) __sync_fetch_and_sub (&ui, 1); (void) __sync_fetch_and_sub (&sl, 1); (void) __sync_fetch_and_sub (&ul, 1); (void) __sync_fetch_and_sub (&sll, 1); (void) __sync_fetch_and_sub (&ull, 1); (void) __sync_fetch_and_or (&sc, 1); (void) __sync_fetch_and_or (&uc, 1); (void) __sync_fetch_and_or (&ss, 1); (void) __sync_fetch_and_or (&us, 1); (void) __sync_fetch_and_or (&si, 1); (void) __sync_fetch_and_or (&ui, 1); (void) __sync_fetch_and_or (&sl, 1); (void) __sync_fetch_and_or (&ul, 1); (void) __sync_fetch_and_or (&sll, 1); (void) __sync_fetch_and_or (&ull, 1); (void) __sync_fetch_and_xor (&sc, 1); (void) __sync_fetch_and_xor (&uc, 1); (void) __sync_fetch_and_xor (&ss, 1); (void) __sync_fetch_and_xor (&us, 1); (void) __sync_fetch_and_xor (&si, 1); (void) __sync_fetch_and_xor (&ui, 1); (void) __sync_fetch_and_xor (&sl, 1); (void) __sync_fetch_and_xor (&ul, 1); (void) __sync_fetch_and_xor (&sll, 1); (void) __sync_fetch_and_xor (&ull, 1); (void) __sync_fetch_and_and (&sc, 1); (void) __sync_fetch_and_and (&uc, 1); (void) __sync_fetch_and_and (&ss, 1); (void) __sync_fetch_and_and (&us, 1); (void) __sync_fetch_and_and (&si, 1); (void) __sync_fetch_and_and (&ui, 1); (void) __sync_fetch_and_and (&sl, 1); (void) __sync_fetch_and_and (&ul, 1); (void) __sync_fetch_and_and (&sll, 1); (void) __sync_fetch_and_and (&ull, 1); (void) __sync_fetch_and_nand (&sc, 1); (void) __sync_fetch_and_nand (&uc, 1); (void) __sync_fetch_and_nand (&ss, 1); (void) __sync_fetch_and_nand (&us, 1); (void) __sync_fetch_and_nand (&si, 1); (void) __sync_fetch_and_nand (&ui, 1); (void) __sync_fetch_and_nand (&sl, 1); (void) __sync_fetch_and_nand (&ul, 1); (void) __sync_fetch_and_nand (&sll, 1); (void) __sync_fetch_and_nand (&ull, 1); } void test_fetch_and_op (void) { sc = __sync_fetch_and_add (&sc, 11); uc = __sync_fetch_and_add (&uc, 11); ss = __sync_fetch_and_add (&ss, 11); us = __sync_fetch_and_add (&us, 11); si = __sync_fetch_and_add (&si, 11); ui = __sync_fetch_and_add (&ui, 11); sl = __sync_fetch_and_add (&sl, 11); ul = __sync_fetch_and_add (&ul, 11); sll = __sync_fetch_and_add (&sll, 11); ull = __sync_fetch_and_add (&ull, 11); sc = __sync_fetch_and_sub (&sc, 11); uc = __sync_fetch_and_sub (&uc, 11); ss = __sync_fetch_and_sub (&ss, 11); us = __sync_fetch_and_sub (&us, 11); si = __sync_fetch_and_sub (&si, 11); ui = __sync_fetch_and_sub (&ui, 11); sl = __sync_fetch_and_sub (&sl, 11); ul = __sync_fetch_and_sub (&ul, 11); sll = __sync_fetch_and_sub (&sll, 11); ull = __sync_fetch_and_sub (&ull, 11); sc = __sync_fetch_and_or (&sc, 11); uc = __sync_fetch_and_or (&uc, 11); ss = __sync_fetch_and_or (&ss, 11); us = __sync_fetch_and_or (&us, 11); si = __sync_fetch_and_or (&si, 11); ui = __sync_fetch_and_or (&ui, 11); sl = __sync_fetch_and_or (&sl, 11); ul = __sync_fetch_and_or (&ul, 11); sll = __sync_fetch_and_or (&sll, 11); ull = __sync_fetch_and_or (&ull, 11); sc = __sync_fetch_and_xor (&sc, 11); uc = __sync_fetch_and_xor (&uc, 11); ss = __sync_fetch_and_xor (&ss, 11); us = __sync_fetch_and_xor (&us, 11); si = __sync_fetch_and_xor (&si, 11); ui = __sync_fetch_and_xor (&ui, 11); sl = __sync_fetch_and_xor (&sl, 11); ul = __sync_fetch_and_xor (&ul, 11); sll = __sync_fetch_and_xor (&sll, 11); ull = __sync_fetch_and_xor (&ull, 11); sc = __sync_fetch_and_and (&sc, 11); uc = __sync_fetch_and_and (&uc, 11); ss = __sync_fetch_and_and (&ss, 11); us = __sync_fetch_and_and (&us, 11); si = __sync_fetch_and_and (&si, 11); ui = __sync_fetch_and_and (&ui, 11); sl = __sync_fetch_and_and (&sl, 11); ul = __sync_fetch_and_and (&ul, 11); sll = __sync_fetch_and_and (&sll, 11); ull = __sync_fetch_and_and (&ull, 11); sc = __sync_fetch_and_nand (&sc, 11); uc = __sync_fetch_and_nand (&uc, 11); ss = __sync_fetch_and_nand (&ss, 11); us = __sync_fetch_and_nand (&us, 11); si = __sync_fetch_and_nand (&si, 11); ui = __sync_fetch_and_nand (&ui, 11); sl = __sync_fetch_and_nand (&sl, 11); ul = __sync_fetch_and_nand (&ul, 11); sll = __sync_fetch_and_nand (&sll, 11); ull = __sync_fetch_and_nand (&ull, 11); } void test_op_and_fetch (void) { sc = __sync_add_and_fetch (&sc, uc); uc = __sync_add_and_fetch (&uc, uc); ss = __sync_add_and_fetch (&ss, uc); us = __sync_add_and_fetch (&us, uc); si = __sync_add_and_fetch (&si, uc); ui = __sync_add_and_fetch (&ui, uc); sl = __sync_add_and_fetch (&sl, uc); ul = __sync_add_and_fetch (&ul, uc); sll = __sync_add_and_fetch (&sll, uc); ull = __sync_add_and_fetch (&ull, uc); sc = __sync_sub_and_fetch (&sc, uc); uc = __sync_sub_and_fetch (&uc, uc); ss = __sync_sub_and_fetch (&ss, uc); us = __sync_sub_and_fetch (&us, uc); si = __sync_sub_and_fetch (&si, uc); ui = __sync_sub_and_fetch (&ui, uc); sl = __sync_sub_and_fetch (&sl, uc); ul = __sync_sub_and_fetch (&ul, uc); sll = __sync_sub_and_fetch (&sll, uc); ull = __sync_sub_and_fetch (&ull, uc); sc = __sync_or_and_fetch (&sc, uc); uc = __sync_or_and_fetch (&uc, uc); ss = __sync_or_and_fetch (&ss, uc); us = __sync_or_and_fetch (&us, uc); si = __sync_or_and_fetch (&si, uc); ui = __sync_or_and_fetch (&ui, uc); sl = __sync_or_and_fetch (&sl, uc); ul = __sync_or_and_fetch (&ul, uc); sll = __sync_or_and_fetch (&sll, uc); ull = __sync_or_and_fetch (&ull, uc); sc = __sync_xor_and_fetch (&sc, uc); uc = __sync_xor_and_fetch (&uc, uc); ss = __sync_xor_and_fetch (&ss, uc); us = __sync_xor_and_fetch (&us, uc); si = __sync_xor_and_fetch (&si, uc); ui = __sync_xor_and_fetch (&ui, uc); sl = __sync_xor_and_fetch (&sl, uc); ul = __sync_xor_and_fetch (&ul, uc); sll = __sync_xor_and_fetch (&sll, uc); ull = __sync_xor_and_fetch (&ull, uc); sc = __sync_and_and_fetch (&sc, uc); uc = __sync_and_and_fetch (&uc, uc); ss = __sync_and_and_fetch (&ss, uc); us = __sync_and_and_fetch (&us, uc); si = __sync_and_and_fetch (&si, uc); ui = __sync_and_and_fetch (&ui, uc); sl = __sync_and_and_fetch (&sl, uc); ul = __sync_and_and_fetch (&ul, uc); sll = __sync_and_and_fetch (&sll, uc); ull = __sync_and_and_fetch (&ull, uc); sc = __sync_nand_and_fetch (&sc, uc); uc = __sync_nand_and_fetch (&uc, uc); ss = __sync_nand_and_fetch (&ss, uc); us = __sync_nand_and_fetch (&us, uc); si = __sync_nand_and_fetch (&si, uc); ui = __sync_nand_and_fetch (&ui, uc); sl = __sync_nand_and_fetch (&sl, uc); ul = __sync_nand_and_fetch (&ul, uc); sll = __sync_nand_and_fetch (&sll, uc); ull = __sync_nand_and_fetch (&ull, uc); } void test_compare_and_swap (void) { sc = __sync_val_compare_and_swap (&sc, uc, sc); uc = __sync_val_compare_and_swap (&uc, uc, sc); ss = __sync_val_compare_and_swap (&ss, uc, sc); us = __sync_val_compare_and_swap (&us, uc, sc); si = __sync_val_compare_and_swap (&si, uc, sc); ui = __sync_val_compare_and_swap (&ui, uc, sc); sl = __sync_val_compare_and_swap (&sl, uc, sc); ul = __sync_val_compare_and_swap (&ul, uc, sc); sll = __sync_val_compare_and_swap (&sll, uc, sc); ull = __sync_val_compare_and_swap (&ull, uc, sc); ui = __sync_bool_compare_and_swap (&sc, uc, sc); ui = __sync_bool_compare_and_swap (&uc, uc, sc); ui = __sync_bool_compare_and_swap (&ss, uc, sc); ui = __sync_bool_compare_and_swap (&us, uc, sc); ui = __sync_bool_compare_and_swap (&si, uc, sc); ui = __sync_bool_compare_and_swap (&ui, uc, sc); ui = __sync_bool_compare_and_swap (&sl, uc, sc); ui = __sync_bool_compare_and_swap (&ul, uc, sc); ui = __sync_bool_compare_and_swap (&sll, uc, sc); ui = __sync_bool_compare_and_swap (&ull, uc, sc); } void test_lock (void) { sc = __sync_lock_test_and_set (&sc, 1); uc = __sync_lock_test_and_set (&uc, 1); ss = __sync_lock_test_and_set (&ss, 1); us = __sync_lock_test_and_set (&us, 1); si = __sync_lock_test_and_set (&si, 1); ui = __sync_lock_test_and_set (&ui, 1); sl = __sync_lock_test_and_set (&sl, 1); ul = __sync_lock_test_and_set (&ul, 1); sll = __sync_lock_test_and_set (&sll, 1); ull = __sync_lock_test_and_set (&ull, 1); __sync_synchronize (); __sync_lock_release (&sc); __sync_lock_release (&uc); __sync_lock_release (&ss); __sync_lock_release (&us); __sync_lock_release (&si); __sync_lock_release (&ui); __sync_lock_release (&sl); __sync_lock_release (&ul); __sync_lock_release (&sll); __sync_lock_release (&ull); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sync-2.c ================================================ /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ /* { dg-options "-ffat-lto-objects" } */ /* Validate that each of the __sync builtins compiles. This won't necessarily link, since the target might not support the builtin, so this may result in external library calls. */ signed char sc; unsigned char uc; signed short ss; unsigned short us; signed int si; unsigned int ui; signed long sl; unsigned long ul; signed long long sll; unsigned long long ull; void test_op_ignore (void) { (void) __sync_fetch_and_add (&sc, -1); (void) __sync_fetch_and_add (&uc, -1); (void) __sync_fetch_and_add (&ss, -1); (void) __sync_fetch_and_add (&us, -1); (void) __sync_fetch_and_add (&si, -1); (void) __sync_fetch_and_add (&ui, -1); (void) __sync_fetch_and_add (&sl, -1); (void) __sync_fetch_and_add (&ul, -1); (void) __sync_fetch_and_add (&sll, -1); (void) __sync_fetch_and_add (&ull, -1); (void) __sync_fetch_and_sub (&sc, -1); (void) __sync_fetch_and_sub (&uc, -1); (void) __sync_fetch_and_sub (&ss, -1); (void) __sync_fetch_and_sub (&us, -1); (void) __sync_fetch_and_sub (&si, -1); (void) __sync_fetch_and_sub (&ui, -1); (void) __sync_fetch_and_sub (&sl, -1); (void) __sync_fetch_and_sub (&ul, -1); (void) __sync_fetch_and_sub (&sll, -1); (void) __sync_fetch_and_sub (&ull, -1); (void) __sync_fetch_and_or (&sc, -1); (void) __sync_fetch_and_or (&uc, -1); (void) __sync_fetch_and_or (&ss, -1); (void) __sync_fetch_and_or (&us, -1); (void) __sync_fetch_and_or (&si, -1); (void) __sync_fetch_and_or (&ui, -1); (void) __sync_fetch_and_or (&sl, -1); (void) __sync_fetch_and_or (&ul, -1); (void) __sync_fetch_and_or (&sll, -1); (void) __sync_fetch_and_or (&ull, -1); (void) __sync_fetch_and_xor (&sc, -1); (void) __sync_fetch_and_xor (&uc, -1); (void) __sync_fetch_and_xor (&ss, -1); (void) __sync_fetch_and_xor (&us, -1); (void) __sync_fetch_and_xor (&si, -1); (void) __sync_fetch_and_xor (&ui, -1); (void) __sync_fetch_and_xor (&sl, -1); (void) __sync_fetch_and_xor (&ul, -1); (void) __sync_fetch_and_xor (&sll, -1); (void) __sync_fetch_and_xor (&ull, -1); (void) __sync_fetch_and_and (&sc, -1); (void) __sync_fetch_and_and (&uc, -1); (void) __sync_fetch_and_and (&ss, -1); (void) __sync_fetch_and_and (&us, -1); (void) __sync_fetch_and_and (&si, -1); (void) __sync_fetch_and_and (&ui, -1); (void) __sync_fetch_and_and (&sl, -1); (void) __sync_fetch_and_and (&ul, -1); (void) __sync_fetch_and_and (&sll, -1); (void) __sync_fetch_and_and (&ull, -1); (void) __sync_fetch_and_nand (&sc, -1); (void) __sync_fetch_and_nand (&uc, -1); (void) __sync_fetch_and_nand (&ss, -1); (void) __sync_fetch_and_nand (&us, -1); (void) __sync_fetch_and_nand (&si, -1); (void) __sync_fetch_and_nand (&ui, -1); (void) __sync_fetch_and_nand (&sl, -1); (void) __sync_fetch_and_nand (&ul, -1); (void) __sync_fetch_and_nand (&sll, -1); (void) __sync_fetch_and_nand (&ull, -1); } void test_fetch_and_op (void) { sc = __sync_fetch_and_add (&sc, -11); uc = __sync_fetch_and_add (&uc, -11); ss = __sync_fetch_and_add (&ss, -11); us = __sync_fetch_and_add (&us, -11); si = __sync_fetch_and_add (&si, -11); ui = __sync_fetch_and_add (&ui, -11); sl = __sync_fetch_and_add (&sl, -11); ul = __sync_fetch_and_add (&ul, -11); sll = __sync_fetch_and_add (&sll, -11); ull = __sync_fetch_and_add (&ull, -11); sc = __sync_fetch_and_sub (&sc, -11); uc = __sync_fetch_and_sub (&uc, -11); ss = __sync_fetch_and_sub (&ss, -11); us = __sync_fetch_and_sub (&us, -11); si = __sync_fetch_and_sub (&si, -11); ui = __sync_fetch_and_sub (&ui, -11); sl = __sync_fetch_and_sub (&sl, -11); ul = __sync_fetch_and_sub (&ul, -11); sll = __sync_fetch_and_sub (&sll, -11); ull = __sync_fetch_and_sub (&ull, -11); sc = __sync_fetch_and_or (&sc, -11); uc = __sync_fetch_and_or (&uc, -11); ss = __sync_fetch_and_or (&ss, -11); us = __sync_fetch_and_or (&us, -11); si = __sync_fetch_and_or (&si, -11); ui = __sync_fetch_and_or (&ui, -11); sl = __sync_fetch_and_or (&sl, -11); ul = __sync_fetch_and_or (&ul, -11); sll = __sync_fetch_and_or (&sll, -11); ull = __sync_fetch_and_or (&ull, -11); sc = __sync_fetch_and_xor (&sc, -11); uc = __sync_fetch_and_xor (&uc, -11); ss = __sync_fetch_and_xor (&ss, -11); us = __sync_fetch_and_xor (&us, -11); si = __sync_fetch_and_xor (&si, -11); ui = __sync_fetch_and_xor (&ui, -11); sl = __sync_fetch_and_xor (&sl, -11); ul = __sync_fetch_and_xor (&ul, -11); sll = __sync_fetch_and_xor (&sll, -11); ull = __sync_fetch_and_xor (&ull, -11); sc = __sync_fetch_and_and (&sc, -11); uc = __sync_fetch_and_and (&uc, -11); ss = __sync_fetch_and_and (&ss, -11); us = __sync_fetch_and_and (&us, -11); si = __sync_fetch_and_and (&si, -11); ui = __sync_fetch_and_and (&ui, -11); sl = __sync_fetch_and_and (&sl, -11); ul = __sync_fetch_and_and (&ul, -11); sll = __sync_fetch_and_and (&sll, -11); ull = __sync_fetch_and_and (&ull, -11); sc = __sync_fetch_and_nand (&sc, -11); uc = __sync_fetch_and_nand (&uc, -11); ss = __sync_fetch_and_nand (&ss, -11); us = __sync_fetch_and_nand (&us, -11); si = __sync_fetch_and_nand (&si, -11); ui = __sync_fetch_and_nand (&ui, -11); sl = __sync_fetch_and_nand (&sl, -11); ul = __sync_fetch_and_nand (&ul, -11); sll = __sync_fetch_and_nand (&sll, -11); ull = __sync_fetch_and_nand (&ull, -11); } void test_lock (void) { sc = __sync_lock_test_and_set (&sc, -1); uc = __sync_lock_test_and_set (&uc, -1); ss = __sync_lock_test_and_set (&ss, -1); us = __sync_lock_test_and_set (&us, -1); si = __sync_lock_test_and_set (&si, -1); ui = __sync_lock_test_and_set (&ui, -1); sl = __sync_lock_test_and_set (&sl, -1); ul = __sync_lock_test_and_set (&ul, -1); sll = __sync_lock_test_and_set (&sll, -1); ull = __sync_lock_test_and_set (&ull, -1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/sync-3.c ================================================ /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ /* { dg-options "-ffat-lto-objects" } */ /* Validate that each of the __sync builtins compiles. This won't necessarily link, since the target might not support the builtin, so this may result in external library calls. */ void test_op_ignore (void) { signed char sc[2]; unsigned char uc[2]; signed short ss[2]; unsigned short us[2]; signed int si[2]; unsigned int ui[2]; signed long sl[2]; unsigned long ul[2]; signed long long sll[2]; unsigned long long ull[2]; (void) __sync_fetch_and_add (&sc[1], -1); (void) __sync_fetch_and_add (&uc[1], -1); (void) __sync_fetch_and_add (&ss[1], -1); (void) __sync_fetch_and_add (&us[1], -1); (void) __sync_fetch_and_add (&si[1], -1); (void) __sync_fetch_and_add (&ui[1], -1); (void) __sync_fetch_and_add (&sl[1], -1); (void) __sync_fetch_and_add (&ul[1], -1); (void) __sync_fetch_and_add (&sll[1], -1); (void) __sync_fetch_and_add (&ull[1], -1); (void) __sync_fetch_and_sub (&sc[1], -1); (void) __sync_fetch_and_sub (&uc[1], -1); (void) __sync_fetch_and_sub (&ss[1], -1); (void) __sync_fetch_and_sub (&us[1], -1); (void) __sync_fetch_and_sub (&si[1], -1); (void) __sync_fetch_and_sub (&ui[1], -1); (void) __sync_fetch_and_sub (&sl[1], -1); (void) __sync_fetch_and_sub (&ul[1], -1); (void) __sync_fetch_and_sub (&sll[1], -1); (void) __sync_fetch_and_sub (&ull[1], -1); (void) __sync_fetch_and_or (&sc[1], -1); (void) __sync_fetch_and_or (&uc[1], -1); (void) __sync_fetch_and_or (&ss[1], -1); (void) __sync_fetch_and_or (&us[1], -1); (void) __sync_fetch_and_or (&si[1], -1); (void) __sync_fetch_and_or (&ui[1], -1); (void) __sync_fetch_and_or (&sl[1], -1); (void) __sync_fetch_and_or (&ul[1], -1); (void) __sync_fetch_and_or (&sll[1], -1); (void) __sync_fetch_and_or (&ull[1], -1); (void) __sync_fetch_and_xor (&sc[1], -1); (void) __sync_fetch_and_xor (&uc[1], -1); (void) __sync_fetch_and_xor (&ss[1], -1); (void) __sync_fetch_and_xor (&us[1], -1); (void) __sync_fetch_and_xor (&si[1], -1); (void) __sync_fetch_and_xor (&ui[1], -1); (void) __sync_fetch_and_xor (&sl[1], -1); (void) __sync_fetch_and_xor (&ul[1], -1); (void) __sync_fetch_and_xor (&sll[1], -1); (void) __sync_fetch_and_xor (&ull[1], -1); (void) __sync_fetch_and_and (&sc[1], -1); (void) __sync_fetch_and_and (&uc[1], -1); (void) __sync_fetch_and_and (&ss[1], -1); (void) __sync_fetch_and_and (&us[1], -1); (void) __sync_fetch_and_and (&si[1], -1); (void) __sync_fetch_and_and (&ui[1], -1); (void) __sync_fetch_and_and (&sl[1], -1); (void) __sync_fetch_and_and (&ul[1], -1); (void) __sync_fetch_and_and (&sll[1], -1); (void) __sync_fetch_and_and (&ull[1], -1); (void) __sync_fetch_and_nand (&sc[1], -1); (void) __sync_fetch_and_nand (&uc[1], -1); (void) __sync_fetch_and_nand (&ss[1], -1); (void) __sync_fetch_and_nand (&us[1], -1); (void) __sync_fetch_and_nand (&si[1], -1); (void) __sync_fetch_and_nand (&ui[1], -1); (void) __sync_fetch_and_nand (&sl[1], -1); (void) __sync_fetch_and_nand (&ul[1], -1); (void) __sync_fetch_and_nand (&sll[1], -1); (void) __sync_fetch_and_nand (&ull[1], -1); } void test_fetch_and_op (void) { signed char sc[2]; unsigned char uc[2]; signed short ss[2]; unsigned short us[2]; signed int si[2]; unsigned int ui[2]; signed long sl[2]; unsigned long ul[2]; signed long long sll[2]; unsigned long long ull[2]; sc[1] = __sync_fetch_and_add (&sc[1], -11); uc[1] = __sync_fetch_and_add (&uc[1], -11); ss[1] = __sync_fetch_and_add (&ss[1], -11); us[1] = __sync_fetch_and_add (&us[1], -11); si[1] = __sync_fetch_and_add (&si[1], -11); ui[1] = __sync_fetch_and_add (&ui[1], -11); sl[1] = __sync_fetch_and_add (&sl[1], -11); ul[1] = __sync_fetch_and_add (&ul[1], -11); sll[1] = __sync_fetch_and_add (&sll[1], -11); ull[1] = __sync_fetch_and_add (&ull[1], -11); sc[1] = __sync_fetch_and_sub (&sc[1], -11); uc[1] = __sync_fetch_and_sub (&uc[1], -11); ss[1] = __sync_fetch_and_sub (&ss[1], -11); us[1] = __sync_fetch_and_sub (&us[1], -11); si[1] = __sync_fetch_and_sub (&si[1], -11); ui[1] = __sync_fetch_and_sub (&ui[1], -11); sl[1] = __sync_fetch_and_sub (&sl[1], -11); ul[1] = __sync_fetch_and_sub (&ul[1], -11); sll[1] = __sync_fetch_and_sub (&sll[1], -11); ull[1] = __sync_fetch_and_sub (&ull[1], -11); sc[1] = __sync_fetch_and_or (&sc[1], -11); uc[1] = __sync_fetch_and_or (&uc[1], -11); ss[1] = __sync_fetch_and_or (&ss[1], -11); us[1] = __sync_fetch_and_or (&us[1], -11); si[1] = __sync_fetch_and_or (&si[1], -11); ui[1] = __sync_fetch_and_or (&ui[1], -11); sl[1] = __sync_fetch_and_or (&sl[1], -11); ul[1] = __sync_fetch_and_or (&ul[1], -11); sll[1] = __sync_fetch_and_or (&sll[1], -11); ull[1] = __sync_fetch_and_or (&ull[1], -11); sc[1] = __sync_fetch_and_xor (&sc[1], -11); uc[1] = __sync_fetch_and_xor (&uc[1], -11); ss[1] = __sync_fetch_and_xor (&ss[1], -11); us[1] = __sync_fetch_and_xor (&us[1], -11); si[1] = __sync_fetch_and_xor (&si[1], -11); ui[1] = __sync_fetch_and_xor (&ui[1], -11); sl[1] = __sync_fetch_and_xor (&sl[1], -11); ul[1] = __sync_fetch_and_xor (&ul[1], -11); sll[1] = __sync_fetch_and_xor (&sll[1], -11); ull[1] = __sync_fetch_and_xor (&ull[1], -11); sc[1] = __sync_fetch_and_and (&sc[1], -11); uc[1] = __sync_fetch_and_and (&uc[1], -11); ss[1] = __sync_fetch_and_and (&ss[1], -11); us[1] = __sync_fetch_and_and (&us[1], -11); si[1] = __sync_fetch_and_and (&si[1], -11); ui[1] = __sync_fetch_and_and (&ui[1], -11); sl[1] = __sync_fetch_and_and (&sl[1], -11); ul[1] = __sync_fetch_and_and (&ul[1], -11); sll[1] = __sync_fetch_and_and (&sll[1], -11); ull[1] = __sync_fetch_and_and (&ull[1], -11); sc[1] = __sync_fetch_and_nand (&sc[1], -11); uc[1] = __sync_fetch_and_nand (&uc[1], -11); ss[1] = __sync_fetch_and_nand (&ss[1], -11); us[1] = __sync_fetch_and_nand (&us[1], -11); si[1] = __sync_fetch_and_nand (&si[1], -11); ui[1] = __sync_fetch_and_nand (&ui[1], -11); sl[1] = __sync_fetch_and_nand (&sl[1], -11); ul[1] = __sync_fetch_and_nand (&ul[1], -11); sll[1] = __sync_fetch_and_nand (&sll[1], -11); ull[1] = __sync_fetch_and_nand (&ull[1], -11); } void test_lock (void) { signed char sc[2]; unsigned char uc[2]; signed short ss[2]; unsigned short us[2]; signed int si[2]; unsigned int ui[2]; signed long sl[2]; unsigned long ul[2]; signed long long sll[2]; unsigned long long ull[2]; sc[1] = __sync_lock_test_and_set (&sc[1], -1); uc[1] = __sync_lock_test_and_set (&uc[1], -1); ss[1] = __sync_lock_test_and_set (&ss[1], -1); us[1] = __sync_lock_test_and_set (&us[1], -1); si[1] = __sync_lock_test_and_set (&si[1], -1); ui[1] = __sync_lock_test_and_set (&ui[1], -1); sl[1] = __sync_lock_test_and_set (&sl[1], -1); ul[1] = __sync_lock_test_and_set (&ul[1], -1); sll[1] = __sync_lock_test_and_set (&sll[1], -1); ull[1] = __sync_lock_test_and_set (&ull[1], -1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/t.c ================================================ #define B 95 foo (a, b, p) unsigned a, b; int *p; { p[1] = a % B; p[0] = a / B; } bar (a, b, p) unsigned a, b; int *p; { p[0] = a / B; p[1] = a % B; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/test-flow.c ================================================ foo (a, b, c, d) { if (a < 0) { b = c; } else { b = d; } return b + 75; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/test-loop.c ================================================ main () { int i; for (i = 100; i >= -1; i--) foo (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/test.c ================================================ foo (a) { if (a & 38) return 1; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/time.c ================================================ main () { int i; for (i = 3000000; --i;) { } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/tmp.c ================================================ foo (a, b) { return (a - b) == 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/trivial.c ================================================ foo () {} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/trunc.c ================================================ main () { printf ("%x, %x\n", (unsigned char) main, main); } foo (p) char *p; { p[0] = (char)foo; p[1] = (char)foo; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/trunctfdf.c ================================================ /* Sparc w/128-bit long double bombed on this because even though the trunctfdf libcall passed the long double by reference, the libcall was still marked as LCT_CONST instead of LCT_PURE. */ double *copy(long double *first, long double *last, double *result) { int n; for (n = last - first; n > 0; --n) { *result = *first; ++first; ++result; } return result; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/u.c ================================================ foo (a, b) { return a % b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/udconvert.c ================================================ double unsigned_to_double1 (u) unsigned u; { double d; d = (int) u; /* convert as from a *signed* integer */ return ((int) u < 0) ? d + 4294967296.0 : d; } /* Alternatively */ double unsigned_to_double2 (u) unsigned u; { double d; u -= 2147483648; /* complement sign bit */ d = (int) u; /* convert as from a *signed* integer */ return d + 2147483648.0; } unsigned double_to_unsigned (d) double d; { d += 2147483648.0; return ((int) d) - 2147483648; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/udivmod4.c ================================================ long long xlrandom () { long long x; unsigned a; int bits = 64; unsigned b; do { a = random (); b = (a & 15) + 1; x <<= b; /* shift up 1-16 steps */ a = (a >> 18) & 1; if (a) x |= (unsigned) (1 << b) - 1; bits -= b; } while (bits >= 0); return x; } unsigned long long __udivmoddi4(); main () { int i; unsigned long long n, d, q, r, rr; for (i = 0; ;i++) { n = xlrandom (); d = xlrandom (); if (d == 0) continue; q = __udivmoddi4 (n, d, &r); if (i % 1000000 == 0) printf ("Testing udivmoddi4: %d iterations made\n", i); rr = n - q * d; if (rr != r || r >= d) { printf ("Testing udivmoddi4: failure after %d iterations\n", i); printf ("n=%lX%08lX\n", (unsigned) (n >> 32), (unsigned) n); printf ("d=%lX%08lX\n", (unsigned) (d >> 32), (unsigned) d); printf ("q=%lX%08lX\n", (unsigned) (q >> 32), (unsigned) q); printf ("r=%lX%08lX\n", (unsigned) (r >> 32), (unsigned) r); printf ("rr=%lX%08lX\n", (unsigned) (rr >> 32), (unsigned) rr); abort (); } } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/unalign-1.c ================================================ typedef struct __attribute__ ((__packed__)) { char valueField[2]; } ptp_tlv_t; typedef struct __attribute__ ((__packed__)) { char stepsRemoved; ptp_tlv_t tlv[1]; } ptp_message_announce_t; int ptplib_send_announce(int sequenceId, int i) { ptp_message_announce_t tx_packet; ((long long *)tx_packet.tlv[0].valueField)[sequenceId] = i; f(&tx_packet); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/uns.c ================================================ foo (a) { if ((unsigned) a < 234) return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/uns_tst.c ================================================ a (c) unsigned char c; { unsigned u = c; if ((int)u < 0) return 1; else return 0; } b (x, y) unsigned x, y; { x /= y; if ((int)x < 0) return 1; else return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/uuarg.c ================================================ /* { dg-require-effective-target untyped_assembly } */ foo (a, b, c, d, e, f, g, h, i) { return foo () + i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/v.c ================================================ main (int *p) { int a; a = 0; p[1] = a; a = 0; p[2] = a; a = 123456; p[3] = a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/vector-1.c ================================================ /* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */ #define vector __attribute__((vector_size(16) )) struct ss { vector float mVec; }; float getCapsule(vector int t) { vector float t1 = (vector float)t; struct ss y = {t1}; return *((float*)&y.mVec); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/vector-2.c ================================================ /* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */ #define vector __attribute__((vector_size(16) )) struct ss { vector float mVec; }; vector float getCapsule(vector int t) { vector float t1 = (vector float)t; struct ss y = {t1}; *((float*)&y.mVec) = 1.0; return y.mVec; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/vector-3.c ================================================ #define vector __attribute__((vector_size(16) )) vector float g(void) { float t = 1.0f; return (vector float){0.0, 0.0, t, 0.0}; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/vector-4.c ================================================ /* { dg-do compile } */ /* { dg-options "-mavx" { target { i?86-*-* x86_64-*-* } } } */ /* Make sure that vector of size 8 of signed char works. This used to crash with AVX on x86 as we would produce try to extract the chars inside the vector mode using the vector mode of V8SI which was wrong. */ __attribute__ ((vector_size (8))) signed char v4, v5, v6; void two (void) { v4 = v5 + v6; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/vector-5.c ================================================ typedef int v2si __attribute__((__vector_size__(8))); v2si f (int x) { return (v2si) { x, (__INTPTR_TYPE__) "" }; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/vector-6.c ================================================ typedef int v2si __attribute__((__vector_size__(8))); v2si f (int x) { return (v2si) { (__INTPTR_TYPE__) "", x }; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/vector-align-1.c ================================================ /* Check to make sure the alignment on vectors is not being lost. */ /* If some target has a Max alignment less than 128, please create a #ifdef around the alignment and add your alignment. */ #define alignment 128 char x __attribute__((aligned(alignment),vector_size(2))); int f[__alignof__(x) == alignment?1:-1]; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/vla-const-1.c ================================================ /* Test TREE_CONSTANT VLA size: bug 27893. */ /* Origin: Joseph Myers */ /* { dg-require-effective-target alloca } */ int a; void g(void *); void f(void) { int b[(__SIZE_TYPE__)&a]; g(b); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/vla-const-2.c ================================================ /* Test TREE_CONSTANT VLA size: bug 27893. */ /* Origin: Joseph Myers */ /* { dg-require-effective-target alloca } */ void g(void *); void f(void) { int b[1/0]; g(b); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/volatile-1.c ================================================ /* The problem here was that the statements that loaded from exception.reason where not being marked as having volatile behavior which caused load PRE on the tree level to go into an infinite loop. */ struct gdb_exception { int reason; }; int catch_exceptions_with_msg (int *gdberrmsg) { volatile struct gdb_exception exception; exceptions_state_mc_init (&(exception)); if (exception.reason != 0) foo (); return exception.reason; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/w.c ================================================ int foo (unsigned short a, unsigned short b) { return a + b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/widechar-1.c ================================================ char *s = L"a" "b"; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/ww.c ================================================ foo (p) short *p; { static int *foo; *p = 1234; *foo = 1234; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/x.c ================================================ f(m){int i,s=0;for(i=0;i 10); return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/xmtst.c ================================================ p1 (int b, int *p, int a) { p[0] = p[1]; return p[0]; } p2 (int b, int *p, int a) { p[0] = p[1]; return p[0] == 0; } p3 (int b, int *p, int a) { p[0] = p[1]; a = p[0]; if (a) return 0; return a; } p4 (int b, int *p, int a) { a = p[1]; p[0] = p[1]; if (a) return 0; return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/xneg.c ================================================ foo (a) double a; { return -a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/xopt.c ================================================ proc1 (a) unsigned a; { return (a >> 20) & 0x010fffff; } proc2 (a) unsigned a; { return (a << 17) & 0xfffff001; } proc3 (a) unsigned a; { return (a & 0xff00000a) >> 25; } proc4 (a) unsigned a; { return (a & 0x100000ff) << 25; } proc5 (a) unsigned a; { return (unsigned char) (a >> 24); } proc6 (a) unsigned a; { return ((unsigned char) a) << 30; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/xor.c ================================================ foo (a, b) { return ~(a ^ ~123); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/xorn.c ================================================ int xorn (a, b) int a, b; { return a ^ ~b; } int not (a) int a; { return ~a; } int xor (a, b) int a, b; { return a ^ b; } main () { int i, j; for (i = 0; i <= 1; i++) for (j = 0; j <= 1; j++) printf ("%d op %d = %d = %d?\n", i, j, 1 & xor (i, not (j)), 1 & xorn (i, j)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/xp.c ================================================ foo (a) { return a & 255; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/xpp.c ================================================ foo (a) { a++; if (a < 10) return 1; return a; } main () { printf ("%d\n", foo ((1 << 31) - 1)); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/xs.c ================================================ foo (a, b) { for (b = 0; b < 10; b++) ; for (a = 0; a < 10; a++) ; a = b << 1; return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/xsh.c ================================================ foo (a, b) { a = b + b; if (a) return a; return b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/xz.c ================================================ foo (int *p) { *p = (unsigned short) *p; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/xzz.c ================================================ foo (a, b) { return a >> (char) b; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/zero-strct-1.c ================================================ typedef struct { } empty_t; f () { empty_t i; bar (i); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/zero-strct-2.c ================================================ struct { } foo = { }; void * bar(void) { return &foo; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/zero-strct-3.c ================================================ typedef struct {} spinlock_t; struct sk_buff_head { int i; spinlock_t lock; }; struct sk_buff_head audit_skb_queue; void audit_init(void) { struct sk_buff_head *list = &audit_skb_queue; spinlock_t a = {}; audit_skb_queue.lock = a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/zero-strct-4.c ================================================ typedef struct {} raw_spinlock_t; typedef struct { raw_spinlock_t raw_lock; } spinlock_t; struct sk_buff_head { int i; spinlock_t lock; }; struct sk_buff_head audit_skb_queue; void audit_init(void) { struct sk_buff_head *list = &audit_skb_queue; audit_skb_queue.lock = (spinlock_t) { .raw_lock = { } }; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/compile/zero-strct-5.c ================================================ /* Check that the inliner does not crash for this testcase. gimple_expr can change the expr to NULL meaning that we should not add any statement. */ struct f {}; struct g1 {struct f l;}; static inline void g(struct f a, int i){} void h(void) { struct g1 t; g(t.l , 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000112-1.c ================================================ #include static int special_format (fmt) const char *fmt; { return (strchr (fmt, '*') != 0 || strchr (fmt, 'V') != 0 || strchr (fmt, 'S') != 0 || strchr (fmt, 'n') != 0); } main() { if (special_format ("ee")) abort (); if (!special_format ("*e")) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000113-1.c ================================================ struct x { unsigned x1:1; unsigned x2:2; unsigned x3:3; }; foobar (int x, int y, int z) { struct x a = {x, y, z}; struct x b = {x, y, z}; struct x *c = &b; c->x3 += (a.x2 - a.x1) * c->x2; if (a.x1 != 1 || c->x3 != 5) abort (); exit (0); } main() { foobar (1, 2, 3); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000121-1.c ================================================ void big(long long u) { } void doit(unsigned int a,unsigned int b,char *id) { big(*id); big(a); big(b); } int main(void) { doit(1,1,"\n"); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000205-1.c ================================================ static int f (int a) { if (a == 0) return 0; do if (a & 128) return 1; while (f (0)); return 0; } int main(void) { if (f (~128)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000217-1.c ================================================ unsigned short int showbug(unsigned short int *a, unsigned short int *b) { *a += *b -8; return (*a >= 8); } int main() { unsigned short int x = 0; unsigned short int y = 10; if (showbug(&x, &y) != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000223-1.c ================================================ /* Copyright (C) 2000 Free Software Foundation, Inc. Contributed by Nathan Sidwell 23 Feb 2000 */ /* __alignof__ should never return a non-power of 2 eg, sizeof(long double) might be 12, but that means it must be alignable on a 4 byte boundary. */ void check (char const *type, int align) { if ((align & -align) != align) { abort (); } } #define QUOTE_(s) #s #define QUOTE(s) QUOTE_(s) #define check(t) check(QUOTE(t), __alignof__(t)) // This struct should have an alignment of the lcm of all the types. If one of // the base alignments is not a power of two, then A cannot be power of two // aligned. struct A { char c; signed short ss; unsigned short us; signed int si; unsigned int ui; signed long sl; unsigned long ul; signed long long sll; unsigned long long ull; float f; double d; long double ld; void *dp; void (*fp)(); }; int main () { check (void); check (char); check (signed short); check (unsigned short); check (signed int); check (unsigned int); check (signed long); check (unsigned long); check (signed long long); check (unsigned long long); check (float); check (double); check (long double); check (void *); check (void (*)()); check (struct A); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000224-1.c ================================================ int loop_1 = 100; int loop_2 = 7; int flag = 0; int test (void) { int i; int counter = 0; while (loop_1 > counter) { if (flag & 1) { for (i = 0; i < loop_2; i++) { counter++; } } flag++; } return 1; } int main() { if (test () != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000225-1.c ================================================ int main () { int nResult; int b=0; int i = -1; do { if (b!=0) { abort (); nResult=1; } else { nResult=0; } i++; b=(i+2)*4; } while (i < 0); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000227-1.c ================================================ static const unsigned char f[] = "\0\377"; static const unsigned char g[] = "\0"; int main(void) { if (sizeof f != 3 || sizeof g != 3) abort (); if (f[0] != g[0]) abort (); if (f[1] != g[1]) abort (); if (f[2] != g[2]) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000313-1.c ================================================ unsigned int buggy (unsigned int *param) { unsigned int accu, zero = 0, borrow; accu = - *param; borrow = - (accu > zero); *param += accu; return borrow; } int main (void) { unsigned int param = 1; unsigned int borrow = buggy (¶m); if (param != 0) abort (); if (borrow + 1 != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000314-1.c ================================================ int main () { long winds = 0; while (winds != 0) { if (*(char *) winds) break; } if (winds == 0 || winds != 0 || *(char *) winds) exit (0); abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000314-2.c ================================================ typedef unsigned long long uint64; const uint64 bigconst = 1ULL << 34; int a = 1; static uint64 getmask(void) { if (a) return bigconst; else return 0; } main() { uint64 f = getmask(); if (sizeof (long long) == 8 && f != bigconst) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000314-3.c ================================================ extern void abort (void); static char arg0[] = "arg0"; static char arg1[] = "arg1"; static void attr_rtx (char *, char *); static char *attr_string (char *); static void attr_eq (char *, char *); static void attr_rtx (char *varg0, char *varg1) { if (varg0 != arg0) abort (); if (varg1 != arg1) abort (); return; } static void attr_eq (name, value) char *name, *value; { return attr_rtx (attr_string (name), attr_string (value)); } static char * attr_string (str) char *str; { return str; } int main() { attr_eq (arg0, arg1); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000402-1.c ================================================ #include #if ULONG_LONG_MAX != 18446744073709551615ull && ULONG_MAX != 18446744073709551615ull int main(void) { exit (0); } #else #if ULONG_MAX != 18446744073709551615ull typedef unsigned long long ull; #else typedef unsigned long ull; #endif #include void checkit(int); main () { const ull a = 0x1400000000ULL; const ull b = 0x80000000ULL; const ull c = a/b; const ull d = 0x1400000000ULL / 0x80000000ULL; checkit ((int) c); checkit ((int) d); exit(0); } void checkit (int a) { if (a != 40) abort(); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000403-1.c ================================================ extern unsigned long aa[], bb[]; int seqgt (unsigned long a, unsigned short win, unsigned long b); int seqgt2 (unsigned long a, unsigned short win, unsigned long b); main() { if (! seqgt (*aa, 0x1000, *bb) || ! seqgt2 (*aa, 0x1000, *bb)) abort (); exit (0); } int seqgt (unsigned long a, unsigned short win, unsigned long b) { return (long) ((a + win) - b) > 0; } int seqgt2 (unsigned long a, unsigned short win, unsigned long b) { long l = ((a + win) - b); return l > 0; } unsigned long aa[] = { (1UL << (sizeof (long) * 8 - 1)) - 0xfff }; unsigned long bb[] = { (1UL << (sizeof (long) * 8 - 1)) - 0xfff }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000412-1.c ================================================ short int i = -1; const char * const wordlist[207]; const char * const * foo(void) { register const char * const *wordptr = &wordlist[207u + i]; return wordptr; } int main() { if (foo() != &wordlist[206]) abort (); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000412-2.c ================================================ int f(int a,int *y) { int x = a; if (a==0) return *y; return f(a-1,&x); } int main(int argc,char **argv) { if (f (100, (int *) 0) != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000412-3.c ================================================ typedef struct { char y; char x[32]; } X; int z (void) { X xxx; xxx.x[0] = xxx.x[31] = '0'; xxx.y = 0xf; return f (xxx, xxx); } int main (void) { int val; val = z (); if (val != 0x60) abort (); exit (0); } int f(X x, X y) { if (x.y != y.y) return 'F'; return x.x[0] + y.x[0]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000412-4.c ================================================ void f(int i, int j, int radius, int width, int N) { const int diff = i-radius; const int lowk = (diff>0 ? diff : 0 ); int k; for(k=lowk; k<= 2; k++){ int idx = ((k-i+radius)*width-j+radius); if (idx < 0) abort (); } for(k=lowk; k<= 2; k++); } int main(int argc, char **argv) { int exc_rad=2; int N=8; int i; for(i=1; i<4; i++) f(i,1,exc_rad,2*exc_rad + 1, N); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000412-5.c ================================================ int main( void ) { struct { int node; int type; } lastglob[1] = { { 0 , 1 } }; if (lastglob[0].node != 0 || lastglob[0].type != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000412-6.c ================================================ unsigned bug (unsigned short value, unsigned short *buffer, unsigned short *bufend); unsigned short buf[] = {1, 4, 16, 64, 256}; int main() { if (bug (512, buf, buf + 3) != 491) abort (); exit (0); } unsigned bug (unsigned short value, unsigned short *buffer, unsigned short *bufend) { unsigned short *tmp; for (tmp = buffer; tmp < bufend; tmp++) value -= *tmp; return value; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000419-1.c ================================================ struct foo { int a, b, c; }; void brother (int a, int b, int c) { if (a) abort (); } void sister (struct foo f, int b, int c) { brother ((f.b == b), b, c); } int main () { struct foo f = { 7, 8, 9 }; sister (f, 1, 2); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000422-1.c ================================================ int ops[13] = { 11, 12, 46, 3, 2, 2, 3, 2, 1, 3, 2, 1, 2 }; int correct[13] = { 46, 12, 11, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1 }; int num = 13; int main() { int i; for (i = 0; i < num; i++) { int j; for (j = num - 1; j > i; j--) { if (ops[j-1] < ops[j]) { int op = ops[j]; ops[j] = ops[j-1]; ops[j-1] = op; } } } for (i = 0; i < num; i++) if (ops[i] != correct[i]) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000503-1.c ================================================ unsigned long sub (int a) { return ((0 > a - 2) ? 0 : a - 2) * sizeof (long); } main () { if (sub (0) != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000511-1.c ================================================ void f (int value, int expect) { if (value != expect) abort (); } int main() { int a = 7, b = 6, c = 4, d = 7, e = 2; f (a||b%c, 1); f (a?b%c:0, 2); f (a=b%c, 2); f (a*=b%c, 4); f (a/=b%c, 2); f (a%=b%c, 0); f (a+=b%c, 2); f (d||c&&e, 1); f (d?c&&e:0, 1); f (d=c&&e, 1); f (d*=c&&e, 1); f (d%=c&&e, 0); f (d+=c&&e, 1); f (d-=c&&e, 0); f (d||c||e, 1); f (d?c||e:0, 0); f (d=c||e, 1); f (d*=c||e, 1); f (d%=c||e, 0); f (d+=c||e, 1); f (d-=c||e, 0); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000519-1.c ================================================ #include int bar (int a, va_list ap) { int b; do b = va_arg (ap, int); while (b > 10); return a + b; } int foo (int a, ...) { va_list ap; va_start (ap, a); return bar (a, ap); } int main () { if (foo (1, 2, 3) != 3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000519-2.c ================================================ long x = -1L; int main() { long b = (x != -1L); if (b) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000523-1.c ================================================ int main (void) { long long x; int n; if (sizeof (long long) < 8) exit (0); n = 9; x = (((long long) n) << 55) / 0xff; if (x == 0) abort (); x = (((long long) 9) << 55) / 0xff; if (x == 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000528-1.c ================================================ /* Copyright (C) 2000 Free Software Foundation */ /* Contributed by Alexandre Oliva */ unsigned long l = (unsigned long)-2; unsigned short s; int main () { long t = l; s = t; if (s != (unsigned short)-2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000603-1.c ================================================ /* It is not clear whether this test is conforming. See DR#236 http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_236.htm. However, there seems to be consensus that the presence of a union to aggregate struct s1 and struct s2 should make it conforming. */ struct s1 { double d; }; struct s2 { double d; }; union u { struct s1 x; struct s2 y; }; double f(struct s1 *a, struct s2 *b) { a->d = 1.0; return b->d + 1.0; } int main() { union u a; a.x.d = 0.0; if (f (&a.x, &a.y) != 2.0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000605-1.c ================================================ typedef struct _RenderInfo RenderInfo; struct _RenderInfo { int y; float scaley; int src_y; }; static void bar(void) { } static int render_image_rgb_a (RenderInfo * info) { int y, ye; float error; float step; y = info->y; ye = 256; step = 1.0 / info->scaley; error = y * step; error -= ((int) error) - step; for (; y < ye; y++) { if (error >= 1.0) { info->src_y += (int) error; error -= (int) error; bar(); } error += step; } return info->src_y; } int main (void) { RenderInfo info; info.y = 0; info.src_y = 0; info.scaley = 1.0; if (render_image_rgb_a(&info) != 256) abort (); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000605-2.c ================================================ struct F { int i; }; void f1(struct F *x, struct F *y) { int timeout = 0; for (; ((const struct F*)x)->i < y->i ; x->i++) if (++timeout > 5) abort (); } main() { struct F x, y; x.i = 0; y.i = 1; f1 (&x, &y); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000605-3.c ================================================ struct F { int x; int y; }; int main() { int timeout = 0; int x = 0; while (1) { const struct F i = { x++, }; if (i.x > 0) break; if (++timeout > 5) goto die; } return 0; die: abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000622-1.c ================================================ long foo(long a, long b, long c) { if (a != 12 || b != 1 || c != 11) abort(); return 0; } long bar (long a, long b) { return b; } void baz (long a, long b, void *c) { long d; d = (long)c; foo(d, bar (a, 1), b); } int main() { baz (10, 11, (void *)12); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000703-1.c ================================================ void abort(void); void exit(int); struct baz { char a[17]; char b[3]; unsigned int c; unsigned int d; }; void foo(struct baz *p, unsigned int c, unsigned int d) { __builtin_memcpy (p->b, "abc", 3); p->c = c; p->d = d; } void bar(struct baz *p, unsigned int c, unsigned int d) { ({ void *s = (p); __builtin_memset (s, '\0', sizeof (struct baz)); s; }); __builtin_memcpy (p->a, "01234567890123456", 17); __builtin_memcpy (p->b, "abc", 3); p->c = c; p->d = d; } int main() { struct baz p; foo(&p, 71, 18); if (p.c != 71 || p.d != 18) abort(); bar(&p, 59, 26); if (p.c != 59 || p.d != 26) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000706-1.c ================================================ extern void abort(void); extern void exit(int); struct baz { int a, b, c, d, e; }; void bar(struct baz *x, int f, int g, int h, int i, int j) { if (x->a != 1 || x->b != 2 || x->c != 3 || x->d != 4 || x->e != 5 || f != 6 || g != 7 || h != 8 || i != 9 || j != 10) abort(); } void foo(struct baz x, char **y) { bar(&x,6,7,8,9,10); } int main() { struct baz x; x.a = 1; x.b = 2; x.c = 3; x.d = 4; x.e = 5; foo(x,(char **)0); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000706-2.c ================================================ extern void abort(void); extern void exit(int); struct baz { int a, b, c, d, e; }; void bar(struct baz *x, int f, int g, int h, int i, int j) { if (x->a != 1 || x->b != 2 || x->c != 3 || x->d != 4 || x->e != 5 || f != 6 || g != 7 || h != 8 || i != 9 || j != 10) abort(); } void foo(char *z, struct baz x, char *y) { bar(&x,6,7,8,9,10); } int main() { struct baz x; x.a = 1; x.b = 2; x.c = 3; x.d = 4; x.e = 5; foo((char *)0,x,(char *)0); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000706-3.c ================================================ extern void abort(void); extern void exit(int); int c; void baz(int *p) { c = *p; } void bar(int b) { if (c != 1 || b != 2) abort(); } void foo(int a, int b) { baz(&a); bar(b); } int main() { foo(1, 2); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000706-4.c ================================================ extern void abort(void); extern void exit(int); int *c; void bar(int b) { if (*c != 1 || b != 2) abort(); } void foo(int a, int b) { c = &a; bar(b); } int main() { foo(1, 2); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000706-5.c ================================================ extern void abort(void); extern void exit(int); struct baz { int a, b, c; }; struct baz *c; void bar(int b) { if (c->a != 1 || c->b != 2 || c->c != 3 || b != 4) abort(); } void foo(struct baz a, int b) { c = &a; bar(b); } int main() { struct baz a; a.a = 1; a.b = 2; a.c = 3; foo(a, 4); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000707-1.c ================================================ extern void abort(void); extern void exit(int); struct baz { int a, b, c; }; void foo (int a, int b, int c) { if (a != 4) abort (); } void bar (struct baz x, int b, int c) { foo (x.b, b, c); } int main () { struct baz x = { 3, 4, 5 }; bar (x, 1, 2); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000715-1.c ================================================ void abort(void); void exit(int); void test1(void) { int x = 3, y = 2; if ((x < y ? x++ : y++) != 2) abort (); if (x != 3) abort (); if (y != 3) abort (); } void test2(void) { int x = 3, y = 2, z; z = (x < y) ? x++ : y++; if (z != 2) abort (); if (x != 3) abort (); if (y != 3) abort (); } void test3(void) { int x = 3, y = 2; int xx = 3, yy = 2; if ((xx < yy ? x++ : y++) != 2) abort (); if (x != 3) abort (); if (y != 3) abort (); } int x, y; static void init_xy(void) { x = 3; y = 2; } void test4(void) { init_xy(); if ((x < y ? x++ : y++) != 2) abort (); if (x != 3) abort (); if (y != 3) abort (); } void test5(void) { int z; init_xy(); z = (x < y) ? x++ : y++; if (z != 2) abort (); if (x != 3) abort (); if (y != 3) abort (); } void test6(void) { int xx = 3, yy = 2; int z; init_xy(); z = (xx < y) ? x++ : y++; if (z != 2) abort (); if (x != 3) abort (); if (y != 3) abort (); } int main(){ test1 (); test2 (); test3 (); test4 (); test5 (); test6 (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000715-2.c ================================================ extern void abort(void); extern void exit(int); unsigned int foo(unsigned int a) { return ((unsigned char)(a + 1)) * 4; } int main(void) { if (foo((unsigned char)~0)) abort (); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000717-1.c ================================================ typedef struct trio { int a, b, c; } trio; int bar (int i, trio t) { if (t.a == t.b || t.a == t.c) abort (); } int foo (trio t, int i) { return bar (i, t); } main () { trio t = { 1, 2, 3 }; foo (t, 4); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000717-2.c ================================================ static void compare (long long foo) { if (foo < 4294967297LL) abort(); } int main(void) { compare (8589934591LL); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000717-3.c ================================================ int c = -1; foo (p) int *p; { int x; int a; a = p[0]; x = a + 5; a = c; p[0] = x - 15; return a; } int main() { int b = 1; int a = foo(&b); if (a != -1 || b != (1 + 5 - 15)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000717-4.c ================================================ /* Extracted from gas. Incorrectly generated non-pic code at -O0 for IA-64, which produces linker errors on some operating systems. */ struct { int offset; struct slot { int field[6]; } slot[4]; } s; int x () { int toggle = 0; int r = s.slot[0].field[!toggle]; return r; } int main () { return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000717-5.c ================================================ typedef struct trio { int a, b, c; } trio; int bar (int i, int j, int k, trio t) { if (t.a != 1 || t.b != 2 || t.c != 3 || i != 4 || j != 5 || k != 6) abort (); } int foo (trio t, int i, int j, int k) { return bar (i, j, k, t); } main () { trio t = { 1, 2, 3 }; foo (t, 4, 5, 6); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000722-1.c ================================================ struct s { char *p; int t; }; extern void bar (void); extern void foo (struct s *); int main(void) { bar (); bar (); exit (0); } void bar (void) { foo (& (struct s) { "hi", 1 }); } void foo (struct s *p) { if (p->t != 1) abort(); p->t = 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000726-1.c ================================================ void adjust_xy (short *, short *); struct adjust_template { short kx_x; short kx_y; short kx; short kz; }; static struct adjust_template adjust = {0, 0, 1, 1}; main () { short x = 1, y = 1; adjust_xy (&x, &y); if (x != 1) abort (); exit (0); } void adjust_xy (x, y) short *x; short *y; { *x = adjust.kx_x * *x + adjust.kx_y * *y + adjust.kx; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000731-1.c ================================================ double foo (void) { return 0.0; } void do_sibcall (void) { (void) foo (); } int main (void) { double x; for (x = 0; x < 20; x++) do_sibcall (); if (!(x >= 10)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000731-2.c ================================================ int main() { int i = 1; int j = 0; while (i != 1024 || j <= 0) { i *= 2; ++ j; } if (j != 10) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000801-1.c ================================================ extern void abort(void); extern void exit(int); void foo (char *bp, unsigned n) { register char c; register char *ep = bp + n; register char *sp; while (bp < ep) { sp = bp + 3; c = *sp; *sp = *bp; *bp++ = c; sp = bp + 1; c = *sp; *sp = *bp; *bp++ = c; bp += 2; } } int main(void) { int one = 1; if (sizeof(int) != 4 * sizeof(char)) exit(0); foo((char *)&one, sizeof(one)); foo((char *)&one, sizeof(one)); if (one != 1) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000801-2.c ================================================ extern void abort(void); extern void exit(int); int bar(void); int baz(void); struct foo { struct foo *next; }; struct foo *test(struct foo *node) { while (node) { if (bar() && !baz()) break; node = node->next; } return node; } int bar (void) { return 0; } int baz (void) { return 0; } int main(void) { struct foo a, b, *c; a.next = &b; b.next = (struct foo *)0; c = test(&a); if (c) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000801-3.c ================================================ /* Origin: PR c/92 from Simon Marlow , adapted to a testcase by Joseph Myers . */ typedef struct { } empty; typedef struct { int i; empty e; int i2; } st; st s = { .i = 0, .i2 = 1 }; extern void abort (void); int main (void) { if (s.i2 == 1) exit (0); else abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000801-4.c ================================================ /* Origin: PR c/128 from Martin Sebor , adapted as a testcase by Joseph Myers . */ /* Character arrays initialized by a string literal must have uninitialized elements zeroed. This isn't clear in the 1990 standard, but was fixed in TC2 and C99; see DRs #060, #092. */ extern void abort (void); int foo (void) { char s[2] = ""; return 0 == s[1]; } char *t; int main (void) { { char s[] = "x"; t = s; } if (foo ()) exit (0); else abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000808-1.c ================================================ typedef struct { long int p_x, p_y; } Point; void bar () { } void f (p0, p1, p2, p3, p4, p5) Point p0, p1, p2, p3, p4, p5; { if (p0.p_x != 0 || p0.p_y != 1 || p1.p_x != -1 || p1.p_y != 0 || p2.p_x != 1 || p2.p_y != -1 || p3.p_x != -1 || p3.p_y != 1 || p4.p_x != 0 || p4.p_y != -1 || p5.p_x != 1 || p5.p_y != 0) abort (); } void foo () { Point p0, p1, p2, p3, p4, p5; bar(); p0.p_x = 0; p0.p_y = 1; p1.p_x = -1; p1.p_y = 0; p2.p_x = 1; p2.p_y = -1; p3.p_x = -1; p3.p_y = 1; p4.p_x = 0; p4.p_y = -1; p5.p_x = 1; p5.p_y = 0; f (p0, p1, p2, p3, p4, p5); } int main() { foo(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000815-1.c ================================================ struct table_elt { void *exp; struct table_elt *next_same_hash; struct table_elt *prev_same_hash; struct table_elt *next_same_value; struct table_elt *prev_same_value; struct table_elt *first_same_value; struct table_elt *related_value; int cost; int mode; char in_memory; char in_struct; char is_const; char flag; }; struct write_data { int sp : 1; int var : 1; int nonscalar : 1; int all : 1; }; int cse_rtx_addr_varies_p(void *); void remove_from_table(struct table_elt *, int); static struct table_elt *table[32]; void invalidate_memory (writes) struct write_data *writes; { register int i; register struct table_elt *p, *next; int all = writes->all; int nonscalar = writes->nonscalar; for (i = 0; i < 31; i++) for (p = table[i]; p; p = next) { next = p->next_same_hash; if (p->in_memory && (all || (nonscalar && p->in_struct) || cse_rtx_addr_varies_p (p->exp))) remove_from_table (p, i); } } int cse_rtx_addr_varies_p(void *x) { return 0; } void remove_from_table(struct table_elt *x, int y) { abort (); } int main() { struct write_data writes; struct table_elt elt; __builtin_memset(&elt, 0, sizeof(elt)); elt.in_memory = 1; table[0] = &elt; __builtin_memset(&writes, 0, sizeof(writes)); writes.var = 1; writes.nonscalar = 1; invalidate_memory(&writes); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000818-1.c ================================================ /* Copyright (C) 2000 Free Software Foundation. by Manfred Hollstein */ void *temporary_obstack; static int input (void); static int ISALNUM (int ch); static void obstack_1grow (void **ptr, int ch); int yylex (void); int main (void); int main (void) { int ch = yylex (); exit (0); } int yylex (void) { int ch; #ifndef WORK_AROUND for (;;) { ch = input (); if (ISALNUM (ch)) obstack_1grow (&temporary_obstack, ch); else if (ch != '_') break; } #else do { ch = input (); if (ISALNUM (ch)) obstack_1grow (&temporary_obstack, ch); } while (ch == '_'); #endif return ch; } static int input (void) { return 0; } static int ISALNUM (int ch) { return ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '0')); } static void obstack_1grow (void **ptr, int ch) { } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000819-1.c ================================================ int a[2] = { 2, 0 }; void foo(int *sp, int cnt) { int *p, *top; top = sp; sp -= cnt; for(p = sp; p <= top; p++) if (*p < 2) exit(0); } int main() { foo(a + 1, 1); abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000822-1.c ================================================ #ifndef NO_TRAMPOLINES int f0(int (*fn)(int *), int *p) { return (*fn) (p); } int f1(void) { int i = 0; int f2(int *p) { i = 1; return *p + 1; } return f0(f2, &i); } #endif int main() { #ifndef NO_TRAMPOLINES if (f1() != 2) abort (); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000910-1.c ================================================ /* Copyright (C) 2000 Free Software Foundation */ /* by Alexandre Oliva */ #include void bar (int); void foo (int *); int main () { static int a[] = { 0, 1, 2 }; int *i = &a[sizeof(a)/sizeof(*a)]; while (i-- > a) foo (i); exit (0); } void baz (int, int); void bar (int i) { baz (i, i); } void foo (int *i) { bar (*i); } void baz (int i, int j) { if (i != j) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000910-2.c ================================================ /* Copyright (C) 2000 Free Software Foundation */ /* by Alexandre Oliva */ #include #include char *list[] = { "*", "e" }; static int bar (const char *fmt) { return (strchr (fmt, '*') != 0); } static void foo () { int i; for (i = 0; i < sizeof (list) / sizeof (*list); i++) { const char *fmt = list[i]; if (bar (fmt)) continue; if (i == 0) abort (); else exit (0); } } int main () { foo (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000914-1.c ================================================ extern void *malloc(__SIZE_TYPE__); enum tree_code { ERROR_MARK, IDENTIFIER_NODE, OP_IDENTIFIER, TREE_LIST, TREE_VEC, BLOCK, VOID_TYPE, INTEGER_TYPE, REAL_TYPE, COMPLEX_TYPE, VECTOR_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, CHAR_TYPE, POINTER_TYPE, OFFSET_TYPE, REFERENCE_TYPE, METHOD_TYPE, FILE_TYPE, ARRAY_TYPE, SET_TYPE, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, FUNCTION_TYPE, LANG_TYPE, INTEGER_CST, REAL_CST, COMPLEX_CST, STRING_CST, FUNCTION_DECL, LABEL_DECL, CONST_DECL, TYPE_DECL, VAR_DECL, PARM_DECL, RESULT_DECL, FIELD_DECL, NAMESPACE_DECL, COMPONENT_REF, BIT_FIELD_REF, INDIRECT_REF, BUFFER_REF, ARRAY_REF, CONSTRUCTOR, COMPOUND_EXPR, MODIFY_EXPR, INIT_EXPR, TARGET_EXPR, COND_EXPR, BIND_EXPR, CALL_EXPR, METHOD_CALL_EXPR, WITH_CLEANUP_EXPR, CLEANUP_POINT_EXPR, PLACEHOLDER_EXPR, WITH_RECORD_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, CEIL_DIV_EXPR, FLOOR_DIV_EXPR, ROUND_DIV_EXPR, TRUNC_MOD_EXPR, CEIL_MOD_EXPR, FLOOR_MOD_EXPR, ROUND_MOD_EXPR, RDIV_EXPR, EXACT_DIV_EXPR, FIX_TRUNC_EXPR, FIX_CEIL_EXPR, FIX_FLOOR_EXPR, FIX_ROUND_EXPR, FLOAT_EXPR, EXPON_EXPR, NEGATE_EXPR, MIN_EXPR, MAX_EXPR, ABS_EXPR, FFS_EXPR, LSHIFT_EXPR, RSHIFT_EXPR, LROTATE_EXPR, RROTATE_EXPR, BIT_IOR_EXPR, BIT_XOR_EXPR, BIT_AND_EXPR, BIT_ANDTC_EXPR, BIT_NOT_EXPR, TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR, TRUTH_XOR_EXPR, TRUTH_NOT_EXPR, LT_EXPR, LE_EXPR, GT_EXPR, GE_EXPR, EQ_EXPR, NE_EXPR, UNORDERED_EXPR, ORDERED_EXPR, UNLT_EXPR, UNLE_EXPR, UNGT_EXPR, UNGE_EXPR, UNEQ_EXPR, IN_EXPR, SET_LE_EXPR, CARD_EXPR, RANGE_EXPR, CONVERT_EXPR, NOP_EXPR, NON_LVALUE_EXPR, SAVE_EXPR, UNSAVE_EXPR, RTL_EXPR, ADDR_EXPR, REFERENCE_EXPR, ENTRY_VALUE_EXPR, COMPLEX_EXPR, CONJ_EXPR, REALPART_EXPR, IMAGPART_EXPR, PREDECREMENT_EXPR, PREINCREMENT_EXPR, POSTDECREMENT_EXPR, POSTINCREMENT_EXPR, VA_ARG_EXPR, TRY_CATCH_EXPR, TRY_FINALLY_EXPR, GOTO_SUBROUTINE_EXPR, POPDHC_EXPR, POPDCC_EXPR, LABEL_EXPR, GOTO_EXPR, RETURN_EXPR, EXIT_EXPR, LOOP_EXPR, LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR, EXPR_WITH_FILE_LOCATION, SWITCH_EXPR, LAST_AND_UNUSED_TREE_CODE }; typedef union tree_node *tree; struct tree_common { union tree_node *chain; union tree_node *type; enum tree_code code : 8; unsigned side_effects_flag : 1; unsigned constant_flag : 1; unsigned permanent_flag : 1; unsigned addressable_flag : 1; unsigned volatile_flag : 1; unsigned readonly_flag : 1; unsigned unsigned_flag : 1; unsigned asm_written_flag: 1; unsigned used_flag : 1; unsigned nothrow_flag : 1; unsigned static_flag : 1; unsigned public_flag : 1; unsigned private_flag : 1; unsigned protected_flag : 1; unsigned bounded_flag : 1; unsigned lang_flag_0 : 1; unsigned lang_flag_1 : 1; unsigned lang_flag_2 : 1; unsigned lang_flag_3 : 1; unsigned lang_flag_4 : 1; unsigned lang_flag_5 : 1; unsigned lang_flag_6 : 1; }; union tree_node { struct tree_common common; }; enum c_tree_code { C_DUMMY_TREE_CODE = LAST_AND_UNUSED_TREE_CODE, SRCLOC, SIZEOF_EXPR, ARROW_EXPR, ALIGNOF_EXPR, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR, LAST_C_TREE_CODE }; enum cplus_tree_code { CP_DUMMY_TREE_CODE = LAST_C_TREE_CODE, OFFSET_REF, PTRMEM_CST, NEW_EXPR, VEC_NEW_EXPR, DELETE_EXPR, VEC_DELETE_EXPR, SCOPE_REF, MEMBER_REF, TYPE_EXPR, AGGR_INIT_EXPR, THROW_EXPR, EMPTY_CLASS_EXPR, TEMPLATE_DECL, TEMPLATE_PARM_INDEX, TEMPLATE_TYPE_PARM, TEMPLATE_TEMPLATE_PARM, BOUND_TEMPLATE_TEMPLATE_PARM, TYPENAME_TYPE, TYPEOF_TYPE, USING_DECL, DEFAULT_ARG, TEMPLATE_ID_EXPR, CPLUS_BINDING, OVERLOAD, WRAPPER, LOOKUP_EXPR, FUNCTION_NAME, MODOP_EXPR, CAST_EXPR, REINTERPRET_CAST_EXPR, CONST_CAST_EXPR, STATIC_CAST_EXPR, DYNAMIC_CAST_EXPR, DOTSTAR_EXPR, TYPEID_EXPR, PSEUDO_DTOR_EXPR, SUBOBJECT, CTOR_STMT, CLEANUP_STMT, START_CATCH_STMT, CTOR_INITIALIZER, RETURN_INIT, TRY_BLOCK, HANDLER, TAG_DEFN, IDENTITY_CONV, LVALUE_CONV, QUAL_CONV, STD_CONV, PTR_CONV, PMEM_CONV, BASE_CONV, REF_BIND, USER_CONV, AMBIG_CONV, RVALUE_CONV, LAST_CPLUS_TREE_CODE }; blah(){} convert_like_real (convs) tree convs; { switch (((enum tree_code) (convs)->common.code)) { case AMBIG_CONV: return blah(); default: break; }; abort (); } main() { tree convs = (void *)malloc (sizeof (struct tree_common));; convs->common.code = AMBIG_CONV; convert_like_real (convs); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20000917-1.c ================================================ /* This bug exists in gcc-2.95, egcs-1.1.2, gcc-2.7.2 and probably every other version as well. */ typedef struct int3 { int a, b, c; } int3; int3 one (void) { return (int3) { 1, 1, 1 }; } int3 zero (void) { return (int3) { 0, 0, 0 }; } int main (void) { int3 a; /* gcc allocates a temporary for the inner expression statement to store the return value of `one'. gcc frees the temporaries for the inner expression statement. gcc realloates the same temporary slot to store the return value of `zero'. gcc expands the call to zero ahead of the expansion of the statement expressions. The temporary gets the value of `zero'. gcc expands statement expressions and the stale temporary is clobbered with the value of `one'. The bad value is copied from the temporary into *&a. */ *({ ({ one (); &a; }); }) = zero (); if (a.a && a.b && a.c) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001009-1.c ================================================ int a,b; main() { int c=-2; int d=0xfe; int e=a&1; int f=b&2; if ((char)(c|(e&f)) == (char)d) return 0; else abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001009-2.c ================================================ int b=1; int foo() { int a; int c; a=0xff; for (;b;b--) { c=1; asm(""::"r"(c)); c=(signed char)a; } if (c!=-1) abort(); return c; } int main() { foo(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001011-1.c ================================================ extern void abort(void); extern int strcmp(const char *, const char *); int foo(const char *a) { return strcmp(a, "main"); } int main(void) { if(foo(__FUNCTION__)) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001013-1.c ================================================ struct x { int a, b; } z = { -4028, 4096 }; int foo(struct x *p, int y) { if ((y & 0xff) != y || -p->b >= p->a) return 1; return 0; } main() { if (foo (&z, 10)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001017-1.c ================================================ void bug (double *Cref, char transb, int m, int n, int k, double a, double *A, int fdA, double *B, int fdB, double b, double *C, int fdC) { if (C != Cref) abort (); } int main (void) { double A[1], B[1], C[1]; bug (C, 'B', 1, 2, 3, 4.0, A, 5, B, 6, 7.0, C, 8); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001017-2.c ================================================ void fn_4parms (unsigned char a, long *b, long *c, unsigned int *d) { if (*b != 1 || *c != 2 || *d != 3) abort (); } int main () { unsigned char a = 0; unsigned long b = 1, c = 2; unsigned int d = 3; fn_4parms (a, &b, &c, &d); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001024-1.c ================================================ struct a; extern int baz (struct a *__restrict x); struct a { long v; long w; }; struct b { struct a c; struct a d; }; int bar (int x, const struct b *__restrict y, struct b *__restrict z) { if (y->c.v || y->c.w != 250000 || y->d.v || y->d.w != 250000) abort(); } void foo(void) { struct b x; x.c.v = 0; x.c.w = 250000; x.d = x.c; bar(0, &x, ((void *)0)); } int main() { foo(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001026-1.c ================================================ extern void abort (void); typedef struct { long r[(19 + sizeof (long))/(sizeof (long))]; } realvaluetype; typedef void *tree; static realvaluetype real_value_from_int_cst (tree x, tree y) { realvaluetype r; int i; for (i = 0; i < sizeof(r.r)/sizeof(long); ++i) r.r[i] = -1; return r; } struct brfic_args { tree type; tree i; realvaluetype d; }; static void build_real_from_int_cst_1 (data) void * data; { struct brfic_args *args = (struct brfic_args *) data; args->d = real_value_from_int_cst (args->type, args->i); } int main() { struct brfic_args args; __builtin_memset (&args, 0, sizeof(args)); build_real_from_int_cst_1 (&args); if (args.d.r[0] == 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001027-1.c ================================================ int x,*p=&x; int main() { int i=0; x=1; p[i]=2; if (x != 2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001031-1.c ================================================ extern void abort (void); extern void exit (int); void t1 (int x) { if (x != 4100) abort (); } int t2 (void) { int i; t1 ((i = 4096) + 4); return i; } void t3 (long long x) { if (x != 0x80000fffULL) abort (); } long long t4 (void) { long long i; t3 ((i = 4096) + 0x7fffffffULL); return i; } main () { if (t2 () != 4096) abort (); if (t4 () != 4096) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001101.c ================================================ /* { dg-require-effective-target untyped_assembly } */ extern void abort(void); typedef struct { unsigned int unchanging : 1; } struc, *rtx; rtx dummy ( int *a, rtx *b) { *a = 1; *b = (rtx)7; return (rtx)1; } void bogus (insn, thread, delay_list) rtx insn; rtx thread; rtx delay_list; { rtx new_thread; int must_annul; delay_list = dummy ( &must_annul, &new_thread); if (delay_list == 0 && new_thread ) { thread = new_thread; } if (delay_list && must_annul) insn->unchanging = 1; if (new_thread != thread ) abort(); } int main() { struc baz; bogus (&baz, (rtx)7, 0); exit(0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001108-1.c ================================================ long long signed_poly (long long sum, long x) { sum += (long long) (long) sum * (long long) x; return sum; } unsigned long long unsigned_poly (unsigned long long sum, unsigned long x) { sum += (unsigned long long) (unsigned long) sum * (unsigned long long) x; return sum; } int main (void) { if (signed_poly (2LL, -3) != -4LL) abort (); if (unsigned_poly (2ULL, 3) != 8ULL) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001111-1.c ================================================ static int next_buffer = 0; void bar (void); static int t = 1, u = 0; long foo (unsigned int offset) { unsigned i, buffer; int x; char *data; i = u; if (i) return i * 0xce2f; buffer = next_buffer; data = buffer * 0xce2f; for (i = 0; i < 2; i++) bar (); buffer = next_buffer; return buffer * 0xce2f + offset; } void bar (void) { } int main () { if (foo (3) != 3) abort (); next_buffer = 1; if (foo (2) != 0xce2f + 2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001112-1.c ================================================ int main () { long long i = 1; i = i * 2 + 1; if (i != 3) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001121-1.c ================================================ /* { dg-options "-fgnu89-inline" } */ extern void abort (void); extern void exit (int); double d; __inline__ double foo (void) { return d; } __inline__ int bar (void) { foo(); return 0; } int main (void) { if (bar ()) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001124-1.c ================================================ struct inode { long long i_size; struct super_block *i_sb; }; struct file { long long f_pos; }; struct super_block { int s_blocksize; unsigned char s_blocksize_bits; int s_hs; }; static char * isofs_bread(unsigned int block) { if (block) abort (); exit(0); } static int do_isofs_readdir(struct inode *inode, struct file *filp) { int bufsize = inode->i_sb->s_blocksize; unsigned char bufbits = inode->i_sb->s_blocksize_bits; unsigned int block, offset; char *bh = 0; int hs; if (filp->f_pos >= inode->i_size) return 0; offset = filp->f_pos & (bufsize - 1); block = filp->f_pos >> bufbits; hs = inode->i_sb->s_hs; while (filp->f_pos < inode->i_size) { if (!bh) bh = isofs_bread(block); hs += block << bufbits; if (hs == 0) filp->f_pos++; if (offset >= bufsize) offset &= bufsize - 1; if (*bh) filp->f_pos++; filp->f_pos++; } return 0; } struct super_block s; struct inode i; struct file f; int main(int argc, char **argv) { s.s_blocksize = 512; s.s_blocksize_bits = 9; i.i_size = 2048; i.i_sb = &s; f.f_pos = 0; do_isofs_readdir(&i,&f); abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001130-1.c ================================================ static inline int bar(void) { return 1; } static int mem[3]; static int foo(int x) { if (x != 0) return x; mem[x++] = foo(bar()); if (x != 1) abort(); return 0; } int main() { foo(0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001130-2.c ================================================ static int which_alternative = 3; static const char *i960_output_ldconst (void); static const char * output_25 (void) { switch (which_alternative) { case 0: return "mov %1,%0"; case 1: return i960_output_ldconst (); case 2: return "ld %1,%0"; case 3: return "st %1,%0"; } } static const char *i960_output_ldconst (void) { return "foo"; } int main(void) { const char *s = output_25 () ; if (s[0] != 's') abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001203-1.c ================================================ /* Origin: PR c/410 from Jan Echternach , adapted to a testcase by Joseph Myers . */ extern void exit (int); static void foo (void) { struct { long a; char b[1]; } x = { 2, { 0 } }; } int main (void) { int tmp; foo (); tmp = 1; exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001203-2.c ================================================ struct obstack { long chunk_size; struct _obstack_chunk *chunk; char *object_base; char *next_free; char *chunk_limit; int alignment_mask; unsigned maybe_empty_object; }; struct objfile { struct objfile *next; struct obstack type_obstack; }; struct type { unsigned length; struct objfile *objfile; short nfields; struct field { union field_location { int bitpos; unsigned long physaddr; char *physname; } loc; int bitsize; struct type *type; char *name; } *fields; }; struct type *alloc_type (void); void * xmalloc (unsigned int z); void _obstack_newchunk (struct obstack *o, int i); void get_discrete_bounds (long long *lowp, long long *highp); extern void *memset(void *, int, __SIZE_TYPE__); struct type * create_array_type (struct type *result_type, struct type *element_type) { long long low_bound, high_bound; if (result_type == ((void *)0)) { result_type = alloc_type (); } get_discrete_bounds (&low_bound, &high_bound); (result_type)->length = (element_type)->length * (high_bound - low_bound + 1); (result_type)->nfields = 1; (result_type)->fields = (struct field *) ((result_type)->objfile != ((void *)0) ? ( { struct obstack *__h = (&(result_type)->objfile -> type_obstack); { struct obstack *__o = (__h); int __len = ((sizeof (struct field))); if (__o->chunk_limit - __o->next_free < __len) _obstack_newchunk (__o, __len); __o->next_free += __len; (void) 0; }; ({ struct obstack *__o1 = (__h); void *value; value = (void *) __o1->object_base; if (__o1->next_free == value) __o1->maybe_empty_object = 1; __o1->next_free = (((((__o1->next_free) - (char *) 0) +__o1->alignment_mask) & ~ (__o1->alignment_mask)) + (char *) 0); if (__o1->next_free - (char *)__o1->chunk > __o1->chunk_limit - (char *)__o1->chunk) __o1->next_free = __o1->chunk_limit; __o1->object_base = __o1->next_free; value; }); }) : xmalloc (sizeof (struct field))); return (result_type); } struct type * alloc_type (void) { abort (); } void * xmalloc (unsigned int z) { return 0; } void _obstack_newchunk (struct obstack *o, int i) { abort (); } void get_discrete_bounds (long long *lowp, long long *highp) { *lowp = 0; *highp = 2; } int main(void) { struct type element_type; struct type result_type; memset (&element_type, 0, sizeof (struct type)); memset (&result_type, 0, sizeof (struct type)); element_type.length = 4; create_array_type (&result_type, &element_type); if (result_type.length != 12) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001221-1.c ================================================ int main () { unsigned long long a; if (! (a = 0xfedcba9876543210ULL)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001228-1.c ================================================ int foo1(void) { union { char a[sizeof (unsigned)]; unsigned b; } u; u.b = 0x01; return u.a[0]; } int foo2(void) { volatile union { char a[sizeof (unsigned)]; unsigned b; } u; u.b = 0x01; return u.a[0]; } int main(void) { if (foo1() != foo2()) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20001229-1.c ================================================ /* This testcase originally provoked an unaligned access fault on Alpha. Since Digital Unix and Linux (and probably others) by default fix these up in the kernel, the failure was not visible unless one is sitting at the console examining logs. So: If we know how, ask the kernel to deliver SIGBUS instead so that the test case visibly fails. */ #if defined(__alpha__) && defined(__linux__) #include #include static inline int setsysinfo(unsigned long op, void *buffer, unsigned long size, int *start, void *arg, unsigned long flag) { syscall(__NR_osf_setsysinfo, op, buffer, size, start, arg, flag); } static void __attribute__((constructor)) trap_unaligned(void) { unsigned int buf[2]; buf[0] = SSIN_UACPROC; buf[1] = UAC_SIGBUS | UAC_NOPRINT; setsysinfo(SSI_NVPAIRS, buf, 1, 0, 0, 0); } #endif /* alpha */ void foo(char *a, char *b) { } void showinfo() { char uname[33] = "", tty[38] = "/dev/"; foo(uname, tty); } int main() { showinfo (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010106-1.c ================================================ /* Copyright 2001 Free Software Foundation Contributed by Alexandre Oliva */ int f(int i) { switch (i) { case -2: return 33; case -1: return 0; case 0: return 7; case 1: return 4; case 2: return 3; case 3: return 15; case 4: return 9; default: abort (); } } int main() { if (f(-1)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010114-1.c ================================================ /* Origin: PR c/1540 from Mattias Lampe , adapted to a testcase by Joseph Myers . GCC 2.95.2 fails, CVS GCC of 2001-01-13 passes. */ extern void abort (void); extern void exit (int); int main (void) { int array1[1] = { 1 }; int array2[2][1]= { { 1 }, { 0 } }; if (array1[0] != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010116-1.c ================================================ /* Distilled from optimization/863. */ extern void abort (void); extern void exit (int); extern void ok (int); typedef struct { int x, y, z; } Data; void find (Data *first, Data *last) { int i; for (i = (last - first) >> 2; i > 0; --i) ok(i); abort (); } void ok(int i) { if (i != 1) abort (); exit (0); } int main () { Data DataList[4]; find (DataList + 0, DataList + 4); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010118-1.c ================================================ typedef struct { int a, b, c, d, e, f; } A; void foo (A *v, int w, int x, int *y, int *z) { } void bar (A *v, int x, int y, int w, int h) { if (v->a != x || v->b != y) { int oldw = w; int oldh = h; int e = v->e; int f = v->f; int dx, dy; foo(v, 0, 0, &w, &h); dx = (oldw - w) * (double) e/2.0; dy = (oldh - h) * (double) f/2.0; x += dx; y += dy; v->a = x; v->b = y; v->c = w; v->d = h; } } int main () { A w = { 100, 110, 20, 30, -1, -1 }; bar (&w,400,420,50,70); if (w.d != 70) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010119-1.c ================================================ #ifdef __OPTIMIZE__ extern void undef (void); void bar (unsigned x) { } void baz (unsigned x) { } extern inline void foo (int a, int b) { int c = 0; while (c++ < b) (__builtin_constant_p (a) ? ((a) > 20000 ? undef () : bar (a)) : baz (a)); } #else void foo (int a, int b) { } #endif int main (void) { foo(10, 100); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010122-1.c ================================================ /* { dg-skip-if "requires frame pointers" { *-*-* } "-fomit-frame-pointer" "" } */ /* { dg-require-effective-target return_address } */ extern void exit (int); extern void abort (void); extern void *alloca (__SIZE_TYPE__); char *dummy (void); #define NOINLINE __attribute__((noinline)) __attribute__ ((noclone)) void *save_ret1[6]; void *test4a (char *); void *test5a (char *); void *test6a (char *); void NOINLINE *test1 (void) { void * temp; temp = __builtin_return_address (0); return temp; } void NOINLINE *test2 (void) { void * temp; dummy (); temp = __builtin_return_address (0); return temp; } void NOINLINE *test3 (void) { void * temp; temp = __builtin_return_address (0); dummy (); return temp; } void NOINLINE *test4 (void) { char * save = (char*) alloca (4); return test4a (save); } void *NOINLINE test4a (char * p) { void * temp; temp = __builtin_return_address (1); return temp; } void NOINLINE *test5 (void) { char * save = (char*) alloca (4); return test5a (save); } void NOINLINE *test5a (char * p) { void * temp; dummy (); temp = __builtin_return_address (1); return temp; } void NOINLINE *test6 (void) { char * save = (char*) alloca (4); return test6a (save); } void NOINLINE *test6a (char * p) { void * temp; temp = __builtin_return_address (1); dummy (); return temp; } void *(*func1[6])(void) = { test1, test2, test3, test4, test5, test6 }; char * NOINLINE call_func1 (int i) { save_ret1[i] = func1[i] (); } static void *ret_addr; void *save_ret2[6]; void test10a (char *); void test11a (char *); void test12a (char *); void NOINLINE test7 (void) { ret_addr = __builtin_return_address (0); return; } void NOINLINE test8 (void) { dummy (); ret_addr = __builtin_return_address (0); return; } void NOINLINE test9 (void) { ret_addr = __builtin_return_address (0); dummy (); return; } void NOINLINE test10 (void) { char * save = (char*) alloca (4); test10a (save); } void NOINLINE test10a (char * p) { ret_addr = __builtin_return_address (1); return; } void NOINLINE test11 (void) { char * save = (char*) alloca (4); test11a (save); } void NOINLINE test11a (char * p) { dummy (); ret_addr = __builtin_return_address (1); return; } void NOINLINE test12 (void) { char * save = (char*) alloca (4); test12a (save); } void NOINLINE test12a (char * p) { ret_addr = __builtin_return_address (1); dummy (); return; } char * dummy (void) { char * save = (char*) alloca (4); return save; } void (*func2[6])(void) = { test7, test8, test9, test10, test11, test12 }; void NOINLINE call_func2 (int i) { func2[i] (); save_ret2[i] = ret_addr; } int main (void) { int i; for (i = 0; i < 6; i++) { call_func1(i); } if (save_ret1[0] != save_ret1[1] || save_ret1[1] != save_ret1[2]) abort (); if (save_ret1[3] != save_ret1[4] || save_ret1[4] != save_ret1[5]) abort (); if (save_ret1[3] && save_ret1[0] != save_ret1[3]) abort (); for (i = 0; i < 6; i++) { call_func2(i); } if (save_ret2[0] != save_ret2[1] || save_ret2[1] != save_ret2[2]) abort (); if (save_ret2[3] != save_ret2[4] || save_ret2[4] != save_ret2[5]) abort (); if (save_ret2[3] && save_ret2[0] != save_ret2[3]) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010123-1.c ================================================ extern void abort (); extern void exit (int); struct s { int value; char *string; }; int main (void) { int i; for (i = 0; i < 4; i++) { struct s *t = & (struct s) { 3, "hey there" }; if (t->value != 3) abort(); t->value = 4; if (t->value != 4) abort(); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010129-1.c ================================================ /* { dg-options "-mtune=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ extern void abort (void); extern void exit (int); long baz1 (void *a) { static long l; return l++; } int baz2 (const char *a) { return 0; } int baz3 (int i) { if (!i) abort (); return 1; } void **bar; int foo (void *a, long b, int c) { int d = 0, e, f = 0, i; char g[256]; void **h; g[0] = '\n'; g[1] = 0; while (baz1 (a) < b) { if (g[0] != ' ' && g[0] != '\t') { f = 1; e = 0; if (!d && baz2 (g) == 0) { if ((c & 0x10) == 0) continue; e = d = 1; } if (!((c & 0x10) && (c & 0x4000) && e) && (c & 2)) continue; if ((c & 0x2000) && baz2 (g) == 0) continue; if ((c & 0x1408) && baz2 (g) == 0) continue; if ((c & 0x200) && baz2 (g) == 0) continue; if (c & 0x80) { for (h = bar, i = 0; h; h = (void **)*h, i++) if (baz3 (i)) break; } f = 0; } } return 0; } int main () { void *n = 0; bar = &n; foo (&n, 1, 0xc811); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010206-1.c ================================================ int foo (void) { int i; #line 1 "20010206-1.c" if (0) i = 1; else i #line 1 "20010206-1.c" = 26; return i; } int main () { if (foo () != 26) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010209-1.c ================================================ /* { dg-require-effective-target alloca } */ int b; int foo (void) { int x[b]; int bar (int t[b]) { int i; for (i = 0; i < b; i++) t[i] = i + (i > 0 ? t[i-1] : 0); return t[b-1]; } return bar (x); } int main () { b = 6; if (foo () != 15) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010221-1.c ================================================ int n = 2; main () { int i, x = 45; for (i = 0; i < n; i++) { if (i != 0) x = ( i > 0 ) ? i : 0; } if (x != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010222-1.c ================================================ int a[2] = { 18, 6 }; int main () { int b = (-3 * a[0] -3 * a[1]) / 12; if (b != -6) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010224-1.c ================================================ extern void abort (void); typedef signed short int16_t; typedef unsigned short uint16_t; int16_t logadd (int16_t *a, int16_t *b); void ba_compute_psd (int16_t start); int16_t masktab[6] = { 1, 2, 3, 4, 5}; int16_t psd[6] = { 50, 40, 30, 20, 10}; int16_t bndpsd[6] = { 1, 2, 3, 4, 5}; void ba_compute_psd (int16_t start) { int i,j,k; int16_t lastbin = 4; j = start; k = masktab[start]; bndpsd[k] = psd[j]; j++; for (i = j; i < lastbin; i++) { bndpsd[k] = logadd(&bndpsd[k], &psd[j]); j++; } } int16_t logadd (int16_t *a, int16_t *b) { return *a + *b; } int main (void) { int i; ba_compute_psd (0); if (bndpsd[1] != 140) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010325-1.c ================================================ /* Origin: Joseph Myers . This tests for inconsistency in whether wide STRING_CSTs use the host or the target endianness. */ extern void exit (int); extern void abort (void); int main (void) { if (L"a" "b"[1] != L'b') abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010329-1.c ================================================ #include int main (void) { void *x = ((void *)((unsigned int)INT_MAX + 2)); void *y = ((void *)((unsigned long)LONG_MAX + 2)); if (x >= ((void *)((unsigned int)INT_MAX + 1)) && x <= ((void *)((unsigned int)INT_MAX + 6)) && y >= ((void *)((unsigned long)LONG_MAX + 1)) && y <= ((void *)((unsigned long)LONG_MAX + 6))) exit (0); else abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010403-1.c ================================================ void b (int *); void c (int, int); void d (int); int e; void a (int x, int y) { int f = x ? e : 0; int z = y; b (&y); c (z, y); d (f); } void b (int *y) { (*y)++; } void c (int x, int y) { if (x == y) abort (); } void d (int x) { } int main (void) { a (0, 0); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010409-1.c ================================================ typedef __SIZE_TYPE__ size_t; extern size_t strlen (const char *s); typedef struct A { int a, b; } A; typedef struct B { struct A **a; int b; } B; A *a; int b = 1, c; B d[1]; void foo (A *x, const char *y, int z) { c = y[4] + z * 25; } A *bar (const char *v, int w, int x, const char *y, int z) { if (w) abort (); exit (0); } void test (const char *x, int *y) { foo (d->a[d->b], "test", 200); d->a[d->b] = bar (x, b ? 0 : 65536, strlen (x), "test", 201); d->a[d->b]->a++; if (y) d->a[d->b]->b = *y; } int main () { d->b = 0; d->a = &a; test ("", 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010422-1.c ================================================ unsigned int foo(unsigned int x) { if (x < 5) x = 4; else x = 8; return x; } int main(void) { if (foo (8) != 8) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010518-1.c ================================================ /* Leaf functions with many arguments. */ int add (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m) { return a+b+c+d+e+f+g+h+i+j+k+l+m; } int main(void) { if (add (1,2,3,4,5,6,7,8,9,10,11,12,13) != 91) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010518-2.c ================================================ /* Mis-aligned packed structures. */ typedef struct { char b0; char b1; char b2; char b3; char b4; char b5; } __attribute__ ((packed)) b_struct; typedef struct { short a; long b; short c; short d; b_struct e; } __attribute__ ((packed)) a_struct; int main(void) { volatile a_struct *a; volatile a_struct b; a = &b; *a = (a_struct){1,2,3,4}; a->e.b4 = 'c'; if (a->a != 1 || a->b != 2 || a->c != 3 || a->d != 4 || a->e.b4 != 'c') abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010520-1.c ================================================ static unsigned int expr_hash_table_size = 1; int main () { int del = 1; unsigned int i = 0; if (i < expr_hash_table_size && del) exit (0); abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010604-1.c ================================================ #include int f (int a, int b, int c, _Bool d, _Bool e, _Bool f, char g) { if (g != 1 || d != true || e != true || f != true) abort (); return a + b + c; } int main (void) { if (f (1, 2, -3, true, true, true, '\001')) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010605-1.c ================================================ int main () { int v = 42; inline int fff (int x) { return x*10; } return (fff (v) != 420); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010605-2.c ================================================ void foo (), bar (), baz (); int main () { __complex__ double x; __complex__ float y; __complex__ long double z; __real__ x = 1.0; __imag__ x = 2.0; foo (x); __real__ y = 3.0f; __imag__ y = 4.0f; bar (y); __real__ z = 5.0L; __imag__ z = 6.0L; baz (z); exit (0); } void foo (__complex__ double x) { if (__real__ x != 1.0 || __imag__ x != 2.0) abort (); } void bar (__complex__ float x) { if (__real__ x != 3.0f || __imag__ x != 4.0f) abort (); } void baz (__complex__ long double x) { if (__real__ x != 5.0L || __imag__ x != 6.0L) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010711-1.c ================================================ void foo (int *a) {} int main () { int a; if (&a == 0) abort (); else { foo (&a); exit (0); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010717-1.c ================================================ extern void abort (void); int main () { int i, j; unsigned long u, r1, r2; i = -16; j = 1; u = i + j; /* no sign extension upon shift */ r1 = u >> 1; /* sign extension upon shift, but there shouldn't be */ r2 = ((unsigned long) (i + j)) >> 1; if (r1 != r2) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010723-1.c ================================================ int test () { int biv,giv; for (biv = 0, giv = 0; giv != 8; biv++) giv = biv*8; return giv; } main() { if (test () != 8) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010904-1.c ================================================ typedef struct x { int a; int b; } __attribute__((aligned(32))) X; typedef struct y { X x[32]; int c; } Y; Y y[2]; int main(void) { if (((char *)&y[1] - (char *)&y[0]) & 31) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010904-2.c ================================================ typedef struct x { int a; int b; } __attribute__((aligned(32))) X; typedef struct y { X x; X y[31]; int c; } Y; Y y[2]; int main(void) { if (((char *)&y[1] - (char *)&y[0]) & 31) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010910-1.c ================================================ /* Test case contributed by Ingo Rohloff . Code distilled from Linux kernel. */ /* Compile this program with a gcc-2.95.2 using "gcc -O2" and run it. The result will be that rx_ring[1].next == 0 (it should be == 14) and ep.skbuff[4] == 5 (it should be 0) */ extern void abort(void); struct epic_rx_desc { unsigned int next; }; struct epic_private { struct epic_rx_desc *rx_ring; unsigned int rx_skbuff[5]; }; static void epic_init_ring(struct epic_private *ep) { int i; for (i = 0; i < 5; i++) { ep->rx_ring[i].next = 10 + (i+1)*2; ep->rx_skbuff[i] = 0; } ep->rx_ring[i-1].next = 10; } static int check_rx_ring[5] = { 12,14,16,18,10 }; int main(void) { struct epic_private ep; struct epic_rx_desc rx_ring[5]; int i; for (i=0;i<5;i++) { rx_ring[i].next=0; ep.rx_skbuff[i]=5; } ep.rx_ring=rx_ring; epic_init_ring(&ep); for (i=0;i<5;i++) { if ( rx_ring[i].next != check_rx_ring[i] ) abort(); if ( ep.rx_skbuff[i] != 0 ) abort(); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010915-1.c ================================================ /* Bug in reorg.c, deleting the "++" in the last loop in main. Origin: . */ extern void f (void); extern int x (int, char **); extern int r (const char *); extern char *s (char *, char **); extern char *m (char *); char *u; char *h; int check = 0; int o = 0; int main (int argc, char **argv) { char *args[] = {"a", "b", "c", "d", "e"}; if (x (5, args) != 0 || check != 2 || o != 5) abort (); exit (0); } int x (int argc, char **argv) { int opt = 0; char *g = 0; char *p = 0; if (argc > o && argc > 2 && argv[o]) { g = s (argv[o], &p); if (g) { *g++ = '\0'; h = s (g, &p); if (g == p) h = m (g); } u = s (argv[o], &p); if (argv[o] == p) u = m (argv[o]); } else abort (); while (++o < argc) if (r (argv[o]) == 0) return 1; return 0; } char *m (char *x) { abort (); } char *s (char *v, char **pp) { if (strcmp (v, "a") != 0 || check++ > 1) abort (); *pp = v+1; return 0; } int r (const char *f) { static char c[2] = "b"; static int cnt = 0; if (*f != *c || f[1] != c[1] || cnt > 3) abort (); c[0]++; cnt++; return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010924-1.c ================================================ /* Verify that flexible arrays can be initialized from STRING_CST constructors. */ /* Baselines. */ struct { char a1c; char *a1p; } a1 = { '4', "62" }; struct { char a2c; char a2p[2]; } a2 = { 'v', "cq" }; /* The tests. */ struct { char a3c; char a3p[]; } a3 = { 'o', "wx" }; struct { char a4c; char a4p[]; } a4 = { '9', { 'e', 'b' } }; main() { if (a1.a1c != '4') abort(); if (a1.a1p[0] != '6') abort(); if (a1.a1p[1] != '2') abort(); if (a1.a1p[2] != '\0') abort(); if (a2.a2c != 'v') abort(); if (a2.a2p[0] != 'c') abort(); if (a2.a2p[1] != 'q') abort(); if (a3.a3c != 'o') abort(); if (a3.a3p[0] != 'w') abort(); if (a3.a3p[1] != 'x') abort(); if (a4.a4c != '9') abort(); if (a4.a4p[0] != 'e') abort(); if (a4.a4p[1] != 'b') abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20010925-1.c ================================================ extern void exit(int); extern void abort (void); extern void * memcpy (void *, const void *, __SIZE_TYPE__); int foo (void *, void *, unsigned int c); int src[10]; int dst[10]; int main() { if (foo (dst, src, 10) != 0) abort(); exit(0); } int foo (void *a, void *b, unsigned int c) { if (c == 0) return 1; memcpy (a, b, c); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011008-3.c ================================================ extern void exit (int); extern void abort (void); typedef unsigned int u_int32_t; typedef unsigned char u_int8_t; typedef int int32_t; typedef enum { TXNLIST_DELETE, TXNLIST_LSN, TXNLIST_TXNID, TXNLIST_PGNO } db_txnlist_type; struct __db_lsn; typedef struct __db_lsn DB_LSN; struct __db_lsn { u_int32_t file; u_int32_t offset; }; struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST; struct __db_txnlist { db_txnlist_type type; struct { struct __db_txnlist *le_next; struct __db_txnlist **le_prev; } links; union { struct { u_int32_t txnid; int32_t generation; int32_t aborted; } t; struct { u_int32_t flags; int32_t fileid; u_int32_t count; char *fname; } d; struct { int32_t ntxns; int32_t maxn; DB_LSN *lsn_array; } l; struct { int32_t nentries; int32_t maxentry; char *fname; int32_t fileid; void *pgno_array; u_int8_t uid[20]; } p; } u; }; int log_compare (const DB_LSN *a, const DB_LSN *b) { return 1; } int __db_txnlist_lsnadd(int val, DB_TXNLIST *elp, DB_LSN *lsnp, u_int32_t flags) { int i; for (i = 0; i < (!(flags & (0x1)) ? 1 : elp->u.l.ntxns); i++) { int __j; DB_LSN __tmp; val++; for (__j = 0; __j < elp->u.l.ntxns - 1; __j++) if (log_compare(&elp->u.l.lsn_array[__j], &elp->u.l.lsn_array[__j + 1]) < 0) { __tmp = elp->u.l.lsn_array[__j]; elp->u.l.lsn_array[__j] = elp->u.l.lsn_array[__j + 1]; elp->u.l.lsn_array[__j + 1] = __tmp; } } *lsnp = elp->u.l.lsn_array[0]; return val; } #if defined (STACK_SIZE) && STACK_SIZE < 12350 #define VLEN (STACK_SIZE/10) #else #define VLEN 1235 #endif int main (void) { DB_TXNLIST el; DB_LSN lsn, lsn_a[VLEN]; el.u.l.ntxns = VLEN-1; el.u.l.lsn_array = lsn_a; if (__db_txnlist_lsnadd (0, &el, &lsn, 0) != 1) abort (); if (__db_txnlist_lsnadd (0, &el, &lsn, 1) != VLEN-1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011019-1.c ================================================ extern void exit (int); extern void abort (void); struct { int a; int b[5]; } x; int *y; int foo (void) { return y - x.b; } int main (void) { y = x.b; if (foo ()) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011024-1.c ================================================ /* Test whether store motion recognizes pure functions as potentially reading any memory. */ typedef __SIZE_TYPE__ size_t; extern void *memcpy (void *dest, const void *src, size_t n); extern size_t strlen (const char *s); extern int strcmp (const char *s1, const char *s2) __attribute__((pure)); char buf[50]; static void foo (void) { if (memcpy (buf, "abc", 4) != buf) abort (); if (strcmp (buf, "abc")) abort (); memcpy (buf, "abcdefgh", strlen ("abcdefgh") + 1); } int main (void) { foo (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011109-1.c ================================================ void fail1(void) { abort (); } void fail2(void) { abort (); } void fail3(void) { abort (); } void fail4(void) { abort (); } void foo(long x) { switch (x) { case -6: fail1 (); break; case 0: fail2 (); break; case 1: case 2: break; case 3: case 4: case 5: fail3 (); break; default: fail4 (); break; } switch (x) { case -3: fail1 (); break; case 0: case 4: fail2 (); break; case 1: case 3: break; case 2: case 8: abort (); break; default: fail4 (); break; } } int main(void) { foo (1); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011109-2.c ================================================ int main(void) { char *c1 = "foo"; char *c2 = "foo"; int i; for (i = 0; i < 3; i++) if (c1[i] != c2[i]) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011113-1.c ================================================ typedef __SIZE_TYPE__ size_t; extern void *memcpy (void *__restrict, const void *__restrict, size_t); extern void abort (void); extern void exit (int); typedef struct t { unsigned a : 16; unsigned b : 8; unsigned c : 8; long d[4]; } *T; typedef struct { long r[3]; } U; T bar (U, unsigned int); T foo (T x) { U d, u; memcpy (&u, &x->d[1], sizeof u); d = u; return bar (d, x->b); } T baz (T x) { U d, u; d.r[0] = 0x123456789; d.r[1] = 0xfedcba987; d.r[2] = 0xabcdef123; memcpy (&u, &x->d[1], sizeof u); d = u; return bar (d, x->b); } T bar (U d, unsigned int m) { if (d.r[0] != 21 || d.r[1] != 22 || d.r[2] != 23) abort (); return 0; } struct t t = { 26, 0, 0, { 0, 21, 22, 23 }}; int main (void) { baz (&t); foo (&t); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011114-1.c ================================================ char foo(char bar[]) { return bar[1]; } extern char foo(char *); int main(void) { if (foo("xy") != 'y') abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011115-1.c ================================================ extern void exit (int); static inline int foo (void) { #ifdef __OPTIMIZE__ extern int undefined_reference; return undefined_reference; #else return 0; #endif } static inline int bar (void) { if (foo == foo) return 1; else return foo (); } int main (void) { exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011121-1.c ================================================ struct s { int i[18]; char f; char b[2]; }; struct s s1; int main() { struct s s2; s2.b[0] = 100; __builtin_memcpy(&s2, &s1, ((unsigned int) &((struct s *)0)->b)); if (s2.b[0] != 100) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011126-1.c ================================================ /* Produced a overflow in ifcvt.c, causing S to contain 0xffffffff7fffffff. */ int a = 1; int main () { long long s; s = a; if (s < 0) s = -2147483648LL; else s = 2147483647LL; if (s < 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011126-2.c ================================================ /* Problem originally visible on ia64. There is a partial redundancy of "in + 1" that makes GCSE want to transform the final while loop to p = in + 1; tmp = p; ... goto start; top: tmp = tmp + 1; start: in = tmp; if (in < p) goto top; We miscalculate the number of loop iterations as (p - tmp) = 0 instead of (p - in) = 1, which results in overflow in the doloop optimization. */ static const char * test (const char *in, char *out) { while (1) { if (*in == 'a') { const char *p = in + 1; while (*p == 'x') ++p; if (*p == 'b') return p; while (in < p) *out++ = *in++; } } } int main () { char out[4]; test ("aab", out); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011128-1.c ================================================ main() { char blah[33] = "01234567890123456789"; exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011217-1.c ================================================ int main() { double x = 1.0; double y = 2.0; if ((y > x--) != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011219-1.c ================================================ /* This testcase failed on IA-32 at -O and above, because combine attached a REG_LABEL note to jump instruction already using JUMP_LABEL. */ extern void abort (void); extern void exit (int); enum X { A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q }; void bar (const char *x, int y, const char *z) { } long foo (enum X x, const void *y) { long a; switch (x) { case K: a = *(long *)y; break; case L: a = *(long *)y; break; case M: a = *(long *)y; break; case N: a = *(long *)y; break; case O: a = *(long *)y; break; default: bar ("foo", 1, "bar"); } return a; } int main () { long i = 24; if (foo (N, &i) != 24) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20011223-1.c ================================================ /* Origin: Joseph Myers . */ /* Case labels in a switch statement are converted to the promoted type of the controlling expression, not an unpromoted version. Reported as PR c/2454 by Andreas Krakowczyk . */ extern void exit (int); extern void abort (void); static int i; int main (void) { i = -1; switch ((signed char) i) { case 255: abort (); default: exit (0); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020103-1.c ================================================ /* On h8300 port, the following used to be broken with -mh or -ms. */ extern void abort (void); extern void exit (int); unsigned long foo (unsigned long a) { return a ^ 0x0000ffff; } unsigned long bar (unsigned long a) { return a ^ 0xffff0000; } int main () { if (foo (0) != 0x0000ffff) abort (); if (bar (0) != 0xffff0000) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020107-1.c ================================================ /* This testcase failed because - 1 - buf was simplified into ~buf and when later expanding it back into - buf + -1, -1 got lost. */ /* { dg-options "-fgnu89-inline" } */ extern void abort (void); extern void exit (int); static void bar (int x) { if (!x) abort (); } char buf[10]; inline char * foo (char *tmp) { asm ("" : "=r" (tmp) : "0" (tmp)); return tmp + 2; } int main (void) { bar ((foo (buf) - 1 - buf) == 1); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020108-1.c ================================================ /* This file tests shifts in various integral modes. */ #include #define CAT(A, B) A ## B #define REPEAT_8 \ REPEAT_FN ( 0) \ REPEAT_FN ( 1) \ REPEAT_FN ( 2) \ REPEAT_FN ( 3) \ REPEAT_FN ( 4) \ REPEAT_FN ( 5) \ REPEAT_FN ( 6) \ REPEAT_FN ( 7) #define REPEAT_16 \ REPEAT_8 \ REPEAT_FN ( 8) \ REPEAT_FN ( 9) \ REPEAT_FN (10) \ REPEAT_FN (11) \ REPEAT_FN (12) \ REPEAT_FN (13) \ REPEAT_FN (14) \ REPEAT_FN (15) #define REPEAT_32 \ REPEAT_16 \ REPEAT_FN (16) \ REPEAT_FN (17) \ REPEAT_FN (18) \ REPEAT_FN (19) \ REPEAT_FN (20) \ REPEAT_FN (21) \ REPEAT_FN (22) \ REPEAT_FN (23) \ REPEAT_FN (24) \ REPEAT_FN (25) \ REPEAT_FN (26) \ REPEAT_FN (27) \ REPEAT_FN (28) \ REPEAT_FN (29) \ REPEAT_FN (30) \ REPEAT_FN (31) /* Define 8-bit shifts. */ #if CHAR_BIT == 8 typedef unsigned int u8 __attribute__((mode(QI))); typedef signed int s8 __attribute__((mode(QI))); #define REPEAT_FN(COUNT) \ u8 CAT (ashift_qi_, COUNT) (u8 n) { return n << COUNT; } REPEAT_8 #undef REPEAT_FN #define REPEAT_FN(COUNT) \ u8 CAT (lshiftrt_qi_, COUNT) (u8 n) { return n >> COUNT; } REPEAT_8 #undef REPEAT_FN #define REPEAT_FN(COUNT) \ s8 CAT (ashiftrt_qi_, COUNT) (s8 n) { return n >> COUNT; } REPEAT_8 #undef REPEAT_FN #endif /* CHAR_BIT == 8 */ /* Define 16-bit shifts. */ #if CHAR_BIT == 8 || CHAR_BIT == 16 #if CHAR_BIT == 8 typedef unsigned int u16 __attribute__((mode(HI))); typedef signed int s16 __attribute__((mode(HI))); #elif CHAR_BIT == 16 typedef unsigned int u16 __attribute__((mode(QI))); typedef signed int s16 __attribute__((mode(QI))); #endif #define REPEAT_FN(COUNT) \ u16 CAT (ashift_hi_, COUNT) (u16 n) { return n << COUNT; } REPEAT_16 #undef REPEAT_FN #define REPEAT_FN(COUNT) \ u16 CAT (lshiftrt_hi_, COUNT) (u16 n) { return n >> COUNT; } REPEAT_16 #undef REPEAT_FN #define REPEAT_FN(COUNT) \ s16 CAT (ashiftrt_hi_, COUNT) (s16 n) { return n >> COUNT; } REPEAT_16 #undef REPEAT_FN #endif /* CHAR_BIT == 8 || CHAR_BIT == 16 */ /* Define 32-bit shifts. */ #if CHAR_BIT == 8 || CHAR_BIT == 16 || CHAR_BIT == 32 #if CHAR_BIT == 8 typedef unsigned int u32 __attribute__((mode(SI))); typedef signed int s32 __attribute__((mode(SI))); #elif CHAR_BIT == 16 typedef unsigned int u32 __attribute__((mode(HI))); typedef signed int s32 __attribute__((mode(HI))); #elif CHAR_BIT == 32 typedef unsigned int u32 __attribute__((mode(QI))); typedef signed int s32 __attribute__((mode(QI))); #endif #define REPEAT_FN(COUNT) \ u32 CAT (ashift_si_, COUNT) (u32 n) { return n << COUNT; } REPEAT_32 #undef REPEAT_FN #define REPEAT_FN(COUNT) \ u32 CAT (lshiftrt_si_, COUNT) (u32 n) { return n >> COUNT; } REPEAT_32 #undef REPEAT_FN #define REPEAT_FN(COUNT) \ s32 CAT (ashiftrt_si_, COUNT) (s32 n) { return n >> COUNT; } REPEAT_32 #undef REPEAT_FN #endif /* CHAR_BIT == 8 || CHAR_BIT == 16 || CHAR_BIT == 32 */ extern void abort (void); extern void exit (int); int main () { /* Test 8-bit shifts. */ #if CHAR_BIT == 8 # define REPEAT_FN(COUNT) \ if (CAT (ashift_qi_, COUNT) (0xff) != (u8) ((u8)0xff << COUNT)) abort (); REPEAT_8; # undef REPEAT_FN # define REPEAT_FN(COUNT) \ if (CAT (lshiftrt_qi_, COUNT) (0xff) != (u8) ((u8)0xff >> COUNT)) abort (); REPEAT_8; # undef REPEAT_FN # define REPEAT_FN(COUNT) \ if (CAT (ashiftrt_qi_, COUNT) (-1) != -1) abort (); REPEAT_8; # undef REPEAT_FN # define REPEAT_FN(COUNT) \ if (CAT (ashiftrt_qi_, COUNT) (0) != 0) abort (); REPEAT_8; # undef REPEAT_FN #endif /* CHAR_BIT == 8 */ /* Test 16-bit shifts. */ #if CHAR_BIT == 8 || CHAR_BIT == 16 # define REPEAT_FN(COUNT) \ if (CAT (ashift_hi_, COUNT) (0xffff) \ != (u16) ((u16) 0xffff << COUNT)) abort (); REPEAT_16; # undef REPEAT_FN # define REPEAT_FN(COUNT) \ if (CAT (lshiftrt_hi_, COUNT) (0xffff) \ != (u16) ((u16) 0xffff >> COUNT)) abort (); REPEAT_16; # undef REPEAT_FN # define REPEAT_FN(COUNT) \ if (CAT (ashiftrt_hi_, COUNT) (-1) != -1) abort (); REPEAT_16; # undef REPEAT_FN # define REPEAT_FN(COUNT) \ if (CAT (ashiftrt_hi_, COUNT) (0) != 0) abort (); REPEAT_16; # undef REPEAT_FN #endif /* CHAR_BIT == 8 || CHAR_BIT == 16 */ /* Test 32-bit shifts. */ #if CHAR_BIT == 8 || CHAR_BIT == 16 || CHAR_BIT == 32 # define REPEAT_FN(COUNT) \ if (CAT (ashift_si_, COUNT) (0xffffffff) \ != (u32) ((u32) 0xffffffff << COUNT)) abort (); REPEAT_32; # undef REPEAT_FN # define REPEAT_FN(COUNT) \ if (CAT (lshiftrt_si_, COUNT) (0xffffffff) \ != (u32) ((u32) 0xffffffff >> COUNT)) abort (); REPEAT_32; # undef REPEAT_FN # define REPEAT_FN(COUNT) \ if (CAT (ashiftrt_si_, COUNT) (-1) != -1) abort (); REPEAT_32; # undef REPEAT_FN # define REPEAT_FN(COUNT) \ if (CAT (ashiftrt_si_, COUNT) (0) != 0) abort (); REPEAT_32; # undef REPEAT_FN #endif /* CHAR_BIT == 8 || CHAR_BIT == 16 || CHAR_BIT == 32 */ exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020118-1.c ================================================ /* This tests an insn length of sign extension on h8300 port. */ extern void exit (int); volatile signed char *q; volatile signed int n; void foo (void) { signed char *p; for (;;) { p = (signed char *) q; n = p[2]; p = (signed char *) q; n = p[2]; p = (signed char *) q; n = p[2]; p = (signed char *) q; n = p[2]; p = (signed char *) q; n = p[2]; p = (signed char *) q; n = p[2]; p = (signed char *) q; n = p[2]; p = (signed char *) q; n = p[2]; p = (signed char *) q; n = p[2]; p = (signed char *) q; n = p[2]; p = (signed char *) q; n = p[2]; } } int main () { exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020127-1.c ================================================ /* This used to fail on h8300. */ extern void abort (void); extern void exit (int); unsigned long foo (unsigned long n) { return (~n >> 3) & 1; } int main () { if (foo (1 << 3) != 0) abort (); if (foo (0) != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020129-1.c ================================================ /* This testcase failed at -O2 on IA-64, because scheduling did not take into account conditional execution when using cselib for alias analysis. */ struct D { int d1; struct D *d2; }; struct C { struct D c1; long c2, c3, c4, c5, c6; }; struct A { struct A *a1; struct C *a2; }; struct B { struct C b1; struct A *b2; }; extern void abort (void); extern void exit (int); void foo (struct B *x, struct B *y) { if (x->b2 == 0) { struct A *a; x->b2 = a = y->b2; y->b2 = 0; for (; a; a = a->a1) a->a2 = &x->b1; } if (y->b2 != 0) abort (); if (x->b1.c3 == -1) { x->b1.c3 = y->b1.c3; x->b1.c4 = y->b1.c4; y->b1.c3 = -1; y->b1.c4 = 0; } if (y->b1.c3 != -1) abort (); } struct B x, y; int main () { y.b1.c1.d1 = 6; y.b1.c3 = 145; y.b1.c4 = 2448; x.b1.c3 = -1; foo (&x, &y); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020201-1.c ================================================ /* Test whether division by constant works properly. */ extern void abort (void); extern void exit (int); unsigned char cx = 7; unsigned short sx = 14; unsigned int ix = 21; unsigned long lx = 28; unsigned long long Lx = 35; int main () { unsigned char cy; unsigned short sy; unsigned int iy; unsigned long ly; unsigned long long Ly; cy = cx / 6; if (cy != 1) abort (); cy = cx % 6; if (cy != 1) abort (); sy = sx / 6; if (sy != 2) abort (); sy = sx % 6; if (sy != 2) abort (); iy = ix / 6; if (iy != 3) abort (); iy = ix % 6; if (iy != 3) abort (); ly = lx / 6; if (ly != 4) abort (); ly = lx % 6; if (ly != 4) abort (); Ly = Lx / 6; if (Ly != 5) abort (); Ly = Lx % 6; if (Ly != 5) abort (); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020206-1.c ================================================ struct A { unsigned int a, b, c; }; extern void abort (void); extern void exit (int); struct A bar (void) { return (struct A) { 176, 52, 31 }; } void baz (struct A *a) { if (a->a != 176 || a->b != 52 || a->c != 31) abort (); } int main () { struct A d; d = ({ ({ bar (); }); }); baz (&d); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020206-2.c ================================================ /* Origin: PR c/5420 from David Mosberger . This testcase was miscompiled when tail call optimizing, because a compound literal initialization was emitted only in the tail call insn chain, not in the normal call insn chain. */ typedef struct { unsigned short a; } A; extern void abort (void); extern void exit (int); void foo (unsigned int x) { if (x != 0x800 && x != 0x810) abort (); } int main (int argc, char **argv) { int i; for (i = 0; i < 2; ++i) foo (((A) { ((!(i >> 4) ? 8 : 64 + (i >> 4)) << 8) + (i << 4) } ).a); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020213-1.c ================================================ /* PR c/5681 This testcase failed on IA-32 at -O0, because safe_from_p incorrectly assumed it is safe to first write into a.a2 b-1 and then read the original value from it. */ int bar (float); struct A { float a1; int a2; } a; int b; void foo (void) { a.a2 = bar (a.a1); a.a2 = a.a2 < b - 1 ? a.a2 : b - 1; if (a.a2 >= b - 1) abort (); } int bar (float x) { return 2241; } int main() { a.a1 = 1.0f; b = 3384; foo (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020215-1.c ================================================ /* Test failed on an architecture that: - had 16-bit registers, - passed 64-bit structures in registers, - only allowed SImode values in even numbered registers. Before reload, s.i2 in foo() was represented as: (subreg:SI (reg:DI 0) 2) find_dummy_reload would return (reg:SI 1) for the subreg reload, despite that not being a valid register. */ struct s { short i1; long i2; short i3; }; struct s foo (struct s s) { s.i2++; return s; } int main () { struct s s = foo ((struct s) { 1000, 2000L, 3000 }); if (s.i1 != 1000 || s.i2 != 2001L || s.i3 != 3000) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020216-1.c ================================================ /* PR c/3444 This used to fail because bitwise xor was improperly computed in char type and sign extended to int type. */ extern void abort (); extern void exit (int); signed char c = (signed char) 0xffffffff; int foo (void) { return (unsigned short) c ^ (signed char) 0x99999999; } int main (void) { if ((unsigned char) -1 != 0xff || sizeof (short) != 2 || sizeof (int) != 4) exit (0); if (foo () != (int) 0xffff0066) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020219-1.c ================================================ /* PR c/4308 This testcase failed because 0x8000000000000000 >> 0 was incorrectly folded into 0xffffffff00000000. */ extern void abort (void); extern void exit (int); long long foo (void) { long long C = 1ULL << 63, X; int Y = 32; X = C >> (Y & 31); return X; } int main (void) { if (foo () != 1ULL << 63) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020225-1.c ================================================ /* This testcase failed at -O2 on powerpc64 due to andsi3 writing nonzero bits to the high 32 bits of a 64 bit register. */ extern void abort (void); extern void exit (int); unsigned long foo (unsigned long base, unsigned int val) { return base + (val & 0x80000001); } int main (void) { if (foo (0L, 0x0ffffff0) != 0L) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020225-2.c ================================================ static int test(int x) { union { int i; double d; } a; a.d = 0; a.i = 1; return x >> a.i; } int main(void) { if (test (5) != 2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020226-1.c ================================================ /* This tests the rotate patterns that some machines support. */ #include #ifndef CHAR_BIT #define CHAR_BIT 8 #endif #define ROR(a,b) (((a) >> (b)) | ((a) << ((sizeof (a) * CHAR_BIT) - (b)))) #define ROL(a,b) (((a) << (b)) | ((a) >> ((sizeof (a) * CHAR_BIT) - (b)))) #define CHAR_VALUE ((unsigned char)0x1234U) #define SHORT_VALUE ((unsigned short)0x1234U) #define INT_VALUE 0x1234U #define LONG_VALUE 0x12345678LU #define LL_VALUE 0x12345678abcdef0LLU #define SHIFT1 4 #define SHIFT2 ((sizeof (long long) * CHAR_BIT) - SHIFT1) unsigned char uc = CHAR_VALUE; unsigned short us = SHORT_VALUE; unsigned int ui = INT_VALUE; unsigned long ul = LONG_VALUE; unsigned long long ull = LL_VALUE; int shift1 = SHIFT1; int shift2 = SHIFT2; main () { if (ROR (uc, shift1) != ROR (CHAR_VALUE, SHIFT1)) abort (); if (ROR (uc, SHIFT1) != ROR (CHAR_VALUE, SHIFT1)) abort (); if (ROR (us, shift1) != ROR (SHORT_VALUE, SHIFT1)) abort (); if (ROR (us, SHIFT1) != ROR (SHORT_VALUE, SHIFT1)) abort (); if (ROR (ui, shift1) != ROR (INT_VALUE, SHIFT1)) abort (); if (ROR (ui, SHIFT1) != ROR (INT_VALUE, SHIFT1)) abort (); if (ROR (ul, shift1) != ROR (LONG_VALUE, SHIFT1)) abort (); if (ROR (ul, SHIFT1) != ROR (LONG_VALUE, SHIFT1)) abort (); if (ROR (ull, shift1) != ROR (LL_VALUE, SHIFT1)) abort (); if (ROR (ull, SHIFT1) != ROR (LL_VALUE, SHIFT1)) abort (); if (ROR (ull, shift2) != ROR (LL_VALUE, SHIFT2)) abort (); if (ROR (ull, SHIFT2) != ROR (LL_VALUE, SHIFT2)) abort (); if (ROL (uc, shift1) != ROL (CHAR_VALUE, SHIFT1)) abort (); if (ROL (uc, SHIFT1) != ROL (CHAR_VALUE, SHIFT1)) abort (); if (ROL (us, shift1) != ROL (SHORT_VALUE, SHIFT1)) abort (); if (ROL (us, SHIFT1) != ROL (SHORT_VALUE, SHIFT1)) abort (); if (ROL (ui, shift1) != ROL (INT_VALUE, SHIFT1)) abort (); if (ROL (ui, SHIFT1) != ROL (INT_VALUE, SHIFT1)) abort (); if (ROL (ul, shift1) != ROL (LONG_VALUE, SHIFT1)) abort (); if (ROL (ul, SHIFT1) != ROL (LONG_VALUE, SHIFT1)) abort (); if (ROL (ull, shift1) != ROL (LL_VALUE, SHIFT1)) abort (); if (ROL (ull, SHIFT1) != ROL (LL_VALUE, SHIFT1)) abort (); if (ROL (ull, shift2) != ROL (LL_VALUE, SHIFT2)) abort (); if (ROL (ull, SHIFT2) != ROL (LL_VALUE, SHIFT2)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020227-1.c ================================================ /* This testcase failed on mmix-knuth-mmixware. Problem was with storing to an unaligned mem:SC, gcc tried doing it by parts from a (concat:SC (reg:SF 293) (reg:SF 294)). */ typedef __complex__ float cf; struct x { char c; cf f; } __attribute__ ((__packed__)); extern void f2 (struct x*); extern void f1 (void); int main (void) { f1 (); exit (0); } void f1 (void) { struct x s; s.f = 1; s.c = 42; f2 (&s); } void f2 (struct x *y) { if (y->f != 1 || y->c != 42) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020307-1.c ================================================ #define MASK(N) ((1UL << (N)) - 1) #define BITS(N) ((1UL << ((N) - 1)) + 2) #define FUNC(N) void f##N(long j) { if ((j & MASK(N)) >= BITS(N)) abort();} FUNC(3) FUNC(4) FUNC(5) FUNC(6) FUNC(7) FUNC(8) FUNC(9) FUNC(10) FUNC(11) FUNC(12) FUNC(13) FUNC(14) FUNC(15) FUNC(16) FUNC(17) FUNC(18) FUNC(19) FUNC(20) FUNC(21) FUNC(22) FUNC(23) FUNC(24) FUNC(25) FUNC(26) FUNC(27) FUNC(28) FUNC(29) FUNC(30) FUNC(31) int main () { f3(0); f4(0); f5(0); f6(0); f7(0); f8(0); f9(0); f10(0); f11(0); f12(0); f13(0); f14(0); f15(0); f16(0); f17(0); f18(0); f19(0); f20(0); f21(0); f22(0); f23(0); f24(0); f25(0); f26(0); f27(0); f28(0); f29(0); f30(0); f31(0); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020314-1.c ================================================ /* { dg-require-effective-target alloca } */ void f(void * a, double y) { } double g (double a, double b, double c, double d) { double x, y, z; void *p; x = a + b; y = c * d; p = alloca (16); f(p, y); z = x * y * a; return z + b; } main () { double a, b, c, d; a = 1.0; b = 0.0; c = 10.0; d = 0.0; if (g (a, b, c, d) != 0.0) abort (); if (a != 1.0 || b != 0.0 || c != 10.0 || d != 0.0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020320-1.c ================================================ /* PR c/5354 */ /* Verify that GCC preserves relevant stack slots. */ extern void abort(void); extern void exit(int); struct large { int x, y[9]; }; int main() { int fixed; fixed = ({ int temp1 = 2; temp1; }) - ({ int temp2 = 1; temp2; }); if (fixed != 1) abort(); fixed = ({ struct large temp3; temp3.x = 2; temp3; }).x - ({ struct large temp4; temp4.x = 1; temp4; }).x; if (fixed != 1) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020321-1.c ================================================ /* PR 3177 */ /* Produced a SIGILL on ia64 with sibcall from F to G. We hadn't widened the register window to allow for the fourth outgoing argument as an "in" register. */ float g (void *a, void *b, int e, int c, float d) { return d; } float f (void *a, void *b, int c, float d) { return g (a, b, 0, c, d); } int main () { f (0, 0, 1, 1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020328-1.c ================================================ int b = 0; func () { } void testit(int x) { if (x != 20) abort (); } int main() { int a = 0; if (b) func(); /* simplify_and_const_int would incorrectly omit the mask in the line below. */ testit ((a + 23) & 0xfffffffc); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020402-1.c ================================================ /* derived from PR c/2100 */ extern void abort (); extern void exit (int); #define SMALL_N 2 #define NUM_ELEM 4 int main(void) { int listElem[NUM_ELEM]={30,2,10,5}; int listSmall[SMALL_N]; int i, j; int posGreatest=-1, greatest=-1; for (i=0; i greatest) { posGreatest = i; greatest = listElem[i]; } } for (i=SMALL_N; i greatest) { posGreatest = j; greatest = listSmall[j]; } } } if (listSmall[0] != 5 || listSmall[1] != 2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020402-2.c ================================================ /* PR 3967 local-alloc screwed up consideration of high+lo_sum and created reg_equivs that it shouldn't have, resulting in lo_sum with uninitialized data, resulting in segv. The test has to remain relatively large, since register spilling is required to twig the bug. */ unsigned long *Local1; unsigned long *Local2; unsigned long *Local3; unsigned long *RDbf1; unsigned long *RDbf2; unsigned long *RDbf3; unsigned long *IntVc1; unsigned long *IntVc2; unsigned long *IntCode3; unsigned long *IntCode4; unsigned long *IntCode5; unsigned long *IntCode6; unsigned long *Lom1; unsigned long *Lom2; unsigned long *Lom3; unsigned long *Lom4; unsigned long *Lom5; unsigned long *Lom6; unsigned long *Lom7; unsigned long *Lom8; unsigned long *Lom9; unsigned long *Lom10; unsigned long *RDbf11; unsigned long *RDbf12; typedef struct { long a1; unsigned long n1; unsigned long local1; unsigned long local2; unsigned long local3; unsigned long rdbf1; unsigned long rdbf2; unsigned long milli; unsigned long frames1; unsigned long frames2; unsigned long nonShared; long newPrivate; long freeLimit; unsigned long cache1; unsigned long cache2; unsigned long cache3; unsigned long cache4; unsigned long cache5; unsigned long time6; unsigned long frames7; unsigned long page8; unsigned long ot9; unsigned long data10; unsigned long bm11; unsigned long misc12; } ShrPcCommonStatSType; typedef struct { unsigned long sharedAttached; unsigned long totalAttached; long avgPercentShared; unsigned long numberOfFreeFrames; unsigned long localDirtyPageCount; unsigned long globalDirtyPageCount; long wakeupInterval; unsigned long numActiveProcesses; unsigned long numRecentActiveProcesses; unsigned long gemDirtyPageKinds[10]; unsigned long stoneDirtyPageKinds[10]; unsigned long gemsInCacheCount; long targetFreeFrameCount; } ShrPcMonStatSType; typedef struct { unsigned long c1; unsigned long c2; unsigned long c3; unsigned long c4; unsigned long c5; unsigned long c6; unsigned long c7; unsigned long c8; unsigned long c9; unsigned long c10; unsigned long c11; unsigned long c12; unsigned long a1; unsigned long a2; unsigned long a3; unsigned long a4; unsigned long a5; unsigned long a6; unsigned long a7; unsigned long a8; unsigned long a9; unsigned long a10; unsigned long a11; unsigned long a12; unsigned long a13; unsigned long a14; unsigned long a15; unsigned long a16; unsigned long a17; unsigned long a18; unsigned long a19; unsigned long sessionStats[40]; } ShrPcGemStatSType; union ShrPcStatUnion { ShrPcMonStatSType monitor; ShrPcGemStatSType gem; }; typedef struct { int processId; int sessionId; ShrPcCommonStatSType cmn; union ShrPcStatUnion u; } ShrPcStatsSType; typedef struct { unsigned long *p1; unsigned long *p2; unsigned long *p3; unsigned long *p4; unsigned long *p5; unsigned long *p6; unsigned long *p7; unsigned long *p8; unsigned long *p9; unsigned long *p10; unsigned long *p11; } WorkEntrySType; WorkEntrySType Workspace; static void setStatPointers (ShrPcStatsSType * statsPtr, long sessionId) { statsPtr->sessionId = sessionId; statsPtr->cmn.a1 = 0; statsPtr->cmn.n1 = 5; Local1 = &statsPtr->cmn.local1; Local2 = &statsPtr->cmn.local2; Local3 = &statsPtr->cmn.local3; RDbf1 = &statsPtr->cmn.rdbf1; RDbf2 = &statsPtr->cmn.rdbf2; RDbf3 = &statsPtr->cmn.milli; *RDbf3 = 1; IntVc1 = &statsPtr->u.gem.a1; IntVc2 = &statsPtr->u.gem.a2; IntCode3 = &statsPtr->u.gem.a3; IntCode4 = &statsPtr->u.gem.a4; IntCode5 = &statsPtr->u.gem.a5; IntCode6 = &statsPtr->u.gem.a6; { WorkEntrySType *workSpPtr; workSpPtr = &Workspace; workSpPtr->p1 = &statsPtr->u.gem.a7; workSpPtr->p2 = &statsPtr->u.gem.a8; workSpPtr->p3 = &statsPtr->u.gem.a9; workSpPtr->p4 = &statsPtr->u.gem.a10; workSpPtr->p5 = &statsPtr->u.gem.a11; workSpPtr->p6 = &statsPtr->u.gem.a12; workSpPtr->p7 = &statsPtr->u.gem.a13; workSpPtr->p8 = &statsPtr->u.gem.a14; workSpPtr->p9 = &statsPtr->u.gem.a15; workSpPtr->p10 = &statsPtr->u.gem.a16; workSpPtr->p11 = &statsPtr->u.gem.a17; } Lom1 = &statsPtr->u.gem.c1; Lom2 = &statsPtr->u.gem.c2; Lom3 = &statsPtr->u.gem.c3; Lom4 = &statsPtr->u.gem.c4; Lom5 = &statsPtr->u.gem.c5; Lom6 = &statsPtr->u.gem.c6; Lom7 = &statsPtr->u.gem.c7; Lom8 = &statsPtr->u.gem.c8; Lom9 = &statsPtr->u.gem.c9; Lom10 = &statsPtr->u.gem.c10; RDbf11 = &statsPtr->u.gem.c11; RDbf12 = &statsPtr->u.gem.c12; } typedef struct { ShrPcStatsSType stats; } ShrPcPteSType; ShrPcPteSType MyPte; static void initPte (void *shrpcPtr, long sessionId) { ShrPcPteSType *ptePtr; ptePtr = &MyPte; setStatPointers (&ptePtr->stats, sessionId); } void InitCache (int sessionId) { initPte (0, sessionId); } int main (int argc, char *argv[]) { InitCache (5); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020402-3.c ================================================ /* extracted from gdb sources */ typedef unsigned long long CORE_ADDR; struct blockvector; struct symtab { struct blockvector *blockvector; }; struct sec { void *unused; }; struct symbol { int len; char *name; }; struct block { CORE_ADDR startaddr, endaddr; struct symbol *function; struct block *superblock; unsigned char gcc_compile_flag; int nsyms; struct symbol syms[1]; }; struct blockvector { int nblocks; struct block *block[2]; }; struct blockvector *blockvector_for_pc_sect(register CORE_ADDR pc, struct symtab *symtab) { register struct block *b; register int bot, top, half; struct blockvector *bl; bl = symtab->blockvector; b = bl->block[0]; bot = 0; top = bl->nblocks; while (top - bot > 1) { half = (top - bot + 1) >> 1; b = bl->block[bot + half]; if (b->startaddr <= pc) bot += half; else top = bot + half; } while (bot >= 0) { b = bl->block[bot]; if (b->endaddr > pc) { return bl; } bot--; } return 0; } int main(void) { struct block a = { 0, 0x10000, 0, 0, 1, 20 }; struct block b = { 0x10000, 0x20000, 0, 0, 1, 20 }; struct blockvector bv = { 2, { &a, &b } }; struct symtab s = { &bv }; struct blockvector *ret; ret = blockvector_for_pc_sect(0x500, &s); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020404-1.c ================================================ /* { dg-require-effective-target int32plus } */ /* { dg-skip-if "pointers can be truncated" { m32c-*-* } "*" "" } */ /* Extracted from GDB sources. */ typedef long long bfd_signed_vma; typedef bfd_signed_vma file_ptr; typedef enum bfd_boolean {false, true} boolean; typedef unsigned long long bfd_size_type; typedef unsigned int flagword; typedef unsigned long long CORE_ADDR; typedef unsigned long long bfd_vma; struct bfd_struct { int x; }; struct asection_struct { unsigned int user_set_vma : 1; bfd_vma vma; bfd_vma lma; unsigned int alignment_power; unsigned int entsize; }; typedef struct bfd_struct bfd; typedef struct asection_struct asection; static bfd * bfd_openw_with_cleanup (char *filename, const char *target, char *mode); static asection * bfd_make_section_anyway (bfd *abfd, const char *name); static boolean bfd_set_section_size (bfd *abfd, asection *sec, bfd_size_type val); static boolean bfd_set_section_flags (bfd *abfd, asection *sec, flagword flags); static boolean bfd_set_section_contents (bfd *abfd, asection *section, void * data, file_ptr offset, bfd_size_type count); static void dump_bfd_file (char *filename, char *mode, char *target, CORE_ADDR vaddr, char *buf, int len) { bfd *obfd; asection *osection; obfd = bfd_openw_with_cleanup (filename, target, mode); osection = bfd_make_section_anyway (obfd, ".newsec"); bfd_set_section_size (obfd, osection, len); (((osection)->vma = (osection)->lma= (vaddr)), ((osection)->user_set_vma = (boolean)true), true); (((osection)->alignment_power = (0)),true); bfd_set_section_flags (obfd, osection, 0x203); osection->entsize = 0; bfd_set_section_contents (obfd, osection, buf, 0, len); } static bfd * bfd_openw_with_cleanup (char *filename, const char *target, char *mode) { static bfd foo_bfd = { 0 }; return &foo_bfd; } static asection * bfd_make_section_anyway (bfd *abfd, const char *name) { static asection foo_section = { false, 0x0, 0x0, 0 }; return &foo_section; } static boolean bfd_set_section_size (bfd *abfd, asection *sec, bfd_size_type val) { return true; } static boolean bfd_set_section_flags (bfd *abfd, asection *sec, flagword flags) { } static boolean bfd_set_section_contents (bfd *abfd, asection *section, void * data, file_ptr offset, bfd_size_type count) { if (count != (bfd_size_type)0x1eadbeef) abort(); } static char hello[] = "hello"; int main(void) { dump_bfd_file(0, 0, 0, (CORE_ADDR)0xdeadbeef, hello, (int)0x1eadbeef); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020406-1.c ================================================ // Origin: abbott@dima.unige.it // PR c/5120 extern void * malloc (__SIZE_TYPE__); extern void * calloc (__SIZE_TYPE__, __SIZE_TYPE__); typedef unsigned int FFelem; FFelem FFmul(const FFelem x, const FFelem y) { return x; } struct DUPFFstruct { int maxdeg; int deg; FFelem *coeffs; }; typedef struct DUPFFstruct *DUPFF; int DUPFFdeg(const DUPFF f) { return f->deg; } DUPFF DUPFFnew(const int maxdeg) { DUPFF ans = (DUPFF)malloc(sizeof(struct DUPFFstruct)); ans->coeffs = 0; if (maxdeg >= 0) ans->coeffs = (FFelem*)calloc(maxdeg+1,sizeof(FFelem)); ans->maxdeg = maxdeg; ans->deg = -1; return ans; } void DUPFFfree(DUPFF x) { } void DUPFFswap(DUPFF x, DUPFF y) { } DUPFF DUPFFcopy(const DUPFF x) { return x; } void DUPFFshift_add(DUPFF f, const DUPFF g, int deg, const FFelem coeff) { } DUPFF DUPFFexgcd(DUPFF *fcofac, DUPFF *gcofac, const DUPFF f, const DUPFF g) { DUPFF u, v, uf, ug, vf, vg; FFelem q, lcu, lcvrecip, p; int df, dg, du, dv; printf("DUPFFexgcd called on degrees %d and %d\n", DUPFFdeg(f), DUPFFdeg(g)); if (DUPFFdeg(f) < DUPFFdeg(g)) return DUPFFexgcd(gcofac, fcofac, g, f); /*** BUG IN THIS LINE ***/ if (DUPFFdeg(f) != 2 || DUPFFdeg(g) != 1) abort(); if (f->coeffs[0] == 0) return f; /****** NEVER REACH HERE IN THE EXAMPLE ******/ p = 2; df = DUPFFdeg(f); if (df < 0) df = 0; /* both inputs are zero */ dg = DUPFFdeg(g); if (dg < 0) dg = 0; /* one input is zero */ u = DUPFFcopy(f); v = DUPFFcopy(g); uf = DUPFFnew(dg); uf->coeffs[0] = 1; uf->deg = 0; ug = DUPFFnew(df); vf = DUPFFnew(dg); vg = DUPFFnew(df); vg->coeffs[0] = 1; vg->deg = 0; while (DUPFFdeg(v) > 0) { dv = DUPFFdeg(v); lcvrecip = FFmul(1, v->coeffs[dv]); while (DUPFFdeg(u) >= dv) { du = DUPFFdeg(u); lcu = u->coeffs[du]; q = FFmul(lcu, lcvrecip); DUPFFshift_add(u, v, du-dv, p-q); DUPFFshift_add(uf, vf, du-dv, p-q); DUPFFshift_add(ug, vg, du-dv, p-q); } DUPFFswap(u, v); DUPFFswap(uf, vf); DUPFFswap(ug, vg); } if (DUPFFdeg(v) == 0) { DUPFFswap(u, v); DUPFFswap(uf, vf); DUPFFswap(ug, vg); } DUPFFfree(vf); DUPFFfree(vg); DUPFFfree(v); *fcofac = uf; *gcofac = ug; return u; } int main() { DUPFF f, g, cf, cg, h; f = DUPFFnew(1); f->coeffs[1] = 1; f->deg = 1; g = DUPFFnew(2); g->coeffs[2] = 1; g->deg = 2; printf("calling DUPFFexgcd on degrees %d and %d\n", DUPFFdeg(f), DUPFFdeg(g)) ; h = DUPFFexgcd(&cf, &cg, f, g); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020411-1.c ================================================ /* PR optimization/6177 This testcase ICEd because expr.c did not expect to see a CONCAT as array rtl. */ extern void abort (void); extern void exit (int); __complex__ float foo (void) { __complex__ float f[1]; __real__ f[0] = 1.0; __imag__ f[0] = 1.0; f[0] = __builtin_conjf (f[0]); return f[0]; } int main (void) { __complex__ double d[1]; d[0] = foo (); if (__real__ d[0] != 1.0 || __imag__ d[0] != -1.0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020412-1.c ================================================ /* PR c/3711 This testcase ICEd on IA-32 at -O0 and was miscompiled otherwise, because std_expand_builtin_va_arg didn't handle variable size types. */ /* { dg-require-effective-target alloca } */ #include extern void abort (void); extern void exit (int); void bar (int c) { static int d = '0'; if (c != d++) abort (); if (c < '0' || c > '9') abort (); } void foo (int size, ...) { struct { char x[size]; } d; va_list ap; int i; va_start (ap, size); d = va_arg (ap, typeof (d)); for (i = 0; i < size; i++) bar (d.x[i]); d = va_arg (ap, typeof (d)); for (i = 0; i < size; i++) bar (d.x[i]); va_end (ap); } int main (void) { int z = 5; struct { char a[z]; } x, y; x.a[0] = '0'; x.a[1] = '1'; x.a[2] = '2'; x.a[3] = '3'; x.a[4] = '4'; y.a[0] = '5'; y.a[1] = '6'; y.a[2] = '7'; y.a[3] = '8'; y.a[4] = '9'; foo (z, x, y); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020413-1.c ================================================ void test(long double val, int *eval) { long double tmp = 1.0l; int i = 0; if (val < 0.0l) val = -val; if (val >= tmp) while (tmp < val) { tmp *= 2.0l; if (i++ >= 10) abort (); } else if (val != 0.0l) while (val < tmp) { tmp /= 2.0l; if (i++ >= 10) abort (); } *eval = i; } int main(void) { int eval; test(3.0, &eval); test(3.5, &eval); test(4.0, &eval); test(5.0, &eval); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020418-1.c ================================================ /* ifcvt accidentally deletes a referenced label while generating conditional traps on machines having such patterns */ struct foo { int a; }; void gcc_crash(struct foo *p) { if (__builtin_expect(p->a < 52, 0)) __builtin_trap(); top: p->a++; if (p->a >= 62) goto top; } int main(void) { struct foo x; x.a = 53; gcc_crash(&x); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020423-1.c ================================================ /* PR c/5430 */ /* Verify that the multiplicative folding code is not fooled by the mix between signed variables and unsigned constants. */ extern void abort (void); extern void exit (int); int main (void) { int my_int = 924; unsigned int result; result = ((my_int*2 + 4) - 8U) / 2; if (result != 922U) abort(); result = ((my_int*2 - 4U) + 2) / 2; if (result != 923U) abort(); result = (((my_int + 2) * 2) - 8U - 4) / 2; if (result != 920U) abort(); result = (((my_int + 2) * 2) - (8U + 4)) / 2; if (result != 920U) abort(); result = ((my_int*4 + 2U) - 4U) / 2; if (result != 1847U) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020503-1.c ================================================ /* PR 6534 */ /* GCSE unified the two i<0 tests, but if-conversion to ui=abs(i) insertted the code at the wrong place corrupting the i<0 test. */ void abort (void); static char * inttostr (long i, char buf[128]) { unsigned long ui = i; char *p = buf + 127; *p = '\0'; if (i < 0) ui = -ui; do *--p = '0' + ui % 10; while ((ui /= 10) != 0); if (i < 0) *--p = '-'; return p; } int main () { char buf[128], *p; p = inttostr (-1, buf); if (*p != '-') abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020506-1.c ================================================ /* Copyright (C) 2002 Free Software Foundation. Test that (A & C1) op C2 optimizations behave correctly where C1 is a constant power of 2, op is == or !=, and C2 is C1 or zero. Written by Roger Sayle, 5th May 2002. */ #include extern void abort (void); void test1 (signed char c, int set); void test2 (unsigned char c, int set); void test3 (short s, int set); void test4 (unsigned short s, int set); void test5 (int i, int set); void test6 (unsigned int i, int set); void test7 (long long l, int set); void test8 (unsigned long long l, int set); #ifndef LONG_LONG_MAX #define LONG_LONG_MAX __LONG_LONG_MAX__ #endif #ifndef LONG_LONG_MIN #define LONG_LONG_MIN (-LONG_LONG_MAX-1LL) #endif #ifndef ULONG_LONG_MAX #define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL) #endif void test1 (signed char c, int set) { if ((c & (SCHAR_MAX+1)) == 0) { if (set) abort (); } else if (!set) abort (); if ((c & (SCHAR_MAX+1)) != 0) { if (!set) abort (); } else if (set) abort (); if ((c & (SCHAR_MAX+1)) == (SCHAR_MAX+1)) { if (!set) abort (); } else if (set) abort (); if ((c & (SCHAR_MAX+1)) != (SCHAR_MAX+1)) { if (set) abort (); } else if (!set) abort (); } void test2 (unsigned char c, int set) { if ((c & (SCHAR_MAX+1)) == 0) { if (set) abort (); } else if (!set) abort (); if ((c & (SCHAR_MAX+1)) != 0) { if (!set) abort (); } else if (set) abort (); if ((c & (SCHAR_MAX+1)) == (SCHAR_MAX+1)) { if (!set) abort (); } else if (set) abort (); if ((c & (SCHAR_MAX+1)) != (SCHAR_MAX+1)) { if (set) abort (); } else if (!set) abort (); } void test3 (short s, int set) { if ((s & (SHRT_MAX+1)) == 0) { if (set) abort (); } else if (!set) abort (); if ((s & (SHRT_MAX+1)) != 0) { if (!set) abort (); } else if (set) abort (); if ((s & (SHRT_MAX+1)) == (SHRT_MAX+1)) { if (!set) abort (); } else if (set) abort (); if ((s & (SHRT_MAX+1)) != (SHRT_MAX+1)) { if (set) abort (); } else if (!set) abort (); } void test4 (unsigned short s, int set) { if ((s & (SHRT_MAX+1)) == 0) { if (set) abort (); } else if (!set) abort (); if ((s & (SHRT_MAX+1)) != 0) { if (!set) abort (); } else if (set) abort (); if ((s & (SHRT_MAX+1)) == (SHRT_MAX+1)) { if (!set) abort (); } else if (set) abort (); if ((s & (SHRT_MAX+1)) != (SHRT_MAX+1)) { if (set) abort (); } else if (!set) abort (); } void test5 (int i, int set) { if ((i & (INT_MAX+1U)) == 0) { if (set) abort (); } else if (!set) abort (); if ((i & (INT_MAX+1U)) != 0) { if (!set) abort (); } else if (set) abort (); if ((i & (INT_MAX+1U)) == (INT_MAX+1U)) { if (!set) abort (); } else if (set) abort (); if ((i & (INT_MAX+1U)) != (INT_MAX+1U)) { if (set) abort (); } else if (!set) abort (); } void test6 (unsigned int i, int set) { if ((i & (INT_MAX+1U)) == 0) { if (set) abort (); } else if (!set) abort (); if ((i & (INT_MAX+1U)) != 0) { if (!set) abort (); } else if (set) abort (); if ((i & (INT_MAX+1U)) == (INT_MAX+1U)) { if (!set) abort (); } else if (set) abort (); if ((i & (INT_MAX+1U)) != (INT_MAX+1U)) { if (set) abort (); } else if (!set) abort (); } void test7 (long long l, int set) { if ((l & (LONG_LONG_MAX+1ULL)) == 0) { if (set) abort (); } else if (!set) abort (); if ((l & (LONG_LONG_MAX+1ULL)) != 0) { if (!set) abort (); } else if (set) abort (); if ((l & (LONG_LONG_MAX+1ULL)) == (LONG_LONG_MAX+1ULL)) { if (!set) abort (); } else if (set) abort (); if ((l & (LONG_LONG_MAX+1ULL)) != (LONG_LONG_MAX+1ULL)) { if (set) abort (); } else if (!set) abort (); } void test8 (unsigned long long l, int set) { if ((l & (LONG_LONG_MAX+1ULL)) == 0) { if (set) abort (); } else if (!set) abort (); if ((l & (LONG_LONG_MAX+1ULL)) != 0) { if (!set) abort (); } else if (set) abort (); if ((l & (LONG_LONG_MAX+1ULL)) == (LONG_LONG_MAX+1ULL)) { if (!set) abort (); } else if (set) abort (); if ((l & (LONG_LONG_MAX+1ULL)) != (LONG_LONG_MAX+1ULL)) { if (set) abort (); } else if (!set) abort (); } int main () { test1 (0, 0); test1 (SCHAR_MAX, 0); test1 (SCHAR_MIN, 1); test1 (UCHAR_MAX, 1); test2 (0, 0); test2 (SCHAR_MAX, 0); test2 (SCHAR_MIN, 1); test2 (UCHAR_MAX, 1); test3 (0, 0); test3 (SHRT_MAX, 0); test3 (SHRT_MIN, 1); test3 (USHRT_MAX, 1); test4 (0, 0); test4 (SHRT_MAX, 0); test4 (SHRT_MIN, 1); test4 (USHRT_MAX, 1); test5 (0, 0); test5 (INT_MAX, 0); test5 (INT_MIN, 1); test5 (UINT_MAX, 1); test6 (0, 0); test6 (INT_MAX, 0); test6 (INT_MIN, 1); test6 (UINT_MAX, 1); test7 (0, 0); test7 (LONG_LONG_MAX, 0); test7 (LONG_LONG_MIN, 1); test7 (ULONG_LONG_MAX, 1); test8 (0, 0); test8 (LONG_LONG_MAX, 0); test8 (LONG_LONG_MIN, 1); test8 (ULONG_LONG_MAX, 1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020508-1.c ================================================ /* This tests the rotate patterns that some machines support. */ #include #ifndef CHAR_BIT #define CHAR_BIT 8 #endif #define ROR(a,b) (((a) >> (b)) | ((a) << ((sizeof (a) * CHAR_BIT) - (b)))) #define ROL(a,b) (((a) << (b)) | ((a) >> ((sizeof (a) * CHAR_BIT) - (b)))) #define CHAR_VALUE ((unsigned char)0xf234U) #define SHORT_VALUE ((unsigned short)0xf234U) #define INT_VALUE 0xf234U #define LONG_VALUE 0xf2345678LU #define LL_VALUE 0xf2345678abcdef0LLU #define SHIFT1 4 #define SHIFT2 ((sizeof (long long) * CHAR_BIT) - SHIFT1) unsigned char uc = CHAR_VALUE; unsigned short us = SHORT_VALUE; unsigned int ui = INT_VALUE; unsigned long ul = LONG_VALUE; unsigned long long ull = LL_VALUE; int shift1 = SHIFT1; int shift2 = SHIFT2; main () { if (ROR (uc, shift1) != ROR (CHAR_VALUE, SHIFT1)) abort (); if (ROR (uc, SHIFT1) != ROR (CHAR_VALUE, SHIFT1)) abort (); if (ROR (us, shift1) != ROR (SHORT_VALUE, SHIFT1)) abort (); if (ROR (us, SHIFT1) != ROR (SHORT_VALUE, SHIFT1)) abort (); if (ROR (ui, shift1) != ROR (INT_VALUE, SHIFT1)) abort (); if (ROR (ui, SHIFT1) != ROR (INT_VALUE, SHIFT1)) abort (); if (ROR (ul, shift1) != ROR (LONG_VALUE, SHIFT1)) abort (); if (ROR (ul, SHIFT1) != ROR (LONG_VALUE, SHIFT1)) abort (); if (ROR (ull, shift1) != ROR (LL_VALUE, SHIFT1)) abort (); if (ROR (ull, SHIFT1) != ROR (LL_VALUE, SHIFT1)) abort (); if (ROR (ull, shift2) != ROR (LL_VALUE, SHIFT2)) abort (); if (ROR (ull, SHIFT2) != ROR (LL_VALUE, SHIFT2)) abort (); if (ROL (uc, shift1) != ROL (CHAR_VALUE, SHIFT1)) abort (); if (ROL (uc, SHIFT1) != ROL (CHAR_VALUE, SHIFT1)) abort (); if (ROL (us, shift1) != ROL (SHORT_VALUE, SHIFT1)) abort (); if (ROL (us, SHIFT1) != ROL (SHORT_VALUE, SHIFT1)) abort (); if (ROL (ui, shift1) != ROL (INT_VALUE, SHIFT1)) abort (); if (ROL (ui, SHIFT1) != ROL (INT_VALUE, SHIFT1)) abort (); if (ROL (ul, shift1) != ROL (LONG_VALUE, SHIFT1)) abort (); if (ROL (ul, SHIFT1) != ROL (LONG_VALUE, SHIFT1)) abort (); if (ROL (ull, shift1) != ROL (LL_VALUE, SHIFT1)) abort (); if (ROL (ull, SHIFT1) != ROL (LL_VALUE, SHIFT1)) abort (); if (ROL (ull, shift2) != ROL (LL_VALUE, SHIFT2)) abort (); if (ROL (ull, SHIFT2) != ROL (LL_VALUE, SHIFT2)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020508-2.c ================================================ #include #ifndef CHAR_BIT #define CHAR_BIT 8 #endif #define ROR(a,b) (((a) >> (b)) | ((a) << ((sizeof (a) * CHAR_BIT) - (b)))) #define ROL(a,b) (((a) << (b)) | ((a) >> ((sizeof (a) * CHAR_BIT) - (b)))) #define CHAR_VALUE ((char)0x1234) #define SHORT_VALUE ((short)0x1234) #define INT_VALUE ((int)0x1234) #define LONG_VALUE ((long)0x12345678L) #define LL_VALUE ((long long)0x12345678abcdef0LL) #define SHIFT1 4 #define SHIFT2 ((sizeof (long long) * CHAR_BIT) - SHIFT1) char c = CHAR_VALUE; short s = SHORT_VALUE; int i = INT_VALUE; long l = LONG_VALUE; long long ll = LL_VALUE; int shift1 = SHIFT1; int shift2 = SHIFT2; main () { if (ROR (c, shift1) != ROR (CHAR_VALUE, SHIFT1)) abort (); if (ROR (c, SHIFT1) != ROR (CHAR_VALUE, SHIFT1)) abort (); if (ROR (s, shift1) != ROR (SHORT_VALUE, SHIFT1)) abort (); if (ROR (s, SHIFT1) != ROR (SHORT_VALUE, SHIFT1)) abort (); if (ROR (i, shift1) != ROR (INT_VALUE, SHIFT1)) abort (); if (ROR (i, SHIFT1) != ROR (INT_VALUE, SHIFT1)) abort (); if (ROR (l, shift1) != ROR (LONG_VALUE, SHIFT1)) abort (); if (ROR (l, SHIFT1) != ROR (LONG_VALUE, SHIFT1)) abort (); if (ROR (ll, shift1) != ROR (LL_VALUE, SHIFT1)) abort (); if (ROR (ll, SHIFT1) != ROR (LL_VALUE, SHIFT1)) abort (); if (ROR (ll, shift2) != ROR (LL_VALUE, SHIFT2)) abort (); if (ROR (ll, SHIFT2) != ROR (LL_VALUE, SHIFT2)) abort (); if (ROL (c, shift1) != ROL (CHAR_VALUE, SHIFT1)) abort (); if (ROL (c, SHIFT1) != ROL (CHAR_VALUE, SHIFT1)) abort (); if (ROL (s, shift1) != ROL (SHORT_VALUE, SHIFT1)) abort (); if (ROL (s, SHIFT1) != ROL (SHORT_VALUE, SHIFT1)) abort (); if (ROL (i, shift1) != ROL (INT_VALUE, SHIFT1)) abort (); if (ROL (i, SHIFT1) != ROL (INT_VALUE, SHIFT1)) abort (); if (ROL (l, shift1) != ROL (LONG_VALUE, SHIFT1)) abort (); if (ROL (l, SHIFT1) != ROL (LONG_VALUE, SHIFT1)) abort (); if (ROL (ll, shift1) != ROL (LL_VALUE, SHIFT1)) abort (); if (ROL (ll, SHIFT1) != ROL (LL_VALUE, SHIFT1)) abort (); if (ROL (ll, shift2) != ROL (LL_VALUE, SHIFT2)) abort (); if (ROL (ll, SHIFT2) != ROL (LL_VALUE, SHIFT2)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020508-3.c ================================================ #include #ifndef CHAR_BIT #define CHAR_BIT 8 #endif #define ROR(a,b) (((a) >> (b)) | ((a) << ((sizeof (a) * CHAR_BIT) - (b)))) #define ROL(a,b) (((a) << (b)) | ((a) >> ((sizeof (a) * CHAR_BIT) - (b)))) #define CHAR_VALUE ((char)0xf234) #define SHORT_VALUE ((short)0xf234) #define INT_VALUE ((int)0xf234) #define LONG_VALUE ((long)0xf2345678L) #define LL_VALUE ((long long)0xf2345678abcdef0LL) #define SHIFT1 4 #define SHIFT2 ((sizeof (long long) * CHAR_BIT) - SHIFT1) char c = CHAR_VALUE; short s = SHORT_VALUE; int i = INT_VALUE; long l = LONG_VALUE; long long ll = LL_VALUE; int shift1 = SHIFT1; int shift2 = SHIFT2; main () { if (ROR (c, shift1) != ROR (CHAR_VALUE, SHIFT1)) abort (); if (ROR (c, SHIFT1) != ROR (CHAR_VALUE, SHIFT1)) abort (); if (ROR (s, shift1) != ROR (SHORT_VALUE, SHIFT1)) abort (); if (ROR (s, SHIFT1) != ROR (SHORT_VALUE, SHIFT1)) abort (); if (ROR (i, shift1) != ROR (INT_VALUE, SHIFT1)) abort (); if (ROR (i, SHIFT1) != ROR (INT_VALUE, SHIFT1)) abort (); if (ROR (l, shift1) != ROR (LONG_VALUE, SHIFT1)) abort (); if (ROR (l, SHIFT1) != ROR (LONG_VALUE, SHIFT1)) abort (); if (ROR (ll, shift1) != ROR (LL_VALUE, SHIFT1)) abort (); if (ROR (ll, SHIFT1) != ROR (LL_VALUE, SHIFT1)) abort (); if (ROR (ll, shift2) != ROR (LL_VALUE, SHIFT2)) abort (); if (ROR (ll, SHIFT2) != ROR (LL_VALUE, SHIFT2)) abort (); if (ROL (c, shift1) != ROL (CHAR_VALUE, SHIFT1)) abort (); if (ROL (c, SHIFT1) != ROL (CHAR_VALUE, SHIFT1)) abort (); if (ROL (s, shift1) != ROL (SHORT_VALUE, SHIFT1)) abort (); if (ROL (s, SHIFT1) != ROL (SHORT_VALUE, SHIFT1)) abort (); if (ROL (i, shift1) != ROL (INT_VALUE, SHIFT1)) abort (); if (ROL (i, SHIFT1) != ROL (INT_VALUE, SHIFT1)) abort (); if (ROL (l, shift1) != ROL (LONG_VALUE, SHIFT1)) abort (); if (ROL (l, SHIFT1) != ROL (LONG_VALUE, SHIFT1)) abort (); if (ROL (ll, shift1) != ROL (LL_VALUE, SHIFT1)) abort (); if (ROL (ll, SHIFT1) != ROL (LL_VALUE, SHIFT1)) abort (); if (ROL (ll, shift2) != ROL (LL_VALUE, SHIFT2)) abort (); if (ROL (ll, SHIFT2) != ROL (LL_VALUE, SHIFT2)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020510-1.c ================================================ /* Copyright (C) 2002 Free Software Foundation. Test that optimizing ((c>=1) && (c<=127)) into (signed char)c < 0 doesn't cause any problems for the compiler and behaves correctly. Written by Roger Sayle, 8th May 2002. */ #include extern void abort (void); void testc (unsigned char c, int ok) { if ((c>=1) && (c<=SCHAR_MAX)) { if (!ok) abort (); } else if (ok) abort (); } void tests (unsigned short s, int ok) { if ((s>=1) && (s<=SHRT_MAX)) { if (!ok) abort (); } else if (ok) abort (); } void testi (unsigned int i, int ok) { if ((i>=1) && (i<=INT_MAX)) { if (!ok) abort (); } else if (ok) abort (); } void testl (unsigned long l, int ok) { if ((l>=1) && (l<=LONG_MAX)) { if (!ok) abort (); } else if (ok) abort (); } int main () { testc (0, 0); testc (1, 1); testc (SCHAR_MAX, 1); testc (SCHAR_MAX+1, 0); testc (UCHAR_MAX, 0); tests (0, 0); tests (1, 1); tests (SHRT_MAX, 1); tests (SHRT_MAX+1, 0); tests (USHRT_MAX, 0); testi (0, 0); testi (1, 1); testi (INT_MAX, 1); testi (INT_MAX+1U, 0); testi (UINT_MAX, 0); testl (0, 0); testl (1, 1); testl (LONG_MAX, 1); testl (LONG_MAX+1UL, 0); testl (ULONG_MAX, 0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020529-1.c ================================================ /* PR target/6838 from cato@df.lth.se. cris-elf got an ICE with -O2: the insn matching (insn 49 48 52 (parallel[ (set (mem/s:HI (plus:SI (reg/v/f:SI 0 r0 [24]) (const_int 8 [0x8])) [5 .c+0 S2 A8]) (reg:HI 2 r2 [27])) (set (reg/f:SI 2 r2 [31]) (plus:SI (reg/v/f:SI 0 r0 [24]) (const_int 8 [0x8]))) ] ) 24 {*mov_sidehi_mem} (nil) (nil)) forced a splitter through the output pattern "#", but there was no matching splitter. */ struct xx { int a; struct xx *b; short c; }; int f1 (struct xx *); void f2 (void); int foo (struct xx *p, int b, int c, int d) { int a; for (;;) { a = f1(p); if (a) return (0); if (b) continue; p->c = d; if (p->a) f2 (); if (c) f2 (); d = p->c; switch (a) { case 1: if (p->b) f2 (); if (c) f2 (); default: break; } } return d; } int main (void) { struct xx s = {0, &s, 23}; if (foo (&s, 0, 0, 0) != 0 || s.a != 0 || s.b != &s || s.c != 0) abort (); exit (0); } int f1 (struct xx *p) { static int beenhere = 0; if (beenhere++ > 1) abort (); return beenhere > 1; } void f2 (void) { abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020611-1.c ================================================ /* PR target/6997. Missing (set_attr "cc" "none") in sleu pattern in cris.md. Testcase from hp@axis.com. */ int p; int k; unsigned int n; void x () { unsigned int h; h = n <= 30; if (h) p = 1; else p = 0; if (h) k = 1; else k = 0; } unsigned int n = 30; main () { x (); if (p != 1 || k != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020614-1.c ================================================ /* PR c/6677 */ /* Verify that GCC doesn't perform illegal simplifications when folding constants. */ #include extern void abort (void); extern void exit (int); int main (void) { int i; signed char j; unsigned char k; i = SCHAR_MAX; j = ((signed char) (i << 1)) / 2; if (j != -1) abort(); j = ((signed char) (i * 2)) / 2; if (j != -1) abort(); i = UCHAR_MAX; k = ((unsigned char) (i << 1)) / 2; if (k != UCHAR_MAX/2) abort(); k = ((unsigned char) (i * 2)) / 2; if (k != UCHAR_MAX/2) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020615-1.c ================================================ /* PR target/7042. When reorg.c changed branches into return insns, it completely forgot about any current_function_epilogue_delay_list and dropped those insns. Uncovered on cris-axis-elf, where an insn in an epilogue delay-slot set the return-value register with the testcase below. Derived from ghostscript-6.52 (GPL) by hp@axis.com. */ typedef struct font_hints_s { int axes_swapped; int x_inverted, y_inverted; } font_hints; typedef struct gs_fixed_point_s { long x, y; } gs_fixed_point; int line_hints(const font_hints *fh, const gs_fixed_point *p0, const gs_fixed_point *p1) { long dx = p1->x - p0->x; long dy = p1->y - p0->y; long adx, ady; int xi = fh->x_inverted, yi = fh->y_inverted; int hints; if (xi) dx = -dx; if (yi) dy = -dy; if (fh->axes_swapped) { long t = dx; int ti = xi; dx = dy, xi = yi; dy = t, yi = ti; } adx = dx < 0 ? -dx : dx; ady = dy < 0 ? -dy : dy; if (dy != 0 && (adx <= ady >> 4)) { hints = dy > 0 ? 2 : 1; if (xi) hints ^= 3; } else if (dx != 0 && (ady <= adx >> 4)) { hints = dx < 0 ? 8 : 4; if (yi) hints ^= 12; } else hints = 0; return hints; } int main () { static font_hints fh[] = {{0, 1, 0}, {0, 0, 1}, {0, 0, 0}}; static gs_fixed_point gsf[] = {{0x30000, 0x13958}, {0x30000, 0x18189}, {0x13958, 0x30000}, {0x18189, 0x30000}}; if (line_hints (fh, gsf, gsf + 1) != 1 || line_hints (fh + 1, gsf + 2, gsf + 3) != 8 || line_hints (fh + 2, gsf + 2, gsf + 3) != 4) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020619-1.c ================================================ #if (__SIZEOF_INT__ == 4) typedef int int32; #elif (__SIZEOF_LONG__ == 4) typedef long int32; #else #error Add target support for int32 #endif static int32 ref(void) { union { char c[5]; int32 i; } u; __builtin_memset (&u, 0, sizeof(u)); u.c[0] = 1; u.c[1] = 2; u.c[2] = 3; u.c[3] = 4; return u.i; } int main() { int32 b = ref(); if (b != 0x01020304 && b != 0x04030201) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020716-1.c ================================================ extern void abort (void); extern void exit (int); int sub1 (int val) { return val; } int testcond (int val) { int flag1; { int t1 = val; { int t2 = t1; { flag1 = sub1 (t2) ==0; goto lab1; }; } lab1: ; } if (flag1 != 0) return 0x4d0000; else return 0; } int main (void) { if (testcond (1)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020720-1.c ================================================ /* Copyright (C) 2002 Free Software Foundation. Ensure that fabs(x) < 0.0 optimization is working. Written by Roger Sayle, 20th July 2002. */ extern void abort (void); extern double fabs (double); extern void link_error (void); void foo (double x) { double p, q; p = fabs (x); q = 0.0; if (p < q) link_error (); } int main() { foo (1.0); return 0; } #ifndef __OPTIMIZE__ void link_error () { abort (); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020805-1.c ================================================ /* This testcase was miscompiled on IA-32, because fold-const assumed associate_trees is always done on PLUS_EXPR. */ extern void abort (void); extern void exit (int); void check (unsigned int m) { if (m != (unsigned int) -1) abort (); } unsigned int n = 1; int main (void) { unsigned int m; m = (1 | (2 - n)) | (-n); check (m); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020810-1.c ================================================ /* PR target/7559 This testcase was miscompiled on x86-64, because classify_argument wrongly computed the offset of nested structure fields. */ extern void abort (void); struct A { long x; }; struct R { struct A a, b; }; struct R R = { 100, 200 }; void f (struct R r) { if (r.a.x != R.a.x || r.b.x != R.b.x) abort (); } struct R g (void) { return R; } int main (void) { struct R r; f(R); r = g(); if (r.a.x != R.a.x || r.b.x != R.b.x) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020819-1.c ================================================ foo () { return 0; } main() { int i, j, k, ccp_bad = 0; for (i = 0; i < 10; i++) { for (j = 0; j < 10; j++) if (foo ()) ccp_bad = 1; k = ccp_bad != 0; if (k) abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020904-1.c ================================================ /* PR c/7102 */ /* Verify that GCC zero-extends integer constants in unsigned binary operations. */ typedef unsigned char u8; u8 fun(u8 y) { u8 x=((u8)255)/y; return x; } int main(void) { if (fun((u8)2) != 127) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020911-1.c ================================================ extern void abort (void); unsigned short c = 0x8000; int main() { if ((c-0x8000) < 0 || (c-0x8000) > 0x7fff) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020916-1.c ================================================ /* Distilled from try_pre_increment in flow.c. If-conversion inserted new instructions at the wrong place on ppc. */ int foo(int a) { int x; x = 0; if (a > 0) x = 1; if (a < 0) x = 1; return x; } int main() { if (foo(1) != 1) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20020920-1.c ================================================ extern void abort (void); extern void exit (int); struct B { int x; int y; }; struct A { int z; struct B b; }; struct A f () { struct B b = { 0, 1 }; struct A a = { 2, b }; return a; } int main (void) { struct A a = f (); if (a.z != 2 || a.b.x != 0 || a.b.y != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021010-1.c ================================================ #include int sub () { int dummy = 0, a = 16; if (a / INT_MAX / 16 == 0) return 0; else return a / INT_MAX / 16; } int main () { if (sub () != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021010-2.c ================================================ /* cse.c failure on x86 target. Contributed by Stuart Hastings 10 Oct 2002 */ #include typedef signed short SInt16; typedef struct { SInt16 minx; SInt16 maxx; SInt16 miny; SInt16 maxy; } IOGBounds; int expectedwidth = 50; unsigned int *global_vramPtr = (unsigned int *)0xa000; IOGBounds global_bounds = { 100, 150, 100, 150 }; IOGBounds global_saveRect = { 75, 175, 75, 175 }; main() { unsigned int *vramPtr; int width; IOGBounds saveRect = global_saveRect; IOGBounds bounds = global_bounds; if (saveRect.minx < bounds.minx) saveRect.minx = bounds.minx; if (saveRect.maxx > bounds.maxx) saveRect.maxx = bounds.maxx; vramPtr = global_vramPtr + (saveRect.miny - bounds.miny) ; width = saveRect.maxx - saveRect.minx; if (width != expectedwidth) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021011-1.c ================================================ /* PR opt/8165. */ extern void abort (void); char buf[64]; int main (void) { int i; __builtin_strcpy (buf, "mystring"); if (__builtin_strcmp (buf, "mystring") != 0) abort (); for (i = 0; i < 16; ++i) { __builtin_strcpy (buf + i, "mystring"); if (__builtin_strcmp (buf + i, "mystring") != 0) abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021015-1.c ================================================ /* PR opt/7409. */ extern void abort (void); char g_list[] = { '1' }; void g (void *p, char *list, int length, char **elementPtr, char **nextPtr) { if (*nextPtr != g_list) abort (); **nextPtr = 0; } int main (void) { char *list = g_list; char *element; int i, length = 100; for (i = 0; *list != 0; i++) { char *prevList = list; g (0, list, length, &element, &list); length -= (list - prevList); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021024-1.c ================================================ /* Origin: PR target/6981 from Mattias Engdegaard . */ /* { dg-require-effective-target int32plus } */ void exit (int); void abort (void); unsigned long long *cp, m; void foo (void) { } void bar (unsigned rop, unsigned long long *r) { unsigned rs1, rs2, rd; top: rs2 = (rop >> 23) & 0x1ff; rs1 = (rop >> 9) & 0x1ff; rd = rop & 0x1ff; *cp = 1; m = r[rs1] + r[rs2]; *cp = 2; foo(); if (!rd) goto top; r[rd] = 1; } int main(void) { static unsigned long long r[64]; unsigned long long cr; cp = &cr; r[4] = 47; r[8] = 11; bar((8 << 23) | (4 << 9) | 15, r); if (m != 47 + 11) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021111-1.c ================================================ /* Origin: PR c/8467 */ extern void abort (void); extern void exit (int); int aim_callhandler(int sess, int conn, unsigned short family, unsigned short type); int aim_callhandler(int sess, int conn, unsigned short family, unsigned short type) { static int i = 0; if (!conn) return 0; if (type == 0xffff) { return 0; } if (i >= 1) abort (); i++; return aim_callhandler(sess, conn, family, (unsigned short) 0xffff); } int main (void) { aim_callhandler (0, 1, 0, 0); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021113-1.c ================================================ /* { dg-require-effective-target alloca } */ /* This program tests a data flow bug that would cause constant propagation to propagate constants through function calls. */ foo (int *p) { *p = 10; } main() { int *ptr = alloca (sizeof (int)); *ptr = 5; foo (ptr); if (*ptr == 5) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021118-1.c ================================================ struct s { int f[4]; }; int foo (struct s s, int x1, int x2, int x3, int x4, int x5, int x6, int x7) { return s.f[3] + x7; } int main () { struct s s = { 1, 2, 3, 4 }; if (foo (s, 100, 200, 300, 400, 500, 600, 700) != 704) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021118-2.c ================================================ /* Originally added to test SH constant pool layout. t1() failed for non-PIC and t2() failed for PIC. */ int t1 (float *f, int i, void (*f1) (double), void (*f2) (float, float)) { f1 (3.0); f[i] = f[i + 1]; f2 (2.5f, 3.5f); } int t2 (float *f, int i, void (*f1) (double), void (*f2) (float, float), void (*f3) (float)) { f3 (6.0f); f1 (3.0); f[i] = f[i + 1]; f2 (2.5f, 3.5f); } void f1 (double d) { if (d != 3.0) abort (); } void f2 (float f1, float f2) { if (f1 != 2.5f || f2 != 3.5f) abort (); } void f3 (float f) { if (f != 6.0f) abort (); } int main () { float f[3] = { 2.0f, 3.0f, 4.0f }; t1 (f, 0, f1, f2); t2 (f, 1, f1, f2, f3); if (f[0] != 3.0f && f[1] != 4.0f) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021118-3.c ================================================ extern void abort (void); extern void exit (int); int foo (int x) { if (x == -2 || -x - 100 >= 0) abort (); return 0; } int main () { foo (-3); foo (-99); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021119-1.c ================================================ /* PR 8639. */ extern void abort(void); int foo (int i) { int r; r = (80 - 4 * i) / 20; return r; } int main () { if (foo (1) != 3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021120-1.c ================================================ /* Macros to emit "L Nxx R" for each octal number xx between 000 and 037. */ #define OP1(L, N, R, I, J) L N##I##J R #define OP2(L, N, R, I) \ OP1(L, N, R, 0, I), OP1(L, N, R, 1, I), \ OP1(L, N, R, 2, I), OP1(L, N, R, 3, I) #define OP(L, N, R) \ OP2(L, N, R, 0), OP2(L, N, R, 1), OP2(L, N, R, 2), OP2(L, N, R, 3), \ OP2(L, N, R, 4), OP2(L, N, R, 5), OP2(L, N, R, 6), OP2(L, N, R, 7) /* Declare 32 unique variables with prefix N. */ #define DECLARE(N) OP (, N,) /* Copy 32 variables with prefix N from the array at ADDR. Leave ADDR pointing to the end of the array. */ #define COPYIN(N, ADDR) OP (, N, = *(ADDR++)) /* Likewise, but copy the other way. */ #define COPYOUT(N, ADDR) OP (*(ADDR++) =, N,) /* Add the contents of the array at ADDR to 32 variables with prefix N. Leave ADDR pointing to the end of the array. */ #define ADD(N, ADDR) OP (, N, += *(ADDR++)) volatile double gd[32]; volatile float gf[32]; void foo (int n) { double DECLARE(d); float DECLARE(f); volatile double *pd; volatile float *pf; int i; pd = gd; COPYIN (d, pd); for (i = 0; i < n; i++) { pf = gf; COPYIN (f, pf); pd = gd; ADD (d, pd); pd = gd; ADD (d, pd); pd = gd; ADD (d, pd); pf = gf; COPYOUT (f, pf); } pd = gd; COPYOUT (d, pd); } int main () { int i; for (i = 0; i < 32; i++) gd[i] = i, gf[i] = i; foo (1); for (i = 0; i < 32; i++) if (gd[i] != i * 4 || gf[i] != i) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021120-2.c ================================================ int g1, g2; void foo (int x) { int y; if (x) y = 793; else y = 793; g1 = 7930 / y; g2 = 7930 / x; } int main () { foo (793); if (g1 != 10 || g2 != 10) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021120-3.c ================================================ /* Test whether a partly call-clobbered register will be moved over a call. Although the original test case didn't use any GNUisms, it proved difficult to reduce without the named register extension. */ #if __SH64__ == 32 #define LOC asm ("r10") #else #define LOC #endif unsigned int foo (char *c, unsigned int x, unsigned int y) { register unsigned int z LOC; sprintf (c, "%d", x / y); z = x + 1; return z / (y + 1); } int main () { char c[16]; if (foo (c, ~1U, 4) != (~0U / 5)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021127-1.c ================================================ /* { dg-options "-std=c99" } */ long long a = -1; long long llabs (long long); void abort (void); int main() { if (llabs (a) != 1) abort (); return 0; } long long llabs (long long b) { abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021204-1.c ================================================ /* This test was miscompiled when using sibling call optimization, because X ? Y : Y - 1 optimization changed X into !X in place and haven't reverted it if do_store_flag was successful, so when expanding the expression the second time it was !X ? Y : Y - 1. */ extern void abort (void); extern void exit (int); void foo (int x) { if (x != 1) abort (); } int z; int main (int argc, char **argv) { char *a = "test"; char *b = a + 2; foo (z > 0 ? b - a : b - a - 1); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021219-1.c ================================================ /* PR optimization/8988 */ /* Contributed by Kevin Easton */ void foo(char *p1, char **p2) {} int main(void) { char str[] = "foo { xx }"; char *ptr = str + 5; foo(ptr, &ptr); while (*ptr && (*ptr == 13 || *ptr == 32)) ptr++; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030105-1.c ================================================ int __attribute__ ((noinline)) foo () { const int a[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; int i, sum; sum = 0; for (i = 0; i < sizeof (a) / sizeof (*a); i++) sum += a[i]; return sum; } int main () { if (foo () != 28) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030109-1.c ================================================ /* PR c/8032 */ /* Verify that an empty initializer inside a partial parent initializer doesn't confuse GCC. */ struct X { int a; int b; int z[]; }; struct X x = { .b = 40, .z = {} }; int main () { if (x.b != 40) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030117-1.c ================================================ int foo (int, int, int); int bar (int, int, int); int main (void) { if (foo (5, 10, 21) != 12) abort (); if (bar (9, 12, 15) != 150) abort (); exit (0); } int foo (int x, int y, int z) { return (x + y + z) / 3; } int bar (int x, int y, int z) { return foo (x * x, y * y, z * z); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030120-1.c ================================================ /* On H8/300 port, NOTICE_UPDATE_CC had a bug that causes the final pass to remove test insns that should be kept. */ unsigned short test1 (unsigned short w) { if ((w & 0xff00) == 0) { if (w == 0) w = 2; } return w; } unsigned long test2 (unsigned long w) { if ((w & 0xffff0000) == 0) { if (w == 0) w = 2; } return w; } int test3 (unsigned short a) { if (a & 1) return 1; else if (a) return 1; else return 0; } int main () { if (test1 (1) != 1) abort (); if (test2 (1) != 1) abort (); if (test3 (2) != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030120-2.c ================================================ /* PR 8848 */ extern void abort (); int foo(int status) { int s = 0; if (status == 1) s=1; if (status == 3) s=3; if (status == 4) s=4; return s; } int main() { if (foo (3) != 3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030125-1.c ================================================ /* Verify whether math functions are simplified. */ /* { dg-require-effective-target c99_runtime } */ /* { dg-require-weak } */ double sin(double); double floor(double); float t(float a) { return sin(a); } float q(float a) { return floor(a); } double q1(float a) { return floor(a); } main() { #ifdef __OPTIMIZE__ if (t(0)!=0) abort (); if (q(0)!=0) abort (); if (q1(0)!=0) abort (); #endif return 0; } __attribute__ ((weak)) double floor(double a) { abort (); } __attribute__ ((weak)) float floorf(float a) { return a; } __attribute__ ((weak)) double sin(double a) { return a; } __attribute__ ((weak)) float sinf(float a) { abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030128-1.c ================================================ unsigned char x = 50; volatile short y = -5; int main () { x /= y; if (x != (unsigned char) -10) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030203-1.c ================================================ void f(int); int do_layer3(int single) { int stereo1; if(single >= 0) /* stream is stereo, but force to mono */ stereo1 = 1; else stereo1 = 2; f(single); return stereo1; } extern void abort (); int main() { if (do_layer3(-1) != 2) abort (); return 0; } void f(int i) {} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030209-1.c ================================================ #ifdef STACK_SIZE #if STACK_SIZE < 8*100*100 #define SKIP #endif #endif #ifndef SKIP double x[100][100]; int main () { int i; i = 99; x[i][0] = 42; if (x[99][0] != 42) abort (); exit (0); } #else int main () { exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030216-1.c ================================================ /* This test requires constant propagation of loads and stores to be enabled. This is only guaranteed at -O2 and higher. Do not run at -O1. */ /* { dg-skip-if "requires higher optimization" { *-*-* } "-O1" "" } */ void link_error (void); const double one=1.0; main () { #ifdef __OPTIMIZE__ if ((int) one != 1) link_error (); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030218-1.c ================================================ /* On H8, the predicate general_operand_src(op,mode) used to ignore mode when op is a (mem (post_inc ...)). As a result, the pattern for extendhisi2 was recognized as extendqisi2. */ extern void abort (); extern void exit (int); short *q; long foo (short *p) { long b = *p; q = p + 1; return b; } int main () { short a = 0xff00; if (foo (&a) != (long) (short) 0xff00) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030221-1.c ================================================ /* PR optimization/8613 */ /* Contributed by Glen Nakamura */ extern void abort (void); int main (void) { char buf[16] = "1234567890"; char *p = buf; *p++ = (char) __builtin_strlen (buf); if ((buf[0] != 10) || (p - buf != 1)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030222-1.c ================================================ /* Verify that we get the low part of the long long as an int. We used to get it wrong on big-endian machines, if register allocation succeeded at all. We use volatile to make sure the long long is actually truncated to int, in case a single register is wide enough for a long long. */ /* { dg-skip-if "asm would require extra shift-left-4-byte" { spu-*-* } "*" "" } */ #include void ll_to_int (long long x, volatile int *p) { int i; asm ("" : "=r" (i) : "0" (x)); *p = i; } int val = INT_MIN + 1; int main() { volatile int i; ll_to_int ((long long)val, &i); if (i != val) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030224-2.c ================================================ /* Make sure that we don't free any temp stack slots associated with initializing marker before we're finished with them. */ extern void abort(); typedef struct { short v16; } __attribute__((packed)) jint16_t; struct node { jint16_t magic; jint16_t nodetype; int totlen; } __attribute__((packed)); struct node node, *node_p = &node; int main() { struct node marker = { .magic = (jint16_t) {0x1985}, .nodetype = (jint16_t) {0x2003}, .totlen = node_p->totlen }; if (marker.magic.v16 != 0x1985) abort(); if (marker.nodetype.v16 != 0x2003) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030307-1.c ================================================ /* PR optimization/8726 */ /* Originator: Paul Eggert */ /* Verify that GCC doesn't miscompile tail calls on Sparc. */ extern void abort(void); int fcntl_lock(int fd, int op, long long offset, long long count, int type); int vfswrap_lock(char *fsp, int fd, int op, long long offset, long long count, int type) { return fcntl_lock(fd, op, offset, count, type); } int fcntl_lock(int fd, int op, long long offset, long long count, int type) { return type; } int main(void) { if (vfswrap_lock (0, 1, 2, 3, 4, 5) != 5) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030313-1.c ================================================ struct A { unsigned long p, q, r, s; } x = { 13, 14, 15, 16 }; extern void abort (void); extern void exit (int); static inline struct A * bar (void) { struct A *r; switch (8) { case 2: abort (); break; case 8: r = &x; break; default: abort (); break; } return r; } void foo (unsigned long *x, int y) { if (y != 12) abort (); if (x[0] != 1 || x[1] != 11) abort (); if (x[2] != 2 || x[3] != 12) abort (); if (x[4] != 3 || x[5] != 13) abort (); if (x[6] != 4 || x[7] != 14) abort (); if (x[8] != 5 || x[9] != 15) abort (); if (x[10] != 6 || x[11] != 16) abort (); } int main (void) { unsigned long a[40]; int b = 0; a[b++] = 1; a[b++] = 11; a[b++] = 2; a[b++] = 12; a[b++] = 3; a[b++] = bar()->p; a[b++] = 4; a[b++] = bar()->q; a[b++] = 5; a[b++] = bar()->r; a[b++] = 6; a[b++] = bar()->s; foo (a, b); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030316-1.c ================================================ /* PR target/9164 */ /* The comparison operand was sign extended erraneously. */ int main (void) { long j = 0x40000000; if ((unsigned int) (0x40000000 + j) < 0L) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030323-1.c ================================================ /* PR opt/10116 */ /* { dg-require-effective-target return_address } */ /* Removed tablejump while label still in use; this is really a link test. */ void *NSReturnAddress(int offset) { switch (offset) { case 0: return __builtin_return_address(0 + 1); case 1: return __builtin_return_address(1 + 1); case 2: return __builtin_return_address(2 + 1); case 3: return __builtin_return_address(3 + 1); case 4: return __builtin_return_address(4 + 1); case 5: return __builtin_return_address(5 + 1); case 6: return __builtin_return_address(6 + 1); case 7: return __builtin_return_address(7 + 1); case 8: return __builtin_return_address(8 + 1); case 9: return __builtin_return_address(9 + 1); case 10: return __builtin_return_address(10 + 1); case 11: return __builtin_return_address(11 + 1); case 12: return __builtin_return_address(12 + 1); case 13: return __builtin_return_address(13 + 1); case 14: return __builtin_return_address(14 + 1); case 15: return __builtin_return_address(15 + 1); case 16: return __builtin_return_address(16 + 1); case 17: return __builtin_return_address(17 + 1); case 18: return __builtin_return_address(18 + 1); case 19: return __builtin_return_address(19 + 1); case 20: return __builtin_return_address(20 + 1); case 21: return __builtin_return_address(21 + 1); case 22: return __builtin_return_address(22 + 1); case 23: return __builtin_return_address(23 + 1); case 24: return __builtin_return_address(24 + 1); case 25: return __builtin_return_address(25 + 1); case 26: return __builtin_return_address(26 + 1); case 27: return __builtin_return_address(27 + 1); case 28: return __builtin_return_address(28 + 1); case 29: return __builtin_return_address(29 + 1); case 30: return __builtin_return_address(30 + 1); case 31: return __builtin_return_address(31 + 1); case 32: return __builtin_return_address(32 + 1); case 33: return __builtin_return_address(33 + 1); case 34: return __builtin_return_address(34 + 1); case 35: return __builtin_return_address(35 + 1); case 36: return __builtin_return_address(36 + 1); case 37: return __builtin_return_address(37 + 1); case 38: return __builtin_return_address(38 + 1); case 39: return __builtin_return_address(39 + 1); case 40: return __builtin_return_address(40 + 1); case 41: return __builtin_return_address(41 + 1); case 42: return __builtin_return_address(42 + 1); case 43: return __builtin_return_address(43 + 1); case 44: return __builtin_return_address(44 + 1); case 45: return __builtin_return_address(45 + 1); case 46: return __builtin_return_address(46 + 1); case 47: return __builtin_return_address(47 + 1); case 48: return __builtin_return_address(48 + 1); case 49: return __builtin_return_address(49 + 1); case 50: return __builtin_return_address(50 + 1); case 51: return __builtin_return_address(51 + 1); case 52: return __builtin_return_address(52 + 1); case 53: return __builtin_return_address(53 + 1); case 54: return __builtin_return_address(54 + 1); case 55: return __builtin_return_address(55 + 1); case 56: return __builtin_return_address(56 + 1); case 57: return __builtin_return_address(57 + 1); case 58: return __builtin_return_address(58 + 1); case 59: return __builtin_return_address(59 + 1); case 60: return __builtin_return_address(60 + 1); case 61: return __builtin_return_address(61 + 1); case 62: return __builtin_return_address(62 + 1); case 63: return __builtin_return_address(63 + 1); case 64: return __builtin_return_address(64 + 1); case 65: return __builtin_return_address(65 + 1); case 66: return __builtin_return_address(66 + 1); case 67: return __builtin_return_address(67 + 1); case 68: return __builtin_return_address(68 + 1); case 69: return __builtin_return_address(69 + 1); case 70: return __builtin_return_address(70 + 1); case 71: return __builtin_return_address(71 + 1); case 72: return __builtin_return_address(72 + 1); case 73: return __builtin_return_address(73 + 1); case 74: return __builtin_return_address(74 + 1); case 75: return __builtin_return_address(75 + 1); case 76: return __builtin_return_address(76 + 1); case 77: return __builtin_return_address(77 + 1); case 78: return __builtin_return_address(78 + 1); case 79: return __builtin_return_address(79 + 1); case 80: return __builtin_return_address(80 + 1); case 81: return __builtin_return_address(81 + 1); case 82: return __builtin_return_address(82 + 1); case 83: return __builtin_return_address(83 + 1); case 84: return __builtin_return_address(84 + 1); case 85: return __builtin_return_address(85 + 1); case 86: return __builtin_return_address(86 + 1); case 87: return __builtin_return_address(87 + 1); case 88: return __builtin_return_address(88 + 1); case 89: return __builtin_return_address(89 + 1); case 90: return __builtin_return_address(90 + 1); case 91: return __builtin_return_address(91 + 1); case 92: return __builtin_return_address(92 + 1); case 93: return __builtin_return_address(93 + 1); case 94: return __builtin_return_address(94 + 1); case 95: return __builtin_return_address(95 + 1); case 96: return __builtin_return_address(96 + 1); case 97: return __builtin_return_address(97 + 1); case 98: return __builtin_return_address(98 + 1); case 99: return __builtin_return_address(99 + 1); } return 0; } int main() { return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030330-1.c ================================================ /* PR opt/10011 */ /* This is link test for builtin_constant_p simplification + DCE. */ extern void link_error(void); static void usb_hub_port_wait_reset(unsigned int delay) { int delay_time; for (delay_time = 0; delay_time < 500; delay_time += delay) { if (__builtin_constant_p(delay)) link_error(); } } int main() { return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030401-1.c ================================================ /* Testcase for PR fortran/9974. This was a miscompilation of the g77 front-end caused by the jump bypassing optimizations not handling instructions inserted on CFG edges. */ extern void abort (); int bar () { return 1; } void foo (int x) { unsigned char error = 0; if (! (error = ((x == 0) || bar ()))) bar (); if (! error) abort (); } int main() { foo (1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030403-1.c ================================================ /* The non-destructive folder was always emitting >= when folding comparisons to signed_max+1. */ #include int main () { unsigned long count = 8; if (count > INT_MAX) abort (); return (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030404-1.c ================================================ /* This exposed a bug in tree-ssa-ccp.c. Since 'j' and 'i' are never defined, CCP was not traversing the edges out of the if(), which caused the PHI node for 'k' at the top of the while to only be visited once. This ended up causing CCP to think that 'k' was the constant '1'. */ main() { int i, j, k; k = 0; while (k < 10) { k++; if (j > i) j = 5; else j =3; } if (k != 10) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030408-1.c ================================================ /* PR optimization/8634 */ /* Contributed by Glen Nakamura */ extern void abort (void); struct foo { char a, b, c, d, e, f, g, h, i, j; }; int test1 () { const char X[8] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' }; char buffer[8]; __builtin_memcpy (buffer, X, 8); if (buffer[0] != 'A' || buffer[1] != 'B' || buffer[2] != 'C' || buffer[3] != 'D' || buffer[4] != 'E' || buffer[5] != 'F' || buffer[6] != 'G' || buffer[7] != 'H') abort (); return 0; } int test2 () { const char X[10] = { 'A', 'B', 'C', 'D', 'E' }; char buffer[10]; __builtin_memcpy (buffer, X, 10); if (buffer[0] != 'A' || buffer[1] != 'B' || buffer[2] != 'C' || buffer[3] != 'D' || buffer[4] != 'E' || buffer[5] != '\0' || buffer[6] != '\0' || buffer[7] != '\0' || buffer[8] != '\0' || buffer[9] != '\0') abort (); return 0; } int test3 () { const struct foo X = { a : 'A', c : 'C', e : 'E', g : 'G', i : 'I' }; char buffer[10]; __builtin_memcpy (buffer, &X, 10); if (buffer[0] != 'A' || buffer[1] != '\0' || buffer[2] != 'C' || buffer[3] != '\0' || buffer[4] != 'E' || buffer[5] != '\0' || buffer[6] != 'G' || buffer[7] != '\0' || buffer[8] != 'I' || buffer[9] != '\0') abort (); return 0; } int test4 () { const struct foo X = { .b = 'B', .d = 'D', .f = 'F', .h = 'H' , .j = 'J' }; char buffer[10]; __builtin_memcpy (buffer, &X, 10); if (buffer[0] != '\0' || buffer[1] != 'B' || buffer[2] != '\0' || buffer[3] != 'D' || buffer[4] != '\0' || buffer[5] != 'F' || buffer[6] != '\0' || buffer[7] != 'H' || buffer[8] != '\0' || buffer[9] != 'J') abort (); return 0; } int main () { test1 (); test2 (); test3 (); test4 (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030501-1.c ================================================ int main (int argc, char **argv) { int size = 10; { int retframe_block() { return size + 5; } if (retframe_block() != 15) abort (); exit (0); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030606-1.c ================================================ int * foo (int *x, int b) { *(x++) = 55; if (b) *(x++) = b; return x; } main() { int a[5]; memset (a, 1, sizeof (a)); if (foo(a, 0) - a != 1 || a[0] != 55 || a[1] != a[4]) abort(); memset (a, 1, sizeof (a)); if (foo(a, 2) - a != 2 || a[0] != 55 || a[1] != 2) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030613-1.c ================================================ /* PR optimization/10955 */ /* Originator: */ /* This used to fail on SPARC32 at -O3 because the loop unroller wrongly thought it could eliminate a pseudo in a loop, while the pseudo was used outside the loop. */ extern void abort(void); #define COMPLEX struct CS COMPLEX { long x; long y; }; static COMPLEX CCID (COMPLEX x) { COMPLEX a; a.x = x.x; a.y = x.y; return a; } static COMPLEX CPOW (COMPLEX x, int y) { COMPLEX a; a = x; while (--y > 0) a=CCID(a); return a; } static int c5p (COMPLEX x) { COMPLEX a,b; a = CPOW (x, 2); b = CCID( CPOW(a,2) ); return (b.x == b.y); } int main (void) { COMPLEX x; x.x = -7; x.y = -7; if (!c5p(x)) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030626-1.c ================================================ char buf[10]; extern void abort (void); extern int sprintf (char*, const char*, ...); int main() { int l = sprintf (buf, "foo\0bar"); if (l != 3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030626-2.c ================================================ char buf[40]; extern int sprintf (char*, const char*, ...); extern void abort (void); int main() { int i = 0; int l = sprintf (buf, "%s", i++ ? "string" : "other string"); if (l != sizeof ("other string") - 1 || i != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030714-1.c ================================================ /* derived from PR optimization/11440 */ extern void abort (void); extern void exit (int); typedef _Bool bool; const bool false = 0; const bool true = 1; enum EPosition { STATIC, RELATIVE, ABSOLUTE, FIXED }; typedef enum EPosition EPosition; enum EFloat { FNONE = 0, FLEFT, FRIGHT }; typedef enum EFloat EFloat; struct RenderBox { int unused[6]; short m_verticalPosition; bool m_layouted : 1; bool m_unused : 1; bool m_minMaxKnown : 1; bool m_floating : 1; bool m_positioned : 1; bool m_overhangingContents : 1; bool m_relPositioned : 1; bool m_paintSpecial : 1; bool m_isAnonymous : 1; bool m_recalcMinMax : 1; bool m_isText : 1; bool m_inline : 1; bool m_replaced : 1; bool m_mouseInside : 1; bool m_hasFirstLine : 1; bool m_isSelectionBorder : 1; bool (*isTableCell) (struct RenderBox *this); }; typedef struct RenderBox RenderBox; struct RenderStyle { struct NonInheritedFlags { union { struct { unsigned int _display : 4; unsigned int _bg_repeat : 2; bool _bg_attachment : 1; unsigned int _overflow : 4 ; unsigned int _vertical_align : 4; unsigned int _clear : 2; EPosition _position : 2; EFloat _floating : 2; unsigned int _table_layout : 1; bool _flowAroundFloats :1; unsigned int _styleType : 3; bool _hasHover : 1; bool _hasActive : 1; bool _clipSpecified : 1; unsigned int _unicodeBidi : 2; int _unused : 1; } f; int _niflags; }; } noninherited_flags; }; typedef struct RenderStyle RenderStyle; extern void RenderObject_setStyle(RenderBox *this, RenderStyle *_style); extern void removeFromSpecialObjects(RenderBox *this); void RenderBox_setStyle(RenderBox *thisin, RenderStyle *_style) { RenderBox *this = thisin; bool oldpos, tmp; EPosition tmppo; tmp = this->m_positioned; oldpos = tmp; RenderObject_setStyle(this, _style); tmppo = _style->noninherited_flags.f._position; switch(tmppo) { case ABSOLUTE: case FIXED: { bool ltrue = true; this->m_positioned = ltrue; break; } default: { EFloat tmpf; EPosition tmpp; if (oldpos) { bool ltrue = true; this->m_positioned = ltrue; removeFromSpecialObjects(this); } { bool lfalse = false; this->m_positioned = lfalse; } tmpf = _style->noninherited_flags.f._floating; if(!this->isTableCell (this) && !(tmpf == FNONE)) { bool ltrue = true; this->m_floating = ltrue; } else { tmpp = _style->noninherited_flags.f._position; if (tmpp == RELATIVE) { bool ltrue = true; this->m_relPositioned = ltrue; } } } } } RenderBox g_this; RenderStyle g__style; void RenderObject_setStyle(RenderBox *this, RenderStyle *_style) { (void) this; (void) _style; } void removeFromSpecialObjects(RenderBox *this) { (void) this; } bool RenderBox_isTableCell (RenderBox *this) { (void) this; return false; } int main (void) { g_this.m_relPositioned = false; g_this.m_positioned = false; g_this.m_floating = false; g_this.isTableCell = RenderBox_isTableCell; g__style.noninherited_flags.f._position = FIXED; g__style.noninherited_flags.f._floating = FNONE; RenderBox_setStyle (&g_this, &g__style); if (g_this.m_positioned != true) abort (); if (g_this.m_relPositioned != false) abort (); if (g_this.m_floating != false) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030715-1.c ================================================ /* PR optimization/11320 */ /* Origin: Andreas Schwab */ /* Verify that the scheduler correctly computes the dependencies in the presence of conditional instructions. */ int strcmp (const char *, const char *); int ap_standalone; const char *ap_check_cmd_context (void *a, int b) { return 0; } const char *server_type (void *a, void *b, char *arg) { const char *err = ap_check_cmd_context (a, 0x01|0x02|0x04|0x08|0x10); if (err) return err; if (!strcmp (arg, "inetd")) ap_standalone = 0; else if (!strcmp (arg, "standalone")) ap_standalone = 1; else return "ServerType must be either 'inetd' or 'standalone'"; return 0; } int main () { server_type (0, 0, "standalone"); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030717-1.c ================================================ /* PR target/11087 This testcase was miscompiled on ppc64, because basic_induction_var called convert_modes, yet did not expect it to emit any new instructions. Those were emitted at the end of the function and destroyed during life analysis, while the program used uninitialized pseudos created by convert_modes. */ struct A { unsigned short a1; unsigned long a2; }; struct B { int b1, b2, b3, b4, b5; }; struct C { struct B c1[1]; int c2, c3; }; static int foo (int x) { return x < 0 ? -x : x; } int bar (struct C *x, struct A *y) { int a = x->c3; const int b = y->a1 >> 9; const unsigned long c = y->a2; int d = a; unsigned long e, f; f = foo (c - x->c1[d].b4); do { if (d <= 0) d = x->c2; d--; e = foo (c-x->c1[d].b4); if (e < f) a = d; } while (d != x->c3); x->c1[a].b4 = c + b; return a; } int main () { struct A a; struct C b; int c; a.a1 = 512; a.a2 = 4242; __builtin_memset (&b, 0, sizeof (b)); b.c1[0].b3 = 424242; b.c2 = 1; c = bar (&b, &a); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030718-1.c ================================================ /* PR c/10320 The function temp was not being emitted in a prerelease of 3.4 20030406. Contributed by pinskia@physics.uc.edu */ static inline void temp(); int main() { temp(); return 0; } static void temp(){} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030811-1.c ================================================ /* Origin: PR target/11535 from H. J. Lu */ /* { dg-require-effective-target return_address } */ void vararg (int i, ...) { (void) i; } int i0[0], i1; void test1 (void) { int a = (int) (long long) __builtin_return_address (0); vararg (0, a); } void test2 (void) { i0[0] = (int) (long long) __builtin_return_address (0); } void test3 (void) { i1 = (int) (long long) __builtin_return_address (0); } void test4 (void) { volatile long long a = (long long) __builtin_return_address (0); i0[0] = (int) a; } int main (void) { return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030821-1.c ================================================ extern void abort (void); int foo (int x) { if ((int) (x & 0x80ffffff) != (int) (0x8000fffe)) abort (); return 0; } int main () { return foo (0x8000fffe); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030828-1.c ================================================ const int *p; int bar (void) { return *p + 1; } main () { /* Variable 'i' is never used but it's aliased to a global pointer. The alias analyzer was not considering that 'i' may be used in the call to bar(). */ const int i = 5; p = &i; if (bar() != 6) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030828-2.c ================================================ struct rtx_def { int code; }; main() { int tmp[2]; struct rtx_def *r, s; int *p, *q; /* The alias analyzer was creating the same memory tag for r, p and q because 'struct rtx_def *' is type-compatible with 'int *'. However, the alias set of 'int[2]' is not the same as 'int *', so variable 'tmp' was deemed not aliased with anything. */ r = &s; r->code = 39; /* If 'r' wasn't declared, then q and tmp would have had the same memory tag. */ p = tmp; q = p + 1; *q = 0; tmp[1] = 39; if (*q != 39) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030903-1.c ================================================ /* Test that we don't let stmt.c think that the enumeration's values are the entire set of possibilities. Such an assumption is false for C, but true for other languages. */ enum X { X1 = 1, X2, X3, X4 }; static volatile enum X test = 0; static void y(int); int main() { switch (test) { case X1: y(1); break; case X2: y(2); break; case X3: y(3); break; case X4: y(4); break; } return 0; } static void y(int x) { abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030909-1.c ================================================ void abort (); void exit (int); void test(int x, int y) { if (x == y) abort (); } void foo(int x, int y) { if (x == y) goto a; else { a:; if (x == y) goto b; else { b:; if (x != y) test (x, y); } } } int main(void) { foo (0, 0); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030910-1.c ================================================ /* The gimplifier was inserting unwanted temporaries for REALPART_EXPR nodes. These need to be treated like a COMPONENT_REF so their address can be taken. */ int main() { __complex double dc; double *dp = &(__real dc); *dp = 3.14; if ((__real dc) != 3.14) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030913-1.c ================================================ /* Assignments via pointers pointing to global variables were being killed by SSA-DCE. Test contributed by Paul Brook */ int glob; void fn2(int ** q) { *q = &glob; } void test() { int *p; fn2(&p); *p=42; } int main() { test(); if (glob != 42) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030914-1.c ================================================ /* On IRIX 6, PB is passed partially in registers and partially on the stack, with an odd number of words in the register part. Check that the long double stack argument (PC) is still accessed properly. */ struct s { int val[16]; }; long double f (int pa, struct s pb, long double pc) { int i; for (i = 0; i < 16; i++) pc += pb.val[i]; return pc; } int main () { struct s x; int i; for (i = 0; i < 16; i++) x.val[i] = i + 1; if (f (1, x, 10000.0L) != 10136.0L) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030914-2.c ================================================ /* On IRIX 6, PA is passed partially in registers and partially on the stack. We therefore have two potential uses of pretend_args_size: one for the partial argument and one for the varargs save area. Make sure that these uses don't conflict. */ struct s { int i[18]; }; int f (struct s pa, int pb, ...) { return pb; } struct s gs; int main () { if (f (gs, 0x1234) != 0x1234) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030916-1.c ================================================ /* "i" overflows in f(). Check that x[i] is not treated as a giv. */ #include #if CHAR_BIT == 8 void f (unsigned int *x) { unsigned char i; int j; i = 0x10; for (j = 0; j < 0x10; j++) { i += 0xe8; x[i] = 0; i -= 0xe7; } } int main () { unsigned int x[256]; int i; for (i = 0; i < 256; i++) x[i] = 1; f (x); for (i = 0; i < 256; i++) if (x[i] != (i >= 0x08 && i < 0xf8)) abort (); exit (0); } #else int main () { exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030920-1.c ================================================ extern void abort (void); int main() { int hicount = 0; unsigned char *c; char *str = "\x7f\xff"; for (c = (unsigned char *)str; *c ; c++) { if (!(((unsigned int)(*c)) < 0x80)) hicount++; } if (hicount != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20030928-1.c ================================================ #include #if INT_MAX <= 32767 int main () { exit (0); } #else void get_addrs (const char**x, int *y) { x[0] = "a1111" + (y[0] - 0x10000) * 2; x[1] = "a1112" + (y[1] - 0x20000) * 2; x[2] = "a1113" + (y[2] - 0x30000) * 2; x[3] = "a1114" + (y[3] - 0x40000) * 2; x[4] = "a1115" + (y[4] - 0x50000) * 2; x[5] = "a1116" + (y[5] - 0x60000) * 2; x[6] = "a1117" + (y[6] - 0x70000) * 2; x[7] = "a1118" + (y[7] - 0x80000) * 2; } int main () { const char *x[8]; int y[8]; int i; for (i = 0; i < 8; i++) y[i] = 0x10000 * (i + 1); get_addrs (x, y); for (i = 0; i < 8; i++) if (*x[i] != 'a') abort (); exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20031003-1.c ================================================ /* PR optimization/9325 */ #include extern void abort (void); int f1() { return (int)2147483648.0f; } int f2() { return (int)(float)(2147483647); } int main() { #if INT_MAX == 2147483647 if (f1() != 2147483647) abort (); #ifdef __SPU__ /* SPU float rounds towards zero. */ if (f2() != 0x7fffff80) abort (); #else if (f2() != 2147483647) abort (); #endif #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20031010-1.c ================================================ /* A reminder to process ops in generate_expr_as_of_bb exactly once. */ long __attribute__((noinline)) foo (long ct, long cf, _Bool p1, _Bool p2, _Bool p3) { long diff; diff = ct - cf; if (p1) { if (p2) { if (p3) { long tmp = ct; ct = cf; cf = tmp; } diff = ct - cf; } return diff; } abort (); } int main () { if (foo(2, 3, 1, 1, 1) == 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20031011-1.c ================================================ /* Check that MAX_EXPR and MIN_EXPR are working properly. */ #define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) #define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) extern void abort (void); int main() { int ll_bitsize, ll_bitpos; int rl_bitsize, rl_bitpos; int end_bit; ll_bitpos = 32; ll_bitsize = 32; rl_bitpos = 0; rl_bitsize = 32; end_bit = MAX (ll_bitpos + ll_bitsize, rl_bitpos + rl_bitsize); if (end_bit != 64) abort (); end_bit = MAX (rl_bitpos + rl_bitsize, ll_bitpos + ll_bitsize); if (end_bit != 64) abort (); end_bit = MIN (ll_bitpos + ll_bitsize, rl_bitpos + rl_bitsize); if (end_bit != 32) abort (); end_bit = MIN (rl_bitpos + rl_bitsize, ll_bitpos + ll_bitsize); if (end_bit != 32) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20031012-1.c ================================================ /* PR optimization/8750 Used to fail under Cygwin with -O2 -fomit-frame-pointer Testcase by David B. Trout */ #if defined(STACK_SIZE) && STACK_SIZE < 16000 #define ARRAY_SIZE (STACK_SIZE / 2) #define STRLEN (ARRAY_SIZE - 9) #else #define ARRAY_SIZE 15000 #define STRLEN 13371 #endif extern void *memset (void *, int, __SIZE_TYPE__); extern void abort (void); static void foo () { char a[ARRAY_SIZE]; a[0]=0; memset( &a[0], 0xCD, STRLEN ); a[STRLEN]=0; if (strlen(a) != STRLEN) abort (); } int main ( int argc, char* argv[] ) { foo(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20031020-1.c ================================================ /* PR target/12654 The Alpha backend tried to do a >= 1024 as (a - 1024) >= 0, which fails for very large negative values. */ /* Origin: tg@swox.com */ #include extern void abort (void); void __attribute__((noinline)) foo (long x) { if (x >= 1024) abort (); } int main () { foo (LONG_MIN); foo (LONG_MIN + 10000); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20031201-1.c ================================================ /* Copyright (C) 2003 Free Software Foundation. PR target/13256 STRICT_LOW_PART was handled incorrectly in delay slots. Origin: Hans-Peter Nilsson. */ typedef struct { unsigned int e0 : 16; unsigned int e1 : 16; } s1; typedef struct { unsigned int e0 : 16; unsigned int e1 : 16; } s2; typedef struct { s1 i12; s2 i16; } io; static int test_length = 2; static io *i; static int m = 1; static int d = 1; static unsigned long test_t0; static unsigned long test_t1; void test(void) __attribute__ ((__noinline__)); extern int f1 (void *port) __attribute__ ((__noinline__)); extern void f0 (void) __attribute__ ((__noinline__)); int f1 (void *port) { int fail_count = 0; unsigned long tlen; s1 x0 = {0}; s2 x1 = {0}; i = port; x0.e0 = x1.e0 = 32; i->i12 = x0; i->i16 = x1; do f0(); while (test_t1); x0.e0 = x1.e0 = 8; i->i12 = x0; i->i16 = x1; test (); if (m) { unsigned long e = 1000000000 / 460800 * test_length; tlen = test_t1 - test_t0; if (((tlen-e) & 0x7FFFFFFF) > 1000) f0(); } if (d) { unsigned long e = 1000000000 / 460800 * test_length; tlen = test_t1 - test_t0; if (((tlen - e) & 0x7FFFFFFF) > 1000) f0(); } return fail_count != 0 ? 1 : 0; } int main () { io io0; f1 (&io0); abort (); } void test (void) { io *iop = i; if (iop->i12.e0 != 8 || iop->i16.e0 != 8) abort (); exit (0); } void f0 (void) { static int washere = 0; io *iop = i; if (washere++ || iop->i12.e0 != 32 || iop->i16.e0 != 32) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20031204-1.c ================================================ /* PR optimization/13260 */ #include typedef unsigned long u32; u32 in_aton(const char* x) { return 0x0a0b0c0d; } u32 root_nfs_parse_addr(char *name) { u32 addr; int octets = 0; char *cp, *cq; cp = cq = name; while (octets < 4) { while (*cp >= '0' && *cp <= '9') cp++; if (cp == cq || cp - cq > 3) break; if (*cp == '.' || octets == 3) octets++; if (octets < 4) cp++; cq = cp; } if (octets == 4 && (*cp == ':' || *cp == '\0')) { if (*cp == ':') *cp++ = '\0'; addr = in_aton(name); strcpy(name, cp); } else addr = (-1); return addr; } int main() { static char addr[] = "10.11.12.13:/hello"; u32 result = root_nfs_parse_addr(addr); if (result != 0x0a0b0c0d) { abort(); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20031211-1.c ================================================ struct a { unsigned int bitfield : 1; }; unsigned int x; main() { struct a a = {0}; x = 0xbeef; a.bitfield |= x; if (a.bitfield != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20031211-2.c ================================================ struct a { unsigned int bitfield : 3; }; int main() { struct a a; a.bitfield = 131; foo (a.bitfield); exit (0); } foo(unsigned int z) { if (z != 3) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20031214-1.c ================================================ /* PR optimization/10312 */ /* Originator: Peter van Hoof

*/ /* Verify that the strength reduction pass doesn't find illegitimate givs. */ struct { double a; int n[2]; } g = { 0., { 1, 2}}; int k = 0; void b (int *j) { } int main () { int j; for (j = 0; j < 2; j++) k = (k > g.n[j]) ? k : g.n[j]; k++; b (&j); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20031215-1.c ================================================ /* PR middle-end/13400 */ /* The following test used to fail at run-time with a write to read-only memory, caused by if-conversion converting a conditional write into an unconditional write. */ typedef struct {int c, l; char ch[3];} pstr; const pstr ao = {2, 2, "OK"}; const pstr * const a = &ao; void test1(void) { if (a->ch[a->l]) { ((char *)a->ch)[a->l] = 0; } } void test2(void) { if (a->ch[a->l]) { ((char *)a->ch)[a->l] = -1; } } void test3(void) { if (a->ch[a->l]) { ((char *)a->ch)[a->l] = 1; } } int main(void) { test1(); test2(); test3(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20031216-1.c ================================================ /* PR optimization/13313 */ /* Origin: Mike Lerwill */ extern void abort(void); void DisplayNumber (unsigned long v) { if (v != 0x9aL) abort(); } unsigned long ReadNumber (void) { return 0x009a0000L; } int main (void) { unsigned long tmp; tmp = (ReadNumber() & 0x00ff0000L) >> 16; DisplayNumber (tmp); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040208-1.c ================================================ int main () { long double x; x = 0x1.0p-500L; x *= 0x1.0p-522L; if (x != 0x1.0p-1022L) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040218-1.c ================================================ /* PR target/14209. Bug in cris.md, shrinking access size of postincrement. Origin: . */ long int xb (long int *y) __attribute__ ((__noinline__)); long int xw (long int *y) __attribute__ ((__noinline__)); short int yb (short int *y) __attribute__ ((__noinline__)); long int xb (long int *y) { long int xx = *y & 255; return xx + y[1]; } long int xw (long int *y) { long int xx = *y & 65535; return xx + y[1]; } short int yb (short int *y) { short int xx = *y & 255; return xx + y[1]; } int main (void) { long int y[] = {-1, 16000}; short int yw[] = {-1, 16000}; if (xb (y) != 16255 || xw (y) != 81535 || yb (yw) != 16255) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040223-1.c ================================================ /* { dg-require-effective-target alloca } */ #include #include void a(void *x,int y) { if (y != 1234) abort (); } int main() { a(strcpy(alloca(100),"abc"),1234); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040302-1.c ================================================ /* { dg-require-effective-target label_values } */ int code[]={0,0,0,0,1}; void foo(int x) { volatile int b; b = 0xffffffff; } void bar(int *pc) { static const void *l[] = {&&lab0, &&end}; foo(0); goto *l[*pc]; lab0: foo(0); pc++; goto *l[*pc]; end: return; } int main() { bar(code); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040307-1.c ================================================ int main() { int b = 0; struct { unsigned int bit0:1; unsigned int bit1:1; unsigned int bit2:1; unsigned int bit3:1; unsigned int bit4:1; unsigned int bit5:1; unsigned int bit6:1; unsigned int bit7:1; } sdata = {0x01}; while ( sdata.bit0-- > 0 ) { b++ ; if ( b > 100 ) break; } if (b != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040308-1.c ================================================ /* { dg-require-effective-target alloca } */ /* This used to fail on SPARC with an unaligned memory access. */ void foo(int n) { struct S { int i[n]; unsigned int b:1; int i2; } __attribute__ ((packed)) __attribute__ ((aligned (4))); struct S s; s.i2 = 0; } int main(void) { foo(4); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040309-1.c ================================================ extern void abort (); int foo(unsigned short x) { unsigned short y; y = x > 32767 ? x - 32768 : 0; return y; } int main() { if (foo (0) != 0) abort (); if (foo (32767) != 0) abort (); if (foo (32768) != 0) abort (); if (foo (32769) != 1) abort (); if (foo (65535) != 32767) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040311-1.c ================================================ /* Copyright (C) 2004 Free Software Foundation. Check that constant folding and RTL simplification of -(x >> y) doesn't break anything and produces the expected results. Written by Roger Sayle, 11th March 2004. */ extern void abort (void); #define INT_BITS (sizeof(int)*8) int test1(int x) { return -(x >> (INT_BITS-1)); } int test2(unsigned int x) { return -((int)(x >> (INT_BITS-1))); } int test3(int x) { int y; y = INT_BITS-1; return -(x >> y); } int test4(unsigned int x) { int y; y = INT_BITS-1; return -((int)(x >> y)); } int main() { if (test1(0) != 0) abort (); if (test1(1) != 0) abort (); if (test1(-1) != 1) abort (); if (test2(0) != 0) abort (); if (test2(1) != 0) abort (); if (test2((unsigned int)-1) != -1) abort (); if (test3(0) != 0) abort (); if (test3(1) != 0) abort (); if (test3(-1) != 1) abort (); if (test4(0) != 0) abort (); if (test4(1) != 0) abort (); if (test4((unsigned int)-1) != -1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040313-1.c ================================================ /* PR middle-end/14470 */ /* Origin: Lodewijk Voge */ extern void abort(void); int main() { int t[1025] = { 1024 }, d; d = 0; d = t[d]++; if (t[0] != 1025) abort(); if (d != 1024) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040319-1.c ================================================ int blah (int zzz) { int foo; if (zzz >= 0) return 1; foo = (zzz >= 0 ? (zzz) : -(zzz)); return foo; } main() { if (blah (-1) != 1) abort (); else exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040331-1.c ================================================ /* PR c++/14755 */ extern void abort (void); extern void exit (int); int main (void) { #if __INT_MAX__ >= 2147483647 struct { int count: 31; } s = { 0 }; while (s.count--) abort (); #elif __INT_MAX__ >= 32767 struct { int count: 15; } s = { 0 }; while (s.count--) abort (); #else /* Don't bother because __INT_MAX__ is too small. */ #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040409-1.c ================================================ #include extern void abort (); int test1(int x) { return x ^ INT_MIN; } unsigned int test1u(unsigned int x) { return x ^ (unsigned int)INT_MIN; } int test2(int x) { return x + INT_MIN; } unsigned int test2u(unsigned int x) { return x + (unsigned int)INT_MIN; } int test3(int x) { return x - INT_MIN; } unsigned int test3u(unsigned int x) { return x - (unsigned int)INT_MIN; } int test4(int x) { int y = INT_MIN; return x ^ y; } unsigned int test4u(unsigned int x) { unsigned int y = (unsigned int)INT_MIN; return x ^ y; } int test5(int x) { int y = INT_MIN; return x + y; } unsigned int test5u(unsigned int x) { unsigned int y = (unsigned int)INT_MIN; return x + y; } int test6(int x) { int y = INT_MIN; return x - y; } unsigned int test6u(unsigned int x) { unsigned int y = (unsigned int)INT_MIN; return x - y; } void test(int a, int b) { if (test1(a) != b) abort(); if (test2(a) != b) abort(); if (test3(a) != b) abort(); if (test4(a) != b) abort(); if (test5(a) != b) abort(); if (test6(a) != b) abort(); } void testu(unsigned int a, unsigned int b) { if (test1u(a) != b) abort(); if (test2u(a) != b) abort(); if (test3u(a) != b) abort(); if (test4u(a) != b) abort(); if (test5u(a) != b) abort(); if (test6u(a) != b) abort(); } int main() { #if INT_MAX == 2147483647 test(0x00000000,0x80000000); test(0x80000000,0x00000000); test(0x12345678,0x92345678); test(0x92345678,0x12345678); test(0x7fffffff,0xffffffff); test(0xffffffff,0x7fffffff); testu(0x00000000,0x80000000); testu(0x80000000,0x00000000); testu(0x12345678,0x92345678); testu(0x92345678,0x12345678); testu(0x7fffffff,0xffffffff); testu(0xffffffff,0x7fffffff); #endif #if INT_MAX == 32767 test(0x0000,0x8000); test(0x8000,0x0000); test(0x1234,0x9234); test(0x9234,0x1234); test(0x7fff,0xffff); test(0xffff,0x7fff); testu(0x0000,0x8000); testu(0x8000,0x0000); testu(0x1234,0x9234); testu(0x9234,0x1234); testu(0x7fff,0xffff); testu(0xffff,0x7fff); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040409-2.c ================================================ #include extern void abort (); int test1(int x) { return (x ^ INT_MIN) ^ 0x1234; } unsigned int test1u(unsigned int x) { return (x ^ (unsigned int)INT_MIN) ^ 0x1234; } int test2(int x) { return (x ^ 0x1234) ^ INT_MIN; } unsigned int test2u(unsigned int x) { return (x ^ 0x1234) ^ (unsigned int)INT_MIN; } int test3(int x) { return (x + INT_MIN) ^ 0x1234; } unsigned int test3u(unsigned int x) { return (x + (unsigned int)INT_MIN) ^ 0x1234; } int test4(int x) { return (x ^ 0x1234) + INT_MIN; } unsigned int test4u(unsigned int x) { return (x ^ 0x1234) + (unsigned int)INT_MIN; } int test5(int x) { return (x - INT_MIN) ^ 0x1234; } unsigned int test5u(unsigned int x) { return (x - (unsigned int)INT_MIN) ^ 0x1234; } int test6(int x) { return (x ^ 0x1234) - INT_MIN; } unsigned int test6u(unsigned int x) { return (x ^ 0x1234) - (unsigned int)INT_MIN; } int test7(int x) { int y = INT_MIN; int z = 0x1234; return (x ^ y) ^ z; } unsigned int test7u(unsigned int x) { unsigned int y = (unsigned int)INT_MIN; unsigned int z = 0x1234; return (x ^ y) ^ z; } int test8(int x) { int y = 0x1234; int z = INT_MIN; return (x ^ y) ^ z; } unsigned int test8u(unsigned int x) { unsigned int y = 0x1234; unsigned int z = (unsigned int)INT_MIN; return (x ^ y) ^ z; } int test9(int x) { int y = INT_MIN; int z = 0x1234; return (x + y) ^ z; } unsigned int test9u(unsigned int x) { unsigned int y = (unsigned int)INT_MIN; unsigned int z = 0x1234; return (x + y) ^ z; } int test10(int x) { int y = 0x1234; int z = INT_MIN; return (x ^ y) + z; } unsigned int test10u(unsigned int x) { unsigned int y = 0x1234; unsigned int z = (unsigned int)INT_MIN; return (x ^ y) + z; } int test11(int x) { int y = INT_MIN; int z = 0x1234; return (x - y) ^ z; } unsigned int test11u(unsigned int x) { unsigned int y = (unsigned int)INT_MIN; unsigned int z = 0x1234; return (x - y) ^ z; } int test12(int x) { int y = 0x1234; int z = INT_MIN; return (x ^ y) - z; } unsigned int test12u(unsigned int x) { unsigned int y = 0x1234; unsigned int z = (unsigned int)INT_MIN; return (x ^ y) - z; } void test(int a, int b) { if (test1(a) != b) abort(); if (test2(a) != b) abort(); if (test3(a) != b) abort(); if (test4(a) != b) abort(); if (test5(a) != b) abort(); if (test6(a) != b) abort(); if (test7(a) != b) abort(); if (test8(a) != b) abort(); if (test9(a) != b) abort(); if (test10(a) != b) abort(); if (test11(a) != b) abort(); if (test12(a) != b) abort(); } void testu(unsigned int a, unsigned int b) { if (test1u(a) != b) abort(); if (test2u(a) != b) abort(); if (test3u(a) != b) abort(); if (test4u(a) != b) abort(); if (test5u(a) != b) abort(); if (test6u(a) != b) abort(); if (test7u(a) != b) abort(); if (test8u(a) != b) abort(); if (test9u(a) != b) abort(); if (test10u(a) != b) abort(); if (test11u(a) != b) abort(); if (test12u(a) != b) abort(); } int main() { #if INT_MAX == 2147483647 test(0x00000000,0x80001234); test(0x00001234,0x80000000); test(0x80000000,0x00001234); test(0x80001234,0x00000000); test(0x7fffffff,0xffffedcb); test(0xffffffff,0x7fffedcb); testu(0x00000000,0x80001234); testu(0x00001234,0x80000000); testu(0x80000000,0x00001234); testu(0x80001234,0x00000000); testu(0x7fffffff,0xffffedcb); testu(0xffffffff,0x7fffedcb); #endif #if INT_MAX == 32767 test(0x0000,0x9234); test(0x1234,0x8000); test(0x8000,0x1234); test(0x9234,0x0000); test(0x7fff,0xedcb); test(0xffff,0x6dcb); testu(0x0000,0x9234); testu(0x8000,0x1234); testu(0x1234,0x8000); testu(0x9234,0x0000); testu(0x7fff,0xedcb); testu(0xffff,0x6dcb); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040409-3.c ================================================ #include extern void abort (); int test1(int x) { return ~(x ^ INT_MIN); } unsigned int test1u(unsigned int x) { return ~(x ^ (unsigned int)INT_MIN); } int test2(int x) { return ~(x + INT_MIN); } unsigned int test2u(unsigned int x) { return ~(x + (unsigned int)INT_MIN); } int test3(int x) { return ~(x - INT_MIN); } unsigned int test3u(unsigned int x) { return ~(x - (unsigned int)INT_MIN); } int test4(int x) { int y = INT_MIN; return ~(x ^ y); } unsigned int test4u(unsigned int x) { unsigned int y = (unsigned int)INT_MIN; return ~(x ^ y); } int test5(int x) { int y = INT_MIN; return ~(x + y); } unsigned int test5u(unsigned int x) { unsigned int y = (unsigned int)INT_MIN; return ~(x + y); } int test6(int x) { int y = INT_MIN; return ~(x - y); } unsigned int test6u(unsigned int x) { unsigned int y = (unsigned int)INT_MIN; return ~(x - y); } void test(int a, int b) { if (test1(a) != b) abort(); if (test2(a) != b) abort(); if (test3(a) != b) abort(); if (test4(a) != b) abort(); if (test5(a) != b) abort(); if (test6(a) != b) abort(); } void testu(unsigned int a, unsigned int b) { if (test1u(a) != b) abort(); if (test2u(a) != b) abort(); if (test3u(a) != b) abort(); if (test4u(a) != b) abort(); if (test5u(a) != b) abort(); if (test6u(a) != b) abort(); } int main() { #if INT_MAX == 2147483647 test(0x00000000,0x7fffffff); test(0x80000000,0xffffffff); test(0x12345678,0x6dcba987); test(0x92345678,0xedcba987); test(0x7fffffff,0x00000000); test(0xffffffff,0x80000000); testu(0x00000000,0x7fffffff); testu(0x80000000,0xffffffff); testu(0x12345678,0x6dcba987); testu(0x92345678,0xedcba987); testu(0x7fffffff,0x00000000); testu(0xffffffff,0x80000000); #endif #if INT_MAX == 32767 test(0x0000,0x7fff); test(0x8000,0xffff); test(0x1234,0x6dcb); test(0x9234,0xedcb); test(0x7fff,0x0000); test(0xffff,0x8000); testu(0x0000,0x7fff); testu(0x8000,0xffff); testu(0x1234,0x6dcb); testu(0x9234,0xedcb); testu(0x7fff,0x0000); testu(0xffff,0x8000); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040411-1.c ================================================ int sub1 (int i, int j) { typedef int c[i+2]; int x[10], y[10]; if (j == 2) { memcpy (x, y, 10 * sizeof (int)); return sizeof (c); } else return sizeof (c) * 3; } int main () { if (sub1 (20, 3) != 66 * sizeof (int)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040423-1.c ================================================ int sub1 (int i, int j) { typedef struct { int c[i+2]; }c; int x[10], y[10]; if (j == 2) { memcpy (x, y, 10 * sizeof (int)); return sizeof (c); } else return sizeof (c) * 3; } int main () { typedef struct { int c[22]; }c; if (sub1 (20, 3) != sizeof (c)*3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040520-1.c ================================================ /* PR 15454 */ void abort (); int main () { int foo; int bar (void) { int baz = 0; if (foo!=45) baz = foo; return baz; } foo = 1; if (!bar ()) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040625-1.c ================================================ /* From PR target/16176 */ struct __attribute__ ((packed)) s { struct s *next; }; struct s * __attribute__ ((noinline)) maybe_next (struct s *s, int t) { if (t) s = s->next; return s; } int main () { struct s s1, s2; s1.next = &s2; if (maybe_next (&s1, 1) != &s2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040629-1.c ================================================ /* { dg-require-effective-target int32plus } */ /* Test arithmetics on bitfields. */ #ifndef T extern void abort (void); extern void exit (int); #ifndef FIELDS1 #define FIELDS1 #endif #ifndef FIELDS2 #define FIELDS2 #endif struct { FIELDS1 unsigned int i : 6, j : 11, k : 15; FIELDS2 } b; struct { FIELDS1 unsigned int i : 5, j : 1, k : 26; FIELDS2 } c; struct { FIELDS1 unsigned int i : 16, j : 8, k : 8; FIELDS2 } d; unsigned int ret1 (void) { return b.i; } unsigned int ret2 (void) { return b.j; } unsigned int ret3 (void) { return b.k; } unsigned int ret4 (void) { return c.i; } unsigned int ret5 (void) { return c.j; } unsigned int ret6 (void) { return c.k; } unsigned int ret7 (void) { return d.i; } unsigned int ret8 (void) { return d.j; } unsigned int ret9 (void) { return d.k; } #define T(n, pre, post, op) \ void fn1_##n (unsigned int x) { pre b.i post; } \ void fn2_##n (unsigned int x) { pre b.j post; } \ void fn3_##n (unsigned int x) { pre b.k post; } \ void fn4_##n (unsigned int x) { pre c.i post; } \ void fn5_##n (unsigned int x) { pre c.j post; } \ void fn6_##n (unsigned int x) { pre c.k post; } \ void fn7_##n (unsigned int x) { pre d.i post; } \ void fn8_##n (unsigned int x) { pre d.j post; } \ void fn9_##n (unsigned int x) { pre d.k post; } #include "20040629-1.c" #undef T #define FAIL(n, i) abort () int main (void) { #define T(n, pre, post, op) \ b.i = 51; \ b.j = 636; \ b.k = 31278; \ c.i = 21; \ c.j = 1; \ c.k = 33554432; \ d.i = 26812; \ d.j = 156; \ d.k = 187; \ fn1_##n (3); \ if (ret1 () != (op (51, 3) & ((1 << 6) - 1))) \ FAIL (n, 1); \ b.i = 51; \ fn2_##n (251); \ if (ret2 () != (op (636, 251) & ((1 << 11) - 1))) \ FAIL (n, 2); \ b.j = 636; \ fn3_##n (13279); \ if (ret3 () != (op (31278, 13279) & ((1 << 15) - 1))) \ FAIL (n, 3); \ b.j = 31278; \ fn4_##n (24); \ if (ret4 () != (op (21, 24) & ((1 << 5) - 1))) \ FAIL (n, 4); \ c.i = 21; \ fn5_##n (1); \ if (ret5 () != (op (1, 1) & ((1 << 1) - 1))) \ FAIL (n, 5); \ c.j = 1; \ fn6_##n (264151); \ if (ret6 () != (op (33554432, 264151) & ((1 << 26) - 1))) \ FAIL (n, 6); \ c.k = 33554432; \ fn7_##n (713); \ if (ret7 () != (op (26812, 713) & ((1 << 16) - 1))) \ FAIL (n, 7); \ d.i = 26812; \ fn8_##n (17); \ if (ret8 () != (op (156, 17) & ((1 << 8) - 1))) \ FAIL (n, 8); \ d.j = 156; \ fn9_##n (199); \ if (ret9 () != (op (187, 199) & ((1 << 8) - 1))) \ FAIL (n, 9); \ d.k = 187; #include "20040629-1.c" #undef T return 0; } #else #ifndef opadd #define opadd(x, y) (x + y) #define opsub(x, y) (x - y) #define opinc(x, y) (x + 1) #define opdec(x, y) (x - 1) #define opand(x, y) (x & y) #define opior(x, y) (x | y) #define opxor(x, y) (x ^ y) #define opdiv(x, y) (x / y) #define oprem(x, y) (x % y) #define opadd3(x, y) (x + 3) #define opsub7(x, y) (x - 7) #define opand21(x, y) (x & 21) #define opior19(x, y) (x | 19) #define opxor37(x, y) (x ^ 37) #define opdiv17(x, y) (x / 17) #define oprem19(x, y) (x % 19) #endif T(1, , += x, opadd) T(2, ++, , opinc) T(3, , ++, opinc) T(4, , -= x, opsub) T(5, --, , opdec) T(6, , --, opdec) T(7, , &= x, opand) T(8, , |= x, opior) T(9, , ^= x, opxor) T(a, , /= x, opdiv) T(b, , %= x, oprem) T(c, , += 3, opadd3) T(d, , -= 7, opsub7) T(e, , &= 21, opand21) T(f, , |= 19, opior19) T(g, , ^= 37, opxor37) T(h, , /= 17, opdiv17) T(i, , %= 19, oprem19) #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040703-1.c ================================================ /* PR 16341 */ /* { dg-require-effective-target int32plus } */ #define PART_PRECISION (sizeof (cpp_num_part) * 8) typedef unsigned int cpp_num_part; typedef struct cpp_num cpp_num; struct cpp_num { cpp_num_part high; cpp_num_part low; int unsignedp; /* True if value should be treated as unsigned. */ int overflow; /* True if the most recent calculation overflowed. */ }; static int num_positive (cpp_num num, unsigned int precision) { if (precision > PART_PRECISION) { precision -= PART_PRECISION; return (num.high & (cpp_num_part) 1 << (precision - 1)) == 0; } return (num.low & (cpp_num_part) 1 << (precision - 1)) == 0; } static cpp_num num_trim (cpp_num num, unsigned int precision) { if (precision > PART_PRECISION) { precision -= PART_PRECISION; if (precision < PART_PRECISION) num.high &= ((cpp_num_part) 1 << precision) - 1; } else { if (precision < PART_PRECISION) num.low &= ((cpp_num_part) 1 << precision) - 1; num.high = 0; } return num; } /* Shift NUM, of width PRECISION, right by N bits. */ static cpp_num num_rshift (cpp_num num, unsigned int precision, unsigned int n) { cpp_num_part sign_mask; int x = num_positive (num, precision); if (num.unsignedp || x) sign_mask = 0; else sign_mask = ~(cpp_num_part) 0; if (n >= precision) num.high = num.low = sign_mask; else { /* Sign-extend. */ if (precision < PART_PRECISION) num.high = sign_mask, num.low |= sign_mask << precision; else if (precision < 2 * PART_PRECISION) num.high |= sign_mask << (precision - PART_PRECISION); if (n >= PART_PRECISION) { n -= PART_PRECISION; num.low = num.high; num.high = sign_mask; } if (n) { num.low = (num.low >> n) | (num.high << (PART_PRECISION - n)); num.high = (num.high >> n) | (sign_mask << (PART_PRECISION - n)); } } num = num_trim (num, precision); num.overflow = 0; return num; } #define num_zerop(num) ((num.low | num.high) == 0) #define num_eq(num1, num2) (num1.low == num2.low && num1.high == num2.high) cpp_num num_lshift (cpp_num num, unsigned int precision, unsigned int n) { if (n >= precision) { num.overflow = !num.unsignedp && !num_zerop (num); num.high = num.low = 0; } else { cpp_num orig; unsigned int m = n; orig = num; if (m >= PART_PRECISION) { m -= PART_PRECISION; num.high = num.low; num.low = 0; } if (m) { num.high = (num.high << m) | (num.low >> (PART_PRECISION - m)); num.low <<= m; } num = num_trim (num, precision); if (num.unsignedp) num.overflow = 0; else { cpp_num maybe_orig = num_rshift (num, precision, n); num.overflow = !num_eq (orig, maybe_orig); } } return num; } unsigned int precision = 64; unsigned int n = 16; cpp_num num = { 0, 3, 0, 0 }; int main() { cpp_num res = num_lshift (num, 64, n); if (res.low != 0x30000) abort (); if (res.high != 0) abort (); if (res.overflow != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040704-1.c ================================================ /* PR 16348: Make sure that condition-first false loops DTRT. */ extern void abort (); int main() { for (; 0 ;) { abort (); label: return 0; } goto label; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040705-1.c ================================================ /* { dg-require-effective-target int32plus } */ #define FIELDS1 long long l; #include "20040629-1.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040705-2.c ================================================ /* { dg-require-effective-target int32plus } */ #define FIELDS2 long long l; #include "20040629-1.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040706-1.c ================================================ int main () { int i; for (i = 0; i < 10; i++) continue; if (i < 10) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040707-1.c ================================================ struct s { char c1, c2; }; void foo (struct s s) { static struct s s1; s1 = s; } int main () { static struct s s2; foo (s2); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040709-1.c ================================================ /* { dg-require-effective-target int32plus } */ /* Test arithmetics on bitfields. */ extern void abort (void); extern void exit (int); unsigned int myrnd (void) { static unsigned int s = 1388815473; s *= 1103515245; s += 12345; return (s / 65536) % 2048; } #define T(S) \ struct S s##S; \ struct S retme##S (struct S x) \ { \ return x; \ } \ \ unsigned int fn1##S (unsigned int x) \ { \ struct S y = s##S; \ y.k += x; \ y = retme##S (y); \ return y.k; \ } \ \ unsigned int fn2##S (unsigned int x) \ { \ struct S y = s##S; \ y.k += x; \ y.k %= 15; \ return y.k; \ } \ \ unsigned int retit##S (void) \ { \ return s##S.k; \ } \ \ unsigned int fn3##S (unsigned int x) \ { \ s##S.k += x; \ return retit##S (); \ } \ \ void test##S (void) \ { \ int i; \ unsigned int mask, v, a, r; \ struct S x; \ char *p = (char *) &s##S; \ for (i = 0; i < sizeof (s##S); ++i) \ *p++ = myrnd (); \ if (__builtin_classify_type (s##S.l) == 8) \ s##S.l = 5.25; \ s##S.k = -1; \ mask = s##S.k; \ v = myrnd (); \ a = myrnd (); \ s##S.k = v; \ x = s##S; \ r = fn1##S (a); \ if (x.i != s##S.i || x.j != s##S.j \ || x.k != s##S.k || x.l != s##S.l \ || ((v + a) & mask) != r) \ abort (); \ v = myrnd (); \ a = myrnd (); \ s##S.k = v; \ x = s##S; \ r = fn2##S (a); \ if (x.i != s##S.i || x.j != s##S.j \ || x.k != s##S.k || x.l != s##S.l \ || ((((v + a) & mask) % 15) & mask) != r) \ abort (); \ v = myrnd (); \ a = myrnd (); \ s##S.k = v; \ x = s##S; \ r = fn3##S (a); \ if (x.i != s##S.i || x.j != s##S.j \ || s##S.k != r || x.l != s##S.l \ || ((v + a) & mask) != r) \ abort (); \ } struct A { unsigned int i : 6, l : 1, j : 10, k : 15; }; T(A) struct B { unsigned int i : 6, j : 11, k : 15; unsigned int l; }; T(B) struct C { unsigned int l; unsigned int i : 6, j : 11, k : 15; }; T(C) struct D { unsigned long long l : 6, i : 6, j : 23, k : 29; }; T(D) struct E { unsigned long long l, i : 12, j : 23, k : 29; }; T(E) struct F { unsigned long long i : 12, j : 23, k : 29, l; }; T(F) struct G { unsigned int i : 12, j : 13, k : 7; unsigned long long l; }; T(G) struct H { unsigned int i : 12, j : 11, k : 9; unsigned long long l; }; T(H) struct I { unsigned short i : 1, j : 6, k : 9; unsigned long long l; }; T(I) struct J { unsigned short i : 1, j : 8, k : 7; unsigned short l; }; T(J) struct K { unsigned int k : 6, l : 1, j : 10, i : 15; }; T(K) struct L { unsigned int k : 6, j : 11, i : 15; unsigned int l; }; T(L) struct M { unsigned int l; unsigned int k : 6, j : 11, i : 15; }; T(M) struct N { unsigned long long l : 6, k : 6, j : 23, i : 29; }; T(N) struct O { unsigned long long l, k : 12, j : 23, i : 29; }; T(O) struct P { unsigned long long k : 12, j : 23, i : 29, l; }; T(P) struct Q { unsigned int k : 12, j : 13, i : 7; unsigned long long l; }; T(Q) struct R { unsigned int k : 12, j : 11, i : 9; unsigned long long l; }; T(R) struct S { unsigned short k : 1, j : 6, i : 9; unsigned long long l; }; T(S) struct T { unsigned short k : 1, j : 8, i : 7; unsigned short l; }; T(T) struct U { unsigned short j : 6, k : 1, i : 9; unsigned long long l; }; T(U) struct V { unsigned short j : 8, k : 1, i : 7; unsigned short l; }; T(V) struct W { long double l; unsigned int k : 12, j : 13, i : 7; }; T(W) struct X { unsigned int k : 12, j : 13, i : 7; long double l; }; T(X) struct Y { unsigned int k : 12, j : 11, i : 9; long double l; }; T(Y) struct Z { long double l; unsigned int j : 13, i : 7, k : 12; }; T(Z) int main (void) { testA (); testB (); testC (); testD (); testE (); testF (); testG (); testH (); testI (); testJ (); testK (); testL (); testM (); testN (); testO (); testP (); testQ (); testR (); testS (); testT (); testU (); testV (); testW (); testX (); testY (); testZ (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040709-2.c ================================================ /* Test arithmetics on bitfields. */ /* { dg-require-effective-target int32plus } */ extern void abort (void); extern void exit (int); unsigned int myrnd (void) { static unsigned int s = 1388815473; s *= 1103515245; s += 12345; return (s / 65536) % 2048; } #define T(S) \ struct S s##S; \ struct S retme##S (struct S x) \ { \ return x; \ } \ \ unsigned int fn1##S (unsigned int x) \ { \ struct S y = s##S; \ y.k += x; \ y = retme##S (y); \ return y.k; \ } \ \ unsigned int fn2##S (unsigned int x) \ { \ struct S y = s##S; \ y.k += x; \ y.k %= 15; \ return y.k; \ } \ \ unsigned int retit##S (void) \ { \ return s##S.k; \ } \ \ unsigned int fn3##S (unsigned int x) \ { \ s##S.k += x; \ return retit##S (); \ } \ \ void test##S (void) \ { \ int i; \ unsigned int mask, v, a, r; \ struct S x; \ char *p = (char *) &s##S; \ for (i = 0; i < sizeof (s##S); ++i) \ *p++ = myrnd (); \ if (__builtin_classify_type (s##S.l) == 8) \ s##S.l = 5.25; \ s##S.k = -1; \ mask = s##S.k; \ v = myrnd (); \ a = myrnd (); \ s##S.k = v; \ x = s##S; \ r = fn1##S (a); \ if (x.i != s##S.i || x.j != s##S.j \ || x.k != s##S.k || x.l != s##S.l \ || ((v + a) & mask) != r) \ abort (); \ v = myrnd (); \ a = myrnd (); \ s##S.k = v; \ x = s##S; \ r = fn2##S (a); \ if (x.i != s##S.i || x.j != s##S.j \ || x.k != s##S.k || x.l != s##S.l \ || ((((v + a) & mask) % 15) & mask) != r) \ abort (); \ v = myrnd (); \ a = myrnd (); \ s##S.k = v; \ x = s##S; \ r = fn3##S (a); \ if (x.i != s##S.i || x.j != s##S.j \ || s##S.k != r || x.l != s##S.l \ || ((v + a) & mask) != r) \ abort (); \ } #define pck __attribute__((packed)) struct pck A { unsigned short i : 1, l : 1, j : 3, k : 11; }; T(A) struct pck B { unsigned short i : 4, j : 1, k : 11; unsigned int l; }; T(B) struct pck C { unsigned int l; unsigned short i : 4, j : 1, k : 11; }; T(C) struct pck D { unsigned long long l : 6, i : 6, j : 23, k : 29; }; T(D) struct pck E { unsigned long long l, i : 12, j : 23, k : 29; }; T(E) struct pck F { unsigned long long i : 12, j : 23, k : 29, l; }; T(F) struct pck G { unsigned short i : 1, j : 1, k : 6; unsigned long long l; }; T(G) struct pck H { unsigned short i : 6, j : 2, k : 8; unsigned long long l; }; T(H) struct pck I { unsigned short i : 1, j : 6, k : 1; unsigned long long l; }; T(I) struct pck J { unsigned short i : 1, j : 8, k : 7; unsigned short l; }; T(J) struct pck K { unsigned int k : 6, l : 1, j : 10, i : 15; }; T(K) struct pck L { unsigned int k : 6, j : 11, i : 15; unsigned int l; }; T(L) struct pck M { unsigned int l; unsigned short k : 6, j : 11, i : 15; }; T(M) struct pck N { unsigned long long l : 6, k : 6, j : 23, i : 29; }; T(N) struct pck O { unsigned long long l, k : 12, j : 23, i : 29; }; T(O) struct pck P { unsigned long long k : 12, j : 23, i : 29, l; }; T(P) struct pck Q { unsigned short k : 12, j : 1, i : 3; unsigned long long l; }; T(Q) struct pck R { unsigned short k : 2, j : 11, i : 3; unsigned long long l; }; T(R) struct pck S { unsigned short k : 1, j : 6, i : 9; unsigned long long l; }; T(S) struct pck T { unsigned short k : 1, j : 8, i : 7; unsigned short l; }; T(T) struct pck U { unsigned short j : 6, k : 1, i : 9; unsigned long long l; }; T(U) struct pck V { unsigned short j : 8, k : 1, i : 7; unsigned short l; }; T(V) struct pck W { long double l; unsigned int k : 12, j : 13, i : 7; }; T(W) struct pck X { unsigned int k : 12, j : 13, i : 7; long double l; }; T(X) struct pck Y { unsigned int k : 12, j : 11, i : 9; long double l; }; T(Y) struct pck Z { long double l; unsigned int j : 13, i : 7, k : 12; }; T(Z) int main (void) { testA (); testB (); testC (); testD (); testE (); testF (); testG (); testH (); testI (); testJ (); testK (); testL (); testM (); testN (); testO (); testP (); testQ (); testR (); testS (); testT (); testU (); testV (); testW (); testX (); testY (); testZ (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040805-1.c ================================================ #if __INT_MAX__ < 32768 || (defined(STACK_SIZE) && STACK_SIZE < 0x12000) int main () { exit (0); } #else int a[2] = { 2, 3 }; static int __attribute__((noinline)) bar (int x, void *b) { a[0]++; return x; } static int __attribute__((noinline)) foo (int x) { char buf[0x10000]; int y = a[0]; a[1] = y; x = bar (x, buf); y = bar (y, buf); return x + y; } int main () { if (foo (100) != 102) abort (); exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040811-1.c ================================================ /* { dg-require-effective-target int32plus } */ /* { dg-require-effective-target alloca } */ /* Ensure that we deallocate X when branching back before its declaration. */ void *volatile p; int main (void) { int n = 0; lab:; int x[n % 1000 + 1]; x[0] = 1; x[n % 1000] = 2; p = x; n++; if (n < 1000000) goto lab; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040820-1.c ================================================ /* PR rtl-optimization/17099 */ extern void exit (int); extern void abort (void); void check (int a) { if (a != 1) abort (); } void test (int a, int b) { check ((a ? 1 : 0) | (b ? 2 : 0)); } int main (void) { test (1, 0); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040823-1.c ================================================ /* Ensure that we create VUSE operands also for noreturn functions. */ #include #include int *pwarn; void bla (void) __attribute__ ((noreturn)); void bla (void) { if (!*pwarn) abort (); exit (0); } int main (void) { int warn; memset (&warn, 0, sizeof (warn)); pwarn = &warn; warn = 1; bla (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040831-1.c ================================================ /* This testcase was being miscompiled, because operand_equal_p returned that (unsigned long) d and (long) d are equal. */ extern void abort (void); extern void exit (int); int main (void) { double d = -12.0; long l = (d > 10000) ? (unsigned long) d : (long) d; if (l != -12) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20040917-1.c ================================================ /* submitted by kenneth zadeck */ static int test_var; /* the idea here is that not only is inlinable, inlinable but since it is static, the cgraph node will not be marked as output. The current version of the code ignores these cgraph nodes. */ void not_inlinable() __attribute__((noinline)); static void inlinable () { test_var = -10; } void not_inlinable () { inlinable(); } main () { test_var = 10; /* Variable test_var should be considered call-clobbered by the call to not_inlinable(). */ not_inlinable (); if (test_var == 10) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041011-1.c ================================================ typedef unsigned long long ull; volatile int gvol[32]; ull gull; #define MULTI(X) \ X( 1), X( 2), X( 3), X( 4), X( 5), X( 6), X( 7), X( 8), X( 9), X(10), \ X(11), X(12), X(13), X(14), X(15), X(16), X(17), X(18), X(19), X(20), \ X(21), X(22), X(23), X(24), X(25), X(26), X(27), X(28), X(29), X(30) #define DECLARE(INDEX) x##INDEX #define COPYIN(INDEX) x##INDEX = gvol[INDEX] #define COPYOUT(INDEX) gvol[INDEX] = x##INDEX #define BUILD_TEST(NAME, N) \ ull __attribute__((noinline)) \ NAME (int n, ull x) \ { \ while (n--) \ { \ int MULTI (DECLARE); \ MULTI (COPYIN); \ MULTI (COPYOUT); \ x += N; \ } \ return x; \ } #define RUN_TEST(NAME, N) \ if (NAME (3, ~0ULL) != N * 3 - 1) \ abort (); \ if (NAME (3, 0xffffffffULL) \ != N * 3 + 0xffffffffULL) \ abort (); #define DO_TESTS(DO_TEST) \ DO_TEST (t1, -2048) \ DO_TEST (t2, -513) \ DO_TEST (t3, -512) \ DO_TEST (t4, -511) \ DO_TEST (t5, -1) \ DO_TEST (t6, 1) \ DO_TEST (t7, 511) \ DO_TEST (t8, 512) \ DO_TEST (t9, 513) \ DO_TEST (t10, gull) \ DO_TEST (t11, -gull) DO_TESTS (BUILD_TEST) ull neg (ull x) { return -x; } int main () { gull = 100; DO_TESTS (RUN_TEST) if (neg (gull) != -100ULL) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041019-1.c ================================================ test_store_ccp (int i) { int *p, a, b, c; if (i < 5) p = &a; else if (i > 8) p = &b; else p = &c; *p = 10; b = 3; /* STORE-CCP was wrongfully propagating 10 into *p. */ return *p + 2; } test_store_copy_prop (int i) { int *p, a, b, c; if (i < 5) p = &a; else if (i > 8) p = &b; else p = &c; *p = i; b = i + 1; /* STORE-COPY-PROP was wrongfully propagating i into *p. */ return *p; } main() { int x; x = test_store_ccp (10); if (x == 12) abort (); x = test_store_copy_prop (9); if (x == 9) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041112-1.c ================================================ /* This was failing on Alpha because the comparison (p != -1) was rewritten as (p+1 != 0) and p+1 isn't allowed to wrap for pointers. */ extern void abort(void); typedef __SIZE_TYPE__ size_t; int global; static void *foo(int p) { if (p == 0) { global++; return &global; } return (void *)(size_t)-1; } int bar(void) { void *p; p = foo(global); if (p != (void *)(size_t)-1) return 1; global++; return 0; } int main(void) { global = 1; if (bar () != 0) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041113-1.c ================================================ #include void test (int x, ...) { va_list ap; int i; va_start (ap, x); if (va_arg (ap, int) != 1) abort (); if (va_arg (ap, int) != 2) abort (); if (va_arg (ap, int) != 3) abort (); if (va_arg (ap, int) != 4) abort (); } double a = 40.0; int main(int argc, char *argv[]) { test(0, 1, 2, 3, (int)(a / 10.0)); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041114-1.c ================================================ /* Verify that var <= 0 || ((long unsigned) (unsigned) (var - 1) < MAX_UNSIGNED_INT) gets folded to 1. */ #include void abort (void); void link_failure (void); volatile int v; void foo (int var) { if (!(var <= 0 || ((long unsigned) (unsigned) (var - 1) < UINT_MAX))) link_failure (); } int main (int argc, char **argv) { foo (v); return 0; } #ifndef __OPTIMIZE__ void link_failure (void) { abort (); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041124-1.c ================================================ struct s { _Complex unsigned short x; }; struct s gs = { 100 + 200i }; struct s __attribute__((noinline)) foo (void) { return gs; } int main () { if (foo ().x != gs.x) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041126-1.c ================================================ extern int abs (int); extern void abort (void); void check (int *p) { int i; for (i = 0; i < 5; ++i) if (p[i]) abort (); for (; i < 10; ++i) if (p[i] != i + 1) abort (); } int main (void) { int a[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; int i; for (i = -5; i < 0; i++) a[abs (i - 10) - 11] = 0; check (a); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041201-1.c ================================================ /* PR rtl-opt/15289 */ typedef struct { _Complex char a; _Complex char b; } Scc2; Scc2 s = { 1+2i, 3+4i }; int checkScc2 (Scc2 s) { return s.a != 1+2i || s.b != 3+4i; } int main (void) { return checkScc2 (s); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041210-1.c ================================================ /* The FR-V port used to fail this test because the andcc patterns wrongly claimed to set the C and V flags. */ #include int x[4] = { INT_MIN / 2, INT_MAX, 2, 4 }; int main () { if (x[0] < x[1]) if ((x[2] & x[3]) < 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041212-1.c ================================================ /* A function pointer compared with a void pointer should not be canonicalized. See PR middle-end/17564. */ void *f (void) __attribute__ ((__noinline__)); void * f (void) { return f; } int main (void) { if (f () != f) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041213-2.c ================================================ /* PR tree-optimization/18694 The dominator optimization didn't take the PHI evaluation order into account when threading an edge. */ extern void abort (void) __attribute__((noreturn)); extern void exit (int) __attribute__((noreturn)); void __attribute__((noinline)) foo (int i) { int next_n = 1; int j = 0; for (; i != 0; i--) { int n; for (n = next_n; j < n; j++) next_n++; if (j != n) abort (); } } int main (void) { foo (2); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041214-1.c ================================================ /* { dg-require-effective-target indirect_jumps } */ typedef long unsigned int size_t; extern void abort (void); extern char *strcpy (char *, const char *); extern int strcmp (const char *, const char *); typedef __builtin_va_list va_list; static const char null[] = "(null)"; int g (char *s, const char *format, va_list ap) { const char *f; const char *string; char spec; static const void *step0_jumps[] = { &&do_precision, &&do_form_integer, &&do_form_string, }; f = format; if (*f == '\0') goto all_done; do { spec = (*++f); goto *(step0_jumps[2]); /* begin switch table. */ do_precision: ++f; __builtin_va_arg (ap, int); spec = *f; goto *(step0_jumps[2]); do_form_integer: __builtin_va_arg (ap, unsigned long int); goto end; do_form_string: string = __builtin_va_arg (ap, const char *); strcpy (s, string); /* End of switch table. */ end: ++f; } while (*f != '\0'); all_done: return 0; } void f (char *s, const char *f, ...) { va_list ap; __builtin_va_start (ap, f); g (s, f, ap); __builtin_va_end (ap); } int main (void) { char buf[10]; f (buf, "%s", "asdf", 0); if (strcmp (buf, "asdf")) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041218-1.c ================================================ /* PR rtl-optimization/16968 */ /* Testcase by Jakub Jelinek */ struct T { unsigned int b, c, *d; unsigned char e; }; struct S { unsigned int a; struct T f; }; struct U { struct S g, h; }; struct V { unsigned int i; struct U j; }; extern void exit (int); extern void abort (void); void * dummy1 (void *x) { return ""; } void * dummy2 (void *x, void *y) { exit (0); } struct V * baz (unsigned int x) { static struct V v; __builtin_memset (&v, 0x55, sizeof (v)); return &v; } int check (void *x, struct S *y) { if (y->a || y->f.b || y->f.c || y->f.d || y->f.e) abort (); return 1; } static struct V * bar (unsigned int x, void *y) { const struct T t = { 0, 0, (void *) 0, 0 }; struct V *u; void *v; v = dummy1 (y); if (!v) return (void *) 0; u = baz (sizeof (struct V)); u->i = x; u->j.g.a = 0; u->j.g.f = t; u->j.h.a = 0; u->j.h.f = t; if (!check (v, &u->j.g) || !check (v, &u->j.h)) return (void *) 0; return u; } int foo (unsigned int *x, unsigned int y, void **z) { void *v; unsigned int i, j; *z = v = (void *) 0; for (i = 0; i < y; i++) { struct V *c; j = *x; switch (j) { case 1: c = bar (j, x); break; default: c = 0; break; } if (c) v = dummy2 (v, c); else return 1; } *z = v; return 0; } int main (void) { unsigned int one = 1; void *p; foo (&one, 1, &p); abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20041218-2.c ================================================ extern void abort (void); int test(int n) { struct s { char b[n]; } __attribute__((packed)); n++; return sizeof(struct s); } int main() { if (test(123) != 123) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050104-1.c ================================================ /* PR tree-optimization/19060 */ void abort (void); static long long min () { return -__LONG_LONG_MAX__ - 1; } void foo (long long j) { if (j > 10 || j < min ()) abort (); } int main (void) { foo (10); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050106-1.c ================================================ /* PR tree-optimization/19283 */ void abort (void); static inline unsigned short foo (unsigned int *p) { return *p; }; unsigned int u; int main () { if ((foo (&u) & 0x8000) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050107-1.c ================================================ typedef enum { C = 1, D = 2 } B; extern void abort (void); struct S { B __attribute__ ((mode (byte))) a; B __attribute__ ((mode (byte))) b; }; void foo (struct S *x) { if (x->a != C || x->b != D) abort (); } int main (void) { struct S s; s.a = C; s.b = D; foo (&s); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050111-1.c ================================================ /* PR middle-end/19084, rtl-optimization/19348 */ unsigned int foo (unsigned long long x) { unsigned int u; if (x == 0) return 0; u = (unsigned int) (x >> 32); return u; } unsigned long long bar (unsigned short x) { return (unsigned long long) x << 32; } extern void abort (void); int main (void) { if (sizeof (long long) != 8) return 0; if (foo (0) != 0) abort (); if (foo (0xffffffffULL) != 0) abort (); if (foo (0x25ff00ff00ULL) != 0x25) abort (); if (bar (0) != 0) abort (); if (bar (0x25) != 0x2500000000ULL) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050119-1.c ================================================ /* PR c/19342 */ typedef enum { A, B, C, D } E; struct S { E __attribute__ ((mode (__byte__))) a; E __attribute__ ((mode (__byte__))) b; E __attribute__ ((mode (__byte__))) c; E __attribute__ ((mode (__byte__))) d; }; extern void abort (void); extern void exit (int); void foo (struct S *s) { if (s->a != s->b) abort (); if (s->c != C) abort (); } int main (void) { struct S s[2]; s[0].a = B; s[0].b = B; s[0].c = C; s[0].d = D; s[1].a = D; s[1].b = C; s[1].c = B; s[1].d = A; foo (s); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050119-2.c ================================================ /* PR middle-end/19874 */ typedef enum { A, B, C, D } E; struct S { E __attribute__ ((mode (__byte__))) a; E __attribute__ ((mode (__byte__))) b; E __attribute__ ((mode (__byte__))) c; E __attribute__ ((mode (__byte__))) d; }; extern void abort (void); extern void exit (int); E foo (struct S *s) { if (s->a != s->b) abort (); if (s->c != C) abort (); return s->d; } int main (void) { struct S s[2]; s[0].a = B; s[0].b = B; s[0].c = C; s[0].d = D; s[1].a = D; s[1].b = C; s[1].c = B; s[1].d = A; if (foo (s) != D) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050121-1.c ================================================ /* PR middle-end/19551 */ extern void abort (); #define T(type, name) \ __attribute__((pure)) _Complex type \ foo_##name (int x) \ { \ _Complex type r; \ __real r = x + 1; \ __imag r = x - 1; \ return r; \ } \ \ void \ bar_##name (type *x) \ { \ *x = __real foo_##name (5); \ } \ \ void \ baz_##name (type *x) \ { \ *x = __imag foo_##name (5); \ } typedef long double ldouble_t; typedef long long llong; T (float, float) T (double, double) T (long double, ldouble_t) T (char, char) T (short, short) T (int, int) T (long, long) T (long long, llong) #undef T int main (void) { #define T(type, name) \ { \ type var = 0; \ bar_##name (&var); \ if (var != 6) \ abort (); \ var = 0; \ baz_##name (&var); \ if (var != 4) \ abort (); \ } T (float, float) T (double, double) T (long double, ldouble_t) T (char, char) T (short, short) T (int, int) T (long, long) T (long long, llong) return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050124-1.c ================================================ /* PR rtl-optimization/19579 */ extern void abort (void); int foo (int i, int j) { int k = i + 1; if (j) { if (k > 0) k++; else if (k < 0) k--; } return k; } int main (void) { if (foo (-2, 0) != -1) abort (); if (foo (-1, 0) != 0) abort (); if (foo (0, 0) != 1) abort (); if (foo (1, 0) != 2) abort (); if (foo (-2, 1) != -2) abort (); if (foo (-1, 1) != 0) abort (); if (foo (0, 1) != 2) abort (); if (foo (1, 1) != 3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050125-1.c ================================================ /* Verify that the CALL sideeffect isn't optimized away. */ /* Contributed by Greg Parker 25 Jan 2005 */ #include #include struct parse { char *next; char *end; int error; }; int seterr(struct parse *p, int err) { p->error = err; return 0; } void bracket_empty(struct parse *p) { if (((p->next < p->end) && (*p->next++) == ']') || seterr(p, 7)) { } } int main(int argc __attribute__((unused)), char **argv __attribute__((unused))) { struct parse p; p.next = p.end = (char *)0x12345; p.error = 0; bracket_empty(&p); if (p.error != 7) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050131-1.c ================================================ /* Verify that we do not lose side effects on a MOD expression. */ #include #include int foo (int a) { int x = 0 % a++; return a; } main() { if (foo (9) != 10) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050203-1.c ================================================ /* Reduced testcase extracted from Samba source code. */ #include static void __attribute__((__noinline__)) foo (unsigned char *p) { *p = 0x81; } static void __attribute__((__noinline__)) bar (int x) { asm (""); } int main() { unsigned char b; foo(&b); if (b & 0x80) { bar (b & 0x7f); exit (0); } else { bar (b & 1); abort (); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050215-1.c ================================================ /* PR middle-end/19857 */ typedef struct { char c[8]; } V #ifdef __ELF__ __attribute__ ((aligned (8))) #endif ; typedef __SIZE_TYPE__ size_t; V v; void abort (void); int main (void) { V *w = &v; if (((size_t) ((float *) ((size_t) w & ~(size_t) 3)) % 8) != 0 || ((size_t) w & 1)) { #ifndef __ELF__ if (((size_t) &v & 7) == 0) #endif abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050218-1.c ================================================ /* PR tree-optimization/19828 */ typedef __SIZE_TYPE__ size_t; extern size_t strlen (const char *s); extern int strncmp (const char *s1, const char *s2, size_t n); extern void abort (void); const char *a[16] = { "a", "bc", "de", "fgh" }; int foo (char *x, const char *y, size_t n) { size_t i, j = 0; for (i = 0; i < n; i++) { if (strncmp (x + j, a[i], strlen (a[i])) != 0) return 2; j += strlen (a[i]); if (y) j += strlen (y); } return 0; } int main (void) { if (foo ("abcde", (const char *) 0, 3) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050224-1.c ================================================ /* Origin: Mikael Pettersson and the Linux kernel. */ extern void abort (void); unsigned long a = 0xc0000000, b = 0xd0000000; unsigned long c = 0xc01bb958, d = 0xc0264000; unsigned long e = 0xc0288000, f = 0xc02d4378; void foo (int x, int y, int z) { if (x != 245 || y != 36 || z != 444) abort (); } int main (void) { unsigned long g; int h = 0, i = 0, j = 0; if (sizeof (unsigned long) < 4) return 0; for (g = a; g < b; g += 0x1000) if (g < c) h++; else if (g >= d && g < e) j++; else if (g < f) i++; foo (i, j, h); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050316-1.c ================================================ /* PR rtl-optimization/16104 */ /* { dg-require-effective-target int32plus } */ /* { dg-options "-Wno-psabi" } */ extern void abort (void); typedef int V2SI __attribute__ ((vector_size (8))); typedef unsigned int V2USI __attribute__ ((vector_size (8))); typedef short V2HI __attribute__ ((vector_size (4))); typedef unsigned int V2UHI __attribute__ ((vector_size (4))); int test1 (void) { return (long long) (V2SI) 0LL; } int test2 (V2SI x) { return (long long) x; } V2SI test3 (void) { return (V2SI) (long long) (int) (V2HI) 0; } V2SI test4 (V2HI x) { return (V2SI) (long long) (int) x; } V2SI test5 (V2USI x) { return (V2SI) x; } int main (void) { if (sizeof (short) != 2 || sizeof (int) != 4 || sizeof (long long) != 8) return 0; if (test1 () != 0) abort (); V2SI x = { 2, 2 }; if (test2 (x) != 2) abort (); union { V2SI x; int y[2]; V2USI z; long long l; } u; u.x = test3 (); if (u.y[0] != 0 || u.y[1] != 0) abort (); V2HI y = { 4, 4 }; union { V2SI x; long long y; } v; v.x = test4 (y); if (v.y != 0x40004) abort (); V2USI z = { 6, 6 }; u.x = test5 (z); if (u.y[0] != 6 || u.y[1] != 6) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050316-2.c ================================================ /* This testcase generates MMX instructions together with x87 instructions. Currently, there is no "emms" generated to switch between register sets, so the testcase fails for targets where MMX insns are enabled. */ /* { dg-options "-mno-mmx -Wno-psabi" { target { x86_64-*-* i?86-*-* } } } */ extern void abort (void); typedef int V2SI __attribute__ ((vector_size (8))); typedef unsigned int V2USI __attribute__ ((vector_size (8))); typedef float V2SF __attribute__ ((vector_size (8))); typedef short V2HI __attribute__ ((vector_size (4))); typedef unsigned int V2UHI __attribute__ ((vector_size (4))); long long test1 (V2SF x) { return (long long) (V2SI) x; } long long test2 (V2SF x) { return (long long) x; } long long test3 (V2SI x) { return (long long) (V2SF) x; } int main (void) { if (sizeof (short) != 2 || sizeof (int) != 4 || sizeof (long long) != 8) return 0; V2SF x = { 2.0, 2.0 }; union { long long l; float f[2]; int i[2]; } u; u.l = test1 (x); if (u.f[0] != 2.0 || u.f[1] != 2.0) abort (); V2SF y = { 6.0, 6.0 }; u.l = test2 (y); if (u.f[0] != 6.0 || u.f[1] != 6.0) abort (); V2SI z = { 4, 4 }; u.l = test3 (z); if (u.i[0] != 4 || u.i[1] != 4) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050316-3.c ================================================ /* { dg-options "-Wno-psabi" } */ extern void abort (void); typedef int V2SI __attribute__ ((vector_size (8))); typedef unsigned int V2USI __attribute__ ((vector_size (8))); typedef short V2HI __attribute__ ((vector_size (4))); typedef unsigned int V2UHI __attribute__ ((vector_size (4))); V2USI test1 (V2SI x) { return (V2USI) (V2SI) (long long) x; } long long test2 (V2SI x) { return (long long) (V2USI) (V2SI) (long long) x; } int main (void) { if (sizeof (short) != 2 || sizeof (int) != 4 || sizeof (long long) != 8) return 0; union { V2SI x; int y[2]; V2USI z; long long l; } u; V2SI a = { -3, -3 }; u.z = test1 (a); if (u.y[0] != -3 || u.y[1] != -3) abort (); u.l = test2 (a); if (u.y[0] != -3 || u.y[1] != -3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050410-1.c ================================================ int s = 200; int __attribute__((noinline)) foo (void) { return (signed char) (s - 100) - 5; } int main (void) { if (foo () != 95) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050502-1.c ================================================ /* PR rtl-optimization/21330 */ extern void abort (void); extern int strcmp (const char *, const char *); int __attribute__((noinline)) bar (const char **x) { return *(*x)++; } int __attribute__((noinline)) baz (int c) { return c != '@'; } void __attribute__((noinline)) foo (const char **w, char *x, _Bool y, _Bool z) { char c = bar (w); int i = 0; while (1) { x[i++] = c; c = bar (w); if (y && c == '\'') break; if (z && c == '\"') break; if (!y && !z && !baz (c)) break; } x[i] = 0; } int main (void) { char buf[64]; const char *p; p = "abcde'fgh"; foo (&p, buf, 1, 0); if (strcmp (p, "fgh") != 0 || strcmp (buf, "abcde") != 0) abort (); p = "ABCDEFG\"HI"; foo (&p, buf, 0, 1); if (strcmp (p, "HI") != 0 || strcmp (buf, "ABCDEFG") != 0) abort (); p = "abcd\"e'fgh"; foo (&p, buf, 1, 1); if (strcmp (p, "e'fgh") != 0 || strcmp (buf, "abcd") != 0) abort (); p = "ABCDEF'G\"HI"; foo (&p, buf, 1, 1); if (strcmp (p, "G\"HI") != 0 || strcmp (buf, "ABCDEF") != 0) abort (); p = "abcdef@gh"; foo (&p, buf, 0, 0); if (strcmp (p, "gh") != 0 || strcmp (buf, "abcdef") != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050502-2.c ================================================ /* PR target/21297 */ typedef __SIZE_TYPE__ size_t; extern int memcmp (const char *, const char *, size_t); extern void abort (); void foo (char *x) { int i; for (i = 0; i < 2; i++); x[i + i] = '\0'; } void bar (char *x) { int i; for (i = 0; i < 2; i++); x[i + i + i + i] = '\0'; } int main (void) { char x[] = "IJKLMNOPQR"; foo (x); if (memcmp (x, "IJKL\0NOPQR", sizeof x) != 0) abort (); x[4] = 'M'; bar (x); if (memcmp (x, "IJKLMNOP\0R", sizeof x) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050604-1.c ================================================ /* PR regression/21897 */ /* This testcase generates MMX instructions together with x87 instructions. Currently, there is no "emms" generated to switch between register sets, so the testcase fails for targets where MMX insns are enabled. */ /* { dg-options "-mno-mmx" { target { x86_64-*-* i?86-*-* } } } */ extern void abort (void); typedef short v4hi __attribute__ ((vector_size (8))); typedef float v4sf __attribute__ ((vector_size (16))); union { v4hi v; short s[4]; } u; union { v4sf v; float f[4]; } v; void foo (void) { unsigned int i; for (i = 0; i < 2; i++) u.v += (v4hi) { 12, 14 }; for (i = 0; i < 2; i++) v.v += (v4sf) { 18.0, 20.0, 22 }; } int main (void) { foo (); if (u.s[0] != 24 || u.s[1] != 28 || u.s[2] || u.s[3]) abort (); if (v.f[0] != 36.0 || v.f[1] != 40.0 || v.f[2] != 44.0 || v.f[3] != 0.0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050607-1.c ================================================ /* PR middle-end/21850 */ extern void abort (void); typedef int V2SI __attribute__ ((vector_size (8))); int main (void) { #if (__INT_MAX__ == 2147483647) \ && (__LONG_LONG_MAX__ == 9223372036854775807LL) if (((int)(long long)(V2SI){ 2, 2 }) != 2) abort (); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050613-1.c ================================================ /* PR tree-optimization/22043 */ extern void abort (void); struct A { int i; int j; int k; int l; }; struct B { struct A a; int r[1]; }; struct C { struct A a; int r[0]; }; struct D { struct A a; int r[]; }; void foo (struct A *x) { if (x->i != 0 || x->j != 5 || x->k != 0 || x->l != 0) abort (); } int main () { struct B b = { .a.j = 5 }; struct C c = { .a.j = 5 }; struct D d = { .a.j = 5 }; foo (&b.a); foo (&c.a); foo (&d.a); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050713-1.c ================================================ /* Test that sibling call is not used if there is an argument overlap. */ extern void abort (void); struct S { int a, b, c; }; int foo2 (struct S x, struct S y) { if (x.a != 3 || x.b != 4 || x.c != 5) abort (); if (y.a != 6 || y.b != 7 || y.c != 8) abort (); return 0; } int foo3 (struct S x, struct S y, struct S z) { foo2 (x, y); if (z.a != 9 || z.b != 10 || z.c != 11) abort (); return 0; } int bar2 (struct S x, struct S y) { return foo2 (y, x); } int bar3 (struct S x, struct S y, struct S z) { return foo3 (y, x, z); } int baz3 (struct S x, struct S y, struct S z) { return foo3 (y, z, x); } int main (void) { struct S a = { 3, 4, 5 }, b = { 6, 7, 8 }, c = { 9, 10, 11 }; bar2 (b, a); bar3 (b, a, c); baz3 (c, a, b); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050826-1.c ================================================ /* PR rtl-optimization/23561 */ struct A { char a1[1]; char a2[5]; char a3[1]; char a4[2048 - 7]; } a; typedef __SIZE_TYPE__ size_t; extern void *memset (void *, int, size_t); extern void *memcpy (void *, const void *, size_t); extern int memcmp (const void *, const void *, size_t); extern void abort (void); void bar (struct A *x) { size_t i; if (memcmp (x, "\1HELLO\1", sizeof "\1HELLO\1")) abort (); for (i = 0; i < sizeof (x->a4); i++) if (x->a4[i]) abort (); } int foo (void) { memset (&a, 0, sizeof (a)); a.a1[0] = 1; memcpy (a.a2, "HELLO", sizeof "HELLO"); a.a3[0] = 1; bar (&a); return 0; } int main (void) { foo (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050826-2.c ================================================ /* PR rtl-optimization/23560 */ struct rtattr { unsigned short rta_len; unsigned short rta_type; }; __attribute__ ((noinline)) int inet_check_attr (void *r, struct rtattr **rta) { int i; for (i = 1; i <= 14; i++) { struct rtattr *attr = rta[i - 1]; if (attr) { if (attr->rta_len - sizeof (struct rtattr) < 4) return -22; if (i != 9 && i != 8) rta[i - 1] = attr + 1; } } return 0; } extern void abort (void); int main (void) { struct rtattr rt[2]; struct rtattr *rta[14]; int i; rt[0].rta_len = sizeof (struct rtattr) + 8; rt[0].rta_type = 0; rt[1] = rt[0]; for (i = 0; i < 14; i++) rta[i] = &rt[0]; if (inet_check_attr (0, rta) != 0) abort (); for (i = 0; i < 14; i++) if (rta[i] != &rt[i != 7 && i != 8]) abort (); for (i = 0; i < 14; i++) rta[i] = &rt[0]; rta[1] = 0; rt[1].rta_len -= 8; rta[5] = &rt[1]; if (inet_check_attr (0, rta) != -22) abort (); for (i = 0; i < 14; i++) if (i == 1 && rta[i] != 0) abort (); else if (i != 1 && i <= 5 && rta[i] != &rt[1]) abort (); else if (i > 5 && rta[i] != &rt[0]) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20050929-1.c ================================================ /* PR middle-end/24109 */ extern void abort (void); struct A { int i; int j; }; struct B { struct A *a; struct A *b; }; struct C { struct B *c; struct A *d; }; struct C e = { &(struct B) { &(struct A) { 1, 2 }, &(struct A) { 3, 4 } }, &(struct A) { 5, 6 } }; int main (void) { if (e.c->a->i != 1 || e.c->a->j != 2) abort (); if (e.c->b->i != 3 || e.c->b->j != 4) abort (); if (e.d->i != 5 || e.d->j != 6) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20051012-1.c ================================================ /* { dg-require-effective-target untyped_assembly } */ extern void abort (void); struct type { int *a; int b:16; unsigned int p:9; } t; unsigned int foo () { return t.p; } int main (void) { t.p = 8; if (foo (t) != 8) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20051021-1.c ================================================ /* Verify that TRUTH_AND_EXPR is not wrongly changed to TRUTH_ANDIF_EXPR. */ extern void abort (void); int count = 0; int foo1(void) { count++; return 0; } int foo2(void) { count++; return 0; } int main(void) { if ((foo1() == 1) & (foo2() == 1)) abort (); if (count != 2) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20051104-1.c ================================================ /* PR rtl-optimization/23567 */ struct { int len; char *name; } s; int main (void) { s.len = 0; s.name = ""; if (s.name [s.len] != 0) s.name [s.len] = 0; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20051110-1.c ================================================ void add_unwind_adjustsp (long); void abort (void); unsigned char bytes[5]; void add_unwind_adjustsp (long offset) { int n; unsigned long o; o = (long) ((offset - 0x204) >> 2); n = 0; while (o) { bytes[n] = o & 0x7f; o >>= 7; if (o) bytes[n] |= 0x80; n++; } } int main(void) { add_unwind_adjustsp (4132); if (bytes[0] != 0x88 || bytes[1] != 0x07) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20051110-2.c ================================================ void add_unwind_adjustsp (long); void abort (void); unsigned char bytes[5]; int flag; void add_unwind_adjustsp (long offset) { int n; unsigned long o; o = (long) ((offset - 0x204) >> 2); n = 0; do { a: bytes[n] = o & 0x7f; o >>= 7; if (o) { bytes[n] |= 0x80; if (flag) goto a; } n++; } while (o); } int main(void) { add_unwind_adjustsp (4132); if (bytes[0] != 0x88 || bytes[1] != 0x07) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20051113-1.c ================================================ extern void *malloc(__SIZE_TYPE__); extern void *memset(void *, int, __SIZE_TYPE__); typedef struct { short a; unsigned short b; unsigned short c; unsigned long long Count; long long Count2; } __attribute__((packed)) Struct1; typedef struct { short a; unsigned short b; unsigned short c; unsigned long long d; long long e; long long f; } __attribute__((packed)) Struct2; typedef union { Struct1 a; Struct2 b; } Union; typedef struct { int Count; Union List[0]; } __attribute__((packed)) Struct3; unsigned long long Sum (Struct3 *instrs) __attribute__((noinline)); unsigned long long Sum (Struct3 *instrs) { unsigned long long count = 0; int i; for (i = 0; i < instrs->Count; i++) { count += instrs->List[i].a.Count; } return count; } long long Sum2 (Struct3 *instrs) __attribute__((noinline)); long long Sum2 (Struct3 *instrs) { long long count = 0; int i; for (i = 0; i < instrs->Count; i++) { count += instrs->List[i].a.Count2; } return count; } main() { Struct3 *p = malloc (sizeof (int) + 3 * sizeof(Union)); memset(p, 0, sizeof(int) + 3*sizeof(Union)); p->Count = 3; p->List[0].a.Count = 555; p->List[1].a.Count = 999; p->List[2].a.Count = 0x101010101ULL; p->List[0].a.Count2 = 555; p->List[1].a.Count2 = 999; p->List[2].a.Count2 = 0x101010101LL; if (Sum(p) != 555 + 999 + 0x101010101ULL) abort(); if (Sum2(p) != 555 + 999 + 0x101010101LL) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20051215-1.c ================================================ /* PR rtl-optimization/24899 */ extern void abort (void); __attribute__ ((noinline)) int foo (int x, int y, int *z) { int a, b, c, d; a = b = 0; for (d = 0; d < y; d++) { if (z) b = d * *z; for (c = 0; c < x; c++) a += b; } return a; } int main (void) { if (foo (3, 2, 0) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20060102-1.c ================================================ extern void abort (); int f(int x) { return (x >> (sizeof (x) * __CHAR_BIT__ - 1)) ? -1 : 1; } volatile int one = 1; int main (void) { /* Test that the function above returns different values for different signs. */ if (f(one) == f(-one)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20060110-1.c ================================================ extern void abort (void); long long f (long long a) { return (a << 32) >> 32; } long long a = 0x1234567876543210LL; long long b = (0x1234567876543210LL << 32) >> 32; int main () { if (f (a) != b) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20060110-2.c ================================================ extern void abort (void); long long f (long long a, long long b) { return ((a + b) << 32) >> 32; } long long a = 0x1234567876543210LL; long long b = 0x2345678765432101LL; long long c = ((0x1234567876543210LL + 0x2345678765432101LL) << 32) >> 32; int main () { if (f (a, b) != c) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20060127-1.c ================================================ void abort (); void f (long long a) { if ((a & 0xffffffffLL) != 0) abort (); } long long a = 0x1234567800000000LL; int main () { f (a); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20060412-1.c ================================================ extern void abort (void); struct S { long o; }; struct T { long o; struct S m[82]; }; struct T t; int main () { struct S *p, *q; p = (struct S *) &t; p = &((struct T *) p)->m[0]; q = p + 82; while (--q > p) q->o = -1; q->o = 0; if (q > p) abort (); if (q - p > 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20060420-1.c ================================================ extern void abort (void); typedef float v4flt __attribute__ ((vector_size (16))); void __attribute__ ((noinline)) foo (float *dst, float **src, int a, int n) { int i, j; int z = sizeof (v4flt) / sizeof (float); unsigned m = sizeof (v4flt) - 1; for (j = 0; j < n && (((unsigned long) dst + j) & m); ++j) { float t = src[0][j]; for (i = 1; i < a; ++i) t += src[i][j]; dst[j] = t; } for (; j < (n - (4 * z - 1)); j += 4 * z) { v4flt t0 = *(v4flt *) (src[0] + j + 0 * z); v4flt t1 = *(v4flt *) (src[0] + j + 1 * z); v4flt t2 = *(v4flt *) (src[0] + j + 2 * z); v4flt t3 = *(v4flt *) (src[0] + j + 3 * z); for (i = 1; i < a; ++i) { t0 += *(v4flt *) (src[i] + j + 0 * z); t1 += *(v4flt *) (src[i] + j + 1 * z); t2 += *(v4flt *) (src[i] + j + 2 * z); t3 += *(v4flt *) (src[i] + j + 3 * z); } *(v4flt *) (dst + j + 0 * z) = t0; *(v4flt *) (dst + j + 1 * z) = t1; *(v4flt *) (dst + j + 2 * z) = t2; *(v4flt *) (dst + j + 3 * z) = t3; } for (; j < n; ++j) { float t = src[0][j]; for (i = 1; i < a; ++i) t += src[i][j]; dst[j] = t; } } float buffer[64]; int main (void) { int i; float *dst, *src[2]; char *cptr; cptr = (char *)buffer; cptr += (-(long int) buffer & (16 * sizeof (float) - 1)); dst = (float *)cptr; src[0] = dst + 16; src[1] = dst + 32; for (i = 0; i < 16; ++i) { src[0][i] = (float) i + 11 * (float) i; src[1][i] = (float) i + 12 * (float) i; } foo (dst, src, 2, 16); for (i = 0; i < 16; ++i) { float e = (float) i + 11 * (float) i + (float) i + 12 * (float) i; if (dst[i] != e) abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20060905-1.c ================================================ /* PR rtl-optimization/28386 */ /* Origin: Volker Reichelt */ extern void abort(void); volatile char s[256][3]; char g; static void dummy(char a) { g = a; } static int foo(void) { int i, j=0; for (i = 0; i < 256; i++) if (i >= 128 && i < 256) { dummy (s[i - 128][0]); ++j; } return j; } int main(void) { if (foo () != 128) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20060910-1.c ================================================ /* PR rtl-optimization/28636 */ /* Origin: Andreas Schwab */ extern void abort(void); struct input_ty { unsigned char *buffer_position; unsigned char *buffer_end; }; int input_getc_complicated (struct input_ty *x) { return 0; } int check_header (struct input_ty *deeper) { unsigned len; for (len = 0; len < 6; len++) if (((deeper)->buffer_position < (deeper)->buffer_end ? *((deeper)->buffer_position)++ : input_getc_complicated((deeper))) < 0) return 0; return 1; } struct input_ty s; unsigned char b[6]; int main (void) { s.buffer_position = b; s.buffer_end = b + sizeof b; if (!check_header(&s)) abort(); if (s.buffer_position != s.buffer_end) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20060929-1.c ================================================ /* PR c/29154 */ extern void abort (void); void foo (int **p, int *q) { *(*p++)++ = *q++; } void bar (int **p, int *q) { **p = *q++; *(*p++)++; } void baz (int **p, int *q) { **p = *q++; (*p++)++; } int main (void) { int i = 42, j = 0; int *p = &i; foo (&p, &j); if (p - 1 != &i || j != 0 || i != 0) abort (); i = 43; p = &i; bar (&p, &j); if (p - 1 != &i || j != 0 || i != 0) abort (); i = 44; p = &i; baz (&p, &j); if (p - 1 != &i || j != 0 || i != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20060930-1.c ================================================ /* PR rtl-optimization/28096 */ /* Origin: Jan Stein */ extern void abort (void); int bar (int, int) __attribute__((noinline)); int bar (int a, int b) { if (b != 1) abort (); } void foo(int, int) __attribute__((noinline)); void foo (int e, int n) { int i, bb2, bb5; if (e > 0) e = -e; for (i = 0; i < n; i++) { if (e >= 0) { bb2 = 0; bb5 = 0; } else { bb5 = -e; bb2 = bb5; } bar (bb5, bb2); } } int main(void) { foo (1, 1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20060930-2.c ================================================ /* PR middle-end/29272 */ extern void abort (void); struct S { struct S *s; } s; struct T { struct T *t; } t; static inline void foo (void *s) { struct T *p = s; __builtin_memcpy (&p->t, &t.t, sizeof (t.t)); } void * __attribute__((noinline)) bar (void *p, struct S *q) { q->s = &s; foo (p); return q->s; } int main (void) { t.t = &t; if (bar (&s, &s) != (void *) &t) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20061031-1.c ================================================ /* PR rtl-optimization/29631 */ /* Origin: Falk Hueffner */ const signed char nunmap[] = { 17, -1, 1 }; __attribute__((noinline)) void ff(int i) { asm volatile(""); } __attribute__((noinline)) void f(short delta) { short p0 = 2, s; for (s = 0; s < 2; s++) { p0 += delta; ff(s); if (nunmap[p0] == 17) asm volatile(""); } } int main(void) { f(-1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20061101-1.c ================================================ /* PR rtl-optimization/28970 */ /* Origin: Peter Bergner */ /* { dg-require-effective-target int32plus } */ extern void abort (void); int tar (int i) { if (i != 36863) abort (); return -1; } void bug(int q, int bcount) { int j = 0; int outgo = 0; while(j != -1) { outgo++; if (outgo > q-1) outgo = q-1; j = tar (outgo*bcount); } } int main(void) { bug(5, 36863); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20061101-2.c ================================================ /* PR rtl-optimization/28970 */ /* Origin: Peter Bergner */ extern void abort (void); int tar (long i) { if (i != 36863) abort (); return -1; } void bug(int q, long bcount) { int j = 0; int outgo = 0; while(j != -1) { outgo++; if (outgo > q-1) outgo = q-1; j = tar (outgo*bcount); } } int main(void) { bug(5, 36863); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20061220-1.c ================================================ /* PR middle-end/30262 */ /* { dg-skip-if "asm statements do not work as expected" { rl78-*-* } "*" "" } */ extern void abort (void); int foo (void) { unsigned int x = 0; void nested (void) { x = 254; } nested (); asm volatile ("" :: "r" (x)); asm volatile ("" :: "m" (x)); asm volatile ("" :: "mr" (x)); asm volatile ("" : "=r" (x) : "0" (x)); asm volatile ("" : "=m" (x) : "m" (x)); return x; } int bar (void) { unsigned int x = 0; void nested (void) { asm volatile ("" :: "r" (x)); asm volatile ("" :: "m" (x)); asm volatile ("" :: "mr" (x)); x += 4; asm volatile ("" : "=r" (x) : "0" (x)); asm volatile ("" : "=m" (x) : "m" (x)); } nested (); return x; } int baz (void) { unsigned int x = 0; void nested (void) { void nested2 (void) { asm volatile ("" :: "r" (x)); asm volatile ("" :: "m" (x)); asm volatile ("" :: "mr" (x)); x += 4; asm volatile ("" : "=r" (x) : "0" (x)); asm volatile ("" : "=m" (x) : "m" (x)); } nested2 (); nested2 (); } nested (); return x; } int main (void) { if (foo () != 254 || bar () != 4 || baz () != 8) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20070201-1.c ================================================ /* PR middle-end/30473 */ extern int sprintf (char *, const char *, ...); extern void abort (void); char * foo (char *buf, char *p) { sprintf (buf, "abcde", p++); return p; } int main (void) { char buf[6]; if (foo (buf, &buf[2]) != &buf[3]) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20070212-1.c ================================================ struct f { int i; }; int g(int i, int c, struct f *ff, int *p) { int *t; if (c) t = &i; else t = &ff->i; *p = 0; return *t; } extern void abort(void); int main() { struct f f; f.i = 1; if (g(5, 0, &f, &f.i) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20070212-2.c ================================================ int f(int k, int i1, int j1) { int *f1; if(k) f1 = &i1; else f1 = &j1; i1 = 0; return *f1; } extern void abort (void); int main() { if (f(1, 1, 2) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20070212-3.c ================================================ struct foo { int i; int j; }; int bar (struct foo *k, int k2, int f, int f2) { int *p, *q; int res; if (f) p = &k->i; else p = &k->j; res = *p; k->i = 1; if (f2) q = p; else q = &k2; return res + *q; } extern void abort (void); int main() { struct foo k; k.i = 0; k.j = 1; if (bar (&k, 1, 1, 1) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20070424-1.c ================================================ extern void abort (void); extern void exit (int); void do_exit (void) { exit (0); } void do_abort (void) { abort (); } void foo (int x, int a) { if (x < a) goto doit; do_exit (); if (x != a) goto doit; /* else */ do_abort (); return; doit: do_abort (); } int main() { foo (1, 0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20070517-1.c ================================================ /* PR rtl-optimization/31691 */ /* Origin: Chi-Hua Chen */ extern void abort (void); static int get_kind(int) __attribute__ ((noinline)); static int get_kind(int v) { volatile int k = v; return k; } static int some_call(void) __attribute__ ((noinline)); static int some_call(void) { return 0; } static void example (int arg) { int tmp, kind = get_kind (arg); if (kind == 9 || kind == 10 || kind == 5) { if (some_call() == 0) { if (kind == 9 || kind == 10) tmp = arg; else abort(); } } } int main(void) { example(10); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20070614-1.c ================================================ extern void abort (void); _Complex v = 3.0 + 1.0iF; void foo (_Complex z, int *x) { if (z != v) abort (); } _Complex bar (_Complex z) __attribute__ ((pure)); _Complex bar (_Complex z) { return v; } int baz (void) { int a, i; for (i = 0; i < 6; i++) foo (bar (1.0iF * i), &a); return 0; } int main () { baz (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20070623-1.c ================================================ #include int __attribute__((noinline)) nge(int a, int b) {return -(a >= b);} int __attribute__((noinline)) ngt(int a, int b) {return -(a > b);} int __attribute__((noinline)) nle(int a, int b) {return -(a <= b);} int __attribute__((noinline)) nlt(int a, int b) {return -(a < b);} int __attribute__((noinline)) neq(int a, int b) {return -(a == b);} int __attribute__((noinline)) nne(int a, int b) {return -(a != b);} int __attribute__((noinline)) ngeu(unsigned a, unsigned b) {return -(a >= b);} int __attribute__((noinline)) ngtu(unsigned a, unsigned b) {return -(a > b);} int __attribute__((noinline)) nleu(unsigned a, unsigned b) {return -(a <= b);} int __attribute__((noinline)) nltu(unsigned a, unsigned b) {return -(a < b);} int main() { if (nge(INT_MIN, INT_MAX) != 0) abort(); if (nge(INT_MAX, INT_MIN) != -1) abort(); if (ngt(INT_MIN, INT_MAX) != 0) abort(); if (ngt(INT_MAX, INT_MIN) != -1) abort(); if (nle(INT_MIN, INT_MAX) != -1) abort(); if (nle(INT_MAX, INT_MIN) != 0) abort(); if (nlt(INT_MIN, INT_MAX) != -1) abort(); if (nlt(INT_MAX, INT_MIN) != 0) abort(); if (neq(INT_MIN, INT_MAX) != 0) abort(); if (neq(INT_MAX, INT_MIN) != 0) abort(); if (nne(INT_MIN, INT_MAX) != -1) abort(); if (nne(INT_MAX, INT_MIN) != -1) abort(); if (ngeu(0, ~0U) != 0) abort(); if (ngeu(~0U, 0) != -1) abort(); if (ngtu(0, ~0U) != 0) abort(); if (ngtu(~0U, 0) != -1) abort(); if (nleu(0, ~0U) != -1) abort(); if (nleu(~0U, 0) != 0) abort(); if (nltu(0, ~0U) != -1) abort(); if (nltu(~0U, 0) != 0) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20070724-1.c ================================================ void abort (void); static unsigned char magic[] = "\235"; static unsigned char value = '\235'; int main() { if (value != magic[0]) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20070824-1.c ================================================ /* PR tree-optimization/33136 */ /* { dg-require-effective-target alloca } */ extern void abort (void); struct S { struct S *a; int b; }; int main (void) { struct S *s = (struct S *) 0, **p, *n; for (p = &s; *p; p = &(*p)->a); n = (struct S *) __builtin_alloca (sizeof (*n)); n->a = *p; n->b = 1; *p = n; if (!s) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20070919-1.c ================================================ /* PR c/33238 */ /* { dg-require-effective-target alloca } */ typedef __SIZE_TYPE__ size_t; int memcmp (const void *, const void *, size_t); void abort (void); void __attribute__((noinline)) bar (void *x, void *y) { struct S { char w[8]; } *p = x, *q = y; if (memcmp (p->w, "zyxwvut", 8) != 0) abort (); if (memcmp (q[0].w, "abcdefg", 8) != 0) abort (); if (memcmp (q[1].w, "ABCDEFG", 8) != 0) abort (); if (memcmp (q[2].w, "zyxwvut", 8) != 0) abort (); if (memcmp (q[3].w, "zyxwvut", 8) != 0) abort (); } void __attribute__((noinline)) foo (void *x, int y) { struct S { char w[y]; } *p = x, a; int i; a = ({ struct S b; b = p[2]; p[3] = b; }); bar (&a, x); } int main (void) { struct S { char w[8]; } p[4] = { "abcdefg", "ABCDEFG", "zyxwvut", "ZYXWVUT" }; foo (p, 8); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071011-1.c ================================================ extern void abort(void); void foo(int *p) { int x; int y; x = *p; *p = 0; y = *p; if (x != y) return; abort (); } int main() { int a = 1; foo(&a); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071018-1.c ================================================ extern void abort(void); struct foo { int rank; char *name; }; struct mem { struct foo *x[4]; }; void __attribute__((noinline)) bar(struct foo **f) { *f = __builtin_malloc(sizeof(struct foo)); } struct foo * __attribute__((noinline, noclone)) foo(int rank) { void *x = __builtin_malloc(sizeof(struct mem)); struct mem *as = x; struct foo **upper = &as->x[rank * 8 - 5]; *upper = 0; bar(upper); return *upper; } int main() { if (foo(1) == 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071029-1.c ================================================ extern void exit (int); extern void abort (void); typedef union { struct { int f1, f2, f3, f4, f5, f6, f7, f8; long int f9, f10; int f11; } f; char s[56]; long int a; } T; __attribute__((noinline)) void test (T *t) { static int i = 11; if (t->f.f1 != i++) abort (); if (t->f.f2 || t->f.f3 || t->f.f4 || t->f.f5 || t->f.f6 || t->f.f7 || t->f.f8 || t->f.f9 || t->f.f10 || t->f.f11) abort (); if (i == 20) exit (0); } __attribute__((noinline)) void foo (int i) { T t; again: t = (T) { { ++i, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; test (&t); goto again; } int main (void) { T *t1, *t2; int cnt = 0; t1 = (T *) 0; loop: t2 = t1; t1 = & (T) { .f.f9 = cnt++ }; if (cnt < 3) goto loop; if (t1 != t2 || t1->f.f9 != 2) abort (); foo (10); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071030-1.c ================================================ /* PR target/11044 */ /* Originator: Tim McGrath */ /* Testcase contributed by Eric Botcazou */ /* Testcase copied from gcc.target/i386/loop-3.c */ extern void *memset (void *, int, __SIZE_TYPE__); extern void abort (void); typedef struct { unsigned char colormod; } entity_state_t; typedef struct { int num_entities; entity_state_t *entities; } packet_entities_t; typedef struct { double senttime; float ping_time; packet_entities_t entities; } client_frame_t; typedef enum { cs_free, cs_server, cs_zombie, cs_connected, cs_spawned } sv_client_state_t; typedef struct client_s { sv_client_state_t state; int ping; client_frame_t frames[64]; } client_t; int CalcPing (client_t *cl) { float ping; int count, i; register client_frame_t *frame; if (cl->state == cs_server) return cl->ping; ping = 0; count = 0; for (frame = cl->frames, i = 0; i < 64; i++, frame++) { if (frame->ping_time > 0) { ping += frame->ping_time; count++; } } if (!count) return 9999; ping /= count; return ping * 1000; } int main(void) { client_t cl; memset(&cl, 0, sizeof(cl)); cl.frames[0].ping_time = 1.0f; if (CalcPing(&cl) != 1000) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071108-1.c ================================================ /* PR tree-optimization/32575 */ extern void abort (void); struct S { void *s1, *s2; unsigned char s3, s4, s5; }; __attribute__ ((noinline)) void * foo (void) { static struct S s; return &s; } __attribute__ ((noinline)) void * bar () { return (void *) 0; } __attribute__ ((noinline)) struct S * test (void *a, void *b) { struct S *p, q; p = foo (); if (p == 0) { p = &q; __builtin_memset (p, 0, sizeof (*p)); } p->s1 = a; p->s2 = b; if (p == &q) p = 0; return p; } int main (void) { int a; int b; struct S *z = test ((void *) &a, (void *) &b); if (z == 0 || z->s1 != (void *) &a || z->s2 != (void *) &b || z->s3 || z->s4) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071120-1.c ================================================ extern void abort (void); void __attribute__((noinline,noreturn)) vec_assert_fail (void) { abort (); } struct ggc_root_tab { void *base; }; typedef struct deferred_access_check {} VEC_deferred_access_check_gc; typedef struct deferred_access { VEC_deferred_access_check_gc* deferred_access_checks; int deferring_access_checks_kind; } deferred_access; typedef struct VEC_deferred_access_base { unsigned num; deferred_access vec[1]; } VEC_deferred_access_base; static __inline__ deferred_access * VEC_deferred_access_base_last (VEC_deferred_access_base *vec_) { (void)((vec_ && vec_->num) ? 0 : (vec_assert_fail (), 0)); return &vec_->vec[vec_->num - 1]; } static __inline__ void VEC_deferred_access_base_pop (VEC_deferred_access_base *vec_) { (void)((vec_->num) ? 0 : (vec_assert_fail (), 0)); --vec_->num; } void __attribute__((noinline)) perform_access_checks (VEC_deferred_access_check_gc* p) { abort (); } typedef struct VEC_deferred_access_gc { VEC_deferred_access_base base; } VEC_deferred_access_gc; static VEC_deferred_access_gc *deferred_access_stack; static unsigned deferred_access_no_check; const struct ggc_root_tab gt_pch_rs_gt_cp_semantics_h[] = { { &deferred_access_no_check } }; void __attribute__((noinline)) pop_to_parent_deferring_access_checks (void) { if (deferred_access_no_check) deferred_access_no_check--; else { VEC_deferred_access_check_gc *checks; deferred_access *ptr; checks = (VEC_deferred_access_base_last(deferred_access_stack ? &deferred_access_stack->base : 0))->deferred_access_checks; VEC_deferred_access_base_pop(deferred_access_stack ? &deferred_access_stack->base : 0); ptr = VEC_deferred_access_base_last(deferred_access_stack ? &deferred_access_stack->base : 0); if (ptr->deferring_access_checks_kind == 0) perform_access_checks (checks); } } int main() { deferred_access_stack = __builtin_malloc (sizeof(VEC_deferred_access_gc) + sizeof(deferred_access) * 8); deferred_access_stack->base.num = 2; deferred_access_stack->base.vec[0].deferring_access_checks_kind = 1; pop_to_parent_deferring_access_checks (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071202-1.c ================================================ extern void abort (void); struct T { int t; int r[8]; }; struct S { int a; int b; int c[6]; struct T d; }; __attribute__((noinline)) void foo (struct S *s) { *s = (struct S) { s->b, s->a, { 0, 0, 0, 0, 0, 0 }, s->d }; } int main (void) { struct S s = { 6, 12, { 1, 2, 3, 4, 5, 6 }, { 7, { 8, 9, 10, 11, 12, 13, 14, 15 } } }; foo (&s); if (s.a != 12 || s.b != 6 || s.c[0] || s.c[1] || s.c[2] || s.c[3] || s.c[4] || s.c[5]) abort (); if (s.d.t != 7 || s.d.r[0] != 8 || s.d.r[1] != 9 || s.d.r[2] != 10 || s.d.r[3] != 11 || s.d.r[4] != 12 || s.d.r[5] != 13 || s.d.r[6] != 14 || s.d.r[7] != 15) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071205-1.c ================================================ /* PR middle-end/34337 */ extern void abort (void); int foo (int x) { return ((x << 8) & 65535) | 255; } int main (void) { if (foo (0x32) != 0x32ff || foo (0x174) != 0x74ff) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071210-1.c ================================================ /* PR rtl-optimization/34302 */ /* { dg-require-effective-target label_values } */ /* { dg-require-effective-target indirect_jumps } */ extern void abort (void); struct S { int n1, n2, n3, n4; }; __attribute__((noinline)) struct S foo (int x, int y, int z) { if (x != 10 || y != 9 || z != 8) abort (); struct S s = { 1, 2, 3, 4 }; return s; } __attribute__((noinline)) void ** bar (void **u, int *v) { void **w = u; int *s = v, x, y, z; void **p, **q; static void *l[] = { &&lab1, &&lab1, &&lab2, &&lab3, &&lab4 }; if (!u) return l; q = *w++; goto *q; lab2: p = q; q = *w++; x = s[2]; y = s[1]; z = s[0]; s -= 1; struct S r = foo (x, y, z); s[3] = r.n1; s[2] = r.n2; s[1] = r.n3; s[0] = r.n4; goto *q; lab3: p = q; q = *w++; s += 1; s[0] = 23; lab1: goto *q; lab4: return 0; } int main (void) { void **u = bar ((void **) 0, (int *) 0); void *t[] = { u[2], u[4] }; int s[] = { 7, 8, 9, 10, 11, 12 }; if (bar (t, &s[1]) != (void **) 0 || s[0] != 4 || s[1] != 3 || s[2] != 2 || s[3] != 1 || s[4] != 11 || s[5] != 12) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071211-1.c ================================================ extern void abort() __attribute__ ((noreturn)); struct s { unsigned long long f1 : 40; #if(__SIZEOF_INT__ >= 4) unsigned int f2 : 24; #else unsigned long int f2 : 24; #endif } sv; int main() { int f2; sv.f2 = (1 << 24) - 1; __asm__ volatile ("" : : : "memory"); ++sv.f2; f2 = sv.f2; if (f2 != 0) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071213-1.c ================================================ /* PR target/34281 */ #include extern void abort (void); void h (int x, va_list ap) { switch (x) { case 1: if (va_arg (ap, int) != 3 || va_arg (ap, int) != 4) abort (); return; case 5: if (va_arg (ap, int) != 9 || va_arg (ap, int) != 10) abort (); return; default: abort (); } } void f1 (int i, long long int j, ...) { va_list ap; va_start (ap, j); h (i, ap); if (i != 1 || j != 2) abort (); va_end (ap); } void f2 (int i, int j, int k, long long int l, ...) { va_list ap; va_start (ap, l); h (i, ap); if (i != 5 || j != 6 || k != 7 || l != 8) abort (); va_end (ap); } int main () { f1 (1, 2, 3, 4); f2 (5, 6, 7, 8, 9, 10); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071216-1.c ================================================ /* PR rtl-optimization/34490 */ extern void abort (void); static int x; int __attribute__((noinline)) bar (void) { return x; } int foo (void) { long int b = bar (); if ((unsigned long) b < -4095L) return b; if (-b != 38) b = -2; return b + 1; } int main (void) { x = 26; if (foo () != 26) abort (); x = -39; if (foo () != -1) abort (); x = -38; if (foo () != -37) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071219-1.c ================================================ /* PR c++/34459 */ extern void abort (void); extern void *memset (void *s, int c, __SIZE_TYPE__ n); struct S { char s[25]; }; struct S *p; void __attribute__((noinline,noclone)) foo (struct S *x, int set) { int i; for (i = 0; i < sizeof (x->s); ++i) if (x->s[i] != 0) abort (); else if (set) x->s[i] = set; p = x; } void __attribute__((noinline,noclone)) test1 (void) { struct S a; memset (&a.s, '\0', sizeof (a.s)); foo (&a, 0); struct S b = a; foo (&b, 1); b = a; b = b; foo (&b, 0); } void __attribute__((noinline,noclone)) test2 (void) { struct S a; memset (&a.s, '\0', sizeof (a.s)); foo (&a, 0); struct S b = a; foo (&b, 1); b = a; b = *p; foo (&b, 0); } void __attribute__((noinline,noclone)) test3 (void) { struct S a; memset (&a.s, '\0', sizeof (a.s)); foo (&a, 0); struct S b = a; foo (&b, 1); *p = a; *p = b; foo (&b, 0); } int main (void) { test1 (); test2 (); test3 (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071220-1.c ================================================ /* PR tree-optimization/29484 */ /* { dg-require-effective-target label_values } */ /* { dg-require-effective-target indirect_jumps } */ extern void abort (void); void *__attribute__((noinline)) baz (void **lab) { asm volatile ("" : "+r" (lab)); return *lab; } static inline int bar (void) { static void *b[] = { &&addr }; void *p = baz (b); goto *p; addr: return 17; } int __attribute__((noinline)) f1 (void) { return bar (); } int __attribute__((noinline)) f2 (void) { return bar (); } int main (void) { if (f1 () != 17 || f1 () != 17 || f2 () != 17 || f2 () != 17) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20071220-2.c ================================================ /* PR tree-optimization/29484 */ /* { dg-require-effective-target label_values } */ extern void abort (void); void *__attribute__((noinline)) baz (void **lab) { asm volatile ("" : "+r" (lab)); return *lab; } static inline int bar (void) { static void *b[] = { &&addr }; baz (b); addr: return 17; } int __attribute__((noinline)) f1 (void) { return bar (); } int __attribute__((noinline)) f2 (void) { return bar (); } int main (void) { if (f1 () != 17 || f1 () != 17 || f2 () != 17 || f2 () != 17) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080117-1.c ================================================ typedef struct gs_imager_state_s { struct { int half_width; int cap; float miter_limit; } line_params; } gs_imager_state; static const gs_imager_state gstate_initial = { { 1 } }; void gstate_path_memory(gs_imager_state *pgs) { *pgs = gstate_initial; } int gs_state_update_overprint(void) { return gstate_initial.line_params.half_width; } extern void abort (void); int main() { if (gs_state_update_overprint() != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080122-1.c ================================================ /* PR rtl-optimization/34628 */ /* Origin: Martin Michlmayr */ typedef unsigned short u16; typedef unsigned char u8; static void do_segfault(u8 in_buf[], const u8 out_buf[], const int len) { int i; for (i = 0; i < len; i++) { asm(""); in_buf[2*i] = ( out_buf[2*i] | out_buf[(2*i)+1]<<8 ) & 0xFF; asm(""); in_buf[(2*i)+1] = ( out_buf[2*i] | out_buf[(2*i)+1]<<8 ) >> 8; asm(""); } } int main(int argc, char *argv[]) { u8 outbuf[32] = "buffer "; u8 inbuf[32] = "\f"; asm(""); do_segfault(inbuf, outbuf, 12); asm(""); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080222-1.c ================================================ extern void abort (void); struct container { unsigned char data[1]; }; unsigned char space[6] = {1, 2, 3, 4, 5, 6}; int foo (struct container *p) { return p->data[4]; } int main () { if (foo ((struct container *) space) != 5) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080408-1.c ================================================ extern void abort (void); int main () { short ssi = 126; unsigned short usi = 65280; int fail = !(ssi < usi); if (fail) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080424-1.c ================================================ /* PR tree-optimization/36008 */ extern void abort (void); int g[48][3][3]; void __attribute__ ((noinline)) bar (int x[3][3], int y[3][3]) { static int i; if (x != g[i + 8] || y != g[i++]) abort (); } static inline void __attribute__ ((always_inline)) foo (int x[][3][3]) { int i; for (i = 0; i < 8; i++) { int k = i + 8; bar (x[k], x[k - 8]); } } int main () { foo (g); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080502-1.c ================================================ /* PR target/36090 */ extern void abort (void); long double __attribute__ ((noinline)) foo (long double x) { return __builtin_signbit (x) ? 3.1415926535897932384626433832795029L : 0.0; } int main (void) { if (foo (-1.0L) != 3.1415926535897932384626433832795029L) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080506-1.c ================================================ /* PR middle-end/36137 */ extern void abort (void); #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) int main () { unsigned int u; int i = -1; u = MAX ((unsigned int) MAX (i, 0), 1); if (u != 1) abort (); u = MIN ((unsigned int) MAX (i, 0), (unsigned int) i); if (u != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080506-2.c ================================================ /* PR middle-end/36013 */ extern void abort (void); void __attribute__((noinline)) foo (int **__restrict p, int **__restrict q) { *p[0] = 1; *q[0] = 2; if (*p[0] != 2) abort (); } int main (void) { int a; int *p1 = &a, *p2 = &a; foo (&p1, &p2); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080519-1.c ================================================ extern void abort (void); typedef unsigned long HARD_REG_SET[2]; HARD_REG_SET reg_class_contents[2]; struct du_chain { struct du_chain *next_use; int cl; }; void __attribute__((noinline)) merge_overlapping_regs (HARD_REG_SET *p) { if ((*p)[0] != -1 || (*p)[1] != -1) abort (); } void __attribute__((noinline)) regrename_optimize (struct du_chain *this) { HARD_REG_SET this_unavailable; unsigned long *scan_fp_; int n_uses; struct du_chain *last; this_unavailable[0] = 0; this_unavailable[1] = 0; n_uses = 0; for (last = this; last->next_use; last = last->next_use) { scan_fp_ = reg_class_contents[last->cl]; n_uses++; this_unavailable[0] |= ~ scan_fp_[0]; this_unavailable[1] |= ~ scan_fp_[1]; } if (n_uses < 1) return; scan_fp_ = reg_class_contents[last->cl]; this_unavailable[0] |= ~ scan_fp_[0]; this_unavailable[1] |= ~ scan_fp_[1]; merge_overlapping_regs (&this_unavailable); } int main() { struct du_chain du1 = { 0, 0 }; struct du_chain du0 = { &du1, 1 }; reg_class_contents[0][0] = -1; reg_class_contents[0][1] = -1; reg_class_contents[1][0] = 0; reg_class_contents[1][1] = 0; regrename_optimize (&du0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080522-1.c ================================================ /* This testcase is to make sure we have i in referenced vars and that we properly compute aliasing for the loads and stores. */ extern void abort (void); static int i; static int *p = &i; int __attribute__((noinline)) foo(int *q) { *p = 1; *q = 2; return *p; } int __attribute__((noinline)) bar(int *q) { *q = 2; *p = 1; return *q; } int main() { int j = 0; if (foo(&i) != 2) abort (); if (bar(&i) != 1) abort (); if (foo(&j) != 1) abort (); if (j != 2) abort (); if (bar(&j) != 2) abort (); if (j != 2) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080529-1.c ================================================ /* PR target/36362 */ extern void abort (void); int test (float c) { return !!c * 7LL == 0; } int main (void) { if (test (1.0f) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080604-1.c ================================================ struct barstruct { char const* some_string; } x; extern void abort (void); void __attribute__((noinline)) foo(void) { if (!x.some_string) abort (); } void baz(int b) { struct barstruct bar; struct barstruct* barptr; if (b) barptr = &bar; else { barptr = &x + 1; barptr = barptr - 1; } barptr->some_string = "Everything OK"; foo(); barptr->some_string = "Everything OK"; } int main() { x.some_string = (void *)0; baz(0); if (!x.some_string) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080719-1.c ================================================ typedef unsigned int u32; static const u32 deadfish = 0xdeadf155; static const u32 cfb_tab8_be[] = { 0x00000000,0x000000ff,0x0000ff00,0x0000ffff, 0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff, 0xff000000,0xff0000ff,0xff00ff00,0xff00ffff, 0xffff0000,0xffff00ff,0xffffff00,0xffffffff }; static const u32 cfb_tab8_le[] = { 0x00000000,0xff000000,0x00ff0000,0xffff0000, 0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00, 0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff, 0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff }; static const u32 cfb_tab16_be[] = { 0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff }; static const u32 cfb_tab16_le[] = { 0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff }; static const u32 cfb_tab32[] = { 0x00000000, 0xffffffff }; const u32 *xxx(int bpp) { const u32 *tab; if (0) return &deadfish; switch (bpp) { case 8: tab = cfb_tab8_be; break; case 16: tab = cfb_tab16_be; break; case 32: default: tab = cfb_tab32; break; } return tab; } int main(void) { const u32 *a = xxx(8); int b = a[0]; if (b != cfb_tab8_be[0]) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20080813-1.c ================================================ /* PR middle-end/37103 */ extern void abort (void); void foo (unsigned short x) { signed char y = -1; if (x == y) abort (); } void bar (unsigned short x) { unsigned char y = -1; if (x == y) abort (); } int main (void) { if (sizeof (int) == sizeof (short)) return 0; foo (-1); if (sizeof (short) > 1) bar (-1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20081103-1.c ================================================ struct S { char c; char arr[4]; float f; }; char A[4] = { '1', '2', '3', '4' }; void foo (struct S s) { if (__builtin_memcmp (s.arr, A, 4)) __builtin_abort (); } int main (void) { struct S s; __builtin_memcpy (s.arr, A, 4); foo (s); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20081112-1.c ================================================ #include extern void abort (void); static __attribute__((noinline)) void foo (int a) { int b = (a - 1) + INT_MIN; if (b != INT_MIN) abort (); } int main (void) { foo (1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20081117-1.c ================================================ /* { dg-require-effective-target int32plus } */ extern void abort (void); struct s { unsigned long long a:16; unsigned long long b:32; unsigned long long c:16; }; __attribute__ ((noinline)) unsigned f (struct s s, unsigned i) { return s.b == i; } struct s s = { 1, 0x87654321u, 2}; int main () { if (!f (s, 0x87654321u)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20081218-1.c ================================================ struct A { int i, j; char pad[512]; } a; int __attribute__((noinline)) foo (void) { __builtin_memset (&a, 0x26, sizeof a); return a.i; } void __attribute__((noinline)) bar (void) { __builtin_memset (&a, 0x36, sizeof a); a.i = 0x36363636; a.j = 0x36373636; } int main (void) { int i; if (sizeof (int) != 4 || __CHAR_BIT__ != 8) return 0; if (foo () != 0x26262626) __builtin_abort (); for (i = 0; i < sizeof a; i++) if (((char *)&a)[i] != 0x26) __builtin_abort (); bar (); if (a.j != 0x36373636) __builtin_abort (); a.j = 0x36363636; for (i = 0; i < sizeof a; i++) if (((char *)&a)[i] != 0x36) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20090113-1.c ================================================ typedef struct descriptor_dimension { int stride; int lbound; int ubound; } descriptor_dimension; typedef struct { int *data; int dtype; descriptor_dimension dim[7]; } gfc_array_i4; void msum_i4 (gfc_array_i4 * const retarray, gfc_array_i4 * const array, const int * const pdim) { int count[7]; int extent[7]; int * dest; const int * base; int dim; int n; int len; dim = (*pdim) - 1; len = array->dim[dim].ubound + 1 - array->dim[dim].lbound; for (n = 0; n < dim; n++) { extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound; count[n] = 0; } dest = retarray->data; base = array->data; do { int result = 0; for (n = 0; n < len; n++, base++) result += *base; *dest = result; count[0]++; dest += 1; } while (count[0] != extent[0]); } int main() { int rdata[3]; int adata[9]; gfc_array_i4 retarray = { rdata, 265, { { 1, 1, 3 } } }; gfc_array_i4 array = { adata, 266, { { 1, 1, 3 }, { 3, 1, 3 } } }; int dim = 2; msum_i4 (&retarray, &array, &dim); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20090113-2.c ================================================ struct obstack {}; struct bitmap_head_def; typedef struct bitmap_head_def *bitmap; typedef const struct bitmap_head_def *const_bitmap; typedef unsigned long BITMAP_WORD; typedef struct bitmap_obstack { struct bitmap_element_def *elements; struct bitmap_head_def *heads; struct obstack obstack; } bitmap_obstack; typedef struct bitmap_element_def { struct bitmap_element_def *next; struct bitmap_element_def *prev; unsigned int indx; BITMAP_WORD bits[((128 + (8 * 8 * 1u) - 1) / (8 * 8 * 1u))]; } bitmap_element; struct bitmap_descriptor; typedef struct bitmap_head_def { bitmap_element *first; bitmap_element *current; unsigned int indx; bitmap_obstack *obstack; } bitmap_head; bitmap_element bitmap_zero_bits; typedef struct { bitmap_element *elt1; bitmap_element *elt2; unsigned word_no; BITMAP_WORD bits; } bitmap_iterator; static void __attribute__((noinline)) bmp_iter_set_init (bitmap_iterator *bi, const_bitmap map, unsigned start_bit, unsigned *bit_no) { bi->elt1 = map->first; bi->elt2 = ((void *)0); while (1) { if (!bi->elt1) { bi->elt1 = &bitmap_zero_bits; break; } if (bi->elt1->indx >= start_bit / (((128 + (8 * 8 * 1u) - 1) / (8 * 8 * 1u)) * (8 * 8 * 1u))) break; bi->elt1 = bi->elt1->next; } if (bi->elt1->indx != start_bit / (((128 + (8 * 8 * 1u) - 1) / (8 * 8 * 1u)) * (8 * 8 * 1u))) start_bit = bi->elt1->indx * (((128 + (8 * 8 * 1u) - 1) / (8 * 8 * 1u)) * (8 * 8 * 1u)); bi->word_no = start_bit / (8 * 8 * 1u) % ((128 + (8 * 8 * 1u) - 1) / (8 * 8 * 1u)); bi->bits = bi->elt1->bits[bi->word_no]; bi->bits >>= start_bit % (8 * 8 * 1u); start_bit += !bi->bits; *bit_no = start_bit; } static void __attribute__((noinline)) bmp_iter_next (bitmap_iterator *bi, unsigned *bit_no) { bi->bits >>= 1; *bit_no += 1; } static unsigned char __attribute__((noinline)) bmp_iter_set_tail (bitmap_iterator *bi, unsigned *bit_no) { while (!(bi->bits & 1)) { bi->bits >>= 1; *bit_no += 1; } return 1; } static __inline__ unsigned char bmp_iter_set (bitmap_iterator *bi, unsigned *bit_no) { unsigned bno = *bit_no; BITMAP_WORD bits = bi->bits; bitmap_element *elt1; if (bits) { while (!(bits & 1)) { bits >>= 1; bno += 1; } *bit_no = bno; return 1; } *bit_no = ((bno + 64 - 1) / 64 * 64); bi->word_no++; elt1 = bi->elt1; while (1) { while (bi->word_no != 2) { bi->bits = elt1->bits[bi->word_no]; if (bi->bits) { bi->elt1 = elt1; return bmp_iter_set_tail (bi, bit_no); } *bit_no += 64; bi->word_no++; } elt1 = elt1->next; if (!elt1) { bi->elt1 = elt1; return 0; } *bit_no = elt1->indx * (2 * 64); bi->word_no = 0; } } extern void abort (void); static void __attribute__((noinline)) catchme(int i) { if (i != 0 && i != 64) abort (); } static void __attribute__((noinline)) foobar (bitmap_head *chain) { bitmap_iterator rsi; unsigned int regno; for (bmp_iter_set_init (&(rsi), (chain), (0), &(regno)); bmp_iter_set (&(rsi), &(regno)); bmp_iter_next (&(rsi), &(regno))) catchme(regno); } int main() { bitmap_element elem = { (void *)0, (void *)0, 0, { 1, 1 } }; bitmap_head live_throughout = { &elem, &elem, 0, (void *)0 }; foobar (&live_throughout); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20090113-3.c ================================================ struct obstack {}; struct bitmap_head_def; typedef struct bitmap_head_def *bitmap; typedef const struct bitmap_head_def *const_bitmap; typedef unsigned long BITMAP_WORD; typedef struct bitmap_obstack { struct bitmap_element_def *elements; struct bitmap_head_def *heads; struct obstack obstack; } bitmap_obstack; typedef struct bitmap_element_def { struct bitmap_element_def *next; struct bitmap_element_def *prev; unsigned int indx; BITMAP_WORD bits[(2)]; } bitmap_element; struct bitmap_descriptor; typedef struct bitmap_head_def { bitmap_element *first; bitmap_element *current; unsigned int indx; bitmap_obstack *obstack; } bitmap_head; bitmap_element bitmap_zero_bits; typedef struct { bitmap_element *elt1; bitmap_element *elt2; unsigned word_no; BITMAP_WORD bits; } bitmap_iterator; static __attribute__((noinline)) void bmp_iter_set_init (bitmap_iterator *bi, const_bitmap map, unsigned start_bit, unsigned *bit_no) { bi->elt1 = map->first; bi->elt2 = ((void *)0); while (1) { if (!bi->elt1) { bi->elt1 = &bitmap_zero_bits; break; } if (bi->elt1->indx >= start_bit / (128u)) break; bi->elt1 = bi->elt1->next; } if (bi->elt1->indx != start_bit / (128u)) start_bit = bi->elt1->indx * (128u); bi->word_no = start_bit / 64u % (2); bi->bits = bi->elt1->bits[bi->word_no]; bi->bits >>= start_bit % 64u; start_bit += !bi->bits; *bit_no = start_bit; } static __inline__ __attribute__((always_inline)) void bmp_iter_next (bitmap_iterator *bi, unsigned *bit_no) { bi->bits >>= 1; *bit_no += 1; } static __inline__ __attribute__((always_inline)) unsigned char bmp_iter_set (bitmap_iterator *bi, unsigned *bit_no) { if (bi->bits) { while (!(bi->bits & 1)) { bi->bits >>= 1; *bit_no += 1; } return 1; } *bit_no = ((*bit_no + 64u - 1) / 64u * 64u); bi->word_no++; while (1) { while (bi->word_no != (2)) { bi->bits = bi->elt1->bits[bi->word_no]; if (bi->bits) { while (!(bi->bits & 1)) { bi->bits >>= 1; *bit_no += 1; } return 1; } *bit_no += 64u; bi->word_no++; } bi->elt1 = bi->elt1->next; if (!bi->elt1) return 0; *bit_no = bi->elt1->indx * (128u); bi->word_no = 0; } } static void __attribute__((noinline)) foobar (bitmap_head *live_throughout) { bitmap_iterator rsi; unsigned int regno; for (bmp_iter_set_init (&(rsi), (live_throughout), (0), &(regno)); bmp_iter_set (&(rsi), &(regno)); bmp_iter_next (&(rsi), &(regno))) ; } int main() { bitmap_element elem = { (void *)0, (void *)0, 0, { 1, 1 } }; bitmap_head live_throughout = { &elem, &elem, 0, (void *)0 }; foobar (&live_throughout); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20090207-1.c ================================================ int foo(int i) { int a[32]; a[1] = 3; a[0] = 1; a[i] = 2; return a[0]; } extern void abort (void); int main() { if (foo (0) != 2 || foo (1) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20090219-1.c ================================================ /* On ARM, BAR used to get a bogus number in E due to stack misalignment. */ extern void abort (void); extern void exit (int); void foo (void) { int f = 0; void bar (int a, int b, int c, int d, int e) { if (e != 0) { f = 1; abort (); } } bar (0, 0, 0, 0, 0); } int main (void) { foo (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20090527-1.c ================================================ typedef enum { POSITION_ASIS, POSITION_UNSPECIFIED } unit_position; typedef enum { STATUS_UNKNOWN, STATUS_UNSPECIFIED } unit_status; typedef struct { unit_position position; unit_status status; } unit_flags; extern void abort (void); void new_unit (unit_flags * flags) { if (flags->status == STATUS_UNSPECIFIED) flags->status = STATUS_UNKNOWN; if (flags->position == POSITION_UNSPECIFIED) flags->position = POSITION_ASIS; switch (flags->status) { case STATUS_UNKNOWN: break; default: abort (); } } int main() { unit_flags f; f.status = STATUS_UNSPECIFIED; new_unit (&f); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20090623-1.c ================================================ int * __restrict__ x; int foo (int y) { *x = y; return *x; } extern void abort (void); int main() { int i = 0; x = &i; if (foo(1) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20090711-1.c ================================================ /* Used to be miscompiled at -O0 due to incorrect choice of sign extension vs. zero extension. __attribute__ ((noinline)) added to try to make it fail at higher optimization levels too. */ extern void abort (void); long long __attribute__ ((noinline)) div (long long val) { return val / 32768; } int main (void) { long long d1 = -990000000; long long d2 = div(d1); if (d2 != -30212) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20090814-1.c ================================================ int __attribute__((noinline)) bar (int *a) { return *a; } int i; int __attribute__((noinline)) foo (int (*a)[2]) { return bar (&(*a)[i]); } extern void abort (void); int a[2]; int main() { a[0] = -1; a[1] = 42; i = 1; if (foo (&a) != 42) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20091229-1.c ================================================ long long foo(long long v) { return v / -0x080000000LL; } int main(int argc, char **argv) { if (foo(0x080000000LL) != -1) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20100209-1.c ================================================ int bar(int foo) { return (int)(((unsigned long long)(long long)foo) / 8); } extern void abort (void); int main() { if (sizeof (long long) > sizeof (int) && bar(-1) != -1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20100316-1.c ================================================ struct Foo { int i; unsigned precision : 10; unsigned blah : 3; } f; int __attribute__((noinline,noclone)) foo (struct Foo *p) { struct Foo *q = p; return (*q).precision; } extern void abort (void); int main() { f.i = -1; f.precision = 0; f.blah = -1; if (foo (&f) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20100416-1.c ================================================ void abort(void); int movegt(int x, int y, long long a) { int i; int ret = 0; for (i = 0; i < y; i++) { if (a >= (long long) 0xf000000000000000LL) ret = x; else ret = y; } return ret; } struct test { long long val; int ret; } tests[] = { { 0xf000000000000000LL, -1 }, { 0xefffffffffffffffLL, 1 }, { 0xf000000000000001LL, -1 }, { 0x0000000000000000LL, -1 }, { 0x8000000000000000LL, 1 }, }; int main() { int i; for (i = 0; i < sizeof (tests) / sizeof (tests[0]); i++) { if (movegt (-1, 1, tests[i].val) != tests[i].ret) abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20100430-1.c ================================================ /* This used to generate unaligned accesses at -O2 because of IVOPTS. */ struct packed_struct { struct packed_struct1 { unsigned char cc11; unsigned char cc12; } __attribute__ ((packed)) pst1; struct packed_struct2 { unsigned char cc21; unsigned char cc22; unsigned short ss[104]; unsigned char cc23[13]; } __attribute__ ((packed)) pst2[4]; } __attribute__ ((packed)); typedef struct { int ii; struct packed_struct buf; } info_t; static unsigned short g; static void __attribute__((noinline)) dummy (unsigned short s) { g = s; } static int foo (info_t *info) { int i, j; for (i = 0; i < info->buf.pst1.cc11; i++) for (j = 0; j < info->buf.pst2[i].cc22; j++) dummy (info->buf.pst2[i].ss[j]); return 0; } int main(void) { info_t info; info.buf.pst1.cc11 = 2; info.buf.pst2[0].cc22 = info.buf.pst2[1].cc22 = 8; return foo (&info); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20100708-1.c ================================================ /* PR middle-end/44843 */ /* Verify that we don't use the alignment of struct S for inner accesses. */ struct S { double for_alignment; struct { int x, y, z; } a[16]; }; void f(struct S *s) __attribute__((noinline)); void f(struct S *s) { unsigned int i; for (i = 0; i < 16; ++i) { s->a[i].x = 0; s->a[i].y = 0; s->a[i].z = 0; } } int main (void) { struct S s; f (&s); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20100805-1.c ================================================ unsigned int foo (unsigned int a, unsigned int b) { unsigned i; a = a & 1; for (i = 0; i < b; ++i) a = a << 1 | a >> (sizeof (unsigned int) * 8 - 1); return a; } extern void abort (void); int main() { if (foo (1, sizeof (unsigned int) * 8 + 1) != 2) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20100827-1.c ================================================ extern void abort (void); int __attribute__((noinline,noclone)) foo (char *p) { int h = 0; do { if (*p == '\0') break; ++h; if (p == 0) abort (); ++p; } while (1); return h; } int main() { if (foo("a") != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20101011-1.c ================================================ /* { dg-options "-fnon-call-exceptions" } */ /* With -fnon-call-exceptions 0 / 0 should not be eliminated. */ #ifdef SIGNAL_SUPPRESS # define DO_TEST 0 #elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) || defined (__POWERPC__) || defined (__ppc) /* On PPC division by zero does not trap. */ # define DO_TEST 0 #elif defined (__SPU__) /* On SPU division by zero does not trap. */ # define DO_TEST 0 #elif defined (__sh__) /* On SH division by zero does not trap. */ # define DO_TEST 0 #elif defined (__v850__) /* On V850 division by zero does not trap. */ # define DO_TEST 0 #elif defined (__MSP430__) /* On MSP430 division by zero does not trap. */ # define DO_TEST 0 #elif defined (__RL78__) /* On RL78 division by zero does not trap. */ # define DO_TEST 0 #elif defined (__RX__) /* On RX division by zero does not trap. */ # define DO_TEST 0 #elif defined (__aarch64__) /* On AArch64 integer division by zero does not trap. */ # define DO_TEST 0 #elif defined (__TMS320C6X__) /* On TI C6X division by zero does not trap. */ # define DO_TEST 0 #elif defined (__VISIUM__) /* On Visium division by zero does not trap. */ # define DO_TEST 0 #elif defined (__mips__) && !defined(__linux__) /* MIPS divisions do trap by default, but libgloss targets do not intercept the trap and raise a SIGFPE. The same is probably true of other bare-metal environments, so restrict the test to systems that use the Linux kernel. */ # define DO_TEST 0 #elif defined (__mips16) && defined(__linux__) /* Not all Linux kernels deal correctly the breakpoints generated by MIPS16 divisions by zero. They show up as a SIGTRAP instead. */ # define DO_TEST 0 #elif defined (__MICROBLAZE__) /* We cannot rely on division by zero generating a trap. */ # define DO_TEST 0 #elif defined (__epiphany__) /* Epiphany does not have hardware division, and the software implementation has truly undefined behavior for division by 0. */ # define DO_TEST 0 #elif defined (__m68k__) && !defined(__linux__) /* Attempting to trap division-by-zero in this way isn't likely to work on bare-metal m68k systems. */ # define DO_TEST 0 #elif defined (__CRIS__) /* No SIGFPE for CRIS integer division. */ # define DO_TEST 0 #elif defined (__MMIX__) /* By default we emit a sequence with DIVU, which "never signals an exceptional condition, even when dividing by zero". */ # define DO_TEST 0 #elif defined (__arc__) /* No SIGFPE for ARC integer division. */ # define DO_TEST 0 #elif defined (__arm__) && defined (__ARM_EABI__) # ifdef __ARM_ARCH_EXT_IDIV__ /* Hardware division instructions may not trap, and handle trapping differently anyway. Skip the test if we have those instructions. */ # define DO_TEST 0 # else # include /* ARM division-by-zero behavior is to call a helper function, which can do several different things, depending on requirements. Emulate the behavior of other targets here by raising SIGFPE. */ int __attribute__((used)) __aeabi_idiv0 (int return_value) { raise (SIGFPE); return return_value; } # define DO_TEST 1 # endif #elif defined (__nios2__) /* Nios II requires both hardware support and user configuration to raise an exception on divide by zero. */ # define DO_TEST 0 #elif defined (__nvptx__) /* There isn't even a signal function. */ # define DO_TEST 0 #else # define DO_TEST 1 #endif extern void abort (void); extern void exit (int); #if DO_TEST #include void sigfpe (int signum __attribute__ ((unused))) { exit (0); } #endif /* When optimizing, the compiler is smart enough to constant fold the static unset variables i and j to produce 0 / 0, but it can't eliminate the assignment to the global k. */ static int i; static int j; int k __attribute__ ((used)); int main () { #if DO_TEST signal (SIGFPE, sigfpe); k = i / j; abort (); #else exit (0); #endif } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20101013-1.c ================================================ /* PR rtl-optimization/45912 */ extern void abort (void); static void* __attribute__((noinline,noclone)) get_addr_base_and_unit_offset (void *base, long long *i) { *i = 0; return base; } static void* __attribute__((noinline,noclone)) build_int_cst (void *base, long long offset) { if (offset != 4) abort (); return base; } static void* __attribute__((noinline,noclone)) build_ref_for_offset (void *base, long long offset) { long long base_offset; base = get_addr_base_and_unit_offset (base, &base_offset); return build_int_cst (base, base_offset + offset / 8); } int main (void) { void *ret = build_ref_for_offset ((void *)0, 32); if (ret != (void *)0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20101025-1.c ================================================ static int g_7; static int *volatile g_6 = &g_7; int g_3; static int f1 (int *p_58) { return *p_58; } void f2 (int i) __attribute__ ((noinline)); void f2 (int i) { g_3 = i; } int f3 (void) __attribute__ ((noinline)); int f3 (void) { *g_6 = 1; f2 (f1 (&g_7)); return 0; } int main () { f3 (); if (g_3 != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20110418-1.c ================================================ typedef unsigned long long uint64_t; void f(uint64_t *a, uint64_t aa) __attribute__((noinline)); void f(uint64_t *a, uint64_t aa) { uint64_t new_value = aa; uint64_t old_value = *a; int bit_size = 32; uint64_t mask = (uint64_t)(unsigned)(-1); uint64_t tmp = old_value & mask; new_value &= mask; /* On overflow we need to add 1 in the upper bits */ if (tmp > new_value) new_value += 1ull< */ typedef __SIZE_TYPE__ size_t; extern void *memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strlen (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); typedef __INT16_TYPE__ int16_t; typedef __INT32_TYPE__ int32_t; extern void abort (void); int a; static void __attribute__ ((noinline,noclone)) do_something (int item) { a = item; } int pack_unpack (char *s, char *p) { char *send, *pend; char type; int integer_size; send = s + strlen (s); pend = p + strlen (p); while (p < pend) { type = *p++; switch (type) { case 's': integer_size = 2; goto unpack_integer; case 'l': integer_size = 4; goto unpack_integer; unpack_integer: switch (integer_size) { case 2: { union { int16_t i; char a[sizeof (int16_t)]; } v; memcpy (v.a, s, sizeof (int16_t)); s += sizeof (int16_t); do_something (v.i); } break; case 4: { union { int32_t i; char a[sizeof (int32_t)]; } v; memcpy (v.a, s, sizeof (int32_t)); s += sizeof (int32_t); do_something (v.i); } break; } break; } } return (int) *s; } int main (void) { int n = pack_unpack ("\200\001\377\376\035\300", "sl"); if (n != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20111212-1.c ================================================ /* PR tree-optimization/50569 */ /* Reported by Paul Koning */ /* Reduced testcase by Mikael Pettersson */ struct event { struct { unsigned int sec; } sent __attribute__((packed)); }; void __attribute__((noinline,noclone)) frob_entry(char *buf) { struct event event; __builtin_memcpy(&event, buf, sizeof(event)); if (event.sent.sec < 64) { event.sent.sec = -1U; __builtin_memcpy(buf, &event, sizeof(event)); } } int main(void) { union { char buf[1 + sizeof(struct event)]; int align; } u; __builtin_memset(&u, 0, sizeof u); frob_entry(&u.buf[1]); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20111227-1.c ================================================ /* PR rtl-optimization/51667 */ /* Testcase by Uros Bizjak */ extern void abort (void); void __attribute__((noinline,noclone)) bar (int a) { if (a != -1) abort (); } void __attribute__((noinline,noclone)) foo (short *a, int t) { short r = *a; if (t) bar ((unsigned short) r); else bar ((signed short) r); } short v = -1; int main(void) { foo (&v, 0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20120105-1.c ================================================ struct __attribute__((packed)) S { int a, b, c; }; static int __attribute__ ((noinline,noclone)) extract(const char *p) { struct S s; __builtin_memcpy (&s, p, sizeof(struct S)); return s.a; } volatile int i; int main (void) { char p[sizeof(struct S) + 1]; __builtin_memset (p, 0, sizeof(struct S) + 1); i = extract (p + 1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20120111-1.c ================================================ #include #include uint32_t f0a (uint64_t arg2) __attribute__((noinline)); uint32_t f0a (uint64_t arg) { return ~((unsigned) (arg > -3)); } int main() { uint32_t r1; r1 = f0a (12094370573988097329ULL); if (r1 != ~0U) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20120207-1.c ================================================ /* PR middle-end/51994 */ /* Testcase by Uros Bizjak */ extern char *strcpy (char *, const char *); extern void abort (void); char __attribute__((noinline)) test (int a) { char buf[16]; char *output = buf; strcpy (&buf[0], "0123456789"); output += a; output -= 1; return output[0]; } int main () { if (test (2) != '1') abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20120427-1.c ================================================ typedef struct sreal { unsigned sig; /* Significant. */ int exp; /* Exponent. */ } sreal; sreal_compare (sreal *a, sreal *b) { if (a->exp > b->exp) return 1; if (a->exp < b->exp) return -1; if (a->sig > b->sig) return 1; return -(a->sig < b->sig); } sreal a[] = { { 0, 0 }, { 1, 0 }, { 0, 1 }, { 1, 1 } }; int main() { int i, j; for (i = 0; i <= 3; i++) { for (j = 0; j < 3; j++) { if (i < j && sreal_compare(&a[i], &a[j]) != -1) abort(); if (i == j && sreal_compare(&a[i], &a[j]) != 0) abort(); if (i > j && sreal_compare(&a[i], &a[j]) != 1) abort(); } } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20120427-2.c ================================================ typedef struct sreal { unsigned sig; /* Significant. */ int exp; /* Exponent. */ } sreal; sreal_compare (sreal *a, sreal *b) { if (a->exp > b->exp) return 1; if (a->exp < b->exp) return -1; if (a->sig > b->sig) return 1; if (a->sig < b->sig) return -1; return 0; } sreal a[] = { { 0, 0 }, { 1, 0 }, { 0, 1 }, { 1, 1 } }; int main() { int i, j; for (i = 0; i <= 3; i++) { for (j = 0; j < 3; j++) { if (i < j && sreal_compare(&a[i], &a[j]) != -1) abort(); if (i == j && sreal_compare(&a[i], &a[j]) != 0) abort(); if (i > j && sreal_compare(&a[i], &a[j]) != 1) abort(); } } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20120615-1.c ================================================ extern void abort (void); void __attribute__((noinline,noclone)) test1(int i) { if (i == 12) return; if (i != 17) { if (i == 15) return; abort (); } } int main() { test1 (15); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20120808-1.c ================================================ extern void exit (int); extern void abort (void); volatile int i; unsigned char *volatile cp; unsigned char d[32] = { 0 }; int main (void) { unsigned char c[32] = { 0 }; unsigned char *p = d + i; int j; for (j = 0; j < 30; j++) { int x = 0xff; int y = *++p; switch (j) { case 1: x ^= 2; break; case 2: x ^= 4; break; case 25: x ^= 1; break; default: break; } c[j] = y | x; cp = p; } if (c[0] != 0xff || c[1] != 0xfd || c[2] != 0xfb || c[3] != 0xff || c[4] != 0xff || c[25] != 0xfe || cp != d + 30) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20120817-1.c ================================================ typedef unsigned long long u64; unsigned long foo = 0; u64 f() __attribute__((noinline)); u64 f() { return ((u64)40) + ((u64) 24) * (int)(foo - 1); } int main () { if (f () != 16) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20120919-1.c ================================================ /* PR rtl-optimization/54290 */ /* Testcase by Eric Volk */ /* { dg-require-effective-target int32plus } */ double vd[2] = {1., 0.}; int vi[2] = {1234567890, 0}; double *pd = vd; int *pi = vi; extern void abort(void); void init (int *n, int *dummy) __attribute__ ((noinline,noclone)); void init (int *n, int *dummy) { if(0 == n) dummy[0] = 0; } int main (void) { int dummy[1532]; int i = -1, n = 1, s = 0; init (&n, dummy); while (i < n) { if (i == 0) { if (pd[i] > 0) { if (pi[i] > 0) { s += pi[i]; } } pd[i] = pi[i]; } ++i; } if (s != 1234567890) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20121108-1.c ================================================ char temp[] = "192.168.190.160"; unsigned result = (((((192u<<8)|168u)<<8)|190u)<<8)|160u; int strtoul1(const char *a, char **b, int c) __attribute__((noinline, noclone)); int strtoul1(const char *a, char **b, int c) { *b = a+3; if (a == temp) return 192; else if (a == temp+4) return 168; else if (a == temp+8) return 190; else if (a == temp+12) return 160; __builtin_abort(); } int string_to_ip(const char *s) __attribute__((noinline,noclone)); int string_to_ip(const char *s) { int addr; char *e; int i; if (s == 0) return(0); for (addr=0, i=0; i<4; ++i) { int val = s ? strtoul1(s, &e, 10) : 0; addr <<= 8; addr |= (val & 0xFF); if (s) { s = (*e) ? e+1 : e; } } return addr; } int main(void) { int t = string_to_ip (temp); printf ("%x\n", t); printf ("%x\n", result); if (t != result) __builtin_abort (); printf ("WORKS.\n"); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20131127-1.c ================================================ /* PR middle-end/59138 */ /* Testcase by John Regehr */ extern void abort (void); #pragma pack(1) struct S0 { int f0; int f1; int f2; short f3; }; short a = 1; struct S0 b = { 1 }, c, d, e; struct S0 fn1() { return c; } void fn2 (void) { b = fn1 (); a = 0; d = e; } int main (void) { fn2 (); if (a != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20140212-1.c ================================================ /* PR rtl-optimization/60116 */ /* Reported by Zhendong Su */ extern void abort (void); int a, b, c, d = 1, e, f = 1, h, i, k; char g, j; void fn1 (void) { int l; e = 0; c = 0; for (;;) { k = a && b; j = k * 54; g = j * 147; l = ~g + (long long) e && 1; if (d) c = l; else h = i = l * 9UL; if (f) return; } } int main (void) { fn1 (); if (c != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20140212-2.c ================================================ /* This used to fail as we would convert f into just return (unsigned int)usVlanID which is wrong. */ int f(unsigned short usVlanID) __attribute__((noinline,noclone)); int f(unsigned short usVlanID) { unsigned int uiVlanID = 0xffffffff; int i; if ((unsigned short)0xffff != usVlanID) uiVlanID = (unsigned int)usVlanID; return uiVlanID; } int main(void) { if (f(1) != 1) __builtin_abort (); if (f(0xffff) != -1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20140326-1.c ================================================ int a; int main (void) { char e[2] = { 0, 0 }, f = 0; if (a == 131072) f = e[a]; return f; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20140425-1.c ================================================ /* PR target/60941 */ /* Reported by Martin Husemann */ extern void abort (void); static void __attribute__((noinline)) set (unsigned long *l) { *l = 31; } int main (void) { unsigned long l; int i; set (&l); i = (int) l; l = (unsigned long)(2U << i); if (l != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20140622-1.c ================================================ unsigned p; long __attribute__((noinline, noclone)) test (unsigned a) { return (long)(p + a) - (long)p; } int main () { p = (unsigned) -2; if (test (0) != 0) __builtin_abort (); if (test (1) != 1) __builtin_abort (); if (test (2) != -(long)(unsigned)-2) __builtin_abort (); p = (unsigned) -1; if (test (0) != 0) __builtin_abort (); if (test (1) != -(long)(unsigned)-1) __builtin_abort (); if (test (2) != -(long)(unsigned)-2) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20140828-1.c ================================================ short *f(short *a, int b, int *d) __attribute__((noinline,noclone)); short *f(short *a, int b, int *d) { short c = *a; a++; c = b << c; *d = c; return a; } int main(void) { int d; short a[2]; a[0] = 0; if (f(a, 1, &d) != &a[1]) __builtin_abort (); if (d != 1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20141022-1.c ================================================ #define ABORT() do { __builtin_printf("assert.\n"); __builtin_abort (); }while(0) int f(int a) __attribute__((noinline)); int f(int a) { int fem_key_src; int D2930 = a & 4294967291; fem_key_src = a == 6 ? 0 : 15; fem_key_src = D2930 != 1 ? fem_key_src : 0; return fem_key_src; } int main(void) { if (f(0) != 15) ABORT (); if (f(1) != 0) ABORT (); if (f(6) != 0) ABORT (); if (f(5) != 0) ABORT (); if (f(15) != 15) ABORT (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20141107-1.c ================================================ #define bool _Bool bool f(int a, bool c) __attribute__((noinline)); bool f(int a, bool c) { if (!a) c = !c; return c; } void checkf(int a, bool b) { bool c = f(a, b); char d; __builtin_memcpy (&d, &c, 1); if ( d != (a==0)^b) __builtin_abort(); } int main(void) { checkf(0, 0); checkf(0, 1); checkf(1, 1); checkf(1, 0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20141125-1.c ================================================ int f(long long a) __attribute__((noinline,noclone)); int f(long long a) { if (a & 0x3ffffffffffffffull) return 1; return 1024; } int main(void) { if(f(0x48375d8000000000ull) != 1) __builtin_abort (); if (f(0xfc00000000000000ull) != 1024) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20150611-1.c ================================================ int a, c, d; short b; int main () { int e[1]; for (; b < 2; b++) { a = 0; if (b == 28378) a = e[b]; if (!(d || b)) for (; c;) ; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/900409-1.c ================================================ long f1(long a){return a&0xff000000L;} long f2 (long a){return a&~0xff000000L;} long f3(long a){return a&0x000000ffL;} long f4(long a){return a&~0x000000ffL;} long f5(long a){return a&0x0000ffffL;} long f6(long a){return a&~0x0000ffffL;} main () { long a = 0x89ABCDEF; if (f1(a)!=0x89000000L|| f2(a)!=0x00ABCDEFL|| f3(a)!=0x000000EFL|| f4(a)!=0x89ABCD00L|| f5(a)!=0x0000CDEFL|| f6(a)!=0x89AB0000L) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920202-1.c ================================================ static int rule_text_needs_stack_pop = 0; static int input_stack_pos = 1; f (void) { rule_text_needs_stack_pop = 1; if (input_stack_pos <= 0) return 1; else return 0; } main () { f (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920302-1.c ================================================ short optab[5]; char buf[10]; execute (ip) register short *ip; { #ifndef NO_LABEL_VALUES register void *base = &&x; char *bp = buf; static void *tab[] = {&&x, &&y, &&z}; if (ip == 0) { int i; for (i = 0; i < 3; ++i) optab[i] = (short)(tab[i] - base); return; } x: *bp++='x'; goto *(base + *ip++); y: *bp++='y'; goto *(base + *ip++); z: *bp++='z'; *bp=0; return; #else strcpy (buf, "xyxyz"); #endif } short p[5]; main () { execute ((short *) 0); p[0] = optab[1]; p[1] = optab[0]; p[2] = optab[1]; p[3] = optab[2]; execute (&p); if (strcmp (buf, "xyxyz")) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920409-1.c ================================================ x(){signed char c=-1;return c<0;}main(){if(x()!=1)abort();exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920410-1.c ================================================ #define STACK_REQUIREMENT (40000 * 4 + 256) #if defined (STACK_SIZE) && STACK_SIZE < STACK_REQUIREMENT main () { exit (0); } #else main(){int d[40000];d[0]=0;exit(0);} #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920411-1.c ================================================ long f (w) char *w; { long k, i, c = 0, x; char *p = (char*) &x; for (i = 0; i < 1; i++) { for (k = 0; k < sizeof (long); k++) p[k] = w[k]; c += x; } return c; } main () { int i; char a[sizeof (long)]; for (i = sizeof (long); --i >= 0;) a[i] = ' '; if (f (a) != ~0UL / (unsigned char) ~0 * ' ') abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920415-1.c ================================================ #ifndef NO_LABEL_VALUES main(){__label__ l;void*x(){return&&l;}goto*x();abort();return;l:exit(0);} #else main(){ exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920428-1.c ================================================ x(const char*s){char a[1];const char*ss=s;a[*s++]|=1;return(int)ss+1==(int)s;} main(){if(x("")!=1)abort();exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920428-2.c ================================================ #if !defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) s(i){if(i>0){__label__ l1;int f(int i){if(i==2)goto l1;return 0;}return f(i);l1:;}return 1;} x(){return s(0)==1&&s(1)==0&&s(2)==1;} main(){if(x()!=1)abort();exit(0);} #else main(){ exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920429-1.c ================================================ typedef unsigned char t;int i,j; t*f(t*p){t c;c=*p++;i=((c&2)?1:0);j=(c&7)+1;return p;} main(){t*p0="ab",*p1;p1=f(p0);if(p0+1!=p1)abort();exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920501-1.c ================================================ /* { dg-require-effective-target untyped_assembly } */ int s[2]; x(){if(!s[0]){s[1+s[1]]=s[1];return 1;}} main(){s[0]=s[1]=0;if(x(0)!=1)abort();exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920501-2.c ================================================ unsigned long gcd_ll (unsigned long long x, unsigned long long y) { for (;;) { if (y == 0) return (unsigned long) x; x = x % y; if (x == 0) return (unsigned long) y; y = y % x; } } unsigned long long powmod_ll (unsigned long long b, unsigned e, unsigned long long m) { unsigned t; unsigned long long pow; int i; if (e == 0) return 1; /* Find the most significant bit in E. */ t = e; for (i = 0; t != 0; i++) t >>= 1; /* The most sign bit in E is handled outside of the loop, by beginning with B in POW, and decrementing I. */ pow = b; i -= 2; for (; i >= 0; i--) { pow = pow * pow % m; if ((1 << i) & e) pow = pow * b % m; } return pow; } unsigned long factab[10]; void facts (t, a_int, x0, p) unsigned long long t; int a_int; int x0; unsigned p; { unsigned long *xp = factab; unsigned long long x, y; unsigned long q = 1; unsigned long long a = a_int; int i; unsigned long d; int j = 1; unsigned long tmp; int jj = 0; x = x0; y = x0; for (i = 1; i < 10000; i++) { x = powmod_ll (x, p, t) + a; y = powmod_ll (y, p, t) + a; y = powmod_ll (y, p, t) + a; if (x > y) tmp = x - y; else tmp = y - x; q = (unsigned long long) q * tmp % t; if (i == j) { jj += 1; j += jj; d = gcd_ll (q, t); if (d != 1) { *xp++ = d; t /= d; if (t == 1) { return; *xp = 0; } } } } } main () { unsigned long long t; unsigned x0, a; unsigned p; p = 27; t = (1ULL << p) - 1; a = -1; x0 = 3; facts (t, a, x0, p); if (factab[0] != 7 || factab[1] != 73 || factab[2] != 262657) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920501-3.c ================================================ int tab[9]; execute(oip, ip) unsigned short *oip, *ip; { #ifndef NO_LABEL_VALUES int x = 0; int *xp = tab; base: x++; if (x == 4) { *xp = 0; return; } *xp++ = ip - oip; goto *(&&base + *ip++); #else tab[0] = 0; tab[1] = 1; tab[2] = 2; tab[3] = 0; #endif } main() { unsigned short ip[10]; int i; for (i = 0; i < 10; i++) ip[i] = 0; execute(ip, ip); if (tab[0] != 0 || tab[1] != 1 || tab[2] != 2 || tab[3] != 0) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920501-4.c ================================================ #ifndef NO_LABEL_VALUES int x (int i) { static const void *j[] = {&& x, && y, && z}; goto *j[i]; x: return 2; y: return 3; z: return 5; } int main (void) { if ( x (0) != 2 || x (1) != 3 || x (2) != 5) abort (); exit (0); } #else int main (void) { exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920501-5.c ================================================ #ifndef NO_LABEL_VALUES x (int i) { void *j[] = {&&x, &&y, &&z}; goto *j[i]; x:return 2; y:return 3; z:return 5; } main () { if (x (0) != 2 || x (1) != 3 || x (2) != 5) abort(); exit(0); } #else main(){ exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920501-6.c ================================================ #include /* Convert a decimal string to a long long unsigned. No error check is performed. */ long long unsigned str2llu (str) char *str; { long long unsigned acc; int d; acc = *str++ - '0'; for (;;) { d = *str++; if (d == '\0') break; d -= '0'; acc = acc * 10 + d; } return acc; } /* isqrt(t) - computes the square root of t. (tege 86-10-27) */ long unsigned sqrtllu (long long unsigned t) { long long unsigned s; long long unsigned b; for (b = 0, s = t; b++, (s >>= 1) != 0; ) ; s = 1LL << (b >> 1); if (b & 1) s += s >> 1; do { b = t / s; s = (s + b) >> 1; } while (b < s); return s; } int plist (p0, p1, tab) long long unsigned p0, p1; long long unsigned *tab; { long long unsigned p; long unsigned d; long unsigned s; long long unsigned *xp = tab; for (p = p0; p <= p1; p += 2) { s = sqrtllu (p); for (d = 3; d <= s; d += 2) { long long unsigned q = p % d; if (q == 0) goto not_prime; } *xp++ = p; not_prime:; } *xp = 0; return xp - tab; } main (argc, argv) int argc; char *argv[]; { long long tab[10]; int nprimes; nprimes = plist (str2llu ("1234111111"), str2llu ("1234111127"), tab); if(tab[0]!=1234111117LL||tab[1]!=1234111121LL||tab[2]!=1234111127LL||tab[3]!=0) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920501-7.c ================================================ #ifdef STACK_SIZE #define DEPTH ((STACK_SIZE) / 512 + 1) #else #define DEPTH 1000 #endif #if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) x(a) { __label__ xlab; void y(a) { if (a==0) goto xlab; y (a-1); } y (a); xlab:; return a; } #endif main () { #if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) if (x (DEPTH) != DEPTH) abort (); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920501-8.c ================================================ #include #include char buf[50]; int va (int a, double b, int c, ...) { va_list ap; int d, e, f, g, h, i, j, k, l, m, n, o, p; va_start (ap, c); d = va_arg (ap, int); e = va_arg (ap, int); f = va_arg (ap, int); g = va_arg (ap, int); h = va_arg (ap, int); i = va_arg (ap, int); j = va_arg (ap, int); k = va_arg (ap, int); l = va_arg (ap, int); m = va_arg (ap, int); n = va_arg (ap, int); o = va_arg (ap, int); p = va_arg (ap, int); sprintf (buf, "%d,%f,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p); va_end (ap); } main() { va (1, 1.0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); if (strcmp ("1,1.000000,2,3,4,5,6,7,8,9,10,11,12,13,14,15", buf)) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920501-9.c ================================================ #include long long proc1(){return 1LL;} long long proc2(){return 0x12345678LL;} long long proc3(){return 0xaabbccdd12345678LL;} long long proc4(){return -1LL;} long long proc5(){return 0xaabbccddLL;} print_longlong(x,buf) long long x; char *buf; { unsigned long l; l= (x >> 32) & 0xffffffff; if (l != 0) sprintf(buf,"%lx%08.lx",l,((unsigned long)x & 0xffffffff)); else sprintf(buf,"%lx",((unsigned long)x & 0xffffffff)); } main(){char buf[100]; print_longlong(proc1(),buf);if(strcmp("1",buf))abort(); print_longlong(proc2(),buf);if(strcmp("12345678",buf))abort(); print_longlong(proc3(),buf);if(strcmp("aabbccdd12345678",buf))abort(); print_longlong(proc4(),buf);if(strcmp("ffffffffffffffff",buf))abort(); print_longlong(proc5(),buf);if(strcmp("aabbccdd",buf))abort(); exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920506-1.c ================================================ int l[]={0,1}; main(){int*p=l;switch(*p++){case 0:exit(0);case 1:break;case 2:break;case 3:case 4:break;}abort();} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920520-1.c ================================================ foo(int *bar) { *bar = 8; } bugger() { int oldDepth, newDepth; foo(&oldDepth); switch (oldDepth) { case 8: case 500: newDepth = 8; break; case 5000: newDepth = 500; break; default: newDepth = 17; break; } return newDepth - oldDepth; } main() { if (bugger() != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920603-1.c ================================================ f(got){if(got!=0xffff)abort();} main(){signed char c=-1;unsigned u=(unsigned short)c;f(u);exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920604-1.c ================================================ long long mod (a, b) long long a, b; { return a % b; } int main () { mod (1LL, 2LL); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920612-1.c ================================================ /* { dg-options "-fwrapv" } */ extern void abort (void); extern void exit (int); int f(j)int j;{return++j>0;} int main(){if(f((~0U)>>1))abort();exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920612-2.c ================================================ main () { int i = 0; int a (int x) { while (x) i++, x--; return x; } #ifndef NO_TRAMPOLINES if (a (2) != 0) abort (); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920618-1.c ================================================ main(){if(1.17549435e-38F<=1.1)exit(0);abort();} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920625-1.c ================================================ #include typedef struct{double x,y;}point; point pts[]={{1.0,2.0},{3.0,4.0},{5.0,6.0},{7.0,8.0}}; static int va1(int nargs,...) { va_list args; int i; point pi; va_start(args,nargs); for(i=0;i 1.84467440737096e+19) abort(); if (16777217L != (float)16777217e0) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920711-1.c ================================================ /* { dg-options "-fwrapv" } */ extern void abort (void); extern void exit (int); int f(long a){return (--a > 0);} int main(){if(f(0x80000000L)==0)abort();exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920721-1.c ================================================ long f(short a,short b){return (long)a/b;} main(){if(f(-32768,-1)!=32768L)abort();else exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920721-2.c ================================================ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ f(){} main(){int n=2;double x[n];f();exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920721-3.c ================================================ static inline fu (unsigned short data) { return data; } ru(i) { if(fu(i++)!=5)abort(); if(fu(++i)!=7)abort(); } static inline fs (signed short data) { return data; } rs(i) { if(fs(i++)!=5)abort(); if(fs(++i)!=7)abort(); } main() { ru(5); rs(5); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920721-4.c ================================================ #ifndef NO_LABEL_VALUES int try (int num) { __label__ lab1, lab2, lab3, lab4, lab5, lab6, default_lab; void *do_switch (int num) { switch(num) { case 1: return &&lab1; case 2: return &&lab2; case 3: return &&lab3; case 4: return &&lab4; case 5: return &&lab5; case 6: return &&lab6; default: return &&default_lab; } } goto *do_switch (num); lab1: return 1; lab2: return 2; lab3: return 3; lab4: return 4; lab5: return 5; lab6: return 6; default_lab: return -1; } main() { int i; for (i = 1; i <= 6; i++) { if (try (i) != i) abort(); } exit(0); } #else main(){ exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920726-1.c ================================================ #include #include struct spurious { int anumber; }; int first(char *buf, char *fmt, ...) { int pos, number; va_list args; int dummy; char *bp = buf; va_start(args, fmt); for (pos = 0; fmt[pos]; pos++) if (fmt[pos] == 'i') { number = va_arg(args, int); sprintf(bp, "%d", number); bp += strlen(bp); } else *bp++ = fmt[pos]; va_end(args); *bp = 0; return dummy; } struct spurious second(char *buf,char *fmt, ...) { int pos, number; va_list args; struct spurious dummy; char *bp = buf; va_start(args, fmt); for (pos = 0; fmt[pos]; pos++) if (fmt[pos] == 'i') { number = va_arg(args, int); sprintf(bp, "%d", number); bp += strlen(bp); } else *bp++ = fmt[pos]; va_end(args); *bp = 0; return dummy; } main() { char buf1[100], buf2[100]; first(buf1, "i i ", 5, 20); second(buf2, "i i ", 5, 20); if (strcmp ("5 20 ", buf1) || strcmp ("5 20 ", buf2)) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920728-1.c ================================================ typedef struct {int dims[0]; } *A; f(unsigned long obj) { unsigned char y = obj >> 24; y &= ~4; if ((y==0)||(y!=251 )) abort(); if(((int)obj&7)!=7)return; REST_OF_CODE_JUST_HERE_TO_TRIGGER_THE_BUG: { unsigned char t = obj >> 24; if (!(t==0)&&(t<=0x03)) return 0; return ((A)(obj&0x00FFFFFFL))->dims[1]; } } long g(){return 0xff000000L;} main (){int x;f(g());exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920730-1.c ================================================ /* 920730-1.c */ #include f1() { int b=INT_MIN; return b>=INT_MIN; } f2() { int b=INT_MIN+1; return b>= (unsigned)(INT_MAX+2); } f3() { int b=INT_MAX; return b>=INT_MAX; } f4() { int b=-1; return b>=UINT_MAX; } main () { if((f1()&f2()&f3()&f4())!=1) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920731-1.c ================================================ f(x){int i;for(i=0;i<8&&(x&1)==0;x>>=1,i++);return i;} main(){if(f(4)!=2)abort();exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920810-1.c ================================================ #include #include #include typedef struct{void*super;int name;int size;}t; t*f(t*clas,int size) { t*child=(t*)malloc(size); memcpy(child,clas,clas->size); child->super=clas; child->name=0; child->size=size; return child; } main() { t foo,*bar; memset(&foo,37,sizeof(t)); foo.size=sizeof(t); bar=f(&foo,sizeof(t)); if(bar->super!=&foo||bar->name!=0||bar->size!=sizeof(t))abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920812-1.c ================================================ typedef int t; f(t y){switch(y){case 1:return 1;}return 0;} main(){if(f((t)1)!=1)abort();exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920829-1.c ================================================ long long c=2863311530LL,c3=2863311530LL*3; main(){if(c*3!=c3)abort();exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920908-1.c ================================================ /* REPRODUCED:RUN:SIGNAL MACHINE:mips OPTIONS: */ #include typedef struct{int A;}T; T f(int x,...) { va_list ap; T X; va_start(ap,x); X=va_arg(ap,T); if(X.A!=10)abort(); X=va_arg(ap,T); if(X.A!=20)abort(); va_end(ap); return X; } main() { T X,Y; int i; X.A=10; Y.A=20; f(2,X,Y); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920908-2.c ================================================ /* The bit-field below would have a problem if __INT_MAX__ is too small. */ #if __INT_MAX__ < 2147483647 int main (void) { exit (0); } #else /* CONF:m68k-sun-sunos4.1.1 OPTIONS:-O */ struct T { unsigned i:8; unsigned c:24; }; f(struct T t) { struct T s[1]; s[0]=t; return(char)s->c; } main() { struct T t; t.i=0xff; t.c=0xffff11; if(f(t)!=0x11)abort(); exit(0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920909-1.c ================================================ f(a){switch(a){case 0x402:return a+1;case 0x403:return a+2;case 0x404:return a+3;case 0x405:return a+4;case 0x406:return 1;case 0x407:return 4;}return 0;} main(){if(f(1))abort();exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920922-1.c ================================================ unsigned long* f(p)unsigned long*p; { unsigned long a = (*p++) >> 24; return p + a; } main () { unsigned long x = 0x80000000UL; if (f(&x) != &x + 0x81) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/920929-1.c ================================================ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ /* REPRODUCED:RUN:SIGNAL MACHINE:sparc OPTIONS: */ f(int n) { int i; double v[n]; for(i=0;i=0)abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921013-1.c ================================================ f(d,x,y,n) int*d; float*x,*y; int n; { while(n--){*d++=*x++==*y++;} } main() { int r[4]; float a[]={5,1,3,5}; float b[]={2,4,3,0}; int i; f(r,a,b,4); for(i=0;i<4;i++) if((a[i]==b[i])!=r[i]) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921016-1.c ================================================ main() { int j=1081; struct { signed int m:11; }l; if((l.m=j)==j)abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921017-1.c ================================================ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ f(n) { int a[n]; int g(i) { return a[i]; } a[1]=4711; return g(1); } main() { #ifndef NO_TRAMPOLINES if(f(2)!=4711)abort(); #endif exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921019-1.c ================================================ void *foo[]={(void *)&("X"[0])}; main () { if (((char*)foo[0])[0] != 'X') abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921019-2.c ================================================ main() { double x,y=0.5; x=y/0.2; if(x!=x) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921029-1.c ================================================ typedef unsigned long long ULL; ULL back; ULL hpart, lpart; ULL build(long h, long l) { hpart = h; hpart <<= 32; lpart = l; lpart &= 0xFFFFFFFFLL; back = hpart | lpart; return back; } main() { if (build(0, 1) != 0x0000000000000001LL) abort(); if (build(0, 0) != 0x0000000000000000LL) abort(); if (build(0, 0xFFFFFFFF) != 0x00000000FFFFFFFFLL) abort(); if (build(0, 0xFFFFFFFE) != 0x00000000FFFFFFFELL) abort(); if (build(1, 1) != 0x0000000100000001LL) abort(); if (build(1, 0) != 0x0000000100000000LL) abort(); if (build(1, 0xFFFFFFFF) != 0x00000001FFFFFFFFLL) abort(); if (build(1, 0xFFFFFFFE) != 0x00000001FFFFFFFELL) abort(); if (build(0xFFFFFFFF, 1) != 0xFFFFFFFF00000001LL) abort(); if (build(0xFFFFFFFF, 0) != 0xFFFFFFFF00000000LL) abort(); if (build(0xFFFFFFFF, 0xFFFFFFFF) != 0xFFFFFFFFFFFFFFFFLL) abort(); if (build(0xFFFFFFFF, 0xFFFFFFFE) != 0xFFFFFFFFFFFFFFFELL) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921104-1.c ================================================ main () { unsigned long val = 1; if (val > (unsigned long) ~0) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921110-1.c ================================================ extern int abort(); typedef int (*frob)(); frob f[] = {abort}; main() { exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921112-1.c ================================================ union u { struct { int i1, i2; } t; double d; } x[2], v; f (x, v) union u *x, v; { *++x = v; } main() { x[1].t.i1 = x[1].t.i2 = 0; v.t.i1 = 1; v.t.i2 = 2; f (x, v); if (x[1].t.i1 != 1 || x[1].t.i2 != 2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921113-1.c ================================================ #define STACK_REQUIREMENT (128 * 128 * 4 + 1024) #if defined (STACK_SIZE) && STACK_SIZE < STACK_REQUIREMENT main () { exit (0); } #else typedef struct { float wsx; } struct_list; typedef struct_list *list_t; typedef struct { float x, y; } vector_t; w(float x, float y) {} f1(float x, float y) { if (x != 0 || y != 0) abort(); } f2(float x, float y) { if (x != 1 || y != 1) abort(); } gitter(int count, vector_t pos[], list_t list, int *nww, vector_t limit[2], float r) { float d; int gitt[128][128]; f1(limit[0].x, limit[0].y); f2(limit[1].x, limit[1].y); *nww = 0; d = pos[0].x; if (d <= 0.) { w(d, r); if (d <= r * 0.5) { w(d, r); list[0].wsx = 1; } } } vector_t pos[1] = {{0., 0.}}; vector_t limit[2] = {{0.,0.},{1.,1.}}; main() { int nww; struct_list list; gitter(1, pos, &list, &nww, limit, 1.); exit(0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921117-1.c ================================================ struct s { char text[11]; int flag; } cell; int check (struct s p) { if (p.flag != 99) return 1; return strcmp (p.text, "0123456789"); } main () { cell.flag = 99; strcpy (cell.text, "0123456789"); if (check (cell)) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921123-1.c ================================================ f(short *p) { short x = *p; return (--x < 0); } main() { short x = -10; if (!f(&x)) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921123-2.c ================================================ typedef struct { unsigned short b0, b1, b2, b3; } four_quarters; four_quarters x; int a, b; void f (four_quarters j) { b = j.b2; a = j.b3; } main () { four_quarters x; x.b0 = x.b1 = x.b2 = 0; x.b3 = 38; f(x); if (a != 38) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921124-1.c ================================================ f(x, d1, d2, d3) double d1, d2, d3; { return x; } g(b,s,x,y,i,j) char *b,*s; double x,y; { if (x != 1.0 || y != 2.0 || i != 3 || j != 4) abort(); } main() { g("","", 1.0, 2.0, f(3, 0.0, 0.0, 0.0), f(4, 0.0, 0.0, 0.0)); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921202-1.c ================================================ /* { dg-require-effective-target untyped_assembly } */ #ifndef STACK_SIZE #define VLEN 2055 #else #define VLEN ((STACK_SIZE/16) - 1) #endif main () { long dx[VLEN+1]; long dy[VLEN+1]; long s1[VLEN]; int cyx, cyy; int i; long size; for (;;) { size = VLEN; mpn_random2 (s1, size); for (i = 0; i < 1; i++) ; dy[size] = 0x12345678; for (i = 0; i < 1; i++) cyy = mpn_mul_1 (dy, s1, size); if (cyx != cyy || mpn_cmp (dx, dy, size + 1) != 0 || dx[size] != 0x12345678) { foo ("", 8, cyy); mpn_print (dy, size); } exxit(); } } foo (){} mpn_mul_1(){} mpn_print (){} mpn_random2(){} mpn_cmp(){} exxit(){exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921202-2.c ================================================ int f(long long x) { x >>= 8; return x & 0xff; } main() { if (f(0x0123456789ABCDEFLL) != 0xCD) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921204-1.c ================================================ /* The bit-field below would have a problem if __INT_MAX__ is too small. */ #if __INT_MAX__ < 2147483647 int main (void) { exit (0); } #else typedef struct { unsigned b0:1, f1:17, b18:1, b19:1, b20:1, f2:11; } bf; typedef union { bf b; unsigned w; } bu; bu f(bu i) { bu o = i; if (o.b.b0) o.b.b18 = 1, o.b.b20 = 1; else o.b.b18 = 0, o.b.b20 = 0; return o; } main() { bu a; bu r; a.w = 0x4000000; a.b.b0 = 0; r = f(a); if (a.w != r.w) abort(); exit(0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921207-1.c ================================================ f() { unsigned b = 0; if (b > ~0U) b = ~0U; return b; } main() { if (f()!=0) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921208-1.c ================================================ double f(double x) { return x*x; } double Int(double (*f)(double), double a) { return (*f)(a); } main() { if (Int(&f,2.0) != 4.0) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921208-2.c ================================================ /* { dg-require-effective-target untyped_assembly } */ #define STACK_REQUIREMENT (100000 * 4 + 1024) #if defined (STACK_SIZE) && STACK_SIZE < STACK_REQUIREMENT main () { exit (0); } #else g(){} f() { int i; float a[100000]; for (i = 0; i < 1; i++) { g(1.0, 1.0 + i / 2.0 * 3.0); g(2.0, 1.0 + i / 2.0 * 3.0); } } main () { f(); exit(0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921215-1.c ================================================ main() { #ifndef NO_TRAMPOLINES void p(void ((*f) (void ()))) { void r() { foo (); } f(r); } void q(void ((*f)())) { f(); } p(q); #endif exit(0); } foo(){} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921218-1.c ================================================ f() { return (unsigned char)("\377"[0]); } main() { if (f() != (unsigned char)(0377)) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/921218-2.c ================================================ f() { long l2; unsigned short us; unsigned long ul; short s2; ul = us = l2 = s2 = -1; return ul; } main() { if (f()!=(unsigned short)-1) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930106-1.c ================================================ #if defined (STACK_SIZE) #define DUMMY_SIZE 9 #else #define DUMMY_SIZE 399999 #endif double g() { return 1.0; } f() { char dummy[DUMMY_SIZE]; double f1, f2, f3; f1 = g(); f2 = g(); f3 = g(); return f1 + f2 + f3; } main() { if (f() != 3.0) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930111-1.c ================================================ main() { if (wwrite((long long) 0) != 123) abort(); exit(0); } int wwrite(long long i) { switch(i) { case 3: case 10: case 23: case 28: case 47: return 0; default: return 123; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930123-1.c ================================================ f(int *x) { *x = 0; } main() { int s, c, x; char a[] = "c"; f(&s); a[c = 0] = s == 0 ? (x=1, 'a') : (x=2, 'b'); if (a[c] != 'a') abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930126-1.c ================================================ struct s { unsigned long long a:8, b:32; }; struct s f(struct s x) { x.b = 0xcdef1234; return x; } main() { static struct s i; i.a = 12; i = f(i); if (i.a != 12 || i.b != 0xcdef1234) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930208-1.c ================================================ typedef union { long l; struct { char b3, b2, b1, b0; } c; } T; f (T u) { ++u.c.b0; ++u.c.b3; return (u.c.b1 != 2 || u.c.b2 != 2); } main () { T u; u.c.b1 = 2; u.c.b2 = 2; u.c.b0 = ~0; u.c.b3 = ~0; if (f (u)) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930406-1.c ================================================ f() { int x = 1; #if defined(STACK_SIZE) char big[STACK_SIZE/2]; #else char big[0x1000]; #endif ({ __label__ mylabel; mylabel: x++; if (x != 3) goto mylabel; }); exit(0); } main() { f(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930408-1.c ================================================ typedef enum foo E; enum foo { e0, e1 }; struct { E eval; } s; p() { abort(); } f() { switch (s.eval) { case e0: p(); } } main() { s.eval = e1; f(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930429-1.c ================================================ char * f (char *p) { short x = *p++ << 16; return p; } main () { char *p = ""; if (f (p) != p + 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930429-2.c ================================================ int f (b) { return (b >> 1) > 0; } main () { if (!f (9)) abort (); if (f (-9)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930513-1.c ================================================ #include char buf[2]; f (fp) int (*fp)(char *, const char *, ...); { (*fp)(buf, "%.0f", 5.0); } main () { f (&sprintf); if (buf[0] != '5' || buf[1] != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930513-2.c ================================================ sub3 (i) const int *i; { } eq (a, b) { static int i = 0; if (a != i) abort (); i++; } main () { int i; for (i = 0; i < 4; i++) { const int j = i; int k; sub3 (&j); k = j; eq (k, k); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930518-1.c ================================================ int bar = 0; f (p) int *p; { int foo = 2; while (foo > bar) { foo -= bar; *p++ = foo; bar = 1; } } main () { int tab[2]; tab[0] = tab[1] = 0; f (tab); if (tab[0] != 2 || tab[1] != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930526-1.c ================================================ /* { dg-options "-fgnu89-inline" } */ extern void exit (int); inline void f (int x) { int *(p[25]); int m[25*7]; int i; for (i = 0; i < 25; i++) p[i] = m + x*i; p[1][0] = 0; } int main () { f (7); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930527-1.c ================================================ f (unsigned char x) { return (0x50 | (x >> 4)) ^ 0xff; } main () { if (f (0) != 0xaf) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930529-1.c ================================================ /* { dg-options { "-fwrapv" } } */ extern void abort (void); extern void exit (int); int dd (int x, int d) { return x / d; } int main () { int i; for (i = -3; i <= 3; i++) { if (dd (i, 1) != i / 1) abort (); if (dd (i, 2) != i / 2) abort (); if (dd (i, 3) != i / 3) abort (); if (dd (i, 4) != i / 4) abort (); if (dd (i, 5) != i / 5) abort (); if (dd (i, 6) != i / 6) abort (); if (dd (i, 7) != i / 7) abort (); if (dd (i, 8) != i / 8) abort (); } for (i = ((unsigned) ~0 >> 1) - 3; i <= ((unsigned) ~0 >> 1) + 3; i++) { if (dd (i, 1) != i / 1) abort (); if (dd (i, 2) != i / 2) abort (); if (dd (i, 3) != i / 3) abort (); if (dd (i, 4) != i / 4) abort (); if (dd (i, 5) != i / 5) abort (); if (dd (i, 6) != i / 6) abort (); if (dd (i, 7) != i / 7) abort (); if (dd (i, 8) != i / 8) abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930603-1.c ================================================ float fx (x) float x; { return 1.0 + 3.0 / (2.302585093 * x); } main () { float fx (), inita (), initc (), a, b, c; a = inita (); c = initc (); f (); b = fx (c) + a; f (); if (a != 3.0 || b < 4.3257 || b > 4.3258 || c != 4.0) abort (); exit (0); } float inita () { return 3.0; } float initc () { return 4.0; } f () {} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930603-2.c ================================================ int w[2][2]; f () { int i, j; for (i = 0; i < 2; i++) for (j = 0; j < 2; j++) if (i == j) w[i][j] = 1; } main () { f (); if (w[0][0] != 1 || w[1][1] != 1 || w[1][0] != 0 || w[0][1] != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930603-3.c ================================================ f (b, c) unsigned char *b; int c; { unsigned long v = 0; switch (c) { case 'd': v = ((unsigned long)b[0] << 8) + b[1]; v >>= 9; break; case 'k': v = b[3] >> 4; break; default: abort (); } return v; } main () { char buf[4]; buf[0] = 170; buf[1] = 5; if (f (buf, 'd') != 85) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930608-1.c ================================================ double f (double a) {} double (* const a[]) (double) = {&f}; main () { double (*p) (); p = &f; if (p != a[0]) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930614-1.c ================================================ f (double *ty) { *ty = -1.0; } main () { double foo[6]; double tx = 0.0, ty, d; f (&ty); if (ty < 0) ty = -ty; d = (tx > ty) ? tx : ty; if (ty != d) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930614-2.c ================================================ main () { int i, j, k, l; float x[8][2][8][2]; for (i = 0; i < 8; i++) for (j = i; j < 8; j++) for (k = 0; k < 2; k++) for (l = 0; l < 2; l++) { if ((i == j) && (k == l)) x[i][k][j][l] = 0.8; else x[i][k][j][l] = 0.8; if (x[i][k][j][l] < 0.0) abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930621-1.c ================================================ /* The bit-field below would have a problem if __INT_MAX__ is too small. */ #if __INT_MAX__ < 2147483647 int main (void) { exit (0); } #else f () { struct { int x : 18; int y : 14; } foo; foo.x = 10; foo.y = 20; return foo.y; } main () { if (f () != 20) abort (); exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930622-1.c ================================================ int a = 1, b; g () { return 0; } h (x) {} f () { if (g () == -1) return 0; a = g (); if (b >= 1) h (a); return 0; } main () { f (); if (a != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930622-2.c ================================================ long double ll_to_ld (long long n) { return n; } long long ld_to_ll (long double n) { return n; } main () { long long n; if (ll_to_ld (10LL) != 10.0) abort (); if (ld_to_ll (10.0) != 10) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930628-1.c ================================================ f (double x[2], double y[2]) { if (x == y) abort (); } main () { struct { int f[3]; double x[1][2]; } tp[4][2]; int i, j, ki, kj, mi, mj; float bdm[4][2][4][2]; for (i = 0; i < 4; i++) for (j = i; j < 4; j++) for (ki = 0; ki < 2; ki++) for (kj = 0; kj < 2; kj++) if ((j == i) && (ki == kj)) bdm[i][ki][j][kj] = 1000.0; else { for (mi = 0; mi < 1; mi++) for (mj = 0; mj < 1; mj++) f (tp[i][ki].x[mi], tp[j][kj].x[mj]); bdm[i][ki][j][kj] = 1000.0; } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930630-1.c ================================================ /* The bit-field below would have a problem if __INT_MAX__ is too small. */ #if __INT_MAX__ < 2147483647 int main (void) { exit (0); } #else main () { struct { signed int bf0:17; signed int bf1:7; } bf; bf.bf1 = 7; f (bf.bf1); exit (0); } f (x) int x; { if (x != 7) abort (); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930702-1.c ================================================ fp (double a, int b) { if (a != 33 || b != 11) abort (); } main () { int (*f) (double, int) = fp; fp (33, 11); f (33, 11); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930713-1.c ================================================ typedef struct { char x; } T; T f (s1) T s1; { T s1a; s1a.x = 17; return s1a; } main () { T s1a, s1b; s1a.x = 13; s1b = f (s1a); if (s1a.x != 13 || s1b.x != 17) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930718-1.c ================================================ typedef struct rtx_def { int f1 :1; int f2 :1; } *rtx; static rtx f (orig) register rtx orig; { if (orig->f1 || orig->f2) return orig; orig->f2 = 1; return orig; } void f2 () { abort (); } main () { struct rtx_def foo; rtx bar; foo.f1 = 1; foo.f2 = 0; bar = f (&foo); if (bar != &foo || bar->f2 != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930719-1.c ================================================ int f (foo, bar, com) { unsigned align; if (foo) return 0; while (1) { switch (bar) { case 1: if (com != 0) return align; *(char *) 0 = 0; } } } main () { f (0, 1, 1); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930725-1.c ================================================ int v; char * g () { return ""; } char * f () { return (v == 0 ? g () : "abc"); } main () { v = 1; if (!strcmp (f (), "abc")) exit (0); abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930818-1.c ================================================ static double one = 1.0; f() { int colinear; colinear = (one == 0.0); if (colinear) abort (); return colinear; } main() { if (f()) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930916-1.c ================================================ f (n) unsigned n; { if ((int) n >= 0) abort (); } main () { unsigned x = ~0; f (x); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930921-1.c ================================================ f (x) unsigned x; { return (unsigned) (((unsigned long long) x * 0xAAAAAAAB) >> 32) >> 1; } main () { unsigned i; for (i = 0; i < 10000; i++) if (f (i) != i / 3) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930929-1.c ================================================ sub1 (i) int i; { return i - (5 - i); } sub2 (i) int i; { return i + (5 + i); } sub3 (i) int i; { return i - (5 + i); } sub4 (i) int i; { return i + (5 - i); } main() { if (sub1 (20) != 35) abort (); if (sub2 (20) != 45) abort (); if (sub3 (20) != -5) abort (); if (sub4 (20) != 5) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930930-1.c ================================================ __extension__ typedef __PTRDIFF_TYPE__ ptr_t; ptr_t *wm_TR; ptr_t *wm_HB; ptr_t *wm_SPB; ptr_t mem[100]; f (mr_TR, mr_SPB, mr_HB, reg1, reg2) ptr_t *mr_TR; ptr_t *mr_SPB; ptr_t *mr_HB; ptr_t *reg1; ptr_t *reg2; { ptr_t *x = mr_TR; for (;;) { if (reg1 < reg2) goto out; if ((ptr_t *) *reg1 < mr_HB && (ptr_t *) *reg1 >= mr_SPB) *--mr_TR = *reg1; reg1--; } out: if (x != mr_TR) abort (); } main () { mem[99] = (ptr_t) mem; f (mem + 100, mem + 6, mem + 8, mem + 99, mem + 99); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/930930-2.c ================================================ int test_endianness() { union doubleword { double d; unsigned long u[2]; } dw; dw.d = 10; return dw.u[0] != 0 ? 1 : 0; } int test_endianness_vol() { union doubleword { volatile double d; volatile long u[2]; } dw; dw.d = 10; return dw.u[0] != 0 ? 1 : 0; } main () { if (test_endianness () != test_endianness_vol ()) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931002-1.c ================================================ f (void (*func) ()) { func (); } main () { #ifndef NO_TRAMPOLINES void t0 () { } void t1 () { f (t0); } void t2 () { t1 (); } t1 (); t1 (); t2 (); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-1.c ================================================ struct tiny { int c; }; f (int n, struct tiny x, struct tiny y, struct tiny z, long l) { if (x.c != 10) abort(); if (y.c != 11) abort(); if (z.c != 12) abort(); if (l != 123) abort (); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-10.c ================================================ #include struct tiny { char c; char d; }; f (int n, ...) { struct tiny x; int i; va_list ap; va_start (ap,n); for (i = 0; i < n; i++) { x = va_arg (ap,struct tiny); if (x.c != i + 10) abort(); if (x.d != i + 20) abort(); } { long x = va_arg (ap, long); if (x != 123) abort(); } va_end (ap); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; x[0].d = 20; x[1].d = 21; x[2].d = 22; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-11.c ================================================ struct tiny { char c; char d; char e; }; f (int n, struct tiny x, struct tiny y, struct tiny z, long l) { if (x.c != 10) abort(); if (x.d != 20) abort(); if (x.e != 30) abort(); if (y.c != 11) abort(); if (y.d != 21) abort(); if (y.e != 31) abort(); if (z.c != 12) abort(); if (z.d != 22) abort(); if (z.e != 32) abort(); if (l != 123) abort (); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; x[0].d = 20; x[1].d = 21; x[2].d = 22; x[0].e = 30; x[1].e = 31; x[2].e = 32; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-12.c ================================================ #include struct tiny { char c; char d; char e; }; f (int n, ...) { struct tiny x; int i; va_list ap; va_start (ap,n); for (i = 0; i < n; i++) { x = va_arg (ap,struct tiny); if (x.c != i + 10) abort(); if (x.d != i + 20) abort(); if (x.e != i + 30) abort(); } { long x = va_arg (ap, long); if (x != 123) abort(); } va_end (ap); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; x[0].d = 20; x[1].d = 21; x[2].d = 22; x[0].e = 30; x[1].e = 31; x[2].e = 32; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-13.c ================================================ struct tiny { char c; char d; char e; char f; }; f (int n, struct tiny x, struct tiny y, struct tiny z, long l) { if (x.c != 10) abort(); if (x.d != 20) abort(); if (x.e != 30) abort(); if (x.f != 40) abort(); if (y.c != 11) abort(); if (y.d != 21) abort(); if (y.e != 31) abort(); if (y.f != 41) abort(); if (z.c != 12) abort(); if (z.d != 22) abort(); if (z.e != 32) abort(); if (z.f != 42) abort(); if (l != 123) abort (); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; x[0].d = 20; x[1].d = 21; x[2].d = 22; x[0].e = 30; x[1].e = 31; x[2].e = 32; x[0].f = 40; x[1].f = 41; x[2].f = 42; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-14.c ================================================ #include struct tiny { char c; char d; char e; char f; }; f (int n, ...) { struct tiny x; int i; va_list ap; va_start (ap,n); for (i = 0; i < n; i++) { x = va_arg (ap,struct tiny); if (x.c != i + 10) abort(); if (x.d != i + 20) abort(); if (x.e != i + 30) abort(); if (x.f != i + 40) abort(); } { long x = va_arg (ap, long); if (x != 123) abort(); } va_end (ap); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; x[0].d = 20; x[1].d = 21; x[2].d = 22; x[0].e = 30; x[1].e = 31; x[2].e = 32; x[0].f = 40; x[1].f = 41; x[2].f = 42; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-2.c ================================================ #include struct tiny { int c; }; f (int n, ...) { struct tiny x; int i; va_list ap; va_start (ap,n); for (i = 0; i < n; i++) { x = va_arg (ap,struct tiny); if (x.c != i + 10) abort(); } { long x = va_arg (ap, long); if (x != 123) abort(); } va_end (ap); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-3.c ================================================ struct tiny { short c; }; f (int n, struct tiny x, struct tiny y, struct tiny z, long l) { if (x.c != 10) abort(); if (y.c != 11) abort(); if (z.c != 12) abort(); if (l != 123) abort (); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-4.c ================================================ #include struct tiny { short c; }; f (int n, ...) { struct tiny x; int i; va_list ap; va_start (ap,n); for (i = 0; i < n; i++) { x = va_arg (ap,struct tiny); if (x.c != i + 10) abort(); } { long x = va_arg (ap, long); if (x != 123) abort(); } va_end (ap); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-5.c ================================================ struct tiny { short c; short d; }; f (int n, struct tiny x, struct tiny y, struct tiny z, long l) { if (x.c != 10) abort(); if (x.d != 20) abort(); if (y.c != 11) abort(); if (y.d != 21) abort(); if (z.c != 12) abort(); if (z.d != 22) abort(); if (l != 123) abort (); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; x[0].d = 20; x[1].d = 21; x[2].d = 22; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-6.c ================================================ #include struct tiny { short c; short d; }; f (int n, ...) { struct tiny x; int i; va_list ap; va_start (ap,n); for (i = 0; i < n; i++) { x = va_arg (ap,struct tiny); if (x.c != i + 10) abort(); if (x.d != i + 20) abort(); } { long x = va_arg (ap, long); if (x != 123) abort(); } va_end (ap); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; x[0].d = 20; x[1].d = 21; x[2].d = 22; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-7.c ================================================ struct tiny { char c; }; f (int n, struct tiny x, struct tiny y, struct tiny z, long l) { if (x.c != 10) abort(); if (y.c != 11) abort(); if (z.c != 12) abort(); if (l != 123) abort (); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-8.c ================================================ #include struct tiny { char c; }; f (int n, ...) { struct tiny x; int i; va_list ap; va_start (ap,n); for (i = 0; i < n; i++) { x = va_arg (ap,struct tiny); if (x.c != i + 10) abort(); } { long x = va_arg (ap, long); if (x != 123) abort(); } va_end (ap); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931004-9.c ================================================ struct tiny { char c; char d; }; f (int n, struct tiny x, struct tiny y, struct tiny z, long l) { if (x.c != 10) abort(); if (x.d != 20) abort(); if (y.c != 11) abort(); if (y.d != 21) abort(); if (z.c != 12) abort(); if (z.d != 22) abort(); if (l != 123) abort (); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; x[0].d = 20; x[1].d = 21; x[2].d = 22; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931005-1.c ================================================ typedef struct { char x; } T; T f (s1) T s1; { T s1a; s1a.x = s1.x; return s1a; } main () { T s1a, s1b; s1a.x = 100; s1b = f (s1a); if (s1b.x != 100) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931009-1.c ================================================ main () { f (); exit (0); } static g (out, size, lo, hi) int *out, size, lo, hi; { int j; for (j = 0; j < size; j++) out[j] = j * (hi - lo); } f () { int a[2]; g (a, 2, 0, 1); if (a[0] != 0 || a[1] != 1) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931012-1.c ================================================ f (int b, int c) { if (b != 0 && b != 1 && c != 0) b = 0; return b; } main () { if (!f (1, 2)) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931017-1.c ================================================ int v; main () { f (); exit (0); } h1 () { return 0; } h2 (e) int *e; { if (e != &v) abort (); return 0; } g (c) char *c; { int i; int b; do { i = h1 (); if (i == -1) return 0; else if (i == 1) h1 (); } while (i == 1); do b = h2 (&v); while (i == 5); if (i != 2) return b; *c = 'a'; return 0; } f () { char c; g (&c); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931018-1.c ================================================ unsigned int a[0x1000]; extern const unsigned long v; main () { f (v); f (v); exit (0); } f (a) unsigned long a; { if (a != 0xdeadbeefL) abort(); } const unsigned long v = 0xdeadbeefL; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931031-1.c ================================================ /* The bit-field below would have a problem if __INT_MAX__ is too small. */ #if __INT_MAX__ < 2147483647 int main (void) { exit (0); } #else struct foo { unsigned y:1; unsigned x:32; }; int f (x) struct foo x; { int t = x.x; if (t < 0) return 1; return t+1; } main () { struct foo x; x.x = -1; if (f (x) == 0) abort (); exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931102-1.c ================================================ typedef union { struct { char h, l; } b; } T; f (x) int x; { int num = 0; T reg; reg.b.l = x; while ((reg.b.l & 1) == 0) { num++; reg.b.l >>= 1; } return num; } main () { if (f (2) != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931102-2.c ================================================ typedef union { long align; struct { short h, l; } b; } T; f (x) int x; { int num = 0; T reg; reg.b.l = x; while ((reg.b.l & 1) == 0) { num++; reg.b.l >>= 1; } return num; } main () { if (f (2) != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931110-1.c ================================================ typedef struct { short f:3, g:3, h:10; } small; struct { int i; small s[10]; } x; main () { int i; for (i = 0; i < 10; i++) x.s[i].f = 0; exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931110-2.c ================================================ main () { static int a[] = {3, 4}; register int *b; int c; b = a; c = *b++ % 8; if (c != 3) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931208-1.c ================================================ f () { unsigned long x, y = 1; x = ((y * 8192) - 216) / 16; return x; } main () { if (f () != 498) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/931228-1.c ================================================ f (x) { x &= 010000; x &= 007777; x ^= 017777; x &= 017770; return x; } main () { if (f (-1) != 017770) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/940115-1.c ================================================ f (cp, end) char *cp; char *end; { return (cp < end); } main () { if (! f ((char *) 0, (char *) 1)) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/940122-1.c ================================================ char *a = 0; char *b = 0; g (x) int x; { if ((!!a) != (!!b)) abort (); } f (x) int x; { g (x * x); } main () { f (100); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/941014-1.c ================================================ int f (int a, int b) { } main () { unsigned long addr1; unsigned long addr2; addr1 = (unsigned long) &f; addr1 += 5; addr2 = 5 + (unsigned long) &f; if (addr1 != addr2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/941014-2.c ================================================ #include #include typedef struct { unsigned short a; unsigned short b; } foo_t; void a1 (unsigned long offset) {} volatile foo_t * f () { volatile foo_t *foo_p = (volatile foo_t *)malloc (sizeof (foo_t)); a1((unsigned long)foo_p-30); if (foo_p->a & 0xf000) printf("%d\n", foo_p->a); foo_p->b = 0x0100; a1 ((unsigned long)foo_p + 2); a1 ((unsigned long)foo_p - 30); return foo_p; } main () { volatile foo_t *foo_p; foo_p = f (); if (foo_p->b != 0x0100) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/941015-1.c ================================================ int foo1 (value) long long value; { register const long long constant = 0xc000000080000000LL; if (value < constant) return 1; else return 2; } int foo2 (value) unsigned long long value; { register const unsigned long long constant = 0xc000000080000000LL; if (value < constant) return 1; else return 2; } main () { unsigned long long value = 0xc000000000000001LL; int x, y; x = foo1 (value); y = foo2 (value); if (x != y || x != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/941021-1.c ================================================ double glob_dbl; f (pdbl, value) double *pdbl; double value; { if (pdbl == 0) pdbl = &glob_dbl; *pdbl = value; } main () { f ((void *) 0, 55.1); if (glob_dbl != 55.1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/941025-1.c ================================================ long f (x, y) long x,y; { return (x > 1) ? y : (y & 1); } main () { if (f (2L, 0xdecadeL) != 0xdecadeL) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/941031-1.c ================================================ typedef long mpt; int f (mpt us, mpt vs) { long aus; long avs; aus = us >= 0 ? us : -us; avs = vs >= 0 ? vs : -vs; if (aus < avs) { long t = aus; aus = avs; avs = aus; } return avs; } main () { if (f ((mpt) 3, (mpt) 17) != 17) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/941101-1.c ================================================ f () { int var = 7; if ((var/7) == 1) return var/7; return 0; } main () { if (f () != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/941110-1.c ================================================ f (const int x) { int y = 0; y = x ? y : -y; { const int *p = &x; } return y; } main () { if (f (0)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/941202-1.c ================================================ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ g (x, y) { if (x != 3) abort (); } static inline f (int i) { int *tmp; tmp = (int *) alloca (sizeof (i)); *tmp = i; g (*tmp, 0); } main () { f (3); exit (0); }; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950221-1.c ================================================ struct parsefile { long fd; char *buf; }; struct parsefile basepf; struct parsefile *parsefile = &basepf; #ifdef STACK_SIZE int filler[STACK_SIZE / (2*sizeof(int))]; #else int filler[0x3000]; #endif int el; char * g1 (a, b) int a; int *b; { } g2 (a) long a; { if (a != 0xdeadbeefL) abort (); exit (0); } f () { register char *p, *q; register int i; register int something; if (parsefile->fd == 0L && el) { const char *rl_cp; int len; rl_cp = g1 (el, &len); strcpy (p, rl_cp); } else { alabel: i = g2 (parsefile->fd); } } main () { el = 0; parsefile->fd = 0xdeadbeefL; f (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950322-1.c ================================================ f (unsigned char *a) { int i, j; int x, y; j = a[1]; i = a[0] - j; if (i < 0) { x = 1; y = -i; } else { x = 0; y = i; } return x + y; } main () { unsigned char a[2]; a[0] = 8; a[1] = 9; if (f (a) != 2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950426-1.c ================================================ struct tag { int m1; char *m2[5]; } s1, *p1; int i; main() { s1.m1 = -1; p1 = &s1; if ( func1( &p1->m1 ) == -1 ) foo ("ok"); else abort (); i = 3; s1.m2[3]= "123"; if ( strlen( (p1->m2[i])++ ) == 3 ) foo ("ok"); else abort (); exit (0); } func1(int *p) { return(*p); } foo (char *s) {} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950426-2.c ================================================ main() { long int i = -2147483647L - 1L; /* 0x80000000 */ char ca = 1; if (i >> ca != -1073741824L) abort (); if (i >> i / -2000000000L != -1073741824L) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950503-1.c ================================================ main () { int tmp; unsigned long long utmp1, utmp2; tmp = 16; utmp1 = (~((unsigned long long) 0)) >> tmp; utmp2 = (~((unsigned long long) 0)) >> 16; if (utmp1 != utmp2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950511-1.c ================================================ main () { unsigned long long xx; unsigned long long *x = (unsigned long long *) &xx; *x = -3; *x = *x * *x; if (*x != 9) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950512-1.c ================================================ unsigned f1 (x) { return ((unsigned) (x != 0) - 3) / 2; } unsigned long long f2 (x) { return ((unsigned long long) (x != 0) - 3) / 2; } main () { if (f1 (1) != (~(unsigned) 0) >> 1) abort (); if (f1 (0) != ((~(unsigned) 0) >> 1) - 1) abort (); if (f2 (1) != (~(unsigned long long) 0) >> 1) abort (); if (f2 (0) != ((~(unsigned long long) 0) >> 1) - 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950605-1.c ================================================ f (c) unsigned char c; { if (c != 0xFF) abort (); } main () { f (-1); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950607-1.c ================================================ main () { struct { long status; } h; h.status = 0; if (((h.status & 128) == 1) && ((h.status & 32) == 0)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950607-2.c ================================================ typedef struct { long int p_x, p_y; } Point; int f (Point basePt, Point pt1, Point pt2) { long long vector; vector = (long long) (pt1.p_x - basePt.p_x) * (long long) (pt2.p_y - basePt.p_y) - (long long) (pt1.p_y - basePt.p_y) * (long long) (pt2.p_x - basePt.p_x); if (vector > (long long) 0) return 0; else if (vector < (long long) 0) return 1; else return 2; } main () { Point b, p1, p2; int answer; b.p_x = -23250; b.p_y = 23250; p1.p_x = 23250; p1.p_y = -23250; p2.p_x = -23250; p2.p_y = -23250; answer = f (b, p1, p2); if (answer != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950612-1.c ================================================ unsigned int f1 (int diff) { return ((unsigned int) (diff < 0 ? -diff : diff)); } unsigned int f2 (unsigned int diff) { return ((unsigned int) ((signed int) diff < 0 ? -diff : diff)); } unsigned long long f3 (long long diff) { return ((unsigned long long) (diff < 0 ? -diff : diff)); } unsigned long long f4 (unsigned long long diff) { return ((unsigned long long) ((signed long long) diff < 0 ? -diff : diff)); } main () { int i; for (i = 0; i <= 10; i++) { if (f1 (i) != i) abort (); if (f1 (-i) != i) abort (); if (f2 (i) != i) abort (); if (f2 (-i) != i) abort (); if (f3 ((long long) i) != i) abort (); if (f3 ((long long) -i) != i) abort (); if (f4 ((long long) i) != i) abort (); if (f4 ((long long) -i) != i) abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950621-1.c ================================================ struct s { int a; int b; struct s *dummy; }; f (struct s *sp) { return sp && sp->a == -1 && sp->b == -1; } main () { struct s x; x.a = x.b = -1; if (f (&x) == 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950628-1.c ================================================ typedef struct { char hours, day, month; short year; } T; T g (void) { T now; now.hours = 1; now.day = 2; now.month = 3; now.year = 4; return now; } T f (void) { T virk; virk = g (); return virk; } main () { if (f ().hours != 1 || f ().day != 2 || f ().month != 3 || f ().year != 4) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950704-1.c ================================================ int errflag; long long f (long long x, long long y) { long long r; errflag = 0; r = x + y; if (x >= 0) { if ((y < 0) || (r >= 0)) return r; } else { if ((y > 0) || (r < 0)) return r; } errflag = 1; return 0; } main () { f (0, 0); if (errflag) abort (); f (1, -1); if (errflag) abort (); f (-1, 1); if (errflag) abort (); f (0x8000000000000000LL, 0x8000000000000000LL); if (!errflag) abort (); f (0x8000000000000000LL, -1LL); if (!errflag) abort (); f (0x7fffffffffffffffLL, 0x7fffffffffffffffLL); if (!errflag) abort (); f (0x7fffffffffffffffLL, 1LL); if (!errflag) abort (); f (0x7fffffffffffffffLL, 0x8000000000000000LL); if (errflag) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950706-1.c ================================================ int f (int n) { return (n > 0) - (n < 0); } main () { if (f (-1) != -1) abort (); if (f (1) != 1) abort (); if (f (0) != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950710-1.c ================================================ struct twelve { int a; int b; int c; }; struct pair { int first; int second; }; struct pair g () { struct pair p; return p; } static void f () { int i; for (i = 0; i < 1; i++) { int j; for (j = 0; j < 1; j++) { if (0) { int k; for (k = 0; k < 1; k++) { struct pair e = g (); } } else { struct twelve a, b; if ((((char *) &b - (char *) &a) < 0 ? (-((char *) &b - (char *) &a)) : ((char *) &b - (char *) &a)) < sizeof (a)) abort (); } } } } main () { f (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950714-1.c ================================================ int array[10] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; main () { int i, j; int *p; for (i = 0; i < 10; i++) for (p = &array[0]; p != &array[9]; p++) if (*p == i) goto label; label: if (i != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950809-1.c ================================================ struct S { int *sp, fc, *sc, a[2]; }; f (struct S *x) { int *t = x->sc; int t1 = t[0]; int t2 = t[1]; int t3 = t[2]; int a0 = x->a[0]; int a1 = x->a[1]; t[2] = t1; t[0] = a1; x->a[1] = a0; x->a[0] = t3; x->fc = t2; x->sp = t; } main () { struct S s; static int sc[3] = {2, 3, 4}; s.sc = sc; s.a[0] = 10; s.a[1] = 11; f (&s); if (s.sp[2] != 2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950906-1.c ================================================ g (int i) { } f (int i) { g (0); while ( ({ i--; }) ) g (0); } main () { f (10); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950915-1.c ================================================ long int a = 100000; long int b = 21475; long f () { return ((long long) a * (long long) b) >> 16; } main () { if (f () < 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/950929-1.c ================================================ int f (char *p) { } main () { char c; char c2; int i = 0; char *pc = &c; char *pc2 = &c2; int *pi = &i; *pc2 = 1; *pi = 1; *pc2 &= *pi; f (pc2); *pc2 = 1; *pc2 &= *pi; if (*pc2 != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/951003-1.c ================================================ int f (i) { return 12; } int g () { return 0; } main () { int i, s; for (i = 0; i < 32; i++) { s = f (i); if (i == g ()) s = 42; if (i == 0 || s == 12) ; else abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/951115-1.c ================================================ int var = 0; g () { var = 1; } f () { int f2 = 0; if (f2 == 0) ; g (); } main () { f (); if (var != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/951204-1.c ================================================ f (char *x) { *x = 'x'; } main () { int i; char x = '\0'; for (i = 0; i < 100; ++i) { f (&x); if (*(const char *) &x != 'x') abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960116-1.c ================================================ static inline p (int *p) { return !((long) p & 1); } int f (int *q) { if (p (q) && *q) return 1; return 0; } main () { if (f ((int*) 0xffffffff) != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960117-1.c ================================================ static char id_space[2] [32 +1]; typedef short COUNT; typedef char TEXT; union T_VALS { TEXT *id __attribute__ ((aligned (2), packed)) ; }; typedef union T_VALS VALS; struct T_VAL { COUNT pos __attribute__ ((aligned (2), packed)) ; VALS vals __attribute__ ((aligned (2), packed)) ; }; typedef struct T_VAL VAL; VAL curval = {0}; static short idc = 0; static int cur_line; static int char_pos; typedef unsigned short WORD; WORD get_id (char c) { curval.vals.id[0] = c; } WORD get_tok () { char c = 'c'; curval.vals.id = id_space[idc]; curval.pos = (cur_line << 10) | char_pos; return get_id (c); } main () { get_tok (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960209-1.c ================================================ struct a_struct { unsigned char a_character; }; struct a_struct an_array[5]; struct a_struct *a_ptr; int yabba = 1; int f (a, b) unsigned char a; unsigned long b; { long i, j, p, q, r, s; if (b != (unsigned long) 0) { if (yabba) return -1; s = 4000000 / b; for (i = 0; i < 11; i++) { for (j = 0; j < 256; j++) { if (((p - s < 0) ? -s : 0) < (( q - s < 0) ? -s : q)) r = i; } } } if (yabba) return 0; a_ptr = &an_array[a]; a_ptr->a_character = (unsigned char) r; } main () { if (f (1, 0UL) != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960215-1.c ================================================ long double C = 2; long double U = 1; long double Y2 = 3; long double Y1 = 1; long double X, Y, Z, T, R, S; main () { X = (C + U) * Y2; Y = C - U - U; Z = C + U + U; T = (C - U) * Y1; X = X - (Z + U); R = Y * Y1; S = Z * Y2; T = T - Y; Y = (U - Y) + R; Z = S - (Z + U + U); R = (Y2 + U) * Y1; Y1 = Y2 * Y1; R = R - Y2; Y1 = Y1 - 0.5L; if (Z != 6) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960218-1.c ================================================ int glob; g (x) { glob = x; return 0; } f (x) { int a = ~x; while (a) a = g (a); } main () { f (3); if (glob != -4) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960219-1.c ================================================ f (int i) { if (((1 << i) & 1) == 0) abort (); } main () { f (0); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960301-1.c ================================================ struct foo { unsigned : 12; unsigned field : 4; } foo; unsigned oldfoo; int bar (unsigned k) { oldfoo = foo.field; foo.field = k; if (k) return 1; return 2; } main () { if (bar (1U) != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960302-1.c ================================================ long a = 1; foo () { switch (a % 2 % 2 % 2 % 2 % 2 % 2 % 2 % 2) { case 0: return 0; case 1: return 1; default: return -1; } } main () { if (foo () != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960311-1.c ================================================ #include #ifdef DEBUG #define abort() printf ("error, line %d\n", __LINE__) #endif int count; void a1() { ++count; } void b (unsigned char data) { if (data & 0x80) a1(); data <<= 1; if (data & 0x80) a1(); data <<= 1; if (data & 0x80) a1(); } main () { count = 0; b (0); if (count != 0) abort (); count = 0; b (0x80); if (count != 1) abort (); count = 0; b (0x40); if (count != 1) abort (); count = 0; b (0x20); if (count != 1) abort (); count = 0; b (0xc0); if (count != 2) abort (); count = 0; b (0xa0); if (count != 2) abort (); count = 0; b (0x60); if (count != 2) abort (); count = 0; b (0xe0); if (count != 3) abort (); #ifdef DEBUG printf ("Done.\n"); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960311-2.c ================================================ #include #ifdef DEBUG #define abort() printf ("error, line %d\n", __LINE__) #endif int count; void a1() { ++count; } void b (unsigned short data) { if (data & 0x8000) a1(); data <<= 1; if (data & 0x8000) a1(); data <<= 1; if (data & 0x8000) a1(); } main () { count = 0; b (0); if (count != 0) abort (); count = 0; b (0x8000); if (count != 1) abort (); count = 0; b (0x4000); if (count != 1) abort (); count = 0; b (0x2000); if (count != 1) abort (); count = 0; b (0xc000); if (count != 2) abort (); count = 0; b (0xa000); if (count != 2) abort (); count = 0; b (0x6000); if (count != 2) abort (); count = 0; b (0xe000); if (count != 3) abort (); #ifdef DEBUG printf ("Done.\n"); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960311-3.c ================================================ #include #ifdef DEBUG #define abort() printf ("error, line %d\n", __LINE__) #endif int count; void a1() { ++count; } void b (unsigned long data) { if (data & 0x80000000) a1(); data <<= 1; if (data & 0x80000000) a1(); data <<= 1; if (data & 0x80000000) a1(); } main () { count = 0; b (0); if (count != 0) abort (); count = 0; b (0x80000000); if (count != 1) abort (); count = 0; b (0x40000000); if (count != 1) abort (); count = 0; b (0x20000000); if (count != 1) abort (); count = 0; b (0xc0000000); if (count != 2) abort (); count = 0; b (0xa0000000); if (count != 2) abort (); count = 0; b (0x60000000); if (count != 2) abort (); count = 0; b (0xe0000000); if (count != 3) abort (); #ifdef DEBUG printf ("Done.\n"); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960312-1.c ================================================ struct S { int *sp, fc, *sc, a[2]; }; f (struct S *x) { int *t = x->sc; int t1 = t[0]; int t2 = t[1]; int t3 = t[2]; int a0 = x->a[0]; int a1 = x->a[1]; asm("": :"r" (t2), "r" (t3)); t[2] = t1; t[0] = a1; x->a[1] = a0; x->a[0] = t3; x->fc = t2; x->sp = t; } main () { struct S s; static int sc[3] = {2, 3, 4}; s.sc = sc; s.a[0] = 10; s.a[1] = 11; f (&s); if (s.sp[2] != 2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960317-1.c ================================================ int f (unsigned bitcount, int mant) { int mask = -1 << bitcount; { if (! (mant & -mask)) goto ab; if (mant & ~mask) goto auf; } ab: return 0; auf: return 1; } main () { if (f (0, -1)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960321-1.c ================================================ char a[10] = "deadbeef"; char acc_a (long i) { return a[i-2000000000L]; } main () { if (acc_a (2000000000L) != 'd') abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960326-1.c ================================================ struct s { int a; int b; short c; int d[3]; }; struct s s = { .b = 3, .d = {2,0,0} }; main () { if (s.b != 3) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960327-1.c ================================================ #include g () { return '\n'; } f () { char s[] = "abcedfg012345"; char *sp = s + 12; switch (g ()) { case '\n': break; } while (*--sp == '0') ; sprintf (sp + 1, "X"); if (s[12] != 'X') abort (); } main () { f (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960402-1.c ================================================ f (signed long long int x) { return x > 0xFFFFFFFFLL || x < -0x80000000LL; } main () { if (f (0) != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960405-1.c ================================================ #define X 5.9486574767861588254287966331400356538172e4931L long double x = X + X; long double y = 2.0L * X; main () { #if ! defined (__vax__) && ! defined (_CRAY) if (x != y) abort (); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960416-1.c ================================================ typedef unsigned long int st; typedef unsigned long long dt; typedef union { dt d; struct { st h, l; } s; } t_be; typedef union { dt d; struct { st l, h; } s; } t_le; #define df(f, t) \ int \ f (t afh, t bfh) \ { \ t hh; \ t hp, lp, dp, m; \ st ad, bd; \ int s; \ s = 0; \ ad = afh.s.h - afh.s.l; \ bd = bfh.s.l - bfh.s.h; \ if (bd > bfh.s.l) \ { \ bd = -bd; \ s = ~s; \ } \ lp.d = (dt) afh.s.l * bfh.s.l; \ hp.d = (dt) afh.s.h * bfh.s.h; \ dp.d = (dt) ad *bd; \ dp.d ^= s; \ hh.d = hp.d + hp.s.h + lp.s.h + dp.s.h; \ m.d = (dt) lp.s.h + hp.s.l + lp.s.l + dp.s.l; \ return hh.s.l + m.s.l; \ } df(f_le, t_le) df(f_be, t_be) main () { t_be x; x.s.h = 0x10000000U; x.s.l = 0xe0000000U; if (x.d == 0x10000000e0000000ULL && f_be ((t_be) 0x100000000ULL, (t_be) 0x100000000ULL) != -1) abort (); if (x.d == 0xe000000010000000ULL && f_le ((t_le) 0x100000000ULL, (t_le) 0x100000000ULL) != -1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960419-1.c ================================================ static int i; void check(x) int x; { if (!x) abort(); } main() { int *p = &i; check(p != (void *)0); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960419-2.c ================================================ #define SIZE 8 main() { int a[SIZE] = {1}; int i; for (i = 1; i < SIZE; i++) if (a[i] != 0) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960512-1.c ================================================ __complex__ double f () { int a[40]; __complex__ double c; a[9] = 0; c = a[9]; return c; } main () { __complex__ double c; if (c = f ()) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960513-1.c ================================================ long double f (d, i) long double d; int i; { long double e; d = -d; e = d; if (i == 1) d *= 2; d -= e * d; d -= e * d; d -= e * d; d -= e * d; d -= e * d; return d; } main () { if (! (int) (f (2.0L, 1))) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960521-1.c ================================================ #include int *a, *b; int n; #ifdef STACK_SIZE #define BLOCK_SIZE (STACK_SIZE / (sizeof (*a) + sizeof (*b))) #else #define BLOCK_SIZE 32768 #endif foo () { int i; for (i = 0; i < n; i++) a[i] = -1; for (i = 0; i < BLOCK_SIZE - 1; i++) b[i] = -1; } main () { n = BLOCK_SIZE; a = malloc (n * sizeof(*a)); b = malloc (n * sizeof(*b)); *b++ = 0; foo (); if (b[-1]) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960608-1.c ================================================ typedef struct { unsigned char a : 2; unsigned char b : 3; unsigned char c : 1; unsigned char d : 1; unsigned char e : 1; } a_struct; foo (flags) a_struct *flags; { return (flags->c != 0 || flags->d != 1 || flags->e != 1 || flags->a != 2 || flags->b != 3); } main () { a_struct flags; flags.c = 0; flags.d = 1; flags.e = 1; flags.a = 2; flags.b = 3; if (foo (&flags) != 0) abort (); else exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960801-1.c ================================================ unsigned f () { long long l2; unsigned short us; unsigned long long ul; short s2; ul = us = l2 = s2 = -1; return ul; } unsigned long long g () { long long l2; unsigned short us; unsigned long long ul; short s2; ul = us = l2 = s2 = -1; return ul; } main () { if (f () != (unsigned short) -1) abort (); if (g () != (unsigned short) -1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960802-1.c ================================================ long val = 0x5e000000; long f1 (void) { return 0x132; } long f2 (void) { return 0x5e000000; } void f3 (long b) { val = b; } void f4 () { long v = f1 (); long o = f2 (); v = (v & 0x00ffffff) | (o & 0xff000000); f3 (v); } main () { f4 (); if (val != 0x5e000132) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960830-1.c ================================================ #ifdef __i386__ f (rp) unsigned int *rp; { __asm__ ("mull %3" : "=a" (rp[0]), "=d" (rp[1]) : "%0" (7), "rm" (7)); } main () { unsigned int s[2]; f (s); if (s[1] != 0 || s[0] != 49) abort (); exit (0); } #else main () { exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/960909-1.c ================================================ int ffs (x) int x; { int bit, mask; if (x == 0) return 0; for (bit = 1, mask = 1; !(x & mask); bit++, mask <<= 1) ; return bit; } f (x) int x; { int y; y = ffs (x) - 1; if (y < 0) abort (); } main () { f (1); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/961004-1.c ================================================ int k = 0; main() { int i; int j; for (i = 0; i < 2; i++) { if (k) { if (j != 2) abort (); } else { j = 2; k++; } } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/961017-1.c ================================================ main () { unsigned char z = 0; do ; while (--z > 0); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/961017-2.c ================================================ main () { int i = 0; if (sizeof (unsigned long int) == 4) { unsigned long int z = 0; do { z -= 0x00004000; i++; if (i > 0x00040000) abort (); } while (z > 0); exit (0); } else if (sizeof (unsigned int) == 4) { unsigned int z = 0; do { z -= 0x00004000; i++; if (i > 0x00040000) abort (); } while (z > 0); exit (0); } else exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/961026-1.c ================================================ int test (arg) int arg; { if (arg > 0 || arg == 0) return 0; return -1; } main () { if (test (0) != 0) abort (); if (test (-1) != -1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/961112-1.c ================================================ f (x) { if (x != 0 || x == 0) return 0; return 1; } main () { if (f (3)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/961122-1.c ================================================ long long acc; addhi (short a) { acc += (long long) a << 32; } subhi (short a) { acc -= (long long) a << 32; } main () { acc = 0xffff00000000ll; addhi (1); if (acc != 0x1000000000000ll) abort (); subhi (1); if (acc != 0xffff00000000ll) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/961122-2.c ================================================ int f (int a) { return ((a >= 0 && a <= 10) && ! (a >= 0)); } main () { if (f (0)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/961125-1.c ================================================ static char * begfield (int tab, char *ptr, char *lim, int sword, int schar) { if (tab) { while (ptr < lim && sword--) { while (ptr < lim && *ptr != tab) ++ptr; if (ptr < lim) ++ptr; } } else { while (1) ; } if (ptr + schar <= lim) ptr += schar; return ptr; } main () { char *s = ":ab"; char *lim = s + 3; if (begfield (':', s, lim, 1, 1) != s + 2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/961206-1.c ================================================ int sub1 (unsigned long long i) { if (i < 0x80000000) return 1; else return 0; } int sub2 (unsigned long long i) { if (i <= 0x7FFFFFFF) return 1; else return 0; } int sub3 (unsigned long long i) { if (i >= 0x80000000) return 0; else return 1; } int sub4 (unsigned long long i) { if (i > 0x7FFFFFFF) return 0; else return 1; } main() { if (sub1 (0x80000000ULL)) abort (); if (sub2 (0x80000000ULL)) abort (); if (sub3 (0x80000000ULL)) abort (); if (sub4 (0x80000000ULL)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/961213-1.c ================================================ int g (unsigned long long int *v, int n, unsigned int a[], int b) { int cnt; *v = 0; for (cnt = 0; cnt < n; ++cnt) *v = *v * b + a[cnt]; return n; } main () { int res; unsigned int ar[] = { 10, 11, 12, 13, 14 }; unsigned long long int v; res = g (&v, sizeof(ar)/sizeof(ar[0]), ar, 16); if (v != 0xabcdeUL) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/961223-1.c ================================================ /* { dg-options "-fgnu89-inline" } */ extern void exit (int); extern void abort (void); struct s { double d; }; inline struct s sub (struct s s) { s.d += 1.0; return s; } int main () { struct s t = { 2.0 }; t = sub (t); if (t.d != 3.0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/970214-1.c ================================================ #define L 1 main () { exit (L'1' != L'1'); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/970214-2.c ================================================ #define m(L) (L'1' + (L)) main () { exit (m (0) != L'1'); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/970217-1.c ================================================ sub (int i, int array[i++]) { return i; } main() { int array[10]; exit (sub (10, array) != 11); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/970923-1.c ================================================ int ts(a) int a; { if (a < 1000 && a > 2000) return 1; else return 0; } int tu(a) unsigned int a; { if (a < 1000 && a > 2000) return 1; else return 0; } main() { if (ts (0) || tu (0)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980205.c ================================================ #include void fdouble (double one, ...) { double value; va_list ap; va_start (ap, one); value = va_arg (ap, double); va_end (ap); if (one != 1.0 || value != 2.0) abort (); } int main () { fdouble (1.0, 2.0); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980223.c ================================================ typedef struct { char *addr; long type; } object; object bar (object blah) { abort(); } object foo (object x, object y) { object z = *(object*)(x.addr); if (z.type & 64) { y = *(object*)(z.addr+sizeof(object)); z = *(object*)(z.addr); if (z.type & 64) y = bar(y); } return y; } int nil; object cons1[2] = { {(char *) &nil, 0}, {(char *) &nil, 0} }; object cons2[2] = { {(char *) &cons1, 64}, {(char *) &nil, 0} }; main() { object x = {(char *) &cons2, 64}; object y = {(char *) &nil, 0}; object three = foo(x,y); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980424-1.c ================================================ int i, a[99]; void f (int one) { if (one != 1) abort (); } void g () { f (a[i & 0x3f]); } int main () { a[0] = 1; i = 0x40; g (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980505-1.c ================================================ static int f(int) __attribute__((const)); int main() { int f1, f2, x; x = 1; f1 = f(x); x = 2; f2 = f(x); if (f1 != 1 || f2 != 2) abort (); exit (0); } static int f(int x) { return x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980505-2.c ================================================ typedef unsigned short Uint16; typedef unsigned int Uint; Uint f () { Uint16 token; Uint count; static Uint16 values[1] = {0x9300}; token = values[0]; count = token >> 8; return count; } int main () { if (f () != 0x93) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980506-1.c ================================================ struct decision { char enforce_mode; struct decision *next; }; static void clear_modes (p) register struct decision *p; { goto blah; foo: p->enforce_mode = 0; blah: if (p) goto foo; } main() { struct decision *p = 0; clear_modes (p); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980506-2.c ================================================ static void *self(void *p){ return p; } int f() { struct { int i; } s, *sp; int *ip = &s.i; s.i = 1; sp = self(&s); *ip = 0; return sp->i+1; } main() { if (f () != 1) abort (); else exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980506-3.c ================================================ unsigned char lookup_table [257]; static int build_lookup (pattern) unsigned char *pattern; { int m; m = strlen (pattern) - 1; memset (lookup_table, ++m, 257); return m; } int main(argc, argv) int argc; char **argv; { if (build_lookup ("bind") != 4) abort (); else exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980526-1.c ================================================ /* { dg-skip-if "requires indirect jumps" { ! indirect_jumps } { "-O0" } { "" } } */ /* { dg-skip-if "requires label values" { ! label_values } { "-O0" } { "" } } */ int expect_do1 = 1, expect_do2 = 2; static int doit(int x){ __label__ lbl1; __label__ lbl2; static int jtab_init = 0; static void *jtab[2]; if(!jtab_init) { jtab[0] = &&lbl1; jtab[1] = &&lbl2; jtab_init = 1; } goto *jtab[x]; lbl1: return 1; lbl2: return 2; } static void do1(void) { if (doit(0) != expect_do1) abort (); } static void do2(void){ if (doit(1) != expect_do2) abort (); } int main(void){ #ifndef NO_LABEL_VALUES do1(); do2(); #endif exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980526-2.c ================================================ typedef unsigned int dev_t; typedef unsigned int kdev_t; static inline kdev_t to_kdev_t(int dev) { int major, minor; if (sizeof(kdev_t) == 16) return (kdev_t)dev; major = (dev >> 8); minor = (dev & 0xff); return ((( major ) << 22 ) | ( minor )) ; } void do_mknod(const char * filename, int mode, kdev_t dev) { if (dev==0x15800078) exit(0); else abort(); } char * getname(const char * filename) { register unsigned int a1,a2,a3,a4,a5,a6,a7,a8,a9; a1 = (unsigned int)(filename) *5 + 1; a2 = (unsigned int)(filename) *6 + 2; a3 = (unsigned int)(filename) *7 + 3; a4 = (unsigned int)(filename) *8 + 4; a5 = (unsigned int)(filename) *9 + 5; a6 = (unsigned int)(filename) *10 + 5; a7 = (unsigned int)(filename) *11 + 5; a8 = (unsigned int)(filename) *12 + 5; a9 = (unsigned int)(filename) *13 + 5; return (char *)(a1*a2+a3*a4+a5*a6+a7*a8+a9); } int sys_mknod(const char * filename, int mode, dev_t dev) { int error; char * tmp; tmp = getname(filename); error = ((long)( tmp )) ; do_mknod(tmp,mode,to_kdev_t(dev)); return error; } int main(void) { if (sizeof (int) != 4) exit (0); return sys_mknod("test",1,0x12345678); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980526-3.c ================================================ int compare(x, y) unsigned int x; unsigned int y; { if (x==y) return 0; else return 1; } main() { unsigned int i, j, k, l; i = 5; j = 2; k=0; l=2; if (compare(5%(~(unsigned) 2), i%~j) || compare(0, k%~l)) abort(); else exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980602-1.c ================================================ main() { int i; for (i = 1; i < 100; i++) ; if (i == 100) exit (0); abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980602-2.c ================================================ /* The bit-field below would have a problem if __INT_MAX__ is too small. */ #if __INT_MAX__ < 2147483647 int main (void) { exit (0); } #else struct { unsigned bit : 30; } t; int main() { if (!(t.bit++)) exit (0); else abort (); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980604-1.c ================================================ int a = 1; int b = -1; int c = 1; int d = 0; main () { double e; double f; double g; f = c; g = d; e = (a < b) ? f : g; if (e) abort (); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980605-1.c ================================================ #include #ifndef STACK_SIZE #define STACK_SIZE 200000 #endif __inline__ static int dummy (x) { int y; y = (long) (x * 4711.3); return y; } int getval (void); int f2 (double x) { unsigned short s; int a, b, c, d, e, f, g, h, i, j; a = getval (); b = getval (); c = getval (); d = getval (); e = getval (); f = getval (); g = getval (); h = getval (); i = getval (); j = getval (); s = x; return a + b + c + d + e + f + g + h + i + j + s; } int x = 1; int getval (void) { return x++; } char buf[10]; void f () { char ar[STACK_SIZE/2]; int a, b, c, d, e, f, g, h, i, j, k; a = getval (); b = getval (); c = getval (); d = getval (); e = getval (); f = getval (); g = getval (); h = getval (); i = getval (); j = getval (); k = f2 (17.0); sprintf (buf, "%d\n", a + b + c + d + e + f + g + h + i + j + k); if (a + b + c + d + e + f + g + h + i + j + k != 227) abort (); } main () { f (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980608-1.c ================================================ /* { dg-options "-fgnu89-inline" } */ #include extern void abort(void); extern void exit (int); void f1(int a,int b,int c,int d,int e, int f,int g,int h,int i,int j, int k,int l,int m,int n,int o) { return; } inline void debug(const char *msg,...) { va_list ap; va_start( ap, msg ); f1(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); if ( va_arg(ap,int) != 101) abort(); if ( va_arg(ap,int) != 102) abort(); if ( va_arg(ap,int) != 103) abort(); if ( va_arg(ap,int) != 104) abort(); if ( va_arg(ap,int) != 105) abort(); if ( va_arg(ap,int) != 106) abort(); va_end( ap ); } int main(void) { debug("%d %d %d %d %d %d\n", 101, 102, 103, 104, 105, 106); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980612-1.c ================================================ struct fd { unsigned char a; unsigned char b; } f = { 5 }; struct fd *g() { return &f; } int h() { return -1; } int main() { struct fd *f = g(); f->b = h(); if (((f->a & 0x7f) & ~0x10) <= 2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980617-1.c ================================================ void foo (unsigned int * p) { if ((signed char)(*p & 0xFF) == 17 || (signed char)(*p & 0xFF) == 18) return; else abort (); } int main () { int i = 0x30011; foo(&i); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980618-1.c ================================================ void func(int, int); int main() { int x = 7; func(!x, !7); exit (0); } void func(int x, int y) { if (x == y) return; else abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980701-1.c ================================================ ns_name_skip (unsigned char **x, unsigned char *y) { *x = 0; return 0; } unsigned char a[2]; int dn_skipname(unsigned char *ptr, unsigned char *eom) { unsigned char *saveptr = ptr; if (ns_name_skip(&ptr, eom) == -1) return (-1); return (ptr - saveptr); } main() { if (dn_skipname (&a[0], &a[1]) == 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980707-1.c ================================================ #include #include char ** buildargv (char *input) { static char *arglist[256]; int numargs = 0; while (1) { while (*input == ' ') input++; if (*input == 0) break; arglist [numargs++] = input; while (*input != ' ' && *input != 0) input++; if (*input == 0) break; *(input++) = 0; } arglist [numargs] = NULL; return arglist; } int main() { char **args; char input[256]; int i; strcpy(input, " a b"); args = buildargv(input); if (strcmp (args[0], "a")) abort (); if (strcmp (args[1], "b")) abort (); if (args[2] != NULL) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980709-1.c ================================================ /* { dg-xfail-if "Can not call system libm.a with -msoft-float" { powerpc-*-aix* rs6000-*-aix* } { "-msoft-float" } { "" } } */ #include main() { volatile double a; double c; a = 32.0; c = pow(a, 1.0/3.0); if (c + 0.1 > 3.174802 && c - 0.1 < 3.174802) exit (0); else abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980716-1.c ================================================ #include void stub(int num, ...) { va_list ap; char *end; int i; for (i = 0; i < 2; i++) { va_start(ap, num); while ( 1 ) { end = va_arg(ap, char *); if (!end) break; } va_end(ap); } } int main() { stub(1, "ab", "bc", "cx", (char *)0); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/980929-1.c ================================================ void f(int i) { if (i != 1000) abort (); } int main() { int n=1000; int i; f(n); for(i=0; i<1; ++i) { f(n); n=666; &n; } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/981001-1.c ================================================ #define NG 0x100L unsigned long flg = 0; long sub (int n) { int a, b ; if (n >= 2) { if (n % 2 == 0) { a = sub (n / 2); return (a + 2 * sub (n / 2 - 1)) * a; } else { a = sub (n / 2 + 1); b = sub (n / 2); return a * a + b * b; } } else return (long) n; } int main (void) { if (sub (30) != 832040L) flg |= NG; if (flg) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/981019-1.c ================================================ /* { dg-skip-if "ptxas seg faults" { nvptx-*-* } { "-O3*" } { "" } } */ extern int f2(void); extern int f3(void); extern void f1(void); void ff(int fname, int part, int nparts) { if (fname) /* bb 0 */ { if (nparts) /* bb 1 */ f1(); /* bb 2 */ } else fname = 2; /* bb 3 */ /* bb 4 is the branch to bb 10 (bb 10 is physically at the end of the loop) */ while (f3() /* bb 10 */) { if (nparts /* bb 5 */ && f2() /* bb 6 */) { f1(); /* bb 7 ... */ nparts = part; if (f3()) /* ... bb 7 */ f1(); /* bb 8 */ f1(); /* bb 9 */ break; } } if (nparts) /* bb 11 */ f1(); /* bb 12 */ return; /* bb 13 */ } int main(void) { ff(0, 1, 0); return 0; } int f3(void) { static int x = 0; x = !x; return x; } void f1(void) { abort(); } int f2(void) { abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/981130-1.c ================================================ /* { dg-xfail-if "alias analysis conflicts with instruction scheduling" { m32r-*-* } { "-O2" "-O1" "-O0" "-Os"} { "" } } */ struct s { int a; int b;}; struct s s1; struct s s2 = { 1, 2, }; void check (a, b) int a; int b; { if (a == b) exit (0); else abort (); } int main () { int * p; int x; s1.a = 9; p = & s1.a; s1 = s2; x = * p; check (x, 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/981206-1.c ================================================ /* Verify unaligned address aliasing on Alpha EV[45]. */ static unsigned short x, y; void foo() { x = 0x345; y = 0x567; } int main() { foo (); if (x != 0x345 || y != 0x567) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990106-1.c ================================================ foo(bufp) char *bufp; { int x = 80; return (*bufp++ = x ? 'a' : 'b'); } main() { char x; if (foo (&x) != 'a') abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990106-2.c ================================================ unsigned calc_mp(unsigned mod) { unsigned a,b,c; c=-1; a=c/mod; b=0-a*mod; if (b > mod) { a += 1; b-=mod; } return b; } int main(int argc, char *argv[]) { unsigned x = 1234; unsigned y = calc_mp(x); if ((sizeof (y) == 4 && y != 680) || (sizeof (y) == 2 && y != 134)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990117-1.c ================================================ int foo (int x, int y, int i, int j) { double tmp1 = ((double) x / y); double tmp2 = ((double) i / j); return tmp1 < tmp2; } main () { if (foo (2, 24, 3, 4) == 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990127-1.c ================================================ extern void abort (void); extern void exit (int); main() { int a,b,c; int *pa, *pb, *pc; int **ppa, **ppb, **ppc; int i,j,k,x,y,z; a = 10; b = 20; c = 30; pa = &a; pb = &b; pc = &c; ppa = &pa; ppb = &pb; ppc = &pc; x = 0; y = 0; z = 0; for(i=0;i<10;i++){ if( pa == &a ) pa = &b; else pa = &a; while( (*pa)-- ){ x++; if( (*pa) < 3 ) break; else pa = &b; } x++; pa = &b; } if ((*pa) != -5 || (*pb) != -5 || x != 43) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990127-2.c ================================================ /* { dg-options "-mpc64" { target { i?86-*-* x86_64-*-* } } } */ extern void abort (void); extern void exit (int); void fpEq (double x, double y) { if (x != y) abort (); } void fpTest (double x, double y) { double result1 = (35.7 * 100.0) / 45.0; double result2 = (x * 100.0) / y; fpEq (result1, result2); } int main () { fpTest (35.7, 45.0); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990128-1.c ================================================ extern int printf (const char *,...); struct s { struct s *n; } *p; struct s ss; #define MAX 10 struct s sss[MAX]; int count = 0; void sub( struct s *p, struct s **pp ); int look( struct s *p, struct s **pp ); main() { struct s *pp; struct s *next; int i; p = &ss; next = p; for ( i = 0; i < MAX; i++ ) { next->n = &sss[i]; next = next->n; } next->n = 0; sub( p, &pp ); if (count != MAX+2) abort (); exit( 0 ); } void sub( struct s *p, struct s **pp ) { for ( ; look( p, pp ); ) { if ( p ) p = p->n; else break; } } int look( struct s *p, struct s **pp ) { for ( ; p; p = p->n ) ; *pp = p; count++; return( 1 ); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990130-1.c ================================================ int count = 0; int dummy; static int * bar(void) { ++count; return &dummy; } static void foo(void) { asm("" : "+r"(*bar())); } main() { foo(); if (count != 1) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990208-1.c ================================================ /* As a quality of implementation issue, we should not prevent inlining of function explicitly marked inline just because a label therein had its address taken. */ #ifndef NO_LABEL_VALUES static void *ptr1, *ptr2; static int i = 1; static __inline__ void doit(void **pptr, int cond) { if (cond) { here: *pptr = &&here; } } __attribute__ ((noinline)) static void f(int cond) { doit (&ptr1, cond); } __attribute__ ((noinline)) static void g(int cond) { doit (&ptr2, cond); } __attribute__ ((noinline)) static void bar(void); int main() { f (i); bar(); g (i); #ifdef __OPTIMIZE__ if (ptr1 == ptr2) abort (); #endif exit (0); } void bar(void) { } #else /* NO_LABEL_VALUES */ int main() { exit(0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990211-1.c ================================================ /* Copyright (C) 1999 Free Software Foundation, Inc. Contributed by Nathan Sidwell 20 Jan 1999 */ /* check range combining boolean operations work */ extern void abort(); #define N 77 void func(int i) { /* fold-const does some clever things with range tests. Make sure we get (some of) them right */ /* these must fail, regardless of the value of i */ if ((i < 0) && (i >= 0)) abort(); if ((i > 0) && (i <= 0)) abort(); if ((i >= 0) && (i < 0)) abort(); if ((i <= 0) && (i > 0)) abort(); if ((i < N) && (i >= N)) abort(); if ((i > N) && (i <= N)) abort(); if ((i >= N) && (i < N)) abort(); if ((i <= N) && (i > N)) abort(); /* these must pass, regardless of the value of i */ if (! ((i < 0) || (i >= 0))) abort(); if (! ((i > 0) || (i <= 0))) abort(); if (! ((i >= 0) || (i < 0))) abort(); if (! ((i <= 0) || (i > 0))) abort(); if (! ((i < N) || (i >= N))) abort(); if (! ((i > N) || (i <= N))) abort(); if (! ((i >= N) || (i < N))) abort(); if (! ((i <= N) || (i > N))) abort(); return; } int main() { func(0); func(1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990222-1.c ================================================ char line[4] = { '1', '9', '9', '\0' }; int main() { char *ptr = line + 3; while ((*--ptr += 1) > '9') *ptr = '0'; if (line[0] != '2' || line[1] != '0' || line[2] != '0') abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990324-1.c ================================================ void f(long i) { if ((signed char)i < 0 || (signed char)i == 0) abort (); else exit (0); } main() { f(0xffffff01); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990326-1.c ================================================ struct a { char a, b; short c; }; int a1() { static struct a x = { 1, 2, ~1 }, y = { 65, 2, ~2 }; return (x.a == (y.a & ~64) && x.b == y.b); } int a2() { static struct a x = { 1, 66, ~1 }, y = { 1, 2, ~2 }; return (x.a == y.a && (x.b & ~64) == y.b); } int a3() { static struct a x = { 9, 66, ~1 }, y = { 33, 18, ~2 }; return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16)); } struct b { int c; short b, a; }; int b1() { static struct b x = { ~1, 2, 1 }, y = { ~2, 2, 65 }; return (x.a == (y.a & ~64) && x.b == y.b); } int b2() { static struct b x = { ~1, 66, 1 }, y = { ~2, 2, 1 }; return (x.a == y.a && (x.b & ~64) == y.b); } int b3() { static struct b x = { ~1, 66, 9 }, y = { ~2, 18, 33 }; return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16)); } struct c { unsigned int c:4, b:14, a:14; } __attribute__ ((aligned)); int c1() { static struct c x = { ~1, 2, 1 }, y = { ~2, 2, 65 }; return (x.a == (y.a & ~64) && x.b == y.b); } int c2() { static struct c x = { ~1, 66, 1 }, y = { ~2, 2, 1 }; return (x.a == y.a && (x.b & ~64) == y.b); } int c3() { static struct c x = { ~1, 66, 9 }, y = { ~2, 18, 33 }; return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16)); } struct d { unsigned int a:14, b:14, c:4; } __attribute__ ((aligned)); int d1() { static struct d x = { 1, 2, ~1 }, y = { 65, 2, ~2 }; return (x.a == (y.a & ~64) && x.b == y.b); } int d2() { static struct d x = { 1, 66, ~1 }, y = { 1, 2, ~2 }; return (x.a == y.a && (x.b & ~64) == y.b); } int d3() { static struct d x = { 9, 66, ~1 }, y = { 33, 18, ~2 }; return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16)); } struct e { int c:4, b:14, a:14; } __attribute__ ((aligned)); int e1() { static struct e x = { ~1, -2, -65 }, y = { ~2, -2, -1 }; return (x.a == (y.a & ~64) && x.b == y.b); } int e2() { static struct e x = { ~1, -2, -1 }, y = { ~2, -66, -1 }; return (x.a == y.a && (x.b & ~64) == y.b); } int e3() { static struct e x = { ~1, -18, -33 }, y = { ~2, -66, -9 }; return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16)); } int e4() { static struct e x = { -1, -1, 0 }; return x.a == 0 && x.b & 0x2000; } struct f { int a:14, b:14, c:4; } __attribute__ ((aligned)); int f1() { static struct f x = { -65, -2, ~1 }, y = { -1, -2, ~2 }; return (x.a == (y.a & ~64) && x.b == y.b); } int f2() { static struct f x = { -1, -2, ~1 }, y = { -1, -66, ~2 }; return (x.a == y.a && (x.b & ~64) == y.b); } int f3() { static struct f x = { -33, -18, ~1 }, y = { -9, -66, ~2 }; return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16)); } int f4() { static struct f x = { 0, -1, -1 }; return x.a == 0 && x.b & 0x2000; } struct gx { int c:4, b:14, a:14; } __attribute__ ((aligned)); struct gy { int b:14, a:14, c:4; } __attribute__ ((aligned)); int g1() { static struct gx x = { ~1, -2, -65 }; static struct gy y = { -2, -1, ~2 }; return (x.a == (y.a & ~64) && x.b == y.b); } int g2() { static struct gx x = { ~1, -2, -1 }; static struct gy y = { -66, -1, ~2 }; return (x.a == y.a && (x.b & ~64) == y.b); } int g3() { static struct gx x = { ~1, -18, -33 }; static struct gy y = { -66, -9, ~2 }; return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16)); } int g4() { static struct gx x = { ~1, 0x0020, 0x0010 }; static struct gy y = { 0x0200, 0x0100, ~2 }; return ((x.a & 0x00f0) == (y.a & 0x0f00) && (x.b & 0x00f0) == (y.b & 0x0f00)); } int g5() { static struct gx x = { ~1, 0x0200, 0x0100 }; static struct gy y = { 0x0020, 0x0010, ~2 }; return ((x.a & 0x0f00) == (y.a & 0x00f0) && (x.b & 0x0f00) == (y.b & 0x00f0)); } int g6() { static struct gx x = { ~1, 0xfe20, 0xfd10 }; static struct gy y = { 0xc22f, 0xc11f, ~2 }; return ((x.a & 0x03ff) == (y.a & 0x3ff0) && (x.b & 0x03ff) == (y.b & 0x3ff0)); } int g7() { static struct gx x = { ~1, 0xc22f, 0xc11f }; static struct gy y = { 0xfe20, 0xfd10, ~2 }; return ((x.a & 0x3ff0) == (y.a & 0x03ff) && (x.b & 0x3ff0) == (y.b & 0x03ff)); } struct hx { int a:14, b:14, c:4; } __attribute__ ((aligned)); struct hy { int c:4, a:14, b:14; } __attribute__ ((aligned)); int h1() { static struct hx x = { -65, -2, ~1 }; static struct hy y = { ~2, -1, -2 }; return (x.a == (y.a & ~64) && x.b == y.b); } int h2() { static struct hx x = { -1, -2, ~1 }; static struct hy y = { ~2, -1, -66 }; return (x.a == y.a && (x.b & ~64) == y.b); } int h3() { static struct hx x = { -33, -18, ~1 }; static struct hy y = { ~2, -9, -66 }; return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16)); } int h4() { static struct hx x = { 0x0010, 0x0020, ~1 }; static struct hy y = { ~2, 0x0100, 0x0200 }; return ((x.a & 0x00f0) == (y.a & 0x0f00) && (x.b & 0x00f0) == (y.b & 0x0f00)); } int h5() { static struct hx x = { 0x0100, 0x0200, ~1 }; static struct hy y = { ~2, 0x0010, 0x0020 }; return ((x.a & 0x0f00) == (y.a & 0x00f0) && (x.b & 0x0f00) == (y.b & 0x00f0)); } int h6() { static struct hx x = { 0xfd10, 0xfe20, ~1 }; static struct hy y = { ~2, 0xc11f, 0xc22f }; return ((x.a & 0x03ff) == (y.a & 0x3ff0) && (x.b & 0x03ff) == (y.b & 0x3ff0)); } int h7() { static struct hx x = { 0xc11f, 0xc22f, ~1 }; static struct hy y = { ~2, 0xfd10, 0xfe20 }; return ((x.a & 0x3ff0) == (y.a & 0x03ff) && (x.b & 0x3ff0) == (y.b & 0x03ff)); } int main() { if (!a1 ()) abort (); if (!a2 ()) abort (); if (!a3 ()) abort (); if (!b1 ()) abort (); if (!b2 ()) abort (); if (!b3 ()) abort (); if (!c1 ()) abort (); if (!c2 ()) abort (); if (!c3 ()) abort (); if (!d1 ()) abort (); if (!d2 ()) abort (); if (!d3 ()) abort (); if (!e1 ()) abort (); if (!e2 ()) abort (); if (!e3 ()) abort (); if (!e4 ()) abort (); if (!f1 ()) abort (); if (!f2 ()) abort (); if (!f3 ()) abort (); if (!f4 ()) abort (); if (!g1 ()) abort (); if (!g2 ()) abort (); if (!g3 ()) abort (); if (g4 ()) abort (); if (g5 ()) abort (); if (!g6 ()) abort (); if (!g7 ()) abort (); if (!h1 ()) abort (); if (!h2 ()) abort (); if (!h3 ()) abort (); if (h4 ()) abort (); if (h5 ()) abort (); if (!h6 ()) abort (); if (!h7 ()) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990404-1.c ================================================ int x[10] = { 0,1,2,3,4,5,6,7,8,9}; int main() { int niterations = 0, i; for (;;) { int i, mi, max; max = 0; for (i = 0; i < 10 ; i++) { if (x[i] > max) { max = x[i]; mi = i; } } if (max == 0) break; x[mi] = 0; niterations++; if (niterations > 10) abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990413-2.c ================================================ /* This tests for a bug in regstack that was breaking glibc's math library. */ /* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */ extern void abort (void); static __inline double minus_zero (void) { union { double __d; int __i[2]; } __x; __x.__i[0] = 0x0; __x.__i[1] = 0x80000000; return __x.__d; } static __inline long double __atan2l (long double __y, long double __x) { register long double __value; __asm __volatile__ ("fpatan\n\t" : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); return __value; } static __inline long double __sqrtl (long double __x) { register long double __result; __asm __volatile__ ("fsqrt" : "=t" (__result) : "0" (__x)); return __result; } static __inline double asin (double __x) { return __atan2l (__x, __sqrtl (1.0 - __x * __x)); } int main (void) { double x; x = minus_zero(); x = asin (x); if (x != 0.0) /* actually -0.0, but 0.0 == -0.0 */ abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990513-1.c ================================================ #include void foo (int *BM_tab, int j) { int *BM_tab_base; BM_tab_base = BM_tab; BM_tab += 0400; while (BM_tab_base != BM_tab) { *--BM_tab = j; *--BM_tab = j; *--BM_tab = j; *--BM_tab = j; } } int main () { int BM_tab[0400]; memset (BM_tab, 0, sizeof (BM_tab)); foo (BM_tab, 6); if (BM_tab[0] != 6) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990524-1.c ================================================ char a[] = "12345"; char b[] = "12345"; void loop (char * pz, char * pzDta) { for (;;) { switch (*(pz++) = *(pzDta++)) { case 0: goto loopDone2; case '"': case '\\': pz[-1] = '\\'; *(pz++) = pzDta[-1]; } } loopDone2:; if (a - pz != b - pzDta) abort (); } main() { loop (a, b); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990525-1.c ================================================ struct blah { int m1, m2; }; void die(struct blah arg) { int i ; struct blah buf[1]; for (i = 0; i < 1 ; buf[i++] = arg) ; if (buf[0].m1 != 1) { abort (); } } int main() { struct blah s = { 1, 2 }; die(s); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990525-2.c ================================================ typedef struct { int v[4]; } Test1; Test1 func2(); int func1() { Test1 test; test = func2(); if (test.v[0] != 10) abort (); if (test.v[1] != 20) abort (); if (test.v[2] != 30) abort (); if (test.v[3] != 40) abort (); } Test1 func2() { Test1 tmp; tmp.v[0] = 10; tmp.v[1] = 20; tmp.v[2] = 30; tmp.v[3] = 40; return tmp; } int main() { func1(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990527-1.c ================================================ int sum; void g (int i) { sum += i; } void f(int j) { int i; for (i = 0; i < 9; i++) { j++; g (j); j = 9; } } int main () { f (0); if (sum != 81) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990531-1.c ================================================ unsigned long bad(int reg, unsigned long inWord) { union { unsigned long word; unsigned char byte[4]; } data; data.word = inWord; data.byte[reg] = 0; return data.word; } main() { /* XXX This test could be generalized. */ if (sizeof (long) != 4) exit (0); if (bad (0, 0xdeadbeef) == 0xdeadbeef) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990604-1.c ================================================ int b; void f () { int i = 0; if (b == 0) do { b = i; i++; } while (i < 10); } int main () { f (); if (b != 9) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990628-1.c ================================================ #include struct { long sqlcode; } sqlca; struct data_record { int dummy; int a[100]; } *data_ptr, data_tmp; int num_records() { return 1; } void fetch() { static int fetch_count; memset(&data_tmp, 0x55, sizeof(data_tmp)); sqlca.sqlcode = (++fetch_count > 1 ? 100 : 0); } void load_data() { struct data_record *p; int num = num_records(); data_ptr = malloc(num * sizeof(struct data_record)); memset(data_ptr, 0xaa, num * sizeof(struct data_record)); fetch(); p = data_ptr; while (sqlca.sqlcode == 0) { *p++ = data_tmp; fetch(); } } main() { load_data(); if (sizeof (int) == 2 && data_ptr[0].dummy != 0x5555) abort (); else if (sizeof (int) > 2 && data_ptr[0].dummy != 0x55555555) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990804-1.c ================================================ int gfbyte ( void ) { return 0; } int main( void ) { int i,j,k ; i = gfbyte(); i = i + 1 ; if ( i == 0 ) k = -0 ; else k = i + 0 ; if (i != 1) abort (); k = 1 ; if ( k <= i) do j = gfbyte () ; while ( k++ < i ) ; exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990811-1.c ================================================ struct s {long a; int b;}; int foo(int x, void *y) { switch(x) { case 0: return ((struct s*)y)->a; case 1: return *(signed char*)y; case 2: return *(short*)y; } abort(); } int main () { struct s s; short sh[10]; signed char c[10]; int i; s.a = 1; s.b = 2; for (i = 0; i < 10; i++) { sh[i] = i; c[i] = i; } if (foo(0, &s) != 1) abort(); if (foo(1, c+3) != 3) abort(); if (foo(2, sh+3) != 3) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990826-0.c ================================================ /* From: niles@fan745.gsfc.nasa.gov To: fortran@gnu.org Subject: Re: Scary problems in g77 for RedHat 6.0. (glibc-2.1) Date: Sun, 06 Jun 1999 23:37:23 -0400 X-UIDL: 9c1e40c572e3b306464f703461764cd5 */ /* { dg-xfail-if "Can not call system libm.a with -msoft-float" { powerpc-*-aix* rs6000-*-aix* } { "-msoft-float" } { "" } } */ #include #include int main() { if (floor (0.1) != 0.) abort (); return 0; } /* It will result in 36028797018963968.000000 on Alpha RedHat Linux 6.0 using glibc-2.1 at least on my 21064. This may result in g77 bug reports concerning the INT() function, just so you know. Thanks, Rick Niles. */ ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990827-1.c ================================================ unsigned test(unsigned one , unsigned bit) { unsigned val= bit & 1; unsigned zero= one >> 1; val++; return zero + ( val>> 1 ); } int main() { if (test (1,0) != 0) abort (); if (test (1,1) != 1) abort (); if (test (1,65535) != 1) abort (); exit (0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990829-1.c ================================================ double test (const double le, const double ri) { double val = ( ri - le ) / ( ri * ( le + 1.0 ) ); return val; } int main () { double retval; retval = test(1.0,2.0); if (retval < 0.24 || retval > 0.26) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990923-1.c ================================================ #define mask 0xffff0000L #define value 0xabcd0000L long foo (long x) { if ((x & mask) == value) return x & 0xffffL; return 1; } int main (void) { if (foo (value) != 0 || foo (0) != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991014-1.c ================================================ typedef __SIZE_TYPE__ Size_t; #if __SIZEOF_LONG__ < __SIZEOF_POINTER__ #define bufsize ((1LL << (8 * sizeof(Size_t) - 2))-256) #else #define bufsize ((1L << (8 * sizeof(Size_t) - 2))-256) #endif struct huge_struct { short buf[bufsize]; int a; int b; int c; int d; }; union huge_union { int a; char buf[bufsize]; }; Size_t union_size() { return sizeof(union huge_union); } Size_t struct_size() { return sizeof(struct huge_struct); } Size_t struct_a_offset() { return (Size_t)(&((struct huge_struct *) 0)->a); } int main() { /* Check the exact sizeof value. bufsize is aligned on 256b. */ if (union_size() != sizeof(char) * bufsize) abort(); if (struct_size() != sizeof(short) * bufsize + 4*sizeof(int)) abort(); if (struct_a_offset() < sizeof(short) * bufsize) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991016-1.c ================================================ /* Two of these types will, on current gcc targets, have the same mode but have different alias sets. DOIT tries to get gcse to invalidly hoist one of the values out of the loop. */ typedef int T0; typedef long T1; typedef long long T2; int doit(int sel, int n, void *p) { T0 * const p0 = p; T1 * const p1 = p; T2 * const p2 = p; switch (sel) { case 0: do *p0 += *p0; while (--n); return *p0 == 0; case 1: do *p1 += *p1; while (--n); return *p1 == 0; case 2: do *p2 += *p2; while (--n); return *p2 == 0; default: abort (); } } int main() { T0 v0; T1 v1; T2 v2; v0 = 1; doit(0, 5, &v0); v1 = 1; doit(1, 5, &v1); v2 = 1; doit(2, 5, &v2); if (v0 != 32) abort (); if (v1 != 32) abort (); if (v2 != 32) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991019-1.c ================================================ typedef struct { double epsilon; } material_type; material_type foo(double x) { material_type m; m.epsilon = 1.0 + x; return m; } main() { int i; material_type x; /* We must iterate enough times to overflow the FP stack on the x86. */ for (i = 0; i < 10; i++) { x = foo (1.0); if (x.epsilon != 1.0 + 1.0) abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991023-1.c ================================================ int blah; foo() { int i; for (i=0 ; i< 7 ; i++) { if (i == 7 - 1) blah = 0xfcc; else blah = 0xfee; } return blah; } main() { if (foo () != 0xfcc) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991030-1.c ================================================ double x = 0x1.fp1; int main() { if (x != 3.875) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991112-1.c ================================================ /* This code was miscompiled at -O3 on x86. Reported by Jim Meyering; distilled from bash. */ int rl_show_char (int c) { return 0; } int rl_character_len (int c, int pos) { return isprint (c) ? 1 : 2; } int main(void) { int (*x)(int, int) = rl_character_len; if (x('a', 1) != 1) abort(); if (x('\002', 1) != 2) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991118-1.c ================================================ struct tmp { long long int pad : 12; long long int field : 52; }; struct tmp2 { long long int field : 52; long long int pad : 12; }; struct tmp3 { long long int pad : 11; long long int field : 53; }; struct tmp4 { long long int field : 53; long long int pad : 11; }; struct tmp sub (struct tmp tmp) { tmp.field ^= 0x0008765412345678LL; return tmp; } struct tmp2 sub2 (struct tmp2 tmp2) { tmp2.field ^= 0x0008765412345678LL; return tmp2; } struct tmp3 sub3 (struct tmp3 tmp3) { tmp3.field ^= 0x0018765412345678LL; return tmp3; } struct tmp4 sub4 (struct tmp4 tmp4) { tmp4.field ^= 0x0018765412345678LL; return tmp4; } struct tmp tmp = {0x123, 0x123456789ABCDLL}; struct tmp2 tmp2 = {0x123456789ABCDLL, 0x123}; struct tmp3 tmp3 = {0x123, 0x1FFFF00000000LL}; struct tmp4 tmp4 = {0x1FFFF00000000LL, 0x123}; main() { if (sizeof (long long) != 8) exit (0); tmp = sub (tmp); tmp2 = sub2 (tmp2); if (tmp.pad != 0x123 || tmp.field != 0xFFF9551175BDFDB5LL) abort (); if (tmp2.pad != 0x123 || tmp2.field != 0xFFF9551175BDFDB5LL) abort (); tmp3 = sub3 (tmp3); tmp4 = sub4 (tmp4); if (tmp3.pad != 0x123 || tmp3.field != 0xFFF989AB12345678LL) abort (); if (tmp4.pad != 0x123 || tmp4.field != 0xFFF989AB12345678LL) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991201-1.c ================================================ struct vc_data { unsigned long space; unsigned char vc_palette[16*3]; }; struct vc { struct vc_data *d; }; struct vc_data a_con; struct vc vc_cons[63] = { &a_con }; int default_red[16]; int default_grn[16]; int default_blu[16]; extern void bar(int); void reset_palette(int currcons) { int j, k; for (j=k=0; j<16; j++) { (vc_cons[currcons].d->vc_palette) [k++] = default_red[j]; (vc_cons[currcons].d->vc_palette) [k++] = default_grn[j]; (vc_cons[currcons].d->vc_palette) [k++] = default_blu[j]; } bar(k); } void bar(int k) { if (k != 16*3) abort(); } int main() { reset_palette(0); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991202-1.c ================================================ int x, y; int main() { x = 2; y = x; do { x = y; y = 2 * y; } while ( ! ((y - x) >= 20)); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991202-2.c ================================================ int f1 () { unsigned long x, y = 1; x = ((y * 8192) - 216) % 16; return x; } int main () { if (f1 () != 8) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991202-3.c ================================================ unsigned int f (unsigned int a) { return a * 65536 / 8; } unsigned int g (unsigned int a) { return a * 65536; } unsigned int h (unsigned int a) { return a / 8; } int main () { if (f (65536) != h (g (65536))) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991216-1.c ================================================ #define VALUE 0x123456789abcdefLL #define AFTER 0x55 void test1 (int a, long long value, int after) { if (a != 1 || value != VALUE || after != AFTER) abort (); } void test2 (int a, int b, long long value, int after) { if (a != 1 || b != 2 || value != VALUE || after != AFTER) abort (); } void test3 (int a, int b, int c, long long value, int after) { if (a != 1 || b != 2 || c != 3 || value != VALUE || after != AFTER) abort (); } void test4 (int a, int b, int c, int d, long long value, int after) { if (a != 1 || b != 2 || c != 3 || d != 4 || value != VALUE || after != AFTER) abort (); } void test5 (int a, int b, int c, int d, int e, long long value, int after) { if (a != 1 || b != 2 || c != 3 || d != 4 || e != 5 || value != VALUE || after != AFTER) abort (); } void test6 (int a, int b, int c, int d, int e, int f, long long value, int after) { if (a != 1 || b != 2 || c != 3 || d != 4 || e != 5 || f != 6 || value != VALUE || after != AFTER) abort (); } void test7 (int a, int b, int c, int d, int e, int f, int g, long long value, int after) { if (a != 1 || b != 2 || c != 3 || d != 4 || e != 5 || f != 6 || g != 7 || value != VALUE || after != AFTER) abort (); } void test8 (int a, int b, int c, int d, int e, int f, int g, int h, long long value, int after) { if (a != 1 || b != 2 || c != 3 || d != 4 || e != 5 || f != 6 || g != 7 || h != 8 || value != VALUE || after != AFTER) abort (); } int main () { test1 (1, VALUE, AFTER); test2 (1, 2, VALUE, AFTER); test3 (1, 2, 3, VALUE, AFTER); test4 (1, 2, 3, 4, VALUE, AFTER); test5 (1, 2, 3, 4, 5, VALUE, AFTER); test6 (1, 2, 3, 4, 5, 6, VALUE, AFTER); test7 (1, 2, 3, 4, 5, 6, 7, VALUE, AFTER); test8 (1, 2, 3, 4, 5, 6, 7, 8, VALUE, AFTER); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991216-2.c ================================================ #include #define VALUE 0x123456789abcdefLL #define AFTER 0x55 void test (int n, ...) { va_list ap; int i; va_start (ap, n); for (i = 2; i <= n; i++) { if (va_arg (ap, int) != i) abort (); } if (va_arg (ap, long long) != VALUE) abort (); if (va_arg (ap, int) != AFTER) abort (); va_end (ap); } int main () { test (1, VALUE, AFTER); test (2, 2, VALUE, AFTER); test (3, 2, 3, VALUE, AFTER); test (4, 2, 3, 4, VALUE, AFTER); test (5, 2, 3, 4, 5, VALUE, AFTER); test (6, 2, 3, 4, 5, 6, VALUE, AFTER); test (7, 2, 3, 4, 5, 6, 7, VALUE, AFTER); test (8, 2, 3, 4, 5, 6, 7, 8, VALUE, AFTER); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991216-4.c ================================================ /* Test against a problem with loop reversal. */ static void bug(int size, int tries) { int i; int num = 0; while (num < size) { for (i = 1; i < tries; i++) num++; } } int main() { bug(5, 10); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991221-1.c ================================================ int main( void ) { unsigned long totalsize = 80; unsigned long msize = 64; if (sizeof(long) != 4) exit(0); if ( totalsize > (2147483647L * 2UL + 1) || (msize != 0 && ((msize - 1) > (2147483647L * 2UL + 1) ))) abort(); exit( 0 ); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991227-1.c ================================================ char* doit(int flag) { return 1 + (flag ? "\0wrong\n" : "\0right\n"); } int main() { char *result = doit(0); if (*result == 'r' && result[1] == 'i') exit(0); abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/991228-1.c ================================================ __extension__ union { double d; int i[2]; } u = { d: -0.25 }; /* This assumes the endianness of words in a long long is the same as that for doubles, which doesn't hold for a few platforms, but we can probably special case them here, as appropriate. */ long long endianness_test = 1; #define MSW (*(int*)&endianness_test) int signbit(double x) { __extension__ union { double d; int i[2]; } u = { d: x }; return u.i[MSW] < 0; } int main(void) { if (2*sizeof(int) != sizeof(double) || u.i[MSW] >= 0) exit(0); if (!signbit(-0.25)) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/alias-1.c ================================================ int val; int *ptr = &val; float *ptr2 = &val; __attribute__((optimize ("-fno-strict-aliasing"))) typepun () { *ptr2=0; } main() { *ptr=1; typepun (); if (*ptr) __builtin_abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/alias-2.c ================================================ /* { dg-require-alias "" } */ int a[10]={}; extern int b[10] __attribute__ ((alias("a"))); int off; main() { b[off]=1; a[off]=2; if (b[off]!=2) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/alias-3.c ================================================ /* { dg-require-alias "" } */ static int a=0; extern int b __attribute__ ((alias("a"))); __attribute__ ((noinline)) static inc() { b++; } int main() { a=0; inc (); if (a!=1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/alias-4.c ================================================ /* { dg-require-alias "" } */ int a = 1; extern int b __attribute__ ((alias ("a"))); int c = 1; extern int d __attribute__ ((alias ("c"))); main (int argc) { int *p; int *q; if (argc) p = &a, q = &b; else p = &c, q = &d; *p = 1; *q = 2; if (*p == 1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/align-1.c ================================================ typedef int new_int __attribute__ ((aligned(16))); struct S { int x; }; int main() { if (sizeof(struct S) != sizeof(int)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/align-2.c ================================================ /* Simple alignment checks; looking for compiler/assembler alignment disagreements, agreement between struct initialization and access. */ struct a_short { char c; short s; } s_c_s = { 'a', 13 }; struct a_int { char c ; int i; } s_c_i = { 'b', 14 }; struct b_int { short s; int i; } s_s_i = { 15, 16 }; struct a_float { char c; float f; } s_c_f = { 'c', 17.0 }; struct b_float { short s; float f; } s_s_f = { 18, 19.0 }; struct a_double { char c; double d; } s_c_d = { 'd', 20.0 }; struct b_double { short s; double d; } s_s_d = { 21, 22.0 }; struct c_double { int i; double d; } s_i_d = { 23, 24.0 }; struct d_double { float f; double d; } s_f_d = { 25.0, 26.0 }; struct a_ldouble { char c; long double ld; } s_c_ld = { 'e', 27.0 }; struct b_ldouble { short s; long double ld; } s_s_ld = { 28, 29.0 }; struct c_ldouble { int i; long double ld; } s_i_ld = { 30, 31.0 }; struct d_ldouble { float f; long double ld; } s_f_ld = { 32.0, 33.0 }; struct e_ldouble { double d; long double ld; } s_d_ld = { 34.0, 35.0 }; int main () { if (s_c_s.c != 'a') abort (); if (s_c_s.s != 13) abort (); if (s_c_i.c != 'b') abort (); if (s_c_i.i != 14) abort (); if (s_s_i.s != 15) abort (); if (s_s_i.i != 16) abort (); if (s_c_f.c != 'c') abort (); if (s_c_f.f != 17.0) abort (); if (s_s_f.s != 18) abort (); if (s_s_f.f != 19.0) abort (); if (s_c_d.c != 'd') abort (); if (s_c_d.d != 20.0) abort (); if (s_s_d.s != 21) abort (); if (s_s_d.d != 22.0) abort (); if (s_i_d.i != 23) abort (); if (s_i_d.d != 24.0) abort (); if (s_f_d.f != 25.0) abort (); if (s_f_d.d != 26.0) abort (); if (s_c_ld.c != 'e') abort (); if (s_c_ld.ld != 27.0) abort (); if (s_s_ld.s != 28) abort (); if (s_s_ld.ld != 29.0) abort (); if (s_i_ld.i != 30) abort (); if (s_i_ld.ld != 31.0) abort (); if (s_f_ld.f != 32.0) abort (); if (s_f_ld.ld != 33.0) abort (); if (s_d_ld.d != 34.0) abort (); if (s_d_ld.ld != 35.0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/align-3.c ================================================ void func(void) __attribute__((aligned(256))); void func(void) { } int main() { if (__alignof__(func) != 256) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/align-nest.c ================================================ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ void foo(int n) { typedef struct { int value; } myint; struct S { int i[n]; unsigned int b:1; myint mi; } __attribute__ ((packed)) __attribute__ ((aligned (4))); struct S s[2]; int k; for (k = 0; k < 2; k ++) s[k].mi.value = 0; } int main () { foo (2); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/alloca-1.c ================================================ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ /* Verify that alloca storage is sufficiently aligned. */ /* ??? May fail if BIGGEST_ALIGNMENT > STACK_BOUNDARY. Which, I guess can only happen on !STRICT_ALIGNMENT targets. */ typedef __SIZE_TYPE__ size_t; struct dummy { int x __attribute__((aligned)); }; #define BIGGEST_ALIGNMENT __alignof__(struct dummy) _Bool foo(void) { char *p = __builtin_alloca(32); return ((size_t)p & (BIGGEST_ALIGNMENT - 1)) == 0; } int main() { if (!foo()) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/anon-1.c ================================================ /* Copyright (C) 2001 Free Software Foundation, Inc. */ /* Source: Neil Booth, 4 Nov 2001, derived from PR 2820 - field lookup in nested anonymous entities was broken. */ struct { int x; struct { int a; union { int b; }; }; } foo; int main(int argc, char *argv[]) { foo.b = 6; foo.a = 5; if (foo.b != 6) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/arith-1.c ================================================ unsigned sat_add (unsigned i) { unsigned ret = i + 1; if (ret < i) ret = i; return ret; } main () { if (sat_add (~0U) != ~0U) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/arith-rand-ll.c ================================================ long long simple_rand () { static unsigned long long seed = 47114711; unsigned long long this = seed * 1103515245 + 12345; seed = this; return this >> 8; } unsigned long long int random_bitstring () { unsigned long long int x; int n_bits; long long ran; int tot_bits = 0; x = 0; for (;;) { ran = simple_rand (); n_bits = (ran >> 1) % 16; tot_bits += n_bits; if (n_bits == 0) return x; else { x <<= n_bits; if (ran & 1) x |= (1 << n_bits) - 1; if (tot_bits > 8 * sizeof (long long) + 6) return x; } } } #define ABS(x) ((x) >= 0 ? (x) : -(x)) main () { long long int i; for (i = 0; i < 10000; i++) { unsigned long long x, y; x = random_bitstring (); y = random_bitstring (); if (sizeof (int) == sizeof (long long)) goto save_time; { unsigned long long xx = x, yy = y, r1, r2; if (yy == 0) continue; r1 = xx / yy; r2 = xx % yy; if (r2 >= yy || r1 * yy + r2 != xx) abort (); } { signed long long xx = x, yy = y, r1, r2; if ((unsigned long long) xx << 1 == 0 && yy == -1) continue; r1 = xx / yy; r2 = xx % yy; if (ABS (r2) >= (unsigned long long) ABS (yy) || (signed long long) (r1 * yy + r2) != xx) abort (); } save_time: { unsigned int xx = x, yy = y, r1, r2; if (yy == 0) continue; r1 = xx / yy; r2 = xx % yy; if (r2 >= yy || r1 * yy + r2 != xx) abort (); } { signed int xx = x, yy = y, r1, r2; if ((unsigned int) xx << 1 == 0 && yy == -1) continue; r1 = xx / yy; r2 = xx % yy; if (ABS (r2) >= (unsigned int) ABS (yy) || (signed int) (r1 * yy + r2) != xx || ((xx < 0) != (r2 < 0) && r2)) abort (); } { unsigned short xx = x, yy = y, r1, r2; if (yy == 0) continue; r1 = xx / yy; r2 = xx % yy; if (r2 >= yy || r1 * yy + r2 != xx) abort (); } { signed short xx = x, yy = y, r1, r2; r1 = xx / yy; r2 = xx % yy; if (ABS (r2) >= (unsigned short) ABS (yy) || (signed short) (r1 * yy + r2) != xx) abort (); } { unsigned char xx = x, yy = y, r1, r2; if (yy == 0) continue; r1 = xx / yy; r2 = xx % yy; if (r2 >= yy || r1 * yy + r2 != xx) abort (); } { signed char xx = x, yy = y, r1, r2; r1 = xx / yy; r2 = xx % yy; if (ABS (r2) >= (unsigned char) ABS (yy) || (signed char) (r1 * yy + r2) != xx) abort (); } } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/arith-rand.c ================================================ long simple_rand () { static unsigned long seed = 47114711; unsigned long this = seed * 1103515245 + 12345; seed = this; return this >> 8; } unsigned long int random_bitstring () { unsigned long int x; int n_bits; long ran; int tot_bits = 0; x = 0; for (;;) { ran = simple_rand (); n_bits = (ran >> 1) % 16; tot_bits += n_bits; if (n_bits == 0) return x; else { x <<= n_bits; if (ran & 1) x |= (1 << n_bits) - 1; if (tot_bits > 8 * sizeof (long) + 6) return x; } } } #define ABS(x) ((x) >= 0 ? (x) : -(x)) main () { long int i; for (i = 0; i < 1000; i++) { unsigned long x, y; x = random_bitstring (); y = random_bitstring (); if (sizeof (int) == sizeof (long)) goto save_time; { unsigned long xx = x, yy = y, r1, r2; if (yy == 0) continue; r1 = xx / yy; r2 = xx % yy; if (r2 >= yy || r1 * yy + r2 != xx) abort (); } { signed long xx = x, yy = y, r1, r2; if ((unsigned long) xx << 1 == 0 && yy == -1) continue; r1 = xx / yy; r2 = xx % yy; if (ABS (r2) >= (unsigned long) ABS (yy) || (signed long) (r1 * yy + r2) != xx) abort (); } save_time: { unsigned int xx = x, yy = y, r1, r2; if (yy == 0) continue; r1 = xx / yy; r2 = xx % yy; if (r2 >= yy || r1 * yy + r2 != xx) abort (); } { signed int xx = x, yy = y, r1, r2; if ((unsigned int) xx << 1 == 0 && yy == -1) continue; r1 = xx / yy; r2 = xx % yy; if (ABS (r2) >= (unsigned int) ABS (yy) || (signed int) (r1 * yy + r2) != xx) abort (); } { unsigned short xx = x, yy = y, r1, r2; if (yy == 0) continue; r1 = xx / yy; r2 = xx % yy; if (r2 >= yy || r1 * yy + r2 != xx) abort (); } { signed short xx = x, yy = y, r1, r2; r1 = xx / yy; r2 = xx % yy; if (ABS (r2) >= (unsigned short) ABS (yy) || (signed short) (r1 * yy + r2) != xx) abort (); } { unsigned char xx = x, yy = y, r1, r2; if (yy == 0) continue; r1 = xx / yy; r2 = xx % yy; if (r2 >= yy || r1 * yy + r2 != xx) abort (); } { signed char xx = x, yy = y, r1, r2; r1 = xx / yy; r2 = xx % yy; if (ABS (r2) >= (unsigned char) ABS (yy) || (signed char) (r1 * yy + r2) != xx) abort (); } } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ashldi-1.c ================================================ #include extern void abort(void); extern void exit(int); #if __LONG_LONG_MAX__ == 9223372036854775807LL #define BITS 64 static unsigned long long const data[64] = { 0x123456789abcdefULL, 0x2468acf13579bdeULL, 0x48d159e26af37bcULL, 0x91a2b3c4d5e6f78ULL, 0x123456789abcdef0ULL, 0x2468acf13579bde0ULL, 0x48d159e26af37bc0ULL, 0x91a2b3c4d5e6f780ULL, 0x23456789abcdef00ULL, 0x468acf13579bde00ULL, 0x8d159e26af37bc00ULL, 0x1a2b3c4d5e6f7800ULL, 0x3456789abcdef000ULL, 0x68acf13579bde000ULL, 0xd159e26af37bc000ULL, 0xa2b3c4d5e6f78000ULL, 0x456789abcdef0000ULL, 0x8acf13579bde0000ULL, 0x159e26af37bc0000ULL, 0x2b3c4d5e6f780000ULL, 0x56789abcdef00000ULL, 0xacf13579bde00000ULL, 0x59e26af37bc00000ULL, 0xb3c4d5e6f7800000ULL, 0x6789abcdef000000ULL, 0xcf13579bde000000ULL, 0x9e26af37bc000000ULL, 0x3c4d5e6f78000000ULL, 0x789abcdef0000000ULL, 0xf13579bde0000000ULL, 0xe26af37bc0000000ULL, 0xc4d5e6f780000000ULL, 0x89abcdef00000000ULL, 0x13579bde00000000ULL, 0x26af37bc00000000ULL, 0x4d5e6f7800000000ULL, 0x9abcdef000000000ULL, 0x3579bde000000000ULL, 0x6af37bc000000000ULL, 0xd5e6f78000000000ULL, 0xabcdef0000000000ULL, 0x579bde0000000000ULL, 0xaf37bc0000000000ULL, 0x5e6f780000000000ULL, 0xbcdef00000000000ULL, 0x79bde00000000000ULL, 0xf37bc00000000000ULL, 0xe6f7800000000000ULL, 0xcdef000000000000ULL, 0x9bde000000000000ULL, 0x37bc000000000000ULL, 0x6f78000000000000ULL, 0xdef0000000000000ULL, 0xbde0000000000000ULL, 0x7bc0000000000000ULL, 0xf780000000000000ULL, 0xef00000000000000ULL, 0xde00000000000000ULL, 0xbc00000000000000ULL, 0x7800000000000000ULL, 0xf000000000000000ULL, 0xe000000000000000ULL, 0xc000000000000000ULL, 0x8000000000000000ULL }; #elif __LONG_LONG_MAX__ == 2147483647LL #define BITS 32 static unsigned long long const data[32] = { 0x1234567fULL, 0x2468acfeULL, 0x48d159fcULL, 0x91a2b3f8ULL, 0x234567f0ULL, 0x468acfe0ULL, 0x8d159fc0ULL, 0x1a2b3f80ULL, 0x34567f00ULL, 0x68acfe00ULL, 0xd159fc00ULL, 0xa2b3f800ULL, 0x4567f000ULL, 0x8acfe000ULL, 0x159fc000ULL, 0x2b3f8000ULL, 0x567f0000ULL, 0xacfe0000ULL, 0x59fc0000ULL, 0xb3f80000ULL, 0x67f00000ULL, 0xcfe00000ULL, 0x9fc00000ULL, 0x3f800000ULL, 0x7f000000ULL, 0xfe000000ULL, 0xfc000000ULL, 0xf8000000ULL, 0xf0000000ULL, 0xe0000000ULL, 0xc0000000ULL, 0x80000000ULL }; #else #error "Update the test case." #endif static unsigned long long variable_shift(unsigned long long x, int i) { return x << i; } static unsigned long long constant_shift(unsigned long long x, int i) { switch (i) { case 0: x = x << 0; break; case 1: x = x << 1; break; case 2: x = x << 2; break; case 3: x = x << 3; break; case 4: x = x << 4; break; case 5: x = x << 5; break; case 6: x = x << 6; break; case 7: x = x << 7; break; case 8: x = x << 8; break; case 9: x = x << 9; break; case 10: x = x << 10; break; case 11: x = x << 11; break; case 12: x = x << 12; break; case 13: x = x << 13; break; case 14: x = x << 14; break; case 15: x = x << 15; break; case 16: x = x << 16; break; case 17: x = x << 17; break; case 18: x = x << 18; break; case 19: x = x << 19; break; case 20: x = x << 20; break; case 21: x = x << 21; break; case 22: x = x << 22; break; case 23: x = x << 23; break; case 24: x = x << 24; break; case 25: x = x << 25; break; case 26: x = x << 26; break; case 27: x = x << 27; break; case 28: x = x << 28; break; case 29: x = x << 29; break; case 30: x = x << 30; break; case 31: x = x << 31; break; #if BITS > 32 case 32: x = x << 32; break; case 33: x = x << 33; break; case 34: x = x << 34; break; case 35: x = x << 35; break; case 36: x = x << 36; break; case 37: x = x << 37; break; case 38: x = x << 38; break; case 39: x = x << 39; break; case 40: x = x << 40; break; case 41: x = x << 41; break; case 42: x = x << 42; break; case 43: x = x << 43; break; case 44: x = x << 44; break; case 45: x = x << 45; break; case 46: x = x << 46; break; case 47: x = x << 47; break; case 48: x = x << 48; break; case 49: x = x << 49; break; case 50: x = x << 50; break; case 51: x = x << 51; break; case 52: x = x << 52; break; case 53: x = x << 53; break; case 54: x = x << 54; break; case 55: x = x << 55; break; case 56: x = x << 56; break; case 57: x = x << 57; break; case 58: x = x << 58; break; case 59: x = x << 59; break; case 60: x = x << 60; break; case 61: x = x << 61; break; case 62: x = x << 62; break; case 63: x = x << 63; break; #endif default: abort (); } return x; } int main() { int i; for (i = 0; i < BITS; ++i) { unsigned long long y = variable_shift (data[0], i); if (y != data[i]) abort (); } for (i = 0; i < BITS; ++i) { unsigned long long y = constant_shift (data[0], i); if (y != data[i]) abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ashrdi-1.c ================================================ #include extern void abort(void); extern void exit(int); #if __LONG_LONG_MAX__ == 9223372036854775807LL #define BITS 64 static long long const zext[64] = { 0x7654321fedcba980LL, 0x3b2a190ff6e5d4c0LL, 0x1d950c87fb72ea60LL, 0xeca8643fdb97530LL, 0x7654321fedcba98LL, 0x3b2a190ff6e5d4cLL, 0x1d950c87fb72ea6LL, 0xeca8643fdb9753LL, 0x7654321fedcba9LL, 0x3b2a190ff6e5d4LL, 0x1d950c87fb72eaLL, 0xeca8643fdb975LL, 0x7654321fedcbaLL, 0x3b2a190ff6e5dLL, 0x1d950c87fb72eLL, 0xeca8643fdb97LL, 0x7654321fedcbLL, 0x3b2a190ff6e5LL, 0x1d950c87fb72LL, 0xeca8643fdb9LL, 0x7654321fedcLL, 0x3b2a190ff6eLL, 0x1d950c87fb7LL, 0xeca8643fdbLL, 0x7654321fedLL, 0x3b2a190ff6LL, 0x1d950c87fbLL, 0xeca8643fdLL, 0x7654321feLL, 0x3b2a190ffLL, 0x1d950c87fLL, 0xeca8643fLL, 0x7654321fLL, 0x3b2a190fLL, 0x1d950c87LL, 0xeca8643LL, 0x7654321LL, 0x3b2a190LL, 0x1d950c8LL, 0xeca864LL, 0x765432LL, 0x3b2a19LL, 0x1d950cLL, 0xeca86LL, 0x76543LL, 0x3b2a1LL, 0x1d950LL, 0xeca8LL, 0x7654LL, 0x3b2aLL, 0x1d95LL, 0xecaLL, 0x765LL, 0x3b2LL, 0x1d9LL, 0xecLL, 0x76LL, 0x3bLL, 0x1dLL, 0xeLL, 0x7LL, 0x3LL, 0x1LL, 0LL }; static long long const sext[64] = { 0x8edcba9f76543210LL, 0xc76e5d4fbb2a1908LL, 0xe3b72ea7dd950c84LL, 0xf1db9753eeca8642LL, 0xf8edcba9f7654321LL, 0xfc76e5d4fbb2a190LL, 0xfe3b72ea7dd950c8LL, 0xff1db9753eeca864LL, 0xff8edcba9f765432LL, 0xffc76e5d4fbb2a19LL, 0xffe3b72ea7dd950cLL, 0xfff1db9753eeca86LL, 0xfff8edcba9f76543LL, 0xfffc76e5d4fbb2a1LL, 0xfffe3b72ea7dd950LL, 0xffff1db9753eeca8LL, 0xffff8edcba9f7654LL, 0xffffc76e5d4fbb2aLL, 0xffffe3b72ea7dd95LL, 0xfffff1db9753eecaLL, 0xfffff8edcba9f765LL, 0xfffffc76e5d4fbb2LL, 0xfffffe3b72ea7dd9LL, 0xffffff1db9753eecLL, 0xffffff8edcba9f76LL, 0xffffffc76e5d4fbbLL, 0xffffffe3b72ea7ddLL, 0xfffffff1db9753eeLL, 0xfffffff8edcba9f7LL, 0xfffffffc76e5d4fbLL, 0xfffffffe3b72ea7dLL, 0xffffffff1db9753eLL, 0xffffffff8edcba9fLL, 0xffffffffc76e5d4fLL, 0xffffffffe3b72ea7LL, 0xfffffffff1db9753LL, 0xfffffffff8edcba9LL, 0xfffffffffc76e5d4LL, 0xfffffffffe3b72eaLL, 0xffffffffff1db975LL, 0xffffffffff8edcbaLL, 0xffffffffffc76e5dLL, 0xffffffffffe3b72eLL, 0xfffffffffff1db97LL, 0xfffffffffff8edcbLL, 0xfffffffffffc76e5LL, 0xfffffffffffe3b72LL, 0xffffffffffff1db9LL, 0xffffffffffff8edcLL, 0xffffffffffffc76eLL, 0xffffffffffffe3b7LL, 0xfffffffffffff1dbLL, 0xfffffffffffff8edLL, 0xfffffffffffffc76LL, 0xfffffffffffffe3bLL, 0xffffffffffffff1dLL, 0xffffffffffffff8eLL, 0xffffffffffffffc7LL, 0xffffffffffffffe3LL, 0xfffffffffffffff1LL, 0xfffffffffffffff8LL, 0xfffffffffffffffcLL, 0xfffffffffffffffeLL, 0xffffffffffffffffLL }; #elif __LONG_LONG_MAX__ == 2147483647LL #define BITS 32 static long long const zext[32] = { 0x76543218LL, 0x3b2a190cLL, 0x1d950c86LL, 0xeca8643LL, 0x7654321LL, 0x3b2a190LL, 0x1d950c8LL, 0xeca864LL, 0x765432LL, 0x3b2a19LL, 0x1d950cLL, 0xeca86LL, 0x76543LL, 0x3b2a1LL, 0x1d950LL, 0xeca8LL, 0x7654LL, 0x3b2aLL, 0x1d95LL, 0xecaLL, 0x765LL, 0x3b2LL, 0x1d9LL, 0xecLL, 0x76LL, 0x3bLL, 0x1dLL, 0xeLL, 0x7LL, 0x3LL, 0x1LL, 0LL }; static long long const sext[64] = { 0x87654321LL, 0xc3b2a190LL, 0xe1d950c8LL, 0xf0eca864LL, 0xf8765432LL, 0xfc3b2a19LL, 0xfe1d950cLL, 0xff0eca86LL, 0xff876543LL, 0xffc3b2a1LL, 0xffe1d950LL, 0xfff0eca8LL, 0xfff87654LL, 0xfffc3b2aLL, 0xfffe1d95LL, 0xffff0ecaLL, 0xffff8765LL, 0xffffc3b2LL, 0xffffe1d9LL, 0xfffff0ecLL, 0xfffff876LL, 0xfffffc3bLL, 0xfffffe1dLL, 0xffffff0eLL, 0xffffff87LL, 0xffffffc3LL, 0xffffffe1LL, 0xfffffff0LL, 0xfffffff8LL, 0xfffffffcLL, 0xfffffffeLL, 0xffffffffLL }; #else #error "Update the test case." #endif static long long variable_shift(long long x, int i) { return x >> i; } static long long constant_shift(long long x, int i) { switch (i) { case 0: x = x >> 0; break; case 1: x = x >> 1; break; case 2: x = x >> 2; break; case 3: x = x >> 3; break; case 4: x = x >> 4; break; case 5: x = x >> 5; break; case 6: x = x >> 6; break; case 7: x = x >> 7; break; case 8: x = x >> 8; break; case 9: x = x >> 9; break; case 10: x = x >> 10; break; case 11: x = x >> 11; break; case 12: x = x >> 12; break; case 13: x = x >> 13; break; case 14: x = x >> 14; break; case 15: x = x >> 15; break; case 16: x = x >> 16; break; case 17: x = x >> 17; break; case 18: x = x >> 18; break; case 19: x = x >> 19; break; case 20: x = x >> 20; break; case 21: x = x >> 21; break; case 22: x = x >> 22; break; case 23: x = x >> 23; break; case 24: x = x >> 24; break; case 25: x = x >> 25; break; case 26: x = x >> 26; break; case 27: x = x >> 27; break; case 28: x = x >> 28; break; case 29: x = x >> 29; break; case 30: x = x >> 30; break; case 31: x = x >> 31; break; #if BITS > 32 case 32: x = x >> 32; break; case 33: x = x >> 33; break; case 34: x = x >> 34; break; case 35: x = x >> 35; break; case 36: x = x >> 36; break; case 37: x = x >> 37; break; case 38: x = x >> 38; break; case 39: x = x >> 39; break; case 40: x = x >> 40; break; case 41: x = x >> 41; break; case 42: x = x >> 42; break; case 43: x = x >> 43; break; case 44: x = x >> 44; break; case 45: x = x >> 45; break; case 46: x = x >> 46; break; case 47: x = x >> 47; break; case 48: x = x >> 48; break; case 49: x = x >> 49; break; case 50: x = x >> 50; break; case 51: x = x >> 51; break; case 52: x = x >> 52; break; case 53: x = x >> 53; break; case 54: x = x >> 54; break; case 55: x = x >> 55; break; case 56: x = x >> 56; break; case 57: x = x >> 57; break; case 58: x = x >> 58; break; case 59: x = x >> 59; break; case 60: x = x >> 60; break; case 61: x = x >> 61; break; case 62: x = x >> 62; break; case 63: x = x >> 63; break; #endif default: abort (); } return x; } int main() { int i; for (i = 0; i < BITS; ++i) { long long y = variable_shift (zext[0], i); if (y != zext[i]) abort (); } for (i = 0; i < BITS; ++i) { long long y = variable_shift (sext[0], i); if (y != sext[i]) abort (); } for (i = 0; i < BITS; ++i) { long long y = constant_shift (zext[0], i); if (y != zext[i]) abort (); } for (i = 0; i < BITS; ++i) { long long y = constant_shift (sext[0], i); if (y != sext[i]) abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bcp-1.c ================================================ /* { dg-options "-fgnu89-inline" } */ extern void abort (void); extern void exit (int); __attribute__ ((externally_visible)) int global; int func(void); /* These must fail. */ int bad0(void) { return __builtin_constant_p(global); } int bad1(void) { return __builtin_constant_p(global++); } inline int bad2(int x) { return __builtin_constant_p(x++); } inline int bad3(int x) { return __builtin_constant_p(x); } inline int bad4(const char *x) { return __builtin_constant_p(x); } int bad5(void) { return bad2(1); } inline int bad6(int x) { return __builtin_constant_p(x+1); } int bad7(void) { return __builtin_constant_p(func()); } int bad8(void) { char buf[10]; return __builtin_constant_p(buf); } int bad9(const char *x) { return __builtin_constant_p(x[123456]); } int bad10(void) { return __builtin_constant_p(&global); } /* These must pass, or we've broken gcc2 functionality. */ int good0(void) { return __builtin_constant_p(1); } int good1(void) { return __builtin_constant_p("hi"); } int good2(void) { return __builtin_constant_p((1234 + 45) & ~7); } /* These are extensions to gcc2. Failure indicates an optimization regression. */ int opt0(void) { return bad3(1); } int opt1(void) { return bad6(1); } int opt2(void) { return __builtin_constant_p("hi"[0]); } /* * Opt3 is known to fail. It is one of the important cases that glibc * was interested in though, so keep this around as a reminder. * * The solution is to add bits to recover bytes from constant pool * elements given nothing but a constant pool label and an offset. * When we can do that, and we can simplify strlen after the fact, * then we can enable recognition of constant pool labels as constants. */ /* int opt3(void) { return bad4("hi"); } */ /* Call through tables so -finline-functions can't screw with us. */ int (* volatile bad_t0[])(void) = { bad0, bad1, bad5, bad7, bad8, bad10 }; int (* volatile bad_t1[])(int x) = { bad2, bad3, bad6 }; int (* volatile bad_t2[])(const char *x) = { bad4, bad9 }; int (* volatile good_t0[])(void) = { good0, good1, good2 }; int (* volatile opt_t0[])(void) = { opt0, opt1, opt2 /* , opt3 */ }; #define N(arr) (sizeof(arr)/sizeof(*arr)) int main() { int i; for (i = 0; i < N(bad_t0); ++i) if ((*bad_t0[i])()) abort(); for (i = 0; i < N(bad_t1); ++i) if ((*bad_t1[i])(1)) abort(); for (i = 0; i < N(bad_t2); ++i) if ((*bad_t2[i])("hi")) abort(); for (i = 0; i < N(good_t0); ++i) if (! (*good_t0[i])()) abort(); #ifdef __OPTIMIZE__ for (i = 0; i < N(opt_t0); ++i) if (! (*opt_t0[i])()) abort(); #endif exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bf-layout-1.c ================================================ struct { long f8:8; long f24:24; } a; struct { long f32:32; } b; main () { if (sizeof (a) != sizeof (b)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bf-pack-1.c ================================================ struct foo { unsigned half:16; unsigned long whole:32 __attribute__ ((packed)); }; f (struct foo *q) { if (q->half != 0x1234) abort (); if (q->whole != 0x56789abcL) abort (); } main () { struct foo bar; bar.half = 0x1234; bar.whole = 0x56789abcL; f (&bar); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bf-sign-1.c ================================================ main () { struct { signed int s:3; unsigned int u:3; int i:3; } x = {-1, -1, -1}; if (x.u != 7) abort (); if (x.s != - 1) abort (); if (x.i != -1 && x.i != 7) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bf-sign-2.c ================================================ /* This test checks promotion of bitfields. Bitfields should be promoted very much like chars and shorts: Bitfields (signed or unsigned) should be promoted to signed int if their value will fit in a signed int, otherwise to an unsigned int if their value will fit in an unsigned int, otherwise we don't promote them (ANSI/ISO does not specify the behavior of bitfields larger than an unsigned int). We test the behavior by subtracting two from the promoted value: this will result in a negitive value for signed types, a positive value for unsigned types. This test (of course) assumes that the compiler is correctly implementing signed and unsigned arithmetic. */ struct X { unsigned int u3:3; signed long int s31:31; signed long int s32:32; unsigned long int u31:31; unsigned long int u32:32; unsigned long long ull3 :3; unsigned long long ull35:35; unsigned u15:15; }; struct X x; main () { if ((x.u3 - 2) >= 0) /* promoted value should be signed */ abort (); if ((x.s31 - 2) >= 0) /* promoted value should be signed */ abort (); if ((x.s32 - 2) >= 0) /* promoted value should be signed */ abort (); if ((x.u15 - 2) >= 0) /* promoted value should be signed */ abort (); /* Conditionalize check on whether integers are 4 bytes or larger, i.e. larger than a 31 bit bitfield. */ if (sizeof (int) >= 4) { if ((x.u31 - 2) >= 0) /* promoted value should be signed */ abort (); } else { if ((x.u31 - 2) < 0) /* promoted value should be UNsigned */ abort (); } if ((x.u32 - 2) < 0) /* promoted value should be UNsigned */ abort (); if ((x.ull3 - 2) >= 0) /* promoted value should be signed */ abort (); if ((x.ull35 - 2) < 0) /* promoted value should be UNsigned */ abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bf64-1.c ================================================ /* { dg-xfail-if "ABI specifies bitfields cannot exceed 32 bits" { mcore-*-* } "*" "" } */ struct tmp { long long int pad : 12; long long int field : 52; }; struct tmp2 { long long int field : 52; long long int pad : 12; }; struct tmp sub (struct tmp tmp) { tmp.field |= 0x0008765412345678LL; return tmp; } struct tmp2 sub2 (struct tmp2 tmp2) { tmp2.field |= 0x0008765412345678LL; return tmp2; } main() { struct tmp tmp = {0x123, 0xFFF000FFF000FLL}; struct tmp2 tmp2 = {0xFFF000FFF000FLL, 0x123}; tmp = sub (tmp); tmp2 = sub2 (tmp2); if (tmp.pad != 0x123 || tmp.field != 0xFFFFFF541FFF567FLL) abort (); if (tmp2.pad != 0x123 || tmp2.field != 0xFFFFFF541FFF567FLL) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bitfld-1.c ================================================ /* Copyright 2002 Free Software Foundation, Inc. Tests correct signedness of operations on bitfields; in particular that integer promotions are done correctly, including the case when casts are present. The C front end was eliding the cast of an unsigned bitfield to unsigned as a no-op, when in fact it forces a conversion to a full-width unsigned int. (At the time of writing, the C++ front end has a different bug; it erroneously promotes the uncast unsigned bitfield to an unsigned int). Source: Neil Booth, 25 Jan 2002, based on PR 3325 (and 3326, which is a different manifestation of the same bug). */ extern void abort (); int main(int argc, char *argv[]) { struct x { signed int i : 7; unsigned int u : 7; } bit; unsigned int u; int i; unsigned int unsigned_result = -13U % 61; int signed_result = -13 % 61; bit.u = 61, u = 61; bit.i = -13, i = -13; if (i % u != unsigned_result) abort (); if (i % (unsigned int) u != unsigned_result) abort (); /* Somewhat counter-intuitively, bit.u is promoted to an int, making the operands and result an int. */ if (i % bit.u != signed_result) abort (); if (bit.i % bit.u != signed_result) abort (); /* But with a cast to unsigned int, the unsigned int is promoted to itself as a no-op, and the operands and result are unsigned. */ if (i % (unsigned int) bit.u != unsigned_result) abort (); if (bit.i % (unsigned int) bit.u != unsigned_result) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bitfld-2.c ================================================ /* Test whether bit field boundaries aren't advanced if bit field type has alignment large enough. */ extern void abort (void); extern void exit (int); struct A { unsigned short a : 5; unsigned short b : 5; unsigned short c : 6; }; struct B { unsigned short a : 5; unsigned short b : 3; unsigned short c : 8; }; int main () { /* If short is not at least 16 bits wide, don't test anything. */ if ((unsigned short) 65521 != 65521) exit (0); if (sizeof (struct A) != sizeof (struct B)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bitfld-3.c ================================================ /* Test that operations on bit-fields yield results reduced to bit-field type. */ /* Origin: Joseph Myers */ extern void exit (int); extern void abort (void); struct s { unsigned long long u33: 33; unsigned long long u40: 40; unsigned long long u41: 41; }; struct s a = { 0x100000, 0x100000, 0x100000 }; struct s b = { 0x100000000ULL, 0x100000000ULL, 0x100000000ULL }; struct s c = { 0x1FFFFFFFFULL, 0, 0 }; int main (void) { if (a.u33 * a.u33 != 0 || a.u33 * a.u40 != 0 || a.u40 * a.u33 != 0 || a.u40 * a.u40 != 0) abort (); if (a.u33 * a.u41 != 0x10000000000ULL || a.u40 * a.u41 != 0x10000000000ULL || a.u41 * a.u33 != 0x10000000000ULL || a.u41 * a.u40 != 0x10000000000ULL || a.u41 * a.u41 != 0x10000000000ULL) abort (); if (b.u33 + b.u33 != 0) abort (); if (b.u33 + b.u40 != 0x200000000ULL || b.u33 + b.u41 != 0x200000000ULL || b.u40 + b.u33 != 0x200000000ULL || b.u40 + b.u40 != 0x200000000ULL || b.u40 + b.u41 != 0x200000000ULL || b.u41 + b.u33 != 0x200000000ULL || b.u41 + b.u40 != 0x200000000ULL || b.u41 + b.u41 != 0x200000000ULL) abort (); if (a.u33 - b.u33 != 0x100100000ULL || a.u33 - b.u40 != 0xFF00100000ULL || a.u33 - b.u41 != 0x1FF00100000ULL || a.u40 - b.u33 != 0xFF00100000ULL || a.u40 - b.u40 != 0xFF00100000ULL || a.u40 - b.u41 != 0x1FF00100000ULL || a.u41 - b.u33 != 0x1FF00100000ULL || a.u41 - b.u40 != 0x1FF00100000ULL || a.u41 - b.u41 != 0x1FF00100000ULL) abort (); if (++c.u33 != 0 || --c.u40 != 0xFFFFFFFFFFULL || c.u41-- != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bitfld-4.c ================================================ /* When comparisons of bit-fields to unsigned constants got shortened, the shortened signed constant was wrongly marked as overflowing, leading to a later integer_zerop failure and misoptimization. Related to bug tree-optimization/16437 but shows the problem on 32-bit systems. */ /* Origin: Joseph Myers */ /* { dg-require-effective-target int32plus } */ extern void abort (void); struct s { int a:12, b:20; }; struct s x = { -123, -456 }; int main (void) { if (x.a != -123U || x.b != -456U) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bitfld-5.c ================================================ /* See http://gcc.gnu.org/ml/gcc/2009-06/msg00072.html. */ extern void abort (void); struct s { unsigned long long a:2; unsigned long long b:40; unsigned long long c:22; }; __attribute__ ((noinline)) void g (unsigned long long a, unsigned long long b) { asm (""); if (a != b) abort (); } __attribute__ ((noinline)) void f (struct s s, unsigned long long b) { asm (""); g (((unsigned long long) (s.b-8)) + 8, b); } int main () { struct s s = {1, 10, 3}; struct s t = {1, 2, 3}; f (s, 10); f (t, 0x10000000002); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bitfld-6.c ================================================ union U { const int a; unsigned b : 20; }; static union U u = { 0x12345678 }; /* Constant folding used to fail to account for endianness when folding a union. */ int main (void) { #ifdef __BYTE_ORDER__ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ return u.b - 0x45678; #else return u.b - 0x12345; #endif #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bitfld-7.c ================================================ union U { const int a; unsigned b : 24; }; static union U u = { 0x12345678 }; /* Constant folding used to fail to account for endianness when folding a union. */ int main (void) { #ifdef __BYTE_ORDER__ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ return u.b - 0x345678; #else return u.b - 0x123456; #endif #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bswap-1.c ================================================ /* Test __builtin_bswap64 . */ unsigned long long g(unsigned long long a) __attribute__((noinline)); unsigned long long g(unsigned long long a) { return __builtin_bswap64(a); } unsigned long long f(unsigned long long c) { union { unsigned long long a; unsigned char b[8]; } a, b; a.a = c; b.b[0] = a.b[7]; b.b[1] = a.b[6]; b.b[2] = a.b[5]; b.b[3] = a.b[4]; b.b[4] = a.b[3]; b.b[5] = a.b[2]; b.b[6] = a.b[1]; b.b[7] = a.b[0]; return b.a; } int main(void) { unsigned long long i; /* The rest of the testcase assumes 8 byte long long. */ if (sizeof(i) != sizeof(char)*8) return 0; if (f(0x12) != g(0x12)) __builtin_abort(); if (f(0x1234) != g(0x1234)) __builtin_abort(); if (f(0x123456) != g(0x123456)) __builtin_abort(); if (f(0x12345678ull) != g(0x12345678ull)) __builtin_abort(); if (f(0x1234567890ull) != g(0x1234567890ull)) __builtin_abort(); if (f(0x123456789012ull) != g(0x123456789012ull)) __builtin_abort(); if (f(0x12345678901234ull) != g(0x12345678901234ull)) __builtin_abort(); if (f(0x1234567890123456ull) != g(0x1234567890123456ull)) __builtin_abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/bswap-2.c ================================================ #ifdef __UINT32_TYPE__ typedef __UINT32_TYPE__ uint32_t; #else typedef __UINT32_TYPE__ unsigned; #endif struct bitfield { unsigned char f0:7; unsigned char :1; unsigned char f1:7; unsigned char :1; unsigned char f2:7; unsigned char :1; unsigned char f3:7; }; struct ok { unsigned char f0; unsigned char f1; unsigned char f2; unsigned char f3; }; union bf_or_uint32 { struct ok inval; struct bitfield bfval; }; __attribute__ ((noinline, noclone)) uint32_t partial_read_le32 (union bf_or_uint32 in) { return in.bfval.f0 | (in.bfval.f1 << 8) | (in.bfval.f2 << 16) | (in.bfval.f3 << 24); } __attribute__ ((noinline, noclone)) uint32_t partial_read_be32 (union bf_or_uint32 in) { return in.bfval.f3 | (in.bfval.f2 << 8) | (in.bfval.f1 << 16) | (in.bfval.f0 << 24); } __attribute__ ((noinline, noclone)) uint32_t fake_read_le32 (char *x, char *y) { unsigned char c0, c1, c2, c3; c0 = x[0]; c1 = x[1]; *y = 1; c2 = x[2]; c3 = x[3]; return c0 | c1 << 8 | c2 << 16 | c3 << 24; } __attribute__ ((noinline, noclone)) uint32_t fake_read_be32 (char *x, char *y) { unsigned char c0, c1, c2, c3; c0 = x[0]; c1 = x[1]; *y = 1; c2 = x[2]; c3 = x[3]; return c3 | c2 << 8 | c1 << 16 | c0 << 24; } __attribute__ ((noinline, noclone)) uint32_t incorrect_read_le32 (char *x, char *y) { unsigned char c0, c1, c2, c3; c0 = x[0]; c1 = x[1]; c2 = x[2]; c3 = x[3]; *y = 1; return c0 | c1 << 8 | c2 << 16 | c3 << 24; } __attribute__ ((noinline, noclone)) uint32_t incorrect_read_be32 (char *x, char *y) { unsigned char c0, c1, c2, c3; c0 = x[0]; c1 = x[1]; c2 = x[2]; c3 = x[3]; *y = 1; return c3 | c2 << 8 | c1 << 16 | c0 << 24; } int main () { union bf_or_uint32 bfin; uint32_t out; char cin[] = { 0x83, 0x85, 0x87, 0x89 }; if (sizeof (uint32_t) * __CHAR_BIT__ != 32) return 0; bfin.inval = (struct ok) { 0x83, 0x85, 0x87, 0x89 }; out = partial_read_le32 (bfin); /* Test what bswap would do if its check are not strict enough instead of what is the expected result as there is too many possible results with bitfields. */ if (out == 0x89878583) __builtin_abort (); bfin.inval = (struct ok) { 0x83, 0x85, 0x87, 0x89 }; out = partial_read_be32 (bfin); /* Test what bswap would do if its check are not strict enough instead of what is the expected result as there is too many possible results with bitfields. */ if (out == 0x83858789) __builtin_abort (); out = fake_read_le32 (cin, &cin[2]); if (out != 0x89018583) __builtin_abort (); cin[2] = 0x87; out = fake_read_be32 (cin, &cin[2]); if (out != 0x83850189) __builtin_abort (); cin[2] = 0x87; out = incorrect_read_le32 (cin, &cin[2]); if (out != 0x89878583) __builtin_abort (); cin[2] = 0x87; out = incorrect_read_be32 (cin, &cin[2]); if (out != 0x83858789) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/built-in-setjmp.c ================================================ /* { dg-require-effective-target indirect_jumps } */ /* { dg-require-effective-target alloca } */ extern int strcmp(const char *, const char *); extern char *strcpy(char *, const char *); extern void abort(void); extern void exit(int); void *buf[20]; void __attribute__((noinline)) sub2 (void) { __builtin_longjmp (buf, 1); } int main () { char *p = (char *) __builtin_alloca (20); strcpy (p, "test"); if (__builtin_setjmp (buf)) { if (strcmp (p, "test") != 0) abort (); exit (0); } { int *q = (int *) __builtin_alloca (p[2] * sizeof (int)); int i; for (i = 0; i < p[2]; i++) q[i] = 0; while (1) sub2 (); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtin-bitops-1.c ================================================ #include #include #if __INT_MAX__ > 2147483647L # if __INT_MAX__ >= 9223372036854775807L # define BITSIZEOF_INT 64 # else # define BITSIZEOF_INT 32 # endif #else # if __INT_MAX__ >= 2147483647L # define BITSIZEOF_INT 32 # else # define BITSIZEOF_INT 16 # endif #endif #if __LONG_MAX__ > 2147483647L # if __LONG_MAX__ >= 9223372036854775807L # define BITSIZEOF_LONG 64 # else # define BITSIZEOF_LONG 32 # endif #else # define BITSIZEOF_LONG 32 #endif #if __LONG_LONG_MAX__ > 2147483647L # if __LONG_LONG_MAX__ >= 9223372036854775807L # define BITSIZEOF_LONG_LONG 64 # else # define BITSIZEOF_LONG_LONG 32 # endif #else # define BITSIZEOF_LONG_LONG 32 #endif #define MAKE_FUNS(suffix, type) \ int my_ffs##suffix(type x) { \ int i; \ if (x == 0) \ return 0; \ for (i = 0; i < CHAR_BIT * sizeof (type); i++) \ if (x & ((type) 1 << i)) \ break; \ return i + 1; \ } \ \ int my_ctz##suffix(type x) { \ int i; \ for (i = 0; i < CHAR_BIT * sizeof (type); i++) \ if (x & ((type) 1 << i)) \ break; \ return i; \ } \ \ int my_clz##suffix(type x) { \ int i; \ for (i = 0; i < CHAR_BIT * sizeof (type); i++) \ if (x & ((type) 1 << ((CHAR_BIT * sizeof (type)) - i - 1))) \ break; \ return i; \ } \ \ int my_clrsb##suffix(type x) { \ int i; \ int leading = (x >> CHAR_BIT * sizeof (type) - 1) & 1; \ for (i = 1; i < CHAR_BIT * sizeof (type); i++) \ if (((x >> ((CHAR_BIT * sizeof (type)) - i - 1)) & 1) \ != leading) \ break; \ return i - 1; \ } \ \ int my_popcount##suffix(type x) { \ int i; \ int count = 0; \ for (i = 0; i < CHAR_BIT * sizeof (type); i++) \ if (x & ((type) 1 << i)) \ count++; \ return count; \ } \ \ int my_parity##suffix(type x) { \ int i; \ int count = 0; \ for (i = 0; i < CHAR_BIT * sizeof (type); i++) \ if (x & ((type) 1 << i)) \ count++; \ return count & 1; \ } MAKE_FUNS (, unsigned); MAKE_FUNS (l, unsigned long); MAKE_FUNS (ll, unsigned long long); extern void abort (void); extern void exit (int); #define NUMS16 \ { \ 0x0000U, \ 0x0001U, \ 0x8000U, \ 0x0002U, \ 0x4000U, \ 0x0100U, \ 0x0080U, \ 0xa5a5U, \ 0x5a5aU, \ 0xcafeU, \ 0xffffU \ } #define NUMS32 \ { \ 0x00000000UL, \ 0x00000001UL, \ 0x80000000UL, \ 0x00000002UL, \ 0x40000000UL, \ 0x00010000UL, \ 0x00008000UL, \ 0xa5a5a5a5UL, \ 0x5a5a5a5aUL, \ 0xcafe0000UL, \ 0x00cafe00UL, \ 0x0000cafeUL, \ 0xffffffffUL \ } #define NUMS64 \ { \ 0x0000000000000000ULL, \ 0x0000000000000001ULL, \ 0x8000000000000000ULL, \ 0x0000000000000002ULL, \ 0x4000000000000000ULL, \ 0x0000000100000000ULL, \ 0x0000000080000000ULL, \ 0xa5a5a5a5a5a5a5a5ULL, \ 0x5a5a5a5a5a5a5a5aULL, \ 0xcafecafe00000000ULL, \ 0x0000cafecafe0000ULL, \ 0x00000000cafecafeULL, \ 0xffffffffffffffffULL \ } unsigned int ints[] = #if BITSIZEOF_INT == 64 NUMS64; #elif BITSIZEOF_INT == 32 NUMS32; #else NUMS16; #endif unsigned long longs[] = #if BITSIZEOF_LONG == 64 NUMS64; #else NUMS32; #endif unsigned long long longlongs[] = #if BITSIZEOF_LONG_LONG == 64 NUMS64; #else NUMS32; #endif #define N(table) (sizeof (table) / sizeof (table[0])) int main (void) { int i; for (i = 0; i < N(ints); i++) { if (__builtin_ffs (ints[i]) != my_ffs (ints[i])) abort (); if (ints[i] != 0 && __builtin_clz (ints[i]) != my_clz (ints[i])) abort (); if (ints[i] != 0 && __builtin_ctz (ints[i]) != my_ctz (ints[i])) abort (); if (__builtin_clrsb (ints[i]) != my_clrsb (ints[i])) abort (); if (__builtin_popcount (ints[i]) != my_popcount (ints[i])) abort (); if (__builtin_parity (ints[i]) != my_parity (ints[i])) abort (); } for (i = 0; i < N(longs); i++) { if (__builtin_ffsl (longs[i]) != my_ffsl (longs[i])) abort (); if (longs[i] != 0 && __builtin_clzl (longs[i]) != my_clzl (longs[i])) abort (); if (longs[i] != 0 && __builtin_ctzl (longs[i]) != my_ctzl (longs[i])) abort (); if (__builtin_clrsbl (longs[i]) != my_clrsbl (longs[i])) abort (); if (__builtin_popcountl (longs[i]) != my_popcountl (longs[i])) abort (); if (__builtin_parityl (longs[i]) != my_parityl (longs[i])) abort (); } for (i = 0; i < N(longlongs); i++) { if (__builtin_ffsll (longlongs[i]) != my_ffsll (longlongs[i])) abort (); if (longlongs[i] != 0 && __builtin_clzll (longlongs[i]) != my_clzll (longlongs[i])) abort (); if (longlongs[i] != 0 && __builtin_ctzll (longlongs[i]) != my_ctzll (longlongs[i])) abort (); if (__builtin_clrsbll (longlongs[i]) != my_clrsbll (longlongs[i])) abort (); if (__builtin_popcountll (longlongs[i]) != my_popcountll (longlongs[i])) abort (); if (__builtin_parityll (longlongs[i]) != my_parityll (longlongs[i])) abort (); } /* Test constant folding. */ #define TEST(x, suffix) \ if (__builtin_ffs##suffix (x) != my_ffs##suffix (x)) \ abort (); \ if (x != 0 && __builtin_clz##suffix (x) != my_clz##suffix (x)) \ abort (); \ if (x != 0 && __builtin_ctz##suffix (x) != my_ctz##suffix (x)) \ abort (); \ if (__builtin_clrsb##suffix (x) != my_clrsb##suffix (x)) \ abort (); \ if (__builtin_popcount##suffix (x) != my_popcount##suffix (x)) \ abort (); \ if (__builtin_parity##suffix (x) != my_parity##suffix (x)) \ abort (); #if BITSIZEOF_INT == 32 TEST(0x00000000UL,); TEST(0x00000001UL,); TEST(0x80000000UL,); TEST(0x40000000UL,); TEST(0x00010000UL,); TEST(0x00008000UL,); TEST(0xa5a5a5a5UL,); TEST(0x5a5a5a5aUL,); TEST(0xcafe0000UL,); TEST(0x00cafe00UL,); TEST(0x0000cafeUL,); TEST(0xffffffffUL,); #endif #if BITSIZEOF_LONG_LONG == 64 TEST(0x0000000000000000ULL, ll); TEST(0x0000000000000001ULL, ll); TEST(0x8000000000000000ULL, ll); TEST(0x0000000000000002ULL, ll); TEST(0x4000000000000000ULL, ll); TEST(0x0000000100000000ULL, ll); TEST(0x0000000080000000ULL, ll); TEST(0xa5a5a5a5a5a5a5a5ULL, ll); TEST(0x5a5a5a5a5a5a5a5aULL, ll); TEST(0xcafecafe00000000ULL, ll); TEST(0x0000cafecafe0000ULL, ll); TEST(0x00000000cafecafeULL, ll); TEST(0xffffffffffffffffULL, ll); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtin-constant.c ================================================ /* PR optimization/8423. */ #define btest(x) __builtin_constant_p(x) ? "1" : "0" #ifdef __OPTIMIZE__ void foo (char *i) { if (*i == '0') abort (); } #else void foo (char *i) { } #endif int main (void) { int size = sizeof (int); foo (btest (size)); foo (btest (size)); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtin-prefetch-1.c ================================================ /* Test that __builtin_prefetch does no harm. Prefetch using all valid combinations of rw and locality values. These must be compile-time constants. */ #define NO_TEMPORAL_LOCALITY 0 #define LOW_TEMPORAL_LOCALITY 1 #define MODERATE_TEMPORAL_LOCALITY 1 #define HIGH_TEMPORAL_LOCALITY 3 #define WRITE_ACCESS 1 #define READ_ACCESS 0 enum locality { none, low, moderate, high }; enum rw { read, write }; int arr[10]; void good_const (const int *p) { __builtin_prefetch (p, 0, 0); __builtin_prefetch (p, 0, 1); __builtin_prefetch (p, 0, 2); __builtin_prefetch (p, READ_ACCESS, 3); __builtin_prefetch (p, 1, NO_TEMPORAL_LOCALITY); __builtin_prefetch (p, 1, LOW_TEMPORAL_LOCALITY); __builtin_prefetch (p, 1, MODERATE_TEMPORAL_LOCALITY); __builtin_prefetch (p, WRITE_ACCESS, HIGH_TEMPORAL_LOCALITY); } void good_enum (const int *p) { __builtin_prefetch (p, read, none); __builtin_prefetch (p, read, low); __builtin_prefetch (p, read, moderate); __builtin_prefetch (p, read, high); __builtin_prefetch (p, write, none); __builtin_prefetch (p, write, low); __builtin_prefetch (p, write, moderate); __builtin_prefetch (p, write, high); } void good_expr (const int *p) { __builtin_prefetch (p, 1 - 1, 6 - (2 * 3)); __builtin_prefetch (p, 1 + 0, 1 + 2); } void good_vararg (const int *p) { __builtin_prefetch (p, 0, 3); __builtin_prefetch (p, 0); __builtin_prefetch (p, 1); __builtin_prefetch (p); } int main () { good_const (arr); good_enum (arr); good_expr (arr); good_vararg (arr); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtin-prefetch-2.c ================================================ /* Test that __builtin_prefetch does no harm. Prefetch data using a variety of storage classes and address expressions. */ int glob_int_arr[100]; int *glob_ptr_int = glob_int_arr; int glob_int = 4; static stat_int_arr[100]; static int *stat_ptr_int = stat_int_arr; static int stat_int; struct S { int a; short b, c; char d[8]; struct S *next; }; struct S str; struct S *ptr_str = &str; /* Prefetch global variables using the address of the variable. */ void simple_global () { __builtin_prefetch (glob_int_arr, 0, 0); __builtin_prefetch (glob_ptr_int, 0, 0); __builtin_prefetch (&glob_int, 0, 0); } /* Prefetch file-level static variables using the address of the variable. */ void simple_file () { __builtin_prefetch (stat_int_arr, 0, 0); __builtin_prefetch (stat_ptr_int, 0, 0); __builtin_prefetch (&stat_int, 0, 0); } /* Prefetch local static variables using the address of the variable. */ void simple_static_local () { static int gx[100]; static int *hx = gx; static int ix; __builtin_prefetch (gx, 0, 0); __builtin_prefetch (hx, 0, 0); __builtin_prefetch (&ix, 0, 0); } /* Prefetch local stack variables using the address of the variable. */ void simple_local () { int gx[100]; int *hx = gx; int ix; __builtin_prefetch (gx, 0, 0); __builtin_prefetch (hx, 0, 0); __builtin_prefetch (&ix, 0, 0); } /* Prefetch arguments using the address of the variable. */ void simple_arg (int g[100], int *h, int i) { __builtin_prefetch (g, 0, 0); __builtin_prefetch (h, 0, 0); __builtin_prefetch (&i, 0, 0); } /* Prefetch using address expressions involving global variables. */ void expr_global (void) { __builtin_prefetch (&str, 0, 0); __builtin_prefetch (ptr_str, 0, 0); __builtin_prefetch (&str.b, 0, 0); __builtin_prefetch (&ptr_str->b, 0, 0); __builtin_prefetch (&str.d, 0, 0); __builtin_prefetch (&ptr_str->d, 0, 0); __builtin_prefetch (str.next, 0, 0); __builtin_prefetch (ptr_str->next, 0, 0); __builtin_prefetch (str.next->d, 0, 0); __builtin_prefetch (ptr_str->next->d, 0, 0); __builtin_prefetch (&glob_int_arr, 0, 0); __builtin_prefetch (glob_ptr_int, 0, 0); __builtin_prefetch (&glob_int_arr[2], 0, 0); __builtin_prefetch (&glob_ptr_int[3], 0, 0); __builtin_prefetch (glob_int_arr+3, 0, 0); __builtin_prefetch (glob_int_arr+glob_int, 0, 0); __builtin_prefetch (glob_ptr_int+5, 0, 0); __builtin_prefetch (glob_ptr_int+glob_int, 0, 0); } /* Prefetch using address expressions involving local variables. */ void expr_local (void) { int b[10]; int *pb = b; struct S t; struct S *pt = &t; int j = 4; __builtin_prefetch (&t, 0, 0); __builtin_prefetch (pt, 0, 0); __builtin_prefetch (&t.b, 0, 0); __builtin_prefetch (&pt->b, 0, 0); __builtin_prefetch (&t.d, 0, 0); __builtin_prefetch (&pt->d, 0, 0); __builtin_prefetch (t.next, 0, 0); __builtin_prefetch (pt->next, 0, 0); __builtin_prefetch (t.next->d, 0, 0); __builtin_prefetch (pt->next->d, 0, 0); __builtin_prefetch (&b, 0, 0); __builtin_prefetch (pb, 0, 0); __builtin_prefetch (&b[2], 0, 0); __builtin_prefetch (&pb[3], 0, 0); __builtin_prefetch (b+3, 0, 0); __builtin_prefetch (b+j, 0, 0); __builtin_prefetch (pb+5, 0, 0); __builtin_prefetch (pb+j, 0, 0); } int main () { simple_global (); simple_file (); simple_static_local (); simple_local (); simple_arg (glob_int_arr, glob_ptr_int, glob_int); str.next = &str; expr_global (); expr_local (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtin-prefetch-3.c ================================================ /* Test that __builtin_prefetch does no harm. Prefetch data using a variety of storage classes and address expressions with volatile variables and pointers. */ int glob_int_arr[100]; int glob_int = 4; volatile int glob_vol_int_arr[100]; int * volatile glob_vol_ptr_int = glob_int_arr; volatile int *glob_ptr_vol_int = glob_vol_int_arr; volatile int * volatile glob_vol_ptr_vol_int = glob_vol_int_arr; volatile int glob_vol_int; static stat_int_arr[100]; static volatile int stat_vol_int_arr[100]; static int * volatile stat_vol_ptr_int = stat_int_arr; static volatile int *stat_ptr_vol_int = stat_vol_int_arr; static volatile int * volatile stat_vol_ptr_vol_int = stat_vol_int_arr; static volatile int stat_vol_int; struct S { int a; short b, c; char d[8]; struct S *next; }; struct S str; volatile struct S vol_str; struct S * volatile vol_ptr_str = &str; volatile struct S *ptr_vol_str = &vol_str; volatile struct S * volatile vol_ptr_vol_str = &vol_str; /* Prefetch volatile global variables using the address of the variable. */ void simple_vol_global () { __builtin_prefetch (glob_vol_int_arr, 0, 0); __builtin_prefetch (glob_vol_ptr_int, 0, 0); __builtin_prefetch (glob_ptr_vol_int, 0, 0); __builtin_prefetch (glob_vol_ptr_vol_int, 0, 0); __builtin_prefetch (&glob_vol_int, 0, 0); } /* Prefetch volatile static variables using the address of the variable. */ void simple_vol_file () { __builtin_prefetch (stat_vol_int_arr, 0, 0); __builtin_prefetch (stat_vol_ptr_int, 0, 0); __builtin_prefetch (stat_ptr_vol_int, 0, 0); __builtin_prefetch (stat_vol_ptr_vol_int, 0, 0); __builtin_prefetch (&stat_vol_int, 0, 0); } /* Prefetch using address expressions involving volatile global variables. */ void expr_vol_global (void) { __builtin_prefetch (&vol_str, 0, 0); __builtin_prefetch (ptr_vol_str, 0, 0); __builtin_prefetch (vol_ptr_str, 0, 0); __builtin_prefetch (vol_ptr_vol_str, 0, 0); __builtin_prefetch (&vol_str.b, 0, 0); __builtin_prefetch (&ptr_vol_str->b, 0, 0); __builtin_prefetch (&vol_ptr_str->b, 0, 0); __builtin_prefetch (&vol_ptr_vol_str->b, 0, 0); __builtin_prefetch (&vol_str.d, 0, 0); __builtin_prefetch (&vol_ptr_str->d, 0, 0); __builtin_prefetch (&ptr_vol_str->d, 0, 0); __builtin_prefetch (&vol_ptr_vol_str->d, 0, 0); __builtin_prefetch (vol_str.next, 0, 0); __builtin_prefetch (vol_ptr_str->next, 0, 0); __builtin_prefetch (ptr_vol_str->next, 0, 0); __builtin_prefetch (vol_ptr_vol_str->next, 0, 0); __builtin_prefetch (vol_str.next->d, 0, 0); __builtin_prefetch (vol_ptr_str->next->d, 0, 0); __builtin_prefetch (ptr_vol_str->next->d, 0, 0); __builtin_prefetch (vol_ptr_vol_str->next->d, 0, 0); __builtin_prefetch (&glob_vol_int_arr, 0, 0); __builtin_prefetch (glob_vol_ptr_int, 0, 0); __builtin_prefetch (glob_ptr_vol_int, 0, 0); __builtin_prefetch (glob_vol_ptr_vol_int, 0, 0); __builtin_prefetch (&glob_vol_int_arr[2], 0, 0); __builtin_prefetch (&glob_vol_ptr_int[3], 0, 0); __builtin_prefetch (&glob_ptr_vol_int[3], 0, 0); __builtin_prefetch (&glob_vol_ptr_vol_int[3], 0, 0); __builtin_prefetch (glob_vol_int_arr+3, 0, 0); __builtin_prefetch (glob_vol_int_arr+glob_vol_int, 0, 0); __builtin_prefetch (glob_vol_ptr_int+5, 0, 0); __builtin_prefetch (glob_ptr_vol_int+5, 0, 0); __builtin_prefetch (glob_vol_ptr_vol_int+5, 0, 0); __builtin_prefetch (glob_vol_ptr_int+glob_vol_int, 0, 0); __builtin_prefetch (glob_ptr_vol_int+glob_vol_int, 0, 0); __builtin_prefetch (glob_vol_ptr_vol_int+glob_vol_int, 0, 0); } int main () { simple_vol_global (); simple_vol_file (); str.next = &str; vol_str.next = &str; expr_vol_global (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtin-prefetch-4.c ================================================ /* Test that __builtin_prefetch does no harm. Check that the expression containing the address to prefetch is evaluated if it has side effects, even if the target does not support data prefetch. Check changes to pointers and to array indices that are either global variables or arguments. */ #define ARRSIZE 100 int arr[ARRSIZE]; int *ptr = &arr[20]; int arrindex = 4; /* Check that assignment within a prefetch argument is evaluated. */ int assign_arg_ptr (int *p) { int *q; __builtin_prefetch ((q = p), 0, 0); return q == p; } int assign_glob_ptr (void) { int *q; __builtin_prefetch ((q = ptr), 0, 0); return q == ptr; } int assign_arg_idx (int *p, int i) { int j; __builtin_prefetch (&p[j = i], 0, 0); return j == i; } int assign_glob_idx (void) { int j; __builtin_prefetch (&ptr[j = arrindex], 0, 0); return j == arrindex; } /* Check that pre/post increment/decrement within a prefetch argument are evaluated. */ int preinc_arg_ptr (int *p) { int *q; q = p + 1; __builtin_prefetch (++p, 0, 0); return p == q; } int preinc_glob_ptr (void) { int *q; q = ptr + 1; __builtin_prefetch (++ptr, 0, 0); return ptr == q; } int postinc_arg_ptr (int *p) { int *q; q = p + 1; __builtin_prefetch (p++, 0, 0); return p == q; } int postinc_glob_ptr (void) { int *q; q = ptr + 1; __builtin_prefetch (ptr++, 0, 0); return ptr == q; } int predec_arg_ptr (int *p) { int *q; q = p - 1; __builtin_prefetch (--p, 0, 0); return p == q; } int predec_glob_ptr (void) { int *q; q = ptr - 1; __builtin_prefetch (--ptr, 0, 0); return ptr == q; } int postdec_arg_ptr (int *p) { int *q; q = p - 1; __builtin_prefetch (p--, 0, 0); return p == q; } int postdec_glob_ptr (void) { int *q; q = ptr - 1; __builtin_prefetch (ptr--, 0, 0); return ptr == q; } int preinc_arg_idx (int *p, int i) { int j = i + 1; __builtin_prefetch (&p[++i], 0, 0); return i == j; } int preinc_glob_idx (void) { int j = arrindex + 1; __builtin_prefetch (&ptr[++arrindex], 0, 0); return arrindex == j; } int postinc_arg_idx (int *p, int i) { int j = i + 1; __builtin_prefetch (&p[i++], 0, 0); return i == j; } int postinc_glob_idx (void) { int j = arrindex + 1; __builtin_prefetch (&ptr[arrindex++], 0, 0); return arrindex == j; } int predec_arg_idx (int *p, int i) { int j = i - 1; __builtin_prefetch (&p[--i], 0, 0); return i == j; } int predec_glob_idx (void) { int j = arrindex - 1; __builtin_prefetch (&ptr[--arrindex], 0, 0); return arrindex == j; } int postdec_arg_idx (int *p, int i) { int j = i - 1; __builtin_prefetch (&p[i--], 0, 0); return i == j; } int postdec_glob_idx (void) { int j = arrindex - 1; __builtin_prefetch (&ptr[arrindex--], 0, 0); return arrindex == j; } /* Check that function calls within the first prefetch argument are evaluated. */ int getptrcnt = 0; int * getptr (int *p) { getptrcnt++; return p + 1; } int funccall_arg_ptr (int *p) { __builtin_prefetch (getptr (p), 0, 0); return getptrcnt == 1; } int getintcnt = 0; int getint (int i) { getintcnt++; return i + 1; } int funccall_arg_idx (int *p, int i) { __builtin_prefetch (&p[getint (i)], 0, 0); return getintcnt == 1; } int main () { if (!assign_arg_ptr (ptr)) abort (); if (!assign_glob_ptr ()) abort (); if (!assign_arg_idx (ptr, 4)) abort (); if (!assign_glob_idx ()) abort (); if (!preinc_arg_ptr (ptr)) abort (); if (!preinc_glob_ptr ()) abort (); if (!postinc_arg_ptr (ptr)) abort (); if (!postinc_glob_ptr ()) abort (); if (!predec_arg_ptr (ptr)) abort (); if (!predec_glob_ptr ()) abort (); if (!postdec_arg_ptr (ptr)) abort (); if (!postdec_glob_ptr ()) abort (); if (!preinc_arg_idx (ptr, 3)) abort (); if (!preinc_glob_idx ()) abort (); if (!postinc_arg_idx (ptr, 3)) abort (); if (!postinc_glob_idx ()) abort (); if (!predec_arg_idx (ptr, 3)) abort (); if (!predec_glob_idx ()) abort (); if (!postdec_arg_idx (ptr, 3)) abort (); if (!postdec_glob_idx ()) abort (); if (!funccall_arg_ptr (ptr)) abort (); if (!funccall_arg_idx (ptr, 3)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtin-prefetch-5.c ================================================ /* Test that __builtin_prefetch does no harm. Use addresses that are unlikely to be word-aligned. Some targets have alignment requirements for prefetch addresses, so make sure the compiler takes care of that. This fails if it aborts, anything else is OK. */ struct S { short a; short b; char c[8]; } s; char arr[100]; char *ptr = arr; int idx = 3; void arg_ptr (char *p) { __builtin_prefetch (p, 0, 0); } void arg_idx (char *p, int i) { __builtin_prefetch (&p[i], 0, 0); } void glob_ptr (void) { __builtin_prefetch (ptr, 0, 0); } void glob_idx (void) { __builtin_prefetch (&ptr[idx], 0, 0); } int main () { __builtin_prefetch (&s.b, 0, 0); __builtin_prefetch (&s.c[1], 0, 0); arg_ptr (&s.c[1]); arg_ptr (ptr+3); arg_idx (ptr, 3); arg_idx (ptr+1, 2); idx = 3; glob_ptr (); glob_idx (); ptr++; idx = 2; glob_ptr (); glob_idx (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtin-prefetch-6.c ================================================ /* Test that __builtin_prefetch does no harm. Data prefetch should not fault if used with an invalid address. */ #include #define ARRSIZE 65 int *bad_addr[ARRSIZE]; int arr_used; /* Fill bad_addr with a range of values in the hopes that on any target some will be invalid addresses. */ void init_addrs (void) { int i; int bits_per_ptr = sizeof (void *) * 8; for (i = 0; i < bits_per_ptr; i++) bad_addr[i] = (void *)(1UL << i); arr_used = bits_per_ptr + 1; /* The last element used is zero. */ } void prefetch_for_read (void) { int i; for (i = 0; i < ARRSIZE; i++) __builtin_prefetch (bad_addr[i], 0, 0); } void prefetch_for_write (void) { int i; for (i = 0; i < ARRSIZE; i++) __builtin_prefetch (bad_addr[i], 1, 0); } int main () { init_addrs (); prefetch_for_read (); prefetch_for_write (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtin-types-compatible-p.c ================================================ int i; double d; /* Make sure we return a constant. */ float rootbeer[__builtin_types_compatible_p (int, typeof(i))]; typedef enum { hot, dog, poo, bear } dingos; typedef enum { janette, laura, amanda } cranberry; typedef float same1; typedef float same2; int main (void); int main (void) { /* Compatible types. */ if (!(__builtin_types_compatible_p (int, const int) && __builtin_types_compatible_p (typeof (hot), int) && __builtin_types_compatible_p (typeof (hot), typeof (laura)) && __builtin_types_compatible_p (int[5], int[]) && __builtin_types_compatible_p (same1, same2))) abort (); /* Incompatible types. */ if (__builtin_types_compatible_p (char *, int) || __builtin_types_compatible_p (char *, const char *) || __builtin_types_compatible_p (long double, double) || __builtin_types_compatible_p (typeof (i), typeof (d)) || __builtin_types_compatible_p (typeof (dingos), typeof (cranberry)) || __builtin_types_compatible_p (char, int) || __builtin_types_compatible_p (char *, char **)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/20010124-1-lib.c ================================================ /* Verify that structure return doesn't invoke memcpy on overlapping objects. */ extern void abort (void); extern int inside_main; typedef __SIZE_TYPE__ size_t; struct S { char stuff[1024]; }; union U { struct { int space; struct S s; } a; struct { struct S s; int space; } b; }; struct S f(struct S *p) { return *p; } void g(union U *p) { } void *memcpy(void *a, const void *b, size_t len) { if (inside_main) { if (a < b && a+len > b) abort (); if (b < a && b+len > a) abort (); return a; } else { char *dst = (char *) a; const char *src = (const char *) b; while (len--) *dst++ = *src++; return a; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/20010124-1.c ================================================ /* Verify that structure return doesn't invoke memcpy on overlapping objects. */ extern void abort (void); struct S { char stuff[1024]; }; union U { struct { int space; struct S s; } a; struct { struct S s; int space; } b; }; struct S f(struct S *); void g(union U *); void main_test(void) { union U u; u.b.s = f(&u.a.s); u.a.s = f(&u.b.s); g(&u); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/20010124-1.x ================================================ load_lib target-supports.exp if [istarget "nvptx-*-*"] { # This test uses memcpy for block move in the same file as it # defines it. The two decls are not the same, by design, and we # end up emitting a definition of memcpy, along with a .extern # declaration. This confuses the ptx assembler. return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1-lib.c ================================================ extern void abort (void); extern int abs_called; extern int inside_main; /* The labs call should have been optimized, but the abs call shouldn't have been. */ int abs (int x) { if (inside_main) abs_called = 1; return (x < 0 ? -x : x); } long labs (long x) { if (inside_main) abort (); return (x < 0 ? -x : x); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1.c ================================================ /* Test for -fno-builtin-FUNCTION. */ /* Origin: Joseph Myers . */ /* GCC normally handles abs and labs as built-in functions even without optimization. So test that with -fno-builtin-abs, labs is so handled but abs isn't. */ int abs_called = 0; extern int abs (int); extern long labs (long); extern void abort (void); void main_test (void) { if (labs (0) != 0) abort (); if (abs (0) != 0) abort (); if (!abs_called) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1.x ================================================ set additional_flags -fno-builtin-abs return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/abs-2-lib.c ================================================ #include "lib/abs.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/abs-2.c ================================================ /* Test for builtin abs, labs, llabs, imaxabs. */ /* Origin: Joseph Myers */ #include typedef __INTMAX_TYPE__ intmax_t; #define INTMAX_MAX __INTMAX_MAX__ extern int abs (int); extern long labs (long); extern long long llabs (long long); extern intmax_t imaxabs (intmax_t); extern void abort (void); extern void link_error (void); void main_test (void) { /* For each type, test both runtime and compile time (constant folding) optimization. */ volatile int i0 = 0, i1 = 1, im1 = -1, imin = -INT_MAX, imax = INT_MAX; volatile long l0 = 0L, l1 = 1L, lm1 = -1L, lmin = -LONG_MAX, lmax = LONG_MAX; volatile long long ll0 = 0LL, ll1 = 1LL, llm1 = -1LL; volatile long long llmin = -__LONG_LONG_MAX__, llmax = __LONG_LONG_MAX__; volatile intmax_t imax0 = 0, imax1 = 1, imaxm1 = -1; volatile intmax_t imaxmin = -INTMAX_MAX, imaxmax = INTMAX_MAX; if (abs (i0) != 0) abort (); if (abs (0) != 0) link_error (); if (abs (i1) != 1) abort (); if (abs (1) != 1) link_error (); if (abs (im1) != 1) abort (); if (abs (-1) != 1) link_error (); if (abs (imin) != INT_MAX) abort (); if (abs (-INT_MAX) != INT_MAX) link_error (); if (abs (imax) != INT_MAX) abort (); if (abs (INT_MAX) != INT_MAX) link_error (); if (labs (l0) != 0L) abort (); if (labs (0L) != 0L) link_error (); if (labs (l1) != 1L) abort (); if (labs (1L) != 1L) link_error (); if (labs (lm1) != 1L) abort (); if (labs (-1L) != 1L) link_error (); if (labs (lmin) != LONG_MAX) abort (); if (labs (-LONG_MAX) != LONG_MAX) link_error (); if (labs (lmax) != LONG_MAX) abort (); if (labs (LONG_MAX) != LONG_MAX) link_error (); if (llabs (ll0) != 0LL) abort (); if (llabs (0LL) != 0LL) link_error (); if (llabs (ll1) != 1LL) abort (); if (llabs (1LL) != 1LL) link_error (); if (llabs (llm1) != 1LL) abort (); if (llabs (-1LL) != 1LL) link_error (); if (llabs (llmin) != __LONG_LONG_MAX__) abort (); if (llabs (-__LONG_LONG_MAX__) != __LONG_LONG_MAX__) link_error (); if (llabs (llmax) != __LONG_LONG_MAX__) abort (); if (llabs (__LONG_LONG_MAX__) != __LONG_LONG_MAX__) link_error (); if (imaxabs (imax0) != 0) abort (); if (imaxabs (0) != 0) link_error (); if (imaxabs (imax1) != 1) abort (); if (imaxabs (1) != 1) link_error (); if (imaxabs (imaxm1) != 1) abort (); if (imaxabs (-1) != 1) link_error (); if (imaxabs (imaxmin) != INTMAX_MAX) abort (); if (imaxabs (-INTMAX_MAX) != INTMAX_MAX) link_error (); if (imaxabs (imaxmax) != INTMAX_MAX) abort (); if (imaxabs (INTMAX_MAX) != INTMAX_MAX) link_error (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/abs-3-lib.c ================================================ #include "lib/abs.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/abs-3.c ================================================ /* Test for builtin abs, labs, llabs, imaxabs. Test for __builtin versions. */ /* Origin: Joseph Myers */ #include typedef __INTMAX_TYPE__ intmax_t; #define INTMAX_MAX __INTMAX_MAX__ extern void abort (void); extern void link_error (void); void main_test (void) { /* For each type, test both runtime and compile time (constant folding) optimization. */ volatile int i0 = 0, i1 = 1, im1 = -1, imin = -INT_MAX, imax = INT_MAX; volatile long l0 = 0L, l1 = 1L, lm1 = -1L, lmin = -LONG_MAX, lmax = LONG_MAX; volatile long long ll0 = 0LL, ll1 = 1LL, llm1 = -1LL; volatile long long llmin = -__LONG_LONG_MAX__, llmax = __LONG_LONG_MAX__; volatile intmax_t imax0 = 0, imax1 = 1, imaxm1 = -1; volatile intmax_t imaxmin = -INTMAX_MAX, imaxmax = INTMAX_MAX; if (__builtin_abs (i0) != 0) abort (); if (__builtin_abs (0) != 0) link_error (); if (__builtin_abs (i1) != 1) abort (); if (__builtin_abs (1) != 1) link_error (); if (__builtin_abs (im1) != 1) abort (); if (__builtin_abs (-1) != 1) link_error (); if (__builtin_abs (imin) != INT_MAX) abort (); if (__builtin_abs (-INT_MAX) != INT_MAX) link_error (); if (__builtin_abs (imax) != INT_MAX) abort (); if (__builtin_abs (INT_MAX) != INT_MAX) link_error (); if (__builtin_labs (l0) != 0L) abort (); if (__builtin_labs (0L) != 0L) link_error (); if (__builtin_labs (l1) != 1L) abort (); if (__builtin_labs (1L) != 1L) link_error (); if (__builtin_labs (lm1) != 1L) abort (); if (__builtin_labs (-1L) != 1L) link_error (); if (__builtin_labs (lmin) != LONG_MAX) abort (); if (__builtin_labs (-LONG_MAX) != LONG_MAX) link_error (); if (__builtin_labs (lmax) != LONG_MAX) abort (); if (__builtin_labs (LONG_MAX) != LONG_MAX) link_error (); if (__builtin_llabs (ll0) != 0LL) abort (); if (__builtin_llabs (0LL) != 0LL) link_error (); if (__builtin_llabs (ll1) != 1LL) abort (); if (__builtin_llabs (1LL) != 1LL) link_error (); if (__builtin_llabs (llm1) != 1LL) abort (); if (__builtin_llabs (-1LL) != 1LL) link_error (); if (__builtin_llabs (llmin) != __LONG_LONG_MAX__) abort (); if (__builtin_llabs (-__LONG_LONG_MAX__) != __LONG_LONG_MAX__) link_error (); if (__builtin_llabs (llmax) != __LONG_LONG_MAX__) abort (); if (__builtin_llabs (__LONG_LONG_MAX__) != __LONG_LONG_MAX__) link_error (); if (__builtin_imaxabs (imax0) != 0) abort (); if (__builtin_imaxabs (0) != 0) link_error (); if (__builtin_imaxabs (imax1) != 1) abort (); if (__builtin_imaxabs (1) != 1) link_error (); if (__builtin_imaxabs (imaxm1) != 1) abort (); if (__builtin_imaxabs (-1) != 1) link_error (); if (__builtin_imaxabs (imaxmin) != INTMAX_MAX) abort (); if (__builtin_imaxabs (-INTMAX_MAX) != INTMAX_MAX) link_error (); if (__builtin_imaxabs (imaxmax) != INTMAX_MAX) abort (); if (__builtin_imaxabs (INTMAX_MAX) != INTMAX_MAX) link_error (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp ================================================ # Copyright (C) 2003-2016 Free Software Foundation, Inc. # # This file is part of GCC. # # GCC is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # GCC is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GCC; see the file COPYING3. If not see # . # This harness is for testing builtin support. Each test has two files: # # - foo.c defines the main testing function, main_test(). # - foo-lib.c implements the library functions that foo.c is testing. # # The functions in foo-lib.c will often want to abort on certain inputs. # They can use the global variable inside_main to see whether they are # being called from the test program or part of the common runtime. # # In many cases, the library functions will behave as normal at -O0 # and abort when optimisation is enabled. Such implementations should # go into the lib/ directory so that they can be included by any test # that needs them. They shouldn't call any external functions in case # those functions were overridden too. load_lib torture-options.exp load_lib c-torture.exp torture-init set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS set additional_flags "-fno-tree-loop-distribute-patterns -fno-tracer" if [istarget "powerpc-*-darwin*"] { lappend additional_flags "-Wl,-multiply_defined,suppress" } if { [istarget *-*-eabi*] || [istarget *-*-elf] || [istarget *-*-mingw*] || [istarget *-*-rtems*] } { lappend additional_flags "-Wl,--allow-multiple-definition" } foreach src [lsort [find $srcdir/$subdir *.c]] { if {![string match *-lib.c $src] && [runtest_file_p $runtests $src]} { c-torture-execute [list $src \ [file root $src]-lib.c \ $srcdir/$subdir/lib/main.c] \ $additional_flags } } torture-finish ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/chk.h ================================================ #ifndef os # define os(ptr) __builtin_object_size (ptr, 0) #endif /* This is one of the alternatives for object size checking. If dst has side-effects, size checking will never be done. */ #undef memcpy #define memcpy(dst, src, len) \ __builtin___memcpy_chk (dst, src, len, os (dst)) #undef mempcpy #define mempcpy(dst, src, len) \ __builtin___mempcpy_chk (dst, src, len, os (dst)) #undef memmove #define memmove(dst, src, len) \ __builtin___memmove_chk (dst, src, len, os (dst)) #undef memset #define memset(dst, val, len) \ __builtin___memset_chk (dst, val, len, os (dst)) #undef strcpy #define strcpy(dst, src) \ __builtin___strcpy_chk (dst, src, os (dst)) #undef stpcpy #define stpcpy(dst, src) \ __builtin___stpcpy_chk (dst, src, os (dst)) #undef strcat #define strcat(dst, src) \ __builtin___strcat_chk (dst, src, os (dst)) #undef strncpy #define strncpy(dst, src, len) \ __builtin___strncpy_chk (dst, src, len, os (dst)) #undef stpncpy #define stpncpy(dst, src, len) \ __builtin___stpncpy_chk (dst, src, len, os (dst)) #undef strncat #define strncat(dst, src, len) \ __builtin___strncat_chk (dst, src, len, os (dst)) #undef sprintf #define sprintf(dst, ...) \ __builtin___sprintf_chk (dst, 0, os (dst), __VA_ARGS__) #undef vsprintf #define vsprintf(dst, fmt, ap) \ __builtin___vsprintf_chk (dst, 0, os (dst), fmt, ap) #undef snprintf #define snprintf(dst, len, ...) \ __builtin___snprintf_chk (dst, len, 0, os (dst), __VA_ARGS__) #undef vsnprintf #define vsnprintf(dst, len, fmt, ap) \ __builtin___vsnprintf_chk (dst, len, 0, os (dst), fmt, ap) /* Now "redefine" even builtins for the purpose of testing. */ #undef __builtin_memcpy #define __builtin_memcpy(dst, src, len) memcpy (dst, src, len) #undef __builtin_mempcpy #define __builtin_mempcpy(dst, src, len) mempcpy (dst, src, len) #undef __builtin_memmove #define __builtin_memmove(dst, src, len) memmove (dst, src, len) #undef __builtin_memset #define __builtin_memset(dst, val, len) memset (dst, val, len) #undef __builtin_strcpy #define __builtin_strcpy(dst, src) strcpy (dst, src) #undef __builtin_stpcpy #define __builtin_stpcpy(dst, src) stpcpy (dst, src) #undef __builtin_strcat #define __builtin_strcat(dst, src) strcat (dst, src) #undef __builtin_strncpy #define __builtin_strncpy(dst, src, len) strncpy (dst, src, len) #undef __builtin_strncat #define __builtin_strncat(dst, src, len) strncat (dst, src, len) #undef __builtin_sprintf #define __builtin_sprintf(dst, ...) sprintf (dst, __VA_ARGS__) #undef __builtin_vsprintf #define __builtin_vsprintf(dst, fmt, ap) vsprintf (dst, fmt, ap) #undef __builtin_snprintf #define __builtin_snprintf(dst, len, ...) snprintf (dst, len, __VA_ARGS__) #undef __builtin_vsnprintf #define __builtin_vsnprintf(dst, len, fmt, ap) vsnprintf (dst, len, fmt, ap) extern void *chk_fail_buf[]; extern volatile int chk_fail_allowed, chk_calls; extern volatile int memcpy_disallowed, mempcpy_disallowed, memmove_disallowed; extern volatile int memset_disallowed, strcpy_disallowed, stpcpy_disallowed; extern volatile int strncpy_disallowed, stpncpy_disallowed, strcat_disallowed; extern volatile int strncat_disallowed, sprintf_disallowed, vsprintf_disallowed; extern volatile int snprintf_disallowed, vsnprintf_disallowed; /* A storage class that ensures that declarations bind locally. We want to test non-static declarations where we know it is safe to do so. */ #if __PIC__ && !__PIE__ #define LOCAL static #else #define LOCAL #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/complex-1-lib.c ================================================ extern int inside_main; extern void abort (void); #ifdef __OPTIMIZE__ #define ABORT_INSIDE_MAIN do { if (inside_main) abort (); } while (0) #else #define ABORT_INSIDE_MAIN do { } while (0) #endif static float _Complex conjf (float _Complex z) { ABORT_INSIDE_MAIN; return ~z; } static double _Complex conj (double _Complex z) { ABORT_INSIDE_MAIN; return ~z; } static long double _Complex conjl (long double _Complex z) { ABORT_INSIDE_MAIN; return ~z; } static float crealf (float _Complex z) { ABORT_INSIDE_MAIN; return __real__ z; } static double creal (double _Complex z) { ABORT_INSIDE_MAIN; return __real__ z; } static long double creall (long double _Complex z) { ABORT_INSIDE_MAIN; return __real__ z; } static float cimagf (float _Complex z) { ABORT_INSIDE_MAIN; return __imag__ z; } static double cimag (double _Complex z) { ABORT_INSIDE_MAIN; return __imag__ z; } static long double cimagl (long double _Complex z) { ABORT_INSIDE_MAIN; return __imag__ z; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/complex-1.c ================================================ /* Test for builtin conj, creal, cimag. */ /* Origin: Joseph Myers */ extern float _Complex conjf (float _Complex); extern double _Complex conj (double _Complex); extern long double _Complex conjl (long double _Complex); extern float crealf (float _Complex); extern double creal (double _Complex); extern long double creall (long double _Complex); extern float cimagf (float _Complex); extern double cimag (double _Complex); extern long double cimagl (long double _Complex); extern void abort (void); extern void link_error (void); void main_test (void) { /* For each type, test both runtime and compile time (constant folding) optimization. */ volatile float _Complex fc = 1.0F + 2.0iF; volatile double _Complex dc = 1.0 + 2.0i; volatile long double _Complex ldc = 1.0L + 2.0iL; /* Test floats. */ if (conjf (fc) != 1.0F - 2.0iF) abort (); if (__builtin_conjf (fc) != 1.0F - 2.0iF) abort (); if (conjf (1.0F + 2.0iF) != 1.0F - 2.0iF) link_error (); if (__builtin_conjf (1.0F + 2.0iF) != 1.0F - 2.0iF) link_error (); if (crealf (fc) != 1.0F) abort (); if (__builtin_crealf (fc) != 1.0F) abort (); if (crealf (1.0F + 2.0iF) != 1.0F) link_error (); if (__builtin_crealf (1.0F + 2.0iF) != 1.0F) link_error (); if (cimagf (fc) != 2.0F) abort (); if (__builtin_cimagf (fc) != 2.0F) abort (); if (cimagf (1.0F + 2.0iF) != 2.0F) link_error (); if (__builtin_cimagf (1.0F + 2.0iF) != 2.0F) link_error (); /* Test doubles. */ if (conj (dc) != 1.0 - 2.0i) abort (); if (__builtin_conj (dc) != 1.0 - 2.0i) abort (); if (conj (1.0 + 2.0i) != 1.0 - 2.0i) link_error (); if (__builtin_conj (1.0 + 2.0i) != 1.0 - 2.0i) link_error (); if (creal (dc) != 1.0) abort (); if (__builtin_creal (dc) != 1.0) abort (); if (creal (1.0 + 2.0i) != 1.0) link_error (); if (__builtin_creal (1.0 + 2.0i) != 1.0) link_error (); if (cimag (dc) != 2.0) abort (); if (__builtin_cimag (dc) != 2.0) abort (); if (cimag (1.0 + 2.0i) != 2.0) link_error (); if (__builtin_cimag (1.0 + 2.0i) != 2.0) link_error (); /* Test long doubles. */ if (conjl (ldc) != 1.0L - 2.0iL) abort (); if (__builtin_conjl (ldc) != 1.0L - 2.0iL) abort (); if (conjl (1.0L + 2.0iL) != 1.0L - 2.0iL) link_error (); if (__builtin_conjl (1.0L + 2.0iL) != 1.0L - 2.0iL) link_error (); if (creall (ldc) != 1.0L) abort (); if (__builtin_creall (ldc) != 1.0L) abort (); if (creall (1.0L + 2.0iL) != 1.0L) link_error (); if (__builtin_creall (1.0L + 2.0iL) != 1.0L) link_error (); if (cimagl (ldc) != 2.0L) abort (); if (__builtin_cimagl (ldc) != 2.0L) abort (); if (cimagl (1.0L + 2.0iL) != 2.0L) link_error (); if (__builtin_cimagl (1.0L + 2.0iL) != 2.0L) link_error (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/fprintf-lib.c ================================================ #include "lib/fprintf.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/fprintf.c ================================================ /* Copyright (C) 2001 Free Software Foundation. Ensure all expected transformations of builtin fprintf occur and that we honor side effects in the arguments. Written by Kaveh R. Ghazi, 1/7/2001. */ #include extern int fprintf_unlocked (FILE *, const char *, ...); extern void abort(void); void main_test (void) { FILE *s_array[] = {stdout, NULL}, **s_ptr = s_array; const char *const s1 = "hello world"; const char *const s2[] = { s1, 0 }, *const*s3; fprintf (*s_ptr, ""); fprintf (*s_ptr, "%s", ""); fprintf (*s_ptr, "%s", "hello"); fprintf (*s_ptr, "%s", "\n"); fprintf (*s_ptr, "%s", *s2); s3 = s2; fprintf (*s_ptr, "%s", *s3++); if (s3 != s2+1 || *s3 != 0) abort(); s3 = s2; fprintf (*s_ptr++, "%s", *s3++); if (s3 != s2+1 || *s3 != 0 || s_ptr != s_array+1 || *s_ptr != 0) abort(); s_ptr = s_array; fprintf (*s_ptr, "%c", '\n'); fprintf (*s_ptr, "%c", **s2); s3 = s2; fprintf (*s_ptr, "%c", **s3++); if (s3 != s2+1 || *s3 != 0) abort(); s3 = s2; fprintf (*s_ptr++, "%c", **s3++); if (s3 != s2+1 || *s3 != 0 || s_ptr != s_array+1 || *s_ptr != 0) abort(); s_ptr = s_array; fprintf (*s_ptr++, "hello world"); if (s_ptr != s_array+1 || *s_ptr != 0) abort(); s_ptr = s_array; fprintf (*s_ptr, "\n"); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ __builtin_fprintf (*s_ptr, "%s", "hello world\n"); /* Check the unlocked style, these evaluate to nothing to avoid problems on systems without the unlocked functions. */ fprintf_unlocked (*s_ptr, ""); __builtin_fprintf_unlocked (*s_ptr, ""); fprintf_unlocked (*s_ptr, "%s", ""); __builtin_fprintf_unlocked (*s_ptr, "%s", ""); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/fprintf.x ================================================ load_lib target-supports.exp if { [check_effective_target_freestanding] } { return 1; } return 0; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/fputs-lib.c ================================================ #include #include extern void abort (void); extern int inside_main; extern size_t strlen(const char *); int fputs(const char *string, FILE *stream) { size_t n = strlen(string); size_t r; #if defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ if (inside_main) abort(); #endif r = fwrite (string, 1, n, stream); return n > r ? EOF : 0; } /* Locking stdio doesn't matter for the purposes of this test. */ int fputs_unlocked(const char *string, FILE *stream) { return fputs (string, stream); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/fputs.c ================================================ /* Copyright (C) 2000, 2001 Free Software Foundation. Ensure all expected transformations of builtin fputs occur and that we honor side effects in the stream argument. Written by Kaveh R. Ghazi, 10/30/2000. */ #include extern void abort(void); int i; void main_test(void) { FILE *s_array[] = {stdout, NULL}, **s_ptr = s_array; const char *const s1 = "hello world"; fputs ("", *s_ptr); fputs ("\n", *s_ptr); fputs ("bye", *s_ptr); fputs (s1, *s_ptr); fputs (s1+5, *s_ptr); fputs (s1+10, *s_ptr); fputs (s1+11, *s_ptr); /* Check side-effects when transforming fputs -> NOP. */ fputs ("", *s_ptr++); if (s_ptr != s_array+1 || *s_ptr != 0) abort(); /* Check side-effects when transforming fputs -> fputc. */ s_ptr = s_array; fputs ("\n", *s_ptr++); if (s_ptr != s_array+1 || *s_ptr != 0) abort(); /* Check side-effects when transforming fputs -> fwrite. */ s_ptr = s_array; fputs ("hello\n", *s_ptr++); if (s_ptr != s_array+1 || *s_ptr != 0) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ s_ptr = s_array; __builtin_fputs ("", *s_ptr); /* These builtin stubs are called by __builtin_fputs, ensure their prototypes are set correctly too. */ __builtin_fputc ('\n', *s_ptr); __builtin_fwrite ("hello\n", 1, 6, *s_ptr); /* Check the unlocked style, these evaluate to nothing to avoid problems on systems without the unlocked functions. */ fputs_unlocked ("", *s_ptr); __builtin_fputs_unlocked ("", *s_ptr); /* Check side-effects in conditional expression. */ s_ptr = s_array; fputs (i++ ? "f" : "x", *s_ptr++); if (s_ptr != s_array+1 || *s_ptr != 0 || i != 1) abort(); fputs (--i ? "\n" : "\n", *--s_ptr); if (s_ptr != s_array || i != 0) abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/fputs.x ================================================ load_lib target-supports.exp if { [check_effective_target_freestanding] } { return 1; } return 0; ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/abs.c ================================================ extern int inside_main; extern void abort (void); #ifdef __OPTIMIZE__ #define ABORT_INSIDE_MAIN do { if (inside_main) abort (); } while (0) #else #define ABORT_INSIDE_MAIN do { } while (0) #endif typedef __INTMAX_TYPE__ intmax_t; __attribute__ ((__noinline__)) int abs (int x) { ABORT_INSIDE_MAIN; return x < 0 ? -x : x; } __attribute__ ((__noinline__)) long labs (long x) { ABORT_INSIDE_MAIN; return x < 0 ? -x : x; } __attribute__ ((__noinline__)) long long llabs (long long x) { ABORT_INSIDE_MAIN; return x < 0 ? -x : x; } __attribute__ ((__noinline__)) intmax_t imaxabs (intmax_t x) { ABORT_INSIDE_MAIN; return x < 0 ? -x : x; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/bfill.c ================================================ extern int inside_main; __attribute__ ((__noinline__)) void bfill (void *s, __SIZE_TYPE__ n, int ch) { char *p; for (p = s; n-- > 0; p++) *p = ch; #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/bzero.c ================================================ extern int inside_main; __attribute__ ((__noinline__)) void bzero (void *s, __SIZE_TYPE__ n) { char *p; for (p = s; n-- > 0; p++) *p = 0; #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/chk.c ================================================ #include #ifdef __unix__ #include #endif extern void abort (void); extern int inside_main; void *chk_fail_buf[256] __attribute__((aligned (16))); volatile int chk_fail_allowed, chk_calls; volatile int memcpy_disallowed, mempcpy_disallowed, memmove_disallowed; volatile int memset_disallowed, strcpy_disallowed, stpcpy_disallowed; volatile int strncpy_disallowed, stpncpy_disallowed, strcat_disallowed; volatile int strncat_disallowed, sprintf_disallowed, vsprintf_disallowed; volatile int snprintf_disallowed, vsnprintf_disallowed; extern __SIZE_TYPE__ strlen (const char *); extern int vsprintf (char *, const char *, va_list); void __attribute__((noreturn)) __chk_fail (void) { if (chk_fail_allowed) __builtin_longjmp (chk_fail_buf, 1); abort (); } void * memcpy (void *dst, const void *src, __SIZE_TYPE__ n) { const char *srcp; char *dstp; #ifdef __OPTIMIZE__ if (memcpy_disallowed && inside_main) abort (); #endif srcp = src; dstp = dst; while (n-- != 0) *dstp++ = *srcp++; return dst; } void * __memcpy_chk (void *dst, const void *src, __SIZE_TYPE__ n, __SIZE_TYPE__ size) { /* If size is -1, GCC should always optimize the call into memcpy. */ if (size == (__SIZE_TYPE__) -1) abort (); ++chk_calls; if (n > size) __chk_fail (); return memcpy (dst, src, n); } void * mempcpy (void *dst, const void *src, __SIZE_TYPE__ n) { const char *srcp; char *dstp; #ifdef __OPTIMIZE__ if (mempcpy_disallowed && inside_main) abort (); #endif srcp = src; dstp = dst; while (n-- != 0) *dstp++ = *srcp++; return dstp; } void * __mempcpy_chk (void *dst, const void *src, __SIZE_TYPE__ n, __SIZE_TYPE__ size) { /* If size is -1, GCC should always optimize the call into mempcpy. */ if (size == (__SIZE_TYPE__) -1) abort (); ++chk_calls; if (n > size) __chk_fail (); return mempcpy (dst, src, n); } void * memmove (void *dst, const void *src, __SIZE_TYPE__ n) { const char *srcp; char *dstp; #ifdef __OPTIMIZE__ if (memmove_disallowed && inside_main) abort (); #endif srcp = src; dstp = dst; if (srcp < dstp) while (n-- != 0) dstp[n] = srcp[n]; else while (n-- != 0) *dstp++ = *srcp++; return dst; } void * __memmove_chk (void *dst, const void *src, __SIZE_TYPE__ n, __SIZE_TYPE__ size) { /* If size is -1, GCC should always optimize the call into memmove. */ if (size == (__SIZE_TYPE__) -1) abort (); ++chk_calls; if (n > size) __chk_fail (); return memmove (dst, src, n); } void * memset (void *dst, int c, __SIZE_TYPE__ n) { while (n-- != 0) n[(char *) dst] = c; /* Single-byte memsets should be done inline when optimisation is enabled. Do this after the copy in case we're being called to initialize bss. */ #ifdef __OPTIMIZE__ if (memset_disallowed && inside_main && n < 2) abort (); #endif return dst; } void * __memset_chk (void *dst, int c, __SIZE_TYPE__ n, __SIZE_TYPE__ size) { /* If size is -1, GCC should always optimize the call into memset. */ if (size == (__SIZE_TYPE__) -1) abort (); ++chk_calls; if (n > size) __chk_fail (); return memset (dst, c, n); } char * strcpy (char *d, const char *s) { char *r = d; #ifdef __OPTIMIZE__ if (strcpy_disallowed && inside_main) abort (); #endif while ((*d++ = *s++)); return r; } char * __strcpy_chk (char *d, const char *s, __SIZE_TYPE__ size) { /* If size is -1, GCC should always optimize the call into strcpy. */ if (size == (__SIZE_TYPE__) -1) abort (); ++chk_calls; if (strlen (s) >= size) __chk_fail (); return strcpy (d, s); } char * stpcpy (char *dst, const char *src) { #ifdef __OPTIMIZE__ if (stpcpy_disallowed && inside_main) abort (); #endif while (*src != 0) *dst++ = *src++; *dst = 0; return dst; } char * __stpcpy_chk (char *d, const char *s, __SIZE_TYPE__ size) { /* If size is -1, GCC should always optimize the call into stpcpy. */ if (size == (__SIZE_TYPE__) -1) abort (); ++chk_calls; if (strlen (s) >= size) __chk_fail (); return stpcpy (d, s); } char * stpncpy (char *dst, const char *src, __SIZE_TYPE__ n) { #ifdef __OPTIMIZE__ if (stpncpy_disallowed && inside_main) abort (); #endif for (; *src && n; n--) *dst++ = *src++; char *ret = dst; while (n--) *dst++ = 0; return ret; } char * __stpncpy_chk (char *s1, const char *s2, __SIZE_TYPE__ n, __SIZE_TYPE__ size) { /* If size is -1, GCC should always optimize the call into stpncpy. */ if (size == (__SIZE_TYPE__) -1) abort (); ++chk_calls; if (n > size) __chk_fail (); return stpncpy (s1, s2, n); } char * strncpy (char *s1, const char *s2, __SIZE_TYPE__ n) { char *dest = s1; #ifdef __OPTIMIZE__ if (strncpy_disallowed && inside_main) abort(); #endif for (; *s2 && n; n--) *s1++ = *s2++; while (n--) *s1++ = 0; return dest; } char * __strncpy_chk (char *s1, const char *s2, __SIZE_TYPE__ n, __SIZE_TYPE__ size) { /* If size is -1, GCC should always optimize the call into strncpy. */ if (size == (__SIZE_TYPE__) -1) abort (); ++chk_calls; if (n > size) __chk_fail (); return strncpy (s1, s2, n); } char * strcat (char *dst, const char *src) { char *p = dst; #ifdef __OPTIMIZE__ if (strcat_disallowed && inside_main) abort (); #endif while (*p) p++; while ((*p++ = *src++)) ; return dst; } char * __strcat_chk (char *d, const char *s, __SIZE_TYPE__ size) { /* If size is -1, GCC should always optimize the call into strcat. */ if (size == (__SIZE_TYPE__) -1) abort (); ++chk_calls; if (strlen (d) + strlen (s) >= size) __chk_fail (); return strcat (d, s); } char * strncat (char *s1, const char *s2, __SIZE_TYPE__ n) { char *dest = s1; char c; #ifdef __OPTIMIZE__ if (strncat_disallowed && inside_main) abort(); #endif while (*s1) s1++; c = '\0'; while (n > 0) { c = *s2++; *s1++ = c; if (c == '\0') return dest; n--; } if (c != '\0') *s1 = '\0'; return dest; } char * __strncat_chk (char *d, const char *s, __SIZE_TYPE__ n, __SIZE_TYPE__ size) { __SIZE_TYPE__ len = strlen (d), n1 = n; const char *s1 = s; /* If size is -1, GCC should always optimize the call into strncat. */ if (size == (__SIZE_TYPE__) -1) abort (); ++chk_calls; while (len < size && n1 > 0) { if (*s1++ == '\0') break; ++len; --n1; } if (len >= size) __chk_fail (); return strncat (d, s, n); } /* No chk test in GCC testsuite needs more bytes than this. As we can't expect vsnprintf to be available on the target, assume 4096 bytes is enough. */ static char chk_sprintf_buf[4096]; int __sprintf_chk (char *str, int flag, __SIZE_TYPE__ size, const char *fmt, ...) { int ret; va_list ap; /* If size is -1 and flag 0, GCC should always optimize the call into sprintf. */ if (size == (__SIZE_TYPE__) -1 && flag == 0) abort (); ++chk_calls; #ifdef __OPTIMIZE__ if (sprintf_disallowed && inside_main) abort(); #endif va_start (ap, fmt); ret = vsprintf (chk_sprintf_buf, fmt, ap); va_end (ap); if (ret >= 0) { if (ret >= size) __chk_fail (); memcpy (str, chk_sprintf_buf, ret + 1); } return ret; } int __vsprintf_chk (char *str, int flag, __SIZE_TYPE__ size, const char *fmt, va_list ap) { int ret; /* If size is -1 and flag 0, GCC should always optimize the call into vsprintf. */ if (size == (__SIZE_TYPE__) -1 && flag == 0) abort (); ++chk_calls; #ifdef __OPTIMIZE__ if (vsprintf_disallowed && inside_main) abort(); #endif ret = vsprintf (chk_sprintf_buf, fmt, ap); if (ret >= 0) { if (ret >= size) __chk_fail (); memcpy (str, chk_sprintf_buf, ret + 1); } return ret; } int __snprintf_chk (char *str, __SIZE_TYPE__ len, int flag, __SIZE_TYPE__ size, const char *fmt, ...) { int ret; va_list ap; /* If size is -1 and flag 0, GCC should always optimize the call into snprintf. */ if (size == (__SIZE_TYPE__) -1 && flag == 0) abort (); ++chk_calls; if (size < len) __chk_fail (); #ifdef __OPTIMIZE__ if (snprintf_disallowed && inside_main) abort(); #endif va_start (ap, fmt); ret = vsprintf (chk_sprintf_buf, fmt, ap); va_end (ap); if (ret >= 0) { if (ret < len) memcpy (str, chk_sprintf_buf, ret + 1); else { memcpy (str, chk_sprintf_buf, len - 1); str[len - 1] = '\0'; } } return ret; } int __vsnprintf_chk (char *str, __SIZE_TYPE__ len, int flag, __SIZE_TYPE__ size, const char *fmt, va_list ap) { int ret; /* If size is -1 and flag 0, GCC should always optimize the call into vsnprintf. */ if (size == (__SIZE_TYPE__) -1 && flag == 0) abort (); ++chk_calls; if (size < len) __chk_fail (); #ifdef __OPTIMIZE__ if (vsnprintf_disallowed && inside_main) abort(); #endif ret = vsprintf (chk_sprintf_buf, fmt, ap); if (ret >= 0) { if (ret < len) memcpy (str, chk_sprintf_buf, ret + 1); else { memcpy (str, chk_sprintf_buf, len - 1); str[len - 1] = '\0'; } } return ret; } int snprintf (char *str, __SIZE_TYPE__ len, const char *fmt, ...) { int ret; va_list ap; #ifdef __OPTIMIZE__ if (snprintf_disallowed && inside_main) abort(); #endif va_start (ap, fmt); ret = vsprintf (chk_sprintf_buf, fmt, ap); va_end (ap); if (ret >= 0) { if (ret < len) memcpy (str, chk_sprintf_buf, ret + 1); else if (len) { memcpy (str, chk_sprintf_buf, len - 1); str[len - 1] = '\0'; } } return ret; } /* uClibc's vsprintf calls vsnprintf. */ #ifndef __UCLIBC__ int vsnprintf (char *str, __SIZE_TYPE__ len, const char *fmt, va_list ap) { int ret; #ifdef __OPTIMIZE__ if (vsnprintf_disallowed && inside_main) abort(); #endif ret = vsprintf (chk_sprintf_buf, fmt, ap); if (ret >= 0) { if (ret < len) memcpy (str, chk_sprintf_buf, ret + 1); else if (len) { memcpy (str, chk_sprintf_buf, len - 1); str[len - 1] = '\0'; } } return ret; } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/fprintf.c ================================================ #include #include extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) int fprintf (FILE *fp, const char *string, ...) { va_list ap; int r; #ifdef __OPTIMIZE__ if (inside_main) abort(); #endif va_start (ap, string); r = vfprintf (fp, string, ap); va_end (ap); return r; } /* Locking stdio doesn't matter for the purposes of this test. */ __attribute__ ((__noinline__)) int fprintf_unlocked (FILE *fp, const char *string, ...) { va_list ap; int r; #ifdef __OPTIMIZE__ if (inside_main) abort(); #endif va_start (ap, string); r = vfprintf (fp, string, ap); va_end (ap); return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c ================================================ extern void abort(void); extern void main_test (void); extern void abort (void); int inside_main; int main () { inside_main = 1; main_test (); inside_main = 0; return 0; } /* When optimizing, all the constant cases should have been constant folded, so no calls to link_error should remain. In any case, link_error should not be called. */ #ifndef __OPTIMIZE__ void link_error (void) { abort (); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memchr.c ================================================ extern void abort(void); extern int inside_main; __attribute__ ((__noinline__)) void * memchr (const void *s, int c, __SIZE_TYPE__ n) { const unsigned char uc = c; const unsigned char *sp; #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif sp = s; for (; n != 0; ++sp, --n) if (*sp == uc) return (void *) sp; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memcmp.c ================================================ extern void abort(void); extern int inside_main; __attribute__ ((__noinline__)) int memcmp (const void *s1, const void *s2, __SIZE_TYPE__ len) { const unsigned char *sp1, *sp2; #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif sp1 = s1; sp2 = s2; while (len != 0 && *sp1 == *sp2) sp1++, sp2++, len--; if (len == 0) return 0; return *sp1 - *sp2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memmove.c ================================================ extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) void * memmove (void *dst, const void *src, __SIZE_TYPE__ n) { char *dstp; const char *srcp; #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif srcp = src; dstp = dst; if (srcp < dstp) while (n-- != 0) dstp[n] = srcp[n]; else while (n-- != 0) *dstp++ = *srcp++; return dst; } void bcopy (const void *src, void *dst, __SIZE_TYPE__ n) { memmove (dst, src, n); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/mempcpy.c ================================================ extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) void * mempcpy (void *dst, const void *src, __SIZE_TYPE__ n) { const char *srcp; char *dstp; #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif srcp = src; dstp = dst; while (n-- != 0) *dstp++ = *srcp++; return dstp; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memset.c ================================================ extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) void * memset (void *dst, int c, __SIZE_TYPE__ n) { while (n-- != 0) n[(char *) dst] = c; /* Single-byte memsets should be done inline when optimisation is enabled. Do this after the copy in case we're being called to initialize bss. */ #ifdef __OPTIMIZE__ if (inside_main && n < 2) abort (); #endif return dst; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/printf.c ================================================ #include #include extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) int printf (const char *string, ...) { va_list ap; int r; #ifdef __OPTIMIZE__ if (inside_main) abort(); #endif va_start (ap, string); r = vprintf (string, ap); va_end (ap); return r; } /* Locking stdio doesn't matter for the purposes of this test. */ __attribute__ ((__noinline__)) int printf_unlocked (const char *string, ...) { va_list ap; int r; #ifdef __OPTIMIZE__ if (inside_main) abort(); #endif va_start (ap, string); r = vprintf (string, ap); va_end (ap); return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c ================================================ #include #include extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) int (sprintf) (char *buf, const char *fmt, ...) { va_list ap; int r; #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif va_start (ap, fmt); r = vsprintf (buf, fmt, ap); va_end (ap); return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/stpcpy.c ================================================ extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) char * stpcpy (char *dst, const char *src) { #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif while (*src != 0) *dst++ = *src++; *dst = 0; return dst; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcat.c ================================================ extern int inside_main; extern void abort(void); __attribute__ ((__noinline__)) char * strcat (char *dst, const char *src) { char *p = dst; #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif while (*p) p++; while ((*p++ = *src++)) ; return dst; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strchr.c ================================================ extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) char * strchr (const char *s, int c) { #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif for (;;) { if (*s == c) return (char *) s; if (*s == 0) return 0; s++; } } __attribute__ ((__noinline__)) char * index (const char *s, int c) { return strchr (s, c); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcmp.c ================================================ extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) int strcmp (const char *s1, const char *s2) { #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif while (*s1 != 0 && *s1 == *s2) s1++, s2++; if (*s1 == 0 || *s2 == 0) return (unsigned char) *s1 - (unsigned char) *s2; return *s1 - *s2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcpy.c ================================================ extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) char * strcpy (char *d, const char *s) { char *r = d; #if defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ if (inside_main) abort (); #endif while ((*d++ = *s++)); return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcspn.c ================================================ extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) __SIZE_TYPE__ strcspn (const char *s1, const char *s2) { const char *p, *q; #ifdef __OPTIMIZE__ if (inside_main) abort(); #endif for (p = s1; *p; p++) for (q = s2; *q; q++) if (*p == *q) goto found; found: return p - s1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strlen.c ================================================ extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) __SIZE_TYPE__ strlen (const char *s) { __SIZE_TYPE__ i; #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif i = 0; while (s[i] != 0) i++; return i; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncat.c ================================================ extern void abort(void); extern int inside_main; typedef __SIZE_TYPE__ size_t; __attribute__ ((__noinline__)) char * strncat (char *s1, const char *s2, size_t n) { char *dest = s1; char c = '\0'; #ifdef __OPTIMIZE__ if (inside_main) abort(); #endif while (*s1) s1++; c = '\0'; while (n > 0) { c = *s2++; *s1++ = c; if (c == '\0') return dest; n--; } if (c != '\0') *s1 = '\0'; return dest; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncmp.c ================================================ extern void abort (void); extern int inside_main; typedef __SIZE_TYPE__ size_t; __attribute__ ((__noinline__)) int strncmp(const char *s1, const char *s2, size_t n) { const unsigned char *u1 = (const unsigned char *)s1; const unsigned char *u2 = (const unsigned char *)s2; unsigned char c1, c2; #ifdef __OPTIMIZE__ if (inside_main) abort(); #endif while (n > 0) { c1 = *u1++, c2 = *u2++; if (c1 == '\0' || c1 != c2) return c1 - c2; n--; } return c1 - c2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncpy.c ================================================ extern void abort(void); extern int inside_main; typedef __SIZE_TYPE__ size_t; __attribute__ ((__noinline__)) char * strncpy(char *s1, const char *s2, size_t n) { char *dest = s1; #ifdef __OPTIMIZE__ if (inside_main) abort(); #endif for (; *s2 && n; n--) *s1++ = *s2++; while (n--) *s1++ = 0; return dest; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strpbrk.c ================================================ extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) char * strpbrk(const char *s1, const char *s2) { const char *p; #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif while (*s1) { for (p = s2; *p; p++) if (*s1 == *p) return (char *)s1; s1++; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strrchr.c ================================================ extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) char * strrchr (const char *s, int c) { __SIZE_TYPE__ i; #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif i = 0; while (s[i] != 0) i++; do if (s[i] == c) return (char *) s + i; while (i-- != 0); return 0; } __attribute__ ((__noinline__)) char * rindex (const char *s, int c) { return strrchr (s, c); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strspn.c ================================================ extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) __SIZE_TYPE__ strcspn (const char *s1, const char *s2) { const char *p, *q; #ifdef __OPTIMIZE__ if (inside_main) abort(); #endif for (p = s1; *p; p++) { for (q = s2; *q; q++) if (*p == *q) goto proceed; break; proceed:; } return p - s1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strstr.c ================================================ extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) char * strstr(const char *s1, const char *s2) { const char *p, *q; #ifdef __OPTIMIZE__ if (inside_main) abort (); #endif /* deliberately dumb algorithm */ for (; *s1; s1++) { p = s1, q = s2; while (*q && *p) { if (*q != *p) break; p++, q++; } if (*q == 0) return (char *)s1; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memchr-lib.c ================================================ #include "lib/memchr.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memchr.c ================================================ /* Copyright (C) 2007 Free Software Foundation. Ensure all expected transformations of builtin memchr occur and perform correctly. Written by Paolo Carlini, 10/5/2007. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern void *memchr (const void *, int, size_t); void main_test (void) { const char* const foo1 = "hello world"; if (memchr (foo1, 'x', 11)) abort (); if (memchr (foo1, 'o', 11) != foo1 + 4) abort (); if (memchr (foo1, 'w', 2)) abort (); if (memchr (foo1 + 5, 'o', 6) != foo1 + 7) abort (); if (memchr (foo1, 'd', 11) != foo1 + 10) abort (); if (memchr (foo1, 'd', 10)) abort (); if (memchr (foo1, '\0', 11)) abort (); if (memchr (foo1, '\0', 12) != foo1 + 11) abort (); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_memchr (foo1, 'r', 11) != foo1 + 8) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memcmp-lib.c ================================================ #include "lib/memcmp.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memcmp.c ================================================ /* Copyright (C) 2001 Free Software Foundation. Ensure that short builtin memcmp are optimized and perform correctly. On architectures with a cmpstrsi instruction, this test doesn't determine which optimization is being performed, but it does check for correctness. Written by Roger Sayle, 12/02/2001. Additional tests by Roger Sayle after PR 3508, 12/26/2001. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern int memcmp (const void *, const void *, size_t); extern char *strcpy (char *, const char *); extern void link_error (void); void main_test (void) { char str[8]; strcpy (str, "3141"); if ( memcmp (str, str+2, 0) != 0 ) abort (); if ( memcmp (str+1, str+3, 0) != 0 ) abort (); if ( memcmp (str+1, str+3, 1) != 0 ) abort (); if ( memcmp (str, str+2, 1) >= 0 ) abort (); if ( memcmp (str+2, str, 1) <= 0 ) abort (); if (memcmp ("abcd", "efgh", 4) >= 0) link_error (); if (memcmp ("abcd", "abcd", 4) != 0) link_error (); if (memcmp ("efgh", "abcd", 4) <= 0) link_error (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memcpy-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memcpy-chk.c ================================================ /* Copyright (C) 2004, 2005 Free Software Foundation. Ensure builtin __memcpy_chk performs correctly. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern int memcmp (const void *, const void *, size_t); #include "chk.h" const char s1[] = "123"; char p[32] = ""; volatile char *s2 = "defg"; /* prevent constant propagation to happen when whole program assumptions are made. */ volatile char *s3 = "FGH"; /* prevent constant propagation to happen when whole program assumptions are made. */ volatile size_t l1 = 1; /* prevent constant propagation to happen when whole program assumptions are made. */ void __attribute__((noinline)) test1 (void) { int i; #if defined __i386__ || defined __x86_64__ /* The functions below might not be optimized into direct stores on all arches. It depends on how many instructions would be generated and what limits the architecture chooses in STORE_BY_PIECES_P. */ memcpy_disallowed = 1; #endif /* All the memcpy calls in this routine except last have fixed length, so object size checking should be done at compile time if optimizing. */ chk_calls = 0; if (memcpy (p, "ABCDE", 6) != p || memcmp (p, "ABCDE", 6)) abort (); if (memcpy (p + 16, "VWX" + 1, 2) != p + 16 || memcmp (p + 16, "WX\0\0", 5)) abort (); if (memcpy (p + 1, "", 1) != p + 1 || memcmp (p, "A\0CDE", 6)) abort (); if (memcpy (p + 3, "FGHI", 4) != p + 3 || memcmp (p, "A\0CFGHI", 8)) abort (); i = 8; memcpy (p + 20, "qrstu", 6); memcpy (p + 25, "QRSTU", 6); if (memcpy (p + 25 + 1, s1, 3) != p + 25 + 1 || memcmp (p + 25, "Q123U", 6)) abort (); if (memcpy (memcpy (p, "abcdEFG", 4) + 4, "efg", 4) != p + 4 || memcmp (p, "abcdefg", 8)) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_memcpy (p, "ABCDE", 6) != p || memcmp (p, "ABCDE", 6)) abort (); memcpy (p + 5, s3, 1); if (memcmp (p, "ABCDEFg", 8)) abort (); memcpy_disallowed = 0; if (chk_calls) abort (); chk_calls = 0; memcpy (p + 6, s1 + 1, l1); if (memcmp (p, "ABCDEF2", 8)) abort (); /* The above memcpy copies into an object with known size, but unknown length, so it should be a __memcpy_chk call. */ if (chk_calls != 1) abort (); } long buf1[64]; char *buf2 = (char *) (buf1 + 32); long buf5[20]; char buf7[20]; void __attribute__((noinline)) test2_sub (long *buf3, char *buf4, char *buf6, int n) { int i = 0; /* All the memcpy/__builtin_memcpy/__builtin___memcpy_chk calls in this routine are either fixed length, or have side-effects in __builtin_object_size arguments, or dst doesn't point into a known object. */ chk_calls = 0; /* These should probably be handled by store_by_pieces on most arches. */ if (memcpy (buf1, "ABCDEFGHI", 9) != (char *) buf1 || memcmp (buf1, "ABCDEFGHI\0", 11)) abort (); if (memcpy (buf1, "abcdefghijklmnopq", 17) != (char *) buf1 || memcmp (buf1, "abcdefghijklmnopq\0", 19)) abort (); if (__builtin_memcpy (buf3, "ABCDEF", 6) != (char *) buf1 || memcmp (buf1, "ABCDEFghijklmnopq\0", 19)) abort (); if (__builtin_memcpy (buf3, "a", 1) != (char *) buf1 || memcmp (buf1, "aBCDEFghijklmnopq\0", 19)) abort (); if (memcpy ((char *) buf3 + 2, "bcd" + ++i, 2) != (char *) buf1 + 2 || memcmp (buf1, "aBcdEFghijklmnopq\0", 19) || i != 1) abort (); /* These should probably be handled by move_by_pieces on most arches. */ if (memcpy ((char *) buf3 + 4, buf5, 6) != (char *) buf1 + 4 || memcmp (buf1, "aBcdRSTUVWklmnopq\0", 19)) abort (); if (__builtin_memcpy ((char *) buf1 + ++i + 8, (char *) buf5 + 1, 1) != (char *) buf1 + 10 || memcmp (buf1, "aBcdRSTUVWSlmnopq\0", 19) || i != 2) abort (); if (memcpy ((char *) buf3 + 14, buf6, 2) != (char *) buf1 + 14 || memcmp (buf1, "aBcdRSTUVWSlmnrsq\0", 19)) abort (); if (memcpy (buf3, buf5, 8) != (char *) buf1 || memcmp (buf1, "RSTUVWXYVWSlmnrsq\0", 19)) abort (); if (memcpy (buf3, buf5, 17) != (char *) buf1 || memcmp (buf1, "RSTUVWXYZ01234567\0", 19)) abort (); __builtin_memcpy (buf3, "aBcdEFghijklmnopq\0", 19); /* These should be handled either by movmemendM or memcpy call. */ /* buf3 points to an unknown object, so __memcpy_chk should not be done. */ if (memcpy ((char *) buf3 + 4, buf5, n + 6) != (char *) buf1 + 4 || memcmp (buf1, "aBcdRSTUVWklmnopq\0", 19)) abort (); /* This call has side-effects in dst, therefore no checking. */ if (__builtin___memcpy_chk ((char *) buf1 + ++i + 8, (char *) buf5 + 1, n + 1, os ((char *) buf1 + ++i + 8)) != (char *) buf1 + 11 || memcmp (buf1, "aBcdRSTUVWkSmnopq\0", 19) || i != 3) abort (); if (memcpy ((char *) buf3 + 14, buf6, n + 2) != (char *) buf1 + 14 || memcmp (buf1, "aBcdRSTUVWkSmnrsq\0", 19)) abort (); i = 1; /* These might be handled by store_by_pieces. */ if (memcpy (buf2, "ABCDEFGHI", 9) != buf2 || memcmp (buf2, "ABCDEFGHI\0", 11)) abort (); if (memcpy (buf2, "abcdefghijklmnopq", 17) != buf2 || memcmp (buf2, "abcdefghijklmnopq\0", 19)) abort (); if (__builtin_memcpy (buf4, "ABCDEF", 6) != buf2 || memcmp (buf2, "ABCDEFghijklmnopq\0", 19)) abort (); if (__builtin_memcpy (buf4, "a", 1) != buf2 || memcmp (buf2, "aBCDEFghijklmnopq\0", 19)) abort (); if (memcpy (buf4 + 2, "bcd" + i++, 2) != buf2 + 2 || memcmp (buf2, "aBcdEFghijklmnopq\0", 19) || i != 2) abort (); /* These might be handled by move_by_pieces. */ if (memcpy (buf4 + 4, buf7, 6) != buf2 + 4 || memcmp (buf2, "aBcdRSTUVWklmnopq\0", 19)) abort (); /* Side effect. */ if (__builtin___memcpy_chk (buf2 + i++ + 8, buf7 + 1, 1, os (buf2 + i++ + 8)) != buf2 + 10 || memcmp (buf2, "aBcdRSTUVWSlmnopq\0", 19) || i != 3) abort (); if (memcpy (buf4 + 14, buf6, 2) != buf2 + 14 || memcmp (buf2, "aBcdRSTUVWSlmnrsq\0", 19)) abort (); __builtin_memcpy (buf4, "aBcdEFghijklmnopq\0", 19); /* These should be handled either by movmemendM or memcpy call. */ if (memcpy (buf4 + 4, buf7, n + 6) != buf2 + 4 || memcmp (buf2, "aBcdRSTUVWklmnopq\0", 19)) abort (); /* Side effect. */ if (__builtin___memcpy_chk (buf2 + i++ + 8, buf7 + 1, n + 1, os (buf2 + i++ + 8)) != buf2 + 11 || memcmp (buf2, "aBcdRSTUVWkSmnopq\0", 19) || i != 4) abort (); if (memcpy (buf4 + 14, buf6, n + 2) != buf2 + 14 || memcmp (buf2, "aBcdRSTUVWkSmnrsq\0", 19)) abort (); if (chk_calls) abort (); } void __attribute__((noinline)) test2 (void) { long *x; char *y; int z; __builtin_memcpy (buf5, "RSTUVWXYZ0123456789", 20); __builtin_memcpy (buf7, "RSTUVWXYZ0123456789", 20); __asm ("" : "=r" (x) : "0" (buf1)); __asm ("" : "=r" (y) : "0" (buf2)); __asm ("" : "=r" (z) : "0" (0)); test2_sub (x, y, "rstuvwxyz", z); } /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test3 (void) { struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int i; size_t l; /* The following calls should do runtime checking - length is not known, but destination is. */ chk_calls = 0; memcpy (a.buf1 + 2, s3, l1); memcpy (r, s3, l1 + 1); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; memcpy (r, s2, l1 + 2); memcpy (r + 2, s3, l1); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } memcpy (r, s2, l1); if (chk_calls != 5) abort (); /* Following have known destination and known length, so if optimizing certainly shouldn't result in the checking variants. */ chk_calls = 0; memcpy (a.buf1 + 2, s3, 1); memcpy (r, s3, 2); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; memcpy (r, s2, 3); r = buf3; l = 4; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1], l = 2; else if (i == l1) r = &a.buf2[7], l = 3; else if (i == l1 + 1) r = &buf3[5], l = 4; else if (i == l1 + 2) r = &a.buf1[9], l = 1; } memcpy (r, s2, 1); /* Here, l is known to be at most 4 and __builtin_object_size (&buf3[16], 0) is 4, so this doesn't need runtime checking. */ memcpy (&buf3[16], s2, l); if (chk_calls) abort (); chk_calls = 0; } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test4 (void) { struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { memcpy (&a.buf2[9], s2, l1 + 1); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { memcpy (&a.buf2[7], s3, strlen (s3) + 1); abort (); } /* This should be detectable at compile time already. */ if (__builtin_setjmp (chk_fail_buf) == 0) { memcpy (&buf3[19], "ab", 2); abort (); } chk_fail_allowed = 0; } #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_COPY #define MAX_COPY (10 * sizeof (long long)) #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + MAX_EXTRA) /* Use a sequence length that is not divisible by two, to make it more likely to detect when words are mixed up. */ #define SEQUENCE_LENGTH 31 static union { char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u1, u2; void __attribute__((noinline)) test5 (void) { int off1, off2, len, i; char *p, *q, c; for (off1 = 0; off1 < MAX_OFFSET; off1++) for (off2 = 0; off2 < MAX_OFFSET; off2++) for (len = 1; len < MAX_COPY; len++) { for (i = 0, c = 'A'; i < MAX_LENGTH; i++, c++) { u1.buf[i] = 'a'; if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; u2.buf[i] = c; } p = memcpy (u1.buf + off1, u2.buf + off2, len); if (p != u1.buf + off1) abort (); q = u1.buf; for (i = 0; i < off1; i++, q++) if (*q != 'a') abort (); for (i = 0, c = 'A' + off2; i < len; i++, q++, c++) { if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; if (*q != c) abort (); } for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); } } #define TESTSIZE 80 char srcb[TESTSIZE] __attribute__ ((aligned)); char dstb[TESTSIZE] __attribute__ ((aligned)); void __attribute__((noinline)) check (char *test, char *match, int n) { if (memcmp (test, match, n)) abort (); } #define TN(n) \ { memset (dstb, 0, n); memcpy (dstb, srcb, n); check (dstb, srcb, n); } #define T(n) \ TN (n) \ TN ((n) + 1) \ TN ((n) + 2) \ TN ((n) + 3) void __attribute__((noinline)) test6 (void) { int i; chk_calls = 0; for (i = 0; i < sizeof (srcb); ++i) srcb[i] = 'a' + i % 26; T (0); T (4); T (8); T (12); T (16); T (20); T (24); T (28); T (32); T (36); T (40); T (44); T (48); T (52); T (56); T (60); T (64); T (68); T (72); T (76); /* All memcpy calls in this routine have constant arguments. */ if (chk_calls) abort (); } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (l1) : "0" (l1)); test1 (); test2 (); test3 (); test4 (); test5 (); test6 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memcpy-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test4 struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memmove-2-lib.c ================================================ #include "lib/memmove.c" #ifdef __vxworks /* The RTP C library uses bzero and bfill, both of which are defined in the same file as bcopy. */ #include "lib/bzero.c" #include "lib/bfill.c" #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memmove-2.c ================================================ /* Copyright (C) 2004 Free Software Foundation. Check builtin memmove and bcopy optimization when length is 1. Written by Jakub Jelinek, 9/14/2004. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern void *memmove (void *, const void *, size_t); extern void bcopy (const void *, void *, size_t); extern int memcmp (const void *, const void *, size_t); char p[32] = "abcdefg"; char *q = p + 4; void main_test (void) { /* memmove with length 1 can be optimized into memcpy if it can be expanded inline. */ if (memmove (p + 2, p + 3, 1) != p + 2 || memcmp (p, "abddefg", 8)) abort (); if (memmove (p + 1, p + 1, 1) != p + 1 || memcmp (p, "abddefg", 8)) abort (); if (memmove (q, p + 4, 1) != p + 4 || memcmp (p, "abddefg", 8)) abort (); bcopy (p + 5, p + 6, 1); if (memcmp (p, "abddeff", 8)) abort (); bcopy (p + 1, p + 1, 1); if (memcmp (p, "abddeff", 8)) abort (); bcopy (q, p + 4, 1); if (memcmp (p, "abddeff", 8)) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memmove-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memmove-chk.c ================================================ /* Copyright (C) 2004, 2005 Free Software Foundation. Ensure builtin __memcpy_chk performs correctly. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern void *memmove (void *, const void *, size_t); extern int memcmp (const void *, const void *, size_t); #include "chk.h" const char s1[] = "123"; char p[32] = ""; volatile char *s2 = "defg"; /* prevent constant propagation to happen when whole program assumptions are made. */ volatile char *s3 = "FGH"; /* prevent constant propagation to happen when whole program assumptions are made. */ volatile size_t l1 = 1; /* prevent constant propagation to happen when whole program assumptions are made. */ void __attribute__((noinline)) test1 (void) { int i; #if defined __i386__ || defined __x86_64__ /* The functions below might not be optimized into direct stores on all arches. It depends on how many instructions would be generated and what limits the architecture chooses in STORE_BY_PIECES_P. */ memmove_disallowed = 1; memcpy_disallowed = 1; #endif /* All the memmove calls in this routine except last have fixed length, so object size checking should be done at compile time if optimizing. */ chk_calls = 0; if (memmove (p, "ABCDE", 6) != p || memcmp (p, "ABCDE", 6)) abort (); if (memmove (p + 16, "VWX" + 1, 2) != p + 16 || memcmp (p + 16, "WX\0\0", 5)) abort (); if (memmove (p + 1, "", 1) != p + 1 || memcmp (p, "A\0CDE", 6)) abort (); if (memmove (p + 3, "FGHI", 4) != p + 3 || memcmp (p, "A\0CFGHI", 8)) abort (); i = 8; memmove (p + 20, "qrstu", 6); memmove (p + 25, "QRSTU", 6); if (memmove (p + 25 + 1, s1, 3) != p + 25 + 1 || memcmp (p + 25, "Q123U", 6)) abort (); if (memmove (memmove (p, "abcdEFG", 4) + 4, "efg", 4) != p + 4 || memcmp (p, "abcdefg", 8)) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_memmove (p, "ABCDE", 6) != p || memcmp (p, "ABCDE", 6)) abort (); memmove (p + 5, s3, 1); if (memcmp (p, "ABCDEFg", 8)) abort (); memmove_disallowed = 0; memcpy_disallowed = 0; if (chk_calls) abort (); chk_calls = 0; memmove (p + 6, s1 + 1, l1); if (memcmp (p, "ABCDEF2", 8)) abort (); /* The above memmove copies into an object with known size, but unknown length, so it should be a __memmove_chk call. */ if (chk_calls != 1) abort (); } long buf1[64]; char *buf2 = (char *) (buf1 + 32); long buf5[20]; char buf7[20]; void __attribute__((noinline)) test2_sub (long *buf3, char *buf4, char *buf6, int n) { int i = 0; /* All the memmove/__builtin_memmove/__builtin___memmove_chk calls in this routine are either fixed length, or have side-effects in __builtin_object_size arguments, or dst doesn't point into a known object. */ chk_calls = 0; /* These should probably be handled by store_by_pieces on most arches. */ if (memmove (buf1, "ABCDEFGHI", 9) != (char *) buf1 || memcmp (buf1, "ABCDEFGHI\0", 11)) abort (); if (memmove (buf1, "abcdefghijklmnopq", 17) != (char *) buf1 || memcmp (buf1, "abcdefghijklmnopq\0", 19)) abort (); if (__builtin_memmove (buf3, "ABCDEF", 6) != (char *) buf1 || memcmp (buf1, "ABCDEFghijklmnopq\0", 19)) abort (); if (__builtin_memmove (buf3, "a", 1) != (char *) buf1 || memcmp (buf1, "aBCDEFghijklmnopq\0", 19)) abort (); if (memmove ((char *) buf3 + 2, "bcd" + ++i, 2) != (char *) buf1 + 2 || memcmp (buf1, "aBcdEFghijklmnopq\0", 19) || i != 1) abort (); /* These should probably be handled by move_by_pieces on most arches. */ if (memmove ((char *) buf3 + 4, buf5, 6) != (char *) buf1 + 4 || memcmp (buf1, "aBcdRSTUVWklmnopq\0", 19)) abort (); if (__builtin_memmove ((char *) buf1 + ++i + 8, (char *) buf5 + 1, 1) != (char *) buf1 + 10 || memcmp (buf1, "aBcdRSTUVWSlmnopq\0", 19) || i != 2) abort (); if (memmove ((char *) buf3 + 14, buf6, 2) != (char *) buf1 + 14 || memcmp (buf1, "aBcdRSTUVWSlmnrsq\0", 19)) abort (); if (memmove (buf3, buf5, 8) != (char *) buf1 || memcmp (buf1, "RSTUVWXYVWSlmnrsq\0", 19)) abort (); if (memmove (buf3, buf5, 17) != (char *) buf1 || memcmp (buf1, "RSTUVWXYZ01234567\0", 19)) abort (); __builtin_memmove (buf3, "aBcdEFghijklmnopq\0", 19); /* These should be handled either by movmemendM or memmove call. */ /* buf3 points to an unknown object, so __memmove_chk should not be done. */ if (memmove ((char *) buf3 + 4, buf5, n + 6) != (char *) buf1 + 4 || memcmp (buf1, "aBcdRSTUVWklmnopq\0", 19)) abort (); /* This call has side-effects in dst, therefore no checking. */ if (__builtin___memmove_chk ((char *) buf1 + ++i + 8, (char *) buf5 + 1, n + 1, os ((char *) buf1 + ++i + 8)) != (char *) buf1 + 11 || memcmp (buf1, "aBcdRSTUVWkSmnopq\0", 19) || i != 3) abort (); if (memmove ((char *) buf3 + 14, buf6, n + 2) != (char *) buf1 + 14 || memcmp (buf1, "aBcdRSTUVWkSmnrsq\0", 19)) abort (); i = 1; /* These might be handled by store_by_pieces. */ if (memmove (buf2, "ABCDEFGHI", 9) != buf2 || memcmp (buf2, "ABCDEFGHI\0", 11)) abort (); if (memmove (buf2, "abcdefghijklmnopq", 17) != buf2 || memcmp (buf2, "abcdefghijklmnopq\0", 19)) abort (); if (__builtin_memmove (buf4, "ABCDEF", 6) != buf2 || memcmp (buf2, "ABCDEFghijklmnopq\0", 19)) abort (); if (__builtin_memmove (buf4, "a", 1) != buf2 || memcmp (buf2, "aBCDEFghijklmnopq\0", 19)) abort (); if (memmove (buf4 + 2, "bcd" + i++, 2) != buf2 + 2 || memcmp (buf2, "aBcdEFghijklmnopq\0", 19) || i != 2) abort (); /* These might be handled by move_by_pieces. */ if (memmove (buf4 + 4, buf7, 6) != buf2 + 4 || memcmp (buf2, "aBcdRSTUVWklmnopq\0", 19)) abort (); /* Side effect. */ if (__builtin___memmove_chk (buf2 + i++ + 8, buf7 + 1, 1, os (buf2 + i++ + 8)) != buf2 + 10 || memcmp (buf2, "aBcdRSTUVWSlmnopq\0", 19) || i != 3) abort (); if (memmove (buf4 + 14, buf6, 2) != buf2 + 14 || memcmp (buf2, "aBcdRSTUVWSlmnrsq\0", 19)) abort (); __builtin_memmove (buf4, "aBcdEFghijklmnopq\0", 19); /* These should be handled either by movmemendM or memmove call. */ if (memmove (buf4 + 4, buf7, n + 6) != buf2 + 4 || memcmp (buf2, "aBcdRSTUVWklmnopq\0", 19)) abort (); /* Side effect. */ if (__builtin___memmove_chk (buf2 + i++ + 8, buf7 + 1, n + 1, os (buf2 + i++ + 8)) != buf2 + 11 || memcmp (buf2, "aBcdRSTUVWkSmnopq\0", 19) || i != 4) abort (); if (memmove (buf4 + 14, buf6, n + 2) != buf2 + 14 || memcmp (buf2, "aBcdRSTUVWkSmnrsq\0", 19)) abort (); if (chk_calls) abort (); } void __attribute__((noinline)) test2 (void) { long *x; char *y; int z; __builtin_memmove (buf5, "RSTUVWXYZ0123456789", 20); __builtin_memmove (buf7, "RSTUVWXYZ0123456789", 20); __asm ("" : "=r" (x) : "0" (buf1)); __asm ("" : "=r" (y) : "0" (buf2)); __asm ("" : "=r" (z) : "0" (0)); test2_sub (x, y, "rstuvwxyz", z); } static const struct foo { char *s; double d; long l; } foo[] = { { "hello world1", 3.14159, 101L }, { "hello world2", 3.14159, 102L }, { "hello world3", 3.14159, 103L }, { "hello world4", 3.14159, 104L }, { "hello world5", 3.14159, 105L }, { "hello world6", 3.14159, 106L } }; static const struct bar { char *s; const struct foo f[3]; } bar[] = { { "hello world10", { { "hello1", 3.14159, 201L }, { "hello2", 3.14159, 202L }, { "hello3", 3.14159, 203L }, } }, { "hello world11", { { "hello4", 3.14159, 204L }, { "hello5", 3.14159, 205L }, { "hello6", 3.14159, 206L }, } } }; static const int baz[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }; void __attribute__((noinline)) test3 (void) { const char *s; struct foo f1[sizeof foo/sizeof*foo]; struct bar b1[sizeof bar/sizeof*bar]; int bz[sizeof baz/sizeof*baz]; /* All the memmove/__builtin_memmove calls in this routine have fixed length. */ chk_calls = 0; /* All the *memmove calls below have src in read-only memory, so all of them should be optimized into memcpy. */ memmove_disallowed = 1; if (memmove (f1, foo, sizeof (foo)) != f1 || memcmp (f1, foo, sizeof (foo))) abort (); if (memmove (b1, bar, sizeof (bar)) != b1 || memcmp (b1, bar, sizeof (bar))) abort (); memmove (bz, baz, sizeof (baz)); if (memcmp (bz, baz, sizeof (baz))) abort (); if (memmove (p, "abcde", 6) != p || memcmp (p, "abcde", 6)) abort (); s = s1; if (memmove (p + 2, ++s, 0) != p + 2 || memcmp (p, "abcde", 6) || s != s1 + 1) abort (); if (__builtin_memmove (p + 3, "", 1) != p + 3 || memcmp (p, "abc\0e", 6)) abort (); memmove (p + 2, "fghijk", 4); if (memcmp (p, "abfghi", 7)) abort (); s = s1 + 1; memmove (p + 1, s++, 0); if (memcmp (p, "abfghi", 7) || s != s1 + 2) abort (); __builtin_memmove (p + 4, "ABCDE", 1); if (memcmp (p, "abfgAi", 7)) abort (); /* memmove with length 1 can be optimized into memcpy if it can be expanded inline. */ if (memmove (p + 2, p + 3, 1) != p + 2) abort (); if (memcmp (p, "abggAi", 7)) abort (); if (chk_calls) abort (); memmove_disallowed = 0; } /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test4 (void) { struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int i; size_t l; /* The following calls should do runtime checking - length is not known, but destination is. */ chk_calls = 0; memmove (a.buf1 + 2, s3, l1); memmove (r, s3, l1 + 1); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; memmove (r, s2, l1 + 2); memmove (r + 2, s3, l1); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } memmove (r, s2, l1); if (chk_calls != 5) abort (); /* Following have known destination and known length, so if optimizing certainly shouldn't result in the checking variants. */ chk_calls = 0; memmove (a.buf1 + 2, s3, 1); memmove (r, s3, 2); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; memmove (r, s2, 3); r = buf3; l = 4; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1], l = 2; else if (i == l1) r = &a.buf2[7], l = 3; else if (i == l1 + 1) r = &buf3[5], l = 4; else if (i == l1 + 2) r = &a.buf1[9], l = 1; } memmove (r, s2, 1); /* Here, l is known to be at most 4 and __builtin_object_size (&buf3[16], 0) is 4, so this doesn't need runtime checking. */ memmove (&buf3[16], s2, l); if (chk_calls) abort (); chk_calls = 0; } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test5 (void) { struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { memmove (&a.buf2[9], s2, l1 + 1); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { memmove (&a.buf2[7], s3, strlen (s3) + 1); abort (); } /* This should be detectable at compile time already. */ if (__builtin_setjmp (chk_fail_buf) == 0) { memmove (&buf3[19], "ab", 2); abort (); } chk_fail_allowed = 0; } #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_COPY #define MAX_COPY (10 * sizeof (long long)) #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + MAX_EXTRA) /* Use a sequence length that is not divisible by two, to make it more likely to detect when words are mixed up. */ #define SEQUENCE_LENGTH 31 static union { char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u1, u2; void __attribute__((noinline)) test6 (void) { int off1, off2, len, i; char *p, *q, c; for (off1 = 0; off1 < MAX_OFFSET; off1++) for (off2 = 0; off2 < MAX_OFFSET; off2++) for (len = 1; len < MAX_COPY; len++) { for (i = 0, c = 'A'; i < MAX_LENGTH; i++, c++) { u1.buf[i] = 'a'; if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; u2.buf[i] = c; } p = memmove (u1.buf + off1, u2.buf + off2, len); if (p != u1.buf + off1) abort (); q = u1.buf; for (i = 0; i < off1; i++, q++) if (*q != 'a') abort (); for (i = 0, c = 'A' + off2; i < len; i++, q++, c++) { if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; if (*q != c) abort (); } for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); } } #define TESTSIZE 80 char srcb[TESTSIZE] __attribute__ ((aligned)); char dstb[TESTSIZE] __attribute__ ((aligned)); void __attribute__((noinline)) check (char *test, char *match, int n) { if (memcmp (test, match, n)) abort (); } #define TN(n) \ { memset (dstb, 0, n); memmove (dstb, srcb, n); check (dstb, srcb, n); } #define T(n) \ TN (n) \ TN ((n) + 1) \ TN ((n) + 2) \ TN ((n) + 3) void __attribute__((noinline)) test7 (void) { int i; chk_calls = 0; for (i = 0; i < sizeof (srcb); ++i) srcb[i] = 'a' + i % 26; T (0); T (4); T (8); T (12); T (16); T (20); T (24); T (28); T (32); T (36); T (40); T (44); T (48); T (52); T (56); T (60); T (64); T (68); T (72); T (76); /* All memmove calls in this routine have constant arguments. */ if (chk_calls) abort (); } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (l1) : "0" (l1)); test1 (); test2 (); __builtin_memset (p, '\0', sizeof (p)); test3 (); test4 (); test5 (); test6 (); test7 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memmove-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test5 struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memmove-lib.c ================================================ #include "lib/memmove.c" #ifdef __vxworks /* The RTP C library uses bzero and bfill, both of which are defined in the same file as bcopy. */ #include "lib/bzero.c" #include "lib/bfill.c" #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memmove.c ================================================ /* Copyright (C) 2003, 2004 Free Software Foundation. Ensure builtin memmove and bcopy perform correctly. Written by Jakub Jelinek, 4/26/2003. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern void *memmove (void *, const void *, size_t); extern void bcopy (const void *, void *, size_t); extern int memcmp (const void *, const void *, size_t); const char s1[] = "123"; char p[32] = ""; static const struct foo { char *s; double d; long l; } foo[] = { { "hello world1", 3.14159, 101L }, { "hello world2", 3.14159, 102L }, { "hello world3", 3.14159, 103L }, { "hello world4", 3.14159, 104L }, { "hello world5", 3.14159, 105L }, { "hello world6", 3.14159, 106L } }; static const struct bar { char *s; const struct foo f[3]; } bar[] = { { "hello world10", { { "hello1", 3.14159, 201L }, { "hello2", 3.14159, 202L }, { "hello3", 3.14159, 203L }, } }, { "hello world11", { { "hello4", 3.14159, 204L }, { "hello5", 3.14159, 205L }, { "hello6", 3.14159, 206L }, } } }; static const int baz[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }; void main_test (void) { const char *s; struct foo f1[sizeof foo/sizeof*foo]; struct bar b1[sizeof bar/sizeof*bar]; int bz[sizeof baz/sizeof*baz]; if (memmove (f1, foo, sizeof (foo)) != f1 || memcmp (f1, foo, sizeof (foo))) abort (); if (memmove (b1, bar, sizeof (bar)) != b1 || memcmp (b1, bar, sizeof (bar))) abort (); bcopy (baz, bz, sizeof (baz)); if (memcmp (bz, baz, sizeof (baz))) abort (); if (memmove (p, "abcde", 6) != p || memcmp (p, "abcde", 6)) abort (); s = s1; if (memmove (p + 2, ++s, 0) != p + 2 || memcmp (p, "abcde", 6) || s != s1 + 1) abort (); if (__builtin_memmove (p + 3, "", 1) != p + 3 || memcmp (p, "abc\0e", 6)) abort (); bcopy ("fghijk", p + 2, 4); if (memcmp (p, "abfghi", 7)) abort (); s = s1 + 1; bcopy (s++, p + 1, 0); if (memcmp (p, "abfghi", 7) || s != s1 + 2) abort (); __builtin_bcopy ("ABCDE", p + 4, 1); if (memcmp (p, "abfgAi", 7)) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memops-asm-lib.c ================================================ extern void abort (void); extern int inside_main; typedef __SIZE_TYPE__ size_t; #define TEST_ABORT if (inside_main) abort() /* LTO code is at the present to able to track that asm alias my_bcopy on builtin actually refers to this function. See PR47181. */ __attribute__ ((used)) void * my_memcpy (void *d, const void *s, size_t n) { char *dst = (char *) d; const char *src = (const char *) s; while (n--) *dst++ = *src++; return (char *) d; } /* LTO code is at the present to able to track that asm alias my_bcopy on builtin actually refers to this function. See PR47181. */ __attribute__ ((used)) void my_bcopy (const void *s, void *d, size_t n) { char *dst = (char *) d; const char *src = (const char *) s; if (src >= dst) while (n--) *dst++ = *src++; else { dst += n; src += n; while (n--) *--dst = *--src; } } /* LTO code is at the present to able to track that asm alias my_bcopy on builtin actually refers to this function. See PR47181. */ __attribute__ ((used)) void * my_memset (void *d, int c, size_t n) { char *dst = (char *) d; while (n--) *dst++ = c; return (char *) d; } /* LTO code is at the present to able to track that asm alias my_bcopy on builtin actually refers to this function. See PR47181. */ __attribute__ ((used)) void my_bzero (void *d, size_t n) { char *dst = (char *) d; while (n--) *dst++ = '\0'; } void * memcpy (void *d, const void *s, size_t n) { void *result = my_memcpy (d, s, n); TEST_ABORT; return result; } void bcopy (const void *s, void *d, size_t n) { my_bcopy (s, d, n); TEST_ABORT; } void * memset (void *d, int c, size_t n) { void *result = my_memset (d, c, n); TEST_ABORT; return result; } void bzero (void *d, size_t n) { my_bzero (d, n); TEST_ABORT; } #ifdef __vxworks /* The RTP C library uses bfill, which is defined in the same file as bzero and bcopy. */ #include "lib/bfill.c" #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memops-asm.c ================================================ /* Copyright (C) 2003 Free Software Foundation. Test memcpy and memset in presence of redirect. */ #define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname) #define ASMNAME2(prefix, cname) STRING (prefix) cname #define STRING(x) #x typedef __SIZE_TYPE__ size_t; extern void abort (void); extern void *memcpy (void *, const void *, size_t) __asm (ASMNAME ("my_memcpy")); extern void bcopy (const void *, void *, size_t) __asm (ASMNAME ("my_bcopy")); extern void *memset (void *, int, size_t) __asm (ASMNAME ("my_memset")); extern void bzero (void *, size_t) __asm (ASMNAME ("my_bzero")); extern int memcmp (const void *, const void *, size_t); struct A { char c[32]; } a = { "foobar" }; char x[64] = "foobar", y[64]; int i = 39, j = 6, k = 4; extern int inside_main; void main_test (void) { struct A b = a; struct A c = { { 'x' } }; inside_main = 1; if (memcmp (b.c, x, 32) || c.c[0] != 'x' || memcmp (c.c + 1, x + 32, 31)) abort (); if (__builtin_memcpy (y, x, i) != y || memcmp (x, y, 64)) abort (); if (memcpy (y + 6, x, j) != y + 6 || memcmp (x, y, 6) || memcmp (x, y + 6, 58)) abort (); if (__builtin_memset (y + 2, 'X', k) != y + 2 || memcmp (y, "foXXXXfoobar", 13)) abort (); bcopy (y + 1, y + 2, 6); if (memcmp (y, "fooXXXXfobar", 13)) abort (); __builtin_bzero (y + 4, 2); if (memcmp (y, "fooX\0\0Xfobar", 13)) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memops-asm.x ================================================ # Different translation units may have different user name overrides # and we do not preserve enough context to known which one we want. set torture_eval_before_compile { if {[string match {*-flto*} "$option"]} { continue } } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/mempcpy-2-lib.c ================================================ #include "lib/mempcpy.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/mempcpy-2.c ================================================ /* Copyright (C) 2003 Free Software Foundation. Ensure that builtin mempcpy and stpcpy perform correctly. Written by Jakub Jelinek, 21/05/2003. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern void *mempcpy (void *, const void *, size_t); extern int memcmp (const void *, const void *, size_t); extern int inside_main; long buf1[64]; char *buf2 = (char *) (buf1 + 32); long buf5[20]; char buf7[20]; void __attribute__((noinline)) test (long *buf3, char *buf4, char *buf6, int n) { int i = 0; /* These should probably be handled by store_by_pieces on most arches. */ if (mempcpy (buf1, "ABCDEFGHI", 9) != (char *) buf1 + 9 || memcmp (buf1, "ABCDEFGHI\0", 11)) abort (); if (mempcpy (buf1, "abcdefghijklmnopq", 17) != (char *) buf1 + 17 || memcmp (buf1, "abcdefghijklmnopq\0", 19)) abort (); if (__builtin_mempcpy (buf3, "ABCDEF", 6) != (char *) buf1 + 6 || memcmp (buf1, "ABCDEFghijklmnopq\0", 19)) abort (); if (__builtin_mempcpy (buf3, "a", 1) != (char *) buf1 + 1 || memcmp (buf1, "aBCDEFghijklmnopq\0", 19)) abort (); if (mempcpy ((char *) buf3 + 2, "bcd" + ++i, 2) != (char *) buf1 + 4 || memcmp (buf1, "aBcdEFghijklmnopq\0", 19) || i != 1) abort (); /* These should probably be handled by move_by_pieces on most arches. */ if (mempcpy ((char *) buf3 + 4, buf5, 6) != (char *) buf1 + 10 || memcmp (buf1, "aBcdRSTUVWklmnopq\0", 19)) abort (); if (__builtin_mempcpy ((char *) buf1 + ++i + 8, (char *) buf5 + 1, 1) != (char *) buf1 + 11 || memcmp (buf1, "aBcdRSTUVWSlmnopq\0", 19) || i != 2) abort (); if (mempcpy ((char *) buf3 + 14, buf6, 2) != (char *) buf1 + 16 || memcmp (buf1, "aBcdRSTUVWSlmnrsq\0", 19)) abort (); if (mempcpy (buf3, buf5, 8) != (char *) buf1 + 8 || memcmp (buf1, "RSTUVWXYVWSlmnrsq\0", 19)) abort (); if (mempcpy (buf3, buf5, 17) != (char *) buf1 + 17 || memcmp (buf1, "RSTUVWXYZ01234567\0", 19)) abort (); __builtin_memcpy (buf3, "aBcdEFghijklmnopq\0", 19); /* These should be handled either by movmemendM or mempcpy call. */ if (mempcpy ((char *) buf3 + 4, buf5, n + 6) != (char *) buf1 + 10 || memcmp (buf1, "aBcdRSTUVWklmnopq\0", 19)) abort (); if (__builtin_mempcpy ((char *) buf1 + ++i + 8, (char *) buf5 + 1, n + 1) != (char *) buf1 + 12 || memcmp (buf1, "aBcdRSTUVWkSmnopq\0", 19) || i != 3) abort (); if (mempcpy ((char *) buf3 + 14, buf6, n + 2) != (char *) buf1 + 16 || memcmp (buf1, "aBcdRSTUVWkSmnrsq\0", 19)) abort (); i = 1; /* These might be handled by store_by_pieces. */ if (mempcpy (buf2, "ABCDEFGHI", 9) != buf2 + 9 || memcmp (buf2, "ABCDEFGHI\0", 11)) abort (); if (mempcpy (buf2, "abcdefghijklmnopq", 17) != buf2 + 17 || memcmp (buf2, "abcdefghijklmnopq\0", 19)) abort (); if (__builtin_mempcpy (buf4, "ABCDEF", 6) != buf2 + 6 || memcmp (buf2, "ABCDEFghijklmnopq\0", 19)) abort (); if (__builtin_mempcpy (buf4, "a", 1) != buf2 + 1 || memcmp (buf2, "aBCDEFghijklmnopq\0", 19)) abort (); if (mempcpy (buf4 + 2, "bcd" + i++, 2) != buf2 + 4 || memcmp (buf2, "aBcdEFghijklmnopq\0", 19) || i != 2) abort (); /* These might be handled by move_by_pieces. */ if (mempcpy (buf4 + 4, buf7, 6) != buf2 + 10 || memcmp (buf2, "aBcdRSTUVWklmnopq\0", 19)) abort (); if (__builtin_mempcpy (buf2 + i++ + 8, buf7 + 1, 1) != buf2 + 11 || memcmp (buf2, "aBcdRSTUVWSlmnopq\0", 19) || i != 3) abort (); if (mempcpy (buf4 + 14, buf6, 2) != buf2 + 16 || memcmp (buf2, "aBcdRSTUVWSlmnrsq\0", 19)) abort (); __builtin_memcpy (buf4, "aBcdEFghijklmnopq\0", 19); /* These should be handled either by movmemendM or mempcpy call. */ if (mempcpy (buf4 + 4, buf7, n + 6) != buf2 + 10 || memcmp (buf2, "aBcdRSTUVWklmnopq\0", 19)) abort (); if (__builtin_mempcpy (buf2 + i++ + 8, buf7 + 1, n + 1) != buf2 + 12 || memcmp (buf2, "aBcdRSTUVWkSmnopq\0", 19) || i != 4) abort (); if (mempcpy (buf4 + 14, buf6, n + 2) != buf2 + 16 || memcmp (buf2, "aBcdRSTUVWkSmnrsq\0", 19)) abort (); } void main_test (void) { /* All these tests are allowed to call mempcpy/stpcpy. */ inside_main = 0; __builtin_memcpy (buf5, "RSTUVWXYZ0123456789", 20); __builtin_memcpy (buf7, "RSTUVWXYZ0123456789", 20); test (buf1, buf2, "rstuvwxyz", 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/mempcpy-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/mempcpy-chk.c ================================================ /* Copyright (C) 2004, 2005 Free Software Foundation. Ensure builtin __mempcpy_chk performs correctly. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern void *mempcpy (void *, const void *, size_t); extern int memcmp (const void *, const void *, size_t); #include "chk.h" const char s1[] = "123"; char p[32] = ""; volatile char *s2 = "defg"; /* prevent constant propagation to happen when whole program assumptions are made. */ volatile char *s3 = "FGH"; /* prevent constant propagation to happen when whole program assumptions are made. */ volatile size_t l1 = 1; /* prevent constant propagation to happen when whole program assumptions are made. */ void __attribute__((noinline)) test1 (void) { int i; #if defined __i386__ || defined __x86_64__ /* The functions below might not be optimized into direct stores on all arches. It depends on how many instructions would be generated and what limits the architecture chooses in STORE_BY_PIECES_P. */ mempcpy_disallowed = 1; #endif /* All the mempcpy calls in this routine except last have fixed length, so object size checking should be done at compile time if optimizing. */ chk_calls = 0; if (mempcpy (p, "ABCDE", 6) != p + 6 || memcmp (p, "ABCDE", 6)) abort (); if (mempcpy (p + 16, "VWX" + 1, 2) != p + 16 + 2 || memcmp (p + 16, "WX\0\0", 5)) abort (); if (mempcpy (p + 1, "", 1) != p + 1 + 1 || memcmp (p, "A\0CDE", 6)) abort (); if (mempcpy (p + 3, "FGHI", 4) != p + 3 + 4 || memcmp (p, "A\0CFGHI", 8)) abort (); i = 8; memcpy (p + 20, "qrstu", 6); memcpy (p + 25, "QRSTU", 6); if (mempcpy (p + 25 + 1, s1, 3) != (p + 25 + 1 + 3) || memcmp (p + 25, "Q123U", 6)) abort (); if (mempcpy (mempcpy (p, "abcdEFG", 4), "efg", 4) != p + 8 || memcmp (p, "abcdefg", 8)) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_mempcpy (p, "ABCDE", 6) != p + 6 || memcmp (p, "ABCDE", 6)) abort (); /* If the result of mempcpy is ignored, gcc should use memcpy. This should be optimized always, so disallow mempcpy calls. */ mempcpy_disallowed = 1; mempcpy (p + 5, s3, 1); if (memcmp (p, "ABCDEFg", 8)) abort (); if (chk_calls) abort (); chk_calls = 0; mempcpy (p + 6, s1 + 1, l1); if (memcmp (p, "ABCDEF2", 8)) abort (); /* The above mempcpy copies into an object with known size, but unknown length and with result ignored, so it should be a __memcpy_chk call. */ if (chk_calls != 1) abort (); mempcpy_disallowed = 0; } long buf1[64]; char *buf2 = (char *) (buf1 + 32); long buf5[20]; char buf7[20]; void __attribute__((noinline)) test2_sub (long *buf3, char *buf4, char *buf6, int n) { int i = 0; /* All the mempcpy/__builtin_mempcpy/__builtin___mempcpy_chk calls in this routine are either fixed length, or have side-effects in __builtin_object_size arguments, or dst doesn't point into a known object. */ chk_calls = 0; /* These should probably be handled by store_by_pieces on most arches. */ if (mempcpy (buf1, "ABCDEFGHI", 9) != (char *) buf1 + 9 || memcmp (buf1, "ABCDEFGHI\0", 11)) abort (); if (mempcpy (buf1, "abcdefghijklmnopq", 17) != (char *) buf1 + 17 || memcmp (buf1, "abcdefghijklmnopq\0", 19)) abort (); if (__builtin_mempcpy (buf3, "ABCDEF", 6) != (char *) buf1 + 6 || memcmp (buf1, "ABCDEFghijklmnopq\0", 19)) abort (); if (__builtin_mempcpy (buf3, "a", 1) != (char *) buf1 + 1 || memcmp (buf1, "aBCDEFghijklmnopq\0", 19)) abort (); if (mempcpy ((char *) buf3 + 2, "bcd" + ++i, 2) != (char *) buf1 + 4 || memcmp (buf1, "aBcdEFghijklmnopq\0", 19) || i != 1) abort (); /* These should probably be handled by move_by_pieces on most arches. */ if (mempcpy ((char *) buf3 + 4, buf5, 6) != (char *) buf1 + 10 || memcmp (buf1, "aBcdRSTUVWklmnopq\0", 19)) abort (); if (__builtin_mempcpy ((char *) buf1 + ++i + 8, (char *) buf5 + 1, 1) != (char *) buf1 + 11 || memcmp (buf1, "aBcdRSTUVWSlmnopq\0", 19) || i != 2) abort (); if (mempcpy ((char *) buf3 + 14, buf6, 2) != (char *) buf1 + 16 || memcmp (buf1, "aBcdRSTUVWSlmnrsq\0", 19)) abort (); if (mempcpy (buf3, buf5, 8) != (char *) buf1 + 8 || memcmp (buf1, "RSTUVWXYVWSlmnrsq\0", 19)) abort (); if (mempcpy (buf3, buf5, 17) != (char *) buf1 + 17 || memcmp (buf1, "RSTUVWXYZ01234567\0", 19)) abort (); __builtin_memcpy (buf3, "aBcdEFghijklmnopq\0", 19); /* These should be handled either by movmemendM or mempcpy call. */ /* buf3 points to an unknown object, so __mempcpy_chk should not be done. */ if (mempcpy ((char *) buf3 + 4, buf5, n + 6) != (char *) buf1 + 10 || memcmp (buf1, "aBcdRSTUVWklmnopq\0", 19)) abort (); /* This call has side-effects in dst, therefore no checking. */ if (__builtin___mempcpy_chk ((char *) buf1 + ++i + 8, (char *) buf5 + 1, n + 1, os ((char *) buf1 + ++i + 8)) != (char *) buf1 + 12 || memcmp (buf1, "aBcdRSTUVWkSmnopq\0", 19) || i != 3) abort (); if (mempcpy ((char *) buf3 + 14, buf6, n + 2) != (char *) buf1 + 16 || memcmp (buf1, "aBcdRSTUVWkSmnrsq\0", 19)) abort (); i = 1; /* These might be handled by store_by_pieces. */ if (mempcpy (buf2, "ABCDEFGHI", 9) != buf2 + 9 || memcmp (buf2, "ABCDEFGHI\0", 11)) abort (); if (mempcpy (buf2, "abcdefghijklmnopq", 17) != buf2 + 17 || memcmp (buf2, "abcdefghijklmnopq\0", 19)) abort (); if (__builtin_mempcpy (buf4, "ABCDEF", 6) != buf2 + 6 || memcmp (buf2, "ABCDEFghijklmnopq\0", 19)) abort (); if (__builtin_mempcpy (buf4, "a", 1) != buf2 + 1 || memcmp (buf2, "aBCDEFghijklmnopq\0", 19)) abort (); if (mempcpy (buf4 + 2, "bcd" + i++, 2) != buf2 + 4 || memcmp (buf2, "aBcdEFghijklmnopq\0", 19) || i != 2) abort (); /* These might be handled by move_by_pieces. */ if (mempcpy (buf4 + 4, buf7, 6) != buf2 + 10 || memcmp (buf2, "aBcdRSTUVWklmnopq\0", 19)) abort (); /* Side effect. */ if (__builtin___mempcpy_chk (buf2 + i++ + 8, buf7 + 1, 1, os (buf2 + i++ + 8)) != buf2 + 11 || memcmp (buf2, "aBcdRSTUVWSlmnopq\0", 19) || i != 3) abort (); if (mempcpy (buf4 + 14, buf6, 2) != buf2 + 16 || memcmp (buf2, "aBcdRSTUVWSlmnrsq\0", 19)) abort (); __builtin_memcpy (buf4, "aBcdEFghijklmnopq\0", 19); /* These should be handled either by movmemendM or mempcpy call. */ if (mempcpy (buf4 + 4, buf7, n + 6) != buf2 + 10 || memcmp (buf2, "aBcdRSTUVWklmnopq\0", 19)) abort (); /* Side effect. */ if (__builtin___mempcpy_chk (buf2 + i++ + 8, buf7 + 1, n + 1, os (buf2 + i++ + 8)) != buf2 + 12 || memcmp (buf2, "aBcdRSTUVWkSmnopq\0", 19) || i != 4) abort (); if (mempcpy (buf4 + 14, buf6, n + 2) != buf2 + 16 || memcmp (buf2, "aBcdRSTUVWkSmnrsq\0", 19)) abort (); if (chk_calls) abort (); } void __attribute__((noinline)) test2 (void) { long *x; char *y; int z; __builtin_memcpy (buf5, "RSTUVWXYZ0123456789", 20); __builtin_memcpy (buf7, "RSTUVWXYZ0123456789", 20); __asm ("" : "=r" (x) : "0" (buf1)); __asm ("" : "=r" (y) : "0" (buf2)); __asm ("" : "=r" (z) : "0" (0)); test2_sub (x, y, "rstuvwxyz", z); } volatile void *vx; /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test3 (void) { struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int i; size_t l; /* The following calls should do runtime checking - length is not known, but destination is. */ chk_calls = 0; vx = mempcpy (a.buf1 + 2, s3, l1); vx = mempcpy (r, s3, l1 + 1); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; vx = mempcpy (r, s2, l1 + 2); vx = mempcpy (r + 2, s3, l1); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } vx = mempcpy (r, s2, l1); if (chk_calls != 5) abort (); /* Following have known destination and known length, so if optimizing certainly shouldn't result in the checking variants. */ chk_calls = 0; vx = mempcpy (a.buf1 + 2, s3, 1); vx = mempcpy (r, s3, 2); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; vx = mempcpy (r, s2, 3); r = buf3; l = 4; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1], l = 2; else if (i == l1) r = &a.buf2[7], l = 3; else if (i == l1 + 1) r = &buf3[5], l = 4; else if (i == l1 + 2) r = &a.buf1[9], l = 1; } vx = mempcpy (r, s2, 1); /* Here, l is known to be at most 4 and __builtin_object_size (&buf3[16], 0) is 4, so this doesn't need runtime checking. */ vx = mempcpy (&buf3[16], s2, l); if (chk_calls) abort (); chk_calls = 0; } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test4 (void) { struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { vx = mempcpy (&a.buf2[9], s2, l1 + 1); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { vx = mempcpy (&a.buf2[7], s3, strlen (s3) + 1); abort (); } /* This should be detectable at compile time already. */ if (__builtin_setjmp (chk_fail_buf) == 0) { vx = mempcpy (&buf3[19], "ab", 2); abort (); } chk_fail_allowed = 0; } #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_COPY #define MAX_COPY (10 * sizeof (long long)) #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + MAX_EXTRA) /* Use a sequence length that is not divisible by two, to make it more likely to detect when words are mixed up. */ #define SEQUENCE_LENGTH 31 static union { char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u1, u2; void __attribute__((noinline)) test5 (void) { int off1, off2, len, i; char *p, *q, c; for (off1 = 0; off1 < MAX_OFFSET; off1++) for (off2 = 0; off2 < MAX_OFFSET; off2++) for (len = 1; len < MAX_COPY; len++) { for (i = 0, c = 'A'; i < MAX_LENGTH; i++, c++) { u1.buf[i] = 'a'; if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; u2.buf[i] = c; } p = mempcpy (u1.buf + off1, u2.buf + off2, len); if (p != u1.buf + off1 + len) abort (); q = u1.buf; for (i = 0; i < off1; i++, q++) if (*q != 'a') abort (); for (i = 0, c = 'A' + off2; i < len; i++, q++, c++) { if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; if (*q != c) abort (); } for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); } } #define TESTSIZE 80 char srcb[TESTSIZE] __attribute__ ((aligned)); char dstb[TESTSIZE] __attribute__ ((aligned)); void __attribute__((noinline)) check (char *test, char *match, int n) { if (memcmp (test, match, n)) abort (); } #define TN(n) \ { memset (dstb, 0, n); vx = mempcpy (dstb, srcb, n); check (dstb, srcb, n); } #define T(n) \ TN (n) \ TN ((n) + 1) \ TN ((n) + 2) \ TN ((n) + 3) void __attribute__((noinline)) test6 (void) { int i; chk_calls = 0; for (i = 0; i < sizeof (srcb); ++i) srcb[i] = 'a' + i % 26; T (0); T (4); T (8); T (12); T (16); T (20); T (24); T (28); T (32); T (36); T (40); T (44); T (48); T (52); T (56); T (60); T (64); T (68); T (72); T (76); /* All mempcpy calls in this routine have constant arguments. */ if (chk_calls) abort (); } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (l1) : "0" (l1)); test1 (); test2 (); test3 (); test4 (); test5 (); test6 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/mempcpy-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test4 struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/mempcpy-lib.c ================================================ #include "lib/mempcpy.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/mempcpy.c ================================================ /* Copyright (C) 2003 Free Software Foundation. Ensure builtin mempcpy performs correctly. Written by Kaveh Ghazi, 4/11/2003. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern void *mempcpy (void *, const void *, size_t); extern int memcmp (const void *, const void *, size_t); extern int inside_main; const char s1[] = "123"; char p[32] = ""; char *s2 = "defg"; char *s3 = "FGH"; size_t l1 = 1; void main_test (void) { int i; #if !defined __i386__ && !defined __x86_64__ /* The functions below might not be optimized into direct stores on all arches. It depends on how many instructions would be generated and what limits the architecture chooses in STORE_BY_PIECES_P. */ inside_main = 0; #endif if (mempcpy (p, "ABCDE", 6) != p + 6 || memcmp (p, "ABCDE", 6)) abort (); if (mempcpy (p + 16, "VWX" + 1, 2) != p + 16 + 2 || memcmp (p + 16, "WX\0\0", 5)) abort (); if (mempcpy (p + 1, "", 1) != p + 1 + 1 || memcmp (p, "A\0CDE", 6)) abort (); if (mempcpy (p + 3, "FGHI", 4) != p + 3 + 4 || memcmp (p, "A\0CFGHI", 8)) abort (); i = 8; memcpy (p + 20, "qrstu", 6); memcpy (p + 25, "QRSTU", 6); if (mempcpy (p + 25 + 1, s1, 3) != (p + 25 + 1 + 3) || memcmp (p + 25, "Q123U", 6)) abort (); if (mempcpy (mempcpy (p, "abcdEFG", 4), "efg", 4) != p + 8 || memcmp (p, "abcdefg", 8)) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_mempcpy (p, "ABCDE", 6) != p + 6 || memcmp (p, "ABCDE", 6)) abort (); /* If the result of mempcpy is ignored, gcc should use memcpy. This should be optimized always, so set inside_main again. */ inside_main = 1; mempcpy (p + 5, s3, 1); if (memcmp (p, "ABCDEFg", 8)) abort (); mempcpy (p + 6, s1 + 1, l1); if (memcmp (p, "ABCDEF2", 8)) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memset-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memset-chk.c ================================================ /* Copyright (C) 2004, 2005 Free Software Foundation. Ensure builtin __memset_chk performs correctly. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern void *memset (void *, int, size_t); extern int memcmp (const void *, const void *, size_t); #include "chk.h" char buffer[32]; int argc = 1; volatile size_t l1 = 1; /* prevent constant propagation to happen when whole program assumptions are made. */ volatile char *s3 = "FGH"; /* prevent constant propagation to happen when whole program assumptions are made. */ char *s4; void __attribute__((noinline)) test1 (void) { memset_disallowed = 1; chk_calls = 0; memset (buffer, argc, 0); memset (buffer, argc, 1); memset (buffer, argc, 2); memset (buffer, argc, 3); memset (buffer, argc, 4); memset (buffer, argc, 5); memset (buffer, argc, 6); memset (buffer, argc, 7); memset (buffer, argc, 8); memset (buffer, argc, 9); memset (buffer, argc, 10); memset (buffer, argc, 11); memset (buffer, argc, 12); memset (buffer, argc, 13); memset (buffer, argc, 14); memset (buffer, argc, 15); memset (buffer, argc, 16); memset (buffer, argc, 17); memset_disallowed = 0; if (chk_calls) abort (); } /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test2 (void) { struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int i; size_t l; /* The following calls should do runtime checking - length is not known, but destination is. */ chk_calls = 0; memset (a.buf1 + 2, 'a', l1); memset (r, '\0', l1 + 1); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; memset (r, argc, l1 + 2); memset (r + 2, 'Q', l1); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } memset (r, '\0', l1); if (chk_calls != 5) abort (); /* Following have known destination and known length, so if optimizing certainly shouldn't result in the checking variants. */ chk_calls = 0; memset (a.buf1 + 2, '\0', 1); memset (r, argc, 2); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; memset (r, 'N', 3); r = buf3; l = 4; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1], l = 2; else if (i == l1) r = &a.buf2[7], l = 3; else if (i == l1 + 1) r = &buf3[5], l = 4; else if (i == l1 + 2) r = &a.buf1[9], l = 1; } memset (r, 'H', 1); /* Here, l is known to be at most 4 and __builtin_object_size (&buf3[16], 0) is 4, so this doesn't need runtime checking. */ memset (&buf3[16], 'd', l); /* Neither length nor destination known. Doesn't need runtime checking. */ memset (s4, 'a', l1); memset (s4 + 2, '\0', l1 + 2); /* Destination unknown. */ memset (s4 + 4, 'b', 2); memset (s4 + 6, '\0', 4); if (chk_calls) abort (); chk_calls = 0; } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test3 (void) { struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { memset (&a.buf2[9], '\0', l1 + 1); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { memset (&a.buf2[7], 'T', strlen (s3) + 1); abort (); } /* This should be detectable at compile time already. */ if (__builtin_setjmp (chk_fail_buf) == 0) { memset (&buf3[19], 'b', 2); abort (); } chk_fail_allowed = 0; } #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_COPY #define MAX_COPY (10 * sizeof (long long)) #define MAX_COPY2 15 #else #define MAX_COPY2 MAX_COPY #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + MAX_EXTRA) #define MAX_LENGTH2 (MAX_OFFSET + MAX_COPY2 + MAX_EXTRA) static union { char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u; char A = 'A'; void __attribute__((noinline)) test4 (void) { int off, len, i; char *p, *q; for (off = 0; off < MAX_OFFSET; off++) for (len = 1; len < MAX_COPY; len++) { for (i = 0; i < MAX_LENGTH; i++) u.buf[i] = 'a'; p = memset (u.buf + off, '\0', len); if (p != u.buf + off) abort (); q = u.buf; for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); for (i = 0; i < len; i++, q++) if (*q != '\0') abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); p = memset (u.buf + off, A, len); if (p != u.buf + off) abort (); q = u.buf; for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); for (i = 0; i < len; i++, q++) if (*q != 'A') abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); p = memset (u.buf + off, 'B', len); if (p != u.buf + off) abort (); q = u.buf; for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); for (i = 0; i < len; i++, q++) if (*q != 'B') abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); } } static union { char buf[MAX_LENGTH2]; long long align_int; long double align_fp; } u2; void reset () { int i; for (i = 0; i < MAX_LENGTH2; i++) u2.buf[i] = 'a'; } void check (int off, int len, int ch) { char *q; int i; q = u2.buf; for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); for (i = 0; i < len; i++, q++) if (*q != ch) abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); } void __attribute__((noinline)) test5 (void) { int off; char *p; /* len == 1 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 1); if (p != u2.buf + off) abort (); check (off, 1, '\0'); p = memset (u2.buf + off, A, 1); if (p != u2.buf + off) abort (); check (off, 1, 'A'); p = memset (u2.buf + off, 'B', 1); if (p != u2.buf + off) abort (); check (off, 1, 'B'); } /* len == 2 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 2); if (p != u2.buf + off) abort (); check (off, 2, '\0'); p = memset (u2.buf + off, A, 2); if (p != u2.buf + off) abort (); check (off, 2, 'A'); p = memset (u2.buf + off, 'B', 2); if (p != u2.buf + off) abort (); check (off, 2, 'B'); } /* len == 3 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 3); if (p != u2.buf + off) abort (); check (off, 3, '\0'); p = memset (u2.buf + off, A, 3); if (p != u2.buf + off) abort (); check (off, 3, 'A'); p = memset (u2.buf + off, 'B', 3); if (p != u2.buf + off) abort (); check (off, 3, 'B'); } /* len == 4 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 4); if (p != u2.buf + off) abort (); check (off, 4, '\0'); p = memset (u2.buf + off, A, 4); if (p != u2.buf + off) abort (); check (off, 4, 'A'); p = memset (u2.buf + off, 'B', 4); if (p != u2.buf + off) abort (); check (off, 4, 'B'); } /* len == 5 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 5); if (p != u2.buf + off) abort (); check (off, 5, '\0'); p = memset (u2.buf + off, A, 5); if (p != u2.buf + off) abort (); check (off, 5, 'A'); p = memset (u2.buf + off, 'B', 5); if (p != u2.buf + off) abort (); check (off, 5, 'B'); } /* len == 6 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 6); if (p != u2.buf + off) abort (); check (off, 6, '\0'); p = memset (u2.buf + off, A, 6); if (p != u2.buf + off) abort (); check (off, 6, 'A'); p = memset (u2.buf + off, 'B', 6); if (p != u2.buf + off) abort (); check (off, 6, 'B'); } /* len == 7 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 7); if (p != u2.buf + off) abort (); check (off, 7, '\0'); p = memset (u2.buf + off, A, 7); if (p != u2.buf + off) abort (); check (off, 7, 'A'); p = memset (u2.buf + off, 'B', 7); if (p != u2.buf + off) abort (); check (off, 7, 'B'); } /* len == 8 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 8); if (p != u2.buf + off) abort (); check (off, 8, '\0'); p = memset (u2.buf + off, A, 8); if (p != u2.buf + off) abort (); check (off, 8, 'A'); p = memset (u2.buf + off, 'B', 8); if (p != u2.buf + off) abort (); check (off, 8, 'B'); } /* len == 9 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 9); if (p != u2.buf + off) abort (); check (off, 9, '\0'); p = memset (u2.buf + off, A, 9); if (p != u2.buf + off) abort (); check (off, 9, 'A'); p = memset (u2.buf + off, 'B', 9); if (p != u2.buf + off) abort (); check (off, 9, 'B'); } /* len == 10 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 10); if (p != u2.buf + off) abort (); check (off, 10, '\0'); p = memset (u2.buf + off, A, 10); if (p != u2.buf + off) abort (); check (off, 10, 'A'); p = memset (u2.buf + off, 'B', 10); if (p != u2.buf + off) abort (); check (off, 10, 'B'); } /* len == 11 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 11); if (p != u2.buf + off) abort (); check (off, 11, '\0'); p = memset (u2.buf + off, A, 11); if (p != u2.buf + off) abort (); check (off, 11, 'A'); p = memset (u2.buf + off, 'B', 11); if (p != u2.buf + off) abort (); check (off, 11, 'B'); } /* len == 12 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 12); if (p != u2.buf + off) abort (); check (off, 12, '\0'); p = memset (u2.buf + off, A, 12); if (p != u2.buf + off) abort (); check (off, 12, 'A'); p = memset (u2.buf + off, 'B', 12); if (p != u2.buf + off) abort (); check (off, 12, 'B'); } /* len == 13 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 13); if (p != u2.buf + off) abort (); check (off, 13, '\0'); p = memset (u2.buf + off, A, 13); if (p != u2.buf + off) abort (); check (off, 13, 'A'); p = memset (u2.buf + off, 'B', 13); if (p != u2.buf + off) abort (); check (off, 13, 'B'); } /* len == 14 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 14); if (p != u2.buf + off) abort (); check (off, 14, '\0'); p = memset (u2.buf + off, A, 14); if (p != u2.buf + off) abort (); check (off, 14, 'A'); p = memset (u2.buf + off, 'B', 14); if (p != u2.buf + off) abort (); check (off, 14, 'B'); } /* len == 15 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u2.buf + off, '\0', 15); if (p != u2.buf + off) abort (); check (off, 15, '\0'); p = memset (u2.buf + off, A, 15); if (p != u2.buf + off) abort (); check (off, 15, 'A'); p = memset (u2.buf + off, 'B', 15); if (p != u2.buf + off) abort (); check (off, 15, 'B'); } } void __attribute__((noinline)) test6 (void) { int len; char *p; /* off == 0 */ for (len = 0; len < MAX_COPY2; len++) { reset (); p = memset (u2.buf, '\0', len); if (p != u2.buf) abort (); check (0, len, '\0'); p = memset (u2.buf, A, len); if (p != u2.buf) abort (); check (0, len, 'A'); p = memset (u2.buf, 'B', len); if (p != u2.buf) abort (); check (0, len, 'B'); } /* off == 1 */ for (len = 0; len < MAX_COPY2; len++) { reset (); p = memset (u2.buf+1, '\0', len); if (p != u2.buf+1) abort (); check (1, len, '\0'); p = memset (u2.buf+1, A, len); if (p != u2.buf+1) abort (); check (1, len, 'A'); p = memset (u2.buf+1, 'B', len); if (p != u2.buf+1) abort (); check (1, len, 'B'); } /* off == 2 */ for (len = 0; len < MAX_COPY2; len++) { reset (); p = memset (u2.buf+2, '\0', len); if (p != u2.buf+2) abort (); check (2, len, '\0'); p = memset (u2.buf+2, A, len); if (p != u2.buf+2) abort (); check (2, len, 'A'); p = memset (u2.buf+2, 'B', len); if (p != u2.buf+2) abort (); check (2, len, 'B'); } /* off == 3 */ for (len = 0; len < MAX_COPY2; len++) { reset (); p = memset (u2.buf+3, '\0', len); if (p != u2.buf+3) abort (); check (3, len, '\0'); p = memset (u2.buf+3, A, len); if (p != u2.buf+3) abort (); check (3, len, 'A'); p = memset (u2.buf+3, 'B', len); if (p != u2.buf+3) abort (); check (3, len, 'B'); } /* off == 4 */ for (len = 0; len < MAX_COPY2; len++) { reset (); p = memset (u2.buf+4, '\0', len); if (p != u2.buf+4) abort (); check (4, len, '\0'); p = memset (u2.buf+4, A, len); if (p != u2.buf+4) abort (); check (4, len, 'A'); p = memset (u2.buf+4, 'B', len); if (p != u2.buf+4) abort (); check (4, len, 'B'); } /* off == 5 */ for (len = 0; len < MAX_COPY2; len++) { reset (); p = memset (u2.buf+5, '\0', len); if (p != u2.buf+5) abort (); check (5, len, '\0'); p = memset (u2.buf+5, A, len); if (p != u2.buf+5) abort (); check (5, len, 'A'); p = memset (u2.buf+5, 'B', len); if (p != u2.buf+5) abort (); check (5, len, 'B'); } /* off == 6 */ for (len = 0; len < MAX_COPY2; len++) { reset (); p = memset (u2.buf+6, '\0', len); if (p != u2.buf+6) abort (); check (6, len, '\0'); p = memset (u2.buf+6, A, len); if (p != u2.buf+6) abort (); check (6, len, 'A'); p = memset (u2.buf+6, 'B', len); if (p != u2.buf+6) abort (); check (6, len, 'B'); } /* off == 7 */ for (len = 0; len < MAX_COPY2; len++) { reset (); p = memset (u2.buf+7, '\0', len); if (p != u2.buf+7) abort (); check (7, len, '\0'); p = memset (u2.buf+7, A, len); if (p != u2.buf+7) abort (); check (7, len, 'A'); p = memset (u2.buf+7, 'B', len); if (p != u2.buf+7) abort (); check (7, len, 'B'); } } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (l1) : "0" (l1)); s4 = buffer; test1 (); test2 (); test3 (); test4 (); test5 (); test6 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memset-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test3 struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memset-lib.c ================================================ #include "lib/memset.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/memset.c ================================================ /* Copyright (C) 2002, 2003 Free Software Foundation. Ensure that builtin memset operations for constant length and non-constant assigned value don't cause compiler problems. Written by Roger Sayle, 21 April 2002. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern void *memset (void *, int, size_t); char buffer[32]; int argc = 1; void main_test (void) { memset (buffer, argc, 0); memset (buffer, argc, 1); memset (buffer, argc, 2); memset (buffer, argc, 3); memset (buffer, argc, 4); memset (buffer, argc, 5); memset (buffer, argc, 6); memset (buffer, argc, 7); memset (buffer, argc, 8); memset (buffer, argc, 9); memset (buffer, argc, 10); memset (buffer, argc, 11); memset (buffer, argc, 12); memset (buffer, argc, 13); memset (buffer, argc, 14); memset (buffer, argc, 15); memset (buffer, argc, 16); memset (buffer, argc, 17); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/pr22237-lib.c ================================================ extern void abort (void); void * memcpy (void *dst, const void *src, __SIZE_TYPE__ n) { const char *srcp; char *dstp; srcp = src; dstp = dst; if (dst < src) { if (dst + n > src) abort (); } else { if (src + n > dst) abort (); } while (n-- != 0) *dstp++ = *srcp++; return dst; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/pr22237.c ================================================ extern void abort (void); extern void exit (int); struct s { unsigned char a[256]; }; union u { struct { struct s b; int c; } d; struct { int c; struct s b; } e; }; static union u v; static union u v0; static struct s *p = &v.d.b; static struct s *q = &v.e.b; static inline struct s rp (void) { return *p; } static inline struct s rq (void) { return *q; } static void pq (void) { *p = rq(); } static void qp (void) { *q = rp(); } static void init (struct s *sp) { int i; for (i = 0; i < 256; i++) sp->a[i] = i; } static void check (struct s *sp) { int i; for (i = 0; i < 256; i++) if (sp->a[i] != i) abort (); } void main_test (void) { v = v0; init (p); qp (); check (q); v = v0; init (q); pq (); check (p); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/pr23484-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/pr23484-chk.c ================================================ /* PR middle-end/23484 */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen (const char *); extern void *memcpy (void *, const void *, size_t); extern void *mempcpy (void *, const void *, size_t); extern void *memmove (void *, const void *, size_t); extern int snprintf (char *, size_t, const char *, ...); extern int memcmp (const void *, const void *, size_t); #include "chk.h" static char data[8] = "ABCDEFG"; int l1; void __attribute__((noinline)) test1 (void) { char buf[8]; /* All the checking calls in this routine have a maximum length, so object size checking should be done at compile time if optimizing. */ chk_calls = 0; memset (buf, 'I', sizeof (buf)); if (memcpy (buf, data, l1 ? sizeof (buf) : 4) != buf || memcmp (buf, "ABCDIIII", 8)) abort (); memset (buf, 'J', sizeof (buf)); if (mempcpy (buf, data, l1 ? sizeof (buf) : 4) != buf + 4 || memcmp (buf, "ABCDJJJJ", 8)) abort (); memset (buf, 'K', sizeof (buf)); if (memmove (buf, data, l1 ? sizeof (buf) : 4) != buf || memcmp (buf, "ABCDKKKK", 8)) abort (); memset (buf, 'L', sizeof (buf)); #if(__SIZEOF_INT__ >= 4) if (snprintf (buf, l1 ? sizeof (buf) : 4, "%d", l1 + 65536) != 5 || memcmp (buf, "655\0LLLL", 8)) abort (); #else if (snprintf (buf, l1 ? sizeof (buf) : 4, "%d", l1 + 32700) != 5 || memcmp (buf, "327\0LLLL", 8)) abort (); #endif if (chk_calls) abort (); } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (l1) : "0" (l1)); test1 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/pr23484-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/printf-lib.c ================================================ #include "lib/printf.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/printf.c ================================================ /* Copyright (C) 2000 Free Software Foundation. Ensure all expected transformations of builtin printf occur and that we honor side effects in the arguments. Written by Kaveh R. Ghazi, 12/4/2000. */ extern int printf (const char *, ...); extern int printf_unlocked (const char *, ...); extern void abort(void); void main_test (void) { const char *const s1 = "hello world"; const char *const s2[] = { s1, 0 }, *const*s3; printf ("%s\n", "hello"); printf ("%s\n", *s2); s3 = s2; printf ("%s\n", *s3++); if (s3 != s2+1 || *s3 != 0) abort(); printf ("%c", '\n'); printf ("%c", **s2); s3 = s2; printf ("%c", **s3++); if (s3 != s2+1 || *s3 != 0) abort(); printf (""); printf ("%s", ""); printf ("\n"); printf ("%s", "\n"); printf ("hello world\n"); printf ("%s", "hello world\n"); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ __builtin_printf ("%s\n", "hello"); /* These builtin stubs are called by __builtin_printf, ensure their prototypes are set correctly too. */ __builtin_putchar ('\n'); __builtin_puts ("hello"); /* Check the unlocked style, these evaluate to nothing to avoid problems on systems without the unlocked functions. */ printf_unlocked (""); __builtin_printf_unlocked (""); printf_unlocked ("%s", ""); __builtin_printf_unlocked ("%s", ""); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/snprintf-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/snprintf-chk.c ================================================ /* Copyright (C) 2004, 2005 Free Software Foundation. Ensure builtin __snprintf_chk performs correctly. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern char *strcpy (char *, const char *); extern int memcmp (const void *, const void *, size_t); extern void *memset (void *, int, size_t); extern int sprintf (char *, const char *, ...); extern int snprintf (char *, size_t, const char *, ...); #include "chk.h" const char s1[] = "123"; char p[32] = ""; char *s2 = "defg"; char *s3 = "FGH"; char *s4; size_t l1 = 1; static char buffer[32]; char * volatile ptr = "barf"; /* prevent constant propagation to happen when whole program assumptions are made. */ void __attribute__((noinline)) test1 (void) { chk_calls = 0; /* snprintf_disallowed = 1; */ memset (buffer, 'A', 32); snprintf (buffer, 4, "foo"); if (memcmp (buffer, "foo", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); if (snprintf (buffer, 4, "foo bar") != 7) abort (); if (memcmp (buffer, "foo", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); snprintf (buffer, 32, "%s", "bar"); if (memcmp (buffer, "bar", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); if (snprintf (buffer, 21, "%s", "bar") != 3) abort (); if (memcmp (buffer, "bar", 4) || buffer[4] != 'A') abort (); snprintf_disallowed = 0; memset (buffer, 'A', 32); if (snprintf (buffer, 4, "%d%d%d", (int) l1, (int) l1 + 1, (int) l1 + 12) != 4) abort (); if (memcmp (buffer, "121", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); if (snprintf (buffer, 32, "%d%d%d", (int) l1, (int) l1 + 1, (int) l1 + 12) != 4) abort (); if (memcmp (buffer, "1213", 5) || buffer[5] != 'A') abort (); if (chk_calls) abort (); memset (buffer, 'A', 32); snprintf (buffer, strlen (ptr) + 1, "%s", ptr); if (memcmp (buffer, "barf", 5) || buffer[5] != 'A') abort (); memset (buffer, 'A', 32); snprintf (buffer, l1 + 31, "%d - %c", (int) l1 + 27, *ptr); if (memcmp (buffer, "28 - b\0AAAAA", 12)) abort (); if (chk_calls != 2) abort (); chk_calls = 0; memset (s4, 'A', 32); snprintf (s4, l1 + 6, "%d - %c", (int) l1 - 17, ptr[1]); if (memcmp (s4, "-16 - \0AAA", 10)) abort (); if (chk_calls) abort (); } /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test2 (void) { struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int i; /* The following calls should do runtime checking - length is not known, but destination is. */ chk_calls = 0; snprintf (a.buf1 + 2, l1, "%s", s3 + 3); snprintf (r, l1 + 4, "%s%c", s3 + 3, s3[3]); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; snprintf (r, strlen (s2) - 2, "%c %s", s2[2], s2 + 4); snprintf (r + 2, l1, s3 + 3); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } snprintf (r, l1, s2 + 4); if (chk_calls != 5) abort (); /* Following have known destination and known source length, so if optimizing certainly shouldn't result in the checking variants. */ chk_calls = 0; /* snprintf_disallowed = 1; */ snprintf (a.buf1 + 2, 4, ""); snprintf (r, 1, "a"); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; snprintf (r, 3, "%s", s1 + 1); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } snprintf (r, 1, "%s", ""); snprintf (r, 0, "%s", ""); snprintf_disallowed = 0; /* Unknown destination and source, no checking. */ snprintf (s4, l1 + 31, "%s %d", s3, 0); if (chk_calls) abort (); } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test3 (void) { struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { snprintf (&a.buf2[9], l1 + 1, "%c%s", s2[3], s2 + 4); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { snprintf (&a.buf2[7], l1 + 30, "%s%c", s3 + strlen (s3) - 2, *s3); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { snprintf (&a.buf2[7], l1 + 3, "%d", (int) l1 + 9999); abort (); } /* This should be detectable at compile time already. */ if (__builtin_setjmp (chk_fail_buf) == 0) { snprintf (&buf3[19], 2, "a"); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { snprintf (&buf3[17], 4, "a"); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { snprintf (&buf3[17], 4, "%s", "abc"); abort (); } chk_fail_allowed = 0; } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (s2) : "0" (s2)); __asm ("" : "=r" (s3) : "0" (s3)); __asm ("" : "=r" (l1) : "0" (l1)); s4 = p; test1 (); test2 (); test3 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/snprintf-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test3 struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/sprintf-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/sprintf-chk.c ================================================ /* Copyright (C) 2004, 2005 Free Software Foundation. Ensure builtin __sprintf_chk performs correctly. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern char *strcpy (char *, const char *); extern int memcmp (const void *, const void *, size_t); extern void *memset (void *, int, size_t); extern int sprintf (char *, const char *, ...); #include "chk.h" LOCAL const char s1[] = "123"; char p[32] = ""; char *s2 = "defg"; char *s3 = "FGH"; char *s4; size_t l1 = 1; static char buffer[32]; char * volatile ptr = "barf"; /* prevent constant propagation to happen when whole program assumptions are made. */ void __attribute__((noinline)) test1 (void) { chk_calls = 0; sprintf_disallowed = 1; memset (buffer, 'A', 32); sprintf (buffer, "foo"); if (memcmp (buffer, "foo", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); if (sprintf (buffer, "foo") != 3) abort (); if (memcmp (buffer, "foo", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); sprintf (buffer, "%s", "bar"); if (memcmp (buffer, "bar", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); if (sprintf (buffer, "%s", "bar") != 3) abort (); if (memcmp (buffer, "bar", 4) || buffer[4] != 'A') abort (); if (chk_calls) abort (); sprintf_disallowed = 0; memset (buffer, 'A', 32); sprintf (buffer, "%s", ptr); if (memcmp (buffer, "barf", 5) || buffer[5] != 'A') abort (); memset (buffer, 'A', 32); sprintf (buffer, "%d - %c", (int) l1 + 27, *ptr); if (memcmp (buffer, "28 - b\0AAAAA", 12)) abort (); if (chk_calls != 2) abort (); chk_calls = 0; sprintf (s4, "%d - %c", (int) l1 - 17, ptr[1]); if (memcmp (s4, "-16 - a", 8)) abort (); if (chk_calls) abort (); } /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test2 (void) { struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int i; /* The following calls should do runtime checking - source length is not known, but destination is. */ chk_calls = 0; sprintf (a.buf1 + 2, "%s", s3 + 3); sprintf (r, "%s%c", s3 + 3, s3[3]); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; sprintf (r, "%c %s", s2[2], s2 + 4); sprintf (r + 2, s3 + 3); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } sprintf (r, s2 + 4); if (chk_calls != 5) abort (); /* Following have known destination and known source length, so if optimizing certainly shouldn't result in the checking variants. */ chk_calls = 0; sprintf_disallowed = 1; sprintf (a.buf1 + 2, ""); sprintf (r, "a"); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; sprintf (r, "%s", s1 + 1); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } sprintf (r, "%s", ""); sprintf_disallowed = 0; /* Unknown destination and source, no checking. */ sprintf (s4, "%s %d", s3, 0); if (chk_calls) abort (); } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test3 (void) { struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { sprintf (&a.buf2[9], "%c%s", s2[3], s2 + 4); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { sprintf (&a.buf2[7], "%s%c", s3 + strlen (s3) - 2, *s3); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { sprintf (&a.buf2[7], "%d", (int) l1 + 9999); abort (); } /* This should be detectable at compile time already. */ if (__builtin_setjmp (chk_fail_buf) == 0) { sprintf (&buf3[19], "a"); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { sprintf (&buf3[17], "%s", "abc"); abort (); } chk_fail_allowed = 0; } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (s2) : "0" (s2)); __asm ("" : "=r" (s3) : "0" (s3)); __asm ("" : "=r" (l1) : "0" (l1)); s4 = p; test1 (); test2 (); test3 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/sprintf-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test3 struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/sprintf-lib.c ================================================ #include "lib/sprintf.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/sprintf.c ================================================ /* Copyright (C) 2003 Free Software Foundation. Test sprintf optimizations don't break anything and return the correct results. Written by Roger Sayle, June 22, 2003. */ static char buffer[32]; extern void abort (); typedef __SIZE_TYPE__ size_t; extern int sprintf(char*, const char*, ...); extern void *memset(void*, int, size_t); extern int memcmp(const void*, const void*, size_t); void test1() { sprintf(buffer,"foo"); } int test2() { return sprintf(buffer,"foo"); } void test3() { sprintf(buffer,"%s","bar"); } int test4() { return sprintf(buffer,"%s","bar"); } void test5(char *ptr) { sprintf(buffer,"%s",ptr); } void main_test (void) { memset (buffer, 'A', 32); test1 (); if (memcmp(buffer, "foo", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); if (test2 () != 3) abort (); if (memcmp(buffer, "foo", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); test3 (); if (memcmp(buffer, "bar", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); if (test4 () != 3) abort (); if (memcmp(buffer, "bar", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); test5 ("barf"); if (memcmp(buffer, "barf", 5) || buffer[5] != 'A') abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/stpcpy-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/stpcpy-chk.c ================================================ /* Copyright (C) 2004, 2005 Free Software Foundation. Ensure builtin __stpcpy_chk performs correctly. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern char *stpcpy (char *, const char *); extern int memcmp (const void *, const void *, size_t); #include "chk.h" LOCAL const char s1[] = "123"; char p[32] = ""; char *s2 = "defg"; char *s3 = "FGH"; char *s4; size_t l1 = 1; void __attribute__((noinline)) test1 (void) { int i = 8; #if defined __i386__ || defined __x86_64__ /* The functions below might not be optimized into direct stores on all arches. It depends on how many instructions would be generated and what limits the architecture chooses in STORE_BY_PIECES_P. */ stpcpy_disallowed = 1; #endif if (stpcpy (p, "abcde") != p + 5 || memcmp (p, "abcde", 6)) abort (); if (stpcpy (p + 16, "vwxyz" + 1) != p + 16 + 4 || memcmp (p + 16, "wxyz", 5)) abort (); if (stpcpy (p + 1, "") != p + 1 + 0 || memcmp (p, "a\0cde", 6)) abort (); if (stpcpy (p + 3, "fghij") != p + 3 + 5 || memcmp (p, "a\0cfghij", 9)) abort (); if (stpcpy ((i++, p + 20 + 1), "23") != (p + 20 + 1 + 2) || i != 9 || memcmp (p + 19, "z\0""23\0", 5)) abort (); if (stpcpy (stpcpy (p, "ABCD"), "EFG") != p + 7 || memcmp (p, "ABCDEFG", 8)) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_stpcpy (p, "abcde") != p + 5 || memcmp (p, "abcde", 6)) abort (); /* If return value of stpcpy is ignored, it should be optimized into strcpy call. */ stpcpy_disallowed = 1; stpcpy (p + 1, "abcd"); stpcpy_disallowed = 0; if (memcmp (p, "aabcd", 6)) abort (); if (chk_calls) abort (); chk_calls = 0; strcpy_disallowed = 1; if (stpcpy (p, s2) != p + 4 || memcmp (p, "defg\0", 6)) abort (); strcpy_disallowed = 0; stpcpy_disallowed = 1; stpcpy (p + 2, s3); stpcpy_disallowed = 0; if (memcmp (p, "deFGH", 6)) abort (); if (chk_calls != 2) abort (); } #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_COPY #define MAX_COPY (10 * sizeof (long long)) #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + 1 + MAX_EXTRA) /* Use a sequence length that is not divisible by two, to make it more likely to detect when words are mixed up. */ #define SEQUENCE_LENGTH 31 static union { char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u1, u2; volatile char *vx; void __attribute__((noinline)) test2 (void) { int off1, off2, len, i; char *p, *q, c; for (off1 = 0; off1 < MAX_OFFSET; off1++) for (off2 = 0; off2 < MAX_OFFSET; off2++) for (len = 1; len < MAX_COPY; len++) { for (i = 0, c = 'A'; i < MAX_LENGTH; i++, c++) { u1.buf[i] = 'a'; if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; u2.buf[i] = c; } u2.buf[off2 + len] = '\0'; p = stpcpy (u1.buf + off1, u2.buf + off2); if (p != u1.buf + off1 + len) abort (); q = u1.buf; for (i = 0; i < off1; i++, q++) if (*q != 'a') abort (); for (i = 0, c = 'A' + off2; i < len; i++, q++, c++) { if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; if (*q != c) abort (); } if (*q++ != '\0') abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); } } /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test3 (void) { struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int i; const char *l; /* The following calls should do runtime checking - source length is not known, but destination is. */ chk_calls = 0; vx = stpcpy (a.buf1 + 2, s3 + 3); vx = stpcpy (r, s3 + 2); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; vx = stpcpy (r, s2 + 2); vx = stpcpy (r + 2, s3 + 3); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } vx = stpcpy (r, s2 + 4); if (chk_calls != 5) abort (); /* Following have known destination and known source length, so if optimizing certainly shouldn't result in the checking variants. */ chk_calls = 0; vx = stpcpy (a.buf1 + 2, ""); vx = stpcpy (r, "a"); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; vx = stpcpy (r, s1 + 1); r = buf3; l = "abc"; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1], l = "e"; else if (i == l1) r = &a.buf2[7], l = "gh"; else if (i == l1 + 1) r = &buf3[5], l = "jkl"; else if (i == l1 + 2) r = &a.buf1[9], l = ""; } vx = stpcpy (r, ""); /* Here, strlen (l) + 1 is known to be at most 4 and __builtin_object_size (&buf3[16], 0) is 4, so this doesn't need runtime checking. */ vx = stpcpy (&buf3[16], l); /* Unknown destination and source, no checking. */ vx = stpcpy (s4, s3); stpcpy (s4 + 4, s3); if (chk_calls) abort (); chk_calls = 0; } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test4 (void) { struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { vx = stpcpy (&a.buf2[9], s2 + 3); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { vx = stpcpy (&a.buf2[7], s3 + strlen (s3) - 3); abort (); } /* This should be detectable at compile time already. */ if (__builtin_setjmp (chk_fail_buf) == 0) { vx = stpcpy (&buf3[19], "a"); abort (); } chk_fail_allowed = 0; } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (s2) : "0" (s2)); __asm ("" : "=r" (s3) : "0" (s3)); __asm ("" : "=r" (l1) : "0" (l1)); test1 (); s4 = p; test2 (); test3 (); test4 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/stpcpy-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test4 struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/stpncpy-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/stpncpy-chk.c ================================================ /* Copyright (C) 2004, 2005, 2011 Free Software Foundation. Ensure builtin __stpncpy_chk performs correctly. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern char *stpncpy (char *, const char *, size_t); extern int memcmp (const void *, const void *, size_t); extern int strcmp (const char *, const char *); extern int strncmp (const char *, const char *, size_t); extern void *memset (void *, int, size_t); #include "chk.h" const char s1[] = "123"; char p[32] = ""; char * volatile s2 = "defg"; /* prevent constant propagation to happen when whole program assumptions are made. */ char * volatile s3 = "FGH"; /* prevent constant propagation to happen when whole program assumptions are made. */ char *s4; volatile size_t l1 = 1; /* prevent constant propagation to happen when whole program assumptions are made. */ int i; void __attribute__((noinline)) test1 (void) { const char *const src = "hello world"; const char *src2; char dst[64], *dst2; chk_calls = 0; memset (dst, 0, sizeof (dst)); if (stpncpy (dst, src, 4) != dst+4 || strncmp (dst, src, 4)) abort(); memset (dst, 0, sizeof (dst)); if (stpncpy (dst+16, src, 4) != dst+20 || strncmp (dst+16, src, 4)) abort(); memset (dst, 0, sizeof (dst)); if (stpncpy (dst+32, src+5, 4) != dst+36 || strncmp (dst+32, src+5, 4)) abort(); memset (dst, 0, sizeof (dst)); dst2 = dst; if (stpncpy (++dst2, src+5, 4) != dst+5 || strncmp (dst2, src+5, 4) || dst2 != dst+1) abort(); memset (dst, 0, sizeof (dst)); if (stpncpy (dst, src, 0) != dst || strcmp (dst, "")) abort(); memset (dst, 0, sizeof (dst)); dst2 = dst; src2 = src; if (stpncpy (++dst2, ++src2, 0) != dst+1 || strcmp (dst2, "") || dst2 != dst+1 || src2 != src+1) abort(); memset (dst, 0, sizeof (dst)); dst2 = dst; src2 = src; if (stpncpy (++dst2+5, ++src2+5, 0) != dst+6 || strcmp (dst2+5, "") || dst2 != dst+1 || src2 != src+1) abort(); memset (dst, 0, sizeof (dst)); if (stpncpy (dst, src, 12) != dst+11 || strcmp (dst, src)) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ memset (dst, 0, sizeof (dst)); if (__builtin_stpncpy (dst, src, 4) != dst+4 || strncmp (dst, src, 4)) abort(); memset (dst, 0, sizeof (dst)); if (stpncpy (dst, i++ ? "xfoo" + 1 : "bar", 4) != dst+3 || strcmp (dst, "bar") || i != 1) abort (); /* If return value of stpncpy is ignored, it should be optimized into stpncpy call. */ stpncpy_disallowed = 1; stpncpy (dst + 1, src, 4); stpncpy_disallowed = 0; if (strncmp (dst + 1, src, 4)) abort (); if (chk_calls) abort (); } void __attribute__((noinline)) test2 (void) { chk_calls = 0; /* No runtime checking should be done here, both destination and length are unknown. */ size_t cpy_length = l1 < 4 ? l1 + 1 : 4; if (stpncpy (s4, "abcd", l1 + 1) != s4 + cpy_length || strncmp (s4, "abcd", cpy_length)) abort (); if (chk_calls) abort (); } /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test3 (void) { struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int i; const char *l; size_t l2; /* The following calls should do runtime checking - source length is not known, but destination is. The returned value is checked so that stpncpy calls are not rewritten to strncpy calls. */ chk_calls = 0; if (!stpncpy (a.buf1 + 2, s3 + 3, l1)) abort(); if (!stpncpy (r, s3 + 2, l1 + 2)) abort(); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; if (!stpncpy (r, s2 + 2, l1 + 2)) abort(); if (!stpncpy (r + 2, s3 + 3, l1)) abort(); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } if (!stpncpy (r, s2 + 4, l1)) abort(); if (chk_calls != 5) abort (); /* Following have known destination and known length, so if optimizing certainly shouldn't result in the checking variants. */ chk_calls = 0; if (!stpncpy (a.buf1 + 2, "", 3)) abort (); if (!stpncpy (a.buf1 + 2, "", 0)) abort (); if (!stpncpy (r, "a", 1)) abort (); if (!stpncpy (r, "a", 3)) abort (); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; if (!stpncpy (r, s1 + 1, 3)) abort (); if (!stpncpy (r, s1 + 1, 2)) abort (); r = buf3; l = "abc"; l2 = 4; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1], l = "e", l2 = 2; else if (i == l1) r = &a.buf2[7], l = "gh", l2 = 3; else if (i == l1 + 1) r = &buf3[5], l = "jkl", l2 = 4; else if (i == l1 + 2) r = &a.buf1[9], l = "", l2 = 1; } if (!stpncpy (r, "", 1)) abort (); /* Here, strlen (l) + 1 is known to be at most 4 and __builtin_object_size (&buf3[16], 0) is 4, so this doesn't need runtime checking. */ if (!stpncpy (&buf3[16], l, l2)) abort (); if (!stpncpy (&buf3[15], "abc", l2)) abort (); if (!stpncpy (&buf3[10], "fghij", l2)) abort (); if (chk_calls) abort (); chk_calls = 0; } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test4 (void) { struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { if (stpncpy (&a.buf2[9], s2 + 4, l1 + 1)) // returned value used to prevent stpncpy calls // to be rewritten in strncpy calls i++; abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { if (stpncpy (&a.buf2[7], s3, l1 + 4)) i++; abort (); } /* This should be detectable at compile time already. */ if (__builtin_setjmp (chk_fail_buf) == 0) { if (stpncpy (&buf3[19], "abc", 2)) i++; abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { if (stpncpy (&buf3[18], "", 3)) i++; abort (); } chk_fail_allowed = 0; } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (s2) : "0" (s2)); __asm ("" : "=r" (s3) : "0" (s3)); __asm ("" : "=r" (l1) : "0" (l1)); test1 (); s4 = p; test2 (); test3 (); test4 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/stpncpy-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test4 struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcat-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcat-chk.c ================================================ /* Copyright (C) 2004, 2005 Free Software Foundation. Ensure builtin __strcat_chk performs correctly. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern char *strcat (char *, const char *); extern int memcmp (const void *, const void *, size_t); extern char *strcpy (char *, const char *); extern int strcmp (const char *, const char *); extern void *memset (void *, int, size_t); #define RESET_DST_WITH(FILLER) \ do { memset (dst, 'X', sizeof (dst)); strcpy (dst, (FILLER)); } while (0) #include "chk.h" const char s1[] = "123"; char p[32] = ""; char *s2 = "defg"; char *s3 = "FGH"; char *s4; size_t l1 = 1; char *s5; void __attribute__((noinline)) test1 (void) { const char *const x1 = "hello world"; const char *const x2 = ""; char dst[64], *d2; chk_calls = 0; strcat_disallowed = 1; /* Following strcat calls should be optimized out at compile time. */ RESET_DST_WITH (x1); if (strcat (dst, "") != dst || strcmp (dst, x1)) abort (); RESET_DST_WITH (x1); if (strcat (dst, x2) != dst || strcmp (dst, x1)) abort (); RESET_DST_WITH (x1); d2 = dst; if (strcat (++d2, x2) != dst+1 || d2 != dst+1 || strcmp (dst, x1)) abort (); RESET_DST_WITH (x1); d2 = dst; if (strcat (++d2+5, x2) != dst+6 || d2 != dst+1 || strcmp (dst, x1)) abort (); RESET_DST_WITH (x1); d2 = dst; if (strcat (++d2+5, x1+11) != dst+6 || d2 != dst+1 || strcmp (dst, x1)) abort (); if (chk_calls) abort (); strcat_disallowed = 0; RESET_DST_WITH (x1); if (strcat (dst, " 1111") != dst || memcmp (dst, "hello world 1111\0XXX", 20)) abort (); RESET_DST_WITH (x1); if (strcat (dst+5, " 2222") != dst+5 || memcmp (dst, "hello world 2222\0XXX", 20)) abort (); RESET_DST_WITH (x1); d2 = dst; if (strcat (++d2+5, " 3333") != dst+6 || d2 != dst+1 || memcmp (dst, "hello world 3333\0XXX", 20)) abort (); RESET_DST_WITH (x1); strcat (strcat (strcat (strcat (strcat (strcat (dst, ": this "), ""), "is "), "a "), "test"), "."); if (memcmp (dst, "hello world: this is a test.\0X", 30)) abort (); chk_calls = 0; strcat_disallowed = 1; /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ RESET_DST_WITH (x1); if (__builtin_strcat (dst, "") != dst || strcmp (dst, x1)) abort (); if (chk_calls) abort (); strcat_disallowed = 0; } /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test2 (void) { struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int i; /* The following calls should do runtime checking - source length is not known, but destination is. */ memset (&a, '\0', sizeof (a)); s5 = (char *) &a; __asm __volatile ("" : : "r" (s5) : "memory"); chk_calls = 0; strcat (a.buf1 + 2, s3 + 3); strcat (r, s3 + 2); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; memset (r, '\0', 3); __asm __volatile ("" : : "r" (r) : "memory"); strcat (r, s2 + 2); strcat (r + 2, s3 + 3); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } strcat (r, s2 + 4); if (chk_calls != 5) abort (); /* Following have known destination and known source length, but we don't know the length of dest string, so runtime checking is needed too. */ memset (&a, '\0', sizeof (a)); chk_calls = 0; s5 = (char *) &a; __asm __volatile ("" : : "r" (s5) : "memory"); strcat (a.buf1 + 2, "a"); strcat (r, ""); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; memset (r, '\0', 3); __asm __volatile ("" : : "r" (r) : "memory"); strcat (r, s1 + 1); if (chk_calls != 2) abort (); chk_calls = 0; /* Unknown destination and source, no checking. */ strcat (s4, s3); if (chk_calls) abort (); chk_calls = 0; } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test3 (void) { struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; memset (&a, '\0', sizeof (a)); memset (buf3, '\0', sizeof (buf3)); s5 = (char *) &a; __asm __volatile ("" : : "r" (s5) : "memory"); s5 = buf3; __asm __volatile ("" : : "r" (s5) : "memory"); chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { strcat (&a.buf2[9], s2 + 3); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { strcat (&a.buf2[7], s3 + strlen (s3) - 3); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { strcat (&buf3[19], "a"); abort (); } chk_fail_allowed = 0; } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (s2) : "0" (s2)); __asm ("" : "=r" (s3) : "0" (s3)); __asm ("" : "=r" (l1) : "0" (l1)); s4 = p; test1 (); memset (p, '\0', sizeof (p)); test2 (); test3 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcat-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test3 struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcat-lib.c ================================================ #include "lib/strcat.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcat.c ================================================ /* Copyright (C) 2000, 2003 Free Software Foundation. Ensure all expected transformations of builtin strcat occur and perform correctly. Written by Kaveh R. Ghazi, 11/27/2000. */ extern int inside_main; extern void abort (void); typedef __SIZE_TYPE__ size_t; extern char *strcat (char *, const char *); extern char *strcpy (char *, const char *); extern void *memset (void *, int, size_t); extern int memcmp (const void *, const void *, size_t); #define RESET_DST_WITH(FILLER) \ do { memset (dst, 'X', sizeof (dst)); strcpy (dst, (FILLER)); } while (0) void main_test (void) { const char *const s1 = "hello world"; const char *const s2 = ""; char dst[64], *d2; RESET_DST_WITH (s1); if (strcat (dst, "") != dst || memcmp (dst, "hello world\0XXX", 15)) abort(); RESET_DST_WITH (s1); if (strcat (dst, s2) != dst || memcmp (dst, "hello world\0XXX", 15)) abort(); RESET_DST_WITH (s1); d2 = dst; if (strcat (++d2, s2) != dst+1 || d2 != dst+1 || memcmp (dst, "hello world\0XXX", 15)) abort(); RESET_DST_WITH (s1); d2 = dst; if (strcat (++d2+5, s2) != dst+6 || d2 != dst+1 || memcmp (dst, "hello world\0XXX", 15)) abort(); RESET_DST_WITH (s1); d2 = dst; if (strcat (++d2+5, s1+11) != dst+6 || d2 != dst+1 || memcmp (dst, "hello world\0XXX", 15)) abort(); #ifndef __OPTIMIZE_SIZE__ # if !defined __i386__ && !defined __x86_64__ /* The functions below might not be optimized into direct stores on all arches. It depends on how many instructions would be generated and what limits the architecture chooses in STORE_BY_PIECES_P. */ inside_main = 0; # endif RESET_DST_WITH (s1); if (strcat (dst, " 1111") != dst || memcmp (dst, "hello world 1111\0XXX", 20)) abort(); RESET_DST_WITH (s1); if (strcat (dst+5, " 2222") != dst+5 || memcmp (dst, "hello world 2222\0XXX", 20)) abort(); RESET_DST_WITH (s1); d2 = dst; if (strcat (++d2+5, " 3333") != dst+6 || d2 != dst+1 || memcmp (dst, "hello world 3333\0XXX", 20)) abort(); RESET_DST_WITH (s1); strcat (strcat (strcat (strcat (strcat (strcat (dst, ": this "), ""), "is "), "a "), "test"), "."); if (memcmp (dst, "hello world: this is a test.\0X", 30)) abort(); /* Set inside_main again. */ inside_main = 1; #endif /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ RESET_DST_WITH (s1); if (__builtin_strcat (dst, "") != dst || memcmp (dst, "hello world\0XXX", 15)) abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strchr-lib.c ================================================ #include "lib/strchr.c" #ifdef __vxworks /* The RTP C library uses bzero, bfill and bcopy, all of which are defined in the same file as index. */ #include "lib/bzero.c" #include "lib/bfill.c" #include "lib/memmove.c" #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strchr.c ================================================ /* Copyright (C) 2000, 2003 Free Software Foundation. Ensure all expected transformations of builtin strchr and index occur and perform correctly. Written by Jakub Jelinek, 11/7/2000. */ extern void abort (void); extern char *strchr (const char *, int); extern char *index (const char *, int); void main_test (void) { const char *const foo = "hello world"; if (strchr (foo, 'x')) abort (); if (strchr (foo, 'o') != foo + 4) abort (); if (strchr (foo + 5, 'o') != foo + 7) abort (); if (strchr (foo, '\0') != foo + 11) abort (); /* Test only one instance of index since the code path is the same as that of strchr. */ if (index ("hello", 'z') != 0) abort (); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_strchr (foo, 'o') != foo + 4) abort (); if (__builtin_index (foo, 'o') != foo + 4) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcmp-lib.c ================================================ #include "lib/strcmp.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcmp.c ================================================ /* Copyright (C) 2000, 2003, 2004 Free Software Foundation. Ensure all expected transformations of builtin strcmp occur and perform correctly. Written by Jakub Jelinek, 11/7/2000. */ extern void abort (void); extern int strcmp (const char *, const char *); int x = 7; char *bar = "hi world"; void main_test (void) { const char *const foo = "hello world"; if (strcmp (foo, "hello") <= 0) abort (); if (strcmp (foo + 2, "llo") <= 0) abort (); if (strcmp (foo, foo) != 0) abort (); if (strcmp (foo, "hello world ") >= 0) abort (); if (strcmp (foo + 10, "dx") >= 0) abort (); if (strcmp (10 + foo, "dx") >= 0) abort (); if (strcmp (bar, "") <= 0) abort (); if (strcmp ("", bar) >= 0) abort (); if (strcmp (bar+8, "") != 0) abort (); if (strcmp ("", bar+8) != 0) abort (); if (strcmp (bar+(--x), "") <= 0 || x != 6) abort (); if (strcmp ("", bar+(++x)) >= 0 || x != 7) abort (); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_strcmp (foo, "hello") <= 0) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcpy-2-lib.c ================================================ #include "lib/strcpy.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcpy-2.c ================================================ /* Copyright (C) 2004 Free Software Foundation. Ensure builtin strcpy is optimized into memcpy even when there is more than one possible string literal passed to it, but all string literals passed to it have equal length. Written by Jakub Jelinek, 9/15/2004. */ extern void abort (void); extern char *strcpy (char *, const char *); typedef __SIZE_TYPE__ size_t; extern void *memcpy (void *, const void *, size_t); extern int memcmp (const void *, const void *, size_t); char buf[32], *p; int i; char * __attribute__((noinline)) test (void) { int j; const char *q = "abcdefg"; for (j = 0; j < 3; ++j) { if (j == i) q = "bcdefgh"; else if (j == i + 1) q = "cdefghi"; else if (j == i + 2) q = "defghij"; } p = strcpy (buf, q); return strcpy (buf + 16, q); } void main_test (void) { #ifndef __OPTIMIZE_SIZE__ /* For -Os, strcpy above is not replaced with memcpy (buf, q, 8);, as that is larger. */ if (test () != buf + 16 || p != buf) abort (); #endif } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcpy-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcpy-chk.c ================================================ /* Copyright (C) 2004, 2005 Free Software Foundation. Ensure builtin __strcpy_chk performs correctly. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern char *strcpy (char *, const char *); extern int memcmp (const void *, const void *, size_t); #include "chk.h" LOCAL const char s1[] = "123"; char p[32] = ""; char *s2 = "defg"; char *s3 = "FGH"; char *s4; size_t l1 = 1; void __attribute__((noinline)) test1 (void) { chk_calls = 0; #ifndef __OPTIMIZE_SIZE__ strcpy_disallowed = 1; #else strcpy_disallowed = 0; #endif if (strcpy (p, "abcde") != p || memcmp (p, "abcde", 6)) abort (); if (strcpy (p + 16, "vwxyz" + 1) != p + 16 || memcmp (p + 16, "wxyz", 5)) abort (); if (strcpy (p + 1, "") != p + 1 || memcmp (p, "a\0cde", 6)) abort (); if (strcpy (p + 3, "fghij") != p + 3 || memcmp (p, "a\0cfghij", 9)) abort (); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_strcpy (p, "abcde") != p || memcmp (p, "abcde", 6)) abort (); strcpy_disallowed = 0; if (chk_calls) abort (); } #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_COPY #define MAX_COPY (10 * sizeof (long long)) #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + 1 + MAX_EXTRA) /* Use a sequence length that is not divisible by two, to make it more likely to detect when words are mixed up. */ #define SEQUENCE_LENGTH 31 static union { char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u1, u2; void __attribute__((noinline)) test2 (void) { int off1, off2, len, i; char *p, *q, c; for (off1 = 0; off1 < MAX_OFFSET; off1++) for (off2 = 0; off2 < MAX_OFFSET; off2++) for (len = 1; len < MAX_COPY; len++) { for (i = 0, c = 'A'; i < MAX_LENGTH; i++, c++) { u1.buf[i] = 'a'; if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; u2.buf[i] = c; } u2.buf[off2 + len] = '\0'; p = strcpy (u1.buf + off1, u2.buf + off2); if (p != u1.buf + off1) abort (); q = u1.buf; for (i = 0; i < off1; i++, q++) if (*q != 'a') abort (); for (i = 0, c = 'A' + off2; i < len; i++, q++, c++) { if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; if (*q != c) abort (); } if (*q++ != '\0') abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); } } /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test3 (void) { struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int i; const char *l; /* The following calls should do runtime checking - source length is not known, but destination is. */ chk_calls = 0; strcpy (a.buf1 + 2, s3 + 3); strcpy (r, s3 + 2); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; strcpy (r, s2 + 2); strcpy (r + 2, s3 + 3); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } strcpy (r, s2 + 4); if (chk_calls != 5) abort (); /* Following have known destination and known source length, so if optimizing certainly shouldn't result in the checking variants. */ chk_calls = 0; strcpy (a.buf1 + 2, ""); strcpy (r, "a"); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; strcpy (r, s1 + 1); r = buf3; l = "abc"; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1], l = "e"; else if (i == l1) r = &a.buf2[7], l = "gh"; else if (i == l1 + 1) r = &buf3[5], l = "jkl"; else if (i == l1 + 2) r = &a.buf1[9], l = ""; } strcpy (r, ""); /* Here, strlen (l) + 1 is known to be at most 4 and __builtin_object_size (&buf3[16], 0) is 4, so this doesn't need runtime checking. */ strcpy (&buf3[16], l); /* Unknown destination and source, no checking. */ strcpy (s4, s3); if (chk_calls) abort (); chk_calls = 0; } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test4 (void) { struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { strcpy (&a.buf2[9], s2 + 3); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { strcpy (&a.buf2[7], s3 + strlen (s3) - 3); abort (); } /* This should be detectable at compile time already. */ if (__builtin_setjmp (chk_fail_buf) == 0) { strcpy (&buf3[19], "a"); abort (); } chk_fail_allowed = 0; } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (s2) : "0" (s2)); __asm ("" : "=r" (s3) : "0" (s3)); __asm ("" : "=r" (l1) : "0" (l1)); test1 (); test2 (); s4 = p; test3 (); test4 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcpy-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test4 struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcpy-lib.c ================================================ #include "lib/strcpy.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcpy.c ================================================ /* Copyright (C) 2000 Free Software Foundation. Ensure builtin memcpy and strcpy perform correctly. Written by Jakub Jelinek, 11/24/2000. */ extern void abort (void); extern char *strcpy (char *, const char *); typedef __SIZE_TYPE__ size_t; extern void *memcpy (void *, const void *, size_t); extern int memcmp (const void *, const void *, size_t); char p[32] = ""; void main_test (void) { if (strcpy (p, "abcde") != p || memcmp (p, "abcde", 6)) abort (); if (strcpy (p + 16, "vwxyz" + 1) != p + 16 || memcmp (p + 16, "wxyz", 5)) abort (); if (strcpy (p + 1, "") != p + 1 || memcmp (p, "a\0cde", 6)) abort (); if (strcpy (p + 3, "fghij") != p + 3 || memcmp (p, "a\0cfghij", 9)) abort (); if (memcpy (p, "ABCDE", 6) != p || memcmp (p, "ABCDE", 6)) abort (); if (memcpy (p + 16, "VWX" + 1, 2) != p + 16 || memcmp (p + 16, "WXyz", 5)) abort (); if (memcpy (p + 1, "", 1) != p + 1 || memcmp (p, "A\0CDE", 6)) abort (); if (memcpy (p + 3, "FGHI", 4) != p + 3 || memcmp (p, "A\0CFGHIj", 9)) abort (); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_strcpy (p, "abcde") != p || memcmp (p, "abcde", 6)) abort (); if (__builtin_memcpy (p, "ABCDE", 6) != p || memcmp (p, "ABCDE", 6)) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcspn-lib.c ================================================ #include "lib/strcspn.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strcspn.c ================================================ /* Copyright (C) 2000, 2004 Free Software Foundation. Ensure all expected transformations of builtin strcspn occur and perform correctly. Written by Kaveh R. Ghazi, 11/27/2000. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strcspn (const char *, const char *); extern char *strcpy (char *, const char *); void main_test (void) { const char *const s1 = "hello world"; char dst[64], *d2; if (strcspn (s1, "hello") != 0) abort(); if (strcspn (s1, "z") != 11) abort(); if (strcspn (s1+4, "z") != 7) abort(); if (strcspn (s1, "hello world") != 0) abort(); if (strcspn (s1, "") != 11) abort(); strcpy (dst, s1); if (strcspn (dst, "") != 11) abort(); strcpy (dst, s1); d2 = dst; if (strcspn (++d2, "") != 10 || d2 != dst+1) abort(); strcpy (dst, s1); d2 = dst; if (strcspn (++d2+5, "") != 5 || d2 != dst+1) abort(); if (strcspn ("", s1) != 0) abort(); strcpy (dst, s1); if (strcspn ("", dst) != 0) abort(); strcpy (dst, s1); d2 = dst; if (strcspn ("", ++d2) != 0 || d2 != dst+1) abort(); strcpy (dst, s1); d2 = dst; if (strcspn ("", ++d2+5) != 0 || d2 != dst+1) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_strcspn (s1, "z") != 11) abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-2-lib.c ================================================ #include "lib/strlen.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-2.c ================================================ /* Copyright (C) 2003 Free Software Foundation. Test strlen optimizations on conditional expressions. Written by Jakub Jelinek, June 23, 2003. */ typedef __SIZE_TYPE__ size_t; extern size_t strlen (const char *); extern char *strcpy (char *, const char *); extern int memcmp (const void *, const void *, size_t); extern void abort (void); extern int inside_main; size_t g, h, i, j, k, l; size_t foo (void) { if (l) abort (); return ++l; } void main_test (void) { if (strlen (i ? "foo" + 1 : j ? "bar" + 1 : "baz" + 1) != 2) abort (); if (strlen (g++ ? "foo" : "bar") != 3 || g != 1) abort (); if (strlen (h++ ? "xfoo" + 1 : "bar") != 3 || h != 1) abort (); if (strlen ((i++, "baz")) != 3 || i != 1) abort (); /* The following calls might not optimize strlen call away. */ inside_main = 0; if (strlen (j ? "foo" + k++ : "bar" + k++) != 3 || k != 1) abort (); if (strlen (foo () ? "foo" : "bar") != 3 || l != 1) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3-lib.c ================================================ #include "lib/strlen.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c ================================================ /* Copyright (C) 2004 Free Software Foundation. Test strlen on const variables initialized to string literals. Written by Jakub Jelinek, 9/14/2004. */ extern void abort (void); extern __SIZE_TYPE__ strlen (const char *); extern char *strcpy (char *, const char *); static const char bar[] = "Hello, World!"; static const char baz[] = "hello, world?"; static const char larger[20] = "short string"; extern int inside_main; int l1 = 1; int x = 6; void main_test(void) { #ifdef __OPTIMIZE__ const char *foo; int i; #endif if (strlen (bar) != 13) abort (); if (strlen (bar + 3) != 10) abort (); if (strlen (&bar[6]) != 7) abort (); if (strlen (bar + (x++ & 7)) != 7) abort (); if (x != 7) abort (); #ifdef __OPTIMIZE__ foo = bar; for (i = 0; i < 4; ++i) { if (i == l1 - 1) foo = "HELLO, WORLD!"; else if (i == l1) foo = bar; else if (i == l1 + 1) foo = "hello, world!"; else foo = baz; } if (strlen (foo) != 13) abort (); #endif if (strlen (larger) != 12) abort (); if (strlen (&larger[10]) != 2) abort (); inside_main = 0; /* This will result in strlen call, because larger array is bigger than its initializer. */ if (strlen (larger + (x++ & 7)) != 5) abort (); if (x != 8) abort (); inside_main = 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-lib.c ================================================ #include "lib/strlen.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strlen.c ================================================ /* Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation. Ensure all expected transformations of builtin strlen occur and perform correctly. Written by Jakub Jelinek, 11/7/2000. Additional tests written by Roger Sayle, 11/02/2001: Ensure all builtin strlen comparisons against zero are optimized and perform correctly. The multiple calls to strcpy are to prevent the potentially "pure" strlen calls from being removed by CSE. Modified by Ben Elliston, 2006-10-25: The multiple calls to strcpy that Roger mentions above are problematic on systems where strcpy is implemented using strlen (which this test overrides to call abort). So, rather than use strcpy, we perform the identical operations using array indexing and char assignments. */ extern void abort (void); extern __SIZE_TYPE__ strlen (const char *); extern char *strcpy (char *, const char *); int x = 6; void main_test(void) { const char *const foo = "hello world"; char str[8]; char *ptr; if (strlen (foo) != 11) abort (); if (strlen (foo + 4) != 7) abort (); if (strlen (foo + (x++ & 7)) != 5) abort (); if (x != 7) abort (); ptr = str; ptr[0] = 'n'; ptr[1] = 't'; ptr[2] = 's'; ptr[3] = '\0'; if (strlen (ptr) == 0) abort (); ptr[0] = 'n'; ptr[1] = 't'; ptr[2] = 's'; ptr[3] = '\0'; if (strlen (ptr) < 1) abort (); ptr[0] = 'n'; ptr[1] = 't'; ptr[2] = 's'; ptr[3] = '\0'; if (strlen (ptr) <= 0) abort (); ptr[0] = 'n'; ptr[1] = 't'; ptr[2] = 's'; ptr[3] = '\0'; if (strlen (ptr+3) != 0) abort (); ptr[0] = 'n'; ptr[1] = 't'; ptr[2] = 's'; ptr[3] = '\0'; if (strlen (ptr+3) > 0) abort (); ptr[0] = 'n'; ptr[1] = 't'; ptr[2] = 's'; ptr[3] = '\0'; if (strlen (str+3) >= 1) abort (); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_strlen (foo) != 11) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncat-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncat-chk.c ================================================ /* Copyright (C) 2004, 2005 Free Software Foundation. Ensure builtin __strncat_chk performs correctly. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen (const char *); extern void *memcpy (void *, const void *, size_t); extern char *strcat (char *, const char *); extern char *strncat (char *, const char *, size_t); extern int memcmp (const void *, const void *, size_t); extern char *strcpy (char *, const char *); extern int strcmp (const char *, const char *); extern void *memset (void *, int, size_t); #include "chk.h" const char s1[] = "123"; char p[32] = ""; char *s2 = "defg"; char *s3 = "FGH"; char *s4; size_t l1 = 1; char *s5; int x = 123; void __attribute__((noinline)) test1 (void) { const char *const s1 = "hello world"; const char *const s2 = ""; const char *s3; char dst[64], *d2; /* Following strncat calls should be all optimized out. */ chk_calls = 0; strncat_disallowed = 1; strcat_disallowed = 1; strcpy (dst, s1); if (strncat (dst, "", 100) != dst || strcmp (dst, s1)) abort (); strcpy (dst, s1); if (strncat (dst, s2, 100) != dst || strcmp (dst, s1)) abort (); strcpy (dst, s1); d2 = dst; if (strncat (++d2, s2, 100) != dst+1 || d2 != dst+1 || strcmp (dst, s1)) abort (); strcpy (dst, s1); d2 = dst; if (strncat (++d2+5, s2, 100) != dst+6 || d2 != dst+1 || strcmp (dst, s1)) abort (); strcpy (dst, s1); d2 = dst; if (strncat (++d2+5, s1+11, 100) != dst+6 || d2 != dst+1 || strcmp (dst, s1)) abort (); strcpy (dst, s1); d2 = dst; if (strncat (++d2+5, s1, 0) != dst+6 || d2 != dst+1 || strcmp (dst, s1)) abort (); strcpy (dst, s1); d2 = dst; s3 = s1; if (strncat (++d2+5, ++s3, 0) != dst+6 || d2 != dst+1 || strcmp (dst, s1) || s3 != s1 + 1) abort (); strcpy (dst, s1); d2 = dst; if (strncat (++d2+5, "", ++x) != dst+6 || d2 != dst+1 || x != 124 || strcmp (dst, s1)) abort (); if (chk_calls) abort (); strcat_disallowed = 0; /* These __strncat_chk calls should be optimized into __strcat_chk, as strlen (src) <= len. */ strcpy (dst, s1); if (strncat (dst, "foo", 3) != dst || strcmp (dst, "hello worldfoo")) abort (); strcpy (dst, s1); if (strncat (dst, "foo", 100) != dst || strcmp (dst, "hello worldfoo")) abort (); strcpy (dst, s1); if (strncat (dst, s1, 100) != dst || strcmp (dst, "hello worldhello world")) abort (); if (chk_calls != 3) abort (); chk_calls = 0; /* The following calls have side-effects in dest, so are not checked. */ strcpy (dst, s1); d2 = dst; if (__builtin___strncat_chk (++d2, s1, 100, os (++d2)) != dst+1 || d2 != dst+1 || strcmp (dst, "hello worldhello world")) abort (); strcpy (dst, s1); d2 = dst; if (__builtin___strncat_chk (++d2+5, s1, 100, os (++d2+5)) != dst+6 || d2 != dst+1 || strcmp (dst, "hello worldhello world")) abort (); strcpy (dst, s1); d2 = dst; if (__builtin___strncat_chk (++d2+5, s1+5, 100, os (++d2+5)) != dst+6 || d2 != dst+1 || strcmp (dst, "hello world world")) abort (); if (chk_calls) abort (); chk_calls = 0; strcat_disallowed = 1; /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ strcpy (dst, s1); if (__builtin_strncat (dst, "", 100) != dst || strcmp (dst, s1)) abort (); if (chk_calls) abort (); strncat_disallowed = 0; strcat_disallowed = 0; } /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test2 (void) { struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int i; /* The following calls should do runtime checking. */ memset (&a, '\0', sizeof (a)); s5 = (char *) &a; __asm __volatile ("" : : "r" (s5) : "memory"); chk_calls = 0; strncat (a.buf1 + 2, s3 + 3, l1 - 1); strncat (r, s3 + 2, l1); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; memset (r, '\0', 3); __asm __volatile ("" : : "r" (r) : "memory"); strncat (r, s2 + 2, l1 + 1); strncat (r + 2, s3 + 3, l1 - 1); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } strncat (r, s2 + 4, l1); if (chk_calls != 5) abort (); /* Following have known destination and known source length, but we don't know the length of dest string, so runtime checking is needed too. */ memset (&a, '\0', sizeof (a)); chk_calls = 0; s5 = (char *) &a; __asm __volatile ("" : : "r" (s5) : "memory"); strncat (a.buf1 + 2, "a", 5); strncat (r, "def", 0); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; memset (r, '\0', 3); __asm __volatile ("" : : "r" (r) : "memory"); strncat (r, s1 + 1, 2); if (chk_calls != 2) abort (); chk_calls = 0; strcat_disallowed = 1; /* Unknown destination and source, no checking. */ strncat (s4, s3, l1 + 1); strcat_disallowed = 0; if (chk_calls) abort (); } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test3 (void) { struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; memset (&a, '\0', sizeof (a)); memset (buf3, '\0', sizeof (buf3)); s5 = (char *) &a; __asm __volatile ("" : : "r" (s5) : "memory"); s5 = buf3; __asm __volatile ("" : : "r" (s5) : "memory"); chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { strncat (&a.buf2[9], s2 + 3, 4); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { strncat (&a.buf2[7], s3 + strlen (s3) - 3, 3); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { strncat (&buf3[19], "abcde", 1); abort (); } chk_fail_allowed = 0; } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (s2) : "0" (s2)); __asm ("" : "=r" (s3) : "0" (s3)); __asm ("" : "=r" (l1) : "0" (l1)); s4 = p; test1 (); memset (p, '\0', sizeof (p)); test2 (); test3 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncat-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test3 struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncat-lib.c ================================================ #include "lib/strncat.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncat.c ================================================ /* Copyright (C) 2000, 2003 Free Software Foundation. Ensure all expected transformations of builtin strncat occur and perform correctly. Written by Kaveh R. Ghazi, 11/27/2000. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern char *strncat (char *, const char *, size_t); extern char *strcpy (char *, const char *); extern void *memset (void *, int, size_t); extern int memcmp (const void *, const void *, size_t); int x = 123; /* Reset the destination buffer to a known state. */ #define RESET_DST_WITH(FILLER) \ do { memset (dst, 'X', sizeof (dst)); strcpy (dst, (FILLER)); } while (0) void main_test (void) { const char *const s1 = "hello world"; const char *const s2 = ""; char dst[64], *d2; RESET_DST_WITH (s1); if (strncat (dst, "", 100) != dst || memcmp (dst, "hello world\0XXX", 15)) abort(); RESET_DST_WITH (s1); if (strncat (dst, s2, 100) != dst || memcmp (dst, "hello world\0XXX", 15)) abort(); RESET_DST_WITH (s1); d2 = dst; if (strncat (++d2, s2, 100) != dst+1 || d2 != dst+1 || memcmp (dst, "hello world\0XXX", 15)) abort(); RESET_DST_WITH (s1); d2 = dst; if (strncat (++d2+5, s2, 100) != dst+6 || d2 != dst+1 || memcmp (dst, "hello world\0XXX", 15)) abort(); RESET_DST_WITH (s1); d2 = dst; if (strncat (++d2+5, s1+11, 100) != dst+6 || d2 != dst+1 || memcmp (dst, "hello world\0XXX", 15)) abort(); RESET_DST_WITH (s1); d2 = dst; if (strncat (++d2+5, s1, 0) != dst+6 || d2 != dst+1 || memcmp (dst, "hello world\0XXX", 15)) abort(); RESET_DST_WITH (s1); d2 = dst; if (strncat (++d2+5, "", ++x) != dst+6 || d2 != dst+1 || x != 124 || memcmp (dst, "hello world\0XXX", 15)) abort(); RESET_DST_WITH (s1); if (strncat (dst, "foo", 3) != dst || memcmp (dst, "hello worldfoo\0XXX", 18)) abort(); RESET_DST_WITH (s1); if (strncat (dst, "foo", 100) != dst || memcmp (dst, "hello worldfoo\0XXX", 18)) abort(); RESET_DST_WITH (s1); if (strncat (dst, s1, 100) != dst || memcmp (dst, "hello worldhello world\0XXX", 26)) abort(); RESET_DST_WITH (s1); d2 = dst; if (strncat (++d2, s1, 100) != dst+1 || d2 != dst+1 || memcmp (dst, "hello worldhello world\0XXX", 26)) abort(); RESET_DST_WITH (s1); d2 = dst; if (strncat (++d2+5, s1, 100) != dst+6 || d2 != dst+1 || memcmp (dst, "hello worldhello world\0XXX", 26)) abort(); RESET_DST_WITH (s1); d2 = dst; if (strncat (++d2+5, s1+5, 100) != dst+6 || d2 != dst+1 || memcmp (dst, "hello world world\0XXX", 21)) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ RESET_DST_WITH (s1); if (__builtin_strncat (dst, "", 100) != dst || memcmp (dst, "hello world\0XXX", 15)) abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncmp-2-lib.c ================================================ #include "lib/strncmp.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncmp-2.c ================================================ /* Copyright (C) 2000, 2001, 2003, 2005 Free Software Foundation. Ensure all expected transformations of builtin strncmp occur and perform correctly. Written by Kaveh R. Ghazi, 11/26/2000. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern int strncmp (const char *, const char *, size_t); void main_test (void) { #if !defined(__OPTIMIZE__) || ((defined(__sh__) || defined(__i386__) || defined (__x86_64__)) && !defined(__OPTIMIZE_SIZE__)) /* These tests work on platforms which support cmpstrsi. We test it at -O0 on all platforms to ensure the strncmp logic is correct. */ const char *const s1 = "hello world"; const char *s2; int n = 6, x; s2 = s1; if (strncmp (++s2, "ello", 3) != 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp ("ello", ++s2, 3) != 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp (++s2, "ello", 4) != 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp ("ello", ++s2, 4) != 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp (++s2, "ello", 5) <= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp ("ello", ++s2, 5) >= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp (++s2, "ello", 6) <= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp ("ello", ++s2, 6) >= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp (++s2, "zllo", 3) >= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp ("zllo", ++s2, 3) <= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp (++s2, "zllo", 4) >= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp ("zllo", ++s2, 4) <= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp (++s2, "zllo", 5) >= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp ("zllo", ++s2, 5) <= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp (++s2, "zllo", 6) >= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp ("zllo", ++s2, 6) <= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp (++s2, "allo", 3) <= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp ("allo", ++s2, 3) >= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp (++s2, "allo", 4) <= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp ("allo", ++s2, 4) >= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp (++s2, "allo", 5) <= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp ("allo", ++s2, 5) >= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp (++s2, "allo", 6) <= 0 || s2 != s1+1) abort(); s2 = s1; if (strncmp ("allo", ++s2, 6) >= 0 || s2 != s1+1) abort(); s2 = s1; n = 2; x = 1; if (strncmp (++s2, s1+(x&3), ++n) != 0 || s2 != s1+1 || n != 3) abort(); s2 = s1; n = 2; x = 1; if (strncmp (s1+(x&3), ++s2, ++n) != 0 || s2 != s1+1 || n != 3) abort(); s2 = s1; n = 3; x = 1; if (strncmp (++s2, s1+(x&3), ++n) != 0 || s2 != s1+1 || n != 4) abort(); s2 = s1; n = 3; x = 1; if (strncmp (s1+(x&3), ++s2, ++n) != 0 || s2 != s1+1 || n != 4) abort(); s2 = s1; n = 4; x = 1; if (strncmp (++s2, s1+(x&3), ++n) != 0 || s2 != s1+1 || n != 5) abort(); s2 = s1; n = 4; x = 1; if (strncmp (s1+(x&3), ++s2, ++n) != 0 || s2 != s1+1 || n != 5) abort(); s2 = s1; n = 5; x = 1; if (strncmp (++s2, s1+(x&3), ++n) != 0 || s2 != s1+1 || n != 6) abort(); s2 = s1; n = 5; x = 1; if (strncmp (s1+(x&3), ++s2, ++n) != 0 || s2 != s1+1 || n != 6) abort(); s2 = s1; n = 2; if (strncmp (++s2, "zllo", ++n) >= 0 || s2 != s1+1 || n != 3) abort(); s2 = s1; n = 2; x = 1; if (strncmp ("zllo", ++s2, ++n) <= 0 || s2 != s1+1 || n != 3) abort(); s2 = s1; n = 3; x = 1; if (strncmp (++s2, "zllo", ++n) >= 0 || s2 != s1+1 || n != 4) abort(); s2 = s1; n = 3; x = 1; if (strncmp ("zllo", ++s2, ++n) <= 0 || s2 != s1+1 || n != 4) abort(); s2 = s1; n = 4; x = 1; if (strncmp (++s2, "zllo", ++n) >= 0 || s2 != s1+1 || n != 5) abort(); s2 = s1; n = 4; x = 1; if (strncmp ("zllo", ++s2, ++n) <= 0 || s2 != s1+1 || n != 5) abort(); s2 = s1; n = 5; x = 1; if (strncmp (++s2, "zllo", ++n) >= 0 || s2 != s1+1 || n != 6) abort(); s2 = s1; n = 5; x = 1; if (strncmp ("zllo", ++s2, ++n) <= 0 || s2 != s1+1 || n != 6) abort(); s2 = s1; n = 2; if (strncmp (++s2, "allo", ++n) <= 0 || s2 != s1+1 || n != 3) abort(); s2 = s1; n = 2; x = 1; if (strncmp ("allo", ++s2, ++n) >= 0 || s2 != s1+1 || n != 3) abort(); s2 = s1; n = 3; x = 1; if (strncmp (++s2, "allo", ++n) <= 0 || s2 != s1+1 || n != 4) abort(); s2 = s1; n = 3; x = 1; if (strncmp ("allo", ++s2, ++n) >= 0 || s2 != s1+1 || n != 4) abort(); s2 = s1; n = 4; x = 1; if (strncmp (++s2, "allo", ++n) <= 0 || s2 != s1+1 || n != 5) abort(); s2 = s1; n = 4; x = 1; if (strncmp ("allo", ++s2, ++n) >= 0 || s2 != s1+1 || n != 5) abort(); s2 = s1; n = 5; x = 1; if (strncmp (++s2, "allo", ++n) <= 0 || s2 != s1+1 || n != 6) abort(); s2 = s1; n = 5; x = 1; if (strncmp ("allo", ++s2, ++n) >= 0 || s2 != s1+1 || n != 6) abort(); #endif } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncmp-lib.c ================================================ #include "lib/strncmp.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncmp.c ================================================ /* Copyright (C) 2000, 2001, 2003 Free Software Foundation. Ensure all expected transformations of builtin strncmp occur and perform correctly. Written by Kaveh R. Ghazi, 11/26/2000. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern int strncmp (const char *, const char *, size_t); void main_test (void) { const char *const s1 = "hello world"; const char *s2, *s3; if (strncmp (s1, "hello world", 12) != 0) abort(); if (strncmp ("hello world", s1, 12) != 0) abort(); if (strncmp ("hello", "hello", 6) != 0) abort(); if (strncmp ("hello", "hello", 2) != 0) abort(); if (strncmp ("hello", "hello", 100) != 0) abort(); if (strncmp (s1+10, "d", 100) != 0) abort(); if (strncmp (10+s1, "d", 100) != 0) abort(); if (strncmp ("d", s1+10, 1) != 0) abort(); if (strncmp ("d", 10+s1, 1) != 0) abort(); if (strncmp ("hello", "aaaaa", 100) <= 0) abort(); if (strncmp ("aaaaa", "hello", 100) >= 0) abort(); if (strncmp ("hello", "aaaaa", 1) <= 0) abort(); if (strncmp ("aaaaa", "hello", 1) >= 0) abort(); s2 = s1; s3 = s1+4; if (strncmp (++s2, ++s3, 0) != 0 || s2 != s1+1 || s3 != s1+5) abort(); s2 = s1; if (strncmp (++s2, "", 1) <= 0 || s2 != s1+1) abort(); if (strncmp ("", ++s2, 1) >= 0 || s2 != s1+2) abort(); if (strncmp (++s2, "", 100) <= 0 || s2 != s1+3) abort(); if (strncmp ("", ++s2, 100) >= 0 || s2 != s1+4) abort(); if (strncmp (++s2+6, "", 100) != 0 || s2 != s1+5) abort(); if (strncmp ("", ++s2+5, 100) != 0 || s2 != s1+6) abort(); if (strncmp ("ozz", ++s2, 1) != 0 || s2 != s1+7) abort(); if (strncmp (++s2, "rzz", 1) != 0 || s2 != s1+8) abort(); s2 = s1; s3 = s1+4; if (strncmp (++s2, ++s3+2, 1) >= 0 || s2 != s1+1 || s3 != s1+5) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_strncmp ("hello", "a", 100) <= 0) abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncpy-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncpy-chk.c ================================================ /* Copyright (C) 2004, 2005 Free Software Foundation. Ensure builtin __strncpy_chk performs correctly. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern char *strncpy (char *, const char *, size_t); extern int memcmp (const void *, const void *, size_t); extern int strcmp (const char *, const char *); extern int strncmp (const char *, const char *, size_t); extern void *memset (void *, int, size_t); #include "chk.h" const char s1[] = "123"; char p[32] = ""; char * volatile s2 = "defg"; /* prevent constant propagation to happen when whole program assumptions are made. */ char * volatile s3 = "FGH"; /* prevent constant propagation to happen when whole program assumptions are made. */ char *s4; volatile size_t l1 = 1; /* prevent constant propagation to happen when whole program assumptions are made. */ int i; void __attribute__((noinline)) test1 (void) { const char *const src = "hello world"; const char *src2; char dst[64], *dst2; strncpy_disallowed = 1; chk_calls = 0; memset (dst, 0, sizeof (dst)); if (strncpy (dst, src, 4) != dst || strncmp (dst, src, 4)) abort(); memset (dst, 0, sizeof (dst)); if (strncpy (dst+16, src, 4) != dst+16 || strncmp (dst+16, src, 4)) abort(); memset (dst, 0, sizeof (dst)); if (strncpy (dst+32, src+5, 4) != dst+32 || strncmp (dst+32, src+5, 4)) abort(); memset (dst, 0, sizeof (dst)); dst2 = dst; if (strncpy (++dst2, src+5, 4) != dst+1 || strncmp (dst2, src+5, 4) || dst2 != dst+1) abort(); memset (dst, 0, sizeof (dst)); if (strncpy (dst, src, 0) != dst || strcmp (dst, "")) abort(); memset (dst, 0, sizeof (dst)); dst2 = dst; src2 = src; if (strncpy (++dst2, ++src2, 0) != dst+1 || strcmp (dst2, "") || dst2 != dst+1 || src2 != src+1) abort(); memset (dst, 0, sizeof (dst)); dst2 = dst; src2 = src; if (strncpy (++dst2+5, ++src2+5, 0) != dst+6 || strcmp (dst2+5, "") || dst2 != dst+1 || src2 != src+1) abort(); memset (dst, 0, sizeof (dst)); if (strncpy (dst, src, 12) != dst || strcmp (dst, src)) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ memset (dst, 0, sizeof (dst)); if (__builtin_strncpy (dst, src, 4) != dst || strncmp (dst, src, 4)) abort(); memset (dst, 0, sizeof (dst)); if (strncpy (dst, i++ ? "xfoo" + 1 : "bar", 4) != dst || strcmp (dst, "bar") || i != 1) abort (); if (chk_calls) abort (); strncpy_disallowed = 0; } void __attribute__((noinline)) test2 (void) { chk_calls = 0; /* No runtime checking should be done here, both destination and length are unknown. */ strncpy (s4, "abcd", l1 + 1); if (chk_calls) abort (); } /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test3 (void) { struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int i; const char *l; size_t l2; /* The following calls should do runtime checking - source length is not known, but destination is. */ chk_calls = 0; strncpy (a.buf1 + 2, s3 + 3, l1); strncpy (r, s3 + 2, l1 + 2); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; strncpy (r, s2 + 2, l1 + 2); strncpy (r + 2, s3 + 3, l1); r = buf3; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1]; else if (i == l1) r = &a.buf2[7]; else if (i == l1 + 1) r = &buf3[5]; else if (i == l1 + 2) r = &a.buf1[9]; } strncpy (r, s2 + 4, l1); if (chk_calls != 5) abort (); /* Following have known destination and known length, so if optimizing certainly shouldn't result in the checking variants. */ chk_calls = 0; strncpy (a.buf1 + 2, "", 3); strncpy (a.buf1 + 2, "", 0); strncpy (r, "a", 1); strncpy (r, "a", 3); r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; strncpy (r, s1 + 1, 3); strncpy (r, s1 + 1, 2); r = buf3; l = "abc"; l2 = 4; for (i = 0; i < 4; ++i) { if (i == l1 - 1) r = &a.buf1[1], l = "e", l2 = 2; else if (i == l1) r = &a.buf2[7], l = "gh", l2 = 3; else if (i == l1 + 1) r = &buf3[5], l = "jkl", l2 = 4; else if (i == l1 + 2) r = &a.buf1[9], l = "", l2 = 1; } strncpy (r, "", 1); /* Here, strlen (l) + 1 is known to be at most 4 and __builtin_object_size (&buf3[16], 0) is 4, so this doesn't need runtime checking. */ strncpy (&buf3[16], l, l2); strncpy (&buf3[15], "abc", l2); strncpy (&buf3[10], "fghij", l2); if (chk_calls) abort (); chk_calls = 0; } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test4 (void) { struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { strncpy (&a.buf2[9], s2 + 4, l1 + 1); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { strncpy (&a.buf2[7], s3, l1 + 4); abort (); } /* This should be detectable at compile time already. */ if (__builtin_setjmp (chk_fail_buf) == 0) { strncpy (&buf3[19], "abc", 2); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { strncpy (&buf3[18], "", 3); abort (); } chk_fail_allowed = 0; } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (s2) : "0" (s2)); __asm ("" : "=r" (s3) : "0" (s3)); __asm ("" : "=r" (l1) : "0" (l1)); test1 (); s4 = p; test2 (); test3 (); test4 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncpy-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test4 struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncpy-lib.c ================================================ #include "lib/strncpy.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strncpy.c ================================================ /* Copyright (C) 2000, 2005 Free Software Foundation. Ensure all expected transformations of builtin strncpy occur and perform correctly. Written by Kaveh R. Ghazi, 11/25/2000. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern char *strncpy (char *, const char *, size_t); extern int memcmp (const void *, const void *, size_t); extern void *memset (void *, int, size_t); /* Reset the destination buffer to a known state. */ #define RESET_DST memset(dst, 'X', sizeof(dst)) int i; void main_test (void) { const char *const src = "hello world"; const char *src2; char dst[64], *dst2; RESET_DST; if (strncpy (dst, src, 4) != dst || memcmp (dst, "hellXXX", 7)) abort(); RESET_DST; if (strncpy (dst+16, src, 4) != dst+16 || memcmp (dst+16, "hellXXX", 7)) abort(); RESET_DST; if (strncpy (dst+32, src+5, 4) != dst+32 || memcmp (dst+32, " worXXX", 7)) abort(); RESET_DST; dst2 = dst; if (strncpy (++dst2, src+5, 4) != dst+1 || memcmp (dst2, " worXXX", 7) || dst2 != dst+1) abort(); RESET_DST; if (strncpy (dst, src, 0) != dst || memcmp (dst, "XXX", 3)) abort(); RESET_DST; dst2 = dst; src2 = src; if (strncpy (++dst2, ++src2, 0) != dst+1 || memcmp (dst2, "XXX", 3) || dst2 != dst+1 || src2 != src+1) abort(); RESET_DST; dst2 = dst; src2 = src; if (strncpy (++dst2+5, ++src2+5, 0) != dst+6 || memcmp (dst2+5, "XXX", 3) || dst2 != dst+1 || src2 != src+1) abort(); RESET_DST; if (strncpy (dst, src, 12) != dst || memcmp (dst, "hello world\0XXX", 15)) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ RESET_DST; if (__builtin_strncpy (dst, src, 4) != dst || memcmp (dst, "hellXXX", 7)) abort(); RESET_DST; if (strncpy (dst, i++ ? "xfoo" + 1 : "bar", 4) != dst || memcmp (dst, "bar\0XXX", 7) || i != 1) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strpbrk-lib.c ================================================ #include "lib/strpbrk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strpbrk.c ================================================ /* Copyright (C) 2000 Free Software Foundation. Ensure all expected transformations of builtin strpbrk occur and perform correctly. Written by Kaveh R. Ghazi, 11/6/2000. */ extern void abort(void); extern char *strpbrk (const char *, const char *); extern int strcmp (const char *, const char *); void fn (const char *foo, const char *const *bar) { if (strcmp(strpbrk ("hello world", "lrooo"), "llo world") != 0) abort(); if (strpbrk (foo, "") != 0) abort(); if (strpbrk (foo + 4, "") != 0) abort(); if (strpbrk (*bar--, "") != 0) abort(); if (strpbrk (*bar, "h") != foo) abort(); if (strpbrk (foo, "h") != foo) abort(); if (strpbrk (foo, "w") != foo + 6) abort(); if (strpbrk (foo + 6, "o") != foo + 7) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_strpbrk (foo + 6, "o") != foo + 7) abort(); } void main_test (void) { const char *const foo[] = { "hello world", "bye bye world" }; fn (foo[0], foo + 1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strpcpy-2-lib.c ================================================ #include "lib/stpcpy.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strpcpy-2.c ================================================ /* Copyright (C) 2003 Free Software Foundation. Ensure that builtin stpcpy performs correctly. Written by Jakub Jelinek, 21/05/2003. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern int memcmp (const void *, const void *, size_t); extern char *stpcpy (char *, const char *); extern int inside_main; long buf1[64]; char *buf2 = (char *) (buf1 + 32); long buf5[20]; char buf7[20]; void __attribute__((noinline)) test (long *buf3, char *buf4, char *buf6, int n) { int i = 4; if (stpcpy ((char *) buf3, "abcdefghijklmnop") != (char *) buf1 + 16 || memcmp (buf1, "abcdefghijklmnop", 17)) abort (); if (__builtin_stpcpy ((char *) buf3, "ABCDEFG") != (char *) buf1 + 7 || memcmp (buf1, "ABCDEFG\0ijklmnop", 17)) abort (); if (stpcpy ((char *) buf3 + i++, "x") != (char *) buf1 + 5 || memcmp (buf1, "ABCDx\0G\0ijklmnop", 17)) abort (); } void main_test (void) { /* All these tests are allowed to call mempcpy/stpcpy. */ inside_main = 0; __builtin_memcpy (buf5, "RSTUVWXYZ0123456789", 20); __builtin_memcpy (buf7, "RSTUVWXYZ0123456789", 20); test (buf1, buf2, "rstuvwxyz", 0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strpcpy-lib.c ================================================ #include "lib/stpcpy.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strpcpy.c ================================================ /* Copyright (C) 2003, 2004 Free Software Foundation. Ensure builtin stpcpy performs correctly. Written by Kaveh Ghazi, 4/11/2003. */ typedef __SIZE_TYPE__ size_t; extern void abort (void); extern char *strcpy (char *, const char *); extern char *stpcpy (char *, const char *); extern int memcmp (const void *, const void *, size_t); extern int inside_main; const char s1[] = "123"; char p[32] = ""; char *s2 = "defg"; char *s3 = "FGH"; size_t l1 = 1; void main_test (void) { int i = 8; #if !defined __i386__ && !defined __x86_64__ /* The functions below might not be optimized into direct stores on all arches. It depends on how many instructions would be generated and what limits the architecture chooses in STORE_BY_PIECES_P. */ inside_main = 0; #endif if (stpcpy (p, "abcde") != p + 5 || memcmp (p, "abcde", 6)) abort (); if (stpcpy (p + 16, "vwxyz" + 1) != p + 16 + 4 || memcmp (p + 16, "wxyz", 5)) abort (); if (stpcpy (p + 1, "") != p + 1 + 0 || memcmp (p, "a\0cde", 6)) abort (); if (stpcpy (p + 3, "fghij") != p + 3 + 5 || memcmp (p, "a\0cfghij", 9)) abort (); if (stpcpy ((i++, p + 20 + 1), "23") != (p + 20 + 1 + 2) || i != 9 || memcmp (p + 19, "z\0""23\0", 5)) abort (); if (stpcpy (stpcpy (p, "ABCD"), "EFG") != p + 7 || memcmp (p, "ABCDEFG", 8)) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_stpcpy (p, "abcde") != p + 5 || memcmp (p, "abcde", 6)) abort (); /* If the result of stpcpy is ignored, gcc should use strcpy. This should be optimized always, so set inside_main again. */ inside_main = 1; stpcpy (p + 3, s3); if (memcmp (p, "abcFGH", 6)) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strrchr-lib.c ================================================ #include "lib/strrchr.c" #ifdef __vxworks /* The RTP C library uses bzero, bfill and bcopy, all of which are defined in the same file as rindex. */ #include "lib/bzero.c" #include "lib/bfill.c" #include "lib/memmove.c" #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strrchr.c ================================================ /* Copyright (C) 2000, 2003, 2004 Free Software Foundation. Ensure all expected transformations of builtin strrchr and rindex occur and perform correctly. Written by Jakub Jelinek, 11/7/2000. */ extern void abort (void); extern char *strrchr (const char *, int); extern char *rindex (const char *, int); char *bar = "hi world"; int x = 7; void main_test (void) { const char *const foo = "hello world"; if (strrchr (foo, 'x')) abort (); if (strrchr (foo, 'o') != foo + 7) abort (); if (strrchr (foo, 'e') != foo + 1) abort (); if (strrchr (foo + 3, 'e')) abort (); if (strrchr (foo, '\0') != foo + 11) abort (); if (strrchr (bar, '\0') != bar + 8) abort (); if (strrchr (bar + 4, '\0') != bar + 8) abort (); if (strrchr (bar + (x++ & 3), '\0') != bar + 8) abort (); if (x != 8) abort (); /* Test only one instance of rindex since the code path is the same as that of strrchr. */ if (rindex ("hello", 'z') != 0) abort (); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_strrchr (foo, 'o') != foo + 7) abort (); if (__builtin_rindex (foo, 'o') != foo + 7) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strspn-lib.c ================================================ #include "lib/strspn.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strspn.c ================================================ /* Copyright (C) 2000 Free Software Foundation. Ensure all expected transformations of builtin strspn occur and perform correctly. Written by Kaveh R. Ghazi, 11/27/2000. */ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strspn (const char *, const char *); extern char *strcpy (char *, const char *); void main_test (void) { const char *const s1 = "hello world"; char dst[64], *d2; if (strspn (s1, "hello") != 5) abort(); if (strspn (s1+4, "hello") != 1) abort(); if (strspn (s1, "z") != 0) abort(); if (strspn (s1, "hello world") != 11) abort(); if (strspn (s1, "") != 0) abort(); strcpy (dst, s1); if (strspn (dst, "") != 0) abort(); strcpy (dst, s1); d2 = dst; if (strspn (++d2, "") != 0 || d2 != dst+1) abort(); strcpy (dst, s1); d2 = dst; if (strspn (++d2+5, "") != 0 || d2 != dst+1) abort(); if (strspn ("", s1) != 0) abort(); strcpy (dst, s1); if (strspn ("", dst) != 0) abort(); strcpy (dst, s1); d2 = dst; if (strspn ("", ++d2) != 0 || d2 != dst+1) abort(); strcpy (dst, s1); d2 = dst; if (strspn ("", ++d2+5) != 0 || d2 != dst+1) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_strspn (s1, "hello") != 5) abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm-lib.c ================================================ extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern char *strchr(const char *, int); extern int strcmp(const char *, const char *); extern int strncmp(const char *, const char *, size_t); extern int inside_main; extern const char *p; __attribute__ ((used)) char * my_strstr (const char *s1, const char *s2) { const size_t len = strlen (s2); #ifdef __OPTIMIZE__ /* If optimizing, we should be called only in the strstr (foo + 2, p) case. All other cases should be optimized. */ if (inside_main) if (s2 != p || strcmp (s1, "hello world" + 2) != 0) abort (); #endif if (len == 0) return (char *) s1; for (s1 = strchr (s1, *s2); s1; s1 = strchr (s1 + 1, *s2)) if (strncmp (s1, s2, len) == 0) return (char *) s1; return (char *) 0; } char * strstr (const char *s1, const char *s2) { if (inside_main) abort (); return my_strstr (s1, s2); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.c ================================================ /* Copyright (C) 2000, 2003 Free Software Foundation. Ensure all expected transformations of builtin strstr occur and perform correctly in presence of redirect. */ #define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname) #define ASMNAME2(prefix, cname) STRING (prefix) cname #define STRING(x) #x typedef __SIZE_TYPE__ size_t; extern void abort (void); extern char *strstr (const char *, const char *) __asm (ASMNAME ("my_strstr")); const char *p = "rld", *q = "hello world"; void main_test (void) { const char *const foo = "hello world"; if (strstr (foo, "") != foo) abort (); if (strstr (foo + 4, "") != foo + 4) abort (); if (strstr (foo, "h") != foo) abort (); if (strstr (foo, "w") != foo + 6) abort (); if (strstr (foo + 6, "o") != foo + 7) abort (); if (strstr (foo + 1, "world") != foo + 6) abort (); if (strstr (foo + 2, p) != foo + 8) abort (); if (strstr (q, "") != q) abort (); if (strstr (q + 1, "o") != q + 4) abort (); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_strstr (foo + 1, "world") != foo + 6) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.x ================================================ # Different translation units may have different user name overrides # and we do not preserve enough context to known which one we want. set torture_eval_before_compile { if {[string match {*-flto*} "$option"]} { continue } } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-lib.c ================================================ #include "lib/strstr.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/strstr.c ================================================ /* Copyright (C) 2000 Free Software Foundation. Ensure all expected transformations of builtin strstr occur and perform correctly. Written by Kaveh R. Ghazi, 11/6/2000. */ extern void abort(void); extern char *strstr (const char *, const char *); void main_test (void) { const char *const foo = "hello world"; if (strstr (foo, "") != foo) abort(); if (strstr (foo + 4, "") != foo + 4) abort(); if (strstr (foo, "h") != foo) abort(); if (strstr (foo, "w") != foo + 6) abort(); if (strstr (foo + 6, "o") != foo + 7) abort(); if (strstr (foo + 1, "world") != foo + 6) abort(); /* Test at least one instance of the __builtin_ style. We do this to ensure that it works and that the prototype is correct. */ if (__builtin_strstr (foo + 1, "world") != foo + 6) abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/vsnprintf-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/vsnprintf-chk.c ================================================ /* Copyright (C) 2004, 2005 Free Software Foundation. Ensure builtin __vsnprintf_chk performs correctly. */ #include extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern char *strcpy (char *, const char *); extern int memcmp (const void *, const void *, size_t); extern void *memset (void *, int, size_t); extern int vsnprintf (char *, size_t, const char *, va_list); #include "chk.h" const char s1[] = "123"; char p[32] = ""; char *s2 = "defg"; char *s3 = "FGH"; char *s4; size_t l1 = 1; static char buffer[32]; char * volatile ptr = "barf"; /* prevent constant propagation to happen when whole program assumptions are made. */ int __attribute__((noinline)) test1_sub (int i, ...) { int ret = 0; va_list ap; va_start (ap, i); switch (i) { case 0: vsnprintf (buffer, 4, "foo", ap); break; case 1: ret = vsnprintf (buffer, 4, "foo bar", ap); break; case 2: vsnprintf (buffer, 32, "%s", ap); break; case 3: ret = vsnprintf (buffer, 21, "%s", ap); break; case 4: ret = vsnprintf (buffer, 4, "%d%d%d", ap); break; case 5: ret = vsnprintf (buffer, 32, "%d%d%d", ap); break; case 6: ret = vsnprintf (buffer, strlen (ptr) + 1, "%s", ap); break; case 7: vsnprintf (buffer, l1 + 31, "%d - %c", ap); break; case 8: vsnprintf (s4, l1 + 6, "%d - %c", ap); break; } va_end (ap); return ret; } void __attribute__((noinline)) test1 (void) { chk_calls = 0; /* vsnprintf_disallowed = 1; */ memset (buffer, 'A', 32); test1_sub (0); if (memcmp (buffer, "foo", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); if (test1_sub (1) != 7) abort (); if (memcmp (buffer, "foo", 4) || buffer[4] != 'A') abort (); vsnprintf_disallowed = 0; memset (buffer, 'A', 32); test1_sub (2, "bar"); if (memcmp (buffer, "bar", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); if (test1_sub (3, "bar") != 3) abort (); if (memcmp (buffer, "bar", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); if (test1_sub (4, (int) l1, (int) l1 + 1, (int) l1 + 12) != 4) abort (); if (memcmp (buffer, "121", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); if (test1_sub (5, (int) l1, (int) l1 + 1, (int) l1 + 12) != 4) abort (); if (memcmp (buffer, "1213", 5) || buffer[5] != 'A') abort (); if (chk_calls) abort (); memset (buffer, 'A', 32); test1_sub (6, ptr); if (memcmp (buffer, "barf", 5) || buffer[5] != 'A') abort (); memset (buffer, 'A', 32); test1_sub (7, (int) l1 + 27, *ptr); if (memcmp (buffer, "28 - b\0AAAAA", 12)) abort (); if (chk_calls != 2) abort (); chk_calls = 0; memset (s4, 'A', 32); test1_sub (8, (int) l1 - 17, ptr[1]); if (memcmp (s4, "-16 - \0AAA", 10)) abort (); if (chk_calls) abort (); } void __attribute__((noinline)) test2_sub (int i, ...) { va_list ap; struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int j; va_start (ap, i); /* The following calls should do runtime checking - length is not known, but destination is. */ switch (i) { case 0: vsnprintf (a.buf1 + 2, l1, "%s", ap); break; case 1: vsnprintf (r, l1 + 4, "%s%c", ap); break; case 2: r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; vsnprintf (r, strlen (s2) - 2, "%c %s", ap); break; case 3: r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; vsnprintf (r + 2, l1, s3 + 3, ap); break; case 4: case 7: r = buf3; for (j = 0; j < 4; ++j) { if (j == l1 - 1) r = &a.buf1[1]; else if (j == l1) r = &a.buf2[7]; else if (j == l1 + 1) r = &buf3[5]; else if (j == l1 + 2) r = &a.buf1[9]; } if (i == 4) vsnprintf (r, l1, s2 + 4, ap); else vsnprintf (r, 1, "a", ap); break; case 5: r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; vsnprintf (r, l1 + 3, "%s", ap); break; case 6: vsnprintf (a.buf1 + 2, 4, "", ap); break; case 8: vsnprintf (s4, 3, "%s %d", ap); break; } va_end (ap); } /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test2 (void) { /* The following calls should do runtime checking - length is not known, but destination is. */ chk_calls = 0; test2_sub (0, s3 + 3); test2_sub (1, s3 + 3, s3[3]); test2_sub (2, s2[2], s2 + 4); test2_sub (3); test2_sub (4); test2_sub (5, s1 + 1); if (chk_calls != 6) abort (); /* Following have known destination and known source length, so if optimizing certainly shouldn't result in the checking variants. */ chk_calls = 0; /* vsnprintf_disallowed = 1; */ test2_sub (6); test2_sub (7); vsnprintf_disallowed = 0; /* Unknown destination and source, no checking. */ test2_sub (8, s3, 0); if (chk_calls) abort (); } void __attribute__((noinline)) test3_sub (int i, ...) { va_list ap; struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; va_start (ap, i); /* The following calls should do runtime checking - source length is not known, but destination is. */ switch (i) { case 0: vsnprintf (&a.buf2[9], l1 + 1, "%c%s", ap); break; case 1: vsnprintf (&a.buf2[7], l1 + 30, "%s%c", ap); break; case 2: vsnprintf (&a.buf2[7], l1 + 3, "%d", ap); break; case 3: vsnprintf (&buf3[17], l1 + 3, "%s", ap); break; case 4: vsnprintf (&buf3[19], 2, "a", ap); break; case 5: vsnprintf (&buf3[16], 5, "a", ap); break; } va_end (ap); } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test3 (void) { chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { test3_sub (0, s2[3], s2 + 4); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { test3_sub (1, s3 + strlen (s3) - 2, *s3); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { test3_sub (2, (int) l1 + 9999); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { test3_sub (3, "abc"); abort (); } /* This should be detectable at compile time already. */ if (__builtin_setjmp (chk_fail_buf) == 0) { test3_sub (4); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { test3_sub (5); abort (); } chk_fail_allowed = 0; } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (s2) : "0" (s2)); __asm ("" : "=r" (s3) : "0" (s3)); __asm ("" : "=r" (l1) : "0" (l1)); s4 = p; test1 (); test2 (); test3 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/vsnprintf-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test3_sub struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/vsprintf-chk-lib.c ================================================ #include "lib/chk.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/vsprintf-chk.c ================================================ /* Copyright (C) 2004, 2005 Free Software Foundation. Ensure builtin __vsprintf_chk performs correctly. */ #include extern void abort (void); typedef __SIZE_TYPE__ size_t; extern size_t strlen(const char *); extern void *memcpy (void *, const void *, size_t); extern char *strcpy (char *, const char *); extern int memcmp (const void *, const void *, size_t); extern void *memset (void *, int, size_t); extern int vsprintf (char *, const char *, va_list); #include "chk.h" const char s1[] = "123"; char p[32] = ""; char *s2 = "defg"; char *s3 = "FGH"; char *s4; size_t l1 = 1; static char buffer[32]; char * volatile ptr = "barf"; /* prevent constant propagation to happen when whole program assumptions are made. */ int __attribute__((noinline)) test1_sub (int i, ...) { int ret = 0; va_list ap; va_start (ap, i); switch (i) { case 0: vsprintf (buffer, "foo", ap); break; case 1: ret = vsprintf (buffer, "foo", ap); break; case 2: vsprintf (buffer, "%s", ap); break; case 3: ret = vsprintf (buffer, "%s", ap); break; case 4: vsprintf (buffer, "%d - %c", ap); break; case 5: vsprintf (s4, "%d - %c", ap); break; } va_end (ap); return ret; } void __attribute__((noinline)) test1 (void) { chk_calls = 0; vsprintf_disallowed = 1; memset (buffer, 'A', 32); test1_sub (0); if (memcmp (buffer, "foo", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); if (test1_sub (1) != 3) abort (); if (memcmp (buffer, "foo", 4) || buffer[4] != 'A') abort (); if (chk_calls) abort (); vsprintf_disallowed = 0; memset (buffer, 'A', 32); test1_sub (2, "bar"); if (memcmp (buffer, "bar", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); if (test1_sub (3, "bar") != 3) abort (); if (memcmp (buffer, "bar", 4) || buffer[4] != 'A') abort (); memset (buffer, 'A', 32); test1_sub (2, ptr); if (memcmp (buffer, "barf", 5) || buffer[5] != 'A') abort (); memset (buffer, 'A', 32); test1_sub (4, (int) l1 + 27, *ptr); if (memcmp (buffer, "28 - b\0AAAAA", 12)) abort (); if (chk_calls != 4) abort (); chk_calls = 0; test1_sub (5, (int) l1 - 17, ptr[1]); if (memcmp (s4, "-16 - a", 8)) abort (); if (chk_calls) abort (); } void __attribute__((noinline)) test2_sub (int i, ...) { va_list ap; struct A { char buf1[10]; char buf2[10]; } a; char *r = l1 == 1 ? &a.buf1[5] : &a.buf2[4]; char buf3[20]; int j; va_start (ap, i); /* The following calls should do runtime checking - source length is not known, but destination is. */ switch (i) { case 0: vsprintf (a.buf1 + 2, "%s", ap); break; case 1: vsprintf (r, "%s%c", ap); break; case 2: r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; vsprintf (r, "%c %s", ap); break; case 3: r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; vsprintf (r + 2, s3 + 3, ap); break; case 4: case 7: r = buf3; for (j = 0; j < 4; ++j) { if (j == l1 - 1) r = &a.buf1[1]; else if (j == l1) r = &a.buf2[7]; else if (j == l1 + 1) r = &buf3[5]; else if (j == l1 + 2) r = &a.buf1[9]; } if (i == 4) vsprintf (r, s2 + 4, ap); else vsprintf (r, "a", ap); break; case 5: r = l1 == 1 ? __builtin_alloca (4) : &a.buf2[7]; vsprintf (r, "%s", ap); break; case 6: vsprintf (a.buf1 + 2, "", ap); break; case 8: vsprintf (s4, "%s %d", ap); break; } va_end (ap); } /* Test whether compile time checking is done where it should and so is runtime object size checking. */ void __attribute__((noinline)) test2 (void) { /* The following calls should do runtime checking - source length is not known, but destination is. */ chk_calls = 0; test2_sub (0, s3 + 3); test2_sub (1, s3 + 3, s3[3]); test2_sub (2, s2[2], s2 + 4); test2_sub (3); test2_sub (4); test2_sub (5, s1 + 1); if (chk_calls != 6) abort (); /* Following have known destination and known source length, so if optimizing certainly shouldn't result in the checking variants. */ chk_calls = 0; vsprintf_disallowed = 1; test2_sub (6); test2_sub (7); vsprintf_disallowed = 0; /* Unknown destination and source, no checking. */ test2_sub (8, s3, 0); if (chk_calls) abort (); } void __attribute__((noinline)) test3_sub (int i, ...) { va_list ap; struct A { char buf1[10]; char buf2[10]; } a; char buf3[20]; va_start (ap, i); /* The following calls should do runtime checking - source length is not known, but destination is. */ switch (i) { case 0: vsprintf (&a.buf2[9], "%c%s", ap); break; case 1: vsprintf (&a.buf2[7], "%s%c", ap); break; case 2: vsprintf (&a.buf2[7], "%d", ap); break; case 3: vsprintf (&buf3[17], "%s", ap); break; case 4: vsprintf (&buf3[19], "a", ap); break; } va_end (ap); } /* Test whether runtime and/or compile time checking catches buffer overflows. */ void __attribute__((noinline)) test3 (void) { chk_fail_allowed = 1; /* Runtime checks. */ if (__builtin_setjmp (chk_fail_buf) == 0) { test3_sub (0, s2[3], s2 + 4); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { test3_sub (1, s3 + strlen (s3) - 2, *s3); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { test3_sub (2, (int) l1 + 9999); abort (); } if (__builtin_setjmp (chk_fail_buf) == 0) { test3_sub (3, "abc"); abort (); } /* This should be detectable at compile time already. */ if (__builtin_setjmp (chk_fail_buf) == 0) { test3_sub (4); abort (); } chk_fail_allowed = 0; } void main_test (void) { #ifndef __OPTIMIZE__ /* Object size checking is only intended for -O[s123]. */ return; #endif __asm ("" : "=r" (s2) : "0" (s2)); __asm ("" : "=r" (s3) : "0" (s3)); __asm ("" : "=r" (l1) : "0" (l1)); s4 = p; test1 (); test2 (); test3 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/vsprintf-chk.x ================================================ load_lib target-supports.exp if { ! [check_effective_target_nonlocal_goto] } { return 1 } if [istarget "epiphany-*-*"] { # This test assumes the absence of struct padding. # to make this true for test3_sub struct A on epiphany would require # __attribute__((packed)) . return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/call-trap-1.c ================================================ /* Undefined behavior from a call to a function cast to a different type does not appear until after the function designator and arguments have been evaluated. PR 38483. */ /* Origin: Joseph Myers */ /* { dg-require-effective-target untyped_assembly } */ extern void exit (int); extern void abort (void); int foo (void) { exit (0); return 0; } void bar (void) { } int main (void) { ((long (*)(int))bar) (foo ()); abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/cbrt.c ================================================ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freely granted, provided that this notice * is preserved. * ==================================================== */ #ifndef __vax__ static const unsigned long B1 = 715094163, /* B1 = (682-0.03306235651)*2**20 */ B2 = 696219795; /* B2 = (664-0.03306235651)*2**20 */ static const double C = 5.42857142857142815906e-01, /* 19/35 = 0x3FE15F15, 0xF15F15F1 */ D = -7.05306122448979611050e-01, /* -864/1225 = 0xBFE691DE, 0x2532C834 */ E = 1.41428571428571436819e+00, /* 99/70 = 0x3FF6A0EA, 0x0EA0EA0F */ F = 1.60714285714285720630e+00, /* 45/28 = 0x3FF9B6DB, 0x6DB6DB6E */ G = 3.57142857142857150787e-01; /* 5/14 = 0x3FD6DB6D, 0xB6DB6DB7 */ double cbrtl (double x) { long hx; double r,s,w; double lt; unsigned sign; typedef unsigned unsigned32 __attribute__((mode(SI))); union { double t; unsigned32 pt[2]; } ut, ux; int n0; ut.t = 1.0; n0 = (ut.pt[0] == 0); ut.t = 0.0; ux.t = x; hx = ux.pt[n0]; /* high word of x */ sign=hx&0x80000000; /* sign= sign(x) */ hx ^=sign; if(hx>=0x7ff00000) return(x+x); /* cbrt(NaN,INF) is itself */ if((hx| ux.pt[1-n0])==0) return(ux.t); /* cbrt(0) is itself */ ux.pt[n0] = hx; /* rough cbrt to 5 bits */ if(hx<0x00100000) /* subnormal number */ {ut.pt[n0]=0x43500000; /* set t= 2**54 */ ut.t*=x; ut.pt[n0]=ut.pt[n0]/3+B2; } else ut.pt[n0]=hx/3+B1; /* new cbrt to 23 bits, may be implemented in single precision */ r=ut.t*ut.t/ux.t; s=C+r*ut.t; ut.t*=G+F/(s+E+D/s); /* chopped to 20 bits and make it larger than cbrt(x) */ ut.pt[1-n0]=0; ut.pt[n0]+=0x00000001; /* one step newton iteration to 53 bits with error less than 0.667 ulps */ s=ut.t*ut.t; /* t*t is exact */ r=ux.t/s; w=ut.t+ut.t; r=(r-ut.t)/(w+r); /* r-s is exact */ ut.t=ut.t+ut.t*r; /* restore the sign bit */ ut.pt[n0] |= sign; lt = ut.t; lt -= (lt - (x/(lt*lt))) * 0.333333333333333333333; return lt; } main () { if ((int) (cbrtl (27.0) + 0.5) != 3) abort (); exit (0); } #else main () { exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/cmpdi-1.c ================================================ #define F 140 #define T 13 feq (x, y) long long int x; long long int y; { if (x == y) return T; else return F; } fne (x, y) long long int x; long long int y; { if (x != y) return T; else return F; } flt (x, y) long long int x; long long int y; { if (x < y) return T; else return F; } fge (x, y) long long int x; long long int y; { if (x >= y) return T; else return F; } fgt (x, y) long long int x; long long int y; { if (x > y) return T; else return F; } fle (x, y) long long int x; long long int y; { if (x <= y) return T; else return F; } fltu (x, y) unsigned long long int x; unsigned long long int y; { if (x < y) return T; else return F; } fgeu (x, y) unsigned long long int x; unsigned long long int y; { if (x >= y) return T; else return F; } fgtu (x, y) unsigned long long int x; unsigned long long int y; { if (x > y) return T; else return F; } fleu (x, y) unsigned long long int x; unsigned long long int y; { if (x <= y) return T; else return F; } long long args[] = { 0LL, 1LL, -1LL, 0x7fffffffffffffffLL, 0x8000000000000000LL, 0x8000000000000001LL, 0x1A3F237394D36C58LL, 0x93850E92CAAC1B04LL }; int correct_results[] = { T, F, F, T, F, T, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, F, T, T, F, F, T, T, F, T, F, F, T, F, T, F, T, F, T, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, F, T, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, T, F, F, T, T, F, F, T, F, T, F, T, F, T, F, T, F, T, T, F, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, T, F, F, T, F, T, F, T, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, F, T, T, F, T, F, F, T, T, F, F, T, F, T, F, T, F, T, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, F, T, F, T }; main () { int i, j, *res = correct_results; for (i = 0; i < 8; i++) { long long arg0 = args[i]; for (j = 0; j < 8; j++) { long long arg1 = args[j]; if (feq (arg0, arg1) != *res++) abort (); if (fne (arg0, arg1) != *res++) abort (); if (flt (arg0, arg1) != *res++) abort (); if (fge (arg0, arg1) != *res++) abort (); if (fgt (arg0, arg1) != *res++) abort (); if (fle (arg0, arg1) != *res++) abort (); if (fltu (arg0, arg1) != *res++) abort (); if (fgeu (arg0, arg1) != *res++) abort (); if (fgtu (arg0, arg1) != *res++) abort (); if (fleu (arg0, arg1) != *res++) abort (); } } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/cmpsf-1.c ================================================ #include #define F 140 #define T 13 feq (float x, float y) { if (x == y) return T; else return F; } fne (float x, float y) { if (x != y) return T; else return F; } flt (float x, float y) { if (x < y) return T; else return F; } fge (float x, float y) { if (x >= y) return T; else return F; } fgt (float x, float y) { if (x > y) return T; else return F; } fle (float x, float y) { if (x <= y) return T; else return F; } float args[] = { 0.0F, 1.0F, -1.0F, __FLT_MAX__, __FLT_MIN__, 0.0000000000001F, 123456789.0F, -987654321.0F }; int correct_results[] = { T, F, F, T, F, T, F, T, T, F, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, F, T, T, F, F, T, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, }; int main (void) { int i, j, *res = correct_results; for (i = 0; i < 8; i++) { float arg0 = args[i]; for (j = 0; j < 8; j++) { float arg1 = args[j]; if (feq (arg0, arg1) != *res++) abort (); if (fne (arg0, arg1) != *res++) abort (); if (flt (arg0, arg1) != *res++) abort (); if (fge (arg0, arg1) != *res++) abort (); if (fgt (arg0, arg1) != *res++) abort (); if (fle (arg0, arg1) != *res++) abort (); } } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/cmpsi-1.c ================================================ f1 (unsigned int x, unsigned int y) { if (x == 0) dummy (); x -= y; /* 0xfffffff2 < 0x80000000? */ if (x < ~(~(unsigned int) 0 >> 1)) abort (); return x; } f2 (unsigned long int x, unsigned long int y) { if (x == 0) dummy (); x -= y; /* 0xfffffff2 < 0x80000000? */ if (x < ~(~(unsigned long int) 0 >> 1)) abort (); return x; } dummy () {} main () { /* 0x7ffffff3 0x80000001 */ f1 ((~(unsigned int) 0 >> 1) - 12, ~(~(unsigned int) 0 >> 1) + 1); f2 ((~(unsigned long int) 0 >> 1) - 12, ~(~(unsigned long int) 0 >> 1) + 1); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/cmpsi-2.c ================================================ /* { dg-require-effective-target int32plus } */ #define F 140 #define T 13 feq (int x, int y) { if (x == y) return T; else return F; } fne (int x, int y) { if (x != y) return T; else return F; } flt (int x, int y) { if (x < y) return T; else return F; } fge (int x, int y) { if (x >= y) return T; else return F; } fgt (int x, int y) { if (x > y) return T; else return F; } fle (int x, int y) { if (x <= y) return T; else return F; } fltu (unsigned int x, unsigned int y) { if (x < y) return T; else return F; } fgeu (unsigned int x, unsigned int y) { if (x >= y) return T; else return F; } fgtu (unsigned int x, unsigned int y) { if (x > y) return T; else return F; } fleu (unsigned int x, unsigned int y) { if (x <= y) return T; else return F; } unsigned int args[] = { 0L, 1L, -1L, 0x7fffffffL, 0x80000000L, 0x80000001L, 0x1A3F2373L, 0x93850E92L }; int correct_results[] = { T, F, F, T, F, T, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, F, T, T, F, F, T, T, F, T, F, F, T, F, T, F, T, F, T, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, F, T, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, T, F, F, T, T, F, F, T, F, T, F, T, F, T, F, T, F, T, T, F, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, T, F, F, T, F, T, F, T, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, F, T, T, F, T, F, F, T, T, F, F, T, F, T, F, T, F, T, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, F, T, F, T }; int main (void) { int i, j, *res = correct_results; for (i = 0; i < 8; i++) { unsigned int arg0 = args[i]; for (j = 0; j < 8; j++) { unsigned int arg1 = args[j]; if (feq (arg0, arg1) != *res++) abort (); if (fne (arg0, arg1) != *res++) abort (); if (flt (arg0, arg1) != *res++) abort (); if (fge (arg0, arg1) != *res++) abort (); if (fgt (arg0, arg1) != *res++) abort (); if (fle (arg0, arg1) != *res++) abort (); if (fltu (arg0, arg1) != *res++) abort (); if (fgeu (arg0, arg1) != *res++) abort (); if (fgtu (arg0, arg1) != *res++) abort (); if (fleu (arg0, arg1) != *res++) abort (); } } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c ================================================ #include #if !defined(NO_LABEL_VALUES) && (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647 typedef unsigned int uint32; typedef signed int sint32; typedef uint32 reg_t; typedef unsigned long int host_addr_t; typedef uint32 target_addr_t; typedef sint32 target_saddr_t; typedef union { struct { unsigned int offset:18; unsigned int ignore:4; unsigned int s1:8; int :2; signed int simm:14; unsigned int s3:8; unsigned int s2:8; int pad2:2; } f1; long long ll; double d; } insn_t; typedef struct { target_addr_t vaddr_tag; unsigned long int rigged_paddr; } tlb_entry_t; typedef struct { insn_t *pc; reg_t registers[256]; insn_t *program; tlb_entry_t tlb_tab[0x100]; } environment_t; enum operations { LOAD32_RR, METAOP_DONE }; host_addr_t f () { abort (); } reg_t simulator_kernel (int what, environment_t *env) { register insn_t *pc = env->pc; register reg_t *regs = env->registers; register insn_t insn; register int s1; register reg_t r2; register void *base_addr = &&sim_base_addr; register tlb_entry_t *tlb = env->tlb_tab; if (what != 0) { int i; static void *op_map[] = { &&L_LOAD32_RR, &&L_METAOP_DONE, }; insn_t *program = env->program; for (i = 0; i < what; i++) program[i].f1.offset = op_map[program[i].f1.offset] - base_addr; } sim_base_addr:; insn = *pc++; r2 = (*(reg_t *) (((char *) regs) + (insn.f1.s2 << 2))); s1 = (insn.f1.s1 << 2); goto *(base_addr + insn.f1.offset); L_LOAD32_RR: { target_addr_t vaddr_page = r2 / 4096; unsigned int x = vaddr_page % 0x100; insn = *pc++; for (;;) { target_addr_t tag = tlb[x].vaddr_tag; host_addr_t rigged_paddr = tlb[x].rigged_paddr; if (tag == vaddr_page) { *(reg_t *) (((char *) regs) + s1) = *(uint32 *) (rigged_paddr + r2); r2 = *(reg_t *) (((char *) regs) + (insn.f1.s2 << 2)); s1 = insn.f1.s1 << 2; goto *(base_addr + insn.f1.offset); } if (((target_saddr_t) tag < 0)) { *(reg_t *) (((char *) regs) + s1) = *(uint32 *) f (); r2 = *(reg_t *) (((char *) regs) + (insn.f1.s2 << 2)); s1 = insn.f1.s1 << 2; goto *(base_addr + insn.f1.offset); } x = (x - 1) % 0x100; } L_METAOP_DONE: return (*(reg_t *) (((char *) regs) + s1)); } } insn_t program[2 + 1]; void *malloc (); int main () { environment_t env; insn_t insn; int i, res; host_addr_t a_page = (host_addr_t) malloc (2 * 4096); target_addr_t a_vaddr = 0x123450; target_addr_t vaddr_page = a_vaddr / 4096; a_page = (a_page + 4096 - 1) & -4096; env.tlb_tab[((vaddr_page) % 0x100)].vaddr_tag = vaddr_page; env.tlb_tab[((vaddr_page) % 0x100)].rigged_paddr = a_page - vaddr_page * 4096; insn.f1.offset = LOAD32_RR; env.registers[0] = 0; env.registers[2] = a_vaddr; *(sint32 *) (a_page + a_vaddr % 4096) = 88; insn.f1.s1 = 0; insn.f1.s2 = 2; for (i = 0; i < 2; i++) program[i] = insn; insn.f1.offset = METAOP_DONE; insn.f1.s1 = 0; program[2] = insn; env.pc = program; env.program = program; res = simulator_kernel (2 + 1, &env); if (res != 88) abort (); exit (0); } #else main(){ exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/comp-goto-2.c ================================================ /* A slight variation of 920501-7.c. */ #ifdef STACK_SIZE #define DEPTH ((STACK_SIZE) / 512 + 1) #else #define DEPTH 1000 #endif #if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) x(a) { __label__ xlab; void y(a) { void *x = &&llab; if (a==-1) goto *x; if (a==0) goto xlab; llab: y (a-1); } y (a); xlab:; return a; } #endif main () { #if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) if (x (DEPTH) != DEPTH) abort (); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/compare-1.c ================================================ /* Copyright (C) 2002 Free Software Foundation. Test for correctness of composite comparisons. Written by Roger Sayle, 3rd June 2002. */ extern void abort (void); int ieq (int x, int y, int ok) { if ((x<=y) && (x>=y)) { if (!ok) abort (); } else if (ok) abort (); if ((x<=y) && (x==y)) { if (!ok) abort (); } else if (ok) abort (); if ((x<=y) && (y<=x)) { if (!ok) abort (); } else if (ok) abort (); if ((y==x) && (x<=y)) { if (!ok) abort (); } else if (ok) abort (); } int ine (int x, int y, int ok) { if ((xy)) { if (!ok) abort (); } else if (ok) abort (); } int ilt (int x, int y, int ok) { if ((xy) && (x!=y)) { if (!ok) abort (); } else if (ok) abort (); } int ige (int x, int y, int ok) { if ((x>y) || (x==y)) { if (!ok) abort (); } else if (ok) abort (); } int main () { ieq (1, 4, 0); ieq (3, 3, 1); ieq (5, 2, 0); ine (1, 4, 1); ine (3, 3, 0); ine (5, 2, 1); ilt (1, 4, 1); ilt (3, 3, 0); ilt (5, 2, 0); ile (1, 4, 1); ile (3, 3, 1); ile (5, 2, 0); igt (1, 4, 0); igt (3, 3, 0); igt (5, 2, 1); ige (1, 4, 0); ige (3, 3, 1); ige (5, 2, 1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/compare-2.c ================================================ /* Copyright (C) 2002 Free Software Foundation. Ensure that the composite comparison optimization doesn't misfire and attempt to combine a signed comparison with an unsigned one. Written by Roger Sayle, 3rd June 2002. */ extern void abort (void); int foo (int x, int y) { /* If miscompiled the following may become "x == y". */ return (x<=y) && ((unsigned int)x >= (unsigned int)y); } int main () { if (! foo (-1,0)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/compare-3.c ================================================ /* Copyright (C) 2002 Free Software Foundation. Test for composite comparison always true/false optimization. Written by Roger Sayle, 7th June 2002. */ extern void link_error0 (); extern void link_error1 (); void test1 (int x, int y) { if ((x==y) && (x!=y)) link_error0(); } void test2 (int x, int y) { if ((xy)) link_error0(); } void test3 (int x, int y) { if ((x=y) || (x #include int err; #define TEST(TYPE, FUNC) \ __complex__ TYPE \ ctest_ ## FUNC (__complex__ TYPE x) \ { \ __complex__ TYPE res; \ \ res = ~x; \ \ return res; \ } \ \ void \ test_ ## FUNC (void) \ { \ __complex__ TYPE res, x; \ \ x = 1.0 + 2.0i; \ \ res = ctest_ ## FUNC (x); \ \ if (res != 1.0 - 2.0i) \ { \ printf ("test_" #FUNC " failed\n"); \ ++err; \ } \ } TEST(float, float) TEST(double, double) TEST(long double, long_double) TEST(int, int) TEST(long int, long_int) int main (void) { err = 0; test_float (); test_double (); test_long_double (); test_int (); test_long_int (); if (err != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/complex-7.c ================================================ /* Test argument passing of complex values. The MIPS64 compiler had a bug when they were split between registers and the stack. */ /* Origin: Joseph Myers */ volatile _Complex float f1 = 1.1f + 2.2if; volatile _Complex float f2 = 3.3f + 4.4if; volatile _Complex float f3 = 5.5f + 6.6if; volatile _Complex float f4 = 7.7f + 8.8if; volatile _Complex float f5 = 9.9f + 10.1if; volatile _Complex double d1 = 1.1 + 2.2i; volatile _Complex double d2 = 3.3 + 4.4i; volatile _Complex double d3 = 5.5 + 6.6i; volatile _Complex double d4 = 7.7 + 8.8i; volatile _Complex double d5 = 9.9 + 10.1i; volatile _Complex long double ld1 = 1.1L + 2.2iL; volatile _Complex long double ld2 = 3.3L + 4.4iL; volatile _Complex long double ld3 = 5.5L + 6.6iL; volatile _Complex long double ld4 = 7.7L + 8.8iL; volatile _Complex long double ld5 = 9.9L + 10.1iL; extern void abort (void); extern void exit (int); __attribute__((noinline)) void check_float (int a, _Complex float a1, _Complex float a2, _Complex float a3, _Complex float a4, _Complex float a5) { if (a1 != f1 || a2 != f2 || a3 != f3 || a4 != f4 || a5 != f5) abort (); } __attribute__((noinline)) void check_double (int a, _Complex double a1, _Complex double a2, _Complex double a3, _Complex double a4, _Complex double a5) { if (a1 != d1 || a2 != d2 || a3 != d3 || a4 != d4 || a5 != d5) abort (); } __attribute__((noinline)) void check_long_double (int a, _Complex long double a1, _Complex long double a2, _Complex long double a3, _Complex long double a4, _Complex long double a5) { if (a1 != ld1 || a2 != ld2 || a3 != ld3 || a4 != ld4 || a5 != ld5) abort (); } int main (void) { check_float (0, f1, f2, f3, f4, f5); check_double (0, d1, d2, d3, d4, d5); check_long_double (0, ld1, ld2, ld3, ld4, ld5); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/compndlit-1.c ================================================ /* The bit-field below would have a problem if __INT_MAX__ is too small. */ #if __INT_MAX__ < 2147483647 int main (void) { exit (0); } #else struct S { int a:3; unsigned b:1, c:28; }; struct S x = {1, 1, 1}; main () { x = (struct S) {b:0, a:0, c:({ struct S o = x; o.a == 1 ? 10 : 20;})}; if (x.c != 10) abort (); exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/const-addr-expr-1.c ================================================ #include #include extern void abort(); typedef struct foo { int uaattrid; char *name; } FOO; FOO Upgrade_items[] = { {1, "1"}, {2, "2"}, {0, NULL} }; int *Upgd_minor_ID = (int *) &((Upgrade_items + 1)->uaattrid); int *Upgd_minor_ID1 = (int *) &((Upgrade_items)->uaattrid); int main(int argc, char **argv) { if (*Upgd_minor_ID != 2) abort(); if (*Upgd_minor_ID1 != 1) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/conversion.c ================================================ /* Test front-end conversions, optimizer conversions, and run-time conversions between different arithmetic types. Constants are specified in a non-obvious way to make them work for any word size. Their value on a 32-bit machine is indicated in the comments. Note that this code is NOT intended for testing of accuracy of fp conversions. */ float u2f(u) unsigned int u; { return u; } double u2d(u) unsigned int u; { return u; } long double u2ld(u) unsigned int u; { return u; } float s2f(s) int s; { return s; } double s2d(s) int s; { return s; } long double s2ld(s) int s; { return s; } int fnear (float x, float y) { float t = x - y; return t == 0 || x / t > 1000000.0; } int dnear (double x, double y) { double t = x - y; return t == 0 || x / t > 100000000000000.0; } int ldnear (long double x, long double y) { long double t = x - y; return t == 0 || x / t > 100000000000000000000000000000000.0; } test_integer_to_float() { if (u2f(0U) != (float) 0U) /* 0 */ abort(); if (!fnear (u2f(~0U), (float) ~0U)) /* 0xffffffff */ abort(); if (!fnear (u2f((~0U) >> 1), (float) ((~0U) >> 1))) /* 0x7fffffff */ abort(); if (u2f(~((~0U) >> 1)) != (float) ~((~0U) >> 1)) /* 0x80000000 */ abort(); if (u2d(0U) != (double) 0U) /* 0 */ abort(); if (!dnear (u2d(~0U), (double) ~0U)) /* 0xffffffff */ abort(); if (!dnear (u2d((~0U) >> 1),(double) ((~0U) >> 1))) /* 0x7fffffff */ abort(); if (u2d(~((~0U) >> 1)) != (double) ~((~0U) >> 1)) /* 0x80000000 */ abort(); if (u2ld(0U) != (long double) 0U) /* 0 */ abort(); if (!ldnear (u2ld(~0U), (long double) ~0U)) /* 0xffffffff */ abort(); if (!ldnear (u2ld((~0U) >> 1),(long double) ((~0U) >> 1))) /* 0x7fffffff */ abort(); if (u2ld(~((~0U) >> 1)) != (long double) ~((~0U) >> 1)) /* 0x80000000 */ abort(); if (s2f(0) != (float) 0) /* 0 */ abort(); if (!fnear (s2f(~0), (float) ~0)) /* 0xffffffff */ abort(); if (!fnear (s2f((int)((~0U) >> 1)), (float)(int)((~0U) >> 1))) /* 0x7fffffff */ abort(); if (s2f((int)(~((~0U) >> 1))) != (float)(int)~((~0U) >> 1)) /* 0x80000000 */ abort(); if (s2d(0) != (double) 0) /* 0 */ abort(); if (!dnear (s2d(~0), (double) ~0)) /* 0xffffffff */ abort(); if (!dnear (s2d((int)((~0U) >> 1)), (double)(int)((~0U) >> 1))) /* 0x7fffffff */ abort(); if (s2d((int)~((~0U) >> 1)) != (double)(int)~((~0U) >> 1)) /* 0x80000000 */ abort(); if (s2ld(0) != (long double) 0) /* 0 */ abort(); if (!ldnear (s2ld(~0), (long double) ~0)) /* 0xffffffff */ abort(); if (!ldnear (s2ld((int)((~0U) >> 1)), (long double)(int)((~0U) >> 1))) /* 0x7fffffff */ abort(); if (s2ld((int)~((~0U) >> 1)) != (long double)(int)~((~0U) >> 1)) /* 0x80000000 */ abort(); } #if __GNUC__ float ull2f(u) unsigned long long int u; { return u; } double ull2d(u) unsigned long long int u; { return u; } long double ull2ld(u) unsigned long long int u; { return u; } float sll2f(s) long long int s; { return s; } double sll2d(s) long long int s; { return s; } long double sll2ld(s) long long int s; { return s; } test_longlong_integer_to_float() { if (ull2f(0ULL) != (float) 0ULL) /* 0 */ abort(); if (ull2f(~0ULL) != (float) ~0ULL) /* 0xffffffff */ abort(); if (ull2f((~0ULL) >> 1) != (float) ((~0ULL) >> 1)) /* 0x7fffffff */ abort(); if (ull2f(~((~0ULL) >> 1)) != (float) ~((~0ULL) >> 1)) /* 0x80000000 */ abort(); if (ull2d(0ULL) != (double) 0ULL) /* 0 */ abort(); #if __HAVE_68881__ /* Some 68881 targets return values in fp0, with excess precision. But the compile-time conversion to double works correctly. */ if (! dnear (ull2d(~0ULL), (double) ~0ULL)) /* 0xffffffff */ abort(); if (! dnear (ull2d((~0ULL) >> 1), (double) ((~0ULL) >> 1))) /* 0x7fffffff */ abort(); #else if (ull2d(~0ULL) != (double) ~0ULL) /* 0xffffffff */ abort(); if (ull2d((~0ULL) >> 1) != (double) ((~0ULL) >> 1)) /* 0x7fffffff */ abort(); #endif if (ull2d(~((~0ULL) >> 1)) != (double) ~((~0ULL) >> 1)) /* 0x80000000 */ abort(); if (ull2ld(0ULL) != (long double) 0ULL) /* 0 */ abort(); if (ull2ld(~0ULL) != (long double) ~0ULL) /* 0xffffffff */ abort(); if (ull2ld((~0ULL) >> 1) != (long double) ((~0ULL) >> 1)) /* 0x7fffffff */ abort(); if (ull2ld(~((~0ULL) >> 1)) != (long double) ~((~0ULL) >> 1)) /* 0x80000000 */ abort(); if (sll2f(0LL) != (float) 0LL) /* 0 */ abort(); if (sll2f(~0LL) != (float) ~0LL) /* 0xffffffff */ abort(); if (! fnear (sll2f((long long int)((~0ULL) >> 1)), (float)(long long int)((~0ULL) >> 1))) /* 0x7fffffff */ abort(); if (sll2f((long long int)(~((~0ULL) >> 1))) != (float)(long long int)~((~0ULL) >> 1)) /* 0x80000000 */ abort(); if (sll2d(0LL) != (double) 0LL) /* 0 */ abort(); if (sll2d(~0LL) != (double) ~0LL) /* 0xffffffff */ abort(); if (!dnear (sll2d((long long int)((~0ULL) >> 1)), (double)(long long int)((~0ULL) >> 1))) /* 0x7fffffff */ abort(); if (! dnear (sll2d((long long int)~((~0ULL) >> 1)), (double)(long long int)~((~0ULL) >> 1))) /* 0x80000000 */ abort(); if (sll2ld(0LL) != (long double) 0LL) /* 0 */ abort(); if (sll2ld(~0LL) != (long double) ~0LL) /* 0xffffffff */ abort(); if (!ldnear (sll2ld((long long int)((~0ULL) >> 1)), (long double)(long long int)((~0ULL) >> 1))) /* 0x7fffffff */ abort(); if (! ldnear (sll2ld((long long int)~((~0ULL) >> 1)), (long double)(long long int)~((~0ULL) >> 1))) /* 0x80000000 */ abort(); } #endif unsigned int f2u(float f) { return (unsigned) f; } unsigned int d2u(double d) { return (unsigned) d; } unsigned int ld2u(long double d) { return (unsigned) d; } int f2s(float f) { return (int) f; } int d2s(double d) { return (int) d; } int ld2s(long double d) { return (int) d; } test_float_to_integer() { if (f2u(0.0) != 0) abort(); if (f2u(0.999) != 0) abort(); if (f2u(1.0) != 1) abort(); if (f2u(1.99) != 1) abort(); #ifdef __SPU__ /* SPU float rounds towards zero. */ if (f2u((float) ((~0U) >> 1)) != 0x7fffff80) abort(); #else if (f2u((float) ((~0U) >> 1)) != (~0U) >> 1 && /* 0x7fffffff */ f2u((float) ((~0U) >> 1)) != ((~0U) >> 1) + 1) abort(); #endif if (f2u((float) ~((~0U) >> 1)) != ~((~0U) >> 1)) /* 0x80000000 */ abort(); /* These tests require double precision, so for hosts that don't offer that much precision, just ignore these test. */ if (sizeof (double) >= 8) { if (d2u(0.0) != 0) abort(); if (d2u(0.999) != 0) abort(); if (d2u(1.0) != 1) abort(); if (d2u(1.99) != 1) abort(); if (d2u((double) (~0U)) != ~0U) /* 0xffffffff */ abort(); if (d2u((double) ((~0U) >> 1)) != (~0U) >> 1) /* 0x7fffffff */ abort(); if (d2u((double) ~((~0U) >> 1)) != ~((~0U) >> 1)) /* 0x80000000 */ abort(); } /* These tests require long double precision, so for hosts that don't offer that much precision, just ignore these test. */ if (sizeof (long double) >= 8) { if (ld2u(0.0) != 0) abort(); if (ld2u(0.999) != 0) abort(); if (ld2u(1.0) != 1) abort(); if (ld2u(1.99) != 1) abort(); if (ld2u((long double) (~0U)) != ~0U) /* 0xffffffff */ abort(); if (ld2u((long double) ((~0U) >> 1)) != (~0U) >> 1) /* 0x7fffffff */ abort(); if (ld2u((long double) ~((~0U) >> 1)) != ~((~0U) >> 1)) /* 0x80000000 */ abort(); } if (f2s(0.0) != 0) abort(); if (f2s(0.999) != 0) abort(); if (f2s(1.0) != 1) abort(); if (f2s(1.99) != 1) abort(); if (f2s(-0.999) != 0) abort(); if (f2s(-1.0) != -1) abort(); if (f2s(-1.99) != -1) abort(); if (f2s((float)(int)~((~0U) >> 1)) != (int)~((~0U) >> 1)) /* 0x80000000 */ abort(); /* These tests require double precision, so for hosts that don't offer that much precision, just ignore these test. */ if (sizeof (double) >= 8) { if (d2s(0.0) != 0) abort(); if (d2s(0.999) != 0) abort(); if (d2s(1.0) != 1) abort(); if (d2s(1.99) != 1) abort(); if (d2s(-0.999) != 0) abort(); if (d2s(-1.0) != -1) abort(); if (d2s(-1.99) != -1) abort(); if (d2s((double) ((~0U) >> 1)) != (~0U) >> 1) /* 0x7fffffff */ abort(); if (d2s((double)(int)~((~0U) >> 1)) != (int)~((~0U) >> 1)) /* 0x80000000 */ abort(); } /* These tests require long double precision, so for hosts that don't offer that much precision, just ignore these test. */ if (sizeof (long double) >= 8) { if (ld2s(0.0) != 0) abort(); if (ld2s(0.999) != 0) abort(); if (ld2s(1.0) != 1) abort(); if (ld2s(1.99) != 1) abort(); if (ld2s(-0.999) != 0) abort(); if (ld2s(-1.0) != -1) abort(); if (ld2s(-1.99) != -1) abort(); if (ld2s((long double) ((~0U) >> 1)) != (~0U) >> 1) /* 0x7fffffff */ abort(); if (ld2s((long double)(int)~((~0U) >> 1)) != (int)~((~0U) >> 1)) /* 0x80000000 */ abort(); } } #if __GNUC__ unsigned long long int f2ull(float f) { return (unsigned long long int) f; } unsigned long long int d2ull(double d) { return (unsigned long long int) d; } unsigned long long int ld2ull(long double d) { return (unsigned long long int) d; } long long int f2sll(float f) { return (long long int) f; } long long int d2sll(double d) { return (long long int) d; } long long int ld2sll(long double d) { return (long long int) d; } test_float_to_longlong_integer() { if (f2ull(0.0) != 0LL) abort(); if (f2ull(0.999) != 0LL) abort(); if (f2ull(1.0) != 1LL) abort(); if (f2ull(1.99) != 1LL) abort(); #ifdef __SPU__ /* SPU float rounds towards zero. */ if (f2ull((float) ((~0ULL) >> 1)) != 0x7fffff8000000000ULL) abort(); #else if (f2ull((float) ((~0ULL) >> 1)) != (~0ULL) >> 1 && /* 0x7fffffff */ f2ull((float) ((~0ULL) >> 1)) != ((~0ULL) >> 1) + 1) abort(); #endif if (f2ull((float) ~((~0ULL) >> 1)) != ~((~0ULL) >> 1)) /* 0x80000000 */ abort(); if (d2ull(0.0) != 0LL) abort(); if (d2ull(0.999) != 0LL) abort(); if (d2ull(1.0) != 1LL) abort(); if (d2ull(1.99) != 1LL) abort(); if (d2ull((double) ((~0ULL) >> 1)) != (~0ULL) >> 1 && /* 0x7fffffff */ d2ull((double) ((~0ULL) >> 1)) != ((~0ULL) >> 1) + 1) abort(); if (d2ull((double) ~((~0ULL) >> 1)) != ~((~0ULL) >> 1)) /* 0x80000000 */ abort(); if (ld2ull(0.0) != 0LL) abort(); if (ld2ull(0.999) != 0LL) abort(); if (ld2ull(1.0) != 1LL) abort(); if (ld2ull(1.99) != 1LL) abort(); if (ld2ull((long double) ((~0ULL) >> 1)) != (~0ULL) >> 1 && /* 0x7fffffff */ ld2ull((long double) ((~0ULL) >> 1)) != ((~0ULL) >> 1) + 1) abort(); if (ld2ull((long double) ~((~0ULL) >> 1)) != ~((~0ULL) >> 1)) /* 0x80000000 */ abort(); if (f2sll(0.0) != 0LL) abort(); if (f2sll(0.999) != 0LL) abort(); if (f2sll(1.0) != 1LL) abort(); if (f2sll(1.99) != 1LL) abort(); if (f2sll(-0.999) != 0LL) abort(); if (f2sll(-1.0) != -1LL) abort(); if (f2sll(-1.99) != -1LL) abort(); if (f2sll((float)(long long int)~((~0ULL) >> 1)) != (long long int)~((~0ULL) >> 1)) /* 0x80000000 */ abort(); if (d2sll(0.0) != 0LL) abort(); if (d2sll(0.999) != 0LL) abort(); if (d2sll(1.0) != 1LL) abort(); if (d2sll(1.99) != 1LL) abort(); if (d2sll(-0.999) != 0LL) abort(); if (d2sll(-1.0) != -1LL) abort(); if (d2sll(-1.99) != -1LL) abort(); if (d2sll((double)(long long int)~((~0ULL) >> 1)) != (long long int)~((~0ULL) >> 1)) /* 0x80000000 */ abort(); if (ld2sll(0.0) != 0LL) abort(); if (ld2sll(0.999) != 0LL) abort(); if (ld2sll(1.0) != 1LL) abort(); if (ld2sll(1.99) != 1LL) abort(); if (ld2sll(-0.999) != 0LL) abort(); if (ld2sll(-1.0) != -1LL) abort(); if (ld2sll(-1.99) != -1LL) abort(); if (ld2sll((long double)(long long int)~((~0ULL) >> 1)) != (long long int)~((~0ULL) >> 1)) /* 0x80000000 */ abort(); } #endif main() { test_integer_to_float(); test_float_to_integer(); #if __GNUC__ test_longlong_integer_to_float(); test_float_to_longlong_integer(); #endif exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/cvt-1.c ================================================ static inline long g1 (double x) { return (double) (long) x; } long g2 (double f) { return f; } double f (long i) { if (g1 (i) != g2 (i)) abort (); return g2 (i); } main () { if (f (123456789L) != 123456789L) abort (); if (f (123456789L) != g2 (123456789L)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/dbra-1.c ================================================ f1 (a) long a; { int i; for (i = 0; i < 10; i++) { if (--a == -1) return i; } return -1; } f2 (a) long a; { int i; for (i = 0; i < 10; i++) { if (--a != -1) return i; } return -1; } f3 (a) long a; { int i; for (i = 0; i < 10; i++) { if (--a == 0) return i; } return -1; } f4 (a) long a; { int i; for (i = 0; i < 10; i++) { if (--a != 0) return i; } return -1; } f5 (a) long a; { int i; for (i = 0; i < 10; i++) { if (++a == 0) return i; } return -1; } f6 (a) long a; { int i; for (i = 0; i < 10; i++) { if (++a != 0) return i; } return -1; } main() { if (f1 (5L) != 5) abort (); if (f2 (1L) != 0) abort (); if (f2 (0L) != 1) abort (); if (f3 (5L) != 4) abort (); if (f4 (1L) != 1) abort (); if (f4 (0L) != 0) abort (); if (f5 (-5L) != 4) abort (); if (f6 (-1L) != 1) abort (); if (f6 (0L) != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/divcmp-1.c ================================================ extern void abort(void); int test1(int x) { return x/10 == 2; } int test1u(unsigned int x) { return x/10U == 2; } int test2(int x) { return x/10 == 0; } int test2u(unsigned int x) { return x/10U == 0; } int test3(int x) { return x/10 != 2; } int test3u(unsigned int x) { return x/10U != 2; } int test4(int x) { return x/10 != 0; } int test4u(unsigned int x) { return x/10U != 0; } int test5(int x) { return x/10 < 2; } int test5u(unsigned int x) { return x/10U < 2; } int test6(int x) { return x/10 < 0; } int test7(int x) { return x/10 <= 2; } int test7u(unsigned int x) { return x/10U <= 2; } int test8(int x) { return x/10 <= 0; } int test8u(unsigned int x) { return x/10U <= 0; } int test9(int x) { return x/10 > 2; } int test9u(unsigned int x) { return x/10U > 2; } int test10(int x) { return x/10 > 0; } int test10u(unsigned int x) { return x/10U > 0; } int test11(int x) { return x/10 >= 2; } int test11u(unsigned int x) { return x/10U >= 2; } int test12(int x) { return x/10 >= 0; } int main() { if (test1(19) != 0) abort (); if (test1(20) != 1) abort (); if (test1(29) != 1) abort (); if (test1(30) != 0) abort (); if (test1u(19) != 0) abort (); if (test1u(20) != 1) abort (); if (test1u(29) != 1) abort (); if (test1u(30) != 0) abort (); if (test2(0) != 1) abort (); if (test2(9) != 1) abort (); if (test2(10) != 0) abort (); if (test2(-1) != 1) abort (); if (test2(-9) != 1) abort (); if (test2(-10) != 0) abort (); if (test2u(0) != 1) abort (); if (test2u(9) != 1) abort (); if (test2u(10) != 0) abort (); if (test2u(-1) != 0) abort (); if (test2u(-9) != 0) abort (); if (test2u(-10) != 0) abort (); if (test3(19) != 1) abort (); if (test3(20) != 0) abort (); if (test3(29) != 0) abort (); if (test3(30) != 1) abort (); if (test3u(19) != 1) abort (); if (test3u(20) != 0) abort (); if (test3u(29) != 0) abort (); if (test3u(30) != 1) abort (); if (test4(0) != 0) abort (); if (test4(9) != 0) abort (); if (test4(10) != 1) abort (); if (test4(-1) != 0) abort (); if (test4(-9) != 0) abort (); if (test4(-10) != 1) abort (); if (test4u(0) != 0) abort (); if (test4u(9) != 0) abort (); if (test4u(10) != 1) abort (); if (test4u(-1) != 1) abort (); if (test4u(-9) != 1) abort (); if (test4u(-10) != 1) abort (); if (test5(19) != 1) abort (); if (test5(20) != 0) abort (); if (test5(29) != 0) abort (); if (test5(30) != 0) abort (); if (test5u(19) != 1) abort (); if (test5u(20) != 0) abort (); if (test5u(29) != 0) abort (); if (test5u(30) != 0) abort (); if (test6(0) != 0) abort (); if (test6(9) != 0) abort (); if (test6(10) != 0) abort (); if (test6(-1) != 0) abort (); if (test6(-9) != 0) abort (); if (test6(-10) != 1) abort (); if (test7(19) != 1) abort (); if (test7(20) != 1) abort (); if (test7(29) != 1) abort (); if (test7(30) != 0) abort (); if (test7u(19) != 1) abort (); if (test7u(20) != 1) abort (); if (test7u(29) != 1) abort (); if (test7u(30) != 0) abort (); if (test8(0) != 1) abort (); if (test8(9) != 1) abort (); if (test8(10) != 0) abort (); if (test8(-1) != 1) abort (); if (test8(-9) != 1) abort (); if (test8(-10) != 1) abort (); if (test8u(0) != 1) abort (); if (test8u(9) != 1) abort (); if (test8u(10) != 0) abort (); if (test8u(-1) != 0) abort (); if (test8u(-9) != 0) abort (); if (test8u(-10) != 0) abort (); if (test9(19) != 0) abort (); if (test9(20) != 0) abort (); if (test9(29) != 0) abort (); if (test9(30) != 1) abort (); if (test9u(19) != 0) abort (); if (test9u(20) != 0) abort (); if (test9u(29) != 0) abort (); if (test9u(30) != 1) abort (); if (test10(0) != 0) abort (); if (test10(9) != 0) abort (); if (test10(10) != 1) abort (); if (test10(-1) != 0) abort (); if (test10(-9) != 0) abort (); if (test10(-10) != 0) abort (); if (test10u(0) != 0) abort (); if (test10u(9) != 0) abort (); if (test10u(10) != 1) abort (); if (test10u(-1) != 1) abort (); if (test10u(-9) != 1) abort (); if (test10u(-10) != 1) abort (); if (test11(19) != 0) abort (); if (test11(20) != 1) abort (); if (test11(29) != 1) abort (); if (test11(30) != 1) abort (); if (test11u(19) != 0) abort (); if (test11u(20) != 1) abort (); if (test11u(29) != 1) abort (); if (test11u(30) != 1) abort (); if (test12(0) != 1) abort (); if (test12(9) != 1) abort (); if (test12(10) != 1) abort (); if (test12(-1) != 1) abort (); if (test12(-9) != 1) abort (); if (test12(-10) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/divcmp-2.c ================================================ extern void abort (void); int test1(int x) { return x/10 == 2; } int test2(int x) { return x/10 == 0; } int test3(int x) { return x/10 == -2; } int test4(int x) { return x/-10 == 2; } int test5(int x) { return x/-10 == 0; } int test6(int x) { return x/-10 == -2; } int main() { if (test1(19) != 0) abort (); if (test1(20) != 1) abort (); if (test1(29) != 1) abort (); if (test1(30) != 0) abort (); if (test2(-10) != 0) abort (); if (test2(-9) != 1) abort (); if (test2(9) != 1) abort (); if (test2(10) != 0) abort (); if (test3(-30) != 0) abort (); if (test3(-29) != 1) abort (); if (test3(-20) != 1) abort (); if (test3(-19) != 0) abort (); if (test4(-30) != 0) abort (); if (test4(-29) != 1) abort (); if (test4(-20) != 1) abort (); if (test4(-19) != 0) abort (); if (test5(-10) != 0) abort (); if (test5(-9) != 1) abort (); if (test5(9) != 1) abort (); if (test5(10) != 0) abort (); if (test6(19) != 0) abort (); if (test6(20) != 1) abort (); if (test6(29) != 1) abort (); if (test6(30) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/divcmp-3.c ================================================ extern void abort(void); int test1(char x) { return x/100 == 3; } int test1u(unsigned char x) { return x/100 == 3; } int test2(char x) { return x/100 != 3; } int test2u(unsigned char x) { return x/100 != 3; } int test3(char x) { return x/100 < 3; } int test3u(unsigned char x) { return x/100 < 3; } int test4(char x) { return x/100 <= 3; } int test4u(unsigned char x) { return x/100 <= 3; } int test5(char x) { return x/100 > 3; } int test5u(unsigned char x) { return x/100 > 3; } int test6(char x) { return x/100 >= 3; } int test6u(unsigned char x) { return x/100 >= 3; } int main() { int c; for (c=-128; c<256; c++) { if (test1(c) != 0) abort (); if (test1u(c) != 0) abort (); if (test2(c) != 1) abort (); if (test2u(c) != 1) abort (); if (test3(c) != 1) abort (); if (test3u(c) != 1) abort (); if (test4(c) != 1) abort (); if (test4u(c) != 1) abort (); if (test5(c) != 0) abort (); if (test5u(c) != 0) abort (); if (test6(c) != 0) abort (); if (test6u(c) != 0) abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/divcmp-4.c ================================================ /* PR middle-end/17894 */ extern void abort(void); int test1(int x) { return x/-10 == 2; } int test2(int x) { return x/-10 == 0; } int test3(int x) { return x/-10 != 2; } int test4(int x) { return x/-10 != 0; } int test5(int x) { return x/-10 < 2; } int test6(int x) { return x/-10 < 0; } int test7(int x) { return x/-10 <= 2; } int test8(int x) { return x/-10 <= 0; } int test9(int x) { return x/-10 > 2; } int test10(int x) { return x/-10 > 0; } int test11(int x) { return x/-10 >= 2; } int test12(int x) { return x/-10 >= 0; } int main() { if (test1(-30) != 0) abort (); if (test1(-29) != 1) abort (); if (test1(-20) != 1) abort (); if (test1(-19) != 0) abort (); if (test2(0) != 1) abort (); if (test2(9) != 1) abort (); if (test2(10) != 0) abort (); if (test2(-1) != 1) abort (); if (test2(-9) != 1) abort (); if (test2(-10) != 0) abort (); if (test3(-30) != 1) abort (); if (test3(-29) != 0) abort (); if (test3(-20) != 0) abort (); if (test3(-19) != 1) abort (); if (test4(0) != 0) abort (); if (test4(9) != 0) abort (); if (test4(10) != 1) abort (); if (test4(-1) != 0) abort (); if (test4(-9) != 0) abort (); if (test4(-10) != 1) abort (); if (test5(-30) != 0) abort (); if (test5(-29) != 0) abort (); if (test5(-20) != 0) abort (); if (test5(-19) != 1) abort (); if (test6(0) != 0) abort (); if (test6(9) != 0) abort (); if (test6(10) != 1) abort (); if (test6(-1) != 0) abort (); if (test6(-9) != 0) abort (); if (test6(-10) != 0) abort (); if (test7(-30) != 0) abort (); if (test7(-29) != 1) abort (); if (test7(-20) != 1) abort (); if (test7(-19) != 1) abort (); if (test8(0) != 1) abort (); if (test8(9) != 1) abort (); if (test8(10) != 1) abort (); if (test8(-1) != 1) abort (); if (test8(-9) != 1) abort (); if (test8(-10) != 0) abort (); if (test9(-30) != 1) abort (); if (test9(-29) != 0) abort (); if (test9(-20) != 0) abort (); if (test9(-19) != 0) abort (); if (test10(0) != 0) abort (); if (test10(9) != 0) abort (); if (test10(10) != 0) abort (); if (test10(-1) != 0) abort (); if (test10(-9) != 0) abort (); if (test10(-10) != 1) abort (); if (test11(-30) != 1) abort (); if (test11(-29) != 1) abort (); if (test11(-20) != 1) abort (); if (test11(-19) != 0) abort (); if (test12(0) != 1) abort (); if (test12(9) != 1) abort (); if (test12(10) != 0) abort (); if (test12(-1) != 1) abort (); if (test12(-9) != 1) abort (); if (test12(-10) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/divcmp-5.c ================================================ /* PR middle-end/26561 */ extern void abort(void); int always_one_1 (int a) { if (a/100 >= -999999999) return 1; else return 0; } int always_one_2 (int a) { if (a/100 < -999999999) return 0; else return 1; } int main(void) { if (always_one_1 (0) != 1) abort (); if (always_one_2 (0) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/divconst-1.c ================================================ typedef struct { unsigned a, b, c, d; } t1; f (t1 *ps) { ps->a = 10000; ps->b = ps->a / 3; ps->c = 10000; ps->d = ps->c / 3; } main () { t1 s; f (&s); if (s.a != 10000 || s.b != 3333 || s.c != 10000 || s.d != 3333) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/divconst-2.c ================================================ long f (long x) { return x / (-0x7fffffffL - 1L); } long r (long x) { return x % (-0x7fffffffL - 1L); } /* Since we have a negative divisor, this equation must hold for the results of / and %; no specific results are guaranteed. */ long std_eqn (long num, long denom, long quot, long rem) { /* For completeness, a check for "ABS (rem) < ABS (denom)" belongs here, but causes trouble on 32-bit machines and isn't worthwhile. */ return quot * (-0x7fffffffL - 1L) + rem == num; } long nums[] = { -1L, 0x7fffffffL, -0x7fffffffL - 1L }; main () { int i; for (i = 0; i < sizeof (nums) / sizeof (nums[0]); i++) if (std_eqn (nums[i], -0x7fffffffL - 1L, f (nums[i]), r (nums[i])) == 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/divconst-3.c ================================================ long long f (long long x) { return x / 10000000000LL; } main () { if (f (10000000000LL) != 1 || f (100000000000LL) != 10) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/divmod-1.c ================================================ div1 (signed char x) { return x / -1; } div2 (signed short x) { return x / -1; } div3 (signed char x, signed char y) { return x / y; } div4 (signed short x, signed short y) { return x / y; } mod1 (signed char x) { return x % -1; } mod2 (signed short x) { return x % -1; } mod3 (signed char x, signed char y) { return x % y; } mod4 (signed short x, signed short y) { return x % y; } signed long mod5 (signed long x, signed long y) { return x % y; } unsigned long mod6 (unsigned long x, unsigned long y) { return x % y; } main () { if (div1 (-(1 << 7)) != 1 << 7) abort (); if (div2 (-(1 << 15)) != 1 << 15) abort (); if (div3 (-(1 << 7), -1) != 1 << 7) abort (); if (div4 (-(1 << 15), -1) != 1 << 15) abort (); if (mod1 (-(1 << 7)) != 0) abort (); if (mod2 (-(1 << 15)) != 0) abort (); if (mod3 (-(1 << 7), -1) != 0) abort (); if (mod4 (-(1 << 15), -1) != 0) abort (); if (mod5 (0x50000000, 2) != 0) abort (); if (mod6 (0x50000000, 2) != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/doloop-1.c ================================================ #include extern void exit (int); extern void abort (void); volatile unsigned int i; int main (void) { unsigned char z = 0; do ++i; while (--z > 0); if (i != UCHAR_MAX + 1U) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/doloop-2.c ================================================ #include extern void exit (int); extern void abort (void); volatile unsigned int i; int main (void) { unsigned short z = 0; do ++i; while (--z > 0); if (i != USHRT_MAX + 1U) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/eeprof-1.c ================================================ /* { dg-require-effective-target return_address } */ /* { dg-options "-finstrument-functions" } */ /* { dg-xfail-run-if "" { powerpc-ibm-aix* } "*" "" } */ extern void abort (void); #define ASSERT(X) if (!(X)) abort (); #define NOCHK __attribute__ ((no_instrument_function)) int entry_calls, exit_calls; void (*last_fn_entered)(); void (*last_fn_exited)(); __attribute__ ((noinline)) int main () NOCHK; __attribute__ ((noinline)) void foo () { ASSERT (last_fn_entered == foo); } __attribute__ ((noinline)) static void foo2 () { ASSERT (entry_calls == 1 && exit_calls == 0); ASSERT (last_fn_entered == foo2); foo (); ASSERT (entry_calls == 2 && exit_calls == 1); ASSERT (last_fn_entered == foo); ASSERT (last_fn_exited == foo); } __attribute__ ((noinline)) void nfoo (void) NOCHK; void nfoo () { ASSERT (entry_calls == 2 && exit_calls == 2); ASSERT (last_fn_entered == foo); ASSERT (last_fn_exited == foo2); foo (); ASSERT (entry_calls == 3 && exit_calls == 3); ASSERT (last_fn_entered == foo); ASSERT (last_fn_exited == foo); } int main () { ASSERT (entry_calls == 0 && exit_calls == 0); foo2 (); ASSERT (entry_calls == 2 && exit_calls == 2); ASSERT (last_fn_entered == foo); ASSERT (last_fn_exited == foo2); nfoo (); ASSERT (entry_calls == 3 && exit_calls == 3); ASSERT (last_fn_entered == foo); return 0; } void __cyg_profile_func_enter (void (*fn)(), void (*parent)()) NOCHK; void __cyg_profile_func_exit (void (*fn)(), void (*parent)()) NOCHK; __attribute__ ((noinline)) void __cyg_profile_func_enter (void (*fn)(), void (*parent)()) { entry_calls++; last_fn_entered = fn; } __attribute__ ((noinline)) void __cyg_profile_func_exit (void (*fn)(), void (*parent)()) { exit_calls++; last_fn_exited = fn; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/enum-1.c ================================================ typedef enum { END = -1, EMPTY = (1 << 8 ) , BACKREF, BEGLINE, ENDLINE, BEGWORD, ENDWORD, LIMWORD, NOTLIMWORD, QMARK, STAR, PLUS, REPMN, CAT, OR, ORTOP, LPAREN, RPAREN, CSET } token; static token tok; static int atom () { if ((tok >= 0 && tok < (1 << 8 ) ) || tok >= CSET || tok == BACKREF || tok == BEGLINE || tok == ENDLINE || tok == BEGWORD || tok == ENDWORD || tok == LIMWORD || tok == NOTLIMWORD) return 1; else return 0; } main () { tok = 0; if (atom () != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/enum-2.c ================================================ /* Copyright (C) 2000 Free Software Foundation */ /* by Alexandre Oliva */ enum foo { FOO, BAR }; /* Even though the underlying type of an enum is unspecified, the type of enumeration constants is explicitly defined as int (6.4.4.3/2 in the C99 Standard). Therefore, `i' must not be promoted to `unsigned' in the comparison below; we must exit the loop when it becomes negative. */ int main () { int i; for (i = BAR; i >= FOO; --i) if (i == -1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/enum-3.c ================================================ /* The composite type of int and an enum compatible with int might be either of the two types, but it isn't an unsigned type. */ /* Origin: Joseph Myers */ #include #include extern void abort (void); extern void exit (int); enum e { a = INT_MIN }; int *p; enum e *q; int main (void) { enum e x = a; q = &x; if (*(1 ? q : p) > 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/execute.exp ================================================ # Copyright (C) 1991-2016 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GCC; see the file COPYING3. If not see # . # This file was written by Rob Savoye. (rob@cygnus.com) # Modified and maintained by Jeffrey Wheat (cassidy@cygnus.com) # # These tests come from Torbjorn Granlund (tege@cygnus.com) # C torture test suite. # # Load support procs. load_lib gcc-dg.exp # Initialize `dg'. dg-init # Main loop. set saved-dg-do-what-default ${dg-do-what-default} set dg-do-what-default "run" gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" "-w" set dg-do-what-default ${saved-dg-do-what-default} # All done. dg-finish ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/extzvsi.c ================================================ /* The bit-field below would have a problem if __INT_MAX__ is too small. */ #if __INT_MAX__ < 2147483647 int main (void) { exit (0); } #else /* Failed on powerpc due to bad extzvsi pattern. */ struct ieee { unsigned int negative:1; unsigned int exponent:11; unsigned int mantissa0:20; unsigned int mantissa1:32; } x; unsigned int foo (void) { unsigned int exponent; exponent = x.exponent; if (exponent == 0) return 1; else if (exponent > 1) return 2; return 0; } int main (void) { x.exponent = 1; if (foo () != 0) abort (); return 0; } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ffs-1.c ================================================ __volatile int a = 0; extern void abort (void); extern void exit (int); int main (void) { if (__builtin_ffs (a) != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ffs-2.c ================================================ struct { int input; int output; } ffstesttab[] = { #if __INT_MAX__ >= 2147483647 /* at least 32-bit integers */ { 0x80000000, 32 }, { 0xa5a5a5a5, 1 }, { 0x5a5a5a5a, 2 }, { 0xcafe0000, 18 }, #endif #if __INT_MAX__ >= 32767 /* at least 16-bit integers */ { 0x8000, 16 }, { 0xa5a5, 1 }, { 0x5a5a, 2 }, { 0x0ca0, 6 }, #endif #if __INT_MAX__ < 32767 #error integers are too small #endif }; #define NFFSTESTS (sizeof (ffstesttab) / sizeof (ffstesttab[0])) extern void abort (void); extern void exit (int); int main (void) { int i; for (i = 0; i < NFFSTESTS; i++) { if (__builtin_ffs (ffstesttab[i].input) != ffstesttab[i].output) abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/float-floor.c ================================================ #if(__SIZEOF_DOUBLE__==8) double d = 1024.0 - 1.0 / 32768.0; #else double d = 1024.0 - 1.0 / 16384.0; #endif extern double floor(double); extern float floorf(float); extern void abort(); int main() { double df = floor(d); float f1 = (float)floor(d); if ((int)df != 1023 || (int)f1 != 1023) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/floatunsisf-1.c ================================================ /* The fp-bit.c function __floatunsisf had a latent bug where guard bits could be lost leading to incorrect rounding. */ /* Origin: Joseph Myers */ extern void abort (void); extern void exit (int); #if __INT_MAX__ >= 0x7fffffff volatile unsigned u = 0x80000081; #else volatile unsigned long u = 0x80000081; #endif volatile float f1, f2; int main (void) { f1 = (float) u; f2 = (float) 0x80000081; if (f1 != f2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/fprintf-1.c ================================================ /* { dg-skip-if "requires io" { freestanding } { "*" } { "" } } */ #include #include int main (void) { #define test(ret, args...) \ fprintf (stdout, args); \ if (fprintf (stdout, args) != ret) \ abort (); test (5, "hello"); test (6, "hello\n"); test (1, "a"); test (0, ""); test (5, "%s", "hello"); test (6, "%s", "hello\n"); test (1, "%s", "a"); test (0, "%s", ""); test (1, "%c", 'x'); test (7, "%s\n", "hello\n"); test (2, "%d\n", 0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/fprintf-chk-1.c ================================================ /* { dg-skip-if "requires io" { freestanding } { "*" } { "" } } */ #include #include #include volatile int should_optimize; int __attribute__((noinline)) __fprintf_chk (FILE *f, int flag, const char *fmt, ...) { va_list ap; int ret; #ifdef __OPTIMIZE__ if (should_optimize) abort (); #endif should_optimize = 1; va_start (ap, fmt); ret = vfprintf (f, fmt, ap); va_end (ap); return ret; } int main (void) { #define test(ret, opt, args...) \ should_optimize = opt; \ __fprintf_chk (stdout, 1, args); \ if (!should_optimize) \ abort (); \ should_optimize = 0; \ if (__fprintf_chk (stdout, 1, args) != ret) \ abort (); \ if (!should_optimize) \ abort (); test (5, 1, "hello"); test (6, 1, "hello\n"); test (1, 1, "a"); test (0, 1, ""); test (5, 1, "%s", "hello"); test (6, 1, "%s", "hello\n"); test (1, 1, "%s", "a"); test (0, 1, "%s", ""); test (1, 1, "%c", 'x'); test (7, 0, "%s\n", "hello\n"); test (2, 0, "%d\n", 0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/frame-address.c ================================================ /* { dg-require-effective-target return_address } */ int check_fa_work (const char *, const char *) __attribute__((noinline)); int check_fa_mid (const char *) __attribute__((noinline)); int check_fa (char *) __attribute__((noinline)); int how_much (void) __attribute__((noinline)); int check_fa_work (const char *c, const char *f) { const char d = 0; if (c >= &d) return c >= f && f >= &d; else return c <= f && f <= &d; } int check_fa_mid (const char *c) { const char *f = __builtin_frame_address (0); /* Prevent a tail call to check_fa_work, eliding the current stack frame. */ return check_fa_work (c, f) != 0; } int check_fa (char *unused) { const char c = 0; /* Prevent a tail call to check_fa_mid, eliding the current stack frame. */ return check_fa_mid (&c) != 0; } int how_much (void) { return 8; } int main (void) { char *unused = __builtin_alloca (how_much ()); if (!check_fa(unused)) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/func-ptr-1.c ================================================ static double f (float a); static double (*fp) (float a); main () { fp = f; if (fp ((float) 1) != 1.0) abort (); exit (0); } static double f (float a) { return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/gofast.c ================================================ /* { dg-skip-if "requires io" { freestanding } { "*" } { "" } } */ /* Program to test gcc's usage of the gofast library. */ /* The main guiding themes are to make it trivial to add test cases over time and to make it easy for a program to parse the output to see if the right libcalls are being made. */ #include float fp_add (float a, float b) { return a + b; } float fp_sub (float a, float b) { return a - b; } float fp_mul (float a, float b) { return a * b; } float fp_div (float a, float b) { return a / b; } float fp_neg (float a) { return -a; } double dp_add (double a, double b) { return a + b; } double dp_sub (double a, double b) { return a - b; } double dp_mul (double a, double b) { return a * b; } double dp_div (double a, double b) { return a / b; } double dp_neg (double a) { return -a; } double fp_to_dp (float f) { return f; } float dp_to_fp (double d) { return d; } int eqsf2 (float a, float b) { return a == b; } int nesf2 (float a, float b) { return a != b; } int gtsf2 (float a, float b) { return a > b; } int gesf2 (float a, float b) { return a >= b; } int ltsf2 (float a, float b) { return a < b; } int lesf2 (float a, float b) { return a <= b; } int eqdf2 (double a, double b) { return a == b; } int nedf2 (double a, double b) { return a != b; } int gtdf2 (double a, double b) { return a > b; } int gedf2 (double a, double b) { return a >= b; } int ltdf2 (double a, double b) { return a < b; } int ledf2 (double a, double b) { return a <= b; } float floatsisf (int i) { return i; } double floatsidf (int i) { return i; } int fixsfsi (float f) { return f; } int fixdfsi (double d) { return d; } unsigned int fixunssfsi (float f) { return f; } unsigned int fixunsdfsi (double d) { return d; } int fail_count = 0; int fail (char *msg) { fail_count++; fprintf (stderr, "Test failed: %s\n", msg); } int main() { if (fp_add (1, 1) != 2) fail ("fp_add 1+1"); if (fp_sub (3, 2) != 1) fail ("fp_sub 3-2"); if (fp_mul (2, 3) != 6) fail ("fp_mul 2*3"); if (fp_div (3, 2) != 1.5) fail ("fp_div 3/2"); if (fp_neg (1) != -1) fail ("fp_neg 1"); if (dp_add (1, 1) != 2) fail ("dp_add 1+1"); if (dp_sub (3, 2) != 1) fail ("dp_sub 3-2"); if (dp_mul (2, 3) != 6) fail ("dp_mul 2*3"); if (dp_div (3, 2) != 1.5) fail ("dp_div 3/2"); if (dp_neg (1) != -1) fail ("dp_neg 1"); if (fp_to_dp (1.5) != 1.5) fail ("fp_to_dp 1.5"); if (dp_to_fp (1.5) != 1.5) fail ("dp_to_fp 1.5"); if (floatsisf (1) != 1) fail ("floatsisf 1"); if (floatsidf (1) != 1) fail ("floatsidf 1"); if (fixsfsi (1.42) != 1) fail ("fixsfsi 1.42"); if (fixunssfsi (1.42) != 1) fail ("fixunssfsi 1.42"); if (fixdfsi (1.42) != 1) fail ("fixdfsi 1.42"); if (fixunsdfsi (1.42) != 1) fail ("fixunsdfsi 1.42"); if (eqsf2 (1, 1) == 0) fail ("eqsf2 1==1"); if (eqsf2 (1, 2) != 0) fail ("eqsf2 1==2"); if (nesf2 (1, 2) == 0) fail ("nesf2 1!=1"); if (nesf2 (1, 1) != 0) fail ("nesf2 1!=1"); if (gtsf2 (2, 1) == 0) fail ("gtsf2 2>1"); if (gtsf2 (1, 1) != 0) fail ("gtsf2 1>1"); if (gtsf2 (0, 1) != 0) fail ("gtsf2 0>1"); if (gesf2 (2, 1) == 0) fail ("gesf2 2>=1"); if (gesf2 (1, 1) == 0) fail ("gesf2 1>=1"); if (gesf2 (0, 1) != 0) fail ("gesf2 0>=1"); if (ltsf2 (1, 2) == 0) fail ("ltsf2 1<2"); if (ltsf2 (1, 1) != 0) fail ("ltsf2 1<1"); if (ltsf2 (1, 0) != 0) fail ("ltsf2 1<0"); if (lesf2 (1, 2) == 0) fail ("lesf2 1<=2"); if (lesf2 (1, 1) == 0) fail ("lesf2 1<=1"); if (lesf2 (1, 0) != 0) fail ("lesf2 1<=0"); if (fail_count != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.c ================================================ #if __INT_MAX__ != 2147483647 || (__LONG_LONG_MAX__ != 9223372036854775807ll && __LONG_MAX__ != 9223372036854775807ll) int main(void) { exit (0); } #else #if __LONG_MAX__ != 9223372036854775807ll typedef unsigned long long ull; #else typedef unsigned long ull; #endif typedef unsigned ul; union fl { float f; ul l; } uf; union dl { double d; ull ll; } ud; int failed = 0; void c(ull d, ul f) { ud.ll = d; uf.f = (float) ud.d; if (uf.l != f) { failed++; } } int main() { if (sizeof (float) != sizeof (ul) || sizeof (double) != sizeof (ull)) exit (0); #if (defined __arm__ || defined __thumb__) && ! (defined __ARMEB__ || defined __VFP_FP__) /* The ARM always stores FP numbers in big-wordian format, even when running in little-byteian mode. */ c(0x0000000036900000ULL, 0x00000000U); c(0x0000000136900000ULL, 0x00000001U); c(0xffffffff369fffffULL, 0x00000001U); c(0x0000000036A00000ULL, 0x00000001U); c(0xffffffff36A7ffffULL, 0x00000001U); c(0x0000000036A80000ULL, 0x00000002U); c(0xffffffff36AfffffULL, 0x00000002U); c(0x0000000036b00000ULL, 0x00000002U); c(0x0000000136b00000ULL, 0x00000002U); c(0xdfffffff380fffffULL, 0x007fffffU); c(0xe0000000380fffffULL, 0x00800000U); c(0xe0000001380fffffULL, 0x00800000U); c(0xffffffff380fffffULL, 0x00800000U); c(0x0000000038100000ULL, 0x00800000U); c(0x0000000138100000ULL, 0x00800000U); c(0x1000000038100000ULL, 0x00800000U); c(0x1000000138100000ULL, 0x00800001U); c(0x2fffffff38100000ULL, 0x00800001U); c(0x3000000038100000ULL, 0x00800002U); c(0x5000000038100000ULL, 0x00800002U); c(0x5000000138100000ULL, 0x00800003U); #else c(0x3690000000000000ULL, 0x00000000U); c(0x3690000000000001ULL, 0x00000001U); c(0x369fffffffffffffULL, 0x00000001U); c(0x36A0000000000000ULL, 0x00000001U); c(0x36A7ffffffffffffULL, 0x00000001U); c(0x36A8000000000000ULL, 0x00000002U); c(0x36AfffffffffffffULL, 0x00000002U); c(0x36b0000000000000ULL, 0x00000002U); c(0x36b0000000000001ULL, 0x00000002U); c(0x380fffffdfffffffULL, 0x007fffffU); c(0x380fffffe0000000ULL, 0x00800000U); c(0x380fffffe0000001ULL, 0x00800000U); c(0x380fffffffffffffULL, 0x00800000U); c(0x3810000000000000ULL, 0x00800000U); c(0x3810000000000001ULL, 0x00800000U); c(0x3810000010000000ULL, 0x00800000U); c(0x3810000010000001ULL, 0x00800001U); c(0x381000002fffffffULL, 0x00800001U); c(0x3810000030000000ULL, 0x00800002U); c(0x3810000050000000ULL, 0x00800002U); c(0x3810000050000001ULL, 0x00800003U); #endif if (failed) abort (); else exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x ================================================ if {[istarget "m68k-*-*"] && [check_effective_target_coldfire_fpu]} { # ColdFire FPUs require software handling of subnormals. We are # not aware of any system that has this. set torture_execute_xfail "m68k-*-*" } if [istarget "avr-*-*"] { # AVR doubles are floats return 1 } if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } { # C6X floating point hardware turns denormals to zero in FP conversions. set torture_execute_xfail "tic6x-*-*" return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/20001122-1.c ================================================ volatile double a, *p; int main () { double c, d; volatile double b; d = 1.0; p = &b; do { c = d; d = c * 0.5; b = 1 + d; } while (b != 1.0); a = 1.0 + c; if (a == 1.0) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/20010114-2.c ================================================ extern void exit (int); extern void abort (void); float rintf (float x) { static const float TWO23 = 8388608.0; if (__builtin_fabs (x) < TWO23) { if (x > 0.0) { x += TWO23; x -= TWO23; } else if (x < 0.0) { x = TWO23 - x; x = -(x - TWO23); } } return x; } int main (void) { if (rintf (-1.5) != -2.0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/20010114-2.x ================================================ if [istarget "spu-*-*"] { # This doesn't work on the SPU because single precision floats are # always rounded toward 0. return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/20010226-1.c ================================================ #include long double dfrom = 1.1L; long double m1; long double m2; unsigned long mant_long; int main() { /* Some targets don't support a conforming long double type. This is common with very small parts which set long double == float. Look to see if the type has at least 32 bits of precision. */ if (LDBL_EPSILON > 0x1p-31L) return 0; m1 = dfrom / 2.0L; m2 = m1 * 4294967296.0L; mant_long = ((unsigned long) m2) & 0xffffffff; if (mant_long == 0x8ccccccc) return 0; else abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/20011123-1.c ================================================ main() { double db1 = 1.7976931348623157e+308; long double ldb1 = db1; if (sizeof (double) != 8 || sizeof (long double) != 16) exit (0); if (ldb1 != 1.7976931348623157e+308) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/20030331-1.c ================================================ extern void exit (int); extern void abort (void); float x = -1.5f; float rintf () { static const float TWO23 = 8388608.0; if (__builtin_fabs (x) < TWO23) { if (x > 0.0) { x += TWO23; x -= TWO23; } else if (x < 0.0) { x = TWO23 - x; x = -(x - TWO23); } } return x; } int main (void) { if (rintf () != -2.0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/20030331-1.x ================================================ if [istarget "spu-*-*"] { # This doesn't work on the SPU because single precision floats are # always rounded toward 0. return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/20041213-1.c ================================================ extern double sqrt (double); extern void abort (void); int once; double foo (void) { if (once++) abort (); return 0.0 / 0.0; } double x; int main (void) { x = sqrt (foo ()); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/920518-1.c ================================================ unsigned u=2147483839;float f0=2147483648e0,f1=2147483904e0; main() { float f=u; if(f==f0) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/920518-1.x ================================================ if [istarget "spu-*-*"] { # This doesn't work on the SPU because single precision floats are # always rounded toward 0. return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.c ================================================ #include double normalize(x)double x;{if(x==0)x=0;return x;} main(){char b[9];sprintf(b,"%g",normalize(-0.0));if(strcmp(b,"0"))abort();exit(0);} ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/930529-1.c ================================================ main () { union { double d; unsigned char c[8]; } d; d.d = 1.0/7.0; if (sizeof (char) * 8 == sizeof (double)) { if (d.c[0] == 0x92 && d.c[1] == 0x24 && d.c[2] == 0x49 && d.c[3] == 0x92 && d.c[4] == 0x24 && d.c[5] == 0x49 && d.c[6] == 0xc2 && d.c[7] == 0x3f) exit (0); if (d.c[7] == 0x92 && d.c[6] == 0x24 && d.c[5] == 0x49 && d.c[4] == 0x92 && d.c[3] == 0x24 && d.c[2] == 0x49 && d.c[1] == 0xc2 && d.c[0] == 0x3f) exit (0); #if defined __arm__ || defined __thumb__ if (d.c[4] == 0x92 && d.c[5] == 0x24 && d.c[6] == 0x49 && d.c[7] == 0x92 && d.c[0] == 0x24 && d.c[1] == 0x49 && d.c[2] == 0xc2 && d.c[3] == 0x3f) exit (0); #endif abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/980619-1.c ================================================ int main(void) { float reale = 1.0f; float oneplus; int i; if (sizeof (float) != 4) exit (0); for (i = 0; ; i++) { oneplus = 1.0f + reale; if (oneplus == 1.0f) break; reale=reale/2.0f; } /* Assumes ieee754 accurate arithmetic above. */ if (i != 24) abort (); else exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/980619-1.x ================================================ # This used to fail on ia32, with or without -ffloat-store. # It works now, but some people think that's a fluke, so I'm # keeping this around just in case. #set torture_eval_before_execute { # # set compiler_conditional_xfail_data { # "ia32 fp rounding isn't pedantic" \ # "i?86-*-*" \ # { "-O3" "-O2" "-O1" "-Os"} \ # { "" } # } #} return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/acc1.c ================================================ /* Tail call optimizations would reverse the order of additions in func(). */ double func (const double *array) { double d = *array; if (d == 0.0) return d; else return d + func (array + 1); } int main () { double values[] = { 0.1e-100, 1.0, -1.0, 0.0 }; if (func (values) != 0.1e-100) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/acc2.c ================================================ /* Tail call optimizations would reverse the order of multiplications in func(). */ double func (const double *array) { double d = *array; if (d == 1.0) return d; else return d * func (array + 1); } int main () { double values[] = { __DBL_MAX__, 2.0, 0.5, 1.0 }; if (func (values) != __DBL_MAX__) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/builtin-nan-1.c ================================================ /* PR middle-end/19983 */ typedef __SIZE_TYPE__ size_t; extern void abort(void); extern int memcmp(const void *, const void *, size_t); double n1 = __builtin_nan("0x1"); double n2 = __builtin_nan("0X1"); int main() { if (memcmp (&n1, &n2, sizeof(double))) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/compare-fp-1.c ================================================ /* Copyright (C) 2004 Free Software Foundation. Test for correctness of composite floating-point comparisons. Written by Paolo Bonzini, 26th May 2004. */ extern void abort (void); #define TEST(c) if ((c) != ok) abort (); #define ORD(a, b) (!__builtin_isunordered ((a), (b))) #define UNORD(a, b) (__builtin_isunordered ((a), (b))) #define UNEQ(a, b) (__builtin_isunordered ((a), (b)) || ((a) == (b))) #define UNLT(a, b) (__builtin_isunordered ((a), (b)) || ((a) < (b))) #define UNLE(a, b) (__builtin_isunordered ((a), (b)) || ((a) <= (b))) #define UNGT(a, b) (__builtin_isunordered ((a), (b)) || ((a) > (b))) #define UNGE(a, b) (__builtin_isunordered ((a), (b)) || ((a) >= (b))) #define LTGT(a, b) (__builtin_islessgreater ((a), (b))) float pinf; float ninf; float NaN; int iuneq (float x, float y, int ok) { TEST (UNEQ (x, y)); TEST (!LTGT (x, y)); TEST (UNLE (x, y) && UNGE (x,y)); } int ieq (float x, float y, int ok) { TEST (ORD (x, y) && UNEQ (x, y)); } int iltgt (float x, float y, int ok) { TEST (!UNEQ (x, y)); /* Not optimizable. */ TEST (LTGT (x, y)); /* Same, __builtin_islessgreater does not trap. */ TEST (ORD (x, y) && (UNLT (x, y) || UNGT (x,y))); } int ine (float x, float y, int ok) { TEST (UNLT (x, y) || UNGT (x, y)); } int iunlt (float x, float y, int ok) { TEST (UNLT (x, y)); TEST (UNORD (x, y) || (x < y)); } int ilt (float x, float y, int ok) { TEST (ORD (x, y) && UNLT (x, y)); /* Not optimized */ TEST ((x <= y) && (x != y)); TEST ((x <= y) && (y != x)); TEST ((x != y) && (x <= y)); /* Not optimized */ TEST ((y != x) && (x <= y)); /* Not optimized */ } int iunle (float x, float y, int ok) { TEST (UNLE (x, y)); TEST (UNORD (x, y) || (x <= y)); } int ile (float x, float y, int ok) { TEST (ORD (x, y) && UNLE (x, y)); /* Not optimized */ TEST ((x < y) || (x == y)); TEST ((y > x) || (x == y)); TEST ((x == y) || (x < y)); /* Not optimized */ TEST ((y == x) || (x < y)); /* Not optimized */ } int iungt (float x, float y, int ok) { TEST (UNGT (x, y)); TEST (UNORD (x, y) || (x > y)); } int igt (float x, float y, int ok) { TEST (ORD (x, y) && UNGT (x, y)); /* Not optimized */ TEST ((x >= y) && (x != y)); TEST ((x >= y) && (y != x)); TEST ((x != y) && (x >= y)); /* Not optimized */ TEST ((y != x) && (x >= y)); /* Not optimized */ } int iunge (float x, float y, int ok) { TEST (UNGE (x, y)); TEST (UNORD (x, y) || (x >= y)); } int ige (float x, float y, int ok) { TEST (ORD (x, y) && UNGE (x, y)); /* Not optimized */ TEST ((x > y) || (x == y)); TEST ((y < x) || (x == y)); TEST ((x == y) || (x > y)); /* Not optimized */ TEST ((y == x) || (x > y)); /* Not optimized */ } int main () { pinf = __builtin_inf (); ninf = -__builtin_inf (); NaN = __builtin_nan (""); iuneq (ninf, pinf, 0); iuneq (NaN, NaN, 1); iuneq (pinf, ninf, 0); iuneq (1, 4, 0); iuneq (3, 3, 1); iuneq (5, 2, 0); ieq (1, 4, 0); ieq (3, 3, 1); ieq (5, 2, 0); iltgt (ninf, pinf, 1); iltgt (NaN, NaN, 0); iltgt (pinf, ninf, 1); iltgt (1, 4, 1); iltgt (3, 3, 0); iltgt (5, 2, 1); ine (1, 4, 1); ine (3, 3, 0); ine (5, 2, 1); iunlt (NaN, ninf, 1); iunlt (pinf, NaN, 1); iunlt (pinf, ninf, 0); iunlt (pinf, pinf, 0); iunlt (ninf, ninf, 0); iunlt (1, 4, 1); iunlt (3, 3, 0); iunlt (5, 2, 0); ilt (1, 4, 1); ilt (3, 3, 0); ilt (5, 2, 0); iunle (NaN, ninf, 1); iunle (pinf, NaN, 1); iunle (pinf, ninf, 0); iunle (pinf, pinf, 1); iunle (ninf, ninf, 1); iunle (1, 4, 1); iunle (3, 3, 1); iunle (5, 2, 0); ile (1, 4, 1); ile (3, 3, 1); ile (5, 2, 0); iungt (NaN, ninf, 1); iungt (pinf, NaN, 1); iungt (pinf, ninf, 1); iungt (pinf, pinf, 0); iungt (ninf, ninf, 0); iungt (1, 4, 0); iungt (3, 3, 0); iungt (5, 2, 1); igt (1, 4, 0); igt (3, 3, 0); igt (5, 2, 1); iunge (NaN, ninf, 1); iunge (pinf, NaN, 1); iunge (ninf, pinf, 0); iunge (pinf, pinf, 1); iunge (ninf, ninf, 1); iunge (1, 4, 0); iunge (3, 3, 1); iunge (5, 2, 1); ige (1, 4, 0); ige (3, 3, 1); ige (5, 2, 1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/compare-fp-1.x ================================================ if [istarget "spu-*-*"] { # The SPU single-precision floating point format does not # support Nan & Inf. return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/compare-fp-2.c ================================================ /* Copyright (C) 2004 Free Software Foundation. Ensure that the composite comparison optimization doesn't misfire and attempt to combine an integer comparison with a floating-point one. Written by Paolo Bonzini, 26th May 2004. */ extern void abort (void); int foo (double x, double y) { /* If miscompiled the following may become false. */ return (x > y) && ((int)x == (int)y); } int main () { if (! foo (1.3,1.0)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/compare-fp-3.c ================================================ /* Copyright (C) 2004 Free Software Foundation. Test for composite comparison always true/false optimization. Written by Paolo Bonzini, 26th May 2004. */ extern void link_error0 (); extern void link_error1 (); void test1 (float x, float y) { if ((x==y) && (x!=y)) link_error0(); } void test2 (float x, float y) { if ((xy)) link_error0(); } void test3 (float x, float y) { if ((x=y) || (x= (b)) #define UNORD(a, b) (!ORD ((a), (b))) #define UNEQ(a, b) (!LTGT ((a), (b))) #define UNLT(a, b) (((a) < (b)) || __builtin_isunordered ((a), (b))) #define UNLE(a, b) (((a) <= (b)) || __builtin_isunordered ((a), (b))) #define UNGT(a, b) (((a) > (b)) || __builtin_isunordered ((a), (b))) #define UNGE(a, b) (((a) >= (b)) || __builtin_isunordered ((a), (b))) #define LTGT(a, b) (((a) < (b)) || (a) > (b)) float pinf; float ninf; float NaN; int iuneq (float x, float y, int ok) { TEST (UNEQ (x, y)); TEST (!LTGT (x, y)); TEST (UNLE (x, y) && UNGE (x,y)); } int ieq (float x, float y, int ok) { TEST (ORD (x, y) && UNEQ (x, y)); } int iltgt (float x, float y, int ok) { TEST (!UNEQ (x, y)); TEST (LTGT (x, y)); TEST (ORD (x, y) && (UNLT (x, y) || UNGT (x,y))); } int ine (float x, float y, int ok) { TEST (UNLT (x, y) || UNGT (x, y)); TEST ((x < y) || (x > y) || UNORD (x, y)); } int iunlt (float x, float y, int ok) { TEST (UNLT (x, y)); TEST (UNORD (x, y) || (x < y)); } int ilt (float x, float y, int ok) { TEST (ORD (x, y) && UNLT (x, y)); TEST ((x <= y) && (x != y)); TEST ((x <= y) && (y != x)); TEST ((x != y) && (x <= y)); TEST ((y != x) && (x <= y)); } int iunle (float x, float y, int ok) { TEST (UNLE (x, y)); TEST (UNORD (x, y) || (x <= y)); } int ile (float x, float y, int ok) { TEST (ORD (x, y) && UNLE (x, y)); TEST ((x < y) || (x == y)); TEST ((y > x) || (x == y)); TEST ((x == y) || (x < y)); TEST ((y == x) || (x < y)); } int iungt (float x, float y, int ok) { TEST (UNGT (x, y)); TEST (UNORD (x, y) || (x > y)); } int igt (float x, float y, int ok) { TEST (ORD (x, y) && UNGT (x, y)); TEST ((x >= y) && (x != y)); TEST ((x >= y) && (y != x)); TEST ((x != y) && (x >= y)); TEST ((y != x) && (x >= y)); } int iunge (float x, float y, int ok) { TEST (UNGE (x, y)); TEST (UNORD (x, y) || (x >= y)); } int ige (float x, float y, int ok) { TEST (ORD (x, y) && UNGE (x, y)); TEST ((x > y) || (x == y)); TEST ((y < x) || (x == y)); TEST ((x == y) || (x > y)); TEST ((y == x) || (x > y)); } int main () { pinf = __builtin_inf (); ninf = -__builtin_inf (); NaN = __builtin_nan (""); iuneq (ninf, pinf, 0); iuneq (NaN, NaN, 1); iuneq (pinf, ninf, 0); iuneq (1, 4, 0); iuneq (3, 3, 1); iuneq (5, 2, 0); ieq (1, 4, 0); ieq (3, 3, 1); ieq (5, 2, 0); iltgt (ninf, pinf, 1); iltgt (NaN, NaN, 0); iltgt (pinf, ninf, 1); iltgt (1, 4, 1); iltgt (3, 3, 0); iltgt (5, 2, 1); ine (1, 4, 1); ine (3, 3, 0); ine (5, 2, 1); iunlt (NaN, ninf, 1); iunlt (pinf, NaN, 1); iunlt (pinf, ninf, 0); iunlt (pinf, pinf, 0); iunlt (ninf, ninf, 0); iunlt (1, 4, 1); iunlt (3, 3, 0); iunlt (5, 2, 0); ilt (1, 4, 1); ilt (3, 3, 0); ilt (5, 2, 0); iunle (NaN, ninf, 1); iunle (pinf, NaN, 1); iunle (pinf, ninf, 0); iunle (pinf, pinf, 1); iunle (ninf, ninf, 1); iunle (1, 4, 1); iunle (3, 3, 1); iunle (5, 2, 0); ile (1, 4, 1); ile (3, 3, 1); ile (5, 2, 0); iungt (NaN, ninf, 1); iungt (pinf, NaN, 1); iungt (pinf, ninf, 1); iungt (pinf, pinf, 0); iungt (ninf, ninf, 0); iungt (1, 4, 0); iungt (3, 3, 0); iungt (5, 2, 1); igt (1, 4, 0); igt (3, 3, 0); igt (5, 2, 1); iunge (NaN, ninf, 1); iunge (pinf, NaN, 1); iunge (ninf, pinf, 0); iunge (pinf, pinf, 1); iunge (ninf, ninf, 1); iunge (1, 4, 0); iunge (3, 3, 1); iunge (5, 2, 1); ige (1, 4, 0); ige (3, 3, 1); ige (5, 2, 1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/compare-fp-4.x ================================================ # The ARM VxWorks kernel uses an external floating-point library in # which routines like __ledf2 are just aliases for __cmpdf2. These # routines therefore don't handle NaNs correctly. if [istarget "arm*-*-vxworks*"] { set torture_eval_before_execute { global compiler_conditional_xfail_data set compiler_conditional_xfail_data { "The ARM kernel uses a flawed floating-point library." { "*-*-*" } {} { "-mrtp" } } } } if [istarget "spu-*-*"] { # The SPU single-precision floating point format does not # support Nan & Inf. return 1 } lappend additional_flags "-fno-trapping-math" return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/copysign1.c ================================================ #include #include #include #define fpsizeoff sizeof(float) #define fpsizeof sizeof(double) #define fpsizeofl sizeof(long double) /* Work around the fact that with the Intel double-extended precision, we've got a 10 byte type stuffed into some amount of padding. And the fact that -ffloat-store is going to stuff this value temporarily into some bit of stack frame that we've no control over and can't zero. */ #if LDBL_MANT_DIG == 64 # if defined(__i386__) || defined(__x86_64__) || defined (__ia64__) # undef fpsizeofl # define fpsizeofl 10 # endif #endif /* Work around the fact that the sign of the second double in the IBM double-double format is not strictly specified when it contains a zero. For instance, -0.0L can be represented with either (-0.0, +0.0) or (-0.0, -0.0). The former is what we'll get from the compiler when it builds constants; the later is what we'll get from the negation operator at runtime. */ /* ??? This hack only works for big-endian, which is fortunately true for AIX and, Darwin. */ #if LDBL_MANT_DIG == 106 # undef fpsizeofl # define fpsizeofl sizeof(double) #endif #define TEST(TYPE, EXT) \ TYPE c##EXT (TYPE x, TYPE y) \ { \ return __builtin_copysign##EXT (x, y); \ } \ \ struct D##EXT { TYPE x, y, z; }; \ \ static const struct D##EXT T##EXT[] = { \ { 1.0, 2.0, 1.0 }, \ { 1.0, -2.0, -1.0 }, \ { -1.0, -2.0, -1.0 }, \ { 0.0, -2.0, -0.0 }, \ { -0.0, -2.0, -0.0 }, \ { -0.0, 2.0, 0.0 }, \ { __builtin_inf##EXT (), -0.0, -__builtin_inf##EXT () }, \ { -__builtin_nan##EXT (""), __builtin_inf##EXT (), \ __builtin_nan##EXT ("") } \ }; \ \ void test##EXT (void) \ { \ int i, n = sizeof (T##EXT) / sizeof (T##EXT[0]); \ TYPE r; \ for (i = 0; i < n; ++i) \ { \ r = c##EXT (T##EXT[i].x, T##EXT[i].y); \ if (memcmp (&r, &T##EXT[i].z, fpsizeof##EXT) != 0) \ abort (); \ } \ } TEST(float, f) TEST(double, ) TEST(long double, l) int main() { testf(); test(); testl(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/copysign2.c ================================================ #include #include #include #define fpsizeoff sizeof(float) #define fpsizeof sizeof(double) #define fpsizeofl sizeof(long double) /* Work around the fact that with the Intel double-extended precision, we've got a 10 byte type stuffed into some amount of padding. And the fact that -ffloat-store is going to stuff this value temporarily into some bit of stack frame that we've no control over and can't zero. */ #if LDBL_MANT_DIG == 64 # if defined(__i386__) || defined(__x86_64__) || defined (__ia64__) # undef fpsizeofl # define fpsizeofl 10 # endif #endif /* Work around the fact that the sign of the second double in the IBM double-double format is not strictly specified when it contains a zero. For instance, -0.0L can be represented with either (-0.0, +0.0) or (-0.0, -0.0). The former is what we'll get from the compiler when it builds constants; the later is what we'll get from the negation operator at runtime. */ /* ??? This hack only works for big-endian, which is fortunately true for AIX and Darwin. */ #if LDBL_MANT_DIG == 106 # undef fpsizeofl # define fpsizeofl sizeof(double) #endif #define TEST(TYPE, EXT) \ static TYPE Y##EXT[] = { \ 2.0, -2.0, -2.0, -2.0, -2.0, 2.0, -0.0, __builtin_inf##EXT () \ }; \ static const TYPE Z##EXT[] = { \ 1.0, -1.0, -1.0, -0.0, -0.0, 0.0, -__builtin_inf##EXT (), \ __builtin_nan##EXT ("") \ }; \ \ void test##EXT (void) \ { \ TYPE r[8]; \ int i; \ r[0] = __builtin_copysign##EXT (1.0, Y##EXT[0]); \ r[1] = __builtin_copysign##EXT (1.0, Y##EXT[1]); \ r[2] = __builtin_copysign##EXT (-1.0, Y##EXT[2]); \ r[3] = __builtin_copysign##EXT (0.0, Y##EXT[3]); \ r[4] = __builtin_copysign##EXT (-0.0, Y##EXT[4]); \ r[5] = __builtin_copysign##EXT (-0.0, Y##EXT[5]); \ r[6] = __builtin_copysign##EXT (__builtin_inf##EXT (), Y##EXT[6]); \ r[7] = __builtin_copysign##EXT (-__builtin_nan##EXT (""), Y##EXT[7]); \ for (i = 0; i < 8; ++i) \ if (memcmp (r+i, Z##EXT+i, fpsizeof##EXT) != 0) \ abort (); \ } TEST(float, f) TEST(double, ) TEST(long double, l) int main() { testf(); test(); testl(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.c ================================================ #ifndef SIGNAL_SUPPRESS #include #endif double dnan = 1.0/0.0 - 1.0/0.0; double x = 1.0; void leave () { exit (0); } main () { #if ! defined (__vax__) && ! defined (_CRAY) /* Move this line earlier, for architectures (like alpha) that issue SIGFPE on the first comparisons. */ #ifndef SIGNAL_SUPPRESS /* Some machines catches a SIGFPE when a NaN is compared. Let this test succeed o such machines. */ signal (SIGFPE, leave); #endif /* NaN is an IEEE unordered operand. All these test should be false. */ if (dnan == dnan) abort (); if (dnan != x) x = 1.0; else abort (); if (dnan < x) abort (); if (dnan > x) abort (); if (dnan <= x) abort (); if (dnan >= x) abort (); if (dnan == x) abort (); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.x ================================================ # The ARM VxWorks kernel uses an external floating-point library in # which routines like __ledf2 are just aliases for __cmpdf2. These # routines therefore don't handle NaNs correctly. if [istarget "arm*-*-vxworks*"] { set torture_eval_before_execute { global compiler_conditional_xfail_data set compiler_conditional_xfail_data { "The ARM kernel uses a flawed floating-point library." { "*-*-*" } {} { "-mrtp" } } } } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.c ================================================ #ifndef SIGNAL_SUPPRESS #include #endif float fnan = 1.0f/0.0f - 1.0f/0.0f; float x = 1.0f; void leave () { exit (0); } main () { #if ! defined (__vax__) && ! defined (_CRAY) /* Move this line earlier, for architectures (like alpha) that issue SIGFPE on the first comparisons. */ #ifndef SIGNAL_SUPPRESS /* Some machines catches a SIGFPE when a NaN is compared. Let this test succeed o such machines. */ signal (SIGFPE, leave); #endif /* NaN is an IEEE unordered operand. All these test should be false. */ if (fnan == fnan) abort (); if (fnan != x) x = 1.0; else abort (); if (fnan < x) abort (); if (fnan > x) abort (); if (fnan <= x) abort (); if (fnan >= x) abort (); if (fnan == x) abort (); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.x ================================================ # The ARM VxWorks kernel uses an external floating-point library in # which routines like __ledf2 are just aliases for __cmpdf2. These # routines therefore don't handle NaNs correctly. if [istarget "arm*-*-vxworks*"] { set torture_eval_before_execute { global compiler_conditional_xfail_data set compiler_conditional_xfail_data { "The ARM kernel uses a flawed floating-point library." { "*-*-*" } {} { "-mrtp" } } } } if [istarget "spu-*-*"] { # The SPU single-precision floating point format does not # support Nan & Inf. return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.c ================================================ #ifndef SIGNAL_SUPPRESS #include #endif long double dnan = 1.0l/0.0l - 1.0l/0.0l; long double x = 1.0l; void leave () { exit (0); } main () { #if ! defined (__vax__) && ! defined (_CRAY) /* Move this line earlier, for architectures (like alpha) that issue SIGFPE on the first comparisons. */ #ifndef SIGNAL_SUPPRESS /* Some machines catches a SIGFPE when a NaN is compared. Let this test succeed o such machines. */ signal (SIGFPE, leave); #endif /* NaN is an IEEE unordered operand. All these test should be false. */ if (dnan == dnan) abort (); if (dnan != x) x = 1.0; else abort (); if (dnan < x) abort (); if (dnan > x) abort (); if (dnan <= x) abort (); if (dnan >= x) abort (); if (dnan == x) abort (); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.x ================================================ # The ARM VxWorks kernel uses an external floating-point library in # which routines like __ledf2 are just aliases for __cmpdf2. These # routines therefore don't handle NaNs correctly. if [istarget "arm*-*-vxworks*"] { set torture_eval_before_execute { global compiler_conditional_xfail_data set compiler_conditional_xfail_data { "The ARM kernel uses a flawed floating-point library." { "*-*-*" } {} { "-mrtp" } } } } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.c ================================================ #ifndef FLOAT #define FLOAT double #endif void test_isunordered(FLOAT x, FLOAT y, int true) { if (__builtin_isunordered(x, y)) { if (! true) abort (); } else { if (true) abort (); } } void test_isless(FLOAT x, FLOAT y, int true) { if (__builtin_isless(x, y)) { if (! true) abort (); } else { if (true) abort (); } } void test_islessequal(FLOAT x, FLOAT y, int true) { if (__builtin_islessequal(x, y)) { if (! true) abort (); } else { if (true) abort (); } } void test_isgreater(FLOAT x, FLOAT y, int true) { if (__builtin_isgreater(x, y)) { if (! true) abort (); } else { if (true) abort (); } } void test_isgreaterequal(FLOAT x, FLOAT y, int true) { if (__builtin_isgreaterequal(x, y)) { if (! true) abort (); } else { if (true) abort (); } } void test_islessgreater(FLOAT x, FLOAT y, int true) { if (__builtin_islessgreater(x, y)) { if (! true) abort (); } else { if (true) abort (); } } #define NAN (0.0 / 0.0) int main() { struct try { FLOAT x, y; unsigned unord : 1; unsigned lt : 1; unsigned le : 1; unsigned gt : 1; unsigned ge : 1; unsigned lg : 1; }; static struct try const data[] = { { NAN, NAN, 1, 0, 0, 0, 0, 0 }, { 0.0, NAN, 1, 0, 0, 0, 0, 0 }, { NAN, 0.0, 1, 0, 0, 0, 0, 0 }, { 0.0, 0.0, 0, 0, 1, 0, 1, 0 }, { 1.0, 2.0, 0, 1, 1, 0, 0, 1 }, { 2.0, 1.0, 0, 0, 0, 1, 1, 1 }, }; const int n = sizeof(data) / sizeof(data[0]); int i; for (i = 0; i < n; ++i) { test_isunordered (data[i].x, data[i].y, data[i].unord); test_isless (data[i].x, data[i].y, data[i].lt); test_islessequal (data[i].x, data[i].y, data[i].le); test_isgreater (data[i].x, data[i].y, data[i].gt); test_isgreaterequal (data[i].x, data[i].y, data[i].ge); test_islessgreater (data[i].x, data[i].y, data[i].lg); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4e.c ================================================ #if defined (__ia64__) && defined (__hpux__) #define FLOAT __float80 #include "fp-cmp-4.c" #else int main () { return 0; } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.c ================================================ #define FLOAT float #include "fp-cmp-4.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.x ================================================ if [istarget "spu-*-*"] { # The SPU single-precision floating point format does not # support Nan & Inf. return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4l.c ================================================ #define FLOAT long double #include "fp-cmp-4.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-5.c ================================================ /* Like fp-cmp-4.c, but test that the setcc patterns are correct. */ static int test_isunordered(double x, double y) { return __builtin_isunordered(x, y); } static int test_not_isunordered(double x, double y) { return !__builtin_isunordered(x, y); } static int test_isless(double x, double y) { return __builtin_isless(x, y); } static int test_not_isless(double x, double y) { return !__builtin_isless(x, y); } static int test_islessequal(double x, double y) { return __builtin_islessequal(x, y); } static int test_not_islessequal(double x, double y) { return !__builtin_islessequal(x, y); } static int test_isgreater(double x, double y) { return __builtin_isgreater(x, y); } static int test_not_isgreater(double x, double y) { return !__builtin_isgreater(x, y); } static int test_isgreaterequal(double x, double y) { return __builtin_isgreaterequal(x, y); } static int test_not_isgreaterequal(double x, double y) { return !__builtin_isgreaterequal(x, y); } static int test_islessgreater(double x, double y) { return __builtin_islessgreater(x, y); } static int test_not_islessgreater(double x, double y) { return !__builtin_islessgreater(x, y); } static void one_test(double x, double y, int expected, int (*pos) (double, double), int (*neg) (double, double)) { if ((*pos)(x, y) != expected) abort (); if ((*neg)(x, y) != !expected) abort (); } #define NAN (0.0 / 0.0) int main() { struct try { double x, y; int result[6]; }; static struct try const data[] = { { NAN, NAN, { 1, 0, 0, 0, 0, 0 } }, { 0.0, NAN, { 1, 0, 0, 0, 0, 0 } }, { NAN, 0.0, { 1, 0, 0, 0, 0, 0 } }, { 0.0, 0.0, { 0, 0, 1, 0, 1, 0 } }, { 1.0, 2.0, { 0, 1, 1, 0, 0, 1 } }, { 2.0, 1.0, { 0, 0, 0, 1, 1, 1 } }, }; struct test { int (*pos)(double, double); int (*neg)(double, double); }; static struct test const tests[] = { { test_isunordered, test_not_isunordered }, { test_isless, test_not_isless }, { test_islessequal, test_not_islessequal }, { test_isgreater, test_not_isgreater }, { test_isgreaterequal, test_not_isgreaterequal }, { test_islessgreater, test_not_islessgreater } }; const int n = sizeof(data) / sizeof(data[0]); int i, j; for (i = 0; i < n; ++i) for (j = 0; j < 6; ++j) one_test (data[i].x, data[i].y, data[i].result[j], tests[j].pos, tests[j].neg); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-6.c ================================================ const double dnan = 1.0/0.0 - 1.0/0.0; double x = 1.0; extern void link_error (void); extern void abort (void); main () { #if ! defined (__vax__) && ! defined (_CRAY) /* NaN is an IEEE unordered operand. All these test should be false. */ if (dnan == dnan) link_error (); if (dnan != x) x = 1.0; else link_error (); if (dnan < x) link_error (); if (dnan > x) link_error (); if (dnan <= x) link_error (); if (dnan >= x) link_error (); if (dnan == x) link_error (); #endif exit (0); } #ifndef __OPTIMIZE__ void link_error (void) { abort (); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-6.x ================================================ # The ARM VxWorks kernel uses an external floating-point library in # which routines like __ledf2 are just aliases for __cmpdf2. These # routines therefore don't handle NaNs correctly. if [istarget "arm*-*-vxworks*"] { set torture_eval_before_execute { global compiler_conditional_xfail_data set compiler_conditional_xfail_data { "The ARM kernel uses a flawed floating-point library." { "*-*-*" } { "-O0" } { "-mrtp" } } } } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-7.c ================================================ extern void link_error (); void foo(double x) { if (x > __builtin_inf()) link_error (); } int main () { foo (1.0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8.c ================================================ #ifndef FLOAT #define FLOAT double #endif /* Like fp-cmp-4.c, but test that the cmove patterns are correct. */ static FLOAT test_isunordered(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return __builtin_isunordered(x, y) ? a : b; } static FLOAT test_not_isunordered(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return !__builtin_isunordered(x, y) ? a : b; } static FLOAT test_isless(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return __builtin_isless(x, y) ? a : b; } static FLOAT test_not_isless(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return !__builtin_isless(x, y) ? a : b; } static FLOAT test_islessequal(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return __builtin_islessequal(x, y) ? a : b; } static FLOAT test_not_islessequal(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return !__builtin_islessequal(x, y) ? a : b; } static FLOAT test_isgreater(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return __builtin_isgreater(x, y) ? a : b; } static FLOAT test_not_isgreater(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return !__builtin_isgreater(x, y) ? a : b; } static FLOAT test_isgreaterequal(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return __builtin_isgreaterequal(x, y) ? a : b; } static FLOAT test_not_isgreaterequal(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return !__builtin_isgreaterequal(x, y) ? a : b; } static FLOAT test_islessgreater(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return __builtin_islessgreater(x, y) ? a : b; } static FLOAT test_not_islessgreater(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return !__builtin_islessgreater(x, y) ? a : b; } static void one_test(FLOAT x, FLOAT y, int expected, FLOAT (*pos) (FLOAT, FLOAT, FLOAT, FLOAT), FLOAT (*neg) (FLOAT, FLOAT, FLOAT, FLOAT)) { if (((*pos)(x, y, 1.0, 2.0) == 1.0) != expected) abort (); if (((*neg)(x, y, 3.0, 4.0) == 4.0) != expected) abort (); } #define NAN (0.0 / 0.0) #define INF (1.0 / 0.0) int main() { struct try { FLOAT x, y; int result[6]; }; static struct try const data[] = { { NAN, NAN, { 1, 0, 0, 0, 0, 0 } }, { 0.0, NAN, { 1, 0, 0, 0, 0, 0 } }, { NAN, 0.0, { 1, 0, 0, 0, 0, 0 } }, { 0.0, 0.0, { 0, 0, 1, 0, 1, 0 } }, { 1.0, 2.0, { 0, 1, 1, 0, 0, 1 } }, { 2.0, 1.0, { 0, 0, 0, 1, 1, 1 } }, { INF, 0.0, { 0, 0, 0, 1, 1, 1 } }, { 1.0, INF, { 0, 1, 1, 0, 0, 1 } }, { INF, INF, { 0, 0, 1, 0, 1, 0 } }, { 0.0, -INF, { 0, 0, 0, 1, 1, 1 } }, { -INF, 1.0, { 0, 1, 1, 0, 0, 1 } }, { -INF, -INF, { 0, 0, 1, 0, 1, 0 } }, { INF, -INF, { 0, 0, 0, 1, 1, 1 } }, { -INF, INF, { 0, 1, 1, 0, 0, 1 } }, }; struct test { FLOAT (*pos)(FLOAT, FLOAT, FLOAT, FLOAT); FLOAT (*neg)(FLOAT, FLOAT, FLOAT, FLOAT); }; static struct test const tests[] = { { test_isunordered, test_not_isunordered }, { test_isless, test_not_isless }, { test_islessequal, test_not_islessequal }, { test_isgreater, test_not_isgreater }, { test_isgreaterequal, test_not_isgreaterequal }, { test_islessgreater, test_not_islessgreater } }; const int n = sizeof(data) / sizeof(data[0]); int i, j; for (i = 0; i < n; ++i) for (j = 0; j < 6; ++j) one_test (data[i].x, data[i].y, data[i].result[j], tests[j].pos, tests[j].neg); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8e.c ================================================ #if defined (__ia64__) && defined (__hpux__) #define FLOAT __float80 #include "fp-cmp-8.c" #else int main () { return 0; } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8f.c ================================================ #define FLOAT float #include "fp-cmp-8.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8f.x ================================================ if [istarget "spu-*-*"] { # The SPU single-precision floating point format does not # support Nan & Inf. return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8l.c ================================================ #define FLOAT long double #include "fp-cmp-8.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/hugeval.c ================================================ #include static const double zero = 0.0; static const double pone = 1.0; static const double none = -1.0; static const double pinf = 1.0 / 0.0; static const double ninf = -1.0 / 0.0; int main () { if (pinf != pone/zero) abort (); if (ninf != none/zero) abort (); #ifdef HUGE_VAL if (HUGE_VAL != pinf) abort (); if (-HUGE_VAL != ninf) abort (); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/hugeval.x ================================================ # This test fails under hpux 9.X and 10.X because HUGE_VAL is DBL_MAX # instead of +Infinity. global target_triplet if { [istarget "hppa*-*-hpux9*"] || [istarget "hppa*-*-hpux10*"] } { set torture_execute_xfail "$target_triplet" } # VxWorks kernel mode has the same problem. if {[istarget "*-*-vxworks*"]} { set torture_eval_before_execute { global compiler_conditional_xfail_data set compiler_conditional_xfail_data { "The kernel HUGE_VAL is defined to DBL_MAX instead of +Inf." { "*-*-*" } {} { "-mrtp" } } } } if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } { # C6X uses -freciprocal-math by default. set torture_execute_xfail "$target_triplet" return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp ================================================ # # Expect driver script for GCC Regression Tests # Copyright (C) 1993-2016 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GCC; see the file COPYING3. If not see # . # # Written by Jeffrey Wheat (cassidy@cygnus.com) # # Load support procs. load_lib gcc-dg.exp load_lib torture-options.exp load_lib c-torture.exp # These tests come from Torbjorn Granlund's (tege@cygnus.com) # C torture test suite, and other contributors. # Disable tests on machines with no hardware support for IEEE arithmetic. if { [istarget "vax-*-*"] || [ istarget "powerpc-*-*spe"] || [istarget "pdp11-*-*"] } { return } if $tracelevel then { strace $tracelevel } torture-init set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS set additional_flags "-fno-inline" # We must use -ffloat-store/-mieee to ensure that excess precision on some # machines does not cause problems if { ([istarget "i?86-*-*"] || [istarget "x86_64-*-*"]) && [check_effective_target_ia32] } then { lappend additional_flags "-ffloat-store" } if [istarget "m68k-*-*"] then { lappend additional_flags "-ffloat-store" } if { [istarget "alpha*-*-*"] || [istarget "sh*-*-*"] } then { lappend additional_flags "-mieee" } # load support procs load_lib c-torture.exp # initialize harness gcc_init # # main test loop # foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { # If we're only testing specific files and this isn't one of them, skip it. if ![runtest_file_p $runtests $src] then { continue } c-torture-execute $src $additional_flags } # All done. torture-finish gcc_finish ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/inf-1.c ================================================ extern void abort (void); int main() { #ifndef __SPU__ /* The SPU single-precision floating point format does not support Inf. */ float fi = __builtin_inff(); #endif double di = __builtin_inf(); long double li = __builtin_infl(); float fh = __builtin_huge_valf(); double dh = __builtin_huge_val(); long double lh = __builtin_huge_vall(); #ifndef __SPU__ if (fi + fi != fi) abort (); #endif if (di + di != di) abort (); if (li + li != li) abort (); #ifndef __SPU__ if (fi != fh) abort (); #endif if (di != dh) abort (); if (li != lh) abort (); #ifndef __SPU__ if (fi <= 0) abort (); #endif if (di <= 0) abort (); if (li <= 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/inf-2.c ================================================ extern void abort (void); void test(double f, double i) { if (f == __builtin_inf()) abort (); if (f == -__builtin_inf()) abort (); if (i == -__builtin_inf()) abort (); if (i != __builtin_inf()) abort (); if (f >= __builtin_inf()) abort (); if (f > __builtin_inf()) abort (); if (i > __builtin_inf()) abort (); if (f <= -__builtin_inf()) abort (); if (f < -__builtin_inf()) abort (); } void testf(float f, float i) { #ifndef __SPU__ /* The SPU single-precision floating point format does not support Inf. */ if (f == __builtin_inff()) abort (); if (f == -__builtin_inff()) abort (); if (i == -__builtin_inff()) abort (); if (i != __builtin_inff()) abort (); if (f >= __builtin_inff()) abort (); if (f > __builtin_inff()) abort (); if (i > __builtin_inff()) abort (); if (f <= -__builtin_inff()) abort (); if (f < -__builtin_inff()) abort (); #endif } void testl(long double f, long double i) { if (f == __builtin_infl()) abort (); if (f == -__builtin_infl()) abort (); if (i == -__builtin_infl()) abort (); if (i != __builtin_infl()) abort (); if (f >= __builtin_infl()) abort (); if (f > __builtin_infl()) abort (); if (i > __builtin_infl()) abort (); if (f <= -__builtin_infl()) abort (); if (f < -__builtin_infl()) abort (); } int main() { test (34.0, __builtin_inf()); testf (34.0f, __builtin_inff()); testl (34.0l, __builtin_infl()); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/inf-3.c ================================================ extern void abort (void); void test(double f, double i) { if (f == __builtin_huge_val()) abort (); if (f == -__builtin_huge_val()) abort (); if (i == -__builtin_huge_val()) abort (); if (i != __builtin_huge_val()) abort (); if (f >= __builtin_huge_val()) abort (); if (f > __builtin_huge_val()) abort (); if (i > __builtin_huge_val()) abort (); if (f <= -__builtin_huge_val()) abort (); if (f < -__builtin_huge_val()) abort (); } void testf(float f, float i) { if (f == __builtin_huge_valf()) abort (); if (f == -__builtin_huge_valf()) abort (); if (i == -__builtin_huge_valf()) abort (); if (i != __builtin_huge_valf()) abort (); if (f >= __builtin_huge_valf()) abort (); if (f > __builtin_huge_valf()) abort (); if (i > __builtin_huge_valf()) abort (); if (f <= -__builtin_huge_valf()) abort (); if (f < -__builtin_huge_valf()) abort (); } void testl(long double f, long double i) { if (f == __builtin_huge_vall()) abort (); if (f == -__builtin_huge_vall()) abort (); if (i == -__builtin_huge_vall()) abort (); if (i != __builtin_huge_vall()) abort (); if (f >= __builtin_huge_vall()) abort (); if (f > __builtin_huge_vall()) abort (); if (i > __builtin_huge_vall()) abort (); if (f <= -__builtin_huge_vall()) abort (); if (f < -__builtin_huge_vall()) abort (); } int main() { test (34.0, __builtin_huge_val()); testf (34.0f, __builtin_huge_valf()); testl (34.0l, __builtin_huge_vall()); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/minuszero.c ================================================ main () { union { double d; unsigned short i[sizeof (double) / sizeof (short)]; } u; int a = 0; int b = -5; int j; u.d = (double) a / b; /* Look for the right pattern, but be sloppy since we don't know the byte order. */ for (j = 0; j < sizeof (double) / sizeof (short); j++) { if (u.i[j] == 0x8000) exit (0); } abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.c ================================================ /* Check that certain subnormal numbers (formerly known as denormalized numbers) are rounded to within 0.5 ulp. PR other/14354. */ /* This test requires that float and unsigned int are the same size and that the sign-bit of the float is at MSB of the unsigned int. */ #if __INT_MAX__ != 2147483647L int main () { exit (0); } #else union uf { unsigned int u; float f; }; static float u2f (unsigned int v) { union uf u; u.u = v; return u.f; } static unsigned int f2u (float v) { union uf u; u.f = v; return u.u; } int ok = 1; static void tstmul (unsigned int ux, unsigned int uy, unsigned int ur) { float x = u2f (ux); float y = u2f (uy); if (f2u (x * y) != ur) /* Set a variable rather than aborting here, to simplify tracing when several computations are wrong. */ ok = 0; } /* We don't want to make this const and static, or else we risk inlining causing the test to fold as constants at compile-time. */ struct { unsigned int p1, p2, res; } expected[] = { {0xfff, 0x3f800400, 0xfff}, {0xf, 0x3fc88888, 0x17}, {0xf, 0x3f844444, 0xf} }; int main () { unsigned int i; for (i = 0; i < sizeof (expected) / sizeof (expected[0]); i++) { tstmul (expected[i].p1, expected[i].p2, expected[i].res); tstmul (expected[i].p2, expected[i].p1, expected[i].res); } if (!ok) abort (); exit (0); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x ================================================ if [istarget "epiphany-*-*"] { # The Epiphany single-precision floating point format does not # support subnormals. return 1 } if {[istarget "m68k-*-*"] && [check_effective_target_coldfire_fpu]} { # ColdFire FPUs require software handling of subnormals. We are # not aware of any system that has this. set torture_execute_xfail "m68k-*-*" } if [istarget "spu-*-*"] { # The SPU single-precision floating point format does not # support subnormals. return 1 } if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } { # C6X floating point hardware turns denormals to zero in multiplications. set torture_execute_xfail "tic6x-*-*" return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/mzero2.c ================================================ /* Test IEEE +0/-0 rules */ static double pzero = +0.0; static double nzero = -0.0; static double pinf = +1.0 / 0.0; static double ninf = -1.0 / 0.0; static double nan = 0.0 / 0.0; void expect (double value, double expected) { if (expected != expected) /* expected value is Not a number */ { if (value == value) /* actual value is a number */ abort (); } else if (value != value) abort (); /* actual value is a NaN */ else if (memcmp ((void *)&value, (void *)&expected, sizeof (double)) != 0) abort (); /* values don't match */ } main () { expect (pzero + pzero, pzero); expect (pzero + nzero, pzero); expect (nzero + pzero, pzero); expect (nzero + nzero, nzero); expect (pzero - pzero, pzero); expect (pzero - nzero, pzero); expect (nzero - pzero, nzero); expect (nzero - nzero, pzero); expect (pzero * pzero, pzero); expect (pzero * nzero, nzero); expect (nzero * pzero, nzero); expect (nzero * nzero, pzero); expect (+1.00 * pzero, pzero); expect (-1.00 * pzero, nzero); expect (+1.00 * nzero, nzero); expect (-1.00 * nzero, pzero); #ifndef _TMS320C6700 /* C6X floating point division is implemented using reciprocals. */ expect (pzero / pzero, nan); expect (pzero / nzero, nan); expect (nzero / pzero, nan); expect (nzero / nzero, nan); expect (+1.00 / pzero, pinf); expect (-1.00 / pzero, ninf); expect (+1.00 / nzero, ninf); expect (-1.00 / nzero, pinf); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/mzero2.x ================================================ # freebsd sets up the fpu with a different precision control which causes # this test to "fail". if { [istarget "i?86-*-freebsd*\[123\]\.*"] } { set torture_execute_xfail "i?86-*-freebsd*" } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/mzero3.c ================================================ /* Copyright (C) 2002 Free Software Foundation. by Hans-Peter Nilsson , derived from mzero2.c In the MMIX port, negdf2 was bogusly expanding -x into 0 - x. */ double nzerod = -0.0; float nzerof = -0.0; double zerod = 0.0; float zerof = 0.0; void expectd (double, double); void expectf (float, float); double negd (double); float negf (float); main () { expectd (negd (zerod), nzerod); expectf (negf (zerof), nzerof); expectd (negd (nzerod), zerod); expectf (negf (nzerof), zerof); exit (0); } void expectd (double value, double expected) { if (value != expected || memcmp ((void *)&value, (void *) &expected, sizeof (double)) != 0) abort (); } void expectf (float value, float expected) { if (value != expected || memcmp ((void *)&value, (void *) &expected, sizeof (float)) != 0) abort (); } double negd (double v) { return -v; } float negf (float v) { return -v; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/mzero4.c ================================================ /* Copyright (C) 2003 Free Software Foundation. by Roger Sayle , derived from mzero3.c Constant folding of sin(-0.0), tan(-0.0) and atan(-0.0) should all return -0.0, for both double and float forms. */ void abort (void); typedef __SIZE_TYPE__ size_t; extern int memcmp (const void *, const void *, size_t); double sin (double); double tan (double); double atan (double); float sinf (float); float tanf (float); float atanf (float); void expectd (double, double); void expectf (float, float); void expectd (double value, double expected) { if (value != expected || memcmp ((void *)&value, (void *) &expected, sizeof (double)) != 0) abort (); } void expectf (float value, float expected) { if (value != expected || memcmp ((void *)&value, (void *) &expected, sizeof (float)) != 0) abort (); } int main () { expectd (sin (0.0), 0.0); expectd (tan (0.0), 0.0); expectd (atan (0.0), 0.0); expectd (sin (-0.0), -0.0); expectd (tan (-0.0), -0.0); expectd (atan (-0.0), -0.0); expectf (sinf (0.0f), 0.0f); expectf (tanf (0.0f), 0.0f); expectf (atanf (0.0f), 0.0f); expectf (sinf (-0.0f), -0.0f); expectf (tanf (-0.0f), -0.0f); expectf (atanf (-0.0f), -0.0f); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/mzero5.c ================================================ /* Test gcse handling of IEEE 0/-0 rules. */ static double zero = 0.0; int negzero_check (double d) { if (d == 0) return !!memcmp ((void *)&zero, (void *)&d, sizeof (double)); return 0; } int sub (double d, double e) { if (d == 0.0 && e == 0.0 && negzero_check (d) == 0 && negzero_check (e) == 0) return 1; else return 0; } int main (void) { double minus_zero = -0.0; if (sub (minus_zero, 0)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/mzero6.c ================================================ /* Tail call optimizations would convert func() into the moral equivalent of: double acc = 0.0; for (int i = 0; i <= n; i++) acc += d; return acc; which mishandles the case where 'd' is -0. They also initialised 'acc' to a zero int rather than a zero double. */ double func (double d, int n) { if (n == 0) return d; else return d + func (d, n - 1); } int main () { if (__builtin_copysign (1.0, func (0.0 / -5.0, 10)) != -1.0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/pr28634.c ================================================ /* PR rtl-optimization/28634. On targets with delayed branches, dbr_schedule could do the next iteration's addition in the branch delay slot, then subtract the value again if the branch wasn't taken. This can lead to rounding errors. */ double x = -0x1.0p53; double y = 1; int main (void) { while (y > 0) y += x; if (y != x + 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/pr29302-1.c ================================================ extern void abort (void); int main (void) { int n; long double x; x = 1/0.0; n = (x == 1/0.0); if (n == 1) return 0; else abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/pr29302-1.x ================================================ if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } { # C6X uses -freciprocal-math by default. set torture_execute_xfail "tic6x-*-*" return 1 } return 0 if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } { # C6X uses -freciprocal-math by default. set torture_execute_xfail "tic6x-*-*" return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/pr30704.c ================================================ /* PR middle-end/30704 */ typedef __SIZE_TYPE__ size_t; extern void abort (void); extern int memcmp (const void *, const void *, size_t); extern void *memcpy (void *, const void *, size_t); long long f1 (void) { long long t; double d = 0x0.fffffffffffff000p-1022; memcpy (&t, &d, sizeof (long long)); return t; } double f2 (void) { long long t = 0x000fedcba9876543LL; double d; memcpy (&d, &t, sizeof (long long)); return d; } int main () { union { long long ll; double d; } u; if (sizeof (long long) != sizeof (double) || __DBL_MIN_EXP__ != -1021) return 0; u.ll = f1 (); if (u.d != 0x0.fffffffffffff000p-1022) abort (); u.d = f2 (); if (u.ll != 0x000fedcba9876543LL) abort (); double b = 234.0; long long c; double d = b; memcpy (&c, &b, sizeof (double)); long long e = c; if (memcmp (&e, &d, sizeof (double)) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/pr30704.x ================================================ if [istarget "avr-*-*"] { # AVR doubles are floats return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/pr36332.c ================================================ /* PR target/36332 */ int foo (long double ld) { return ld == __builtin_infl (); } int main () { if (foo (__LDBL_MAX__)) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/pr38016.c ================================================ #include "fp-cmp-8.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/pr38016.x ================================================ lappend additional_flags "-fno-ivopts" "-fno-gcse" return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/pr50310.c ================================================ /* PR target/50310 */ extern void abort (void); double s1[4], s2[4], s3[64]; void foo (void) { int i; for (i = 0; i < 4; i++) s3[0 * 4 + i] = __builtin_isgreater (s1[i], s2[i]) ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[1 * 4 + i] = (!__builtin_isgreater (s1[i], s2[i])) ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[2 * 4 + i] = __builtin_isgreaterequal (s1[i], s2[i]) ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[3 * 4 + i] = (!__builtin_isgreaterequal (s1[i], s2[i])) ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[4 * 4 + i] = __builtin_isless (s1[i], s2[i]) ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[5 * 4 + i] = (!__builtin_isless (s1[i], s2[i])) ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[6 * 4 + i] = __builtin_islessequal (s1[i], s2[i]) ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[7 * 4 + i] = (!__builtin_islessequal (s1[i], s2[i])) ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[8 * 4 + i] = __builtin_islessgreater (s1[i], s2[i]) ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[9 * 4 + i] = (!__builtin_islessgreater (s1[i], s2[i])) ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[10 * 4 + i] = __builtin_isunordered (s1[i], s2[i]) ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[11 * 4 + i] = (!__builtin_isunordered (s1[i], s2[i])) ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[12 * 4 + i] = s1[i] > s2[i] ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[13 * 4 + i] = s1[i] <= s2[i] ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[14 * 4 + i] = s1[i] < s2[i] ? -1.0 : 0.0; for (i = 0; i < 4; i++) s3[15 * 4 + i] = s1[i] >= s2[i] ? -1.0 : 0.0; } int main () { int i; s1[0] = 5.0; s1[1] = 6.0; s1[2] = 5.0; s1[3] = __builtin_nan (""); s2[0] = 6.0; s2[1] = 5.0; s2[2] = 5.0; s2[3] = 5.0; asm volatile ("" : : : "memory"); foo (); asm volatile ("" : : : "memory"); for (i = 0; i < 16 * 4; i++) if (i >= 12 * 4 && (i & 3) == 3) { if (s3[i] != 0.0) abort (); } else { static int masks[] = { 2, 2|4, 1, 1|4, 1|2, 8, 2, 1 }; if (s3[i] != (((1 << (i & 3)) & ((i & 4) ? ~masks[i / 8] : masks[i / 8])) ? -1.0 : 0.0)) abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/pr67218.c ================================================ extern void abort (void) __attribute__ ((noreturn)); double __attribute__ ((noinline, noclone)) foo (unsigned int x) { return (double) (float) (x | 0xffff0000); } int main () { if (foo (1) != 0x1.fffep31) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/pr72824-2.c ================================================ /* PR tree-optimization/72824 */ typedef float V __attribute__((vector_size (4 * sizeof (float)))); static inline void foo (V *x, V value) { int i; for (i = 0; i < 32; ++i) x[i] = value; } int main () { V x[32]; foo (x, (V) { 0.f, -0.f, 0.f, -0.f }); if (__builtin_copysignf (1.0, x[3][1]) != -1.0f) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/pr72824.c ================================================ /* PR tree-optimization/72824 */ static inline void foo (float *x, float value) { int i; for (i = 0; i < 32; ++i) x[i] = value; } int main () { float x[32]; foo (x, -0.f); if (__builtin_copysignf (1.0, x[3]) != -1.0f) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.c ================================================ #if defined(__i386__) && defined(__FreeBSD__) #include #endif double d (unsigned long long k) { double x; x = (double) k; return x; } float s (unsigned long long k) { float x; x = (float) k; return x; } main () { unsigned long long int k; double x; #if defined(__i386__) && defined(__FreeBSD__) /* This test case assumes extended-precision, but FreeBSD defaults to double-precision. Make it so. */ fpsetprec (FP_PE); #endif if (sizeof (double) >= 8) { k = 0x8693ba6d7d220401ULL; x = d (k); k = (unsigned long long) x; if (k != 0x8693ba6d7d220800ULL) abort (); } k = 0x8234508000000001ULL; x = s (k); k = (unsigned long long) x; #ifdef __SPU__ /* SPU float rounds towards zero. */ if (k != 0x8234500000000000ULL) abort (); #else if (k != 0x8234510000000000ULL) abort (); #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.x ================================================ # This doesn't work on d10v if doubles are not 64 bits if { [istarget "d10v-*-*"] && ! [string-match "*-mdouble64*" $CFLAGS] } { set torture_execute_xfail "d10v-*-*" } if [istarget "avr-*-*"] { # AVR doubles are floats return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.c ================================================ extern void abort(); typedef union { struct { unsigned int hi; unsigned int lo; } i; double d; } hexdouble; static const double twoTo52 = 0x1.0p+52; void func ( double x ) { hexdouble argument; register double y, z; unsigned int xHead; argument.d = x; xHead = argument.i.hi & 0x7fffffff; if (__builtin_expect(!!(xHead < 0x43300000u), 1)) { y = ( x - twoTo52 ) + twoTo52; if ( y != x ) abort(); z = x - 0.5; y = ( z - twoTo52 ) + twoTo52; if ( y == (( x - twoTo52 ) + twoTo52) ) abort(); } return; } int main() { if (sizeof (double) == 4) return 0; func((double)1.00); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.x ================================================ if [istarget "avr-*-*"] { # AVR doubles are floats return 1 } return 0 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ieee/unsafe-fp-assoc.c ================================================ #include extern void abort(void); static const double C = DBL_MAX; double foo(double x) { return ( ( (x * C) * C ) * C); } int main () { double d = foo (0.0); if (d != 0.0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ifcvt-onecmpl-abs-1.c ================================================ extern void abort(void); __attribute__ ((noinline)) int foo(int n) { if (n < 0) n = ~n; return n; } int main(void) { if (foo (-1) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/index-1.c ================================================ int a[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 }; int f (long n) { return a[n - 100000]; } main () { if (f (100030L) != 30) abort(); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/inst-check.c ================================================ #include f(m) { int i,s=0; for(i=0;i gt (a, b) { return a > b; } ge (a, b) { return a >= b; } lt (a, b) { return a < b; } le (a, b) { return a <= b; } void true (c) { if (!c) abort(); } void false (c) { if (c) abort(); } f () { true (gt (2, 1)); false (gt (1, 2)); true (gt (INT_MAX, 0)); false (gt (0, INT_MAX)); true (gt (INT_MAX, 1)); false (gt (1, INT_MAX)); false (gt (INT_MIN, 0)); true (gt (0, INT_MIN)); false (gt (INT_MIN, 1)); true (gt (1, INT_MIN)); true (gt (INT_MAX, INT_MIN)); false (gt (INT_MIN, INT_MAX)); true (ge (2, 1)); false (ge (1, 2)); true (ge (INT_MAX, 0)); false (ge (0, INT_MAX)); true (ge (INT_MAX, 1)); false (ge (1, INT_MAX)); false (ge (INT_MIN, 0)); true (ge (0, INT_MIN)); false (ge (INT_MIN, 1)); true (ge (1, INT_MIN)); true (ge (INT_MAX, INT_MIN)); false (ge (INT_MIN, INT_MAX)); false (lt (2, 1)); true (lt (1, 2)); false (lt (INT_MAX, 0)); true (lt (0, INT_MAX)); false (lt (INT_MAX, 1)); true (lt (1, INT_MAX)); true (lt (INT_MIN, 0)); false (lt (0, INT_MIN)); true (lt (INT_MIN, 1)); false (lt (1, INT_MIN)); false (lt (INT_MAX, INT_MIN)); true (lt (INT_MIN, INT_MAX)); false (le (2, 1)); true (le (1, 2)); false (le (INT_MAX, 0)); true (le (0, INT_MAX)); false (le (INT_MAX, 1)); true (le (1, INT_MAX)); true (le (INT_MIN, 0)); false (le (0, INT_MIN)); true (le (INT_MIN, 1)); false (le (1, INT_MIN)); false (le (INT_MAX, INT_MIN)); true (le (INT_MIN, INT_MAX)); } main () { f (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ipa-sra-1.c ================================================ /* Trivially making sure IPA-SRA does not introduce segfaults where they should not be. */ struct bovid { float red; int green; void *blue; }; static int __attribute__((noinline)) ox (int fail, struct bovid *cow) { int r; if (fail) r = cow->red; else r = 0; return r; } int main (int argc, char *argv[]) { int r; r = ox ((argc > 2000), (void *) 0); return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ipa-sra-2.c ================================================ /* { dg-require-effective-target int32plus } */ struct big { int data[1000000]; }; struct small { int data[10]; }; union both { struct big big; struct small small; }; extern void *calloc (__SIZE_TYPE__, __SIZE_TYPE__); extern void free (void *); static int __attribute__((noinline)) foo (int fail, union both *agg) { int r; if (fail) r = agg->big.data[999999]; else r = agg->small.data[0]; return r; } int main (int argc, char *argv[]) { union both *agg = calloc (1, sizeof (struct small)); int r; r = foo ((argc > 2000), agg); free (agg); return r; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/longlong.c ================================================ /* Source: PR 321 modified for test suite by Neil Booth 14 Jan 2001. */ typedef unsigned long long uint64; unsigned long pars; uint64 b[32]; uint64 *r = b; void alpha_ep_extbl_i_eq_0() { unsigned int rb, ra, rc; rb = (((unsigned long)(pars) >> 27)) & 0x1fUL; ra = (((unsigned int)(pars) >> 5)) & 0x1fUL; rc = (((unsigned int)(pars) >> 0)) & 0x1fUL; { uint64 temp = ((r[ra] >> ((r[rb] & 0x7) << 3)) & 0x00000000000000FFLL); if (rc != 31) r[rc] = temp; } } int main(void) { if (sizeof (uint64) == 8) { b[17] = 0x0000000000303882ULL; /* rb */ b[2] = 0x534f4f4c494d000aULL; /* ra & rc */ pars = 0x88000042; /* 17, 2, 2 coded */ alpha_ep_extbl_i_eq_0(); if (b[2] != 0x4d) abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-1.c ================================================ main () { int i, j, k[3]; j = 0; for (i=0; i < 3; i++) { k[i] = j++; } for (i=2; i >= 0; i--) { if (k[i] != i) abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-10.c ================================================ /* Reduced from PR optimization/5076, PR optimization/2847 */ static int count = 0; static void inc (void) { count++; } int main (void) { int iNbr = 1; int test = 0; while (test == 0) { inc (); if (iNbr == 0) break; else { inc (); iNbr--; } test = 1; } if (count != 2) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-11.c ================================================ static int a[199]; static void foo () { int i; for (i = 198; i >= 0; i--) a[i] = i; } int main () { int i; foo (); for (i = 0; i < 199; i++) if (a[i] != i) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-12.c ================================================ /* Checks that pure functions are not treated as const. */ char *p; static int __attribute__ ((pure)) is_end_of_statement (void) { return *p == '\n' || *p == ';' || *p == '!'; } void foo (void) { /* The is_end_of_statement call was moved out of the loop at one stage, resulting in an endless loop. */ while (!is_end_of_statement ()) p++; } int main (void) { p = "abc\n"; foo (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-13.c ================================================ /* PR opt/7130 */ #define TYPE long void scale (TYPE *alpha, TYPE *x, int n) { int i, ix; if (*alpha != 1) for (i = 0, ix = 0; i < n; i++, ix += 2) { TYPE tmpr, tmpi; tmpr = *alpha * x[ix]; tmpi = *alpha * x[ix + 1]; x[ix] = tmpr; x[ix + 1] = tmpi; } } int main (void) { int i; TYPE x[10]; TYPE alpha = 2; for (i = 0; i < 10; i++) x[i] = i; scale (&alpha, x, 5); if (x[9] != 18) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-14.c ================================================ int a3[3]; void f(int *a) { int i; for (i=3; --i;) a[i] = 42 / i; } int main () { f(a3); if (a3[1] != 42 || a3[2] != 21) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-15.c ================================================ /* Bombed with a segfault on powerpc-linux. doloop.c generated wrong loop count. */ void foo (unsigned long *start, unsigned long *end) { unsigned long *temp = end - 1; while (end > start) *end-- = *temp--; } int main (void) { unsigned long a[5]; int start, end, k; for (start = 0; start < 5; start++) for (end = 0; end < 5; end++) { for (k = 0; k < 5; k++) a[k] = k; foo (a + start, a + end); for (k = 0; k <= start; k++) if (a[k] != k) abort (); for (k = start + 1; k <= end; k++) if (a[k] != k - 1) abort (); for (k = end + 1; k < 5; k++) if (a[k] != k) abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-2.c ================================================ int a[2]; f (b) { unsigned int i; for (i = 0; i < b; i++) a[i] = i - 2; } main () { a[0] = a[1] = 0; f (2); if (a[0] != -2 || a[1] != -1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-2b.c ================================================ #include int a[2]; f (int i) { for (; i < INT_MAX; i++) { a[i] = -2; if (&a[i] == &a[1]) break; } } main () { a[0] = a[1] = 0; f (0); if (a[0] != -2 || a[1] != -2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-2c.c ================================================ /* { dg-options "-fgnu89-inline -Wno-pointer-to-int-cast" } */ extern void abort (void); extern void exit (int); int a[2]; __inline__ void f (int b, int o) { unsigned int i; int *p; for (p = &a[b], i = b; --i < ~0; ) *--p = i * 3 + o; } void g(int b) { f (b, (int)a); } int main () { a[0] = a[1] = 0; g (2); if (a[0] != (int)a || a[1] != (int)a + 3) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-2d.c ================================================ int a[2]; f (b) { unsigned int i; int *p; for (p = &a[b], i = b; --i < ~0; ) *--p = i * 3 + (int)a; } main () { a[0] = a[1] = 0; f (2); if (a[0] != (int)a || a[1] != (int)a + 3) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-2e.c ================================================ void f (int *p, int **q) { int i; for (i = 0; i < 40; i++) { *q++ = &p[i]; } } int main () { void *p; int *q[40]; __SIZE_TYPE__ start; /* Find the signed middle of the address space. */ if (sizeof(start) == sizeof(int)) start = (__SIZE_TYPE__) __INT_MAX__; else if (sizeof(start) == sizeof(long)) start = (__SIZE_TYPE__) __LONG_MAX__; else if (sizeof(start) == sizeof(long long)) start = (__SIZE_TYPE__) __LONG_LONG_MAX__; else return 0; /* Arbitrarily align the pointer. */ start &= -32; /* Pretend that's good enough to start address arithmetic. */ p = (void *)start; /* Verify that GIV replacement computes the correct results. */ q[39] = 0; f (p, q); if (q[39] != (int *)p + 39) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-2f.c ================================================ /* { dg-require-effective-target mmap } */ /* { dg-skip-if "the executable is at the same position the test tries to remap" { m68k-*-linux* } { "*" } { "" } } */ #include #include #include #include #include #ifndef MAP_ANON #ifdef MAP_ANONYMOUS #define MAP_ANON MAP_ANONYMOUS #else #define MAP_ANON MAP_FILE #endif #endif #ifndef MAP_FILE #define MAP_FILE 0 #endif #ifndef MAP_FIXED #define MAP_FIXED 0 #endif #define MAP_START (void *)0x7fff8000 #define MAP_LEN 0x10000 #define OFFSET (MAP_LEN/2 - 2 * sizeof (char)); f (int s, char *p) { int i; for (i = s; i >= 0 && &p[i] < &p[40]; i++) { p[i] = -2; } } main () { #ifdef MAP_ANON char *p; int dev_zero; dev_zero = open ("/dev/zero", O_RDONLY); /* -1 is OK when we have MAP_ANON; else mmap will flag an error. */ if (INT_MAX != 0x7fffffffL || sizeof (char *) != sizeof (int)) exit (0); p = mmap (MAP_START, MAP_LEN, PROT_READ|PROT_WRITE, MAP_ANON|MAP_FIXED|MAP_PRIVATE, dev_zero, 0); if (p != (char *)-1) { p += OFFSET; p[39] = 0; f (0, p); if (p[39] != (char)-2) abort (); p[39] = 0; f (-1, p); if (p[39] != 0) abort (); } #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-2g.c ================================================ /* { dg-require-effective-target mmap } */ /* { dg-skip-if "the executable is at the same position the test tries to remap" { m68k-*-linux* } { "*" } { "" } } */ #include #include #include #include #include #ifndef MAP_ANON #ifdef MAP_ANONYMOUS #define MAP_ANON MAP_ANONYMOUS #else #define MAP_ANON MAP_FILE #endif #endif #ifndef MAP_FILE #define MAP_FILE 0 #endif #ifndef MAP_FIXED #define MAP_FIXED 0 #endif #define MAP_START (void *)0x7fff8000 #define MAP_LEN 0x10000 #define OFFSET (MAP_LEN/2 - 2 * sizeof (char)); f (int s, char *p) { int i; for (i = s; &p[i] < &p[40] && i >= 0; i++) { p[i] = -2; } } main () { #ifdef MAP_ANON char *p; int dev_zero; dev_zero = open ("/dev/zero", O_RDONLY); /* -1 is OK when we have MAP_ANON; else mmap will flag an error. */ if (INT_MAX != 0x7fffffffL || sizeof (char *) != sizeof (int)) exit (0); p = mmap (MAP_START, MAP_LEN, PROT_READ|PROT_WRITE, MAP_ANON|MAP_FIXED|MAP_PRIVATE, dev_zero, 0); if (p != (char *)-1) { p += OFFSET; p[39] = 0; f (0, p); if (p[39] != (char)-2) abort (); p[39] = 0; f (-1, p); if (p[39] != 0) abort (); } #endif exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-3.c ================================================ #include int n = 0; g (i) { n++; } f (m) { int i; i = m; do { g (i * INT_MAX / 2); } while (--i > 0); } main () { f (4); if (n != 4) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-3b.c ================================================ #include int n = 0; g (i) { n++; } f (m) { int i; i = m; do { g (i * 4); i -= INT_MAX / 8; } while (i > 0); } main () { f (INT_MAX/8*4); if (n != 4) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-3c.c ================================================ #include void * a[255]; f (m) { int i; int sh = 0x100; i = m; do { a[sh >>= 1] = ((unsigned)i << 3) + (char*)a; i += 4; } while (i < INT_MAX/2 + 1 + 4 * 4); } main () { a[0x10] = 0; a[0x08] = 0; f (INT_MAX/2 + INT_MAX/4 + 2); if (a[0x10] || a[0x08]) abort (); a[0x10] = 0; a[0x08] = 0; f (INT_MAX/2 + 1); if (! a[0x10] || a[0x08]) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-4.c ================================================ int f() { int j = 1; long i; for (i = -0x70000000L; i < 0x60000000L; i += 0x10000000L) j <<= 1; return j; } int main () { if (f () != 8192) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-4b.c ================================================ int f() { int j = 1; long i; i = 0x60000000L; do { j <<= 1; i += 0x10000000L; } while (i < -0x60000000L); return j; } int main () { if (f () != 2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-5.c ================================================ static int ap(int i); static void testit(void){ int ir[4] = {0,1,2,3}; int ix,n,m; n=1; m=3; for (ix=1;ix<=4;ix++) { if (n == 1) m = 4; else m = n-1; ap(ir[n-1]); n = m; } } static int t = 0; static int a[4]; static int ap(int i){ if (t > 3) abort(); a[t++] = i; return 1; } int main(void) { testit(); if (a[0] != 0) abort(); if (a[1] != 3) abort(); if (a[2] != 2) abort(); if (a[3] != 1) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-6.c ================================================ main() { char c; char d; int nbits; c = -1; for (nbits = 1 ; nbits < 100; nbits++) { d = (1 << nbits) - 1; if (d == c) break; } if (nbits == 100) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-7.c ================================================ void foo (unsigned int n) { int i, j = -1; for (i = 0; i < 10 && j < 0; i++) { if ((1UL << i) == n) j = i; } if (j < 0) abort (); } main() { foo (64); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-8.c ================================================ double a[3] = { 0.0, 1.0, 2.0 }; void bar (int x, double *y) { if (x || *y != 1.0) abort (); } int main () { double c; int d; for (d = 0; d < 3; d++) { c = a[d]; if (c > 0.0) goto e; } bar(1, &c); exit (1); e: bar(0, &c); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-9.c ================================================ /* Source: Neil Booth, from PR # 115. */ int false() { return 0; } extern void abort (void); int main (int argc,char *argv[]) { int count = 0; while (false() || count < -123) ++count; if (count) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-ivopts-1.c ================================================ /* From PR 18977. */ void foo(float * x); int main() { float x[4]; foo (x); return 0; } void foo (float *x) { int i,j,k; float temp; static float t16[16]={1.,2.,3.,4.,5.,6.,7.,8.,9., 10.,11.,12.,13.,14.,15.,16.}; static float tmp[4]={0.,0.,0.,0.}; for (i=0; i<4; i++) { k = 3 - i; temp = t16[5*k]; for(j=k+1; j<4; j++) { tmp[k] = t16[k+ j*4] * temp; } } x[0] = tmp[0]; x[1] = tmp[1]; x[2] = tmp[2]; x[3] = tmp[3]; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/loop-ivopts-2.c ================================================ /* PR rtl-optimization/20290 */ /* We used to mis-optimize the second loop in main on at least ppc and arm, because tree loop would change the loop to something like: ivtmp.65 = &l[i]; ivtmp.16 = 113; goto (); :; *(ivtmp.65 + 4294967292B) = 9; i = i + 1; :; ivtmp.16 = ivtmp.16 - 1; ivtmp.65 = ivtmp.65 + 4B; if (ivtmp.16 != 0) goto ; We used to consider the increment of i as executed in every iteration, so we'd miscompute the final value. */ extern void abort (void); void check (unsigned int *l) { int i; for (i = 0; i < 288; i++) if (l[i] != 7 + (i < 256 || i >= 280) + (i >= 144 && i < 256)) abort (); } int main (void) { int i; unsigned int l[288]; for (i = 0; i < 144; i++) l[i] = 8; for (; i < 256; i++) l[i] = 9; for (; i < 280; i++) l[i] = 7; for (; i < 288; i++) l[i] = 8; check (l); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/lshrdi-1.c ================================================ #include extern void abort(void); extern void exit(int); #if __LONG_LONG_MAX__ == 9223372036854775807LL #define BITS 64 static unsigned long long const zext[64] = { 0x87654321fedcba90ULL, 0x43b2a190ff6e5d48ULL, 0x21d950c87fb72ea4ULL, 0x10eca8643fdb9752ULL, 0x87654321fedcba9ULL, 0x43b2a190ff6e5d4ULL, 0x21d950c87fb72eaULL, 0x10eca8643fdb975ULL, 0x87654321fedcbaULL, 0x43b2a190ff6e5dULL, 0x21d950c87fb72eULL, 0x10eca8643fdb97ULL, 0x87654321fedcbULL, 0x43b2a190ff6e5ULL, 0x21d950c87fb72ULL, 0x10eca8643fdb9ULL, 0x87654321fedcULL, 0x43b2a190ff6eULL, 0x21d950c87fb7ULL, 0x10eca8643fdbULL, 0x87654321fedULL, 0x43b2a190ff6ULL, 0x21d950c87fbULL, 0x10eca8643fdULL, 0x87654321feULL, 0x43b2a190ffULL, 0x21d950c87fULL, 0x10eca8643fULL, 0x87654321fULL, 0x43b2a190fULL, 0x21d950c87ULL, 0x10eca8643ULL, 0x87654321ULL, 0x43b2a190ULL, 0x21d950c8ULL, 0x10eca864ULL, 0x8765432ULL, 0x43b2a19ULL, 0x21d950cULL, 0x10eca86ULL, 0x876543ULL, 0x43b2a1ULL, 0x21d950ULL, 0x10eca8ULL, 0x87654ULL, 0x43b2aULL, 0x21d95ULL, 0x10ecaULL, 0x8765ULL, 0x43b2ULL, 0x21d9ULL, 0x10ecULL, 0x876ULL, 0x43bULL, 0x21dULL, 0x10eULL, 0x87ULL, 0x43ULL, 0x21ULL, 0x10ULL, 0x8ULL, 0x4ULL, 0x2ULL, 0x1ULL }; #elif __LONG_LONG_MAX__ == 2147483647LL #define BITS 32 static unsigned long long const zext[32] = { 0x87654321ULL, 0x43b2a190ULL, 0x21d950c8ULL, 0x10eca864ULL, 0x8765432ULL, 0x43b2a19ULL, 0x21d950cULL, 0x10eca86ULL, 0x876543ULL, 0x43b2a1ULL, 0x21d950ULL, 0x10eca8ULL, 0x87654ULL, 0x43b2aULL, 0x21d95ULL, 0x10ecaULL, 0x8765ULL, 0x43b2ULL, 0x21d9ULL, 0x10ecULL, 0x876ULL, 0x43bULL, 0x21dULL, 0x10eULL, 0x87ULL, 0x43ULL, 0x21ULL, 0x10ULL, 0x8ULL, 0x4ULL, 0x2ULL, 0x1ULL, }; #else #error "Update the test case." #endif static unsigned long long variable_shift(unsigned long long x, int i) { return x >> i; } static unsigned long long constant_shift(unsigned long long x, int i) { switch (i) { case 0: x = x >> 0; break; case 1: x = x >> 1; break; case 2: x = x >> 2; break; case 3: x = x >> 3; break; case 4: x = x >> 4; break; case 5: x = x >> 5; break; case 6: x = x >> 6; break; case 7: x = x >> 7; break; case 8: x = x >> 8; break; case 9: x = x >> 9; break; case 10: x = x >> 10; break; case 11: x = x >> 11; break; case 12: x = x >> 12; break; case 13: x = x >> 13; break; case 14: x = x >> 14; break; case 15: x = x >> 15; break; case 16: x = x >> 16; break; case 17: x = x >> 17; break; case 18: x = x >> 18; break; case 19: x = x >> 19; break; case 20: x = x >> 20; break; case 21: x = x >> 21; break; case 22: x = x >> 22; break; case 23: x = x >> 23; break; case 24: x = x >> 24; break; case 25: x = x >> 25; break; case 26: x = x >> 26; break; case 27: x = x >> 27; break; case 28: x = x >> 28; break; case 29: x = x >> 29; break; case 30: x = x >> 30; break; case 31: x = x >> 31; break; #if BITS > 32 case 32: x = x >> 32; break; case 33: x = x >> 33; break; case 34: x = x >> 34; break; case 35: x = x >> 35; break; case 36: x = x >> 36; break; case 37: x = x >> 37; break; case 38: x = x >> 38; break; case 39: x = x >> 39; break; case 40: x = x >> 40; break; case 41: x = x >> 41; break; case 42: x = x >> 42; break; case 43: x = x >> 43; break; case 44: x = x >> 44; break; case 45: x = x >> 45; break; case 46: x = x >> 46; break; case 47: x = x >> 47; break; case 48: x = x >> 48; break; case 49: x = x >> 49; break; case 50: x = x >> 50; break; case 51: x = x >> 51; break; case 52: x = x >> 52; break; case 53: x = x >> 53; break; case 54: x = x >> 54; break; case 55: x = x >> 55; break; case 56: x = x >> 56; break; case 57: x = x >> 57; break; case 58: x = x >> 58; break; case 59: x = x >> 59; break; case 60: x = x >> 60; break; case 61: x = x >> 61; break; case 62: x = x >> 62; break; case 63: x = x >> 63; break; #endif default: abort (); } return x; } int main() { int i; for (i = 0; i < BITS; ++i) { unsigned long long y = variable_shift (zext[0], i); if (y != zext[i]) abort (); } for (i = 0; i < BITS; ++i) { unsigned long long y = constant_shift (zext[0], i); if (y != zext[i]) abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/lto-tbaa-1.c ================================================ /* { dg-additional-options "-fno-early-inlining -fno-ipa-cp" } */ struct a { float *b; } *a; struct b { int *b; } b; struct c { float *b; } *c; int d; use_a (struct a *a) { } set_b (int **a) { *a=&d; } use_c (struct c *a) { } __attribute__ ((noinline)) int **retme(int **val) { return val; } int e; struct b b= {&e}; struct b b2; struct b b3; int **ptr = &b2.b; main () { a= (void *)0; b.b=&e; ptr =retme ( &b.b); set_b (ptr); b3=b; if (b3.b != &d) __builtin_abort (); c= (void *)0; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/mayalias-1.c ================================================ /* Tests that the may_alias attribute works as expected. Author: Osku Salerma Apr 2002. */ extern void abort(void); extern void exit(int); typedef short __attribute__((__may_alias__)) short_a; int main (void) { int a = 0x12345678; short_a *b = (short_a*) &a; b[1] = 0; if (a == 0x12345678) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/mayalias-2.c ================================================ typedef struct __attribute__((__may_alias__)) { short x; } test; int f() { int a=10; test *p=(test *)&a; p->x = 1; return a; } int main() { if (f() == 10) __builtin_abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/mayalias-3.c ================================================ typedef struct __attribute__((__may_alias__)) { short x; } test; test *p; int g(int *a) { p = (test*)a; } int f() { int a; g(&a); a = 10; test s={1}; *p=s; return a; } int main() { if (f() == 10) __builtin_abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/medce-1.c ================================================ extern void abort (void); extern void link_error (void); static int ok = 0; void bar (void) { ok = 1; } void foo(int x) { switch (x) { case 0: if (0) { link_error(); case 1: bar(); } } } int main() { foo (1); if (!ok) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/memcpy-1.c ================================================ #include #if defined (STACK_SIZE) #define MEMCPY_SIZE (STACK_SIZE / 3) #else #define MEMCPY_SIZE (1 << 17) #endif void *copy (void *o, const void *i, unsigned l) { return memcpy (o, i, l); } main () { unsigned i; unsigned char src[MEMCPY_SIZE]; unsigned char dst[MEMCPY_SIZE]; for (i = 0; i < MEMCPY_SIZE; i++) src[i] = (unsigned char) i, dst[i] = 0; (void) memcpy (dst, src, MEMCPY_SIZE / 128); for (i = 0; i < MEMCPY_SIZE / 128; i++) if (dst[i] != (unsigned char) i) abort (); (void) memset (dst, 1, MEMCPY_SIZE / 128); for (i = 0; i < MEMCPY_SIZE / 128; i++) if (dst[i] != 1) abort (); (void) memcpy (dst, src, MEMCPY_SIZE); for (i = 0; i < MEMCPY_SIZE; i++) if (dst[i] != (unsigned char) i) abort (); (void) memset (dst, 0, MEMCPY_SIZE); for (i = 0; i < MEMCPY_SIZE; i++) if (dst[i] != 0) abort (); (void) copy (dst, src, MEMCPY_SIZE / 128); for (i = 0; i < MEMCPY_SIZE / 128; i++) if (dst[i] != (unsigned char) i) abort (); (void) memset (dst, 0, MEMCPY_SIZE); (void) copy (dst, src, MEMCPY_SIZE); for (i = 0; i < MEMCPY_SIZE; i++) if (dst[i] != (unsigned char) i) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/memcpy-2.c ================================================ /* Copyright (C) 2002 Free Software Foundation. Test memcpy with various combinations of pointer alignments and lengths to make sure any optimizations in the library are correct. Written by Michael Meissner, March 9, 2002. */ #include #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_COPY #define MAX_COPY (10 * sizeof (long long)) #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + MAX_EXTRA) /* Use a sequence length that is not divisible by two, to make it more likely to detect when words are mixed up. */ #define SEQUENCE_LENGTH 31 static union { char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u1, u2; main () { int off1, off2, len, i; char *p, *q, c; for (off1 = 0; off1 < MAX_OFFSET; off1++) for (off2 = 0; off2 < MAX_OFFSET; off2++) for (len = 1; len < MAX_COPY; len++) { for (i = 0, c = 'A'; i < MAX_LENGTH; i++, c++) { u1.buf[i] = 'a'; if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; u2.buf[i] = c; } p = memcpy (u1.buf + off1, u2.buf + off2, len); if (p != u1.buf + off1) abort (); q = u1.buf; for (i = 0; i < off1; i++, q++) if (*q != 'a') abort (); for (i = 0, c = 'A' + off2; i < len; i++, q++, c++) { if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; if (*q != c) abort (); } for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/memcpy-bi.c ================================================ /* Test builtin-memcpy (which may emit different code for different N). */ #include #define TESTSIZE 80 char src[TESTSIZE] __attribute__ ((aligned)); char dst[TESTSIZE] __attribute__ ((aligned)); void check (char *test, char *match, int n) { if (memcmp (test, match, n)) abort (); } #define TN(n) \ { memset (dst, 0, n); memcpy (dst, src, n); check (dst, src, n); } #define T(n) \ TN (n) \ TN ((n) + 1) \ TN ((n) + 2) \ TN ((n) + 3) main () { int i,j; for (i = 0; i < sizeof (src); ++i) src[i] = 'a' + i % 26; T (0); T (4); T (8); T (12); T (16); T (20); T (24); T (28); T (32); T (36); T (40); T (44); T (48); T (52); T (56); T (60); T (64); T (68); T (72); T (76); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/memset-1.c ================================================ /* Copyright (C) 2002 Free Software Foundation. Test memset with various combinations of pointer alignments and lengths to make sure any optimizations in the library are correct. Written by Michael Meissner, March 9, 2002. */ #include #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_COPY #define MAX_COPY (10 * sizeof (long long)) #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + MAX_EXTRA) static union { char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u; char A = 'A'; main () { int off, len, i; char *p, *q; for (off = 0; off < MAX_OFFSET; off++) for (len = 1; len < MAX_COPY; len++) { for (i = 0; i < MAX_LENGTH; i++) u.buf[i] = 'a'; p = memset (u.buf + off, '\0', len); if (p != u.buf + off) abort (); q = u.buf; for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); for (i = 0; i < len; i++, q++) if (*q != '\0') abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); p = memset (u.buf + off, A, len); if (p != u.buf + off) abort (); q = u.buf; for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); for (i = 0; i < len; i++, q++) if (*q != 'A') abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); p = memset (u.buf + off, 'B', len); if (p != u.buf + off) abort (); q = u.buf; for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); for (i = 0; i < len; i++, q++) if (*q != 'B') abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/memset-2.c ================================================ /* Copyright (C) 2002 Free Software Foundation. Test memset with various combinations of pointer alignments and constant lengths to make sure any optimizations in the compiler are correct. Written by Roger Sayle, April 22, 2002. */ #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_COPY #define MAX_COPY 15 #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + MAX_EXTRA) static union { char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u; char A = 'A'; void reset () { int i; for (i = 0; i < MAX_LENGTH; i++) u.buf[i] = 'a'; } void check (int off, int len, int ch) { char *q; int i; q = u.buf; for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); for (i = 0; i < len; i++, q++) if (*q != ch) abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); } int main () { int off; char *p; /* len == 1 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 1); if (p != u.buf + off) abort (); check (off, 1, '\0'); p = memset (u.buf + off, A, 1); if (p != u.buf + off) abort (); check (off, 1, 'A'); p = memset (u.buf + off, 'B', 1); if (p != u.buf + off) abort (); check (off, 1, 'B'); } /* len == 2 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 2); if (p != u.buf + off) abort (); check (off, 2, '\0'); p = memset (u.buf + off, A, 2); if (p != u.buf + off) abort (); check (off, 2, 'A'); p = memset (u.buf + off, 'B', 2); if (p != u.buf + off) abort (); check (off, 2, 'B'); } /* len == 3 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 3); if (p != u.buf + off) abort (); check (off, 3, '\0'); p = memset (u.buf + off, A, 3); if (p != u.buf + off) abort (); check (off, 3, 'A'); p = memset (u.buf + off, 'B', 3); if (p != u.buf + off) abort (); check (off, 3, 'B'); } /* len == 4 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 4); if (p != u.buf + off) abort (); check (off, 4, '\0'); p = memset (u.buf + off, A, 4); if (p != u.buf + off) abort (); check (off, 4, 'A'); p = memset (u.buf + off, 'B', 4); if (p != u.buf + off) abort (); check (off, 4, 'B'); } /* len == 5 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 5); if (p != u.buf + off) abort (); check (off, 5, '\0'); p = memset (u.buf + off, A, 5); if (p != u.buf + off) abort (); check (off, 5, 'A'); p = memset (u.buf + off, 'B', 5); if (p != u.buf + off) abort (); check (off, 5, 'B'); } /* len == 6 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 6); if (p != u.buf + off) abort (); check (off, 6, '\0'); p = memset (u.buf + off, A, 6); if (p != u.buf + off) abort (); check (off, 6, 'A'); p = memset (u.buf + off, 'B', 6); if (p != u.buf + off) abort (); check (off, 6, 'B'); } /* len == 7 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 7); if (p != u.buf + off) abort (); check (off, 7, '\0'); p = memset (u.buf + off, A, 7); if (p != u.buf + off) abort (); check (off, 7, 'A'); p = memset (u.buf + off, 'B', 7); if (p != u.buf + off) abort (); check (off, 7, 'B'); } /* len == 8 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 8); if (p != u.buf + off) abort (); check (off, 8, '\0'); p = memset (u.buf + off, A, 8); if (p != u.buf + off) abort (); check (off, 8, 'A'); p = memset (u.buf + off, 'B', 8); if (p != u.buf + off) abort (); check (off, 8, 'B'); } /* len == 9 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 9); if (p != u.buf + off) abort (); check (off, 9, '\0'); p = memset (u.buf + off, A, 9); if (p != u.buf + off) abort (); check (off, 9, 'A'); p = memset (u.buf + off, 'B', 9); if (p != u.buf + off) abort (); check (off, 9, 'B'); } /* len == 10 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 10); if (p != u.buf + off) abort (); check (off, 10, '\0'); p = memset (u.buf + off, A, 10); if (p != u.buf + off) abort (); check (off, 10, 'A'); p = memset (u.buf + off, 'B', 10); if (p != u.buf + off) abort (); check (off, 10, 'B'); } /* len == 11 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 11); if (p != u.buf + off) abort (); check (off, 11, '\0'); p = memset (u.buf + off, A, 11); if (p != u.buf + off) abort (); check (off, 11, 'A'); p = memset (u.buf + off, 'B', 11); if (p != u.buf + off) abort (); check (off, 11, 'B'); } /* len == 12 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 12); if (p != u.buf + off) abort (); check (off, 12, '\0'); p = memset (u.buf + off, A, 12); if (p != u.buf + off) abort (); check (off, 12, 'A'); p = memset (u.buf + off, 'B', 12); if (p != u.buf + off) abort (); check (off, 12, 'B'); } /* len == 13 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 13); if (p != u.buf + off) abort (); check (off, 13, '\0'); p = memset (u.buf + off, A, 13); if (p != u.buf + off) abort (); check (off, 13, 'A'); p = memset (u.buf + off, 'B', 13); if (p != u.buf + off) abort (); check (off, 13, 'B'); } /* len == 14 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 14); if (p != u.buf + off) abort (); check (off, 14, '\0'); p = memset (u.buf + off, A, 14); if (p != u.buf + off) abort (); check (off, 14, 'A'); p = memset (u.buf + off, 'B', 14); if (p != u.buf + off) abort (); check (off, 14, 'B'); } /* len == 15 */ for (off = 0; off < MAX_OFFSET; off++) { reset (); p = memset (u.buf + off, '\0', 15); if (p != u.buf + off) abort (); check (off, 15, '\0'); p = memset (u.buf + off, A, 15); if (p != u.buf + off) abort (); check (off, 15, 'A'); p = memset (u.buf + off, 'B', 15); if (p != u.buf + off) abort (); check (off, 15, 'B'); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/memset-3.c ================================================ /* Copyright (C) 2002 Free Software Foundation. Test memset with various combinations of constant pointer alignments and lengths to make sure any optimizations in the compiler are correct. Written by Roger Sayle, July 22, 2002. */ #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_COPY #define MAX_COPY 15 #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + MAX_EXTRA) static union { char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u; char A = 'A'; void reset () { int i; for (i = 0; i < MAX_LENGTH; i++) u.buf[i] = 'a'; } void check (int off, int len, int ch) { char *q; int i; q = u.buf; for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); for (i = 0; i < len; i++, q++) if (*q != ch) abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); } int main () { int len; char *p; /* off == 0 */ for (len = 0; len < MAX_COPY; len++) { reset (); p = memset (u.buf, '\0', len); if (p != u.buf) abort (); check (0, len, '\0'); p = memset (u.buf, A, len); if (p != u.buf) abort (); check (0, len, 'A'); p = memset (u.buf, 'B', len); if (p != u.buf) abort (); check (0, len, 'B'); } /* off == 1 */ for (len = 0; len < MAX_COPY; len++) { reset (); p = memset (u.buf+1, '\0', len); if (p != u.buf+1) abort (); check (1, len, '\0'); p = memset (u.buf+1, A, len); if (p != u.buf+1) abort (); check (1, len, 'A'); p = memset (u.buf+1, 'B', len); if (p != u.buf+1) abort (); check (1, len, 'B'); } /* off == 2 */ for (len = 0; len < MAX_COPY; len++) { reset (); p = memset (u.buf+2, '\0', len); if (p != u.buf+2) abort (); check (2, len, '\0'); p = memset (u.buf+2, A, len); if (p != u.buf+2) abort (); check (2, len, 'A'); p = memset (u.buf+2, 'B', len); if (p != u.buf+2) abort (); check (2, len, 'B'); } /* off == 3 */ for (len = 0; len < MAX_COPY; len++) { reset (); p = memset (u.buf+3, '\0', len); if (p != u.buf+3) abort (); check (3, len, '\0'); p = memset (u.buf+3, A, len); if (p != u.buf+3) abort (); check (3, len, 'A'); p = memset (u.buf+3, 'B', len); if (p != u.buf+3) abort (); check (3, len, 'B'); } /* off == 4 */ for (len = 0; len < MAX_COPY; len++) { reset (); p = memset (u.buf+4, '\0', len); if (p != u.buf+4) abort (); check (4, len, '\0'); p = memset (u.buf+4, A, len); if (p != u.buf+4) abort (); check (4, len, 'A'); p = memset (u.buf+4, 'B', len); if (p != u.buf+4) abort (); check (4, len, 'B'); } /* off == 5 */ for (len = 0; len < MAX_COPY; len++) { reset (); p = memset (u.buf+5, '\0', len); if (p != u.buf+5) abort (); check (5, len, '\0'); p = memset (u.buf+5, A, len); if (p != u.buf+5) abort (); check (5, len, 'A'); p = memset (u.buf+5, 'B', len); if (p != u.buf+5) abort (); check (5, len, 'B'); } /* off == 6 */ for (len = 0; len < MAX_COPY; len++) { reset (); p = memset (u.buf+6, '\0', len); if (p != u.buf+6) abort (); check (6, len, '\0'); p = memset (u.buf+6, A, len); if (p != u.buf+6) abort (); check (6, len, 'A'); p = memset (u.buf+6, 'B', len); if (p != u.buf+6) abort (); check (6, len, 'B'); } /* off == 7 */ for (len = 0; len < MAX_COPY; len++) { reset (); p = memset (u.buf+7, '\0', len); if (p != u.buf+7) abort (); check (7, len, '\0'); p = memset (u.buf+7, A, len); if (p != u.buf+7) abort (); check (7, len, 'A'); p = memset (u.buf+7, 'B', len); if (p != u.buf+7) abort (); check (7, len, 'B'); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/memset-4.c ================================================ /* Test to make sure memset of small old size works correctly. */ #define SIZE 15 void f(char *a) __attribute__((noinline)); void f(char *a) { __builtin_memset (a, 0, SIZE); } int main(void) { int i; char b[SIZE]; for(i = 0; i < sizeof(b); i++) { b[i] = i; } f(b); for(i = 0; i < sizeof(b); i++) { if (0 != b[i]) __builtin_abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/mod-1.c ================================================ f (x, y) { if (x % y != 0) abort (); } main () { f (-5, 5); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c ================================================ /* { dg-require-effective-target stdint_types } */ #include #include #include void f883b (int8_t * result, int16_t * __restrict arg1, uint32_t * __restrict arg2, uint64_t * __restrict arg3, uint8_t * __restrict arg4) { int idx; for (idx=0;idx<96;idx += 1) { result[idx] = (((((((((((-27 + 2+1)>>1) || arg4[idx]) < arg1[idx]) ? (((-27 + 2+1)>>1) || arg4[idx]) : arg1[idx]) >> (arg2[idx] & 31)) ^ 1) - -32)>>7) | -5) & arg3[idx]); } } int8_t result[96]; int16_t arg1[96]; uint32_t arg2[96]; uint64_t arg3[96]; uint8_t arg4[96]; int main (void) { int i; int correct[] = {0x0,0x1,0x2,0x3,0x0,0x1,0x2,0x3,0x8,0x9,0xa,0xb,0x8,0x9, 0xa,0xb,0x10,0x11,0x12,0x13,0x10,0x11,0x12,0x13, 0x18,0x19,0x1a,0x1b,0x18,0x19,0x1a,0x1b,0x20,0x21,0x22, 0x23,0x20,0x21,0x22,0x23,0x28,0x29,0x2a, 0x2b,0x28,0x29,0x2a,0x2b,0x30,0x31,0x32,0x33, 0x30,0x31,0x32,0x33,0x38,0x39,0x3a,0x3b,0x38,0x39,0x3a, 0x3b,0x40,0x41,0x42,0x43,0x40,0x41,0x42,0x43,0x48,0x49, 0x4a,0x4b,0x48,0x49,0x4a,0x4b,0x50,0x51, 0x52,0x53,0x50,0x51,0x52,0x53,0x58,0x59,0x5a,0x5b, 0x58,0x59,0x5a,0x5b}; for (i=0; i < 96; i++) arg3[i] = arg2[i] = arg1[i] = arg4[i] = i; f883b(result, arg1, arg2, arg3, arg4); for (i=0; i < 96; i++) if (result[i] != correct[i]) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/multdi-1.c ================================================ /* PR target/9348 */ #define u_l_l unsigned long long #define l_l long long l_l mpy_res; u_l_l mpy (long a, long b) { return (u_l_l) a * (u_l_l) b; } int main(void) { mpy_res = mpy(1,-1); if (mpy_res != -1LL) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/multi-ix.c ================================================ /* Test for a reload bug: if you have a memory reference using the indexed addressing mode, and the base address is a pseudo containing an address in the frame and this pseudo fails to get a hard register, we end up with a double PLUS, so the frame address gets reloaded. Now, when the index got a hard register, and it dies in this insn, push_reload will consider that hard register as a reload register, and disregrad overlaps with rld[n_reloads].in . That is fine as long as the add can be done with a single insn, but when the constant is so large that it has to be reloaded into a register first, that clobbers the index. */ #include #ifdef STACK_SIZE /* We need to be careful that we don't blow our stack. Function f, in the worst case, needs to fit on the stack: * 40 int[CHUNK] arrays; * ~40 ints; * ~40 pointers for stdarg passing. Subtract the last two off STACK_SIZE and figure out what the maximum chunk size can be. We make the last bit conservative to account for register saves and other processor-dependent saving. Limit the chunk size to some sane values. */ #define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) #define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) #define CHUNK \ MIN (500, (MAX (1, (signed)(STACK_SIZE-40*sizeof(int)-256*sizeof(void *)) \ / (signed)(40*sizeof(int))))) #else #define CHUNK 500 #endif void s(int, ...); void z(int, ...); void c(int, ...); typedef int l[CHUNK]; void f (int n) { int i; l a0, a1, a2, a3, a4, a5, a6, a7, a8, a9; l a10, a11, a12, a13, a14, a15, a16, a17, a18, a19; l a20, a21, a22, a23, a24, a25, a26, a27, a28, a29; l a30, a31, a32, a33, a34, a35, a36, a37, a38, a39; int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9; int i10, i11, i12, i13, i14, i15, i16, i17, i18, i19; int i20, i21, i22, i23, i24, i25, i26, i27, i28, i29; int i30, i31, i32, i33, i34, i35, i36, i37, i38, i39; for (i = 0; i < n; i++) { s (40, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39); i0 = a0[0]; i1 = a1[0]; i2 = a2[0]; i3 = a3[0]; i4 = a4[0]; i5 = a5[0]; i6 = a6[0]; i7 = a7[0]; i8 = a8[0]; i9 = a9[0]; i10 = a10[0]; i11 = a11[0]; i12 = a12[0]; i13 = a13[0]; i14 = a14[0]; i15 = a15[0]; i16 = a16[0]; i17 = a17[0]; i18 = a18[0]; i19 = a19[0]; i20 = a20[0]; i21 = a21[0]; i22 = a22[0]; i23 = a23[0]; i24 = a24[0]; i25 = a25[0]; i26 = a26[0]; i27 = a27[0]; i28 = a28[0]; i29 = a29[0]; i30 = a30[0]; i31 = a31[0]; i32 = a32[0]; i33 = a33[0]; i34 = a34[0]; i35 = a35[0]; i36 = a36[0]; i37 = a37[0]; i38 = a38[0]; i39 = a39[0]; z (40, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39); a0[i0] = i0; a1[i1] = i1; a2[i2] = i2; a3[i3] = i3; a4[i4] = i4; a5[i5] = i5; a6[i6] = i6; a7[i7] = i7; a8[i8] = i8; a9[i9] = i9; a10[i10] = i10; a11[i11] = i11; a12[i12] = i12; a13[i13] = i13; a14[i14] = i14; a15[i15] = i15; a16[i16] = i16; a17[i17] = i17; a18[i18] = i18; a19[i19] = i19; a20[i20] = i20; a21[i21] = i21; a22[i22] = i22; a23[i23] = i23; a24[i24] = i24; a25[i25] = i25; a26[i26] = i26; a27[i27] = i27; a28[i28] = i28; a29[i29] = i29; a30[i30] = i30; a31[i31] = i31; a32[i32] = i32; a33[i33] = i33; a34[i34] = i34; a35[i35] = i35; a36[i36] = i36; a37[i37] = i37; a38[i38] = i38; a39[i39] = i39; c (40, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39); } } int main () { /* CHUNK needs to be at least 40 to avoid stack corruption, since index variable i0 in "a[i0] = i0" equals 39. */ if (CHUNK < 40) exit (0); f (1); exit (0); } void s(int n, ...) { va_list list; va_start (list, n); while (n--) { int *a = va_arg (list, int *); a[0] = n; } va_end (list); } void z(int n, ...) { va_list list; va_start (list, n); while (n--) { int *a = va_arg (list, int *); __builtin_memset (a, 0, sizeof (l)); } va_end (list); } void c(int n, ...) { va_list list; va_start (list, n); while (n--) { int *a = va_arg (list, int *); if (a[n] != n) abort (); } va_end (list); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/nest-align-1.c ================================================ /* Test for alignment handling when a variable is accessed by nested function. */ /* Origin: Joey Ye */ /* Force bigger stack alignment for PowerPC EABI targets. */ /* { dg-options "-mno-eabi" { target powerpc-*-eabi* } } */ #include typedef int aligned __attribute__((aligned)); extern void abort (void); void check (int *i) { *i = 20; if ((((ptrdiff_t) i) & (__alignof__(aligned) - 1)) != 0) abort (); } void foo (void) { aligned jj; void bar () { jj = -20; } jj = 0; bar (); if (jj != -20) abort (); check (&jj); if (jj != 20) abort (); } int main() { foo (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/nest-stdar-1.c ================================================ #include main () { double f (int x, ...) { va_list args; double a; va_start (args, x); a = va_arg (args, double); va_end (args); return a; } if (f (1, (double)1) != 1.0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/nestfunc-1.c ================================================ int g (int a, int b, int (*gi) (int, int)) { if ((*gi) (a, b)) return a; else return b; } f () { #ifndef NO_TRAMPOLINES int i, j; int f2 (int a, int b) { return a > b; } if (g (1, 2, f2) != 2) abort (); #endif } main () { f (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/nestfunc-2.c ================================================ extern int foo (int, int, int (*) (int, int, int, int, int, int, int)); int z; int main (void) { #ifndef NO_TRAMPOLINES int sum = 0; int i; int nested (int a, int b, int c, int d, int e, int f, int g) { z = c + d + e + f + g; if (a > 2 * b) return a - b; else return b - a; } for (i = 0; i < 10; ++i) { int j; for (j = 0; j < 10; ++j) { int k; for (k = 0; k < 10; ++k) sum += foo (i, j > k ? j - k : k - j, nested); } } if (sum != 2300) abort (); if (z != 0x1b) abort (); #endif exit (0); } int foo (int a, int b, int (* fp) (int, int, int, int, int, int, int)) { return fp (a, b, a, b, a, b, a); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/nestfunc-3.c ================================================ extern long foo (long, long, long (*) (long, long)); extern long use (long (*) (long, long), long, long); int main (void) { #ifndef NO_TRAMPOLINES long sum = 0; long i; long nested_0 (long a, long b) { if (a > 2 * b) return a - b; else return b - a; } long nested_1 (long a, long b) { return use (nested_0, b, a) + sum; } long nested_2 (long a, long b) { return nested_1 (b, a); } for (i = 0; i < 10; ++i) { long j; for (j = 0; j < 10; ++j) { long k; for (k = 0; k < 10; ++k) sum += foo (i, j > k ? j - k : k - j, nested_2); } } if ((sum & 0xffffffff) != 0xbecfcbf5) abort (); #endif exit (0); } long use (long (* func)(long, long), long a, long b) { return func (b, a); } long foo (long a, long b, long (* func) (long, long)) { return func (a, b); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/nestfunc-4.c ================================================ /* Origin: hp@bitrange.com Test that return values come out right from a 1000-level call chain to functions without parameters that each need at least one "long" preserved. Exposed problems related to the MMIX port. */ long level = 0; extern long foo (void); extern long bar (void); #ifdef STACK_SIZE #define DEPTH ((STACK_SIZE) / 512 + 1) #else #define DEPTH 500 #endif int main (void) { if (foo () == -42) exit (0); abort (); } long foo (void) { long tmp = ++level; return bar () + tmp; } long bar (void) { long tmp = level; return tmp > DEPTH - 1 ? -42 - tmp : foo () - tmp; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/nestfunc-5.c ================================================ extern void abort (void); extern void exit (int); #ifndef NO_TRAMPOLINES static void recursive (int n, void (*proc) (void)) { __label__ l1; void do_goto (void) { goto l1; } if (n == 3) recursive (n - 1, do_goto); else if (n > 0) recursive (n - 1, proc); else (*proc) (); return; l1: if (n == 3) exit (0); else abort (); } int main () { recursive (10, abort); abort (); } #else int main () { return 0; } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c ================================================ /* Test that the GP gets properly restored, either by the nonlocal receiver or the nested function. */ #ifndef NO_TRAMPOLINES typedef __SIZE_TYPE__ size_t; extern void abort (void); extern void exit (int); extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); int main () { __label__ nonlocal; int compare (const void *a, const void *b) { goto nonlocal; } char array[3]; qsort (array, 3, 1, compare); abort (); nonlocal: exit (0); } #else int main() { return 0; } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/nestfunc-7.c ================================================ struct A { int one; int two; int three; int four; int five; int six; }; static int test (void) { int base; struct A Foo (void) { struct A a; a.one = base + 1; a.two = base + 2; a.three = base + 3; a.four = base + 4; a.five = base + 5; a.six = base + 6; return a; } base = 10; struct A a = Foo (); return (a.one == 11 && a.two == 12 && a.three == 13 && a.four == 14 && a.five == 15 && a.six == 16); } int main (void) { return !test (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/p18298.c ================================================ /* { dg-options "-fgnu89-inline" } */ #include #include extern void abort (void); int strcmp (const char*, const char*); char s[2048] = "a"; inline bool foo(const char *str) { return !strcmp(s,str); } int main() { int i = 0; while(!(foo(""))) { i ++; s[0] = '\0'; if (i>2) abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/packed-1.c ================================================ short x1 = 17; struct { short i __attribute__ ((packed)); } t; f () { t.i = x1; if (t.i != 17) abort (); } main () { f (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/packed-2.c ================================================ typedef struct s { unsigned short a; unsigned long b __attribute__ ((packed)); } s; s t; int main() { t.b = 0; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pending-4.c ================================================ void dummy (x, y) int *x; int y; {} int main (argc, argv) int argc; char **argv; { int number_columns=9; int cnt0 = 0; int cnt1 = 0; int i,A1; for (i = number_columns-1; i != 0; i--) { if (i == 1) { dummy(&A1, i); cnt0++; } else { dummy(&A1, i-1); cnt1++; } } if (cnt0 != 1 || cnt1 != 7) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/postmod-1.c ================================================ #define DECLARE_ARRAY(A) array##A[0x10] #define DECLARE_COUNTER(A) counter##A = 0 #define DECLARE_POINTER(A) *pointer##A = array##A + x /* Create a loop that allows post-modification of pointerA, followed by a use of the post-modified address. */ #define BEFORE(A) counter##A += *pointer##A, pointer##A += 3 #define AFTER(A) counter##A += pointer##A[x] /* Set up the arrays so that one iteration of the loop sets the counter to 3.0f. */ #define INIT_ARRAY(A) array##A[1] = 1.0f, array##A[5] = 2.0f /* Check that the loop worked correctly for all values. */ #define CHECK_ARRAY(A) exit_code |= (counter##A != 3.0f) /* Having 6 copies triggered the bug for ARM and Thumb. */ #define MANY(A) A (0), A (1), A (2), A (3), A (4), A (5) /* Each addendA should be allocated a register. */ #define INIT_VOLATILE(A) addend##A = vol #define ADD_VOLATILE(A) vol += addend##A /* Having 5 copies triggered the bug for ARM and Thumb. */ #define MANY2(A) A (0), A (1), A (2), A (3), A (4) float MANY (DECLARE_ARRAY); float MANY (DECLARE_COUNTER); volatile int stop = 1; volatile int vol; void __attribute__((noinline)) foo (int x) { float MANY (DECLARE_POINTER); int i; do { MANY (BEFORE); MANY (AFTER); /* Create an inner loop that should ensure the code above has registers free for reload inheritance. */ { int MANY2 (INIT_VOLATILE); for (i = 0; i < 10; i++) MANY2 (ADD_VOLATILE); } } while (!stop); } int main (void) { int exit_code = 0; MANY (INIT_ARRAY); foo (1); MANY (CHECK_ARRAY); return exit_code; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr15262-1.c ================================================ /* PR 15262. The alias analyzer only considers relations between pointers and symbols. If two pointers P and Q point to the same symbol S, then their respective memory tags will either be the same or they will have S in their alias set. However, if there are no common symbols between P and Q, TBAA will currently miss their alias relationship altogether. */ struct A { int t; int i; }; int foo () { return 3; } main () { struct A loc, *locp; float f, g, *p; int T355, *T356; /* Avoid the partial hack in TBAA that would consider memory tags if the program had no addressable symbols. */ f = 3; g = 2; p = foo () ? &g : &f; if (*p > 0.0) g = 1; /* Store into *locp and cache its current value. */ locp = malloc (sizeof (*locp)); locp->i = 10; T355 = locp->i; /* Take the address of one of locp's fields and write to it. */ T356 = &locp->i; *T356 = 1; /* Read the recently stored value. If TBAA fails, this will appear as a redundant load that will be replaced with '10'. */ T355 = locp->i; if (T355 != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr15262-2.c ================================================ /* PR 15262. Similar to pr15262-1.c but with no obvious addresses being taken in function foo(). Without IPA, by only looking inside foo() we cannot tell for certain whether 'q' and 'b' alias each other. */ struct A { int t; int i; }; struct B { int *p; float b; }; float X; foo (struct B b, struct A *q, float *h) { X += *h; *(b.p) = 3; q->t = 2; return *(b.p); } main() { struct A a; struct B b; b.p = &a.t; if (foo (b, &a, &X) == 3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr15262.c ================================================ /* We used to mis-compile this testcase as we did not know that &a+offsetof(b,a) was the same as &a.b */ struct A { int t; int i; }; void bar (float *p) { *p = 5.2; } int foo(struct A *locp, int i, int str) { float f, g, *p; int T355; int *T356; /* Currently, the alias analyzer has limited support for handling aliases of structure fields when no other variables are aliased. Introduce additional aliases to confuse it. */ p = i ? &g : &f; bar (p); if (*p > 0.0) str = 1; T355 = locp->i; T356 = &locp->i; *T356 = str; T355 = locp->i; return T355; } main () { struct A loc; int str; loc.i = 2; str = foo (&loc, 10, 3); if (str!=1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr15296.c ================================================ /* PR optimization/15296. The delayed-branch scheduler caused code that SEGV:d for CRIS; a register was set to -1 in a delay-slot for the fall-through code, while that register held a pointer used in code at the branch target. */ typedef __INTPTR_TYPE__ intptr_t; typedef intptr_t W; union u0 { union u0 *r; W i; }; struct s1 { union u0 **m0; union u0 m1[4]; }; void f (void *, struct s1 *, const union u0 *, W, W, W) __attribute__ ((__noinline__)); void g (void *, char *) __attribute__ ((__noinline__)); void f (void *a, struct s1 *b, const union u0 *h, W v0, W v1, W v4) { union u0 *e = 0; union u0 *k = 0; union u0 **v5 = b->m0; union u0 *c = b->m1; union u0 **d = &v5[0]; l0:; if (v0 < v1) goto l0; if (v0 == 0) goto l3; v0 = v4; if (v0 != 0) goto l3; c[0].r = *d; v1 = -1; e = c[0].r; if (e != 0) g (a, ""); k = e + 3; k->i = v1; goto l4; l3:; c[0].i = v0; e = c[1].r; if (e != 0) g (a, ""); e = c[0].r; if (e == 0) g (a, ""); k = e + 2; k->r = c[1].r; l4:; } void g (void *a, char *b) { abort (); } int main () { union u0 uv[] = {{ .i = 111 }, { .i = 222 }, { .i = 333 }, { .i = 444 }}; struct s1 s = { 0, {{ .i = 555 }, { .i = 0 }, { .i = 999 }, { .i = 777 }}}; f (0, &s, 0, 20000, 10000, (W) uv); if (s.m1[0].i != (W) uv || s.m1[1].i != 0 || s.m1[2].i != 999 || s.m1[3].i != 777 || uv[0].i != 111 || uv[1].i != 222 || uv[2].i != 0 || uv[3].i != 444) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr16790-1.c ================================================ /* PR middle-end/16790. */ extern void abort (); static void test1(unsigned int u1) { unsigned int y_final_1; signed short y_middle; unsigned int y_final_2; y_final_1 = (unsigned int)( (signed short)(u1 * 2) * 3 ); y_middle = (signed short)(u1 * 2); y_final_2 = (unsigned int)( y_middle * 3 ); if (y_final_1 != y_final_2) abort (); } static void test2(unsigned int u1) { unsigned int y_final_1; signed short y_middle; unsigned int y_final_2; y_final_1 = (unsigned int)( (signed short)(u1 << 1) * 3 ); y_middle = (signed short)(u1 << 1); y_final_2 = (unsigned int)( y_middle * 3 ); if (y_final_1 != y_final_2) abort (); } int main() { test1(0x4000U); test2(0x4000U); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr17078-1.c ================================================ extern void abort(void); void test(int *ptr) { int i = 1; goto useless; if (0) { useless: i = 0; } else i = 1; *ptr = i; } int main() { int i = 1; test(&i); if (i) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr17133.c ================================================ extern void abort (void); int foo = 0; void *bar = 0; unsigned int baz = 100; void *pure_alloc () { void *res; while (1) { res = (void *) ((((unsigned int) (foo + bar))) & ~1); foo += 2; if (foo < baz) return res; foo = 0; } } int main () { pure_alloc (); if (!foo) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr17252.c ================================================ /* PR 17252. When a char * pointer P takes its own address, storing into *P changes P itself. */ char *a; main () { /* Make 'a' point to itself. */ a = (char *)&a; /* Change what 'a' is pointing to. */ a[0]++; /* If a's memory tag does not contain 'a' in its alias set, we will think that this predicate is superfluous and change it to 'if (1)'. */ if (a == (char *)&a) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr17377.c ================================================ /* PR target/17377 Bug in code emitted by "return" pattern on CRIS: missing pop of forced return address on stack. */ /* { dg-require-effective-target return_address } */ int calls = 0; void *f (int) __attribute__ ((__noinline__)); void * f (int i) { /* The code does a little brittle song and dance to trig the "return" pattern instead of the function epilogue. This must still be a leaf function for the bug to be exposed. */ if (calls++ == 0) return __builtin_return_address (0); switch (i) { case 1: return f; case 0: return __builtin_return_address (0); } return 0; } int x; void *y (int i) __attribute__ ((__noinline__,__noclone__)); void * y (int i) { x = 0; /* This must not be a sibling call: the return address must appear constant for different calls to this function. Postincrementing x catches otherwise unidentified multiple returns (e.g. through the return-address register and then this epilogue popping the address stored on stack in "f"). */ return (char *) f (i) + x++; } int main (void) { void *v = y (4); if (y (1) != f /* Can't reasonably check the validity of the return address above, but it's not that important: the test-case will probably crash on the first call to f with the bug present, or it will run wild including returning early (in y or here), so we also try and check the number of calls. */ || y (0) != v || y (3) != 0 || y (-1) != 0 || calls != 5) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr19005.c ================================================ /* PR target/19005 */ extern void abort (void); int v, s; void bar (int a, int b) { unsigned char x = v; if (!s) { if (a != x || b != (unsigned char) (x + 1)) abort (); } else if (a != (unsigned char) (x + 1) || b != x) abort (); s ^= 1; } int foo (int x) { unsigned char a = x, b = x + 1; bar (a, b); a ^= b; b ^= a; a ^= b; bar (a, b); return 0; } int main (void) { for (v = -10; v < 266; v++) foo (v); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr19449.c ================================================ /* PR c/19449 */ extern void abort (void); int y; int z = __builtin_choose_expr (!__builtin_constant_p (y), 3, 4); int foo (int x) { return __builtin_choose_expr (!__builtin_constant_p (x), 3, y++); } int main () { if (y || z != 3 || foo (4) != 3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr19515.c ================================================ /* PR 19515 */ typedef union { char a2[8]; }aun; void abort (void); int main(void) { aun a = {{0}}; if (a.a2[2] != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr19606.c ================================================ /* PR c/19606 The C front end used to shorten the type of a division to a type that does not preserve the semantics of the original computation. Make sure that won't happen. */ signed char a = -4; int foo (void) { return ((unsigned int) (signed int) a) / 2LL; } int bar (void) { return ((unsigned int) (signed int) a) % 5LL; } int main (void) { int r; r = foo (); if (r != ((unsigned int) (signed int) (signed char) -4) / 2LL) abort (); r = bar (); if (r != ((unsigned int) (signed int) (signed char) -4) % 5LL) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr19687.c ================================================ extern void abort (void); union U { int i, j[4]; }; int main () { union U t = {}; int i; for (i = 0; i < 4; ++i) if (t.j[i] != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr19689.c ================================================ /* { dg-require-effective-target int32plus } */ extern void abort (void); struct { int b : 29; } f; void foo (short j) { f.b = j; } int main() { foo (-55); if (f.b != -55) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr20100-1.c ================================================ /* PR tree-optimization/20100 Pure function being treated as const. Author: Hans-Peter Nilsson. */ static unsigned short g = 0; static unsigned short p = 0; unsigned char e; static unsigned short next_g (void) { return g == e - 1 ? 0 : g + 1; } static unsigned short curr_p (void) { return p; } static unsigned short inc_g (void) { return g = next_g (); } static unsigned short curr_g (void) { return g; } static char ring_empty (void) { if (curr_p () == curr_g ()) return 1; else return 0; } char frob (unsigned short a, unsigned short b) { g = a; p = b; inc_g (); return ring_empty (); } unsigned short get_n (void) { unsigned short n = 0; unsigned short org_g; org_g = curr_g (); while (!ring_empty () && n < 5) { inc_g (); n++; } return n; } void abort (void); void exit (int); int main (void) { e = 3; if (frob (0, 2) != 0 || g != 1 || p != 2 || e != 3 || get_n () != 1 || g != 2 || p != 2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr20187-1.c ================================================ int a = 0x101; int b = 0x100; int test (void) { return (((unsigned char) (unsigned long long) ((a ? a : 1) & (a * b))) ? 0 : 1); } int main (void) { return 1 - test (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr20466-1.c ================================================ int f (int **, int *, int *, int **, int **) __attribute__ ((__noinline__)); int f (int **ipp, int *i1p, int *i2p, int **i3, int **i4) { **ipp = *i1p; *ipp = i2p; *i3 = *i4; **ipp = 99; return 3; } extern void exit (int); extern void abort (void); int main (void) { int i = 42, i1 = 66, i2 = 1, i3 = -1, i4 = 55; int *ip = &i; int *i3p = &i3; int *i4p = &i4; f (&ip, &i1, &i2, &i3p, &i4p); if (i != 66 || ip != &i2 || i2 != 99 || i3 != -1 || i3p != i4p || i4 != 55) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr20527-1.c ================================================ /* PR rtl-optimization/20527 Mishandled postincrement. This test-case is derived from the function BZ2_hbCreateDecodeTables in the file huffman.c from bzip2-1.0.2, hence requiring the following disclaimer copied here: */ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2002 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@acm.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ void f (long *limit, long *base, long minLen, long maxLen) __attribute__ ((__noinline__)); void f (long *limit, long *base, long minLen, long maxLen) { long i; long vec; vec = 0; for (i = minLen; i <= maxLen; i++) { vec += (base[i+1] - base[i]); limit[i] = vec-1; } } extern void abort (void); extern void exit (int); long b[] = {1, 5, 11, 23}; int main (void) { long l[3]; f (l, b, 0, 2); if (l[0] != 3 || l[1] != 9 || l[2] != 21) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr20601-1.c ================================================ /* PR tree-optimization/20601 */ /* { dg-xfail-if "ptxas crashes" { nvptx-*-* } { "-O1" } { "" } } */ extern void abort (void); extern void exit (int); struct T { char *t1; char t2[4096]; char **t3; }; int a[5]; int b; char **c; int d; char **e; struct T t; char *f[16]; char *g[] = { "a", "-u", "b", "c" }; __attribute__ ((__noreturn__)) void foo (void) { while (1); } __attribute__ ((noinline)) char * bar (char *x, unsigned int y) { return 0; } static inline char * baz (char *x, unsigned int y) { if (sizeof (t.t2) != (unsigned int) -1 && y > sizeof (t.t2)) foo (); return bar (x, y); } static inline int setup1 (int x) { char *p; int rval; if (!baz (t.t2, sizeof (t.t2))) baz (t.t2, sizeof (t.t2)); if (x & 0x200) { char **h, **i = e; ++d; e = f; if (t.t1 && *t.t1) e[0] = t.t1; else abort (); for (h = e + 1; (*h = *i); ++i, ++h) ; } return 1; } static inline int setup2 (void) { int j = 1; e = c + 1; d = b - 1; while (d > 0 && e[0][0] == '-') { if (e[0][1] != '\0' && e[0][2] != '\0') abort (); switch (e[0][1]) { case 'u': if (!e[1]) abort (); t.t3 = &e[1]; d--; e++; break; case 'P': j |= 0x1000; break; case '-': d--; e++; if (j == 1) j |= 0x600; return j; } d--; e++; } if (d > 0 && !(j & 1)) abort (); return j; } int main (void) { int x; c = g; b = 4; x = setup2 (); t.t1 = "/bin/sh"; setup1 (x); /* PRE shouldn't transform x into the constant 0x601 here, it's not legal. */ if ((x & 0x400) && !a[4]) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr20621-1.c ================================================ /* When generating o32 MIPS PIC, main's $gp save slot was out of range of a single load instruction. */ struct big { int i[sizeof (int) >= 4 && sizeof (void *) >= 4 ? 0x4000 : 4]; }; struct big gb; int foo (struct big b, int x) { return b.i[x]; } #if defined(STACK_SIZE) && STACK_SIZE <= 0x10000 int main (void) { return 0; } #else int main (void) { return foo (gb, 0) + foo (gb, 1); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr21173.c ================================================ void abort (void); char q; void *a[2]; void foo (char *p) { int i; for (i = 0; i < 2; i++) a[i] += p - &q; } int main (void) { int i; foo (&q); for (i = 0; i < 2; i ++) if (a[i]) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr21331.c ================================================ void abort (void); int bar (void) { return -1; } unsigned long foo () { unsigned long retval; retval = bar (); if (retval == -1) return 0; return 3; } main () { if (foo () != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr21964-1.c ================================================ void foo (int n, int m) { if (m == 0) exit (0); else if (n != 0) abort (); else foo (n++, m - 1); } int main (void) { foo (0, 4); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr22061-1.c ================================================ /* { dg-require-effective-target alloca } */ int N = 1; void foo() {} /* Necessary to trigger the original ICE. */ void bar (char a[2][N]) { a[1][0] = N; } int main (void) { void *x; N = 4; x = alloca (2 * N); memset (x, 0, 2 * N); bar (x); if (N[(char *) x] != N) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr22061-2.c ================================================ int *x; static void bar (char a[2][(*x)++]) {} int main (void) { exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr22061-3.c ================================================ void bar (int N) { int foo (char a[2][++N]) { N += 4; return sizeof (a[0]); } if (foo (0) != 2) abort (); if (foo (0) != 7) abort (); if (N != 11) abort (); } int main() { bar (1); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr22061-4.c ================================================ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ void bar (int N) { void foo (int a[2][N++]) {} int a[2][N]; foo (a); int b[2][N]; foo (b); if (sizeof (a) != sizeof (int) * 2 * 1) abort (); if (sizeof (b) != sizeof (int) * 2 * 2) abort (); if (N != 3) abort (); } int main (void) { bar (1); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr22098-1.c ================================================ extern void abort (void); extern void exit (int); typedef __UINTPTR_TYPE__ uintptr_t; int main (void) { int a = 0; int *p; uintptr_t b; b = (uintptr_t)(p = &(int []){0, 1, 2}[++a]); if (a != 1 || *p != 1 || *(int *)b != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr22098-2.c ================================================ extern void abort (void); extern void exit (int); typedef __UINTPTR_TYPE__ uintptr_t; int main (void) { int a = 0; int *p; uintptr_t b; b = (uintptr_t)(p = &(int []){0, 1, 2}[1]); if (*p != 1 || *(int *)b != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr22098-3.c ================================================ extern void abort (void); extern void exit (int); typedef __UINTPTR_TYPE__ uintptr_t; int n = 0; int f (void) { return ++n; } int main (void) { int a = 0; int *p; uintptr_t b; b = (uintptr_t)(p = &(int []){0, f(), 2}[1]); if (*p != 1 || *(int *)b != 1 || n != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr22348.c ================================================ void abort (void); void f(int i) { if (i>4 + 3 * 16) abort(); } int main() { unsigned int buflen, i; buflen = 4 + 3 * 16; for (i = 4; i < buflen; i+= 3) f(i); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr22429.c ================================================ extern void abort (void); #define N (1 << (sizeof(int) * __CHAR_BIT__ - 2)) int f(int n) { if (-N <= n && n <= N-1) return 1; return 0; } int main () { if (f (N)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr22493-1.c ================================================ /* { dg-options "-fwrapv" } */ #include extern void abort (); extern void exit (int); void f(int i) { if (i>0) abort(); i = -i; if (i<0) return; abort (); } int main(int argc, char *argv[]) { f(INT_MIN); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr22630.c ================================================ void abort (void); int j; void bla (int *r) { int *p, *q; p = q = r; if (!p) p = &j; if (p != q) j = 1; } int main (void) { bla (0); if (!j) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr23047.c ================================================ /* { dg-options "-fwrapv" } */ #include extern void abort (); extern void exit (int); void f(int i) { i = i > 0 ? i : -i; if (i<0) return; abort (); } int main(int argc, char *argv[]) { f(INT_MIN); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr23135.c ================================================ /* Based on execute/simd-1.c, modified by joern.rennecke@st.com to trigger a reload bug. Verified for gcc mainline from 20050722 13:00 UTC for sh-elf -m4 -O2. */ /* { dg-options "-Wno-psabi" } */ #ifndef STACK_SIZE #define STACK_SIZE (256*1024) #endif extern void abort (void); extern void exit (int); typedef struct { char c[STACK_SIZE/2]; } big_t; typedef int __attribute__((mode(SI))) __attribute__((vector_size (8))) vecint; typedef int __attribute__((mode(SI))) siint; vecint i = { 150, 100 }; vecint j = { 10, 13 }; vecint k; union { vecint v; siint i[2]; } res; void verify (siint a1, siint a2, siint b1, siint b2, big_t big) { if (a1 != b1 || a2 != b2) abort (); } int main () { big_t big; vecint k0, k1, k2, k3, k4, k5, k6, k7; k0 = i + j; res.v = k0; verify (res.i[0], res.i[1], 160, 113, big); k1 = i * j; res.v = k1; verify (res.i[0], res.i[1], 1500, 1300, big); k2 = i / j; /* This is the observed failure - reload 0 has the wrong type and thus the conflict with reload 1 is missed: (insn:HI 94 92 96 1 pr23135.c:46 (parallel [ (set (subreg:SI (reg:DI 253) 0) (div:SI (reg:SI 4 r4) (reg:SI 5 r5))) (clobber (reg:SI 146 pr)) (clobber (reg:DF 64 fr0)) (clobber (reg:DF 66 fr2)) (use (reg:PSI 151 )) (use (reg/f:SI 256)) ]) 60 {divsi3_i4} (insn_list:REG_DEP_TRUE 90 (insn_list:REG_DEP_TRUE 89 (insn_list:REG_DEP_TRUE 42 (insn_list:REG_DEP_TRUE 83 (insn_list:REG_DEP_TRUE 92 (insn_list:REG_DEP_TRUE 91 (nil))))))) (expr_list:REG_DEAD (reg:SI 4 r4) (expr_list:REG_DEAD (reg:SI 5 r5) (expr_list:REG_UNUSED (reg:DF 66 fr2) (expr_list:REG_UNUSED (reg:DF 64 fr0) (expr_list:REG_UNUSED (reg:SI 146 pr) (insn_list:REG_RETVAL 91 (nil)))))))) Reloads for insn # 94 Reload 0: reload_in (SI) = (plus:SI (reg/f:SI 14 r14) (const_int 64 [0x40])) GENERAL_REGS, RELOAD_FOR_OUTADDR_ADDRESS (opnum = 0) reload_in_reg: (plus:SI (reg/f:SI 14 r14) (const_int 64 [0x40])) reload_reg_rtx: (reg:SI 3 r3) Reload 1: GENERAL_REGS, RELOAD_FOR_OUTPUT_ADDRESS (opnum = 0), can't combine, se condary_reload_p reload_reg_rtx: (reg:SI 3 r3) Reload 2: reload_out (SI) = (mem:SI (plus:SI (plus:SI (reg/f:SI 14 r14) (const_int 64 [0x40])) (const_int 28 [0x1c])) [ 16 S8 A32]) FPUL_REGS, RELOAD_FOR_OUTPUT (opnum = 0) reload_out_reg: (subreg:SI (reg:DI 253) 0) reload_reg_rtx: (reg:SI 150 fpul) secondary_out_reload = 1 Reload 3: reload_in (SI) = (symbol_ref:SI ("__sdivsi3_i4") [flags 0x1]) GENERAL_REGS, RELOAD_FOR_INPUT (opnum = 1), can't combine reload_in_reg: (reg/f:SI 256) reload_reg_rtx: (reg:SI 3 r3) */ res.v = k2; verify (res.i[0], res.i[1], 15, 7, big); k3 = i & j; res.v = k3; verify (res.i[0], res.i[1], 2, 4, big); k4 = i | j; res.v = k4; verify (res.i[0], res.i[1], 158, 109, big); k5 = i ^ j; res.v = k5; verify (res.i[0], res.i[1], 156, 105, big); k6 = -i; res.v = k6; verify (res.i[0], res.i[1], -150, -100, big); k7 = ~i; res.v = k7; verify (res.i[0], res.i[1], -151, -101, big); k = k0 + k1 + k3 + k4 + k5 + k6 + k7; res.v = k; verify (res.i[0], res.i[1], 1675, 1430, big); k = k0 * k1 * k3 * k4 * k5 * k6 * k7; res.v = k; verify (res.i[0], res.i[1], 1456467968, -1579586240, big); k = k0 / k1 / k2 / k3 / k4 / k5 / k6 / k7; res.v = k; verify (res.i[0], res.i[1], 0, 0, big); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr23324.c ================================================ extern void abort (void); #define A(x) if (!(x)) abort () static union at6 {} vv6 = {}; static struct et6 { struct bt6 { signed av6:6; signed bv6:7; signed cv6:6; signed dv6:5; unsigned char ev6; unsigned int fv6; long int gv6; } mv6; unsigned long int nv6; signed ov6:12; signed pv6:3; signed qv6:2; signed rv6:10; union ct6 { long int hv6; float iv6; float jv6; } sv6; int *tv6; union dt6 { double kv6; float lv6; } uv6; } wv6 = { { 8, 9, 2, 4, '\x10', 67426805U, 1047191860L }, 1366022414UL, 858, 1, 1, 305, { 1069379046L }, (int *) 358273621U, { 3318.041978 } }; static double xv6 = 19239.101269; static long long int yv6 = 1207859169L; static int zv6 = 660195606; static union at6 callee_af6 (struct et6 ap6, double bp6, long long int cp6, int dp6) { A (wv6.mv6.av6 == ap6.mv6.av6); A (wv6.mv6.bv6 == ap6.mv6.bv6); A (wv6.mv6.cv6 == ap6.mv6.cv6); A (wv6.mv6.dv6 == ap6.mv6.dv6); A (wv6.mv6.ev6 == ap6.mv6.ev6); A (wv6.mv6.fv6 == ap6.mv6.fv6); A (wv6.mv6.gv6 == ap6.mv6.gv6); A (wv6.nv6 == ap6.nv6); A (wv6.ov6 == ap6.ov6); A (wv6.pv6 == ap6.pv6); A (wv6.qv6 == ap6.qv6); A (wv6.rv6 == ap6.rv6); A (wv6.sv6.hv6 == ap6.sv6.hv6); A (wv6.tv6 == ap6.tv6); A (wv6.uv6.kv6 == ap6.uv6.kv6); A (xv6 == bp6); A (yv6 == cp6); A (zv6 == dp6); return vv6; } static void caller_bf6 (void) { union at6 bav6; bav6 = callee_af6 (wv6, xv6, yv6, zv6); } static unsigned char uv7 = '\x46'; static float vv7 = 96636.982442; static double wv7 = 28450.711801; static union ct7 {} xv7 = {}; static struct et7 { struct dt7 { float iv7; unsigned short int jv7; } kv7; float lv7[0]; signed mv7:9; short int nv7; double ov7; float pv7; } yv7 = { { 30135.996213, 42435 }, {}, 170, 22116, 26479.628148, 4082.960685 }; static union ft7 { float qv7; float *rv7; unsigned int *sv7; } zv7 = { 5042.227886 }; static int bav7 = 1345451862; static struct gt7 { double tv7; } bbv7 = { 47875.491954 }; static long int bcv7[1] = { 1732133482L }; static long long int bdv7 = 381678602L; static unsigned char callee_af7 (float ap7, double bp7, union ct7 cp7, struct et7 dp7, union ft7 ep7, int fp7, struct gt7 gp7, long int hp7[1], long long int ip7) { A (vv7 == ap7); A (wv7 == bp7); A (yv7.kv7.iv7 == dp7.kv7.iv7); A (yv7.kv7.jv7 == dp7.kv7.jv7); A (yv7.mv7 == dp7.mv7); A (yv7.nv7 == dp7.nv7); A (yv7.ov7 == dp7.ov7); A (yv7.pv7 == dp7.pv7); A (zv7.qv7 == ep7.qv7); A (bav7 == fp7); A (bbv7.tv7 == gp7.tv7); A (bcv7[0] == hp7[0]); A (bdv7 == ip7); return uv7; } static void caller_bf7 (void) { unsigned char bev7; bev7 = callee_af7 (vv7, wv7, xv7, yv7, zv7, bav7, bbv7, bcv7, bdv7); A (uv7 == bev7); } int main () { caller_bf6 (); caller_bf7 (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr23467.c ================================================ struct s1 { int __attribute__ ((aligned (8))) a; }; struct { char c; struct s1 m; } v; int main (void) { if ((int)&v.m & 7) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr23604.c ================================================ extern void abort (void); int g(int i, int j) { if (i>-1) if (i<2) { if (i != j) { if (j != 0) return 0; } } return 1; } int main(void) { if (!g(1, 0)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr23941.c ================================================ extern void abort (void); double d = __FLT_MIN__ / 2.0; int main() { double x = __FLT_MIN__ / 2.0; if (x != d) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr24135.c ================================================ #ifndef NO_TRAMPOLINES extern void abort (void); int x(int a, int b) { __label__ xlab; __label__ xlab2; void y(int b) { switch (b) { case 1: goto xlab; case 2: goto xlab; } } a = a + 2; y (b); xlab: return a; xlab2: a++; return a; } int main () { int i, j; for (j = 1; j <= 2; ++j) for (i = 1; i <= 2; ++i) { int a = x (j, i); if (a != 2 + j) abort (); } return 0; } #else int main() { return 0; } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr24141.c ================================================ // reduced testcase, compile with -O2. Also, with --disable-checking // gcc produces wrong code. void abort (void); int i; void g (void) { i = 1; } void f (int a, int b) { int c = 0; if (a == 0) c = 1; if (c) return; if (c == 1) c = 0; if (b == 0) c = 1; if (c) g (); } int main (void) { f (1, 0); if (i != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr24142.c ================================================ void abort (void); int f (int a, int b) { if (a == 1) a = 0; if (b == 0) a = 1; if (a != 0) return 0; return 1; } int main (void) { if (f (1, 1) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr24716.c ================================================ /* PR24716, scalar evolution returning the wrong result for pdest. */ int Link[] = { -1 }; int W[] = { 2 }; extern void abort (void); int f (int k, int p) { int pdest, j, D1361; j = 0; pdest = 0; for (;;) { if (pdest > 2) do j--, pdest++; while (j > 2); if (j == 1) break; while (pdest > p) if (j == p) pdest++; do { D1361 = W[k]; do if (D1361 != 0) pdest = 1, W[k] = D1361 = 0; while (p < 1); } while (k > 0); do { p = 0; k = Link[k]; while (p < j) if (k != -1) pdest++, p++; } while (k != -1); j = 1; } /* The correct return value should be pdest (1 in the call from main). DOM3 is mistaken and propagates a 0 here. */ return pdest; } int main () { if (!f (0, 2)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr24851.c ================================================ /* We used to handle pointer addition wrongly at the time of recombining to an ARRAY_REF in the case of p + -4B where -4B is represented as unsigned. */ void abort(void); int main() { int a[10], *p, *q; q = &a[1]; p = &q[-1]; if (p >= &a[9]) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr25125.c ================================================ extern void exit (int); extern void abort (void); extern unsigned short f (short a) __attribute__((__noinline__)); unsigned short f (short a) { short b; if (a > 0) return 0; b = ((int) a) + - (int) 32768; return b; } int main (void) { if (sizeof (short) < 2 || sizeof (short) >= sizeof (int)) exit (0); if (f (-32767) != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr25737.c ================================================ extern void abort (void); struct delay_block { struct delay_block *succ; }; static struct delay_block Timer_Queue; struct delay_block* time_enqueue (struct delay_block *d) { struct delay_block *q = Timer_Queue.succ; d->succ = (void *)0; return Timer_Queue.succ; } int main(void) { Timer_Queue.succ = &Timer_Queue; if (time_enqueue (&Timer_Queue) != (void*)0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr27073.c ================================================ void __attribute__((noinline)) foo (int *p, int d1, int d2, int d3, short count, int s1, int s2, int s3, int s4, int s5) { int n = count; while (n--) { *p++ = s1; *p++ = s2; *p++ = s3; *p++ = s4; *p++ = s5; } } int main() { int x[10], i; foo (x, 0, 0, 0, 2, 100, 200, 300, 400, 500); for (i = 0; i < 10; i++) if (x[i] != (i % 5 + 1) * 100) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr27260.c ================================================ /* PR middle-end/27260 */ extern void abort (void); extern void *memset (void *, int, __SIZE_TYPE__); char buf[65]; void foo (int x) { memset (buf, x != 2 ? 1 : 0, 64); } int main (void) { int i; buf[64] = 2; for (i = 0; i < 64; i++) if (buf[i] != 0) abort (); foo (0); for (i = 0; i < 64; i++) if (buf[i] != 1) abort (); foo (2); for (i = 0; i < 64; i++) if (buf[i] != 0) abort (); if (buf[64] != 2) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr27285.c ================================================ /* PR tree-optimization/27285 */ extern void abort (void); struct S { unsigned char a, b, c, d[16]; }; void __attribute__ ((noinline)) foo (struct S *x, struct S *y) { int a, b; unsigned char c, *d, *e; b = x->b; d = x->d; e = y->d; a = 0; while (b) { if (b >= 8) { c = 0xff; b -= 8; } else { c = 0xff << (8 - b); b = 0; } e[a] = d[a] & c; a++; } } int main (void) { struct S x = { 0, 25, 0, { 0xaa, 0xbb, 0xcc, 0xdd }}; struct S y = { 0, 0, 0, { 0 }}; foo (&x, &y); if (x.d[0] != y.d[0] || x.d[1] != y.d[1] || x.d[2] != y.d[2] || (x.d[3] & 0x80) != y.d[3]) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr27364.c ================================================ int f(unsigned number_of_digits_to_use) { if (number_of_digits_to_use >1294) return 0; return (number_of_digits_to_use * 3321928 / 1000000 + 1) /16; } int main(void) { if (f(11) != 2) __builtin_abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr27671-1.c ================================================ /* PR rtl-optimization/27671. The combiner used to simplify "a ^ b == a" to "a" via simplify_relational_operation_1 in simplify-rtx.c. */ extern void abort (void) __attribute__ ((noreturn)); extern void exit (int) __attribute__ ((noreturn)); static int __attribute__((noinline)) foo (int a, int b) { int c = a ^ b; if (c == a) abort (); } int main (void) { foo (0, 1); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr28289.c ================================================ extern int ok (int); extern void exit (); static int gen_x86_64_shrd (int); static int gen_x86_64_shrd(int a __attribute__ ((__unused__))) { return 0; } extern int gen_x86_shrd_1 (int); extern void ix86_split_ashr (int); void ix86_split_ashr (int mode) { (mode != 0 ? ok : gen_x86_64_shrd) (0); } volatile int one = 1; int main (void) { ix86_split_ashr (one); return 1; } int ok (int i) { exit (i); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr28403.c ================================================ typedef unsigned long long ull; int global; int __attribute__((noinline)) foo (int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8) { global = x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8; } ull __attribute__((noinline)) bar (ull x) { foo (1, 2, 1, 3, 1, 4, 1, 5); return x >> global; } int main (void) { if (bar (0x123456789abcdefULL) != (0x123456789abcdefULL >> 18)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr28651.c ================================================ #include extern void abort (void); int __attribute__((noinline)) foo (unsigned int u) { return (int)(u + 4) < (int)u; } int main (int argc, char *argv[]) { unsigned int u = INT_MAX; if (foo (u) == 0) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr28778.c ================================================ extern void abort(void); typedef long GLint; void aglChoosePixelFormat (const GLint *); void find (const int *alistp) { const int *blist; int list[32]; if (alistp) blist = alistp; else { list[3] = 42; blist = list; } aglChoosePixelFormat ((GLint *) blist); } void aglChoosePixelFormat (const GLint * a) { int *b = (int *) a; if (b[3] != 42) abort (); } int main (void) { find (0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr28865.c ================================================ struct A { int a; char b[]; }; union B { struct A a; char b[sizeof (struct A) + 31]; }; union B b = { { 1, "123456789012345678901234567890" } }; union B c = { { 2, "123456789012345678901234567890" } }; __attribute__((noinline, noclone)) void foo (int *x[2]) { x[0] = &b.a.a; x[1] = &c.a.a; } int main () { int *x[2]; foo (x); if (*x[0] != 1 || *x[1] != 2) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr28982a.c ================================================ /* PR rtl-optimization/28982. Function foo() does the equivalent of: float tmp_results[NVARS]; for (int i = 0; i < NVARS; i++) { int inc = incs[i]; float *ptr = ptrs[i], result = 0; for (int j = 0; j < n; j++) result += *ptr, ptr += inc; tmp_results[i] = result; } memcpy (results, tmp_results, sizeof (results)); but without the outermost loop. The idea is to create high register pressure and ensure that some INC and PTR variables are spilled. On ARM targets, sequences like "result += *ptr, ptr += inc" can usually be implemented using (mem (post_modify ...)), and we do indeed create such MEMs before reload for this testcase. However, (post_modify ...) is not a valid address for coprocessor loads, so for -mfloat-abi=softfp, reload reloads the POST_MODIFY into a base register. GCC did not deal correctly with cases where the base and index of the POST_MODIFY are themselves reloaded. */ #define NITER 4 #define NVARS 20 #define MULTI(X) \ X( 0), X( 1), X( 2), X( 3), X( 4), X( 5), X( 6), X( 7), X( 8), X( 9), \ X(10), X(11), X(12), X(13), X(14), X(15), X(16), X(17), X(18), X(19) #define DECLAREI(INDEX) inc##INDEX = incs[INDEX] #define DECLAREF(INDEX) *ptr##INDEX = ptrs[INDEX], result##INDEX = 0 #define LOOP(INDEX) result##INDEX += *ptr##INDEX, ptr##INDEX += inc##INDEX #define COPYOUT(INDEX) results[INDEX] = result##INDEX float *ptrs[NVARS]; float results[NVARS]; int incs[NVARS]; void __attribute__((noinline)) foo (int n) { int MULTI (DECLAREI); float MULTI (DECLAREF); while (n--) MULTI (LOOP); MULTI (COPYOUT); } float input[NITER * NVARS]; int main (void) { int i; for (i = 0; i < NVARS; i++) ptrs[i] = input + i, incs[i] = i; for (i = 0; i < NITER * NVARS; i++) input[i] = i; foo (NITER); for (i = 0; i < NVARS; i++) if (results[i] != i * NITER * (NITER + 1) / 2) return 1; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr28982b.c ================================================ /* Like pr28982a.c, but with the spill slots outside the range of a single sp-based load on ARM. This test tests for cases where the addresses in the base and index reloads require further reloads. */ #if defined(STACK_SIZE) && STACK_SIZE <= 0x80100 int main (void) { return 0; } #else #define NITER 4 #define NVARS 20 #define MULTI(X) \ X( 0), X( 1), X( 2), X( 3), X( 4), X( 5), X( 6), X( 7), X( 8), X( 9), \ X(10), X(11), X(12), X(13), X(14), X(15), X(16), X(17), X(18), X(19) #define DECLAREI(INDEX) inc##INDEX = incs[INDEX] #define DECLAREF(INDEX) *ptr##INDEX = ptrs[INDEX], result##INDEX = 0 #define LOOP(INDEX) result##INDEX += *ptr##INDEX, ptr##INDEX += inc##INDEX #define COPYOUT(INDEX) results[INDEX] = result##INDEX float *ptrs[NVARS]; float results[NVARS]; int incs[NVARS]; struct big { int i[0x10000]; }; void __attribute__((noinline)) bar (struct big b) { incs[0] += b.i[0]; } void __attribute__((noinline)) foo (int n) { struct big b = {}; int MULTI (DECLAREI); float MULTI (DECLAREF); while (n--) MULTI (LOOP); MULTI (COPYOUT); bar (b); } float input[NITER * NVARS]; int main (void) { int i; for (i = 0; i < NVARS; i++) ptrs[i] = input + i, incs[i] = i; for (i = 0; i < NITER * NVARS; i++) input[i] = i; foo (NITER); for (i = 0; i < NVARS; i++) if (results[i] != i * NITER * (NITER + 1) / 2) return 1; return 0; } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr29006.c ================================================ struct __attribute__((__packed__)) s { char c; unsigned long long x; }; void __attribute__((__noinline__)) foo (struct s *s) { s->x = 0; } int main (void) { struct s s = { 1, ~0ULL }; foo (&s); return s.x != 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr29156.c ================================================ extern void abort(void); struct test1 { int a; int b; }; struct test2 { float d; struct test1 sub; }; int global; int bla(struct test1 *xa, struct test2 *xb) { global = 1; xb->sub.a = 1; xa->a = 8; return xb->sub.a; } int main(void) { struct test2 pom; if (bla (&pom.sub, &pom) != 8) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr29695-1.c ================================================ /* PR middle-end/29695 */ extern void abort (void); int f1 (void) { int a = 128; return (a & 0x80) ? 0x80 : 0; } int f2 (void) { unsigned char a = 128; return (a & 0x80) ? 0x80 : 0; } int f3 (void) { unsigned char a = 128; return (a & 0x80) ? 0x380 : 0; } int f4 (void) { unsigned char a = 128; return (a & 0x80) ? -128 : 0; } long long f5 (void) { long long a = 0x80000000LL; return (a & 0x80000000) ? 0x80000000LL : 0LL; } long long f6 (void) { unsigned int a = 0x80000000; return (a & 0x80000000) ? 0x80000000LL : 0LL; } long long f7 (void) { unsigned int a = 0x80000000; return (a & 0x80000000) ? 0x380000000LL : 0LL; } long long f8 (void) { unsigned int a = 0x80000000; return (a & 0x80000000) ? -2147483648LL : 0LL; } int main (void) { if ((char) 128 != -128 || (int) 0x80000000 != -2147483648) return 0; if (f1 () != 128) abort (); if (f2 () != 128) abort (); if (f3 () != 896) abort (); if (f4 () != -128) abort (); if (f5 () != 0x80000000LL) abort (); if (f6 () != 0x80000000LL) abort (); if (f7 () != 0x380000000LL) abort (); if (f8 () != -2147483648LL) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr29695-2.c ================================================ /* PR middle-end/29695 */ extern void abort (void); int a = 128; unsigned char b = 128; long long c = 0x80000000LL; unsigned int d = 0x80000000; int f1 (void) { return (a & 0x80) ? 0x80 : 0; } int f2 (void) { return (b & 0x80) ? 0x80 : 0; } int f3 (void) { return (b & 0x80) ? 0x380 : 0; } int f4 (void) { return (b & 0x80) ? -128 : 0; } long long f5 (void) { return (c & 0x80000000) ? 0x80000000LL : 0LL; } long long f6 (void) { return (d & 0x80000000) ? 0x80000000LL : 0LL; } long long f7 (void) { return (d & 0x80000000) ? 0x380000000LL : 0LL; } long long f8 (void) { return (d & 0x80000000) ? -2147483648LL : 0LL; } int main (void) { if ((char) 128 != -128 || (int) 0x80000000 != -2147483648) return 0; if (f1 () != 128) abort (); if (f2 () != 128) abort (); if (f3 () != 896) abort (); if (f4 () != -128) abort (); if (f5 () != 0x80000000LL) abort (); if (f6 () != 0x80000000LL) abort (); if (f7 () != 0x380000000LL) abort (); if (f8 () != -2147483648LL) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr29797-1.c ================================================ /* { dg-require-effective-target int32plus } */ extern void abort(void); unsigned int bar(void) { return 32768; } int main() { unsigned int nStyle = bar (); if (nStyle & 32768) nStyle |= 65536; if (nStyle != (32768 | 65536)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr29797-2.c ================================================ extern void abort(void); unsigned long bar(void) { return 32768; } int main() { unsigned long nStyle = bar (); if (nStyle & 32768) nStyle |= 65536; if (nStyle != (32768 | 65536)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr29798.c ================================================ extern void abort (); int main () { int i; double oldrho; double beta = 0.0; double work = 1.0; for (i = 1; i <= 2; i++) { double rho = work * work; if (i != 1) beta = rho / oldrho; if (beta == 1.0) abort (); /* All targets even remotely likely to ever get supported use at least an even base, so there will never be any floating-point rounding. All computation in this test case is exact for even bases. */ work /= 2.0; oldrho = rho; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr30185.c ================================================ /* PR target/30185 */ extern void abort (void); typedef struct S { char a; long long b; } S; S foo (S x, S y) { S z; z.b = x.b / y.b; return z; } int main (void) { S a, b; a.b = 32LL; b.b = 4LL; if (foo (a, b).b != 8LL) abort (); a.b = -8LL; b.b = -2LL; if (foo (a, b).b != 4LL) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr30778.c ================================================ extern void *memset (void *, int, unsigned long); extern void abort (void); struct reg_stat { void *last_death; void *last_set; void *last_set_value; int last_set_label; char last_set_sign_bit_copies; int last_set_mode : 8; char last_set_invalid; char sign_bit_copies; long nonzero_bits; }; static struct reg_stat *reg_stat; void __attribute__((noinline)) init_reg_last (void) { memset (reg_stat, 0, __builtin_offsetof (struct reg_stat, sign_bit_copies)); } int main (void) { struct reg_stat r; reg_stat = &r; r.nonzero_bits = -1; init_reg_last (); if (r.nonzero_bits != -1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr31072.c ================================================ extern volatile int ReadyFlag_NotProperlyInitialized; volatile int ReadyFlag_NotProperlyInitialized=1; int main(void) { if (ReadyFlag_NotProperlyInitialized != 1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr31136.c ================================================ extern void abort (void); struct S { unsigned b4:4; unsigned b6:6; } s; int main() { s.b6 = 31; s.b4 = s.b6; s.b6 = s.b4; if (s.b6 != 15) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr31169.c ================================================ extern void abort(); #define HOST_WIDE_INT long #define HOST_BITS_PER_WIDE_INT (sizeof(long)*8) struct tree_type { unsigned int precision : 9; }; int sign_bit_p (struct tree_type *t, HOST_WIDE_INT val_hi, unsigned HOST_WIDE_INT val_lo) { unsigned HOST_WIDE_INT mask_lo, lo; HOST_WIDE_INT mask_hi, hi; int width = t->precision; if (width > HOST_BITS_PER_WIDE_INT) { hi = (unsigned HOST_WIDE_INT) 1 << (width - HOST_BITS_PER_WIDE_INT - 1); lo = 0; mask_hi = ((unsigned HOST_WIDE_INT) -1 >> (2 * HOST_BITS_PER_WIDE_INT - width)); mask_lo = -1; } else { hi = 0; lo = (unsigned HOST_WIDE_INT) 1 << (width - 1); mask_hi = 0; mask_lo = ((unsigned HOST_WIDE_INT) -1 >> (HOST_BITS_PER_WIDE_INT - width)); } if ((val_hi & mask_hi) == hi && (val_lo & mask_lo) == lo) return 1; return 0; } int main() { struct tree_type t; t.precision = 1; if (!sign_bit_p (&t, 0, -1)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr31448-2.c ================================================ /* PR middle-end/31448, this used to ICE during expand because reduce_to_bit_field_precision was not ready to handle constants. */ typedef struct _st { long int iIndex : 24; long int iIndex1 : 24; } st; st *next; void g(void) { st *next = 0; int nIndx; const static int constreg[] = { 0,}; nIndx = 0; next->iIndex = constreg[nIndx]; } void f(void) { int nIndx; const static long int constreg[] = { 0xFEFEFEFE,}; nIndx = 0; next->iIndex = constreg[nIndx]; next->iIndex1 = constreg[nIndx]; } int main(void) { st a; next = &a; f(); if (next->iIndex != 0xFFFEFEFE) __builtin_abort (); if (next->iIndex1 != 0xFFFEFEFE) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr31448.c ================================================ /* PR middle-end/31448, this used to ICE during expand because reduce_to_bit_field_precision was not ready to handle constants. */ /* { dg-require-effective-target int32plus } */ typedef struct _st { int iIndex : 24; int iIndex1 : 24; } st; st *next; void g(void) { st *next = 0; int nIndx; const static int constreg[] = { 0,}; nIndx = 0; next->iIndex = constreg[nIndx]; } void f(void) { int nIndx; const static int constreg[] = { 0xFEFEFEFE,}; nIndx = 0; next->iIndex = constreg[nIndx]; next->iIndex1 = constreg[nIndx]; } int main(void) { st a; next = &a; f(); if (next->iIndex != 0xFFFEFEFE) __builtin_abort (); if (next->iIndex1 != 0xFFFEFEFE) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr31605.c ================================================ void put_field (unsigned int start, unsigned int len) { int cur_bitshift = ((start + len) % 8) - 8; if (cur_bitshift > -8) exit (0); } int main () { put_field (0, 1); abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr32244-1.c ================================================ struct foo { unsigned long long b:40; } x; extern void abort (void); void test1(unsigned long long res) { /* The shift is carried out in 40 bit precision. */ if (x.b<<32 != res) abort (); } int main() { x.b = 0x0100; test1(0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr32500.c ================================================ extern void abort(void); extern void exit(int); void foo(int) __attribute__((noinline)); void bar(void) __attribute__((noinline)); /* Make sure foo is not inlined or considered pure/const. */ int x; void foo(int i) { x = i; } void bar(void) { exit(0); } int main(int argc, char *argv[]) { int i; int numbers[4] = { 0xdead, 0xbeef, 0x1337, 0x4242 }; for (i = 1; i <= 12; i++) { if (i <= 4) foo(numbers[i-1]); else if (i >= 7 && i <= 9) bar(); } abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr33142.c ================================================ int abs(int j); extern void abort(void); __attribute__((noinline)) int lisp_atan2(long dy, long dx) { if (dx <= 0) if (dy > 0) return abs(dx) <= abs(dy); return 0; } int main() { volatile long dy = 63, dx = -77; if (lisp_atan2(dy, dx)) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr33382.c ================================================ struct Foo { int i; int j[]; }; struct Foo x = { 1, { 2, 0, 2, 3 } }; int foo(void) { x.j[0] = 1; return x.j[1]; } extern void abort(void); int main() { if (foo() != 0) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr33631.c ================================================ typedef union { int __lock; } pthread_mutex_t; extern void abort (void); int main() { struct { int c; pthread_mutex_t m; } r = { .m = 0 }; if (r.c != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr33669.c ================================================ extern void abort (void); typedef struct foo_t { unsigned int blksz; unsigned int bf_cnt; } foo_t; #define _RNDUP(x, unit) ((((x) + (unit) - 1) / (unit)) * (unit)) #define _RNDDOWN(x, unit) ((x) - ((x)%(unit))) long long foo (foo_t *const pxp, long long offset, unsigned int extent) { long long blkoffset = _RNDDOWN(offset, (long long )pxp->blksz); unsigned int diff = (unsigned int)(offset - blkoffset); unsigned int blkextent = _RNDUP(diff + extent, pxp->blksz); if (pxp->blksz < blkextent) return -1LL; if (pxp->bf_cnt > pxp->blksz) pxp->bf_cnt = pxp->blksz; return blkoffset; } int main () { foo_t x; long long xx; x.blksz = 8192; x.bf_cnt = 0; xx = foo (&x, 0, 4096); if (xx != 0LL) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr33779-1.c ================================================ int foo(int i) { if (((unsigned)(i + 1)) * 4 == 0) return 1; return 0; } extern void abort(void); int main() { if (foo(0x3fffffff) == 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr33779-2.c ================================================ int foo(int i) { return ((int)((unsigned)(i + 1) * 4)) / 4; } extern void abort(void); int main() { if (foo(0x3fffffff) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr33870-1.c ================================================ extern void abort (void); typedef struct PgHdr PgHdr; typedef unsigned char u8; struct PgHdr { int y; struct { unsigned int pgno; PgHdr *pNextHash, *pPrevHash; PgHdr *pNextFree, *pPrevFree; PgHdr *pNextAll; u8 inJournal; short int nRef; PgHdr *pDirty, *pPrevDirty; unsigned int notUsed; } x; }; PgHdr **xx; volatile int vx; static inline PgHdr *merge_pagelist(PgHdr *pA, PgHdr *pB) { PgHdr result; PgHdr *pTail; xx = &result.x.pDirty; pTail = &result; while( pA && pB ){ if( pA->x.pgnox.pgno ){ pTail->x.pDirty = pA; pTail = pA; pA = pA->x.pDirty; }else{ pTail->x.pDirty = pB; pTail = pB; pB = pB->x.pDirty; } vx = (*xx)->y; } if( pA ){ pTail->x.pDirty = pA; }else if( pB ){ pTail->x.pDirty = pB; }else{ pTail->x.pDirty = 0; } return result.x.pDirty; } PgHdr * __attribute__((noinline)) sort_pagelist(PgHdr *pIn) { PgHdr *a[25], *p; int i; __builtin_memset (a, 0, sizeof (a)); while( pIn ){ p = pIn; pIn = p->x.pDirty; p->x.pDirty = 0; for(i=0; i<25 -1; i++){ if( a[i]==0 ){ a[i] = p; break; }else{ p = merge_pagelist(a[i], p); a[i] = 0; a[i] = 0; } } if( i==25 -1 ){ a[i] = merge_pagelist(a[i], p); } } p = a[0]; for(i=1; i<25; i++){ p = merge_pagelist (p, a[i]); } return p; } int main() { PgHdr a[5]; PgHdr *p; a[0].x.pgno = 5; a[0].x.pDirty = &a[1]; a[1].x.pgno = 4; a[1].x.pDirty = &a[2]; a[2].x.pgno = 1; a[2].x.pDirty = &a[3]; a[3].x.pgno = 3; a[3].x.pDirty = 0; p = sort_pagelist (&a[0]); if (p->x.pDirty == p) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr33870.c ================================================ extern void abort (void); typedef struct PgHdr PgHdr; typedef unsigned char u8; struct PgHdr { unsigned int pgno; PgHdr *pNextHash, *pPrevHash; PgHdr *pNextFree, *pPrevFree; PgHdr *pNextAll; u8 inJournal; short int nRef; PgHdr *pDirty, *pPrevDirty; unsigned int notUsed; }; static inline PgHdr *merge_pagelist(PgHdr *pA, PgHdr *pB) { PgHdr result; PgHdr *pTail; pTail = &result; while( pA && pB ){ if( pA->pgnopgno ){ pTail->pDirty = pA; pTail = pA; pA = pA->pDirty; }else{ pTail->pDirty = pB; pTail = pB; pB = pB->pDirty; } } if( pA ){ pTail->pDirty = pA; }else if( pB ){ pTail->pDirty = pB; }else{ pTail->pDirty = 0; } return result.pDirty; } PgHdr * __attribute__((noinline)) sort_pagelist(PgHdr *pIn) { PgHdr *a[25], *p; int i; __builtin_memset (a, 0, sizeof (a)); while( pIn ){ p = pIn; pIn = p->pDirty; p->pDirty = 0; for(i=0; i<25 -1; i++){ if( a[i]==0 ){ a[i] = p; break; }else{ p = merge_pagelist(a[i], p); a[i] = 0; } } if( i==25 -1 ){ a[i] = merge_pagelist(a[i], p); } } p = a[0]; for(i=1; i<25; i++){ p = merge_pagelist (p, a[i]); } return p; } int main() { PgHdr a[5]; PgHdr *p; a[0].pgno = 5; a[0].pDirty = &a[1]; a[1].pgno = 4; a[1].pDirty = &a[2]; a[2].pgno = 1; a[2].pDirty = &a[3]; a[3].pgno = 3; a[3].pDirty = 0; p = sort_pagelist (&a[0]); if (p->pDirty == p) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr33992.c ================================================ extern void abort (); void __attribute__((noinline)) bar (unsigned long long i) { if (i) abort (); } static void __attribute__((always_inline)) foo (unsigned long long *r) { int i; for (i = 0; ; i++) if (*r & ((unsigned long long)1 << (63 - i))) break; bar (i); } void __attribute__((noinline)) do_test (unsigned long long *r) { int i; for (i = 0; i < 2; ++i) foo (r); } int main() { unsigned long long r = 0x8000000000000001ull; do_test (&r); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr34070-1.c ================================================ extern void abort (void); int f(unsigned int x) { return ((int)x) % 4; } int main() { if (f(-1) != -1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr34070-2.c ================================================ extern void abort (void); int f(unsigned int x, int n) { return ((int)x) / (1 << n); } int main() { if (f(-1, 1) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr34099-2.c ================================================ int test1 (int b, int c) { char x; if (b) return x / c; else return 1; } int test2 (int b, int c) { int x; if (b) return x * c; else return 1; } int test3 (int b, int c) { int x; if (b) return x % c; else return 1; } int test4 (int b, int c) { char x; if (b) return x == c; else return 1; } extern void abort (void); int main() { if (test1(1, 1000) != 0) abort (); if (test2(1, 0) != 0) abort (); if (test3(1, 1) != 0) abort (); if (test4(1, 1000) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr34099.c ================================================ int foo (int b, int c) { int x; if (b) return x & c; else return 1; } extern void abort (void); int main() { if (foo(1, 0) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr34130.c ================================================ extern void abort (void); int foo (int i) { return -2 * __builtin_abs(i - 2); } int main() { if (foo(1) != -2 || foo(3) != -2) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr34154.c ================================================ int foo( unsigned long long aLL ) { switch( aLL ) { case 1000000000000000000ULL ... 9999999999999999999ULL : return 19 ; default : return 20 ; }; }; extern void abort (void); int main() { unsigned long long aLL = 1000000000000000000ULL; if (foo (aLL) != 19) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr34176.c ================================================ typedef __SIZE_TYPE__ size_t; typedef unsigned int index_ty; typedef index_ty *index_list_ty; struct mult_index { index_ty index; unsigned int count; }; struct mult_index_list { struct mult_index *item; size_t nitems; size_t nitems_max; struct mult_index *item2; size_t nitems2_max; }; int __attribute__((noinline)) hash_find_entry (size_t *result) { *result = 2; return 0; } extern void abort (void); struct mult_index * __attribute__((noinline)) foo (size_t n) { static count = 0; if (count++ > 0) abort (); return 0; } int main (void) { size_t nitems = 0; for (;;) { size_t list; hash_find_entry (&list); { size_t len2 = list; struct mult_index *destptr; struct mult_index *dest; size_t new_max = nitems + len2; if (new_max != len2) break; dest = foo (new_max); destptr = dest; while (len2--) destptr++; nitems = destptr - dest; } } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr34415.c ================================================ const char *__attribute__((noinline)) foo (const char *p) { const char *end; int len = 1; for (;;) { int c = *p; c = (c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c); if (c == 'B') end = p; else if (c == 'A') { end = p; do p++; while (*p == '+'); } else break; p++; len++; } if (len > 2 && *p == ':') p = end; return p; } int main (void) { const char *input = "Bbb:"; return foo (input) != input + 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr34456.c ================================================ /* { dg-skip-if "requires qsort" { freestanding } { "*" } { "" } } */ #include int __attribute__ ((noinline)) debug (void) { return 1; } int errors; struct s { int elt; int (*compare) (int); }; static int compare (const void *x, const void *y) { const struct s *s1 = x, *s2 = y; int (*compare1) (int); int elt2; compare1 = s1->compare; elt2 = s2->elt; if (elt2 != 0 && debug () && compare1 (s1->elt) != 0) errors++; return compare1 (elt2); } int bad_compare (int x) { return -x; } struct s array[2] = { { 1, bad_compare }, { -1, bad_compare } }; int main (void) { qsort (array, 2, sizeof (struct s), compare); return errors == 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr34768-1.c ================================================ int x; void __attribute__((noinline)) foo (void) { x = -x; } void __attribute__((const,noinline)) bar (void) { } int __attribute__((noinline)) test (int c) { int tmp = x; (c ? foo : bar) (); return tmp + x; } extern void abort (void); int main() { x = 1; if (test (1) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr34768-2.c ================================================ int x; int __attribute__((noinline)) foo (void) { x = -x; return 0; } int __attribute__((const,noinline)) bar (void) { return 0; } int __attribute__((noinline)) test (int c) { int tmp = x; int res = (c ? foo : bar) (); return tmp + x + res; } extern void abort (void); int main() { x = 1; if (test (1) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr34971.c ================================================ struct foo { unsigned long long b:40; } x; extern void abort (void); void test1(unsigned long long res) { /* Build a rotate expression on a 40 bit argument. */ if ((x.b<<8) + (x.b>>32) != res) abort (); } int main() { x.b = 0x0100000001; test1(0x0000000101); x.b = 0x0100000000; test1(0x0000000001); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr34982.c ================================================ extern void abort (void); static void something(); int main() { something(-1); return 0; } static void something(int i) { if (i != -1) abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr35163.c ================================================ extern void abort(void); int main() { signed char a = -30; signed char b = -31; #if(__SIZEOF_INT__ >= 4) if (a > (unsigned short)b) #else if ((long) a > (unsigned short)b) #endif abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr35231.c ================================================ extern void abort(void); int __attribute__((noinline)) foo(int bits_per_pixel, int depth) { if ((bits_per_pixel | depth) == 1) abort (); return bits_per_pixel; } int main() { if (foo(2, 0) != 2) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr35390.c ================================================ extern void abort (void); unsigned int foo (int n) { return ~((unsigned int)~n); } int main() { if (foo(0) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr35456.c ================================================ /* { dg-skip-if "signed zero not supported" { "vax-*-*" } { "*" } { "" } } */ extern void abort (void); double __attribute__ ((noinline)) not_fabs (double x) { return x >= 0.0 ? x : -x; } int main() { double x = -0.0; double y; y = not_fabs (x); if (!__builtin_signbit (y)) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr35472.c ================================================ extern void abort (void); extern void *memset (void *s, int c, __SIZE_TYPE__ n); struct S { int i[16]; }; struct S *p; void __attribute__((noinline,noclone)) foo(struct S *a, struct S *b) { a->i[0] = -1; p = b; } void test (void) { struct S a, b; memset (&a.i[0], '\0', sizeof (a.i)); memset (&b.i[0], '\0', sizeof (b.i)); foo (&a, &b); *p = a; *p = b; if (b.i[0] != -1) abort (); } int main() { test(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr35800.c ================================================ extern void abort (void); int stab_xcoff_builtin_type (int typenum) { const char *name; if (typenum >= 0 || typenum < -34) { return 0; } switch (-typenum) { case 1: name = "int"; break; case 2: name = "char"; case 3: name = "short"; break; case 4: name = "long"; case 5: name = "unsigned char"; case 6: name = "signed char"; case 7: name = "unsigned short"; case 8: name = "unsigned int"; case 9: name = "unsigned"; case 10: name = "unsigned long"; case 11: name = "void"; case 12: name = "float"; case 13: name = "double"; case 14: name = "long double"; case 15: name = "integer"; case 16: name = "boolean"; case 17: name = "short real"; case 18: name = "real"; case 19: name = "stringptr"; case 20: name = "character"; case 21: name = "logical*1"; case 22: name = "logical*2"; case 23: name = "logical*4"; case 24: name = "logical"; case 25: name = "complex"; case 26: name = "double complex"; case 27: name = "integer*1"; case 28: name = "integer*2"; case 29: name = "integer*4"; case 30: name = "wchar"; case 31: name = "long long"; case 32: name = "unsigned long long"; case 33: name = "logical*8"; case 34: name = "integer*8"; } return name[0]; } int main() { int i; if (stab_xcoff_builtin_type(0) != 0) abort (); if (stab_xcoff_builtin_type(-1) != 'i') abort (); if (stab_xcoff_builtin_type(-2) != 's') abort (); if (stab_xcoff_builtin_type(-3) != 's') abort (); for (i = -4; i >= -34; --i) if (stab_xcoff_builtin_type(i) != 'i') abort (); if (stab_xcoff_builtin_type(-35) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr36034-1.c ================================================ double x[5][10] = { { 10, 11, 12, 13, 14, 15, -1, -1, -1, -1 }, { 21, 22, 23, 24, 25, 26, -1, -1, -1, -1 }, { 32, 33, 34, 35, 36, 37, -1, -1, -1, -1 }, { 43, 44, 45, 46, 47, 48, -1, -1, -1, -1 }, { 54, 55, 56, 57, 58, 59, -1, -1, -1, -1 } }; double tmp[5][6]; void __attribute__((noinline)) test (void) { int i, j; for (i = 0; i < 5; ++i) { tmp[i][0] = x[i][0]; tmp[i][1] = x[i][1]; tmp[i][2] = x[i][2]; tmp[i][3] = x[i][3]; tmp[i][4] = x[i][4]; tmp[i][5] = x[i][5]; } } extern void abort (void); int main() { int i, j; test(); for (i = 0; i < 5; ++i) for (j = 0; j < 6; ++j) if (tmp[i][j] == -1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr36034-2.c ================================================ double x[50] = { 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, 32, 33, 34, 35, 36, 37, -1, -1, -1, -1, 43, 44, 45, 46, 47, 48, -1, -1, -1, -1, 54, 55, 56, 57, 58, 59, -1, -1, -1, -1 }; double tmp[30]; void __attribute__((noinline)) test (void) { int i, j; for (i = 0; i < 5; ++i) { tmp[i*6] = x[i*10]; tmp[i*6+1] = x[i*10+1]; tmp[i*6+2] = x[i*10+2]; tmp[i*6+3] = x[i*10+3]; tmp[i*6+4] = x[i*10+4]; tmp[i*6+5] = x[i*10+5]; } } extern void abort (void); int main() { int i, j; test(); for (i = 0; i < 5; ++i) for (j = 0; j < 6; ++j) if (tmp[i*6+j] == -1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr36038.c ================================================ /* PR tree-optimization/36038 */ long long list[10]; long long expect[10] = { 0, 1, 2, 3, 4, 4, 5, 6, 7, 9 }; long long *stack_base; int indices[10]; int *markstack_ptr; void doit (void) { long long *src; long long *dst; long long *sp = stack_base + 5; int diff = 2; int shift; int count; shift = diff - (markstack_ptr[-1] - markstack_ptr[-2]); count = (sp - stack_base) - markstack_ptr[-1] + 2; src = sp; dst = (sp += shift); while (--count) *dst-- = *src--; } int main () { int i; for (i = 0; i < 10; i++) list[i] = i; markstack_ptr = indices + 9; markstack_ptr[-1] = 2; markstack_ptr[-2] = 1; stack_base = list + 2; doit (); if (__builtin_memcmp (expect, list, sizeof (list))) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr36077.c ================================================ extern void abort (void); unsigned int test (unsigned int x) { return x / 0x80000001U / 0x00000002U; } int main() { if (test(2) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr36093.c ================================================ extern void abort (void); typedef struct Bar { char c[129]; } Bar __attribute__((__aligned__(128))); typedef struct Foo { Bar bar[4]; } Foo; Foo foo[4]; int main() { int i, j; Foo *foop = &foo[0]; for (i=0; i < 4; i++) { Bar *bar = &foop->bar[i]; for (j=0; j < 129; j++) { bar->c[j] = 'a' + i; } } if (foo[0].bar[3].c[128] != 'd') abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr36321.c ================================================ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ extern void abort (void); extern __SIZE_TYPE__ strlen (const char *); void foo(char *str) { int len2 = strlen (str); char *a = (char *) __builtin_alloca (0); char *b = (char *) __builtin_alloca (len2*3); if ((int) (a-b) < (len2*3)) { #ifdef _WIN32 abort (); #endif return; } } static char * volatile argp = "pr36321.x"; int main(int argc, char **argv) { foo (argp); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr36339.c ================================================ extern void abort (void); typedef unsigned long my_uintptr_t; int check_a(my_uintptr_t tagged_ptr); int __attribute__((noinline)) try_a(my_uintptr_t x) { my_uintptr_t heap[2]; my_uintptr_t *hp = heap; hp[0] = x; hp[1] = 0; return check_a((my_uintptr_t)(void*)((char*)hp + 1)); } int __attribute__((noinline)) check_a(my_uintptr_t tagged_ptr) { my_uintptr_t *hp = (my_uintptr_t*)(void*)((char*)tagged_ptr - 1); if (hp[0] == 42 && hp[1] == 0) return 0; return -1; } int main(void) { if (try_a(42) < 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr36343.c ================================================ extern void abort (void); void __attribute__((noinline)) bar (int **p) { float *q = (float *)p; *q = 0.0; } float __attribute__((noinline)) foo (int b) { int *i = 0; float f = 1.0; int **p; if (b) p = &i; else p = (int **)&f; bar (p); if (b) return **p; return f; } int main() { if (foo(0) != 0.0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr36691.c ================================================ unsigned char g_5; void func_1 (void) { for (g_5 = 9; g_5 >= 4; g_5 -= 5) ; } extern void abort (void); int main (void) { func_1 (); if (g_5 != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr36765.c ================================================ int __attribute__((noinline)) foo(int i) { int *p = __builtin_malloc (4 * sizeof(int)); *p = 0; p[i] = 1; return *p; } extern void abort (void); int main() { if (foo(0) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr37102.c ================================================ extern void abort (void); unsigned int a, b = 1, c; void __attribute__ ((noinline)) foo (int x) { if (x != 5) abort (); } int main () { unsigned int d, e; for (d = 1; d < 5; d++) if (c) a = b; a = b; e = a << 1; if (e) e = (e << 1) ^ 1; foo (e); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr37125.c ================================================ extern void abort (void); static inline unsigned int mod_rhs(int rhs) { if (rhs == 0) return 1; return rhs; } void func_44 (unsigned int p_45); void func_44 (unsigned int p_45) { if (!((p_45 * -9) % mod_rhs (-9))) { abort(); } } int main (void) { func_44 (2); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr37573.c ================================================ /* PR tree-optimization/37573 */ /* { dg-require-effective-target int32plus } */ struct S { unsigned int *a; unsigned int b; unsigned int c[624]; }; static unsigned char __attribute__((noinline)) foo (struct S *s) { unsigned int r; if (!--s->b) { unsigned int *c = s->c; unsigned int i; s->a = c; for (i = 0; i < 227; i++) c[i] = ((((c[i] ^ c[i + 1]) & 0x7ffffffe) ^ c[i]) >> 1) ^ ((0 - (c[i + 1] & 1)) & 0x9908b0df) ^ c[i + 397]; } r = *(s->a++); r ^= (r >> 11); r ^= ((r & 0xff3a58ad) << 7); r ^= ((r & 0xffffdf8c) << 15); r ^= (r >> 18); return (unsigned char) (r >> 1); } static void __attribute__((noinline)) bar (unsigned char *p, unsigned int q, unsigned int r) { struct S s; unsigned int i; unsigned int *c = s.c; *c = r; for (i = 1; i < 624; i++) c[i] = i + 0x6c078965 * ((c[i - 1] >> 30) ^ c[i - 1]); s.b = 1; while (q--) *p++ ^= foo (&s); }; static unsigned char p[23] = { 0xc0, 0x49, 0x17, 0x32, 0x62, 0x1e, 0x2e, 0xd5, 0x4c, 0x19, 0x28, 0x49, 0x91, 0xe4, 0x72, 0x83, 0x91, 0x3d, 0x93, 0x83, 0xb3, 0x61, 0x38 }; static unsigned char q[23] = { 0x3e, 0x41, 0x55, 0x54, 0x4f, 0x49, 0x54, 0x20, 0x55, 0x4e, 0x49, 0x43, 0x4f, 0x44, 0x45, 0x20, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x3c }; int main (void) { unsigned int s; s = 23; bar (p, s, s + 0xa25e); if (__builtin_memcmp (p, q, s) != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr37882.c ================================================ /* PR middle-end/37882 */ struct S { unsigned char b : 3; } s; int main () { s.b = 4; if (s.b > 0 && s.b < 4) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr37924.c ================================================ /* PR c/37924 */ extern void abort (void); signed char a; unsigned char b; int test1 (void) { int c = -1; return ((unsigned int) (a ^ c)) >> 9; } int test2 (void) { int c = -1; return ((unsigned int) (b ^ c)) >> 9; } int main (void) { a = 0; if (test1 () != (-1U >> 9)) abort (); a = 0x40; if (test1 () != (-1U >> 9)) abort (); a = 0x80; if (test1 () != (a < 0) ? 0 : (-1U >> 9)) abort (); a = 0xff; if (test1 () != (a < 0) ? 0 : (-1U >> 9)) abort (); b = 0; if (test2 () != (-1U >> 9)) abort (); b = 0x40; if (test2 () != (-1U >> 9)) abort (); b = 0x80; if (test2 () != (-1U >> 9)) abort (); b = 0xff; if (test2 () != (-1U >> 9)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr37931.c ================================================ /* PR middle-end/37931 */ extern void abort (void); int foo (int a, unsigned int b) { return (a | 1) & (b | 1); } int main (void) { if (foo (6, 0xc6) != 7) abort (); if (foo (0x80, 0xc1) != 0x81) abort (); if (foo (4, 4) != 5) abort (); if (foo (5, 4) != 5) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr38048-1.c ================================================ extern void abort(void); int foo () { int mat[2][1]; int (*a)[1] = mat; int det = 0; int i; mat[0][0] = 1; mat[1][0] = 2; for (i = 0; i < 2; ++i) det += a[i][0]; return det; } int main() { if (foo () != 3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr38048-2.c ================================================ extern void abort (void); static int inv_J(int a[][2]) { int i, j; int det = 0.0; for (j=0; j<2; ++j) det += a[j][0] + a[j][1]; return det; } int foo() { int mat[2][2]; mat[0][0] = 1; mat[0][1] = 2; mat[1][0] = 4; mat[1][1] = 8; return inv_J(mat); } int main() { if (foo () != 15) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr38051.c ================================================ typedef __SIZE_TYPE__ size_t; static int mymemcmp1 (unsigned long int, unsigned long int) __attribute__ ((__nothrow__)); __inline static int mymemcmp1 (unsigned long int a, unsigned long int b) { long int srcp1 = (long int) &a; long int srcp2 = (long int) &b; unsigned long int a0, b0; do { a0 = ((unsigned char *) srcp1)[0]; b0 = ((unsigned char *) srcp2)[0]; srcp1 += 1; srcp2 += 1; } while (a0 == b0); return a0 - b0; } static int mymemcmp2 (long, long, size_t) __attribute__ ((__nothrow__)); static int mymemcmp2 (long int srcp1, long int srcp2, size_t len) { unsigned long int a0, a1; unsigned long int b0, b1; switch (len % 4) { default: case 2: a0 = ((unsigned long int *) srcp1)[0]; b0 = ((unsigned long int *) srcp2)[0]; srcp1 -= 2 * (sizeof (unsigned long int)); srcp2 -= 2 * (sizeof (unsigned long int)); len += 2; goto do1; case 3: a1 = ((unsigned long int *) srcp1)[0]; b1 = ((unsigned long int *) srcp2)[0]; srcp1 -= (sizeof (unsigned long int)); srcp2 -= (sizeof (unsigned long int)); len += 1; goto do2; case 0: if (16 <= 3 * (sizeof (unsigned long int)) && len == 0) return 0; a0 = ((unsigned long int *) srcp1)[0]; b0 = ((unsigned long int *) srcp2)[0]; goto do3; case 1: a1 = ((unsigned long int *) srcp1)[0]; b1 = ((unsigned long int *) srcp2)[0]; srcp1 += (sizeof (unsigned long int)); srcp2 += (sizeof (unsigned long int)); len -= 1; if (16 <= 3 * (sizeof (unsigned long int)) && len == 0) goto do0; } do { a0 = ((unsigned long int *) srcp1)[0]; b0 = ((unsigned long int *) srcp2)[0]; if (a1 != b1) return mymemcmp1 ((a1), (b1)); do3: a1 = ((unsigned long int *) srcp1)[1]; b1 = ((unsigned long int *) srcp2)[1]; if (a0 != b0) return mymemcmp1 ((a0), (b0)); do2: a0 = ((unsigned long int *) srcp1)[2]; b0 = ((unsigned long int *) srcp2)[2]; if (a1 != b1) return mymemcmp1 ((a1), (b1)); do1: a1 = ((unsigned long int *) srcp1)[3]; b1 = ((unsigned long int *) srcp2)[3]; if (a0 != b0) return mymemcmp1 ((a0), (b0)); srcp1 += 4 * (sizeof (unsigned long int)); srcp2 += 4 * (sizeof (unsigned long int)); len -= 4; } while (len != 0); do0: if (a1 != b1) return mymemcmp1 ((a1), (b1)); return 0; } static int mymemcmp3 (long, long, size_t) __attribute__ ((__nothrow__)); static int mymemcmp3 (long int srcp1, long int srcp2, size_t len) { unsigned long int a0, a1, a2, a3; unsigned long int b0, b1, b2, b3; unsigned long int x; int shl, shr; shl = 8 * (srcp1 % (sizeof (unsigned long int))); shr = 8 * (sizeof (unsigned long int)) - shl; srcp1 &= -(sizeof (unsigned long int)); switch (len % 4) { default: case 2: a1 = ((unsigned long int *) srcp1)[0]; a2 = ((unsigned long int *) srcp1)[1]; b2 = ((unsigned long int *) srcp2)[0]; srcp1 -= 1 * (sizeof (unsigned long int)); srcp2 -= 2 * (sizeof (unsigned long int)); len += 2; goto do1; case 3: a0 = ((unsigned long int *) srcp1)[0]; a1 = ((unsigned long int *) srcp1)[1]; b1 = ((unsigned long int *) srcp2)[0]; srcp2 -= 1 * (sizeof (unsigned long int)); len += 1; goto do2; case 0: if (16 <= 3 * (sizeof (unsigned long int)) && len == 0) return 0; a3 = ((unsigned long int *) srcp1)[0]; a0 = ((unsigned long int *) srcp1)[1]; b0 = ((unsigned long int *) srcp2)[0]; srcp1 += 1 * (sizeof (unsigned long int)); goto do3; case 1: a2 = ((unsigned long int *) srcp1)[0]; a3 = ((unsigned long int *) srcp1)[1]; b3 = ((unsigned long int *) srcp2)[0]; srcp1 += 2 * (sizeof (unsigned long int)); srcp2 += 1 * (sizeof (unsigned long int)); len -= 1; if (16 <= 3 * (sizeof (unsigned long int)) && len == 0) goto do0; } do { a0 = ((unsigned long int *) srcp1)[0]; b0 = ((unsigned long int *) srcp2)[0]; x = (((a2) >> (shl)) | ((a3) << (shr))); if (x != b3) return mymemcmp1 ((x), (b3)); do3: a1 = ((unsigned long int *) srcp1)[1]; b1 = ((unsigned long int *) srcp2)[1]; x = (((a3) >> (shl)) | ((a0) << (shr))); if (x != b0) return mymemcmp1 ((x), (b0)); do2: a2 = ((unsigned long int *) srcp1)[2]; b2 = ((unsigned long int *) srcp2)[2]; x = (((a0) >> (shl)) | ((a1) << (shr))); if (x != b1) return mymemcmp1 ((x), (b1)); do1: a3 = ((unsigned long int *) srcp1)[3]; b3 = ((unsigned long int *) srcp2)[3]; x = (((a1) >> (shl)) | ((a2) << (shr))); if (x != b2) return mymemcmp1 ((x), (b2)); srcp1 += 4 * (sizeof (unsigned long int)); srcp2 += 4 * (sizeof (unsigned long int)); len -= 4; } while (len != 0); do0: x = (((a2) >> (shl)) | ((a3) << (shr))); if (x != b3) return mymemcmp1 ((x), (b3)); return 0; } __attribute__ ((noinline)) int mymemcmp (const void *s1, const void *s2, size_t len) { unsigned long int a0; unsigned long int b0; long int srcp1 = (long int) s1; long int srcp2 = (long int) s2; if (srcp1 % (sizeof (unsigned long int)) == 0) return mymemcmp2 (srcp1, srcp2, len / (sizeof (unsigned long int))); else return mymemcmp3 (srcp1, srcp2, len / (sizeof (unsigned long int))); } char buf[256]; int main (void) { char *p; union { long int l; char c[sizeof (long int)]; } u; /* The test above assumes little endian and long being the same size as pointer. */ if (sizeof (long int) != sizeof (void *) || sizeof (long int) < 4) return 0; u.l = 0x12345678L; if (u.c[0] != 0x78 || u.c[1] != 0x56 || u.c[2] != 0x34 || u.c[3] != 0x12) return 0; p = buf + 16 - (((long int) buf) & 15); __builtin_memcpy (p + 9, "\x1\x37\x82\xa7\x55\x49\x9d\xbf\xf8\x44\xb6\x55\x17\x8e\xf9", 15); __builtin_memcpy (p + 128 + 24, "\x1\x37\x82\xa7\x55\x49\xd0\xf3\xb7\x2a\x6d\x23\x71\x49\x6a", 15); if (mymemcmp (p + 9, p + 128 + 24, 33) != -51) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr38151.c ================================================ /* { dg-options "-Wno-psabi" } */ void abort (void); struct S2848 { unsigned int a; _Complex int b; struct { } __attribute__ ((aligned)) c; }; struct S2848 s2848; int fails; void __attribute__((noinline)) check2848va (int z, ...) { struct S2848 arg; __builtin_va_list ap; __builtin_va_start (ap, z); arg = __builtin_va_arg (ap, struct S2848); if (s2848.a != arg.a) ++fails; if (s2848.b != arg.b) ++fails; __builtin_va_end (ap); } int main (void) { s2848.a = 4027477739U; s2848.b = (723419448 + -218144346 * __extension__ 1i); check2848va (1, s2848); if (fails) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr38212.c ================================================ int __attribute__((noinline)) foo (int *__restrict p, int i) { int *__restrict q; int *__restrict r; int v, w; q = p + 1; r = q - i; v = *r; *p = 1; w = *r; return v + w; } extern void abort (void); int main() { int i = 0; if (foo (&i, 1) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr38236.c ================================================ struct X { int i; }; int __attribute__((noinline)) foo (struct X *p, int *q, int a, int b) { struct X x, y; if (a) p = &x; if (b) q = &x.i; else q = &y.i; *q = 1; return p->i; } extern void abort (void); int main() { if (foo((void *)0, (void *)0, 1, 1) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr38422.c ================================================ /* PR middle-end/38422 */ extern void abort (void); struct S { int s : (sizeof (int) * __CHAR_BIT__ - 2); } s; void foo (void) { s.s *= 2; } int main () { s.s = 24; foo (); if (s.s != 48) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr38533.c ================================================ /* PR middle-end/38533 */ #define A asm volatile ("" : "=r" (f) : "0" (0)); e |= f; #define B A A A A A A A A A A A #define C B B B B B B B B B B B int foo (void) { int e = 0, f; C C B B B B B A A A A A A return e; } int main (void) { if (foo ()) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr38819.c ================================================ extern void exit (int); extern void abort (void); volatile int a = 1; volatile int b = 0; volatile int x = 2; volatile signed int r = 8; void __attribute__((noinline)) foo (void) { exit (0); } int main (void) { int si1 = a; int si2 = b; int i; for (i = 0; i < 100; ++i) { foo (); if (x == 8) i++; r += i + si1 % si2; } abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr38969.c ================================================ __complex__ float __attribute__ ((noinline)) foo (__complex__ float x) { return x; } __complex__ float __attribute__ ((noinline)) bar (__complex__ float x) { return foo (x); } int main() { __complex__ float a, b; __real__ a = 9; __imag__ a = 42; b = bar (a); if (a != b) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr39100.c ================================================ /* Bad PTA results (incorrect store handling) was causing us to delete *na = 0 store. */ typedef struct E { int p; struct E *n; } *EP; typedef struct C { EP x; short cn, cp; } *CP; __attribute__((noinline)) CP foo (CP h, EP x) { EP pl = 0, *pa = &pl; EP nl = 0, *na = &nl; EP n; while (x) { n = x->n; if ((x->p & 1) == 1) { h->cp++; *pa = x; pa = &((*pa)->n); } else { h->cn++; *na = x; na = &((*na)->n); } x = n; } *pa = nl; *na = 0; h->x = pl; return h; } int main (void) { struct C c = { 0, 0, 0 }; struct E e[2] = { { 0, &e[1] }, { 1, 0 } }; EP p; foo (&c, &e[0]); if (c.cn != 1 || c.cp != 1) __builtin_abort (); if (c.x != &e[1]) __builtin_abort (); if (e[1].n != &e[0]) __builtin_abort (); if (e[0].n) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr39120.c ================================================ struct X { int *p; } x; struct X __attribute__((noinline)) foo(int *p) { struct X x; x.p = p; return x; } void __attribute((noinline)) bar() { *x.p = 1; } extern void abort (void); int main() { int i = 0; x = foo(&i); bar(); if (i != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr39228.c ================================================ /* { dg-add-options ieee } */ /* { dg-skip-if "No Inf/NaN support" { spu-*-* } "*" "" } */ extern void abort (void); static inline int __attribute__((always_inline)) testf (float b) { float c = 1.01f * b; return __builtin_isinff (c); } static inline int __attribute__((always_inline)) test (double b) { double c = 1.01 * b; return __builtin_isinf (c); } static inline int __attribute__((always_inline)) testl (long double b) { long double c = 1.01L * b; return __builtin_isinfl (c); } int main() { if (testf (__FLT_MAX__) < 1) abort (); if (test (__DBL_MAX__) < 1) abort (); if (testl (__LDBL_MAX__) < 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr39233.c ================================================ extern void abort (void); __attribute__((noinline)) void foo (void *p) { long l = (long) p; if (l < 0 || l > 6) abort (); } int main () { short i; for (i = 6; i >= 0; i--) foo ((void *) (long) i); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr39240.c ================================================ /* PR target/39240 */ extern void abort (void); __attribute__ ((noinline)) static int foo1 (int x) { return x; } __attribute__ ((noinline)) unsigned int bar1 (int x) { return foo1 (x + 6); } volatile unsigned long l1 = (unsigned int) -4; __attribute__ ((noinline)) static short int foo2 (int x) { return x; } __attribute__ ((noinline)) unsigned short int bar2 (int x) { return foo2 (x + 6); } volatile unsigned long l2 = (unsigned short int) -4; __attribute__ ((noinline)) static signed char foo3 (int x) { return x; } __attribute__ ((noinline)) unsigned char bar3 (int x) { return foo3 (x + 6); } volatile unsigned long l3 = (unsigned char) -4; __attribute__ ((noinline)) static unsigned int foo4 (int x) { return x; } __attribute__ ((noinline)) int bar4 (int x) { return foo4 (x + 6); } volatile unsigned long l4 = (int) -4; __attribute__ ((noinline)) static unsigned short int foo5 (int x) { return x; } __attribute__ ((noinline)) short int bar5 (int x) { return foo5 (x + 6); } volatile unsigned long l5 = (short int) -4; __attribute__ ((noinline)) static unsigned char foo6 (int x) { return x; } __attribute__ ((noinline)) signed char bar6 (int x) { return foo6 (x + 6); } volatile unsigned long l6 = (signed char) -4; int main (void) { if (bar1 (-10) != l1) abort (); if (bar2 (-10) != l2) abort (); if (bar3 (-10) != l3) abort (); if (bar4 (-10) != l4) abort (); if (bar5 (-10) != l5) abort (); if (bar6 (-10) != l6) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr39339.c ================================================ struct C { unsigned int c; struct D { unsigned int columns : 4; unsigned int fore : 12; unsigned int back : 6; unsigned int fragment : 1; unsigned int standout : 1; unsigned int underline : 1; unsigned int strikethrough : 1; unsigned int reverse : 1; unsigned int blink : 1; unsigned int half : 1; unsigned int bold : 1; unsigned int invisible : 1; unsigned int pad : 1; } attr; }; struct A { struct C *data; unsigned int len; }; struct B { struct A *cells; unsigned char soft_wrapped : 1; }; struct E { long row, col; struct C defaults; }; __attribute__ ((noinline)) void foo (struct E *screen, unsigned int c, int columns, struct B *row) { struct D attr; long col; int i; col = screen->col; attr = screen->defaults.attr; attr.columns = columns; row->cells->data[col].c = c; row->cells->data[col].attr = attr; col++; attr.fragment = 1; for (i = 1; i < columns; i++) { row->cells->data[col].c = c; row->cells->data[col].attr = attr; col++; } } int main (void) { struct E e = {.row = 5,.col = 0,.defaults = {6, {-1, -1, -1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0}} }; struct C c[4]; struct A a = { c, 4 }; struct B b = { &a, 1 }; struct D d; __builtin_memset (&c, 0, sizeof c); foo (&e, 65, 2, &b); d = e.defaults.attr; d.columns = 2; if (__builtin_memcmp (&d, &c[0].attr, sizeof d)) __builtin_abort (); d.fragment = 1; if (__builtin_memcmp (&d, &c[1].attr, sizeof d)) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr39501.c ================================================ /* { dg-options "-ffast-math" } */ extern void abort (void); extern void exit (int); #define min1(a,b) ((a) < (b) ? (a) : (b)) #define max1(a,b) ((a) > (b) ? (a) : (b)) #define min2(a,b) ((a) <= (b) ? (a) : (b)) #define max2(a,b) ((a) >= (b) ? (a) : (b)) #define F(type,n) \ type __attribute__((noinline)) type##_##n(type a, type b) \ { \ return n(a, b); \ } F(float,min1) F(float,min2) F(float,max1) F(float,max2) F(double,min1) F(double,min2) F(double,max1) F(double,max2) int main() { if (float_min1(0.f, -1.f) != -1.f) abort(); if (float_min1(-1.f, 0.f) != -1.f) abort(); if (float_min1(0.f, 1.f) != 0.f) abort(); if (float_min1(1.f, 0.f) != 0.f) abort(); if (float_min1(-1.f, 1.f) != -1.f) abort(); if (float_min1(1.f, -1.f) != -1.f) abort(); if (float_max1(0.f, -1.f) != 0.f) abort(); if (float_max1(-1.f, 0.f) != 0.f) abort(); if (float_max1(0.f, 1.f) != 1.f) abort(); if (float_max1(1.f, 0.f) != 1.f) abort(); if (float_max1(-1.f, 1.f) != 1.f) abort(); if (float_max1(1.f, -1.f) != 1.f) abort(); if (float_min2(0.f, -1.f) != -1.f) abort(); if (float_min2(-1.f, 0.f) != -1.f) abort(); if (float_min2(0.f, 1.f) != 0.f) abort(); if (float_min2(1.f, 0.f) != 0.f) abort(); if (float_min2(-1.f, 1.f) != -1.f) abort(); if (float_min2(1.f, -1.f) != -1.f) abort(); if (float_max2(0.f, -1.f) != 0.f) abort(); if (float_max2(-1.f, 0.f) != 0.f) abort(); if (float_max2(0.f, 1.f) != 1.f) abort(); if (float_max2(1.f, 0.f) != 1.f) abort(); if (float_max2(-1.f, 1.f) != 1.f) abort(); if (float_max2(1.f, -1.f) != 1.f) abort(); if (double_min1(0., -1.) != -1.) abort(); if (double_min1(-1., 0.) != -1.) abort(); if (double_min1(0., 1.) != 0.) abort(); if (double_min1(1., 0.) != 0.) abort(); if (double_min1(-1., 1.) != -1.) abort(); if (double_min1(1., -1.) != -1.) abort(); if (double_max1(0., -1.) != 0.) abort(); if (double_max1(-1., 0.) != 0.) abort(); if (double_max1(0., 1.) != 1.) abort(); if (double_max1(1., 0.) != 1.) abort(); if (double_max1(-1., 1.) != 1.) abort(); if (double_max1(1., -1.) != 1.) abort(); if (double_min2(0., -1.) != -1.) abort(); if (double_min2(-1., 0.) != -1.) abort(); if (double_min2(0., 1.) != 0.) abort(); if (double_min2(1., 0.) != 0.) abort(); if (double_min2(-1., 1.) != -1.) abort(); if (double_min2(1., -1.) != -1.) abort(); if (double_max2(0., -1.) != 0.) abort(); if (double_max2(-1., 0.) != 0.) abort(); if (double_max2(0., 1.) != 1.) abort(); if (double_max2(1., 0.) != 1.) abort(); if (double_max2(-1., 1.) != 1.) abort(); if (double_max2(1., -1.) != 1.) abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr40022.c ================================================ extern void abort (void); struct A { struct A *a; }; struct B { struct A *b; }; __attribute__((noinline)) struct A * foo (struct A *x) { asm volatile ("" : : "g" (x) : "memory"); return x; } __attribute__((noinline)) void bar (struct B *w, struct A *x, struct A *y, struct A *z) { struct A **c; c = &w->b; *c = foo (x); while (*c) c = &(*c)->a; *c = foo (y); while (*c) c = &(*c)->a; *c = foo (z); } struct B d; struct A e, f, g; int main (void) { f.a = &g; bar (&d, &e, &f, 0); if (d.b == 0 || d.b->a == 0 || d.b->a->a == 0 || d.b->a->a->a != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr40057.c ================================================ /* PR middle-end/40057 */ extern void abort (void); __attribute__((noinline)) int foo (unsigned long long x) { unsigned long long y = (x >> 31ULL) & 1ULL; if (y == 0ULL) return 0; return -1; } __attribute__((noinline)) int bar (long long x) { long long y = (x >> 31LL) & 1LL; if (y == 0LL) return 0; return -1; } int main (void) { if (sizeof (long long) != 8) return 0; if (foo (0x1682a9aaaULL)) abort (); if (!foo (0x1882a9aaaULL)) abort (); if (bar (0x1682a9aaaLL)) abort (); if (!bar (0x1882a9aaaLL)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr40386.c ================================================ /* { dg-options "-fno-ira-share-spill-slots -Wno-shift-overflow" } */ extern void abort (void); extern void exit (int); #define CHAR_BIT 8 #define ROR(a,b) (((a) >> (b)) | ((a) << ((sizeof (a) * CHAR_BIT) - (b)))) #define ROL(a,b) (((a) << (b)) | ((a) >> ((sizeof (a) * CHAR_BIT) - (b)))) #define CHAR_VALUE ((char)0xf234) #define SHORT_VALUE ((short)0xf234) #define INT_VALUE ((int)0xf234) #define LONG_VALUE ((long)0xf2345678L) #define LL_VALUE ((long long)0xf2345678abcdef0LL) #define SHIFT1 4 #define SHIFT2 ((sizeof (long long) * CHAR_BIT) - SHIFT1) char c = CHAR_VALUE; short s = SHORT_VALUE; int i = INT_VALUE; long l = LONG_VALUE; long long ll = LL_VALUE; int shift1 = SHIFT1; int shift2 = SHIFT2; int main () { if (ROR (c, shift1) != ROR (CHAR_VALUE, SHIFT1)) abort (); if (ROR (c, SHIFT1) != ROR (CHAR_VALUE, SHIFT1)) abort (); if (ROR (s, shift1) != ROR (SHORT_VALUE, SHIFT1)) abort (); if (ROR (s, SHIFT1) != ROR (SHORT_VALUE, SHIFT1)) abort (); if (ROR (i, shift1) != ROR (INT_VALUE, SHIFT1)) abort (); if (ROR (i, SHIFT1) != ROR (INT_VALUE, SHIFT1)) abort (); if (ROR (l, shift1) != ROR (LONG_VALUE, SHIFT1)) abort (); if (ROR (l, SHIFT1) != ROR (LONG_VALUE, SHIFT1)) abort (); if (ROR (ll, shift1) != ROR (LL_VALUE, SHIFT1)) abort (); if (ROR (ll, SHIFT1) != ROR (LL_VALUE, SHIFT1)) abort (); if (ROR (ll, shift2) != ROR (LL_VALUE, SHIFT2)) abort (); if (ROR (ll, SHIFT2) != ROR (LL_VALUE, SHIFT2)) abort (); if (ROL (c, shift1) != ROL (CHAR_VALUE, SHIFT1)) abort (); if (ROL (c, SHIFT1) != ROL (CHAR_VALUE, SHIFT1)) abort (); if (ROL (s, shift1) != ROL (SHORT_VALUE, SHIFT1)) abort (); if (ROL (s, SHIFT1) != ROL (SHORT_VALUE, SHIFT1)) abort (); if (ROL (i, shift1) != ROL (INT_VALUE, SHIFT1)) abort (); if (ROL (i, SHIFT1) != ROL (INT_VALUE, SHIFT1)) abort (); if (ROL (l, shift1) != ROL (LONG_VALUE, SHIFT1)) abort (); if (ROL (l, SHIFT1) != ROL (LONG_VALUE, SHIFT1)) abort (); if (ROL (ll, shift1) != ROL (LL_VALUE, SHIFT1)) abort (); if (ROL (ll, SHIFT1) != ROL (LL_VALUE, SHIFT1)) abort (); if (ROL (ll, shift2) != ROL (LL_VALUE, SHIFT2)) abort (); if (ROL (ll, SHIFT2) != ROL (LL_VALUE, SHIFT2)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr40404.c ================================================ extern void abort (void); #if (__SIZEOF_INT__ <= 2) struct S { unsigned long ui17 : 17; } s; #else struct S { unsigned int ui17 : 17; } s; #endif int main() { s.ui17 = 0x1ffff; if (s.ui17 >= 0xfffffffeu) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr40493.c ================================================ extern void abort (void); typedef union i386_operand_type { struct { unsigned int reg8:1; unsigned int reg16:1; unsigned int reg32:1; unsigned int reg64:1; unsigned int floatreg:1; unsigned int regmmx:1; unsigned int regxmm:1; unsigned int regymm:1; unsigned int control:1; unsigned int debug:1; unsigned int test:1; unsigned int sreg2:1; unsigned int sreg3:1; unsigned int imm1:1; unsigned int imm8:1; unsigned int imm8s:1; unsigned int imm16:1; unsigned int imm32:1; unsigned int imm32s:1; unsigned int imm64:1; unsigned int disp8:1; unsigned int disp16:1; unsigned int disp32:1; unsigned int disp32s:1; unsigned int disp64:1; unsigned int acc:1; unsigned int floatacc:1; unsigned int baseindex:1; unsigned int inoutportreg:1; unsigned int shiftcount:1; unsigned int jumpabsolute:1; unsigned int esseg:1; unsigned int regmem:1; unsigned int mem:1; unsigned int byte:1; unsigned int word:1; unsigned int dword:1; unsigned int fword:1; unsigned int qword:1; unsigned int tbyte:1; unsigned int xmmword:1; unsigned int ymmword:1; unsigned int unspecified:1; unsigned int anysize:1; } bitfield; unsigned int array[2]; } i386_operand_type; unsigned int x00, x01, y00, y01; int main (int argc, char *argv[]) { i386_operand_type a,b,c,d; a.bitfield.reg16 = 1; a.bitfield.imm16 = 0; a.array[1] = 22; b = a; x00 = b.array[0]; x01 = b.array[1]; c = b; y00 = c.array[0]; y01 = c.array[1]; d = c; if (d.bitfield.reg16 != 1) abort(); if (d.bitfield.imm16 != 0) abort(); if (d.array[1] != 22) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr40579.c ================================================ extern void abort (void); static char * __attribute__((noinline)) itos(int num) { return (char *)0; } static void __attribute__((noinline)) foo(int i, const char *x) { if (i >= 4) abort (); } int main() { int x = -__INT_MAX__ + 3; int i; for (i = 0; i < 4; ++i) { char *p; --x; p = itos(x); foo(i, p); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr40657.c ================================================ /* Verify that that Thumb-1 epilogue size optimization does not clobber the return value. */ long long v = 0x123456789abc; __attribute__((noinline)) void bar (int *x) { asm volatile ("" : "=m" (x) ::); } __attribute__((noinline)) long long foo() { int x; bar(&x); return v; } int main () { if (foo () != v) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr40668.c ================================================ #if (__SIZEOF_INT__ == 2) #define TESTVALUE 0x1234 #else #define TESTVALUE 0x12345678 #endif static void foo (unsigned int x, void *p) { __builtin_memcpy (p, &x, sizeof x); } void bar (int type, void *number) { switch (type) { case 1: foo (TESTVALUE, number); break; case 7: foo (0, number); break; case 8: foo (0, number); break; case 9: foo (0, number); break; } } int main (void) { unsigned int x; bar (1, &x); if (x != TESTVALUE) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr40747.c ================================================ /* PR middle-end/40747 */ extern void abort (void); int foo (int i) { return (i < 4 && i >= 0) ? i : 4; } int main () { if (foo (-1) != 4) abort (); if (foo (0) != 0) abort (); if (foo (1) != 1) abort (); if (foo (2) != 2) abort (); if (foo (3) != 3) abort (); if (foo (4) != 4) abort (); if (foo (5) != 4) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr41239.c ================================================ /* PR rtl-optimization/41239 */ struct S { short nargs; unsigned long arg[2]; }; extern void abort (void); extern void exit (int); extern char fn1 (int, const char *, int, const char *, const char *); extern void fn2 (int, ...); extern int fn3 (int); extern int fn4 (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); unsigned long test (struct S *x) { signed int arg1 = x->arg[0]; long int arg2 = x->arg[1]; if (arg2 == 0) (fn1 (20, "foo", 924, __func__, ((void *) 0)) ? (fn2 (fn3 (0x2040082), fn4 ("division by zero"))) : (void) 0); return (long int) arg1 / arg2; } int main (void) { struct S s = { 2, { 5, 0 } }; test (&s); abort (); } __attribute__((noinline)) char fn1 (int x, const char *y, int z, const char *w, const char *v) { asm volatile ("" : : "r" (w), "r" (v) : "memory"); asm volatile ("" : "+r" (x) : "r" (y), "r" (z) : "memory"); return x; } __attribute__((noinline)) int fn3 (int x) { asm volatile ("" : "+r" (x) : : "memory"); return x; } __attribute__((noinline)) int fn4 (const char *x, ...) { asm volatile ("" : "+r" (x) : : "memory"); return *x; } __attribute__((noinline)) void fn2 (int x, ...) { asm volatile ("" : "+r" (x) : : "memory"); if (x) /* Could be a longjmp or throw too. */ exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr41317.c ================================================ extern void abort (void); struct A { int i; }; struct B { struct A a; int j; }; static void foo (struct B *p) { ((struct A *)p)->i = 1; } int main() { struct A a; a.i = 0; foo ((struct B *)&a); if (a.i != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr41395-1.c ================================================ struct VEC_char_base { unsigned num; unsigned alloc; short vec[1]; }; short __attribute__((noinline)) foo (struct VEC_char_base *p, int i) { short *q; p->vec[i] = 0; q = &p->vec[8]; *q = 1; return p->vec[i]; } extern void abort (void); extern void *malloc (__SIZE_TYPE__); int main() { struct VEC_char_base *p = malloc (sizeof (struct VEC_char_base) + 256); if (foo (p, 8) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr41395-2.c ================================================ struct VEC_char_base { unsigned num; unsigned alloc; union { short vec[1]; struct { int i; int j; int k; } a; } u; }; short __attribute__((noinline)) foo (struct VEC_char_base *p, int i) { short *q; p->u.vec[i] = 0; q = &p->u.vec[16]; *q = 1; return p->u.vec[i]; } extern void abort (void); extern void *malloc (__SIZE_TYPE__); int main() { struct VEC_char_base *p = malloc (sizeof (struct VEC_char_base) + 256); if (foo (p, 16) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr41463.c ================================================ #include union tree_node; struct tree_common { int a; long b; long c; void *p; int d; }; struct other_tree { struct tree_common common; int arr[14]; }; struct tree_vec { struct tree_common common; int length; union tree_node *a[1]; }; union tree_node { struct other_tree othr; struct tree_vec vec; }; union tree_node global; union tree_node * __attribute__((noinline)) foo (union tree_node *p, int i) { union tree_node **q; p->vec.a[i] = (union tree_node *) 0; q = &p->vec.a[1]; *q = &global; return p->vec.a[i]; } extern void abort (void); extern void *malloc (__SIZE_TYPE__); int main() { union tree_node *p = malloc (sizeof (union tree_node)); if (foo (p, 1) != &global) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr41750.c ================================================ /* PR 41750 - IPA-SRA used to pass hash->sgot by value rather than by reference. */ struct bfd_link_hash_table { int hash; }; struct foo_link_hash_table { struct bfd_link_hash_table root; int *dynobj; int *sgot; }; struct foo_link_info { struct foo_link_hash_table *hash; }; extern void abort (void); int __attribute__((noinline)) foo_create_got_section (int *abfd, struct foo_link_info *info) { info->hash->sgot = abfd; return 1; } static int * get_got (int *abfd, struct foo_link_info *info, struct foo_link_hash_table *hash) { int *got; int *dynobj; got = hash->sgot; if (!got) { dynobj = hash->dynobj; if (!dynobj) hash->dynobj = dynobj = abfd; if (!foo_create_got_section (dynobj, info)) return 0; got = hash->sgot; } return got; } int * __attribute__((noinline,noclone)) elf64_ia64_check_relocs (int *abfd, struct foo_link_info *info) { return get_got (abfd, info, info->hash); } struct foo_link_info link_info; struct foo_link_hash_table hash; int abfd; int main () { link_info.hash = &hash; if (elf64_ia64_check_relocs (&abfd, &link_info) != &abfd) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr41917.c ================================================ /* PR rtl-optimization/41917 */ extern void abort (void); unsigned int a = 1; int main (void) { unsigned int b, c, d; if (sizeof (int) != 4 || (int) 0xc7d24b5e > 0) return 0; c = 0xc7d24b5e; d = a | -2; b = (d == 0) ? c : (c % d); if (b != c) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr41919.c ================================================ extern void abort (void); #define assert(x) if(!(x)) abort() struct S1 { signed char f0; }; int g_23 = 0; static struct S1 foo (void) { int *l_100 = &g_23; int **l_110 = &l_100; struct S1 l_128 = { 1 }; assert (l_100 == &g_23); assert (l_100 == &g_23); assert (l_100 == &g_23); assert (l_100 == &g_23); assert (l_100 == &g_23); assert (l_100 == &g_23); assert (l_100 == &g_23); return l_128; } static signed char bar(signed char si1, signed char si2) { return (si1 <= 0) ? si1 : (si2 * 2); } int main (void) { struct S1 s = foo(); if (bar(0x99 ^ (s.f0 && 1), 1) != -104) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr41935.c ================================================ /* PR middle-end/41935 */ extern void abort (void); long int foo (int n, int i, int j) { typedef int T[n]; struct S { int a; T b[n]; }; return __builtin_offsetof (struct S, b[i][j]); } int main (void) { typedef int T[5]; struct S { int a; T b[5]; }; if (foo (5, 2, 3) != __builtin_offsetof (struct S, b) + (5 * 2 + 3) * sizeof (int)) abort (); if (foo (5, 5, 5) != __builtin_offsetof (struct S, b) + (5 * 5 + 5) * sizeof (int)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr42006.c ================================================ extern void abort (void); static unsigned int my_add(unsigned int si1, unsigned int si2) { return (si1 > (50-si2)) ? si1 : (si1 + si2); } static unsigned int my_shift(unsigned int left, unsigned int right) { return (right > 100) ? left : (left >> right); } static int func_4(unsigned int p_6) { int count = 0; for (p_6 = 1; p_6 < 3; p_6 = my_add(p_6, 1)) { if (count++ > 1) abort (); if (my_shift(p_6, p_6)) return 0; } return 0; } int main(void) { func_4(0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr42142.c ================================================ int __attribute__((noinline,noclone)) sort(int L) { int end[2] = { 10, 10, }, i=0, R; while (i<2) { R = end[i]; if (L max) max = i; } static int CallFunctionRec(int (*fun)(int depth), int depth) { if (!fun(depth)) { return 0; } if (depth < 10) { CallFunctionRec(fun, depth + 1); } return 1; } static int CallFunction(int (*fun)(int depth)) { return CallFunctionRec(fun, 1) && !fun(0); } static int callback(int depth) { storemax (depth); return depth != 0; } int main() { CallFunction(callback); if (max != 10) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr42248.c ================================================ typedef struct { _Complex double a; _Complex double b; } Scf10; Scf10 g1s; void check (Scf10 x, _Complex double y) { if (x.a != y) __builtin_abort (); } void init (Scf10 *p, _Complex double y) { p->a = y; } int main () { init (&g1s, (_Complex double)1); check (g1s, (_Complex double)1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr42269-2.c ================================================ /* Make sure that language + abi extensions in passing S interoperate. */ static long long __attribute__((noinline)) foo (unsigned short s) { return (short) s; } unsigned short s = 0xFFFF; int main (void) { return foo (s) + 1 != 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr42512.c ================================================ extern void abort (void); short g_3; int main (void) { int l_2; for (l_2 = -1; l_2 != 0; l_2 = (unsigned char)(l_2 - 1)) g_3 |= l_2; if (g_3 != -1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr42544.c ================================================ /* PR c/42544 */ extern void abort (void); int main () { signed short s = -1; if (sizeof (long long) == sizeof (unsigned int)) return 0; if ((unsigned int) s >= 0x100000000ULL) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr42570.c ================================================ typedef unsigned char uint8_t; uint8_t foo[1][0]; extern void abort (void); int main() { if (sizeof (foo) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr42614.c ================================================ extern void *malloc(__SIZE_TYPE__); extern void abort(void); extern void free(void *); typedef struct SEntry { unsigned char num; } TEntry; typedef struct STable { TEntry data[2]; } TTable; TTable *init () { return malloc(sizeof(TTable)); } void expect_func (int a, unsigned char *b) __attribute__ ((noinline)); static inline void inlined_wrong (TEntry *entry_p, int flag); void inlined_wrong (TEntry *entry_p, int flag) { unsigned char index; entry_p->num = 0; if (flag == 0) abort(); for (index = 0; index < 1; index++) entry_p->num++; if (!entry_p->num) { abort(); } } void expect_func (int a, unsigned char *b) { if (abs ((a == 0))) abort (); if (abs ((b == 0))) abort (); } int main () { unsigned char index = 0; TTable *table_p = init(); TEntry work; inlined_wrong (&(table_p->data[1]), 1); expect_func (1, &index); inlined_wrong (&work, 1); free (table_p); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr42691.c ================================================ extern void abort (void); union _D_rep { unsigned short rep[4]; double val; }; int add(double* key, double* table) { unsigned i = 0; double* deletedEntry = 0; while (1) { double* entry = table + i; if (*entry == *key) break; union _D_rep _D_inf = {{ 0, 0, 0, 0x7ff0 }}; if (*entry != _D_inf.val) abort (); union _D_rep _D_inf2 = {{ 0, 0, 0, 0x7ff0 }}; if (!_D_inf2.val) deletedEntry = entry; i++; } if (deletedEntry) *deletedEntry = 0.0; return 0; } int main () { union _D_rep infinit = {{ 0, 0, 0, 0x7ff0 }}; double table[2] = { infinit.val, 23 }; double key = 23; int ret = add (&key, table); return ret; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr42721.c ================================================ /* PR c/42721 */ extern void abort (void); static unsigned long long foo (unsigned long long x, unsigned long long y) { return x / y; } static int a, b; int main (void) { unsigned long long c = 1; b ^= c && (foo (a, -1ULL) != 1L); if (b != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr42833.c ================================================ typedef __INT_LEAST8_TYPE__ int8_t; typedef __UINT_LEAST32_TYPE__ uint32_t; typedef int ssize_t; typedef struct { int8_t v1; int8_t v2; int8_t v3; int8_t v4; } neon_s8; uint32_t helper_neon_rshl_s8 (uint32_t arg1, uint32_t arg2); uint32_t helper_neon_rshl_s8 (uint32_t arg1, uint32_t arg2) { uint32_t res; neon_s8 vsrc1; neon_s8 vsrc2; neon_s8 vdest; do { union { neon_s8 v; uint32_t i; } conv_u; conv_u.i = (arg1); vsrc1 = conv_u.v; } while (0); do { union { neon_s8 v; uint32_t i; } conv_u; conv_u.i = (arg2); vsrc2 = conv_u.v; } while (0); do { int8_t tmp; tmp = (int8_t) vsrc2.v1; if (tmp >= (ssize_t) sizeof (vsrc1.v1) * 8) { vdest.v1 = 0; } else if (tmp < -(ssize_t) sizeof (vsrc1.v1) * 8) { vdest.v1 = vsrc1.v1 >> (sizeof (vsrc1.v1) * 8 - 1); } else if (tmp == -(ssize_t) sizeof (vsrc1.v1) * 8) { vdest.v1 = vsrc1.v1 >> (tmp - 1); vdest.v1++; vdest.v1 >>= 1; } else if (tmp < 0) { vdest.v1 = (vsrc1.v1 + (1 << (-1 - tmp))) >> -tmp; } else { vdest.v1 = vsrc1.v1 << tmp; } } while (0); do { int8_t tmp; tmp = (int8_t) vsrc2.v2; if (tmp >= (ssize_t) sizeof (vsrc1.v2) * 8) { vdest.v2 = 0; } else if (tmp < -(ssize_t) sizeof (vsrc1.v2) * 8) { vdest.v2 = vsrc1.v2 >> (sizeof (vsrc1.v2) * 8 - 1); } else if (tmp == -(ssize_t) sizeof (vsrc1.v2) * 8) { vdest.v2 = vsrc1.v2 >> (tmp - 1); vdest.v2++; vdest.v2 >>= 1; } else if (tmp < 0) { vdest.v2 = (vsrc1.v2 + (1 << (-1 - tmp))) >> -tmp; } else { vdest.v2 = vsrc1.v2 << tmp; } } while (0); do { int8_t tmp; tmp = (int8_t) vsrc2.v3; if (tmp >= (ssize_t) sizeof (vsrc1.v3) * 8) { vdest.v3 = 0; } else if (tmp < -(ssize_t) sizeof (vsrc1.v3) * 8) { vdest.v3 = vsrc1.v3 >> (sizeof (vsrc1.v3) * 8 - 1); } else if (tmp == -(ssize_t) sizeof (vsrc1.v3) * 8) { vdest.v3 = vsrc1.v3 >> (tmp - 1); vdest.v3++; vdest.v3 >>= 1; } else if (tmp < 0) { vdest.v3 = (vsrc1.v3 + (1 << (-1 - tmp))) >> -tmp; } else { vdest.v3 = vsrc1.v3 << tmp; } } while (0); do { int8_t tmp; tmp = (int8_t) vsrc2.v4; if (tmp >= (ssize_t) sizeof (vsrc1.v4) * 8) { vdest.v4 = 0; } else if (tmp < -(ssize_t) sizeof (vsrc1.v4) * 8) { vdest.v4 = vsrc1.v4 >> (sizeof (vsrc1.v4) * 8 - 1); } else if (tmp == -(ssize_t) sizeof (vsrc1.v4) * 8) { vdest.v4 = vsrc1.v4 >> (tmp - 1); vdest.v4++; vdest.v4 >>= 1; } else if (tmp < 0) { vdest.v4 = (vsrc1.v4 + (1 << (-1 - tmp))) >> -tmp; } else { vdest.v4 = vsrc1.v4 << tmp; } } while (0);; do { union { neon_s8 v; uint32_t i; } conv_u; conv_u.v = (vdest); res = conv_u.i; } while (0); return res; } extern void abort(void); int main() { uint32_t r = helper_neon_rshl_s8 (0x05050505, 0x01010101); if (r != 0x0a0a0a0a) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr43008.c ================================================ int i; struct X { int *p; }; struct X * __attribute__((malloc)) my_alloc (void) { struct X *p = __builtin_malloc (sizeof (struct X)); p->p = &i; return p; } extern void abort (void); int main() { struct X *p, *q; p = my_alloc (); q = my_alloc (); *(p->p) = 1; *(q->p) = 0; if (*(p->p) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr43220.c ================================================ /* { dg-require-effective-target int32plus } */ /* { dg-require-effective-target alloca } */ void *volatile p; int main (void) { int n = 0; lab:; { int x[n % 1000 + 1]; x[0] = 1; x[n % 1000] = 2; p = x; n++; } { int x[n % 1000 + 1]; x[0] = 1; x[n % 1000] = 2; p = x; n++; } if (n < 1000000) goto lab; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr43236.c ================================================ /* { dg-options "-ftree-loop-distribution" } */ extern void abort(void); extern void *memset(void *s, int c, __SIZE_TYPE__ n); extern int memcmp(const void *s1, const void *s2, __SIZE_TYPE__ n); /*extern int printf(const char *format, ...);*/ int main() { char A[30], B[30], C[30]; int i; /* prepare arrays */ memset(A, 1, 30); memset(B, 1, 30); for (i = 20; i-- > 10;) { A[i] = 0; B[i] = 0; } /* expected result */ memset(C, 1, 30); memset(C + 10, 0, 10); /* show result */ /* for (i = 0; i < 30; i++) printf("%d %d %d\n", A[i], B[i], C[i]); */ /* compare results */ if (memcmp(A, C, 30) || memcmp(B, C, 30)) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr43269.c ================================================ int g_21; int g_211; int g_261; static void __attribute__((noinline,noclone)) func_32 (int b) { if (b) { lbl_370: g_21 = 1; } for (g_261 = -1; g_261 > -2; g_261--) { if (g_211 + 1) { return; } else { g_21 = 1; goto lbl_370; } } } extern void abort (void); int main(void) { func_32(0); if (g_261 != -1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr43385.c ================================================ /* PR c/43385 */ extern void abort (void); int e; __attribute__((noinline)) void foo (int x, int y) { if (__builtin_expect (x, 0) && y != 0) e++; } __attribute__((noinline)) int bar (int x, int y) { if (__builtin_expect (x, 0) && y != 0) return 1; else return 0; } int main (void) { int z = 0; asm ("" : "+r" (z)); foo (z + 2, z + 1); if (e != 1) abort (); foo (z + 2, z); if (e != 1) abort (); foo (z + 1, z + 1); if (e != 2) abort (); foo (z + 1, z); if (e != 2) abort (); foo (z, z + 1); if (e != 2) abort (); foo (z, z); if (e != 2) abort (); if (bar (z + 2, z + 1) != 1) abort (); if (bar (z + 2, z) != 0) abort (); if (bar (z + 1, z + 1) != 1) abort (); if (bar (z + 1, z) != 0) abort (); if (bar (z, z + 1) != 0) abort (); if (bar (z, z) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr43438.c ================================================ extern void abort (void); static unsigned char g_2 = 1; static int g_9; static int *l_8 = &g_9; static void func_12(int p_13) { int * l_17 = &g_9; *l_17 &= 0 < p_13; } int main(void) { unsigned char l_11 = 254; *l_8 |= g_2; l_11 |= *l_8; func_12(l_11); if (g_9 != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr43560.c ================================================ /* PR tree-optimization/43560 */ struct S { int a, b; char c[10]; }; __attribute__ ((noinline)) void test (struct S *x) { while (x->b > 1 && x->c[x->b - 1] == '/') { x->b--; x->c[x->b] = '\0'; } } const struct S s = { 0, 0, "" }; int main () { struct S *p; asm ("" : "=r" (p) : "0" (&s)); test (p); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr43629.c ================================================ int flag; extern void abort (void); int main() { int x; if (flag) x = -1; else x &= 0xff; if (x & ~0xff) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr43783.c ================================================ typedef __attribute__((aligned(16))) struct { unsigned long long w[3]; } UINT192; UINT192 bid_Kx192[32]; extern void abort (void); int main() { int i = 0; unsigned long x = 0; for (i = 0; i < 32; ++i) bid_Kx192[i].w[1] = i == 1; for (i = 0; i < 32; ++i) x += bid_Kx192[1].w[1]; if (x != 32) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr43784.c ================================================ struct s { unsigned char a[256]; }; union u { struct { struct s b; int c; } d; struct { int c; struct s b; } e; }; static union u v; static struct s *p = &v.d.b; static struct s *q = &v.e.b; static struct s __attribute__((noinline)) rp(void) { return *p; } static void qp(void) { *q = rp(); } int main() { int i; for (i = 0; i < 256; i++) p->a[i] = i; qp(); for (i = 0; i < 256; i++) if (q->a[i] != i) __builtin_abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr43835.c ================================================ struct PMC { unsigned flags; }; typedef struct Pcc_cell { struct PMC *p; long bla; long type; } Pcc_cell; extern void abort (); extern void Parrot_gc_mark_PMC_alive_fun(int * interp, struct PMC *pmc) __attribute__((noinline)); void Parrot_gc_mark_PMC_alive_fun (int * interp, struct PMC *pmc) { abort (); } static void mark_cell(int * interp, Pcc_cell *c) __attribute__((__nonnull__(1))) __attribute__((__nonnull__(2))) __attribute__((noinline)); static void mark_cell(int * interp, Pcc_cell *c) { if (c->type == 4 && c->p && !(c->p->flags & (1<<18))) Parrot_gc_mark_PMC_alive_fun(interp, c->p); } void foo(int * interp, Pcc_cell *c); void foo(int * interp, Pcc_cell *c) { mark_cell(interp, c); } int main() { int i; Pcc_cell c; c.p = 0; c.bla = 42; c.type = 4; foo (&i, &c); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr43987.c ================================================ char B[256 * sizeof(void *)]; typedef void *FILE; typedef struct globals { int c; FILE *l; } __attribute__((may_alias)) T; void add_input_file(FILE *file) { (*(T*)&B).l[0] = file; } extern void abort (void); int main() { FILE x; (*(T*)&B).l = &x; add_input_file ((void *)-1); if ((*(T*)&B).l[0] != (void *)-1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr44164.c ================================================ struct X { struct Y { struct YY { struct Z { int i; } c; } bb; } b; } a; int __attribute__((noinline, noclone)) foo (struct Z *p) { int i = p->i; a.b = (struct Y){}; return p->i + i; } extern void abort (void); int main() { a.b.bb.c.i = 1; if (foo (&a.b.bb.c) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr44202-1.c ================================================ extern __attribute__ ((__noreturn__)) void exit(int); extern __attribute__ ((__noreturn__)) void abort(void); __attribute__ ((__noinline__)) int add512(int a, int *b) { int c = a + 512; if (c != 0) *b = a; return c; } __attribute__ ((__noinline__)) int add513(int a, int *b) { int c = a + 513; if (c == 0) *b = a; return c; } int main(void) { int b0 = -1; int b1 = -1; if (add512(-512, &b0) != 0 || b0 != -1 || add513(-513, &b1) != 0 || b1 != -513) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr44468.c ================================================ #include struct S { int i; int j; }; struct R { int k; struct S a; }; struct Q { float k; struct S a; }; struct Q s; int __attribute__((noinline,noclone)) test1 (void *q) { struct S *b = (struct S *)((char *)q + sizeof (int)); s.a.i = 0; b->i = 3; return s.a.i; } int __attribute__((noinline,noclone)) test2 (void *q) { struct S *b = &((struct R *)q)->a; s.a.i = 0; b->i = 3; return s.a.i; } int __attribute__((noinline,noclone)) test3 (void *q) { s.a.i = 0; ((struct S *)((char *)q + sizeof (int)))->i = 3; return s.a.i; } extern void abort (void); int main() { if (sizeof (float) != sizeof (int) || offsetof (struct R, a) != sizeof (int) || offsetof (struct Q, a) != sizeof (int)) return 0; s.a.i = 1; s.a.j = 2; if (test1 ((void *)&s) != 3) abort (); s.a.i = 1; s.a.j = 2; if (test2 ((void *)&s) != 3) abort (); s.a.i = 1; s.a.j = 2; if (test3 ((void *)&s) != 3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr44555.c ================================================ struct a { char b[100]; }; int foo(struct a *a) { if (&a->b) return 1; return 0; } extern void abort (void); int main() { if (foo((struct a *)0) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr44575.c ================================================ /* PR target/44575 */ #include int fails = 0; struct S { float a[3]; }; struct S a[5]; void check (int z, ...) { struct S arg, *p; va_list ap; int j = 0, k = 0; int i; va_start (ap, z); for (i = 2; i < 4; ++i) { p = 0; j++; k += 2; switch ((z << 4) | i) { case 0x12: case 0x13: p = &a[2]; arg = va_arg (ap, struct S); break; default: ++fails; break; } if (p && p->a[2] != arg.a[2]) ++fails; if (fails) break; } va_end (ap); } int main () { a[2].a[2] = -49026; check (1, a[2], a[2]); if (fails) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr44683.c ================================================ int __attribute__((noinline,noclone)) copysign_bug (double x) { if (x != 0.0 && (x * 0.5 == x)) return 1; if (__builtin_copysign(1.0, x) < 0.0) return 2; else return 3; } int main(void) { double x = -0.0; if (copysign_bug (x) != 2) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr44828.c ================================================ extern void abort (void); static signed char foo (signed char si1, signed char si2) { return si1 * si2; } int a = 0x105F61CA; int main (void) { int b = 0x0332F5C8; if (foo (b, a) > 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr44852.c ================================================ __attribute__ ((__noinline__)) char *sf(char *s, char *s0) { asm (""); while (*--s == '9') if (s == s0) { *s = '0'; break; } ++*s++; return s; } int main() { char s[] = "999999"; char *x = sf (s+2, s); if (x != s+1 || __builtin_strcmp (s, "199999") != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr44858.c ================================================ /* PR rtl-optimization/44858 */ extern void abort (void); int a = 3; int b = 1; __attribute__((noinline)) long long foo (int x, int y) { return x / y; } __attribute__((noinline)) int bar (void) { int c = 2; c &= foo (1, b) > b; b = (a != 0) | c; return c; } int main (void) { if (bar () != 0 || b != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr44942.c ================================================ /* PR target/44942 */ #include void test1 (int a, int b, int c, int d, int e, int f, int g, long double h, ...) { int i; va_list ap; va_start (ap, h); i = va_arg (ap, int); if (i != 1234) __builtin_abort (); va_end (ap); } void test2 (int a, int b, int c, int d, int e, int f, int g, long double h, int i, long double j, int k, long double l, int m, long double n, ...) { int o; va_list ap; va_start (ap, n); o = va_arg (ap, int); if (o != 1234) __builtin_abort (); va_end (ap); } void test3 (double a, double b, double c, double d, double e, double f, double g, long double h, ...) { double i; va_list ap; va_start (ap, h); i = va_arg (ap, double); if (i != 1234.0) __builtin_abort (); va_end (ap); } void test4 (double a, double b, double c, double d, double e, double f, double g, long double h, double i, long double j, double k, long double l, double m, long double n, ...) { double o; va_list ap; va_start (ap, n); o = va_arg (ap, double); if (o != 1234.0) __builtin_abort (); va_end (ap); } int main () { test1 (0, 0, 0, 0, 0, 0, 0, 0.0L, 1234); test2 (0, 0, 0, 0, 0, 0, 0, 0.0L, 0, 0.0L, 0, 0.0L, 0, 0.0L, 1234); test3 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0L, 1234.0); test4 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0L, 0.0, 0.0L, 0.0, 0.0L, 0.0, 0.0L, 1234.0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr45034.c ================================================ extern void abort (void); static void fixnum_neg(signed char x, signed char *py, int *pv) { unsigned char ux, uy; ux = (unsigned char)x; uy = -ux; *py = (uy <= 127) ? (signed char)uy : (-(signed char)(255 - uy) - 1); *pv = (x == -128) ? 1 : 0; } void __attribute__((noinline)) foo(int x, int y, int v) { if (y < -128 || y > 127) abort(); } int test_neg(void) { signed char x, y; int v, err; err = 0; x = -128; for (;;) { fixnum_neg(x, &y, &v); foo((int)x, (int)y, v); if ((v && x != -128) || (!v && x == -128)) ++err; if (x == 127) break; ++x; } return err; } int main(void) { if (sizeof (char) != 1) return 0; if (test_neg() != 0) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr45070.c ================================================ /* PR45070 */ extern void abort(void); struct packed_ushort { unsigned short ucs; } __attribute__((packed)); struct source { int pos, length; int flag; }; static void __attribute__((noinline)) fetch(struct source *p) { p->length = 128; } static struct packed_ushort __attribute__((noinline)) next(struct source *p) { struct packed_ushort rv; if (p->pos >= p->length) { if (p->flag) { p->flag = 0; fetch(p); return next(p); } p->flag = 1; rv.ucs = 0xffff; return rv; } rv.ucs = 0; return rv; } int main(void) { struct source s; int i; s.pos = 0; s.length = 0; s.flag = 0; for (i = 0; i < 16; i++) { struct packed_ushort rv = next(&s); if ((i == 0 && rv.ucs != 0xffff) || (i > 0 && rv.ucs != 0)) abort(); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr45262.c ================================================ /* PR middle-end/45262 */ /* { dg-require-effective-target int32plus } */ extern void abort (void); int foo (unsigned int x) { return ((int) x < 0) || ((int) (-x) < 0); } int bar (unsigned int x) { return x >> 31 || (-x) >> 31; } int main (void) { if (foo (1) != 1) abort (); if (foo (0) != 0) abort (); if (foo (-1) != 1) abort (); if (bar (1) != 1) abort (); if (bar (0) != 0) abort (); if (bar (-1) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr45695.c ================================================ /* PR rtl-optimization/45695 */ extern void abort (void); __attribute__((noinline)) void g (int x) { asm volatile ("" : "+r" (x)); } __attribute__((noinline)) int f (int a, int b, int d) { int r = -1; b += d; if (d == a) r = b - d; g (b); return r; } int main (void) { int l; asm ("" : "=r" (l) : "0" (0)); if (f (l + 0, l + 1, l + 4) != -1) abort (); if (f (l + 4, l + 1, l + 4) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr46019.c ================================================ /* PR middle-end/46019 */ extern void abort (void); int main (void) { unsigned long long l = 0x40000000000ULL; int n; for (n = 0; n < 8; n++) if (l / (0x200000000ULL << n) != (0x200 >> n)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr46309.c ================================================ /* PR tree-optimization/46309 */ extern void abort (void); unsigned int *q; __attribute__((noinline, noclone)) void bar (unsigned int *p) { if (*p != 2 && *p != 3) (!(!(*q & 263) || *p != 1)) ? abort () : 0; } int main () { unsigned int x, y; asm volatile ("" : : : "memory"); x = 2; bar (&x); x = 3; bar (&x); y = 1; x = 0; q = &y; bar (&x); y = 0; x = 1; bar (&x); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr46316.c ================================================ extern void abort (void); long long __attribute__((noinline,noclone)) foo (long long t) { while (t > -4) t -= 2; return t; } int main(void) { if (foo (0) != -4) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr46909-1.c ================================================ /* PR tree-optimization/46909 */ extern void abort (); int __attribute__ ((__noinline__)) foo (unsigned int x) { if (! (x == 4 || x == 6) || (x == 2 || x == 6)) return 1; return -1; } int main () { int i; for (i = -10; i < 10; i++) if (foo (i) != 1 - 2 * (i == 4)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr46909-2.c ================================================ /* PR tree-optimization/46909 */ extern void abort (void); int __attribute__((noinline)) foo (int x) { if ((x != 0 && x != 13) || x == 5 || x == 20) return 1; return -1; } int main (void) { int i; for (i = -10; i < 30; i++) if (foo (i) != 1 - 2 * (i == 0) - 2 * (i == 13)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr47148.c ================================================ /* PR tree-optimization/47148 */ static inline unsigned bar (unsigned x, unsigned y) { if (y >= 32) return x; else return x >> y; } static unsigned a = 1, b = 1; static inline void foo (unsigned char x, unsigned y) { if (!y) return; unsigned c = (0x7000U / (x - 2)) ^ a; unsigned d = bar (a, a); b &= ((a - d) && (a - 1)) + c; } int main (void) { foo (1, 1); foo (-1, 1); if (b && ((unsigned char) -1) == 255) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr47155.c ================================================ /* PR tree-optimization/47155 */ unsigned int a; static signed char b = -127; int c = 1; int main (void) { a = b <= (unsigned char) (-6 * c); if (!a) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr47237.c ================================================ /* { dg-xfail-if "can cause stack underflow" { nios2-*-* } "*" "" } */ /* { dg-require-effective-target untyped_assembly } */ #define INTEGER_ARG 5 extern void abort(void); static void foo(int arg) { if (arg != INTEGER_ARG) abort(); } static void bar(int arg) { foo(arg); __builtin_apply(foo, __builtin_apply_args(), 16); } int main(void) { bar(INTEGER_ARG); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr47299.c ================================================ /* PR rtl-optimization/47299 */ extern void abort (void); __attribute__ ((noinline, noclone)) unsigned short foo (unsigned char x) { return x * 255; } int main () { if (foo (0x40) != 0x3fc0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr47337.c ================================================ /* PR rtl-optimization/47337 */ static unsigned int a[256], b = 0; static char c = 0; static int d = 0, *f = &d; static long long e = 0; static short foo (long long x, long long y) { return x / y; } static char bar (char x, char y) { return x - y; } static int baz (int x, int y) { *f = (y != (short) (y * 3)); for (c = 0; c < 2; c++) { lab: if (d) { if (e) e = 1; else return x; } else { d = 1; goto lab; } f = &d; } return x; } static void fnx (unsigned long long x, int y) { if (!y) { b = a[b & 1]; b = a[b & 1]; b = a[(b ^ (x & 1)) & 1]; b = a[(b ^ (x & 1)) & 1]; } } char *volatile w = "2"; int main () { int h = 0; unsigned int k = 0; int l[8]; int i, j; if (__builtin_strcmp (w, "1") == 0) h = 1; for (i = 0; i < 256; i++) { for (j = 8; j > 0; j--) k = 1; a[i] = k; } for (i = 0; i < 8; i++) l[i] = 0; d = bar (c, c); d = baz (c, 1 | foo (l[0], 10)); fnx (d, h); fnx (e, h); if (d != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr47538.c ================================================ /* PR tree-optimization/47538 */ struct S { double a, b, *c; unsigned long d; }; __attribute__((noinline, noclone)) void foo (struct S *x, const struct S *y) { const unsigned long n = y->d + 1; const double m = 0.25 * (y->b - y->a); x->a = y->a; x->b = y->b; if (n == 1) { x->c[0] = 0.; } else if (n == 2) { x->c[1] = m * y->c[0]; x->c[0] = 2.0 * x->c[1]; } else { double o = 0.0, p = 1.0; unsigned long i; for (i = 1; i <= n - 2; i++) { x->c[i] = m * (y->c[i - 1] - y->c[i + 1]) / (double) i; o += p * x->c[i]; p = -p; } x->c[n - 1] = m * y->c[n - 2] / (n - 1.0); o += p * x->c[n - 1]; x->c[0] = 2.0 * o; } } int main (void) { struct S x, y; double c[4] = { 10, 20, 30, 40 }, d[4], e[4] = { 118, 118, 118, 118 }; y.a = 10; y.b = 6; y.c = c; x.c = d; y.d = 3; __builtin_memcpy (d, e, sizeof d); foo (&x, &y); if (d[0] != 0 || d[1] != 20 || d[2] != 10 || d[3] != -10) __builtin_abort (); y.d = 2; __builtin_memcpy (d, e, sizeof d); foo (&x, &y); if (d[0] != 60 || d[1] != 20 || d[2] != -10 || d[3] != 118) __builtin_abort (); y.d = 1; __builtin_memcpy (d, e, sizeof d); foo (&x, &y); if (d[0] != -20 || d[1] != -10 || d[2] != 118 || d[3] != 118) __builtin_abort (); y.d = 0; __builtin_memcpy (d, e, sizeof d); foo (&x, &y); if (d[0] != 0 || d[1] != 118 || d[2] != 118 || d[3] != 118) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr47925.c ================================================ struct s { volatile struct s *next; }; void __attribute__((noinline)) bar (int ignored, int n) { asm volatile (""); } int __attribute__((noinline)) foo (volatile struct s *ptr, int n) { int i; bar (0, n); for (i = 0; i < n; i++) ptr = ptr->next; } int main (void) { volatile struct s rec = { &rec }; foo (&rec, 10); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr48197.c ================================================ /* PR c/48197 */ extern void abort (void); static int y = 0x8000; int main () { unsigned int x = (short)y; if (sizeof (0LL) == sizeof (0U)) return 0; if (0LL > (0U ^ (short)-0x8000)) abort (); if (0LL > (0U ^ x)) abort (); if (0LL > (0U ^ (short)y)) abort (); if ((0U ^ (short)-0x8000) < 0LL) abort (); if ((0U ^ x) < 0LL) abort (); if ((0U ^ (short)y) < 0LL) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr48571-1.c ================================================ #define S (sizeof (int)) unsigned int c[624]; void __attribute__((noinline)) bar (void) { unsigned int i; /* Obfuscated c[i] = c[i-1] * 2. */ for (i = 1; i < 624; ++i) *(unsigned int *)((void *)c + (__SIZE_TYPE__)i * S) = 2 * *(unsigned int *)((void *)c + ((__SIZE_TYPE__)i + ((__SIZE_TYPE__)-S)/S) * S); } extern void abort (void); int main() { unsigned int i, j; for (i = 0; i < 624; ++i) c[i] = 1; bar(); j = 1; for (i = 0; i < 624; ++i) { if (c[i] != j) abort (); j = j * 2; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr48717.c ================================================ /* PR tree-optimization/48717 */ extern void abort (void); int v = 1, w; unsigned short foo (unsigned short x, unsigned short y) { return x + y; } void bar (void) { v = foo (~w, w); } int main () { bar (); if (v != (unsigned short) -1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr48809.c ================================================ /* PR tree-optimization/48809 */ extern void abort (void); int foo (signed char x) { int y = 0; switch (x) { case 0: y = 1; break; case 1: y = 7; break; case 2: y = 2; break; case 3: y = 19; break; case 4: y = 5; break; case 5: y = 17; break; case 6: y = 31; break; case 7: y = 8; break; case 8: y = 28; break; case 9: y = 16; break; case 10: y = 31; break; case 11: y = 12; break; case 12: y = 15; break; case 13: y = 111; break; case 14: y = 17; break; case 15: y = 10; break; case 16: y = 31; break; case 17: y = 7; break; case 18: y = 2; break; case 19: y = 19; break; case 20: y = 5; break; case 21: y = 107; break; case 22: y = 31; break; case 23: y = 8; break; case 24: y = 28; break; case 25: y = 106; break; case 26: y = 31; break; case 27: y = 102; break; case 28: y = 105; break; case 29: y = 111; break; case 30: y = 17; break; case 31: y = 10; break; case 32: y = 31; break; case 98: y = 18; break; case -62: y = 19; break; } return y; } int main () { if (foo (98) != 18 || foo (97) != 0 || foo (99) != 0) abort (); if (foo (-62) != 19 || foo (-63) != 0 || foo (-61) != 0) abort (); if (foo (28) != 105 || foo (27) != 102 || foo (29) != 111) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr48814-1.c ================================================ extern void abort (void); int arr[] = {1,2,3,4}; int count = 0; int __attribute__((noinline)) incr (void) { return ++count; } int main() { arr[count++] = incr (); if (count != 2 || arr[count] != 3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr48814-2.c ================================================ extern void abort (void); int arr[] = {1,2,3,4}; int count = 0; int incr (void) { return ++count; } int main() { arr[count++] = incr (); if (count != 2 || arr[count] != 3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr48973-1.c ================================================ /* PR middle-end/48973 */ extern void abort (void); struct S { int f : 1; } s; int v = -1; void foo (unsigned int x) { if (x != -1U) abort (); } int main () { s.f = (v & 1) > 0; foo (s.f); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr48973-2.c ================================================ /* PR middle-end/48973 */ extern void abort (void); struct S { int f : 1; } s; int v = -1; int main () { s.f = v < 0; if ((unsigned int) s.f != -1U) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49039.c ================================================ /* PR tree-optimization/49039 */ extern void abort (void); int cnt; __attribute__((noinline, noclone)) void foo (unsigned int x, unsigned int y) { unsigned int minv, maxv; if (x == 1 || y == -2U) return; minv = x < y ? x : y; maxv = x > y ? x : y; if (minv == 1) ++cnt; if (maxv == -2U) ++cnt; } int main () { foo (-2U, 1); if (cnt != 2) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49073.c ================================================ /* PR tree-optimization/49073 */ extern void abort (void); int a[] = { 1, 2, 3, 4, 5, 6, 7 }, c; int main () { int d = 1, i = 1; _Bool f = 0; do { d = a[i]; if (f && d == 4) { ++c; break; } i++; f = (d == 3); } while (d < 7); if (c != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49123.c ================================================ /* PR lto/49123 */ extern void abort (void); static struct S { int f : 1; } s; static int v = -1; int main () { s.f = v < 0; if ((unsigned int) s.f != -1U) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49161.c ================================================ /* PR tree-optimization/49161 */ extern void abort (void); int c; __attribute__((noinline, noclone)) void bar (int x) { if (x != c++) abort (); } __attribute__((noinline, noclone)) void foo (int x) { switch (x) { case 3: goto l1; case 4: goto l2; case 6: goto l3; default: return; } l1: goto l4; l2: goto l4; l3: bar (-1); l4: bar (0); if (x != 4) bar (1); if (x != 3) bar (-1); bar (2); } int main () { foo (3); if (c != 3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49186.c ================================================ /* PR target/49186 */ extern void abort (void); int main () { int x; unsigned long long uv = 0x1000000001ULL; x = (uv < 0x80) ? 1 : ((uv < 0x800) ? 2 : 3); if (x != 3) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49218.c ================================================ #ifdef __SIZEOF_INT128__ typedef __int128 L; #else typedef long long L; #endif float f; int main () { L i = f; if (i <= 10) do { ++i; asm (""); } while (i != 11); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49279.c ================================================ /* PR tree-optimization/49279 */ extern void abort (void); struct S { int a; int *__restrict p; }; __attribute__((noinline, noclone)) struct S *bar (struct S *p) { struct S *r; asm volatile ("" : "=r" (r) : "0" (p) : "memory"); return r; } __attribute__((noinline, noclone)) int foo (int *p, int *q) { struct S s, *t; s.a = 1; s.p = p; t = bar (&s); t->p = q; s.p[0] = 0; t->p[0] = 1; return s.p[0]; } int main () { int a, b; if (foo (&a, &b) != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49281.c ================================================ /* PR target/49281 */ extern void abort (void); __attribute__((noinline, noclone)) int foo (int x) { return (x << 2) | 4; } __attribute__((noinline, noclone)) int bar (int x) { return (x << 2) | 3; } int main () { if (foo (43) != 172 || foo (1) != 4 || foo (2) != 12) abort (); if (bar (43) != 175 || bar (1) != 7 || bar (2) != 11) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49390.c ================================================ /* PR rtl-optimization/49390 */ struct S { unsigned int s1; unsigned int s2; }; struct T { unsigned int t1; struct S t2; }; struct U { unsigned short u1; unsigned short u2; }; struct V { struct U v1; struct T v2; }; struct S a; char *b; union { char b[64]; struct V v; } u; volatile int v; extern void abort (void); __attribute__((noinline, noclone)) void foo (int x, void *y, unsigned int z, unsigned int w) { if (x != 4 || y != (void *) &u.v.v2) abort (); v = z + w; v = 16384; } __attribute__((noinline, noclone)) void bar (struct S x) { v = x.s1; v = x.s2; } __attribute__((noinline, noclone)) int baz (struct S *x) { v = x->s1; v = x->s2; v = 0; return v + 1; } __attribute__((noinline, noclone)) void test (struct S *c) { struct T *d; struct S e = a; unsigned int f, g; if (c == 0) c = &e; else { if (c->s2 % 8192 <= 15 || (8192 - c->s2 % 8192) <= 31) foo (1, 0, c->s1, c->s2); } if (!baz (c)) return; g = (((struct U *) b)->u2 & 2) ? 32 : __builtin_offsetof (struct V, v2); f = c->s2 % 8192; if (f == 0) { e.s2 += g; f = g; } else if (f < g) { foo (2, 0, c->s1, c->s2); return; } if ((((struct U *) b)->u2 & 1) && f == g) { bar (*c); foo (3, 0, c->s1, c->s2); return; } d = (struct T *) (b + c->s2 % 8192); if (d->t2.s1 >= c->s1 && (d->t2.s1 != c->s1 || d->t2.s2 >= c->s2)) foo (4, d, c->s1, c->s2); return; } int main () { struct S *c = 0; asm ("" : "+r" (c) : "r" (&a)); u.v.v2.t2.s1 = 8192; b = u.b; test (c); if (v != 16384) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49419.c ================================================ /* PR tree-optimization/49419 */ extern void abort (void); struct S { int w, x, y; } *t; int foo (int n, int f, int *s, int m) { int x, i, a; if (n == -1) return 0; for (x = n, i = 0; t[x].w == f && i < m; i++) x = t[x].x; if (i == m) abort (); a = i + 1; for (x = n; i > 0; i--) { s[i] = t[x].y; x = t[x].x; } s[0] = x; return a; } int main (void) { int s[3], i; struct S buf[3] = { { 1, 1, 2 }, { 0, 0, 0 }, { 0, 0, 0 } }; t = buf; if (foo (0, 1, s, 3) != 2) abort (); if (s[0] != 1 || s[1] != 2) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49644.c ================================================ /* PR c/49644 */ extern void abort (void); int main () { _Complex double a[12], *c = a, s = 3.0 + 1.0i; double b[12] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }, *d = b; int i; for (i = 0; i < 6; i++) *c++ = *d++ * s; if (c != a + 6 || d != b + 6) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49712.c ================================================ /* PR tree-optimization/49712 */ int a[2], b, c, d, e; void foo (int x, int y) { } int bar (void) { int i; for (; d <= 0; d = 1) for (i = 0; i < 4; i++) for (e = 0; e; e = 1) ; return 0; } int main () { for (b = 0; b < 2; b++) while (c) foo (a[b] = 0, bar ()); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49768.c ================================================ /* PR tree-optimization/49768 */ extern void abort (void); int main () { static struct { unsigned int : 1; unsigned int s : 1; } s = { .s = 1 }; if (s.s != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr49886.c ================================================ struct PMC { unsigned flags; }; typedef struct Pcc_cell { struct PMC *p; long bla; long type; } Pcc_cell; int gi; int cond; extern void abort (); extern void never_ever(int interp, struct PMC *pmc) __attribute__((noinline,noclone)); void never_ever (int interp, struct PMC *pmc) { abort (); } static void mark_cell(int * interp, Pcc_cell *c) __attribute__((__nonnull__(1))); static void mark_cell(int * interp, Pcc_cell *c) { if (!cond) return; if (c && c->type == 4 && c->p && !(c->p->flags & (1<<18))) never_ever(gi + 1, c->p); if (c && c->type == 4 && c->p && !(c->p->flags & (1<<17))) never_ever(gi + 2, c->p); if (c && c->type == 4 && c->p && !(c->p->flags & (1<<16))) never_ever(gi + 3, c->p); if (c && c->type == 4 && c->p && !(c->p->flags & (1<<15))) never_ever(gi + 4, c->p); if (c && c->type == 4 && c->p && !(c->p->flags & (1<<14))) never_ever(gi + 5, c->p); if (c && c->type == 4 && c->p && !(c->p->flags & (1<<13))) never_ever(gi + 6, c->p); if (c && c->type == 4 && c->p && !(c->p->flags & (1<<12))) never_ever(gi + 7, c->p); if (c && c->type == 4 && c->p && !(c->p->flags & (1<<11))) never_ever(gi + 8, c->p); if (c && c->type == 4 && c->p && !(c->p->flags & (1<<10))) never_ever(gi + 9, c->p); } static void foo(int * interp, Pcc_cell *c) { mark_cell(interp, c); } static struct Pcc_cell * __attribute__((noinline,noclone)) getnull(void) { return (struct Pcc_cell *) 0; } int main() { int i; cond = 1; for (i = 0; i < 100; i++) foo (&gi, getnull ()); return 0; } void bar_1 (int * interp, Pcc_cell *c) { c->bla += 1; mark_cell(interp, c); } void bar_2 (int * interp, Pcc_cell *c) { c->bla += 2; mark_cell(interp, c); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr50865.c ================================================ /* PR middle-end/50865 */ #define INT64_MIN (-__LONG_LONG_MAX__ - 1) int main () { volatile long long l1 = 1; volatile long long l2 = -1; volatile long long l3 = -1; if ((INT64_MIN % 1LL) != 0) __builtin_abort (); if ((INT64_MIN % l1) != 0) __builtin_abort (); if (l2 == -1) { if ((INT64_MIN % 1LL) != 0) __builtin_abort (); } else if ((INT64_MIN % -l2) != 0) __builtin_abort (); if ((INT64_MIN % -l3) != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr51023.c ================================================ /* PR rtl-optimization/51023 */ extern void abort (void); short int foo (long int x) { return x; } int main () { long int a = 0x4272AL; if (foo (a) == a) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr51323.c ================================================ /* PR middle-end/51323 */ extern void abort (void); struct S { int a, b, c; }; int v; __attribute__((noinline, noclone)) void foo (int x, int y, int z) { if (x != v || y != 0 || z != 9) abort (); } static inline int baz (const struct S *p) { return p->b; } __attribute__((noinline, noclone)) void bar (int x, struct S y) { foo (baz (&y), 0, x); } int main () { struct S s; v = 3; s.a = v - 1; s.b = v; s.c = v + 1; bar (9, s); v = 17; s.a = v - 1; s.b = v; s.c = v + 1; bar (9, s); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr51447.c ================================================ /* PR rtl-optimization/51447 */ /* { dg-require-effective-target label_values } */ /* { dg-require-effective-target indirect_jumps } */ extern void abort (void); #ifdef __x86_64__ register void *ptr asm ("rbx"); #else void *ptr; #endif int main (void) { __label__ nonlocal_lab; __attribute__((noinline, noclone)) void bar (void *func) { ptr = func; goto nonlocal_lab; } bar (&&nonlocal_lab); return 1; nonlocal_lab: if (ptr != &&nonlocal_lab) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr51466.c ================================================ /* PR tree-optimization/51466 */ extern void abort (void); __attribute__((noinline, noclone)) int foo (int i) { volatile int v[4]; int *p; v[i] = 6; p = (int *) &v[i]; return *p; } __attribute__((noinline, noclone)) int bar (int i) { volatile int v[4]; int *p; v[i] = 6; p = (int *) &v[i]; *p = 8; return v[i]; } __attribute__((noinline, noclone)) int baz (int i) { volatile int v[4]; int *p; v[i] = 6; p = (int *) &v[0]; *p = 8; return v[i]; } int main () { if (foo (3) != 6 || bar (2) != 8 || baz (0) != 8 || baz (1) != 6) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr51581-1.c ================================================ /* PR tree-optimization/51581 */ /* { dg-require-effective-target int32plus } */ extern void abort (void); #define N 4096 int a[N], c[N]; unsigned int b[N], d[N]; __attribute__((noinline, noclone)) void f1 (void) { int i; for (i = 0; i < N; i++) c[i] = a[i] / 3; } __attribute__((noinline, noclone)) void f2 (void) { int i; for (i = 0; i < N; i++) d[i] = b[i] / 3; } __attribute__((noinline, noclone)) void f3 (void) { int i; for (i = 0; i < N; i++) c[i] = a[i] / 18; } __attribute__((noinline, noclone)) void f4 (void) { int i; for (i = 0; i < N; i++) d[i] = b[i] / 18; } __attribute__((noinline, noclone)) void f5 (void) { int i; for (i = 0; i < N; i++) c[i] = a[i] / 19; } __attribute__((noinline, noclone)) void f6 (void) { int i; for (i = 0; i < N; i++) d[i] = b[i] / 19; } #if __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8 __attribute__((noinline, noclone)) void f7 (void) { int i; for (i = 0; i < N; i++) c[i] = (int) ((unsigned long long) (a[i] * 0x55555556LL) >> 32) - (a[i] >> 31); } __attribute__((noinline, noclone)) void f8 (void) { int i; for (i = 0; i < N; i++) d[i] = ((unsigned int) ((b[i] * 0xaaaaaaabULL) >> 32) >> 1); } __attribute__((noinline, noclone)) void f9 (void) { int i; for (i = 0; i < N; i++) c[i] = (((int) ((unsigned long long) (a[i] * 0x38e38e39LL) >> 32)) >> 2) - (a[i] >> 31); } __attribute__((noinline, noclone)) void f10 (void) { int i; for (i = 0; i < N; i++) d[i] = (unsigned int) ((b[i] * 0x38e38e39ULL) >> 32) >> 2; } __attribute__((noinline, noclone)) void f11 (void) { int i; for (i = 0; i < N; i++) c[i] = (((int) ((unsigned long long) (a[i] * 0x6bca1af3LL) >> 32)) >> 3) - (a[i] >> 31); } __attribute__((noinline, noclone)) void f12 (void) { int i; for (i = 0; i < N; i++) { unsigned int tmp = (b[i] * 0xaf286bcbULL) >> 32; d[i] = (((b[i] - tmp) >> 1) + tmp) >> 4; } } #endif int main () { int i; for (i = 0; i < N; i++) { asm (""); a[i] = i - N / 2; b[i] = i; } a[0] = -__INT_MAX__ - 1; a[1] = -__INT_MAX__; a[N - 1] = __INT_MAX__; b[N - 1] = ~0; f1 (); f2 (); for (i = 0; i < N; i++) if (c[i] != a[i] / 3 || d[i] != b[i] / 3) abort (); f3 (); f4 (); for (i = 0; i < N; i++) if (c[i] != a[i] / 18 || d[i] != b[i] / 18) abort (); f5 (); f6 (); for (i = 0; i < N; i++) if (c[i] != a[i] / 19 || d[i] != b[i] / 19) abort (); #if __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8 f7 (); f8 (); for (i = 0; i < N; i++) if (c[i] != a[i] / 3 || d[i] != b[i] / 3) abort (); f9 (); f10 (); for (i = 0; i < N; i++) if (c[i] != a[i] / 18 || d[i] != b[i] / 18) abort (); f11 (); f12 (); for (i = 0; i < N; i++) if (c[i] != a[i] / 19 || d[i] != b[i] / 19) abort (); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr51581-2.c ================================================ /* PR tree-optimization/51581 */ /* { dg-require-effective-target int32plus } */ extern void abort (void); #define N 4096 int a[N], c[N]; unsigned int b[N], d[N]; __attribute__((noinline, noclone)) void f1 (void) { int i; for (i = 0; i < N; i++) c[i] = a[i] % 3; } __attribute__((noinline, noclone)) void f2 (void) { int i; for (i = 0; i < N; i++) d[i] = b[i] % 3; } __attribute__((noinline, noclone)) void f3 (void) { int i; for (i = 0; i < N; i++) c[i] = a[i] % 18; } __attribute__((noinline, noclone)) void f4 (void) { int i; for (i = 0; i < N; i++) d[i] = b[i] % 18; } __attribute__((noinline, noclone)) void f5 (void) { int i; for (i = 0; i < N; i++) c[i] = a[i] % 19; } __attribute__((noinline, noclone)) void f6 (void) { int i; for (i = 0; i < N; i++) d[i] = b[i] % 19; } #if __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8 __attribute__((noinline, noclone)) void f7 (void) { int i; for (i = 0; i < N; i++) { int x = (int) ((unsigned long long) (a[i] * 0x55555556LL) >> 32) - (a[i] >> 31); c[i] = a[i] - x * 3; } } __attribute__((noinline, noclone)) void f8 (void) { int i; for (i = 0; i < N; i++) { unsigned int x = ((unsigned int) ((b[i] * 0xaaaaaaabULL) >> 32) >> 1); d[i] = b[i] - x * 3; } } __attribute__((noinline, noclone)) void f9 (void) { int i; for (i = 0; i < N; i++) { int x = (((int) ((unsigned long long) (a[i] * 0x38e38e39LL) >> 32)) >> 2) - (a[i] >> 31); c[i] = a[i] - x * 18; } } __attribute__((noinline, noclone)) void f10 (void) { int i; for (i = 0; i < N; i++) { unsigned int x = (unsigned int) ((b[i] * 0x38e38e39ULL) >> 32) >> 2; d[i] = b[i] - x * 18; } } __attribute__((noinline, noclone)) void f11 (void) { int i; for (i = 0; i < N; i++) { int x = (((int) ((unsigned long long) (a[i] * 0x6bca1af3LL) >> 32)) >> 3) - (a[i] >> 31); c[i] = a[i] - x * 19; } } __attribute__((noinline, noclone)) void f12 (void) { int i; for (i = 0; i < N; i++) { unsigned int tmp = (b[i] * 0xaf286bcbULL) >> 32; unsigned int x = (((b[i] - tmp) >> 1) + tmp) >> 4; d[i] = b[i] - x * 19; } } #endif int main () { int i; for (i = 0; i < N; i++) { asm (""); a[i] = i - N / 2; b[i] = i; } a[0] = -__INT_MAX__ - 1; a[1] = -__INT_MAX__; a[N - 1] = __INT_MAX__; b[N - 1] = ~0; f1 (); f2 (); for (i = 0; i < N; i++) if (c[i] != a[i] % 3 || d[i] != b[i] % 3) abort (); f3 (); f4 (); for (i = 0; i < N; i++) if (c[i] != a[i] % 18 || d[i] != b[i] % 18) abort (); f5 (); f6 (); for (i = 0; i < N; i++) if (c[i] != a[i] % 19 || d[i] != b[i] % 19) abort (); #if __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8 f7 (); f8 (); for (i = 0; i < N; i++) if (c[i] != a[i] % 3 || d[i] != b[i] % 3) abort (); f9 (); f10 (); for (i = 0; i < N; i++) if (c[i] != a[i] % 18 || d[i] != b[i] % 18) abort (); f11 (); f12 (); for (i = 0; i < N; i++) if (c[i] != a[i] % 19 || d[i] != b[i] % 19) abort (); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr51877.c ================================================ /* PR tree-optimization/51877 */ extern void abort (void); struct A { int a; char b[32]; } a, b; __attribute__((noinline, noclone)) struct A bar (int x) { struct A r; static int n; r.a = ++n; __builtin_memset (r.b, 0, sizeof (r.b)); r.b[0] = x; return r; } __attribute__((noinline, noclone)) void baz (void) { asm volatile ("" : : : "memory"); } __attribute__((noinline, noclone)) void foo (struct A *x, int y) { if (y == 6) a = bar (7); else *x = bar (7); baz (); } int main () { a = bar (3); b = bar (4); if (a.a != 1 || a.b[0] != 3 || b.a != 2 || b.b[0] != 4) abort (); foo (&b, 0); if (a.a != 1 || a.b[0] != 3 || b.a != 3 || b.b[0] != 7) abort (); foo (&b, 6); if (a.a != 4 || a.b[0] != 7 || b.a != 3 || b.b[0] != 7) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr51933.c ================================================ /* PR rtl-optimization/51933 */ static signed char v1; static unsigned char v2[256], v3[256]; __attribute__((noclone, noinline)) void foo (void) { #if defined(__s390__) && !defined(__zarch__) /* S/390 31 bit cannot deal with more than one literal pool reference per insn. */ asm volatile ("" : : "g" (&v1) : "memory"); asm volatile ("" : : "g" (&v2[0])); asm volatile ("" : : "g" (&v3[0])); #else asm volatile ("" : : "g" (&v1), "g" (&v2[0]), "g" (&v3[0]) : "memory"); #endif } __attribute__((noclone, noinline)) int bar (const int x, const unsigned short *y, char *z) { int i; unsigned short u; if (!v1) foo (); for (i = 0; i < x; i++) { u = y[i]; z[i] = u < 0x0100 ? v2[u] : v3[u & 0xff]; } z[x] = '\0'; return x; } int main (void) { char buf[18]; unsigned short s[18]; unsigned char c[18] = "abcdefghijklmnopq"; int i; for (i = 0; i < 256; i++) { v2[i] = i; v3[i] = i + 1; } for (i = 0; i < 18; i++) s[i] = c[i]; s[5] |= 0x600; s[6] |= 0x500; s[11] |= 0x2000; s[15] |= 0x500; foo (); if (bar (17, s, buf) != 17 || __builtin_memcmp (buf, "abcdeghhijkmmnoqq", 18) != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr52129.c ================================================ /* PR target/52129 */ /* { dg-xfail-if "ptxas crashes" { nvptx-*-* } { "-O1" } { "" } } */ extern void abort (void); struct S { void *p; unsigned int q; }; struct T { char a[64]; char b[64]; } t; __attribute__((noinline, noclone)) int foo (void *x, struct S s, void *y, void *z) { if (x != &t.a[2] || s.p != &t.b[5] || s.q != 27 || y != &t.a[17] || z != &t.b[17]) abort (); return 29; } __attribute__((noinline, noclone)) int bar (void *x, void *y, void *z, struct S s, int t, struct T *u) { return foo (x, s, &u->a[t], &u->b[t]); } int main () { struct S s = { &t.b[5], 27 }; if (bar (&t.a[2], (void *) 0, (void *) 0, s, 17, &t) != 29) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr52209.c ================================================ /* PR middle-end/52209 */ extern void abort (void); struct S0 { int f2 : 1; } c; int b; int main () { b = -1 ^ c.f2; if (b != -1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr52286.c ================================================ /* PR tree-optimization/52286 */ extern void abort (void); int main () { #if __SIZEOF_INT__ > 2 int a, b; asm ("" : "=r" (a) : "0" (0)); b = (~a | 1) & -2038094497; #else long a, b; asm ("" : "=r" (a) : "0" (0)); b = (~a | 1) & -2038094497L; #endif if (b >= 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr52760.c ================================================ /* PR tree-optimization/52760 */ struct T { unsigned short a, b, c, d; }; __attribute__((noinline, noclone)) void foo (int x, struct T *y) { int i; for (i = 0; i < x; i++) { y[i].a = ((0x00ff & y[i].a >> 8) | (0xff00 & y[i].a << 8)); y[i].b = ((0x00ff & y[i].b >> 8) | (0xff00 & y[i].b << 8)); y[i].c = ((0x00ff & y[i].c >> 8) | (0xff00 & y[i].c << 8)); y[i].d = ((0x00ff & y[i].d >> 8) | (0xff00 & y[i].d << 8)); } } int main () { struct T t = { 0x0001, 0x0203, 0x0405, 0x0607 }; foo (1, &t); if (t.a != 0x0100 || t.b != 0x0302 || t.c != 0x0504 || t.d != 0x0706) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr52979-1.c ================================================ /* PR middle-end/52979 */ /* { dg-require-effective-target int32plus } */ extern void abort (void); int c, d, e; void foo (void) { } struct __attribute__((packed)) S { int g : 31; int h : 6; }; struct S a = { 1 }; static struct S b = { 1 }; void bar (void) { a.h = 1; struct S f = { }; b = f; e = 0; if (d) c = a.g; } void baz (void) { bar (); a = b; } int main () { baz (); if (a.g) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr52979-2.c ================================================ /* PR middle-end/52979 */ /* { dg-require-effective-target int32plus } */ extern void abort (void); int c, d, e; void foo (void) { } struct __attribute__((packed)) S { int g : 31; int h : 6; }; static struct S b = { 1 }; struct S a = { 1 }; void bar (void) { a.h = 1; struct S f = { }; b = f; e = 0; if (d) c = a.g; } void baz (void) { bar (); a = b; } int main () { baz (); if (a.g) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr53084.c ================================================ /* PR middle-end/53084 */ extern void abort (void); __attribute__((noinline, noclone)) void bar (const char *p) { if (p[0] != 'o' || p[1] != 'o' || p[2]) abort (); } int main () { static const char *const foo[] = {"foo" + 1}; bar (foo[0]); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr53160.c ================================================ /* PR rtl-optimization/53160 */ extern void abort (void); int a, c = 1, d, e, g; volatile int b; volatile char f; long h; short i; void foo (void) { for (e = 0; e; ++e) ; } int main () { if (g) (void) b; foo (); for (d = 0; d >= 0; d--) { short j = f; int k = 0; i = j ? j : j << k; } h = c == 0 ? 0 : i; a = h; if (a != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr53465.c ================================================ /* PR tree-optimization/53465 */ extern void abort (); static const int a[] = { 1, 2 }; void foo (const int *x, int y) { int i; int b = 0; int c; for (i = 0; i < y; i++) { int d = x[i]; if (d == 0) break; if (b && d <= c) abort (); c = d; b = 1; } } int main () { foo (a, 2); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr53645-2.c ================================================ /* PR tree-optimization/53645 */ /* { dg-options "-std=gnu89" } */ typedef unsigned short int UV __attribute__((vector_size (16))); typedef short int SV __attribute__((vector_size (16))); extern void abort (void); #define TEST(a, b, c, d, e, f, g, h) \ __attribute__((noinline)) void \ uq##a##b##c##d##e##f##g##h (UV *x, UV *y) \ { \ *x = *y / ((UV) { a, b, c, d, e, f, g, h }); \ } \ \ __attribute__((noinline)) void \ ur##a##b##c##d##e##f##g##h (UV *x, UV *y) \ { \ *x = *y % ((UV) { a, b, c, d, e, f, g, h }); \ } \ \ __attribute__((noinline)) void \ sq##a##b##c##d##e##f##g##h (SV *x, SV *y) \ { \ *x = *y / ((SV) { a, b, c, d, e, f, g, h }); \ } \ \ __attribute__((noinline)) void \ sr##a##b##c##d##e##f##g##h (SV *x, SV *y) \ { \ *x = *y % ((SV) { a, b, c, d, e, f, g, h }); \ } #define TESTS \ TEST (4, 4, 4, 4, 4, 4, 4, 4) \ TEST (1, 4, 2, 8, 16, 64, 32, 128) \ TEST (3, 3, 3, 3, 3, 3, 3, 3) \ TEST (6, 5, 6, 5, 6, 5, 6, 5) \ TEST (14, 14, 14, 6, 14, 6, 14, 14) \ TEST (7, 7, 7, 7, 7, 7, 7, 7) \ TESTS UV u[] = { ((UV) { 73U, 65531U, 0U, 174U, 921U, 65535U, 17U, 178U }), ((UV) { 1U, 8173U, 65535U, 65472U, 12U, 29612U, 128U, 8912U }) }; SV s[] = { ((SV) { 73, -9123, 32761, 8191, 16371, 1201, 12701, 9999 }), ((SV) { 9903, -1, -7323, 0, -7, -323, 9124, -9199 }) }; int main () { UV ur, ur2; SV sr, sr2; int i; #undef TEST #define TEST(a, b, c, d, e, f, g, h) \ uq##a##b##c##d##e##f##g##h (&ur, u + i); \ if (ur[0] != u[i][0] / a || ur[3] != u[i][3] / d) \ abort (); \ asm volatile ("" : : "r" (&ur) : "memory"); \ if (ur[2] != u[i][2] / c || ur[1] != u[i][1] / b) \ abort (); \ asm volatile ("" : : "r" (&ur) : "memory"); \ if (ur[4] != u[i][4] / e || ur[7] != u[i][7] / h) \ abort (); \ asm volatile ("" : : "r" (&ur) : "memory"); \ if (ur[6] != u[i][6] / g || ur[5] != u[i][5] / f) \ abort (); \ asm volatile ("" : : "r" (&ur) : "memory"); \ ur##a##b##c##d##e##f##g##h (&ur, u + i); \ if (ur[0] != u[i][0] % a || ur[3] != u[i][3] % d) \ abort (); \ asm volatile ("" : : "r" (&ur) : "memory"); \ if (ur[2] != u[i][2] % c || ur[1] != u[i][1] % b) \ abort (); \ asm volatile ("" : : "r" (&ur) : "memory"); \ if (ur[4] != u[i][4] % e || ur[7] != u[i][7] % h) \ abort (); \ asm volatile ("" : : "r" (&ur) : "memory"); \ if (ur[6] != u[i][6] % g || ur[5] != u[i][5] % f) \ abort (); \ asm volatile ("" : : "r" (&ur) : "memory"); for (i = 0; i < sizeof (u) / sizeof (u[0]); i++) { TESTS } #undef TEST #define TEST(a, b, c, d, e, f, g, h) \ sq##a##b##c##d##e##f##g##h (&sr, s + i); \ if (sr[0] != s[i][0] / a || sr[3] != s[i][3] / d) \ abort (); \ asm volatile ("" : : "r" (&sr) : "memory"); \ if (sr[2] != s[i][2] / c || sr[1] != s[i][1] / b) \ abort (); \ asm volatile ("" : : "r" (&sr) : "memory"); \ if (sr[4] != s[i][4] / e || sr[7] != s[i][7] / h) \ abort (); \ asm volatile ("" : : "r" (&sr) : "memory"); \ if (sr[6] != s[i][6] / g || sr[5] != s[i][5] / f) \ abort (); \ asm volatile ("" : : "r" (&sr) : "memory"); \ sr##a##b##c##d##e##f##g##h (&sr, s + i); \ if (sr[0] != s[i][0] % a || sr[3] != s[i][3] % d) \ abort (); \ asm volatile ("" : : "r" (&sr) : "memory"); \ if (sr[2] != s[i][2] % c || sr[1] != s[i][1] % b) \ abort (); \ asm volatile ("" : : "r" (&sr) : "memory"); \ if (sr[4] != s[i][4] % e || sr[7] != s[i][7] % h) \ abort (); \ asm volatile ("" : : "r" (&sr) : "memory"); \ if (sr[6] != s[i][6] % g || sr[5] != s[i][5] % f) \ abort (); \ asm volatile ("" : : "r" (&sr) : "memory"); for (i = 0; i < sizeof (s) / sizeof (s[0]); i++) { TESTS } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr53645.c ================================================ /* PR tree-optimization/53645 */ /* { dg-options "-std=gnu89" } */ typedef unsigned int UV __attribute__((vector_size (16))); typedef int SV __attribute__((vector_size (16))); extern void abort (void); #define TEST(a, b, c, d) \ __attribute__((noinline)) void \ uq##a##b##c##d (UV *x, UV *y) \ { \ *x = *y / ((UV) { a, b, c, d }); \ } \ \ __attribute__((noinline)) void \ ur##a##b##c##d (UV *x, UV *y) \ { \ *x = *y % ((UV) { a, b, c, d }); \ } \ \ __attribute__((noinline)) void \ sq##a##b##c##d (SV *x, SV *y) \ { \ *x = *y / ((SV) { a, b, c, d }); \ } \ \ __attribute__((noinline)) void \ sr##a##b##c##d (SV *x, SV *y) \ { \ *x = *y % ((SV) { a, b, c, d }); \ } #define TESTS \ TEST (4, 4, 4, 4) \ TEST (1, 4, 2, 8) \ TEST (3, 3, 3, 3) \ TEST (6, 5, 6, 5) \ TEST (14, 14, 14, 6) \ TEST (7, 7, 7, 7) \ TESTS UV u[] = { ((UV) { 73U, 65531U, 0U, 174U }), ((UV) { 1U, 8173U, ~0U, ~0U - 63 }) }; SV s[] = { ((SV) { 73, -9123, 32761, 8191 }), ((SV) { 9903, -1, -7323, 0 }) }; int main () { UV ur, ur2; SV sr, sr2; int i; #undef TEST #define TEST(a, b, c, d) \ uq##a##b##c##d (&ur, u + i); \ if (ur[0] != u[i][0] / a || ur[3] != u[i][3] / d) \ abort (); \ asm volatile ("" : : "r" (&ur) : "memory"); \ if (ur[2] != u[i][2] / c || ur[1] != u[i][1] / b) \ abort (); \ asm volatile ("" : : "r" (&ur) : "memory"); \ ur##a##b##c##d (&ur, u + i); \ if (ur[0] != u[i][0] % a || ur[3] != u[i][3] % d) \ abort (); \ asm volatile ("" : : "r" (&ur) : "memory"); \ if (ur[2] != u[i][2] % c || ur[1] != u[i][1] % b) \ abort (); \ asm volatile ("" : : "r" (&ur) : "memory"); for (i = 0; i < sizeof (u) / sizeof (u[0]); i++) { TESTS } #undef TEST #define TEST(a, b, c, d) \ sq##a##b##c##d (&sr, s + i); \ if (sr[0] != s[i][0] / a || sr[3] != s[i][3] / d) \ abort (); \ asm volatile ("" : : "r" (&sr) : "memory"); \ if (sr[2] != s[i][2] / c || sr[1] != s[i][1] / b) \ abort (); \ asm volatile ("" : : "r" (&sr) : "memory"); \ sr##a##b##c##d (&sr, s + i); \ if (sr[0] != s[i][0] % a || sr[3] != s[i][3] % d) \ abort (); \ asm volatile ("" : : "r" (&sr) : "memory"); \ if (sr[2] != s[i][2] % c || sr[1] != s[i][1] % b) \ abort (); \ asm volatile ("" : : "r" (&sr) : "memory"); for (i = 0; i < sizeof (s) / sizeof (s[0]); i++) { TESTS } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr53688.c ================================================ char headline[256]; struct hdr { char part1[9]; char part2[8]; } p; void __attribute__((noinline,noclone)) init() { __builtin_memcpy (p.part1, "FOOBARFOO", sizeof (p.part1)); __builtin_memcpy (p.part2, "SPEC CPU", sizeof (p.part2)); } int main() { char *x; int c; init(); __builtin_memcpy (&headline[0], p.part1, 9); c = 9; x = &headline[0]; x = x + c; __builtin_memset (x, ' ', 245); __builtin_memcpy (&headline[10], p.part2, 8); c = 18; x = &headline[0]; x = x + c; __builtin_memset (x, ' ', 238); if (headline[10] != 'S') __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr54471.c ================================================ /* PR tree-optimization/54471 */ #ifdef __SIZEOF_INT128__ #define T __int128 #else #define T long long #endif extern void abort (void); __attribute__ ((noinline)) unsigned T foo (T ixi, unsigned ctr) { unsigned T irslt = 1; T ix = ixi; for (; ctr; ctr--) { irslt *= ix; ix *= ix; } if (irslt != 14348907) abort (); return irslt; } int main () { unsigned T res; res = foo (3, 4); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr54937.c ================================================ void exit (int); void abort (void); int a[1]; void (*terminate_me)(int); __attribute__((noinline,noclone)) t(int c) { int i; for (i=0;ia; int x; while (count--) { x = item->a; if (first) first = 0; else if (x >= a) return 1; a = x; item++; } return 0; } extern void abort (void); int main () { ST _1[2] = {{2}, {1}}; if (foo(_1, 2) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr55137.c ================================================ /* PR c++/55137 */ extern void abort (void); int foo (unsigned int x) { return ((int) (x + 1U) + 1) < (int) x; } int bar (unsigned int x) { return (int) (x + 1U) + 1; } int baz (unsigned int x) { return x + 1U; } int main () { if (foo (__INT_MAX__) != (bar (__INT_MAX__) < __INT_MAX__) || foo (__INT_MAX__) != ((int) baz (__INT_MAX__) + 1 < __INT_MAX__)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr55750.c ================================================ /* PR middle-end/55750 */ extern void abort (void); struct S { int m : 1; int n : 7; } arr[2]; __attribute__((noinline, noclone)) void foo (unsigned i) { arr[i].n++; } int main () { arr[0].m = -1; arr[0].n = (1 << 6) - 1; arr[1].m = 0; arr[1].n = -1; foo (0); foo (1); if (arr[0].m != -1 || arr[0].n != -(1 << 6) || arr[1].m != 0 || arr[1].n != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr55875.c ================================================ int a[251]; __attribute__ ((noinline)) t(int i) { if (i==0) exit(0); if (i>255) abort (); } main() { unsigned int i; for (i=0;;i++) { a[i]=t((unsigned char)(i+5)); } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr56051.c ================================================ /* PR tree-optimization/56051 */ extern void abort (void); int main () { unsigned char x1[1] = { 0 }; unsigned int s1 = __CHAR_BIT__; int a1 = x1[0] < (unsigned char) (1 << s1); unsigned char y1 = (unsigned char) (1 << s1); int b1 = x1[0] < y1; if (a1 != b1) abort (); #if __SIZEOF_LONG_LONG__ > __SIZEOF_INT__ unsigned long long x2[1] = { 2ULL << (sizeof (int) * __CHAR_BIT__) }; unsigned int s2 = sizeof (int) * __CHAR_BIT__ - 1; int a2 = x2[0] >= (unsigned long long) (1 << s2); unsigned long long y2 = 1 << s2; int b2 = x2[0] >= y2; if (a2 != b2) abort (); unsigned long long x3[1] = { 2ULL << (sizeof (int) * __CHAR_BIT__) }; unsigned int s3 = sizeof (int) * __CHAR_BIT__ - 1; int a3 = x3[0] >= (unsigned long long) (1U << s3); unsigned long long y3 = 1U << s3; int b3 = x3[0] >= y3; if (a3 != b3) abort (); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr56205.c ================================================ /* PR tree-optimization/56205 */ #include int a, b; char c[128]; __attribute__((noinline, noclone)) static void f1 (const char *fmt, ...) { va_list ap; asm volatile ("" : : : "memory"); if (__builtin_strcmp (fmt, "%s %d %s") != 0) __builtin_abort (); va_start (ap, fmt); if (__builtin_strcmp (va_arg (ap, const char *), "foo") != 0 || va_arg (ap, int) != 1 || __builtin_strcmp (va_arg (ap, const char *), "bar") != 0) __builtin_abort (); va_end (ap); } __attribute__((noinline, noclone)) static void f2 (const char *fmt, va_list ap) { asm volatile ("" : : : "memory"); if (__builtin_strcmp (fmt, "baz") != 0 || __builtin_strcmp (va_arg (ap, const char *), "foo") != 0 || va_arg (ap, double) != 12.0 || va_arg (ap, int) != 26) __builtin_abort (); } static void f3 (int x, char const *y, va_list z) { f1 ("%s %d %s", x ? "" : "foo", ++a, (y && *y) ? "bar" : ""); if (y && *y) f2 (y, z); } __attribute__((noinline, noclone)) void f4 (int x, char const *y, ...) { va_list z; va_start (z, y); if (!x && *c == '\0') ++b; f3 (x, y, z); va_end (z); } int main () { asm volatile ("" : : : "memory"); f4 (0, "baz", "foo", 12.0, 26); if (a != 1 || b != 1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr56250.c ================================================ /* PR tree-optimization/56250 */ extern void abort (void); int main () { unsigned int x = 2; unsigned int y = (0U - x / 2) / 2; if (-1U / x != y) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr56799.c ================================================ /* { dg-require-effective-target int32plus } */ #include typedef struct { int x; int y;} S; extern int foo(S*); int hi = 0, lo = 0; int main() { S a; int r; a.x = (int) 0x00010000; a.y = 1; r = foo (&a); if (r == 2 && lo==0 && hi==1) { exit (0); } abort (); } typedef unsigned short u16; __attribute__ ((noinline)) int foo (S* ptr) { int a = ptr->x; int c = 0; u16 b = (u16) a; if (b != 0) { lo = 1; c += ptr->y; } b = a >> 16; if (b != 0) { hi = 1; c+= ptr->y; } c += ptr->y; return c; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr56837.c ================================================ extern void abort (void); _Complex int a[1024]; __attribute__((noinline, noclone)) void foo (void) { int i; for (i = 0; i < 1024; i++) a[i] = -1; } int main () { int i; foo (); for (i = 0; i < 1024; i++) if (a[i] != -1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr56866.c ================================================ /* PR target/56866 */ int main () { #if __CHAR_BIT__ == 8 && __SIZEOF_LONG_LONG__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_SHORT__ == 2 unsigned long long wq[256], rq[256]; unsigned int wi[256], ri[256]; unsigned short ws[256], rs[256]; unsigned char wc[256], rc[256]; int t; __builtin_memset (wq, 0, sizeof wq); __builtin_memset (wi, 0, sizeof wi); __builtin_memset (ws, 0, sizeof ws); __builtin_memset (wc, 0, sizeof wc); wq[0] = 0x0123456789abcdefULL; wi[0] = 0x01234567; ws[0] = 0x4567; wc[0] = 0x73; asm volatile ("" : : "g" (wq), "g" (wi), "g" (ws), "g" (wc) : "memory"); for (t = 0; t < 256; ++t) rq[t] = (wq[t] >> 8) | (wq[t] << (sizeof (wq[0]) * __CHAR_BIT__ - 8)); for (t = 0; t < 256; ++t) ri[t] = (wi[t] >> 8) | (wi[t] << (sizeof (wi[0]) * __CHAR_BIT__ - 8)); for (t = 0; t < 256; ++t) rs[t] = (ws[t] >> 9) | (ws[t] << (sizeof (ws[0]) * __CHAR_BIT__ - 9)); for (t = 0; t < 256; ++t) rc[t] = (wc[t] >> 5) | (wc[t] << (sizeof (wc[0]) * __CHAR_BIT__ - 5)); asm volatile ("" : : "g" (rq), "g" (ri), "g" (rs), "g" (rc) : "memory"); if (rq[0] != 0xef0123456789abcdULL || rq[1]) __builtin_abort (); if (ri[0] != 0x67012345 || ri[1]) __builtin_abort (); if (rs[0] != 0xb3a2 || rs[1]) __builtin_abort (); if (rc[0] != 0x9b || rc[1]) __builtin_abort (); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr56899.c ================================================ /* PR tree-optimization/56899 */ #if __SIZEOF_INT__ == 4 && __CHAR_BIT__ == 8 __attribute__((noinline, noclone)) void f1 (int v) { int x = -214748365 * (v - 1); if (x != -1932735285) __builtin_abort (); } __attribute__((noinline, noclone)) void f2 (int v) { int x = 214748365 * (v + 1); if (x != -1932735285) __builtin_abort (); } __attribute__((noinline, noclone)) void f3 (unsigned int v) { unsigned int x = -214748365U * (v - 1); if (x != -1932735285U) __builtin_abort (); } __attribute__((noinline, noclone)) void f4 (unsigned int v) { unsigned int x = 214748365U * (v + 1); if (x != -1932735285U) __builtin_abort (); } #endif int main () { #if __SIZEOF_INT__ == 4 && __CHAR_BIT__ == 8 f1 (10); f2 (-10); f3 (10); f4 (-10U); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr56962.c ================================================ /* PR tree-optimization/56962 */ extern void abort (void); long long v[144]; __attribute__((noinline, noclone)) void bar (long long *x) { if (x != &v[29]) abort (); } __attribute__((noinline, noclone)) void foo (long long *x, long y, long z) { long long a, b, c; a = x[z * 4 + y * 3]; b = x[z * 5 + y * 3]; c = x[z * 5 + y * 4]; x[y * 4] = a; bar (&x[z * 5 + y]); x[z * 5 + y * 5] = b + c; } int main () { foo (v, 24, 1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr56982.c ================================================ /* { dg-require-effective-target indirect_jumps } */ #include extern void abort (void); extern void exit (int); static jmp_buf env; void baz (void) { __asm__ volatile ("" : : : "memory"); } static inline int g(int x) { if (x) { baz(); return 0; } else { baz(); return 1; } } int f(int *e) { if (*e) return 1; int x = setjmp(env); int n = g(x); if (n == 0) exit(0); if (x) abort(); longjmp(env, 42); } int main(int argc, char** argv) { int v = 0; return f(&v); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57124.c ================================================ /* { dg-require-effective-target int32plus } */ /* { dg-options "-fno-strict-overflow" } */ extern void abort (void); extern void exit (int); __attribute__ ((noinline)) void foo(short unsigned int *p1, short unsigned int *p2) { short unsigned int x1, x4; int x2, x3, x5, x6; unsigned int x7; x1 = *p1; x2 = (int) x1; x3 = x2 * 65536; x4 = *p2; x5 = (int) x4; x6 = x3 + x4; x7 = (unsigned int) x6; if (x7 <= 268435455U) abort (); exit (0); } int main() { short unsigned int x, y; x = -5; y = -10; foo (&x, &y); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57130.c ================================================ /* PR rtl-optimization/57130 */ struct S { int a, b, c, d; } s[2] = { { 6, 8, -8, -5 }, { 0, 2, -1, 2 } }; __attribute__((noinline, noclone)) void foo (struct S r) { static int cnt; if (__builtin_memcmp (&r, &s[cnt++], sizeof r) != 0) __builtin_abort (); } int main () { struct S r = { 6, 8, -8, -5 }; foo (r); r = (struct S) { 0, 2, -1, 2 }; foo (r); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57131.c ================================================ /* PR rtl-optimization/57131 */ extern void abort (void); int main () { volatile int x1 = 0; volatile long long x2 = 0; volatile int x3 = 0; volatile int x4 = 1; volatile int x5 = 1; volatile long long x6 = 1; long long t = ((x1 * (x2 << x3)) / (x4 * x5)) + x6; if (t != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57144.c ================================================ extern void abort (void); extern void exit (int); void __attribute__ ((noinline)) foo(int a) { int z = a > 0 ? a : -a; long long x = z; if (x > 0x100000000LL) abort (); else exit (0); } int main() { foo (1); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57281.c ================================================ /* PR rtl-optimization/57281 */ int a = 1, b, d, *e = &d; long long c, *g = &c; volatile long long f; int foo (int h) { int j = *g = b; return h == 0 ? j : 0; } int main () { int h = a; for (; b != -20; b--) { (int) f; *e = 0; *e = foo (h); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57321.c ================================================ /* PR tree-optimization/57321 */ int a = 1, *b, **c; static int foo (int *p) { if (*p == a) { int *i[7][5] = { { 0 } }; int **j[1][1]; j[0][0] = &i[0][0]; *b = &p != c; } return 0; } int main () { int i = 0; foo (&i); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57344-1.c ================================================ /* PR middle-end/57344 */ struct __attribute__((packed)) S { int a : 11; #if __SIZEOF_INT__ * __CHAR_BIT__ >= 32 int b : 22; #else int b : 13; #endif char c; int : 0; } s[2]; int i; __attribute__((noinline, noclone)) void foo (int x) { if (x != -3161) __builtin_abort (); asm volatile ("" : : : "memory"); } int main () { struct S t = { 0, -3161L }; s[1] = t; for (; i < 1; i++) foo (s[1].b); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57344-2.c ================================================ /* PR middle-end/57344 */ /* { dg-require-effective-target int32plus } */ struct __attribute__((packed)) S { int a : 27; #if __SIZEOF_INT__ * __CHAR_BIT__ >= 32 int b : 22; #else int b : 13; #endif char c; int : 0; } s[2]; int i; __attribute__((noinline, noclone)) void foo (int x) { if (x != -3161) __builtin_abort (); asm volatile ("" : : : "memory"); } int main () { struct S t = { 0, -3161L }; s[1] = t; for (; i < 1; i++) foo (s[1].b); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57344-3.c ================================================ /* PR middle-end/57344 */ struct __attribute__((packed)) S { long long int a : 43; long long int b : 22; char c; long long int : 0; } s[2]; int i; __attribute__((noinline, noclone)) void foo (long long int x) { if (x != -3161LL) __builtin_abort (); asm volatile ("" : : : "memory"); } int main () { struct S t = { 0, -3161LL }; s[1] = t; for (; i < 1; i++) foo (s[1].b); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57344-4.c ================================================ /* PR middle-end/57344 */ struct __attribute__((packed)) S { long long int a : 59; long long int b : 54; char c; long long int : 0; } s[2]; int i; __attribute__((noinline, noclone)) void foo (long long int x) { if (x != -1220975898975746LL) __builtin_abort (); asm volatile ("" : : : "memory"); } int main () { struct S t = { 0, -1220975898975746LL }; s[1] = t; for (; i < 1; i++) foo (s[1].b); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57568.c ================================================ /* PR target/57568 */ extern void abort (void); int a[6][9] = { }, b = 1, *c = &a[3][5]; int main () { if (b && (*c = *c + *c)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57829.c ================================================ /* PR rtl-optimization/57829 */ __attribute__((noinline, noclone)) int f1 (int k) { return 2 | ((k - 1) >> ((int) sizeof (int) * __CHAR_BIT__ - 1)); } __attribute__((noinline, noclone)) long int f2 (long int k) { return 2L | ((k - 1L) >> ((int) sizeof (long int) * __CHAR_BIT__ - 1)); } __attribute__((noinline, noclone)) int f3 (int k) { k &= 63; return 4 | ((k + 2) >> 5); } int main () { if (f1 (1) != 2 || f2 (1L) != 2L || f3 (63) != 6 || f3 (1) != 4) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57860.c ================================================ /* PR rtl-optimization/57860 */ extern void abort (void); int a, *b = &a, c, d, e, *f = &e, g, *h = &d, k[1] = { 1 }; int foo (int p) { for (;; g++) { for (; c; c--); *f = *h = p > ((0x1FFFFFFFFLL ^ a) & *b); if (k[g]) return 0; } } int main () { foo (1); if (d != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57861.c ================================================ /* PR rtl-optimization/57861 */ extern void abort (void); short a = 1, f; int b, c, d, *g = &b, h, i, j; unsigned int e; static int foo (char p) { int k; for (c = 0; c < 2; c++) { i = (j = 0) || p; k = i * p; if (e < k) { short *l = &f; a = d && h; *l = 0; } } return 0; } int main () { *g = foo (a); if (a != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57875.c ================================================ /* PR rtl-optimization/57875 */ extern void abort (void); int a[1], b, c, d, f, i; char e[1]; int main () { for (; i < 1; i++) if (!d) { if (!c) f = 2; e[0] &= f ^= 0; } b = a[e[0] >> 1 & 1]; if (b != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57876.c ================================================ /* PR rtl-optimization/57876 */ extern void abort (void); int a, b = 1, c, *d = &c, f, *g, h, j; static int e; int main () { int i; for (i = 0; i < 2; i++) { long long k = b; int l; for (f = 0; f < 8; f++) { int *m = &e; j = *d; h = a * j - 1; *m = (h == 0) < k; g = &l; } } if (e != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr57877.c ================================================ /* PR rtl-optimization/57877 */ extern void abort (void); int a, b, *c = &b, e, f = 6, g, h; short d; static unsigned char foo (unsigned long long p1, int *p2) { for (; g <= 0; g++) { short *i = &d; int *j = &e; h = *c; *i = h; *j = (*i == *p2) < p1; } return 0; } int main () { foo (f, &a); if (e != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58209.c ================================================ /* PR tree-optimization/58209 */ extern void abort (void); typedef __INTPTR_TYPE__ T; T buf[1024]; T * foo (T n) { if (n == 0) return (T *) buf; T s = (T) foo (n - 1); return (T *) (s + sizeof (T)); } T * bar (T n) { if (n == 0) return buf; return foo (n - 1) + 1; } int main () { int i; for (i = 0; i < 27; i++) if (foo (i) != buf + i || bar (i) != buf + i) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58277-1.c ================================================ /* PR tree-optimization/58277 */ extern void abort (void); static int a[2]; int b, c, d, *e, f, g, h, **i = &e, k, l = 1, n, o, p; static int **volatile j = &e; const int m; char u; int bar () { u = 0; return m; } __attribute__((noinline, noclone)) void baz () { asm (""); } static int foo () { int t1; g = bar (); if (l) ; else for (;; h++) { *i = 0; o = *e = 0; if (p) { f = 0; return 0; } for (;; k++) { int *t2 = 0; int *const *t3[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, &t2, &t2, &t2, &t2, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, &t2, &t2, &t2, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, &t2, 0, 0, 0, &t2, 0, &t2, 0, 0, &t2, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 0, &t2, &t2, 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, &t2, 0, 0, 0, &t2, &t2 }; int *const **t4[] = {&t3[0]}; **i = 0; if (**j) break; u = 0; } *i = *j; t1 = 0; for (; t1 < 5; t1++) *i = *j; } *j = 0; return 1; } int main () { int t5; a[0] = 1; { int *t6[6] = {&d, &d}; for (n = 1; n; n--) if (foo()) { int *t7[] = {0}; d = 0; for (; u < 1; u++) *i = *j; *i = 0; *i = 0; int t8[5] = {0}; *i = &t8[0]; int *const *t9 = &t6[0]; int *const **t10 = &t9; *t10 = &t7[0]; } } u = 0; for (; b; b++) for (t5 = 0; t5 < 10; t5++) c = a[a[a[a[a[a[a[a[c]]]]]]]]; baz (); if (!a[a[a[a[a[a[a[a[a[a[a[a[a[a[a[u]]]]]]]]]]]]]]]) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58277-2.c ================================================ /* PR tree-optimization/58277 */ extern void abort (void); static int a[1], b, c, e, i, j, k, m, q[] = { 1, 1 }, t; int volatile d; int **r; static int ***volatile s = &r; int f, g, o, x; static int *volatile h = &f, *p; char n; static void fn1 () { b = a[a[a[a[a[a[a[a[b]]]]]]]]; b = a[a[a[a[a[a[a[a[b]]]]]]]]; b = a[a[b]]; b = a[a[a[a[a[a[a[a[b]]]]]]]]; b = a[a[a[a[a[a[a[a[b]]]]]]]]; } static int fn2 () { n = 0; for (; g; t++) { for (;; m++) { d; int *u; int **v[] = { 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, 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, 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, &u, 0, 0, 0, 0, &u, &u, &u, &u, &u, &u, &u, 0, &u, 0, &u, &u, &u, 0, &u, &u, 0, &u, &u, &u, &u, 0, &u, &u, &u, &u, &u, 0, &u, &u, 0, &u, 0, &u, &u, 0, &u, &u, &u, &u, &u, 0, &u, 0, 0, 0, &u, &u, &u, 0, 0, &u, &u, &u, 0, &u, 0, &u, &u }; int ***w[] = { &v[0] }; if (*p) break; return 0; } *h = 0; } return 1; } static void fn3 () { int *y[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; for (; i; i++) x = 0; if (fn2 ()) { int *z[6] = { }; for (; n < 1; n++) *h = 0; int t1[7]; for (; c; c++) o = t1[0]; for (; e; e--) { int **t2 = &y[0]; int ***t3 = &t2; *t3 = &z[0]; } } *s = 0; for (n = 0;; n = 0) { int t4 = 0; if (q[n]) break; *r = &t4; } } int main () { for (; j; j--) a[0] = 0; fn3 (); for (; k; k++) fn1 (); fn1 (); if (n) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58364.c ================================================ /* PR tree-optimization/58364 */ int a = 1, b, c; int foo (int x) { return x < 0 ? 1 : x; } int main () { if (foo (a > c == (b = 0))) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58365.c ================================================ /* PR rtl-optimization/58365 */ extern void abort (void); struct S { volatile int a; int b, c, d, e; } f; static struct S g, h; int i = 1; char foo (void) { return i; } static struct S bar (void) { if (foo ()) return f; return g; } int main () { h = bar (); f.b = 1; if (h.b != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58385.c ================================================ /* PR tree-optimization/58385 */ extern void abort (void); int a, b = 1; int foo () { b = 0; return 0; } int main () { ((0 || a) & foo () >= 0) <= 1 && 1; if (b) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58387.c ================================================ extern void abort(void); int a = -1; int main () { int b = a == 0 ? 0 : -a; if (b < 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58419.c ================================================ __attribute__((__noinline__)) void dummy () { asm volatile(""); } int a, g, i, k, *p; signed char b; char e; short c, h; static short *d = &c; char foo (int p1, int p2) { return p1 - p2; } int bar () { short *q = &c; *q = 1; *p = 0; return 0; } int main () { for (b = -22; b >= -29; b--) { short *l = &h; char *m = &e; *l = a; g = foo (*m = k && *d, 1 > i) || bar (); } dummy(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58431.c ================================================ char a, h; int b, d, e, g, j, k; volatile int c; short i; int main () { int m; m = i ^= 1; for (b = 0; b < 1; b++) { char o = m; g = k; j = j || c; if (a != o) for (; d < 1; d++) ; else { char *p = &h; *p = 1; for (; e; e++) ; } } if (h != 0) __builtin_abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58564.c ================================================ /* PR middle-end/58564 */ extern void abort (void); int a, b; short *c, **d = &c; int main () { b = (0, 0 > ((&c == d) & (1 && (a ^ 1)))) | 0U; if (b != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58570.c ================================================ /* { dg-require-effective-target int32plus } */ #pragma pack(1) struct S { int f0:15; int f1:29; }; int e = 1, i; static struct S d[6]; int main (void) { if (e) { d[i].f0 = 1; d[i].f1 = 1; } if (d[0].f1 != 1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58574.c ================================================ /* PR target/58574 */ __attribute__((noinline, noclone)) double foo (double x) { double t; switch ((int) x) { case 0: t = 2 * x - 1; return 0.70878e-3 + (0.71234e-3 + (0.35779e-5 + (0.17403e-7 + (0.81710e-10 + (0.36885e-12 + 0.15917e-14 * t) * t) * t) * t) * t) * t; case 1: t = 2 * x - 3; return 0.21479e-2 + (0.72686e-3 + (0.36843e-5 + (0.18071e-7 + (0.85496e-10 + (0.38852e-12 + 0.16868e-14 * t) * t) * t) * t) * t) * t; case 2: t = 2 * x - 5; return 0.36165e-2 + (0.74182e-3 + (0.37948e-5 + (0.18771e-7 + (0.89484e-10 + (0.40935e-12 + 0.17872e-14 * t) * t) * t) * t) * t) * t; case 3: t = 2 * x - 7; return 0.51154e-2 + (0.75722e-3 + (0.39096e-5 + (0.19504e-7 + (0.93687e-10 + (0.43143e-12 + 0.18939e-14 * t) * t) * t) * t) * t) * t; case 4: t = 2 * x - 9; return 0.66457e-2 + (0.77310e-3 + (0.40289e-5 + (0.20271e-7 + (0.98117e-10 + (0.45484e-12 + 0.20076e-14 * t) * t) * t) * t) * t) * t; case 5: t = 2 * x - 11; return 0.82082e-2 + (0.78946e-3 + (0.41529e-5 + (0.21074e-7 + (0.10278e-9 + (0.47965e-12 + 0.21285e-14 * t) * t) * t) * t) * t) * t; case 6: t = 2 * x - 13; return 0.98039e-2 + (0.80633e-3 + (0.42819e-5 + (0.21916e-7 + (0.10771e-9 + (0.50595e-12 + 0.22573e-14 * t) * t) * t) * t) * t) * t; case 7: t = 2 * x - 15; return 0.11433e-1 + (0.82372e-3 + (0.44160e-5 + (0.22798e-7 + (0.11291e-9 + (0.53386e-12 + 0.23944e-14 * t) * t) * t) * t) * t) * t; case 8: t = 2 * x - 17; return 0.13099e-1 + (0.84167e-3 + (0.45555e-5 + (0.23723e-7 + (0.11839e-9 + (0.56346e-12 + 0.25403e-14 * t) * t) * t) * t) * t) * t; case 9: t = 2 * x - 19; return 0.14800e-1 + (0.86018e-3 + (0.47008e-5 + (0.24694e-7 + (0.12418e-9 + (0.59486e-12 + 0.26957e-14 * t) * t) * t) * t) * t) * t; case 10: t = 2 * x - 21; return 0.16540e-1 + (0.87928e-3 + (0.48520e-5 + (0.25711e-7 + (0.13030e-9 + (0.62820e-12 + 0.28612e-14 * t) * t) * t) * t) * t) * t; case 11: t = 2 * x - 23; return 0.18318e-1 + (0.89900e-3 + (0.50094e-5 + (0.26779e-7 + (0.13675e-9 + (0.66358e-12 + 0.30375e-14 * t) * t) * t) * t) * t) * t; case 12: t = 2 * x - 25; return 0.20136e-1 + (0.91936e-3 + (0.51734e-5 + (0.27900e-7 + (0.14357e-9 + (0.70114e-12 + 0.32252e-14 * t) * t) * t) * t) * t) * t; case 13: t = 2 * x - 27; return 0.21996e-1 + (0.94040e-3 + (0.53443e-5 + (0.29078e-7 + (0.15078e-9 + (0.74103e-12 + 0.34251e-14 * t) * t) * t) * t) * t) * t; case 14: t = 2 * x - 29; return 0.23898e-1 + (0.96213e-3 + (0.55225e-5 + (0.30314e-7 + (0.15840e-9 + (0.78340e-12 + 0.36381e-14 * t) * t) * t) * t) * t) * t; case 15: t = 2 * x - 31; return 0.25845e-1 + (0.98459e-3 + (0.57082e-5 + (0.31613e-7 + (0.16646e-9 + (0.82840e-12 + 0.38649e-14 * t) * t) * t) * t) * t) * t; case 16: t = 2 * x - 33; return 0.27837e-1 + (0.10078e-2 + (0.59020e-5 + (0.32979e-7 + (0.17498e-9 + (0.87622e-12 + 0.41066e-14 * t) * t) * t) * t) * t) * t; case 17: t = 2 * x - 35; return 0.29877e-1 + (0.10318e-2 + (0.61041e-5 + (0.34414e-7 + (0.18399e-9 + (0.92703e-12 + 0.43639e-14 * t) * t) * t) * t) * t) * t; case 18: t = 2 * x - 37; return 0.31965e-1 + (0.10566e-2 + (0.63151e-5 + (0.35924e-7 + (0.19353e-9 + (0.98102e-12 + 0.46381e-14 * t) * t) * t) * t) * t) * t; case 19: t = 2 * x - 39; return 0.34104e-1 + (0.10823e-2 + (0.65354e-5 + (0.37512e-7 + (0.20362e-9 + (0.10384e-11 + 0.49300e-14 * t) * t) * t) * t) * t) * t; case 20: t = 2 * x - 41; return 0.36295e-1 + (0.11089e-2 + (0.67654e-5 + (0.39184e-7 + (0.21431e-9 + (0.10994e-11 + 0.52409e-14 * t) * t) * t) * t) * t) * t; case 21: t = 2 * x - 43; return 0.38540e-1 + (0.11364e-2 + (0.70058e-5 + (0.40943e-7 + (0.22563e-9 + (0.11642e-11 + 0.55721e-14 * t) * t) * t) * t) * t) * t; case 22: t = 2 * x - 45; return 0.40842e-1 + (0.11650e-2 + (0.72569e-5 + (0.42796e-7 + (0.23761e-9 + (0.12332e-11 + 0.59246e-14 * t) * t) * t) * t) * t) * t; case 23: t = 2 * x - 47; return 0.43201e-1 + (0.11945e-2 + (0.75195e-5 + (0.44747e-7 + (0.25030e-9 + (0.13065e-11 + 0.63000e-14 * t) * t) * t) * t) * t) * t; case 24: t = 2 * x - 49; return 0.45621e-1 + (0.12251e-2 + (0.77941e-5 + (0.46803e-7 + (0.26375e-9 + (0.13845e-11 + 0.66996e-14 * t) * t) * t) * t) * t) * t; case 25: t = 2 * x - 51; return 0.48103e-1 + (0.12569e-2 + (0.80814e-5 + (0.48969e-7 + (0.27801e-9 + (0.14674e-11 + 0.71249e-14 * t) * t) * t) * t) * t) * t; case 26: t = 2 * x - 59; return 0.58702e-1 + (0.13962e-2 + (0.93714e-5 + (0.58882e-7 + (0.34414e-9 + (0.18552e-11 + 0.91160e-14 * t) * t) * t) * t) * t) * t; case 30: t = 2 * x - 79; return 0.90908e-1 + (0.18544e-2 + (0.13903e-4 + (0.95549e-7 + (0.59752e-9 + (0.33656e-11 + 0.16815e-13 * t) * t) * t) * t) * t) * t; case 40: t = 2 * x - 99; return 0.13443e0 + (0.25474e-2 + (0.21385e-4 + (0.15996e-6 + (0.10585e-8 + (0.61258e-11 + 0.30412e-13 * t) * t) * t) * t) * t) * t; case 50: t = 2 * x - 119; return 0.19540e0 + (0.36342e-2 + (0.34096e-4 + (0.27479e-6 + (0.18934e-8 + (0.11021e-10 + 0.52931e-13 * t) * t) * t) * t) * t) * t; case 60: t = 2 * x - 121; return 0.20281e0 + (0.37739e-2 + (0.35791e-4 + (0.29038e-6 + (0.20068e-8 + (0.11673e-10 + 0.55790e-13 * t) * t) * t) * t) * t) * t; case 61: t = 2 * x - 123; return 0.21050e0 + (0.39206e-2 + (0.37582e-4 + (0.30691e-6 + (0.21270e-8 + (0.12361e-10 + 0.58770e-13 * t) * t) * t) * t) * t) * t; case 62: t = 2 * x - 125; return 0.21849e0 + (0.40747e-2 + (0.39476e-4 + (0.32443e-6 + (0.22542e-8 + (0.13084e-10 + 0.61873e-13 * t) * t) * t) * t) * t) * t; case 63: t = 2 * x - 127; return 0.22680e0 + (0.42366e-2 + (0.41477e-4 + (0.34300e-6 + (0.23888e-8 + (0.13846e-10 + 0.65100e-13 * t) * t) * t) * t) * t) * t; case 64: t = 2 * x - 129; return 0.23545e0 + (0.44067e-2 + (0.43594e-4 + (0.36268e-6 + (0.25312e-8 + (0.14647e-10 + 0.68453e-13 * t) * t) * t) * t) * t) * t; case 65: t = 2 * x - 131; return 0.24444e0 + (0.45855e-2 + (0.45832e-4 + (0.38352e-6 + (0.26819e-8 + (0.15489e-10 + 0.71933e-13 * t) * t) * t) * t) * t) * t; case 66: t = 2 * x - 133; return 0.25379e0 + (0.47735e-2 + (0.48199e-4 + (0.40561e-6 + (0.28411e-8 + (0.16374e-10 + 0.75541e-13 * t) * t) * t) * t) * t) * t; case 67: t = 2 * x - 135; return 0.26354e0 + (0.49713e-2 + (0.50702e-4 + (0.42901e-6 + (0.30095e-8 + (0.17303e-10 + 0.79278e-13 * t) * t) * t) * t) * t) * t; case 68: t = 2 * x - 137; return 0.27369e0 + (0.51793e-2 + (0.53350e-4 + (0.45379e-6 + (0.31874e-8 + (0.18277e-10 + 0.83144e-13 * t) * t) * t) * t) * t) * t; case 69: t = 2 * x - 139; return 0.28426e0 + (0.53983e-2 + (0.56150e-4 + (0.48003e-6 + (0.33752e-8 + (0.19299e-10 + 0.87139e-13 * t) * t) * t) * t) * t) * t; case 70: t = 2 * x - 141; return 0.29529e0 + (0.56288e-2 + (0.59113e-4 + (0.50782e-6 + (0.35735e-8 + (0.20369e-10 + 0.91262e-13 * t) * t) * t) * t) * t) * t; case 71: t = 2 * x - 143; return 0.30679e0 + (0.58714e-2 + (0.62248e-4 + (0.53724e-6 + (0.37827e-8 + (0.21490e-10 + 0.95513e-13 * t) * t) * t) * t) * t) * t; case 72: t = 2 * x - 145; return 0.31878e0 + (0.61270e-2 + (0.65564e-4 + (0.56837e-6 + (0.40035e-8 + (0.22662e-10 + 0.99891e-13 * t) * t) * t) * t) * t) * t; case 73: t = 2 * x - 147; return 0.33130e0 + (0.63962e-2 + (0.69072e-4 + (0.60133e-6 + (0.42362e-8 + (0.23888e-10 + 0.10439e-12 * t) * t) * t) * t) * t) * t; case 74: t = 2 * x - 149; return 0.34438e0 + (0.66798e-2 + (0.72783e-4 + (0.63619e-6 + (0.44814e-8 + (0.25168e-10 + 0.10901e-12 * t) * t) * t) * t) * t) * t; case 75: t = 2 * x - 151; return 0.35803e0 + (0.69787e-2 + (0.76710e-4 + (0.67306e-6 + (0.47397e-8 + (0.26505e-10 + 0.11376e-12 * t) * t) * t) * t) * t) * t; case 76: t = 2 * x - 153; return 0.37230e0 + (0.72938e-2 + (0.80864e-4 + (0.71206e-6 + (0.50117e-8 + (0.27899e-10 + 0.11862e-12 * t) * t) * t) * t) * t) * t; case 77: t = 2 * x - 155; return 0.38722e0 + (0.76260e-2 + (0.85259e-4 + (0.75329e-6 + (0.52979e-8 + (0.29352e-10 + 0.12360e-12 * t) * t) * t) * t) * t) * t; case 78: t = 2 * x - 157; return 0.40282e0 + (0.79762e-2 + (0.89909e-4 + (0.79687e-6 + (0.55989e-8 + (0.30866e-10 + 0.12868e-12 * t) * t) * t) * t) * t) * t; case 79: t = 2 * x - 159; return 0.41914e0 + (0.83456e-2 + (0.94827e-4 + (0.84291e-6 + (0.59154e-8 + (0.32441e-10 + 0.13387e-12 * t) * t) * t) * t) * t) * t; case 80: t = 2 * x - 161; return 0.43621e0 + (0.87352e-2 + (0.10002e-3 + (0.89156e-6 + (0.62480e-8 + (0.34079e-10 + 0.13917e-12 * t) * t) * t) * t) * t) * t; case 81: t = 2 * x - 163; return 0.45409e0 + (0.91463e-2 + (0.10553e-3 + (0.94293e-6 + (0.65972e-8 + (0.35782e-10 + 0.14455e-12 * t) * t) * t) * t) * t) * t; case 82: t = 2 * x - 165; return 0.47282e0 + (0.95799e-2 + (0.11135e-3 + (0.99716e-6 + (0.69638e-8 + (0.37549e-10 + 0.15003e-12 * t) * t) * t) * t) * t) * t; case 83: t = 2 * x - 167; return 0.49243e0 + (0.10037e-1 + (0.11750e-3 + (0.10544e-5 + (0.73484e-8 + (0.39383e-10 + 0.15559e-12 * t) * t) * t) * t) * t) * t; case 84: t = 2 * x - 169; return 0.51298e0 + (0.10520e-1 + (0.12400e-3 + (0.11147e-5 + (0.77517e-8 + (0.41283e-10 + 0.16122e-12 * t) * t) * t) * t) * t) * t; case 85: t = 2 * x - 171; return 0.53453e0 + (0.11030e-1 + (0.13088e-3 + (0.11784e-5 + (0.81743e-8 + (0.43252e-10 + 0.16692e-12 * t) * t) * t) * t) * t) * t; case 86: t = 2 * x - 173; return 0.55712e0 + (0.11568e-1 + (0.13815e-3 + (0.12456e-5 + (0.86169e-8 + (0.45290e-10 + 0.17268e-12 * t) * t) * t) * t) * t) * t; case 87: t = 2 * x - 175; return 0.58082e0 + (0.12135e-1 + (0.14584e-3 + (0.13164e-5 + (0.90803e-8 + (0.47397e-10 + 0.17850e-12 * t) * t) * t) * t) * t) * t; case 88: t = 2 * x - 177; return 0.60569e0 + (0.12735e-1 + (0.15396e-3 + (0.13909e-5 + (0.95651e-8 + (0.49574e-10 + 0.18435e-12 * t) * t) * t) * t) * t) * t; case 89: t = 2 * x - 179; return 0.63178e0 + (0.13368e-1 + (0.16254e-3 + (0.14695e-5 + (0.10072e-7 + (0.51822e-10 + 0.19025e-12 * t) * t) * t) * t) * t) * t; case 90: t = 2 * x - 181; return 0.65918e0 + (0.14036e-1 + (0.17160e-3 + (0.15521e-5 + (0.10601e-7 + (0.54140e-10 + 0.19616e-12 * t) * t) * t) * t) * t) * t; case 91: t = 2 * x - 183; return 0.68795e0 + (0.14741e-1 + (0.18117e-3 + (0.16392e-5 + (0.11155e-7 + (0.56530e-10 + 0.20209e-12 * t) * t) * t) * t) * t) * t; case 92: t = 2 * x - 185; return 0.71818e0 + (0.15486e-1 + (0.19128e-3 + (0.17307e-5 + (0.11732e-7 + (0.58991e-10 + 0.20803e-12 * t) * t) * t) * t) * t) * t; case 93: t = 2 * x - 187; return 0.74993e0 + (0.16272e-1 + (0.20195e-3 + (0.18269e-5 + (0.12335e-7 + (0.61523e-10 + 0.21395e-12 * t) * t) * t) * t) * t) * t; } return 1.0; } int main () { #ifdef __s390x__ { register unsigned long r5 __asm ("r5"); r5 = 0xdeadbeefUL; asm volatile ("":"+r" (r5)); } #endif double d = foo (78.4); if (d < 0.38 || d > 0.42) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58640-2.c ================================================ extern void abort (void); int a[20], b, c; int fn1 () { int d, e, f, g = 0; a[12] = 1; for (e = 0; e < 3; e++) for (d = 0; d < 2; d++) { for (f = 0; f < 2; f++) { g ^= a[12] > 1; if (g) return 0; if (b) break; } for (c = 0; c < 1; c++) a[d] = a[e * 3 + 9]; } return 0; } int main () { fn1 (); if (a[0] != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58640.c ================================================ int a, b, c, d = 1, e; static signed char foo () { int f, g = a; for (f = 1; f < 3; f++) for (; b < 1; b++) { if (d) for (c = 0; c < 4; c++) for (f = 0; f < 3; f++) { for (e = 0; e < 1; e++) a = g; if (f) break; } else if (f) continue; return 0; } return 0; } int main () { foo (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58662.c ================================================ extern void abort (void); int a, c, d; volatile int b; static int foo (int p1, short p2) { return p1 / p2; } int main () { char e; d = foo (a == 0, (0, 35536)); e = d % 14; b = e && c; if (b != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58726.c ================================================ /* PR rtl-optimization/58726 */ int a, c; union { int f1; int f2 : 1; } b; short foo (short p) { return p < 0 ? p : a; } int main () { if (sizeof (short) * __CHAR_BIT__ != 16 || sizeof (int) * __CHAR_BIT__ != 32) return 0; b.f1 = 56374; unsigned short d; int e = b.f2; d = e == 0 ? b.f1 : 0; c = foo (d); if (c != (short) 56374) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58831.c ================================================ #include int a, *b, c, d, f, **i, p, q, *r; short o, j; static int __attribute__((noinline, noclone)) fn1 (int *p1, int **p2) { int **e = &b; for (; p; p++) *p1 = 1; *e = *p2 = &d; assert (r); return c; } static int ** __attribute__((noinline, noclone)) fn2 (void) { for (f = 0; f != 42; f++) { int *g[3] = {0, 0, 0}; for (o = 0; o; o--) for (; a > 1;) { int **h[1] = { &g[2] }; } } return &r; } int main (void) { i = fn2 (); fn1 (b, i); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58943.c ================================================ /* PR c/58943 */ unsigned int x[1] = { 2 }; unsigned int foo (void) { x[0] |= 128; return 1; } int main () { x[0] |= foo (); if (x[0] != 131) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr58984.c ================================================ /* PR tree-optimization/58984 */ struct S { int f0 : 8; int : 6; int f1 : 5; }; struct T { char f0; int : 6; int f1 : 5; }; int a, *c = &a, e, n, b, m; static int foo (struct S p) { const unsigned short *f[36]; for (; e < 2; e++) { const unsigned short **i = &f[0]; *c ^= 1; if (p.f1) { *i = 0; return b; } } return 0; } static int bar (struct T p) { const unsigned short *f[36]; for (; e < 2; e++) { const unsigned short **i = &f[0]; *c ^= 1; if (p.f1) { *i = 0; return b; } } return 0; } int main () { struct S o = { 1, 1 }; foo (o); m = n || o.f0; if (a != 1) __builtin_abort (); e = 0; struct T p = { 1, 1 }; bar (p); m |= n || p.f0; if (a != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr59014-2.c ================================================ /* PR tree-optimization/59014 */ __attribute__((noinline, noclone)) long long int foo (long long int x, long long int y) { if (((int) x | (int) y) != 0) return 6; return x + y; } int main () { if (sizeof (long long) == sizeof (int)) return 0; int shift_half = sizeof (int) * __CHAR_BIT__ / 2; long long int x = (3LL << shift_half) << shift_half; long long int y = (5LL << shift_half) << shift_half; long long int z = foo (x, y); if (z != ((8LL << shift_half) << shift_half)) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr59014.c ================================================ /* PR tree-optimization/59014 */ int a = 2, b, c, d; int foo () { for (;; c++) if ((b > 0) | (a & 1)) ; else { d = a; return 0; } } int main () { foo (); if (d != 2) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr59101.c ================================================ /* PR target/59101 */ __attribute__((noinline, noclone)) int foo (int a) { return (~a & 4102790424LL) > 0 | 6; } int main () { if (foo (0) != 7) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr59221.c ================================================ /* { dg-xfail-if "ptxas crashes" { nvptx-*-* } { "*" } { "-O0" "-Os" } } */ int a = 1, b, d; short e; int main () { for (; b; b++) ; short f = a; int g = 15; e = f ? f : 1 << g; int h = e; d = h == 83647 ? 0 : h; if (d != 1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr59229.c ================================================ int i; __attribute__((noinline, noclone)) void bar (char *p) { if (i < 1 || i > 6) __builtin_abort (); if (__builtin_memcmp (p, "abcdefg", i + 1) != 0) __builtin_abort (); __builtin_memset (p, ' ', 7); } __attribute__((noinline, noclone)) void foo (char *p, unsigned long l) { if (l < 1 || l > 6) return; char buf[7]; __builtin_memcpy (buf, p, l + 1); bar (buf); } int main () { for (i = 0; i < 16; i++) foo ("abcdefghijklmnop", i); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr59358.c ================================================ /* PR tree-optimization/59358 */ __attribute__((noinline, noclone)) int foo (int *x, int y) { int z = *x; if (y > z && y <= 16) while (y > z) z *= 2; return z; } int main () { int i; for (i = 1; i < 17; i++) { int j = foo (&i, 16); int k; if (i >= 8 && i <= 15) k = 16 + (i - 8) * 2; else if (i >= 4 && i <= 7) k = 16 + (i - 4) * 4; else if (i == 3) k = 24; else k = 16; if (j != k) __builtin_abort (); j = foo (&i, 7); if (i >= 7) k = i; else if (i >= 4) k = 8 + (i - 4) * 2; else if (i == 3) k = 12; else k = 8; if (j != k) __builtin_abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr59387.c ================================================ /* PR tree-optimization/59387 */ int a, *d, **e = &d, f; char c; struct S { int f1; } b; int main () { for (a = -19; a; a++) { for (b.f1 = 0; b.f1 < 24; b.f1++) c--; *e = &f; if (!d) return 0; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr59388.c ================================================ /* PR tree-optimization/59388 */ int a; struct S { unsigned int f:1; } b; int main () { a = (0 < b.f) | b.f; return a; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr59413.c ================================================ /* PR tree-optimization/59413 */ typedef unsigned int uint32_t; uint32_t a; int b; int main () { uint32_t c; for (a = 7; a <= 1; a++) { char d = a; c = d; b = a == c; } if (a != 7) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr59643.c ================================================ /* PR tree-optimization/59643 */ #define N 32 __attribute__((noinline, noclone)) void foo (double *a, double *b, double *c, double d, double e, int n) { int i; for (i = 1; i < n - 1; i++) a[i] = d * (b[i] + c[i] + a[i - 1] + a[i + 1]) + e * a[i]; } double expected[] = { 0.0, 10.0, 44.0, 110.0, 232.0, 490.0, 1020.0, 2078.0, 4152.0, 8314.0, 16652.0, 33326.0, 66664.0, 133354.0, 266748.0, 533534.0, 1067064.0, 2134138.0, 4268300.0, 8536622.0, 17073256.0, 34146538.0, 68293116.0, 136586270.0, 273172536.0, 546345082.0, 1092690188.0, 2185380398.0, 4370760808.0, 8741521642.0, 17483043324.0, 6.0 }; int main () { int i; double a[N], b[N], c[N]; if (__DBL_MANT_DIG__ <= 35) return 0; for (i = 0; i < N; i++) { a[i] = (i & 3) * 2.0; b[i] = (i & 7) - 4; c[i] = i & 7; } foo (a, b, c, 2.0, 3.0, N); for (i = 0; i < N; i++) if (a[i] != expected[i]) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr59747.c ================================================ extern void abort (void); extern void exit (int); int a[6], c = 1, d; short e; int __attribute__ ((noinline)) fn1 (int p) { return a[p]; } int main () { if (sizeof (long long) != 8) exit (0); a[0] = 1; if (c) e--; d = e; long long f = e; if (fn1 ((f >> 56) & 1) != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr60003.c ================================================ /* PR tree-optimization/60003 */ /* { dg-require-effective-target indirect_jumps } */ extern void abort (void); unsigned long long jmp_buf[5]; __attribute__((noinline, noclone)) void baz (void) { __builtin_longjmp (&jmp_buf, 1); } void bar (void) { baz (); } __attribute__((noinline, noclone)) int foo (int x) { int a = 0; if (__builtin_setjmp (&jmp_buf) == 0) { while (1) { a = 1; bar (); /* OK if baz () instead */ } } else { if (a == 0) return 0; else return x; } } int main () { if (foo (1) == 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr60017.c ================================================ /* PR target/60017 */ extern void abort (void); struct S0 { short m0; short m1; }; struct S1 { unsigned m0:1; char m1[2][2]; struct S0 m2[2]; }; struct S1 x = { 1, {{2, 3}, {4, 5}}, {{6, 7}, {8, 9}} }; struct S1 func (void) { return x; } int main (void) { struct S1 ret = func (); if (ret.m2[1].m1 != 9) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr60062.c ================================================ /* PR target/60062 */ int a; static void foo (const char *p1, int p2) { if (__builtin_strcmp (p1, "hello") != 0) __builtin_abort (); } static void bar (const char *p1) { if (__builtin_strcmp (p1, "hello") != 0) __builtin_abort (); } __attribute__((optimize (0))) int main () { foo ("hello", a); bar ("hello"); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr60072.c ================================================ /* PR target/60072 */ int c = 1; __attribute__ ((optimize (1))) static int *foo (int *p) { return p; } int main () { *foo (&c) = 2; return c - 2; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr60454.c ================================================ #ifdef __UINT32_TYPE__ typedef __UINT32_TYPE__ uint32_t; #else typedef unsigned uint32_t; #endif #define __fake_const_swab32(x) ((uint32_t)( \ (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \ (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \ (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 8) | \ (((uint32_t)(x) & (uint32_t)0x0000ff00UL) ) | \ (((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24))) /* Previous version of bswap optimization would detect byte swap when none happen. This test aims at catching such wrong detection to avoid regressions. */ __attribute__ ((noinline, noclone)) uint32_t fake_swap32 (uint32_t in) { return __fake_const_swab32 (in); } int main(void) { if (sizeof (uint32_t) * __CHAR_BIT__ != 32) return 0; if (fake_swap32 (0x12345678UL) != 0x78567E12UL) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr60822.c ================================================ /* { dg-require-effective-target int32plus } */ struct X { char fill0[800000]; int a; char fill1[900000]; int b; }; int __attribute__((noinline,noclone)) Avg(struct X *p, int s) { return (s * (long long)(p->a + p->b)) >> 17; } struct X x; int main() { x.a = 1 << 17; x.b = 2 << 17; if (Avg(&x, 1) != 3) __builtin_abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr60960.c ================================================ /* PR tree-optimization/60960 */ typedef unsigned char v4qi __attribute__ ((vector_size (4))); __attribute__((noinline, noclone)) v4qi f1 (v4qi v) { return v / 2; } __attribute__((noinline, noclone)) v4qi f2 (v4qi v) { return v / (v4qi) { 2, 2, 2, 2 }; } __attribute__((noinline, noclone)) v4qi f3 (v4qi x, v4qi y) { return x / y; } int main () { v4qi x = { 5, 5, 5, 5 }; v4qi y = { 2, 2, 2, 2 }; v4qi z = f1 (x); if (__builtin_memcmp (&y, &z, sizeof (y)) != 0) __builtin_abort (); z = f2 (x); if (__builtin_memcmp (&y, &z, sizeof (y)) != 0) __builtin_abort (); z = f3 (x, y); if (__builtin_memcmp (&y, &z, sizeof (y)) != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c ================================================ #ifdef __INT32_TYPE__ typedef __INT32_TYPE__ int32_t; #else typedef int int32_t; #endif #ifdef __UINT32_TYPE__ typedef __UINT32_TYPE__ uint32_t; #else typedef unsigned uint32_t; #endif #define __fake_const_swab32(x) ((uint32_t)( \ (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \ (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \ (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \ (( (int32_t)(x) & (int32_t)0xff000000UL) >> 24))) /* Previous version of bswap optimization failed to consider sign extension and as a result would replace an expression *not* doing a bswap by a bswap. */ __attribute__ ((noinline, noclone)) uint32_t fake_bswap32 (uint32_t in) { return __fake_const_swab32 (in); } int main(void) { if (sizeof (int32_t) * __CHAR_BIT__ != 32) return 0; if (sizeof (uint32_t) * __CHAR_BIT__ != 32) return 0; if (fake_bswap32 (0x87654321) != 0xffffff87) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c ================================================ #ifdef __INT16_TYPE__ typedef __INT16_TYPE__ int16_t; #else typedef short int16_t; #endif #ifdef __UINT32_TYPE__ typedef __UINT32_TYPE__ uint32_t; #else typedef unsigned uint32_t; #endif #define __fake_const_swab32(x) ((uint32_t)( \ (((uint32_t) (x) & (uint32_t)0x000000ffUL) << 24) | \ (((uint32_t)(int16_t)(x) & (uint32_t)0x00ffff00UL) << 8) | \ (((uint32_t) (x) & (uint32_t)0x00ff0000UL) >> 8) | \ (((uint32_t) (x) & (uint32_t)0xff000000UL) >> 24))) /* Previous version of bswap optimization failed to consider sign extension and as a result would replace an expression *not* doing a bswap by a bswap. */ __attribute__ ((noinline, noclone)) uint32_t fake_bswap32 (uint32_t in) { return __fake_const_swab32 (in); } int main(void) { if (sizeof (uint32_t) * __CHAR_BIT__ != 32) return 0; if (sizeof (int16_t) * __CHAR_BIT__ != 16) return 0; if (fake_bswap32 (0x81828384) != 0xff838281) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c ================================================ short a = -1; int b; char c; int main () { c = a; b = a | c; if (b != -1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr61375.c ================================================ #ifdef __UINT64_TYPE__ typedef __UINT64_TYPE__ uint64_t; #else typedef unsigned long long uint64_t; #endif #ifndef __SIZEOF_INT128__ #define __int128 long long #endif /* Some version of bswap optimization would ICE when analyzing a mask constant too big for an uint64_t variable (PR210931). */ __attribute__ ((noinline, noclone)) uint64_t uint128_central_bitsi_ior (unsigned __int128 in1, uint64_t in2) { __int128 mask = (__int128)0xffff << 56; return ((in1 & mask) >> 56) | in2; } int main(int argc, char **argv) { __int128 in = 1; #ifdef __SIZEOF_INT128__ in <<= 64; #endif if (sizeof (uint64_t) * __CHAR_BIT__ != 64) return 0; if (sizeof (unsigned __int128) * __CHAR_BIT__ != 128) return 0; if (uint128_central_bitsi_ior (in, 2) != 0x102) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr61517.c ================================================ int a, b, *c = &a; unsigned short d; int main () { unsigned int e = a; *c = 1; if (!b) { d = e; *c = d | e; } if (a != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr61673.c ================================================ /* PR rtl-optimization/61673 */ char e; __attribute__((noinline, noclone)) void bar (char x) { if (x != 0x54 && x != (char) 0x87) __builtin_abort (); } __attribute__((noinline, noclone)) void foo (const char *x) { char d = x[0]; int c = d; if ((c >= 0 && c <= 0x7f) == 0) e = d; bar (d); } __attribute__((noinline, noclone)) void baz (const char *x) { char d = x[0]; int c = d; if ((c >= 0 && c <= 0x7f) == 0) e = d; } int main () { const char c[] = { 0x54, 0x87 }; e = 0x21; foo (c); if (e != 0x21) __builtin_abort (); foo (c + 1); if (e != (char) 0x87) __builtin_abort (); e = 0x21; baz (c); if (e != 0x21) __builtin_abort (); baz (c + 1); if (e != (char) 0x87) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr61682.c ================================================ /* PR tree-optimization/61682 */ int a, b; static int *c = &b; int main () { int *d = &a; for (a = 0; a < 12; a++) *c |= *d / 9; if (b != 1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr61725.c ================================================ /* PR tree-optimization/61725 */ int main () { int x; for (x = -128; x <= 128; x++) { int a = __builtin_ffs (x); if (x == 0 && a != 0) __builtin_abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr62151.c ================================================ /* PR rtl-optimization/62151 */ int a, c, d, e, f, g, h, i; short b; int fn1 () { b = 0; for (;;) { int j[2]; j[f] = 0; if (h) d = 0; else { for (; f; f++) ; for (a = 0; a < 1; a++) for (;;) { i = b & ((b ^ 1) & 83647) ? b : b - 1; g = 1 ? i : 0; e = j[0]; if (c) break; return 0; } } } } int main () { fn1 (); if (g != -1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr63209.c ================================================ static int Sub(int a, int b) { return b -a; } static unsigned Select(unsigned a, unsigned b, unsigned c) { const int pa_minus_pb = Sub((a >> 8) & 0xff, (b >> 8) & 0xff) + Sub((a >> 0) & 0xff, (b >> 0) & 0xff); return (pa_minus_pb <= 0) ? a : b; } __attribute__((noinline)) unsigned Predictor(unsigned left, const unsigned* const top) { const unsigned pred = Select(top[1], left, top[0]); return pred; } int main(void) { const unsigned top[2] = {0xff7a7a7a, 0xff7a7a7a}; const unsigned left = 0xff7b7b7b; const unsigned pred = Predictor(left, top /*+ 1*/); if (pred == left) return 0; return 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr63302.c ================================================ /* PR tree-optimization/63302 */ #ifdef __SIZEOF_INT128__ #if __SIZEOF_INT128__ * __CHAR_BIT__ == 128 #define USE_INT128 #endif #endif #if __SIZEOF_LONG_LONG__ * __CHAR_BIT__ == 64 #define USE_LLONG #endif #ifdef USE_INT128 __attribute__((noinline, noclone)) int foo (__int128 x) { __int128 v = x & (((__int128) -1 << 63) | 0x7ff); return v == 0 || v == ((__int128) -1 << 63); } #endif #ifdef USE_LLONG __attribute__((noinline, noclone)) int bar (long long x) { long long v = x & (((long long) -1 << 31) | 0x7ff); return v == 0 || v == ((long long) -1 << 31); } #endif int main () { #ifdef USE_INT128 if (foo (0) != 1 || foo (1) != 0 || foo (0x800) != 1 || foo (0x801) != 0 || foo ((__int128) 1 << 63) != 0 || foo ((__int128) -1 << 63) != 1 || foo (((__int128) -1 << 63) | 1) != 0 || foo (((__int128) -1 << 63) | 0x800) != 1 || foo (((__int128) -1 << 63) | 0x801) != 0) __builtin_abort (); #endif #ifdef USE_LLONG if (bar (0) != 1 || bar (1) != 0 || bar (0x800) != 1 || bar (0x801) != 0 || bar (1LL << 31) != 0 || bar (-1LL << 31) != 1 || bar ((-1LL << 31) | 1) != 0 || bar ((-1LL << 31) | 0x800) != 1 || bar ((-1LL << 31) | 0x801) != 0) __builtin_abort (); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr63641.c ================================================ /* PR tree-optimization/63641 */ __attribute__ ((noinline, noclone)) int foo (unsigned char b) { if (0x0 <= b && b <= 0x8) goto lab; if (b == 0x0b) goto lab; if (0x0e <= b && b <= 0x1a) goto lab; if (0x1c <= b && b <= 0x1f) goto lab; return 0; lab: return 1; } __attribute__ ((noinline, noclone)) int bar (unsigned char b) { if (0x0 <= b && b <= 0x8) goto lab; if (b == 0x0b) goto lab; if (0x0e <= b && b <= 0x1a) goto lab; if (0x3c <= b && b <= 0x3f) goto lab; return 0; lab: return 1; } char tab1[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1 }; char tab2[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1 }; int main () { int i; asm volatile ("" : : : "memory"); for (i = 0; i < 256; i++) if (foo (i) != (i < 32 ? tab1[i] : 0)) __builtin_abort (); for (i = 0; i < 256; i++) if (bar (i) != (i < 64 ? tab2[i] : 0)) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr63659.c ================================================ /* PR rtl-optimization/63659 */ int a, b, c, *d = &b, g, h, i; unsigned char e; char f; int main () { while (a) { for (a = 0; a; a++) for (; c; c++) ; if (i) break; } char j = c, k = -1, l; l = g = j >> h; f = l == 0 ? k : k % l; e = 0 ? 0 : f; *d = e; if (b != 255) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr63843.c ================================================ /* PR rtl-optimization/63843 */ static inline __attribute__ ((always_inline)) unsigned short foo (unsigned short v) { return (v << 8) | (v >> 8); } unsigned short __attribute__ ((noinline, noclone, hot)) bar (unsigned char *x) { unsigned int a; unsigned short b; __builtin_memcpy (&a, &x[0], sizeof (a)); a ^= 0x80808080U; __builtin_memcpy (&x[0], &a, sizeof (a)); __builtin_memcpy (&b, &x[2], sizeof (b)); return foo (b); } int main () { unsigned char x[8] = { 0x01, 0x01, 0x01, 0x01 }; if (__CHAR_BIT__ == 8 && sizeof (short) == 2 && sizeof (int) == 4 && bar (x) != 0x8181U) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr64006.c ================================================ /* PR tree-optimization/64006 */ int v; long __attribute__ ((noinline, noclone)) test (long *x, int y) { int i; long s = 1; for (i = 0; i < y; i++) if (__builtin_mul_overflow (s, x[i], &s)) v++; return s; } int main () { long d[7] = { 975, 975, 975, 975, 975, 975, 975 }; long r = test (d, 7); if (sizeof (long) * __CHAR_BIT__ == 64 && v != 1) __builtin_abort (); else if (sizeof (long) * __CHAR_BIT__ == 32 && v != 4) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr64255.c ================================================ /* PR rtl-optimization/64255 */ __attribute__((noinline, noclone)) void bar (long i, unsigned long j) { if (i != 1 || j != 1) __builtin_abort (); } __attribute__((noinline, noclone)) void foo (long i) { unsigned long j; if (!i) return; j = i >= 0 ? (unsigned long) i : - (unsigned long) i; if ((i >= 0 ? (unsigned long) i : - (unsigned long) i) != j) __builtin_abort (); bar (i, j); } int main () { foo (1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr64260.c ================================================ /* PR rtl-optimization/64260 */ int a = 1, b; void foo (char p) { int t = 0; for (; b < 1; b++) { int *s = &a; if (--t) *s &= p; *s &= 1; } } int main () { foo (0); if (a != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr64682.c ================================================ /* PR rtl-optimization/64682 */ int a, b = 1; __attribute__((noinline, noclone)) void foo (int x) { if (x != 5) __builtin_abort (); } int main () { int i; for (i = 0; i < 56; i++) for (; a; a--) ; int *c = &b; if (*c) *c = 1 % (unsigned int) *c | 5; foo (b); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr64718.c ================================================ static int __attribute__ ((noinline, noclone)) swap (int x) { return (unsigned short) ((unsigned short) x << 8 | (unsigned short) x >> 8); } static int a = 0x1234; int main (void) { int b = 0x1234; if (swap (a) != 0x3412) __builtin_abort (); if (swap (b) != 0x3412) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr64756.c ================================================ /* PR rtl-optimization/64756 */ int a, *tmp, **c = &tmp; volatile int d; static int *volatile *e = &tmp; unsigned int f; static void fn1 (int *p) { int g; for (; f < 1; f++) for (g = 1; g >= 0; g--) { d || d; *c = p; if (tmp != &a) __builtin_abort (); *e = 0; } } int main () { fn1 (&a); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr64957.c ================================================ /* PR rtl-optimization/64957 */ __attribute__((noinline, noclone)) int foo (int b) { return (((b ^ 5) | 1) ^ 5) | 1; } __attribute__((noinline, noclone)) int bar (int b) { return (((b ^ ~5) & ~1) ^ ~5) & ~1; } int main () { int i; for (i = 0; i < 16; i++) if (foo (i) != (i | 1) || bar (i) != (i & ~1)) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr64979.c ================================================ /* PR target/64979 */ #include void __attribute__((noinline, noclone)) bar (int x, va_list *ap) { if (ap) { int i; for (i = 0; i < 10; i++) if (i != va_arg (*ap, int)) __builtin_abort (); if (va_arg (*ap, double) != 0.5) __builtin_abort (); } } void __attribute__((noinline, noclone)) foo (int x, ...) { va_list ap; int n; va_start (ap, x); n = va_arg (ap, int); bar (x, (va_list *) ((n == 0) ? ((void *) 0) : &ap)); va_end (ap); } int main () { foo (100, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0.5); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65053-1.c ================================================ /* PR tree-optimization/65053 */ int i; __attribute__ ((noinline, noclone)) unsigned int foo (void) { return 0; } int main () { unsigned int u = -1; if (u == -1) { unsigned int n = foo (); if (n > 0) u = n - 1; } while (u != -1) { asm ("" : "+g" (u)); u = -1; i = 1; } if (i) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65053-2.c ================================================ /* PR tree-optimization/65053 */ int i; unsigned int x; int main () { asm volatile ("" : "+g" (x)); unsigned int n = x; unsigned int u = 32; if (n >= 32) __builtin_abort (); if (n != 0) u = n + 32; while (u != 32) { asm ("" : : "g" (u)); u = 32; i = 1; } if (i) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65170.c ================================================ /* PR tree-optimization/65170 */ #ifdef __SIZEOF_INT128__ typedef unsigned __int128 V; typedef unsigned long long int H; #else typedef unsigned long long int V; typedef unsigned int H; #endif __attribute__((noinline, noclone)) void foo (V b, V c) { V a; b &= (H) -1; c &= (H) -1; a = b * c; if (a != 1) __builtin_abort (); } int main () { foo (1, 1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65215-1.c ================================================ /* PR tree-optimization/65215 */ static inline unsigned int foo (unsigned int x) { return (x >> 24) | ((x >> 8) & 0xff00) | ((x << 8) & 0xff0000) | (x << 24); } __attribute__((noinline, noclone)) unsigned int bar (unsigned long long *x) { return foo (*x); } int main () { if (__CHAR_BIT__ != 8 || sizeof (unsigned int) != 4 || sizeof (unsigned long long) != 8) return 0; unsigned long long l = foo (0xdeadbeefU) | 0xfeedbea800000000ULL; if (bar (&l) != 0xdeadbeefU) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65215-2.c ================================================ /* PR tree-optimization/65215 */ static inline unsigned int foo (unsigned int x) { return (x >> 24) | ((x >> 8) & 0xff00) | ((x << 8) & 0xff0000) | (x << 24); } __attribute__((noinline, noclone)) unsigned long long bar (unsigned long long *x) { return ((unsigned long long) foo (*x) << 32) | foo (*x >> 32); } int main () { if (__CHAR_BIT__ != 8 || sizeof (unsigned int) != 4 || sizeof (unsigned long long) != 8) return 0; unsigned long long l = foo (0xfeedbea8U) | ((unsigned long long) foo (0xdeadbeefU) << 32); if (bar (&l) != 0xfeedbea8deadbeefULL) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65215-3.c ================================================ /* PR tree-optimization/65215 */ struct S { unsigned long long l1 : 24, l2 : 8, l3 : 32; }; static inline unsigned int foo (unsigned int x) { return (x >> 24) | ((x >> 8) & 0xff00) | ((x << 8) & 0xff0000) | (x << 24); } __attribute__((noinline, noclone)) unsigned long long bar (struct S *x) { unsigned long long x1 = foo (((unsigned int) x->l1 << 8) | x->l2); unsigned long long x2 = foo (x->l3); return (x2 << 32) | x1; } int main () { if (__CHAR_BIT__ != 8 || sizeof (unsigned int) != 4 || sizeof (unsigned long long) != 8) return 0; struct S s = { 0xdeadbeU, 0xefU, 0xfeedbea8U }; unsigned long long l = bar (&s); if (foo (l >> 32) != s.l3 || (foo (l) >> 8) != s.l1 || (foo (l) & 0xff) != s.l2) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65215-4.c ================================================ /* PR tree-optimization/65215 */ struct S { unsigned long long l1 : 48; }; static inline unsigned int foo (unsigned int x) { return (x >> 24) | ((x >> 8) & 0xff00) | ((x << 8) & 0xff0000) | (x << 24); } __attribute__((noinline, noclone)) unsigned int bar (struct S *x) { return foo (x->l1); } int main () { if (__CHAR_BIT__ != 8 || sizeof (unsigned int) != 4 || sizeof (unsigned long long) != 8) return 0; struct S s; s.l1 = foo (0xdeadbeefU) | (0xfeedULL << 32); if (bar (&s) != 0xdeadbeefU) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65215-5.c ================================================ /* PR tree-optimization/65215 */ __attribute__((noinline, noclone)) unsigned int foo (unsigned char *p) { return ((unsigned int) p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; } __attribute__((noinline, noclone)) unsigned int bar (unsigned char *p) { return ((unsigned int) p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]; } struct S { unsigned int a; unsigned char b[5]; }; int main () { struct S s = { 1, { 2, 3, 4, 5, 6 } }; if (__CHAR_BIT__ != 8 || sizeof (unsigned int) != 4) return 0; if (foo (&s.b[1]) != 0x03040506U || bar (&s.b[1]) != 0x06050403U) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65216.c ================================================ /* PR tree-optimization/65216 */ int a, b = 62, e; volatile int c, d; int main () { int f = 0; for (a = 0; a < 2; a++) { b &= (8 ^ f) & 1; for (e = 0; e < 6; e++) if (c) f = d; } if (b != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65369.c ================================================ /* PR tree-optimization/65369 */ #include static const char data[] = "12345678901234567890123456789012345678901234567890" "123456789012345678901234567890"; __attribute__ ((noinline)) static void foo (const unsigned int *buf) { if (__builtin_memcmp (buf, data, 64)) __builtin_abort (); } __attribute__ ((noinline)) static void bar (const unsigned char *block) { uint32_t buf[16]; __builtin_memcpy (buf + 0, block + 0, 4); __builtin_memcpy (buf + 1, block + 4, 4); __builtin_memcpy (buf + 2, block + 8, 4); __builtin_memcpy (buf + 3, block + 12, 4); __builtin_memcpy (buf + 4, block + 16, 4); __builtin_memcpy (buf + 5, block + 20, 4); __builtin_memcpy (buf + 6, block + 24, 4); __builtin_memcpy (buf + 7, block + 28, 4); __builtin_memcpy (buf + 8, block + 32, 4); __builtin_memcpy (buf + 9, block + 36, 4); __builtin_memcpy (buf + 10, block + 40, 4); __builtin_memcpy (buf + 11, block + 44, 4); __builtin_memcpy (buf + 12, block + 48, 4); __builtin_memcpy (buf + 13, block + 52, 4); __builtin_memcpy (buf + 14, block + 56, 4); __builtin_memcpy (buf + 15, block + 60, 4); foo (buf); } int main () { unsigned char input[sizeof data + 16] __attribute__((aligned (16))); __builtin_memset (input, 0, sizeof input); __builtin_memcpy (input + 1, data, sizeof data); bar (input + 1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65401.c ================================================ /* PR rtl-optimization/65401 */ struct S { unsigned short s[64]; }; __attribute__((noinline, noclone)) void foo (struct S *x) { unsigned int i; unsigned char *s; s = (unsigned char *) x->s; for (i = 0; i < 64; i++) x->s[i] = s[i * 2] | (s[i * 2 + 1] << 8); } __attribute__((noinline, noclone)) void bar (struct S *x) { unsigned int i; unsigned char *s; s = (unsigned char *) x->s; for (i = 0; i < 64; i++) x->s[i] = (s[i * 2] << 8) | s[i * 2 + 1]; } int main () { unsigned int i; struct S s; if (sizeof (unsigned short) != 2) return 0; for (i = 0; i < 64; i++) s.s[i] = i + ((64 - i) << 8); foo (&s); #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ for (i = 0; i < 64; i++) if (s.s[i] != (64 - i) + (i << 8)) __builtin_abort (); #elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ for (i = 0; i < 64; i++) if (s.s[i] != i + ((64 - i) << 8)) __builtin_abort (); #endif for (i = 0; i < 64; i++) s.s[i] = i + ((64 - i) << 8); bar (&s); #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ for (i = 0; i < 64; i++) if (s.s[i] != (64 - i) + (i << 8)) __builtin_abort (); #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ for (i = 0; i < 64; i++) if (s.s[i] != i + ((64 - i) << 8)) __builtin_abort (); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65418-1.c ================================================ /* PR tree-optimization/65418 */ __attribute__((noinline, noclone)) int foo (int x) { if (x == -216 || x == -132 || x == -218 || x == -146) return 1; return 0; } int main () { volatile int i; for (i = -230; i < -120; i++) if (foo (i) != (i == -216 || i == -132 || i == -218 || i == -146)) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65418-2.c ================================================ /* PR tree-optimization/65418 */ __attribute__((noinline, noclone)) int foo (int x) { if (x == -216 || x == -211 || x == -218 || x == -205 || x == -223) return 1; return 0; } int main () { volatile int i; for (i = -230; i < -200; i++) if (foo (i) != (i == -216 || i == -211 || i == -218 || i == -205 || i == -223)) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65427.c ================================================ /* PR tree-optimization/65427 */ typedef int V __attribute__ ((vector_size (8 * sizeof (int)))); V a, b, c, d, e, f; __attribute__((noinline, noclone)) void foo (int x, int y) { do { if (x) d = a ^ c; else d = a ^ b; } while (y); } int main () { a = (V) { 1, 2, 3, 4, 5, 6, 7, 8 }; b = (V) { 0x40, 0x80, 0x40, 0x80, 0x40, 0x80, 0x40, 0x80 }; e = (V) { 0x41, 0x82, 0x43, 0x84, 0x45, 0x86, 0x47, 0x88 }; foo (0, 0); if (__builtin_memcmp (&d, &e, sizeof (V)) != 0) __builtin_abort (); c = (V) { 0x80, 0x40, 0x80, 0x40, 0x80, 0x40, 0x80, 0x40 }; f = (V) { 0x81, 0x42, 0x83, 0x44, 0x85, 0x46, 0x87, 0x48 }; foo (1, 0); if (__builtin_memcmp (&d, &f, sizeof (V)) != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65648.c ================================================ /* PR target/65648 */ int a = 0, *b = 0, c = 0; static int d = 0; short e = 1; static long long f = 0; long long *i = &f; unsigned char j = 0; __attribute__((noinline, noclone)) void foo (int x, int *y) { asm volatile ("" : : "r" (x), "r" (y) : "memory"); } __attribute__((noinline, noclone)) void bar (const char *x, long long y) { asm volatile ("" : : "r" (x), "r" (&y) : "memory"); if (y != 0) __builtin_abort (); } int main () { int k = 0; b = &k; j = (!a) - (c <= e); *i = j; foo (a, &k); bar ("", f); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr65956.c ================================================ /* PR target/65956 */ struct A { char *a; int b; long long c; }; char v[3]; __attribute__((noinline, noclone)) void fn1 (char *x, char *y) { if (x != &v[1] || y != &v[2]) __builtin_abort (); v[1]++; } __attribute__((noinline, noclone)) int fn2 (char *x) { asm volatile ("" : "+g" (x) : : "memory"); return x == &v[0]; } __attribute__((noinline, noclone)) void fn3 (const char *x) { if (x[0] != 0) __builtin_abort (); } static struct A foo (const char *x, struct A y, struct A z) { struct A r = { 0, 0, 0 }; if (y.b && z.b) { if (fn2 (y.a) && fn2 (z.a)) switch (x[0]) { case '|': break; default: fn3 (x); } fn1 (y.a, z.a); } return r; } __attribute__((noinline, noclone)) int bar (int x, struct A *y) { switch (x) { case 219: foo ("+", y[-2], y[0]); case 220: foo ("-", y[-2], y[0]); } } int main () { struct A a[3] = { { &v[1], 1, 1LL }, { &v[0], 0, 0LL }, { &v[2], 2, 2LL } }; bar (220, a + 2); if (v[1] != 1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr66187.c ================================================ /* PR tree-optimization/66187 */ int a = 1, e = -1; short b, f; int main () { f = e; int g = b < 0 ? 0 : f + b; if ((g & -4) < 0) a = 0; if (a) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr66233.c ================================================ /* PR tree-optimization/66233 */ unsigned int v[8]; __attribute__((noinline, noclone)) void foo (void) { int i; for (i = 0; i < 8; i++) v[i] = (float) i; } int main () { unsigned int i; foo (); for (i = 0; i < 8; i++) if (v[i] != i) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr66556.c ================================================ /* { dg-do run } */ extern void abort (void); struct { unsigned f2; unsigned f3 : 15; unsigned f5 : 3; short f6; } b = {0x7f8000, 6, 5, 0}, g = {8, 0, 5, 0}; short d, l; int a, c, h = 8; volatile char e[237] = {4}; short *f = &d; short i[5] = {3}; char j; int *k = &c; int fn1 (unsigned p1) { return -p1; } void fn2 (char p1) { a = p1; e[0]; } short fn3 () { *k = 4; return *f; } int main () { unsigned m; short *n = &i[4]; m = fn1 ((h && j) <= b.f5); l = m > g.f3; *n = 3; fn2 (b.f2 >> 15); if ((a & 0xff) != 0xff) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr66757.c ================================================ /* PR tree-optimization/66757 */ /* Testcase by Zhendong Su */ int a, b; int main (void) { unsigned int t = (unsigned char) (~b); if ((t ^ 1) / 255) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr67037.c ================================================ long (*extfunc)(); static inline void lstrcpynW( short *d, const short *s, int n ) { unsigned int count = n; while ((count > 1) && *s) { count--; *d++ = *s++; } if (count) *d = 0; } int __attribute__((noinline,noclone)) badfunc(int u0, int u1, int u2, int u3, short *fsname, unsigned int fsname_len) { static const short ntfsW[] = {'N','T','F','S',0}; char superblock[2048+3300]; int ret = 0; short *p; if (extfunc()) return 0; p = (void *)extfunc(); if (p != 0) goto done; extfunc(superblock); lstrcpynW(fsname, ntfsW, fsname_len); ret = 1; done: return ret; } static long f() { return 0; } int main() { short buf[6]; extfunc = f; return !badfunc(0, 0, 0, 0, buf, 6); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr67226.c ================================================ struct assembly_operand { int type, value, symtype, symflags, marker; }; struct assembly_operand to_input, from_input; void __attribute__ ((__noinline__, __noclone__)) assemblez_1 (int internal_number, struct assembly_operand o1) { if (o1.type != from_input.type) __builtin_abort (); } void __attribute__ ((__noinline__, __noclone__)) t0 (struct assembly_operand to, struct assembly_operand from) { if (to.value == 0) assemblez_1 (32, from); else __builtin_abort (); } int main (void) { to_input.value = 0; to_input.type = 1; to_input.symtype = 2; to_input.symflags = 3; to_input.marker = 4; from_input.value = 5; from_input.type = 6; from_input.symtype = 7; from_input.symflags = 8; from_input.marker = 9; t0 (to_input, from_input); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr67714.c ================================================ unsigned int b; int c; signed char fn1 () { signed char d; for (int i = 0; i < 1; i++) d = -15; return d; } int main (void) { for (c = 0; c < 1; c++) b = 0; char e = fn1 (); signed char f = e ^ b; volatile int g = (int) f; if (g != -15) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr67781.c ================================================ #ifdef __UINT32_TYPE__ typedef __UINT32_TYPE__ uint32_t; #else typedef unsigned uint32_t; #endif #ifdef __UINT8_TYPE__ typedef __UINT8_TYPE__ uint8_t; #else typedef unsigned char uint8_t; #endif struct { uint32_t a; uint8_t b; } s = { 0x123456, 0x78 }; int pr67781() { uint32_t c = (s.a << 8) | s.b; return c; } int main () { if (sizeof (uint32_t) * __CHAR_BIT__ != 32) return 0; if (pr67781 () != 0x12345678) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr67929_1.c ================================================ int __attribute__ ((noinline, noclone)) foo (float a) { return a * 4.9f; } int main (void) { if (foo (10.0f) != 49) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68143_1.c ================================================ #define NULL 0 struct stuff { int a; int b; int c; int d; int e; char *f; int g; }; void __attribute__ ((noinline)) bar (struct stuff *x) { if (x->g != 2) __builtin_abort (); } int main (int argc, char** argv) { struct stuff x = {0, 0, 0, 0, 0, NULL, 0}; x.a = 100; x.d = 100; x.g = 2; /* Struct should now look like {100, 0, 0, 100, 0, 0, 0, 2}. */ bar (&x); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68185.c ================================================ int a, b, d = 1, e, f, o, u, w = 1, z; short c, q, t; int main () { char g; for (; d; d--) { while (o) for (; e;) { c = b; int h = o = z; for (; u;) for (; a;) ; } if (t < 1) g = w; f = g; g && (q = 1); } if (q != 1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68249.c ================================================ /* PR rtl-optimization/68249 */ int a, b, c, g, k, l, m, n; char h; void fn1 () { for (; k; k++) { m = b || c < 0 || c > 1 ? : c; g = l = n || m < 0 || (m > 1) > 1 >> m ? : 1 << m; } l = b + 1; for (; b < 1; b++) h = a + 1; } int main () { char j; for (; a < 1; a++) { fn1 (); if (h) j = h; if (j > c) g = 0; } if (h != 1) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68250.c ================================================ /* PR rtl-optimization/68250 */ signed char a, b, h, k, l, m, o; short c, d, n; int e, f, g, j, q; void fn1 (void) { int p = b || a; n = o > 0 || d > 1 >> o ? d : d << o; for (; j; j++) m = c < 0 || m || c << p; l = f + 1; for (; f < 1; f = 1) k = h + 1; } __attribute__((noinline, noclone)) void fn2 (int k) { if (k != 1) __builtin_abort (); } int main () { signed char i; for (; e < 1; e++) { fn1 (); if (k) i = k; if (i > q) g = 0; } fn2 (k); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68321.c ================================================ /* PR rtl-optimization/68321 */ int e = 1, u = 5, t2, t5, i, k; int a[1], b, m; char n, t; int fn1 (int p1) { int g[1]; for (;;) { if (p1 / 3) for (; t5;) u || n; t2 = p1 & 4; if (b + 1) return 0; u = g[0]; } } int main () { for (; e >= 0; e--) { char c; if (!m) c = t; fn1 (c); } if (a[t2] != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68328.c ================================================ int a, b, c = 1, d = 1, e; __attribute__ ((noinline, noclone)) int foo (void) { asm volatile ("":::"memory"); return 4195552; } __attribute__ ((noinline, noclone)) void bar (int x, int y) { asm volatile (""::"g" (x), "g" (y):"memory"); if (y == 0) __builtin_abort (); } int baz (int x) { char g, h; int i, j; foo (); for (;;) { if (c) h = d; g = h < x ? h : 0; i = (signed char) ((unsigned char) (g - 120) ^ 1); j = i > 97; if (a - j) bar (0x123456, 0); if (!b) return e; } } int main () { baz (2); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68376-1.c ================================================ /* PR rtl-optimization/68376 */ int a, b, c = 1; signed char d; int main () { for (; a < 1; a++) for (; b < 1; b++) { signed char e = ~d; if (d < 1) e = d; d = e; if (!c) __builtin_abort (); } if (d != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68376-2.c ================================================ /* PR rtl-optimization/68376 */ extern void abort (void); __attribute__((noinline, noclone)) int f1 (int x) { return x < 0 ? ~x : x; } __attribute__((noinline, noclone)) int f2 (int x) { return x < 0 ? x : ~x; } __attribute__((noinline, noclone)) int f3 (int x) { return x <= 0 ? ~x : x; } __attribute__((noinline, noclone)) int f4 (int x) { return x <= 0 ? x : ~x; } __attribute__((noinline, noclone)) int f5 (int x) { return x >= 0 ? ~x : x; } __attribute__((noinline, noclone)) int f6 (int x) { return x >= 0 ? x : ~x; } __attribute__((noinline, noclone)) int f7 (int x) { return x > 0 ? ~x : x; } __attribute__((noinline, noclone)) int f8 (int x) { return x > 0 ? x : ~x; } int main () { if (f1 (5) != 5 || f1 (-5) != 4 || f1 (0) != 0) abort (); if (f2 (5) != -6 || f2 (-5) != -5 || f2 (0) != -1) abort (); if (f3 (5) != 5 || f3 (-5) != 4 || f3 (0) != -1) abort (); if (f4 (5) != -6 || f4 (-5) != -5 || f4 (0) != 0) abort (); if (f5 (5) != -6 || f5 (-5) != -5 || f5 (0) != -1) abort (); if (f6 (5) != 5 || f6 (-5) != 4 || f6 (0) != 0) abort (); if (f7 (5) != -6 || f7 (-5) != -5 || f7 (0) != 0) abort (); if (f8 (5) != 5 || f8 (-5) != 4 || f8 (0) != -1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68381.c ================================================ /* { dg-options "-O -fexpensive-optimizations -fno-tree-bit-ccp" } */ __attribute__ ((noinline, noclone)) int foo (unsigned short x, unsigned short y) { int r; if (__builtin_mul_overflow (x, y, &r)) __builtin_abort (); return r; } int main (void) { int x = 1; int y = 2; if (foo (x, y) != x * y) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68390.c ================================================ /* { dg-do run } */ /* { dg-options "-O2" } */ __attribute__ ((noinline)) double direct(int x, ...) { return x*x; } __attribute__ ((noinline)) double broken(double (*indirect)(int x, ...), int v) { return indirect(v); } int main () { double d1, d2; int i = 2; d1 = broken (direct, i); if (d1 != i*i) { __builtin_abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68506.c ================================================ /* { dg-options "-fno-builtin-abort" } */ int a, b, m, n, o, p, s, u, i; char c, q, y; short d; unsigned char e; static int f, h; static short g, r, v; unsigned t; extern void abort (); int fn1 (int p1) { return a ? p1 : p1 + a; } unsigned char fn2 (unsigned char p1, int p2) { return p2 >= 2 ? p1 : p1 >> p2; } static short fn3 () { int w, x = 0; for (; p < 31; p++) { s = fn1 (c | ((1 && c) == c)); t = fn2 (s, x); c = (unsigned) c > -(unsigned) ((o = (m = d = t) == p) <= 4UL) && n; v = -c; y = 1; for (; y; y++) e = v == 1; d = 0; for (; h != 2;) { for (;;) { if (!m) abort (); r = 7 - f; x = e = i | r; q = u * g; w = b == q; if (w) break; } break; } } return x; } int main () { fn3 (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68532.c ================================================ /* { dg-options "-O2 -ftree-vectorize -fno-vect-cost-model" } */ /* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */ #define SIZE 128 unsigned short _Alignas (16) in[SIZE]; __attribute__ ((noinline)) int test (unsigned short sum, unsigned short *in, int x) { for (int j = 0; j < SIZE; j += 8) sum += in[j] * x; return sum; } int main () { for (int i = 0; i < SIZE; i++) in[i] = i; if (test (0, in, 1) != 960) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68624.c ================================================ int b, c, d, e = 1, f, g, h, j; static int fn1 () { int a = c; if (h) return 9; g = (c || b) % e; if ((g || f) && b) return 9; e = d; for (c = 0; c > -4; c--) ; if (d) c--; j = c; return d; } int main () { fn1 (); if (c != -4) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68648.c ================================================ int __attribute__ ((noinline)) foo (void) { return 123; } int __attribute__ ((noinline)) bar (void) { int c = 1; c |= 4294967295 ^ (foo () | 4073709551608); return c; } int main () { if (bar () != 0x83fd4005) __builtin_abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68841.c ================================================ static inline int foo (int *x, int y) { int z = *x; while (y > z) z *= 2; return z; } int main () { int i; for (i = 1; i < 17; i++) { int j; int k; j = foo (&i, 7); if (i >= 7) k = i; else if (i >= 4) k = 8 + (i - 4) * 2; else if (i == 3) k = 12; else k = 8; if (j != k) __builtin_abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr68911.c ================================================ extern void abort (void); char a; int b, c; short d; int main () { unsigned e = 2; unsigned timeout = 0; for (; c < 2; c++) { int f = ~e / 7; if (f) a = e = ~(b && d); while (e < 94) { e++; if (++timeout > 100) goto die; } } return 0; die: abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr69097-1.c ================================================ /* PR tree-optimization/69097 */ int a, b; unsigned int c; int main () { int d = b; b = ~(~a + (~d | b)); a = ~(~c >> b); c = a % b; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr69097-2.c ================================================ /* PR tree-optimization/69097 */ __attribute__((noinline, noclone)) int f1 (int x, int y) { return x % y; } __attribute__((noinline, noclone)) int f2 (int x, int y) { return x % -y; } __attribute__((noinline, noclone)) int f3 (int x, int y) { int z = -y; return x % z; } int main () { if (f1 (-__INT_MAX__ - 1, 1) != 0 || f2 (-__INT_MAX__ - 1, -1) != 0 || f3 (-__INT_MAX__ - 1, -1) != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr69320-1.c ================================================ #include int a, b, d, f; char c; static int *e = &d; int main() { int g = -1L; *e = g; c = 4; for (; c >= 14; c++) *e = 1; f = a == 0; *e ^= f; int h = ~d; if (d) b = h; if (h) exit (0); abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr69320-2.c ================================================ #include int a, *c, d, e, g, f; short b; int fn1 () { int h = d != 10; if (h > g) asm volatile ("" : : : "memory"); if (h == 10) { int *i = 0; a = 0; for (; a < 7; a++) for (; *i;) ; } else { b = e / h; return f; } c = &h; abort (); } int main () { fn1 (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr69320-3.c ================================================ #include static int a[40] = {7, 5, 3, 3, 0, 0, 3}; short b; int c = 5; int main() { b = 0; for (; b <= 3; b++) if (a[b + 6] ^ (0 || c)) ; else break; if (b != 4) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr69320-4.c ================================================ #include int a; char b, d; short c; short fn1(int p1, int p2) { return p2 >= 2 ? p1 : p1 > p2; } int main() { int *e = &a, *f = &a; b = 1; for (; b <= 9; b++) { c = *e != 5 || d; *f = fn1(c || b, a); } if ((long long) a != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr69403.c ================================================ /* PR target/69403. */ int a, b, c; __attribute__ ((__noinline__)) int fn1 () { if ((b | (a != (a & c))) == 1) __builtin_abort (); return 0; } int main (void) { a = 5; c = 1; b = 6; return fn1 (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr69447.c ================================================ typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; typedef unsigned long long u64; u64 __attribute__((noinline, noclone)) foo(u8 u8_0, u16 u16_0, u64 u64_0, u8 u8_1, u16 u16_1, u64 u64_1, u64 u64_2, u8 u8_3, u64 u64_3) { u64_1 *= 0x7730; u64_3 *= u64_3; u16_1 |= u64_3; u64_3 -= 2; u8_3 /= u64_2; u8_0 |= 3; u64_3 %= u8_0; u8_0 -= 1; return u8_0 + u16_0 + u64_0 + u8_1 + u16_1 + u64_1 + u8_3 + u64_3; } int main() { unsigned x = foo(1, 1, 1, 1, 1, 1, 1, 1, 1); if (x != 0x7737) __builtin_abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr69691.c ================================================ /* PR rtl-optimization/69691 */ char u[] = { 46, 97, 99, 104, 52, 0 }; char *v[] = { u, 0 }; struct S { char a[10]; struct S *b[31]; }; struct S r[7], *r2 = r; static struct S *w = 0; __attribute__((noinline, noclone)) int fn (int x) { if (__builtin_strchr (u, x) || x == 96) return x; __builtin_abort (); } __attribute__((noinline, noclone)) int foo (char x) { if (x == 0) __builtin_abort (); if (fn (x) >= 96 && fn (x) <= 122) return (fn (x) - 96); else if (x == 46) return 0; else { __builtin_printf ("foo %d\n", x); return -1; } } __attribute__((noinline, noclone)) void bar (char **x) { char **b, c, *d, e[500], *f, g[10]; int z, l, h, i; struct S *s; w = r2++; for (b = x; *b; b++) { __builtin_strcpy (e, *b); f = e; do { d = __builtin_strchr (f, 32); if (d) *d = 0; l = __builtin_strlen (f); h = 0; s = w; __builtin_memset (g, 0, sizeof (g)); for (z = 0; z < l; z++) { c = f[z]; if (c >= 48 && c <= 57) g[h] = c - 48; else { i = foo (c); if (!s->b[i]) { s->b[i] = r2++; if (r2 == &r[7]) __builtin_abort (); } s = s->b[i]; h++; } } __builtin_memcpy (s->a, g, 10); if (d) f = d + 1; } while (d); } } __attribute__((noinline, noclone)) void baz (char *x) { char a[300], b[300]; int z, y, t, l; struct S *s; l = __builtin_strlen (x); *a = 96; for (z = 0; z < l; z++) { a[z + 1] = fn ((unsigned int) x[z]); if (foo (a[z + 1]) <= 0) return; } a[l + 1] = 96; l += 2; __builtin_memset (b, 0, l + 2); if (!w) return; for (z = 0; z < l; z++) { s = w; for (y = z; y < l; y++) { s = s->b[foo (a[y])]; if (!s) break; for (t = 0; t <= y - z + 2; t++) if (s->a[t] > b[z + t]) b[z + t] = s->a[t]; } } for (z = 3; z < l - 2; z++) if ((b[z] & 1) == 1) asm (""); } int main () { bar (v); char c[] = { 97, 97, 97, 97, 97, 0 }; baz (c); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr70005.c ================================================ unsigned char a = 6; int b, c; static void fn1 () { int i = a > 1 ? 1 : a, j = 6 & (c = a && (b = a)); int d = 0, e = a, f = ~c, g = b || a; unsigned char h = ~a; if (a) f = j; if (h && g) d = a; i = -~(f * d * h) + c && (e || i) ^ f; if (i != 1) __builtin_abort (); } int main () { fn1 (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr70127.c ================================================ /* PR tree-optimization/70127 */ struct S { int f; signed int g : 2; } a[1], c = {5, 1}, d; short b; __attribute__((noinline, noclone)) void foo (int x) { if (x != 1) __builtin_abort (); } int main () { while (b++ <= 0) { struct S e = {1, 1}; d = e = a[0] = c; } foo (a[0].g); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr70222-1.c ================================================ /* PR rtl-optimization/70222 */ int a = 1; unsigned int b = 2; int c = 0; int d = 0; void foo () { int e = ((-(c >= c)) < b) > ((int) (-1ULL >> ((a / a) * 15))); d = -e; } __attribute__((noinline, noclone)) void bar (int x) { if (x != -1) __builtin_abort (); } int main () { #if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8 foo (); bar (d); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr70222-2.c ================================================ /* PR rtl-optimization/70222 */ #if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8 __attribute__((noinline, noclone)) unsigned int foo (int x) { unsigned long long y = -1ULL >> x; return (unsigned int) y >> 31; } #endif int main () { #if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8 if (foo (15) != 1 || foo (32) != 1 || foo (33) != 0) __builtin_abort (); #endif return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr70429.c ================================================ /* PR rtl-optimization/70429 */ __attribute__((noinline, noclone)) int foo (int a) { return (int) (0x14ff6e2207db5d1fLL >> a) >> 4; } int main () { if (sizeof (int) != 4 || sizeof (long long) != 8 || __CHAR_BIT__ != 8) return 0; if (foo (1) != 0x3edae8 || foo (2) != -132158092) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr70460.c ================================================ /* PR rtl-optimization/70460 */ int c; __attribute__((noinline, noclone)) void foo (int x) { static int b[] = { &&lab1 - &&lab0, &&lab2 - &&lab0 }; void *a = &&lab0 + b[x]; goto *a; lab1: c += 2; lab2: c++; lab0: ; } int main () { foo (0); if (c != 3) __builtin_abort (); foo (1); if (c != 4) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr70566.c ================================================ /* PR target/70566. */ #define NULL 0 struct mystruct { unsigned int f1 : 1; unsigned int f2 : 1; unsigned int f3 : 1; }; __attribute__ ((noinline)) void myfunc (int a, void *b) { } __attribute__ ((noinline)) int myfunc2 (void *a) { return 0; } static void set_f2 (struct mystruct *user, int f2) { if (user->f2 != f2) myfunc (myfunc2 (NULL), NULL); else __builtin_abort (); } __attribute__ ((noinline)) void foo (void *data) { struct mystruct *user = data; if (!user->f2) set_f2 (user, 1); } int main (void) { struct mystruct a; a.f1 = 1; a.f2 = 0; foo (&a); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr70586.c ================================================ /* PR tree-optimization/70586 */ int a, e, f; short b, c, d; int foo (int x, int y) { return (y == 0 || (x && y == 1)) ? x : x % y; } static short bar (void) { int i = foo (c, f); f = foo (d, 2); int g = foo (b, c); int h = foo (g > 0, c); c = (3 >= h ^ 7) <= foo (i, c); if (foo (e, 1)) return a; return 0; } int main () { bar (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr70602.c ================================================ /* PR tree-optimization/70602 */ struct __attribute__((packed)) S { int s : 1; int t : 20; }; int a, b, c; int main () { for (; a < 1; a++) { struct S e[] = { {0, 9}, {0, 9}, {0, 9}, {0, 0}, {0, 9}, {0, 9}, {0, 9}, {0, 0}, {0, 9}, {0, 9}, {0, 9}, {0, 0}, {0, 9}, {0, 9}, {0, 9}, {0, 0}, {0, 9}, {0, 9}, {0, 9}, {0, 0}, {0, 9} }; b = b || e[0].s; c = e[0].t; } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr71083.c ================================================ struct lock_chain { unsigned int irq_context: 2, depth: 6, base: 24; }; __attribute__((noinline, noclone)) struct lock_chain * foo (struct lock_chain *chain) { int i; for (i = 0; i < 100; i++) { chain[i+1].base = chain[i].base; } return chain; } struct lock_chain1 { char x; unsigned short base; } __attribute__((packed)); __attribute__((noinline, noclone)) struct lock_chain1 * bar (struct lock_chain1 *chain) { int i; for (i = 0; i < 100; i++) { chain[i+1].base = chain[i].base; } return chain; } struct lock_chain test [101]; struct lock_chain1 test1 [101]; int main () { foo (test); bar (test1); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr71494.c ================================================ /* PR middle-end/71494 */ int main () { void *label = &&out; int i = 0; void test (void) { label = &&out2; goto *label; out2:; i++; } goto *label; out: i += 2; test (); if (i != 3) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr71554.c ================================================ /* PR target/71554 */ int v; __attribute__ ((noinline, noclone)) void bar (void) { v++; } __attribute__ ((noinline, noclone)) void foo (unsigned int x) { signed int y = ((-__INT_MAX__ - 1) / 2); signed int r; if (__builtin_mul_overflow (x, y, &r)) bar (); } int main () { foo (2); if (v) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr71626-1.c ================================================ /* PR middle-end/71626 */ typedef __INTPTR_TYPE__ V __attribute__((__vector_size__(sizeof (__INTPTR_TYPE__)))); __attribute__((noinline, noclone)) V foo () { V v = { (__INTPTR_TYPE__) foo }; return v; } int main () { V v = foo (); if (v[0] != (__INTPTR_TYPE__) foo) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr71626-2.c ================================================ /* PR middle-end/71626 */ /* { dg-additional-options "-fpic" { target fpic } } */ #include "pr71626-1.c" ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr71700.c ================================================ struct S { signed f0 : 16; unsigned f1 : 1; }; int b; static struct S c[] = {{-1, 0}, {-1, 0}}; struct S d; int main () { struct S e = c[0]; d = e; if (d.f1 != 0) __builtin_abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr7284-1.c ================================================ /* Signed left-shift is implementation-defined in C89 (and see DR#081), not undefined. Bug 7284 from Al Grant (AlGrant at myrealbox.com). */ /* { dg-require-effective-target int32plus } */ /* { dg-options "-std=c89" } */ extern void abort (void); extern void exit (int); int f (int n) { return (n << 24) / (1 << 23); } volatile int x = 128; int main (void) { if (f(x) != -256) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr78378.c ================================================ /* PR rtl-optimization/78378 */ unsigned long long __attribute__ ((noinline, noclone)) foo (unsigned long long x) { x <<= 41; x /= 232; return 1 + (unsigned short) x; } int main () { unsigned long long x = foo (1); if (x != 0x2c24) __builtin_abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/printf-1.c ================================================ /* { dg-skip-if "requires io" { freestanding } { "*" } { "" } } */ #include #include int main (void) { #define test(ret, args...) \ printf (args); \ if (printf (args) != ret) \ abort (); test (5, "hello"); test (6, "hello\n"); test (1, "a"); test (0, ""); test (5, "%s", "hello"); test (6, "%s", "hello\n"); test (1, "%s", "a"); test (0, "%s", ""); test (1, "%c", 'x'); test (7, "%s\n", "hello\n"); test (2, "%d\n", 0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/printf-chk-1.c ================================================ /* { dg-skip-if "requires io" { freestanding } { "*" } { "" } } */ #include #include #include volatile int should_optimize; int __attribute__((noinline)) __printf_chk (int flag, const char *fmt, ...) { va_list ap; int ret; #ifdef __OPTIMIZE__ if (should_optimize) abort (); #endif should_optimize = 1; va_start (ap, fmt); ret = vprintf (fmt, ap); va_end (ap); return ret; } int main (void) { #define test(ret, opt, args...) \ should_optimize = opt; \ __printf_chk (1, args); \ if (!should_optimize) \ abort (); \ should_optimize = 0; \ if (__printf_chk (1, args) != ret) \ abort (); \ if (!should_optimize) \ abort (); test (5, 0, "hello"); test (6, 1, "hello\n"); test (1, 1, "a"); test (0, 1, ""); test (5, 0, "%s", "hello"); test (6, 1, "%s", "hello\n"); test (1, 1, "%s", "a"); test (0, 1, "%s", ""); test (1, 1, "%c", 'x'); test (7, 1, "%s\n", "hello\n"); test (2, 0, "%d\n", 0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pta-field-1.c ================================================ struct Foo { int *p; int *q; }; void __attribute__((noinline)) bar (int **x) { struct Foo *f = (struct Foo *)x; *(f->q) = 0; } int foo(void) { struct Foo f; int i = 1, j = 2; f.p = &i; f.q = &j; bar(&f.p); return j; } extern void abort (void); int main() { if (foo () != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pta-field-2.c ================================================ struct Foo { int *p; int *q; }; void __attribute__((noinline)) bar (int **x) { struct Foo *f = (struct Foo *)(x - 1); *(f->p) = 0; } int foo(void) { struct Foo f; int i = 1, j = 2; f.p = &i; f.q = &j; bar(&f.q); return i; } extern void abort (void); int main() { if (foo () != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/ptr-arith-1.c ================================================ char * f (char *s, unsigned int i) { return &s[i + 3 - 1]; } main () { char *str = "abcdefghijkl"; char *x2 = f (str, 12); if (str + 14 != x2) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pure-1.c ================================================ /* Origin: Kaveh Ghazi 2002-05-27. */ /* Use a different function for each test so the link failures indicate which one is broken. */ extern void link_error0 (void); extern void link_error1 (void); extern void link_error2 (void); extern void link_error3 (void); extern void link_error4 (void); extern void link_error5 (void); extern void link_error6 (void); extern void link_error7 (void); extern int i; extern int func0 (int) __attribute__ ((__pure__)); extern int func1 (int) __attribute__ ((__const__)); /* GCC should automatically detect attributes for these functions. At -O3 They'll be inlined, but that's ok. */ static int func2 (int a) { return i + a; } /* pure */ static int func3 (int a) { return a * 3; } /* const */ static int func4 (int a) { return func0(a) + a; } /* pure */ static int func5 (int a) { return a + func1(a); } /* const */ static int func6 (int a) { return func2(a) + a; } /* pure */ static int func7 (int a) { return a + func3(a); } /* const */ int main () { int i[10], r; i[0] = 0; r = func0(0); if (i[0]) link_error0(); i[1] = 0; r = func1(0); if (i[1]) link_error1(); i[2] = 0; r = func2(0); if (i[2]) link_error2(); i[3] = 0; r = func3(0); if (i[3]) link_error3(); i[4] = 0; r = func4(0); if (i[4]) link_error4(); i[5] = 0; r = func5(0); if (i[5]) link_error5(); i[6] = 0; r = func6(0); if (i[6]) link_error6(); i[7] = 0; r = func7(0); if (i[7]) link_error7(); return r; } int func0 (int a) { return a - i; } /* pure */ int func1 (int a) { return a - a; } /* const */ int i = 2; #ifndef __OPTIMIZE__ /* Avoid link failures when not optimizing. */ void link_error0() {} void link_error1() {} void link_error2() {} void link_error3() {} void link_error4() {} void link_error5() {} void link_error6() {} void link_error7() {} #endif /* ! __OPTIMIZE__ */ ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pushpop_macro.c ================================================ extern void abort (); #define _ 2 #pragma push_macro("_") #undef _ #define _ 1 #pragma pop_macro("_") int main () { if (_ != 2) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/regstack-1.c ================================================ long double C = 5; long double U = 1; long double Y2 = 11; long double Y1 = 17; long double X, Y, Z, T, R, S; main () { X = (C + U) * Y2; Y = C - U - U; Z = C + U + U; T = (C - U) * Y1; X = X - (Z + U); R = Y * Y1; S = Z * Y2; T = T - Y; Y = (U - Y) + R; Z = S - (Z + U + U); R = (Y2 + U) * Y1; Y1 = Y2 * Y1; R = R - Y2; Y1 = Y1 - 0.5L; if (Z != 68. || Y != 49. || X != 58. || Y1 != 186.5 || R != 193. || S != 77. || T != 65. || Y2 != 11.) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/restrict-1.c ================================================ /* PR rtl-optimization/16536 Origin: Jeremy Denise Reduced: Wolfgang Bangerth Volker Reichelt */ /* { dg-options "-fgnu89-inline" } */ extern void abort (); typedef struct { int i, dummy; } A; inline A foo (const A* p, const A* q) { return (A){p->i+q->i}; } void bar (A* __restrict__ p) { *p=foo(p,p); if (p->i!=2) abort(); } int main () { A a={1}; bar(&a); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/scal-to-vec1.c ================================================ #define vector(elcount, type) \ __attribute__((vector_size((elcount)*sizeof(type)))) type #define vidx(type, vec, idx) (*((type *) &(vec) + idx)) #define operl(a, b, op) (a op b) #define operr(a, b, op) (b op a) #define check(type, count, vec0, vec1, num, op, lr) \ do {\ int __i; \ for (__i = 0; __i < count; __i++) {\ if (vidx (type, vec1, __i) != oper##lr (num, vidx (type, vec0, __i), op)) \ __builtin_abort (); \ }\ } while (0) #define veccompare(type, count, v0, v1) \ do {\ int __i; \ for (__i = 0; __i < count; __i++) { \ if (vidx (type, v0, __i) != vidx (type, v1, __i)) \ __builtin_abort (); \ } \ } while (0) volatile int one = 1; int main (int argc, char *argv[]) { #define fvec_2 (vector(4, float)){2., 2., 2., 2.} #define dvec_2 (vector(2, double)){2., 2.} vector(8, short) v0 = {one, 1, 2, 3, 4, 5, 6, 7}; vector(8, short) v1; vector(4, float) f0 = {1., 2., 3., 4.}; vector(4, float) f1, f2; vector(2, double) d0 = {1., 2.}; vector(2, double) d1, d2; v1 = 2 + v0; check (short, 8, v0, v1, 2, +, l); v1 = 2 - v0; check (short, 8, v0, v1, 2, -, l); v1 = 2 * v0; check (short, 8, v0, v1, 2, *, l); v1 = 2 / v0; check (short, 8, v0, v1, 2, /, l); v1 = 2 % v0; check (short, 8, v0, v1, 2, %, l); v1 = 2 ^ v0; check (short, 8, v0, v1, 2, ^, l); v1 = 2 & v0; check (short, 8, v0, v1, 2, &, l); v1 = 2 | v0; check (short, 8, v0, v1, 2, |, l); v1 = 2 << v0; check (short, 8, v0, v1, 2, <<, l); v1 = 2 >> v0; check (short, 8, v0, v1, 2, >>, l); v1 = v0 + 2; check (short, 8, v0, v1, 2, +, r); v1 = v0 - 2; check (short, 8, v0, v1, 2, -, r); v1 = v0 * 2; check (short, 8, v0, v1, 2, *, r); v1 = v0 / 2; check (short, 8, v0, v1, 2, /, r); v1 = v0 % 2; check (short, 8, v0, v1, 2, %, r); v1 = v0 ^ 2; check (short, 8, v0, v1, 2, ^, r); v1 = v0 & 2; check (short, 8, v0, v1, 2, &, r); v1 = v0 | 2; check (short, 8, v0, v1, 2, |, r); f1 = 2. + f0; f2 = fvec_2 + f0; veccompare (float, 4, f1, f2); f1 = 2. - f0; f2 = fvec_2 - f0; veccompare (float, 4, f1, f2); f1 = 2. * f0; f2 = fvec_2 * f0; veccompare (float, 4, f1, f2); f1 = 2. / f0; f2 = fvec_2 / f0; veccompare (float, 4, f1, f2); f1 = f0 + 2.; f2 = f0 + fvec_2; veccompare (float, 4, f1, f2); f1 = f0 - 2.; f2 = f0 - fvec_2; veccompare (float, 4, f1, f2); f1 = f0 * 2.; f2 = f0 * fvec_2; veccompare (float, 4, f1, f2); f1 = f0 / 2.; f2 = f0 / fvec_2; veccompare (float, 4, f1, f2); d1 = 2. + d0; d2 = dvec_2 + d0; veccompare (double, 2, d1, d2); d1 = 2. - d0; d2 = dvec_2 - d0; veccompare (double, 2, d1, d2); d1 = 2. * d0; d2 = dvec_2 * d0; veccompare (double, 2, d1, d2); d1 = 2. / d0; d2 = dvec_2 / d0; veccompare (double, 2, d1, d2); d1 = d0 + 2.; d2 = d0 + dvec_2; veccompare (double, 2, d1, d2); d1 = d0 - 2.; d2 = d0 - dvec_2; veccompare (double, 2, d1, d2); d1 = d0 * 2.; d2 = d0 * dvec_2; veccompare (double, 2, d1, d2); d1 = d0 / 2.; d2 = d0 / dvec_2; veccompare (double, 2, d1, d2); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/scal-to-vec2.c ================================================ #define vector(elcount, type) \ __attribute__((vector_size((elcount)*sizeof(type)))) type #define vidx(type, vec, idx) (*((type *) &(vec) + idx)) #define operl(a, b, op) (a op b) #define operr(a, b, op) (b op a) #define check(type, count, vec0, vec1, num, op, lr) \ do {\ int __i; \ for (__i = 0; __i < count; __i++) {\ if (vidx (type, vec1, __i) != oper##lr (num, vidx (type, vec0, __i), op)) \ __builtin_abort (); \ }\ } while (0) #define veccompare(type, count, v0, v1) \ do {\ int __i; \ for (__i = 0; __i < count; __i++) { \ if (vidx (type, v0, __i) != vidx (type, v1, __i)) \ __builtin_abort (); \ } \ } while (0) long __attribute__ ((noinline)) vlng () { return (long)42; } int __attribute__ ((noinline)) vint () { return (int) 43; } short __attribute__ ((noinline)) vsrt () { return (short)42; } char __attribute__ ((noinline)) vchr () { return (char)42; } int main (int argc, char *argv[]) { vector(16, char) c0 = {argc, 1,2,3,4,5,6,7, argc, 1,2,3,4,5,6,7}; vector(16, char) c1; vector(8, short) s0 = {argc, 1,2,3,4,5,6,7}; vector(8, short) s1; vector(4, int) i0 = {argc, 1, 2, 3}; vector(4, int) i1; vector(2, long) l0 = {argc, 1}; vector(2, long) l1; c1 = vchr() + c0; check (char, 16, c0, c1, vchr(), +, l); s1 = vsrt() + s0; check (short, 8, s0, s1, vsrt(), +, l); s1 = vchr() + s0; check (short, 8, s0, s1, vchr(), +, l); i1 = vint() * i0; check (int, 4, i0, i1, vint(), *, l); i1 = vsrt() * i0; check (int, 4, i0, i1, vsrt(), *, l); i1 = vchr() * i0; check (int, 4, i0, i1, vchr(), *, l); l1 = vlng() * l0; check (long, 2, l0, l1, vlng(), *, l); l1 = vint() * l0; check (long, 2, l0, l1, vint(), *, l); l1 = vsrt() * l0; check (long, 2, l0, l1, vsrt(), *, l); l1 = vchr() * l0; check (long, 2, l0, l1, vchr(), *, l); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/scal-to-vec3.c ================================================ #define vector(elcount, type) \ __attribute__((vector_size((elcount)*sizeof(type)))) type #define vidx(type, vec, idx) (*((type *) &(vec) + idx)) #define veccompare(type, count, v0, v1) \ do {\ int __i; \ for (__i = 0; __i < count; __i++) { \ if (vidx (type, v0, __i) != vidx (type, v1, __i)) \ __builtin_abort (); \ } \ } while (0) int main (int argc, char *argv[]) { #define fvec_2 (vector(4, float)){2., 2., 2., 2.} #define dvec_2 (vector(2, double)){2., 2.} vector(4, float) f0 = {1., 2., 3., 4.}; vector(4, float) f1, f2; vector(2, double) d0 = {1., 2.}; vector(2, double) d1, d2; f1 = 2 + f0; f2 = fvec_2 + f0; veccompare (float, 4, f1, f2); f1 = 2 - f0; f2 = fvec_2 - f0; veccompare (float, 4, f1, f2); f1 = 2 * f0; f2 = fvec_2 * f0; veccompare (float, 4, f1, f2); f1 = 2 / f0; f2 = fvec_2 / f0; veccompare (float, 4, f1, f2); f1 = f0 + 2; f2 = f0 + fvec_2; veccompare (float, 4, f1, f2); f1 = f0 - 2; f2 = f0 - fvec_2; veccompare (float, 4, f1, f2); f1 = f0 * 2; f2 = f0 * fvec_2; veccompare (float, 4, f1, f2); f1 = f0 / 2; f2 = f0 / fvec_2; veccompare (float, 4, f1, f2); d1 = 2 + d0; d2 = dvec_2 + d0; veccompare (double, 2, d1, d2); d1 = 2 - d0; d2 = dvec_2 - d0; veccompare (double, 2, d1, d2); d1 = 2 * d0; d2 = dvec_2 * d0; veccompare (double, 2, d1, d2); d1 = 2 / d0; d2 = dvec_2 / d0; veccompare (double, 2, d1, d2); d1 = d0 + 2; d2 = d0 + dvec_2; veccompare (double, 2, d1, d2); d1 = d0 - 2; d2 = d0 - dvec_2; veccompare (double, 2, d1, d2); d1 = d0 * 2; d2 = d0 * dvec_2; veccompare (double, 2, d1, d2); d1 = d0 / 2; d2 = d0 / dvec_2; veccompare (double, 2, d1, d2); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/scope-1.c ================================================ int v = 3; f () { int v = 4; { extern int v; if (v != 3) abort (); } } main () { f (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/shiftdi.c ================================================ /* { dg-require-effective-target int32plus } */ /* Failed on sparc with -mv8plus because sparc.c:set_extends() thought erroneously that SImode ASHIFT chops the upper bits, it does not. */ typedef unsigned long long uint64; void g(uint64 x, int y, int z, uint64 *p) { unsigned w = ((x >> y) & 0xffffffffULL) << (z & 0x1f); *p |= (w & 0xffffffffULL) << z; } int main(void) { uint64 a = 0; g(0xdeadbeef01234567ULL, 0, 0, &a); return (a == 0x01234567) ? 0 : 1; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/shiftopt-1.c ================================================ /* Copyright (C) 2002 Free Software Foundation Check that constant folding of shift operations is working. Roger Sayle, 10th October 2002. */ extern void abort (void); extern void link_error (void); void utest (unsigned int x) { if (x >> 0 != x) link_error (); if (x << 0 != x) link_error (); if (0 << x != 0) link_error (); if (0 >> x != 0) link_error (); if (-1 >> x != -1) link_error (); if (~0 >> x != ~0) link_error (); } void stest (int x) { if (x >> 0 != x) link_error (); if (x << 0 != x) link_error (); if (0 << x != 0) link_error (); if (0 >> x != 0) link_error (); } int main () { utest(9); utest(0); stest(9); stest(0); return 0; } #ifndef __OPTIMIZE__ void link_error () { abort (); } #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/simd-1.c ================================================ /* Origin: Aldy Hernandez Purpose: Test generic SIMD support. This test should work regardless of if the target has SIMD instructions. */ typedef int __attribute__((mode(SI))) __attribute__((vector_size (16))) vecint; typedef int __attribute__((mode(SI))) siint; vecint i = { 150, 100, 150, 200 }; vecint j = { 10, 13, 20, 30 }; vecint k; union { vecint v; siint i[4]; } res; /* This should go away once we can use == and != on vector types. */ void verify (siint a1, siint a2, siint a3, siint a4, siint b1, siint b2, siint b3, siint b4) { if (a1 != b1 || a2 != b2 || a3 != b3 || a4 != b4) abort (); } int main () { k = i + j; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], 160, 113, 170, 230); k = i * j; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], 1500, 1300, 3000, 6000); k = i / j; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], 15, 7, 7, 6); k = i & j; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], 2, 4, 20, 8); k = i | j; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], 158, 109, 150, 222); k = i ^ j; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], 156, 105, 130, 214); k = -i; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], -150, -100, -150, -200); k = ~i; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], -151, -101, -151, -201); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/simd-2.c ================================================ /* Purpose: Test generic SIMD support, V8HImode. This test should work regardless of if the target has SIMD instructions. */ typedef short __attribute__((vector_size (16))) vecint; vecint i = { 150, 100, 150, 200, 0, 0, 0, 0 }; vecint j = { 10, 13, 20, 30, 1, 1, 1, 1 }; vecint k; union { vecint v; short i[8]; } res; /* This should go away once we can use == and != on vector types. */ void verify (int a1, int a2, int a3, int a4, int b1, int b2, int b3, int b4) { if (a1 != b1 || a2 != b2 || a3 != b3 || a4 != b4) abort (); } int main () { k = i + j; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], 160, 113, 170, 230); k = i * j; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], 1500, 1300, 3000, 6000); k = i / j; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], 15, 7, 7, 6); k = i & j; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], 2, 4, 20, 8); k = i | j; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], 158, 109, 150, 222); k = i ^ j; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], 156, 105, 130, 214); k = -i; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], -150, -100, -150, -200); k = ~i; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], -151, -101, -151, -201); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/simd-4.c ================================================ /* { dg-require-effective-target stdint_types } */ #include typedef int32_t __attribute__((vector_size(8))) v2si; int64_t s64; static inline int64_t __ev_convert_s64 (v2si a) { return (int64_t) a; } int main() { union { int64_t ll; int32_t i[2]; } endianness_test; endianness_test.ll = 1; int32_t little_endian = endianness_test.i[0]; s64 = __ev_convert_s64 ((v2si){1,0xffffffff}); if (s64 != (little_endian ? 0xffffffff00000001LL : 0x1ffffffffLL)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/simd-5.c ================================================ /* Test saving and restoring of SIMD registers. */ typedef short Q __attribute__((vector_size(8))); Q q1 = {1, 2}, q2 = {3, 4}, q3 = {5, 6}, q4 = {7, 8}; Q w1, w2, w3, w4; Q z1, z2, z3, z4; volatile int dummy; void __attribute__((__noinline__)) func0 (void) { dummy = 1; } void __attribute__((__noinline__)) func1 (void) { Q a, b; a = q1 * q2; b = q3 * q4; w1 = a; w2 = b; func0 (); w3 = a; w4 = b; } void __attribute__((__noinline__)) func2 (void) { Q a, b; a = q1 + q2; b = q3 - q4; z1 = a; z2 = b; func1 (); z3 = a; z4 = b; } int main (void) { func2 (); if (memcmp (&w1, &w3, sizeof (Q)) != 0) abort (); if (memcmp (&w2, &w4, sizeof (Q)) != 0) abort (); if (memcmp (&z1, &z3, sizeof (Q)) != 0) abort (); if (memcmp (&z2, &z4, sizeof (Q)) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/simd-6.c ================================================ extern void abort (void); extern int memcmp (const void *, const void *, __SIZE_TYPE__); typedef unsigned char v8qi __attribute__((vector_size(8))); v8qi foo(v8qi x, v8qi y) { return x * y; } int main() { v8qi a = { 1, 2, 3, 4, 5, 6, 7, 8 }; v8qi b = { 3, 3, 3, 3, 3, 3, 3, 3 }; v8qi c = { 3, 6, 9, 12, 15, 18, 21, 24 }; v8qi r; r = foo (a, b); if (memcmp (&r, &c, 8) != 0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/stdarg-1.c ================================================ #include extern void abort (void); int foo_arg, bar_arg; long x; double d; va_list gap; va_list *pap; void foo (int v, va_list ap) { switch (v) { case 5: foo_arg = va_arg (ap, int); break; default: abort (); } } void bar (int v) { if (v == 0x4006) { if (va_arg (gap, double) != 17.0 || va_arg (gap, long) != 129L) abort (); } else if (v == 0x4008) { if (va_arg (*pap, long long) != 14LL || va_arg (*pap, long double) != 131.0L || va_arg (*pap, int) != 17) abort (); } bar_arg = v; } void f0 (int i, ...) { } void f1 (int i, ...) { va_list ap; va_start (ap, i); va_end (ap); } void f2 (int i, ...) { va_list ap; va_start (ap, i); bar (d); x = va_arg (ap, long); bar (x); va_end (ap); } void f3 (int i, ...) { va_list ap; va_start (ap, i); d = va_arg (ap, double); va_end (ap); } void f4 (int i, ...) { va_list ap; va_start (ap, i); x = va_arg (ap, double); foo (i, ap); va_end (ap); } void f5 (int i, ...) { va_list ap; va_start (ap, i); va_copy (gap, ap); bar (i); va_end (ap); va_end (gap); } void f6 (int i, ...) { va_list ap; va_start (ap, i); bar (d); va_arg (ap, long); va_arg (ap, long); x = va_arg (ap, long); bar (x); va_end (ap); } void f7 (int i, ...) { va_list ap; va_start (ap, i); pap = ≈ bar (i); va_end (ap); } void f8 (int i, ...) { va_list ap; va_start (ap, i); pap = ≈ bar (i); d = va_arg (ap, double); va_end (ap); } int main (void) { f0 (1); f1 (2); d = 31.0; f2 (3, 28L); if (bar_arg != 28 || x != 28) abort (); f3 (4, 131.0); if (d != 131.0) abort (); f4 (5, 16.0, 128); if (x != 16 || foo_arg != 128) abort (); f5 (0x4006, 17.0, 129L); if (bar_arg != 0x4006) abort (); f6 (7, 12L, 14L, -31L); if (bar_arg != -31) abort (); f7 (0x4008, 14LL, 131.0L, 17, 26.0); if (bar_arg != 0x4008) abort (); f8 (0x4008, 14LL, 131.0L, 17, 27.0); if (bar_arg != 0x4008 || d != 27.0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/stdarg-2.c ================================================ #include extern void abort (void); int foo_arg, bar_arg; long x; double d; va_list gap; void foo (int v, va_list ap) { switch (v) { case 5: foo_arg = va_arg (ap, int); foo_arg += va_arg (ap, double); foo_arg += va_arg (ap, long long); break; case 8: foo_arg = va_arg (ap, long long); foo_arg += va_arg (ap, double); break; case 11: foo_arg = va_arg (ap, int); foo_arg += va_arg (ap, long double); break; default: abort (); } } void bar (int v) { if (v == 0x4002) { if (va_arg (gap, int) != 13 || va_arg (gap, double) != -14.0) abort (); } bar_arg = v; } void f1 (int i, ...) { va_start (gap, i); x = va_arg (gap, long); va_end (gap); } void f2 (int i, ...) { va_start (gap, i); bar (i); va_end (gap); } void f3 (int i, ...) { va_list aps[10]; va_start (aps[4], i); x = va_arg (aps[4], long); va_end (aps[4]); } void f4 (int i, ...) { va_list aps[10]; va_start (aps[4], i); bar (i); va_end (aps[4]); } void f5 (int i, ...) { va_list aps[10]; va_start (aps[4], i); foo (i, aps[4]); va_end (aps[4]); } struct A { int i; va_list g; va_list h[2]; }; void f6 (int i, ...) { struct A a; va_start (a.g, i); x = va_arg (a.g, long); va_end (a.g); } void f7 (int i, ...) { struct A a; va_start (a.g, i); bar (i); va_end (a.g); } void f8 (int i, ...) { struct A a; va_start (a.g, i); foo (i, a.g); va_end (a.g); } void f10 (int i, ...) { struct A a; va_start (a.h[1], i); x = va_arg (a.h[1], long); va_end (a.h[1]); } void f11 (int i, ...) { struct A a; va_start (a.h[1], i); bar (i); va_end (a.h[1]); } void f12 (int i, ...) { struct A a; va_start (a.h[1], i); foo (i, a.h[1]); va_end (a.h[1]); } int main (void) { f1 (1, 79L); if (x != 79L) abort (); f2 (0x4002, 13, -14.0); if (bar_arg != 0x4002) abort (); f3 (3, 2031L); if (x != 2031) abort (); f4 (4, 18); if (bar_arg != 4) abort (); f5 (5, 1, 19.0, 18LL); if (foo_arg != 38) abort (); f6 (6, 18L); if (x != 18L) abort (); f7 (7); if (bar_arg != 7) abort (); f8 (8, 2031LL, 13.0); if (foo_arg != 2044) abort (); f10 (9, 180L); if (x != 180L) abort (); f11 (10); if (bar_arg != 10) abort (); f12 (11, 2030, 12.0L); if (foo_arg != 2042) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/stdarg-3.c ================================================ #include extern void abort (void); int foo_arg, bar_arg; long x; double d; va_list gap; struct S1 { int i; double d; int j; double e; } s1; struct S2 { double d; long i; } s2; int y; void bar (int v) { bar_arg = v; } void f1 (int i, ...) { va_list ap; va_start (ap, i); while (i-- > 0) x = va_arg (ap, long); va_end (ap); } void f2 (int i, ...) { va_list ap; va_start (ap, i); while (i-- > 0) d = va_arg (ap, double); va_end (ap); } void f3 (int i, ...) { va_list ap; int j = i; while (j-- > 0) { va_start (ap, i); x = va_arg (ap, long); va_end (ap); bar (x); } } void f4 (int i, ...) { va_list ap; int j = i; while (j-- > 0) { va_start (ap, i); d = va_arg (ap, double); va_end (ap); bar (d + 4.0); } } void f5 (int i, ...) { va_list ap; va_start (ap, i); while (i-- > 0) s1 = va_arg (ap, struct S1); va_end (ap); } void f6 (int i, ...) { va_list ap; va_start (ap, i); while (i-- > 0) s2 = va_arg (ap, struct S2); va_end (ap); } void f7 (int i, ...) { va_list ap; int j = i; while (j-- > 0) { va_start (ap, i); s1 = va_arg (ap, struct S1); va_end (ap); bar (s1.i); } } void f8 (int i, ...) { va_list ap; int j = i; while (j-- > 0) { va_start (ap, i); s2 = va_arg (ap, struct S2); y = va_arg (ap, int); va_end (ap); bar (s2.i); } } int main (void) { struct S1 a1, a3; struct S2 a2, a4; f1 (7, 1L, 2L, 3L, 5L, 7L, 9L, 11L, 13L); if (x != 11L) abort (); f2 (6, 1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0); if (d != 32.0) abort (); f3 (2, 1L, 3L); if (bar_arg != 1L || x != 1L) abort (); f4 (2, 17.0, 19.0); if (bar_arg != 21 || d != 17.0) abort (); a1.i = 131; a1.j = 251; a1.d = 15.0; a1.e = 191.0; a3 = a1; a3.j = 254; a3.e = 178.0; f5 (2, a1, a3, a1); if (s1.i != 131 || s1.j != 254 || s1.d != 15.0 || s1.e != 178.0) abort (); f5 (3, a1, a3, a1); if (s1.i != 131 || s1.j != 251 || s1.d != 15.0 || s1.e != 191.0) abort (); a2.i = 138; a2.d = 16.0; a4.i = 257; a4.d = 176.0; f6 (2, a2, a4, a2); if (s2.i != 257 || s2.d != 176.0) abort (); f6 (3, a2, a4, a2); if (s2.i != 138 || s2.d != 16.0) abort (); f7 (2, a3, a1, a1); if (s1.i != 131 || s1.j != 254 || s1.d != 15.0 || s1.e != 178.0) abort (); if (bar_arg != 131) abort (); f8 (3, a4, a2, a2); if (s2.i != 257 || s2.d != 176.0) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/stdarg-4.c ================================================ #include extern void abort (void); long x, y; inline void __attribute__((always_inline)) f1i (va_list ap) { x = va_arg (ap, double); x += va_arg (ap, long); x += va_arg (ap, double); } void f1 (int i, ...) { va_list ap; va_start (ap, i); f1i (ap); va_end (ap); } inline void __attribute__((always_inline)) f2i (va_list ap) { y = va_arg (ap, int); y += va_arg (ap, long); y += va_arg (ap, double); f1i (ap); } void f2 (int i, ...) { va_list ap; va_start (ap, i); f2i (ap); va_end (ap); } long f3h (int i, long arg0, long arg1, long arg2, long arg3) { return i + arg0 + arg1 + arg2 + arg3; } long f3 (int i, ...) { long t, arg0, arg1, arg2, arg3; va_list ap; va_start (ap, i); switch (i) { case 0: t = f3h (i, 0, 0, 0, 0); break; case 1: arg0 = va_arg (ap, long); t = f3h (i, arg0, 0, 0, 0); break; case 2: arg0 = va_arg (ap, long); arg1 = va_arg (ap, long); t = f3h (i, arg0, arg1, 0, 0); break; case 3: arg0 = va_arg (ap, long); arg1 = va_arg (ap, long); arg2 = va_arg (ap, long); t = f3h (i, arg0, arg1, arg2, 0); break; case 4: arg0 = va_arg (ap, long); arg1 = va_arg (ap, long); arg2 = va_arg (ap, long); arg3 = va_arg (ap, long); t = f3h (i, arg0, arg1, arg2, arg3); break; default: abort (); } va_end (ap); return t; } void f4 (int i, ...) { va_list ap; va_start (ap, i); switch (i) { case 4: y = va_arg (ap, double); break; case 5: y = va_arg (ap, double); y += va_arg (ap, double); break; default: abort (); } f1i (ap); va_end (ap); } int main (void) { f1 (3, 16.0, 128L, 32.0); if (x != 176L) abort (); f2 (6, 5, 7L, 18.0, 19.0, 17L, 64.0); if (x != 100L || y != 30L) abort (); if (f3 (0) != 0) abort (); if (f3 (1, 18L) != 19L) abort (); if (f3 (2, 18L, 100L) != 120L) abort (); if (f3 (3, 18L, 100L, 300L) != 421L) abort (); if (f3 (4, 18L, 71L, 64L, 86L) != 243L) abort (); f4 (4, 6.0, 9.0, 16L, 18.0); if (x != 43L || y != 6L) abort (); f4 (5, 7.0, 21.0, 1.0, 17L, 126.0); if (x != 144L || y != 28L) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/stkalign.c ================================================ /* { dg-options "-fno-inline" } */ /* Check that stack alignment is not affected by variables not placed on the stack. */ #include #define ALIGNMENT 64 unsigned test(unsigned n, unsigned p) { static struct { char __attribute__((__aligned__(ALIGNMENT))) c; } s; unsigned x; assert(__alignof__(s) == ALIGNMENT); asm ("" : "=g" (x), "+m" (s) : "0" (&x)); return n ? test(n - 1, x) : (x ^ p); } unsigned test2(unsigned n, unsigned p) { static struct { char c; } s; unsigned x; assert(__alignof__(s) != ALIGNMENT); asm ("" : "=g" (x), "+m" (s) : "0" (&x)); return n ? test2(n - 1, x) : (x ^ p); } int main (int argc, char *argv[] __attribute__((unused))) { unsigned int x, y; x = test(argc, 0); x |= test(argc + 1, 0); x |= test(argc + 2, 0); y = test2(argc, 0); y |= test2(argc + 1, 0); y |= test2(argc + 2, 0); return (x & (ALIGNMENT - 1)) == 0 && (y & (ALIGNMENT - 1)) != 0 ? 1 : 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/strcmp-1.c ================================================ /* Copyright (C) 2002 Free Software Foundation. Test strcmp with various combinations of pointer alignments and lengths to make sure any optimizations in the library are correct. Written by Michael Meissner, March 9, 2002. */ #include #include #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_TEST #define MAX_TEST (8 * sizeof (long long)) #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_TEST + MAX_EXTRA + 2) static union { unsigned char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u1, u2; void test (const unsigned char *s1, const unsigned char *s2, int expected) { int value = strcmp ((char *) s1, (char *) s2); if (expected < 0 && value >= 0) abort (); else if (expected == 0 && value != 0) abort (); else if (expected > 0 && value <= 0) abort (); } main () { size_t off1, off2, len, i; unsigned char *buf1, *buf2; unsigned char *mod1, *mod2; unsigned char *p1, *p2; for (off1 = 0; off1 < MAX_OFFSET; off1++) for (off2 = 0; off2 < MAX_OFFSET; off2++) for (len = 0; len < MAX_TEST; len++) { p1 = u1.buf; for (i = 0; i < off1; i++) *p1++ = '\0'; buf1 = p1; for (i = 0; i < len; i++) *p1++ = 'a'; mod1 = p1; for (i = 0; i < MAX_EXTRA+2; i++) *p1++ = 'x'; p2 = u2.buf; for (i = 0; i < off2; i++) *p2++ = '\0'; buf2 = p2; for (i = 0; i < len; i++) *p2++ = 'a'; mod2 = p2; for (i = 0; i < MAX_EXTRA+2; i++) *p2++ = 'x'; mod1[0] = '\0'; mod2[0] = '\0'; test (buf1, buf2, 0); mod1[0] = 'a'; mod1[1] = '\0'; mod2[0] = '\0'; test (buf1, buf2, +1); mod1[0] = '\0'; mod2[0] = 'a'; mod2[1] = '\0'; test (buf1, buf2, -1); mod1[0] = 'b'; mod1[1] = '\0'; mod2[0] = 'c'; mod2[1] = '\0'; test (buf1, buf2, -1); mod1[0] = 'c'; mod1[1] = '\0'; mod2[0] = 'b'; mod2[1] = '\0'; test (buf1, buf2, +1); mod1[0] = 'b'; mod1[1] = '\0'; mod2[0] = (unsigned char)'\251'; mod2[1] = '\0'; test (buf1, buf2, -1); mod1[0] = (unsigned char)'\251'; mod1[1] = '\0'; mod2[0] = 'b'; mod2[1] = '\0'; test (buf1, buf2, +1); mod1[0] = (unsigned char)'\251'; mod1[1] = '\0'; mod2[0] = (unsigned char)'\252'; mod2[1] = '\0'; test (buf1, buf2, -1); mod1[0] = (unsigned char)'\252'; mod1[1] = '\0'; mod2[0] = (unsigned char)'\251'; mod2[1] = '\0'; test (buf1, buf2, +1); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/strcpy-1.c ================================================ /* Copyright (C) 2002 Free Software Foundation. Test strcpy with various combinations of pointer alignments and lengths to make sure any optimizations in the library are correct. */ #include #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_COPY #define MAX_COPY (10 * sizeof (long long)) #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + 1 + MAX_EXTRA) /* Use a sequence length that is not divisible by two, to make it more likely to detect when words are mixed up. */ #define SEQUENCE_LENGTH 31 static union { char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u1, u2; main () { int off1, off2, len, i; char *p, *q, c; for (off1 = 0; off1 < MAX_OFFSET; off1++) for (off2 = 0; off2 < MAX_OFFSET; off2++) for (len = 1; len < MAX_COPY; len++) { for (i = 0, c = 'A'; i < MAX_LENGTH; i++, c++) { u1.buf[i] = 'a'; if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; u2.buf[i] = c; } u2.buf[off2 + len] = '\0'; p = strcpy (u1.buf + off1, u2.buf + off2); if (p != u1.buf + off1) abort (); q = u1.buf; for (i = 0; i < off1; i++, q++) if (*q != 'a') abort (); for (i = 0, c = 'A' + off2; i < len; i++, q++, c++) { if (c >= 'A' + SEQUENCE_LENGTH) c = 'A'; if (*q != c) abort (); } if (*q++ != '\0') abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/strcpy-2.c ================================================ /* Test to make sure strcpy works correctly. */ #define STRING "Hi!THE" const char a[] = STRING; void f(char *a) __attribute__((noinline)); void f(char *a) { __builtin_strcpy (a, STRING); } int main(void) { int i; char b[sizeof(a)] = {}; f(b); for(i = 0; i < sizeof(b); i++) { if (a[i] != b[i]) __builtin_abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/strct-pack-1.c ================================================ typedef struct { short s __attribute__ ((aligned(2), packed)); double d __attribute__ ((aligned(2), packed)); } TRIAL; int check (TRIAL *t) { if (t->s != 1 || t->d != 16.0) return 1; return 0; } main () { TRIAL trial; trial.s = 1; trial.d = 16.0; if (check (&trial) != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/strct-pack-2.c ================================================ typedef struct { short a __attribute__ ((aligned (2),packed)); short *ap[2] __attribute__ ((aligned (2),packed)); } A; main () { short i, j = 1; A a, *ap = &a; ap->ap[j] = &i; exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/strct-pack-3.c ================================================ typedef struct { short i __attribute__ ((aligned (2),packed)); int f[2] __attribute__ ((aligned (2),packed)); } A; f (ap) A *ap; { short i, j = 1; i = ap->f[1]; i += ap->f[j]; for (j = 0; j < 2; j++) i += ap->f[j]; return i; } main () { A a; a.f[0] = 100; a.f[1] = 13; if (f (&a) != 139) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/strct-pack-4.c ================================================ typedef struct { unsigned char a __attribute__((packed)); unsigned short b __attribute__((packed)); } three_char_t; unsigned char my_set_a (void) { return 0xab; } unsigned short my_set_b (void) { return 0x1234; } main () { three_char_t three_char; three_char.a = my_set_a (); three_char.b = my_set_b (); if (three_char.a != 0xab || three_char.b != 0x1234) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/strct-stdarg-1.c ================================================ #include struct tiny { char c; char d; char e; char f; char g; }; f (int n, ...) { struct tiny x; int i; va_list ap; va_start (ap,n); for (i = 0; i < n; i++) { x = va_arg (ap,struct tiny); if (x.c != i + 10) abort(); if (x.d != i + 20) abort(); if (x.e != i + 30) abort(); if (x.f != i + 40) abort(); if (x.g != i + 50) abort(); } { long x = va_arg (ap, long); if (x != 123) abort(); } va_end (ap); } main () { struct tiny x[3]; x[0].c = 10; x[1].c = 11; x[2].c = 12; x[0].d = 20; x[1].d = 21; x[2].d = 22; x[0].e = 30; x[1].e = 31; x[2].e = 32; x[0].f = 40; x[1].f = 41; x[2].f = 42; x[0].g = 50; x[1].g = 51; x[2].g = 52; f (3, x[0], x[1], x[2], (long) 123); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/strct-varg-1.c ================================================ #include struct s { int x, y; }; f (int attr, ...) { struct s va_values; va_list va; int i; va_start (va, attr); if (attr != 2) abort (); va_values = va_arg (va, struct s); if (va_values.x != 0xaaaa || va_values.y != 0x5555) abort (); attr = va_arg (va, int); if (attr != 3) abort (); va_values = va_arg (va, struct s); if (va_values.x != 0xffff || va_values.y != 0x1111) abort (); va_end (va); } main () { struct s a, b; a.x = 0xaaaa; a.y = 0x5555; b.x = 0xffff; b.y = 0x1111; f (2, a, 3, b); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/string-opt-17.c ================================================ /* Copyright (C) 2003 Free Software Foundation. Test strcpy optimizations don't evaluate side-effects twice. Written by Jakub Jelinek, June 23, 2003. */ typedef __SIZE_TYPE__ size_t; extern char *strcpy (char *, const char *); extern int memcmp (const void *, const void *, size_t); extern void abort (void); extern void exit (int); size_t test1 (char *s, size_t i) { strcpy (s, "foobarbaz" + i++); return i; } size_t check2 (void) { static size_t r = 5; if (r != 5) abort (); return ++r; } void test2 (char *s) { strcpy (s, "foobarbaz" + check2 ()); } int main (void) { char buf[10]; if (test1 (buf, 7) != 8 || memcmp (buf, "az", 3)) abort (); test2 (buf); if (memcmp (buf, "baz", 4)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/string-opt-18.c ================================================ /* Copyright (C) 2003 Free Software Foundation. Test equal pointer optimizations don't break anything. Written by Roger Sayle, July 14, 2003. */ extern void abort (); typedef __SIZE_TYPE__ size_t; extern void *memcpy(void*, const void*, size_t); extern void *mempcpy(void*, const void*, size_t); extern void *memmove(void*, const void*, size_t); extern char *strcpy(char*, const char*); extern int memcmp(const void*, const void*, size_t); extern int strcmp(const char*, const char*); extern int strncmp(const char*, const char*, size_t); void test1 (void *ptr) { if (memcpy(ptr,ptr,8) != ptr) abort (); } void test2 (char *ptr) { if (mempcpy(ptr,ptr,8) != ptr+8) abort (); } void test3 (void *ptr) { if (memmove(ptr,ptr,8) != ptr) abort (); } void test4 (char *ptr) { if (strcpy(ptr,ptr) != ptr) abort (); } void test5 (void *ptr) { if (memcmp(ptr,ptr,8) != 0) abort (); } void test6 (const char *ptr) { if (strcmp(ptr,ptr) != 0) abort (); } void test7 (const char *ptr) { if (strncmp(ptr,ptr,8) != 0) abort (); } int main () { char buf[10]; test1 (buf); test2 (buf); test3 (buf); test4 (buf); test5 (buf); test6 (buf); test7 (buf); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/string-opt-5.c ================================================ /* Copyright (C) 2000 Free Software Foundation. Ensure builtin strlen, strcmp, strchr, strrchr and strncpy perform correctly. Written by Jakub Jelinek, 11/7/2000. */ extern void abort (void); extern __SIZE_TYPE__ strlen (const char *); extern int strcmp (const char *, const char *); extern char *strchr (const char *, int); extern char *strrchr (const char *, int); extern char *strncpy (char *, const char *, __SIZE_TYPE__); extern void *memset (void *, int, __SIZE_TYPE__); extern int memcmp (const void *, const void *, __SIZE_TYPE__); int x = 6; int y = 1; char *bar = "hi world"; char buf [64]; int main() { const char *const foo = "hello world"; char dst [64]; if (strlen (bar) != 8) abort (); if (strlen (bar + (++x & 2)) != 6) abort (); if (x != 7) abort (); if (strlen (foo + (x++, 6)) != 5) abort (); if (x != 8) abort (); if (strlen (foo + (++x & 1)) != 10) abort (); if (x != 9) abort (); if (strcmp (foo + (x -= 6), "lo world")) abort (); if (x != 3) abort (); if (strcmp (foo, bar) >= 0) abort (); if (strcmp (foo, bar + (x++ & 1)) >= 0) abort (); if (x != 4) abort (); if (strchr (foo + (x++ & 7), 'l') != foo + 9) abort (); if (x != 5) abort (); if (strchr (bar, 'o') != bar + 4) abort (); if (strchr (bar, '\0') != bar + 8) abort (); if (strrchr (bar, 'x')) abort (); if (strrchr (bar, 'o') != bar + 4) abort (); if (strcmp (foo + (x++ & 1), "ello world" + (--y & 1))) abort (); if (x != 6 || y != 0) abort (); dst[5] = ' '; dst[6] = '\0'; x = 5; y = 1; if (strncpy (dst + 1, foo + (x++ & 3), 4) != dst + 1 || x != 6 || strcmp (dst + 1, "ello ")) abort (); memset (dst, ' ', sizeof dst); if (strncpy (dst + (++x & 1), (y++ & 3) + "foo", 10) != dst + 1 || x != 7 || y != 2 || memcmp (dst, " oo\0\0\0\0\0\0\0\0 ", 12)) abort (); memset (dst, ' ', sizeof dst); if (strncpy (dst, "hello", 8) != dst || memcmp (dst, "hello\0\0\0 ", 9)) abort (); x = '!'; memset (buf, ' ', sizeof buf); if (memset (buf, x++, ++y) != buf || x != '!' + 1 || y != 3 || memcmp (buf, "!!!", 3)) abort (); if (memset (buf + y++, '-', 8) != buf + 3 || y != 4 || memcmp (buf, "!!!--------", 11)) abort (); x = 10; if (memset (buf + ++x, 0, y++) != buf + 11 || x != 11 || y != 5 || memcmp (buf + 8, "---\0\0\0", 7)) abort (); if (memset (buf + (x += 4), 0, 6) != buf + 15 || x != 15 || memcmp (buf + 10, "-\0\0\0\0\0\0\0\0\0", 11)) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/strlen-1.c ================================================ /* Copyright (C) 2002 Free Software Foundation. Test strlen with various combinations of pointer alignments and lengths to make sure any optimizations in the library are correct. Written by Michael Meissner, March 9, 2002. */ #include #include #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_TEST #define MAX_TEST (8 * sizeof (long long)) #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_TEST + MAX_EXTRA + 1) static union { char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u; main () { size_t off, len, len2, i; char *p; for (off = 0; off < MAX_OFFSET; off++) for (len = 0; len < MAX_TEST; len++) { p = u.buf; for (i = 0; i < off; i++) *p++ = '\0'; for (i = 0; i < len; i++) *p++ = 'a'; *p++ = '\0'; for (i = 0; i < MAX_EXTRA; i++) *p++ = 'b'; p = u.buf + off; len2 = strlen (p); if (len != len2) abort (); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/strncmp-1.c ================================================ /* { dg-xfail-if "kernel strncmp does not perform unsigned comparisons" { vxworks_kernel } "*" "" } */ /* Copyright (C) 2002 Free Software Foundation. Test strncmp with various combinations of pointer alignments and lengths to make sure any optimizations in the library are correct. Written by Michael Meissner, March 9, 2002. */ #include #include #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_TEST #define MAX_TEST (8 * sizeof (long long)) #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_TEST + MAX_EXTRA) static union { unsigned char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u1, u2; void test (const unsigned char *s1, const unsigned char *s2, size_t len, int expected) { int value = strncmp ((char *) s1, (char *) s2, len); if (expected < 0 && value >= 0) abort (); else if (expected == 0 && value != 0) abort (); else if (expected > 0 && value <= 0) abort (); } main () { size_t off1, off2, len, i; unsigned char *buf1, *buf2; unsigned char *mod1, *mod2; unsigned char *p1, *p2; for (off1 = 0; off1 < MAX_OFFSET; off1++) for (off2 = 0; off2 < MAX_OFFSET; off2++) for (len = 0; len < MAX_TEST; len++) { p1 = u1.buf; for (i = 0; i < off1; i++) *p1++ = '\0'; buf1 = p1; for (i = 0; i < len; i++) *p1++ = 'a'; mod1 = p1; for (i = 0; i < MAX_EXTRA; i++) *p1++ = 'x'; p2 = u2.buf; for (i = 0; i < off2; i++) *p2++ = '\0'; buf2 = p2; for (i = 0; i < len; i++) *p2++ = 'a'; mod2 = p2; for (i = 0; i < MAX_EXTRA; i++) *p2++ = 'x'; mod1[0] = '\0'; mod2[0] = '\0'; test (buf1, buf2, MAX_LENGTH, 0); test (buf1, buf2, len, 0); mod1[0] = 'a'; mod1[1] = '\0'; mod2[0] = '\0'; test (buf1, buf2, MAX_LENGTH, +1); test (buf1, buf2, len, 0); mod1[0] = '\0'; mod2[0] = 'a'; mod2[1] = '\0'; test (buf1, buf2, MAX_LENGTH, -1); test (buf1, buf2, len, 0); mod1[0] = 'b'; mod1[1] = '\0'; mod2[0] = 'c'; mod2[1] = '\0'; test (buf1, buf2, MAX_LENGTH, -1); test (buf1, buf2, len, 0); mod1[0] = 'c'; mod1[1] = '\0'; mod2[0] = 'b'; mod2[1] = '\0'; test (buf1, buf2, MAX_LENGTH, +1); test (buf1, buf2, len, 0); mod1[0] = 'b'; mod1[1] = '\0'; mod2[0] = (unsigned char)'\251'; mod2[1] = '\0'; test (buf1, buf2, MAX_LENGTH, -1); test (buf1, buf2, len, 0); mod1[0] = (unsigned char)'\251'; mod1[1] = '\0'; mod2[0] = 'b'; mod2[1] = '\0'; test (buf1, buf2, MAX_LENGTH, +1); test (buf1, buf2, len, 0); mod1[0] = (unsigned char)'\251'; mod1[1] = '\0'; mod2[0] = (unsigned char)'\252'; mod2[1] = '\0'; test (buf1, buf2, MAX_LENGTH, -1); test (buf1, buf2, len, 0); mod1[0] = (unsigned char)'\252'; mod1[1] = '\0'; mod2[0] = (unsigned char)'\251'; mod2[1] = '\0'; test (buf1, buf2, MAX_LENGTH, +1); test (buf1, buf2, len, 0); } exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/struct-aliasing-1.c ================================================ struct S { float f; }; int __attribute__((noinline)) foo (int *r, struct S *p) { int *q = (int *)&p->f; int i = *q; *r = 0; return i + *q; } extern void abort (void); int main() { int i = 1; if (foo (&i, (struct S *)&i) != 1) abort (); return (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/struct-cpy-1.c ================================================ /* powerpc64-linux gcc miscompiled this due to rs6000.c:expand_block_move not setting mem aliasing info correctly for the code implementing the structure assignment. */ struct termios { unsigned int a; unsigned int b; unsigned int c; unsigned int d; unsigned char pad[28]; }; struct tty_driver { unsigned char pad1[38]; struct termios t __attribute__ ((aligned (8))); }; static struct termios zero_t; static struct tty_driver pty; void ini (void) { pty.t = zero_t; pty.t.a = 1; pty.t.b = 2; pty.t.c = 3; pty.t.d = 4; } int main (void) { extern void abort (void); ini (); if (pty.t.a != 1 || pty.t.b != 2 || pty.t.c != 3 || pty.t.d != 4) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/struct-ini-1.c ================================================ struct S { char f1; int f2[2]; }; struct S object = {'X', 8, 9}; main () { if (object.f1 != 'X' || object.f2[0] != 8 || object.f2[1] != 9) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/struct-ini-2.c ================================================ struct { int a:4; int :4; int b:4; int c:4; } x = { 2,3,4 }; main () { if (x.a != 2) abort (); if (x.b != 3) abort (); if (x.c != 4) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/struct-ini-3.c ================================================ struct { unsigned int f1:1, f2:1, f3:3, f4:3, f5:2, f6:1, f7:1; } result = {1, 1, 7, 7, 3, 1, 1}; main () { if ((result.f3 & ~7) != 0 || (result.f4 & ~7) != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/struct-ini-4.c ================================================ struct s { int a[3]; int c[3]; }; struct s s = { c: {1, 2, 3} }; main() { if (s.c[0] != 1) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/struct-ret-1.c ================================================ #include #include char out[100]; typedef struct { double d; int i[3]; } B; typedef struct { char c[33],c1; } X; char c1 = 'a'; char c2 = 127; char c3 = (char)128; char c4 = (char)255; char c5 = -1; double d1 = 0.1; double d2 = 0.2; double d3 = 0.3; double d4 = 0.4; double d5 = 0.5; double d6 = 0.6; double d7 = 0.7; double d8 = 0.8; double d9 = 0.9; B B1 = {0.1,{1,2,3}}; B B2 = {0.2,{5,4,3}}; X X1 = {"abcdefghijklmnopqrstuvwxyzABCDEF", 'G'}; X X2 = {"123",'9'}; X X3 = {"return-return-return",'R'}; X f (B a, char b, double c, B d) { static X xr = {"return val", 'R'}; X r; r = xr; r.c1 = b; sprintf (out, "X f(B,char,double,B):({%g,{%d,%d,%d}},'%c',%g,{%g,{%d,%d,%d}})", a.d, a.i[0], a.i[1], a.i[2], b, c, d.d, d.i[0], d.i[1], d.i[2]); return r; } X (*fp) (B, char, double, B) = &f; main () { X Xr; char tmp[100]; Xr = f (B1, c2, d3, B2); strcpy (tmp, out); Xr.c[0] = Xr.c1 = '\0'; Xr = (*fp) (B1, c2, d3, B2); if (strcmp (tmp, out)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/struct-ret-2.c ================================================ typedef struct { unsigned char a __attribute__ ((packed)); unsigned short b __attribute__ ((packed)); } three_byte_t; unsigned char f (void) { return 0xab; } unsigned short g (void) { return 0x1234; } main () { three_byte_t three_byte; three_byte.a = f (); three_byte.b = g (); if (three_byte.a != 0xab || three_byte.b != 0x1234) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/switch-1.c ================================================ /* Copyright (C) 2003 Free Software Foundation. Test that switch statements suitable using case bit tests are implemented correctly. Written by Roger Sayle, 01/25/2001. */ extern void abort (void); int foo (int x) { switch (x) { case 4: case 6: case 9: case 11: return 30; } return 31; } int main () { int i, r; for (i=-1; i<66; i++) { r = foo (i); if (i == 4) { if (r != 30) abort (); } else if (i == 6) { if (r != 30) abort (); } else if (i == 9) { if (r != 30) abort (); } else if (i == 11) { if (r != 30) abort (); } else if (r != 31) abort (); } return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/tstdi-1.c ================================================ #define FALSE 140 #define TRUE 13 feq (x) long long int x; { if (x == 0) return TRUE; else return FALSE; } fne (x) long long int x; { if (x != 0) return TRUE; else return FALSE; } flt (x) long long int x; { if (x < 0) return TRUE; else return FALSE; } fge (x) long long int x; { if (x >= 0) return TRUE; else return FALSE; } fgt (x) long long int x; { if (x > 0) return TRUE; else return FALSE; } fle (x) long long int x; { if (x <= 0) return TRUE; else return FALSE; } main () { if (feq (0LL) != TRUE) abort (); if (feq (-1LL) != FALSE) abort (); if (feq (0x8000000000000000LL) != FALSE) abort (); if (feq (0x8000000000000001LL) != FALSE) abort (); if (feq (1LL) != FALSE) abort (); if (feq (0x7fffffffffffffffLL) != FALSE) abort (); if (fne (0LL) != FALSE) abort (); if (fne (-1LL) != TRUE) abort (); if (fne (0x8000000000000000LL) != TRUE) abort (); if (fne (0x8000000000000001LL) != TRUE) abort (); if (fne (1LL) != TRUE) abort (); if (fne (0x7fffffffffffffffLL) != TRUE) abort (); if (flt (0LL) != FALSE) abort (); if (flt (-1LL) != TRUE) abort (); if (flt (0x8000000000000000LL) != TRUE) abort (); if (flt (0x8000000000000001LL) != TRUE) abort (); if (flt (1LL) != FALSE) abort (); if (flt (0x7fffffffffffffffLL) != FALSE) abort (); if (fge (0LL) != TRUE) abort (); if (fge (-1LL) != FALSE) abort (); if (fge (0x8000000000000000LL) != FALSE) abort (); if (fge (0x8000000000000001LL) != FALSE) abort (); if (fge (1LL) != TRUE) abort (); if (fge (0x7fffffffffffffffLL) != TRUE) abort (); if (fgt (0LL) != FALSE) abort (); if (fgt (-1LL) != FALSE) abort (); if (fgt (0x8000000000000000LL) != FALSE) abort (); if (fgt (0x8000000000000001LL) != FALSE) abort (); if (fgt (1LL) != TRUE) abort (); if (fgt (0x7fffffffffffffffLL) != TRUE) abort (); if (fle (0LL) != TRUE) abort (); if (fle (-1LL) != TRUE) abort (); if (fle (0x8000000000000000LL) != TRUE) abort (); if (fle (0x8000000000000001LL) != TRUE) abort (); if (fle (1LL) != FALSE) abort (); if (fle (0x7fffffffffffffffLL) != FALSE) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/unroll-1.c ================================================ /* { dg-options "-fgnu89-inline" } */ extern void abort (void); extern void exit (int); inline int f (int x) { return (x + 1); } int main (void) { int a = 0 ; while ( (f(f(f(f(f(f(f(f(f(f(1))))))))))) + a < 12 ) { a++; exit (0); } if (a != 1) abort(); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/usmul.c ================================================ /* { dg-require-effective-target int32plus } */ int __attribute__ ((noinline)) foo (short x, unsigned short y) { return x * y; } int __attribute__ ((noinline)) bar (unsigned short x, short y) { return x * y; } int main () { if (foo (-2, 0xffff) != -131070) abort (); if (foo (2, 0xffff) != 131070) abort (); if (foo (-32768, 0x8000) != -1073741824) abort (); if (foo (32767, 0x8000) != 1073709056) abort (); if (bar (0xffff, -2) != -131070) abort (); if (bar (0xffff, 2) != 131070) abort (); if (bar (0x8000, -32768) != -1073741824) abort (); if (bar (0x8000, 32767) != 1073709056) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-1.c ================================================ #include typedef unsigned long L; f (L p0, L p1, L p2, L p3, L p4, L p5, L p6, L p7, L p8, ...) { va_list select; va_start (select, p8); if (va_arg (select, L) != 10) abort (); if (va_arg (select, L) != 11) abort (); if (va_arg (select, L) != 0) abort (); va_end (select); } main () { f (1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 0L); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-10.c ================================================ /* This is a modfied version of va-arg-9.c to test va_copy. */ #include #ifndef va_copy #define va_copy __va_copy #endif extern __SIZE_TYPE__ strlen (const char *); int to_hex (unsigned int a) { static char hex[] = "0123456789abcdef"; if (a > 15) abort (); return hex[a]; } void fap (int i, char* format, va_list ap) { va_list apc; char *formatc; va_copy (apc, ap); formatc = format; if (strlen (format) != 16 - i) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); while (*formatc) if (*formatc++ != to_hex (va_arg (apc, int))) abort (); } void f0 (char* format, ...) { va_list ap; va_start (ap, format); fap(0, format, ap); va_end(ap); } void f1 (int a1, char* format, ...) { va_list ap; va_start(ap, format); fap(1, format, ap); va_end(ap); } void f2 (int a1, int a2, char* format, ...) { va_list ap; va_start(ap, format); fap(2, format, ap); va_end(ap); } void f3 (int a1, int a2, int a3, char* format, ...) { va_list ap; va_start(ap, format); fap(3, format, ap); va_end(ap); } void f4 (int a1, int a2, int a3, int a4, char* format, ...) { va_list ap; va_start(ap, format); fap(4, format, ap); va_end(ap); } void f5 (int a1, int a2, int a3, int a4, int a5, char* format, ...) { va_list ap; va_start(ap, format); fap(5, format, ap); va_end(ap); } void f6 (int a1, int a2, int a3, int a4, int a5, int a6, char* format, ...) { va_list ap; va_start(ap, format); fap(6, format, ap); va_end(ap); } void f7 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, char* format, ...) { va_list ap; va_start(ap, format); fap(7, format, ap); va_end(ap); } void f8 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, char* format, ...) { va_list ap; va_start(ap, format); fap(8, format, ap); va_end(ap); } void f9 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, char* format, ...) { va_list ap; va_start(ap, format); fap(9, format, ap); va_end(ap); } void f10 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, char* format, ...) { va_list ap; va_start(ap, format); fap(10, format, ap); va_end(ap); } void f11 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, char* format, ...) { va_list ap; va_start(ap, format); fap(11, format, ap); va_end(ap); } void f12 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, char* format, ...) { va_list ap; va_start(ap, format); fap(12, format, ap); va_end(ap); } void f13 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, char* format, ...) { va_list ap; va_start(ap, format); fap(13, format, ap); va_end(ap); } void f14 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, int a14, char* format, ...) { va_list ap; va_start(ap, format); fap(14, format, ap); va_end(ap); } void f15 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, int a14, int a15, char* format, ...) { va_list ap; va_start(ap, format); fap(15, format, ap); va_end(ap); } main () { char *f = "0123456789abcdef"; f0 (f+0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f1 (0, f+1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f2 (0, 1, f+2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f3 (0, 1, 2, f+3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f4 (0, 1, 2, 3, f+4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f5 (0, 1, 2, 3, 4, f+5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f6 (0, 1, 2, 3, 4, 5, f+6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f7 (0, 1, 2, 3, 4, 5, 6, f+7, 7, 8, 9, 10, 11, 12, 13, 14, 15); f8 (0, 1, 2, 3, 4, 5, 6, 7, f+8, 8, 9, 10, 11, 12, 13, 14, 15); f9 (0, 1, 2, 3, 4, 5, 6, 7, 8, f+9, 9, 10, 11, 12, 13, 14, 15); f10 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, f+10, 10, 11, 12, 13, 14, 15); f11 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, f+11, 11, 12, 13, 14, 15); f12 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, f+12, 12, 13, 14, 15); f13 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, f+13, 13, 14, 15); f14 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, f+14, 14, 15); f15 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, f+15, 15); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-11.c ================================================ /* Test va_arg when the result is ignored and only the pointer increment side effect is used. */ #include static int foo (int a, ...) { va_list va; int i, res; va_start (va, a); for (i = 0; i < 4; ++i) (void) va_arg (va, int); res = va_arg (va, int); va_end (va); return res; } int main (void) { if (foo (5, 4, 3, 2, 1, 0)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-12.c ================================================ #include /*typedef unsigned long L;*/ typedef double L; void f (L p0, L p1, L p2, L p3, L p4, L p5, L p6, L p7, L p8, ...) { va_list select; va_start (select, p8); if (va_arg (select, L) != 10.) abort (); if (va_arg (select, L) != 11.) abort (); if (va_arg (select, L) != 0.) abort (); va_end (select); } int main () { f (1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 0.); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-13.c ================================================ /* derived from mozilla source code */ #include typedef struct { void *stream; va_list ap; int nChar; } ScanfState; void dummy (va_list vap) { if (va_arg (vap, int) != 1234) abort(); return; } void test (int fmt, ...) { ScanfState state, *statep; statep = &state; va_start (statep->ap, fmt); dummy (statep->ap); va_end (statep->ap); va_start (state.ap, fmt); dummy (state.ap); va_end (state.ap); return; } int main (void) { test (456, 1234); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-14.c ================================================ #include va_list global; void vat(va_list param, ...) { va_list local; va_start (local, param); va_copy (global, local); va_copy (param, local); if (va_arg (local, int) != 1) abort(); va_end (local); if (va_arg (global, int) != 1) abort(); va_end (global); if (va_arg (param, int) != 1) abort(); va_end (param); va_start (param, param); va_start (global, param); va_copy (local, param); if (va_arg (local, int) != 1) abort(); va_end (local); va_copy (local, global); if (va_arg (local, int) != 1) abort(); va_end (local); if (va_arg (global, int) != 1) abort(); va_end (global); if (va_arg (param, int) != 1) abort(); va_end (param); } int main(void) { va_list t; vat (t, 1); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-15.c ================================================ #include void vafunction (char *dummy, ...) { double darg; int iarg; int flag = 0; int i; va_list ap; va_start(ap, dummy); for (i = 1; i <= 18; i++, flag++) { if (flag & 1) { darg = va_arg (ap, double); if (darg != (double)i) abort(); } else { iarg = va_arg (ap, int); if (iarg != i) abort(); } } va_end(ap); } int main (void) { vafunction( "", 1, 2., 3, 4., 5, 6., 7, 8., 9, 10., 11, 12., 13, 14., 15, 16., 17, 18. ); exit(0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-16.c ================================================ #include typedef double TYPE; void vafunction (TYPE dummy1, TYPE dummy2, ...) { va_list ap; va_start(ap, dummy2); if (dummy1 != 888.) abort(); if (dummy2 != 999.) abort(); if (va_arg (ap, TYPE) != 1.) abort(); if (va_arg (ap, TYPE) != 2.) abort(); if (va_arg (ap, TYPE) != 3.) abort(); if (va_arg (ap, TYPE) != 4.) abort(); if (va_arg (ap, TYPE) != 5.) abort(); if (va_arg (ap, TYPE) != 6.) abort(); if (va_arg (ap, TYPE) != 7.) abort(); if (va_arg (ap, TYPE) != 8.) abort(); if (va_arg (ap, TYPE) != 9.) abort(); va_end(ap); } int main (void) { vafunction( 888., 999., 1., 2., 3., 4., 5., 6., 7., 8., 9. ); exit(0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-17.c ================================================ #include typedef double TYPE; void vafunction (char *dummy, ...) { va_list ap; va_start(ap, dummy); if (va_arg (ap, TYPE) != 1.) abort(); if (va_arg (ap, TYPE) != 2.) abort(); if (va_arg (ap, TYPE) != 3.) abort(); if (va_arg (ap, TYPE) != 4.) abort(); if (va_arg (ap, TYPE) != 5.) abort(); if (va_arg (ap, TYPE) != 6.) abort(); if (va_arg (ap, TYPE) != 7.) abort(); if (va_arg (ap, TYPE) != 8.) abort(); if (va_arg (ap, TYPE) != 9.) abort(); va_end(ap); } int main (void) { vafunction( "", 1., 2., 3., 4., 5., 6., 7., 8., 9. ); exit(0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-18.c ================================================ #include typedef double L; void f (L p0, L p1, L p2, L p3, L p4, L p5, L p6, L p7, L p8, ...) { va_list select; va_start (select, p8); if (va_arg (select, int) != 10) abort (); if (va_arg (select, int) != 11) abort (); if (va_arg (select, int) != 12) abort (); va_end (select); } int main () { f (1., 2., 3., 4., 5., 6., 7., 8., 9., 10, 11, 12); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-19.c ================================================ #include typedef int TYPE; void vafunction (char *dummy, ...) { va_list ap; va_start(ap, dummy); if (va_arg (ap, TYPE) != 1) abort(); if (va_arg (ap, TYPE) != 2) abort(); if (va_arg (ap, TYPE) != 3) abort(); if (va_arg (ap, TYPE) != 4) abort(); if (va_arg (ap, TYPE) != 5) abort(); if (va_arg (ap, TYPE) != 6) abort(); if (va_arg (ap, TYPE) != 7) abort(); if (va_arg (ap, TYPE) != 8) abort(); if (va_arg (ap, TYPE) != 9) abort(); va_end(ap); } int main (void) { vafunction( "", 1, 2, 3, 4, 5, 6, 7, 8, 9 ); exit(0); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-2.c ================================================ /* The purpose of this test is to catch edge cases when arguments are passed in regs and on the stack. We test 16 cases, trying to catch multiple targets (some use 3 regs for argument passing, some use 12, etc.). We test both the arguments and the `lastarg' (the argument to va_start). */ #include extern __SIZE_TYPE__ strlen (); int to_hex (unsigned int a) { static char hex[] = "0123456789abcdef"; if (a > 15) abort (); return hex[a]; } void f0 (char* format, ...) { va_list ap; va_start (ap, format); if (strlen (format) != 16 - 0) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f1 (int a1, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 1) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f2 (int a1, int a2, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 2) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f3 (int a1, int a2, int a3, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 3) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f4 (int a1, int a2, int a3, int a4, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 4) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f5 (int a1, int a2, int a3, int a4, int a5, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 5) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f6 (int a1, int a2, int a3, int a4, int a5, int a6, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 6) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f7 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 7) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f8 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 8) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f9 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 9) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f10 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 10) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f11 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 11) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f12 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 12) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f13 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 13) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f14 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, int a14, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 14) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } void f15 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, int a14, int a15, char* format, ...) { va_list ap; va_start(ap, format); if (strlen (format) != 16 - 15) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); va_end(ap); } main () { char *f = "0123456789abcdef"; f0 (f+0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f1 (0, f+1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f2 (0, 1, f+2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f3 (0, 1, 2, f+3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f4 (0, 1, 2, 3, f+4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f5 (0, 1, 2, 3, 4, f+5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f6 (0, 1, 2, 3, 4, 5, f+6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f7 (0, 1, 2, 3, 4, 5, 6, f+7, 7, 8, 9, 10, 11, 12, 13, 14, 15); f8 (0, 1, 2, 3, 4, 5, 6, 7, f+8, 8, 9, 10, 11, 12, 13, 14, 15); f9 (0, 1, 2, 3, 4, 5, 6, 7, 8, f+9, 9, 10, 11, 12, 13, 14, 15); f10 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, f+10, 10, 11, 12, 13, 14, 15); f11 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, f+11, 11, 12, 13, 14, 15); f12 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, f+12, 12, 13, 14, 15); f13 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, f+13, 13, 14, 15); f14 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, f+14, 14, 15); f15 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, f+15, 15); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-20.c ================================================ #include void foo(va_list v) { unsigned long long x = va_arg (v, unsigned long long); if (x != 16LL) abort(); } void bar(char c, char d, ...) { va_list v; va_start(v, d); foo(v); va_end(v); } int main(void) { bar(0, 0, 16LL); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-21.c ================================================ /* Copyright (C) 2000 Free Software Foundation. If the argument to va_end() has side effects, test whether side effects from that argument are honored. Written by Kaveh R. Ghazi, 10/31/2000. */ #include #include #include #ifndef __GNUC__ #define __attribute__(x) #endif static void __attribute__ ((__format__ (__printf__, 1, 2))) doit (const char *s, ...) { va_list *ap_array[3], **ap_ptr = ap_array; ap_array[0] = malloc (sizeof(va_list)); ap_array[1] = NULL; ap_array[2] = malloc (sizeof(va_list)); va_start (*ap_array[0], s); vprintf (s, **ap_ptr); /* Increment the va_list pointer once. */ va_end (**ap_ptr++); /* Increment the va_list pointer a second time. */ ap_ptr++; va_start (*ap_array[2], s); /* If we failed to increment ap_ptr twice, then the parameter passed in here will dereference NULL and should cause a crash. */ vprintf (s, **ap_ptr); va_end (**ap_ptr); /* Just in case, If *ap_ptr is NULL abort anyway. */ if (*ap_ptr == 0) abort(); } int main() { doit ("%s", "hello world\n"); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-22.c ================================================ #include extern void abort (void); extern void exit (int); void bar (int n, int c) { static int lastn = -1, lastc = -1; if (lastn != n) { if (lastc != lastn) abort (); lastc = 0; lastn = n; } if (c != (char) (lastc ^ (n << 3))) abort (); lastc++; } #define D(N) typedef struct { char x[N]; } A##N; D(0) D(1) D(2) D(3) D(4) D(5) D(6) D(7) D(8) D(9) D(10) D(11) D(12) D(13) D(14) D(15) D(16) D(31) D(32) D(35) D(72) #undef D void foo (int size, ...) { #define D(N) A##N a##N; D(0) D(1) D(2) D(3) D(4) D(5) D(6) D(7) D(8) D(9) D(10) D(11) D(12) D(13) D(14) D(15) D(16) D(31) D(32) D(35) D(72) #undef D va_list ap; int i; if (size != 21) abort (); va_start (ap, size); #define D(N) \ a##N = va_arg (ap, typeof (a##N)); \ for (i = 0; i < N; i++) \ bar (N, a##N.x[i]); D(0) D(1) D(2) D(3) D(4) D(5) D(6) D(7) D(8) D(9) D(10) D(11) D(12) D(13) D(14) D(15) D(16) D(31) D(32) D(35) D(72) #undef D va_end (ap); } int main (void) { #define D(N) A##N a##N; D(0) D(1) D(2) D(3) D(4) D(5) D(6) D(7) D(8) D(9) D(10) D(11) D(12) D(13) D(14) D(15) D(16) D(31) D(32) D(35) D(72) #undef D int i; #define D(N) \ for (i = 0; i < N; i++) \ a##N.x[i] = i ^ (N << 3); D(0) D(1) D(2) D(3) D(4) D(5) D(6) D(7) D(8) D(9) D(10) D(11) D(12) D(13) D(14) D(15) D(16) D(31) D(32) D(35) D(72) #undef D foo (21 #define D(N) , a##N D(0) D(1) D(2) D(3) D(4) D(5) D(6) D(7) D(8) D(9) D(10) D(11) D(12) D(13) D(14) D(15) D(16) D(31) D(32) D(35) D(72) #undef D ); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-23.c ================================================ /* PR 9700 */ /* Alpha got the base address for the va_list incorrect when there was a structure that was passed partially in registers and partially on the stack. */ #include struct two { long x, y; }; void foo(int a, int b, int c, int d, int e, struct two f, int g, ...) { va_list args; int h; va_start(args, g); h = va_arg(args, int); if (g != 1 || h != 2) abort (); } int main() { struct two t = { 0, 0 }; foo(0, 0, 0, 0, 0, t, 1, 2); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-24.c ================================================ /* The purpose of this code is to test argument passing of a tuple of 11 integers, with the break point between named and unnamed arguments at every possible position. */ #include #include #include static int errors = 0; static void verify (const char *tcase, int n[11]) { int i; for (i = 0; i <= 10; i++) if (n[i] != i) { printf (" %s: n[%d] = %d expected %d\n", tcase, i, n[i], i); errors++; } } #define STR(x) #x #define p(i) int q##i, #define P(i) n[i] = q##i; #define p0 p(0) #define p1 p(1) #define p2 p(2) #define p3 p(3) #define p4 p(4) #define p5 p(5) #define p6 p(6) #define p7 p(7) #define p8 p(8) #define p9 p(9) #define P0 P(0) #define P1 P(1) #define P2 P(2) #define P3 P(3) #define P4 P(4) #define P5 P(5) #define P6 P(6) #define P7 P(7) #define P8 P(8) #define P9 P(9) #define TCASE(x, params, vecinit) \ static void \ varargs##x (params ...) \ { \ va_list ap; \ int n[11]; \ int i; \ \ va_start (ap, q##x); \ vecinit \ for (i = x + 1; i <= 10; i++) \ n[i] = va_arg (ap, int); \ va_end (ap); \ \ verify (STR(varargs##x), n); \ } #define TEST(x) varargs##x (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) TCASE(0, p0 , P0 ) TCASE(1, p0 p1 , P0 P1 ) TCASE(2, p0 p1 p2 , P0 P1 P2 ) TCASE(3, p0 p1 p2 p3 , P0 P1 P2 P3 ) TCASE(4, p0 p1 p2 p3 p4 , P0 P1 P2 P3 P4 ) TCASE(5, p0 p1 p2 p3 p4 p5 , P0 P1 P2 P3 P4 P5 ) TCASE(6, p0 p1 p2 p3 p4 p5 p6 , P0 P1 P2 P3 P4 P5 P6 ) TCASE(7, p0 p1 p2 p3 p4 p5 p6 p7 , P0 P1 P2 P3 P4 P5 P6 P7 ) TCASE(8, p0 p1 p2 p3 p4 p5 p6 p7 p8 , P0 P1 P2 P3 P4 P5 P6 P7 P8 ) TCASE(9, p0 p1 p2 p3 p4 p5 p6 p7 p8 p9, P0 P1 P2 P3 P4 P5 P6 P7 P8 P9) int main(void) { TEST(0); TEST(1); TEST(2); TEST(3); TEST(4); TEST(5); TEST(6); TEST(7); TEST(8); TEST(9); if (errors) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-26.c ================================================ #include double f (float f1, float f2, float f3, float f4, float f5, float f6, ...) { va_list ap; double d; va_start (ap, f6); d = va_arg (ap, double); va_end (ap); return d; } int main () { if (f (1, 2, 3, 4, 5, 6, 7.0) != 7.0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-4.c ================================================ /* On the i960 any arg bigger than 16 bytes causes all subsequent args to be passed on the stack. We test this. */ #include typedef struct { char a[32]; } big; void f (big x, char *s, ...) { va_list ap; if (x.a[0] != 'a' || x.a[1] != 'b' || x.a[2] != 'c') abort (); va_start (ap, s); if (va_arg (ap, int) != 42) abort (); if (va_arg (ap, int) != 'x') abort (); if (va_arg (ap, int) != 0) abort (); va_end (ap); } main () { static big x = { "abc" }; f (x, "", 42, 'x', 0); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-5.c ================================================ #include va_double (int n, ...) { va_list args; va_start (args, n); if (va_arg (args, double) != 3.141592) abort (); if (va_arg (args, double) != 2.71827) abort (); if (va_arg (args, double) != 2.2360679) abort (); if (va_arg (args, double) != 2.1474836) abort (); va_end (args); } va_long_double (int n, ...) { va_list args; va_start (args, n); if (va_arg (args, long double) != 3.141592L) abort (); if (va_arg (args, long double) != 2.71827L) abort (); if (va_arg (args, long double) != 2.2360679L) abort (); if (va_arg (args, long double) != 2.1474836L) abort (); va_end (args); } main () { va_double (4, 3.141592, 2.71827, 2.2360679, 2.1474836); va_long_double (4, 3.141592L, 2.71827L, 2.2360679L, 2.1474836L); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-6.c ================================================ #include f (int n, ...) { va_list args; va_start (args, n); if (va_arg (args, int) != 10) abort (); if (va_arg (args, long long) != 10000000000LL) abort (); if (va_arg (args, int) != 11) abort (); if (va_arg (args, long double) != 3.14L) abort (); if (va_arg (args, int) != 12) abort (); if (va_arg (args, int) != 13) abort (); if (va_arg (args, long long) != 20000000000LL) abort (); if (va_arg (args, int) != 14) abort (); if (va_arg (args, double) != 2.72) abort (); va_end(args); } main () { f (4, 10, 10000000000LL, 11, 3.14L, 12, 13, 20000000000LL, 14, 2.72); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-7.c ================================================ /* Origin: Franz Sirl */ /* { dg-options "-fgnu89-inline" } */ extern void abort (void); extern void exit (int); #include inline void debug(int i1, int i2, int i3, int i4, int i5, int i6, int i7, double f1, double f2, double f3, double f4, double f5, double f6, double f7, double f8, double f9, ...) { va_list ap; va_start (ap, f9); if (va_arg (ap,int) != 8) abort (); if (va_arg (ap,int) != 9) abort (); if (va_arg (ap,int) != 10) abort (); va_end (ap); } int main(void) { debug (1, 2, 3, 4, 5, 6, 7, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 8, 9, 10); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-8.c ================================================ /* Origin: Franz Sirl */ /* { dg-options "-fgnu89-inline" } */ extern void abort (void); extern void exit (int); #include #include #if __LONG_LONG_MAX__ == 9223372036854775807LL typedef long long int INT64; inline void debug(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, ...) { va_list ap; va_start (ap, i9); if (va_arg (ap,int) != 10) abort (); if (va_arg (ap,INT64) != 0x123400005678LL) abort (); va_end (ap); } int main(void) { debug(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0x123400005678LL); exit(0); } #else int main(void) { exit(0); } #endif /* long long 64 bits */ ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-9.c ================================================ /* This is a modfied version of va-arg-2.c to test passing a va_list as a parameter to another function. */ #include extern __SIZE_TYPE__ strlen (const char *); int to_hex (unsigned int a) { static char hex[] = "0123456789abcdef"; if (a > 15) abort (); return hex[a]; } void fap (int i, char* format, va_list ap) { if (strlen (format) != 16 - i) abort (); while (*format) if (*format++ != to_hex (va_arg (ap, int))) abort (); } void f0 (char* format, ...) { va_list ap; va_start (ap, format); fap(0, format, ap); va_end(ap); } void f1 (int a1, char* format, ...) { va_list ap; va_start(ap, format); fap(1, format, ap); va_end(ap); } void f2 (int a1, int a2, char* format, ...) { va_list ap; va_start(ap, format); fap(2, format, ap); va_end(ap); } void f3 (int a1, int a2, int a3, char* format, ...) { va_list ap; va_start(ap, format); fap(3, format, ap); va_end(ap); } void f4 (int a1, int a2, int a3, int a4, char* format, ...) { va_list ap; va_start(ap, format); fap(4, format, ap); va_end(ap); } void f5 (int a1, int a2, int a3, int a4, int a5, char* format, ...) { va_list ap; va_start(ap, format); fap(5, format, ap); va_end(ap); } void f6 (int a1, int a2, int a3, int a4, int a5, int a6, char* format, ...) { va_list ap; va_start(ap, format); fap(6, format, ap); va_end(ap); } void f7 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, char* format, ...) { va_list ap; va_start(ap, format); fap(7, format, ap); va_end(ap); } void f8 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, char* format, ...) { va_list ap; va_start(ap, format); fap(8, format, ap); va_end(ap); } void f9 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, char* format, ...) { va_list ap; va_start(ap, format); fap(9, format, ap); va_end(ap); } void f10 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, char* format, ...) { va_list ap; va_start(ap, format); fap(10, format, ap); va_end(ap); } void f11 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, char* format, ...) { va_list ap; va_start(ap, format); fap(11, format, ap); va_end(ap); } void f12 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, char* format, ...) { va_list ap; va_start(ap, format); fap(12, format, ap); va_end(ap); } void f13 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, char* format, ...) { va_list ap; va_start(ap, format); fap(13, format, ap); va_end(ap); } void f14 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, int a14, char* format, ...) { va_list ap; va_start(ap, format); fap(14, format, ap); va_end(ap); } void f15 (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, int a14, int a15, char* format, ...) { va_list ap; va_start(ap, format); fap(15, format, ap); va_end(ap); } main () { char *f = "0123456789abcdef"; f0 (f+0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f1 (0, f+1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f2 (0, 1, f+2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f3 (0, 1, 2, f+3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f4 (0, 1, 2, 3, f+4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f5 (0, 1, 2, 3, 4, f+5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f6 (0, 1, 2, 3, 4, 5, f+6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); f7 (0, 1, 2, 3, 4, 5, 6, f+7, 7, 8, 9, 10, 11, 12, 13, 14, 15); f8 (0, 1, 2, 3, 4, 5, 6, 7, f+8, 8, 9, 10, 11, 12, 13, 14, 15); f9 (0, 1, 2, 3, 4, 5, 6, 7, 8, f+9, 9, 10, 11, 12, 13, 14, 15); f10 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, f+10, 10, 11, 12, 13, 14, 15); f11 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, f+11, 11, 12, 13, 14, 15); f12 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, f+12, 12, 13, 14, 15); f13 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, f+13, 13, 14, 15); f14 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, f+14, 14, 15); f15 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, f+15, 15); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-pack-1.c ================================================ /* __builtin_va_arg_pack () builtin tests. */ #include extern void abort (void); int v1 = 8; long int v2 = 3; void *v3 = (void *) &v2; struct A { char c[16]; } v4 = { "foo" }; long double v5 = 40; char seen[20]; int cnt; __attribute__ ((noinline)) int foo1 (int x, int y, ...) { int i; long int l; void *v; struct A a; long double ld; va_list ap; va_start (ap, y); if (x < 0 || x >= 20 || seen[x]) abort (); seen[x] = ++cnt; if (y != 6) abort (); i = va_arg (ap, int); if (i != 5) abort (); switch (x) { case 0: i = va_arg (ap, int); if (i != 9 || v1 != 9) abort (); a = va_arg (ap, struct A); if (__builtin_memcmp (a.c, v4.c, sizeof (a.c)) != 0) abort (); v = (void *) va_arg (ap, struct A *); if (v != (void *) &v4) abort (); l = va_arg (ap, long int); if (l != 3 || v2 != 4) abort (); break; case 1: ld = va_arg (ap, long double); if (ld != 41 || v5 != ld) abort (); i = va_arg (ap, int); if (i != 8) abort (); v = va_arg (ap, void *); if (v != &v2) abort (); break; case 2: break; default: abort (); } va_end (ap); return x; } __attribute__ ((noinline)) int foo2 (int x, int y, ...) { long long int ll; void *v; struct A a, b; long double ld; va_list ap; va_start (ap, y); if (x < 0 || x >= 20 || seen[x]) abort (); seen[x] = ++cnt | 64; if (y != 10) abort (); switch (x) { case 11: break; case 12: ld = va_arg (ap, long double); if (ld != 41 || v5 != 40) abort (); a = va_arg (ap, struct A); if (__builtin_memcmp (a.c, v4.c, sizeof (a.c)) != 0) abort (); b = va_arg (ap, struct A); if (__builtin_memcmp (b.c, v4.c, sizeof (b.c)) != 0) abort (); v = va_arg (ap, void *); if (v != &v2) abort (); ll = va_arg (ap, long long int); if (ll != 16LL) abort (); break; case 2: break; default: abort (); } va_end (ap); return x + 8; } __attribute__ ((noinline)) int foo3 (void) { return 6; } extern inline __attribute__ ((always_inline, gnu_inline)) int bar (int x, ...) { if (x < 10) return foo1 (x, foo3 (), 5, __builtin_va_arg_pack ()); return foo2 (x, foo3 () + 4, __builtin_va_arg_pack ()); } int main (void) { if (bar (0, ++v1, v4, &v4, v2++) != 0) abort (); if (bar (1, ++v5, 8, v3) != 1) abort (); if (bar (2) != 2) abort (); if (bar (v1 + 2) != 19) abort (); if (bar (v1 + 3, v5--, v4, v4, v3, 16LL) != 20) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/va-arg-trap-1.c ================================================ /* Undefined behavior from a call to va_arg with a type other than that of the argument passed (in particular, with a type such as "float" that can never be the type of an argument passed through "...") does not appear until after the va_list expression is evaluated. PR 38483. */ /* Origin: Joseph Myers */ #include extern void exit (int); extern void abort (void); va_list ap; float f; va_list * foo (void) { exit (0); return ≈ } void bar (int i, ...) { va_start (ap, i); f = va_arg (*foo (), float); va_end (ap); } int main (void) { bar (1, 0); abort (); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/vfprintf-1.c ================================================ /* { dg-skip-if "requires io" { freestanding } { "*" } { "" } } */ #ifndef test #include #include #include void inner (int x, ...) { va_list ap, ap2; va_start (ap, x); va_start (ap2, x); switch (x) { #define test(n, ret, fmt, args) \ case n: \ vfprintf (stdout, fmt, ap); \ if (vfprintf (stdout, fmt, ap2) != ret) \ abort (); \ break; #include "vfprintf-1.c" #undef test default: abort (); } va_end (ap); va_end (ap2); } int main (void) { #define test(n, ret, fmt, args) \ inner args; #include "vfprintf-1.c" #undef test return 0; } #else test (0, 5, "hello", (0)); test (1, 6, "hello\n", (1)); test (2, 1, "a", (2)); test (3, 0, "", (3)); test (4, 5, "%s", (4, "hello")); test (5, 6, "%s", (5, "hello\n")); test (6, 1, "%s", (6, "a")); test (7, 0, "%s", (7, "")); test (8, 1, "%c", (8, 'x')); test (9, 7, "%s\n", (9, "hello\n")); test (10, 2, "%d\n", (10, 0)); #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/vfprintf-chk-1.c ================================================ /* { dg-skip-if "requires io" { freestanding } { "*" } { "" } } */ #ifndef test #include #include #include volatile int should_optimize; int __attribute__((noinline)) __vfprintf_chk (FILE *f, int flag, const char *fmt, va_list ap) { #ifdef __OPTIMIZE__ if (should_optimize) abort (); #endif should_optimize = 1; return vfprintf (f, fmt, ap); } void inner (int x, ...) { va_list ap, ap2; va_start (ap, x); va_start (ap2, x); switch (x) { #define test(n, ret, opt, fmt, args) \ case n: \ should_optimize = opt; \ __vfprintf_chk (stdout, 1, fmt, ap); \ if (! should_optimize) \ abort (); \ should_optimize = 0; \ if (__vfprintf_chk (stdout, 1, fmt, ap2) != ret) \ abort (); \ if (! should_optimize) \ abort (); \ break; #include "vfprintf-chk-1.c" #undef test default: abort (); } va_end (ap); va_end (ap2); } int main (void) { #define test(n, ret, opt, fmt, args) \ inner args; #include "vfprintf-chk-1.c" #undef test return 0; } #else test (0, 5, 1, "hello", (0)); test (1, 6, 1, "hello\n", (1)); test (2, 1, 1, "a", (2)); test (3, 0, 1, "", (3)); test (4, 5, 0, "%s", (4, "hello")); test (5, 6, 0, "%s", (5, "hello\n")); test (6, 1, 0, "%s", (6, "a")); test (7, 0, 0, "%s", (7, "")); test (8, 1, 0, "%c", (8, 'x')); test (9, 7, 0, "%s\n", (9, "hello\n")); test (10, 2, 0, "%d\n", (10, 0)); #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c ================================================ /* VLAs should be deallocated on a jump to before their definition, including a jump to a label in an inner scope. PR 19771. */ /* { dg-require-effective-target alloca } */ #if (__SIZEOF_INT__ <= 2) #define LIMIT 10000 #else #define LIMIT 1000000 #endif void *volatile p; int main (void) { int n = 0; if (0) { lab:; } int x[n % 1000 + 1]; x[0] = 1; x[n % 1000] = 2; p = x; n++; if (n < LIMIT) goto lab; return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/vprintf-1.c ================================================ /* { dg-skip-if "requires io" { freestanding } { "*" } { "" } } */ #ifndef test #include #include #include void inner (int x, ...) { va_list ap, ap2; va_start (ap, x); va_start (ap2, x); switch (x) { #define test(n, ret, fmt, args) \ case n: \ vprintf (fmt, ap); \ if (vprintf (fmt, ap2) != ret) \ abort (); \ break; #include "vprintf-1.c" #undef test default: abort (); } va_end (ap); va_end (ap2); } int main (void) { #define test(n, ret, fmt, args) \ inner args; #include "vprintf-1.c" #undef test return 0; } #else test (0, 5, "hello", (0)); test (1, 6, "hello\n", (1)); test (2, 1, "a", (2)); test (3, 0, "", (3)); test (4, 5, "%s", (4, "hello")); test (5, 6, "%s", (5, "hello\n")); test (6, 1, "%s", (6, "a")); test (7, 0, "%s", (7, "")); test (8, 1, "%c", (8, 'x')); test (9, 7, "%s\n", (9, "hello\n")); test (10, 2, "%d\n", (10, 0)); #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/vprintf-chk-1.c ================================================ /* { dg-skip-if "requires io" { freestanding } { "*" } { "" } } */ #ifndef test #include #include #include volatile int should_optimize; int __attribute__((noinline)) __vprintf_chk (int flag, const char *fmt, va_list ap) { #ifdef __OPTIMIZE__ if (should_optimize) abort (); #endif should_optimize = 1; return vprintf (fmt, ap); } void inner (int x, ...) { va_list ap, ap2; va_start (ap, x); va_start (ap2, x); switch (x) { #define test(n, ret, opt, fmt, args) \ case n: \ should_optimize = opt; \ __vprintf_chk (1, fmt, ap); \ if (! should_optimize) \ abort (); \ should_optimize = 0; \ if (__vprintf_chk (1, fmt, ap2) != ret) \ abort (); \ if (! should_optimize) \ abort (); \ break; #include "vprintf-chk-1.c" #undef test default: abort (); } va_end (ap); va_end (ap2); } int main (void) { #define test(n, ret, opt, fmt, args) \ inner args; #include "vprintf-chk-1.c" #undef test return 0; } #else test (0, 5, 0, "hello", (0)); test (1, 6, 1, "hello\n", (1)); test (2, 1, 1, "a", (2)); test (3, 0, 1, "", (3)); test (4, 5, 0, "%s", (4, "hello")); test (5, 6, 0, "%s", (5, "hello\n")); test (6, 1, 0, "%s", (6, "a")); test (7, 0, 0, "%s", (7, "")); test (8, 1, 0, "%c", (8, 'x')); test (9, 7, 0, "%s\n", (9, "hello\n")); test (10, 2, 0, "%d\n", (10, 0)); #endif ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/vrp-1.c ================================================ extern void abort (); extern void exit (int); int f (int a) { if (a != 2) { a = -a; if (a == 2) return 0; return 1; } return 1; } int main (int argc, char *argv[]) { if (f (-2)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/vrp-2.c ================================================ extern void abort (); extern void exit (int); int f (int a) { if (a != 2) { a = a > 0 ? a : -a; if (a == 2) return 0; return 1; } return 1; } int main (int argc, char *argv[]) { if (f (-2)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/vrp-3.c ================================================ extern void abort (); extern void exit (int); int f (int a) { if (a < 12) { if (a > -15) { a = a > 0 ? a : -a; if (a == 2) return 0; return 1; } } return 1; } int main (int argc, char *argv[]) { if (f (-2)) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/vrp-4.c ================================================ extern void exit (int); extern void abort (); void test(int x, int y) { int c; if (x == 1) abort(); if (y == 1) abort(); c = x / y; if (c != 1) abort(); } int main() { test(2, 2); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/vrp-5.c ================================================ /* { dg-require-effective-target int32plus } */ extern void exit (int); extern void abort (); void test(unsigned int a, unsigned int b) { if (a < 5) abort(); if (b < 5) abort(); if (a + b != 0U) abort(); } int main(int argc, char *argv[]) { unsigned int x = 0x80000000; test(x, x); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/vrp-6.c ================================================ /* { dg-require-effective-target int32plus } */ #include extern void exit (int); extern void abort (); void test01(unsigned int a, unsigned int b) { if (a < 5) abort(); if (b < 5) abort(); if (a - b != 5) abort(); } void test02(unsigned int a, unsigned int b) { if (a >= 12) if (b > 15) if (a - b < UINT_MAX - 15U) abort (); } int main(int argc, char *argv[]) { unsigned x = 0x80000000; test01(x + 5, x); test02(14, 16); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/vrp-7.c ================================================ void abort (void); struct T { int b : 1; } t; void __attribute__((noinline)) foo (int f) { t.b = (f & 0x10) ? 1 : 0; } int main (void) { foo (0x10); if (!t.b) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/wchar_t-1.c ================================================ /* { dg-options "-finput-charset=utf-8" } */ typedef __WCHAR_TYPE__ wchar_t; wchar_t x[] = L"Ä"; wchar_t y = L'Ä'; extern void abort (void); extern void exit (int); int main (void) { if (sizeof (x) / sizeof (wchar_t) != 2) abort (); if (x[0] != L'Ä' || x[1] != L'\0') abort (); if (y != L'Ä') abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/widechar-1.c ================================================ #define C L'\400' #if C #define zero (!C) #else #define zero C #endif main() { if (zero != 0) abort (); exit (0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/widechar-2.c ================================================ #include const wchar_t ws[] = L"foo"; int main (void) { if (ws[0] != L'f' || ws[1] != L'o' || ws[2] != L'o' || ws[3] != L'\0') abort(); exit(0); } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/zero-struct-1.c ================================================ struct g{}; char y[3]; char *f = &y[0]; char *ff = &y[0]; void h(void) { struct g t; *((struct g*)(f++)) = *((struct g*)(ff++)); *((struct g*)(f++)) = (struct g){}; t = *((struct g*)(ff++)); } void abort (void); int main(void) { h(); if (f != &y[2]) abort(); if (ff != &y[2]) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/zero-struct-2.c ================================================ void abort (void); int ii; typedef struct {} raw_spinlock_t; typedef struct { raw_spinlock_t raw_lock; } spinlock_t; raw_spinlock_t one_raw_spinlock (void) { raw_spinlock_t raw_lock; ii++; return raw_lock; } int main(void) { spinlock_t lock = (spinlock_t) { .raw_lock = one_raw_spinlock() }; if (ii != 1) abort (); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/zerolen-1.c ================================================ extern void abort (void); extern void exit (int); union iso_directory_record { char carr[4]; struct { unsigned char name_len [1]; char name [0]; } u; } entry; void set(union iso_directory_record *); int main (void) { union iso_directory_record *de; de = &entry; set(de); if (de->u.name_len[0] == 1 && de->u.name[0] == 0) exit (0); else abort (); } void set (union iso_directory_record *p) { p->carr[0] = 1; p->carr[1] = 0; return; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/zerolen-2.c ================================================ /* { dg-skip-if "assumes absence of larger-than-word padding" { epiphany-*-* } "*" "" } */ extern void abort(void); typedef int word __attribute__((mode(word))); struct foo { word x; word y[0]; }; int main() { if (sizeof(word) != sizeof(struct foo)) abort(); if (__alignof__(word) != __alignof__(struct foo)) abort(); return 0; } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/unsorted/dump-noaddr.c ================================================ #include #if MASK & 1 #define t11(x) x x x x x x x x x x x #define t16(x) x x x x x x x x x x x x x x x x #if INT_MAX < 2147483647 #define M (sizeof (t11(t11(t16(t16(" "))))) - 1) #else #define M (sizeof (t16(t16(t16(t16(t16(" ")))))) - 1) #endif #endif #if MASK & 2 #if INT_MAX < 2147483647 #define M 30976 #else #define M 1048576 #endif #endif typedef struct s { int c; void *vp; struct s *s; }s; typedef int (*fpt) (const char *, void *, int *); int M_var = M; extern void exit (int); int f (int start, int end, int *a, int *b, int c, s *sp) { int count = 0; int i; for (i = start; i <= end; i++) { a[i] = b[i] + c; count ++; } (*(fpt)sp->s->vp) ("Hello World!\n", &exit, &M_var); return count; } int g (int i) { switch (i) { case 1: return 42; case 2: return 60; case 3: return 7; case 4: return 3; case 5: return M; default: return 0; } } ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/unsorted/dump-noaddr.x ================================================ # This checks if -fdump-noaddr dumps are done consistently. proc dump_compare { src options } { global srcdir subdir global tmpdir global torture_with_loops set option_list $torture_with_loops set dumpbase [file tail $src] # loop through all the options foreach option $option_list { file delete -force dump1 file mkdir dump1 c-torture-compile $src "$option $options -dumpbase dump1/$dumpbase -DMASK=1 -x c --param ggc-min-heapsize=1 -fdump-ipa-all -fdump-rtl-all -fdump-tree-all -fdump-noaddr" file delete -force dump2 file mkdir dump2 c-torture-compile $src "$option $options -dumpbase dump2/$dumpbase -DMASK=2 -x c -fdump-ipa-all -fdump-rtl-all -fdump-tree-all -fdump-noaddr" foreach dump1 [lsort [glob -nocomplain dump1/*]] { regsub dump1/ $dump1 dump2/ dump2 set dumptail "gcc.c-torture/unsorted/[file tail $dump1]" regsub {\.\d+((t|r|i)\.[^.]+)$} $dumptail {.*\1} dumptail set tmp [ diff "$dump1" "$dump2" ] if { $tmp == 0 } { untested "$dumptail, $option comparison" } elseif { $tmp == 1 } { pass "$dumptail, $option comparison" } else { fail "$dumptail, $option comparison" } } } file delete -force dump1 file delete -force dump2 } dump_compare $src $options return 1 ================================================ FILE: testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/unsorted/unsorted.exp ================================================ # # Expect driver script for GCC Regression Tests # Copyright (C) 1993-2016 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GCC; see the file COPYING3. If not see # . # # Written by Jeffrey Wheat (cassidy@cygnus.com) # # # These tests come from Torbjorn Granlund's (tege@cygnus.com) # C torture test suite, and other contributors. # if $tracelevel then { strace $tracelevel } # load support procs load_lib c-torture.exp load_lib torture-options.exp torture-init set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS # # This loop will run c-torture on any *.c file found in this directory. # If a *.c has a corresponding *.exp file, then the test is skipped as # as the *.exp will drive the test itself. It is done this way so that # generic tests do not need a separate .exp for it. Only the tests that # require unique options need their own .exp file. # foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { if [file exists [file rootname $testcase].exp] then { verbose "INFO:\"[file rootname $testcase].exp\" exists, skipping test" 3 continue } # If we're only testing specific files and this isn't one of them, skip it. if ![runtest_file_p $runtests $testcase] then { continue } c-torture $testcase } torture-finish ================================================ FILE: testdata/gcc-6.3.0/source-url ================================================ ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-6.3.0/gcc-6.3.0.tar.gz ================================================ FILE: testdata/issue3.h ================================================ #define FOO 3 void foo(int a, int b); #define do_foo(x) \ foo(x, FOO) ================================================ FILE: testdata/issue4.c ================================================ typedef int int_t; // redeclaration error: int foo(void *ptr); typedef int foo(void *ptr); // redeclaration error: int_t foo2(void *ptr); typedef int_t foo2(void *ptr); ================================================ FILE: testdata/issue50.h ================================================ #ifdef __cplusplus extern "C"; ================================================ FILE: testdata/issue57.c ================================================ typedef int bool_t; typedef bool_t (*bool_func) (void); typedef bool_func func1; ================================================ FILE: testdata/issue62.c ================================================ struct global { int i; }; extern struct global2 { int j; }; static struct local { int k; }; ================================================ FILE: testdata/issue64.c ================================================ typedef struct foo foo; foo bar = {0}; ================================================ FILE: testdata/issue65.c ================================================ struct { int i; int j:1; int k:2; int l:3; int m; } foo; ================================================ FILE: testdata/issue66.c ================================================ short *p = ((short*)3)[5]; ================================================ FILE: testdata/issue67.c ================================================ int foo; // bar1 char /* baz3 */ qux; // abc7 // def8 int ghi; /* abc11 */ /* def12 */ int ghi; /* abc16 */ /* def18 */ int ghi; /* abc21 */ // def22 int ghi; // def25 /* abc26 */ int ghi; // abc29 // def31 int ghi; ================================================ FILE: testdata/issue68.h ================================================ typedef struct a *b; #define c(type, name, paramName) \ void set##name(const b node, type paramName); \ type get##name(const b node); c(void *, Context, context); // The final semicolon is a C++11 empty declaration, illegal in C99. // See also http://en.cppreference.com/w/cpp/language/declarations ================================================ FILE: testdata/issue69.h ================================================ int i; #ifndef a // Next line DOES NOT end with newline. #endif /* a */ ================================================ FILE: testdata/issue72.h ================================================ enum { PERF_TXN_ABORT_MASK = (0xffffffffULL << 32) }; ================================================ FILE: testdata/issue74.h ================================================ struct foobar { unsigned long long baz : 36; }; ================================================ FILE: testdata/issue77.c ================================================ void f() { if ("abc"[0] == 'a') {} } ================================================ FILE: testdata/issue78.c ================================================ f(){} ================================================ FILE: testdata/issue8.h ================================================ #define __signed signed typedef __signed char __int8_t; // for future tests // (on the real code this producting another error) // #if 5 > 1 // // ok? // #endif // remove this block -> works! #if !defined(A) && (!defined(B) || defined(C)) // ok? #endif #define FOO (4) // remove this block -> works! #if (FOO) > 4 // ok? #endif ================================================ FILE: testdata/issue80.c ================================================ char s[] = "abcdef"; char *t = "abcdef"; char u[11] = "abcdef"; ================================================ FILE: testdata/issue81.c ================================================ char *s = "\0\377\0"; char *t = "\0\0"; ================================================ FILE: testdata/issue82.c ================================================ #define a(b, c, ...) d(c) a(1, 2, 3) #undef a #define a(b, c...) d(c) a(1, 2, 3) ================================================ FILE: testdata/issue84.c ================================================ #define a(b, ...) c(b, __VA_ARGS__) a(1, 2, 3); a(1, 2); a(1); ================================================ FILE: testdata/issue85.c ================================================ int i; extern int j; ================================================ FILE: testdata/issue86.c ================================================ int i = 42; extern int j = 24; ================================================ FILE: testdata/issue87.c ================================================ typedef int foo; typedef int foo; ================================================ FILE: testdata/issue88.c ================================================ void foo(); void bar() { foo == foo; } ================================================ FILE: testdata/issue89.c ================================================ struct a { unsigned f : 3; }; void h() { struct a a; g(a.f); } int g(unsigned); ================================================ FILE: testdata/issue9.c ================================================ typedef short JBLOCK[64]; typedef JBLOCK *JBLOCKROW; typedef JBLOCKROW *JBLOCKARRAY; typedef JBLOCKARRAY *JBLOCKIMAGE; short v6[64]; short (v6)[64]; JBLOCK v6; JBLOCK (v6); short (*v11)[64]; short ((*v11))[64]; short ((*v11)[64]); JBLOCKROW v11; JBLOCKROW (v11); short (**v17)[64]; short ((**v17))[64]; short ((**v17)[64]); JBLOCKARRAY v17; JBLOCKARRAY (v17); short (***v23)[64]; short ((***v23))[64]; short ((***v23)[64]); JBLOCKIMAGE v23; JBLOCKIMAGE (v23); ================================================ FILE: testdata/issue90.c ================================================ struct { unsigned a:1; unsigned b:1; } x; void f() { x.a + x.b; } ================================================ FILE: testdata/issue92.c ================================================ typedef struct{int i;} t; typedef struct{int i;} t; ================================================ FILE: testdata/issue93.c ================================================ #include "issue93.h" extern int hello; int main() { return 0; } ================================================ FILE: testdata/issue93.h ================================================ // This line DOES NOT end with newline. Use '$ truncate -s -1 issue93.h' to remove the final newline if necessary. ================================================ FILE: testdata/issue9b.c ================================================ typedef short JBLOCK[64]; typedef JBLOCK *JBLOCKROW; typedef JBLOCKROW *JBLOCKARRAY; typedef JBLOCKARRAY *JBLOCKIMAGE; short (**ok)[64]; JBLOCKARRAY ok; short ***bad[64]; JBLOCKARRAY bad; ================================================ FILE: testdata/paste.c ================================================ # define __REPB_PREFIX(name) __##name unsigned char *__REPB_PREFIX(buffer); ================================================ FILE: testdata/paste2.c ================================================ # define __intN_t(N) typedef int int##N##_t __intN_t (8); ================================================ FILE: testdata/redecl.c ================================================ // [0]6.7.7, 7, p.124 typedef void fv(int), (*pfv)(int); void (*signal(int, void (*)(int)))(int); fv *signal(int, fv *); pfv signal(int, pfv); // Denormalized forms. void ((*signal(int, void (*)(int)))(int)); void (((*signal(int, void (*)(int)))(int))); void (*signal(int, void ((*))(int)))(int); void (*signal(int, void (((*)))(int)))(int); fv (*signal(int, fv *)); fv ((*signal(int, fv *))); fv *signal(int, fv (*)); fv *signal(int, fv ((*))); pfv (signal(int, pfv)); pfv ((signal(int, pfv))); // ---------------------------------------------------------------------------- typedef int t; int f29(); t f29(); int *f32(); t *f32(); int (*f35)(); t (*f35)(); int (*f38())(); t (*f38())(); typedef int *t2; int *f43(); t2 f43(); int *(*f46)(); t2 (*f46)(); int *(*f49()); t2 (*f49()); int **f52(); t2 *f52(); int a55[4]; t a55[4]; int *a58[4]; t *a58[4]; int *a61[4]; t2 a61[4]; int **a64[4]; t2 *a64[4]; int *(*a67[4]); t2 *(a67[4]); int (**a67[4]); t2 (*a67[4]); ================================================ FILE: testdata/tcc-0.9.26/COPYING ================================================ GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ================================================ FILE: testdata/tcc-0.9.26/source-url ================================================ http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.26.tar.bz2 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/00_assignment.c ================================================ #include int main() { int a; a = 42; printf("%d\n", a); int b = 64; printf("%d\n", b); int c = 12, d = 34; printf("%d, %d\n", c, d); return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/00_assignment.expect ================================================ 42 64 12, 34 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/01_comment.c ================================================ #include int main() { printf("Hello\n"); printf("Hello\n"); /* this is a comment */ printf("Hello\n"); printf("Hello\n"); // this is also a comment sayhello(); printf("Hello\n"); return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/01_comment.expect ================================================ Hello Hello Hello Hello Hello ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/02_printf.c ================================================ #include int main() { printf("Hello world\n"); int Count; for (Count = -5; Count <= 5; Count++) printf("Count = %d\n", Count); printf("String 'hello', 'there' is '%s', '%s'\n", "hello", "there"); printf("Character 'A' is '%c'\n", 65); printf("Character 'a' is '%c'\n", 'a'); return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/02_printf.expect ================================================ Hello world Count = -5 Count = -4 Count = -3 Count = -2 Count = -1 Count = 0 Count = 1 Count = 2 Count = 3 Count = 4 Count = 5 String 'hello', 'there' is 'hello', 'there' Character 'A' is 'A' Character 'a' is 'a' ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/03_struct.c ================================================ #include struct fred { int boris; int natasha; }; void main() { struct fred bloggs; bloggs.boris = 12; bloggs.natasha = 34; printf("%d\n", bloggs.boris); printf("%d\n", bloggs.natasha); struct fred jones[2]; jones[0].boris = 12; jones[0].natasha = 34; jones[1].boris = 56; jones[1].natasha = 78; printf("%d\n", jones[0].boris); printf("%d\n", jones[0].natasha); printf("%d\n", jones[1].boris); printf("%d\n", jones[1].natasha); return 0; } ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/03_struct.expect ================================================ 12 34 12 34 56 78 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/04_for.c ================================================ #include int main() { int Count; for (Count = 1; Count <= 10; Count++) { printf("%d\n", Count); } return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/04_for.expect ================================================ 1 2 3 4 5 6 7 8 9 10 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/05_array.c ================================================ #include int main() { int Count; int Array[10]; for (Count = 1; Count <= 10; Count++) { Array[Count-1] = Count * Count; } for (Count = 0; Count < 10; Count++) { printf("%d\n", Array[Count]); } return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/05_array.expect ================================================ 1 4 9 16 25 36 49 64 81 100 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/06_case.c ================================================ #include int main() { int Count; for (Count = 0; Count < 4; Count++) { printf("%d\n", Count); switch (Count) { case 1: printf("%d\n", 1); break; case 2: printf("%d\n", 2); break; default: printf("%d\n", 0); break; } } return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/06_case.expect ================================================ 0 0 1 1 2 2 3 0 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/07_function.c ================================================ #include int myfunc(int x) { return x * x; } void vfunc(int a) { printf("a=%d\n", a); } void qfunc() { printf("qfunc()\n"); } int main() { printf("%d\n", myfunc(3)); printf("%d\n", myfunc(4)); vfunc(1234); qfunc(); return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/07_function.expect ================================================ 9 16 a=1234 qfunc() ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/08_while.c ================================================ #include int main() { int a; int p; int t; a = 1; p = 0; t = 0; while (a < 100) { printf("%d\n", a); t = a; a = t + p; p = t; } return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/08_while.expect ================================================ 1 1 2 3 5 8 13 21 34 55 89 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/09_do_while.c ================================================ #include int main() { int a; int p; int t; a = 1; p = 0; t = 0; do { printf("%d\n", a); t = a; a = t + p; p = t; } while (a < 100); return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/09_do_while.expect ================================================ 1 1 2 3 5 8 13 21 34 55 89 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/10_pointer.c ================================================ #include struct ziggy { int a; int b; int c; } bolshevic; int main() { int a; int *b; int c; a = 42; b = &a; printf("a = %d\n", *b); bolshevic.a = 12; bolshevic.b = 34; bolshevic.c = 56; printf("bolshevic.a = %d\n", bolshevic.a); printf("bolshevic.b = %d\n", bolshevic.b); printf("bolshevic.c = %d\n", bolshevic.c); struct ziggy *tsar = &bolshevic; printf("tsar->a = %d\n", tsar->a); printf("tsar->b = %d\n", tsar->b); printf("tsar->c = %d\n", tsar->c); b = &(bolshevic.b); printf("bolshevic.b = %d\n", *b); return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/10_pointer.expect ================================================ a = 42 bolshevic.a = 12 bolshevic.b = 34 bolshevic.c = 56 tsar->a = 12 tsar->b = 34 tsar->c = 56 bolshevic.b = 34 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/11_precedence.c ================================================ #include int main() { int a; int b; int c; int d; int e; int f; int x; int y; a = 12; b = 34; c = 56; d = 78; e = 0; f = 1; printf("%d\n", c + d); printf("%d\n", (y = c + d)); printf("%d\n", e || e && f); printf("%d\n", e || f && f); printf("%d\n", e && e || f); printf("%d\n", e && f || f); printf("%d\n", a && f | f); printf("%d\n", a | b ^ c & d); printf("%d, %d\n", a == a, a == b); printf("%d, %d\n", a != a, a != b); printf("%d\n", a != b && c != d); printf("%d\n", a + b * c / f); printf("%d\n", a + b * c / f); printf("%d\n", (4 << 4)); printf("%d\n", (64 >> 4)); return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/11_precedence.expect ================================================ 134 134 0 1 1 1 1 46 1, 0 0, 1 1 1916 1916 64 4 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/12_hashdefine.c ================================================ #include #define FRED 12 #define BLOGGS(x) (12*(x)) int main() { printf("%d\n", FRED); printf("%d, %d, %d\n", BLOGGS(1), BLOGGS(2), BLOGGS(3)); return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/12_hashdefine.expect ================================================ 12 12, 24, 36 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/13_integer_literals.c ================================================ #include int main() { int a = 24680; int b = 01234567; int c = 0x2468ac; int d = 0x2468AC; int e = 0x555; //TODO extension 0b010101010101; printf("%d\n", a); printf("%d\n", b); printf("%d\n", c); printf("%d\n", d); printf("%d\n", e); return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/13_integer_literals.expect ================================================ 24680 342391 2386092 2386092 1365 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/14_if.c ================================================ #include int main() { int a = 1; if (a) printf("a is true\n"); else printf("a is false\n"); int b = 0; if (b) printf("b is true\n"); else printf("b is false\n"); return 0; } // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/14_if.expect ================================================ a is true b is false ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/15_recursion.c ================================================ #include int factorial(int i) { if (i < 2) return i; else return i * factorial(i - 1); } int main() { int Count; for (Count = 1; Count <= 10; Count++) printf("%d\n", factorial(Count)); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/15_recursion.expect ================================================ 1 2 6 24 120 720 5040 40320 362880 3628800 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/16_nesting.c ================================================ #include int main() { int x, y, z; for (x = 0; x < 2; x++) { for (y = 0; y < 3; y++) { for (z = 0; z < 3; z++) { printf("%d %d %d\n", x, y, z); } } } return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/16_nesting.expect ================================================ 0 0 0 0 0 1 0 0 2 0 1 0 0 1 1 0 1 2 0 2 0 0 2 1 0 2 2 1 0 0 1 0 1 1 0 2 1 1 0 1 1 1 1 1 2 1 2 0 1 2 1 1 2 2 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/17_enum.c ================================================ #include enum fred { a, b, c, d, e = 54, f = 73, g, h }; int main() { enum fred frod; printf("%d %d %d %d %d %d %d %d\n", a, b, c, d, e, f, g, h); /* printf("%d\n", frod); */ frod = 12; printf("%d\n", frod); frod = e; printf("%d\n", frod); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/17_enum.expect ================================================ 0 1 2 3 54 73 74 75 12 54 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/18_include.c ================================================ #include int main() { printf("including\n"); #include "18_include.h" printf("done\n"); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/18_include.expect ================================================ including included done ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/18_include.h ================================================ printf("included\n"); ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/19_pointer_arithmetic.c ================================================ #include int main() { int a; int *b; int *c; a = 42; b = &a; c = NULL; printf("%d\n", *b); if (b == NULL) printf("b is NULL\n"); else printf("b is not NULL\n"); if (c == NULL) printf("c is NULL\n"); else printf("c is not NULL\n"); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/19_pointer_arithmetic.expect ================================================ 42 b is not NULL c is NULL ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/20_pointer_comparison.c ================================================ #include int main() { int a; int b; int *d; int *e; d = &a; e = &b; a = 12; b = 34; printf("%d\n", *d); printf("%d\n", *e); printf("%d\n", d == e); printf("%d\n", d != e); d = e; printf("%d\n", d == e); printf("%d\n", d != e); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/20_pointer_comparison.expect ================================================ 12 34 0 1 1 0 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/21_char_array.c ================================================ #include int main() { int x = 'a'; char y = x; char *a = "hello"; printf("%s\n", a); int c; c = *a; char *b; for (b = a; *b != 0; b++) printf("%c: %d\n", *b, *b); char destarray[10]; char *dest = &destarray[0]; char *src = a; while (*src != 0) *dest++ = *src++; *dest = 0; printf("copied string is %s\n", destarray); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/21_char_array.expect ================================================ hello h: 104 e: 101 l: 108 l: 108 o: 111 copied string is hello ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/22_floating_point.c ================================================ #include #include int main() { // variables float a = 12.34 + 56.78; printf("%f\n", a); // infix operators printf("%f\n", 12.34 + 56.78); printf("%f\n", 12.34 - 56.78); printf("%f\n", 12.34 * 56.78); printf("%f\n", 12.34 / 56.78); // comparison operators printf("%d %d %d %d %d %d\n", 12.34 < 56.78, 12.34 <= 56.78, 12.34 == 56.78, 12.34 >= 56.78, 12.34 > 56.78, 12.34 != 56.78); printf("%d %d %d %d %d %d\n", 12.34 < 12.34, 12.34 <= 12.34, 12.34 == 12.34, 12.34 >= 12.34, 12.34 > 12.34, 12.34 != 12.34); printf("%d %d %d %d %d %d\n", 56.78 < 12.34, 56.78 <= 12.34, 56.78 == 12.34, 56.78 >= 12.34, 56.78 > 12.34, 56.78 != 12.34); // assignment operators a = 12.34; a += 56.78; printf("%f\n", a); a = 12.34; a -= 56.78; printf("%f\n", a); a = 12.34; a *= 56.78; printf("%f\n", a); a = 12.34; a /= 56.78; printf("%f\n", a); // prefix operators printf("%f\n", +12.34); printf("%f\n", -12.34); // type coercion a = 2; printf("%f\n", a); printf("%f\n", sin(2)); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/22_floating_point.expect ================================================ 69.120003 69.120000 -44.440000 700.665200 0.217330 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 1 1 1 69.120003 -44.439999 700.665222 0.217330 12.340000 -12.340000 2.000000 0.909297 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/23_type_coercion.c ================================================ #include void charfunc(char a) { printf("char: %c\n", a); } void intfunc(int a) { printf("int: %d\n", a); } void floatfunc(float a) { printf("float: %f\n", a); } int main() { charfunc('a'); charfunc(98); charfunc(99.0); intfunc('a'); intfunc(98); intfunc(99.0); floatfunc('a'); floatfunc(98); floatfunc(99.0); /* printf("%c %d %f\n", 'a', 'b', 'c'); */ /* printf("%c %d %f\n", 97, 98, 99); */ /* printf("%c %d %f\n", 97.0, 98.0, 99.0); */ char b = 97; char c = 97.0; printf("%d %d\n", b, c); int d = 'a'; int e = 97.0; printf("%d %d\n", d, e); float f = 'a'; float g = 97; printf("%f %f\n", f, g); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/23_type_coercion.expect ================================================ char: a char: b char: c int: 97 int: 98 int: 99 float: 97.000000 float: 98.000000 float: 99.000000 97 97 97 97 97.000000 97.000000 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/24_math_library.c ================================================ #include #include int main() { printf("%f\n", sin(0.12)); printf("%f\n", cos(0.12)); printf("%f\n", tan(0.12)); printf("%f\n", asin(0.12)); printf("%f\n", acos(0.12)); printf("%f\n", atan(0.12)); printf("%f\n", sinh(0.12)); printf("%f\n", cosh(0.12)); printf("%f\n", tanh(0.12)); printf("%f\n", exp(0.12)); printf("%f\n", fabs(-0.12)); printf("%f\n", log(0.12)); printf("%f\n", log10(0.12)); printf("%f\n", pow(0.12, 0.12)); printf("%f\n", sqrt(0.12)); printf("%f\n", round(12.34)); printf("%f\n", ceil(12.34)); printf("%f\n", floor(12.34)); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/24_math_library.expect ================================================ 0.119712 0.992809 0.120579 0.120290 1.450506 0.119429 0.120288 1.007209 0.119427 1.127497 0.120000 -2.120264 -0.920819 0.775357 0.346410 12.000000 13.000000 12.000000 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/25_quicksort.c ================================================ #include int array[16]; //Swap integer values by array indexes void swap(int a, int b) { int tmp = array[a]; array[a] = array[b]; array[b] = tmp; } //Partition the array into two halves and return the //index about which the array is partitioned int partition(int left, int right) { int pivotIndex = left; int pivotValue = array[pivotIndex]; int index = left; int i; swap(pivotIndex, right); for(i = left; i < right; i++) { if(array[i] < pivotValue) { swap(i, index); index += 1; } } swap(right, index); return index; } //Quicksort the array void quicksort(int left, int right) { if(left >= right) return; int index = partition(left, right); quicksort(left, index - 1); quicksort(index + 1, right); } int main() { int i; array[0] = 62; array[1] = 83; array[2] = 4; array[3] = 89; array[4] = 36; array[5] = 21; array[6] = 74; array[7] = 37; array[8] = 65; array[9] = 33; array[10] = 96; array[11] = 38; array[12] = 53; array[13] = 16; array[14] = 74; array[15] = 55; for (i = 0; i < 16; i++) printf("%d ", array[i]); printf("\n"); quicksort(0, 15); for (i = 0; i < 16; i++) printf("%d ", array[i]); printf("\n"); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/25_quicksort.expect ================================================ 62 83 4 89 36 21 74 37 65 33 96 38 53 16 74 55 4 16 21 33 36 37 38 53 55 62 65 74 74 83 89 96 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/26_character_constants.c ================================================ #include int main() { printf("%d\n", '\1'); printf("%d\n", '\10'); printf("%d\n", '\100'); printf("%d\n", '\x01'); printf("%d\n", '\x0e'); printf("%d\n", '\x10'); printf("%d\n", '\x40'); printf("test \x40\n"); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/26_character_constants.expect ================================================ 1 8 64 1 14 16 64 test @ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/27_sizeof.c ================================================ #include int main() { char a; int b; double c; printf("%d\n", sizeof(a)); printf("%d\n", sizeof(b)); printf("%d\n", sizeof(c)); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/27_sizeof.expect ================================================ 1 4 8 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/28_strings.c ================================================ #include #include #include int main() { char a[10]; strcpy(a, "hello"); printf("%s\n", a); strncpy(a, "gosh", 2); printf("%s\n", a); printf("%d\n", strcmp(a, "apple") > 0); printf("%d\n", strcmp(a, "goere") > 0); printf("%d\n", strcmp(a, "zebra") < 0); printf("%d\n", strlen(a)); strcat(a, "!"); printf("%s\n", a); printf("%d\n", strncmp(a, "apple", 2) > 0); printf("%d\n", strncmp(a, "goere", 2) == 0); printf("%d\n", strncmp(a, "goerg", 2) == 0); printf("%d\n", strncmp(a, "zebra", 2) < 0); printf("%s\n", index(a, 'o')); printf("%s\n", rindex(a, 'l')); printf("%d\n", rindex(a, 'x') == NULL); memset(&a[1], 'r', 4); printf("%s\n", a); memcpy(&a[2], a, 2); printf("%s\n", a); printf("%d\n", memcmp(a, "apple", 4) > 0); printf("%d\n", memcmp(a, "grgr", 4) == 0); printf("%d\n", memcmp(a, "zebra", 4) < 0); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/28_strings.expect ================================================ hello gollo 1 1 1 5 gollo! 1 1 1 1 ollo! lo! 1 grrrr! grgrr! 1 1 1 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/29_array_address.c ================================================ #include #include int main() { char a[10]; strcpy(a, "abcdef"); printf("%s\n", &a[1]); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/29_array_address.expect ================================================ bcdef ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/30_hanoi.c ================================================ /* example from http://barnyard.syr.edu/quickies/hanoi.c */ /* hanoi.c: solves the tower of hanoi problem. (Programming exercise.) */ /* By Terry R. McConnell (12/2/97) */ /* Compile: cc -o hanoi hanoi.c */ /* This program does no error checking. But then, if it's right, it's right ... right ? */ /* The original towers of hanoi problem seems to have been originally posed by one M. Claus in 1883. There is a popular legend that goes along with it that has been often repeated and paraphrased. It goes something like this: In the great temple at Benares there are 3 golden spikes. On one of them, God placed 64 disks increasing in size from bottom to top, at the beginning of time. Since then, and to this day, the priest on duty constantly transfers disks, one at a time, in such a way that no larger disk is ever put on top of a smaller one. When the disks have been transferred entirely to another spike the Universe will come to an end in a large thunderclap. This paraphrases the original legend due to DeParville, La Nature, Paris 1884, Part I, 285-286. For this and further information see: Mathematical Recreations & Essays, W.W. Rouse Ball, MacMillan, NewYork, 11th Ed. 1967, 303-305. * * */ #include #include #define TRUE 1 #define FALSE 0 /* This is the number of "disks" on tower A initially. Taken to be 64 in the * legend. The number of moves required, in general, is 2^N - 1. For N = 64, * this is 18,446,744,073,709,551,615 */ #define N 4 /* These are the three towers. For example if the state of A is 0,1,3,4, that * means that there are three discs on A of sizes 1, 3, and 4. (Think of right * as being the "down" direction.) */ int A[N], B[N], C[N]; void Hanoi(int,int*,int*,int*); /* Print the current configuration of A, B, and C to the screen */ void PrintAll() { int i; printf("A: "); for(i=0;i int main(int argc, char **argv) { int Count; printf("hello world %d\n", argc); for (Count = 0; Count < argc; Count++) printf("arg %d: %s\n", Count, argv[Count]); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/31_args.expect ================================================ hello world 6 arg 0: ./test arg 1: - arg 2: arg1 arg 3: arg2 arg 4: arg3 arg 5: arg4 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/32_led.c ================================================ /* example from http://barnyard.syr.edu/quickies/led.c */ /* led.c: print out number as if on 7 line led display. I.e., write integer given on command line like this: _ _ _ | _| _| |_| |_ | |_ _| | _| etc. We assume the terminal behaves like a classical teletype. So the top lines of all digits have to be printed first, then the middle lines of all digits, etc. By Terry R. McConnell compile: cc -o led led.c If you just want to link in the subroutine print_led that does all the work, compile with -DNO_MAIN, and declare the following in any source file that uses the call: extern void print_led(unsigned long x, char *buf); Bug: you cannot call repeatedly to print more than one number to a line. That would require curses or some other terminal API that allows moving the cursor to a previous line. */ #include #include #define MAX_DIGITS 32 #define NO_MAIN /* Print the top line of the digit d into buffer. Does not null terminate buffer. */ void topline(int d, char *p){ *p++ = ' '; switch(d){ /* all these have _ on top line */ case 0: case 2: case 3: case 5: case 7: case 8: case 9: *p++ = '_'; break; default: *p++=' '; } *p++=' '; } /* Print the middle line of the digit d into the buffer. Does not null terminate. */ void midline(int d, char *p){ switch(d){ /* those that have leading | on middle line */ case 0: case 4: case 5: case 6: case 8: case 9: *p++='|'; break; default: *p++=' '; } switch(d){ /* those that have _ on middle line */ case 2: case 3: case 4: case 5: case 6: case 8: case 9: *p++='_'; break; default: *p++=' '; } switch(d){ /* those that have closing | on middle line */ case 0: case 1: case 2: case 3: case 4: case 7: case 8: case 9: *p++='|'; break; default: *p++=' '; } } /* Print the bottom line of the digit d. Does not null terminate. */ void botline(int d, char *p){ switch(d){ /* those that have leading | on bottom line */ case 0: case 2: case 6: case 8: *p++='|'; break; default: *p++=' '; } switch(d){ /* those that have _ on bottom line */ case 0: case 2: case 3: case 5: case 6: case 8: *p++='_'; break; default: *p++=' '; } switch(d){ /* those that have closing | on bottom line */ case 0: case 1: case 3: case 4: case 5: case 6: case 7: case 8: case 9: *p++='|'; break; default: *p++=' '; } } /* Write the led representation of integer to string buffer. */ void print_led(unsigned long x, char *buf) { int i=0,n; static int d[MAX_DIGITS]; /* extract digits from x */ n = ( x == 0L ? 1 : 0 ); /* 0 is a digit, hence a special case */ while(x){ d[n++] = (int)(x%10L); if(n >= MAX_DIGITS)break; x = x/10L; } /* print top lines of all digits */ for(i=n-1;i>=0;i--){ topline(d[i],buf); buf += 3; *buf++=' '; } *buf++='\n'; /* move teletype to next line */ /* print middle lines of all digits */ for(i=n-1;i>=0;i--){ midline(d[i],buf); buf += 3; *buf++=' '; } *buf++='\n'; /* print bottom lines of all digits */ for(i=n-1;i>=0;i--){ botline(d[i],buf); buf += 3; *buf++=' '; } *buf++='\n'; *buf='\0'; } int main() { char buf[5*MAX_DIGITS]; print_led(1234567, buf); printf("%s\n",buf); return 0; } #ifndef NO_MAIN int main(int argc, char **argv) { int i=0,n; long x; static int d[MAX_DIGITS]; char buf[5*MAX_DIGITS]; if(argc != 2){ fprintf(stderr,"led: usage: led integer\n"); return 1; } /* fetch argument from command line */ x = atol(argv[1]); /* sanity check */ if(x<0){ fprintf(stderr,"led: %d must be non-negative\n",x); return 1; } print_led(x,buf); printf("%s\n",buf); return 0; } #endif /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/32_led.expect ================================================ _ _ _ _ | _| _| |_| |_ |_ | | |_ _| | _| |_| | ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/33_ternary_op.c ================================================ #include int main() { int Count; for (Count = 0; Count < 10; Count++) { printf("%d\n", (Count < 5) ? (Count*Count) : (Count * 3)); } return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/33_ternary_op.expect ================================================ 0 1 4 9 16 15 18 21 24 27 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/34_array_assignment.c ================================================ #include int main() { int a[4]; a[0] = 12; a[1] = 23; a[2] = 34; a[3] = 45; printf("%d %d %d %d\n", a[0], a[1], a[2], a[3]); int b[4]; b = a; printf("%d %d %d %d\n", b[0], b[1], b[2], b[3]); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/34_array_assignment.expect ================================================ 12 23 34 45 12 23 34 45 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/35_sizeof.c ================================================ #include int main() { char a; short b; printf("%d %d\n", sizeof(char), sizeof(a)); printf("%d %d\n", sizeof(short), sizeof(b)); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/35_sizeof.expect ================================================ 1 1 2 2 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/36_array_initialisers.c ================================================ #include int main() { int Count; int Array[10] = { 12, 34, 56, 78, 90, 123, 456, 789, 8642, 9753 }; for (Count = 0; Count < 10; Count++) printf("%d: %d\n", Count, Array[Count]); int Array2[10] = { 12, 34, 56, 78, 90, 123, 456, 789, 8642, 9753, }; for (Count = 0; Count < 10; Count++) printf("%d: %d\n", Count, Array2[Count]); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/36_array_initialisers.expect ================================================ 0: 12 1: 34 2: 56 3: 78 4: 90 5: 123 6: 456 7: 789 8: 8642 9: 9753 0: 12 1: 34 2: 56 3: 78 4: 90 5: 123 6: 456 7: 789 8: 8642 9: 9753 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/37_sprintf.c ================================================ #include int main() { char Buf[100]; int Count; for (Count = 1; Count <= 20; Count++) { sprintf(Buf, "->%02d<-\n", Count); printf("%s", Buf); } return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/37_sprintf.expect ================================================ ->01<- ->02<- ->03<- ->04<- ->05<- ->06<- ->07<- ->08<- ->09<- ->10<- ->11<- ->12<- ->13<- ->14<- ->15<- ->16<- ->17<- ->18<- ->19<- ->20<- ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/38_multiple_array_index.c ================================================ #include int main() { int a[4][4]; int b = 0; int x; int y; for (x = 0; x < 4; x++) { for (y = 0; y < 4; y++) { b++; a[x][y] = b; } } for (x = 0; x < 4; x++) { printf("x=%d: ", x); for (y = 0; y < 4; y++) { printf("%d ", a[x][y]); } printf("\n"); } return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/38_multiple_array_index.expect ================================================ x=0: 1 2 3 4 x=1: 5 6 7 8 x=2: 9 10 11 12 x=3: 13 14 15 16 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/39_typedef.c ================================================ #include typedef int MyInt; struct FunStruct { int i; int j; }; typedef struct FunStruct MyFunStruct; typedef MyFunStruct *MoreFunThanEver; int main() { MyInt a = 1; printf("%d\n", a); MyFunStruct b; b.i = 12; b.j = 34; printf("%d,%d\n", b.i, b.j); MoreFunThanEver c = &b; printf("%d,%d\n", c->i, c->j); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/39_typedef.expect ================================================ 1 12,34 12,34 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/40_stdio.c ================================================ #include int main() { FILE *f = fopen("fred.txt", "w"); fwrite("hello\nhello\n", 1, 12, f); fclose(f); char freddy[7]; f = fopen("fred.txt", "r"); if (fread(freddy, 1, 6, f) != 6) printf("couldn't read fred.txt\n"); freddy[6] = '\0'; fclose(f); printf("%s", freddy); int InChar; char ShowChar; f = fopen("fred.txt", "r"); while ( (InChar = fgetc(f)) != EOF) { ShowChar = InChar; if (ShowChar < ' ') ShowChar = '.'; printf("ch: %d '%c'\n", InChar, ShowChar); } fclose(f); f = fopen("fred.txt", "r"); while ( (InChar = getc(f)) != EOF) { ShowChar = InChar; if (ShowChar < ' ') ShowChar = '.'; printf("ch: %d '%c'\n", InChar, ShowChar); } fclose(f); f = fopen("fred.txt", "r"); while (fgets(freddy, sizeof(freddy), f) != NULL) printf("x: %s", freddy); fclose(f); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/40_stdio.expect ================================================ hello ch: 104 'h' ch: 101 'e' ch: 108 'l' ch: 108 'l' ch: 111 'o' ch: 10 '.' ch: 104 'h' ch: 101 'e' ch: 108 'l' ch: 108 'l' ch: 111 'o' ch: 10 '.' ch: 104 'h' ch: 101 'e' ch: 108 'l' ch: 108 'l' ch: 111 'o' ch: 10 '.' ch: 104 'h' ch: 101 'e' ch: 108 'l' ch: 108 'l' ch: 111 'o' ch: 10 '.' x: hello x: hello ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/41_hashif.c ================================================ #include int main() { printf("#include test\n"); #if 1 #if 0 printf("a\n"); #else printf("b\n"); #endif #else #if 0 printf("c\n"); #else printf("d\n"); #endif #endif #if 0 #if 1 printf("e\n"); #else printf("f\n"); #endif #else #if 1 printf("g\n"); #else printf("h\n"); #endif #endif #define DEF #ifdef DEF #ifdef DEF printf("i\n"); #else printf("j\n"); #endif #else #ifdef DEF printf("k\n"); #else printf("l\n"); #endif #endif #ifndef DEF #ifndef DEF printf("m\n"); #else printf("n\n"); #endif #else #ifndef DEF printf("o\n"); #else printf("p\n"); #endif #endif #define ONE 1 #define ZERO 0 #if ONE #if ZERO printf("q\n"); #else printf("r\n"); #endif #else #if ZERO printf("s\n"); #else printf("t\n"); #endif #endif return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/41_hashif.expect ================================================ #include test b g i p r ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/42_function_pointer.c ================================================ #include int fred(int p) { printf("yo %d\n", p); return 42; } int (*f)(int) = &fred; int main() { printf("%d\n", (*f)(24)); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/42_function_pointer.expect ================================================ yo 24 42 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/43_void_param.c ================================================ #include void fred(void) { printf("yo\n"); } int main() { fred(); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/43_void_param.expect ================================================ yo ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/44_scoped_declarations.c ================================================ #include int main() { int a; for (a = 0; a < 2; a++) { int b = a; } printf("it's all good\n"); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/44_scoped_declarations.expect ================================================ it's all good ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/45_empty_for.c ================================================ #include int main() { int Count = 0; for (;;) { Count++; printf("%d\n", Count); if (Count >= 10) break; } return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/45_empty_for.expect ================================================ 1 2 3 4 5 6 7 8 9 10 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/46_grep.c ================================================ /* * The information in this document is subject to change * without notice and should not be construed as a commitment * by Digital Equipment Corporation or by DECUS. * * Neither Digital Equipment Corporation, DECUS, nor the authors * assume any responsibility for the use or reliability of this * document or the described software. * * Copyright (C) 1980, DECUS * * General permission to copy or modify, but not for profit, is * hereby granted, provided that the above copyright notice is * included and reference made to the fact that reproduction * privileges were granted by DECUS. */ #include #include #include int match(); void badpat(char *message, char *source, char *stop); void error(char *s); void store(int op); /* * grep * * Runs on the Decus compiler or on vms, On vms, define as: * grep :== "$disk:[account]grep" (native) * grep :== "$disk:[account]grep grep" (Decus) * See below for more information. */ char *documentation[] = { "grep searches a file for a given pattern. Execute by", " grep [flags] regular_expression file_list\n", "Flags are single characters preceeded by '-':", " -c Only a count of matching lines is printed", " -f Print file name for matching lines switch, see below", " -n Each line is preceeded by its line number", " -v Only print non-matching lines\n", "The file_list is a list of files (wildcards are acceptable on RSX modes).", "\nThe file name is normally printed if there is a file given.", "The -f flag reverses this action (print name no file, not if more).\n", 0 }; char *patdoc[] = { "The regular_expression defines the pattern to search for. Upper- and", "lower-case are always ignored. Blank lines never match. The expression", "should be quoted to prevent file-name translation.", "x An ordinary character (not mentioned below) matches that character.", "'\\' The backslash quotes any character. \"\\$\" matches a dollar-sign.", "'^' A circumflex at the beginning of an expression matches the", " beginning of a line.", "'$' A dollar-sign at the end of an expression matches the end of a line.", "'.' A period matches any character except \"new-line\".", "':a' A colon matches a class of characters described by the following", "':d' character. \":a\" matches any alphabetic, \":d\" matches digits,", "':n' \":n\" matches alphanumerics, \": \" matches spaces, tabs, and", "': ' other control characters, such as new-line.", "'*' An expression followed by an asterisk matches zero or more", " occurrances of that expression: \"fo*\" matches \"f\", \"fo\"", " \"foo\", etc.", "'+' An expression followed by a plus sign matches one or more", " occurrances of that expression: \"fo+\" matches \"fo\", etc.", "'-' An expression followed by a minus sign optionally matches", " the expression.", "'[]' A string enclosed in square brackets matches any character in", " that string, but no others. If the first character in the", " string is a circumflex, the expression matches any character", " except \"new-line\" and the characters in the string. For", " example, \"[xyz]\" matches \"xx\" and \"zyx\", while \"[^xyz]\"", " matches \"abc\" but not \"axb\". A range of characters may be", " specified by two characters separated by \"-\". Note that,", " [a-z] matches alphabetics, while [z-a] never matches.", "The concatenation of regular expressions is a regular expression.", 0}; #define LMAX 512 #define PMAX 256 #define CHAR 1 #define BOL 2 #define EOL 3 #define ANY 4 #define CLASS 5 #define NCLASS 6 #define STAR 7 #define PLUS 8 #define MINUS 9 #define ALPHA 10 #define DIGIT 11 #define NALPHA 12 #define PUNCT 13 #define RANGE 14 #define ENDPAT 15 int cflag=0, fflag=0, nflag=0, vflag=0, nfile=0, debug=0; char *pp, lbuf[LMAX], pbuf[PMAX]; char *cclass(); char *pmatch(); /*** Display a file name *******************************/ void file(char *s) { printf("File %s:\n", s); } /*** Report unopenable file ****************************/ void cant(char *s) { fprintf(stderr, "%s: cannot open\n", s); } /*** Give good help ************************************/ void help(char **hp) { char **dp; for (dp = hp; *dp; ++dp) printf("%s\n", *dp); } /*** Display usage summary *****************************/ void usage(char *s) { fprintf(stderr, "?GREP-E-%s\n", s); fprintf(stderr, "Usage: grep [-cfnv] pattern [file ...]. grep ? for help\n"); exit(1); } /*** Compile the pattern into global pbuf[] ************/ void compile(char *source) { char *s; /* Source string pointer */ char *lp; /* Last pattern pointer */ int c; /* Current character */ int o; /* Temp */ char *spp; /* Save beginning of pattern */ s = source; if (debug) printf("Pattern = \"%s\"\n", s); pp = pbuf; while (c = *s++) { /* * STAR, PLUS and MINUS are special. */ if (c == '*' || c == '+' || c == '-') { if (pp == pbuf || (o=pp[-1]) == BOL || o == EOL || o == STAR || o == PLUS || o == MINUS) badpat("Illegal occurrance op.", source, s); store(ENDPAT); store(ENDPAT); spp = pp; /* Save pattern end */ while (--pp > lp) /* Move pattern down */ *pp = pp[-1]; /* one byte */ *pp = (c == '*') ? STAR : (c == '-') ? MINUS : PLUS; pp = spp; /* Restore pattern end */ continue; } /* * All the rest. */ lp = pp; /* Remember start */ switch(c) { case '^': store(BOL); break; case '$': store(EOL); break; case '.': store(ANY); break; case '[': s = cclass(source, s); break; case ':': if (*s) { switch(tolower(c = *s++)) { case 'a': case 'A': store(ALPHA); break; case 'd': case 'D': store(DIGIT); break; case 'n': case 'N': store(NALPHA); break; case ' ': store(PUNCT); break; default: badpat("Unknown : type", source, s); } break; } else badpat("No : type", source, s); case '\\': if (*s) c = *s++; default: store(CHAR); store(tolower(c)); } } store(ENDPAT); store(0); /* Terminate string */ if (debug) { for (lp = pbuf; lp < pp;) { if ((c = (*lp++ & 0377)) < ' ') printf("\\%o ", c); else printf("%c ", c); } printf("\n"); } } /*** Compile a class (within []) ***********************/ char *cclass(char *source, char *src) /* char *source; // Pattern start -- for error msg. */ /* char *src; // Class start */ { char *s; /* Source pointer */ char *cp; /* Pattern start */ int c; /* Current character */ int o; /* Temp */ s = src; o = CLASS; if (*s == '^') { ++s; o = NCLASS; } store(o); cp = pp; store(0); /* Byte count */ while ((c = *s++) && c!=']') { if (c == '\\') { /* Store quoted char */ if ((c = *s++) == '\0') /* Gotta get something */ badpat("Class terminates badly", source, s); else store(tolower(c)); } else if (c == '-' && (pp - cp) > 1 && *s != ']' && *s != '\0') { c = pp[-1]; /* Range start */ pp[-1] = RANGE; /* Range signal */ store(c); /* Re-store start */ c = *s++; /* Get end char and*/ store(tolower(c)); /* Store it */ } else { store(tolower(c)); /* Store normal char */ } } if (c != ']') badpat("Unterminated class", source, s); if ((c = (pp - cp)) >= 256) badpat("Class too large", source, s); if (c == 0) badpat("Empty class", source, s); *cp = c; return(s); } /*** Store an entry in the pattern buffer **************/ void store(int op) { if (pp >= &pbuf[PMAX]) error("Pattern too complex\n"); *pp++ = op; } /*** Report a bad pattern specification ****************/ void badpat(char *message, char *source, char *stop) /* char *message; // Error message */ /* char *source; // Pattern start */ /* char *stop; // Pattern end */ { fprintf(stderr, "-GREP-E-%s, pattern is\"%s\"\n", message, source); fprintf(stderr, "-GREP-E-Stopped at byte %d, '%c'\n", stop-source, stop[-1]); error("?GREP-E-Bad pattern\n"); } /*** Scan the file for the pattern in pbuf[] ***********/ void grep(FILE *fp, char *fn) /* FILE *fp; // File to process */ /* char *fn; // File name (for -f option) */ { int lno, count, m; lno = 0; count = 0; while (fgets(lbuf, LMAX, fp)) { ++lno; m = match(); if ((m && !vflag) || (!m && vflag)) { ++count; if (!cflag) { if (fflag && fn) { file(fn); fn = 0; } if (nflag) printf("%d\t", lno); printf("%s\n", lbuf); } } } if (cflag) { if (fflag && fn) file(fn); printf("%d\n", count); } } /*** Match line (lbuf) with pattern (pbuf) return 1 if match ***/ int match() { char *l; /* Line pointer */ for (l = lbuf; *l; ++l) { if (pmatch(l, pbuf)) return(1); } return(0); } /*** Match partial line with pattern *******************/ char *pmatch(char *line, char *pattern) /* char *line; // (partial) line to match */ /* char *pattern; // (partial) pattern to match */ { char *l; /* Current line pointer */ char *p; /* Current pattern pointer */ char c; /* Current character */ char *e; /* End for STAR and PLUS match */ int op; /* Pattern operation */ int n; /* Class counter */ char *are; /* Start of STAR match */ l = line; if (debug > 1) printf("pmatch(\"%s\")\n", line); p = pattern; while ((op = *p++) != ENDPAT) { if (debug > 1) printf("byte[%d] = 0%o, '%c', op = 0%o\n", l-line, *l, *l, op); switch(op) { case CHAR: if (tolower(*l++) != *p++) return(0); break; case BOL: if (l != lbuf) return(0); break; case EOL: if (*l != '\0') return(0); break; case ANY: if (*l++ == '\0') return(0); break; case DIGIT: if ((c = *l++) < '0' || (c > '9')) return(0); break; case ALPHA: c = tolower(*l++); if (c < 'a' || c > 'z') return(0); break; case NALPHA: c = tolower(*l++); if (c >= 'a' && c <= 'z') break; else if (c < '0' || c > '9') return(0); break; case PUNCT: c = *l++; if (c == 0 || c > ' ') return(0); break; case CLASS: case NCLASS: c = tolower(*l++); n = *p++ & 0377; do { if (*p == RANGE) { p += 3; n -= 2; if (c >= p[-2] && c <= p[-1]) break; } else if (c == *p++) break; } while (--n > 1); if ((op == CLASS) == (n <= 1)) return(0); if (op == CLASS) p += n - 2; break; case MINUS: e = pmatch(l, p); /* Look for a match */ while (*p++ != ENDPAT); /* Skip over pattern */ if (e) /* Got a match? */ l = e; /* Yes, update string */ break; /* Always succeeds */ case PLUS: /* One or more ... */ if ((l = pmatch(l, p)) == 0) return(0); /* Gotta have a match */ case STAR: /* Zero or more ... */ are = l; /* Remember line start */ while (*l && (e = pmatch(l, p))) l = e; /* Get longest match */ while (*p++ != ENDPAT); /* Skip over pattern */ while (l >= are) { /* Try to match rest */ if (e = pmatch(l, p)) return(e); --l; /* Nope, try earlier */ } return(0); /* Nothing else worked */ default: printf("Bad op code %d\n", op); error("Cannot happen -- match\n"); } } return(l); } /*** Report an error ***********************************/ void error(char *s) { fprintf(stderr, "%s", s); exit(1); } /*** Main program - parse arguments & grep *************/ int main(int argc, char **argv) { char *p; int c, i; int gotpattern; FILE *f; if (argc <= 1) usage("No arguments"); if (argc == 2 && argv[1][0] == '?' && argv[1][1] == 0) { help(documentation); help(patdoc); return 0; } nfile = argc-1; gotpattern = 0; for (i=1; i < argc; ++i) { p = argv[i]; if (*p == '-') { ++p; while (c = *p++) { switch(tolower(c)) { case '?': help(documentation); break; case 'C': case 'c': ++cflag; break; case 'D': case 'd': ++debug; break; case 'F': case 'f': ++fflag; break; case 'n': case 'N': ++nflag; break; case 'v': case 'V': ++vflag; break; default: usage("Unknown flag"); } } argv[i] = 0; --nfile; } else if (!gotpattern) { compile(p); argv[i] = 0; ++gotpattern; --nfile; } } if (!gotpattern) usage("No pattern"); if (nfile == 0) grep(stdin, 0); else { fflag = fflag ^ (nfile > 0); for (i=1; i < argc; ++i) { if (p = argv[i]) { if ((f=fopen(p, "r")) == NULL) cant(p); else { grep(f, p); fclose(f); } } } } return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/47_switch_return.c ================================================ #include void fred(int x) { switch (x) { case 1: printf("1\n"); return; case 2: printf("2\n"); break; case 3: printf("3\n"); return; } printf("out\n"); } int main() { fred(1); fred(2); fred(3); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/47_switch_return.expect ================================================ 1 2 out 3 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/48_nested_break.c ================================================ #include int main() { int a; char b; a = 0; while (a < 2) { printf("%d", a++); break; b = 'A'; while (b < 'C') { printf("%c", b++); } printf("e"); } printf("\n"); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/48_nested_break.expect ================================================ 0 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/49_bracket_evaluation.c ================================================ #include struct point { double x; double y; }; struct point point_array[100]; int main() { int my_point = 10; point_array[my_point].x = 12.34; point_array[my_point].y = 56.78; printf("%f, %f\n", point_array[my_point].x, point_array[my_point].y); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/49_bracket_evaluation.expect ================================================ 12.340000, 56.780000 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/50_logical_second_arg.c ================================================ #include int fred() { printf("fred\n"); return 0; } int joe() { printf("joe\n"); return 1; } int main() { printf("%d\n", fred() && joe()); printf("%d\n", fred() || joe()); printf("%d\n", joe() && fred()); printf("%d\n", joe() || fred()); printf("%d\n", fred() && (1 + joe())); printf("%d\n", fred() || (0 + joe())); printf("%d\n", joe() && (0 + fred())); printf("%d\n", joe() || (1 + fred())); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/50_logical_second_arg.expect ================================================ fred 0 fred joe 1 joe fred 0 joe 1 fred 0 fred joe 1 joe fred 0 joe 1 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/51_static.c ================================================ #include static int fred = 1234; static int joe; void henry() { static int fred = 4567; printf("%d\n", fred); fred++; } int main() { printf("%d\n", fred); henry(); henry(); henry(); henry(); printf("%d\n", fred); fred = 8901; joe = 2345; printf("%d\n", fred); printf("%d\n", joe); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/51_static.expect ================================================ 1234 4567 4568 4569 4570 1234 8901 2345 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/52_unnamed_enum.c ================================================ #include enum fred { a, b, c }; int main() { printf("a=%d\n", a); printf("b=%d\n", b); printf("c=%d\n", c); enum fred d; typedef enum { e, f, g } h; typedef enum { i, j, k } m; printf("e=%d\n", e); printf("f=%d\n", f); printf("g=%d\n", g); printf("i=%d\n", i); printf("j=%d\n", j); printf("k=%d\n", k); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/52_unnamed_enum.expect ================================================ a=0 b=1 c=2 e=0 f=1 g=2 i=0 j=1 k=2 ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/54_goto.c ================================================ #include void fred() { printf("In fred()\n"); goto done; printf("In middle\n"); done: printf("At end\n"); } void joe() { int b = 5678; printf("In joe()\n"); { int c = 1234; printf("c = %d\n", c); goto outer; printf("uh-oh\n"); } outer: printf("done\n"); } void henry() { int a; printf("In henry()\n"); goto inner; { int b; inner: b = 1234; printf("b = %d\n", b); } printf("done\n"); } int main() { fred(); joe(); henry(); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/54_goto.expect ================================================ In fred() At end In joe() c = 1234 done In henry() b = 1234 done ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/55_lshift_type.c ================================================ /* $Id: lshift-type.c 53089 2012-07-06 11:18:26Z vinc17/ypig $ Tests on left-shift type, written by Vincent Lefevre . ISO C99 TC3 says: [6.5.7#3] "The integer promotions are performed on each of the operands. The type of the result is that of the promoted left operand." */ #include #define PTYPE(M) ((M) < 0 || -(M) < 0 ? -1 : 1) * (int) sizeof((M)+0) #define CHECK(X,T) check(#X, PTYPE(X), PTYPE((X) << (T) 1)) #define TEST1(X,T) do { CHECK(X,T); CHECK(X,unsigned T); } while (0) #define TEST2(X) \ do \ { \ TEST1((X),short); \ TEST1((X),int); \ TEST1((X),long); \ TEST1((X),long long); \ } \ while (0) #define TEST3(X,T) do { TEST2((T)(X)); TEST2((unsigned T)(X)); } while (0) #define TEST4(X) \ do \ { \ TEST3((X),short); \ TEST3((X),int); \ TEST3((X),long); \ TEST3((X),long long); \ } \ while (0) static int debug, nfailed = 0; static void check (const char *s, int arg1, int shift) { int failed = arg1 != shift; if (debug || failed) printf ("%s %d %d\n", s, arg1, shift); nfailed += failed; } int main (int argc, char **argv) { debug = argc > 1; TEST4(1); TEST4(-1); printf ("%d test(s) failed\n", nfailed); return nfailed != 0; } ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/55_lshift_type.expect ================================================ 0 test(s) failed ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/LICENSE ================================================ The tests in this directory are either directly copied from the picoc project or are subsequently modified and added to for the purpose of TinyCC project. All these modifications are licensed under the same terms as TinyCC as specified in the file COPYING. === picoc license === Copyright (c) 2009-2011, Zik Saleeba All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Zik Saleeba nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: testdata/tcc-0.9.26/tests/tests2/Makefile ================================================ TOP = ../.. include $(TOP)/Makefile VPATH = $(top_srcdir)/tests/tests2 TCCFLAGS = -B$(TOP) ifdef CONFIG_WIN32 TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP) endif ifeq ($(TARGETOS),Darwin) CFLAGS += -Wl,-flat_namespace,-undefined,warning TCCFLAGS += -D_ANSI_SOURCE export MACOSX_DEPLOYMENT_TARGET:=10.2 endif TCC_RUN = $(TOP)/tcc $(TCCFLAGS) -run TESTS = \ 00_assignment.test \ 01_comment.test \ 02_printf.test \ 03_struct.test \ 04_for.test \ 05_array.test \ 06_case.test \ 07_function.test \ 08_while.test \ 09_do_while.test \ 10_pointer.test \ 11_precedence.test \ 12_hashdefine.test \ 13_integer_literals.test \ 14_if.test \ 15_recursion.test \ 16_nesting.test \ 17_enum.test \ 18_include.test \ 19_pointer_arithmetic.test \ 20_pointer_comparison.test \ 21_char_array.test \ 22_floating_point.test \ 23_type_coercion.test \ 24_math_library.test \ 25_quicksort.test \ 26_character_constants.test \ 27_sizeof.test \ 28_strings.test \ 29_array_address.test \ 31_args.test \ 32_led.test \ 33_ternary_op.test \ 35_sizeof.test \ 36_array_initialisers.test \ 37_sprintf.test \ 38_multiple_array_index.test \ 39_typedef.test \ 40_stdio.test \ 41_hashif.test \ 42_function_pointer.test \ 43_void_param.test \ 44_scoped_declarations.test \ 45_empty_for.test \ 47_switch_return.test \ 48_nested_break.test \ 49_bracket_evaluation.test \ 50_logical_second_arg.test \ 51_static.test \ 52_unnamed_enum.test \ 54_goto.test \ 55_lshift_type.test # 30_hanoi.test -- seg fault in the code, gcc as well # 34_array_assignment.test -- array assignment is not in C standard # 46_grep.test -- does not compile even with gcc # some tests do not pass on all platforms, remove them for now ifeq ($(TARGETOS),Darwin) TESTS := $(filter-out 40_stdio.test,$(TESTS)) endif ifdef CONFIG_WIN32 TESTS := $(filter-out 24_math_library.test 28_strings.test,$(TESTS)) endif %.test: %.c %.expect @echo Test: $*... @if [ "x`echo $* | grep args`" != "x" ]; \ then $(TCC_RUN) $< - arg1 arg2 arg3 arg4 >$*.output; \ else $(TCC_RUN) $< >$*.output; \ fi @if diff -bu $(<:.c=.expect) $*.output ; \ then rm -f $*.output; \ else exit 1; \ fi all test: $(TESTS) clean: rm -vf fred.txt *.output ================================================ FILE: testdata/vers2.h ================================================ vers2.h included from testdata/example-6.10.3.5-4.h ================================================ FILE: trigraphs.go ================================================ // Code generated by golex. DO NOT EDIT. // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on [0], 6.4. // // Implements translation phases 1 and 2 of [0], 5.1.1.2. package cc import ( "fmt" ) const ( _ = iota scTRIGRAPHS ) func (t *trigraphsReader) scan() (r int) { c := t.Enter() yystate0: yyrule := -1 _ = yyrule c = t.Rule0() switch yyt := t.sc; yyt { default: panic(fmt.Errorf(`invalid start condition %d`, yyt)) case 0: // start condition: INITIAL goto yystart1 case 1: // start condition: TRIGRAPHS goto yystart5 } goto yystate0 // silence unused label error goto yyAction // silence unused label error yyAction: switch yyrule { case 1: goto yyrule1 case 2: goto yyrule2 case 3: goto yyrule3 case 4: goto yyrule4 case 5: goto yyrule5 case 6: goto yyrule6 case 7: goto yyrule7 case 8: goto yyrule8 case 9: goto yyrule9 case 10: goto yyrule10 case 11: goto yyrule11 } goto yystate1 // silence unused label error yystate1: c = t.Next() yystart1: switch { default: goto yyabort case c == '\\': goto yystate3 case c == '\r': goto yystate2 } yystate2: c = t.Next() yyrule = 10 t.Mark() goto yyrule10 yystate3: c = t.Next() switch { default: goto yyabort case c == '\n': goto yystate2 case c == '\r': goto yystate4 } yystate4: c = t.Next() switch { default: goto yyabort case c == '\n': goto yystate2 } goto yystate5 // silence unused label error yystate5: c = t.Next() yystart5: switch { default: goto yyabort case c == '?': goto yystate6 case c == '\\': goto yystate3 case c == '\r': goto yystate2 } yystate6: c = t.Next() switch { default: goto yyabort case c == '?': goto yystate7 } yystate7: c = t.Next() switch { default: goto yyabort case c == '!': goto yystate8 case c == '(': goto yystate10 case c == ')': goto yystate11 case c == '-': goto yystate12 case c == '/': goto yystate13 case c == '<': goto yystate16 case c == '=': goto yystate17 case c == '>': goto yystate18 case c == '\'': goto yystate9 } yystate8: c = t.Next() yyrule = 1 t.Mark() goto yyrule1 yystate9: c = t.Next() yyrule = 2 t.Mark() goto yyrule2 yystate10: c = t.Next() yyrule = 3 t.Mark() goto yyrule3 yystate11: c = t.Next() yyrule = 4 t.Mark() goto yyrule4 yystate12: c = t.Next() yyrule = 5 t.Mark() goto yyrule5 yystate13: c = t.Next() yyrule = 6 t.Mark() switch { default: goto yyrule6 case c == '\n': goto yystate14 case c == '\r': goto yystate15 } yystate14: c = t.Next() yyrule = 11 t.Mark() goto yyrule11 yystate15: c = t.Next() switch { default: goto yyabort case c == '\n': goto yystate14 } yystate16: c = t.Next() yyrule = 7 t.Mark() goto yyrule7 yystate17: c = t.Next() yyrule = 8 t.Mark() goto yyrule8 yystate18: c = t.Next() yyrule = 9 t.Mark() goto yyrule9 yyrule1: // "??!" { return '|' } yyrule2: // "??'" { return '^' } yyrule3: // "??(" { return '[' } yyrule4: // "??)" { return ']' } yyrule5: // "??-" { return '~' } yyrule6: // "??/" { return '\\' } yyrule7: // "??<" { return '{' } yyrule8: // "??=" { return '#' } yyrule9: // "??>" { return '}' } yyrule10: // \\\r?\n|\r yyrule11: // "??/"\r?\n goto yystate0 panic("unreachable") goto yyabort // silence unused label error yyabort: // no lexem recognized if c, ok := t.Abort(); ok { return c } goto yyAction } ================================================ FILE: trigraphs.l ================================================ %{ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on [0], 6.4. // // Implements translation phases 1 and 2 of [0], 5.1.1.2. %} %yyc c %yyn c = t.Next() %yym t.Mark() %yyt t.sc %s TRIGRAPHS %{ package cc import ( "fmt" ) const ( _ = iota scTRIGRAPHS ) func (t *trigraphsReader) scan() (r int) { c := t.Enter() %} %% c = t.Rule0() "??!" return '|' "??'" return '^' "??(" return '[' "??)" return ']' "??-" return '~' "??/" return '\\' "??<" return '{' "??=" return '#' "??>" return '}' \\\r?\n|\r | "??/"\r?\n %% if c, ok := t.Abort(); ok { return c } goto yyAction } ================================================ FILE: ucn32.go ================================================ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build 386 arm armbe mips mipsle sparc package cc var ucnDigits = [...]uint32{ 0x33: 0x3ff, 0x37: 0x3ff0000, 0x4b: 0xffc0, 0x4f: 0xffc0, 0x53: 0xffc0, 0x57: 0xffc0, 0x5b: 0xffc0, 0x5f: 0xff80, 0x63: 0xffc0, 0x67: 0xffc0, 0x6b: 0xffc0, 0x72: 0x3ff0000, 0x76: 0x3ff0000, 0x79: 0xfffff, } var ucnNonDigits = [...]uint32{ 0x5: 0x4a00400, 0xff7fffff, 0xff7fffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfc3fffff, 0xffffff, 0x12: 0xffff0000, 0xffffffff, 0xffffffff, 0xe9ff01ff, 0x30003, 0x1f, 0x1b: 0x4000000, 0xffffd740, 0xfffffffb, 0x547f7fff, 0xffffd, 0xffffdffe, 0xffffffff, 0xdffeffff, 0xffffffff, 0xffff0003, 0xffffffff, 0xffff199f, 0x33fcfff, 0x29: 0xfffe0000, 0x27fffff, 0xfffffffe, 0xff, 0x3ff0000, 0x2f: 0x70000, 0x31: 0x7fffffe, 0x7ffff, 0xffff0000, 0xffffffff, 0x7cffffff, 0x1fff7fff, 0x3de0, 0x48: 0xffffffee, 0xe3ffffff, 0xff073fff, 0xf, 0xfff99fee, 0xc3c5fdff, 0xb000399f, 0x3000f, 0xfff987e4, 0xc36dfdff, 0x5e003987, 0x100000, 0xfffbafee, 0xe3edfdff, 0x13bbf, 0x1, 0xfff99fee, 0xe3cdfdff, 0xb000398f, 0x3, 0xd63dc7ec, 0xc3bfc718, 0x3dc7, 0x60: 0xfffddfee, 0xc3effdff, 0x3ddf, 0x3, 0xfffddfec, 0xc3effdff, 0x40003ddf, 0x3, 0xfffddfec, 0xc3fffdff, 0x3dcf, 0x3, 0x70: 0xfffffffe, 0x7ffffff, 0xc00ffff, 0x74: 0xfef02596, 0x3bff6cae, 0x30003f5f, 0x78: 0x3000001, 0xc2a00000, 0xfffffeff, 0xfffe03ff, 0xfebf0fdf, 0x2fe3fff, 0x85: 0xffffffff, 0xffff003f, 0x7fffff, 0xf0: 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffff, 0xffffffff, 0xffffffff, 0x3ffffff, 0x3f3fffff, 0xffffffff, 0xaaff3f3f, 0x3fffffff, 0xffffffff, 0x5fdfffff, 0xfcf1fdc, 0x1fdc1fff, 0x101: 0x80000000, 0x1, 0x80000000, 0x108: 0x3f2ffc84, 0x1fbfd50, 0x10b: 0xffffffff, 0x7, 0x180: 0xe0, 0x3fe, 0xfffffffe, 0xffffffff, 0x180fffff, 0xfffffffe, 0xffffffff, 0x187fffff, 0xffffffe0, 0x1fff, 0x270: 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x3f, 0x560: 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xf, } ================================================ FILE: ucn64.go ================================================ // Copyright 2016 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build amd64 amd64p32 arm64 arm64be ppc64 ppc64le mips64 mips64le mips64p32 mips64p32le sparc64 package cc var ucnDigits = [...]uint64{ 0x19: 0x3ff00000000, 0x1b: 0x3ff000000000000, 0x25: 0xffc000000000, 0x27: 0xffc000000000, 0x29: 0xffc000000000, 0x2b: 0xffc000000000, 0x2d: 0xffc000000000, 0x2f: 0xff8000000000, 0x31: 0xffc000000000, 0x33: 0xffc000000000, 0x35: 0xffc000000000, 0x39: 0x3ff0000, 0x3b: 0x3ff0000, 0xfffff00000000, } var ucnNonDigits = [...]uint64{ 0x2: 0x4a0040000000000, 0xff7fffffff7fffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xfc3fffffffffffff, 0xffffff, 0xffffffffffff0000, 0xe9ff01ffffffffff, 0x1f00030003, 0xd: 0x400000000000000, 0xfffffffbffffd740, 0xffffd547f7fff, 0xffffffffffffdffe, 0xffffffffdffeffff, 0xffffffffffff0003, 0x33fcfffffff199f, 0xfffe000000000000, 0xfffffffe027fffff, 0x3ff0000000000ff, 0x7000000000000, 0x7fffffe00000000, 0xffff00000007ffff, 0x7cffffffffffffff, 0x3de01fff7fff, 0x24: 0xe3ffffffffffffee, 0xfff073fff, 0xc3c5fdfffff99fee, 0x3000fb000399f, 0xc36dfdfffff987e4, 0x1000005e003987, 0xe3edfdfffffbafee, 0x100013bbf, 0xe3cdfdfffff99fee, 0x3b000398f, 0xc3bfc718d63dc7ec, 0x3dc7, 0xc3effdfffffddfee, 0x300003ddf, 0xc3effdfffffddfec, 0x340003ddf, 0xc3fffdfffffddfec, 0x300003dcf, 0x38: 0x7fffffffffffffe, 0xc00ffff, 0x3bff6caefef02596, 0x30003f5f, 0xc2a0000003000001, 0xfffe03fffffffeff, 0x2fe3ffffebf0fdf, 0x42: 0xffffffff00000000, 0x7fffffffff003f, 0x78: 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffff0fffffff, 0x3ffffffffffffff, 0xffffffff3f3fffff, 0x3fffffffaaff3f3f, 0x5fdfffffffffffff, 0x1fdc1fff0fcf1fdc, 0x8000000000000000, 0x8000000000000001, 0x84: 0x1fbfd503f2ffc84, 0xffffffff00000000, 0x7, 0xc0: 0x3fe000000e0, 0xfffffffffffffffe, 0xfffffffe180fffff, 0x187fffffffffffff, 0x1fffffffffe0, 0x138: 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0x3fffffffff, 0x2b0: 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xfffffffff, } ================================================ FILE: v2/AUTHORS ================================================ # This file lists authors for copyright purposes. This file is distinct from # the CONTRIBUTORS files. See the latter for an explanation. # # Names should be added to this file as: # Name or Organization # # The email address is not required for organizations. # # Please keep the list sorted. Dan Kortschak Jan Mercl <0xjnml@gmail.com> Maxim Kupriianov Peter Waller Steffen Butzer Yasuhiro Matsumoto ================================================ FILE: v2/CONTRIBUTORS ================================================ # This file lists people who contributed code to this repository. The AUTHORS # file lists the copyright holders; this file lists people. # # Names should be added to this file like so: # Name # # Please keep the list sorted. Dan Kortschak Jan Mercl <0xjnml@gmail.com> Maxim Kupriianov Peter Waller Steffen Butzer Yasuhiro Matsumoto Zvi Effron ================================================ FILE: v2/LICENSE ================================================ Copyright (c) 2017 The CC Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the names of the authors nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: v2/Makefile ================================================ # Copyright 2017 The CC Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. .PHONY: all clean cover cpu editor internalError later mem nuke todo edit grep=--include=*.go --include=*.l --include=*.y --include=*.yy ngrep='TODOOK\|parser\.go\|scanner\.go\|trigraphs\.go\|.*_string\.go' all: editor go vet 2>&1 | grep -v $(ngrep) || true golint 2>&1 | grep -v $(ngrep) || true make todo unused . || true misspell *.go gosimple || true maligned || true unconvert -apply clean: go clean rm -f *~ *.test *.out cover: t=$(shell tempfile) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t cpu: clean go test -run @ -bench . -cpuprofile cpu.out go tool pprof -lines *.test cpu.out edit: touch log gvim -p Makefile *.l *.yy *_test.go log ast2.go cc.go cpp.go encoding.go enum.go etc.go lexer.go model.go operand.go type.go editor: ast.go parser.go scanner.go trigraphs.go stringer.go gofmt -l -s -w *.go GOOS=linux GOARCH=arm go build GOOS=linux GOARCH=386 go build GOOS=linux GOARCH=amd64 go build GOOS=windows GOARCH=386 go build GOOS=windows GOARCH=amd64 go build go test -i go test -short 2>&1 | tee log sleep 1 go install internalError: egrep -ho '"internal error.*"' *.go | sort | cat -n later: @grep -n $(grep) LATER * || true @grep -n $(grep) MAYBE * || true mem: clean go test -run @ -bench . -memprofile mem.out -memprofilerate 1 -timeout 24h go tool pprof -lines -web -alloc_space *.test mem.out nuke: clean go clean -i todo: @grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * | grep -v $(ngrep) || true @grep -nr $(grep) TODO * | grep -v $(ngrep) || true @grep -nr $(grep) BUG * | grep -v $(ngrep) || true @grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true ast.go parser.go scanner.go trigraphs.go stringer.go: parser.yy scanner.l trigraphs.l enum.go go generate ================================================ FILE: v2/README.md ================================================ # c99 Package CC is a C99 compiler front end. Work In Progress. API unstable. Installation $ go get github.com/cznic/cc/v2 Documentation: [godoc.org/github.com/cznic/cc/v2](http://godoc.org/github.com/cznic/cc/v2) ================================================ FILE: v2/all_test.go ================================================ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc // [0]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf import ( "bytes" "flag" "fmt" "go/token" "io" "io/ioutil" "os" "path" "path/filepath" "regexp" "runtime" "strings" "testing" "unicode" "unicode/utf8" "github.com/cznic/golex/lex" "github.com/cznic/xc" ) func caller(s string, va ...interface{}) { if s == "" { s = strings.Repeat("%v ", len(va)) } _, fn, fl, _ := runtime.Caller(2) fmt.Fprintf(os.Stderr, "# caller: %s:%d: ", path.Base(fn), fl) fmt.Fprintf(os.Stderr, s, va...) fmt.Fprintln(os.Stderr) _, fn, fl, _ = runtime.Caller(1) fmt.Fprintf(os.Stderr, "# \tcallee: %s:%d: ", path.Base(fn), fl) fmt.Fprintln(os.Stderr) os.Stderr.Sync() } func caller3(s string, va ...interface{}) { if s == "" { s = strings.Repeat("%v ", len(va)) } _, fn, fl, _ := runtime.Caller(3) fmt.Fprintf(os.Stderr, "# caller: %s:%d: ", path.Base(fn), fl) fmt.Fprintf(os.Stderr, s, va...) fmt.Fprintln(os.Stderr) _, fn, fl, _ = runtime.Caller(1) fmt.Fprintf(os.Stderr, "# \tcallee: %s:%d: ", path.Base(fn), fl) fmt.Fprintln(os.Stderr) os.Stderr.Sync() } func dbg(s string, va ...interface{}) { if s == "" { s = strings.Repeat("%v ", len(va)) } _, fn, fl, _ := runtime.Caller(1) fmt.Fprintf(os.Stderr, "# dbg %s:%d: ", path.Base(fn), fl) fmt.Fprintf(os.Stderr, s, va...) fmt.Fprintln(os.Stderr) os.Stderr.Sync() } func TODO(...interface{}) string { //TODOOK _, fn, fl, _ := runtime.Caller(1) return fmt.Sprintf("# TODO: %s:%d:\n", path.Base(fn), fl) //TODOOK } func use(...interface{}) {} func init() { use(caller, caller3, dbg, TODO, toksDump) //TODOOK flag.IntVar(&yyDebug, "yydebug", 0, "") flag.BoolVar(&traceMacroDefs, "macros", false, "") } // ============================================================================ var ( oRE = flag.String("re", "", "") shellc = filepath.FromSlash("testdata/_sqlite/sqlite-amalgamation-3210000/shell.c") sqlite3c = filepath.FromSlash("testdata/_sqlite/sqlite-amalgamation-3210000/sqlite3.c") searchPaths []string ) func init() { var err error searchPaths, err = Paths(true) if err != nil { panic(err) } } func testUCNTable(t *testing.T, tab []rune, fOk, fOther func(rune) bool, fcategory func(rune) bool, tag string) { m := map[rune]struct{}{} for i := 0; i < len(tab); i += 2 { l, h := tab[i], tab[i+1] if h == 0 { h = l } for r := l; r <= h; r++ { m[r] = struct{}{} } } for r := rune(0); r < 0xffff; r++ { _, ok := m[r] if g, e := fOk(r), ok; g != e { t.Errorf("%#04x %v %v", r, g, e) } if ok { if g, e := fOther(r), false; g != e { t.Errorf("%#04x %v %v", r, g, e) } } } } func TestUCNDigitsTable(t *testing.T) { tab := []rune{ 0x0660, 0x0669, 0x06F0, 0x06F9, 0x0966, 0x096F, 0x09E6, 0x09EF, 0x0A66, 0x0A6F, 0x0AE6, 0x0AEF, 0x0B66, 0x0B6F, 0x0BE7, 0x0BEF, 0x0C66, 0x0C6F, 0x0CE6, 0x0CEF, 0x0D66, 0x0D6F, 0x0E50, 0x0E59, 0x0ED0, 0x0ED9, 0x0F20, 0x0F33, } testUCNTable(t, tab, isUCNDigit, isUCNNonDigit, unicode.IsDigit, "unicode.IsDigit") } func TestUCNNonDigitsTable(t *testing.T) { tab := []rune{ 0x00AA, 0x0000, 0x00B5, 0x0000, 0x00B7, 0x0000, 0x00BA, 0x0000, 0x00C0, 0x00D6, 0x00D8, 0x00F6, 0x00F8, 0x01F5, 0x01FA, 0x0217, 0x0250, 0x02A8, 0x02B0, 0x02B8, 0x02BB, 0x0000, 0x02BD, 0x02C1, 0x02D0, 0x02D1, 0x02E0, 0x02E4, 0x037A, 0x0000, 0x0386, 0x0000, 0x0388, 0x038A, 0x038C, 0x0000, 0x038E, 0x03A1, 0x03A3, 0x03CE, 0x03D0, 0x03D6, 0x03DA, 0x0000, 0x03DC, 0x0000, 0x03DE, 0x0000, 0x03E0, 0x0000, 0x03E2, 0x03F3, 0x0401, 0x040C, 0x040E, 0x044F, 0x0451, 0x045C, 0x045E, 0x0481, 0x0490, 0x04C4, 0x04C7, 0x04C8, 0x04CB, 0x04CC, 0x04D0, 0x04EB, 0x04EE, 0x04F5, 0x04F8, 0x04F9, 0x0531, 0x0556, 0x0559, 0x0000, 0x0561, 0x0587, 0x05B0, 0x05B9, 0x05F0, 0x05F2, 0x0621, 0x063A, 0x0640, 0x0652, 0x0670, 0x06B7, 0x06BA, 0x06BE, 0x06C0, 0x06CE, 0x06D0, 0x06DC, 0x06E5, 0x06E8, 0x06EA, 0x06ED, 0x0901, 0x0903, 0x0905, 0x0939, 0x093D, 0x0000, 0x093E, 0x094D, 0x0950, 0x0952, 0x0958, 0x0963, 0x0981, 0x0983, 0x0985, 0x098C, 0x098F, 0x0990, 0x0993, 0x09A8, 0x09AA, 0x09B0, 0x09B2, 0x0000, 0x09B6, 0x09B9, 0x09BE, 0x09C4, 0x09C7, 0x09C8, 0x09CB, 0x09CD, 0x09DC, 0x09DD, 0x09DF, 0x09E3, 0x09F0, 0x09F1, 0x0A02, 0x0000, 0x0A05, 0x0A0A, 0x0A0F, 0x0A10, 0x0A13, 0x0A28, 0x0A2A, 0x0A30, 0x0A32, 0x0A33, 0x0A35, 0x0A36, 0x0A38, 0x0A39, 0x0A3E, 0x0A42, 0x0A47, 0x0A48, 0x0A4B, 0x0A4D, 0x0A59, 0x0A5C, 0x0A5E, 0x0000, 0x0A74, 0x0000, 0x0A81, 0x0A83, 0x0A85, 0x0A8B, 0x0A8D, 0x0000, 0x0A8F, 0x0A91, 0x0A93, 0x0AA8, 0x0AAA, 0x0AB0, 0x0AB2, 0x0AB3, 0x0AB5, 0x0AB9, 0x0ABD, 0x0AC5, 0x0AC7, 0x0AC9, 0x0ACB, 0x0ACD, 0x0AD0, 0x0000, 0x0AE0, 0x0000, 0x0B01, 0x0B03, 0x0B05, 0x0B0C, 0x0B0F, 0x0B10, 0x0B13, 0x0B28, 0x0B2A, 0x0B30, 0x0B32, 0x0B33, 0x0B36, 0x0B39, 0x0B3D, 0x0000, 0x0B3E, 0x0B43, 0x0B47, 0x0B48, 0x0B4B, 0x0B4D, 0x0B5C, 0x0B5D, 0x0B5F, 0x0B61, 0x0B82, 0x0B83, 0x0B85, 0x0B8A, 0x0B8E, 0x0B90, 0x0B92, 0x0B95, 0x0B99, 0x0B9A, 0x0B9C, 0x0000, 0x0B9E, 0x0B9F, 0x0BA3, 0x0BA4, 0x0BA8, 0x0BAA, 0x0BAE, 0x0BB5, 0x0BB7, 0x0BB9, 0x0BBE, 0x0BC2, 0x0BC6, 0x0BC8, 0x0BCA, 0x0BCD, 0x0C01, 0x0C03, 0x0C05, 0x0C0C, 0x0C0E, 0x0C10, 0x0C12, 0x0C28, 0x0C2A, 0x0C33, 0x0C35, 0x0C39, 0x0C3E, 0x0C44, 0x0C46, 0x0C48, 0x0C4A, 0x0C4D, 0x0C60, 0x0C61, 0x0C82, 0x0C83, 0x0C85, 0x0C8C, 0x0C8E, 0x0C90, 0x0C92, 0x0CA8, 0x0CAA, 0x0CB3, 0x0CB5, 0x0CB9, 0x0CBE, 0x0CC4, 0x0CC6, 0x0CC8, 0x0CCA, 0x0CCD, 0x0CDE, 0x0000, 0x0CE0, 0x0CE1, 0x0D02, 0x0D03, 0x0D05, 0x0D0C, 0x0D0E, 0x0D10, 0x0D12, 0x0D28, 0x0D2A, 0x0D39, 0x0D3E, 0x0D43, 0x0D46, 0x0D48, 0x0D4A, 0x0D4D, 0x0D60, 0x0D61, 0x0E01, 0x0E3A, // In [0], Annex D, Thai [0x0E40, 0x0E5B] overlaps with digits // [0x0E50, 0x0E59]. Exclude them. 0x0E40, 0x0E4F, 0x0E5A, 0x0E5B, 0x0E81, 0x0E82, 0x0E84, 0x0000, 0x0E87, 0x0E88, 0x0E8A, 0x0000, 0x0E8D, 0x0000, 0x0E94, 0x0E97, 0x0E99, 0x0E9F, 0x0EA1, 0x0EA3, 0x0EA5, 0x0000, 0x0EA7, 0x0000, 0x0EAA, 0x0EAB, 0x0EAD, 0x0EAE, 0x0EB0, 0x0EB9, 0x0EBB, 0x0EBD, 0x0EC0, 0x0EC4, 0x0EC6, 0x0000, 0x0EC8, 0x0ECD, 0x0EDC, 0x0EDD, 0x0F00, 0x0000, 0x0F18, 0x0F19, 0x0F35, 0x0000, 0x0F37, 0x0000, 0x0F39, 0x0000, 0x0F3E, 0x0F47, 0x0F49, 0x0F69, 0x0F71, 0x0F84, 0x0F86, 0x0F8B, 0x0F90, 0x0F95, 0x0F97, 0x0000, 0x0F99, 0x0FAD, 0x0FB1, 0x0FB7, 0x0FB9, 0x0000, 0x10A0, 0x10C5, 0x10D0, 0x10F6, 0x1E00, 0x1E9B, 0x1EA0, 0x1EF9, 0x1F00, 0x1F15, 0x1F18, 0x1F1D, 0x1F20, 0x1F45, 0x1F48, 0x1F4D, 0x1F50, 0x1F57, 0x1F59, 0x0000, 0x1F5B, 0x0000, 0x1F5D, 0x0000, 0x1F5F, 0x1F7D, 0x1F80, 0x1FB4, 0x1FB6, 0x1FBC, 0x1FBE, 0x0000, 0x1FC2, 0x1FC4, 0x1FC6, 0x1FCC, 0x1FD0, 0x1FD3, 0x1FD6, 0x1FDB, 0x1FE0, 0x1FEC, 0x1FF2, 0x1FF4, 0x1FF6, 0x1FFC, 0x203F, 0x2040, 0x207F, 0x0000, 0x2102, 0x0000, 0x2107, 0x0000, 0x210A, 0x2113, 0x2115, 0x0000, 0x2118, 0x211D, 0x2124, 0x0000, 0x2126, 0x0000, 0x2128, 0x0000, 0x212A, 0x2131, 0x2133, 0x2138, 0x2160, 0x2182, 0x3005, 0x3007, 0x3021, 0x3029, 0x3041, 0x3093, 0x309B, 0x309C, 0x30A1, 0x30F6, 0x30FB, 0x30FC, 0x3105, 0x312C, 0x4E00, 0x9FA5, 0xAC00, 0xD7A3, } testUCNTable(t, tab, isUCNNonDigit, isUCNDigit, unicode.IsLetter, "unicode.IsLetter") } func charStr(c rune) string { return yySymName(int(c)) } func charsStr(chars []lex.Char, delta token.Pos) (a []string) { for _, v := range chars { a = append(a, fmt.Sprintf("{%s %d}", charStr(v.Rune), v.Pos()-delta)) } return a } type x []struct { c rune pos token.Pos } type lexerTests []struct { src string chars x } func testLexer(t *testing.T, newLexer func(i int, src string) (*lexer, error), tab lexerTests) { nextTest: for ti, test := range tab { lx, err := newLexer(ti, test.src) if err != nil { t.Fatal(err) } delta := token.Pos(lx.File.Base() - 1) var chars []lex.Char var c lex.Char var lval yySymType for i := 0; c.Rune >= 0 && i < len(test.src)+2; i++ { lx.Lex(&lval) c = lval.Token.Char chars = append(chars, c) } if c.Rune >= 0 { t.Errorf("%d: scanner stall %v", ti, charsStr(chars, delta)) continue } if g, e := lx.error(), error(nil); g != e { t.Errorf("%d: lx.err %v %v %v", ti, g, e, charsStr(chars, delta)) continue } if g, e := len(chars), len(test.chars); g != e { t.Errorf("%d: len(chars) %v %v %v", ti, g, e, charsStr(chars, delta)) continue } for i, c := range chars { c = chars[i] e := test.chars[i] g := c.Rune if e := e.c; g != e { t.Errorf("%d: c[%d] %v %v %v", ti, i, charStr(g), charStr(e), charsStr(chars, delta)) continue nextTest } if g, e := c.Pos()-delta, e.pos; g != e { t.Errorf("%d: pos[%d] %v %v %v", ti, i, g, e, charsStr(chars, delta)) continue nextTest } } } } func TestLexer(t *testing.T) { ctx, err := newContext(&Tweaks{}) if err != nil { t.Fatal(err) } testLexer( t, func(i int, src string) (*lexer, error) { return newLexer(ctx, fmt.Sprintf("TestLexer.%d", i), len(src), strings.NewReader(src)) }, lexerTests{ {"", x{{-1, 1}}}, {"%0", x{{'%', 1}, {INTCONST, 2}, {-1, 3}}}, {"%:%:", x{{PPPASTE, 1}, {-1, 5}}}, {"%>", x{{'}', 1}, {-1, 3}}}, {"0", x{{INTCONST, 1}, {-1, 2}}}, {"01", x{{INTCONST, 1}, {-1, 3}}}, {"0??/1\n", x{{INTCONST, 1}, {'?', 2}, {'?', 3}, {'/', 4}, {INTCONST, 5}, {'\n', 6}, {-1, 7}}}, {"0??/1\n2", x{{INTCONST, 1}, {'?', 2}, {'?', 3}, {'/', 4}, {INTCONST, 5}, {'\n', 6}, {INTCONST, 7}, {-1, 8}}}, {"0??/\n", x{{INTCONST, 1}, {'?', 2}, {'?', 3}, {'/', 4}, {'\n', 5}, {-1, 6}}}, {"0??/\n2", x{{INTCONST, 1}, {'?', 2}, {'?', 3}, {'/', 4}, {'\n', 5}, {INTCONST, 6}, {-1, 7}}}, {"0\\1\n", x{{INTCONST, 1}, {'\\', 2}, {INTCONST, 3}, {'\n', 4}, {-1, 5}}}, {"0\\1\n2", x{{INTCONST, 1}, {'\\', 2}, {INTCONST, 3}, {'\n', 4}, {INTCONST, 5}, {-1, 6}}}, {"0\\\n", x{{INTCONST, 1}, {-1, 4}}}, {"0\\\n2", x{{INTCONST, 1}, {-1, 5}}}, {"0\x00", x{{INTCONST, 1}, {0, 2}, {-1, 3}}}, {"0\x001", x{{INTCONST, 1}, {0, 2}, {INTCONST, 3}, {-1, 4}}}, {":>", x{{']', 1}, {-1, 3}}}, {"<%", x{{'{', 1}, {-1, 3}}}, {"<:", x{{'[', 1}, {-1, 3}}}, {"??!", x{{'?', 1}, {'?', 2}, {'!', 3}, {-1, 4}}}, {"??!0", x{{'?', 1}, {'?', 2}, {'!', 3}, {INTCONST, 4}, {-1, 5}}}, {"??!01", x{{'?', 1}, {'?', 2}, {'!', 3}, {INTCONST, 4}, {-1, 6}}}, {"??!=", x{{'?', 1}, {'?', 2}, {NEQ, 3}, {-1, 5}}}, {"??'", x{{'?', 1}, {'?', 2}, {'\'', 3}, {-1, 4}}}, {"??(", x{{'?', 1}, {'?', 2}, {'(', 3}, {-1, 4}}}, {"??)", x{{'?', 1}, {'?', 2}, {')', 3}, {-1, 4}}}, {"??-", x{{'?', 1}, {'?', 2}, {'-', 3}, {-1, 4}}}, {"??/", x{{'?', 1}, {'?', 2}, {'/', 3}, {-1, 4}}}, {"??/1\n", x{{'?', 1}, {'?', 2}, {'/', 3}, {INTCONST, 4}, {'\n', 5}, {-1, 6}}}, {"??/1\n2", x{{'?', 1}, {'?', 2}, {'/', 3}, {INTCONST, 4}, {'\n', 5}, {INTCONST, 6}, {-1, 7}}}, {"??/\n", x{{'?', 1}, {'?', 2}, {'/', 3}, {'\n', 4}, {-1, 5}}}, {"??/\n2", x{{'?', 1}, {'?', 2}, {'/', 3}, {'\n', 4}, {INTCONST, 5}, {-1, 6}}}, {"??<", x{{'?', 1}, {'?', 2}, {'<', 3}, {-1, 4}}}, {"??=??=", x{{'?', 1}, {'?', 2}, {'=', 3}, {'?', 4}, {'?', 5}, {'=', 6}, {-1, 7}}}, {"??>", x{{'?', 1}, {'?', 2}, {'>', 3}, {-1, 4}}}, {"???!", x{{'?', 1}, {'?', 2}, {'?', 3}, {'!', 4}, {-1, 5}}}, {"???!0", x{{'?', 1}, {'?', 2}, {'?', 3}, {'!', 4}, {INTCONST, 5}, {-1, 6}}}, {"???/\n2", x{{'?', 1}, {'?', 2}, {'?', 3}, {'/', 4}, {'\n', 5}, {INTCONST, 6}, {-1, 7}}}, {"????!0", x{{'?', 1}, {'?', 2}, {'?', 3}, {'?', 4}, {'!', 5}, {INTCONST, 6}, {-1, 7}}}, {"???x0", x{{'?', 1}, {'?', 2}, {'?', 3}, {IDENTIFIER, 4}, {-1, 6}}}, {"???x??!0", x{{'?', 1}, {'?', 2}, {'?', 3}, {IDENTIFIER, 4}, {'?', 5}, {'?', 6}, {'!', 7}, {INTCONST, 8}, {-1, 9}}}, {"??x0", x{{'?', 1}, {'?', 2}, {IDENTIFIER, 3}, {-1, 5}}}, {"??x??!0", x{{'?', 1}, {'?', 2}, {IDENTIFIER, 3}, {'?', 4}, {'?', 5}, {'!', 6}, {INTCONST, 7}, {-1, 8}}}, {"?x0", x{{'?', 1}, {IDENTIFIER, 2}, {-1, 4}}}, {"?x??!0", x{{'?', 1}, {IDENTIFIER, 2}, {'?', 3}, {'?', 4}, {'!', 5}, {INTCONST, 6}, {-1, 7}}}, {"@", x{{'@', 1}, {-1, 2}}}, {"@%", x{{'@', 1}, {'%', 2}, {-1, 3}}}, {"@%0", x{{'@', 1}, {'%', 2}, {INTCONST, 3}, {-1, 4}}}, {"@%:", x{{'@', 1}, {'#', 2}, {-1, 4}}}, {"@%:0", x{{'@', 1}, {'#', 2}, {INTCONST, 4}, {-1, 5}}}, {"@%:01", x{{'@', 1}, {'#', 2}, {INTCONST, 4}, {-1, 6}}}, {"@??=", x{{'@', 1}, {'?', 2}, {'?', 3}, {'=', 4}, {-1, 5}}}, {"\"(a\\\nz", x{{'"', 1}, {'(', 2}, {IDENTIFIER, 3}, {-1, 7}}}, {"\\1\n", x{{'\\', 1}, {INTCONST, 2}, {'\n', 3}, {-1, 4}}}, {"\\1\n2", x{{'\\', 1}, {INTCONST, 2}, {'\n', 3}, {INTCONST, 4}, {-1, 5}}}, {"\\\n", x{{-1, 3}}}, {"\\\n2", x{{INTCONST, 3}, {-1, 4}}}, {"\\\r\n", x{{-1, 4}}}, {"\\\r\n2", x{{INTCONST, 4}, {-1, 5}}}, {"\r", x{{-1, 2}}}, {"\r0", x{{INTCONST, 2}, {-1, 3}}}, {"\r01", x{{INTCONST, 2}, {-1, 4}}}, {"\x00", x{{0, 1}, {-1, 2}}}, {"\x000", x{{0, 1}, {INTCONST, 2}, {-1, 3}}}, }, ) } func TestLexerTrigraphs(t *testing.T) { ctx, err := newContext(&Tweaks{EnableTrigraphs: true}) if err != nil { t.Fatal(err) } testLexer( t, func(i int, src string) (*lexer, error) { return newLexer(ctx, fmt.Sprintf("TestLexer.%d", i), len(src), strings.NewReader(src)) }, lexerTests{ {"", x{{-1, 1}}}, {"%0", x{{'%', 1}, {INTCONST, 2}, {-1, 3}}}, {"%:%:", x{{PPPASTE, 1}, {-1, 5}}}, {"%>", x{{'}', 1}, {-1, 3}}}, {"0", x{{INTCONST, 1}, {-1, 2}}}, {"01", x{{INTCONST, 1}, {-1, 3}}}, {"0??/1\n", x{{INTCONST, 1}, {'\\', 2}, {INTCONST, 5}, {'\n', 6}, {-1, 7}}}, {"0??/1\n2", x{{INTCONST, 1}, {'\\', 2}, {INTCONST, 5}, {'\n', 6}, {INTCONST, 7}, {-1, 8}}}, {"0??/\n", x{{INTCONST, 1}, {-1, 6}}}, {"0??/\n2", x{{INTCONST, 1}, {-1, 7}}}, {"0\\1\n", x{{INTCONST, 1}, {'\\', 2}, {INTCONST, 3}, {'\n', 4}, {-1, 5}}}, {"0\\1\n2", x{{INTCONST, 1}, {'\\', 2}, {INTCONST, 3}, {'\n', 4}, {INTCONST, 5}, {-1, 6}}}, {"0\\\n", x{{INTCONST, 1}, {-1, 4}}}, {"0\\\n2", x{{INTCONST, 1}, {-1, 5}}}, {"0\x00", x{{INTCONST, 1}, {0, 2}, {-1, 3}}}, {"0\x001", x{{INTCONST, 1}, {0, 2}, {INTCONST, 3}, {-1, 4}}}, {":>", x{{']', 1}, {-1, 3}}}, {"<%", x{{'{', 1}, {-1, 3}}}, {"<:", x{{'[', 1}, {-1, 3}}}, {"??!", x{{'|', 1}, {-1, 4}}}, {"??!0", x{{'|', 1}, {INTCONST, 4}, {-1, 5}}}, {"??!01", x{{'|', 1}, {INTCONST, 4}, {-1, 6}}}, {"??!=", x{{ORASSIGN, 1}, {-1, 5}}}, {"??'", x{{'^', 1}, {-1, 4}}}, {"??(", x{{'[', 1}, {-1, 4}}}, {"??)", x{{']', 1}, {-1, 4}}}, {"??-", x{{'~', 1}, {-1, 4}}}, {"??/", x{{'\\', 1}, {-1, 4}}}, {"??/1\n", x{{'\\', 1}, {INTCONST, 4}, {'\n', 5}, {-1, 6}}}, {"??/1\n2", x{{'\\', 1}, {INTCONST, 4}, {'\n', 5}, {INTCONST, 6}, {-1, 7}}}, {"??/\n", x{{-1, 5}}}, {"??/\n2", x{{INTCONST, 5}, {-1, 6}}}, {"??<", x{{'{', 1}, {-1, 4}}}, {"??=??=", x{{PPPASTE, 1}, {-1, 7}}}, {"??>", x{{'}', 1}, {-1, 4}}}, {"???!", x{{'?', 1}, {'|', 2}, {-1, 5}}}, {"???!0", x{{'?', 1}, {'|', 2}, {INTCONST, 5}, {-1, 6}}}, {"???/\n2", x{{'?', 1}, {INTCONST, 6}, {-1, 7}}}, {"????!0", x{{'?', 1}, {'?', 2}, {'|', 3}, {INTCONST, 6}, {-1, 7}}}, {"???x0", x{{'?', 1}, {'?', 2}, {'?', 3}, {IDENTIFIER, 4}, {-1, 6}}}, {"???x??!0", x{{'?', 1}, {'?', 2}, {'?', 3}, {IDENTIFIER, 4}, {'|', 5}, {INTCONST, 8}, {-1, 9}}}, {"??x0", x{{'?', 1}, {'?', 2}, {IDENTIFIER, 3}, {-1, 5}}}, {"??x??!0", x{{'?', 1}, {'?', 2}, {IDENTIFIER, 3}, {'|', 4}, {INTCONST, 7}, {-1, 8}}}, {"?x0", x{{'?', 1}, {IDENTIFIER, 2}, {-1, 4}}}, {"?x??!0", x{{'?', 1}, {IDENTIFIER, 2}, {'|', 3}, {INTCONST, 6}, {-1, 7}}}, {"@", x{{'@', 1}, {-1, 2}}}, {"@%", x{{'@', 1}, {'%', 2}, {-1, 3}}}, {"@%0", x{{'@', 1}, {'%', 2}, {INTCONST, 3}, {-1, 4}}}, {"@%:", x{{'@', 1}, {'#', 2}, {-1, 4}}}, {"@%:0", x{{'@', 1}, {'#', 2}, {INTCONST, 4}, {-1, 5}}}, {"@%:01", x{{'@', 1}, {'#', 2}, {INTCONST, 4}, {-1, 6}}}, {"@??=", x{{'@', 1}, {'#', 2}, {-1, 5}}}, {"\"(a\\\nz", x{{'"', 1}, {'(', 2}, {IDENTIFIER, 3}, {-1, 7}}}, {"\\1\n", x{{'\\', 1}, {INTCONST, 2}, {'\n', 3}, {-1, 4}}}, {"\\1\n2", x{{'\\', 1}, {INTCONST, 2}, {'\n', 3}, {INTCONST, 4}, {-1, 5}}}, {"\\\n", x{{-1, 3}}}, {"\\\n2", x{{INTCONST, 3}, {-1, 4}}}, {"\\\r\n", x{{-1, 4}}}, {"\\\r\n2", x{{INTCONST, 4}, {-1, 5}}}, {"\r", x{{-1, 2}}}, {"\r0", x{{INTCONST, 2}, {-1, 3}}}, {"\r01", x{{INTCONST, 2}, {-1, 4}}}, {"\x00", x{{0, 1}, {-1, 2}}}, {"\x000", x{{0, 1}, {INTCONST, 2}, {-1, 3}}}, }, ) } func exampleAST(rule int, src string) interface{} { ctx, err := newContext(&Tweaks{ EnableAnonymousStructFields: true, EnableEmptyStructs: true, EnableOmitFuncDeclSpec: true, }) if err != nil { return fmt.Sprintf("TODO: %v", err) //TODOOK } ctx.exampleRule = rule src = strings.TrimSpace(src) r, n := utf8.DecodeRuneInString(src) src = src[n:] l, err := newLexer(ctx, fmt.Sprintf("example%v.c", rule), len(src), strings.NewReader(src)) if err != nil { return fmt.Sprintf("TODO: %v", err) //TODOOK } l.unget(cppToken{Token: xc.Token{Char: lex.Char{Rune: r}}}) yyParse(l) if err := ctx.error(); err != nil { return fmt.Sprintf("TODO: %v", err) //TODOOK } if ctx.exampleAST == nil { return "TODO: nil" //TODOOK } return ctx.exampleAST } func testCPPParseSource(ctx *context, src Source) (*cpp, tokenReader, error) { if ctx == nil { var err error if ctx, err = newContext(&Tweaks{}); err != nil { return nil, nil, err } } c := newCPP(ctx) r, err := c.parse(src) if err != nil { return nil, nil, err } return c, r, nil } func testCPPParseFile(ctx *context, nm string) (*cpp, tokenReader, error) { return testCPPParseSource(ctx, MustFileSource(nm)) } func testCPPParseString(ctx *context, name, src string) (*cpp, tokenReader, error) { return testCPPParseSource(ctx, NewStringSource(name, src)) } func TestCPPParse0(t *testing.T) { ctx, err := newContext(&Tweaks{}) if err != nil { t.Fatal(err) } for i, v := range []string{ "", "\n", "foo\n", `#if 1 #endif `, `#if 1 # /* foo */ #endif `, } { if _, _, err := testCPPParseString(ctx, "test", v); err != nil { t.Error(i, err) } } } func TestCPPExpand(t *testing.T) { var re *regexp.Regexp if s := *oRE; s != "" { re = regexp.MustCompile(s) } model, err := NewModel() if err != nil { t.Fatal(err) } if err := filepath.Walk(filepath.FromSlash("testdata/cpp-expand/"), func(path string, info os.FileInfo, err error) error { if err != nil { return err } if info.IsDir() || (!strings.HasSuffix(path, ".c") && !strings.HasSuffix(path, ".h")) { return nil } if re != nil && !re.MatchString(path) { return nil } t.Log(path) ctx, err := newContext(&Tweaks{ cppExpandTest: true, }) if err != nil { t.Fatal(err) } ctx.model = model b, err := ioutil.ReadFile(path) if err != nil { t.Fatal(err) } c, r, err := testCPPParseFile(ctx, path) if err != nil { t.Fatal(ErrString(err)) } var tb tokenBuffer if err := c.eval(r, &tb); err != nil { t.Fatal(ErrString(err)) } switch { case strings.Contains(filepath.ToSlash(path), "/mustfail/"): err := c.error() if err != nil { t.Logf(ErrString(err)) return nil } t.Fatalf("unexpected success: %s", path) default: if err := c.error(); err != nil { t.Fatal(ErrString(err)) } } var a []string for { t := tb.read() if t.Rune == ccEOF { break } a = append(a, TokSrc(t.Token)) } s := strings.Join(a, "") exp, err := ioutil.ReadFile(path + ".expect") if err != nil { t.Fatal(err) } if g, e := s, string(exp); g != e { t.Errorf("\n---- src %s\n%s---- got\n%s---- exp %s\n%s", path, b, g, path+".expect", e) } return nil }); err != nil { t.Fatal(err) } } func (b *tokenBuffer) WriteTo(fset *token.FileSet, w io.Writer) { var lpos token.Position for { t := b.read() if t.Rune == ccEOF { return } pos := fset.Position(t.Pos()) if pos.Filename != lpos.Filename { fmt.Fprintf(w, "# %d %v\n", pos.Line, pos.Filename) } lpos = pos w.Write([]byte(TokSrc(t.Token))) } } func (b *tokenBuffer) Bytes(fset *token.FileSet) []byte { var buf bytes.Buffer b.WriteTo(fset, &buf) return buf.Bytes() } func TestPreprocessSQLite(t *testing.T) { model, err := NewModel() if err != nil { t.Fatal(err) } ctx, err := newContext(&Tweaks{}) if err != nil { t.Fatal(err) } ctx.model = model cpp := newCPP(ctx) cpp.includePaths = []string{"@"} cpp.sysIncludePaths = searchPaths r, err := cpp.parse(MustBuiltin(), MustFileSource(sqlite3c)) if err != nil { t.Fatalf("%v: %v", sqlite3c, err) } var w tokenBuffer if err := cpp.eval(r, &w); err != nil { t.Fatalf("%v: %v", sqlite3c, ErrString(err)) } if err := cpp.error(); err != nil { t.Fatalf("%v: %v", sqlite3c, ErrString(err)) } if n := len(cpp.lx.ungetBuffer); n != 0 { t.Fatal(n) } } func TestParseSQLite(t *testing.T) { model, err := NewModel() if err != nil { t.Fatal(err) } ctx, err := newContext(&Tweaks{ EnableAnonymousStructFields: true, EnableEmptyStructs: true, }) if err != nil { t.Fatal(err) } ctx.model = model ctx.includePaths = []string{"@"} ctx.sysIncludePaths = searchPaths if _, err := ctx.parse([]Source{MustBuiltin(), MustFileSource(sqlite3c)}); err != nil { dbg("%T %v", err, PrettyString(err)) t.Fatalf("%v", ErrString(err)) } } func TestFunc(t *testing.T) { model, err := NewModel() if err != nil { t.Fatal(err) } ctx, err := newContext(&Tweaks{InjectFinalNL: true}) if err != nil { t.Fatal(err) } ctx.model = model tu, err := ctx.parse( []Source{NewStringSource("testfunc.c", `int (*foo(char bar))(double baz){}`)}, ) if err != nil { t.Fatalf("%v", ErrString(err)) } if err := tu.ExternalDeclarationList.check(ctx); err != nil { t.Fatal(err) } if err := ctx.error(); err != nil { t.Fatal(err) } fileScope := ctx.scope n := fileScope.LookupIdent(dict.SID("foo")) d, ok := n.(*Declarator) if !ok { t.Fatalf("%T", n) } fd := d if g, e := d.Type.String(), "function (char) returning pointer to function (double) returning int"; g != e { t.Fatalf("got %q\nexp %q", g, e) } if g, e := fmt.Sprint(d.Type.(*FunctionType).Params), "[char]"; g != e { t.Fatalf("got %q\nexp %q", g, e) } fnScope := tu.ExternalDeclarationList.ExternalDeclaration.FunctionDefinition.FunctionBody.CompoundStmt.scope n = fnScope.LookupIdent(dict.SID("bar")) if d, ok = n.(*Declarator); !ok { t.Fatalf("%T", n) } if g, e := fmt.Sprint(d.Type), "char"; g != e { t.Fatalf("got %q\nexp %q", g, e) } names := fd.ParameterNames() if g, e := len(names), 1; g != e { t.Fatal(g, e) } if g, e := names[0], dict.SID("bar"); g != e { t.Fatal(g, e) } params := fd.Parameters if g, e := len(params), 1; g != e { t.Fatal(g, e) } if g, e := params[0].Name(), dict.SID("bar"); g != e { t.Fatal(g, e) } } func TestTypecheckSQLite(t *testing.T) { if _, err := Translate( &Tweaks{ EnableAnonymousStructFields: true, EnableEmptyStructs: true, }, []string{"@"}, searchPaths, MustBuiltin(), MustFileSource(sqlite3c), ); err != nil { t.Fatal(err) } } func TestTypecheckSQLiteShell(t *testing.T) { if _, err := Translate( &Tweaks{ EnableAnonymousStructFields: true, EnableEmptyStructs: true, }, []string{"@"}, searchPaths, MustBuiltin(), MustCrt0(), MustFileSource(shellc), ); err != nil { t.Fatal(err) } } func TestTypecheckTCCTests(t *testing.T) { blacklist := map[string]struct{}{ "34_array_assignment.c": {}, // gcc: main.c:16:6: error: incompatible types when assigning to type ‘int[4]’ from type ‘int *’ "46_grep.c": {}, // gcc: 46_grep.c:489:12: error: ‘documentation’ undeclared (first use in this function) } m, err := filepath.Glob("testdata/tcc-0.9.26/tests/tests2/*.c") if err != nil { t.Fatal(err) } for _, pth := range m { if _, ok := blacklist[filepath.Base(pth)]; ok { continue } if _, err := Translate( &Tweaks{ EnableBinaryLiterals: true, EnableEmptyStructs: true, EnableImplicitDeclarations: true, EnableReturnExprInVoidFunc: true, EnableAnonymousStructFields: true, }, []string{"@"}, searchPaths, MustBuiltin(), MustCrt0(), MustFileSource(pth), ); err != nil { t.Fatal(ErrString(err)) } } } ================================================ FILE: v2/ast.go ================================================ // Code generated by yy. DO NOT EDIT. // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "fmt" "github.com/cznic/xc" "go/token" ) // AbstractDeclaratorCase represents case numbers of production AbstractDeclarator type AbstractDeclaratorCase int // Values of type AbstractDeclaratorCase const ( AbstractDeclaratorPointer AbstractDeclaratorCase = iota AbstractDeclaratorAbstract ) // String implements fmt.Stringer func (n AbstractDeclaratorCase) String() string { switch n { case AbstractDeclaratorPointer: return "AbstractDeclaratorPointer" case AbstractDeclaratorAbstract: return "AbstractDeclaratorAbstract" default: return fmt.Sprintf("AbstractDeclaratorCase(%v)", int(n)) } } // AbstractDeclarator represents data reduced by productions: // // AbstractDeclarator: // Pointer // Case AbstractDeclaratorPointer // | PointerOpt DirectAbstractDeclarator // Case AbstractDeclaratorAbstract type AbstractDeclarator struct { DeclarationSpecifier *DeclarationSpecifier Type Type TypeQualifiers []*TypeQualifier // From the PointerOpt production, if any. Case AbstractDeclaratorCase DirectAbstractDeclarator *DirectAbstractDeclarator Pointer *Pointer PointerOpt *PointerOpt } func (n *AbstractDeclarator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *AbstractDeclarator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *AbstractDeclarator) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Pointer.Pos() case 1: if p := n.PointerOpt.Pos(); p != 0 { return p } return n.DirectAbstractDeclarator.Pos() default: panic("internal error") } } // AbstractDeclaratorOpt represents data reduced by productions: // // AbstractDeclaratorOpt: // /* empty */ // Case 0 // | AbstractDeclarator // Case 1 type AbstractDeclaratorOpt struct { AbstractDeclarator *AbstractDeclarator } func (n *AbstractDeclaratorOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *AbstractDeclaratorOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *AbstractDeclaratorOpt) Pos() token.Pos { if n == nil { return 0 } return n.AbstractDeclarator.Pos() } // ArgumentExprList represents data reduced by productions: // // ArgumentExprList: // Expr // Case 0 // | ArgumentExprList ',' Expr // Case 1 type ArgumentExprList struct { ArgumentExprList *ArgumentExprList Case int Expr *Expr Token xc.Token } func (n *ArgumentExprList) reverse() *ArgumentExprList { if n == nil { return nil } na := n nb := na.ArgumentExprList for nb != nil { nc := nb.ArgumentExprList nb.ArgumentExprList = na na = nb nb = nc } n.ArgumentExprList = nil return na } func (n *ArgumentExprList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *ArgumentExprList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ArgumentExprList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 1: return n.ArgumentExprList.Pos() case 0: return n.Expr.Pos() default: panic("internal error") } } // ArgumentExprListOpt represents data reduced by productions: // // ArgumentExprListOpt: // /* empty */ // Case 0 // | ArgumentExprList // Case 1 type ArgumentExprListOpt struct { ArgumentExprList *ArgumentExprList } func (n *ArgumentExprListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ArgumentExprListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ArgumentExprListOpt) Pos() token.Pos { if n == nil { return 0 } return n.ArgumentExprList.Pos() } // BlockItemCase represents case numbers of production BlockItem type BlockItemCase int // Values of type BlockItemCase const ( BlockItemDecl BlockItemCase = iota BlockItemStmt ) // String implements fmt.Stringer func (n BlockItemCase) String() string { switch n { case BlockItemDecl: return "BlockItemDecl" case BlockItemStmt: return "BlockItemStmt" default: return fmt.Sprintf("BlockItemCase(%v)", int(n)) } } // BlockItem represents data reduced by productions: // // BlockItem: // Declaration // Case BlockItemDecl // | Stmt // Case BlockItemStmt type BlockItem struct { Case BlockItemCase Declaration *Declaration Stmt *Stmt } func (n *BlockItem) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *BlockItem) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *BlockItem) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Declaration.Pos() case 1: return n.Stmt.Pos() default: panic("internal error") } } // BlockItemList represents data reduced by productions: // // BlockItemList: // BlockItem // Case 0 // | BlockItemList BlockItem // Case 1 type BlockItemList struct { BlockItem *BlockItem BlockItemList *BlockItemList Case int } func (n *BlockItemList) reverse() *BlockItemList { if n == nil { return nil } na := n nb := na.BlockItemList for nb != nil { nc := nb.BlockItemList nb.BlockItemList = na na = nb nb = nc } n.BlockItemList = nil return na } func (n *BlockItemList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *BlockItemList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *BlockItemList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.BlockItem.Pos() case 1: return n.BlockItemList.Pos() default: panic("internal error") } } // BlockItemListOpt represents data reduced by productions: // // BlockItemListOpt: // /* empty */ // Case 0 // | BlockItemList // Case 1 type BlockItemListOpt struct { BlockItemList *BlockItemList } func (n *BlockItemListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *BlockItemListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *BlockItemListOpt) Pos() token.Pos { if n == nil { return 0 } return n.BlockItemList.Pos() } // CommaOpt represents data reduced by productions: // // CommaOpt: // /* empty */ // Case 0 // | ',' // Case 1 type CommaOpt struct { Token xc.Token } func (n *CommaOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *CommaOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *CommaOpt) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // CompoundStmt represents data reduced by production: // // CompoundStmt: // '{' BlockItemListOpt '}' // Case 0 type CompoundStmt struct { scope *Scope BlockItemListOpt *BlockItemListOpt Token xc.Token Token2 xc.Token } func (n *CompoundStmt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *CompoundStmt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *CompoundStmt) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // ConstExpr represents data reduced by production: // // ConstExpr: // Expr // Case 0 type ConstExpr struct { Operand Operand Expr *Expr } func (n *ConstExpr) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ConstExpr) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ConstExpr) Pos() token.Pos { if n == nil { return 0 } return n.Expr.Pos() } // Declaration represents data reduced by production: // // Declaration: // DeclarationSpecifiers InitDeclaratorListOpt ';' // Case 0 type Declaration struct { Attributes [][]xc.Token Scope *Scope DeclarationSpecifiers *DeclarationSpecifiers InitDeclaratorListOpt *InitDeclaratorListOpt Token xc.Token } func (n *Declaration) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Declaration) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Declaration) Pos() token.Pos { if n == nil { return 0 } return n.DeclarationSpecifiers.Pos() } // DeclarationList represents data reduced by productions: // // DeclarationList: // Declaration // Case 0 // | DeclarationList Declaration // Case 1 type DeclarationList struct { Case int Declaration *Declaration DeclarationList *DeclarationList } func (n *DeclarationList) reverse() *DeclarationList { if n == nil { return nil } na := n nb := na.DeclarationList for nb != nil { nc := nb.DeclarationList nb.DeclarationList = na na = nb nb = nc } n.DeclarationList = nil return na } func (n *DeclarationList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *DeclarationList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DeclarationList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Declaration.Pos() case 1: return n.DeclarationList.Pos() default: panic("internal error") } } // DeclarationListOpt represents data reduced by productions: // // DeclarationListOpt: // /* empty */ // Case 0 // | DeclarationList // Case 1 type DeclarationListOpt struct { DeclarationList *DeclarationList } func (n *DeclarationListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DeclarationListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DeclarationListOpt) Pos() token.Pos { if n == nil { return 0 } return n.DeclarationList.Pos() } // DeclarationSpecifiersCase represents case numbers of production DeclarationSpecifiers type DeclarationSpecifiersCase int // Values of type DeclarationSpecifiersCase const ( DeclarationSpecifiersFunc DeclarationSpecifiersCase = iota DeclarationSpecifiersStorage DeclarationSpecifiersQualifier DeclarationSpecifiersSpecifier ) // String implements fmt.Stringer func (n DeclarationSpecifiersCase) String() string { switch n { case DeclarationSpecifiersFunc: return "DeclarationSpecifiersFunc" case DeclarationSpecifiersStorage: return "DeclarationSpecifiersStorage" case DeclarationSpecifiersQualifier: return "DeclarationSpecifiersQualifier" case DeclarationSpecifiersSpecifier: return "DeclarationSpecifiersSpecifier" default: return fmt.Sprintf("DeclarationSpecifiersCase(%v)", int(n)) } } // DeclarationSpecifiers represents data reduced by productions: // // DeclarationSpecifiers: // FunctionSpecifier DeclarationSpecifiersOpt // Case DeclarationSpecifiersFunc // | StorageClassSpecifier DeclarationSpecifiersOpt // Case DeclarationSpecifiersStorage // | TypeQualifier DeclarationSpecifiersOpt // Case DeclarationSpecifiersQualifier // | TypeSpecifier DeclarationSpecifiersOpt // Case DeclarationSpecifiersSpecifier type DeclarationSpecifiers struct { Case DeclarationSpecifiersCase DeclarationSpecifiersOpt *DeclarationSpecifiersOpt FunctionSpecifier *FunctionSpecifier StorageClassSpecifier *StorageClassSpecifier TypeQualifier *TypeQualifier TypeSpecifier *TypeSpecifier } func (n *DeclarationSpecifiers) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DeclarationSpecifiers) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DeclarationSpecifiers) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.FunctionSpecifier.Pos() case 1: return n.StorageClassSpecifier.Pos() case 2: return n.TypeQualifier.Pos() case 3: return n.TypeSpecifier.Pos() default: panic("internal error") } } // DeclarationSpecifiersOpt represents data reduced by productions: // // DeclarationSpecifiersOpt: // /* empty */ // Case 0 // | DeclarationSpecifiers // Case 1 type DeclarationSpecifiersOpt struct { DeclarationSpecifiers *DeclarationSpecifiers } func (n *DeclarationSpecifiersOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DeclarationSpecifiersOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DeclarationSpecifiersOpt) Pos() token.Pos { if n == nil { return 0 } return n.DeclarationSpecifiers.Pos() } // Declarator represents data reduced by production: // // Declarator: // PointerOpt DirectDeclarator // Case 0 type Declarator struct { AssignedTo int // Declarator appears at the left side of assignment. Attributes [][]xc.Token Bits int // StructDeclarator: bit width when a bit field. DeclarationSpecifier *DeclarationSpecifier // Nil for embedded declarators. Definition *Declarator // Declaration -> definition. Field int // Declaration order# if struct field declarator. FunctionDefinition *FunctionDefinition // When the declarator defines a function. Initializer *Initializer // Only when part of an InitDeclarator. Linkage Linkage // Linkage of the declared name, [0]6.2.2. Parameters []*Declarator // Of the function declarator. Referenced int Scope *Scope // Declaration scope. ScopeNum int // Sequential scope number within function body. StorageDuration StorageDuration // Storage duration of the declared name, [0]6.2.4. Type Type // Declared type. TypeQualifiers []*TypeQualifier // From the PointerOpt production, if any. unnamed int vars []*Declarator // Function declarator only. AddressTaken bool Alloca bool // Function declarator: Body calls __builtin_alloca Embedded bool // [0]6.7.5-3: Not a full declarator. IsField bool IsFunctionParameter bool IsBuiltin bool DirectDeclarator *DirectDeclarator PointerOpt *PointerOpt } func (n *Declarator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Declarator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Declarator) Pos() token.Pos { if n == nil { return 0 } if p := n.PointerOpt.Pos(); p != 0 { return p } return n.DirectDeclarator.Pos() } // DeclaratorOpt represents data reduced by productions: // // DeclaratorOpt: // /* empty */ // Case 0 // | Declarator // Case 1 type DeclaratorOpt struct { Declarator *Declarator } func (n *DeclaratorOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DeclaratorOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DeclaratorOpt) Pos() token.Pos { if n == nil { return 0 } return n.Declarator.Pos() } // Designation represents data reduced by production: // // Designation: // DesignatorList '=' // Case 0 type Designation struct { List []int64 DesignatorList *DesignatorList Token xc.Token } func (n *Designation) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Designation) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Designation) Pos() token.Pos { if n == nil { return 0 } return n.DesignatorList.Pos() } // DesignatorCase represents case numbers of production Designator type DesignatorCase int // Values of type DesignatorCase const ( DesignatorField DesignatorCase = iota DesignatorIndex ) // String implements fmt.Stringer func (n DesignatorCase) String() string { switch n { case DesignatorField: return "DesignatorField" case DesignatorIndex: return "DesignatorIndex" default: return fmt.Sprintf("DesignatorCase(%v)", int(n)) } } // Designator represents data reduced by productions: // // Designator: // '.' IDENTIFIER // Case DesignatorField // | '[' ConstExpr ']' // Case DesignatorIndex type Designator struct { Case DesignatorCase ConstExpr *ConstExpr Token xc.Token Token2 xc.Token } func (n *Designator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Designator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Designator) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // DesignatorList represents data reduced by productions: // // DesignatorList: // Designator // Case 0 // | DesignatorList Designator // Case 1 type DesignatorList struct { Case int Designator *Designator DesignatorList *DesignatorList } func (n *DesignatorList) reverse() *DesignatorList { if n == nil { return nil } na := n nb := na.DesignatorList for nb != nil { nc := nb.DesignatorList nb.DesignatorList = na na = nb nb = nc } n.DesignatorList = nil return na } func (n *DesignatorList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *DesignatorList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DesignatorList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Designator.Pos() case 1: return n.DesignatorList.Pos() default: panic("internal error") } } // DirectAbstractDeclaratorCase represents case numbers of production DirectAbstractDeclarator type DirectAbstractDeclaratorCase int // Values of type DirectAbstractDeclaratorCase const ( DirectAbstractDeclaratorAbstract DirectAbstractDeclaratorCase = iota DirectAbstractDeclaratorParamList DirectAbstractDeclaratorDFn DirectAbstractDeclaratorDArrSize DirectAbstractDeclaratorDArrVL DirectAbstractDeclaratorDArr DirectAbstractDeclaratorDArrSize2 DirectAbstractDeclaratorDArr2 ) // String implements fmt.Stringer func (n DirectAbstractDeclaratorCase) String() string { switch n { case DirectAbstractDeclaratorAbstract: return "DirectAbstractDeclaratorAbstract" case DirectAbstractDeclaratorParamList: return "DirectAbstractDeclaratorParamList" case DirectAbstractDeclaratorDFn: return "DirectAbstractDeclaratorDFn" case DirectAbstractDeclaratorDArrSize: return "DirectAbstractDeclaratorDArrSize" case DirectAbstractDeclaratorDArrVL: return "DirectAbstractDeclaratorDArrVL" case DirectAbstractDeclaratorDArr: return "DirectAbstractDeclaratorDArr" case DirectAbstractDeclaratorDArrSize2: return "DirectAbstractDeclaratorDArrSize2" case DirectAbstractDeclaratorDArr2: return "DirectAbstractDeclaratorDArr2" default: return fmt.Sprintf("DirectAbstractDeclaratorCase(%v)", int(n)) } } // DirectAbstractDeclarator represents data reduced by productions: // // DirectAbstractDeclarator: // '(' AbstractDeclarator ')' // Case DirectAbstractDeclaratorAbstract // | '(' ParameterTypeListOpt ')' // Case DirectAbstractDeclaratorParamList // | DirectAbstractDeclarator '(' ParameterTypeListOpt ')' // Case DirectAbstractDeclaratorDFn // | DirectAbstractDeclaratorOpt '[' "static" TypeQualifierListOpt Expr ']' // Case DirectAbstractDeclaratorDArrSize // | DirectAbstractDeclaratorOpt '[' '*' ']' // Case DirectAbstractDeclaratorDArrVL // | DirectAbstractDeclaratorOpt '[' ExprOpt ']' // Case DirectAbstractDeclaratorDArr // | DirectAbstractDeclaratorOpt '[' TypeQualifierList "static" Expr ']' // Case DirectAbstractDeclaratorDArrSize2 // | DirectAbstractDeclaratorOpt '[' TypeQualifierList ExprOpt ']' // Case DirectAbstractDeclaratorDArr2 type DirectAbstractDeclarator struct { AbstractDeclarator *AbstractDeclarator Case DirectAbstractDeclaratorCase DirectAbstractDeclarator *DirectAbstractDeclarator DirectAbstractDeclaratorOpt *DirectAbstractDeclaratorOpt Expr *Expr ExprOpt *ExprOpt ParameterTypeListOpt *ParameterTypeListOpt Token xc.Token Token2 xc.Token Token3 xc.Token TypeQualifierList *TypeQualifierList TypeQualifierListOpt *TypeQualifierListOpt } func (n *DirectAbstractDeclarator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DirectAbstractDeclarator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DirectAbstractDeclarator) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 2: return n.DirectAbstractDeclarator.Pos() case 3, 4, 5, 6, 7: if p := n.DirectAbstractDeclaratorOpt.Pos(); p != 0 { return p } return n.Token.Pos() case 0, 1: return n.Token.Pos() default: panic("internal error") } } // DirectAbstractDeclaratorOpt represents data reduced by productions: // // DirectAbstractDeclaratorOpt: // /* empty */ // Case 0 // | DirectAbstractDeclarator // Case 1 type DirectAbstractDeclaratorOpt struct { DirectAbstractDeclarator *DirectAbstractDeclarator } func (n *DirectAbstractDeclaratorOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DirectAbstractDeclaratorOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DirectAbstractDeclaratorOpt) Pos() token.Pos { if n == nil { return 0 } return n.DirectAbstractDeclarator.Pos() } // DirectDeclaratorCase represents case numbers of production DirectDeclarator type DirectDeclaratorCase int // Values of type DirectDeclaratorCase const ( DirectDeclaratorParen DirectDeclaratorCase = iota DirectDeclaratorIdentList DirectDeclaratorParamList DirectDeclaratorArraySize DirectDeclaratorArraySize2 DirectDeclaratorArrayVar DirectDeclaratorArray DirectDeclaratorIdent ) // String implements fmt.Stringer func (n DirectDeclaratorCase) String() string { switch n { case DirectDeclaratorParen: return "DirectDeclaratorParen" case DirectDeclaratorIdentList: return "DirectDeclaratorIdentList" case DirectDeclaratorParamList: return "DirectDeclaratorParamList" case DirectDeclaratorArraySize: return "DirectDeclaratorArraySize" case DirectDeclaratorArraySize2: return "DirectDeclaratorArraySize2" case DirectDeclaratorArrayVar: return "DirectDeclaratorArrayVar" case DirectDeclaratorArray: return "DirectDeclaratorArray" case DirectDeclaratorIdent: return "DirectDeclaratorIdent" default: return fmt.Sprintf("DirectDeclaratorCase(%v)", int(n)) } } // DirectDeclarator represents data reduced by productions: // // DirectDeclarator: // '(' Declarator ')' // Case DirectDeclaratorParen // | DirectDeclarator '(' IdentifierListOpt ')' // Case DirectDeclaratorIdentList // | DirectDeclarator '(' ParameterTypeList ')' // Case DirectDeclaratorParamList // | DirectDeclarator '[' "static" TypeQualifierListOpt Expr ']' // Case DirectDeclaratorArraySize // | DirectDeclarator '[' TypeQualifierList "static" Expr ']' // Case DirectDeclaratorArraySize2 // | DirectDeclarator '[' TypeQualifierListOpt '*' ']' // Case DirectDeclaratorArrayVar // | DirectDeclarator '[' TypeQualifierListOpt ExprOpt ']' // Case DirectDeclaratorArray // | IDENTIFIER // Case DirectDeclaratorIdent type DirectDeclarator struct { paramScope *Scope Case DirectDeclaratorCase Declarator *Declarator DirectDeclarator *DirectDeclarator Expr *Expr ExprOpt *ExprOpt IdentifierListOpt *IdentifierListOpt ParameterTypeList *ParameterTypeList Token xc.Token Token2 xc.Token Token3 xc.Token TypeQualifierList *TypeQualifierList TypeQualifierListOpt *TypeQualifierListOpt } func (n *DirectDeclarator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *DirectDeclarator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *DirectDeclarator) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 1, 2, 3, 4, 5, 6: return n.DirectDeclarator.Pos() case 0, 7: return n.Token.Pos() default: panic("internal error") } } // EnumSpecifierCase represents case numbers of production EnumSpecifier type EnumSpecifierCase int // Values of type EnumSpecifierCase const ( EnumSpecifierTag EnumSpecifierCase = iota EnumSpecifierDefine ) // String implements fmt.Stringer func (n EnumSpecifierCase) String() string { switch n { case EnumSpecifierTag: return "EnumSpecifierTag" case EnumSpecifierDefine: return "EnumSpecifierDefine" default: return fmt.Sprintf("EnumSpecifierCase(%v)", int(n)) } } // EnumSpecifier represents data reduced by productions: // // EnumSpecifier: // "enum" IDENTIFIER // Case EnumSpecifierTag // | "enum" IdentifierOpt '{' EnumeratorList CommaOpt '}' // Case EnumSpecifierDefine type EnumSpecifier struct { Tag int scope *Scope // Where to declare enumeration constants. typ Type Case EnumSpecifierCase CommaOpt *CommaOpt EnumeratorList *EnumeratorList IdentifierOpt *IdentifierOpt Token xc.Token Token2 xc.Token Token3 xc.Token } func (n *EnumSpecifier) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *EnumSpecifier) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *EnumSpecifier) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // EnumerationConstant represents data reduced by production: // // EnumerationConstant: // IDENTIFIER // Case 0 type EnumerationConstant struct { Operand Operand Token xc.Token } func (n *EnumerationConstant) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *EnumerationConstant) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *EnumerationConstant) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // EnumeratorCase represents case numbers of production Enumerator type EnumeratorCase int // Values of type EnumeratorCase const ( EnumeratorBase EnumeratorCase = iota EnumeratorInit ) // String implements fmt.Stringer func (n EnumeratorCase) String() string { switch n { case EnumeratorBase: return "EnumeratorBase" case EnumeratorInit: return "EnumeratorInit" default: return fmt.Sprintf("EnumeratorCase(%v)", int(n)) } } // Enumerator represents data reduced by productions: // // Enumerator: // EnumerationConstant // Case EnumeratorBase // | EnumerationConstant '=' ConstExpr // Case EnumeratorInit type Enumerator struct { Case EnumeratorCase ConstExpr *ConstExpr EnumerationConstant *EnumerationConstant Token xc.Token } func (n *Enumerator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Enumerator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Enumerator) Pos() token.Pos { if n == nil { return 0 } return n.EnumerationConstant.Pos() } // EnumeratorList represents data reduced by productions: // // EnumeratorList: // Enumerator // Case 0 // | EnumeratorList ',' Enumerator // Case 1 type EnumeratorList struct { Case int Enumerator *Enumerator EnumeratorList *EnumeratorList Token xc.Token } func (n *EnumeratorList) reverse() *EnumeratorList { if n == nil { return nil } na := n nb := na.EnumeratorList for nb != nil { nc := nb.EnumeratorList nb.EnumeratorList = na na = nb nb = nc } n.EnumeratorList = nil return na } func (n *EnumeratorList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *EnumeratorList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *EnumeratorList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Enumerator.Pos() case 1: return n.EnumeratorList.Pos() default: panic("internal error") } } // ExprCase represents case numbers of production Expr type ExprCase int // Values of type ExprCase const ( ExprPreInc ExprCase = iota ExprPreDec ExprAlignofType ExprAlignofExpr ExprSizeofType ExprSizeofExpr ExprNot ExprAddrof ExprStatement ExprPExprList ExprCompLit ExprCast ExprDeref ExprUnaryPlus ExprUnaryMinus ExprCpl ExprChar ExprNe ExprModAssign ExprLAnd ExprAndAssign ExprMulAssign ExprPostInc ExprAddAssign ExprPostDec ExprSubAssign ExprPSelect ExprDivAssign ExprLsh ExprLshAssign ExprLe ExprEq ExprGe ExprRsh ExprRshAssign ExprXorAssign ExprOrAssign ExprLOr ExprMod ExprAnd ExprCall ExprMul ExprAdd ExprSub ExprSelect ExprDiv ExprLt ExprAssign ExprGt ExprCond ExprIndex ExprXor ExprOr ExprFloat ExprIdent ExprInt ExprLChar ExprLString ExprString ) // String implements fmt.Stringer func (n ExprCase) String() string { switch n { case ExprPreInc: return "ExprPreInc" case ExprPreDec: return "ExprPreDec" case ExprAlignofType: return "ExprAlignofType" case ExprAlignofExpr: return "ExprAlignofExpr" case ExprSizeofType: return "ExprSizeofType" case ExprSizeofExpr: return "ExprSizeofExpr" case ExprNot: return "ExprNot" case ExprAddrof: return "ExprAddrof" case ExprStatement: return "ExprStatement" case ExprPExprList: return "ExprPExprList" case ExprCompLit: return "ExprCompLit" case ExprCast: return "ExprCast" case ExprDeref: return "ExprDeref" case ExprUnaryPlus: return "ExprUnaryPlus" case ExprUnaryMinus: return "ExprUnaryMinus" case ExprCpl: return "ExprCpl" case ExprChar: return "ExprChar" case ExprNe: return "ExprNe" case ExprModAssign: return "ExprModAssign" case ExprLAnd: return "ExprLAnd" case ExprAndAssign: return "ExprAndAssign" case ExprMulAssign: return "ExprMulAssign" case ExprPostInc: return "ExprPostInc" case ExprAddAssign: return "ExprAddAssign" case ExprPostDec: return "ExprPostDec" case ExprSubAssign: return "ExprSubAssign" case ExprPSelect: return "ExprPSelect" case ExprDivAssign: return "ExprDivAssign" case ExprLsh: return "ExprLsh" case ExprLshAssign: return "ExprLshAssign" case ExprLe: return "ExprLe" case ExprEq: return "ExprEq" case ExprGe: return "ExprGe" case ExprRsh: return "ExprRsh" case ExprRshAssign: return "ExprRshAssign" case ExprXorAssign: return "ExprXorAssign" case ExprOrAssign: return "ExprOrAssign" case ExprLOr: return "ExprLOr" case ExprMod: return "ExprMod" case ExprAnd: return "ExprAnd" case ExprCall: return "ExprCall" case ExprMul: return "ExprMul" case ExprAdd: return "ExprAdd" case ExprSub: return "ExprSub" case ExprSelect: return "ExprSelect" case ExprDiv: return "ExprDiv" case ExprLt: return "ExprLt" case ExprAssign: return "ExprAssign" case ExprGt: return "ExprGt" case ExprCond: return "ExprCond" case ExprIndex: return "ExprIndex" case ExprXor: return "ExprXor" case ExprOr: return "ExprOr" case ExprFloat: return "ExprFloat" case ExprIdent: return "ExprIdent" case ExprInt: return "ExprInt" case ExprLChar: return "ExprLChar" case ExprLString: return "ExprLString" case ExprString: return "ExprString" default: return fmt.Sprintf("ExprCase(%v)", int(n)) } } // Expr represents data reduced by productions: // // Expr: // "++" Expr // Case ExprPreInc // | "--" Expr // Case ExprPreDec // | "__alignof__" '(' TypeName ')' // Case ExprAlignofType // | "__alignof__" Expr // Case ExprAlignofExpr // | "sizeof" '(' TypeName ')' // Case ExprSizeofType // | "sizeof" Expr // Case ExprSizeofExpr // | '!' Expr // Case ExprNot // | '&' Expr // Case ExprAddrof // | '(' CompoundStmt ')' // Case ExprStatement // | '(' ExprList ')' // Case ExprPExprList // | '(' TypeName ')' '{' InitializerList CommaOpt '}' // Case ExprCompLit // | '(' TypeName ')' Expr // Case ExprCast // | '*' Expr // Case ExprDeref // | '+' Expr // Case ExprUnaryPlus // | '-' Expr // Case ExprUnaryMinus // | '~' Expr // Case ExprCpl // | CHARCONST // Case ExprChar // | Expr "!=" Expr // Case ExprNe // | Expr "%=" Expr // Case ExprModAssign // | Expr "&&" Expr // Case ExprLAnd // | Expr "&=" Expr // Case ExprAndAssign // | Expr "*=" Expr // Case ExprMulAssign // | Expr "++" // Case ExprPostInc // | Expr "+=" Expr // Case ExprAddAssign // | Expr "--" // Case ExprPostDec // | Expr "-=" Expr // Case ExprSubAssign // | Expr "->" IDENTIFIER // Case ExprPSelect // | Expr "/=" Expr // Case ExprDivAssign // | Expr "<<" Expr // Case ExprLsh // | Expr "<<=" Expr // Case ExprLshAssign // | Expr "<=" Expr // Case ExprLe // | Expr "==" Expr // Case ExprEq // | Expr ">=" Expr // Case ExprGe // | Expr ">>" Expr // Case ExprRsh // | Expr ">>=" Expr // Case ExprRshAssign // | Expr "^=" Expr // Case ExprXorAssign // | Expr "|=" Expr // Case ExprOrAssign // | Expr "||" Expr // Case ExprLOr // | Expr '%' Expr // Case ExprMod // | Expr '&' Expr // Case ExprAnd // | Expr '(' ArgumentExprListOpt ')' // Case ExprCall // | Expr '*' Expr // Case ExprMul // | Expr '+' Expr // Case ExprAdd // | Expr '-' Expr // Case ExprSub // | Expr '.' IDENTIFIER // Case ExprSelect // | Expr '/' Expr // Case ExprDiv // | Expr '<' Expr // Case ExprLt // | Expr '=' Expr // Case ExprAssign // | Expr '>' Expr // Case ExprGt // | Expr '?' ExprList ':' Expr // Case ExprCond // | Expr '[' ExprList ']' // Case ExprIndex // | Expr '^' Expr // Case ExprXor // | Expr '|' Expr // Case ExprOr // | FLOATCONST // Case ExprFloat // | IDENTIFIER // Case ExprIdent // | INTCONST // Case ExprInt // | LONGCHARCONST // Case ExprLChar // | LONGSTRINGLITERAL // Case ExprLString // | STRINGLITERAL // Case ExprString type Expr struct { CallArgs []Operand // Promoted arguments of Call. Declarator *Declarator // Case Ident. Operand Operand Scope *Scope // Case Ident, CompLit. enum *EnumType AssignedTo bool // Expression appears at the left side of assignment. ArgumentExprListOpt *ArgumentExprListOpt Case ExprCase CommaOpt *CommaOpt CompoundStmt *CompoundStmt Expr *Expr Expr2 *Expr ExprList *ExprList InitializerList *InitializerList Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token TypeName *TypeName } func (n *Expr) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Expr) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Expr) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52: return n.Expr.Pos() case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 53, 54, 55, 56, 57, 58: return n.Token.Pos() default: panic("internal error") } } // ExprList represents data reduced by productions: // // ExprList: // Expr // Case 0 // | ExprList ',' Expr // Case 1 type ExprList struct { Operand Operand Case int Expr *Expr ExprList *ExprList Token xc.Token } func (n *ExprList) reverse() *ExprList { if n == nil { return nil } na := n nb := na.ExprList for nb != nil { nc := nb.ExprList nb.ExprList = na na = nb nb = nc } n.ExprList = nil return na } func (n *ExprList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *ExprList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ExprList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Expr.Pos() case 1: return n.ExprList.Pos() default: panic("internal error") } } // ExprListOpt represents data reduced by productions: // // ExprListOpt: // /* empty */ // Case 0 // | ExprList // Case 1 type ExprListOpt struct { ExprList *ExprList } func (n *ExprListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ExprListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ExprListOpt) Pos() token.Pos { if n == nil { return 0 } return n.ExprList.Pos() } // ExprOpt represents data reduced by productions: // // ExprOpt: // /* empty */ // Case 0 // | Expr // Case 1 type ExprOpt struct { Expr *Expr } func (n *ExprOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ExprOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ExprOpt) Pos() token.Pos { if n == nil { return 0 } return n.Expr.Pos() } // ExprStmt represents data reduced by production: // // ExprStmt: // ExprListOpt ';' // Case 0 type ExprStmt struct { ExprListOpt *ExprListOpt Token xc.Token } func (n *ExprStmt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ExprStmt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ExprStmt) Pos() token.Pos { if n == nil { return 0 } if p := n.ExprListOpt.Pos(); p != 0 { return p } return n.Token.Pos() } // ExternalDeclarationCase represents case numbers of production ExternalDeclaration type ExternalDeclarationCase int // Values of type ExternalDeclarationCase const ( ExternalDeclarationDecl ExternalDeclarationCase = iota ExternalDeclarationFunc ) // String implements fmt.Stringer func (n ExternalDeclarationCase) String() string { switch n { case ExternalDeclarationDecl: return "ExternalDeclarationDecl" case ExternalDeclarationFunc: return "ExternalDeclarationFunc" default: return fmt.Sprintf("ExternalDeclarationCase(%v)", int(n)) } } // ExternalDeclaration represents data reduced by productions: // // ExternalDeclaration: // Declaration // Case ExternalDeclarationDecl // | FunctionDefinition // Case ExternalDeclarationFunc type ExternalDeclaration struct { Case ExternalDeclarationCase Declaration *Declaration FunctionDefinition *FunctionDefinition } func (n *ExternalDeclaration) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ExternalDeclaration) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ExternalDeclaration) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Declaration.Pos() case 1: return n.FunctionDefinition.Pos() default: panic("internal error") } } // ExternalDeclarationList represents data reduced by productions: // // ExternalDeclarationList: // ExternalDeclaration // Case 0 // | ExternalDeclarationList ExternalDeclaration // Case 1 type ExternalDeclarationList struct { Case int ExternalDeclaration *ExternalDeclaration ExternalDeclarationList *ExternalDeclarationList } func (n *ExternalDeclarationList) reverse() *ExternalDeclarationList { if n == nil { return nil } na := n nb := na.ExternalDeclarationList for nb != nil { nc := nb.ExternalDeclarationList nb.ExternalDeclarationList = na na = nb nb = nc } n.ExternalDeclarationList = nil return na } func (n *ExternalDeclarationList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *ExternalDeclarationList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ExternalDeclarationList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.ExternalDeclaration.Pos() case 1: return n.ExternalDeclarationList.Pos() default: panic("internal error") } } // FunctionBody represents data reduced by production: // // FunctionBody: // CompoundStmt // Case 0 type FunctionBody struct { CompoundStmt *CompoundStmt } func (n *FunctionBody) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *FunctionBody) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *FunctionBody) Pos() token.Pos { if n == nil { return 0 } return n.CompoundStmt.Pos() } // FunctionDefinitionCase represents case numbers of production FunctionDefinition type FunctionDefinitionCase int // Values of type FunctionDefinitionCase const ( FunctionDefinitionSpec FunctionDefinitionCase = iota FunctionDefinitionInt ) // String implements fmt.Stringer func (n FunctionDefinitionCase) String() string { switch n { case FunctionDefinitionSpec: return "FunctionDefinitionSpec" case FunctionDefinitionInt: return "FunctionDefinitionInt" default: return fmt.Sprintf("FunctionDefinitionCase(%v)", int(n)) } } // FunctionDefinition represents data reduced by productions: // // FunctionDefinition: // DeclarationSpecifiers Declarator DeclarationListOpt FunctionBody // Case FunctionDefinitionSpec // | Declarator DeclarationListOpt FunctionBody // Case FunctionDefinitionInt type FunctionDefinition struct { Case FunctionDefinitionCase DeclarationListOpt *DeclarationListOpt DeclarationSpecifiers *DeclarationSpecifiers Declarator *Declarator FunctionBody *FunctionBody } func (n *FunctionDefinition) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *FunctionDefinition) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *FunctionDefinition) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.DeclarationSpecifiers.Pos() case 1: return n.Declarator.Pos() default: panic("internal error") } } // FunctionSpecifier represents data reduced by production: // // FunctionSpecifier: // "inline" // Case 0 type FunctionSpecifier struct { Token xc.Token } func (n *FunctionSpecifier) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *FunctionSpecifier) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *FunctionSpecifier) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // IdentifierList represents data reduced by productions: // // IdentifierList: // IDENTIFIER // Case 0 // | IdentifierList ',' IDENTIFIER // Case 1 type IdentifierList struct { Case int IdentifierList *IdentifierList Token xc.Token Token2 xc.Token } func (n *IdentifierList) reverse() *IdentifierList { if n == nil { return nil } na := n nb := na.IdentifierList for nb != nil { nc := nb.IdentifierList nb.IdentifierList = na na = nb nb = nc } n.IdentifierList = nil return na } func (n *IdentifierList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *IdentifierList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *IdentifierList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 1: return n.IdentifierList.Pos() case 0: return n.Token.Pos() default: panic("internal error") } } // IdentifierListOpt represents data reduced by productions: // // IdentifierListOpt: // /* empty */ // Case 0 // | IdentifierList // Case 1 type IdentifierListOpt struct { IdentifierList *IdentifierList } func (n *IdentifierListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *IdentifierListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *IdentifierListOpt) Pos() token.Pos { if n == nil { return 0 } return n.IdentifierList.Pos() } // IdentifierOpt represents data reduced by productions: // // IdentifierOpt: // /* empty */ // Case 0 // | IDENTIFIER // Case 1 type IdentifierOpt struct { Token xc.Token } func (n *IdentifierOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *IdentifierOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *IdentifierOpt) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // InitDeclaratorCase represents case numbers of production InitDeclarator type InitDeclaratorCase int // Values of type InitDeclaratorCase const ( InitDeclaratorBase InitDeclaratorCase = iota InitDeclaratorInit ) // String implements fmt.Stringer func (n InitDeclaratorCase) String() string { switch n { case InitDeclaratorBase: return "InitDeclaratorBase" case InitDeclaratorInit: return "InitDeclaratorInit" default: return fmt.Sprintf("InitDeclaratorCase(%v)", int(n)) } } // InitDeclarator represents data reduced by productions: // // InitDeclarator: // Declarator // Case InitDeclaratorBase // | Declarator '=' Initializer // Case InitDeclaratorInit type InitDeclarator struct { Case InitDeclaratorCase Declarator *Declarator Initializer *Initializer Token xc.Token } func (n *InitDeclarator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *InitDeclarator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *InitDeclarator) Pos() token.Pos { if n == nil { return 0 } return n.Declarator.Pos() } // InitDeclaratorList represents data reduced by productions: // // InitDeclaratorList: // InitDeclarator // Case 0 // | InitDeclaratorList ',' InitDeclarator // Case 1 type InitDeclaratorList struct { Case int InitDeclarator *InitDeclarator InitDeclaratorList *InitDeclaratorList Token xc.Token } func (n *InitDeclaratorList) reverse() *InitDeclaratorList { if n == nil { return nil } na := n nb := na.InitDeclaratorList for nb != nil { nc := nb.InitDeclaratorList nb.InitDeclaratorList = na na = nb nb = nc } n.InitDeclaratorList = nil return na } func (n *InitDeclaratorList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *InitDeclaratorList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *InitDeclaratorList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.InitDeclarator.Pos() case 1: return n.InitDeclaratorList.Pos() default: panic("internal error") } } // InitDeclaratorListOpt represents data reduced by productions: // // InitDeclaratorListOpt: // /* empty */ // Case 0 // | InitDeclaratorList // Case 1 type InitDeclaratorListOpt struct { InitDeclaratorList *InitDeclaratorList } func (n *InitDeclaratorListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *InitDeclaratorListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *InitDeclaratorListOpt) Pos() token.Pos { if n == nil { return 0 } return n.InitDeclaratorList.Pos() } // InitializerCase represents case numbers of production Initializer type InitializerCase int // Values of type InitializerCase const ( InitializerCompLit InitializerCase = iota InitializerExpr ) // String implements fmt.Stringer func (n InitializerCase) String() string { switch n { case InitializerCompLit: return "InitializerCompLit" case InitializerExpr: return "InitializerExpr" default: return fmt.Sprintf("InitializerCase(%v)", int(n)) } } // Initializer represents data reduced by productions: // // Initializer: // '{' InitializerList CommaOpt '}' // Case InitializerCompLit // | Expr // Case InitializerExpr type Initializer struct { Case InitializerCase CommaOpt *CommaOpt Expr *Expr InitializerList *InitializerList Token xc.Token Token2 xc.Token } func (n *Initializer) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Initializer) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Initializer) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 1: return n.Expr.Pos() case 0: return n.Token.Pos() default: panic("internal error") } } // InitializerList represents data reduced by productions: // // InitializerList: // /* empty */ // Case 0 // | Initializer // Case 1 // | Designation Initializer // Case 2 // | InitializerList ',' Initializer // Case 3 // | InitializerList ',' Designation Initializer // Case 4 type InitializerList struct { Operand Operand //TODO- Len int Case int Designation *Designation Initializer *Initializer InitializerList *InitializerList Token xc.Token } func (n *InitializerList) reverse() *InitializerList { if n == nil { return nil } na := n nb := na.InitializerList for nb != nil { nc := nb.InitializerList nb.InitializerList = na na = nb nb = nc } n.InitializerList = nil return na } func (n *InitializerList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *InitializerList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *InitializerList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return 0 case 2: return n.Designation.Pos() case 1: return n.Initializer.Pos() case 3, 4: if p := n.InitializerList.Pos(); p != 0 { return p } return n.Token.Pos() default: panic("internal error") } } // IterationStmtCase represents case numbers of production IterationStmt type IterationStmtCase int // Values of type IterationStmtCase const ( IterationStmtDo IterationStmtCase = iota IterationStmtForDecl IterationStmtFor IterationStmtWhile ) // String implements fmt.Stringer func (n IterationStmtCase) String() string { switch n { case IterationStmtDo: return "IterationStmtDo" case IterationStmtForDecl: return "IterationStmtForDecl" case IterationStmtFor: return "IterationStmtFor" case IterationStmtWhile: return "IterationStmtWhile" default: return fmt.Sprintf("IterationStmtCase(%v)", int(n)) } } // IterationStmt represents data reduced by productions: // // IterationStmt: // "do" Stmt "while" '(' ExprList ')' ';' // Case IterationStmtDo // | "for" '(' Declaration ExprListOpt ';' ExprListOpt ')' Stmt // Case IterationStmtForDecl // | "for" '(' ExprListOpt ';' ExprListOpt ';' ExprListOpt ')' Stmt // Case IterationStmtFor // | "while" '(' ExprList ')' Stmt // Case IterationStmtWhile type IterationStmt struct { Case IterationStmtCase Declaration *Declaration ExprList *ExprList ExprListOpt *ExprListOpt ExprListOpt2 *ExprListOpt ExprListOpt3 *ExprListOpt Stmt *Stmt Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token Token5 xc.Token } func (n *IterationStmt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *IterationStmt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *IterationStmt) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // JumpStmtCase represents case numbers of production JumpStmt type JumpStmtCase int // Values of type JumpStmtCase const ( JumpStmtBreak JumpStmtCase = iota JumpStmtContinue JumpStmtGoto JumpStmtReturn ) // String implements fmt.Stringer func (n JumpStmtCase) String() string { switch n { case JumpStmtBreak: return "JumpStmtBreak" case JumpStmtContinue: return "JumpStmtContinue" case JumpStmtGoto: return "JumpStmtGoto" case JumpStmtReturn: return "JumpStmtReturn" default: return fmt.Sprintf("JumpStmtCase(%v)", int(n)) } } // JumpStmt represents data reduced by productions: // // JumpStmt: // "break" ';' // Case JumpStmtBreak // | "continue" ';' // Case JumpStmtContinue // | "goto" IDENTIFIER ';' // Case JumpStmtGoto // | "return" ExprListOpt ';' // Case JumpStmtReturn type JumpStmt struct { ReturnOperand Operand scope *Scope Case JumpStmtCase ExprListOpt *ExprListOpt Token xc.Token Token2 xc.Token Token3 xc.Token } func (n *JumpStmt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *JumpStmt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *JumpStmt) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // LabeledStmtCase represents case numbers of production LabeledStmt type LabeledStmtCase int // Values of type LabeledStmtCase const ( LabeledStmtSwitchCase LabeledStmtCase = iota LabeledStmtDefault LabeledStmtLabel LabeledStmtLabel2 ) // String implements fmt.Stringer func (n LabeledStmtCase) String() string { switch n { case LabeledStmtSwitchCase: return "LabeledStmtSwitchCase" case LabeledStmtDefault: return "LabeledStmtDefault" case LabeledStmtLabel: return "LabeledStmtLabel" case LabeledStmtLabel2: return "LabeledStmtLabel2" default: return fmt.Sprintf("LabeledStmtCase(%v)", int(n)) } } // LabeledStmt represents data reduced by productions: // // LabeledStmt: // "case" ConstExpr ':' Stmt // Case LabeledStmtSwitchCase // | "default" ':' Stmt // Case LabeledStmtDefault // | IDENTIFIER ':' Stmt // Case LabeledStmtLabel // | TYPEDEF_NAME ':' Stmt // Case LabeledStmtLabel2 type LabeledStmt struct { Case LabeledStmtCase ConstExpr *ConstExpr Stmt *Stmt Token xc.Token Token2 xc.Token } func (n *LabeledStmt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *LabeledStmt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *LabeledStmt) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // ParameterDeclarationCase represents case numbers of production ParameterDeclaration type ParameterDeclarationCase int // Values of type ParameterDeclarationCase const ( ParameterDeclarationAbstract ParameterDeclarationCase = iota ParameterDeclarationDeclarator ) // String implements fmt.Stringer func (n ParameterDeclarationCase) String() string { switch n { case ParameterDeclarationAbstract: return "ParameterDeclarationAbstract" case ParameterDeclarationDeclarator: return "ParameterDeclarationDeclarator" default: return fmt.Sprintf("ParameterDeclarationCase(%v)", int(n)) } } // ParameterDeclaration represents data reduced by productions: // // ParameterDeclaration: // DeclarationSpecifiers AbstractDeclaratorOpt // Case ParameterDeclarationAbstract // | DeclarationSpecifiers Declarator // Case ParameterDeclarationDeclarator type ParameterDeclaration struct { AbstractDeclaratorOpt *AbstractDeclaratorOpt Case ParameterDeclarationCase DeclarationSpecifiers *DeclarationSpecifiers Declarator *Declarator } func (n *ParameterDeclaration) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ParameterDeclaration) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ParameterDeclaration) Pos() token.Pos { if n == nil { return 0 } return n.DeclarationSpecifiers.Pos() } // ParameterList represents data reduced by productions: // // ParameterList: // ParameterDeclaration // Case 0 // | ParameterList ',' ParameterDeclaration // Case 1 type ParameterList struct { Case int ParameterDeclaration *ParameterDeclaration ParameterList *ParameterList Token xc.Token } func (n *ParameterList) reverse() *ParameterList { if n == nil { return nil } na := n nb := na.ParameterList for nb != nil { nc := nb.ParameterList nb.ParameterList = na na = nb nb = nc } n.ParameterList = nil return na } func (n *ParameterList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *ParameterList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ParameterList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.ParameterDeclaration.Pos() case 1: return n.ParameterList.Pos() default: panic("internal error") } } // ParameterTypeListCase represents case numbers of production ParameterTypeList type ParameterTypeListCase int // Values of type ParameterTypeListCase const ( ParameterTypeListBase ParameterTypeListCase = iota ParameterTypeListDots ) // String implements fmt.Stringer func (n ParameterTypeListCase) String() string { switch n { case ParameterTypeListBase: return "ParameterTypeListBase" case ParameterTypeListDots: return "ParameterTypeListDots" default: return fmt.Sprintf("ParameterTypeListCase(%v)", int(n)) } } // ParameterTypeList represents data reduced by productions: // // ParameterTypeList: // ParameterList // Case ParameterTypeListBase // | ParameterList ',' "..." // Case ParameterTypeListDots type ParameterTypeList struct { Case ParameterTypeListCase ParameterList *ParameterList Token xc.Token Token2 xc.Token } func (n *ParameterTypeList) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ParameterTypeList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ParameterTypeList) Pos() token.Pos { if n == nil { return 0 } return n.ParameterList.Pos() } // ParameterTypeListOpt represents data reduced by productions: // // ParameterTypeListOpt: // /* empty */ // Case 0 // | ParameterTypeList // Case 1 type ParameterTypeListOpt struct { ParameterTypeList *ParameterTypeList } func (n *ParameterTypeListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *ParameterTypeListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *ParameterTypeListOpt) Pos() token.Pos { if n == nil { return 0 } return n.ParameterTypeList.Pos() } // PointerCase represents case numbers of production Pointer type PointerCase int // Values of type PointerCase const ( PointerBase PointerCase = iota PointerPtr ) // String implements fmt.Stringer func (n PointerCase) String() string { switch n { case PointerBase: return "PointerBase" case PointerPtr: return "PointerPtr" default: return fmt.Sprintf("PointerCase(%v)", int(n)) } } // Pointer represents data reduced by productions: // // Pointer: // '*' TypeQualifierListOpt // Case PointerBase // | '*' TypeQualifierListOpt Pointer // Case PointerPtr type Pointer struct { Case PointerCase Pointer *Pointer Token xc.Token TypeQualifierListOpt *TypeQualifierListOpt } func (n *Pointer) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Pointer) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Pointer) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // PointerOpt represents data reduced by productions: // // PointerOpt: // /* empty */ // Case 0 // | Pointer // Case 1 type PointerOpt struct { Pointer *Pointer } func (n *PointerOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *PointerOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *PointerOpt) Pos() token.Pos { if n == nil { return 0 } return n.Pointer.Pos() } // SelectionStmtCase represents case numbers of production SelectionStmt type SelectionStmtCase int // Values of type SelectionStmtCase const ( SelectionStmtIfElse SelectionStmtCase = iota SelectionStmtIf SelectionStmtSwitch ) // String implements fmt.Stringer func (n SelectionStmtCase) String() string { switch n { case SelectionStmtIfElse: return "SelectionStmtIfElse" case SelectionStmtIf: return "SelectionStmtIf" case SelectionStmtSwitch: return "SelectionStmtSwitch" default: return fmt.Sprintf("SelectionStmtCase(%v)", int(n)) } } // SelectionStmt represents data reduced by productions: // // SelectionStmt: // "if" '(' ExprList ')' Stmt "else" Stmt // Case SelectionStmtIfElse // | "if" '(' ExprList ')' Stmt // Case SelectionStmtIf // | "switch" '(' ExprList ')' Stmt // Case SelectionStmtSwitch type SelectionStmt struct { Cases []*LabeledStmt SwitchOp Operand // Promoted switch operand Case SelectionStmtCase ExprList *ExprList Stmt *Stmt Stmt2 *Stmt Token xc.Token Token2 xc.Token Token3 xc.Token Token4 xc.Token } func (n *SelectionStmt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *SelectionStmt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *SelectionStmt) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // SpecifierQualifierListCase represents case numbers of production SpecifierQualifierList type SpecifierQualifierListCase int // Values of type SpecifierQualifierListCase const ( SpecifierQualifierListQualifier SpecifierQualifierListCase = iota SpecifierQualifierListSpecifier ) // String implements fmt.Stringer func (n SpecifierQualifierListCase) String() string { switch n { case SpecifierQualifierListQualifier: return "SpecifierQualifierListQualifier" case SpecifierQualifierListSpecifier: return "SpecifierQualifierListSpecifier" default: return fmt.Sprintf("SpecifierQualifierListCase(%v)", int(n)) } } // SpecifierQualifierList represents data reduced by productions: // // SpecifierQualifierList: // TypeQualifier SpecifierQualifierListOpt // Case SpecifierQualifierListQualifier // | TypeSpecifier SpecifierQualifierListOpt // Case SpecifierQualifierListSpecifier type SpecifierQualifierList struct { Case SpecifierQualifierListCase SpecifierQualifierListOpt *SpecifierQualifierListOpt TypeQualifier *TypeQualifier TypeSpecifier *TypeSpecifier } func (n *SpecifierQualifierList) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *SpecifierQualifierList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *SpecifierQualifierList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.TypeQualifier.Pos() case 1: return n.TypeSpecifier.Pos() default: panic("internal error") } } // SpecifierQualifierListOpt represents data reduced by productions: // // SpecifierQualifierListOpt: // /* empty */ // Case 0 // | SpecifierQualifierList // Case 1 type SpecifierQualifierListOpt struct { SpecifierQualifierList *SpecifierQualifierList } func (n *SpecifierQualifierListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *SpecifierQualifierListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *SpecifierQualifierListOpt) Pos() token.Pos { if n == nil { return 0 } return n.SpecifierQualifierList.Pos() } // StmtCase represents case numbers of production Stmt type StmtCase int // Values of type StmtCase const ( StmtBlock StmtCase = iota StmtExpr StmtIter StmtJump StmtLabeled StmtSelect ) // String implements fmt.Stringer func (n StmtCase) String() string { switch n { case StmtBlock: return "StmtBlock" case StmtExpr: return "StmtExpr" case StmtIter: return "StmtIter" case StmtJump: return "StmtJump" case StmtLabeled: return "StmtLabeled" case StmtSelect: return "StmtSelect" default: return fmt.Sprintf("StmtCase(%v)", int(n)) } } // Stmt represents data reduced by productions: // // Stmt: // CompoundStmt // Case StmtBlock // | ExprStmt // Case StmtExpr // | IterationStmt // Case StmtIter // | JumpStmt // Case StmtJump // | LabeledStmt // Case StmtLabeled // | SelectionStmt // Case StmtSelect type Stmt struct { Case StmtCase CompoundStmt *CompoundStmt ExprStmt *ExprStmt IterationStmt *IterationStmt JumpStmt *JumpStmt LabeledStmt *LabeledStmt SelectionStmt *SelectionStmt } func (n *Stmt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *Stmt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *Stmt) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.CompoundStmt.Pos() case 1: return n.ExprStmt.Pos() case 2: return n.IterationStmt.Pos() case 3: return n.JumpStmt.Pos() case 4: return n.LabeledStmt.Pos() case 5: return n.SelectionStmt.Pos() default: panic("internal error") } } // StorageClassSpecifierCase represents case numbers of production StorageClassSpecifier type StorageClassSpecifierCase int // Values of type StorageClassSpecifierCase const ( StorageClassSpecifierAuto StorageClassSpecifierCase = iota StorageClassSpecifierExtern StorageClassSpecifierRegister StorageClassSpecifierStatic StorageClassSpecifierTypedef ) // String implements fmt.Stringer func (n StorageClassSpecifierCase) String() string { switch n { case StorageClassSpecifierAuto: return "StorageClassSpecifierAuto" case StorageClassSpecifierExtern: return "StorageClassSpecifierExtern" case StorageClassSpecifierRegister: return "StorageClassSpecifierRegister" case StorageClassSpecifierStatic: return "StorageClassSpecifierStatic" case StorageClassSpecifierTypedef: return "StorageClassSpecifierTypedef" default: return fmt.Sprintf("StorageClassSpecifierCase(%v)", int(n)) } } // StorageClassSpecifier represents data reduced by productions: // // StorageClassSpecifier: // "auto" // Case StorageClassSpecifierAuto // | "extern" // Case StorageClassSpecifierExtern // | "register" // Case StorageClassSpecifierRegister // | "static" // Case StorageClassSpecifierStatic // | "typedef" // Case StorageClassSpecifierTypedef type StorageClassSpecifier struct { Case StorageClassSpecifierCase Token xc.Token } func (n *StorageClassSpecifier) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *StorageClassSpecifier) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StorageClassSpecifier) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // StructDeclarationCase represents case numbers of production StructDeclaration type StructDeclarationCase int // Values of type StructDeclarationCase const ( StructDeclarationBase StructDeclarationCase = iota StructDeclarationAnon ) // String implements fmt.Stringer func (n StructDeclarationCase) String() string { switch n { case StructDeclarationBase: return "StructDeclarationBase" case StructDeclarationAnon: return "StructDeclarationAnon" default: return fmt.Sprintf("StructDeclarationCase(%v)", int(n)) } } // StructDeclaration represents data reduced by productions: // // StructDeclaration: // SpecifierQualifierList StructDeclaratorList ';' // Case StructDeclarationBase // | SpecifierQualifierList ';' // Case StructDeclarationAnon type StructDeclaration struct { Case StructDeclarationCase SpecifierQualifierList *SpecifierQualifierList StructDeclaratorList *StructDeclaratorList Token xc.Token } func (n *StructDeclaration) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *StructDeclaration) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StructDeclaration) Pos() token.Pos { if n == nil { return 0 } return n.SpecifierQualifierList.Pos() } // StructDeclarationList represents data reduced by productions: // // StructDeclarationList: // StructDeclaration // Case 0 // | StructDeclarationList StructDeclaration // Case 1 type StructDeclarationList struct { Case int StructDeclaration *StructDeclaration StructDeclarationList *StructDeclarationList } func (n *StructDeclarationList) reverse() *StructDeclarationList { if n == nil { return nil } na := n nb := na.StructDeclarationList for nb != nil { nc := nb.StructDeclarationList nb.StructDeclarationList = na na = nb nb = nc } n.StructDeclarationList = nil return na } func (n *StructDeclarationList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *StructDeclarationList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StructDeclarationList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.StructDeclaration.Pos() case 1: return n.StructDeclarationList.Pos() default: panic("internal error") } } // StructDeclaratorCase represents case numbers of production StructDeclarator type StructDeclaratorCase int // Values of type StructDeclaratorCase const ( StructDeclaratorBase StructDeclaratorCase = iota StructDeclaratorBits ) // String implements fmt.Stringer func (n StructDeclaratorCase) String() string { switch n { case StructDeclaratorBase: return "StructDeclaratorBase" case StructDeclaratorBits: return "StructDeclaratorBits" default: return fmt.Sprintf("StructDeclaratorCase(%v)", int(n)) } } // StructDeclarator represents data reduced by productions: // // StructDeclarator: // Declarator // Case StructDeclaratorBase // | DeclaratorOpt ':' ConstExpr // Case StructDeclaratorBits type StructDeclarator struct { Bits int Case StructDeclaratorCase ConstExpr *ConstExpr Declarator *Declarator DeclaratorOpt *DeclaratorOpt Token xc.Token } func (n *StructDeclarator) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *StructDeclarator) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StructDeclarator) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.Declarator.Pos() case 1: if p := n.DeclaratorOpt.Pos(); p != 0 { return p } return n.Token.Pos() default: panic("internal error") } } // StructDeclaratorList represents data reduced by productions: // // StructDeclaratorList: // StructDeclarator // Case 0 // | StructDeclaratorList ',' StructDeclarator // Case 1 type StructDeclaratorList struct { Case int StructDeclarator *StructDeclarator StructDeclaratorList *StructDeclaratorList Token xc.Token } func (n *StructDeclaratorList) reverse() *StructDeclaratorList { if n == nil { return nil } na := n nb := na.StructDeclaratorList for nb != nil { nc := nb.StructDeclaratorList nb.StructDeclaratorList = na na = nb nb = nc } n.StructDeclaratorList = nil return na } func (n *StructDeclaratorList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *StructDeclaratorList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StructDeclaratorList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.StructDeclarator.Pos() case 1: return n.StructDeclaratorList.Pos() default: panic("internal error") } } // StructOrUnionCase represents case numbers of production StructOrUnion type StructOrUnionCase int // Values of type StructOrUnionCase const ( StructOrUnionStruct StructOrUnionCase = iota StructOrUnionUnion ) // String implements fmt.Stringer func (n StructOrUnionCase) String() string { switch n { case StructOrUnionStruct: return "StructOrUnionStruct" case StructOrUnionUnion: return "StructOrUnionUnion" default: return fmt.Sprintf("StructOrUnionCase(%v)", int(n)) } } // StructOrUnion represents data reduced by productions: // // StructOrUnion: // "struct" // Case StructOrUnionStruct // | "union" // Case StructOrUnionUnion type StructOrUnion struct { Case StructOrUnionCase Token xc.Token } func (n *StructOrUnion) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *StructOrUnion) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StructOrUnion) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // StructOrUnionSpecifierCase represents case numbers of production StructOrUnionSpecifier type StructOrUnionSpecifierCase int // Values of type StructOrUnionSpecifierCase const ( StructOrUnionSpecifierTag StructOrUnionSpecifierCase = iota StructOrUnionSpecifierEmpty StructOrUnionSpecifierDefine ) // String implements fmt.Stringer func (n StructOrUnionSpecifierCase) String() string { switch n { case StructOrUnionSpecifierTag: return "StructOrUnionSpecifierTag" case StructOrUnionSpecifierEmpty: return "StructOrUnionSpecifierEmpty" case StructOrUnionSpecifierDefine: return "StructOrUnionSpecifierDefine" default: return fmt.Sprintf("StructOrUnionSpecifierCase(%v)", int(n)) } } // StructOrUnionSpecifier represents data reduced by productions: // // StructOrUnionSpecifier: // StructOrUnion IDENTIFIER // Case StructOrUnionSpecifierTag // | StructOrUnion IdentifierOpt '{' '}' // Case StructOrUnionSpecifierEmpty // | StructOrUnion IdentifierOpt '{' StructDeclarationList '}' // Case StructOrUnionSpecifierDefine type StructOrUnionSpecifier struct { scope *Scope // Declare the struct tag in scope.parent. typ Type Case StructOrUnionSpecifierCase IdentifierOpt *IdentifierOpt StructDeclarationList *StructDeclarationList StructOrUnion *StructOrUnion Token xc.Token Token2 xc.Token } func (n *StructOrUnionSpecifier) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *StructOrUnionSpecifier) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *StructOrUnionSpecifier) Pos() token.Pos { if n == nil { return 0 } return n.StructOrUnion.Pos() } // TypeName represents data reduced by production: // // TypeName: // SpecifierQualifierList AbstractDeclaratorOpt // Case 0 type TypeName struct { Type Type AbstractDeclaratorOpt *AbstractDeclaratorOpt SpecifierQualifierList *SpecifierQualifierList } func (n *TypeName) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *TypeName) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *TypeName) Pos() token.Pos { if n == nil { return 0 } return n.SpecifierQualifierList.Pos() } // TypeQualifierCase represents case numbers of production TypeQualifier type TypeQualifierCase int // Values of type TypeQualifierCase const ( TypeQualifierConst TypeQualifierCase = iota TypeQualifierRestrict TypeQualifierVolatile ) // String implements fmt.Stringer func (n TypeQualifierCase) String() string { switch n { case TypeQualifierConst: return "TypeQualifierConst" case TypeQualifierRestrict: return "TypeQualifierRestrict" case TypeQualifierVolatile: return "TypeQualifierVolatile" default: return fmt.Sprintf("TypeQualifierCase(%v)", int(n)) } } // TypeQualifier represents data reduced by productions: // // TypeQualifier: // "const" // Case TypeQualifierConst // | "restrict" // Case TypeQualifierRestrict // | "volatile" // Case TypeQualifierVolatile type TypeQualifier struct { Case TypeQualifierCase Token xc.Token } func (n *TypeQualifier) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *TypeQualifier) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *TypeQualifier) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } // TypeQualifierList represents data reduced by productions: // // TypeQualifierList: // TypeQualifier // Case 0 // | TypeQualifierList TypeQualifier // Case 1 type TypeQualifierList struct { Case int TypeQualifier *TypeQualifier TypeQualifierList *TypeQualifierList } func (n *TypeQualifierList) reverse() *TypeQualifierList { if n == nil { return nil } na := n nb := na.TypeQualifierList for nb != nil { nc := nb.TypeQualifierList nb.TypeQualifierList = na na = nb nb = nc } n.TypeQualifierList = nil return na } func (n *TypeQualifierList) fragment() interface{} { return n.reverse() } // String implements fmt.Stringer. func (n *TypeQualifierList) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *TypeQualifierList) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 0: return n.TypeQualifier.Pos() case 1: return n.TypeQualifierList.Pos() default: panic("internal error") } } // TypeQualifierListOpt represents data reduced by productions: // // TypeQualifierListOpt: // /* empty */ // Case 0 // | TypeQualifierList // Case 1 type TypeQualifierListOpt struct { TypeQualifierList *TypeQualifierList } func (n *TypeQualifierListOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *TypeQualifierListOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *TypeQualifierListOpt) Pos() token.Pos { if n == nil { return 0 } return n.TypeQualifierList.Pos() } // TypeSpecifierCase represents case numbers of production TypeSpecifier type TypeSpecifierCase int // Values of type TypeSpecifierCase const ( TypeSpecifierBool TypeSpecifierCase = iota TypeSpecifierComplex TypeSpecifierChar TypeSpecifierDouble TypeSpecifierFloat TypeSpecifierInt TypeSpecifierLong TypeSpecifierShort TypeSpecifierSigned TypeSpecifierUnsigned TypeSpecifierVoid TypeSpecifierEnum TypeSpecifierStruct TypeSpecifierName TypeSpecifierTypeofExpr TypeSpecifierTypeof ) // String implements fmt.Stringer func (n TypeSpecifierCase) String() string { switch n { case TypeSpecifierBool: return "TypeSpecifierBool" case TypeSpecifierComplex: return "TypeSpecifierComplex" case TypeSpecifierChar: return "TypeSpecifierChar" case TypeSpecifierDouble: return "TypeSpecifierDouble" case TypeSpecifierFloat: return "TypeSpecifierFloat" case TypeSpecifierInt: return "TypeSpecifierInt" case TypeSpecifierLong: return "TypeSpecifierLong" case TypeSpecifierShort: return "TypeSpecifierShort" case TypeSpecifierSigned: return "TypeSpecifierSigned" case TypeSpecifierUnsigned: return "TypeSpecifierUnsigned" case TypeSpecifierVoid: return "TypeSpecifierVoid" case TypeSpecifierEnum: return "TypeSpecifierEnum" case TypeSpecifierStruct: return "TypeSpecifierStruct" case TypeSpecifierName: return "TypeSpecifierName" case TypeSpecifierTypeofExpr: return "TypeSpecifierTypeofExpr" case TypeSpecifierTypeof: return "TypeSpecifierTypeof" default: return fmt.Sprintf("TypeSpecifierCase(%v)", int(n)) } } // TypeSpecifier represents data reduced by productions: // // TypeSpecifier: // "_Bool" // Case TypeSpecifierBool // | "_Complex" // Case TypeSpecifierComplex // | "char" // Case TypeSpecifierChar // | "double" // Case TypeSpecifierDouble // | "float" // Case TypeSpecifierFloat // | "int" // Case TypeSpecifierInt // | "long" // Case TypeSpecifierLong // | "short" // Case TypeSpecifierShort // | "signed" // Case TypeSpecifierSigned // | "unsigned" // Case TypeSpecifierUnsigned // | "void" // Case TypeSpecifierVoid // | EnumSpecifier // Case TypeSpecifierEnum // | StructOrUnionSpecifier // Case TypeSpecifierStruct // | TYPEDEF_NAME // Case TypeSpecifierName // | "typeof" '(' Expr ')' // Case TypeSpecifierTypeofExpr // | "typeof" '(' TypeName ')' // Case TypeSpecifierTypeof type TypeSpecifier struct { scope *Scope typ Type // typeof Case TypeSpecifierCase EnumSpecifier *EnumSpecifier Expr *Expr StructOrUnionSpecifier *StructOrUnionSpecifier Token xc.Token Token2 xc.Token Token3 xc.Token TypeName *TypeName } func (n *TypeSpecifier) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *TypeSpecifier) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *TypeSpecifier) Pos() token.Pos { if n == nil { return 0 } switch n.Case { case 11: return n.EnumSpecifier.Pos() case 12: return n.StructOrUnionSpecifier.Pos() case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15: return n.Token.Pos() default: panic("internal error") } } // VolatileOpt represents data reduced by productions: // // VolatileOpt: // /* empty */ // Case 0 // | "volatile" // Case 1 type VolatileOpt struct { Token xc.Token } func (n *VolatileOpt) fragment() interface{} { return n } // String implements fmt.Stringer. func (n *VolatileOpt) String() string { return PrettyString(n) } // Pos reports the position of the first component of n or zero if it's empty. func (n *VolatileOpt) Pos() token.Pos { if n == nil { return 0 } return n.Token.Pos() } ================================================ FILE: v2/ast2.go ================================================ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc // [0]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf import ( "fmt" "go/token" "math" "math/big" "sort" "strconv" "strings" "github.com/cznic/ir" "github.com/cznic/mathutil" ) // Node represents an AST node. type Node interface { Pos() token.Pos } // Pos implements Node. func (n *TranslationUnit) Pos() token.Pos { return token.Pos(0) } // DeclarationSpecifier describes declaration specifiers. type DeclarationSpecifier struct { FunctionSpecifiers []*FunctionSpecifier StorageClassSpecifiers []*StorageClassSpecifier TypeQualifiers []*TypeQualifier TypeSpecifiers []*TypeSpecifier typeSpecifiers []TypeSpecifierCase } func (d *DeclarationSpecifier) typ(ctx *context) Type { if d.typeSpecifiers == nil { d.typeSpecifiers = make([]TypeSpecifierCase, len(d.TypeSpecifiers)) for i, v := range d.TypeSpecifiers { d.typeSpecifiers[i] = v.Case } sort.Slice(d.typeSpecifiers, func(i, j int) bool { return d.typeSpecifiers[i] < d.typeSpecifiers[j] }) } // [0]6.7.2-2 if len(d.typeSpecifiers) == 1 { switch d.typeSpecifiers[0] { case TypeSpecifierBool: return Bool case TypeSpecifierChar: return Char case TypeSpecifierDouble: return Double case TypeSpecifierFloat: return Float case TypeSpecifierInt: return Int case TypeSpecifierLong: return Long case TypeSpecifierName: ts := d.TypeSpecifiers[0] r := &NamedType{Name: ts.Token.Val} switch x := ts.scope.LookupIdent(ts.Token.Val).(type) { case *Declarator: if !x.DeclarationSpecifier.IsTypedef() { panic("internal error 1") } r.Type = x.Type t := r.Type for { switch x := t.(type) { case *ArrayType, *EnumType, *FunctionType, *StructType, *UnionType: return r case *NamedType: t = x.Type case *PointerType: t = x.Item case *TaggedStructType: x.getType() return r case *TaggedUnionType: x.getType() return r case *TaggedEnumType: x.getType() return r case TypeKind: switch x { case Char, Double, Float, Int, Long, LongDouble, LongLong, SChar, Short, UChar, UInt, ULong, ULongLong, UShort, Void: return r default: panic(x) } default: panic(fmt.Errorf("%T %v", x, x)) } } default: panic(fmt.Errorf("%T", x)) } case TypeSpecifierShort: return Short case TypeSpecifierStruct: t := d.TypeSpecifiers[0].StructOrUnionSpecifier.typ switch x := t.(type) { case *TaggedStructType: x.getType() case *TaggedUnionType: x.getType() } return t case TypeSpecifierSigned: return Int case TypeSpecifierUnsigned: return UInt case TypeSpecifierVoid: return Void case TypeSpecifierEnum: t := d.TypeSpecifiers[0].EnumSpecifier.typ if x, ok := t.(*TaggedEnumType); ok { x.getType() } return t case TypeSpecifierTypeof, TypeSpecifierTypeofExpr: return d.TypeSpecifiers[0].typ default: panic(d.typeSpecifiers) } } switch { case d.is(TypeSpecifierChar, TypeSpecifierSigned): return SChar case d.is(TypeSpecifierChar, TypeSpecifierUnsigned): return UChar case d.is(TypeSpecifierComplex, TypeSpecifierDouble): return DoubleComplex case d.is(TypeSpecifierComplex, TypeSpecifierDouble, TypeSpecifierLong): return LongDoubleComplex case d.is(TypeSpecifierComplex, TypeSpecifierFloat): return FloatComplex case d.is(TypeSpecifierDouble, TypeSpecifierLong): return LongDouble case d.is(TypeSpecifierInt, TypeSpecifierLong): return Long case d.is(TypeSpecifierInt, TypeSpecifierLong, TypeSpecifierLong): return LongLong case d.is(TypeSpecifierInt, TypeSpecifierLong, TypeSpecifierLong, TypeSpecifierUnsigned): return ULongLong case d.is(TypeSpecifierInt, TypeSpecifierLong, TypeSpecifierSigned): return Long case d.is(TypeSpecifierInt, TypeSpecifierLong, TypeSpecifierLong, TypeSpecifierSigned): return LongLong case d.is(TypeSpecifierInt, TypeSpecifierLong, TypeSpecifierUnsigned): return ULong case d.is(TypeSpecifierInt, TypeSpecifierShort): return Short case d.is(TypeSpecifierInt, TypeSpecifierShort, TypeSpecifierSigned): return Short case d.is(TypeSpecifierInt, TypeSpecifierShort, TypeSpecifierUnsigned): return UShort case d.is(TypeSpecifierInt, TypeSpecifierSigned): return Int case d.is(TypeSpecifierInt, TypeSpecifierUnsigned): return UInt case d.is(TypeSpecifierLong, TypeSpecifierLong): return LongLong case d.is(TypeSpecifierLong, TypeSpecifierSigned): return Long case d.is(TypeSpecifierLong, TypeSpecifierUnsigned): return ULong case d.is(TypeSpecifierLong, TypeSpecifierLong, TypeSpecifierSigned): return LongLong case d.is(TypeSpecifierLong, TypeSpecifierLong, TypeSpecifierUnsigned): return ULongLong case d.is(TypeSpecifierShort, TypeSpecifierUnsigned): return UShort case d.is(TypeSpecifierShort, TypeSpecifierSigned): return Short default: panic(d.typeSpecifiers) } } func (d *DeclarationSpecifier) is(a ...TypeSpecifierCase) bool { if d == nil { return false } if len(d.typeSpecifiers) != len(a) { return false } for i, v := range a { if v != d.typeSpecifiers[i] { return false } } return true } // IsTypedef reports whether the storage class specifier "typedef" is present. func (d *DeclarationSpecifier) IsTypedef() bool { if d == nil { return false } for _, v := range d.StorageClassSpecifiers { if v.Case == StorageClassSpecifierTypedef { return true } } return false } // IsStatic reports whether the storage class specifier "static" is present. func (d *DeclarationSpecifier) IsStatic() bool { if d == nil { return false } for _, v := range d.StorageClassSpecifiers { if v.Case == StorageClassSpecifierStatic { return true } } return false } // IsExtern reports whether the storage class specifier "extern" is present. func (d *DeclarationSpecifier) IsExtern() bool { if d == nil { return false } for _, v := range d.StorageClassSpecifiers { if v.Case == StorageClassSpecifierExtern { return true } } return false } func (n *ConstExpr) eval(ctx *context) Operand { if n.Operand.Type == nil { n.Operand = n.Expr.eval(ctx, true, nil, nil, nil) if n.Operand.Value == nil { // not a constant expression panic(fmt.Errorf("TODO247 %v", ctx.position(n))) } } return n.Operand } func (n *Expr) eval(ctx *context, arr2ptr bool, fn *Declarator, seq *int, sc []int) Operand { if n.Operand.Type != nil { return n.Operand } defer func() { if n.Operand.Type != nil && n.Operand.Type.IsArithmeticType() { n.Operand = n.Operand.normalize(ctx.model) } }() outer: switch n.Case { case ExprPreInc: // "++" Expr // [0]6.5.3.1 // // The operand of the prefix increment or decrement operator // shall have qualified or unqualified real or pointer type and // shall be a modifiable lvalue. n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc) if !n.Operand.isScalarType() { panic(ctx.position(n)) } case ExprPreDec: // "--" Expr // [0]6.5.3.1 // // The operand of the prefix increment or decrement operator // shall have qualified or unqualified real or pointer type and // shall be a modifiable lvalue. n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc) if !n.Operand.isScalarType() { panic(ctx.position(n)) } case ExprAlignofType: // "__alignof__" '(' TypeName ')' t := n.TypeName.check(ctx) n.Operand = Operand{Type: Int, Value: &ir.Int64Value{Value: int64(ctx.model.Alignof(t))}} case ExprAlignofExpr: // "__alignof__" Expr op := n.Expr.eval(ctx, false, fn, seq, sc) n.Operand = Operand{Type: Int, Value: &ir.Int64Value{Value: int64(ctx.model.Alignof(underlyingType(op.Type, false)))}} case ExprSizeofType: // "sizeof" '(' TypeName ')' t := n.TypeName.check(ctx) n.Operand = ctx.sizeof(t) case ExprSizeofExpr: // "sizeof" Expr // [0]6.5.3.4 switch t := n.Expr.eval(ctx, false, fn, seq, sc).Type.(type) { // [0]6.3.2.1-3 case *ArrayType: if t.Size.Type == nil { panic(fmt.Errorf("%v", ctx.position(n))) } switch d := n.Expr.Declarator; { case d != nil && d.IsFunctionParameter: n.Operand = ctx.sizeof(Ptr) default: n.Operand = t.Size.mul(ctx, ctx.sizeof(t.Item)) } case *PointerType, *StructType, *TaggedStructType, *TaggedUnionType, *UnionType: n.Operand = ctx.sizeof(t) case *NamedType: n.Operand = ctx.sizeof(t.Type) case TypeKind: switch t { case Char, Double, Float, Int, Long, LongDouble, LongLong, Short, UChar, UInt, ULong, ULongLong, UShort: n.Operand = ctx.sizeof(t) default: panic(t) } default: //dbg("", ctx.position(n)) panic(t) } if n.Operand.Value == nil { panic(fmt.Errorf("%v", ctx.position(n))) } case ExprNot: // '!' Expr n.Operand = Operand{Type: Int} a := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) if a.IsZero() { //TODO n.Expr.IsZero everywhere n.Operand.Value = &ir.Int64Value{Value: 1} break } if a.IsNonZero() { //TODO n.Expr.IsNonZero everywhere n.Operand.Value = &ir.Int64Value{Value: 0} } case ExprAddrof: // '&' Expr // [0]6.5.3.2 op := n.Expr.eval(ctx, false, fn, seq, sc) // [0]6.3.2.1-3 n.Operand = Operand{Type: &PointerType{op.Type}} if d := n.Expr.Declarator; d != nil && n.Expr.Case != ExprPSelect { d.AddressTaken = true } n.Operand.Value = op.Value case ExprPExprList: // '(' ExprList ')' n.Operand = n.ExprList.eval(ctx, arr2ptr, fn, seq, sc) n.Declarator = n.ExprList.declarator(ctx) case ExprCompLit: // '(' TypeName ')' '{' InitializerList CommaOpt '}' t := n.TypeName.check(ctx) n.Operand = Operand{Type: t} if n.InitializerList == nil { n.InitializerList = &InitializerList{} } n.InitializerList.check(ctx, t, fn) if fn == nil { break } nmTok := n.Token nmTok.Char.Rune = IDENTIFIER fn.unnamed++ nmTok.Val = dict.SID(fmt.Sprintf("unnamed%d", fn.unnamed)) d := &Declarator{ DirectDeclarator: &DirectDeclarator{ Case: DirectDeclaratorIdent, Token: nmTok, }, Initializer: &Initializer{ Case: InitializerCompLit, InitializerList: n.InitializerList, }, Referenced: 1, Scope: n.Scope, Type: t, } n.Declarator = d fn.vars = append(fn.vars, d) case ExprCast: // '(' TypeName ')' Expr // [0]6.5.4 t := n.TypeName.check(ctx) op := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) if t == Void { n.Operand = Operand{Type: Void} break } more: switch x := t.(type) { case *EnumType: n.Operand = op.ConvertTo(ctx.model, t) case *PointerType: //dbg("", ctx.position(n), t, op) n.Operand = op.ConvertTo(ctx.model, t) case *NamedType: t = x.Type goto more case *TaggedEnumType: n.Operand = op.ConvertTo(ctx.model, t) case *TaggedStructType: n.Operand.Type = t case *TaggedUnionType: n.Operand = op.ConvertTo(ctx.model, t) case TypeKind: switch x { case Char, Double, DoubleComplex, Float, FloatComplex, Int, Long, LongDouble, LongDoubleComplex, LongLong, SChar, Short, UChar, UInt, ULong, ULongLong, UShort: n.Operand = op.ConvertTo(ctx.model, t) default: panic(x) } default: panic(fmt.Errorf("%v: %T", ctx.position(n), x)) } if n.Expr.Operand.Value != nil { op := n.Expr.Operand.ConvertTo(ctx.model, t) n.Operand.Value = op.Value } case ExprDeref: // '*' Expr // [0]6.5.3 if !arr2ptr && n.Expr.Case == ExprCall { // int *f(); int *p = &*f(); arr2ptr = true } op := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) for t, done := op.Type, false; !done; { switch x := t.(type) { case *ArrayType: n.Operand = Operand{Type: x.Item} done = true case *NamedType: t = x.Type case *PointerType: n.Operand = Operand{Type: x.Item} done = true default: panic(fmt.Errorf("%v: ExprDeref %v, arr2ptr %v", ctx.position(n), op, arr2ptr)) } } case ExprUnaryPlus: // '+' Expr // [0]6.5.3.3 // The operand of the unary + or - operator shall have // arithmetic type; of the ~ operator, integer type; of the ! // operator, scalar type. op := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) if !op.isArithmeticType() { panic(ctx.position(n)) } n.Operand = op.integerPromotion(ctx.model) case ExprUnaryMinus: // '-' Expr // [0]6.5.3.3 // The operand of the unary + or - operator shall have // arithmetic type; of the ~ operator, integer type; of the ! // operator, scalar type. op := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) if !op.isArithmeticType() { panic(ctx.position(n)) } n.Operand = op.unaryMinus(ctx) case ExprCpl: // '~' Expr // [0]6.5.3.3 // The operand of the unary + or - operator shall have // arithmetic type; of the ~ operator, integer type; of the ! // operator, scalar type. op := n.Expr.eval(ctx, arr2ptr, fn, seq, sc).integerPromotion(ctx.model) if !op.Type.IsIntegerType() { panic(ctx.position(n)) } n.Operand = op.cpl(ctx) case ExprChar: // CHARCONST n.Operand = ctx.charConst(n.Token) case ExprNe: // Expr "!=" Expr lhs := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) rhs := n.Expr2.eval(ctx, arr2ptr, fn, seq, sc) if n.Expr.Equals(n.Expr2) { n.Operand = Operand{Type: Int, Value: &ir.Int64Value{Value: 0}} break } // [0]6.5.9 switch { // One of the following shall hold: case // both operands have arithmetic type lhs.isArithmeticType() && rhs.isArithmeticType(): n.Operand = lhs.ne(ctx, rhs) // fmt.Printf("TODO497 %v\n", ctx.position(n)) // n.Operand = n.Operand.normalize(ctx.model) // n.DumpOperands("· ") //TODO- case // one operand is a pointer and the other is a null // pointer constant. lhs.isPointerType() && rhs.isNullPtrConst(): n.Operand = Operand{Type: Int} switch { case n.Expr.IsNonZero(): n.Operand.Value = &ir.Int64Value{Value: 1} case n.Expr.IsZero(): n.Operand.Value = &ir.Int64Value{Value: 0} } case // one operand is a pointer and the other is a null // pointer constant. lhs.isNullPtrConst() && rhs.isPointerType(): n.Operand = Operand{Type: Int} switch { case n.Expr2.IsNonZero(): n.Operand.Value = &ir.Int64Value{Value: 1} case n.Expr2.IsZero(): n.Operand.Value = &ir.Int64Value{Value: 0} } case // both operands are pointers to qualified or unqualified versions of compatible types lhs.isPointerType() && rhs.isPointerType() && (lhs.Type.IsCompatible(rhs.Type) || ctx.tweaks.EnablePointerCompatibility): n.Operand = Operand{Type: Int} if n.Expr.Case == ExprAddrof && n.Expr.Expr.Case == ExprIdent && n.Expr2.Case == ExprAddrof && n.Expr2.Expr.Case == ExprIdent { var val int64 if n.Expr.Expr.Token.Val != n.Expr2.Expr.Token.Val { val = 1 } n.Operand.Value = &ir.Int64Value{Value: val} } default: panic(fmt.Errorf("%v: %v %v", ctx.position(n), lhs, rhs)) } case ExprModAssign: // Expr "%=" Expr // [0]6.5.16.2 n.Expr.eval(ctx, arr2ptr, fn, seq, sc).mod(ctx, n, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) n.Operand = n.Expr.Operand case ExprLAnd: // Expr "&&" Expr n.Operand = Operand{Type: Int} n.Expr.eval(ctx, arr2ptr, fn, seq, sc) if n.Expr.IsZero() { n.Operand.Value = &ir.Int64Value{Value: 0} break } n.Expr2.eval(ctx, arr2ptr, fn, seq, sc) if n.Expr2.IsZero() { n.Operand.Value = &ir.Int64Value{Value: 0} break } if n.Expr.IsNonZero() && n.Expr2.IsNonZero() { n.Operand.Value = &ir.Int64Value{Value: 1} break } case ExprAndAssign: // Expr "&=" Expr n.Expr.eval(ctx, arr2ptr, fn, seq, sc).and(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) n.Operand = n.Expr.Operand case ExprMulAssign: // Expr "*=" Expr // [0]6.5.16.2 n.Expr.eval(ctx, arr2ptr, fn, seq, sc).mul(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) n.Operand = n.Expr.Operand case ExprPostInc: // Expr "++" // [0]6.5.2.4 // // The operand of the postfix increment or decrement operator // shall have qualified or unqualified real or pointer type and // shall be a modifiable lvalue. n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc) if !n.Operand.isScalarType() { panic(ctx.position(n)) } case ExprAddAssign: // Expr "+=" Expr // [0]6.5.16.2 // // 1. For the operators += and -= only, either the left operand // shall be a pointer to an object type and the right shall // have integer type, or the left operand shall have qualified // or unqualified arithmetic type and the right shall have // arithmetic type. lhs := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) rhs := n.Expr2.eval(ctx, arr2ptr, fn, seq, sc) switch { case lhs.isPointerType() && rhs.isIntegerType(), lhs.isArithmeticType() && rhs.isArithmeticType(): // ok default: panic(ctx.position(n)) } n.Operand = lhs case ExprPostDec: // Expr "--" // [0]6.5.2.4 // // The operand of the postfix increment or decrement operator // shall have qualified or unqualified real or pointer type and // shall be a modifiable lvalue. n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc) if !n.Operand.isScalarType() { panic(ctx.position(n)) } case ExprSubAssign: // Expr "-=" Expr // [0]6.5.16.2 // // 1. For the operators += and -= only, either the left operand // shall be a pointer to an object type and the right shall // have integer type, or the left operand shall have qualified // or unqualified arithmetic type and the right shall have // arithmetic type. lhs := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) rhs := n.Expr2.eval(ctx, arr2ptr, fn, seq, sc) switch { case lhs.isPointerType() && rhs.isIntegerType(), lhs.isArithmeticType() && rhs.isArithmeticType(): // ok default: panic(ctx.position(n)) } n.Operand = lhs case ExprPSelect: // Expr "->" IDENTIFIER n.Expr.AssignedTo = n.AssignedTo op := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) if d := n.Expr.Declarator; d != nil && n.AssignedTo { d.AssignedTo++ } t := op.Type for done := false; !done; { switch x := t.(type) { case *ArrayType: t = x.Item done = true case *NamedType: t = x.Type case *PointerType: t = x.Item done = true default: panic(fmt.Errorf("%v: %T", ctx.position(n), x)) } } out: for { switch x := t.(type) { case *NamedType: t = x.Type case *StructType: ctx.model.Layout(x) fp := x.Field(n.Token2.Val) if fp == nil { panic(ctx.position(n)) } n.Operand = Operand{Type: fp.Declarator.Type} n.Operand.FieldProperties = fp if op.Value == Null { n.Operand.Value = &ir.Int64Value{Value: fp.Offset} } break out case *TaggedStructType: t = x.getType() if t == x { panic(fmt.Errorf("%v: %q", ctx.position(n), dict.S(x.Tag))) } case *TaggedUnionType: t = x.getType() if t == x { panic(fmt.Errorf("%v: %q", ctx.position(n), dict.S(x.Tag))) } case *UnionType: ctx.model.Layout(x) fp := x.Field(n.Token2.Val) if fp == nil { panic(ctx.position(n)) } n.Operand = Operand{Type: fp.Declarator.Type} n.Operand.FieldProperties = fp if op.Value == Null { n.Operand.Value = &ir.Int64Value{} } break out default: panic(x) } } case ExprSelect: // Expr '.' IDENTIFIER n.Expr.AssignedTo = n.AssignedTo op := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) if d := n.Expr.Declarator; d != nil && n.AssignedTo { d.AssignedTo++ } t := op.Type out3: for { switch x := t.(type) { case *NamedType: t = x.Type case *StructType: ctx.model.Layout(x) fp := x.Field(n.Token2.Val) if fp == nil { panic(ctx.position(n)) } n.Operand = Operand{Type: fp.Declarator.Type} n.Operand.FieldProperties = fp break out3 case *TaggedStructType: y := x.getType() if x == y { panic("TODO") } t = y case *TaggedUnionType: y := x.getType() if x == y { panic(fmt.Errorf("%v:", ctx.position(n))) } t = y case *UnionType: ctx.model.Layout(x) fp := x.Field(n.Token2.Val) if fp == nil { panic(ctx.position(n)) } n.Operand = Operand{Type: fp.Declarator.Type} n.Operand.FieldProperties = fp break out3 default: //dbg("%v: %T", ctx.position(n), x) panic(x) } } if d := n.Expr.Declarator; d != nil { d.Referenced++ d.AddressTaken = true } case ExprDivAssign: // Expr "/=" Expr // [0]6.5.16.2 n.Expr.eval(ctx, arr2ptr, fn, seq, sc).div(ctx, n, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) n.Operand = n.Expr.Operand case ExprLsh: // Expr "<<" Expr n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).lsh(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) case ExprLshAssign: // Expr "<<=" Expr n.Expr.eval(ctx, arr2ptr, fn, seq, sc).lsh(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) n.Operand = n.Expr.Operand case ExprLe: // Expr "<=" Expr n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).le(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) if n.Expr.Equals(n.Expr2) { n.Operand = Operand{Type: Int, Value: &ir.Int64Value{Value: 1}} } case ExprEq: // Expr "==" Expr lhs := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) switch x := underlyingType(lhs.Type, true).(type) { case *EnumType: n.Expr2.enum = x } rhs := n.Expr2.eval(ctx, arr2ptr, fn, seq, sc) n.Operand.Type = Int if n.Expr.Equals(n.Expr2) { n.Operand.Value = &ir.Int64Value{Value: 1} break } // [0]6.5.9 switch { // One of the following shall hold: case // both operands have arithmetic type lhs.isArithmeticType() && rhs.isArithmeticType(): n.Operand = lhs.eq(ctx, rhs) case // one operand is a pointer and the other is a null // pointer constant. lhs.isPointerType() && rhs.isNullPtrConst(): switch { case n.Expr.IsNonZero(): n.Operand.Value = &ir.Int64Value{Value: 0} case n.Expr.IsZero(): n.Operand.Value = &ir.Int64Value{Value: 1} } case // one operand is a pointer and the other is a null // pointer constant. lhs.isNullPtrConst() && rhs.isPointerType(): switch { case n.Expr2.IsNonZero(): n.Operand.Value = &ir.Int64Value{Value: 0} case n.Expr2.IsZero(): n.Operand.Value = &ir.Int64Value{Value: 1} } case // both operands are pointers to qualified or unqualified versions of compatible types lhs.isPointerType() && rhs.isPointerType() && (lhs.Type.IsCompatible(rhs.Type) || ctx.tweaks.EnablePointerCompatibility): if n.Expr.Case == ExprAddrof && n.Expr.Expr.Case == ExprIdent && n.Expr2.Case == ExprAddrof && n.Expr2.Expr.Case == ExprIdent { var val int64 if n.Expr.Expr.Token.Val == n.Expr2.Expr.Token.Val { val = 1 } n.Operand.Value = &ir.Int64Value{Value: val} } default: panic(fmt.Errorf("%v: %v %v", ctx.position(n), lhs, rhs)) } case ExprGe: // Expr ">=" Expr n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).ge(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) if n.Expr.Equals(n.Expr2) { n.Operand = Operand{Type: Int, Value: &ir.Int64Value{Value: 1}} } case ExprRsh: // Expr ">>" Expr n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).rsh(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) case ExprRshAssign: // Expr ">>=" Expr n.Expr.eval(ctx, arr2ptr, fn, seq, sc).rsh(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) n.Operand = n.Expr.Operand case ExprXorAssign: // Expr "^=" Expr n.Expr.eval(ctx, arr2ptr, fn, seq, sc).xor(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) n.Operand = n.Expr.Operand case ExprOrAssign: // Expr "|=" Expr n.Expr.eval(ctx, arr2ptr, fn, seq, sc).or(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) n.Operand = n.Expr.Operand case ExprLOr: // Expr "||" Expr n.Operand = Operand{Type: Int} n.Expr.eval(ctx, arr2ptr, fn, seq, sc) if n.Expr.IsNonZero() { n.Operand.Value = &ir.Int64Value{Value: 1} break } n.Expr2.eval(ctx, arr2ptr, fn, seq, sc) if n.Expr2.IsNonZero() { n.Operand.Value = &ir.Int64Value{Value: 1} break } if n.Expr.IsZero() && n.Expr2.IsZero() { n.Operand.Value = &ir.Int64Value{Value: 0} } case ExprMod: // Expr '%' Expr n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).mod(ctx, n, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) // [0]6.5.5 case ExprAnd: // Expr '&' Expr n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).and(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) if n.isSideEffectsFree() { // x & (x | y) == x x, y := n.Expr, n.Expr2 if y.Case == ExprIdent { x, y = y, x } if x.Case == ExprIdent && y.Case == ExprPExprList && y.ExprList.ExprList == nil { if z := y.ExprList.Expr; z.Case == ExprOr { if z.Expr.Case == ExprIdent && z.Expr.Token.Val == x.Token.Val || z.Expr2.Case == ExprIdent && z.Expr2.Token.Val == x.Token.Val { *n = *x } } } } case ExprCall: // Expr '(' ArgumentExprListOpt ')' if n.Expr.Case == ExprIdent { switch n.Expr.Token.Val { case idBuiltinTypesCompatible: // using #define __builtin_types_compatible_p(type1, type2) __builtin_types_compatible__((type1){}, (type2){}) o := n.ArgumentExprListOpt if o == nil { panic("missing arguments of __builtin_types_compatible_p") } args := o.ArgumentExprList arg1 := args.Expr if arg1.Case != ExprCompLit { // '(' TypeName ')' '{' InitializerList CommaOpt '}' panic("invalid argument of __builtin_types_compatible__p") } args = args.ArgumentExprList if args == nil { panic("missing argument of __builtin_types_compatible_p") } arg2 := args.Expr if arg2.Case != ExprCompLit { // '(' TypeName ')' '{' InitializerList CommaOpt '}' panic("invalid argument of __builtin_types_compatible__") } if args.ArgumentExprList != nil { panic("too many arguments of __builtin_types_compatible_p") } t := arg1.eval(ctx, arr2ptr, fn, seq, sc).Type u := arg2.eval(ctx, arr2ptr, fn, seq, sc).Type var v int64 if t.IsCompatible(u) { v = 1 } n.Operand.Type = Int n.Operand.Value = &ir.Int64Value{Value: v} break outer case idBuiltinClasifyType: o := n.ArgumentExprListOpt if o == nil { panic("missing argument of __builtin_classify_type") } args := o.ArgumentExprList if args.ArgumentExprList != nil { panic("too many arguments of __builtin_classify_type") } op := args.Expr.eval(ctx, arr2ptr, fn, seq, sc) v := noTypeClass if x, ok := classifyType[op.Type.Kind()]; ok { v = x } n.Case = ExprInt n.Operand.Type = Int n.Operand.Value = &ir.Int64Value{Value: int64(v)} break outer } } // [0]6.5.2.2 op := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) args := n.ArgumentExprListOpt.eval(ctx, fn, seq, sc) ops := make([]Operand, len(args)) n.CallArgs = ops t := checkFn(ctx, op.Type) if t == nil { if !ctx.tweaks.EnableImplicitDeclarations { panic(ctx.position(n)) } if n.Expr.Case == ExprIdent && n.Expr.Token.Val == idAsm { panic(ctx.position(n).String()) } n.Operand = Operand{Type: Int} break } if _, ok := t.Result.(*ArrayType); ok { panic(ctx.position) } n.Operand = Operand{Type: t.Result} // 2. If the expression that denotes the called function has a // type that includes a prototype, the number of arguments // shall agree with the number of parameters. Each argument // shall have a type such that its value may be assigned to an // object with the unqualified version of the type of its // corresponding parameter. params := t.Params var voidParams bool if voidParams = len(params) == 1 && params[0].Kind() == Void; voidParams { params = nil } switch { case voidParams && len(args) != 0: panic(fmt.Errorf("%v: %v args %v params %v variadic %v voidParams %v", ctx.position(n), n.Case, len(args), len(params), t.Variadic, voidParams)) case len(args) < len(params): panic(fmt.Errorf("%v: %v args %v params %v variadic %v voidParams %v", ctx.position(n), n.Case, len(args), len(params), t.Variadic, voidParams)) case len(args) == len(params): for i, rhs := range args { switch { case rhs.Type.Kind() == Ptr && t.Params[i].IsIntegerType(): ops[i] = rhs.ConvertTo(ctx.model, t.Params[i]) default: ops[i] = AdjustedParameterType(t.Params[i]).assign(ctx, n, rhs) } } // len(args) > len(params) case t.Variadic: for i, rhs := range args { switch { case i >= len(t.Params): ops[i] = ctx.model.defaultArgumentPromotion(rhs) case rhs.Type.Kind() == Ptr && t.Params[i].IsIntegerType(): ops[i] = rhs.ConvertTo(ctx.model, t.Params[i]) default: ops[i] = AdjustedParameterType(t.Params[i]).assign(ctx, n, rhs) } } case len(params) == 0: for i, rhs := range args { ops[i] = ctx.model.defaultArgumentPromotion(rhs) } default: panic(fmt.Errorf("%v: %v args %v params %v variadic %v voidParams %v", ctx.position(n), n.Case, len(args), len(params), t.Variadic, voidParams)) } for i, v := range ops { if v.Value != nil { ops[i] = v.ConvertTo(ctx.model, ops[i].Type) } } case ExprMul: // Expr '*' Expr n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).mul(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) case ExprAdd: // Expr '+' Expr lhs := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) rhs := n.Expr2.eval(ctx, arr2ptr, fn, seq, sc) // [0]6.5.6 // // For addition, either both operands shall have arithmetic // type, or one operand shall be a pointer to an object type // and the other shall have integer type. (Incrementing is // equivalent to adding 1.) switch { case lhs.isArithmeticType() && rhs.isArithmeticType(): n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).add(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) case lhs.isPointerType() && rhs.isIntegerType(): n.Operand = lhs n.Operand.Value = nil case lhs.isIntegerType() && rhs.isPointerType(): n.Operand = rhs n.Operand.Value = nil default: panic(ctx.position(n)) } case ExprSub: // Expr '-' Expr // [0]6.5.6 lhs := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) rhs := n.Expr2.eval(ctx, arr2ptr, fn, seq, sc) switch { // 3. For subtraction, one of the following shall hold: case // both operands have arithmetic type; lhs.isArithmeticType() && rhs.isArithmeticType(): n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).sub(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) if n.Operand.Type.IsIntegerType() && n.Expr.Equals(n.Expr2) { n.Operand.Value = &ir.Int64Value{Value: 0} } case // both operands are pointers to qualified or // unqualified versions of compatible object types; lhs.isPointerType() && rhs.isPointerType() && (lhs.Type.IsCompatible(rhs.Type) || ctx.tweaks.EnablePointerCompatibility): n.Operand = Operand{Type: ctx.ptrDiff()} if rhs.IsZero() { n.Operand.Value = lhs.Value } case // the left operand is a pointer to an object type and // the right operand has integer type. lhs.isPointerType() && rhs.isIntegerType(): n.Operand = lhs default: //dbg("", lhs, rhs) panic(ctx.position(n)) } case ExprDiv: // Expr '/' Expr n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).div(ctx, n, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) // [0]6.5.5 case ExprLt: // Expr '<' Expr n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).lt(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) if n.Expr.Equals(n.Expr2) { n.Operand = Operand{Type: Int, Value: &ir.Int64Value{Value: 0}} } case ExprAssign: // Expr '=' Expr n.Expr.AssignedTo = true n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc) if d := n.Expr.Declarator; d != nil { d.AssignedTo++ if n.Expr.Case == ExprIdent { n.Operand.Type = d.Type } } switch x := underlyingType(n.Operand.Type, true).(type) { case *EnumType: n.Expr2.enum = x } rhs := n.Expr2.eval(ctx, arr2ptr, fn, seq, sc) n.Operand.Type.assign(ctx, n, rhs) case ExprGt: // Expr '>' Expr n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).gt(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) if n.Expr.Equals(n.Expr2) { n.Operand = Operand{Type: Int, Value: &ir.Int64Value{Value: 0}} } case ExprCond: // Expr '?' ExprList ':' Expr // [0]6.5.15 cond := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) // 2. The first operand shall have scalar type. if !cond.isScalarType() { panic(ctx.position(n)) } switch { case cond.IsNonZero(): n.Operand = n.ExprList.eval(ctx, arr2ptr, fn, seq, sc) break outer case cond.IsZero(): n.Operand = n.Expr2.eval(ctx, arr2ptr, fn, seq, sc) break outer } a := n.ExprList.eval(ctx, arr2ptr, fn, seq, sc) b := n.Expr2.eval(ctx, arr2ptr, fn, seq, sc) switch { // 3. One of the following shall hold for the second and third // operands: case // both operands have arithmetic type; a.isArithmeticType() && b.isArithmeticType(): // 5. If both the second and third operands have // arithmetic type, the result type that would be // determined by the usual arithmetic conversions, were // they applied to those two operands, is the type of // the result. x, _ := UsualArithmeticConversions(ctx.model, a, b) n.Operand = Operand{Type: x.Type} case // both operands have the same structure or union type a.Type.Kind() == Struct && b.Type.Kind() == Struct && a.Type.Equal(b.Type), a.Type.Kind() == Union && b.Type.Kind() == Union && a.Type.Equal(b.Type): n.Operand = Operand{Type: a.Type} case // both operands are pointers to qualified or // unqualified versions of compatible types; a.isPointerType() && b.isPointerType() && (a.Type.IsCompatible(b.Type) || ctx.tweaks.EnablePointerCompatibility): n.Operand = Operand{Type: a.Type} case // one operand is a pointer and the other is a null pointer constant a.isNullPtrConst() && b.isPointerType(): n.Operand = Operand{Type: b.Type} if cond.IsNonZero() { n.Operand.Value = Null } case // one operand is a pointer and the other is a null pointer constant a.isPointerType() && b.isNullPtrConst(): n.Operand = Operand{Type: a.Type} if cond.IsZero() { n.Operand.Value = Null } case a.Type.Kind() == Void && b.Type.Kind() == Void: // assert n.Operand = Operand{Type: Void} default: panic(fmt.Errorf("%v: %v, %v", ctx.position(n), a, b)) } case ExprIndex: // Expr '[' ExprList ']' // [0]6.5.2.1 op := n.Expr.eval(ctx, arr2ptr, fn, seq, sc) index := n.ExprList.eval(ctx, true, fn, seq, sc) switch t := op.Type.(type) { case *ArrayType: if arr2ptr { panic("internal error") } n.Operand = Operand{Type: t.Item} case *PointerType: n.Operand = Operand{Type: t.Item} case *NamedType: n.Operand = Operand{Type: t.Type} case TypeKind: if !t.IsIntegerType() { panic(fmt.Errorf("%v: %T %v", ctx.position(n), t, t)) } r := UnderlyingType(index.Type) switch { case r.IsPointerType(): n.Operand = Operand{Type: r.(*PointerType).Item} default: panic(fmt.Errorf("%v: %v[%v]", ctx.position(n), op.Type, index)) } default: panic(fmt.Errorf("%v: %T %v", ctx.position(n), t, t)) } if !index.isIntegerType() { l := UnderlyingType(op.Type) switch { case l.IsIntegerType() && index.isPointerType(): n.Operand = Operand{Type: UnderlyingType(index.Type).(*PointerType).Item} default: panic(fmt.Errorf("%v: %v[%v]", ctx.position(n), op.Type, index)) } } if d := n.Expr.Declarator; d != nil { d.Referenced++ } case ExprXor: // Expr '^' Expr n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).xor(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) if n.Expr.Equals(n.Expr2) { n.Operand.Value = &ir.Int64Value{Value: 0} } case ExprOr: // Expr '|' Expr n.Operand = n.Expr.eval(ctx, arr2ptr, fn, seq, sc).or(ctx, n.Expr2.eval(ctx, arr2ptr, fn, seq, sc)) case ExprFloat: // FLOATCONST n.floatConst(ctx) case ExprIdent: // IDENTIFIER builtin := false // [0]6.5.1 nm := n.Token.Val var nm2 int if ctx.tweaks.EnableImplicitBuiltins { nm2 = dict.SID("__builtin_" + string(dict.S(nm))) if n.Scope.LookupIdent(nm2) != nil { builtin = true } } if n.Scope.LookupIdent(nm) == nil { if n.enum != nil { if c := n.enum.find(nm); c != nil { n.Operand = c.Operand return n.Operand } } switch { case builtin: nm = nm2 default: if !ctx.tweaks.EnableImplicitDeclarations { panic(fmt.Errorf("%v: undefined %q", ctx.position(n), dict.S(nm))) } } } switch x := n.Scope.LookupIdent(nm).(type) { case *Declarator: x.IsBuiltin = builtin n.Declarator = x if arr2ptr { x.Referenced++ } t := x.Type t0 := t more2: switch y := t.(type) { case *ArrayType: if !x.IsFunctionParameter && y.Size.Type == nil { switch { case x.IsTLD() && x.DeclarationSpecifier.IsExtern(): // ok default: panic(fmt.Errorf("%v: %s has incomplete type: %v", ctx.position(x), dict.S(x.Name()), t0)) } } n.Operand = Operand{Type: t0} case *EnumType, *PointerType, *StructType, *TaggedEnumType, *TaggedStructType, *TaggedUnionType, *UnionType: n.Operand = Operand{Type: t0} case *FunctionType: n.Operand = Operand{Type: t0} if nm == idBuiltinAlloca { fn.Alloca = true } case *NamedType: t = y.Type goto more2 case TypeKind: switch y { case Bool, Char, Double, DoubleComplex, Float, FloatComplex, Int, Long, LongDouble, LongDoubleComplex, LongLong, SChar, Short, UChar, UInt, ULong, ULongLong, UShort: n.Operand = Operand{Type: t0} default: //dbg("", ctx.position(n)) panic(y) } default: //dbg("", ctx.position(n)) panic(y) } case *EnumerationConstant: n.Operand = x.Operand case nil: if ctx.tweaks.EnableImplicitDeclarations { return Operand{} } panic(fmt.Errorf("%v: undefined: %q", ctx.position(n), dict.S(nm))) default: //dbg("%s", dict.S(nm)) panic(fmt.Errorf("%v: %T", ctx.position(n), x)) } case ExprInt: // INTCONST s0 := string(dict.S(n.Token.Val)) s := s0 if strings.Contains(s, "p") { n.Case = ExprFloat n.floatConst(ctx) break } loop: for i := len(s) - 1; i > 0; i-- { switch s0[i] { case 'l', 'L', 'u', 'U': s = s[:i] default: break loop } } decadic := s == "0" || !strings.HasPrefix(s, "0") v, err := strconv.ParseUint(s, 0, 64) if err != nil { if ctx.tweaks.EnableBinaryLiterals && (strings.HasPrefix(s, "0b") || strings.HasPrefix(s, "0B")) { decadic = false v, err = strconv.ParseUint(s[2:], 2, 64) } if err != nil { panic(fmt.Errorf("%v: %v %v", ctx.position(n), n.Case, err)) } } // [0]6.4.4.1 switch suff := strings.ToUpper(s0[len(s):]); { case suff == "" && decadic: n.Operand = newIntConst(ctx, n, v, Int, Long, LongLong) case suff == "" && !decadic: n.Operand = newIntConst(ctx, n, v, Int, UInt, Long, ULong, LongLong, ULongLong) case suff == "U": n.Operand = newIntConst(ctx, n, v, UInt, ULong, ULongLong) case suff == "L" && decadic: n.Operand = newIntConst(ctx, n, v, Long, LongLong) case suff == "L" && !decadic: n.Operand = newIntConst(ctx, n, v, Long, ULong, LongLong, ULongLong) case suff == "UL", suff == "LU": n.Operand = newIntConst(ctx, n, v, ULong, ULongLong) case suff == "LL" && decadic: n.Operand = newIntConst(ctx, n, v, LongLong) case suff == "LL" && !decadic: n.Operand = newIntConst(ctx, n, v, LongLong, ULongLong) case suff == "ULL", suff == "LLU": n.Operand = newIntConst(ctx, n, v, ULongLong) default: panic(fmt.Errorf("%v: TODO %q %q decadic: %v\n%s", ctx.position(n), s, suff, decadic, PrettyString(n))) } case ExprLChar: // LONGCHARCONST n.Operand = ctx.charConst(n.Token) case ExprLString: // LONGSTRINGLITERAL n.Operand = ctx.strConst(n.Token) case ExprString: // STRINGLITERAL n.Operand = ctx.strConst(n.Token) case ExprStatement: // '(' CompoundStmt ')' n.Operand = n.CompoundStmt.check(ctx, fn, seq, sc, nil, false) default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } if !arr2ptr { return n.Operand } // [0]6.3.2.1 // // 3. Except when it is the operand of the sizeof operator or // the unary & operator, or is a string literal used to // initialize an array, an expression that has type ‘‘array of // type’’ is converted to an expression with type ‘‘pointer to // type’’ that points to the initial element of the array // object and is not an lvalue. If the array object has // register storage class, the behavior is undefined. t := n.Operand.Type for { switch x := t.(type) { case *ArrayType: n.Operand.Type = &PointerType{x.Item} return n.Operand case *FunctionType: n.Operand.Type = &PointerType{x} return n.Operand case *NamedType: t = x.Type case *EnumType, *PointerType, *StructType, *TaggedEnumType, *TaggedStructType, *TaggedUnionType, *UnionType: return n.Operand case TypeKind: switch x { case Bool, Char, Double, DoubleComplex, Float, FloatComplex, Int, Long, LongDouble, LongDoubleComplex, LongLong, SChar, Short, UChar, UInt, ULong, ULongLong, UShort, Void: return n.Operand default: //dbg("", ctx.position(n)) panic(x) } case nil: if ctx.tweaks.EnableImplicitDeclarations { return n.Operand } panic(fmt.Errorf("%v: %T", ctx.position(n), x)) default: //dbg("", ctx.position(n)) panic(fmt.Errorf("%T", x)) } } } func (n *Expr) floatConst(ctx *context) { s0 := string(dict.S(n.Token.Val)) s := s0 loop2: for i := len(s) - 1; i > 0; i-- { switch s0[i] { case 'l', 'L', 'f', 'F': s = s[:i] default: break loop2 } } var v float64 var err error switch { case strings.Contains(s, "p"): var bf *big.Float bf, _, err = big.ParseFloat(s, 0, 53, big.ToNearestEven) if err == nil { v, _ = bf.Float64() } default: v, err = strconv.ParseFloat(s, 64) } if err != nil { switch { case !strings.HasPrefix(s, "-") && strings.Contains(err.Error(), "value out of range"): // linux_386/usr/include/math.h // // /* Value returned on overflow. With IEEE 754 floating point, this is // +Infinity, otherwise the largest representable positive value. */ // #if __GNUC_PREREQ (3, 3) // # define HUGE_VAL (__builtin_huge_val ()) // #else // /* This may provoke compiler warnings, and may not be rounded to // +Infinity in all IEEE 754 rounding modes, but is the best that can // be done in ISO C while remaining a constant expression. 10,000 is // greater than the maximum (decimal) exponent for all supported // floating-point formats and widths. */ // # define HUGE_VAL 1e10000 // #endif v = math.Inf(1) default: panic(fmt.Errorf("%v: %v", ctx.position(n), err)) } } // [0]6.4.4.2 switch suff := strings.ToUpper(s0[len(s):]); suff { case "", "l", "L": n.Operand = Operand{Type: Double, Value: &ir.Float64Value{Value: v}} case "f", "F": n.Operand = Operand{Type: Float, Value: &ir.Float32Value{Value: float32(v)}} default: panic(fmt.Errorf("%v: TODO %q %q %v", ctx.position(n), s, suff, v)) } } func checkFn(ctx *context, t Type) *FunctionType { // 1. The expression that denotes the called function 80) shall // have type pointer to function returning void or returning an // object type other than an array type. for { switch x := t.(type) { case *FunctionType: return x case *NamedType: t = x.Type case *PointerType: switch x := x.Item.(type) { case *FunctionType: return x case *NamedType: t = x.Type default: panic(fmt.Errorf("%T", x)) } case nil: return nil default: panic(fmt.Errorf("%T", x)) } } } func (n *ArgumentExprListOpt) eval(ctx *context, fn *Declarator, seq *int, sc []int) []Operand { if n == nil { return nil } return n.ArgumentExprList.eval(ctx, fn, seq, sc) } func (n *ArgumentExprList) eval(ctx *context, fn *Declarator, seq *int, sc []int) (r []Operand) { for ; n != nil; n = n.ArgumentExprList { r = append(r, n.Expr.eval(ctx, true, fn, seq, sc)) } return r } func (n *TypeName) check(ctx *context) Type { // SpecifierQualifierList AbstractDeclaratorOpt ds := &DeclarationSpecifier{} n.SpecifierQualifierList.check(ctx, ds) if n.AbstractDeclaratorOpt == nil { n.Type = ds.typ(ctx) return n.Type } n.AbstractDeclaratorOpt.check(ctx, ds, ds.typ(ctx)) n.Type = n.AbstractDeclaratorOpt.AbstractDeclarator.Type return n.Type } func (n *ExprListOpt) eval(ctx *context, arr2ptr bool, fn *Declarator, seq *int, sc []int) Operand { if n == nil { return Operand{} } return n.ExprList.eval(ctx, arr2ptr, fn, seq, sc) } func (n *ExprList) eval(ctx *context, arr2ptr bool, fn *Declarator, seq *int, sc []int) Operand { if n.Operand.Type == nil { for l := n; l != nil; l = l.ExprList { n.Operand = l.Expr.eval(ctx, arr2ptr, fn, seq, sc) } } return n.Operand } func (n *ExprList) declarator(ctx *context) (r *Declarator) { for l := n; ; l = l.ExprList { if l.ExprList == nil { return l.Expr.Declarator } } } func (n *ExprOpt) eval(ctx *context, arr2ptr bool, fn *Declarator, seq *int, sc []int) Operand { if n == nil { return Operand{} } return n.Expr.eval(ctx, arr2ptr, fn, seq, sc) } // Name returns the ID of the declared name. func (n *Declarator) Name() int { return n.DirectDeclarator.nm() } func (n *DirectDeclarator) nm() int { switch n.Case { case DirectDeclaratorArray, DirectDeclaratorArraySize, DirectDeclaratorArrayVar, DirectDeclaratorIdentList, DirectDeclaratorParamList: return n.DirectDeclarator.nm() case DirectDeclaratorIdent: return n.Token.Val case DirectDeclaratorParen: return n.Declarator.Name() default: panic(fmt.Errorf("TODO %v", n.Case)) } } func (n *ExternalDeclarationList) check(ctx *context) (err error) { for ; n != nil; n = n.ExternalDeclarationList { n.ExternalDeclaration.check(ctx) } return nil } func (n *ExternalDeclaration) check(ctx *context) { switch n.Case { case ExternalDeclarationDecl: // Declaration n.Declaration.check(ctx, nil, nil, nil, nil, false) case ExternalDeclarationFunc: // FunctionDefinition n.FunctionDefinition.check(ctx) default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } // LocalVariables returns all local variables declared in a function in the // order of appearance. The result does not include function parameters. func (n *FunctionDefinition) LocalVariables() []*Declarator { return n.Declarator.vars } func (n *FunctionDefinition) check(ctx *context) { ds := &DeclarationSpecifier{} switch n.Case { case FunctionDefinitionSpec: // DeclarationSpecifiers Declarator DeclarationListOpt FunctionBody n.DeclarationSpecifiers.check(ctx, ds) if len(ds.TypeSpecifiers) == 0 { // [0]6.7.2-2 ds.typeSpecifiers = []TypeSpecifierCase{TypeSpecifierInt} } case FunctionDefinitionInt: // Declarator DeclarationListOpt FunctionBody ds.typeSpecifiers = []TypeSpecifierCase{TypeSpecifierInt} default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } switch o := n.DeclarationListOpt; { case o != nil: sc := n.Declarator.fpScope(ctx) params := n.DeclarationListOpt.check(ctx, sc) n.Declarator.check0(ctx, ds, ds.typ(ctx), false, nil, nil, params) if n.Declarator.Type.Kind() != Function { panic("TODO") } d := n.Declarator n.FunctionBody.check(ctx, n.Declarator) for _, v := range d.ParameterNames() { p, _ := sc.Idents[v].(*Declarator) p.IsFunctionParameter = true d.Parameters = append(d.Parameters, p) } default: n.Declarator.check(ctx, ds, ds.typ(ctx), false, nil, nil) if n.Declarator.Type.Kind() != Function { panic("TODO") } d := n.Declarator sc := d.fpScope(ctx) n.FunctionBody.check(ctx, n.Declarator) for _, v := range d.ParameterNames() { p, _ := sc.Idents[v].(*Declarator) d.Parameters = append(d.Parameters, p) } } } func (n *DeclarationListOpt) check(ctx *context, scope *Scope) (r []*Declarator) { if n == nil { return } for l := n.DeclarationList; l != nil; l = l.DeclarationList { r = append(r, l.Declaration.check(ctx, nil, nil, nil, scope, true)...) } return r } func (n *FunctionBody) check(ctx *context, fn *Declarator) { // CompoundStmt *CompoundStmt seq := -1 n.CompoundStmt.check(ctx, fn, &seq, nil, nil, false) } func (n *CompoundStmt) check(ctx *context, fn *Declarator, seq *int, sc []int, inSwitch *SelectionStmt, inLoop bool) Operand { // '{' BlockItemListOpt '}' *seq++ sc = append(sc, *seq) if *seq == 0 { // Pull function parameters into the outermost block scope. for _, v := range fn.fpScope(ctx).Idents { d := v.(*Declarator) nm := d.Name() if ex := n.scope.Idents[nm]; ex != nil { panic("TODO") // redeclared } n.scope.insertDeclarator(ctx, d) } } return n.BlockItemListOpt.check(ctx, fn, seq, sc, inSwitch, inLoop) } func (n *Declarator) fpScope(ctx *context) *Scope { return n.DirectDeclarator.fpScope(ctx) } func (n *DirectDeclarator) fpScope(ctx *context) *Scope { switch n.Case { //TODO case DirectDeclaratorParen: // '(' Declarator ')' case DirectDeclaratorIdentList: // DirectDeclarator '(' IdentifierListOpt ')' switch n.DirectDeclarator.Case { case DirectDeclaratorIdent: return n.paramScope default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.DirectDeclarator.Case)) } case DirectDeclaratorParamList: // DirectDeclarator '(' ParameterTypeList ')' switch n.DirectDeclarator.Case { case DirectDeclaratorParen: if n.DirectDeclarator.Declarator.DirectDeclarator.Case == DirectDeclaratorIdent { return n.paramScope } return n.DirectDeclarator.Declarator.DirectDeclarator.fpScope(ctx) case DirectDeclaratorIdent: return n.paramScope default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.DirectDeclarator.Case)) } //TODO case DirectDeclaratorArraySize: // DirectDeclarator '[' "static" TypeQualifierListOpt Expr ']' //TODO case DirectDeclaratorArraySize2: // DirectDeclarator '[' TypeQualifierList "static" Expr ']' //TODO case DirectDeclaratorArrayVar: // DirectDeclarator '[' TypeQualifierListOpt '*' ']' //TODO case DirectDeclaratorArray: // DirectDeclarator '[' TypeQualifierListOpt ExprOpt ']' //TODO case DirectDeclaratorIdent: // IDENTIFIER default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } // ParameterNames returns a list of IDs of names of parameters of n. The // function panics if n is not function type. func (n *Declarator) ParameterNames() []int { return n.DirectDeclarator.parameterNames() } func (n *DirectDeclarator) parameterNames() (r []int) { switch n.Case { //TODO case DirectDeclaratorParen: // '(' Declarator ')' case DirectDeclaratorIdentList: // DirectDeclarator '(' IdentifierListOpt ')' switch n.DirectDeclarator.Case { case DirectDeclaratorIdent: return n.IdentifierListOpt.check() default: panic(n.DirectDeclarator.Case) } case DirectDeclaratorParamList: // DirectDeclarator '(' ParameterTypeList ')' switch n.DirectDeclarator.Case { case DirectDeclaratorIdent: for l := n.ParameterTypeList.ParameterList; l != nil; l = l.ParameterList { switch n := l.ParameterDeclaration; n.Case { case ParameterDeclarationAbstract: // DeclarationSpecifiers AbstractDeclaratorOpt r = append(r, 0) case ParameterDeclarationDeclarator: // DeclarationSpecifiers Declarator r = append(r, n.Declarator.Name()) default: panic(n.Case) } } return r case DirectDeclaratorParen: if n.DirectDeclarator.Declarator.DirectDeclarator.Case == DirectDeclaratorIdent { for l := n.ParameterTypeList.ParameterList; l != nil; l = l.ParameterList { switch n := l.ParameterDeclaration; n.Case { case ParameterDeclarationAbstract: // DeclarationSpecifiers AbstractDeclaratorOpt r = append(r, 0) case ParameterDeclarationDeclarator: // DeclarationSpecifiers Declarator r = append(r, n.Declarator.Name()) default: panic(n.Case) } } return r } return n.DirectDeclarator.Declarator.DirectDeclarator.parameterNames() default: panic(n.DirectDeclarator.Case) } //TODO case DirectDeclaratorArraySize: // DirectDeclarator '[' "static" TypeQualifierListOpt Expr ']' //TODO case DirectDeclaratorArraySize2: // DirectDeclarator '[' TypeQualifierList "static" Expr ']' //TODO case DirectDeclaratorArrayVar: // DirectDeclarator '[' TypeQualifierListOpt '*' ']' //TODO case DirectDeclaratorArray: // DirectDeclarator '[' TypeQualifierListOpt ExprOpt ']' //TODO case DirectDeclaratorIdent: // IDENTIFIER default: panic(n.Case) } } func (n *BlockItemListOpt) check(ctx *context, fn *Declarator, seq *int, sc []int, inSwitch *SelectionStmt, inLoop bool) Operand { if n == nil { return Operand{Type: Void} } return n.BlockItemList.check(ctx, fn, seq, sc, inSwitch, inLoop) } func (n *BlockItemList) check(ctx *context, fn *Declarator, seq *int, sc []int, inSwitch *SelectionStmt, inLoop bool) (r Operand) { for ; n != nil; n = n.BlockItemList { op := n.BlockItem.check(ctx, fn, seq, sc, inSwitch, inLoop) if n.BlockItemList == nil { r = op } } return r } func (n *BlockItem) check(ctx *context, fn *Declarator, seq *int, sc []int, inSwitch *SelectionStmt, inLoop bool) (r Operand) { r = Operand{Type: Void} switch n.Case { case BlockItemDecl: // Declaration n.Declaration.check(ctx, seq, sc, fn, nil, false) case BlockItemStmt: // Stmt r = n.Stmt.check(ctx, fn, seq, sc, inSwitch, inLoop) default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } return r } func (n *Stmt) check(ctx *context, fn *Declarator, seq *int, sc []int, inSwitch *SelectionStmt, inLoop bool) (r Operand) { r = Operand{Type: Void} switch n.Case { case StmtBlock: // CompoundStmt n.CompoundStmt.check(ctx, fn, seq, sc, inSwitch, inLoop) case StmtExpr: // ExprStmt r = n.ExprStmt.check(ctx, fn, seq, sc) case StmtIter: // IterationStmt n.IterationStmt.check(ctx, fn, seq, sc, inSwitch, inLoop) case StmtJump: // JumpStmt n.JumpStmt.check(ctx, fn, seq, sc, inSwitch, inLoop) case StmtLabeled: // LabeledStmt n.LabeledStmt.check(ctx, fn, seq, sc, inSwitch, inLoop) case StmtSelect: // SelectionStmt n.SelectionStmt.check(ctx, fn, seq, sc, inSwitch, inLoop) default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } return r } func (n *LabeledStmt) check(ctx *context, fn *Declarator, seq *int, sc []int, inSwitch *SelectionStmt, inLoop bool) { //[0]6.8.1 switch n.Case { case LabeledStmtSwitchCase: // "case" ConstExpr ':' Stmt op := n.ConstExpr.eval(ctx).ConvertTo(ctx.model, inSwitch.SwitchOp.Type) n.ConstExpr.Operand = op if op.Value == nil { panic("TODO") } if inSwitch == nil { panic("TODO") } inSwitch.Cases = append(inSwitch.Cases, n) n.Stmt.check(ctx, fn, seq, sc, inSwitch, inLoop) case LabeledStmtDefault: // "default" ':' Stmt if inSwitch == nil { panic("TODO") } inSwitch.Cases = append(inSwitch.Cases, n) n.Stmt.check(ctx, fn, seq, sc, inSwitch, inLoop) case LabeledStmtLabel: // IDENTIFIER ':' Stmt n.Stmt.check(ctx, fn, seq, sc, inSwitch, inLoop) case LabeledStmtLabel2: // TYPEDEF_NAME ':' Stmt n.Stmt.check(ctx, fn, seq, sc, inSwitch, inLoop) default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *SelectionStmt) check(ctx *context, fn *Declarator, seq *int, sc []int, inSwitch *SelectionStmt, inLoop bool) { switch n.Case { case SelectionStmtIfElse: // "if" '(' ExprList ')' Stmt "else" Stmt if !n.ExprList.eval(ctx, true, fn, seq, sc).isScalarType() { panic("TODO") } n.Stmt.check(ctx, fn, seq, sc, inSwitch, inLoop) n.Stmt2.check(ctx, fn, seq, sc, inSwitch, inLoop) case SelectionStmtIf: // "if" '(' ExprList ')' Stmt if !n.ExprList.eval(ctx, true, fn, seq, sc).isScalarType() { panic("TODO") } n.Stmt.check(ctx, fn, seq, sc, inSwitch, inLoop) case SelectionStmtSwitch: // "switch" '(' ExprList ')' Stmt // [0]6.8.4.2 if !n.ExprList.eval(ctx, true, fn, seq, sc).isIntegerType() { panic("TODO") } n.SwitchOp = n.ExprList.Operand.integerPromotion(ctx.model) n.Stmt.check(ctx, fn, seq, sc, n, inLoop) default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *IterationStmt) check(ctx *context, fn *Declarator, seq *int, sc []int, inSwitch *SelectionStmt, inLoop bool) { switch n.Case { case IterationStmtDo: // "do" Stmt "while" '(' ExprList ')' ';' if !n.ExprList.eval(ctx, true, fn, seq, sc).isScalarType() { panic(ctx.position) } n.Stmt.check(ctx, fn, seq, sc, inSwitch, true) case IterationStmtForDecl: // "for" '(' Declaration ExprListOpt ';' ExprListOpt ')' Stmt n.Declaration.check(ctx, seq, sc, fn, n.Declaration.Scope, false) n.ExprListOpt.eval(ctx, true, fn, seq, sc) if e := n.ExprListOpt.eval(ctx, true, fn, seq, sc); e.Type != nil && !e.isScalarType() { panic(ctx.position(n)) } n.ExprListOpt2.eval(ctx, true, fn, seq, sc) n.Stmt.check(ctx, fn, seq, sc, inSwitch, true) case IterationStmtFor: // "for" '(' ExprListOpt ';' ExprListOpt ';' ExprListOpt ')' Stmt // [0]6.8.5.3 n.ExprListOpt.eval(ctx, true, fn, seq, sc) if e := n.ExprListOpt2.eval(ctx, true, fn, seq, sc); e.Type != nil && !e.isScalarType() { panic(ctx.position(n)) } n.ExprListOpt3.eval(ctx, true, fn, seq, sc) n.Stmt.check(ctx, fn, seq, sc, inSwitch, true) case IterationStmtWhile: // "while" '(' ExprList ')' Stmt if e := n.ExprList.eval(ctx, true, fn, seq, sc); e.Type != nil && !e.isScalarType() { panic(ctx.position(n)) } n.Stmt.check(ctx, fn, seq, sc, inSwitch, true) default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *JumpStmt) check(ctx *context, fn *Declarator, seq *int, sc []int, inSwitch *SelectionStmt, inLoop bool) { switch n.Case { case JumpStmtBreak: // "break" ';' // [0]6.8.6.3 // // 1. A break statement shall appear only in or as a switch // body or loop body. if inSwitch == nil && !inLoop { panic(ctx.position) } case JumpStmtContinue: // "continue" ';' // [0]6.8.6.2 // // 1. A continue statement shall appear only in or as a loop // body. if !inLoop { panic(ctx.position(n)) } case JumpStmtGoto: // "goto" IDENTIFIER ';' if nm := n.Token2.Val; n.scope.LookupLabel(nm) == nil { panic(ctx.position(n)) } case JumpStmtReturn: // "return" ExprListOpt ';' // [0]6.8.6.4 op := n.ExprListOpt.eval(ctx, true, fn, seq, sc) switch t := fn.Type.(*FunctionType).Result; t.Kind() { case Void: if op.Type != nil { if ctx.tweaks.EnableReturnExprInVoidFunc { break } panic(ctx.position(n)) } default: if op.Type == nil { panic(ctx.position(n)) } n.ReturnOperand = op.ConvertTo(ctx.model, t) } default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *ExprStmt) check(ctx *context, fn *Declarator, seq *int, sc []int) Operand { // ExprListOpt ';' return n.ExprListOpt.eval(ctx, true, fn, seq, sc) } func (n *Declaration) check(ctx *context, seq *int, sc []int, fn *Declarator, scope *Scope, fnParam bool) []*Declarator { // DeclarationSpecifiers InitDeclaratorListOpt ';' ds := &DeclarationSpecifier{} n.DeclarationSpecifiers.check(ctx, ds) if len(ds.TypeSpecifiers) == 0 { // [0]6.7.2-2 panic("TODO") } r := n.InitDeclaratorListOpt.check(ctx, ds, seq, sc, fn, scope) for _, v := range r { if fnParam { v.IsFunctionParameter = true continue } if v.Linkage == LinkageExternal && v.DeclarationSpecifier.IsExtern() { continue } switch x := UnderlyingType(v.Type).(type) { case *ArrayType: if x.Size.Type == nil { panic(fmt.Errorf("%v: %s has incomplete type: %v", ctx.position(v), dict.S(v.Name()), v.Type)) } } } return r } func (n *InitDeclaratorListOpt) check(ctx *context, ds *DeclarationSpecifier, seq *int, sc []int, fn *Declarator, scope *Scope) []*Declarator { if n == nil { return nil } return n.InitDeclaratorList.check(ctx, ds, seq, sc, fn, scope) } func (n *InitDeclaratorList) check(ctx *context, ds *DeclarationSpecifier, seq *int, sc []int, fn *Declarator, scope *Scope) (r []*Declarator) { for ; n != nil; n = n.InitDeclaratorList { r = append(r, n.InitDeclarator.check(ctx, ds, seq, sc, fn, scope)) } return r } func (n *InitDeclarator) check(ctx *context, ds *DeclarationSpecifier, seq *int, sc []int, fn *Declarator, scope *Scope) *Declarator { if scope != nil { n.Declarator.Scope = scope } switch n.Case { case InitDeclaratorBase: // Declarator n.Declarator.check(ctx, ds, ds.typ(ctx), !ds.IsTypedef(), sc, fn) case InitDeclaratorInit: // Declarator '=' Initializer if ds.IsTypedef() || ds.IsExtern() { panic(ctx.position(n)) // error } n.Declarator.Initializer = n.Initializer n.Declarator.check(ctx, ds, ds.typ(ctx), true, sc, fn) n.Initializer.check(ctx, n.Declarator.Type, fn, false, nil, seq, sc) if ex := n.Declarator.Scope.Idents[n.Declarator.Name()].(*Declarator); ex != nil && ex != n.Declarator { switch { case ex.Initializer == nil: ex.Initializer = n.Initializer default: if n.Initializer != nil { panic(fmt.Errorf("%v: existing initializer at %v", ctx.position(n), ctx.position(ex))) // More than one initializer } } } default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } return n.Declarator } func (n *Initializer) check(ctx *context, t Type, fn *Declarator, field bool, arr *ArrayType, seq *int, sc []int) (r Operand) { // [0]6.7.8 switch n.Case { case InitializerCompLit: // '{' InitializerList CommaOpt '}' return n.InitializerList.check(ctx, t, fn) case InitializerExpr: // Expr op := n.Expr.eval(ctx, true, fn, seq, sc) switch { case t.Kind() == Function && op.Type.IsPointerType() && UnderlyingType(op.Type).(*PointerType).Item.Kind() == Function: t.assign(ctx, n, op) return n.Expr.Operand case op.isPointerType() && !t.IsPointerType() && arr != nil: t = arr case t.IsScalarType(): // 11. The initializer for a scalar shall be a single // expression, optionally enclosed in braces. The // initial value of the object is that of the // expression (after conversion); the same type // constraints and conversions as for simple assignment // apply, taking the type of the scalar to be the // unqualified version of its declared type. t.assign(ctx, n, op) return n.Expr.Operand case op.IsZero(): switch k := UnderlyingType(t).Kind(); k { case Array, Struct, Union: return op default: panic(fmt.Errorf("%v: %v", ctx.position(n.Expr), k)) } } if t.Kind() == Struct || t.Kind() == Union { // 13. The initializer for a structure or union object // that has automatic storage duration shall be either // an initializer list as described below, or a single // expression that has compatible structure or union // type. In the latter case, the initial value of the // object, including unnamed members, is that of the // expression. if t.IsCompatible(op.Type) { return Operand{} } switch t.Kind() { case Union: x := UnderlyingType(t).(*UnionType) if x.Fields[0].Type.Kind() == Array && n.Expr.IsZero() { return op } if x.Fields[0].Type.IsCompatible(op.Type) { return op } } panic(fmt.Errorf("%v: typ %v, op type %v", ctx.position(n), t, op.Type)) } if t.Kind() == Array { at := UnderlyingType(t).(*ArrayType) it := at.Item switch x := it.(type) { case TypeKind: switch x { case Char, UChar: if op.isPointerType() && op.Type.(*PointerType).Item == Char { // 14. An array of character type may be initialized by // a character string literal, optionally enclosed in // braces. Successive characters of the character // string literal (including the terminating null // character if there is room or if the array is of // unknown size) initialize the elements of the array. x := t.(*ArrayType) if !field && x.Size.Type == nil { switch y := op.Value.(type) { case *ir.StringValue: x.Size = newIntConst(ctx, n, uint64(len(dict.S(int(y.StringID)))+1), UInt, ULong, ULongLong) default: panic(fmt.Errorf("%v: TODO", ctx.position(n))) } } return op } panic(fmt.Errorf("%v:", ctx.position(n))) default: panic(fmt.Errorf("%v:", ctx.position(n))) } case *NamedType: switch { case x.Name == idWcharT: if op.isPointerType() && op.Type.(*PointerType).Item == UnderlyingType(x) { // 14. An array of character type may be initialized by // a character string literal, optionally enclosed in // braces. Successive characters of the character // string literal (including the terminating null // character if there is room or if the array is of // unknown size) initialize the elements of the array. if !field && at.Size.Type == nil { switch y := op.Value.(type) { case *ir.WideStringValue: at.Size = newIntConst(ctx, n, uint64(len(y.Value)+1), UInt, ULong, ULongLong) default: panic(fmt.Errorf("%v: TODO", ctx.position(n))) } } return op } panic(fmt.Errorf("%v:", ctx.position(n))) default: panic(fmt.Errorf("%v:", ctx.position(n))) } case *ArrayType: at2 := UnderlyingType(it).(*ArrayType) switch UnderlyingType(at2.Item).Kind() { case Char, UChar: if op.isPointerType() && op.Type.(*PointerType).Item == Char { // 14. An array of character type may be initialized by // a character string literal, optionally enclosed in // braces. Successive characters of the character // string literal (including the terminating null // character if there is room or if the array is of // unknown size) initialize the elements of the array. if !field && at2.Size.Type == nil { switch y := op.Value.(type) { case *ir.StringValue: at2.Size = newIntConst(ctx, n, uint64(len(dict.S(int(y.StringID)))+1), UInt, ULong, ULongLong) default: panic(fmt.Errorf("%v: TODO", ctx.position(n))) } } return op } case Array: panic(fmt.Errorf("%v: TODO Initializer t %v, op %v", ctx.position(n), at2, op)) default: panic(fmt.Errorf("%v:", ctx.position(n))) } default: panic(fmt.Errorf("%v: %T", ctx.position(n), x)) } } panic(fmt.Errorf("%v: TODO Initializer t %v, op %v", ctx.position(n), t, op)) default: panic(fmt.Errorf("%v: TODO Initializer %v", ctx.position(n), n.Case)) } } func (n *InitializerList) check(ctx *context, t Type, fn *Declarator) Operand { // InitializerList: // /* empty */ // Case 0 // | Initializer // Case 1 // | Designation Initializer // Case 2 // | InitializerList ',' Initializer // Case 3 // | InitializerList ',' Designation Initializer // Case 4 r := &ir.CompositeValue{} n.Operand = Operand{Type: t, Value: r} n0 := n for { switch x := t.(type) { case *ArrayType: var index, maxIndex int64 = 0, -1 for ; n != nil; n = n.InitializerList { n0.Len++ if n.Designation != nil { dst, nt := n.Designation.check(ctx, x) _ = nt //TODO if len(dst) != 1 { panic(ctx.position(n)) } index = dst[0] switch nv := int64(len(r.Values)); { case nv < index: r.Values = append(r.Values, make([]ir.Value, index-nv)...) case nv > index: r.Values[index] = n.Initializer.check(ctx, x.Item, fn, false, x, nil, nil) index++ continue } } r.Values = append(r.Values, n.Initializer.check(ctx, x.Item, fn, false, x, nil, nil)) if index > maxIndex { maxIndex = index } index++ } if x.Size.Type == nil { x.Size = newIntConst(ctx, n0, uint64(maxIndex+1), UInt, ULong, ULongLong) } return Operand{Type: t, Value: r} case *NamedType: t = x.Type case *StructType: field := 0 for ; n != nil; n = n.InitializerList { if n.Designation != nil { dst, nt := n.Designation.check(ctx, x) field = int(dst[0]) if len(dst) != 1 { panic(fmt.Errorf("%v: %v %v", ctx.position(n), dst, nt)) } switch nv := len(r.Values); { case nv < field: r.Values = append(r.Values, make([]ir.Value, field-nv)...) case nv > field: r.Values[field] = n.Initializer.check(ctx, x.Fields[field].Type, fn, true, nil, nil, nil) field++ continue } } for x.Fields[field].Bits < 0 { field++ } switch { case field < len(x.Fields): r.Values = append(r.Values, n.Initializer.check(ctx, x.Fields[field].Type, fn, true, nil, nil, nil)) field++ default: panic(fmt.Errorf("%v: TODO", ctx.position(n.Initializer))) } n0.Len++ } return Operand{Type: t, Value: r} case *TaggedStructType: t = x.getType() if t == x { panic("TODO") } case *TaggedUnionType: t = x.getType() if t == x { panic("TODO") } case TypeKind: switch { case x.IsArithmeticType(): switch n.Case { case 0: // /* empty */ if x.IsIntegerType() { return Operand{Type: t, Value: &ir.Int64Value{}} } switch t { case Double, LongDouble: return Operand{Type: t, Value: &ir.Float64Value{}} case Float: return Operand{Type: t, Value: &ir.Float64Value{}} default: panic(fmt.Errorf("%v: %v", ctx.position(n), t)) } default: panic(fmt.Errorf("%v: %v", ctx.position(n), n.Case)) } default: panic("TODO") } case *UnionType: field := 0 for ; n != nil; n = n.InitializerList { if n.Designation != nil { dst, nt := n.Designation.check(ctx, x) _ = nt //TODO if len(dst) != 1 { panic(ctx.position(n)) } field = int(dst[0]) switch nv := len(r.Values); { case nv < field: r.Values = append(r.Values, make([]ir.Value, field-nv)...) case nv > field: r.Values[field] = n.Initializer.check(ctx, x.Fields[field].Type, fn, true, nil, nil, nil) field++ continue } } for x.Fields[field].Bits < 0 { field++ } switch { case field < len(x.Fields): r.Values = append(r.Values, n.Initializer.check(ctx, x.Fields[field].Type, fn, true, nil, nil, nil)) field++ default: panic(fmt.Errorf("%v: TODO", ctx.position(n.Initializer))) } n0.Len++ } return Operand{Type: t, Value: r} default: panic(fmt.Errorf("%v: TODO %T", ctx.position(n), x)) } } } func (n *Designation) check(ctx *context, t Type) (r []int64, nt Type) { switch x := underlyingType(t, true).(type) { case *ArrayType: nt = x.Item for l := n.DesignatorList; l != nil; l = l.DesignatorList { switch n := l.Designator; n.Case { case DesignatorField: // '.' IDENTIFIER panic("TODO") case DesignatorIndex: // '[' ConstExpr ']' op := n.ConstExpr.eval(ctx) switch x := op.Value.(type) { case *ir.Int64Value: if v := x.Value; v < mathutil.MinInt || v > mathutil.MaxInt { panic("TODO") } r = append(r, x.Value) default: panic(fmt.Errorf("%v: %T", ctx.position(n), x)) } default: panic("TODO") } } case *StructType: t := Type(x) for l := n.DesignatorList; l != nil; l = l.DesignatorList { switch n := l.Designator; n.Case { case DesignatorField: // '.' IDENTIFIER nm := n.Token2.Val var f *FieldProperties switch x := t.(type) { case *StructType: ctx.model.Layout(t) f = x.Field(nm) if f == nil || f.Type == nil { panic(fmt.Errorf("(C) %v: TODO %q", ctx.position(n.Token2), dict.S(nm))) } if fi := f.Declarator.Field; fi > len(x.Fields) || x.Fields[fi].Name != nm { panic("TODO") } case *UnionType: ctx.model.Layout(t) f = x.Field(nm) if f == nil || f.Type == nil { panic(fmt.Errorf("(C) %v: TODO %q", ctx.position(n.Token2), dict.S(nm))) } if fi := f.Declarator.Field; fi > len(x.Fields) || x.Fields[fi].Name != nm { panic("TODO") } default: panic(fmt.Errorf("%v", ctx.position(n))) } r = append(r, int64(f.Declarator.Field)) t = f.Type nt = t case DesignatorIndex: // '[' ConstExpr ']' op := n.ConstExpr.eval(ctx) switch x := UnderlyingType(t).(type) { case *ArrayType: nt = x.Item switch y := op.Value.(type) { case *ir.Int64Value: if x.Size.Value == nil { panic("TODO") } if y.Value >= x.Size.Value.(*ir.Int64Value).Value { panic("TODO") } r = append(r, y.Value) default: panic(fmt.Errorf("%v: %v %T %v", ctx.position(n), t, y, op)) } default: panic(fmt.Errorf("%v: %v %T %v", ctx.position(n), t, x, op)) } default: panic("TODO") } } case *UnionType: t := Type(x) for l := n.DesignatorList; l != nil; l = l.DesignatorList { switch n := l.Designator; n.Case { case DesignatorField: // '.' IDENTIFIER nm := n.Token2.Val var f *FieldProperties switch x := t.(type) { //TODO case *StructType: //TODO f = x.Field(nm) //TODO if f == nil || f.Type == nil { //TODO panic(fmt.Errorf("(C) %v: TODO %q", ctx.position(n.Token2), dict.S(nm))) //TODO } //TODO if fi := f.Declarator.Field; fi > len(x.Fields) || x.Fields[fi].Name != nm { //TODO panic("TODO") //TODO } case *UnionType: ctx.model.Layout(t) f = x.Field(nm) if f == nil || f.Type == nil { panic(fmt.Errorf("(C) %v: TODO %q", ctx.position(n.Token2), dict.S(nm))) } if fi := f.Declarator.Field; fi > len(x.Fields) || x.Fields[fi].Name != nm { panic("TODO") } default: panic(fmt.Errorf("%v: %T", ctx.position(n), x)) } r = append(r, int64(f.Declarator.Field)) t = f.Type nt = t //TODO case DesignatorIndex: // '[' ConstExpr ']' //TODO panic("TODO") default: panic(n.Case) } } if len(r) > 1 { panic("TODO") } default: panic(fmt.Errorf("%v: %T", ctx.position(n), x)) } n.List = r return r, nt } func (n *Declarator) check(ctx *context, ds *DeclarationSpecifier, t Type, isObject bool, sc []int, fn *Declarator) (r Type) { return n.check0(ctx, ds, t, isObject, sc, fn, nil) } func (n *Declarator) check0(ctx *context, ds *DeclarationSpecifier, t Type, isObject bool, sc []int, fn *Declarator, fnParams []*Declarator) (r Type) { // PointerOpt DirectDeclarator if l := len(sc); l != 0 { n.ScopeNum = sc[l-1] } n.DeclarationSpecifier = ds t = n.PointerOpt.check(ctx, t, &n.TypeQualifiers) n.Type = n.DirectDeclarator.check(ctx, t, sc, fn) isFunction := n.Type.Kind() == Function && !ds.IsTypedef() if fn != nil && !n.Embedded && !isFunction { fn.vars = append(fn.vars, n) } if isFunction && fnParams != nil { t := underlyingType(n.Type, true).(*FunctionType) if n := len(t.Params); n != 0 && n != len(fnParams) { panic("TODO") } n.Parameters = nil t.Params = make([]Type, len(fnParams)) outer: for _, v := range fnParams { nm := v.Name() for i, w := range t.params { if nm == w { v.IsFunctionParameter = true t.Params[i] = v.Type continue outer } } panic("TODO") } } if n.Embedded { return n.Type } // [0]6.2.2 switch { case // 3. If the declaration of a file scope identifier for an // object or a function contains the storage-class specifier // static, the identifier has internal linkage. (isObject || isFunction) && n.Scope == ctx.scope && ds.IsStatic(): n.Linkage = LinkageInternal case // 4. For an identifier declared with the storage-class // specifier extern in a scope in which a prior declaration of // that identifier is visible, if the prior declaration // specifies internal or external linkage, the linkage of the // identifier at the later declaration is the same as the // linkage specified at the prior declaration. If no prior // declaration is visible, or if the prior declaration // specifies no linkage, then the identifier has external // linkage. (isObject || isFunction) && ds.IsExtern(): n.Linkage = LinkageExternal case // 5. If the declaration of an identifier for a function has no // storage-class specifier, its linkage is determined exactly // as if it were declared with the storage-class specifier // extern. If the declaration of an identifier for an object // has file scope and no storage-class specifier, its linkage // is external. (isObject || isFunction) && (n.Scope == ctx.scope || isFunction) && len(ds.StorageClassSpecifiers) == 0: n.Linkage = LinkageExternal case // 6. The following identifiers have no linkage: an identifier // declared to be anything other than an object or a function; // an identifier declared to be a function parameter; a block // scope identifier for an object declared without the // storage-class specifier extern. !(isObject || isFunction), n.IsFunctionParameter, n.Scope != ctx.scope && !ds.IsExtern(): n.Linkage = LinkageNone default: panic(ctx.position(n)) } // [0]6.2.4 switch { case // 3. An object whose identifier is declared with external or // internal linkage, or with the storage-class specifier static // has static storage duration. Its lifetime is the entire // execution of the program and its stored value is initialized // only once, prior to program startup. n.Linkage == LinkageExternal, n.Linkage == LinkageInternal, ds.IsStatic(): n.StorageDuration = StorageDurationStatic case // 4. An object whose identifier is declared with no linkage // and without the storage-class specifier static has automatic // storage duration. n.Linkage == LinkageNone && !ds.IsStatic(): n.StorageDuration = StorageDurationAutomatic default: panic(ctx.position(n)) } if (ds.IsExtern() || isFunction) && n.Scope != ctx.scope { if ds.IsExtern() { n.insert(ctx, isFunction) } n.Scope = ctx.scope } n.insert(ctx, isFunction) return n.Type } func (n *Declarator) insert(ctx *context, isFunction bool) { nm := n.Name() switch ex := n.Scope.Idents[n.Name()]; ex := ex.(type) { case nil: n.Scope.insertDeclarator(ctx, n) case *Declarator: switch ex.Linkage { case LinkageNone: switch n.Linkage { case LinkageNone: if ex.DeclarationSpecifier.IsTypedef() && n.DeclarationSpecifier.IsTypedef() && ex.Type.IsCompatible(n.Type) { break } panic(fmt.Errorf("%v: %s %v, %v %v:", ctx.position(ex), dict.S(nm), ex.Type, n.Type, ctx.position(n))) default: panic(n.Linkage) } case LinkageExternal: switch n.Linkage { case LinkageExternal: if isFunction && (n.Scope.Parent != nil || n.FunctionDefinition == nil) { break } if !ex.Type.IsCompatible(n.Type) { if ex.Type.Kind() == Function && ex.FunctionDefinition == nil && n.FunctionDefinition != nil { if len(ex.Type.(*FunctionType).Params) == 0 { n.Scope.Idents[nm] = n break } } if !(n.Name() == idMain && n.Scope.Parent == nil && n.Type.Kind() == Function) { //IncompatibleTypeDiff(ex.Type, n.Type) //TODO- panic(fmt.Errorf("%v: %v\n%v: %v", ctx.position(ex), ex.Type, ctx.position(n), n.Type)) } break } if prefer(n) || !prefer(ex) { n.Scope.Idents[nm] = n } default: panic(fmt.Errorf("%v: %v %v %v:", ctx.position(n), n.Linkage, isFunction, ctx.position(ex))) } case LinkageInternal: switch n.Linkage { case LinkageInternal: if !ex.Type.IsCompatible(n.Type) { //IncompatibleTypeDiff(ex.Type, n.Type) //TODO- panic(fmt.Errorf("%v: %v\n%v: %v", ctx.position(ex), ex.Type, ctx.position(n), n.Type)) } case LinkageExternal: ex.Linkage = n.Linkage n.Scope.Idents[nm] = n default: // Keep it internal. } default: panic(ex.Linkage) } if isFunction { switch { case n.FunctionDefinition != nil: if ex.FunctionDefinition != nil { panic(ctx.position(n)) } ex.Definition = n n.Scope.Idents[nm] = n case ex.FunctionDefinition != nil: n.Definition = ex } break } switch { case n.Initializer != nil: if ex.Initializer != nil { panic(ctx.position(n)) } ex.Definition = n n.Scope.Idents[nm] = n case ex.Initializer != nil: n.Definition = ex } default: panic(ctx.position(n)) } } func (n *PointerOpt) check(ctx *context, t Type, tq *[]*TypeQualifier) Type { if n == nil { return t } return n.Pointer.check(ctx, t, tq) } func (n *Pointer) check(ctx *context, t Type, tq *[]*TypeQualifier) Type { n.TypeQualifierListOpt.check(ctx, tq) switch n.Case { case PointerBase: // '*' TypeQualifierListOpt return &PointerType{t} case PointerPtr: // '*' TypeQualifierListOpt Pointer return n.Pointer.check(ctx, &PointerType{t}, tq) default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *TypeQualifierListOpt) check(ctx *context, tq *[]*TypeQualifier) { if n == nil { return } n.TypeQualifierList.check(ctx, tq) } func (n *TypeQualifierList) check(ctx *context, tq *[]*TypeQualifier) { s := *tq for ; n != nil; n = n.TypeQualifierList { s = append(s, n.TypeQualifier) } *tq = s } func (n *DirectDeclarator) check(ctx *context, t Type, sc []int, fn *Declarator) Type { switch n.Case { case DirectDeclaratorParen: // '(' Declarator ')' return n.Declarator.check(ctx, nil, t, false, sc, fn) case DirectDeclaratorIdentList: // DirectDeclarator '(' IdentifierListOpt ')' t := &FunctionType{ params: n.IdentifierListOpt.check(), Result: t, } return n.DirectDeclarator.check(ctx, t, sc, fn) case DirectDeclaratorParamList: // DirectDeclarator '(' ParameterTypeList ')' fp, variadic := n.ParameterTypeList.check(ctx) t := &FunctionType{ Params: fp, Result: t, Variadic: variadic, } return n.DirectDeclarator.check(ctx, t, sc, fn) case DirectDeclaratorArraySize: // DirectDeclarator '[' "static" TypeQualifierListOpt Expr ']' var tq []*TypeQualifier n.TypeQualifierListOpt.check(ctx, &tq) sz := n.Expr.eval(ctx, true, fn, nil, nil) t := &ArrayType{ Item: t, Size: sz, TypeQualifiers: tq, } return n.DirectDeclarator.check(ctx, t, sc, fn) //TODO case DirectDeclaratorArraySize2: // DirectDeclarator '[' TypeQualifierList "static" Expr ']' case DirectDeclaratorArrayVar: // DirectDeclarator '[' TypeQualifierListOpt '*' ']' var tq []*TypeQualifier n.TypeQualifierListOpt.check(ctx, &tq) t := &ArrayType{ Item: t, TypeQualifiers: tq, } return n.DirectDeclarator.check(ctx, t, sc, fn) case DirectDeclaratorArray: // DirectDeclarator '[' TypeQualifierListOpt ExprOpt ']' var tq []*TypeQualifier n.TypeQualifierListOpt.check(ctx, &tq) n.ExprOpt.eval(ctx, true, fn, nil, nil) var sz Operand if o := n.ExprOpt; o != nil { sz = o.Expr.Operand } t := &ArrayType{ Item: t, Size: sz, TypeQualifiers: tq, } return n.DirectDeclarator.check(ctx, t, sc, fn) case DirectDeclaratorIdent: // IDENTIFIER return t default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *IdentifierListOpt) check() []int { if n == nil { return nil } return n.IdentifierList.check() } func (n *IdentifierList) check() (r []int) { m := map[int]struct{}{} for ; n != nil; n = n.IdentifierList { nm := n.Token.Val if n.Token.Rune == ',' { nm = n.Token2.Val } if _, ok := m[nm]; ok { panic("TODO") } m[nm] = struct{}{} r = append(r, nm) } return r } func (n *ParameterTypeList) check(ctx *context) ([]Type, bool) { switch n.Case { case ParameterTypeListBase: // ParameterList return n.ParameterList.check(ctx), false case ParameterTypeListDots: // ParameterList ',' "..." return n.ParameterList.check(ctx), true default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *ParameterList) check(ctx *context) (r []Type) { for ; n != nil; n = n.ParameterList { r = append(r, n.ParameterDeclaration.check(ctx)) } return r } func (n *ParameterDeclaration) check(ctx *context) Type { switch n.Case { case ParameterDeclarationAbstract: // DeclarationSpecifiers AbstractDeclaratorOpt ds := &DeclarationSpecifier{} n.DeclarationSpecifiers.check(ctx, ds) n.AbstractDeclaratorOpt.check(ctx, ds, ds.typ(ctx)) if n.AbstractDeclaratorOpt == nil { return ds.typ(ctx) } return n.AbstractDeclaratorOpt.AbstractDeclarator.Type case ParameterDeclarationDeclarator: // DeclarationSpecifiers Declarator ds := &DeclarationSpecifier{} n.DeclarationSpecifiers.check(ctx, ds) n.Declarator.IsFunctionParameter = true return n.Declarator.check(ctx, ds, ds.typ(ctx), true, nil, nil) default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *AbstractDeclaratorOpt) check(ctx *context, ds *DeclarationSpecifier, t Type) { if n == nil { return } n.AbstractDeclarator.check(ctx, ds, t) } func (n *AbstractDeclarator) check(ctx *context, ds *DeclarationSpecifier, t Type) Type { n.DeclarationSpecifier = ds switch n.Case { case AbstractDeclaratorPointer: // Pointer n.Type = n.Pointer.check(ctx, t, &n.TypeQualifiers) case AbstractDeclaratorAbstract: // PointerOpt DirectAbstractDeclarator t = n.PointerOpt.check(ctx, t, &n.TypeQualifiers) n.Type = n.DirectAbstractDeclarator.check(ctx, t) default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } return n.Type } func (n *DirectAbstractDeclarator) check(ctx *context, t Type) Type { switch n.Case { case DirectAbstractDeclaratorAbstract: // '(' AbstractDeclarator ')' return n.AbstractDeclarator.check(ctx, nil, t) case DirectAbstractDeclaratorParamList: // '(' ParameterTypeListOpt ')' fp, variadic := n.ParameterTypeListOpt.check(ctx) t := &FunctionType{ Params: fp, Result: t, Variadic: variadic, } return t case DirectAbstractDeclaratorDFn: // DirectAbstractDeclarator '(' ParameterTypeListOpt ')' fp, variadic := n.ParameterTypeListOpt.check(ctx) t := &FunctionType{ Params: fp, Result: t, Variadic: variadic, } return n.DirectAbstractDeclarator.check(ctx, t) case DirectAbstractDeclaratorDArrSize: // DirectAbstractDeclaratorOpt '[' "static" TypeQualifierListOpt Expr ']' var tq []*TypeQualifier n.TypeQualifierListOpt.check(ctx, &tq) sz := n.Expr.eval(ctx, true, nil, nil, nil) t := &ArrayType{ Item: t, Size: sz, } if n.DirectAbstractDeclaratorOpt == nil { return t } return n.DirectAbstractDeclaratorOpt.DirectAbstractDeclarator.check(ctx, t) //TODO case DirectAbstractDeclaratorDArrVL: // DirectAbstractDeclaratorOpt '[' '*' ']' case DirectAbstractDeclaratorDArr: // DirectAbstractDeclaratorOpt '[' ExprOpt ']' n.ExprOpt.eval(ctx, true, nil, nil, nil) var sz Operand if o := n.ExprOpt; o != nil { sz = o.Expr.Operand } t := &ArrayType{ Item: t, Size: sz, } if n.DirectAbstractDeclaratorOpt == nil { return t } return n.DirectAbstractDeclaratorOpt.DirectAbstractDeclarator.check(ctx, t) //TODO case DirectAbstractDeclaratorDArrSize2: // DirectAbstractDeclaratorOpt '[' TypeQualifierList "static" Expr ']' case DirectAbstractDeclaratorDArr2: // DirectAbstractDeclaratorOpt '[' TypeQualifierList ExprOpt ']' var tq []*TypeQualifier n.TypeQualifierListOpt.check(ctx, &tq) n.ExprOpt.eval(ctx, true, nil, nil, nil) var sz Operand if o := n.ExprOpt; o != nil { sz = o.Expr.Operand } t := &ArrayType{ Item: t, Size: sz, } if n.DirectAbstractDeclaratorOpt == nil { return t } return n.DirectAbstractDeclaratorOpt.DirectAbstractDeclarator.check(ctx, t) default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *ParameterTypeListOpt) check(ctx *context) ([]Type, bool) { if n == nil { return nil, false } return n.ParameterTypeList.check(ctx) } func (n *DeclarationSpecifiers) check(ctx *context, ds *DeclarationSpecifier) { switch n.Case { case DeclarationSpecifiersFunc: // FunctionSpecifier DeclarationSpecifiersOpt n.FunctionSpecifier.check(ctx, ds) case DeclarationSpecifiersStorage: // StorageClassSpecifier DeclarationSpecifiersOpt n.StorageClassSpecifier.check(ctx, ds) case DeclarationSpecifiersQualifier: // TypeQualifier DeclarationSpecifiersOpt n.TypeQualifier.check(ctx, ds) case DeclarationSpecifiersSpecifier: // TypeSpecifier DeclarationSpecifiersOpt n.TypeSpecifier.check(ctx, ds) default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } n.DeclarationSpecifiersOpt.check(ctx, ds) } func (n *FunctionSpecifier) check(ctx *context, ds *DeclarationSpecifier) { ds.FunctionSpecifiers = append(ds.FunctionSpecifiers, n) } func (n *TypeQualifier) check(ctx *context, ds *DeclarationSpecifier) { switch n.Case { case TypeQualifierConst, // "const" TypeQualifierRestrict, // "restrict" TypeQualifierVolatile: // "volatile" //nop default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } ds.TypeQualifiers = append(ds.TypeQualifiers, n) } func (n *TypeSpecifier) check(ctx *context, ds *DeclarationSpecifier) { switch n.Case { case TypeSpecifierBool, // "_Bool" TypeSpecifierChar, // "char" TypeSpecifierComplex, // "_Complex" TypeSpecifierDouble, // "double" TypeSpecifierFloat, // "float" TypeSpecifierInt, // "int" TypeSpecifierLong, // "long" TypeSpecifierName, // TYPEDEF_NAME TypeSpecifierShort, // "short" TypeSpecifierSigned, // "signed" TypeSpecifierUnsigned, // "unsigned" TypeSpecifierVoid: // "void" // nop case TypeSpecifierEnum: // EnumSpecifier n.EnumSpecifier.check(ctx) case TypeSpecifierStruct: // StructOrUnionSpecifier n.StructOrUnionSpecifier.check(ctx) case TypeSpecifierTypeof: // "typeof" '(' TypeName ')' n.typ = n.TypeName.check(ctx) case TypeSpecifierTypeofExpr: // "typeof" '(' Expr ')' op := n.Expr.eval(ctx, false, nil, nil, nil) n.typ = op.Type default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } ds.TypeSpecifiers = append(ds.TypeSpecifiers, n) } func (n *EnumSpecifier) check(ctx *context) { // [0]6.7.2.2 n.Tag = n.Token2.Val if n.IdentifierOpt != nil { n.Tag = n.IdentifierOpt.Token.Val } switch n.Case { case EnumSpecifierTag: // "enum" IDENTIFIER n.typ = &TaggedEnumType{Tag: n.Tag, scope: n.scope} case EnumSpecifierDefine: // "enum" IdentifierOpt '{' EnumeratorList CommaOpt '}' t := n.EnumeratorList.check(ctx, n.scope) t.Tag = n.Tag n.typ = t var min int64 var max uint64 for _, v := range t.Enums { w := v.Operand.Value.(*ir.Int64Value).Value u := uint64(w) if !v.Operand.Type.IsUnsigned() && w < 0 { if w < min { min = w } u = uint64(-w) } if u > max { max = u } } t.Min = min t.Max = max var x Operand //TODO- switch { //TODO- case min < 0: if u := uint64(-min); u > max { max = u } x = newIntConst(ctx, n, max /*TODO- Char, */, Int, Long, LongLong, ULongLong) //TODO- default: //TODO- x = newIntConst(ctx, n, max /*TODO- UChar, */, UInt, ULong, ULongLong) //TODO- } for i := range t.Enums { t.Enums[i].Operand.Type = x.Type t.Enums[i].Operand.IsEnumConst = true } if n.IdentifierOpt != nil { n.scope.insertEnumTag(ctx, n.IdentifierOpt.Token.Val, n) } default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *EnumSpecifier) isCompatible(m *EnumSpecifier) bool { if n.Tag != m.Tag || (n.EnumeratorList != nil) != (m.EnumeratorList != nil) { return false } if n.typ != nil && m.typ != nil { return n.typ.IsCompatible(m.typ) } panic(fmt.Errorf("%v, %v", n, m)) } func (n *EnumeratorList) check(ctx *context, s *Scope) *EnumType { r := &EnumType{} iota := int64(-1) for ; n != nil; n = n.EnumeratorList { r.Enums = append(r.Enums, n.Enumerator.check(ctx, s, &iota)) } return r } func (n *Enumerator) check(ctx *context, s *Scope, iota *int64) *EnumerationConstant { c := n.EnumerationConstant switch n.Case { case EnumeratorBase: // EnumerationConstant *iota++ c.Operand = Operand{Value: &ir.Int64Value{Value: *iota}, Type: Int} s.insertEnumerationConstant(ctx, c) return c case EnumeratorInit: // EnumerationConstant '=' ConstExpr c.Operand = n.ConstExpr.eval(ctx) s.insertEnumerationConstant(ctx, c) switch x := c.Operand.Value.(type) { case *ir.Int64Value: *iota = x.Value default: panic(ctx.position(n)) } return c default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *StructOrUnionSpecifier) check(ctx *context) { var tag int if n.IdentifierOpt != nil { tag = n.IdentifierOpt.Token.Val } switch n.Case { case StructOrUnionSpecifierTag: // StructOrUnion IDENTIFIER switch n.StructOrUnion.Case { case StructOrUnionStruct: n.typ = &TaggedStructType{Tag: n.Token.Val, scope: n.scope} case StructOrUnionUnion: n.typ = &TaggedUnionType{Tag: n.Token.Val, scope: n.scope} default: panic(ctx.position(n)) } case StructOrUnionSpecifierEmpty: // StructOrUnion IdentifierOpt '{' '}' switch n.StructOrUnion.Case { case StructOrUnionStruct: n.typ = &StructType{structBase{Tag: tag}} default: panic(ctx.position(n)) } if tag != 0 { n.scope.Parent.insertStructTag(ctx, n) } case StructOrUnionSpecifierDefine: // StructOrUnion IdentifierOpt '{' StructDeclarationList '}' switch n.StructOrUnion.Case { case StructOrUnionStruct: n.typ = &StructType{structBase{Tag: tag, Fields: n.StructDeclarationList.check(ctx), scope: n.scope}} default: n.typ = &UnionType{structBase{Tag: tag, Fields: n.StructDeclarationList.check(ctx), scope: n.scope}} } if tag != 0 { n.scope.Parent.insertStructTag(ctx, n) } default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *StructDeclarationList) check(ctx *context) (r []Field) { field := 0 for ; n != nil; n = n.StructDeclarationList { r = append(r, n.StructDeclaration.check(ctx, &field)...) } for len(r) > 0 && r[len(r)-1].Bits < 0 { r = r[:len(r)-1] } return r } func (n *StructDeclaration) check(ctx *context, field *int) []Field { switch n.Case { case StructDeclarationBase: // SpecifierQualifierList StructDeclaratorList ';' ds := &DeclarationSpecifier{} n.SpecifierQualifierList.check(ctx, ds) return n.StructDeclaratorList.check(ctx, ds, field) case StructDeclarationAnon: // SpecifierQualifierList ';' ds := &DeclarationSpecifier{} n.SpecifierQualifierList.check(ctx, ds) *field++ return []Field{{Type: ds.typ(ctx), Anonymous: true}} default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *StructDeclaratorList) check(ctx *context, ds *DeclarationSpecifier, field *int) (r []Field) { for ; n != nil; n = n.StructDeclaratorList { r = append(r, n.StructDeclarator.check(ctx, ds, *field)) *field++ } return r } func (n *StructDeclarator) check(ctx *context, ds *DeclarationSpecifier, field int) Field { switch n.Case { case StructDeclaratorBase: // Declarator f := Field{Type: n.Declarator.check(ctx, ds, ds.typ(ctx), false, nil, nil), Name: n.Declarator.Name(), Declarator: n.Declarator} n.Declarator.IsField = true n.Declarator.Field = field return f case StructDeclaratorBits: // DeclaratorOpt ':' ConstExpr var d *Declarator var nm int t := ds.typ(ctx) if n.DeclaratorOpt != nil { d = n.DeclaratorOpt.Declarator nm = d.Name() d.IsField = true d.Field = field t = d.check(ctx, ds, t, false, nil, nil) } op := n.ConstExpr.eval(ctx) if op.Value == nil { panic(ctx.position) } if !op.isIntegerType() { panic(ctx.position) } bits := op.Value.(*ir.Int64Value).Value if bits > 64 { panic(ctx.position) } if bits == 0 { bits = -1 } n.Bits = int(bits) if d != nil { d.Bits = n.Bits } return Field{Type: t, Name: nm, Bits: n.Bits, Declarator: d} default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *SpecifierQualifierList) check(ctx *context, ds *DeclarationSpecifier) { switch n.Case { case SpecifierQualifierListQualifier: // TypeQualifier SpecifierQualifierListOpt n.TypeQualifier.check(ctx, ds) n.SpecifierQualifierListOpt.check(ctx, ds) case SpecifierQualifierListSpecifier: // TypeSpecifier SpecifierQualifierListOpt n.TypeSpecifier.check(ctx, ds) n.SpecifierQualifierListOpt.check(ctx, ds) default: panic(fmt.Errorf("%v: TODO %v", ctx.position(n), n.Case)) } } func (n *SpecifierQualifierListOpt) check(ctx *context, ds *DeclarationSpecifier) { if n == nil { return } n.SpecifierQualifierList.check(ctx, ds) } func (n *StorageClassSpecifier) check(ctx *context, ds *DeclarationSpecifier) { if len(ds.StorageClassSpecifiers) != 0 { panic("TODO") // [0]6.7.1-2 } ds.StorageClassSpecifiers = []*StorageClassSpecifier{n} } func (n *DeclarationSpecifiersOpt) check(ctx *context, ds *DeclarationSpecifier) { if n == nil { return } n.DeclarationSpecifiers.check(ctx, ds) } // IsTLD reports whether n is declared in file scope. func (n *Declarator) IsTLD() bool { return n.Scope.Parent == nil } func (n *Expr) isSideEffectsFree() bool { return false //TODO- switch n.Case { case ExprChar, // CHARCONST ExprFloat, // FLOATCONST ExprIdent, // IDENTIFIER ExprInt, // INTCONST ExprLChar, // LONGCHARCONST ExprSizeofExpr, // "sizeof" Expr ExprSizeofType, // "sizeof" '(' TypeName ')' ExprString: // STRINGLITERAL return true case ExprPExprList: // '(' ExprList ')' return n.ExprList.isSideEffectsFree() case ExprAddAssign, // Expr "+=" Expr ExprAndAssign, // Expr "&=" Expr ExprAssign, // Expr '=' Expr ExprCall, // Expr '(' ArgumentExprListOpt ')' ExprCompLit, // '(' TypeName ')' '{' InitializerList CommaOpt '}' //TODO we can do better ExprDivAssign, // Expr "/=" Expr ExprLshAssign, // Expr "<<=" Expr ExprModAssign, // Expr "%=" Expr ExprMulAssign, // Expr "*=" Expr ExprOrAssign, // Expr "|=" Expr ExprPostDec, // Expr "--" ExprPostInc, // Expr "++" ExprPreDec, // "--" Expr ExprPreInc, // "++" Expr ExprRshAssign, // Expr ">>=" Expr ExprStatement, // '(' CompoundStmt ')' //TODO we can do better ExprSubAssign, // Expr "-=" Expr ExprXorAssign: // Expr "^=" Expr return false case ExprCast: // '(' TypeName ')' Expr return !isVaList(n.Expr.Operand.Type) && n.Expr.isSideEffectsFree() case ExprCond: // Expr '?' ExprList ':' Expr if !n.Expr.isSideEffectsFree() { return false } switch { case n.Expr.Operand.IsNonZero(): return n.ExprList.isSideEffectsFree() case n.Expr.Operand.IsZero(): return n.Expr2.isSideEffectsFree() } return false case ExprAdd, // Expr '+' Expr ExprAnd, // Expr '&' Expr ExprDiv, // Expr '/' Expr ExprEq, // Expr "==" Expr ExprGe, // Expr ">=" Expr ExprGt, // Expr ">" Expr ExprLe, // Expr "<=" Expr ExprLsh, // Expr "<<" Expr ExprLt, // Expr '<' Expr ExprMod, // Expr '%' Expr ExprMul, // Expr '*' Expr ExprNe, // Expr "!=" Expr ExprOr, // Expr '|' Expr ExprRsh, // Expr ">>" Expr ExprSub, // Expr '-' Expr ExprXor: // Expr '^' Expr return n.Expr.isSideEffectsFree() && n.Expr2.isSideEffectsFree() case ExprLAnd: // Expr "&&" Expr return n.Expr.isSideEffectsFree() && n.Expr2.isSideEffectsFree() case ExprLOr: // Expr "||" Expr return n.Expr.isSideEffectsFree() && n.Expr2.isSideEffectsFree() case ExprAddrof, // '&' Expr ExprCpl, // '~' Expr ExprDeref, // '*' Expr ExprNot, // '!' Expr ExprPSelect, // Expr "->" IDENTIFIER ExprSelect, // Expr '.' IDENTIFIER ExprUnaryMinus, // '-' Expr ExprUnaryPlus: // '+' Expr return n.Expr.isSideEffectsFree() case ExprIndex: // Expr '[' ExprList ']' return n.Expr.isSideEffectsFree() && n.ExprList.isSideEffectsFree() default: panic(fmt.Sprint(n.Case, n.Operand)) } } func (n *ExprList) isSideEffectsFree() bool { for l := n; l != nil; l = l.ExprList { if !l.Expr.isSideEffectsFree() { return false } } return true } // IsNonZero reports whether n is provably non zero. func (n *ExprList) IsNonZero() bool { for n.ExprList != nil { n = n.ExprList } return n.Expr.IsNonZero() } // IsNonZero reports whether n is provably non zero. func (n *Expr) IsNonZero() bool { return n.Operand.IsNonZero() //TODO- if n.Operand.IsNonZero() { return true } switch n.Case { case ExprAdd, // Expr '+' Expr ExprAddAssign, // Expr "+=" Expr ExprAnd, // Expr '&' Expr ExprAndAssign, // Expr "&=" Expr ExprCall, // Expr '(' ArgumentExprListOpt ')' ExprChar, // CHARCONST ExprDeref, // '*' Expr ExprDiv, // Expr '/' Expr ExprEq, // Expr "==" Expr ExprFloat, // FLOATCONST ExprGe, // Expr ">=" Expr ExprGt, // Expr '>' Expr ExprIdent, // IDENTIFIER ExprIndex, // Expr '[' ExprList ']' ExprInt, // INTCONST ExprLe, // Expr "<=" Expr ExprLsh, // Expr "<<" Expr ExprLt, // Expr '<' Expr ExprMod, // Expr '%' Expr ExprMul, // Expr '*' Expr ExprPSelect, // Expr "->" IDENTIFIER ExprPostDec, // Expr "--" ExprPostInc, // Expr "++" ExprPreDec, // "--" Expr ExprPreInc, // Expr "++" ExprRsh, // Expr ">>" Expr ExprRshAssign, // Expr ">>=" Expr ExprSelect, // Expr '.' IDENTIFIER ExprSizeofExpr, // "sizeof" Expr ExprSizeofType, // "sizeof" '(' TypeName ')' ExprString, // STRINGLITERAL ExprSubAssign, // Expr "-=" Expr ExprSub: // Expr '-' Expr return false case ExprAddrof: // '&' Expr n = n.Expr for { switch n.Case { case ExprIdent: // IDENTIFIER return true case ExprIndex: // Expr '[' ExprList ']' n = n.Expr case ExprPSelect: // Expr "->" IDENTIFIER return false default: panic(fmt.Errorf("Expr.IsNonZero %s", n.Case)) } } case ExprAssign: // Expr '=' Expr return n.Expr2.IsNonZero() case ExprCast: // '(' TypeName ')' Expr return n.Expr.IsNonZero() case ExprCond: // Expr '?' ExprList ':' Expr return n.Expr.IsNonZero() && n.ExprList.IsNonZero() || n.Expr.IsZero() && n.Expr2.IsNonZero() case ExprCpl: // '~' Expr return n.Expr.IsZero() case ExprLAnd: // Expr "&&" Expr return n.Expr.IsNonZero() && n.Expr2.IsNonZero() case ExprLOr: // Expr "||" Expr return n.Expr.IsNonZero() || n.Expr2.IsNonZero() case ExprNe: // Expr "!=" Expr return n.Expr.IsZero() && n.Expr2.IsNonZero() || n.Expr.IsNonZero() && n.Expr2.IsZero() case ExprNot: // '!' Expr return n.Expr.IsZero() case ExprOr: // Expr '|' Expr return n.Expr.IsNonZero() || n.Expr2.IsNonZero() case ExprOrAssign: // Expr "|=" Expr return n.Expr.IsNonZero() || n.Expr2.IsNonZero() case ExprPExprList: // '(' ExprList ')' return n.ExprList.IsNonZero() case ExprUnaryMinus: // '-' Expr return n.Expr.IsNonZero() case ExprUnaryPlus: // '+' Expr return n.Expr.IsNonZero() case ExprXor: // Expr '^' Expr return n.Expr.IsNonZero() && n.Expr2.IsZero() || n.Expr.IsZero() && n.Expr2.IsNonZero() case ExprXorAssign: // Expr "^=" Expr return n.Expr.IsNonZero() && n.Expr2.IsZero() || n.Expr.IsZero() && n.Expr2.IsNonZero() default: panic(fmt.Errorf("%T.IsNonZero %v", n, n.Case)) } } // IsZero reports whether n is provably zero. func (n *ExprList) IsZero() bool { for n.ExprList != nil { n = n.ExprList } return n.Expr.IsZero() } // IsZero reports whether n is provably zero. func (n *Expr) IsZero() bool { return n.Operand.IsZero() //TODO- if n.Operand.IsZero() { return true } switch n.Case { case ExprAdd, // Expr '+' Expr ExprAddAssign, // Expr "+=" Expr ExprAddrof, // '&' Expr ExprCall, // Expr '(' ArgumentExprListOpt ')' ExprChar, // CHARCONST ExprCompLit, // '(' TypeName ')' '{' InitializerList CommaOpt '}' //TODO we can do better ExprCpl, // '~' Expr ExprDeref, // '*' Expr ExprDiv, // Expr '/' Expr ExprEq, // Expr "==" Expr ExprFloat, // FLOATCONST ExprGe, // Expr ">=" Expr ExprGt, // Expr '>' Expr ExprIdent, // IDENTIFIER ExprIndex, // Expr '[' ExprList ']' ExprInt, // INTCONST ExprLe, // Expr "<=" Expr ExprLsh, // Expr "<<" Expr ExprLt, // Expr '<' Expr ExprPSelect, // Expr "->" IDENTIFIER ExprPostDec, // "--" Expr ExprPostInc, // Expr "++" ExprPreDec, // "--" Expr ExprPreInc, // Expr "++" ExprRsh, // Expr ">>" Expr ExprRshAssign, // Expr ">>=" Expr ExprSubAssign, // Expr "-=" Expr ExprSelect, // Expr '.' IDENTIFIER ExprSizeofExpr, // "sizeof" Expr ExprSizeofType, // "sizeof" '(' TypeName ')' ExprString, // STRINGLITERAL ExprSub: // Expr '-' Expr return false case ExprAnd: // Expr '&' Expr return n.Expr.IsZero() || n.Expr2.IsZero() case ExprAndAssign: // Expr "&=" Expr return n.Expr.IsZero() || n.Expr2.IsZero() case ExprAssign: // Expr '=' Expr return n.Expr2.IsZero() case ExprCast: // '(' TypeName ')' Expr return n.Expr.IsZero() case ExprCond: // Expr '?' ExprList ':' Expr return n.Expr.IsNonZero() && n.ExprList.IsZero() || n.Expr.IsNonZero() && n.Expr2.IsZero() case ExprLAnd: // Expr "&&" Expr return n.Expr.IsZero() || n.Expr2.IsZero() case ExprLOr: // Expr "||" Expr return n.Expr.IsZero() && n.Expr2.IsZero() case ExprMod: // Expr '%' Expr return n.Expr.IsZero() case ExprMul: // Expr '*' Expr return n.Expr.IsZero() || n.Expr2.IsZero() case ExprNe: // Expr "!=" Expr return n.Expr.IsZero() && n.Expr2.IsZero() case ExprNot: // '!' Expr return n.Expr.IsNonZero() case ExprOr: // Expr '|' Expr return n.Expr.IsZero() && n.Expr2.IsZero() case ExprOrAssign: // Expr "|=" Expr return n.Expr.IsZero() && n.Expr2.IsZero() case ExprPExprList: // '(' ExprList ')' return n.ExprList.IsZero() case ExprUnaryMinus: // '-' Expr return n.Expr.IsZero() case ExprUnaryPlus: // '+' Expr return n.Expr.IsZero() case ExprXor: // Expr '^' Expr return n.Expr.IsZero() && n.Expr2.IsZero() || n.Expr.Equals(n.Expr2) case ExprXorAssign: // Expr "^=" Expr return n.Expr.IsZero() && n.Expr2.IsZero() || n.Expr.Equals(n.Expr2) default: panic(fmt.Errorf("%T.IsZero %v", n, n.Case)) } } func (n *ExprList) equals(m *ExprList) bool { if (n.ExprList == nil) != (m.ExprList == nil) { return false } for l, k := n, m; l != nil; l, k = l.ExprList, k.ExprList { if (l.ExprList == nil) != (k.ExprList == nil) || !l.Expr.Equals(k.Expr) { return false } } return true } func (n *ExprList) equals2(m *Expr) bool { for n.ExprList != nil { n = n.ExprList } return n.Expr.Equals(m) } // Equals reports whether s equals m. func (n *Expr) Equals(m *Expr) bool { return false //TODO- if n.Operand.Type != m.Operand.Type || n.Operand.Value != m.Operand.Value || !n.isSideEffectsFree() || !m.isSideEffectsFree() { return false } if n.Case != m.Case { switch { case n.Case == ExprPExprList: return n.ExprList.equals2(m) case m.Case == ExprPExprList: return m.ExprList.equals2(n) } return false } switch n.Case { case ExprPSelect, // Expr "->" IDENTIFIER ExprSelect: // Expr '.' IDENTIFIER return n.Expr.Equals(m.Expr) && n.Token.Val == m.Token.Val && n.Token2.Val == m.Token2.Val case ExprIdent: // IDENTIFIER return n.Token.Val == m.Token.Val case ExprPExprList: // '(' ExprList ')' return n.ExprList.equals(m.ExprList) case ExprInt: // INTCONST return true case // unary ExprCast, // '(' TypeName ')' Expr ExprCpl, // '~' Expr ExprDeref, // '*' Expr ExprNot, // '!' Expr ExprUnaryPlus: // '+' Expr return n.Expr.Equals(m.Expr) case ExprIndex: // Expr '[' ExprList ']' return n.Expr.Equals(m.Expr) && n.ExprList.equals(m.ExprList) case // binary commutative ExprAdd, // Expr '+' Expr ExprAnd, // Expr '&' Expr ExprEq, // Expr "==" Expr ExprGe, // Expr "==" Expr ExprLe, // Expr "==" Expr ExprLt, // Expr "==" Expr ExprMul, // Expr '*' Expr ExprNe, // Expr "==" Expr ExprOr, // Expr '|' Expr ExprXor: // Expr '^' Expr return n.Expr.Equals(m.Expr) && n.Expr2.Equals(m.Expr2) || n.Expr.Equals(m.Expr2) && n.Expr2.Equals(m.Expr) case // binary ExprDiv, // Expr '/' Expr ExprGt, // Expr '>' Expr ExprLAnd, // Expr "&&" Expr ExprLOr, // Expr "||" Expr ExprLsh, // Expr "<<" Expr ExprMod, // Expr '%' Expr ExprRsh, // Expr ">>" Expr ExprSub: // Expr '-' Expr return n.Expr.Equals(m.Expr) && n.Expr2.Equals(m.Expr2) case ExprCall: // Expr '(' ArgumentExprListOpt ')' if !n.Expr.Equals(m.Expr) { return false } if (n.ArgumentExprListOpt == nil) != (m.ArgumentExprListOpt == nil) { return false } if n.ArgumentExprListOpt == nil { return true } for l, k := n.ArgumentExprListOpt.ArgumentExprList, m.ArgumentExprListOpt.ArgumentExprList; l != nil; l, k = l.ArgumentExprList, k.ArgumentExprList { if (l.ArgumentExprList == nil) != (k.ArgumentExprList == nil) || !l.Expr.Equals(k.Expr) { return false } } return true default: panic(fmt.Errorf("%T.Equal %v", n, n.Case)) } } func (n *EnumerationConstant) equal(m *EnumerationConstant) (r bool) { return n.Token.Val == m.Token.Val && n.Operand.Value.(*ir.Int64Value).Value == m.Operand.Value.(*ir.Int64Value).Value } // DumpOperands dumps the operands of n to stdout. func (n *ExprList) DumpOperands(s string) { for l := n; l != nil; l = l.ExprList { l.Expr.DumpOperands(s + "· ") } } // DumpOperands dumps the operands of n to stdout. func (n *Expr) DumpOperands(s string) { z := "" switch { case n.IsZero(): z = ".Z" case n.IsNonZero(): z = ".NZ" } fmt.Printf("%s%v%v %v\n", s, n.Case, z, n.Operand) switch n.Case { case ExprAddrof, ExprCast, ExprCpl, ExprDeref, ExprIndex, ExprNot, ExprPSelect, ExprPostDec, ExprPostInc, ExprPreDec, ExprPreInc, ExprSelect, ExprSizeofExpr, ExprUnaryMinus, ExprUnaryPlus: n.Expr.DumpOperands(s + "· ") case ExprAdd, ExprAnd, ExprAndAssign, ExprAssign, ExprDiv, ExprEq, ExprGe, ExprGt, ExprLAnd, ExprLOr, ExprLe, ExprLsh, ExprLt, ExprMod, ExprMul, ExprNe, ExprOr, ExprOrAssign, ExprRsh, ExprSub, ExprXor, ExprXorAssign: n.Expr.DumpOperands(s + "· ") n.Expr2.DumpOperands(s + "· ") case ExprPExprList: n.ExprList.DumpOperands(s + "· ") case ExprCond: n.Expr.DumpOperands(s + "· ") n.ExprList.DumpOperands(s + "· ") n.Expr2.DumpOperands(s + "· ") case ExprCall, ExprChar, ExprFloat, ExprIdent, ExprInt, ExprSizeofType, ExprString: // nop default: panic(n.Case.String()) } } ================================================ FILE: v2/ast_test.go ================================================ // Code generated by yy. DO NOT EDIT. // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "fmt" ) func ExampleAbstractDeclarator_pointer() { fmt.Println(exampleAST(177, "\U00100000 ( _Bool * )")) // Output: // &cc.AbstractDeclarator{ // · Pointer: &cc.Pointer{ // · · Token: '*', // · }, // } } func ExampleAbstractDeclarator_abstract() { fmt.Println(exampleAST(178, "\U00100000 ( _Bool ( ) )")) // Output: // &cc.AbstractDeclarator{ // · Case: 1, // · DirectAbstractDeclarator: &cc.DirectAbstractDeclarator{ // · · Case: 1, // · · Token: '(', // · · Token2: ')', // · }, // } } func ExampleAbstractDeclaratorOpt_case0() { fmt.Println(exampleAST(179, "\U00100000 ( _Bool )") == (*AbstractDeclaratorOpt)(nil)) // Output: // true } func ExampleAbstractDeclaratorOpt_case1() { fmt.Println(exampleAST(180, "\U00100000 ( _Bool * )")) // Output: // &cc.AbstractDeclaratorOpt{ // · AbstractDeclarator: &cc.AbstractDeclarator{ // · · Pointer: &cc.Pointer{ // · · · Token: '*', // · · }, // · }, // } } func ExampleArgumentExprList_case0() { fmt.Println(exampleAST(4, "\U00100000 'a' ( 'b' )")) // Output: // &cc.ArgumentExprList{ // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // } } func ExampleArgumentExprList_case1() { fmt.Println(exampleAST(5, "\U00100000 'a' ( 'b' , 'c' )")) // Output: // &cc.ArgumentExprList{ // · ArgumentExprList: &cc.ArgumentExprList{ // · · Case: 1, // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'c'", // · · }, // · · Token: ',', // · }, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // } } func ExampleArgumentExprListOpt_case0() { fmt.Println(exampleAST(6, "\U00100000 'a' ( )") == (*ArgumentExprListOpt)(nil)) // Output: // true } func ExampleArgumentExprListOpt_case1() { fmt.Println(exampleAST(7, "\U00100000 'a' ( 'b' )")) // Output: // &cc.ArgumentExprListOpt{ // · ArgumentExprList: &cc.ArgumentExprList{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · }, // } } func ExampleBlockItem_decl() { fmt.Println(exampleAST(219, "\U00100001 a { auto ; !")) // Output: // &cc.BlockItem{ // · Declaration: &cc.Declaration{ // · · Scope: &cc.Scope{ // · · }, // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · Case: 1, // · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · Case: 2, // · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · Case: 3, // · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · · · · · Case: 2, // · · · · · · · · Token: CHAR "char", // · · · · · · · }, // · · · · · · }, // · · · · · }, // · · · · · TypeQualifier: &cc.TypeQualifier{ // · · · · · · Token: CONST "const", // · · · · · }, // · · · · }, // · · · }, // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Case: 3, // · · · · Token: STATIC "static", // · · · }, // · · }, // · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ // · · · InitDeclaratorList: &cc.InitDeclaratorList{ // · · · · InitDeclarator: &cc.InitDeclarator{ // · · · · · Case: 1, // · · · · · Declarator: &cc.Declarator{ // · · · · · · Linkage: LinkageNone, // · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · · · StorageDuration: StorageDurationAutomatic, // · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · Case: DirectDeclaratorArray, // · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · Case: DirectDeclaratorIdent, // · · · · · · · · Token: IDENTIFIER "__func__", // · · · · · · · }, // · · · · · · · Token: '[', // · · · · · · · Token2: ']', // · · · · · · }, // · · · · · }, // · · · · · Initializer: &cc.Initializer{ // · · · · · · Case: 1, // · · · · · · Expr: &cc.Expr{ // · · · · · · · Case: ExprString, // · · · · · · · Token: STRINGLITERAL "\"a\"", // · · · · · · }, // · · · · · }, // · · · · · Token: '=', // · · · · }, // · · · }, // · · }, // · · Token: ';', // · }, // } } func ExampleBlockItem_stmt() { fmt.Println(exampleAST(220, "\U00100001 a { ; !")) // Output: // &cc.BlockItem{ // · Case: 1, // · Stmt: &cc.Stmt{ // · · Case: 1, // · · ExprStmt: &cc.ExprStmt{ // · · · Token: ';', // · · }, // · }, // } } func ExampleBlockItemList_case0() { fmt.Println(exampleAST(215, "\U00100001 a { ; !")) // Output: // &cc.BlockItemList{ // · BlockItem: &cc.BlockItem{ // · · Declaration: &cc.Declaration{ // · · · Scope: &cc.Scope{ // · · · }, // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · Case: 1, // · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · Case: 2, // · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · Case: 3, // · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · · · · · · Case: 2, // · · · · · · · · · Token: CHAR "char", // · · · · · · · · }, // · · · · · · · }, // · · · · · · }, // · · · · · · TypeQualifier: &cc.TypeQualifier{ // · · · · · · · Token: CONST "const", // · · · · · · }, // · · · · · }, // · · · · }, // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Case: 3, // · · · · · Token: STATIC "static", // · · · · }, // · · · }, // · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ // · · · · InitDeclaratorList: &cc.InitDeclaratorList{ // · · · · · InitDeclarator: &cc.InitDeclarator{ // · · · · · · Case: 1, // · · · · · · Declarator: &cc.Declarator{ // · · · · · · · Linkage: LinkageNone, // · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · · · · StorageDuration: StorageDurationAutomatic, // · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · Case: DirectDeclaratorArray, // · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · Case: DirectDeclaratorIdent, // · · · · · · · · · Token: IDENTIFIER "__func__", // · · · · · · · · }, // · · · · · · · · Token: '[', // · · · · · · · · Token2: ']', // · · · · · · · }, // · · · · · · }, // · · · · · · Initializer: &cc.Initializer{ // · · · · · · · Case: 1, // · · · · · · · Expr: &cc.Expr{ // · · · · · · · · Case: ExprString, // · · · · · · · · Token: STRINGLITERAL "\"a\"", // · · · · · · · }, // · · · · · · }, // · · · · · · Token: '=', // · · · · · }, // · · · · }, // · · · }, // · · · Token: ';', // · · }, // · }, // } } func ExampleBlockItemList_case1() { fmt.Println(exampleAST(216, "\U00100001 a { ; ; !")) // Output: // &cc.BlockItemList{ // · BlockItem: &cc.BlockItem{ // · · Declaration: &cc.Declaration{ // · · · Scope: &cc.Scope{ // · · · }, // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · Case: 1, // · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · Case: 2, // · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · Case: 3, // · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · · · · · · Case: 2, // · · · · · · · · · Token: CHAR "char", // · · · · · · · · }, // · · · · · · · }, // · · · · · · }, // · · · · · · TypeQualifier: &cc.TypeQualifier{ // · · · · · · · Token: CONST "const", // · · · · · · }, // · · · · · }, // · · · · }, // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Case: 3, // · · · · · Token: STATIC "static", // · · · · }, // · · · }, // · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ // · · · · InitDeclaratorList: &cc.InitDeclaratorList{ // · · · · · InitDeclarator: &cc.InitDeclarator{ // · · · · · · Case: 1, // · · · · · · Declarator: &cc.Declarator{ // · · · · · · · Linkage: LinkageNone, // · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · · · · StorageDuration: StorageDurationAutomatic, // · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · Case: DirectDeclaratorArray, // · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · Case: DirectDeclaratorIdent, // · · · · · · · · · Token: IDENTIFIER "__func__", // · · · · · · · · }, // · · · · · · · · Token: '[', // · · · · · · · · Token2: ']', // · · · · · · · }, // · · · · · · }, // · · · · · · Initializer: &cc.Initializer{ // · · · · · · · Case: 1, // · · · · · · · Expr: &cc.Expr{ // · · · · · · · · Case: ExprString, // · · · · · · · · Token: STRINGLITERAL "\"a\"", // · · · · · · · }, // · · · · · · }, // · · · · · · Token: '=', // · · · · · }, // · · · · }, // · · · }, // · · · Token: ';', // · · }, // · }, // · BlockItemList: &cc.BlockItemList{ // · · BlockItem: &cc.BlockItem{ // · · · Case: 1, // · · · Stmt: &cc.Stmt{ // · · · · Case: 1, // · · · · ExprStmt: &cc.ExprStmt{ // · · · · · Token: ';', // · · · · }, // · · · }, // · · }, // · · Case: 1, // · }, // } } func ExampleBlockItemListOpt_case0() { fmt.Println(exampleAST(217, "\U00100001 a { }") == (*BlockItemListOpt)(nil)) // Output: // false } func ExampleBlockItemListOpt_case1() { fmt.Println(exampleAST(218, "\U00100001 a { ; }")) // Output: // &cc.BlockItemListOpt{ // · BlockItemList: &cc.BlockItemList{ // · · BlockItem: &cc.BlockItem{ // · · · Declaration: &cc.Declaration{ // · · · · Scope: &cc.Scope{ // · · · · }, // · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · Case: 1, // · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · Case: 2, // · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · · Case: 3, // · · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · · · · · · · Case: 2, // · · · · · · · · · · Token: CHAR "char", // · · · · · · · · · }, // · · · · · · · · }, // · · · · · · · }, // · · · · · · · TypeQualifier: &cc.TypeQualifier{ // · · · · · · · · Token: CONST "const", // · · · · · · · }, // · · · · · · }, // · · · · · }, // · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · · Case: 3, // · · · · · · Token: STATIC "static", // · · · · · }, // · · · · }, // · · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ // · · · · · InitDeclaratorList: &cc.InitDeclaratorList{ // · · · · · · InitDeclarator: &cc.InitDeclarator{ // · · · · · · · Case: 1, // · · · · · · · Declarator: &cc.Declarator{ // · · · · · · · · Linkage: LinkageNone, // · · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · · · · · StorageDuration: StorageDurationAutomatic, // · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · Case: DirectDeclaratorArray, // · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · · Case: DirectDeclaratorIdent, // · · · · · · · · · · Token: IDENTIFIER "__func__", // · · · · · · · · · }, // · · · · · · · · · Token: '[', // · · · · · · · · · Token2: ']', // · · · · · · · · }, // · · · · · · · }, // · · · · · · · Initializer: &cc.Initializer{ // · · · · · · · · Case: 1, // · · · · · · · · Expr: &cc.Expr{ // · · · · · · · · · Case: ExprString, // · · · · · · · · · Token: STRINGLITERAL "\"a\"", // · · · · · · · · }, // · · · · · · · }, // · · · · · · · Token: '=', // · · · · · · }, // · · · · · }, // · · · · }, // · · · · Token: ';', // · · · }, // · · }, // · · BlockItemList: &cc.BlockItemList{ // · · · BlockItem: &cc.BlockItem{ // · · · · Case: 1, // · · · · Stmt: &cc.Stmt{ // · · · · · Case: 1, // · · · · · ExprStmt: &cc.ExprStmt{ // · · · · · · Token: ';', // · · · · · }, // · · · · }, // · · · }, // · · · Case: 1, // · · }, // · }, // } } func ExampleCommaOpt_case0() { fmt.Println(exampleAST(129, "\U00100000 ( _Bool ) { }") == (*CommaOpt)(nil)) // Output: // true } func ExampleCommaOpt_case1() { fmt.Println(exampleAST(130, "\U00100001 auto a = { , }")) // Output: // &cc.CommaOpt{ // · Token: ',', // } } func ExampleCompoundStmt_case0() { fmt.Println(exampleAST(214, "\U00100001 a { }")) // Output: // &cc.CompoundStmt{ // · BlockItemListOpt: &cc.BlockItemListOpt{ // · · BlockItemList: &cc.BlockItemList{ // · · · BlockItem: &cc.BlockItem{ // · · · · Declaration: &cc.Declaration{ // · · · · · Scope: &cc.Scope{ // · · · · · }, // · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · Case: 1, // · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · Case: 2, // · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · · · Case: 3, // · · · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · · · · · · · · Case: 2, // · · · · · · · · · · · Token: CHAR "char", // · · · · · · · · · · }, // · · · · · · · · · }, // · · · · · · · · }, // · · · · · · · · TypeQualifier: &cc.TypeQualifier{ // · · · · · · · · · Token: CONST "const", // · · · · · · · · }, // · · · · · · · }, // · · · · · · }, // · · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · · · Case: 3, // · · · · · · · Token: STATIC "static", // · · · · · · }, // · · · · · }, // · · · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ // · · · · · · InitDeclaratorList: &cc.InitDeclaratorList{ // · · · · · · · InitDeclarator: &cc.InitDeclarator{ // · · · · · · · · Case: 1, // · · · · · · · · Declarator: &cc.Declarator{ // · · · · · · · · · Linkage: LinkageNone, // · · · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · · · · · · StorageDuration: StorageDurationAutomatic, // · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · · Case: DirectDeclaratorArray, // · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · · · Case: DirectDeclaratorIdent, // · · · · · · · · · · · Token: IDENTIFIER "__func__", // · · · · · · · · · · }, // · · · · · · · · · · Token: '[', // · · · · · · · · · · Token2: ']', // · · · · · · · · · }, // · · · · · · · · }, // · · · · · · · · Initializer: &cc.Initializer{ // · · · · · · · · · Case: 1, // · · · · · · · · · Expr: &cc.Expr{ // · · · · · · · · · · Case: ExprString, // · · · · · · · · · · Token: STRINGLITERAL "\"a\"", // · · · · · · · · · }, // · · · · · · · · }, // · · · · · · · · Token: '=', // · · · · · · · }, // · · · · · · }, // · · · · · }, // · · · · · Token: ';', // · · · · }, // · · · }, // · · }, // · }, // · Token: '{', // · Token2: '}', // } } func ExampleConstExpr_case0() { fmt.Println(exampleAST(73, "\U00100000 'a'")) // Output: // &cc.ConstExpr{ // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // } } func ExampleDeclaration_case0() { fmt.Println(exampleAST(75, "\U00100001 auto ;")) // Output: // &cc.Declaration{ // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · Case: 1, // · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · Token: AUTO "auto", // · · }, // · }, // · Token: ';', // } } func ExampleDeclarationList_case0() { fmt.Println(exampleAST(243, "\U00100001 a auto ; {")) // Output: // &cc.DeclarationList{ // · Declaration: &cc.Declaration{ // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · Case: 1, // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Token: AUTO "auto", // · · · }, // · · }, // · · Token: ';', // · }, // } } func ExampleDeclarationList_case1() { fmt.Println(exampleAST(244, "\U00100001 a auto ; auto ; {")) // Output: // &cc.DeclarationList{ // · Declaration: &cc.Declaration{ // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · Case: 1, // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Token: AUTO "auto", // · · · }, // · · }, // · · Token: ';', // · }, // · DeclarationList: &cc.DeclarationList{ // · · Case: 1, // · · Declaration: &cc.Declaration{ // · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · Case: 1, // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Token: AUTO "auto", // · · · · }, // · · · }, // · · · Token: ';', // · · }, // · }, // } } func ExampleDeclarationListOpt_case0() { fmt.Println(exampleAST(245, "\U00100001 a {") == (*DeclarationListOpt)(nil)) // Output: // true } func ExampleDeclarationListOpt_case1() { fmt.Println(exampleAST(246, "\U00100001 a auto ; {")) // Output: // &cc.DeclarationListOpt{ // · DeclarationList: &cc.DeclarationList{ // · · Declaration: &cc.Declaration{ // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · Case: 1, // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Token: AUTO "auto", // · · · · }, // · · · }, // · · · Token: ';', // · · }, // · }, // } } func ExampleDeclarationSpecifiers_func() { fmt.Println(exampleAST(76, "\U00100001 inline (")) // Output: // &cc.DeclarationSpecifiers{ // · FunctionSpecifier: &cc.FunctionSpecifier{ // · · Token: INLINE "inline", // · }, // } } func ExampleDeclarationSpecifiers_storage() { fmt.Println(exampleAST(77, "\U00100001 auto (")) // Output: // &cc.DeclarationSpecifiers{ // · Case: 1, // · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · Token: AUTO "auto", // · }, // } } func ExampleDeclarationSpecifiers_qualifier() { fmt.Println(exampleAST(78, "\U00100001 const (")) // Output: // &cc.DeclarationSpecifiers{ // · Case: 2, // · TypeQualifier: &cc.TypeQualifier{ // · · Token: CONST "const", // · }, // } } func ExampleDeclarationSpecifiers_specifier() { fmt.Println(exampleAST(79, "\U00100001 _Bool (")) // Output: // &cc.DeclarationSpecifiers{ // · Case: 3, // · TypeSpecifier: &cc.TypeSpecifier{ // · · Token: BOOL "_Bool", // · }, // } } func ExampleDeclarationSpecifiersOpt_case0() { fmt.Println(exampleAST(80, "\U00100001 inline (") == (*DeclarationSpecifiersOpt)(nil)) // Output: // true } func ExampleDeclarationSpecifiersOpt_case1() { fmt.Println(exampleAST(81, "\U00100001 const auto (")) // Output: // &cc.DeclarationSpecifiersOpt{ // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · Case: 1, // · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · Token: AUTO "auto", // · · }, // · }, // } } func ExampleDeclarator_case0() { fmt.Println(exampleAST(141, "\U00100001 a )")) // Output: // &cc.Declarator{ // · Linkage: LinkageNone, // · StorageDuration: StorageDurationAutomatic, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Case: DirectDeclaratorIdent, // · · Token: IDENTIFIER "a", // · }, // } } func ExampleDeclaratorOpt_case0() { fmt.Println(exampleAST(142, "\U00100001 struct { _Bool :") == (*DeclaratorOpt)(nil)) // Output: // true } func ExampleDeclaratorOpt_case1() { fmt.Println(exampleAST(143, "\U00100001 struct { _Bool a :")) // Output: // &cc.DeclaratorOpt{ // · Declarator: &cc.Declarator{ // · · Linkage: LinkageNone, // · · Scope: &cc.Scope{ // · · }, // · · StorageDuration: StorageDurationAutomatic, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Case: DirectDeclaratorIdent, // · · · Token: IDENTIFIER "a", // · · }, // · }, // } } func ExampleDesignation_case0() { fmt.Println(exampleAST(198, "\U00100000 ( _Bool ) { . a = !")) // Output: // &cc.Designation{ // · DesignatorList: &cc.DesignatorList{ // · · Designator: &cc.Designator{ // · · · Token: '.', // · · · Token2: IDENTIFIER "a", // · · }, // · }, // · Token: '=', // } } func ExampleDesignator_field() { fmt.Println(exampleAST(201, "\U00100000 ( _Bool ) { . a .")) // Output: // &cc.Designator{ // · Token: '.', // · Token2: IDENTIFIER "a", // } } func ExampleDesignator_index() { fmt.Println(exampleAST(202, "\U00100000 ( _Bool ) { [ 'a' ] .")) // Output: // &cc.Designator{ // · Case: 1, // · ConstExpr: &cc.ConstExpr{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'a'", // · · }, // · }, // · Token: '[', // · Token2: ']', // } } func ExampleDesignatorList_case0() { fmt.Println(exampleAST(199, "\U00100000 ( _Bool ) { . a .")) // Output: // &cc.DesignatorList{ // · Designator: &cc.Designator{ // · · Token: '.', // · · Token2: IDENTIFIER "a", // · }, // } } func ExampleDesignatorList_case1() { fmt.Println(exampleAST(200, "\U00100000 ( _Bool ) { . a . b .")) // Output: // &cc.DesignatorList{ // · Designator: &cc.Designator{ // · · Token: '.', // · · Token2: IDENTIFIER "a", // · }, // · DesignatorList: &cc.DesignatorList{ // · · Case: 1, // · · Designator: &cc.Designator{ // · · · Token: '.', // · · · Token2: IDENTIFIER "b", // · · }, // · }, // } } func ExampleDirectAbstractDeclarator_abstract() { fmt.Println(exampleAST(181, "\U00100000 ( _Bool ( * ) (")) // Output: // &cc.DirectAbstractDeclarator{ // · AbstractDeclarator: &cc.AbstractDeclarator{ // · · Pointer: &cc.Pointer{ // · · · Token: '*', // · · }, // · }, // · Token: '(', // · Token2: ')', // } } func ExampleDirectAbstractDeclarator_paramList() { fmt.Println(exampleAST(182, "\U00100000 ( _Bool ( ) (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 1, // · Token: '(', // · Token2: ')', // } } func ExampleDirectAbstractDeclarator_dFn() { fmt.Println(exampleAST(183, "\U00100000 ( _Bool ( ) ( ) (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 2, // · DirectAbstractDeclarator: &cc.DirectAbstractDeclarator{ // · · Case: 1, // · · Token: '(', // · · Token2: ')', // · }, // · Token: '(', // · Token2: ')', // } } func ExampleDirectAbstractDeclarator_dArrSize() { fmt.Println(exampleAST(184, "\U00100000 ( _Bool [ static 'a' ] (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 3, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: '[', // · Token2: STATIC "static", // · Token3: ']', // } } func ExampleDirectAbstractDeclarator_dArrVL() { fmt.Println(exampleAST(185, "\U00100000 ( _Bool [ * ] (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 4, // · Token: '[', // · Token2: '*', // · Token3: ']', // } } func ExampleDirectAbstractDeclarator_dArr() { fmt.Println(exampleAST(186, "\U00100000 ( _Bool [ ] (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 5, // · Token: '[', // · Token2: ']', // } } func ExampleDirectAbstractDeclarator_dArrSize2() { fmt.Println(exampleAST(187, "\U00100000 ( _Bool [ const static 'a' ] (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 6, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: '[', // · Token2: STATIC "static", // · Token3: ']', // · TypeQualifierList: &cc.TypeQualifierList{ // · · TypeQualifier: &cc.TypeQualifier{ // · · · Token: CONST "const", // · · }, // · }, // } } func ExampleDirectAbstractDeclarator_dArr2() { fmt.Println(exampleAST(188, "\U00100000 ( _Bool [ const ] (")) // Output: // &cc.DirectAbstractDeclarator{ // · Case: 7, // · Token: '[', // · Token2: ']', // · TypeQualifierList: &cc.TypeQualifierList{ // · · TypeQualifier: &cc.TypeQualifier{ // · · · Token: CONST "const", // · · }, // · }, // } } func ExampleDirectAbstractDeclaratorOpt_case0() { fmt.Println(exampleAST(189, "\U00100000 ( _Bool [") == (*DirectAbstractDeclaratorOpt)(nil)) // Output: // true } func ExampleDirectAbstractDeclaratorOpt_case1() { fmt.Println(exampleAST(190, "\U00100000 ( _Bool ( ) [")) // Output: // &cc.DirectAbstractDeclaratorOpt{ // · DirectAbstractDeclarator: &cc.DirectAbstractDeclarator{ // · · Case: 1, // · · Token: '(', // · · Token2: ')', // · }, // } } func ExampleDirectDeclarator_paren() { fmt.Println(exampleAST(144, "\U00100001 ( a ) (")) // Output: // &cc.DirectDeclarator{ // · Case: DirectDeclaratorParen, // · Declarator: &cc.Declarator{ // · · Linkage: LinkageNone, // · · StorageDuration: StorageDurationAutomatic, // · · Embedded: true, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Case: DirectDeclaratorIdent, // · · · Token: IDENTIFIER "a", // · · }, // · }, // · Token: '(', // · Token2: ')', // } } func ExampleDirectDeclarator_identList() { fmt.Println(exampleAST(146, "\U00100001 a ( ) (")) // Output: // &cc.DirectDeclarator{ // · Case: DirectDeclaratorIdentList, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Case: DirectDeclaratorIdent, // · · Token: IDENTIFIER "a", // · }, // · Token: '(', // · Token2: ')', // } } func ExampleDirectDeclarator_paramList() { fmt.Println(exampleAST(148, "\U00100001 a ( auto ) (")) // Output: // &cc.DirectDeclarator{ // · Case: DirectDeclaratorParamList, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Case: DirectDeclaratorIdent, // · · Token: IDENTIFIER "a", // · }, // · ParameterTypeList: &cc.ParameterTypeList{ // · · ParameterList: &cc.ParameterList{ // · · · ParameterDeclaration: &cc.ParameterDeclaration{ // · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · Case: 1, // · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · · Token: AUTO "auto", // · · · · · }, // · · · · }, // · · · }, // · · }, // · }, // · Token: '(', // · Token2: ')', // } } func ExampleDirectDeclarator_arraySize() { fmt.Println(exampleAST(149, "\U00100001 a [ static 'b' ] (")) // Output: // &cc.DirectDeclarator{ // · Case: DirectDeclaratorArraySize, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Case: DirectDeclaratorIdent, // · · Token: IDENTIFIER "a", // · }, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: '[', // · Token2: STATIC "static", // · Token3: ']', // } } func ExampleDirectDeclarator_arraySize2() { fmt.Println(exampleAST(150, "\U00100001 a [ const static 'b' ] (")) // Output: // &cc.DirectDeclarator{ // · Case: DirectDeclaratorArraySize2, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Case: DirectDeclaratorIdent, // · · Token: IDENTIFIER "a", // · }, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: '[', // · Token2: STATIC "static", // · Token3: ']', // · TypeQualifierList: &cc.TypeQualifierList{ // · · TypeQualifier: &cc.TypeQualifier{ // · · · Token: CONST "const", // · · }, // · }, // } } func ExampleDirectDeclarator_arrayVar() { fmt.Println(exampleAST(151, "\U00100001 a [ * ] (")) // Output: // &cc.DirectDeclarator{ // · Case: DirectDeclaratorArrayVar, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Case: DirectDeclaratorIdent, // · · Token: IDENTIFIER "a", // · }, // · Token: '[', // · Token2: '*', // · Token3: ']', // } } func ExampleDirectDeclarator_array() { fmt.Println(exampleAST(152, "\U00100001 a [ ] (")) // Output: // &cc.DirectDeclarator{ // · Case: DirectDeclaratorArray, // · DirectDeclarator: &cc.DirectDeclarator{ // · · Case: DirectDeclaratorIdent, // · · Token: IDENTIFIER "a", // · }, // · Token: '[', // · Token2: ']', // } } func ExampleDirectDeclarator_ident() { fmt.Println(exampleAST(153, "\U00100001 a (")) // Output: // &cc.DirectDeclarator{ // · Case: DirectDeclaratorIdent, // · Token: IDENTIFIER "a", // } } func ExampleEnumSpecifier_tag() { fmt.Println(exampleAST(131, "\U00100001 enum a (")) // Output: // &cc.EnumSpecifier{ // · Token: ENUM "enum", // · Token2: IDENTIFIER "a", // } } func ExampleEnumSpecifier_define() { fmt.Println(exampleAST(132, "\U00100001 enum { a } (")) // Output: // &cc.EnumSpecifier{ // · Case: 1, // · EnumeratorList: &cc.EnumeratorList{ // · · Enumerator: &cc.Enumerator{ // · · · EnumerationConstant: &cc.EnumerationConstant{ // · · · · Token: IDENTIFIER "a", // · · · }, // · · }, // · }, // · Token: ENUM "enum", // · Token2: '{', // · Token3: '}', // } } func ExampleEnumerationConstant_case0() { fmt.Println(exampleAST(3, "\U00100001 enum { a ,")) // Output: // &cc.EnumerationConstant{ // · Token: IDENTIFIER "a", // } } func ExampleEnumerator_base() { fmt.Println(exampleAST(135, "\U00100001 enum { a ,")) // Output: // &cc.Enumerator{ // · EnumerationConstant: &cc.EnumerationConstant{ // · · Token: IDENTIFIER "a", // · }, // } } func ExampleEnumerator_init() { fmt.Println(exampleAST(136, "\U00100001 enum { a = 'b' ,")) // Output: // &cc.Enumerator{ // · Case: 1, // · ConstExpr: &cc.ConstExpr{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · }, // · EnumerationConstant: &cc.EnumerationConstant{ // · · Token: IDENTIFIER "a", // · }, // · Token: '=', // } } func ExampleEnumeratorList_case0() { fmt.Println(exampleAST(133, "\U00100001 enum { a ,")) // Output: // &cc.EnumeratorList{ // · Enumerator: &cc.Enumerator{ // · · EnumerationConstant: &cc.EnumerationConstant{ // · · · Token: IDENTIFIER "a", // · · }, // · }, // } } func ExampleEnumeratorList_case1() { fmt.Println(exampleAST(134, "\U00100001 enum { a , b ,")) // Output: // &cc.EnumeratorList{ // · Enumerator: &cc.Enumerator{ // · · EnumerationConstant: &cc.EnumerationConstant{ // · · · Token: IDENTIFIER "a", // · · }, // · }, // · EnumeratorList: &cc.EnumeratorList{ // · · Case: 1, // · · Enumerator: &cc.Enumerator{ // · · · EnumerationConstant: &cc.EnumerationConstant{ // · · · · Token: IDENTIFIER "b", // · · · }, // · · }, // · · Token: ',', // · }, // } } func ExampleExpr_preInc() { fmt.Println(exampleAST(8, "\U00100000 ++ 'a'")) // Output: // &cc.Expr{ // · Case: ExprPreInc, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: INC, // } } func ExampleExpr_preDec() { fmt.Println(exampleAST(9, "\U00100000 -- 'a'")) // Output: // &cc.Expr{ // · Case: ExprPreDec, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: DEC, // } } func ExampleExpr_alignofType() { fmt.Println(exampleAST(10, "\U00100000 __alignof__ ( _Bool )")) // Output: // &cc.Expr{ // · Case: ExprAlignofType, // · Token: ALIGNOF "__alignof__", // · Token2: '(', // · Token3: ')', // · TypeName: &cc.TypeName{ // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · Case: 1, // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Token: BOOL "_Bool", // · · · }, // · · }, // · }, // } } func ExampleExpr_alignofExpr() { fmt.Println(exampleAST(11, "\U00100000 __alignof__ 'a'")) // Output: // &cc.Expr{ // · Case: ExprAlignofExpr, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: ALIGNOF "__alignof__", // } } func ExampleExpr_sizeofType() { fmt.Println(exampleAST(12, "\U00100000 sizeof ( _Bool )")) // Output: // &cc.Expr{ // · Case: ExprSizeofType, // · Token: SIZEOF "sizeof", // · Token2: '(', // · Token3: ')', // · TypeName: &cc.TypeName{ // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · Case: 1, // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Token: BOOL "_Bool", // · · · }, // · · }, // · }, // } } func ExampleExpr_sizeofExpr() { fmt.Println(exampleAST(13, "\U00100000 sizeof 'a'")) // Output: // &cc.Expr{ // · Case: ExprSizeofExpr, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: SIZEOF "sizeof", // } } func ExampleExpr_not() { fmt.Println(exampleAST(14, "\U00100000 ! 'a'")) // Output: // &cc.Expr{ // · Case: ExprNot, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: '!', // } } func ExampleExpr_addrof() { fmt.Println(exampleAST(15, "\U00100000 & 'a'")) // Output: // &cc.Expr{ // · Case: ExprAddrof, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: '&', // } } func ExampleExpr_statement() { fmt.Println(exampleAST(16, "\U00100000 ( { } )")) // Output: // &cc.Expr{ // · Case: ExprStatement, // · CompoundStmt: &cc.CompoundStmt{ // · · Token: '{', // · · Token2: '}', // · }, // · Token: '(', // · Token2: ')', // } } func ExampleExpr_pExprList() { fmt.Println(exampleAST(17, "\U00100000 ( 'a' )")) // Output: // &cc.Expr{ // · Case: ExprPExprList, // · ExprList: &cc.ExprList{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'a'", // · · }, // · }, // · Token: '(', // · Token2: ')', // } } func ExampleExpr_compLit() { fmt.Println(exampleAST(18, "\U00100000 ( _Bool ) { }")) // Output: // &cc.Expr{ // · Case: ExprCompLit, // · Token: '(', // · Token2: ')', // · Token3: '{', // · Token4: '}', // · TypeName: &cc.TypeName{ // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · Case: 1, // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Token: BOOL "_Bool", // · · · }, // · · }, // · }, // } } func ExampleExpr_cast() { fmt.Println(exampleAST(19, "\U00100000 ( _Bool ) 'a'")) // Output: // &cc.Expr{ // · Case: ExprCast, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: '(', // · Token2: ')', // · TypeName: &cc.TypeName{ // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · Case: 1, // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Token: BOOL "_Bool", // · · · }, // · · }, // · }, // } } func ExampleExpr_deref() { fmt.Println(exampleAST(20, "\U00100000 * 'a'")) // Output: // &cc.Expr{ // · Case: ExprDeref, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: '*', // } } func ExampleExpr_unaryPlus() { fmt.Println(exampleAST(21, "\U00100000 + 'a'")) // Output: // &cc.Expr{ // · Case: ExprUnaryPlus, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: '+', // } } func ExampleExpr_unaryMinus() { fmt.Println(exampleAST(22, "\U00100000 - 'a'")) // Output: // &cc.Expr{ // · Case: ExprUnaryMinus, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: '-', // } } func ExampleExpr_cpl() { fmt.Println(exampleAST(23, "\U00100000 ~ 'a'")) // Output: // &cc.Expr{ // · Case: ExprCpl, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: '~', // } } func ExampleExpr_char() { fmt.Println(exampleAST(24, "\U00100000 'a'")) // Output: // &cc.Expr{ // · Case: ExprChar, // · Token: CHARCONST "'a'", // } } func ExampleExpr_ne() { fmt.Println(exampleAST(25, "\U00100000 'a' != 'b'")) // Output: // &cc.Expr{ // · Case: ExprNe, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: NEQ, // } } func ExampleExpr_modAssign() { fmt.Println(exampleAST(26, "\U00100000 'a' %= 'b'")) // Output: // &cc.Expr{ // · Case: ExprModAssign, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: MODASSIGN, // } } func ExampleExpr_lAnd() { fmt.Println(exampleAST(27, "\U00100000 'a' && 'b'")) // Output: // &cc.Expr{ // · Case: ExprLAnd, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: ANDAND, // } } func ExampleExpr_andAssign() { fmt.Println(exampleAST(28, "\U00100000 'a' &= 'b'")) // Output: // &cc.Expr{ // · Case: ExprAndAssign, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: ANDASSIGN, // } } func ExampleExpr_mulAssign() { fmt.Println(exampleAST(29, "\U00100000 'a' *= 'b'")) // Output: // &cc.Expr{ // · Case: ExprMulAssign, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: MULASSIGN, // } } func ExampleExpr_postInc() { fmt.Println(exampleAST(30, "\U00100000 'a' ++")) // Output: // &cc.Expr{ // · Case: ExprPostInc, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: INC, // } } func ExampleExpr_addAssign() { fmt.Println(exampleAST(31, "\U00100000 'a' += 'b'")) // Output: // &cc.Expr{ // · Case: ExprAddAssign, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: ADDASSIGN, // } } func ExampleExpr_postDec() { fmt.Println(exampleAST(32, "\U00100000 'a' --")) // Output: // &cc.Expr{ // · Case: ExprPostDec, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: DEC, // } } func ExampleExpr_subAssign() { fmt.Println(exampleAST(33, "\U00100000 'a' -= 'b'")) // Output: // &cc.Expr{ // · Case: ExprSubAssign, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: SUBASSIGN, // } } func ExampleExpr_pSelect() { fmt.Println(exampleAST(34, "\U00100000 'a' -> b")) // Output: // &cc.Expr{ // · Case: ExprPSelect, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: ARROW, // · Token2: IDENTIFIER "b", // } } func ExampleExpr_divAssign() { fmt.Println(exampleAST(35, "\U00100000 'a' /= 'b'")) // Output: // &cc.Expr{ // · Case: ExprDivAssign, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: DIVASSIGN, // } } func ExampleExpr_lsh() { fmt.Println(exampleAST(36, "\U00100000 'a' << 'b'")) // Output: // &cc.Expr{ // · Case: ExprLsh, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: LSH, // } } func ExampleExpr_lshAssign() { fmt.Println(exampleAST(37, "\U00100000 'a' <<= 'b'")) // Output: // &cc.Expr{ // · Case: ExprLshAssign, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: LSHASSIGN, // } } func ExampleExpr_le() { fmt.Println(exampleAST(38, "\U00100000 'a' <= 'b'")) // Output: // &cc.Expr{ // · Case: ExprLe, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: LEQ, // } } func ExampleExpr_eq() { fmt.Println(exampleAST(39, "\U00100000 'a' == 'b'")) // Output: // &cc.Expr{ // · Case: ExprEq, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: EQ, // } } func ExampleExpr_ge() { fmt.Println(exampleAST(40, "\U00100000 'a' >= 'b'")) // Output: // &cc.Expr{ // · Case: ExprGe, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: GEQ, // } } func ExampleExpr_rsh() { fmt.Println(exampleAST(41, "\U00100000 'a' >> 'b'")) // Output: // &cc.Expr{ // · Case: ExprRsh, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: RSH, // } } func ExampleExpr_rshAssign() { fmt.Println(exampleAST(42, "\U00100000 'a' >>= 'b'")) // Output: // &cc.Expr{ // · Case: ExprRshAssign, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: RSHASSIGN, // } } func ExampleExpr_xorAssign() { fmt.Println(exampleAST(43, "\U00100000 'a' ^= 'b'")) // Output: // &cc.Expr{ // · Case: ExprXorAssign, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: XORASSIGN, // } } func ExampleExpr_orAssign() { fmt.Println(exampleAST(44, "\U00100000 'a' |= 'b'")) // Output: // &cc.Expr{ // · Case: ExprOrAssign, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: ORASSIGN, // } } func ExampleExpr_lOr() { fmt.Println(exampleAST(45, "\U00100000 'a' || 'b'")) // Output: // &cc.Expr{ // · Case: ExprLOr, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: OROR, // } } func ExampleExpr_mod() { fmt.Println(exampleAST(46, "\U00100000 'a' % 'b'")) // Output: // &cc.Expr{ // · Case: ExprMod, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: '%', // } } func ExampleExpr_and() { fmt.Println(exampleAST(47, "\U00100000 'a' & 'b'")) // Output: // &cc.Expr{ // · Case: ExprAnd, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: '&', // } } func ExampleExpr_call() { fmt.Println(exampleAST(48, "\U00100000 'a' ( )")) // Output: // &cc.Expr{ // · Case: ExprCall, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: '(', // · Token2: ')', // } } func ExampleExpr_mul() { fmt.Println(exampleAST(49, "\U00100000 'a' * 'b'")) // Output: // &cc.Expr{ // · Case: ExprMul, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: '*', // } } func ExampleExpr_add() { fmt.Println(exampleAST(50, "\U00100000 'a' + 'b'")) // Output: // &cc.Expr{ // · Case: ExprAdd, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: '+', // } } func ExampleExpr_sub() { fmt.Println(exampleAST(51, "\U00100000 'a' - 'b'")) // Output: // &cc.Expr{ // · Case: ExprSub, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: '-', // } } func ExampleExpr_select() { fmt.Println(exampleAST(52, "\U00100000 'a' . b")) // Output: // &cc.Expr{ // · Case: ExprSelect, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: '.', // · Token2: IDENTIFIER "b", // } } func ExampleExpr_div() { fmt.Println(exampleAST(53, "\U00100000 'a' / 'b'")) // Output: // &cc.Expr{ // · Case: ExprDiv, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: '/', // } } func ExampleExpr_lt() { fmt.Println(exampleAST(54, "\U00100000 'a' < 'b'")) // Output: // &cc.Expr{ // · Case: ExprLt, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: '<', // } } func ExampleExpr_assign() { fmt.Println(exampleAST(55, "\U00100000 'a' = 'b'")) // Output: // &cc.Expr{ // · Case: ExprAssign, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: '=', // } } func ExampleExpr_gt() { fmt.Println(exampleAST(56, "\U00100000 'a' > 'b'")) // Output: // &cc.Expr{ // · Case: ExprGt, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: '>', // } } func ExampleExpr_cond() { fmt.Println(exampleAST(57, "\U00100000 'a' ? 'b' : 'c'")) // Output: // &cc.Expr{ // · Case: ExprCond, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'c'", // · }, // · ExprList: &cc.ExprList{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · }, // · Token: '?', // · Token2: ':', // } } func ExampleExpr_index() { fmt.Println(exampleAST(58, "\U00100000 'a' [ 'b' ]")) // Output: // &cc.Expr{ // · Case: ExprIndex, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · ExprList: &cc.ExprList{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · }, // · Token: '[', // · Token2: ']', // } } func ExampleExpr_xor() { fmt.Println(exampleAST(59, "\U00100000 'a' ^ 'b'")) // Output: // &cc.Expr{ // · Case: ExprXor, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: '^', // } } func ExampleExpr_or() { fmt.Println(exampleAST(60, "\U00100000 'a' | 'b'")) // Output: // &cc.Expr{ // · Case: ExprOr, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Expr2: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // · Token: '|', // } } func ExampleExpr_float() { fmt.Println(exampleAST(61, "\U00100000 1.97")) // Output: // &cc.Expr{ // · Case: ExprFloat, // · Token: FLOATCONST "1.97", // } } func ExampleExpr_ident() { fmt.Println(exampleAST(62, "\U00100001 a { b %")) // Output: // &cc.Expr{ // · Scope: &cc.Scope{ // · }, // · Case: ExprIdent, // · Token: IDENTIFIER "b", // } } func ExampleExpr_int() { fmt.Println(exampleAST(63, "\U00100000 97")) // Output: // &cc.Expr{ // · Case: ExprInt, // · Token: INTCONST "97", // } } func ExampleExpr_lChar() { fmt.Println(exampleAST(64, "\U00100000 L'a'")) // Output: // &cc.Expr{ // · Case: ExprLChar, // · Token: LONGCHARCONST "L'a'", // } } func ExampleExpr_lString() { fmt.Println(exampleAST(65, "\U00100000 L\"a\"")) // Output: // &cc.Expr{ // · Case: ExprLString, // · Token: LONGSTRINGLITERAL "L\"a\"", // } } func ExampleExpr_string() { fmt.Println(exampleAST(66, "\U00100000 \"a\"")) // Output: // &cc.Expr{ // · Case: ExprString, // · Token: STRINGLITERAL "\"a\"", // } } func ExampleExprList_case0() { fmt.Println(exampleAST(69, "\U00100000 ( 'a' )")) // Output: // &cc.ExprList{ // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // } } func ExampleExprList_case1() { fmt.Println(exampleAST(70, "\U00100000 ( 'a' , 'b' )")) // Output: // &cc.ExprList{ // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · ExprList: &cc.ExprList{ // · · Case: 1, // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · · Token: ',', // · }, // } } func ExampleExprListOpt_case0() { fmt.Println(exampleAST(71, "\U00100001 a { ;") == (*ExprListOpt)(nil)) // Output: // true } func ExampleExprListOpt_case1() { fmt.Println(exampleAST(72, "\U00100001 a { 'b' )")) // Output: // &cc.ExprListOpt{ // · ExprList: &cc.ExprList{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · }, // } } func ExampleExprOpt_case0() { fmt.Println(exampleAST(67, "\U00100000 ( _Bool [ ]") == (*ExprOpt)(nil)) // Output: // true } func ExampleExprOpt_case1() { fmt.Println(exampleAST(68, "\U00100001 a [ 'b' ]")) // Output: // &cc.ExprOpt{ // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // } } func ExampleExprStmt_case0() { fmt.Println(exampleAST(221, "\U00100001 a { ; !")) // Output: // &cc.ExprStmt{ // · Token: ';', // } } func ExampleExternalDeclaration_decl() { fmt.Println(exampleAST(235, "\U00100001 auto ;")) // Output: // &cc.ExternalDeclaration{ // · Declaration: &cc.Declaration{ // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · Case: 1, // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Token: AUTO "auto", // · · · }, // · · }, // · · Token: ';', // · }, // } } func ExampleExternalDeclaration_func() { fmt.Println(exampleAST(236, "\U00100001 a { }")) // Output: // &cc.ExternalDeclaration{ // · Case: 1, // · FunctionDefinition: &cc.FunctionDefinition{ // · · Case: 1, // · · Declarator: &cc.Declarator{ // · · · FunctionDefinition: &cc.FunctionDefinition{ /* recursive/repetitive pointee not shown */ }, // · · · Linkage: LinkageNone, // · · · StorageDuration: StorageDurationAutomatic, // · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · Case: DirectDeclaratorIdent, // · · · · Token: IDENTIFIER "a", // · · · }, // · · }, // · · FunctionBody: &cc.FunctionBody{ // · · · CompoundStmt: &cc.CompoundStmt{ // · · · · BlockItemListOpt: &cc.BlockItemListOpt{ // · · · · · BlockItemList: &cc.BlockItemList{ // · · · · · · BlockItem: &cc.BlockItem{ // · · · · · · · Declaration: &cc.Declaration{ // · · · · · · · · Scope: &cc.Scope{ // · · · · · · · · · Parent: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · · · · · }, // · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · · Case: 1, // · · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · · · · Case: 2, // · · · · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · · · · · · Case: 3, // · · · · · · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · · · · · · · · · · · Case: 2, // · · · · · · · · · · · · · · Token: CHAR "char", // · · · · · · · · · · · · · }, // · · · · · · · · · · · · }, // · · · · · · · · · · · }, // · · · · · · · · · · · TypeQualifier: &cc.TypeQualifier{ // · · · · · · · · · · · · Token: CONST "const", // · · · · · · · · · · · }, // · · · · · · · · · · }, // · · · · · · · · · }, // · · · · · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · · · · · · Case: 3, // · · · · · · · · · · Token: STATIC "static", // · · · · · · · · · }, // · · · · · · · · }, // · · · · · · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ // · · · · · · · · · InitDeclaratorList: &cc.InitDeclaratorList{ // · · · · · · · · · · InitDeclarator: &cc.InitDeclarator{ // · · · · · · · · · · · Case: 1, // · · · · · · · · · · · Declarator: &cc.Declarator{ // · · · · · · · · · · · · Linkage: LinkageNone, // · · · · · · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · · · · · · · · · StorageDuration: StorageDurationAutomatic, // · · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · · · · · Case: DirectDeclaratorArray, // · · · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · · · · · · Case: DirectDeclaratorIdent, // · · · · · · · · · · · · · · Token: IDENTIFIER "__func__", // · · · · · · · · · · · · · }, // · · · · · · · · · · · · · Token: '[', // · · · · · · · · · · · · · Token2: ']', // · · · · · · · · · · · · }, // · · · · · · · · · · · }, // · · · · · · · · · · · Initializer: &cc.Initializer{ // · · · · · · · · · · · · Case: 1, // · · · · · · · · · · · · Expr: &cc.Expr{ // · · · · · · · · · · · · · Case: ExprString, // · · · · · · · · · · · · · Token: STRINGLITERAL "\"a\"", // · · · · · · · · · · · · }, // · · · · · · · · · · · }, // · · · · · · · · · · · Token: '=', // · · · · · · · · · · }, // · · · · · · · · · }, // · · · · · · · · }, // · · · · · · · · Token: ';', // · · · · · · · }, // · · · · · · }, // · · · · · }, // · · · · }, // · · · · Token: '{', // · · · · Token2: '}', // · · · }, // · · }, // · }, // } } func ExampleExternalDeclarationList_case0() { fmt.Println(exampleAST(233, "\U00100001 auto ;")) // Output: // &cc.ExternalDeclarationList{ // · ExternalDeclaration: &cc.ExternalDeclaration{ // · · Declaration: &cc.Declaration{ // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · Case: 1, // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Token: AUTO "auto", // · · · · }, // · · · }, // · · · Token: ';', // · · }, // · }, // } } func ExampleExternalDeclarationList_case1() { fmt.Println(exampleAST(234, "\U00100001 auto ; auto ;")) // Output: // &cc.ExternalDeclarationList{ // · ExternalDeclaration: &cc.ExternalDeclaration{ // · · Declaration: &cc.Declaration{ // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · Case: 1, // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Token: AUTO "auto", // · · · · }, // · · · }, // · · · Token: ';', // · · }, // · }, // · ExternalDeclarationList: &cc.ExternalDeclarationList{ // · · Case: 1, // · · ExternalDeclaration: &cc.ExternalDeclaration{ // · · · Declaration: &cc.Declaration{ // · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · Case: 1, // · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · · Token: AUTO "auto", // · · · · · }, // · · · · }, // · · · · Token: ';', // · · · }, // · · }, // · }, // } } func ExampleFunctionBody_case0() { fmt.Println(exampleAST(242, "\U00100001 a { }")) // Output: // &cc.FunctionBody{ // · CompoundStmt: &cc.CompoundStmt{ // · · BlockItemListOpt: &cc.BlockItemListOpt{ // · · · BlockItemList: &cc.BlockItemList{ // · · · · BlockItem: &cc.BlockItem{ // · · · · · Declaration: &cc.Declaration{ // · · · · · · Scope: &cc.Scope{ // · · · · · · }, // · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · Case: 1, // · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · · Case: 2, // · · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · · · · Case: 3, // · · · · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · · · · · · · · · Case: 2, // · · · · · · · · · · · · Token: CHAR "char", // · · · · · · · · · · · }, // · · · · · · · · · · }, // · · · · · · · · · }, // · · · · · · · · · TypeQualifier: &cc.TypeQualifier{ // · · · · · · · · · · Token: CONST "const", // · · · · · · · · · }, // · · · · · · · · }, // · · · · · · · }, // · · · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · · · · Case: 3, // · · · · · · · · Token: STATIC "static", // · · · · · · · }, // · · · · · · }, // · · · · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ // · · · · · · · InitDeclaratorList: &cc.InitDeclaratorList{ // · · · · · · · · InitDeclarator: &cc.InitDeclarator{ // · · · · · · · · · Case: 1, // · · · · · · · · · Declarator: &cc.Declarator{ // · · · · · · · · · · Linkage: LinkageNone, // · · · · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · · · · · · · StorageDuration: StorageDurationAutomatic, // · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · · · Case: DirectDeclaratorArray, // · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · · · · Case: DirectDeclaratorIdent, // · · · · · · · · · · · · Token: IDENTIFIER "__func__", // · · · · · · · · · · · }, // · · · · · · · · · · · Token: '[', // · · · · · · · · · · · Token2: ']', // · · · · · · · · · · }, // · · · · · · · · · }, // · · · · · · · · · Initializer: &cc.Initializer{ // · · · · · · · · · · Case: 1, // · · · · · · · · · · Expr: &cc.Expr{ // · · · · · · · · · · · Case: ExprString, // · · · · · · · · · · · Token: STRINGLITERAL "\"a\"", // · · · · · · · · · · }, // · · · · · · · · · }, // · · · · · · · · · Token: '=', // · · · · · · · · }, // · · · · · · · }, // · · · · · · }, // · · · · · · Token: ';', // · · · · · }, // · · · · }, // · · · }, // · · }, // · · Token: '{', // · · Token2: '}', // · }, // } } func ExampleFunctionDefinition_spec() { fmt.Println(exampleAST(238, "\U00100001 auto a { }")) // Output: // &cc.FunctionDefinition{ // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · Case: 1, // · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · Token: AUTO "auto", // · · }, // · }, // · Declarator: &cc.Declarator{ // · · FunctionDefinition: &cc.FunctionDefinition{ /* recursive/repetitive pointee not shown */ }, // · · Linkage: LinkageNone, // · · StorageDuration: StorageDurationAutomatic, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Case: DirectDeclaratorIdent, // · · · Token: IDENTIFIER "a", // · · }, // · }, // · FunctionBody: &cc.FunctionBody{ // · · CompoundStmt: &cc.CompoundStmt{ // · · · BlockItemListOpt: &cc.BlockItemListOpt{ // · · · · BlockItemList: &cc.BlockItemList{ // · · · · · BlockItem: &cc.BlockItem{ // · · · · · · Declaration: &cc.Declaration{ // · · · · · · · Scope: &cc.Scope{ // · · · · · · · · Parent: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · · · · }, // · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · Case: 1, // · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · · · Case: 2, // · · · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · · · · · Case: 3, // · · · · · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · · · · · · · · · · Case: 2, // · · · · · · · · · · · · · Token: CHAR "char", // · · · · · · · · · · · · }, // · · · · · · · · · · · }, // · · · · · · · · · · }, // · · · · · · · · · · TypeQualifier: &cc.TypeQualifier{ // · · · · · · · · · · · Token: CONST "const", // · · · · · · · · · · }, // · · · · · · · · · }, // · · · · · · · · }, // · · · · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · · · · · Case: 3, // · · · · · · · · · Token: STATIC "static", // · · · · · · · · }, // · · · · · · · }, // · · · · · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ // · · · · · · · · InitDeclaratorList: &cc.InitDeclaratorList{ // · · · · · · · · · InitDeclarator: &cc.InitDeclarator{ // · · · · · · · · · · Case: 1, // · · · · · · · · · · Declarator: &cc.Declarator{ // · · · · · · · · · · · Linkage: LinkageNone, // · · · · · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · · · · · · · · StorageDuration: StorageDurationAutomatic, // · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · · · · Case: DirectDeclaratorArray, // · · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · · · · · Case: DirectDeclaratorIdent, // · · · · · · · · · · · · · Token: IDENTIFIER "__func__", // · · · · · · · · · · · · }, // · · · · · · · · · · · · Token: '[', // · · · · · · · · · · · · Token2: ']', // · · · · · · · · · · · }, // · · · · · · · · · · }, // · · · · · · · · · · Initializer: &cc.Initializer{ // · · · · · · · · · · · Case: 1, // · · · · · · · · · · · Expr: &cc.Expr{ // · · · · · · · · · · · · Case: ExprString, // · · · · · · · · · · · · Token: STRINGLITERAL "\"a\"", // · · · · · · · · · · · }, // · · · · · · · · · · }, // · · · · · · · · · · Token: '=', // · · · · · · · · · }, // · · · · · · · · }, // · · · · · · · }, // · · · · · · · Token: ';', // · · · · · · }, // · · · · · }, // · · · · }, // · · · }, // · · · Token: '{', // · · · Token2: '}', // · · }, // · }, // } } func ExampleFunctionDefinition_int() { fmt.Println(exampleAST(240, "\U00100001 a { }")) // Output: // &cc.FunctionDefinition{ // · Case: 1, // · Declarator: &cc.Declarator{ // · · FunctionDefinition: &cc.FunctionDefinition{ /* recursive/repetitive pointee not shown */ }, // · · Linkage: LinkageNone, // · · StorageDuration: StorageDurationAutomatic, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Case: DirectDeclaratorIdent, // · · · Token: IDENTIFIER "a", // · · }, // · }, // · FunctionBody: &cc.FunctionBody{ // · · CompoundStmt: &cc.CompoundStmt{ // · · · BlockItemListOpt: &cc.BlockItemListOpt{ // · · · · BlockItemList: &cc.BlockItemList{ // · · · · · BlockItem: &cc.BlockItem{ // · · · · · · Declaration: &cc.Declaration{ // · · · · · · · Scope: &cc.Scope{ // · · · · · · · · Parent: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · · · · }, // · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · Case: 1, // · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · · · Case: 2, // · · · · · · · · · · DeclarationSpecifiersOpt: &cc.DeclarationSpecifiersOpt{ // · · · · · · · · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · · · · · · · · Case: 3, // · · · · · · · · · · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · · · · · · · · · · Case: 2, // · · · · · · · · · · · · · Token: CHAR "char", // · · · · · · · · · · · · }, // · · · · · · · · · · · }, // · · · · · · · · · · }, // · · · · · · · · · · TypeQualifier: &cc.TypeQualifier{ // · · · · · · · · · · · Token: CONST "const", // · · · · · · · · · · }, // · · · · · · · · · }, // · · · · · · · · }, // · · · · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · · · · · Case: 3, // · · · · · · · · · Token: STATIC "static", // · · · · · · · · }, // · · · · · · · }, // · · · · · · · InitDeclaratorListOpt: &cc.InitDeclaratorListOpt{ // · · · · · · · · InitDeclaratorList: &cc.InitDeclaratorList{ // · · · · · · · · · InitDeclarator: &cc.InitDeclarator{ // · · · · · · · · · · Case: 1, // · · · · · · · · · · Declarator: &cc.Declarator{ // · · · · · · · · · · · Linkage: LinkageNone, // · · · · · · · · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · · · · · · · · StorageDuration: StorageDurationAutomatic, // · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · · · · Case: DirectDeclaratorArray, // · · · · · · · · · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · · · · · · · · · Case: DirectDeclaratorIdent, // · · · · · · · · · · · · · Token: IDENTIFIER "__func__", // · · · · · · · · · · · · }, // · · · · · · · · · · · · Token: '[', // · · · · · · · · · · · · Token2: ']', // · · · · · · · · · · · }, // · · · · · · · · · · }, // · · · · · · · · · · Initializer: &cc.Initializer{ // · · · · · · · · · · · Case: 1, // · · · · · · · · · · · Expr: &cc.Expr{ // · · · · · · · · · · · · Case: ExprString, // · · · · · · · · · · · · Token: STRINGLITERAL "\"a\"", // · · · · · · · · · · · }, // · · · · · · · · · · }, // · · · · · · · · · · Token: '=', // · · · · · · · · · }, // · · · · · · · · }, // · · · · · · · }, // · · · · · · · Token: ';', // · · · · · · }, // · · · · · }, // · · · · }, // · · · }, // · · · Token: '{', // · · · Token2: '}', // · · }, // · }, // } } func ExampleFunctionSpecifier_case0() { fmt.Println(exampleAST(140, "\U00100001 inline (")) // Output: // &cc.FunctionSpecifier{ // · Token: INLINE "inline", // } } func ExampleIdentifierList_case0() { fmt.Println(exampleAST(170, "\U00100001 a ( b )")) // Output: // &cc.IdentifierList{ // · Token: IDENTIFIER "b", // } } func ExampleIdentifierList_case1() { fmt.Println(exampleAST(171, "\U00100001 a ( b , c )")) // Output: // &cc.IdentifierList{ // · IdentifierList: &cc.IdentifierList{ // · · Case: 1, // · · Token: ',', // · · Token2: IDENTIFIER "c", // · }, // · Token: IDENTIFIER "b", // } } func ExampleIdentifierListOpt_case0() { fmt.Println(exampleAST(172, "\U00100001 a ( )") == (*IdentifierListOpt)(nil)) // Output: // true } func ExampleIdentifierListOpt_case1() { fmt.Println(exampleAST(173, "\U00100001 a ( b )")) // Output: // &cc.IdentifierListOpt{ // · IdentifierList: &cc.IdentifierList{ // · · Token: IDENTIFIER "b", // · }, // } } func ExampleIdentifierOpt_case0() { fmt.Println(exampleAST(174, "\U00100001 struct {") == (*IdentifierOpt)(nil)) // Output: // true } func ExampleIdentifierOpt_case1() { fmt.Println(exampleAST(175, "\U00100001 enum a {")) // Output: // &cc.IdentifierOpt{ // · Token: IDENTIFIER "a", // } } func ExampleInitDeclarator_base() { fmt.Println(exampleAST(86, "\U00100001 a auto b ,")) // Output: // &cc.InitDeclarator{ // · Declarator: &cc.Declarator{ // · · Linkage: LinkageNone, // · · StorageDuration: StorageDurationAutomatic, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Case: DirectDeclaratorIdent, // · · · Token: IDENTIFIER "b", // · · }, // · }, // } } func ExampleInitDeclarator_init() { fmt.Println(exampleAST(87, "\U00100001 auto a = 'b' ,")) // Output: // &cc.InitDeclarator{ // · Case: 1, // · Declarator: &cc.Declarator{ // · · Linkage: LinkageNone, // · · StorageDuration: StorageDurationAutomatic, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Case: DirectDeclaratorIdent, // · · · Token: IDENTIFIER "a", // · · }, // · }, // · Initializer: &cc.Initializer{ // · · Case: 1, // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · }, // · Token: '=', // } } func ExampleInitDeclaratorList_case0() { fmt.Println(exampleAST(82, "\U00100001 auto a ,")) // Output: // &cc.InitDeclaratorList{ // · InitDeclarator: &cc.InitDeclarator{ // · · Declarator: &cc.Declarator{ // · · · Linkage: LinkageNone, // · · · StorageDuration: StorageDurationAutomatic, // · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · Case: DirectDeclaratorIdent, // · · · · Token: IDENTIFIER "a", // · · · }, // · · }, // · }, // } } func ExampleInitDeclaratorList_case1() { fmt.Println(exampleAST(83, "\U00100001 auto a , b ,")) // Output: // &cc.InitDeclaratorList{ // · InitDeclarator: &cc.InitDeclarator{ // · · Declarator: &cc.Declarator{ // · · · Linkage: LinkageNone, // · · · StorageDuration: StorageDurationAutomatic, // · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · Case: DirectDeclaratorIdent, // · · · · Token: IDENTIFIER "a", // · · · }, // · · }, // · }, // · InitDeclaratorList: &cc.InitDeclaratorList{ // · · Case: 1, // · · InitDeclarator: &cc.InitDeclarator{ // · · · Declarator: &cc.Declarator{ // · · · · Linkage: LinkageNone, // · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · StorageDuration: StorageDurationAutomatic, // · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · Case: DirectDeclaratorIdent, // · · · · · Token: IDENTIFIER "b", // · · · · }, // · · · }, // · · }, // · · Token: ',', // · }, // } } func ExampleInitDeclaratorListOpt_case0() { fmt.Println(exampleAST(84, "\U00100001 auto ;") == (*InitDeclaratorListOpt)(nil)) // Output: // true } func ExampleInitDeclaratorListOpt_case1() { fmt.Println(exampleAST(85, "\U00100001 auto a ;")) // Output: // &cc.InitDeclaratorListOpt{ // · InitDeclaratorList: &cc.InitDeclaratorList{ // · · InitDeclarator: &cc.InitDeclarator{ // · · · Declarator: &cc.Declarator{ // · · · · Linkage: LinkageNone, // · · · · StorageDuration: StorageDurationAutomatic, // · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · Case: DirectDeclaratorIdent, // · · · · · Token: IDENTIFIER "a", // · · · · }, // · · · }, // · · }, // · }, // } } func ExampleInitializer_compLit() { fmt.Println(exampleAST(191, "\U00100001 auto a = { } ,")) // Output: // &cc.Initializer{ // · Token: '{', // · Token2: '}', // } } func ExampleInitializer_expr() { fmt.Println(exampleAST(192, "\U00100001 auto a = 'b' ,")) // Output: // &cc.Initializer{ // · Case: 1, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'b'", // · }, // } } func ExampleInitializerList_case0() { fmt.Println(exampleAST(193, "\U00100000 ( _Bool ) { ,") == (*InitializerList)(nil)) // Output: // true } func ExampleInitializerList_case1() { fmt.Println(exampleAST(194, "\U00100000 ( _Bool ) { 'a' ,")) // Output: // &cc.InitializerList{ // · Case: 1, // · Initializer: &cc.Initializer{ // · · Case: 1, // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'a'", // · · }, // · }, // } } func ExampleInitializerList_case2() { fmt.Println(exampleAST(195, "\U00100001 auto a = { . b = 'c' ,")) // Output: // &cc.InitializerList{ // · Case: 2, // · Designation: &cc.Designation{ // · · DesignatorList: &cc.DesignatorList{ // · · · Designator: &cc.Designator{ // · · · · Token: '.', // · · · · Token2: IDENTIFIER "b", // · · · }, // · · }, // · · Token: '=', // · }, // · Initializer: &cc.Initializer{ // · · Case: 1, // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'c'", // · · }, // · }, // } } func ExampleInitializerList_case3() { fmt.Println(exampleAST(196, "\U00100001 auto a = { , 'b' ,")) // Output: // &cc.InitializerList{ // · Case: 3, // · Initializer: &cc.Initializer{ // · · Case: 1, // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · }, // · Token: ',', // } } func ExampleInitializerList_case4() { fmt.Println(exampleAST(197, "\U00100001 auto a = { , . b = 'c' ,")) // Output: // &cc.InitializerList{ // · Case: 4, // · Designation: &cc.Designation{ // · · DesignatorList: &cc.DesignatorList{ // · · · Designator: &cc.Designator{ // · · · · Token: '.', // · · · · Token2: IDENTIFIER "b", // · · · }, // · · }, // · · Token: '=', // · }, // · Initializer: &cc.Initializer{ // · · Case: 1, // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'c'", // · · }, // · }, // · Token: ',', // } } func ExampleIterationStmt_do() { fmt.Println(exampleAST(225, "\U00100001 a { do ; while ( 'b' ) ; !")) // Output: // &cc.IterationStmt{ // · ExprList: &cc.ExprList{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · }, // · Stmt: &cc.Stmt{ // · · Case: 1, // · · ExprStmt: &cc.ExprStmt{ // · · · Token: ';', // · · }, // · }, // · Token: DO "do", // · Token2: WHILE "while", // · Token3: '(', // · Token4: ')', // · Token5: ';', // } } func ExampleIterationStmt_forDecl() { fmt.Println(exampleAST(226, "\U00100001 a { for ( auto ; ; ) ; !")) // Output: // &cc.IterationStmt{ // · Case: 1, // · Declaration: &cc.Declaration{ // · · Scope: &cc.Scope{ // · · · Parent: &cc.Scope{ // · · · }, // · · }, // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · Case: 1, // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Token: AUTO "auto", // · · · }, // · · }, // · · Token: ';', // · }, // · Stmt: &cc.Stmt{ // · · Case: 1, // · · ExprStmt: &cc.ExprStmt{ // · · · Token: ';', // · · }, // · }, // · Token: FOR "for", // · Token2: '(', // · Token3: ';', // · Token4: ')', // } } func ExampleIterationStmt_for() { fmt.Println(exampleAST(227, "\U00100001 a { for ( ; ; ) ; !")) // Output: // &cc.IterationStmt{ // · Case: 2, // · Stmt: &cc.Stmt{ // · · Case: 1, // · · ExprStmt: &cc.ExprStmt{ // · · · Token: ';', // · · }, // · }, // · Token: FOR "for", // · Token2: '(', // · Token3: ';', // · Token4: ';', // · Token5: ')', // } } func ExampleIterationStmt_while() { fmt.Println(exampleAST(228, "\U00100001 a { while ( 'b' ) ; !")) // Output: // &cc.IterationStmt{ // · Case: 3, // · ExprList: &cc.ExprList{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · }, // · Stmt: &cc.Stmt{ // · · Case: 1, // · · ExprStmt: &cc.ExprStmt{ // · · · Token: ';', // · · }, // · }, // · Token: WHILE "while", // · Token2: '(', // · Token3: ')', // } } func ExampleJumpStmt_break() { fmt.Println(exampleAST(229, "\U00100001 a { break ; !")) // Output: // &cc.JumpStmt{ // · Token: BREAK "break", // · Token2: ';', // } } func ExampleJumpStmt_continue() { fmt.Println(exampleAST(230, "\U00100001 a { continue ; !")) // Output: // &cc.JumpStmt{ // · Case: 1, // · Token: CONTINUE "continue", // · Token2: ';', // } } func ExampleJumpStmt_goto() { fmt.Println(exampleAST(231, "\U00100001 a { goto b ; !")) // Output: // &cc.JumpStmt{ // · Case: 2, // · Token: GOTO "goto", // · Token2: IDENTIFIER "b", // · Token3: ';', // } } func ExampleJumpStmt_return() { fmt.Println(exampleAST(232, "\U00100001 a { return ; !")) // Output: // &cc.JumpStmt{ // · Case: 3, // · Token: RETURN "return", // · Token2: ';', // } } func ExampleLabeledStmt_switchCase() { fmt.Println(exampleAST(209, "\U00100001 a { case 'b' : ; !")) // Output: // &cc.LabeledStmt{ // · ConstExpr: &cc.ConstExpr{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · }, // · Stmt: &cc.Stmt{ // · · Case: 1, // · · ExprStmt: &cc.ExprStmt{ // · · · Token: ';', // · · }, // · }, // · Token: CASE "case", // · Token2: ':', // } } func ExampleLabeledStmt_default() { fmt.Println(exampleAST(210, "\U00100001 a { default : ; !")) // Output: // &cc.LabeledStmt{ // · Case: 1, // · Stmt: &cc.Stmt{ // · · Case: 1, // · · ExprStmt: &cc.ExprStmt{ // · · · Token: ';', // · · }, // · }, // · Token: DEFAULT "default", // · Token2: ':', // } } func ExampleLabeledStmt_label() { fmt.Println(exampleAST(211, "\U00100001 a { b : ; !")) // Output: // &cc.LabeledStmt{ // · Case: 2, // · Stmt: &cc.Stmt{ // · · Case: 1, // · · ExprStmt: &cc.ExprStmt{ // · · · Token: ';', // · · }, // · }, // · Token: IDENTIFIER "b", // · Token2: ':', // } } func ExampleLabeledStmt_label2() { fmt.Println(exampleAST(212, "\U00100001 a { typedef name : ; !")) // Output: // TODO: example212.c:1:19: unexpected ':', expected one of [',', ';', '='] } func ExampleParameterDeclaration_abstract() { fmt.Println(exampleAST(168, "\U00100001 a ( auto )")) // Output: // &cc.ParameterDeclaration{ // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · Case: 1, // · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · Token: AUTO "auto", // · · }, // · }, // } } func ExampleParameterDeclaration_declarator() { fmt.Println(exampleAST(169, "\U00100001 a ( auto b )")) // Output: // &cc.ParameterDeclaration{ // · Case: 1, // · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · Case: 1, // · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · Token: AUTO "auto", // · · }, // · }, // · Declarator: &cc.Declarator{ // · · Linkage: LinkageNone, // · · Scope: &cc.Scope{ // · · }, // · · StorageDuration: StorageDurationAutomatic, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Case: DirectDeclaratorIdent, // · · · Token: IDENTIFIER "b", // · · }, // · }, // } } func ExampleParameterList_case0() { fmt.Println(exampleAST(166, "\U00100001 a ( auto )")) // Output: // &cc.ParameterList{ // · ParameterDeclaration: &cc.ParameterDeclaration{ // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · Case: 1, // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Token: AUTO "auto", // · · · }, // · · }, // · }, // } } func ExampleParameterList_case1() { fmt.Println(exampleAST(167, "\U00100001 a ( auto , auto )")) // Output: // &cc.ParameterList{ // · ParameterDeclaration: &cc.ParameterDeclaration{ // · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · Case: 1, // · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · Token: AUTO "auto", // · · · }, // · · }, // · }, // · ParameterList: &cc.ParameterList{ // · · Case: 1, // · · ParameterDeclaration: &cc.ParameterDeclaration{ // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · Case: 1, // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Token: AUTO "auto", // · · · · }, // · · · }, // · · }, // · · Token: ',', // · }, // } } func ExampleParameterTypeList_base() { fmt.Println(exampleAST(162, "\U00100001 a ( auto )")) // Output: // &cc.ParameterTypeList{ // · ParameterList: &cc.ParameterList{ // · · ParameterDeclaration: &cc.ParameterDeclaration{ // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · Case: 1, // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Token: AUTO "auto", // · · · · }, // · · · }, // · · }, // · }, // } } func ExampleParameterTypeList_dots() { fmt.Println(exampleAST(163, "\U00100001 a ( auto , ... )")) // Output: // &cc.ParameterTypeList{ // · Case: 1, // · ParameterList: &cc.ParameterList{ // · · ParameterDeclaration: &cc.ParameterDeclaration{ // · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · Case: 1, // · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · Token: AUTO "auto", // · · · · }, // · · · }, // · · }, // · }, // · Token: ',', // · Token2: DDD, // } } func ExampleParameterTypeListOpt_case0() { fmt.Println(exampleAST(164, "\U00100000 ( _Bool ( )") == (*ParameterTypeListOpt)(nil)) // Output: // true } func ExampleParameterTypeListOpt_case1() { fmt.Println(exampleAST(165, "\U00100000 ( _Bool ( auto )")) // Output: // &cc.ParameterTypeListOpt{ // · ParameterTypeList: &cc.ParameterTypeList{ // · · ParameterList: &cc.ParameterList{ // · · · ParameterDeclaration: &cc.ParameterDeclaration{ // · · · · DeclarationSpecifiers: &cc.DeclarationSpecifiers{ // · · · · · Case: 1, // · · · · · StorageClassSpecifier: &cc.StorageClassSpecifier{ // · · · · · · Token: AUTO "auto", // · · · · · }, // · · · · }, // · · · }, // · · }, // · }, // } } func ExamplePointer_base() { fmt.Println(exampleAST(154, "\U00100001 * (")) // Output: // &cc.Pointer{ // · Token: '*', // } } func ExamplePointer_ptr() { fmt.Println(exampleAST(155, "\U00100001 * * (")) // Output: // &cc.Pointer{ // · Case: 1, // · Pointer: &cc.Pointer{ // · · Token: '*', // · }, // · Token: '*', // } } func ExamplePointerOpt_case0() { fmt.Println(exampleAST(156, "\U00100001 (") == (*PointerOpt)(nil)) // Output: // true } func ExamplePointerOpt_case1() { fmt.Println(exampleAST(157, "\U00100001 * (")) // Output: // &cc.PointerOpt{ // · Pointer: &cc.Pointer{ // · · Token: '*', // · }, // } } func ExampleSelectionStmt_ifElse() { fmt.Println(exampleAST(222, "\U00100001 a { if ( 'b' ) ; else ; !")) // Output: // &cc.SelectionStmt{ // · ExprList: &cc.ExprList{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · }, // · Stmt: &cc.Stmt{ // · · Case: 1, // · · ExprStmt: &cc.ExprStmt{ // · · · Token: ';', // · · }, // · }, // · Stmt2: &cc.Stmt{ // · · Case: 1, // · · ExprStmt: &cc.ExprStmt{ // · · · Token: ';', // · · }, // · }, // · Token: IF "if", // · Token2: '(', // · Token3: ')', // · Token4: ELSE "else", // } } func ExampleSelectionStmt_if() { fmt.Println(exampleAST(223, "\U00100001 a { if ( 'b' ) ; !")) // Output: // &cc.SelectionStmt{ // · Case: 1, // · ExprList: &cc.ExprList{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · }, // · Stmt: &cc.Stmt{ // · · Case: 1, // · · ExprStmt: &cc.ExprStmt{ // · · · Token: ';', // · · }, // · }, // · Token: IF "if", // · Token2: '(', // · Token3: ')', // } } func ExampleSelectionStmt_switch() { fmt.Println(exampleAST(224, "\U00100001 a { switch ( 'b' ) ; !")) // Output: // &cc.SelectionStmt{ // · Case: 2, // · ExprList: &cc.ExprList{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'b'", // · · }, // · }, // · Stmt: &cc.Stmt{ // · · Case: 1, // · · ExprStmt: &cc.ExprStmt{ // · · · Token: ';', // · · }, // · }, // · Token: SWITCH "switch", // · Token2: '(', // · Token3: ')', // } } func ExampleSpecifierQualifierList_qualifier() { fmt.Println(exampleAST(121, "\U00100000 ( const (")) // Output: // &cc.SpecifierQualifierList{ // · TypeQualifier: &cc.TypeQualifier{ // · · Token: CONST "const", // · }, // } } func ExampleSpecifierQualifierList_specifier() { fmt.Println(exampleAST(122, "\U00100000 ( _Bool (")) // Output: // &cc.SpecifierQualifierList{ // · Case: 1, // · TypeSpecifier: &cc.TypeSpecifier{ // · · Token: BOOL "_Bool", // · }, // } } func ExampleSpecifierQualifierListOpt_case0() { fmt.Println(exampleAST(123, "\U00100000 ( const (") == (*SpecifierQualifierListOpt)(nil)) // Output: // true } func ExampleSpecifierQualifierListOpt_case1() { fmt.Println(exampleAST(124, "\U00100000 ( const _Bool (")) // Output: // &cc.SpecifierQualifierListOpt{ // · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · Case: 1, // · · TypeSpecifier: &cc.TypeSpecifier{ // · · · Token: BOOL "_Bool", // · · }, // · }, // } } func ExampleStmt_block() { fmt.Println(exampleAST(203, "\U00100001 a { { } !")) // Output: // &cc.Stmt{ // · CompoundStmt: &cc.CompoundStmt{ // · · Token: '{', // · · Token2: '}', // · }, // } } func ExampleStmt_expr() { fmt.Println(exampleAST(204, "\U00100001 a { ; !")) // Output: // &cc.Stmt{ // · Case: 1, // · ExprStmt: &cc.ExprStmt{ // · · Token: ';', // · }, // } } func ExampleStmt_iter() { fmt.Println(exampleAST(205, "\U00100001 a { while ( 'b' ) ; !")) // Output: // &cc.Stmt{ // · Case: 2, // · IterationStmt: &cc.IterationStmt{ // · · Case: 3, // · · ExprList: &cc.ExprList{ // · · · Expr: &cc.Expr{ // · · · · Case: ExprChar, // · · · · Token: CHARCONST "'b'", // · · · }, // · · }, // · · Stmt: &cc.Stmt{ // · · · Case: 1, // · · · ExprStmt: &cc.ExprStmt{ // · · · · Token: ';', // · · · }, // · · }, // · · Token: WHILE "while", // · · Token2: '(', // · · Token3: ')', // · }, // } } func ExampleStmt_jump() { fmt.Println(exampleAST(206, "\U00100001 a { break ; !")) // Output: // &cc.Stmt{ // · Case: 3, // · JumpStmt: &cc.JumpStmt{ // · · Token: BREAK "break", // · · Token2: ';', // · }, // } } func ExampleStmt_labeled() { fmt.Println(exampleAST(207, "\U00100001 a { default : ; !")) // Output: // &cc.Stmt{ // · Case: 4, // · LabeledStmt: &cc.LabeledStmt{ // · · Case: 1, // · · Stmt: &cc.Stmt{ // · · · Case: 1, // · · · ExprStmt: &cc.ExprStmt{ // · · · · Token: ';', // · · · }, // · · }, // · · Token: DEFAULT "default", // · · Token2: ':', // · }, // } } func ExampleStmt_select() { fmt.Println(exampleAST(208, "\U00100001 a { if ( 'b' ) ; !")) // Output: // &cc.Stmt{ // · Case: 5, // · SelectionStmt: &cc.SelectionStmt{ // · · Case: 1, // · · ExprList: &cc.ExprList{ // · · · Expr: &cc.Expr{ // · · · · Case: ExprChar, // · · · · Token: CHARCONST "'b'", // · · · }, // · · }, // · · Stmt: &cc.Stmt{ // · · · Case: 1, // · · · ExprStmt: &cc.ExprStmt{ // · · · · Token: ';', // · · · }, // · · }, // · · Token: IF "if", // · · Token2: '(', // · · Token3: ')', // · }, // } } func ExampleStorageClassSpecifier_auto() { fmt.Println(exampleAST(88, "\U00100001 auto (")) // Output: // &cc.StorageClassSpecifier{ // · Token: AUTO "auto", // } } func ExampleStorageClassSpecifier_extern() { fmt.Println(exampleAST(89, "\U00100001 extern (")) // Output: // &cc.StorageClassSpecifier{ // · Case: 1, // · Token: EXTERN "extern", // } } func ExampleStorageClassSpecifier_register() { fmt.Println(exampleAST(90, "\U00100001 register (")) // Output: // &cc.StorageClassSpecifier{ // · Case: 2, // · Token: REGISTER "register", // } } func ExampleStorageClassSpecifier_static() { fmt.Println(exampleAST(91, "\U00100001 static (")) // Output: // &cc.StorageClassSpecifier{ // · Case: 3, // · Token: STATIC "static", // } } func ExampleStorageClassSpecifier_typedef() { fmt.Println(exampleAST(92, "\U00100001 typedef (")) // Output: // &cc.StorageClassSpecifier{ // · Case: 4, // · Token: TYPEDEF "typedef", // } } func ExampleStructDeclaration_base() { fmt.Println(exampleAST(119, "\U00100001 struct { _Bool a ; }")) // Output: // &cc.StructDeclaration{ // · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · Case: 1, // · · TypeSpecifier: &cc.TypeSpecifier{ // · · · Token: BOOL "_Bool", // · · }, // · }, // · StructDeclaratorList: &cc.StructDeclaratorList{ // · · StructDeclarator: &cc.StructDeclarator{ // · · · Declarator: &cc.Declarator{ // · · · · Linkage: LinkageNone, // · · · · Scope: &cc.Scope{ // · · · · }, // · · · · StorageDuration: StorageDurationAutomatic, // · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · Case: DirectDeclaratorIdent, // · · · · · Token: IDENTIFIER "a", // · · · · }, // · · · }, // · · }, // · }, // · Token: ';', // } } func ExampleStructDeclaration_anon() { fmt.Println(exampleAST(120, "\U00100001 struct { _Bool ; }")) // Output: // &cc.StructDeclaration{ // · Case: 1, // · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · Case: 1, // · · TypeSpecifier: &cc.TypeSpecifier{ // · · · Token: BOOL "_Bool", // · · }, // · }, // · Token: ';', // } } func ExampleStructDeclarationList_case0() { fmt.Println(exampleAST(117, "\U00100001 struct { _Bool ; }")) // Output: // &cc.StructDeclarationList{ // · StructDeclaration: &cc.StructDeclaration{ // · · Case: 1, // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · Case: 1, // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Token: BOOL "_Bool", // · · · }, // · · }, // · · Token: ';', // · }, // } } func ExampleStructDeclarationList_case1() { fmt.Println(exampleAST(118, "\U00100001 struct { _Bool ; _Bool ; }")) // Output: // &cc.StructDeclarationList{ // · StructDeclaration: &cc.StructDeclaration{ // · · Case: 1, // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · Case: 1, // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Token: BOOL "_Bool", // · · · }, // · · }, // · · Token: ';', // · }, // · StructDeclarationList: &cc.StructDeclarationList{ // · · Case: 1, // · · StructDeclaration: &cc.StructDeclaration{ // · · · Case: 1, // · · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · · Case: 1, // · · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · · Token: BOOL "_Bool", // · · · · }, // · · · }, // · · · Token: ';', // · · }, // · }, // } } func ExampleStructDeclarator_base() { fmt.Println(exampleAST(127, "\U00100001 struct { _Bool a ,")) // Output: // &cc.StructDeclarator{ // · Declarator: &cc.Declarator{ // · · Linkage: LinkageNone, // · · Scope: &cc.Scope{ // · · }, // · · StorageDuration: StorageDurationAutomatic, // · · DirectDeclarator: &cc.DirectDeclarator{ // · · · Case: DirectDeclaratorIdent, // · · · Token: IDENTIFIER "a", // · · }, // · }, // } } func ExampleStructDeclarator_bits() { fmt.Println(exampleAST(128, "\U00100001 struct { _Bool : 'a' ,")) // Output: // &cc.StructDeclarator{ // · Case: 1, // · ConstExpr: &cc.ConstExpr{ // · · Expr: &cc.Expr{ // · · · Case: ExprChar, // · · · Token: CHARCONST "'a'", // · · }, // · }, // · Token: ':', // } } func ExampleStructDeclaratorList_case0() { fmt.Println(exampleAST(125, "\U00100001 struct { _Bool a ,")) // Output: // &cc.StructDeclaratorList{ // · StructDeclarator: &cc.StructDeclarator{ // · · Declarator: &cc.Declarator{ // · · · Linkage: LinkageNone, // · · · Scope: &cc.Scope{ // · · · }, // · · · StorageDuration: StorageDurationAutomatic, // · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · Case: DirectDeclaratorIdent, // · · · · Token: IDENTIFIER "a", // · · · }, // · · }, // · }, // } } func ExampleStructDeclaratorList_case1() { fmt.Println(exampleAST(126, "\U00100001 struct { _Bool a , b ,")) // Output: // &cc.StructDeclaratorList{ // · StructDeclarator: &cc.StructDeclarator{ // · · Declarator: &cc.Declarator{ // · · · Linkage: LinkageNone, // · · · Scope: &cc.Scope{ // · · · }, // · · · StorageDuration: StorageDurationAutomatic, // · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · Case: DirectDeclaratorIdent, // · · · · Token: IDENTIFIER "a", // · · · }, // · · }, // · }, // · StructDeclaratorList: &cc.StructDeclaratorList{ // · · Case: 1, // · · StructDeclarator: &cc.StructDeclarator{ // · · · Declarator: &cc.Declarator{ // · · · · Linkage: LinkageNone, // · · · · Scope: &cc.Scope{ /* recursive/repetitive pointee not shown */ }, // · · · · StorageDuration: StorageDurationAutomatic, // · · · · DirectDeclarator: &cc.DirectDeclarator{ // · · · · · Case: DirectDeclaratorIdent, // · · · · · Token: IDENTIFIER "b", // · · · · }, // · · · }, // · · }, // · · Token: ',', // · }, // } } func ExampleStructOrUnion_struct() { fmt.Println(exampleAST(115, "\U00100001 struct {")) // Output: // &cc.StructOrUnion{ // · Token: STRUCT "struct", // } } func ExampleStructOrUnion_union() { fmt.Println(exampleAST(116, "\U00100001 union {")) // Output: // &cc.StructOrUnion{ // · Case: 1, // · Token: UNION "union", // } } func ExampleStructOrUnionSpecifier_tag() { fmt.Println(exampleAST(109, "\U00100001 struct a (")) // Output: // &cc.StructOrUnionSpecifier{ // · StructOrUnion: &cc.StructOrUnion{ // · · Token: STRUCT "struct", // · }, // · Token: IDENTIFIER "a", // } } func ExampleStructOrUnionSpecifier_empty() { fmt.Println(exampleAST(111, "\U00100001 struct { } (")) // Output: // &cc.StructOrUnionSpecifier{ // · Case: 1, // · StructOrUnion: &cc.StructOrUnion{ // · · Token: STRUCT "struct", // · }, // · Token: '{', // · Token2: '}', // } } func ExampleStructOrUnionSpecifier_define() { fmt.Println(exampleAST(114, "\U00100001 struct { _Bool ; } (")) // Output: // &cc.StructOrUnionSpecifier{ // · Case: 2, // · StructDeclarationList: &cc.StructDeclarationList{ // · · StructDeclaration: &cc.StructDeclaration{ // · · · Case: 1, // · · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · · Case: 1, // · · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · · Token: BOOL "_Bool", // · · · · }, // · · · }, // · · · Token: ';', // · · }, // · }, // · StructOrUnion: &cc.StructOrUnion{ // · · Token: STRUCT "struct", // · }, // · Token: '{', // · Token2: '}', // } } func ExampleTypeName_case0() { fmt.Println(exampleAST(176, "\U00100000 ( _Bool )")) // Output: // &cc.TypeName{ // · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · Case: 1, // · · TypeSpecifier: &cc.TypeSpecifier{ // · · · Token: BOOL "_Bool", // · · }, // · }, // } } func ExampleTypeQualifier_const() { fmt.Println(exampleAST(137, "\U00100001 const !")) // Output: // &cc.TypeQualifier{ // · Token: CONST "const", // } } func ExampleTypeQualifier_restrict() { fmt.Println(exampleAST(138, "\U00100001 restrict !")) // Output: // &cc.TypeQualifier{ // · Case: 1, // · Token: RESTRICT "restrict", // } } func ExampleTypeQualifier_volatile() { fmt.Println(exampleAST(139, "\U00100001 volatile !")) // Output: // &cc.TypeQualifier{ // · Case: 2, // · Token: VOLATILE "volatile", // } } func ExampleTypeQualifierList_case0() { fmt.Println(exampleAST(158, "\U00100001 * const !")) // Output: // &cc.TypeQualifierList{ // · TypeQualifier: &cc.TypeQualifier{ // · · Token: CONST "const", // · }, // } } func ExampleTypeQualifierList_case1() { fmt.Println(exampleAST(159, "\U00100001 * const const !")) // Output: // &cc.TypeQualifierList{ // · TypeQualifier: &cc.TypeQualifier{ // · · Token: CONST "const", // · }, // · TypeQualifierList: &cc.TypeQualifierList{ // · · Case: 1, // · · TypeQualifier: &cc.TypeQualifier{ // · · · Token: CONST "const", // · · }, // · }, // } } func ExampleTypeQualifierListOpt_case0() { fmt.Println(exampleAST(160, "\U00100001 * (") == (*TypeQualifierListOpt)(nil)) // Output: // true } func ExampleTypeQualifierListOpt_case1() { fmt.Println(exampleAST(161, "\U00100001 * const !")) // Output: // &cc.TypeQualifierListOpt{ // · TypeQualifierList: &cc.TypeQualifierList{ // · · TypeQualifier: &cc.TypeQualifier{ // · · · Token: CONST "const", // · · }, // · }, // } } func ExampleTypeSpecifier_bool() { fmt.Println(exampleAST(93, "\U00100001 _Bool (")) // Output: // &cc.TypeSpecifier{ // · Token: BOOL "_Bool", // } } func ExampleTypeSpecifier_complex() { fmt.Println(exampleAST(94, "\U00100001 _Complex (")) // Output: // &cc.TypeSpecifier{ // · Case: 1, // · Token: COMPLEX "_Complex", // } } func ExampleTypeSpecifier_char() { fmt.Println(exampleAST(95, "\U00100001 char (")) // Output: // &cc.TypeSpecifier{ // · Case: 2, // · Token: CHAR "char", // } } func ExampleTypeSpecifier_double() { fmt.Println(exampleAST(96, "\U00100001 double (")) // Output: // &cc.TypeSpecifier{ // · Case: 3, // · Token: DOUBLE "double", // } } func ExampleTypeSpecifier_float() { fmt.Println(exampleAST(97, "\U00100001 float (")) // Output: // &cc.TypeSpecifier{ // · Case: 4, // · Token: FLOAT "float", // } } func ExampleTypeSpecifier_int() { fmt.Println(exampleAST(98, "\U00100001 int (")) // Output: // &cc.TypeSpecifier{ // · Case: 5, // · Token: INT "int", // } } func ExampleTypeSpecifier_long() { fmt.Println(exampleAST(99, "\U00100001 long (")) // Output: // &cc.TypeSpecifier{ // · Case: 6, // · Token: LONG "long", // } } func ExampleTypeSpecifier_short() { fmt.Println(exampleAST(100, "\U00100001 short (")) // Output: // &cc.TypeSpecifier{ // · Case: 7, // · Token: SHORT "short", // } } func ExampleTypeSpecifier_signed() { fmt.Println(exampleAST(101, "\U00100001 signed (")) // Output: // &cc.TypeSpecifier{ // · Case: 8, // · Token: SIGNED "signed", // } } func ExampleTypeSpecifier_unsigned() { fmt.Println(exampleAST(102, "\U00100001 unsigned (")) // Output: // &cc.TypeSpecifier{ // · Case: 9, // · Token: UNSIGNED "unsigned", // } } func ExampleTypeSpecifier_void() { fmt.Println(exampleAST(103, "\U00100001 void (")) // Output: // &cc.TypeSpecifier{ // · Case: 10, // · Token: VOID "void", // } } func ExampleTypeSpecifier_enum() { fmt.Println(exampleAST(104, "\U00100001 enum a (")) // Output: // &cc.TypeSpecifier{ // · Case: 11, // · EnumSpecifier: &cc.EnumSpecifier{ // · · Token: ENUM "enum", // · · Token2: IDENTIFIER "a", // · }, // } } func ExampleTypeSpecifier_struct() { fmt.Println(exampleAST(105, "\U00100001 struct a (")) // Output: // &cc.TypeSpecifier{ // · Case: 12, // · StructOrUnionSpecifier: &cc.StructOrUnionSpecifier{ // · · StructOrUnion: &cc.StructOrUnion{ // · · · Token: STRUCT "struct", // · · }, // · · Token: IDENTIFIER "a", // · }, // } } func ExampleTypeSpecifier_name() { fmt.Println(exampleAST(106, "\U00100001 typedef int foo; foo bar;")) // Output: // &cc.TypeSpecifier{ // · Case: 13, // · Token: TYPEDEF_NAME "foo", // } } func ExampleTypeSpecifier_typeofExpr() { fmt.Println(exampleAST(107, "\U00100001 typeof ( 'a' ) (")) // Output: // &cc.TypeSpecifier{ // · Case: 14, // · Expr: &cc.Expr{ // · · Case: ExprChar, // · · Token: CHARCONST "'a'", // · }, // · Token: TYPEOF "typeof", // · Token2: '(', // · Token3: ')', // } } func ExampleTypeSpecifier_typeof() { fmt.Println(exampleAST(108, "\U00100001 typeof ( _Bool ) (")) // Output: // &cc.TypeSpecifier{ // · Case: 15, // · Token: TYPEOF "typeof", // · Token2: '(', // · Token3: ')', // · TypeName: &cc.TypeName{ // · · SpecifierQualifierList: &cc.SpecifierQualifierList{ // · · · Case: 1, // · · · TypeSpecifier: &cc.TypeSpecifier{ // · · · · Token: BOOL "_Bool", // · · · }, // · · }, // · }, // } } ================================================ FILE: v2/cc.go ================================================ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate rm -f scanner.go trigraphs.go //go:generate golex -o trigraphs.go trigraphs.l //go:generate golex -o scanner.go scanner.l //go:generate rm -f ast.go //go:generate yy -kind Case -o parser.y -astImport "\"github.com/cznic/xc\";\"go/token\";\"fmt\"" -prettyString PrettyString parser.yy //go:generate rm -f parser.go //go:generate goyacc -o /dev/null -xegen xegen parser.y //go:generate goyacc -o parser.go -pool -fs -xe xegen -dlvalf "%v" -dlval "PrettyString(lval.Token)" parser.y //go:generate rm -f xegen //go:generate stringer -output stringer.go -type=cond,Linkage,StorageDuration enum.go //go:generate sh -c "go test -run ^Example |fe" //go:generate gofmt -l -s -w . // Package cc is a C99 compiler front end. Work In Progress. API unstable. package cc import ( "bufio" "bytes" "fmt" "go/scanner" "go/token" "io" "io/ioutil" "os" "os/exec" "path/filepath" "runtime" "runtime/debug" "sort" "strings" "sync" "github.com/cznic/ir" "github.com/cznic/strutil" "github.com/cznic/xc" ) const ( // CRT0Source is the source code of the C startup code. CRT0Source = `int main(); __FILE_TYPE__ __stdfiles[3]; char **environ; void *stdin = &__stdfiles[0], *stdout = &__stdfiles[1], *stderr = &__stdfiles[2]; void _start(int argc, char **argv) { __register_stdfiles(stdin, stdout, stderr, &environ); __builtin_exit(((int (*)(int, char **))main) (argc, argv)); } ` cacheSize = 500 ) var ( _ Source = (*FileSource)(nil) _ Source = (*StringSource)(nil) _ debug.GCStats // YYDebug points to parser's yyDebug variable. YYDebug = &yyDebug traceMacroDefs bool cache = make(map[cacheKey][]uint32, cacheSize) cacheMu sync.Mutex // Guards cache, fset fset = token.NewFileSet() packageDir string headers string selfImportPath string ) func init() { ip, err := strutil.ImportPath() if err != nil { panic(err) } selfImportPath = ip if packageDir, err = findRepo(ip); err != nil { panic(err) } headers = filepath.Join(packageDir, "headers", fmt.Sprintf("%v_%v", env("GOOS", runtime.GOOS), env("GOARCH", runtime.GOARCH))) } func findRepo(s string) (string, error) { s = filepath.FromSlash(s) for _, v := range strings.Split(strutil.Gopath(), string(os.PathListSeparator)) { p := filepath.Join(v, "src", s) fi, err := os.Lstat(p) if err != nil { continue } if fi.IsDir() { wd, err := os.Getwd() if err != nil { return "", err } if p, err = filepath.Rel(wd, p); err != nil { return "", err } if p, err = filepath.Abs(p); err != nil { return "", err } return p, nil } } return "", fmt.Errorf("%q: cannot find repository", s) } // ImportPath reports the import path of this package. func ImportPath() string { return selfImportPath } // Builtin returns the Source for built-in and predefined stuff or an error, if any. func Builtin() (Source, error) { return NewFileSource(filepath.Join(headers, "builtin.h")) } // Crt0 returns the Source for program initialization code. func Crt0() (Source, error) { return NewStringSource("crt0.c", CRT0Source), nil } //TODO mv to ccgo // MustBuiltin is like Builtin but panics on error. func MustBuiltin() Source { return MustFileSource(filepath.Join(headers, "builtin.h")) } // MustCrt0 is like Crt0 but panics on error. func MustCrt0() Source { //TODO mv to ccgo s, err := Crt0() if err != nil { panic(err) } return s } // MustFileSource is like NewFileSource but panics on error. func MustFileSource(nm string) *FileSource { return MustFileSource2(nm, true) } // MustFileSource2 is like NewFileSource but panics on error. func MustFileSource2(nm string, cacheable bool) *FileSource { src, err := NewFileSource2(nm, cacheable) if err != nil { wd, _ := os.Getwd() panic(fmt.Errorf("%v: %v (wd %v)", nm, err, wd)) } return src } // Paths returns the system header search paths, or an error, if any. If local // is true the package-local, cached header search paths are returned. func Paths(local bool) ([]string, error) { p := filepath.Join(headers, "paths") b, err := ioutil.ReadFile(p) if err != nil { return nil, err } a := strings.Split(string(b), "\n") for i, v := range a { switch { case local: a[i] = filepath.Join(headers, strings.TrimSpace(v)) default: a[i] = strings.TrimSpace(v) } } return a, nil } // HostConfig executes HostCppConfig with the cpp argument set to "cpp". For // more info please see the documentation of HostCppConfig. func HostConfig(opts ...string) (predefined string, includePaths, sysIncludePaths []string, err error) { return HostCppConfig("cpp", opts...) } // HostCppConfig returns the system C preprocessor configuration, or an error, // if any. The configuration is obtained by running the cpp command. For the // predefined macros list the '-dM' options is added. For the include paths // lists, the option '-v' is added and the output is parsed to extract the // "..." include and <...> include paths. To add any other options to cpp, list // them in opts. // // The function relies on a POSIX compatible C preprocessor installed. // Execution of HostConfig is not free, so caching the results is recommended // whenever possible. func HostCppConfig(cpp string, opts ...string) (predefined string, includePaths, sysIncludePaths []string, err error) { args := append(append([]string{"-dM"}, opts...), os.DevNull) // cross-compile e.g. win64 -> win32 if env("GOARCH", runtime.GOARCH) == "386" { args = append(args, "-m32") } pre, err := exec.Command(cpp, args...).Output() if err != nil { return "", nil, nil, err } args = append(append([]string{"-v"}, opts...), os.DevNull) out, err := exec.Command(cpp, args...).CombinedOutput() if err != nil { return "", nil, nil, err } sep := "\n" if env("GOOS", runtime.GOOS) == "windows" { sep = "\r\n" } a := strings.Split(string(out), sep) for i := 0; i < len(a); { switch a[i] { case "#include \"...\" search starts here:": loop: for i = i + 1; i < len(a); { switch v := a[i]; { case strings.HasPrefix(v, "#") || v == "End of search list.": break loop default: includePaths = append(includePaths, strings.TrimSpace(v)) i++ } } case "#include <...> search starts here:": for i = i + 1; i < len(a); { switch v := a[i]; { case strings.HasPrefix(v, "#") || v == "End of search list.": return string(pre), includePaths, sysIncludePaths, nil default: sysIncludePaths = append(sysIncludePaths, strings.TrimSpace(v)) i++ } } default: i++ } } return "", nil, nil, fmt.Errorf("failed parsing %s -v output", cpp) } type cacheKey struct { name string mtime int64 } // FlushCache removes all items in the file cache used by instances of FileSource. func FlushCache() { //TODO- cacheMu.Lock() cache = make(map[cacheKey][]uint32, cacheSize) fset = token.NewFileSet() cacheMu.Unlock() } // TranslationUnit represents a translation unit, see [0]6.9. type TranslationUnit struct { ExternalDeclarationList *ExternalDeclarationList FileScope *Scope FileSet *token.FileSet IncludePaths []string Macros map[int]*Macro Model Model SysIncludePaths []string } // Tweaks amend the behavior of the parser. type Tweaks struct { //TODO- remove all options TrackExpand func(string) TrackIncludes func(string) DefinesOnly bool // like in CC -E -dM foo.c EnableAnonymousStructFields bool // struct{int;} EnableBinaryLiterals bool // 0b101010 == 42 EnableEmptyStructs bool // struct{} EnableImplicitBuiltins bool // Undefined printf becomes __builtin_printf. EnableImplicitDeclarations bool // eg. using exit(1) w/o #include EnableOmitFuncDeclSpec bool // foo() { ... } == int foo() { ... } EnablePointerCompatibility bool // All pointers are assignment compatible. EnableReturnExprInVoidFunc bool // void f() { return 1; } EnableTrigraphs bool EnableUnionCasts bool // (union foo)0 IgnoreUnknownPragmas bool // #pragma InjectFinalNL bool // Specs want the source to always end in a newline. PreprocessOnly bool // like in CC -E foo.c cppExpandTest bool // Fake includes } // Translate preprocesses, parses and type checks a translation unit using fset // to record node and error positions, includePaths and sysIncludePaths for // looking for "foo.h" and files. A special path "@" is interpretted as // 'the same directory as where the file with the #include is'. The input // consists of sources which must include any predefined/builtin stuff. // // The returned scope is the file scope of the Translation unit. func Translate(tweaks *Tweaks, includePaths, sysIncludePaths []string, sources ...Source) (tu *TranslationUnit, err error) { returned := false defer func() { e := recover() if !returned && err == nil { if e != nil { err = fmt.Errorf("%v\n%s", e, debugStack()) return } err = fmt.Errorf("PANIC: %v\n%s", e, debugStack()) } }() model, err := NewModel() if err != nil { return nil, err } ctx, err := newContext(tweaks) if err != nil { return nil, err } ctx.model = model ctx.includePaths = append([]string(nil), includePaths...) ctx.sysIncludePaths = append([]string(nil), sysIncludePaths...) if tu, err = ctx.parse(sources); err != nil { return nil, err } if tweaks.PreprocessOnly { returned = true return nil, nil } if err := tu.ExternalDeclarationList.check(ctx); err != nil { return nil, err } if err := ctx.error(); err != nil { return nil, err } tu.IncludePaths = append([]string(nil), includePaths...) tu.SysIncludePaths = append([]string(nil), sysIncludePaths...) returned = true return tu, nil } // Translation unit context. type context struct { errors scanner.ErrorList exampleAST interface{} exampleRule int includePaths []string model Model scope *Scope sync.Mutex sysIncludePaths []string tweaks *Tweaks } func newContext(t *Tweaks) (*context, error) { return &context{ scope: newScope(nil), tweaks: t, }, nil } func (c *context) err(n Node, msg string, args ...interface{}) { c.errPos(n.Pos(), msg, args...) } func (c *context) newScope() { c.scope = newScope(c.scope) } func (c *context) newStructScope() { c.scope = newScope(c.scope); c.scope.structScope = true } func (c *context) position(n Node) (r token.Position) { if n != nil { return fset.PositionFor(n.Pos(), true) } return r } func (c *context) errPos(pos token.Pos, msg string, args ...interface{}) { c.Lock() s := fmt.Sprintf(msg, args...) //s = fmt.Sprintf("%s\n====%s\n----", s, debug.Stack()) c.errors.Add(fset.PositionFor(pos, true), s) c.Unlock() } func (c *context) error() error { c.Lock() defer c.Unlock() if len(c.errors) == 0 { return nil } c.errors.Sort() err := append(scanner.ErrorList(nil), c.errors...) return err } func (c *context) parse(in []Source) (_ *TranslationUnit, err error) { cpp := newCPP(c) r, err := cpp.parse(in...) if err != nil { return nil, err } lx, err := newLexer(c, "", 0, nil) if err != nil { return nil, err } p := newTokenPipe(1024) if c.tweaks.PreprocessOnly { p.emitWhiteSpace = true } lx.tc = p var cppErr error ch := make(chan struct{}) go func() { returned := false defer func() { p.close() e := recover() if !returned && cppErr == nil { cppErr = fmt.Errorf("PANIC: %v\n%s", e, debugStack()) c.err(nopos, "%v", cppErr) } ch <- struct{}{} }() if cppErr = cpp.eval(r, p); cppErr != nil { c.err(nopos, "%v", cppErr) } returned = true }() if c.tweaks.PreprocessOnly { for { t := p.read() if t.Rune == ccEOF { break } if f := c.tweaks.TrackExpand; f != nil { if p := c.position(t); filepath.Base(p.Filename) != "builtin.h" { f(TokSrc(t.Token)) } } } if err := c.error(); err != nil { return nil, err } return nil, cppErr } ok := lx.parse(TRANSLATION_UNIT) if err := c.error(); err != nil || !ok { go func() { // drain for range p.ch { } }() return nil, err } if c.scope.Parent != nil { panic("internal error") } <-ch if cppErr != nil { return nil, cppErr } tu := lx.ast.(*TranslationUnit) tu.Macros = cpp.macros return tu, nil } func (c *context) popScope() (old, new *Scope) { old = c.scope c.scope = c.scope.Parent return old, c.scope } func (c *context) ptrDiff() Type { d, ok := c.scope.LookupIdent(idPtrdiffT).(*Declarator) if !ok { psz := c.model[Ptr].Size for _, v := range []TypeKind{Int, Long, LongLong} { if c.model[v].Size >= psz { return v } } panic("internal error") } if !d.DeclarationSpecifier.IsTypedef() { panic(d.Type) } return d.Type } func (c *context) wideChar() Type { d, ok := c.scope.LookupIdent(idWcharT).(*Declarator) if !ok { var sz int switch goos := env("GOOS", ""); goos { case "windows": sz = 2 case "linux": sz = 4 default: panic(goos) } for _, v := range []TypeKind{SChar, Short, Int, Long, LongLong} { if c.model[v].Size >= sz { return v } } panic("internal error") } if !d.DeclarationSpecifier.IsTypedef() { panic(d.Type) } return d.Type } func (c *context) charConst(t xc.Token) Operand { switch t.Rune { case CHARCONST: s := string(t.S()) s = s[1 : len(s)-1] // Remove outer 's. if len(s) == 1 { return Operand{Type: Int, Value: &ir.Int64Value{Value: int64(s[0])}} } runes := []rune(s) var r rune switch runes[0] { case '\\': r, _ = decodeEscapeSequence(runes) if r < 0 { r = -r } default: r = runes[0] } return Operand{Type: Int, Value: &ir.Int64Value{Value: int64(r)}} case LONGCHARCONST: s := t.S() var buf bytes.Buffer s = s[2 : len(s)-1] runes := []rune(string(s)) for i := 0; i < len(runes); { switch r := runes[i]; { case r == '\\': r, n := decodeEscapeSequence(runes[i:]) switch { case r < 0: buf.WriteByte(byte(-r)) default: buf.WriteRune(r) } i += n default: buf.WriteByte(byte(r)) i++ } } s = buf.Bytes() runes = []rune(string(s)) if len(runes) != 1 { panic("TODO") } return Operand{Type: Long, Value: &ir.Int64Value{Value: int64(runes[0])}} default: panic("internal error") } } func (c *context) strConst(t xc.Token) Operand { s := t.S() switch t.Rune { case LONGSTRINGLITERAL: s = s[1:] // Remove leading 'L'. fallthrough case STRINGLITERAL: var buf bytes.Buffer s = s[1 : len(s)-1] // Remove outer "s. runes := []rune(string(s)) for i := 0; i < len(runes); { switch r := runes[i]; { case r == '\\': r, n := decodeEscapeSequence(runes[i:]) switch { case r < 0: buf.WriteByte(byte(-r)) default: buf.WriteRune(r) } i += n default: buf.WriteByte(byte(r)) i++ } } switch t.Rune { case LONGSTRINGLITERAL: runes := []rune(buf.String()) typ := c.wideChar() return Operand{ Type: &ArrayType{Item: typ, Size: Operand{Type: Int, Value: &ir.Int64Value{Value: c.model.Sizeof(typ) * int64(len(runes)+1)}}}, Value: &ir.WideStringValue{Value: runes}, } case STRINGLITERAL: return Operand{ Type: &ArrayType{Item: Char, Size: Operand{Type: Int, Value: &ir.Int64Value{Value: int64(len(buf.Bytes()) + 1)}}}, Value: &ir.StringValue{StringID: ir.StringID(dict.ID(buf.Bytes()))}, } } } panic("internal error") } func (c *context) sizeof(t Type) Operand { sz := c.model.Sizeof(t) d, ok := c.scope.LookupIdent(idSizeT).(*Declarator) if !ok { psz := c.model[Ptr].Size for _, v := range []TypeKind{UInt, ULong, ULongLong} { if c.model[v].Size >= psz { return newIntConst(c, nopos, uint64(sz), v) } } panic("internal error") } if !d.DeclarationSpecifier.IsTypedef() { panic(d.Type) } return Operand{Type: d.Type, Value: &ir.Int64Value{Value: sz}} } func (c *context) toC(ch rune, val int) rune { if ch != IDENTIFIER { return ch } if x, ok := keywords[val]; ok { return x } return ch } // Source represents parser's input. type Source interface { Cache([]uint32) // Optionally cache the encoded source. Can be a no-operation. Cached() []uint32 // Return nil or the optionally encoded source cached by earlier call to Cache. Name() string // Result will be used in reporting source code positions. ReadCloser() (io.ReadCloser, error) // Where to read the source from Size() (int64, error) // Report the size of the source in bytes. String() string } // FileSource is a Source reading from a named file. type FileSource struct { *bufio.Reader f *os.File path string key cacheKey size int64 cacheable bool } // NewFileSource returns a newly created *FileSource reading from name. func NewFileSource(name string) (*FileSource, error) { return NewFileSource2(name, true) } // NewFileSource2 returns a newly created *FileSource reading from name. func NewFileSource2(name string, cacheable bool) (*FileSource, error) { //TODO-? f, err := os.Open(name) if err != nil { return nil, err } r := &FileSource{f: f, path: name, cacheable: cacheable} fi, err := f.Stat() if err != nil { return nil, err } r.size = fi.Size() r.key = cacheKey{name, fi.ModTime().UnixNano()} return r, nil } func (s *FileSource) String() string { return s.Name() } // Cache implements Source. func (s *FileSource) Cache(a []uint32) { if !s.cacheable { return } cacheMu.Lock() if len(cache) > cacheSize { for k := range cache { delete(cache, k) break } } cache[s.key] = a cacheMu.Unlock() } // Cached implements Source. func (s *FileSource) Cached() (r []uint32) { if !s.cacheable { return nil } cacheMu.Lock() var ok bool r, ok = cache[s.key] cacheMu.Unlock() if ok { s.Close() } return r } // Close implements io.ReadCloser. func (s *FileSource) Close() error { if f := s.f; f != nil { s.f = nil return f.Close() } return nil } // Name implements Source. func (s *FileSource) Name() string { return s.path } // ReadCloser implements Source. func (s *FileSource) ReadCloser() (io.ReadCloser, error) { s.Reader = bufio.NewReader(s.f) return s, nil } // Size implements Source. func (s *FileSource) Size() (int64, error) { return s.size, nil } // StringSource is a Source reading from a string. type StringSource struct { *strings.Reader name string src string } // NewStringSource returns a newly created *StringSource reading from src and // having the presumed name. func NewStringSource(name, src string) *StringSource { return &StringSource{name: name, src: src} } func (s *StringSource) String() string { return s.Name() } // Cache implements Source. func (s *StringSource) Cache(a []uint32) { cacheMu.Lock() if len(cache) > cacheSize { for k := range cache { delete(cache, k) break } } cache[cacheKey{mtime: -1, name: s.src}] = a cacheMu.Unlock() } // Cached implements Source. func (s *StringSource) Cached() (r []uint32) { cacheMu.Lock() r = cache[cacheKey{mtime: -1, name: s.src}] cacheMu.Unlock() return r } // Close implements io.ReadCloser. func (s *StringSource) Close() error { return nil } // Name implements Source. func (s *StringSource) Name() string { return s.name } // Size implements Source. func (s *StringSource) Size() (int64, error) { return int64(len(s.src)), nil } // ReadCloser implements Source. func (s *StringSource) ReadCloser() (io.ReadCloser, error) { s.Reader = strings.NewReader(s.src) return s, nil } // Scope binds names to declarations. type Scope struct { EnumTags map[int]*EnumSpecifier // name ID: *EnumSpecifier Idents map[int]Node // name ID: Node in {*Declarator, EnumerationConstant} Labels map[int]*LabeledStmt // name ID: label Parent *Scope StructTags map[int]*StructOrUnionSpecifier // name ID: *StructOrUnionSpecifier // parser support typedefs map[int]struct{} // name: nothing typedef bool structScope bool } func newScope(parent *Scope) *Scope { return &Scope{Parent: parent} } func (s *Scope) insertLabel(ctx *context, st *LabeledStmt) { for s.Parent != nil && s.Parent.Parent != nil { s = s.Parent } if s.Labels == nil { s.Labels = map[int]*LabeledStmt{} } if ex := s.Labels[st.Token.Val]; ex != nil { panic("TODO") } s.Labels[st.Token.Val] = st } func (s *Scope) insertEnumTag(ctx *context, nm int, es *EnumSpecifier) { for s.structScope { s = s.Parent } if s.EnumTags == nil { s.EnumTags = map[int]*EnumSpecifier{} } if ex := s.EnumTags[nm]; ex != nil { if ex == es || ex.isCompatible(es) { return } panic(fmt.Errorf("%s\n----\n%s", ex, es)) } s.EnumTags[nm] = es } func (s *Scope) insertDeclarator(ctx *context, d *Declarator) { if s.Idents == nil { s.Idents = map[int]Node{} } nm := d.Name() if ex := s.Idents[nm]; ex != nil { panic("internal error 8") } s.Idents[nm] = d } func (s *Scope) insertEnumerationConstant(ctx *context, c *EnumerationConstant) { for s.structScope { s = s.Parent } if s.Idents == nil { s.Idents = map[int]Node{} } nm := c.Token.Val if ex := s.Idents[nm]; ex != nil { if ex == c { return } if x, ok := ex.(*EnumerationConstant); ok && x.equal(c) { return } panic(fmt.Errorf("%v: %v, %v", ctx.position(c), ex, c)) } s.Idents[nm] = c } func (s *Scope) insertStructTag(ctx *context, ss *StructOrUnionSpecifier) { for s.structScope { s = s.Parent } if s.StructTags == nil { s.StructTags = map[int]*StructOrUnionSpecifier{} } nm := ss.IdentifierOpt.Token.Val if ex := s.StructTags[nm]; ex != nil && !ex.typ.IsCompatible(ss.typ) { panic(fmt.Errorf("%v: %v, %v", ctx.position(ss), ex.typ, ss.typ)) } s.StructTags[nm] = ss } func (s *Scope) insertTypedef(ctx *context, d *Declarator) { if s.typedefs == nil { s.typedefs = map[int]struct{}{} } // Redefinitions, if any, are ignored during parsing, but checked later in insertDeclarator. s.typedefs[d.Name()] = struct{}{} } func (s *Scope) isTypedef(nm int) bool { for s != nil { if _, ok := s.typedefs[nm]; ok { return true } s = s.Parent } return false } // LookupIdent will return the Node associated with name ID nm. func (s *Scope) LookupIdent(nm int) Node { for s != nil { if n := s.Idents[nm]; n != nil { return n } s = s.Parent } return nil } // LookupLabel will return the Node associated with label ID nm. func (s *Scope) LookupLabel(nm int) Node { for s != nil { if n := s.Labels[nm]; n != nil { if s.Parent == nil && s.Parent.Parent != nil { panic("internal error") } return n } s = s.Parent } return nil } func (s *Scope) lookupEnumTag(nm int) *EnumSpecifier { for s != nil { if n := s.EnumTags[nm]; n != nil { return n } s = s.Parent } return nil } func (s *Scope) lookupStructTag(nm int) *StructOrUnionSpecifier { for s != nil { if n := s.StructTags[nm]; n != nil { return n } s = s.Parent } return nil } func (s *Scope) String() string { var a []string for _, v := range s.Idents { switch x := v.(type) { case *Declarator: a = append(a, string(dict.S(x.Name()))) default: panic(fmt.Errorf("%T", x)) } } sort.Strings(a) return "{" + strings.Join(a, ", ") + "}" } ================================================ FILE: v2/cpp.go ================================================ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // [0]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf // [1]: https://www.spinellis.gr/blog/20060626/cpp.algo.pdf package cc import ( "bytes" "encoding/binary" "fmt" "go/token" "io" "math" "os" "path/filepath" "strconv" "strings" "github.com/cznic/golex/lex" "github.com/cznic/ir" "github.com/cznic/mathutil" "github.com/cznic/xc" ) const ( maxIncludeLevel = 200 // gcc, std is at least 15. ) var ( _ tokenReader = (*cppReader)(nil) _ tokenReader = (*tokenBuffer)(nil) _ tokenReader = (*tokenPipe)(nil) _ tokenWriter = (*tokenBuffer)(nil) _ tokenWriter = (*tokenPipe)(nil) ) type cppToken struct { xc.Token hs map[int]struct{} } func (t *cppToken) has(nm int) bool { _, ok := t.hs[nm]; return ok } func (t *cppToken) cloneAdd(nm int) map[int]struct{} { nhs := map[int]struct{}{nm: {}} for k, v := range t.hs { nhs[k] = v } return nhs } func (t *cppToken) hsAdd(hs map[int]struct{}) { if len(hs) == 0 { return } if len(t.hs) == 0 { t.hs = map[int]struct{}{} } for k := range hs { t.hs[k] = struct{}{} } } type tokenWriter interface { write(...cppToken) } type tokenReader interface { read() cppToken unget(cppToken) ungets(...cppToken) } type tokenPipe struct { b []byte ch chan cppToken s []cppToken emitWhiteSpace bool } func newTokenPipe(n int) *tokenPipe { return &tokenPipe{ch: make(chan cppToken, n)} } func (*tokenPipe) unget(cppToken) { panic("internal error") } func (*tokenPipe) ungets(...cppToken) { panic("internal error") } func (p *tokenPipe) close() { if len(p.s) != 0 { p.flush() } close(p.ch) } func (p *tokenPipe) flush() { p.b = p.b[:0] p.b = append(p.b, '"') for _, t := range p.s { s := dict.S(t.Val) p.b = append(p.b, s[1:len(s)-1]...) } p.b = append(p.b, '"') p.s[0].Val = dict.ID(p.b) p.ch <- p.s[0] p.s = p.s[:0] } func (p *tokenPipe) read() cppToken { t, ok := <-p.ch if !ok { t.Rune = ccEOF } return t } func (p *tokenPipe) write(toks ...cppToken) { for _, t := range toks { switch t.Rune { case '\n', ' ': if p.emitWhiteSpace { p.ch <- t } case STRINGLITERAL, LONGSTRINGLITERAL: p.s = append(p.s, t) default: if len(p.s) != 0 { p.flush() } p.ch <- t } } } type tokenBuffer struct { toks0 []cppToken toks []cppToken ungetBuffer last rune } func (b *tokenBuffer) write(t ...cppToken) { b.toks = append(b.toks, t...) if b.toks0 == nil || &b.toks0[0] != &b.toks[0] { b.toks0 = b.toks } } func (b *tokenBuffer) read() (t cppToken) { if len(b.ungetBuffer) != 0 { return b.ungetBuffer.read() } if len(b.toks) == 0 { t.Rune = ccEOF return } t = b.toks[0] b.toks = b.toks[1:] if len(b.toks) == 0 { b.toks = b.toks0[:0] } if t.Rune == '#' && (b.last == '\n' || b.last == 0) { t.Rune = DIRECTIVE } b.last = t.Rune return t } type cppReader struct { decBuf []byte decPos token.Pos tu [][]uint32 ungetBuffer last rune } func (c *cppReader) unget(t cppToken) { c.ungetBuffer = append(c.ungetBuffer, t) } func (c *cppReader) read() (t cppToken) { if len(c.ungetBuffer) != 0 { return c.ungetBuffer.read() } more: if len(c.decBuf) == 0 { if len(c.tu) == 0 { t.Rune = ccEOF return t } if len(c.tu[0]) == 0 { c.tu = c.tu[1:] goto more } c.decBuf = dict.S(int(c.tu[0][0])) c.tu[0] = c.tu[0][1:] c.decPos = 0 } c.decBuf, c.decPos, t.Token = decodeToken(c.decBuf, c.decPos) if t.Rune == '#' && (c.last == '\n' || c.last == 0) { t.Rune = DIRECTIVE } c.last = t.Rune return t } type conds []cond func (c conds) on() bool { return condOn[c.tos()] } func (c conds) pop() conds { return c[:len(c)-1] } func (c conds) push(n cond) conds { return append(c, n) } func (c conds) tos() cond { return c[len(c)-1] } // Macro represents a preprocessor Macro. type Macro struct { Args []int // Numeric IDs of argument identifiers. DefTok xc.Token // Macro name definition token. ReplacementToks []xc.Token // The tokens that replace the macro. R/O IsFnLike bool // Whether the macro is function like. IsVariadic bool // Whether the macro is variadic. ident bool } func newMacro(def xc.Token, repl []xc.Token) *Macro { return &Macro{DefTok: def, ReplacementToks: append([]xc.Token(nil), repl...)} } // Eval attempts to evaluate m, which must be a simple macro, like `#define foo numeric-literal`. func (m *Macro) Eval(model Model, macros map[int]*Macro) (op Operand, err error) { returned := false defer func() { e := recover() if !returned && err == nil { err = fmt.Errorf("PANIC: %v\n%s", e, debugStack()) } }() if m.IsFnLike { return op, fmt.Errorf("cannot evaluate function-like macro") } ctx, err := newContext(&Tweaks{}) if err != nil { return op, err } ctx.model = model c := newCPP(ctx) c.macros = macros if op, _ = c.constExpr(cppToks(m.ReplacementToks), false); op.Type == nil { return op, fmt.Errorf("cannot evaluate macro") } returned = true return op, nil } func (m *Macro) param(ap [][]cppToken, nm int, out *[]cppToken) bool { *out = nil if nm == idVaArgs { if !m.IsVariadic { return false } if i := len(m.Args); i < len(ap) { o := *out for i, v := range ap[i:] { if i != 0 { switch lo := len(o); lo { case 0: var t cppToken t.Rune = ',' t.Val = 0 o = append(o, t) default: t := o[len(o)-1] t.Rune = ',' t.Val = 0 o = append(o, t) t.Rune = ' ' o = append(o, t) } } o = append(o, v...) } *out = o } return true } if len(m.Args) != 0 && nm == m.Args[len(m.Args)-1] && m.IsVariadic && !m.ident { if i := len(m.Args) - 1; i < len(ap) { o := *out for i, v := range ap[i:] { if i != 0 { switch lo := len(o); lo { case 0: var t cppToken t.Rune = ',' t.Val = 0 o = append(o, t) default: t := o[len(o)-1] t.Rune = ',' t.Val = 0 o = append(o, t) t.Rune = ' ' o = append(o, t) } } o = append(o, v...) } *out = o } return true } for i, v := range m.Args { if v == nm { *out = ap[i] return true } } return false } type nullReader struct{} func (nullReader) Read([]byte) (int, error) { return 0, io.EOF } type cpp struct { *context includeLevel int lx *lexer macroStack map[int][]*Macro macros map[int]*Macro // name ID: macro toks []cppToken } func newCPP(ctx *context) *cpp { lx, err := newLexer(ctx, "", 0, nullReader{}) if err != nil { panic(err) } lx.context = ctx r := &cpp{ context: ctx, lx: lx, macroStack: map[int][]*Macro{}, macros: map[int]*Macro{}, } return r } func (c *cpp) parse(src ...Source) (tokenReader, error) { var ( encBuf []byte encBuf1 [30]byte // Rune, position, optional value ID. tokBuf []cppToken tu [][]uint32 ) for _, v := range src { if pf := v.Cached(); pf != nil { tu = append(tu, pf) continue } sz, err := v.Size() if err != nil { return nil, err } if sz > mathutil.MaxInt { return nil, fmt.Errorf("%v: file too big: %v", v.Name(), sz) } r, err := v.ReadCloser() if err != nil { return nil, err } lx, err := newLexer(c.context, v.Name(), int(sz), r) if err != nil { return nil, err } if err := func() (err error) { returned := false defer func() { e := recover() if !returned && err == nil { err = fmt.Errorf("PANIC: %v\n%s", e, debugStack()) c.err(nopos, "%v", err) } if e := r.Close(); e != nil && err == nil { err = e } }() var pf []uint32 var t cppToken var toks []cppToken for { ch := lx.cppScan() if ch.Rune == ccEOF { break } tokBuf = tokBuf[:0] for { t.Char = ch t.Val = 0 if ch.Rune == '\n' { toks = append(cppTrimSpace(tokBuf), t) break } if _, ok := tokHasVal[ch.Rune]; ok { t.Val = dict.ID(lx.TokenBytes(nil)) } tokBuf = append(tokBuf, t) if ch = lx.cppScan(); ch.Rune == ccEOF { if !c.tweaks.InjectFinalNL { c.errPos(lx.last.Pos(), "file is missing final newline") } ch.Rune = '\n' } } var encPos token.Pos encBuf = encBuf[:0] for _, t := range toks { n := binary.PutUvarint(encBuf1[:], uint64(t.Rune)) pos := t.Pos() n += binary.PutUvarint(encBuf1[n:], uint64(pos-encPos)) encPos = pos if t.Val != 0 { n += binary.PutUvarint(encBuf1[n:], uint64(t.Val)) } encBuf = append(encBuf, encBuf1[:n]...) } id := dict.ID(encBuf) if int64(id) > math.MaxUint32 { panic("internal error 4") } pf = append(pf, uint32(id)) } v.Cache(pf) tu = append(tu, pf) returned = true return nil }(); err != nil { return nil, err } } return &cppReader{tu: tu}, nil } func (c *cpp) eval(r tokenReader, w tokenWriter) (err error) { c.macros[idFile] = &Macro{ReplacementToks: []xc.Token{{Char: lex.NewChar(0, STRINGLITERAL)}}} c.macros[idLineMacro] = &Macro{ReplacementToks: []xc.Token{{Char: lex.NewChar(0, INTCONST)}}} if cs := c.expand(r, w, conds(nil).push(condZero), 0, false); len(cs) != 1 || cs.tos() != condZero { return fmt.Errorf("unexpected top of condition stack value: %v", cs) } return nil } // [1]pg 1. // // expand(TS ) /* recur, substitute, pushback, rescan */ // { // if TS is {} then // // ---------------------------------------------------------- A // return {}; // // else if TS is T^HS • TS’ and T is in HS then // //----------------------------------------------------------- B // return T^HS • expand(TS’); // // else if TS is T^HS • TS’ and T is a "()-less macro" then // // ---------------------------------------------------------- C // return expand(subst(ts(T), {}, {}, HS \cup {T}, {}) • TS’ ); // // else if TS is T^HS •(•TS’ and T is a "()’d macro" then // // ---------------------------------------------------------- D // check TS’ is actuals • )^HS’ • TS’’ and actuals are "correct for T" // return expand(subst(ts(T), fp(T), actuals,(HS \cap HS’) \cup {T }, {}) • TS’’); // // // ------------------------------------------------------------------ E // note TS must be T^HS • TS’ // return T^HS • expand(TS’); // } func (c *cpp) expand(r tokenReader, w tokenWriter, cs conds, lvl int, expandDefined bool) conds { for { t := r.read() switch t.Rune { // First, if TS is the empty set, the result is the // empty set. case ccEOF: // -------------------------------------------------- A // return {}; return cs case DIRECTIVE: cs = c.directive(r, w, cs) t.Rune = '\n' t.Val = 0 w.write(t) case IDENTIFIER: if !cs.on() { break } nm := t.Val if nm == idDefined && expandDefined { more: switch t = r.read(); t.Rune { case ccEOF: panic("TODO") case IDENTIFIER: nm := t.Val t.Rune = INTCONST t.Val = idZero if _, ok := c.macros[nm]; ok { t.Val = idOne } w.write(t) continue case ' ': goto more case '(': // defined(name) var u cppToken switch t = r.read(); t.Rune { case ccEOF: panic("TODO") case IDENTIFIER: nm := t.Val u = t u.Rune = INTCONST u.Val = idZero if _, ok := c.macros[nm]; ok { u.Val = idOne } more2: switch t = r.read(); t.Rune { case ccEOF: panic("TODO") case ' ': goto more2 case ')': // ok done w.write(u) continue default: panic(t.String()) } default: panic(t.String()) } default: panic(t.String()) } } // Otherwise, if the token sequence begins with a token // whose hide set contains that token, then the result // is the token sequence beginning with that token // (including its hide set) followed by the result of // expand on the rest of the token sequence. if t.has(nm) { // ------------------------------------------ B // return T^HS • expand(TS’); w.write(t) continue } m := c.macros[nm] if m != nil && !m.IsFnLike { // Otherwise, if the token sequence begins with // an object-like macro, the result is the // expansion of the rest of the token sequence // beginning with the sequence returned by // subst invoked with the replacement token // sequence for the macro, two empty sets, the // union of the macro’s hide set and the macro // itself, and an empty set. switch nm { case idFile: m.ReplacementToks[0].Val = dict.SID(fmt.Sprintf("%q", c.position(t).Filename)) case idLineMacro: m.ReplacementToks[0].Val = dict.SID(fmt.Sprint(c.position(t).Line)) } // ------------------------------------------ C // return expand(subst(ts(T), {}, {}, HS \cup {T}, {}) • TS’ ); toks := c.subst(m, nil, t.cloneAdd(nm), expandDefined) for i, v := range toks { toks[i].Char = lex.NewChar(t.Pos(), v.Rune) } r.ungets(toks...) continue } if m != nil && m.IsFnLike { // ------------------------------------------ D // check TS’ is actuals • )^HS’ • TS’’ and actuals are "correct for T" // return expand(subst(ts(T), fp(T), actuals,(HS \cap HS’) \cup {T }, {}) • TS’’); hs := t.hs again: switch t2 := r.read(); t2.Rune { case '\n', ' ': goto again case '(': // ok case ccEOF: w.write(t) continue default: w.write(t) w.write(t2) continue } ap, hs2 := c.actuals(m, r) switch { case len(hs2) == 0: hs2 = map[int]struct{}{nm: {}} default: nhs := map[int]struct{}{} for k := range hs { if _, ok := hs2[k]; ok { nhs[k] = struct{}{} } } nhs[nm] = struct{}{} hs2 = nhs } toks := c.subst(m, ap, hs2, expandDefined) for i, v := range toks { toks[i].Char = lex.NewChar(t.Pos(), v.Rune) } r.ungets(toks...) continue } w.write(t) default: // -------------------------------------------------- E if !cs.on() { break } w.write(t) } } } func (c *cpp) pragmaActuals(nd Node, line []cppToken) (out []cppToken) { first := true for { if len(line) == 0 { c.err(nd, "unexpected EOF") return nil } t := line[0] line = line[1:] switch t.Rune { case '(': if !first { panic(fmt.Errorf("%v", t)) } first = false case STRINGLITERAL: out = append(out, t) case ')': return out default: panic(fmt.Errorf("%v: %v (%v)", c.position(t), t, yySymName(int(t.Rune)))) } } } func (c *cpp) actuals(m *Macro, r tokenReader) (out [][]cppToken, hs map[int]struct{}) { var lvl, n int for { t := r.read() if t.Rune < 0 { c.err(t, "unexpected EOF") return nil, nil } switch t.Rune { case ',': if lvl == 0 { n++ continue } case ')': if lvl == 0 { for i, v := range out { out[i] = cppTrimSpace(v) } for len(out) < len(m.Args) { out = append(out, nil) } return out, t.hs } lvl-- case '(': lvl++ } for len(out) <= n { out = append(out, []cppToken{}) } if t.Rune == '\n' { t.Rune = ' ' } out[n] = append(out[n], t) } } func (c *cpp) expands(toks []cppToken, expandDefined bool) (out []cppToken) { var r, w tokenBuffer r.toks = toks c.expand(&r, &w, conds(nil).push(condZero), 1, expandDefined) return w.toks } // [1]pg 2. // // subst(IS, FP, AP, HS, OS) /* substitute args, handle stringize and paste */ // { // if IS is {} then // // ---------------------------------------------------------- A // return hsadd(HS, OS); // // else if IS is # • T • IS’ and T is FP[i] then // // ---------------------------------------------------------- B // return subst(IS’, FP, AP, HS, OS • stringize(select(i, AP))); // // else if IS is ## • T • IS’ and T is FP[i] then // { // // ---------------------------------------------------------- C // if select(i, AP) is {} then /* only if actuals can be empty */ // // -------------------------------------------------- D // return subst(IS’, FP, AP, HS, OS); // else // // -------------------------------------------------- E // return subst(IS’, FP, AP, HS, glue(OS, select(i, AP))); // } // // else if IS is ## • T^HS’ • IS’ then // // ---------------------------------------------------------- F // return subst(IS’, FP, AP, HS, glue(OS, T^HS’)); // // else if IS is T • ##^HS’ • IS’ and T is FP[i] then // { // // ---------------------------------------------------------- G // if select(i, AP) is {} then /* only if actuals can be empty */ // { // // -------------------------------------------------- H // if IS’ is T’ • IS’’ and T’ is FP[j] then // // ------------------------------------------ I // return subst(IS’’, FP, AP, HS, OS • select(j, AP)); // else // // ------------------------------------------ J // return subst(IS’, FP, AP, HS, OS); // } // else // // -------------------------------------------------- K // return subst(##^HS’ • IS’, FP, AP, HS, OS • select(i, AP)); // // } // // else if IS is T • IS’ and T is FP[i] then // // ---------------------------------------------------------- L // return subst(IS’, FP, AP, HS, OS • expand(select(i, AP))); // // // ------------------------------------------------------------------ M // note IS must be T^HS’ • IS’ // return subst(IS’, FP, AP, HS, OS • T^HS’); // } // // A quick overview of subst is that it walks through the input sequence, IS, // building up an output sequence, OS, by handling each token from left to // right. (The order that this operation takes is left to the implementation // also, walking from left to right is more natural since the rest of the // algorithm is constrained to this ordering.) Stringizing is easy, pasting // requires trickier handling because the operation has a bunch of // combinations. After the entire input sequence is finished, the updated hide // set is applied to the output sequence, and that is the result of subst. func (c *cpp) subst(m *Macro, ap [][]cppToken, hs map[int]struct{}, expandDefined bool) (out []cppToken) { // dbg("%s %v %v", m.def.S(), m.variadic, ap) repl := cppToks(m.ReplacementToks) var arg []cppToken for { if len(repl) == 0 { // -------------------------------------------------- A // return hsadd(HS, OS); out := cppTrimSpace(out) for i := range out { out[i].hsAdd(hs) } return out } if repl[0].Rune == '#' && len(repl) > 1 && repl[1].Rune == IDENTIFIER && m.param(ap, repl[1].Val, &arg) { // -------------------------------------------------- B // return subst(IS’, FP, AP, HS, OS • stringize(select(i, AP))); out = append(out, c.stringize(arg)) repl = repl[2:] continue } if repl[0].Rune == '#' && len(repl) > 2 && repl[1].Rune == ' ' && repl[2].Rune == IDENTIFIER && m.param(ap, repl[2].Val, &arg) { // -------------------------------------------------- B // return subst(IS’, FP, AP, HS, OS • stringize(select(i, AP))); out = append(out, c.stringize(arg)) repl = repl[3:] continue } if repl[0].Rune == PPPASTE && len(repl) > 1 && repl[1].Rune == IDENTIFIER && m.param(ap, repl[1].Val, &arg) { // -------------------------------------------------- C if len(arg) == 0 { // ------------------------------------------ D // return subst(IS’, FP, AP, HS, OS); repl = repl[2:] continue } // -------------------------------------------------- E // return subst(IS’, FP, AP, HS, glue(OS, select(i, AP))); _, out = c.glue(out, arg) repl = repl[2:] continue } if repl[0].Rune == PPPASTE && len(repl) > 2 && repl[1].Rune == ' ' && repl[2].Rune == IDENTIFIER && m.param(ap, repl[2].Val, &arg) { // -------------------------------------------------- C if len(arg) == 0 { // ------------------------------------------ D // return subst(IS’, FP, AP, HS, OS); repl = repl[3:] continue } // -------------------------------------------------- E // return subst(IS’, FP, AP, HS, glue(OS, select(i, AP))); _, out = c.glue(out, arg) repl = repl[3:] continue } if repl[0].Rune == PPPASTE && len(repl) > 1 && repl[1].Rune != ' ' { // -------------------------------------------------- F // return subst(IS’, FP, AP, HS, glue(OS, T^HS’)); _, out = c.glue(out, repl[1:2]) repl = repl[2:] continue } if repl[0].Rune == PPPASTE && len(repl) > 2 && repl[1].Rune == ' ' { // -------------------------------------------------- F // return subst(IS’, FP, AP, HS, glue(OS, T^HS’)); _, out = c.glue(out, repl[2:3]) repl = repl[3:] continue } if len(repl) > 1 && repl[0].Rune == IDENTIFIER && m.param(ap, repl[0].Val, &arg) && repl[1].Rune == PPPASTE { // -------------------------------------------------- G if len(arg) == 0 { // ------------------------------------------ H panic(c.position(repl[0])) } // -------------------------------------------------- K // return subst(##^HS’ • IS’, FP, AP, HS, OS • select(i, AP)); out = append(out, arg...) repl = repl[1:] continue } if len(repl) > 2 && repl[0].Rune == IDENTIFIER && m.param(ap, repl[0].Val, &arg) && repl[1].Rune == ' ' && repl[2].Rune == PPPASTE { // -------------------------------------------------- G if len(arg) == 0 { // ------------------------------------------ H if len(repl) > 3 && repl[3].Rune == IDENTIFIER && m.param(ap, repl[3].Val, &arg) { // ---------------------------------- I panic(c.position(repl[0])) } // ------------------------------------------ J // return subst(IS’, FP, AP, HS, OS); repl = repl[3:] continue } // -------------------------------------------------- K // return subst(##^HS’ • IS’, FP, AP, HS, OS • select(i, AP)); out = append(out, arg...) repl = repl[2:] continue } if repl[0].Rune == IDENTIFIER && m.param(ap, repl[0].Val, &arg) { // -------------------------------------------------- L // return subst(IS’, FP, AP, HS, OS • expand(select(i, AP))); out = append(out, c.expands(arg, expandDefined)...) repl = repl[1:] continue } // ---------------------------------------------------------- M // note IS must be T^HS’ • IS’ // return subst(IS’, FP, AP, HS, OS • T^HS’); out = append(out, repl[0]) repl = repl[1:] } } // paste last of left side with first of right side // // [1] pg. 3 func (c *cpp) glue(ls, rs []cppToken) (n int, out []cppToken) { for len(ls) != 0 && ls[len(ls)-1].Rune == ' ' { ls = ls[:len(ls)-1] } for len(rs) != 0 && rs[0].Rune == ' ' { rs = rs[1:] n++ } if len(rs) == 0 { panic("TODO") } if len(ls) == 0 { return n, rs } l := ls[len(ls)-1] ls = ls[:len(ls)-1] r := rs[0] rs = rs[1:] n++ switch l.Rune { case '#': switch r.Rune { case '#': l.Rune = PPPASTE default: panic(PrettyString([]cppToken{l, r})) } default: switch l.Rune { case STRINGLITERAL: s := TokSrc(l.Token) if len(s) > 2 && s[0] == '"' && s[len(s)-1] == '"' { s = s[1 : len(s)-1] } l.Val = dict.SID(s + TokSrc(r.Token)) default: l.Val = dict.SID(TokSrc(l.Token) + TokSrc(r.Token)) } } return n, append(append(ls, l), rs...) } // Given a token sequence, stringize returns a single string literal token // containing the concatenated spellings of the tokens. // // [1] pg. 3 func (c *cpp) stringize(s []cppToken) cppToken { var a []string for _, v := range s { switch v.Rune { case CHARCONST, LONGCHARCONST, LONGSTRINGLITERAL, STRINGLITERAL: s := fmt.Sprintf("%q", TokSrc(v.Token)) a = append(a, s[1:len(s)-1]) default: a = append(a, TokSrc(v.Token)) } } if v := dict.SID(fmt.Sprintf(`"%s"`, strings.Join(a, ""))); v != 0 { var t cppToken if len(s) != 0 { t = s[0] } t.Rune = STRINGLITERAL t.Val = v return t } return cppToken{} } func (c *cpp) directive(r tokenReader, w tokenWriter, cs conds) (y conds) { line := c.line(r) if len(line) == 0 { return cs } if cs.on() { if f := c.tweaks.TrackExpand; f != nil && c.tweaks.DefinesOnly { if s := cppToksDump(line, ""); strings.HasPrefix(s, "define") { f(fmt.Sprintf("#%s", cppToksDump(line, ""))) } } } outer: switch t := line[0]; t.Rune { case ccEOF: // nop case IDENTIFIER: switch t.Val { case idDefine: if !cs.on() { break } if len(line) == 1 { c.err(t, "empty define not allowed") break } c.define(line[1:]) case idElif: switch cs.tos() { case condIfOff: if _, ok := c.constExpr(line[1:], true); ok { return cs.pop().push(condIfOn) } case condIfOn: return cs.pop().push(condIfSkip) case condIfSkip: // nop default: panic(fmt.Errorf("%v: %v", c.position(t), cs.tos())) } case idElse: switch cs.tos() { case condIfOff: return cs.pop().push(condIfOn) case condIfOn: return cs.pop().push(condIfOff) case condIfSkip: // nop default: panic(fmt.Errorf("%v: %v", c.position(t), cs.tos())) } case idError: if !cs.on() { break } c.err(t, "%s", cppToksDump(line, "")) case idIf: if !cs.on() { return cs.push(condIfSkip) } switch _, ok := c.constExpr(line[1:], true); { case ok: return cs.push(condIfOn) default: return cs.push(condIfOff) } case idIfdef: if !cs.on() { return cs.push(condIfSkip) } line = cppTrimAllSpace(line[1:]) if len(line) == 0 { c.err(t, "empty #ifdef not allowed") break } if len(line) > 1 { c.err(t, "extra tokens after #ifdef not allowed") break } if line[0].Rune != IDENTIFIER { c.err(line[0], "expected identifier") break } if _, ok := c.macros[line[0].Val]; ok { return cs.push(condIfOn) } return cs.push(condIfOff) case idIfndef: if !cs.on() { return cs.push(condIfSkip) } line = cppTrimAllSpace(line[1:]) if len(line) == 0 { c.err(t, "empty #ifndef not allowed") break } if len(line) > 1 { c.err(t, "extra tokens after #ifndef not allowed") break } if line[0].Rune != IDENTIFIER { c.err(line[0], "expected identifier") break } if _, ok := c.macros[line[0].Val]; ok { return cs.push(condIfOff) } return cs.push(condIfOn) case idIncludeNext, idInclude: if !cs.on() { break } line = cppTrimAllSpace(line[1:]) if len(line) == 0 { c.err(t, "empty include not allowed") break } expanded := false again: switch line[0].Rune { case '<': if c.tweaks.cppExpandTest { w.write(line...) return cs } var nm string for _, v := range line[1:] { if v.Rune == '>' { c.include(t, nm, c.sysIncludePaths, w) return cs } nm += TokSrc(v.Token) } c.err(t, "invalid include file name specification") case STRINGLITERAL: if c.tweaks.cppExpandTest { w.write(line...) return cs } b := dict.S(line[0].Val) // `"foo.h"` nm := string(b[1 : len(b)-1]) // `foo.h` c.include(t, nm, c.includePaths, w) return cs default: if expanded { panic(PrettyString(line)) } line = c.expands(cppTrimAllSpace(line), false) expanded = true if c.tweaks.cppExpandTest { w.write(line...) return cs } goto again } case idEndif: switch cs.tos() { case condIfOn, condIfOff, condIfSkip: return cs.pop() default: panic(fmt.Errorf("%v: %v", c.position(t), cs.tos())) } case idLine: if !cs.on() { break } f := fset.File(line[0].Pos()) off := f.Offset(line[0].Pos()) pos := c.position(line[0]) line = c.expands(cppTrimAllSpace(line[1:]), false) switch len(line) { case 1: // #line linenum n, err := strconv.ParseUint(string(line[0].S()), 10, 31) if err != nil { break } f.AddLineInfo(off, pos.Filename, int(n-1)) //TODO case 2: // #line linenum filename //TODO default: // ignore } // ignored case idPragma: if !cs.on() { break } for { line = line[1:] if len(line) == 0 { panic(fmt.Errorf("%v", c.position(t))) } switch t = line[0]; { case t.Rune == ' ': // nop case t.Val == idPushMacro: actuals := c.pragmaActuals(t, line[1:]) if len(actuals) != 1 { panic(fmt.Errorf("%v", c.position(t))) } t := actuals[0] switch t.Rune { case STRINGLITERAL: nm := int(c.strConst(t.Token).Value.(*ir.StringValue).StringID) m := c.macros[nm] if m != nil { c.macroStack[nm] = append(c.macroStack[nm], m) } break outer default: panic(fmt.Errorf("%v: %v", c.position(t), yySymName(int(actuals[0].Rune)))) } case t.Val == idPopMacro: actuals := c.pragmaActuals(t, line[1:]) if len(actuals) != 1 { panic(fmt.Errorf("%v", c.position(t))) } t := actuals[0] switch t.Rune { case STRINGLITERAL: nm := int(c.strConst(t.Token).Value.(*ir.StringValue).StringID) s := c.macroStack[nm] if n := len(s); n != 0 { m := s[n-1] s = s[:n-1] c.macroStack[nm] = s c.macros[nm] = m } break outer default: panic(fmt.Errorf("%v: %v", c.position(t), yySymName(int(actuals[0].Rune)))) } default: if c.tweaks.IgnoreUnknownPragmas { break outer } panic(fmt.Errorf("%v: %#x, %v", c.position(t), t.Rune, t)) } } case idUndef: if !cs.on() { break } line = cppTrimSpace(line[1:]) if len(line) == 0 { panic("TODO") } if len(line) > 1 { panic("TODO") } if line[0].Rune != IDENTIFIER { panic("TODO") } delete(c.macros, line[0].Val) case idWarning: if !cs.on() { break } panic(fmt.Errorf("%v", c.position(t))) default: panic(fmt.Errorf("%v %v", c.position(t), PrettyString(t))) } default: panic(PrettyString(t)) } return cs } func (c *cpp) include(n Node, nm string, paths []string, w tokenWriter) { if c.includeLevel == maxIncludeLevel { c.err(n, "too many include levels") } c.includeLevel++ defer func() { c.includeLevel-- }() dir := filepath.Dir(c.position(n).Filename) if d, err := filepath.Abs(dir); err == nil { dir = d } var path string if n.(cppToken).Val == idIncludeNext { nmDir, _ := filepath.Split(nm) for i, v := range paths { if w, err := filepath.Abs(v); err == nil { v = w } v = filepath.Join(v, nmDir) if v == dir { paths = paths[i+1:] break } } } for _, v := range paths { if v == "@" { v = dir } var p string switch { case strings.HasPrefix(nm, "./"): p = nm default: p = filepath.Join(v, nm) } fi, err := os.Stat(p) if err != nil || fi.IsDir() { continue } path = p break } if path == "" { wd, _ := os.Getwd() c.err(n, "include file not found: %s\nworking dir: %s\nsearch paths:\n\t%s", nm, wd, strings.Join(paths, "\n\t")) return } s, err := NewFileSource2(path, true) if err != nil { c.err(n, "%s", err.Error()) return } if n, _ := s.Size(); n == 0 { return } if f := c.tweaks.TrackIncludes; f != nil { f(path) } r, err := c.parse(s) if err != nil { c.err(n, "%s", err.Error()) } c.expand(r, w, conds(nil).push(condZero), 0, false) } func (c *cpp) constExpr(toks []cppToken, expandDefined bool) (op Operand, y bool) { toks = cppTrimAllSpace(c.expands(cppTrimAllSpace(toks), expandDefined)) for i, v := range toks { if v.Rune == IDENTIFIER { toks[i].Rune = INTCONST toks[i].Val = idZero } } c.lx.ungetBuffer = c.lx.ungetBuffer[:0] c.lx.ungets(toks...) if !c.lx.parseExpr() { return Operand{}, false } e := c.lx.ast.(*ConstExpr) v := e.eval(c.context) if v.Type != Int { return v, false } switch x := v.Value.(type) { case *ir.Int64Value: return v, x.Value != 0 default: return v, false } } func (c *cpp) define(line []cppToken) { switch line[0].Rune { case ' ': c.defineMacro(xcToks(line[1:])) default: panic(PrettyString(line)) } } func (c *cpp) defineMacro(line []xc.Token) { if len(line) == 0 { panic("internal error") } if line[0].Rune == ' ' { line = line[1:] } switch t := line[0]; t.Rune { case IDENTIFIER: nm := t.Val if protectedMacro[nm] { panic("TODO") } line := line[1:] var repl []xc.Token if len(line) != 0 { switch line[0].Rune { case '\n', ccEOF: // nop case ' ': repl = line[1:] case '(': c.defineFnMacro(t, line[1:]) return default: panic(fmt.Errorf(PrettyString(line[0]))) } } if ex := c.macros[nm]; ex != nil { if c.identicalReplacementLists(repl, ex.ReplacementToks) { return } c.err(t, "%q replacement lists differ: %q, %q", dict.S(nm), toksDump(ex.ReplacementToks, ""), toksDump(repl, "")) return } if traceMacroDefs { fmt.Fprintf(os.Stderr, "#define %s %s\n", dict.S(nm), toksDump(repl, "")) } c.macros[nm] = newMacro(t, repl) default: panic(PrettyString(t)) } } func (c *cpp) identicalReplacementLists(a, b []xc.Token) bool { if len(a) != len(b) { return false } for i, v := range a { w := b[i] if v.Rune != w.Rune || v.Val != w.Val { return false } } return true } func (c *cpp) defineFnMacro(nmTok xc.Token, line []xc.Token) { ident := true var params []int variadic := false for i, v := range line { switch v.Rune { case IDENTIFIER: if !ident { panic("TODO") } params = append(params, v.Val) ident = false case ')': m := newMacro(nmTok, trimSpace(line[i+1:])) m.IsFnLike = true m.ident = ident m.IsVariadic = variadic m.Args = params if ex := c.macros[nmTok.Val]; ex != nil { if c.identicalParamLists(params, ex.Args) && c.identicalReplacementLists(m.ReplacementToks, ex.ReplacementToks) && m.IsVariadic == ex.IsVariadic { return } c.err(nmTok, "parameter and/or replacement lists differ") return } if traceMacroDefs { var a [][]byte for _, v := range m.Args { a = append(a, dict.S(v)) } fmt.Fprintf(os.Stderr, "#define %s(%s) %s\n", dict.S(nmTok.Val), bytes.Join(a, []byte(", ")), toksDump(m.ReplacementToks, "")) } c.macros[nmTok.Val] = m return case ',': if ident { panic("TODO") } ident = true case ' ': // nop case DDD: variadic = true default: panic(PrettyString(v)) } } } func (c *cpp) identicalParamLists(a, b []int) bool { if len(a) != len(b) { return false } for i, v := range a { if v != b[i] { return false } } return true } func (c *cpp) line(r tokenReader) []cppToken { c.toks = c.toks[:0] for { switch t := r.read(); t.Rune { case '\n', ccEOF: if len(c.toks) == 0 || c.toks[0].Rune != ' ' { return c.toks } for i, v := range c.toks { if v.Rune != ' ' { n := copy(c.toks, c.toks[i:]) c.toks = c.toks[:n] return c.toks } } c.toks = c.toks[:0] return c.toks default: c.toks = append(c.toks, t) } } } ================================================ FILE: v2/encoding.go ================================================ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "encoding/binary" "go/token" "reflect" "strconv" "github.com/cznic/golex/lex" "github.com/cznic/ir" "github.com/cznic/strutil" "github.com/cznic/xc" ) var ( dict = xc.Dict printHooks = strutil.PrettyPrintHooks{} ) func init() { for k, v := range xc.PrintHooks { printHooks[k] = v } delete(printHooks, reflect.TypeOf(token.Pos(0))) lcRT := reflect.TypeOf(lex.Char{}) lcH := func(f strutil.Formatter, v interface{}, prefix, suffix string) { c := v.(lex.Char) r := c.Rune s := yySymName(int(r)) if x := s[0]; x >= '0' && x <= '9' { s = strconv.QuoteRune(r) } f.Format(prefix) f.Format("%s", s) f.Format(suffix) } printHooks[lcRT] = lcH printHooks[reflect.TypeOf(xc.Token{})] = func(f strutil.Formatter, v interface{}, prefix, suffix string) { t := v.(xc.Token) if (t == xc.Token{}) { return } lcH(f, t.Char, prefix, "") if s := t.S(); len(s) != 0 { f.Format(" %q", s) } f.Format(suffix) } for _, v := range []interface{}{ (*ir.Float32Value)(nil), (*ir.Float64Value)(nil), (*ir.Int32Value)(nil), (*ir.Int64Value)(nil), (*ir.StringValue)(nil), DirectDeclaratorCase(0), ExprCase(0), Linkage(0), StorageDuration(0), TypeKind(0), ir.Linkage(0), } { printHooks[reflect.TypeOf(v)] = func(f strutil.Formatter, v interface{}, prefix, suffix string) { f.Format(prefix) f.Format("%v", v) f.Format(suffix) } } } var ( nopos xc.Token // Null pointer, [0]6.3.2.3-3. Null = &ir.AddressValue{} idAsm = dict.SID("asm") idAttribute = dict.SID("__attribute__") idBuiltinAlloca = dict.SID("__builtin_alloca") idBuiltinClasifyType = dict.SID("__builtin_classify_type") idBuiltinTypesCompatible = dict.SID("__builtin_types_compatible__") // Implements __builtin_types_compatible_p idBuiltinVaList = dict.SID("__builtin_va_list") idChar = dict.SID("char") idConst = dict.SID("const") idDefine = dict.SID("define") idDefined = dict.SID("defined") idElif = dict.SID("elif") idElse = dict.SID("else") idEndif = dict.SID("endif") idError = dict.SID("error") idFile = dict.SID("__FILE__") idFuncName = dict.SID("__func__") idIf = dict.SID("if") idIfdef = dict.SID("ifdef") idIfndef = dict.SID("ifndef") idInclude = dict.SID("include") idIncludeNext = dict.SID("include_next") idLine = dict.SID("line") idLineMacro = dict.SID("__LINE__") idMain = dict.SID("main") idOne = dict.SID("1") idPopMacro = dict.SID("pop_macro") idPragma = dict.SID("pragma") idPtrdiffT = dict.SID("ptrdiff_t") idPushMacro = dict.SID("push_macro") idSizeT = dict.SID("size_t") idStatic = dict.SID("static") idUndef = dict.SID("undef") idVaArgs = dict.SID("__VA_ARGS__") idVaList = dict.SID("va_list") idWarning = dict.SID("warning") idWcharT = dict.SID("wchar_t") idZero = dict.SID("0") protectedMacro = map[int]bool{ idFile: true, idLineMacro: true, } keywords = map[int]rune{ dict.SID("_Bool"): BOOL, dict.SID("_Complex"): COMPLEX, dict.SID("__alignof__"): ALIGNOF, dict.SID("auto"): AUTO, dict.SID("break"): BREAK, dict.SID("case"): CASE, dict.SID("char"): CHAR, dict.SID("const"): CONST, dict.SID("continue"): CONTINUE, dict.SID("default"): DEFAULT, dict.SID("do"): DO, dict.SID("double"): DOUBLE, dict.SID("else"): ELSE, dict.SID("enum"): ENUM, dict.SID("extern"): EXTERN, dict.SID("float"): FLOAT, dict.SID("for"): FOR, dict.SID("goto"): GOTO, dict.SID("if"): IF, dict.SID("inline"): INLINE, dict.SID("int"): INT, dict.SID("long"): LONG, dict.SID("register"): REGISTER, dict.SID("restrict"): RESTRICT, dict.SID("return"): RETURN, dict.SID("short"): SHORT, dict.SID("signed"): SIGNED, dict.SID("sizeof"): SIZEOF, dict.SID("static"): STATIC, dict.SID("struct"): STRUCT, dict.SID("switch"): SWITCH, dict.SID("typedef"): TYPEDEF, dict.SID("typeof"): TYPEOF, dict.SID("union"): UNION, dict.SID("unsigned"): UNSIGNED, dict.SID("void"): VOID, dict.SID("volatile"): VOLATILE, dict.SID("while"): WHILE, } tokConstVals = map[rune]int{ ADDASSIGN: dict.SID("+="), ANDAND: dict.SID("&&"), ANDASSIGN: dict.SID("&="), ARROW: dict.SID("->"), AUTO: dict.SID("auto"), BOOL: dict.SID("_Bool"), BREAK: dict.SID("break"), CASE: dict.SID("case"), CHAR: dict.SID("char"), COMPLEX: dict.SID("_Complex"), CONST: dict.SID("const"), CONTINUE: dict.SID("continue"), DDD: dict.SID("..."), DEC: dict.SID("--"), DEFAULT: dict.SID("default"), DIVASSIGN: dict.SID("/="), DO: dict.SID("do"), DOUBLE: dict.SID("double"), ELSE: dict.SID("else"), ENUM: dict.SID("enum"), EQ: dict.SID("=="), EXTERN: dict.SID("extern"), FLOAT: dict.SID("float"), FOR: dict.SID("for"), GEQ: dict.SID(">="), GOTO: dict.SID("goto"), IF: dict.SID("if"), INC: dict.SID("++"), INLINE: dict.SID("inline"), INT: dict.SID("int"), LEQ: dict.SID("<="), LONG: dict.SID("long"), LSH: dict.SID("<<"), LSHASSIGN: dict.SID("<<="), MODASSIGN: dict.SID("%="), MULASSIGN: dict.SID("*="), NEQ: dict.SID("!="), ORASSIGN: dict.SID("|="), OROR: dict.SID("||"), PPPASTE: dict.SID("##"), REGISTER: dict.SID("register"), RESTRICT: dict.SID("restrict"), RETURN: dict.SID("return"), RSH: dict.SID(">>"), RSHASSIGN: dict.SID(">>="), SHORT: dict.SID("short"), SIGNED: dict.SID("signed"), SIZEOF: dict.SID("sizeof"), STATIC: dict.SID("static"), STRUCT: dict.SID("struct"), SUBASSIGN: dict.SID("-="), SWITCH: dict.SID("switch"), TYPEDEF: dict.SID("typedef"), TYPEOF: dict.SID("typeof"), UNION: dict.SID("union"), UNSIGNED: dict.SID("unsigned"), VOID: dict.SID("void"), VOLATILE: dict.SID("volatile"), WHILE: dict.SID("while"), XORASSIGN: dict.SID("^="), } tokHasVal = map[rune]struct{}{ CHARCONST: {}, FLOATCONST: {}, IDENTIFIER: {}, INTCONST: {}, LONGCHARCONST: {}, LONGSTRINGLITERAL: {}, NON_REPL: {}, PPNUMBER: {}, STRINGLITERAL: {}, TYPEDEF_NAME: {}, } followSetHasTypedefName = [len(yyParseTab)]bool{} classifyType = map[TypeKind]int{ 0: noTypeClass, Void: voidTypeClass, Ptr: pointerTypeClass, Char: charTypeClass, SChar: charTypeClass, UChar: charTypeClass, Short: integerTypeClass, UShort: integerTypeClass, Int: integerTypeClass, UInt: integerTypeClass, Long: integerTypeClass, ULong: integerTypeClass, LongLong: integerTypeClass, ULongLong: integerTypeClass, Float: realTypeClass, Double: realTypeClass, LongDouble: realTypeClass, Bool: booleanTypeClass, FloatComplex: complexTypeClass, DoubleComplex: complexTypeClass, LongDoubleComplex: complexTypeClass, Struct: recordTypeClass, Union: unionTypeClass, Enum: enumeralTypeClass, TypedefName: noTypeClass, Function: functionTypeClass, Array: arrayTypeClass, } ) func init() { for i, v := range yyFollow { for _, v := range v { if v == TYPEDEF_NAME { followSetHasTypedefName[i] = true } } } } func isUCNDigit(r rune) bool { return int(r) < len(ucnDigits)<>bitShift]&(1<>bitShift]&(1<= '0' && r <= '9', r >= 'a' && r <= 'f', r >= 'A' && r <= 'F': v = v<<4 | decodeHex(r) n++ default: break loop2 } } return -rune(v & 0xff), n case 'u', 'U': return decodeUCN(runes) } if r < '0' || r > '7' { panic("internal error") } v, n := 0, 1 loop: for _, r := range runes[1:] { switch { case r >= '0' && r <= '7': v = v<<3 | (int(r) - '0') n++ default: break loop } } return -rune(v), n } func decodeHex(r rune) int { switch { case r >= '0' && r <= '9': return int(r) - '0' default: x := int(r) &^ 0x20 return x - 'A' + 10 } } // universal-character-name \\u{hex-quad}|\\U{hex-quad}{hex-quad} func decodeUCN(runes []rune) (rune, int) { if runes[0] != '\\' { panic("internal error") } runes = runes[1:] switch runes[0] { case 'u': return rune(decodeHexQuad(runes[1:])), 6 case 'U': return rune(decodeHexQuad(runes[1:])<<16 | decodeHexQuad(runes[5:])), 10 default: panic("internal error") } } // hex-quad {hexadecimal-digit}{hexadecimal-digit}{hexadecimal-digit}{hexadecimal-digit} func decodeHexQuad(runes []rune) int { n := 0 for _, r := range runes[:4] { n = n<<4 | decodeHex(r) } return n } // Values from GCC's typeclass.h const ( noTypeClass = iota - 1 voidTypeClass integerTypeClass charTypeClass enumeralTypeClass booleanTypeClass pointerTypeClass referenceTypeClass offsetTypeClass realTypeClass complexTypeClass functionTypeClass methodTypeClass recordTypeClass unionTypeClass arrayTypeClass stringTypeClass langTypeClass ) ================================================ FILE: v2/enum.go ================================================ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "github.com/cznic/ir" ) // [0]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf type cond int const ( condZero cond = iota condIfOff condIfOn condIfSkip maxCond ) var ( condOn = [maxCond]bool{ condIfOn: true, condZero: true, } ) // Linkage describes linkage of identifiers, [0]6.2.2. type Linkage int // Values of Linkage const ( LinkageNone Linkage = iota LinkageInternal Linkage = Linkage(ir.InternalLinkage) LinkageExternal Linkage = Linkage(ir.ExternalLinkage) ) // StorageDuration describes lifetime of an object, [0]6.2.4. type StorageDuration int // Values of StorageDuration const ( StorageDurationAutomatic StorageDuration = iota StorageDurationStatic ) ================================================ FILE: v2/etc.go ================================================ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "bytes" "fmt" "go/scanner" "io" "os" "runtime/debug" "strings" "github.com/cznic/strutil" "github.com/cznic/xc" ) var ( bNL = []byte{'\n'} bPanic = []byte("panic") ) // PrettyString returns pretty strings for things produced by this package. func PrettyString(v interface{}) string { return strutil.PrettyString(v, "", "", printHooks) } func debugStack() []byte { b := debug.Stack() b = b[bytes.Index(b, bPanic)+1:] b = b[bytes.Index(b, bPanic):] b = b[bytes.Index(b, bNL)+1:] return b } func cppTrimSpace(toks []cppToken) []cppToken { for len(toks) != 0 && toks[0].Rune == ' ' { toks = toks[1:] } for len(toks) != 0 && toks[len(toks)-1].Rune == ' ' { toks = toks[:len(toks)-1] } return toks } func trimSpace(toks []xc.Token) []xc.Token { for len(toks) != 0 && toks[0].Rune == ' ' { toks = toks[1:] } for len(toks) != 0 && toks[len(toks)-1].Rune == ' ' { toks = toks[:len(toks)-1] } return toks } func cppTrimAllSpace(toks []cppToken) []cppToken { w := 0 for _, v := range toks { switch v.Rune { case ' ', '\n': // nop default: toks[w] = v w++ } } return toks[:w] } func trimAllSpace(toks []xc.Token) []xc.Token { w := 0 for _, v := range toks { switch v.Rune { case ' ', '\n': // nop default: toks[w] = v w++ } } return toks[:w] } func isVaList(t Type) bool { //TODO export and use x, ok := t.(*NamedType) return ok && (x.Name == idVaList || x.Name == idBuiltinVaList) } func cppToksDump(toks []cppToken, sep string) string { var a []string for _, t := range toks { if t.Rune == '\n' { continue } a = append(a, TokSrc(t.Token)) } return strings.Join(a, sep) } func toksDump(toks []xc.Token, sep string) string { var a []string for _, t := range toks { if t.Rune == '\n' { continue } a = append(a, TokSrc(t)) } return strings.Join(a, sep) } func prefer(d *Declarator) bool { if d.DeclarationSpecifier.IsExtern() { return false } t := d.Type for { switch x := UnderlyingType(t).(type) { case *ArrayType: return x.Size.Type != nil case *FunctionType: return d.FunctionDefinition != nil case *EnumType, *StructType, *UnionType: return true case *PointerType: t = x.Item case *TaggedStructType: return x.Type != nil case TypeKind: if x.IsScalarType() || x == Void { return true } panic(x) default: panic(x) } } } func env(key, val string) string { if s := os.Getenv(key); s != "" { return s } return val } // IncompatibleTypeDiff is a debug helper. func IncompatibleTypeDiff(a, b Type) { if a == nil || b == nil { panic(fmt.Errorf("TODO\n\t%v\n\t%v", a, b)) } ok0 := a.IsCompatible(b) a0 := a b0 := b a = UnderlyingType(a) b = UnderlyingType(b) if ok := a.IsCompatible(b); ok != ok0 { fmt.Printf(`UnderlyingType changed compatibility from %v to %v (%T %T)\n %v %v ---- %v %v ==== %v %v ---- %v %v ---- `, ok0, ok, a0, b0, a0, b0, a, b, PrettyString(a0), PrettyString(b0), PrettyString(a), PrettyString(b)) } switch x := a.(type) { case *FunctionType: y := b.(*FunctionType) if g, e := x.Variadic, y.Variadic; g != e { fmt.Printf("different .Variadic %v %v\n", g, e) } if g, e := x.Result, y.Result; g != e && !g.IsCompatible(e) { fmt.Printf("Incompatible result types in %v, %T(%v) and %T(%v)\n", x, g, g, e, e) IncompatibleTypeDiff(g, e) } if g, e := len(x.Params), len(y.Params); g != e { fmt.Printf("len(Params) %v %v\n", g, e) return } for i, v := range x.Params { w := y.Params[i] if g, e := v, w; g != e && !g.IsCompatible(e) { fmt.Printf("Parameter %v.Type: types not compatible %T %T\n\t%v\n\t%v\n", i, g, e, g, e) IncompatibleTypeDiff(g, e) } } case *PointerType: y := b.(*PointerType) IncompatibleTypeDiff(x.Item, y.Item) case *StructType: switch y := b.(type) { case *StructType: if g, e := x.Tag, y.Tag; g != e { fmt.Printf("Tags %q %q\n", dict.S(g), dict.S(e)) return } if g, e := len(x.Fields), len(y.Fields); g != e { fmt.Printf("len(Fields) %v %v\n", g, e) return } for i, v := range x.Fields { w := y.Fields[i] if g, e := v.Name, w.Name; g != e { fmt.Printf("Field %v.Name: %q %q\n", i, dict.S(g), dict.S(e)) } if g, e := v.Bits, w.Bits; g != e { fmt.Printf("Field %v.Bits: %v %v\n", i, g, e) } if g, e := v.PackedType, w.PackedType; g != e && !g.IsCompatible(e) { fmt.Printf("Field %v.PackedType: incompatible types\n\t%v\n\t%v\n", i, g, e) IncompatibleTypeDiff(g, e) } if g, e := v.Type, w.Type; g != e && !g.IsCompatible(e) { fmt.Printf("Field %v.Type: incompatible types\n\t%v\n\t%v\n", i, g, e) IncompatibleTypeDiff(g, e) } } case *TaggedStructType: b = y.Type if b == y { panic("TODO") } if b == nil { panic(fmt.Errorf("%T(%v).Type: %v", y, y, y.Type)) } IncompatibleTypeDiff(x, b) default: panic(fmt.Errorf("%T", y)) } case TypeKind: y := b.(TypeKind) if g, e := x, y; g != e && !g.IsCompatible(e) { fmt.Printf("TypeKinds differ: %v %v\n", g, e) } default: panic(fmt.Errorf("%T", x)) } } // ErrString is like error.Error() but expands scanner.ErrorList. func ErrString(err error) string { var b bytes.Buffer printError(&b, "", err) return b.String() } func printError(w io.Writer, pref string, err error) { switch x := err.(type) { case scanner.ErrorList: for i, v := range x { fmt.Fprintf(w, "%s%v\n", pref, v) if i == 50 { fmt.Fprintln(w, "too many errors") break } } default: fmt.Fprintf(w, "%s%v\n", pref, err) } } func cppToks(toks []xc.Token) []cppToken { r := make([]cppToken, len(toks)) for i, v := range toks { r[i].Token = v } return r } func xcToks(toks []cppToken) []xc.Token { r := make([]xc.Token, len(toks)) for i, v := range toks { r[i] = v.Token } return r } ================================================ FILE: v2/headers/LICENSE-GCC-RTE-V3.1 ================================================ GCC RUNTIME LIBRARY EXCEPTION Version 3.1, 31 March 2009 Copyright © 2009 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This GCC Runtime Library Exception ("Exception") is an additional permission under section 7 of the GNU General Public License, version 3 ("GPLv3"). It applies to a given file (the "Runtime Library") that bears a notice placed by the copyright holder of the file stating that the file is governed by GPLv3 along with this Exception. When you use GCC to compile a program, GCC may combine portions of certain GCC header files and runtime libraries with the compiled program. The purpose of this Exception is to allow compilation of non-GPL (including proprietary) programs to use, in this way, the header files and runtime libraries covered by this Exception. 0. Definitions. A file is an "Independent Module" if it either requires the Runtime Library for execution after a Compilation Process, or makes use of an interface provided by the Runtime Library, but is not otherwise based on the Runtime Library. "GCC" means a version of the GNU Compiler Collection, with or without modifications, governed by version 3 (or a specified later version) of the GNU General Public License (GPL) with the option of using any subsequent versions published by the FSF. "GPL-compatible Software" is software whose conditions of propagation, modification and use would permit combination with GCC in accord with the license of GCC. "Target Code" refers to output from any compiler for a real or virtual target processor architecture, in executable form or suitable for input to an assembler, loader, linker and/or execution phase. Notwithstanding that, Target Code does not include data in any format that is used as a compiler intermediate representation, or used for producing a compiler intermediate representation. The "Compilation Process" transforms code entirely represented in non-intermediate languages designed for human-written code, and/or in Java Virtual Machine byte code, into Target Code. Thus, for example, use of source code generators and preprocessors need not be considered part of the Compilation Process, since the Compilation Process can be understood as starting with the output of the generators or preprocessors. A Compilation Process is "Eligible" if it is done using GCC, alone or with other GPL-compatible software, or if it is done without using any work based on GCC. For example, using non-GPL-compatible Software to optimize any GCC intermediate representations would not qualify as an Eligible Compilation Process. 1. Grant of Additional Permission. You have permission to propagate a work of Target Code formed by combining the Runtime Library with Independent Modules, even if such propagation would otherwise violate the terms of GPLv3, provided that all Target Code was generated by Eligible Compilation Processes. You may then convey such a combination under terms of your choice, consistent with the licensing of the Independent Modules. 2. No Weakening of GCC Copyleft. The availability of this Exception does not imply any general presumption that third-party software is unaffected by the copyleft requirements of the license of GCC. ================================================ FILE: v2/headers/LICENSE-GPL-V3.txt ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: v2/headers/Makefile ================================================ # Copyright 2017 The CC Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # .PHONY: all clean cover cpu editor internalError later mem nuke todo edit grep=--include=*.go --include=*.l --include=*.y --include=*.yy ngrep='TODOOK\|parser\.go\|scanner\.go\|.*_string\.go' all: editor go vet 2>&1 | grep -v $(ngrep) || true golint 2>&1 | grep -v $(ngrep) || true make todo unused . || true misspell *.go gosimple || true maligned || true unconvert -apply clean: go clean rm -f *~ *.test *.out cover: t=$(shell mktemp) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t cpu: clean go test -run @ -bench . -cpuprofile cpu.out go tool pprof -lines *.test cpu.out edit: gvim -p Makefile *.go editor: gofmt -l -s -w *.go go test -i go test 2>&1 | tee log go run generator.go -crt github.com/cznic/crt 2>&1 | tee -a log find -name \*.c -or -name \*.h | xargs -n1 indent -linux -l -1 find -name \*.c~ -or -name \*.h~ | xargs rm internalError: egrep -ho '"internal error.*"' *.go | sort | cat -n later: @grep -n $(grep) LATER * || true @grep -n $(grep) MAYBE * || true mem: clean go test -run @ -bench . -memprofile mem.out -memprofilerate 1 -timeout 24h go tool pprof -lines -web -alloc_space *.test mem.out nuke: clean go clean -i todo: @grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * | grep -v $(ngrep) || true @grep -nr $(grep) TODO * | grep -v $(ngrep) || true @grep -nr $(grep) BUG * | grep -v $(ngrep) || true @grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true ================================================ FILE: v2/headers/all_test.go ================================================ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate go run generator.go package headers import ( "fmt" "os" "path" "runtime" "strings" "testing" ) func caller(s string, va ...interface{}) { if s == "" { s = strings.Repeat("%v ", len(va)) } _, fn, fl, _ := runtime.Caller(2) fmt.Fprintf(os.Stderr, "# caller: %s:%d: ", path.Base(fn), fl) fmt.Fprintf(os.Stderr, s, va...) fmt.Fprintln(os.Stderr) _, fn, fl, _ = runtime.Caller(1) fmt.Fprintf(os.Stderr, "# \tcallee: %s:%d: ", path.Base(fn), fl) fmt.Fprintln(os.Stderr) os.Stderr.Sync() } func dbg(s string, va ...interface{}) { if s == "" { s = strings.Repeat("%v ", len(va)) } _, fn, fl, _ := runtime.Caller(1) fmt.Fprintf(os.Stderr, "# dbg %s:%d: ", path.Base(fn), fl) fmt.Fprintf(os.Stderr, s, va...) fmt.Fprintln(os.Stderr) os.Stderr.Sync() } func TODO(...interface{}) string { //TODOOK _, fn, fl, _ := runtime.Caller(1) return fmt.Sprintf("# TODO: %s:%d:\n", path.Base(fn), fl) //TODOOK } func use(...interface{}) {} func init() { use(caller, dbg, TODO) //TODOOK } // ============================================================================ func Test(t *testing.T) { t.Logf("TODO") } ================================================ FILE: v2/headers/features.c ================================================ // +build ignore #include #include int main() { #ifdef _POSIX_SOURCE printf("_POSIX_SOURCE %li\n", (long)_POSIX_SOURCE); #endif #ifdef _POSIX_C_SOURCE printf("_POSIX_C_SOURCE %li\n", (long)_POSIX_C_SOURCE); #endif #ifdef _XOPEN_SOURCE printf("_XOPEN_SOURCE %li\n", (long)_XOPEN_SOURCE); #endif #ifdef _XOPEN_SOURCE_EXTENDED printf("_XOPEN_SOURCE_EXTENDED %li\n", (long)_XOPEN_SOURCE_EXTENDED); #endif #ifdef _LARGEFILE_SOURCE printf("_LARGEFILE_SOURCE %li\n", (long)_LARGEFILE_SOURCE); #endif #ifdef _LARGEFILE64_SOURCE printf("_LARGEFILE64_SOURCE %li\n", (long)_LARGEFILE64_SOURCE); #endif #ifdef _FILE_OFFSET_BITS printf("_FILE_OFFSET_BITS %li\n", (long)_FILE_OFFSET_BITS); #endif #ifdef _ISOC99_SOURCE printf("_ISOC99_SOURCE %li\n", (long)_ISOC99_SOURCE); #endif #ifdef __STDC_WANT_LIB_EXT2__ printf("__STDC_WANT_LIB_EXT2__ %li\n", (long)__STDC_WANT_LIB_EXT2__); #endif #ifdef __STDC_WANT_IEC_60559_BFP_EXT__ printf("__STDC_WANT_IEC_60559_BFP_EXT__ %li\n", (long)__STDC_WANT_IEC_60559_BFP_EXT__); #endif #ifdef __STDC_WANT_IEC_60559_FUNCS_EXT__ printf("__STDC_WANT_IEC_60559_FUNCS_EXT__ %li\n", (long)__STDC_WANT_IEC_60559_FUNCS_EXT__); #endif #ifdef __STDC_WANT_IEC_60559_TYPES_EXT__ printf("__STDC_WANT_IEC_60559_TYPES_EXT__ %li\n", (long)__STDC_WANT_IEC_60559_TYPES_EXT__); #endif #ifdef _GNU_SOURCE printf("_GNU_SOURCE %li\n", (long)_GNU_SOURCE); #endif #ifdef _DEFAULT_SOURCE printf("_DEFAULT_SOURCE %li\n", (long)_DEFAULT_SOURCE); #endif #ifdef _REENTRANT printf("_REENTRANT %li\n", (long)_REENTRANT); #endif #ifdef _THREAD_SAFE printf("_THREAD_SAFE %li\n", (long)_THREAD_SAFE); #endif } ================================================ FILE: v2/headers/generator.go ================================================ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore package main import ( "bytes" "flag" "fmt" "go/format" "go/token" "io/ioutil" "os" "path/filepath" "runtime" "sort" "strings" "github.com/cznic/cc/v2" "github.com/cznic/ir" "github.com/cznic/sortutil" "github.com/cznic/strutil" "github.com/cznic/xc" ) var ( goOS = runtime.GOOS goArch = runtime.GOARCH osArch = fmt.Sprintf("%s_%s", goOS, goArch) crt string dict = xc.Dict need = map[string][]string{ // "goos_goarch" or "goos" or "all": list of headers "all": { "alloca.h", "assert.h", "ctype.h", "errno.h", "fcntl.h", "float.h", "inttypes.h", "limits.h", "locale.h", "malloc.h", "math.h", "setjmp.h", "stdarg.h", "stdbool.h", "stddef.h", "stdint.h", "stdio.h", "stdlib.h", "string.h", "strings.h", "sys/stat.h", "sys/time.h", "sys/wait.h", "time.h", "unistd.h", "wchar.h", "zlib.h", }, "linux": { "arpa/inet.h", "dirent.h", "dlfcn.h", "execinfo.h", "fts.h", "getopt.h", "grp.h", "memory.h", "netdb.h", "pthread.h", "pwd.h", "sched.h", "signal.h", "signal.h", "sys/file.h", "sys/ioctl.h", "sys/mman.h", "sys/param.h", "sys/resource.h", "sys/select.h", "sys/socket.h", "sys/statfs.h", "sys/times.h", "sys/types.h", "sys/uio.h", "sys/un.h", "sys/utsname.h", "termios.h", "utime.h", }, "windows": { "io.h", "process.h", "windows.h", }, } ) func main() { oCRT := flag.String("crt", "", "CRT import path to update") flag.Parse() if s := *oCRT; s != "" { var err error if crt, err = findRepo(s); err != nil { panic(err) } } sys := predefined() var want []string for k, v := range need { switch { case k == "all", k == goOS, k == osArch: want = append(want, v...) } } want = want[:sortutil.Dedupe(sort.StringSlice(want))] var got []string tweaks := &cc.Tweaks{ EnableAnonymousStructFields: true, EnableEmptyStructs: true, TrackIncludes: func(s string) { if strings.HasSuffix(s, "builtin.h") || strings.HasSuffix(s, "predefined.h") { return } got = append(got, s) }, } for _, v := range want { tu, err := cc.Translate( tweaks, append([]string{"@"}, sys...), sys, cc.NewStringSource("main.c", fmt.Sprintf(` #include "./%s/builtin.h" // Output of gcc features.c && ./a.out in github.com/cznic/cc/v2/headers on linux_amd64. #define _POSIX_SOURCE 1 #define _POSIX_C_SOURCE 200809 #define _DEFAULT_SOURCE 1 #include "%v" `, osArch, v)), ) if err != nil { panic(cc.ErrString(err)) } if crt != "" { defs(v, tu) } } got = got[:sortutil.Dedupe(sort.StringSlice(got))] for _, v := range got { b, err := ioutil.ReadFile(v) if err != nil { panic(cc.ErrString(err)) } f := filepath.Join(osArch, v) mkdir(filepath.Dir(f)) if err := ioutil.WriteFile(f, b, 0644); err != nil { panic(cc.ErrString(err)) } } } func predefined() []string { predefined, inc, sys, err := cc.HostConfig("-std=c99") if err != nil { panic(cc.ErrString(err)) } if len(inc) != 0 { panic(inc) } a := strings.Split(predefined, "\n") w := 0 for _, v := range a { v = strings.TrimSpace(v) if s := strings.ToLower(v); strings.Contains(s, "gcc") || strings.Contains(s, "gnu") { continue } a[w] = v w++ } a = a[:w] osArch = fmt.Sprintf("%s_%s", goOS, goArch) mkdir(osArch) b := bytes.NewBufferString(`// Code generated by $ go generate - DO NOT EDIT. // +build ignore `) for _, v := range a { fmt.Fprintln(b, v) } if err := ioutil.WriteFile(filepath.Join(osArch, "predefined.h"), b.Bytes(), 0644); err != nil { panic(cc.ErrString(err)) } b.Reset() m := map[string]struct{}{} w = 0 for _, v := range sys { v := filepath.Clean(v) if _, ok := m[v]; !ok { fmt.Fprintf(b, "%s\n", v) sys[w] = v w++ } m[v] = struct{}{} } sys = sys[:w] if err := ioutil.WriteFile(filepath.Join(osArch, "paths"), b.Bytes(), 0664); err != nil { panic(cc.ErrString(err)) } return sys } func mkdir(p string) { if _, err := os.Stat(p); err != nil { if !os.IsNotExist(err) { panic(cc.ErrString(err)) } if err := os.MkdirAll(p, 0775); err != nil { panic(fmt.Errorf("%q: %v", p, err)) } } } func findRepo(s string) (string, error) { s = filepath.FromSlash(s) for _, v := range strings.Split(strutil.Gopath(), string(os.PathListSeparator)) { p := filepath.Join(v, "src", s) fi, err := os.Lstat(p) if err != nil { continue } if fi.IsDir() { wd, err := os.Getwd() if err != nil { return "", err } if p, err = filepath.Rel(wd, p); err != nil { return "", err } if p, err = filepath.Abs(p); err != nil { return "", err } return p, nil } } return "", fmt.Errorf("%q: cannot find repository", s) } func defs(include string, tu *cc.TranslationUnit) { model, err := cc.NewModel() if err != nil { panic(err) } var a []string for _, v := range tu.Macros { if v.IsFnLike { continue } from := tu.FileSet.Position(v.DefTok.Pos()).Filename if from == "" || strings.Contains(from, "predefined.h") || strings.Contains(from, "builtin.h") { continue } nm := string(dict.S(v.DefTok.Val)) if strings.HasPrefix(nm, "__") { continue } if strings.HasPrefix(nm, "_") && len(nm) > 1 { if c := nm[1]; c >= 'A' && c <= 'Z' { continue } } a = append(a, nm) } sort.Strings(a) fn := include[:len(include)-2] // sans .h dir := filepath.Join(crt, filepath.FromSlash(fn)) fn = filepath.Join(dir, fmt.Sprintf("const_%s_%s.go", runtime.GOOS, runtime.GOARCH)) pn := filepath.Base(dir) if token.Lookup(pn).IsKeyword() { pn += "_" } buf := bytes.NewBufferString(fmt.Sprintf(`// Code generated by $ go generate - DO NOT EDIT. package %s const (`, pn)) for _, nm := range a { v := tu.Macros[dict.SID(nm)] op, err := v.Eval(model, tu.Macros) if err != nil { continue } buf.WriteByte('\n') switch x := op.Value.(type) { case *ir.Float32Value: fmt.Fprintf(buf, "X%s = %v", nm, x.Value) case *ir.Float64Value: fmt.Fprintf(buf, "X%s = %v", nm, x.Value) case *ir.Int64Value: switch { case op.Type.IsUnsigned(): fmt.Fprintf(buf, "X%s = %v", nm, uint64(cc.ConvertInt64(x.Value, op.Type, model))) default: fmt.Fprintf(buf, "X%s = %v", nm, x.Value) } case *ir.StringValue: fmt.Fprintf(buf, "X%s = %q", nm, dict.S(int(x.StringID))) default: panic(fmt.Errorf("%T", x)) } } a = a[:0] for _, v := range tu.FileScope.Idents { switch x := v.(type) { case *cc.EnumerationConstant: nm := string(dict.S(x.Token.Val)) if strings.HasPrefix(nm, "__") { continue } a = append(a, string(dict.S(x.Token.Val))) } } sort.Strings(a) if len(a) != 0 { buf.WriteByte('\n') } for _, nm := range a { op := tu.FileScope.Idents[dict.SID(nm)].(*cc.EnumerationConstant).Operand x := op.Value.(*ir.Int64Value) buf.WriteByte('\n') switch { case op.Type.IsUnsigned(): fmt.Fprintf(buf, "C%s = %v", nm, uint64(cc.ConvertInt64(x.Value, op.Type, model))) default: fmt.Fprintf(buf, "C%s = %v", nm, x.Value) } } buf.WriteString("\n)\n") b, err := format.Source(buf.Bytes()) if err != nil { fmt.Printf("%s\n", buf.Bytes()) panic(err) } mkdir(dir) if err := ioutil.WriteFile(fn, b, 0644); err != nil { panic(err) } } ================================================ FILE: v2/headers/linux_386/builtin.h ================================================ // Copyright 2018 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore #ifndef _BUILTIN_H_ #define _BUILTIN_H_ #include "predefined.h" typedef struct { void *_[2]; // Go *[]interface{} } *__builtin_va_list; typedef void *__FILE_TYPE__; __SIZE_TYPE__ __builtin_strlen(char *__s); __UINT64_TYPE__ __builtin_bswap64(__UINT64_TYPE__ x); char *__builtin_strchrnul(char *, int); char *__builtin_strcpy(char *__dest, char *__src); double __builtin_copysign(double x, double y); int __builtin_abs(int j); int __builtin_ffs(int i); int __builtin_isprint(int); int __builtin_memcmp(void *__s1, void *__s2, __SIZE_TYPE__ __n); int __builtin_printf(char *__format, ...); int __builtin_sprintf(char *__s, char *__format, ...); int __builtin_strcmp(char *__s1, char *__s2); int __signbit(double x); int __signbitf(float x); void *__builtin_alloca(__SIZE_TYPE__ __size); void *__builtin_memcpy(void *dest, const void *src, __SIZE_TYPE__ n); void *__builtin_memset(void *s, int c, __SIZE_TYPE__ n); #ifdef __ccgo__ extern void *__ccgo_va_end; extern void *__ccgo_va_start; #endif void __GO__(char*); void __builtin_abort(void); void __builtin_exit(int __status); void __builtin_trap(void); void __register_stdfiles(void *, void *, void *, void *); #define __builtin_choose_expr(a, b, c) (a) ? (b) : (c) #define __builtin_expect(exp, c) (exp) #define __builtin_offsetof(st, m) ((__SIZE_TYPE__)(&((st *)0)->m)) #define __builtin_prefetch(addr, ...) (void)(addr) #define __builtin_signbit(x) (sizeof(x) == sizeof(float) ? __signbitf(x) : sizeof (x) == sizeof(double) ? __signbit(x) : __signbitl(x)) #define __builtin_types_compatible_p(type1, type2) __builtin_types_compatible__((type1){}, (type2){}) #define __builtin_va_arg(ap, type) (type)ap #define __builtin_va_copy(dest, src) dest = src #ifdef __ccgo__ #define __builtin_va_end(ap) ap = __ccgo_va_end #define __builtin_va_start(ap, arg) ap = __ccgo_va_start #else #define __builtin_va_end(ap) ap = (void*)0 #define __builtin_va_start(ap, arg) ap = (void*)-1 #endif #define __complex__ _Complex #define __const const #define __extension__ #define __typeof__ typeof #define __volatile volatile #endif /* _BUILTIN_H_ */ ================================================ FILE: v2/headers/linux_386/paths ================================================ /usr/lib/gcc/i686-linux-gnu/7/include /usr/local/include /usr/lib/gcc/i686-linux-gnu/7/include-fixed /usr/include/i386-linux-gnu /usr/include ================================================ FILE: v2/headers/linux_386/predefined.h ================================================ // Code generated by $ go generate - DO NOT EDIT. // +build ignore #define __SSP_STRONG__ 3 #define __DBL_MIN_EXP__ (-1021) #define __FLT32X_MAX_EXP__ 1024 #define __pentiumpro__ 1 #define __UINT_LEAST16_MAX__ 0xffff #define __ATOMIC_ACQUIRE 2 #define __FLT128_MAX_10_EXP__ 4932 #define __FLT_MIN__ 1.17549435082228750796873653722224568e-38F #define __UINT_LEAST8_TYPE__ unsigned char #define __SIZEOF_FLOAT80__ 12 #define __INTMAX_C(c) c ## LL #define __CHAR_BIT__ 8 #define __UINT8_MAX__ 0xff #define __WINT_MAX__ 0xffffffffU #define __FLT32_MIN_EXP__ (-125) #define __ORDER_LITTLE_ENDIAN__ 1234 #define __SIZE_MAX__ 0xffffffffU #define __WCHAR_MAX__ 0x7fffffffL #define __DBL_DENORM_MIN__ ((double)4.94065645841246544176568792868221372e-324L) #define __FLT32X_DECIMAL_DIG__ 17 #define __FLT_EVAL_METHOD__ 2 #define __unix__ 1 #define __FLT64_DECIMAL_DIG__ 17 #define __UINT_FAST64_MAX__ 0xffffffffffffffffULL #define __SIG_ATOMIC_TYPE__ int #define __DBL_MIN_10_EXP__ (-307) #define __FINITE_MATH_ONLY__ 0 #define __FLT32_HAS_DENORM__ 1 #define __UINT_FAST8_MAX__ 0xff #define __has_include(STR) __has_include__(STR) #define __DEC64_MAX_EXP__ 385 #define __INT8_C(c) c #define __INT_LEAST8_WIDTH__ 8 #define __UINT_LEAST64_MAX__ 0xffffffffffffffffULL #define __SHRT_MAX__ 0x7fff #define __LDBL_MAX__ 1.18973149535723176502126385303097021e+4932L #define __FLT64X_MAX_10_EXP__ 4932 #define __UINT_LEAST8_MAX__ 0xff #define __FLT128_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966F128 #define __UINTMAX_TYPE__ long long unsigned int #define __linux 1 #define __DEC32_EPSILON__ 1E-6DF #define __FLT_EVAL_METHOD_TS_18661_3__ 2 #define __unix 1 #define __UINT32_MAX__ 0xffffffffU #define __LDBL_MAX_EXP__ 16384 #define __FLT128_MIN_EXP__ (-16381) #define __WINT_MIN__ 0U #define __linux__ 1 #define __FLT128_MIN_10_EXP__ (-4931) #define __INT_LEAST16_WIDTH__ 16 #define __SCHAR_MAX__ 0x7f #define __FLT128_MANT_DIG__ 113 #define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1) #define __INT64_C(c) c ## LL #define __DBL_DIG__ 15 #define __FLT64X_MANT_DIG__ 64 #define __SIZEOF_INT__ 4 #define __SIZEOF_POINTER__ 4 #define __USER_LABEL_PREFIX__ #define __FLT64X_EPSILON__ 1.08420217248550443400745280086994171e-19F64x #define __STDC_HOSTED__ 1 #define __LDBL_HAS_INFINITY__ 1 #define __FLT32_DIG__ 6 #define __FLT_EPSILON__ 1.19209289550781250000000000000000000e-7F #define __SHRT_WIDTH__ 16 #define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L #define __DEC32_MAX__ 9.999999E96DF #define __FLT64X_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951F64x #define __FLT32X_HAS_INFINITY__ 1 #define __INT32_MAX__ 0x7fffffff #define __INT_WIDTH__ 32 #define __SIZEOF_LONG__ 4 #define __STDC_IEC_559__ 1 #define __STDC_ISO_10646__ 201706L #define __UINT16_C(c) c #define __PTRDIFF_WIDTH__ 32 #define __DECIMAL_DIG__ 21 #define __FLT64_EPSILON__ 2.22044604925031308084726333618164062e-16F64 #define __INTMAX_WIDTH__ 64 #define __has_include_next(STR) __has_include_next__(STR) #define __FLT64X_MIN_10_EXP__ (-4931) #define __LDBL_HAS_QUIET_NAN__ 1 #define __FLT64_MANT_DIG__ 53 #define __pie__ 2 #define __FLT_HAS_DENORM__ 1 #define __SIZEOF_LONG_DOUBLE__ 12 #define __BIGGEST_ALIGNMENT__ 16 #define __FLT64_MAX_10_EXP__ 308 #define __i686 1 #define __FLT32_HAS_INFINITY__ 1 #define __DBL_MAX__ ((double)1.79769313486231570814527423731704357e+308L) #define __INT_FAST32_MAX__ 0x7fffffff #define __DBL_HAS_INFINITY__ 1 #define __DEC32_MIN_EXP__ (-94) #define __INTPTR_WIDTH__ 32 #define __FLT32X_HAS_DENORM__ 1 #define __INT_FAST16_TYPE__ int #define __STRICT_ANSI__ 1 #define __LDBL_HAS_DENORM__ 1 #define __FLT128_HAS_INFINITY__ 1 #define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL #define __INT_LEAST32_MAX__ 0x7fffffff #define __DEC32_MIN__ 1E-95DF #define __DBL_MAX_EXP__ 1024 #define __WCHAR_WIDTH__ 32 #define __FLT32_MAX__ 3.40282346638528859811704183484516925e+38F32 #define __DEC128_EPSILON__ 1E-33DL #define __ATOMIC_HLE_RELEASE 131072 #define __PTRDIFF_MAX__ 0x7fffffff #define __STDC_NO_THREADS__ 1 #define __ATOMIC_HLE_ACQUIRE 65536 #define __FLT32_HAS_QUIET_NAN__ 1 #define __LONG_LONG_MAX__ 0x7fffffffffffffffLL #define __SIZEOF_SIZE_T__ 4 #define __FLT64X_MIN_EXP__ (-16381) #define __SIZEOF_WINT_T__ 4 #define __LONG_LONG_WIDTH__ 64 #define __FLT32_MAX_EXP__ 128 #define __GXX_ABI_VERSION 1011 #define __FLT_MIN_EXP__ (-125) #define __i686__ 1 #define __FLT64X_HAS_QUIET_NAN__ 1 #define __INT_FAST64_TYPE__ long long int #define __FLT64_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F64 #define __DBL_MIN__ ((double)2.22507385850720138309023271733240406e-308L) #define __PIE__ 2 #define __FLT32X_EPSILON__ 2.22044604925031308084726333618164062e-16F32x #define __DECIMAL_BID_FORMAT__ 1 #define __FLT64_MIN_EXP__ (-1021) #define __FLT64_MIN_10_EXP__ (-307) #define __FLT64X_DECIMAL_DIG__ 21 #define __DEC128_MIN__ 1E-6143DL #define __REGISTER_PREFIX__ #define __UINT16_MAX__ 0xffff #define __DBL_HAS_DENORM__ 1 #define __FLT32_MIN__ 1.17549435082228750796873653722224568e-38F32 #define __UINT8_TYPE__ unsigned char #define __NO_INLINE__ 1 #define __i386 1 #define __FLT_MANT_DIG__ 24 #define __LDBL_DECIMAL_DIG__ 21 #define __VERSION__ "7.3.0" #define __UINT64_C(c) c ## ULL #define _STDC_PREDEF_H 1 #define __FLT128_MAX_EXP__ 16384 #define __FLT32_MANT_DIG__ 24 #define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __STDC_IEC_559_COMPLEX__ 1 #define __FLT128_HAS_DENORM__ 1 #define __FLT128_DIG__ 33 #define __SCHAR_WIDTH__ 8 #define __INT32_C(c) c #define __DEC64_EPSILON__ 1E-15DD #define __ORDER_PDP_ENDIAN__ 3412 #define __DEC128_MIN_EXP__ (-6142) #define __code_model_32__ 1 #define __FLT32_MAX_10_EXP__ 38 #define __INT_FAST32_TYPE__ int #define __UINT_LEAST16_TYPE__ short unsigned int #define __FLT64X_HAS_INFINITY__ 1 #define __INT16_MAX__ 0x7fff #define __i386__ 1 #define __SIZE_TYPE__ unsigned int #define __UINT64_MAX__ 0xffffffffffffffffULL #define __FLT64X_DIG__ 18 #define __INT8_TYPE__ signed char #define __ELF__ 1 #define __FLT_RADIX__ 2 #define __INT_LEAST16_TYPE__ short int #define __LDBL_EPSILON__ 1.08420217248550443400745280086994171e-19L #define __UINTMAX_C(c) c ## ULL #define __SIG_ATOMIC_MAX__ 0x7fffffff #define __SIZEOF_PTRDIFF_T__ 4 #define __FLT32X_MANT_DIG__ 53 #define __FLT32X_MIN_EXP__ (-1021) #define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF #define __pentiumpro 1 #define __INT_FAST16_MAX__ 0x7fffffff #define __FLT64_DIG__ 15 #define __UINT_FAST32_MAX__ 0xffffffffU #define __UINT_LEAST64_TYPE__ long long unsigned int #define __FLT_HAS_QUIET_NAN__ 1 #define __FLT_MAX_10_EXP__ 38 #define __LONG_MAX__ 0x7fffffffL #define __FLT64X_HAS_DENORM__ 1 #define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL #define __FLT_HAS_INFINITY__ 1 #define __UINT_FAST16_TYPE__ unsigned int #define __DEC64_MAX__ 9.999999999999999E384DD #define __INT_FAST32_WIDTH__ 32 #define __CHAR16_TYPE__ short unsigned int #define __PRAGMA_REDEFINE_EXTNAME 1 #define __SIZE_WIDTH__ 32 #define __SEG_FS 1 #define __INT_LEAST16_MAX__ 0x7fff #define __DEC64_MANT_DIG__ 16 #define __INT64_MAX__ 0x7fffffffffffffffLL #define __UINT_LEAST32_MAX__ 0xffffffffU #define __SEG_GS 1 #define __FLT32_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F32 #define __SIG_ATOMIC_WIDTH__ 32 #define __INT_LEAST64_TYPE__ long long int #define __INT16_TYPE__ short int #define __INT_LEAST8_TYPE__ signed char #define __STDC_VERSION__ 199901L #define __DEC32_MAX_EXP__ 97 #define __INT_FAST8_MAX__ 0x7f #define __FLT128_MAX__ 1.18973149535723176508575932662800702e+4932F128 #define __INTPTR_MAX__ 0x7fffffff #define __FLT64_HAS_QUIET_NAN__ 1 #define __FLT32_MIN_10_EXP__ (-37) #define __FLT32X_DIG__ 15 #define __LDBL_MANT_DIG__ 64 #define __DBL_HAS_QUIET_NAN__ 1 #define __FLT64_HAS_INFINITY__ 1 #define __FLT64X_MAX__ 1.18973149535723176502126385303097021e+4932F64x #define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1) #define __INTPTR_TYPE__ int #define __UINT16_TYPE__ short unsigned int #define __WCHAR_TYPE__ long int #define __SIZEOF_FLOAT__ 4 #define __pic__ 2 #define __UINTPTR_MAX__ 0xffffffffU #define __INT_FAST64_WIDTH__ 64 #define __DEC64_MIN_EXP__ (-382) #define __FLT32_DECIMAL_DIG__ 9 #define __INT_FAST64_MAX__ 0x7fffffffffffffffLL #define __FLT_DIG__ 6 #define __FLT64X_MAX_EXP__ 16384 #define __UINT_FAST64_TYPE__ long long unsigned int #define __INT_MAX__ 0x7fffffff #define __INT64_TYPE__ long long int #define __FLT_MAX_EXP__ 128 #define __DBL_MANT_DIG__ 53 #define __SIZEOF_FLOAT128__ 16 #define __INT_LEAST64_MAX__ 0x7fffffffffffffffLL #define __DEC64_MIN__ 1E-383DD #define __WINT_TYPE__ unsigned int #define __UINT_LEAST32_TYPE__ unsigned int #define __SIZEOF_SHORT__ 2 #define __LDBL_MIN_EXP__ (-16381) #define __FLT64_MAX__ 1.79769313486231570814527423731704357e+308F64 #define __WINT_WIDTH__ 32 #define __INT_LEAST8_MAX__ 0x7f #define __FLT32X_MAX_10_EXP__ 308 #define __LDBL_MAX_10_EXP__ 4932 #define __ATOMIC_RELAXED 0 #define __DBL_EPSILON__ ((double)2.22044604925031308084726333618164062e-16L) #define __FLT128_MIN__ 3.36210314311209350626267781732175260e-4932F128 #define __UINT8_C(c) c #define __FLT64_MAX_EXP__ 1024 #define __INT_LEAST32_TYPE__ int #define __SIZEOF_WCHAR_T__ 4 #define __UINT64_TYPE__ long long unsigned int #define __FLT128_HAS_QUIET_NAN__ 1 #define __INT_FAST8_TYPE__ signed char #define __FLT64X_MIN__ 3.36210314311209350626267781732175260e-4932F64x #define __FLT64_HAS_DENORM__ 1 #define __FLT32_EPSILON__ 1.19209289550781250000000000000000000e-7F32 #define __DBL_DECIMAL_DIG__ 17 #define __INT_FAST8_WIDTH__ 8 #define __DEC_EVAL_METHOD__ 2 #define __FLT32X_MAX__ 1.79769313486231570814527423731704357e+308F32x #define __ORDER_BIG_ENDIAN__ 4321 #define __UINT32_C(c) c ## U #define __INTMAX_MAX__ 0x7fffffffffffffffLL #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __FLT_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F #define __INT8_MAX__ 0x7f #define __LONG_WIDTH__ 32 #define __PIC__ 2 #define __UINT_FAST32_TYPE__ unsigned int #define __CHAR32_TYPE__ unsigned int #define __FLT_MAX__ 3.40282346638528859811704183484516925e+38F #define __INT32_TYPE__ int #define __SIZEOF_DOUBLE__ 8 #define __FLT_MIN_10_EXP__ (-37) #define __FLT64_MIN__ 2.22507385850720138309023271733240406e-308F64 #define __INT_LEAST32_WIDTH__ 32 #define __INTMAX_TYPE__ long long int #define __DEC128_MAX_EXP__ 6145 #define __FLT32X_HAS_QUIET_NAN__ 1 #define __ATOMIC_CONSUME 1 #define __INT_FAST16_WIDTH__ 32 #define __UINTMAX_MAX__ 0xffffffffffffffffULL #define __DEC32_MANT_DIG__ 7 #define __FLT32X_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F32x #define __DBL_MAX_10_EXP__ 308 #define __LDBL_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951L #define __INT16_C(c) c #define __STDC__ 1 #define __PTRDIFF_TYPE__ int #define __ATOMIC_SEQ_CST 5 #define __UINT32_TYPE__ unsigned int #define __FLT32X_MIN_10_EXP__ (-307) #define __UINTPTR_TYPE__ unsigned int #define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD #define __DEC128_MANT_DIG__ 34 #define __LDBL_MIN_10_EXP__ (-4931) #define __FLT128_EPSILON__ 1.92592994438723585305597794258492732e-34F128 #define __SIZEOF_LONG_LONG__ 8 #define __FLT128_DECIMAL_DIG__ 36 #define __FLT32X_MIN__ 2.22507385850720138309023271733240406e-308F32x #define __LDBL_DIG__ 18 #define __FLT_DECIMAL_DIG__ 9 #define __UINT_FAST16_MAX__ 0xffffffffU #define __INT_LEAST64_WIDTH__ 64 #define __UINT_FAST8_TYPE__ unsigned char #define __ATOMIC_ACQ_REL 4 #define __ATOMIC_RELEASE 3 ================================================ FILE: v2/headers/linux_386/usr/include/alloca.h ================================================ /* Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _ALLOCA_H #define _ALLOCA_H 1 #include #define __need_size_t #include __BEGIN_DECLS /* Remove any previous definitions. */ #undef alloca /* Allocate a block that will be freed when the calling function exits. */ extern void *alloca(size_t __size) __THROW; #ifdef __GNUC__ # define alloca(size) __builtin_alloca (size) #endif /* GCC. */ __END_DECLS #endif /* alloca.h */ ================================================ FILE: v2/headers/linux_386/usr/include/arpa/inet.h ================================================ /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _ARPA_INET_H #define _ARPA_INET_H 1 #include #include /* To define `struct in_addr'. */ /* Type for length arguments in socket calls. */ #ifndef __socklen_t_defined typedef __socklen_t socklen_t; # define __socklen_t_defined #endif __BEGIN_DECLS /* Convert Internet host address from numbers-and-dots notation in CP into binary data in network byte order. */ extern in_addr_t inet_addr(const char *__cp) __THROW; /* Return the local host address part of the Internet address in IN. */ extern in_addr_t inet_lnaof(struct in_addr __in) __THROW; /* Make Internet host address in network byte order by combining the network number NET with the local address HOST. */ extern struct in_addr inet_makeaddr(in_addr_t __net, in_addr_t __host) __THROW; /* Return network number part of the Internet address IN. */ extern in_addr_t inet_netof(struct in_addr __in) __THROW; /* Extract the network number in network byte order from the address in numbers-and-dots natation starting at CP. */ extern in_addr_t inet_network(const char *__cp) __THROW; /* Convert Internet number in IN to ASCII representation. The return value is a pointer to an internal array containing the string. */ extern char *inet_ntoa(struct in_addr __in) __THROW; /* Convert from presentation format of an Internet number in buffer starting at CP to the binary network format and store result for interface type AF in buffer starting at BUF. */ extern int inet_pton(int __af, const char *__restrict __cp, void *__restrict __buf) __THROW; /* Convert a Internet address in binary network format for interface type AF in buffer starting at CP to presentation form and place result in buffer of length LEN astarting at BUF. */ extern const char *inet_ntop(int __af, const void *__restrict __cp, char *__restrict __buf, socklen_t __len) __THROW; /* The following functions are not part of XNS 5.2. */ #ifdef __USE_MISC /* Convert Internet host address from numbers-and-dots notation in CP into binary data and store the result in the structure INP. */ extern int inet_aton(const char *__cp, struct in_addr *__inp) __THROW; /* Format a network number NET into presentation format and place result in buffer starting at BUF with length of LEN bytes. */ extern char *inet_neta(in_addr_t __net, char *__buf, size_t __len) __THROW; /* Convert network number for interface type AF in buffer starting at CP to presentation format. The result will specifiy BITS bits of the number. */ extern char *inet_net_ntop(int __af, const void *__cp, int __bits, char *__buf, size_t __len) __THROW; /* Convert network number for interface type AF from presentation in buffer starting at CP to network format and store result int buffer starting at BUF of size LEN. */ extern int inet_net_pton(int __af, const char *__cp, void *__buf, size_t __len) __THROW; /* Convert ASCII representation in hexadecimal form of the Internet address to binary form and place result in buffer of length LEN starting at BUF. */ extern unsigned int inet_nsap_addr(const char *__cp, unsigned char *__buf, int __len) __THROW; /* Convert internet address in binary form in LEN bytes starting at CP a presentation form and place result in BUF. */ extern char *inet_nsap_ntoa(int __len, const unsigned char *__cp, char *__buf) __THROW; #endif __END_DECLS #endif /* arpa/inet.h */ ================================================ FILE: v2/headers/linux_386/usr/include/asm-generic/errno-base.h ================================================ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _ASM_GENERIC_ERRNO_BASE_H #define _ASM_GENERIC_ERRNO_BASE_H #define EPERM 1 /* Operation not permitted */ #define ENOENT 2 /* No such file or directory */ #define ESRCH 3 /* No such process */ #define EINTR 4 /* Interrupted system call */ #define EIO 5 /* I/O error */ #define ENXIO 6 /* No such device or address */ #define E2BIG 7 /* Argument list too long */ #define ENOEXEC 8 /* Exec format error */ #define EBADF 9 /* Bad file number */ #define ECHILD 10 /* No child processes */ #define EAGAIN 11 /* Try again */ #define ENOMEM 12 /* Out of memory */ #define EACCES 13 /* Permission denied */ #define EFAULT 14 /* Bad address */ #define ENOTBLK 15 /* Block device required */ #define EBUSY 16 /* Device or resource busy */ #define EEXIST 17 /* File exists */ #define EXDEV 18 /* Cross-device link */ #define ENODEV 19 /* No such device */ #define ENOTDIR 20 /* Not a directory */ #define EISDIR 21 /* Is a directory */ #define EINVAL 22 /* Invalid argument */ #define ENFILE 23 /* File table overflow */ #define EMFILE 24 /* Too many open files */ #define ENOTTY 25 /* Not a typewriter */ #define ETXTBSY 26 /* Text file busy */ #define EFBIG 27 /* File too large */ #define ENOSPC 28 /* No space left on device */ #define ESPIPE 29 /* Illegal seek */ #define EROFS 30 /* Read-only file system */ #define EMLINK 31 /* Too many links */ #define EPIPE 32 /* Broken pipe */ #define EDOM 33 /* Math argument out of domain of func */ #define ERANGE 34 /* Math result not representable */ #endif ================================================ FILE: v2/headers/linux_386/usr/include/asm-generic/errno.h ================================================ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _ASM_GENERIC_ERRNO_H #define _ASM_GENERIC_ERRNO_H #include #define EDEADLK 35 /* Resource deadlock would occur */ #define ENAMETOOLONG 36 /* File name too long */ #define ENOLCK 37 /* No record locks available */ /* * This error code is special: arch syscall entry code will return * -ENOSYS if users try to call a syscall that doesn't exist. To keep * failures of syscalls that really do exist distinguishable from * failures due to attempts to use a nonexistent syscall, syscall * implementations should refrain from returning -ENOSYS. */ #define ENOSYS 38 /* Invalid system call number */ #define ENOTEMPTY 39 /* Directory not empty */ #define ELOOP 40 /* Too many symbolic links encountered */ #define EWOULDBLOCK EAGAIN /* Operation would block */ #define ENOMSG 42 /* No message of desired type */ #define EIDRM 43 /* Identifier removed */ #define ECHRNG 44 /* Channel number out of range */ #define EL2NSYNC 45 /* Level 2 not synchronized */ #define EL3HLT 46 /* Level 3 halted */ #define EL3RST 47 /* Level 3 reset */ #define ELNRNG 48 /* Link number out of range */ #define EUNATCH 49 /* Protocol driver not attached */ #define ENOCSI 50 /* No CSI structure available */ #define EL2HLT 51 /* Level 2 halted */ #define EBADE 52 /* Invalid exchange */ #define EBADR 53 /* Invalid request descriptor */ #define EXFULL 54 /* Exchange full */ #define ENOANO 55 /* No anode */ #define EBADRQC 56 /* Invalid request code */ #define EBADSLT 57 /* Invalid slot */ #define EDEADLOCK EDEADLK #define EBFONT 59 /* Bad font file format */ #define ENOSTR 60 /* Device not a stream */ #define ENODATA 61 /* No data available */ #define ETIME 62 /* Timer expired */ #define ENOSR 63 /* Out of streams resources */ #define ENONET 64 /* Machine is not on the network */ #define ENOPKG 65 /* Package not installed */ #define EREMOTE 66 /* Object is remote */ #define ENOLINK 67 /* Link has been severed */ #define EADV 68 /* Advertise error */ #define ESRMNT 69 /* Srmount error */ #define ECOMM 70 /* Communication error on send */ #define EPROTO 71 /* Protocol error */ #define EMULTIHOP 72 /* Multihop attempted */ #define EDOTDOT 73 /* RFS specific error */ #define EBADMSG 74 /* Not a data message */ #define EOVERFLOW 75 /* Value too large for defined data type */ #define ENOTUNIQ 76 /* Name not unique on network */ #define EBADFD 77 /* File descriptor in bad state */ #define EREMCHG 78 /* Remote address changed */ #define ELIBACC 79 /* Can not access a needed shared library */ #define ELIBBAD 80 /* Accessing a corrupted shared library */ #define ELIBSCN 81 /* .lib section in a.out corrupted */ #define ELIBMAX 82 /* Attempting to link in too many shared libraries */ #define ELIBEXEC 83 /* Cannot exec a shared library directly */ #define EILSEQ 84 /* Illegal byte sequence */ #define ERESTART 85 /* Interrupted system call should be restarted */ #define ESTRPIPE 86 /* Streams pipe error */ #define EUSERS 87 /* Too many users */ #define ENOTSOCK 88 /* Socket operation on non-socket */ #define EDESTADDRREQ 89 /* Destination address required */ #define EMSGSIZE 90 /* Message too long */ #define EPROTOTYPE 91 /* Protocol wrong type for socket */ #define ENOPROTOOPT 92 /* Protocol not available */ #define EPROTONOSUPPORT 93 /* Protocol not supported */ #define ESOCKTNOSUPPORT 94 /* Socket type not supported */ #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ #define EPFNOSUPPORT 96 /* Protocol family not supported */ #define EAFNOSUPPORT 97 /* Address family not supported by protocol */ #define EADDRINUSE 98 /* Address already in use */ #define EADDRNOTAVAIL 99 /* Cannot assign requested address */ #define ENETDOWN 100 /* Network is down */ #define ENETUNREACH 101 /* Network is unreachable */ #define ENETRESET 102 /* Network dropped connection because of reset */ #define ECONNABORTED 103 /* Software caused connection abort */ #define ECONNRESET 104 /* Connection reset by peer */ #define ENOBUFS 105 /* No buffer space available */ #define EISCONN 106 /* Transport endpoint is already connected */ #define ENOTCONN 107 /* Transport endpoint is not connected */ #define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ #define ETOOMANYREFS 109 /* Too many references: cannot splice */ #define ETIMEDOUT 110 /* Connection timed out */ #define ECONNREFUSED 111 /* Connection refused */ #define EHOSTDOWN 112 /* Host is down */ #define EHOSTUNREACH 113 /* No route to host */ #define EALREADY 114 /* Operation already in progress */ #define EINPROGRESS 115 /* Operation now in progress */ #define ESTALE 116 /* Stale file handle */ #define EUCLEAN 117 /* Structure needs cleaning */ #define ENOTNAM 118 /* Not a XENIX named type file */ #define ENAVAIL 119 /* No XENIX semaphores available */ #define EISNAM 120 /* Is a named type file */ #define EREMOTEIO 121 /* Remote I/O error */ #define EDQUOT 122 /* Quota exceeded */ #define ENOMEDIUM 123 /* No medium found */ #define EMEDIUMTYPE 124 /* Wrong medium type */ #define ECANCELED 125 /* Operation Canceled */ #define ENOKEY 126 /* Required key not available */ #define EKEYEXPIRED 127 /* Key has expired */ #define EKEYREVOKED 128 /* Key has been revoked */ #define EKEYREJECTED 129 /* Key was rejected by service */ /* for robust mutexes */ #define EOWNERDEAD 130 /* Owner died */ #define ENOTRECOVERABLE 131 /* State not recoverable */ #define ERFKILL 132 /* Operation not possible due to RF-kill */ #define EHWPOISON 133 /* Memory page has hardware error */ #endif ================================================ FILE: v2/headers/linux_386/usr/include/asm-generic/ioctl.h ================================================ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _ASM_GENERIC_IOCTL_H #define _ASM_GENERIC_IOCTL_H /* ioctl command encoding: 32 bits total, command in lower 16 bits, * size of the parameter structure in the lower 14 bits of the * upper 16 bits. * Encoding the size of the parameter structure in the ioctl request * is useful for catching programs compiled with old versions * and to avoid overwriting user space outside the user buffer area. * The highest 2 bits are reserved for indicating the ``access mode''. * NOTE: This limits the max parameter size to 16kB -1 ! */ /* * The following is for compatibility across the various Linux * platforms. The generic ioctl numbering scheme doesn't really enforce * a type field. De facto, however, the top 8 bits of the lower 16 * bits are indeed used as a type field, so we might just as well make * this explicit here. Please be sure to use the decoding macros * below from now on. */ #define _IOC_NRBITS 8 #define _IOC_TYPEBITS 8 /* * Let any architecture override either of the following before * including this file. */ #ifndef _IOC_SIZEBITS # define _IOC_SIZEBITS 14 #endif #ifndef _IOC_DIRBITS # define _IOC_DIRBITS 2 #endif #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) #define _IOC_NRSHIFT 0 #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) /* * Direction bits, which any architecture can choose to override * before including this file. * * NOTE: _IOC_WRITE means userland is writing and kernel is * reading. _IOC_READ means userland is reading and kernel is writing. */ #ifndef _IOC_NONE # define _IOC_NONE 0U #endif #ifndef _IOC_WRITE # define _IOC_WRITE 1U #endif #ifndef _IOC_READ # define _IOC_READ 2U #endif #define _IOC(dir,type,nr,size) \ (((dir) << _IOC_DIRSHIFT) | \ ((type) << _IOC_TYPESHIFT) | \ ((nr) << _IOC_NRSHIFT) | \ ((size) << _IOC_SIZESHIFT)) #define _IOC_TYPECHECK(t) (sizeof(t)) /* * Used to create numbers. * * NOTE: _IOW means userland is writing and kernel is reading. _IOR * means userland is reading and kernel is writing. */ #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size))) #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) #define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) #define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) #define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) /* used to decode ioctl numbers.. */ #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) /* ...and for the drivers/sound files... */ #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) #endif /* _ASM_GENERIC_IOCTL_H */ ================================================ FILE: v2/headers/linux_386/usr/include/asm-generic/ioctls.h ================================================ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef __ASM_GENERIC_IOCTLS_H #define __ASM_GENERIC_IOCTLS_H #include /* * These are the most common definitions for tty ioctl numbers. * Most of them do not use the recommended _IOC(), but there is * probably some source code out there hardcoding the number, * so we might as well use them for all new platforms. * * The architectures that use different values here typically * try to be compatible with some Unix variants for the same * architecture. */ /* 0x54 is just a magic number to make these relatively unique ('T') */ #define TCGETS 0x5401 #define TCSETS 0x5402 #define TCSETSW 0x5403 #define TCSETSF 0x5404 #define TCGETA 0x5405 #define TCSETA 0x5406 #define TCSETAW 0x5407 #define TCSETAF 0x5408 #define TCSBRK 0x5409 #define TCXONC 0x540A #define TCFLSH 0x540B #define TIOCEXCL 0x540C #define TIOCNXCL 0x540D #define TIOCSCTTY 0x540E #define TIOCGPGRP 0x540F #define TIOCSPGRP 0x5410 #define TIOCOUTQ 0x5411 #define TIOCSTI 0x5412 #define TIOCGWINSZ 0x5413 #define TIOCSWINSZ 0x5414 #define TIOCMGET 0x5415 #define TIOCMBIS 0x5416 #define TIOCMBIC 0x5417 #define TIOCMSET 0x5418 #define TIOCGSOFTCAR 0x5419 #define TIOCSSOFTCAR 0x541A #define FIONREAD 0x541B #define TIOCINQ FIONREAD #define TIOCLINUX 0x541C #define TIOCCONS 0x541D #define TIOCGSERIAL 0x541E #define TIOCSSERIAL 0x541F #define TIOCPKT 0x5420 #define FIONBIO 0x5421 #define TIOCNOTTY 0x5422 #define TIOCSETD 0x5423 #define TIOCGETD 0x5424 #define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ #define TIOCSBRK 0x5427 /* BSD compatibility */ #define TIOCCBRK 0x5428 /* BSD compatibility */ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TCGETS2 _IOR('T', 0x2A, struct termios2) #define TCSETS2 _IOW('T', 0x2B, struct termios2) #define TCSETSW2 _IOW('T', 0x2C, struct termios2) #define TCSETSF2 _IOW('T', 0x2D, struct termios2) #define TIOCGRS485 0x542E #ifndef TIOCSRS485 #define TIOCSRS485 0x542F #endif #define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ #define TIOCGDEV _IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */ #define TCGETX 0x5432 /* SYS5 TCGETX compatibility */ #define TCSETX 0x5433 #define TCSETXF 0x5434 #define TCSETXW 0x5435 #define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */ #define TIOCVHANGUP 0x5437 #define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */ #define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */ #define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */ #define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */ #define FIONCLEX 0x5450 #define FIOCLEX 0x5451 #define FIOASYNC 0x5452 #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 #define TIOCSERSWILD 0x5455 #define TIOCGLCKTRMIOS 0x5456 #define TIOCSLCKTRMIOS 0x5457 #define TIOCSERGSTRUCT 0x5458 /* For debugging only */ #define TIOCSERGETLSR 0x5459 /* Get line status register */ #define TIOCSERGETMULTI 0x545A /* Get multiport config */ #define TIOCSERSETMULTI 0x545B /* Set multiport config */ #define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ #define TIOCGICOUNT 0x545D /* read serial port __inline__ interrupt counts */ /* * Some arches already define FIOQSIZE due to a historical * conflict with a Hayes modem-specific ioctl value. */ #ifndef FIOQSIZE # define FIOQSIZE 0x5460 #endif /* Used for packet mode */ #define TIOCPKT_DATA 0 #define TIOCPKT_FLUSHREAD 1 #define TIOCPKT_FLUSHWRITE 2 #define TIOCPKT_STOP 4 #define TIOCPKT_START 8 #define TIOCPKT_NOSTOP 16 #define TIOCPKT_DOSTOP 32 #define TIOCPKT_IOCTL 64 #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ #endif /* __ASM_GENERIC_IOCTLS_H */ ================================================ FILE: v2/headers/linux_386/usr/include/asm-generic/param.h ================================================ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef __ASM_GENERIC_PARAM_H #define __ASM_GENERIC_PARAM_H #ifndef HZ #define HZ 100 #endif #ifndef EXEC_PAGESIZE #define EXEC_PAGESIZE 4096 #endif #ifndef NOGROUP #define NOGROUP (-1) #endif #define MAXHOSTNAMELEN 64 /* max length of hostname */ #endif /* __ASM_GENERIC_PARAM_H */ ================================================ FILE: v2/headers/linux_386/usr/include/asm-generic/socket.h ================================================ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef __ASM_GENERIC_SOCKET_H #define __ASM_GENERIC_SOCKET_H #include /* For setsockopt(2) */ #define SOL_SOCKET 1 #define SO_DEBUG 1 #define SO_REUSEADDR 2 #define SO_TYPE 3 #define SO_ERROR 4 #define SO_DONTROUTE 5 #define SO_BROADCAST 6 #define SO_SNDBUF 7 #define SO_RCVBUF 8 #define SO_SNDBUFFORCE 32 #define SO_RCVBUFFORCE 33 #define SO_KEEPALIVE 9 #define SO_OOBINLINE 10 #define SO_NO_CHECK 11 #define SO_PRIORITY 12 #define SO_LINGER 13 #define SO_BSDCOMPAT 14 #define SO_REUSEPORT 15 #ifndef SO_PASSCRED /* powerpc only differs in these */ #define SO_PASSCRED 16 #define SO_PEERCRED 17 #define SO_RCVLOWAT 18 #define SO_SNDLOWAT 19 #define SO_RCVTIMEO 20 #define SO_SNDTIMEO 21 #endif /* Security levels - as per NRL IPv6 - don't actually do anything */ #define SO_SECURITY_AUTHENTICATION 22 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 #define SO_SECURITY_ENCRYPTION_NETWORK 24 #define SO_BINDTODEVICE 25 /* Socket filtering */ #define SO_ATTACH_FILTER 26 #define SO_DETACH_FILTER 27 #define SO_GET_FILTER SO_ATTACH_FILTER #define SO_PEERNAME 28 #define SO_TIMESTAMP 29 #define SCM_TIMESTAMP SO_TIMESTAMP #define SO_ACCEPTCONN 30 #define SO_PEERSEC 31 #define SO_PASSSEC 34 #define SO_TIMESTAMPNS 35 #define SCM_TIMESTAMPNS SO_TIMESTAMPNS #define SO_MARK 36 #define SO_TIMESTAMPING 37 #define SCM_TIMESTAMPING SO_TIMESTAMPING #define SO_PROTOCOL 38 #define SO_DOMAIN 39 #define SO_RXQ_OVFL 40 #define SO_WIFI_STATUS 41 #define SCM_WIFI_STATUS SO_WIFI_STATUS #define SO_PEEK_OFF 42 /* Instruct lower device to use last 4-bytes of skb data as FCS */ #define SO_NOFCS 43 #define SO_LOCK_FILTER 44 #define SO_SELECT_ERR_QUEUE 45 #define SO_BUSY_POLL 46 #define SO_MAX_PACING_RATE 47 #define SO_BPF_EXTENSIONS 48 #define SO_INCOMING_CPU 49 #define SO_ATTACH_BPF 50 #define SO_DETACH_BPF SO_DETACH_FILTER #define SO_ATTACH_REUSEPORT_CBPF 51 #define SO_ATTACH_REUSEPORT_EBPF 52 #define SO_CNX_ADVICE 53 #define SCM_TIMESTAMPING_OPT_STATS 54 #define SO_MEMINFO 55 #define SO_INCOMING_NAPI_ID 56 #define SO_COOKIE 57 #define SCM_TIMESTAMPING_PKTINFO 58 #define SO_PEERGROUPS 59 #define SO_ZEROCOPY 60 #endif /* __ASM_GENERIC_SOCKET_H */ ================================================ FILE: v2/headers/linux_386/usr/include/asm-generic/sockios.h ================================================ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef __ASM_GENERIC_SOCKIOS_H #define __ASM_GENERIC_SOCKIOS_H /* Socket-level I/O control calls. */ #define FIOSETOWN 0x8901 #define SIOCSPGRP 0x8902 #define FIOGETOWN 0x8903 #define SIOCGPGRP 0x8904 #define SIOCATMARK 0x8905 #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ #endif /* __ASM_GENERIC_SOCKIOS_H */ ================================================ FILE: v2/headers/linux_386/usr/include/assert.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.2 Diagnostics */ #ifdef _ASSERT_H # undef _ASSERT_H # undef assert # undef __ASSERT_VOID_CAST # ifdef __USE_GNU # undef assert_perror # endif #endif /* assert.h */ #define _ASSERT_H 1 #include #if defined __cplusplus && __GNUC_PREREQ (2,95) # define __ASSERT_VOID_CAST static_cast #else # define __ASSERT_VOID_CAST (void) #endif /* void assert (int expression); If NDEBUG is defined, do nothing. If not, and EXPRESSION is zero, print an error message and abort. */ #ifdef NDEBUG # define assert(expr) (__ASSERT_VOID_CAST (0)) /* void assert_perror (int errnum); If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an error message with the error text for ERRNUM and abort. (This is a GNU extension.) */ # ifdef __USE_GNU # define assert_perror(errnum) (__ASSERT_VOID_CAST (0)) # endif #else /* Not NDEBUG. */ #ifndef _ASSERT_H_DECLS #define _ASSERT_H_DECLS __BEGIN_DECLS /* This prints an "Assertion failed" message and aborts. */ extern void __assert_fail(const char *__assertion, const char *__file, unsigned int __line, const char *__function) __THROW __attribute__ ((__noreturn__)); /* Likewise, but prints the error text for ERRNUM. */ extern void __assert_perror_fail(int __errnum, const char *__file, unsigned int __line, const char *__function) __THROW __attribute__ ((__noreturn__)); /* The following is not at all used here but needed for standard compliance. */ extern void __assert(const char *__assertion, const char *__file, int __line) __THROW __attribute__ ((__noreturn__)); __END_DECLS #endif /* Not _ASSERT_H_DECLS */ /* When possible, define assert so that it does not add extra parentheses around EXPR. Otherwise, those added parentheses would suppress warnings we'd expect to be detected by gcc's -Wparentheses. */ # if defined __cplusplus # define assert(expr) \ (static_cast (expr) \ ? void (0) \ : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION)) # elif !defined __GNUC__ || defined __STRICT_ANSI__ # define assert(expr) \ ((expr) \ ? __ASSERT_VOID_CAST (0) \ : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION)) # else /* The first occurrence of EXPR is not evaluated due to the sizeof, but will trigger any pedantic warnings masked by the __extension__ for the second occurrence. The ternary operator is required to support function pointers and bit fields in this context, and to suppress the evaluation of variable length arrays. */ # define assert(expr) \ ((void) sizeof ((expr) ? 1 : 0), __extension__ ({ \ if (expr) \ ; /* empty */ \ else \ __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION); \ })) # endif # ifdef __USE_GNU # define assert_perror(errnum) \ (!(errnum) \ ? __ASSERT_VOID_CAST (0) \ : __assert_perror_fail ((errnum), __FILE__, __LINE__, __ASSERT_FUNCTION)) # endif /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__' which contains the name of the function currently being defined. This is broken in G++ before version 2.6. C9x has a similar variable called __func__, but prefer the GCC one since it demangles C++ function names. */ # if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4) # define __ASSERT_FUNCTION __extension__ __PRETTY_FUNCTION__ # else # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __ASSERT_FUNCTION __func__ # else # define __ASSERT_FUNCTION ((const char *) 0) # endif # endif #endif /* NDEBUG. */ #if defined __USE_ISOC11 && !defined __cplusplus # undef static_assert # define static_assert _Static_assert #endif ================================================ FILE: v2/headers/linux_386/usr/include/ctype.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard 7.4: Character handling */ #ifndef _CTYPE_H #define _CTYPE_H 1 #include #include __BEGIN_DECLS #ifndef _ISbit /* These are all the characteristics of characters. If there get to be more than 16 distinct characteristics, many things must be changed that use `unsigned short int's. The characteristics are stored always in network byte order (big endian). We define the bit value interpretations here dependent on the machine's byte order. */ # include # if __BYTE_ORDER == __BIG_ENDIAN # define _ISbit(bit) (1 << (bit)) # else /* __BYTE_ORDER == __LITTLE_ENDIAN */ # define _ISbit(bit) ((bit) < 8 ? ((1 << (bit)) << 8) : ((1 << (bit)) >> 8)) # endif enum { _ISupper = _ISbit(0), /* UPPERCASE. */ _ISlower = _ISbit(1), /* lowercase. */ _ISalpha = _ISbit(2), /* Alphabetic. */ _ISdigit = _ISbit(3), /* Numeric. */ _ISxdigit = _ISbit(4), /* Hexadecimal numeric. */ _ISspace = _ISbit(5), /* Whitespace. */ _ISprint = _ISbit(6), /* Printing. */ _ISgraph = _ISbit(7), /* Graphical. */ _ISblank = _ISbit(8), /* Blank (usually SPC and TAB). */ _IScntrl = _ISbit(9), /* Control character. */ _ISpunct = _ISbit(10), /* Punctuation. */ _ISalnum = _ISbit(11) /* Alphanumeric. */ }; #endif /* ! _ISbit */ /* These are defined in ctype-info.c. The declarations here must match those in localeinfo.h. In the thread-specific locale model (see `uselocale' in ) we cannot use global variables for these as was done in the past. Instead, the following accessor functions return the address of each variable, which is local to the current thread if multithreaded. These point into arrays of 384, so they can be indexed by any `unsigned char' value [0,255]; by EOF (-1); or by any `signed char' value [-128,-1). ISO C requires that the ctype functions work for `unsigned char' values and for EOF; we also support negative `signed char' values for broken old programs. The case conversion arrays are of `int's rather than `unsigned char's because tolower (EOF) must be EOF, which doesn't fit into an `unsigned char'. But today more important is that the arrays are also used for multi-byte character sets. */ extern const unsigned short int **__ctype_b_loc(void) __THROW __attribute__ ((__const__)); extern const __int32_t **__ctype_tolower_loc(void) __THROW __attribute__ ((__const__)); extern const __int32_t **__ctype_toupper_loc(void) __THROW __attribute__ ((__const__)); #ifndef __cplusplus # define __isctype(c, type) \ ((*__ctype_b_loc ())[(int) (c)] & (unsigned short int) type) #elif defined __USE_EXTERN_INLINES # define __isctype_f(type) \ __extern_inline int \ is##type (int __c) __THROW \ { \ return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _IS##type; \ } #endif #define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */ #define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */ #define __exctype(name) extern int name (int) __THROW /* The following names are all functions: int isCHARACTERISTIC(int c); which return nonzero iff C has CHARACTERISTIC. For the meaning of the characteristic names, see the `enum' above. */ __exctype(isalnum); __exctype(isalpha); __exctype(iscntrl); __exctype(isdigit); __exctype(islower); __exctype(isgraph); __exctype(isprint); __exctype(ispunct); __exctype(isspace); __exctype(isupper); __exctype(isxdigit); /* Return the lowercase version of C. */ extern int tolower(int __c) __THROW; /* Return the uppercase version of C. */ extern int toupper(int __c) __THROW; /* ISO C99 introduced one new function. */ #ifdef __USE_ISOC99 __exctype(isblank); #endif #ifdef __USE_GNU /* Test C for a set of character classes according to MASK. */ extern int isctype(int __c, int __mask) __THROW; #endif #if defined __USE_MISC || defined __USE_XOPEN /* Return nonzero iff C is in the ASCII set (i.e., is no more than 7 bits wide). */ extern int isascii(int __c) __THROW; /* Return the part of C that is in the ASCII set (i.e., the low-order 7 bits of C). */ extern int toascii(int __c) __THROW; /* These are the same as `toupper' and `tolower' except that they do not check the argument for being in the range of a `char'. */ __exctype(_toupper); __exctype(_tolower); #endif /* Use X/Open or use misc. */ /* This code is needed for the optimized mapping functions. */ #define __tobody(c, f, a, args) \ (__extension__ \ ({ int __res; \ if (sizeof (c) > 1) \ { \ if (__builtin_constant_p (c)) \ { \ int __c = (c); \ __res = __c < -128 || __c > 255 ? __c : (a)[__c]; \ } \ else \ __res = f args; \ } \ else \ __res = (a)[(int) (c)]; \ __res; })) #if !defined __NO_CTYPE # ifdef __isctype_f __isctype_f(alnum) __isctype_f(alpha) __isctype_f(cntrl) __isctype_f(digit) __isctype_f(lower) __isctype_f(graph) __isctype_f(print) __isctype_f(punct) __isctype_f(space) __isctype_f(upper) __isctype_f(xdigit) # ifdef __USE_ISOC99 __isctype_f(blank) # endif # elif defined __isctype # define isalnum(c) __isctype((c), _ISalnum) # define isalpha(c) __isctype((c), _ISalpha) # define iscntrl(c) __isctype((c), _IScntrl) # define isdigit(c) __isctype((c), _ISdigit) # define islower(c) __isctype((c), _ISlower) # define isgraph(c) __isctype((c), _ISgraph) # define isprint(c) __isctype((c), _ISprint) # define ispunct(c) __isctype((c), _ISpunct) # define isspace(c) __isctype((c), _ISspace) # define isupper(c) __isctype((c), _ISupper) # define isxdigit(c) __isctype((c), _ISxdigit) # ifdef __USE_ISOC99 # define isblank(c) __isctype((c), _ISblank) # endif # endif # ifdef __USE_EXTERN_INLINES __extern_inline int __NTH(tolower(int __c)) { return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc())[__c] : __c; } __extern_inline int __NTH(toupper(int __c)) { return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc())[__c] : __c; } # endif # if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus # define tolower(c) __tobody (c, tolower, *__ctype_tolower_loc (), (c)) # define toupper(c) __tobody (c, toupper, *__ctype_toupper_loc (), (c)) # endif /* Optimizing gcc */ # if defined __USE_MISC || defined __USE_XOPEN # define isascii(c) __isascii (c) # define toascii(c) __toascii (c) # define _tolower(c) ((int) (*__ctype_tolower_loc ())[(int) (c)]) # define _toupper(c) ((int) (*__ctype_toupper_loc ())[(int) (c)]) # endif #endif /* Not __NO_CTYPE. */ #ifdef __USE_XOPEN2K8 /* POSIX.1-2008 extended locale interface (see locale.h). */ # include /* These definitions are similar to the ones above but all functions take as an argument a handle for the locale which shall be used. */ # define __isctype_l(c, type, locale) \ ((locale)->__ctype_b[(int) (c)] & (unsigned short int) type) # define __exctype_l(name) \ extern int name (int, locale_t) __THROW /* The following names are all functions: int isCHARACTERISTIC(int c, locale_t *locale); which return nonzero iff C has CHARACTERISTIC. For the meaning of the characteristic names, see the `enum' above. */ __exctype_l(isalnum_l); __exctype_l(isalpha_l); __exctype_l(iscntrl_l); __exctype_l(isdigit_l); __exctype_l(islower_l); __exctype_l(isgraph_l); __exctype_l(isprint_l); __exctype_l(ispunct_l); __exctype_l(isspace_l); __exctype_l(isupper_l); __exctype_l(isxdigit_l); __exctype_l(isblank_l); /* Return the lowercase version of C in locale L. */ extern int __tolower_l(int __c, locale_t __l) __THROW; extern int tolower_l(int __c, locale_t __l) __THROW; /* Return the uppercase version of C. */ extern int __toupper_l(int __c, locale_t __l) __THROW; extern int toupper_l(int __c, locale_t __l) __THROW; # if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus # define __tolower_l(c, locale) \ __tobody (c, __tolower_l, (locale)->__ctype_tolower, (c, locale)) # define __toupper_l(c, locale) \ __tobody (c, __toupper_l, (locale)->__ctype_toupper, (c, locale)) # define tolower_l(c, locale) __tolower_l ((c), (locale)) # define toupper_l(c, locale) __toupper_l ((c), (locale)) # endif /* Optimizing gcc */ # ifndef __NO_CTYPE # define __isalnum_l(c,l) __isctype_l((c), _ISalnum, (l)) # define __isalpha_l(c,l) __isctype_l((c), _ISalpha, (l)) # define __iscntrl_l(c,l) __isctype_l((c), _IScntrl, (l)) # define __isdigit_l(c,l) __isctype_l((c), _ISdigit, (l)) # define __islower_l(c,l) __isctype_l((c), _ISlower, (l)) # define __isgraph_l(c,l) __isctype_l((c), _ISgraph, (l)) # define __isprint_l(c,l) __isctype_l((c), _ISprint, (l)) # define __ispunct_l(c,l) __isctype_l((c), _ISpunct, (l)) # define __isspace_l(c,l) __isctype_l((c), _ISspace, (l)) # define __isupper_l(c,l) __isctype_l((c), _ISupper, (l)) # define __isxdigit_l(c,l) __isctype_l((c), _ISxdigit, (l)) # define __isblank_l(c,l) __isctype_l((c), _ISblank, (l)) # ifdef __USE_MISC # define __isascii_l(c,l) ((l), __isascii (c)) # define __toascii_l(c,l) ((l), __toascii (c)) # endif # define isalnum_l(c,l) __isalnum_l ((c), (l)) # define isalpha_l(c,l) __isalpha_l ((c), (l)) # define iscntrl_l(c,l) __iscntrl_l ((c), (l)) # define isdigit_l(c,l) __isdigit_l ((c), (l)) # define islower_l(c,l) __islower_l ((c), (l)) # define isgraph_l(c,l) __isgraph_l ((c), (l)) # define isprint_l(c,l) __isprint_l ((c), (l)) # define ispunct_l(c,l) __ispunct_l ((c), (l)) # define isspace_l(c,l) __isspace_l ((c), (l)) # define isupper_l(c,l) __isupper_l ((c), (l)) # define isxdigit_l(c,l) __isxdigit_l ((c), (l)) # define isblank_l(c,l) __isblank_l ((c), (l)) # ifdef __USE_MISC # define isascii_l(c,l) __isascii_l ((c), (l)) # define toascii_l(c,l) __toascii_l ((c), (l)) # endif # endif /* Not __NO_CTYPE. */ #endif /* Use POSIX 2008. */ __END_DECLS #endif /* ctype.h */ ================================================ FILE: v2/headers/linux_386/usr/include/dirent.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 5.1.2 Directory Operations */ #ifndef _DIRENT_H #define _DIRENT_H 1 #include __BEGIN_DECLS #include #ifdef __USE_XOPEN # ifndef __ino_t_defined # ifndef __USE_FILE_OFFSET64 typedef __ino_t ino_t; # else typedef __ino64_t ino_t; # endif # define __ino_t_defined # endif # if defined __USE_LARGEFILE64 && !defined __ino64_t_defined typedef __ino64_t ino64_t; # define __ino64_t_defined # endif #endif /* This file defines `struct dirent'. It defines the macro `_DIRENT_HAVE_D_NAMLEN' iff there is a `d_namlen' member that gives the length of `d_name'. It defines the macro `_DIRENT_HAVE_D_RECLEN' iff there is a `d_reclen' member that gives the size of the entire directory entry. It defines the macro `_DIRENT_HAVE_D_OFF' iff there is a `d_off' member that gives the file offset of the next directory entry. It defines the macro `_DIRENT_HAVE_D_TYPE' iff there is a `d_type' member that gives the type of the file. */ #include #if defined __USE_MISC && !defined d_fileno # define d_ino d_fileno /* Backward compatibility. */ #endif /* These macros extract size information from a `struct dirent *'. They may evaluate their argument multiple times, so it must not have side effects. Each of these may involve a relatively costly call to `strlen' on some systems, so these values should be cached. _D_EXACT_NAMLEN (DP) returns the length of DP->d_name, not including its terminating null character. _D_ALLOC_NAMLEN (DP) returns a size at least (_D_EXACT_NAMLEN (DP) + 1); that is, the allocation size needed to hold the DP->d_name string. Use this macro when you don't need the exact length, just an upper bound. This macro is less likely to require calling `strlen' than _D_EXACT_NAMLEN. */ #ifdef _DIRENT_HAVE_D_NAMLEN # define _D_EXACT_NAMLEN(d) ((d)->d_namlen) # define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1) #else # define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name)) # ifdef _DIRENT_HAVE_D_RECLEN # define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0]) # else # define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name : \ _D_EXACT_NAMLEN (d) + 1) # endif #endif #ifdef __USE_MISC /* File types for `d_type'. */ enum { DT_UNKNOWN = 0, # define DT_UNKNOWN DT_UNKNOWN DT_FIFO = 1, # define DT_FIFO DT_FIFO DT_CHR = 2, # define DT_CHR DT_CHR DT_DIR = 4, # define DT_DIR DT_DIR DT_BLK = 6, # define DT_BLK DT_BLK DT_REG = 8, # define DT_REG DT_REG DT_LNK = 10, # define DT_LNK DT_LNK DT_SOCK = 12, # define DT_SOCK DT_SOCK DT_WHT = 14 # define DT_WHT DT_WHT }; /* Convert between stat structure types and directory types. */ # define IFTODT(mode) (((mode) & 0170000) >> 12) # define DTTOIF(dirtype) ((dirtype) << 12) #endif /* This is the data type of directory stream objects. The actual structure is opaque to users. */ typedef struct __dirstream DIR; /* Open a directory stream on NAME. Return a DIR stream on the directory, or NULL if it could not be opened. This function is a possible cancellation point and therefore not marked with __THROW. */ extern DIR *opendir(const char *__name) __nonnull((1)); #ifdef __USE_XOPEN2K8 /* Same as opendir, but open the stream on the file descriptor FD. This function is a possible cancellation point and therefore not marked with __THROW. */ extern DIR *fdopendir(int __fd); #endif /* Close the directory stream DIRP. Return 0 if successful, -1 if not. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int closedir(DIR * __dirp) __nonnull((1)); /* Read a directory entry from DIRP. Return a pointer to a `struct dirent' describing the entry, or NULL for EOF or error. The storage returned may be overwritten by a later readdir call on the same DIR stream. If the Large File Support API is selected we have to use the appropriate interface. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern struct dirent *readdir(DIR * __dirp) __nonnull((1)); #else # ifdef __REDIRECT extern struct dirent *__REDIRECT(readdir, (DIR * __dirp), readdir64) __nonnull((1)); # else # define readdir readdir64 # endif #endif #ifdef __USE_LARGEFILE64 extern struct dirent64 *readdir64(DIR * __dirp) __nonnull((1)); #endif #ifdef __USE_POSIX /* Reentrant version of `readdir'. Return in RESULT a pointer to the next entry. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int readdir_r(DIR * __restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __nonnull((1, 2, 3)) __attribute_deprecated__; # else # ifdef __REDIRECT extern int __REDIRECT(readdir_r, (DIR * __restrict __dirp, struct dirent * __restrict __entry, struct dirent ** __restrict __result), readdir64_r) __nonnull((1, 2, 3)) __attribute_deprecated__; # else # define readdir_r readdir64_r # endif # endif # ifdef __USE_LARGEFILE64 extern int readdir64_r(DIR * __restrict __dirp, struct dirent64 *__restrict __entry, struct dirent64 **__restrict __result) __nonnull((1, 2, 3)) __attribute_deprecated__; # endif #endif /* POSIX or misc */ /* Rewind DIRP to the beginning of the directory. */ extern void rewinddir(DIR * __dirp) __THROW __nonnull((1)); #if defined __USE_MISC || defined __USE_XOPEN # include /* Seek to position POS on DIRP. */ extern void seekdir(DIR * __dirp, long int __pos) __THROW __nonnull((1)); /* Return the current position of DIRP. */ extern long int telldir(DIR * __dirp) __THROW __nonnull((1)); #endif #ifdef __USE_XOPEN2K8 /* Return the file descriptor used by DIRP. */ extern int dirfd(DIR * __dirp) __THROW __nonnull((1)); # if defined __OPTIMIZE__ && defined _DIR_dirfd # define dirfd(dirp) _DIR_dirfd (dirp) # endif # ifdef __USE_MISC # ifndef MAXNAMLEN /* Get the definitions of the POSIX.1 limits. */ # include /* `MAXNAMLEN' is the BSD name for what POSIX calls `NAME_MAX'. */ # ifdef NAME_MAX # define MAXNAMLEN NAME_MAX # else # define MAXNAMLEN 255 # endif # endif # endif # define __need_size_t # include /* Scan the directory DIR, calling SELECTOR on each directory entry. Entries for which SELECT returns nonzero are individually malloc'd, sorted using qsort with CMP, and collected in a malloc'd array in *NAMELIST. Returns the number of entries selected, or -1 on error. This function is a cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int scandir(const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __nonnull((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT(scandir, (const char *__restrict __dir, struct dirent *** __restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)), scandir64) __nonnull((1, 2)); # else # define scandir scandir64 # endif # endif # if defined __USE_GNU && defined __USE_LARGEFILE64 /* This function is like `scandir' but it uses the 64bit dirent structure. Please note that the CMP function must now work with struct dirent64 **. */ extern int scandir64(const char *__restrict __dir, struct dirent64 ***__restrict __namelist, int (*__selector) (const struct dirent64 *), int (*__cmp) (const struct dirent64 **, const struct dirent64 **)) __nonnull((1, 2)); # endif # ifdef __USE_GNU /* Similar to `scandir' but a relative DIR name is interpreted relative to the directory for which DFD is a descriptor. This function is a cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int scandirat(int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __nonnull((2, 3)); # else # ifdef __REDIRECT extern int __REDIRECT(scandirat, (int __dfd, const char *__restrict __dir, struct dirent *** __restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)), scandirat64) __nonnull((2, 3)); # else # define scandirat scandirat64 # endif # endif /* This function is like `scandir' but it uses the 64bit dirent structure. Please note that the CMP function must now work with struct dirent64 **. */ extern int scandirat64(int __dfd, const char *__restrict __dir, struct dirent64 ***__restrict __namelist, int (*__selector) (const struct dirent64 *), int (*__cmp) (const struct dirent64 **, const struct dirent64 **)) __nonnull((2, 3)); # endif /* Function to compare two `struct dirent's alphabetically. */ # ifndef __USE_FILE_OFFSET64 extern int alphasort(const struct dirent **__e1, const struct dirent **__e2) __THROW __attribute_pure__ __nonnull((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT_NTH(alphasort, (const struct dirent ** __e1, const struct dirent ** __e2), alphasort64) __attribute_pure__ __nonnull((1, 2)); # else # define alphasort alphasort64 # endif # endif # if defined __USE_GNU && defined __USE_LARGEFILE64 extern int alphasort64(const struct dirent64 **__e1, const struct dirent64 **__e2) __THROW __attribute_pure__ __nonnull((1, 2)); # endif #endif /* Use XPG7. */ #ifdef __USE_MISC /* Read directory entries from FD into BUF, reading at most NBYTES. Reading starts at offset *BASEP, and *BASEP is updated with the new position after reading. Returns the number of bytes read; zero when at end of directory; or -1 for errors. */ # ifndef __USE_FILE_OFFSET64 extern __ssize_t getdirentries(int __fd, char *__restrict __buf, size_t __nbytes, __off_t * __restrict __basep) __THROW __nonnull((2, 4)); # else # ifdef __REDIRECT extern __ssize_t __REDIRECT_NTH(getdirentries, (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t * __restrict __basep), getdirentries64) __nonnull((2, 4)); # else # define getdirentries getdirentries64 # endif # endif # ifdef __USE_LARGEFILE64 extern __ssize_t getdirentries64(int __fd, char *__restrict __buf, size_t __nbytes, __off64_t * __restrict __basep) __THROW __nonnull((2, 4)); # endif #endif /* Use misc. */ #ifdef __USE_GNU /* Function to compare two `struct dirent's by name & version. */ # ifndef __USE_FILE_OFFSET64 extern int versionsort(const struct dirent **__e1, const struct dirent **__e2) __THROW __attribute_pure__ __nonnull((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT_NTH(versionsort, (const struct dirent ** __e1, const struct dirent ** __e2), versionsort64) __attribute_pure__ __nonnull((1, 2)); # else # define versionsort versionsort64 # endif # endif # ifdef __USE_LARGEFILE64 extern int versionsort64(const struct dirent64 **__e1, const struct dirent64 **__e2) __THROW __attribute_pure__ __nonnull((1, 2)); # endif #endif /* Use GNU. */ __END_DECLS #endif /* dirent.h */ ================================================ FILE: v2/headers/linux_386/usr/include/dlfcn.h ================================================ /* User functions for run-time dynamic loading. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _DLFCN_H #define _DLFCN_H 1 #include #define __need_size_t #include /* Collect various system dependent definitions and declarations. */ #include #ifdef __USE_GNU /* If the first argument of `dlsym' or `dlvsym' is set to RTLD_NEXT the run-time address of the symbol called NAME in the next shared object is returned. The "next" relation is defined by the order the shared objects were loaded. */ # define RTLD_NEXT ((void *) -1l) /* If the first argument to `dlsym' or `dlvsym' is set to RTLD_DEFAULT the run-time address of the symbol called NAME in the global scope is returned. */ # define RTLD_DEFAULT ((void *) 0) /* Type for namespace indeces. */ typedef long int Lmid_t; /* Special namespace ID values. */ # define LM_ID_BASE 0 /* Initial namespace. */ # define LM_ID_NEWLM -1 /* For dlmopen: request new namespace. */ #endif __BEGIN_DECLS /* Open the shared object FILE and map it in; return a handle that can be passed to `dlsym' to get symbol values from it. */ extern void *dlopen(const char *__file, int __mode) __THROWNL; /* Unmap and close a shared object opened by `dlopen'. The handle cannot be used again after calling `dlclose'. */ extern int dlclose(void *__handle) __THROWNL __nonnull((1)); /* Find the run-time address in the shared object HANDLE refers to of the symbol called NAME. */ extern void *dlsym(void *__restrict __handle, const char *__restrict __name) __THROW __nonnull((2)); #ifdef __USE_GNU /* Like `dlopen', but request object to be allocated in a new namespace. */ extern void *dlmopen(Lmid_t __nsid, const char *__file, int __mode) __THROWNL; /* Find the run-time address in the shared object HANDLE refers to of the symbol called NAME with VERSION. */ extern void *dlvsym(void *__restrict __handle, const char *__restrict __name, const char *__restrict __version) __THROW __nonnull((2, 3)); #endif /* When any of the above functions fails, call this function to return a string describing the error. Each call resets the error string so that a following call returns null. */ extern char *dlerror(void) __THROW; #ifdef __USE_GNU /* Structure containing information about object searched using `dladdr'. */ typedef struct { const char *dli_fname; /* File name of defining object. */ void *dli_fbase; /* Load address of that object. */ const char *dli_sname; /* Name of nearest symbol. */ void *dli_saddr; /* Exact value of nearest symbol. */ } Dl_info; /* Fill in *INFO with the following information about ADDRESS. Returns 0 iff no shared object's segments contain that address. */ extern int dladdr(const void *__address, Dl_info * __info) __THROW __nonnull((2)); /* Same as `dladdr', but additionally sets *EXTRA_INFO according to FLAGS. */ extern int dladdr1(const void *__address, Dl_info * __info, void **__extra_info, int __flags) __THROW __nonnull((2)); /* These are the possible values for the FLAGS argument to `dladdr1'. This indicates what extra information is stored at *EXTRA_INFO. It may also be zero, in which case the EXTRA_INFO argument is not used. */ enum { /* Matching symbol table entry (const ElfNN_Sym *). */ RTLD_DL_SYMENT = 1, /* The object containing the address (struct link_map *). */ RTLD_DL_LINKMAP = 2 }; /* Get information about the shared object HANDLE refers to. REQUEST is from among the values below, and determines the use of ARG. On success, returns zero. On failure, returns -1 and records an error message to be fetched with `dlerror'. */ extern int dlinfo(void *__restrict __handle, int __request, void *__restrict __arg) __THROW __nonnull((1, 3)); /* These are the possible values for the REQUEST argument to `dlinfo'. */ enum { /* Treat ARG as `lmid_t *'; store namespace ID for HANDLE there. */ RTLD_DI_LMID = 1, /* Treat ARG as `struct link_map **'; store the `struct link_map *' for HANDLE there. */ RTLD_DI_LINKMAP = 2, RTLD_DI_CONFIGADDR = 3, /* Unsupported, defined by Solaris. */ /* Treat ARG as `Dl_serinfo *' (see below), and fill in to describe the directories that will be searched for dependencies of this object. RTLD_DI_SERINFOSIZE fills in just the `dls_cnt' and `dls_size' entries to indicate the size of the buffer that must be passed to RTLD_DI_SERINFO to fill in the full information. */ RTLD_DI_SERINFO = 4, RTLD_DI_SERINFOSIZE = 5, /* Treat ARG as `char *', and store there the directory name used to expand $ORIGIN in this shared object's dependency file names. */ RTLD_DI_ORIGIN = 6, RTLD_DI_PROFILENAME = 7, /* Unsupported, defined by Solaris. */ RTLD_DI_PROFILEOUT = 8, /* Unsupported, defined by Solaris. */ /* Treat ARG as `size_t *', and store there the TLS module ID of this object's PT_TLS segment, as used in TLS relocations; store zero if this object does not define a PT_TLS segment. */ RTLD_DI_TLS_MODID = 9, /* Treat ARG as `void **', and store there a pointer to the calling thread's TLS block corresponding to this object's PT_TLS segment. Store a null pointer if this object does not define a PT_TLS segment, or if the calling thread has not allocated a block for it. */ RTLD_DI_TLS_DATA = 10, RTLD_DI_MAX = 10 }; /* This is the type of elements in `Dl_serinfo', below. The `dls_name' member points to space in the buffer passed to `dlinfo'. */ typedef struct { char *dls_name; /* Name of library search path directory. */ unsigned int dls_flags; /* Indicates where this directory came from. */ } Dl_serpath; /* This is the structure that must be passed (by reference) to `dlinfo' for the RTLD_DI_SERINFO and RTLD_DI_SERINFOSIZE requests. */ typedef struct { size_t dls_size; /* Size in bytes of the whole buffer. */ unsigned int dls_cnt; /* Number of elements in `dls_serpath'. */ Dl_serpath dls_serpath[1]; /* Actually longer, dls_cnt elements. */ } Dl_serinfo; #endif /* __USE_GNU */ __END_DECLS #endif /* dlfcn.h */ ================================================ FILE: v2/headers/linux_386/usr/include/endian.h ================================================ /* Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _ENDIAN_H #define _ENDIAN_H 1 #include /* Definitions for byte order, according to significance of bytes, from low addresses to high addresses. The value is what you get by putting '4' in the most significant byte, '3' in the second most significant byte, '2' in the second least significant byte, and '1' in the least significant byte, and then writing down one digit for each byte, starting with the byte at the lowest address at the left, and proceeding to the byte with the highest address at the right. */ #define __LITTLE_ENDIAN 1234 #define __BIG_ENDIAN 4321 #define __PDP_ENDIAN 3412 /* This file defines `__BYTE_ORDER' for the particular machine. */ #include /* Some machines may need to use a different endianness for floating point values. */ #ifndef __FLOAT_WORD_ORDER # define __FLOAT_WORD_ORDER __BYTE_ORDER #endif #ifdef __USE_MISC # define LITTLE_ENDIAN __LITTLE_ENDIAN # define BIG_ENDIAN __BIG_ENDIAN # define PDP_ENDIAN __PDP_ENDIAN # define BYTE_ORDER __BYTE_ORDER #endif #if __BYTE_ORDER == __LITTLE_ENDIAN # define __LONG_LONG_PAIR(HI, LO) LO, HI #elif __BYTE_ORDER == __BIG_ENDIAN # define __LONG_LONG_PAIR(HI, LO) HI, LO #endif #if defined __USE_MISC && !defined __ASSEMBLER__ /* Conversion interfaces. */ # include # include # if __BYTE_ORDER == __LITTLE_ENDIAN # define htobe16(x) __bswap_16 (x) # define htole16(x) __uint16_identity (x) # define be16toh(x) __bswap_16 (x) # define le16toh(x) __uint16_identity (x) # define htobe32(x) __bswap_32 (x) # define htole32(x) __uint32_identity (x) # define be32toh(x) __bswap_32 (x) # define le32toh(x) __uint32_identity (x) # define htobe64(x) __bswap_64 (x) # define htole64(x) __uint64_identity (x) # define be64toh(x) __bswap_64 (x) # define le64toh(x) __uint64_identity (x) # else # define htobe16(x) __uint16_identity (x) # define htole16(x) __bswap_16 (x) # define be16toh(x) __uint16_identity (x) # define le16toh(x) __bswap_16 (x) # define htobe32(x) __uint32_identity (x) # define htole32(x) __bswap_32 (x) # define be32toh(x) __uint32_identity (x) # define le32toh(x) __bswap_32 (x) # define htobe64(x) __uint64_identity (x) # define htole64(x) __bswap_64 (x) # define be64toh(x) __uint64_identity (x) # define le64toh(x) __bswap_64 (x) # endif #endif #endif /* endian.h */ ================================================ FILE: v2/headers/linux_386/usr/include/errno.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.5 Errors */ #ifndef _ERRNO_H #define _ERRNO_H 1 #include /* The system-specific definitions of the E* constants, as macros. */ #include /* When included from assembly language, this header only provides the E* constants. */ #ifndef __ASSEMBLER__ __BEGIN_DECLS /* The error code set by various library functions. */ extern int *__errno_location(void) __THROW __attribute_const__; # define errno (*__errno_location ()) # ifdef __USE_GNU /* The full and simple forms of the name with which the program was invoked. These variables are set up automatically at startup based on the value of argv[0]. */ extern char *program_invocation_name; extern char *program_invocation_short_name; /* bits/errno.h may have defined this type. If it didn't, provide a fallback definition. */ # ifndef __error_t_defined # define __error_t_defined 1 typedef int error_t; # endif # endif /* __USE_GNU */ __END_DECLS #endif /* !__ASSEMBLER__ */ #endif /* errno.h */ ================================================ FILE: v2/headers/linux_386/usr/include/execinfo.h ================================================ /* Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _EXECINFO_H #define _EXECINFO_H 1 #include __BEGIN_DECLS /* Store up to SIZE return address of the current program state in ARRAY and return the exact number of values stored. */ extern int backtrace(void **__array, int __size) __nonnull((1)); /* Return names of functions from the backtrace list in ARRAY in a newly malloc()ed memory block. */ extern char **backtrace_symbols(void *const *__array, int __size) __THROW __nonnull((1)); /* This function is similar to backtrace_symbols() but it writes the result immediately to a file. */ extern void backtrace_symbols_fd(void *const *__array, int __size, int __fd) __THROW __nonnull((1)); __END_DECLS #endif /* execinfo.h */ ================================================ FILE: v2/headers/linux_386/usr/include/fcntl.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 6.5 File Control Operations */ #ifndef _FCNTL_H #define _FCNTL_H 1 #include /* This must be early so can define types winningly. */ __BEGIN_DECLS /* Get __mode_t, __dev_t and __off_t .*/ #include /* Get the definitions of O_*, F_*, FD_*: all the numbers and flag bits for `open', `fcntl', et al. */ #include /* Detect if open needs mode as a third argument (or for openat as a fourth argument). */ #ifdef __O_TMPFILE # define __OPEN_NEEDS_MODE(oflag) \ (((oflag) & O_CREAT) != 0 || ((oflag) & __O_TMPFILE) == __O_TMPFILE) #else # define __OPEN_NEEDS_MODE(oflag) (((oflag) & O_CREAT) != 0) #endif /* POSIX.1-2001 specifies that these types are defined by . Earlier POSIX standards permitted any type ending in `_t' to be defined by any POSIX header, so we don't conditionalize the definitions here. */ #ifndef __mode_t_defined typedef __mode_t mode_t; # define __mode_t_defined #endif #ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; # define __off64_t_defined #endif #ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif /* For XPG all symbols from should also be available. */ #ifdef __USE_XOPEN2K8 # include #endif #if defined __USE_XOPEN || defined __USE_XOPEN2K8 # include # define S_IFMT __S_IFMT # define S_IFDIR __S_IFDIR # define S_IFCHR __S_IFCHR # define S_IFBLK __S_IFBLK # define S_IFREG __S_IFREG # ifdef __S_IFIFO # define S_IFIFO __S_IFIFO # endif # ifdef __S_IFLNK # define S_IFLNK __S_IFLNK # endif # if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) && defined __S_IFSOCK # define S_IFSOCK __S_IFSOCK # endif /* Protection bits. */ # define S_ISUID __S_ISUID /* Set user ID on execution. */ # define S_ISGID __S_ISGID /* Set group ID on execution. */ # if defined __USE_MISC || defined __USE_XOPEN /* Save swapped text after use (sticky bit). This is pretty well obsolete. */ # define S_ISVTX __S_ISVTX # endif # define S_IRUSR __S_IREAD /* Read by owner. */ # define S_IWUSR __S_IWRITE /* Write by owner. */ # define S_IXUSR __S_IEXEC /* Execute by owner. */ /* Read, write, and execute by owner. */ # define S_IRWXU (__S_IREAD|__S_IWRITE|__S_IEXEC) # define S_IRGRP (S_IRUSR >> 3) /* Read by group. */ # define S_IWGRP (S_IWUSR >> 3) /* Write by group. */ # define S_IXGRP (S_IXUSR >> 3) /* Execute by group. */ /* Read, write, and execute by group. */ # define S_IRWXG (S_IRWXU >> 3) # define S_IROTH (S_IRGRP >> 3) /* Read by others. */ # define S_IWOTH (S_IWGRP >> 3) /* Write by others. */ # define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */ /* Read, write, and execute by others. */ # define S_IRWXO (S_IRWXG >> 3) #endif #ifdef __USE_MISC # ifndef R_OK /* Verbatim from . Ugh. */ /* Values for the second argument to access. These may be OR'd together. */ # define R_OK 4 /* Test for read permission. */ # define W_OK 2 /* Test for write permission. */ # define X_OK 1 /* Test for execute permission. */ # define F_OK 0 /* Test for existence. */ # endif #endif /* Use misc. */ /* XPG wants the following symbols. has the same definitions. */ #if defined __USE_XOPEN || defined __USE_XOPEN2K8 # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Seek from end of file. */ #endif /* XPG */ /* Do the file control operation described by CMD on FD. The remaining arguments are interpreted depending on CMD. This function is a cancellation point and therefore not marked with __THROW. */ extern int fcntl(int __fd, int __cmd, ...); /* Open FILE and return a new file descriptor for it, or -1 on error. OFLAG determines the type of access used. If O_CREAT or O_TMPFILE is set in OFLAG, the third argument is taken as a `mode_t', the mode of the created file. This function is a cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int open(const char *__file, int __oflag, ...) __nonnull((1)); #else # ifdef __REDIRECT extern int __REDIRECT(open, (const char *__file, int __oflag, ...), open64) __nonnull((1)); # else # define open open64 # endif #endif #ifdef __USE_LARGEFILE64 extern int open64(const char *__file, int __oflag, ...) __nonnull((1)); #endif #ifdef __USE_ATFILE /* Similar to `open' but a relative path name is interpreted relative to the directory for which FD is a descriptor. NOTE: some other `openat' implementation support additional functionality through this interface, especially using the O_XATTR flag. This is not yet supported here. This function is a cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int openat(int __fd, const char *__file, int __oflag, ...) __nonnull((2)); # else # ifdef __REDIRECT extern int __REDIRECT(openat, (int __fd, const char *__file, int __oflag, ...), openat64) __nonnull((2)); # else # define openat openat64 # endif # endif # ifdef __USE_LARGEFILE64 extern int openat64(int __fd, const char *__file, int __oflag, ...) __nonnull((2)); # endif #endif /* Create and open FILE, with mode MODE. This takes an `int' MODE argument because that is what `mode_t' will be widened to. This function is a cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int creat(const char *__file, mode_t __mode) __nonnull((1)); #else # ifdef __REDIRECT extern int __REDIRECT(creat, (const char *__file, mode_t __mode), creat64) __nonnull((1)); # else # define creat creat64 # endif #endif #ifdef __USE_LARGEFILE64 extern int creat64(const char *__file, mode_t __mode) __nonnull((1)); #endif #if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \ && !defined __USE_POSIX)) /* NOTE: These declarations also appear in ; be sure to keep both files consistent. Some systems have them there and some here, and some software depends on the macros being defined without including both. */ /* `lockf' is a simpler interface to the locking facilities of `fcntl'. LEN is always relative to the current file position. The CMD argument is one of the following. */ # define F_ULOCK 0 /* Unlock a previously locked region. */ # define F_LOCK 1 /* Lock a region for exclusive use. */ # define F_TLOCK 2 /* Test and lock a region for exclusive use. */ # define F_TEST 3 /* Test a region for other processes locks. */ # ifndef __USE_FILE_OFFSET64 extern int lockf(int __fd, int __cmd, off_t __len); # else # ifdef __REDIRECT extern int __REDIRECT(lockf, (int __fd, int __cmd, __off64_t __len), lockf64); # else # define lockf lockf64 # endif # endif # ifdef __USE_LARGEFILE64 extern int lockf64(int __fd, int __cmd, off64_t __len); # endif #endif #ifdef __USE_XOPEN2K /* Advice the system about the expected behaviour of the application with respect to the file associated with FD. */ # ifndef __USE_FILE_OFFSET64 extern int posix_fadvise(int __fd, off_t __offset, off_t __len, int __advise) __THROW; # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(posix_fadvise, (int __fd, __off64_t __offset, __off64_t __len, int __advise), posix_fadvise64); # else # define posix_fadvise posix_fadvise64 # endif # endif # ifdef __USE_LARGEFILE64 extern int posix_fadvise64(int __fd, off64_t __offset, off64_t __len, int __advise) __THROW; # endif /* Reserve storage for the data of the file associated with FD. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int posix_fallocate(int __fd, off_t __offset, off_t __len); # else # ifdef __REDIRECT extern int __REDIRECT(posix_fallocate, (int __fd, __off64_t __offset, __off64_t __len), posix_fallocate64); # else # define posix_fallocate posix_fallocate64 # endif # endif # ifdef __USE_LARGEFILE64 extern int posix_fallocate64(int __fd, off64_t __offset, off64_t __len); # endif #endif /* Define some inlines helping to catch common problems. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function \ && defined __va_arg_pack_len # include #endif __END_DECLS #endif /* fcntl.h */ ================================================ FILE: v2/headers/linux_386/usr/include/features.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _FEATURES_H #define _FEATURES_H 1 /* These are defined by the user (or the compiler) to specify the desired environment: __STRICT_ANSI__ ISO Standard C. _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. _ISOC11_SOURCE Extensions to ISO C99 from ISO C11. __STDC_WANT_LIB_EXT2__ Extensions to ISO C99 from TR 27431-2:2010. __STDC_WANT_IEC_60559_BFP_EXT__ Extensions to ISO C11 from TS 18661-1:2014. __STDC_WANT_IEC_60559_FUNCS_EXT__ Extensions to ISO C11 from TS 18661-4:2015. __STDC_WANT_IEC_60559_TYPES_EXT__ Extensions to ISO C11 from TS 18661-3:2015. _POSIX_SOURCE IEEE Std 1003.1. _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; if >=199309L, add IEEE Std 1003.1b-1993; if >=199506L, add IEEE Std 1003.1c-1995; if >=200112L, all of IEEE 1003.1-2004 if >=200809L, all of IEEE 1003.1-2008 _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if Single Unix conformance is wanted, to 600 for the sixth revision, to 700 for the seventh revision. _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. _LARGEFILE_SOURCE Some more functions for correct standard I/O. _LARGEFILE64_SOURCE Additional functionality from LFS for large files. _FILE_OFFSET_BITS=N Select default filesystem interface. _ATFILE_SOURCE Additional *at interfaces. _GNU_SOURCE All of the above, plus GNU extensions. _DEFAULT_SOURCE The default set of features (taking precedence over __STRICT_ANSI__). _FORTIFY_SOURCE Add security hardening to many library functions. Set to 1 or 2; 2 performs stricter checks than 1. _REENTRANT, _THREAD_SAFE Obsolete; equivalent to _POSIX_C_SOURCE=199506L. The `-ansi' switch to the GNU C compiler, and standards conformance options such as `-std=c99', define __STRICT_ANSI__. If none of these are defined, or if _DEFAULT_SOURCE is defined, the default is to have _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to 200809L, as well as enabling miscellaneous functions from BSD and SVID. If more than one of these are defined, they accumulate. For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE together give you ISO C, 1003.1, and 1003.2, but nothing else. These are defined by this file and are used by the header files to decide what to declare or define: __GLIBC_USE (F) Define things from feature set F. This is defined to 1 or 0; the subsequent macros are either defined or undefined, and those tests should be moved to __GLIBC_USE. __USE_ISOC11 Define ISO C11 things. __USE_ISOC99 Define ISO C99 things. __USE_ISOC95 Define ISO C90 AMD1 (C95) things. __USE_ISOCXX11 Define ISO C++11 things. __USE_POSIX Define IEEE Std 1003.1 things. __USE_POSIX2 Define IEEE Std 1003.2 things. __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things. __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things. __USE_XOPEN Define XPG things. __USE_XOPEN_EXTENDED Define X/Open Unix things. __USE_UNIX98 Define Single Unix V2 things. __USE_XOPEN2K Define XPG6 things. __USE_XOPEN2KXSI Define XPG6 XSI things. __USE_XOPEN2K8 Define XPG7 things. __USE_XOPEN2K8XSI Define XPG7 XSI things. __USE_LARGEFILE Define correct standard I/O things. __USE_LARGEFILE64 Define LFS things with separate names. __USE_FILE_OFFSET64 Define 64bit interface as default. __USE_MISC Define things from 4.3BSD or System V Unix. __USE_ATFILE Define *at interfaces and AT_* constants for them. __USE_GNU Define GNU extensions. __USE_FORTIFY_LEVEL Additional security measures used, according to level. The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are defined by this file unconditionally. `__GNU_LIBRARY__' is provided only for compatibility. All new code should use the other symbols to test for features. All macros listed above as possibly being defined by this file are explicitly undefined if they are not explicitly defined. Feature-test macros that are not defined by the user or compiler but are implied by the other feature-test macros defined (or by the lack of any definitions) are defined by the file. ISO C feature test macros depend on the definition of the macro when an affected header is included, not when the first system header is included, and so they are handled in , which does not have a multiple include guard. Feature test macros that can be handled from the first system header included are handled here. */ /* Undefine everything, so we get a clean slate. */ #undef __USE_ISOC11 #undef __USE_ISOC99 #undef __USE_ISOC95 #undef __USE_ISOCXX11 #undef __USE_POSIX #undef __USE_POSIX2 #undef __USE_POSIX199309 #undef __USE_POSIX199506 #undef __USE_XOPEN #undef __USE_XOPEN_EXTENDED #undef __USE_UNIX98 #undef __USE_XOPEN2K #undef __USE_XOPEN2KXSI #undef __USE_XOPEN2K8 #undef __USE_XOPEN2K8XSI #undef __USE_LARGEFILE #undef __USE_LARGEFILE64 #undef __USE_FILE_OFFSET64 #undef __USE_MISC #undef __USE_ATFILE #undef __USE_GNU #undef __USE_FORTIFY_LEVEL #undef __KERNEL_STRICT_NAMES #undef __GLIBC_USE_DEPRECATED_GETS /* Suppress kernel-name space pollution unless user expressedly asks for it. */ #ifndef _LOOSE_KERNEL_NAMES # define __KERNEL_STRICT_NAMES #endif /* Convenience macro to test the version of gcc. Use like this: #if __GNUC_PREREQ (2,8) ... code requiring gcc 2.8 or later ... #endif Note: only works for GCC 2.0 and later, because __GNUC_MINOR__ was added in 2.0. */ #if defined __GNUC__ && defined __GNUC_MINOR__ # define __GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #else # define __GNUC_PREREQ(maj, min) 0 #endif /* Similarly for clang. Features added to GCC after version 4.2 may or may not also be available in clang, and clang's definitions of __GNUC(_MINOR)__ are fixed at 4 and 2 respectively. Not all such features can be queried via __has_extension/__has_feature. */ #if defined __clang_major__ && defined __clang_minor__ # define __glibc_clang_prereq(maj, min) \ ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min)) #else # define __glibc_clang_prereq(maj, min) 0 #endif /* Whether to use feature set F. */ #define __GLIBC_USE(F) __GLIBC_USE_ ## F /* _BSD_SOURCE and _SVID_SOURCE are deprecated aliases for _DEFAULT_SOURCE. If _DEFAULT_SOURCE is present we do not issue a warning; the expectation is that the source is being transitioned to use the new macro. */ #if (defined _BSD_SOURCE || defined _SVID_SOURCE) \ && !defined _DEFAULT_SOURCE # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" # undef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 #endif /* If _GNU_SOURCE was defined by the user, turn on all the other features. */ #ifdef _GNU_SOURCE # undef _ISOC95_SOURCE # define _ISOC95_SOURCE 1 # undef _ISOC99_SOURCE # define _ISOC99_SOURCE 1 # undef _ISOC11_SOURCE # define _ISOC11_SOURCE 1 # undef _POSIX_SOURCE # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 200809L # undef _XOPEN_SOURCE # define _XOPEN_SOURCE 700 # undef _XOPEN_SOURCE_EXTENDED # define _XOPEN_SOURCE_EXTENDED 1 # undef _LARGEFILE64_SOURCE # define _LARGEFILE64_SOURCE 1 # undef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 # undef _ATFILE_SOURCE # define _ATFILE_SOURCE 1 #endif /* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined, define _DEFAULT_SOURCE. */ #if (defined _DEFAULT_SOURCE \ || (!defined __STRICT_ANSI__ \ && !defined _ISOC99_SOURCE \ && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE \ && !defined _XOPEN_SOURCE)) # undef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 #endif /* This is to enable the ISO C11 extension. */ #if (defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) # define __USE_ISOC11 1 #endif /* This is to enable the ISO C99 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) # define __USE_ISOC99 1 #endif /* This is to enable the ISO C90 Amendment 1:1995 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L)) # define __USE_ISOC95 1 #endif #ifdef __cplusplus /* This is to enable compatibility for ISO C++17. */ # if __cplusplus >= 201703L # define __USE_ISOC11 1 # endif /* This is to enable compatibility for ISO C++11. Check the temporary macro for now, too. */ # if __cplusplus >= 201103L || defined __GXX_EXPERIMENTAL_CXX0X__ # define __USE_ISOCXX11 1 # define __USE_ISOC99 1 # endif #endif /* If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE is defined, use POSIX.1-2008 (or another version depending on _XOPEN_SOURCE). */ #ifdef _DEFAULT_SOURCE # if !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE # define __USE_POSIX_IMPLICITLY 1 # endif # undef _POSIX_SOURCE # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 200809L #endif #if ((!defined __STRICT_ANSI__ \ || (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500)) \ && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE) # define _POSIX_SOURCE 1 # if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500 # define _POSIX_C_SOURCE 2 # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 600 # define _POSIX_C_SOURCE 199506L # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 700 # define _POSIX_C_SOURCE 200112L # else # define _POSIX_C_SOURCE 200809L # endif # define __USE_POSIX_IMPLICITLY 1 #endif /* Some C libraries once required _REENTRANT and/or _THREAD_SAFE to be defined in all multithreaded code. GNU libc has not required this for many years. We now treat them as compatibility synonyms for _POSIX_C_SOURCE=199506L, which is the earliest level of POSIX with comprehensive support for multithreaded code. Using them never lowers the selected level of POSIX conformance, only raises it. */ #if ((!defined _POSIX_C_SOURCE || (_POSIX_C_SOURCE - 0) < 199506L) \ && (defined _REENTRANT || defined _THREAD_SAFE)) # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 199506L #endif #if (defined _POSIX_SOURCE \ || (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 1) \ || defined _XOPEN_SOURCE) # define __USE_POSIX 1 #endif #if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE # define __USE_POSIX2 1 #endif #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199309L # define __USE_POSIX199309 1 #endif #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199506L # define __USE_POSIX199506 1 #endif #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200112L # define __USE_XOPEN2K 1 # undef __USE_ISOC95 # define __USE_ISOC95 1 # undef __USE_ISOC99 # define __USE_ISOC99 1 #endif #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200809L # define __USE_XOPEN2K8 1 # undef _ATFILE_SOURCE # define _ATFILE_SOURCE 1 #endif #ifdef _XOPEN_SOURCE # define __USE_XOPEN 1 # if (_XOPEN_SOURCE - 0) >= 500 # define __USE_XOPEN_EXTENDED 1 # define __USE_UNIX98 1 # undef _LARGEFILE_SOURCE # define _LARGEFILE_SOURCE 1 # if (_XOPEN_SOURCE - 0) >= 600 # if (_XOPEN_SOURCE - 0) >= 700 # define __USE_XOPEN2K8 1 # define __USE_XOPEN2K8XSI 1 # endif # define __USE_XOPEN2K 1 # define __USE_XOPEN2KXSI 1 # undef __USE_ISOC95 # define __USE_ISOC95 1 # undef __USE_ISOC99 # define __USE_ISOC99 1 # endif # else # ifdef _XOPEN_SOURCE_EXTENDED # define __USE_XOPEN_EXTENDED 1 # endif # endif #endif #ifdef _LARGEFILE_SOURCE # define __USE_LARGEFILE 1 #endif #ifdef _LARGEFILE64_SOURCE # define __USE_LARGEFILE64 1 #endif #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 # define __USE_FILE_OFFSET64 1 #endif #if defined _DEFAULT_SOURCE # define __USE_MISC 1 #endif #ifdef _ATFILE_SOURCE # define __USE_ATFILE 1 #endif #ifdef _GNU_SOURCE # define __USE_GNU 1 #endif #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \ && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0 # if _FORTIFY_SOURCE > 1 # define __USE_FORTIFY_LEVEL 2 # else # define __USE_FORTIFY_LEVEL 1 # endif #else # define __USE_FORTIFY_LEVEL 0 #endif /* The function 'gets' existed in C89, but is impossible to use safely. It has been removed from ISO C11 and ISO C++14. Note: for compatibility with various implementations of , this test must consider only the value of __cplusplus when compiling C++. */ #if defined __cplusplus ? __cplusplus >= 201402L : defined __USE_ISOC11 # define __GLIBC_USE_DEPRECATED_GETS 0 #else # define __GLIBC_USE_DEPRECATED_GETS 1 #endif /* Get definitions of __STDC_* predefined macros, if the compiler has not preincluded this header automatically. */ #include /* This macro indicates that the installed library is the GNU C Library. For historic reasons the value now is 6 and this will stay from now on. The use of this variable is deprecated. Use __GLIBC__ and __GLIBC_MINOR__ now (see below) when you want to test for a specific GNU C library version and use the values in to get the sonames of the shared libraries. */ #undef __GNU_LIBRARY__ #define __GNU_LIBRARY__ 6 /* Major and minor version number of the GNU C library package. Use these macros to test for features in specific releases. */ #define __GLIBC__ 2 #define __GLIBC_MINOR__ 27 #define __GLIBC_PREREQ(maj, min) \ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) /* This is here only because every header file already includes this one. */ #ifndef __ASSEMBLER__ # ifndef _SYS_CDEFS_H # include # endif /* If we don't have __REDIRECT, prototypes will be missing if __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */ # if defined __USE_FILE_OFFSET64 && !defined __REDIRECT # define __USE_LARGEFILE 1 # define __USE_LARGEFILE64 1 # endif #endif /* !ASSEMBLER */ /* Decide whether we can define 'extern inline' functions in headers. */ #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \ && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \ && defined __extern_inline # define __USE_EXTERN_INLINES 1 #endif /* This is here only because every header file already includes this one. Get the definitions of all the appropriate `__stub_FUNCTION' symbols. contains `#define __stub_FUNCTION' when FUNCTION is a stub that will always return failure (and set errno to ENOSYS). */ #include #endif /* features.h */ ================================================ FILE: v2/headers/linux_386/usr/include/fts.h ================================================ /* File tree traversal functions declarations. Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)fts.h 8.3 (Berkeley) 8/14/94 */ #ifndef _FTS_H #define _FTS_H 1 #include #include typedef struct { struct _ftsent *fts_cur; /* current node */ struct _ftsent *fts_child; /* linked list of children */ struct _ftsent **fts_array; /* sort array */ dev_t fts_dev; /* starting device # */ char *fts_path; /* path for this descent */ int fts_rfd; /* fd for root */ int fts_pathlen; /* sizeof(path) */ int fts_nitems; /* elements in the sort array */ int (*fts_compar) (const void *, const void *); /* compare fn */ #define FTS_COMFOLLOW 0x0001 /* follow command line symlinks */ #define FTS_LOGICAL 0x0002 /* logical walk */ #define FTS_NOCHDIR 0x0004 /* don't change directories */ #define FTS_NOSTAT 0x0008 /* don't get stat info */ #define FTS_PHYSICAL 0x0010 /* physical walk */ #define FTS_SEEDOT 0x0020 /* return dot and dot-dot */ #define FTS_XDEV 0x0040 /* don't cross devices */ #define FTS_WHITEOUT 0x0080 /* return whiteout information */ #define FTS_OPTIONMASK 0x00ff /* valid user option mask */ #define FTS_NAMEONLY 0x0100 /* (private) child names only */ #define FTS_STOP 0x0200 /* (private) unrecoverable error */ int fts_options; /* fts_open options, global flags */ } FTS; #ifdef __USE_LARGEFILE64 typedef struct { struct _ftsent64 *fts_cur; /* current node */ struct _ftsent64 *fts_child; /* linked list of children */ struct _ftsent64 **fts_array; /* sort array */ dev_t fts_dev; /* starting device # */ char *fts_path; /* path for this descent */ int fts_rfd; /* fd for root */ int fts_pathlen; /* sizeof(path) */ int fts_nitems; /* elements in the sort array */ int (*fts_compar) (const void *, const void *); /* compare fn */ int fts_options; /* fts_open options, global flags */ } FTS64; #endif typedef struct _ftsent { struct _ftsent *fts_cycle; /* cycle node */ struct _ftsent *fts_parent; /* parent directory */ struct _ftsent *fts_link; /* next file in directory */ long fts_number; /* local numeric value */ void *fts_pointer; /* local address value */ char *fts_accpath; /* access path */ char *fts_path; /* root path */ int fts_errno; /* errno for this node */ int fts_symfd; /* fd for symlink */ unsigned short fts_pathlen; /* strlen(fts_path) */ unsigned short fts_namelen; /* strlen(fts_name) */ ino_t fts_ino; /* inode */ dev_t fts_dev; /* device */ nlink_t fts_nlink; /* link count */ #define FTS_ROOTPARENTLEVEL -1 #define FTS_ROOTLEVEL 0 short fts_level; /* depth (-1 to N) */ #define FTS_D 1 /* preorder directory */ #define FTS_DC 2 /* directory that causes cycles */ #define FTS_DEFAULT 3 /* none of the above */ #define FTS_DNR 4 /* unreadable directory */ #define FTS_DOT 5 /* dot or dot-dot */ #define FTS_DP 6 /* postorder directory */ #define FTS_ERR 7 /* error; errno is set */ #define FTS_F 8 /* regular file */ #define FTS_INIT 9 /* initialized only */ #define FTS_NS 10 /* stat(2) failed */ #define FTS_NSOK 11 /* no stat(2) requested */ #define FTS_SL 12 /* symbolic link */ #define FTS_SLNONE 13 /* symbolic link without target */ #define FTS_W 14 /* whiteout object */ unsigned short fts_info; /* user flags for FTSENT structure */ #define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */ #define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */ unsigned short fts_flags; /* private flags for FTSENT structure */ #define FTS_AGAIN 1 /* read node again */ #define FTS_FOLLOW 2 /* follow symbolic link */ #define FTS_NOINSTR 3 /* no instructions */ #define FTS_SKIP 4 /* discard node */ unsigned short fts_instr; /* fts_set() instructions */ struct stat *fts_statp; /* stat(2) information */ char fts_name[1]; /* file name */ } FTSENT; #ifdef __USE_LARGEFILE64 typedef struct _ftsent64 { struct _ftsent64 *fts_cycle; /* cycle node */ struct _ftsent64 *fts_parent; /* parent directory */ struct _ftsent64 *fts_link; /* next file in directory */ long fts_number; /* local numeric value */ void *fts_pointer; /* local address value */ char *fts_accpath; /* access path */ char *fts_path; /* root path */ int fts_errno; /* errno for this node */ int fts_symfd; /* fd for symlink */ unsigned short fts_pathlen; /* strlen(fts_path) */ unsigned short fts_namelen; /* strlen(fts_name) */ ino64_t fts_ino; /* inode */ dev_t fts_dev; /* device */ nlink_t fts_nlink; /* link count */ short fts_level; /* depth (-1 to N) */ unsigned short fts_info; /* user flags for FTSENT structure */ unsigned short fts_flags; /* private flags for FTSENT structure */ unsigned short fts_instr; /* fts_set() instructions */ struct stat64 *fts_statp; /* stat(2) information */ char fts_name[1]; /* file name */ } FTSENT64; #endif __BEGIN_DECLS #ifndef __USE_FILE_OFFSET64 FTSENT * fts_children(FTS *, int); int fts_close(FTS *); FTS *fts_open(char *const *, int, int (*)(const FTSENT **, const FTSENT **)); FTSENT *fts_read(FTS *); int fts_set(FTS *, FTSENT *, int) __THROW; #else # ifdef __REDIRECT FTSENT * __REDIRECT(fts_children, (FTS *, int), fts64_children); int __REDIRECT(fts_close, (FTS *), fts64_close); FTS *__REDIRECT(fts_open, (char *const *, int, int (*)(const FTSENT **, const FTSENT **)), fts64_open); FTSENT *__REDIRECT(fts_read, (FTS *), fts64_read); int __REDIRECT_NTH(fts_set, (FTS *, FTSENT *, int), fts64_set); # else # define fts_children fts64_children # define fts_close fts64_close # define fts_open fts64_open # define fts_read fts64_read # define fts_set fts64_set # endif #endif #ifdef __USE_LARGEFILE64 FTSENT64 * fts64_children(FTS64 *, int); int fts64_close(FTS64 *); FTS64 *fts64_open(char *const *, int, int (*)(const FTSENT64 **, const FTSENT64 **)); FTSENT64 *fts64_read(FTS64 *); int fts64_set(FTS64 *, FTSENT64 *, int) __THROW; #endif __END_DECLS #endif /* fts.h */ ================================================ FILE: v2/headers/linux_386/usr/include/getopt.h ================================================ /* Declarations for getopt. Copyright (C) 1989-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Unlike the bulk of the getopt implementation, this file is NOT part of gnulib; gnulib also has a getopt.h but it is different. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _GETOPT_H #define _GETOPT_H 1 #include /* The type of the 'argv' argument to getopt_long and getopt_long_only is properly 'char **', since both functions may write to the array (in order to move all the options to the beginning). However, for compatibility with old versions of LSB, glibc has to use 'char *const *' instead. */ #ifndef __getopt_argv_const # define __getopt_argv_const const #endif #include #include #endif /* getopt.h */ ================================================ FILE: v2/headers/linux_386/usr/include/grp.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 9.2.1 Group Database Access */ #ifndef _GRP_H #define _GRP_H 1 #include __BEGIN_DECLS #include #define __need_size_t #include /* For the Single Unix specification we must define this type here. */ #if (defined __USE_XOPEN || defined __USE_XOPEN2K) && !defined __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined #endif /* The group structure. */ struct group { char *gr_name; /* Group name. */ char *gr_passwd; /* Password. */ __gid_t gr_gid; /* Group ID. */ char **gr_mem; /* Member list. */ }; #ifdef __USE_MISC # include #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Rewind the group-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setgrent(void); /* Close the group-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endgrent(void); /* Read an entry from the group-file stream, opening it if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct group *getgrent(void); #endif #ifdef __USE_MISC /* Read a group entry from STREAM. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct group *fgetgrent(FILE * __stream); #endif #ifdef __USE_GNU /* Write the given entry onto the given stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int putgrent(const struct group *__restrict __p, FILE * __restrict __f); #endif /* Search for an entry with a matching group ID. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct group *getgrgid(__gid_t __gid); /* Search for an entry with a matching group name. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct group *getgrnam(const char *__name); #ifdef __USE_POSIX # ifdef __USE_MISC /* Reasonable value for the buffer sized used in the reentrant functions below. But better use `sysconf'. */ # define NSS_BUFLEN_GROUP 1024 # endif /* Reentrant versions of some of the functions above. PLEASE NOTE: the `getgrent_r' function is not (yet) standardized. The interface may change in later versions of this library. But the interface is designed following the principals used for the other reentrant functions so the chances are good this is what the POSIX people would choose. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ # ifdef __USE_GNU extern int getgrent_r(struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); # endif /* Search for an entry with a matching group ID. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getgrgid_r(__gid_t __gid, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); /* Search for an entry with a matching group name. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getgrnam_r(const char *__restrict __name, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); # ifdef __USE_MISC /* Read a group entry from STREAM. This function is not standardized an probably never will. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fgetgrent_r(FILE * __restrict __stream, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); # endif #endif /* POSIX or reentrant */ #ifdef __USE_MISC # define __need_size_t # include /* Set the group set for the current user to GROUPS (N of them). */ extern int setgroups(size_t __n, const __gid_t * __groups) __THROW; /* Store at most *NGROUPS members of the group set for USER into *GROUPS. Also include GROUP. The actual number of groups found is returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getgrouplist(const char *__user, __gid_t __group, __gid_t * __groups, int *__ngroups); /* Initialize the group set for the current user by reading the group database and using all groups of which USER is a member. Also include GROUP. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int initgroups(const char *__user, __gid_t __group); #endif /* Use misc. */ __END_DECLS #endif /* grp.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/asm/errno.h ================================================ #include ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/asm/ioctl.h ================================================ #include ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/asm/ioctls.h ================================================ #include ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/asm/param.h ================================================ #include ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/asm/socket.h ================================================ #include ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/asm/sockios.h ================================================ #include ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/_G_config.h ================================================ /* This file is needed by libio to define various configuration parameters. These are always the same in the GNU C library. */ #ifndef _BITS_G_CONFIG_H #define _BITS_G_CONFIG_H 1 #if !defined _BITS_LIBIO_H && !defined _G_CONFIG_H # error "Never include directly; use instead." #endif /* Define types for libio in terms of the standard internal type names. */ #include #define __need_size_t #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # define __need_wchar_t #endif #define __need_NULL #include #include #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # include #endif typedef struct { __off_t __pos; __mbstate_t __state; } _G_fpos_t; typedef struct { __off64_t __pos; __mbstate_t __state; } _G_fpos64_t; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # include typedef union { struct __gconv_info __cd; struct { struct __gconv_info __cd; struct __gconv_step_data __data; } __combined; } _G_iconv_t; #endif /* These library features are always available in the GNU C library. */ #define _G_va_list __gnuc_va_list #define _G_HAVE_MMAP 1 #define _G_HAVE_MREMAP 1 #define _G_IO_IO_FILE_VERSION 0x20001 /* This is defined by if `st_blksize' exists. */ #define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE) #define _G_BUFSIZ 8192 #endif /* bits/_G_config.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/byteswap-16.h ================================================ /* Macros to swap the order of bytes in 16-bit integer values. Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_BYTESWAP_H # error "Never use directly; include instead." #endif #ifdef __GNUC__ # if __GNUC__ >= 2 # define __bswap_16(x) \ (__extension__ \ ({ unsigned short int __v, __x = (unsigned short int) (x); \ if (__builtin_constant_p (__x)) \ __v = __bswap_constant_16 (__x); \ else \ __asm__ ("rorw $8, %w0" \ : "=r" (__v) \ : "0" (__x) \ : "cc"); \ __v; })) # else /* This is better than nothing. */ # define __bswap_16(x) \ (__extension__ \ ({ unsigned short int __x = (unsigned short int) (x); \ __bswap_constant_16 (__x); })) # endif #else static __inline unsigned short int __bswap_16(unsigned short int __bsx) { return __bswap_constant_16(__bsx); } #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/byteswap.h ================================================ /* Macros to swap the order of bytes in integer values. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H # error "Never use directly; include instead." #endif #ifndef _BITS_BYTESWAP_H #define _BITS_BYTESWAP_H 1 #include #include #include /* Swap bytes in 16 bit value. */ #define __bswap_constant_16(x) \ ((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) /* Get __bswap_16. */ #include /* Swap bytes in 32 bit value. */ #define __bswap_constant_32(x) \ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) #ifdef __GNUC__ # if __GNUC_PREREQ (4, 3) static __inline unsigned int __bswap_32(unsigned int __bsx) { return __builtin_bswap32(__bsx); } # elif __GNUC__ >= 2 # if __WORDSIZE == 64 || (defined __i486__ || defined __pentium__ \ || defined __pentiumpro__ || defined __pentium4__ \ || defined __k8__ || defined __athlon__ \ || defined __k6__ || defined __nocona__ \ || defined __core2__ || defined __geode__ \ || defined __amdfam10__) /* To swap the bytes in a word the i486 processors and up provide the `bswap' opcode. On i386 we have to use three instructions. */ # define __bswap_32(x) \ (__extension__ \ ({ unsigned int __v, __x = (x); \ if (__builtin_constant_p (__x)) \ __v = __bswap_constant_32 (__x); \ else \ __asm__ ("bswap %0" : "=r" (__v) : "0" (__x)); \ __v; })) # else # define __bswap_32(x) \ (__extension__ \ ({ unsigned int __v, __x = (x); \ if (__builtin_constant_p (__x)) \ __v = __bswap_constant_32 (__x); \ else \ __asm__ ("rorw $8, %w0;" \ "rorl $16, %0;" \ "rorw $8, %w0" \ : "=r" (__v) \ : "0" (__x) \ : "cc"); \ __v; })) # endif # else # define __bswap_32(x) \ (__extension__ \ ({ unsigned int __x = (x); __bswap_constant_32 (__x); })) # endif #else static __inline unsigned int __bswap_32(unsigned int __bsx) { return __bswap_constant_32(__bsx); } #endif #if __GNUC_PREREQ (2, 0) /* Swap bytes in 64 bit value. */ # define __bswap_constant_64(x) \ (__extension__ ((((x) & 0xff00000000000000ull) >> 56) \ | (((x) & 0x00ff000000000000ull) >> 40) \ | (((x) & 0x0000ff0000000000ull) >> 24) \ | (((x) & 0x000000ff00000000ull) >> 8) \ | (((x) & 0x00000000ff000000ull) << 8) \ | (((x) & 0x0000000000ff0000ull) << 24) \ | (((x) & 0x000000000000ff00ull) << 40) \ | (((x) & 0x00000000000000ffull) << 56))) # if __GNUC_PREREQ (4, 3) static __inline __uint64_t __bswap_64(__uint64_t __bsx) { return __builtin_bswap64(__bsx); } # elif __WORDSIZE == 64 # define __bswap_64(x) \ (__extension__ \ ({ __uint64_t __v, __x = (x); \ if (__builtin_constant_p (__x)) \ __v = __bswap_constant_64 (__x); \ else \ __asm__ ("bswap %q0" : "=r" (__v) : "0" (__x)); \ __v; })) # else # define __bswap_64(x) \ (__extension__ \ ({ union { __extension__ __uint64_t __ll; \ unsigned int __l[2]; } __w, __r; \ if (__builtin_constant_p (x)) \ __r.__ll = __bswap_constant_64 (x); \ else \ { \ __w.__ll = (x); \ __r.__l[0] = __bswap_32 (__w.__l[1]); \ __r.__l[1] = __bswap_32 (__w.__l[0]); \ } \ __r.__ll; })) # endif #else # define __bswap_constant_64(x) \ ((((x) & 0xff00000000000000ull) >> 56) \ | (((x) & 0x00ff000000000000ull) >> 40) \ | (((x) & 0x0000ff0000000000ull) >> 24) \ | (((x) & 0x000000ff00000000ull) >> 8) \ | (((x) & 0x00000000ff000000ull) << 8) \ | (((x) & 0x0000000000ff0000ull) << 24) \ | (((x) & 0x000000000000ff00ull) << 40) \ | (((x) & 0x00000000000000ffull) << 56)) static __inline __uint64_t __bswap_64(__uint64_t __bsx) { return __bswap_constant_64(__bsx); } #endif #endif /* _BITS_BYTESWAP_H */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/confname.h ================================================ /* `sysconf', `pathconf', and `confstr' NAME values. Generic version. Copyright (C) 1993-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _UNISTD_H # error "Never use directly; include instead." #endif /* Values for the NAME argument to `pathconf' and `fpathconf'. */ enum { _PC_LINK_MAX, #define _PC_LINK_MAX _PC_LINK_MAX _PC_MAX_CANON, #define _PC_MAX_CANON _PC_MAX_CANON _PC_MAX_INPUT, #define _PC_MAX_INPUT _PC_MAX_INPUT _PC_NAME_MAX, #define _PC_NAME_MAX _PC_NAME_MAX _PC_PATH_MAX, #define _PC_PATH_MAX _PC_PATH_MAX _PC_PIPE_BUF, #define _PC_PIPE_BUF _PC_PIPE_BUF _PC_CHOWN_RESTRICTED, #define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED _PC_NO_TRUNC, #define _PC_NO_TRUNC _PC_NO_TRUNC _PC_VDISABLE, #define _PC_VDISABLE _PC_VDISABLE _PC_SYNC_IO, #define _PC_SYNC_IO _PC_SYNC_IO _PC_ASYNC_IO, #define _PC_ASYNC_IO _PC_ASYNC_IO _PC_PRIO_IO, #define _PC_PRIO_IO _PC_PRIO_IO _PC_SOCK_MAXBUF, #define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF _PC_FILESIZEBITS, #define _PC_FILESIZEBITS _PC_FILESIZEBITS _PC_REC_INCR_XFER_SIZE, #define _PC_REC_INCR_XFER_SIZE _PC_REC_INCR_XFER_SIZE _PC_REC_MAX_XFER_SIZE, #define _PC_REC_MAX_XFER_SIZE _PC_REC_MAX_XFER_SIZE _PC_REC_MIN_XFER_SIZE, #define _PC_REC_MIN_XFER_SIZE _PC_REC_MIN_XFER_SIZE _PC_REC_XFER_ALIGN, #define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN _PC_ALLOC_SIZE_MIN, #define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN _PC_SYMLINK_MAX, #define _PC_SYMLINK_MAX _PC_SYMLINK_MAX _PC_2_SYMLINKS #define _PC_2_SYMLINKS _PC_2_SYMLINKS }; /* Values for the argument to `sysconf'. */ enum { _SC_ARG_MAX, #define _SC_ARG_MAX _SC_ARG_MAX _SC_CHILD_MAX, #define _SC_CHILD_MAX _SC_CHILD_MAX _SC_CLK_TCK, #define _SC_CLK_TCK _SC_CLK_TCK _SC_NGROUPS_MAX, #define _SC_NGROUPS_MAX _SC_NGROUPS_MAX _SC_OPEN_MAX, #define _SC_OPEN_MAX _SC_OPEN_MAX _SC_STREAM_MAX, #define _SC_STREAM_MAX _SC_STREAM_MAX _SC_TZNAME_MAX, #define _SC_TZNAME_MAX _SC_TZNAME_MAX _SC_JOB_CONTROL, #define _SC_JOB_CONTROL _SC_JOB_CONTROL _SC_SAVED_IDS, #define _SC_SAVED_IDS _SC_SAVED_IDS _SC_REALTIME_SIGNALS, #define _SC_REALTIME_SIGNALS _SC_REALTIME_SIGNALS _SC_PRIORITY_SCHEDULING, #define _SC_PRIORITY_SCHEDULING _SC_PRIORITY_SCHEDULING _SC_TIMERS, #define _SC_TIMERS _SC_TIMERS _SC_ASYNCHRONOUS_IO, #define _SC_ASYNCHRONOUS_IO _SC_ASYNCHRONOUS_IO _SC_PRIORITIZED_IO, #define _SC_PRIORITIZED_IO _SC_PRIORITIZED_IO _SC_SYNCHRONIZED_IO, #define _SC_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO _SC_FSYNC, #define _SC_FSYNC _SC_FSYNC _SC_MAPPED_FILES, #define _SC_MAPPED_FILES _SC_MAPPED_FILES _SC_MEMLOCK, #define _SC_MEMLOCK _SC_MEMLOCK _SC_MEMLOCK_RANGE, #define _SC_MEMLOCK_RANGE _SC_MEMLOCK_RANGE _SC_MEMORY_PROTECTION, #define _SC_MEMORY_PROTECTION _SC_MEMORY_PROTECTION _SC_MESSAGE_PASSING, #define _SC_MESSAGE_PASSING _SC_MESSAGE_PASSING _SC_SEMAPHORES, #define _SC_SEMAPHORES _SC_SEMAPHORES _SC_SHARED_MEMORY_OBJECTS, #define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS _SC_AIO_LISTIO_MAX, #define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX _SC_AIO_MAX, #define _SC_AIO_MAX _SC_AIO_MAX _SC_AIO_PRIO_DELTA_MAX, #define _SC_AIO_PRIO_DELTA_MAX _SC_AIO_PRIO_DELTA_MAX _SC_DELAYTIMER_MAX, #define _SC_DELAYTIMER_MAX _SC_DELAYTIMER_MAX _SC_MQ_OPEN_MAX, #define _SC_MQ_OPEN_MAX _SC_MQ_OPEN_MAX _SC_MQ_PRIO_MAX, #define _SC_MQ_PRIO_MAX _SC_MQ_PRIO_MAX _SC_VERSION, #define _SC_VERSION _SC_VERSION _SC_PAGESIZE, #define _SC_PAGESIZE _SC_PAGESIZE #define _SC_PAGE_SIZE _SC_PAGESIZE _SC_RTSIG_MAX, #define _SC_RTSIG_MAX _SC_RTSIG_MAX _SC_SEM_NSEMS_MAX, #define _SC_SEM_NSEMS_MAX _SC_SEM_NSEMS_MAX _SC_SEM_VALUE_MAX, #define _SC_SEM_VALUE_MAX _SC_SEM_VALUE_MAX _SC_SIGQUEUE_MAX, #define _SC_SIGQUEUE_MAX _SC_SIGQUEUE_MAX _SC_TIMER_MAX, #define _SC_TIMER_MAX _SC_TIMER_MAX /* Values for the argument to `sysconf' corresponding to _POSIX2_* symbols. */ _SC_BC_BASE_MAX, #define _SC_BC_BASE_MAX _SC_BC_BASE_MAX _SC_BC_DIM_MAX, #define _SC_BC_DIM_MAX _SC_BC_DIM_MAX _SC_BC_SCALE_MAX, #define _SC_BC_SCALE_MAX _SC_BC_SCALE_MAX _SC_BC_STRING_MAX, #define _SC_BC_STRING_MAX _SC_BC_STRING_MAX _SC_COLL_WEIGHTS_MAX, #define _SC_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX _SC_EQUIV_CLASS_MAX, #define _SC_EQUIV_CLASS_MAX _SC_EQUIV_CLASS_MAX _SC_EXPR_NEST_MAX, #define _SC_EXPR_NEST_MAX _SC_EXPR_NEST_MAX _SC_LINE_MAX, #define _SC_LINE_MAX _SC_LINE_MAX _SC_RE_DUP_MAX, #define _SC_RE_DUP_MAX _SC_RE_DUP_MAX _SC_CHARCLASS_NAME_MAX, #define _SC_CHARCLASS_NAME_MAX _SC_CHARCLASS_NAME_MAX _SC_2_VERSION, #define _SC_2_VERSION _SC_2_VERSION _SC_2_C_BIND, #define _SC_2_C_BIND _SC_2_C_BIND _SC_2_C_DEV, #define _SC_2_C_DEV _SC_2_C_DEV _SC_2_FORT_DEV, #define _SC_2_FORT_DEV _SC_2_FORT_DEV _SC_2_FORT_RUN, #define _SC_2_FORT_RUN _SC_2_FORT_RUN _SC_2_SW_DEV, #define _SC_2_SW_DEV _SC_2_SW_DEV _SC_2_LOCALEDEF, #define _SC_2_LOCALEDEF _SC_2_LOCALEDEF _SC_PII, #define _SC_PII _SC_PII _SC_PII_XTI, #define _SC_PII_XTI _SC_PII_XTI _SC_PII_SOCKET, #define _SC_PII_SOCKET _SC_PII_SOCKET _SC_PII_INTERNET, #define _SC_PII_INTERNET _SC_PII_INTERNET _SC_PII_OSI, #define _SC_PII_OSI _SC_PII_OSI _SC_POLL, #define _SC_POLL _SC_POLL _SC_SELECT, #define _SC_SELECT _SC_SELECT _SC_UIO_MAXIOV, #define _SC_UIO_MAXIOV _SC_UIO_MAXIOV _SC_IOV_MAX = _SC_UIO_MAXIOV, #define _SC_IOV_MAX _SC_IOV_MAX _SC_PII_INTERNET_STREAM, #define _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_DGRAM, #define _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_DGRAM _SC_PII_OSI_COTS, #define _SC_PII_OSI_COTS _SC_PII_OSI_COTS _SC_PII_OSI_CLTS, #define _SC_PII_OSI_CLTS _SC_PII_OSI_CLTS _SC_PII_OSI_M, #define _SC_PII_OSI_M _SC_PII_OSI_M _SC_T_IOV_MAX, #define _SC_T_IOV_MAX _SC_T_IOV_MAX /* Values according to POSIX 1003.1c (POSIX threads). */ _SC_THREADS, #define _SC_THREADS _SC_THREADS _SC_THREAD_SAFE_FUNCTIONS, #define _SC_THREAD_SAFE_FUNCTIONS _SC_THREAD_SAFE_FUNCTIONS _SC_GETGR_R_SIZE_MAX, #define _SC_GETGR_R_SIZE_MAX _SC_GETGR_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX, #define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX _SC_LOGIN_NAME_MAX, #define _SC_LOGIN_NAME_MAX _SC_LOGIN_NAME_MAX _SC_TTY_NAME_MAX, #define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX _SC_THREAD_DESTRUCTOR_ITERATIONS, #define _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_KEYS_MAX, #define _SC_THREAD_KEYS_MAX _SC_THREAD_KEYS_MAX _SC_THREAD_STACK_MIN, #define _SC_THREAD_STACK_MIN _SC_THREAD_STACK_MIN _SC_THREAD_THREADS_MAX, #define _SC_THREAD_THREADS_MAX _SC_THREAD_THREADS_MAX _SC_THREAD_ATTR_STACKADDR, #define _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKSIZE, #define _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_PRIORITY_SCHEDULING, #define _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIO_INHERIT, #define _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_PROTECT, #define _SC_THREAD_PRIO_PROTECT _SC_THREAD_PRIO_PROTECT _SC_THREAD_PROCESS_SHARED, #define _SC_THREAD_PROCESS_SHARED _SC_THREAD_PROCESS_SHARED _SC_NPROCESSORS_CONF, #define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF _SC_NPROCESSORS_ONLN, #define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN _SC_PHYS_PAGES, #define _SC_PHYS_PAGES _SC_PHYS_PAGES _SC_AVPHYS_PAGES, #define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES _SC_ATEXIT_MAX, #define _SC_ATEXIT_MAX _SC_ATEXIT_MAX _SC_PASS_MAX, #define _SC_PASS_MAX _SC_PASS_MAX _SC_XOPEN_VERSION, #define _SC_XOPEN_VERSION _SC_XOPEN_VERSION _SC_XOPEN_XCU_VERSION, #define _SC_XOPEN_XCU_VERSION _SC_XOPEN_XCU_VERSION _SC_XOPEN_UNIX, #define _SC_XOPEN_UNIX _SC_XOPEN_UNIX _SC_XOPEN_CRYPT, #define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT _SC_XOPEN_ENH_I18N, #define _SC_XOPEN_ENH_I18N _SC_XOPEN_ENH_I18N _SC_XOPEN_SHM, #define _SC_XOPEN_SHM _SC_XOPEN_SHM _SC_2_CHAR_TERM, #define _SC_2_CHAR_TERM _SC_2_CHAR_TERM _SC_2_C_VERSION, #define _SC_2_C_VERSION _SC_2_C_VERSION _SC_2_UPE, #define _SC_2_UPE _SC_2_UPE _SC_XOPEN_XPG2, #define _SC_XOPEN_XPG2 _SC_XOPEN_XPG2 _SC_XOPEN_XPG3, #define _SC_XOPEN_XPG3 _SC_XOPEN_XPG3 _SC_XOPEN_XPG4, #define _SC_XOPEN_XPG4 _SC_XOPEN_XPG4 _SC_CHAR_BIT, #define _SC_CHAR_BIT _SC_CHAR_BIT _SC_CHAR_MAX, #define _SC_CHAR_MAX _SC_CHAR_MAX _SC_CHAR_MIN, #define _SC_CHAR_MIN _SC_CHAR_MIN _SC_INT_MAX, #define _SC_INT_MAX _SC_INT_MAX _SC_INT_MIN, #define _SC_INT_MIN _SC_INT_MIN _SC_LONG_BIT, #define _SC_LONG_BIT _SC_LONG_BIT _SC_WORD_BIT, #define _SC_WORD_BIT _SC_WORD_BIT _SC_MB_LEN_MAX, #define _SC_MB_LEN_MAX _SC_MB_LEN_MAX _SC_NZERO, #define _SC_NZERO _SC_NZERO _SC_SSIZE_MAX, #define _SC_SSIZE_MAX _SC_SSIZE_MAX _SC_SCHAR_MAX, #define _SC_SCHAR_MAX _SC_SCHAR_MAX _SC_SCHAR_MIN, #define _SC_SCHAR_MIN _SC_SCHAR_MIN _SC_SHRT_MAX, #define _SC_SHRT_MAX _SC_SHRT_MAX _SC_SHRT_MIN, #define _SC_SHRT_MIN _SC_SHRT_MIN _SC_UCHAR_MAX, #define _SC_UCHAR_MAX _SC_UCHAR_MAX _SC_UINT_MAX, #define _SC_UINT_MAX _SC_UINT_MAX _SC_ULONG_MAX, #define _SC_ULONG_MAX _SC_ULONG_MAX _SC_USHRT_MAX, #define _SC_USHRT_MAX _SC_USHRT_MAX _SC_NL_ARGMAX, #define _SC_NL_ARGMAX _SC_NL_ARGMAX _SC_NL_LANGMAX, #define _SC_NL_LANGMAX _SC_NL_LANGMAX _SC_NL_MSGMAX, #define _SC_NL_MSGMAX _SC_NL_MSGMAX _SC_NL_NMAX, #define _SC_NL_NMAX _SC_NL_NMAX _SC_NL_SETMAX, #define _SC_NL_SETMAX _SC_NL_SETMAX _SC_NL_TEXTMAX, #define _SC_NL_TEXTMAX _SC_NL_TEXTMAX _SC_XBS5_ILP32_OFF32, #define _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFFBIG, #define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG _SC_XBS5_LP64_OFF64, #define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64 _SC_XBS5_LPBIG_OFFBIG, #define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG _SC_XOPEN_LEGACY, #define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY _SC_XOPEN_REALTIME, #define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME_THREADS, #define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS _SC_ADVISORY_INFO, #define _SC_ADVISORY_INFO _SC_ADVISORY_INFO _SC_BARRIERS, #define _SC_BARRIERS _SC_BARRIERS _SC_BASE, #define _SC_BASE _SC_BASE _SC_C_LANG_SUPPORT, #define _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT_R, #define _SC_C_LANG_SUPPORT_R _SC_C_LANG_SUPPORT_R _SC_CLOCK_SELECTION, #define _SC_CLOCK_SELECTION _SC_CLOCK_SELECTION _SC_CPUTIME, #define _SC_CPUTIME _SC_CPUTIME _SC_THREAD_CPUTIME, #define _SC_THREAD_CPUTIME _SC_THREAD_CPUTIME _SC_DEVICE_IO, #define _SC_DEVICE_IO _SC_DEVICE_IO _SC_DEVICE_SPECIFIC, #define _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC_R, #define _SC_DEVICE_SPECIFIC_R _SC_DEVICE_SPECIFIC_R _SC_FD_MGMT, #define _SC_FD_MGMT _SC_FD_MGMT _SC_FIFO, #define _SC_FIFO _SC_FIFO _SC_PIPE, #define _SC_PIPE _SC_PIPE _SC_FILE_ATTRIBUTES, #define _SC_FILE_ATTRIBUTES _SC_FILE_ATTRIBUTES _SC_FILE_LOCKING, #define _SC_FILE_LOCKING _SC_FILE_LOCKING _SC_FILE_SYSTEM, #define _SC_FILE_SYSTEM _SC_FILE_SYSTEM _SC_MONOTONIC_CLOCK, #define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK _SC_MULTI_PROCESS, #define _SC_MULTI_PROCESS _SC_MULTI_PROCESS _SC_SINGLE_PROCESS, #define _SC_SINGLE_PROCESS _SC_SINGLE_PROCESS _SC_NETWORKING, #define _SC_NETWORKING _SC_NETWORKING _SC_READER_WRITER_LOCKS, #define _SC_READER_WRITER_LOCKS _SC_READER_WRITER_LOCKS _SC_SPIN_LOCKS, #define _SC_SPIN_LOCKS _SC_SPIN_LOCKS _SC_REGEXP, #define _SC_REGEXP _SC_REGEXP _SC_REGEX_VERSION, #define _SC_REGEX_VERSION _SC_REGEX_VERSION _SC_SHELL, #define _SC_SHELL _SC_SHELL _SC_SIGNALS, #define _SC_SIGNALS _SC_SIGNALS _SC_SPAWN, #define _SC_SPAWN _SC_SPAWN _SC_SPORADIC_SERVER, #define _SC_SPORADIC_SERVER _SC_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER, #define _SC_THREAD_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER _SC_SYSTEM_DATABASE, #define _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE_R, #define _SC_SYSTEM_DATABASE_R _SC_SYSTEM_DATABASE_R _SC_TIMEOUTS, #define _SC_TIMEOUTS _SC_TIMEOUTS _SC_TYPED_MEMORY_OBJECTS, #define _SC_TYPED_MEMORY_OBJECTS _SC_TYPED_MEMORY_OBJECTS _SC_USER_GROUPS, #define _SC_USER_GROUPS _SC_USER_GROUPS _SC_USER_GROUPS_R, #define _SC_USER_GROUPS_R _SC_USER_GROUPS_R _SC_2_PBS, #define _SC_2_PBS _SC_2_PBS _SC_2_PBS_ACCOUNTING, #define _SC_2_PBS_ACCOUNTING _SC_2_PBS_ACCOUNTING _SC_2_PBS_LOCATE, #define _SC_2_PBS_LOCATE _SC_2_PBS_LOCATE _SC_2_PBS_MESSAGE, #define _SC_2_PBS_MESSAGE _SC_2_PBS_MESSAGE _SC_2_PBS_TRACK, #define _SC_2_PBS_TRACK _SC_2_PBS_TRACK _SC_SYMLOOP_MAX, #define _SC_SYMLOOP_MAX _SC_SYMLOOP_MAX _SC_STREAMS, #define _SC_STREAMS _SC_STREAMS _SC_2_PBS_CHECKPOINT, #define _SC_2_PBS_CHECKPOINT _SC_2_PBS_CHECKPOINT _SC_V6_ILP32_OFF32, #define _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFFBIG, #define _SC_V6_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG _SC_V6_LP64_OFF64, #define _SC_V6_LP64_OFF64 _SC_V6_LP64_OFF64 _SC_V6_LPBIG_OFFBIG, #define _SC_V6_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG _SC_HOST_NAME_MAX, #define _SC_HOST_NAME_MAX _SC_HOST_NAME_MAX _SC_TRACE, #define _SC_TRACE _SC_TRACE _SC_TRACE_EVENT_FILTER, #define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER _SC_TRACE_INHERIT, #define _SC_TRACE_INHERIT _SC_TRACE_INHERIT _SC_TRACE_LOG, #define _SC_TRACE_LOG _SC_TRACE_LOG _SC_LEVEL1_ICACHE_SIZE, #define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_ASSOC, #define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_LINESIZE, #define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_DCACHE_SIZE, #define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_ASSOC, #define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_LINESIZE, #define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL2_CACHE_SIZE, #define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_ASSOC, #define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_LINESIZE, #define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL3_CACHE_SIZE, #define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_ASSOC, #define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_LINESIZE, #define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL4_CACHE_SIZE, #define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_ASSOC, #define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_LINESIZE, #define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE /* Leave room here, maybe we need a few more cache levels some day. */ _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, #define _SC_IPV6 _SC_IPV6 _SC_RAW_SOCKETS, #define _SC_RAW_SOCKETS _SC_RAW_SOCKETS _SC_V7_ILP32_OFF32, #define _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFFBIG, #define _SC_V7_ILP32_OFFBIG _SC_V7_ILP32_OFFBIG _SC_V7_LP64_OFF64, #define _SC_V7_LP64_OFF64 _SC_V7_LP64_OFF64 _SC_V7_LPBIG_OFFBIG, #define _SC_V7_LPBIG_OFFBIG _SC_V7_LPBIG_OFFBIG _SC_SS_REPL_MAX, #define _SC_SS_REPL_MAX _SC_SS_REPL_MAX _SC_TRACE_EVENT_NAME_MAX, #define _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_NAME_MAX, #define _SC_TRACE_NAME_MAX _SC_TRACE_NAME_MAX _SC_TRACE_SYS_MAX, #define _SC_TRACE_SYS_MAX _SC_TRACE_SYS_MAX _SC_TRACE_USER_EVENT_MAX, #define _SC_TRACE_USER_EVENT_MAX _SC_TRACE_USER_EVENT_MAX _SC_XOPEN_STREAMS, #define _SC_XOPEN_STREAMS _SC_XOPEN_STREAMS _SC_THREAD_ROBUST_PRIO_INHERIT, #define _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_PROTECT #define _SC_THREAD_ROBUST_PRIO_PROTECT _SC_THREAD_ROBUST_PRIO_PROTECT }; /* Values for the NAME argument to `confstr'. */ enum { _CS_PATH, /* The default search path. */ #define _CS_PATH _CS_PATH _CS_V6_WIDTH_RESTRICTED_ENVS, #define _CS_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS _CS_GNU_LIBC_VERSION, #define _CS_GNU_LIBC_VERSION _CS_GNU_LIBC_VERSION _CS_GNU_LIBPTHREAD_VERSION, #define _CS_GNU_LIBPTHREAD_VERSION _CS_GNU_LIBPTHREAD_VERSION _CS_V5_WIDTH_RESTRICTED_ENVS, #define _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS, #define _CS_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS _CS_LFS_CFLAGS = 1000, #define _CS_LFS_CFLAGS _CS_LFS_CFLAGS _CS_LFS_LDFLAGS, #define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS _CS_LFS_LIBS, #define _CS_LFS_LIBS _CS_LFS_LIBS _CS_LFS_LINTFLAGS, #define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS _CS_LFS64_CFLAGS, #define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS _CS_LFS64_LDFLAGS, #define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS _CS_LFS64_LIBS, #define _CS_LFS64_LIBS _CS_LFS64_LIBS _CS_LFS64_LINTFLAGS, #define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, #define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS, #define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LIBS, #define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LINTFLAGS, #define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS, #define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS, #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LIBS, #define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_LP64_OFF64_CFLAGS, #define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS, #define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LIBS, #define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LINTFLAGS, #define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LIBS, #define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LIBS, #define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LIBS, #define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS, #define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS, #define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LIBS, #define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, #define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LIBS, #define _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LIBS, #define _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS, #define _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS, #define _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LIBS, #define _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS, #define _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_V6_ENV, #define _CS_V6_ENV _CS_V6_ENV _CS_V7_ENV #define _CS_V7_ENV _CS_V7_ENV }; ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/cpu-set.h ================================================ /* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993 scheduling interface. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_CPU_SET_H #define _BITS_CPU_SET_H 1 #ifndef _SCHED_H # error "Never include directly; use instead." #endif /* Size definition for CPU sets. */ #define __CPU_SETSIZE 1024 #define __NCPUBITS (8 * sizeof (__cpu_mask)) /* Type for array elements in 'cpu_set_t'. */ typedef __CPU_MASK_TYPE __cpu_mask; /* Basic access functions. */ #define __CPUELT(cpu) ((cpu) / __NCPUBITS) #define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) /* Data structure to describe CPU mask. */ typedef struct { __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS]; } cpu_set_t; /* Access functions for CPU masks. */ #if __GNUC_PREREQ (2, 91) # define __CPU_ZERO_S(setsize, cpusetp) \ do __builtin_memset (cpusetp, '\0', setsize); while (0) #else # define __CPU_ZERO_S(setsize, cpusetp) \ do { \ size_t __i; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ __cpu_mask *__bits = (cpusetp)->__bits; \ for (__i = 0; __i < __imax; ++__i) \ __bits[__i] = 0; \ } while (0) #endif #define __CPU_SET_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ |= __CPUMASK (__cpu)) \ : 0; })) #define __CPU_CLR_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ &= ~__CPUMASK (__cpu)) \ : 0; })) #define __CPU_ISSET_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? ((((const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ & __CPUMASK (__cpu))) != 0 \ : 0; })) #define __CPU_COUNT_S(setsize, cpusetp) \ __sched_cpucount (setsize, cpusetp) #if __GNUC_PREREQ (2, 91) # define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ (__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0) #else # define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ (__extension__ \ ({ const __cpu_mask *__arr1 = (cpusetp1)->__bits; \ const __cpu_mask *__arr2 = (cpusetp2)->__bits; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ size_t __i; \ for (__i = 0; __i < __imax; ++__i) \ if (__arr1[__i] != __arr2[__i]) \ break; \ __i == __imax; })) #endif #define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \ (__extension__ \ ({ cpu_set_t *__dest = (destset); \ const __cpu_mask *__arr1 = (srcset1)->__bits; \ const __cpu_mask *__arr2 = (srcset2)->__bits; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ size_t __i; \ for (__i = 0; __i < __imax; ++__i) \ ((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i]; \ __dest; })) #define __CPU_ALLOC_SIZE(count) \ ((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask)) #define __CPU_ALLOC(count) __sched_cpualloc (count) #define __CPU_FREE(cpuset) __sched_cpufree (cpuset) __BEGIN_DECLS extern int __sched_cpucount(size_t __setsize, const cpu_set_t * __setp) __THROW; extern cpu_set_t *__sched_cpualloc(size_t __count) __THROW __wur; extern void __sched_cpufree(cpu_set_t * __set) __THROW; __END_DECLS #endif /* bits/cpu-set.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/dirent.h ================================================ /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _DIRENT_H # error "Never use directly; include instead." #endif struct dirent { #ifndef __USE_FILE_OFFSET64 __ino_t d_ino; __off_t d_off; #else __ino64_t d_ino; __off64_t d_off; #endif unsigned short int d_reclen; unsigned char d_type; char d_name[256]; /* We must not include limits.h! */ }; #ifdef __USE_LARGEFILE64 struct dirent64 { __ino64_t d_ino; __off64_t d_off; unsigned short int d_reclen; unsigned char d_type; char d_name[256]; /* We must not include limits.h! */ }; #endif #define d_fileno d_ino /* Backwards compatibility. */ #undef _DIRENT_HAVE_D_NAMLEN #define _DIRENT_HAVE_D_RECLEN #define _DIRENT_HAVE_D_OFF #define _DIRENT_HAVE_D_TYPE #if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T /* Inform libc code that these two types are effectively identical. */ # define _DIRENT_MATCHES_DIRENT64 1 #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/dlfcn.h ================================================ /* System dependent definitions for run-time dynamic loading. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _DLFCN_H # error "Never use directly; include instead." #endif /* The MODE argument to `dlopen' contains one of the following: */ #define RTLD_LAZY 0x00001 /* Lazy function call binding. */ #define RTLD_NOW 0x00002 /* Immediate function call binding. */ #define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */ #define RTLD_NOLOAD 0x00004 /* Do not load the object. */ #define RTLD_DEEPBIND 0x00008 /* Use deep binding. */ /* If the following bit is set in the MODE argument to `dlopen', the symbols of the loaded object and its dependencies are made visible as if the object were linked directly into the program. */ #define RTLD_GLOBAL 0x00100 /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. The implementation does this by default and so we can define the value to zero. */ #define RTLD_LOCAL 0 /* Do not delete object when closed. */ #define RTLD_NODELETE 0x01000 #ifdef __USE_GNU /* To support profiling of shared objects it is a good idea to call the function found using `dlsym' using the following macro since these calls do not use the PLT. But this would mean the dynamic loader has no chance to find out when the function is called. The macro applies the necessary magic so that profiling is possible. Rewrite foo = (*fctp) (arg1, arg2); into foo = DL_CALL_FCT (fctp, (arg1, arg2)); */ # define DL_CALL_FCT(fctp, args) \ (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) __BEGIN_DECLS /* This function calls the profiling functions. */ extern void _dl_mcount_wrapper_check(void *__selfpc) __THROW; __END_DECLS #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/endian.h ================================================ /* i386/x86_64 are little-endian. */ #ifndef _ENDIAN_H # error "Never use directly; include instead." #endif #define __BYTE_ORDER __LITTLE_ENDIAN ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/environments.h ================================================ /* Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _UNISTD_H # error "Never include this file directly. Use instead" #endif #include /* This header should define the following symbols under the described situations. A value `1' means that the model is always supported, `-1' means it is never supported. Undefined means it cannot be statically decided. _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard and are available only for compatibility. */ #if __WORDSIZE == 64 /* Environments with 32-bit wide pointers are optionally provided. Therefore following macros aren't defined: # undef _POSIX_V7_ILP32_OFF32 # undef _POSIX_V7_ILP32_OFFBIG # undef _POSIX_V6_ILP32_OFF32 # undef _POSIX_V6_ILP32_OFFBIG # undef _XBS5_ILP32_OFF32 # undef _XBS5_ILP32_OFFBIG and users need to check at runtime. */ /* We also have no use (for now) for an environment with bigger pointers and offsets. */ # define _POSIX_V7_LPBIG_OFFBIG -1 # define _POSIX_V6_LPBIG_OFFBIG -1 # define _XBS5_LPBIG_OFFBIG -1 /* By default we have 64-bit wide `long int', pointers and `off_t'. */ # define _POSIX_V7_LP64_OFF64 1 # define _POSIX_V6_LP64_OFF64 1 # define _XBS5_LP64_OFF64 1 #else /* __WORDSIZE == 32 */ /* We have 32-bit wide `int', `long int' and pointers and all platforms support LFS. -mx32 has 64-bit wide `off_t'. */ # define _POSIX_V7_ILP32_OFFBIG 1 # define _POSIX_V6_ILP32_OFFBIG 1 # define _XBS5_ILP32_OFFBIG 1 # ifndef __x86_64__ /* -m32 has 32-bit wide `off_t'. */ # define _POSIX_V7_ILP32_OFF32 1 # define _POSIX_V6_ILP32_OFF32 1 # define _XBS5_ILP32_OFF32 1 # endif /* We optionally provide an environment with the above size but an 64-bit side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ /* Environments with 64-bit wide pointers can be provided, so these macros aren't defined: # undef _POSIX_V7_LP64_OFF64 # undef _POSIX_V7_LPBIG_OFFBIG # undef _POSIX_V6_LP64_OFF64 # undef _POSIX_V6_LPBIG_OFFBIG # undef _XBS5_LP64_OFF64 # undef _XBS5_LPBIG_OFFBIG and sysconf tests for it at runtime. */ #endif /* __WORDSIZE == 32 */ #define __ILP32_OFF32_CFLAGS "-m32" #define __ILP32_OFF32_LDFLAGS "-m32" #if defined __x86_64__ && defined __ILP32__ # define __ILP32_OFFBIG_CFLAGS "-mx32" # define __ILP32_OFFBIG_LDFLAGS "-mx32" #else # define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" # define __ILP32_OFFBIG_LDFLAGS "-m32" #endif #define __LP64_OFF64_CFLAGS "-m64" #define __LP64_OFF64_LDFLAGS "-m64" ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/errno.h ================================================ /* Error constants. Linux specific version. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_ERRNO_H #define _BITS_ERRNO_H 1 #if !defined _ERRNO_H # error "Never include directly; use instead." #endif # include /* Older Linux headers do not define these constants. */ # ifndef ENOTSUP # define ENOTSUP EOPNOTSUPP # endif # ifndef ECANCELED # define ECANCELED 125 # endif # ifndef EOWNERDEAD # define EOWNERDEAD 130 # endif #ifndef ENOTRECOVERABLE # define ENOTRECOVERABLE 131 # endif # ifndef ERFKILL # define ERFKILL 132 # endif # ifndef EHWPOISON # define EHWPOISON 133 # endif #endif /* bits/errno.h. */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/fcntl-linux.h ================================================ /* O_*, F_*, FD_* bit values for Linux. Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _FCNTL_H # error "Never use directly; include instead." #endif /* This file contains shared definitions between Linux architectures and is included by to declare them. The various #ifndef cases allow the architecture specific file to define those values with different values. A minimal contains just: struct flock {...} #ifdef __USE_LARGEFILE64 struct flock64 {...} #endif #include */ #ifdef __USE_GNU # include #endif /* open/fcntl. */ #define O_ACCMODE 0003 #define O_RDONLY 00 #define O_WRONLY 01 #define O_RDWR 02 #ifndef O_CREAT # define O_CREAT 0100 /* Not fcntl. */ #endif #ifndef O_EXCL # define O_EXCL 0200 /* Not fcntl. */ #endif #ifndef O_NOCTTY # define O_NOCTTY 0400 /* Not fcntl. */ #endif #ifndef O_TRUNC # define O_TRUNC 01000 /* Not fcntl. */ #endif #ifndef O_APPEND # define O_APPEND 02000 #endif #ifndef O_NONBLOCK # define O_NONBLOCK 04000 #endif #ifndef O_NDELAY # define O_NDELAY O_NONBLOCK #endif #ifndef O_SYNC # define O_SYNC 04010000 #endif #define O_FSYNC O_SYNC #ifndef O_ASYNC # define O_ASYNC 020000 #endif #ifndef __O_LARGEFILE # define __O_LARGEFILE 0100000 #endif #ifndef __O_DIRECTORY # define __O_DIRECTORY 0200000 #endif #ifndef __O_NOFOLLOW # define __O_NOFOLLOW 0400000 #endif #ifndef __O_CLOEXEC # define __O_CLOEXEC 02000000 #endif #ifndef __O_DIRECT # define __O_DIRECT 040000 #endif #ifndef __O_NOATIME # define __O_NOATIME 01000000 #endif #ifndef __O_PATH # define __O_PATH 010000000 #endif #ifndef __O_DSYNC # define __O_DSYNC 010000 #endif #ifndef __O_TMPFILE # define __O_TMPFILE (020000000 | __O_DIRECTORY) #endif #ifndef F_GETLK # ifndef __USE_FILE_OFFSET64 # define F_GETLK 5 /* Get record locking info. */ # define F_SETLK 6 /* Set record locking info (non-blocking). */ # define F_SETLKW 7 /* Set record locking info (blocking). */ # else # define F_GETLK F_GETLK64 /* Get record locking info. */ # define F_SETLK F_SETLK64 /* Set record locking info (non-blocking). */ # define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ # endif #endif #ifndef F_GETLK64 # define F_GETLK64 12 /* Get record locking info. */ # define F_SETLK64 13 /* Set record locking info (non-blocking). */ # define F_SETLKW64 14 /* Set record locking info (blocking). */ #endif /* open file description locks. Usually record locks held by a process are released on *any* close and are not inherited across a fork. These cmd values will set locks that conflict with process-associated record locks, but are "owned" by the opened file description, not the process. This means that they are inherited across fork or clone with CLONE_FILES like BSD (flock) locks, and they are only released automatically when the last reference to the the file description against which they were acquired is put. */ #ifdef __USE_GNU # define F_OFD_GETLK 36 # define F_OFD_SETLK 37 # define F_OFD_SETLKW 38 #endif #ifdef __USE_LARGEFILE64 # define O_LARGEFILE __O_LARGEFILE #endif #ifdef __USE_XOPEN2K8 # define O_DIRECTORY __O_DIRECTORY /* Must be a directory. */ # define O_NOFOLLOW __O_NOFOLLOW /* Do not follow links. */ # define O_CLOEXEC __O_CLOEXEC /* Set close_on_exec. */ #endif #ifdef __USE_GNU # define O_DIRECT __O_DIRECT /* Direct disk access. */ # define O_NOATIME __O_NOATIME /* Do not set atime. */ # define O_PATH __O_PATH /* Resolve pathname but do not open file. */ # define O_TMPFILE __O_TMPFILE /* Atomically create nameless file. */ #endif /* For now, Linux has no separate synchronicity options for read operations. We define O_RSYNC therefore as the same as O_SYNC since this is a superset. */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 # define O_DSYNC __O_DSYNC /* Synchronize data. */ # if defined __O_RSYNC # define O_RSYNC __O_RSYNC /* Synchronize read operations. */ # else # define O_RSYNC O_SYNC /* Synchronize read operations. */ # endif #endif /* Values for the second argument to `fcntl'. */ #define F_DUPFD 0 /* Duplicate file descriptor. */ #define F_GETFD 1 /* Get file descriptor flags. */ #define F_SETFD 2 /* Set file descriptor flags. */ #define F_GETFL 3 /* Get file status flags. */ #define F_SETFL 4 /* Set file status flags. */ #ifndef __F_SETOWN # define __F_SETOWN 8 # define __F_GETOWN 9 #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 # define F_SETOWN __F_SETOWN /* Get owner (process receiving SIGIO). */ # define F_GETOWN __F_GETOWN /* Set owner (process receiving SIGIO). */ #endif #ifndef __F_SETSIG # define __F_SETSIG 10 /* Set number of signal to be sent. */ # define __F_GETSIG 11 /* Get number of signal to be sent. */ #endif #ifndef __F_SETOWN_EX # define __F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ # define __F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU # define F_SETSIG __F_SETSIG /* Set number of signal to be sent. */ # define F_GETSIG __F_GETSIG /* Get number of signal to be sent. */ # define F_SETOWN_EX __F_SETOWN_EX /* Get owner (thread receiving SIGIO). */ # define F_GETOWN_EX __F_GETOWN_EX /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU # define F_SETLEASE 1024 /* Set a lease. */ # define F_GETLEASE 1025 /* Enquire what lease is active. */ # define F_NOTIFY 1026 /* Request notifications on a directory. */ # define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ # define F_GETPIPE_SZ 1032 /* Set pipe page size array. */ # define F_ADD_SEALS 1033 /* Add seals to file. */ # define F_GET_SEALS 1034 /* Get seals for file. */ /* Set / get write life time hints. */ # define F_GET_RW_HINT 1035 # define F_SET_RW_HINT 1036 # define F_GET_FILE_RW_HINT 1037 # define F_SET_FILE_RW_HINT 1038 #endif #ifdef __USE_XOPEN2K8 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with close-on-exit set. */ #endif /* For F_[GET|SET]FD. */ #define FD_CLOEXEC 1 /* Actually anything with low bit set goes */ #ifndef F_RDLCK /* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ # define F_RDLCK 0 /* Read lock. */ # define F_WRLCK 1 /* Write lock. */ # define F_UNLCK 2 /* Remove lock. */ #endif /* For old implementation of BSD flock. */ #ifndef F_EXLCK # define F_EXLCK 4 /* or 3 */ # define F_SHLCK 8 /* or 4 */ #endif #ifdef __USE_MISC /* Operations for BSD flock, also used by the kernel implementation. */ # define LOCK_SH 1 /* Shared lock. */ # define LOCK_EX 2 /* Exclusive lock. */ # define LOCK_NB 4 /* Or'd with one of the above to prevent blocking. */ # define LOCK_UN 8 /* Remove lock. */ #endif #ifdef __USE_GNU # define LOCK_MAND 32 /* This is a mandatory flock: */ # define LOCK_READ 64 /* ... which allows concurrent read operations. */ # define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ # define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ #endif #ifdef __USE_GNU /* Types of directory notifications that may be requested with F_NOTIFY. */ # define DN_ACCESS 0x00000001 /* File accessed. */ # define DN_MODIFY 0x00000002 /* File modified. */ # define DN_CREATE 0x00000004 /* File created. */ # define DN_DELETE 0x00000008 /* File removed. */ # define DN_RENAME 0x00000010 /* File renamed. */ # define DN_ATTRIB 0x00000020 /* File changed attributes. */ # define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ #endif #ifdef __USE_GNU /* Owner types. */ enum __pid_type { F_OWNER_TID = 0, /* Kernel thread. */ F_OWNER_PID, /* Process. */ F_OWNER_PGRP, /* Process group. */ F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ }; /* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ struct f_owner_ex { enum __pid_type type; /* Owner type of ID. */ __pid_t pid; /* ID of owner. */ }; #endif #ifdef __USE_GNU /* Types of seals. */ # define F_SEAL_SEAL 0x0001 /* Prevent further seals from being set. */ # define F_SEAL_SHRINK 0x0002 /* Prevent file from shrinking. */ # define F_SEAL_GROW 0x0004 /* Prevent file from growing. */ # define F_SEAL_WRITE 0x0008 /* Prevent writes. */ #endif #ifdef __USE_GNU /* Hint values for F_{GET,SET}_RW_HINT. */ # define RWF_WRITE_LIFE_NOT_SET 0 # define RWH_WRITE_LIFE_NONE 1 # define RWH_WRITE_LIFE_SHORT 2 # define RWH_WRITE_LIFE_MEDIUM 3 # define RWH_WRITE_LIFE_LONG 4 # define RWH_WRITE_LIFE_EXTREME 5 #endif /* Define some more compatibility macros to be backward compatible with BSD systems which did not managed to hide these kernel macros. */ #ifdef __USE_MISC # define FAPPEND O_APPEND # define FFSYNC O_FSYNC # define FASYNC O_ASYNC # define FNONBLOCK O_NONBLOCK # define FNDELAY O_NDELAY #endif /* Use misc. */ #ifndef __POSIX_FADV_DONTNEED # define __POSIX_FADV_DONTNEED 4 # define __POSIX_FADV_NOREUSE 5 #endif /* Advise to `posix_fadvise'. */ #ifdef __USE_XOPEN2K # define POSIX_FADV_NORMAL 0 /* No further special treatment. */ # define POSIX_FADV_RANDOM 1 /* Expect random page references. */ # define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ # define POSIX_FADV_DONTNEED __POSIX_FADV_DONTNEED /* Don't need these pages. */ # define POSIX_FADV_NOREUSE __POSIX_FADV_NOREUSE /* Data will be accessed once. */ #endif #ifdef __USE_GNU /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the write. */ # define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those dirty pages in the range which are not presently under writeback. */ # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ # define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing (but we may still block on the fd we splice from/to). */ # define SPLICE_F_MORE 4 /* Expect more data. */ # define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ /* Flags for fallocate. */ # include /* File handle structure. */ struct file_handle { unsigned int handle_bytes; int handle_type; /* File identifier. */ unsigned char f_handle[0]; }; /* Maximum handle size (for now). */ # define MAX_HANDLE_SZ 128 #endif /* Values for `*at' functions. */ #ifdef __USE_ATFILE # define AT_FDCWD -100 /* Special value used to indicate the *at functions should use the current working directory. */ # define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */ # define AT_REMOVEDIR 0x200 /* Remove directory instead of unlinking file. */ # define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ # ifdef __USE_GNU # define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal. */ # define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname. */ # endif # define AT_EACCESS 0x200 /* Test access permitted for effective IDs, not real IDs. */ #endif __BEGIN_DECLS #ifdef __USE_GNU /* Provide kernel hint to read ahead. */ extern __ssize_t readahead(int __fd, __off64_t __offset, size_t __count) __THROW; /* Selective file content synch'ing. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int sync_file_range(int __fd, __off64_t __offset, __off64_t __count, unsigned int __flags); /* Splice address range into a pipe. This function is a possible cancellation point and therefore not marked with __THROW. */ extern __ssize_t vmsplice(int __fdout, const struct iovec *__iov, size_t __count, unsigned int __flags); /* Splice two files together. This function is a possible cancellation point and therefore not marked with __THROW. */ extern __ssize_t splice(int __fdin, __off64_t * __offin, int __fdout, __off64_t * __offout, size_t __len, unsigned int __flags); /* In-kernel implementation of tee for pipe buffers. This function is a possible cancellation point and therefore not marked with __THROW. */ extern __ssize_t tee(int __fdin, int __fdout, size_t __len, unsigned int __flags); /* Reserve storage for the data of the file associated with FD. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int fallocate(int __fd, int __mode, __off_t __offset, __off_t __len); # else # ifdef __REDIRECT extern int __REDIRECT(fallocate, (int __fd, int __mode, __off64_t __offset, __off64_t __len), fallocate64); # else # define fallocate fallocate64 # endif # endif # ifdef __USE_LARGEFILE64 extern int fallocate64(int __fd, int __mode, __off64_t __offset, __off64_t __len); # endif /* Map file name to file handle. */ extern int name_to_handle_at(int __dfd, const char *__name, struct file_handle *__handle, int *__mnt_id, int __flags) __THROW; /* Open file using the file handle. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int open_by_handle_at(int __mountdirfd, struct file_handle *__handle, int __flags); #endif /* use GNU */ __END_DECLS ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/fcntl.h ================================================ /* O_*, F_*, FD_* bit values for Linux/x86. Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _FCNTL_H # error "Never use directly; include instead." #endif #ifdef __x86_64__ # define __O_LARGEFILE 0 #endif #ifdef __x86_64__ /* Not necessary, we always have 64-bit offsets. */ # define F_GETLK64 5 /* Get record locking info. */ # define F_SETLK64 6 /* Set record locking info (non-blocking). */ # define F_SETLKW64 7 /* Set record locking info (blocking). */ #endif struct flock { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ #ifndef __USE_FILE_OFFSET64 __off_t l_start; /* Offset where the lock begins. */ __off_t l_len; /* Size of the locked area; zero means until EOF. */ #else __off64_t l_start; /* Offset where the lock begins. */ __off64_t l_len; /* Size of the locked area; zero means until EOF. */ #endif __pid_t l_pid; /* Process holding the lock. */ }; #ifdef __USE_LARGEFILE64 struct flock64 { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ __off64_t l_start; /* Offset where the lock begins. */ __off64_t l_len; /* Size of the locked area; zero means until EOF. */ __pid_t l_pid; /* Process holding the lock. */ }; #endif /* Include generic Linux declarations. */ #include ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/floatn-common.h ================================================ /* Macros to control TS 18661-3 glibc features where the same definitions are appropriate for all platforms. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_FLOATN_COMMON_H #define _BITS_FLOATN_COMMON_H #include #include /* This header should be included at the bottom of each bits/floatn.h. It defines the following macros for each _FloatN and _FloatNx type, where the same definitions, or definitions based only on the macros in bits/floatn.h, are appropriate for all glibc configurations. */ /* Defined to 1 if the current compiler invocation provides a floating-point type with the right format for this type, and this glibc includes corresponding *fN or *fNx interfaces for it. */ #define __HAVE_FLOAT16 0 #define __HAVE_FLOAT32 1 #define __HAVE_FLOAT64 1 #define __HAVE_FLOAT32X 1 #define __HAVE_FLOAT128X 0 /* Defined to 1 if the corresponding __HAVE_ macro is 1 and the type is the first with its format in the sequence of (the default choices for) float, double, long double, _Float16, _Float32, _Float64, _Float128, _Float32x, _Float64x, _Float128x for this glibc; that is, if functions present once per floating-point format rather than once per type are present for this type. All configurations supported by glibc have _Float32 the same format as float, _Float64 and _Float32x the same format as double, the _Float64x the same format as either long double or _Float128. No configurations support _Float128x or, as of GCC 7, have compiler support for a type meeting the requirements for _Float128x. */ #define __HAVE_DISTINCT_FLOAT16 __HAVE_FLOAT16 #define __HAVE_DISTINCT_FLOAT32 0 #define __HAVE_DISTINCT_FLOAT64 0 #define __HAVE_DISTINCT_FLOAT32X 0 #define __HAVE_DISTINCT_FLOAT64X 0 #define __HAVE_DISTINCT_FLOAT128X __HAVE_FLOAT128X /* Defined to 1 if any _FloatN or _FloatNx types that are not ABI-distinct are however distinct types at the C language level (so for the purposes of __builtin_types_compatible_p and _Generic). */ #if __GNUC_PREREQ (7, 0) && !defined __cplusplus # define __HAVE_FLOATN_NOT_TYPEDEF 1 #else # define __HAVE_FLOATN_NOT_TYPEDEF 0 #endif #ifndef __ASSEMBLER__ /* Defined to concatenate the literal suffix to be used with _FloatN or _FloatNx types, if __HAVE_ is 1. The corresponding literal suffixes exist since GCC 7, for C only. */ # if __HAVE_FLOAT16 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus /* No corresponding suffix available for this type. */ # define __f16(x) ((_Float16) x##f) # else # define __f16(x) x##f16 # endif # endif # if __HAVE_FLOAT32 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # define __f32(x) x##f # else # define __f32(x) x##f32 # endif # endif # if __HAVE_FLOAT64 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # ifdef __NO_LONG_DOUBLE_MATH # define __f64(x) x##l # else # define __f64(x) x # endif # else # define __f64(x) x##f64 # endif # endif # if __HAVE_FLOAT32X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # define __f32x(x) x # else # define __f32x(x) x##f32x # endif # endif # if __HAVE_FLOAT64X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # if __HAVE_FLOAT64X_LONG_DOUBLE # define __f64x(x) x##l # else # define __f64x(x) __f128 (x) # endif # else # define __f64x(x) x##f64x # endif # endif # if __HAVE_FLOAT128X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # error "_Float128X supported but no constant suffix" # else # define __f128x(x) x##f128x # endif # endif /* Defined to a complex type if __HAVE_ is 1. */ # if __HAVE_FLOAT16 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef _Complex float __cfloat16 __attribute__ ((__mode__(__HC__))); # define __CFLOAT16 __cfloat16 # else # define __CFLOAT16 _Complex _Float16 # endif # endif # if __HAVE_FLOAT32 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # define __CFLOAT32 _Complex float # else # define __CFLOAT32 _Complex _Float32 # endif # endif # if __HAVE_FLOAT64 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # ifdef __NO_LONG_DOUBLE_MATH # define __CFLOAT64 _Complex long double # else # define __CFLOAT64 _Complex double # endif # else # define __CFLOAT64 _Complex _Float64 # endif # endif # if __HAVE_FLOAT32X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # define __CFLOAT32X _Complex double # else # define __CFLOAT32X _Complex _Float32x # endif # endif # if __HAVE_FLOAT64X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # if __HAVE_FLOAT64X_LONG_DOUBLE # define __CFLOAT64X _Complex long double # else # define __CFLOAT64X __CFLOAT128 # endif # else # define __CFLOAT64X _Complex _Float64x # endif # endif # if __HAVE_FLOAT128X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # error "_Float128X supported but no complex type" # else # define __CFLOAT128X _Complex _Float128x # endif # endif /* The remaining of this file provides support for older compilers. */ # if __HAVE_FLOAT16 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef float _Float16 __attribute__ ((__mode__(__HF__))); # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf16() ((_Float16) __builtin_huge_val ()) # define __builtin_inff16() ((_Float16) __builtin_inf ()) # define __builtin_nanf16(x) ((_Float16) __builtin_nan (x)) # define __builtin_nansf16(x) ((_Float16) __builtin_nans (x)) # endif # endif # if __HAVE_FLOAT32 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef float _Float32; # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf32() (__builtin_huge_valf ()) # define __builtin_inff32() (__builtin_inff ()) # define __builtin_nanf32(x) (__builtin_nanf (x)) # define __builtin_nansf32(x) (__builtin_nansf (x)) # endif # endif # if __HAVE_FLOAT64 /* If double, long double and _Float64 all have the same set of values, TS 18661-3 requires the usual arithmetic conversions on long double and _Float64 to produce _Float64. For this to be the case when building with a compiler without a distinct _Float64 type, _Float64 must be a typedef for long double, not for double. */ # ifdef __NO_LONG_DOUBLE_MATH # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef long double _Float64; # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf64() (__builtin_huge_vall ()) # define __builtin_inff64() (__builtin_infl ()) # define __builtin_nanf64(x) (__builtin_nanl (x)) # define __builtin_nansf64(x) (__builtin_nansl (x)) # endif # else # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef double _Float64; # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf64() (__builtin_huge_val ()) # define __builtin_inff64() (__builtin_inf ()) # define __builtin_nanf64(x) (__builtin_nan (x)) # define __builtin_nansf64(x) (__builtin_nans (x)) # endif # endif # endif # if __HAVE_FLOAT32X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef double _Float32x; # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf32x() (__builtin_huge_val ()) # define __builtin_inff32x() (__builtin_inf ()) # define __builtin_nanf32x(x) (__builtin_nan (x)) # define __builtin_nansf32x(x) (__builtin_nans (x)) # endif # endif # if __HAVE_FLOAT64X # if __HAVE_FLOAT64X_LONG_DOUBLE # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef long double _Float64x; # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf64x() (__builtin_huge_vall ()) # define __builtin_inff64x() (__builtin_infl ()) # define __builtin_nanf64x(x) (__builtin_nanl (x)) # define __builtin_nansf64x(x) (__builtin_nansl (x)) # endif # else # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef _Float128 _Float64x; # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf64x() (__builtin_huge_valf128 ()) # define __builtin_inff64x() (__builtin_inff128 ()) # define __builtin_nanf64x(x) (__builtin_nanf128 (x)) # define __builtin_nansf64x(x) (__builtin_nansf128 (x)) # endif # endif # endif # if __HAVE_FLOAT128X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # error "_Float128x supported but no type" # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf128x() ((_Float128x) __builtin_huge_val ()) # define __builtin_inff128x() ((_Float128x) __builtin_inf ()) # define __builtin_nanf128x(x) ((_Float128x) __builtin_nan (x)) # define __builtin_nansf128x(x) ((_Float128x) __builtin_nans (x)) # endif # endif #endif /* !__ASSEMBLER__. */ #endif /* _BITS_FLOATN_COMMON_H */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/floatn.h ================================================ /* Macros to control TS 18661-3 glibc features on x86. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_FLOATN_H #define _BITS_FLOATN_H #include /* Defined to 1 if the current compiler invocation provides a floating-point type with the IEEE 754 binary128 format, and this glibc includes corresponding *f128 interfaces for it. The required libgcc support was added some time after the basic compiler support, for x86_64 and x86. */ #if (defined __x86_64__ \ ? __GNUC_PREREQ (4, 3) \ : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) \ && !defined(__CUDACC__) && !defined(__ICC) # define __HAVE_FLOAT128 1 #else # define __HAVE_FLOAT128 0 #endif /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct from the default float, double and long double types in this glibc. */ #if __HAVE_FLOAT128 # define __HAVE_DISTINCT_FLOAT128 1 #else # define __HAVE_DISTINCT_FLOAT128 0 #endif /* Defined to 1 if the current compiler invocation provides a floating-point type with the right format for _Float64x, and this glibc includes corresponding *f64x interfaces for it. */ #define __HAVE_FLOAT64X 1 /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has the format of _Float128, which must be different from that of long double. */ #define __HAVE_FLOAT64X_LONG_DOUBLE 1 #ifndef __ASSEMBLER__ /* Defined to concatenate the literal suffix to be used with _Float128 types, if __HAVE_FLOAT128 is 1. */ # if __HAVE_FLOAT128 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus /* The literal suffix f128 exists only since GCC 7.0. */ # define __f128(x) x##q # else # define __f128(x) x##f128 # endif # endif /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ # if __HAVE_FLOAT128 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus /* Add a typedef for older GCC compilers which don't natively support _Complex _Float128. */ typedef _Complex float __cfloat128 __attribute__ ((__mode__(__TC__))); # define __CFLOAT128 __cfloat128 # else # define __CFLOAT128 _Complex _Float128 # endif # endif /* The remaining of this file provides support for older compilers. */ # if __HAVE_FLOAT128 /* The type _Float128 exists only since GCC 7.0. */ # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef __float128 _Float128; # endif /* __builtin_huge_valf128 doesn't exist before GCC 7.0. */ # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ()) # endif /* Older GCC has only a subset of built-in functions for _Float128 on x86, and __builtin_infq is not usable in static initializers. Converting a narrower sNaN to _Float128 produces a quiet NaN, so attempts to use _Float128 sNaNs will not work properly with older compilers. */ # if !__GNUC_PREREQ (7, 0) # define __builtin_copysignf128 __builtin_copysignq # define __builtin_fabsf128 __builtin_fabsq # define __builtin_inff128() ((_Float128) __builtin_inf ()) # define __builtin_nanf128(x) ((_Float128) __builtin_nan (x)) # define __builtin_nansf128(x) ((_Float128) __builtin_nans (x)) # endif /* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*, e.g.: __builtin_signbitf128, before GCC 6. However, there has never been a __builtin_signbitf128 in GCC and the type-generic builtin is only available since GCC 6. */ # if !__GNUC_PREREQ (6, 0) # define __builtin_signbitf128 __signbitf128 # endif # endif #endif /* !__ASSEMBLER__. */ #include #endif /* _BITS_FLOATN_H */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/flt-eval-method.h ================================================ /* Define __GLIBC_FLT_EVAL_METHOD. x86 version. Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif #ifdef __FLT_EVAL_METHOD__ # if __FLT_EVAL_METHOD__ == -1 # define __GLIBC_FLT_EVAL_METHOD 2 # else # define __GLIBC_FLT_EVAL_METHOD __FLT_EVAL_METHOD__ # endif #elif defined __x86_64__ # define __GLIBC_FLT_EVAL_METHOD 0 #else # define __GLIBC_FLT_EVAL_METHOD 2 #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/fp-fast.h ================================================ /* Define FP_FAST_* macros. Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif #ifdef __USE_ISOC99 /* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l} builtins are supported. */ # ifdef __FP_FAST_FMA # define FP_FAST_FMA 1 # endif # ifdef __FP_FAST_FMAF # define FP_FAST_FMAF 1 # endif # ifdef __FP_FAST_FMAL # define FP_FAST_FMAL 1 # endif #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/fp-logb.h ================================================ /* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. x86 version. Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif #define __FP_LOGB0_IS_MIN 1 #define __FP_LOGBNAN_IS_MIN 1 ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/getopt_core.h ================================================ /* Declarations for getopt (basic, portable features only). Copyright (C) 1989-2018 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _GETOPT_CORE_H #define _GETOPT_CORE_H 1 /* This header should not be used directly; include getopt.h or unistd.h instead. Unlike most bits headers, it does not have a protective #error, because the guard macro for getopt.h in gnulib is not fixed. */ __BEGIN_DECLS /* For communication from 'getopt' to the caller. When 'getopt' finds an option that takes an argument, the argument value is returned here. Also, when 'ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to 'getopt'. On entry to 'getopt', zero means this is the first call; initialize. When 'getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, 'optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message 'getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, 'optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in 'optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU 'getopt'. The argument '--' causes premature termination of argument scanning, explicitly telling 'getopt' that there are no more options. If OPTS begins with '-', then non-option arguments are treated as arguments to the option '\1'. This behavior is specific to the GNU 'getopt'. If OPTS begins with '+', or POSIXLY_CORRECT is set in the environment, then do not permute arguments. For standards compliance, the 'argv' argument has the type char *const *, but this is inaccurate; if argument permutation is enabled, the argv array (not the strings it points to) must be writable. */ extern int getopt(int ___argc, char *const *___argv, const char *__shortopts) __THROW __nonnull((2, 3)); __END_DECLS #endif /* getopt_core.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/getopt_ext.h ================================================ /* Declarations for getopt (GNU extensions). Copyright (C) 1989-2018 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _GETOPT_EXT_H #define _GETOPT_EXT_H 1 /* This header should not be used directly; include getopt.h instead. Unlike most bits headers, it does not have a protective #error, because the guard macro for getopt.h in gnulib is not fixed. */ __BEGIN_DECLS /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of 'struct option' terminated by an element containing a name which is zero. The field 'has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field 'flag' is not NULL, it points to a variable that is set to the value given in the field 'val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an 'int' to a compiled-in constant, such as set a value from 'optarg', set the option's 'flag' field to zero and its 'val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero 'flag' field, 'getopt' returns the contents of the 'val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the 'has_arg' field of 'struct option'. */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 extern int getopt_long(int ___argc, char *__getopt_argv_const * ___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW __nonnull((2, 3)); extern int getopt_long_only(int ___argc, char *__getopt_argv_const * ___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW __nonnull((2, 3)); __END_DECLS #endif /* getopt_ext.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/getopt_posix.h ================================================ /* Declarations for getopt (POSIX compatibility shim). Copyright (C) 1989-2018 Free Software Foundation, Inc. Unlike the bulk of the getopt implementation, this file is NOT part of gnulib. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _GETOPT_POSIX_H #define _GETOPT_POSIX_H 1 #if !defined _UNISTD_H && !defined _STDIO_H #error "Never include getopt_posix.h directly; use unistd.h instead." #endif #include __BEGIN_DECLS #if defined __USE_POSIX2 && !defined __USE_POSIX_IMPLICITLY \ && !defined __USE_GNU && !defined _GETOPT_H /* GNU getopt has more functionality than POSIX getopt. When we are explicitly conforming to POSIX and not GNU, and getopt.h (which is not part of POSIX) has not been included, the extra functionality is disabled. */ # ifdef __REDIRECT extern int __REDIRECT_NTH(getopt, (int ___argc, char *const *___argv, const char *__shortopts), __posix_getopt); # else extern int __posix_getopt(int ___argc, char *const *___argv, const char *__shortopts) __THROW __nonnull((2, 3)); # define getopt __posix_getopt # endif #endif __END_DECLS #endif /* getopt_posix.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/in.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* Linux version. */ #ifndef _NETINET_IN_H # error "Never use directly; include instead." #endif /* If the application has already included linux/in6.h from a linux-based kernel then we will not define the IPv6 IPPROTO_* defines, in6_addr (nor the defines), sockaddr_in6, or ipv6_mreq. Same for in6_ptkinfo or ip6_mtuinfo in linux/ipv6.h. The ABI used by the linux-kernel and glibc match exactly. Neither the linux kernel nor glibc should break this ABI without coordination. In upstream kernel 56c176c9 the _UAPI prefix was stripped so we need to check for _LINUX_IN6_H and _IPV6_H now, and keep checking the old versions for maximum backwards compatibility. */ #if defined _UAPI_LINUX_IN6_H \ || defined _UAPI_IPV6_H \ || defined _LINUX_IN6_H \ || defined _IPV6_H /* This is not quite the same API since the kernel always defines s6_addr16 and s6_addr32. This is not a violation of POSIX since POSIX says "at least the following member" and that holds true. */ # define __USE_KERNEL_IPV6_DEFS 1 #else # define __USE_KERNEL_IPV6_DEFS 0 #endif /* Options for use with `getsockopt' and `setsockopt' at the IP level. The first word in the comment at the right is the data type used; "bool" means a boolean value stored in an `int'. */ #define IP_OPTIONS 4 /* ip_opts; IP per-packet options. */ #define IP_HDRINCL 3 /* int; Header is included with data. */ #define IP_TOS 1 /* int; IP type of service and precedence. */ #define IP_TTL 2 /* int; IP time to live. */ #define IP_RECVOPTS 6 /* bool; Receive all IP options w/datagram. */ /* For BSD compatibility. */ #define IP_RECVRETOPTS IP_RETOPTS /* bool; Receive IP options for response. */ #define IP_RETOPTS 7 /* ip_opts; Set/get IP per-packet options. */ #define IP_MULTICAST_IF 32 /* in_addr; set/get IP multicast i/f */ #define IP_MULTICAST_TTL 33 /* unsigned char; set/get IP multicast ttl */ #define IP_MULTICAST_LOOP 34 /* bool; set/get IP multicast loopback */ #define IP_ADD_MEMBERSHIP 35 /* ip_mreq; add an IP group membership */ #define IP_DROP_MEMBERSHIP 36 /* ip_mreq; drop an IP group membership */ #define IP_UNBLOCK_SOURCE 37 /* ip_mreq_source: unblock data from source */ #define IP_BLOCK_SOURCE 38 /* ip_mreq_source: block data from source */ #define IP_ADD_SOURCE_MEMBERSHIP 39 /* ip_mreq_source: join source group */ #define IP_DROP_SOURCE_MEMBERSHIP 40 /* ip_mreq_source: leave source group */ #define IP_MSFILTER 41 #ifdef __USE_MISC # define MCAST_JOIN_GROUP 42 /* group_req: join any-source group */ # define MCAST_BLOCK_SOURCE 43 /* group_source_req: block from given group */ # define MCAST_UNBLOCK_SOURCE 44 /* group_source_req: unblock from given group */ # define MCAST_LEAVE_GROUP 45 /* group_req: leave any-source group */ # define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */ # define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr */ # define MCAST_MSFILTER 48 # define IP_MULTICAST_ALL 49 # define IP_UNICAST_IF 50 # define MCAST_EXCLUDE 0 # define MCAST_INCLUDE 1 #endif #define IP_ROUTER_ALERT 5 /* bool */ #define IP_PKTINFO 8 /* bool */ #define IP_PKTOPTIONS 9 #define IP_PMTUDISC 10 /* obsolete name? */ #define IP_MTU_DISCOVER 10 /* int; see below */ #define IP_RECVERR 11 /* bool */ #define IP_RECVTTL 12 /* bool */ #define IP_RECVTOS 13 /* bool */ #define IP_MTU 14 /* int */ #define IP_FREEBIND 15 #define IP_IPSEC_POLICY 16 #define IP_XFRM_POLICY 17 #define IP_PASSSEC 18 #define IP_TRANSPARENT 19 #define IP_MULTICAST_ALL 49 /* bool */ /* TProxy original addresses */ #define IP_ORIGDSTADDR 20 #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR #define IP_MINTTL 21 #define IP_NODEFRAG 22 #define IP_CHECKSUM 23 #define IP_BIND_ADDRESS_NO_PORT 24 #define IP_RECVFRAGSIZE 25 /* IP_MTU_DISCOVER arguments. */ #define IP_PMTUDISC_DONT 0 /* Never send DF frames. */ #define IP_PMTUDISC_WANT 1 /* Use per route hints. */ #define IP_PMTUDISC_DO 2 /* Always DF. */ #define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */ /* Always use interface mtu (ignores dst pmtu) but don't set DF flag. Also incoming ICMP frag_needed notifications will be ignored on this socket to prevent accepting spoofed ones. */ #define IP_PMTUDISC_INTERFACE 4 /* Like IP_PMTUDISC_INTERFACE but allow packets to be fragmented. */ #define IP_PMTUDISC_OMIT 5 #define IP_MULTICAST_IF 32 #define IP_MULTICAST_TTL 33 #define IP_MULTICAST_LOOP 34 #define IP_ADD_MEMBERSHIP 35 #define IP_DROP_MEMBERSHIP 36 #define IP_UNBLOCK_SOURCE 37 #define IP_BLOCK_SOURCE 38 #define IP_ADD_SOURCE_MEMBERSHIP 39 #define IP_DROP_SOURCE_MEMBERSHIP 40 #define IP_MSFILTER 41 #define IP_MULTICAST_ALL 49 #define IP_UNICAST_IF 50 /* To select the IP level. */ #define SOL_IP 0 #define IP_DEFAULT_MULTICAST_TTL 1 #define IP_DEFAULT_MULTICAST_LOOP 1 #define IP_MAX_MEMBERSHIPS 20 #ifdef __USE_MISC /* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS. The `ip_dst' field is used for the first-hop gateway when using a source route (this gets put into the header proper). */ struct ip_opts { struct in_addr ip_dst; /* First hop; zero without source route. */ char ip_opts[40]; /* Actually variable in size. */ }; /* Like `struct ip_mreq' but including interface specification by index. */ struct ip_mreqn { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_address; /* local IP address of interface */ int imr_ifindex; /* Interface index */ }; /* Structure used for IP_PKTINFO. */ struct in_pktinfo { int ipi_ifindex; /* Interface index */ struct in_addr ipi_spec_dst; /* Routing destination address */ struct in_addr ipi_addr; /* Header destination address */ }; #endif /* Options for use with `getsockopt' and `setsockopt' at the IPv6 level. The first word in the comment at the right is the data type used; "bool" means a boolean value stored in an `int'. */ #define IPV6_ADDRFORM 1 #define IPV6_2292PKTINFO 2 #define IPV6_2292HOPOPTS 3 #define IPV6_2292DSTOPTS 4 #define IPV6_2292RTHDR 5 #define IPV6_2292PKTOPTIONS 6 #define IPV6_CHECKSUM 7 #define IPV6_2292HOPLIMIT 8 #define SCM_SRCRT IPV6_RXSRCRT #define IPV6_NEXTHOP 9 #define IPV6_AUTHHDR 10 #define IPV6_UNICAST_HOPS 16 #define IPV6_MULTICAST_IF 17 #define IPV6_MULTICAST_HOPS 18 #define IPV6_MULTICAST_LOOP 19 #define IPV6_JOIN_GROUP 20 #define IPV6_LEAVE_GROUP 21 #define IPV6_ROUTER_ALERT 22 #define IPV6_MTU_DISCOVER 23 #define IPV6_MTU 24 #define IPV6_RECVERR 25 #define IPV6_V6ONLY 26 #define IPV6_JOIN_ANYCAST 27 #define IPV6_LEAVE_ANYCAST 28 #define IPV6_IPSEC_POLICY 34 #define IPV6_XFRM_POLICY 35 #define IPV6_HDRINCL 36 /* Advanced API (RFC3542) (1). */ #define IPV6_RECVPKTINFO 49 #define IPV6_PKTINFO 50 #define IPV6_RECVHOPLIMIT 51 #define IPV6_HOPLIMIT 52 #define IPV6_RECVHOPOPTS 53 #define IPV6_HOPOPTS 54 #define IPV6_RTHDRDSTOPTS 55 #define IPV6_RECVRTHDR 56 #define IPV6_RTHDR 57 #define IPV6_RECVDSTOPTS 58 #define IPV6_DSTOPTS 59 #define IPV6_RECVPATHMTU 60 #define IPV6_PATHMTU 61 #define IPV6_DONTFRAG 62 /* Advanced API (RFC3542) (2). */ #define IPV6_RECVTCLASS 66 #define IPV6_TCLASS 67 #define IPV6_AUTOFLOWLABEL 70 /* RFC5014. */ #define IPV6_ADDR_PREFERENCES 72 /* RFC5082. */ #define IPV6_MINHOPCOUNT 73 #define IPV6_ORIGDSTADDR 74 #define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR #define IPV6_TRANSPARENT 75 #define IPV6_UNICAST_IF 76 #define IPV6_RECVFRAGSIZE 77 /* Obsolete synonyms for the above. */ #if !__USE_KERNEL_IPV6_DEFS # define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP # define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP #endif #define IPV6_RXHOPOPTS IPV6_HOPOPTS #define IPV6_RXDSTOPTS IPV6_DSTOPTS /* IPV6_MTU_DISCOVER values. */ #define IPV6_PMTUDISC_DONT 0 /* Never send DF frames. */ #define IPV6_PMTUDISC_WANT 1 /* Use per route hints. */ #define IPV6_PMTUDISC_DO 2 /* Always DF. */ #define IPV6_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */ #define IPV6_PMTUDISC_INTERFACE 4 /* See IP_PMTUDISC_INTERFACE. */ #define IPV6_PMTUDISC_OMIT 5 /* See IP_PMTUDISC_OMIT. */ /* Socket level values for IPv6. */ #define SOL_IPV6 41 #define SOL_ICMPV6 58 /* Routing header options for IPv6. */ #define IPV6_RTHDR_LOOSE 0 /* Hop doesn't need to be neighbour. */ #define IPV6_RTHDR_STRICT 1 /* Hop must be a neighbour. */ #define IPV6_RTHDR_TYPE_0 0 /* IPv6 Routing header type 0. */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/ioctl-types.h ================================================ /* Structure types for pre-termios terminal ioctls. Linux version. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_IOCTL_H # error "Never use directly; include instead." #endif /* Get definition of constants for use with `ioctl'. */ #include struct winsize { unsigned short int ws_row; unsigned short int ws_col; unsigned short int ws_xpixel; unsigned short int ws_ypixel; }; #define NCC 8 struct termio { unsigned short int c_iflag; /* input mode flags */ unsigned short int c_oflag; /* output mode flags */ unsigned short int c_cflag; /* control mode flags */ unsigned short int c_lflag; /* local mode flags */ unsigned char c_line; /* line discipline */ unsigned char c_cc[NCC]; /* control characters */ }; /* modem lines */ #define TIOCM_LE 0x001 #define TIOCM_DTR 0x002 #define TIOCM_RTS 0x004 #define TIOCM_ST 0x008 #define TIOCM_SR 0x010 #define TIOCM_CTS 0x020 #define TIOCM_CAR 0x040 #define TIOCM_RNG 0x080 #define TIOCM_DSR 0x100 #define TIOCM_CD TIOCM_CAR #define TIOCM_RI TIOCM_RNG /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ /* line disciplines */ #define N_TTY 0 #define N_SLIP 1 #define N_MOUSE 2 #define N_PPP 3 #define N_STRIP 4 #define N_AX25 5 #define N_X25 6 /* X.25 async */ #define N_6PACK 7 #define N_MASC 8 /* Mobitex module */ #define N_R3964 9 /* Simatic R3964 module */ #define N_PROFIBUS_FDL 10 /* Profibus */ #define N_IRDA 11 /* Linux IR */ #define N_SMSBLOCK 12 /* SMS block mode */ #define N_HDLC 13 /* synchronous HDLC */ #define N_SYNC_PPP 14 /* synchronous PPP */ #define N_HCI 15 /* Bluetooth HCI UART */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/ioctls.h ================================================ /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_IOCTL_H # error "Never use directly; include instead." #endif /* Use the definitions from the kernel header files. */ #include /* Routing table calls. */ #define SIOCADDRT 0x890B /* add routing table entry */ #define SIOCDELRT 0x890C /* delete routing table entry */ #define SIOCRTMSG 0x890D /* call to routing system */ /* Socket configuration controls. */ #define SIOCGIFNAME 0x8910 /* get iface name */ #define SIOCSIFLINK 0x8911 /* set iface channel */ #define SIOCGIFCONF 0x8912 /* get iface list */ #define SIOCGIFFLAGS 0x8913 /* get flags */ #define SIOCSIFFLAGS 0x8914 /* set flags */ #define SIOCGIFADDR 0x8915 /* get PA address */ #define SIOCSIFADDR 0x8916 /* set PA address */ #define SIOCGIFDSTADDR 0x8917 /* get remote PA address */ #define SIOCSIFDSTADDR 0x8918 /* set remote PA address */ #define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */ #define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */ #define SIOCGIFNETMASK 0x891b /* get network PA mask */ #define SIOCSIFNETMASK 0x891c /* set network PA mask */ #define SIOCGIFMETRIC 0x891d /* get metric */ #define SIOCSIFMETRIC 0x891e /* set metric */ #define SIOCGIFMEM 0x891f /* get memory address (BSD) */ #define SIOCSIFMEM 0x8920 /* set memory address (BSD) */ #define SIOCGIFMTU 0x8921 /* get MTU size */ #define SIOCSIFMTU 0x8922 /* set MTU size */ #define SIOCSIFNAME 0x8923 /* set interface name */ #define SIOCSIFHWADDR 0x8924 /* set hardware address */ #define SIOCGIFENCAP 0x8925 /* get/set encapsulations */ #define SIOCSIFENCAP 0x8926 #define SIOCGIFHWADDR 0x8927 /* Get hardware address */ #define SIOCGIFSLAVE 0x8929 /* Driver slaving support */ #define SIOCSIFSLAVE 0x8930 #define SIOCADDMULTI 0x8931 /* Multicast address lists */ #define SIOCDELMULTI 0x8932 #define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */ #define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */ #define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */ #define SIOCGIFPFLAGS 0x8935 #define SIOCDIFADDR 0x8936 /* delete PA address */ #define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */ #define SIOCGIFCOUNT 0x8938 /* get number of devices */ #define SIOCGIFBR 0x8940 /* Bridging support */ #define SIOCSIFBR 0x8941 /* Set bridging options */ #define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ #define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ /* ARP cache control calls. */ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */ #define SIOCDARP 0x8953 /* delete ARP table entry */ #define SIOCGARP 0x8954 /* get ARP table entry */ #define SIOCSARP 0x8955 /* set ARP table entry */ /* RARP cache control calls. */ #define SIOCDRARP 0x8960 /* delete RARP table entry */ #define SIOCGRARP 0x8961 /* get RARP table entry */ #define SIOCSRARP 0x8962 /* set RARP table entry */ /* Driver configuration calls */ #define SIOCGIFMAP 0x8970 /* Get device parameters */ #define SIOCSIFMAP 0x8971 /* Set device parameters */ /* DLCI configuration calls */ #define SIOCADDDLCI 0x8980 /* Create new DLCI device */ #define SIOCDELDLCI 0x8981 /* Delete DLCI device */ /* Device private ioctl calls. */ /* These 16 ioctls are available to devices via the do_ioctl() device vector. Each device should include this file and redefine these names as their own. Because these are device dependent it is a good idea _NOT_ to issue them to random objects and hope. */ #define SIOCDEVPRIVATE 0x89F0 /* to 89FF */ /* * These 16 ioctl calls are protocol private */ #define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/libc-header-start.h ================================================ /* Handle feature test macros at the start of a header. Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* This header is internal to glibc and should not be included outside of glibc headers. Headers including it must define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first. This header cannot have multiple include guards because ISO C feature test macros depend on the definition of the macro when an affected header is included, not when the first system header is included. */ #ifndef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION # error "Never include directly." #endif #undef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include /* ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__ macro. */ #undef __GLIBC_USE_LIB_EXT2 #if (defined __USE_GNU \ || (defined __STDC_WANT_LIB_EXT2__ && __STDC_WANT_LIB_EXT2__ > 0)) # define __GLIBC_USE_LIB_EXT2 1 #else # define __GLIBC_USE_LIB_EXT2 0 #endif /* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__ macro. */ #undef __GLIBC_USE_IEC_60559_BFP_EXT #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__ # define __GLIBC_USE_IEC_60559_BFP_EXT 1 #else # define __GLIBC_USE_IEC_60559_BFP_EXT 0 #endif /* ISO/IEC TS 18661-4:2015 defines the __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. */ #undef __GLIBC_USE_IEC_60559_FUNCS_EXT #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__ # define __GLIBC_USE_IEC_60559_FUNCS_EXT 1 #else # define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 #endif /* ISO/IEC TS 18661-3:2015 defines the __STDC_WANT_IEC_60559_TYPES_EXT__ macro. */ #undef __GLIBC_USE_IEC_60559_TYPES_EXT #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_TYPES_EXT__ # define __GLIBC_USE_IEC_60559_TYPES_EXT 1 #else # define __GLIBC_USE_IEC_60559_TYPES_EXT 0 #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/libio.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Per Bothner . The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . As a special exception, if you link the code in this file with files compiled with a GNU compiler to produce an executable, that does not cause the resulting executable to be covered by the GNU Lesser General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Lesser General Public License. This exception applies to code released by its copyright holders in files containing the exception. */ #ifndef _BITS_LIBIO_H #define _BITS_LIBIO_H 1 #if !defined _STDIO_H && !defined _LIBIO_H # error "Never include directly; use instead." #endif #include /* ALL of these should be defined in _G_config.h */ #define _IO_fpos_t _G_fpos_t #define _IO_fpos64_t _G_fpos64_t #define _IO_size_t size_t #define _IO_ssize_t __ssize_t #define _IO_off_t __off_t #define _IO_off64_t __off64_t #define _IO_pid_t __pid_t #define _IO_uid_t __uid_t #define _IO_iconv_t _G_iconv_t #define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE #define _IO_BUFSIZ _G_BUFSIZ #define _IO_va_list _G_va_list #define _IO_wint_t wint_t /* This define avoids name pollution if we're using GNU stdarg.h */ #define __need___va_list #include #ifdef __GNUC_VA_LIST # undef _IO_va_list # define _IO_va_list __gnuc_va_list #endif /* __GNUC_VA_LIST */ #ifndef __P # include #endif /*!__P */ #define _IO_UNIFIED_JUMPTABLES 1 #ifndef EOF # define EOF (-1) #endif #ifndef NULL # if defined __GNUG__ && \ (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) # define NULL (__null) # else # if !defined(__cplusplus) # define NULL ((void*)0) # else # define NULL (0) # endif # endif #endif #define _IOS_INPUT 1 #define _IOS_OUTPUT 2 #define _IOS_ATEND 4 #define _IOS_APPEND 8 #define _IOS_TRUNC 16 #define _IOS_NOCREATE 32 #define _IOS_NOREPLACE 64 #define _IOS_BIN 128 /* Magic numbers and bits for the _flags field. The magic numbers use the high-order bits of _flags; the remaining bits are available for variable flags. Note: The magic numbers must all be negative if stdio emulation is desired. */ #define _IO_MAGIC 0xFBAD0000 /* Magic number */ #define _OLD_STDIO_MAGIC 0xFABC0000 /* Emulate old stdio. */ #define _IO_MAGIC_MASK 0xFFFF0000 #define _IO_USER_BUF 1 /* User owns buffer; don't delete it on close. */ #define _IO_UNBUFFERED 2 #define _IO_NO_READS 4 /* Reading not allowed */ #define _IO_NO_WRITES 8 /* Writing not allowd */ #define _IO_EOF_SEEN 0x10 #define _IO_ERR_SEEN 0x20 #define _IO_DELETE_DONT_CLOSE 0x40 /* Don't call close(_fileno) on cleanup. */ #define _IO_LINKED 0x80 /* Set if linked (using _chain) to streambuf::_list_all. */ #define _IO_IN_BACKUP 0x100 #define _IO_LINE_BUF 0x200 #define _IO_TIED_PUT_GET 0x400 /* Set if put and get pointer logicly tied. */ #define _IO_CURRENTLY_PUTTING 0x800 #define _IO_IS_APPENDING 0x1000 #define _IO_IS_FILEBUF 0x2000 #define _IO_BAD_SEEN 0x4000 #define _IO_USER_LOCK 0x8000 #define _IO_FLAGS2_MMAP 1 #define _IO_FLAGS2_NOTCANCEL 2 #ifdef _LIBC # define _IO_FLAGS2_FORTIFY 4 #endif #define _IO_FLAGS2_USER_WBUF 8 #ifdef _LIBC # define _IO_FLAGS2_SCANF_STD 16 # define _IO_FLAGS2_NOCLOSE 32 # define _IO_FLAGS2_CLOEXEC 64 # define _IO_FLAGS2_NEED_LOCK 128 #endif /* These are "formatting flags" matching the iostream fmtflags enum values. */ #define _IO_SKIPWS 01 #define _IO_LEFT 02 #define _IO_RIGHT 04 #define _IO_INTERNAL 010 #define _IO_DEC 020 #define _IO_OCT 040 #define _IO_HEX 0100 #define _IO_SHOWBASE 0200 #define _IO_SHOWPOINT 0400 #define _IO_UPPERCASE 01000 #define _IO_SHOWPOS 02000 #define _IO_SCIENTIFIC 04000 #define _IO_FIXED 010000 #define _IO_UNITBUF 020000 #define _IO_STDIO 040000 #define _IO_DONT_CLOSE 0100000 #define _IO_BOOLALPHA 0200000 struct _IO_jump_t; struct _IO_FILE; /* During the build of glibc itself, _IO_lock_t will already have been defined by internal headers. */ #ifndef _IO_lock_t_defined typedef void _IO_lock_t; #endif /* A streammarker remembers a position in a buffer. */ struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; /* If _pos >= 0 it points to _buf->Gbase()+_pos. FIXME comment */ /* if _pos < 0, it points to _buf->eBptr()+_pos. FIXME comment */ int _pos; #if 0 void set_streampos(streampos sp) { _spos = sp; } void set_offset(int offset) { _pos = offset; _spos = (streampos) (-2); } public: streammarker(streambuf * sb); ~streammarker(); int saving() { return _spos == -2; } int delta(streammarker &); int delta(); #endif }; /* This is the structure from the libstdc++ codecvt class. */ enum __codecvt_result { __codecvt_ok, __codecvt_partial, __codecvt_error, __codecvt_noconv }; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T /* The order of the elements in the following struct must match the order of the virtual functions in the libstdc++ codecvt class. */ struct _IO_codecvt { void (*__codecvt_destr) (struct _IO_codecvt *); enum __codecvt_result (*__codecvt_do_out) (struct _IO_codecvt *, __mbstate_t *, const wchar_t *, const wchar_t *, const wchar_t **, char *, char *, char **); enum __codecvt_result (*__codecvt_do_unshift) (struct _IO_codecvt *, __mbstate_t *, char *, char *, char **); enum __codecvt_result (*__codecvt_do_in) (struct _IO_codecvt *, __mbstate_t *, const char *, const char *, const char **, wchar_t *, wchar_t *, wchar_t **); int (*__codecvt_do_encoding) (struct _IO_codecvt *); int (*__codecvt_do_always_noconv) (struct _IO_codecvt *); int (*__codecvt_do_length) (struct _IO_codecvt *, __mbstate_t *, const char *, const char *, _IO_size_t); int (*__codecvt_do_max_length) (struct _IO_codecvt *); _IO_iconv_t __cd_in; _IO_iconv_t __cd_out; }; /* Extra data for wide character streams. */ struct _IO_wide_data { wchar_t *_IO_read_ptr; /* Current read pointer */ wchar_t *_IO_read_end; /* End of get area. */ wchar_t *_IO_read_base; /* Start of putback+get area. */ wchar_t *_IO_write_base; /* Start of put area. */ wchar_t *_IO_write_ptr; /* Current put pointer. */ wchar_t *_IO_write_end; /* End of put area. */ wchar_t *_IO_buf_base; /* Start of reserve area. */ wchar_t *_IO_buf_end; /* End of reserve area. */ /* The following fields are used to support backing up and undo. */ wchar_t *_IO_save_base; /* Pointer to start of non-current get area. */ wchar_t *_IO_backup_base; /* Pointer to first valid character of backup area */ wchar_t *_IO_save_end; /* Pointer to end of non-current get area. */ __mbstate_t _IO_state; __mbstate_t _IO_last_state; struct _IO_codecvt _codecvt; wchar_t _shortbuf[1]; const struct _IO_jump_t *_wide_vtable; }; #endif struct _IO_FILE { int _flags; /* High-order word is _IO_MAGIC; rest is flags. */ #define _IO_file_flags _flags /* The following pointers correspond to the C++ streambuf protocol. */ /* Note: Tk uses the _IO_read_ptr and _IO_read_end fields directly. */ char *_IO_read_ptr; /* Current read pointer */ char *_IO_read_end; /* End of get area. */ char *_IO_read_base; /* Start of putback+get area. */ char *_IO_write_base; /* Start of put area. */ char *_IO_write_ptr; /* Current put pointer. */ char *_IO_write_end; /* End of put area. */ char *_IO_buf_base; /* Start of reserve area. */ char *_IO_buf_end; /* End of reserve area. */ /* The following fields are used to support backing up and undo. */ char *_IO_save_base; /* Pointer to start of non-current get area. */ char *_IO_backup_base; /* Pointer to first valid character of backup area */ char *_IO_save_end; /* Pointer to end of non-current get area. */ struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; #if 0 int _blksize; #else int _flags2; #endif _IO_off_t _old_offset; /* This used to be _offset but it's too small. */ #define __HAVE_COLUMN /* temporary */ /* 1+column number of pbase(); 0 is unknown. */ unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; /* char* _save_gptr; char* _save_egptr; */ _IO_lock_t *_lock; #ifdef _IO_USE_OLD_IO_FILE }; struct _IO_FILE_complete { struct _IO_FILE _file; #endif #if defined _G_IO_IO_FILE_VERSION && _G_IO_IO_FILE_VERSION == 0x20001 _IO_off64_t _offset; # if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T /* Wide character stream stuff. */ struct _IO_codecvt *_codecvt; struct _IO_wide_data *_wide_data; struct _IO_FILE *_freeres_list; void *_freeres_buf; # else void *__pad1; void *__pad2; void *__pad3; void *__pad4; # endif size_t __pad5; int _mode; /* Make sure we don't get into trouble again. */ char _unused2[15 * sizeof(int) - 4 * sizeof(void *) - sizeof(size_t)]; #endif }; #ifndef __cplusplus typedef struct _IO_FILE _IO_FILE; #endif struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; extern struct _IO_FILE_plus _IO_2_1_stderr_; #ifndef _LIBC #define _IO_stdin ((_IO_FILE*)(&_IO_2_1_stdin_)) #define _IO_stdout ((_IO_FILE*)(&_IO_2_1_stdout_)) #define _IO_stderr ((_IO_FILE*)(&_IO_2_1_stderr_)) #else extern _IO_FILE *_IO_stdin attribute_hidden; extern _IO_FILE *_IO_stdout attribute_hidden; extern _IO_FILE *_IO_stderr attribute_hidden; #endif /* Functions to do I/O and file management for a stream. */ /* Read NBYTES bytes from COOKIE into a buffer pointed to by BUF. Return number of bytes read. */ typedef __ssize_t __io_read_fn(void *__cookie, char *__buf, size_t __nbytes); /* Write N bytes pointed to by BUF to COOKIE. Write all N bytes unless there is an error. Return number of bytes written. If there is an error, return 0 and do not write anything. If the file has been opened for append (__mode.__append set), then set the file pointer to the end of the file and then do the write; if not, just write at the current file pointer. */ typedef __ssize_t __io_write_fn(void *__cookie, const char *__buf, size_t __n); /* Move COOKIE's file position to *POS bytes from the beginning of the file (if W is SEEK_SET), the current position (if W is SEEK_CUR), or the end of the file (if W is SEEK_END). Set *POS to the new file position. Returns zero if successful, nonzero if not. */ typedef int __io_seek_fn(void *__cookie, _IO_off64_t * __pos, int __w); /* Close COOKIE. */ typedef int __io_close_fn(void *__cookie); #ifdef __USE_GNU /* User-visible names for the above. */ typedef __io_read_fn cookie_read_function_t; typedef __io_write_fn cookie_write_function_t; typedef __io_seek_fn cookie_seek_function_t; typedef __io_close_fn cookie_close_function_t; /* The structure with the cookie function pointers. */ typedef struct { __io_read_fn *read; /* Read bytes. */ __io_write_fn *write; /* Write bytes. */ __io_seek_fn *seek; /* Seek/tell file position. */ __io_close_fn *close; /* Close file. */ } _IO_cookie_io_functions_t; typedef _IO_cookie_io_functions_t cookie_io_functions_t; struct _IO_cookie_file; /* Initialize one of those. */ extern void _IO_cookie_init(struct _IO_cookie_file *__cfile, int __read_write, void *__cookie, _IO_cookie_io_functions_t __fns); #endif #ifdef __cplusplus extern "C" { #endif extern int __underflow(_IO_FILE *); extern int __uflow(_IO_FILE *); extern int __overflow(_IO_FILE *, int); #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T extern _IO_wint_t __wunderflow(_IO_FILE *); extern _IO_wint_t __wuflow(_IO_FILE *); extern _IO_wint_t __woverflow(_IO_FILE *, _IO_wint_t); #endif #if __GNUC__ >= 3 # define _IO_BE(expr, res) __builtin_expect ((expr), res) #else # define _IO_BE(expr, res) (expr) #endif #define _IO_getc_unlocked(_fp) \ (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \ ? __uflow (_fp) : *(unsigned char *) (_fp)->_IO_read_ptr++) #define _IO_peekc_unlocked(_fp) \ (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \ && __underflow (_fp) == EOF ? EOF \ : *(unsigned char *) (_fp)->_IO_read_ptr) #define _IO_putc_unlocked(_ch, _fp) \ (_IO_BE ((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end, 0) \ ? __overflow (_fp, (unsigned char) (_ch)) \ : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch))) #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # define _IO_getwc_unlocked(_fp) \ (_IO_BE ((_fp)->_wide_data == NULL \ || ((_fp)->_wide_data->_IO_read_ptr \ >= (_fp)->_wide_data->_IO_read_end), 0) \ ? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++) # define _IO_putwc_unlocked(_wch, _fp) \ (_IO_BE ((_fp)->_wide_data == NULL \ || ((_fp)->_wide_data->_IO_write_ptr \ >= (_fp)->_wide_data->_IO_write_end), 0) \ ? __woverflow (_fp, _wch) \ : (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch))) #endif #define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0) #define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0) extern int _IO_getc(_IO_FILE * __fp); extern int _IO_putc(int __c, _IO_FILE * __fp); extern int _IO_feof(_IO_FILE * __fp) __THROW; extern int _IO_ferror(_IO_FILE * __fp) __THROW; extern int _IO_peekc_locked(_IO_FILE * __fp); /* This one is for Emacs. */ #define _IO_PENDING_OUTPUT_COUNT(_fp) \ ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base) extern void _IO_flockfile(_IO_FILE *) __THROW; extern void _IO_funlockfile(_IO_FILE *) __THROW; extern int _IO_ftrylockfile(_IO_FILE *) __THROW; #define _IO_peekc(_fp) _IO_peekc_unlocked (_fp) #define _IO_flockfile(_fp) /**/ #define _IO_funlockfile(_fp) /**/ #define _IO_ftrylockfile(_fp) /**/ #ifndef _IO_cleanup_region_start #define _IO_cleanup_region_start(_fct, _fp) /**/ #endif #ifndef _IO_cleanup_region_end #define _IO_cleanup_region_end(_Doit) /**/ #endif #define _IO_need_lock(_fp) \ (((_fp)->_flags2 & _IO_FLAGS2_NEED_LOCK) != 0) extern int _IO_vfscanf(_IO_FILE * __restrict, const char *__restrict, _IO_va_list, int *__restrict); extern int _IO_vfprintf(_IO_FILE * __restrict, const char *__restrict, _IO_va_list); extern _IO_ssize_t _IO_padn(_IO_FILE *, int, _IO_ssize_t); extern _IO_size_t _IO_sgetn(_IO_FILE *, void *, _IO_size_t); extern _IO_off64_t _IO_seekoff(_IO_FILE *, _IO_off64_t, int, int); extern _IO_off64_t _IO_seekpos(_IO_FILE *, _IO_off64_t, int); extern void _IO_free_backup_area(_IO_FILE *) __THROW; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T extern _IO_wint_t _IO_getwc(_IO_FILE * __fp); extern _IO_wint_t _IO_putwc(wchar_t __wc, _IO_FILE * __fp); extern int _IO_fwide(_IO_FILE * __fp, int __mode) __THROW; # if __GNUC__ >= 2 /* While compiling glibc we have to handle compatibility with very old versions. */ # if defined _LIBC && defined SHARED # include # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) # define _IO_fwide_maybe_incompatible \ (__builtin_expect (&_IO_stdin_used == NULL, 0)) extern const int _IO_stdin_used; weak_extern(_IO_stdin_used); # endif # endif # ifndef _IO_fwide_maybe_incompatible # define _IO_fwide_maybe_incompatible (0) # endif /* A special optimized version of the function above. It optimizes the case of initializing an unoriented byte stream. */ # define _IO_fwide(__fp, __mode) \ ({ int __result = (__mode); \ if (__result < 0 && ! _IO_fwide_maybe_incompatible) \ { \ if ((__fp)->_mode == 0) \ /* We know that all we have to do is to set the flag. */ \ (__fp)->_mode = -1; \ __result = (__fp)->_mode; \ } \ else if (__builtin_constant_p (__mode) && (__mode) == 0) \ __result = _IO_fwide_maybe_incompatible ? -1 : (__fp)->_mode; \ else \ __result = _IO_fwide (__fp, __result); \ __result; }) # endif extern int _IO_vfwscanf(_IO_FILE * __restrict, const wchar_t * __restrict, _IO_va_list, int *__restrict); extern int _IO_vfwprintf(_IO_FILE * __restrict, const wchar_t * __restrict, _IO_va_list); extern _IO_ssize_t _IO_wpadn(_IO_FILE *, wint_t, _IO_ssize_t); extern void _IO_free_wbackup_area(_IO_FILE *) __THROW; #endif #ifdef __LDBL_COMPAT # include #endif #ifdef __cplusplus } #endif #endif /* _BITS_LIBIO_H */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/libm-simd-decl-stubs.h ================================================ /* Empty definitions required for __MATHCALL_VEC unfolding in mathcalls.h. Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never include directly;\ include instead." #endif /* Needed definitions could be generated with: for func in $(grep __MATHCALL_VEC math/bits/mathcalls.h |\ sed -r "s|__MATHCALL_VEC.?\(||; s|,.*||"); do echo "#define __DECL_SIMD_${func}"; echo "#define __DECL_SIMD_${func}f"; echo "#define __DECL_SIMD_${func}l"; done */ #ifndef _BITS_LIBM_SIMD_DECL_STUBS_H #define _BITS_LIBM_SIMD_DECL_STUBS_H 1 #define __DECL_SIMD_cos #define __DECL_SIMD_cosf #define __DECL_SIMD_cosl #define __DECL_SIMD_cosf16 #define __DECL_SIMD_cosf32 #define __DECL_SIMD_cosf64 #define __DECL_SIMD_cosf128 #define __DECL_SIMD_cosf32x #define __DECL_SIMD_cosf64x #define __DECL_SIMD_cosf128x #define __DECL_SIMD_sin #define __DECL_SIMD_sinf #define __DECL_SIMD_sinl #define __DECL_SIMD_sinf16 #define __DECL_SIMD_sinf32 #define __DECL_SIMD_sinf64 #define __DECL_SIMD_sinf128 #define __DECL_SIMD_sinf32x #define __DECL_SIMD_sinf64x #define __DECL_SIMD_sinf128x #define __DECL_SIMD_sincos #define __DECL_SIMD_sincosf #define __DECL_SIMD_sincosl #define __DECL_SIMD_sincosf16 #define __DECL_SIMD_sincosf32 #define __DECL_SIMD_sincosf64 #define __DECL_SIMD_sincosf128 #define __DECL_SIMD_sincosf32x #define __DECL_SIMD_sincosf64x #define __DECL_SIMD_sincosf128x #define __DECL_SIMD_log #define __DECL_SIMD_logf #define __DECL_SIMD_logl #define __DECL_SIMD_logf16 #define __DECL_SIMD_logf32 #define __DECL_SIMD_logf64 #define __DECL_SIMD_logf128 #define __DECL_SIMD_logf32x #define __DECL_SIMD_logf64x #define __DECL_SIMD_logf128x #define __DECL_SIMD_exp #define __DECL_SIMD_expf #define __DECL_SIMD_expl #define __DECL_SIMD_expf16 #define __DECL_SIMD_expf32 #define __DECL_SIMD_expf64 #define __DECL_SIMD_expf128 #define __DECL_SIMD_expf32x #define __DECL_SIMD_expf64x #define __DECL_SIMD_expf128x #define __DECL_SIMD_pow #define __DECL_SIMD_powf #define __DECL_SIMD_powl #define __DECL_SIMD_powf16 #define __DECL_SIMD_powf32 #define __DECL_SIMD_powf64 #define __DECL_SIMD_powf128 #define __DECL_SIMD_powf32x #define __DECL_SIMD_powf64x #define __DECL_SIMD_powf128x #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/local_lim.h ================================================ /* Minimum guaranteed maximum values for system limits. Linux version. Copyright (C) 1993-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see . */ /* The kernel header pollutes the namespace with the NR_OPEN symbol and defines LINK_MAX although filesystems have different maxima. A similar thing is true for OPEN_MAX: the limit can be changed at runtime and therefore the macro must not be defined. Remove this after including the header if necessary. */ #ifndef NR_OPEN # define __undef_NR_OPEN #endif #ifndef LINK_MAX # define __undef_LINK_MAX #endif #ifndef OPEN_MAX # define __undef_OPEN_MAX #endif #ifndef ARG_MAX # define __undef_ARG_MAX #endif /* The kernel sources contain a file with all the needed information. */ #include /* Have to remove NR_OPEN? */ #ifdef __undef_NR_OPEN # undef NR_OPEN # undef __undef_NR_OPEN #endif /* Have to remove LINK_MAX? */ #ifdef __undef_LINK_MAX # undef LINK_MAX # undef __undef_LINK_MAX #endif /* Have to remove OPEN_MAX? */ #ifdef __undef_OPEN_MAX # undef OPEN_MAX # undef __undef_OPEN_MAX #endif /* Have to remove ARG_MAX? */ #ifdef __undef_ARG_MAX # undef ARG_MAX # undef __undef_ARG_MAX #endif /* The number of data keys per process. */ #define _POSIX_THREAD_KEYS_MAX 128 /* This is the value this implementation supports. */ #define PTHREAD_KEYS_MAX 1024 /* Controlling the iterations of destructors for thread-specific data. */ #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 /* Number of iterations this implementation does. */ #define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS /* The number of threads per process. */ #define _POSIX_THREAD_THREADS_MAX 64 /* We have no predefined limit on the number of threads. */ #undef PTHREAD_THREADS_MAX /* Maximum amount by which a process can descrease its asynchronous I/O priority level. */ #define AIO_PRIO_DELTA_MAX 20 /* Minimum size for a thread. We are free to choose a reasonable value. */ #define PTHREAD_STACK_MIN 16384 /* Maximum number of timer expiration overruns. */ #define DELAYTIMER_MAX 2147483647 /* Maximum tty name length. */ #define TTY_NAME_MAX 32 /* Maximum login name length. This is arbitrary. */ #define LOGIN_NAME_MAX 256 /* Maximum host name length. */ #define HOST_NAME_MAX 64 /* Maximum message queue priority level. */ #define MQ_PRIO_MAX 32768 /* Maximum value the semaphore can have. */ #define SEM_VALUE_MAX (2147483647) ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/locale.h ================================================ /* Definition of locale category symbol values. Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _LOCALE_H && !defined _LANGINFO_H # error "Never use directly; include instead." #endif #ifndef _BITS_LOCALE_H #define _BITS_LOCALE_H 1 #define __LC_CTYPE 0 #define __LC_NUMERIC 1 #define __LC_TIME 2 #define __LC_COLLATE 3 #define __LC_MONETARY 4 #define __LC_MESSAGES 5 #define __LC_ALL 6 #define __LC_PAPER 7 #define __LC_NAME 8 #define __LC_ADDRESS 9 #define __LC_TELEPHONE 10 #define __LC_MEASUREMENT 11 #define __LC_IDENTIFICATION 12 #endif /* bits/locale.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/long-double.h ================================================ /* Properties of long double type. ldbl-96 version. Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* long double is distinct from double, so there is nothing to define here. */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/math-vector.h ================================================ /* Platform-specific SIMD declarations of math functions. Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never include directly;\ include instead." #endif /* Get default empty definitions for simd declarations. */ #include #if defined __x86_64__ && defined __FAST_MATH__ # if defined _OPENMP && _OPENMP >= 201307 /* OpenMP case. */ # define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") # elif __GNUC_PREREQ (6,0) /* W/o OpenMP use GCC 6.* __attribute__ ((__simd__)). */ # define __DECL_SIMD_x86_64 __attribute__ ((__simd__ ("notinbranch"))) # endif # ifdef __DECL_SIMD_x86_64 # undef __DECL_SIMD_cos # define __DECL_SIMD_cos __DECL_SIMD_x86_64 # undef __DECL_SIMD_cosf # define __DECL_SIMD_cosf __DECL_SIMD_x86_64 # undef __DECL_SIMD_sin # define __DECL_SIMD_sin __DECL_SIMD_x86_64 # undef __DECL_SIMD_sinf # define __DECL_SIMD_sinf __DECL_SIMD_x86_64 # undef __DECL_SIMD_sincos # define __DECL_SIMD_sincos __DECL_SIMD_x86_64 # undef __DECL_SIMD_sincosf # define __DECL_SIMD_sincosf __DECL_SIMD_x86_64 # undef __DECL_SIMD_log # define __DECL_SIMD_log __DECL_SIMD_x86_64 # undef __DECL_SIMD_logf # define __DECL_SIMD_logf __DECL_SIMD_x86_64 # undef __DECL_SIMD_exp # define __DECL_SIMD_exp __DECL_SIMD_x86_64 # undef __DECL_SIMD_expf # define __DECL_SIMD_expf __DECL_SIMD_x86_64 # undef __DECL_SIMD_pow # define __DECL_SIMD_pow __DECL_SIMD_x86_64 # undef __DECL_SIMD_powf # define __DECL_SIMD_powf __DECL_SIMD_x86_64 # endif #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/mathcalls-helper-functions.h ================================================ /* Prototype declarations for math classification macros helpers. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* Classify given number. */ __MATHDECL_1(int, __fpclassify,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Test for negative number. */ __MATHDECL_1(int, __signbit,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1(int, __isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. Used by isfinite macro. */ __MATHDECL_1(int, __finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is not a number. */ __MATHDECL_1(int, __isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Test equality. */ __MATHDECL_1(int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y)); /* Test for signaling NaN. */ __MATHDECL_1(int, __issignaling,, (_Mdouble_ __value)) __attribute__ ((__const__)); ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/mathcalls.h ================================================ /* Prototype declarations for math functions; helper file for . Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* NOTE: Because of the special way this file is used by , this file must NOT be protected from multiple inclusion as header files usually are. This file provides prototype declarations for the math functions. Most functions are declared using the macro: __MATHCALL (NAME,[_r], (ARGS...)); This means there is a function `NAME' returning `double' and a function `NAMEf' returning `float'. Each place `_Mdouble_' appears in the prototype, that is actually `double' in the prototype for `NAME' and `float' in the prototype for `NAMEf'. Reentrant variant functions are called `NAME_r' and `NAMEf_r'. Functions returning other types like `int' are declared using the macro: __MATHDECL (TYPE, NAME,[_r], (ARGS...)); This is just like __MATHCALL but for a function returning `TYPE' instead of `_Mdouble_'. In all of these cases, there is still both a `NAME' and a `NAMEf' that takes `float' arguments. Note that there must be no whitespace before the argument passed for NAME, to make token pasting work with -traditional. */ #ifndef _MATH_H # error "Never include directly; include instead." #endif /* Trigonometric functions. */ /* Arc cosine of X. */ __MATHCALL(acos,, (_Mdouble_ __x)); /* Arc sine of X. */ __MATHCALL(asin,, (_Mdouble_ __x)); /* Arc tangent of X. */ __MATHCALL(atan,, (_Mdouble_ __x)); /* Arc tangent of Y/X. */ __MATHCALL(atan2,, (_Mdouble_ __y, _Mdouble_ __x)); /* Cosine of X. */ __MATHCALL_VEC(cos,, (_Mdouble_ __x)); /* Sine of X. */ __MATHCALL_VEC(sin,, (_Mdouble_ __x)); /* Tangent of X. */ __MATHCALL(tan,, (_Mdouble_ __x)); /* Hyperbolic functions. */ /* Hyperbolic cosine of X. */ __MATHCALL(cosh,, (_Mdouble_ __x)); /* Hyperbolic sine of X. */ __MATHCALL(sinh,, (_Mdouble_ __x)); /* Hyperbolic tangent of X. */ __MATHCALL(tanh,, (_Mdouble_ __x)); #ifdef __USE_GNU /* Cosine and sine of X. */ __MATHDECL_VEC(void, sincos,, (_Mdouble_ __x, _Mdouble_ * __sinx, _Mdouble_ * __cosx)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* Hyperbolic arc cosine of X. */ __MATHCALL(acosh,, (_Mdouble_ __x)); /* Hyperbolic arc sine of X. */ __MATHCALL(asinh,, (_Mdouble_ __x)); /* Hyperbolic arc tangent of X. */ __MATHCALL(atanh,, (_Mdouble_ __x)); #endif /* Exponential and logarithmic functions. */ /* Exponential function of X. */ __MATHCALL_VEC(exp,, (_Mdouble_ __x)); /* Break VALUE into a normalized fraction and an integral power of 2. */ __MATHCALL(frexp,, (_Mdouble_ __x, int *__exponent)); /* X times (two to the EXP power). */ __MATHCALL(ldexp,, (_Mdouble_ __x, int __exponent)); /* Natural logarithm of X. */ __MATHCALL_VEC(log,, (_Mdouble_ __x)); /* Base-ten logarithm of X. */ __MATHCALL(log10,, (_Mdouble_ __x)); /* Break VALUE into integral and fractional parts. */ __MATHCALL(modf,, (_Mdouble_ __x, _Mdouble_ * __iptr)) __nonnull((2)); #if __GLIBC_USE (IEC_60559_FUNCS_EXT) /* Compute exponent to base ten. */ __MATHCALL(exp10,, (_Mdouble_ __x)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* Return exp(X) - 1. */ __MATHCALL(expm1,, (_Mdouble_ __x)); /* Return log(1 + X). */ __MATHCALL(log1p,, (_Mdouble_ __x)); /* Return the base 2 signed integral exponent of X. */ __MATHCALL(logb,, (_Mdouble_ __x)); #endif #ifdef __USE_ISOC99 /* Compute base-2 exponential of X. */ __MATHCALL(exp2,, (_Mdouble_ __x)); /* Compute base-2 logarithm of X. */ __MATHCALL(log2,, (_Mdouble_ __x)); #endif /* Power functions. */ /* Return X to the Y power. */ __MATHCALL_VEC(pow,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the square root of X. */ __MATHCALL(sqrt,, (_Mdouble_ __x)); #if defined __USE_XOPEN || defined __USE_ISOC99 /* Return `sqrt(X*X + Y*Y)'. */ __MATHCALL(hypot,, (_Mdouble_ __x, _Mdouble_ __y)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* Return the cube root of X. */ __MATHCALL(cbrt,, (_Mdouble_ __x)); #endif /* Nearest integer, absolute value, and remainder functions. */ /* Smallest integral value not less than X. */ __MATHCALLX(ceil,, (_Mdouble_ __x), (__const__)); /* Absolute value of X. */ __MATHCALLX(fabs,, (_Mdouble_ __x), (__const__)); /* Largest integer not greater than X. */ __MATHCALLX(floor,, (_Mdouble_ __x), (__const__)); /* Floating-point modulo remainder of X/Y. */ __MATHCALL(fmod,, (_Mdouble_ __x, _Mdouble_ __y)); #ifdef __USE_MISC # if ((!defined __cplusplus \ || __cplusplus < 201103L /* isinf conflicts with C++11. */ \ || __MATH_DECLARING_DOUBLE == 0)) /* isinff or isinfl don't. */ \ && !__MATH_DECLARING_FLOATN /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1(int, isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); # endif # if !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is finite and not NaN. */ __MATHDECL_1(int, finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return the remainder of X/Y. */ __MATHCALL(drem,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the fractional part of X after dividing out `ilogb (X)'. */ __MATHCALL(significand,, (_Mdouble_ __x)); # endif #endif /* Use misc. */ #ifdef __USE_ISOC99 /* Return X with its signed changed to Y's. */ __MATHCALLX(copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); #endif #ifdef __USE_ISOC99 /* Return representation of qNaN for double type. */ __MATHCALLX(nan,, (const char *__tagb), (__const__)); #endif #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) # if ((!defined __cplusplus \ || __cplusplus < 201103L /* isnan conflicts with C++11. */ \ || __MATH_DECLARING_DOUBLE == 0)) /* isnanf or isnanl don't. */ \ && !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is not a number. */ __MATHDECL_1(int, isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); # endif #endif #if defined __USE_MISC || (defined __USE_XOPEN && __MATH_DECLARING_DOUBLE) /* Bessel functions. */ __MATHCALL(j0,, (_Mdouble_)); __MATHCALL(j1,, (_Mdouble_)); __MATHCALL(jn,, (int, _Mdouble_)); __MATHCALL(y0,, (_Mdouble_)); __MATHCALL(y1,, (_Mdouble_)); __MATHCALL(yn,, (int, _Mdouble_)); #endif #if defined __USE_XOPEN || defined __USE_ISOC99 /* Error and gamma functions. */ __MATHCALL(erf,, (_Mdouble_)); __MATHCALL(erfc,, (_Mdouble_)); __MATHCALL(lgamma,, (_Mdouble_)); #endif #ifdef __USE_ISOC99 /* True gamma function. */ __MATHCALL(tgamma,, (_Mdouble_)); #endif #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) # if !__MATH_DECLARING_FLOATN /* Obsolete alias for `lgamma'. */ __MATHCALL(gamma,, (_Mdouble_)); # endif #endif #ifdef __USE_MISC /* Reentrant version of lgamma. This function uses the global variable `signgam'. The reentrant version instead takes a pointer and stores the value through it. */ __MATHCALL(lgamma, _r, (_Mdouble_, int *__signgamp)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* Return the integer nearest X in the direction of the prevailing rounding mode. */ __MATHCALL(rint,, (_Mdouble_ __x)); /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ __MATHCALL(nextafter,, (_Mdouble_ __x, _Mdouble_ __y)); # if defined __USE_ISOC99 && !defined __LDBL_COMPAT && !__MATH_DECLARING_FLOATN __MATHCALL(nexttoward,, (_Mdouble_ __x, long double __y)); # endif # if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN /* Return X - epsilon. */ __MATHCALL(nextdown,, (_Mdouble_ __x)); /* Return X + epsilon. */ __MATHCALL(nextup,, (_Mdouble_ __x)); # endif /* Return the remainder of integer divison X / Y with infinite precision. */ __MATHCALL(remainder,, (_Mdouble_ __x, _Mdouble_ __y)); # ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL(scalbn,, (_Mdouble_ __x, int __n)); # endif /* Return the binary exponent of X, which must be nonzero. */ __MATHDECL(int, ilogb,, (_Mdouble_ __x)); #endif #if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN /* Like ilogb, but returning long int. */ __MATHDECL(long int, llogb,, (_Mdouble_ __x)); #endif #ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL(scalbln,, (_Mdouble_ __x, long int __n)); /* Round X to integral value in floating-point format using current rounding direction, but do not raise inexact exception. */ __MATHCALL(nearbyint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHCALLX(round,, (_Mdouble_ __x), (__const__)); /* Round X to the integral value in floating-point format nearest but not larger in magnitude. */ __MATHCALLX(trunc,, (_Mdouble_ __x), (__const__)); /* Compute remainder of X and Y and put in *QUO a value with sign of x/y and magnitude congruent `mod 2^n' to the magnitude of the integral quotient x/y, with n >= 3. */ __MATHCALL(remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo)); /* Conversion functions. */ /* Round X to nearest integral value according to current rounding direction. */ __MATHDECL(long int, lrint,, (_Mdouble_ __x)); __extension__ __MATHDECL(long long int, llrint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHDECL(long int, lround,, (_Mdouble_ __x)); __extension__ __MATHDECL(long long int, llround,, (_Mdouble_ __x)); /* Return positive difference between X and Y. */ __MATHCALL(fdim,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return maximum numeric value from X and Y. */ __MATHCALLX(fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Return minimum numeric value from X and Y. */ __MATHCALLX(fmin,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Multiply-add function computed as a ternary operation. */ __MATHCALL(fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); #endif /* Use ISO C99. */ #if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN /* Round X to nearest integer value, rounding halfway cases to even. */ __MATHCALLX(roundeven,, (_Mdouble_ __x), (__const__)); /* Round X to nearest signed integer value, not raising inexact, with control of rounding direction and width of result. */ __MATHDECL(__intmax_t, fromfp,, (_Mdouble_ __x, int __round, unsigned int __width)); /* Round X to nearest unsigned integer value, not raising inexact, with control of rounding direction and width of result. */ __MATHDECL(__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round, unsigned int __width)); /* Round X to nearest signed integer value, raising inexact for non-integers, with control of rounding direction and width of result. */ __MATHDECL(__intmax_t, fromfpx,, (_Mdouble_ __x, int __round, unsigned int __width)); /* Round X to nearest unsigned integer value, raising inexact for non-integers, with control of rounding direction and width of result. */ __MATHDECL(__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round, unsigned int __width)); /* Return value with maximum magnitude. */ __MATHCALLX(fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Return value with minimum magnitude. */ __MATHCALLX(fminmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Total order operation. */ __MATHDECL_1(int, totalorder,, (_Mdouble_ __x, _Mdouble_ __y)) __attribute__ ((__const__)); /* Total order operation on absolute values. */ __MATHDECL_1(int, totalordermag,, (_Mdouble_ __x, _Mdouble_ __y)) __attribute__ ((__const__)); /* Canonicalize floating-point representation. */ __MATHDECL_1(int, canonicalize,, (_Mdouble_ * __cx, const _Mdouble_ * __x)); /* Get NaN payload. */ __MATHCALL(getpayload,, (const _Mdouble_ * __x)); /* Set quiet NaN payload. */ __MATHDECL_1(int, setpayload,, (_Mdouble_ * __x, _Mdouble_ __payload)); /* Set signaling NaN payload. */ __MATHDECL_1(int, setpayloadsig,, (_Mdouble_ * __x, _Mdouble_ __payload)); #endif #if (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \ && __MATH_DECLARING_DOUBLE \ && !defined __USE_XOPEN2K8)) \ && !__MATH_DECLARING_FLOATN /* Return X times (2 to the Nth power). */ __MATHCALL(scalb,, (_Mdouble_ __x, _Mdouble_ __n)); #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/mman-linux.h ================================================ /* Definitions for POSIX memory map interface. Linux generic version. Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_MMAN_H # error "Never use directly; include instead." #endif /* The following definitions basically come from the kernel headers. But the kernel header is not namespace clean. */ /* Protections are chosen from these bits, OR'd together. The implementation does not necessarily support PROT_EXEC or PROT_WRITE without PROT_READ. The only guarantees are that no writing will be allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ #define PROT_READ 0x1 /* Page can be read. */ #define PROT_WRITE 0x2 /* Page can be written. */ #define PROT_EXEC 0x4 /* Page can be executed. */ #define PROT_NONE 0x0 /* Page can not be accessed. */ #define PROT_GROWSDOWN 0x01000000 /* Extend change to start of growsdown vma (mprotect only). */ #define PROT_GROWSUP 0x02000000 /* Extend change to start of growsup vma (mprotect only). */ /* Sharing types (must choose one and only one of these). */ #define MAP_SHARED 0x01 /* Share changes. */ #define MAP_PRIVATE 0x02 /* Changes are private. */ #ifdef __USE_MISC # define MAP_TYPE 0x0f /* Mask for type of mapping. */ #endif /* Other flags. */ #define MAP_FIXED 0x10 /* Interpret addr exactly. */ #ifdef __USE_MISC # define MAP_FILE 0 # ifdef __MAP_ANONYMOUS # define MAP_ANONYMOUS __MAP_ANONYMOUS /* Don't use a file. */ # else # define MAP_ANONYMOUS 0x20 /* Don't use a file. */ # endif # define MAP_ANON MAP_ANONYMOUS /* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */ # define MAP_HUGE_SHIFT 26 # define MAP_HUGE_MASK 0x3f #endif /* Flags to `msync'. */ #define MS_ASYNC 1 /* Sync memory asynchronously. */ #define MS_SYNC 4 /* Synchronous memory sync. */ #define MS_INVALIDATE 2 /* Invalidate the caches. */ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 # define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ #ifdef __USE_MISC # define MADV_NORMAL 0 /* No further special treatment. */ # define MADV_RANDOM 1 /* Expect random page references. */ # define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define MADV_WILLNEED 3 /* Will need these pages. */ # define MADV_DONTNEED 4 /* Don't need these pages. */ # define MADV_FREE 8 /* Free pages only if memory pressure. */ # define MADV_REMOVE 9 /* Remove these pages and resources. */ # define MADV_DONTFORK 10 /* Do not inherit across fork. */ # define MADV_DOFORK 11 /* Do inherit across fork. */ # define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ # define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ # define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */ # define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */ # define MADV_DONTDUMP 16 /* Explicity exclude from the core dump, overrides the coredump filter bits. */ # define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */ # define MADV_WIPEONFORK 18 /* Zero memory on fork, child only. */ # define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK. */ # define MADV_HWPOISON 100 /* Poison a page for testing. */ #endif /* The POSIX people had to invent similar names for the same things. */ #ifdef __USE_XOPEN2K # define POSIX_MADV_NORMAL 0 /* No further special treatment. */ # define POSIX_MADV_RANDOM 1 /* Expect random page references. */ # define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ # define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ #endif /* Flags for `mlockall'. */ #ifndef MCL_CURRENT # define MCL_CURRENT 1 /* Lock all currently mapped pages. */ # define MCL_FUTURE 2 /* Lock all additions to address space. */ # define MCL_ONFAULT 4 /* Lock all pages that are faulted in. */ #endif #include ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/mman-shared.h ================================================ /* Memory-mapping-related declarations/definitions, not architecture-specific. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_MMAN_H # error "Never use directly; include instead." #endif #ifdef __USE_GNU /* Flags for memfd_create. */ # ifndef MFD_CLOEXEC # define MFD_CLOEXEC 1U # define MFD_ALLOW_SEALING 2U # define MFD_HUGETLB 4U # endif /* Flags for mlock2. */ # ifndef MLOCK_ONFAULT # define MLOCK_ONFAULT 1U # endif /* Access rights for pkey_alloc. */ # ifndef PKEY_DISABLE_ACCESS # define PKEY_DISABLE_ACCESS 0x1 # define PKEY_DISABLE_WRITE 0x2 # endif __BEGIN_DECLS /* Create a new memory file descriptor. NAME is a name for debugging. FLAGS is a combination of the MFD_* constants. */ int memfd_create(const char *__name, unsigned int __flags) __THROW; /* Lock pages from ADDR (inclusive) to ADDR + LENGTH (exclusive) into memory. FLAGS is a combination of the MLOCK_* flags above. */ int mlock2(const void *__addr, size_t __length, unsigned int __flags) __THROW; /* Allocate a new protection key, with the PKEY_DISABLE_* bits specified in ACCESS_RIGHTS. The protection key mask for the current thread is updated to match the access privilege for the new key. */ int pkey_alloc(unsigned int __flags, unsigned int __access_rights) __THROW; /* Update the access rights for the current thread for KEY, which must have been allocated using pkey_alloc. */ int pkey_set(int __key, unsigned int __access_rights) __THROW; /* Return the access rights for the current thread for KEY, which must have been allocated using pkey_alloc. */ int pkey_get(int __key) __THROW; /* Free an allocated protection key, which must have been allocated using pkey_alloc. */ int pkey_free(int __key) __THROW; /* Apply memory protection flags for KEY to the specified address range. */ int pkey_mprotect(void *__addr, size_t __len, int __prot, int __pkey) __THROW; __END_DECLS #endif /* __USE_GNU */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/mman.h ================================================ /* Definitions for POSIX memory map interface. Linux/x86_64 version. Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_MMAN_H # error "Never use directly; include instead." #endif /* The following definitions basically come from the kernel headers. But the kernel header is not namespace clean. */ /* Other flags. */ #ifdef __USE_MISC # define MAP_32BIT 0x40 /* Only give out 32-bit addresses. */ #endif /* These are Linux-specific. */ #ifdef __USE_MISC # define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */ # define MAP_DENYWRITE 0x00800 /* ETXTBSY */ # define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */ # define MAP_LOCKED 0x02000 /* Lock the mapping. */ # define MAP_NORESERVE 0x04000 /* Don't check for reservations. */ # define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */ # define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ # define MAP_STACK 0x20000 /* Allocation is for a stack. */ # define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ #endif /* Include generic Linux declarations. */ #include ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/netdb.h ================================================ /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _NETDB_H # error "Never include directly; use instead." #endif /* Description of data base entry for a single network. NOTE: here a poor assumption is made. The network number is expected to fit into an unsigned long int variable. */ struct netent { char *n_name; /* Official name of network. */ char **n_aliases; /* Alias list. */ int n_addrtype; /* Net address type. */ uint32_t n_net; /* Network number. */ }; ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/param.h ================================================ /* Old-style Unix parameters and limits. Linux version. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_PARAM_H # error "Never use directly; include instead." #endif #ifndef ARG_MAX # define __undef_ARG_MAX #endif #include #include /* The kernel headers define ARG_MAX. The value is wrong, though. */ #ifdef __undef_ARG_MAX # undef ARG_MAX # undef __undef_ARG_MAX #endif #define MAXSYMLINKS 20 /* The following are not really correct but it is a value we used for a long time and which seems to be usable. People should not use NOFILE and NCARGS anyway. */ #define NOFILE 256 #define NCARGS 131072 ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/posix1_lim.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 2.9.2 Minimum Values Added to * * Never include this file directly; use instead. */ #ifndef _BITS_POSIX1_LIM_H #define _BITS_POSIX1_LIM_H 1 /* These are the standard-mandated minimum values. */ /* Minimum number of operations in one list I/O call. */ #define _POSIX_AIO_LISTIO_MAX 2 /* Minimal number of outstanding asynchronous I/O operations. */ #define _POSIX_AIO_MAX 1 /* Maximum length of arguments to `execve', including environment. */ #define _POSIX_ARG_MAX 4096 /* Maximum simultaneous processes per real user ID. */ #ifdef __USE_XOPEN2K # define _POSIX_CHILD_MAX 25 #else # define _POSIX_CHILD_MAX 6 #endif /* Minimal number of timer expiration overruns. */ #define _POSIX_DELAYTIMER_MAX 32 /* Maximum length of a host name (not including the terminating null) as returned from the GETHOSTNAME function. */ #define _POSIX_HOST_NAME_MAX 255 /* Maximum link count of a file. */ #define _POSIX_LINK_MAX 8 /* Maximum length of login name. */ #define _POSIX_LOGIN_NAME_MAX 9 /* Number of bytes in a terminal canonical input queue. */ #define _POSIX_MAX_CANON 255 /* Number of bytes for which space will be available in a terminal input queue. */ #define _POSIX_MAX_INPUT 255 /* Maximum number of message queues open for a process. */ #define _POSIX_MQ_OPEN_MAX 8 /* Maximum number of supported message priorities. */ #define _POSIX_MQ_PRIO_MAX 32 /* Number of bytes in a filename. */ #define _POSIX_NAME_MAX 14 /* Number of simultaneous supplementary group IDs per process. */ #ifdef __USE_XOPEN2K # define _POSIX_NGROUPS_MAX 8 #else # define _POSIX_NGROUPS_MAX 0 #endif /* Number of files one process can have open at once. */ #ifdef __USE_XOPEN2K # define _POSIX_OPEN_MAX 20 #else # define _POSIX_OPEN_MAX 16 #endif #if !defined __USE_XOPEN2K || defined __USE_GNU /* Number of descriptors that a process may examine with `pselect' or `select'. */ # define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX #endif /* Number of bytes in a pathname. */ #define _POSIX_PATH_MAX 256 /* Number of bytes than can be written atomically to a pipe. */ #define _POSIX_PIPE_BUF 512 /* The number of repeated occurrences of a BRE permitted by the REGEXEC and REGCOMP functions when using the interval notation. */ #define _POSIX_RE_DUP_MAX 255 /* Minimal number of realtime signals reserved for the application. */ #define _POSIX_RTSIG_MAX 8 /* Number of semaphores a process can have. */ #define _POSIX_SEM_NSEMS_MAX 256 /* Maximal value of a semaphore. */ #define _POSIX_SEM_VALUE_MAX 32767 /* Number of pending realtime signals. */ #define _POSIX_SIGQUEUE_MAX 32 /* Largest value of a `ssize_t'. */ #define _POSIX_SSIZE_MAX 32767 /* Number of streams a process can have open at once. */ #define _POSIX_STREAM_MAX 8 /* The number of bytes in a symbolic link. */ #define _POSIX_SYMLINK_MAX 255 /* The number of symbolic links that can be traversed in the resolution of a pathname in the absence of a loop. */ #define _POSIX_SYMLOOP_MAX 8 /* Number of timer for a process. */ #define _POSIX_TIMER_MAX 32 /* Maximum number of characters in a tty name. */ #define _POSIX_TTY_NAME_MAX 9 /* Maximum length of a timezone name (element of `tzname'). */ #ifdef __USE_XOPEN2K # define _POSIX_TZNAME_MAX 6 #else # define _POSIX_TZNAME_MAX 3 #endif #if !defined __USE_XOPEN2K || defined __USE_GNU /* Maximum number of connections that can be queued on a socket. */ # define _POSIX_QLIMIT 1 /* Maximum number of bytes that can be buffered on a socket for send or receive. */ # define _POSIX_HIWAT _POSIX_PIPE_BUF /* Maximum number of elements in an `iovec' array. */ # define _POSIX_UIO_MAXIOV 16 #endif /* Maximum clock resolution in nanoseconds. */ #define _POSIX_CLOCKRES_MIN 20000000 /* Get the implementation-specific values for the above. */ #include #ifndef SSIZE_MAX # define SSIZE_MAX LONG_MAX #endif /* This value is a guaranteed minimum maximum. The current maximum can be got from `sysconf'. */ #ifndef NGROUPS_MAX # define NGROUPS_MAX 8 #endif #endif /* bits/posix1_lim.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/posix2_lim.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; include instead. */ #ifndef _BITS_POSIX2_LIM_H #define _BITS_POSIX2_LIM_H 1 /* The maximum `ibase' and `obase' values allowed by the `bc' utility. */ #define _POSIX2_BC_BASE_MAX 99 /* The maximum number of elements allowed in an array by the `bc' utility. */ #define _POSIX2_BC_DIM_MAX 2048 /* The maximum `scale' value allowed by the `bc' utility. */ #define _POSIX2_BC_SCALE_MAX 99 /* The maximum length of a string constant accepted by the `bc' utility. */ #define _POSIX2_BC_STRING_MAX 1000 /* The maximum number of weights that can be assigned to an entry of the LC_COLLATE `order' keyword in the locale definition file. */ #define _POSIX2_COLL_WEIGHTS_MAX 2 /* The maximum number of expressions that can be nested within parentheses by the `expr' utility. */ #define _POSIX2_EXPR_NEST_MAX 32 /* The maximum length, in bytes, of an input line. */ #define _POSIX2_LINE_MAX 2048 /* The maximum number of repeated occurrences of a regular expression permitted when using the interval notation `\{M,N\}'. */ #define _POSIX2_RE_DUP_MAX 255 /* The maximum number of bytes in a character class name. We have no fixed limit, 2048 is a high number. */ #define _POSIX2_CHARCLASS_NAME_MAX 14 /* These values are implementation-specific, and may vary within the implementation. Their precise values can be obtained from sysconf. */ #ifndef BC_BASE_MAX #define BC_BASE_MAX _POSIX2_BC_BASE_MAX #endif #ifndef BC_DIM_MAX #define BC_DIM_MAX _POSIX2_BC_DIM_MAX #endif #ifndef BC_SCALE_MAX #define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX #endif #ifndef BC_STRING_MAX #define BC_STRING_MAX _POSIX2_BC_STRING_MAX #endif #ifndef COLL_WEIGHTS_MAX #define COLL_WEIGHTS_MAX 255 #endif #ifndef EXPR_NEST_MAX #define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX #endif #ifndef LINE_MAX #define LINE_MAX _POSIX2_LINE_MAX #endif #ifndef CHARCLASS_NAME_MAX #define CHARCLASS_NAME_MAX 2048 #endif /* This value is defined like this in regex.h. */ #define RE_DUP_MAX (0x7fff) #endif /* bits/posix2_lim.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/posix_opt.h ================================================ /* Define POSIX options for Linux. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see . */ #ifndef _BITS_POSIX_OPT_H #define _BITS_POSIX_OPT_H 1 /* Job control is supported. */ #define _POSIX_JOB_CONTROL 1 /* Processes have a saved set-user-ID and a saved set-group-ID. */ #define _POSIX_SAVED_IDS 1 /* Priority scheduling is supported. */ #define _POSIX_PRIORITY_SCHEDULING 200809L /* Synchronizing file data is supported. */ #define _POSIX_SYNCHRONIZED_IO 200809L /* The fsync function is present. */ #define _POSIX_FSYNC 200809L /* Mapping of files to memory is supported. */ #define _POSIX_MAPPED_FILES 200809L /* Locking of all memory is supported. */ #define _POSIX_MEMLOCK 200809L /* Locking of ranges of memory is supported. */ #define _POSIX_MEMLOCK_RANGE 200809L /* Setting of memory protections is supported. */ #define _POSIX_MEMORY_PROTECTION 200809L /* Some filesystems allow all users to change file ownership. */ #define _POSIX_CHOWN_RESTRICTED 0 /* `c_cc' member of 'struct termios' structure can be disabled by using the value _POSIX_VDISABLE. */ #define _POSIX_VDISABLE '\0' /* Filenames are not silently truncated. */ #define _POSIX_NO_TRUNC 1 /* X/Open realtime support is available. */ #define _XOPEN_REALTIME 1 /* X/Open thread realtime support is available. */ #define _XOPEN_REALTIME_THREADS 1 /* XPG4.2 shared memory is supported. */ #define _XOPEN_SHM 1 /* Tell we have POSIX threads. */ #define _POSIX_THREADS 200809L /* We have the reentrant functions described in POSIX. */ #define _POSIX_REENTRANT_FUNCTIONS 1 #define _POSIX_THREAD_SAFE_FUNCTIONS 200809L /* We provide priority scheduling for threads. */ #define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L /* We support user-defined stack sizes. */ #define _POSIX_THREAD_ATTR_STACKSIZE 200809L /* We support user-defined stacks. */ #define _POSIX_THREAD_ATTR_STACKADDR 200809L /* We support priority inheritence. */ #define _POSIX_THREAD_PRIO_INHERIT 200809L /* We support priority protection, though only for non-robust mutexes. */ #define _POSIX_THREAD_PRIO_PROTECT 200809L #ifdef __USE_XOPEN2K8 /* We support priority inheritence for robust mutexes. */ # define _POSIX_THREAD_ROBUST_PRIO_INHERIT 200809L /* We do not support priority protection for robust mutexes. */ # define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1 #endif /* We support POSIX.1b semaphores. */ #define _POSIX_SEMAPHORES 200809L /* Real-time signals are supported. */ #define _POSIX_REALTIME_SIGNALS 200809L /* We support asynchronous I/O. */ #define _POSIX_ASYNCHRONOUS_IO 200809L #define _POSIX_ASYNC_IO 1 /* Alternative name for Unix98. */ #define _LFS_ASYNCHRONOUS_IO 1 /* Support for prioritization is also available. */ #define _POSIX_PRIORITIZED_IO 200809L /* The LFS support in asynchronous I/O is also available. */ #define _LFS64_ASYNCHRONOUS_IO 1 /* The rest of the LFS is also available. */ #define _LFS_LARGEFILE 1 #define _LFS64_LARGEFILE 1 #define _LFS64_STDIO 1 /* POSIX shared memory objects are implemented. */ #define _POSIX_SHARED_MEMORY_OBJECTS 200809L /* CPU-time clocks support needs to be checked at runtime. */ #define _POSIX_CPUTIME 0 /* Clock support in threads must be also checked at runtime. */ #define _POSIX_THREAD_CPUTIME 0 /* GNU libc provides regular expression handling. */ #define _POSIX_REGEXP 1 /* Reader/Writer locks are available. */ #define _POSIX_READER_WRITER_LOCKS 200809L /* We have a POSIX shell. */ #define _POSIX_SHELL 1 /* We support the Timeouts option. */ #define _POSIX_TIMEOUTS 200809L /* We support spinlocks. */ #define _POSIX_SPIN_LOCKS 200809L /* The `spawn' function family is supported. */ #define _POSIX_SPAWN 200809L /* We have POSIX timers. */ #define _POSIX_TIMERS 200809L /* The barrier functions are available. */ #define _POSIX_BARRIERS 200809L /* POSIX message queues are available. */ #define _POSIX_MESSAGE_PASSING 200809L /* Thread process-shared synchronization is supported. */ #define _POSIX_THREAD_PROCESS_SHARED 200809L /* The monotonic clock might be available. */ #define _POSIX_MONOTONIC_CLOCK 0 /* The clock selection interfaces are available. */ #define _POSIX_CLOCK_SELECTION 200809L /* Advisory information interfaces are available. */ #define _POSIX_ADVISORY_INFO 200809L /* IPv6 support is available. */ #define _POSIX_IPV6 200809L /* Raw socket support is available. */ #define _POSIX_RAW_SOCKETS 200809L /* We have at least one terminal. */ #define _POSIX2_CHAR_TERM 200809L /* Neither process nor thread sporadic server interfaces is available. */ #define _POSIX_SPORADIC_SERVER -1 #define _POSIX_THREAD_SPORADIC_SERVER -1 /* trace.h is not available. */ #define _POSIX_TRACE -1 #define _POSIX_TRACE_EVENT_FILTER -1 #define _POSIX_TRACE_INHERIT -1 #define _POSIX_TRACE_LOG -1 /* Typed memory objects are not available. */ #define _POSIX_TYPED_MEMORY_OBJECTS -1 #endif /* bits/posix_opt.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/pthreadtypes-arch.h ================================================ /* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_PTHREADTYPES_ARCH_H #define _BITS_PTHREADTYPES_ARCH_H 1 #include #ifdef __x86_64__ # if __WORDSIZE == 64 # define __SIZEOF_PTHREAD_MUTEX_T 40 # define __SIZEOF_PTHREAD_ATTR_T 56 # define __SIZEOF_PTHREAD_MUTEX_T 40 # define __SIZEOF_PTHREAD_RWLOCK_T 56 # define __SIZEOF_PTHREAD_BARRIER_T 32 # else # define __SIZEOF_PTHREAD_MUTEX_T 32 # define __SIZEOF_PTHREAD_ATTR_T 32 # define __SIZEOF_PTHREAD_MUTEX_T 32 # define __SIZEOF_PTHREAD_RWLOCK_T 44 # define __SIZEOF_PTHREAD_BARRIER_T 20 # endif #else # define __SIZEOF_PTHREAD_MUTEX_T 24 # define __SIZEOF_PTHREAD_ATTR_T 36 # define __SIZEOF_PTHREAD_MUTEX_T 24 # define __SIZEOF_PTHREAD_RWLOCK_T 32 # define __SIZEOF_PTHREAD_BARRIER_T 20 #endif #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 #define __SIZEOF_PTHREAD_COND_T 48 #define __SIZEOF_PTHREAD_CONDATTR_T 4 #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 /* Definitions for internal mutex struct. */ #define __PTHREAD_COMPAT_PADDING_MID #define __PTHREAD_COMPAT_PADDING_END #define __PTHREAD_MUTEX_LOCK_ELISION 1 #ifdef __x86_64__ # define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0 # define __PTHREAD_MUTEX_USE_UNION 0 #else # define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1 # define __PTHREAD_MUTEX_USE_UNION 1 #endif #define __LOCK_ALIGNMENT #define __ONCE_ALIGNMENT struct __pthread_rwlock_arch_t { unsigned int __readers; unsigned int __writers; unsigned int __wrphase_futex; unsigned int __writers_futex; unsigned int __pad3; unsigned int __pad4; #ifdef __x86_64__ int __cur_writer; int __shared; signed char __rwelision; # ifdef __ILP32__ unsigned char __pad1[3]; # define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0 } # else unsigned char __pad1[7]; # define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0, 0, 0, 0, 0 } # endif unsigned long int __pad2; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned int __flags; # define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 #else /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned char __flags; unsigned char __shared; signed char __rwelision; # define __PTHREAD_RWLOCK_ELISION_EXTRA 0 unsigned char __pad2; int __cur_writer; #endif }; #ifndef __x86_64__ /* Extra attributes for the cleanup functions. */ # define __cleanup_fct_attribute __attribute__ ((__regparm__ (1))) #endif #endif /* bits/pthreadtypes.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/pthreadtypes.h ================================================ /* Declaration of common pthread types for all architectures. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_PTHREADTYPES_COMMON_H # define _BITS_PTHREADTYPES_COMMON_H 1 /* For internal mutex and condition variable definitions. */ #include /* Thread identifiers. The structure of the attribute type is not exposed on purpose. */ typedef unsigned long int pthread_t; /* Data structures for mutex handling. The structure of the attribute type is not exposed on purpose. */ typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; int __align; } pthread_mutexattr_t; /* Data structure for condition variable handling. The structure of the attribute type is not exposed on purpose. */ typedef union { char __size[__SIZEOF_PTHREAD_CONDATTR_T]; int __align; } pthread_condattr_t; /* Keys for thread-specific data */ typedef unsigned int pthread_key_t; /* Once-only execution */ typedef int __ONCE_ALIGNMENT pthread_once_t; union pthread_attr_t { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; }; #ifndef __have_pthread_attr_t typedef union pthread_attr_t pthread_attr_t; # define __have_pthread_attr_t 1 #endif typedef union { struct __pthread_mutex_s __data; char __size[__SIZEOF_PTHREAD_MUTEX_T]; long int __align; } pthread_mutex_t; typedef union { struct __pthread_cond_s __data; char __size[__SIZEOF_PTHREAD_COND_T]; __extension__ long long int __align; } pthread_cond_t; #if defined __USE_UNIX98 || defined __USE_XOPEN2K /* Data structure for reader-writer lock variable handling. The structure of the attribute type is deliberately not exposed. */ typedef union { struct __pthread_rwlock_arch_t __data; char __size[__SIZEOF_PTHREAD_RWLOCK_T]; long int __align; } pthread_rwlock_t; typedef union { char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; long int __align; } pthread_rwlockattr_t; #endif #ifdef __USE_XOPEN2K /* POSIX spinlock data type. */ typedef volatile int pthread_spinlock_t; /* POSIX barriers data type. The structure of the type is deliberately not exposed. */ typedef union { char __size[__SIZEOF_PTHREAD_BARRIER_T]; long int __align; } pthread_barrier_t; typedef union { char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; int __align; } pthread_barrierattr_t; #endif #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/resource.h ================================================ /* Bit values & structures for resource limits. Linux version. Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_RESOURCE_H # error "Never use directly; include instead." #endif #include /* Transmute defines to enumerations. The macro re-definitions are necessary because some programs want to test for operating system features with #ifdef RUSAGE_SELF. In ISO C the reflexive definition is a no-op. */ /* Kinds of resource limit. */ enum __rlimit_resource { /* Per-process CPU limit, in seconds. */ RLIMIT_CPU = 0, #define RLIMIT_CPU RLIMIT_CPU /* Largest file that can be created, in bytes. */ RLIMIT_FSIZE = 1, #define RLIMIT_FSIZE RLIMIT_FSIZE /* Maximum size of data segment, in bytes. */ RLIMIT_DATA = 2, #define RLIMIT_DATA RLIMIT_DATA /* Maximum size of stack segment, in bytes. */ RLIMIT_STACK = 3, #define RLIMIT_STACK RLIMIT_STACK /* Largest core file that can be created, in bytes. */ RLIMIT_CORE = 4, #define RLIMIT_CORE RLIMIT_CORE /* Largest resident set size, in bytes. This affects swapping; processes that are exceeding their resident set size will be more likely to have physical memory taken from them. */ __RLIMIT_RSS = 5, #define RLIMIT_RSS __RLIMIT_RSS /* Number of open files. */ RLIMIT_NOFILE = 7, __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ #define RLIMIT_NOFILE RLIMIT_NOFILE #define RLIMIT_OFILE __RLIMIT_OFILE /* Address space limit. */ RLIMIT_AS = 9, #define RLIMIT_AS RLIMIT_AS /* Number of processes. */ __RLIMIT_NPROC = 6, #define RLIMIT_NPROC __RLIMIT_NPROC /* Locked-in-memory address space. */ __RLIMIT_MEMLOCK = 8, #define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK /* Maximum number of file locks. */ __RLIMIT_LOCKS = 10, #define RLIMIT_LOCKS __RLIMIT_LOCKS /* Maximum number of pending signals. */ __RLIMIT_SIGPENDING = 11, #define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING /* Maximum bytes in POSIX message queues. */ __RLIMIT_MSGQUEUE = 12, #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE /* Maximum nice priority allowed to raise to. Nice levels 19 .. -20 correspond to 0 .. 39 values of this resource limit. */ __RLIMIT_NICE = 13, #define RLIMIT_NICE __RLIMIT_NICE /* Maximum realtime priority allowed for non-priviledged processes. */ __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO /* Maximum CPU time in µs that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, #define RLIMIT_RTTIME __RLIMIT_RTTIME __RLIMIT_NLIMITS = 16, __RLIM_NLIMITS = __RLIMIT_NLIMITS #define RLIMIT_NLIMITS __RLIMIT_NLIMITS #define RLIM_NLIMITS __RLIM_NLIMITS }; /* Value to indicate that there is no limit. */ #ifndef __USE_FILE_OFFSET64 # define RLIM_INFINITY ((__rlim_t) -1) #else # define RLIM_INFINITY 0xffffffffffffffffuLL #endif #ifdef __USE_LARGEFILE64 # define RLIM64_INFINITY 0xffffffffffffffffuLL #endif /* We can represent all limits. */ #define RLIM_SAVED_MAX RLIM_INFINITY #define RLIM_SAVED_CUR RLIM_INFINITY /* Type for resource quantity measurement. */ #ifndef __USE_FILE_OFFSET64 typedef __rlim_t rlim_t; #else typedef __rlim64_t rlim_t; #endif #ifdef __USE_LARGEFILE64 typedef __rlim64_t rlim64_t; #endif struct rlimit { /* The current (soft) limit. */ rlim_t rlim_cur; /* The hard limit. */ rlim_t rlim_max; }; #ifdef __USE_LARGEFILE64 struct rlimit64 { /* The current (soft) limit. */ rlim64_t rlim_cur; /* The hard limit. */ rlim64_t rlim_max; }; #endif /* Whose usage statistics do you want? */ enum __rusage_who { /* The calling process. */ RUSAGE_SELF = 0, #define RUSAGE_SELF RUSAGE_SELF /* All of its terminated child processes. */ RUSAGE_CHILDREN = -1 #define RUSAGE_CHILDREN RUSAGE_CHILDREN #ifdef __USE_GNU , /* The calling thread. */ RUSAGE_THREAD = 1 # define RUSAGE_THREAD RUSAGE_THREAD /* Name for the same functionality on Solaris. */ # define RUSAGE_LWP RUSAGE_THREAD #endif }; #include #include /* Priority limits. */ #define PRIO_MIN -20 /* Minimum priority a process can have. */ #define PRIO_MAX 20 /* Maximum priority a process can have. */ /* The type of the WHICH argument to `getpriority' and `setpriority', indicating what flavor of entity the WHO argument specifies. */ enum __priority_which { PRIO_PROCESS = 0, /* WHO is a process ID. */ #define PRIO_PROCESS PRIO_PROCESS PRIO_PGRP = 1, /* WHO is a process group ID. */ #define PRIO_PGRP PRIO_PGRP PRIO_USER = 2 /* WHO is a user ID. */ #define PRIO_USER PRIO_USER }; __BEGIN_DECLS #ifdef __USE_GNU /* Modify and return resource limits of a process atomically. */ # ifndef __USE_FILE_OFFSET64 extern int prlimit(__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit *__new_limit, struct rlimit *__old_limit) __THROW; # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(prlimit, (__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit * __new_limit, struct rlimit * __old_limit), prlimit64); # else # define prlimit prlimit64 # endif # endif # ifdef __USE_LARGEFILE64 extern int prlimit64(__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit64 *__new_limit, struct rlimit64 *__old_limit) __THROW; # endif #endif __END_DECLS ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/sched.h ================================================ /* Definitions of constants and data structure for POSIX 1003.1b-1993 scheduling interface. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_SCHED_H #define _BITS_SCHED_H 1 #ifndef _SCHED_H # error "Never include directly; use instead." #endif /* Scheduling algorithms. */ #define SCHED_OTHER 0 #define SCHED_FIFO 1 #define SCHED_RR 2 #ifdef __USE_GNU # define SCHED_BATCH 3 # define SCHED_ISO 4 # define SCHED_IDLE 5 # define SCHED_DEADLINE 6 # define SCHED_RESET_ON_FORK 0x40000000 #endif #ifdef __USE_GNU /* Cloning flags. */ # define CSIGNAL 0x000000ff /* Signal mask to be sent at exit. */ # define CLONE_VM 0x00000100 /* Set if VM shared between processes. */ # define CLONE_FS 0x00000200 /* Set if fs info shared between processes. */ # define CLONE_FILES 0x00000400 /* Set if open files shared between processes. */ # define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared. */ # define CLONE_PTRACE 0x00002000 /* Set if tracing continues on the child. */ # define CLONE_VFORK 0x00004000 /* Set if the parent wants the child to wake it up on mm_release. */ # define CLONE_PARENT 0x00008000 /* Set if we want to have the same parent as the cloner. */ # define CLONE_THREAD 0x00010000 /* Set to add to same thread group. */ # define CLONE_NEWNS 0x00020000 /* Set to create new namespace. */ # define CLONE_SYSVSEM 0x00040000 /* Set to shared SVID SEM_UNDO semantics. */ # define CLONE_SETTLS 0x00080000 /* Set TLS info. */ # define CLONE_PARENT_SETTID 0x00100000 /* Store TID in userlevel buffer before MM copy. */ # define CLONE_CHILD_CLEARTID 0x00200000 /* Register exit futex and memory location to clear. */ # define CLONE_DETACHED 0x00400000 /* Create clone detached. */ # define CLONE_UNTRACED 0x00800000 /* Set if the tracing process can't force CLONE_PTRACE on this clone. */ # define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in the child. */ # define CLONE_NEWCGROUP 0x02000000 /* New cgroup namespace. */ # define CLONE_NEWUTS 0x04000000 /* New utsname group. */ # define CLONE_NEWIPC 0x08000000 /* New ipcs. */ # define CLONE_NEWUSER 0x10000000 /* New user namespace. */ # define CLONE_NEWPID 0x20000000 /* New pid namespace. */ # define CLONE_NEWNET 0x40000000 /* New network namespace. */ # define CLONE_IO 0x80000000 /* Clone I/O context. */ #endif /* Data structure to describe a process' schedulability. */ struct sched_param { int sched_priority; }; __BEGIN_DECLS #ifdef __USE_GNU /* Clone current process. */ extern int clone(int (*__fn) (void *__arg), void *__child_stack, int __flags, void *__arg, ...) __THROW; /* Unshare the specified resources. */ extern int unshare(int __flags) __THROW; /* Get index of currently used CPU. */ extern int sched_getcpu(void) __THROW; /* Switch process to namespace of type NSTYPE indicated by FD. */ extern int setns(int __fd, int __nstype) __THROW; #endif __END_DECLS #endif /* bits/sched.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/select.h ================================================ /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SELECT_H # error "Never use directly; include instead." #endif #include #if defined __GNUC__ && __GNUC__ >= 2 # if __WORDSIZE == 64 # define __FD_ZERO_STOS "stosq" # else # define __FD_ZERO_STOS "stosl" # endif # define __FD_ZERO(fdsp) \ do { \ int __d0, __d1; \ __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ : "=c" (__d0), "=D" (__d1) \ : "a" (0), "0" (sizeof (fd_set) \ / sizeof (__fd_mask)), \ "1" (&__FDS_BITS (fdsp)[0]) \ : "memory"); \ } while (0) #else /* ! GNU CC */ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ # define __FD_ZERO(set) \ do { \ unsigned int __i; \ fd_set *__arr = (set); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) #endif /* GNU CC */ #define __FD_SET(d, set) \ ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) #define __FD_CLR(d, set) \ ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) #define __FD_ISSET(d, set) \ ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/setjmp.h ================================================ /* Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* Define the machine-dependent type `jmp_buf'. x86-64 version. */ #ifndef _BITS_SETJMP_H #define _BITS_SETJMP_H 1 #if !defined _SETJMP_H && !defined _PTHREAD_H # error "Never include directly; use instead." #endif #include #ifndef _ASM # if __WORDSIZE == 64 typedef long int __jmp_buf[8]; # elif defined __x86_64__ __extension__ typedef long long int __jmp_buf[8]; # else typedef int __jmp_buf[6]; # endif #endif #endif /* bits/setjmp.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/sigaction.h ================================================ /* The proper definitions for Linux's sigaction. Copyright (C) 1993-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SIGNAL_H # error "Never include directly; use instead." #endif /* Structure describing the action to be taken when a signal arrives. */ struct sigaction { /* Signal handler. */ #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED union { /* Used if SA_SIGINFO is not set. */ __sighandler_t sa_handler; /* Used if SA_SIGINFO is set. */ void (*sa_sigaction) (int, siginfo_t *, void *); } __sigaction_handler; # define sa_handler __sigaction_handler.sa_handler # define sa_sigaction __sigaction_handler.sa_sigaction #else __sighandler_t sa_handler; #endif /* Additional set of signals to be blocked. */ __sigset_t sa_mask; /* Special flags. */ int sa_flags; /* Restore handler. */ void (*sa_restorer) (void); }; /* Bits in `sa_flags'. */ #define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */ #define SA_NOCLDWAIT 2 /* Don't create zombie on child death. */ #define SA_SIGINFO 4 /* Invoke signal-catching function with three arguments instead of one. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_MISC # define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 # define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ # define SA_NODEFER 0x40000000 /* Don't automatically block the signal when its handler is being executed. */ # define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ #endif #ifdef __USE_MISC # define SA_INTERRUPT 0x20000000 /* Historical no-op. */ /* Some aliases for the SA_ constants. */ # define SA_NOMASK SA_NODEFER # define SA_ONESHOT SA_RESETHAND # define SA_STACK SA_ONSTACK #endif /* Values for the HOW argument to `sigprocmask'. */ #define SIG_BLOCK 0 /* Block signals. */ #define SIG_UNBLOCK 1 /* Unblock signals. */ #define SIG_SETMASK 2 /* Set the set of blocked signals. */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/sigcontext.h ================================================ /* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_SIGCONTEXT_H #define _BITS_SIGCONTEXT_H 1 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H # error "Never use directly; include instead." #endif #include #define FP_XSTATE_MAGIC1 0x46505853U #define FP_XSTATE_MAGIC2 0x46505845U #define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2) struct _fpx_sw_bytes { __uint32_t magic1; __uint32_t extended_size; __uint64_t xstate_bv; __uint32_t xstate_size; __uint32_t __glibc_reserved1[7]; }; struct _fpreg { unsigned short significand[4]; unsigned short exponent; }; struct _fpxreg { unsigned short significand[4]; unsigned short exponent; unsigned short __glibc_reserved1[3]; }; struct _xmmreg { __uint32_t element[4]; }; #ifndef __x86_64__ struct _fpstate { /* Regular FPU environment. */ __uint32_t cw; __uint32_t sw; __uint32_t tag; __uint32_t ipoff; __uint32_t cssel; __uint32_t dataoff; __uint32_t datasel; struct _fpreg _st[8]; unsigned short status; unsigned short magic; /* FXSR FPU environment. */ __uint32_t _fxsr_env[6]; __uint32_t mxcsr; __uint32_t __glibc_reserved1; struct _fpxreg _fxsr_st[8]; struct _xmmreg _xmm[8]; __uint32_t __glibc_reserved2[56]; }; #ifndef sigcontext_struct /* Kernel headers before 2.1.1 define a struct sigcontext_struct, but we need sigcontext. Some packages have come to rely on sigcontext_struct being defined on 32-bit x86, so define this for their benefit. */ # define sigcontext_struct sigcontext #endif #define X86_FXSR_MAGIC 0x0000 struct sigcontext { unsigned short gs, __gsh; unsigned short fs, __fsh; unsigned short es, __esh; unsigned short ds, __dsh; unsigned long edi; unsigned long esi; unsigned long ebp; unsigned long esp; unsigned long ebx; unsigned long edx; unsigned long ecx; unsigned long eax; unsigned long trapno; unsigned long err; unsigned long eip; unsigned short cs, __csh; unsigned long eflags; unsigned long esp_at_signal; unsigned short ss, __ssh; struct _fpstate *fpstate; unsigned long oldmask; unsigned long cr2; }; #else /* __x86_64__ */ struct _fpstate { /* FPU environment matching the 64-bit FXSAVE layout. */ __uint16_t cwd; __uint16_t swd; __uint16_t ftw; __uint16_t fop; __uint64_t rip; __uint64_t rdp; __uint32_t mxcsr; __uint32_t mxcr_mask; struct _fpxreg _st[8]; struct _xmmreg _xmm[16]; __uint32_t __glibc_reserved1[24]; }; struct sigcontext { __uint64_t r8; __uint64_t r9; __uint64_t r10; __uint64_t r11; __uint64_t r12; __uint64_t r13; __uint64_t r14; __uint64_t r15; __uint64_t rdi; __uint64_t rsi; __uint64_t rbp; __uint64_t rbx; __uint64_t rdx; __uint64_t rax; __uint64_t rcx; __uint64_t rsp; __uint64_t rip; __uint64_t eflags; unsigned short cs; unsigned short gs; unsigned short fs; unsigned short __pad0; __uint64_t err; __uint64_t trapno; __uint64_t oldmask; __uint64_t cr2; __extension__ union { struct _fpstate *fpstate; __uint64_t __fpstate_word; }; __uint64_t __reserved1[8]; }; #endif /* __x86_64__ */ struct _xsave_hdr { __uint64_t xstate_bv; __uint64_t __glibc_reserved1[2]; __uint64_t __glibc_reserved2[5]; }; struct _ymmh_state { __uint32_t ymmh_space[64]; }; struct _xstate { struct _fpstate fpstate; struct _xsave_hdr xstate_hdr; struct _ymmh_state ymmh; }; #endif /* _BITS_SIGCONTEXT_H */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/sigevent-consts.h ================================================ /* sigevent constants. Linux version. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_SIGEVENT_CONSTS_H #define _BITS_SIGEVENT_CONSTS_H 1 #if !defined _SIGNAL_H && !defined _AIO_H #error "Don't include directly; use instead." #endif /* `sigev_notify' values. */ enum { SIGEV_SIGNAL = 0, /* Notify via signal. */ # define SIGEV_SIGNAL SIGEV_SIGNAL SIGEV_NONE, /* Other notification: meaningless. */ # define SIGEV_NONE SIGEV_NONE SIGEV_THREAD, /* Deliver via thread creation. */ # define SIGEV_THREAD SIGEV_THREAD SIGEV_THREAD_ID = 4 /* Send signal to specific thread. This is a Linux extension. */ #define SIGEV_THREAD_ID SIGEV_THREAD_ID }; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/siginfo-arch.h ================================================ /* Architecture-specific adjustments to siginfo_t. x86 version. */ #ifndef _BITS_SIGINFO_ARCH_H #define _BITS_SIGINFO_ARCH_H 1 #if defined __x86_64__ && __WORDSIZE == 32 /* si_utime and si_stime must be 4 byte aligned for x32 to match the kernel. We align siginfo_t to 8 bytes so that si_utime and si_stime are actually aligned to 8 bytes since their offsets are multiple of 8 bytes. Note: with some compilers, the alignment attribute would be ignored if it were put in __SI_CLOCK_T instead of encapsulated in a typedef. */ typedef __clock_t __attribute__ ((__aligned__(4))) __sigchld_clock_t; # define __SI_ALIGNMENT __attribute__ ((__aligned__ (8))) # define __SI_CLOCK_T __sigchld_clock_t #endif #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/siginfo-consts.h ================================================ /* siginfo constants. Linux version. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_SIGINFO_CONSTS_H #define _BITS_SIGINFO_CONSTS_H 1 #ifndef _SIGNAL_H #error "Don't include directly; use instead." #endif /* Most of these constants are uniform across all architectures, but there is one exception. */ #include #ifndef __SI_ASYNCIO_AFTER_SIGIO # define __SI_ASYNCIO_AFTER_SIGIO 1 #endif /* Values for `si_code'. Positive values are reserved for kernel-generated signals. */ enum { SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */ SI_TKILL = -6, /* Sent by tkill. */ SI_SIGIO, /* Sent by queued SIGIO. */ #if __SI_ASYNCIO_AFTER_SIGIO SI_ASYNCIO, /* Sent by AIO completion. */ SI_MESGQ, /* Sent by real time mesq state change. */ SI_TIMER, /* Sent by timer expiration. */ #else SI_MESGQ, SI_TIMER, SI_ASYNCIO, #endif SI_QUEUE, /* Sent by sigqueue. */ SI_USER, /* Sent by kill, sigsend. */ SI_KERNEL = 0x80 /* Send by kernel. */ #define SI_ASYNCNL SI_ASYNCNL #define SI_TKILL SI_TKILL #define SI_SIGIO SI_SIGIO #define SI_ASYNCIO SI_ASYNCIO #define SI_MESGQ SI_MESGQ #define SI_TIMER SI_TIMER #define SI_ASYNCIO SI_ASYNCIO #define SI_QUEUE SI_QUEUE #define SI_USER SI_USER #define SI_KERNEL SI_KERNEL }; # if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* `si_code' values for SIGILL signal. */ enum { ILL_ILLOPC = 1, /* Illegal opcode. */ # define ILL_ILLOPC ILL_ILLOPC ILL_ILLOPN, /* Illegal operand. */ # define ILL_ILLOPN ILL_ILLOPN ILL_ILLADR, /* Illegal addressing mode. */ # define ILL_ILLADR ILL_ILLADR ILL_ILLTRP, /* Illegal trap. */ # define ILL_ILLTRP ILL_ILLTRP ILL_PRVOPC, /* Privileged opcode. */ # define ILL_PRVOPC ILL_PRVOPC ILL_PRVREG, /* Privileged register. */ # define ILL_PRVREG ILL_PRVREG ILL_COPROC, /* Coprocessor error. */ # define ILL_COPROC ILL_COPROC ILL_BADSTK /* Internal stack error. */ # define ILL_BADSTK ILL_BADSTK }; /* `si_code' values for SIGFPE signal. */ enum { FPE_INTDIV = 1, /* Integer divide by zero. */ # define FPE_INTDIV FPE_INTDIV FPE_INTOVF, /* Integer overflow. */ # define FPE_INTOVF FPE_INTOVF FPE_FLTDIV, /* Floating point divide by zero. */ # define FPE_FLTDIV FPE_FLTDIV FPE_FLTOVF, /* Floating point overflow. */ # define FPE_FLTOVF FPE_FLTOVF FPE_FLTUND, /* Floating point underflow. */ # define FPE_FLTUND FPE_FLTUND FPE_FLTRES, /* Floating point inexact result. */ # define FPE_FLTRES FPE_FLTRES FPE_FLTINV, /* Floating point invalid operation. */ # define FPE_FLTINV FPE_FLTINV FPE_FLTSUB /* Subscript out of range. */ # define FPE_FLTSUB FPE_FLTSUB }; /* `si_code' values for SIGSEGV signal. */ enum { SEGV_MAPERR = 1, /* Address not mapped to object. */ # define SEGV_MAPERR SEGV_MAPERR SEGV_ACCERR, /* Invalid permissions for mapped object. */ # define SEGV_ACCERR SEGV_ACCERR SEGV_BNDERR, /* Bounds checking failure. */ # define SEGV_BNDERR SEGV_BNDERR SEGV_PKUERR /* Protection key checking failure. */ # define SEGV_PKUERR SEGV_PKUERR }; /* `si_code' values for SIGBUS signal. */ enum { BUS_ADRALN = 1, /* Invalid address alignment. */ # define BUS_ADRALN BUS_ADRALN BUS_ADRERR, /* Non-existant physical address. */ # define BUS_ADRERR BUS_ADRERR BUS_OBJERR, /* Object specific hardware error. */ # define BUS_OBJERR BUS_OBJERR BUS_MCEERR_AR, /* Hardware memory error: action required. */ # define BUS_MCEERR_AR BUS_MCEERR_AR BUS_MCEERR_AO /* Hardware memory error: action optional. */ # define BUS_MCEERR_AO BUS_MCEERR_AO }; # endif # ifdef __USE_XOPEN_EXTENDED /* `si_code' values for SIGTRAP signal. */ enum { TRAP_BRKPT = 1, /* Process breakpoint. */ # define TRAP_BRKPT TRAP_BRKPT TRAP_TRACE /* Process trace trap. */ # define TRAP_TRACE TRAP_TRACE }; # endif # if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* `si_code' values for SIGCHLD signal. */ enum { CLD_EXITED = 1, /* Child has exited. */ # define CLD_EXITED CLD_EXITED CLD_KILLED, /* Child was killed. */ # define CLD_KILLED CLD_KILLED CLD_DUMPED, /* Child terminated abnormally. */ # define CLD_DUMPED CLD_DUMPED CLD_TRAPPED, /* Traced child has trapped. */ # define CLD_TRAPPED CLD_TRAPPED CLD_STOPPED, /* Child has stopped. */ # define CLD_STOPPED CLD_STOPPED CLD_CONTINUED /* Stopped child has continued. */ # define CLD_CONTINUED CLD_CONTINUED }; /* `si_code' values for SIGPOLL signal. */ enum { POLL_IN = 1, /* Data input available. */ # define POLL_IN POLL_IN POLL_OUT, /* Output buffers available. */ # define POLL_OUT POLL_OUT POLL_MSG, /* Input message available. */ # define POLL_MSG POLL_MSG POLL_ERR, /* I/O error. */ # define POLL_ERR POLL_ERR POLL_PRI, /* High priority input available. */ # define POLL_PRI POLL_PRI POLL_HUP /* Device disconnected. */ # define POLL_HUP POLL_HUP }; # endif /* Architectures might also add architecture-specific constants. These are all considered GNU extensions. */ #ifdef __USE_GNU # include #endif #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/signum-generic.h ================================================ /* Signal number constants. Generic template. Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_SIGNUM_GENERIC_H #define _BITS_SIGNUM_GENERIC_H 1 #ifndef _SIGNAL_H #error "Never include directly; use instead." #endif /* Fake signal functions. */ #define SIG_ERR ((__sighandler_t) -1) /* Error return. */ #define SIG_DFL ((__sighandler_t) 0) /* Default action. */ #define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ #ifdef __USE_XOPEN # define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */ #endif /* We define here all the signal names listed in POSIX (1003.1-2008); as of 1003.1-2013, no additional signals have been added by POSIX. We also define here signal names that historically exist in every real-world POSIX variant (e.g. SIGWINCH). Signals in the 1-15 range are defined with their historical numbers. For other signals, we use the BSD numbers. There are two unallocated signal numbers in the 1-31 range: 7 and 29. Signal number 0 is reserved for use as kill(pid, 0), to test whether a process exists without sending it a signal. */ /* ISO C99 signals. */ #define SIGINT 2 /* Interactive attention signal. */ #define SIGILL 4 /* Illegal instruction. */ #define SIGABRT 6 /* Abnormal termination. */ #define SIGFPE 8 /* Erroneous arithmetic operation. */ #define SIGSEGV 11 /* Invalid access to storage. */ #define SIGTERM 15 /* Termination request. */ /* Historical signals specified by POSIX. */ #define SIGHUP 1 /* Hangup. */ #define SIGQUIT 3 /* Quit. */ #define SIGTRAP 5 /* Trace/breakpoint trap. */ #define SIGKILL 9 /* Killed. */ #define SIGBUS 10 /* Bus error. */ #define SIGSYS 12 /* Bad system call. */ #define SIGPIPE 13 /* Broken pipe. */ #define SIGALRM 14 /* Alarm clock. */ /* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ #define SIGURG 16 /* Urgent data is available at a socket. */ #define SIGSTOP 17 /* Stop, unblockable. */ #define SIGTSTP 18 /* Keyboard stop. */ #define SIGCONT 19 /* Continue. */ #define SIGCHLD 20 /* Child terminated or stopped. */ #define SIGTTIN 21 /* Background read from control terminal. */ #define SIGTTOU 22 /* Background write to control terminal. */ #define SIGPOLL 23 /* Pollable event occurred (System V). */ #define SIGXCPU 24 /* CPU time limit exceeded. */ #define SIGXFSZ 25 /* File size limit exceeded. */ #define SIGVTALRM 26 /* Virtual timer expired. */ #define SIGPROF 27 /* Profiling timer expired. */ #define SIGUSR1 30 /* User-defined signal 1. */ #define SIGUSR2 31 /* User-defined signal 2. */ /* Nonstandard signals found in all modern POSIX systems (including both BSD and Linux). */ #define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ /* Archaic names for compatibility. */ #define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ #define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP-11. */ #define SIGCLD SIGCHLD /* Old System V name */ /* Not all systems support real-time signals. bits/signum.h indicates that they are supported by overriding __SIGRTMAX to a value greater than __SIGRTMIN. These constants give the kernel-level hard limits, but some real-time signals may be used internally by glibc. Do not use these constants in application code; use SIGRTMIN and SIGRTMAX (defined in signal.h) instead. */ #define __SIGRTMIN 32 #define __SIGRTMAX __SIGRTMIN /* Biggest signal number + 1 (including real-time signals). */ #define _NSIG (__SIGRTMAX + 1) #endif /* bits/signum-generic.h. */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/signum.h ================================================ /* Signal number definitions. Linux version. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_SIGNUM_H #define _BITS_SIGNUM_H 1 #ifndef _SIGNAL_H #error "Never include directly; use instead." #endif #include /* Adjustments and additions to the signal number constants for most Linux systems. */ #define SIGSTKFLT 16 /* Stack fault (obsolete). */ #define SIGPWR 30 /* Power failure imminent. */ #undef SIGBUS #define SIGBUS 7 #undef SIGUSR1 #define SIGUSR1 10 #undef SIGUSR2 #define SIGUSR2 12 #undef SIGCHLD #define SIGCHLD 17 #undef SIGCONT #define SIGCONT 18 #undef SIGSTOP #define SIGSTOP 19 #undef SIGTSTP #define SIGTSTP 20 #undef SIGURG #define SIGURG 23 #undef SIGPOLL #define SIGPOLL 29 #undef SIGSYS #define SIGSYS 31 #undef __SIGRTMAX #define __SIGRTMAX 64 #endif /* included. */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/sigstack.h ================================================ /* sigstack, sigaltstack definitions. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_SIGSTACK_H #define _BITS_SIGSTACK_H 1 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H # error "Never include this file directly. Use instead" #endif /* Minimum stack size for a signal handler. */ #define MINSIGSTKSZ 2048 /* System default stack size. */ #define SIGSTKSZ 8192 #endif /* bits/sigstack.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/sigthread.h ================================================ /* Signal handling function for threaded programs. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see . */ #ifndef _BITS_SIGTHREAD_H #define _BITS_SIGTHREAD_H 1 #if !defined _SIGNAL_H && !defined _PTHREAD_H # error "Never include this file directly. Use instead" #endif /* Functions for handling signals. */ #include /* Modify the signal mask for the calling thread. The arguments have the same meaning as for sigprocmask(2). */ extern int pthread_sigmask(int __how, const __sigset_t * __restrict __newmask, __sigset_t * __restrict __oldmask) __THROW; /* Send signal SIGNO to the given thread. */ extern int pthread_kill(pthread_t __threadid, int __signo) __THROW; #ifdef __USE_GNU /* Queue signal and data to a thread. */ extern int pthread_sigqueue(pthread_t __threadid, int __signo, const union sigval __value) __THROW; #endif #endif /* bits/sigthread.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/sockaddr.h ================================================ /* Definition of struct sockaddr_* common members and sizes, generic version. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ #ifndef _BITS_SOCKADDR_H #define _BITS_SOCKADDR_H 1 /* POSIX.1g specifies this type name for the `sa_family' member. */ typedef unsigned short int sa_family_t; /* This macro is used to declare the initial common members of the data types used for socket addresses, `struct sockaddr', `struct sockaddr_in', `struct sockaddr_un', etc. */ #define __SOCKADDR_COMMON(sa_prefix) \ sa_family_t sa_prefix##family #define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) /* Size of struct sockaddr_storage. */ #define _SS_SIZE 128 #endif /* bits/sockaddr.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/socket.h ================================================ /* System-specific socket constants and types. Linux version. Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef __BITS_SOCKET_H #define __BITS_SOCKET_H #ifndef _SYS_SOCKET_H # error "Never include directly; use instead." #endif #define __need_size_t #include #include /* Type for length arguments in socket calls. */ #ifndef __socklen_t_defined typedef __socklen_t socklen_t; # define __socklen_t_defined #endif /* Get the architecture-dependent definition of enum __socket_type. */ #include /* Protocol families. */ #define PF_UNSPEC 0 /* Unspecified. */ #define PF_LOCAL 1 /* Local to host (pipes and file-domain). */ #define PF_UNIX PF_LOCAL /* POSIX name for PF_LOCAL. */ #define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */ #define PF_INET 2 /* IP protocol family. */ #define PF_AX25 3 /* Amateur Radio AX.25. */ #define PF_IPX 4 /* Novell Internet Protocol. */ #define PF_APPLETALK 5 /* Appletalk DDP. */ #define PF_NETROM 6 /* Amateur radio NetROM. */ #define PF_BRIDGE 7 /* Multiprotocol bridge. */ #define PF_ATMPVC 8 /* ATM PVCs. */ #define PF_X25 9 /* Reserved for X.25 project. */ #define PF_INET6 10 /* IP version 6. */ #define PF_ROSE 11 /* Amateur Radio X.25 PLP. */ #define PF_DECnet 12 /* Reserved for DECnet project. */ #define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */ #define PF_SECURITY 14 /* Security callback pseudo AF. */ #define PF_KEY 15 /* PF_KEY key management API. */ #define PF_NETLINK 16 #define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */ #define PF_PACKET 17 /* Packet family. */ #define PF_ASH 18 /* Ash. */ #define PF_ECONET 19 /* Acorn Econet. */ #define PF_ATMSVC 20 /* ATM SVCs. */ #define PF_RDS 21 /* RDS sockets. */ #define PF_SNA 22 /* Linux SNA Project */ #define PF_IRDA 23 /* IRDA sockets. */ #define PF_PPPOX 24 /* PPPoX sockets. */ #define PF_WANPIPE 25 /* Wanpipe API sockets. */ #define PF_LLC 26 /* Linux LLC. */ #define PF_IB 27 /* Native InfiniBand address. */ #define PF_MPLS 28 /* MPLS. */ #define PF_CAN 29 /* Controller Area Network. */ #define PF_TIPC 30 /* TIPC sockets. */ #define PF_BLUETOOTH 31 /* Bluetooth sockets. */ #define PF_IUCV 32 /* IUCV sockets. */ #define PF_RXRPC 33 /* RxRPC sockets. */ #define PF_ISDN 34 /* mISDN sockets. */ #define PF_PHONET 35 /* Phonet sockets. */ #define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */ #define PF_CAIF 37 /* CAIF sockets. */ #define PF_ALG 38 /* Algorithm sockets. */ #define PF_NFC 39 /* NFC sockets. */ #define PF_VSOCK 40 /* vSockets. */ #define PF_KCM 41 /* Kernel Connection Multiplexor. */ #define PF_QIPCRTR 42 /* Qualcomm IPC Router. */ #define PF_SMC 43 /* SMC sockets. */ #define PF_MAX 44 /* For now.. */ /* Address families. */ #define AF_UNSPEC PF_UNSPEC #define AF_LOCAL PF_LOCAL #define AF_UNIX PF_UNIX #define AF_FILE PF_FILE #define AF_INET PF_INET #define AF_AX25 PF_AX25 #define AF_IPX PF_IPX #define AF_APPLETALK PF_APPLETALK #define AF_NETROM PF_NETROM #define AF_BRIDGE PF_BRIDGE #define AF_ATMPVC PF_ATMPVC #define AF_X25 PF_X25 #define AF_INET6 PF_INET6 #define AF_ROSE PF_ROSE #define AF_DECnet PF_DECnet #define AF_NETBEUI PF_NETBEUI #define AF_SECURITY PF_SECURITY #define AF_KEY PF_KEY #define AF_NETLINK PF_NETLINK #define AF_ROUTE PF_ROUTE #define AF_PACKET PF_PACKET #define AF_ASH PF_ASH #define AF_ECONET PF_ECONET #define AF_ATMSVC PF_ATMSVC #define AF_RDS PF_RDS #define AF_SNA PF_SNA #define AF_IRDA PF_IRDA #define AF_PPPOX PF_PPPOX #define AF_WANPIPE PF_WANPIPE #define AF_LLC PF_LLC #define AF_IB PF_IB #define AF_MPLS PF_MPLS #define AF_CAN PF_CAN #define AF_TIPC PF_TIPC #define AF_BLUETOOTH PF_BLUETOOTH #define AF_IUCV PF_IUCV #define AF_RXRPC PF_RXRPC #define AF_ISDN PF_ISDN #define AF_PHONET PF_PHONET #define AF_IEEE802154 PF_IEEE802154 #define AF_CAIF PF_CAIF #define AF_ALG PF_ALG #define AF_NFC PF_NFC #define AF_VSOCK PF_VSOCK #define AF_KCM PF_KCM #define AF_QIPCRTR PF_QIPCRTR #define AF_SMC PF_SMC #define AF_MAX PF_MAX /* Socket level values. Others are defined in the appropriate headers. XXX These definitions also should go into the appropriate headers as far as they are available. */ #define SOL_RAW 255 #define SOL_DECNET 261 #define SOL_X25 262 #define SOL_PACKET 263 #define SOL_ATM 264 /* ATM layer (cell level). */ #define SOL_AAL 265 /* ATM Adaption Layer (packet level). */ #define SOL_IRDA 266 #define SOL_NETBEUI 267 #define SOL_LLC 268 #define SOL_DCCP 269 #define SOL_NETLINK 270 #define SOL_TIPC 271 #define SOL_RXRPC 272 #define SOL_PPPOL2TP 273 #define SOL_BLUETOOTH 274 #define SOL_PNPIPE 275 #define SOL_RDS 276 #define SOL_IUCV 277 #define SOL_CAIF 278 #define SOL_ALG 279 #define SOL_NFC 280 #define SOL_KCM 281 #define SOL_TLS 282 /* Maximum queue length specifiable by listen. */ #define SOMAXCONN 128 /* Get the definition of the macro to define the common sockaddr members. */ #include /* Structure describing a generic socket address. */ struct sockaddr { __SOCKADDR_COMMON(sa_); /* Common data: address family and length. */ char sa_data[14]; /* Address data. */ }; /* Structure large enough to hold any socket address (with the historical exception of AF_UNIX). */ #define __ss_aligntype unsigned long int #define _SS_PADSIZE \ (_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype)) struct sockaddr_storage { __SOCKADDR_COMMON(ss_); /* Address family, etc. */ char __ss_padding[_SS_PADSIZE]; __ss_aligntype __ss_align; /* Force desired alignment. */ }; /* Bits in the FLAGS argument to `send', `recv', et al. */ enum { MSG_OOB = 0x01, /* Process out-of-band data. */ #define MSG_OOB MSG_OOB MSG_PEEK = 0x02, /* Peek at incoming messages. */ #define MSG_PEEK MSG_PEEK MSG_DONTROUTE = 0x04, /* Don't use local routing. */ #define MSG_DONTROUTE MSG_DONTROUTE #ifdef __USE_GNU /* DECnet uses a different name. */ MSG_TRYHARD = MSG_DONTROUTE, # define MSG_TRYHARD MSG_DONTROUTE #endif MSG_CTRUNC = 0x08, /* Control data lost before delivery. */ #define MSG_CTRUNC MSG_CTRUNC MSG_PROXY = 0x10, /* Supply or ask second address. */ #define MSG_PROXY MSG_PROXY MSG_TRUNC = 0x20, #define MSG_TRUNC MSG_TRUNC MSG_DONTWAIT = 0x40, /* Nonblocking IO. */ #define MSG_DONTWAIT MSG_DONTWAIT MSG_EOR = 0x80, /* End of record. */ #define MSG_EOR MSG_EOR MSG_WAITALL = 0x100, /* Wait for a full request. */ #define MSG_WAITALL MSG_WAITALL MSG_FIN = 0x200, #define MSG_FIN MSG_FIN MSG_SYN = 0x400, #define MSG_SYN MSG_SYN MSG_CONFIRM = 0x800, /* Confirm path validity. */ #define MSG_CONFIRM MSG_CONFIRM MSG_RST = 0x1000, #define MSG_RST MSG_RST MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */ #define MSG_ERRQUEUE MSG_ERRQUEUE MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */ #define MSG_NOSIGNAL MSG_NOSIGNAL MSG_MORE = 0x8000, /* Sender will send more. */ #define MSG_MORE MSG_MORE MSG_WAITFORONE = 0x10000, /* Wait for at least one packet to return. */ #define MSG_WAITFORONE MSG_WAITFORONE MSG_BATCH = 0x40000, /* sendmmsg: more messages coming. */ #define MSG_BATCH MSG_BATCH MSG_ZEROCOPY = 0x4000000, /* Use user data in kernel path. */ #define MSG_ZEROCOPY MSG_ZEROCOPY MSG_FASTOPEN = 0x20000000, /* Send data in TCP SYN. */ #define MSG_FASTOPEN MSG_FASTOPEN MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file descriptor received through SCM_RIGHTS. */ #define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC }; /* Structure describing messages sent by `sendmsg' and received by `recvmsg'. */ struct msghdr { void *msg_name; /* Address to send to/receive from. */ socklen_t msg_namelen; /* Length of address data. */ struct iovec *msg_iov; /* Vector of data to send/receive into. */ size_t msg_iovlen; /* Number of elements in the vector. */ void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ size_t msg_controllen; /* Ancillary data buffer length. !! The type should be socklen_t but the definition of the kernel is incompatible with this. */ int msg_flags; /* Flags on received message. */ }; /* Structure used for storage of ancillary data object information. */ struct cmsghdr { size_t cmsg_len; /* Length of data in cmsg_data plus length of cmsghdr structure. !! The type should be socklen_t but the definition of the kernel is incompatible with this. */ int cmsg_level; /* Originating protocol. */ int cmsg_type; /* Protocol specific type. */ #if __glibc_c99_flexarr_available __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */ #endif }; /* Ancillary data object manipulation macros. */ #if __glibc_c99_flexarr_available # define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data) #else # define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) #endif #define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg) #define CMSG_FIRSTHDR(mhdr) \ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0) #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \ & (size_t) ~(sizeof (size_t) - 1)) #define CMSG_SPACE(len) (CMSG_ALIGN (len) \ + CMSG_ALIGN (sizeof (struct cmsghdr))) #define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) extern struct cmsghdr *__cmsg_nxthdr(struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW; #ifdef __USE_EXTERN_INLINES # ifndef _EXTERN_INLINE # define _EXTERN_INLINE __extern_inline # endif _EXTERN_INLINE struct cmsghdr *__NTH(__cmsg_nxthdr(struct msghdr *__mhdr, struct cmsghdr *__cmsg)) { if ((size_t) __cmsg->cmsg_len < sizeof(struct cmsghdr)) /* The kernel header does this so there may be a reason. */ return (struct cmsghdr *)0; __cmsg = (struct cmsghdr *)((unsigned char *)__cmsg + CMSG_ALIGN(__cmsg->cmsg_len)); if ((unsigned char *)(__cmsg + 1) > ((unsigned char *)__mhdr->msg_control + __mhdr->msg_controllen) || ((unsigned char *)__cmsg + CMSG_ALIGN(__cmsg->cmsg_len) > ((unsigned char *)__mhdr->msg_control + __mhdr->msg_controllen))) /* No more entries. */ return (struct cmsghdr *)0; return __cmsg; } #endif /* Use `extern inline'. */ /* Socket level message types. This must match the definitions in . */ enum { SCM_RIGHTS = 0x01 /* Transfer file descriptors. */ #define SCM_RIGHTS SCM_RIGHTS #ifdef __USE_GNU , SCM_CREDENTIALS = 0x02 /* Credentials passing. */ # define SCM_CREDENTIALS SCM_CREDENTIALS #endif }; #ifdef __USE_GNU /* User visible structure for SCM_CREDENTIALS message */ struct ucred { pid_t pid; /* PID of sending process. */ uid_t uid; /* UID of sending process. */ gid_t gid; /* GID of sending process. */ }; #endif /* Ugly workaround for unclean kernel headers. */ #ifndef __USE_MISC # ifndef FIOGETOWN # define __SYS_SOCKET_H_undef_FIOGETOWN # endif # ifndef FIOSETOWN # define __SYS_SOCKET_H_undef_FIOSETOWN # endif # ifndef SIOCATMARK # define __SYS_SOCKET_H_undef_SIOCATMARK # endif # ifndef SIOCGPGRP # define __SYS_SOCKET_H_undef_SIOCGPGRP # endif # ifndef SIOCGSTAMP # define __SYS_SOCKET_H_undef_SIOCGSTAMP # endif # ifndef SIOCGSTAMPNS # define __SYS_SOCKET_H_undef_SIOCGSTAMPNS # endif # ifndef SIOCSPGRP # define __SYS_SOCKET_H_undef_SIOCSPGRP # endif #endif #ifndef IOCSIZE_MASK # define __SYS_SOCKET_H_undef_IOCSIZE_MASK #endif #ifndef IOCSIZE_SHIFT # define __SYS_SOCKET_H_undef_IOCSIZE_SHIFT #endif #ifndef IOC_IN # define __SYS_SOCKET_H_undef_IOC_IN #endif #ifndef IOC_INOUT # define __SYS_SOCKET_H_undef_IOC_INOUT #endif #ifndef IOC_OUT # define __SYS_SOCKET_H_undef_IOC_OUT #endif /* Get socket manipulation related informations from kernel headers. */ #include #ifndef __USE_MISC # ifdef __SYS_SOCKET_H_undef_FIOGETOWN # undef __SYS_SOCKET_H_undef_FIOGETOWN # undef FIOGETOWN # endif # ifdef __SYS_SOCKET_H_undef_FIOSETOWN # undef __SYS_SOCKET_H_undef_FIOSETOWN # undef FIOSETOWN # endif # ifdef __SYS_SOCKET_H_undef_SIOCATMARK # undef __SYS_SOCKET_H_undef_SIOCATMARK # undef SIOCATMARK # endif # ifdef __SYS_SOCKET_H_undef_SIOCGPGRP # undef __SYS_SOCKET_H_undef_SIOCGPGRP # undef SIOCGPGRP # endif # ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP # undef __SYS_SOCKET_H_undef_SIOCGSTAMP # undef SIOCGSTAMP # endif # ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS # undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS # undef SIOCGSTAMPNS # endif # ifdef __SYS_SOCKET_H_undef_SIOCSPGRP # undef __SYS_SOCKET_H_undef_SIOCSPGRP # undef SIOCSPGRP # endif #endif #ifdef __SYS_SOCKET_H_undef_IOCSIZE_MASK # undef __SYS_SOCKET_H_undef_IOCSIZE_MASK # undef IOCSIZE_MASK #endif #ifdef __SYS_SOCKET_H_undef_IOCSIZE_SHIFT # undef __SYS_SOCKET_H_undef_IOCSIZE_SHIFT # undef IOCSIZE_SHIFT #endif #ifdef __SYS_SOCKET_H_undef_IOC_IN # undef __SYS_SOCKET_H_undef_IOC_IN # undef IOC_IN #endif #ifdef __SYS_SOCKET_H_undef_IOC_INOUT # undef __SYS_SOCKET_H_undef_IOC_INOUT # undef IOC_INOUT #endif #ifdef __SYS_SOCKET_H_undef_IOC_OUT # undef __SYS_SOCKET_H_undef_IOC_OUT # undef IOC_OUT #endif /* Structure used to manipulate the SO_LINGER option. */ struct linger { int l_onoff; /* Nonzero to linger on close. */ int l_linger; /* Time to linger. */ }; #endif /* bits/socket.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/socket_type.h ================================================ /* Define enum __socket_type for generic Linux. Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SOCKET_H # error "Never include directly; use instead." #endif /* Types of sockets. */ enum __socket_type { SOCK_STREAM = 1, /* Sequenced, reliable, connection-based byte streams. */ #define SOCK_STREAM SOCK_STREAM SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams of fixed maximum length. */ #define SOCK_DGRAM SOCK_DGRAM SOCK_RAW = 3, /* Raw protocol interface. */ #define SOCK_RAW SOCK_RAW SOCK_RDM = 4, /* Reliably-delivered messages. */ #define SOCK_RDM SOCK_RDM SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, datagrams of fixed maximum length. */ #define SOCK_SEQPACKET SOCK_SEQPACKET SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */ #define SOCK_DCCP SOCK_DCCP SOCK_PACKET = 10, /* Linux specific way of getting packets at the dev level. For writing rarp and other similar things on the user level. */ #define SOCK_PACKET SOCK_PACKET /* Flags to be ORed into the type parameter of socket and socketpair and used for the flags parameter of paccept. */ SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the new descriptor(s). */ #define SOCK_CLOEXEC SOCK_CLOEXEC SOCK_NONBLOCK = 00004000 /* Atomically mark descriptor(s) as non-blocking. */ #define SOCK_NONBLOCK SOCK_NONBLOCK }; ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/ss_flags.h ================================================ /* ss_flags values for stack_t. Linux version. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_SS_FLAGS_H #define _BITS_SS_FLAGS_H 1 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H # error "Never include this file directly. Use instead" #endif /* Possible values for `ss_flags'. */ enum { SS_ONSTACK = 1, #define SS_ONSTACK SS_ONSTACK SS_DISABLE #define SS_DISABLE SS_DISABLE }; #endif /* bits/ss_flags.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/stat.h ================================================ /* Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SYS_STAT_H && !defined _FCNTL_H # error "Never include directly; use instead." #endif #ifndef _BITS_STAT_H #define _BITS_STAT_H 1 /* Versions of the `struct stat' data structure. */ #ifndef __x86_64__ # define _STAT_VER_LINUX_OLD 1 # define _STAT_VER_KERNEL 1 # define _STAT_VER_SVR4 2 # define _STAT_VER_LINUX 3 /* i386 versions of the `xmknod' interface. */ # define _MKNOD_VER_LINUX 1 # define _MKNOD_VER_SVR4 2 # define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ #else # define _STAT_VER_KERNEL 0 # define _STAT_VER_LINUX 1 /* x86-64 versions of the `xmknod' interface. */ # define _MKNOD_VER_LINUX 0 #endif #define _STAT_VER _STAT_VER_LINUX struct stat { __dev_t st_dev; /* Device. */ #ifndef __x86_64__ unsigned short int __pad1; #endif #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ #else __ino_t __st_ino; /* 32bit file serial number. */ #endif #ifndef __x86_64__ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ #else __nlink_t st_nlink; /* Link count. */ __mode_t st_mode; /* File mode. */ #endif __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group. */ #ifdef __x86_64__ int __pad0; #endif __dev_t st_rdev; /* Device number, if device. */ #ifndef __x86_64__ unsigned short int __pad2; #endif #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ #else __off64_t st_size; /* Size of file, in bytes. */ #endif __blksize_t st_blksize; /* Optimal block size for I/O. */ #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ #else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif #ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the identifier 'timespec' to appear in the header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ # define st_atime st_atim.tv_sec /* Backward compatibility. */ # define st_mtime st_mtim.tv_sec # define st_ctime st_ctim.tv_sec #else __time_t st_atime; /* Time of last access. */ __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ #endif #ifdef __x86_64__ __syscall_slong_t __glibc_reserved[3]; #else # ifndef __USE_FILE_OFFSET64 unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; # else __ino64_t st_ino; /* File serial number. */ # endif #endif }; #ifdef __USE_LARGEFILE64 /* Note stat64 has the same shape as stat for x86-64. */ struct stat64 { __dev_t st_dev; /* Device. */ # ifdef __x86_64__ __ino64_t st_ino; /* File serial number. */ __nlink_t st_nlink; /* Link count. */ __mode_t st_mode; /* File mode. */ # else unsigned int __pad1; __ino_t __st_ino; /* 32bit file serial number. */ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ # endif __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group. */ # ifdef __x86_64__ int __pad0; __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ # else __dev_t st_rdev; /* Device number, if device. */ unsigned int __pad2; __off64_t st_size; /* Size of file, in bytes. */ # endif __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ # ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the identifier 'timespec' to appear in the header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ # else __time_t st_atime; /* Time of last access. */ __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ # endif # ifdef __x86_64__ __syscall_slong_t __glibc_reserved[3]; # else __ino64_t st_ino; /* File serial number. */ # endif }; #endif /* Tell code we have these members. */ #define _STATBUF_ST_BLKSIZE #define _STATBUF_ST_RDEV /* Nanosecond resolution time values are supported. */ #define _STATBUF_ST_NSEC /* Encoding of the file mode. */ #define __S_IFMT 0170000 /* These bits determine file type. */ /* File types. */ #define __S_IFDIR 0040000 /* Directory. */ #define __S_IFCHR 0020000 /* Character device. */ #define __S_IFBLK 0060000 /* Block device. */ #define __S_IFREG 0100000 /* Regular file. */ #define __S_IFIFO 0010000 /* FIFO. */ #define __S_IFLNK 0120000 /* Symbolic link. */ #define __S_IFSOCK 0140000 /* Socket. */ /* POSIX.1b objects. Note that these macros always evaluate to zero. But they do it by enforcing the correct use of the macros. */ #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) /* Protection bits. */ #define __S_ISUID 04000 /* Set user ID on execution. */ #define __S_ISGID 02000 /* Set group ID on execution. */ #define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ #define __S_IREAD 0400 /* Read by owner. */ #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ #ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif #endif /* bits/stat.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/statfs.h ================================================ /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_STATFS_H # error "Never include directly; use instead." #endif #include struct statfs { __fsword_t f_type; __fsword_t f_bsize; #ifndef __USE_FILE_OFFSET64 __fsblkcnt_t f_blocks; __fsblkcnt_t f_bfree; __fsblkcnt_t f_bavail; __fsfilcnt_t f_files; __fsfilcnt_t f_ffree; #else __fsblkcnt64_t f_blocks; __fsblkcnt64_t f_bfree; __fsblkcnt64_t f_bavail; __fsfilcnt64_t f_files; __fsfilcnt64_t f_ffree; #endif __fsid_t f_fsid; __fsword_t f_namelen; __fsword_t f_frsize; __fsword_t f_flags; __fsword_t f_spare[4]; }; #ifdef __USE_LARGEFILE64 struct statfs64 { __fsword_t f_type; __fsword_t f_bsize; __fsblkcnt64_t f_blocks; __fsblkcnt64_t f_bfree; __fsblkcnt64_t f_bavail; __fsfilcnt64_t f_files; __fsfilcnt64_t f_ffree; __fsid_t f_fsid; __fsword_t f_namelen; __fsword_t f_frsize; __fsword_t f_flags; __fsword_t f_spare[4]; }; #endif /* Tell code we have these members. */ #define _STATFS_F_NAMELEN #define _STATFS_F_FRSIZE #define _STATFS_F_FLAGS ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/stdint-intn.h ================================================ /* Define intN_t types. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_STDINT_INTN_H #define _BITS_STDINT_INTN_H 1 #include typedef __int8_t int8_t; typedef __int16_t int16_t; typedef __int32_t int32_t; typedef __int64_t int64_t; #endif /* bits/stdint-intn.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/stdint-uintn.h ================================================ /* Define uintN_t types. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_STDINT_UINTN_H #define _BITS_STDINT_UINTN_H 1 #include typedef __uint8_t uint8_t; typedef __uint16_t uint16_t; typedef __uint32_t uint32_t; typedef __uint64_t uint64_t; #endif /* bits/stdint-uintn.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/stdio_lim.h ================================================ /* Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_STDIO_LIM_H #define _BITS_STDIO_LIM_H 1 #ifndef _STDIO_H # error "Never include directly; use instead." #endif #define L_tmpnam 20 #define TMP_MAX 238328 #define FILENAME_MAX 4096 #ifdef __USE_POSIX # define L_ctermid 9 # if !defined __USE_XOPEN2K || defined __USE_GNU # define L_cuserid 9 # endif #endif #undef FOPEN_MAX #define FOPEN_MAX 16 #endif /* bits/stdio_lim.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/stdlib-float.h ================================================ /* Floating-point inline functions for stdlib.h. Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STDLIB_H # error "Never use directly; include instead." #endif #ifdef __USE_EXTERN_INLINES __extern_inline double __NTH(atof(const char *__nptr)) { return strtod(__nptr, (char **)NULL); } #endif /* Optimizing and Inlining. */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/sys_errlist.h ================================================ /* Declare sys_errlist and sys_nerr, or don't. Compatibility (do) version. Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STDIO_H # error "Never include directly; use instead." #endif /* sys_errlist and sys_nerr are deprecated. Use strerror instead. */ #ifdef __USE_MISC extern int sys_nerr; extern const char *const sys_errlist[]; #endif #ifdef __USE_GNU extern int _sys_nerr; extern const char *const _sys_errlist[]; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/sysmacros.h ================================================ /* Definitions of macros to access `dev_t' values. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_SYSMACROS_H #define _BITS_SYSMACROS_H 1 #ifndef _SYS_SYSMACROS_H # error "Never include directly; use instead." #endif /* dev_t in glibc is a 64-bit quantity, with 32-bit major and minor numbers. Our default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major number and m is a hex digit of the minor number. This is downward compatible with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also downward compatible with the Linux kernel, which (as of 2016) uses 32-bit dev_t, encoded as mmmM MMmm. Systems that use an incompatible encoding for dev_t should override this file in the appropriate sysdeps subdirectory. */ #define __SYSMACROS_DECLARE_MAJOR(DECL_TEMPL) \ DECL_TEMPL(unsigned int, major, (__dev_t __dev)) #define __SYSMACROS_DEFINE_MAJOR(DECL_TEMPL) \ __SYSMACROS_DECLARE_MAJOR (DECL_TEMPL) \ { \ unsigned int __major; \ __major = ((__dev & (__dev_t) 0x00000000000fff00u) >> 8); \ __major |= ((__dev & (__dev_t) 0xfffff00000000000u) >> 32); \ return __major; \ } #define __SYSMACROS_DECLARE_MINOR(DECL_TEMPL) \ DECL_TEMPL(unsigned int, minor, (__dev_t __dev)) #define __SYSMACROS_DEFINE_MINOR(DECL_TEMPL) \ __SYSMACROS_DECLARE_MINOR (DECL_TEMPL) \ { \ unsigned int __minor; \ __minor = ((__dev & (__dev_t) 0x00000000000000ffu) >> 0); \ __minor |= ((__dev & (__dev_t) 0x00000ffffff00000u) >> 12); \ return __minor; \ } #define __SYSMACROS_DECLARE_MAKEDEV(DECL_TEMPL) \ DECL_TEMPL(__dev_t, makedev, (unsigned int __major, unsigned int __minor)) #define __SYSMACROS_DEFINE_MAKEDEV(DECL_TEMPL) \ __SYSMACROS_DECLARE_MAKEDEV (DECL_TEMPL) \ { \ __dev_t __dev; \ __dev = (((__dev_t) (__major & 0x00000fffu)) << 8); \ __dev |= (((__dev_t) (__major & 0xfffff000u)) << 32); \ __dev |= (((__dev_t) (__minor & 0x000000ffu)) << 0); \ __dev |= (((__dev_t) (__minor & 0xffffff00u)) << 12); \ return __dev; \ } #endif /* bits/sysmacros.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/termios.h ================================================ /* termios type and macro definitions. Linux version. Copyright (C) 1993-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _TERMIOS_H # error "Never include directly; use instead." #endif typedef unsigned char cc_t; typedef unsigned int speed_t; typedef unsigned int tcflag_t; #define NCCS 32 struct termios { tcflag_t c_iflag; /* input mode flags */ tcflag_t c_oflag; /* output mode flags */ tcflag_t c_cflag; /* control mode flags */ tcflag_t c_lflag; /* local mode flags */ cc_t c_line; /* line discipline */ cc_t c_cc[NCCS]; /* control characters */ speed_t c_ispeed; /* input speed */ speed_t c_ospeed; /* output speed */ #define _HAVE_STRUCT_TERMIOS_C_ISPEED 1 #define _HAVE_STRUCT_TERMIOS_C_OSPEED 1 }; /* c_cc characters */ #define VINTR 0 #define VQUIT 1 #define VERASE 2 #define VKILL 3 #define VEOF 4 #define VTIME 5 #define VMIN 6 #define VSWTC 7 #define VSTART 8 #define VSTOP 9 #define VSUSP 10 #define VEOL 11 #define VREPRINT 12 #define VDISCARD 13 #define VWERASE 14 #define VLNEXT 15 #define VEOL2 16 /* c_iflag bits */ #define IGNBRK 0000001 #define BRKINT 0000002 #define IGNPAR 0000004 #define PARMRK 0000010 #define INPCK 0000020 #define ISTRIP 0000040 #define INLCR 0000100 #define IGNCR 0000200 #define ICRNL 0000400 #define IUCLC 0001000 #define IXON 0002000 #define IXANY 0004000 #define IXOFF 0010000 #define IMAXBEL 0020000 #define IUTF8 0040000 /* c_oflag bits */ #define OPOST 0000001 #define OLCUC 0000002 #define ONLCR 0000004 #define OCRNL 0000010 #define ONOCR 0000020 #define ONLRET 0000040 #define OFILL 0000100 #define OFDEL 0000200 #if defined __USE_MISC || defined __USE_XOPEN # define NLDLY 0000400 # define NL0 0000000 # define NL1 0000400 # define CRDLY 0003000 # define CR0 0000000 # define CR1 0001000 # define CR2 0002000 # define CR3 0003000 # define TABDLY 0014000 # define TAB0 0000000 # define TAB1 0004000 # define TAB2 0010000 # define TAB3 0014000 # define BSDLY 0020000 # define BS0 0000000 # define BS1 0020000 # define FFDLY 0100000 # define FF0 0000000 # define FF1 0100000 #endif #define VTDLY 0040000 #define VT0 0000000 #define VT1 0040000 #ifdef __USE_MISC # define XTABS 0014000 #endif /* c_cflag bit meaning */ #ifdef __USE_MISC # define CBAUD 0010017 #endif #define B0 0000000 /* hang up */ #define B50 0000001 #define B75 0000002 #define B110 0000003 #define B134 0000004 #define B150 0000005 #define B200 0000006 #define B300 0000007 #define B600 0000010 #define B1200 0000011 #define B1800 0000012 #define B2400 0000013 #define B4800 0000014 #define B9600 0000015 #define B19200 0000016 #define B38400 0000017 #ifdef __USE_MISC # define EXTA B19200 # define EXTB B38400 #endif #define CSIZE 0000060 #define CS5 0000000 #define CS6 0000020 #define CS7 0000040 #define CS8 0000060 #define CSTOPB 0000100 #define CREAD 0000200 #define PARENB 0000400 #define PARODD 0001000 #define HUPCL 0002000 #define CLOCAL 0004000 #ifdef __USE_MISC # define CBAUDEX 0010000 #endif #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif /* c_lflag bits */ #define ISIG 0000001 #define ICANON 0000002 #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) # define XCASE 0000004 #endif #define ECHO 0000010 #define ECHOE 0000020 #define ECHOK 0000040 #define ECHONL 0000100 #define NOFLSH 0000200 #define TOSTOP 0000400 #ifdef __USE_MISC # define ECHOCTL 0001000 # define ECHOPRT 0002000 # define ECHOKE 0004000 # define FLUSHO 0010000 # define PENDIN 0040000 #endif #define IEXTEN 0100000 #ifdef __USE_MISC # define EXTPROC 0200000 #endif /* tcflow() and TCXONC use these */ #define TCOOFF 0 #define TCOON 1 #define TCIOFF 2 #define TCION 3 /* tcflush() and TCFLSH use these */ #define TCIFLUSH 0 #define TCOFLUSH 1 #define TCIOFLUSH 2 /* tcsetattr uses these */ #define TCSANOW 0 #define TCSADRAIN 1 #define TCSAFLUSH 2 #define _IOT_termios /* Hurd ioctl type field. */ \ _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/thread-shared-types.h ================================================ /* Common threading primitives definitions for both POSIX and C11. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _THREAD_SHARED_TYPES_H #define _THREAD_SHARED_TYPES_H 1 /* Arch-specific definitions. Each architecture must define the following macros to define the expected sizes of pthread data types: __SIZEOF_PTHREAD_ATTR_T - size of pthread_attr_t. __SIZEOF_PTHREAD_MUTEX_T - size of pthread_mutex_t. __SIZEOF_PTHREAD_MUTEXATTR_T - size of pthread_mutexattr_t. __SIZEOF_PTHREAD_COND_T - size of pthread_cond_t. __SIZEOF_PTHREAD_CONDATTR_T - size of pthread_condattr_t. __SIZEOF_PTHREAD_RWLOCK_T - size of pthread_rwlock_t. __SIZEOF_PTHREAD_RWLOCKATTR_T - size of pthread_rwlockattr_t. __SIZEOF_PTHREAD_BARRIER_T - size of pthread_barrier_t. __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t. Also, the following macros must be define for internal pthread_mutex_t struct definitions (struct __pthread_mutex_s): __PTHREAD_COMPAT_PADDING_MID - any additional members after 'kind' and before '__spin' (for 64 bits) or '__nusers' (for 32 bits). __PTHREAD_COMPAT_PADDING_END - any additional members at the end of the internal structure. __PTHREAD_MUTEX_LOCK_ELISION - 1 if the architecture supports lock elision or 0 otherwise. __PTHREAD_MUTEX_NUSERS_AFTER_KIND - control where to put __nusers. The preferred value for new architectures is 0. __PTHREAD_MUTEX_USE_UNION - control whether internal __spins and __list will be place inside a union for linuxthreads compatibility. The preferred value for new architectures is 0. For a new port the preferred values for the required defines are: #define __PTHREAD_COMPAT_PADDING_MID #define __PTHREAD_COMPAT_PADDING_END #define __PTHREAD_MUTEX_LOCK_ELISION 0 #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0 #define __PTHREAD_MUTEX_USE_UNION 0 __PTHREAD_MUTEX_LOCK_ELISION can be set to 1 if the hardware plans to eventually support lock elision using transactional memory. The additional macro defines any constraint for the lock alignment inside the thread structures: __LOCK_ALIGNMENT - for internal lock/futex usage. Same idea but for the once locking primitive: __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition. And finally the internal pthread_rwlock_t (struct __pthread_rwlock_arch_t) must be defined. */ #include /* Common definition of pthread_mutex_t. */ #if !__PTHREAD_MUTEX_USE_UNION typedef struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __pthread_list_t; #else typedef struct __pthread_internal_slist { struct __pthread_internal_slist *__next; } __pthread_slist_t; #endif /* Lock elision support. */ #if __PTHREAD_MUTEX_LOCK_ELISION # if !__PTHREAD_MUTEX_USE_UNION # define __PTHREAD_SPINS_DATA \ short __spins; \ short __elision # define __PTHREAD_SPINS 0, 0 # else # define __PTHREAD_SPINS_DATA \ struct \ { \ short __espins; \ short __eelision; \ } __elision_data # define __PTHREAD_SPINS { 0, 0 } # define __spins __elision_data.__espins # define __elision __elision_data.__eelision # endif #else # define __PTHREAD_SPINS_DATA int __spins /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ # define __PTHREAD_SPINS 0 #endif struct __pthread_mutex_s { int __lock __LOCK_ALIGNMENT; unsigned int __count; int __owner; #if !__PTHREAD_MUTEX_NUSERS_AFTER_KIND unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain binary compatibility with static initializers. */ int __kind; __PTHREAD_COMPAT_PADDING_MID #if __PTHREAD_MUTEX_NUSERS_AFTER_KIND unsigned int __nusers; #endif #if !__PTHREAD_MUTEX_USE_UNION __PTHREAD_SPINS_DATA; __pthread_list_t __list; # define __PTHREAD_MUTEX_HAVE_PREV 1 #else __extension__ union { __PTHREAD_SPINS_DATA; __pthread_slist_t __list; }; # define __PTHREAD_MUTEX_HAVE_PREV 0 #endif __PTHREAD_COMPAT_PADDING_END}; /* Common definition of pthread_cond_t. */ struct __pthread_cond_s { __extension__ union { __extension__ unsigned long long int __wseq; struct { unsigned int __low; unsigned int __high; } __wseq32; }; __extension__ union { __extension__ unsigned long long int __g1_start; struct { unsigned int __low; unsigned int __high; } __g1_start32; }; unsigned int __g_refs[2] __LOCK_ALIGNMENT; unsigned int __g_size[2]; unsigned int __g1_orig_size; unsigned int __wrefs; unsigned int __g_signals[2]; }; #endif /* _THREAD_SHARED_TYPES_H */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/time.h ================================================ /* System-dependent timing definitions. Linux version. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ #ifndef _BITS_TIME_H #define _BITS_TIME_H 1 #include /* ISO/IEC 9899:1999 7.23.1: Components of time The macro `CLOCKS_PER_SEC' is an expression with type `clock_t' that is the number per second of the value returned by the `clock' function. */ /* CAE XSH, Issue 4, Version 2: The value of CLOCKS_PER_SEC is required to be 1 million on all XSI-conformant systems. */ #define CLOCKS_PER_SEC ((__clock_t) 1000000) #if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \ && !defined __USE_XOPEN2K /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK presents the real value for clock ticks per second for the system. */ extern long int __sysconf(int); # define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */ #endif #ifdef __USE_POSIX199309 /* Identifier for system-wide realtime clock. */ # define CLOCK_REALTIME 0 /* Monotonic system-wide clock. */ # define CLOCK_MONOTONIC 1 /* High-resolution timer from the CPU. */ # define CLOCK_PROCESS_CPUTIME_ID 2 /* Thread-specific CPU-time clock. */ # define CLOCK_THREAD_CPUTIME_ID 3 /* Monotonic system-wide clock, not adjusted for frequency scaling. */ # define CLOCK_MONOTONIC_RAW 4 /* Identifier for system-wide realtime clock, updated only on ticks. */ # define CLOCK_REALTIME_COARSE 5 /* Monotonic system-wide clock, updated only on ticks. */ # define CLOCK_MONOTONIC_COARSE 6 /* Monotonic system-wide clock that includes time spent in suspension. */ # define CLOCK_BOOTTIME 7 /* Like CLOCK_REALTIME but also wakes suspended system. */ # define CLOCK_REALTIME_ALARM 8 /* Like CLOCK_BOOTTIME but also wakes suspended system. */ # define CLOCK_BOOTTIME_ALARM 9 /* Like CLOCK_REALTIME but in International Atomic Time. */ # define CLOCK_TAI 11 /* Flag to indicate time is absolute. */ # define TIMER_ABSTIME 1 #endif #ifdef __USE_GNU # include __BEGIN_DECLS /* Tune a POSIX clock. */ extern int clock_adjtime(__clockid_t __clock_id, struct timex *__utx) __THROW; __END_DECLS #endif /* use GNU */ #endif /* bits/time.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/FILE.h ================================================ #ifndef __FILE_defined #define __FILE_defined 1 struct _IO_FILE; /* The opaque type of streams. This is the definition used elsewhere. */ typedef struct _IO_FILE FILE; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/__FILE.h ================================================ #ifndef ____FILE_defined #define ____FILE_defined 1 struct _IO_FILE; typedef struct _IO_FILE __FILE; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/__locale_t.h ================================================ /* Definition of struct __locale_struct and __locale_t. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_TYPES___LOCALE_T_H #define _BITS_TYPES___LOCALE_T_H 1 /* POSIX.1-2008: the locale_t type, representing a locale context (implementation-namespace version). This type should be treated as opaque by applications; some details are exposed for the sake of efficiency in e.g. ctype functions. */ struct __locale_struct { /* Note: LC_ALL is not a valid index into this array. */ struct __locale_data *__locales[13]; /* 13 = __LC_LAST. */ /* To increase the speed of this solution we add some special members. */ const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; /* Note: LC_ALL is not a valid index into this array. */ const char *__names[13]; }; typedef struct __locale_struct *__locale_t; #endif /* bits/types/__locale_t.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/__mbstate_t.h ================================================ #ifndef ____mbstate_t_defined #define ____mbstate_t_defined 1 /* Integral type unchanged by default argument promotions that can hold any value corresponding to members of the extended character set, as well as at least one value that does not correspond to any member of the extended character set. */ #ifndef __WINT_TYPE__ # define __WINT_TYPE__ unsigned int #endif /* Conversion state information. */ typedef struct { int __count; union { __WINT_TYPE__ __wch; char __wchb[4]; } __value; /* Value so far. */ } __mbstate_t; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/__sigset_t.h ================================================ #ifndef ____sigset_t_defined #define ____sigset_t_defined #define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) typedef struct { unsigned long int __val[_SIGSET_NWORDS]; } __sigset_t; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/__sigval_t.h ================================================ /* Define __sigval_t. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef ____sigval_t_defined #define ____sigval_t_defined /* Type for data associated with a signal. */ #ifdef __USE_POSIX199309 union sigval { int sival_int; void *sival_ptr; }; typedef union sigval __sigval_t; #else union __sigval { int __sival_int; void *__sival_ptr; }; typedef union __sigval __sigval_t; #endif #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/clock_t.h ================================================ #ifndef __clock_t_defined #define __clock_t_defined 1 #include /* Returned by `clock'. */ typedef __clock_t clock_t; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/clockid_t.h ================================================ #ifndef __clockid_t_defined #define __clockid_t_defined 1 #include /* Clock ID used in clock and timer functions. */ typedef __clockid_t clockid_t; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/locale_t.h ================================================ /* Definition of locale_t. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_TYPES_LOCALE_T_H #define _BITS_TYPES_LOCALE_T_H 1 #include typedef __locale_t locale_t; #endif /* bits/types/locale_t.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/mbstate_t.h ================================================ #ifndef __mbstate_t_defined #define __mbstate_t_defined 1 #include typedef __mbstate_t mbstate_t; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/sig_atomic_t.h ================================================ #ifndef __sig_atomic_t_defined #define __sig_atomic_t_defined 1 #include /* An integral type that can be modified atomically, without the possibility of a signal arriving in the middle of the operation. */ typedef __sig_atomic_t sig_atomic_t; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/sigevent_t.h ================================================ #ifndef __sigevent_t_defined #define __sigevent_t_defined 1 #include #include #include #define __SIGEV_MAX_SIZE 64 #if __WORDSIZE == 64 # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4) #else # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) #endif /* Forward declaration. */ #ifndef __have_pthread_attr_t typedef union pthread_attr_t pthread_attr_t; # define __have_pthread_attr_t 1 #endif /* Structure to transport application-defined values with signals. */ typedef struct sigevent { __sigval_t sigev_value; int sigev_signo; int sigev_notify; union { int _pad[__SIGEV_PAD_SIZE]; /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the thread to receive the signal. */ __pid_t _tid; struct { void (*_function) (__sigval_t); /* Function to start. */ pthread_attr_t *_attribute; /* Thread attributes. */ } _sigev_thread; } _sigev_un; } sigevent_t; /* POSIX names to access some of the members. */ #define sigev_notify_function _sigev_un._sigev_thread._function #define sigev_notify_attributes _sigev_un._sigev_thread._attribute #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/siginfo_t.h ================================================ #ifndef __siginfo_t_defined #define __siginfo_t_defined 1 #include #include #include #define __SI_MAX_SIZE 128 #if __WORDSIZE == 64 # define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) #else # define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) #endif /* Some fields of siginfo_t have architecture-specific variations. */ #include #ifndef __SI_ALIGNMENT # define __SI_ALIGNMENT /* nothing */ #endif #ifndef __SI_BAND_TYPE # define __SI_BAND_TYPE long int #endif #ifndef __SI_CLOCK_T # define __SI_CLOCK_T __clock_t #endif #ifndef __SI_ERRNO_THEN_CODE # define __SI_ERRNO_THEN_CODE 1 #endif #ifndef __SI_HAVE_SIGSYS # define __SI_HAVE_SIGSYS 1 #endif #ifndef __SI_SIGFAULT_ADDL # define __SI_SIGFAULT_ADDL /* nothing */ #endif typedef struct { int si_signo; /* Signal number. */ #if __SI_ERRNO_THEN_CODE int si_errno; /* If non-zero, an errno value associated with this signal, as defined in . */ int si_code; /* Signal code. */ #else int si_code; int si_errno; #endif #if __WORDSIZE == 64 int __pad0; /* Explicit padding. */ #endif union { int _pad[__SI_PAD_SIZE]; /* kill(). */ struct { __pid_t si_pid; /* Sending process ID. */ __uid_t si_uid; /* Real user ID of sending process. */ } _kill; /* POSIX.1b timers. */ struct { int si_tid; /* Timer ID. */ int si_overrun; /* Overrun count. */ __sigval_t si_sigval; /* Signal value. */ } _timer; /* POSIX.1b signals. */ struct { __pid_t si_pid; /* Sending process ID. */ __uid_t si_uid; /* Real user ID of sending process. */ __sigval_t si_sigval; /* Signal value. */ } _rt; /* SIGCHLD. */ struct { __pid_t si_pid; /* Which child. */ __uid_t si_uid; /* Real user ID of sending process. */ int si_status; /* Exit value or signal. */ __SI_CLOCK_T si_utime; __SI_CLOCK_T si_stime; } _sigchld; /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */ struct { void *si_addr; /* Faulting insn/memory ref. */ __SI_SIGFAULT_ADDL short int si_addr_lsb; /* Valid LSB of the reported address. */ union { /* used when si_code=SEGV_BNDERR */ struct { void *_lower; void *_upper; } _addr_bnd; /* used when si_code=SEGV_PKUERR */ __uint32_t _pkey; } _bounds; } _sigfault; /* SIGPOLL. */ struct { long int si_band; /* Band event for SIGPOLL. */ int si_fd; } _sigpoll; /* SIGSYS. */ #if __SI_HAVE_SIGSYS struct { void *_call_addr; /* Calling user insn. */ int _syscall; /* Triggering system call number. */ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */ } _sigsys; #endif } _sifields; } siginfo_t __SI_ALIGNMENT; /* X/Open requires some more fields with fixed names. */ #define si_pid _sifields._kill.si_pid #define si_uid _sifields._kill.si_uid #define si_timerid _sifields._timer.si_tid #define si_overrun _sifields._timer.si_overrun #define si_status _sifields._sigchld.si_status #define si_utime _sifields._sigchld.si_utime #define si_stime _sifields._sigchld.si_stime #define si_value _sifields._rt.si_sigval #define si_int _sifields._rt.si_sigval.sival_int #define si_ptr _sifields._rt.si_sigval.sival_ptr #define si_addr _sifields._sigfault.si_addr #define si_addr_lsb _sifields._sigfault.si_addr_lsb #define si_lower _sifields._sigfault._bounds._addr_bnd._lower #define si_upper _sifields._sigfault._bounds._addr_bnd._upper #define si_pkey _sifields._sigfault._bounds._pkey #define si_band _sifields._sigpoll.si_band #define si_fd _sifields._sigpoll.si_fd #if __SI_HAVE_SIGSYS # define si_call_addr _sifields._sigsys._call_addr # define si_syscall _sifields._sigsys._syscall # define si_arch _sifields._sigsys._arch #endif #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/sigset_t.h ================================================ #ifndef __sigset_t_defined #define __sigset_t_defined 1 #include /* A set of signals to be blocked, unblocked, or waited for. */ typedef __sigset_t sigset_t; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/sigval_t.h ================================================ #ifndef __sigval_t_defined #define __sigval_t_defined #include /* To avoid sigval_t (not a standard type name) having C++ name mangling depending on whether the selected standard includes union sigval, it should not be defined at all when using a standard for which the sigval name is not reserved; in that case, headers should not include and should use only the internal __sigval_t name. */ #ifndef __USE_POSIX199309 # error "sigval_t defined for standard not including union sigval" #endif typedef __sigval_t sigval_t; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/stack_t.h ================================================ /* Define stack_t. Linux version. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef __stack_t_defined #define __stack_t_defined 1 #define __need_size_t #include /* Structure describing a signal stack. */ typedef struct { void *ss_sp; int ss_flags; size_t ss_size; } stack_t; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/struct_iovec.h ================================================ /* Define struct iovec. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef __iovec_defined #define __iovec_defined 1 #define __need_size_t #include /* Structure for scatter/gather I/O. */ struct iovec { void *iov_base; /* Pointer to data. */ size_t iov_len; /* Length of data. */ }; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/struct_itimerspec.h ================================================ #ifndef __itimerspec_defined #define __itimerspec_defined 1 #include #include /* POSIX.1b structure for timer start values and intervals. */ struct itimerspec { struct timespec it_interval; struct timespec it_value; }; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/struct_osockaddr.h ================================================ #ifndef __osockaddr_defined #define __osockaddr_defined 1 /* This is the 4.3 BSD `struct sockaddr' format, which is used as wire format in the grotty old 4.3 `talk' protocol. */ struct osockaddr { unsigned short int sa_family; unsigned char sa_data[14]; }; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/struct_rusage.h ================================================ /* Define struct rusage. Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef __rusage_defined #define __rusage_defined 1 #include #include /* Structure which says how much of each resource has been used. */ /* The purpose of all the unions is to have the kernel-compatible layout while keeping the API type as 'long int', and among machines where __syscall_slong_t is not 'long int', this only does the right thing for little-endian ones, like x32. */ struct rusage { /* Total amount of user time used. */ struct timeval ru_utime; /* Total amount of system time used. */ struct timeval ru_stime; /* Maximum resident set size (in kilobytes). */ __extension__ union { long int ru_maxrss; __syscall_slong_t __ru_maxrss_word; }; /* Amount of sharing of text segment memory with other processes (kilobyte-seconds). */ /* Maximum resident set size (in kilobytes). */ __extension__ union { long int ru_ixrss; __syscall_slong_t __ru_ixrss_word; }; /* Amount of data segment memory used (kilobyte-seconds). */ __extension__ union { long int ru_idrss; __syscall_slong_t __ru_idrss_word; }; /* Amount of stack memory used (kilobyte-seconds). */ __extension__ union { long int ru_isrss; __syscall_slong_t __ru_isrss_word; }; /* Number of soft page faults (i.e. those serviced by reclaiming a page from the list of pages awaiting reallocation. */ __extension__ union { long int ru_minflt; __syscall_slong_t __ru_minflt_word; }; /* Number of hard page faults (i.e. those that required I/O). */ __extension__ union { long int ru_majflt; __syscall_slong_t __ru_majflt_word; }; /* Number of times a process was swapped out of physical memory. */ __extension__ union { long int ru_nswap; __syscall_slong_t __ru_nswap_word; }; /* Number of input operations via the file system. Note: This and `ru_oublock' do not include operations with the cache. */ __extension__ union { long int ru_inblock; __syscall_slong_t __ru_inblock_word; }; /* Number of output operations via the file system. */ __extension__ union { long int ru_oublock; __syscall_slong_t __ru_oublock_word; }; /* Number of IPC messages sent. */ __extension__ union { long int ru_msgsnd; __syscall_slong_t __ru_msgsnd_word; }; /* Number of IPC messages received. */ __extension__ union { long int ru_msgrcv; __syscall_slong_t __ru_msgrcv_word; }; /* Number of signals delivered. */ __extension__ union { long int ru_nsignals; __syscall_slong_t __ru_nsignals_word; }; /* Number of voluntary context switches, i.e. because the process gave up the process before it had to (usually to wait for some resource to be available). */ __extension__ union { long int ru_nvcsw; __syscall_slong_t __ru_nvcsw_word; }; /* Number of involuntary context switches, i.e. a higher priority process became runnable or the current process used up its time slice. */ __extension__ union { long int ru_nivcsw; __syscall_slong_t __ru_nivcsw_word; }; }; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/struct_sigstack.h ================================================ /* Define struct sigstack. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef __sigstack_defined #define __sigstack_defined 1 /* Structure describing a signal stack (obsolete). */ struct sigstack { void *ss_sp; /* Signal stack pointer. */ int ss_onstack; /* Nonzero if executing on this stack. */ }; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/struct_timespec.h ================================================ #ifndef __timespec_defined #define __timespec_defined 1 #include /* POSIX.1b structure for a time value. This is like a `struct timeval' but has nanoseconds instead of microseconds. */ struct timespec { __time_t tv_sec; /* Seconds. */ __syscall_slong_t tv_nsec; /* Nanoseconds. */ }; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/struct_timeval.h ================================================ #ifndef __timeval_defined #define __timeval_defined 1 #include /* A time value that is accurate to the nearest microsecond but also has a range of years. */ struct timeval { __time_t tv_sec; /* Seconds. */ __suseconds_t tv_usec; /* Microseconds. */ }; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/struct_tm.h ================================================ #ifndef __struct_tm_defined #define __struct_tm_defined 1 #include /* ISO C `broken-down time' structure. */ struct tm { int tm_sec; /* Seconds. [0-60] (1 leap second) */ int tm_min; /* Minutes. [0-59] */ int tm_hour; /* Hours. [0-23] */ int tm_mday; /* Day. [1-31] */ int tm_mon; /* Month. [0-11] */ int tm_year; /* Year - 1900. */ int tm_wday; /* Day of week. [0-6] */ int tm_yday; /* Days in year.[0-365] */ int tm_isdst; /* DST. [-1/0/1] */ # ifdef __USE_MISC long int tm_gmtoff; /* Seconds east of UTC. */ const char *tm_zone; /* Timezone abbreviation. */ # else long int __tm_gmtoff; /* Seconds east of UTC. */ const char *__tm_zone; /* Timezone abbreviation. */ # endif }; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/time_t.h ================================================ #ifndef __time_t_defined #define __time_t_defined 1 #include /* Returned by `time'. */ typedef __time_t time_t; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/timer_t.h ================================================ #ifndef __timer_t_defined #define __timer_t_defined 1 #include /* Timer ID returned by `timer_create'. */ typedef __timer_t timer_t; #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types/wint_t.h ================================================ #ifndef __wint_t_defined #define __wint_t_defined 1 /* Some versions of stddef.h provide wint_t, even though neither the C nor C++ standards, nor POSIX, specifies this. We assume that stddef.h will define the macro _WINT_T if and only if it provides wint_t, and conversely, that it will avoid providing wint_t if _WINT_T is already defined. */ #ifndef _WINT_T #define _WINT_T 1 /* Integral type unchanged by default argument promotions that can hold any value corresponding to members of the extended character set, as well as at least one value that does not correspond to any member of the extended character set. */ #ifndef __WINT_TYPE__ # define __WINT_TYPE__ unsigned int #endif typedef __WINT_TYPE__ wint_t; #endif /* _WINT_T */ #endif /* bits/types/wint_t.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/types.h ================================================ /* bits/types.h -- definitions of __*_t types underlying *_t types. Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ #ifndef _BITS_TYPES_H #define _BITS_TYPES_H 1 #include #include /* Convenience types. */ typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; /* Fixed-size types, underlying types depend on word size and compiler. */ typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; #if __WORDSIZE == 64 typedef signed long int __int64_t; typedef unsigned long int __uint64_t; #else __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; #endif /* quad_t is also 64 bits. */ #if __WORDSIZE == 64 typedef long int __quad_t; typedef unsigned long int __u_quad_t; #else __extension__ typedef long long int __quad_t; __extension__ typedef unsigned long long int __u_quad_t; #endif /* Largest integral types. */ #if __WORDSIZE == 64 typedef long int __intmax_t; typedef unsigned long int __uintmax_t; #else __extension__ typedef long long int __intmax_t; __extension__ typedef unsigned long long int __uintmax_t; #endif /* The machine-dependent file defines __*_T_TYPE macros for each of the OS types we define below. The definitions of those macros must use the following macros for underlying types. We define __S_TYPE and __U_TYPE for the signed and unsigned variants of each of the following integer types on this machine. 16 -- "natural" 16-bit type (always short) 32 -- "natural" 32-bit type (always int) 64 -- "natural" 64-bit type (long or long long) LONG32 -- 32-bit type, traditionally long QUAD -- 64-bit type, always long long WORD -- natural type of __WORDSIZE bits (int or long) LONGWORD -- type of __WORDSIZE bits, traditionally long We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the conventional uses of `long' or `long long' type modifiers match the types we define, even when a less-adorned type would be the same size. This matters for (somewhat) portably writing printf/scanf formats for these types, where using the appropriate l or ll format modifiers can make the typedefs and the formats match up across all GNU platforms. If we used `long' when it's 64 bits where `long long' is expected, then the compiler would warn about the formats not matching the argument types, and the programmer changing them to shut up the compiler would break the program's portability. Here we assume what is presently the case in all the GCC configurations we support: long long is always 64 bits, long is always word/address size, and int is always 32 bits. */ #define __S16_TYPE short int #define __U16_TYPE unsigned short int #define __S32_TYPE int #define __U32_TYPE unsigned int #define __SLONGWORD_TYPE long int #define __ULONGWORD_TYPE unsigned long int #if __WORDSIZE == 32 # define __SQUAD_TYPE __quad_t # define __UQUAD_TYPE __u_quad_t # define __SWORD_TYPE int # define __UWORD_TYPE unsigned int # define __SLONG32_TYPE long int # define __ULONG32_TYPE unsigned long int # define __S64_TYPE __quad_t # define __U64_TYPE __u_quad_t /* We want __extension__ before typedef's that use nonstandard base types such as `long long' in C89 mode. */ # define __STD_TYPE __extension__ typedef #elif __WORDSIZE == 64 # define __SQUAD_TYPE long int # define __UQUAD_TYPE unsigned long int # define __SWORD_TYPE long int # define __UWORD_TYPE unsigned long int # define __SLONG32_TYPE int # define __ULONG32_TYPE unsigned int # define __S64_TYPE long int # define __U64_TYPE unsigned long int /* No need to mark the typedef with __extension__. */ # define __STD_TYPE typedef #else # error #endif #include /* Defines __*_T_TYPE macros. */ __STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */ __STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */ __STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */ __STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */ __STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS). */ __STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */ __STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */ __STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */ __STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */ __STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */ __STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */ __STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */ __STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */ __STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */ __STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */ __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ __STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ __STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ __STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ /* Clock ID used in clock and timer functions. */ __STD_TYPE __CLOCKID_T_TYPE __clockid_t; /* Timer ID returned by `timer_create'. */ __STD_TYPE __TIMER_T_TYPE __timer_t; /* Type to represent block size. */ __STD_TYPE __BLKSIZE_T_TYPE __blksize_t; /* Types from the Large File Support interface. */ /* Type to count number of disk blocks. */ __STD_TYPE __BLKCNT_T_TYPE __blkcnt_t; __STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t; /* Type to count file system blocks. */ __STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t; __STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t; /* Type to count file system nodes. */ __STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t; __STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t; /* Type of miscellaneous file system fields. */ __STD_TYPE __FSWORD_T_TYPE __fsword_t; __STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */ /* Signed long type used in system calls. */ __STD_TYPE __SYSCALL_SLONG_TYPE __syscall_slong_t; /* Unsigned long type used in system calls. */ __STD_TYPE __SYSCALL_ULONG_TYPE __syscall_ulong_t; /* These few don't really vary by system, they always correspond to one of the other defined types. */ typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */ typedef char *__caddr_t; /* Duplicates info from stdint.h but this is used in unistd.h. */ __STD_TYPE __SWORD_TYPE __intptr_t; /* Duplicate info from sys/socket.h. */ __STD_TYPE __U32_TYPE __socklen_t; /* C99: An integer type that can be accessed as an atomic entity, even in the presence of asynchronous interrupts. It is not currently necessary for this to be machine-specific. */ typedef int __sig_atomic_t; #undef __STD_TYPE #endif /* bits/types.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/typesizes.h ================================================ /* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version. Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_TYPES_H # error "Never include directly; use instead." #endif #ifndef _BITS_TYPESIZES_H #define _BITS_TYPESIZES_H 1 /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ /* X32 kernel interface is 64-bit. */ #if defined __x86_64__ && defined __ILP32__ # define __SYSCALL_SLONG_TYPE __SQUAD_TYPE # define __SYSCALL_ULONG_TYPE __UQUAD_TYPE #else # define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE # define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #endif #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE #define __INO_T_TYPE __SYSCALL_ULONG_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #ifdef __x86_64__ # define __NLINK_T_TYPE __SYSCALL_ULONG_TYPE # define __FSWORD_T_TYPE __SYSCALL_SLONG_TYPE #else # define __NLINK_T_TYPE __UWORD_TYPE # define __FSWORD_T_TYPE __SWORD_TYPE #endif #define __OFF_T_TYPE __SYSCALL_SLONG_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE #define __RLIM_T_TYPE __SYSCALL_ULONG_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE #define __BLKCNT_T_TYPE __SYSCALL_SLONG_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE #define __FSBLKCNT_T_TYPE __SYSCALL_ULONG_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE #define __FSFILCNT_T_TYPE __SYSCALL_ULONG_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SYSCALL_SLONG_TYPE #define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE #define __TIMER_T_TYPE void * #define __BLKSIZE_T_TYPE __SYSCALL_SLONG_TYPE #define __FSID_T_TYPE struct { int __val[2]; } #define __SSIZE_T_TYPE __SWORD_TYPE #define __CPU_MASK_TYPE __SYSCALL_ULONG_TYPE #ifdef __x86_64__ /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ # define __OFF_T_MATCHES_OFF64_T 1 /* Same for ino_t and ino64_t. */ # define __INO_T_MATCHES_INO64_T 1 /* And for __rlim_t and __rlim64_t. */ # define __RLIM_T_MATCHES_RLIM64_T 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 #endif /* bits/typesizes.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/uintn-identity.h ================================================ /* Inline functions to return unsigned integer values unchanged. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _NETINET_IN_H && !defined _ENDIAN_H # error "Never use directly; include or instead." #endif #ifndef _BITS_UINTN_IDENTITY_H #define _BITS_UINTN_IDENTITY_H 1 #include /* These inline functions are to ensure the appropriate type conversions and associated diagnostics from macros that convert to a given endianness. */ static __inline __uint16_t __uint16_identity(__uint16_t __x) { return __x; } static __inline __uint32_t __uint32_identity(__uint32_t __x) { return __x; } static __inline __uint64_t __uint64_identity(__uint64_t __x) { return __x; } #endif /* _BITS_UINTN_IDENTITY_H. */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/uio_lim.h ================================================ /* Implementation limits related to sys/uio.h - Linux version. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_UIO_LIM_H #define _BITS_UIO_LIM_H 1 /* Maximum length of the 'struct iovec' array in a single call to readv or writev. This macro has different values in different kernel versions. The latest versions of the kernel use 1024 and this is good choice. Since the C library implementation of readv/writev is able to emulate the functionality even if the currently running kernel does not support this large value the readv/writev call will not fail because of this. */ #define __IOV_MAX 1024 #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/utsname.h ================================================ /* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_UTSNAME_H # error "Never include directly; use instead." #endif /* Length of the entries in `struct utsname' is 65. */ #define _UTSNAME_LENGTH 65 /* Linux provides as additional information in the `struct utsname' the name of the current domain. Define _UTSNAME_DOMAIN_LENGTH to a value != 0 to activate this entry. */ #define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/waitflags.h ================================================ /* Definitions of flag bits for `waitpid' et al. Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SYS_WAIT_H && !defined _STDLIB_H # error "Never include directly; use instead." #endif /* Bits in the third argument to `waitpid'. */ #define WNOHANG 1 /* Don't block waiting. */ #define WUNTRACED 2 /* Report status of stopped children. */ /* Bits in the fourth argument to `waitid'. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 # define WSTOPPED 2 /* Report stopped child (same as WUNTRACED). */ # define WEXITED 4 /* Report dead child. */ # define WCONTINUED 8 /* Report continued child. */ # define WNOWAIT 0x01000000 /* Don't reap, just poll status. */ #endif #define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads in this group */ #define __WALL 0x40000000 /* Wait for any child. */ #define __WCLONE 0x80000000 /* Wait for cloned process. */ /* The following values are used by the `waitid' function. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 # ifndef __ENUM_IDTYPE_T # define __ENUM_IDTYPE_T 1 /* The Linux kernel defines these bare, rather than an enum, which causes a conflict if the include order is reversed. */ # undef P_ALL # undef P_PID # undef P_PGID typedef enum { P_ALL, /* Wait for any child. */ P_PID, /* Wait for specified process. */ P_PGID /* Wait for members of process group. */ } idtype_t; # endif #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/waitstatus.h ================================================ /* Definitions of status bits for `wait' et al. Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SYS_WAIT_H && !defined _STDLIB_H # error "Never include directly; use instead." #endif /* Everything extant so far uses these same bits. */ /* If WIFEXITED(STATUS), the low-order 8 bits of the status. */ #define __WEXITSTATUS(status) (((status) & 0xff00) >> 8) /* If WIFSIGNALED(STATUS), the terminating signal. */ #define __WTERMSIG(status) ((status) & 0x7f) /* If WIFSTOPPED(STATUS), the signal that stopped the child. */ #define __WSTOPSIG(status) __WEXITSTATUS(status) /* Nonzero if STATUS indicates normal termination. */ #define __WIFEXITED(status) (__WTERMSIG(status) == 0) /* Nonzero if STATUS indicates termination by a signal. */ #define __WIFSIGNALED(status) \ (((signed char) (((status) & 0x7f) + 1) >> 1) > 0) /* Nonzero if STATUS indicates the child is stopped. */ #define __WIFSTOPPED(status) (((status) & 0xff) == 0x7f) /* Nonzero if STATUS indicates the child continued after a stop. We only define this if provides the WCONTINUED flag bit. */ #ifdef WCONTINUED # define __WIFCONTINUED(status) ((status) == __W_CONTINUED) #endif /* Nonzero if STATUS indicates the child dumped core. */ #define __WCOREDUMP(status) ((status) & __WCOREFLAG) /* Macros for constructing status values. */ #define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) #define __W_STOPCODE(sig) ((sig) << 8 | 0x7f) #define __W_CONTINUED 0xffff #define __WCOREFLAG 0x80 ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/wchar.h ================================================ /* wchar_t type related definitions. Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_WCHAR_H #define _BITS_WCHAR_H 1 /* The fallback definitions, for when __WCHAR_MAX__ or __WCHAR_MIN__ are not defined, give the right value and type as long as both int and wchar_t are 32-bit types. Adding L'\0' to a constant value ensures that the type is correct; it is necessary to use (L'\0' + 0) rather than just L'\0' so that the type in C++ is the promoted version of wchar_t rather than the distinct wchar_t type itself. Because wchar_t in preprocessor #if expressions is treated as intmax_t or uintmax_t, the expression (L'\0' - 1) would have the wrong value for WCHAR_MAX in such expressions and so cannot be used to define __WCHAR_MAX in the unsigned case. */ #ifdef __WCHAR_MAX__ # define __WCHAR_MAX __WCHAR_MAX__ #elif L'\0' - 1 > 0 # define __WCHAR_MAX (0xffffffffu + L'\0') #else # define __WCHAR_MAX (0x7fffffff + L'\0') #endif #ifdef __WCHAR_MIN__ # define __WCHAR_MIN __WCHAR_MIN__ #elif L'\0' - 1 > 0 # define __WCHAR_MIN (L'\0' + 0) #else # define __WCHAR_MIN (-__WCHAR_MAX - 1) #endif #endif /* bits/wchar.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/wordsize.h ================================================ /* Determine the wordsize from the preprocessor defines. */ #if defined __x86_64__ && !defined __ILP32__ # define __WORDSIZE 64 #else # define __WORDSIZE 32 #define __WORDSIZE32_SIZE_ULONG 0 #define __WORDSIZE32_PTRDIFF_LONG 0 #endif #ifdef __x86_64__ # define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 #else # define __WORDSIZE_TIME64_COMPAT32 0 #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/bits/xopen_lim.h ================================================ /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ /* Additional definitions from X/Open Portability Guide, Issue 4, Version 2 System Interfaces and Headers, 4.16 Please note only the values which are not greater than the minimum stated in the standard document are listed. The `sysconf' functions should be used to obtain the actual value. */ #ifndef _XOPEN_LIM_H #define _XOPEN_LIM_H 1 /* We do not provide fixed values for ARG_MAX Maximum length of argument to the `exec' function including environment data. ATEXIT_MAX Maximum number of functions that may be registered with `atexit'. CHILD_MAX Maximum number of simultaneous processes per real user ID. OPEN_MAX Maximum number of files that one process can have open at anyone time. PAGESIZE PAGE_SIZE Size of bytes of a page. PASS_MAX Maximum number of significant bytes in a password. We only provide a fixed limit for IOV_MAX Maximum number of `iovec' structures that one process has available for use with `readv' or writev'. if this is indeed fixed by the underlying system. */ /* Maximum number of `iovec' structures that may be used in a single call to `readv', `writev', etc. */ #define _XOPEN_IOV_MAX _POSIX_UIO_MAXIOV #include #ifdef __IOV_MAX # define IOV_MAX __IOV_MAX #else # undef IOV_MAX #endif /* Maximum value of `digit' in calls to the `printf' and `scanf' functions. We have no limit, so return a reasonable value. */ #define NL_ARGMAX _POSIX_ARG_MAX /* Maximum number of bytes in a `LANG' name. We have no limit. */ #define NL_LANGMAX _POSIX2_LINE_MAX /* Maximum message number. We have no limit. */ #define NL_MSGMAX INT_MAX /* Maximum number of bytes in N-to-1 collation mapping. We have no limit. */ #if defined __USE_GNU || !defined __USE_XOPEN2K8 # define NL_NMAX INT_MAX #endif /* Maximum set number. We have no limit. */ #define NL_SETMAX INT_MAX /* Maximum number of bytes in a message. We have no limit. */ #define NL_TEXTMAX INT_MAX /* Default process priority. */ #define NZERO 20 /* Number of bits in a word of type `int'. */ #ifdef INT_MAX # if INT_MAX == 32767 # define WORD_BIT 16 # else # if INT_MAX == 2147483647 # define WORD_BIT 32 # else /* Safe assumption. */ # define WORD_BIT 64 # endif # endif #elif defined __INT_MAX__ # if __INT_MAX__ == 32767 # define WORD_BIT 16 # else # if __INT_MAX__ == 2147483647 # define WORD_BIT 32 # else /* Safe assumption. */ # define WORD_BIT 64 # endif # endif #else # define WORD_BIT 32 #endif /* Number of bits in a word of type `long int'. */ #ifdef LONG_MAX # if LONG_MAX == 2147483647 # define LONG_BIT 32 # else /* Safe assumption. */ # define LONG_BIT 64 # endif #elif defined __LONG_MAX__ # if __LONG_MAX__ == 2147483647 # define LONG_BIT 32 # else /* Safe assumption. */ # define LONG_BIT 64 # endif #else # include # if __WORDSIZE == 64 # define LONG_BIT 64 # else # define LONG_BIT 32 # endif #endif #endif /* bits/xopen_lim.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/gnu/stubs-32.h ================================================ /* This file is automatically generated. It defines a symbol `__stub_FUNCTION' for each function in the C library which is a stub, meaning it will fail every time called, usually setting errno to ENOSYS. */ #ifdef _LIBC # error Applications may not define the macro _LIBC #endif #define __stub_chflags #define __stub_fattach #define __stub_fchflags #define __stub_fdetach #define __stub_gtty #define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn #define __stub_sstk #define __stub_stty ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/gnu/stubs.h ================================================ /* This file is automatically generated. This file selects the right generated file of `__stub_FUNCTION' macros based on the architecture being compiled for. */ #if !defined __x86_64__ # include #endif #if defined __x86_64__ && defined __LP64__ # include #endif #if defined __x86_64__ && defined __ILP32__ # include #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/cdefs.h ================================================ /* Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_CDEFS_H #define _SYS_CDEFS_H 1 /* We are almost always included from features.h. */ #ifndef _FEATURES_H # include #endif /* The GNU libc does not support any K&R compilers or the traditional mode of ISO C compilers anymore. Check for some of the combinations not anymore supported. */ #if defined __GNUC__ && !defined __STDC__ # error "You need a ISO C conforming compiler to use the glibc headers" #endif /* Some user header file might have defined this before. */ #undef __P #undef __PMT #ifdef __GNUC__ /* All functions, except those with callbacks or those that synchronize memory, are leaf functions. */ # if __GNUC_PREREQ (4, 6) && !defined _LIBC # define __LEAF , __leaf__ # define __LEAF_ATTR __attribute__ ((__leaf__)) # else # define __LEAF # define __LEAF_ATTR # endif /* GCC can always grok prototypes. For C++ programs we add throw() to help it optimize the function calls. But this works only with gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions as non-throwing using a function attribute since programs can use the -fexceptions options for C code as well. */ # if !defined __cplusplus && __GNUC_PREREQ (3, 3) # define __THROW __attribute__ ((__nothrow__ __LEAF)) # define __THROWNL __attribute__ ((__nothrow__)) # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct # define __NTHNL(fct) __attribute__ ((__nothrow__)) fct # else # if defined __cplusplus && __GNUC_PREREQ (2,8) # define __THROW throw () # define __THROWNL throw () # define __NTH(fct) __LEAF_ATTR fct throw () # define __NTHNL(fct) fct throw () # else # define __THROW # define __THROWNL # define __NTH(fct) fct # define __NTHNL(fct) fct # endif # endif #else /* Not GCC. */ # define __inline /* No inline functions. */ # define __THROW # define __THROWNL # define __NTH(fct) fct #endif /* GCC. */ /* Compilers that are not clang may object to #if defined __clang__ && __has_extension(...) even though they do not need to evaluate the right-hand side of the &&. */ #if defined __clang__ && defined __has_extension # define __glibc_clang_has_extension(ext) __has_extension (ext) #else # define __glibc_clang_has_extension(ext) 0 #endif /* These two macros are not used in glibc anymore. They are kept here only because some other projects expect the macros to be defined. */ #define __P(args) args #define __PMT(args) args /* For these things, GCC behaves the ANSI way normally, and the non-ANSI way under -traditional. */ #define __CONCAT(x,y) x ## y #define __STRING(x) #x /* This is not a typedef so `const __ptr_t' does the right thing. */ #define __ptr_t void * /* C++ needs to know that types and declarations are C, not C++. */ #ifdef __cplusplus # define __BEGIN_DECLS extern "C" { # define __END_DECLS } #else # define __BEGIN_DECLS # define __END_DECLS #endif /* Fortify support. */ #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) #define __bos0(ptr) __builtin_object_size (ptr, 0) #if __GNUC_PREREQ (4,3) # define __warndecl(name, msg) \ extern void name (void) __attribute__((__warning__ (msg))) # define __warnattr(msg) __attribute__((__warning__ (msg))) # define __errordecl(name, msg) \ extern void name (void) __attribute__((__error__ (msg))) #else # define __warndecl(name, msg) extern void name (void) # define __warnattr(msg) # define __errordecl(name, msg) extern void name (void) #endif /* Support for flexible arrays. Headers that should use flexible arrays only if they're "real" (e.g. only if they won't affect sizeof()) should test #if __glibc_c99_flexarr_available. */ #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __flexarr [] # define __glibc_c99_flexarr_available 1 #elif __GNUC_PREREQ (2,97) /* GCC 2.97 supports C99 flexible array members as an extension, even when in C89 mode or compiling C++ (any version). */ # define __flexarr [] # define __glibc_c99_flexarr_available 1 #elif defined __GNUC__ /* Pre-2.97 GCC did not support C99 flexible arrays but did have an equivalent extension with slightly different notation. */ # define __flexarr [0] # define __glibc_c99_flexarr_available 1 #else /* Some other non-C99 compiler. Approximate with [1]. */ # define __flexarr [1] # define __glibc_c99_flexarr_available 0 #endif /* __asm__ ("xyz") is used throughout the headers to rename functions at the assembly language level. This is wrapped by the __REDIRECT macro, in order to support compilers that can do this some other way. When compilers don't support asm-names at all, we have to do preprocessor tricks instead (which don't have exactly the right semantics, but it's the best we can do). Example: int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ #if defined __GNUC__ && __GNUC__ >= 2 # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) # ifdef __cplusplus # define __REDIRECT_NTH(name, proto, alias) \ name proto __THROW __asm__ (__ASMNAME (#alias)) # define __REDIRECT_NTHNL(name, proto, alias) \ name proto __THROWNL __asm__ (__ASMNAME (#alias)) # else # define __REDIRECT_NTH(name, proto, alias) \ name proto __asm__ (__ASMNAME (#alias)) __THROW # define __REDIRECT_NTHNL(name, proto, alias) \ name proto __asm__ (__ASMNAME (#alias)) __THROWNL # endif # define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) # define __ASMNAME2(prefix, cname) __STRING (prefix) cname /* #elif __SOME_OTHER_COMPILER__ # define __REDIRECT(name, proto, alias) name proto; \ _Pragma("let " #name " = " #alias) */ #endif /* GCC has various useful declarations that can be made with the `__attribute__' syntax. All of the ways we use this do fine if they are omitted for compilers that don't understand it. */ #if !defined __GNUC__ || __GNUC__ < 2 # define __attribute__(xyz) /* Ignore */ #endif /* At some point during the gcc 2.96 development the `malloc' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,96) # define __attribute_malloc__ __attribute__ ((__malloc__)) #else # define __attribute_malloc__ /* Ignore */ #endif /* Tell the compiler which arguments to an allocation function indicate the size of the allocation. */ #if __GNUC_PREREQ (4, 3) # define __attribute_alloc_size__(params) \ __attribute__ ((__alloc_size__ params)) #else # define __attribute_alloc_size__(params) /* Ignore. */ #endif /* At some point during the gcc 2.96 development the `pure' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,96) # define __attribute_pure__ __attribute__ ((__pure__)) #else # define __attribute_pure__ /* Ignore */ #endif /* This declaration tells the compiler that the value is constant. */ #if __GNUC_PREREQ (2,5) # define __attribute_const__ __attribute__ ((__const__)) #else # define __attribute_const__ /* Ignore */ #endif /* At some point during the gcc 3.1 development the `used' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (3,1) # define __attribute_used__ __attribute__ ((__used__)) # define __attribute_noinline__ __attribute__ ((__noinline__)) #else # define __attribute_used__ __attribute__ ((__unused__)) # define __attribute_noinline__ /* Ignore */ #endif /* Since version 3.2, gcc allows marking deprecated functions. */ #if __GNUC_PREREQ (3,2) # define __attribute_deprecated__ __attribute__ ((__deprecated__)) #else # define __attribute_deprecated__ /* Ignore */ #endif /* Since version 4.5, gcc also allows one to specify the message printed when a deprecated function is used. clang claims to be gcc 4.2, but may also support this feature. */ #if __GNUC_PREREQ (4,5) || \ __glibc_clang_has_extension (__attribute_deprecated_with_message__) # define __attribute_deprecated_msg__(msg) \ __attribute__ ((__deprecated__ (msg))) #else # define __attribute_deprecated_msg__(msg) __attribute_deprecated__ #endif /* At some point during the gcc 2.8 development the `format_arg' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. If several `format_arg' attributes are given for the same function, in gcc-3.0 and older, all but the last one are ignored. In newer gccs, all designated arguments are considered. */ #if __GNUC_PREREQ (2,8) # define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) #else # define __attribute_format_arg__(x) /* Ignore */ #endif /* At some point during the gcc 2.97 development the `strfmon' format attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,97) # define __attribute_format_strfmon__(a,b) \ __attribute__ ((__format__ (__strfmon__, a, b))) #else # define __attribute_format_strfmon__(a,b) /* Ignore */ #endif /* The nonull function attribute allows to mark pointer parameters which must not be NULL. */ #if __GNUC_PREREQ (3,3) # define __nonnull(params) __attribute__ ((__nonnull__ params)) #else # define __nonnull(params) #endif /* If fortification mode, we warn about unused results of certain function calls which can lead to problems. */ #if __GNUC_PREREQ (3,4) # define __attribute_warn_unused_result__ \ __attribute__ ((__warn_unused_result__)) # if __USE_FORTIFY_LEVEL > 0 # define __wur __attribute_warn_unused_result__ # endif #else # define __attribute_warn_unused_result__ /* empty */ #endif #ifndef __wur # define __wur /* Ignore */ #endif /* Forces a function to be always inlined. */ #if __GNUC_PREREQ (3,2) /* The Linux kernel defines __always_inline in stddef.h (283d7573), and it conflicts with this definition. Therefore undefine it first to allow either header to be included first. */ # undef __always_inline # define __always_inline __inline __attribute__ ((__always_inline__)) #else # undef __always_inline # define __always_inline __inline #endif /* Associate error messages with the source location of the call site rather than with the source location inside the function. */ #if __GNUC_PREREQ (4,3) # define __attribute_artificial__ __attribute__ ((__artificial__)) #else # define __attribute_artificial__ /* Ignore */ #endif /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions older than 4.3 may define these macros and still not guarantee GNU inlining semantics. clang++ identifies itself as gcc-4.2, but has support for GNU inlining semantics, that can be checked fot by using the __GNUC_STDC_INLINE_ and __GNUC_GNU_INLINE__ macro definitions. */ #if (!defined __cplusplus || __GNUC_PREREQ (4,3) \ || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \ || defined __GNUC_GNU_INLINE__))) # if defined __GNUC_STDC_INLINE__ || defined __cplusplus # define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) # define __extern_always_inline \ extern __always_inline __attribute__ ((__gnu_inline__)) # else # define __extern_inline extern __inline # define __extern_always_inline extern __always_inline # endif #endif #ifdef __extern_always_inline # define __fortify_function __extern_always_inline __attribute_artificial__ #endif /* GCC 4.3 and above allow passing all anonymous arguments of an __extern_always_inline function to some other vararg function. */ #if __GNUC_PREREQ (4,3) # define __va_arg_pack() __builtin_va_arg_pack () # define __va_arg_pack_len() __builtin_va_arg_pack_len () #endif /* It is possible to compile containing GCC extensions even if GCC is run in pedantic mode if the uses are carefully marked using the `__extension__' keyword. But this is not generally available before version 2.8. */ #if !__GNUC_PREREQ (2,8) # define __extension__ /* Ignore */ #endif /* __restrict is known in EGCS 1.2 and above. */ #if !__GNUC_PREREQ (2,92) # define __restrict /* Ignore */ #endif /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is array_name[restrict] GCC 3.1 supports this. */ #if __GNUC_PREREQ (3,1) && !defined __GNUG__ # define __restrict_arr __restrict #else # ifdef __GNUC__ # define __restrict_arr /* Not supported in old GCC. */ # else # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __restrict_arr restrict # else /* Some other non-C99 compiler. */ # define __restrict_arr /* Not supported. */ # endif # endif #endif #if __GNUC__ >= 3 # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) # define __glibc_likely(cond) __builtin_expect ((cond), 1) #else # define __glibc_unlikely(cond) (cond) # define __glibc_likely(cond) (cond) #endif #if (!defined _Noreturn \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ && !__GNUC_PREREQ (4,7)) # if __GNUC_PREREQ (2,8) # define _Noreturn __attribute__ ((__noreturn__)) # else # define _Noreturn # endif #endif #if __GNUC_PREREQ (8, 0) /* Describes a char array whose address can safely be passed as the first argument to strncpy and strncat, as the char array is not necessarily a NUL-terminated string. */ # define __attribute_nonstring__ __attribute__ ((__nonstring__)) #else # define __attribute_nonstring__ #endif #if (!defined _Static_assert && !defined __cplusplus \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) # define _Static_assert(expr, diagnostic) \ extern int (*__Static_assert_function (void)) \ [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] #endif #include #include #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH # define __LDBL_COMPAT 1 # ifdef __REDIRECT # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) # define __LDBL_REDIR(name, proto) \ __LDBL_REDIR1 (name, proto, __nldbl_##name) # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) # define __LDBL_REDIR_NTH(name, proto) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) # define __LDBL_REDIR1_DECL(name, alias) \ extern __typeof (name) name __asm (__ASMNAME (#alias)); # define __LDBL_REDIR_DECL(name) \ extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name)); # define __REDIRECT_LDBL(name, proto, alias) \ __LDBL_REDIR1 (name, proto, __nldbl_##alias) # define __REDIRECT_NTH_LDBL(name, proto, alias) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) # endif #endif #if !defined __LDBL_COMPAT || !defined __REDIRECT # define __LDBL_REDIR1(name, proto, alias) name proto # define __LDBL_REDIR(name, proto) name proto # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW # define __LDBL_REDIR_NTH(name, proto) name proto __THROW # define __LDBL_REDIR_DECL(name) # ifdef __REDIRECT # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) # define __REDIRECT_NTH_LDBL(name, proto, alias) \ __REDIRECT_NTH (name, proto, alias) # endif #endif /* __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is intended for use in preprocessor macros. Note: MESSAGE must be a _single_ string; concatenation of string literals is not supported. */ #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5) # define __glibc_macro_warning1(message) _Pragma (#message) # define __glibc_macro_warning(message) \ __glibc_macro_warning1 (GCC warning message) #else # define __glibc_macro_warning(msg) #endif /* Generic selection (ISO C11) is a C-only feature, available in GCC since version 4.9. Previous versions do not provide generic selection, even though they might set __STDC_VERSION__ to 201112L, when in -std=c11 mode. Thus, we must check for !defined __GNUC__ when testing __STDC_VERSION__ for generic selection support. On the other hand, Clang also defines __GNUC__, so a clang-specific check is required to enable the use of generic selection. */ #if !defined __cplusplus \ && (__GNUC_PREREQ (4, 9) \ || __glibc_clang_has_extension (c_generic_selections) \ || (!defined __GNUC__ && defined __STDC_VERSION__ \ && __STDC_VERSION__ >= 201112L)) # define __HAVE_GENERIC_SELECTION 1 #else # define __HAVE_GENERIC_SELECTION 0 #endif #endif /* sys/cdefs.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/file.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_FILE_H #define _SYS_FILE_H 1 #include #ifndef _FCNTL_H # include #endif __BEGIN_DECLS /* Alternate names for values for the WHENCE argument to `lseek'. These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */ #ifndef L_SET # define L_SET 0 /* Seek from beginning of file. */ # define L_INCR 1 /* Seek from current position. */ # define L_XTND 2 /* Seek from end of file. */ #endif /* Operations for the `flock' call. */ #define LOCK_SH 1 /* Shared lock. */ #define LOCK_EX 2 /* Exclusive lock. */ #define LOCK_UN 8 /* Unlock. */ #define __LOCK_ATOMIC 16 /* Atomic update. */ /* Can be OR'd in to one of the above. */ #define LOCK_NB 4 /* Don't block when locking. */ /* Apply or remove an advisory lock, according to OPERATION, on the file FD refers to. */ extern int flock(int __fd, int __operation) __THROW; __END_DECLS #endif /* sys/file.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/ioctl.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_IOCTL_H #define _SYS_IOCTL_H 1 #include __BEGIN_DECLS /* Get the list of `ioctl' requests and related constants. */ #include /* Define some types used by `ioctl' requests. */ #include /* On a Unix system, the system probably defines some of the symbols we define in (usually with the same values). The code to generate has omitted these symbols to avoid the conflict, but a Unix program expects to define them, so we must include here. */ #include /* Perform the I/O control operation specified by REQUEST on FD. One argument may follow; its presence and type depend on REQUEST. Return value depends on REQUEST. Usually -1 indicates error. */ extern int ioctl(int __fd, unsigned long int __request, ...) __THROW; __END_DECLS #endif /* sys/ioctl.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/mman.h ================================================ /* Definitions for BSD-style memory management. Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_MMAN_H #define _SYS_MMAN_H 1 #include #include #define __need_size_t #include #ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined #endif #ifndef __mode_t_defined typedef __mode_t mode_t; # define __mode_t_defined #endif #include /* Return value of `mmap' in case of an error. */ #define MAP_FAILED ((void *) -1) __BEGIN_DECLS /* Map addresses starting near ADDR and extending for LEN bytes. from OFFSET into the file FD describes according to PROT and FLAGS. If ADDR is nonzero, it is the desired mapping address. If the MAP_FIXED bit is set in FLAGS, the mapping will be at ADDR exactly (which must be page-aligned); otherwise the system chooses a convenient nearby address. The return value is the actual mapping address chosen or MAP_FAILED for errors (in which case `errno' is set). A successful `mmap' call deallocates any previous mapping for the affected region. */ #ifndef __USE_FILE_OFFSET64 extern void *mmap(void *__addr, size_t __len, int __prot, int __flags, int __fd, __off_t __offset) __THROW; #else # ifdef __REDIRECT_NTH extern void *__REDIRECT_NTH(mmap, (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset), mmap64); # else # define mmap mmap64 # endif #endif #ifdef __USE_LARGEFILE64 extern void *mmap64(void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset) __THROW; #endif /* Deallocate any mapping for the region starting at ADDR and extending LEN bytes. Returns 0 if successful, -1 for errors (and sets errno). */ extern int munmap(void *__addr, size_t __len) __THROW; /* Change the memory protection of the region starting at ADDR and extending LEN bytes to PROT. Returns 0 if successful, -1 for errors (and sets errno). */ extern int mprotect(void *__addr, size_t __len, int __prot) __THROW; /* Synchronize the region starting at ADDR and extending LEN bytes with the file it maps. Filesystem operations on a file being mapped are unpredictable before this is done. Flags are from the MS_* set. This function is a cancellation point and therefore not marked with __THROW. */ extern int msync(void *__addr, size_t __len, int __flags); #ifdef __USE_MISC /* Advise the system about particular usage patterns the program follows for the region starting at ADDR and extending LEN bytes. */ extern int madvise(void *__addr, size_t __len, int __advice) __THROW; #endif #ifdef __USE_XOPEN2K /* This is the POSIX name for this function. */ extern int posix_madvise(void *__addr, size_t __len, int __advice) __THROW; #endif /* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to be memory resident. */ extern int mlock(const void *__addr, size_t __len) __THROW; /* Unlock whole pages previously mapped by the range [ADDR,ADDR+LEN). */ extern int munlock(const void *__addr, size_t __len) __THROW; /* Cause all currently mapped pages of the process to be memory resident until unlocked by a call to the `munlockall', until the process exits, or until the process calls `execve'. */ extern int mlockall(int __flags) __THROW; /* All currently mapped pages of the process' address space become unlocked. */ extern int munlockall(void) __THROW; #ifdef __USE_MISC /* mincore returns the memory residency status of the pages in the current process's address space specified by [start, start + len). The status is returned in a vector of bytes. The least significant bit of each byte is 1 if the referenced page is in memory, otherwise it is zero. */ extern int mincore(void *__start, size_t __len, unsigned char *__vec) __THROW; #endif #ifdef __USE_GNU /* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length NEW_LEN. If MREMAP_MAYMOVE is set in FLAGS the returned address may differ from ADDR. If MREMAP_FIXED is set in FLAGS the function takes another parameter which is a fixed address at which the block resides after a successful call. */ extern void *mremap(void *__addr, size_t __old_len, size_t __new_len, int __flags, ...) __THROW; /* Remap arbitrary pages of a shared backing store within an existing VMA. */ extern int remap_file_pages(void *__start, size_t __size, int __prot, size_t __pgoff, int __flags) __THROW; #endif /* Open shared memory segment. */ extern int shm_open(const char *__name, int __oflag, mode_t __mode); /* Remove shared memory segment. */ extern int shm_unlink(const char *__name); __END_DECLS #endif /* sys/mman.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/param.h ================================================ /* Compatibility header for old-style Unix parameters and limits. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_PARAM_H #define _SYS_PARAM_H 1 #define __need_NULL #include #include #include #include /* Define BYTE_ORDER et al. */ #include /* Define NSIG. */ /* This file defines some things in system-specific ways. */ #include /* BSD names for some values. */ #define NBBY CHAR_BIT #if !defined NGROUPS && defined NGROUPS_MAX # define NGROUPS NGROUPS_MAX #endif #if !defined MAXSYMLINKS && defined SYMLOOP_MAX # define MAXSYMLINKS SYMLOOP_MAX #endif #if !defined CANBSIZ && defined MAX_CANON # define CANBSIZ MAX_CANON #endif #if !defined MAXPATHLEN && defined PATH_MAX # define MAXPATHLEN PATH_MAX #endif #if !defined NOFILE && defined OPEN_MAX # define NOFILE OPEN_MAX #endif #if !defined MAXHOSTNAMELEN && defined HOST_NAME_MAX # define MAXHOSTNAMELEN HOST_NAME_MAX #endif #ifndef NCARGS # ifdef ARG_MAX # define NCARGS ARG_MAX # else /* ARG_MAX is unlimited, but we define NCARGS for BSD programs that want to compare against some fixed limit. */ # define NCARGS INT_MAX # endif #endif /* Magical constants. */ #ifndef NOGROUP # define NOGROUP 65535 /* Marker for empty group set member. */ #endif #ifndef NODEV # define NODEV ((dev_t) -1) /* Non-existent device. */ #endif /* Unit of `st_blocks'. */ #ifndef DEV_BSIZE # define DEV_BSIZE 512 #endif /* Bit map related macros. */ #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) #define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) #define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) #define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0) /* Macros for counting and rounding. */ #ifndef howmany # define howmany(x, y) (((x) + ((y) - 1)) / (y)) #endif #ifdef __GNUC__ # define roundup(x, y) (__builtin_constant_p (y) && powerof2 (y) \ ? (((x) + (y) - 1) & ~((y) - 1)) \ : ((((x) + ((y) - 1)) / (y)) * (y))) #else # define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) #endif #define powerof2(x) ((((x) - 1) & (x)) == 0) /* Macros for min/max. */ #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* sys/param.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/resource.h ================================================ /* Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_RESOURCE_H #define _SYS_RESOURCE_H 1 #include /* Get the system-dependent definitions of structures and bit values. */ #include #ifndef __id_t_defined typedef __id_t id_t; # define __id_t_defined #endif __BEGIN_DECLS /* The X/Open standard defines that all the functions below must use `int' as the type for the first argument. When we are compiling with GNU extensions we change this slightly to provide better error checking. */ #if defined __USE_GNU && !defined __cplusplus typedef enum __rlimit_resource __rlimit_resource_t; typedef enum __rusage_who __rusage_who_t; typedef enum __priority_which __priority_which_t; #else typedef int __rlimit_resource_t; typedef int __rusage_who_t; typedef int __priority_which_t; #endif /* Put the soft and hard limits for RESOURCE in *RLIMITS. Returns 0 if successful, -1 if not (and sets errno). */ #ifndef __USE_FILE_OFFSET64 extern int getrlimit(__rlimit_resource_t __resource, struct rlimit *__rlimits) __THROW; #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(getrlimit, (__rlimit_resource_t __resource, struct rlimit * __rlimits), getrlimit64); # else # define getrlimit getrlimit64 # endif #endif #ifdef __USE_LARGEFILE64 extern int getrlimit64(__rlimit_resource_t __resource, struct rlimit64 *__rlimits) __THROW; #endif /* Set the soft and hard limits for RESOURCE to *RLIMITS. Only the super-user can increase hard limits. Return 0 if successful, -1 if not (and sets errno). */ #ifndef __USE_FILE_OFFSET64 extern int setrlimit(__rlimit_resource_t __resource, const struct rlimit *__rlimits) __THROW; #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(setrlimit, (__rlimit_resource_t __resource, const struct rlimit * __rlimits), setrlimit64); # else # define setrlimit setrlimit64 # endif #endif #ifdef __USE_LARGEFILE64 extern int setrlimit64(__rlimit_resource_t __resource, const struct rlimit64 *__rlimits) __THROW; #endif /* Return resource usage information on process indicated by WHO and put it in *USAGE. Returns 0 for success, -1 for failure. */ extern int getrusage(__rusage_who_t __who, struct rusage *__usage) __THROW; /* Return the highest priority of any process specified by WHICH and WHO (see above); if WHO is zero, the current process, process group, or user (as specified by WHO) is used. A lower priority number means higher priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */ extern int getpriority(__priority_which_t __which, id_t __who) __THROW; /* Set the priority of all processes specified by WHICH and WHO (see above) to PRIO. Returns 0 on success, -1 on errors. */ extern int setpriority(__priority_which_t __which, id_t __who, int __prio) __THROW; __END_DECLS #endif /* sys/resource.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/select.h ================================================ /* `fd_set' type and related macros, and `select'/`pselect' declarations. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* POSIX 1003.1g: 6.2 Select from File Descriptor Sets */ #ifndef _SYS_SELECT_H #define _SYS_SELECT_H 1 #include /* Get definition of needed basic types. */ #include /* Get __FD_* definitions. */ #include /* Get sigset_t. */ #include /* Get definition of timer specification structures. */ #include #include #ifdef __USE_XOPEN2K # include #endif #ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; # define __suseconds_t_defined #endif /* The fd_set member is required to be an array of longs. */ typedef long int __fd_mask; /* Some versions of define this macros. */ #undef __NFDBITS /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ #define __NFDBITS (8 * (int) sizeof (__fd_mask)) #define __FD_ELT(d) ((d) / __NFDBITS) #define __FD_MASK(d) ((__fd_mask) (1UL << ((d) % __NFDBITS))) /* fd_set for select and pselect. */ typedef struct { /* XPG4.2 requires this member name. Otherwise avoid the name from the global namespace. */ #ifdef __USE_XOPEN __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS]; # define __FDS_BITS(set) ((set)->fds_bits) #else __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS]; # define __FDS_BITS(set) ((set)->__fds_bits) #endif } fd_set; /* Maximum number of file descriptors in `fd_set'. */ #define FD_SETSIZE __FD_SETSIZE #ifdef __USE_MISC /* Sometimes the fd_set member is assumed to have this type. */ typedef __fd_mask fd_mask; /* Number of bits per word of `fd_set' (some code assumes this is 32). */ # define NFDBITS __NFDBITS #endif /* Access macros for `fd_set'. */ #define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp) #define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp) #define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp) #define FD_ZERO(fdsetp) __FD_ZERO (fdsetp) __BEGIN_DECLS /* Check the first NFDS descriptors each in READFDS (if not NULL) for read readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out after waiting the interval specified therein. Returns the number of ready descriptors, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int select(int __nfds, fd_set * __restrict __readfds, fd_set * __restrict __writefds, fd_set * __restrict __exceptfds, struct timeval *__restrict __timeout); #ifdef __USE_XOPEN2K /* Same as above only that the TIMEOUT value is given with higher resolution and a sigmask which is been set temporarily. This version should be used. This function is a cancellation point and therefore not marked with __THROW. */ extern int pselect(int __nfds, fd_set * __restrict __readfds, fd_set * __restrict __writefds, fd_set * __restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t * __restrict __sigmask); #endif /* Define some inlines helping to catch common problems. */ #if __USE_FORTIFY_LEVEL > 0 && defined __GNUC__ # include #endif __END_DECLS #endif /* sys/select.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/socket.h ================================================ /* Declarations of socket constants, types, and functions. Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SOCKET_H #define _SYS_SOCKET_H 1 #include __BEGIN_DECLS #include #define __need_size_t #include /* This operating system-specific header file defines the SOCK_*, PF_*, AF_*, MSG_*, SOL_*, and SO_* constants, and the `struct sockaddr', `struct msghdr', and `struct linger' types. */ #include #ifdef __USE_MISC # include #endif /* The following constants should be used for the second parameter of `shutdown'. */ enum { SHUT_RD = 0, /* No more receptions. */ #define SHUT_RD SHUT_RD SHUT_WR, /* No more transmissions. */ #define SHUT_WR SHUT_WR SHUT_RDWR /* No more receptions or transmissions. */ #define SHUT_RDWR SHUT_RDWR }; /* This is the type we use for generic socket address arguments. With GCC 2.7 and later, the funky union causes redeclarations or uses with any of the listed types to be allowed without complaint. G++ 2.7 does not support transparent unions so there we want the old-style declaration, too. */ #if defined __cplusplus || !__GNUC_PREREQ (2, 7) || !defined __USE_GNU # define __SOCKADDR_ARG struct sockaddr *__restrict # define __CONST_SOCKADDR_ARG const struct sockaddr * #else /* Add more `struct sockaddr_AF' types here as necessary. These are all the ones I found on NetBSD and Linux. */ # define __SOCKADDR_ALLTYPES \ __SOCKADDR_ONETYPE (sockaddr) \ __SOCKADDR_ONETYPE (sockaddr_at) \ __SOCKADDR_ONETYPE (sockaddr_ax25) \ __SOCKADDR_ONETYPE (sockaddr_dl) \ __SOCKADDR_ONETYPE (sockaddr_eon) \ __SOCKADDR_ONETYPE (sockaddr_in) \ __SOCKADDR_ONETYPE (sockaddr_in6) \ __SOCKADDR_ONETYPE (sockaddr_inarp) \ __SOCKADDR_ONETYPE (sockaddr_ipx) \ __SOCKADDR_ONETYPE (sockaddr_iso) \ __SOCKADDR_ONETYPE (sockaddr_ns) \ __SOCKADDR_ONETYPE (sockaddr_un) \ __SOCKADDR_ONETYPE (sockaddr_x25) # define __SOCKADDR_ONETYPE(type) struct type *__restrict __##type##__; typedef union { __SOCKADDR_ALLTYPES} __SOCKADDR_ARG __attribute__ ((__transparent_union__)); # undef __SOCKADDR_ONETYPE # define __SOCKADDR_ONETYPE(type) const struct type *__restrict __##type##__; typedef union { __SOCKADDR_ALLTYPES} __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__)); # undef __SOCKADDR_ONETYPE #endif #ifdef __USE_GNU /* For `recvmmsg' and `sendmmsg'. */ struct mmsghdr { struct msghdr msg_hdr; /* Actual message header. */ unsigned int msg_len; /* Number of received or sent bytes for the entry. */ }; #endif /* Create a new socket of type TYPE in domain DOMAIN, using protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically. Returns a file descriptor for the new socket, or -1 for errors. */ extern int socket(int __domain, int __type, int __protocol) __THROW; /* Create two new sockets, of type TYPE in domain DOMAIN and using protocol PROTOCOL, which are connected to each other, and put file descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero, one will be chosen automatically. Returns 0 on success, -1 for errors. */ extern int socketpair(int __domain, int __type, int __protocol, int __fds[2]) __THROW; /* Give the socket FD the local address ADDR (which is LEN bytes long). */ extern int bind(int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len) __THROW; /* Put the local address of FD into *ADDR and its length in *LEN. */ extern int getsockname(int __fd, __SOCKADDR_ARG __addr, socklen_t * __restrict __len) __THROW; /* Open a connection on socket FD to peer at ADDR (which LEN bytes long). For connectionless socket types, just set the default address to send to and the only address from which to accept transmissions. Return 0 on success, -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int connect(int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len); /* Put the address of the peer connected to socket FD into *ADDR (which is *LEN bytes long), and its actual length into *LEN. */ extern int getpeername(int __fd, __SOCKADDR_ARG __addr, socklen_t * __restrict __len) __THROW; /* Send N bytes of BUF to socket FD. Returns the number sent or -1. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t send(int __fd, const void *__buf, size_t __n, int __flags); /* Read N bytes into BUF from socket FD. Returns the number read or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t recv(int __fd, void *__buf, size_t __n, int __flags); /* Send N bytes of BUF on socket FD to peer at address ADDR (which is ADDR_LEN bytes long). Returns the number sent, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t sendto(int __fd, const void *__buf, size_t __n, int __flags, __CONST_SOCKADDR_ARG __addr, socklen_t __addr_len); /* Read N bytes into BUF through socket FD. If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of the sender, and store the actual size of the address in *ADDR_LEN. Returns the number of bytes read or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t recvfrom(int __fd, void *__restrict __buf, size_t __n, int __flags, __SOCKADDR_ARG __addr, socklen_t * __restrict __addr_len); /* Send a message described MESSAGE on socket FD. Returns the number of bytes sent, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t sendmsg(int __fd, const struct msghdr *__message, int __flags); #ifdef __USE_GNU /* Send a VLEN messages as described by VMESSAGES to socket FD. Returns the number of datagrams successfully written or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int sendmmsg(int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags); #endif /* Receive a message as described by MESSAGE from socket FD. Returns the number of bytes read or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t recvmsg(int __fd, struct msghdr *__message, int __flags); #ifdef __USE_GNU /* Receive up to VLEN messages as described by VMESSAGES from socket FD. Returns the number of messages received or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int recvmmsg(int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags, struct timespec *__tmo); #endif /* Put the current value for socket FD's option OPTNAME at protocol level LEVEL into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's actual length. Returns 0 on success, -1 for errors. */ extern int getsockopt(int __fd, int __level, int __optname, void *__restrict __optval, socklen_t * __restrict __optlen) __THROW; /* Set socket FD's option OPTNAME at protocol level LEVEL to *OPTVAL (which is OPTLEN bytes long). Returns 0 on success, -1 for errors. */ extern int setsockopt(int __fd, int __level, int __optname, const void *__optval, socklen_t __optlen) __THROW; /* Prepare to accept connections on socket FD. N connection requests will be queued before further requests are refused. Returns 0 on success, -1 for errors. */ extern int listen(int __fd, int __n) __THROW; /* Await a connection on socket FD. When a connection arrives, open a new socket to communicate with it, set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting peer and *ADDR_LEN to the address's actual length, and return the new socket's descriptor, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int accept(int __fd, __SOCKADDR_ARG __addr, socklen_t * __restrict __addr_len); #ifdef __USE_GNU /* Similar to 'accept' but takes an additional parameter to specify flags. This function is a cancellation point and therefore not marked with __THROW. */ extern int accept4(int __fd, __SOCKADDR_ARG __addr, socklen_t * __restrict __addr_len, int __flags); #endif /* Shut down all or part of the connection open on socket FD. HOW determines what to shut down: SHUT_RD = No more receptions; SHUT_WR = No more transmissions; SHUT_RDWR = No more receptions or transmissions. Returns 0 on success, -1 for errors. */ extern int shutdown(int __fd, int __how) __THROW; #ifdef __USE_XOPEN2K /* Determine wheter socket is at a out-of-band mark. */ extern int sockatmark(int __fd) __THROW; #endif #ifdef __USE_MISC /* FDTYPE is S_IFSOCK or another S_IF* macro defined in ; returns 1 if FD is open on an object of the indicated type, 0 if not, or -1 for errors (setting errno). */ extern int isfdtype(int __fd, int __fdtype) __THROW; #endif /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif __END_DECLS #endif /* sys/socket.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/stat.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 5.6 File Characteristics */ #ifndef _SYS_STAT_H #define _SYS_STAT_H 1 #include #include /* For __mode_t and __dev_t. */ #ifdef __USE_XOPEN2K8 # include #endif #if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ # include # ifndef __dev_t_defined typedef __dev_t dev_t; # define __dev_t_defined # endif # ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined # endif # ifndef __ino_t_defined # ifndef __USE_FILE_OFFSET64 typedef __ino_t ino_t; # else typedef __ino64_t ino_t; # endif # define __ino_t_defined # endif # ifndef __mode_t_defined typedef __mode_t mode_t; # define __mode_t_defined # endif # ifndef __nlink_t_defined typedef __nlink_t nlink_t; # define __nlink_t_defined # endif # ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined # endif # ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined # endif #endif /* X/Open */ #ifdef __USE_UNIX98 # ifndef __blkcnt_t_defined # ifndef __USE_FILE_OFFSET64 typedef __blkcnt_t blkcnt_t; # else typedef __blkcnt64_t blkcnt_t; # endif # define __blkcnt_t_defined # endif # ifndef __blksize_t_defined typedef __blksize_t blksize_t; # define __blksize_t_defined # endif #endif /* Unix98 */ __BEGIN_DECLS #include #if defined __USE_MISC || defined __USE_XOPEN # define S_IFMT __S_IFMT # define S_IFDIR __S_IFDIR # define S_IFCHR __S_IFCHR # define S_IFBLK __S_IFBLK # define S_IFREG __S_IFREG # ifdef __S_IFIFO # define S_IFIFO __S_IFIFO # endif # ifdef __S_IFLNK # define S_IFLNK __S_IFLNK # endif # if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) \ && defined __S_IFSOCK # define S_IFSOCK __S_IFSOCK # endif #endif /* Test macros for file types. */ #define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask)) #define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR) #define S_ISCHR(mode) __S_ISTYPE((mode), __S_IFCHR) #define S_ISBLK(mode) __S_ISTYPE((mode), __S_IFBLK) #define S_ISREG(mode) __S_ISTYPE((mode), __S_IFREG) #ifdef __S_IFIFO # define S_ISFIFO(mode) __S_ISTYPE((mode), __S_IFIFO) #endif #ifdef __S_IFLNK # define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK) #endif #if defined __USE_MISC && !defined __S_IFLNK # define S_ISLNK(mode) 0 #endif #if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K) \ && defined __S_IFSOCK # define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK) #elif defined __USE_XOPEN2K # define S_ISSOCK(mode) 0 #endif /* These are from POSIX.1b. If the objects are not implemented using separate distinct file types, the macros always will evaluate to zero. Unlike the other S_* macros the following three take a pointer to a `struct stat' object as the argument. */ #ifdef __USE_POSIX199309 # define S_TYPEISMQ(buf) __S_TYPEISMQ(buf) # define S_TYPEISSEM(buf) __S_TYPEISSEM(buf) # define S_TYPEISSHM(buf) __S_TYPEISSHM(buf) #endif /* Protection bits. */ #define S_ISUID __S_ISUID /* Set user ID on execution. */ #define S_ISGID __S_ISGID /* Set group ID on execution. */ #if defined __USE_MISC || defined __USE_XOPEN /* Save swapped text after use (sticky bit). This is pretty well obsolete. */ # define S_ISVTX __S_ISVTX #endif #define S_IRUSR __S_IREAD /* Read by owner. */ #define S_IWUSR __S_IWRITE /* Write by owner. */ #define S_IXUSR __S_IEXEC /* Execute by owner. */ /* Read, write, and execute by owner. */ #define S_IRWXU (__S_IREAD|__S_IWRITE|__S_IEXEC) #ifdef __USE_MISC # define S_IREAD S_IRUSR # define S_IWRITE S_IWUSR # define S_IEXEC S_IXUSR #endif #define S_IRGRP (S_IRUSR >> 3) /* Read by group. */ #define S_IWGRP (S_IWUSR >> 3) /* Write by group. */ #define S_IXGRP (S_IXUSR >> 3) /* Execute by group. */ /* Read, write, and execute by group. */ #define S_IRWXG (S_IRWXU >> 3) #define S_IROTH (S_IRGRP >> 3) /* Read by others. */ #define S_IWOTH (S_IWGRP >> 3) /* Write by others. */ #define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */ /* Read, write, and execute by others. */ #define S_IRWXO (S_IRWXG >> 3) #ifdef __USE_MISC /* Macros for common mode bit masks. */ # define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */ # define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */ # define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) /* 0666 */ # define S_BLKSIZE 512 /* Block size for `st_blocks'. */ #endif #ifndef __USE_FILE_OFFSET64 /* Get file attributes for FILE and put them in BUF. */ extern int stat(const char *__restrict __file, struct stat *__restrict __buf) __THROW __nonnull((1, 2)); /* Get file attributes for the file, device, pipe, or socket that file descriptor FD is open on and put them in BUF. */ extern int fstat(int __fd, struct stat *__buf) __THROW __nonnull((2)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(stat, (const char *__restrict __file, struct stat * __restrict __buf), stat64) __nonnull((1, 2)); extern int __REDIRECT_NTH(fstat, (int __fd, struct stat * __buf), fstat64) __nonnull((2)); # else # define stat stat64 # define fstat fstat64 # endif #endif #ifdef __USE_LARGEFILE64 extern int stat64(const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull((1, 2)); extern int fstat64(int __fd, struct stat64 *__buf) __THROW __nonnull((2)); #endif #ifdef __USE_ATFILE /* Similar to stat, get the attributes for FILE and put them in BUF. Relative path names are interpreted relative to FD unless FD is AT_FDCWD. */ # ifndef __USE_FILE_OFFSET64 extern int fstatat(int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __THROW __nonnull((2, 3)); # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(fstatat, (int __fd, const char *__restrict __file, struct stat * __restrict __buf, int __flag), fstatat64) __nonnull((2, 3)); # else # define fstatat fstatat64 # endif # endif # ifdef __USE_LARGEFILE64 extern int fstatat64(int __fd, const char *__restrict __file, struct stat64 *__restrict __buf, int __flag) __THROW __nonnull((2, 3)); # endif #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K # ifndef __USE_FILE_OFFSET64 /* Get file attributes about FILE and put them in BUF. If FILE is a symbolic link, do not follow it. */ extern int lstat(const char *__restrict __file, struct stat *__restrict __buf) __THROW __nonnull((1, 2)); # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(lstat, (const char *__restrict __file, struct stat * __restrict __buf), lstat64) __nonnull((1, 2)); # else # define lstat lstat64 # endif # endif # ifdef __USE_LARGEFILE64 extern int lstat64(const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull((1, 2)); # endif #endif /* Set file access permissions for FILE to MODE. If FILE is a symbolic link, this affects its target instead. */ extern int chmod(const char *__file, __mode_t __mode) __THROW __nonnull((1)); #ifdef __USE_MISC /* Set file access permissions for FILE to MODE. If FILE is a symbolic link, this affects the link itself rather than its target. */ extern int lchmod(const char *__file, __mode_t __mode) __THROW __nonnull((1)); #endif /* Set file access permissions of the file FD is open on to MODE. */ #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED extern int fchmod(int __fd, __mode_t __mode) __THROW; #endif #ifdef __USE_ATFILE /* Set file access permissions of FILE relative to the directory FD is open on. */ extern int fchmodat(int __fd, const char *__file, __mode_t __mode, int __flag) __THROW __nonnull((2)) __wur; #endif /* Use ATFILE. */ /* Set the file creation mask of the current process to MASK, and return the old creation mask. */ extern __mode_t umask(__mode_t __mask) __THROW; #ifdef __USE_GNU /* Get the current `umask' value without changing it. This function is only available under the GNU Hurd. */ extern __mode_t getumask(void) __THROW; #endif /* Create a new directory named PATH, with permission bits MODE. */ extern int mkdir(const char *__path, __mode_t __mode) __THROW __nonnull((1)); #ifdef __USE_ATFILE /* Like mkdir, create a new directory with permission bits MODE. But interpret relative PATH names relative to the directory associated with FD. */ extern int mkdirat(int __fd, const char *__path, __mode_t __mode) __THROW __nonnull((2)); #endif /* Create a device file named PATH, with permission and special bits MODE and device number DEV (which can be constructed from major and minor device numbers with the `makedev' macro above). */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED extern int mknod(const char *__path, __mode_t __mode, __dev_t __dev) __THROW __nonnull((1)); # ifdef __USE_ATFILE /* Like mknod, create a new device file with permission bits MODE and device number DEV. But interpret relative PATH names relative to the directory associated with FD. */ extern int mknodat(int __fd, const char *__path, __mode_t __mode, __dev_t __dev) __THROW __nonnull((2)); # endif #endif /* Create a new FIFO named PATH, with permission bits MODE. */ extern int mkfifo(const char *__path, __mode_t __mode) __THROW __nonnull((1)); #ifdef __USE_ATFILE /* Like mkfifo, create a new FIFO with permission bits MODE. But interpret relative PATH names relative to the directory associated with FD. */ extern int mkfifoat(int __fd, const char *__path, __mode_t __mode) __THROW __nonnull((2)); #endif #ifdef __USE_ATFILE /* Set file access and modification times relative to directory file descriptor. */ extern int utimensat(int __fd, const char *__path, const struct timespec __times[2], int __flags) __THROW __nonnull((2)); #endif #ifdef __USE_XOPEN2K8 /* Set file access and modification times of the file associated with FD. */ extern int futimens(int __fd, const struct timespec __times[2]) __THROW; #endif /* To allow the `struct stat' structure and the file type `mode_t' bits to vary without changing shared library major version number, the `stat' family of functions and `mknod' are in fact inline wrappers around calls to `xstat', `fxstat', `lxstat', and `xmknod', which all take a leading version-number argument designating the data structure and bits used. defines _STAT_VER with the version number corresponding to `struct stat' as defined in that file; and _MKNOD_VER with the version number corresponding to the S_IF* macros defined therein. It is arranged that when not inlined these function are always statically linked; that way a dynamically-linked executable always encodes the version number corresponding to the data structures it uses, so the `x' functions in the shared library can adapt without needing to recompile all callers. */ #ifndef _STAT_VER # define _STAT_VER 0 #endif #ifndef _MKNOD_VER # define _MKNOD_VER 0 #endif /* Wrappers for stat and mknod system calls. */ #ifndef __USE_FILE_OFFSET64 extern int __fxstat(int __ver, int __fildes, struct stat *__stat_buf) __THROW __nonnull((3)); extern int __xstat(int __ver, const char *__filename, struct stat *__stat_buf) __THROW __nonnull((2, 3)); extern int __lxstat(int __ver, const char *__filename, struct stat *__stat_buf) __THROW __nonnull((2, 3)); extern int __fxstatat(int __ver, int __fildes, const char *__filename, struct stat *__stat_buf, int __flag) __THROW __nonnull((3, 4)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(__fxstat, (int __ver, int __fildes, struct stat * __stat_buf), __fxstat64) __nonnull((3)); extern int __REDIRECT_NTH(__xstat, (int __ver, const char *__filename, struct stat * __stat_buf), __xstat64) __nonnull((2, 3)); extern int __REDIRECT_NTH(__lxstat, (int __ver, const char *__filename, struct stat * __stat_buf), __lxstat64) __nonnull((2, 3)); extern int __REDIRECT_NTH(__fxstatat, (int __ver, int __fildes, const char *__filename, struct stat * __stat_buf, int __flag), __fxstatat64) __nonnull((3, 4)); # else # define __fxstat __fxstat64 # define __xstat __xstat64 # define __lxstat __lxstat64 # endif #endif #ifdef __USE_LARGEFILE64 extern int __fxstat64(int __ver, int __fildes, struct stat64 *__stat_buf) __THROW __nonnull((3)); extern int __xstat64(int __ver, const char *__filename, struct stat64 *__stat_buf) __THROW __nonnull((2, 3)); extern int __lxstat64(int __ver, const char *__filename, struct stat64 *__stat_buf) __THROW __nonnull((2, 3)); extern int __fxstatat64(int __ver, int __fildes, const char *__filename, struct stat64 *__stat_buf, int __flag) __THROW __nonnull((3, 4)); #endif extern int __xmknod(int __ver, const char *__path, __mode_t __mode, __dev_t * __dev) __THROW __nonnull((2, 4)); extern int __xmknodat(int __ver, int __fd, const char *__path, __mode_t __mode, __dev_t * __dev) __THROW __nonnull((3, 5)); #ifdef __USE_EXTERN_INLINES /* Inlined versions of the real stat and mknod functions. */ __extern_inline int __NTH(stat(const char *__path, struct stat *__statbuf)) { return __xstat(_STAT_VER, __path, __statbuf); } # if defined __USE_MISC || defined __USE_XOPEN_EXTENDED __extern_inline int __NTH(lstat(const char *__path, struct stat *__statbuf)) { return __lxstat(_STAT_VER, __path, __statbuf); } # endif __extern_inline int __NTH(fstat(int __fd, struct stat *__statbuf)) { return __fxstat(_STAT_VER, __fd, __statbuf); } # ifdef __USE_ATFILE __extern_inline int __NTH(fstatat(int __fd, const char *__filename, struct stat *__statbuf, int __flag)) { return __fxstatat(_STAT_VER, __fd, __filename, __statbuf, __flag); } # endif # ifdef __USE_MISC __extern_inline int __NTH(mknod(const char *__path, __mode_t __mode, __dev_t __dev)) { return __xmknod(_MKNOD_VER, __path, __mode, &__dev); } # endif # ifdef __USE_ATFILE __extern_inline int __NTH(mknodat(int __fd, const char *__path, __mode_t __mode, __dev_t __dev)) { return __xmknodat(_MKNOD_VER, __fd, __path, __mode, &__dev); } # endif # if defined __USE_LARGEFILE64 \ && (! defined __USE_FILE_OFFSET64 \ || (defined __REDIRECT_NTH && defined __OPTIMIZE__)) __extern_inline int __NTH(stat64(const char *__path, struct stat64 *__statbuf)) { return __xstat64(_STAT_VER, __path, __statbuf); } # if defined __USE_MISC || defined __USE_XOPEN_EXTENDED __extern_inline int __NTH(lstat64(const char *__path, struct stat64 *__statbuf)) { return __lxstat64(_STAT_VER, __path, __statbuf); } # endif __extern_inline int __NTH(fstat64(int __fd, struct stat64 *__statbuf)) { return __fxstat64(_STAT_VER, __fd, __statbuf); } # ifdef __USE_ATFILE __extern_inline int __NTH(fstatat64(int __fd, const char *__filename, struct stat64 *__statbuf, int __flag)) { return __fxstatat64(_STAT_VER, __fd, __filename, __statbuf, __flag); } # endif # endif #endif __END_DECLS #endif /* sys/stat.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/statfs.h ================================================ /* Definitions for getting information about a filesystem. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_STATFS_H #define _SYS_STATFS_H 1 #include /* Get the system-specific definition of `struct statfs'. */ #include __BEGIN_DECLS /* Return information about the filesystem on which FILE resides. */ #ifndef __USE_FILE_OFFSET64 extern int statfs(const char *__file, struct statfs *__buf) __THROW __nonnull((1, 2)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(statfs, (const char *__file, struct statfs * __buf), statfs64) __nonnull((1, 2)); # else # define statfs statfs64 # endif #endif #ifdef __USE_LARGEFILE64 extern int statfs64(const char *__file, struct statfs64 *__buf) __THROW __nonnull((1, 2)); #endif /* Return information about the filesystem containing the file FILDES refers to. */ #ifndef __USE_FILE_OFFSET64 extern int fstatfs(int __fildes, struct statfs *__buf) __THROW __nonnull((2)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(fstatfs, (int __fildes, struct statfs * __buf), fstatfs64) __nonnull((2)); # else # define fstatfs fstatfs64 # endif #endif #ifdef __USE_LARGEFILE64 extern int fstatfs64(int __fildes, struct statfs64 *__buf) __THROW __nonnull((2)); #endif __END_DECLS #endif /* sys/statfs.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/sysmacros.h ================================================ /* Definitions of macros to access `dev_t' values. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SYSMACROS_H_OUTER #ifndef __SYSMACROS_DEPRECATED_INCLUSION # define _SYS_SYSMACROS_H_OUTER 1 #endif /* If is included after , these macros will already be defined, and we need to redefine them without the deprecation warnings. (If they are included in the opposite order, the outer #ifndef will suppress this entire file and the macros will be usable without warnings.) */ #undef major #undef minor #undef makedev /* This is the macro that must be defined to satisfy the misuse check in bits/sysmacros.h. */ #ifndef _SYS_SYSMACROS_H #define _SYS_SYSMACROS_H 1 #include #include #include /* Caution: The text of this deprecation message is unquoted, so that #symbol can be substituted. (It is converted to a string by __SYSMACROS_DM1.) This means the message must be a sequence of complete pp-tokens; in particular, English contractions (it's, can't) cannot be used. The message has been manually word-wrapped to fit in 80 columns when output by GCC 5 and 6. The first line is shorter to leave some room for the "foo.c:23: warning:" annotation. */ #define __SYSMACROS_DM(symbol) __SYSMACROS_DM1 \ (In the GNU C Library, #symbol is defined\n\ by . For historical compatibility, it is\n\ currently defined by as well, but we plan to\n\ remove this soon. To use #symbol, include \n\ directly. If you did not intend to use a system-defined macro\n\ #symbol, you should undefine it after including .) /* This macro is variadic because the deprecation message above contains commas. */ #define __SYSMACROS_DM1(...) __glibc_macro_warning (#__VA_ARGS__) #define __SYSMACROS_DECL_TEMPL(rtype, name, proto) \ extern rtype gnu_dev_##name proto __THROW __attribute_const__; #define __SYSMACROS_IMPL_TEMPL(rtype, name, proto) \ __extension__ __extern_inline __attribute_const__ rtype \ __NTH (gnu_dev_##name proto) __BEGIN_DECLS __SYSMACROS_DECLARE_MAJOR(__SYSMACROS_DECL_TEMPL) __SYSMACROS_DECLARE_MINOR(__SYSMACROS_DECL_TEMPL) __SYSMACROS_DECLARE_MAKEDEV(__SYSMACROS_DECL_TEMPL) #ifdef __USE_EXTERN_INLINES __SYSMACROS_DEFINE_MAJOR(__SYSMACROS_IMPL_TEMPL) __SYSMACROS_DEFINE_MINOR(__SYSMACROS_IMPL_TEMPL) __SYSMACROS_DEFINE_MAKEDEV(__SYSMACROS_IMPL_TEMPL) #endif __END_DECLS #endif /* _SYS_SYSMACROS_H */ #ifndef __SYSMACROS_NEED_IMPLEMENTATION # undef __SYSMACROS_DECL_TEMPL # undef __SYSMACROS_IMPL_TEMPL # undef __SYSMACROS_DECLARE_MAJOR # undef __SYSMACROS_DECLARE_MINOR # undef __SYSMACROS_DECLARE_MAKEDEV # undef __SYSMACROS_DEFINE_MAJOR # undef __SYSMACROS_DEFINE_MINOR # undef __SYSMACROS_DEFINE_MAKEDEV #endif #ifdef __SYSMACROS_DEPRECATED_INCLUSION # define major(dev) __SYSMACROS_DM (major) gnu_dev_major (dev) # define minor(dev) __SYSMACROS_DM (minor) gnu_dev_minor (dev) # define makedev(maj, min) __SYSMACROS_DM (makedev) gnu_dev_makedev (maj, min) #else # define major(dev) gnu_dev_major (dev) # define minor(dev) gnu_dev_minor (dev) # define makedev(maj, min) gnu_dev_makedev (maj, min) #endif #endif /* sys/sysmacros.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/time.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_TIME_H #define _SYS_TIME_H 1 #include #include #include #include #ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; # define __suseconds_t_defined #endif #include __BEGIN_DECLS #ifdef __USE_GNU /* Macros for converting between `struct timeval' and `struct timespec'. */ # define TIMEVAL_TO_TIMESPEC(tv, ts) { \ (ts)->tv_sec = (tv)->tv_sec; \ (ts)->tv_nsec = (tv)->tv_usec * 1000; \ } # define TIMESPEC_TO_TIMEVAL(tv, ts) { \ (tv)->tv_sec = (ts)->tv_sec; \ (tv)->tv_usec = (ts)->tv_nsec / 1000; \ } #endif #ifdef __USE_MISC /* Structure crudely representing a timezone. This is obsolete and should never be used. */ struct timezone { int tz_minuteswest; /* Minutes west of GMT. */ int tz_dsttime; /* Nonzero if DST is ever in effect. */ }; typedef struct timezone *__restrict __timezone_ptr_t; #else typedef void *__restrict __timezone_ptr_t; #endif /* Get the current time of day and timezone information, putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled. Returns 0 on success, -1 on errors. NOTE: This form of timezone information is obsolete. Use the functions and variables declared in instead. */ extern int gettimeofday(struct timeval *__restrict __tv, __timezone_ptr_t __tz) __THROW __nonnull((1)); #ifdef __USE_MISC /* Set the current time of day and timezone information. This call is restricted to the super-user. */ extern int settimeofday(const struct timeval *__tv, const struct timezone *__tz) __THROW; /* Adjust the current time of day by the amount in DELTA. If OLDDELTA is not NULL, it is filled in with the amount of time adjustment remaining to be done from the last `adjtime' call. This call is restricted to the super-user. */ extern int adjtime(const struct timeval *__delta, struct timeval *__olddelta) __THROW; #endif /* Values for the first argument to `getitimer' and `setitimer'. */ enum __itimer_which { /* Timers run in real time. */ ITIMER_REAL = 0, #define ITIMER_REAL ITIMER_REAL /* Timers run only when the process is executing. */ ITIMER_VIRTUAL = 1, #define ITIMER_VIRTUAL ITIMER_VIRTUAL /* Timers run when the process is executing and when the system is executing on behalf of the process. */ ITIMER_PROF = 2 #define ITIMER_PROF ITIMER_PROF }; /* Type of the second argument to `getitimer' and the second and third arguments `setitimer'. */ struct itimerval { /* Value to put into `it_value' when the timer expires. */ struct timeval it_interval; /* Time to the next timer expiration. */ struct timeval it_value; }; #if defined __USE_GNU && !defined __cplusplus /* Use the nicer parameter type only in GNU mode and not for C++ since the strict C++ rules prevent the automatic promotion. */ typedef enum __itimer_which __itimer_which_t; #else typedef int __itimer_which_t; #endif /* Set *VALUE to the current setting of timer WHICH. Return 0 on success, -1 on errors. */ extern int getitimer(__itimer_which_t __which, struct itimerval *__value) __THROW; /* Set the timer WHICH to *NEW. If OLD is not NULL, set *OLD to the old value of timer WHICH. Returns 0 on success, -1 on errors. */ extern int setitimer(__itimer_which_t __which, const struct itimerval *__restrict __new, struct itimerval *__restrict __old) __THROW; /* Change the access time of FILE to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ extern int utimes(const char *__file, const struct timeval __tvp[2]) __THROW __nonnull((1)); #ifdef __USE_MISC /* Same as `utimes', but does not follow symbolic links. */ extern int lutimes(const char *__file, const struct timeval __tvp[2]) __THROW __nonnull((1)); /* Same as `utimes', but takes an open file descriptor instead of a name. */ extern int futimes(int __fd, const struct timeval __tvp[2]) __THROW; #endif #ifdef __USE_GNU /* Change the access time of FILE relative to FD to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ extern int futimesat(int __fd, const char *__file, const struct timeval __tvp[2]) __THROW; #endif #ifdef __USE_MISC /* Convenience macros for operations on timevals. NOTE: `timercmp' does not work for >= or <=. */ # define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) # define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) # define timercmp(a, b, CMP) \ (((a)->tv_sec == (b)->tv_sec) ? \ ((a)->tv_usec CMP (b)->tv_usec) : \ ((a)->tv_sec CMP (b)->tv_sec)) # define timeradd(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ if ((result)->tv_usec >= 1000000) \ { \ ++(result)->tv_sec; \ (result)->tv_usec -= 1000000; \ } \ } while (0) # define timersub(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ if ((result)->tv_usec < 0) { \ --(result)->tv_sec; \ (result)->tv_usec += 1000000; \ } \ } while (0) #endif /* Misc. */ __END_DECLS #endif /* sys/time.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/ttydefaults.h ================================================ /*- * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94 */ /* * System wide defaults for terminal state. Linux version. */ #ifndef _SYS_TTYDEFAULTS_H_ #define _SYS_TTYDEFAULTS_H_ /* * Defaults on "first" open. */ #define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY) #define TTYDEF_OFLAG (OPOST | ONLCR | XTABS) #define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) #define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL) #define TTYDEF_SPEED (B9600) /* * Control Character Defaults */ #define CTRL(x) (x&037) #define CEOF CTRL('d') #ifdef _POSIX_VDISABLE # define CEOL _POSIX_VDISABLE #else # define CEOL '\0' /* XXX avoid _POSIX_VDISABLE */ #endif #define CERASE 0177 #define CINTR CTRL('c') #ifdef _POSIX_VDISABLE # define CSTATUS _POSIX_VDISABLE #else # define CSTATUS '\0' /* XXX avoid _POSIX_VDISABLE */ #endif #define CKILL CTRL('u') #define CMIN 1 #define CQUIT 034 /* FS, ^\ */ #define CSUSP CTRL('z') #define CTIME 0 #define CDSUSP CTRL('y') #define CSTART CTRL('q') #define CSTOP CTRL('s') #define CLNEXT CTRL('v') #define CDISCARD CTRL('o') #define CWERASE CTRL('w') #define CREPRINT CTRL('r') #define CEOT CEOF /* compat */ #define CBRK CEOL #define CRPRNT CREPRINT #define CFLUSH CDISCARD /* PROTECTED INCLUSION ENDS HERE */ #endif /* !_SYS_TTYDEFAULTS_H_ */ /* * #define TTYDEFCHARS to include an array of default control characters. */ #ifdef TTYDEFCHARS cc_t ttydefchars[NCCS] = { CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT, _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT, CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE }; #undef TTYDEFCHARS #endif ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/types.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 2.6 Primitive System Data Types */ #ifndef _SYS_TYPES_H #define _SYS_TYPES_H 1 #include __BEGIN_DECLS #include #ifdef __USE_MISC # ifndef __u_char_defined typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; # define __u_char_defined # endif #endif typedef __loff_t loff_t; #ifndef __ino_t_defined # ifndef __USE_FILE_OFFSET64 typedef __ino_t ino_t; # else typedef __ino64_t ino_t; # endif # define __ino_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __ino64_t_defined typedef __ino64_t ino64_t; # define __ino64_t_defined #endif #ifndef __dev_t_defined typedef __dev_t dev_t; # define __dev_t_defined #endif #ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined #endif #ifndef __mode_t_defined typedef __mode_t mode_t; # define __mode_t_defined #endif #ifndef __nlink_t_defined typedef __nlink_t nlink_t; # define __nlink_t_defined #endif #ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined #endif #ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; # define __off64_t_defined #endif #ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif #if (defined __USE_XOPEN || defined __USE_XOPEN2K8) \ && !defined __id_t_defined typedef __id_t id_t; # define __id_t_defined #endif #ifndef __ssize_t_defined typedef __ssize_t ssize_t; # define __ssize_t_defined #endif #ifdef __USE_MISC # ifndef __daddr_t_defined typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; # define __daddr_t_defined # endif #endif #if (defined __USE_MISC || defined __USE_XOPEN) && !defined __key_t_defined typedef __key_t key_t; # define __key_t_defined #endif #if defined __USE_XOPEN || defined __USE_XOPEN2K8 # include #endif #include #include #include #ifdef __USE_XOPEN # ifndef __useconds_t_defined typedef __useconds_t useconds_t; # define __useconds_t_defined # endif # ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; # define __suseconds_t_defined # endif #endif #define __need_size_t #include #ifdef __USE_MISC /* Old compatibility names for C types. */ typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; #endif /* These size-specific names are used by some of the inet code. */ #include #if !__GNUC_PREREQ (2, 7) /* These were defined by ISO C without the first `_'. */ typedef unsigned char u_int8_t; typedef unsigned short int u_int16_t; typedef unsigned int u_int32_t; # if __WORDSIZE == 64 typedef unsigned long int u_int64_t; # else __extension__ typedef unsigned long long int u_int64_t; # endif typedef int register_t; #else /* For GCC 2.7 and later, we can use specific type-size attributes. */ # define __u_intN_t(N, MODE) \ typedef unsigned int u_int##N##_t __attribute__ ((__mode__ (MODE))) __u_intN_t(8, __QI__); __u_intN_t(16, __HI__); __u_intN_t(32, __SI__); __u_intN_t(64, __DI__); typedef int register_t __attribute__ ((__mode__(__word__))); /* Some code from BIND tests this macro to see if the types above are defined. */ #endif #define __BIT_TYPES_DEFINED__ 1 #ifdef __USE_MISC /* In BSD is expected to define BYTE_ORDER. */ # include /* It also defines `fd_set' and the FD_* macros for `select'. */ # include /* BSD defines `major', `minor', and `makedev' in this header. However, these symbols are likely to collide with user code, so we are going to stop defining them here in an upcoming release. Code that needs these macros should include directly. Code that does not need these macros should #undef them after including this header. */ # define __SYSMACROS_DEPRECATED_INCLUSION # include # undef __SYSMACROS_DEPRECATED_INCLUSION #endif /* Use misc. */ #if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) \ && !defined __blksize_t_defined typedef __blksize_t blksize_t; # define __blksize_t_defined #endif /* Types from the Large File Support interface. */ #ifndef __USE_FILE_OFFSET64 # ifndef __blkcnt_t_defined typedef __blkcnt_t blkcnt_t; /* Type to count number of disk blocks. */ # define __blkcnt_t_defined # endif # ifndef __fsblkcnt_t_defined typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */ # define __fsblkcnt_t_defined # endif # ifndef __fsfilcnt_t_defined typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */ # define __fsfilcnt_t_defined # endif #else # ifndef __blkcnt_t_defined typedef __blkcnt64_t blkcnt_t; /* Type to count number of disk blocks. */ # define __blkcnt_t_defined # endif # ifndef __fsblkcnt_t_defined typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */ # define __fsblkcnt_t_defined # endif # ifndef __fsfilcnt_t_defined typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */ # define __fsfilcnt_t_defined # endif #endif #ifdef __USE_LARGEFILE64 typedef __blkcnt64_t blkcnt64_t; /* Type to count number of disk blocks. */ typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks. */ typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes. */ #endif /* Now add the thread types. */ #if defined __USE_POSIX199506 || defined __USE_UNIX98 # include #endif __END_DECLS #endif /* sys/types.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/ucontext.h ================================================ /* Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_UCONTEXT_H #define _SYS_UCONTEXT_H 1 #include #include #include #include #ifdef __USE_MISC # define __ctx(fld) fld #else # define __ctx(fld) __ ## fld #endif #ifdef __x86_64__ /* Type for general register. */ __extension__ typedef long long int greg_t; /* Number of general registers. */ #define __NGREG 23 #ifdef __USE_MISC # define NGREG __NGREG #endif /* Container for all general registers. */ typedef greg_t gregset_t[__NGREG]; #ifdef __USE_GNU /* Number of each register in the `gregset_t' array. */ enum { REG_R8 = 0, # define REG_R8 REG_R8 REG_R9, # define REG_R9 REG_R9 REG_R10, # define REG_R10 REG_R10 REG_R11, # define REG_R11 REG_R11 REG_R12, # define REG_R12 REG_R12 REG_R13, # define REG_R13 REG_R13 REG_R14, # define REG_R14 REG_R14 REG_R15, # define REG_R15 REG_R15 REG_RDI, # define REG_RDI REG_RDI REG_RSI, # define REG_RSI REG_RSI REG_RBP, # define REG_RBP REG_RBP REG_RBX, # define REG_RBX REG_RBX REG_RDX, # define REG_RDX REG_RDX REG_RAX, # define REG_RAX REG_RAX REG_RCX, # define REG_RCX REG_RCX REG_RSP, # define REG_RSP REG_RSP REG_RIP, # define REG_RIP REG_RIP REG_EFL, # define REG_EFL REG_EFL REG_CSGSFS, /* Actually short cs, gs, fs, __pad0. */ # define REG_CSGSFS REG_CSGSFS REG_ERR, # define REG_ERR REG_ERR REG_TRAPNO, # define REG_TRAPNO REG_TRAPNO REG_OLDMASK, # define REG_OLDMASK REG_OLDMASK REG_CR2 # define REG_CR2 REG_CR2 }; #endif struct _libc_fpxreg { unsigned short int __ctx(significand)[4]; unsigned short int __ctx(exponent); unsigned short int __glibc_reserved1[3]; }; struct _libc_xmmreg { __uint32_t __ctx(element)[4]; }; struct _libc_fpstate { /* 64-bit FXSAVE format. */ __uint16_t __ctx(cwd); __uint16_t __ctx(swd); __uint16_t __ctx(ftw); __uint16_t __ctx(fop); __uint64_t __ctx(rip); __uint64_t __ctx(rdp); __uint32_t __ctx(mxcsr); __uint32_t __ctx(mxcr_mask); struct _libc_fpxreg _st[8]; struct _libc_xmmreg _xmm[16]; __uint32_t __glibc_reserved1[24]; }; /* Structure to describe FPU registers. */ typedef struct _libc_fpstate *fpregset_t; /* Context to describe whole processor state. */ typedef struct { gregset_t __ctx(gregs); /* Note that fpregs is a pointer. */ fpregset_t __ctx(fpregs); __extension__ unsigned long long __reserved1[8]; } mcontext_t; /* Userlevel context. */ typedef struct ucontext_t { unsigned long int __ctx(uc_flags); struct ucontext_t *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; } ucontext_t; #else /* !__x86_64__ */ /* Type for general register. */ typedef int greg_t; /* Number of general registers. */ #define __NGREG 19 #ifdef __USE_MISC # define NGREG __NGREG #endif /* Container for all general registers. */ typedef greg_t gregset_t[__NGREG]; #ifdef __USE_GNU /* Number of each register is the `gregset_t' array. */ enum { REG_GS = 0, # define REG_GS REG_GS REG_FS, # define REG_FS REG_FS REG_ES, # define REG_ES REG_ES REG_DS, # define REG_DS REG_DS REG_EDI, # define REG_EDI REG_EDI REG_ESI, # define REG_ESI REG_ESI REG_EBP, # define REG_EBP REG_EBP REG_ESP, # define REG_ESP REG_ESP REG_EBX, # define REG_EBX REG_EBX REG_EDX, # define REG_EDX REG_EDX REG_ECX, # define REG_ECX REG_ECX REG_EAX, # define REG_EAX REG_EAX REG_TRAPNO, # define REG_TRAPNO REG_TRAPNO REG_ERR, # define REG_ERR REG_ERR REG_EIP, # define REG_EIP REG_EIP REG_CS, # define REG_CS REG_CS REG_EFL, # define REG_EFL REG_EFL REG_UESP, # define REG_UESP REG_UESP REG_SS # define REG_SS REG_SS }; #endif /* Definitions taken from the kernel headers. */ struct _libc_fpreg { unsigned short int __ctx(significand)[4]; unsigned short int __ctx(exponent); }; struct _libc_fpstate { unsigned long int __ctx(cw); unsigned long int __ctx(sw); unsigned long int __ctx(tag); unsigned long int __ctx(ipoff); unsigned long int __ctx(cssel); unsigned long int __ctx(dataoff); unsigned long int __ctx(datasel); struct _libc_fpreg _st[8]; unsigned long int __ctx(status); }; /* Structure to describe FPU registers. */ typedef struct _libc_fpstate *fpregset_t; /* Context to describe whole processor state. */ typedef struct { gregset_t __ctx(gregs); /* Due to Linux's history we have to use a pointer here. The SysV/i386 ABI requires a struct with the values. */ fpregset_t __ctx(fpregs); unsigned long int __ctx(oldmask); unsigned long int __ctx(cr2); } mcontext_t; /* Userlevel context. */ typedef struct ucontext_t { unsigned long int __ctx(uc_flags); struct ucontext_t *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; } ucontext_t; #endif /* !__x86_64__ */ #undef __ctx #endif /* sys/ucontext.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/uio.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_UIO_H #define _SYS_UIO_H 1 #include #include #include #include #ifdef __IOV_MAX # define UIO_MAXIOV __IOV_MAX #else # undef UIO_MAXIOV #endif __BEGIN_DECLS /* Read data from file descriptor FD, and put the result in the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's. The buffers are filled in the order specified. Operates just like 'read' (see ) except that data are put in IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t readv(int __fd, const struct iovec *__iovec, int __count) __wur; /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's, to file descriptor FD. The data is written in the order specified. Operates just like 'write' (see ) except that the data are taken from IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t writev(int __fd, const struct iovec *__iovec, int __count) __wur; #ifdef __USE_MISC # ifndef __USE_FILE_OFFSET64 /* Read data from file descriptor FD at the given position OFFSET without change the file pointer, and put the result in the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's. The buffers are filled in the order specified. Operates just like 'pread' (see ) except that data are put in IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t preadv(int __fd, const struct iovec *__iovec, int __count, __off_t __offset) __wur; /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's, to file descriptor FD at the given position OFFSET without change the file pointer. The data is written in the order specified. Operates just like 'pwrite' (see ) except that the data are taken from IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwritev(int __fd, const struct iovec *__iovec, int __count, __off_t __offset) __wur; # else # ifdef __REDIRECT extern ssize_t __REDIRECT(preadv, (int __fd, const struct iovec * __iovec, int __count, __off64_t __offset), preadv64) __wur; extern ssize_t __REDIRECT(pwritev, (int __fd, const struct iovec * __iovec, int __count, __off64_t __offset), pwritev64) __wur; # else # define preadv preadv64 # define pwritev pwritev64 # endif # endif # ifdef __USE_LARGEFILE64 /* Read data from file descriptor FD at the given position OFFSET without change the file pointer, and put the result in the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's. The buffers are filled in the order specified. Operates just like 'pread' (see ) except that data are put in IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t preadv64(int __fd, const struct iovec *__iovec, int __count, __off64_t __offset) __wur; /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's, to file descriptor FD at the given position OFFSET without change the file pointer. The data is written in the order specified. Operates just like 'pwrite' (see ) except that the data are taken from IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwritev64(int __fd, const struct iovec *__iovec, int __count, __off64_t __offset) __wur; # endif #endif /* Use misc. */ #ifdef __USE_GNU # ifndef __USE_FILE_OFFSET64 /* Same as preadv but with an additional flag argumenti defined at uio.h. */ extern ssize_t preadv2(int __fp, const struct iovec *__iovec, int __count, __off_t __offset, int ___flags) __wur; /* Same as preadv but with an additional flag argument defined at uio.h. */ extern ssize_t pwritev2(int __fd, const struct iovec *__iodev, int __count, __off_t __offset, int __flags) __wur; # else # ifdef __REDIRECT extern ssize_t __REDIRECT(pwritev2, (int __fd, const struct iovec * __iovec, int __count, __off64_t __offset, int __flags), pwritev64v2) __wur; extern ssize_t __REDIRECT(preadv2, (int __fd, const struct iovec * __iovec, int __count, __off64_t __offset, int __flags), preadv64v2) __wur; # else # define preadv2 preadv64v2 # define pwritev2 pwritev64v2 # endif # endif # ifdef __USE_LARGEFILE64 /* Same as preadv but with an additional flag argumenti defined at uio.h. */ extern ssize_t preadv64v2(int __fp, const struct iovec *__iovec, int __count, __off64_t __offset, int ___flags) __wur; /* Same as preadv but with an additional flag argument defined at uio.h. */ extern ssize_t pwritev64v2(int __fd, const struct iovec *__iodev, int __count, __off64_t __offset, int __flags) __wur; # endif #endif /* Use GNU. */ __END_DECLS /* Some operating systems provide system-specific extensions to this header. */ #ifdef __USE_GNU # include #endif #endif /* sys/uio.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/un.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_UN_H #define _SYS_UN_H 1 #include /* Get the definition of the macro to define the common sockaddr members. */ #include __BEGIN_DECLS /* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */ struct sockaddr_un { __SOCKADDR_COMMON(sun_); char sun_path[108]; /* Path name. */ }; #ifdef __USE_MISC # include /* For prototype of `strlen'. */ /* Evaluate to actual length of the `sockaddr_un' structure. */ # define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ + strlen ((ptr)->sun_path)) #endif __END_DECLS #endif /* sys/un.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/utsname.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 4.4 System Identification */ #ifndef _SYS_UTSNAME_H #define _SYS_UTSNAME_H 1 #include __BEGIN_DECLS #include #ifndef _UTSNAME_SYSNAME_LENGTH # define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_NODENAME_LENGTH # define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_RELEASE_LENGTH # define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_VERSION_LENGTH # define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_MACHINE_LENGTH # define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH #endif /* Structure describing the system and machine. */ struct utsname { /* Name of the implementation of the operating system. */ char sysname[_UTSNAME_SYSNAME_LENGTH]; /* Name of this node on the network. */ char nodename[_UTSNAME_NODENAME_LENGTH]; /* Current release level of this implementation. */ char release[_UTSNAME_RELEASE_LENGTH]; /* Current version level of this release. */ char version[_UTSNAME_VERSION_LENGTH]; /* Name of the hardware type the system is running on. */ char machine[_UTSNAME_MACHINE_LENGTH]; #if _UTSNAME_DOMAIN_LENGTH - 0 /* Name of the domain of this node on the network. */ # ifdef __USE_GNU char domainname[_UTSNAME_DOMAIN_LENGTH]; # else char __domainname[_UTSNAME_DOMAIN_LENGTH]; # endif #endif }; #ifdef __USE_MISC /* Note that SVID assumes all members have the same size. */ # define SYS_NMLN _UTSNAME_LENGTH #endif /* Put information about the system in NAME. */ extern int uname(struct utsname *__name) __THROW; __END_DECLS #endif /* sys/utsname.h */ ================================================ FILE: v2/headers/linux_386/usr/include/i386-linux-gnu/sys/wait.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 3.2.1 Wait for Process Termination */ #ifndef _SYS_WAIT_H #define _SYS_WAIT_H 1 #include __BEGIN_DECLS #include #ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 # include #endif #if defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8 /* Some older standards require the contents of struct rusage to be defined here. */ # include #endif /* These macros could also be defined in . */ #if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8) /* This will define the `W*' macros for the flag bits to `waitpid', `wait3', and `wait4'. */ # include /* This will define all the `__W*' macros. */ # include # define WEXITSTATUS(status) __WEXITSTATUS (status) # define WTERMSIG(status) __WTERMSIG (status) # define WSTOPSIG(status) __WSTOPSIG (status) # define WIFEXITED(status) __WIFEXITED (status) # define WIFSIGNALED(status) __WIFSIGNALED (status) # define WIFSTOPPED(status) __WIFSTOPPED (status) # ifdef __WIFCONTINUED # define WIFCONTINUED(status) __WIFCONTINUED (status) # endif #endif /* not included. */ #ifdef __USE_MISC # define WCOREFLAG __WCOREFLAG # define WCOREDUMP(status) __WCOREDUMP (status) # define W_EXITCODE(ret, sig) __W_EXITCODE (ret, sig) # define W_STOPCODE(sig) __W_STOPCODE (sig) #endif /* Wait for a child to die. When one does, put its status in *STAT_LOC and return its process ID. For errors, return (pid_t) -1. This function is a cancellation point and therefore not marked with __THROW. */ extern __pid_t wait(int *__stat_loc); #ifdef __USE_MISC /* Special values for the PID argument to `waitpid' and `wait4'. */ # define WAIT_ANY (-1) /* Any process. */ # define WAIT_MYPGRP 0 /* Any process in my process group. */ #endif /* Wait for a child matching PID to die. If PID is greater than 0, match any process whose process ID is PID. If PID is (pid_t) -1, match any process. If PID is (pid_t) 0, match any process with the same process group as the current process. If PID is less than -1, match any process whose process group is the absolute value of PID. If the WNOHANG bit is set in OPTIONS, and that child is not already dead, return (pid_t) 0. If successful, return PID and store the dead child's status in STAT_LOC. Return (pid_t) -1 for errors. If the WUNTRACED bit is set in OPTIONS, return status for stopped children; otherwise don't. This function is a cancellation point and therefore not marked with __THROW. */ extern __pid_t waitpid(__pid_t __pid, int *__stat_loc, int __options); #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 # ifndef __id_t_defined typedef __id_t id_t; # define __id_t_defined # endif # include /* Wait for a childing matching IDTYPE and ID to change the status and place appropriate information in *INFOP. If IDTYPE is P_PID, match any process whose process ID is ID. If IDTYPE is P_PGID, match any process whose process group is ID. If IDTYPE is P_ALL, match any process. If the WNOHANG bit is set in OPTIONS, and that child is not already dead, clear *INFOP and return 0. If successful, store exit code and status in *INFOP. This function is a cancellation point and therefore not marked with __THROW. */ extern int waitid(idtype_t __idtype, __id_t __id, siginfo_t * __infop, int __options); #endif #if defined __USE_MISC \ || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) /* This being here makes the prototypes valid whether or not we have already included to define `struct rusage'. */ struct rusage; /* Wait for a child to exit. When one does, put its status in *STAT_LOC and return its process ID. For errors return (pid_t) -1. If USAGE is not nil, store information about the child's resource usage there. If the WUNTRACED bit is set in OPTIONS, return status for stopped children; otherwise don't. */ extern __pid_t wait3(int *__stat_loc, int __options, struct rusage *__usage) __THROWNL; #endif #ifdef __USE_MISC /* PID is like waitpid. Other args are like wait3. */ extern __pid_t wait4(__pid_t __pid, int *__stat_loc, int __options, struct rusage *__usage) __THROWNL; #endif /* Use misc. */ __END_DECLS #endif /* sys/wait.h */ ================================================ FILE: v2/headers/linux_386/usr/include/inttypes.h ================================================ /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99: 7.8 Format conversion of integer types */ #ifndef _INTTYPES_H #define _INTTYPES_H 1 #include /* Get the type definitions. */ #include /* Get a definition for wchar_t. But we must not define wchar_t itself. */ #ifndef ____gwchar_t_defined # ifdef __cplusplus # define __gwchar_t wchar_t # elif defined __WCHAR_TYPE__ typedef __WCHAR_TYPE__ __gwchar_t; # else # define __need_wchar_t # include typedef wchar_t __gwchar_t; # endif # define ____gwchar_t_defined 1 #endif # if __WORDSIZE == 64 # define __PRI64_PREFIX "l" # define __PRIPTR_PREFIX "l" # else # define __PRI64_PREFIX "ll" # define __PRIPTR_PREFIX # endif /* Macros for printing format specifiers. */ /* Decimal notation. */ # define PRId8 "d" # define PRId16 "d" # define PRId32 "d" # define PRId64 __PRI64_PREFIX "d" # define PRIdLEAST8 "d" # define PRIdLEAST16 "d" # define PRIdLEAST32 "d" # define PRIdLEAST64 __PRI64_PREFIX "d" # define PRIdFAST8 "d" # define PRIdFAST16 __PRIPTR_PREFIX "d" # define PRIdFAST32 __PRIPTR_PREFIX "d" # define PRIdFAST64 __PRI64_PREFIX "d" # define PRIi8 "i" # define PRIi16 "i" # define PRIi32 "i" # define PRIi64 __PRI64_PREFIX "i" # define PRIiLEAST8 "i" # define PRIiLEAST16 "i" # define PRIiLEAST32 "i" # define PRIiLEAST64 __PRI64_PREFIX "i" # define PRIiFAST8 "i" # define PRIiFAST16 __PRIPTR_PREFIX "i" # define PRIiFAST32 __PRIPTR_PREFIX "i" # define PRIiFAST64 __PRI64_PREFIX "i" /* Octal notation. */ # define PRIo8 "o" # define PRIo16 "o" # define PRIo32 "o" # define PRIo64 __PRI64_PREFIX "o" # define PRIoLEAST8 "o" # define PRIoLEAST16 "o" # define PRIoLEAST32 "o" # define PRIoLEAST64 __PRI64_PREFIX "o" # define PRIoFAST8 "o" # define PRIoFAST16 __PRIPTR_PREFIX "o" # define PRIoFAST32 __PRIPTR_PREFIX "o" # define PRIoFAST64 __PRI64_PREFIX "o" /* Unsigned integers. */ # define PRIu8 "u" # define PRIu16 "u" # define PRIu32 "u" # define PRIu64 __PRI64_PREFIX "u" # define PRIuLEAST8 "u" # define PRIuLEAST16 "u" # define PRIuLEAST32 "u" # define PRIuLEAST64 __PRI64_PREFIX "u" # define PRIuFAST8 "u" # define PRIuFAST16 __PRIPTR_PREFIX "u" # define PRIuFAST32 __PRIPTR_PREFIX "u" # define PRIuFAST64 __PRI64_PREFIX "u" /* lowercase hexadecimal notation. */ # define PRIx8 "x" # define PRIx16 "x" # define PRIx32 "x" # define PRIx64 __PRI64_PREFIX "x" # define PRIxLEAST8 "x" # define PRIxLEAST16 "x" # define PRIxLEAST32 "x" # define PRIxLEAST64 __PRI64_PREFIX "x" # define PRIxFAST8 "x" # define PRIxFAST16 __PRIPTR_PREFIX "x" # define PRIxFAST32 __PRIPTR_PREFIX "x" # define PRIxFAST64 __PRI64_PREFIX "x" /* UPPERCASE hexadecimal notation. */ # define PRIX8 "X" # define PRIX16 "X" # define PRIX32 "X" # define PRIX64 __PRI64_PREFIX "X" # define PRIXLEAST8 "X" # define PRIXLEAST16 "X" # define PRIXLEAST32 "X" # define PRIXLEAST64 __PRI64_PREFIX "X" # define PRIXFAST8 "X" # define PRIXFAST16 __PRIPTR_PREFIX "X" # define PRIXFAST32 __PRIPTR_PREFIX "X" # define PRIXFAST64 __PRI64_PREFIX "X" /* Macros for printing `intmax_t' and `uintmax_t'. */ # define PRIdMAX __PRI64_PREFIX "d" # define PRIiMAX __PRI64_PREFIX "i" # define PRIoMAX __PRI64_PREFIX "o" # define PRIuMAX __PRI64_PREFIX "u" # define PRIxMAX __PRI64_PREFIX "x" # define PRIXMAX __PRI64_PREFIX "X" /* Macros for printing `intptr_t' and `uintptr_t'. */ # define PRIdPTR __PRIPTR_PREFIX "d" # define PRIiPTR __PRIPTR_PREFIX "i" # define PRIoPTR __PRIPTR_PREFIX "o" # define PRIuPTR __PRIPTR_PREFIX "u" # define PRIxPTR __PRIPTR_PREFIX "x" # define PRIXPTR __PRIPTR_PREFIX "X" /* Macros for scanning format specifiers. */ /* Signed decimal notation. */ # define SCNd8 "hhd" # define SCNd16 "hd" # define SCNd32 "d" # define SCNd64 __PRI64_PREFIX "d" # define SCNdLEAST8 "hhd" # define SCNdLEAST16 "hd" # define SCNdLEAST32 "d" # define SCNdLEAST64 __PRI64_PREFIX "d" # define SCNdFAST8 "hhd" # define SCNdFAST16 __PRIPTR_PREFIX "d" # define SCNdFAST32 __PRIPTR_PREFIX "d" # define SCNdFAST64 __PRI64_PREFIX "d" /* Signed decimal notation. */ # define SCNi8 "hhi" # define SCNi16 "hi" # define SCNi32 "i" # define SCNi64 __PRI64_PREFIX "i" # define SCNiLEAST8 "hhi" # define SCNiLEAST16 "hi" # define SCNiLEAST32 "i" # define SCNiLEAST64 __PRI64_PREFIX "i" # define SCNiFAST8 "hhi" # define SCNiFAST16 __PRIPTR_PREFIX "i" # define SCNiFAST32 __PRIPTR_PREFIX "i" # define SCNiFAST64 __PRI64_PREFIX "i" /* Unsigned decimal notation. */ # define SCNu8 "hhu" # define SCNu16 "hu" # define SCNu32 "u" # define SCNu64 __PRI64_PREFIX "u" # define SCNuLEAST8 "hhu" # define SCNuLEAST16 "hu" # define SCNuLEAST32 "u" # define SCNuLEAST64 __PRI64_PREFIX "u" # define SCNuFAST8 "hhu" # define SCNuFAST16 __PRIPTR_PREFIX "u" # define SCNuFAST32 __PRIPTR_PREFIX "u" # define SCNuFAST64 __PRI64_PREFIX "u" /* Octal notation. */ # define SCNo8 "hho" # define SCNo16 "ho" # define SCNo32 "o" # define SCNo64 __PRI64_PREFIX "o" # define SCNoLEAST8 "hho" # define SCNoLEAST16 "ho" # define SCNoLEAST32 "o" # define SCNoLEAST64 __PRI64_PREFIX "o" # define SCNoFAST8 "hho" # define SCNoFAST16 __PRIPTR_PREFIX "o" # define SCNoFAST32 __PRIPTR_PREFIX "o" # define SCNoFAST64 __PRI64_PREFIX "o" /* Hexadecimal notation. */ # define SCNx8 "hhx" # define SCNx16 "hx" # define SCNx32 "x" # define SCNx64 __PRI64_PREFIX "x" # define SCNxLEAST8 "hhx" # define SCNxLEAST16 "hx" # define SCNxLEAST32 "x" # define SCNxLEAST64 __PRI64_PREFIX "x" # define SCNxFAST8 "hhx" # define SCNxFAST16 __PRIPTR_PREFIX "x" # define SCNxFAST32 __PRIPTR_PREFIX "x" # define SCNxFAST64 __PRI64_PREFIX "x" /* Macros for scanning `intmax_t' and `uintmax_t'. */ # define SCNdMAX __PRI64_PREFIX "d" # define SCNiMAX __PRI64_PREFIX "i" # define SCNoMAX __PRI64_PREFIX "o" # define SCNuMAX __PRI64_PREFIX "u" # define SCNxMAX __PRI64_PREFIX "x" /* Macros for scaning `intptr_t' and `uintptr_t'. */ # define SCNdPTR __PRIPTR_PREFIX "d" # define SCNiPTR __PRIPTR_PREFIX "i" # define SCNoPTR __PRIPTR_PREFIX "o" # define SCNuPTR __PRIPTR_PREFIX "u" # define SCNxPTR __PRIPTR_PREFIX "x" __BEGIN_DECLS #if __WORDSIZE == 64 /* We have to define the `uintmax_t' type using `ldiv_t'. */ typedef struct { long int quot; /* Quotient. */ long int rem; /* Remainder. */ } imaxdiv_t; #else /* We have to define the `uintmax_t' type using `lldiv_t'. */ typedef struct { __extension__ long long int quot; /* Quotient. */ __extension__ long long int rem; /* Remainder. */ } imaxdiv_t; #endif /* Compute absolute value of N. */ extern intmax_t imaxabs(intmax_t __n) __THROW __attribute__ ((__const__)); /* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */ extern imaxdiv_t imaxdiv(intmax_t __numer, intmax_t __denom) __THROW __attribute__ ((__const__)); /* Like `strtol' but convert to `intmax_t'. */ extern intmax_t strtoimax(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW; /* Like `strtoul' but convert to `uintmax_t'. */ extern uintmax_t strtoumax(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW; /* Like `wcstol' but convert to `intmax_t'. */ extern intmax_t wcstoimax(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base) __THROW; /* Like `wcstoul' but convert to `uintmax_t'. */ extern uintmax_t wcstoumax(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base) __THROW; #ifdef __USE_EXTERN_INLINES # if __WORDSIZE == 64 extern long int __strtol_internal(const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH(strtoimax(const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtol_internal(nptr, endptr, base, 0); } extern unsigned long int __strtoul_internal(const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH(strtoumax(const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoul_internal(nptr, endptr, base, 0); } extern long int __wcstol_internal(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH(wcstoimax(const __gwchar_t * __restrict nptr, __gwchar_t ** __restrict endptr, int base)) { return __wcstol_internal(nptr, endptr, base, 0); } extern unsigned long int __wcstoul_internal(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH(wcstoumax(const __gwchar_t * __restrict nptr, __gwchar_t ** __restrict endptr, int base)) { return __wcstoul_internal(nptr, endptr, base, 0); } # else /* __WORDSIZE == 32 */ __extension__ extern long long int __strtoll_internal(const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH(strtoimax(const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoll_internal(nptr, endptr, base, 0); } __extension__ extern unsigned long long int __strtoull_internal(const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH(strtoumax(const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoull_internal(nptr, endptr, base, 0); } __extension__ extern long long int __wcstoll_internal(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH(wcstoimax(const __gwchar_t * __restrict nptr, __gwchar_t ** __restrict endptr, int base)) { return __wcstoll_internal(nptr, endptr, base, 0); } __extension__ extern unsigned long long int __wcstoull_internal(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH(wcstoumax(const __gwchar_t * __restrict nptr, __gwchar_t ** __restrict endptr, int base)) { return __wcstoull_internal(nptr, endptr, base, 0); } # endif /* __WORDSIZE == 32 */ #endif /* Use extern inlines. */ __END_DECLS #endif /* inttypes.h */ ================================================ FILE: v2/headers/linux_386/usr/include/limits.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types */ #ifndef _LIBC_LIMITS_H_ #define _LIBC_LIMITS_H_ 1 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include /* Maximum length of any multibyte character in any locale. We define this value here since the gcc header does not define the correct value. */ #define MB_LEN_MAX 16 /* If we are not using GNU CC we have to define all the symbols ourself. Otherwise use gcc's definitions (see below). */ #if !defined __GNUC__ || __GNUC__ < 2 /* We only protect from multiple inclusion here, because all the other #include's protect themselves, and in GCC 2 we may #include_next through multiple copies of this file before we get to GCC's. */ # ifndef _LIMITS_H # define _LIMITS_H 1 #include /* We don't have #include_next. Define ANSI for standard 32-bit words. */ /* These assume 8-bit `char's, 16-bit `short int's, and 32-bit `int's and `long int's. */ /* Number of bits in a `char'. */ # define CHAR_BIT 8 /* Minimum and maximum values a `signed char' can hold. */ # define SCHAR_MIN (-128) # define SCHAR_MAX 127 /* Maximum value an `unsigned char' can hold. (Minimum is 0.) */ # define UCHAR_MAX 255 /* Minimum and maximum values a `char' can hold. */ # ifdef __CHAR_UNSIGNED__ # define CHAR_MIN 0 # define CHAR_MAX UCHAR_MAX # else # define CHAR_MIN SCHAR_MIN # define CHAR_MAX SCHAR_MAX # endif /* Minimum and maximum values a `signed short int' can hold. */ # define SHRT_MIN (-32768) # define SHRT_MAX 32767 /* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */ # define USHRT_MAX 65535 /* Minimum and maximum values a `signed int' can hold. */ # define INT_MIN (-INT_MAX - 1) # define INT_MAX 2147483647 /* Maximum value an `unsigned int' can hold. (Minimum is 0.) */ # define UINT_MAX 4294967295U /* Minimum and maximum values a `signed long int' can hold. */ # if __WORDSIZE == 64 # define LONG_MAX 9223372036854775807L # else # define LONG_MAX 2147483647L # endif # define LONG_MIN (-LONG_MAX - 1L) /* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */ # if __WORDSIZE == 64 # define ULONG_MAX 18446744073709551615UL # else # define ULONG_MAX 4294967295UL # endif # ifdef __USE_ISOC99 /* Minimum and maximum values a `signed long long int' can hold. */ # define LLONG_MAX 9223372036854775807LL # define LLONG_MIN (-LLONG_MAX - 1LL) /* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */ # define ULLONG_MAX 18446744073709551615ULL # endif /* ISO C99 */ # endif /* limits.h */ #endif /* GCC 2. */ #endif /* !_LIBC_LIMITS_H_ */ /* Get the compiler's limits.h, which defines almost all the ISO constants. We put this #include_next outside the double inclusion check because it should be possible to include this file more than once and still get the definitions from gcc's header. */ #if defined __GNUC__ && !defined _GCC_LIMITS_H_ /* `_GCC_LIMITS_H_' is what GCC's file defines. */ # include_next #endif /* The files in some gcc versions don't define LLONG_MIN, LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for ages are available. */ #if defined __USE_ISOC99 && defined __GNUC__ # ifndef LLONG_MIN # define LLONG_MIN (-LLONG_MAX-1) # endif # ifndef LLONG_MAX # define LLONG_MAX __LONG_LONG_MAX__ # endif # ifndef ULLONG_MAX # define ULLONG_MAX (LLONG_MAX * 2ULL + 1) # endif #endif /* The integer width macros are not defined by GCC's before GCC 7, or if _GNU_SOURCE rather than __STDC_WANT_IEC_60559_BFP_EXT__ is used to enable this feature. */ #if __GLIBC_USE (IEC_60559_BFP_EXT) # ifndef CHAR_WIDTH # define CHAR_WIDTH 8 # endif # ifndef SCHAR_WIDTH # define SCHAR_WIDTH 8 # endif # ifndef UCHAR_WIDTH # define UCHAR_WIDTH 8 # endif # ifndef SHRT_WIDTH # define SHRT_WIDTH 16 # endif # ifndef USHRT_WIDTH # define USHRT_WIDTH 16 # endif # ifndef INT_WIDTH # define INT_WIDTH 32 # endif # ifndef UINT_WIDTH # define UINT_WIDTH 32 # endif # ifndef LONG_WIDTH # define LONG_WIDTH __WORDSIZE # endif # ifndef ULONG_WIDTH # define ULONG_WIDTH __WORDSIZE # endif # ifndef LLONG_WIDTH # define LLONG_WIDTH 64 # endif # ifndef ULLONG_WIDTH # define ULLONG_WIDTH 64 # endif #endif /* Use IEC_60559_BFP_EXT. */ #ifdef __USE_POSIX /* POSIX adds things to . */ # include #endif #ifdef __USE_POSIX2 # include #endif #ifdef __USE_XOPEN # include #endif ================================================ FILE: v2/headers/linux_386/usr/include/linux/errno.h ================================================ #include ================================================ FILE: v2/headers/linux_386/usr/include/linux/ioctl.h ================================================ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _LINUX_IOCTL_H #define _LINUX_IOCTL_H #include #endif /* _LINUX_IOCTL_H */ ================================================ FILE: v2/headers/linux_386/usr/include/linux/limits.h ================================================ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _LINUX_LIMITS_H #define _LINUX_LIMITS_H #define NR_OPEN 1024 #define NGROUPS_MAX 65536 /* supplemental group IDs are available */ #define ARG_MAX 131072 /* # bytes of args + environ for exec() */ #define LINK_MAX 127 /* # links a file may have */ #define MAX_CANON 255 /* size of the canonical input queue */ #define MAX_INPUT 255 /* size of the type-ahead buffer */ #define NAME_MAX 255 /* # chars in a file name */ #define PATH_MAX 4096 /* # chars in a path name including nul */ #define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */ #define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */ #define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */ #define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */ #define RTSIG_MAX 32 #endif ================================================ FILE: v2/headers/linux_386/usr/include/linux/param.h ================================================ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _LINUX_PARAM_H #define _LINUX_PARAM_H #include #endif ================================================ FILE: v2/headers/linux_386/usr/include/locale.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.11 Localization */ #ifndef _LOCALE_H #define _LOCALE_H 1 #include #define __need_NULL #include #include __BEGIN_DECLS /* These are the possibilities for the first argument to setlocale. The code assumes that the lowest LC_* symbol has the value zero. */ #define LC_CTYPE __LC_CTYPE #define LC_NUMERIC __LC_NUMERIC #define LC_TIME __LC_TIME #define LC_COLLATE __LC_COLLATE #define LC_MONETARY __LC_MONETARY #define LC_MESSAGES __LC_MESSAGES #define LC_ALL __LC_ALL #define LC_PAPER __LC_PAPER #define LC_NAME __LC_NAME #define LC_ADDRESS __LC_ADDRESS #define LC_TELEPHONE __LC_TELEPHONE #define LC_MEASUREMENT __LC_MEASUREMENT #define LC_IDENTIFICATION __LC_IDENTIFICATION /* Structure giving information about numeric and monetary notation. */ struct lconv { /* Numeric (non-monetary) information. */ char *decimal_point; /* Decimal point character. */ char *thousands_sep; /* Thousands separator. */ /* Each element is the number of digits in each group; elements with higher indices are farther left. An element with value CHAR_MAX means that no further grouping is done. An element with value 0 means that the previous element is used for all groups farther left. */ char *grouping; /* Monetary information. */ /* First three chars are a currency symbol from ISO 4217. Fourth char is the separator. Fifth char is '\0'. */ char *int_curr_symbol; char *currency_symbol; /* Local currency symbol. */ char *mon_decimal_point; /* Decimal point character. */ char *mon_thousands_sep; /* Thousands separator. */ char *mon_grouping; /* Like `grouping' element (above). */ char *positive_sign; /* Sign for positive values. */ char *negative_sign; /* Sign for negative values. */ char int_frac_digits; /* Int'l fractional digits. */ char frac_digits; /* Local fractional digits. */ /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */ char p_cs_precedes; /* 1 iff a space separates currency_symbol from a positive value. */ char p_sep_by_space; /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */ char n_cs_precedes; /* 1 iff a space separates currency_symbol from a negative value. */ char n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and currency_symbol. 1 The sign string precedes the quantity and currency_symbol. 2 The sign string follows the quantity and currency_symbol. 3 The sign string immediately precedes the currency_symbol. 4 The sign string immediately follows the currency_symbol. */ char p_sign_posn; char n_sign_posn; #ifdef __USE_ISOC99 /* 1 if int_curr_symbol precedes a positive value, 0 if succeeds. */ char int_p_cs_precedes; /* 1 iff a space separates int_curr_symbol from a positive value. */ char int_p_sep_by_space; /* 1 if int_curr_symbol precedes a negative value, 0 if succeeds. */ char int_n_cs_precedes; /* 1 iff a space separates int_curr_symbol from a negative value. */ char int_n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and int_curr_symbol. 1 The sign string precedes the quantity and int_curr_symbol. 2 The sign string follows the quantity and int_curr_symbol. 3 The sign string immediately precedes the int_curr_symbol. 4 The sign string immediately follows the int_curr_symbol. */ char int_p_sign_posn; char int_n_sign_posn; #else char __int_p_cs_precedes; char __int_p_sep_by_space; char __int_n_cs_precedes; char __int_n_sep_by_space; char __int_p_sign_posn; char __int_n_sign_posn; #endif }; /* Set and/or return the current locale. */ extern char *setlocale(int __category, const char *__locale) __THROW; /* Return the numeric/monetary information for the current locale. */ extern struct lconv *localeconv(void) __THROW; #ifdef __USE_XOPEN2K8 /* POSIX.1-2008 extends the locale interface with functions for explicit creation and manipulation of 'locale_t' objects representing locale contexts, and a set of parallel locale-sensitive text processing functions that take a locale_t argument. This enables applications to work with data from multiple locales simultaneously and thread-safely. */ # include /* Return a reference to a data structure representing a set of locale datasets. Unlike for the CATEGORY parameter for `setlocale' the CATEGORY_MASK parameter here uses a single bit for each category, made by OR'ing together LC_*_MASK bits above. */ extern locale_t newlocale(int __category_mask, const char *__locale, locale_t __base) __THROW; /* These are the bits that can be set in the CATEGORY_MASK argument to `newlocale'. In the GNU implementation, LC_FOO_MASK has the value of (1 << LC_FOO), but this is not a part of the interface that callers can assume will be true. */ # define LC_CTYPE_MASK (1 << __LC_CTYPE) # define LC_NUMERIC_MASK (1 << __LC_NUMERIC) # define LC_TIME_MASK (1 << __LC_TIME) # define LC_COLLATE_MASK (1 << __LC_COLLATE) # define LC_MONETARY_MASK (1 << __LC_MONETARY) # define LC_MESSAGES_MASK (1 << __LC_MESSAGES) # define LC_PAPER_MASK (1 << __LC_PAPER) # define LC_NAME_MASK (1 << __LC_NAME) # define LC_ADDRESS_MASK (1 << __LC_ADDRESS) # define LC_TELEPHONE_MASK (1 << __LC_TELEPHONE) # define LC_MEASUREMENT_MASK (1 << __LC_MEASUREMENT) # define LC_IDENTIFICATION_MASK (1 << __LC_IDENTIFICATION) # define LC_ALL_MASK (LC_CTYPE_MASK \ | LC_NUMERIC_MASK \ | LC_TIME_MASK \ | LC_COLLATE_MASK \ | LC_MONETARY_MASK \ | LC_MESSAGES_MASK \ | LC_PAPER_MASK \ | LC_NAME_MASK \ | LC_ADDRESS_MASK \ | LC_TELEPHONE_MASK \ | LC_MEASUREMENT_MASK \ | LC_IDENTIFICATION_MASK \ ) /* Return a duplicate of the set of locale in DATASET. All usage counters are increased if necessary. */ extern locale_t duplocale(locale_t __dataset) __THROW; /* Free the data associated with a locale dataset previously returned by a call to `setlocale_r'. */ extern void freelocale(locale_t __dataset) __THROW; /* Switch the current thread's locale to DATASET. If DATASET is null, instead just return the current setting. The special value LC_GLOBAL_LOCALE is the initial setting for all threads and can also be installed any time, meaning the thread uses the global settings controlled by `setlocale'. */ extern locale_t uselocale(locale_t __dataset) __THROW; /* This value can be passed to `uselocale' and may be returned by it. Passing this value to any other function has undefined behavior. */ # define LC_GLOBAL_LOCALE ((locale_t) -1L) #endif __END_DECLS #endif /* locale.h */ ================================================ FILE: v2/headers/linux_386/usr/include/malloc.h ================================================ /* Prototypes and definition for malloc implementation. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MALLOC_H #define _MALLOC_H 1 #include #include #include #ifdef _LIBC # define __MALLOC_HOOK_VOLATILE # define __MALLOC_DEPRECATED #else # define __MALLOC_HOOK_VOLATILE volatile # define __MALLOC_DEPRECATED __attribute_deprecated__ #endif __BEGIN_DECLS /* Allocate SIZE bytes of memory. */ extern void *malloc(size_t __size) __THROW __attribute_malloc__ __wur; /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ extern void *calloc(size_t __nmemb, size_t __size) __THROW __attribute_malloc__ __wur; /* Re-allocate the previously allocated block in __ptr, making the new block SIZE bytes long. */ /* __attribute_malloc__ is not used, because if realloc returns the same pointer that was passed to it, aliasing needs to be allowed between objects pointed by the old and new pointers. */ extern void *realloc(void *__ptr, size_t __size) __THROW __attribute_warn_unused_result__; /* Re-allocate the previously allocated block in PTR, making the new block large enough for NMEMB elements of SIZE bytes each. */ /* __attribute_malloc__ is not used, because if reallocarray returns the same pointer that was passed to it, aliasing needs to be allowed between objects pointed by the old and new pointers. */ extern void *reallocarray(void *__ptr, size_t __nmemb, size_t __size) __THROW __attribute_warn_unused_result__; /* Free a block allocated by `malloc', `realloc' or `calloc'. */ extern void free(void *__ptr) __THROW; /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ extern void *memalign(size_t __alignment, size_t __size) __THROW __attribute_malloc__ __wur; /* Allocate SIZE bytes on a page boundary. */ extern void *valloc(size_t __size) __THROW __attribute_malloc__ __wur; /* Equivalent to valloc(minimum-page-that-holds(n)), that is, round up __size to nearest pagesize. */ extern void *pvalloc(size_t __size) __THROW __attribute_malloc__ __wur; /* Underlying allocation function; successive calls should return contiguous pieces of memory. */ extern void *(*__morecore) (ptrdiff_t __size); /* Default value of `__morecore'. */ extern void *__default_morecore(ptrdiff_t __size) __THROW __attribute_malloc__; /* SVID2/XPG mallinfo structure */ struct mallinfo { int arena; /* non-mmapped space allocated from system */ int ordblks; /* number of free chunks */ int smblks; /* number of fastbin blocks */ int hblks; /* number of mmapped regions */ int hblkhd; /* space in mmapped regions */ int usmblks; /* always 0, preserved for backwards compatibility */ int fsmblks; /* space available in freed fastbin blocks */ int uordblks; /* total allocated space */ int fordblks; /* total free space */ int keepcost; /* top-most, releasable (via malloc_trim) space */ }; /* Returns a copy of the updated current mallinfo. */ extern struct mallinfo mallinfo(void) __THROW; /* SVID2/XPG mallopt options */ #ifndef M_MXFAST # define M_MXFAST 1 /* maximum request size for "fastbins" */ #endif #ifndef M_NLBLKS # define M_NLBLKS 2 /* UNUSED in this malloc */ #endif #ifndef M_GRAIN # define M_GRAIN 3 /* UNUSED in this malloc */ #endif #ifndef M_KEEP # define M_KEEP 4 /* UNUSED in this malloc */ #endif /* mallopt options that actually do something */ #define M_TRIM_THRESHOLD -1 #define M_TOP_PAD -2 #define M_MMAP_THRESHOLD -3 #define M_MMAP_MAX -4 #define M_CHECK_ACTION -5 #define M_PERTURB -6 #define M_ARENA_TEST -7 #define M_ARENA_MAX -8 /* General SVID/XPG interface to tunable parameters. */ extern int mallopt(int __param, int __val) __THROW; /* Release all but __pad bytes of freed top-most memory back to the system. Return 1 if successful, else 0. */ extern int malloc_trim(size_t __pad) __THROW; /* Report the number of usable allocated bytes associated with allocated chunk __ptr. */ extern size_t malloc_usable_size(void *__ptr) __THROW; /* Prints brief summary statistics on stderr. */ extern void malloc_stats(void) __THROW; /* Output information about state of allocator to stream FP. */ extern int malloc_info(int __options, FILE * __fp) __THROW; /* Hooks for debugging and user-defined versions. */ extern void (*__MALLOC_HOOK_VOLATILE __free_hook) (void *__ptr, const void *)__MALLOC_DEPRECATED; extern void *(*__MALLOC_HOOK_VOLATILE __malloc_hook) (size_t __size, const void *)__MALLOC_DEPRECATED; extern void *(*__MALLOC_HOOK_VOLATILE __realloc_hook) (void *__ptr, size_t __size, const void *)__MALLOC_DEPRECATED; extern void *(*__MALLOC_HOOK_VOLATILE __memalign_hook) (size_t __alignment, size_t __size, const void *)__MALLOC_DEPRECATED; extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void); /* Activate a standard set of debugging hooks. */ extern void __malloc_check_init(void) __THROW __MALLOC_DEPRECATED; __END_DECLS #endif /* malloc.h */ ================================================ FILE: v2/headers/linux_386/usr/include/math.h ================================================ /* Declarations for math functions. Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.12 Mathematics */ #ifndef _MATH_H #define _MATH_H 1 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include #if defined log && defined __GNUC__ # warning A macro called log was already defined when was included. # warning This will cause compilation problems. #endif __BEGIN_DECLS /* Get definitions of __intmax_t and __uintmax_t. */ #include /* Get machine-dependent vector math functions declarations. */ #include /* Gather machine dependent type support. */ #include /* Value returned on overflow. With IEEE 754 floating point, this is +Infinity, otherwise the largest representable positive value. */ #if __GNUC_PREREQ (3, 3) # define HUGE_VAL (__builtin_huge_val ()) #else /* This may provoke compiler warnings, and may not be rounded to +Infinity in all IEEE 754 rounding modes, but is the best that can be done in ISO C while remaining a constant expression. 10,000 is greater than the maximum (decimal) exponent for all supported floating-point formats and widths. */ # define HUGE_VAL 1e10000 #endif #ifdef __USE_ISOC99 # if __GNUC_PREREQ (3, 3) # define HUGE_VALF (__builtin_huge_valf ()) # define HUGE_VALL (__builtin_huge_vall ()) # else # define HUGE_VALF 1e10000f # define HUGE_VALL 1e10000L # endif #endif #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define HUGE_VAL_F16 (__builtin_huge_valf16 ()) #endif #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define HUGE_VAL_F32 (__builtin_huge_valf32 ()) #endif #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define HUGE_VAL_F64 (__builtin_huge_valf64 ()) #endif #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define HUGE_VAL_F128 (__builtin_huge_valf128 ()) #endif #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT) # define HUGE_VAL_F32X (__builtin_huge_valf32x ()) #endif #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT) # define HUGE_VAL_F64X (__builtin_huge_valf64x ()) #endif #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT) # define HUGE_VAL_F128X (__builtin_huge_valf128x ()) #endif #ifdef __USE_ISOC99 /* IEEE positive infinity. */ # if __GNUC_PREREQ (3, 3) # define INFINITY (__builtin_inff ()) # else # define INFINITY HUGE_VALF # endif /* IEEE Not A Number. */ # if __GNUC_PREREQ (3, 3) # define NAN (__builtin_nanf ("")) # else /* This will raise an "invalid" exception outside static initializers, but is the best that can be done in ISO C while remaining a constant expression. */ # define NAN (0.0f / 0.0f) # endif #endif /* __USE_ISOC99 */ #if __GLIBC_USE (IEC_60559_BFP_EXT) /* Signaling NaN macros, if supported. */ # if __GNUC_PREREQ (3, 3) # define SNANF (__builtin_nansf ("")) # define SNAN (__builtin_nans ("")) # define SNANL (__builtin_nansl ("")) # endif #endif #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define SNANF16 (__builtin_nansf16 ("")) #endif #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define SNANF32 (__builtin_nansf32 ("")) #endif #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define SNANF64 (__builtin_nansf64 ("")) #endif #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define SNANF128 (__builtin_nansf128 ("")) #endif #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT) # define SNANF32X (__builtin_nansf32x ("")) #endif #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT) # define SNANF64X (__builtin_nansf64x ("")) #endif #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT) # define SNANF128X (__builtin_nansf128x ("")) #endif /* Get __GLIBC_FLT_EVAL_METHOD. */ #include #ifdef __USE_ISOC99 /* Define the following typedefs. float_t floating-point type at least as wide as `float' used to evaluate `float' expressions double_t floating-point type at least as wide as `double' used to evaluate `double' expressions */ # if __GLIBC_FLT_EVAL_METHOD == 0 || __GLIBC_FLT_EVAL_METHOD == 16 typedef float float_t; typedef double double_t; # elif __GLIBC_FLT_EVAL_METHOD == 1 typedef double float_t; typedef double double_t; # elif __GLIBC_FLT_EVAL_METHOD == 2 typedef long double float_t; typedef long double double_t; # elif __GLIBC_FLT_EVAL_METHOD == 32 typedef _Float32 float_t; typedef double double_t; # elif __GLIBC_FLT_EVAL_METHOD == 33 typedef _Float32x float_t; typedef _Float32x double_t; # elif __GLIBC_FLT_EVAL_METHOD == 64 typedef _Float64 float_t; typedef _Float64 double_t; # elif __GLIBC_FLT_EVAL_METHOD == 65 typedef _Float64x float_t; typedef _Float64x double_t; # elif __GLIBC_FLT_EVAL_METHOD == 128 typedef _Float128 float_t; typedef _Float128 double_t; # elif __GLIBC_FLT_EVAL_METHOD == 129 typedef _Float128x float_t; typedef _Float128x double_t; # else # error "Unknown __GLIBC_FLT_EVAL_METHOD" # endif #endif /* Define macros for the return values of ilogb and llogb, based on __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. FP_ILOGB0 Expands to a value returned by `ilogb (0.0)'. FP_ILOGBNAN Expands to a value returned by `ilogb (NAN)'. FP_LLOGB0 Expands to a value returned by `llogb (0.0)'. FP_LLOGBNAN Expands to a value returned by `llogb (NAN)'. */ #include #ifdef __USE_ISOC99 # if __FP_LOGB0_IS_MIN # define FP_ILOGB0 (-2147483647 - 1) # else # define FP_ILOGB0 (-2147483647) # endif # if __FP_LOGBNAN_IS_MIN # define FP_ILOGBNAN (-2147483647 - 1) # else # define FP_ILOGBNAN 2147483647 # endif #endif #if __GLIBC_USE (IEC_60559_BFP_EXT) # if __WORDSIZE == 32 # define __FP_LONG_MAX 0x7fffffffL # else # define __FP_LONG_MAX 0x7fffffffffffffffL # endif # if __FP_LOGB0_IS_MIN # define FP_LLOGB0 (-__FP_LONG_MAX - 1) # else # define FP_LLOGB0 (-__FP_LONG_MAX) # endif # if __FP_LOGBNAN_IS_MIN # define FP_LLOGBNAN (-__FP_LONG_MAX - 1) # else # define FP_LLOGBNAN __FP_LONG_MAX # endif #endif /* Get the architecture specific values describing the floating-point evaluation. The following symbols will get defined: FP_FAST_FMA FP_FAST_FMAF FP_FAST_FMAL If defined it indicates that the `fma' function generally executes about as fast as a multiply and an add. This macro is defined only iff the `fma' function is implemented directly with a hardware multiply-add instructions. */ #include #if __GLIBC_USE (IEC_60559_BFP_EXT) /* Rounding direction macros for fromfp functions. */ enum { FP_INT_UPWARD = # define FP_INT_UPWARD 0 FP_INT_UPWARD, FP_INT_DOWNWARD = # define FP_INT_DOWNWARD 1 FP_INT_DOWNWARD, FP_INT_TOWARDZERO = # define FP_INT_TOWARDZERO 2 FP_INT_TOWARDZERO, FP_INT_TONEARESTFROMZERO = # define FP_INT_TONEARESTFROMZERO 3 FP_INT_TONEARESTFROMZERO, FP_INT_TONEAREST = # define FP_INT_TONEAREST 4 FP_INT_TONEAREST, }; #endif /* The file contains the prototypes for all the actual math functions. These macros are used for those prototypes, so we can easily declare each function as both `name' and `__name', and can declare the float versions `namef' and `__namef'. */ #define __SIMD_DECL(function) __CONCAT (__DECL_SIMD_, function) #define __MATHCALL_VEC(function, suffix, args) \ __SIMD_DECL (__MATH_PRECNAME (function, suffix)) \ __MATHCALL (function, suffix, args) #define __MATHDECL_VEC(type, function,suffix, args) \ __SIMD_DECL (__MATH_PRECNAME (function, suffix)) \ __MATHDECL(type, function,suffix, args) #define __MATHCALL(function,suffix, args) \ __MATHDECL (_Mdouble_,function,suffix, args) #define __MATHDECL(type, function,suffix, args) \ __MATHDECL_1(type, function,suffix, args); \ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) #define __MATHCALLX(function,suffix, args, attrib) \ __MATHDECLX (_Mdouble_,function,suffix, args, attrib) #define __MATHDECLX(type, function,suffix, args, attrib) \ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib) #define __MATHDECL_1(type, function,suffix, args) \ extern type __MATH_PRECNAME(function,suffix) args __THROW #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) #define __MATH_DECLARING_DOUBLE 1 #define __MATH_DECLARING_FLOATN 0 #include #include #undef _Mdouble_ #undef __MATH_PRECNAME #undef __MATH_DECLARING_DOUBLE #undef __MATH_DECLARING_FLOATN #ifdef __USE_ISOC99 /* Include the file of declarations again, this time using `float' instead of `double' and appending f to each function name. */ # define _Mdouble_ float # define __MATH_PRECNAME(name,r) name##f##r # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 0 # include # include # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN # if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) \ || defined __LDBL_COMPAT \ || defined _LIBC_TEST # ifdef __LDBL_COMPAT # ifdef __USE_ISOC99 extern float __nldbl_nexttowardf(float __x, long double __y) __THROW __attribute__ ((__const__)); # ifdef __REDIRECT_NTH extern float __REDIRECT_NTH(nexttowardf, (float __x, long double __y), __nldbl_nexttowardf) __attribute__ ((__const__)); extern double __REDIRECT_NTH(nexttoward, (double __x, long double __y), nextafter) __attribute__ ((__const__)); extern long double __REDIRECT_NTH(nexttowardl, (long double __x, long double __y), nextafter) __attribute__ ((__const__)); # endif # endif # undef __MATHDECL_1 # define __MATHDECL_2(type, function,suffix, args, alias) \ extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \ args, alias) # define __MATHDECL_1(type, function,suffix, args) \ __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix)) # endif /* Include the file of declarations again, this time using `long double' instead of `double' and appending l to each function name. */ # define _Mdouble_ long double # define __MATH_PRECNAME(name,r) name##l##r # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 0 # define __MATH_DECLARE_LDOUBLE 1 # include # include # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN # endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */ #endif /* Use ISO C99. */ /* Include the file of declarations for _FloatN and _FloatNx types. */ #if __HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !defined _LIBC) # define _Mdouble_ _Float16 # define __MATH_PRECNAME(name,r) name##f16##r # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # if __HAVE_DISTINCT_FLOAT16 # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) # include # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN #endif /* __HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC). */ #if __HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !defined _LIBC) # define _Mdouble_ _Float32 # define __MATH_PRECNAME(name,r) name##f32##r # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # if __HAVE_DISTINCT_FLOAT32 # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) # include # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN #endif /* __HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC). */ #if __HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !defined _LIBC) # define _Mdouble_ _Float64 # define __MATH_PRECNAME(name,r) name##f64##r # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # if __HAVE_DISTINCT_FLOAT64 # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) # include # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN #endif /* __HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC). */ #if __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC) # define _Mdouble_ _Float128 # define __MATH_PRECNAME(name,r) name##f128##r # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # if __HAVE_DISTINCT_FLOAT128 # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) # include # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN #endif /* __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !_LIBC). */ #if __HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !defined _LIBC) # define _Mdouble_ _Float32x # define __MATH_PRECNAME(name,r) name##f32x##r # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # if __HAVE_DISTINCT_FLOAT32X # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) # include # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN #endif /* __HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC). */ #if __HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !defined _LIBC) # define _Mdouble_ _Float64x # define __MATH_PRECNAME(name,r) name##f64x##r # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # if __HAVE_DISTINCT_FLOAT64X # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) # include # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN #endif /* __HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC). */ #if __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !defined _LIBC) # define _Mdouble_ _Float128x # define __MATH_PRECNAME(name,r) name##f128x##r # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # if __HAVE_DISTINCT_FLOAT128X # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) # include # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN #endif /* __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC). */ #undef __MATHDECL_1 #undef __MATHDECL #undef __MATHCALL #if defined __USE_MISC || defined __USE_XOPEN /* This variable is used by `gamma' and `lgamma'. */ extern int signgam; #endif #if (__HAVE_DISTINCT_FLOAT16 \ || __HAVE_DISTINCT_FLOAT32 \ || __HAVE_DISTINCT_FLOAT64 \ || __HAVE_DISTINCT_FLOAT32X \ || __HAVE_DISTINCT_FLOAT64X \ || __HAVE_DISTINCT_FLOAT128X) # error "Unsupported _FloatN or _FloatNx types for ." #endif /* Depending on the type of TG_ARG, call an appropriately suffixed version of FUNC with arguments (including parentheses) ARGS. Suffixed functions may not exist for long double if it has the same format as double, or for other types with the same format as float, double or long double. The behavior is undefined if the argument does not have a real floating type. The definition may use a conditional expression, so all suffixed versions of FUNC must return the same type (FUNC may include a cast if necessary rather than being a single identifier). */ #ifdef __NO_LONG_DOUBLE_MATH # if __HAVE_DISTINCT_FLOAT128 # error "Distinct _Float128 without distinct long double not supported." # endif # define __MATH_TG(TG_ARG, FUNC, ARGS) \ (sizeof (TG_ARG) == sizeof (float) ? FUNC ## f ARGS : FUNC ARGS) #elif __HAVE_DISTINCT_FLOAT128 # if __HAVE_GENERIC_SELECTION # if __HAVE_FLOATN_NOT_TYPEDEF && __HAVE_FLOAT32 # define __MATH_TG_F32(FUNC, ARGS) _Float32: FUNC ## f ARGS, # else # define __MATH_TG_F32(FUNC, ARGS) # endif # if __HAVE_FLOATN_NOT_TYPEDEF && __HAVE_FLOAT64X # if __HAVE_FLOAT64X_LONG_DOUBLE # define __MATH_TG_F64X(FUNC, ARGS) _Float64x: FUNC ## l ARGS, # else # define __MATH_TG_F64X(FUNC, ARGS) _Float64x: FUNC ## f128 ARGS, # endif # else # define __MATH_TG_F64X(FUNC, ARGS) # endif # define __MATH_TG(TG_ARG, FUNC, ARGS) \ _Generic ((TG_ARG), \ float: FUNC ## f ARGS, \ __MATH_TG_F32 (FUNC, ARGS) \ default: FUNC ARGS, \ long double: FUNC ## l ARGS, \ __MATH_TG_F64X (FUNC, ARGS) \ _Float128: FUNC ## f128 ARGS) # else # if __HAVE_FLOATN_NOT_TYPEDEF # error "Non-typedef _FloatN but no _Generic." # endif # define __MATH_TG(TG_ARG, FUNC, ARGS) \ __builtin_choose_expr \ (__builtin_types_compatible_p (__typeof (TG_ARG), float), \ FUNC ## f ARGS, \ __builtin_choose_expr \ (__builtin_types_compatible_p (__typeof (TG_ARG), double), \ FUNC ARGS, \ __builtin_choose_expr \ (__builtin_types_compatible_p (__typeof (TG_ARG), long double), \ FUNC ## l ARGS, \ FUNC ## f128 ARGS))) # endif #else # define __MATH_TG(TG_ARG, FUNC, ARGS) \ (sizeof (TG_ARG) == sizeof (float) \ ? FUNC ## f ARGS \ : sizeof (TG_ARG) == sizeof (double) \ ? FUNC ARGS \ : FUNC ## l ARGS) #endif /* ISO C99 defines some generic macros which work on any data type. */ #ifdef __USE_ISOC99 /* All floating-point numbers can be put in one of these categories. */ enum { FP_NAN = # define FP_NAN 0 FP_NAN, FP_INFINITE = # define FP_INFINITE 1 FP_INFINITE, FP_ZERO = # define FP_ZERO 2 FP_ZERO, FP_SUBNORMAL = # define FP_SUBNORMAL 3 FP_SUBNORMAL, FP_NORMAL = # define FP_NORMAL 4 FP_NORMAL }; /* GCC bug 66462 means we cannot use the math builtins with -fsignaling-nan, so disable builtins if this is enabled. When fixed in a newer GCC, the __SUPPORT_SNAN__ check may be skipped for those versions. */ /* Return number of classification appropriate for X. */ # if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__ \ && (!defined __OPTIMIZE_SIZE__ || defined __cplusplus) /* The check for __cplusplus allows the use of the builtin, even when optimization for size is on. This is provided for libstdc++, only to let its configure test work when it is built with -Os. No further use of this definition of fpclassify is expected in C++ mode, since libstdc++ provides its own version of fpclassify in cmath (which undefines fpclassify). */ # define fpclassify(x) __builtin_fpclassify (FP_NAN, FP_INFINITE, \ FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x) # else # define fpclassify(x) __MATH_TG ((x), __fpclassify, (x)) # endif /* Return nonzero value if sign of X is negative. */ # if __GNUC_PREREQ (6,0) # define signbit(x) __builtin_signbit (x) # elif defined __cplusplus /* In C++ mode, __MATH_TG cannot be used, because it relies on __builtin_types_compatible_p, which is a C-only builtin. The check for __cplusplus allows the use of the builtin instead of __MATH_TG. This is provided for libstdc++, only to let its configure test work. No further use of this definition of signbit is expected in C++ mode, since libstdc++ provides its own version of signbit in cmath (which undefines signbit). */ # define signbit(x) __builtin_signbitl (x) # elif __GNUC_PREREQ (4,0) # define signbit(x) __MATH_TG ((x), __builtin_signbit, (x)) # else # define signbit(x) __MATH_TG ((x), __signbit, (x)) # endif /* Return nonzero value if X is not +-Inf or NaN. */ # if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__ # define isfinite(x) __builtin_isfinite (x) # else # define isfinite(x) __MATH_TG ((x), __finite, (x)) # endif /* Return nonzero value if X is neither zero, subnormal, Inf, nor NaN. */ # if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__ # define isnormal(x) __builtin_isnormal (x) # else # define isnormal(x) (fpclassify (x) == FP_NORMAL) # endif /* Return nonzero value if X is a NaN. We could use `fpclassify' but we already have this functions `__isnan' and it is faster. */ # if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__ # define isnan(x) __builtin_isnan (x) # else # define isnan(x) __MATH_TG ((x), __isnan, (x)) # endif /* Return nonzero value if X is positive or negative infinity. */ # if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \ && !defined __SUPPORT_SNAN__ && !defined __cplusplus /* Since __builtin_isinf_sign is broken for float128 before GCC 7.0, use the helper function, __isinff128, with older compilers. This is only provided for C mode, because in C++ mode, GCC has no support for __builtin_types_compatible_p (and when in C++ mode, this macro is not used anyway, because libstdc++ headers undefine it). */ # define isinf(x) \ (__builtin_types_compatible_p (__typeof (x), _Float128) \ ? __isinff128 (x) : __builtin_isinf_sign (x)) # elif __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__ # define isinf(x) __builtin_isinf_sign (x) # else # define isinf(x) __MATH_TG ((x), __isinf, (x)) # endif /* Bitmasks for the math_errhandling macro. */ # define MATH_ERRNO 1 /* errno set by math functions. */ # define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */ /* By default all math functions support both errno and exception handling (except for soft floating point implementations which may only support errno handling). If errno handling is disabled, exceptions are still supported by GLIBC. Set math_errhandling to 0 with -ffast-math (this is nonconforming but it is more useful than leaving it undefined). */ # ifdef __FAST_MATH__ # define math_errhandling 0 # elif defined __NO_MATH_ERRNO__ # define math_errhandling (MATH_ERREXCEPT) # else # define math_errhandling (MATH_ERRNO | MATH_ERREXCEPT) # endif #endif /* Use ISO C99. */ #if __GLIBC_USE (IEC_60559_BFP_EXT) # include /* Return nonzero value if X is a signaling NaN. */ # ifndef __cplusplus # define issignaling(x) __MATH_TG ((x), __issignaling, (x)) # else /* In C++ mode, __MATH_TG cannot be used, because it relies on __builtin_types_compatible_p, which is a C-only builtin. On the other hand, overloading provides the means to distinguish between the floating-point types. The overloading resolution will match the correct parameter (regardless of type qualifiers (i.e.: const and volatile)). */ extern "C++" { inline int issignaling(float __val) { return __issignalingf(__val); } inline int issignaling(double __val) { return __issignaling(__val); } inline int issignaling(long double __val) { # ifdef __NO_LONG_DOUBLE_MATH return __issignaling(__val); # else return __issignalingl(__val); # endif } # if __HAVE_DISTINCT_FLOAT128 inline int issignaling(_Float128 __val) { return __issignalingf128(__val); } # endif } /* extern C++ */ # endif /* Return nonzero value if X is subnormal. */ # define issubnormal(x) (fpclassify (x) == FP_SUBNORMAL) /* Return nonzero value if X is zero. */ # ifndef __cplusplus # ifdef __SUPPORT_SNAN__ # define iszero(x) (fpclassify (x) == FP_ZERO) # else # define iszero(x) (((__typeof (x)) (x)) == 0) # endif # else /* __cplusplus */ extern "C++" { # ifdef __SUPPORT_SNAN__ inline int iszero(float __val) { return __fpclassifyf(__val) == FP_ZERO; } inline int iszero(double __val) { return __fpclassify(__val) == FP_ZERO; } inline int iszero(long double __val) { # ifdef __NO_LONG_DOUBLE_MATH return __fpclassify(__val) == FP_ZERO; # else return __fpclassifyl(__val) == FP_ZERO; # endif } # if __HAVE_DISTINCT_FLOAT128 inline int iszero(_Float128 __val) { return __fpclassifyf128(__val) == FP_ZERO; } # endif # else template < class __T > inline bool iszero(__T __val) { return __val == 0; } # endif } /* extern C++ */ # endif /* __cplusplus */ #endif /* Use IEC_60559_BFP_EXT. */ #ifdef __USE_XOPEN /* X/Open wants another strange constant. */ # define MAXFLOAT 3.40282347e+38F #endif /* Some useful constants. */ #if defined __USE_MISC || defined __USE_XOPEN # define M_E 2.7182818284590452354 /* e */ # define M_LOG2E 1.4426950408889634074 /* log_2 e */ # define M_LOG10E 0.43429448190325182765 /* log_10 e */ # define M_LN2 0.69314718055994530942 /* log_e 2 */ # define M_LN10 2.30258509299404568402 /* log_e 10 */ # define M_PI 3.14159265358979323846 /* pi */ # define M_PI_2 1.57079632679489661923 /* pi/2 */ # define M_PI_4 0.78539816339744830962 /* pi/4 */ # define M_1_PI 0.31830988618379067154 /* 1/pi */ # define M_2_PI 0.63661977236758134308 /* 2/pi */ # define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ # define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ # define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ #endif /* The above constants are not adequate for computation using `long double's. Therefore we provide as an extension constants with similar names as a GNU extension. Provide enough digits for the 128-bit IEEE quad. */ #ifdef __USE_GNU # define M_El 2.718281828459045235360287471352662498L /* e */ # define M_LOG2El 1.442695040888963407359924681001892137L /* log_2 e */ # define M_LOG10El 0.434294481903251827651128918916605082L /* log_10 e */ # define M_LN2l 0.693147180559945309417232121458176568L /* log_e 2 */ # define M_LN10l 2.302585092994045684017991454684364208L /* log_e 10 */ # define M_PIl 3.141592653589793238462643383279502884L /* pi */ # define M_PI_2l 1.570796326794896619231321691639751442L /* pi/2 */ # define M_PI_4l 0.785398163397448309615660845819875721L /* pi/4 */ # define M_1_PIl 0.318309886183790671537767526745028724L /* 1/pi */ # define M_2_PIl 0.636619772367581343075535053490057448L /* 2/pi */ # define M_2_SQRTPIl 1.128379167095512573896158903121545172L /* 2/sqrt(pi) */ # define M_SQRT2l 1.414213562373095048801688724209698079L /* sqrt(2) */ # define M_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */ #endif #if __HAVE_FLOAT16 && defined __USE_GNU # define M_Ef16 __f16 (2.718281828459045235360287471352662498) /* e */ # define M_LOG2Ef16 __f16 (1.442695040888963407359924681001892137) /* log_2 e */ # define M_LOG10Ef16 __f16 (0.434294481903251827651128918916605082) /* log_10 e */ # define M_LN2f16 __f16 (0.693147180559945309417232121458176568) /* log_e 2 */ # define M_LN10f16 __f16 (2.302585092994045684017991454684364208) /* log_e 10 */ # define M_PIf16 __f16 (3.141592653589793238462643383279502884) /* pi */ # define M_PI_2f16 __f16 (1.570796326794896619231321691639751442) /* pi/2 */ # define M_PI_4f16 __f16 (0.785398163397448309615660845819875721) /* pi/4 */ # define M_1_PIf16 __f16 (0.318309886183790671537767526745028724) /* 1/pi */ # define M_2_PIf16 __f16 (0.636619772367581343075535053490057448) /* 2/pi */ # define M_2_SQRTPIf16 __f16 (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */ # define M_SQRT2f16 __f16 (1.414213562373095048801688724209698079) /* sqrt(2) */ # define M_SQRT1_2f16 __f16 (0.707106781186547524400844362104849039) /* 1/sqrt(2) */ #endif #if __HAVE_FLOAT32 && defined __USE_GNU # define M_Ef32 __f32 (2.718281828459045235360287471352662498) /* e */ # define M_LOG2Ef32 __f32 (1.442695040888963407359924681001892137) /* log_2 e */ # define M_LOG10Ef32 __f32 (0.434294481903251827651128918916605082) /* log_10 e */ # define M_LN2f32 __f32 (0.693147180559945309417232121458176568) /* log_e 2 */ # define M_LN10f32 __f32 (2.302585092994045684017991454684364208) /* log_e 10 */ # define M_PIf32 __f32 (3.141592653589793238462643383279502884) /* pi */ # define M_PI_2f32 __f32 (1.570796326794896619231321691639751442) /* pi/2 */ # define M_PI_4f32 __f32 (0.785398163397448309615660845819875721) /* pi/4 */ # define M_1_PIf32 __f32 (0.318309886183790671537767526745028724) /* 1/pi */ # define M_2_PIf32 __f32 (0.636619772367581343075535053490057448) /* 2/pi */ # define M_2_SQRTPIf32 __f32 (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */ # define M_SQRT2f32 __f32 (1.414213562373095048801688724209698079) /* sqrt(2) */ # define M_SQRT1_2f32 __f32 (0.707106781186547524400844362104849039) /* 1/sqrt(2) */ #endif #if __HAVE_FLOAT64 && defined __USE_GNU # define M_Ef64 __f64 (2.718281828459045235360287471352662498) /* e */ # define M_LOG2Ef64 __f64 (1.442695040888963407359924681001892137) /* log_2 e */ # define M_LOG10Ef64 __f64 (0.434294481903251827651128918916605082) /* log_10 e */ # define M_LN2f64 __f64 (0.693147180559945309417232121458176568) /* log_e 2 */ # define M_LN10f64 __f64 (2.302585092994045684017991454684364208) /* log_e 10 */ # define M_PIf64 __f64 (3.141592653589793238462643383279502884) /* pi */ # define M_PI_2f64 __f64 (1.570796326794896619231321691639751442) /* pi/2 */ # define M_PI_4f64 __f64 (0.785398163397448309615660845819875721) /* pi/4 */ # define M_1_PIf64 __f64 (0.318309886183790671537767526745028724) /* 1/pi */ # define M_2_PIf64 __f64 (0.636619772367581343075535053490057448) /* 2/pi */ # define M_2_SQRTPIf64 __f64 (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */ # define M_SQRT2f64 __f64 (1.414213562373095048801688724209698079) /* sqrt(2) */ # define M_SQRT1_2f64 __f64 (0.707106781186547524400844362104849039) /* 1/sqrt(2) */ #endif #if __HAVE_FLOAT128 && defined __USE_GNU # define M_Ef128 __f128 (2.718281828459045235360287471352662498) /* e */ # define M_LOG2Ef128 __f128 (1.442695040888963407359924681001892137) /* log_2 e */ # define M_LOG10Ef128 __f128 (0.434294481903251827651128918916605082) /* log_10 e */ # define M_LN2f128 __f128 (0.693147180559945309417232121458176568) /* log_e 2 */ # define M_LN10f128 __f128 (2.302585092994045684017991454684364208) /* log_e 10 */ # define M_PIf128 __f128 (3.141592653589793238462643383279502884) /* pi */ # define M_PI_2f128 __f128 (1.570796326794896619231321691639751442) /* pi/2 */ # define M_PI_4f128 __f128 (0.785398163397448309615660845819875721) /* pi/4 */ # define M_1_PIf128 __f128 (0.318309886183790671537767526745028724) /* 1/pi */ # define M_2_PIf128 __f128 (0.636619772367581343075535053490057448) /* 2/pi */ # define M_2_SQRTPIf128 __f128 (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */ # define M_SQRT2f128 __f128 (1.414213562373095048801688724209698079) /* sqrt(2) */ # define M_SQRT1_2f128 __f128 (0.707106781186547524400844362104849039) /* 1/sqrt(2) */ #endif #if __HAVE_FLOAT32X && defined __USE_GNU # define M_Ef32x __f32x (2.718281828459045235360287471352662498) /* e */ # define M_LOG2Ef32x __f32x (1.442695040888963407359924681001892137) /* log_2 e */ # define M_LOG10Ef32x __f32x (0.434294481903251827651128918916605082) /* log_10 e */ # define M_LN2f32x __f32x (0.693147180559945309417232121458176568) /* log_e 2 */ # define M_LN10f32x __f32x (2.302585092994045684017991454684364208) /* log_e 10 */ # define M_PIf32x __f32x (3.141592653589793238462643383279502884) /* pi */ # define M_PI_2f32x __f32x (1.570796326794896619231321691639751442) /* pi/2 */ # define M_PI_4f32x __f32x (0.785398163397448309615660845819875721) /* pi/4 */ # define M_1_PIf32x __f32x (0.318309886183790671537767526745028724) /* 1/pi */ # define M_2_PIf32x __f32x (0.636619772367581343075535053490057448) /* 2/pi */ # define M_2_SQRTPIf32x __f32x (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */ # define M_SQRT2f32x __f32x (1.414213562373095048801688724209698079) /* sqrt(2) */ # define M_SQRT1_2f32x __f32x (0.707106781186547524400844362104849039) /* 1/sqrt(2) */ #endif #if __HAVE_FLOAT64X && defined __USE_GNU # define M_Ef64x __f64x (2.718281828459045235360287471352662498) /* e */ # define M_LOG2Ef64x __f64x (1.442695040888963407359924681001892137) /* log_2 e */ # define M_LOG10Ef64x __f64x (0.434294481903251827651128918916605082) /* log_10 e */ # define M_LN2f64x __f64x (0.693147180559945309417232121458176568) /* log_e 2 */ # define M_LN10f64x __f64x (2.302585092994045684017991454684364208) /* log_e 10 */ # define M_PIf64x __f64x (3.141592653589793238462643383279502884) /* pi */ # define M_PI_2f64x __f64x (1.570796326794896619231321691639751442) /* pi/2 */ # define M_PI_4f64x __f64x (0.785398163397448309615660845819875721) /* pi/4 */ # define M_1_PIf64x __f64x (0.318309886183790671537767526745028724) /* 1/pi */ # define M_2_PIf64x __f64x (0.636619772367581343075535053490057448) /* 2/pi */ # define M_2_SQRTPIf64x __f64x (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */ # define M_SQRT2f64x __f64x (1.414213562373095048801688724209698079) /* sqrt(2) */ # define M_SQRT1_2f64x __f64x (0.707106781186547524400844362104849039) /* 1/sqrt(2) */ #endif #if __HAVE_FLOAT128X && defined __USE_GNU # error "M_* values needed for _Float128x" #endif /* When compiling in strict ISO C compatible mode we must not use the inline functions since they, among other things, do not set the `errno' variable correctly. */ #if defined __STRICT_ANSI__ && !defined __NO_MATH_INLINES # define __NO_MATH_INLINES 1 #endif #ifdef __USE_ISOC99 # if __GNUC_PREREQ (3, 1) /* ISO C99 defines some macros to compare number while taking care for unordered numbers. Many FPUs provide special instructions to support these operations. Generic support in GCC for these as builtins went in 2.97, but not all cpus added their patterns until 3.1. Therefore we enable the builtins from 3.1 onwards and use a generic implementation othwerwise. */ # define isgreater(x, y) __builtin_isgreater(x, y) # define isgreaterequal(x, y) __builtin_isgreaterequal(x, y) # define isless(x, y) __builtin_isless(x, y) # define islessequal(x, y) __builtin_islessequal(x, y) # define islessgreater(x, y) __builtin_islessgreater(x, y) # define isunordered(x, y) __builtin_isunordered(x, y) # else # define isgreater(x, y) \ (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \ !isunordered (__x, __y) && __x > __y; })) # define isgreaterequal(x, y) \ (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \ !isunordered (__x, __y) && __x >= __y; })) # define isless(x, y) \ (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \ !isunordered (__x, __y) && __x < __y; })) # define islessequal(x, y) \ (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \ !isunordered (__x, __y) && __x <= __y; })) # define islessgreater(x, y) \ (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \ !isunordered (__x, __y) && __x != __y; })) /* isunordered must always check both operands first for signaling NaNs. */ # define isunordered(x, y) \ (__extension__ ({ __typeof__ (x) __u = (x); __typeof__ (y) __v = (y); \ __u != __v && (__u != __u || __v != __v); })) # endif #endif /* Get machine-dependent inline versions (if there are any). */ #ifdef __USE_EXTERN_INLINES # include #endif /* Define special entry points to use when the compiler got told to only expect finite results. */ #if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 /* Include bits/math-finite.h for double. */ # define _Mdouble_ double # define __MATH_DECLARING_DOUBLE 1 # define __MATH_DECLARING_FLOATN 0 # define __REDIRFROM_X(function, reentrant) \ function ## reentrant # define __REDIRTO_X(function, reentrant) \ __ ## function ## reentrant ## _finite # include # undef _Mdouble_ # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN # undef __REDIRFROM_X # undef __REDIRTO_X /* When __USE_ISOC99 is defined, include math-finite for float and long double, as well. */ # ifdef __USE_ISOC99 /* Include bits/math-finite.h for float. */ # define _Mdouble_ float # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 0 # define __REDIRFROM_X(function, reentrant) \ function ## f ## reentrant # define __REDIRTO_X(function, reentrant) \ __ ## function ## f ## reentrant ## _finite # include # undef _Mdouble_ # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN # undef __REDIRFROM_X # undef __REDIRTO_X /* Include bits/math-finite.h for long double. */ # ifdef __MATH_DECLARE_LDOUBLE # define _Mdouble_ long double # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 0 # define __REDIRFROM_X(function, reentrant) \ function ## l ## reentrant # ifdef __NO_LONG_DOUBLE_MATH # define __REDIRTO_X(function, reentrant) \ __ ## function ## reentrant ## _finite # else # define __REDIRTO_X(function, reentrant) \ __ ## function ## l ## reentrant ## _finite # endif # include # undef _Mdouble_ # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN # undef __REDIRFROM_X # undef __REDIRTO_X # endif # endif /* __USE_ISOC99. */ /* Include bits/math-finite.h for _FloatN and _FloatNx. */ # if (__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # define _Mdouble_ _Float16 # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # define __REDIRFROM_X(function, reentrant) \ function ## f16 ## reentrant # if __HAVE_DISTINCT_FLOAT16 # define __REDIRTO_X(function, reentrant) \ __ ## function ## f16 ## reentrant ## _finite # else # error "non-disinct _Float16" # endif # include # undef _Mdouble_ # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN # undef __REDIRFROM_X # undef __REDIRTO_X # endif # if (__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # define _Mdouble_ _Float32 # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # define __REDIRFROM_X(function, reentrant) \ function ## f32 ## reentrant # if __HAVE_DISTINCT_FLOAT32 # define __REDIRTO_X(function, reentrant) \ __ ## function ## f32 ## reentrant ## _finite # else # define __REDIRTO_X(function, reentrant) \ __ ## function ## f ## reentrant ## _finite # endif # include # undef _Mdouble_ # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN # undef __REDIRFROM_X # undef __REDIRTO_X # endif # if (__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # define _Mdouble_ _Float64 # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # define __REDIRFROM_X(function, reentrant) \ function ## f64 ## reentrant # if __HAVE_DISTINCT_FLOAT64 # define __REDIRTO_X(function, reentrant) \ __ ## function ## f64 ## reentrant ## _finite # else # define __REDIRTO_X(function, reentrant) \ __ ## function ## reentrant ## _finite # endif # include # undef _Mdouble_ # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN # undef __REDIRFROM_X # undef __REDIRTO_X # endif # if (__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # define _Mdouble_ _Float128 # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # define __REDIRFROM_X(function, reentrant) \ function ## f128 ## reentrant # if __HAVE_DISTINCT_FLOAT128 # define __REDIRTO_X(function, reentrant) \ __ ## function ## f128 ## reentrant ## _finite # else # define __REDIRTO_X(function, reentrant) \ __ ## function ## l ## reentrant ## _finite # endif # include # undef _Mdouble_ # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN # undef __REDIRFROM_X # undef __REDIRTO_X # endif # if (__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # define _Mdouble_ _Float32x # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # define __REDIRFROM_X(function, reentrant) \ function ## f32x ## reentrant # if __HAVE_DISTINCT_FLOAT32X # define __REDIRTO_X(function, reentrant) \ __ ## function ## f32x ## reentrant ## _finite # else # define __REDIRTO_X(function, reentrant) \ __ ## function ## reentrant ## _finite # endif # include # undef _Mdouble_ # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN # undef __REDIRFROM_X # undef __REDIRTO_X # endif # if (__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # define _Mdouble_ _Float64x # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # define __REDIRFROM_X(function, reentrant) \ function ## f64x ## reentrant # if __HAVE_DISTINCT_FLOAT64X # define __REDIRTO_X(function, reentrant) \ __ ## function ## f64x ## reentrant ## _finite # elif __HAVE_FLOAT64X_LONG_DOUBLE # define __REDIRTO_X(function, reentrant) \ __ ## function ## l ## reentrant ## _finite # else # define __REDIRTO_X(function, reentrant) \ __ ## function ## f128 ## reentrant ## _finite # endif # include # undef _Mdouble_ # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN # undef __REDIRFROM_X # undef __REDIRTO_X # endif # if (__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # define _Mdouble_ _Float128x # define __MATH_DECLARING_DOUBLE 0 # define __MATH_DECLARING_FLOATN 1 # define __REDIRFROM_X(function, reentrant) \ function ## f128x ## reentrant # if __HAVE_DISTINCT_FLOAT128X # define __REDIRTO_X(function, reentrant) \ __ ## function ## f128x ## reentrant ## _finite # else # error "non-disinct _Float128x" # endif # include # undef _Mdouble_ # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN # undef __REDIRFROM_X # undef __REDIRTO_X # endif #endif /* __FINITE_MATH_ONLY__ > 0. */ #if __GLIBC_USE (IEC_60559_BFP_EXT) /* An expression whose type has the widest of the evaluation formats of X and Y (which are of floating-point types). */ # if __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ > 64 # define __MATH_EVAL_FMT2(x, y) ((x) + (y) + 0.0L) # elif __FLT_EVAL_METHOD__ == 1 || __FLT_EVAL_METHOD__ > 32 # define __MATH_EVAL_FMT2(x, y) ((x) + (y) + 0.0) # elif __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 32 # define __MATH_EVAL_FMT2(x, y) ((x) + (y) + 0.0f) # else # define __MATH_EVAL_FMT2(x, y) ((x) + (y)) # endif /* Return X == Y but raising "invalid" and setting errno if X or Y is a NaN. */ # if !defined __cplusplus || (__cplusplus < 201103L && !defined __GNUC__) # define iseqsig(x, y) \ __MATH_TG (__MATH_EVAL_FMT2 (x, y), __iseqsig, ((x), (y))) # else /* In C++ mode, __MATH_TG cannot be used, because it relies on __builtin_types_compatible_p, which is a C-only builtin. Moreover, the comparison macros from ISO C take two floating-point arguments, which need not have the same type. Choosing what underlying function to call requires evaluating the formats of the arguments, then selecting which is wider. The macro __MATH_EVAL_FMT2 provides this information, however, only the type of the macro expansion is relevant (actually evaluating the expression would be incorrect). Thus, the type is used as a template parameter for __iseqsig_type, which calls the appropriate underlying function. */ extern "C++" { template < typename > struct __iseqsig_type; template <> struct __iseqsig_type { static int __call(float __x, float __y) throw() { return __iseqsigf(__x, __y); }}; template <> struct __iseqsig_type { static int __call(double __x, double __y) throw() { return __iseqsig(__x, __y); }}; template <> struct __iseqsig_type { static int __call(double __x, double __y) throw() { # ifndef __NO_LONG_DOUBLE_MATH return __iseqsigl(__x, __y); # else return __iseqsig(__x, __y); # endif }}; # if __HAVE_DISTINCT_FLOAT128 template <> struct __iseqsig_type <_Float128 > { static int __call(_Float128 __x, _Float128 __y) throw() { return __iseqsigf128(__x, __y); }}; # endif template < typename _T1, typename _T2 > inline int iseqsig(_T1 __x, _T2 __y) throw() { # if __cplusplus >= 201103L typedef decltype(__MATH_EVAL_FMT2(__x, __y)) _T3; # else typedef __typeof(__MATH_EVAL_FMT2(__x, __y)) _T3; # endif return __iseqsig_type < _T3 >::__call(__x, __y); } } /* extern "C++" */ # endif /* __cplusplus */ #endif __END_DECLS #endif /* math.h */ ================================================ FILE: v2/headers/linux_386/usr/include/memory.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * SVID */ #ifndef _MEMORY_H #define _MEMORY_H 1 #include #ifndef _STRING_H # include #endif /* string.h */ #endif /* memory.h */ ================================================ FILE: v2/headers/linux_386/usr/include/netdb.h ================================================ /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* All data returned by the network data base library are supplied in host order and returned in network order (suitable for use in system calls). */ #ifndef _NETDB_H #define _NETDB_H 1 #include #include #include #ifdef __USE_MISC /* This is necessary to make this include file properly replace the Sun version. */ # include #endif #ifdef __USE_GNU # include # include #endif #include /* Absolute file name for network data base files. */ #define _PATH_HEQUIV "/etc/hosts.equiv" #define _PATH_HOSTS "/etc/hosts" #define _PATH_NETWORKS "/etc/networks" #define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf" #define _PATH_PROTOCOLS "/etc/protocols" #define _PATH_SERVICES "/etc/services" __BEGIN_DECLS #if defined __USE_MISC || !defined __USE_XOPEN2K8 /* Error status for non-reentrant lookup functions. We use a macro to access always the thread-specific `h_errno' variable. */ # define h_errno (*__h_errno_location ()) /* Function to get address of global `h_errno' variable. */ extern int *__h_errno_location(void) __THROW __attribute__ ((__const__)); /* Possible values left in `h_errno'. */ # define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found. */ # define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL. */ # define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP. */ # define NO_DATA 4 /* Valid name, no data record of requested type. */ #endif #ifdef __USE_MISC # define NETDB_INTERNAL -1 /* See errno. */ # define NETDB_SUCCESS 0 /* No problem. */ # define NO_ADDRESS NO_DATA /* No address, look for MX record. */ #endif #if defined __USE_XOPEN2K || defined __USE_XOPEN_EXTENDED /* Highest reserved Internet port number. */ # define IPPORT_RESERVED 1024 #endif #ifdef __USE_GNU /* Scope delimiter for getaddrinfo(), getnameinfo(). */ # define SCOPE_DELIMITER '%' #endif #ifdef __USE_MISC /* Print error indicated by `h_errno' variable on standard error. STR if non-null is printed before the error string. */ extern void herror(const char *__str) __THROW; /* Return string associated with error ERR_NUM. */ extern const char *hstrerror(int __err_num) __THROW; #endif /* Description of data base entry for a single host. */ struct hostent { char *h_name; /* Official name of host. */ char **h_aliases; /* Alias list. */ int h_addrtype; /* Host address type. */ int h_length; /* Length of address. */ char **h_addr_list; /* List of addresses from name server. */ #ifdef __USE_MISC # define h_addr h_addr_list[0] /* Address, for backward compatibility. */ #endif }; /* Open host data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void sethostent(int __stay_open); /* Close host data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endhostent(void); /* Get next entry from host data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostent(void); /* Return entry from host data base which address match ADDR with length LEN and type TYPE. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostbyaddr(const void *__addr, __socklen_t __len, int __type); /* Return entry from host data base for host with NAME. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostbyname(const char *__name); #ifdef __USE_MISC /* Return entry from host data base for host with NAME. AF must be set to the address type which is `AF_INET' for IPv4 or `AF_INET6' for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostbyname2(const char *__name, int __af); /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. The last argument is a pointer to a variable which gets the value which would be stored in the global variable `herrno' by the non-reentrant functions. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int gethostent_r(struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); extern int gethostbyaddr_r(const void *__restrict __addr, __socklen_t __len, int __type, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); extern int gethostbyname_r(const char *__restrict __name, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); extern int gethostbyname2_r(const char *__restrict __name, int __af, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); #endif /* misc */ /* Open network data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setnetent(int __stay_open); /* Close network data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endnetent(void); /* Get next entry from network data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct netent *getnetent(void); /* Return entry from network data base which address match NET and type TYPE. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct netent *getnetbyaddr(uint32_t __net, int __type); /* Return entry from network data base for network with NAME. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct netent *getnetbyname(const char *__name); #ifdef __USE_MISC /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. The last argument is a pointer to a variable which gets the value which would be stored in the global variable `herrno' by the non-reentrant functions. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int getnetent_r(struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); extern int getnetbyaddr_r(uint32_t __net, int __type, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); extern int getnetbyname_r(const char *__restrict __name, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); #endif /* misc */ /* Description of data base entry for a single service. */ struct servent { char *s_name; /* Official service name. */ char **s_aliases; /* Alias list. */ int s_port; /* Port number. */ char *s_proto; /* Protocol to use. */ }; /* Open service data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setservent(int __stay_open); /* Close service data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endservent(void); /* Get next entry from service data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct servent *getservent(void); /* Return entry from network data base for network with NAME and protocol PROTO. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct servent *getservbyname(const char *__name, const char *__proto); /* Return entry from service data base which matches port PORT and protocol PROTO. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct servent *getservbyport(int __port, const char *__proto); #ifdef __USE_MISC /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int getservent_r(struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); extern int getservbyname_r(const char *__restrict __name, const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); extern int getservbyport_r(int __port, const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); #endif /* misc */ /* Description of data base entry for a single service. */ struct protoent { char *p_name; /* Official protocol name. */ char **p_aliases; /* Alias list. */ int p_proto; /* Protocol number. */ }; /* Open protocol data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setprotoent(int __stay_open); /* Close protocol data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endprotoent(void); /* Get next entry from protocol data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct protoent *getprotoent(void); /* Return entry from protocol data base for network with NAME. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct protoent *getprotobyname(const char *__name); /* Return entry from protocol data base which number is PROTO. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct protoent *getprotobynumber(int __proto); #ifdef __USE_MISC /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int getprotoent_r(struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); extern int getprotobyname_r(const char *__restrict __name, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); extern int getprotobynumber_r(int __proto, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); /* Establish network group NETGROUP for enumeration. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int setnetgrent(const char *__netgroup); /* Free all space allocated by previous `setnetgrent' call. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern void endnetgrent(void); /* Get next member of netgroup established by last `setnetgrent' call and return pointers to elements in HOSTP, USERP, and DOMAINP. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getnetgrent(char **__restrict __hostp, char **__restrict __userp, char **__restrict __domainp); /* Test whether NETGROUP contains the triple (HOST,USER,DOMAIN). This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int innetgr(const char *__netgroup, const char *__host, const char *__user, const char *__domain); /* Reentrant version of `getnetgrent' where result is placed in BUFFER. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getnetgrent_r(char **__restrict __hostp, char **__restrict __userp, char **__restrict __domainp, char *__restrict __buffer, size_t __buflen); #endif /* misc */ #ifdef __USE_MISC /* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD. The local user is LOCUSER, on the remote machine the command is executed as REMUSER. In *FD2P the descriptor to the socket for the connection is returned. The caller must have the right to use a reserved port. When the function returns *AHOST contains the official host name. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rcmd(char **__restrict __ahost, unsigned short int __rport, const char *__restrict __locuser, const char *__restrict __remuser, const char *__restrict __cmd, int *__restrict __fd2p); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rcmd_af(char **__restrict __ahost, unsigned short int __rport, const char *__restrict __locuser, const char *__restrict __remuser, const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af); /* Call `rexecd' at port RPORT on remote machine *AHOST to execute CMD. The process runs at the remote machine using the ID of user NAME whose cleartext password is PASSWD. In *FD2P the descriptor to the socket for the connection is returned. When the function returns *AHOST contains the official host name. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rexec(char **__restrict __ahost, int __rport, const char *__restrict __name, const char *__restrict __pass, const char *__restrict __cmd, int *__restrict __fd2p); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rexec_af(char **__restrict __ahost, int __rport, const char *__restrict __name, const char *__restrict __pass, const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af); /* Check whether user REMUSER on system RHOST is allowed to login as LOCUSER. If SUSER is not zero the user tries to become superuser. Return 0 if it is possible. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int ruserok(const char *__rhost, int __suser, const char *__remuser, const char *__locuser); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int ruserok_af(const char *__rhost, int __suser, const char *__remuser, const char *__locuser, sa_family_t __af); /* Check whether user REMUSER on system indicated by IPv4 address RADDR is allowed to login as LOCUSER. Non-IPv4 (e.g., IPv6) are not supported. If SUSER is not zero the user tries to become superuser. Return 0 if it is possible. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int iruserok(uint32_t __raddr, int __suser, const char *__remuser, const char *__locuser); /* This is the equivalent function where the pfamiliy if the address pointed to by RADDR is determined by the value of AF. It therefore can be used for IPv6 This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int iruserok_af(const void *__raddr, int __suser, const char *__remuser, const char *__locuser, sa_family_t __af); /* Try to allocate reserved port, returning a descriptor for a socket opened at this port or -1 if unsuccessful. The search for an available port will start at ALPORT and continues with lower numbers. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rresvport(int *__alport); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rresvport_af(int *__alport, sa_family_t __af); #endif /* Extension from POSIX.1:2001. */ #ifdef __USE_XOPEN2K /* Structure to contain information about address of a service provider. */ struct addrinfo { int ai_flags; /* Input flags. */ int ai_family; /* Protocol family for socket. */ int ai_socktype; /* Socket type. */ int ai_protocol; /* Protocol for socket. */ socklen_t ai_addrlen; /* Length of socket address. */ struct sockaddr *ai_addr; /* Socket address for socket. */ char *ai_canonname; /* Canonical name for service location. */ struct addrinfo *ai_next; /* Pointer to next in list. */ }; # ifdef __USE_GNU /* Structure used as control block for asynchronous lookup. */ struct gaicb { const char *ar_name; /* Name to look up. */ const char *ar_service; /* Service name. */ const struct addrinfo *ar_request; /* Additional request specification. */ struct addrinfo *ar_result; /* Pointer to result. */ /* The following are internal elements. */ int __return; int __glibc_reserved[5]; }; /* Lookup mode. */ # define GAI_WAIT 0 # define GAI_NOWAIT 1 # endif /* Possible values for `ai_flags' field in `addrinfo' structure. */ # define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */ # define AI_CANONNAME 0x0002 /* Request for canonical name. */ # define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */ # define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */ # define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */ # define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose returned address type.. */ # ifdef __USE_GNU # define AI_IDN 0x0040 /* IDN encode input (assuming it is encoded in the current locale's character set) before looking it up. */ # define AI_CANONIDN 0x0080 /* Translate canonical name from IDN format. */ # define AI_IDN_ALLOW_UNASSIGNED 0x0100 /* Don't reject unassigned Unicode code points. */ # define AI_IDN_USE_STD3_ASCII_RULES 0x0200 /* Validate strings according to STD3 rules. */ # endif # define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */ /* Error values for `getaddrinfo' function. */ # define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */ # define EAI_NONAME -2 /* NAME or SERVICE is unknown. */ # define EAI_AGAIN -3 /* Temporary failure in name resolution. */ # define EAI_FAIL -4 /* Non-recoverable failure in name res. */ # define EAI_FAMILY -6 /* `ai_family' not supported. */ # define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */ # define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */ # define EAI_MEMORY -10 /* Memory allocation failure. */ # define EAI_SYSTEM -11 /* System error returned in `errno'. */ # define EAI_OVERFLOW -12 /* Argument buffer overflow. */ # ifdef __USE_GNU # define EAI_NODATA -5 /* No address associated with NAME. */ # define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */ # define EAI_INPROGRESS -100 /* Processing request in progress. */ # define EAI_CANCELED -101 /* Request canceled. */ # define EAI_NOTCANCELED -102 /* Request not canceled. */ # define EAI_ALLDONE -103 /* All requests done. */ # define EAI_INTR -104 /* Interrupted by a signal. */ # define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ # endif # ifdef __USE_MISC # define NI_MAXHOST 1025 # define NI_MAXSERV 32 # endif # define NI_NUMERICHOST 1 /* Don't try to look up hostname. */ # define NI_NUMERICSERV 2 /* Don't convert port number to name. */ # define NI_NOFQDN 4 /* Only return nodename portion. */ # define NI_NAMEREQD 8 /* Don't return numeric addresses. */ # define NI_DGRAM 16 /* Look up UDP service rather than TCP. */ # ifdef __USE_GNU # define NI_IDN 32 /* Convert name from IDN format. */ # define NI_IDN_ALLOW_UNASSIGNED 64 /* Don't reject unassigned Unicode code points. */ # define NI_IDN_USE_STD3_ASCII_RULES 128 /* Validate strings according to STD3 rules. */ # endif /* Translate name of a service location and/or a service name to set of socket addresses. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getaddrinfo(const char *__restrict __name, const char *__restrict __service, const struct addrinfo *__restrict __req, struct addrinfo **__restrict __pai); /* Free `addrinfo' structure AI including associated storage. */ extern void freeaddrinfo(struct addrinfo *__ai) __THROW; /* Convert error return from getaddrinfo() to a string. */ extern const char *gai_strerror(int __ecode) __THROW; /* Translate a socket address to a location and service name. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getnameinfo(const struct sockaddr *__restrict __sa, socklen_t __salen, char *__restrict __host, socklen_t __hostlen, char *__restrict __serv, socklen_t __servlen, int __flags); #endif /* POSIX */ #ifdef __USE_GNU /* Enqueue ENT requests from the LIST. If MODE is GAI_WAIT wait until all requests are handled. If WAIT is GAI_NOWAIT return immediately after queueing the requests and signal completion according to SIG. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getaddrinfo_a(int __mode, struct gaicb *__list[__restrict_arr], int __ent, struct sigevent *__restrict __sig); /* Suspend execution of the thread until at least one of the ENT requests in LIST is handled. If TIMEOUT is not a null pointer it specifies the longest time the function keeps waiting before returning with an error. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int gai_suspend(const struct gaicb *const __list[], int __ent, const struct timespec *__timeout); /* Get the error status of the request REQ. */ extern int gai_error(struct gaicb *__req) __THROW; /* Cancel the requests associated with GAICBP. */ extern int gai_cancel(struct gaicb *__gaicbp) __THROW; #endif /* GNU */ __END_DECLS #endif /* netdb.h */ ================================================ FILE: v2/headers/linux_386/usr/include/netinet/in.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _NETINET_IN_H #define _NETINET_IN_H 1 #include #include #include #include __BEGIN_DECLS /* Internet address. */ typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr; }; /* Get system-specific definitions. */ #include /* Standard well-defined IP protocols. */ enum { IPPROTO_IP = 0, /* Dummy protocol for TCP. */ #define IPPROTO_IP IPPROTO_IP IPPROTO_ICMP = 1, /* Internet Control Message Protocol. */ #define IPPROTO_ICMP IPPROTO_ICMP IPPROTO_IGMP = 2, /* Internet Group Management Protocol. */ #define IPPROTO_IGMP IPPROTO_IGMP IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94). */ #define IPPROTO_IPIP IPPROTO_IPIP IPPROTO_TCP = 6, /* Transmission Control Protocol. */ #define IPPROTO_TCP IPPROTO_TCP IPPROTO_EGP = 8, /* Exterior Gateway Protocol. */ #define IPPROTO_EGP IPPROTO_EGP IPPROTO_PUP = 12, /* PUP protocol. */ #define IPPROTO_PUP IPPROTO_PUP IPPROTO_UDP = 17, /* User Datagram Protocol. */ #define IPPROTO_UDP IPPROTO_UDP IPPROTO_IDP = 22, /* XNS IDP protocol. */ #define IPPROTO_IDP IPPROTO_IDP IPPROTO_TP = 29, /* SO Transport Protocol Class 4. */ #define IPPROTO_TP IPPROTO_TP IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol. */ #define IPPROTO_DCCP IPPROTO_DCCP IPPROTO_IPV6 = 41, /* IPv6 header. */ #define IPPROTO_IPV6 IPPROTO_IPV6 IPPROTO_RSVP = 46, /* Reservation Protocol. */ #define IPPROTO_RSVP IPPROTO_RSVP IPPROTO_GRE = 47, /* General Routing Encapsulation. */ #define IPPROTO_GRE IPPROTO_GRE IPPROTO_ESP = 50, /* encapsulating security payload. */ #define IPPROTO_ESP IPPROTO_ESP IPPROTO_AH = 51, /* authentication header. */ #define IPPROTO_AH IPPROTO_AH IPPROTO_MTP = 92, /* Multicast Transport Protocol. */ #define IPPROTO_MTP IPPROTO_MTP IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET. */ #define IPPROTO_BEETPH IPPROTO_BEETPH IPPROTO_ENCAP = 98, /* Encapsulation Header. */ #define IPPROTO_ENCAP IPPROTO_ENCAP IPPROTO_PIM = 103, /* Protocol Independent Multicast. */ #define IPPROTO_PIM IPPROTO_PIM IPPROTO_COMP = 108, /* Compression Header Protocol. */ #define IPPROTO_COMP IPPROTO_COMP IPPROTO_SCTP = 132, /* Stream Control Transmission Protocol. */ #define IPPROTO_SCTP IPPROTO_SCTP IPPROTO_UDPLITE = 136, /* UDP-Lite protocol. */ #define IPPROTO_UDPLITE IPPROTO_UDPLITE IPPROTO_MPLS = 137, /* MPLS in IP. */ #define IPPROTO_MPLS IPPROTO_MPLS IPPROTO_RAW = 255, /* Raw IP packets. */ #define IPPROTO_RAW IPPROTO_RAW IPPROTO_MAX }; /* If __USE_KERNEL_IPV6_DEFS is 1 then the user has included the kernel network headers first and we should use those ABI-identical definitions instead of our own, otherwise 0. */ #if !__USE_KERNEL_IPV6_DEFS enum { IPPROTO_HOPOPTS = 0, /* IPv6 Hop-by-Hop options. */ #define IPPROTO_HOPOPTS IPPROTO_HOPOPTS IPPROTO_ROUTING = 43, /* IPv6 routing header. */ #define IPPROTO_ROUTING IPPROTO_ROUTING IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header. */ #define IPPROTO_FRAGMENT IPPROTO_FRAGMENT IPPROTO_ICMPV6 = 58, /* ICMPv6. */ #define IPPROTO_ICMPV6 IPPROTO_ICMPV6 IPPROTO_NONE = 59, /* IPv6 no next header. */ #define IPPROTO_NONE IPPROTO_NONE IPPROTO_DSTOPTS = 60, /* IPv6 destination options. */ #define IPPROTO_DSTOPTS IPPROTO_DSTOPTS IPPROTO_MH = 135 /* IPv6 mobility header. */ #define IPPROTO_MH IPPROTO_MH }; #endif /* !__USE_KERNEL_IPV6_DEFS */ /* Type to represent a port. */ typedef uint16_t in_port_t; /* Standard well-known ports. */ enum { IPPORT_ECHO = 7, /* Echo service. */ IPPORT_DISCARD = 9, /* Discard transmissions service. */ IPPORT_SYSTAT = 11, /* System status service. */ IPPORT_DAYTIME = 13, /* Time of day service. */ IPPORT_NETSTAT = 15, /* Network status service. */ IPPORT_FTP = 21, /* File Transfer Protocol. */ IPPORT_TELNET = 23, /* Telnet protocol. */ IPPORT_SMTP = 25, /* Simple Mail Transfer Protocol. */ IPPORT_TIMESERVER = 37, /* Timeserver service. */ IPPORT_NAMESERVER = 42, /* Domain Name Service. */ IPPORT_WHOIS = 43, /* Internet Whois service. */ IPPORT_MTP = 57, IPPORT_TFTP = 69, /* Trivial File Transfer Protocol. */ IPPORT_RJE = 77, IPPORT_FINGER = 79, /* Finger service. */ IPPORT_TTYLINK = 87, IPPORT_SUPDUP = 95, /* SUPDUP protocol. */ IPPORT_EXECSERVER = 512, /* execd service. */ IPPORT_LOGINSERVER = 513, /* rlogind service. */ IPPORT_CMDSERVER = 514, IPPORT_EFSSERVER = 520, /* UDP ports. */ IPPORT_BIFFUDP = 512, IPPORT_WHOSERVER = 513, IPPORT_ROUTESERVER = 520, /* Ports less than this value are reserved for privileged processes. */ IPPORT_RESERVED = 1024, /* Ports greater this value are reserved for (non-privileged) servers. */ IPPORT_USERRESERVED = 5000 }; /* Definitions of the bits in an Internet address integer. On subnets, host and network parts are found according to the subnet mask, not these masks. */ #define IN_CLASSA(a) ((((in_addr_t)(a)) & 0x80000000) == 0) #define IN_CLASSA_NET 0xff000000 #define IN_CLASSA_NSHIFT 24 #define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET) #define IN_CLASSA_MAX 128 #define IN_CLASSB(a) ((((in_addr_t)(a)) & 0xc0000000) == 0x80000000) #define IN_CLASSB_NET 0xffff0000 #define IN_CLASSB_NSHIFT 16 #define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET) #define IN_CLASSB_MAX 65536 #define IN_CLASSC(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000) #define IN_CLASSC_NET 0xffffff00 #define IN_CLASSC_NSHIFT 8 #define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET) #define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000) #define IN_MULTICAST(a) IN_CLASSD(a) #define IN_EXPERIMENTAL(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000) #define IN_BADCLASS(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000) /* Address to accept any incoming messages. */ #define INADDR_ANY ((in_addr_t) 0x00000000) /* Address to send to all hosts. */ #define INADDR_BROADCAST ((in_addr_t) 0xffffffff) /* Address indicating an error return. */ #define INADDR_NONE ((in_addr_t) 0xffffffff) /* Network number for local host loopback. */ #define IN_LOOPBACKNET 127 /* Address to loopback in software to local host. */ #ifndef INADDR_LOOPBACK # define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) /* Inet 127.0.0.1. */ #endif /* Defines for Multicast INADDR. */ #define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) /* 224.0.0.0 */ #define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001) /* 224.0.0.1 */ #define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002) /* 224.0.0.2 */ #define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */ #if !__USE_KERNEL_IPV6_DEFS /* IPv6 address */ struct in6_addr { union { uint8_t __u6_addr8[16]; uint16_t __u6_addr16[8]; uint32_t __u6_addr32[4]; } __in6_u; #define s6_addr __in6_u.__u6_addr8 #ifdef __USE_MISC # define s6_addr16 __in6_u.__u6_addr16 # define s6_addr32 __in6_u.__u6_addr32 #endif }; #endif /* !__USE_KERNEL_IPV6_DEFS */ extern const struct in6_addr in6addr_any; /* :: */ extern const struct in6_addr in6addr_loopback; /* ::1 */ #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } #define INET_ADDRSTRLEN 16 #define INET6_ADDRSTRLEN 46 /* Structure describing an Internet socket address. */ struct sockaddr_in { __SOCKADDR_COMMON(sin_); in_port_t sin_port; /* Port number. */ struct in_addr sin_addr; /* Internet address. */ /* Pad to size of `struct sockaddr'. */ unsigned char sin_zero[sizeof(struct sockaddr) - __SOCKADDR_COMMON_SIZE - sizeof(in_port_t) - sizeof(struct in_addr)]; }; #if !__USE_KERNEL_IPV6_DEFS /* Ditto, for IPv6. */ struct sockaddr_in6 { __SOCKADDR_COMMON(sin6_); in_port_t sin6_port; /* Transport layer port # */ uint32_t sin6_flowinfo; /* IPv6 flow information */ struct in6_addr sin6_addr; /* IPv6 address */ uint32_t sin6_scope_id; /* IPv6 scope-id */ }; #endif /* !__USE_KERNEL_IPV6_DEFS */ #ifdef __USE_MISC /* IPv4 multicast request. */ struct ip_mreq { /* IP multicast address of group. */ struct in_addr imr_multiaddr; /* Local IP address of interface. */ struct in_addr imr_interface; }; struct ip_mreq_source { /* IP multicast address of group. */ struct in_addr imr_multiaddr; /* IP address of interface. */ struct in_addr imr_interface; /* IP address of source. */ struct in_addr imr_sourceaddr; }; #endif #if !__USE_KERNEL_IPV6_DEFS /* Likewise, for IPv6. */ struct ipv6_mreq { /* IPv6 multicast address of group */ struct in6_addr ipv6mr_multiaddr; /* local interface */ unsigned int ipv6mr_interface; }; #endif /* !__USE_KERNEL_IPV6_DEFS */ #ifdef __USE_MISC /* Multicast group request. */ struct group_req { /* Interface index. */ uint32_t gr_interface; /* Group address. */ struct sockaddr_storage gr_group; }; struct group_source_req { /* Interface index. */ uint32_t gsr_interface; /* Group address. */ struct sockaddr_storage gsr_group; /* Source address. */ struct sockaddr_storage gsr_source; }; /* Full-state filter operations. */ struct ip_msfilter { /* IP multicast address of group. */ struct in_addr imsf_multiaddr; /* Local IP address of interface. */ struct in_addr imsf_interface; /* Filter mode. */ uint32_t imsf_fmode; /* Number of source addresses. */ uint32_t imsf_numsrc; /* Source addresses. */ struct in_addr imsf_slist[1]; }; #define IP_MSFILTER_SIZE(numsrc) (sizeof (struct ip_msfilter) \ - sizeof (struct in_addr) \ + (numsrc) * sizeof (struct in_addr)) struct group_filter { /* Interface index. */ uint32_t gf_interface; /* Group address. */ struct sockaddr_storage gf_group; /* Filter mode. */ uint32_t gf_fmode; /* Number of source addresses. */ uint32_t gf_numsrc; /* Source addresses. */ struct sockaddr_storage gf_slist[1]; }; #define GROUP_FILTER_SIZE(numsrc) (sizeof (struct group_filter) \ - sizeof (struct sockaddr_storage) \ + ((numsrc) \ * sizeof (struct sockaddr_storage))) #endif /* Functions to convert between host and network byte order. Please note that these functions normally take `unsigned long int' or `unsigned short int' values as arguments and also return them. But this was a short-sighted decision since on different systems the types may have different representations but the values are always the same. */ extern uint32_t ntohl(uint32_t __netlong) __THROW __attribute__ ((__const__)); extern uint16_t ntohs(uint16_t __netshort) __THROW __attribute__ ((__const__)); extern uint32_t htonl(uint32_t __hostlong) __THROW __attribute__ ((__const__)); extern uint16_t htons(uint16_t __hostshort) __THROW __attribute__ ((__const__)); #include /* Get machine dependent optimized versions of byte swapping functions. */ #include #include #ifdef __OPTIMIZE__ /* We can optimize calls to the conversion functions. Either nothing has to be done or we are using directly the byte-swapping functions which often can be inlined. */ # if __BYTE_ORDER == __BIG_ENDIAN /* The host byte order is the same as network byte order, so these functions are all just identity. */ # define ntohl(x) __uint32_identity (x) # define ntohs(x) __uint16_identity (x) # define htonl(x) __uint32_identity (x) # define htons(x) __uint16_identity (x) # else # if __BYTE_ORDER == __LITTLE_ENDIAN # define ntohl(x) __bswap_32 (x) # define ntohs(x) __bswap_16 (x) # define htonl(x) __bswap_32 (x) # define htons(x) __bswap_16 (x) # endif # endif #endif #ifdef __GNUC__ # define IN6_IS_ADDR_UNSPECIFIED(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ __a->__in6_u.__u6_addr32[0] == 0 \ && __a->__in6_u.__u6_addr32[1] == 0 \ && __a->__in6_u.__u6_addr32[2] == 0 \ && __a->__in6_u.__u6_addr32[3] == 0; })) # define IN6_IS_ADDR_LOOPBACK(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ __a->__in6_u.__u6_addr32[0] == 0 \ && __a->__in6_u.__u6_addr32[1] == 0 \ && __a->__in6_u.__u6_addr32[2] == 0 \ && __a->__in6_u.__u6_addr32[3] == htonl (1); })) # define IN6_IS_ADDR_LINKLOCAL(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ (__a->__in6_u.__u6_addr32[0] & htonl (0xffc00000)) == htonl (0xfe800000); })) # define IN6_IS_ADDR_SITELOCAL(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ (__a->__in6_u.__u6_addr32[0] & htonl (0xffc00000)) == htonl (0xfec00000); })) # define IN6_IS_ADDR_V4MAPPED(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ __a->__in6_u.__u6_addr32[0] == 0 \ && __a->__in6_u.__u6_addr32[1] == 0 \ && __a->__in6_u.__u6_addr32[2] == htonl (0xffff); })) # define IN6_IS_ADDR_V4COMPAT(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ __a->__in6_u.__u6_addr32[0] == 0 \ && __a->__in6_u.__u6_addr32[1] == 0 \ && __a->__in6_u.__u6_addr32[2] == 0 \ && ntohl (__a->__in6_u.__u6_addr32[3]) > 1; })) # define IN6_ARE_ADDR_EQUAL(a,b) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ const struct in6_addr *__b = (const struct in6_addr *) (b); \ __a->__in6_u.__u6_addr32[0] == __b->__in6_u.__u6_addr32[0] \ && __a->__in6_u.__u6_addr32[1] == __b->__in6_u.__u6_addr32[1] \ && __a->__in6_u.__u6_addr32[2] == __b->__in6_u.__u6_addr32[2] \ && __a->__in6_u.__u6_addr32[3] == __b->__in6_u.__u6_addr32[3]; })) #else # define IN6_IS_ADDR_UNSPECIFIED(a) \ (((const uint32_t *) (a))[0] == 0 \ && ((const uint32_t *) (a))[1] == 0 \ && ((const uint32_t *) (a))[2] == 0 \ && ((const uint32_t *) (a))[3] == 0) # define IN6_IS_ADDR_LOOPBACK(a) \ (((const uint32_t *) (a))[0] == 0 \ && ((const uint32_t *) (a))[1] == 0 \ && ((const uint32_t *) (a))[2] == 0 \ && ((const uint32_t *) (a))[3] == htonl (1)) # define IN6_IS_ADDR_LINKLOCAL(a) \ ((((const uint32_t *) (a))[0] & htonl (0xffc00000)) \ == htonl (0xfe800000)) # define IN6_IS_ADDR_SITELOCAL(a) \ ((((const uint32_t *) (a))[0] & htonl (0xffc00000)) \ == htonl (0xfec00000)) # define IN6_IS_ADDR_V4MAPPED(a) \ ((((const uint32_t *) (a))[0] == 0) \ && (((const uint32_t *) (a))[1] == 0) \ && (((const uint32_t *) (a))[2] == htonl (0xffff))) # define IN6_IS_ADDR_V4COMPAT(a) \ ((((const uint32_t *) (a))[0] == 0) \ && (((const uint32_t *) (a))[1] == 0) \ && (((const uint32_t *) (a))[2] == 0) \ && (ntohl (((const uint32_t *) (a))[3]) > 1)) # define IN6_ARE_ADDR_EQUAL(a,b) \ ((((const uint32_t *) (a))[0] == ((const uint32_t *) (b))[0]) \ && (((const uint32_t *) (a))[1] == ((const uint32_t *) (b))[1]) \ && (((const uint32_t *) (a))[2] == ((const uint32_t *) (b))[2]) \ && (((const uint32_t *) (a))[3] == ((const uint32_t *) (b))[3])) #endif #define IN6_IS_ADDR_MULTICAST(a) (((const uint8_t *) (a))[0] == 0xff) #ifdef __USE_MISC /* Bind socket to a privileged IP port. */ extern int bindresvport(int __sockfd, struct sockaddr_in *__sock_in) __THROW; /* The IPv6 version of this function. */ extern int bindresvport6(int __sockfd, struct sockaddr_in6 *__sock_in) __THROW; #endif #define IN6_IS_ADDR_MC_NODELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0x1)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0x2)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0x5)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0x8)) #define IN6_IS_ADDR_MC_GLOBAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0xe)) #ifdef __USE_GNU struct cmsghdr; /* Forward declaration. */ #if !__USE_KERNEL_IPV6_DEFS /* IPv6 packet information. */ struct in6_pktinfo { struct in6_addr ipi6_addr; /* src/dst IPv6 address */ unsigned int ipi6_ifindex; /* send/recv interface index */ }; /* IPv6 MTU information. */ struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; /* dst address including zone ID */ uint32_t ip6m_mtu; /* path MTU in host byte order */ }; #endif /* !__USE_KERNEL_IPV6_DEFS */ /* Obsolete hop-by-hop and Destination Options Processing (RFC 2292). */ extern int inet6_option_space(int __nbytes) __THROW __attribute_deprecated__; extern int inet6_option_init(void *__bp, struct cmsghdr **__cmsgp, int __type) __THROW __attribute_deprecated__; extern int inet6_option_append(struct cmsghdr *__cmsg, const uint8_t * __typep, int __multx, int __plusy) __THROW __attribute_deprecated__; extern uint8_t *inet6_option_alloc(struct cmsghdr *__cmsg, int __datalen, int __multx, int __plusy) __THROW __attribute_deprecated__; extern int inet6_option_next(const struct cmsghdr *__cmsg, uint8_t ** __tptrp) __THROW __attribute_deprecated__; extern int inet6_option_find(const struct cmsghdr *__cmsg, uint8_t ** __tptrp, int __type) __THROW __attribute_deprecated__; /* Hop-by-Hop and Destination Options Processing (RFC 3542). */ extern int inet6_opt_init(void *__extbuf, socklen_t __extlen) __THROW; extern int inet6_opt_append(void *__extbuf, socklen_t __extlen, int __offset, uint8_t __type, socklen_t __len, uint8_t __align, void **__databufp) __THROW; extern int inet6_opt_finish(void *__extbuf, socklen_t __extlen, int __offset) __THROW; extern int inet6_opt_set_val(void *__databuf, int __offset, void *__val, socklen_t __vallen) __THROW; extern int inet6_opt_next(void *__extbuf, socklen_t __extlen, int __offset, uint8_t * __typep, socklen_t * __lenp, void **__databufp) __THROW; extern int inet6_opt_find(void *__extbuf, socklen_t __extlen, int __offset, uint8_t __type, socklen_t * __lenp, void **__databufp) __THROW; extern int inet6_opt_get_val(void *__databuf, int __offset, void *__val, socklen_t __vallen) __THROW; /* Routing Header Option (RFC 3542). */ extern socklen_t inet6_rth_space(int __type, int __segments) __THROW; extern void *inet6_rth_init(void *__bp, socklen_t __bp_len, int __type, int __segments) __THROW; extern int inet6_rth_add(void *__bp, const struct in6_addr *__addr) __THROW; extern int inet6_rth_reverse(const void *__in, void *__out) __THROW; extern int inet6_rth_segments(const void *__bp) __THROW; extern struct in6_addr *inet6_rth_getaddr(const void *__bp, int __index) __THROW; /* Multicast source filter support. */ /* Get IPv4 source filter. */ extern int getipv4sourcefilter(int __s, struct in_addr __interface_addr, struct in_addr __group, uint32_t * __fmode, uint32_t * __numsrc, struct in_addr *__slist) __THROW; /* Set IPv4 source filter. */ extern int setipv4sourcefilter(int __s, struct in_addr __interface_addr, struct in_addr __group, uint32_t __fmode, uint32_t __numsrc, const struct in_addr *__slist) __THROW; /* Get source filter. */ extern int getsourcefilter(int __s, uint32_t __interface_addr, const struct sockaddr *__group, socklen_t __grouplen, uint32_t * __fmode, uint32_t * __numsrc, struct sockaddr_storage *__slist) __THROW; /* Set source filter. */ extern int setsourcefilter(int __s, uint32_t __interface_addr, const struct sockaddr *__group, socklen_t __grouplen, uint32_t __fmode, uint32_t __numsrc, const struct sockaddr_storage *__slist) __THROW; #endif /* use GNU */ __END_DECLS #endif /* netinet/in.h */ ================================================ FILE: v2/headers/linux_386/usr/include/pthread.h ================================================ /* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _PTHREAD_H #define _PTHREAD_H 1 #include #include #include #include #include #include #include #include /* Detach state. */ enum { PTHREAD_CREATE_JOINABLE, #define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_DETACHED #define PTHREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED }; /* Mutex types. */ enum { PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_ADAPTIVE_NP #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 , PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL #endif #ifdef __USE_GNU /* For compatibility. */ , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP #endif }; #ifdef __USE_XOPEN2K /* Robust mutex or not flags. */ enum { PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_ROBUST, PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST }; #endif #if defined __USE_POSIX199506 || defined __USE_UNIX98 /* Mutex protocols. */ enum { PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT }; #endif #if __PTHREAD_MUTEX_HAVE_PREV # define PTHREAD_MUTEX_INITIALIZER \ { { 0, 0, 0, 0, 0, __PTHREAD_SPINS, { 0, 0 } } } # ifdef __USE_GNU # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, __PTHREAD_SPINS, { 0, 0 } } } # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, __PTHREAD_SPINS, { 0, 0 } } } # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, __PTHREAD_SPINS, { 0, 0 } } } # endif #else # define PTHREAD_MUTEX_INITIALIZER \ { { 0, 0, 0, 0, 0, { __PTHREAD_SPINS } } } # ifdef __USE_GNU # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { __PTHREAD_SPINS } } } # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { __PTHREAD_SPINS } } } # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { __PTHREAD_SPINS } } } # endif #endif /* Read-write lock types. */ #if defined __USE_UNIX98 || defined __USE_XOPEN2K enum { PTHREAD_RWLOCK_PREFER_READER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP }; /* Define __PTHREAD_RWLOCK_INT_FLAGS_SHARED to 1 if pthread_rwlock_t has the shared field. All 64-bit architectures have the shared field in pthread_rwlock_t. */ #ifndef __PTHREAD_RWLOCK_INT_FLAGS_SHARED # if __WORDSIZE == 64 # define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 # endif #endif /* Read-write lock initializers. */ # define PTHREAD_RWLOCK_INITIALIZER \ { { 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0 } } # ifdef __USE_GNU # ifdef __PTHREAD_RWLOCK_INT_FLAGS_SHARED # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, \ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } # else # if __BYTE_ORDER == __LITTLE_ENDIAN # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \ 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0 } } # else # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\ 0 } } # endif # endif # endif #endif /* Unix98 or XOpen2K */ /* Scheduler inheritance. */ enum { PTHREAD_INHERIT_SCHED, #define PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED PTHREAD_EXPLICIT_SCHED #define PTHREAD_EXPLICIT_SCHED PTHREAD_EXPLICIT_SCHED }; /* Scope handling. */ enum { PTHREAD_SCOPE_SYSTEM, #define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_PROCESS #define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS }; /* Process shared or private flag. */ enum { PTHREAD_PROCESS_PRIVATE, #define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_SHARED #define PTHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED }; /* Conditional variable handling. */ #define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, {0, 0}, 0, 0, {0, 0} } } /* Cleanup buffers */ struct _pthread_cleanup_buffer { void (*__routine) (void *); /* Function to call. */ void *__arg; /* Its argument. */ int __canceltype; /* Saved cancellation type. */ struct _pthread_cleanup_buffer *__prev; /* Chaining of cleanup functions. */ }; /* Cancellation */ enum { PTHREAD_CANCEL_ENABLE, #define PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_DISABLE #define PTHREAD_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE }; enum { PTHREAD_CANCEL_DEFERRED, #define PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_ASYNCHRONOUS #define PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS }; #define PTHREAD_CANCELED ((void *) -1) /* Single execution handling. */ #define PTHREAD_ONCE_INIT 0 #ifdef __USE_XOPEN2K /* Value returned by 'pthread_barrier_wait' for one of the threads after the required number of threads have called this function. -1 is distinct from 0 and all errno constants */ # define PTHREAD_BARRIER_SERIAL_THREAD -1 #endif __BEGIN_DECLS /* Create a new thread, starting with execution of START-ROUTINE getting passed ARG. Creation attributed come from ATTR. The new handle is stored in *NEWTHREAD. */ extern int pthread_create(pthread_t * __restrict __newthread, const pthread_attr_t * __restrict __attr, void *(*__start_routine) (void *), void *__restrict __arg) __THROWNL __nonnull((1, 3)); /* Terminate calling thread. The registered cleanup handlers are called via exception handling so we cannot mark this function with __THROW.*/ extern void pthread_exit(void *__retval) __attribute__ ((__noreturn__)); /* Make calling thread wait for termination of the thread TH. The exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN is not NULL. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_join(pthread_t __th, void **__thread_return); #ifdef __USE_GNU /* Check whether thread TH has terminated. If yes return the status of the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */ extern int pthread_tryjoin_np(pthread_t __th, void **__thread_return) __THROW; /* Make calling thread wait for termination of the thread TH, but only until TIMEOUT. The exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN is not NULL. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_timedjoin_np(pthread_t __th, void **__thread_return, const struct timespec *__abstime); #endif /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN. The resources of TH will therefore be freed immediately when it terminates, instead of waiting for another thread to perform PTHREAD_JOIN on it. */ extern int pthread_detach(pthread_t __th) __THROW; /* Obtain the identifier of the current thread. */ extern pthread_t pthread_self(void) __THROW __attribute__ ((__const__)); /* Compare two thread identifiers. */ extern int pthread_equal(pthread_t __thread1, pthread_t __thread2) __THROW __attribute__ ((__const__)); /* Thread attribute handling. */ /* Initialize thread attribute *ATTR with default attributes (detachstate is PTHREAD_JOINABLE, scheduling policy is SCHED_OTHER, no user-provided stack). */ extern int pthread_attr_init(pthread_attr_t * __attr) __THROW __nonnull((1)); /* Destroy thread attribute *ATTR. */ extern int pthread_attr_destroy(pthread_attr_t * __attr) __THROW __nonnull((1)); /* Get detach state attribute. */ extern int pthread_attr_getdetachstate(const pthread_attr_t * __attr, int *__detachstate) __THROW __nonnull((1, 2)); /* Set detach state attribute. */ extern int pthread_attr_setdetachstate(pthread_attr_t * __attr, int __detachstate) __THROW __nonnull((1)); /* Get the size of the guard area created for stack overflow protection. */ extern int pthread_attr_getguardsize(const pthread_attr_t * __attr, size_t * __guardsize) __THROW __nonnull((1, 2)); /* Set the size of the guard area created for stack overflow protection. */ extern int pthread_attr_setguardsize(pthread_attr_t * __attr, size_t __guardsize) __THROW __nonnull((1)); /* Return in *PARAM the scheduling parameters of *ATTR. */ extern int pthread_attr_getschedparam(const pthread_attr_t * __restrict __attr, struct sched_param *__restrict __param) __THROW __nonnull((1, 2)); /* Set scheduling parameters (priority, etc) in *ATTR according to PARAM. */ extern int pthread_attr_setschedparam(pthread_attr_t * __restrict __attr, const struct sched_param *__restrict __param) __THROW __nonnull((1, 2)); /* Return in *POLICY the scheduling policy of *ATTR. */ extern int pthread_attr_getschedpolicy(const pthread_attr_t * __restrict __attr, int *__restrict __policy) __THROW __nonnull((1, 2)); /* Set scheduling policy in *ATTR according to POLICY. */ extern int pthread_attr_setschedpolicy(pthread_attr_t * __attr, int __policy) __THROW __nonnull((1)); /* Return in *INHERIT the scheduling inheritance mode of *ATTR. */ extern int pthread_attr_getinheritsched(const pthread_attr_t * __restrict __attr, int *__restrict __inherit) __THROW __nonnull((1, 2)); /* Set scheduling inheritance mode in *ATTR according to INHERIT. */ extern int pthread_attr_setinheritsched(pthread_attr_t * __attr, int __inherit) __THROW __nonnull((1)); /* Return in *SCOPE the scheduling contention scope of *ATTR. */ extern int pthread_attr_getscope(const pthread_attr_t * __restrict __attr, int *__restrict __scope) __THROW __nonnull((1, 2)); /* Set scheduling contention scope in *ATTR according to SCOPE. */ extern int pthread_attr_setscope(pthread_attr_t * __attr, int __scope) __THROW __nonnull((1)); /* Return the previously set address for the stack. */ extern int pthread_attr_getstackaddr(const pthread_attr_t * __restrict __attr, void **__restrict __stackaddr) __THROW __nonnull((1, 2)) __attribute_deprecated__; /* Set the starting address of the stack of the thread to be created. Depending on whether the stack grows up or down the value must either be higher or lower than all the address in the memory block. The minimal size of the block must be PTHREAD_STACK_MIN. */ extern int pthread_attr_setstackaddr(pthread_attr_t * __attr, void *__stackaddr) __THROW __nonnull((1)) __attribute_deprecated__; /* Return the currently used minimal stack size. */ extern int pthread_attr_getstacksize(const pthread_attr_t * __restrict __attr, size_t * __restrict __stacksize) __THROW __nonnull((1, 2)); /* Add information about the minimum stack size needed for the thread to be started. This size must never be less than PTHREAD_STACK_MIN and must also not exceed the system limits. */ extern int pthread_attr_setstacksize(pthread_attr_t * __attr, size_t __stacksize) __THROW __nonnull((1)); #ifdef __USE_XOPEN2K /* Return the previously set address for the stack. */ extern int pthread_attr_getstack(const pthread_attr_t * __restrict __attr, void **__restrict __stackaddr, size_t * __restrict __stacksize) __THROW __nonnull((1, 2, 3)); /* The following two interfaces are intended to replace the last two. They require setting the address as well as the size since only setting the address will make the implementation on some architectures impossible. */ extern int pthread_attr_setstack(pthread_attr_t * __attr, void *__stackaddr, size_t __stacksize) __THROW __nonnull((1)); #endif #ifdef __USE_GNU /* Thread created with attribute ATTR will be limited to run only on the processors represented in CPUSET. */ extern int pthread_attr_setaffinity_np(pthread_attr_t * __attr, size_t __cpusetsize, const cpu_set_t * __cpuset) __THROW __nonnull((1, 3)); /* Get bit set in CPUSET representing the processors threads created with ATTR can run on. */ extern int pthread_attr_getaffinity_np(const pthread_attr_t * __attr, size_t __cpusetsize, cpu_set_t * __cpuset) __THROW __nonnull((1, 3)); /* Get the default attributes used by pthread_create in this process. */ extern int pthread_getattr_default_np(pthread_attr_t * __attr) __THROW __nonnull((1)); /* Set the default attributes to be used by pthread_create in this process. */ extern int pthread_setattr_default_np(const pthread_attr_t * __attr) __THROW __nonnull((1)); /* Initialize thread attribute *ATTR with attributes corresponding to the already running thread TH. It shall be called on uninitialized ATTR and destroyed with pthread_attr_destroy when no longer needed. */ extern int pthread_getattr_np(pthread_t __th, pthread_attr_t * __attr) __THROW __nonnull((2)); #endif /* Functions for scheduling control. */ /* Set the scheduling parameters for TARGET_THREAD according to POLICY and *PARAM. */ extern int pthread_setschedparam(pthread_t __target_thread, int __policy, const struct sched_param *__param) __THROW __nonnull((3)); /* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */ extern int pthread_getschedparam(pthread_t __target_thread, int *__restrict __policy, struct sched_param *__restrict __param) __THROW __nonnull((2, 3)); /* Set the scheduling priority for TARGET_THREAD. */ extern int pthread_setschedprio(pthread_t __target_thread, int __prio) __THROW; #ifdef __USE_GNU /* Get thread name visible in the kernel and its interfaces. */ extern int pthread_getname_np(pthread_t __target_thread, char *__buf, size_t __buflen) __THROW __nonnull((2)); /* Set thread name visible in the kernel and its interfaces. */ extern int pthread_setname_np(pthread_t __target_thread, const char *__name) __THROW __nonnull((2)); #endif #ifdef __USE_UNIX98 /* Determine level of concurrency. */ extern int pthread_getconcurrency(void) __THROW; /* Set new concurrency level to LEVEL. */ extern int pthread_setconcurrency(int __level) __THROW; #endif #ifdef __USE_GNU /* Yield the processor to another thread or process. This function is similar to the POSIX `sched_yield' function but might be differently implemented in the case of a m-on-n thread implementation. */ extern int pthread_yield(void) __THROW; /* Limit specified thread TH to run only on the processors represented in CPUSET. */ extern int pthread_setaffinity_np(pthread_t __th, size_t __cpusetsize, const cpu_set_t * __cpuset) __THROW __nonnull((3)); /* Get bit set in CPUSET representing the processors TH can run on. */ extern int pthread_getaffinity_np(pthread_t __th, size_t __cpusetsize, cpu_set_t * __cpuset) __THROW __nonnull((3)); #endif /* Functions for handling initialization. */ /* Guarantee that the initialization function INIT_ROUTINE will be called only once, even if pthread_once is executed several times with the same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or extern variable initialized to PTHREAD_ONCE_INIT. The initialization functions might throw exception which is why this function is not marked with __THROW. */ extern int pthread_once(pthread_once_t * __once_control, void (*__init_routine) (void)) __nonnull((1, 2)); /* Functions for handling cancellation. Note that these functions are explicitly not marked to not throw an exception in C++ code. If cancellation is implemented by unwinding this is necessary to have the compiler generate the unwind information. */ /* Set cancelability state of current thread to STATE, returning old state in *OLDSTATE if OLDSTATE is not NULL. */ extern int pthread_setcancelstate(int __state, int *__oldstate); /* Set cancellation state of current thread to TYPE, returning the old type in *OLDTYPE if OLDTYPE is not NULL. */ extern int pthread_setcanceltype(int __type, int *__oldtype); /* Cancel THREAD immediately or at the next possibility. */ extern int pthread_cancel(pthread_t __th); /* Test for pending cancellation for the current thread and terminate the thread as per pthread_exit(PTHREAD_CANCELED) if it has been cancelled. */ extern void pthread_testcancel(void); /* Cancellation handling with integration into exception handling. */ typedef struct { struct { __jmp_buf __cancel_jmp_buf; int __mask_was_saved; } __cancel_jmp_buf[1]; void *__pad[4]; } __pthread_unwind_buf_t __attribute__ ((__aligned__)); /* No special attributes by default. */ #ifndef __cleanup_fct_attribute # define __cleanup_fct_attribute #endif /* Structure to hold the cleanup handler information. */ struct __pthread_cleanup_frame { void (*__cancel_routine) (void *); void *__cancel_arg; int __do_it; int __cancel_type; }; #if defined __GNUC__ && defined __EXCEPTIONS # ifdef __cplusplus /* Class to handle cancellation handler invocation. */ class __pthread_cleanup_class { void (*__cancel_routine) (void *); void *__cancel_arg; int __do_it; int __cancel_type; public: __pthread_cleanup_class(void (*__fct) (void *), void *__arg) :__cancel_routine(__fct), __cancel_arg(__arg), __do_it(1) { } ~__pthread_cleanup_class() { if (__do_it) __cancel_routine(__cancel_arg); } void __setdoit(int __newval) { __do_it = __newval; } void __defer() { pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &__cancel_type); } void __restore() const { pthread_setcanceltype(__cancel_type, 0); }}; /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ # define pthread_cleanup_push(routine, arg) \ do { \ __pthread_cleanup_class __clframe (routine, arg) /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ # define pthread_cleanup_pop(execute) \ __clframe.__setdoit (execute); \ } while (0) # ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ # define pthread_cleanup_push_defer_np(routine, arg) \ do { \ __pthread_cleanup_class __clframe (routine, arg); \ __clframe.__defer () /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ # define pthread_cleanup_pop_restore_np(execute) \ __clframe.__restore (); \ __clframe.__setdoit (execute); \ } while (0) # endif # else /* Function called to call the cleanup handler. As an extern inline function the compiler is free to decide inlining the change when needed or fall back on the copy which must exist somewhere else. */ __extern_inline void __pthread_cleanup_routine(struct __pthread_cleanup_frame *__frame) { if (__frame->__do_it) __frame->__cancel_routine(__frame->__cancel_arg); } /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ # define pthread_cleanup_push(routine, arg) \ do { \ struct __pthread_cleanup_frame __clframe \ __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \ = { .__cancel_routine = (routine), .__cancel_arg = (arg), \ .__do_it = 1 }; /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ # define pthread_cleanup_pop(execute) \ __clframe.__do_it = (execute); \ } while (0) # ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ # define pthread_cleanup_push_defer_np(routine, arg) \ do { \ struct __pthread_cleanup_frame __clframe \ __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \ = { .__cancel_routine = (routine), .__cancel_arg = (arg), \ .__do_it = 1 }; \ (void) pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, \ &__clframe.__cancel_type) /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ # define pthread_cleanup_pop_restore_np(execute) \ (void) pthread_setcanceltype (__clframe.__cancel_type, NULL); \ __clframe.__do_it = (execute); \ } while (0) # endif # endif #else /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ # define pthread_cleanup_push(routine, arg) \ do { \ __pthread_unwind_buf_t __cancel_buf; \ void (*__cancel_routine) (void *) = (routine); \ void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ /* NOTREACHED */ \ } \ \ __pthread_register_cancel (&__cancel_buf); \ do { extern void __pthread_register_cancel(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute; /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ # define pthread_cleanup_pop(execute) \ do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ } while (0); \ __pthread_unregister_cancel (&__cancel_buf); \ if (execute) \ __cancel_routine (__cancel_arg); \ } while (0) extern void __pthread_unregister_cancel(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute; # ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ # define pthread_cleanup_push_defer_np(routine, arg) \ do { \ __pthread_unwind_buf_t __cancel_buf; \ void (*__cancel_routine) (void *) = (routine); \ void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ /* NOTREACHED */ \ } \ \ __pthread_register_cancel_defer (&__cancel_buf); \ do { extern void __pthread_register_cancel_defer(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute; /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ # define pthread_cleanup_pop_restore_np(execute) \ do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ } while (0); \ __pthread_unregister_cancel_restore (&__cancel_buf); \ if (execute) \ __cancel_routine (__cancel_arg); \ } while (0) extern void __pthread_unregister_cancel_restore(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute; # endif /* Internal interface to initiate cleanup. */ extern void __pthread_unwind_next(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute __attribute__ ((__noreturn__)) # ifndef SHARED __attribute__ ((__weak__)) # endif ; #endif /* Function used in the macros. */ struct __jmp_buf_tag; extern int __sigsetjmp(struct __jmp_buf_tag *__env, int __savemask) __THROWNL; /* Mutex handling. */ /* Initialize a mutex. */ extern int pthread_mutex_init(pthread_mutex_t * __mutex, const pthread_mutexattr_t * __mutexattr) __THROW __nonnull((1)); /* Destroy a mutex. */ extern int pthread_mutex_destroy(pthread_mutex_t * __mutex) __THROW __nonnull((1)); /* Try locking a mutex. */ extern int pthread_mutex_trylock(pthread_mutex_t * __mutex) __THROWNL __nonnull((1)); /* Lock a mutex. */ extern int pthread_mutex_lock(pthread_mutex_t * __mutex) __THROWNL __nonnull((1)); #ifdef __USE_XOPEN2K /* Wait until lock becomes available, or specified time passes. */ extern int pthread_mutex_timedlock(pthread_mutex_t * __restrict __mutex, const struct timespec *__restrict __abstime) __THROWNL __nonnull((1, 2)); #endif /* Unlock a mutex. */ extern int pthread_mutex_unlock(pthread_mutex_t * __mutex) __THROWNL __nonnull((1)); /* Get the priority ceiling of MUTEX. */ extern int pthread_mutex_getprioceiling(const pthread_mutex_t * __restrict __mutex, int *__restrict __prioceiling) __THROW __nonnull((1, 2)); /* Set the priority ceiling of MUTEX to PRIOCEILING, return old priority ceiling value in *OLD_CEILING. */ extern int pthread_mutex_setprioceiling(pthread_mutex_t * __restrict __mutex, int __prioceiling, int *__restrict __old_ceiling) __THROW __nonnull((1, 3)); #ifdef __USE_XOPEN2K8 /* Declare the state protected by MUTEX as consistent. */ extern int pthread_mutex_consistent(pthread_mutex_t * __mutex) __THROW __nonnull((1)); # ifdef __USE_GNU extern int pthread_mutex_consistent_np(pthread_mutex_t * __mutex) __THROW __nonnull((1)); # endif #endif /* Functions for handling mutex attributes. */ /* Initialize mutex attribute object ATTR with default attributes (kind is PTHREAD_MUTEX_TIMED_NP). */ extern int pthread_mutexattr_init(pthread_mutexattr_t * __attr) __THROW __nonnull((1)); /* Destroy mutex attribute object ATTR. */ extern int pthread_mutexattr_destroy(pthread_mutexattr_t * __attr) __THROW __nonnull((1)); /* Get the process-shared flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull((1, 2)); /* Set the process-shared flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_setpshared(pthread_mutexattr_t * __attr, int __pshared) __THROW __nonnull((1)); #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 /* Return in *KIND the mutex kind attribute in *ATTR. */ extern int pthread_mutexattr_gettype(const pthread_mutexattr_t * __restrict __attr, int *__restrict __kind) __THROW __nonnull((1, 2)); /* Set the mutex kind attribute in *ATTR to KIND (either PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, or PTHREAD_MUTEX_DEFAULT). */ extern int pthread_mutexattr_settype(pthread_mutexattr_t * __attr, int __kind) __THROW __nonnull((1)); #endif /* Return in *PROTOCOL the mutex protocol attribute in *ATTR. */ extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t * __restrict __attr, int *__restrict __protocol) __THROW __nonnull((1, 2)); /* Set the mutex protocol attribute in *ATTR to PROTOCOL (either PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, or PTHREAD_PRIO_PROTECT). */ extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t * __attr, int __protocol) __THROW __nonnull((1)); /* Return in *PRIOCEILING the mutex prioceiling attribute in *ATTR. */ extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t * __restrict __attr, int *__restrict __prioceiling) __THROW __nonnull((1, 2)); /* Set the mutex prioceiling attribute in *ATTR to PRIOCEILING. */ extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t * __attr, int __prioceiling) __THROW __nonnull((1)); #ifdef __USE_XOPEN2K /* Get the robustness flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_getrobust(const pthread_mutexattr_t * __attr, int *__robustness) __THROW __nonnull((1, 2)); # ifdef __USE_GNU extern int pthread_mutexattr_getrobust_np(const pthread_mutexattr_t * __attr, int *__robustness) __THROW __nonnull((1, 2)); # endif /* Set the robustness flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_setrobust(pthread_mutexattr_t * __attr, int __robustness) __THROW __nonnull((1)); # ifdef __USE_GNU extern int pthread_mutexattr_setrobust_np(pthread_mutexattr_t * __attr, int __robustness) __THROW __nonnull((1)); # endif #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K /* Functions for handling read-write locks. */ /* Initialize read-write lock RWLOCK using attributes ATTR, or use the default values if later is NULL. */ extern int pthread_rwlock_init(pthread_rwlock_t * __restrict __rwlock, const pthread_rwlockattr_t * __restrict __attr) __THROW __nonnull((1)); /* Destroy read-write lock RWLOCK. */ extern int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock) __THROW __nonnull((1)); /* Acquire read lock for RWLOCK. */ extern int pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); /* Try to acquire read lock for RWLOCK. */ extern int pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); # ifdef __USE_XOPEN2K /* Try to acquire read lock for RWLOCK or return after specfied time. */ extern int pthread_rwlock_timedrdlock(pthread_rwlock_t * __restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull((1, 2)); # endif /* Acquire write lock for RWLOCK. */ extern int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); /* Try to acquire write lock for RWLOCK. */ extern int pthread_rwlock_trywrlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); # ifdef __USE_XOPEN2K /* Try to acquire write lock for RWLOCK or return after specfied time. */ extern int pthread_rwlock_timedwrlock(pthread_rwlock_t * __restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull((1, 2)); # endif /* Unlock RWLOCK. */ extern int pthread_rwlock_unlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); /* Functions for handling read-write lock attributes. */ /* Initialize attribute object ATTR with default values. */ extern int pthread_rwlockattr_init(pthread_rwlockattr_t * __attr) __THROW __nonnull((1)); /* Destroy attribute object ATTR. */ extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t * __attr) __THROW __nonnull((1)); /* Return current setting of process-shared attribute of ATTR in PSHARED. */ extern int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull((1, 2)); /* Set process-shared attribute of ATTR to PSHARED. */ extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t * __attr, int __pshared) __THROW __nonnull((1)); /* Return current setting of reader/writer preference. */ extern int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pref) __THROW __nonnull((1, 2)); /* Set reader/write preference. */ extern int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t * __attr, int __pref) __THROW __nonnull((1)); #endif /* Functions for handling conditional variables. */ /* Initialize condition variable COND using attributes ATTR, or use the default values if later is NULL. */ extern int pthread_cond_init(pthread_cond_t * __restrict __cond, const pthread_condattr_t * __restrict __cond_attr) __THROW __nonnull((1)); /* Destroy condition variable COND. */ extern int pthread_cond_destroy(pthread_cond_t * __cond) __THROW __nonnull((1)); /* Wake up one thread waiting for condition variable COND. */ extern int pthread_cond_signal(pthread_cond_t * __cond) __THROWNL __nonnull((1)); /* Wake up all threads waiting for condition variables COND. */ extern int pthread_cond_broadcast(pthread_cond_t * __cond) __THROWNL __nonnull((1)); /* Wait for condition variable COND to be signaled or broadcast. MUTEX is assumed to be locked before. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_cond_wait(pthread_cond_t * __restrict __cond, pthread_mutex_t * __restrict __mutex) __nonnull((1, 2)); /* Wait for condition variable COND to be signaled or broadcast until ABSTIME. MUTEX is assumed to be locked before. ABSTIME is an absolute time specification; zero is the beginning of the epoch (00:00:00 GMT, January 1, 1970). This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_cond_timedwait(pthread_cond_t * __restrict __cond, pthread_mutex_t * __restrict __mutex, const struct timespec *__restrict __abstime) __nonnull((1, 2, 3)); /* Functions for handling condition variable attributes. */ /* Initialize condition variable attribute ATTR. */ extern int pthread_condattr_init(pthread_condattr_t * __attr) __THROW __nonnull((1)); /* Destroy condition variable attribute ATTR. */ extern int pthread_condattr_destroy(pthread_condattr_t * __attr) __THROW __nonnull((1)); /* Get the process-shared flag of the condition variable attribute ATTR. */ extern int pthread_condattr_getpshared(const pthread_condattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull((1, 2)); /* Set the process-shared flag of the condition variable attribute ATTR. */ extern int pthread_condattr_setpshared(pthread_condattr_t * __attr, int __pshared) __THROW __nonnull((1)); #ifdef __USE_XOPEN2K /* Get the clock selected for the condition variable attribute ATTR. */ extern int pthread_condattr_getclock(const pthread_condattr_t * __restrict __attr, __clockid_t * __restrict __clock_id) __THROW __nonnull((1, 2)); /* Set the clock selected for the condition variable attribute ATTR. */ extern int pthread_condattr_setclock(pthread_condattr_t * __attr, __clockid_t __clock_id) __THROW __nonnull((1)); #endif #ifdef __USE_XOPEN2K /* Functions to handle spinlocks. */ /* Initialize the spinlock LOCK. If PSHARED is nonzero the spinlock can be shared between different processes. */ extern int pthread_spin_init(pthread_spinlock_t * __lock, int __pshared) __THROW __nonnull((1)); /* Destroy the spinlock LOCK. */ extern int pthread_spin_destroy(pthread_spinlock_t * __lock) __THROW __nonnull((1)); /* Wait until spinlock LOCK is retrieved. */ extern int pthread_spin_lock(pthread_spinlock_t * __lock) __THROWNL __nonnull((1)); /* Try to lock spinlock LOCK. */ extern int pthread_spin_trylock(pthread_spinlock_t * __lock) __THROWNL __nonnull((1)); /* Release spinlock LOCK. */ extern int pthread_spin_unlock(pthread_spinlock_t * __lock) __THROWNL __nonnull((1)); /* Functions to handle barriers. */ /* Initialize BARRIER with the attributes in ATTR. The barrier is opened when COUNT waiters arrived. */ extern int pthread_barrier_init(pthread_barrier_t * __restrict __barrier, const pthread_barrierattr_t * __restrict __attr, unsigned int __count) __THROW __nonnull((1)); /* Destroy a previously dynamically initialized barrier BARRIER. */ extern int pthread_barrier_destroy(pthread_barrier_t * __barrier) __THROW __nonnull((1)); /* Wait on barrier BARRIER. */ extern int pthread_barrier_wait(pthread_barrier_t * __barrier) __THROWNL __nonnull((1)); /* Initialize barrier attribute ATTR. */ extern int pthread_barrierattr_init(pthread_barrierattr_t * __attr) __THROW __nonnull((1)); /* Destroy previously dynamically initialized barrier attribute ATTR. */ extern int pthread_barrierattr_destroy(pthread_barrierattr_t * __attr) __THROW __nonnull((1)); /* Get the process-shared flag of the barrier attribute ATTR. */ extern int pthread_barrierattr_getpshared(const pthread_barrierattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull((1, 2)); /* Set the process-shared flag of the barrier attribute ATTR. */ extern int pthread_barrierattr_setpshared(pthread_barrierattr_t * __attr, int __pshared) __THROW __nonnull((1)); #endif /* Functions for handling thread-specific data. */ /* Create a key value identifying a location in the thread-specific data area. Each thread maintains a distinct thread-specific data area. DESTR_FUNCTION, if non-NULL, is called with the value associated to that key when the key is destroyed. DESTR_FUNCTION is not called if the value associated is NULL when the key is destroyed. */ extern int pthread_key_create(pthread_key_t * __key, void (*__destr_function) (void *)) __THROW __nonnull((1)); /* Destroy KEY. */ extern int pthread_key_delete(pthread_key_t __key) __THROW; /* Return current value of the thread-specific data slot identified by KEY. */ extern void *pthread_getspecific(pthread_key_t __key) __THROW; /* Store POINTER in the thread-specific data slot identified by KEY. */ extern int pthread_setspecific(pthread_key_t __key, const void *__pointer) __THROW; #ifdef __USE_XOPEN2K /* Get ID of CPU-time clock for thread THREAD_ID. */ extern int pthread_getcpuclockid(pthread_t __thread_id, __clockid_t * __clock_id) __THROW __nonnull((2)); #endif /* Install handlers to be called when a new process is created with FORK. The PREPARE handler is called in the parent process just before performing FORK. The PARENT handler is called in the parent process just after FORK. The CHILD handler is called in the child process. Each of the three handlers can be NULL, meaning that no handler needs to be called at that point. PTHREAD_ATFORK can be called several times, in which case the PREPARE handlers are called in LIFO order (last added with PTHREAD_ATFORK, first called before FORK), and the PARENT and CHILD handlers are called in FIFO (first added, first called). */ extern int pthread_atfork(void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)) __THROW; #ifdef __USE_EXTERN_INLINES /* Optimizations. */ __extern_inline int __NTH(pthread_equal(pthread_t __thread1, pthread_t __thread2)) { return __thread1 == __thread2; } #endif __END_DECLS #endif /* pthread.h */ ================================================ FILE: v2/headers/linux_386/usr/include/pwd.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 9.2.2 User Database Access */ #ifndef _PWD_H #define _PWD_H 1 #include __BEGIN_DECLS #include #define __need_size_t #include #if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ # ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined # endif # ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined # endif #endif /* The passwd structure. */ struct passwd { char *pw_name; /* Username. */ char *pw_passwd; /* Password. */ __uid_t pw_uid; /* User ID. */ __gid_t pw_gid; /* Group ID. */ char *pw_gecos; /* Real name. */ char *pw_dir; /* Home directory. */ char *pw_shell; /* Shell program. */ }; #ifdef __USE_MISC # include #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Rewind the password-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setpwent(void); /* Close the password-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endpwent(void); /* Read an entry from the password-file stream, opening it if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwent(void); #endif #ifdef __USE_MISC /* Read an entry from STREAM. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct passwd *fgetpwent(FILE * __stream) __nonnull((1)); /* Write the given entry onto the given stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int putpwent(const struct passwd *__restrict __p, FILE * __restrict __f); #endif /* Search for an entry with a matching user ID. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwuid(__uid_t __uid); /* Search for an entry with a matching username. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwnam(const char *__name) __nonnull((1)); #ifdef __USE_POSIX # ifdef __USE_MISC /* Reasonable value for the buffer sized used in the reentrant functions below. But better use `sysconf'. */ # define NSS_BUFLEN_PASSWD 1024 # endif /* Reentrant versions of some of the functions above. PLEASE NOTE: the `getpwent_r' function is not (yet) standardized. The interface may change in later versions of this library. But the interface is designed following the principals used for the other reentrant functions so the chances are good this is what the POSIX people would choose. */ # ifdef __USE_MISC /* This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getpwent_r(struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull((1, 2, 4)); # endif extern int getpwuid_r(__uid_t __uid, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull((2, 3, 5)); extern int getpwnam_r(const char *__restrict __name, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull((1, 2, 3, 5)); # ifdef __USE_MISC /* Read an entry from STREAM. This function is not standardized and probably never will. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fgetpwent_r(FILE * __restrict __stream, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull((1, 2, 3, 5)); # endif #endif /* POSIX or reentrant */ #ifdef __USE_GNU /* Re-construct the password-file line for the given uid in the given buffer. This knows the format that the caller will expect, but this need not be the format of the password file. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getpw(__uid_t __uid, char *__buffer); #endif __END_DECLS #endif /* pwd.h */ ================================================ FILE: v2/headers/linux_386/usr/include/rpc/netdb.h ================================================ /* @(#)netdb.h 2.1 88/07/29 3.9 RPCSRC */ /* * Copyright (c) 2010, Oracle America, Inc. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the "Oracle America, Inc." nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Cleaned up for GNU C library roland@gnu.ai.mit.edu: added multiple inclusion protection and use of . In GNU this file is #include'd by . */ #ifndef _RPC_NETDB_H #define _RPC_NETDB_H 1 #include #define __need_size_t #include __BEGIN_DECLS struct rpcent { char *r_name; /* Name of server for this rpc program. */ char **r_aliases; /* Alias list. */ int r_number; /* RPC program number. */ }; extern void setrpcent(int __stayopen) __THROW; extern void endrpcent(void) __THROW; extern struct rpcent *getrpcbyname(const char *__name) __THROW; extern struct rpcent *getrpcbynumber(int __number) __THROW; extern struct rpcent *getrpcent(void) __THROW; #ifdef __USE_MISC extern int getrpcbyname_r(const char *__name, struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) __THROW; extern int getrpcbynumber_r(int __number, struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) __THROW; extern int getrpcent_r(struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) __THROW; #endif __END_DECLS #endif /* rpc/netdb.h */ ================================================ FILE: v2/headers/linux_386/usr/include/sched.h ================================================ /* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SCHED_H #define _SCHED_H 1 #include /* Get type definitions. */ #include #define __need_size_t #define __need_NULL #include #include #include #ifndef __USE_XOPEN2K # include #endif #ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif /* Get system specific constant and data structure definitions. */ #include #include /* Backward compatibility. */ #define sched_priority sched_priority #define __sched_priority sched_priority __BEGIN_DECLS /* Set scheduling parameters for a process. */ extern int sched_setparam(__pid_t __pid, const struct sched_param *__param) __THROW; /* Retrieve scheduling parameters for a particular process. */ extern int sched_getparam(__pid_t __pid, struct sched_param *__param) __THROW; /* Set scheduling algorithm and/or parameters for a process. */ extern int sched_setscheduler(__pid_t __pid, int __policy, const struct sched_param *__param) __THROW; /* Retrieve scheduling algorithm for a particular purpose. */ extern int sched_getscheduler(__pid_t __pid) __THROW; /* Yield the processor. */ extern int sched_yield(void) __THROW; /* Get maximum priority value for a scheduler. */ extern int sched_get_priority_max(int __algorithm) __THROW; /* Get minimum priority value for a scheduler. */ extern int sched_get_priority_min(int __algorithm) __THROW; /* Get the SCHED_RR interval for the named process. */ extern int sched_rr_get_interval(__pid_t __pid, struct timespec *__t) __THROW; #ifdef __USE_GNU /* Access macros for `cpu_set'. */ # define CPU_SETSIZE __CPU_SETSIZE # define CPU_SET(cpu, cpusetp) __CPU_SET_S (cpu, sizeof (cpu_set_t), cpusetp) # define CPU_CLR(cpu, cpusetp) __CPU_CLR_S (cpu, sizeof (cpu_set_t), cpusetp) # define CPU_ISSET(cpu, cpusetp) __CPU_ISSET_S (cpu, sizeof (cpu_set_t), \ cpusetp) # define CPU_ZERO(cpusetp) __CPU_ZERO_S (sizeof (cpu_set_t), cpusetp) # define CPU_COUNT(cpusetp) __CPU_COUNT_S (sizeof (cpu_set_t), cpusetp) # define CPU_SET_S(cpu, setsize, cpusetp) __CPU_SET_S (cpu, setsize, cpusetp) # define CPU_CLR_S(cpu, setsize, cpusetp) __CPU_CLR_S (cpu, setsize, cpusetp) # define CPU_ISSET_S(cpu, setsize, cpusetp) __CPU_ISSET_S (cpu, setsize, \ cpusetp) # define CPU_ZERO_S(setsize, cpusetp) __CPU_ZERO_S (setsize, cpusetp) # define CPU_COUNT_S(setsize, cpusetp) __CPU_COUNT_S (setsize, cpusetp) # define CPU_EQUAL(cpusetp1, cpusetp2) \ __CPU_EQUAL_S (sizeof (cpu_set_t), cpusetp1, cpusetp2) # define CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ __CPU_EQUAL_S (setsize, cpusetp1, cpusetp2) # define CPU_AND(destset, srcset1, srcset2) \ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, &) # define CPU_OR(destset, srcset1, srcset2) \ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, |) # define CPU_XOR(destset, srcset1, srcset2) \ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, ^) # define CPU_AND_S(setsize, destset, srcset1, srcset2) \ __CPU_OP_S (setsize, destset, srcset1, srcset2, &) # define CPU_OR_S(setsize, destset, srcset1, srcset2) \ __CPU_OP_S (setsize, destset, srcset1, srcset2, |) # define CPU_XOR_S(setsize, destset, srcset1, srcset2) \ __CPU_OP_S (setsize, destset, srcset1, srcset2, ^) # define CPU_ALLOC_SIZE(count) __CPU_ALLOC_SIZE (count) # define CPU_ALLOC(count) __CPU_ALLOC (count) # define CPU_FREE(cpuset) __CPU_FREE (cpuset) /* Set the CPU affinity for a task */ extern int sched_setaffinity(__pid_t __pid, size_t __cpusetsize, const cpu_set_t * __cpuset) __THROW; /* Get the CPU affinity for a task */ extern int sched_getaffinity(__pid_t __pid, size_t __cpusetsize, cpu_set_t * __cpuset) __THROW; #endif __END_DECLS #endif /* sched.h */ ================================================ FILE: v2/headers/linux_386/usr/include/setjmp.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.13 Nonlocal jumps */ #ifndef _SETJMP_H #define _SETJMP_H 1 #include __BEGIN_DECLS #include /* Get `__jmp_buf'. */ #include /* Calling environment, plus possibly a saved signal mask. */ struct __jmp_buf_tag { /* NOTE: The machine-dependent definitions of `__sigsetjmp' assume that a `jmp_buf' begins with a `__jmp_buf' and that `__mask_was_saved' follows it. Do not move these members or add others before it. */ __jmp_buf __jmpbuf; /* Calling environment. */ int __mask_was_saved; /* Saved the signal mask? */ __sigset_t __saved_mask; /* Saved signal mask. */ }; typedef struct __jmp_buf_tag jmp_buf[1]; /* Store the calling environment in ENV, also saving the signal mask. Return 0. */ extern int setjmp(jmp_buf __env) __THROWNL; /* Store the calling environment in ENV, also saving the signal mask if SAVEMASK is nonzero. Return 0. This is the internal name for `sigsetjmp'. */ extern int __sigsetjmp(struct __jmp_buf_tag __env[1], int __savemask) __THROWNL; /* Store the calling environment in ENV, not saving the signal mask. Return 0. */ extern int _setjmp(struct __jmp_buf_tag __env[1]) __THROWNL; /* Do not save the signal mask. This is equivalent to the `_setjmp' BSD function. */ #define setjmp(env) _setjmp (env) /* Jump to the environment saved in ENV, making the `setjmp' call there return VAL, or 1 if VAL is 0. */ extern void longjmp(struct __jmp_buf_tag __env[1], int __val) __THROWNL __attribute__ ((__noreturn__)); #if defined __USE_MISC || defined __USE_XOPEN /* Same. Usually `_longjmp' is used with `_setjmp', which does not save the signal mask. But it is how ENV was saved that determines whether `longjmp' restores the mask; `_longjmp' is just an alias. */ extern void _longjmp(struct __jmp_buf_tag __env[1], int __val) __THROWNL __attribute__ ((__noreturn__)); #endif #ifdef __USE_POSIX /* Use the same type for `jmp_buf' and `sigjmp_buf'. The `__mask_was_saved' flag determines whether or not `longjmp' will restore the signal mask. */ typedef struct __jmp_buf_tag sigjmp_buf[1]; /* Store the calling environment in ENV, also saving the signal mask if SAVEMASK is nonzero. Return 0. */ # define sigsetjmp(env, savemask) __sigsetjmp (env, savemask) /* Jump to the environment saved in ENV, making the sigsetjmp call there return VAL, or 1 if VAL is 0. Restore the signal mask if that sigsetjmp call saved it. This is just an alias `longjmp'. */ extern void siglongjmp(sigjmp_buf __env, int __val) __THROWNL __attribute__ ((__noreturn__)); #endif /* Use POSIX. */ /* Define helper functions to catch unsafe code. */ #if __USE_FORTIFY_LEVEL > 0 # include #endif __END_DECLS #endif /* setjmp.h */ ================================================ FILE: v2/headers/linux_386/usr/include/signal.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.14 Signal handling */ #ifndef _SIGNAL_H #define _SIGNAL_H #include __BEGIN_DECLS #include #include #include #if defined __USE_POSIX #include #endif #if defined __USE_XOPEN || defined __USE_XOPEN2K # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif #ifdef __USE_XOPEN # endif # ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined # endif #endif /* Unix98 */ #ifdef __USE_POSIX199309 /* We need `struct timespec' later on. */ # include #endif #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED # include # include #endif #ifdef __USE_MISC # include #endif #ifdef __USE_POSIX199309 # include # include #endif /* Type of a signal handler. */ typedef void (*__sighandler_t) (int); /* The X/Open definition of `signal' specifies the SVID semantic. Use the additional function `sysv_signal' when X/Open compatibility is requested. */ extern __sighandler_t __sysv_signal(int __sig, __sighandler_t __handler) __THROW; #ifdef __USE_GNU extern __sighandler_t sysv_signal(int __sig, __sighandler_t __handler) __THROW; #endif /* Set the handler for the signal SIG to HANDLER, returning the old handler, or SIG_ERR on error. By default `signal' has the BSD semantic. */ #ifdef __USE_MISC extern __sighandler_t signal(int __sig, __sighandler_t __handler) __THROW; #else /* Make sure the used `signal' implementation is the SVID version. */ # ifdef __REDIRECT_NTH extern __sighandler_t __REDIRECT_NTH(signal, (int __sig, __sighandler_t __handler), __sysv_signal); # else # define signal __sysv_signal # endif #endif #if defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8 /* The X/Open definition of `signal' conflicts with the BSD version. So they defined another function `bsd_signal'. */ extern __sighandler_t bsd_signal(int __sig, __sighandler_t __handler) __THROW; #endif /* Send signal SIG to process number PID. If PID is zero, send SIG to all processes in the current process's process group. If PID is < -1, send SIG to all processes in process group - PID. */ #ifdef __USE_POSIX extern int kill(__pid_t __pid, int __sig) __THROW; #endif /* Use POSIX. */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Send SIG to all processes in process group PGRP. If PGRP is zero, send SIG to all processes in the current process's process group. */ extern int killpg(__pid_t __pgrp, int __sig) __THROW; #endif /* Use misc || X/Open Unix. */ /* Raise signal SIG, i.e., send SIG to yourself. */ extern int raise(int __sig) __THROW; #ifdef __USE_MISC /* SVID names for the same things. */ extern __sighandler_t ssignal(int __sig, __sighandler_t __handler) __THROW; extern int gsignal(int __sig) __THROW; #endif /* Use misc. */ #ifdef __USE_XOPEN2K8 /* Print a message describing the meaning of the given signal number. */ extern void psignal(int __sig, const char *__s); /* Print a message describing the meaning of the given signal information. */ extern void psiginfo(const siginfo_t * __pinfo, const char *__s); #endif /* POSIX 2008. */ /* The `sigpause' function in X/Open defines the argument as the signal number. This requires redirecting to another function because the default version in glibc uses an old BSD interface. This function is a cancellation point and therefore not marked with __THROW. */ #ifdef __USE_XOPEN_EXTENDED # ifdef __GNUC__ extern int sigpause(int __sig) __asm__("__xpg_sigpause"); # else extern int __sigpause(int __sig_or_mask, int __is_sig); /* Remove a signal from the signal mask and suspend the process. */ # define sigpause(sig) __sigpause ((sig), 1) # endif #endif #ifdef __USE_MISC /* None of the following functions should be used anymore. They are here only for compatibility. A single word (`int') is not guaranteed to be enough to hold a complete signal mask and therefore these functions simply do not work in many situations. Use `sigprocmask' instead. */ /* Compute mask for signal SIG. */ # define sigmask(sig) ((int)(1u << ((sig) - 1))) /* Block signals in MASK, returning the old mask. */ extern int sigblock(int __mask) __THROW __attribute_deprecated__; /* Set the mask of blocked signals to MASK, returning the old mask. */ extern int sigsetmask(int __mask) __THROW __attribute_deprecated__; /* Return currently selected signal mask. */ extern int siggetmask(void) __THROW __attribute_deprecated__; #endif /* Use misc. */ #ifdef __USE_MISC # define NSIG _NSIG #endif #ifdef __USE_GNU typedef __sighandler_t sighandler_t; #endif /* 4.4 BSD uses the name `sig_t' for this. */ #ifdef __USE_MISC typedef __sighandler_t sig_t; #endif #ifdef __USE_POSIX /* Clear all signals from SET. */ extern int sigemptyset(sigset_t * __set) __THROW __nonnull((1)); /* Set all signals in SET. */ extern int sigfillset(sigset_t * __set) __THROW __nonnull((1)); /* Add SIGNO to SET. */ extern int sigaddset(sigset_t * __set, int __signo) __THROW __nonnull((1)); /* Remove SIGNO from SET. */ extern int sigdelset(sigset_t * __set, int __signo) __THROW __nonnull((1)); /* Return 1 if SIGNO is in SET, 0 if not. */ extern int sigismember(const sigset_t * __set, int __signo) __THROW __nonnull((1)); # ifdef __USE_GNU /* Return non-empty value is SET is not empty. */ extern int sigisemptyset(const sigset_t * __set) __THROW __nonnull((1)); /* Build new signal set by combining the two inputs set using logical AND. */ extern int sigandset(sigset_t * __set, const sigset_t * __left, const sigset_t * __right) __THROW __nonnull((1, 2, 3)); /* Build new signal set by combining the two inputs set using logical OR. */ extern int sigorset(sigset_t * __set, const sigset_t * __left, const sigset_t * __right) __THROW __nonnull((1, 2, 3)); # endif /* GNU */ /* Get the system-specific definitions of `struct sigaction' and the `SA_*' and `SIG_*'. constants. */ # include /* Get and/or change the set of blocked signals. */ extern int sigprocmask(int __how, const sigset_t * __restrict __set, sigset_t * __restrict __oset) __THROW; /* Change the set of blocked signals to SET, wait until a signal arrives, and restore the set of blocked signals. This function is a cancellation point and therefore not marked with __THROW. */ extern int sigsuspend(const sigset_t * __set) __nonnull((1)); /* Get and/or set the action for signal SIG. */ extern int sigaction(int __sig, const struct sigaction *__restrict __act, struct sigaction *__restrict __oact) __THROW; /* Put in SET all signals that are blocked and waiting to be delivered. */ extern int sigpending(sigset_t * __set) __THROW __nonnull((1)); # ifdef __USE_POSIX199506 /* Select any of pending signals from SET or wait for any to arrive. This function is a cancellation point and therefore not marked with __THROW. */ extern int sigwait(const sigset_t * __restrict __set, int *__restrict __sig) __nonnull((1, 2)); # endif /* Use POSIX 1995. */ # ifdef __USE_POSIX199309 /* Select any of pending signals from SET and place information in INFO. This function is a cancellation point and therefore not marked with __THROW. */ extern int sigwaitinfo(const sigset_t * __restrict __set, siginfo_t * __restrict __info) __nonnull((1)); /* Select any of pending signals from SET and place information in INFO. Wait the time specified by TIMEOUT if no signal is pending. This function is a cancellation point and therefore not marked with __THROW. */ extern int sigtimedwait(const sigset_t * __restrict __set, siginfo_t * __restrict __info, const struct timespec *__restrict __timeout) __nonnull((1)); /* Send signal SIG to the process PID. Associate data in VAL with the signal. */ extern int sigqueue(__pid_t __pid, int __sig, const union sigval __val) __THROW; # endif /* Use POSIX 199306. */ #endif /* Use POSIX. */ #ifdef __USE_MISC /* Names of the signals. This variable exists only for compatibility. Use `strsignal' instead (see ). */ extern const char *const _sys_siglist[_NSIG]; extern const char *const sys_siglist[_NSIG]; /* Get machine-dependent `struct sigcontext' and signal subcodes. */ # include /* Restore the state saved in SCP. */ extern int sigreturn(struct sigcontext *__scp) __THROW; #endif /* Use misc. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 # define __need_size_t # include # include # if defined __USE_XOPEN || defined __USE_XOPEN2K8 /* This will define `ucontext_t' and `mcontext_t'. */ # include # endif #endif /* Use POSIX.1-2008 or X/Open Unix. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_MISC /* If INTERRUPT is nonzero, make signal SIG interrupt system calls (causing them to fail with EINTR); if INTERRUPT is zero, make system calls be restarted after signal SIG. */ extern int siginterrupt(int __sig, int __interrupt) __THROW; # include # include /* Alternate signal handler stack interface. This interface should always be preferred over `sigstack'. */ extern int sigaltstack(const stack_t * __restrict __ss, stack_t * __restrict __oss) __THROW; #endif /* __USE_XOPEN_EXTENDED || __USE_MISC */ #if ((defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_MISC) # include #endif #if ((defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \ || defined __USE_MISC) /* Run signals handlers on the stack specified by SS (if not NULL). If OSS is not NULL, it is filled in with the old signal stack status. This interface is obsolete and on many platform not implemented. */ extern int sigstack(struct sigstack *__ss, struct sigstack *__oss) __THROW __attribute_deprecated__; #endif #ifdef __USE_XOPEN_EXTENDED /* Simplified interface for signal management. */ /* Add SIG to the calling process' signal mask. */ extern int sighold(int __sig) __THROW; /* Remove SIG from the calling process' signal mask. */ extern int sigrelse(int __sig) __THROW; /* Set the disposition of SIG to SIG_IGN. */ extern int sigignore(int __sig) __THROW; /* Set the disposition of SIG. */ extern __sighandler_t sigset(int __sig, __sighandler_t __disp) __THROW; #endif #if defined __USE_POSIX199506 || defined __USE_UNIX98 /* Some of the functions for handling signals in threaded programs must be defined here. */ # include # include #endif /* use Unix98 */ /* The following functions are used internally in the C library and in other code which need deep insights. */ /* Return number of available real-time signal with highest priority. */ extern int __libc_current_sigrtmin(void) __THROW; /* Return number of available real-time signal with lowest priority. */ extern int __libc_current_sigrtmax(void) __THROW; #define SIGRTMIN (__libc_current_sigrtmin ()) #define SIGRTMAX (__libc_current_sigrtmax ()) __END_DECLS #endif /* not signal.h */ ================================================ FILE: v2/headers/linux_386/usr/include/stdc-predef.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STDC_PREDEF_H #define _STDC_PREDEF_H 1 /* This header is separate from features.h so that the compiler can include it implicitly at the start of every compilation. It must not itself include or any other header that includes because the implicit include comes before any feature test macros that may be defined in a source file before it first explicitly includes a system header. GCC knows the name of this header in order to preinclude it. */ /* glibc's intent is to support the IEC 559 math functionality, real and complex. If the GCC (4.9 and later) predefined macros specifying compiler intent are available, use them to determine whether the overall intent is to support these features; otherwise, presume an older compiler has intent to support these features and define these macros by default. */ #ifdef __GCC_IEC_559 # if __GCC_IEC_559 > 0 # define __STDC_IEC_559__ 1 # endif #else # define __STDC_IEC_559__ 1 #endif #ifdef __GCC_IEC_559_COMPLEX # if __GCC_IEC_559_COMPLEX > 0 # define __STDC_IEC_559_COMPLEX__ 1 # endif #else # define __STDC_IEC_559_COMPLEX__ 1 #endif /* wchar_t uses Unicode 10.0.0. Version 10.0 of the Unicode Standard is synchronized with ISO/IEC 10646:2017, fifth edition, plus the following additions from Amendment 1 to the fifth edition: - 56 emoji characters - 285 hentaigana - 3 additional Zanabazar Square characters */ #define __STDC_ISO_10646__ 201706L /* We do not support C11 . */ #define __STDC_NO_THREADS__ 1 #endif ================================================ FILE: v2/headers/linux_386/usr/include/stdint.h ================================================ /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99: 7.18 Integer types */ #ifndef _STDINT_H #define _STDINT_H 1 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include #include #include #include /* Exact integral types. */ /* Signed. */ #include /* Unsigned. */ #include /* Small types. */ /* Signed. */ typedef signed char int_least8_t; typedef short int int_least16_t; typedef int int_least32_t; #if __WORDSIZE == 64 typedef long int int_least64_t; #else __extension__ typedef long long int int_least64_t; #endif /* Unsigned. */ typedef unsigned char uint_least8_t; typedef unsigned short int uint_least16_t; typedef unsigned int uint_least32_t; #if __WORDSIZE == 64 typedef unsigned long int uint_least64_t; #else __extension__ typedef unsigned long long int uint_least64_t; #endif /* Fast types. */ /* Signed. */ typedef signed char int_fast8_t; #if __WORDSIZE == 64 typedef long int int_fast16_t; typedef long int int_fast32_t; typedef long int int_fast64_t; #else typedef int int_fast16_t; typedef int int_fast32_t; __extension__ typedef long long int int_fast64_t; #endif /* Unsigned. */ typedef unsigned char uint_fast8_t; #if __WORDSIZE == 64 typedef unsigned long int uint_fast16_t; typedef unsigned long int uint_fast32_t; typedef unsigned long int uint_fast64_t; #else typedef unsigned int uint_fast16_t; typedef unsigned int uint_fast32_t; __extension__ typedef unsigned long long int uint_fast64_t; #endif /* Types for `void *' pointers. */ #if __WORDSIZE == 64 # ifndef __intptr_t_defined typedef long int intptr_t; # define __intptr_t_defined # endif typedef unsigned long int uintptr_t; #else # ifndef __intptr_t_defined typedef int intptr_t; # define __intptr_t_defined # endif typedef unsigned int uintptr_t; #endif /* Largest integral types. */ typedef __intmax_t intmax_t; typedef __uintmax_t uintmax_t; # if __WORDSIZE == 64 # define __INT64_C(c) c ## L # define __UINT64_C(c) c ## UL # else # define __INT64_C(c) c ## LL # define __UINT64_C(c) c ## ULL # endif /* Limits of integral types. */ /* Minimum of signed integral types. */ # define INT8_MIN (-128) # define INT16_MIN (-32767-1) # define INT32_MIN (-2147483647-1) # define INT64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of signed integral types. */ # define INT8_MAX (127) # define INT16_MAX (32767) # define INT32_MAX (2147483647) # define INT64_MAX (__INT64_C(9223372036854775807)) /* Maximum of unsigned integral types. */ # define UINT8_MAX (255) # define UINT16_MAX (65535) # define UINT32_MAX (4294967295U) # define UINT64_MAX (__UINT64_C(18446744073709551615)) /* Minimum of signed integral types having a minimum size. */ # define INT_LEAST8_MIN (-128) # define INT_LEAST16_MIN (-32767-1) # define INT_LEAST32_MIN (-2147483647-1) # define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of signed integral types having a minimum size. */ # define INT_LEAST8_MAX (127) # define INT_LEAST16_MAX (32767) # define INT_LEAST32_MAX (2147483647) # define INT_LEAST64_MAX (__INT64_C(9223372036854775807)) /* Maximum of unsigned integral types having a minimum size. */ # define UINT_LEAST8_MAX (255) # define UINT_LEAST16_MAX (65535) # define UINT_LEAST32_MAX (4294967295U) # define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615)) /* Minimum of fast signed integral types having a minimum size. */ # define INT_FAST8_MIN (-128) # if __WORDSIZE == 64 # define INT_FAST16_MIN (-9223372036854775807L-1) # define INT_FAST32_MIN (-9223372036854775807L-1) # else # define INT_FAST16_MIN (-2147483647-1) # define INT_FAST32_MIN (-2147483647-1) # endif # define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of fast signed integral types having a minimum size. */ # define INT_FAST8_MAX (127) # if __WORDSIZE == 64 # define INT_FAST16_MAX (9223372036854775807L) # define INT_FAST32_MAX (9223372036854775807L) # else # define INT_FAST16_MAX (2147483647) # define INT_FAST32_MAX (2147483647) # endif # define INT_FAST64_MAX (__INT64_C(9223372036854775807)) /* Maximum of fast unsigned integral types having a minimum size. */ # define UINT_FAST8_MAX (255) # if __WORDSIZE == 64 # define UINT_FAST16_MAX (18446744073709551615UL) # define UINT_FAST32_MAX (18446744073709551615UL) # else # define UINT_FAST16_MAX (4294967295U) # define UINT_FAST32_MAX (4294967295U) # endif # define UINT_FAST64_MAX (__UINT64_C(18446744073709551615)) /* Values to test for integral types holding `void *' pointer. */ # if __WORDSIZE == 64 # define INTPTR_MIN (-9223372036854775807L-1) # define INTPTR_MAX (9223372036854775807L) # define UINTPTR_MAX (18446744073709551615UL) # else # define INTPTR_MIN (-2147483647-1) # define INTPTR_MAX (2147483647) # define UINTPTR_MAX (4294967295U) # endif /* Minimum for largest signed integral type. */ # define INTMAX_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum for largest signed integral type. */ # define INTMAX_MAX (__INT64_C(9223372036854775807)) /* Maximum for largest unsigned integral type. */ # define UINTMAX_MAX (__UINT64_C(18446744073709551615)) /* Limits of other integer types. */ /* Limits of `ptrdiff_t' type. */ # if __WORDSIZE == 64 # define PTRDIFF_MIN (-9223372036854775807L-1) # define PTRDIFF_MAX (9223372036854775807L) # else # if __WORDSIZE32_PTRDIFF_LONG # define PTRDIFF_MIN (-2147483647L-1) # define PTRDIFF_MAX (2147483647L) # else # define PTRDIFF_MIN (-2147483647-1) # define PTRDIFF_MAX (2147483647) # endif # endif /* Limits of `sig_atomic_t'. */ # define SIG_ATOMIC_MIN (-2147483647-1) # define SIG_ATOMIC_MAX (2147483647) /* Limit of `size_t' type. */ # if __WORDSIZE == 64 # define SIZE_MAX (18446744073709551615UL) # else # if __WORDSIZE32_SIZE_ULONG # define SIZE_MAX (4294967295UL) # else # define SIZE_MAX (4294967295U) # endif # endif /* Limits of `wchar_t'. */ # ifndef WCHAR_MIN /* These constants might also be defined in . */ # define WCHAR_MIN __WCHAR_MIN # define WCHAR_MAX __WCHAR_MAX # endif /* Limits of `wint_t'. */ # define WINT_MIN (0u) # define WINT_MAX (4294967295u) /* Signed. */ # define INT8_C(c) c # define INT16_C(c) c # define INT32_C(c) c # if __WORDSIZE == 64 # define INT64_C(c) c ## L # else # define INT64_C(c) c ## LL # endif /* Unsigned. */ # define UINT8_C(c) c # define UINT16_C(c) c # define UINT32_C(c) c ## U # if __WORDSIZE == 64 # define UINT64_C(c) c ## UL # else # define UINT64_C(c) c ## ULL # endif /* Maximal type. */ # if __WORDSIZE == 64 # define INTMAX_C(c) c ## L # define UINTMAX_C(c) c ## UL # else # define INTMAX_C(c) c ## LL # define UINTMAX_C(c) c ## ULL # endif #if __GLIBC_USE (IEC_60559_BFP_EXT) # define INT8_WIDTH 8 # define UINT8_WIDTH 8 # define INT16_WIDTH 16 # define UINT16_WIDTH 16 # define INT32_WIDTH 32 # define UINT32_WIDTH 32 # define INT64_WIDTH 64 # define UINT64_WIDTH 64 # define INT_LEAST8_WIDTH 8 # define UINT_LEAST8_WIDTH 8 # define INT_LEAST16_WIDTH 16 # define UINT_LEAST16_WIDTH 16 # define INT_LEAST32_WIDTH 32 # define UINT_LEAST32_WIDTH 32 # define INT_LEAST64_WIDTH 64 # define UINT_LEAST64_WIDTH 64 # define INT_FAST8_WIDTH 8 # define UINT_FAST8_WIDTH 8 # define INT_FAST16_WIDTH __WORDSIZE # define UINT_FAST16_WIDTH __WORDSIZE # define INT_FAST32_WIDTH __WORDSIZE # define UINT_FAST32_WIDTH __WORDSIZE # define INT_FAST64_WIDTH 64 # define UINT_FAST64_WIDTH 64 # define INTPTR_WIDTH __WORDSIZE # define UINTPTR_WIDTH __WORDSIZE # define INTMAX_WIDTH 64 # define UINTMAX_WIDTH 64 # define PTRDIFF_WIDTH __WORDSIZE # define SIG_ATOMIC_WIDTH 32 # define SIZE_WIDTH __WORDSIZE # define WCHAR_WIDTH 32 # define WINT_WIDTH 32 #endif #endif /* stdint.h */ ================================================ FILE: v2/headers/linux_386/usr/include/stdio.h ================================================ /* Define ISO C stdio on top of C++ iostreams. Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.19 Input/output */ #ifndef _STDIO_H #define _STDIO_H 1 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include __BEGIN_DECLS #define __need_size_t #define __need_NULL #include #include #include #include #define _STDIO_USES_IOSTREAM #include #if defined __USE_XOPEN || defined __USE_XOPEN2K8 # ifdef __GNUC__ # ifndef _VA_LIST_DEFINED typedef _G_va_list va_list; # define _VA_LIST_DEFINED # endif # else # include # endif #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K # ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined # endif # if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; # define __off64_t_defined # endif #endif #ifdef __USE_XOPEN2K8 # ifndef __ssize_t_defined typedef __ssize_t ssize_t; # define __ssize_t_defined # endif #endif /* The type of the second argument to `fgetpos' and `fsetpos'. */ #ifndef __USE_FILE_OFFSET64 typedef _G_fpos_t fpos_t; #else typedef _G_fpos64_t fpos_t; #endif #ifdef __USE_LARGEFILE64 typedef _G_fpos64_t fpos64_t; #endif /* The possibilities for the third argument to `setvbuf'. */ #define _IOFBF 0 /* Fully buffered. */ #define _IOLBF 1 /* Line buffered. */ #define _IONBF 2 /* No buffering. */ /* Default buffer size. */ #ifndef BUFSIZ # define BUFSIZ _IO_BUFSIZ #endif /* End of file character. Some things throughout the library rely on this being -1. */ #ifndef EOF # define EOF (-1) #endif /* The possibilities for the third argument to `fseek'. These values should not be changed. */ #define SEEK_SET 0 /* Seek from beginning of file. */ #define SEEK_CUR 1 /* Seek from current position. */ #define SEEK_END 2 /* Seek from end of file. */ #ifdef __USE_GNU # define SEEK_DATA 3 /* Seek to next data. */ # define SEEK_HOLE 4 /* Seek to next hole. */ #endif #if defined __USE_MISC || defined __USE_XOPEN /* Default path prefix for `tempnam' and `tmpnam'. */ # define P_tmpdir "/tmp" #endif /* Get the values: L_tmpnam How long an array of chars must be to be passed to `tmpnam'. TMP_MAX The minimum number of unique filenames generated by tmpnam (and tempnam when it uses tmpnam's name space), or tempnam (the two are separate). L_ctermid How long an array to pass to `ctermid'. L_cuserid How long an array to pass to `cuserid'. FOPEN_MAX Minimum number of files that can be open at once. FILENAME_MAX Maximum length of a filename. */ #include /* Standard streams. */ extern struct _IO_FILE *stdin; /* Standard input stream. */ extern struct _IO_FILE *stdout; /* Standard output stream. */ extern struct _IO_FILE *stderr; /* Standard error output stream. */ /* C89/C99 say they're macros. Make them happy. */ #define stdin stdin #define stdout stdout #define stderr stderr /* Remove file FILENAME. */ extern int remove(const char *__filename) __THROW; /* Rename file OLD to NEW. */ extern int rename(const char *__old, const char *__new) __THROW; #ifdef __USE_ATFILE /* Rename file OLD relative to OLDFD to NEW relative to NEWFD. */ extern int renameat(int __oldfd, const char *__old, int __newfd, const char *__new) __THROW; #endif /* Create a temporary file and open it read/write. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern FILE *tmpfile(void) __wur; #else # ifdef __REDIRECT extern FILE *__REDIRECT(tmpfile, (void), tmpfile64) __wur; # else # define tmpfile tmpfile64 # endif #endif #ifdef __USE_LARGEFILE64 extern FILE *tmpfile64(void) __wur; #endif /* Generate a temporary filename. */ extern char *tmpnam(char *__s) __THROW __wur; #ifdef __USE_MISC /* This is the reentrant variant of `tmpnam'. The only difference is that it does not allow S to be NULL. */ extern char *tmpnam_r(char *__s) __THROW __wur; #endif #if defined __USE_MISC || defined __USE_XOPEN /* Generate a unique temporary filename using up to five characters of PFX if it is not NULL. The directory to put this file in is searched for as follows: First the environment variable "TMPDIR" is checked. If it contains the name of a writable directory, that directory is used. If not and if DIR is not NULL, that value is checked. If that fails, P_tmpdir is tried and finally "/tmp". The storage for the filename is allocated by `malloc'. */ extern char *tempnam(const char *__dir, const char *__pfx) __THROW __attribute_malloc__ __wur; #endif /* Close STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fclose(FILE * __stream); /* Flush STREAM, or all streams if STREAM is NULL. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fflush(FILE * __stream); #ifdef __USE_MISC /* Faster versions when locking is not required. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fflush_unlocked(FILE * __stream); #endif #ifdef __USE_GNU /* Close all streams. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fcloseall(void); #endif #ifndef __USE_FILE_OFFSET64 /* Open a file and create a new stream for it. This function is a possible cancellation point and therefore not marked with __THROW. */ extern FILE *fopen(const char *__restrict __filename, const char *__restrict __modes) __wur; /* Open a file, replacing an existing stream with it. This function is a possible cancellation point and therefore not marked with __THROW. */ extern FILE *freopen(const char *__restrict __filename, const char *__restrict __modes, FILE * __restrict __stream) __wur; #else # ifdef __REDIRECT extern FILE *__REDIRECT(fopen, (const char *__restrict __filename, const char *__restrict __modes), fopen64) __wur; extern FILE *__REDIRECT(freopen, (const char *__restrict __filename, const char *__restrict __modes, FILE * __restrict __stream), freopen64) __wur; # else # define fopen fopen64 # define freopen freopen64 # endif #endif #ifdef __USE_LARGEFILE64 extern FILE *fopen64(const char *__restrict __filename, const char *__restrict __modes) __wur; extern FILE *freopen64(const char *__restrict __filename, const char *__restrict __modes, FILE * __restrict __stream) __wur; #endif #ifdef __USE_POSIX /* Create a new stream that refers to an existing system file descriptor. */ extern FILE *fdopen(int __fd, const char *__modes) __THROW __wur; #endif #ifdef __USE_GNU /* Create a new stream that refers to the given magic cookie, and uses the given functions for input and output. */ extern FILE *fopencookie(void *__restrict __magic_cookie, const char *__restrict __modes, _IO_cookie_io_functions_t __io_funcs) __THROW __wur; #endif #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) /* Create a new stream that refers to a memory buffer. */ extern FILE *fmemopen(void *__s, size_t __len, const char *__modes) __THROW __wur; /* Open a stream that writes into a malloc'd buffer that is expanded as necessary. *BUFLOC and *SIZELOC are updated with the buffer's location and the number of characters written on fflush or fclose. */ extern FILE *open_memstream(char **__bufloc, size_t * __sizeloc) __THROW __wur; #endif /* If BUF is NULL, make STREAM unbuffered. Else make it use buffer BUF, of size BUFSIZ. */ extern void setbuf(FILE * __restrict __stream, char *__restrict __buf) __THROW; /* Make STREAM use buffering mode MODE. If BUF is not NULL, use N bytes of it for buffering; else allocate an internal buffer N bytes long. */ extern int setvbuf(FILE * __restrict __stream, char *__restrict __buf, int __modes, size_t __n) __THROW; #ifdef __USE_MISC /* If BUF is NULL, make STREAM unbuffered. Else make it use SIZE bytes of BUF for buffering. */ extern void setbuffer(FILE * __restrict __stream, char *__restrict __buf, size_t __size) __THROW; /* Make STREAM line-buffered. */ extern void setlinebuf(FILE * __stream) __THROW; #endif /* Write formatted output to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fprintf(FILE * __restrict __stream, const char *__restrict __format, ...); /* Write formatted output to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int printf(const char *__restrict __format, ...); /* Write formatted output to S. */ extern int sprintf(char *__restrict __s, const char *__restrict __format, ...) __THROWNL; /* Write formatted output to S from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfprintf(FILE * __restrict __s, const char *__restrict __format, _G_va_list __arg); /* Write formatted output to stdout from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vprintf(const char *__restrict __format, _G_va_list __arg); /* Write formatted output to S from argument list ARG. */ extern int vsprintf(char *__restrict __s, const char *__restrict __format, _G_va_list __arg) __THROWNL; #if defined __USE_ISOC99 || defined __USE_UNIX98 /* Maximum chars of output to write in MAXLEN. */ extern int snprintf(char *__restrict __s, size_t __maxlen, const char *__restrict __format, ...) __THROWNL __attribute__ ((__format__(__printf__, 3, 4))); extern int vsnprintf(char *__restrict __s, size_t __maxlen, const char *__restrict __format, _G_va_list __arg) __THROWNL __attribute__ ((__format__(__printf__, 3, 0))); #endif #if __GLIBC_USE (LIB_EXT2) /* Write formatted output to a string dynamically allocated with `malloc'. Store the address of the string in *PTR. */ extern int vasprintf(char **__restrict __ptr, const char *__restrict __f, _G_va_list __arg) __THROWNL __attribute__ ((__format__(__printf__, 2, 0))) __wur; extern int __asprintf(char **__restrict __ptr, const char *__restrict __fmt, ...) __THROWNL __attribute__ ((__format__(__printf__, 2, 3))) __wur; extern int asprintf(char **__restrict __ptr, const char *__restrict __fmt, ...) __THROWNL __attribute__ ((__format__(__printf__, 2, 3))) __wur; #endif #ifdef __USE_XOPEN2K8 /* Write formatted output to a file descriptor. */ extern int vdprintf(int __fd, const char *__restrict __fmt, _G_va_list __arg) __attribute__ ((__format__(__printf__, 2, 0))); extern int dprintf(int __fd, const char *__restrict __fmt, ...) __attribute__ ((__format__(__printf__, 2, 3))); #endif /* Read formatted input from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fscanf(FILE * __restrict __stream, const char *__restrict __format, ...) __wur; /* Read formatted input from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int scanf(const char *__restrict __format, ...) __wur; /* Read formatted input from S. */ extern int sscanf(const char *__restrict __s, const char *__restrict __format, ...) __THROW; #if defined __USE_ISOC99 && !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT(fscanf, (FILE * __restrict __stream, const char *__restrict __format, ...), __isoc99_fscanf) __wur; extern int __REDIRECT(scanf, (const char *__restrict __format, ...), __isoc99_scanf) __wur; extern int __REDIRECT_NTH(sscanf, (const char *__restrict __s, const char *__restrict __format, ...), __isoc99_sscanf); # else extern int __isoc99_fscanf(FILE * __restrict __stream, const char *__restrict __format, ...) __wur; extern int __isoc99_scanf(const char *__restrict __format, ...) __wur; extern int __isoc99_sscanf(const char *__restrict __s, const char *__restrict __format, ...) __THROW; # define fscanf __isoc99_fscanf # define scanf __isoc99_scanf # define sscanf __isoc99_sscanf # endif #endif #ifdef __USE_ISOC99 /* Read formatted input from S into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfscanf(FILE * __restrict __s, const char *__restrict __format, _G_va_list __arg) __attribute__ ((__format__(__scanf__, 2, 0))) __wur; /* Read formatted input from stdin into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vscanf(const char *__restrict __format, _G_va_list __arg) __attribute__ ((__format__(__scanf__, 1, 0))) __wur; /* Read formatted input from S into argument list ARG. */ extern int vsscanf(const char *__restrict __s, const char *__restrict __format, _G_va_list __arg) __THROW __attribute__ ((__format__(__scanf__, 2, 0))); # if !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT(vfscanf, (FILE * __restrict __s, const char *__restrict __format, _G_va_list __arg), __isoc99_vfscanf) __attribute__ ((__format__(__scanf__, 2, 0))) __wur; extern int __REDIRECT(vscanf, (const char *__restrict __format, _G_va_list __arg), __isoc99_vscanf) __attribute__ ((__format__(__scanf__, 1, 0))) __wur; extern int __REDIRECT_NTH(vsscanf, (const char *__restrict __s, const char *__restrict __format, _G_va_list __arg), __isoc99_vsscanf) __attribute__ ((__format__(__scanf__, 2, 0))); # else extern int __isoc99_vfscanf(FILE * __restrict __s, const char *__restrict __format, _G_va_list __arg) __wur; extern int __isoc99_vscanf(const char *__restrict __format, _G_va_list __arg) __wur; extern int __isoc99_vsscanf(const char *__restrict __s, const char *__restrict __format, _G_va_list __arg) __THROW; # define vfscanf __isoc99_vfscanf # define vscanf __isoc99_vscanf # define vsscanf __isoc99_vsscanf # endif # endif #endif /* Use ISO C9x. */ /* Read a character from STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern int fgetc(FILE * __stream); extern int getc(FILE * __stream); /* Read a character from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getchar(void); /* The C standard explicitly says this is a macro, so we always do the optimization for it. */ #define getc(_fp) _IO_getc (_fp) #ifdef __USE_POSIX199506 /* These are defined in POSIX.1:1996. These functions are possible cancellation points and therefore not marked with __THROW. */ extern int getc_unlocked(FILE * __stream); extern int getchar_unlocked(void); #endif /* Use POSIX. */ #ifdef __USE_MISC /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fgetc_unlocked(FILE * __stream); #endif /* Use MISC. */ /* Write a character to STREAM. These functions are possible cancellation points and therefore not marked with __THROW. These functions is a possible cancellation point and therefore not marked with __THROW. */ extern int fputc(int __c, FILE * __stream); extern int putc(int __c, FILE * __stream); /* Write a character to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int putchar(int __c); /* The C standard explicitly says this can be a macro, so we always do the optimization for it. */ #define putc(_ch, _fp) _IO_putc (_ch, _fp) #ifdef __USE_MISC /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputc_unlocked(int __c, FILE * __stream); #endif /* Use MISC. */ #ifdef __USE_POSIX199506 /* These are defined in POSIX.1:1996. These functions are possible cancellation points and therefore not marked with __THROW. */ extern int putc_unlocked(int __c, FILE * __stream); extern int putchar_unlocked(int __c); #endif /* Use POSIX. */ #if defined __USE_MISC \ || (defined __USE_XOPEN && !defined __USE_XOPEN2K) /* Get a word (int) from STREAM. */ extern int getw(FILE * __stream); /* Write a word (int) to STREAM. */ extern int putw(int __w, FILE * __stream); #endif /* Get a newline-terminated string of finite length from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *fgets(char *__restrict __s, int __n, FILE * __restrict __stream) __wur; #if __GLIBC_USE (DEPRECATED_GETS) /* Get a newline-terminated string from stdin, removing the newline. This function is impossible to use safely. It has been officially removed from ISO C11 and ISO C++14, and we have also removed it from the _GNU_SOURCE feature list. It remains available when explicitly using an old ISO C, Unix, or POSIX standard. This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *gets(char *__s) __wur __attribute_deprecated__; #endif #ifdef __USE_GNU /* This function does the same as `fgets' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern char *fgets_unlocked(char *__restrict __s, int __n, FILE * __restrict __stream) __wur; #endif #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) /* Read up to (and including) a DELIMITER from STREAM into *LINEPTR (and null-terminate it). *LINEPTR is a pointer returned from malloc (or NULL), pointing to *N characters of space. It is realloc'd as necessary. Returns the number of characters read (not including the null terminator), or -1 on error or EOF. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern _IO_ssize_t __getdelim(char **__restrict __lineptr, size_t * __restrict __n, int __delimiter, FILE * __restrict __stream) __wur; extern _IO_ssize_t getdelim(char **__restrict __lineptr, size_t * __restrict __n, int __delimiter, FILE * __restrict __stream) __wur; /* Like `getdelim', but reads up to a newline. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern _IO_ssize_t getline(char **__restrict __lineptr, size_t * __restrict __n, FILE * __restrict __stream) __wur; #endif /* Write a string to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fputs(const char *__restrict __s, FILE * __restrict __stream); /* Write a string, followed by a newline, to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int puts(const char *__s); /* Push a character back onto the input buffer of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int ungetc(int __c, FILE * __stream); /* Read chunks of generic data from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern size_t fread(void *__restrict __ptr, size_t __size, size_t __n, FILE * __restrict __stream) __wur; /* Write chunks of generic data to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern size_t fwrite(const void *__restrict __ptr, size_t __size, size_t __n, FILE * __restrict __s); #ifdef __USE_GNU /* This function does the same as `fputs' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputs_unlocked(const char *__restrict __s, FILE * __restrict __stream); #endif #ifdef __USE_MISC /* Faster versions when locking is not necessary. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern size_t fread_unlocked(void *__restrict __ptr, size_t __size, size_t __n, FILE * __restrict __stream) __wur; extern size_t fwrite_unlocked(const void *__restrict __ptr, size_t __size, size_t __n, FILE * __restrict __stream); #endif /* Seek to a certain position on STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fseek(FILE * __stream, long int __off, int __whence); /* Return the current position of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern long int ftell(FILE * __stream) __wur; /* Rewind to the beginning of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void rewind(FILE * __stream); /* The Single Unix Specification, Version 2, specifies an alternative, more adequate interface for the two functions above which deal with file offset. `long int' is not the right type. These definitions are originally defined in the Large File Support API. */ #if defined __USE_LARGEFILE || defined __USE_XOPEN2K # ifndef __USE_FILE_OFFSET64 /* Seek to a certain position on STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fseeko(FILE * __stream, __off_t __off, int __whence); /* Return the current position of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern __off_t ftello(FILE * __stream) __wur; # else # ifdef __REDIRECT extern int __REDIRECT(fseeko, (FILE * __stream, __off64_t __off, int __whence), fseeko64); extern __off64_t __REDIRECT(ftello, (FILE * __stream), ftello64); # else # define fseeko fseeko64 # define ftello ftello64 # endif # endif #endif #ifndef __USE_FILE_OFFSET64 /* Get STREAM's position. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fgetpos(FILE * __restrict __stream, fpos_t * __restrict __pos); /* Set STREAM's position. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fsetpos(FILE * __stream, const fpos_t * __pos); #else # ifdef __REDIRECT extern int __REDIRECT(fgetpos, (FILE * __restrict __stream, fpos_t * __restrict __pos), fgetpos64); extern int __REDIRECT(fsetpos, (FILE * __stream, const fpos_t * __pos), fsetpos64); # else # define fgetpos fgetpos64 # define fsetpos fsetpos64 # endif #endif #ifdef __USE_LARGEFILE64 extern int fseeko64(FILE * __stream, __off64_t __off, int __whence); extern __off64_t ftello64(FILE * __stream) __wur; extern int fgetpos64(FILE * __restrict __stream, fpos64_t * __restrict __pos); extern int fsetpos64(FILE * __stream, const fpos64_t * __pos); #endif /* Clear the error and EOF indicators for STREAM. */ extern void clearerr(FILE * __stream) __THROW; /* Return the EOF indicator for STREAM. */ extern int feof(FILE * __stream) __THROW __wur; /* Return the error indicator for STREAM. */ extern int ferror(FILE * __stream) __THROW __wur; #ifdef __USE_MISC /* Faster versions when locking is not required. */ extern void clearerr_unlocked(FILE * __stream) __THROW; extern int feof_unlocked(FILE * __stream) __THROW __wur; extern int ferror_unlocked(FILE * __stream) __THROW __wur; #endif /* Print a message describing the meaning of the value of errno. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void perror(const char *__s); /* Provide the declarations for `sys_errlist' and `sys_nerr' if they are available on this system. Even if available, these variables should not be used directly. The `strerror' function provides all the necessary functionality. */ #include #ifdef __USE_POSIX /* Return the system file descriptor for STREAM. */ extern int fileno(FILE * __stream) __THROW __wur; #endif /* Use POSIX. */ #ifdef __USE_MISC /* Faster version when locking is not required. */ extern int fileno_unlocked(FILE * __stream) __THROW __wur; #endif #ifdef __USE_POSIX2 /* Create a new stream connected to a pipe running the given command. This function is a possible cancellation point and therefore not marked with __THROW. */ extern FILE *popen(const char *__command, const char *__modes) __wur; /* Close a stream opened by popen and return the status of its child. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int pclose(FILE * __stream); #endif #ifdef __USE_POSIX /* Return the name of the controlling terminal. */ extern char *ctermid(char *__s) __THROW; #endif /* Use POSIX. */ #if (defined __USE_XOPEN && !defined __USE_XOPEN2K) || defined __USE_GNU /* Return the name of the current user. */ extern char *cuserid(char *__s); #endif /* Use X/Open, but not issue 6. */ #ifdef __USE_GNU struct obstack; /* See . */ /* Write formatted output to an obstack. */ extern int obstack_printf(struct obstack *__restrict __obstack, const char *__restrict __format, ...) __THROWNL __attribute__ ((__format__(__printf__, 2, 3))); extern int obstack_vprintf(struct obstack *__restrict __obstack, const char *__restrict __format, _G_va_list __args) __THROWNL __attribute__ ((__format__(__printf__, 2, 0))); #endif /* Use GNU. */ #ifdef __USE_POSIX199506 /* These are defined in POSIX.1:1996. */ /* Acquire ownership of STREAM. */ extern void flockfile(FILE * __stream) __THROW; /* Try to acquire ownership of STREAM but do not block if it is not possible. */ extern int ftrylockfile(FILE * __stream) __THROW __wur; /* Relinquish the ownership granted for STREAM. */ extern void funlockfile(FILE * __stream) __THROW; #endif /* POSIX */ #if defined __USE_XOPEN && !defined __USE_XOPEN2K && !defined __USE_GNU /* X/Open Issues 1-5 required getopt to be declared in this header. It was removed in Issue 6. GNU follows Issue 6. */ # include #endif /* If we are compiling with optimizing read this file. It contains several optimizing inline functions and macros. */ #ifdef __USE_EXTERN_INLINES # include #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif #ifdef __LDBL_COMPAT # include #endif __END_DECLS #endif /* included. */ ================================================ FILE: v2/headers/linux_386/usr/include/stdlib.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.20 General utilities */ #ifndef _STDLIB_H #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include /* Get size_t, wchar_t and NULL from . */ #define __need_size_t #define __need_wchar_t #define __need_NULL #include __BEGIN_DECLS #define _STDLIB_H 1 #if (defined __USE_XOPEN || defined __USE_XOPEN2K8) && !defined _SYS_WAIT_H /* XPG requires a few symbols from being defined. */ # include # include /* Define the macros also would define this way. */ # define WEXITSTATUS(status) __WEXITSTATUS (status) # define WTERMSIG(status) __WTERMSIG (status) # define WSTOPSIG(status) __WSTOPSIG (status) # define WIFEXITED(status) __WIFEXITED (status) # define WIFSIGNALED(status) __WIFSIGNALED (status) # define WIFSTOPPED(status) __WIFSTOPPED (status) # ifdef __WIFCONTINUED # define WIFCONTINUED(status) __WIFCONTINUED (status) # endif #endif /* X/Open or XPG7 and not included. */ /* _FloatN API tests for enablement. */ #include /* Returned by `div'. */ typedef struct { int quot; /* Quotient. */ int rem; /* Remainder. */ } div_t; /* Returned by `ldiv'. */ #ifndef __ldiv_t_defined typedef struct { long int quot; /* Quotient. */ long int rem; /* Remainder. */ } ldiv_t; # define __ldiv_t_defined 1 #endif #if defined __USE_ISOC99 && !defined __lldiv_t_defined /* Returned by `lldiv'. */ __extension__ typedef struct { long long int quot; /* Quotient. */ long long int rem; /* Remainder. */ } lldiv_t; # define __lldiv_t_defined 1 #endif /* The largest number rand will return (same as INT_MAX). */ #define RAND_MAX 2147483647 /* We define these the same for all machines. Changes from this to the outside world should be done in `_exit'. */ #define EXIT_FAILURE 1 /* Failing exit status. */ #define EXIT_SUCCESS 0 /* Successful exit status. */ /* Maximum length of a multibyte character in the current locale. */ #define MB_CUR_MAX (__ctype_get_mb_cur_max ()) extern size_t __ctype_get_mb_cur_max(void) __THROW __wur; /* Convert a string to a floating-point number. */ extern double atof(const char *__nptr) __THROW __attribute_pure__ __nonnull((1)) __wur; /* Convert a string to an integer. */ extern int atoi(const char *__nptr) __THROW __attribute_pure__ __nonnull((1)) __wur; /* Convert a string to a long integer. */ extern long int atol(const char *__nptr) __THROW __attribute_pure__ __nonnull((1)) __wur; #ifdef __USE_ISOC99 /* Convert a string to a long long integer. */ __extension__ extern long long int atoll(const char *__nptr) __THROW __attribute_pure__ __nonnull((1)) __wur; #endif /* Convert a string to a floating-point number. */ extern double strtod(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); #ifdef __USE_ISOC99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float strtof(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); extern long double strtold(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); #endif /* Likewise for '_FloatN' and '_FloatNx'. */ #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT) extern _Float16 strtof16(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); #endif #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT) extern _Float32 strtof32(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); #endif #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT) extern _Float64 strtof64(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); #endif #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT) extern _Float128 strtof128(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); #endif #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT) extern _Float32x strtof32x(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); #endif #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT) extern _Float64x strtof64x(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); #endif #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT) extern _Float128x strtof128x(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); #endif /* Convert a string to a long integer. */ extern long int strtol(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); /* Convert a string to an unsigned long integer. */ extern unsigned long int strtoul(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); #ifdef __USE_MISC /* Convert a string to a quadword integer. */ __extension__ extern long long int strtoq(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); /* Convert a string to an unsigned quadword integer. */ __extension__ extern unsigned long long int strtouq(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); #endif /* Use misc. */ #ifdef __USE_ISOC99 /* Convert a string to a quadword integer. */ __extension__ extern long long int strtoll(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); /* Convert a string to an unsigned quadword integer. */ __extension__ extern unsigned long long int strtoull(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); #endif /* ISO C99 or use MISC. */ /* Convert a floating-point number to a string. */ #if __GLIBC_USE (IEC_60559_BFP_EXT) extern int strfromd(char *__dest, size_t __size, const char *__format, double __f) __THROW __nonnull((3)); extern int strfromf(char *__dest, size_t __size, const char *__format, float __f) __THROW __nonnull((3)); extern int strfroml(char *__dest, size_t __size, const char *__format, long double __f) __THROW __nonnull((3)); #endif #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT) extern int strfromf16(char *__dest, size_t __size, const char *__format, _Float16 __f) __THROW __nonnull((3)); #endif #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT) extern int strfromf32(char *__dest, size_t __size, const char *__format, _Float32 __f) __THROW __nonnull((3)); #endif #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT) extern int strfromf64(char *__dest, size_t __size, const char *__format, _Float64 __f) __THROW __nonnull((3)); #endif #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT) extern int strfromf128(char *__dest, size_t __size, const char *__format, _Float128 __f) __THROW __nonnull((3)); #endif #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT) extern int strfromf32x(char *__dest, size_t __size, const char *__format, _Float32x __f) __THROW __nonnull((3)); #endif #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT) extern int strfromf64x(char *__dest, size_t __size, const char *__format, _Float64x __f) __THROW __nonnull((3)); #endif #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT) extern int strfromf128x(char *__dest, size_t __size, const char *__format, _Float128x __f) __THROW __nonnull((3)); #endif #ifdef __USE_GNU /* Parallel versions of the functions above which take the locale to use as an additional parameter. These are GNU extensions inspired by the POSIX.1-2008 extended locale API. */ # include extern long int strtol_l(const char *__restrict __nptr, char **__restrict __endptr, int __base, locale_t __loc) __THROW __nonnull((1, 4)); extern unsigned long int strtoul_l(const char *__restrict __nptr, char **__restrict __endptr, int __base, locale_t __loc) __THROW __nonnull((1, 4)); __extension__ extern long long int strtoll_l(const char *__restrict __nptr, char **__restrict __endptr, int __base, locale_t __loc) __THROW __nonnull((1, 4)); __extension__ extern unsigned long long int strtoull_l(const char *__restrict __nptr, char **__restrict __endptr, int __base, locale_t __loc) __THROW __nonnull((1, 4)); extern double strtod_l(const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) __THROW __nonnull((1, 3)); extern float strtof_l(const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) __THROW __nonnull((1, 3)); extern long double strtold_l(const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) __THROW __nonnull((1, 3)); # if __HAVE_FLOAT16 extern _Float16 strtof16_l(const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) __THROW __nonnull((1, 3)); # endif # if __HAVE_FLOAT32 extern _Float32 strtof32_l(const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) __THROW __nonnull((1, 3)); # endif # if __HAVE_FLOAT64 extern _Float64 strtof64_l(const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) __THROW __nonnull((1, 3)); # endif # if __HAVE_FLOAT128 extern _Float128 strtof128_l(const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) __THROW __nonnull((1, 3)); # endif # if __HAVE_FLOAT32X extern _Float32x strtof32x_l(const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) __THROW __nonnull((1, 3)); # endif # if __HAVE_FLOAT64X extern _Float64x strtof64x_l(const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) __THROW __nonnull((1, 3)); # endif # if __HAVE_FLOAT128X extern _Float128x strtof128x_l(const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) __THROW __nonnull((1, 3)); # endif #endif /* GNU */ #ifdef __USE_EXTERN_INLINES __extern_inline int __NTH(atoi(const char *__nptr)) { return (int)strtol(__nptr, (char **)NULL, 10); } __extern_inline long int __NTH(atol(const char *__nptr)) { return strtol(__nptr, (char **)NULL, 10); } # ifdef __USE_ISOC99 __extension__ __extern_inline long long int __NTH(atoll(const char *__nptr)) { return strtoll(__nptr, (char **)NULL, 10); } # endif #endif /* Optimizing and Inlining. */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Convert N to base 64 using the digits "./0-9A-Za-z", least-significant digit first. Returns a pointer to static storage overwritten by the next call. */ extern char *l64a(long int __n) __THROW __wur; /* Read a number from a string S in base 64 as above. */ extern long int a64l(const char *__s) __THROW __attribute_pure__ __nonnull((1)) __wur; #endif /* Use misc || extended X/Open. */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED # include /* we need int32_t... */ /* These are the functions that actually do things. The `random', `srandom', `initstate' and `setstate' functions are those from BSD Unices. The `rand' and `srand' functions are required by the ANSI standard. We provide both interfaces to the same random number generator. */ /* Return a random long integer between 0 and RAND_MAX inclusive. */ extern long int random(void) __THROW; /* Seed the random number generator with the given number. */ extern void srandom(unsigned int __seed) __THROW; /* Initialize the random number generator to use state buffer STATEBUF, of length STATELEN, and seed it with SEED. Optimal lengths are 8, 16, 32, 64, 128 and 256, the bigger the better; values less than 8 will cause an error and values greater than 256 will be rounded down. */ extern char *initstate(unsigned int __seed, char *__statebuf, size_t __statelen) __THROW __nonnull((2)); /* Switch the random number generator to state buffer STATEBUF, which should have been previously initialized by `initstate'. */ extern char *setstate(char *__statebuf) __THROW __nonnull((1)); # ifdef __USE_MISC /* Reentrant versions of the `random' family of functions. These functions all use the following data structure to contain state, rather than global state variables. */ struct random_data { int32_t *fptr; /* Front pointer. */ int32_t *rptr; /* Rear pointer. */ int32_t *state; /* Array of state values. */ int rand_type; /* Type of random number generator. */ int rand_deg; /* Degree of random number generator. */ int rand_sep; /* Distance between front and rear. */ int32_t *end_ptr; /* Pointer behind state table. */ }; extern int random_r(struct random_data *__restrict __buf, int32_t * __restrict __result) __THROW __nonnull((1, 2)); extern int srandom_r(unsigned int __seed, struct random_data *__buf) __THROW __nonnull((2)); extern int initstate_r(unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) __THROW __nonnull((2, 4)); extern int setstate_r(char *__restrict __statebuf, struct random_data *__restrict __buf) __THROW __nonnull((1, 2)); # endif /* Use misc. */ #endif /* Use extended X/Open || misc. */ /* Return a random integer between 0 and RAND_MAX inclusive. */ extern int rand(void) __THROW; /* Seed the random number generator with the given number. */ extern void srand(unsigned int __seed) __THROW; #ifdef __USE_POSIX199506 /* Reentrant interface according to POSIX.1. */ extern int rand_r(unsigned int *__seed) __THROW; #endif #if defined __USE_MISC || defined __USE_XOPEN /* System V style 48-bit random number generator functions. */ /* Return non-negative, double-precision floating-point value in [0.0,1.0). */ extern double drand48(void) __THROW; extern double erand48(unsigned short int __xsubi[3]) __THROW __nonnull((1)); /* Return non-negative, long integer in [0,2^31). */ extern long int lrand48(void) __THROW; extern long int nrand48(unsigned short int __xsubi[3]) __THROW __nonnull((1)); /* Return signed, long integers in [-2^31,2^31). */ extern long int mrand48(void) __THROW; extern long int jrand48(unsigned short int __xsubi[3]) __THROW __nonnull((1)); /* Seed random number generator. */ extern void srand48(long int __seedval) __THROW; extern unsigned short int *seed48(unsigned short int __seed16v[3]) __THROW __nonnull((1)); extern void lcong48(unsigned short int __param[7]) __THROW __nonnull((1)); # ifdef __USE_MISC /* Data structure for communication with thread safe versions. This type is to be regarded as opaque. It's only exported because users have to allocate objects of this type. */ struct drand48_data { unsigned short int __x[3]; /* Current state. */ unsigned short int __old_x[3]; /* Old state. */ unsigned short int __c; /* Additive const. in congruential formula. */ unsigned short int __init; /* Flag for initializing. */ __extension__ unsigned long long int __a; /* Factor in congruential formula. */ }; /* Return non-negative, double-precision floating-point value in [0.0,1.0). */ extern int drand48_r(struct drand48_data *__restrict __buffer, double *__restrict __result) __THROW __nonnull((1, 2)); extern int erand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) __THROW __nonnull((1, 2)); /* Return non-negative, long integer in [0,2^31). */ extern int lrand48_r(struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull((1, 2)); extern int nrand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull((1, 2)); /* Return signed, long integers in [-2^31,2^31). */ extern int mrand48_r(struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull((1, 2)); extern int jrand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull((1, 2)); /* Seed random number generator. */ extern int srand48_r(long int __seedval, struct drand48_data *__buffer) __THROW __nonnull((2)); extern int seed48_r(unsigned short int __seed16v[3], struct drand48_data *__buffer) __THROW __nonnull((1, 2)); extern int lcong48_r(unsigned short int __param[7], struct drand48_data *__buffer) __THROW __nonnull((1, 2)); # endif /* Use misc. */ #endif /* Use misc or X/Open. */ /* Allocate SIZE bytes of memory. */ extern void *malloc(size_t __size) __THROW __attribute_malloc__ __wur; /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ extern void *calloc(size_t __nmemb, size_t __size) __THROW __attribute_malloc__ __wur; /* Re-allocate the previously allocated block in PTR, making the new block SIZE bytes long. */ /* __attribute_malloc__ is not used, because if realloc returns the same pointer that was passed to it, aliasing needs to be allowed between objects pointed by the old and new pointers. */ extern void *realloc(void *__ptr, size_t __size) __THROW __attribute_warn_unused_result__; #ifdef __USE_GNU /* Re-allocate the previously allocated block in PTR, making the new block large enough for NMEMB elements of SIZE bytes each. */ /* __attribute_malloc__ is not used, because if reallocarray returns the same pointer that was passed to it, aliasing needs to be allowed between objects pointed by the old and new pointers. */ extern void *reallocarray(void *__ptr, size_t __nmemb, size_t __size) __THROW __attribute_warn_unused_result__; #endif /* Free a block allocated by `malloc', `realloc' or `calloc'. */ extern void free(void *__ptr) __THROW; #ifdef __USE_MISC # include #endif /* Use misc. */ #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \ || defined __USE_MISC /* Allocate SIZE bytes on a page boundary. The storage cannot be freed. */ extern void *valloc(size_t __size) __THROW __attribute_malloc__ __wur; #endif #ifdef __USE_XOPEN2K /* Allocate memory of SIZE bytes with an alignment of ALIGNMENT. */ extern int posix_memalign(void **__memptr, size_t __alignment, size_t __size) __THROW __nonnull((1)) __wur; #endif #ifdef __USE_ISOC11 /* ISO C variant of aligned allocation. */ extern void *aligned_alloc(size_t __alignment, size_t __size) __THROW __attribute_malloc__ __attribute_alloc_size__((2)) __wur; #endif /* Abort execution and generate a core-dump. */ extern void abort(void) __THROW __attribute__ ((__noreturn__)); /* Register a function to be called when `exit' is called. */ extern int atexit(void (*__func) (void)) __THROW __nonnull((1)); #if defined __USE_ISOC11 || defined __USE_ISOCXX11 /* Register a function to be called when `quick_exit' is called. */ # ifdef __cplusplus extern "C++" int at_quick_exit(void (*__func) (void)) __THROW __asm("at_quick_exit") __nonnull((1)); # else extern int at_quick_exit(void (*__func) (void)) __THROW __nonnull((1)); # endif #endif #ifdef __USE_MISC /* Register a function to be called with the status given to `exit' and the given argument. */ extern int on_exit(void (*__func) (int __status, void *__arg), void *__arg) __THROW __nonnull((1)); #endif /* Call all functions registered with `atexit' and `on_exit', in the reverse of the order in which they were registered, perform stdio cleanup, and terminate program execution with STATUS. */ extern void exit(int __status) __THROW __attribute__ ((__noreturn__)); #if defined __USE_ISOC11 || defined __USE_ISOCXX11 /* Call all functions registered with `at_quick_exit' in the reverse of the order in which they were registered and terminate program execution with STATUS. */ extern void quick_exit(int __status) __THROW __attribute__ ((__noreturn__)); #endif #ifdef __USE_ISOC99 /* Terminate the program with STATUS without calling any of the functions registered with `atexit' or `on_exit'. */ extern void _Exit(int __status) __THROW __attribute__ ((__noreturn__)); #endif /* Return the value of envariable NAME, or NULL if it doesn't exist. */ extern char *getenv(const char *__name) __THROW __nonnull((1)) __wur; #ifdef __USE_GNU /* This function is similar to the above but returns NULL if the programs is running with SUID or SGID enabled. */ extern char *secure_getenv(const char *__name) __THROW __nonnull((1)) __wur; #endif #if defined __USE_MISC || defined __USE_XOPEN /* The SVID says this is in , but this seems a better place. */ /* Put STRING, which is of the form "NAME=VALUE", in the environment. If there is no `=', remove NAME from the environment. */ extern int putenv(char *__string) __THROW __nonnull((1)); #endif #ifdef __USE_XOPEN2K /* Set NAME to VALUE in the environment. If REPLACE is nonzero, overwrite an existing value. */ extern int setenv(const char *__name, const char *__value, int __replace) __THROW __nonnull((2)); /* Remove the variable NAME from the environment. */ extern int unsetenv(const char *__name) __THROW __nonnull((1)); #endif #ifdef __USE_MISC /* The `clearenv' was planned to be added to POSIX.1 but probably never made it. Nevertheless the POSIX.9 standard (POSIX bindings for Fortran 77) requires this function. */ extern int clearenv(void) __THROW; #endif #if defined __USE_MISC \ || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) /* Generate a unique temporary file name from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the file name unique. Always returns TEMPLATE, it's either a temporary file name or a null string if it cannot get a unique file name. */ extern char *mktemp(char *__template) __THROW __nonnull((1)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Generate a unique temporary file name from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the filename unique. Returns a file descriptor open on the file for reading and writing, or -1 if it cannot create a uniquely-named file. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int mkstemp(char *__template) __nonnull((1)) __wur; # else # ifdef __REDIRECT extern int __REDIRECT(mkstemp, (char *__template), mkstemp64) __nonnull((1)) __wur; # else # define mkstemp mkstemp64 # endif # endif # ifdef __USE_LARGEFILE64 extern int mkstemp64(char *__template) __nonnull((1)) __wur; # endif #endif #ifdef __USE_MISC /* Similar to mkstemp, but the template can have a suffix after the XXXXXX. The length of the suffix is specified in the second parameter. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int mkstemps(char *__template, int __suffixlen) __nonnull((1)) __wur; # else # ifdef __REDIRECT extern int __REDIRECT(mkstemps, (char *__template, int __suffixlen), mkstemps64) __nonnull((1)) __wur; # else # define mkstemps mkstemps64 # endif # endif # ifdef __USE_LARGEFILE64 extern int mkstemps64(char *__template, int __suffixlen) __nonnull((1)) __wur; # endif #endif #ifdef __USE_XOPEN2K8 /* Create a unique temporary directory from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the directory name unique. Returns TEMPLATE, or a null pointer if it cannot get a unique name. The directory is created mode 700. */ extern char *mkdtemp(char *__template) __THROW __nonnull((1)) __wur; #endif #ifdef __USE_GNU /* Generate a unique temporary file name from TEMPLATE similar to mkstemp. But allow the caller to pass additional flags which are used in the open call to create the file.. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int mkostemp(char *__template, int __flags) __nonnull((1)) __wur; # else # ifdef __REDIRECT extern int __REDIRECT(mkostemp, (char *__template, int __flags), mkostemp64) __nonnull((1)) __wur; # else # define mkostemp mkostemp64 # endif # endif # ifdef __USE_LARGEFILE64 extern int mkostemp64(char *__template, int __flags) __nonnull((1)) __wur; # endif /* Similar to mkostemp, but the template can have a suffix after the XXXXXX. The length of the suffix is specified in the second parameter. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int mkostemps(char *__template, int __suffixlen, int __flags) __nonnull((1)) __wur; # else # ifdef __REDIRECT extern int __REDIRECT(mkostemps, (char *__template, int __suffixlen, int __flags), mkostemps64) __nonnull((1)) __wur; # else # define mkostemps mkostemps64 # endif # endif # ifdef __USE_LARGEFILE64 extern int mkostemps64(char *__template, int __suffixlen, int __flags) __nonnull((1)) __wur; # endif #endif /* Execute the given line as a shell command. This function is a cancellation point and therefore not marked with __THROW. */ extern int system(const char *__command) __wur; #ifdef __USE_GNU /* Return a malloc'd string containing the canonical absolute name of the existing named file. */ extern char *canonicalize_file_name(const char *__name) __THROW __nonnull((1)) __wur; #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Return the canonical absolute name of file NAME. If RESOLVED is null, the result is malloc'd; otherwise, if the canonical name is PATH_MAX chars or more, returns null with `errno' set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, returns the name in RESOLVED. */ extern char *realpath(const char *__restrict __name, char *__restrict __resolved) __THROW __wur; #endif /* Shorthand for type of comparison functions. */ #ifndef __COMPAR_FN_T # define __COMPAR_FN_T typedef int (*__compar_fn_t) (const void *, const void *); # ifdef __USE_GNU typedef __compar_fn_t comparison_fn_t; # endif #endif #ifdef __USE_GNU typedef int (*__compar_d_fn_t) (const void *, const void *, void *); #endif /* Do a binary search for KEY in BASE, which consists of NMEMB elements of SIZE bytes each, using COMPAR to perform the comparisons. */ extern void *bsearch(const void *__key, const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __nonnull((1, 2, 5)) __wur; #ifdef __USE_EXTERN_INLINES # include #endif /* Sort NMEMB elements of BASE, of SIZE bytes each, using COMPAR to perform the comparisons. */ extern void qsort(void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __nonnull((1, 4)); #ifdef __USE_GNU extern void qsort_r(void *__base, size_t __nmemb, size_t __size, __compar_d_fn_t __compar, void *__arg) __nonnull((1, 4)); #endif /* Return the absolute value of X. */ extern int abs(int __x) __THROW __attribute__ ((__const__)) __wur; extern long int labs(long int __x) __THROW __attribute__ ((__const__)) __wur; #ifdef __USE_ISOC99 __extension__ extern long long int llabs(long long int __x) __THROW __attribute__ ((__const__)) __wur; #endif /* Return the `div_t', `ldiv_t' or `lldiv_t' representation of the value of NUMER over DENOM. */ /* GCC may have built-ins for these someday. */ extern div_t div(int __numer, int __denom) __THROW __attribute__ ((__const__)) __wur; extern ldiv_t ldiv(long int __numer, long int __denom) __THROW __attribute__ ((__const__)) __wur; #ifdef __USE_ISOC99 __extension__ extern lldiv_t lldiv(long long int __numer, long long int __denom) __THROW __attribute__ ((__const__)) __wur; #endif #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_MISC /* Convert floating point numbers to strings. The returned values are valid only until another call to the same function. */ /* Convert VALUE to a string with NDIGIT digits and return a pointer to this. Set *DECPT with the position of the decimal character and *SIGN with the sign of the number. */ extern char *ecvt(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull((3, 4)) __wur; /* Convert VALUE to a string rounded to NDIGIT decimal digits. Set *DECPT with the position of the decimal character and *SIGN with the sign of the number. */ extern char *fcvt(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull((3, 4)) __wur; /* If possible convert VALUE to a string with NDIGIT significant digits. Otherwise use exponential representation. The resulting string will be written to BUF. */ extern char *gcvt(double __value, int __ndigit, char *__buf) __THROW __nonnull((3)) __wur; #endif #ifdef __USE_MISC /* Long double versions of above functions. */ extern char *qecvt(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull((3, 4)) __wur; extern char *qfcvt(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull((3, 4)) __wur; extern char *qgcvt(long double __value, int __ndigit, char *__buf) __THROW __nonnull((3)) __wur; /* Reentrant version of the functions above which provide their own buffers. */ extern int ecvt_r(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull((3, 4, 5)); extern int fcvt_r(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull((3, 4, 5)); extern int qecvt_r(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull((3, 4, 5)); extern int qfcvt_r(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull((3, 4, 5)); #endif /* misc */ /* Return the length of the multibyte character in S, which is no longer than N. */ extern int mblen(const char *__s, size_t __n) __THROW; /* Return the length of the given multibyte character, putting its `wchar_t' representation in *PWC. */ extern int mbtowc(wchar_t * __restrict __pwc, const char *__restrict __s, size_t __n) __THROW; /* Put the multibyte character represented by WCHAR in S, returning its length. */ extern int wctomb(char *__s, wchar_t __wchar) __THROW; /* Convert a multibyte string to a wide char string. */ extern size_t mbstowcs(wchar_t * __restrict __pwcs, const char *__restrict __s, size_t __n) __THROW; /* Convert a wide char string to multibyte string. */ extern size_t wcstombs(char *__restrict __s, const wchar_t * __restrict __pwcs, size_t __n) __THROW; #ifdef __USE_MISC /* Determine whether the string value of RESPONSE matches the affirmation or negative response expression as specified by the LC_MESSAGES category in the program's current locale. Returns 1 if affirmative, 0 if negative, and -1 if not matching. */ extern int rpmatch(const char *__response) __THROW __nonnull((1)) __wur; #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Parse comma separated suboption from *OPTIONP and match against strings in TOKENS. If found return index and set *VALUEP to optional value introduced by an equal sign. If the suboption is not part of TOKENS return in *VALUEP beginning of unknown suboption. On exit *OPTIONP is set to the beginning of the next token or at the terminating NUL character. */ extern int getsubopt(char **__restrict __optionp, char *const *__restrict __tokens, char **__restrict __valuep) __THROW __nonnull((1, 2, 3)) __wur; #endif #ifdef __USE_XOPEN /* Setup DES tables according KEY. */ extern void setkey(const char *__key) __THROW __nonnull((1)); #endif /* X/Open pseudo terminal handling. */ #ifdef __USE_XOPEN2KXSI /* Return a master pseudo-terminal handle. */ extern int posix_openpt(int __oflag) __wur; #endif #ifdef __USE_XOPEN_EXTENDED /* The next four functions all take a master pseudo-tty fd and perform an operation on the associated slave: */ /* Chown the slave to the calling user. */ extern int grantpt(int __fd) __THROW; /* Release an internal lock so the slave can be opened. Call after grantpt(). */ extern int unlockpt(int __fd) __THROW; /* Return the pathname of the pseudo terminal slave associated with the master FD is open on, or NULL on errors. The returned storage is good until the next call to this function. */ extern char *ptsname(int __fd) __THROW __wur; #endif #ifdef __USE_GNU /* Store at most BUFLEN characters of the pathname of the slave pseudo terminal associated with the master FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ptsname_r(int __fd, char *__buf, size_t __buflen) __THROW __nonnull((2)); /* Open a master pseudo terminal and return its file descriptor. */ extern int getpt(void); #endif #ifdef __USE_MISC /* Put the 1 minute, 5 minute and 15 minute load averages into the first NELEM elements of LOADAVG. Return the number written (never more than three, but may be less than NELEM), or -1 if an error occurred. */ extern int getloadavg(double __loadavg[], int __nelem) __THROW __nonnull((1)); #endif #if defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K /* Return the index into the active-logins file (utmp) for the controlling terminal. */ extern int ttyslot(void) __THROW; #endif #include /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif #ifdef __LDBL_COMPAT # include #endif __END_DECLS #endif /* stdlib.h */ ================================================ FILE: v2/headers/linux_386/usr/include/string.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.21 String handling */ #ifndef _STRING_H #define _STRING_H 1 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include __BEGIN_DECLS /* Get size_t and NULL from . */ #define __need_size_t #define __need_NULL #include /* Tell the caller that we provide correct C++ prototypes. */ #if defined __cplusplus && __GNUC_PREREQ (4, 4) # define __CORRECT_ISO_CPP_STRING_H_PROTO #endif /* Copy N bytes of SRC to DEST. */ extern void *memcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Copy N bytes of SRC to DEST, guaranteeing correct behavior for overlapping strings. */ extern void *memmove(void *__dest, const void *__src, size_t __n) __THROW __nonnull((1, 2)); /* Copy no more than N bytes of SRC to DEST, stopping when C is found. Return the position in DEST one byte past where C was copied, or NULL if C was not found in the first N bytes of SRC. */ #if defined __USE_MISC || defined __USE_XOPEN extern void *memccpy(void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) __THROW __nonnull((1, 2)); #endif /* Misc || X/Open. */ /* Set N bytes of S to C. */ extern void *memset(void *__s, int __c, size_t __n) __THROW __nonnull((1)); /* Compare N bytes of S1 and S2. */ extern int memcmp(const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); /* Search N bytes of S for C. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern void *memchr(void *__s, int __c, size_t __n) __THROW __asm("memchr") __attribute_pure__ __nonnull((1)); extern const void *memchr(const void *__s, int __c, size_t __n) __THROW __asm("memchr") __attribute_pure__ __nonnull((1)); # ifdef __OPTIMIZE__ __extern_always_inline void *memchr(void *__s, int __c, size_t __n) __THROW { return __builtin_memchr(__s, __c, __n); } __extern_always_inline const void *memchr(const void *__s, int __c, size_t __n) __THROW { return __builtin_memchr(__s, __c, __n); } # endif } #else extern void *memchr(const void *__s, int __c, size_t __n) __THROW __attribute_pure__ __nonnull((1)); #endif #ifdef __USE_GNU /* Search in S for C. This is similar to `memchr' but there is no length limit. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" void *rawmemchr(void *__s, int __c) __THROW __asm("rawmemchr") __attribute_pure__ __nonnull((1)); extern "C++" const void *rawmemchr(const void *__s, int __c) __THROW __asm("rawmemchr") __attribute_pure__ __nonnull((1)); # else extern void *rawmemchr(const void *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); # endif /* Search N bytes of S for the final occurrence of C. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" void *memrchr(void *__s, int __c, size_t __n) __THROW __asm("memrchr") __attribute_pure__ __nonnull((1)); extern "C++" const void *memrchr(const void *__s, int __c, size_t __n) __THROW __asm("memrchr") __attribute_pure__ __nonnull((1)); # else extern void *memrchr(const void *__s, int __c, size_t __n) __THROW __attribute_pure__ __nonnull((1)); # endif #endif /* Copy SRC to DEST. */ extern char *strcpy(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1, 2)); /* Copy no more than N characters of SRC to DEST. */ extern char *strncpy(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Append SRC onto DEST. */ extern char *strcat(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1, 2)); /* Append no more than N characters from SRC onto DEST. */ extern char *strncat(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Compare S1 and S2. */ extern int strcmp(const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Compare N characters of S1 and S2. */ extern int strncmp(const char *__s1, const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); /* Compare the collated forms of S1 and S2. */ extern int strcoll(const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Put a transformation of SRC into no more than N bytes of DEST. */ extern size_t strxfrm(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((2)); #ifdef __USE_XOPEN2K8 /* POSIX.1-2008 extended locale interface (see locale.h). */ # include /* Compare the collated forms of S1 and S2, using sorting rules from L. */ extern int strcoll_l(const char *__s1, const char *__s2, locale_t __l) __THROW __attribute_pure__ __nonnull((1, 2, 3)); /* Put a transformation of SRC into no more than N bytes of DEST, using sorting rules from L. */ extern size_t strxfrm_l(char *__dest, const char *__src, size_t __n, locale_t __l) __THROW __nonnull((2, 4)); #endif #if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 \ || __GLIBC_USE (LIB_EXT2)) /* Duplicate S, returning an identical malloc'd string. */ extern char *strdup(const char *__s) __THROW __attribute_malloc__ __nonnull((1)); #endif /* Return a malloc'd copy of at most N bytes of STRING. The resultant string is terminated even if no null terminator appears before STRING[N]. */ #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) extern char *strndup(const char *__string, size_t __n) __THROW __attribute_malloc__ __nonnull((1)); #endif #if defined __USE_GNU && defined __GNUC__ /* Duplicate S, returning an identical alloca'd string. */ # define strdupa(s) \ (__extension__ \ ({ \ const char *__old = (s); \ size_t __len = strlen (__old) + 1; \ char *__new = (char *) __builtin_alloca (__len); \ (char *) memcpy (__new, __old, __len); \ })) /* Return an alloca'd copy of at most N bytes of string. */ # define strndupa(s, n) \ (__extension__ \ ({ \ const char *__old = (s); \ size_t __len = strnlen (__old, (n)); \ char *__new = (char *) __builtin_alloca (__len + 1); \ __new[__len] = '\0'; \ (char *) memcpy (__new, __old, __len); \ })) #endif /* Find the first occurrence of C in S. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strchr(char *__s, int __c) __THROW __asm("strchr") __attribute_pure__ __nonnull((1)); extern const char *strchr(const char *__s, int __c) __THROW __asm("strchr") __attribute_pure__ __nonnull((1)); # ifdef __OPTIMIZE__ __extern_always_inline char *strchr(char *__s, int __c) __THROW { return __builtin_strchr(__s, __c); } __extern_always_inline const char *strchr(const char *__s, int __c) __THROW { return __builtin_strchr(__s, __c); } # endif } #else extern char *strchr(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); #endif /* Find the last occurrence of C in S. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strrchr(char *__s, int __c) __THROW __asm("strrchr") __attribute_pure__ __nonnull((1)); extern const char *strrchr(const char *__s, int __c) __THROW __asm("strrchr") __attribute_pure__ __nonnull((1)); # ifdef __OPTIMIZE__ __extern_always_inline char *strrchr(char *__s, int __c) __THROW { return __builtin_strrchr(__s, __c); } __extern_always_inline const char *strrchr(const char *__s, int __c) __THROW { return __builtin_strrchr(__s, __c); } # endif } #else extern char *strrchr(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); #endif #ifdef __USE_GNU /* This function is similar to `strchr'. But it returns a pointer to the closing NUL byte in case C is not found in S. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *strchrnul(char *__s, int __c) __THROW __asm("strchrnul") __attribute_pure__ __nonnull((1)); extern "C++" const char *strchrnul(const char *__s, int __c) __THROW __asm("strchrnul") __attribute_pure__ __nonnull((1)); # else extern char *strchrnul(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); # endif #endif /* Return the length of the initial segment of S which consists entirely of characters not in REJECT. */ extern size_t strcspn(const char *__s, const char *__reject) __THROW __attribute_pure__ __nonnull((1, 2)); /* Return the length of the initial segment of S which consists entirely of characters in ACCEPT. */ extern size_t strspn(const char *__s, const char *__accept) __THROW __attribute_pure__ __nonnull((1, 2)); /* Find the first occurrence in S of any character in ACCEPT. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strpbrk(char *__s, const char *__accept) __THROW __asm("strpbrk") __attribute_pure__ __nonnull((1, 2)); extern const char *strpbrk(const char *__s, const char *__accept) __THROW __asm("strpbrk") __attribute_pure__ __nonnull((1, 2)); # ifdef __OPTIMIZE__ __extern_always_inline char *strpbrk(char *__s, const char *__accept) __THROW { return __builtin_strpbrk(__s, __accept); } __extern_always_inline const char *strpbrk(const char *__s, const char *__accept) __THROW { return __builtin_strpbrk(__s, __accept); } # endif } #else extern char *strpbrk(const char *__s, const char *__accept) __THROW __attribute_pure__ __nonnull((1, 2)); #endif /* Find the first occurrence of NEEDLE in HAYSTACK. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strstr(char *__haystack, const char *__needle) __THROW __asm("strstr") __attribute_pure__ __nonnull((1, 2)); extern const char *strstr(const char *__haystack, const char *__needle) __THROW __asm("strstr") __attribute_pure__ __nonnull((1, 2)); # ifdef __OPTIMIZE__ __extern_always_inline char *strstr(char *__haystack, const char *__needle) __THROW { return __builtin_strstr(__haystack, __needle); } __extern_always_inline const char *strstr(const char *__haystack, const char *__needle) __THROW { return __builtin_strstr(__haystack, __needle); } # endif } #else extern char *strstr(const char *__haystack, const char *__needle) __THROW __attribute_pure__ __nonnull((1, 2)); #endif /* Divide S into tokens separated by characters in DELIM. */ extern char *strtok(char *__restrict __s, const char *__restrict __delim) __THROW __nonnull((2)); /* Divide S into tokens separated by characters in DELIM. Information passed between calls are stored in SAVE_PTR. */ extern char *__strtok_r(char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __THROW __nonnull((2, 3)); #ifdef __USE_POSIX extern char *strtok_r(char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __THROW __nonnull((2, 3)); #endif #ifdef __USE_GNU /* Similar to `strstr' but this function ignores the case of both strings. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *strcasestr(char *__haystack, const char *__needle) __THROW __asm("strcasestr") __attribute_pure__ __nonnull((1, 2)); extern "C++" const char *strcasestr(const char *__haystack, const char *__needle) __THROW __asm("strcasestr") __attribute_pure__ __nonnull((1, 2)); # else extern char *strcasestr(const char *__haystack, const char *__needle) __THROW __attribute_pure__ __nonnull((1, 2)); # endif #endif #ifdef __USE_GNU /* Find the first occurrence of NEEDLE in HAYSTACK. NEEDLE is NEEDLELEN bytes long; HAYSTACK is HAYSTACKLEN bytes long. */ extern void *memmem(const void *__haystack, size_t __haystacklen, const void *__needle, size_t __needlelen) __THROW __attribute_pure__ __nonnull((1, 3)); /* Copy N bytes of SRC to DEST, return pointer to bytes after the last written byte. */ extern void *__mempcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); extern void *mempcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); #endif /* Return the length of S. */ extern size_t strlen(const char *__s) __THROW __attribute_pure__ __nonnull((1)); #ifdef __USE_XOPEN2K8 /* Find the length of STRING, but scan at most MAXLEN characters. If no '\0' terminator is found in that many characters, return MAXLEN. */ extern size_t strnlen(const char *__string, size_t __maxlen) __THROW __attribute_pure__ __nonnull((1)); #endif /* Return a string describing the meaning of the `errno' code in ERRNUM. */ extern char *strerror(int __errnum) __THROW; #ifdef __USE_XOPEN2K /* Reentrant version of `strerror'. There are 2 flavors of `strerror_r', GNU which returns the string and may or may not use the supplied temporary buffer and POSIX one which fills the string into the buffer. To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L without -D_GNU_SOURCE is needed, otherwise the GNU version is preferred. */ # if defined __USE_XOPEN2K && !defined __USE_GNU /* Fill BUF with a string describing the meaning of the `errno' code in ERRNUM. */ # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(strerror_r, (int __errnum, char *__buf, size_t __buflen), __xpg_strerror_r) __nonnull((2)); # else extern int __xpg_strerror_r(int __errnum, char *__buf, size_t __buflen) __THROW __nonnull((2)); # define strerror_r __xpg_strerror_r # endif # else /* If a temporary buffer is required, at most BUFLEN bytes of BUF will be used. */ extern char *strerror_r(int __errnum, char *__buf, size_t __buflen) __THROW __nonnull((2)) __wur; # endif #endif #ifdef __USE_XOPEN2K8 /* Translate error number to string according to the locale L. */ extern char *strerror_l(int __errnum, locale_t __l) __THROW; #endif #ifdef __USE_MISC # include /* Set N bytes of S to 0. The compiler will not delete a call to this function, even if S is dead after the call. */ extern void explicit_bzero(void *__s, size_t __n) __THROW __nonnull((1)); /* Return the next DELIM-delimited token from *STRINGP, terminating it with a '\0', and update *STRINGP to point past it. */ extern char *strsep(char **__restrict __stringp, const char *__restrict __delim) __THROW __nonnull((1, 2)); #endif #ifdef __USE_XOPEN2K8 /* Return a string describing the meaning of the signal number in SIG. */ extern char *strsignal(int __sig) __THROW; /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ extern char *__stpcpy(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1, 2)); extern char *stpcpy(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1, 2)); /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ extern char *__stpncpy(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); extern char *stpncpy(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); #endif #ifdef __USE_GNU /* Compare S1 and S2 as strings holding name & indices/version numbers. */ extern int strverscmp(const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Sautee STRING briskly. */ extern char *strfry(char *__string) __THROW __nonnull((1)); /* Frobnicate N bytes of S. */ extern void *memfrob(void *__s, size_t __n) __THROW __nonnull((1)); # ifndef basename /* Return the file name within directory of FILENAME. We don't declare the function if the `basename' macro is available (defined in ) which makes the XPG version of this function available. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *basename(char *__filename) __THROW __asm("basename") __nonnull((1)); extern "C++" const char *basename(const char *__filename) __THROW __asm("basename") __nonnull((1)); # else extern char *basename(const char *__filename) __THROW __nonnull((1)); # endif # endif #endif #if __GNUC_PREREQ (3,4) # if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function /* Functions with security checks. */ # include # endif #endif __END_DECLS #endif /* string.h */ ================================================ FILE: v2/headers/linux_386/usr/include/strings.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STRINGS_H #define _STRINGS_H 1 #include #define __need_size_t #include /* Tell the caller that we provide correct C++ prototypes. */ #if defined __cplusplus && __GNUC_PREREQ (4, 4) # define __CORRECT_ISO_CPP_STRINGS_H_PROTO #endif __BEGIN_DECLS #if defined __USE_MISC || !defined __USE_XOPEN2K8 /* Compare N bytes of S1 and S2 (same as memcmp). */ extern int bcmp(const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); /* Copy N bytes of SRC to DEST (like memmove, but args reversed). */ extern void bcopy(const void *__src, void *__dest, size_t __n) __THROW __nonnull((1, 2)); /* Set N bytes of S to 0. */ extern void bzero(void *__s, size_t __n) __THROW __nonnull((1)); /* Find the first occurrence of C in S (same as strchr). */ # ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO extern "C++" { extern char *index(char *__s, int __c) __THROW __asm("index") __attribute_pure__ __nonnull((1)); extern const char *index(const char *__s, int __c) __THROW __asm("index") __attribute_pure__ __nonnull((1)); # if defined __OPTIMIZE__ __extern_always_inline char *index(char *__s, int __c) __THROW { return __builtin_index(__s, __c); } __extern_always_inline const char *index(const char *__s, int __c) __THROW { return __builtin_index(__s, __c); } # endif } # else extern char *index(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); # endif /* Find the last occurrence of C in S (same as strrchr). */ # ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO extern "C++" { extern char *rindex(char *__s, int __c) __THROW __asm("rindex") __attribute_pure__ __nonnull((1)); extern const char *rindex(const char *__s, int __c) __THROW __asm("rindex") __attribute_pure__ __nonnull((1)); # if defined __OPTIMIZE__ __extern_always_inline char *rindex(char *__s, int __c) __THROW { return __builtin_rindex(__s, __c); } __extern_always_inline const char *rindex(const char *__s, int __c) __THROW { return __builtin_rindex(__s, __c); } # endif } # else extern char *rindex(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); # endif #endif #if defined __USE_MISC || !defined __USE_XOPEN2K8 || defined __USE_XOPEN2K8XSI /* Return the position of the first bit set in I, or 0 if none are set. The least-significant bit is position 1, the most-significant 32. */ extern int ffs(int __i) __THROW __attribute_const__; #endif /* The following two functions are non-standard but necessary for non-32 bit platforms. */ # ifdef __USE_MISC extern int ffsl(long int __l) __THROW __attribute_const__; __extension__ extern int ffsll(long long int __ll) __THROW __attribute_const__; # endif /* Compare S1 and S2, ignoring case. */ extern int strcasecmp(const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int strncasecmp(const char *__s1, const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); #ifdef __USE_XOPEN2K8 /* POSIX.1-2008 extended locale interface (see locale.h). */ # include /* Compare S1 and S2, ignoring case, using collation rules from LOC. */ extern int strcasecmp_l(const char *__s1, const char *__s2, locale_t __loc) __THROW __attribute_pure__ __nonnull((1, 2, 3)); /* Compare no more than N chars of S1 and S2, ignoring case, using collation rules from LOC. */ extern int strncasecmp_l(const char *__s1, const char *__s2, size_t __n, locale_t __loc) __THROW __attribute_pure__ __nonnull((1, 2, 4)); #endif __END_DECLS #if __GNUC_PREREQ (3,4) && __USE_FORTIFY_LEVEL > 0 \ && defined __fortify_function /* Functions with security checks. */ # if defined __USE_MISC || !defined __USE_XOPEN2K8 # include # endif #endif #endif /* strings.h */ ================================================ FILE: v2/headers/linux_386/usr/include/termios.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 7.1-2 General Terminal Interface */ #ifndef _TERMIOS_H #define _TERMIOS_H 1 #include #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* We need `pid_t'. */ # include # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined # endif #endif __BEGIN_DECLS /* Get the system-dependent definitions of `struct termios', `tcflag_t', `cc_t', `speed_t', and all the macros specifying the flag bits. */ #include #ifdef __USE_MISC /* Compare a character C to a value VAL from the `c_cc' array in a `struct termios'. If VAL is _POSIX_VDISABLE, no character can match it. */ # define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE) #endif /* Return the output baud rate stored in *TERMIOS_P. */ extern speed_t cfgetospeed(const struct termios *__termios_p) __THROW; /* Return the input baud rate stored in *TERMIOS_P. */ extern speed_t cfgetispeed(const struct termios *__termios_p) __THROW; /* Set the output baud rate stored in *TERMIOS_P to SPEED. */ extern int cfsetospeed(struct termios *__termios_p, speed_t __speed) __THROW; /* Set the input baud rate stored in *TERMIOS_P to SPEED. */ extern int cfsetispeed(struct termios *__termios_p, speed_t __speed) __THROW; #ifdef __USE_MISC /* Set both the input and output baud rates in *TERMIOS_OP to SPEED. */ extern int cfsetspeed(struct termios *__termios_p, speed_t __speed) __THROW; #endif /* Put the state of FD into *TERMIOS_P. */ extern int tcgetattr(int __fd, struct termios *__termios_p) __THROW; /* Set the state of FD to *TERMIOS_P. Values for OPTIONAL_ACTIONS (TCSA*) are in . */ extern int tcsetattr(int __fd, int __optional_actions, const struct termios *__termios_p) __THROW; #ifdef __USE_MISC /* Set *TERMIOS_P to indicate raw mode. */ extern void cfmakeraw(struct termios *__termios_p) __THROW; #endif /* Send zero bits on FD. */ extern int tcsendbreak(int __fd, int __duration) __THROW; /* Wait for pending output to be written on FD. This function is a cancellation point and therefore not marked with __THROW. */ extern int tcdrain(int __fd); /* Flush pending data on FD. Values for QUEUE_SELECTOR (TC{I,O,IO}FLUSH) are in . */ extern int tcflush(int __fd, int __queue_selector) __THROW; /* Suspend or restart transmission on FD. Values for ACTION (TC[IO]{OFF,ON}) are in . */ extern int tcflow(int __fd, int __action) __THROW; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Get process group ID for session leader for controlling terminal FD. */ extern __pid_t tcgetsid(int __fd) __THROW; #endif #ifdef __USE_MISC # include #endif __END_DECLS #endif /* termios.h */ ================================================ FILE: v2/headers/linux_386/usr/include/time.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.23 Date and time */ #ifndef _TIME_H #define _TIME_H 1 #include #define __need_size_t #define __need_NULL #include /* This defines CLOCKS_PER_SEC, which is the number of processor clock ticks per second, and possibly a number of other constants. */ #include /* Many of the typedefs and structs whose official home is this header may also need to be defined by other headers. */ #include #include #include #if defined __USE_POSIX199309 || defined __USE_ISOC11 # include #endif #ifdef __USE_POSIX199309 # include # include # include struct sigevent; #endif #ifdef __USE_XOPEN2K # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined # endif #endif #ifdef __USE_XOPEN2K8 # include #endif #ifdef __USE_ISOC11 /* Time base values for timespec_get. */ # define TIME_UTC 1 #endif __BEGIN_DECLS /* Time used by the program so far (user time + system time). The result / CLOCKS_PER_SEC is program time in seconds. */ extern clock_t clock(void) __THROW; /* Return the current time and put it in *TIMER if TIMER is not NULL. */ extern time_t time(time_t * __timer) __THROW; /* Return the difference between TIME1 and TIME0. */ extern double difftime(time_t __time1, time_t __time0) __THROW __attribute__ ((__const__)); /* Return the `time_t' representation of TP and normalize TP. */ extern time_t mktime(struct tm *__tp) __THROW; /* Format TP into S according to FORMAT. Write no more than MAXSIZE characters and return the number of characters written, or 0 if it would exceed MAXSIZE. */ extern size_t strftime(char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp) __THROW; #ifdef __USE_XOPEN /* Parse S according to FORMAT and store binary time information in TP. The return value is a pointer to the first unparsed character in S. */ extern char *strptime(const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp) __THROW; #endif #ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ extern size_t strftime_l(char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp, locale_t __loc) __THROW; #endif #ifdef __USE_GNU extern char *strptime_l(const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp, locale_t __loc) __THROW; #endif /* Return the `struct tm' representation of *TIMER in Universal Coordinated Time (aka Greenwich Mean Time). */ extern struct tm *gmtime(const time_t * __timer) __THROW; /* Return the `struct tm' representation of *TIMER in the local timezone. */ extern struct tm *localtime(const time_t * __timer) __THROW; #ifdef __USE_POSIX /* Return the `struct tm' representation of *TIMER in UTC, using *TP to store the result. */ extern struct tm *gmtime_r(const time_t * __restrict __timer, struct tm *__restrict __tp) __THROW; /* Return the `struct tm' representation of *TIMER in local time, using *TP to store the result. */ extern struct tm *localtime_r(const time_t * __restrict __timer, struct tm *__restrict __tp) __THROW; #endif /* POSIX */ /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ extern char *asctime(const struct tm *__tp) __THROW; /* Equivalent to `asctime (localtime (timer))'. */ extern char *ctime(const time_t * __timer) __THROW; #ifdef __USE_POSIX /* Reentrant versions of the above functions. */ /* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ extern char *asctime_r(const struct tm *__restrict __tp, char *__restrict __buf) __THROW; /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */ extern char *ctime_r(const time_t * __restrict __timer, char *__restrict __buf) __THROW; #endif /* POSIX */ /* Defined in localtime.c. */ extern char *__tzname[2]; /* Current timezone names. */ extern int __daylight; /* If daylight-saving time is ever in use. */ extern long int __timezone; /* Seconds west of UTC. */ #ifdef __USE_POSIX /* Same as above. */ extern char *tzname[2]; /* Set time conversion information from the TZ environment variable. If TZ is not defined, a locale-dependent default is used. */ extern void tzset(void) __THROW; #endif #if defined __USE_MISC || defined __USE_XOPEN extern int daylight; extern long int timezone; #endif #ifdef __USE_MISC /* Set the system time to *WHEN. This call is restricted to the superuser. */ extern int stime(const time_t * __when) __THROW; #endif /* Nonzero if YEAR is a leap year (every 4 years, except every 100th isn't, and every 400th is). */ #define __isleap(year) \ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) #ifdef __USE_MISC /* Miscellaneous functions many Unices inherited from the public domain localtime package. These are included only for compatibility. */ /* Like `mktime', but for TP represents Universal Time, not local time. */ extern time_t timegm(struct tm *__tp) __THROW; /* Another name for `mktime'. */ extern time_t timelocal(struct tm *__tp) __THROW; /* Return the number of days in YEAR. */ extern int dysize(int __year) __THROW __attribute__ ((__const__)); #endif #ifdef __USE_POSIX199309 /* Pause execution for a number of nanoseconds. This function is a cancellation point and therefore not marked with __THROW. */ extern int nanosleep(const struct timespec *__requested_time, struct timespec *__remaining); /* Get resolution of clock CLOCK_ID. */ extern int clock_getres(clockid_t __clock_id, struct timespec *__res) __THROW; /* Get current value of clock CLOCK_ID and store it in TP. */ extern int clock_gettime(clockid_t __clock_id, struct timespec *__tp) __THROW; /* Set clock CLOCK_ID to value TP. */ extern int clock_settime(clockid_t __clock_id, const struct timespec *__tp) __THROW; # ifdef __USE_XOPEN2K /* High-resolution sleep with the specified clock. This function is a cancellation point and therefore not marked with __THROW. */ extern int clock_nanosleep(clockid_t __clock_id, int __flags, const struct timespec *__req, struct timespec *__rem); /* Return clock ID for CPU-time clock. */ extern int clock_getcpuclockid(pid_t __pid, clockid_t * __clock_id) __THROW; # endif /* Create new per-process timer using CLOCK_ID. */ extern int timer_create(clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t * __restrict __timerid) __THROW; /* Delete timer TIMERID. */ extern int timer_delete(timer_t __timerid) __THROW; /* Set timer TIMERID to VALUE, returning old value in OVALUE. */ extern int timer_settime(timer_t __timerid, int __flags, const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __THROW; /* Get current value of timer TIMERID and store it in VALUE. */ extern int timer_gettime(timer_t __timerid, struct itimerspec *__value) __THROW; /* Get expiration overrun for timer TIMERID. */ extern int timer_getoverrun(timer_t __timerid) __THROW; #endif #ifdef __USE_ISOC11 /* Set TS to calendar time based in time base BASE. */ extern int timespec_get(struct timespec *__ts, int __base) __THROW __nonnull((1)); #endif #ifdef __USE_XOPEN_EXTENDED /* Set to one of the following values to indicate an error. 1 the DATEMSK environment variable is null or undefined, 2 the template file cannot be opened for reading, 3 failed to get file status information, 4 the template file is not a regular file, 5 an error is encountered while reading the template file, 6 memory allication failed (not enough memory available), 7 there is no line in the template that matches the input, 8 invalid input specification Example: February 31 or a time is specified that can not be represented in a time_t (representing the time in seconds since 00:00:00 UTC, January 1, 1970) */ extern int getdate_err; /* Parse the given string as a date specification and return a value representing the value. The templates from the file identified by the environment variable DATEMSK are used. In case of an error `getdate_err' is set. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct tm *getdate(const char *__string); #endif #ifdef __USE_GNU /* Since `getdate' is not reentrant because of the use of `getdate_err' and the static buffer to return the result in, we provide a thread-safe variant. The functionality is the same. The result is returned in the buffer pointed to by RESBUFP and in case of an error the return value is != 0 with the same values as given above for `getdate_err'. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getdate_r(const char *__restrict __string, struct tm *__restrict __resbufp); #endif __END_DECLS #endif /* time.h. */ ================================================ FILE: v2/headers/linux_386/usr/include/unistd.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 2.10 Symbolic Constants */ #ifndef _UNISTD_H #define _UNISTD_H 1 #include __BEGIN_DECLS /* These may be used to determine what facilities are present at compile time. Their values can be obtained at run time from `sysconf'. */ #ifdef __USE_XOPEN2K8 /* POSIX Standard approved as ISO/IEC 9945-1 as of September 2008. */ # define _POSIX_VERSION 200809L #elif defined __USE_XOPEN2K /* POSIX Standard approved as ISO/IEC 9945-1 as of December 2001. */ # define _POSIX_VERSION 200112L #elif defined __USE_POSIX199506 /* POSIX Standard approved as ISO/IEC 9945-1 as of June 1995. */ # define _POSIX_VERSION 199506L #elif defined __USE_POSIX199309 /* POSIX Standard approved as ISO/IEC 9945-1 as of September 1993. */ # define _POSIX_VERSION 199309L #else /* POSIX Standard approved as ISO/IEC 9945-1 as of September 1990. */ # define _POSIX_VERSION 199009L #endif /* These are not #ifdef __USE_POSIX2 because they are in the theoretically application-owned namespace. */ #ifdef __USE_XOPEN2K8 # define __POSIX2_THIS_VERSION 200809L /* The utilities on GNU systems also correspond to this version. */ #elif defined __USE_XOPEN2K /* The utilities on GNU systems also correspond to this version. */ # define __POSIX2_THIS_VERSION 200112L #elif defined __USE_POSIX199506 /* The utilities on GNU systems also correspond to this version. */ # define __POSIX2_THIS_VERSION 199506L #else /* The utilities on GNU systems also correspond to this version. */ # define __POSIX2_THIS_VERSION 199209L #endif /* The utilities on GNU systems also correspond to this version. */ #define _POSIX2_VERSION __POSIX2_THIS_VERSION /* This symbol was required until the 2001 edition of POSIX. */ #define _POSIX2_C_VERSION __POSIX2_THIS_VERSION /* If defined, the implementation supports the C Language Bindings Option. */ #define _POSIX2_C_BIND __POSIX2_THIS_VERSION /* If defined, the implementation supports the C Language Development Utilities Option. */ #define _POSIX2_C_DEV __POSIX2_THIS_VERSION /* If defined, the implementation supports the Software Development Utilities Option. */ #define _POSIX2_SW_DEV __POSIX2_THIS_VERSION /* If defined, the implementation supports the creation of locales with the localedef utility. */ #define _POSIX2_LOCALEDEF __POSIX2_THIS_VERSION /* X/Open version number to which the library conforms. It is selectable. */ #ifdef __USE_XOPEN2K8 # define _XOPEN_VERSION 700 #elif defined __USE_XOPEN2K # define _XOPEN_VERSION 600 #elif defined __USE_UNIX98 # define _XOPEN_VERSION 500 #else # define _XOPEN_VERSION 4 #endif /* Commands and utilities from XPG4 are available. */ #define _XOPEN_XCU_VERSION 4 /* We are compatible with the old published standards as well. */ #define _XOPEN_XPG2 1 #define _XOPEN_XPG3 1 #define _XOPEN_XPG4 1 /* The X/Open Unix extensions are available. */ #define _XOPEN_UNIX 1 /* Encryption is present. */ #define _XOPEN_CRYPT 1 /* The enhanced internationalization capabilities according to XPG4.2 are present. */ #define _XOPEN_ENH_I18N 1 /* The legacy interfaces are also available. */ #define _XOPEN_LEGACY 1 /* Get values of POSIX options: If these symbols are defined, the corresponding features are always available. If not, they may be available sometimes. The current values can be obtained with `sysconf'. _POSIX_JOB_CONTROL Job control is supported. _POSIX_SAVED_IDS Processes have a saved set-user-ID and a saved set-group-ID. _POSIX_REALTIME_SIGNALS Real-time, queued signals are supported. _POSIX_PRIORITY_SCHEDULING Priority scheduling is supported. _POSIX_TIMERS POSIX.4 clocks and timers are supported. _POSIX_ASYNCHRONOUS_IO Asynchronous I/O is supported. _POSIX_PRIORITIZED_IO Prioritized asynchronous I/O is supported. _POSIX_SYNCHRONIZED_IO Synchronizing file data is supported. _POSIX_FSYNC The fsync function is present. _POSIX_MAPPED_FILES Mapping of files to memory is supported. _POSIX_MEMLOCK Locking of all memory is supported. _POSIX_MEMLOCK_RANGE Locking of ranges of memory is supported. _POSIX_MEMORY_PROTECTION Setting of memory protections is supported. _POSIX_MESSAGE_PASSING POSIX.4 message queues are supported. _POSIX_SEMAPHORES POSIX.4 counting semaphores are supported. _POSIX_SHARED_MEMORY_OBJECTS POSIX.4 shared memory objects are supported. _POSIX_THREADS POSIX.1c pthreads are supported. _POSIX_THREAD_ATTR_STACKADDR Thread stack address attribute option supported. _POSIX_THREAD_ATTR_STACKSIZE Thread stack size attribute option supported. _POSIX_THREAD_SAFE_FUNCTIONS Thread-safe functions are supported. _POSIX_THREAD_PRIORITY_SCHEDULING POSIX.1c thread execution scheduling supported. _POSIX_THREAD_PRIO_INHERIT Thread priority inheritance option supported. _POSIX_THREAD_PRIO_PROTECT Thread priority protection option supported. _POSIX_THREAD_PROCESS_SHARED Process-shared synchronization supported. _POSIX_PII Protocol-independent interfaces are supported. _POSIX_PII_XTI XTI protocol-indep. interfaces are supported. _POSIX_PII_SOCKET Socket protocol-indep. interfaces are supported. _POSIX_PII_INTERNET Internet family of protocols supported. _POSIX_PII_INTERNET_STREAM Connection-mode Internet protocol supported. _POSIX_PII_INTERNET_DGRAM Connectionless Internet protocol supported. _POSIX_PII_OSI ISO/OSI family of protocols supported. _POSIX_PII_OSI_COTS Connection-mode ISO/OSI service supported. _POSIX_PII_OSI_CLTS Connectionless ISO/OSI service supported. _POSIX_POLL Implementation supports `poll' function. _POSIX_SELECT Implementation supports `select' and `pselect'. _XOPEN_REALTIME X/Open realtime support is available. _XOPEN_REALTIME_THREADS X/Open realtime thread support is available. _XOPEN_SHM Shared memory interface according to XPG4.2. _XBS5_ILP32_OFF32 Implementation provides environment with 32-bit int, long, pointer, and off_t types. _XBS5_ILP32_OFFBIG Implementation provides environment with 32-bit int, long, and pointer and off_t with at least 64 bits. _XBS5_LP64_OFF64 Implementation provides environment with 32-bit int, and 64-bit long, pointer, and off_t types. _XBS5_LPBIG_OFFBIG Implementation provides environment with at least 32 bits int and long, pointer, and off_t with at least 64 bits. If any of these symbols is defined as -1, the corresponding option is not true for any file. If any is defined as other than -1, the corresponding option is true for all files. If a symbol is not defined at all, the value for a specific file can be obtained from `pathconf' and `fpathconf'. _POSIX_CHOWN_RESTRICTED Only the super user can use `chown' to change the owner of a file. `chown' can only be used to change the group ID of a file to a group of which the calling process is a member. _POSIX_NO_TRUNC Pathname components longer than NAME_MAX generate an error. _POSIX_VDISABLE If defined, if the value of an element of the `c_cc' member of `struct termios' is _POSIX_VDISABLE, no character will have the effect associated with that element. _POSIX_SYNC_IO Synchronous I/O may be performed. _POSIX_ASYNC_IO Asynchronous I/O may be performed. _POSIX_PRIO_IO Prioritized Asynchronous I/O may be performed. Support for the Large File Support interface is not generally available. If it is available the following constants are defined to one. _LFS64_LARGEFILE Low-level I/O supports large files. _LFS64_STDIO Standard I/O supports large files. */ #include /* Get the environment definitions from Unix98. */ #if defined __USE_UNIX98 || defined __USE_XOPEN2K # include #endif /* Standard file descriptors. */ #define STDIN_FILENO 0 /* Standard input. */ #define STDOUT_FILENO 1 /* Standard output. */ #define STDERR_FILENO 2 /* Standard error output. */ /* All functions that are not declared anywhere else. */ #include #ifndef __ssize_t_defined typedef __ssize_t ssize_t; # define __ssize_t_defined #endif #define __need_size_t #define __need_NULL #include #if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ # ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined # endif # ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined # endif # ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined # endif # if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; # define __off64_t_defined # endif # ifndef __useconds_t_defined typedef __useconds_t useconds_t; # define __useconds_t_defined # endif # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined # endif #endif /* X/Open */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K # ifndef __intptr_t_defined typedef __intptr_t intptr_t; # define __intptr_t_defined # endif #endif #if defined __USE_MISC || defined __USE_XOPEN # ifndef __socklen_t_defined typedef __socklen_t socklen_t; # define __socklen_t_defined # endif #endif /* Values for the second argument to access. These may be OR'd together. */ #define R_OK 4 /* Test for read permission. */ #define W_OK 2 /* Test for write permission. */ #define X_OK 1 /* Test for execute permission. */ #define F_OK 0 /* Test for existence. */ /* Test for access to NAME using the real UID and real GID. */ extern int access(const char *__name, int __type) __THROW __nonnull((1)); #ifdef __USE_GNU /* Test for access to NAME using the effective UID and GID (as normal file operations use). */ extern int euidaccess(const char *__name, int __type) __THROW __nonnull((1)); /* An alias for `euidaccess', used by some other systems. */ extern int eaccess(const char *__name, int __type) __THROW __nonnull((1)); #endif #ifdef __USE_ATFILE /* Test for access to FILE relative to the directory FD is open on. If AT_EACCESS is set in FLAG, then use effective IDs like `eaccess', otherwise use real IDs like `access'. */ extern int faccessat(int __fd, const char *__file, int __type, int __flag) __THROW __nonnull((2)) __wur; #endif /* Use GNU. */ /* Values for the WHENCE argument to lseek. */ #ifndef _STDIO_H /* has the same definitions. */ # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Seek from end of file. */ # ifdef __USE_GNU # define SEEK_DATA 3 /* Seek to next data. */ # define SEEK_HOLE 4 /* Seek to next hole. */ # endif #endif #if defined __USE_MISC && !defined L_SET /* Old BSD names for the same constants; just for compatibility. */ # define L_SET SEEK_SET # define L_INCR SEEK_CUR # define L_XTND SEEK_END #endif /* Move FD's file position to OFFSET bytes from the beginning of the file (if WHENCE is SEEK_SET), the current position (if WHENCE is SEEK_CUR), or the end of the file (if WHENCE is SEEK_END). Return the new file position. */ #ifndef __USE_FILE_OFFSET64 extern __off_t lseek(int __fd, __off_t __offset, int __whence) __THROW; #else # ifdef __REDIRECT_NTH extern __off64_t __REDIRECT_NTH(lseek, (int __fd, __off64_t __offset, int __whence), lseek64); # else # define lseek lseek64 # endif #endif #ifdef __USE_LARGEFILE64 extern __off64_t lseek64(int __fd, __off64_t __offset, int __whence) __THROW; #endif /* Close the file descriptor FD. This function is a cancellation point and therefore not marked with __THROW. */ extern int close(int __fd); /* Read NBYTES into BUF from FD. Return the number read, -1 for errors or 0 for EOF. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t read(int __fd, void *__buf, size_t __nbytes) __wur; /* Write N bytes of BUF to FD. Return the number written, or -1. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t write(int __fd, const void *__buf, size_t __n) __wur; #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 # ifndef __USE_FILE_OFFSET64 /* Read NBYTES into BUF from FD at the given position OFFSET without changing the file pointer. Return the number read, -1 for errors or 0 for EOF. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pread(int __fd, void *__buf, size_t __nbytes, __off_t __offset) __wur; /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwrite(int __fd, const void *__buf, size_t __n, __off_t __offset) __wur; # else # ifdef __REDIRECT extern ssize_t __REDIRECT(pread, (int __fd, void *__buf, size_t __nbytes, __off64_t __offset), pread64) __wur; extern ssize_t __REDIRECT(pwrite, (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset), pwrite64) __wur; # else # define pread pread64 # define pwrite pwrite64 # endif # endif # ifdef __USE_LARGEFILE64 /* Read NBYTES into BUF from FD at the given position OFFSET without changing the file pointer. Return the number read, -1 for errors or 0 for EOF. */ extern ssize_t pread64(int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __wur; /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. */ extern ssize_t pwrite64(int __fd, const void *__buf, size_t __n, __off64_t __offset) __wur; # endif #endif /* Create a one-way communication channel (pipe). If successful, two file descriptors are stored in PIPEDES; bytes written on PIPEDES[1] can be read from PIPEDES[0]. Returns 0 if successful, -1 if not. */ extern int pipe(int __pipedes[2]) __THROW __wur; #ifdef __USE_GNU /* Same as pipe but apply flags passed in FLAGS to the new file descriptors. */ extern int pipe2(int __pipedes[2], int __flags) __THROW __wur; #endif /* Schedule an alarm. In SECONDS seconds, the process will get a SIGALRM. If SECONDS is zero, any currently scheduled alarm will be cancelled. The function returns the number of seconds remaining until the last alarm scheduled would have signaled, or zero if there wasn't one. There is no return value to indicate an error, but you can set `errno' to 0 and check its value after calling `alarm', and this might tell you. The signal may come late due to processor scheduling. */ extern unsigned int alarm(unsigned int __seconds) __THROW; /* Make the process sleep for SECONDS seconds, or until a signal arrives and is not ignored. The function returns the number of seconds less than SECONDS which it actually slept (thus zero if it slept the full time). If a signal handler does a `longjmp' or modifies the handling of the SIGALRM signal while inside `sleep' call, the handling of the SIGALRM signal afterwards is undefined. There is no return value to indicate error, but if `sleep' returns SECONDS, it probably didn't work. This function is a cancellation point and therefore not marked with __THROW. */ extern unsigned int sleep(unsigned int __seconds); #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_MISC /* Set an alarm to go off (generating a SIGALRM signal) in VALUE microseconds. If INTERVAL is nonzero, when the alarm goes off, the timer is reset to go off every INTERVAL microseconds thereafter. Returns the number of microseconds remaining before the alarm. */ extern __useconds_t ualarm(__useconds_t __value, __useconds_t __interval) __THROW; /* Sleep USECONDS microseconds, or until a signal arrives that is not blocked or ignored. This function is a cancellation point and therefore not marked with __THROW. */ extern int usleep(__useconds_t __useconds); #endif /* Suspend the process until a signal arrives. This always returns -1 and sets `errno' to EINTR. This function is a cancellation point and therefore not marked with __THROW. */ extern int pause(void); /* Change the owner and group of FILE. */ extern int chown(const char *__file, __uid_t __owner, __gid_t __group) __THROW __nonnull((1)) __wur; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Change the owner and group of the file that FD is open on. */ extern int fchown(int __fd, __uid_t __owner, __gid_t __group) __THROW __wur; /* Change owner and group of FILE, if it is a symbolic link the ownership of the symbolic link is changed. */ extern int lchown(const char *__file, __uid_t __owner, __gid_t __group) __THROW __nonnull((1)) __wur; #endif /* Use X/Open Unix. */ #ifdef __USE_ATFILE /* Change the owner and group of FILE relative to the directory FD is open on. */ extern int fchownat(int __fd, const char *__file, __uid_t __owner, __gid_t __group, int __flag) __THROW __nonnull((2)) __wur; #endif /* Use GNU. */ /* Change the process's working directory to PATH. */ extern int chdir(const char *__path) __THROW __nonnull((1)) __wur; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Change the process's working directory to the one FD is open on. */ extern int fchdir(int __fd) __THROW __wur; #endif /* Get the pathname of the current working directory, and put it in SIZE bytes of BUF. Returns NULL if the directory couldn't be determined or SIZE was too small. If successful, returns BUF. In GNU, if BUF is NULL, an array is allocated with `malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as necessary. */ extern char *getcwd(char *__buf, size_t __size) __THROW __wur; #ifdef __USE_GNU /* Return a malloc'd string containing the current directory name. If the environment variable `PWD' is set, and its value is correct, that value is used. */ extern char *get_current_dir_name(void) __THROW; #endif #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_MISC /* Put the absolute pathname of the current working directory in BUF. If successful, return BUF. If not, put an error message in BUF and return NULL. BUF should be at least PATH_MAX bytes long. */ extern char *getwd(char *__buf) __THROW __nonnull((1)) __attribute_deprecated__ __wur; #endif /* Duplicate FD, returning a new file descriptor on the same file. */ extern int dup(int __fd) __THROW __wur; /* Duplicate FD to FD2, closing FD2 and making it open on the same file. */ extern int dup2(int __fd, int __fd2) __THROW; #ifdef __USE_GNU /* Duplicate FD to FD2, closing FD2 and making it open on the same file while setting flags according to FLAGS. */ extern int dup3(int __fd, int __fd2, int __flags) __THROW; #endif /* NULL-terminated array of "NAME=VALUE" environment variables. */ extern char **__environ; #ifdef __USE_GNU extern char **environ; #endif /* Replace the current process, executing PATH with arguments ARGV and environment ENVP. ARGV and ENVP are terminated by NULL pointers. */ extern int execve(const char *__path, char *const __argv[], char *const __envp[]) __THROW __nonnull((1, 2)); #ifdef __USE_XOPEN2K8 /* Execute the file FD refers to, overlaying the running program image. ARGV and ENVP are passed to the new program, as for `execve'. */ extern int fexecve(int __fd, char *const __argv[], char *const __envp[]) __THROW __nonnull((2)); #endif /* Execute PATH with arguments ARGV and environment from `environ'. */ extern int execv(const char *__path, char *const __argv[]) __THROW __nonnull((1, 2)); /* Execute PATH with all arguments after PATH until a NULL pointer, and the argument after that for environment. */ extern int execle(const char *__path, const char *__arg, ...) __THROW __nonnull((1, 2)); /* Execute PATH with all arguments after PATH until a NULL pointer and environment from `environ'. */ extern int execl(const char *__path, const char *__arg, ...) __THROW __nonnull((1, 2)); /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with arguments ARGV and environment from `environ'. */ extern int execvp(const char *__file, char *const __argv[]) __THROW __nonnull((1, 2)); /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with all arguments after FILE until a NULL pointer and environment from `environ'. */ extern int execlp(const char *__file, const char *__arg, ...) __THROW __nonnull((1, 2)); #ifdef __USE_GNU /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with arguments ARGV and environment from `environ'. */ extern int execvpe(const char *__file, char *const __argv[], char *const __envp[]) __THROW __nonnull((1, 2)); #endif #if defined __USE_MISC || defined __USE_XOPEN /* Add INC to priority of the current process. */ extern int nice(int __inc) __THROW __wur; #endif /* Terminate program execution with the low-order 8 bits of STATUS. */ extern void _exit(int __status) __attribute__ ((__noreturn__)); /* Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf'; the `_SC_*' symbols for the NAME argument to `sysconf'; and the `_CS_*' symbols for the NAME argument to `confstr'. */ #include /* Get file-specific configuration information about PATH. */ extern long int pathconf(const char *__path, int __name) __THROW __nonnull((1)); /* Get file-specific configuration about descriptor FD. */ extern long int fpathconf(int __fd, int __name) __THROW; /* Get the value of the system variable NAME. */ extern long int sysconf(int __name) __THROW; #ifdef __USE_POSIX2 /* Get the value of the string-valued system variable NAME. */ extern size_t confstr(int __name, char *__buf, size_t __len) __THROW; #endif /* Get the process ID of the calling process. */ extern __pid_t getpid(void) __THROW; /* Get the process ID of the calling process's parent. */ extern __pid_t getppid(void) __THROW; /* Get the process group ID of the calling process. */ extern __pid_t getpgrp(void) __THROW; /* Get the process group ID of process PID. */ extern __pid_t __getpgid(__pid_t __pid) __THROW; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 extern __pid_t getpgid(__pid_t __pid) __THROW; #endif /* Set the process group ID of the process matching PID to PGID. If PID is zero, the current process's process group ID is set. If PGID is zero, the process ID of the process is used. */ extern int setpgid(__pid_t __pid, __pid_t __pgid) __THROW; #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Both System V and BSD have `setpgrp' functions, but with different calling conventions. The BSD function is the same as POSIX.1 `setpgid' (above). The System V function takes no arguments and puts the calling process in its on group like `setpgid (0, 0)'. New programs should always use `setpgid' instead. GNU provides the POSIX.1 function. */ /* Set the process group ID of the calling process to its own PID. This is exactly the same as `setpgid (0, 0)'. */ extern int setpgrp(void) __THROW; #endif /* Use misc or X/Open. */ /* Create a new session with the calling process as its leader. The process group IDs of the session and the calling process are set to the process ID of the calling process, which is returned. */ extern __pid_t setsid(void) __THROW; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Return the session ID of the given process. */ extern __pid_t getsid(__pid_t __pid) __THROW; #endif /* Get the real user ID of the calling process. */ extern __uid_t getuid(void) __THROW; /* Get the effective user ID of the calling process. */ extern __uid_t geteuid(void) __THROW; /* Get the real group ID of the calling process. */ extern __gid_t getgid(void) __THROW; /* Get the effective group ID of the calling process. */ extern __gid_t getegid(void) __THROW; /* If SIZE is zero, return the number of supplementary groups the calling process is in. Otherwise, fill in the group IDs of its supplementary groups in LIST and return the number written. */ extern int getgroups(int __size, __gid_t __list[]) __THROW __wur; #ifdef __USE_GNU /* Return nonzero iff the calling process is in group GID. */ extern int group_member(__gid_t __gid) __THROW; #endif /* Set the user ID of the calling process to UID. If the calling process is the super-user, set the real and effective user IDs, and the saved set-user-ID to UID; if not, the effective user ID is set to UID. */ extern int setuid(__uid_t __uid) __THROW __wur; #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Set the real user ID of the calling process to RUID, and the effective user ID of the calling process to EUID. */ extern int setreuid(__uid_t __ruid, __uid_t __euid) __THROW __wur; #endif #ifdef __USE_XOPEN2K /* Set the effective user ID of the calling process to UID. */ extern int seteuid(__uid_t __uid) __THROW __wur; #endif /* Use POSIX.1-2001. */ /* Set the group ID of the calling process to GID. If the calling process is the super-user, set the real and effective group IDs, and the saved set-group-ID to GID; if not, the effective group ID is set to GID. */ extern int setgid(__gid_t __gid) __THROW __wur; #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Set the real group ID of the calling process to RGID, and the effective group ID of the calling process to EGID. */ extern int setregid(__gid_t __rgid, __gid_t __egid) __THROW __wur; #endif #ifdef __USE_XOPEN2K /* Set the effective group ID of the calling process to GID. */ extern int setegid(__gid_t __gid) __THROW __wur; #endif /* Use POSIX.1-2001. */ #ifdef __USE_GNU /* Fetch the real user ID, effective user ID, and saved-set user ID, of the calling process. */ extern int getresuid(__uid_t * __ruid, __uid_t * __euid, __uid_t * __suid) __THROW; /* Fetch the real group ID, effective group ID, and saved-set group ID, of the calling process. */ extern int getresgid(__gid_t * __rgid, __gid_t * __egid, __gid_t * __sgid) __THROW; /* Set the real user ID, effective user ID, and saved-set user ID, of the calling process to RUID, EUID, and SUID, respectively. */ extern int setresuid(__uid_t __ruid, __uid_t __euid, __uid_t __suid) __THROW __wur; /* Set the real group ID, effective group ID, and saved-set group ID, of the calling process to RGID, EGID, and SGID, respectively. */ extern int setresgid(__gid_t __rgid, __gid_t __egid, __gid_t __sgid) __THROW __wur; #endif /* Clone the calling process, creating an exact copy. Return -1 for errors, 0 to the new process, and the process ID of the new process to the old process. */ extern __pid_t fork(void) __THROWNL; #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_MISC /* Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is replaced by a call to `execve'. Return -1 for errors, 0 to the new process, and the process ID of the new process to the old process. */ extern __pid_t vfork(void) __THROW; #endif /* Use misc or XPG < 7. */ /* Return the pathname of the terminal FD is open on, or NULL on errors. The returned storage is good only until the next call to this function. */ extern char *ttyname(int __fd) __THROW; /* Store at most BUFLEN characters of the pathname of the terminal FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ttyname_r(int __fd, char *__buf, size_t __buflen) __THROW __nonnull((2)) __wur; /* Return 1 if FD is a valid descriptor associated with a terminal, zero if not. */ extern int isatty(int __fd) __THROW; #ifdef __USE_MISC /* Return the index into the active-logins file (utmp) for the controlling terminal. */ extern int ttyslot(void) __THROW; #endif /* Make a link to FROM named TO. */ extern int link(const char *__from, const char *__to) __THROW __nonnull((1, 2)) __wur; #ifdef __USE_ATFILE /* Like link but relative paths in TO and FROM are interpreted relative to FROMFD and TOFD respectively. */ extern int linkat(int __fromfd, const char *__from, int __tofd, const char *__to, int __flags) __THROW __nonnull((2, 4)) __wur; #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K /* Make a symbolic link to FROM named TO. */ extern int symlink(const char *__from, const char *__to) __THROW __nonnull((1, 2)) __wur; /* Read the contents of the symbolic link PATH into no more than LEN bytes of BUF. The contents are not null-terminated. Returns the number of characters read, or -1 for errors. */ extern ssize_t readlink(const char *__restrict __path, char *__restrict __buf, size_t __len) __THROW __nonnull((1, 2)) __wur; #endif /* Use POSIX.1-2001. */ #ifdef __USE_ATFILE /* Like symlink but a relative path in TO is interpreted relative to TOFD. */ extern int symlinkat(const char *__from, int __tofd, const char *__to) __THROW __nonnull((1, 3)) __wur; /* Like readlink but a relative PATH is interpreted relative to FD. */ extern ssize_t readlinkat(int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len) __THROW __nonnull((2, 3)) __wur; #endif /* Remove the link NAME. */ extern int unlink(const char *__name) __THROW __nonnull((1)); #ifdef __USE_ATFILE /* Remove the link NAME relative to FD. */ extern int unlinkat(int __fd, const char *__name, int __flag) __THROW __nonnull((2)); #endif /* Remove the directory PATH. */ extern int rmdir(const char *__path) __THROW __nonnull((1)); /* Return the foreground process group ID of FD. */ extern __pid_t tcgetpgrp(int __fd) __THROW; /* Set the foreground process group ID of FD set PGRP_ID. */ extern int tcsetpgrp(int __fd, __pid_t __pgrp_id) __THROW; /* Return the login name of the user. This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *getlogin(void); #ifdef __USE_POSIX199506 /* Return at most NAME_LEN characters of the login name of the user in NAME. If it cannot be determined or some other error occurred, return the error code. Otherwise return 0. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getlogin_r(char *__name, size_t __name_len) __nonnull((1)); #endif #ifdef __USE_MISC /* Set the login name returned by `getlogin'. */ extern int setlogin(const char *__name) __THROW __nonnull((1)); #endif #ifdef __USE_POSIX2 /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. */ # include #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K /* Put the name of the current host in no more than LEN bytes of NAME. The result is null-terminated if LEN is large enough for the full name and the terminator. */ extern int gethostname(char *__name, size_t __len) __THROW __nonnull((1)); #endif #if defined __USE_MISC /* Set the name of the current host to NAME, which is LEN bytes long. This call is restricted to the super-user. */ extern int sethostname(const char *__name, size_t __len) __THROW __nonnull((1)) __wur; /* Set the current machine's Internet number to ID. This call is restricted to the super-user. */ extern int sethostid(long int __id) __THROW __wur; /* Get and set the NIS (aka YP) domain name, if any. Called just like `gethostname' and `sethostname'. The NIS domain name is usually the empty string when not using NIS. */ extern int getdomainname(char *__name, size_t __len) __THROW __nonnull((1)) __wur; extern int setdomainname(const char *__name, size_t __len) __THROW __nonnull((1)) __wur; /* Revoke access permissions to all processes currently communicating with the control terminal, and then send a SIGHUP signal to the process group of the control terminal. */ extern int vhangup(void) __THROW; /* Revoke the access of all descriptors currently open on FILE. */ extern int revoke(const char *__file) __THROW __nonnull((1)) __wur; /* Enable statistical profiling, writing samples of the PC into at most SIZE bytes of SAMPLE_BUFFER; every processor clock tick while profiling is enabled, the system examines the user PC and increments SAMPLE_BUFFER[((PC - OFFSET) / 2) * SCALE / 65536]. If SCALE is zero, disable profiling. Returns zero on success, -1 on error. */ extern int profil(unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale) __THROW __nonnull((1)); /* Turn accounting on if NAME is an existing file. The system will then write a record for each process as it terminates, to this file. If NAME is NULL, turn accounting off. This call is restricted to the super-user. */ extern int acct(const char *__name) __THROW; /* Successive calls return the shells listed in `/etc/shells'. */ extern char *getusershell(void) __THROW; extern void endusershell(void) __THROW; /* Discard cached info. */ extern void setusershell(void) __THROW; /* Rewind and re-read the file. */ /* Put the program in the background, and dissociate from the controlling terminal. If NOCHDIR is zero, do `chdir ("/")'. If NOCLOSE is zero, redirects stdin, stdout, and stderr to /dev/null. */ extern int daemon(int __nochdir, int __noclose) __THROW __wur; #endif /* Use misc. */ #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) /* Make PATH be the root directory (the starting point for absolute paths). This call is restricted to the super-user. */ extern int chroot(const char *__path) __THROW __nonnull((1)) __wur; /* Prompt with PROMPT and read a string from the terminal without echoing. Uses /dev/tty if possible; otherwise stderr and stdin. */ extern char *getpass(const char *__prompt) __nonnull((1)); #endif /* Use misc || X/Open. */ /* Make all changes done to FD actually appear on disk. This function is a cancellation point and therefore not marked with __THROW. */ extern int fsync(int __fd); #ifdef __USE_GNU /* Make all changes done to all files on the file system associated with FD actually appear on disk. */ extern int syncfs(int __fd) __THROW; #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Return identifier for the current host. */ extern long int gethostid(void); /* Make all changes done to all files actually appear on disk. */ extern void sync(void) __THROW; # if defined __USE_MISC || !defined __USE_XOPEN2K /* Return the number of bytes in a page. This is the system's page size, which is not necessarily the same as the hardware page size. */ extern int getpagesize(void) __THROW __attribute__ ((__const__)); /* Return the maximum number of file descriptors the current process could possibly have. */ extern int getdtablesize(void) __THROW; # endif #endif /* Use misc || X/Open Unix. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Truncate FILE to LENGTH bytes. */ # ifndef __USE_FILE_OFFSET64 extern int truncate(const char *__file, __off_t __length) __THROW __nonnull((1)) __wur; # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(truncate, (const char *__file, __off64_t __length), truncate64) __nonnull((1)) __wur; # else # define truncate truncate64 # endif # endif # ifdef __USE_LARGEFILE64 extern int truncate64(const char *__file, __off64_t __length) __THROW __nonnull((1)) __wur; # endif #endif /* Use X/Open Unix || POSIX 2008. */ #if defined __USE_POSIX199309 \ || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K /* Truncate the file FD is open on to LENGTH bytes. */ # ifndef __USE_FILE_OFFSET64 extern int ftruncate(int __fd, __off_t __length) __THROW __wur; # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(ftruncate, (int __fd, __off64_t __length), ftruncate64) __wur; # else # define ftruncate ftruncate64 # endif # endif # ifdef __USE_LARGEFILE64 extern int ftruncate64(int __fd, __off64_t __length) __THROW __wur; # endif #endif /* Use POSIX.1b || X/Open Unix || XPG6. */ #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \ || defined __USE_MISC /* Set the end of accessible data space (aka "the break") to ADDR. Returns zero on success and -1 for errors (with errno set). */ extern int brk(void *__addr) __THROW __wur; /* Increase or decrease the end of accessible data space by DELTA bytes. If successful, returns the address the previous end of data space (i.e. the beginning of the new space, if DELTA > 0); returns (void *) -1 for errors (with errno set). */ extern void *sbrk(intptr_t __delta) __THROW; #endif #ifdef __USE_MISC /* Invoke `system call' number SYSNO, passing it the remaining arguments. This is completely system-dependent, and not often useful. In Unix, `syscall' sets `errno' for all errors and most calls return -1 for errors; in many systems you cannot pass arguments or get return values for all system calls (`pipe', `fork', and `getppid' typically among them). In Mach, all system calls take normal arguments and always return an error code (zero for success). */ extern long int syscall(long int __sysno, ...) __THROW; #endif /* Use misc. */ #if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) && !defined F_LOCK /* NOTE: These declarations also appear in ; be sure to keep both files consistent. Some systems have them there and some here, and some software depends on the macros being defined without including both. */ /* `lockf' is a simpler interface to the locking facilities of `fcntl'. LEN is always relative to the current file position. The CMD argument is one of the following. This function is a cancellation point and therefore not marked with __THROW. */ # define F_ULOCK 0 /* Unlock a previously locked region. */ # define F_LOCK 1 /* Lock a region for exclusive use. */ # define F_TLOCK 2 /* Test and lock a region for exclusive use. */ # define F_TEST 3 /* Test a region for other processes locks. */ # ifndef __USE_FILE_OFFSET64 extern int lockf(int __fd, int __cmd, __off_t __len) __wur; # else # ifdef __REDIRECT extern int __REDIRECT(lockf, (int __fd, int __cmd, __off64_t __len), lockf64) __wur; # else # define lockf lockf64 # endif # endif # ifdef __USE_LARGEFILE64 extern int lockf64(int __fd, int __cmd, __off64_t __len) __wur; # endif #endif /* Use misc and F_LOCK not already defined. */ #ifdef __USE_GNU /* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno' set to EINTR. */ # define TEMP_FAILURE_RETRY(expression) \ (__extension__ \ ({ long int __result; \ do __result = (long int) (expression); \ while (__result == -1L && errno == EINTR); \ __result; })) /* Copy LENGTH bytes from INFD to OUTFD. */ ssize_t copy_file_range(int __infd, __off64_t * __pinoff, int __outfd, __off64_t * __poutoff, size_t __length, unsigned int __flags); #endif /* __USE_GNU */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 /* Synchronize at least the data part of a file with the underlying media. */ extern int fdatasync(int __fildes); #endif /* Use POSIX199309 */ /* XPG4.2 specifies that prototypes for the encryption functions must be defined here. */ #ifdef __USE_XOPEN /* Encrypt at most 8 characters from KEY using salt to perturb DES. */ extern char *crypt(const char *__key, const char *__salt) __THROW __nonnull((1, 2)); /* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt block in place. */ extern void encrypt(char *__glibc_block, int __edflag) __THROW __nonnull((1)); /* Swab pairs bytes in the first N bytes of the area pointed to by FROM and copy the result to TO. The value of TO must not be in the range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM is without partner. */ extern void swab(const void *__restrict __from, void *__restrict __to, ssize_t __n) __THROW __nonnull((1, 2)); #endif /* Prior to Issue 6, the Single Unix Specification required these prototypes to appear in this header. They are also found in . */ #if defined __USE_XOPEN && !defined __USE_XOPEN2K /* Return the name of the controlling terminal. */ extern char *ctermid(char *__s) __THROW; /* Return the name of the current user. */ extern char *cuserid(char *__s); #endif /* Unix98 requires this function to be declared here. In other standards it is in . */ #if defined __USE_UNIX98 && !defined __USE_XOPEN2K extern int pthread_atfork(void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)) __THROW; #endif #ifdef __USE_MISC /* Write LENGTH bytes of randomness starting at BUFFER. Return 0 on success or -1 on error. */ int getentropy(void *__buffer, size_t __length) __wur; #endif /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif __END_DECLS #endif /* unistd.h */ ================================================ FILE: v2/headers/linux_386/usr/include/utime.h ================================================ /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 5.6.6 Set File Access and Modification Times */ #ifndef _UTIME_H #define _UTIME_H 1 #include __BEGIN_DECLS #include #if defined __USE_XOPEN || defined __USE_XOPEN2K # include #endif /* Structure describing file times. */ struct utimbuf { __time_t actime; /* Access time. */ __time_t modtime; /* Modification time. */ }; /* Set the access and modification times of FILE to those given in *FILE_TIMES. If FILE_TIMES is NULL, set them to the current time. */ extern int utime(const char *__file, const struct utimbuf *__file_times) __THROW __nonnull((1)); __END_DECLS #endif /* utime.h */ ================================================ FILE: v2/headers/linux_386/usr/include/wchar.h ================================================ /* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.24 * Extended multibyte and wide character utilities */ #ifndef _WCHAR_H #define _WCHAR_H 1 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include /* Gather machine dependent type support. */ #include #define __need_size_t #define __need_wchar_t #define __need_NULL #include #define __need___va_list #include #include #include #include #include #if defined __USE_UNIX98 || defined __USE_XOPEN2K # include #endif #ifdef __USE_XOPEN2K8 # include #endif /* Tell the caller that we provide correct C++ prototypes. */ #if defined __cplusplus && __GNUC_PREREQ (4, 4) # define __CORRECT_ISO_CPP_WCHAR_H_PROTO #endif #ifndef WCHAR_MIN /* These constants might also be defined in . */ # define WCHAR_MIN __WCHAR_MIN # define WCHAR_MAX __WCHAR_MAX #endif #ifndef WEOF # define WEOF (0xffffffffu) #endif /* All versions of XPG prior to the publication of ISO C99 required the bulk of 's declarations to appear in this header (because did not exist prior to C99). In POSIX.1-2001 those declarations were marked as XSI extensions; in -2008 they were additionally marked as obsolescent. _GNU_SOURCE mode anticipates the removal of these declarations in the next revision of POSIX. */ #if (defined __USE_XOPEN && !defined __USE_GNU \ && !(defined __USE_XOPEN2K && !defined __USE_XOPEN2KXSI)) # include #endif __BEGIN_DECLS /* This incomplete type is defined in but needed here because of `wcsftime'. */ struct tm; /* Copy SRC to DEST. */ extern wchar_t *wcscpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src) __THROW __nonnull((1, 2)); /* Copy no more than N wide-characters of SRC to DEST. */ extern wchar_t *wcsncpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Append SRC onto DEST. */ extern wchar_t *wcscat(wchar_t * __restrict __dest, const wchar_t * __restrict __src) __THROW __nonnull((1, 2)); /* Append no more than N wide-characters of SRC onto DEST. */ extern wchar_t *wcsncat(wchar_t * __restrict __dest, const wchar_t * __restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Compare S1 and S2. */ extern int wcscmp(const wchar_t * __s1, const wchar_t * __s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Compare N wide-characters of S1 and S2. */ extern int wcsncmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); #ifdef __USE_XOPEN2K8 /* Compare S1 and S2, ignoring case. */ extern int wcscasecmp(const wchar_t * __s1, const wchar_t * __s2) __THROW; /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int wcsncasecmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW; /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ extern int wcscasecmp_l(const wchar_t * __s1, const wchar_t * __s2, locale_t __loc) __THROW; extern int wcsncasecmp_l(const wchar_t * __s1, const wchar_t * __s2, size_t __n, locale_t __loc) __THROW; #endif /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the current locale. */ extern int wcscoll(const wchar_t * __s1, const wchar_t * __s2) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm(wchar_t * __restrict __s1, const wchar_t * __restrict __s2, size_t __n) __THROW; #ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the given locale. */ extern int wcscoll_l(const wchar_t * __s1, const wchar_t * __s2, locale_t __loc) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm_l(wchar_t * __s1, const wchar_t * __s2, size_t __n, locale_t __loc) __THROW; /* Duplicate S, returning an identical malloc'd string. */ extern wchar_t *wcsdup(const wchar_t * __s) __THROW __attribute_malloc__; #endif /* Find the first occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcschr(wchar_t * __wcs, wchar_t __wc) __THROW __asm("wcschr") __attribute_pure__; extern "C++" const wchar_t *wcschr(const wchar_t * __wcs, wchar_t __wc) __THROW __asm("wcschr") __attribute_pure__; #else extern wchar_t *wcschr(const wchar_t * __wcs, wchar_t __wc) __THROW __attribute_pure__; #endif /* Find the last occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcsrchr(wchar_t * __wcs, wchar_t __wc) __THROW __asm("wcsrchr") __attribute_pure__; extern "C++" const wchar_t *wcsrchr(const wchar_t * __wcs, wchar_t __wc) __THROW __asm("wcsrchr") __attribute_pure__; #else extern wchar_t *wcsrchr(const wchar_t * __wcs, wchar_t __wc) __THROW __attribute_pure__; #endif #ifdef __USE_GNU /* This function is similar to `wcschr'. But it returns a pointer to the closing NUL wide character in case C is not found in S. */ extern wchar_t *wcschrnul(const wchar_t * __s, wchar_t __wc) __THROW __attribute_pure__; #endif /* Return the length of the initial segmet of WCS which consists entirely of wide characters not in REJECT. */ extern size_t wcscspn(const wchar_t * __wcs, const wchar_t * __reject) __THROW __attribute_pure__; /* Return the length of the initial segmet of WCS which consists entirely of wide characters in ACCEPT. */ extern size_t wcsspn(const wchar_t * __wcs, const wchar_t * __accept) __THROW __attribute_pure__; /* Find the first occurrence in WCS of any character in ACCEPT. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcspbrk(wchar_t * __wcs, const wchar_t * __accept) __THROW __asm("wcspbrk") __attribute_pure__; extern "C++" const wchar_t *wcspbrk(const wchar_t * __wcs, const wchar_t * __accept) __THROW __asm("wcspbrk") __attribute_pure__; #else extern wchar_t *wcspbrk(const wchar_t * __wcs, const wchar_t * __accept) __THROW __attribute_pure__; #endif /* Find the first occurrence of NEEDLE in HAYSTACK. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcsstr(wchar_t * __haystack, const wchar_t * __needle) __THROW __asm("wcsstr") __attribute_pure__; extern "C++" const wchar_t *wcsstr(const wchar_t * __haystack, const wchar_t * __needle) __THROW __asm("wcsstr") __attribute_pure__; #else extern wchar_t *wcsstr(const wchar_t * __haystack, const wchar_t * __needle) __THROW __attribute_pure__; #endif /* Divide WCS into tokens separated by characters in DELIM. */ extern wchar_t *wcstok(wchar_t * __restrict __s, const wchar_t * __restrict __delim, wchar_t ** __restrict __ptr) __THROW; /* Return the number of wide characters in S. */ extern size_t wcslen(const wchar_t * __s) __THROW __attribute_pure__; #ifdef __USE_XOPEN /* Another name for `wcsstr' from XPG4. */ # ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcswcs(wchar_t * __haystack, const wchar_t * __needle) __THROW __asm("wcswcs") __attribute_pure__; extern "C++" const wchar_t *wcswcs(const wchar_t * __haystack, const wchar_t * __needle) __THROW __asm("wcswcs") __attribute_pure__; # else extern wchar_t *wcswcs(const wchar_t * __haystack, const wchar_t * __needle) __THROW __attribute_pure__; # endif #endif #ifdef __USE_XOPEN2K8 /* Return the number of wide characters in S, but at most MAXLEN. */ extern size_t wcsnlen(const wchar_t * __s, size_t __maxlen) __THROW __attribute_pure__; #endif /* Search N wide characters of S for C. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wmemchr(wchar_t * __s, wchar_t __c, size_t __n) __THROW __asm("wmemchr") __attribute_pure__; extern "C++" const wchar_t *wmemchr(const wchar_t * __s, wchar_t __c, size_t __n) __THROW __asm("wmemchr") __attribute_pure__; #else extern wchar_t *wmemchr(const wchar_t * __s, wchar_t __c, size_t __n) __THROW __attribute_pure__; #endif /* Compare N wide characters of S1 and S2. */ extern int wmemcmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW __attribute_pure__; /* Copy N wide characters of SRC to DEST. */ extern wchar_t *wmemcpy(wchar_t * __restrict __s1, const wchar_t * __restrict __s2, size_t __n) __THROW; /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for overlapping strings. */ extern wchar_t *wmemmove(wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW; /* Set N wide characters of S to C. */ extern wchar_t *wmemset(wchar_t * __s, wchar_t __c, size_t __n) __THROW; #ifdef __USE_GNU /* Copy N wide characters of SRC to DEST and return pointer to following wide character. */ extern wchar_t *wmempcpy(wchar_t * __restrict __s1, const wchar_t * __restrict __s2, size_t __n) __THROW; #endif /* Determine whether C constitutes a valid (one-byte) multibyte character. */ extern wint_t btowc(int __c) __THROW; /* Determine whether C corresponds to a member of the extended character set whose multibyte representation is a single byte. */ extern int wctob(wint_t __c) __THROW; /* Determine whether PS points to an object representing the initial state. */ extern int mbsinit(const mbstate_t * __ps) __THROW __attribute_pure__; /* Write wide character representation of multibyte character pointed to by S to PWC. */ extern size_t mbrtowc(wchar_t * __restrict __pwc, const char *__restrict __s, size_t __n, mbstate_t * __restrict __p) __THROW; /* Write multibyte representation of wide character WC to S. */ extern size_t wcrtomb(char *__restrict __s, wchar_t __wc, mbstate_t * __restrict __ps) __THROW; /* Return number of bytes in multibyte character pointed to by S. */ extern size_t __mbrlen(const char *__restrict __s, size_t __n, mbstate_t * __restrict __ps) __THROW; extern size_t mbrlen(const char *__restrict __s, size_t __n, mbstate_t * __restrict __ps) __THROW; #ifdef __USE_EXTERN_INLINES /* Define inline function as optimization. */ /* We can use the BTOWC and WCTOB optimizations since we know that all locales must use ASCII encoding for the values in the ASCII range and because the wchar_t encoding is always ISO 10646. */ extern wint_t __btowc_alias(int __c) __asm("btowc"); __extern_inline wint_t __NTH(btowc(int __c)) { return (__builtin_constant_p(__c) && __c >= '\0' && __c <= '\x7f' ? (wint_t) __c : __btowc_alias(__c)); } extern int __wctob_alias(wint_t __c) __asm("wctob"); __extern_inline int __NTH(wctob(wint_t __wc)) { return (__builtin_constant_p(__wc) && __wc >= L'\0' && __wc <= L'\x7f' ? (int)__wc : __wctob_alias(__wc)); } __extern_inline size_t __NTH(mbrlen(const char *__restrict __s, size_t __n, mbstate_t * __restrict __ps)) { return (__ps != NULL ? mbrtowc(NULL, __s, __n, __ps) : __mbrlen(__s, __n, NULL)); } #endif /* Write wide character representation of multibyte character string SRC to DST. */ extern size_t mbsrtowcs(wchar_t * __restrict __dst, const char **__restrict __src, size_t __len, mbstate_t * __restrict __ps) __THROW; /* Write multibyte character representation of wide character string SRC to DST. */ extern size_t wcsrtombs(char *__restrict __dst, const wchar_t ** __restrict __src, size_t __len, mbstate_t * __restrict __ps) __THROW; #ifdef __USE_XOPEN2K8 /* Write wide character representation of at most NMC bytes of the multibyte character string SRC to DST. */ extern size_t mbsnrtowcs(wchar_t * __restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t * __restrict __ps) __THROW; /* Write multibyte character representation of at most NWC characters from the wide character string SRC to DST. */ extern size_t wcsnrtombs(char *__restrict __dst, const wchar_t ** __restrict __src, size_t __nwc, size_t __len, mbstate_t * __restrict __ps) __THROW; #endif /* use POSIX 2008 */ /* The following functions are extensions found in X/Open CAE. */ #ifdef __USE_XOPEN /* Determine number of column positions required for C. */ extern int wcwidth(wchar_t __c) __THROW; /* Determine number of column positions required for first N wide characters (or fewer if S ends before this) in S. */ extern int wcswidth(const wchar_t * __s, size_t __n) __THROW; #endif /* Use X/Open. */ /* Convert initial portion of the wide string NPTR to `double' representation. */ extern double wcstod(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; #ifdef __USE_ISOC99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float wcstof(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; extern long double wcstold(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; #endif /* C99 */ /* Likewise for `_FloatN' and `_FloatNx' when support is enabled. */ #if __HAVE_FLOAT16 && defined __USE_GNU extern _Float16 wcstof16(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; #endif #if __HAVE_FLOAT32 && defined __USE_GNU extern _Float32 wcstof32(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; #endif #if __HAVE_FLOAT64 && defined __USE_GNU extern _Float64 wcstof64(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; #endif #if __HAVE_FLOAT128 && defined __USE_GNU extern _Float128 wcstof128(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; #endif #if __HAVE_FLOAT32X && defined __USE_GNU extern _Float32x wcstof32x(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; #endif #if __HAVE_FLOAT64X && defined __USE_GNU extern _Float64x wcstof64x(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; #endif #if __HAVE_FLOAT128X && defined __USE_GNU extern _Float128x wcstof128x(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; #endif /* Convert initial portion of wide string NPTR to `long int' representation. */ extern long int wcstol(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long int' representation. */ extern unsigned long int wcstoul(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; #ifdef __USE_ISOC99 /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoll(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstoull(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; #endif /* ISO C99. */ #ifdef __USE_GNU /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoq(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstouq(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; #endif /* Use GNU. */ #ifdef __USE_GNU /* Parallel versions of the functions above which take the locale to use as an additional parameter. These are GNU extensions inspired by the POSIX.1-2008 extended locale API. */ extern long int wcstol_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, locale_t __loc) __THROW; extern unsigned long int wcstoul_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, locale_t __loc) __THROW; __extension__ extern long long int wcstoll_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, locale_t __loc) __THROW; __extension__ extern unsigned long long int wcstoull_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, locale_t __loc) __THROW; extern double wcstod_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; extern float wcstof_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; extern long double wcstold_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; # if __HAVE_FLOAT16 extern _Float16 wcstof16_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; # endif # if __HAVE_FLOAT32 extern _Float32 wcstof32_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; # endif # if __HAVE_FLOAT64 extern _Float64 wcstof64_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; # endif # if __HAVE_FLOAT128 extern _Float128 wcstof128_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; # endif # if __HAVE_FLOAT32X extern _Float32x wcstof32x_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; # endif # if __HAVE_FLOAT64X extern _Float64x wcstof64x_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; # endif # if __HAVE_FLOAT128X extern _Float128x wcstof128x_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; # endif #endif /* use GNU */ #ifdef __USE_XOPEN2K8 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */ extern wchar_t *wcpcpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src) __THROW; /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ extern wchar_t *wcpncpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src, size_t __n) __THROW; #endif /* Wide character I/O functions. */ #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) /* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces a wide character string. */ extern __FILE *open_wmemstream(wchar_t ** __bufloc, size_t * __sizeloc) __THROW; #endif #if defined __USE_ISOC95 || defined __USE_UNIX98 /* Select orientation for stream. */ extern int fwide(__FILE * __fp, int __mode) __THROW; /* Write formatted output to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwprintf(__FILE * __restrict __stream, const wchar_t * __restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */ ; /* Write formatted output to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wprintf(const wchar_t * __restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */ ; /* Write formatted output of at most N characters to S. */ extern int swprintf(wchar_t * __restrict __s, size_t __n, const wchar_t * __restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */ ; /* Write formatted output to S from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwprintf(__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */ ; /* Write formatted output to stdout from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwprintf(const wchar_t * __restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */ ; /* Write formatted output of at most N character to S from argument list ARG. */ extern int vswprintf(wchar_t * __restrict __s, size_t __n, const wchar_t * __restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */ ; /* Read formatted input from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwscanf(__FILE * __restrict __stream, const wchar_t * __restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; /* Read formatted input from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wscanf(const wchar_t * __restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */ ; /* Read formatted input from S. */ extern int swscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; # if defined __USE_ISOC99 && !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT(fwscanf, (__FILE * __restrict __stream, const wchar_t * __restrict __format, ...), __isoc99_fwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; extern int __REDIRECT(wscanf, (const wchar_t * __restrict __format, ...), __isoc99_wscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */ ; extern int __REDIRECT_NTH(swscanf, (const wchar_t * __restrict __s, const wchar_t * __restrict __format, ...), __isoc99_swscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; # else extern int __isoc99_fwscanf(__FILE * __restrict __stream, const wchar_t * __restrict __format, ...); extern int __isoc99_wscanf(const wchar_t * __restrict __format, ...); extern int __isoc99_swscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, ...) __THROW; # define fwscanf __isoc99_fwscanf # define wscanf __isoc99_wscanf # define swscanf __isoc99_swscanf # endif # endif #endif /* Use ISO C95, C99 and Unix98. */ #ifdef __USE_ISOC99 /* Read formatted input from S into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwscanf(__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; /* Read formatted input from stdin into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwscanf(const wchar_t * __restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */ ; /* Read formatted input from S into argument list ARG. */ extern int vswscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; # if !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT extern int __REDIRECT(vfwscanf, (__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg), __isoc99_vfwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; extern int __REDIRECT(vwscanf, (const wchar_t * __restrict __format, __gnuc_va_list __arg), __isoc99_vwscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */ ; extern int __REDIRECT_NTH(vswscanf, (const wchar_t * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg), __isoc99_vswscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; # else extern int __isoc99_vfwscanf(__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg); extern int __isoc99_vwscanf(const wchar_t * __restrict __format, __gnuc_va_list __arg); extern int __isoc99_vswscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) __THROW; # define vfwscanf __isoc99_vfwscanf # define vwscanf __isoc99_vwscanf # define vswscanf __isoc99_vswscanf # endif # endif #endif /* Use ISO C99. */ /* Read a character from STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fgetwc(__FILE * __stream); extern wint_t getwc(__FILE * __stream); /* Read a character from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t getwchar(void); /* Write a character to STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fputwc(wchar_t __wc, __FILE * __stream); extern wint_t putwc(wchar_t __wc, __FILE * __stream); /* Write a character to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t putwchar(wchar_t __wc); /* Get a newline-terminated wide character string of finite length from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws(wchar_t * __restrict __ws, int __n, __FILE * __restrict __stream); /* Write a string to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fputws(const wchar_t * __restrict __ws, __FILE * __restrict __stream); /* Push a character back onto the input buffer of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t ungetwc(wint_t __wc, __FILE * __stream); #ifdef __USE_GNU /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t getwc_unlocked(__FILE * __stream); extern wint_t getwchar_unlocked(void); /* This is the wide character version of a GNU extension. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fgetwc_unlocked(__FILE * __stream); /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fputwc_unlocked(wchar_t __wc, __FILE * __stream); /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t putwc_unlocked(wchar_t __wc, __FILE * __stream); extern wint_t putwchar_unlocked(wchar_t __wc); /* This function does the same as `fgetws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws_unlocked(wchar_t * __restrict __ws, int __n, __FILE * __restrict __stream); /* This function does the same as `fputws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputws_unlocked(const wchar_t * __restrict __ws, __FILE * __restrict __stream); #endif /* Format TP into S according to FORMAT. Write no more than MAXSIZE wide characters and return the number of wide characters written, or 0 if it would exceed MAXSIZE. */ extern size_t wcsftime(wchar_t * __restrict __s, size_t __maxsize, const wchar_t * __restrict __format, const struct tm *__restrict __tp) __THROW; # ifdef __USE_GNU /* Similar to `wcsftime' but takes the information from the provided locale and not the global locale. */ extern size_t wcsftime_l(wchar_t * __restrict __s, size_t __maxsize, const wchar_t * __restrict __format, const struct tm *__restrict __tp, locale_t __loc) __THROW; # endif /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif #ifdef __LDBL_COMPAT # include #endif __END_DECLS #endif /* wchar.h */ ================================================ FILE: v2/headers/linux_386/usr/include/zconf.h ================================================ /* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #ifndef ZCONF_H #define ZCONF_H /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. * Even better than compiling with -DZ_PREFIX would be to use configure to set * this permanently in zconf.h using "./configure --zprefix". */ #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ # define Z_PREFIX_SET /* all linked symbols and init macros */ # define _dist_code z__dist_code # define _length_code z__length_code # define _tr_align z__tr_align # define _tr_flush_bits z__tr_flush_bits # define _tr_flush_block z__tr_flush_block # define _tr_init z__tr_init # define _tr_stored_block z__tr_stored_block # define _tr_tally z__tr_tally # define adler32 z_adler32 # define adler32_combine z_adler32_combine # define adler32_combine64 z_adler32_combine64 # define adler32_z z_adler32_z # ifndef Z_SOLO # define compress z_compress # define compress2 z_compress2 # define compressBound z_compressBound # endif # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 # define crc32_z z_crc32_z # define deflate z_deflate # define deflateBound z_deflateBound # define deflateCopy z_deflateCopy # define deflateEnd z_deflateEnd # define deflateGetDictionary z_deflateGetDictionary # define deflateInit z_deflateInit # define deflateInit2 z_deflateInit2 # define deflateInit2_ z_deflateInit2_ # define deflateInit_ z_deflateInit_ # define deflateParams z_deflateParams # define deflatePending z_deflatePending # define deflatePrime z_deflatePrime # define deflateReset z_deflateReset # define deflateResetKeep z_deflateResetKeep # define deflateSetDictionary z_deflateSetDictionary # define deflateSetHeader z_deflateSetHeader # define deflateTune z_deflateTune # define deflate_copyright z_deflate_copyright # define get_crc_table z_get_crc_table # ifndef Z_SOLO # define gz_error z_gz_error # define gz_intmax z_gz_intmax # define gz_strwinerror z_gz_strwinerror # define gzbuffer z_gzbuffer # define gzclearerr z_gzclearerr # define gzclose z_gzclose # define gzclose_r z_gzclose_r # define gzclose_w z_gzclose_w # define gzdirect z_gzdirect # define gzdopen z_gzdopen # define gzeof z_gzeof # define gzerror z_gzerror # define gzflush z_gzflush # define gzfread z_gzfread # define gzfwrite z_gzfwrite # define gzgetc z_gzgetc # define gzgetc_ z_gzgetc_ # define gzgets z_gzgets # define gzoffset z_gzoffset # define gzoffset64 z_gzoffset64 # define gzopen z_gzopen # define gzopen64 z_gzopen64 # ifdef _WIN32 # define gzopen_w z_gzopen_w # endif # define gzprintf z_gzprintf # define gzputc z_gzputc # define gzputs z_gzputs # define gzread z_gzread # define gzrewind z_gzrewind # define gzseek z_gzseek # define gzseek64 z_gzseek64 # define gzsetparams z_gzsetparams # define gztell z_gztell # define gztell64 z_gztell64 # define gzungetc z_gzungetc # define gzvprintf z_gzvprintf # define gzwrite z_gzwrite # endif # define inflate z_inflate # define inflateBack z_inflateBack # define inflateBackEnd z_inflateBackEnd # define inflateBackInit z_inflateBackInit # define inflateBackInit_ z_inflateBackInit_ # define inflateCodesUsed z_inflateCodesUsed # define inflateCopy z_inflateCopy # define inflateEnd z_inflateEnd # define inflateGetDictionary z_inflateGetDictionary # define inflateGetHeader z_inflateGetHeader # define inflateInit z_inflateInit # define inflateInit2 z_inflateInit2 # define inflateInit2_ z_inflateInit2_ # define inflateInit_ z_inflateInit_ # define inflateMark z_inflateMark # define inflatePrime z_inflatePrime # define inflateReset z_inflateReset # define inflateReset2 z_inflateReset2 # define inflateResetKeep z_inflateResetKeep # define inflateSetDictionary z_inflateSetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateUndermine z_inflateUndermine # define inflateValidate z_inflateValidate # define inflate_copyright z_inflate_copyright # define inflate_fast z_inflate_fast # define inflate_table z_inflate_table # ifndef Z_SOLO # define uncompress z_uncompress # define uncompress2 z_uncompress2 # endif # define zError z_zError # ifndef Z_SOLO # define zcalloc z_zcalloc # define zcfree z_zcfree # endif # define zlibCompileFlags z_zlibCompileFlags # define zlibVersion z_zlibVersion /* all zlib typedefs in zlib.h and zconf.h */ # define Byte z_Byte # define Bytef z_Bytef # define alloc_func z_alloc_func # define charf z_charf # define free_func z_free_func # ifndef Z_SOLO # define gzFile z_gzFile # endif # define gz_header z_gz_header # define gz_headerp z_gz_headerp # define in_func z_in_func # define intf z_intf # define out_func z_out_func # define uInt z_uInt # define uIntf z_uIntf # define uLong z_uLong # define uLongf z_uLongf # define voidp z_voidp # define voidpc z_voidpc # define voidpf z_voidpf /* all zlib structs in zlib.h and zconf.h */ # define gz_header_s z_gz_header_s # define internal_state z_internal_state #endif #if defined(__MSDOS__) && !defined(MSDOS) # define MSDOS #endif #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) # define OS2 #endif #if defined(_WINDOWS) && !defined(WINDOWS) # define WINDOWS #endif #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) # ifndef WIN32 # define WIN32 # endif #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) # ifndef SYS16BIT # define SYS16BIT # endif # endif #endif /* * Compile with -DMAXSEG_64K if the alloc function cannot allocate more * than 64k bytes at a time (needed on systems with 16-bit int). */ #ifdef SYS16BIT # define MAXSEG_64K #endif #ifdef MSDOS # define UNALIGNED_OK #endif #ifdef __STDC_VERSION__ # ifndef STDC # define STDC # endif # if __STDC_VERSION__ >= 199901L # ifndef STDC99 # define STDC99 # endif # endif #endif #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) # define STDC #endif #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) # define STDC #endif #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) # define STDC #endif #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) # define STDC #endif #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ # define STDC #endif #ifndef STDC # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ # define const /* note: need a more gentle solution here */ # endif #endif #if defined(ZLIB_CONST) && !defined(z_const) # define z_const const #else # define z_const #endif #ifdef Z_SOLO typedef unsigned long z_size_t; #else # define z_longlong long long # if defined(NO_SIZE_T) typedef unsigned NO_SIZE_T z_size_t; # elif defined(STDC) # include typedef size_t z_size_t; # else typedef unsigned long z_size_t; # endif # undef z_longlong #endif /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL # ifdef MAXSEG_64K # define MAX_MEM_LEVEL 8 # else # define MAX_MEM_LEVEL 9 # endif #endif /* Maximum value for windowBits in deflateInit2 and inflateInit2. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files * created by gzip. (Files created by minigzip can still be extracted by * gzip.) */ #ifndef MAX_WBITS # define MAX_WBITS 15 /* 32K LZ77 window */ #endif /* The memory requirements for deflate are (in bytes): (1 << (windowBits+2)) + (1 << (memLevel+9)) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) plus a few kilobytes for small objects. For example, if you want to reduce the default memory requirements from 256K to 128K, compile with make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits that is, 32K for windowBits=15 (default value) plus about 7 kilobytes for small objects. */ /* Type declarations */ #ifndef OF /* function prototypes */ # ifdef STDC # define OF(args) args # else # define OF(args) () # endif #endif #ifndef Z_ARG /* function prototypes for stdarg */ # if defined(STDC) || defined(Z_HAVE_STDARG_H) # define Z_ARG(args) args # else # define Z_ARG(args) () # endif #endif /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, * just define FAR to be empty. */ #ifdef SYS16BIT # if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */ # define SMALL_MEDIUM # ifdef _MSC_VER # define FAR _far # else # define FAR far # endif # endif # if (defined(__SMALL__) || defined(__MEDIUM__)) /* Turbo C small or medium model */ # define SMALL_MEDIUM # ifdef __BORLANDC__ # define FAR _far # else # define FAR far # endif # endif #endif #if defined(WINDOWS) || defined(WIN32) /* If building or using zlib as a DLL, define ZLIB_DLL. * This is not mandatory, but it offers a little performance increase. */ # ifdef ZLIB_DLL # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) # ifdef ZLIB_INTERNAL # define ZEXTERN extern __declspec(dllexport) # else # define ZEXTERN extern __declspec(dllimport) # endif # endif # endif /* ZLIB_DLL */ /* If building or using zlib with the WINAPI/WINAPIV calling convention, * define ZLIB_WINAPI. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. */ # ifdef ZLIB_WINAPI # ifdef FAR # undef FAR # endif # include /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ # define ZEXPORT WINAPI # ifdef WIN32 # define ZEXPORTVA WINAPIV # else # define ZEXPORTVA FAR CDECL # endif # endif #endif #if defined (__BEOS__) # ifdef ZLIB_DLL # ifdef ZLIB_INTERNAL # define ZEXPORT __declspec(dllexport) # define ZEXPORTVA __declspec(dllexport) # else # define ZEXPORT __declspec(dllimport) # define ZEXPORTVA __declspec(dllimport) # endif # endif #endif #ifndef ZEXTERN # define ZEXTERN extern #endif #ifndef ZEXPORT # define ZEXPORT #endif #ifndef ZEXPORTVA # define ZEXPORTVA #endif #ifndef FAR # define FAR #endif #if !defined(__MACTYPES__) typedef unsigned char Byte; /* 8 bits */ #endif typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ #ifdef SMALL_MEDIUM /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ # define Bytef Byte FAR #else typedef Byte FAR Bytef; #endif typedef char FAR charf; typedef int FAR intf; typedef uInt FAR uIntf; typedef uLong FAR uLongf; #ifdef STDC typedef void const *voidpc; typedef void FAR *voidpf; typedef void *voidp; #else typedef Byte const *voidpc; typedef Byte FAR *voidpf; typedef Byte *voidp; #endif #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) # include # if (UINT_MAX == 0xffffffffUL) # define Z_U4 unsigned # elif (ULONG_MAX == 0xffffffffUL) # define Z_U4 unsigned long # elif (USHRT_MAX == 0xffffffffUL) # define Z_U4 unsigned short # endif #endif #ifdef Z_U4 typedef Z_U4 z_crc_t; #else typedef unsigned long z_crc_t; #endif #if 1 /* was set to #if 1 by ./configure */ # define Z_HAVE_UNISTD_H #endif #if 1 /* was set to #if 1 by ./configure */ # define Z_HAVE_STDARG_H #endif #ifdef STDC # ifndef Z_SOLO # include /* for off_t */ # endif #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) # ifndef Z_SOLO # include /* for va_list */ # endif #endif #ifdef _WIN32 # ifndef Z_SOLO # include /* for wchar_t */ # endif #endif /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even * though the former does not conform to the LFS document), but considering * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as * equivalently requesting no 64-bit operations */ #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 # undef _LARGEFILE64_SOURCE #endif #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) # define Z_HAVE_UNISTD_H #endif #ifndef Z_SOLO # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) # include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ # ifdef VMS # include /* for off_t */ # endif # ifndef z_off_t # define z_off_t off_t # endif # endif #endif #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 # define Z_LFS64 #endif #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) # define Z_LARGE64 #endif #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) # define Z_WANT64 #endif #if !defined(SEEK_SET) && !defined(Z_SOLO) # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif #ifndef z_off_t # define z_off_t long #endif #if !defined(_WIN32) && defined(Z_LARGE64) # define z_off64_t off64_t #else # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) # define z_off64_t __int64 # else # define z_off64_t z_off_t # endif #endif /* MVS linker does not support external names larger than 8 bytes */ #if defined(__MVS__) #pragma map(deflateInit_,"DEIN") #pragma map(deflateInit2_,"DEIN2") #pragma map(deflateEnd,"DEEND") #pragma map(deflateBound,"DEBND") #pragma map(inflateInit_,"ININ") #pragma map(inflateInit2_,"ININ2") #pragma map(inflateEnd,"INEND") #pragma map(inflateSync,"INSY") #pragma map(inflateSetDictionary,"INSEDI") #pragma map(compressBound,"CMBND") #pragma map(inflate_table,"INTABL") #pragma map(inflate_fast,"INFA") #pragma map(inflate_copyright,"INCOPY") #endif #endif /* ZCONF_H */ ================================================ FILE: v2/headers/linux_386/usr/include/zlib.h ================================================ /* zlib.h -- interface of the 'zlib' general purpose compression library version 1.2.11, January 15th, 2017 Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler jloup@gzip.org madler@alumni.caltech.edu The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). */ #ifndef ZLIB_H #define ZLIB_H #include "zconf.h" #ifdef __cplusplus extern "C" { #endif #define ZLIB_VERSION "1.2.11" #define ZLIB_VERNUM 0x12b0 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 #define ZLIB_VER_REVISION 11 #define ZLIB_VER_SUBREVISION 0 /* The 'zlib' compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method (deflation) but other algorithms will be added later and will have the same stream interface. Compression can be done in a single step if the buffers are large enough, or can be done by repeated calls of the compression function. In the latter case, the application must provide more input and/or consume the output (providing more output space) before each call. The compressed data format used by default by the in-memory functions is the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped around a deflate stream, which is itself documented in RFC 1951. The library also supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. This library can optionally read and write gzip and raw deflate streams in memory as well. The zlib format was designed to be compact and fast for use in memory and on communications channels. The gzip format was designed for single- file compression on file systems, has a larger header than zlib to maintain directory information, and uses a different, slower check method than zlib. The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash even in the case of corrupted input. */ typedef voidpf(*alloc_func) OF((voidpf opaque, uInt items, uInt size)); typedef void (*free_func) OF((voidpf opaque, voidpf address)); struct internal_state; typedef struct z_stream_s { z_const Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total number of input bytes read so far */ Bytef *next_out; /* next output byte will go here */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total number of bytes output so far */ z_const char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ int data_type; /* best guess about the data type: binary or text for deflate, or the decoding state for inflate */ uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ } z_stream; typedef z_stream FAR *z_streamp; /* gzip header information passed to and from zlib routines. See RFC 1952 for more details on the meanings of these fields. */ typedef struct gz_header_s { int text; /* true if compressed data believed to be text */ uLong time; /* modification time */ int xflags; /* extra flags (not used when writing a gzip file) */ int os; /* operating system */ Bytef *extra; /* pointer to extra field or Z_NULL if none */ uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ uInt extra_max; /* space at extra (only when reading header) */ Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ uInt name_max; /* space at name (only when reading header) */ Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ uInt comm_max; /* space at comment (only when reading header) */ int hcrc; /* true if there was or will be a header crc */ int done; /* true when done reading gzip header (not used when writing a gzip file) */ } gz_header; typedef gz_header FAR *gz_headerp; /* The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out has dropped to zero. The application must initialize zalloc, zfree and opaque before calling the init function. All other fields are set by the compression library and must not be updated by the application. The opaque value provided by the application will be passed as the first parameter for calls of zalloc and zfree. This can be useful for custom memory management. The compression library attaches no meaning to the opaque value. zalloc must return Z_NULL if there is not enough memory for the object. If zlib is used in a multi-threaded application, zalloc and zfree must be thread safe. In that case, zlib is thread-safe. When zalloc and zfree are Z_NULL on entry to the initialization function, they are set to internal routines that use the standard library functions malloc() and free(). On 16-bit systems, the functions zalloc and zfree must be able to allocate exactly 65536 bytes, but will not be required to allocate more than this if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers returned by zalloc for objects of exactly 65536 bytes *must* have their offset normalized to zero. The default allocation function provided by this library ensures this (see zutil.c). To reduce memory requirements and avoid any allocation of 64K objects, at the expense of compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). The fields total_in and total_out can be used for statistics or progress reports. After compression, total_in holds the total size of the uncompressed data and may be saved for use by the decompressor (particularly if the decompressor wants to decompress everything in a single step). */ /* constants */ #define Z_NO_FLUSH 0 #define Z_PARTIAL_FLUSH 1 #define Z_SYNC_FLUSH 2 #define Z_FULL_FLUSH 3 #define Z_FINISH 4 #define Z_BLOCK 5 #define Z_TREES 6 /* Allowed flush values; see deflate() and inflate() below for details */ #define Z_OK 0 #define Z_STREAM_END 1 #define Z_NEED_DICT 2 #define Z_ERRNO (-1) #define Z_STREAM_ERROR (-2) #define Z_DATA_ERROR (-3) #define Z_MEM_ERROR (-4) #define Z_BUF_ERROR (-5) #define Z_VERSION_ERROR (-6) /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ #define Z_NO_COMPRESSION 0 #define Z_BEST_SPEED 1 #define Z_BEST_COMPRESSION 9 #define Z_DEFAULT_COMPRESSION (-1) /* compression levels */ #define Z_FILTERED 1 #define Z_HUFFMAN_ONLY 2 #define Z_RLE 3 #define Z_FIXED 4 #define Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ #define Z_BINARY 0 #define Z_TEXT 1 #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ #define Z_UNKNOWN 2 /* Possible values of the data_type field for deflate() */ #define Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ #define zlib_version zlibVersion() /* for compatibility with versions < 1.0.2 */ /* basic functions */ ZEXTERN const char *ZEXPORT zlibVersion OF((void)); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check is automatically made by deflateInit and inflateInit. */ /* ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If zalloc and zfree are set to Z_NULL, deflateInit updates them to use default allocation functions. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION requests a default compromise between speed and compression (currently equivalent to level 6). deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if level is not a valid compression level, or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); /* deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. deflate performs one or both of the following actions: - Compress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in and avail_in are updated and processing will resume at this point for the next call of deflate(). - Generate more output starting at next_out and update next_out and avail_out accordingly. This action is forced if the parameter flush is non zero. Forcing flush frequently degrades the compression ratio, so this parameter should be set only when necessary. Some output may be provided even if flush is zero. Before the call of deflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating avail_in or avail_out accordingly; avail_out should never be zero before the call. The application can consume the compressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. See deflatePending(), which can be used if desired to determine whether or not there is more ouput in that case. Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to decide how much data to accumulate before producing output, in order to maximize compression. If the parameter flush is set to Z_SYNC_FLUSH, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. (In particular avail_in is zero after the call if enough output space has been provided before the call.) Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. This completes the current deflate block and follows it with an empty stored block that is three bits plus filler bits to the next byte, followed by four bytes (00 00 ff ff). If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the output buffer, but the output is not aligned to a byte boundary. All of the input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. This completes the current deflate block and follows it with an empty fixed codes block that is 10 bits long. This assures that enough bytes are output in order for the decompressor to finish the block before the empty fixed codes block. If flush is set to Z_BLOCK, a deflate block is completed and emitted, as for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to seven bits of the current block are held to be written as the next byte after the next deflate block is completed. In this case, the decompressor may not be provided enough bits at this point in order to complete decompression of the data provided so far to the compressor. It may need to wait for the next block to be emitted. This is for advanced applications that need to control the emission of deflate blocks. If flush is set to Z_FULL_FLUSH, all output is flushed as with Z_SYNC_FLUSH, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using Z_FULL_FLUSH too often can seriously degrade compression. If deflate returns with avail_out == 0, this function must be called again with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that avail_out is greater than six to avoid repeated flush markers due to avail_out == 0 on return. If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this function must be called again with Z_FINISH and more output space (updated avail_out) but no more input data, until it returns with Z_STREAM_END or an error. After deflate has returned Z_STREAM_END, the only possible operations on the stream are deflateReset or deflateEnd. Z_FINISH can be used in the first deflate call after deflateInit if all the compression is to be done in a single step. In order to complete in one call, avail_out must be at least the value returned by deflateBound (see below). Then deflate is guaranteed to return Z_STREAM_END. If not enough output space is provided, deflate will not return Z_STREAM_END, and it must be called again as described above. deflate() sets strm->adler to the Adler-32 checksum of all input read so far (that is, total_in bytes). If a gzip stream is being generated, then strm->adler will be the CRC-32 checksum of the input read so far. (See deflateInit2 below.) deflate() may update strm->data_type if it can make a good guess about the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is considered binary. This field is only for information purposes and does not affect the compression algorithm in any manner. deflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if all input has been consumed and all output has been produced (only when flush is set to Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example if next_in or next_out was Z_NULL or the state was inadvertently written over by the application), or Z_BUF_ERROR if no progress is possible (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and deflate() can be called again with more input and more output space to continue compressing. */ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent, Z_DATA_ERROR if the stream was freed prematurely (some input or output was discarded). In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. In the current version of inflate, the provided input is not read or consumed. The allocation of a sliding window will be deferred to the first call of inflate (if the decompression does not complete on the first call). If zalloc and zfree are set to Z_NULL, inflateInit updates them to use default allocation functions. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit does not perform any decompression. Actual decompression will be done by inflate(). So next_in, and avail_in, next_out, and avail_out are unused and unchanged. The current implementation of inflateInit() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. inflate performs one or both of the following actions: - Decompress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), then next_in and avail_in are updated accordingly, and processing will resume at this point for the next call of inflate(). - Generate more output starting at next_out and update next_out and avail_out accordingly. inflate() provides as much output as possible, until there is no more input data or no more space in the output buffer (see below about the flush parameter). Before the call of inflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating the next_* and avail_* values accordingly. If the caller of inflate() does not provide both available input and available output space, it is possible that there will be no progress made. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of inflate(). If inflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much output as possible to the output buffer. Z_BLOCK requests that inflate() stop if and when it gets to the next deflate block boundary. When decoding the zlib or gzip format, this will cause inflate() to return immediately after the header and before the first block. When doing a raw inflate, inflate() will go ahead and process the first block, and will return when it gets to the end of that block, or when it runs out of data. The Z_BLOCK option assists in appending to or combining deflate streams. To assist in this, on return inflate() always sets strm->data_type to the number of unused bits in the last byte taken from strm->next_in, plus 64 if inflate() is currently decoding the last block in the deflate stream, plus 128 if inflate() returned immediately after decoding an end-of-block code or decoding the complete header up to just before the first byte of the deflate stream. The end-of-block will not be indicated until all of the uncompressed data from that block has been written to strm->next_out. The number of unused bits may in general be greater than seven, except when bit 7 of data_type is set, in which case the number of unused bits will be less than eight. data_type is set as noted here every time inflate() returns for all flush options, and so can be used to determine the amount of currently consumed input in bits. The Z_TREES option behaves as Z_BLOCK does, but it also returns when the end of each deflate block header is reached, before any actual data in that block is decoded. This allows the caller to determine the length of the deflate block header for later use in random access within a deflate block. 256 is added to the value of strm->data_type when inflate() returns immediately after reaching the end of the deflate block header. inflate() should normally be called until it returns Z_STREAM_END or an error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to Z_FINISH. In this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all of the uncompressed data for the operation to complete. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The use of Z_FINISH is not required to perform an inflation in one step. However it may be used to inform inflate that a faster approach can be used for the single inflate() call. Z_FINISH also informs inflate to not maintain a sliding window if the stream completes, which reduces inflate's memory footprint. If the stream does not complete, either because not all of the stream is provided or not enough output space is provided, then a sliding window will be allocated and inflate() can be called again to continue the operation as if Z_NO_FLUSH had been used. In this implementation, inflate() always flushes as much output as possible to the output buffer, and always uses the faster approach on the first call. So the effects of the flush parameter in this implementation are on the return value of inflate() as noted below, when inflate() returns early when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of memory for a sliding window when Z_FINISH is used. If a preset dictionary is needed after this call (see inflateSetDictionary below), inflate sets strm->adler to the Adler-32 checksum of the dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the Adler-32 checksum of all output produced so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described below. At the end of the stream, inflate() checks that its computed Adler-32 checksum is equal to that saved by the compressor and returns Z_STREAM_END only if the checksum is correct. inflate() can decompress and check either zlib-wrapped or gzip-wrapped deflate data. The header type is detected automatically, if requested when initializing with inflateInit2(). Any information contained in the gzip header is not retained unless inflateGetHeader() is used. When processing gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output produced so far. The CRC-32 is checked against the gzip trailer, as is the uncompressed length, modulo 2^32. inflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced, Z_NEED_DICT if a preset dictionary is needed at this point, Z_DATA_ERROR if the input data was corrupted (input stream not conforming to the zlib format or incorrect check value, in which case strm->msg points to a string with a more specific error), Z_STREAM_ERROR if the stream structure was inconsistent (for example next_in or next_out was Z_NULL, or the state was inadvertently written over by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no progress was possible or if there was not enough room in the output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and inflate() can be called again with more input and more output space to continue decompressing. If Z_DATA_ERROR is returned, the application may then call inflateSync() to look for a good compression block if a partial recovery of the data is to be attempted. */ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state was inconsistent. */ /* Advanced functions */ /* The following functions are needed only in some special applications. */ /* ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy)); This is another version of deflateInit with more compression options. The fields next_in, zalloc, zfree and opaque must be initialized before by the caller. The method parameter is the compression method. It must be Z_DEFLATED in this version of the library. The windowBits parameter is the base two logarithm of the window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. Larger values of this parameter result in better compression at the expense of memory usage. The default value is 15 if deflateInit is used instead. For the current implementation of deflate(), a windowBits value of 8 (a window size of 256 bytes) is not supported. As a result, a request for 8 will result in 9 (a 512-byte window). In that case, providing 8 to inflateInit2() will result in an error when the zlib header with 9 is checked against the initialization of inflate(). The remedy is to not use 8 with deflateInit2() with this initialization, or at least in that case use 9 with inflateInit2(). windowBits can also be -8..-15 for raw deflate. In this case, -windowBits determines the window size. deflate() will then generate raw deflate data with no zlib header or trailer, and will not compute a check value. windowBits can also be greater than 15 for optional gzip encoding. Add 16 to windowBits to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper. The gzip header will have no file name, no extra data, no comment, no modification time (set to zero), no header crc, and the operating system will be set to the appropriate value, if the operating system was determined at compile time. If a gzip stream is being written, strm->adler is a CRC-32 instead of an Adler-32. For raw deflate or gzip encoding, a request for a 256-byte window is rejected as invalid, since only the zlib header provides a means of transmitting the window size to the decompressor. The memLevel parameter specifies how much memory should be allocated for the internal compression state. memLevel=1 uses minimum memory but is slow and reduces compression ratio; memLevel=9 uses maximum memory for optimal speed. The default value is 8. See zconf.h for total memory usage as a function of windowBits and memLevel. The strategy parameter is used to tune the compression algorithm. Use the value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no string match), or Z_RLE to limit match distances to one (run-length encoding). Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better. The effect of Z_FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately. Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit2 does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, const Bytef * dictionary, uInt dictLength)); /* Initializes the compression dictionary from the given byte sequence without producing any compressed output. When using the zlib format, this function must be called immediately after deflateInit, deflateInit2 or deflateReset, and before any call of deflate. When doing raw deflate, this function must be called either before any call of deflate, or immediately after the completion of a deflate block, i.e. after all input has been consumed and all output has been delivered when using any of the flush options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The compressor and decompressor must use exactly the same dictionary (see inflateSetDictionary). The dictionary should consist of strings (byte sequences) that are likely to be encountered later in the data to be compressed, with the most commonly used strings preferably put towards the end of the dictionary. Using a dictionary is most useful when the data to be compressed is short and can be predicted with good accuracy; the data can then be compressed better than with the default empty dictionary. Depending on the size of the compression data structures selected by deflateInit or deflateInit2, a part of the dictionary may in effect be discarded, for example if the dictionary is larger than the window size provided in deflateInit or deflateInit2. Thus the strings most likely to be useful should be put at the end of the dictionary, not at the front. In addition, the current implementation of deflate will use at most the window size minus 262 bytes of the provided dictionary. Upon return of this function, strm->adler is set to the Adler-32 value of the dictionary; the decompressor may later use this value to determine which dictionary has been used by the compressor. (The Adler-32 value applies to the whole dictionary even if only a subset of the dictionary is actually used by the compressor.) If a raw deflate was requested, then the Adler-32 value is not computed and strm->adler is not set. deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent (for example if deflate has already been called for this stream or if not at a block boundary for raw deflate). deflateSetDictionary does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, Bytef * dictionary, uInt * dictLength)); /* Returns the sliding dictionary being maintained by deflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied to dictionary. dictionary must have enough space, where 32768 bytes is always enough. If deflateGetDictionary() is called with dictionary equal to Z_NULL, then only the dictionary length is returned, and nothing is copied. Similary, if dictLength is Z_NULL, then it is not set. deflateGetDictionary() may return a length less than the window size, even when more than the window size in input has been provided. It may return up to 258 bytes less in that case, due to how zlib's implementation of deflate manages the sliding window and lookahead for matches, where matches can be up to 258 bytes long. If the application needs the last window-size bytes of input, then that would need to be saved by the application outside of zlib. deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the stream state is inconsistent. */ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when several compression strategies will be tried, for example when there are several ways of pre-processing the input data with a filter. The streams that will be discarded should then be freed by calling deflateEnd. Note that deflateCopy duplicates the internal compression state which can be quite large, so this strategy is slow and can consume lots of memory. deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate the internal compression state. The stream will leave the compression level and any other attributes that may have been set unchanged. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, int level, int strategy)); /* Dynamically update the compression level and compression strategy. The interpretation of level and strategy is as in deflateInit2(). This can be used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression approach (which is a function of the level) or the strategy is changed, and if there have been any deflate() calls since the state was initialized or reset, then the input available so far is compressed with the old level and strategy using deflate(strm, Z_BLOCK). There are three approaches for the compression levels 0, 1..3, and 4..9 respectively. The new level and strategy will take effect at the next call of deflate(). If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does not have enough output space to complete, then the parameter change will not take effect. In this case, deflateParams() can be called again with the same parameters and more output space to try again. In order to assure a change in the parameters on the first try, the deflate stream should be flushed using deflate() with Z_BLOCK or other flush request until strm.avail_out is not zero, before calling deflateParams(). Then no more input data should be provided before the deflateParams() call. If this is done, the old level and strategy will be applied to the data compressed before deflateParams(), and the new level and strategy will be applied to the the data compressed after deflateParams(). deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if there was not enough output space to complete the compression of the available input data before a change in the strategy or approach. Note that in the case of a Z_BUF_ERROR, the parameters are not changed. A return value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be retried with more output space. */ ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)); /* Fine tune deflate's internal compression parameters. This should only be used by someone who understands the algorithm used by zlib's deflate for searching for the best matching string, and even then only by the most fanatic optimizer trying to squeeze out the last compressed bit for their specific input data. Read the deflate.c source code for the meaning of the max_lazy, good_length, nice_length, and max_chain parameters. deflateTune() can be called after deflateInit() or deflateInit2(), and returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. */ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, uLong sourceLen)); /* deflateBound() returns an upper bound on the compressed size after deflation of sourceLen bytes. It must be called after deflateInit() or deflateInit2(), and after deflateSetHeader(), if used. This would be used to allocate an output buffer for deflation in a single pass, and so would be called before deflate(). If that first deflate() call is provided the sourceLen input bytes, an output buffer allocated to the size returned by deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed to return Z_STREAM_END. Note that it is possible for the compressed size to be larger than the value returned by deflateBound() if flush options other than Z_FINISH or Z_NO_FLUSH are used. */ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, unsigned *pending, int *bits)); /* deflatePending() returns the number of bytes and bits of output that have been generated, but not yet provided in the available output. The bytes not provided would be due to the available output space having being consumed. The number of bits of output not provided are between 0 and 7, where they await more bits to join them in order to fill out a full byte. If pending or bits are Z_NULL, then those values are not set. deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, int bits, int value)); /* deflatePrime() inserts bits in the deflate output stream. The intent is that this function is used to start off the deflate output with the bits leftover from a previous deflate stream when appending to it. As such, this function can only be used for raw deflate, and must be used before the first deflate() call after a deflateInit2() or deflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the output. deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, gz_headerp head)); /* deflateSetHeader() provides gzip header information for when a gzip stream is requested by deflateInit2(). deflateSetHeader() may be called after deflateInit2() or deflateReset() and before the first call of deflate(). The text, time, os, extra field, name, and comment information in the provided gz_header structure are written to the gzip header (xflag is ignored -- the extra flags are set according to the compression level). The caller must assure that, if not Z_NULL, name and comment are terminated with a zero byte, and that if extra is not Z_NULL, that extra_len bytes are available there. If hcrc is true, a gzip header crc is included. Note that the current versions of the command-line version of gzip (up through version 1.3.x) do not support header crc's, and will report that it is a "multi-part gzip file" and give up. If deflateSetHeader is not used, the default gzip header has text false, the time set to zero, and os set to 255, with no extra, name, or comment fields. The gzip header is returned to the default state by deflateReset(). deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, int windowBits)); This is another version of inflateInit with an extra parameter. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. The windowBits parameter is the base two logarithm of the maximum window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. The default value is 15 if inflateInit is used instead. windowBits must be greater than or equal to the windowBits value provided to deflateInit2() while compressing, or it must be equal to 15 if deflateInit2() was not used. If a compressed stream with a larger window size is given as input, inflate() will return with the error code Z_DATA_ERROR instead of trying to allocate a larger window. windowBits can also be zero to request that inflate use the window size in the zlib header of the compressed stream. windowBits can also be -8..-15 for raw inflate. In this case, -windowBits determines the window size. inflate() will then process raw deflate data, not looking for a zlib or gzip header, not generating a check value, and not looking for any check values for comparison at the end of the stream. This is for use with other formats that use the deflate compressed data format such as zip. Those formats provide their own check values. If a custom format is developed using the raw deflate format for compressed data, it is recommended that a check value such as an Adler-32 or a CRC-32 be applied to the uncompressed data as is done in the zlib, gzip, and zip formats. For most applications, the zlib format should be used as is. Note that comments above on the use in deflateInit2() applies to the magnitude of windowBits. windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see below), inflate() will not automatically decode concatenated gzip streams. inflate() will return Z_STREAM_END at the end of the gzip stream. The state would need to be reset to continue decoding a subsequent gzip stream. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit2 does not perform any decompression apart from possibly reading the zlib header if present: actual decompression will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unused and unchanged.) The current implementation of inflateInit2() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, const Bytef * dictionary, uInt dictLength)); /* Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the Adler-32 value returned by that call of inflate. The compressor and decompressor must use exactly the same dictionary (see deflateSetDictionary). For raw inflate, this function can be called at any time to set the dictionary. If the provided dictionary is smaller than the window and there is already data in the window, then the provided dictionary will amend what's there. The application must insure that the dictionary that was used for compression is provided. inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the expected one (incorrect Adler-32 value). inflateSetDictionary does not perform any decompression: this will be done by subsequent calls of inflate(). */ ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, Bytef * dictionary, uInt * dictLength)); /* Returns the sliding dictionary being maintained by inflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied to dictionary. dictionary must have enough space, where 32768 bytes is always enough. If inflateGetDictionary() is called with dictionary equal to Z_NULL, then only the dictionary length is returned, and nothing is copied. Similary, if dictLength is Z_NULL, then it is not set. inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the stream state is inconsistent. */ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); /* Skips invalid compressed data until a possible full flush point (see above for the description of deflate with Z_FULL_FLUSH) can be found, or until all available input is skipped. No output is provided. inflateSync searches for a 00 00 FF FF pattern in the compressed data. All full flush points have this pattern, but not all occurrences of this pattern are full flush points. inflateSync returns Z_OK if a possible full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the success case, the application may save the current current value of total_in which indicates where valid compressed data was found. In the error case, the application may repeatedly call inflateSync, providing more input each time, until success or end of the input data. */ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when randomly accessing a large stream. The first pass through the stream can periodically record the inflate state, allowing restarting inflate at those points when randomly accessing the stream. inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, int windowBits)); /* This function is the same as inflateReset, but it also permits changing the wrap and window size requests. The windowBits parameter is interpreted the same as it is for inflateInit2. If the window size is changed, then the memory allocated for the window is freed, and the window will be reallocated by inflate() if needed. inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL), or if the windowBits parameter is invalid. */ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, int bits, int value)); /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the middle of a byte. The provided bits will be used before any bytes are used from next_in. This function should only be used with raw inflate, and should be used before the first inflate() call after inflateInit2() or inflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the input. If bits is negative, then the input stream bit buffer is emptied. Then inflatePrime() can be called again to put bits in the buffer. This is used to clear out bits leftover after feeding inflate a block description prior to feeding inflate codes. inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); /* This function returns two values, one in the lower 16 bits of the return value, and the other in the remaining upper bits, obtained by shifting the return value down 16 bits. If the upper value is -1 and the lower value is zero, then inflate() is currently decoding information outside of a block. If the upper value is -1 and the lower value is non-zero, then inflate is in the middle of a stored block, with the lower value equaling the number of bytes from the input remaining to copy. If the upper value is not -1, then it is the number of bits back from the current bit position in the input of the code (literal or length/distance pair) currently being processed. In that case the lower value is the number of bytes already emitted for that code. A code is being processed if inflate is waiting for more input to complete decoding of the code, or if it has completed decoding but is waiting for more output space to write the literal or match data. inflateMark() is used to mark locations in the input data for random access, which may be at bit positions, and to note those cases where the output of a code may span boundaries of random access blocks. The current location in the input stream can be determined from avail_in and data_type as noted in the description for the Z_BLOCK flush parameter for inflate. inflateMark returns the value noted above, or -65536 if the provided source stream state was inconsistent. */ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, gz_headerp head)); /* inflateGetHeader() requests that gzip header information be stored in the provided gz_header structure. inflateGetHeader() may be called after inflateInit2() or inflateReset(), and before the first call of inflate(). As inflate() processes the gzip stream, head->done is zero until the header is completed, at which time head->done is set to one. If a zlib stream is being decoded, then head->done is set to -1 to indicate that there will be no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be used to force inflate() to return immediately after header processing is complete and before any actual data is decompressed. The text, time, xflags, and os fields are filled in with the gzip header contents. hcrc is set to true if there is a header CRC. (The header CRC was valid if done is set to one.) If extra is not Z_NULL, then extra_max contains the maximum number of bytes to write to extra. Once done is true, extra_len contains the actual extra field length, and extra contains the extra field, or that field truncated if extra_max is less than extra_len. If name is not Z_NULL, then up to name_max characters are written there, terminated with a zero unless the length is greater than name_max. If comment is not Z_NULL, then up to comm_max characters are written there, terminated with a zero unless the length is greater than comm_max. When any of extra, name, or comment are not Z_NULL and the respective field is not present in the header, then that field is set to Z_NULL to signal its absence. This allows the use of deflateSetHeader() with the returned structure to duplicate the header. However if those fields are set to allocated memory, then the application will need to save those pointers elsewhere so that they can be eventually freed. If inflateGetHeader is not used, then the header information is simply discarded. The header is always checked for validity, including the header CRC if present. inflateReset() will reset the process to discard the header information. The application would need to call inflateGetHeader() again to retrieve the header from the next gzip stream. inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, unsigned char FAR *window)); Initialize the internal stream state for decompression using inflateBack() calls. The fields zalloc, zfree and opaque in strm must be initialized before the call. If zalloc and zfree are Z_NULL, then the default library- derived memory allocation routines are used. windowBits is the base two logarithm of the window size, in the range 8..15. window is a caller supplied buffer of that size. Except for special applications where it is assured that deflate was used with small window sizes, windowBits must be 15 and a 32K byte window must be supplied to be able to decompress general deflate streams. See inflateBack() for the usage of these routines. inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of the parameters are invalid, Z_MEM_ERROR if the internal state could not be allocated, or Z_VERSION_ERROR if the version of the library does not match the version of the header file. */ typedef unsigned (*in_func) OF((void FAR *, z_const unsigned char FAR * FAR *)); typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, in_func in, void FAR * in_desc, out_func out, void FAR * out_desc)); /* inflateBack() does a raw inflate with a single call using a call-back interface for input and output. This is potentially more efficient than inflate() for file i/o applications, in that it avoids copying between the output and the sliding window by simply making the window itself the output buffer. inflate() can be faster on modern CPUs when used with large buffers. inflateBack() trusts the application to not change the output buffer passed by the output function, at least until inflateBack() returns. inflateBackInit() must be called first to allocate the internal state and to initialize the state with the user-provided window buffer. inflateBack() may then be used multiple times to inflate a complete, raw deflate stream with each call. inflateBackEnd() is then called to free the allocated state. A raw deflate stream is one with no zlib or gzip header or trailer. This routine would normally be used in a utility that reads zip or gzip files and writes out uncompressed files. The utility would decode the header and process the trailer on its own, hence this routine expects only the raw deflate stream to decompress. This is different from the default behavior of inflate(), which expects a zlib header and trailer around the deflate stream. inflateBack() uses two subroutines supplied by the caller that are then called by inflateBack() for input and output. inflateBack() calls those routines until it reads a complete deflate stream and writes out all of the uncompressed data, or until it encounters an error. The function's parameters and return types are defined above in the in_func and out_func typedefs. inflateBack() will call in(in_desc, &buf) which should return the number of bytes of provided input, and a pointer to that input in buf. If there is no input available, in() must return zero -- buf is ignored in that case -- and inflateBack() will return a buffer error. inflateBack() will call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() should return zero on success, or non-zero on failure. If out() returns non-zero, inflateBack() will return with an error. Neither in() nor out() are permitted to change the contents of the window provided to inflateBackInit(), which is also the buffer that out() uses to write from. The length written by out() will be at most the window size. Any non-zero amount of input may be provided by in(). For convenience, inflateBack() can be provided input on the first call by setting strm->next_in and strm->avail_in. If that input is exhausted, then in() will be called. Therefore strm->next_in must be initialized before calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in must also be initialized, and then if strm->avail_in is not zero, input will initially be taken from strm->next_in[0 .. strm->avail_in - 1]. The in_desc and out_desc parameters of inflateBack() is passed as the first parameter of in() and out() respectively when they are called. These descriptors can be optionally used to pass any information that the caller- supplied in() and out() functions need to do their job. On return, inflateBack() will set strm->next_in and strm->avail_in to pass back any unused input that was provided by the last in() call. The return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR if in() or out() returned an error, Z_DATA_ERROR if there was a format error in the deflate stream (in which case strm->msg is set to indicate the nature of the error), or Z_STREAM_ERROR if the stream was not properly initialized. In the case of Z_BUF_ERROR, an input or output error can be distinguished using strm->next_in which will be Z_NULL only if in() returned an error. If strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning non-zero. (in() will always be called before out(), so strm->next_in is assured to be defined if out() returns non-zero.) Note that inflateBack() cannot return Z_OK. */ ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); /* All memory allocated by inflateBackInit() is freed. inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream state was inconsistent. */ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); /* Return flags indicating compile-time options. Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: 1.0: size of uInt 3.2: size of uLong 5.4: size of voidpf (pointer) 7.6: size of z_off_t Compiler, assembler, and debug options: 8: ZLIB_DEBUG 9: ASMV or ASMINF -- use ASM code 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention 11: 0 (reserved) One-time table building (smaller code, but not thread-safe if true): 12: BUILDFIXED -- build static block decoding tables when needed 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed 14,15: 0 (reserved) Library content (indicates missing functionality): 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking deflate code when not needed) 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect and decode gzip streams (to avoid linking crc code) 18-19: 0 (reserved) Operation variations (changes in library functionality): 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate 21: FASTEST -- deflate algorithm with only one, lowest compression level 22,23: 0 (reserved) The sprintf variant used by gzprintf (zero is best): 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! 26: 0 = returns value, 1 = void -- 1 means inferred string length returned Remainder: 27-31: 0 (reserved) */ #ifndef Z_SOLO /* utility functions */ /* The following utility functions are implemented on top of the basic stream-oriented functions. To simplify the interface, some default options are assumed (compression level and memory usage, standard memory allocation functions). The source code of these utility functions can be modified if you need special options. */ ZEXTERN int ZEXPORT compress OF((Bytef * dest, uLongf * destLen, const Bytef * source, uLong sourceLen)); /* Compresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed data. compress() is equivalent to compress2() with a level parameter of Z_DEFAULT_COMPRESSION. compress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer. */ ZEXTERN int ZEXPORT compress2 OF((Bytef * dest, uLongf * destLen, const Bytef * source, uLong sourceLen, int level)); /* Compresses the source buffer into the destination buffer. The level parameter has the same meaning as in deflateInit. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed data. compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); /* compressBound() returns an upper bound on the compressed size after compress() or compress2() on sourceLen bytes. It would be used before a compress() or compress2() call to allocate the destination buffer. */ ZEXTERN int ZEXPORT uncompress OF((Bytef * dest, uLongf * destLen, const Bytef * source, uLong sourceLen)); /* Decompresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be large enough to hold the entire uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some mechanism outside the scope of this compression library.) Upon exit, destLen is the actual size of the uncompressed data. uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In the case where there is not enough room, uncompress() will fill the output buffer with the uncompressed data up to that point. */ ZEXTERN int ZEXPORT uncompress2 OF((Bytef * dest, uLongf * destLen, const Bytef * source, uLong * sourceLen)); /* Same as uncompress, except that sourceLen is a pointer, where the length of the source is *sourceLen. On return, *sourceLen is the number of source bytes consumed. */ /* gzip file access functions */ /* This library supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio, using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. */ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ /* ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); Opens a gzip (.gz) file for reading or writing. The mode parameter is as in fopen ("rb" or "wb") but can also include a compression level ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression as in "wb9F". (See the description of deflateInit2 for more information about the strategy parameter.) 'T' will request transparent writing or appending with no compression and not using the gzip format. "a" can be used instead of "w" to request that the gzip stream that will be written be appended to the file. "+" will result in an error, since reading and writing to the same gzip file is not supported. The addition of "x" when writing will create the file exclusively, which fails if the file already exists. On systems that support it, the addition of "e" when reading or writing will set the flag to close the file on an execve() call. These functions, as well as gzip, will read and decode a sequence of gzip streams in a file. The append function of gzopen() can be used to create such a file. (Also see gzflush() for another way to do this.) When appending, gzopen does not test whether the file begins with a gzip stream, nor does it look for the end of the gzip streams to begin appending. gzopen will simply append a gzip stream to the existing file. gzopen can be used to read a file which is not in gzip format; in this case gzread will directly read from the file without decompression. When reading, this will be detected automatically by looking for the magic two- byte gzip header. gzopen returns NULL if the file could not be opened, if there was insufficient memory to allocate the gzFile state, or if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). errno can be checked to determine if the reason gzopen failed was that the file could not be opened. */ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); /* gzdopen associates a gzFile with the file descriptor fd. File descriptors are obtained from calls like open, dup, creat, pipe or fileno (if the file has been previously opened with fopen). The mode parameter is as in gzopen. The next call of gzclose on the returned gzFile will also close the file descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, mode);. The duplicated descriptor should be saved to avoid a leak, since gzdopen does not close fd if it fails. If you are using fileno() to get the file descriptor from a FILE *, then you will have to use dup() to avoid double-close()ing the file descriptor. Both gzclose() and fclose() will close the associated file descriptor, so they need to have different file descriptors. gzdopen returns NULL if there was insufficient memory to allocate the gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided), or if fd is -1. The file descriptor is not used until the next gz* read, write, seek, or close operation, so gzdopen will not detect if fd is invalid (unless fd is -1). */ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); /* Set the internal buffer size used by this library's functions. The default buffer size is 8192 bytes. This function must be called after gzopen() or gzdopen(), and before any other calls that read or write the file. The buffer memory allocation is always deferred to the first read or write. Three times that size in buffer space is allocated. A larger buffer size of, for example, 64K or 128K bytes will noticeably increase the speed of decompression (reading). The new buffer size also affects the maximum length for gzprintf(). gzbuffer() returns 0 on success, or -1 on failure, such as being called too late. */ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); /* Dynamically update the compression level or strategy. See the description of deflateInit2 for the meaning of these parameters. Previously provided data is flushed before the parameter change. gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not opened for writing, Z_ERRNO if there is an error writing the flushed data, or Z_MEM_ERROR if there is a memory allocation error. */ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); /* Reads the given number of uncompressed bytes from the compressed file. If the input file is not in gzip format, gzread copies the given number of bytes into the buffer directly from the file. After reaching the end of a gzip stream in the input, gzread will continue to read, looking for another gzip stream. Any number of gzip streams may be concatenated in the input file, and will all be decompressed by gzread(). If something other than a gzip stream is encountered after a gzip stream, that remaining trailing garbage is ignored (and no error is returned). gzread can be used to read a gzip file that is being concurrently written. Upon reaching the end of the input, gzread will return with the available data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then gzclearerr can be used to clear the end of file indicator in order to permit gzread to be tried again. Z_OK indicates that a gzip stream was completed on the last gzread. Z_BUF_ERROR indicates that the input file ended in the middle of a gzip stream. Note that gzread does not return -1 in the event of an incomplete gzip stream. This error is deferred until gzclose(), which will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip stream. Alternatively, gzerror can be used before gzclose to detect this case. gzread returns the number of uncompressed bytes actually read, less than len for end of file, or -1 for error. If len is too large to fit in an int, then nothing is read, -1 is returned, and the error state is set to Z_STREAM_ERROR. */ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, gzFile file)); /* Read up to nitems items of size size from file to buf, otherwise operating as gzread() does. This duplicates the interface of stdio's fread(), with size_t request and return types. If the library defines size_t, then z_size_t is identical to size_t. If not, then z_size_t is an unsigned integer type that can contain a pointer. gzfread() returns the number of full items read of size size, or zero if the end of the file was reached and a full item could not be read, or if there was an error. gzerror() must be consulted if zero is returned in order to determine if there was an error. If the multiplication of size and nitems overflows, i.e. the product does not fit in a z_size_t, then nothing is read, zero is returned, and the error state is set to Z_STREAM_ERROR. In the event that the end of file is reached and only a partial item is available at the end, i.e. the remaining uncompressed data length is not a multiple of size, then the final partial item is nevetheless read into buf and the end-of-file flag is set. The length of the partial item read is not provided, but could be inferred from the result of gztell(). This behavior is the same as the behavior of fread() implementations in common libraries, but it prevents the direct use of gzfread() to read a concurrently written file, reseting and retrying on end-of-file, when size is not 1. */ ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); /* Writes the given number of uncompressed bytes into the compressed file. gzwrite returns the number of uncompressed bytes written or 0 in case of error. */ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, z_size_t nitems, gzFile file)); /* gzfwrite() writes nitems items of size size from buf to file, duplicating the interface of stdio's fwrite(), with size_t request and return types. If the library defines size_t, then z_size_t is identical to size_t. If not, then z_size_t is an unsigned integer type that can contain a pointer. gzfwrite() returns the number of full items written of size size, or zero if there was an error. If the multiplication of size and nitems overflows, i.e. the product does not fit in a z_size_t, then nothing is written, zero is returned, and the error state is set to Z_STREAM_ERROR. */ ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); /* Converts, formats, and writes the arguments to the compressed file under control of the format string, as in fprintf. gzprintf returns the number of uncompressed bytes actually written, or a negative zlib error code in case of error. The number of uncompressed bytes written is limited to 8191, or one less than the buffer size given to gzbuffer(). The caller should assure that this limit is not exceeded. If it is exceeded, then gzprintf() will return an error (0) with nothing written. In this case, there may also be a buffer overflow with unpredictable consequences, which is possible only if zlib was compiled with the insecure functions sprintf() or vsprintf() because the secure snprintf() or vsnprintf() functions were not available. This can be determined using zlibCompileFlags(). */ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); /* Writes the given null-terminated string to the compressed file, excluding the terminating null character. gzputs returns the number of characters written, or -1 in case of error. */ ZEXTERN char *ZEXPORT gzgets OF((gzFile file, char *buf, int len)); /* Reads bytes from the compressed file until len-1 characters are read, or a newline character is read and transferred to buf, or an end-of-file condition is encountered. If any characters are read or if len == 1, the string is terminated with a null character. If no characters are read due to an end-of-file or len < 1, then the buffer is left untouched. gzgets returns buf which is a null-terminated string, or it returns NULL for end-of-file or in case of error. If there was an error, the contents at buf are indeterminate. */ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); /* Writes c, converted to an unsigned char, into the compressed file. gzputc returns the value that was written, or -1 in case of error. */ ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); /* Reads one byte from the compressed file. gzgetc returns this byte or -1 in case of end of file or error. This is implemented as a macro for speed. As such, it does not do all of the checking the other functions do. I.e. it does not check to see if file is NULL, nor whether the structure file points to has been clobbered or not. */ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); /* Push one character back onto the stream to be read as the first character on the next read. At least one character of push-back is allowed. gzungetc() returns the character pushed, or -1 on failure. gzungetc() will fail if c is -1, and may fail if a character has been pushed but not read yet. If gzungetc is used immediately after gzopen or gzdopen, at least the output buffer size of pushed characters is allowed. (See gzbuffer above.) The pushed character will be discarded if the stream is repositioned with gzseek() or gzrewind(). */ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); /* Flushes all pending output into the compressed file. The parameter flush is as in the deflate() function. The return value is the zlib error number (see function gzerror below). gzflush is only permitted when writing. If the flush parameter is Z_FINISH, the remaining data is written and the gzip stream is completed in the output. If gzwrite() is called again, a new gzip stream will be started in the output. gzread() is able to read such concatenated gzip streams. gzflush should be called only when strictly necessary because it will degrade compression if called too often. */ /* ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, z_off_t offset, int whence)); Sets the starting position for the next gzread or gzwrite on the given compressed file. The offset represents a number of bytes in the uncompressed data stream. The whence parameter is defined as in lseek(2); the value SEEK_END is not supported. If the file is opened for reading, this function is emulated but can be extremely slow. If the file is opened for writing, only forward seeks are supported; gzseek then compresses a sequence of zeroes up to the new starting position. gzseek returns the resulting offset location as measured in bytes from the beginning of the uncompressed stream, or -1 in case of error, in particular if the file is opened for writing and the new starting position would be before the current position. */ ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); /* Rewinds the given file. This function is supported only for reading. gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) */ /* ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); Returns the starting position for the next gzread or gzwrite on the given compressed file. This position represents a number of bytes in the uncompressed data stream, and is zero when starting, even if appending or reading a gzip stream from the middle of a file using gzdopen(). gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) */ /* ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); Returns the current offset in the file being read or written. This offset includes the count of bytes that precede the gzip stream, for example when appending or when using gzdopen() for reading. When reading, the offset does not include as yet unused buffered input. This information can be used for a progress indicator. On error, gzoffset() returns -1. */ ZEXTERN int ZEXPORT gzeof OF((gzFile file)); /* Returns true (1) if the end-of-file indicator has been set while reading, false (0) otherwise. Note that the end-of-file indicator is set only if the read tried to go past the end of the input, but came up short. Therefore, just like feof(), gzeof() may return false even if there is no more data to read, in the event that the last read request was for the exact number of bytes remaining in the input file. This will happen if the input file size is an exact multiple of the buffer size. If gzeof() returns true, then the read functions will return no more data, unless the end-of-file indicator is reset by gzclearerr() and the input file has grown since the previous end of file was detected. */ ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); /* Returns true (1) if file is being copied directly while reading, or false (0) if file is a gzip stream being decompressed. If the input file is empty, gzdirect() will return true, since the input does not contain a gzip stream. If gzdirect() is used immediately after gzopen() or gzdopen() it will cause buffers to be allocated to allow reading the file to determine if it is a gzip file. Therefore if gzbuffer() is used, it should be called before gzdirect(). When writing, gzdirect() returns true (1) if transparent writing was requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: gzdirect() is not needed when writing. Transparent writing must be explicitly requested, so the application already knows the answer. When linking statically, using gzdirect() will include all of the zlib code for gzip file reading and decompression, which may not be desired.) */ ZEXTERN int ZEXPORT gzclose OF((gzFile file)); /* Flushes all pending output if necessary, closes the compressed file and deallocates the (de)compression state. Note that once file is closed, you cannot call gzerror with file, since its structures have been deallocated. gzclose must not be called more than once on the same file, just as free must not be called more than once on the same allocation. gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the last read ended in the middle of a gzip stream, or Z_OK on success. */ ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); /* Same as gzclose(), but gzclose_r() is only for use when reading, and gzclose_w() is only for use when writing or appending. The advantage to using these instead of gzclose() is that they avoid linking in zlib compression or decompression code that is not used when only reading or only writing respectively. If gzclose() is used, then both compression and decompression code will be included the application when linking to a static zlib library. */ ZEXTERN const char *ZEXPORT gzerror OF((gzFile file, int *errnum)); /* Returns the error message for the last error which occurred on the given compressed file. errnum is set to zlib error number. If an error occurred in the file system and not in the compression library, errnum is set to Z_ERRNO and the application may consult errno to get the exact error code. The application must not modify the returned string. Future calls to this function may invalidate the previously returned string. If file is closed, then the string previously returned by gzerror will no longer be available. gzerror() should be used to distinguish errors from end-of-file for those functions above that do not distinguish those cases in their return values. */ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); /* Clears the error and end-of-file flags for file. This is analogous to the clearerr() function in stdio. This is useful for continuing to read a gzip file that is being written concurrently. */ #endif /* !Z_SOLO */ /* checksum functions */ /* These functions are not related to compression but are exported anyway because they might be useful in applications using the compression library. */ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef * buf, uInt len)); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. If buf is Z_NULL, this function returns the required initial value for the checksum. An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed much faster. Usage example: uLong adler = adler32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { adler = adler32(adler, buffer, length); } if (adler != original_adler) error(); */ ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef * buf, z_size_t len)); /* Same as adler32(), but with a size_t length. */ /* ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, z_off_t len2)); Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note that the z_off_t type (like off_t) is a signed integer. If len2 is negative, the result has no meaning or utility. */ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef * buf, uInt len)); /* Update a running CRC-32 with the bytes buf[0..len-1] and return the updated CRC-32. If buf is Z_NULL, this function returns the required initial value for the crc. Pre- and post-conditioning (one's complement) is performed within this function so it shouldn't be done by the application. Usage example: uLong crc = crc32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { crc = crc32(crc, buffer, length); } if (crc != original_crc) error(); */ ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef * buf, z_size_t len)); /* Same as crc32(), but with a size_t length. */ /* ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); Combine two CRC-32 check values into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and len2. */ /* various hacks, don't look :) */ /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, const char *version, int stream_size)); ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, unsigned char FAR * window, const char *version, int stream_size)); #ifdef Z_PREFIX_SET # define z_deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) # define z_inflateInit(strm) \ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) # define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) # define z_inflateInit2(strm, windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ (int)sizeof(z_stream)) # define z_inflateBackInit(strm, windowBits, window) \ inflateBackInit_((strm), (windowBits), (window), \ ZLIB_VERSION, (int)sizeof(z_stream)) #else # define deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) # define inflateInit(strm) \ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) # define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) # define inflateInit2(strm, windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ (int)sizeof(z_stream)) # define inflateBackInit(strm, windowBits, window) \ inflateBackInit_((strm), (windowBits), (window), \ ZLIB_VERSION, (int)sizeof(z_stream)) #endif #ifndef Z_SOLO /* gzgetc() macro and its supporting function and exposed data structure. Note * that the real internal state is much larger than the exposed structure. * This abbreviated structure exposes just enough for the gzgetc() macro. The * user should not mess with these exposed elements, since their names or * behavior could change in the future, perhaps even capriciously. They can * only be used by the gzgetc() macro. You have been warned. */ struct gzFile_s { unsigned have; unsigned char *next; z_off64_t pos; }; ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ #ifdef Z_PREFIX_SET # undef z_gzgetc # define z_gzgetc(g) \ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) #else # define gzgetc(g) \ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) #endif /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if * both are true, the application gets the *64 functions, and the regular * functions are changed to 64 bits) -- in case these are set on systems * without large file support, _LFS64_LARGEFILE must also be true */ #ifdef Z_LARGE64 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); #endif #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) # ifdef Z_PREFIX_SET # define z_gzopen z_gzopen64 # define z_gzseek z_gzseek64 # define z_gztell z_gztell64 # define z_gzoffset z_gzoffset64 # define z_adler32_combine z_adler32_combine64 # define z_crc32_combine z_crc32_combine64 # else # define gzopen gzopen64 # define gzseek gzseek64 # define gztell gztell64 # define gzoffset gzoffset64 # define adler32_combine adler32_combine64 # define crc32_combine crc32_combine64 # endif # ifndef Z_LARGE64 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); # endif #else ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); #endif #else /* Z_SOLO */ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); #endif /* !Z_SOLO */ /* undocumented functions */ ZEXTERN const char *ZEXPORT zError OF((int)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); ZEXTERN const z_crc_t FAR *ZEXPORT get_crc_table OF((void)); ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF((z_streamp)); ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); #if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO) ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t * path, const char *mode)); #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) # ifndef Z_SOLO ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, const char *format, va_list va)); # endif #endif #ifdef __cplusplus } #endif #endif /* ZLIB_H */ ================================================ FILE: v2/headers/linux_386/usr/lib/gcc/i686-linux-gnu/7/include/float.h ================================================ /* Copyright (C) 2002-2017 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* * ISO C Standard: 5.2.4.2.2 Characteristics of floating types */ #ifndef _FLOAT_H___ #define _FLOAT_H___ /* Radix of exponent representation, b. */ #undef FLT_RADIX #define FLT_RADIX __FLT_RADIX__ /* Number of base-FLT_RADIX digits in the significand, p. */ #undef FLT_MANT_DIG #undef DBL_MANT_DIG #undef LDBL_MANT_DIG #define FLT_MANT_DIG __FLT_MANT_DIG__ #define DBL_MANT_DIG __DBL_MANT_DIG__ #define LDBL_MANT_DIG __LDBL_MANT_DIG__ /* Number of decimal digits, q, such that any floating-point number with q decimal digits can be rounded into a floating-point number with p radix b digits and back again without change to the q decimal digits, p * log10(b) if b is a power of 10 floor((p - 1) * log10(b)) otherwise */ #undef FLT_DIG #undef DBL_DIG #undef LDBL_DIG #define FLT_DIG __FLT_DIG__ #define DBL_DIG __DBL_DIG__ #define LDBL_DIG __LDBL_DIG__ /* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */ #undef FLT_MIN_EXP #undef DBL_MIN_EXP #undef LDBL_MIN_EXP #define FLT_MIN_EXP __FLT_MIN_EXP__ #define DBL_MIN_EXP __DBL_MIN_EXP__ #define LDBL_MIN_EXP __LDBL_MIN_EXP__ /* Minimum negative integer such that 10 raised to that power is in the range of normalized floating-point numbers, ceil(log10(b) * (emin - 1)) */ #undef FLT_MIN_10_EXP #undef DBL_MIN_10_EXP #undef LDBL_MIN_10_EXP #define FLT_MIN_10_EXP __FLT_MIN_10_EXP__ #define DBL_MIN_10_EXP __DBL_MIN_10_EXP__ #define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ /* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */ #undef FLT_MAX_EXP #undef DBL_MAX_EXP #undef LDBL_MAX_EXP #define FLT_MAX_EXP __FLT_MAX_EXP__ #define DBL_MAX_EXP __DBL_MAX_EXP__ #define LDBL_MAX_EXP __LDBL_MAX_EXP__ /* Maximum integer such that 10 raised to that power is in the range of representable finite floating-point numbers, floor(log10((1 - b**-p) * b**emax)) */ #undef FLT_MAX_10_EXP #undef DBL_MAX_10_EXP #undef LDBL_MAX_10_EXP #define FLT_MAX_10_EXP __FLT_MAX_10_EXP__ #define DBL_MAX_10_EXP __DBL_MAX_10_EXP__ #define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ /* Maximum representable finite floating-point number, (1 - b**-p) * b**emax */ #undef FLT_MAX #undef DBL_MAX #undef LDBL_MAX #define FLT_MAX __FLT_MAX__ #define DBL_MAX __DBL_MAX__ #define LDBL_MAX __LDBL_MAX__ /* The difference between 1 and the least value greater than 1 that is representable in the given floating point type, b**1-p. */ #undef FLT_EPSILON #undef DBL_EPSILON #undef LDBL_EPSILON #define FLT_EPSILON __FLT_EPSILON__ #define DBL_EPSILON __DBL_EPSILON__ #define LDBL_EPSILON __LDBL_EPSILON__ /* Minimum normalized positive floating-point number, b**(emin - 1). */ #undef FLT_MIN #undef DBL_MIN #undef LDBL_MIN #define FLT_MIN __FLT_MIN__ #define DBL_MIN __DBL_MIN__ #define LDBL_MIN __LDBL_MIN__ /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */ /* ??? This is supposed to change with calls to fesetround in . */ #undef FLT_ROUNDS #define FLT_ROUNDS 1 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ || (defined (__cplusplus) && __cplusplus >= 201103L) /* The floating-point expression evaluation method. The precise definitions of these values are generalised to include support for the interchange and extended types defined in ISO/IEC TS 18661-3. Prior to this (for C99/C11) the definitions were: -1 indeterminate 0 evaluate all operations and constants just to the range and precision of the type 1 evaluate operations and constants of type float and double to the range and precision of the double type, evaluate long double operations and constants to the range and precision of the long double type 2 evaluate all operations and constants to the range and precision of the long double type The TS 18661-3 definitions are: -1 indeterminate 0 evaluate all operations and constants, whose semantic type has at most the range and precision of float, to the range and precision of float; evaluate all other operations and constants to the range and precision of the semantic type. 1 evaluate all operations and constants, whose semantic type has at most the range and precision of double, to the range and precision of double; evaluate all other operations and constants to the range and precision of the semantic type. 2 evaluate all operations and constants, whose semantic type has at most the range and precision of long double, to the range and precision of long double; evaluate all other operations and constants to the range and precision of the semantic type. N where _FloatN is a supported interchange floating type evaluate all operations and constants, whose semantic type has at most the range and precision of the _FloatN type, to the range and precision of the _FloatN type; evaluate all other operations and constants to the range and precision of the semantic type. N + 1, where _FloatNx is a supported extended floating type evaluate operations and constants, whose semantic type has at most the range and precision of the _FloatNx type, to the range and precision of the _FloatNx type; evaluate all other operations and constants to the range and precision of the semantic type. The compiler predefines two macros: __FLT_EVAL_METHOD__ Which, depending on the value given for -fpermitted-flt-eval-methods, may be limited to only those values for FLT_EVAL_METHOD defined in C99/C11. __FLT_EVAL_METHOD_TS_18661_3__ Which always permits the values for FLT_EVAL_METHOD defined in ISO/IEC TS 18661-3. Here we want to use __FLT_EVAL_METHOD__, unless __STDC_WANT_IEC_60559_TYPES_EXT__ is defined, in which case the user is specifically asking for the ISO/IEC TS 18661-3 types, so we use __FLT_EVAL_METHOD_TS_18661_3__. ??? This ought to change with the setting of the fp control word; the value provided by the compiler assumes the widest setting. */ #undef FLT_EVAL_METHOD #ifdef __STDC_WANT_IEC_60559_TYPES_EXT__ #define FLT_EVAL_METHOD __FLT_EVAL_METHOD_TS_18661_3__ #else #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ #endif /* Number of decimal digits, n, such that any floating-point number in the widest supported floating type with pmax radix b digits can be rounded to a floating-point number with n decimal digits and back again without change to the value, pmax * log10(b) if b is a power of 10 ceil(1 + pmax * log10(b)) otherwise */ #undef DECIMAL_DIG #define DECIMAL_DIG __DECIMAL_DIG__ #endif /* C99 */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L /* Versions of DECIMAL_DIG for each floating-point type. */ #undef FLT_DECIMAL_DIG #undef DBL_DECIMAL_DIG #undef LDBL_DECIMAL_DIG #define FLT_DECIMAL_DIG __FLT_DECIMAL_DIG__ #define DBL_DECIMAL_DIG __DBL_DECIMAL_DIG__ #define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__ /* Whether types support subnormal numbers. */ #undef FLT_HAS_SUBNORM #undef DBL_HAS_SUBNORM #undef LDBL_HAS_SUBNORM #define FLT_HAS_SUBNORM __FLT_HAS_DENORM__ #define DBL_HAS_SUBNORM __DBL_HAS_DENORM__ #define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__ /* Minimum positive values, including subnormals. */ #undef FLT_TRUE_MIN #undef DBL_TRUE_MIN #undef LDBL_TRUE_MIN #define FLT_TRUE_MIN __FLT_DENORM_MIN__ #define DBL_TRUE_MIN __DBL_DENORM_MIN__ #define LDBL_TRUE_MIN __LDBL_DENORM_MIN__ #endif /* C11 */ #ifdef __STDC_WANT_IEC_60559_BFP_EXT__ /* Number of decimal digits for which conversions between decimal character strings and binary formats, in both directions, are correctly rounded. */ #define CR_DECIMAL_DIG __UINTMAX_MAX__ #endif #ifdef __STDC_WANT_IEC_60559_TYPES_EXT__ /* Constants for _FloatN and _FloatNx types from TS 18661-3. See comments above for their semantics. */ #ifdef __FLT16_MANT_DIG__ #undef FLT16_MANT_DIG #define FLT16_MANT_DIG __FLT16_MANT_DIG__ #undef FLT16_DIG #define FLT16_DIG __FLT16_DIG__ #undef FLT16_MIN_EXP #define FLT16_MIN_EXP __FLT16_MIN_EXP__ #undef FLT16_MIN_10_EXP #define FLT16_MIN_10_EXP __FLT16_MIN_10_EXP__ #undef FLT16_MAX_EXP #define FLT16_MAX_EXP __FLT16_MAX_EXP__ #undef FLT16_MAX_10_EXP #define FLT16_MAX_10_EXP __FLT16_MAX_10_EXP__ #undef FLT16_MAX #define FLT16_MAX __FLT16_MAX__ #undef FLT16_EPSILON #define FLT16_EPSILON __FLT16_EPSILON__ #undef FLT16_MIN #define FLT16_MIN __FLT16_MIN__ #undef FLT16_DECIMAL_DIG #define FLT16_DECIMAL_DIG __FLT16_DECIMAL_DIG__ #undef FLT16_TRUE_MIN #define FLT16_TRUE_MIN __FLT16_DENORM_MIN__ #endif /* __FLT16_MANT_DIG__. */ #ifdef __FLT32_MANT_DIG__ #undef FLT32_MANT_DIG #define FLT32_MANT_DIG __FLT32_MANT_DIG__ #undef FLT32_DIG #define FLT32_DIG __FLT32_DIG__ #undef FLT32_MIN_EXP #define FLT32_MIN_EXP __FLT32_MIN_EXP__ #undef FLT32_MIN_10_EXP #define FLT32_MIN_10_EXP __FLT32_MIN_10_EXP__ #undef FLT32_MAX_EXP #define FLT32_MAX_EXP __FLT32_MAX_EXP__ #undef FLT32_MAX_10_EXP #define FLT32_MAX_10_EXP __FLT32_MAX_10_EXP__ #undef FLT32_MAX #define FLT32_MAX __FLT32_MAX__ #undef FLT32_EPSILON #define FLT32_EPSILON __FLT32_EPSILON__ #undef FLT32_MIN #define FLT32_MIN __FLT32_MIN__ #undef FLT32_DECIMAL_DIG #define FLT32_DECIMAL_DIG __FLT32_DECIMAL_DIG__ #undef FLT32_TRUE_MIN #define FLT32_TRUE_MIN __FLT32_DENORM_MIN__ #endif /* __FLT32_MANT_DIG__. */ #ifdef __FLT64_MANT_DIG__ #undef FLT64_MANT_DIG #define FLT64_MANT_DIG __FLT64_MANT_DIG__ #undef FLT64_DIG #define FLT64_DIG __FLT64_DIG__ #undef FLT64_MIN_EXP #define FLT64_MIN_EXP __FLT64_MIN_EXP__ #undef FLT64_MIN_10_EXP #define FLT64_MIN_10_EXP __FLT64_MIN_10_EXP__ #undef FLT64_MAX_EXP #define FLT64_MAX_EXP __FLT64_MAX_EXP__ #undef FLT64_MAX_10_EXP #define FLT64_MAX_10_EXP __FLT64_MAX_10_EXP__ #undef FLT64_MAX #define FLT64_MAX __FLT64_MAX__ #undef FLT64_EPSILON #define FLT64_EPSILON __FLT64_EPSILON__ #undef FLT64_MIN #define FLT64_MIN __FLT64_MIN__ #undef FLT64_DECIMAL_DIG #define FLT64_DECIMAL_DIG __FLT64_DECIMAL_DIG__ #undef FLT64_TRUE_MIN #define FLT64_TRUE_MIN __FLT64_DENORM_MIN__ #endif /* __FLT64_MANT_DIG__. */ #ifdef __FLT128_MANT_DIG__ #undef FLT128_MANT_DIG #define FLT128_MANT_DIG __FLT128_MANT_DIG__ #undef FLT128_DIG #define FLT128_DIG __FLT128_DIG__ #undef FLT128_MIN_EXP #define FLT128_MIN_EXP __FLT128_MIN_EXP__ #undef FLT128_MIN_10_EXP #define FLT128_MIN_10_EXP __FLT128_MIN_10_EXP__ #undef FLT128_MAX_EXP #define FLT128_MAX_EXP __FLT128_MAX_EXP__ #undef FLT128_MAX_10_EXP #define FLT128_MAX_10_EXP __FLT128_MAX_10_EXP__ #undef FLT128_MAX #define FLT128_MAX __FLT128_MAX__ #undef FLT128_EPSILON #define FLT128_EPSILON __FLT128_EPSILON__ #undef FLT128_MIN #define FLT128_MIN __FLT128_MIN__ #undef FLT128_DECIMAL_DIG #define FLT128_DECIMAL_DIG __FLT128_DECIMAL_DIG__ #undef FLT128_TRUE_MIN #define FLT128_TRUE_MIN __FLT128_DENORM_MIN__ #endif /* __FLT128_MANT_DIG__. */ #ifdef __FLT32X_MANT_DIG__ #undef FLT32X_MANT_DIG #define FLT32X_MANT_DIG __FLT32X_MANT_DIG__ #undef FLT32X_DIG #define FLT32X_DIG __FLT32X_DIG__ #undef FLT32X_MIN_EXP #define FLT32X_MIN_EXP __FLT32X_MIN_EXP__ #undef FLT32X_MIN_10_EXP #define FLT32X_MIN_10_EXP __FLT32X_MIN_10_EXP__ #undef FLT32X_MAX_EXP #define FLT32X_MAX_EXP __FLT32X_MAX_EXP__ #undef FLT32X_MAX_10_EXP #define FLT32X_MAX_10_EXP __FLT32X_MAX_10_EXP__ #undef FLT32X_MAX #define FLT32X_MAX __FLT32X_MAX__ #undef FLT32X_EPSILON #define FLT32X_EPSILON __FLT32X_EPSILON__ #undef FLT32X_MIN #define FLT32X_MIN __FLT32X_MIN__ #undef FLT32X_DECIMAL_DIG #define FLT32X_DECIMAL_DIG __FLT32X_DECIMAL_DIG__ #undef FLT32X_TRUE_MIN #define FLT32X_TRUE_MIN __FLT32X_DENORM_MIN__ #endif /* __FLT32X_MANT_DIG__. */ #ifdef __FLT64X_MANT_DIG__ #undef FLT64X_MANT_DIG #define FLT64X_MANT_DIG __FLT64X_MANT_DIG__ #undef FLT64X_DIG #define FLT64X_DIG __FLT64X_DIG__ #undef FLT64X_MIN_EXP #define FLT64X_MIN_EXP __FLT64X_MIN_EXP__ #undef FLT64X_MIN_10_EXP #define FLT64X_MIN_10_EXP __FLT64X_MIN_10_EXP__ #undef FLT64X_MAX_EXP #define FLT64X_MAX_EXP __FLT64X_MAX_EXP__ #undef FLT64X_MAX_10_EXP #define FLT64X_MAX_10_EXP __FLT64X_MAX_10_EXP__ #undef FLT64X_MAX #define FLT64X_MAX __FLT64X_MAX__ #undef FLT64X_EPSILON #define FLT64X_EPSILON __FLT64X_EPSILON__ #undef FLT64X_MIN #define FLT64X_MIN __FLT64X_MIN__ #undef FLT64X_DECIMAL_DIG #define FLT64X_DECIMAL_DIG __FLT64X_DECIMAL_DIG__ #undef FLT64X_TRUE_MIN #define FLT64X_TRUE_MIN __FLT64X_DENORM_MIN__ #endif /* __FLT64X_MANT_DIG__. */ #ifdef __FLT128X_MANT_DIG__ #undef FLT128X_MANT_DIG #define FLT128X_MANT_DIG __FLT128X_MANT_DIG__ #undef FLT128X_DIG #define FLT128X_DIG __FLT128X_DIG__ #undef FLT128X_MIN_EXP #define FLT128X_MIN_EXP __FLT128X_MIN_EXP__ #undef FLT128X_MIN_10_EXP #define FLT128X_MIN_10_EXP __FLT128X_MIN_10_EXP__ #undef FLT128X_MAX_EXP #define FLT128X_MAX_EXP __FLT128X_MAX_EXP__ #undef FLT128X_MAX_10_EXP #define FLT128X_MAX_10_EXP __FLT128X_MAX_10_EXP__ #undef FLT128X_MAX #define FLT128X_MAX __FLT128X_MAX__ #undef FLT128X_EPSILON #define FLT128X_EPSILON __FLT128X_EPSILON__ #undef FLT128X_MIN #define FLT128X_MIN __FLT128X_MIN__ #undef FLT128X_DECIMAL_DIG #define FLT128X_DECIMAL_DIG __FLT128X_DECIMAL_DIG__ #undef FLT128X_TRUE_MIN #define FLT128X_TRUE_MIN __FLT128X_DENORM_MIN__ #endif /* __FLT128X_MANT_DIG__. */ #endif /* __STDC_WANT_IEC_60559_TYPES_EXT__. */ #ifdef __STDC_WANT_DEC_FP__ /* Draft Technical Report 24732, extension for decimal floating-point arithmetic: Characteristic of decimal floating types . */ /* Number of base-FLT_RADIX digits in the significand, p. */ #undef DEC32_MANT_DIG #undef DEC64_MANT_DIG #undef DEC128_MANT_DIG #define DEC32_MANT_DIG __DEC32_MANT_DIG__ #define DEC64_MANT_DIG __DEC64_MANT_DIG__ #define DEC128_MANT_DIG __DEC128_MANT_DIG__ /* Minimum exponent. */ #undef DEC32_MIN_EXP #undef DEC64_MIN_EXP #undef DEC128_MIN_EXP #define DEC32_MIN_EXP __DEC32_MIN_EXP__ #define DEC64_MIN_EXP __DEC64_MIN_EXP__ #define DEC128_MIN_EXP __DEC128_MIN_EXP__ /* Maximum exponent. */ #undef DEC32_MAX_EXP #undef DEC64_MAX_EXP #undef DEC128_MAX_EXP #define DEC32_MAX_EXP __DEC32_MAX_EXP__ #define DEC64_MAX_EXP __DEC64_MAX_EXP__ #define DEC128_MAX_EXP __DEC128_MAX_EXP__ /* Maximum representable finite decimal floating-point number (there are 6, 15, and 33 9s after the decimal points respectively). */ #undef DEC32_MAX #undef DEC64_MAX #undef DEC128_MAX #define DEC32_MAX __DEC32_MAX__ #define DEC64_MAX __DEC64_MAX__ #define DEC128_MAX __DEC128_MAX__ /* The difference between 1 and the least value greater than 1 that is representable in the given floating point type. */ #undef DEC32_EPSILON #undef DEC64_EPSILON #undef DEC128_EPSILON #define DEC32_EPSILON __DEC32_EPSILON__ #define DEC64_EPSILON __DEC64_EPSILON__ #define DEC128_EPSILON __DEC128_EPSILON__ /* Minimum normalized positive floating-point number. */ #undef DEC32_MIN #undef DEC64_MIN #undef DEC128_MIN #define DEC32_MIN __DEC32_MIN__ #define DEC64_MIN __DEC64_MIN__ #define DEC128_MIN __DEC128_MIN__ /* Minimum subnormal positive floating-point number. */ #undef DEC32_SUBNORMAL_MIN #undef DEC64_SUBNORMAL_MIN #undef DEC128_SUBNORMAL_MIN #define DEC32_SUBNORMAL_MIN __DEC32_SUBNORMAL_MIN__ #define DEC64_SUBNORMAL_MIN __DEC64_SUBNORMAL_MIN__ #define DEC128_SUBNORMAL_MIN __DEC128_SUBNORMAL_MIN__ /* The floating-point expression evaluation method. -1 indeterminate 0 evaluate all operations and constants just to the range and precision of the type 1 evaluate operations and constants of type _Decimal32 and _Decimal64 to the range and precision of the _Decimal64 type, evaluate _Decimal128 operations and constants to the range and precision of the _Decimal128 type; 2 evaluate all operations and constants to the range and precision of the _Decimal128 type. */ #undef DEC_EVAL_METHOD #define DEC_EVAL_METHOD __DEC_EVAL_METHOD__ #endif /* __STDC_WANT_DEC_FP__ */ #endif /* _FLOAT_H___ */ ================================================ FILE: v2/headers/linux_386/usr/lib/gcc/i686-linux-gnu/7/include/stdarg.h ================================================ /* Copyright (C) 1989-2017 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* * ISO C Standard: 7.15 Variable arguments */ #ifndef _STDARG_H #ifndef _ANSI_STDARG_H_ #ifndef __need___va_list #define _STDARG_H #define _ANSI_STDARG_H_ #endif /* not __need___va_list */ #undef __need___va_list /* Define __gnuc_va_list. */ #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST typedef __builtin_va_list __gnuc_va_list; #endif /* Define the standard macros for the user, if this invocation was from the user program. */ #ifdef _STDARG_H #define va_start(v,l) __builtin_va_start(v,l) #define va_end(v) __builtin_va_end(v) #define va_arg(v,l) __builtin_va_arg(v,l) #if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L \ || __cplusplus + 0 >= 201103L #define va_copy(d,s) __builtin_va_copy(d,s) #endif #define __va_copy(d,s) __builtin_va_copy(d,s) /* Define va_list, if desired, from __gnuc_va_list. */ /* We deliberately do not define va_list when called from stdio.h, because ANSI C says that stdio.h is not supposed to define va_list. stdio.h needs to have access to that data type, but must not use that name. It should use the name __gnuc_va_list, which is safe because it is reserved for the implementation. */ #ifdef _BSD_VA_LIST #undef _BSD_VA_LIST #endif #if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST)) /* SVR4.2 uses _VA_LIST for an internal alias for va_list, so we must avoid testing it and setting it here. SVR4 uses _VA_LIST as a flag in stdarg.h, but we should have no conflict with that. */ #ifndef _VA_LIST_ #define _VA_LIST_ #ifdef __i860__ #ifndef _VA_LIST #define _VA_LIST va_list #endif #endif /* __i860__ */ typedef __gnuc_va_list va_list; #ifdef _SCO_DS #define __VA_LIST #endif #endif /* _VA_LIST_ */ #else /* not __svr4__ || _SCO_DS */ /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. But on BSD NET2 we must not test or define or undef it. (Note that the comments in NET 2's ansi.h are incorrect for _VA_LIST_--see stdio.h!) */ #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT) /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */ #ifndef _VA_LIST_DEFINED /* The macro _VA_LIST is used in SCO Unix 3.2. */ #ifndef _VA_LIST /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ #ifndef _VA_LIST_T_H /* The macro __va_list__ is used by BeOS. */ #ifndef __va_list__ typedef __gnuc_va_list va_list; #endif /* not __va_list__ */ #endif /* not _VA_LIST_T_H */ #endif /* not _VA_LIST */ #endif /* not _VA_LIST_DEFINED */ #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) #define _VA_LIST_ #endif #ifndef _VA_LIST #define _VA_LIST #endif #ifndef _VA_LIST_DEFINED #define _VA_LIST_DEFINED #endif #ifndef _VA_LIST_T_H #define _VA_LIST_T_H #endif #ifndef __va_list__ #define __va_list__ #endif #endif /* not _VA_LIST_, except on certain systems */ #endif /* not __svr4__ */ #endif /* _STDARG_H */ #endif /* not _ANSI_STDARG_H_ */ #endif /* not _STDARG_H */ ================================================ FILE: v2/headers/linux_386/usr/lib/gcc/i686-linux-gnu/7/include/stdbool.h ================================================ /* Copyright (C) 1998-2017 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* * ISO C Standard: 7.16 Boolean type and values */ #ifndef _STDBOOL_H #define _STDBOOL_H #ifndef __cplusplus #define bool _Bool #define true 1 #define false 0 #else /* __cplusplus */ /* Supporting _Bool in C++ is a GCC extension. */ #define _Bool bool #if __cplusplus < 201103L /* Defining these macros in C++98 is a GCC extension. */ #define bool bool #define false false #define true true #endif #endif /* __cplusplus */ /* Signal that all the definitions are present. */ #define __bool_true_false_are_defined 1 #endif /* stdbool.h */ ================================================ FILE: v2/headers/linux_386/usr/lib/gcc/i686-linux-gnu/7/include/stddef.h ================================================ /* Copyright (C) 1989-2017 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* * ISO C Standard: 7.17 Common definitions */ #if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \ && !defined(__STDDEF_H__)) \ || defined(__need_wchar_t) || defined(__need_size_t) \ || defined(__need_ptrdiff_t) || defined(__need_NULL) \ || defined(__need_wint_t) /* Any one of these symbols __need_* means that GNU libc wants us just to define one data type. So don't define the symbols that indicate this file's entire job has been done. */ #if (!defined(__need_wchar_t) && !defined(__need_size_t) \ && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \ && !defined(__need_wint_t)) #define _STDDEF_H #define _STDDEF_H_ /* snaroff@next.com says the NeXT needs this. */ #define _ANSI_STDDEF_H #endif #ifndef __sys_stdtypes_h /* This avoids lossage on SunOS but only if stdtypes.h comes first. There's no way to win with the other order! Sun lossage. */ /* On 4.3bsd-net2, make sure ansi.h is included, so we have one less case to deal with in the following. */ #if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__) #include #endif /* On FreeBSD 5, machine/ansi.h does not exist anymore... */ #if defined (__FreeBSD__) && (__FreeBSD__ >= 5) #include #endif /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are defined if the corresponding type is *not* defined. FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_. NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_ */ #if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) #if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_) #define _SIZE_T #endif #if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_) #define _PTRDIFF_T #endif /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ instead of _WCHAR_T_. */ #if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_) #ifndef _BSD_WCHAR_T_ #define _WCHAR_T #endif #endif /* Undef _FOO_T_ if we are supposed to define foo_t. */ #if defined (__need_ptrdiff_t) || defined (_STDDEF_H_) #undef _PTRDIFF_T_ #undef _BSD_PTRDIFF_T_ #endif #if defined (__need_size_t) || defined (_STDDEF_H_) #undef _SIZE_T_ #undef _BSD_SIZE_T_ #endif #if defined (__need_wchar_t) || defined (_STDDEF_H_) #undef _WCHAR_T_ #undef _BSD_WCHAR_T_ #endif #endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) */ /* Sequent's header files use _PTRDIFF_T_ in some conflicting way. Just ignore it. */ #if defined (__sequent__) && defined (_PTRDIFF_T_) #undef _PTRDIFF_T_ #endif /* On VxWorks, may have defined macros like _TYPE_size_t which will typedef size_t. fixincludes patched the vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is not defined, and so that defining this macro defines _GCC_SIZE_T. If we find that the macros are still defined at this point, we must invoke them so that the type is defined as expected. */ #if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_)) _TYPE_ptrdiff_t; #undef _TYPE_ptrdiff_t #endif #if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_)) _TYPE_size_t; #undef _TYPE_size_t #endif #if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_)) _TYPE_wchar_t; #undef _TYPE_wchar_t #endif /* In case nobody has defined these types, but we aren't running under GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and __WCHAR_TYPE__ have reasonable values. This can happen if the parts of GCC is compiled by an older compiler, that actually include gstddef.h, such as collect2. */ /* Signed type of difference of two pointers. */ /* Define this type if we are doing the whole job, or if we want this type in particular. */ #if defined (_STDDEF_H) || defined (__need_ptrdiff_t) #ifndef _PTRDIFF_T /* in case has defined it. */ #ifndef _T_PTRDIFF_ #ifndef _T_PTRDIFF #ifndef __PTRDIFF_T #ifndef _PTRDIFF_T_ #ifndef _BSD_PTRDIFF_T_ #ifndef ___int_ptrdiff_t_h #ifndef _GCC_PTRDIFF_T #ifndef _PTRDIFF_T_DECLARED /* DragonFly */ #define _PTRDIFF_T #define _T_PTRDIFF_ #define _T_PTRDIFF #define __PTRDIFF_T #define _PTRDIFF_T_ #define _BSD_PTRDIFF_T_ #define ___int_ptrdiff_t_h #define _GCC_PTRDIFF_T #define _PTRDIFF_T_DECLARED #ifndef __PTRDIFF_TYPE__ #define __PTRDIFF_TYPE__ long int #endif typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif /* _PTRDIFF_T_DECLARED */ #endif /* _GCC_PTRDIFF_T */ #endif /* ___int_ptrdiff_t_h */ #endif /* _BSD_PTRDIFF_T_ */ #endif /* _PTRDIFF_T_ */ #endif /* __PTRDIFF_T */ #endif /* _T_PTRDIFF */ #endif /* _T_PTRDIFF_ */ #endif /* _PTRDIFF_T */ /* If this symbol has done its job, get rid of it. */ #undef __need_ptrdiff_t #endif /* _STDDEF_H or __need_ptrdiff_t. */ /* Unsigned type of `sizeof' something. */ /* Define this type if we are doing the whole job, or if we want this type in particular. */ #if defined (_STDDEF_H) || defined (__need_size_t) #ifndef __size_t__ /* BeOS */ #ifndef __SIZE_T__ /* Cray Unicos/Mk */ #ifndef _SIZE_T /* in case has defined it. */ #ifndef _SYS_SIZE_T_H #ifndef _T_SIZE_ #ifndef _T_SIZE #ifndef __SIZE_T #ifndef _SIZE_T_ #ifndef _BSD_SIZE_T_ #ifndef _SIZE_T_DEFINED_ #ifndef _SIZE_T_DEFINED #ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */ #ifndef _SIZE_T_DECLARED /* FreeBSD 5 */ #ifndef ___int_size_t_h #ifndef _GCC_SIZE_T #ifndef _SIZET_ #ifndef __size_t #define __size_t__ /* BeOS */ #define __SIZE_T__ /* Cray Unicos/Mk */ #define _SIZE_T #define _SYS_SIZE_T_H #define _T_SIZE_ #define _T_SIZE #define __SIZE_T #define _SIZE_T_ #define _BSD_SIZE_T_ #define _SIZE_T_DEFINED_ #define _SIZE_T_DEFINED #define _BSD_SIZE_T_DEFINED_ /* Darwin */ #define _SIZE_T_DECLARED /* FreeBSD 5 */ #define ___int_size_t_h #define _GCC_SIZE_T #define _SIZET_ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ || defined(__DragonFly__) \ || defined(__FreeBSD_kernel__) /* __size_t is a typedef on FreeBSD 5, must not trash it. */ #elif defined (__VMS__) /* __size_t is also a typedef on VMS. */ #else #define __size_t #endif #ifndef __SIZE_TYPE__ #define __SIZE_TYPE__ long unsigned int #endif #if !(defined (__GNUG__) && defined (size_t)) typedef __SIZE_TYPE__ size_t; #ifdef __BEOS__ typedef long ssize_t; #endif /* __BEOS__ */ #endif /* !(defined (__GNUG__) && defined (size_t)) */ #endif /* __size_t */ #endif /* _SIZET_ */ #endif /* _GCC_SIZE_T */ #endif /* ___int_size_t_h */ #endif /* _SIZE_T_DECLARED */ #endif /* _BSD_SIZE_T_DEFINED_ */ #endif /* _SIZE_T_DEFINED */ #endif /* _SIZE_T_DEFINED_ */ #endif /* _BSD_SIZE_T_ */ #endif /* _SIZE_T_ */ #endif /* __SIZE_T */ #endif /* _T_SIZE */ #endif /* _T_SIZE_ */ #endif /* _SYS_SIZE_T_H */ #endif /* _SIZE_T */ #endif /* __SIZE_T__ */ #endif /* __size_t__ */ #undef __need_size_t #endif /* _STDDEF_H or __need_size_t. */ /* Wide character type. Locale-writers should change this as necessary to be big enough to hold unique values not between 0 and 127, and not (wchar_t) -1, for each defined multibyte character. */ /* Define this type if we are doing the whole job, or if we want this type in particular. */ #if defined (_STDDEF_H) || defined (__need_wchar_t) #ifndef __wchar_t__ /* BeOS */ #ifndef __WCHAR_T__ /* Cray Unicos/Mk */ #ifndef _WCHAR_T #ifndef _T_WCHAR_ #ifndef _T_WCHAR #ifndef __WCHAR_T #ifndef _WCHAR_T_ #ifndef _BSD_WCHAR_T_ #ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */ #ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */ #ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */ #ifndef _WCHAR_T_DEFINED_ #ifndef _WCHAR_T_DEFINED #ifndef _WCHAR_T_H #ifndef ___int_wchar_t_h #ifndef __INT_WCHAR_T_H #ifndef _GCC_WCHAR_T #define __wchar_t__ /* BeOS */ #define __WCHAR_T__ /* Cray Unicos/Mk */ #define _WCHAR_T #define _T_WCHAR_ #define _T_WCHAR #define __WCHAR_T #define _WCHAR_T_ #define _BSD_WCHAR_T_ #define _WCHAR_T_DEFINED_ #define _WCHAR_T_DEFINED #define _WCHAR_T_H #define ___int_wchar_t_h #define __INT_WCHAR_T_H #define _GCC_WCHAR_T #define _WCHAR_T_DECLARED /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other symbols in the _FOO_T_ family, stays defined even after its corresponding type is defined). If we define wchar_t, then we must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if we undef _WCHAR_T_, then we must also define rune_t, since headers like runetype.h assume that if machine/ansi.h is included, and _BSD_WCHAR_T_ is not defined, then rune_t is available. machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of the same type." */ #ifdef _BSD_WCHAR_T_ #undef _BSD_WCHAR_T_ #ifdef _BSD_RUNE_T_ #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) typedef _BSD_RUNE_T_ rune_t; #define _BSD_WCHAR_T_DEFINED_ #define _BSD_RUNE_T_DEFINED_ /* Darwin */ #if defined (__FreeBSD__) && (__FreeBSD__ < 5) /* Why is this file so hard to maintain properly? In contrast to the comment above regarding BSD/386 1.1, on FreeBSD for as long as the symbol has existed, _BSD_RUNE_T_ must not stay defined or redundant typedefs will occur when stdlib.h is included after this file. */ #undef _BSD_RUNE_T_ #endif #endif #endif #endif /* FreeBSD 5 can't be handled well using "traditional" logic above since it no longer defines _BSD_RUNE_T_ yet still desires to export rune_t in some cases... */ #if defined (__FreeBSD__) && (__FreeBSD__ >= 5) #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) #if __BSD_VISIBLE #ifndef _RUNE_T_DECLARED typedef __rune_t rune_t; #define _RUNE_T_DECLARED #endif #endif #endif #endif #ifndef __WCHAR_TYPE__ #define __WCHAR_TYPE__ int #endif #ifndef __cplusplus typedef __WCHAR_TYPE__ wchar_t; #endif #endif #endif #endif #endif #endif #endif #endif /* _WCHAR_T_DECLARED */ #endif /* _BSD_RUNE_T_DEFINED_ */ #endif #endif #endif #endif #endif #endif #endif #endif /* __WCHAR_T__ */ #endif /* __wchar_t__ */ #undef __need_wchar_t #endif /* _STDDEF_H or __need_wchar_t. */ #if defined (__need_wint_t) #ifndef _WINT_T #define _WINT_T #ifndef __WINT_TYPE__ #define __WINT_TYPE__ unsigned int #endif typedef __WINT_TYPE__ wint_t; #endif #undef __need_wint_t #endif /* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. are already defined. */ /* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */ /* NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here. */ #if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) /* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_ are probably typos and should be removed before 2.8 is released. */ #ifdef _GCC_PTRDIFF_T_ #undef _PTRDIFF_T_ #undef _BSD_PTRDIFF_T_ #endif #ifdef _GCC_SIZE_T_ #undef _SIZE_T_ #undef _BSD_SIZE_T_ #endif #ifdef _GCC_WCHAR_T_ #undef _WCHAR_T_ #undef _BSD_WCHAR_T_ #endif /* The following ones are the real ones. */ #ifdef _GCC_PTRDIFF_T #undef _PTRDIFF_T_ #undef _BSD_PTRDIFF_T_ #endif #ifdef _GCC_SIZE_T #undef _SIZE_T_ #undef _BSD_SIZE_T_ #endif #ifdef _GCC_WCHAR_T #undef _WCHAR_T_ #undef _BSD_WCHAR_T_ #endif #endif /* _ANSI_H_ || _MACHINE_ANSI_H_ || _X86_64_ANSI_H_ || _I386_ANSI_H_ */ #endif /* __sys_stdtypes_h */ /* A null pointer constant. */ #if defined (_STDDEF_H) || defined (__need_NULL) #undef NULL /* in case has defined it. */ #ifdef __GNUG__ #define NULL __null #else /* G++ */ #ifndef __cplusplus #define NULL ((void *)0) #else /* C++ */ #define NULL 0 #endif /* C++ */ #endif /* G++ */ #endif /* NULL not defined and or need NULL. */ #undef __need_NULL #ifdef _STDDEF_H /* Offset of member MEMBER in a struct of type TYPE. */ #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \ || (defined(__cplusplus) && __cplusplus >= 201103L) #ifndef _GCC_MAX_ALIGN_T #define _GCC_MAX_ALIGN_T /* Type whose alignment is supported in every context and is at least as great as that of any standard type not using alignment specifiers. */ typedef struct { long long __max_align_ll __attribute__ ((__aligned__(__alignof__(long long)))); long double __max_align_ld __attribute__ ((__aligned__(__alignof__(long double)))); /* _Float128 is defined as a basic type, so max_align_t must be sufficiently aligned for it. This code must work in C++, so we use __float128 here; that is only available on some architectures, but only on i386 is extra alignment needed for __float128. */ #ifdef __i386__ __float128 __max_align_f128 __attribute__ ((__aligned__(__alignof(__float128)))); #endif } max_align_t; #endif #endif /* C11 or C++11. */ #if defined(__cplusplus) && __cplusplus >= 201103L #ifndef _GXX_NULLPTR_T #define _GXX_NULLPTR_T typedef decltype(nullptr) nullptr_t; #endif #endif /* C++11. */ #endif /* _STDDEF_H was defined this time */ #endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__ || __need_XXX was not defined before */ ================================================ FILE: v2/headers/linux_386/usr/lib/gcc/i686-linux-gnu/7/include/stdint.h ================================================ #ifndef _GCC_WRAP_STDINT_H #if __STDC_HOSTED__ # if defined __cplusplus && __cplusplus >= 201103L # undef __STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS # undef __STDC_CONSTANT_MACROS # define __STDC_CONSTANT_MACROS # endif # include_next #else # include "stdint-gcc.h" #endif #define _GCC_WRAP_STDINT_H #endif ================================================ FILE: v2/headers/linux_386/usr/lib/gcc/i686-linux-gnu/7/include-fixed/limits.h ================================================ /* Copyright (C) 1992-2017 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* This administrivia gets added to the beginning of limits.h if the system has its own version of limits.h. */ /* We use _GCC_LIMITS_H_ because we want this not to match any macros that the system's limits.h uses for its own purposes. */ #ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */ #define _GCC_LIMITS_H_ #ifndef _LIBC_LIMITS_H_ /* Use "..." so that we find syslimits.h only in this same directory. */ #include "syslimits.h" #endif /* Copyright (C) 1991-2017 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _LIMITS_H___ #define _LIMITS_H___ /* Number of bits in a `char'. */ #undef CHAR_BIT #define CHAR_BIT __CHAR_BIT__ /* Maximum length of a multibyte character. */ #ifndef MB_LEN_MAX #define MB_LEN_MAX 1 #endif /* Minimum and maximum values a `signed char' can hold. */ #undef SCHAR_MIN #define SCHAR_MIN (-SCHAR_MAX - 1) #undef SCHAR_MAX #define SCHAR_MAX __SCHAR_MAX__ /* Maximum value an `unsigned char' can hold. (Minimum is 0). */ #undef UCHAR_MAX #if __SCHAR_MAX__ == __INT_MAX__ # define UCHAR_MAX (SCHAR_MAX * 2U + 1U) #else # define UCHAR_MAX (SCHAR_MAX * 2 + 1) #endif /* Minimum and maximum values a `char' can hold. */ #ifdef __CHAR_UNSIGNED__ # undef CHAR_MIN # if __SCHAR_MAX__ == __INT_MAX__ # define CHAR_MIN 0U # else # define CHAR_MIN 0 # endif # undef CHAR_MAX # define CHAR_MAX UCHAR_MAX #else # undef CHAR_MIN # define CHAR_MIN SCHAR_MIN # undef CHAR_MAX # define CHAR_MAX SCHAR_MAX #endif /* Minimum and maximum values a `signed short int' can hold. */ #undef SHRT_MIN #define SHRT_MIN (-SHRT_MAX - 1) #undef SHRT_MAX #define SHRT_MAX __SHRT_MAX__ /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */ #undef USHRT_MAX #if __SHRT_MAX__ == __INT_MAX__ # define USHRT_MAX (SHRT_MAX * 2U + 1U) #else # define USHRT_MAX (SHRT_MAX * 2 + 1) #endif /* Minimum and maximum values a `signed int' can hold. */ #undef INT_MIN #define INT_MIN (-INT_MAX - 1) #undef INT_MAX #define INT_MAX __INT_MAX__ /* Maximum value an `unsigned int' can hold. (Minimum is 0). */ #undef UINT_MAX #define UINT_MAX (INT_MAX * 2U + 1U) /* Minimum and maximum values a `signed long int' can hold. (Same as `int'). */ #undef LONG_MIN #define LONG_MIN (-LONG_MAX - 1L) #undef LONG_MAX #define LONG_MAX __LONG_MAX__ /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */ #undef ULONG_MAX #define ULONG_MAX (LONG_MAX * 2UL + 1UL) #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* Minimum and maximum values a `signed long long int' can hold. */ # undef LLONG_MIN # define LLONG_MIN (-LLONG_MAX - 1LL) # undef LLONG_MAX # define LLONG_MAX __LONG_LONG_MAX__ /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ # undef ULLONG_MAX # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) #endif #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__) /* Minimum and maximum values a `signed long long int' can hold. */ # undef LONG_LONG_MIN # define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL) # undef LONG_LONG_MAX # define LONG_LONG_MAX __LONG_LONG_MAX__ /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ # undef ULONG_LONG_MAX # define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL) #endif #ifdef __STDC_WANT_IEC_60559_BFP_EXT__ /* TS 18661-1 widths of integer types. */ # undef CHAR_WIDTH # define CHAR_WIDTH __SCHAR_WIDTH__ # undef SCHAR_WIDTH # define SCHAR_WIDTH __SCHAR_WIDTH__ # undef UCHAR_WIDTH # define UCHAR_WIDTH __SCHAR_WIDTH__ # undef SHRT_WIDTH # define SHRT_WIDTH __SHRT_WIDTH__ # undef USHRT_WIDTH # define USHRT_WIDTH __SHRT_WIDTH__ # undef INT_WIDTH # define INT_WIDTH __INT_WIDTH__ # undef UINT_WIDTH # define UINT_WIDTH __INT_WIDTH__ # undef LONG_WIDTH # define LONG_WIDTH __LONG_WIDTH__ # undef ULONG_WIDTH # define ULONG_WIDTH __LONG_WIDTH__ # undef LLONG_WIDTH # define LLONG_WIDTH __LONG_LONG_WIDTH__ # undef ULLONG_WIDTH # define ULLONG_WIDTH __LONG_LONG_WIDTH__ #endif #endif /* _LIMITS_H___ */ /* This administrivia gets added to the end of limits.h if the system has its own version of limits.h. */ #else /* not _GCC_LIMITS_H_ */ #ifdef _GCC_NEXT_LIMITS_H #include_next /* recurse down to the real one */ #endif #endif /* not _GCC_LIMITS_H_ */ ================================================ FILE: v2/headers/linux_386/usr/lib/gcc/i686-linux-gnu/7/include-fixed/syslimits.h ================================================ /* syslimits.h stands for the system's own limits.h file. If we can use it ok unmodified, then we install this text. If fixincludes fixes it, then the fixed version is installed instead of this text. */ #define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */ #include_next #undef _GCC_NEXT_LIMITS_H ================================================ FILE: v2/headers/linux_amd64/builtin.h ================================================ // Copyright 2018 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore #ifndef _BUILTIN_H_ #define _BUILTIN_H_ #include "predefined.h" typedef void *__builtin_va_list; typedef void *__FILE_TYPE__; __SIZE_TYPE__ __builtin_strlen(char *__s); __UINT64_TYPE__ __builtin_bswap64(__UINT64_TYPE__ x); __builtin_va_list __builtin_va_copy(); char *__builtin_strchrnul(char *, int); char *__builtin_strcpy(char *__dest, char *__src); double __builtin_copysign(double x, double y); int __builtin_abs(int j); int __builtin_ffs(int i); int __builtin_isprint(int); int __builtin_memcmp(void *__s1, void *__s2, __SIZE_TYPE__ __n); int __builtin_printf(char *__format, ...); int __builtin_sprintf(char *__s, char *__format, ...); int __builtin_strcmp(char *__s1, char *__s2); int __signbit(double x); int __signbitf(float x); void *__GO2__(char*); void *__builtin_alloca(__SIZE_TYPE__ __size); void *__builtin_memcpy(void *dest, const void *src, __SIZE_TYPE__ n); void *__builtin_memset(void *s, int c, __SIZE_TYPE__ n); void __GO__(char*); void __builtin_abort(void); void __builtin_exit(int __status); void __builtin_free(void*); void __builtin_trap(void); void __builtin_va_end(__builtin_va_list); void __register_stdfiles(void *, void *, void *, void *); #define __builtin_choose_expr(a, b, c) (a) ? (b) : (c) #define __builtin_expect(exp, c) (exp) #define __builtin_offsetof(st, m) ((__SIZE_TYPE__)(&((st *)0)->m)) #define __builtin_prefetch(addr, ...) (void)(addr) #define __builtin_signbit(x) (sizeof(x) == sizeof(float) ? __signbitf(x) : sizeof (x) == sizeof(double) ? __signbit(x) : __signbitl(x)) #define __builtin_types_compatible_p(type1, type2) __builtin_types_compatible__((type1){}, (type2){}) #define __builtin_va_arg(ap, type) (type)ap #ifdef __ccgo__ #define __builtin_va_copy(dest, src) dest = __builtin_va_copy(src) #define __builtin_va_end(ap) __builtin_va_end(ap) #define __builtin_va_start(ap, arg) ap = __GO2__("X__builtin_va_start(tls, ap)") #else #define __builtin_va_copy(dest, src) dest = src #define __builtin_va_end(ap) ap = (void*)0 #define __builtin_va_start(ap, arg) ap = (void*)-1 #endif #define __complex__ _Complex #define __const const #define __extension__ #define __typeof__ typeof #define __volatile volatile #endif /* _BUILTIN_H_ */ ================================================ FILE: v2/headers/linux_amd64/paths ================================================ /usr/lib64/gcc/x86_64-suse-linux/4.8/include /usr/local/include /usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed /usr/x86_64-suse-linux/include /usr/include ================================================ FILE: v2/headers/linux_amd64/predefined.h ================================================ // Code generated by $ go generate - DO NOT EDIT. // +build ignore #define __DBL_MIN_EXP__ (-1021) #define __UINT_LEAST16_MAX__ 65535 #define __ATOMIC_ACQUIRE 2 #define __FLT_MIN__ 1.17549435082228750797e-38F #define __UINT_LEAST8_TYPE__ unsigned char #define __INTMAX_C(c) c ## L #define __CHAR_BIT__ 8 #define __UINT8_MAX__ 255 #define __WINT_MAX__ 4294967295U #define __ORDER_LITTLE_ENDIAN__ 1234 #define __SIZE_MAX__ 18446744073709551615UL #define __WCHAR_MAX__ 2147483647 #define __DBL_DENORM_MIN__ ((double)4.94065645841246544177e-324L) #define __FLT_EVAL_METHOD__ 0 #define __unix__ 1 #define __x86_64 1 #define __UINT_FAST64_MAX__ 18446744073709551615UL #define __SIG_ATOMIC_TYPE__ int #define __DBL_MIN_10_EXP__ (-307) #define __FINITE_MATH_ONLY__ 0 #define __UINT_FAST8_MAX__ 255 #define __DEC64_MAX_EXP__ 385 #define __INT8_C(c) c #define __UINT_LEAST64_MAX__ 18446744073709551615UL #define __SHRT_MAX__ 32767 #define __LDBL_MAX__ 1.18973149535723176502e+4932L #define __UINT_LEAST8_MAX__ 255 #define __UINTMAX_TYPE__ long unsigned int #define __linux 1 #define __DEC32_EPSILON__ 1E-6DF #define __unix 1 #define __UINT32_MAX__ 4294967295U #define __LDBL_MAX_EXP__ 16384 #define __WINT_MIN__ 0U #define __linux__ 1 #define __SCHAR_MAX__ 127 #define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1) #define __INT64_C(c) c ## L #define __DBL_DIG__ 15 #define __SIZEOF_INT__ 4 #define __SIZEOF_POINTER__ 8 #define __USER_LABEL_PREFIX__ #define __STDC_HOSTED__ 1 #define __LDBL_HAS_INFINITY__ 1 #define __FLT_EPSILON__ 1.19209289550781250000e-7F #define __LDBL_MIN__ 3.36210314311209350626e-4932L #define __DEC32_MAX__ 9.999999E96DF #define __INT32_MAX__ 2147483647 #define __SIZEOF_LONG__ 8 #define __STDC_IEC_559__ 1 #define __STDC_ISO_10646__ 201304L #define __UINT16_C(c) c #define __DECIMAL_DIG__ 21 #define __LDBL_HAS_QUIET_NAN__ 1 #define __MMX__ 1 #define __FLT_HAS_DENORM__ 1 #define __SIZEOF_LONG_DOUBLE__ 16 #define __BIGGEST_ALIGNMENT__ 16 #define __DBL_MAX__ ((double)1.79769313486231570815e+308L) #define __INT_FAST32_MAX__ 9223372036854775807L #define __DBL_HAS_INFINITY__ 1 #define __DEC32_MIN_EXP__ (-94) #define __INT_FAST16_TYPE__ long int #define __STRICT_ANSI__ 1 #define __LDBL_HAS_DENORM__ 1 #define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL #define __INT_LEAST32_MAX__ 2147483647 #define __DEC32_MIN__ 1E-95DF #define __DBL_MAX_EXP__ 1024 #define __DEC128_EPSILON__ 1E-33DL #define __SSE2_MATH__ 1 #define __ATOMIC_HLE_RELEASE 131072 #define __PTRDIFF_MAX__ 9223372036854775807L #define __amd64 1 #define __STDC_NO_THREADS__ 1 #define __ATOMIC_HLE_ACQUIRE 65536 #define __LONG_LONG_MAX__ 9223372036854775807LL #define __SIZEOF_SIZE_T__ 8 #define __SIZEOF_WINT_T__ 4 #define __GXX_ABI_VERSION 1002 #define __FLT_MIN_EXP__ (-125) #define __INT_FAST64_TYPE__ long int #define __DBL_MIN__ ((double)2.22507385850720138309e-308L) #define __LP64__ 1 #define __DECIMAL_BID_FORMAT__ 1 #define __DEC128_MIN__ 1E-6143DL #define __REGISTER_PREFIX__ #define __UINT16_MAX__ 65535 #define __DBL_HAS_DENORM__ 1 #define __UINT8_TYPE__ unsigned char #define __NO_INLINE__ 1 #define __FLT_MANT_DIG__ 24 #define __VERSION__ "4.8.5" #define __UINT64_C(c) c ## UL #define _STDC_PREDEF_H 1 #define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __STDC_IEC_559_COMPLEX__ 1 #define __INT32_C(c) c #define __DEC64_EPSILON__ 1E-15DD #define __ORDER_PDP_ENDIAN__ 3412 #define __DEC128_MIN_EXP__ (-6142) #define __INT_FAST32_TYPE__ long int #define __UINT_LEAST16_TYPE__ short unsigned int #define __INT16_MAX__ 32767 #define __SIZE_TYPE__ long unsigned int #define __UINT64_MAX__ 18446744073709551615UL #define __INT8_TYPE__ signed char #define __ELF__ 1 #define __FLT_RADIX__ 2 #define __INT_LEAST16_TYPE__ short int #define __LDBL_EPSILON__ 1.08420217248550443401e-19L #define __UINTMAX_C(c) c ## UL #define __SSE_MATH__ 1 #define __k8 1 #define __SIG_ATOMIC_MAX__ 2147483647 #define __SIZEOF_PTRDIFF_T__ 8 #define __x86_64__ 1 #define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF #define __INT_FAST16_MAX__ 9223372036854775807L #define __UINT_FAST32_MAX__ 18446744073709551615UL #define __UINT_LEAST64_TYPE__ long unsigned int #define __FLT_HAS_QUIET_NAN__ 1 #define __FLT_MAX_10_EXP__ 38 #define __LONG_MAX__ 9223372036854775807L #define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL #define __FLT_HAS_INFINITY__ 1 #define __UINT_FAST16_TYPE__ long unsigned int #define __DEC64_MAX__ 9.999999999999999E384DD #define __CHAR16_TYPE__ short unsigned int #define __PRAGMA_REDEFINE_EXTNAME 1 #define __INT_LEAST16_MAX__ 32767 #define __DEC64_MANT_DIG__ 16 #define __INT64_MAX__ 9223372036854775807L #define __UINT_LEAST32_MAX__ 4294967295U #define __INT_LEAST64_TYPE__ long int #define __INT16_TYPE__ short int #define __INT_LEAST8_TYPE__ signed char #define __STDC_VERSION__ 199901L #define __DEC32_MAX_EXP__ 97 #define __INT_FAST8_MAX__ 127 #define __INTPTR_MAX__ 9223372036854775807L #define __SSE2__ 1 #define __LDBL_MANT_DIG__ 64 #define __DBL_HAS_QUIET_NAN__ 1 #define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1) #define __code_model_small__ 1 #define __k8__ 1 #define __INTPTR_TYPE__ long int #define __UINT16_TYPE__ short unsigned int #define __WCHAR_TYPE__ int #define __SIZEOF_FLOAT__ 4 #define __UINTPTR_MAX__ 18446744073709551615UL #define __DEC64_MIN_EXP__ (-382) #define __INT_FAST64_MAX__ 9223372036854775807L #define __FLT_DIG__ 6 #define __UINT_FAST64_TYPE__ long unsigned int #define __INT_MAX__ 2147483647 #define __amd64__ 1 #define __INT64_TYPE__ long int #define __FLT_MAX_EXP__ 128 #define __ORDER_BIG_ENDIAN__ 4321 #define __DBL_MANT_DIG__ 53 #define __INT_LEAST64_MAX__ 9223372036854775807L #define __DEC64_MIN__ 1E-383DD #define __WINT_TYPE__ unsigned int #define __UINT_LEAST32_TYPE__ unsigned int #define __SIZEOF_SHORT__ 2 #define __SSE__ 1 #define __LDBL_MIN_EXP__ (-16381) #define __INT_LEAST8_MAX__ 127 #define __SIZEOF_INT128__ 16 #define __LDBL_MAX_10_EXP__ 4932 #define __ATOMIC_RELAXED 0 #define __DBL_EPSILON__ ((double)2.22044604925031308085e-16L) #define _LP64 1 #define __UINT8_C(c) c #define __INT_LEAST32_TYPE__ int #define __SIZEOF_WCHAR_T__ 4 #define __UINT64_TYPE__ long unsigned int #define __INT_FAST8_TYPE__ signed char #define __DBL_DECIMAL_DIG__ 17 #define __FXSR__ 1 #define __DEC_EVAL_METHOD__ 2 #define __UINT32_C(c) c ## U #define __INTMAX_MAX__ 9223372036854775807L #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __FLT_DENORM_MIN__ 1.40129846432481707092e-45F #define __INT8_MAX__ 127 #define __UINT_FAST32_TYPE__ long unsigned int #define __CHAR32_TYPE__ unsigned int #define __FLT_MAX__ 3.40282346638528859812e+38F #define __INT32_TYPE__ int #define __SIZEOF_DOUBLE__ 8 #define __FLT_MIN_10_EXP__ (-37) #define __INTMAX_TYPE__ long int #define __DEC128_MAX_EXP__ 6145 #define __ATOMIC_CONSUME 1 #define __UINTMAX_MAX__ 18446744073709551615UL #define __DEC32_MANT_DIG__ 7 #define __DBL_MAX_10_EXP__ 308 #define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L #define __INT16_C(c) c #define __STDC__ 1 #define __PTRDIFF_TYPE__ long int #define __ATOMIC_SEQ_CST 5 #define __UINT32_TYPE__ unsigned int #define __UINTPTR_TYPE__ long unsigned int #define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD #define __DEC128_MANT_DIG__ 34 #define __LDBL_MIN_10_EXP__ (-4931) #define __SIZEOF_LONG_LONG__ 8 #define __LDBL_DIG__ 18 #define __FLT_DECIMAL_DIG__ 9 #define __UINT_FAST16_MAX__ 18446744073709551615UL #define __UINT_FAST8_TYPE__ unsigned char #define __ATOMIC_ACQ_REL 4 #define __ATOMIC_RELEASE 3 ================================================ FILE: v2/headers/linux_amd64/usr/include/_G_config.h ================================================ /* This file is needed by libio to define various configuration parameters. These are always the same in the GNU C library. */ #ifndef _G_config_h #define _G_config_h 1 /* Define types for libio in terms of the standard internal type names. */ #include #define __need_size_t #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # define __need_wchar_t #endif #define __need_NULL #include #define __need_mbstate_t #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # define __need_wint_t #endif #include typedef struct { __off_t __pos; __mbstate_t __state; } _G_fpos_t; typedef struct { __off64_t __pos; __mbstate_t __state; } _G_fpos64_t; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # include typedef union { struct __gconv_info __cd; struct { struct __gconv_info __cd; struct __gconv_step_data __data; } __combined; } _G_iconv_t; #endif /* These library features are always available in the GNU C library. */ #define _G_va_list __gnuc_va_list #define _G_HAVE_MMAP 1 #define _G_HAVE_MREMAP 1 #define _G_IO_IO_FILE_VERSION 0x20001 /* This is defined by if `st_blksize' exists. */ #define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE) #define _G_BUFSIZ 8192 #endif /* _G_config.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/alloca.h ================================================ /* Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _ALLOCA_H #define _ALLOCA_H 1 #include #define __need_size_t #include __BEGIN_DECLS /* Remove any previous definitions. */ #undef alloca /* Allocate a block that will be freed when the calling function exits. */ extern void *alloca(size_t __size) __THROW; #ifdef __GNUC__ # define alloca(size) __builtin_alloca (size) #endif /* GCC. */ __END_DECLS #endif /* alloca.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/arpa/inet.h ================================================ /* Copyright (C) 1997-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _ARPA_INET_H #define _ARPA_INET_H 1 #include #include /* To define `struct in_addr'. */ /* Type for length arguments in socket calls. */ #ifndef __socklen_t_defined typedef __socklen_t socklen_t; # define __socklen_t_defined #endif __BEGIN_DECLS /* Convert Internet host address from numbers-and-dots notation in CP into binary data in network byte order. */ extern in_addr_t inet_addr(const char *__cp) __THROW; /* Return the local host address part of the Internet address in IN. */ extern in_addr_t inet_lnaof(struct in_addr __in) __THROW; /* Make Internet host address in network byte order by combining the network number NET with the local address HOST. */ extern struct in_addr inet_makeaddr(in_addr_t __net, in_addr_t __host) __THROW; /* Return network number part of the Internet address IN. */ extern in_addr_t inet_netof(struct in_addr __in) __THROW; /* Extract the network number in network byte order from the address in numbers-and-dots natation starting at CP. */ extern in_addr_t inet_network(const char *__cp) __THROW; /* Convert Internet number in IN to ASCII representation. The return value is a pointer to an internal array containing the string. */ extern char *inet_ntoa(struct in_addr __in) __THROW; /* Convert from presentation format of an Internet number in buffer starting at CP to the binary network format and store result for interface type AF in buffer starting at BUF. */ extern int inet_pton(int __af, const char *__restrict __cp, void *__restrict __buf) __THROW; /* Convert a Internet address in binary network format for interface type AF in buffer starting at CP to presentation form and place result in buffer of length LEN astarting at BUF. */ extern const char *inet_ntop(int __af, const void *__restrict __cp, char *__restrict __buf, socklen_t __len) __THROW; /* The following functions are not part of XNS 5.2. */ #ifdef __USE_MISC /* Convert Internet host address from numbers-and-dots notation in CP into binary data and store the result in the structure INP. */ extern int inet_aton(const char *__cp, struct in_addr *__inp) __THROW; /* Format a network number NET into presentation format and place result in buffer starting at BUF with length of LEN bytes. */ extern char *inet_neta(in_addr_t __net, char *__buf, size_t __len) __THROW; /* Convert network number for interface type AF in buffer starting at CP to presentation format. The result will specifiy BITS bits of the number. */ extern char *inet_net_ntop(int __af, const void *__cp, int __bits, char *__buf, size_t __len) __THROW; /* Convert network number for interface type AF from presentation in buffer starting at CP to network format and store result int buffer starting at BUF of size LEN. */ extern int inet_net_pton(int __af, const char *__cp, void *__buf, size_t __len) __THROW; /* Convert ASCII representation in hexadecimal form of the Internet address to binary form and place result in buffer of length LEN starting at BUF. */ extern unsigned int inet_nsap_addr(const char *__cp, unsigned char *__buf, int __len) __THROW; /* Convert internet address in binary form in LEN bytes starting at CP a presentation form and place result in BUF. */ extern char *inet_nsap_ntoa(int __len, const unsigned char *__cp, char *__buf) __THROW; #endif __END_DECLS #endif /* arpa/inet.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/asm/errno.h ================================================ #include ================================================ FILE: v2/headers/linux_amd64/usr/include/asm/ioctl.h ================================================ #include ================================================ FILE: v2/headers/linux_amd64/usr/include/asm/ioctls.h ================================================ #include ================================================ FILE: v2/headers/linux_amd64/usr/include/asm/param.h ================================================ #include ================================================ FILE: v2/headers/linux_amd64/usr/include/asm/socket.h ================================================ #include ================================================ FILE: v2/headers/linux_amd64/usr/include/asm/sockios.h ================================================ #include ================================================ FILE: v2/headers/linux_amd64/usr/include/asm-generic/errno-base.h ================================================ #ifndef _ASM_GENERIC_ERRNO_BASE_H #define _ASM_GENERIC_ERRNO_BASE_H #define EPERM 1 /* Operation not permitted */ #define ENOENT 2 /* No such file or directory */ #define ESRCH 3 /* No such process */ #define EINTR 4 /* Interrupted system call */ #define EIO 5 /* I/O error */ #define ENXIO 6 /* No such device or address */ #define E2BIG 7 /* Argument list too long */ #define ENOEXEC 8 /* Exec format error */ #define EBADF 9 /* Bad file number */ #define ECHILD 10 /* No child processes */ #define EAGAIN 11 /* Try again */ #define ENOMEM 12 /* Out of memory */ #define EACCES 13 /* Permission denied */ #define EFAULT 14 /* Bad address */ #define ENOTBLK 15 /* Block device required */ #define EBUSY 16 /* Device or resource busy */ #define EEXIST 17 /* File exists */ #define EXDEV 18 /* Cross-device link */ #define ENODEV 19 /* No such device */ #define ENOTDIR 20 /* Not a directory */ #define EISDIR 21 /* Is a directory */ #define EINVAL 22 /* Invalid argument */ #define ENFILE 23 /* File table overflow */ #define EMFILE 24 /* Too many open files */ #define ENOTTY 25 /* Not a typewriter */ #define ETXTBSY 26 /* Text file busy */ #define EFBIG 27 /* File too large */ #define ENOSPC 28 /* No space left on device */ #define ESPIPE 29 /* Illegal seek */ #define EROFS 30 /* Read-only file system */ #define EMLINK 31 /* Too many links */ #define EPIPE 32 /* Broken pipe */ #define EDOM 33 /* Math argument out of domain of func */ #define ERANGE 34 /* Math result not representable */ #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/asm-generic/errno.h ================================================ #ifndef _ASM_GENERIC_ERRNO_H #define _ASM_GENERIC_ERRNO_H #include #define EDEADLK 35 /* Resource deadlock would occur */ #define ENAMETOOLONG 36 /* File name too long */ #define ENOLCK 37 /* No record locks available */ /* * This error code is special: arch syscall entry code will return * -ENOSYS if users try to call a syscall that doesn't exist. To keep * failures of syscalls that really do exist distinguishable from * failures due to attempts to use a nonexistent syscall, syscall * implementations should refrain from returning -ENOSYS. */ #define ENOSYS 38 /* Invalid system call number */ #define ENOTEMPTY 39 /* Directory not empty */ #define ELOOP 40 /* Too many symbolic links encountered */ #define EWOULDBLOCK EAGAIN /* Operation would block */ #define ENOMSG 42 /* No message of desired type */ #define EIDRM 43 /* Identifier removed */ #define ECHRNG 44 /* Channel number out of range */ #define EL2NSYNC 45 /* Level 2 not synchronized */ #define EL3HLT 46 /* Level 3 halted */ #define EL3RST 47 /* Level 3 reset */ #define ELNRNG 48 /* Link number out of range */ #define EUNATCH 49 /* Protocol driver not attached */ #define ENOCSI 50 /* No CSI structure available */ #define EL2HLT 51 /* Level 2 halted */ #define EBADE 52 /* Invalid exchange */ #define EBADR 53 /* Invalid request descriptor */ #define EXFULL 54 /* Exchange full */ #define ENOANO 55 /* No anode */ #define EBADRQC 56 /* Invalid request code */ #define EBADSLT 57 /* Invalid slot */ #define EDEADLOCK EDEADLK #define EBFONT 59 /* Bad font file format */ #define ENOSTR 60 /* Device not a stream */ #define ENODATA 61 /* No data available */ #define ETIME 62 /* Timer expired */ #define ENOSR 63 /* Out of streams resources */ #define ENONET 64 /* Machine is not on the network */ #define ENOPKG 65 /* Package not installed */ #define EREMOTE 66 /* Object is remote */ #define ENOLINK 67 /* Link has been severed */ #define EADV 68 /* Advertise error */ #define ESRMNT 69 /* Srmount error */ #define ECOMM 70 /* Communication error on send */ #define EPROTO 71 /* Protocol error */ #define EMULTIHOP 72 /* Multihop attempted */ #define EDOTDOT 73 /* RFS specific error */ #define EBADMSG 74 /* Not a data message */ #define EOVERFLOW 75 /* Value too large for defined data type */ #define ENOTUNIQ 76 /* Name not unique on network */ #define EBADFD 77 /* File descriptor in bad state */ #define EREMCHG 78 /* Remote address changed */ #define ELIBACC 79 /* Can not access a needed shared library */ #define ELIBBAD 80 /* Accessing a corrupted shared library */ #define ELIBSCN 81 /* .lib section in a.out corrupted */ #define ELIBMAX 82 /* Attempting to link in too many shared libraries */ #define ELIBEXEC 83 /* Cannot exec a shared library directly */ #define EILSEQ 84 /* Illegal byte sequence */ #define ERESTART 85 /* Interrupted system call should be restarted */ #define ESTRPIPE 86 /* Streams pipe error */ #define EUSERS 87 /* Too many users */ #define ENOTSOCK 88 /* Socket operation on non-socket */ #define EDESTADDRREQ 89 /* Destination address required */ #define EMSGSIZE 90 /* Message too long */ #define EPROTOTYPE 91 /* Protocol wrong type for socket */ #define ENOPROTOOPT 92 /* Protocol not available */ #define EPROTONOSUPPORT 93 /* Protocol not supported */ #define ESOCKTNOSUPPORT 94 /* Socket type not supported */ #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ #define EPFNOSUPPORT 96 /* Protocol family not supported */ #define EAFNOSUPPORT 97 /* Address family not supported by protocol */ #define EADDRINUSE 98 /* Address already in use */ #define EADDRNOTAVAIL 99 /* Cannot assign requested address */ #define ENETDOWN 100 /* Network is down */ #define ENETUNREACH 101 /* Network is unreachable */ #define ENETRESET 102 /* Network dropped connection because of reset */ #define ECONNABORTED 103 /* Software caused connection abort */ #define ECONNRESET 104 /* Connection reset by peer */ #define ENOBUFS 105 /* No buffer space available */ #define EISCONN 106 /* Transport endpoint is already connected */ #define ENOTCONN 107 /* Transport endpoint is not connected */ #define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ #define ETOOMANYREFS 109 /* Too many references: cannot splice */ #define ETIMEDOUT 110 /* Connection timed out */ #define ECONNREFUSED 111 /* Connection refused */ #define EHOSTDOWN 112 /* Host is down */ #define EHOSTUNREACH 113 /* No route to host */ #define EALREADY 114 /* Operation already in progress */ #define EINPROGRESS 115 /* Operation now in progress */ #define ESTALE 116 /* Stale file handle */ #define EUCLEAN 117 /* Structure needs cleaning */ #define ENOTNAM 118 /* Not a XENIX named type file */ #define ENAVAIL 119 /* No XENIX semaphores available */ #define EISNAM 120 /* Is a named type file */ #define EREMOTEIO 121 /* Remote I/O error */ #define EDQUOT 122 /* Quota exceeded */ #define ENOMEDIUM 123 /* No medium found */ #define EMEDIUMTYPE 124 /* Wrong medium type */ #define ECANCELED 125 /* Operation Canceled */ #define ENOKEY 126 /* Required key not available */ #define EKEYEXPIRED 127 /* Key has expired */ #define EKEYREVOKED 128 /* Key has been revoked */ #define EKEYREJECTED 129 /* Key was rejected by service */ /* for robust mutexes */ #define EOWNERDEAD 130 /* Owner died */ #define ENOTRECOVERABLE 131 /* State not recoverable */ #define ERFKILL 132 /* Operation not possible due to RF-kill */ #define EHWPOISON 133 /* Memory page has hardware error */ #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/asm-generic/ioctl.h ================================================ #ifndef _ASM_GENERIC_IOCTL_H #define _ASM_GENERIC_IOCTL_H /* ioctl command encoding: 32 bits total, command in lower 16 bits, * size of the parameter structure in the lower 14 bits of the * upper 16 bits. * Encoding the size of the parameter structure in the ioctl request * is useful for catching programs compiled with old versions * and to avoid overwriting user space outside the user buffer area. * The highest 2 bits are reserved for indicating the ``access mode''. * NOTE: This limits the max parameter size to 16kB -1 ! */ /* * The following is for compatibility across the various Linux * platforms. The generic ioctl numbering scheme doesn't really enforce * a type field. De facto, however, the top 8 bits of the lower 16 * bits are indeed used as a type field, so we might just as well make * this explicit here. Please be sure to use the decoding macros * below from now on. */ #define _IOC_NRBITS 8 #define _IOC_TYPEBITS 8 /* * Let any architecture override either of the following before * including this file. */ #ifndef _IOC_SIZEBITS # define _IOC_SIZEBITS 14 #endif #ifndef _IOC_DIRBITS # define _IOC_DIRBITS 2 #endif #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) #define _IOC_NRSHIFT 0 #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) /* * Direction bits, which any architecture can choose to override * before including this file. */ #ifndef _IOC_NONE # define _IOC_NONE 0U #endif #ifndef _IOC_WRITE # define _IOC_WRITE 1U #endif #ifndef _IOC_READ # define _IOC_READ 2U #endif #define _IOC(dir,type,nr,size) \ (((dir) << _IOC_DIRSHIFT) | \ ((type) << _IOC_TYPESHIFT) | \ ((nr) << _IOC_NRSHIFT) | \ ((size) << _IOC_SIZESHIFT)) #define _IOC_TYPECHECK(t) (sizeof(t)) /* used to create numbers */ #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size))) #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) #define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) #define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) #define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) /* used to decode ioctl numbers.. */ #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) /* ...and for the drivers/sound files... */ #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) #endif /* _ASM_GENERIC_IOCTL_H */ ================================================ FILE: v2/headers/linux_amd64/usr/include/asm-generic/ioctls.h ================================================ #ifndef __ASM_GENERIC_IOCTLS_H #define __ASM_GENERIC_IOCTLS_H #include /* * These are the most common definitions for tty ioctl numbers. * Most of them do not use the recommended _IOC(), but there is * probably some source code out there hardcoding the number, * so we might as well use them for all new platforms. * * The architectures that use different values here typically * try to be compatible with some Unix variants for the same * architecture. */ /* 0x54 is just a magic number to make these relatively unique ('T') */ #define TCGETS 0x5401 #define TCSETS 0x5402 #define TCSETSW 0x5403 #define TCSETSF 0x5404 #define TCGETA 0x5405 #define TCSETA 0x5406 #define TCSETAW 0x5407 #define TCSETAF 0x5408 #define TCSBRK 0x5409 #define TCXONC 0x540A #define TCFLSH 0x540B #define TIOCEXCL 0x540C #define TIOCNXCL 0x540D #define TIOCSCTTY 0x540E #define TIOCGPGRP 0x540F #define TIOCSPGRP 0x5410 #define TIOCOUTQ 0x5411 #define TIOCSTI 0x5412 #define TIOCGWINSZ 0x5413 #define TIOCSWINSZ 0x5414 #define TIOCMGET 0x5415 #define TIOCMBIS 0x5416 #define TIOCMBIC 0x5417 #define TIOCMSET 0x5418 #define TIOCGSOFTCAR 0x5419 #define TIOCSSOFTCAR 0x541A #define FIONREAD 0x541B #define TIOCINQ FIONREAD #define TIOCLINUX 0x541C #define TIOCCONS 0x541D #define TIOCGSERIAL 0x541E #define TIOCSSERIAL 0x541F #define TIOCPKT 0x5420 #define FIONBIO 0x5421 #define TIOCNOTTY 0x5422 #define TIOCSETD 0x5423 #define TIOCGETD 0x5424 #define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ #define TIOCSBRK 0x5427 /* BSD compatibility */ #define TIOCCBRK 0x5428 /* BSD compatibility */ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TCGETS2 _IOR('T', 0x2A, struct termios2) #define TCSETS2 _IOW('T', 0x2B, struct termios2) #define TCSETSW2 _IOW('T', 0x2C, struct termios2) #define TCSETSF2 _IOW('T', 0x2D, struct termios2) #define TIOCGRS485 0x542E #ifndef TIOCSRS485 #define TIOCSRS485 0x542F #endif #define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ #define TIOCGDEV _IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */ #define TCGETX 0x5432 /* SYS5 TCGETX compatibility */ #define TCSETX 0x5433 #define TCSETXF 0x5434 #define TCSETXW 0x5435 #define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */ #define TIOCVHANGUP 0x5437 #define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */ #define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */ #define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */ #define FIONCLEX 0x5450 #define FIOCLEX 0x5451 #define FIOASYNC 0x5452 #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 #define TIOCSERSWILD 0x5455 #define TIOCGLCKTRMIOS 0x5456 #define TIOCSLCKTRMIOS 0x5457 #define TIOCSERGSTRUCT 0x5458 /* For debugging only */ #define TIOCSERGETLSR 0x5459 /* Get line status register */ #define TIOCSERGETMULTI 0x545A /* Get multiport config */ #define TIOCSERSETMULTI 0x545B /* Set multiport config */ #define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ #define TIOCGICOUNT 0x545D /* read serial port __inline__ interrupt counts */ /* * Some arches already define FIOQSIZE due to a historical * conflict with a Hayes modem-specific ioctl value. */ #ifndef FIOQSIZE # define FIOQSIZE 0x5460 #endif /* Used for packet mode */ #define TIOCPKT_DATA 0 #define TIOCPKT_FLUSHREAD 1 #define TIOCPKT_FLUSHWRITE 2 #define TIOCPKT_STOP 4 #define TIOCPKT_START 8 #define TIOCPKT_NOSTOP 16 #define TIOCPKT_DOSTOP 32 #define TIOCPKT_IOCTL 64 #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ #endif /* __ASM_GENERIC_IOCTLS_H */ ================================================ FILE: v2/headers/linux_amd64/usr/include/asm-generic/param.h ================================================ #ifndef __ASM_GENERIC_PARAM_H #define __ASM_GENERIC_PARAM_H #ifndef HZ #define HZ 100 #endif #ifndef EXEC_PAGESIZE #define EXEC_PAGESIZE 4096 #endif #ifndef NOGROUP #define NOGROUP (-1) #endif #define MAXHOSTNAMELEN 64 /* max length of hostname */ #endif /* __ASM_GENERIC_PARAM_H */ ================================================ FILE: v2/headers/linux_amd64/usr/include/asm-generic/socket.h ================================================ #ifndef __ASM_GENERIC_SOCKET_H #define __ASM_GENERIC_SOCKET_H #include /* For setsockopt(2) */ #define SOL_SOCKET 1 #define SO_DEBUG 1 #define SO_REUSEADDR 2 #define SO_TYPE 3 #define SO_ERROR 4 #define SO_DONTROUTE 5 #define SO_BROADCAST 6 #define SO_SNDBUF 7 #define SO_RCVBUF 8 #define SO_SNDBUFFORCE 32 #define SO_RCVBUFFORCE 33 #define SO_KEEPALIVE 9 #define SO_OOBINLINE 10 #define SO_NO_CHECK 11 #define SO_PRIORITY 12 #define SO_LINGER 13 #define SO_BSDCOMPAT 14 #define SO_REUSEPORT 15 #ifndef SO_PASSCRED /* powerpc only differs in these */ #define SO_PASSCRED 16 #define SO_PEERCRED 17 #define SO_RCVLOWAT 18 #define SO_SNDLOWAT 19 #define SO_RCVTIMEO 20 #define SO_SNDTIMEO 21 #endif /* Security levels - as per NRL IPv6 - don't actually do anything */ #define SO_SECURITY_AUTHENTICATION 22 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 #define SO_SECURITY_ENCRYPTION_NETWORK 24 #define SO_BINDTODEVICE 25 /* Socket filtering */ #define SO_ATTACH_FILTER 26 #define SO_DETACH_FILTER 27 #define SO_GET_FILTER SO_ATTACH_FILTER #define SO_PEERNAME 28 #define SO_TIMESTAMP 29 #define SCM_TIMESTAMP SO_TIMESTAMP #define SO_ACCEPTCONN 30 #define SO_PEERSEC 31 #define SO_PASSSEC 34 #define SO_TIMESTAMPNS 35 #define SCM_TIMESTAMPNS SO_TIMESTAMPNS #define SO_MARK 36 #define SO_TIMESTAMPING 37 #define SCM_TIMESTAMPING SO_TIMESTAMPING #define SO_PROTOCOL 38 #define SO_DOMAIN 39 #define SO_RXQ_OVFL 40 #define SO_WIFI_STATUS 41 #define SCM_WIFI_STATUS SO_WIFI_STATUS #define SO_PEEK_OFF 42 /* Instruct lower device to use last 4-bytes of skb data as FCS */ #define SO_NOFCS 43 #define SO_LOCK_FILTER 44 #define SO_SELECT_ERR_QUEUE 45 #define SO_BUSY_POLL 46 #define SO_MAX_PACING_RATE 47 #define SO_BPF_EXTENSIONS 48 #define SO_INCOMING_CPU 49 #define SO_ATTACH_BPF 50 #define SO_DETACH_BPF SO_DETACH_FILTER #endif /* __ASM_GENERIC_SOCKET_H */ ================================================ FILE: v2/headers/linux_amd64/usr/include/asm-generic/sockios.h ================================================ #ifndef __ASM_GENERIC_SOCKIOS_H #define __ASM_GENERIC_SOCKIOS_H /* Socket-level I/O control calls. */ #define FIOSETOWN 0x8901 #define SIOCSPGRP 0x8902 #define FIOGETOWN 0x8903 #define SIOCGPGRP 0x8904 #define SIOCATMARK 0x8905 #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ #endif /* __ASM_GENERIC_SOCKIOS_H */ ================================================ FILE: v2/headers/linux_amd64/usr/include/assert.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.2 Diagnostics */ #ifdef _ASSERT_H # undef _ASSERT_H # undef assert # undef __ASSERT_VOID_CAST # ifdef __USE_GNU # undef assert_perror # endif #endif /* assert.h */ #define _ASSERT_H 1 #include #if defined __cplusplus && __GNUC_PREREQ (2,95) # define __ASSERT_VOID_CAST static_cast #else # define __ASSERT_VOID_CAST (void) #endif /* void assert (int expression); If NDEBUG is defined, do nothing. If not, and EXPRESSION is zero, print an error message and abort. */ #ifdef NDEBUG # define assert(expr) (__ASSERT_VOID_CAST (0)) /* void assert_perror (int errnum); If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an error message with the error text for ERRNUM and abort. (This is a GNU extension.) */ # ifdef __USE_GNU # define assert_perror(errnum) (__ASSERT_VOID_CAST (0)) # endif #else /* Not NDEBUG. */ __BEGIN_DECLS /* This prints an "Assertion failed" message and aborts. */ extern void __assert_fail(const char *__assertion, const char *__file, unsigned int __line, const char *__function) __THROW __attribute__ ((__noreturn__)); /* Likewise, but prints the error text for ERRNUM. */ extern void __assert_perror_fail(int __errnum, const char *__file, unsigned int __line, const char *__function) __THROW __attribute__ ((__noreturn__)); /* The following is not at all used here but needed for standard compliance. */ extern void __assert(const char *__assertion, const char *__file, int __line) __THROW __attribute__ ((__noreturn__)); __END_DECLS # define assert(expr) \ ((expr) \ ? __ASSERT_VOID_CAST (0) \ : __assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION)) # ifdef __USE_GNU # define assert_perror(errnum) \ (!(errnum) \ ? __ASSERT_VOID_CAST (0) \ : __assert_perror_fail ((errnum), __FILE__, __LINE__, __ASSERT_FUNCTION)) # endif /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__' which contains the name of the function currently being defined. This is broken in G++ before version 2.6. C9x has a similar variable called __func__, but prefer the GCC one since it demangles C++ function names. */ # if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4) # define __ASSERT_FUNCTION __PRETTY_FUNCTION__ # else # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __ASSERT_FUNCTION __func__ # else # define __ASSERT_FUNCTION ((const char *) 0) # endif # endif #endif /* NDEBUG. */ #if defined __USE_ISOC11 && !defined __cplusplus # undef static_assert # define static_assert _Static_assert #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/byteswap-16.h ================================================ /* Macros to swap the order of bytes in 16-bit integer values. Copyright (C) 2012-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_BYTESWAP_H # error "Never use directly; include instead." #endif #ifdef __GNUC__ # if __GNUC__ >= 2 # define __bswap_16(x) \ (__extension__ \ ({ unsigned short int __v, __x = (unsigned short int) (x); \ if (__builtin_constant_p (__x)) \ __v = __bswap_constant_16 (__x); \ else \ __asm__ ("rorw $8, %w0" \ : "=r" (__v) \ : "0" (__x) \ : "cc"); \ __v; })) # else /* This is better than nothing. */ # define __bswap_16(x) \ (__extension__ \ ({ unsigned short int __x = (unsigned short int) (x); \ __bswap_constant_16 (__x); })) # endif #else static __inline unsigned short int __bswap_16(unsigned short int __bsx) { return __bswap_constant_16(__bsx); } #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/byteswap.h ================================================ /* Macros to swap the order of bytes in integer values. Copyright (C) 1997-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H # error "Never use directly; include instead." #endif #ifndef _BITS_BYTESWAP_H #define _BITS_BYTESWAP_H 1 #include #include #include /* Swap bytes in 16 bit value. */ #define __bswap_constant_16(x) \ ((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) /* Get __bswap_16. */ #include /* Swap bytes in 32 bit value. */ #define __bswap_constant_32(x) \ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) #ifdef __GNUC__ # if __GNUC_PREREQ (4, 3) static __inline unsigned int __bswap_32(unsigned int __bsx) { return __builtin_bswap32(__bsx); } # elif __GNUC__ >= 2 # if __WORDSIZE == 64 || (defined __i486__ || defined __pentium__ \ || defined __pentiumpro__ || defined __pentium4__ \ || defined __k8__ || defined __athlon__ \ || defined __k6__ || defined __nocona__ \ || defined __core2__ || defined __geode__ \ || defined __amdfam10__) /* To swap the bytes in a word the i486 processors and up provide the `bswap' opcode. On i386 we have to use three instructions. */ # define __bswap_32(x) \ (__extension__ \ ({ unsigned int __v, __x = (x); \ if (__builtin_constant_p (__x)) \ __v = __bswap_constant_32 (__x); \ else \ __asm__ ("bswap %0" : "=r" (__v) : "0" (__x)); \ __v; })) # else # define __bswap_32(x) \ (__extension__ \ ({ unsigned int __v, __x = (x); \ if (__builtin_constant_p (__x)) \ __v = __bswap_constant_32 (__x); \ else \ __asm__ ("rorw $8, %w0;" \ "rorl $16, %0;" \ "rorw $8, %w0" \ : "=r" (__v) \ : "0" (__x) \ : "cc"); \ __v; })) # endif # else # define __bswap_32(x) \ (__extension__ \ ({ unsigned int __x = (x); __bswap_constant_32 (__x); })) # endif #else static __inline unsigned int __bswap_32(unsigned int __bsx) { return __bswap_constant_32(__bsx); } #endif #if __GNUC_PREREQ (2, 0) /* Swap bytes in 64 bit value. */ # define __bswap_constant_64(x) \ (__extension__ ((((x) & 0xff00000000000000ull) >> 56) \ | (((x) & 0x00ff000000000000ull) >> 40) \ | (((x) & 0x0000ff0000000000ull) >> 24) \ | (((x) & 0x000000ff00000000ull) >> 8) \ | (((x) & 0x00000000ff000000ull) << 8) \ | (((x) & 0x0000000000ff0000ull) << 24) \ | (((x) & 0x000000000000ff00ull) << 40) \ | (((x) & 0x00000000000000ffull) << 56))) # if __GNUC_PREREQ (4, 3) static __inline __uint64_t __bswap_64(__uint64_t __bsx) { return __builtin_bswap64(__bsx); } # elif __WORDSIZE == 64 # define __bswap_64(x) \ (__extension__ \ ({ __uint64_t __v, __x = (x); \ if (__builtin_constant_p (__x)) \ __v = __bswap_constant_64 (__x); \ else \ __asm__ ("bswap %q0" : "=r" (__v) : "0" (__x)); \ __v; })) # else # define __bswap_64(x) \ (__extension__ \ ({ union { __extension__ __uint64_t __ll; \ unsigned int __l[2]; } __w, __r; \ if (__builtin_constant_p (x)) \ __r.__ll = __bswap_constant_64 (x); \ else \ { \ __w.__ll = (x); \ __r.__l[0] = __bswap_32 (__w.__l[1]); \ __r.__l[1] = __bswap_32 (__w.__l[0]); \ } \ __r.__ll; })) # endif #else # define __bswap_constant_64(x) \ ((((x) & 0xff00000000000000ull) >> 56) \ | (((x) & 0x00ff000000000000ull) >> 40) \ | (((x) & 0x0000ff0000000000ull) >> 24) \ | (((x) & 0x000000ff00000000ull) >> 8) \ | (((x) & 0x00000000ff000000ull) << 8) \ | (((x) & 0x0000000000ff0000ull) << 24) \ | (((x) & 0x000000000000ff00ull) << 40) \ | (((x) & 0x00000000000000ffull) << 56)) static __inline __uint64_t __bswap_64(__uint64_t __bsx) { return __bswap_constant_64(__bsx); } #endif #endif /* _BITS_BYTESWAP_H */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/confname.h ================================================ /* `sysconf', `pathconf', and `confstr' NAME values. Generic version. Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _UNISTD_H # error "Never use directly; include instead." #endif /* Values for the NAME argument to `pathconf' and `fpathconf'. */ enum { _PC_LINK_MAX, #define _PC_LINK_MAX _PC_LINK_MAX _PC_MAX_CANON, #define _PC_MAX_CANON _PC_MAX_CANON _PC_MAX_INPUT, #define _PC_MAX_INPUT _PC_MAX_INPUT _PC_NAME_MAX, #define _PC_NAME_MAX _PC_NAME_MAX _PC_PATH_MAX, #define _PC_PATH_MAX _PC_PATH_MAX _PC_PIPE_BUF, #define _PC_PIPE_BUF _PC_PIPE_BUF _PC_CHOWN_RESTRICTED, #define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED _PC_NO_TRUNC, #define _PC_NO_TRUNC _PC_NO_TRUNC _PC_VDISABLE, #define _PC_VDISABLE _PC_VDISABLE _PC_SYNC_IO, #define _PC_SYNC_IO _PC_SYNC_IO _PC_ASYNC_IO, #define _PC_ASYNC_IO _PC_ASYNC_IO _PC_PRIO_IO, #define _PC_PRIO_IO _PC_PRIO_IO _PC_SOCK_MAXBUF, #define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF _PC_FILESIZEBITS, #define _PC_FILESIZEBITS _PC_FILESIZEBITS _PC_REC_INCR_XFER_SIZE, #define _PC_REC_INCR_XFER_SIZE _PC_REC_INCR_XFER_SIZE _PC_REC_MAX_XFER_SIZE, #define _PC_REC_MAX_XFER_SIZE _PC_REC_MAX_XFER_SIZE _PC_REC_MIN_XFER_SIZE, #define _PC_REC_MIN_XFER_SIZE _PC_REC_MIN_XFER_SIZE _PC_REC_XFER_ALIGN, #define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN _PC_ALLOC_SIZE_MIN, #define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN _PC_SYMLINK_MAX, #define _PC_SYMLINK_MAX _PC_SYMLINK_MAX _PC_2_SYMLINKS #define _PC_2_SYMLINKS _PC_2_SYMLINKS }; /* Values for the argument to `sysconf'. */ enum { _SC_ARG_MAX, #define _SC_ARG_MAX _SC_ARG_MAX _SC_CHILD_MAX, #define _SC_CHILD_MAX _SC_CHILD_MAX _SC_CLK_TCK, #define _SC_CLK_TCK _SC_CLK_TCK _SC_NGROUPS_MAX, #define _SC_NGROUPS_MAX _SC_NGROUPS_MAX _SC_OPEN_MAX, #define _SC_OPEN_MAX _SC_OPEN_MAX _SC_STREAM_MAX, #define _SC_STREAM_MAX _SC_STREAM_MAX _SC_TZNAME_MAX, #define _SC_TZNAME_MAX _SC_TZNAME_MAX _SC_JOB_CONTROL, #define _SC_JOB_CONTROL _SC_JOB_CONTROL _SC_SAVED_IDS, #define _SC_SAVED_IDS _SC_SAVED_IDS _SC_REALTIME_SIGNALS, #define _SC_REALTIME_SIGNALS _SC_REALTIME_SIGNALS _SC_PRIORITY_SCHEDULING, #define _SC_PRIORITY_SCHEDULING _SC_PRIORITY_SCHEDULING _SC_TIMERS, #define _SC_TIMERS _SC_TIMERS _SC_ASYNCHRONOUS_IO, #define _SC_ASYNCHRONOUS_IO _SC_ASYNCHRONOUS_IO _SC_PRIORITIZED_IO, #define _SC_PRIORITIZED_IO _SC_PRIORITIZED_IO _SC_SYNCHRONIZED_IO, #define _SC_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO _SC_FSYNC, #define _SC_FSYNC _SC_FSYNC _SC_MAPPED_FILES, #define _SC_MAPPED_FILES _SC_MAPPED_FILES _SC_MEMLOCK, #define _SC_MEMLOCK _SC_MEMLOCK _SC_MEMLOCK_RANGE, #define _SC_MEMLOCK_RANGE _SC_MEMLOCK_RANGE _SC_MEMORY_PROTECTION, #define _SC_MEMORY_PROTECTION _SC_MEMORY_PROTECTION _SC_MESSAGE_PASSING, #define _SC_MESSAGE_PASSING _SC_MESSAGE_PASSING _SC_SEMAPHORES, #define _SC_SEMAPHORES _SC_SEMAPHORES _SC_SHARED_MEMORY_OBJECTS, #define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS _SC_AIO_LISTIO_MAX, #define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX _SC_AIO_MAX, #define _SC_AIO_MAX _SC_AIO_MAX _SC_AIO_PRIO_DELTA_MAX, #define _SC_AIO_PRIO_DELTA_MAX _SC_AIO_PRIO_DELTA_MAX _SC_DELAYTIMER_MAX, #define _SC_DELAYTIMER_MAX _SC_DELAYTIMER_MAX _SC_MQ_OPEN_MAX, #define _SC_MQ_OPEN_MAX _SC_MQ_OPEN_MAX _SC_MQ_PRIO_MAX, #define _SC_MQ_PRIO_MAX _SC_MQ_PRIO_MAX _SC_VERSION, #define _SC_VERSION _SC_VERSION _SC_PAGESIZE, #define _SC_PAGESIZE _SC_PAGESIZE #define _SC_PAGE_SIZE _SC_PAGESIZE _SC_RTSIG_MAX, #define _SC_RTSIG_MAX _SC_RTSIG_MAX _SC_SEM_NSEMS_MAX, #define _SC_SEM_NSEMS_MAX _SC_SEM_NSEMS_MAX _SC_SEM_VALUE_MAX, #define _SC_SEM_VALUE_MAX _SC_SEM_VALUE_MAX _SC_SIGQUEUE_MAX, #define _SC_SIGQUEUE_MAX _SC_SIGQUEUE_MAX _SC_TIMER_MAX, #define _SC_TIMER_MAX _SC_TIMER_MAX /* Values for the argument to `sysconf' corresponding to _POSIX2_* symbols. */ _SC_BC_BASE_MAX, #define _SC_BC_BASE_MAX _SC_BC_BASE_MAX _SC_BC_DIM_MAX, #define _SC_BC_DIM_MAX _SC_BC_DIM_MAX _SC_BC_SCALE_MAX, #define _SC_BC_SCALE_MAX _SC_BC_SCALE_MAX _SC_BC_STRING_MAX, #define _SC_BC_STRING_MAX _SC_BC_STRING_MAX _SC_COLL_WEIGHTS_MAX, #define _SC_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX _SC_EQUIV_CLASS_MAX, #define _SC_EQUIV_CLASS_MAX _SC_EQUIV_CLASS_MAX _SC_EXPR_NEST_MAX, #define _SC_EXPR_NEST_MAX _SC_EXPR_NEST_MAX _SC_LINE_MAX, #define _SC_LINE_MAX _SC_LINE_MAX _SC_RE_DUP_MAX, #define _SC_RE_DUP_MAX _SC_RE_DUP_MAX _SC_CHARCLASS_NAME_MAX, #define _SC_CHARCLASS_NAME_MAX _SC_CHARCLASS_NAME_MAX _SC_2_VERSION, #define _SC_2_VERSION _SC_2_VERSION _SC_2_C_BIND, #define _SC_2_C_BIND _SC_2_C_BIND _SC_2_C_DEV, #define _SC_2_C_DEV _SC_2_C_DEV _SC_2_FORT_DEV, #define _SC_2_FORT_DEV _SC_2_FORT_DEV _SC_2_FORT_RUN, #define _SC_2_FORT_RUN _SC_2_FORT_RUN _SC_2_SW_DEV, #define _SC_2_SW_DEV _SC_2_SW_DEV _SC_2_LOCALEDEF, #define _SC_2_LOCALEDEF _SC_2_LOCALEDEF _SC_PII, #define _SC_PII _SC_PII _SC_PII_XTI, #define _SC_PII_XTI _SC_PII_XTI _SC_PII_SOCKET, #define _SC_PII_SOCKET _SC_PII_SOCKET _SC_PII_INTERNET, #define _SC_PII_INTERNET _SC_PII_INTERNET _SC_PII_OSI, #define _SC_PII_OSI _SC_PII_OSI _SC_POLL, #define _SC_POLL _SC_POLL _SC_SELECT, #define _SC_SELECT _SC_SELECT _SC_UIO_MAXIOV, #define _SC_UIO_MAXIOV _SC_UIO_MAXIOV _SC_IOV_MAX = _SC_UIO_MAXIOV, #define _SC_IOV_MAX _SC_IOV_MAX _SC_PII_INTERNET_STREAM, #define _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_DGRAM, #define _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_DGRAM _SC_PII_OSI_COTS, #define _SC_PII_OSI_COTS _SC_PII_OSI_COTS _SC_PII_OSI_CLTS, #define _SC_PII_OSI_CLTS _SC_PII_OSI_CLTS _SC_PII_OSI_M, #define _SC_PII_OSI_M _SC_PII_OSI_M _SC_T_IOV_MAX, #define _SC_T_IOV_MAX _SC_T_IOV_MAX /* Values according to POSIX 1003.1c (POSIX threads). */ _SC_THREADS, #define _SC_THREADS _SC_THREADS _SC_THREAD_SAFE_FUNCTIONS, #define _SC_THREAD_SAFE_FUNCTIONS _SC_THREAD_SAFE_FUNCTIONS _SC_GETGR_R_SIZE_MAX, #define _SC_GETGR_R_SIZE_MAX _SC_GETGR_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX, #define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX _SC_LOGIN_NAME_MAX, #define _SC_LOGIN_NAME_MAX _SC_LOGIN_NAME_MAX _SC_TTY_NAME_MAX, #define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX _SC_THREAD_DESTRUCTOR_ITERATIONS, #define _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_KEYS_MAX, #define _SC_THREAD_KEYS_MAX _SC_THREAD_KEYS_MAX _SC_THREAD_STACK_MIN, #define _SC_THREAD_STACK_MIN _SC_THREAD_STACK_MIN _SC_THREAD_THREADS_MAX, #define _SC_THREAD_THREADS_MAX _SC_THREAD_THREADS_MAX _SC_THREAD_ATTR_STACKADDR, #define _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKSIZE, #define _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_PRIORITY_SCHEDULING, #define _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIO_INHERIT, #define _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_PROTECT, #define _SC_THREAD_PRIO_PROTECT _SC_THREAD_PRIO_PROTECT _SC_THREAD_PROCESS_SHARED, #define _SC_THREAD_PROCESS_SHARED _SC_THREAD_PROCESS_SHARED _SC_NPROCESSORS_CONF, #define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF _SC_NPROCESSORS_ONLN, #define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN _SC_PHYS_PAGES, #define _SC_PHYS_PAGES _SC_PHYS_PAGES _SC_AVPHYS_PAGES, #define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES _SC_ATEXIT_MAX, #define _SC_ATEXIT_MAX _SC_ATEXIT_MAX _SC_PASS_MAX, #define _SC_PASS_MAX _SC_PASS_MAX _SC_XOPEN_VERSION, #define _SC_XOPEN_VERSION _SC_XOPEN_VERSION _SC_XOPEN_XCU_VERSION, #define _SC_XOPEN_XCU_VERSION _SC_XOPEN_XCU_VERSION _SC_XOPEN_UNIX, #define _SC_XOPEN_UNIX _SC_XOPEN_UNIX _SC_XOPEN_CRYPT, #define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT _SC_XOPEN_ENH_I18N, #define _SC_XOPEN_ENH_I18N _SC_XOPEN_ENH_I18N _SC_XOPEN_SHM, #define _SC_XOPEN_SHM _SC_XOPEN_SHM _SC_2_CHAR_TERM, #define _SC_2_CHAR_TERM _SC_2_CHAR_TERM _SC_2_C_VERSION, #define _SC_2_C_VERSION _SC_2_C_VERSION _SC_2_UPE, #define _SC_2_UPE _SC_2_UPE _SC_XOPEN_XPG2, #define _SC_XOPEN_XPG2 _SC_XOPEN_XPG2 _SC_XOPEN_XPG3, #define _SC_XOPEN_XPG3 _SC_XOPEN_XPG3 _SC_XOPEN_XPG4, #define _SC_XOPEN_XPG4 _SC_XOPEN_XPG4 _SC_CHAR_BIT, #define _SC_CHAR_BIT _SC_CHAR_BIT _SC_CHAR_MAX, #define _SC_CHAR_MAX _SC_CHAR_MAX _SC_CHAR_MIN, #define _SC_CHAR_MIN _SC_CHAR_MIN _SC_INT_MAX, #define _SC_INT_MAX _SC_INT_MAX _SC_INT_MIN, #define _SC_INT_MIN _SC_INT_MIN _SC_LONG_BIT, #define _SC_LONG_BIT _SC_LONG_BIT _SC_WORD_BIT, #define _SC_WORD_BIT _SC_WORD_BIT _SC_MB_LEN_MAX, #define _SC_MB_LEN_MAX _SC_MB_LEN_MAX _SC_NZERO, #define _SC_NZERO _SC_NZERO _SC_SSIZE_MAX, #define _SC_SSIZE_MAX _SC_SSIZE_MAX _SC_SCHAR_MAX, #define _SC_SCHAR_MAX _SC_SCHAR_MAX _SC_SCHAR_MIN, #define _SC_SCHAR_MIN _SC_SCHAR_MIN _SC_SHRT_MAX, #define _SC_SHRT_MAX _SC_SHRT_MAX _SC_SHRT_MIN, #define _SC_SHRT_MIN _SC_SHRT_MIN _SC_UCHAR_MAX, #define _SC_UCHAR_MAX _SC_UCHAR_MAX _SC_UINT_MAX, #define _SC_UINT_MAX _SC_UINT_MAX _SC_ULONG_MAX, #define _SC_ULONG_MAX _SC_ULONG_MAX _SC_USHRT_MAX, #define _SC_USHRT_MAX _SC_USHRT_MAX _SC_NL_ARGMAX, #define _SC_NL_ARGMAX _SC_NL_ARGMAX _SC_NL_LANGMAX, #define _SC_NL_LANGMAX _SC_NL_LANGMAX _SC_NL_MSGMAX, #define _SC_NL_MSGMAX _SC_NL_MSGMAX _SC_NL_NMAX, #define _SC_NL_NMAX _SC_NL_NMAX _SC_NL_SETMAX, #define _SC_NL_SETMAX _SC_NL_SETMAX _SC_NL_TEXTMAX, #define _SC_NL_TEXTMAX _SC_NL_TEXTMAX _SC_XBS5_ILP32_OFF32, #define _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFFBIG, #define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG _SC_XBS5_LP64_OFF64, #define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64 _SC_XBS5_LPBIG_OFFBIG, #define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG _SC_XOPEN_LEGACY, #define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY _SC_XOPEN_REALTIME, #define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME_THREADS, #define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS _SC_ADVISORY_INFO, #define _SC_ADVISORY_INFO _SC_ADVISORY_INFO _SC_BARRIERS, #define _SC_BARRIERS _SC_BARRIERS _SC_BASE, #define _SC_BASE _SC_BASE _SC_C_LANG_SUPPORT, #define _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT_R, #define _SC_C_LANG_SUPPORT_R _SC_C_LANG_SUPPORT_R _SC_CLOCK_SELECTION, #define _SC_CLOCK_SELECTION _SC_CLOCK_SELECTION _SC_CPUTIME, #define _SC_CPUTIME _SC_CPUTIME _SC_THREAD_CPUTIME, #define _SC_THREAD_CPUTIME _SC_THREAD_CPUTIME _SC_DEVICE_IO, #define _SC_DEVICE_IO _SC_DEVICE_IO _SC_DEVICE_SPECIFIC, #define _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC_R, #define _SC_DEVICE_SPECIFIC_R _SC_DEVICE_SPECIFIC_R _SC_FD_MGMT, #define _SC_FD_MGMT _SC_FD_MGMT _SC_FIFO, #define _SC_FIFO _SC_FIFO _SC_PIPE, #define _SC_PIPE _SC_PIPE _SC_FILE_ATTRIBUTES, #define _SC_FILE_ATTRIBUTES _SC_FILE_ATTRIBUTES _SC_FILE_LOCKING, #define _SC_FILE_LOCKING _SC_FILE_LOCKING _SC_FILE_SYSTEM, #define _SC_FILE_SYSTEM _SC_FILE_SYSTEM _SC_MONOTONIC_CLOCK, #define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK _SC_MULTI_PROCESS, #define _SC_MULTI_PROCESS _SC_MULTI_PROCESS _SC_SINGLE_PROCESS, #define _SC_SINGLE_PROCESS _SC_SINGLE_PROCESS _SC_NETWORKING, #define _SC_NETWORKING _SC_NETWORKING _SC_READER_WRITER_LOCKS, #define _SC_READER_WRITER_LOCKS _SC_READER_WRITER_LOCKS _SC_SPIN_LOCKS, #define _SC_SPIN_LOCKS _SC_SPIN_LOCKS _SC_REGEXP, #define _SC_REGEXP _SC_REGEXP _SC_REGEX_VERSION, #define _SC_REGEX_VERSION _SC_REGEX_VERSION _SC_SHELL, #define _SC_SHELL _SC_SHELL _SC_SIGNALS, #define _SC_SIGNALS _SC_SIGNALS _SC_SPAWN, #define _SC_SPAWN _SC_SPAWN _SC_SPORADIC_SERVER, #define _SC_SPORADIC_SERVER _SC_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER, #define _SC_THREAD_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER _SC_SYSTEM_DATABASE, #define _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE_R, #define _SC_SYSTEM_DATABASE_R _SC_SYSTEM_DATABASE_R _SC_TIMEOUTS, #define _SC_TIMEOUTS _SC_TIMEOUTS _SC_TYPED_MEMORY_OBJECTS, #define _SC_TYPED_MEMORY_OBJECTS _SC_TYPED_MEMORY_OBJECTS _SC_USER_GROUPS, #define _SC_USER_GROUPS _SC_USER_GROUPS _SC_USER_GROUPS_R, #define _SC_USER_GROUPS_R _SC_USER_GROUPS_R _SC_2_PBS, #define _SC_2_PBS _SC_2_PBS _SC_2_PBS_ACCOUNTING, #define _SC_2_PBS_ACCOUNTING _SC_2_PBS_ACCOUNTING _SC_2_PBS_LOCATE, #define _SC_2_PBS_LOCATE _SC_2_PBS_LOCATE _SC_2_PBS_MESSAGE, #define _SC_2_PBS_MESSAGE _SC_2_PBS_MESSAGE _SC_2_PBS_TRACK, #define _SC_2_PBS_TRACK _SC_2_PBS_TRACK _SC_SYMLOOP_MAX, #define _SC_SYMLOOP_MAX _SC_SYMLOOP_MAX _SC_STREAMS, #define _SC_STREAMS _SC_STREAMS _SC_2_PBS_CHECKPOINT, #define _SC_2_PBS_CHECKPOINT _SC_2_PBS_CHECKPOINT _SC_V6_ILP32_OFF32, #define _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFFBIG, #define _SC_V6_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG _SC_V6_LP64_OFF64, #define _SC_V6_LP64_OFF64 _SC_V6_LP64_OFF64 _SC_V6_LPBIG_OFFBIG, #define _SC_V6_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG _SC_HOST_NAME_MAX, #define _SC_HOST_NAME_MAX _SC_HOST_NAME_MAX _SC_TRACE, #define _SC_TRACE _SC_TRACE _SC_TRACE_EVENT_FILTER, #define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER _SC_TRACE_INHERIT, #define _SC_TRACE_INHERIT _SC_TRACE_INHERIT _SC_TRACE_LOG, #define _SC_TRACE_LOG _SC_TRACE_LOG _SC_LEVEL1_ICACHE_SIZE, #define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_ASSOC, #define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_LINESIZE, #define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_DCACHE_SIZE, #define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_ASSOC, #define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_LINESIZE, #define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL2_CACHE_SIZE, #define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_ASSOC, #define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_LINESIZE, #define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL3_CACHE_SIZE, #define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_ASSOC, #define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_LINESIZE, #define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL4_CACHE_SIZE, #define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_ASSOC, #define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_LINESIZE, #define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE /* Leave room here, maybe we need a few more cache levels some day. */ _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, #define _SC_IPV6 _SC_IPV6 _SC_RAW_SOCKETS, #define _SC_RAW_SOCKETS _SC_RAW_SOCKETS _SC_V7_ILP32_OFF32, #define _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFFBIG, #define _SC_V7_ILP32_OFFBIG _SC_V7_ILP32_OFFBIG _SC_V7_LP64_OFF64, #define _SC_V7_LP64_OFF64 _SC_V7_LP64_OFF64 _SC_V7_LPBIG_OFFBIG, #define _SC_V7_LPBIG_OFFBIG _SC_V7_LPBIG_OFFBIG _SC_SS_REPL_MAX, #define _SC_SS_REPL_MAX _SC_SS_REPL_MAX _SC_TRACE_EVENT_NAME_MAX, #define _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_NAME_MAX, #define _SC_TRACE_NAME_MAX _SC_TRACE_NAME_MAX _SC_TRACE_SYS_MAX, #define _SC_TRACE_SYS_MAX _SC_TRACE_SYS_MAX _SC_TRACE_USER_EVENT_MAX, #define _SC_TRACE_USER_EVENT_MAX _SC_TRACE_USER_EVENT_MAX _SC_XOPEN_STREAMS, #define _SC_XOPEN_STREAMS _SC_XOPEN_STREAMS _SC_THREAD_ROBUST_PRIO_INHERIT, #define _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_PROTECT #define _SC_THREAD_ROBUST_PRIO_PROTECT _SC_THREAD_ROBUST_PRIO_PROTECT }; /* Values for the NAME argument to `confstr'. */ enum { _CS_PATH, /* The default search path. */ #define _CS_PATH _CS_PATH _CS_V6_WIDTH_RESTRICTED_ENVS, #define _CS_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS _CS_GNU_LIBC_VERSION, #define _CS_GNU_LIBC_VERSION _CS_GNU_LIBC_VERSION _CS_GNU_LIBPTHREAD_VERSION, #define _CS_GNU_LIBPTHREAD_VERSION _CS_GNU_LIBPTHREAD_VERSION _CS_V5_WIDTH_RESTRICTED_ENVS, #define _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS, #define _CS_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS _CS_LFS_CFLAGS = 1000, #define _CS_LFS_CFLAGS _CS_LFS_CFLAGS _CS_LFS_LDFLAGS, #define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS _CS_LFS_LIBS, #define _CS_LFS_LIBS _CS_LFS_LIBS _CS_LFS_LINTFLAGS, #define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS _CS_LFS64_CFLAGS, #define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS _CS_LFS64_LDFLAGS, #define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS _CS_LFS64_LIBS, #define _CS_LFS64_LIBS _CS_LFS64_LIBS _CS_LFS64_LINTFLAGS, #define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, #define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS, #define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LIBS, #define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LINTFLAGS, #define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS, #define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS, #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LIBS, #define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_LP64_OFF64_CFLAGS, #define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS, #define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LIBS, #define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LINTFLAGS, #define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LIBS, #define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LIBS, #define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LIBS, #define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS, #define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS, #define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LIBS, #define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, #define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LIBS, #define _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LIBS, #define _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS, #define _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS, #define _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LIBS, #define _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS, #define _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_V6_ENV, #define _CS_V6_ENV _CS_V6_ENV _CS_V7_ENV #define _CS_V7_ENV _CS_V7_ENV }; ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/dirent.h ================================================ /* Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _DIRENT_H # error "Never use directly; include instead." #endif struct dirent { #ifndef __USE_FILE_OFFSET64 __ino_t d_ino; __off_t d_off; #else __ino64_t d_ino; __off64_t d_off; #endif unsigned short int d_reclen; unsigned char d_type; char d_name[256]; /* We must not include limits.h! */ }; #ifdef __USE_LARGEFILE64 struct dirent64 { __ino64_t d_ino; __off64_t d_off; unsigned short int d_reclen; unsigned char d_type; char d_name[256]; /* We must not include limits.h! */ }; #endif #define d_fileno d_ino /* Backwards compatibility. */ #undef _DIRENT_HAVE_D_NAMLEN #define _DIRENT_HAVE_D_RECLEN #define _DIRENT_HAVE_D_OFF #define _DIRENT_HAVE_D_TYPE #if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T /* Inform libc code that these two types are effectively identical. */ # define _DIRENT_MATCHES_DIRENT64 1 #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/dlfcn.h ================================================ /* System dependent definitions for run-time dynamic loading. Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _DLFCN_H # error "Never use directly; include instead." #endif /* The MODE argument to `dlopen' contains one of the following: */ #define RTLD_LAZY 0x00001 /* Lazy function call binding. */ #define RTLD_NOW 0x00002 /* Immediate function call binding. */ #define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */ #define RTLD_NOLOAD 0x00004 /* Do not load the object. */ #define RTLD_DEEPBIND 0x00008 /* Use deep binding. */ /* If the following bit is set in the MODE argument to `dlopen', the symbols of the loaded object and its dependencies are made visible as if the object were linked directly into the program. */ #define RTLD_GLOBAL 0x00100 /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. The implementation does this by default and so we can define the value to zero. */ #define RTLD_LOCAL 0 /* Do not delete object when closed. */ #define RTLD_NODELETE 0x01000 #ifdef __USE_GNU /* To support profiling of shared objects it is a good idea to call the function found using `dlsym' using the following macro since these calls do not use the PLT. But this would mean the dynamic loader has no chance to find out when the function is called. The macro applies the necessary magic so that profiling is possible. Rewrite foo = (*fctp) (arg1, arg2); into foo = DL_CALL_FCT (fctp, (arg1, arg2)); */ # define DL_CALL_FCT(fctp, args) \ (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) __BEGIN_DECLS /* This function calls the profiling functions. */ extern void _dl_mcount_wrapper_check(void *__selfpc) __THROW; __END_DECLS #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/endian.h ================================================ /* i386/x86_64 are little-endian. */ #ifndef _ENDIAN_H # error "Never use directly; include instead." #endif #define __BYTE_ORDER __LITTLE_ENDIAN ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/environments.h ================================================ /* Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _UNISTD_H # error "Never include this file directly. Use instead" #endif #include /* This header should define the following symbols under the described situations. A value `1' means that the model is always supported, `-1' means it is never supported. Undefined means it cannot be statically decided. _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard and are available only for compatibility. */ #if __WORDSIZE == 64 /* Environments with 32-bit wide pointers are optionally provided. Therefore following macros aren't defined: # undef _POSIX_V7_ILP32_OFF32 # undef _POSIX_V7_ILP32_OFFBIG # undef _POSIX_V6_ILP32_OFF32 # undef _POSIX_V6_ILP32_OFFBIG # undef _XBS5_ILP32_OFF32 # undef _XBS5_ILP32_OFFBIG and users need to check at runtime. */ /* We also have no use (for now) for an environment with bigger pointers and offsets. */ # define _POSIX_V7_LPBIG_OFFBIG -1 # define _POSIX_V6_LPBIG_OFFBIG -1 # define _XBS5_LPBIG_OFFBIG -1 /* By default we have 64-bit wide `long int', pointers and `off_t'. */ # define _POSIX_V7_LP64_OFF64 1 # define _POSIX_V6_LP64_OFF64 1 # define _XBS5_LP64_OFF64 1 #else /* __WORDSIZE == 32 */ /* We have 32-bit wide `int', `long int' and pointers and all platforms support LFS. -mx32 has 64-bit wide `off_t'. */ # define _POSIX_V7_ILP32_OFFBIG 1 # define _POSIX_V6_ILP32_OFFBIG 1 # define _XBS5_ILP32_OFFBIG 1 # ifndef __x86_64__ /* -m32 has 32-bit wide `off_t'. */ # define _POSIX_V7_ILP32_OFF32 1 # define _POSIX_V6_ILP32_OFF32 1 # define _XBS5_ILP32_OFF32 1 # endif /* We optionally provide an environment with the above size but an 64-bit side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ /* Environments with 64-bit wide pointers can be provided, so these macros aren't defined: # undef _POSIX_V7_LP64_OFF64 # undef _POSIX_V7_LPBIG_OFFBIG # undef _POSIX_V6_LP64_OFF64 # undef _POSIX_V6_LPBIG_OFFBIG # undef _XBS5_LP64_OFF64 # undef _XBS5_LPBIG_OFFBIG and sysconf tests for it at runtime. */ #endif /* __WORDSIZE == 32 */ #define __ILP32_OFF32_CFLAGS "-m32" #define __ILP32_OFF32_LDFLAGS "-m32" #if defined __x86_64__ && defined __ILP32__ # define __ILP32_OFFBIG_CFLAGS "-mx32" # define __ILP32_OFFBIG_LDFLAGS "-mx32" #else # define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" # define __ILP32_OFFBIG_LDFLAGS "-m32" #endif #define __LP64_OFF64_CFLAGS "-m64" #define __LP64_OFF64_LDFLAGS "-m64" ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/errno.h ================================================ /* Error constants. Linux specific version. Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifdef _ERRNO_H # undef EDOM # undef EILSEQ # undef ERANGE # include /* Linux has no ENOTSUP error code. */ # define ENOTSUP EOPNOTSUPP /* Older Linux versions also had no ECANCELED error code. */ # ifndef ECANCELED # define ECANCELED 125 # endif /* Support for error codes to support robust mutexes was added later, too. */ # ifndef EOWNERDEAD # define EOWNERDEAD 130 # define ENOTRECOVERABLE 131 # endif # ifndef ERFKILL # define ERFKILL 132 # endif # ifndef EHWPOISON # define EHWPOISON 133 # endif # ifndef __ASSEMBLER__ /* Function to get address of global `errno' variable. */ extern int *__errno_location(void) __THROW __attribute__ ((__const__)); # if !defined _LIBC || defined _LIBC_REENTRANT /* When using threads, errno is a per-thread value. */ # define errno (*__errno_location ()) # endif # endif /* !__ASSEMBLER__ */ #endif /* _ERRNO_H */ #if !defined _ERRNO_H && defined __need_Emath /* This is ugly but the kernel header is not clean enough. We must define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is defined. */ # define EDOM 33 /* Math argument out of domain of function. */ # define EILSEQ 84 /* Illegal byte sequence. */ # define ERANGE 34 /* Math result not representable. */ #endif /* !_ERRNO_H && __need_Emath */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/fcntl-linux.h ================================================ /* O_*, F_*, FD_* bit values for Linux. Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _FCNTL_H # error "Never use directly; include instead." #endif /* This file contains shared definitions between Linux architectures and is included by to declare them. The various #ifndef cases allow the architecture specific file to define those values with different values. A minimal contains just: struct flock {...} #ifdef __USE_LARGEFILE64 struct flock64 {...} #endif #include */ #ifdef __USE_GNU # include #endif /* open/fcntl. */ #define O_ACCMODE 0003 #define O_RDONLY 00 #define O_WRONLY 01 #define O_RDWR 02 #ifndef O_CREAT # define O_CREAT 0100 /* Not fcntl. */ #endif #ifndef O_EXCL # define O_EXCL 0200 /* Not fcntl. */ #endif #ifndef O_NOCTTY # define O_NOCTTY 0400 /* Not fcntl. */ #endif #ifndef O_TRUNC # define O_TRUNC 01000 /* Not fcntl. */ #endif #ifndef O_APPEND # define O_APPEND 02000 #endif #ifndef O_NONBLOCK # define O_NONBLOCK 04000 #endif #ifndef O_NDELAY # define O_NDELAY O_NONBLOCK #endif #ifndef O_SYNC # define O_SYNC 04010000 #endif #define O_FSYNC O_SYNC #ifndef O_ASYNC # define O_ASYNC 020000 #endif #ifndef __O_LARGEFILE # define __O_LARGEFILE 0100000 #endif #ifndef __O_DIRECTORY # define __O_DIRECTORY 0200000 #endif #ifndef __O_NOFOLLOW # define __O_NOFOLLOW 0400000 #endif #ifndef __O_CLOEXEC # define __O_CLOEXEC 02000000 #endif #ifndef __O_DIRECT # define __O_DIRECT 040000 #endif #ifndef __O_NOATIME # define __O_NOATIME 01000000 #endif #ifndef __O_PATH # define __O_PATH 010000000 #endif #ifndef __O_DSYNC # define __O_DSYNC 010000 #endif #ifndef __O_TMPFILE # define __O_TMPFILE (020000000 | __O_DIRECTORY) #endif #ifndef F_GETLK # ifndef __USE_FILE_OFFSET64 # define F_GETLK 5 /* Get record locking info. */ # define F_SETLK 6 /* Set record locking info (non-blocking). */ # define F_SETLKW 7 /* Set record locking info (blocking). */ # else # define F_GETLK F_GETLK64 /* Get record locking info. */ # define F_SETLK F_SETLK64 /* Set record locking info (non-blocking). */ # define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ # endif #endif #ifndef F_GETLK64 # define F_GETLK64 12 /* Get record locking info. */ # define F_SETLK64 13 /* Set record locking info (non-blocking). */ # define F_SETLKW64 14 /* Set record locking info (blocking). */ #endif /* open file description locks. Usually record locks held by a process are released on *any* close and are not inherited across a fork. These cmd values will set locks that conflict with process-associated record locks, but are "owned" by the opened file description, not the process. This means that they are inherited across fork or clone with CLONE_FILES like BSD (flock) locks, and they are only released automatically when the last reference to the the file description against which they were acquired is put. */ #ifdef __USE_GNU # define F_OFD_GETLK 36 # define F_OFD_SETLK 37 # define F_OFD_SETLKW 38 #endif #ifdef __USE_LARGEFILE64 # define O_LARGEFILE __O_LARGEFILE #endif #ifdef __USE_XOPEN2K8 # define O_DIRECTORY __O_DIRECTORY /* Must be a directory. */ # define O_NOFOLLOW __O_NOFOLLOW /* Do not follow links. */ # define O_CLOEXEC __O_CLOEXEC /* Set close_on_exec. */ #endif #ifdef __USE_GNU # define O_DIRECT __O_DIRECT /* Direct disk access. */ # define O_NOATIME __O_NOATIME /* Do not set atime. */ # define O_PATH __O_PATH /* Resolve pathname but do not open file. */ # define O_TMPFILE __O_TMPFILE /* Atomically create nameless file. */ #endif /* For now, Linux has no separate synchronicitiy options for read operations. We define O_RSYNC therefore as the same as O_SYNC since this is a superset. */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 # define O_DSYNC __O_DSYNC /* Synchronize data. */ # if defined __O_RSYNC # define O_RSYNC __O_RSYNC /* Synchronize read operations. */ # else # define O_RSYNC O_SYNC /* Synchronize read operations. */ # endif #endif /* Values for the second argument to `fcntl'. */ #define F_DUPFD 0 /* Duplicate file descriptor. */ #define F_GETFD 1 /* Get file descriptor flags. */ #define F_SETFD 2 /* Set file descriptor flags. */ #define F_GETFL 3 /* Get file status flags. */ #define F_SETFL 4 /* Set file status flags. */ #ifndef __F_SETOWN # define __F_SETOWN 8 # define __F_GETOWN 9 #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 # define F_SETOWN __F_SETOWN /* Get owner (process receiving SIGIO). */ # define F_GETOWN __F_GETOWN /* Set owner (process receiving SIGIO). */ #endif #ifndef __F_SETSIG # define __F_SETSIG 10 /* Set number of signal to be sent. */ # define __F_GETSIG 11 /* Get number of signal to be sent. */ #endif #ifndef __F_SETOWN_EX # define __F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ # define __F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU # define F_SETSIG __F_SETSIG /* Set number of signal to be sent. */ # define F_GETSIG __F_GETSIG /* Get number of signal to be sent. */ # define F_SETOWN_EX __F_SETOWN_EX /* Get owner (thread receiving SIGIO). */ # define F_GETOWN_EX __F_GETOWN_EX /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU # define F_SETLEASE 1024 /* Set a lease. */ # define F_GETLEASE 1025 /* Enquire what lease is active. */ # define F_NOTIFY 1026 /* Request notifications on a directory. */ # define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ # define F_GETPIPE_SZ 1032 /* Set pipe page size array. */ #endif #ifdef __USE_XOPEN2K8 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with close-on-exit set. */ #endif /* For F_[GET|SET]FD. */ #define FD_CLOEXEC 1 /* Actually anything with low bit set goes */ #ifndef F_RDLCK /* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ # define F_RDLCK 0 /* Read lock. */ # define F_WRLCK 1 /* Write lock. */ # define F_UNLCK 2 /* Remove lock. */ #endif /* For old implementation of BSD flock. */ #ifndef F_EXLCK # define F_EXLCK 4 /* or 3 */ # define F_SHLCK 8 /* or 4 */ #endif #ifdef __USE_MISC /* Operations for BSD flock, also used by the kernel implementation. */ # define LOCK_SH 1 /* Shared lock. */ # define LOCK_EX 2 /* Exclusive lock. */ # define LOCK_NB 4 /* Or'd with one of the above to prevent blocking. */ # define LOCK_UN 8 /* Remove lock. */ #endif #ifdef __USE_GNU # define LOCK_MAND 32 /* This is a mandatory flock: */ # define LOCK_READ 64 /* ... which allows concurrent read operations. */ # define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ # define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ #endif #ifdef __USE_GNU /* Types of directory notifications that may be requested with F_NOTIFY. */ # define DN_ACCESS 0x00000001 /* File accessed. */ # define DN_MODIFY 0x00000002 /* File modified. */ # define DN_CREATE 0x00000004 /* File created. */ # define DN_DELETE 0x00000008 /* File removed. */ # define DN_RENAME 0x00000010 /* File renamed. */ # define DN_ATTRIB 0x00000020 /* File changed attributes. */ # define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ #endif #ifdef __USE_GNU /* Owner types. */ enum __pid_type { F_OWNER_TID = 0, /* Kernel thread. */ F_OWNER_PID, /* Process. */ F_OWNER_PGRP, /* Process group. */ F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ }; /* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ struct f_owner_ex { enum __pid_type type; /* Owner type of ID. */ __pid_t pid; /* ID of owner. */ }; #endif /* Define some more compatibility macros to be backward compatible with BSD systems which did not managed to hide these kernel macros. */ #ifdef __USE_MISC # define FAPPEND O_APPEND # define FFSYNC O_FSYNC # define FASYNC O_ASYNC # define FNONBLOCK O_NONBLOCK # define FNDELAY O_NDELAY #endif /* Use misc. */ #ifndef __POSIX_FADV_DONTNEED # define __POSIX_FADV_DONTNEED 4 # define __POSIX_FADV_NOREUSE 5 #endif /* Advise to `posix_fadvise'. */ #ifdef __USE_XOPEN2K # define POSIX_FADV_NORMAL 0 /* No further special treatment. */ # define POSIX_FADV_RANDOM 1 /* Expect random page references. */ # define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ # define POSIX_FADV_DONTNEED __POSIX_FADV_DONTNEED /* Don't need these pages. */ # define POSIX_FADV_NOREUSE __POSIX_FADV_NOREUSE /* Data will be accessed once. */ #endif #ifdef __USE_GNU /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the write. */ # define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those dirty pages in the range which are not presently under writeback. */ # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ # define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing (but we may still block on the fd we splice from/to). */ # define SPLICE_F_MORE 4 /* Expect more data. */ # define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ /* Flags for fallocate. */ # define FALLOC_FL_KEEP_SIZE 1 /* Don't extend size of file even if offset + len is greater than file size. */ # define FALLOC_FL_PUNCH_HOLE 2 /* Create a hole in the file. */ # define FALLOC_FL_COLLAPSE_RANGE 8 /* Remove a range of a file without leaving a hole. */ # define FALLOC_FL_ZERO_RANGE 16 /* Convert a range of a file to zeros. */ /* File handle structure. */ struct file_handle { unsigned int handle_bytes; int handle_type; /* File identifier. */ unsigned char f_handle[0]; }; /* Maximum handle size (for now). */ # define MAX_HANDLE_SZ 128 #endif __BEGIN_DECLS #ifdef __USE_GNU /* Provide kernel hint to read ahead. */ extern ssize_t readahead(int __fd, __off64_t __offset, size_t __count) __THROW; /* Selective file content synch'ing. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int sync_file_range(int __fd, __off64_t __offset, __off64_t __count, unsigned int __flags); /* Splice address range into a pipe. This function is a possible cancellation point and therefore not marked with __THROW. */ extern ssize_t vmsplice(int __fdout, const struct iovec *__iov, size_t __count, unsigned int __flags); /* Splice two files together. This function is a possible cancellation point and therefore not marked with __THROW. */ extern ssize_t splice(int __fdin, __off64_t * __offin, int __fdout, __off64_t * __offout, size_t __len, unsigned int __flags); /* In-kernel implementation of tee for pipe buffers. This function is a possible cancellation point and therefore not marked with __THROW. */ extern ssize_t tee(int __fdin, int __fdout, size_t __len, unsigned int __flags); /* Reserve storage for the data of the file associated with FD. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int fallocate(int __fd, int __mode, __off_t __offset, __off_t __len); # else # ifdef __REDIRECT extern int __REDIRECT(fallocate, (int __fd, int __mode, __off64_t __offset, __off64_t __len), fallocate64); # else # define fallocate fallocate64 # endif # endif # ifdef __USE_LARGEFILE64 extern int fallocate64(int __fd, int __mode, __off64_t __offset, __off64_t __len); # endif /* Map file name to file handle. */ extern int name_to_handle_at(int __dfd, const char *__name, struct file_handle *__handle, int *__mnt_id, int __flags) __THROW; /* Open file using the file handle. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int open_by_handle_at(int __mountdirfd, struct file_handle *__handle, int __flags); #endif /* use GNU */ __END_DECLS ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/fcntl.h ================================================ /* O_*, F_*, FD_* bit values for Linux/x86. Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _FCNTL_H # error "Never use directly; include instead." #endif #ifdef __x86_64__ # define __O_LARGEFILE 0 #endif #ifdef __x86_64__ /* Not necessary, we always have 64-bit offsets. */ # define F_GETLK64 5 /* Get record locking info. */ # define F_SETLK64 6 /* Set record locking info (non-blocking). */ # define F_SETLKW64 7 /* Set record locking info (blocking). */ #endif struct flock { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ #ifndef __USE_FILE_OFFSET64 __off_t l_start; /* Offset where the lock begins. */ __off_t l_len; /* Size of the locked area; zero means until EOF. */ #else __off64_t l_start; /* Offset where the lock begins. */ __off64_t l_len; /* Size of the locked area; zero means until EOF. */ #endif __pid_t l_pid; /* Process holding the lock. */ }; #ifdef __USE_LARGEFILE64 struct flock64 { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ __off64_t l_start; /* Offset where the lock begins. */ __off64_t l_len; /* Size of the locked area; zero means until EOF. */ __pid_t l_pid; /* Process holding the lock. */ }; #endif /* Include generic Linux declarations. */ #include ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/huge_val.h ================================================ /* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity). Used by and functions for overflow. Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif /* IEEE positive infinity (-HUGE_VAL is negative infinity). */ #if __GNUC_PREREQ(3,3) # define HUGE_VAL (__builtin_huge_val()) #elif __GNUC_PREREQ(2,96) # define HUGE_VAL (__extension__ 0x1.0p2047) #elif defined __GNUC__ # define HUGE_VAL \ (__extension__ \ ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ { __l: 0x7ff0000000000000ULL }).__d) #else /* not GCC */ # include typedef union { unsigned char __c[8]; double __d; } __huge_val_t; # if __BYTE_ORDER == __BIG_ENDIAN # define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } # endif # if __BYTE_ORDER == __LITTLE_ENDIAN # define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } # endif static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; # define HUGE_VAL (__huge_val.__d) #endif /* GCC. */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/huge_valf.h ================================================ /* `HUGE_VALF' constant for IEEE 754 machines (where it is infinity). Used by and functions for overflow. Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif /* IEEE positive infinity (-HUGE_VAL is negative infinity). */ #if __GNUC_PREREQ(3,3) # define HUGE_VALF (__builtin_huge_valf()) #elif __GNUC_PREREQ(2,96) # define HUGE_VALF (__extension__ 0x1.0p255f) #elif defined __GNUC__ # define HUGE_VALF \ (__extension__ \ ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ { __l: 0x7f800000UL }).__d) #else /* not GCC */ typedef union { unsigned char __c[4]; float __f; } __huge_valf_t; # if __BYTE_ORDER == __BIG_ENDIAN # define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } # endif # if __BYTE_ORDER == __LITTLE_ENDIAN # define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } # endif static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; # define HUGE_VALF (__huge_valf.__f) #endif /* GCC. */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/huge_vall.h ================================================ /* `HUGE_VALL' constant for ix86 (where it is infinity). Used by and functions for overflow. Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif #if __GNUC_PREREQ(3,3) # define HUGE_VALL (__builtin_huge_vall()) #elif __GNUC_PREREQ(2,96) # define HUGE_VALL (__extension__ 0x1.0p32767L) #else # define __HUGE_VALL_bytes { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 } # define __huge_vall_t union { unsigned char __c[12]; long double __ld; } # ifdef __GNUC__ # define HUGE_VALL (__extension__ \ ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld) # else /* Not GCC. */ static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes }; # define HUGE_VALL (__huge_vall.__ld) # endif /* GCC. */ #endif /* GCC 2.95 */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/in.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* Linux version. */ #ifndef _NETINET_IN_H # error "Never use directly; include instead." #endif /* If the application has already included linux/in6.h from a linux-based kernel then we will not define the IPv6 IPPROTO_* defines, in6_addr (nor the defines), sockaddr_in6, or ipv6_mreq. Same for in6_ptkinfo or ip6_mtuinfo in linux/ipv6.h. The ABI used by the linux-kernel and glibc match exactly. Neither the linux kernel nor glibc should break this ABI without coordination. */ #if defined _UAPI_LINUX_IN6_H || defined _UAPI_IPV6_H /* This is not quite the same API since the kernel always defines s6_addr16 and s6_addr32. This is not a violation of POSIX since POSIX says "at least the following member" and that holds true. */ # define __USE_KERNEL_IPV6_DEFS #endif /* Options for use with `getsockopt' and `setsockopt' at the IP level. The first word in the comment at the right is the data type used; "bool" means a boolean value stored in an `int'. */ #define IP_OPTIONS 4 /* ip_opts; IP per-packet options. */ #define IP_HDRINCL 3 /* int; Header is included with data. */ #define IP_TOS 1 /* int; IP type of service and precedence. */ #define IP_TTL 2 /* int; IP time to live. */ #define IP_RECVOPTS 6 /* bool; Receive all IP options w/datagram. */ /* For BSD compatibility. */ #define IP_RECVRETOPTS IP_RETOPTS /* bool; Receive IP options for response. */ #define IP_RETOPTS 7 /* ip_opts; Set/get IP per-packet options. */ #define IP_MULTICAST_IF 32 /* in_addr; set/get IP multicast i/f */ #define IP_MULTICAST_TTL 33 /* u_char; set/get IP multicast ttl */ #define IP_MULTICAST_LOOP 34 /* i_char; set/get IP multicast loopback */ #define IP_ADD_MEMBERSHIP 35 /* ip_mreq; add an IP group membership */ #define IP_DROP_MEMBERSHIP 36 /* ip_mreq; drop an IP group membership */ #define IP_UNBLOCK_SOURCE 37 /* ip_mreq_source: unblock data from source */ #define IP_BLOCK_SOURCE 38 /* ip_mreq_source: block data from source */ #define IP_ADD_SOURCE_MEMBERSHIP 39 /* ip_mreq_source: join source group */ #define IP_DROP_SOURCE_MEMBERSHIP 40 /* ip_mreq_source: leave source group */ #define IP_MSFILTER 41 #ifdef __USE_MISC # define MCAST_JOIN_GROUP 42 /* group_req: join any-source group */ # define MCAST_BLOCK_SOURCE 43 /* group_source_req: block from given group */ # define MCAST_UNBLOCK_SOURCE 44 /* group_source_req: unblock from given group */ # define MCAST_LEAVE_GROUP 45 /* group_req: leave any-source group */ # define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */ # define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr */ # define MCAST_MSFILTER 48 # define IP_MULTICAST_ALL 49 # define IP_UNICAST_IF 50 # define MCAST_EXCLUDE 0 # define MCAST_INCLUDE 1 #endif #define IP_ROUTER_ALERT 5 /* bool */ #define IP_PKTINFO 8 /* bool */ #define IP_PKTOPTIONS 9 #define IP_PMTUDISC 10 /* obsolete name? */ #define IP_MTU_DISCOVER 10 /* int; see below */ #define IP_RECVERR 11 /* bool */ #define IP_RECVTTL 12 /* bool */ #define IP_RECVTOS 13 /* bool */ #define IP_MTU 14 /* int */ #define IP_FREEBIND 15 #define IP_IPSEC_POLICY 16 #define IP_XFRM_POLICY 17 #define IP_PASSSEC 18 #define IP_TRANSPARENT 19 #define IP_MULTICAST_ALL 49 /* bool */ /* TProxy original addresses */ #define IP_ORIGDSTADDR 20 #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR #define IP_MINTTL 21 #define IP_NODEFRAG 22 #define IP_CHECKSUM 23 /* IP_MTU_DISCOVER arguments. */ #define IP_PMTUDISC_DONT 0 /* Never send DF frames. */ #define IP_PMTUDISC_WANT 1 /* Use per route hints. */ #define IP_PMTUDISC_DO 2 /* Always DF. */ #define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */ /* Always use interface mtu (ignores dst pmtu) but don't set DF flag. Also incoming ICMP frag_needed notifications will be ignored on this socket to prevent accepting spoofed ones. */ #define IP_PMTUDISC_INTERFACE 4 /* Like IP_PMTUDISC_INTERFACE but allow packets to be fragmented. */ #define IP_PMTUDISC_OMIT 5 #define IP_MULTICAST_IF 32 #define IP_MULTICAST_TTL 33 #define IP_MULTICAST_LOOP 34 #define IP_ADD_MEMBERSHIP 35 #define IP_DROP_MEMBERSHIP 36 #define IP_UNBLOCK_SOURCE 37 #define IP_BLOCK_SOURCE 38 #define IP_ADD_SOURCE_MEMBERSHIP 39 #define IP_DROP_SOURCE_MEMBERSHIP 40 #define IP_MSFILTER 41 #define IP_MULTICAST_ALL 49 #define IP_UNICAST_IF 50 /* To select the IP level. */ #define SOL_IP 0 #define IP_DEFAULT_MULTICAST_TTL 1 #define IP_DEFAULT_MULTICAST_LOOP 1 #define IP_MAX_MEMBERSHIPS 20 #ifdef __USE_MISC /* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS. The `ip_dst' field is used for the first-hop gateway when using a source route (this gets put into the header proper). */ struct ip_opts { struct in_addr ip_dst; /* First hop; zero without source route. */ char ip_opts[40]; /* Actually variable in size. */ }; /* Like `struct ip_mreq' but including interface specification by index. */ struct ip_mreqn { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_address; /* local IP address of interface */ int imr_ifindex; /* Interface index */ }; /* Structure used for IP_PKTINFO. */ struct in_pktinfo { int ipi_ifindex; /* Interface index */ struct in_addr ipi_spec_dst; /* Routing destination address */ struct in_addr ipi_addr; /* Header destination address */ }; #endif /* Options for use with `getsockopt' and `setsockopt' at the IPv6 level. The first word in the comment at the right is the data type used; "bool" means a boolean value stored in an `int'. */ #define IPV6_ADDRFORM 1 #define IPV6_2292PKTINFO 2 #define IPV6_2292HOPOPTS 3 #define IPV6_2292DSTOPTS 4 #define IPV6_2292RTHDR 5 #define IPV6_2292PKTOPTIONS 6 #define IPV6_CHECKSUM 7 #define IPV6_2292HOPLIMIT 8 #define SCM_SRCRT IPV6_RXSRCRT #define IPV6_NEXTHOP 9 #define IPV6_AUTHHDR 10 #define IPV6_UNICAST_HOPS 16 #define IPV6_MULTICAST_IF 17 #define IPV6_MULTICAST_HOPS 18 #define IPV6_MULTICAST_LOOP 19 #define IPV6_JOIN_GROUP 20 #define IPV6_LEAVE_GROUP 21 #define IPV6_ROUTER_ALERT 22 #define IPV6_MTU_DISCOVER 23 #define IPV6_MTU 24 #define IPV6_RECVERR 25 #define IPV6_V6ONLY 26 #define IPV6_JOIN_ANYCAST 27 #define IPV6_LEAVE_ANYCAST 28 #define IPV6_IPSEC_POLICY 34 #define IPV6_XFRM_POLICY 35 /* Advanced API (RFC3542) (1). */ #define IPV6_RECVPKTINFO 49 #define IPV6_PKTINFO 50 #define IPV6_RECVHOPLIMIT 51 #define IPV6_HOPLIMIT 52 #define IPV6_RECVHOPOPTS 53 #define IPV6_HOPOPTS 54 #define IPV6_RTHDRDSTOPTS 55 #define IPV6_RECVRTHDR 56 #define IPV6_RTHDR 57 #define IPV6_RECVDSTOPTS 58 #define IPV6_DSTOPTS 59 #define IPV6_RECVPATHMTU 60 #define IPV6_PATHMTU 61 #define IPV6_DONTFRAG 62 /* Advanced API (RFC3542) (2). */ #define IPV6_RECVTCLASS 66 #define IPV6_TCLASS 67 /* Obsolete synonyms for the above. */ #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP #define IPV6_RXHOPOPTS IPV6_HOPOPTS #define IPV6_RXDSTOPTS IPV6_DSTOPTS /* IPV6_MTU_DISCOVER values. */ #define IPV6_PMTUDISC_DONT 0 /* Never send DF frames. */ #define IPV6_PMTUDISC_WANT 1 /* Use per route hints. */ #define IPV6_PMTUDISC_DO 2 /* Always DF. */ #define IPV6_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */ #define IPV6_PMTUDISC_INTERFACE 4 /* See IP_PMTUDISC_INTERFACE. */ #define IPV6_PMTUDISC_OMIT 5 /* See IP_PMTUDISC_OMIT. */ /* Socket level values for IPv6. */ #define SOL_IPV6 41 #define SOL_ICMPV6 58 /* Routing header options for IPv6. */ #define IPV6_RTHDR_LOOSE 0 /* Hop doesn't need to be neighbour. */ #define IPV6_RTHDR_STRICT 1 /* Hop must be a neighbour. */ #define IPV6_RTHDR_TYPE_0 0 /* IPv6 Routing header type 0. */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/inf.h ================================================ /* `INFINITY' constant for IEEE 754 machines. Copyright (C) 2004-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif /* IEEE positive infinity. */ #if __GNUC_PREREQ(3,3) # define INFINITY (__builtin_inff()) #else # define INFINITY HUGE_VALF #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/ioctl-types.h ================================================ /* Structure types for pre-termios terminal ioctls. Linux version. Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_IOCTL_H # error "Never use directly; include instead." #endif /* Get definition of constants for use with `ioctl'. */ #include struct winsize { unsigned short int ws_row; unsigned short int ws_col; unsigned short int ws_xpixel; unsigned short int ws_ypixel; }; #define NCC 8 struct termio { unsigned short int c_iflag; /* input mode flags */ unsigned short int c_oflag; /* output mode flags */ unsigned short int c_cflag; /* control mode flags */ unsigned short int c_lflag; /* local mode flags */ unsigned char c_line; /* line discipline */ unsigned char c_cc[NCC]; /* control characters */ }; /* modem lines */ #define TIOCM_LE 0x001 #define TIOCM_DTR 0x002 #define TIOCM_RTS 0x004 #define TIOCM_ST 0x008 #define TIOCM_SR 0x010 #define TIOCM_CTS 0x020 #define TIOCM_CAR 0x040 #define TIOCM_RNG 0x080 #define TIOCM_DSR 0x100 #define TIOCM_CD TIOCM_CAR #define TIOCM_RI TIOCM_RNG /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ /* line disciplines */ #define N_TTY 0 #define N_SLIP 1 #define N_MOUSE 2 #define N_PPP 3 #define N_STRIP 4 #define N_AX25 5 #define N_X25 6 /* X.25 async */ #define N_6PACK 7 #define N_MASC 8 /* Mobitex module */ #define N_R3964 9 /* Simatic R3964 module */ #define N_PROFIBUS_FDL 10 /* Profibus */ #define N_IRDA 11 /* Linux IR */ #define N_SMSBLOCK 12 /* SMS block mode */ #define N_HDLC 13 /* synchronous HDLC */ #define N_SYNC_PPP 14 /* synchronous PPP */ #define N_HCI 15 /* Bluetooth HCI UART */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/ioctls.h ================================================ /* Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_IOCTL_H # error "Never use directly; include instead." #endif /* Use the definitions from the kernel header files. */ #include /* Routing table calls. */ #define SIOCADDRT 0x890B /* add routing table entry */ #define SIOCDELRT 0x890C /* delete routing table entry */ #define SIOCRTMSG 0x890D /* call to routing system */ /* Socket configuration controls. */ #define SIOCGIFNAME 0x8910 /* get iface name */ #define SIOCSIFLINK 0x8911 /* set iface channel */ #define SIOCGIFCONF 0x8912 /* get iface list */ #define SIOCGIFFLAGS 0x8913 /* get flags */ #define SIOCSIFFLAGS 0x8914 /* set flags */ #define SIOCGIFADDR 0x8915 /* get PA address */ #define SIOCSIFADDR 0x8916 /* set PA address */ #define SIOCGIFDSTADDR 0x8917 /* get remote PA address */ #define SIOCSIFDSTADDR 0x8918 /* set remote PA address */ #define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */ #define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */ #define SIOCGIFNETMASK 0x891b /* get network PA mask */ #define SIOCSIFNETMASK 0x891c /* set network PA mask */ #define SIOCGIFMETRIC 0x891d /* get metric */ #define SIOCSIFMETRIC 0x891e /* set metric */ #define SIOCGIFMEM 0x891f /* get memory address (BSD) */ #define SIOCSIFMEM 0x8920 /* set memory address (BSD) */ #define SIOCGIFMTU 0x8921 /* get MTU size */ #define SIOCSIFMTU 0x8922 /* set MTU size */ #define SIOCSIFNAME 0x8923 /* set interface name */ #define SIOCSIFHWADDR 0x8924 /* set hardware address */ #define SIOCGIFENCAP 0x8925 /* get/set encapsulations */ #define SIOCSIFENCAP 0x8926 #define SIOCGIFHWADDR 0x8927 /* Get hardware address */ #define SIOCGIFSLAVE 0x8929 /* Driver slaving support */ #define SIOCSIFSLAVE 0x8930 #define SIOCADDMULTI 0x8931 /* Multicast address lists */ #define SIOCDELMULTI 0x8932 #define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */ #define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */ #define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */ #define SIOCGIFPFLAGS 0x8935 #define SIOCDIFADDR 0x8936 /* delete PA address */ #define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */ #define SIOCGIFCOUNT 0x8938 /* get number of devices */ #define SIOCGIFBR 0x8940 /* Bridging support */ #define SIOCSIFBR 0x8941 /* Set bridging options */ #define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ #define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ /* ARP cache control calls. */ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */ #define SIOCDARP 0x8953 /* delete ARP table entry */ #define SIOCGARP 0x8954 /* get ARP table entry */ #define SIOCSARP 0x8955 /* set ARP table entry */ /* RARP cache control calls. */ #define SIOCDRARP 0x8960 /* delete RARP table entry */ #define SIOCGRARP 0x8961 /* get RARP table entry */ #define SIOCSRARP 0x8962 /* set RARP table entry */ /* Driver configuration calls */ #define SIOCGIFMAP 0x8970 /* Get device parameters */ #define SIOCSIFMAP 0x8971 /* Set device parameters */ /* DLCI configuration calls */ #define SIOCADDDLCI 0x8980 /* Create new DLCI device */ #define SIOCDELDLCI 0x8981 /* Delete DLCI device */ /* Device private ioctl calls. */ /* These 16 ioctls are available to devices via the do_ioctl() device vector. Each device should include this file and redefine these names as their own. Because these are device dependent it is a good idea _NOT_ to issue them to random objects and hope. */ #define SIOCDEVPRIVATE 0x89F0 /* to 89FF */ /* * These 16 ioctl calls are protocol private */ #define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/libm-simd-decl-stubs.h ================================================ /* Empty definitions required for __MATHCALL_VEC unfolding in mathcalls.h. Copyright (C) 2014-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never include directly;\ include instead." #endif /* Needed definitions could be generated with: for func in $(grep __MATHCALL_VEC math/bits/mathcalls.h |\ sed -r "s|__MATHCALL_VEC.?\(||; s|,.*||"); do echo "#define __DECL_SIMD_${func}"; echo "#define __DECL_SIMD_${func}f"; echo "#define __DECL_SIMD_${func}l"; done */ #ifndef _BITS_LIBM_SIMD_DECL_STUBS_H #define _BITS_LIBM_SIMD_DECL_STUBS_H 1 #define __DECL_SIMD_cos #define __DECL_SIMD_cosf #define __DECL_SIMD_cosl #define __DECL_SIMD_sin #define __DECL_SIMD_sinf #define __DECL_SIMD_sinl #define __DECL_SIMD_sincos #define __DECL_SIMD_sincosf #define __DECL_SIMD_sincosl #define __DECL_SIMD_log #define __DECL_SIMD_logf #define __DECL_SIMD_logl #define __DECL_SIMD_exp #define __DECL_SIMD_expf #define __DECL_SIMD_expl #define __DECL_SIMD_pow #define __DECL_SIMD_powf #define __DECL_SIMD_powl #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/local_lim.h ================================================ /* Minimum guaranteed maximum values for system limits. Linux version. Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see . */ /* The kernel header pollutes the namespace with the NR_OPEN symbol and defines LINK_MAX although filesystems have different maxima. A similar thing is true for OPEN_MAX: the limit can be changed at runtime and therefore the macro must not be defined. Remove this after including the header if necessary. */ #ifndef NR_OPEN # define __undef_NR_OPEN #endif #ifndef LINK_MAX # define __undef_LINK_MAX #endif #ifndef OPEN_MAX # define __undef_OPEN_MAX #endif #ifndef ARG_MAX # define __undef_ARG_MAX #endif /* The kernel sources contain a file with all the needed information. */ #include /* Have to remove NR_OPEN? */ #ifdef __undef_NR_OPEN # undef NR_OPEN # undef __undef_NR_OPEN #endif /* Have to remove LINK_MAX? */ #ifdef __undef_LINK_MAX # undef LINK_MAX # undef __undef_LINK_MAX #endif /* Have to remove OPEN_MAX? */ #ifdef __undef_OPEN_MAX # undef OPEN_MAX # undef __undef_OPEN_MAX #endif /* Have to remove ARG_MAX? */ #ifdef __undef_ARG_MAX # undef ARG_MAX # undef __undef_ARG_MAX #endif /* The number of data keys per process. */ #define _POSIX_THREAD_KEYS_MAX 128 /* This is the value this implementation supports. */ #define PTHREAD_KEYS_MAX 1024 /* Controlling the iterations of destructors for thread-specific data. */ #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 /* Number of iterations this implementation does. */ #define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS /* The number of threads per process. */ #define _POSIX_THREAD_THREADS_MAX 64 /* We have no predefined limit on the number of threads. */ #undef PTHREAD_THREADS_MAX /* Maximum amount by which a process can descrease its asynchronous I/O priority level. */ #define AIO_PRIO_DELTA_MAX 20 /* Minimum size for a thread. We are free to choose a reasonable value. */ #define PTHREAD_STACK_MIN 16384 /* Maximum number of timer expiration overruns. */ #define DELAYTIMER_MAX 2147483647 /* Maximum tty name length. */ #define TTY_NAME_MAX 32 /* Maximum login name length. This is arbitrary. */ #define LOGIN_NAME_MAX 256 /* Maximum host name length. */ #define HOST_NAME_MAX 64 /* Maximum message queue priority level. */ #define MQ_PRIO_MAX 32768 /* Maximum value the semaphore can have. */ #define SEM_VALUE_MAX (2147483647) ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/locale.h ================================================ /* Definition of locale category symbol values. Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _LOCALE_H && !defined _LANGINFO_H # error "Never use directly; include instead." #endif #ifndef _BITS_LOCALE_H #define _BITS_LOCALE_H 1 #define __LC_CTYPE 0 #define __LC_NUMERIC 1 #define __LC_TIME 2 #define __LC_COLLATE 3 #define __LC_MONETARY 4 #define __LC_MESSAGES 5 #define __LC_ALL 6 #define __LC_PAPER 7 #define __LC_NAME 8 #define __LC_ADDRESS 9 #define __LC_TELEPHONE 10 #define __LC_MEASUREMENT 11 #define __LC_IDENTIFICATION 12 #endif /* bits/locale.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/math-vector.h ================================================ /* Platform-specific SIMD declarations of math functions. Copyright (C) 2014-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never include directly;\ include instead." #endif /* Get default empty definitions for simd declarations. */ #include #if defined __x86_64__ && defined __FAST_MATH__ # if defined _OPENMP && _OPENMP >= 201307 /* OpenMP case. */ # define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") # elif __GNUC_PREREQ (6,0) /* W/o OpenMP use GCC 6.* __attribute__ ((__simd__)). */ # define __DECL_SIMD_x86_64 __attribute__ ((__simd__ ("notinbranch"))) # endif # ifdef __DECL_SIMD_x86_64 # undef __DECL_SIMD_cos # define __DECL_SIMD_cos __DECL_SIMD_x86_64 # undef __DECL_SIMD_cosf # define __DECL_SIMD_cosf __DECL_SIMD_x86_64 # undef __DECL_SIMD_sin # define __DECL_SIMD_sin __DECL_SIMD_x86_64 # undef __DECL_SIMD_sinf # define __DECL_SIMD_sinf __DECL_SIMD_x86_64 # undef __DECL_SIMD_sincos # define __DECL_SIMD_sincos __DECL_SIMD_x86_64 # undef __DECL_SIMD_sincosf # define __DECL_SIMD_sincosf __DECL_SIMD_x86_64 # undef __DECL_SIMD_log # define __DECL_SIMD_log __DECL_SIMD_x86_64 # undef __DECL_SIMD_logf # define __DECL_SIMD_logf __DECL_SIMD_x86_64 # undef __DECL_SIMD_exp # define __DECL_SIMD_exp __DECL_SIMD_x86_64 # undef __DECL_SIMD_expf # define __DECL_SIMD_expf __DECL_SIMD_x86_64 # undef __DECL_SIMD_pow # define __DECL_SIMD_pow __DECL_SIMD_x86_64 # undef __DECL_SIMD_powf # define __DECL_SIMD_powf __DECL_SIMD_x86_64 # endif #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/mathcalls.h ================================================ /* Prototype declarations for math functions; helper file for . Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* NOTE: Because of the special way this file is used by , this file must NOT be protected from multiple inclusion as header files usually are. This file provides prototype declarations for the math functions. Most functions are declared using the macro: __MATHCALL (NAME,[_r], (ARGS...)); This means there is a function `NAME' returning `double' and a function `NAMEf' returning `float'. Each place `_Mdouble_' appears in the prototype, that is actually `double' in the prototype for `NAME' and `float' in the prototype for `NAMEf'. Reentrant variant functions are called `NAME_r' and `NAMEf_r'. Functions returning other types like `int' are declared using the macro: __MATHDECL (TYPE, NAME,[_r], (ARGS...)); This is just like __MATHCALL but for a function returning `TYPE' instead of `_Mdouble_'. In all of these cases, there is still both a `NAME' and a `NAMEf' that takes `float' arguments. Note that there must be no whitespace before the argument passed for NAME, to make token pasting work with -traditional. */ #ifndef _MATH_H # error "Never include directly; include instead." #endif /* Trigonometric functions. */ _Mdouble_BEGIN_NAMESPACE /* Arc cosine of X. */ __MATHCALL(acos,, (_Mdouble_ __x)); /* Arc sine of X. */ __MATHCALL(asin,, (_Mdouble_ __x)); /* Arc tangent of X. */ __MATHCALL(atan,, (_Mdouble_ __x)); /* Arc tangent of Y/X. */ __MATHCALL(atan2,, (_Mdouble_ __y, _Mdouble_ __x)); /* Cosine of X. */ __MATHCALL_VEC(cos,, (_Mdouble_ __x)); /* Sine of X. */ __MATHCALL_VEC(sin,, (_Mdouble_ __x)); /* Tangent of X. */ __MATHCALL(tan,, (_Mdouble_ __x)); /* Hyperbolic functions. */ /* Hyperbolic cosine of X. */ __MATHCALL(cosh,, (_Mdouble_ __x)); /* Hyperbolic sine of X. */ __MATHCALL(sinh,, (_Mdouble_ __x)); /* Hyperbolic tangent of X. */ __MATHCALL(tanh,, (_Mdouble_ __x)); _Mdouble_END_NAMESPACE #ifdef __USE_GNU /* Cosine and sine of X. */ __MATHDECL_VEC(void, sincos,, (_Mdouble_ __x, _Mdouble_ * __sinx, _Mdouble_ * __cosx)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Hyperbolic arc cosine of X. */ __MATHCALL(acosh,, (_Mdouble_ __x)); /* Hyperbolic arc sine of X. */ __MATHCALL(asinh,, (_Mdouble_ __x)); /* Hyperbolic arc tangent of X. */ __MATHCALL(atanh,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif /* Exponential and logarithmic functions. */ _Mdouble_BEGIN_NAMESPACE /* Exponential function of X. */ __MATHCALL_VEC(exp,, (_Mdouble_ __x)); /* Break VALUE into a normalized fraction and an integral power of 2. */ __MATHCALL(frexp,, (_Mdouble_ __x, int *__exponent)); /* X times (two to the EXP power). */ __MATHCALL(ldexp,, (_Mdouble_ __x, int __exponent)); /* Natural logarithm of X. */ __MATHCALL_VEC(log,, (_Mdouble_ __x)); /* Base-ten logarithm of X. */ __MATHCALL(log10,, (_Mdouble_ __x)); /* Break VALUE into integral and fractional parts. */ __MATHCALL(modf,, (_Mdouble_ __x, _Mdouble_ * __iptr)) __nonnull((2)); _Mdouble_END_NAMESPACE #ifdef __USE_GNU /* A function missing in all standards: compute exponent to base ten. */ __MATHCALL(exp10,, (_Mdouble_ __x)); /* Another name occasionally used. */ __MATHCALL(pow10,, (_Mdouble_ __x)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return exp(X) - 1. */ __MATHCALL(expm1,, (_Mdouble_ __x)); /* Return log(1 + X). */ __MATHCALL(log1p,, (_Mdouble_ __x)); /* Return the base 2 signed integral exponent of X. */ __MATHCALL(logb,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Compute base-2 exponential of X. */ __MATHCALL(exp2,, (_Mdouble_ __x)); /* Compute base-2 logarithm of X. */ __MATHCALL(log2,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif /* Power functions. */ _Mdouble_BEGIN_NAMESPACE /* Return X to the Y power. */ __MATHCALL_VEC(pow,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the square root of X. */ __MATHCALL(sqrt,, (_Mdouble_ __x)); _Mdouble_END_NAMESPACE #if defined __USE_XOPEN || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return `sqrt(X*X + Y*Y)'. */ __MATHCALL(hypot,, (_Mdouble_ __x, _Mdouble_ __y)); __END_NAMESPACE_C99 #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return the cube root of X. */ __MATHCALL(cbrt,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif /* Nearest integer, absolute value, and remainder functions. */ _Mdouble_BEGIN_NAMESPACE /* Smallest integral value not less than X. */ __MATHCALLX(ceil,, (_Mdouble_ __x), (__const__)); /* Absolute value of X. */ __MATHCALLX(fabs,, (_Mdouble_ __x), (__const__)); /* Largest integer not greater than X. */ __MATHCALLX(floor,, (_Mdouble_ __x), (__const__)); /* Floating-point modulo remainder of X/Y. */ __MATHCALL(fmod,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1(int, __isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. */ __MATHDECL_1(int, __finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); _Mdouble_END_NAMESPACE #ifdef __USE_MISC # if (!defined __cplusplus \ || __cplusplus < 201103L /* isinf conflicts with C++11. */ \ || __MATH_DECLARING_DOUBLE == 0) /* isinff or isinfl don't. */ /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1(int, isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); # endif /* Return nonzero if VALUE is finite and not NaN. */ __MATHDECL_1(int, finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return the remainder of X/Y. */ __MATHCALL(drem,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the fractional part of X after dividing out `ilogb (X)'. */ __MATHCALL(significand,, (_Mdouble_ __x)); #endif /* Use misc. */ #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return X with its signed changed to Y's. */ __MATHCALLX(copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); __END_NAMESPACE_C99 #endif #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return representation of qNaN for double type. */ __MATHCALLX(nan,, (const char *__tagb), (__const__)); __END_NAMESPACE_C99 #endif /* Return nonzero if VALUE is not a number. */ __MATHDECL_1(int, __isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); #if defined __USE_MISC || defined __USE_XOPEN # if (!defined __cplusplus \ || __cplusplus < 201103L /* isnan conflicts with C++11. */ \ || __MATH_DECLARING_DOUBLE == 0) /* isnanf or isnanl don't. */ /* Return nonzero if VALUE is not a number. */ __MATHDECL_1(int, isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); # endif /* Bessel functions. */ __MATHCALL(j0,, (_Mdouble_)); __MATHCALL(j1,, (_Mdouble_)); __MATHCALL(jn,, (int, _Mdouble_)); __MATHCALL(y0,, (_Mdouble_)); __MATHCALL(y1,, (_Mdouble_)); __MATHCALL(yn,, (int, _Mdouble_)); #endif #if defined __USE_XOPEN || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Error and gamma functions. */ __MATHCALL(erf,, (_Mdouble_)); __MATHCALL(erfc,, (_Mdouble_)); __MATHCALL(lgamma,, (_Mdouble_)); __END_NAMESPACE_C99 #endif #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* True gamma function. */ __MATHCALL(tgamma,, (_Mdouble_)); __END_NAMESPACE_C99 #endif #if defined __USE_MISC || defined __USE_XOPEN /* Obsolete alias for `lgamma'. */ __MATHCALL(gamma,, (_Mdouble_)); #endif #ifdef __USE_MISC /* Reentrant version of lgamma. This function uses the global variable `signgam'. The reentrant version instead takes a pointer and stores the value through it. */ __MATHCALL(lgamma, _r, (_Mdouble_, int *__signgamp)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return the integer nearest X in the direction of the prevailing rounding mode. */ __MATHCALL(rint,, (_Mdouble_ __x)); /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ __MATHCALLX(nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); # if defined __USE_ISOC99 && !defined __LDBL_COMPAT __MATHCALLX(nexttoward,, (_Mdouble_ __x, long double __y), (__const__)); # endif /* Return the remainder of integer divison X / Y with infinite precision. */ __MATHCALL(remainder,, (_Mdouble_ __x, _Mdouble_ __y)); # ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL(scalbn,, (_Mdouble_ __x, int __n)); # endif /* Return the binary exponent of X, which must be nonzero. */ __MATHDECL(int, ilogb,, (_Mdouble_ __x)); #endif #ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL(scalbln,, (_Mdouble_ __x, long int __n)); /* Round X to integral value in floating-point format using current rounding direction, but do not raise inexact exception. */ __MATHCALL(nearbyint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHCALLX(round,, (_Mdouble_ __x), (__const__)); /* Round X to the integral value in floating-point format nearest but not larger in magnitude. */ __MATHCALLX(trunc,, (_Mdouble_ __x), (__const__)); /* Compute remainder of X and Y and put in *QUO a value with sign of x/y and magnitude congruent `mod 2^n' to the magnitude of the integral quotient x/y, with n >= 3. */ __MATHCALL(remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo)); /* Conversion functions. */ /* Round X to nearest integral value according to current rounding direction. */ __MATHDECL(long int, lrint,, (_Mdouble_ __x)); __extension__ __MATHDECL(long long int, llrint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHDECL(long int, lround,, (_Mdouble_ __x)); __extension__ __MATHDECL(long long int, llround,, (_Mdouble_ __x)); /* Return positive difference between X and Y. */ __MATHCALL(fdim,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return maximum numeric value from X and Y. */ __MATHCALLX(fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Return minimum numeric value from X and Y. */ __MATHCALLX(fmin,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Classify given number. */ __MATHDECL_1(int, __fpclassify,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Test for negative number. */ __MATHDECL_1(int, __signbit,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Multiply-add function computed as a ternary operation. */ __MATHCALL(fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); #endif /* Use ISO C99. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __END_NAMESPACE_C99 #endif #ifdef __USE_GNU /* Test for signaling NaN. */ __MATHDECL_1(int, __issignaling,, (_Mdouble_ __value)) __attribute__ ((__const__)); #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Return X times (2 to the Nth power). */ __MATHCALL(scalb,, (_Mdouble_ __x, _Mdouble_ __n)); #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/mathdef.h ================================================ /* Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _MATH_H && !defined _COMPLEX_H # error "Never use directly; include instead" #endif #if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF # define _MATH_H_MATHDEF 1 # if defined __x86_64__ || (defined __FLT_EVAL_METHOD__ && __FLT_EVAL_METHOD__ == 0) /* The x86-64 architecture computes values with the precission of the used type. Similarly for -m32 -mfpmath=sse. */ typedef float float_t; /* `float' expressions are evaluated as `float'. */ typedef double double_t; /* `double' expressions are evaluated as `double'. */ # else /* The ix87 FPUs evaluate all values in the 80 bit floating-point format which is also available for the user as `long double'. Therefore we define: */ typedef long double float_t; /* `float' expressions are evaluated as `long double'. */ typedef long double double_t; /* `double' expressions are evaluated as `long double'. */ # endif /* The values returned by `ilogb' for 0 and NaN respectively. */ # define FP_ILOGB0 (-2147483647 - 1) # define FP_ILOGBNAN (-2147483647 - 1) /* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l} builtins are supported. */ # ifdef __FP_FAST_FMA # define FP_FAST_FMA 1 # endif # ifdef __FP_FAST_FMAF # define FP_FAST_FMAF 1 # endif # ifdef __FP_FAST_FMAL # define FP_FAST_FMAL 1 # endif #endif /* ISO C99 */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/mman-linux.h ================================================ /* Definitions for POSIX memory map interface. Linux generic version. Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_MMAN_H # error "Never use directly; include instead." #endif /* The following definitions basically come from the kernel headers. But the kernel header is not namespace clean. This file is also used by some non-Linux configurations of the GNU C Library, for other systems that use these same bit values. */ /* Protections are chosen from these bits, OR'd together. The implementation does not necessarily support PROT_EXEC or PROT_WRITE without PROT_READ. The only guarantees are that no writing will be allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ #define PROT_READ 0x1 /* Page can be read. */ #define PROT_WRITE 0x2 /* Page can be written. */ #define PROT_EXEC 0x4 /* Page can be executed. */ #define PROT_NONE 0x0 /* Page can not be accessed. */ #define PROT_GROWSDOWN 0x01000000 /* Extend change to start of growsdown vma (mprotect only). */ #define PROT_GROWSUP 0x02000000 /* Extend change to start of growsup vma (mprotect only). */ /* Sharing types (must choose one and only one of these). */ #define MAP_SHARED 0x01 /* Share changes. */ #define MAP_PRIVATE 0x02 /* Changes are private. */ #ifdef __USE_MISC # define MAP_TYPE 0x0f /* Mask for type of mapping. */ #endif /* Other flags. */ #define MAP_FIXED 0x10 /* Interpret addr exactly. */ #ifdef __USE_MISC # define MAP_FILE 0 # ifdef __MAP_ANONYMOUS # define MAP_ANONYMOUS __MAP_ANONYMOUS /* Don't use a file. */ # else # define MAP_ANONYMOUS 0x20 /* Don't use a file. */ # endif # define MAP_ANON MAP_ANONYMOUS /* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */ # define MAP_HUGE_SHIFT 26 # define MAP_HUGE_MASK 0x3f #endif /* Flags to `msync'. */ #define MS_ASYNC 1 /* Sync memory asynchronously. */ #define MS_SYNC 4 /* Synchronous memory sync. */ #define MS_INVALIDATE 2 /* Invalidate the caches. */ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 # define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ #ifdef __USE_MISC # define MADV_NORMAL 0 /* No further special treatment. */ # define MADV_RANDOM 1 /* Expect random page references. */ # define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define MADV_WILLNEED 3 /* Will need these pages. */ # define MADV_DONTNEED 4 /* Don't need these pages. */ # define MADV_REMOVE 9 /* Remove these pages and resources. */ # define MADV_DONTFORK 10 /* Do not inherit across fork. */ # define MADV_DOFORK 11 /* Do inherit across fork. */ # define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ # define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ # define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */ # define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */ # define MADV_DONTDUMP 16 /* Explicity exclude from the core dump, overrides the coredump filter bits. */ # define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */ # define MADV_HWPOISON 100 /* Poison a page for testing. */ #endif /* The POSIX people had to invent similar names for the same things. */ #ifdef __USE_XOPEN2K # define POSIX_MADV_NORMAL 0 /* No further special treatment. */ # define POSIX_MADV_RANDOM 1 /* Expect random page references. */ # define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ # define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ #endif /* Flags for `mlockall'. */ #ifndef MCL_CURRENT # define MCL_CURRENT 1 /* Lock all currently mapped pages. */ # define MCL_FUTURE 2 /* Lock all additions to address space. */ #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/mman.h ================================================ /* Definitions for POSIX memory map interface. Linux/x86_64 version. Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_MMAN_H # error "Never use directly; include instead." #endif /* The following definitions basically come from the kernel headers. But the kernel header is not namespace clean. */ /* Other flags. */ #ifdef __USE_MISC # define MAP_32BIT 0x40 /* Only give out 32-bit addresses. */ #endif /* These are Linux-specific. */ #ifdef __USE_MISC # define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */ # define MAP_DENYWRITE 0x00800 /* ETXTBSY */ # define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */ # define MAP_LOCKED 0x02000 /* Lock the mapping. */ # define MAP_NORESERVE 0x04000 /* Don't check for reservations. */ # define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */ # define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ # define MAP_STACK 0x20000 /* Allocation is for a stack. */ # define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ #endif /* Include generic Linux declarations. */ #include ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/nan.h ================================================ /* `NAN' constant for IEEE 754 machines. Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif /* IEEE Not A Number. */ #if __GNUC_PREREQ(3,3) # define NAN (__builtin_nanf ("")) #elif defined __GNUC__ # define NAN \ (__extension__ \ ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; }) \ { __l: 0x7fc00000UL }).__d) #else # include # if __BYTE_ORDER == __BIG_ENDIAN # define __qnan_bytes { 0x7f, 0xc0, 0, 0 } # endif # if __BYTE_ORDER == __LITTLE_ENDIAN # define __qnan_bytes { 0, 0, 0xc0, 0x7f } # endif static union { unsigned char __c[4]; float __d; } __qnan_union __attribute__ ((__unused__)) = { __qnan_bytes}; # define NAN (__qnan_union.__d) #endif /* GCC. */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/netdb.h ================================================ /* Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _NETDB_H # error "Never include directly; use instead." #endif /* Description of data base entry for a single network. NOTE: here a poor assumption is made. The network number is expected to fit into an unsigned long int variable. */ struct netent { char *n_name; /* Official name of network. */ char **n_aliases; /* Alias list. */ int n_addrtype; /* Net address type. */ uint32_t n_net; /* Network number. */ }; ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/param.h ================================================ /* Old-style Unix parameters and limits. Linux version. Copyright (C) 1995-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_PARAM_H # error "Never use directly; include instead." #endif #ifndef ARG_MAX # define __undef_ARG_MAX #endif #include #include /* The kernel headers define ARG_MAX. The value is wrong, though. */ #ifdef __undef_ARG_MAX # undef ARG_MAX # undef __undef_ARG_MAX #endif #define MAXSYMLINKS 20 /* The following are not really correct but it is a value we used for a long time and which seems to be usable. People should not use NOFILE and NCARGS anyway. */ #define NOFILE 256 #define NCARGS 131072 ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/posix1_lim.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 2.9.2 Minimum Values Added to * * Never include this file directly; use instead. */ #ifndef _BITS_POSIX1_LIM_H #define _BITS_POSIX1_LIM_H 1 /* These are the standard-mandated minimum values. */ /* Minimum number of operations in one list I/O call. */ #define _POSIX_AIO_LISTIO_MAX 2 /* Minimal number of outstanding asynchronous I/O operations. */ #define _POSIX_AIO_MAX 1 /* Maximum length of arguments to `execve', including environment. */ #define _POSIX_ARG_MAX 4096 /* Maximum simultaneous processes per real user ID. */ #ifdef __USE_XOPEN2K # define _POSIX_CHILD_MAX 25 #else # define _POSIX_CHILD_MAX 6 #endif /* Minimal number of timer expiration overruns. */ #define _POSIX_DELAYTIMER_MAX 32 /* Maximum length of a host name (not including the terminating null) as returned from the GETHOSTNAME function. */ #define _POSIX_HOST_NAME_MAX 255 /* Maximum link count of a file. */ #define _POSIX_LINK_MAX 8 /* Maximum length of login name. */ #define _POSIX_LOGIN_NAME_MAX 9 /* Number of bytes in a terminal canonical input queue. */ #define _POSIX_MAX_CANON 255 /* Number of bytes for which space will be available in a terminal input queue. */ #define _POSIX_MAX_INPUT 255 /* Maximum number of message queues open for a process. */ #define _POSIX_MQ_OPEN_MAX 8 /* Maximum number of supported message priorities. */ #define _POSIX_MQ_PRIO_MAX 32 /* Number of bytes in a filename. */ #define _POSIX_NAME_MAX 14 /* Number of simultaneous supplementary group IDs per process. */ #ifdef __USE_XOPEN2K # define _POSIX_NGROUPS_MAX 8 #else # define _POSIX_NGROUPS_MAX 0 #endif /* Number of files one process can have open at once. */ #ifdef __USE_XOPEN2K # define _POSIX_OPEN_MAX 20 #else # define _POSIX_OPEN_MAX 16 #endif #if !defined __USE_XOPEN2K || defined __USE_GNU /* Number of descriptors that a process may examine with `pselect' or `select'. */ # define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX #endif /* Number of bytes in a pathname. */ #define _POSIX_PATH_MAX 256 /* Number of bytes than can be written atomically to a pipe. */ #define _POSIX_PIPE_BUF 512 /* The number of repeated occurrences of a BRE permitted by the REGEXEC and REGCOMP functions when using the interval notation. */ #define _POSIX_RE_DUP_MAX 255 /* Minimal number of realtime signals reserved for the application. */ #define _POSIX_RTSIG_MAX 8 /* Number of semaphores a process can have. */ #define _POSIX_SEM_NSEMS_MAX 256 /* Maximal value of a semaphore. */ #define _POSIX_SEM_VALUE_MAX 32767 /* Number of pending realtime signals. */ #define _POSIX_SIGQUEUE_MAX 32 /* Largest value of a `ssize_t'. */ #define _POSIX_SSIZE_MAX 32767 /* Number of streams a process can have open at once. */ #define _POSIX_STREAM_MAX 8 /* The number of bytes in a symbolic link. */ #define _POSIX_SYMLINK_MAX 255 /* The number of symbolic links that can be traversed in the resolution of a pathname in the absence of a loop. */ #define _POSIX_SYMLOOP_MAX 8 /* Number of timer for a process. */ #define _POSIX_TIMER_MAX 32 /* Maximum number of characters in a tty name. */ #define _POSIX_TTY_NAME_MAX 9 /* Maximum length of a timezone name (element of `tzname'). */ #ifdef __USE_XOPEN2K # define _POSIX_TZNAME_MAX 6 #else # define _POSIX_TZNAME_MAX 3 #endif #if !defined __USE_XOPEN2K || defined __USE_GNU /* Maximum number of connections that can be queued on a socket. */ # define _POSIX_QLIMIT 1 /* Maximum number of bytes that can be buffered on a socket for send or receive. */ # define _POSIX_HIWAT _POSIX_PIPE_BUF /* Maximum number of elements in an `iovec' array. */ # define _POSIX_UIO_MAXIOV 16 #endif /* Maximum clock resolution in nanoseconds. */ #define _POSIX_CLOCKRES_MIN 20000000 /* Get the implementation-specific values for the above. */ #include #ifndef SSIZE_MAX # define SSIZE_MAX LONG_MAX #endif /* This value is a guaranteed minimum maximum. The current maximum can be got from `sysconf'. */ #ifndef NGROUPS_MAX # define NGROUPS_MAX 8 #endif #endif /* bits/posix1_lim.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/posix2_lim.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; include instead. */ #ifndef _BITS_POSIX2_LIM_H #define _BITS_POSIX2_LIM_H 1 /* The maximum `ibase' and `obase' values allowed by the `bc' utility. */ #define _POSIX2_BC_BASE_MAX 99 /* The maximum number of elements allowed in an array by the `bc' utility. */ #define _POSIX2_BC_DIM_MAX 2048 /* The maximum `scale' value allowed by the `bc' utility. */ #define _POSIX2_BC_SCALE_MAX 99 /* The maximum length of a string constant accepted by the `bc' utility. */ #define _POSIX2_BC_STRING_MAX 1000 /* The maximum number of weights that can be assigned to an entry of the LC_COLLATE `order' keyword in the locale definition file. */ #define _POSIX2_COLL_WEIGHTS_MAX 2 /* The maximum number of expressions that can be nested within parentheses by the `expr' utility. */ #define _POSIX2_EXPR_NEST_MAX 32 /* The maximum length, in bytes, of an input line. */ #define _POSIX2_LINE_MAX 2048 /* The maximum number of repeated occurrences of a regular expression permitted when using the interval notation `\{M,N\}'. */ #define _POSIX2_RE_DUP_MAX 255 /* The maximum number of bytes in a character class name. We have no fixed limit, 2048 is a high number. */ #define _POSIX2_CHARCLASS_NAME_MAX 14 /* These values are implementation-specific, and may vary within the implementation. Their precise values can be obtained from sysconf. */ #ifndef BC_BASE_MAX #define BC_BASE_MAX _POSIX2_BC_BASE_MAX #endif #ifndef BC_DIM_MAX #define BC_DIM_MAX _POSIX2_BC_DIM_MAX #endif #ifndef BC_SCALE_MAX #define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX #endif #ifndef BC_STRING_MAX #define BC_STRING_MAX _POSIX2_BC_STRING_MAX #endif #ifndef COLL_WEIGHTS_MAX #define COLL_WEIGHTS_MAX 255 #endif #ifndef EXPR_NEST_MAX #define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX #endif #ifndef LINE_MAX #define LINE_MAX _POSIX2_LINE_MAX #endif #ifndef CHARCLASS_NAME_MAX #define CHARCLASS_NAME_MAX 2048 #endif /* This value is defined like this in regex.h. */ #define RE_DUP_MAX (0x7fff) #endif /* bits/posix2_lim.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/posix_opt.h ================================================ /* Define POSIX options for Linux. Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see . */ #ifndef _BITS_POSIX_OPT_H #define _BITS_POSIX_OPT_H 1 /* Job control is supported. */ #define _POSIX_JOB_CONTROL 1 /* Processes have a saved set-user-ID and a saved set-group-ID. */ #define _POSIX_SAVED_IDS 1 /* Priority scheduling is supported. */ #define _POSIX_PRIORITY_SCHEDULING 200809L /* Synchronizing file data is supported. */ #define _POSIX_SYNCHRONIZED_IO 200809L /* The fsync function is present. */ #define _POSIX_FSYNC 200809L /* Mapping of files to memory is supported. */ #define _POSIX_MAPPED_FILES 200809L /* Locking of all memory is supported. */ #define _POSIX_MEMLOCK 200809L /* Locking of ranges of memory is supported. */ #define _POSIX_MEMLOCK_RANGE 200809L /* Setting of memory protections is supported. */ #define _POSIX_MEMORY_PROTECTION 200809L /* Some filesystems allow all users to change file ownership. */ #define _POSIX_CHOWN_RESTRICTED 0 /* `c_cc' member of 'struct termios' structure can be disabled by using the value _POSIX_VDISABLE. */ #define _POSIX_VDISABLE '\0' /* Filenames are not silently truncated. */ #define _POSIX_NO_TRUNC 1 /* X/Open realtime support is available. */ #define _XOPEN_REALTIME 1 /* X/Open thread realtime support is available. */ #define _XOPEN_REALTIME_THREADS 1 /* XPG4.2 shared memory is supported. */ #define _XOPEN_SHM 1 /* Tell we have POSIX threads. */ #define _POSIX_THREADS 200809L /* We have the reentrant functions described in POSIX. */ #define _POSIX_REENTRANT_FUNCTIONS 1 #define _POSIX_THREAD_SAFE_FUNCTIONS 200809L /* We provide priority scheduling for threads. */ #define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L /* We support user-defined stack sizes. */ #define _POSIX_THREAD_ATTR_STACKSIZE 200809L /* We support user-defined stacks. */ #define _POSIX_THREAD_ATTR_STACKADDR 200809L /* We support priority inheritence. */ #define _POSIX_THREAD_PRIO_INHERIT 200809L /* We support priority protection, though only for non-robust mutexes. */ #define _POSIX_THREAD_PRIO_PROTECT 200809L #ifdef __USE_XOPEN2K8 /* We support priority inheritence for robust mutexes. */ # define _POSIX_THREAD_ROBUST_PRIO_INHERIT 200809L /* We do not support priority protection for robust mutexes. */ # define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1 #endif /* We support POSIX.1b semaphores. */ #define _POSIX_SEMAPHORES 200809L /* Real-time signals are supported. */ #define _POSIX_REALTIME_SIGNALS 200809L /* We support asynchronous I/O. */ #define _POSIX_ASYNCHRONOUS_IO 200809L #define _POSIX_ASYNC_IO 1 /* Alternative name for Unix98. */ #define _LFS_ASYNCHRONOUS_IO 1 /* Support for prioritization is also available. */ #define _POSIX_PRIORITIZED_IO 200809L /* The LFS support in asynchronous I/O is also available. */ #define _LFS64_ASYNCHRONOUS_IO 1 /* The rest of the LFS is also available. */ #define _LFS_LARGEFILE 1 #define _LFS64_LARGEFILE 1 #define _LFS64_STDIO 1 /* POSIX shared memory objects are implemented. */ #define _POSIX_SHARED_MEMORY_OBJECTS 200809L /* CPU-time clocks support needs to be checked at runtime. */ #define _POSIX_CPUTIME 0 /* Clock support in threads must be also checked at runtime. */ #define _POSIX_THREAD_CPUTIME 0 /* GNU libc provides regular expression handling. */ #define _POSIX_REGEXP 1 /* Reader/Writer locks are available. */ #define _POSIX_READER_WRITER_LOCKS 200809L /* We have a POSIX shell. */ #define _POSIX_SHELL 1 /* We support the Timeouts option. */ #define _POSIX_TIMEOUTS 200809L /* We support spinlocks. */ #define _POSIX_SPIN_LOCKS 200809L /* The `spawn' function family is supported. */ #define _POSIX_SPAWN 200809L /* We have POSIX timers. */ #define _POSIX_TIMERS 200809L /* The barrier functions are available. */ #define _POSIX_BARRIERS 200809L /* POSIX message queues are available. */ #define _POSIX_MESSAGE_PASSING 200809L /* Thread process-shared synchronization is supported. */ #define _POSIX_THREAD_PROCESS_SHARED 200809L /* The monotonic clock might be available. */ #define _POSIX_MONOTONIC_CLOCK 0 /* The clock selection interfaces are available. */ #define _POSIX_CLOCK_SELECTION 200809L /* Advisory information interfaces are available. */ #define _POSIX_ADVISORY_INFO 200809L /* IPv6 support is available. */ #define _POSIX_IPV6 200809L /* Raw socket support is available. */ #define _POSIX_RAW_SOCKETS 200809L /* We have at least one terminal. */ #define _POSIX2_CHAR_TERM 200809L /* Neither process nor thread sporadic server interfaces is available. */ #define _POSIX_SPORADIC_SERVER -1 #define _POSIX_THREAD_SPORADIC_SERVER -1 /* trace.h is not available. */ #define _POSIX_TRACE -1 #define _POSIX_TRACE_EVENT_FILTER -1 #define _POSIX_TRACE_INHERIT -1 #define _POSIX_TRACE_LOG -1 /* Typed memory objects are not available. */ #define _POSIX_TYPED_MEMORY_OBJECTS -1 #endif /* bits/posix_opt.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/pthreadtypes.h ================================================ /* Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_PTHREADTYPES_H #define _BITS_PTHREADTYPES_H 1 #include #ifdef __x86_64__ # if __WORDSIZE == 64 # define __SIZEOF_PTHREAD_ATTR_T 56 # define __SIZEOF_PTHREAD_MUTEX_T 40 # define __SIZEOF_PTHREAD_MUTEXATTR_T 4 # define __SIZEOF_PTHREAD_COND_T 48 # define __SIZEOF_PTHREAD_CONDATTR_T 4 # define __SIZEOF_PTHREAD_RWLOCK_T 56 # define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 # define __SIZEOF_PTHREAD_BARRIER_T 32 # define __SIZEOF_PTHREAD_BARRIERATTR_T 4 # else # define __SIZEOF_PTHREAD_ATTR_T 32 # define __SIZEOF_PTHREAD_MUTEX_T 32 # define __SIZEOF_PTHREAD_MUTEXATTR_T 4 # define __SIZEOF_PTHREAD_COND_T 48 # define __SIZEOF_PTHREAD_CONDATTR_T 4 # define __SIZEOF_PTHREAD_RWLOCK_T 44 # define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 # define __SIZEOF_PTHREAD_BARRIER_T 20 # define __SIZEOF_PTHREAD_BARRIERATTR_T 4 # endif #else # define __SIZEOF_PTHREAD_ATTR_T 36 # define __SIZEOF_PTHREAD_MUTEX_T 24 # define __SIZEOF_PTHREAD_MUTEXATTR_T 4 # define __SIZEOF_PTHREAD_COND_T 48 # define __SIZEOF_PTHREAD_CONDATTR_T 4 # define __SIZEOF_PTHREAD_RWLOCK_T 32 # define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 # define __SIZEOF_PTHREAD_BARRIER_T 20 # define __SIZEOF_PTHREAD_BARRIERATTR_T 4 #endif /* Thread identifiers. The structure of the attribute type is not exposed on purpose. */ typedef unsigned long int pthread_t; union pthread_attr_t { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; }; #ifndef __have_pthread_attr_t typedef union pthread_attr_t pthread_attr_t; # define __have_pthread_attr_t 1 #endif #ifdef __x86_64__ typedef struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __pthread_list_t; #else typedef struct __pthread_internal_slist { struct __pthread_internal_slist *__next; } __pthread_slist_t; #endif /* Data structures for mutex handling. The structure of the attribute type is not exposed on purpose. */ typedef union { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; #ifdef __x86_64__ unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain binary compatibility. */ int __kind; #ifdef __x86_64__ short __spins; short __elision; __pthread_list_t __list; # define __PTHREAD_MUTEX_HAVE_PREV 1 /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ # define __PTHREAD_SPINS 0, 0 #else unsigned int __nusers; __extension__ union { struct { short __espins; short __elision; # define __spins __elision_data.__espins # define __elision __elision_data.__elision # define __PTHREAD_SPINS { 0, 0 } } __elision_data; __pthread_slist_t __list; }; #endif } __data; char __size[__SIZEOF_PTHREAD_MUTEX_T]; long int __align; } pthread_mutex_t; typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; int __align; } pthread_mutexattr_t; /* Data structure for conditional variable handling. The structure of the attribute type is not exposed on purpose. */ typedef union { struct { int __lock; unsigned int __futex; __extension__ unsigned long long int __total_seq; __extension__ unsigned long long int __wakeup_seq; __extension__ unsigned long long int __woken_seq; void *__mutex; unsigned int __nwaiters; unsigned int __broadcast_seq; } __data; char __size[__SIZEOF_PTHREAD_COND_T]; __extension__ long long int __align; } pthread_cond_t; typedef union { char __size[__SIZEOF_PTHREAD_CONDATTR_T]; int __align; } pthread_condattr_t; /* Keys for thread-specific data */ typedef unsigned int pthread_key_t; /* Once-only execution */ typedef int pthread_once_t; #if defined __USE_UNIX98 || defined __USE_XOPEN2K /* Data structure for read-write lock variable handling. The structure of the attribute type is not exposed on purpose. */ typedef union { # ifdef __x86_64__ struct { int __lock; unsigned int __nr_readers; unsigned int __readers_wakeup; unsigned int __writer_wakeup; unsigned int __nr_readers_queued; unsigned int __nr_writers_queued; int __writer; int __shared; signed char __rwelision; # ifdef __ILP32__ unsigned char __pad1[3]; # define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0 } # else unsigned char __pad1[7]; # define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0, 0, 0, 0, 0 } # endif unsigned long int __pad2; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned int __flags; # define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 } __data; # else struct { int __lock; unsigned int __nr_readers; unsigned int __readers_wakeup; unsigned int __writer_wakeup; unsigned int __nr_readers_queued; unsigned int __nr_writers_queued; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned char __flags; unsigned char __shared; signed char __rwelision; # define __PTHREAD_RWLOCK_ELISION_EXTRA 0 unsigned char __pad2; int __writer; } __data; # endif char __size[__SIZEOF_PTHREAD_RWLOCK_T]; long int __align; } pthread_rwlock_t; typedef union { char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; long int __align; } pthread_rwlockattr_t; #endif #ifdef __USE_XOPEN2K /* POSIX spinlock data type. */ typedef volatile int pthread_spinlock_t; /* POSIX barriers data type. The structure of the type is deliberately not exposed. */ typedef union { char __size[__SIZEOF_PTHREAD_BARRIER_T]; long int __align; } pthread_barrier_t; typedef union { char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; int __align; } pthread_barrierattr_t; #endif #ifndef __x86_64__ /* Extra attributes for the cleanup functions. */ # define __cleanup_fct_attribute __attribute__ ((__regparm__ (1))) #endif #endif /* bits/pthreadtypes.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/resource.h ================================================ /* Bit values & structures for resource limits. Linux version. Copyright (C) 1994-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_RESOURCE_H # error "Never use directly; include instead." #endif #include /* Transmute defines to enumerations. The macro re-definitions are necessary because some programs want to test for operating system features with #ifdef RUSAGE_SELF. In ISO C the reflexive definition is a no-op. */ /* Kinds of resource limit. */ enum __rlimit_resource { /* Per-process CPU limit, in seconds. */ RLIMIT_CPU = 0, #define RLIMIT_CPU RLIMIT_CPU /* Largest file that can be created, in bytes. */ RLIMIT_FSIZE = 1, #define RLIMIT_FSIZE RLIMIT_FSIZE /* Maximum size of data segment, in bytes. */ RLIMIT_DATA = 2, #define RLIMIT_DATA RLIMIT_DATA /* Maximum size of stack segment, in bytes. */ RLIMIT_STACK = 3, #define RLIMIT_STACK RLIMIT_STACK /* Largest core file that can be created, in bytes. */ RLIMIT_CORE = 4, #define RLIMIT_CORE RLIMIT_CORE /* Largest resident set size, in bytes. This affects swapping; processes that are exceeding their resident set size will be more likely to have physical memory taken from them. */ __RLIMIT_RSS = 5, #define RLIMIT_RSS __RLIMIT_RSS /* Number of open files. */ RLIMIT_NOFILE = 7, __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ #define RLIMIT_NOFILE RLIMIT_NOFILE #define RLIMIT_OFILE __RLIMIT_OFILE /* Address space limit. */ RLIMIT_AS = 9, #define RLIMIT_AS RLIMIT_AS /* Number of processes. */ __RLIMIT_NPROC = 6, #define RLIMIT_NPROC __RLIMIT_NPROC /* Locked-in-memory address space. */ __RLIMIT_MEMLOCK = 8, #define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK /* Maximum number of file locks. */ __RLIMIT_LOCKS = 10, #define RLIMIT_LOCKS __RLIMIT_LOCKS /* Maximum number of pending signals. */ __RLIMIT_SIGPENDING = 11, #define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING /* Maximum bytes in POSIX message queues. */ __RLIMIT_MSGQUEUE = 12, #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE /* Maximum nice priority allowed to raise to. Nice levels 19 .. -20 correspond to 0 .. 39 values of this resource limit. */ __RLIMIT_NICE = 13, #define RLIMIT_NICE __RLIMIT_NICE /* Maximum realtime priority allowed for non-priviledged processes. */ __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO /* Maximum CPU time in µs that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, #define RLIMIT_RTTIME __RLIMIT_RTTIME __RLIMIT_NLIMITS = 16, __RLIM_NLIMITS = __RLIMIT_NLIMITS #define RLIMIT_NLIMITS __RLIMIT_NLIMITS #define RLIM_NLIMITS __RLIM_NLIMITS }; /* Value to indicate that there is no limit. */ #ifndef __USE_FILE_OFFSET64 # define RLIM_INFINITY ((__rlim_t) -1) #else # define RLIM_INFINITY 0xffffffffffffffffuLL #endif #ifdef __USE_LARGEFILE64 # define RLIM64_INFINITY 0xffffffffffffffffuLL #endif /* We can represent all limits. */ #define RLIM_SAVED_MAX RLIM_INFINITY #define RLIM_SAVED_CUR RLIM_INFINITY /* Type for resource quantity measurement. */ #ifndef __USE_FILE_OFFSET64 typedef __rlim_t rlim_t; #else typedef __rlim64_t rlim_t; #endif #ifdef __USE_LARGEFILE64 typedef __rlim64_t rlim64_t; #endif struct rlimit { /* The current (soft) limit. */ rlim_t rlim_cur; /* The hard limit. */ rlim_t rlim_max; }; #ifdef __USE_LARGEFILE64 struct rlimit64 { /* The current (soft) limit. */ rlim64_t rlim_cur; /* The hard limit. */ rlim64_t rlim_max; }; #endif /* Whose usage statistics do you want? */ enum __rusage_who { /* The calling process. */ RUSAGE_SELF = 0, #define RUSAGE_SELF RUSAGE_SELF /* All of its terminated child processes. */ RUSAGE_CHILDREN = -1 #define RUSAGE_CHILDREN RUSAGE_CHILDREN #ifdef __USE_GNU , /* The calling thread. */ RUSAGE_THREAD = 1 # define RUSAGE_THREAD RUSAGE_THREAD /* Name for the same functionality on Solaris. */ # define RUSAGE_LWP RUSAGE_THREAD #endif }; #define __need_timeval #include /* For `struct timeval'. */ /* Structure which says how much of each resource has been used. */ /* The purpose of all the unions is to have the kernel-compatible layout while keeping the API type as 'long int', and among machines where __syscall_slong_t is not 'long int', this only does the right thing for little-endian ones, like x32. */ struct rusage { /* Total amount of user time used. */ struct timeval ru_utime; /* Total amount of system time used. */ struct timeval ru_stime; /* Maximum resident set size (in kilobytes). */ __extension__ union { long int ru_maxrss; __syscall_slong_t __ru_maxrss_word; }; /* Amount of sharing of text segment memory with other processes (kilobyte-seconds). */ /* Maximum resident set size (in kilobytes). */ __extension__ union { long int ru_ixrss; __syscall_slong_t __ru_ixrss_word; }; /* Amount of data segment memory used (kilobyte-seconds). */ __extension__ union { long int ru_idrss; __syscall_slong_t __ru_idrss_word; }; /* Amount of stack memory used (kilobyte-seconds). */ __extension__ union { long int ru_isrss; __syscall_slong_t __ru_isrss_word; }; /* Number of soft page faults (i.e. those serviced by reclaiming a page from the list of pages awaiting reallocation. */ __extension__ union { long int ru_minflt; __syscall_slong_t __ru_minflt_word; }; /* Number of hard page faults (i.e. those that required I/O). */ __extension__ union { long int ru_majflt; __syscall_slong_t __ru_majflt_word; }; /* Number of times a process was swapped out of physical memory. */ __extension__ union { long int ru_nswap; __syscall_slong_t __ru_nswap_word; }; /* Number of input operations via the file system. Note: This and `ru_oublock' do not include operations with the cache. */ __extension__ union { long int ru_inblock; __syscall_slong_t __ru_inblock_word; }; /* Number of output operations via the file system. */ __extension__ union { long int ru_oublock; __syscall_slong_t __ru_oublock_word; }; /* Number of IPC messages sent. */ __extension__ union { long int ru_msgsnd; __syscall_slong_t __ru_msgsnd_word; }; /* Number of IPC messages received. */ __extension__ union { long int ru_msgrcv; __syscall_slong_t __ru_msgrcv_word; }; /* Number of signals delivered. */ __extension__ union { long int ru_nsignals; __syscall_slong_t __ru_nsignals_word; }; /* Number of voluntary context switches, i.e. because the process gave up the process before it had to (usually to wait for some resource to be available). */ __extension__ union { long int ru_nvcsw; __syscall_slong_t __ru_nvcsw_word; }; /* Number of involuntary context switches, i.e. a higher priority process became runnable or the current process used up its time slice. */ __extension__ union { long int ru_nivcsw; __syscall_slong_t __ru_nivcsw_word; }; }; /* Priority limits. */ #define PRIO_MIN -20 /* Minimum priority a process can have. */ #define PRIO_MAX 20 /* Maximum priority a process can have. */ /* The type of the WHICH argument to `getpriority' and `setpriority', indicating what flavor of entity the WHO argument specifies. */ enum __priority_which { PRIO_PROCESS = 0, /* WHO is a process ID. */ #define PRIO_PROCESS PRIO_PROCESS PRIO_PGRP = 1, /* WHO is a process group ID. */ #define PRIO_PGRP PRIO_PGRP PRIO_USER = 2 /* WHO is a user ID. */ #define PRIO_USER PRIO_USER }; __BEGIN_DECLS #ifdef __USE_GNU /* Modify and return resource limits of a process atomically. */ # ifndef __USE_FILE_OFFSET64 extern int prlimit(__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit *__new_limit, struct rlimit *__old_limit) __THROW; # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(prlimit, (__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit * __new_limit, struct rlimit * __old_limit), prlimit64); # else # define prlimit prlimit64 # endif # endif # ifdef __USE_LARGEFILE64 extern int prlimit64(__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit64 *__new_limit, struct rlimit64 *__old_limit) __THROW; # endif #endif __END_DECLS ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/sched.h ================================================ /* Definitions of constants and data structure for POSIX 1003.1b-1993 scheduling interface. Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef __need_schedparam #ifndef _SCHED_H # error "Never include directly; use instead." #endif /* Scheduling algorithms. */ #define SCHED_OTHER 0 #define SCHED_FIFO 1 #define SCHED_RR 2 #ifdef __USE_GNU # define SCHED_BATCH 3 # define SCHED_IDLE 5 # define SCHED_RESET_ON_FORK 0x40000000 #endif #ifdef __USE_GNU /* Cloning flags. */ # define CSIGNAL 0x000000ff /* Signal mask to be sent at exit. */ # define CLONE_VM 0x00000100 /* Set if VM shared between processes. */ # define CLONE_FS 0x00000200 /* Set if fs info shared between processes. */ # define CLONE_FILES 0x00000400 /* Set if open files shared between processes. */ # define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared. */ # define CLONE_PTRACE 0x00002000 /* Set if tracing continues on the child. */ # define CLONE_VFORK 0x00004000 /* Set if the parent wants the child to wake it up on mm_release. */ # define CLONE_PARENT 0x00008000 /* Set if we want to have the same parent as the cloner. */ # define CLONE_THREAD 0x00010000 /* Set to add to same thread group. */ # define CLONE_NEWNS 0x00020000 /* Set to create new namespace. */ # define CLONE_SYSVSEM 0x00040000 /* Set to shared SVID SEM_UNDO semantics. */ # define CLONE_SETTLS 0x00080000 /* Set TLS info. */ # define CLONE_PARENT_SETTID 0x00100000 /* Store TID in userlevel buffer before MM copy. */ # define CLONE_CHILD_CLEARTID 0x00200000 /* Register exit futex and memory location to clear. */ # define CLONE_DETACHED 0x00400000 /* Create clone detached. */ # define CLONE_UNTRACED 0x00800000 /* Set if the tracing process can't force CLONE_PTRACE on this clone. */ # define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in the child. */ # define CLONE_NEWUTS 0x04000000 /* New utsname group. */ # define CLONE_NEWIPC 0x08000000 /* New ipcs. */ # define CLONE_NEWUSER 0x10000000 /* New user namespace. */ # define CLONE_NEWPID 0x20000000 /* New pid namespace. */ # define CLONE_NEWNET 0x40000000 /* New network namespace. */ # define CLONE_IO 0x80000000 /* Clone I/O context. */ #endif /* The official definition. */ struct sched_param { int __sched_priority; }; __BEGIN_DECLS #ifdef __USE_GNU /* Clone current process. */ extern int clone(int (*__fn) (void *__arg), void *__child_stack, int __flags, void *__arg, ...) __THROW; /* Unshare the specified resources. */ extern int unshare(int __flags) __THROW; /* Get index of currently used CPU. */ extern int sched_getcpu(void) __THROW; /* Switch process to namespace of type NSTYPE indicated by FD. */ extern int setns(int __fd, int __nstype) __THROW; #endif __END_DECLS #endif /* need schedparam */ #if !defined __defined_schedparam \ && (defined __need_schedparam || defined _SCHED_H) # define __defined_schedparam 1 /* Data structure to describe a process' schedulability. */ struct __sched_param { int __sched_priority; }; # undef __need_schedparam #endif #if defined _SCHED_H && !defined __cpu_set_t_defined # define __cpu_set_t_defined /* Size definition for CPU sets. */ # define __CPU_SETSIZE 4096 # define __NCPUBITS (8 * sizeof (__cpu_mask)) /* Type for array elements in 'cpu_set_t'. */ typedef unsigned long int __cpu_mask; /* Basic access functions. */ # define __CPUELT(cpu) ((cpu) / __NCPUBITS) # define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) /* Data structure to describe CPU mask. */ typedef struct { __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS]; } cpu_set_t; /* Access functions for CPU masks. */ # if __GNUC_PREREQ (2, 91) # define __CPU_ZERO_S(setsize, cpusetp) \ do __builtin_memset (cpusetp, '\0', setsize); while (0) # else # define __CPU_ZERO_S(setsize, cpusetp) \ do { \ size_t __i; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ __cpu_mask *__bits = (cpusetp)->__bits; \ for (__i = 0; __i < __imax; ++__i) \ __bits[__i] = 0; \ } while (0) # endif # define __CPU_SET_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ |= __CPUMASK (__cpu)) \ : 0; })) # define __CPU_CLR_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ &= ~__CPUMASK (__cpu)) \ : 0; })) # define __CPU_ISSET_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? ((((const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ & __CPUMASK (__cpu))) != 0 \ : 0; })) # define __CPU_COUNT_S(setsize, cpusetp) \ __sched_cpucount (setsize, cpusetp) # if __GNUC_PREREQ (2, 91) # define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ (__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0) # else # define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ (__extension__ \ ({ const __cpu_mask *__arr1 = (cpusetp1)->__bits; \ const __cpu_mask *__arr2 = (cpusetp2)->__bits; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ size_t __i; \ for (__i = 0; __i < __imax; ++__i) \ if (__arr1[__i] != __arr2[__i]) \ break; \ __i == __imax; })) # endif # define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \ (__extension__ \ ({ cpu_set_t *__dest = (destset); \ const __cpu_mask *__arr1 = (srcset1)->__bits; \ const __cpu_mask *__arr2 = (srcset2)->__bits; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ size_t __i; \ for (__i = 0; __i < __imax; ++__i) \ ((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i]; \ __dest; })) # define __CPU_ALLOC_SIZE(count) \ ((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask)) # define __CPU_ALLOC(count) __sched_cpualloc (count) # define __CPU_FREE(cpuset) __sched_cpufree (cpuset) __BEGIN_DECLS extern int __sched_cpucount(size_t __setsize, const cpu_set_t * __setp) __THROW; extern cpu_set_t *__sched_cpualloc(size_t __count) __THROW __wur; extern void __sched_cpufree(cpu_set_t * __set) __THROW; __END_DECLS #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/select.h ================================================ /* Copyright (C) 1997-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SELECT_H # error "Never use directly; include instead." #endif #include #if defined __GNUC__ && __GNUC__ >= 2 # if __WORDSIZE == 64 # define __FD_ZERO_STOS "stosq" # else # define __FD_ZERO_STOS "stosl" # endif # define __FD_ZERO(fdsp) \ do { \ int __d0, __d1; \ __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ : "=c" (__d0), "=D" (__d1) \ : "a" (0), "0" (sizeof (fd_set) \ / sizeof (__fd_mask)), \ "1" (&__FDS_BITS (fdsp)[0]) \ : "memory"); \ } while (0) #else /* ! GNU CC */ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ # define __FD_ZERO(set) \ do { \ unsigned int __i; \ fd_set *__arr = (set); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) #endif /* GNU CC */ #define __FD_SET(d, set) \ ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) #define __FD_CLR(d, set) \ ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) #define __FD_ISSET(d, set) \ ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/setjmp.h ================================================ /* Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* Define the machine-dependent type `jmp_buf'. x86-64 version. */ #ifndef _BITS_SETJMP_H #define _BITS_SETJMP_H 1 #if !defined _SETJMP_H && !defined _PTHREAD_H # error "Never include directly; use instead." #endif #include #ifndef _ASM # if __WORDSIZE == 64 typedef long int __jmp_buf[8]; # elif defined __x86_64__ __extension__ typedef long long int __jmp_buf[8]; # else typedef int __jmp_buf[6]; # endif #endif #endif /* bits/setjmp.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/sigaction.h ================================================ /* The proper definitions for Linux's sigaction. Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SIGNAL_H # error "Never include directly; use instead." #endif /* Structure describing the action to be taken when a signal arrives. */ struct sigaction { /* Signal handler. */ #ifdef __USE_POSIX199309 union { /* Used if SA_SIGINFO is not set. */ __sighandler_t sa_handler; /* Used if SA_SIGINFO is set. */ void (*sa_sigaction) (int, siginfo_t *, void *); } __sigaction_handler; # define sa_handler __sigaction_handler.sa_handler # define sa_sigaction __sigaction_handler.sa_sigaction #else __sighandler_t sa_handler; #endif /* Additional set of signals to be blocked. */ __sigset_t sa_mask; /* Special flags. */ int sa_flags; /* Restore handler. */ void (*sa_restorer) (void); }; /* Bits in `sa_flags'. */ #define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */ #define SA_NOCLDWAIT 2 /* Don't create zombie on child death. */ #define SA_SIGINFO 4 /* Invoke signal-catching function with three arguments instead of one. */ #if defined __USE_UNIX98 || defined __USE_MISC # define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 # define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ # define SA_NODEFER 0x40000000 /* Don't automatically block the signal when its handler is being executed. */ # define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ #endif #ifdef __USE_MISC # define SA_INTERRUPT 0x20000000 /* Historical no-op. */ /* Some aliases for the SA_ constants. */ # define SA_NOMASK SA_NODEFER # define SA_ONESHOT SA_RESETHAND # define SA_STACK SA_ONSTACK #endif /* Values for the HOW argument to `sigprocmask'. */ #define SIG_BLOCK 0 /* Block signals. */ #define SIG_UNBLOCK 1 /* Unblock signals. */ #define SIG_SETMASK 2 /* Set the set of blocked signals. */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/sigcontext.h ================================================ /* Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_SIGCONTEXT_H #define _BITS_SIGCONTEXT_H 1 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H # error "Never use directly; include instead." #endif #define FP_XSTATE_MAGIC1 0x46505853U #define FP_XSTATE_MAGIC2 0x46505845U #define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2) struct _fpx_sw_bytes { __uint32_t magic1; __uint32_t extended_size; __uint64_t xstate_bv; __uint32_t xstate_size; __uint32_t padding[7]; }; struct _fpreg { unsigned short significand[4]; unsigned short exponent; }; struct _fpxreg { unsigned short significand[4]; unsigned short exponent; unsigned short padding[3]; }; struct _xmmreg { __uint32_t element[4]; }; #ifndef __x86_64__ struct _fpstate { /* Regular FPU environment. */ __uint32_t cw; __uint32_t sw; __uint32_t tag; __uint32_t ipoff; __uint32_t cssel; __uint32_t dataoff; __uint32_t datasel; struct _fpreg _st[8]; unsigned short status; unsigned short magic; /* FXSR FPU environment. */ __uint32_t _fxsr_env[6]; __uint32_t mxcsr; __uint32_t reserved; struct _fpxreg _fxsr_st[8]; struct _xmmreg _xmm[8]; __uint32_t padding[56]; }; #ifndef sigcontext_struct /* Kernel headers before 2.1.1 define a struct sigcontext_struct, but we need sigcontext. Some packages have come to rely on sigcontext_struct being defined on 32-bit x86, so define this for their benefit. */ # define sigcontext_struct sigcontext #endif #define X86_FXSR_MAGIC 0x0000 struct sigcontext { unsigned short gs, __gsh; unsigned short fs, __fsh; unsigned short es, __esh; unsigned short ds, __dsh; unsigned long edi; unsigned long esi; unsigned long ebp; unsigned long esp; unsigned long ebx; unsigned long edx; unsigned long ecx; unsigned long eax; unsigned long trapno; unsigned long err; unsigned long eip; unsigned short cs, __csh; unsigned long eflags; unsigned long esp_at_signal; unsigned short ss, __ssh; struct _fpstate *fpstate; unsigned long oldmask; unsigned long cr2; }; #else /* __x86_64__ */ struct _fpstate { /* FPU environment matching the 64-bit FXSAVE layout. */ __uint16_t cwd; __uint16_t swd; __uint16_t ftw; __uint16_t fop; __uint64_t rip; __uint64_t rdp; __uint32_t mxcsr; __uint32_t mxcr_mask; struct _fpxreg _st[8]; struct _xmmreg _xmm[16]; __uint32_t padding[24]; }; struct sigcontext { __uint64_t r8; __uint64_t r9; __uint64_t r10; __uint64_t r11; __uint64_t r12; __uint64_t r13; __uint64_t r14; __uint64_t r15; __uint64_t rdi; __uint64_t rsi; __uint64_t rbp; __uint64_t rbx; __uint64_t rdx; __uint64_t rax; __uint64_t rcx; __uint64_t rsp; __uint64_t rip; __uint64_t eflags; unsigned short cs; unsigned short gs; unsigned short fs; unsigned short __pad0; __uint64_t err; __uint64_t trapno; __uint64_t oldmask; __uint64_t cr2; __extension__ union { struct _fpstate *fpstate; __uint64_t __fpstate_word; }; __uint64_t __reserved1[8]; }; #endif /* __x86_64__ */ struct _xsave_hdr { __uint64_t xstate_bv; __uint64_t reserved1[2]; __uint64_t reserved2[5]; }; struct _ymmh_state { __uint32_t ymmh_space[64]; }; struct _xstate { struct _fpstate fpstate; struct _xsave_hdr xstate_hdr; struct _ymmh_state ymmh; }; #endif /* _BITS_SIGCONTEXT_H */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/siginfo.h ================================================ /* siginfo_t, sigevent and constants. Linux x86-64 version. Copyright (C) 2012-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SIGNAL_H && !defined __need_siginfo_t \ && !defined __need_sigevent_t # error "Never include this file directly. Use instead" #endif #include #if (!defined __have_sigval_t \ && (defined _SIGNAL_H || defined __need_siginfo_t \ || defined __need_sigevent_t)) # define __have_sigval_t 1 /* Type for data associated with a signal. */ typedef union sigval { int sival_int; void *sival_ptr; } sigval_t; #endif #if (!defined __have_siginfo_t \ && (defined _SIGNAL_H || defined __need_siginfo_t)) # define __have_siginfo_t 1 # define __SI_MAX_SIZE 128 # if __WORDSIZE == 64 # define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) # else # define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) # endif # if defined __x86_64__ && __WORDSIZE == 32 /* si_utime and si_stime must be 4 byte aligned for x32 to match the kernel. We align siginfo_t to 8 bytes so that si_utime and si_stime are actually aligned to 8 bytes since their offsets are multiple of 8 bytes. */ typedef __clock_t __attribute__ ((__aligned__(4))) __sigchld_clock_t; # define __SI_ALIGNMENT __attribute__ ((__aligned__ (8))) # else typedef __clock_t __sigchld_clock_t; # define __SI_ALIGNMENT # endif typedef struct { int si_signo; /* Signal number. */ int si_errno; /* If non-zero, an errno value associated with this signal, as defined in . */ int si_code; /* Signal code. */ union { int _pad[__SI_PAD_SIZE]; /* kill(). */ struct { __pid_t si_pid; /* Sending process ID. */ __uid_t si_uid; /* Real user ID of sending process. */ } _kill; /* POSIX.1b timers. */ struct { int si_tid; /* Timer ID. */ int si_overrun; /* Overrun count. */ sigval_t si_sigval; /* Signal value. */ } _timer; /* POSIX.1b signals. */ struct { __pid_t si_pid; /* Sending process ID. */ __uid_t si_uid; /* Real user ID of sending process. */ sigval_t si_sigval; /* Signal value. */ } _rt; /* SIGCHLD. */ struct { __pid_t si_pid; /* Which child. */ __uid_t si_uid; /* Real user ID of sending process. */ int si_status; /* Exit value or signal. */ __sigchld_clock_t si_utime; __sigchld_clock_t si_stime; } _sigchld; /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */ struct { void *si_addr; /* Faulting insn/memory ref. */ short int si_addr_lsb; /* Valid LSB of the reported address. */ struct { void *_lower; void *_upper; } si_addr_bnd; } _sigfault; /* SIGPOLL. */ struct { long int si_band; /* Band event for SIGPOLL. */ int si_fd; } _sigpoll; /* SIGSYS. */ struct { void *_call_addr; /* Calling user insn. */ int _syscall; /* Triggering system call number. */ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */ } _sigsys; } _sifields; } siginfo_t __SI_ALIGNMENT; /* X/Open requires some more fields with fixed names. */ # define si_pid _sifields._kill.si_pid # define si_uid _sifields._kill.si_uid # define si_timerid _sifields._timer.si_tid # define si_overrun _sifields._timer.si_overrun # define si_status _sifields._sigchld.si_status # define si_utime _sifields._sigchld.si_utime # define si_stime _sifields._sigchld.si_stime # define si_value _sifields._rt.si_sigval # define si_int _sifields._rt.si_sigval.sival_int # define si_ptr _sifields._rt.si_sigval.sival_ptr # define si_addr _sifields._sigfault.si_addr # define si_addr_lsb _sifields._sigfault.si_addr_lsb # define si_lower _sifields._sigfault.si_addr_bnd._lower # define si_upper _sifields._sigfault.si_addr_bnd._upper # define si_band _sifields._sigpoll.si_band # define si_fd _sifields._sigpoll.si_fd # define si_call_addr _sifields._sigsys._call_addr # define si_syscall _sifields._sigsys._syscall # define si_arch _sifields._sigsys._arch /* Values for `si_code'. Positive values are reserved for kernel-generated signals. */ enum { SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */ # define SI_ASYNCNL SI_ASYNCNL SI_TKILL = -6, /* Sent by tkill. */ # define SI_TKILL SI_TKILL SI_SIGIO, /* Sent by queued SIGIO. */ # define SI_SIGIO SI_SIGIO SI_ASYNCIO, /* Sent by AIO completion. */ # define SI_ASYNCIO SI_ASYNCIO SI_MESGQ, /* Sent by real time mesq state change. */ # define SI_MESGQ SI_MESGQ SI_TIMER, /* Sent by timer expiration. */ # define SI_TIMER SI_TIMER SI_QUEUE, /* Sent by sigqueue. */ # define SI_QUEUE SI_QUEUE SI_USER, /* Sent by kill, sigsend. */ # define SI_USER SI_USER SI_KERNEL = 0x80 /* Send by kernel. */ #define SI_KERNEL SI_KERNEL }; # if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* `si_code' values for SIGILL signal. */ enum { ILL_ILLOPC = 1, /* Illegal opcode. */ # define ILL_ILLOPC ILL_ILLOPC ILL_ILLOPN, /* Illegal operand. */ # define ILL_ILLOPN ILL_ILLOPN ILL_ILLADR, /* Illegal addressing mode. */ # define ILL_ILLADR ILL_ILLADR ILL_ILLTRP, /* Illegal trap. */ # define ILL_ILLTRP ILL_ILLTRP ILL_PRVOPC, /* Privileged opcode. */ # define ILL_PRVOPC ILL_PRVOPC ILL_PRVREG, /* Privileged register. */ # define ILL_PRVREG ILL_PRVREG ILL_COPROC, /* Coprocessor error. */ # define ILL_COPROC ILL_COPROC ILL_BADSTK /* Internal stack error. */ # define ILL_BADSTK ILL_BADSTK }; /* `si_code' values for SIGFPE signal. */ enum { FPE_INTDIV = 1, /* Integer divide by zero. */ # define FPE_INTDIV FPE_INTDIV FPE_INTOVF, /* Integer overflow. */ # define FPE_INTOVF FPE_INTOVF FPE_FLTDIV, /* Floating point divide by zero. */ # define FPE_FLTDIV FPE_FLTDIV FPE_FLTOVF, /* Floating point overflow. */ # define FPE_FLTOVF FPE_FLTOVF FPE_FLTUND, /* Floating point underflow. */ # define FPE_FLTUND FPE_FLTUND FPE_FLTRES, /* Floating point inexact result. */ # define FPE_FLTRES FPE_FLTRES FPE_FLTINV, /* Floating point invalid operation. */ # define FPE_FLTINV FPE_FLTINV FPE_FLTSUB /* Subscript out of range. */ # define FPE_FLTSUB FPE_FLTSUB }; /* `si_code' values for SIGSEGV signal. */ enum { SEGV_MAPERR = 1, /* Address not mapped to object. */ # define SEGV_MAPERR SEGV_MAPERR SEGV_ACCERR /* Invalid permissions for mapped object. */ # define SEGV_ACCERR SEGV_ACCERR }; /* `si_code' values for SIGBUS signal. */ enum { BUS_ADRALN = 1, /* Invalid address alignment. */ # define BUS_ADRALN BUS_ADRALN BUS_ADRERR, /* Non-existant physical address. */ # define BUS_ADRERR BUS_ADRERR BUS_OBJERR, /* Object specific hardware error. */ # define BUS_OBJERR BUS_OBJERR BUS_MCEERR_AR, /* Hardware memory error: action required. */ # define BUS_MCEERR_AR BUS_MCEERR_AR BUS_MCEERR_AO /* Hardware memory error: action optional. */ # define BUS_MCEERR_AO BUS_MCEERR_AO }; # endif # ifdef __USE_XOPEN_EXTENDED /* `si_code' values for SIGTRAP signal. */ enum { TRAP_BRKPT = 1, /* Process breakpoint. */ # define TRAP_BRKPT TRAP_BRKPT TRAP_TRACE /* Process trace trap. */ # define TRAP_TRACE TRAP_TRACE }; # endif # if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* `si_code' values for SIGCHLD signal. */ enum { CLD_EXITED = 1, /* Child has exited. */ # define CLD_EXITED CLD_EXITED CLD_KILLED, /* Child was killed. */ # define CLD_KILLED CLD_KILLED CLD_DUMPED, /* Child terminated abnormally. */ # define CLD_DUMPED CLD_DUMPED CLD_TRAPPED, /* Traced child has trapped. */ # define CLD_TRAPPED CLD_TRAPPED CLD_STOPPED, /* Child has stopped. */ # define CLD_STOPPED CLD_STOPPED CLD_CONTINUED /* Stopped child has continued. */ # define CLD_CONTINUED CLD_CONTINUED }; /* `si_code' values for SIGPOLL signal. */ enum { POLL_IN = 1, /* Data input available. */ # define POLL_IN POLL_IN POLL_OUT, /* Output buffers available. */ # define POLL_OUT POLL_OUT POLL_MSG, /* Input message available. */ # define POLL_MSG POLL_MSG POLL_ERR, /* I/O error. */ # define POLL_ERR POLL_ERR POLL_PRI, /* High priority input available. */ # define POLL_PRI POLL_PRI POLL_HUP /* Device disconnected. */ # define POLL_HUP POLL_HUP }; # endif # undef __need_siginfo_t #endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ #if (defined _SIGNAL_H || defined __need_sigevent_t) \ && !defined __have_sigevent_t # define __have_sigevent_t 1 /* Structure to transport application-defined values with signals. */ # define __SIGEV_MAX_SIZE 64 # if __WORDSIZE == 64 # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4) # else # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) # endif /* Forward declaration. */ # ifndef __have_pthread_attr_t typedef union pthread_attr_t pthread_attr_t; # define __have_pthread_attr_t 1 # endif typedef struct sigevent { sigval_t sigev_value; int sigev_signo; int sigev_notify; union { int _pad[__SIGEV_PAD_SIZE]; /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the thread to receive the signal. */ __pid_t _tid; struct { void (*_function) (sigval_t); /* Function to start. */ pthread_attr_t *_attribute; /* Thread attributes. */ } _sigev_thread; } _sigev_un; } sigevent_t; /* POSIX names to access some of the members. */ # define sigev_notify_function _sigev_un._sigev_thread._function # define sigev_notify_attributes _sigev_un._sigev_thread._attribute /* `sigev_notify' values. */ enum { SIGEV_SIGNAL = 0, /* Notify via signal. */ # define SIGEV_SIGNAL SIGEV_SIGNAL SIGEV_NONE, /* Other notification: meaningless. */ # define SIGEV_NONE SIGEV_NONE SIGEV_THREAD, /* Deliver via thread creation. */ # define SIGEV_THREAD SIGEV_THREAD SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */ #define SIGEV_THREAD_ID SIGEV_THREAD_ID }; #endif /* have _SIGNAL_H. */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/signum.h ================================================ /* Signal number definitions. Linux version. Copyright (C) 1995-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifdef _SIGNAL_H /* Fake signal functions. */ #define SIG_ERR ((__sighandler_t) -1) /* Error return. */ #define SIG_DFL ((__sighandler_t) 0) /* Default action. */ #define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ #ifdef __USE_UNIX98 # define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */ #endif /* Signals. */ #define SIGHUP 1 /* Hangup (POSIX). */ #define SIGINT 2 /* Interrupt (ANSI). */ #define SIGQUIT 3 /* Quit (POSIX). */ #define SIGILL 4 /* Illegal instruction (ANSI). */ #define SIGTRAP 5 /* Trace trap (POSIX). */ #define SIGABRT 6 /* Abort (ANSI). */ #define SIGIOT 6 /* IOT trap (4.2 BSD). */ #define SIGBUS 7 /* BUS error (4.2 BSD). */ #define SIGFPE 8 /* Floating-point exception (ANSI). */ #define SIGKILL 9 /* Kill, unblockable (POSIX). */ #define SIGUSR1 10 /* User-defined signal 1 (POSIX). */ #define SIGSEGV 11 /* Segmentation violation (ANSI). */ #define SIGUSR2 12 /* User-defined signal 2 (POSIX). */ #define SIGPIPE 13 /* Broken pipe (POSIX). */ #define SIGALRM 14 /* Alarm clock (POSIX). */ #define SIGTERM 15 /* Termination (ANSI). */ #define SIGSTKFLT 16 /* Stack fault. */ #define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ #define SIGCHLD 17 /* Child status has changed (POSIX). */ #define SIGCONT 18 /* Continue (POSIX). */ #define SIGSTOP 19 /* Stop, unblockable (POSIX). */ #define SIGTSTP 20 /* Keyboard stop (POSIX). */ #define SIGTTIN 21 /* Background read from tty (POSIX). */ #define SIGTTOU 22 /* Background write to tty (POSIX). */ #define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */ #define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */ #define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */ #define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */ #define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */ #define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ #define SIGPOLL SIGIO /* Pollable event occurred (System V). */ #define SIGIO 29 /* I/O now possible (4.2 BSD). */ #define SIGPWR 30 /* Power failure restart (System V). */ #define SIGSYS 31 /* Bad system call. */ #define SIGUNUSED 31 #define _NSIG 65 /* Biggest signal number + 1 (including real-time signals). */ #define SIGRTMIN (__libc_current_sigrtmin ()) #define SIGRTMAX (__libc_current_sigrtmax ()) /* These are the hard limits of the kernel. These values should not be used directly at user level. */ #define __SIGRTMIN 32 #define __SIGRTMAX (_NSIG - 1) #endif /* included. */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/sigset.h ================================================ /* __sig_atomic_t, __sigset_t, and related definitions. Linux version. Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SIGSET_H_types # define _SIGSET_H_types 1 typedef int __sig_atomic_t; /* A `sigset_t' has a bit for each signal. */ # define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) typedef struct { unsigned long int __val[_SIGSET_NWORDS]; } __sigset_t; #endif /* We only want to define these functions if was actually included; otherwise we were included just to define the types. Since we are namespace-clean, it wouldn't hurt to define extra macros. But trouble can be caused by functions being defined (e.g., any global register vars declared later will cause compilation errors). */ #if !defined _SIGSET_H_fns && defined _SIGNAL_H # define _SIGSET_H_fns 1 # ifndef _EXTERN_INLINE # define _EXTERN_INLINE __extern_inline # endif /* Return a mask that includes the bit for SIG only. */ # define __sigmask(sig) \ (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int)))) /* Return the word index for SIG. */ # define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int))) # if defined __GNUC__ && __GNUC__ >= 2 # define __sigemptyset(set) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ sigset_t *__set = (set); \ while (--__cnt >= 0) __set->__val[__cnt] = 0; \ 0; })) # define __sigfillset(set) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ sigset_t *__set = (set); \ while (--__cnt >= 0) __set->__val[__cnt] = ~0UL; \ 0; })) # ifdef __USE_GNU /* The POSIX does not specify for handling the whole signal set in one command. This is often wanted and so we define three more functions here. */ # define __sigisemptyset(set) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ const sigset_t *__set = (set); \ int __ret = __set->__val[--__cnt]; \ while (!__ret && --__cnt >= 0) \ __ret = __set->__val[__cnt]; \ __ret == 0; })) # define __sigandset(dest, left, right) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ sigset_t *__dest = (dest); \ const sigset_t *__left = (left); \ const sigset_t *__right = (right); \ while (--__cnt >= 0) \ __dest->__val[__cnt] = (__left->__val[__cnt] \ & __right->__val[__cnt]); \ 0; })) # define __sigorset(dest, left, right) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ sigset_t *__dest = (dest); \ const sigset_t *__left = (left); \ const sigset_t *__right = (right); \ while (--__cnt >= 0) \ __dest->__val[__cnt] = (__left->__val[__cnt] \ | __right->__val[__cnt]); \ 0; })) # endif # endif /* These functions needn't check for a bogus signal number -- error checking is done in the non __ versions. */ extern int __sigismember(const __sigset_t *, int); extern int __sigaddset(__sigset_t *, int); extern int __sigdelset(__sigset_t *, int); # ifdef __USE_EXTERN_INLINES # define __SIGSETFN(NAME, BODY, CONST) \ _EXTERN_INLINE int \ NAME (CONST __sigset_t *__set, int __sig) \ { \ unsigned long int __mask = __sigmask (__sig); \ unsigned long int __word = __sigword (__sig); \ return BODY; \ } __SIGSETFN(__sigismember, (__set->__val[__word] & __mask) ? 1 : 0, const) __SIGSETFN(__sigaddset, ((__set->__val[__word] |= __mask), 0),) __SIGSETFN(__sigdelset, ((__set->__val[__word] &= ~__mask), 0),) # undef __SIGSETFN # endif #endif /* ! _SIGSET_H_fns. */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/sigstack.h ================================================ /* sigstack, sigaltstack definitions. Copyright (C) 1998-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SIGNAL_H # error "Never include this file directly. Use instead" #endif /* Structure describing a signal stack (obsolete). */ struct sigstack { void *ss_sp; /* Signal stack pointer. */ int ss_onstack; /* Nonzero if executing on this stack. */ }; /* Possible values for `ss_flags.'. */ enum { SS_ONSTACK = 1, #define SS_ONSTACK SS_ONSTACK SS_DISABLE #define SS_DISABLE SS_DISABLE }; /* Minimum stack size for a signal handler. */ #define MINSIGSTKSZ 2048 /* System default stack size. */ #define SIGSTKSZ 8192 /* Alternate, preferred interface. */ typedef struct sigaltstack { void *ss_sp; int ss_flags; size_t ss_size; } stack_t; ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/sigthread.h ================================================ /* Signal handling function for threaded programs. Copyright (C) 1998-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see . */ #ifndef _BITS_SIGTHREAD_H #define _BITS_SIGTHREAD_H 1 #if !defined _SIGNAL_H && !defined _PTHREAD_H # error "Never include this file directly. Use instead" #endif /* Functions for handling signals. */ /* Modify the signal mask for the calling thread. The arguments have the same meaning as for sigprocmask(2). */ extern int pthread_sigmask(int __how, const __sigset_t * __restrict __newmask, __sigset_t * __restrict __oldmask) __THROW; /* Send signal SIGNO to the given thread. */ extern int pthread_kill(pthread_t __threadid, int __signo) __THROW; #ifdef __USE_GNU /* Queue signal and data to a thread. */ extern int pthread_sigqueue(pthread_t __threadid, int __signo, const union sigval __value) __THROW; #endif #endif /* bits/sigthread.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/sockaddr.h ================================================ /* Definition of `struct sockaddr_*' common members. Generic/4.2 BSD version. Copyright (C) 1995-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ #ifndef _BITS_SOCKADDR_H #define _BITS_SOCKADDR_H 1 /* POSIX.1g specifies this type name for the `sa_family' member. */ typedef unsigned short int sa_family_t; /* This macro is used to declare the initial common members of the data types used for socket addresses, `struct sockaddr', `struct sockaddr_in', `struct sockaddr_un', etc. */ #define __SOCKADDR_COMMON(sa_prefix) \ sa_family_t sa_prefix##family #define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) #endif /* bits/sockaddr.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/socket.h ================================================ /* System-specific socket constants and types. Linux version. Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef __BITS_SOCKET_H #define __BITS_SOCKET_H #ifndef _SYS_SOCKET_H # error "Never include directly; use instead." #endif #define __need_size_t #include #include /* Type for length arguments in socket calls. */ #ifndef __socklen_t_defined typedef __socklen_t socklen_t; # define __socklen_t_defined #endif /* Get the architecture-dependent definition of enum __socket_type. */ #include /* Protocol families. */ #define PF_UNSPEC 0 /* Unspecified. */ #define PF_LOCAL 1 /* Local to host (pipes and file-domain). */ #define PF_UNIX PF_LOCAL /* POSIX name for PF_LOCAL. */ #define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */ #define PF_INET 2 /* IP protocol family. */ #define PF_AX25 3 /* Amateur Radio AX.25. */ #define PF_IPX 4 /* Novell Internet Protocol. */ #define PF_APPLETALK 5 /* Appletalk DDP. */ #define PF_NETROM 6 /* Amateur radio NetROM. */ #define PF_BRIDGE 7 /* Multiprotocol bridge. */ #define PF_ATMPVC 8 /* ATM PVCs. */ #define PF_X25 9 /* Reserved for X.25 project. */ #define PF_INET6 10 /* IP version 6. */ #define PF_ROSE 11 /* Amateur Radio X.25 PLP. */ #define PF_DECnet 12 /* Reserved for DECnet project. */ #define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */ #define PF_SECURITY 14 /* Security callback pseudo AF. */ #define PF_KEY 15 /* PF_KEY key management API. */ #define PF_NETLINK 16 #define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */ #define PF_PACKET 17 /* Packet family. */ #define PF_ASH 18 /* Ash. */ #define PF_ECONET 19 /* Acorn Econet. */ #define PF_ATMSVC 20 /* ATM SVCs. */ #define PF_RDS 21 /* RDS sockets. */ #define PF_SNA 22 /* Linux SNA Project */ #define PF_IRDA 23 /* IRDA sockets. */ #define PF_PPPOX 24 /* PPPoX sockets. */ #define PF_WANPIPE 25 /* Wanpipe API sockets. */ #define PF_LLC 26 /* Linux LLC. */ #define PF_IB 27 /* Native InfiniBand address. */ #define PF_MPLS 28 /* MPLS. */ #define PF_CAN 29 /* Controller Area Network. */ #define PF_TIPC 30 /* TIPC sockets. */ #define PF_BLUETOOTH 31 /* Bluetooth sockets. */ #define PF_IUCV 32 /* IUCV sockets. */ #define PF_RXRPC 33 /* RxRPC sockets. */ #define PF_ISDN 34 /* mISDN sockets. */ #define PF_PHONET 35 /* Phonet sockets. */ #define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */ #define PF_CAIF 37 /* CAIF sockets. */ #define PF_ALG 38 /* Algorithm sockets. */ #define PF_NFC 39 /* NFC sockets. */ #define PF_VSOCK 40 /* vSockets. */ #define PF_MAX 41 /* For now.. */ /* Address families. */ #define AF_UNSPEC PF_UNSPEC #define AF_LOCAL PF_LOCAL #define AF_UNIX PF_UNIX #define AF_FILE PF_FILE #define AF_INET PF_INET #define AF_AX25 PF_AX25 #define AF_IPX PF_IPX #define AF_APPLETALK PF_APPLETALK #define AF_NETROM PF_NETROM #define AF_BRIDGE PF_BRIDGE #define AF_ATMPVC PF_ATMPVC #define AF_X25 PF_X25 #define AF_INET6 PF_INET6 #define AF_ROSE PF_ROSE #define AF_DECnet PF_DECnet #define AF_NETBEUI PF_NETBEUI #define AF_SECURITY PF_SECURITY #define AF_KEY PF_KEY #define AF_NETLINK PF_NETLINK #define AF_ROUTE PF_ROUTE #define AF_PACKET PF_PACKET #define AF_ASH PF_ASH #define AF_ECONET PF_ECONET #define AF_ATMSVC PF_ATMSVC #define AF_RDS PF_RDS #define AF_SNA PF_SNA #define AF_IRDA PF_IRDA #define AF_PPPOX PF_PPPOX #define AF_WANPIPE PF_WANPIPE #define AF_LLC PF_LLC #define AF_IB PF_IB #define AF_MPLS PF_MPLS #define AF_CAN PF_CAN #define AF_TIPC PF_TIPC #define AF_BLUETOOTH PF_BLUETOOTH #define AF_IUCV PF_IUCV #define AF_RXRPC PF_RXRPC #define AF_ISDN PF_ISDN #define AF_PHONET PF_PHONET #define AF_IEEE802154 PF_IEEE802154 #define AF_CAIF PF_CAIF #define AF_ALG PF_ALG #define AF_NFC PF_NFC #define AF_VSOCK PF_VSOCK #define AF_MAX PF_MAX /* Socket level values. Others are defined in the appropriate headers. XXX These definitions also should go into the appropriate headers as far as they are available. */ #define SOL_RAW 255 #define SOL_DECNET 261 #define SOL_X25 262 #define SOL_PACKET 263 #define SOL_ATM 264 /* ATM layer (cell level). */ #define SOL_AAL 265 /* ATM Adaption Layer (packet level). */ #define SOL_IRDA 266 /* Maximum queue length specifiable by listen. */ #define SOMAXCONN 128 /* Get the definition of the macro to define the common sockaddr members. */ #include /* Structure describing a generic socket address. */ struct sockaddr { __SOCKADDR_COMMON(sa_); /* Common data: address family and length. */ char sa_data[14]; /* Address data. */ }; /* Structure large enough to hold any socket address (with the historical exception of AF_UNIX). We reserve 128 bytes. */ #define __ss_aligntype unsigned long int #define _SS_SIZE 128 #define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype))) struct sockaddr_storage { __SOCKADDR_COMMON(ss_); /* Address family, etc. */ __ss_aligntype __ss_align; /* Force desired alignment. */ char __ss_padding[_SS_PADSIZE]; }; /* Bits in the FLAGS argument to `send', `recv', et al. */ enum { MSG_OOB = 0x01, /* Process out-of-band data. */ #define MSG_OOB MSG_OOB MSG_PEEK = 0x02, /* Peek at incoming messages. */ #define MSG_PEEK MSG_PEEK MSG_DONTROUTE = 0x04, /* Don't use local routing. */ #define MSG_DONTROUTE MSG_DONTROUTE #ifdef __USE_GNU /* DECnet uses a different name. */ MSG_TRYHARD = MSG_DONTROUTE, # define MSG_TRYHARD MSG_DONTROUTE #endif MSG_CTRUNC = 0x08, /* Control data lost before delivery. */ #define MSG_CTRUNC MSG_CTRUNC MSG_PROXY = 0x10, /* Supply or ask second address. */ #define MSG_PROXY MSG_PROXY MSG_TRUNC = 0x20, #define MSG_TRUNC MSG_TRUNC MSG_DONTWAIT = 0x40, /* Nonblocking IO. */ #define MSG_DONTWAIT MSG_DONTWAIT MSG_EOR = 0x80, /* End of record. */ #define MSG_EOR MSG_EOR MSG_WAITALL = 0x100, /* Wait for a full request. */ #define MSG_WAITALL MSG_WAITALL MSG_FIN = 0x200, #define MSG_FIN MSG_FIN MSG_SYN = 0x400, #define MSG_SYN MSG_SYN MSG_CONFIRM = 0x800, /* Confirm path validity. */ #define MSG_CONFIRM MSG_CONFIRM MSG_RST = 0x1000, #define MSG_RST MSG_RST MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */ #define MSG_ERRQUEUE MSG_ERRQUEUE MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */ #define MSG_NOSIGNAL MSG_NOSIGNAL MSG_MORE = 0x8000, /* Sender will send more. */ #define MSG_MORE MSG_MORE MSG_WAITFORONE = 0x10000, /* Wait for at least one packet to return. */ #define MSG_WAITFORONE MSG_WAITFORONE MSG_FASTOPEN = 0x20000000, /* Send data in TCP SYN. */ #define MSG_FASTOPEN MSG_FASTOPEN MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file descriptor received through SCM_RIGHTS. */ #define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC }; /* Structure describing messages sent by `sendmsg' and received by `recvmsg'. */ struct msghdr { void *msg_name; /* Address to send to/receive from. */ socklen_t msg_namelen; /* Length of address data. */ struct iovec *msg_iov; /* Vector of data to send/receive into. */ size_t msg_iovlen; /* Number of elements in the vector. */ void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ size_t msg_controllen; /* Ancillary data buffer length. !! The type should be socklen_t but the definition of the kernel is incompatible with this. */ int msg_flags; /* Flags on received message. */ }; /* Structure used for storage of ancillary data object information. */ struct cmsghdr { size_t cmsg_len; /* Length of data in cmsg_data plus length of cmsghdr structure. !! The type should be socklen_t but the definition of the kernel is incompatible with this. */ int cmsg_level; /* Originating protocol. */ int cmsg_type; /* Protocol specific type. */ #if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */ #endif }; /* Ancillary data object manipulation macros. */ #if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L # define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data) #else # define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) #endif #define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg) #define CMSG_FIRSTHDR(mhdr) \ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0) #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \ & (size_t) ~(sizeof (size_t) - 1)) #define CMSG_SPACE(len) (CMSG_ALIGN (len) \ + CMSG_ALIGN (sizeof (struct cmsghdr))) #define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) extern struct cmsghdr *__cmsg_nxthdr(struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW; #ifdef __USE_EXTERN_INLINES # ifndef _EXTERN_INLINE # define _EXTERN_INLINE __extern_inline # endif _EXTERN_INLINE struct cmsghdr *__NTH(__cmsg_nxthdr(struct msghdr *__mhdr, struct cmsghdr *__cmsg)) { if ((size_t) __cmsg->cmsg_len < sizeof(struct cmsghdr)) /* The kernel header does this so there may be a reason. */ return (struct cmsghdr *)0; __cmsg = (struct cmsghdr *)((unsigned char *)__cmsg + CMSG_ALIGN(__cmsg->cmsg_len)); if ((unsigned char *)(__cmsg + 1) > ((unsigned char *)__mhdr->msg_control + __mhdr->msg_controllen) || ((unsigned char *)__cmsg + CMSG_ALIGN(__cmsg->cmsg_len) > ((unsigned char *)__mhdr->msg_control + __mhdr->msg_controllen))) /* No more entries. */ return (struct cmsghdr *)0; return __cmsg; } #endif /* Use `extern inline'. */ /* Socket level message types. This must match the definitions in . */ enum { SCM_RIGHTS = 0x01 /* Transfer file descriptors. */ #define SCM_RIGHTS SCM_RIGHTS #ifdef __USE_GNU , SCM_CREDENTIALS = 0x02 /* Credentials passing. */ # define SCM_CREDENTIALS SCM_CREDENTIALS #endif }; #ifdef __USE_GNU /* User visible structure for SCM_CREDENTIALS message */ struct ucred { pid_t pid; /* PID of sending process. */ uid_t uid; /* UID of sending process. */ gid_t gid; /* GID of sending process. */ }; #endif /* Ugly workaround for unclean kernel headers. */ #ifndef __USE_MISC # ifndef FIOGETOWN # define __SYS_SOCKET_H_undef_FIOGETOWN # endif # ifndef FIOSETOWN # define __SYS_SOCKET_H_undef_FIOSETOWN # endif # ifndef SIOCATMARK # define __SYS_SOCKET_H_undef_SIOCATMARK # endif # ifndef SIOCGPGRP # define __SYS_SOCKET_H_undef_SIOCGPGRP # endif # ifndef SIOCGSTAMP # define __SYS_SOCKET_H_undef_SIOCGSTAMP # endif # ifndef SIOCGSTAMPNS # define __SYS_SOCKET_H_undef_SIOCGSTAMPNS # endif # ifndef SIOCSPGRP # define __SYS_SOCKET_H_undef_SIOCSPGRP # endif #endif /* Get socket manipulation related informations from kernel headers. */ #include #ifndef __USE_MISC # ifdef __SYS_SOCKET_H_undef_FIOGETOWN # undef __SYS_SOCKET_H_undef_FIOGETOWN # undef FIOGETOWN # endif # ifdef __SYS_SOCKET_H_undef_FIOSETOWN # undef __SYS_SOCKET_H_undef_FIOSETOWN # undef FIOSETOWN # endif # ifdef __SYS_SOCKET_H_undef_SIOCATMARK # undef __SYS_SOCKET_H_undef_SIOCATMARK # undef SIOCATMARK # endif # ifdef __SYS_SOCKET_H_undef_SIOCGPGRP # undef __SYS_SOCKET_H_undef_SIOCGPGRP # undef SIOCGPGRP # endif # ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP # undef __SYS_SOCKET_H_undef_SIOCGSTAMP # undef SIOCGSTAMP # endif # ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS # undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS # undef SIOCGSTAMPNS # endif # ifdef __SYS_SOCKET_H_undef_SIOCSPGRP # undef __SYS_SOCKET_H_undef_SIOCSPGRP # undef SIOCSPGRP # endif #endif /* Structure used to manipulate the SO_LINGER option. */ struct linger { int l_onoff; /* Nonzero to linger on close. */ int l_linger; /* Time to linger. */ }; #endif /* bits/socket.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/socket_type.h ================================================ /* Define enum __socket_type for generic Linux. Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SOCKET_H # error "Never include directly; use instead." #endif /* Types of sockets. */ enum __socket_type { SOCK_STREAM = 1, /* Sequenced, reliable, connection-based byte streams. */ #define SOCK_STREAM SOCK_STREAM SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams of fixed maximum length. */ #define SOCK_DGRAM SOCK_DGRAM SOCK_RAW = 3, /* Raw protocol interface. */ #define SOCK_RAW SOCK_RAW SOCK_RDM = 4, /* Reliably-delivered messages. */ #define SOCK_RDM SOCK_RDM SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, datagrams of fixed maximum length. */ #define SOCK_SEQPACKET SOCK_SEQPACKET SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */ #define SOCK_DCCP SOCK_DCCP SOCK_PACKET = 10, /* Linux specific way of getting packets at the dev level. For writing rarp and other similar things on the user level. */ #define SOCK_PACKET SOCK_PACKET /* Flags to be ORed into the type parameter of socket and socketpair and used for the flags parameter of paccept. */ SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the new descriptor(s). */ #define SOCK_CLOEXEC SOCK_CLOEXEC SOCK_NONBLOCK = 00004000 /* Atomically mark descriptor(s) as non-blocking. */ #define SOCK_NONBLOCK SOCK_NONBLOCK }; ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/stat.h ================================================ /* Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SYS_STAT_H && !defined _FCNTL_H # error "Never include directly; use instead." #endif #ifndef _BITS_STAT_H #define _BITS_STAT_H 1 /* Versions of the `struct stat' data structure. */ #ifndef __x86_64__ # define _STAT_VER_LINUX_OLD 1 # define _STAT_VER_KERNEL 1 # define _STAT_VER_SVR4 2 # define _STAT_VER_LINUX 3 /* i386 versions of the `xmknod' interface. */ # define _MKNOD_VER_LINUX 1 # define _MKNOD_VER_SVR4 2 # define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ #else # define _STAT_VER_KERNEL 0 # define _STAT_VER_LINUX 1 /* x86-64 versions of the `xmknod' interface. */ # define _MKNOD_VER_LINUX 0 #endif #define _STAT_VER _STAT_VER_LINUX struct stat { __dev_t st_dev; /* Device. */ #ifndef __x86_64__ unsigned short int __pad1; #endif #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ #else __ino_t __st_ino; /* 32bit file serial number. */ #endif #ifndef __x86_64__ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ #else __nlink_t st_nlink; /* Link count. */ __mode_t st_mode; /* File mode. */ #endif __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group. */ #ifdef __x86_64__ int __pad0; #endif __dev_t st_rdev; /* Device number, if device. */ #ifndef __x86_64__ unsigned short int __pad2; #endif #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ #else __off64_t st_size; /* Size of file, in bytes. */ #endif __blksize_t st_blksize; /* Optimal block size for I/O. */ #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ #else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif #ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the identifier 'timespec' to appear in the header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ # define st_atime st_atim.tv_sec /* Backward compatibility. */ # define st_mtime st_mtim.tv_sec # define st_ctime st_ctim.tv_sec #else __time_t st_atime; /* Time of last access. */ __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ #endif #ifdef __x86_64__ __syscall_slong_t __glibc_reserved[3]; #else # ifndef __USE_FILE_OFFSET64 unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; # else __ino64_t st_ino; /* File serial number. */ # endif #endif }; #ifdef __USE_LARGEFILE64 /* Note stat64 has the same shape as stat for x86-64. */ struct stat64 { __dev_t st_dev; /* Device. */ # ifdef __x86_64__ __ino64_t st_ino; /* File serial number. */ __nlink_t st_nlink; /* Link count. */ __mode_t st_mode; /* File mode. */ # else unsigned int __pad1; __ino_t __st_ino; /* 32bit file serial number. */ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ # endif __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group. */ # ifdef __x86_64__ int __pad0; __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ # else __dev_t st_rdev; /* Device number, if device. */ unsigned int __pad2; __off64_t st_size; /* Size of file, in bytes. */ # endif __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ # ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the identifier 'timespec' to appear in the header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ # else __time_t st_atime; /* Time of last access. */ __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ # endif # ifdef __x86_64__ __syscall_slong_t __glibc_reserved[3]; # else __ino64_t st_ino; /* File serial number. */ # endif }; #endif /* Tell code we have these members. */ #define _STATBUF_ST_BLKSIZE #define _STATBUF_ST_RDEV /* Nanosecond resolution time values are supported. */ #define _STATBUF_ST_NSEC /* Encoding of the file mode. */ #define __S_IFMT 0170000 /* These bits determine file type. */ /* File types. */ #define __S_IFDIR 0040000 /* Directory. */ #define __S_IFCHR 0020000 /* Character device. */ #define __S_IFBLK 0060000 /* Block device. */ #define __S_IFREG 0100000 /* Regular file. */ #define __S_IFIFO 0010000 /* FIFO. */ #define __S_IFLNK 0120000 /* Symbolic link. */ #define __S_IFSOCK 0140000 /* Socket. */ /* POSIX.1b objects. Note that these macros always evaluate to zero. But they do it by enforcing the correct use of the macros. */ #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) /* Protection bits. */ #define __S_ISUID 04000 /* Set user ID on execution. */ #define __S_ISGID 02000 /* Set group ID on execution. */ #define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ #define __S_IREAD 0400 /* Read by owner. */ #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ #ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif #endif /* bits/stat.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/statfs.h ================================================ /* Copyright (C) 1997-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_STATFS_H # error "Never include directly; use instead." #endif #include struct statfs { __fsword_t f_type; __fsword_t f_bsize; #ifndef __USE_FILE_OFFSET64 __fsblkcnt_t f_blocks; __fsblkcnt_t f_bfree; __fsblkcnt_t f_bavail; __fsfilcnt_t f_files; __fsfilcnt_t f_ffree; #else __fsblkcnt64_t f_blocks; __fsblkcnt64_t f_bfree; __fsblkcnt64_t f_bavail; __fsfilcnt64_t f_files; __fsfilcnt64_t f_ffree; #endif __fsid_t f_fsid; __fsword_t f_namelen; __fsword_t f_frsize; __fsword_t f_flags; __fsword_t f_spare[4]; }; #ifdef __USE_LARGEFILE64 struct statfs64 { __fsword_t f_type; __fsword_t f_bsize; __fsblkcnt64_t f_blocks; __fsblkcnt64_t f_bfree; __fsblkcnt64_t f_bavail; __fsfilcnt64_t f_files; __fsfilcnt64_t f_ffree; __fsid_t f_fsid; __fsword_t f_namelen; __fsword_t f_frsize; __fsword_t f_flags; __fsword_t f_spare[4]; }; #endif /* Tell code we have these members. */ #define _STATFS_F_NAMELEN #define _STATFS_F_FRSIZE #define _STATFS_F_FLAGS ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/stdio_lim.h ================================================ /* Copyright (C) 1994-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX # error "Never include directly; use instead." #endif #ifdef _STDIO_H # define L_tmpnam 20 # define TMP_MAX 238328 # define FILENAME_MAX 4096 # ifdef __USE_POSIX # define L_ctermid 9 # if !defined __USE_XOPEN2K || defined __USE_GNU # define L_cuserid 9 # endif # endif #endif #if defined __need_FOPEN_MAX || defined _STDIO_H # undef FOPEN_MAX # define FOPEN_MAX 16 #endif #if defined __need_IOV_MAX && !defined IOV_MAX # define IOV_MAX 1024 #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/stdlib-float.h ================================================ /* Floating-point inline functions for stdlib.h. Copyright (C) 2012-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STDLIB_H # error "Never use directly; include instead." #endif #ifdef __USE_EXTERN_INLINES __BEGIN_NAMESPACE_STD __extern_inline double __NTH(atof(const char *__nptr)) { return strtod(__nptr, (char **)NULL); } __END_NAMESPACE_STD #endif /* Optimizing and Inlining. */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/sys_errlist.h ================================================ /* Declare sys_errlist and sys_nerr, or don't. Compatibility (do) version. Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STDIO_H # error "Never include directly; use instead." #endif /* sys_errlist and sys_nerr are deprecated. Use strerror instead. */ #ifdef __USE_MISC extern int sys_nerr; extern const char *const sys_errlist[]; #endif #ifdef __USE_GNU extern int _sys_nerr; extern const char *const _sys_errlist[]; #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/termios.h ================================================ /* termios type and macro definitions. Linux version. Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _TERMIOS_H # error "Never include directly; use instead." #endif typedef unsigned char cc_t; typedef unsigned int speed_t; typedef unsigned int tcflag_t; #define NCCS 32 struct termios { tcflag_t c_iflag; /* input mode flags */ tcflag_t c_oflag; /* output mode flags */ tcflag_t c_cflag; /* control mode flags */ tcflag_t c_lflag; /* local mode flags */ cc_t c_line; /* line discipline */ cc_t c_cc[NCCS]; /* control characters */ speed_t c_ispeed; /* input speed */ speed_t c_ospeed; /* output speed */ #define _HAVE_STRUCT_TERMIOS_C_ISPEED 1 #define _HAVE_STRUCT_TERMIOS_C_OSPEED 1 }; /* c_cc characters */ #define VINTR 0 #define VQUIT 1 #define VERASE 2 #define VKILL 3 #define VEOF 4 #define VTIME 5 #define VMIN 6 #define VSWTC 7 #define VSTART 8 #define VSTOP 9 #define VSUSP 10 #define VEOL 11 #define VREPRINT 12 #define VDISCARD 13 #define VWERASE 14 #define VLNEXT 15 #define VEOL2 16 /* c_iflag bits */ #define IGNBRK 0000001 #define BRKINT 0000002 #define IGNPAR 0000004 #define PARMRK 0000010 #define INPCK 0000020 #define ISTRIP 0000040 #define INLCR 0000100 #define IGNCR 0000200 #define ICRNL 0000400 #define IUCLC 0001000 #define IXON 0002000 #define IXANY 0004000 #define IXOFF 0010000 #define IMAXBEL 0020000 #define IUTF8 0040000 /* c_oflag bits */ #define OPOST 0000001 #define OLCUC 0000002 #define ONLCR 0000004 #define OCRNL 0000010 #define ONOCR 0000020 #define ONLRET 0000040 #define OFILL 0000100 #define OFDEL 0000200 #if defined __USE_MISC || defined __USE_XOPEN # define NLDLY 0000400 # define NL0 0000000 # define NL1 0000400 # define CRDLY 0003000 # define CR0 0000000 # define CR1 0001000 # define CR2 0002000 # define CR3 0003000 # define TABDLY 0014000 # define TAB0 0000000 # define TAB1 0004000 # define TAB2 0010000 # define TAB3 0014000 # define BSDLY 0020000 # define BS0 0000000 # define BS1 0020000 # define FFDLY 0100000 # define FF0 0000000 # define FF1 0100000 #endif #define VTDLY 0040000 #define VT0 0000000 #define VT1 0040000 #ifdef __USE_MISC # define XTABS 0014000 #endif /* c_cflag bit meaning */ #ifdef __USE_MISC # define CBAUD 0010017 #endif #define B0 0000000 /* hang up */ #define B50 0000001 #define B75 0000002 #define B110 0000003 #define B134 0000004 #define B150 0000005 #define B200 0000006 #define B300 0000007 #define B600 0000010 #define B1200 0000011 #define B1800 0000012 #define B2400 0000013 #define B4800 0000014 #define B9600 0000015 #define B19200 0000016 #define B38400 0000017 #ifdef __USE_MISC # define EXTA B19200 # define EXTB B38400 #endif #define CSIZE 0000060 #define CS5 0000000 #define CS6 0000020 #define CS7 0000040 #define CS8 0000060 #define CSTOPB 0000100 #define CREAD 0000200 #define PARENB 0000400 #define PARODD 0001000 #define HUPCL 0002000 #define CLOCAL 0004000 #ifdef __USE_MISC # define CBAUDEX 0010000 #endif #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif /* c_lflag bits */ #define ISIG 0000001 #define ICANON 0000002 #if defined __USE_MISC || defined __USE_XOPEN # define XCASE 0000004 #endif #define ECHO 0000010 #define ECHOE 0000020 #define ECHOK 0000040 #define ECHONL 0000100 #define NOFLSH 0000200 #define TOSTOP 0000400 #ifdef __USE_MISC # define ECHOCTL 0001000 # define ECHOPRT 0002000 # define ECHOKE 0004000 # define FLUSHO 0010000 # define PENDIN 0040000 #endif #define IEXTEN 0100000 #ifdef __USE_MISC # define EXTPROC 0200000 #endif /* tcflow() and TCXONC use these */ #define TCOOFF 0 #define TCOON 1 #define TCIOFF 2 #define TCION 3 /* tcflush() and TCFLSH use these */ #define TCIFLUSH 0 #define TCOFLUSH 1 #define TCIOFLUSH 2 /* tcsetattr uses these */ #define TCSANOW 0 #define TCSADRAIN 1 #define TCSAFLUSH 2 #define _IOT_termios /* Hurd ioctl type field. */ \ _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/time.h ================================================ /* System-dependent timing definitions. Linux version. Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ #if defined __need_timeval || defined __USE_GNU # ifndef _STRUCT_TIMEVAL # define _STRUCT_TIMEVAL 1 # include /* A time value that is accurate to the nearest microsecond but also has a range of years. */ struct timeval { __time_t tv_sec; /* Seconds. */ __suseconds_t tv_usec; /* Microseconds. */ }; # endif /* struct timeval */ #endif #ifndef __need_timeval # ifndef _BITS_TIME_H # define _BITS_TIME_H 1 /* ISO/IEC 9899:1999 7.23.1: Components of time The macro `CLOCKS_PER_SEC' is an expression with type `clock_t' that is the number per second of the value returned by the `clock' function. */ /* CAE XSH, Issue 4, Version 2: The value of CLOCKS_PER_SEC is required to be 1 million on all XSI-conformant systems. */ # define CLOCKS_PER_SEC ((clock_t) 1000000) # if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \ && !defined __USE_XOPEN2K /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK presents the real value for clock ticks per second for the system. */ # include extern long int __sysconf(int); # define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */ # endif # ifdef __USE_POSIX199309 /* Identifier for system-wide realtime clock. */ # define CLOCK_REALTIME 0 /* Monotonic system-wide clock. */ # define CLOCK_MONOTONIC 1 /* High-resolution timer from the CPU. */ # define CLOCK_PROCESS_CPUTIME_ID 2 /* Thread-specific CPU-time clock. */ # define CLOCK_THREAD_CPUTIME_ID 3 /* Monotonic system-wide clock, not adjusted for frequency scaling. */ # define CLOCK_MONOTONIC_RAW 4 /* Identifier for system-wide realtime clock, updated only on ticks. */ # define CLOCK_REALTIME_COARSE 5 /* Monotonic system-wide clock, updated only on ticks. */ # define CLOCK_MONOTONIC_COARSE 6 /* Monotonic system-wide clock that includes time spent in suspension. */ # define CLOCK_BOOTTIME 7 /* Like CLOCK_REALTIME but also wakes suspended system. */ # define CLOCK_REALTIME_ALARM 8 /* Like CLOCK_BOOTTIME but also wakes suspended system. */ # define CLOCK_BOOTTIME_ALARM 9 /* Like CLOCK_REALTIME but in International Atomic Time. */ # define CLOCK_TAI 11 /* Flag to indicate time is absolute. */ # define TIMER_ABSTIME 1 # endif # ifdef __USE_GNU # include __BEGIN_DECLS /* Tune a POSIX clock. */ extern int clock_adjtime(__clockid_t __clock_id, struct timex *__utx) __THROW; __END_DECLS # endif /* use GNU */ # endif /* bits/time.h */ #endif #undef __need_timeval ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/types.h ================================================ /* bits/types.h -- definitions of __*_t types underlying *_t types. Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ #ifndef _BITS_TYPES_H #define _BITS_TYPES_H 1 #include #include /* Convenience types. */ typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; /* Fixed-size types, underlying types depend on word size and compiler. */ typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; #if __WORDSIZE == 64 typedef signed long int __int64_t; typedef unsigned long int __uint64_t; #else __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; #endif /* quad_t is also 64 bits. */ #if __WORDSIZE == 64 typedef long int __quad_t; typedef unsigned long int __u_quad_t; #else __extension__ typedef long long int __quad_t; __extension__ typedef unsigned long long int __u_quad_t; #endif /* The machine-dependent file defines __*_T_TYPE macros for each of the OS types we define below. The definitions of those macros must use the following macros for underlying types. We define __S_TYPE and __U_TYPE for the signed and unsigned variants of each of the following integer types on this machine. 16 -- "natural" 16-bit type (always short) 32 -- "natural" 32-bit type (always int) 64 -- "natural" 64-bit type (long or long long) LONG32 -- 32-bit type, traditionally long QUAD -- 64-bit type, always long long WORD -- natural type of __WORDSIZE bits (int or long) LONGWORD -- type of __WORDSIZE bits, traditionally long We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the conventional uses of `long' or `long long' type modifiers match the types we define, even when a less-adorned type would be the same size. This matters for (somewhat) portably writing printf/scanf formats for these types, where using the appropriate l or ll format modifiers can make the typedefs and the formats match up across all GNU platforms. If we used `long' when it's 64 bits where `long long' is expected, then the compiler would warn about the formats not matching the argument types, and the programmer changing them to shut up the compiler would break the program's portability. Here we assume what is presently the case in all the GCC configurations we support: long long is always 64 bits, long is always word/address size, and int is always 32 bits. */ #define __S16_TYPE short int #define __U16_TYPE unsigned short int #define __S32_TYPE int #define __U32_TYPE unsigned int #define __SLONGWORD_TYPE long int #define __ULONGWORD_TYPE unsigned long int #if __WORDSIZE == 32 # define __SQUAD_TYPE __quad_t # define __UQUAD_TYPE __u_quad_t # define __SWORD_TYPE int # define __UWORD_TYPE unsigned int # define __SLONG32_TYPE long int # define __ULONG32_TYPE unsigned long int # define __S64_TYPE __quad_t # define __U64_TYPE __u_quad_t /* We want __extension__ before typedef's that use nonstandard base types such as `long long' in C89 mode. */ # define __STD_TYPE __extension__ typedef #elif __WORDSIZE == 64 # define __SQUAD_TYPE long int # define __UQUAD_TYPE unsigned long int # define __SWORD_TYPE long int # define __UWORD_TYPE unsigned long int # define __SLONG32_TYPE int # define __ULONG32_TYPE unsigned int # define __S64_TYPE long int # define __U64_TYPE unsigned long int /* No need to mark the typedef with __extension__. */ # define __STD_TYPE typedef #else # error #endif #include /* Defines __*_T_TYPE macros. */ __STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */ __STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */ __STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */ __STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */ __STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS). */ __STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */ __STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */ __STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */ __STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */ __STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */ __STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */ __STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */ __STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */ __STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */ __STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */ __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ __STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ __STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ __STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ /* Clock ID used in clock and timer functions. */ __STD_TYPE __CLOCKID_T_TYPE __clockid_t; /* Timer ID returned by `timer_create'. */ __STD_TYPE __TIMER_T_TYPE __timer_t; /* Type to represent block size. */ __STD_TYPE __BLKSIZE_T_TYPE __blksize_t; /* Types from the Large File Support interface. */ /* Type to count number of disk blocks. */ __STD_TYPE __BLKCNT_T_TYPE __blkcnt_t; __STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t; /* Type to count file system blocks. */ __STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t; __STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t; /* Type to count file system nodes. */ __STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t; __STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t; /* Type of miscellaneous file system fields. */ __STD_TYPE __FSWORD_T_TYPE __fsword_t; __STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */ /* Signed long type used in system calls. */ __STD_TYPE __SYSCALL_SLONG_TYPE __syscall_slong_t; /* Unsigned long type used in system calls. */ __STD_TYPE __SYSCALL_ULONG_TYPE __syscall_ulong_t; /* These few don't really vary by system, they always correspond to one of the other defined types. */ typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */ typedef __quad_t *__qaddr_t; typedef char *__caddr_t; /* Duplicates info from stdint.h but this is used in unistd.h. */ __STD_TYPE __SWORD_TYPE __intptr_t; /* Duplicate info from sys/socket.h. */ __STD_TYPE __U32_TYPE __socklen_t; #undef __STD_TYPE #endif /* bits/types.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/typesizes.h ================================================ /* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version. Copyright (C) 2012-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_TYPES_H # error "Never include directly; use instead." #endif #ifndef _BITS_TYPESIZES_H #define _BITS_TYPESIZES_H 1 /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ /* X32 kernel interface is 64-bit. */ #if defined __x86_64__ && defined __ILP32__ # define __SYSCALL_SLONG_TYPE __SQUAD_TYPE # define __SYSCALL_ULONG_TYPE __UQUAD_TYPE #else # define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE # define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #endif #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE #define __INO_T_TYPE __SYSCALL_ULONG_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #ifdef __x86_64__ # define __NLINK_T_TYPE __SYSCALL_ULONG_TYPE # define __FSWORD_T_TYPE __SYSCALL_SLONG_TYPE #else # define __NLINK_T_TYPE __UWORD_TYPE # define __FSWORD_T_TYPE __SWORD_TYPE #endif #define __OFF_T_TYPE __SYSCALL_SLONG_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE #define __RLIM_T_TYPE __SYSCALL_ULONG_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE #define __BLKCNT_T_TYPE __SYSCALL_SLONG_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE #define __FSBLKCNT_T_TYPE __SYSCALL_ULONG_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE #define __FSFILCNT_T_TYPE __SYSCALL_ULONG_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SYSCALL_SLONG_TYPE #define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE #define __TIMER_T_TYPE void * #define __BLKSIZE_T_TYPE __SYSCALL_SLONG_TYPE #define __FSID_T_TYPE struct { int __val[2]; } #define __SSIZE_T_TYPE __SWORD_TYPE #ifdef __x86_64__ /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ # define __OFF_T_MATCHES_OFF64_T 1 /* Same for ino_t and ino64_t. */ # define __INO_T_MATCHES_INO64_T 1 #endif /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 #endif /* bits/typesizes.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/uio.h ================================================ /* Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SYS_UIO_H && !defined _FCNTL_H # error "Never include directly; use instead." #endif #ifndef _BITS_UIO_H #define _BITS_UIO_H 1 #include /* We should normally use the Linux kernel header file to define this type and macros but this calls for trouble because of the header includes other kernel headers. */ /* Size of object which can be written atomically. This macro has different values in different kernel versions. The latest versions of the kernel use 1024 and this is good choice. Since the C library implementation of readv/writev is able to emulate the functionality even if the currently running kernel does not support this large value the readv/writev call will not fail because of this. */ #define UIO_MAXIOV 1024 /* Structure for scatter/gather I/O. */ struct iovec { void *iov_base; /* Pointer to data. */ size_t iov_len; /* Length of data. */ }; #endif #ifdef __USE_GNU # if defined _SYS_UIO_H && !defined _BITS_UIO_H_FOR_SYS_UIO_H # define _BITS_UIO_H_FOR_SYS_UIO_H 1 __BEGIN_DECLS /* Read from another process' address space. */ extern ssize_t process_vm_readv(pid_t __pid, const struct iovec *__lvec, unsigned long int __liovcnt, const struct iovec *__rvec, unsigned long int __riovcnt, unsigned long int __flags) __THROW; /* Write to another process' address space. */ extern ssize_t process_vm_writev(pid_t __pid, const struct iovec *__lvec, unsigned long int __liovcnt, const struct iovec *__rvec, unsigned long int __riovcnt, unsigned long int __flags) __THROW; __END_DECLS # endif #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/utsname.h ================================================ /* Copyright (C) 1995-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_UTSNAME_H # error "Never include directly; use instead." #endif /* Length of the entries in `struct utsname' is 65. */ #define _UTSNAME_LENGTH 65 /* Linux provides as additional information in the `struct utsname' the name of the current domain. Define _UTSNAME_DOMAIN_LENGTH to a value != 0 to activate this entry. */ #define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/waitflags.h ================================================ /* Definitions of flag bits for `waitpid' et al. Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SYS_WAIT_H && !defined _STDLIB_H # error "Never include directly; use instead." #endif /* Bits in the third argument to `waitpid'. */ #define WNOHANG 1 /* Don't block waiting. */ #define WUNTRACED 2 /* Report status of stopped children. */ /* Bits in the fourth argument to `waitid'. */ #define WSTOPPED 2 /* Report stopped child (same as WUNTRACED). */ #define WEXITED 4 /* Report dead child. */ #define WCONTINUED 8 /* Report continued child. */ #define WNOWAIT 0x01000000 /* Don't reap, just poll status. */ #define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads in this group */ #define __WALL 0x40000000 /* Wait for any child. */ #define __WCLONE 0x80000000 /* Wait for cloned process. */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/waitstatus.h ================================================ /* Definitions of status bits for `wait' et al. Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SYS_WAIT_H && !defined _STDLIB_H # error "Never include directly; use instead." #endif /* Everything extant so far uses these same bits. */ /* If WIFEXITED(STATUS), the low-order 8 bits of the status. */ #define __WEXITSTATUS(status) (((status) & 0xff00) >> 8) /* If WIFSIGNALED(STATUS), the terminating signal. */ #define __WTERMSIG(status) ((status) & 0x7f) /* If WIFSTOPPED(STATUS), the signal that stopped the child. */ #define __WSTOPSIG(status) __WEXITSTATUS(status) /* Nonzero if STATUS indicates normal termination. */ #define __WIFEXITED(status) (__WTERMSIG(status) == 0) /* Nonzero if STATUS indicates termination by a signal. */ #define __WIFSIGNALED(status) \ (((signed char) (((status) & 0x7f) + 1) >> 1) > 0) /* Nonzero if STATUS indicates the child is stopped. */ #define __WIFSTOPPED(status) (((status) & 0xff) == 0x7f) /* Nonzero if STATUS indicates the child continued after a stop. We only define this if provides the WCONTINUED flag bit. */ #ifdef WCONTINUED # define __WIFCONTINUED(status) ((status) == __W_CONTINUED) #endif /* Nonzero if STATUS indicates the child dumped core. */ #define __WCOREDUMP(status) ((status) & __WCOREFLAG) /* Macros for constructing status values. */ #define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) #define __W_STOPCODE(sig) ((sig) << 8 | 0x7f) #define __W_CONTINUED 0xffff #define __WCOREFLAG 0x80 #ifdef __USE_MISC # include union wait { int w_status; struct { # if __BYTE_ORDER == __LITTLE_ENDIAN unsigned int __w_termsig:7; /* Terminating signal. */ unsigned int __w_coredump:1; /* Set if dumped core. */ unsigned int __w_retcode:8; /* Return code if exited normally. */ unsigned int:16; # endif /* Little endian. */ # if __BYTE_ORDER == __BIG_ENDIAN unsigned int:16; unsigned int __w_retcode:8; unsigned int __w_coredump:1; unsigned int __w_termsig:7; # endif /* Big endian. */ } __wait_terminated; struct { # if __BYTE_ORDER == __LITTLE_ENDIAN unsigned int __w_stopval:8; /* W_STOPPED if stopped. */ unsigned int __w_stopsig:8; /* Stopping signal. */ unsigned int:16; # endif /* Little endian. */ # if __BYTE_ORDER == __BIG_ENDIAN unsigned int:16; unsigned int __w_stopsig:8; /* Stopping signal. */ unsigned int __w_stopval:8; /* W_STOPPED if stopped. */ # endif /* Big endian. */ } __wait_stopped; }; # define w_termsig __wait_terminated.__w_termsig # define w_coredump __wait_terminated.__w_coredump # define w_retcode __wait_terminated.__w_retcode # define w_stopsig __wait_stopped.__w_stopsig # define w_stopval __wait_stopped.__w_stopval #endif /* Use misc. */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/wchar.h ================================================ /* wchar_t type related definitions. Copyright (C) 2000-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_WCHAR_H #define _BITS_WCHAR_H 1 /* The fallback definitions, for when __WCHAR_MAX__ or __WCHAR_MIN__ are not defined, give the right value and type as long as both int and wchar_t are 32-bit types. Adding L'\0' to a constant value ensures that the type is correct; it is necessary to use (L'\0' + 0) rather than just L'\0' so that the type in C++ is the promoted version of wchar_t rather than the distinct wchar_t type itself. Because wchar_t in preprocessor #if expressions is treated as intmax_t or uintmax_t, the expression (L'\0' - 1) would have the wrong value for WCHAR_MAX in such expressions and so cannot be used to define __WCHAR_MAX in the unsigned case. */ #ifdef __WCHAR_MAX__ # define __WCHAR_MAX __WCHAR_MAX__ #elif L'\0' - 1 > 0 # define __WCHAR_MAX (0xffffffffu + L'\0') #else # define __WCHAR_MAX (0x7fffffff + L'\0') #endif #ifdef __WCHAR_MIN__ # define __WCHAR_MIN __WCHAR_MIN__ #elif L'\0' - 1 > 0 # define __WCHAR_MIN (L'\0' + 0) #else # define __WCHAR_MIN (-__WCHAR_MAX - 1) #endif #endif /* bits/wchar.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/wordsize.h ================================================ /* Determine the wordsize from the preprocessor defines. */ #if defined __x86_64__ && !defined __ILP32__ # define __WORDSIZE 64 #else # define __WORDSIZE 32 #endif #ifdef __x86_64__ # define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/bits/xopen_lim.h ================================================ /* Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ /* Additional definitions from X/Open Portability Guide, Issue 4, Version 2 System Interfaces and Headers, 4.16 Please note only the values which are not greater than the minimum stated in the standard document are listed. The `sysconf' functions should be used to obtain the actual value. */ #ifndef _XOPEN_LIM_H #define _XOPEN_LIM_H 1 #define __need_IOV_MAX #include /* We do not provide fixed values for ARG_MAX Maximum length of argument to the `exec' function including environment data. ATEXIT_MAX Maximum number of functions that may be registered with `atexit'. CHILD_MAX Maximum number of simultaneous processes per real user ID. OPEN_MAX Maximum number of files that one process can have open at anyone time. PAGESIZE PAGE_SIZE Size of bytes of a page. PASS_MAX Maximum number of significant bytes in a password. We only provide a fixed limit for IOV_MAX Maximum number of `iovec' structures that one process has available for use with `readv' or writev'. if this is indeed fixed by the underlying system. */ /* Maximum number of `iovec' structures that one process has available for use with `readv' or writev'. */ #define _XOPEN_IOV_MAX _POSIX_UIO_MAXIOV /* Maximum value of `digit' in calls to the `printf' and `scanf' functions. We have no limit, so return a reasonable value. */ #define NL_ARGMAX _POSIX_ARG_MAX /* Maximum number of bytes in a `LANG' name. We have no limit. */ #define NL_LANGMAX _POSIX2_LINE_MAX /* Maximum message number. We have no limit. */ #define NL_MSGMAX INT_MAX /* Maximum number of bytes in N-to-1 collation mapping. We have no limit. */ #define NL_NMAX INT_MAX /* Maximum set number. We have no limit. */ #define NL_SETMAX INT_MAX /* Maximum number of bytes in a message. We have no limit. */ #define NL_TEXTMAX INT_MAX /* Default process priority. */ #define NZERO 20 /* Number of bits in a word of type `int'. */ #ifdef INT_MAX # if INT_MAX == 32767 # define WORD_BIT 16 # else # if INT_MAX == 2147483647 # define WORD_BIT 32 # else /* Safe assumption. */ # define WORD_BIT 64 # endif # endif #elif defined __INT_MAX__ # if __INT_MAX__ == 32767 # define WORD_BIT 16 # else # if __INT_MAX__ == 2147483647 # define WORD_BIT 32 # else /* Safe assumption. */ # define WORD_BIT 64 # endif # endif #else # define WORD_BIT 32 #endif /* Number of bits in a word of type `long int'. */ #ifdef LONG_MAX # if LONG_MAX == 2147483647 # define LONG_BIT 32 # else /* Safe assumption. */ # define LONG_BIT 64 # endif #elif defined __LONG_MAX__ # if __LONG_MAX__ == 2147483647 # define LONG_BIT 32 # else /* Safe assumption. */ # define LONG_BIT 64 # endif #else # include # if __WORDSIZE == 64 # define LONG_BIT 64 # else # define LONG_BIT 32 # endif #endif #endif /* bits/xopen_lim.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/ctype.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard 7.4: Character handling */ #ifndef _CTYPE_H #define _CTYPE_H 1 #include #include __BEGIN_DECLS #ifndef _ISbit /* These are all the characteristics of characters. If there get to be more than 16 distinct characteristics, many things must be changed that use `unsigned short int's. The characteristics are stored always in network byte order (big endian). We define the bit value interpretations here dependent on the machine's byte order. */ # include # if __BYTE_ORDER == __BIG_ENDIAN # define _ISbit(bit) (1 << (bit)) # else /* __BYTE_ORDER == __LITTLE_ENDIAN */ # define _ISbit(bit) ((bit) < 8 ? ((1 << (bit)) << 8) : ((1 << (bit)) >> 8)) # endif enum { _ISupper = _ISbit(0), /* UPPERCASE. */ _ISlower = _ISbit(1), /* lowercase. */ _ISalpha = _ISbit(2), /* Alphabetic. */ _ISdigit = _ISbit(3), /* Numeric. */ _ISxdigit = _ISbit(4), /* Hexadecimal numeric. */ _ISspace = _ISbit(5), /* Whitespace. */ _ISprint = _ISbit(6), /* Printing. */ _ISgraph = _ISbit(7), /* Graphical. */ _ISblank = _ISbit(8), /* Blank (usually SPC and TAB). */ _IScntrl = _ISbit(9), /* Control character. */ _ISpunct = _ISbit(10), /* Punctuation. */ _ISalnum = _ISbit(11) /* Alphanumeric. */ }; #endif /* ! _ISbit */ /* These are defined in ctype-info.c. The declarations here must match those in localeinfo.h. In the thread-specific locale model (see `uselocale' in ) we cannot use global variables for these as was done in the past. Instead, the following accessor functions return the address of each variable, which is local to the current thread if multithreaded. These point into arrays of 384, so they can be indexed by any `unsigned char' value [0,255]; by EOF (-1); or by any `signed char' value [-128,-1). ISO C requires that the ctype functions work for `unsigned char' values and for EOF; we also support negative `signed char' values for broken old programs. The case conversion arrays are of `int's rather than `unsigned char's because tolower (EOF) must be EOF, which doesn't fit into an `unsigned char'. But today more important is that the arrays are also used for multi-byte character sets. */ extern const unsigned short int **__ctype_b_loc(void) __THROW __attribute__ ((__const__)); extern const __int32_t **__ctype_tolower_loc(void) __THROW __attribute__ ((__const__)); extern const __int32_t **__ctype_toupper_loc(void) __THROW __attribute__ ((__const__)); #ifndef __cplusplus # define __isctype(c, type) \ ((*__ctype_b_loc ())[(int) (c)] & (unsigned short int) type) #elif defined __USE_EXTERN_INLINES # define __isctype_f(type) \ __extern_inline int \ is##type (int __c) __THROW \ { \ return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _IS##type; \ } #endif #define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */ #define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */ #define __exctype(name) extern int name (int) __THROW __BEGIN_NAMESPACE_STD /* The following names are all functions: int isCHARACTERISTIC(int c); which return nonzero iff C has CHARACTERISTIC. For the meaning of the characteristic names, see the `enum' above. */ __exctype(isalnum); __exctype(isalpha); __exctype(iscntrl); __exctype(isdigit); __exctype(islower); __exctype(isgraph); __exctype(isprint); __exctype(ispunct); __exctype(isspace); __exctype(isupper); __exctype(isxdigit); /* Return the lowercase version of C. */ extern int tolower(int __c) __THROW; /* Return the uppercase version of C. */ extern int toupper(int __c) __THROW; __END_NAMESPACE_STD /* ISO C99 introduced one new function. */ #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 __exctype(isblank); __END_NAMESPACE_C99 #endif #ifdef __USE_GNU /* Test C for a set of character classes according to MASK. */ extern int isctype(int __c, int __mask) __THROW; #endif #if defined __USE_MISC || defined __USE_XOPEN /* Return nonzero iff C is in the ASCII set (i.e., is no more than 7 bits wide). */ extern int isascii(int __c) __THROW; /* Return the part of C that is in the ASCII set (i.e., the low-order 7 bits of C). */ extern int toascii(int __c) __THROW; /* These are the same as `toupper' and `tolower' except that they do not check the argument for being in the range of a `char'. */ __exctype(_toupper); __exctype(_tolower); #endif /* Use X/Open or use misc. */ /* This code is needed for the optimized mapping functions. */ #define __tobody(c, f, a, args) \ (__extension__ \ ({ int __res; \ if (sizeof (c) > 1) \ { \ if (__builtin_constant_p (c)) \ { \ int __c = (c); \ __res = __c < -128 || __c > 255 ? __c : (a)[__c]; \ } \ else \ __res = f args; \ } \ else \ __res = (a)[(int) (c)]; \ __res; })) #if !defined __NO_CTYPE # ifdef __isctype_f __isctype_f(alnum) __isctype_f(alpha) __isctype_f(cntrl) __isctype_f(digit) __isctype_f(lower) __isctype_f(graph) __isctype_f(print) __isctype_f(punct) __isctype_f(space) __isctype_f(upper) __isctype_f(xdigit) # ifdef __USE_ISOC99 __isctype_f(blank) # endif # elif defined __isctype # define isalnum(c) __isctype((c), _ISalnum) # define isalpha(c) __isctype((c), _ISalpha) # define iscntrl(c) __isctype((c), _IScntrl) # define isdigit(c) __isctype((c), _ISdigit) # define islower(c) __isctype((c), _ISlower) # define isgraph(c) __isctype((c), _ISgraph) # define isprint(c) __isctype((c), _ISprint) # define ispunct(c) __isctype((c), _ISpunct) # define isspace(c) __isctype((c), _ISspace) # define isupper(c) __isctype((c), _ISupper) # define isxdigit(c) __isctype((c), _ISxdigit) # ifdef __USE_ISOC99 # define isblank(c) __isctype((c), _ISblank) # endif # endif # ifdef __USE_EXTERN_INLINES __extern_inline int __NTH(tolower(int __c)) { return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc())[__c] : __c; } __extern_inline int __NTH(toupper(int __c)) { return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc())[__c] : __c; } # endif # if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus # define tolower(c) __tobody (c, tolower, *__ctype_tolower_loc (), (c)) # define toupper(c) __tobody (c, toupper, *__ctype_toupper_loc (), (c)) # endif /* Optimizing gcc */ # if defined __USE_MISC || defined __USE_XOPEN # define isascii(c) __isascii (c) # define toascii(c) __toascii (c) # define _tolower(c) ((int) (*__ctype_tolower_loc ())[(int) (c)]) # define _toupper(c) ((int) (*__ctype_toupper_loc ())[(int) (c)]) # endif #endif /* Not __NO_CTYPE. */ #ifdef __USE_XOPEN2K8 /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ # include /* These definitions are similar to the ones above but all functions take as an argument a handle for the locale which shall be used. */ # define __isctype_l(c, type, locale) \ ((locale)->__ctype_b[(int) (c)] & (unsigned short int) type) # define __exctype_l(name) \ extern int name (int, __locale_t) __THROW /* The following names are all functions: int isCHARACTERISTIC(int c, locale_t *locale); which return nonzero iff C has CHARACTERISTIC. For the meaning of the characteristic names, see the `enum' above. */ __exctype_l(isalnum_l); __exctype_l(isalpha_l); __exctype_l(iscntrl_l); __exctype_l(isdigit_l); __exctype_l(islower_l); __exctype_l(isgraph_l); __exctype_l(isprint_l); __exctype_l(ispunct_l); __exctype_l(isspace_l); __exctype_l(isupper_l); __exctype_l(isxdigit_l); __exctype_l(isblank_l); /* Return the lowercase version of C in locale L. */ extern int __tolower_l(int __c, __locale_t __l) __THROW; extern int tolower_l(int __c, __locale_t __l) __THROW; /* Return the uppercase version of C. */ extern int __toupper_l(int __c, __locale_t __l) __THROW; extern int toupper_l(int __c, __locale_t __l) __THROW; # if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus # define __tolower_l(c, locale) \ __tobody (c, __tolower_l, (locale)->__ctype_tolower, (c, locale)) # define __toupper_l(c, locale) \ __tobody (c, __toupper_l, (locale)->__ctype_toupper, (c, locale)) # define tolower_l(c, locale) __tolower_l ((c), (locale)) # define toupper_l(c, locale) __toupper_l ((c), (locale)) # endif /* Optimizing gcc */ # ifndef __NO_CTYPE # define __isalnum_l(c,l) __isctype_l((c), _ISalnum, (l)) # define __isalpha_l(c,l) __isctype_l((c), _ISalpha, (l)) # define __iscntrl_l(c,l) __isctype_l((c), _IScntrl, (l)) # define __isdigit_l(c,l) __isctype_l((c), _ISdigit, (l)) # define __islower_l(c,l) __isctype_l((c), _ISlower, (l)) # define __isgraph_l(c,l) __isctype_l((c), _ISgraph, (l)) # define __isprint_l(c,l) __isctype_l((c), _ISprint, (l)) # define __ispunct_l(c,l) __isctype_l((c), _ISpunct, (l)) # define __isspace_l(c,l) __isctype_l((c), _ISspace, (l)) # define __isupper_l(c,l) __isctype_l((c), _ISupper, (l)) # define __isxdigit_l(c,l) __isctype_l((c), _ISxdigit, (l)) # define __isblank_l(c,l) __isctype_l((c), _ISblank, (l)) # ifdef __USE_MISC # define __isascii_l(c,l) ((l), __isascii (c)) # define __toascii_l(c,l) ((l), __toascii (c)) # endif # define isalnum_l(c,l) __isalnum_l ((c), (l)) # define isalpha_l(c,l) __isalpha_l ((c), (l)) # define iscntrl_l(c,l) __iscntrl_l ((c), (l)) # define isdigit_l(c,l) __isdigit_l ((c), (l)) # define islower_l(c,l) __islower_l ((c), (l)) # define isgraph_l(c,l) __isgraph_l ((c), (l)) # define isprint_l(c,l) __isprint_l ((c), (l)) # define ispunct_l(c,l) __ispunct_l ((c), (l)) # define isspace_l(c,l) __isspace_l ((c), (l)) # define isupper_l(c,l) __isupper_l ((c), (l)) # define isxdigit_l(c,l) __isxdigit_l ((c), (l)) # define isblank_l(c,l) __isblank_l ((c), (l)) # ifdef __USE_MISC # define isascii_l(c,l) __isascii_l ((c), (l)) # define toascii_l(c,l) __toascii_l ((c), (l)) # endif # endif /* Not __NO_CTYPE. */ #endif /* Use POSIX 2008. */ __END_DECLS #endif /* ctype.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/dirent.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 5.1.2 Directory Operations */ #ifndef _DIRENT_H #define _DIRENT_H 1 #include __BEGIN_DECLS #include #ifdef __USE_XOPEN # ifndef __ino_t_defined # ifndef __USE_FILE_OFFSET64 typedef __ino_t ino_t; # else typedef __ino64_t ino_t; # endif # define __ino_t_defined # endif # if defined __USE_LARGEFILE64 && !defined __ino64_t_defined typedef __ino64_t ino64_t; # define __ino64_t_defined # endif #endif /* This file defines `struct dirent'. It defines the macro `_DIRENT_HAVE_D_NAMLEN' iff there is a `d_namlen' member that gives the length of `d_name'. It defines the macro `_DIRENT_HAVE_D_RECLEN' iff there is a `d_reclen' member that gives the size of the entire directory entry. It defines the macro `_DIRENT_HAVE_D_OFF' iff there is a `d_off' member that gives the file offset of the next directory entry. It defines the macro `_DIRENT_HAVE_D_TYPE' iff there is a `d_type' member that gives the type of the file. */ #include #if defined __USE_MISC && !defined d_fileno # define d_ino d_fileno /* Backward compatibility. */ #endif /* These macros extract size information from a `struct dirent *'. They may evaluate their argument multiple times, so it must not have side effects. Each of these may involve a relatively costly call to `strlen' on some systems, so these values should be cached. _D_EXACT_NAMLEN (DP) returns the length of DP->d_name, not including its terminating null character. _D_ALLOC_NAMLEN (DP) returns a size at least (_D_EXACT_NAMLEN (DP) + 1); that is, the allocation size needed to hold the DP->d_name string. Use this macro when you don't need the exact length, just an upper bound. This macro is less likely to require calling `strlen' than _D_EXACT_NAMLEN. */ #ifdef _DIRENT_HAVE_D_NAMLEN # define _D_EXACT_NAMLEN(d) ((d)->d_namlen) # define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1) #else # define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name)) # ifdef _DIRENT_HAVE_D_RECLEN # define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0]) # else # define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name : \ _D_EXACT_NAMLEN (d) + 1) # endif #endif #ifdef __USE_MISC /* File types for `d_type'. */ enum { DT_UNKNOWN = 0, # define DT_UNKNOWN DT_UNKNOWN DT_FIFO = 1, # define DT_FIFO DT_FIFO DT_CHR = 2, # define DT_CHR DT_CHR DT_DIR = 4, # define DT_DIR DT_DIR DT_BLK = 6, # define DT_BLK DT_BLK DT_REG = 8, # define DT_REG DT_REG DT_LNK = 10, # define DT_LNK DT_LNK DT_SOCK = 12, # define DT_SOCK DT_SOCK DT_WHT = 14 # define DT_WHT DT_WHT }; /* Convert between stat structure types and directory types. */ # define IFTODT(mode) (((mode) & 0170000) >> 12) # define DTTOIF(dirtype) ((dirtype) << 12) #endif /* This is the data type of directory stream objects. The actual structure is opaque to users. */ typedef struct __dirstream DIR; /* Open a directory stream on NAME. Return a DIR stream on the directory, or NULL if it could not be opened. This function is a possible cancellation point and therefore not marked with __THROW. */ extern DIR *opendir(const char *__name) __nonnull((1)); #ifdef __USE_XOPEN2K8 /* Same as opendir, but open the stream on the file descriptor FD. This function is a possible cancellation point and therefore not marked with __THROW. */ extern DIR *fdopendir(int __fd); #endif /* Close the directory stream DIRP. Return 0 if successful, -1 if not. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int closedir(DIR * __dirp) __nonnull((1)); /* Read a directory entry from DIRP. Return a pointer to a `struct dirent' describing the entry, or NULL for EOF or error. The storage returned may be overwritten by a later readdir call on the same DIR stream. If the Large File Support API is selected we have to use the appropriate interface. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern struct dirent *readdir(DIR * __dirp) __nonnull((1)); #else # ifdef __REDIRECT extern struct dirent *__REDIRECT(readdir, (DIR * __dirp), readdir64) __nonnull((1)); # else # define readdir readdir64 # endif #endif #ifdef __USE_LARGEFILE64 extern struct dirent64 *readdir64(DIR * __dirp) __nonnull((1)); #endif #ifdef __USE_POSIX /* Reentrant version of `readdir'. Return in RESULT a pointer to the next entry. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int readdir_r(DIR * __restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __nonnull((1, 2, 3)); # else # ifdef __REDIRECT extern int __REDIRECT(readdir_r, (DIR * __restrict __dirp, struct dirent * __restrict __entry, struct dirent ** __restrict __result), readdir64_r) __nonnull((1, 2, 3)); # else # define readdir_r readdir64_r # endif # endif # ifdef __USE_LARGEFILE64 extern int readdir64_r(DIR * __restrict __dirp, struct dirent64 *__restrict __entry, struct dirent64 **__restrict __result) __nonnull((1, 2, 3)); # endif #endif /* POSIX or misc */ /* Rewind DIRP to the beginning of the directory. */ extern void rewinddir(DIR * __dirp) __THROW __nonnull((1)); #if defined __USE_MISC || defined __USE_XOPEN # include /* Seek to position POS on DIRP. */ extern void seekdir(DIR * __dirp, long int __pos) __THROW __nonnull((1)); /* Return the current position of DIRP. */ extern long int telldir(DIR * __dirp) __THROW __nonnull((1)); #endif #ifdef __USE_XOPEN2K8 /* Return the file descriptor used by DIRP. */ extern int dirfd(DIR * __dirp) __THROW __nonnull((1)); # if defined __OPTIMIZE__ && defined _DIR_dirfd # define dirfd(dirp) _DIR_dirfd (dirp) # endif # ifdef __USE_MISC # ifndef MAXNAMLEN /* Get the definitions of the POSIX.1 limits. */ # include /* `MAXNAMLEN' is the BSD name for what POSIX calls `NAME_MAX'. */ # ifdef NAME_MAX # define MAXNAMLEN NAME_MAX # else # define MAXNAMLEN 255 # endif # endif # endif # define __need_size_t # include /* Scan the directory DIR, calling SELECTOR on each directory entry. Entries for which SELECT returns nonzero are individually malloc'd, sorted using qsort with CMP, and collected in a malloc'd array in *NAMELIST. Returns the number of entries selected, or -1 on error. This function is a cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int scandir(const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __nonnull((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT(scandir, (const char *__restrict __dir, struct dirent *** __restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)), scandir64) __nonnull((1, 2)); # else # define scandir scandir64 # endif # endif # if defined __USE_GNU && defined __USE_LARGEFILE64 /* This function is like `scandir' but it uses the 64bit dirent structure. Please note that the CMP function must now work with struct dirent64 **. */ extern int scandir64(const char *__restrict __dir, struct dirent64 ***__restrict __namelist, int (*__selector) (const struct dirent64 *), int (*__cmp) (const struct dirent64 **, const struct dirent64 **)) __nonnull((1, 2)); # endif # ifdef __USE_GNU /* Similar to `scandir' but a relative DIR name is interpreted relative to the directory for which DFD is a descriptor. This function is a cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int scandirat(int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __nonnull((2, 3)); # else # ifdef __REDIRECT extern int __REDIRECT(scandirat, (int __dfd, const char *__restrict __dir, struct dirent *** __restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)), scandirat64) __nonnull((2, 3)); # else # define scandirat scandirat64 # endif # endif /* This function is like `scandir' but it uses the 64bit dirent structure. Please note that the CMP function must now work with struct dirent64 **. */ extern int scandirat64(int __dfd, const char *__restrict __dir, struct dirent64 ***__restrict __namelist, int (*__selector) (const struct dirent64 *), int (*__cmp) (const struct dirent64 **, const struct dirent64 **)) __nonnull((2, 3)); # endif /* Function to compare two `struct dirent's alphabetically. */ # ifndef __USE_FILE_OFFSET64 extern int alphasort(const struct dirent **__e1, const struct dirent **__e2) __THROW __attribute_pure__ __nonnull((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT_NTH(alphasort, (const struct dirent ** __e1, const struct dirent ** __e2), alphasort64) __attribute_pure__ __nonnull((1, 2)); # else # define alphasort alphasort64 # endif # endif # if defined __USE_GNU && defined __USE_LARGEFILE64 extern int alphasort64(const struct dirent64 **__e1, const struct dirent64 **__e2) __THROW __attribute_pure__ __nonnull((1, 2)); # endif #endif /* Use XPG7. */ #ifdef __USE_MISC /* Read directory entries from FD into BUF, reading at most NBYTES. Reading starts at offset *BASEP, and *BASEP is updated with the new position after reading. Returns the number of bytes read; zero when at end of directory; or -1 for errors. */ # ifndef __USE_FILE_OFFSET64 extern __ssize_t getdirentries(int __fd, char *__restrict __buf, size_t __nbytes, __off_t * __restrict __basep) __THROW __nonnull((2, 4)); # else # ifdef __REDIRECT extern __ssize_t __REDIRECT_NTH(getdirentries, (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t * __restrict __basep), getdirentries64) __nonnull((2, 4)); # else # define getdirentries getdirentries64 # endif # endif # ifdef __USE_LARGEFILE64 extern __ssize_t getdirentries64(int __fd, char *__restrict __buf, size_t __nbytes, __off64_t * __restrict __basep) __THROW __nonnull((2, 4)); # endif #endif /* Use misc. */ #ifdef __USE_GNU /* Function to compare two `struct dirent's by name & version. */ # ifndef __USE_FILE_OFFSET64 extern int versionsort(const struct dirent **__e1, const struct dirent **__e2) __THROW __attribute_pure__ __nonnull((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT_NTH(versionsort, (const struct dirent ** __e1, const struct dirent ** __e2), versionsort64) __attribute_pure__ __nonnull((1, 2)); # else # define versionsort versionsort64 # endif # endif # ifdef __USE_LARGEFILE64 extern int versionsort64(const struct dirent64 **__e1, const struct dirent64 **__e2) __THROW __attribute_pure__ __nonnull((1, 2)); # endif #endif /* Use GNU. */ __END_DECLS #endif /* dirent.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/dlfcn.h ================================================ /* User functions for run-time dynamic loading. Copyright (C) 1995-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _DLFCN_H #define _DLFCN_H 1 #include #define __need_size_t #include /* Collect various system dependent definitions and declarations. */ #include #ifdef __USE_GNU /* If the first argument of `dlsym' or `dlvsym' is set to RTLD_NEXT the run-time address of the symbol called NAME in the next shared object is returned. The "next" relation is defined by the order the shared objects were loaded. */ # define RTLD_NEXT ((void *) -1l) /* If the first argument to `dlsym' or `dlvsym' is set to RTLD_DEFAULT the run-time address of the symbol called NAME in the global scope is returned. */ # define RTLD_DEFAULT ((void *) 0) /* Type for namespace indeces. */ typedef long int Lmid_t; /* Special namespace ID values. */ # define LM_ID_BASE 0 /* Initial namespace. */ # define LM_ID_NEWLM -1 /* For dlmopen: request new namespace. */ #endif __BEGIN_DECLS /* Open the shared object FILE and map it in; return a handle that can be passed to `dlsym' to get symbol values from it. */ extern void *dlopen(const char *__file, int __mode) __THROWNL; /* Unmap and close a shared object opened by `dlopen'. The handle cannot be used again after calling `dlclose'. */ extern int dlclose(void *__handle) __THROWNL __nonnull((1)); /* Find the run-time address in the shared object HANDLE refers to of the symbol called NAME. */ extern void *dlsym(void *__restrict __handle, const char *__restrict __name) __THROW __nonnull((2)); #ifdef __USE_GNU /* Like `dlopen', but request object to be allocated in a new namespace. */ extern void *dlmopen(Lmid_t __nsid, const char *__file, int __mode) __THROWNL; /* Find the run-time address in the shared object HANDLE refers to of the symbol called NAME with VERSION. */ extern void *dlvsym(void *__restrict __handle, const char *__restrict __name, const char *__restrict __version) __THROW __nonnull((2, 3)); #endif /* When any of the above functions fails, call this function to return a string describing the error. Each call resets the error string so that a following call returns null. */ extern char *dlerror(void) __THROW; #ifdef __USE_GNU /* Structure containing information about object searched using `dladdr'. */ typedef struct { const char *dli_fname; /* File name of defining object. */ void *dli_fbase; /* Load address of that object. */ const char *dli_sname; /* Name of nearest symbol. */ void *dli_saddr; /* Exact value of nearest symbol. */ } Dl_info; /* Fill in *INFO with the following information about ADDRESS. Returns 0 iff no shared object's segments contain that address. */ extern int dladdr(const void *__address, Dl_info * __info) __THROW __nonnull((2)); /* Same as `dladdr', but additionally sets *EXTRA_INFO according to FLAGS. */ extern int dladdr1(const void *__address, Dl_info * __info, void **__extra_info, int __flags) __THROW __nonnull((2)); /* These are the possible values for the FLAGS argument to `dladdr1'. This indicates what extra information is stored at *EXTRA_INFO. It may also be zero, in which case the EXTRA_INFO argument is not used. */ enum { /* Matching symbol table entry (const ElfNN_Sym *). */ RTLD_DL_SYMENT = 1, /* The object containing the address (struct link_map *). */ RTLD_DL_LINKMAP = 2 }; /* Get information about the shared object HANDLE refers to. REQUEST is from among the values below, and determines the use of ARG. On success, returns zero. On failure, returns -1 and records an error message to be fetched with `dlerror'. */ extern int dlinfo(void *__restrict __handle, int __request, void *__restrict __arg) __THROW __nonnull((1, 3)); /* These are the possible values for the REQUEST argument to `dlinfo'. */ enum { /* Treat ARG as `lmid_t *'; store namespace ID for HANDLE there. */ RTLD_DI_LMID = 1, /* Treat ARG as `struct link_map **'; store the `struct link_map *' for HANDLE there. */ RTLD_DI_LINKMAP = 2, RTLD_DI_CONFIGADDR = 3, /* Unsupported, defined by Solaris. */ /* Treat ARG as `Dl_serinfo *' (see below), and fill in to describe the directories that will be searched for dependencies of this object. RTLD_DI_SERINFOSIZE fills in just the `dls_cnt' and `dls_size' entries to indicate the size of the buffer that must be passed to RTLD_DI_SERINFO to fill in the full information. */ RTLD_DI_SERINFO = 4, RTLD_DI_SERINFOSIZE = 5, /* Treat ARG as `char *', and store there the directory name used to expand $ORIGIN in this shared object's dependency file names. */ RTLD_DI_ORIGIN = 6, RTLD_DI_PROFILENAME = 7, /* Unsupported, defined by Solaris. */ RTLD_DI_PROFILEOUT = 8, /* Unsupported, defined by Solaris. */ /* Treat ARG as `size_t *', and store there the TLS module ID of this object's PT_TLS segment, as used in TLS relocations; store zero if this object does not define a PT_TLS segment. */ RTLD_DI_TLS_MODID = 9, /* Treat ARG as `void **', and store there a pointer to the calling thread's TLS block corresponding to this object's PT_TLS segment. Store a null pointer if this object does not define a PT_TLS segment, or if the calling thread has not allocated a block for it. */ RTLD_DI_TLS_DATA = 10, RTLD_DI_MAX = 10 }; /* This is the type of elements in `Dl_serinfo', below. The `dls_name' member points to space in the buffer passed to `dlinfo'. */ typedef struct { char *dls_name; /* Name of library search path directory. */ unsigned int dls_flags; /* Indicates where this directory came from. */ } Dl_serpath; /* This is the structure that must be passed (by reference) to `dlinfo' for the RTLD_DI_SERINFO and RTLD_DI_SERINFOSIZE requests. */ typedef struct { size_t dls_size; /* Size in bytes of the whole buffer. */ unsigned int dls_cnt; /* Number of elements in `dls_serpath'. */ Dl_serpath dls_serpath[1]; /* Actually longer, dls_cnt elements. */ } Dl_serinfo; #endif /* __USE_GNU */ __END_DECLS #endif /* dlfcn.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/endian.h ================================================ /* Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _ENDIAN_H #define _ENDIAN_H 1 #include /* Definitions for byte order, according to significance of bytes, from low addresses to high addresses. The value is what you get by putting '4' in the most significant byte, '3' in the second most significant byte, '2' in the second least significant byte, and '1' in the least significant byte, and then writing down one digit for each byte, starting with the byte at the lowest address at the left, and proceeding to the byte with the highest address at the right. */ #define __LITTLE_ENDIAN 1234 #define __BIG_ENDIAN 4321 #define __PDP_ENDIAN 3412 /* This file defines `__BYTE_ORDER' for the particular machine. */ #include /* Some machines may need to use a different endianness for floating point values. */ #ifndef __FLOAT_WORD_ORDER # define __FLOAT_WORD_ORDER __BYTE_ORDER #endif #ifdef __USE_MISC # define LITTLE_ENDIAN __LITTLE_ENDIAN # define BIG_ENDIAN __BIG_ENDIAN # define PDP_ENDIAN __PDP_ENDIAN # define BYTE_ORDER __BYTE_ORDER #endif #if __BYTE_ORDER == __LITTLE_ENDIAN # define __LONG_LONG_PAIR(HI, LO) LO, HI #elif __BYTE_ORDER == __BIG_ENDIAN # define __LONG_LONG_PAIR(HI, LO) HI, LO #endif #if defined __USE_MISC && !defined __ASSEMBLER__ /* Conversion interfaces. */ # include # if __BYTE_ORDER == __LITTLE_ENDIAN # define htobe16(x) __bswap_16 (x) # define htole16(x) (x) # define be16toh(x) __bswap_16 (x) # define le16toh(x) (x) # define htobe32(x) __bswap_32 (x) # define htole32(x) (x) # define be32toh(x) __bswap_32 (x) # define le32toh(x) (x) # define htobe64(x) __bswap_64 (x) # define htole64(x) (x) # define be64toh(x) __bswap_64 (x) # define le64toh(x) (x) # else # define htobe16(x) (x) # define htole16(x) __bswap_16 (x) # define be16toh(x) (x) # define le16toh(x) __bswap_16 (x) # define htobe32(x) (x) # define htole32(x) __bswap_32 (x) # define be32toh(x) (x) # define le32toh(x) __bswap_32 (x) # define htobe64(x) (x) # define htole64(x) __bswap_64 (x) # define be64toh(x) (x) # define le64toh(x) __bswap_64 (x) # endif #endif #endif /* endian.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/errno.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.5 Errors */ #ifndef _ERRNO_H /* The includer defined __need_Emath if he wants only the definitions of EDOM and ERANGE, and not everything else. */ #ifndef __need_Emath # define _ERRNO_H 1 # include #endif __BEGIN_DECLS /* Get the error number constants from the system-specific file. This file will test __need_Emath and _ERRNO_H. */ #include #undef __need_Emath #ifdef _ERRNO_H /* Declare the `errno' variable, unless it's defined as a macro by bits/errno.h. This is the case in GNU, where it is a per-thread variable. This redeclaration using the macro still works, but it will be a function declaration without a prototype and may trigger a -Wstrict-prototypes warning. */ #ifndef errno extern int errno; #endif #ifdef __USE_GNU /* The full and simple forms of the name with which the program was invoked. These variables are set up automatically at startup based on the value of ARGV[0] (this works only if you use GNU ld). */ extern char *program_invocation_name, *program_invocation_short_name; #endif /* __USE_GNU */ #endif /* _ERRNO_H */ __END_DECLS #endif /* _ERRNO_H */ /* The Hurd defines `error_t' as an enumerated type so that printing `error_t' values in the debugger shows the names. We might need this definition sometimes even if this file was included before. */ #if defined __USE_GNU || defined __need_error_t # ifndef __error_t_defined typedef int error_t; # define __error_t_defined 1 # endif # undef __need_error_t #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/execinfo.h ================================================ /* Copyright (C) 1998-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _EXECINFO_H #define _EXECINFO_H 1 #include __BEGIN_DECLS /* Store up to SIZE return address of the current program state in ARRAY and return the exact number of values stored. */ extern int backtrace(void **__array, int __size) __nonnull((1)); /* Return names of functions from the backtrace list in ARRAY in a newly malloc()ed memory block. */ extern char **backtrace_symbols(void *const *__array, int __size) __THROW __nonnull((1)); /* This function is similar to backtrace_symbols() but it writes the result immediately to a file. */ extern void backtrace_symbols_fd(void *const *__array, int __size, int __fd) __THROW __nonnull((1)); __END_DECLS #endif /* execinfo.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/fcntl.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 6.5 File Control Operations */ #ifndef _FCNTL_H #define _FCNTL_H 1 #include /* This must be early so can define types winningly. */ __BEGIN_DECLS /* Get __mode_t, __dev_t and __off_t .*/ #include /* Get the definitions of O_*, F_*, FD_*: all the numbers and flag bits for `open', `fcntl', et al. */ #include /* Detect if open needs mode as a third argument (or for openat as a fourth argument). */ #ifdef __O_TMPFILE # define __OPEN_NEEDS_MODE(oflag) \ (((oflag) & O_CREAT) != 0 || ((oflag) & __O_TMPFILE) == __O_TMPFILE) #else # define __OPEN_NEEDS_MODE(oflag) (((oflag) & O_CREAT) != 0) #endif /* POSIX.1-2001 specifies that these types are defined by . Earlier POSIX standards permitted any type ending in `_t' to be defined by any POSIX header, so we don't conditionalize the definitions here. */ #ifndef __mode_t_defined typedef __mode_t mode_t; # define __mode_t_defined #endif #ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; # define __off64_t_defined #endif #ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif /* For XPG all symbols from should also be available. */ #if defined __USE_XOPEN || defined __USE_XOPEN2K8 # define __need_timespec # include # include # define S_IFMT __S_IFMT # define S_IFDIR __S_IFDIR # define S_IFCHR __S_IFCHR # define S_IFBLK __S_IFBLK # define S_IFREG __S_IFREG # ifdef __S_IFIFO # define S_IFIFO __S_IFIFO # endif # ifdef __S_IFLNK # define S_IFLNK __S_IFLNK # endif # if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) && defined __S_IFSOCK # define S_IFSOCK __S_IFSOCK # endif /* Protection bits. */ # define S_ISUID __S_ISUID /* Set user ID on execution. */ # define S_ISGID __S_ISGID /* Set group ID on execution. */ # if defined __USE_MISC || defined __USE_XOPEN /* Save swapped text after use (sticky bit). This is pretty well obsolete. */ # define S_ISVTX __S_ISVTX # endif # define S_IRUSR __S_IREAD /* Read by owner. */ # define S_IWUSR __S_IWRITE /* Write by owner. */ # define S_IXUSR __S_IEXEC /* Execute by owner. */ /* Read, write, and execute by owner. */ # define S_IRWXU (__S_IREAD|__S_IWRITE|__S_IEXEC) # define S_IRGRP (S_IRUSR >> 3) /* Read by group. */ # define S_IWGRP (S_IWUSR >> 3) /* Write by group. */ # define S_IXGRP (S_IXUSR >> 3) /* Execute by group. */ /* Read, write, and execute by group. */ # define S_IRWXG (S_IRWXU >> 3) # define S_IROTH (S_IRGRP >> 3) /* Read by others. */ # define S_IWOTH (S_IWGRP >> 3) /* Write by others. */ # define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */ /* Read, write, and execute by others. */ # define S_IRWXO (S_IRWXG >> 3) #endif #ifdef __USE_MISC # ifndef R_OK /* Verbatim from . Ugh. */ /* Values for the second argument to access. These may be OR'd together. */ # define R_OK 4 /* Test for read permission. */ # define W_OK 2 /* Test for write permission. */ # define X_OK 1 /* Test for execute permission. */ # define F_OK 0 /* Test for existence. */ # endif #endif /* Use misc. */ /* XPG wants the following symbols. has the same definitions. */ #if defined __USE_XOPEN || defined __USE_XOPEN2K8 # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Seek from end of file. */ #endif /* XPG */ /* The constants AT_REMOVEDIR and AT_EACCESS have the same value. AT_EASSESS is meaningful only to faccessat, while AT_REMOVEDIR is meaningful only to unlinkat. The two functions do completely different things and therefore, the flags can be allowed to overlap. For example, passing AT_REMOVEDIR to faccessat would be undefined behavior and thus treating it equivalent to AT_EACCESS is valid undefined behavior. */ #ifdef __USE_ATFILE # define AT_FDCWD -100 /* Special value used to indicate the *at functions should use the current working directory. */ # define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */ # define AT_REMOVEDIR 0x200 /* Remove directory instead of unlinking file. */ # define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ # ifdef __USE_GNU # define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal. */ # define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname. */ # endif # define AT_EACCESS 0x200 /* Test access permitted for effective IDs, not real IDs. */ #endif /* Do the file control operation described by CMD on FD. The remaining arguments are interpreted depending on CMD. This function is a cancellation point and therefore not marked with __THROW. */ extern int fcntl(int __fd, int __cmd, ...); /* Open FILE and return a new file descriptor for it, or -1 on error. OFLAG determines the type of access used. If O_CREAT or O_TMPFILE is set in OFLAG, the third argument is taken as a `mode_t', the mode of the created file. This function is a cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int open(const char *__file, int __oflag, ...) __nonnull((1)); #else # ifdef __REDIRECT extern int __REDIRECT(open, (const char *__file, int __oflag, ...), open64) __nonnull((1)); # else # define open open64 # endif #endif #ifdef __USE_LARGEFILE64 extern int open64(const char *__file, int __oflag, ...) __nonnull((1)); #endif #ifdef __USE_ATFILE /* Similar to `open' but a relative path name is interpreted relative to the directory for which FD is a descriptor. NOTE: some other `openat' implementation support additional functionality through this interface, especially using the O_XATTR flag. This is not yet supported here. This function is a cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int openat(int __fd, const char *__file, int __oflag, ...) __nonnull((2)); # else # ifdef __REDIRECT extern int __REDIRECT(openat, (int __fd, const char *__file, int __oflag, ...), openat64) __nonnull((2)); # else # define openat openat64 # endif # endif # ifdef __USE_LARGEFILE64 extern int openat64(int __fd, const char *__file, int __oflag, ...) __nonnull((2)); # endif #endif /* Create and open FILE, with mode MODE. This takes an `int' MODE argument because that is what `mode_t' will be widened to. This function is a cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int creat(const char *__file, mode_t __mode) __nonnull((1)); #else # ifdef __REDIRECT extern int __REDIRECT(creat, (const char *__file, mode_t __mode), creat64) __nonnull((1)); # else # define creat creat64 # endif #endif #ifdef __USE_LARGEFILE64 extern int creat64(const char *__file, mode_t __mode) __nonnull((1)); #endif #if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \ && !defined __USE_POSIX)) /* NOTE: These declarations also appear in ; be sure to keep both files consistent. Some systems have them there and some here, and some software depends on the macros being defined without including both. */ /* `lockf' is a simpler interface to the locking facilities of `fcntl'. LEN is always relative to the current file position. The CMD argument is one of the following. */ # define F_ULOCK 0 /* Unlock a previously locked region. */ # define F_LOCK 1 /* Lock a region for exclusive use. */ # define F_TLOCK 2 /* Test and lock a region for exclusive use. */ # define F_TEST 3 /* Test a region for other processes locks. */ # ifndef __USE_FILE_OFFSET64 extern int lockf(int __fd, int __cmd, off_t __len); # else # ifdef __REDIRECT extern int __REDIRECT(lockf, (int __fd, int __cmd, __off64_t __len), lockf64); # else # define lockf lockf64 # endif # endif # ifdef __USE_LARGEFILE64 extern int lockf64(int __fd, int __cmd, off64_t __len); # endif #endif #ifdef __USE_XOPEN2K /* Advice the system about the expected behaviour of the application with respect to the file associated with FD. */ # ifndef __USE_FILE_OFFSET64 extern int posix_fadvise(int __fd, off_t __offset, off_t __len, int __advise) __THROW; # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(posix_fadvise, (int __fd, __off64_t __offset, __off64_t __len, int __advise), posix_fadvise64); # else # define posix_fadvise posix_fadvise64 # endif # endif # ifdef __USE_LARGEFILE64 extern int posix_fadvise64(int __fd, off64_t __offset, off64_t __len, int __advise) __THROW; # endif /* Reserve storage for the data of the file associated with FD. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int posix_fallocate(int __fd, off_t __offset, off_t __len); # else # ifdef __REDIRECT extern int __REDIRECT(posix_fallocate, (int __fd, __off64_t __offset, __off64_t __len), posix_fallocate64); # else # define posix_fallocate posix_fallocate64 # endif # endif # ifdef __USE_LARGEFILE64 extern int posix_fallocate64(int __fd, off64_t __offset, off64_t __len); # endif #endif /* Define some inlines helping to catch common problems. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function \ && defined __va_arg_pack_len # include #endif __END_DECLS #endif /* fcntl.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/features.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _FEATURES_H #define _FEATURES_H 1 /* These are defined by the user (or the compiler) to specify the desired environment: __STRICT_ANSI__ ISO Standard C. _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. _ISOC11_SOURCE Extensions to ISO C99 from ISO C11. _POSIX_SOURCE IEEE Std 1003.1. _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; if >=199309L, add IEEE Std 1003.1b-1993; if >=199506L, add IEEE Std 1003.1c-1995; if >=200112L, all of IEEE 1003.1-2004 if >=200809L, all of IEEE 1003.1-2008 _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if Single Unix conformance is wanted, to 600 for the sixth revision, to 700 for the seventh revision. _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. _LARGEFILE_SOURCE Some more functions for correct standard I/O. _LARGEFILE64_SOURCE Additional functionality from LFS for large files. _FILE_OFFSET_BITS=N Select default filesystem interface. _ATFILE_SOURCE Additional *at interfaces. _GNU_SOURCE All of the above, plus GNU extensions. _DEFAULT_SOURCE The default set of features (taking precedence over __STRICT_ANSI__). _REENTRANT Select additionally reentrant object. _THREAD_SAFE Same as _REENTRANT, often used by other systems. _FORTIFY_SOURCE If set to numeric value > 0 additional security measures are defined, according to level. The `-ansi' switch to the GNU C compiler, and standards conformance options such as `-std=c99', define __STRICT_ANSI__. If none of these are defined, or if _DEFAULT_SOURCE is defined, the default is to have _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to 200809L, as well as enabling miscellaneous functions from BSD and SVID. If more than one of these are defined, they accumulate. For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE together give you ISO C, 1003.1, and 1003.2, but nothing else. These are defined by this file and are used by the header files to decide what to declare or define: __USE_ISOC11 Define ISO C11 things. __USE_ISOC99 Define ISO C99 things. __USE_ISOC95 Define ISO C90 AMD1 (C95) things. __USE_POSIX Define IEEE Std 1003.1 things. __USE_POSIX2 Define IEEE Std 1003.2 things. __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things. __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things. __USE_XOPEN Define XPG things. __USE_XOPEN_EXTENDED Define X/Open Unix things. __USE_UNIX98 Define Single Unix V2 things. __USE_XOPEN2K Define XPG6 things. __USE_XOPEN2KXSI Define XPG6 XSI things. __USE_XOPEN2K8 Define XPG7 things. __USE_XOPEN2K8XSI Define XPG7 XSI things. __USE_LARGEFILE Define correct standard I/O things. __USE_LARGEFILE64 Define LFS things with separate names. __USE_FILE_OFFSET64 Define 64bit interface as default. __USE_MISC Define things from 4.3BSD or System V Unix. __USE_ATFILE Define *at interfaces and AT_* constants for them. __USE_GNU Define GNU extensions. __USE_REENTRANT Define reentrant/thread-safe *_r functions. __USE_FORTIFY_LEVEL Additional security measures used, according to level. The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are defined by this file unconditionally. `__GNU_LIBRARY__' is provided only for compatibility. All new code should use the other symbols to test for features. All macros listed above as possibly being defined by this file are explicitly undefined if they are not explicitly defined. Feature-test macros that are not defined by the user or compiler but are implied by the other feature-test macros defined (or by the lack of any definitions) are defined by the file. */ /* Undefine everything, so we get a clean slate. */ #undef __USE_ISOC11 #undef __USE_ISOC99 #undef __USE_ISOC95 #undef __USE_ISOCXX11 #undef __USE_POSIX #undef __USE_POSIX2 #undef __USE_POSIX199309 #undef __USE_POSIX199506 #undef __USE_XOPEN #undef __USE_XOPEN_EXTENDED #undef __USE_UNIX98 #undef __USE_XOPEN2K #undef __USE_XOPEN2KXSI #undef __USE_XOPEN2K8 #undef __USE_XOPEN2K8XSI #undef __USE_LARGEFILE #undef __USE_LARGEFILE64 #undef __USE_FILE_OFFSET64 #undef __USE_MISC #undef __USE_ATFILE #undef __USE_GNU #undef __USE_REENTRANT #undef __USE_FORTIFY_LEVEL #undef __KERNEL_STRICT_NAMES /* Suppress kernel-name space pollution unless user expressedly asks for it. */ #ifndef _LOOSE_KERNEL_NAMES # define __KERNEL_STRICT_NAMES #endif /* Convenience macros to test the versions of glibc and gcc. Use them like this: #if __GNUC_PREREQ (2,8) ... code requiring gcc 2.8 or later ... #endif Note - they won't work for gcc1 or glibc1, since the _MINOR macros were not defined then. */ #if defined __GNUC__ && defined __GNUC_MINOR__ # define __GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #else # define __GNUC_PREREQ(maj, min) 0 #endif /* _BSD_SOURCE and _SVID_SOURCE are deprecated aliases for _DEFAULT_SOURCE. If _DEFAULT_SOURCE is present we do not issue a warning; the expectation is that the source is being transitioned to use the new macro. */ #if (defined _BSD_SOURCE || defined _SVID_SOURCE) \ && !defined _DEFAULT_SOURCE /* # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" */ # undef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 #endif /* If _GNU_SOURCE was defined by the user, turn on all the other features. */ #ifdef _GNU_SOURCE # undef _ISOC95_SOURCE # define _ISOC95_SOURCE 1 # undef _ISOC99_SOURCE # define _ISOC99_SOURCE 1 # undef _ISOC11_SOURCE # define _ISOC11_SOURCE 1 # undef _POSIX_SOURCE # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 200809L # undef _XOPEN_SOURCE # define _XOPEN_SOURCE 700 # undef _XOPEN_SOURCE_EXTENDED # define _XOPEN_SOURCE_EXTENDED 1 # undef _LARGEFILE64_SOURCE # define _LARGEFILE64_SOURCE 1 # undef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 # undef _ATFILE_SOURCE # define _ATFILE_SOURCE 1 #endif /* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined, define _DEFAULT_SOURCE. */ #if (defined _DEFAULT_SOURCE \ || (!defined __STRICT_ANSI__ \ && !defined _ISOC99_SOURCE \ && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE \ && !defined _XOPEN_SOURCE)) # undef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 #endif /* This is to enable the ISO C11 extension. */ #if (defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) # define __USE_ISOC11 1 #endif /* This is to enable the ISO C99 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) # define __USE_ISOC99 1 #endif /* This is to enable the ISO C90 Amendment 1:1995 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L)) # define __USE_ISOC95 1 #endif /* This is to enable compatibility for ISO C++11. So far g++ does not provide a macro. Check the temporary macro for now, too. */ #if ((defined __cplusplus && __cplusplus >= 201103L) \ || defined __GXX_EXPERIMENTAL_CXX0X__) # define __USE_ISOCXX11 1 #endif /* If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE is defined, use POSIX.1-2008 (or another version depending on _XOPEN_SOURCE). */ #ifdef _DEFAULT_SOURCE # if !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE # define __USE_POSIX_IMPLICITLY 1 # endif # undef _POSIX_SOURCE # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 200809L #endif #if ((!defined __STRICT_ANSI__ || (_XOPEN_SOURCE - 0) >= 500) && \ !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE) # define _POSIX_SOURCE 1 # if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500 # define _POSIX_C_SOURCE 2 # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 600 # define _POSIX_C_SOURCE 199506L # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 700 # define _POSIX_C_SOURCE 200112L # else # define _POSIX_C_SOURCE 200809L # endif # define __USE_POSIX_IMPLICITLY 1 #endif #if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE # define __USE_POSIX 1 #endif #if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE # define __USE_POSIX2 1 #endif #if (_POSIX_C_SOURCE - 0) >= 199309L # define __USE_POSIX199309 1 #endif #if (_POSIX_C_SOURCE - 0) >= 199506L # define __USE_POSIX199506 1 #endif #if (_POSIX_C_SOURCE - 0) >= 200112L # define __USE_XOPEN2K 1 # undef __USE_ISOC95 # define __USE_ISOC95 1 # undef __USE_ISOC99 # define __USE_ISOC99 1 #endif #if (_POSIX_C_SOURCE - 0) >= 200809L # define __USE_XOPEN2K8 1 # undef _ATFILE_SOURCE # define _ATFILE_SOURCE 1 #endif #ifdef _XOPEN_SOURCE # define __USE_XOPEN 1 # if (_XOPEN_SOURCE - 0) >= 500 # define __USE_XOPEN_EXTENDED 1 # define __USE_UNIX98 1 # undef _LARGEFILE_SOURCE # define _LARGEFILE_SOURCE 1 # if (_XOPEN_SOURCE - 0) >= 600 # if (_XOPEN_SOURCE - 0) >= 700 # define __USE_XOPEN2K8 1 # define __USE_XOPEN2K8XSI 1 # endif # define __USE_XOPEN2K 1 # define __USE_XOPEN2KXSI 1 # undef __USE_ISOC95 # define __USE_ISOC95 1 # undef __USE_ISOC99 # define __USE_ISOC99 1 # endif # else # ifdef _XOPEN_SOURCE_EXTENDED # define __USE_XOPEN_EXTENDED 1 # endif # endif #endif #ifdef _LARGEFILE_SOURCE # define __USE_LARGEFILE 1 #endif #ifdef _LARGEFILE64_SOURCE # define __USE_LARGEFILE64 1 #endif #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 # define __USE_FILE_OFFSET64 1 #endif #if defined _DEFAULT_SOURCE # define __USE_MISC 1 #endif #ifdef _ATFILE_SOURCE # define __USE_ATFILE 1 #endif #ifdef _GNU_SOURCE # define __USE_GNU 1 #endif #if defined _REENTRANT || defined _THREAD_SAFE # define __USE_REENTRANT 1 #endif #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 # if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0 # warning _FORTIFY_SOURCE requires compiling with optimization (-O) # elif !__GNUC_PREREQ (4, 1) # warning _FORTIFY_SOURCE requires GCC 4.1 or later # elif _FORTIFY_SOURCE > 1 # define __USE_FORTIFY_LEVEL 2 # else # define __USE_FORTIFY_LEVEL 1 # endif #endif #ifndef __USE_FORTIFY_LEVEL # define __USE_FORTIFY_LEVEL 0 #endif /* Get definitions of __STDC_* predefined macros, if the compiler has not preincluded this header automatically. */ #include /* This macro indicates that the installed library is the GNU C Library. For historic reasons the value now is 6 and this will stay from now on. The use of this variable is deprecated. Use __GLIBC__ and __GLIBC_MINOR__ now (see below) when you want to test for a specific GNU C library version and use the values in to get the sonames of the shared libraries. */ #undef __GNU_LIBRARY__ #define __GNU_LIBRARY__ 6 /* Major and minor version number of the GNU C library package. Use these macros to test for features in specific releases. */ #define __GLIBC__ 2 #define __GLIBC_MINOR__ 22 #define __GLIBC_PREREQ(maj, min) \ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) /* This is here only because every header file already includes this one. */ #ifndef __ASSEMBLER__ # ifndef _SYS_CDEFS_H # include # endif /* If we don't have __REDIRECT, prototypes will be missing if __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */ # if defined __USE_FILE_OFFSET64 && !defined __REDIRECT # define __USE_LARGEFILE 1 # define __USE_LARGEFILE64 1 # endif #endif /* !ASSEMBLER */ /* Decide whether we can define 'extern inline' functions in headers. */ #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \ && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \ && defined __extern_inline # define __USE_EXTERN_INLINES 1 #endif /* This is here only because every header file already includes this one. Get the definitions of all the appropriate `__stub_FUNCTION' symbols. contains `#define __stub_FUNCTION' when FUNCTION is a stub that will always return failure (and set errno to ENOSYS). */ #include #endif /* features.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/fts.h ================================================ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)fts.h 8.3 (Berkeley) 8/14/94 */ #ifndef _FTS_H #define _FTS_H 1 #include #include /* The fts interface is incompatible with the LFS interface which transparently uses the 64-bit file access functions. */ #ifdef __USE_FILE_OFFSET64 # error " cannot be used with -D_FILE_OFFSET_BITS==64" #endif typedef struct { struct _ftsent *fts_cur; /* current node */ struct _ftsent *fts_child; /* linked list of children */ struct _ftsent **fts_array; /* sort array */ dev_t fts_dev; /* starting device # */ char *fts_path; /* path for this descent */ int fts_rfd; /* fd for root */ int fts_pathlen; /* sizeof(path) */ int fts_nitems; /* elements in the sort array */ int (*fts_compar) (const void *, const void *); /* compare fn */ #define FTS_COMFOLLOW 0x0001 /* follow command line symlinks */ #define FTS_LOGICAL 0x0002 /* logical walk */ #define FTS_NOCHDIR 0x0004 /* don't change directories */ #define FTS_NOSTAT 0x0008 /* don't get stat info */ #define FTS_PHYSICAL 0x0010 /* physical walk */ #define FTS_SEEDOT 0x0020 /* return dot and dot-dot */ #define FTS_XDEV 0x0040 /* don't cross devices */ #define FTS_WHITEOUT 0x0080 /* return whiteout information */ #define FTS_OPTIONMASK 0x00ff /* valid user option mask */ #define FTS_NAMEONLY 0x0100 /* (private) child names only */ #define FTS_STOP 0x0200 /* (private) unrecoverable error */ int fts_options; /* fts_open options, global flags */ } FTS; typedef struct _ftsent { struct _ftsent *fts_cycle; /* cycle node */ struct _ftsent *fts_parent; /* parent directory */ struct _ftsent *fts_link; /* next file in directory */ long fts_number; /* local numeric value */ void *fts_pointer; /* local address value */ char *fts_accpath; /* access path */ char *fts_path; /* root path */ int fts_errno; /* errno for this node */ int fts_symfd; /* fd for symlink */ u_short fts_pathlen; /* strlen(fts_path) */ u_short fts_namelen; /* strlen(fts_name) */ ino_t fts_ino; /* inode */ dev_t fts_dev; /* device */ nlink_t fts_nlink; /* link count */ #define FTS_ROOTPARENTLEVEL -1 #define FTS_ROOTLEVEL 0 short fts_level; /* depth (-1 to N) */ #define FTS_D 1 /* preorder directory */ #define FTS_DC 2 /* directory that causes cycles */ #define FTS_DEFAULT 3 /* none of the above */ #define FTS_DNR 4 /* unreadable directory */ #define FTS_DOT 5 /* dot or dot-dot */ #define FTS_DP 6 /* postorder directory */ #define FTS_ERR 7 /* error; errno is set */ #define FTS_F 8 /* regular file */ #define FTS_INIT 9 /* initialized only */ #define FTS_NS 10 /* stat(2) failed */ #define FTS_NSOK 11 /* no stat(2) requested */ #define FTS_SL 12 /* symbolic link */ #define FTS_SLNONE 13 /* symbolic link without target */ #define FTS_W 14 /* whiteout object */ u_short fts_info; /* user flags for FTSENT structure */ #define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */ #define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */ u_short fts_flags; /* private flags for FTSENT structure */ #define FTS_AGAIN 1 /* read node again */ #define FTS_FOLLOW 2 /* follow symbolic link */ #define FTS_NOINSTR 3 /* no instructions */ #define FTS_SKIP 4 /* discard node */ u_short fts_instr; /* fts_set() instructions */ struct stat *fts_statp; /* stat(2) information */ char fts_name[1]; /* file name */ } FTSENT; __BEGIN_DECLS FTSENT * fts_children(FTS *, int); int fts_close(FTS *); FTS *fts_open(char *const *, int, int (*)(const FTSENT **, const FTSENT **)); FTSENT *fts_read(FTS *); int fts_set(FTS *, FTSENT *, int) __THROW; __END_DECLS #endif /* fts.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/getopt.h ================================================ /* Declarations for getopt. Copyright (C) 1989-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifndef __THROW # ifndef __GNUC_PREREQ # define __GNUC_PREREQ(maj, min) (0) # endif # if defined __cplusplus && __GNUC_PREREQ (2,8) # define __THROW throw () # else # define __THROW # endif #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt(int ___argc, char *const *___argv, const char *__shortopts) __THROW; # if defined __need_getopt && defined __USE_POSIX2 \ && !defined __USE_POSIX_IMPLICITLY && !defined __USE_GNU /* The GNU getopt has more functionality than the standard version. The additional functionality can be disable at runtime. This redirection helps to also do this at runtime. */ # ifdef __REDIRECT extern int __REDIRECT_NTH(getopt, (int ___argc, char *const *___argv, const char *__shortopts), __posix_getopt); # else extern int __posix_getopt(int ___argc, char *const *___argv, const char *__shortopts) __THROW; # define getopt __posix_getopt # endif # endif #else /* not __GNU_LIBRARY__ */ extern int getopt(); #endif /* __GNU_LIBRARY__ */ #ifndef __need_getopt extern int getopt_long(int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; extern int getopt_long_only(int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; #endif #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/gnu/stubs-64.h ================================================ /* This file is automatically generated. It defines a symbol `__stub_FUNCTION' for each function in the C library which is a stub, meaning it will fail every time called, usually setting errno to ENOSYS. */ #ifdef _LIBC #error Applications may not define the macro _LIBC #endif #define __stub_bdflush #define __stub_chflags #define __stub_fattach #define __stub_fchflags #define __stub_fdetach #define __stub_getmsg #define __stub_gtty #define __stub_lchmod #define __stub_putmsg #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn #define __stub_sstk #define __stub_stty ================================================ FILE: v2/headers/linux_amd64/usr/include/gnu/stubs.h ================================================ /* This file is automatically generated. This file selects the right generated file of `__stub_FUNCTION' macros based on the architecture being compiled for. */ #if !defined __x86_64__ # include #endif #if defined __x86_64__ && defined __LP64__ # include #endif #if defined __x86_64__ && defined __ILP32__ # include #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/grp.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 9.2.1 Group Database Access */ #ifndef _GRP_H #define _GRP_H 1 #include __BEGIN_DECLS #include #define __need_size_t #include /* For the Single Unix specification we must define this type here. */ #if (defined __USE_XOPEN || defined __USE_XOPEN2K) && !defined __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined #endif /* The group structure. */ struct group { char *gr_name; /* Group name. */ char *gr_passwd; /* Password. */ __gid_t gr_gid; /* Group ID. */ char **gr_mem; /* Member list. */ }; #ifdef __USE_MISC # define __need_FILE # include #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Rewind the group-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setgrent(void); /* Close the group-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endgrent(void); /* Read an entry from the group-file stream, opening it if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct group *getgrent(void); #endif #ifdef __USE_MISC /* Read a group entry from STREAM. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct group *fgetgrent(FILE * __stream); #endif #ifdef __USE_GNU /* Write the given entry onto the given stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int putgrent(const struct group *__restrict __p, FILE * __restrict __f); #endif /* Search for an entry with a matching group ID. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct group *getgrgid(__gid_t __gid); /* Search for an entry with a matching group name. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct group *getgrnam(const char *__name); #ifdef __USE_POSIX # ifdef __USE_MISC /* Reasonable value for the buffer sized used in the reentrant functions below. But better use `sysconf'. */ # define NSS_BUFLEN_GROUP 1024 # endif /* Reentrant versions of some of the functions above. PLEASE NOTE: the `getgrent_r' function is not (yet) standardized. The interface may change in later versions of this library. But the interface is designed following the principals used for the other reentrant functions so the chances are good this is what the POSIX people would choose. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ # ifdef __USE_GNU extern int getgrent_r(struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); # endif /* Search for an entry with a matching group ID. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getgrgid_r(__gid_t __gid, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); /* Search for an entry with a matching group name. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getgrnam_r(const char *__restrict __name, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); # ifdef __USE_MISC /* Read a group entry from STREAM. This function is not standardized an probably never will. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fgetgrent_r(FILE * __restrict __stream, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); # endif #endif /* POSIX or reentrant */ #ifdef __USE_MISC # define __need_size_t # include /* Set the group set for the current user to GROUPS (N of them). */ extern int setgroups(size_t __n, const __gid_t * __groups) __THROW; /* Store at most *NGROUPS members of the group set for USER into *GROUPS. Also include GROUP. The actual number of groups found is returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getgrouplist(const char *__user, __gid_t __group, __gid_t * __groups, int *__ngroups); /* Initialize the group set for the current user by reading the group database and using all groups of which USER is a member. Also include GROUP. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int initgroups(const char *__user, __gid_t __group); #endif /* Use misc. */ __END_DECLS #endif /* grp.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/inttypes.h ================================================ /* Copyright (C) 1997-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99: 7.8 Format conversion of integer types */ #ifndef _INTTYPES_H #define _INTTYPES_H 1 #include /* Get the type definitions. */ #include /* Get a definition for wchar_t. But we must not define wchar_t itself. */ #ifndef ____gwchar_t_defined # ifdef __cplusplus # define __gwchar_t wchar_t # elif defined __WCHAR_TYPE__ typedef __WCHAR_TYPE__ __gwchar_t; # else # define __need_wchar_t # include typedef wchar_t __gwchar_t; # endif # define ____gwchar_t_defined 1 #endif # if __WORDSIZE == 64 # define __PRI64_PREFIX "l" # define __PRIPTR_PREFIX "l" # else # define __PRI64_PREFIX "ll" # define __PRIPTR_PREFIX # endif /* Macros for printing format specifiers. */ /* Decimal notation. */ # define PRId8 "d" # define PRId16 "d" # define PRId32 "d" # define PRId64 __PRI64_PREFIX "d" # define PRIdLEAST8 "d" # define PRIdLEAST16 "d" # define PRIdLEAST32 "d" # define PRIdLEAST64 __PRI64_PREFIX "d" # define PRIdFAST8 "d" # define PRIdFAST16 __PRIPTR_PREFIX "d" # define PRIdFAST32 __PRIPTR_PREFIX "d" # define PRIdFAST64 __PRI64_PREFIX "d" # define PRIi8 "i" # define PRIi16 "i" # define PRIi32 "i" # define PRIi64 __PRI64_PREFIX "i" # define PRIiLEAST8 "i" # define PRIiLEAST16 "i" # define PRIiLEAST32 "i" # define PRIiLEAST64 __PRI64_PREFIX "i" # define PRIiFAST8 "i" # define PRIiFAST16 __PRIPTR_PREFIX "i" # define PRIiFAST32 __PRIPTR_PREFIX "i" # define PRIiFAST64 __PRI64_PREFIX "i" /* Octal notation. */ # define PRIo8 "o" # define PRIo16 "o" # define PRIo32 "o" # define PRIo64 __PRI64_PREFIX "o" # define PRIoLEAST8 "o" # define PRIoLEAST16 "o" # define PRIoLEAST32 "o" # define PRIoLEAST64 __PRI64_PREFIX "o" # define PRIoFAST8 "o" # define PRIoFAST16 __PRIPTR_PREFIX "o" # define PRIoFAST32 __PRIPTR_PREFIX "o" # define PRIoFAST64 __PRI64_PREFIX "o" /* Unsigned integers. */ # define PRIu8 "u" # define PRIu16 "u" # define PRIu32 "u" # define PRIu64 __PRI64_PREFIX "u" # define PRIuLEAST8 "u" # define PRIuLEAST16 "u" # define PRIuLEAST32 "u" # define PRIuLEAST64 __PRI64_PREFIX "u" # define PRIuFAST8 "u" # define PRIuFAST16 __PRIPTR_PREFIX "u" # define PRIuFAST32 __PRIPTR_PREFIX "u" # define PRIuFAST64 __PRI64_PREFIX "u" /* lowercase hexadecimal notation. */ # define PRIx8 "x" # define PRIx16 "x" # define PRIx32 "x" # define PRIx64 __PRI64_PREFIX "x" # define PRIxLEAST8 "x" # define PRIxLEAST16 "x" # define PRIxLEAST32 "x" # define PRIxLEAST64 __PRI64_PREFIX "x" # define PRIxFAST8 "x" # define PRIxFAST16 __PRIPTR_PREFIX "x" # define PRIxFAST32 __PRIPTR_PREFIX "x" # define PRIxFAST64 __PRI64_PREFIX "x" /* UPPERCASE hexadecimal notation. */ # define PRIX8 "X" # define PRIX16 "X" # define PRIX32 "X" # define PRIX64 __PRI64_PREFIX "X" # define PRIXLEAST8 "X" # define PRIXLEAST16 "X" # define PRIXLEAST32 "X" # define PRIXLEAST64 __PRI64_PREFIX "X" # define PRIXFAST8 "X" # define PRIXFAST16 __PRIPTR_PREFIX "X" # define PRIXFAST32 __PRIPTR_PREFIX "X" # define PRIXFAST64 __PRI64_PREFIX "X" /* Macros for printing `intmax_t' and `uintmax_t'. */ # define PRIdMAX __PRI64_PREFIX "d" # define PRIiMAX __PRI64_PREFIX "i" # define PRIoMAX __PRI64_PREFIX "o" # define PRIuMAX __PRI64_PREFIX "u" # define PRIxMAX __PRI64_PREFIX "x" # define PRIXMAX __PRI64_PREFIX "X" /* Macros for printing `intptr_t' and `uintptr_t'. */ # define PRIdPTR __PRIPTR_PREFIX "d" # define PRIiPTR __PRIPTR_PREFIX "i" # define PRIoPTR __PRIPTR_PREFIX "o" # define PRIuPTR __PRIPTR_PREFIX "u" # define PRIxPTR __PRIPTR_PREFIX "x" # define PRIXPTR __PRIPTR_PREFIX "X" /* Macros for scanning format specifiers. */ /* Signed decimal notation. */ # define SCNd8 "hhd" # define SCNd16 "hd" # define SCNd32 "d" # define SCNd64 __PRI64_PREFIX "d" # define SCNdLEAST8 "hhd" # define SCNdLEAST16 "hd" # define SCNdLEAST32 "d" # define SCNdLEAST64 __PRI64_PREFIX "d" # define SCNdFAST8 "hhd" # define SCNdFAST16 __PRIPTR_PREFIX "d" # define SCNdFAST32 __PRIPTR_PREFIX "d" # define SCNdFAST64 __PRI64_PREFIX "d" /* Signed decimal notation. */ # define SCNi8 "hhi" # define SCNi16 "hi" # define SCNi32 "i" # define SCNi64 __PRI64_PREFIX "i" # define SCNiLEAST8 "hhi" # define SCNiLEAST16 "hi" # define SCNiLEAST32 "i" # define SCNiLEAST64 __PRI64_PREFIX "i" # define SCNiFAST8 "hhi" # define SCNiFAST16 __PRIPTR_PREFIX "i" # define SCNiFAST32 __PRIPTR_PREFIX "i" # define SCNiFAST64 __PRI64_PREFIX "i" /* Unsigned decimal notation. */ # define SCNu8 "hhu" # define SCNu16 "hu" # define SCNu32 "u" # define SCNu64 __PRI64_PREFIX "u" # define SCNuLEAST8 "hhu" # define SCNuLEAST16 "hu" # define SCNuLEAST32 "u" # define SCNuLEAST64 __PRI64_PREFIX "u" # define SCNuFAST8 "hhu" # define SCNuFAST16 __PRIPTR_PREFIX "u" # define SCNuFAST32 __PRIPTR_PREFIX "u" # define SCNuFAST64 __PRI64_PREFIX "u" /* Octal notation. */ # define SCNo8 "hho" # define SCNo16 "ho" # define SCNo32 "o" # define SCNo64 __PRI64_PREFIX "o" # define SCNoLEAST8 "hho" # define SCNoLEAST16 "ho" # define SCNoLEAST32 "o" # define SCNoLEAST64 __PRI64_PREFIX "o" # define SCNoFAST8 "hho" # define SCNoFAST16 __PRIPTR_PREFIX "o" # define SCNoFAST32 __PRIPTR_PREFIX "o" # define SCNoFAST64 __PRI64_PREFIX "o" /* Hexadecimal notation. */ # define SCNx8 "hhx" # define SCNx16 "hx" # define SCNx32 "x" # define SCNx64 __PRI64_PREFIX "x" # define SCNxLEAST8 "hhx" # define SCNxLEAST16 "hx" # define SCNxLEAST32 "x" # define SCNxLEAST64 __PRI64_PREFIX "x" # define SCNxFAST8 "hhx" # define SCNxFAST16 __PRIPTR_PREFIX "x" # define SCNxFAST32 __PRIPTR_PREFIX "x" # define SCNxFAST64 __PRI64_PREFIX "x" /* Macros for scanning `intmax_t' and `uintmax_t'. */ # define SCNdMAX __PRI64_PREFIX "d" # define SCNiMAX __PRI64_PREFIX "i" # define SCNoMAX __PRI64_PREFIX "o" # define SCNuMAX __PRI64_PREFIX "u" # define SCNxMAX __PRI64_PREFIX "x" /* Macros for scaning `intptr_t' and `uintptr_t'. */ # define SCNdPTR __PRIPTR_PREFIX "d" # define SCNiPTR __PRIPTR_PREFIX "i" # define SCNoPTR __PRIPTR_PREFIX "o" # define SCNuPTR __PRIPTR_PREFIX "u" # define SCNxPTR __PRIPTR_PREFIX "x" __BEGIN_DECLS #if __WORDSIZE == 64 /* We have to define the `uintmax_t' type using `ldiv_t'. */ typedef struct { long int quot; /* Quotient. */ long int rem; /* Remainder. */ } imaxdiv_t; #else /* We have to define the `uintmax_t' type using `lldiv_t'. */ typedef struct { __extension__ long long int quot; /* Quotient. */ __extension__ long long int rem; /* Remainder. */ } imaxdiv_t; #endif /* Compute absolute value of N. */ extern intmax_t imaxabs(intmax_t __n) __THROW __attribute__ ((__const__)); /* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */ extern imaxdiv_t imaxdiv(intmax_t __numer, intmax_t __denom) __THROW __attribute__ ((__const__)); /* Like `strtol' but convert to `intmax_t'. */ extern intmax_t strtoimax(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW; /* Like `strtoul' but convert to `uintmax_t'. */ extern uintmax_t strtoumax(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW; /* Like `wcstol' but convert to `intmax_t'. */ extern intmax_t wcstoimax(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base) __THROW; /* Like `wcstoul' but convert to `uintmax_t'. */ extern uintmax_t wcstoumax(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base) __THROW; #ifdef __USE_EXTERN_INLINES # if __WORDSIZE == 64 extern long int __strtol_internal(const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH(strtoimax(const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtol_internal(nptr, endptr, base, 0); } extern unsigned long int __strtoul_internal(const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH(strtoumax(const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoul_internal(nptr, endptr, base, 0); } extern long int __wcstol_internal(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH(wcstoimax(const __gwchar_t * __restrict nptr, __gwchar_t ** __restrict endptr, int base)) { return __wcstol_internal(nptr, endptr, base, 0); } extern unsigned long int __wcstoul_internal(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH(wcstoumax(const __gwchar_t * __restrict nptr, __gwchar_t ** __restrict endptr, int base)) { return __wcstoul_internal(nptr, endptr, base, 0); } # else /* __WORDSIZE == 32 */ __extension__ extern long long int __strtoll_internal(const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH(strtoimax(const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoll_internal(nptr, endptr, base, 0); } __extension__ extern unsigned long long int __strtoull_internal(const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH(strtoumax(const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoull_internal(nptr, endptr, base, 0); } __extension__ extern long long int __wcstoll_internal(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH(wcstoimax(const __gwchar_t * __restrict nptr, __gwchar_t ** __restrict endptr, int base)) { return __wcstoll_internal(nptr, endptr, base, 0); } __extension__ extern unsigned long long int __wcstoull_internal(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH(wcstoumax(const __gwchar_t * __restrict nptr, __gwchar_t ** __restrict endptr, int base)) { return __wcstoull_internal(nptr, endptr, base, 0); } # endif /* __WORDSIZE == 32 */ #endif /* Use extern inlines. */ __END_DECLS #endif /* inttypes.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/libio.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Per Bothner . The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . As a special exception, if you link the code in this file with files compiled with a GNU compiler to produce an executable, that does not cause the resulting executable to be covered by the GNU Lesser General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Lesser General Public License. This exception applies to code released by its copyright holders in files containing the exception. */ #ifndef _IO_STDIO_H #define _IO_STDIO_H #include <_G_config.h> /* ALL of these should be defined in _G_config.h */ #define _IO_fpos_t _G_fpos_t #define _IO_fpos64_t _G_fpos64_t #define _IO_size_t size_t #define _IO_ssize_t __ssize_t #define _IO_off_t __off_t #define _IO_off64_t __off64_t #define _IO_pid_t __pid_t #define _IO_uid_t __uid_t #define _IO_iconv_t _G_iconv_t #define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE #define _IO_BUFSIZ _G_BUFSIZ #define _IO_va_list _G_va_list #define _IO_wint_t wint_t /* This define avoids name pollution if we're using GNU stdarg.h */ #define __need___va_list #include #ifdef __GNUC_VA_LIST # undef _IO_va_list # define _IO_va_list __gnuc_va_list #endif /* __GNUC_VA_LIST */ #ifndef __P # include #endif /*!__P */ #define _IO_UNIFIED_JUMPTABLES 1 #ifndef EOF # define EOF (-1) #endif #ifndef NULL # if defined __GNUG__ && \ (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) # define NULL (__null) # else # if !defined(__cplusplus) # define NULL ((void*)0) # else # define NULL (0) # endif # endif #endif #define _IOS_INPUT 1 #define _IOS_OUTPUT 2 #define _IOS_ATEND 4 #define _IOS_APPEND 8 #define _IOS_TRUNC 16 #define _IOS_NOCREATE 32 #define _IOS_NOREPLACE 64 #define _IOS_BIN 128 /* Magic numbers and bits for the _flags field. The magic numbers use the high-order bits of _flags; the remaining bits are available for variable flags. Note: The magic numbers must all be negative if stdio emulation is desired. */ #define _IO_MAGIC 0xFBAD0000 /* Magic number */ #define _OLD_STDIO_MAGIC 0xFABC0000 /* Emulate old stdio. */ #define _IO_MAGIC_MASK 0xFFFF0000 #define _IO_USER_BUF 1 /* User owns buffer; don't delete it on close. */ #define _IO_UNBUFFERED 2 #define _IO_NO_READS 4 /* Reading not allowed */ #define _IO_NO_WRITES 8 /* Writing not allowd */ #define _IO_EOF_SEEN 0x10 #define _IO_ERR_SEEN 0x20 #define _IO_DELETE_DONT_CLOSE 0x40 /* Don't call close(_fileno) on cleanup. */ #define _IO_LINKED 0x80 /* Set if linked (using _chain) to streambuf::_list_all. */ #define _IO_IN_BACKUP 0x100 #define _IO_LINE_BUF 0x200 #define _IO_TIED_PUT_GET 0x400 /* Set if put and get pointer logicly tied. */ #define _IO_CURRENTLY_PUTTING 0x800 #define _IO_IS_APPENDING 0x1000 #define _IO_IS_FILEBUF 0x2000 #define _IO_BAD_SEEN 0x4000 #define _IO_USER_LOCK 0x8000 #define _IO_FLAGS2_MMAP 1 #define _IO_FLAGS2_NOTCANCEL 2 #ifdef _LIBC # define _IO_FLAGS2_FORTIFY 4 #endif #define _IO_FLAGS2_USER_WBUF 8 #ifdef _LIBC # define _IO_FLAGS2_SCANF_STD 16 # define _IO_FLAGS2_NOCLOSE 32 # define _IO_FLAGS2_CLOEXEC 64 #endif /* These are "formatting flags" matching the iostream fmtflags enum values. */ #define _IO_SKIPWS 01 #define _IO_LEFT 02 #define _IO_RIGHT 04 #define _IO_INTERNAL 010 #define _IO_DEC 020 #define _IO_OCT 040 #define _IO_HEX 0100 #define _IO_SHOWBASE 0200 #define _IO_SHOWPOINT 0400 #define _IO_UPPERCASE 01000 #define _IO_SHOWPOS 02000 #define _IO_SCIENTIFIC 04000 #define _IO_FIXED 010000 #define _IO_UNITBUF 020000 #define _IO_STDIO 040000 #define _IO_DONT_CLOSE 0100000 #define _IO_BOOLALPHA 0200000 struct _IO_jump_t; struct _IO_FILE; /* Handle lock. */ #ifdef _IO_MTSAFE_IO # if defined __GLIBC__ && __GLIBC__ >= 2 # include # else /*# include */ # endif #else typedef void _IO_lock_t; #endif /* A streammarker remembers a position in a buffer. */ struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; /* If _pos >= 0 it points to _buf->Gbase()+_pos. FIXME comment */ /* if _pos < 0, it points to _buf->eBptr()+_pos. FIXME comment */ int _pos; #if 0 void set_streampos(streampos sp) { _spos = sp; } void set_offset(int offset) { _pos = offset; _spos = (streampos) (-2); } public: streammarker(streambuf * sb); ~streammarker(); int saving() { return _spos == -2; } int delta(streammarker &); int delta(); #endif }; /* This is the structure from the libstdc++ codecvt class. */ enum __codecvt_result { __codecvt_ok, __codecvt_partial, __codecvt_error, __codecvt_noconv }; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T /* The order of the elements in the following struct must match the order of the virtual functions in the libstdc++ codecvt class. */ struct _IO_codecvt { void (*__codecvt_destr) (struct _IO_codecvt *); enum __codecvt_result (*__codecvt_do_out) (struct _IO_codecvt *, __mbstate_t *, const wchar_t *, const wchar_t *, const wchar_t **, char *, char *, char **); enum __codecvt_result (*__codecvt_do_unshift) (struct _IO_codecvt *, __mbstate_t *, char *, char *, char **); enum __codecvt_result (*__codecvt_do_in) (struct _IO_codecvt *, __mbstate_t *, const char *, const char *, const char **, wchar_t *, wchar_t *, wchar_t **); int (*__codecvt_do_encoding) (struct _IO_codecvt *); int (*__codecvt_do_always_noconv) (struct _IO_codecvt *); int (*__codecvt_do_length) (struct _IO_codecvt *, __mbstate_t *, const char *, const char *, _IO_size_t); int (*__codecvt_do_max_length) (struct _IO_codecvt *); _IO_iconv_t __cd_in; _IO_iconv_t __cd_out; }; /* Extra data for wide character streams. */ struct _IO_wide_data { wchar_t *_IO_read_ptr; /* Current read pointer */ wchar_t *_IO_read_end; /* End of get area. */ wchar_t *_IO_read_base; /* Start of putback+get area. */ wchar_t *_IO_write_base; /* Start of put area. */ wchar_t *_IO_write_ptr; /* Current put pointer. */ wchar_t *_IO_write_end; /* End of put area. */ wchar_t *_IO_buf_base; /* Start of reserve area. */ wchar_t *_IO_buf_end; /* End of reserve area. */ /* The following fields are used to support backing up and undo. */ wchar_t *_IO_save_base; /* Pointer to start of non-current get area. */ wchar_t *_IO_backup_base; /* Pointer to first valid character of backup area */ wchar_t *_IO_save_end; /* Pointer to end of non-current get area. */ __mbstate_t _IO_state; __mbstate_t _IO_last_state; struct _IO_codecvt _codecvt; wchar_t _shortbuf[1]; const struct _IO_jump_t *_wide_vtable; }; #endif struct _IO_FILE { int _flags; /* High-order word is _IO_MAGIC; rest is flags. */ #define _IO_file_flags _flags /* The following pointers correspond to the C++ streambuf protocol. */ /* Note: Tk uses the _IO_read_ptr and _IO_read_end fields directly. */ char *_IO_read_ptr; /* Current read pointer */ char *_IO_read_end; /* End of get area. */ char *_IO_read_base; /* Start of putback+get area. */ char *_IO_write_base; /* Start of put area. */ char *_IO_write_ptr; /* Current put pointer. */ char *_IO_write_end; /* End of put area. */ char *_IO_buf_base; /* Start of reserve area. */ char *_IO_buf_end; /* End of reserve area. */ /* The following fields are used to support backing up and undo. */ char *_IO_save_base; /* Pointer to start of non-current get area. */ char *_IO_backup_base; /* Pointer to first valid character of backup area */ char *_IO_save_end; /* Pointer to end of non-current get area. */ struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; #if 0 int _blksize; #else int _flags2; #endif _IO_off_t _old_offset; /* This used to be _offset but it's too small. */ #define __HAVE_COLUMN /* temporary */ /* 1+column number of pbase(); 0 is unknown. */ unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; /* char* _save_gptr; char* _save_egptr; */ _IO_lock_t *_lock; #ifdef _IO_USE_OLD_IO_FILE }; struct _IO_FILE_complete { struct _IO_FILE _file; #endif #if defined _G_IO_IO_FILE_VERSION && _G_IO_IO_FILE_VERSION == 0x20001 _IO_off64_t _offset; # if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T /* Wide character stream stuff. */ struct _IO_codecvt *_codecvt; struct _IO_wide_data *_wide_data; struct _IO_FILE *_freeres_list; void *_freeres_buf; size_t _freeres_size; # else void *__pad1; void *__pad2; void *__pad3; void *__pad4; size_t __pad5; # endif int _mode; /* Make sure we don't get into trouble again. */ char _unused2[15 * sizeof(int) - 4 * sizeof(void *) - sizeof(size_t)]; #endif }; #ifndef __cplusplus typedef struct _IO_FILE _IO_FILE; #endif struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; extern struct _IO_FILE_plus _IO_2_1_stderr_; #ifndef _LIBC #define _IO_stdin ((_IO_FILE*)(&_IO_2_1_stdin_)) #define _IO_stdout ((_IO_FILE*)(&_IO_2_1_stdout_)) #define _IO_stderr ((_IO_FILE*)(&_IO_2_1_stderr_)) #else extern _IO_FILE *_IO_stdin attribute_hidden; extern _IO_FILE *_IO_stdout attribute_hidden; extern _IO_FILE *_IO_stderr attribute_hidden; #endif /* Functions to do I/O and file management for a stream. */ /* Read NBYTES bytes from COOKIE into a buffer pointed to by BUF. Return number of bytes read. */ typedef __ssize_t __io_read_fn(void *__cookie, char *__buf, size_t __nbytes); /* Write N bytes pointed to by BUF to COOKIE. Write all N bytes unless there is an error. Return number of bytes written. If there is an error, return 0 and do not write anything. If the file has been opened for append (__mode.__append set), then set the file pointer to the end of the file and then do the write; if not, just write at the current file pointer. */ typedef __ssize_t __io_write_fn(void *__cookie, const char *__buf, size_t __n); /* Move COOKIE's file position to *POS bytes from the beginning of the file (if W is SEEK_SET), the current position (if W is SEEK_CUR), or the end of the file (if W is SEEK_END). Set *POS to the new file position. Returns zero if successful, nonzero if not. */ typedef int __io_seek_fn(void *__cookie, _IO_off64_t * __pos, int __w); /* Close COOKIE. */ typedef int __io_close_fn(void *__cookie); #ifdef _GNU_SOURCE /* User-visible names for the above. */ typedef __io_read_fn cookie_read_function_t; typedef __io_write_fn cookie_write_function_t; typedef __io_seek_fn cookie_seek_function_t; typedef __io_close_fn cookie_close_function_t; /* The structure with the cookie function pointers. */ typedef struct { __io_read_fn *read; /* Read bytes. */ __io_write_fn *write; /* Write bytes. */ __io_seek_fn *seek; /* Seek/tell file position. */ __io_close_fn *close; /* Close file. */ } _IO_cookie_io_functions_t; typedef _IO_cookie_io_functions_t cookie_io_functions_t; struct _IO_cookie_file; /* Initialize one of those. */ extern void _IO_cookie_init(struct _IO_cookie_file *__cfile, int __read_write, void *__cookie, _IO_cookie_io_functions_t __fns); #endif #ifdef __cplusplus extern "C" { #endif extern int __underflow(_IO_FILE *); extern int __uflow(_IO_FILE *); extern int __overflow(_IO_FILE *, int); #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T extern _IO_wint_t __wunderflow(_IO_FILE *); extern _IO_wint_t __wuflow(_IO_FILE *); extern _IO_wint_t __woverflow(_IO_FILE *, _IO_wint_t); #endif #if __GNUC__ >= 3 # define _IO_BE(expr, res) __builtin_expect ((expr), res) #else # define _IO_BE(expr, res) (expr) #endif #define _IO_getc_unlocked(_fp) \ (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \ ? __uflow (_fp) : *(unsigned char *) (_fp)->_IO_read_ptr++) #define _IO_peekc_unlocked(_fp) \ (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \ && __underflow (_fp) == EOF ? EOF \ : *(unsigned char *) (_fp)->_IO_read_ptr) #define _IO_putc_unlocked(_ch, _fp) \ (_IO_BE ((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end, 0) \ ? __overflow (_fp, (unsigned char) (_ch)) \ : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch))) #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # define _IO_getwc_unlocked(_fp) \ (_IO_BE ((_fp)->_wide_data == NULL \ || ((_fp)->_wide_data->_IO_read_ptr \ >= (_fp)->_wide_data->_IO_read_end), 0) \ ? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++) # define _IO_putwc_unlocked(_wch, _fp) \ (_IO_BE ((_fp)->_wide_data == NULL \ || ((_fp)->_wide_data->_IO_write_ptr \ >= (_fp)->_wide_data->_IO_write_end), 0) \ ? __woverflow (_fp, _wch) \ : (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch))) #endif #define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0) #define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0) extern int _IO_getc(_IO_FILE * __fp); extern int _IO_putc(int __c, _IO_FILE * __fp); extern int _IO_feof(_IO_FILE * __fp) __THROW; extern int _IO_ferror(_IO_FILE * __fp) __THROW; extern int _IO_peekc_locked(_IO_FILE * __fp); /* This one is for Emacs. */ #define _IO_PENDING_OUTPUT_COUNT(_fp) \ ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base) extern void _IO_flockfile(_IO_FILE *) __THROW; extern void _IO_funlockfile(_IO_FILE *) __THROW; extern int _IO_ftrylockfile(_IO_FILE *) __THROW; #ifdef _IO_MTSAFE_IO # define _IO_peekc(_fp) _IO_peekc_locked (_fp) # define _IO_flockfile(_fp) \ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_flockfile (_fp) # define _IO_funlockfile(_fp) \ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_funlockfile (_fp) #else # define _IO_peekc(_fp) _IO_peekc_unlocked (_fp) # define _IO_flockfile(_fp) /**/ # define _IO_funlockfile(_fp) /**/ # define _IO_ftrylockfile(_fp) /**/ # define _IO_cleanup_region_start(_fct, _fp) /**/ # define _IO_cleanup_region_end(_Doit) /**/ #endif /* !_IO_MTSAFE_IO */ extern int _IO_vfscanf(_IO_FILE * __restrict, const char *__restrict, _IO_va_list, int *__restrict); extern int _IO_vfprintf(_IO_FILE * __restrict, const char *__restrict, _IO_va_list); extern _IO_ssize_t _IO_padn(_IO_FILE *, int, _IO_ssize_t); extern _IO_size_t _IO_sgetn(_IO_FILE *, void *, _IO_size_t); extern _IO_off64_t _IO_seekoff(_IO_FILE *, _IO_off64_t, int, int); extern _IO_off64_t _IO_seekpos(_IO_FILE *, _IO_off64_t, int); extern void _IO_free_backup_area(_IO_FILE *) __THROW; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T extern _IO_wint_t _IO_getwc(_IO_FILE * __fp); extern _IO_wint_t _IO_putwc(wchar_t __wc, _IO_FILE * __fp); extern int _IO_fwide(_IO_FILE * __fp, int __mode) __THROW; # if __GNUC__ >= 2 /* While compiling glibc we have to handle compatibility with very old versions. */ # if defined _LIBC && defined SHARED # include # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) # define _IO_fwide_maybe_incompatible \ (__builtin_expect (&_IO_stdin_used == NULL, 0)) extern const int _IO_stdin_used; weak_extern(_IO_stdin_used); # endif # endif # ifndef _IO_fwide_maybe_incompatible # define _IO_fwide_maybe_incompatible (0) # endif /* A special optimized version of the function above. It optimizes the case of initializing an unoriented byte stream. */ # define _IO_fwide(__fp, __mode) \ ({ int __result = (__mode); \ if (__result < 0 && ! _IO_fwide_maybe_incompatible) \ { \ if ((__fp)->_mode == 0) \ /* We know that all we have to do is to set the flag. */ \ (__fp)->_mode = -1; \ __result = (__fp)->_mode; \ } \ else if (__builtin_constant_p (__mode) && (__mode) == 0) \ __result = _IO_fwide_maybe_incompatible ? -1 : (__fp)->_mode; \ else \ __result = _IO_fwide (__fp, __result); \ __result; }) # endif extern int _IO_vfwscanf(_IO_FILE * __restrict, const wchar_t * __restrict, _IO_va_list, int *__restrict); extern int _IO_vfwprintf(_IO_FILE * __restrict, const wchar_t * __restrict, _IO_va_list); extern _IO_ssize_t _IO_wpadn(_IO_FILE *, wint_t, _IO_ssize_t); extern void _IO_free_wbackup_area(_IO_FILE *) __THROW; #endif #ifdef __LDBL_COMPAT # include #endif #ifdef __cplusplus } #endif #endif /* _IO_STDIO_H */ ================================================ FILE: v2/headers/linux_amd64/usr/include/limits.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types */ #ifndef _LIBC_LIMITS_H_ #define _LIBC_LIMITS_H_ 1 #include /* Maximum length of any multibyte character in any locale. We define this value here since the gcc header does not define the correct value. */ #define MB_LEN_MAX 16 /* If we are not using GNU CC we have to define all the symbols ourself. Otherwise use gcc's definitions (see below). */ #if !defined __GNUC__ || __GNUC__ < 2 /* We only protect from multiple inclusion here, because all the other #include's protect themselves, and in GCC 2 we may #include_next through multiple copies of this file before we get to GCC's. */ # ifndef _LIMITS_H # define _LIMITS_H 1 #include /* We don't have #include_next. Define ANSI for standard 32-bit words. */ /* These assume 8-bit `char's, 16-bit `short int's, and 32-bit `int's and `long int's. */ /* Number of bits in a `char'. */ # define CHAR_BIT 8 /* Minimum and maximum values a `signed char' can hold. */ # define SCHAR_MIN (-128) # define SCHAR_MAX 127 /* Maximum value an `unsigned char' can hold. (Minimum is 0.) */ # define UCHAR_MAX 255 /* Minimum and maximum values a `char' can hold. */ # ifdef __CHAR_UNSIGNED__ # define CHAR_MIN 0 # define CHAR_MAX UCHAR_MAX # else # define CHAR_MIN SCHAR_MIN # define CHAR_MAX SCHAR_MAX # endif /* Minimum and maximum values a `signed short int' can hold. */ # define SHRT_MIN (-32768) # define SHRT_MAX 32767 /* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */ # define USHRT_MAX 65535 /* Minimum and maximum values a `signed int' can hold. */ # define INT_MIN (-INT_MAX - 1) # define INT_MAX 2147483647 /* Maximum value an `unsigned int' can hold. (Minimum is 0.) */ # define UINT_MAX 4294967295U /* Minimum and maximum values a `signed long int' can hold. */ # if __WORDSIZE == 64 # define LONG_MAX 9223372036854775807L # else # define LONG_MAX 2147483647L # endif # define LONG_MIN (-LONG_MAX - 1L) /* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */ # if __WORDSIZE == 64 # define ULONG_MAX 18446744073709551615UL # else # define ULONG_MAX 4294967295UL # endif # ifdef __USE_ISOC99 /* Minimum and maximum values a `signed long long int' can hold. */ # define LLONG_MAX 9223372036854775807LL # define LLONG_MIN (-LLONG_MAX - 1LL) /* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */ # define ULLONG_MAX 18446744073709551615ULL # endif /* ISO C99 */ # endif /* limits.h */ #endif /* GCC 2. */ #endif /* !_LIBC_LIMITS_H_ */ /* Get the compiler's limits.h, which defines almost all the ISO constants. We put this #include_next outside the double inclusion check because it should be possible to include this file more than once and still get the definitions from gcc's header. */ #if defined __GNUC__ && !defined _GCC_LIMITS_H_ /* `_GCC_LIMITS_H_' is what GCC's file defines. */ # include_next #endif /* The files in some gcc versions don't define LLONG_MIN, LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for ages are available. */ #if defined __USE_ISOC99 && defined __GNUC__ # ifndef LLONG_MIN # define LLONG_MIN (-LLONG_MAX-1) # endif # ifndef LLONG_MAX # define LLONG_MAX __LONG_LONG_MAX__ # endif # ifndef ULLONG_MAX # define ULLONG_MAX (LLONG_MAX * 2ULL + 1) # endif #endif #ifdef __USE_POSIX /* POSIX adds things to . */ # include #endif #ifdef __USE_POSIX2 # include #endif #ifdef __USE_XOPEN # include #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/linux/errno.h ================================================ #include ================================================ FILE: v2/headers/linux_amd64/usr/include/linux/ioctl.h ================================================ #ifndef _LINUX_IOCTL_H #define _LINUX_IOCTL_H #include #endif /* _LINUX_IOCTL_H */ ================================================ FILE: v2/headers/linux_amd64/usr/include/linux/limits.h ================================================ #ifndef _LINUX_LIMITS_H #define _LINUX_LIMITS_H #define NR_OPEN 1024 #define NGROUPS_MAX 65536 /* supplemental group IDs are available */ #define ARG_MAX 131072 /* # bytes of args + environ for exec() */ #define LINK_MAX 127 /* # links a file may have */ #define MAX_CANON 255 /* size of the canonical input queue */ #define MAX_INPUT 255 /* size of the type-ahead buffer */ #define NAME_MAX 255 /* # chars in a file name */ #define PATH_MAX 4096 /* # chars in a path name including nul */ #define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */ #define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */ #define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */ #define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */ #define RTSIG_MAX 32 #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/linux/param.h ================================================ #ifndef _LINUX_PARAM_H #define _LINUX_PARAM_H #include #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/locale.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.11 Localization */ #ifndef _LOCALE_H #define _LOCALE_H 1 #include #define __need_NULL #include #include __BEGIN_DECLS /* These are the possibilities for the first argument to setlocale. The code assumes that the lowest LC_* symbol has the value zero. */ #define LC_CTYPE __LC_CTYPE #define LC_NUMERIC __LC_NUMERIC #define LC_TIME __LC_TIME #define LC_COLLATE __LC_COLLATE #define LC_MONETARY __LC_MONETARY #define LC_MESSAGES __LC_MESSAGES #define LC_ALL __LC_ALL #define LC_PAPER __LC_PAPER #define LC_NAME __LC_NAME #define LC_ADDRESS __LC_ADDRESS #define LC_TELEPHONE __LC_TELEPHONE #define LC_MEASUREMENT __LC_MEASUREMENT #define LC_IDENTIFICATION __LC_IDENTIFICATION __BEGIN_NAMESPACE_STD /* Structure giving information about numeric and monetary notation. */ struct lconv { /* Numeric (non-monetary) information. */ char *decimal_point; /* Decimal point character. */ char *thousands_sep; /* Thousands separator. */ /* Each element is the number of digits in each group; elements with higher indices are farther left. An element with value CHAR_MAX means that no further grouping is done. An element with value 0 means that the previous element is used for all groups farther left. */ char *grouping; /* Monetary information. */ /* First three chars are a currency symbol from ISO 4217. Fourth char is the separator. Fifth char is '\0'. */ char *int_curr_symbol; char *currency_symbol; /* Local currency symbol. */ char *mon_decimal_point; /* Decimal point character. */ char *mon_thousands_sep; /* Thousands separator. */ char *mon_grouping; /* Like `grouping' element (above). */ char *positive_sign; /* Sign for positive values. */ char *negative_sign; /* Sign for negative values. */ char int_frac_digits; /* Int'l fractional digits. */ char frac_digits; /* Local fractional digits. */ /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */ char p_cs_precedes; /* 1 iff a space separates currency_symbol from a positive value. */ char p_sep_by_space; /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */ char n_cs_precedes; /* 1 iff a space separates currency_symbol from a negative value. */ char n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and currency_symbol. 1 The sign string precedes the quantity and currency_symbol. 2 The sign string follows the quantity and currency_symbol. 3 The sign string immediately precedes the currency_symbol. 4 The sign string immediately follows the currency_symbol. */ char p_sign_posn; char n_sign_posn; #ifdef __USE_ISOC99 /* 1 if int_curr_symbol precedes a positive value, 0 if succeeds. */ char int_p_cs_precedes; /* 1 iff a space separates int_curr_symbol from a positive value. */ char int_p_sep_by_space; /* 1 if int_curr_symbol precedes a negative value, 0 if succeeds. */ char int_n_cs_precedes; /* 1 iff a space separates int_curr_symbol from a negative value. */ char int_n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and int_curr_symbol. 1 The sign string precedes the quantity and int_curr_symbol. 2 The sign string follows the quantity and int_curr_symbol. 3 The sign string immediately precedes the int_curr_symbol. 4 The sign string immediately follows the int_curr_symbol. */ char int_p_sign_posn; char int_n_sign_posn; #else char __int_p_cs_precedes; char __int_p_sep_by_space; char __int_n_cs_precedes; char __int_n_sep_by_space; char __int_p_sign_posn; char __int_n_sign_posn; #endif }; /* Set and/or return the current locale. */ extern char *setlocale(int __category, const char *__locale) __THROW; /* Return the numeric/monetary information for the current locale. */ extern struct lconv *localeconv(void) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ /* Get locale datatype definition. */ # include /* Return a reference to a data structure representing a set of locale datasets. Unlike for the CATEGORY parameter for `setlocale' the CATEGORY_MASK parameter here uses a single bit for each category, made by OR'ing together LC_*_MASK bits above. */ extern __locale_t newlocale(int __category_mask, const char *__locale, __locale_t __base) __THROW; /* These are the bits that can be set in the CATEGORY_MASK argument to `newlocale'. In the GNU implementation, LC_FOO_MASK has the value of (1 << LC_FOO), but this is not a part of the interface that callers can assume will be true. */ # define LC_CTYPE_MASK (1 << __LC_CTYPE) # define LC_NUMERIC_MASK (1 << __LC_NUMERIC) # define LC_TIME_MASK (1 << __LC_TIME) # define LC_COLLATE_MASK (1 << __LC_COLLATE) # define LC_MONETARY_MASK (1 << __LC_MONETARY) # define LC_MESSAGES_MASK (1 << __LC_MESSAGES) # define LC_PAPER_MASK (1 << __LC_PAPER) # define LC_NAME_MASK (1 << __LC_NAME) # define LC_ADDRESS_MASK (1 << __LC_ADDRESS) # define LC_TELEPHONE_MASK (1 << __LC_TELEPHONE) # define LC_MEASUREMENT_MASK (1 << __LC_MEASUREMENT) # define LC_IDENTIFICATION_MASK (1 << __LC_IDENTIFICATION) # define LC_ALL_MASK (LC_CTYPE_MASK \ | LC_NUMERIC_MASK \ | LC_TIME_MASK \ | LC_COLLATE_MASK \ | LC_MONETARY_MASK \ | LC_MESSAGES_MASK \ | LC_PAPER_MASK \ | LC_NAME_MASK \ | LC_ADDRESS_MASK \ | LC_TELEPHONE_MASK \ | LC_MEASUREMENT_MASK \ | LC_IDENTIFICATION_MASK \ ) /* Return a duplicate of the set of locale in DATASET. All usage counters are increased if necessary. */ extern __locale_t duplocale(__locale_t __dataset) __THROW; /* Free the data associated with a locale dataset previously returned by a call to `setlocale_r'. */ extern void freelocale(__locale_t __dataset) __THROW; /* Switch the current thread's locale to DATASET. If DATASET is null, instead just return the current setting. The special value LC_GLOBAL_LOCALE is the initial setting for all threads and can also be installed any time, meaning the thread uses the global settings controlled by `setlocale'. */ extern __locale_t uselocale(__locale_t __dataset) __THROW; /* This value can be passed to `uselocale' and may be returned by it. Passing this value to any other function has undefined behavior. */ # define LC_GLOBAL_LOCALE ((__locale_t) -1L) #endif __END_DECLS #endif /* locale.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/malloc.h ================================================ /* Prototypes and definition for malloc implementation. Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MALLOC_H #define _MALLOC_H 1 #include #include #include #ifdef _LIBC # define __MALLOC_HOOK_VOLATILE # define __MALLOC_DEPRECATED #else # define __MALLOC_HOOK_VOLATILE volatile # define __MALLOC_DEPRECATED __attribute_deprecated__ #endif __BEGIN_DECLS /* Allocate SIZE bytes of memory. */ extern void *malloc(size_t __size) __THROW __attribute_malloc__ __wur; /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ extern void *calloc(size_t __nmemb, size_t __size) __THROW __attribute_malloc__ __wur; /* Re-allocate the previously allocated block in __ptr, making the new block SIZE bytes long. */ /* __attribute_malloc__ is not used, because if realloc returns the same pointer that was passed to it, aliasing needs to be allowed between objects pointed by the old and new pointers. */ extern void *realloc(void *__ptr, size_t __size) __THROW __attribute_warn_unused_result__; /* Free a block allocated by `malloc', `realloc' or `calloc'. */ extern void free(void *__ptr) __THROW; /* Free a block allocated by `calloc'. */ extern void cfree(void *__ptr) __THROW; /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ extern void *memalign(size_t __alignment, size_t __size) __THROW __attribute_malloc__ __wur; /* Allocate SIZE bytes on a page boundary. */ extern void *valloc(size_t __size) __THROW __attribute_malloc__ __wur; /* Equivalent to valloc(minimum-page-that-holds(n)), that is, round up __size to nearest pagesize. */ extern void *pvalloc(size_t __size) __THROW __attribute_malloc__ __wur; /* Underlying allocation function; successive calls should return contiguous pieces of memory. */ extern void *(*__morecore) (ptrdiff_t __size); /* Default value of `__morecore'. */ extern void *__default_morecore(ptrdiff_t __size) __THROW __attribute_malloc__; /* SVID2/XPG mallinfo structure */ struct mallinfo { int arena; /* non-mmapped space allocated from system */ int ordblks; /* number of free chunks */ int smblks; /* number of fastbin blocks */ int hblks; /* number of mmapped regions */ int hblkhd; /* space in mmapped regions */ int usmblks; /* maximum total allocated space */ int fsmblks; /* space available in freed fastbin blocks */ int uordblks; /* total allocated space */ int fordblks; /* total free space */ int keepcost; /* top-most, releasable (via malloc_trim) space */ }; /* Returns a copy of the updated current mallinfo. */ extern struct mallinfo mallinfo(void) __THROW; /* SVID2/XPG mallopt options */ #ifndef M_MXFAST # define M_MXFAST 1 /* maximum request size for "fastbins" */ #endif #ifndef M_NLBLKS # define M_NLBLKS 2 /* UNUSED in this malloc */ #endif #ifndef M_GRAIN # define M_GRAIN 3 /* UNUSED in this malloc */ #endif #ifndef M_KEEP # define M_KEEP 4 /* UNUSED in this malloc */ #endif /* mallopt options that actually do something */ #define M_TRIM_THRESHOLD -1 #define M_TOP_PAD -2 #define M_MMAP_THRESHOLD -3 #define M_MMAP_MAX -4 #define M_CHECK_ACTION -5 #define M_PERTURB -6 #define M_ARENA_TEST -7 #define M_ARENA_MAX -8 /* General SVID/XPG interface to tunable parameters. */ extern int mallopt(int __param, int __val) __THROW; /* Release all but __pad bytes of freed top-most memory back to the system. Return 1 if successful, else 0. */ extern int malloc_trim(size_t __pad) __THROW; /* Report the number of usable allocated bytes associated with allocated chunk __ptr. */ extern size_t malloc_usable_size(void *__ptr) __THROW; /* Prints brief summary statistics on stderr. */ extern void malloc_stats(void) __THROW; /* Output information about state of allocator to stream FP. */ extern int malloc_info(int __options, FILE * __fp) __THROW; /* Record the state of all malloc variables in an opaque data structure. */ extern void *malloc_get_state(void) __THROW; /* Restore the state of all malloc variables from data obtained with malloc_get_state(). */ extern int malloc_set_state(void *__ptr) __THROW; /* Called once when malloc is initialized; redefining this variable in the application provides the preferred way to set up the hook pointers. */ extern void (*__MALLOC_HOOK_VOLATILE __malloc_initialize_hook) (void)__MALLOC_DEPRECATED; /* Hooks for debugging and user-defined versions. */ extern void (*__MALLOC_HOOK_VOLATILE __free_hook) (void *__ptr, const void *)__MALLOC_DEPRECATED; extern void *(*__MALLOC_HOOK_VOLATILE __malloc_hook) (size_t __size, const void *)__MALLOC_DEPRECATED; extern void *(*__MALLOC_HOOK_VOLATILE __realloc_hook) (void *__ptr, size_t __size, const void *)__MALLOC_DEPRECATED; extern void *(*__MALLOC_HOOK_VOLATILE __memalign_hook) (size_t __alignment, size_t __size, const void *)__MALLOC_DEPRECATED; extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void); /* Activate a standard set of debugging hooks. */ extern void __malloc_check_init(void) __THROW __MALLOC_DEPRECATED; __END_DECLS #endif /* malloc.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/math.h ================================================ /* Declarations for math functions. Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.12 Mathematics */ #ifndef _MATH_H #define _MATH_H 1 #include __BEGIN_DECLS /* Get machine-dependent vector math functions declarations. */ #include /* Get machine-dependent HUGE_VAL value (returned on overflow). On all IEEE754 machines, this is +Infinity. */ #include #ifdef __USE_ISOC99 # include # include /* Get machine-dependent INFINITY value. */ # include /* Get machine-dependent NAN value (returned for some domain errors). */ # include #endif /* __USE_ISOC99 */ /* Get general and ISO C99 specific information. */ #include /* The file contains the prototypes for all the actual math functions. These macros are used for those prototypes, so we can easily declare each function as both `name' and `__name', and can declare the float versions `namef' and `__namef'. */ #define __SIMD_DECL(function) __CONCAT (__DECL_SIMD_, function) #define __MATHCALL_VEC(function, suffix, args) \ __SIMD_DECL (__MATH_PRECNAME (function, suffix)) \ __MATHCALL (function, suffix, args) #define __MATHDECL_VEC(type, function,suffix, args) \ __SIMD_DECL (__MATH_PRECNAME (function, suffix)) \ __MATHDECL(type, function,suffix, args) #define __MATHCALL(function,suffix, args) \ __MATHDECL (_Mdouble_,function,suffix, args) #define __MATHDECL(type, function,suffix, args) \ __MATHDECL_1(type, function,suffix, args); \ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) #define __MATHCALLX(function,suffix, args, attrib) \ __MATHDECLX (_Mdouble_,function,suffix, args, attrib) #define __MATHDECLX(type, function,suffix, args, attrib) \ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib) #define __MATHDECL_1(type, function,suffix, args) \ extern type __MATH_PRECNAME(function,suffix) args __THROW #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) #define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD #define _Mdouble_END_NAMESPACE __END_NAMESPACE_STD #include #undef _Mdouble_ #undef _Mdouble_BEGIN_NAMESPACE #undef _Mdouble_END_NAMESPACE #undef __MATH_PRECNAME #ifdef __USE_ISOC99 /* Include the file of declarations again, this time using `float' instead of `double' and appending f to each function name. */ # ifndef _Mfloat_ # define _Mfloat_ float # endif # define _Mdouble_ _Mfloat_ # define __MATH_PRECNAME(name,r) name##f##r # define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99 # define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99 # include # undef _Mdouble_ # undef _Mdouble_BEGIN_NAMESPACE # undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME # if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) \ || defined __LDBL_COMPAT \ || defined _LIBC_TEST # ifdef __LDBL_COMPAT # ifdef __USE_ISOC99 extern float __nldbl_nexttowardf(float __x, long double __y) __THROW __attribute__ ((__const__)); # ifdef __REDIRECT_NTH extern float __REDIRECT_NTH(nexttowardf, (float __x, long double __y), __nldbl_nexttowardf) __attribute__ ((__const__)); extern double __REDIRECT_NTH(nexttoward, (double __x, long double __y), nextafter) __attribute__ ((__const__)); extern long double __REDIRECT_NTH(nexttowardl, (long double __x, long double __y), nextafter) __attribute__ ((__const__)); # endif # endif # undef __MATHDECL_1 # define __MATHDECL_2(type, function,suffix, args, alias) \ extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \ args, alias) # define __MATHDECL_1(type, function,suffix, args) \ __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix)) # endif /* Include the file of declarations again, this time using `long double' instead of `double' and appending l to each function name. */ # ifndef _Mlong_double_ # define _Mlong_double_ long double # endif # define _Mdouble_ _Mlong_double_ # define __MATH_PRECNAME(name,r) name##l##r # define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99 # define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99 # define __MATH_DECLARE_LDOUBLE 1 # include # undef _Mdouble_ # undef _Mdouble_BEGIN_NAMESPACE # undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME # endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */ #endif /* Use ISO C99. */ #undef __MATHDECL_1 #undef __MATHDECL #undef __MATHCALL #if defined __USE_MISC || defined __USE_XOPEN /* This variable is used by `gamma' and `lgamma'. */ extern int signgam; #endif /* ISO C99 defines some generic macros which work on any data type. */ #ifdef __USE_ISOC99 /* Get the architecture specific values describing the floating-point evaluation. The following symbols will get defined: float_t floating-point type at least as wide as `float' used to evaluate `float' expressions double_t floating-point type at least as wide as `double' used to evaluate `double' expressions FLT_EVAL_METHOD Defined to 0 if `float_t' is `float' and `double_t' is `double' 1 if `float_t' and `double_t' are `double' 2 if `float_t' and `double_t' are `long double' else `float_t' and `double_t' are unspecified INFINITY representation of the infinity value of type `float' FP_FAST_FMA FP_FAST_FMAF FP_FAST_FMAL If defined it indicates that the `fma' function generally executes about as fast as a multiply and an add. This macro is defined only iff the `fma' function is implemented directly with a hardware multiply-add instructions. FP_ILOGB0 Expands to a value returned by `ilogb (0.0)'. FP_ILOGBNAN Expands to a value returned by `ilogb (NAN)'. DECIMAL_DIG Number of decimal digits supported by conversion between decimal and all internal floating-point formats. */ /* All floating-point numbers can be put in one of these categories. */ enum { FP_NAN = # define FP_NAN 0 FP_NAN, FP_INFINITE = # define FP_INFINITE 1 FP_INFINITE, FP_ZERO = # define FP_ZERO 2 FP_ZERO, FP_SUBNORMAL = # define FP_SUBNORMAL 3 FP_SUBNORMAL, FP_NORMAL = # define FP_NORMAL 4 FP_NORMAL }; /* Return number of classification appropriate for X. */ # ifdef __NO_LONG_DOUBLE_MATH # define fpclassify(x) \ (sizeof (x) == sizeof (float) ? __fpclassifyf (x) : __fpclassify (x)) # else # define fpclassify(x) \ (sizeof (x) == sizeof (float) \ ? __fpclassifyf (x) \ : sizeof (x) == sizeof (double) \ ? __fpclassify (x) : __fpclassifyl (x)) # endif /* Return nonzero value if sign of X is negative. */ # ifdef __NO_LONG_DOUBLE_MATH # define signbit(x) \ (sizeof (x) == sizeof (float) ? __signbitf (x) : __signbit (x)) # else # define signbit(x) \ (sizeof (x) == sizeof (float) \ ? __signbitf (x) \ : sizeof (x) == sizeof (double) \ ? __signbit (x) : __signbitl (x)) # endif /* Return nonzero value if X is not +-Inf or NaN. */ # ifdef __NO_LONG_DOUBLE_MATH # define isfinite(x) \ (sizeof (x) == sizeof (float) ? __finitef (x) : __finite (x)) # else # define isfinite(x) \ (sizeof (x) == sizeof (float) \ ? __finitef (x) \ : sizeof (x) == sizeof (double) \ ? __finite (x) : __finitel (x)) # endif /* Return nonzero value if X is neither zero, subnormal, Inf, nor NaN. */ # define isnormal(x) (fpclassify (x) == FP_NORMAL) /* Return nonzero value if X is a NaN. We could use `fpclassify' but we already have this functions `__isnan' and it is faster. */ # ifdef __NO_LONG_DOUBLE_MATH # define isnan(x) \ (sizeof (x) == sizeof (float) ? __isnanf (x) : __isnan (x)) # else # define isnan(x) \ (sizeof (x) == sizeof (float) \ ? __isnanf (x) \ : sizeof (x) == sizeof (double) \ ? __isnan (x) : __isnanl (x)) # endif /* Return nonzero value if X is positive or negative infinity. */ # ifdef __NO_LONG_DOUBLE_MATH # define isinf(x) \ (sizeof (x) == sizeof (float) ? __isinff (x) : __isinf (x)) # else # define isinf(x) \ (sizeof (x) == sizeof (float) \ ? __isinff (x) \ : sizeof (x) == sizeof (double) \ ? __isinf (x) : __isinfl (x)) # endif /* Bitmasks for the math_errhandling macro. */ # define MATH_ERRNO 1 /* errno set by math functions. */ # define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */ /* By default all functions support both errno and exception handling. In gcc's fast math mode and if inline functions are defined this might not be true. */ # ifndef __FAST_MATH__ # define math_errhandling (MATH_ERRNO | MATH_ERREXCEPT) # endif #endif /* Use ISO C99. */ #ifdef __USE_GNU /* Return nonzero value if X is a signaling NaN. */ # ifdef __NO_LONG_DOUBLE_MATH # define issignaling(x) \ (sizeof (x) == sizeof (float) ? __issignalingf (x) : __issignaling (x)) # else # define issignaling(x) \ (sizeof (x) == sizeof (float) \ ? __issignalingf (x) \ : sizeof (x) == sizeof (double) \ ? __issignaling (x) : __issignalingl (x)) # endif #endif /* Use GNU. */ #ifdef __USE_MISC /* Support for various different standard error handling behaviors. */ typedef enum { _IEEE_ = -1, /* According to IEEE 754/IEEE 854. */ _SVID_, /* According to System V, release 4. */ _XOPEN_, /* Nowadays also Unix98. */ _POSIX_, _ISOC_ /* Actually this is ISO C99. */ } _LIB_VERSION_TYPE; /* This variable can be changed at run-time to any of the values above to affect floating point error handling behavior (it may also be necessary to change the hardware FPU exception settings). */ extern _LIB_VERSION_TYPE _LIB_VERSION; #endif #ifdef __USE_MISC /* In SVID error handling, `matherr' is called with this description of the exceptional condition. We have a problem when using C++ since `exception' is a reserved name in C++. */ # ifdef __cplusplus struct __exception # else struct exception # endif { int type; char *name; double arg1; double arg2; double retval; }; # ifdef __cplusplus extern int matherr(struct __exception *__exc) throw(); # else extern int matherr(struct exception *__exc); # endif # define X_TLOSS 1.41484755040568800000e+16 /* Types of exceptions in the `type' field. */ # define DOMAIN 1 # define SING 2 # define OVERFLOW 3 # define UNDERFLOW 4 # define TLOSS 5 # define PLOSS 6 /* SVID mode specifies returning this large value instead of infinity. */ # define HUGE 3.40282347e+38F #else /* !Misc. */ # ifdef __USE_XOPEN /* X/Open wants another strange constant. */ # define MAXFLOAT 3.40282347e+38F # endif #endif /* Misc. */ /* Some useful constants. */ #if defined __USE_MISC || defined __USE_XOPEN # define M_E 2.7182818284590452354 /* e */ # define M_LOG2E 1.4426950408889634074 /* log_2 e */ # define M_LOG10E 0.43429448190325182765 /* log_10 e */ # define M_LN2 0.69314718055994530942 /* log_e 2 */ # define M_LN10 2.30258509299404568402 /* log_e 10 */ # define M_PI 3.14159265358979323846 /* pi */ # define M_PI_2 1.57079632679489661923 /* pi/2 */ # define M_PI_4 0.78539816339744830962 /* pi/4 */ # define M_1_PI 0.31830988618379067154 /* 1/pi */ # define M_2_PI 0.63661977236758134308 /* 2/pi */ # define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ # define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ # define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ #endif /* The above constants are not adequate for computation using `long double's. Therefore we provide as an extension constants with similar names as a GNU extension. Provide enough digits for the 128-bit IEEE quad. */ #ifdef __USE_GNU # define M_El 2.718281828459045235360287471352662498L /* e */ # define M_LOG2El 1.442695040888963407359924681001892137L /* log_2 e */ # define M_LOG10El 0.434294481903251827651128918916605082L /* log_10 e */ # define M_LN2l 0.693147180559945309417232121458176568L /* log_e 2 */ # define M_LN10l 2.302585092994045684017991454684364208L /* log_e 10 */ # define M_PIl 3.141592653589793238462643383279502884L /* pi */ # define M_PI_2l 1.570796326794896619231321691639751442L /* pi/2 */ # define M_PI_4l 0.785398163397448309615660845819875721L /* pi/4 */ # define M_1_PIl 0.318309886183790671537767526745028724L /* 1/pi */ # define M_2_PIl 0.636619772367581343075535053490057448L /* 2/pi */ # define M_2_SQRTPIl 1.128379167095512573896158903121545172L /* 2/sqrt(pi) */ # define M_SQRT2l 1.414213562373095048801688724209698079L /* sqrt(2) */ # define M_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */ #endif /* When compiling in strict ISO C compatible mode we must not use the inline functions since they, among other things, do not set the `errno' variable correctly. */ #if defined __STRICT_ANSI__ && !defined __NO_MATH_INLINES # define __NO_MATH_INLINES 1 #endif #if defined __USE_ISOC99 && __GNUC_PREREQ(2,97) /* ISO C99 defines some macros to compare number while taking care for unordered numbers. Many FPUs provide special instructions to support these operations. Generic support in GCC for these as builtins went in before 3.0.0, but not all cpus added their patterns. We define versions that use the builtins here, and will undef/redefine as appropriate for the specific GCC version in use. */ # define isgreater(x, y) __builtin_isgreater(x, y) # define isgreaterequal(x, y) __builtin_isgreaterequal(x, y) # define isless(x, y) __builtin_isless(x, y) # define islessequal(x, y) __builtin_islessequal(x, y) # define islessgreater(x, y) __builtin_islessgreater(x, y) # define isunordered(u, v) __builtin_isunordered(u, v) #endif /* Get machine-dependent inline versions (if there are any). */ #ifdef __USE_EXTERN_INLINES # include #endif /* Define special entry points to use when the compiler got told to only expect finite results. */ #if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 # include #endif #ifdef __USE_ISOC99 /* If we've still got undefined comparison macros, provide defaults. */ /* Return nonzero value if X is greater than Y. */ # ifndef isgreater # define isgreater(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && __x > __y; })) # endif /* Return nonzero value if X is greater than or equal to Y. */ # ifndef isgreaterequal # define isgreaterequal(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && __x >= __y; })) # endif /* Return nonzero value if X is less than Y. */ # ifndef isless # define isless(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && __x < __y; })) # endif /* Return nonzero value if X is less than or equal to Y. */ # ifndef islessequal # define islessequal(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && __x <= __y; })) # endif /* Return nonzero value if either X is less than Y or Y is less than X. */ # ifndef islessgreater # define islessgreater(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && (__x < __y || __y < __x); })) # endif /* Return nonzero value if arguments are unordered. */ # ifndef isunordered # define isunordered(u, v) \ (__extension__ \ ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \ fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; })) # endif #endif __END_DECLS #endif /* math.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/memory.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * SVID */ #ifndef _MEMORY_H #define _MEMORY_H 1 #include #ifndef _STRING_H # include #endif /* string.h */ #endif /* memory.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/netdb.h ================================================ /* Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* All data returned by the network data base library are supplied in host order and returned in network order (suitable for use in system calls). */ #ifndef _NETDB_H #define _NETDB_H 1 #include #include #include #ifdef __USE_MISC /* This is necessary to make this include file properly replace the Sun version. */ # include #endif #ifdef __USE_GNU # define __need_sigevent_t # include # define __need_timespec # include #endif #include /* Absolute file name for network data base files. */ #define _PATH_HEQUIV "/etc/hosts.equiv" #define _PATH_HOSTS "/etc/hosts" #define _PATH_NETWORKS "/etc/networks" #define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf" #define _PATH_PROTOCOLS "/etc/protocols" #define _PATH_SERVICES "/etc/services" __BEGIN_DECLS #if defined __USE_MISC || !defined __USE_XOPEN2K8 /* Error status for non-reentrant lookup functions. We use a macro to access always the thread-specific `h_errno' variable. */ # define h_errno (*__h_errno_location ()) /* Function to get address of global `h_errno' variable. */ extern int *__h_errno_location(void) __THROW __attribute__ ((__const__)); /* Possible values left in `h_errno'. */ # define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found. */ # define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL. */ # define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP. */ # define NO_DATA 4 /* Valid name, no data record of requested type. */ #endif #ifdef __USE_MISC # define NETDB_INTERNAL -1 /* See errno. */ # define NETDB_SUCCESS 0 /* No problem. */ # define NO_ADDRESS NO_DATA /* No address, look for MX record. */ #endif #if defined __USE_XOPEN2K || defined __USE_XOPEN_EXTENDED /* Highest reserved Internet port number. */ # define IPPORT_RESERVED 1024 #endif #ifdef __USE_GNU /* Scope delimiter for getaddrinfo(), getnameinfo(). */ # define SCOPE_DELIMITER '%' #endif #ifdef __USE_MISC /* Print error indicated by `h_errno' variable on standard error. STR if non-null is printed before the error string. */ extern void herror(const char *__str) __THROW; /* Return string associated with error ERR_NUM. */ extern const char *hstrerror(int __err_num) __THROW; #endif /* Description of data base entry for a single host. */ struct hostent { char *h_name; /* Official name of host. */ char **h_aliases; /* Alias list. */ int h_addrtype; /* Host address type. */ int h_length; /* Length of address. */ char **h_addr_list; /* List of addresses from name server. */ #ifdef __USE_MISC # define h_addr h_addr_list[0] /* Address, for backward compatibility. */ #endif }; /* Open host data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void sethostent(int __stay_open); /* Close host data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endhostent(void); /* Get next entry from host data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostent(void); /* Return entry from host data base which address match ADDR with length LEN and type TYPE. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostbyaddr(const void *__addr, __socklen_t __len, int __type); /* Return entry from host data base for host with NAME. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostbyname(const char *__name); #ifdef __USE_MISC /* Return entry from host data base for host with NAME. AF must be set to the address type which is `AF_INET' for IPv4 or `AF_INET6' for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostbyname2(const char *__name, int __af); /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. The last argument is a pointer to a variable which gets the value which would be stored in the global variable `herrno' by the non-reentrant functions. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int gethostent_r(struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); extern int gethostbyaddr_r(const void *__restrict __addr, __socklen_t __len, int __type, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); extern int gethostbyname_r(const char *__restrict __name, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); extern int gethostbyname2_r(const char *__restrict __name, int __af, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); #endif /* misc */ /* Open network data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setnetent(int __stay_open); /* Close network data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endnetent(void); /* Get next entry from network data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct netent *getnetent(void); /* Return entry from network data base which address match NET and type TYPE. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct netent *getnetbyaddr(uint32_t __net, int __type); /* Return entry from network data base for network with NAME. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct netent *getnetbyname(const char *__name); #ifdef __USE_MISC /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. The last argument is a pointer to a variable which gets the value which would be stored in the global variable `herrno' by the non-reentrant functions. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int getnetent_r(struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); extern int getnetbyaddr_r(uint32_t __net, int __type, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); extern int getnetbyname_r(const char *__restrict __name, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); #endif /* misc */ /* Description of data base entry for a single service. */ struct servent { char *s_name; /* Official service name. */ char **s_aliases; /* Alias list. */ int s_port; /* Port number. */ char *s_proto; /* Protocol to use. */ }; /* Open service data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setservent(int __stay_open); /* Close service data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endservent(void); /* Get next entry from service data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct servent *getservent(void); /* Return entry from network data base for network with NAME and protocol PROTO. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct servent *getservbyname(const char *__name, const char *__proto); /* Return entry from service data base which matches port PORT and protocol PROTO. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct servent *getservbyport(int __port, const char *__proto); #ifdef __USE_MISC /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int getservent_r(struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); extern int getservbyname_r(const char *__restrict __name, const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); extern int getservbyport_r(int __port, const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); #endif /* misc */ /* Description of data base entry for a single service. */ struct protoent { char *p_name; /* Official protocol name. */ char **p_aliases; /* Alias list. */ int p_proto; /* Protocol number. */ }; /* Open protocol data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setprotoent(int __stay_open); /* Close protocol data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endprotoent(void); /* Get next entry from protocol data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct protoent *getprotoent(void); /* Return entry from protocol data base for network with NAME. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct protoent *getprotobyname(const char *__name); /* Return entry from protocol data base which number is PROTO. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct protoent *getprotobynumber(int __proto); #ifdef __USE_MISC /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int getprotoent_r(struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); extern int getprotobyname_r(const char *__restrict __name, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); extern int getprotobynumber_r(int __proto, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); /* Establish network group NETGROUP for enumeration. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int setnetgrent(const char *__netgroup); /* Free all space allocated by previous `setnetgrent' call. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern void endnetgrent(void); /* Get next member of netgroup established by last `setnetgrent' call and return pointers to elements in HOSTP, USERP, and DOMAINP. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getnetgrent(char **__restrict __hostp, char **__restrict __userp, char **__restrict __domainp); /* Test whether NETGROUP contains the triple (HOST,USER,DOMAIN). This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int innetgr(const char *__netgroup, const char *__host, const char *__user, const char *__domain); /* Reentrant version of `getnetgrent' where result is placed in BUFFER. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getnetgrent_r(char **__restrict __hostp, char **__restrict __userp, char **__restrict __domainp, char *__restrict __buffer, size_t __buflen); #endif /* misc */ #ifdef __USE_MISC /* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD. The local user is LOCUSER, on the remote machine the command is executed as REMUSER. In *FD2P the descriptor to the socket for the connection is returned. The caller must have the right to use a reserved port. When the function returns *AHOST contains the official host name. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rcmd(char **__restrict __ahost, unsigned short int __rport, const char *__restrict __locuser, const char *__restrict __remuser, const char *__restrict __cmd, int *__restrict __fd2p); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rcmd_af(char **__restrict __ahost, unsigned short int __rport, const char *__restrict __locuser, const char *__restrict __remuser, const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af); /* Call `rexecd' at port RPORT on remote machine *AHOST to execute CMD. The process runs at the remote machine using the ID of user NAME whose cleartext password is PASSWD. In *FD2P the descriptor to the socket for the connection is returned. When the function returns *AHOST contains the official host name. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rexec(char **__restrict __ahost, int __rport, const char *__restrict __name, const char *__restrict __pass, const char *__restrict __cmd, int *__restrict __fd2p); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rexec_af(char **__restrict __ahost, int __rport, const char *__restrict __name, const char *__restrict __pass, const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af); /* Check whether user REMUSER on system RHOST is allowed to login as LOCUSER. If SUSER is not zero the user tries to become superuser. Return 0 if it is possible. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int ruserok(const char *__rhost, int __suser, const char *__remuser, const char *__locuser); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int ruserok_af(const char *__rhost, int __suser, const char *__remuser, const char *__locuser, sa_family_t __af); /* Check whether user REMUSER on system indicated by IPv4 address RADDR is allowed to login as LOCUSER. Non-IPv4 (e.g., IPv6) are not supported. If SUSER is not zero the user tries to become superuser. Return 0 if it is possible. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int iruserok(uint32_t __raddr, int __suser, const char *__remuser, const char *__locuser); /* This is the equivalent function where the pfamiliy if the address pointed to by RADDR is determined by the value of AF. It therefore can be used for IPv6 This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int iruserok_af(const void *__raddr, int __suser, const char *__remuser, const char *__locuser, sa_family_t __af); /* Try to allocate reserved port, returning a descriptor for a socket opened at this port or -1 if unsuccessful. The search for an available port will start at ALPORT and continues with lower numbers. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rresvport(int *__alport); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rresvport_af(int *__alport, sa_family_t __af); #endif /* Extension from POSIX.1:2001. */ #ifdef __USE_XOPEN2K /* Structure to contain information about address of a service provider. */ struct addrinfo { int ai_flags; /* Input flags. */ int ai_family; /* Protocol family for socket. */ int ai_socktype; /* Socket type. */ int ai_protocol; /* Protocol for socket. */ socklen_t ai_addrlen; /* Length of socket address. */ struct sockaddr *ai_addr; /* Socket address for socket. */ char *ai_canonname; /* Canonical name for service location. */ struct addrinfo *ai_next; /* Pointer to next in list. */ }; # ifdef __USE_GNU /* Structure used as control block for asynchronous lookup. */ struct gaicb { const char *ar_name; /* Name to look up. */ const char *ar_service; /* Service name. */ const struct addrinfo *ar_request; /* Additional request specification. */ struct addrinfo *ar_result; /* Pointer to result. */ /* The following are internal elements. */ int __return; int __glibc_reserved[5]; }; /* Lookup mode. */ # define GAI_WAIT 0 # define GAI_NOWAIT 1 # endif /* Possible values for `ai_flags' field in `addrinfo' structure. */ # define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */ # define AI_CANONNAME 0x0002 /* Request for canonical name. */ # define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */ # define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */ # define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */ # define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose returned address type.. */ # ifdef __USE_GNU # define AI_IDN 0x0040 /* IDN encode input (assuming it is encoded in the current locale's character set) before looking it up. */ # define AI_CANONIDN 0x0080 /* Translate canonical name from IDN format. */ # define AI_IDN_ALLOW_UNASSIGNED 0x0100 /* Don't reject unassigned Unicode code points. */ # define AI_IDN_USE_STD3_ASCII_RULES 0x0200 /* Validate strings according to STD3 rules. */ # endif # define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */ /* Error values for `getaddrinfo' function. */ # define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */ # define EAI_NONAME -2 /* NAME or SERVICE is unknown. */ # define EAI_AGAIN -3 /* Temporary failure in name resolution. */ # define EAI_FAIL -4 /* Non-recoverable failure in name res. */ # define EAI_FAMILY -6 /* `ai_family' not supported. */ # define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */ # define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */ # define EAI_MEMORY -10 /* Memory allocation failure. */ # define EAI_SYSTEM -11 /* System error returned in `errno'. */ # define EAI_OVERFLOW -12 /* Argument buffer overflow. */ # ifdef __USE_GNU # define EAI_NODATA -5 /* No address associated with NAME. */ # define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */ # define EAI_INPROGRESS -100 /* Processing request in progress. */ # define EAI_CANCELED -101 /* Request canceled. */ # define EAI_NOTCANCELED -102 /* Request not canceled. */ # define EAI_ALLDONE -103 /* All requests done. */ # define EAI_INTR -104 /* Interrupted by a signal. */ # define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ # endif # ifdef __USE_MISC # define NI_MAXHOST 1025 # define NI_MAXSERV 32 # endif # define NI_NUMERICHOST 1 /* Don't try to look up hostname. */ # define NI_NUMERICSERV 2 /* Don't convert port number to name. */ # define NI_NOFQDN 4 /* Only return nodename portion. */ # define NI_NAMEREQD 8 /* Don't return numeric addresses. */ # define NI_DGRAM 16 /* Look up UDP service rather than TCP. */ # ifdef __USE_GNU # define NI_IDN 32 /* Convert name from IDN format. */ # define NI_IDN_ALLOW_UNASSIGNED 64 /* Don't reject unassigned Unicode code points. */ # define NI_IDN_USE_STD3_ASCII_RULES 128 /* Validate strings according to STD3 rules. */ # endif /* Translate name of a service location and/or a service name to set of socket addresses. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getaddrinfo(const char *__restrict __name, const char *__restrict __service, const struct addrinfo *__restrict __req, struct addrinfo **__restrict __pai); /* Free `addrinfo' structure AI including associated storage. */ extern void freeaddrinfo(struct addrinfo *__ai) __THROW; /* Convert error return from getaddrinfo() to a string. */ extern const char *gai_strerror(int __ecode) __THROW; /* Translate a socket address to a location and service name. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getnameinfo(const struct sockaddr *__restrict __sa, socklen_t __salen, char *__restrict __host, socklen_t __hostlen, char *__restrict __serv, socklen_t __servlen, int __flags); #endif /* POSIX */ #ifdef __USE_GNU /* Enqueue ENT requests from the LIST. If MODE is GAI_WAIT wait until all requests are handled. If WAIT is GAI_NOWAIT return immediately after queueing the requests and signal completion according to SIG. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getaddrinfo_a(int __mode, struct gaicb *__list[__restrict_arr], int __ent, struct sigevent *__restrict __sig); /* Suspend execution of the thread until at least one of the ENT requests in LIST is handled. If TIMEOUT is not a null pointer it specifies the longest time the function keeps waiting before returning with an error. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int gai_suspend(const struct gaicb *const __list[], int __ent, const struct timespec *__timeout); /* Get the error status of the request REQ. */ extern int gai_error(struct gaicb *__req) __THROW; /* Cancel the requests associated with GAICBP. */ extern int gai_cancel(struct gaicb *__gaicbp) __THROW; #endif /* GNU */ __END_DECLS #endif /* netdb.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/netinet/in.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _NETINET_IN_H #define _NETINET_IN_H 1 #include #include #include #include __BEGIN_DECLS /* Internet address. */ typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr; }; /* Get system-specific definitions. */ #include /* Standard well-defined IP protocols. */ enum { IPPROTO_IP = 0, /* Dummy protocol for TCP. */ #define IPPROTO_IP IPPROTO_IP IPPROTO_ICMP = 1, /* Internet Control Message Protocol. */ #define IPPROTO_ICMP IPPROTO_ICMP IPPROTO_IGMP = 2, /* Internet Group Management Protocol. */ #define IPPROTO_IGMP IPPROTO_IGMP IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94). */ #define IPPROTO_IPIP IPPROTO_IPIP IPPROTO_TCP = 6, /* Transmission Control Protocol. */ #define IPPROTO_TCP IPPROTO_TCP IPPROTO_EGP = 8, /* Exterior Gateway Protocol. */ #define IPPROTO_EGP IPPROTO_EGP IPPROTO_PUP = 12, /* PUP protocol. */ #define IPPROTO_PUP IPPROTO_PUP IPPROTO_UDP = 17, /* User Datagram Protocol. */ #define IPPROTO_UDP IPPROTO_UDP IPPROTO_IDP = 22, /* XNS IDP protocol. */ #define IPPROTO_IDP IPPROTO_IDP IPPROTO_TP = 29, /* SO Transport Protocol Class 4. */ #define IPPROTO_TP IPPROTO_TP IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol. */ #define IPPROTO_DCCP IPPROTO_DCCP IPPROTO_IPV6 = 41, /* IPv6 header. */ #define IPPROTO_IPV6 IPPROTO_IPV6 IPPROTO_RSVP = 46, /* Reservation Protocol. */ #define IPPROTO_RSVP IPPROTO_RSVP IPPROTO_GRE = 47, /* General Routing Encapsulation. */ #define IPPROTO_GRE IPPROTO_GRE IPPROTO_ESP = 50, /* encapsulating security payload. */ #define IPPROTO_ESP IPPROTO_ESP IPPROTO_AH = 51, /* authentication header. */ #define IPPROTO_AH IPPROTO_AH IPPROTO_MTP = 92, /* Multicast Transport Protocol. */ #define IPPROTO_MTP IPPROTO_MTP IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET. */ #define IPPROTO_BEETPH IPPROTO_BEETPH IPPROTO_ENCAP = 98, /* Encapsulation Header. */ #define IPPROTO_ENCAP IPPROTO_ENCAP IPPROTO_PIM = 103, /* Protocol Independent Multicast. */ #define IPPROTO_PIM IPPROTO_PIM IPPROTO_COMP = 108, /* Compression Header Protocol. */ #define IPPROTO_COMP IPPROTO_COMP IPPROTO_SCTP = 132, /* Stream Control Transmission Protocol. */ #define IPPROTO_SCTP IPPROTO_SCTP IPPROTO_UDPLITE = 136, /* UDP-Lite protocol. */ #define IPPROTO_UDPLITE IPPROTO_UDPLITE IPPROTO_RAW = 255, /* Raw IP packets. */ #define IPPROTO_RAW IPPROTO_RAW IPPROTO_MAX }; /* If __USE_KERNEL_IPV6_DEFS is defined then the user has included the kernel network headers first and we should use those ABI-identical definitions instead of our own. */ #ifndef __USE_KERNEL_IPV6_DEFS enum { IPPROTO_HOPOPTS = 0, /* IPv6 Hop-by-Hop options. */ #define IPPROTO_HOPOPTS IPPROTO_HOPOPTS IPPROTO_ROUTING = 43, /* IPv6 routing header. */ #define IPPROTO_ROUTING IPPROTO_ROUTING IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header. */ #define IPPROTO_FRAGMENT IPPROTO_FRAGMENT IPPROTO_ICMPV6 = 58, /* ICMPv6. */ #define IPPROTO_ICMPV6 IPPROTO_ICMPV6 IPPROTO_NONE = 59, /* IPv6 no next header. */ #define IPPROTO_NONE IPPROTO_NONE IPPROTO_DSTOPTS = 60, /* IPv6 destination options. */ #define IPPROTO_DSTOPTS IPPROTO_DSTOPTS IPPROTO_MH = 135 /* IPv6 mobility header. */ #define IPPROTO_MH IPPROTO_MH }; #endif /* !__USE_KERNEL_IPV6_DEFS */ /* Type to represent a port. */ typedef uint16_t in_port_t; /* Standard well-known ports. */ enum { IPPORT_ECHO = 7, /* Echo service. */ IPPORT_DISCARD = 9, /* Discard transmissions service. */ IPPORT_SYSTAT = 11, /* System status service. */ IPPORT_DAYTIME = 13, /* Time of day service. */ IPPORT_NETSTAT = 15, /* Network status service. */ IPPORT_FTP = 21, /* File Transfer Protocol. */ IPPORT_TELNET = 23, /* Telnet protocol. */ IPPORT_SMTP = 25, /* Simple Mail Transfer Protocol. */ IPPORT_TIMESERVER = 37, /* Timeserver service. */ IPPORT_NAMESERVER = 42, /* Domain Name Service. */ IPPORT_WHOIS = 43, /* Internet Whois service. */ IPPORT_MTP = 57, IPPORT_TFTP = 69, /* Trivial File Transfer Protocol. */ IPPORT_RJE = 77, IPPORT_FINGER = 79, /* Finger service. */ IPPORT_TTYLINK = 87, IPPORT_SUPDUP = 95, /* SUPDUP protocol. */ IPPORT_EXECSERVER = 512, /* execd service. */ IPPORT_LOGINSERVER = 513, /* rlogind service. */ IPPORT_CMDSERVER = 514, IPPORT_EFSSERVER = 520, /* UDP ports. */ IPPORT_BIFFUDP = 512, IPPORT_WHOSERVER = 513, IPPORT_ROUTESERVER = 520, /* Ports less than this value are reserved for privileged processes. */ IPPORT_RESERVED = 1024, /* Ports greater this value are reserved for (non-privileged) servers. */ IPPORT_USERRESERVED = 5000 }; /* Definitions of the bits in an Internet address integer. On subnets, host and network parts are found according to the subnet mask, not these masks. */ #define IN_CLASSA(a) ((((in_addr_t)(a)) & 0x80000000) == 0) #define IN_CLASSA_NET 0xff000000 #define IN_CLASSA_NSHIFT 24 #define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET) #define IN_CLASSA_MAX 128 #define IN_CLASSB(a) ((((in_addr_t)(a)) & 0xc0000000) == 0x80000000) #define IN_CLASSB_NET 0xffff0000 #define IN_CLASSB_NSHIFT 16 #define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET) #define IN_CLASSB_MAX 65536 #define IN_CLASSC(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000) #define IN_CLASSC_NET 0xffffff00 #define IN_CLASSC_NSHIFT 8 #define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET) #define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000) #define IN_MULTICAST(a) IN_CLASSD(a) #define IN_EXPERIMENTAL(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000) #define IN_BADCLASS(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000) /* Address to accept any incoming messages. */ #define INADDR_ANY ((in_addr_t) 0x00000000) /* Address to send to all hosts. */ #define INADDR_BROADCAST ((in_addr_t) 0xffffffff) /* Address indicating an error return. */ #define INADDR_NONE ((in_addr_t) 0xffffffff) /* Network number for local host loopback. */ #define IN_LOOPBACKNET 127 /* Address to loopback in software to local host. */ #ifndef INADDR_LOOPBACK # define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) /* Inet 127.0.0.1. */ #endif /* Defines for Multicast INADDR. */ #define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) /* 224.0.0.0 */ #define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001) /* 224.0.0.1 */ #define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002) /* 224.0.0.2 */ #define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */ #ifndef __USE_KERNEL_IPV6_DEFS /* IPv6 address */ struct in6_addr { union { uint8_t __u6_addr8[16]; #ifdef __USE_MISC uint16_t __u6_addr16[8]; uint32_t __u6_addr32[4]; #endif } __in6_u; #define s6_addr __in6_u.__u6_addr8 #ifdef __USE_MISC # define s6_addr16 __in6_u.__u6_addr16 # define s6_addr32 __in6_u.__u6_addr32 #endif }; #endif /* !__USE_KERNEL_IPV6_DEFS */ extern const struct in6_addr in6addr_any; /* :: */ extern const struct in6_addr in6addr_loopback; /* ::1 */ #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } #define INET_ADDRSTRLEN 16 #define INET6_ADDRSTRLEN 46 /* Structure describing an Internet socket address. */ struct sockaddr_in { __SOCKADDR_COMMON(sin_); in_port_t sin_port; /* Port number. */ struct in_addr sin_addr; /* Internet address. */ /* Pad to size of `struct sockaddr'. */ unsigned char sin_zero[sizeof(struct sockaddr) - __SOCKADDR_COMMON_SIZE - sizeof(in_port_t) - sizeof(struct in_addr)]; }; #ifndef __USE_KERNEL_IPV6_DEFS /* Ditto, for IPv6. */ struct sockaddr_in6 { __SOCKADDR_COMMON(sin6_); in_port_t sin6_port; /* Transport layer port # */ uint32_t sin6_flowinfo; /* IPv6 flow information */ struct in6_addr sin6_addr; /* IPv6 address */ uint32_t sin6_scope_id; /* IPv6 scope-id */ }; #endif /* !__USE_KERNEL_IPV6_DEFS */ #ifdef __USE_MISC /* IPv4 multicast request. */ struct ip_mreq { /* IP multicast address of group. */ struct in_addr imr_multiaddr; /* Local IP address of interface. */ struct in_addr imr_interface; }; struct ip_mreq_source { /* IP multicast address of group. */ struct in_addr imr_multiaddr; /* IP address of source. */ struct in_addr imr_interface; /* IP address of interface. */ struct in_addr imr_sourceaddr; }; #endif #ifndef __USE_KERNEL_IPV6_DEFS /* Likewise, for IPv6. */ struct ipv6_mreq { /* IPv6 multicast address of group */ struct in6_addr ipv6mr_multiaddr; /* local interface */ unsigned int ipv6mr_interface; }; #endif /* !__USE_KERNEL_IPV6_DEFS */ #ifdef __USE_MISC /* Multicast group request. */ struct group_req { /* Interface index. */ uint32_t gr_interface; /* Group address. */ struct sockaddr_storage gr_group; }; struct group_source_req { /* Interface index. */ uint32_t gsr_interface; /* Group address. */ struct sockaddr_storage gsr_group; /* Source address. */ struct sockaddr_storage gsr_source; }; /* Full-state filter operations. */ struct ip_msfilter { /* IP multicast address of group. */ struct in_addr imsf_multiaddr; /* Local IP address of interface. */ struct in_addr imsf_interface; /* Filter mode. */ uint32_t imsf_fmode; /* Number of source addresses. */ uint32_t imsf_numsrc; /* Source addresses. */ struct in_addr imsf_slist[1]; }; #define IP_MSFILTER_SIZE(numsrc) (sizeof (struct ip_msfilter) \ - sizeof (struct in_addr) \ + (numsrc) * sizeof (struct in_addr)) struct group_filter { /* Interface index. */ uint32_t gf_interface; /* Group address. */ struct sockaddr_storage gf_group; /* Filter mode. */ uint32_t gf_fmode; /* Number of source addresses. */ uint32_t gf_numsrc; /* Source addresses. */ struct sockaddr_storage gf_slist[1]; }; #define GROUP_FILTER_SIZE(numsrc) (sizeof (struct group_filter) \ - sizeof (struct sockaddr_storage) \ + ((numsrc) \ * sizeof (struct sockaddr_storage))) #endif /* Functions to convert between host and network byte order. Please note that these functions normally take `unsigned long int' or `unsigned short int' values as arguments and also return them. But this was a short-sighted decision since on different systems the types may have different representations but the values are always the same. */ extern uint32_t ntohl(uint32_t __netlong) __THROW __attribute__ ((__const__)); extern uint16_t ntohs(uint16_t __netshort) __THROW __attribute__ ((__const__)); extern uint32_t htonl(uint32_t __hostlong) __THROW __attribute__ ((__const__)); extern uint16_t htons(uint16_t __hostshort) __THROW __attribute__ ((__const__)); #include /* Get machine dependent optimized versions of byte swapping functions. */ #include #ifdef __OPTIMIZE__ /* We can optimize calls to the conversion functions. Either nothing has to be done or we are using directly the byte-swapping functions which often can be inlined. */ # if __BYTE_ORDER == __BIG_ENDIAN /* The host byte order is the same as network byte order, so these functions are all just identity. */ # define ntohl(x) (x) # define ntohs(x) (x) # define htonl(x) (x) # define htons(x) (x) # else # if __BYTE_ORDER == __LITTLE_ENDIAN # define ntohl(x) __bswap_32 (x) # define ntohs(x) __bswap_16 (x) # define htonl(x) __bswap_32 (x) # define htons(x) __bswap_16 (x) # endif # endif #endif #ifdef __GNUC__ # define IN6_IS_ADDR_UNSPECIFIED(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ __a->s6_addr32[0] == 0 \ && __a->s6_addr32[1] == 0 \ && __a->s6_addr32[2] == 0 \ && __a->s6_addr32[3] == 0; })) # define IN6_IS_ADDR_LOOPBACK(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ __a->s6_addr32[0] == 0 \ && __a->s6_addr32[1] == 0 \ && __a->s6_addr32[2] == 0 \ && __a->s6_addr32[3] == htonl (1); })) # define IN6_IS_ADDR_LINKLOCAL(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ (__a->s6_addr32[0] & htonl (0xffc00000)) == htonl (0xfe800000); })) # define IN6_IS_ADDR_SITELOCAL(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ (__a->s6_addr32[0] & htonl (0xffc00000)) == htonl (0xfec00000); })) # define IN6_IS_ADDR_V4MAPPED(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ __a->s6_addr32[0] == 0 \ && __a->s6_addr32[1] == 0 \ && __a->s6_addr32[2] == htonl (0xffff); })) # define IN6_IS_ADDR_V4COMPAT(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ __a->s6_addr32[0] == 0 \ && __a->s6_addr32[1] == 0 \ && __a->s6_addr32[2] == 0 \ && ntohl (__a->s6_addr32[3]) > 1; })) # define IN6_ARE_ADDR_EQUAL(a,b) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ const struct in6_addr *__b = (const struct in6_addr *) (b); \ __a->s6_addr32[0] == __b->s6_addr32[0] \ && __a->s6_addr32[1] == __b->s6_addr32[1] \ && __a->s6_addr32[2] == __b->s6_addr32[2] \ && __a->s6_addr32[3] == __b->s6_addr32[3]; })) #else # define IN6_IS_ADDR_UNSPECIFIED(a) \ (((const uint32_t *) (a))[0] == 0 \ && ((const uint32_t *) (a))[1] == 0 \ && ((const uint32_t *) (a))[2] == 0 \ && ((const uint32_t *) (a))[3] == 0) # define IN6_IS_ADDR_LOOPBACK(a) \ (((const uint32_t *) (a))[0] == 0 \ && ((const uint32_t *) (a))[1] == 0 \ && ((const uint32_t *) (a))[2] == 0 \ && ((const uint32_t *) (a))[3] == htonl (1)) # define IN6_IS_ADDR_LINKLOCAL(a) \ ((((const uint32_t *) (a))[0] & htonl (0xffc00000)) \ == htonl (0xfe800000)) # define IN6_IS_ADDR_SITELOCAL(a) \ ((((const uint32_t *) (a))[0] & htonl (0xffc00000)) \ == htonl (0xfec00000)) # define IN6_IS_ADDR_V4MAPPED(a) \ ((((const uint32_t *) (a))[0] == 0) \ && (((const uint32_t *) (a))[1] == 0) \ && (((const uint32_t *) (a))[2] == htonl (0xffff))) # define IN6_IS_ADDR_V4COMPAT(a) \ ((((const uint32_t *) (a))[0] == 0) \ && (((const uint32_t *) (a))[1] == 0) \ && (((const uint32_t *) (a))[2] == 0) \ && (ntohl (((const uint32_t *) (a))[3]) > 1)) # define IN6_ARE_ADDR_EQUAL(a,b) \ ((((const uint32_t *) (a))[0] == ((const uint32_t *) (b))[0]) \ && (((const uint32_t *) (a))[1] == ((const uint32_t *) (b))[1]) \ && (((const uint32_t *) (a))[2] == ((const uint32_t *) (b))[2]) \ && (((const uint32_t *) (a))[3] == ((const uint32_t *) (b))[3])) #endif #define IN6_IS_ADDR_MULTICAST(a) (((const uint8_t *) (a))[0] == 0xff) #ifdef __USE_MISC /* Bind socket to a privileged IP port. */ extern int bindresvport(int __sockfd, struct sockaddr_in *__sock_in) __THROW; /* The IPv6 version of this function. */ extern int bindresvport6(int __sockfd, struct sockaddr_in6 *__sock_in) __THROW; #endif #define IN6_IS_ADDR_MC_NODELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0x1)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0x2)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0x5)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0x8)) #define IN6_IS_ADDR_MC_GLOBAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0xe)) #ifdef __USE_GNU struct cmsghdr; /* Forward declaration. */ #ifndef __USE_KERNEL_IPV6_DEFS /* IPv6 packet information. */ struct in6_pktinfo { struct in6_addr ipi6_addr; /* src/dst IPv6 address */ unsigned int ipi6_ifindex; /* send/recv interface index */ }; /* IPv6 MTU information. */ struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; /* dst address including zone ID */ uint32_t ip6m_mtu; /* path MTU in host byte order */ }; #endif /* !__USE_KERNEL_IPV6_DEFS */ /* Obsolete hop-by-hop and Destination Options Processing (RFC 2292). */ extern int inet6_option_space(int __nbytes) __THROW __attribute_deprecated__; extern int inet6_option_init(void *__bp, struct cmsghdr **__cmsgp, int __type) __THROW __attribute_deprecated__; extern int inet6_option_append(struct cmsghdr *__cmsg, const uint8_t * __typep, int __multx, int __plusy) __THROW __attribute_deprecated__; extern uint8_t *inet6_option_alloc(struct cmsghdr *__cmsg, int __datalen, int __multx, int __plusy) __THROW __attribute_deprecated__; extern int inet6_option_next(const struct cmsghdr *__cmsg, uint8_t ** __tptrp) __THROW __attribute_deprecated__; extern int inet6_option_find(const struct cmsghdr *__cmsg, uint8_t ** __tptrp, int __type) __THROW __attribute_deprecated__; /* Hop-by-Hop and Destination Options Processing (RFC 3542). */ extern int inet6_opt_init(void *__extbuf, socklen_t __extlen) __THROW; extern int inet6_opt_append(void *__extbuf, socklen_t __extlen, int __offset, uint8_t __type, socklen_t __len, uint8_t __align, void **__databufp) __THROW; extern int inet6_opt_finish(void *__extbuf, socklen_t __extlen, int __offset) __THROW; extern int inet6_opt_set_val(void *__databuf, int __offset, void *__val, socklen_t __vallen) __THROW; extern int inet6_opt_next(void *__extbuf, socklen_t __extlen, int __offset, uint8_t * __typep, socklen_t * __lenp, void **__databufp) __THROW; extern int inet6_opt_find(void *__extbuf, socklen_t __extlen, int __offset, uint8_t __type, socklen_t * __lenp, void **__databufp) __THROW; extern int inet6_opt_get_val(void *__databuf, int __offset, void *__val, socklen_t __vallen) __THROW; /* Routing Header Option (RFC 3542). */ extern socklen_t inet6_rth_space(int __type, int __segments) __THROW; extern void *inet6_rth_init(void *__bp, socklen_t __bp_len, int __type, int __segments) __THROW; extern int inet6_rth_add(void *__bp, const struct in6_addr *__addr) __THROW; extern int inet6_rth_reverse(const void *__in, void *__out) __THROW; extern int inet6_rth_segments(const void *__bp) __THROW; extern struct in6_addr *inet6_rth_getaddr(const void *__bp, int __index) __THROW; /* Multicast source filter support. */ /* Get IPv4 source filter. */ extern int getipv4sourcefilter(int __s, struct in_addr __interface_addr, struct in_addr __group, uint32_t * __fmode, uint32_t * __numsrc, struct in_addr *__slist) __THROW; /* Set IPv4 source filter. */ extern int setipv4sourcefilter(int __s, struct in_addr __interface_addr, struct in_addr __group, uint32_t __fmode, uint32_t __numsrc, const struct in_addr *__slist) __THROW; /* Get source filter. */ extern int getsourcefilter(int __s, uint32_t __interface_addr, const struct sockaddr *__group, socklen_t __grouplen, uint32_t * __fmode, uint32_t * __numsrc, struct sockaddr_storage *__slist) __THROW; /* Set source filter. */ extern int setsourcefilter(int __s, uint32_t __interface_addr, const struct sockaddr *__group, socklen_t __grouplen, uint32_t __fmode, uint32_t __numsrc, const struct sockaddr_storage *__slist) __THROW; #endif /* use GNU */ __END_DECLS #endif /* netinet/in.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/pthread.h ================================================ /* Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _PTHREAD_H #define _PTHREAD_H 1 #include #include #include #include #include #include #include /* Detach state. */ enum { PTHREAD_CREATE_JOINABLE, #define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_DETACHED #define PTHREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED }; /* Mutex types. */ enum { PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_ADAPTIVE_NP #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 , PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL #endif #ifdef __USE_GNU /* For compatibility. */ , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP #endif }; #ifdef __USE_XOPEN2K /* Robust mutex or not flags. */ enum { PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_ROBUST, PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST }; #endif #if defined __USE_POSIX199506 || defined __USE_UNIX98 /* Mutex protocols. */ enum { PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT }; #endif #ifdef __PTHREAD_MUTEX_HAVE_PREV # define PTHREAD_MUTEX_INITIALIZER \ { { 0, 0, 0, 0, 0, __PTHREAD_SPINS, { 0, 0 } } } # ifdef __USE_GNU # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, __PTHREAD_SPINS, { 0, 0 } } } # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, __PTHREAD_SPINS, { 0, 0 } } } # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, __PTHREAD_SPINS, { 0, 0 } } } # endif #else # define PTHREAD_MUTEX_INITIALIZER \ { { 0, 0, 0, 0, 0, { __PTHREAD_SPINS } } } # ifdef __USE_GNU # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { __PTHREAD_SPINS } } } # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { __PTHREAD_SPINS } } } # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { __PTHREAD_SPINS } } } # endif #endif /* Read-write lock types. */ #if defined __USE_UNIX98 || defined __USE_XOPEN2K enum { PTHREAD_RWLOCK_PREFER_READER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP }; /* Define __PTHREAD_RWLOCK_INT_FLAGS_SHARED to 1 if pthread_rwlock_t has the shared field. All 64-bit architectures have the shared field in pthread_rwlock_t. */ #ifndef __PTHREAD_RWLOCK_INT_FLAGS_SHARED # if __WORDSIZE == 64 # define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 # endif #endif /* Read-write lock initializers. */ # define PTHREAD_RWLOCK_INITIALIZER \ { { 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0 } } # ifdef __USE_GNU # ifdef __PTHREAD_RWLOCK_INT_FLAGS_SHARED # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, \ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } # else # if __BYTE_ORDER == __LITTLE_ENDIAN # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \ 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0 } } # else # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\ 0 } } # endif # endif # endif #endif /* Unix98 or XOpen2K */ /* Scheduler inheritance. */ enum { PTHREAD_INHERIT_SCHED, #define PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED PTHREAD_EXPLICIT_SCHED #define PTHREAD_EXPLICIT_SCHED PTHREAD_EXPLICIT_SCHED }; /* Scope handling. */ enum { PTHREAD_SCOPE_SYSTEM, #define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_PROCESS #define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS }; /* Process shared or private flag. */ enum { PTHREAD_PROCESS_PRIVATE, #define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_SHARED #define PTHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED }; /* Conditional variable handling. */ #define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } } /* Cleanup buffers */ struct _pthread_cleanup_buffer { void (*__routine) (void *); /* Function to call. */ void *__arg; /* Its argument. */ int __canceltype; /* Saved cancellation type. */ struct _pthread_cleanup_buffer *__prev; /* Chaining of cleanup functions. */ }; /* Cancellation */ enum { PTHREAD_CANCEL_ENABLE, #define PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_DISABLE #define PTHREAD_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE }; enum { PTHREAD_CANCEL_DEFERRED, #define PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_ASYNCHRONOUS #define PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS }; #define PTHREAD_CANCELED ((void *) -1) /* Single execution handling. */ #define PTHREAD_ONCE_INIT 0 #ifdef __USE_XOPEN2K /* Value returned by 'pthread_barrier_wait' for one of the threads after the required number of threads have called this function. -1 is distinct from 0 and all errno constants */ # define PTHREAD_BARRIER_SERIAL_THREAD -1 #endif __BEGIN_DECLS /* Create a new thread, starting with execution of START-ROUTINE getting passed ARG. Creation attributed come from ATTR. The new handle is stored in *NEWTHREAD. */ extern int pthread_create(pthread_t * __restrict __newthread, const pthread_attr_t * __restrict __attr, void *(*__start_routine) (void *), void *__restrict __arg) __THROWNL __nonnull((1, 3)); /* Terminate calling thread. The registered cleanup handlers are called via exception handling so we cannot mark this function with __THROW.*/ extern void pthread_exit(void *__retval) __attribute__ ((__noreturn__)); /* Make calling thread wait for termination of the thread TH. The exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN is not NULL. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_join(pthread_t __th, void **__thread_return); #ifdef __USE_GNU /* Check whether thread TH has terminated. If yes return the status of the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */ extern int pthread_tryjoin_np(pthread_t __th, void **__thread_return) __THROW; /* Make calling thread wait for termination of the thread TH, but only until TIMEOUT. The exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN is not NULL. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_timedjoin_np(pthread_t __th, void **__thread_return, const struct timespec *__abstime); #endif /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN. The resources of TH will therefore be freed immediately when it terminates, instead of waiting for another thread to perform PTHREAD_JOIN on it. */ extern int pthread_detach(pthread_t __th) __THROW; /* Obtain the identifier of the current thread. */ extern pthread_t pthread_self(void) __THROW __attribute__ ((__const__)); /* Compare two thread identifiers. */ extern int pthread_equal(pthread_t __thread1, pthread_t __thread2) __THROW __attribute__ ((__const__)); /* Thread attribute handling. */ /* Initialize thread attribute *ATTR with default attributes (detachstate is PTHREAD_JOINABLE, scheduling policy is SCHED_OTHER, no user-provided stack). */ extern int pthread_attr_init(pthread_attr_t * __attr) __THROW __nonnull((1)); /* Destroy thread attribute *ATTR. */ extern int pthread_attr_destroy(pthread_attr_t * __attr) __THROW __nonnull((1)); /* Get detach state attribute. */ extern int pthread_attr_getdetachstate(const pthread_attr_t * __attr, int *__detachstate) __THROW __nonnull((1, 2)); /* Set detach state attribute. */ extern int pthread_attr_setdetachstate(pthread_attr_t * __attr, int __detachstate) __THROW __nonnull((1)); /* Get the size of the guard area created for stack overflow protection. */ extern int pthread_attr_getguardsize(const pthread_attr_t * __attr, size_t * __guardsize) __THROW __nonnull((1, 2)); /* Set the size of the guard area created for stack overflow protection. */ extern int pthread_attr_setguardsize(pthread_attr_t * __attr, size_t __guardsize) __THROW __nonnull((1)); /* Return in *PARAM the scheduling parameters of *ATTR. */ extern int pthread_attr_getschedparam(const pthread_attr_t * __restrict __attr, struct sched_param *__restrict __param) __THROW __nonnull((1, 2)); /* Set scheduling parameters (priority, etc) in *ATTR according to PARAM. */ extern int pthread_attr_setschedparam(pthread_attr_t * __restrict __attr, const struct sched_param *__restrict __param) __THROW __nonnull((1, 2)); /* Return in *POLICY the scheduling policy of *ATTR. */ extern int pthread_attr_getschedpolicy(const pthread_attr_t * __restrict __attr, int *__restrict __policy) __THROW __nonnull((1, 2)); /* Set scheduling policy in *ATTR according to POLICY. */ extern int pthread_attr_setschedpolicy(pthread_attr_t * __attr, int __policy) __THROW __nonnull((1)); /* Return in *INHERIT the scheduling inheritance mode of *ATTR. */ extern int pthread_attr_getinheritsched(const pthread_attr_t * __restrict __attr, int *__restrict __inherit) __THROW __nonnull((1, 2)); /* Set scheduling inheritance mode in *ATTR according to INHERIT. */ extern int pthread_attr_setinheritsched(pthread_attr_t * __attr, int __inherit) __THROW __nonnull((1)); /* Return in *SCOPE the scheduling contention scope of *ATTR. */ extern int pthread_attr_getscope(const pthread_attr_t * __restrict __attr, int *__restrict __scope) __THROW __nonnull((1, 2)); /* Set scheduling contention scope in *ATTR according to SCOPE. */ extern int pthread_attr_setscope(pthread_attr_t * __attr, int __scope) __THROW __nonnull((1)); /* Return the previously set address for the stack. */ extern int pthread_attr_getstackaddr(const pthread_attr_t * __restrict __attr, void **__restrict __stackaddr) __THROW __nonnull((1, 2)) __attribute_deprecated__; /* Set the starting address of the stack of the thread to be created. Depending on whether the stack grows up or down the value must either be higher or lower than all the address in the memory block. The minimal size of the block must be PTHREAD_STACK_MIN. */ extern int pthread_attr_setstackaddr(pthread_attr_t * __attr, void *__stackaddr) __THROW __nonnull((1)) __attribute_deprecated__; /* Return the currently used minimal stack size. */ extern int pthread_attr_getstacksize(const pthread_attr_t * __restrict __attr, size_t * __restrict __stacksize) __THROW __nonnull((1, 2)); /* Add information about the minimum stack size needed for the thread to be started. This size must never be less than PTHREAD_STACK_MIN and must also not exceed the system limits. */ extern int pthread_attr_setstacksize(pthread_attr_t * __attr, size_t __stacksize) __THROW __nonnull((1)); #ifdef __USE_XOPEN2K /* Return the previously set address for the stack. */ extern int pthread_attr_getstack(const pthread_attr_t * __restrict __attr, void **__restrict __stackaddr, size_t * __restrict __stacksize) __THROW __nonnull((1, 2, 3)); /* The following two interfaces are intended to replace the last two. They require setting the address as well as the size since only setting the address will make the implementation on some architectures impossible. */ extern int pthread_attr_setstack(pthread_attr_t * __attr, void *__stackaddr, size_t __stacksize) __THROW __nonnull((1)); #endif #ifdef __USE_GNU /* Thread created with attribute ATTR will be limited to run only on the processors represented in CPUSET. */ extern int pthread_attr_setaffinity_np(pthread_attr_t * __attr, size_t __cpusetsize, const cpu_set_t * __cpuset) __THROW __nonnull((1, 3)); /* Get bit set in CPUSET representing the processors threads created with ATTR can run on. */ extern int pthread_attr_getaffinity_np(const pthread_attr_t * __attr, size_t __cpusetsize, cpu_set_t * __cpuset) __THROW __nonnull((1, 3)); /* Get the default attributes used by pthread_create in this process. */ extern int pthread_getattr_default_np(pthread_attr_t * __attr) __THROW __nonnull((1)); /* Set the default attributes to be used by pthread_create in this process. */ extern int pthread_setattr_default_np(const pthread_attr_t * __attr) __THROW __nonnull((1)); /* Initialize thread attribute *ATTR with attributes corresponding to the already running thread TH. It shall be called on uninitialized ATTR and destroyed with pthread_attr_destroy when no longer needed. */ extern int pthread_getattr_np(pthread_t __th, pthread_attr_t * __attr) __THROW __nonnull((2)); #endif /* Functions for scheduling control. */ /* Set the scheduling parameters for TARGET_THREAD according to POLICY and *PARAM. */ extern int pthread_setschedparam(pthread_t __target_thread, int __policy, const struct sched_param *__param) __THROW __nonnull((3)); /* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */ extern int pthread_getschedparam(pthread_t __target_thread, int *__restrict __policy, struct sched_param *__restrict __param) __THROW __nonnull((2, 3)); /* Set the scheduling priority for TARGET_THREAD. */ extern int pthread_setschedprio(pthread_t __target_thread, int __prio) __THROW; #ifdef __USE_GNU /* Get thread name visible in the kernel and its interfaces. */ extern int pthread_getname_np(pthread_t __target_thread, char *__buf, size_t __buflen) __THROW __nonnull((2)); /* Set thread name visible in the kernel and its interfaces. */ extern int pthread_setname_np(pthread_t __target_thread, const char *__name) __THROW __nonnull((2)); #endif #ifdef __USE_UNIX98 /* Determine level of concurrency. */ extern int pthread_getconcurrency(void) __THROW; /* Set new concurrency level to LEVEL. */ extern int pthread_setconcurrency(int __level) __THROW; #endif #ifdef __USE_GNU /* Yield the processor to another thread or process. This function is similar to the POSIX `sched_yield' function but might be differently implemented in the case of a m-on-n thread implementation. */ extern int pthread_yield(void) __THROW; /* Limit specified thread TH to run only on the processors represented in CPUSET. */ extern int pthread_setaffinity_np(pthread_t __th, size_t __cpusetsize, const cpu_set_t * __cpuset) __THROW __nonnull((3)); /* Get bit set in CPUSET representing the processors TH can run on. */ extern int pthread_getaffinity_np(pthread_t __th, size_t __cpusetsize, cpu_set_t * __cpuset) __THROW __nonnull((3)); #endif /* Functions for handling initialization. */ /* Guarantee that the initialization function INIT_ROUTINE will be called only once, even if pthread_once is executed several times with the same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or extern variable initialized to PTHREAD_ONCE_INIT. The initialization functions might throw exception which is why this function is not marked with __THROW. */ extern int pthread_once(pthread_once_t * __once_control, void (*__init_routine) (void)) __nonnull((1, 2)); /* Functions for handling cancellation. Note that these functions are explicitly not marked to not throw an exception in C++ code. If cancellation is implemented by unwinding this is necessary to have the compiler generate the unwind information. */ /* Set cancelability state of current thread to STATE, returning old state in *OLDSTATE if OLDSTATE is not NULL. */ extern int pthread_setcancelstate(int __state, int *__oldstate); /* Set cancellation state of current thread to TYPE, returning the old type in *OLDTYPE if OLDTYPE is not NULL. */ extern int pthread_setcanceltype(int __type, int *__oldtype); /* Cancel THREAD immediately or at the next possibility. */ extern int pthread_cancel(pthread_t __th); /* Test for pending cancellation for the current thread and terminate the thread as per pthread_exit(PTHREAD_CANCELED) if it has been cancelled. */ extern void pthread_testcancel(void); /* Cancellation handling with integration into exception handling. */ typedef struct { struct { __jmp_buf __cancel_jmp_buf; int __mask_was_saved; } __cancel_jmp_buf[1]; void *__pad[4]; } __pthread_unwind_buf_t __attribute__ ((__aligned__)); /* No special attributes by default. */ #ifndef __cleanup_fct_attribute # define __cleanup_fct_attribute #endif /* Structure to hold the cleanup handler information. */ struct __pthread_cleanup_frame { void (*__cancel_routine) (void *); void *__cancel_arg; int __do_it; int __cancel_type; }; #if defined __GNUC__ && defined __EXCEPTIONS # ifdef __cplusplus /* Class to handle cancellation handler invocation. */ class __pthread_cleanup_class { void (*__cancel_routine) (void *); void *__cancel_arg; int __do_it; int __cancel_type; public: __pthread_cleanup_class(void (*__fct) (void *), void *__arg) :__cancel_routine(__fct), __cancel_arg(__arg), __do_it(1) { } ~__pthread_cleanup_class() { if (__do_it) __cancel_routine(__cancel_arg); } void __setdoit(int __newval) { __do_it = __newval; } void __defer() { pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &__cancel_type); } void __restore() const { pthread_setcanceltype(__cancel_type, 0); }}; /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ # define pthread_cleanup_push(routine, arg) \ do { \ __pthread_cleanup_class __clframe (routine, arg) /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ # define pthread_cleanup_pop(execute) \ __clframe.__setdoit (execute); \ } while (0) # ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ # define pthread_cleanup_push_defer_np(routine, arg) \ do { \ __pthread_cleanup_class __clframe (routine, arg); \ __clframe.__defer () /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ # define pthread_cleanup_pop_restore_np(execute) \ __clframe.__restore (); \ __clframe.__setdoit (execute); \ } while (0) # endif # else /* Function called to call the cleanup handler. As an extern inline function the compiler is free to decide inlining the change when needed or fall back on the copy which must exist somewhere else. */ __extern_inline void __pthread_cleanup_routine(struct __pthread_cleanup_frame *__frame) { if (__frame->__do_it) __frame->__cancel_routine(__frame->__cancel_arg); } /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ # define pthread_cleanup_push(routine, arg) \ do { \ struct __pthread_cleanup_frame __clframe \ __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \ = { .__cancel_routine = (routine), .__cancel_arg = (arg), \ .__do_it = 1 }; /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ # define pthread_cleanup_pop(execute) \ __clframe.__do_it = (execute); \ } while (0) # ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ # define pthread_cleanup_push_defer_np(routine, arg) \ do { \ struct __pthread_cleanup_frame __clframe \ __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \ = { .__cancel_routine = (routine), .__cancel_arg = (arg), \ .__do_it = 1 }; \ (void) pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, \ &__clframe.__cancel_type) /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ # define pthread_cleanup_pop_restore_np(execute) \ (void) pthread_setcanceltype (__clframe.__cancel_type, NULL); \ __clframe.__do_it = (execute); \ } while (0) # endif # endif #else /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ # define pthread_cleanup_push(routine, arg) \ do { \ __pthread_unwind_buf_t __cancel_buf; \ void (*__cancel_routine) (void *) = (routine); \ void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ /* NOTREACHED */ \ } \ \ __pthread_register_cancel (&__cancel_buf); \ do { extern void __pthread_register_cancel(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute; /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ # define pthread_cleanup_pop(execute) \ do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ } while (0); \ __pthread_unregister_cancel (&__cancel_buf); \ if (execute) \ __cancel_routine (__cancel_arg); \ } while (0) extern void __pthread_unregister_cancel(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute; # ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ # define pthread_cleanup_push_defer_np(routine, arg) \ do { \ __pthread_unwind_buf_t __cancel_buf; \ void (*__cancel_routine) (void *) = (routine); \ void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ /* NOTREACHED */ \ } \ \ __pthread_register_cancel_defer (&__cancel_buf); \ do { extern void __pthread_register_cancel_defer(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute; /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ # define pthread_cleanup_pop_restore_np(execute) \ do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ } while (0); \ __pthread_unregister_cancel_restore (&__cancel_buf); \ if (execute) \ __cancel_routine (__cancel_arg); \ } while (0) extern void __pthread_unregister_cancel_restore(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute; # endif /* Internal interface to initiate cleanup. */ extern void __pthread_unwind_next(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute __attribute__ ((__noreturn__)) # ifndef SHARED __attribute__ ((__weak__)) # endif ; #endif /* Function used in the macros. */ struct __jmp_buf_tag; extern int __sigsetjmp(struct __jmp_buf_tag *__env, int __savemask) __THROWNL; /* Mutex handling. */ /* Initialize a mutex. */ extern int pthread_mutex_init(pthread_mutex_t * __mutex, const pthread_mutexattr_t * __mutexattr) __THROW __nonnull((1)); /* Destroy a mutex. */ extern int pthread_mutex_destroy(pthread_mutex_t * __mutex) __THROW __nonnull((1)); /* Try locking a mutex. */ extern int pthread_mutex_trylock(pthread_mutex_t * __mutex) __THROWNL __nonnull((1)); /* Lock a mutex. */ extern int pthread_mutex_lock(pthread_mutex_t * __mutex) __THROWNL __nonnull((1)); #ifdef __USE_XOPEN2K /* Wait until lock becomes available, or specified time passes. */ extern int pthread_mutex_timedlock(pthread_mutex_t * __restrict __mutex, const struct timespec *__restrict __abstime) __THROWNL __nonnull((1, 2)); #endif /* Unlock a mutex. */ extern int pthread_mutex_unlock(pthread_mutex_t * __mutex) __THROWNL __nonnull((1)); /* Get the priority ceiling of MUTEX. */ extern int pthread_mutex_getprioceiling(const pthread_mutex_t * __restrict __mutex, int *__restrict __prioceiling) __THROW __nonnull((1, 2)); /* Set the priority ceiling of MUTEX to PRIOCEILING, return old priority ceiling value in *OLD_CEILING. */ extern int pthread_mutex_setprioceiling(pthread_mutex_t * __restrict __mutex, int __prioceiling, int *__restrict __old_ceiling) __THROW __nonnull((1, 3)); #ifdef __USE_XOPEN2K8 /* Declare the state protected by MUTEX as consistent. */ extern int pthread_mutex_consistent(pthread_mutex_t * __mutex) __THROW __nonnull((1)); # ifdef __USE_GNU extern int pthread_mutex_consistent_np(pthread_mutex_t * __mutex) __THROW __nonnull((1)); # endif #endif /* Functions for handling mutex attributes. */ /* Initialize mutex attribute object ATTR with default attributes (kind is PTHREAD_MUTEX_TIMED_NP). */ extern int pthread_mutexattr_init(pthread_mutexattr_t * __attr) __THROW __nonnull((1)); /* Destroy mutex attribute object ATTR. */ extern int pthread_mutexattr_destroy(pthread_mutexattr_t * __attr) __THROW __nonnull((1)); /* Get the process-shared flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull((1, 2)); /* Set the process-shared flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_setpshared(pthread_mutexattr_t * __attr, int __pshared) __THROW __nonnull((1)); #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 /* Return in *KIND the mutex kind attribute in *ATTR. */ extern int pthread_mutexattr_gettype(const pthread_mutexattr_t * __restrict __attr, int *__restrict __kind) __THROW __nonnull((1, 2)); /* Set the mutex kind attribute in *ATTR to KIND (either PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, or PTHREAD_MUTEX_DEFAULT). */ extern int pthread_mutexattr_settype(pthread_mutexattr_t * __attr, int __kind) __THROW __nonnull((1)); #endif /* Return in *PROTOCOL the mutex protocol attribute in *ATTR. */ extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t * __restrict __attr, int *__restrict __protocol) __THROW __nonnull((1, 2)); /* Set the mutex protocol attribute in *ATTR to PROTOCOL (either PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, or PTHREAD_PRIO_PROTECT). */ extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t * __attr, int __protocol) __THROW __nonnull((1)); /* Return in *PRIOCEILING the mutex prioceiling attribute in *ATTR. */ extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t * __restrict __attr, int *__restrict __prioceiling) __THROW __nonnull((1, 2)); /* Set the mutex prioceiling attribute in *ATTR to PRIOCEILING. */ extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t * __attr, int __prioceiling) __THROW __nonnull((1)); #ifdef __USE_XOPEN2K /* Get the robustness flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_getrobust(const pthread_mutexattr_t * __attr, int *__robustness) __THROW __nonnull((1, 2)); # ifdef __USE_GNU extern int pthread_mutexattr_getrobust_np(const pthread_mutexattr_t * __attr, int *__robustness) __THROW __nonnull((1, 2)); # endif /* Set the robustness flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_setrobust(pthread_mutexattr_t * __attr, int __robustness) __THROW __nonnull((1)); # ifdef __USE_GNU extern int pthread_mutexattr_setrobust_np(pthread_mutexattr_t * __attr, int __robustness) __THROW __nonnull((1)); # endif #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K /* Functions for handling read-write locks. */ /* Initialize read-write lock RWLOCK using attributes ATTR, or use the default values if later is NULL. */ extern int pthread_rwlock_init(pthread_rwlock_t * __restrict __rwlock, const pthread_rwlockattr_t * __restrict __attr) __THROW __nonnull((1)); /* Destroy read-write lock RWLOCK. */ extern int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock) __THROW __nonnull((1)); /* Acquire read lock for RWLOCK. */ extern int pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); /* Try to acquire read lock for RWLOCK. */ extern int pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); # ifdef __USE_XOPEN2K /* Try to acquire read lock for RWLOCK or return after specfied time. */ extern int pthread_rwlock_timedrdlock(pthread_rwlock_t * __restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull((1, 2)); # endif /* Acquire write lock for RWLOCK. */ extern int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); /* Try to acquire write lock for RWLOCK. */ extern int pthread_rwlock_trywrlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); # ifdef __USE_XOPEN2K /* Try to acquire write lock for RWLOCK or return after specfied time. */ extern int pthread_rwlock_timedwrlock(pthread_rwlock_t * __restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull((1, 2)); # endif /* Unlock RWLOCK. */ extern int pthread_rwlock_unlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); /* Functions for handling read-write lock attributes. */ /* Initialize attribute object ATTR with default values. */ extern int pthread_rwlockattr_init(pthread_rwlockattr_t * __attr) __THROW __nonnull((1)); /* Destroy attribute object ATTR. */ extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t * __attr) __THROW __nonnull((1)); /* Return current setting of process-shared attribute of ATTR in PSHARED. */ extern int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull((1, 2)); /* Set process-shared attribute of ATTR to PSHARED. */ extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t * __attr, int __pshared) __THROW __nonnull((1)); /* Return current setting of reader/writer preference. */ extern int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pref) __THROW __nonnull((1, 2)); /* Set reader/write preference. */ extern int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t * __attr, int __pref) __THROW __nonnull((1)); #endif /* Functions for handling conditional variables. */ /* Initialize condition variable COND using attributes ATTR, or use the default values if later is NULL. */ extern int pthread_cond_init(pthread_cond_t * __restrict __cond, const pthread_condattr_t * __restrict __cond_attr) __THROW __nonnull((1)); /* Destroy condition variable COND. */ extern int pthread_cond_destroy(pthread_cond_t * __cond) __THROW __nonnull((1)); /* Wake up one thread waiting for condition variable COND. */ extern int pthread_cond_signal(pthread_cond_t * __cond) __THROWNL __nonnull((1)); /* Wake up all threads waiting for condition variables COND. */ extern int pthread_cond_broadcast(pthread_cond_t * __cond) __THROWNL __nonnull((1)); /* Wait for condition variable COND to be signaled or broadcast. MUTEX is assumed to be locked before. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_cond_wait(pthread_cond_t * __restrict __cond, pthread_mutex_t * __restrict __mutex) __nonnull((1, 2)); /* Wait for condition variable COND to be signaled or broadcast until ABSTIME. MUTEX is assumed to be locked before. ABSTIME is an absolute time specification; zero is the beginning of the epoch (00:00:00 GMT, January 1, 1970). This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_cond_timedwait(pthread_cond_t * __restrict __cond, pthread_mutex_t * __restrict __mutex, const struct timespec *__restrict __abstime) __nonnull((1, 2, 3)); /* Functions for handling condition variable attributes. */ /* Initialize condition variable attribute ATTR. */ extern int pthread_condattr_init(pthread_condattr_t * __attr) __THROW __nonnull((1)); /* Destroy condition variable attribute ATTR. */ extern int pthread_condattr_destroy(pthread_condattr_t * __attr) __THROW __nonnull((1)); /* Get the process-shared flag of the condition variable attribute ATTR. */ extern int pthread_condattr_getpshared(const pthread_condattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull((1, 2)); /* Set the process-shared flag of the condition variable attribute ATTR. */ extern int pthread_condattr_setpshared(pthread_condattr_t * __attr, int __pshared) __THROW __nonnull((1)); #ifdef __USE_XOPEN2K /* Get the clock selected for the condition variable attribute ATTR. */ extern int pthread_condattr_getclock(const pthread_condattr_t * __restrict __attr, __clockid_t * __restrict __clock_id) __THROW __nonnull((1, 2)); /* Set the clock selected for the condition variable attribute ATTR. */ extern int pthread_condattr_setclock(pthread_condattr_t * __attr, __clockid_t __clock_id) __THROW __nonnull((1)); #endif #ifdef __USE_XOPEN2K /* Functions to handle spinlocks. */ /* Initialize the spinlock LOCK. If PSHARED is nonzero the spinlock can be shared between different processes. */ extern int pthread_spin_init(pthread_spinlock_t * __lock, int __pshared) __THROW __nonnull((1)); /* Destroy the spinlock LOCK. */ extern int pthread_spin_destroy(pthread_spinlock_t * __lock) __THROW __nonnull((1)); /* Wait until spinlock LOCK is retrieved. */ extern int pthread_spin_lock(pthread_spinlock_t * __lock) __THROWNL __nonnull((1)); /* Try to lock spinlock LOCK. */ extern int pthread_spin_trylock(pthread_spinlock_t * __lock) __THROWNL __nonnull((1)); /* Release spinlock LOCK. */ extern int pthread_spin_unlock(pthread_spinlock_t * __lock) __THROWNL __nonnull((1)); /* Functions to handle barriers. */ /* Initialize BARRIER with the attributes in ATTR. The barrier is opened when COUNT waiters arrived. */ extern int pthread_barrier_init(pthread_barrier_t * __restrict __barrier, const pthread_barrierattr_t * __restrict __attr, unsigned int __count) __THROW __nonnull((1)); /* Destroy a previously dynamically initialized barrier BARRIER. */ extern int pthread_barrier_destroy(pthread_barrier_t * __barrier) __THROW __nonnull((1)); /* Wait on barrier BARRIER. */ extern int pthread_barrier_wait(pthread_barrier_t * __barrier) __THROWNL __nonnull((1)); /* Initialize barrier attribute ATTR. */ extern int pthread_barrierattr_init(pthread_barrierattr_t * __attr) __THROW __nonnull((1)); /* Destroy previously dynamically initialized barrier attribute ATTR. */ extern int pthread_barrierattr_destroy(pthread_barrierattr_t * __attr) __THROW __nonnull((1)); /* Get the process-shared flag of the barrier attribute ATTR. */ extern int pthread_barrierattr_getpshared(const pthread_barrierattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull((1, 2)); /* Set the process-shared flag of the barrier attribute ATTR. */ extern int pthread_barrierattr_setpshared(pthread_barrierattr_t * __attr, int __pshared) __THROW __nonnull((1)); #endif /* Functions for handling thread-specific data. */ /* Create a key value identifying a location in the thread-specific data area. Each thread maintains a distinct thread-specific data area. DESTR_FUNCTION, if non-NULL, is called with the value associated to that key when the key is destroyed. DESTR_FUNCTION is not called if the value associated is NULL when the key is destroyed. */ extern int pthread_key_create(pthread_key_t * __key, void (*__destr_function) (void *)) __THROW __nonnull((1)); /* Destroy KEY. */ extern int pthread_key_delete(pthread_key_t __key) __THROW; /* Return current value of the thread-specific data slot identified by KEY. */ extern void *pthread_getspecific(pthread_key_t __key) __THROW; /* Store POINTER in the thread-specific data slot identified by KEY. */ extern int pthread_setspecific(pthread_key_t __key, const void *__pointer) __THROW; #ifdef __USE_XOPEN2K /* Get ID of CPU-time clock for thread THREAD_ID. */ extern int pthread_getcpuclockid(pthread_t __thread_id, __clockid_t * __clock_id) __THROW __nonnull((2)); #endif /* Install handlers to be called when a new process is created with FORK. The PREPARE handler is called in the parent process just before performing FORK. The PARENT handler is called in the parent process just after FORK. The CHILD handler is called in the child process. Each of the three handlers can be NULL, meaning that no handler needs to be called at that point. PTHREAD_ATFORK can be called several times, in which case the PREPARE handlers are called in LIFO order (last added with PTHREAD_ATFORK, first called before FORK), and the PARENT and CHILD handlers are called in FIFO (first added, first called). */ extern int pthread_atfork(void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)) __THROW; #ifdef __USE_EXTERN_INLINES /* Optimizations. */ __extern_inline int __NTH(pthread_equal(pthread_t __thread1, pthread_t __thread2)) { return __thread1 == __thread2; } #endif __END_DECLS #endif /* pthread.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/pwd.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 9.2.2 User Database Access */ #ifndef _PWD_H #define _PWD_H 1 #include __BEGIN_DECLS #include #define __need_size_t #include #if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ # ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined # endif # ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined # endif #endif /* The passwd structure. */ struct passwd { char *pw_name; /* Username. */ char *pw_passwd; /* Password. */ __uid_t pw_uid; /* User ID. */ __gid_t pw_gid; /* Group ID. */ char *pw_gecos; /* Real name. */ char *pw_dir; /* Home directory. */ char *pw_shell; /* Shell program. */ }; #ifdef __USE_MISC # define __need_FILE # include #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Rewind the password-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setpwent(void); /* Close the password-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endpwent(void); /* Read an entry from the password-file stream, opening it if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwent(void); #endif #ifdef __USE_MISC /* Read an entry from STREAM. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct passwd *fgetpwent(FILE * __stream) __nonnull((1)); /* Write the given entry onto the given stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int putpwent(const struct passwd *__restrict __p, FILE * __restrict __f); #endif /* Search for an entry with a matching user ID. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwuid(__uid_t __uid); /* Search for an entry with a matching username. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwnam(const char *__name) __nonnull((1)); #ifdef __USE_POSIX # ifdef __USE_MISC /* Reasonable value for the buffer sized used in the reentrant functions below. But better use `sysconf'. */ # define NSS_BUFLEN_PASSWD 1024 # endif /* Reentrant versions of some of the functions above. PLEASE NOTE: the `getpwent_r' function is not (yet) standardized. The interface may change in later versions of this library. But the interface is designed following the principals used for the other reentrant functions so the chances are good this is what the POSIX people would choose. */ # ifdef __USE_MISC /* This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getpwent_r(struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull((1, 2, 4)); # endif extern int getpwuid_r(__uid_t __uid, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull((2, 3, 5)); extern int getpwnam_r(const char *__restrict __name, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull((1, 2, 3, 5)); # ifdef __USE_MISC /* Read an entry from STREAM. This function is not standardized and probably never will. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fgetpwent_r(FILE * __restrict __stream, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull((1, 2, 3, 5)); # endif #endif /* POSIX or reentrant */ #ifdef __USE_GNU /* Re-construct the password-file line for the given uid in the given buffer. This knows the format that the caller will expect, but this need not be the format of the password file. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getpw(__uid_t __uid, char *__buffer); #endif __END_DECLS #endif /* pwd.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/rpc/netdb.h ================================================ /* @(#)netdb.h 2.1 88/07/29 3.9 RPCSRC */ /* * Copyright (c) 2010, Oracle America, Inc. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the "Oracle America, Inc." nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Cleaned up for GNU C library roland@gnu.ai.mit.edu: added multiple inclusion protection and use of . In GNU this file is #include'd by . */ #ifndef _RPC_NETDB_H #define _RPC_NETDB_H 1 #include #define __need_size_t #include __BEGIN_DECLS struct rpcent { char *r_name; /* Name of server for this rpc program. */ char **r_aliases; /* Alias list. */ int r_number; /* RPC program number. */ }; extern void setrpcent(int __stayopen) __THROW; extern void endrpcent(void) __THROW; extern struct rpcent *getrpcbyname(const char *__name) __THROW; extern struct rpcent *getrpcbynumber(int __number) __THROW; extern struct rpcent *getrpcent(void) __THROW; #ifdef __USE_MISC extern int getrpcbyname_r(const char *__name, struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) __THROW; extern int getrpcbynumber_r(int __number, struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) __THROW; extern int getrpcent_r(struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) __THROW; #endif __END_DECLS #endif /* rpc/netdb.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sched.h ================================================ /* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface. Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SCHED_H #define _SCHED_H 1 #include /* Get type definitions. */ #include #define __need_size_t #include #ifdef __USE_XOPEN2K # define __need_time_t # define __need_timespec #endif #include #ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif /* Get system specific constant and data structure definitions. */ #include /* Define the real names for the elements of `struct sched_param'. */ #define sched_priority __sched_priority __BEGIN_DECLS /* Set scheduling parameters for a process. */ extern int sched_setparam(__pid_t __pid, const struct sched_param *__param) __THROW; /* Retrieve scheduling parameters for a particular process. */ extern int sched_getparam(__pid_t __pid, struct sched_param *__param) __THROW; /* Set scheduling algorithm and/or parameters for a process. */ extern int sched_setscheduler(__pid_t __pid, int __policy, const struct sched_param *__param) __THROW; /* Retrieve scheduling algorithm for a particular purpose. */ extern int sched_getscheduler(__pid_t __pid) __THROW; /* Yield the processor. */ extern int sched_yield(void) __THROW; /* Get maximum priority value for a scheduler. */ extern int sched_get_priority_max(int __algorithm) __THROW; /* Get minimum priority value for a scheduler. */ extern int sched_get_priority_min(int __algorithm) __THROW; /* Get the SCHED_RR interval for the named process. */ extern int sched_rr_get_interval(__pid_t __pid, struct timespec *__t) __THROW; #ifdef __USE_GNU /* Access macros for `cpu_set'. */ # define CPU_SETSIZE __CPU_SETSIZE # define CPU_SET(cpu, cpusetp) __CPU_SET_S (cpu, sizeof (cpu_set_t), cpusetp) # define CPU_CLR(cpu, cpusetp) __CPU_CLR_S (cpu, sizeof (cpu_set_t), cpusetp) # define CPU_ISSET(cpu, cpusetp) __CPU_ISSET_S (cpu, sizeof (cpu_set_t), \ cpusetp) # define CPU_ZERO(cpusetp) __CPU_ZERO_S (sizeof (cpu_set_t), cpusetp) # define CPU_COUNT(cpusetp) __CPU_COUNT_S (sizeof (cpu_set_t), cpusetp) # define CPU_SET_S(cpu, setsize, cpusetp) __CPU_SET_S (cpu, setsize, cpusetp) # define CPU_CLR_S(cpu, setsize, cpusetp) __CPU_CLR_S (cpu, setsize, cpusetp) # define CPU_ISSET_S(cpu, setsize, cpusetp) __CPU_ISSET_S (cpu, setsize, \ cpusetp) # define CPU_ZERO_S(setsize, cpusetp) __CPU_ZERO_S (setsize, cpusetp) # define CPU_COUNT_S(setsize, cpusetp) __CPU_COUNT_S (setsize, cpusetp) # define CPU_EQUAL(cpusetp1, cpusetp2) \ __CPU_EQUAL_S (sizeof (cpu_set_t), cpusetp1, cpusetp2) # define CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ __CPU_EQUAL_S (setsize, cpusetp1, cpusetp2) # define CPU_AND(destset, srcset1, srcset2) \ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, &) # define CPU_OR(destset, srcset1, srcset2) \ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, |) # define CPU_XOR(destset, srcset1, srcset2) \ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, ^) # define CPU_AND_S(setsize, destset, srcset1, srcset2) \ __CPU_OP_S (setsize, destset, srcset1, srcset2, &) # define CPU_OR_S(setsize, destset, srcset1, srcset2) \ __CPU_OP_S (setsize, destset, srcset1, srcset2, |) # define CPU_XOR_S(setsize, destset, srcset1, srcset2) \ __CPU_OP_S (setsize, destset, srcset1, srcset2, ^) # define CPU_ALLOC_SIZE(count) __CPU_ALLOC_SIZE (count) # define CPU_ALLOC(count) __CPU_ALLOC (count) # define CPU_FREE(cpuset) __CPU_FREE (cpuset) /* Set the CPU affinity for a task */ extern int sched_setaffinity(__pid_t __pid, size_t __cpusetsize, const cpu_set_t * __cpuset) __THROW; /* Get the CPU affinity for a task */ extern int sched_getaffinity(__pid_t __pid, size_t __cpusetsize, cpu_set_t * __cpuset) __THROW; #endif __END_DECLS #endif /* sched.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/setjmp.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.13 Nonlocal jumps */ #ifndef _SETJMP_H #define _SETJMP_H 1 #include __BEGIN_DECLS #include /* Get `__jmp_buf'. */ #include /* Get `__sigset_t'. */ /* Calling environment, plus possibly a saved signal mask. */ struct __jmp_buf_tag { /* NOTE: The machine-dependent definitions of `__sigsetjmp' assume that a `jmp_buf' begins with a `__jmp_buf' and that `__mask_was_saved' follows it. Do not move these members or add others before it. */ __jmp_buf __jmpbuf; /* Calling environment. */ int __mask_was_saved; /* Saved the signal mask? */ __sigset_t __saved_mask; /* Saved signal mask. */ }; __BEGIN_NAMESPACE_STD typedef struct __jmp_buf_tag jmp_buf[1]; /* Store the calling environment in ENV, also saving the signal mask. Return 0. */ extern int setjmp(jmp_buf __env) __THROWNL; __END_NAMESPACE_STD /* Store the calling environment in ENV, also saving the signal mask if SAVEMASK is nonzero. Return 0. This is the internal name for `sigsetjmp'. */ extern int __sigsetjmp(struct __jmp_buf_tag __env[1], int __savemask) __THROWNL; /* Store the calling environment in ENV, not saving the signal mask. Return 0. */ extern int _setjmp(struct __jmp_buf_tag __env[1]) __THROWNL; /* Do not save the signal mask. This is equivalent to the `_setjmp' BSD function. */ #define setjmp(env) _setjmp (env) __BEGIN_NAMESPACE_STD /* Jump to the environment saved in ENV, making the `setjmp' call there return VAL, or 1 if VAL is 0. */ extern void longjmp(struct __jmp_buf_tag __env[1], int __val) __THROWNL __attribute__ ((__noreturn__)); __END_NAMESPACE_STD #if defined __USE_MISC || defined __USE_XOPEN /* Same. Usually `_longjmp' is used with `_setjmp', which does not save the signal mask. But it is how ENV was saved that determines whether `longjmp' restores the mask; `_longjmp' is just an alias. */ extern void _longjmp(struct __jmp_buf_tag __env[1], int __val) __THROWNL __attribute__ ((__noreturn__)); #endif #ifdef __USE_POSIX /* Use the same type for `jmp_buf' and `sigjmp_buf'. The `__mask_was_saved' flag determines whether or not `longjmp' will restore the signal mask. */ typedef struct __jmp_buf_tag sigjmp_buf[1]; /* Store the calling environment in ENV, also saving the signal mask if SAVEMASK is nonzero. Return 0. */ # define sigsetjmp(env, savemask) __sigsetjmp (env, savemask) /* Jump to the environment saved in ENV, making the sigsetjmp call there return VAL, or 1 if VAL is 0. Restore the signal mask if that sigsetjmp call saved it. This is just an alias `longjmp'. */ extern void siglongjmp(sigjmp_buf __env, int __val) __THROWNL __attribute__ ((__noreturn__)); #endif /* Use POSIX. */ /* Define helper functions to catch unsafe code. */ #if __USE_FORTIFY_LEVEL > 0 # include #endif __END_DECLS #endif /* setjmp.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/signal.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.14 Signal handling */ #ifndef _SIGNAL_H #if !defined __need_sig_atomic_t && !defined __need_sigset_t # define _SIGNAL_H #endif #include __BEGIN_DECLS #include /* __sigset_t, __sig_atomic_t. */ /* An integral type that can be modified atomically, without the possibility of a signal arriving in the middle of the operation. */ #if defined __need_sig_atomic_t || defined _SIGNAL_H # ifndef __sig_atomic_t_defined # define __sig_atomic_t_defined __BEGIN_NAMESPACE_STD typedef __sig_atomic_t sig_atomic_t; __END_NAMESPACE_STD # endif # undef __need_sig_atomic_t #endif #if defined __need_sigset_t || (defined _SIGNAL_H && defined __USE_POSIX) # ifndef __sigset_t_defined # define __sigset_t_defined typedef __sigset_t sigset_t; # endif # undef __need_sigset_t #endif #ifdef _SIGNAL_H #include #include #if defined __USE_XOPEN || defined __USE_XOPEN2K # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif #ifdef __USE_XOPEN # endif # ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined # endif #endif /* Unix98 */ #ifdef __USE_POSIX199309 /* We need `struct timespec' later on. */ # define __need_timespec # include #endif #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED /* Get the `siginfo_t' type plus the needed symbols. */ # include #endif /* Type of a signal handler. */ typedef void (*__sighandler_t) (int); /* The X/Open definition of `signal' specifies the SVID semantic. Use the additional function `sysv_signal' when X/Open compatibility is requested. */ extern __sighandler_t __sysv_signal(int __sig, __sighandler_t __handler) __THROW; #ifdef __USE_GNU extern __sighandler_t sysv_signal(int __sig, __sighandler_t __handler) __THROW; #endif /* Set the handler for the signal SIG to HANDLER, returning the old handler, or SIG_ERR on error. By default `signal' has the BSD semantic. */ __BEGIN_NAMESPACE_STD #ifdef __USE_MISC extern __sighandler_t signal(int __sig, __sighandler_t __handler) __THROW; #else /* Make sure the used `signal' implementation is the SVID version. */ # ifdef __REDIRECT_NTH extern __sighandler_t __REDIRECT_NTH(signal, (int __sig, __sighandler_t __handler), __sysv_signal); # else # define signal __sysv_signal # endif #endif __END_NAMESPACE_STD #ifdef __USE_XOPEN /* The X/Open definition of `signal' conflicts with the BSD version. So they defined another function `bsd_signal'. */ extern __sighandler_t bsd_signal(int __sig, __sighandler_t __handler) __THROW; #endif /* Send signal SIG to process number PID. If PID is zero, send SIG to all processes in the current process's process group. If PID is < -1, send SIG to all processes in process group - PID. */ #ifdef __USE_POSIX extern int kill(__pid_t __pid, int __sig) __THROW; #endif /* Use POSIX. */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Send SIG to all processes in process group PGRP. If PGRP is zero, send SIG to all processes in the current process's process group. */ extern int killpg(__pid_t __pgrp, int __sig) __THROW; #endif /* Use misc || X/Open Unix. */ __BEGIN_NAMESPACE_STD /* Raise signal SIG, i.e., send SIG to yourself. */ extern int raise(int __sig) __THROW; __END_NAMESPACE_STD #ifdef __USE_MISC /* SVID names for the same things. */ extern __sighandler_t ssignal(int __sig, __sighandler_t __handler) __THROW; extern int gsignal(int __sig) __THROW; #endif /* Use misc. */ #ifdef __USE_XOPEN2K8 /* Print a message describing the meaning of the given signal number. */ extern void psignal(int __sig, const char *__s); /* Print a message describing the meaning of the given signal information. */ extern void psiginfo(const siginfo_t * __pinfo, const char *__s); #endif /* POSIX 2008. */ /* The `sigpause' function in X/Open defines the argument as the signal number. This requires redirecting to another function because the default version in glibc uses an old BSD interface. This function is a cancellation point and therefore not marked with __THROW. */ #ifdef __USE_XOPEN # ifdef __GNUC__ extern int sigpause(int __sig) __asm__("__xpg_sigpause"); # else extern int __sigpause(int __sig_or_mask, int __is_sig); /* Remove a signal from the signal mask and suspend the process. */ # define sigpause(sig) __sigpause ((sig), 1) # endif #endif #ifdef __USE_MISC /* None of the following functions should be used anymore. They are here only for compatibility. A single word (`int') is not guaranteed to be enough to hold a complete signal mask and therefore these functions simply do not work in many situations. Use `sigprocmask' instead. */ /* Compute mask for signal SIG. */ # define sigmask(sig) __sigmask(sig) /* Block signals in MASK, returning the old mask. */ extern int sigblock(int __mask) __THROW __attribute_deprecated__; /* Set the mask of blocked signals to MASK, returning the old mask. */ extern int sigsetmask(int __mask) __THROW __attribute_deprecated__; /* Return currently selected signal mask. */ extern int siggetmask(void) __THROW __attribute_deprecated__; #endif /* Use misc. */ #ifdef __USE_MISC # define NSIG _NSIG #endif #ifdef __USE_GNU typedef __sighandler_t sighandler_t; #endif /* 4.4 BSD uses the name `sig_t' for this. */ #ifdef __USE_MISC typedef __sighandler_t sig_t; #endif #ifdef __USE_POSIX /* Clear all signals from SET. */ extern int sigemptyset(sigset_t * __set) __THROW __nonnull((1)); /* Set all signals in SET. */ extern int sigfillset(sigset_t * __set) __THROW __nonnull((1)); /* Add SIGNO to SET. */ extern int sigaddset(sigset_t * __set, int __signo) __THROW __nonnull((1)); /* Remove SIGNO from SET. */ extern int sigdelset(sigset_t * __set, int __signo) __THROW __nonnull((1)); /* Return 1 if SIGNO is in SET, 0 if not. */ extern int sigismember(const sigset_t * __set, int __signo) __THROW __nonnull((1)); # ifdef __USE_GNU /* Return non-empty value is SET is not empty. */ extern int sigisemptyset(const sigset_t * __set) __THROW __nonnull((1)); /* Build new signal set by combining the two inputs set using logical AND. */ extern int sigandset(sigset_t * __set, const sigset_t * __left, const sigset_t * __right) __THROW __nonnull((1, 2, 3)); /* Build new signal set by combining the two inputs set using logical OR. */ extern int sigorset(sigset_t * __set, const sigset_t * __left, const sigset_t * __right) __THROW __nonnull((1, 2, 3)); # endif /* GNU */ /* Get the system-specific definitions of `struct sigaction' and the `SA_*' and `SIG_*'. constants. */ # include /* Get and/or change the set of blocked signals. */ extern int sigprocmask(int __how, const sigset_t * __restrict __set, sigset_t * __restrict __oset) __THROW; /* Change the set of blocked signals to SET, wait until a signal arrives, and restore the set of blocked signals. This function is a cancellation point and therefore not marked with __THROW. */ extern int sigsuspend(const sigset_t * __set) __nonnull((1)); /* Get and/or set the action for signal SIG. */ extern int sigaction(int __sig, const struct sigaction *__restrict __act, struct sigaction *__restrict __oact) __THROW; /* Put in SET all signals that are blocked and waiting to be delivered. */ extern int sigpending(sigset_t * __set) __THROW __nonnull((1)); /* Select any of pending signals from SET or wait for any to arrive. This function is a cancellation point and therefore not marked with __THROW. */ extern int sigwait(const sigset_t * __restrict __set, int *__restrict __sig) __nonnull((1, 2)); # ifdef __USE_POSIX199309 /* Select any of pending signals from SET and place information in INFO. This function is a cancellation point and therefore not marked with __THROW. */ extern int sigwaitinfo(const sigset_t * __restrict __set, siginfo_t * __restrict __info) __nonnull((1)); /* Select any of pending signals from SET and place information in INFO. Wait the time specified by TIMEOUT if no signal is pending. This function is a cancellation point and therefore not marked with __THROW. */ extern int sigtimedwait(const sigset_t * __restrict __set, siginfo_t * __restrict __info, const struct timespec *__restrict __timeout) __nonnull((1)); /* Send signal SIG to the process PID. Associate data in VAL with the signal. */ extern int sigqueue(__pid_t __pid, int __sig, const union sigval __val) __THROW; # endif /* Use POSIX 199306. */ #endif /* Use POSIX. */ #ifdef __USE_MISC /* Names of the signals. This variable exists only for compatibility. Use `strsignal' instead (see ). */ extern const char *const _sys_siglist[_NSIG]; extern const char *const sys_siglist[_NSIG]; /* Get machine-dependent `struct sigcontext' and signal subcodes. */ # include /* Restore the state saved in SCP. */ extern int sigreturn(struct sigcontext *__scp) __THROW; #endif /* Use misc. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 # define __need_size_t # include /* If INTERRUPT is nonzero, make signal SIG interrupt system calls (causing them to fail with EINTR); if INTERRUPT is zero, make system calls be restarted after signal SIG. */ extern int siginterrupt(int __sig, int __interrupt) __THROW; # include # if defined __USE_XOPEN || defined __USE_XOPEN2K8 /* This will define `ucontext_t' and `mcontext_t'. */ # include # endif /* Run signals handlers on the stack specified by SS (if not NULL). If OSS is not NULL, it is filled in with the old signal stack status. This interface is obsolete and on many platform not implemented. */ extern int sigstack(struct sigstack *__ss, struct sigstack *__oss) __THROW __attribute_deprecated__; /* Alternate signal handler stack interface. This interface should always be preferred over `sigstack'. */ extern int sigaltstack(const struct sigaltstack *__restrict __ss, struct sigaltstack *__restrict __oss) __THROW; #endif /* Use POSIX.1-2008 or X/Open Unix. */ #ifdef __USE_XOPEN_EXTENDED /* Simplified interface for signal management. */ /* Add SIG to the calling process' signal mask. */ extern int sighold(int __sig) __THROW; /* Remove SIG from the calling process' signal mask. */ extern int sigrelse(int __sig) __THROW; /* Set the disposition of SIG to SIG_IGN. */ extern int sigignore(int __sig) __THROW; /* Set the disposition of SIG. */ extern __sighandler_t sigset(int __sig, __sighandler_t __disp) __THROW; #endif #if defined __USE_POSIX199506 || defined __USE_UNIX98 /* Some of the functions for handling signals in threaded programs must be defined here. */ # include # include #endif /* use Unix98 */ /* The following functions are used internally in the C library and in other code which need deep insights. */ /* Return number of available real-time signal with highest priority. */ extern int __libc_current_sigrtmin(void) __THROW; /* Return number of available real-time signal with lowest priority. */ extern int __libc_current_sigrtmax(void) __THROW; #endif /* signal.h */ __END_DECLS #endif /* not signal.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/stdc-predef.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STDC_PREDEF_H #define _STDC_PREDEF_H 1 /* This header is separate from features.h so that the compiler can include it implicitly at the start of every compilation. It must not itself include or any other header that includes because the implicit include comes before any feature test macros that may be defined in a source file before it first explicitly includes a system header. GCC knows the name of this header in order to preinclude it. */ /* glibc's intent is to support the IEC 559 math functionality, real and complex. If the GCC (4.9 and later) predefined macros specifying compiler intent are available, use them to determine whether the overall intent is to support these features; otherwise, presume an older compiler has intent to support these features and define these macros by default. */ #ifdef __GCC_IEC_559 # if __GCC_IEC_559 > 0 # define __STDC_IEC_559__ 1 # endif #else # define __STDC_IEC_559__ 1 #endif #ifdef __GCC_IEC_559_COMPLEX # if __GCC_IEC_559_COMPLEX > 0 # define __STDC_IEC_559_COMPLEX__ 1 # endif #else # define __STDC_IEC_559_COMPLEX__ 1 #endif /* wchar_t uses Unicode 7.0.0. Version 7.0 of the Unicode Standard is synchronized with ISO/IEC 10646:2012, plus Amendments 1 (published on April, 2013) and 2 (not yet published as of February, 2015). Additionally, it includes the accelerated publication of U+20BD RUBLE SIGN. Therefore Unicode 7.0.0 is between 10646:2012 and 10646:2014, and so we use the date ISO/IEC 10646:2012 Amd.1 was published. */ #define __STDC_ISO_10646__ 201304L /* We do not support C11 . */ #define __STDC_NO_THREADS__ 1 #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/stdint.h ================================================ /* Copyright (C) 1997-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99: 7.18 Integer types */ #ifndef _STDINT_H #define _STDINT_H 1 #include #include #include /* Exact integral types. */ /* Signed. */ /* There is some amount of overlap with as known by inet code */ #ifndef __int8_t_defined # define __int8_t_defined typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; # if __WORDSIZE == 64 typedef long int int64_t; # else __extension__ typedef long long int int64_t; # endif #endif /* Unsigned. */ typedef unsigned char uint8_t; typedef unsigned short int uint16_t; #ifndef __uint32_t_defined typedef unsigned int uint32_t; # define __uint32_t_defined #endif #if __WORDSIZE == 64 typedef unsigned long int uint64_t; #else __extension__ typedef unsigned long long int uint64_t; #endif /* Small types. */ /* Signed. */ typedef signed char int_least8_t; typedef short int int_least16_t; typedef int int_least32_t; #if __WORDSIZE == 64 typedef long int int_least64_t; #else __extension__ typedef long long int int_least64_t; #endif /* Unsigned. */ typedef unsigned char uint_least8_t; typedef unsigned short int uint_least16_t; typedef unsigned int uint_least32_t; #if __WORDSIZE == 64 typedef unsigned long int uint_least64_t; #else __extension__ typedef unsigned long long int uint_least64_t; #endif /* Fast types. */ /* Signed. */ typedef signed char int_fast8_t; #if __WORDSIZE == 64 typedef long int int_fast16_t; typedef long int int_fast32_t; typedef long int int_fast64_t; #else typedef int int_fast16_t; typedef int int_fast32_t; __extension__ typedef long long int int_fast64_t; #endif /* Unsigned. */ typedef unsigned char uint_fast8_t; #if __WORDSIZE == 64 typedef unsigned long int uint_fast16_t; typedef unsigned long int uint_fast32_t; typedef unsigned long int uint_fast64_t; #else typedef unsigned int uint_fast16_t; typedef unsigned int uint_fast32_t; __extension__ typedef unsigned long long int uint_fast64_t; #endif /* Types for `void *' pointers. */ #if __WORDSIZE == 64 # ifndef __intptr_t_defined typedef long int intptr_t; # define __intptr_t_defined # endif typedef unsigned long int uintptr_t; #else # ifndef __intptr_t_defined typedef int intptr_t; # define __intptr_t_defined # endif typedef unsigned int uintptr_t; #endif /* Largest integral types. */ #if __WORDSIZE == 64 typedef long int intmax_t; typedef unsigned long int uintmax_t; #else __extension__ typedef long long int intmax_t; __extension__ typedef unsigned long long int uintmax_t; #endif # if __WORDSIZE == 64 # define __INT64_C(c) c ## L # define __UINT64_C(c) c ## UL # else # define __INT64_C(c) c ## LL # define __UINT64_C(c) c ## ULL # endif /* Limits of integral types. */ /* Minimum of signed integral types. */ # define INT8_MIN (-128) # define INT16_MIN (-32767-1) # define INT32_MIN (-2147483647-1) # define INT64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of signed integral types. */ # define INT8_MAX (127) # define INT16_MAX (32767) # define INT32_MAX (2147483647) # define INT64_MAX (__INT64_C(9223372036854775807)) /* Maximum of unsigned integral types. */ # define UINT8_MAX (255) # define UINT16_MAX (65535) # define UINT32_MAX (4294967295U) # define UINT64_MAX (__UINT64_C(18446744073709551615)) /* Minimum of signed integral types having a minimum size. */ # define INT_LEAST8_MIN (-128) # define INT_LEAST16_MIN (-32767-1) # define INT_LEAST32_MIN (-2147483647-1) # define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of signed integral types having a minimum size. */ # define INT_LEAST8_MAX (127) # define INT_LEAST16_MAX (32767) # define INT_LEAST32_MAX (2147483647) # define INT_LEAST64_MAX (__INT64_C(9223372036854775807)) /* Maximum of unsigned integral types having a minimum size. */ # define UINT_LEAST8_MAX (255) # define UINT_LEAST16_MAX (65535) # define UINT_LEAST32_MAX (4294967295U) # define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615)) /* Minimum of fast signed integral types having a minimum size. */ # define INT_FAST8_MIN (-128) # if __WORDSIZE == 64 # define INT_FAST16_MIN (-9223372036854775807L-1) # define INT_FAST32_MIN (-9223372036854775807L-1) # else # define INT_FAST16_MIN (-2147483647-1) # define INT_FAST32_MIN (-2147483647-1) # endif # define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of fast signed integral types having a minimum size. */ # define INT_FAST8_MAX (127) # if __WORDSIZE == 64 # define INT_FAST16_MAX (9223372036854775807L) # define INT_FAST32_MAX (9223372036854775807L) # else # define INT_FAST16_MAX (2147483647) # define INT_FAST32_MAX (2147483647) # endif # define INT_FAST64_MAX (__INT64_C(9223372036854775807)) /* Maximum of fast unsigned integral types having a minimum size. */ # define UINT_FAST8_MAX (255) # if __WORDSIZE == 64 # define UINT_FAST16_MAX (18446744073709551615UL) # define UINT_FAST32_MAX (18446744073709551615UL) # else # define UINT_FAST16_MAX (4294967295U) # define UINT_FAST32_MAX (4294967295U) # endif # define UINT_FAST64_MAX (__UINT64_C(18446744073709551615)) /* Values to test for integral types holding `void *' pointer. */ # if __WORDSIZE == 64 # define INTPTR_MIN (-9223372036854775807L-1) # define INTPTR_MAX (9223372036854775807L) # define UINTPTR_MAX (18446744073709551615UL) # else # define INTPTR_MIN (-2147483647-1) # define INTPTR_MAX (2147483647) # define UINTPTR_MAX (4294967295U) # endif /* Minimum for largest signed integral type. */ # define INTMAX_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum for largest signed integral type. */ # define INTMAX_MAX (__INT64_C(9223372036854775807)) /* Maximum for largest unsigned integral type. */ # define UINTMAX_MAX (__UINT64_C(18446744073709551615)) /* Limits of other integer types. */ /* Limits of `ptrdiff_t' type. */ # if __WORDSIZE == 64 # define PTRDIFF_MIN (-9223372036854775807L-1) # define PTRDIFF_MAX (9223372036854775807L) # else # define PTRDIFF_MIN (-2147483647-1) # define PTRDIFF_MAX (2147483647) # endif /* Limits of `sig_atomic_t'. */ # define SIG_ATOMIC_MIN (-2147483647-1) # define SIG_ATOMIC_MAX (2147483647) /* Limit of `size_t' type. */ # if __WORDSIZE == 64 # define SIZE_MAX (18446744073709551615UL) # else # ifdef __WORDSIZE32_SIZE_ULONG # define SIZE_MAX (4294967295UL) # else # define SIZE_MAX (4294967295U) # endif # endif /* Limits of `wchar_t'. */ # ifndef WCHAR_MIN /* These constants might also be defined in . */ # define WCHAR_MIN __WCHAR_MIN # define WCHAR_MAX __WCHAR_MAX # endif /* Limits of `wint_t'. */ # define WINT_MIN (0u) # define WINT_MAX (4294967295u) /* Signed. */ # define INT8_C(c) c # define INT16_C(c) c # define INT32_C(c) c # if __WORDSIZE == 64 # define INT64_C(c) c ## L # else # define INT64_C(c) c ## LL # endif /* Unsigned. */ # define UINT8_C(c) c # define UINT16_C(c) c # define UINT32_C(c) c ## U # if __WORDSIZE == 64 # define UINT64_C(c) c ## UL # else # define UINT64_C(c) c ## ULL # endif /* Maximal type. */ # if __WORDSIZE == 64 # define INTMAX_C(c) c ## L # define UINTMAX_C(c) c ## UL # else # define INTMAX_C(c) c ## LL # define UINTMAX_C(c) c ## ULL # endif #endif /* stdint.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/stdio.h ================================================ /* Define ISO C stdio on top of C++ iostreams. Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.19 Input/output */ #ifndef _STDIO_H #if !defined __need_FILE && !defined __need___FILE # define _STDIO_H 1 # include __BEGIN_DECLS # define __need_size_t # define __need_NULL # include # include # define __need_FILE # define __need___FILE #endif /* Don't need FILE. */ #if !defined __FILE_defined && defined __need_FILE /* Define outside of namespace so the C++ is happy. */ struct _IO_FILE; __BEGIN_NAMESPACE_STD /* The opaque type of streams. This is the definition used elsewhere. */ typedef struct _IO_FILE FILE; __END_NAMESPACE_STD #if defined __USE_LARGEFILE64 || defined __USE_POSIX \ || defined __USE_ISOC99 || defined __USE_XOPEN \ || defined __USE_POSIX2 __USING_NAMESPACE_STD(FILE) #endif # define __FILE_defined 1 #endif /* FILE not defined. */ #undef __need_FILE #if !defined ____FILE_defined && defined __need___FILE /* The opaque type of streams. This is the definition used elsewhere. */ typedef struct _IO_FILE __FILE; # define ____FILE_defined 1 #endif /* __FILE not defined. */ #undef __need___FILE #ifdef _STDIO_H #define _STDIO_USES_IOSTREAM #include #if defined __USE_XOPEN || defined __USE_XOPEN2K8 # ifdef __GNUC__ # ifndef _VA_LIST_DEFINED typedef _G_va_list va_list; # define _VA_LIST_DEFINED # endif # else # include # endif #endif #ifdef __USE_XOPEN2K8 # ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined # endif # if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; # define __off64_t_defined # endif # ifndef __ssize_t_defined typedef __ssize_t ssize_t; # define __ssize_t_defined # endif #endif /* The type of the second argument to `fgetpos' and `fsetpos'. */ __BEGIN_NAMESPACE_STD #ifndef __USE_FILE_OFFSET64 typedef _G_fpos_t fpos_t; #else typedef _G_fpos64_t fpos_t; #endif __END_NAMESPACE_STD #ifdef __USE_LARGEFILE64 typedef _G_fpos64_t fpos64_t; #endif /* The possibilities for the third argument to `setvbuf'. */ #define _IOFBF 0 /* Fully buffered. */ #define _IOLBF 1 /* Line buffered. */ #define _IONBF 2 /* No buffering. */ /* Default buffer size. */ #ifndef BUFSIZ # define BUFSIZ _IO_BUFSIZ #endif /* End of file character. Some things throughout the library rely on this being -1. */ #ifndef EOF # define EOF (-1) #endif /* The possibilities for the third argument to `fseek'. These values should not be changed. */ #define SEEK_SET 0 /* Seek from beginning of file. */ #define SEEK_CUR 1 /* Seek from current position. */ #define SEEK_END 2 /* Seek from end of file. */ #ifdef __USE_GNU # define SEEK_DATA 3 /* Seek to next data. */ # define SEEK_HOLE 4 /* Seek to next hole. */ #endif #if defined __USE_MISC || defined __USE_XOPEN /* Default path prefix for `tempnam' and `tmpnam'. */ # define P_tmpdir "/tmp" #endif /* Get the values: L_tmpnam How long an array of chars must be to be passed to `tmpnam'. TMP_MAX The minimum number of unique filenames generated by tmpnam (and tempnam when it uses tmpnam's name space), or tempnam (the two are separate). L_ctermid How long an array to pass to `ctermid'. L_cuserid How long an array to pass to `cuserid'. FOPEN_MAX Minimum number of files that can be open at once. FILENAME_MAX Maximum length of a filename. */ #include /* Standard streams. */ extern struct _IO_FILE *stdin; /* Standard input stream. */ extern struct _IO_FILE *stdout; /* Standard output stream. */ extern struct _IO_FILE *stderr; /* Standard error output stream. */ /* C89/C99 say they're macros. Make them happy. */ #define stdin stdin #define stdout stdout #define stderr stderr __BEGIN_NAMESPACE_STD /* Remove file FILENAME. */ extern int remove(const char *__filename) __THROW; /* Rename file OLD to NEW. */ extern int rename(const char *__old, const char *__new) __THROW; __END_NAMESPACE_STD #ifdef __USE_ATFILE /* Rename file OLD relative to OLDFD to NEW relative to NEWFD. */ extern int renameat(int __oldfd, const char *__old, int __newfd, const char *__new) __THROW; #endif __BEGIN_NAMESPACE_STD /* Create a temporary file and open it read/write. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern FILE *tmpfile(void) __wur; #else # ifdef __REDIRECT extern FILE *__REDIRECT(tmpfile, (void), tmpfile64) __wur; # else # define tmpfile tmpfile64 # endif #endif #ifdef __USE_LARGEFILE64 extern FILE *tmpfile64(void) __wur; #endif /* Generate a temporary filename. */ extern char *tmpnam(char *__s) __THROW __wur; __END_NAMESPACE_STD #ifdef __USE_MISC /* This is the reentrant variant of `tmpnam'. The only difference is that it does not allow S to be NULL. */ extern char *tmpnam_r(char *__s) __THROW __wur; #endif #if defined __USE_MISC || defined __USE_XOPEN /* Generate a unique temporary filename using up to five characters of PFX if it is not NULL. The directory to put this file in is searched for as follows: First the environment variable "TMPDIR" is checked. If it contains the name of a writable directory, that directory is used. If not and if DIR is not NULL, that value is checked. If that fails, P_tmpdir is tried and finally "/tmp". The storage for the filename is allocated by `malloc'. */ extern char *tempnam(const char *__dir, const char *__pfx) __THROW __attribute_malloc__ __wur; #endif __BEGIN_NAMESPACE_STD /* Close STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fclose(FILE * __stream); /* Flush STREAM, or all streams if STREAM is NULL. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fflush(FILE * __stream); __END_NAMESPACE_STD #ifdef __USE_MISC /* Faster versions when locking is not required. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fflush_unlocked(FILE * __stream); #endif #ifdef __USE_GNU /* Close all streams. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fcloseall(void); #endif __BEGIN_NAMESPACE_STD #ifndef __USE_FILE_OFFSET64 /* Open a file and create a new stream for it. This function is a possible cancellation point and therefore not marked with __THROW. */ extern FILE *fopen(const char *__restrict __filename, const char *__restrict __modes) __wur; /* Open a file, replacing an existing stream with it. This function is a possible cancellation point and therefore not marked with __THROW. */ extern FILE *freopen(const char *__restrict __filename, const char *__restrict __modes, FILE * __restrict __stream) __wur; #else # ifdef __REDIRECT extern FILE *__REDIRECT(fopen, (const char *__restrict __filename, const char *__restrict __modes), fopen64) __wur; extern FILE *__REDIRECT(freopen, (const char *__restrict __filename, const char *__restrict __modes, FILE * __restrict __stream), freopen64) __wur; # else # define fopen fopen64 # define freopen freopen64 # endif #endif __END_NAMESPACE_STD #ifdef __USE_LARGEFILE64 extern FILE *fopen64(const char *__restrict __filename, const char *__restrict __modes) __wur; extern FILE *freopen64(const char *__restrict __filename, const char *__restrict __modes, FILE * __restrict __stream) __wur; #endif #ifdef __USE_POSIX /* Create a new stream that refers to an existing system file descriptor. */ extern FILE *fdopen(int __fd, const char *__modes) __THROW __wur; #endif #ifdef __USE_GNU /* Create a new stream that refers to the given magic cookie, and uses the given functions for input and output. */ extern FILE *fopencookie(void *__restrict __magic_cookie, const char *__restrict __modes, _IO_cookie_io_functions_t __io_funcs) __THROW __wur; #endif #ifdef __USE_XOPEN2K8 /* Create a new stream that refers to a memory buffer. */ extern FILE *fmemopen(void *__s, size_t __len, const char *__modes) __THROW __wur; /* Open a stream that writes into a malloc'd buffer that is expanded as necessary. *BUFLOC and *SIZELOC are updated with the buffer's location and the number of characters written on fflush or fclose. */ extern FILE *open_memstream(char **__bufloc, size_t * __sizeloc) __THROW __wur; #endif __BEGIN_NAMESPACE_STD /* If BUF is NULL, make STREAM unbuffered. Else make it use buffer BUF, of size BUFSIZ. */ extern void setbuf(FILE * __restrict __stream, char *__restrict __buf) __THROW; /* Make STREAM use buffering mode MODE. If BUF is not NULL, use N bytes of it for buffering; else allocate an internal buffer N bytes long. */ extern int setvbuf(FILE * __restrict __stream, char *__restrict __buf, int __modes, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_MISC /* If BUF is NULL, make STREAM unbuffered. Else make it use SIZE bytes of BUF for buffering. */ extern void setbuffer(FILE * __restrict __stream, char *__restrict __buf, size_t __size) __THROW; /* Make STREAM line-buffered. */ extern void setlinebuf(FILE * __stream) __THROW; #endif __BEGIN_NAMESPACE_STD /* Write formatted output to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fprintf(FILE * __restrict __stream, const char *__restrict __format, ...); /* Write formatted output to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int printf(const char *__restrict __format, ...); /* Write formatted output to S. */ extern int sprintf(char *__restrict __s, const char *__restrict __format, ...) __THROWNL; /* Write formatted output to S from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfprintf(FILE * __restrict __s, const char *__restrict __format, _G_va_list __arg); /* Write formatted output to stdout from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vprintf(const char *__restrict __format, _G_va_list __arg); /* Write formatted output to S from argument list ARG. */ extern int vsprintf(char *__restrict __s, const char *__restrict __format, _G_va_list __arg) __THROWNL; __END_NAMESPACE_STD #if defined __USE_ISOC99 || defined __USE_UNIX98 __BEGIN_NAMESPACE_C99 /* Maximum chars of output to write in MAXLEN. */ extern int snprintf(char *__restrict __s, size_t __maxlen, const char *__restrict __format, ...) __THROWNL __attribute__ ((__format__(__printf__, 3, 4))); extern int vsnprintf(char *__restrict __s, size_t __maxlen, const char *__restrict __format, _G_va_list __arg) __THROWNL __attribute__ ((__format__(__printf__, 3, 0))); __END_NAMESPACE_C99 #endif #ifdef __USE_GNU /* Write formatted output to a string dynamically allocated with `malloc'. Store the address of the string in *PTR. */ extern int vasprintf(char **__restrict __ptr, const char *__restrict __f, _G_va_list __arg) __THROWNL __attribute__ ((__format__(__printf__, 2, 0))) __wur; extern int __asprintf(char **__restrict __ptr, const char *__restrict __fmt, ...) __THROWNL __attribute__ ((__format__(__printf__, 2, 3))) __wur; extern int asprintf(char **__restrict __ptr, const char *__restrict __fmt, ...) __THROWNL __attribute__ ((__format__(__printf__, 2, 3))) __wur; #endif #ifdef __USE_XOPEN2K8 /* Write formatted output to a file descriptor. */ extern int vdprintf(int __fd, const char *__restrict __fmt, _G_va_list __arg) __attribute__ ((__format__(__printf__, 2, 0))); extern int dprintf(int __fd, const char *__restrict __fmt, ...) __attribute__ ((__format__(__printf__, 2, 3))); #endif __BEGIN_NAMESPACE_STD /* Read formatted input from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fscanf(FILE * __restrict __stream, const char *__restrict __format, ...) __wur; /* Read formatted input from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int scanf(const char *__restrict __format, ...) __wur; /* Read formatted input from S. */ extern int sscanf(const char *__restrict __s, const char *__restrict __format, ...) __THROW; #if defined __USE_ISOC99 && !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT(fscanf, (FILE * __restrict __stream, const char *__restrict __format, ...), __isoc99_fscanf) __wur; extern int __REDIRECT(scanf, (const char *__restrict __format, ...), __isoc99_scanf) __wur; extern int __REDIRECT_NTH(sscanf, (const char *__restrict __s, const char *__restrict __format, ...), __isoc99_sscanf); # else extern int __isoc99_fscanf(FILE * __restrict __stream, const char *__restrict __format, ...) __wur; extern int __isoc99_scanf(const char *__restrict __format, ...) __wur; extern int __isoc99_sscanf(const char *__restrict __s, const char *__restrict __format, ...) __THROW; # define fscanf __isoc99_fscanf # define scanf __isoc99_scanf # define sscanf __isoc99_sscanf # endif #endif __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfscanf(FILE * __restrict __s, const char *__restrict __format, _G_va_list __arg) __attribute__ ((__format__(__scanf__, 2, 0))) __wur; /* Read formatted input from stdin into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vscanf(const char *__restrict __format, _G_va_list __arg) __attribute__ ((__format__(__scanf__, 1, 0))) __wur; /* Read formatted input from S into argument list ARG. */ extern int vsscanf(const char *__restrict __s, const char *__restrict __format, _G_va_list __arg) __THROW __attribute__ ((__format__(__scanf__, 2, 0))); # if !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT(vfscanf, (FILE * __restrict __s, const char *__restrict __format, _G_va_list __arg), __isoc99_vfscanf) __attribute__ ((__format__(__scanf__, 2, 0))) __wur; extern int __REDIRECT(vscanf, (const char *__restrict __format, _G_va_list __arg), __isoc99_vscanf) __attribute__ ((__format__(__scanf__, 1, 0))) __wur; extern int __REDIRECT_NTH(vsscanf, (const char *__restrict __s, const char *__restrict __format, _G_va_list __arg), __isoc99_vsscanf) __attribute__ ((__format__(__scanf__, 2, 0))); # else extern int __isoc99_vfscanf(FILE * __restrict __s, const char *__restrict __format, _G_va_list __arg) __wur; extern int __isoc99_vscanf(const char *__restrict __format, _G_va_list __arg) __wur; extern int __isoc99_vsscanf(const char *__restrict __s, const char *__restrict __format, _G_va_list __arg) __THROW; # define vfscanf __isoc99_vfscanf # define vscanf __isoc99_vscanf # define vsscanf __isoc99_vsscanf # endif # endif __END_NAMESPACE_C99 #endif /* Use ISO C9x. */ __BEGIN_NAMESPACE_STD /* Read a character from STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern int fgetc(FILE * __stream); extern int getc(FILE * __stream); /* Read a character from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getchar(void); __END_NAMESPACE_STD /* The C standard explicitly says this is a macro, so we always do the optimization for it. */ #define getc(_fp) _IO_getc (_fp) #ifdef __USE_POSIX /* These are defined in POSIX.1:1996. These functions are possible cancellation points and therefore not marked with __THROW. */ extern int getc_unlocked(FILE * __stream); extern int getchar_unlocked(void); #endif /* Use POSIX. */ #ifdef __USE_MISC /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fgetc_unlocked(FILE * __stream); #endif /* Use MISC. */ __BEGIN_NAMESPACE_STD /* Write a character to STREAM. These functions are possible cancellation points and therefore not marked with __THROW. These functions is a possible cancellation point and therefore not marked with __THROW. */ extern int fputc(int __c, FILE * __stream); extern int putc(int __c, FILE * __stream); /* Write a character to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int putchar(int __c); __END_NAMESPACE_STD /* The C standard explicitly says this can be a macro, so we always do the optimization for it. */ #define putc(_ch, _fp) _IO_putc (_ch, _fp) #ifdef __USE_MISC /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputc_unlocked(int __c, FILE * __stream); #endif /* Use MISC. */ #ifdef __USE_POSIX /* These are defined in POSIX.1:1996. These functions are possible cancellation points and therefore not marked with __THROW. */ extern int putc_unlocked(int __c, FILE * __stream); extern int putchar_unlocked(int __c); #endif /* Use POSIX. */ #if defined __USE_MISC \ || (defined __USE_XOPEN && !defined __USE_XOPEN2K) /* Get a word (int) from STREAM. */ extern int getw(FILE * __stream); /* Write a word (int) to STREAM. */ extern int putw(int __w, FILE * __stream); #endif __BEGIN_NAMESPACE_STD /* Get a newline-terminated string of finite length from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *fgets(char *__restrict __s, int __n, FILE * __restrict __stream) __wur; #if !defined __USE_ISOC11 \ || (defined __cplusplus && __cplusplus <= 201103L) /* Get a newline-terminated string from stdin, removing the newline. DO NOT USE THIS FUNCTION!! There is no limit on how much it will read. The function has been officially removed in ISO C11. This opportunity is used to also remove it from the GNU feature list. It is now only available when explicitly using an old ISO C, Unix, or POSIX standard. GCC defines _GNU_SOURCE when building C++ code and the function is still in C++11, so it is also available for C++. This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *gets(char *__s) __wur __attribute_deprecated__; #endif __END_NAMESPACE_STD #ifdef __USE_GNU /* This function does the same as `fgets' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern char *fgets_unlocked(char *__restrict __s, int __n, FILE * __restrict __stream) __wur; #endif #ifdef __USE_XOPEN2K8 /* Read up to (and including) a DELIMITER from STREAM into *LINEPTR (and null-terminate it). *LINEPTR is a pointer returned from malloc (or NULL), pointing to *N characters of space. It is realloc'd as necessary. Returns the number of characters read (not including the null terminator), or -1 on error or EOF. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern _IO_ssize_t __getdelim(char **__restrict __lineptr, size_t * __restrict __n, int __delimiter, FILE * __restrict __stream) __wur; extern _IO_ssize_t getdelim(char **__restrict __lineptr, size_t * __restrict __n, int __delimiter, FILE * __restrict __stream) __wur; /* Like `getdelim', but reads up to a newline. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern _IO_ssize_t getline(char **__restrict __lineptr, size_t * __restrict __n, FILE * __restrict __stream) __wur; #endif __BEGIN_NAMESPACE_STD /* Write a string to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fputs(const char *__restrict __s, FILE * __restrict __stream); /* Write a string, followed by a newline, to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int puts(const char *__s); /* Push a character back onto the input buffer of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int ungetc(int __c, FILE * __stream); /* Read chunks of generic data from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern size_t fread(void *__restrict __ptr, size_t __size, size_t __n, FILE * __restrict __stream) __wur; /* Write chunks of generic data to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern size_t fwrite(const void *__restrict __ptr, size_t __size, size_t __n, FILE * __restrict __s); __END_NAMESPACE_STD #ifdef __USE_GNU /* This function does the same as `fputs' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputs_unlocked(const char *__restrict __s, FILE * __restrict __stream); #endif #ifdef __USE_MISC /* Faster versions when locking is not necessary. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern size_t fread_unlocked(void *__restrict __ptr, size_t __size, size_t __n, FILE * __restrict __stream) __wur; extern size_t fwrite_unlocked(const void *__restrict __ptr, size_t __size, size_t __n, FILE * __restrict __stream); #endif __BEGIN_NAMESPACE_STD /* Seek to a certain position on STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fseek(FILE * __stream, long int __off, int __whence); /* Return the current position of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern long int ftell(FILE * __stream) __wur; /* Rewind to the beginning of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void rewind(FILE * __stream); __END_NAMESPACE_STD /* The Single Unix Specification, Version 2, specifies an alternative, more adequate interface for the two functions above which deal with file offset. `long int' is not the right type. These definitions are originally defined in the Large File Support API. */ #if defined __USE_LARGEFILE || defined __USE_XOPEN2K # ifndef __USE_FILE_OFFSET64 /* Seek to a certain position on STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fseeko(FILE * __stream, __off_t __off, int __whence); /* Return the current position of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern __off_t ftello(FILE * __stream) __wur; # else # ifdef __REDIRECT extern int __REDIRECT(fseeko, (FILE * __stream, __off64_t __off, int __whence), fseeko64); extern __off64_t __REDIRECT(ftello, (FILE * __stream), ftello64); # else # define fseeko fseeko64 # define ftello ftello64 # endif # endif #endif __BEGIN_NAMESPACE_STD #ifndef __USE_FILE_OFFSET64 /* Get STREAM's position. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fgetpos(FILE * __restrict __stream, fpos_t * __restrict __pos); /* Set STREAM's position. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fsetpos(FILE * __stream, const fpos_t * __pos); #else # ifdef __REDIRECT extern int __REDIRECT(fgetpos, (FILE * __restrict __stream, fpos_t * __restrict __pos), fgetpos64); extern int __REDIRECT(fsetpos, (FILE * __stream, const fpos_t * __pos), fsetpos64); # else # define fgetpos fgetpos64 # define fsetpos fsetpos64 # endif #endif __END_NAMESPACE_STD #ifdef __USE_LARGEFILE64 extern int fseeko64(FILE * __stream, __off64_t __off, int __whence); extern __off64_t ftello64(FILE * __stream) __wur; extern int fgetpos64(FILE * __restrict __stream, fpos64_t * __restrict __pos); extern int fsetpos64(FILE * __stream, const fpos64_t * __pos); #endif __BEGIN_NAMESPACE_STD /* Clear the error and EOF indicators for STREAM. */ extern void clearerr(FILE * __stream) __THROW; /* Return the EOF indicator for STREAM. */ extern int feof(FILE * __stream) __THROW __wur; /* Return the error indicator for STREAM. */ extern int ferror(FILE * __stream) __THROW __wur; __END_NAMESPACE_STD #ifdef __USE_MISC /* Faster versions when locking is not required. */ extern void clearerr_unlocked(FILE * __stream) __THROW; extern int feof_unlocked(FILE * __stream) __THROW __wur; extern int ferror_unlocked(FILE * __stream) __THROW __wur; #endif __BEGIN_NAMESPACE_STD /* Print a message describing the meaning of the value of errno. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void perror(const char *__s); __END_NAMESPACE_STD /* Provide the declarations for `sys_errlist' and `sys_nerr' if they are available on this system. Even if available, these variables should not be used directly. The `strerror' function provides all the necessary functionality. */ #include #ifdef __USE_POSIX /* Return the system file descriptor for STREAM. */ extern int fileno(FILE * __stream) __THROW __wur; #endif /* Use POSIX. */ #ifdef __USE_MISC /* Faster version when locking is not required. */ extern int fileno_unlocked(FILE * __stream) __THROW __wur; #endif #ifdef __USE_POSIX2 /* Create a new stream connected to a pipe running the given command. This function is a possible cancellation point and therefore not marked with __THROW. */ extern FILE *popen(const char *__command, const char *__modes) __wur; /* Close a stream opened by popen and return the status of its child. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int pclose(FILE * __stream); #endif #ifdef __USE_POSIX /* Return the name of the controlling terminal. */ extern char *ctermid(char *__s) __THROW; #endif /* Use POSIX. */ #ifdef __USE_XOPEN /* Return the name of the current user. */ extern char *cuserid(char *__s); #endif /* Use X/Open, but not issue 6. */ #ifdef __USE_GNU struct obstack; /* See . */ /* Write formatted output to an obstack. */ extern int obstack_printf(struct obstack *__restrict __obstack, const char *__restrict __format, ...) __THROWNL __attribute__ ((__format__(__printf__, 2, 3))); extern int obstack_vprintf(struct obstack *__restrict __obstack, const char *__restrict __format, _G_va_list __args) __THROWNL __attribute__ ((__format__(__printf__, 2, 0))); #endif /* Use GNU. */ #ifdef __USE_POSIX /* These are defined in POSIX.1:1996. */ /* Acquire ownership of STREAM. */ extern void flockfile(FILE * __stream) __THROW; /* Try to acquire ownership of STREAM but do not block if it is not possible. */ extern int ftrylockfile(FILE * __stream) __THROW __wur; /* Relinquish the ownership granted for STREAM. */ extern void funlockfile(FILE * __stream) __THROW; #endif /* POSIX */ #if defined __USE_XOPEN && !defined __USE_XOPEN2K && !defined __USE_GNU /* The X/Open standard requires some functions and variables to be declared here which do not belong into this header. But we have to follow. In GNU mode we don't do this nonsense. */ # define __need_getopt # include #endif /* X/Open, but not issue 6 and not for GNU. */ /* If we are compiling with optimizing read this file. It contains several optimizing inline functions and macros. */ #ifdef __USE_EXTERN_INLINES # include #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif #ifdef __LDBL_COMPAT # include #endif __END_DECLS #endif /* included. */ #endif /* !_STDIO_H */ ================================================ FILE: v2/headers/linux_amd64/usr/include/stdlib.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.20 General utilities */ #ifndef _STDLIB_H #include /* Get size_t, wchar_t and NULL from . */ #define __need_size_t #ifndef __need_malloc_and_calloc # define __need_wchar_t # define __need_NULL #endif #include __BEGIN_DECLS #ifndef __need_malloc_and_calloc #define _STDLIB_H 1 #if (defined __USE_XOPEN || defined __USE_XOPEN2K8) && !defined _SYS_WAIT_H /* XPG requires a few symbols from being defined. */ # include # include # ifdef __USE_MISC /* Lots of hair to allow traditional BSD use of `union wait' as well as POSIX.1 use of `int' for the status word. */ # if defined __GNUC__ && !defined __cplusplus # define __WAIT_INT(status) \ (__extension__ (((union { __typeof(status) __in; int __i; }) \ { .__in = (status) }).__i)) # else # define __WAIT_INT(status) (*(int *) &(status)) # endif /* This is the type of the argument to `wait'. The funky union causes redeclarations with either `int *' or `union wait *' to be allowed without complaint. __WAIT_STATUS_DEFN is the type used in the actual function definitions. */ # if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus # define __WAIT_STATUS void * # define __WAIT_STATUS_DEFN void * # else /* This works in GCC 2.6.1 and later. */ typedef union { union wait *__uptr; int *__iptr; } __WAIT_STATUS __attribute__ ((__transparent_union__)); # define __WAIT_STATUS_DEFN int * # endif # else /* Don't use misc. */ # define __WAIT_INT(status) (status) # define __WAIT_STATUS int * # define __WAIT_STATUS_DEFN int * # endif /* Use misc. */ /* Define the macros also would define this way. */ # define WEXITSTATUS(status) __WEXITSTATUS (__WAIT_INT (status)) # define WTERMSIG(status) __WTERMSIG (__WAIT_INT (status)) # define WSTOPSIG(status) __WSTOPSIG (__WAIT_INT (status)) # define WIFEXITED(status) __WIFEXITED (__WAIT_INT (status)) # define WIFSIGNALED(status) __WIFSIGNALED (__WAIT_INT (status)) # define WIFSTOPPED(status) __WIFSTOPPED (__WAIT_INT (status)) # ifdef __WIFCONTINUED # define WIFCONTINUED(status) __WIFCONTINUED (__WAIT_INT (status)) # endif #endif /* X/Open or XPG7 and not included. */ __BEGIN_NAMESPACE_STD /* Returned by `div'. */ typedef struct { int quot; /* Quotient. */ int rem; /* Remainder. */ } div_t; /* Returned by `ldiv'. */ #ifndef __ldiv_t_defined typedef struct { long int quot; /* Quotient. */ long int rem; /* Remainder. */ } ldiv_t; # define __ldiv_t_defined 1 #endif __END_NAMESPACE_STD #if defined __USE_ISOC99 && !defined __lldiv_t_defined __BEGIN_NAMESPACE_C99 /* Returned by `lldiv'. */ __extension__ typedef struct { long long int quot; /* Quotient. */ long long int rem; /* Remainder. */ } lldiv_t; # define __lldiv_t_defined 1 __END_NAMESPACE_C99 #endif /* The largest number rand will return (same as INT_MAX). */ #define RAND_MAX 2147483647 /* We define these the same for all machines. Changes from this to the outside world should be done in `_exit'. */ #define EXIT_FAILURE 1 /* Failing exit status. */ #define EXIT_SUCCESS 0 /* Successful exit status. */ /* Maximum length of a multibyte character in the current locale. */ #define MB_CUR_MAX (__ctype_get_mb_cur_max ()) extern size_t __ctype_get_mb_cur_max(void) __THROW __wur; __BEGIN_NAMESPACE_STD /* Convert a string to a floating-point number. */ extern double atof(const char *__nptr) __THROW __attribute_pure__ __nonnull((1)) __wur; /* Convert a string to an integer. */ extern int atoi(const char *__nptr) __THROW __attribute_pure__ __nonnull((1)) __wur; /* Convert a string to a long integer. */ extern long int atol(const char *__nptr) __THROW __attribute_pure__ __nonnull((1)) __wur; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Convert a string to a long long integer. */ __extension__ extern long long int atoll(const char *__nptr) __THROW __attribute_pure__ __nonnull((1)) __wur; __END_NAMESPACE_C99 #endif __BEGIN_NAMESPACE_STD /* Convert a string to a floating-point number. */ extern double strtod(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float strtof(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); extern long double strtold(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); __END_NAMESPACE_C99 #endif __BEGIN_NAMESPACE_STD /* Convert a string to a long integer. */ extern long int strtol(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); /* Convert a string to an unsigned long integer. */ extern unsigned long int strtoul(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); __END_NAMESPACE_STD #ifdef __USE_MISC /* Convert a string to a quadword integer. */ __extension__ extern long long int strtoq(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); /* Convert a string to an unsigned quadword integer. */ __extension__ extern unsigned long long int strtouq(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); #endif /* Use misc. */ #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Convert a string to a quadword integer. */ __extension__ extern long long int strtoll(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); /* Convert a string to an unsigned quadword integer. */ __extension__ extern unsigned long long int strtoull(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); __END_NAMESPACE_C99 #endif /* ISO C99 or use MISC. */ #ifdef __USE_GNU /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another problem is the implementation of the internationalization handling in the ISO C++ standard library. To support this another set of the functions using locale data exist which take an additional argument. Attention: even though several *_l interfaces are part of POSIX:2008, these are not. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ # include /* Special versions of the functions above which take the locale to use as an additional parameter. */ extern long int strtol_l(const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW __nonnull((1, 4)); extern unsigned long int strtoul_l(const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW __nonnull((1, 4)); __extension__ extern long long int strtoll_l(const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW __nonnull((1, 4)); __extension__ extern unsigned long long int strtoull_l(const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW __nonnull((1, 4)); extern double strtod_l(const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __THROW __nonnull((1, 3)); extern float strtof_l(const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __THROW __nonnull((1, 3)); extern long double strtold_l(const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __THROW __nonnull((1, 3)); #endif /* GNU */ #ifdef __USE_EXTERN_INLINES __BEGIN_NAMESPACE_STD __extern_inline int __NTH(atoi(const char *__nptr)) { return (int)strtol(__nptr, (char **)NULL, 10); } __extern_inline long int __NTH(atol(const char *__nptr)) { return strtol(__nptr, (char **)NULL, 10); } __END_NAMESPACE_STD # ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 __extension__ __extern_inline long long int __NTH(atoll(const char *__nptr)) { return strtoll(__nptr, (char **)NULL, 10); } __END_NAMESPACE_C99 # endif #endif /* Optimizing and Inlining. */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Convert N to base 64 using the digits "./0-9A-Za-z", least-significant digit first. Returns a pointer to static storage overwritten by the next call. */ extern char *l64a(long int __n) __THROW __wur; /* Read a number from a string S in base 64 as above. */ extern long int a64l(const char *__s) __THROW __attribute_pure__ __nonnull((1)) __wur; #endif /* Use misc || extended X/Open. */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED # include /* we need int32_t... */ /* These are the functions that actually do things. The `random', `srandom', `initstate' and `setstate' functions are those from BSD Unices. The `rand' and `srand' functions are required by the ANSI standard. We provide both interfaces to the same random number generator. */ /* Return a random long integer between 0 and RAND_MAX inclusive. */ extern long int random(void) __THROW; /* Seed the random number generator with the given number. */ extern void srandom(unsigned int __seed) __THROW; /* Initialize the random number generator to use state buffer STATEBUF, of length STATELEN, and seed it with SEED. Optimal lengths are 8, 16, 32, 64, 128 and 256, the bigger the better; values less than 8 will cause an error and values greater than 256 will be rounded down. */ extern char *initstate(unsigned int __seed, char *__statebuf, size_t __statelen) __THROW __nonnull((2)); /* Switch the random number generator to state buffer STATEBUF, which should have been previously initialized by `initstate'. */ extern char *setstate(char *__statebuf) __THROW __nonnull((1)); # ifdef __USE_MISC /* Reentrant versions of the `random' family of functions. These functions all use the following data structure to contain state, rather than global state variables. */ struct random_data { int32_t *fptr; /* Front pointer. */ int32_t *rptr; /* Rear pointer. */ int32_t *state; /* Array of state values. */ int rand_type; /* Type of random number generator. */ int rand_deg; /* Degree of random number generator. */ int rand_sep; /* Distance between front and rear. */ int32_t *end_ptr; /* Pointer behind state table. */ }; extern int random_r(struct random_data *__restrict __buf, int32_t * __restrict __result) __THROW __nonnull((1, 2)); extern int srandom_r(unsigned int __seed, struct random_data *__buf) __THROW __nonnull((2)); extern int initstate_r(unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) __THROW __nonnull((2, 4)); extern int setstate_r(char *__restrict __statebuf, struct random_data *__restrict __buf) __THROW __nonnull((1, 2)); # endif /* Use misc. */ #endif /* Use extended X/Open || misc. */ __BEGIN_NAMESPACE_STD /* Return a random integer between 0 and RAND_MAX inclusive. */ extern int rand(void) __THROW; /* Seed the random number generator with the given number. */ extern void srand(unsigned int __seed) __THROW; __END_NAMESPACE_STD #ifdef __USE_POSIX /* Reentrant interface according to POSIX.1. */ extern int rand_r(unsigned int *__seed) __THROW; #endif #if defined __USE_MISC || defined __USE_XOPEN /* System V style 48-bit random number generator functions. */ /* Return non-negative, double-precision floating-point value in [0.0,1.0). */ extern double drand48(void) __THROW; extern double erand48(unsigned short int __xsubi[3]) __THROW __nonnull((1)); /* Return non-negative, long integer in [0,2^31). */ extern long int lrand48(void) __THROW; extern long int nrand48(unsigned short int __xsubi[3]) __THROW __nonnull((1)); /* Return signed, long integers in [-2^31,2^31). */ extern long int mrand48(void) __THROW; extern long int jrand48(unsigned short int __xsubi[3]) __THROW __nonnull((1)); /* Seed random number generator. */ extern void srand48(long int __seedval) __THROW; extern unsigned short int *seed48(unsigned short int __seed16v[3]) __THROW __nonnull((1)); extern void lcong48(unsigned short int __param[7]) __THROW __nonnull((1)); # ifdef __USE_MISC /* Data structure for communication with thread safe versions. This type is to be regarded as opaque. It's only exported because users have to allocate objects of this type. */ struct drand48_data { unsigned short int __x[3]; /* Current state. */ unsigned short int __old_x[3]; /* Old state. */ unsigned short int __c; /* Additive const. in congruential formula. */ unsigned short int __init; /* Flag for initializing. */ __extension__ unsigned long long int __a; /* Factor in congruential formula. */ }; /* Return non-negative, double-precision floating-point value in [0.0,1.0). */ extern int drand48_r(struct drand48_data *__restrict __buffer, double *__restrict __result) __THROW __nonnull((1, 2)); extern int erand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) __THROW __nonnull((1, 2)); /* Return non-negative, long integer in [0,2^31). */ extern int lrand48_r(struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull((1, 2)); extern int nrand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull((1, 2)); /* Return signed, long integers in [-2^31,2^31). */ extern int mrand48_r(struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull((1, 2)); extern int jrand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull((1, 2)); /* Seed random number generator. */ extern int srand48_r(long int __seedval, struct drand48_data *__buffer) __THROW __nonnull((2)); extern int seed48_r(unsigned short int __seed16v[3], struct drand48_data *__buffer) __THROW __nonnull((1, 2)); extern int lcong48_r(unsigned short int __param[7], struct drand48_data *__buffer) __THROW __nonnull((1, 2)); # endif /* Use misc. */ #endif /* Use misc or X/Open. */ #endif /* don't just need malloc and calloc */ #ifndef __malloc_and_calloc_defined # define __malloc_and_calloc_defined __BEGIN_NAMESPACE_STD /* Allocate SIZE bytes of memory. */ extern void *malloc(size_t __size) __THROW __attribute_malloc__ __wur; /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ extern void *calloc(size_t __nmemb, size_t __size) __THROW __attribute_malloc__ __wur; __END_NAMESPACE_STD #endif #ifndef __need_malloc_and_calloc __BEGIN_NAMESPACE_STD /* Re-allocate the previously allocated block in PTR, making the new block SIZE bytes long. */ /* __attribute_malloc__ is not used, because if realloc returns the same pointer that was passed to it, aliasing needs to be allowed between objects pointed by the old and new pointers. */ extern void *realloc(void *__ptr, size_t __size) __THROW __attribute_warn_unused_result__; /* Free a block allocated by `malloc', `realloc' or `calloc'. */ extern void free(void *__ptr) __THROW; __END_NAMESPACE_STD #ifdef __USE_MISC /* Free a block. An alias for `free'. (Sun Unices). */ extern void cfree(void *__ptr) __THROW; #endif /* Use misc. */ #ifdef __USE_MISC # include #endif /* Use misc. */ #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \ || defined __USE_MISC /* Allocate SIZE bytes on a page boundary. The storage cannot be freed. */ extern void *valloc(size_t __size) __THROW __attribute_malloc__ __wur; #endif #ifdef __USE_XOPEN2K /* Allocate memory of SIZE bytes with an alignment of ALIGNMENT. */ extern int posix_memalign(void **__memptr, size_t __alignment, size_t __size) __THROW __nonnull((1)) __wur; #endif #ifdef __USE_ISOC11 /* ISO C variant of aligned allocation. */ extern void *aligned_alloc(size_t __alignment, size_t __size) __THROW __attribute_malloc__ __attribute_alloc_size__((2)) __wur; #endif __BEGIN_NAMESPACE_STD /* Abort execution and generate a core-dump. */ extern void abort(void) __THROW __attribute__ ((__noreturn__)); /* Register a function to be called when `exit' is called. */ extern int atexit(void (*__func) (void)) __THROW __nonnull((1)); #if defined __USE_ISOC11 || defined __USE_ISOCXX11 /* Register a function to be called when `quick_exit' is called. */ # ifdef __cplusplus extern "C++" int at_quick_exit(void (*__func) (void)) __THROW __asm("at_quick_exit") __nonnull((1)); # else extern int at_quick_exit(void (*__func) (void)) __THROW __nonnull((1)); # endif #endif __END_NAMESPACE_STD #ifdef __USE_MISC /* Register a function to be called with the status given to `exit' and the given argument. */ extern int on_exit(void (*__func) (int __status, void *__arg), void *__arg) __THROW __nonnull((1)); #endif __BEGIN_NAMESPACE_STD /* Call all functions registered with `atexit' and `on_exit', in the reverse of the order in which they were registered, perform stdio cleanup, and terminate program execution with STATUS. */ extern void exit(int __status) __THROW __attribute__ ((__noreturn__)); #if defined __USE_ISOC11 || defined __USE_ISOCXX11 /* Call all functions registered with `at_quick_exit' in the reverse of the order in which they were registered and terminate program execution with STATUS. */ extern void quick_exit(int __status) __THROW __attribute__ ((__noreturn__)); #endif __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Terminate the program with STATUS without calling any of the functions registered with `atexit' or `on_exit'. */ extern void _Exit(int __status) __THROW __attribute__ ((__noreturn__)); __END_NAMESPACE_C99 #endif __BEGIN_NAMESPACE_STD /* Return the value of envariable NAME, or NULL if it doesn't exist. */ extern char *getenv(const char *__name) __THROW __nonnull((1)) __wur; __END_NAMESPACE_STD #ifdef __USE_GNU /* This function is similar to the above but returns NULL if the programs is running with SUID or SGID enabled. */ extern char *secure_getenv(const char *__name) __THROW __nonnull((1)) __wur; #endif #if defined __USE_MISC || defined __USE_XOPEN /* The SVID says this is in , but this seems a better place. */ /* Put STRING, which is of the form "NAME=VALUE", in the environment. If there is no `=', remove NAME from the environment. */ extern int putenv(char *__string) __THROW __nonnull((1)); #endif #ifdef __USE_XOPEN2K /* Set NAME to VALUE in the environment. If REPLACE is nonzero, overwrite an existing value. */ extern int setenv(const char *__name, const char *__value, int __replace) __THROW __nonnull((2)); /* Remove the variable NAME from the environment. */ extern int unsetenv(const char *__name) __THROW __nonnull((1)); #endif #ifdef __USE_MISC /* The `clearenv' was planned to be added to POSIX.1 but probably never made it. Nevertheless the POSIX.9 standard (POSIX bindings for Fortran 77) requires this function. */ extern int clearenv(void) __THROW; #endif #if defined __USE_MISC \ || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) /* Generate a unique temporary file name from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the file name unique. Always returns TEMPLATE, it's either a temporary file name or a null string if it cannot get a unique file name. */ extern char *mktemp(char *__template) __THROW __nonnull((1)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Generate a unique temporary file name from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the filename unique. Returns a file descriptor open on the file for reading and writing, or -1 if it cannot create a uniquely-named file. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int mkstemp(char *__template) __nonnull((1)) __wur; # else # ifdef __REDIRECT extern int __REDIRECT(mkstemp, (char *__template), mkstemp64) __nonnull((1)) __wur; # else # define mkstemp mkstemp64 # endif # endif # ifdef __USE_LARGEFILE64 extern int mkstemp64(char *__template) __nonnull((1)) __wur; # endif #endif #ifdef __USE_MISC /* Similar to mkstemp, but the template can have a suffix after the XXXXXX. The length of the suffix is specified in the second parameter. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int mkstemps(char *__template, int __suffixlen) __nonnull((1)) __wur; # else # ifdef __REDIRECT extern int __REDIRECT(mkstemps, (char *__template, int __suffixlen), mkstemps64) __nonnull((1)) __wur; # else # define mkstemps mkstemps64 # endif # endif # ifdef __USE_LARGEFILE64 extern int mkstemps64(char *__template, int __suffixlen) __nonnull((1)) __wur; # endif #endif #ifdef __USE_XOPEN2K8 /* Create a unique temporary directory from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the directory name unique. Returns TEMPLATE, or a null pointer if it cannot get a unique name. The directory is created mode 700. */ extern char *mkdtemp(char *__template) __THROW __nonnull((1)) __wur; #endif #ifdef __USE_GNU /* Generate a unique temporary file name from TEMPLATE similar to mkstemp. But allow the caller to pass additional flags which are used in the open call to create the file.. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int mkostemp(char *__template, int __flags) __nonnull((1)) __wur; # else # ifdef __REDIRECT extern int __REDIRECT(mkostemp, (char *__template, int __flags), mkostemp64) __nonnull((1)) __wur; # else # define mkostemp mkostemp64 # endif # endif # ifdef __USE_LARGEFILE64 extern int mkostemp64(char *__template, int __flags) __nonnull((1)) __wur; # endif /* Similar to mkostemp, but the template can have a suffix after the XXXXXX. The length of the suffix is specified in the second parameter. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int mkostemps(char *__template, int __suffixlen, int __flags) __nonnull((1)) __wur; # else # ifdef __REDIRECT extern int __REDIRECT(mkostemps, (char *__template, int __suffixlen, int __flags), mkostemps64) __nonnull((1)) __wur; # else # define mkostemps mkostemps64 # endif # endif # ifdef __USE_LARGEFILE64 extern int mkostemps64(char *__template, int __suffixlen, int __flags) __nonnull((1)) __wur; # endif #endif __BEGIN_NAMESPACE_STD /* Execute the given line as a shell command. This function is a cancellation point and therefore not marked with __THROW. */ extern int system(const char *__command) __wur; __END_NAMESPACE_STD #ifdef __USE_GNU /* Return a malloc'd string containing the canonical absolute name of the existing named file. */ extern char *canonicalize_file_name(const char *__name) __THROW __nonnull((1)) __wur; #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Return the canonical absolute name of file NAME. If RESOLVED is null, the result is malloc'd; otherwise, if the canonical name is PATH_MAX chars or more, returns null with `errno' set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, returns the name in RESOLVED. */ extern char *realpath(const char *__restrict __name, char *__restrict __resolved) __THROW __wur; #endif /* Shorthand for type of comparison functions. */ #ifndef __COMPAR_FN_T # define __COMPAR_FN_T typedef int (*__compar_fn_t) (const void *, const void *); # ifdef __USE_GNU typedef __compar_fn_t comparison_fn_t; # endif #endif #ifdef __USE_GNU typedef int (*__compar_d_fn_t) (const void *, const void *, void *); #endif __BEGIN_NAMESPACE_STD /* Do a binary search for KEY in BASE, which consists of NMEMB elements of SIZE bytes each, using COMPAR to perform the comparisons. */ extern void *bsearch(const void *__key, const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __nonnull((1, 2, 5)) __wur; #ifdef __USE_EXTERN_INLINES # include #endif /* Sort NMEMB elements of BASE, of SIZE bytes each, using COMPAR to perform the comparisons. */ extern void qsort(void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __nonnull((1, 4)); #ifdef __USE_GNU extern void qsort_r(void *__base, size_t __nmemb, size_t __size, __compar_d_fn_t __compar, void *__arg) __nonnull((1, 4)); #endif /* Return the absolute value of X. */ extern int abs(int __x) __THROW __attribute__ ((__const__)) __wur; extern long int labs(long int __x) __THROW __attribute__ ((__const__)) __wur; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __extension__ extern long long int llabs(long long int __x) __THROW __attribute__ ((__const__)) __wur; #endif __BEGIN_NAMESPACE_STD /* Return the `div_t', `ldiv_t' or `lldiv_t' representation of the value of NUMER over DENOM. */ /* GCC may have built-ins for these someday. */ extern div_t div(int __numer, int __denom) __THROW __attribute__ ((__const__)) __wur; extern ldiv_t ldiv(long int __numer, long int __denom) __THROW __attribute__ ((__const__)) __wur; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 __extension__ extern lldiv_t lldiv(long long int __numer, long long int __denom) __THROW __attribute__ ((__const__)) __wur; __END_NAMESPACE_C99 #endif #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_MISC /* Convert floating point numbers to strings. The returned values are valid only until another call to the same function. */ /* Convert VALUE to a string with NDIGIT digits and return a pointer to this. Set *DECPT with the position of the decimal character and *SIGN with the sign of the number. */ extern char *ecvt(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull((3, 4)) __wur; /* Convert VALUE to a string rounded to NDIGIT decimal digits. Set *DECPT with the position of the decimal character and *SIGN with the sign of the number. */ extern char *fcvt(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull((3, 4)) __wur; /* If possible convert VALUE to a string with NDIGIT significant digits. Otherwise use exponential representation. The resulting string will be written to BUF. */ extern char *gcvt(double __value, int __ndigit, char *__buf) __THROW __nonnull((3)) __wur; #endif #ifdef __USE_MISC /* Long double versions of above functions. */ extern char *qecvt(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull((3, 4)) __wur; extern char *qfcvt(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull((3, 4)) __wur; extern char *qgcvt(long double __value, int __ndigit, char *__buf) __THROW __nonnull((3)) __wur; /* Reentrant version of the functions above which provide their own buffers. */ extern int ecvt_r(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull((3, 4, 5)); extern int fcvt_r(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull((3, 4, 5)); extern int qecvt_r(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull((3, 4, 5)); extern int qfcvt_r(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull((3, 4, 5)); #endif /* misc */ __BEGIN_NAMESPACE_STD /* Return the length of the multibyte character in S, which is no longer than N. */ extern int mblen(const char *__s, size_t __n) __THROW; /* Return the length of the given multibyte character, putting its `wchar_t' representation in *PWC. */ extern int mbtowc(wchar_t * __restrict __pwc, const char *__restrict __s, size_t __n) __THROW; /* Put the multibyte character represented by WCHAR in S, returning its length. */ extern int wctomb(char *__s, wchar_t __wchar) __THROW; /* Convert a multibyte string to a wide char string. */ extern size_t mbstowcs(wchar_t * __restrict __pwcs, const char *__restrict __s, size_t __n) __THROW; /* Convert a wide char string to multibyte string. */ extern size_t wcstombs(char *__restrict __s, const wchar_t * __restrict __pwcs, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_MISC /* Determine whether the string value of RESPONSE matches the affirmation or negative response expression as specified by the LC_MESSAGES category in the program's current locale. Returns 1 if affirmative, 0 if negative, and -1 if not matching. */ extern int rpmatch(const char *__response) __THROW __nonnull((1)) __wur; #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Parse comma separated suboption from *OPTIONP and match against strings in TOKENS. If found return index and set *VALUEP to optional value introduced by an equal sign. If the suboption is not part of TOKENS return in *VALUEP beginning of unknown suboption. On exit *OPTIONP is set to the beginning of the next token or at the terminating NUL character. */ extern int getsubopt(char **__restrict __optionp, char *const *__restrict __tokens, char **__restrict __valuep) __THROW __nonnull((1, 2, 3)) __wur; #endif #ifdef __USE_XOPEN /* Setup DES tables according KEY. */ extern void setkey(const char *__key) __THROW __nonnull((1)); #endif /* X/Open pseudo terminal handling. */ #ifdef __USE_XOPEN2KXSI /* Return a master pseudo-terminal handle. */ extern int posix_openpt(int __oflag) __wur; #endif #ifdef __USE_XOPEN /* The next four functions all take a master pseudo-tty fd and perform an operation on the associated slave: */ /* Chown the slave to the calling user. */ extern int grantpt(int __fd) __THROW; /* Release an internal lock so the slave can be opened. Call after grantpt(). */ extern int unlockpt(int __fd) __THROW; /* Return the pathname of the pseudo terminal slave associated with the master FD is open on, or NULL on errors. The returned storage is good until the next call to this function. */ extern char *ptsname(int __fd) __THROW __wur; #endif #ifdef __USE_GNU /* Store at most BUFLEN characters of the pathname of the slave pseudo terminal associated with the master FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ptsname_r(int __fd, char *__buf, size_t __buflen) __THROW __nonnull((2)); /* Open a master pseudo terminal and return its file descriptor. */ extern int getpt(void); #endif #ifdef __USE_MISC /* Put the 1 minute, 5 minute and 15 minute load averages into the first NELEM elements of LOADAVG. Return the number written (never more than three, but may be less than NELEM), or -1 if an error occurred. */ extern int getloadavg(double __loadavg[], int __nelem) __THROW __nonnull((1)); #endif #include /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif #ifdef __LDBL_COMPAT # include #endif #endif /* don't just need malloc and calloc */ #undef __need_malloc_and_calloc __END_DECLS #endif /* stdlib.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/string.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.21 String handling */ #ifndef _STRING_H #define _STRING_H 1 #include __BEGIN_DECLS /* Get size_t and NULL from . */ #define __need_size_t #define __need_NULL #include /* Tell the caller that we provide correct C++ prototypes. */ #if defined __cplusplus && __GNUC_PREREQ (4, 4) # define __CORRECT_ISO_CPP_STRING_H_PROTO #endif __BEGIN_NAMESPACE_STD /* Copy N bytes of SRC to DEST. */ extern void *memcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Copy N bytes of SRC to DEST, guaranteeing correct behavior for overlapping strings. */ extern void *memmove(void *__dest, const void *__src, size_t __n) __THROW __nonnull((1, 2)); __END_NAMESPACE_STD /* Copy no more than N bytes of SRC to DEST, stopping when C is found. Return the position in DEST one byte past where C was copied, or NULL if C was not found in the first N bytes of SRC. */ #if defined __USE_MISC || defined __USE_XOPEN extern void *memccpy(void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) __THROW __nonnull((1, 2)); #endif /* Misc || X/Open. */ __BEGIN_NAMESPACE_STD /* Set N bytes of S to C. */ extern void *memset(void *__s, int __c, size_t __n) __THROW __nonnull((1)); /* Compare N bytes of S1 and S2. */ extern int memcmp(const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); /* Search N bytes of S for C. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern void *memchr(void *__s, int __c, size_t __n) __THROW __asm("memchr") __attribute_pure__ __nonnull((1)); extern const void *memchr(const void *__s, int __c, size_t __n) __THROW __asm("memchr") __attribute_pure__ __nonnull((1)); # ifdef __OPTIMIZE__ __extern_always_inline void *memchr(void *__s, int __c, size_t __n) __THROW { return __builtin_memchr(__s, __c, __n); } __extern_always_inline const void *memchr(const void *__s, int __c, size_t __n) __THROW { return __builtin_memchr(__s, __c, __n); } # endif } #else extern void *memchr(const void *__s, int __c, size_t __n) __THROW __attribute_pure__ __nonnull((1)); #endif __END_NAMESPACE_STD #ifdef __USE_GNU /* Search in S for C. This is similar to `memchr' but there is no length limit. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" void *rawmemchr(void *__s, int __c) __THROW __asm("rawmemchr") __attribute_pure__ __nonnull((1)); extern "C++" const void *rawmemchr(const void *__s, int __c) __THROW __asm("rawmemchr") __attribute_pure__ __nonnull((1)); # else extern void *rawmemchr(const void *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); # endif /* Search N bytes of S for the final occurrence of C. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" void *memrchr(void *__s, int __c, size_t __n) __THROW __asm("memrchr") __attribute_pure__ __nonnull((1)); extern "C++" const void *memrchr(const void *__s, int __c, size_t __n) __THROW __asm("memrchr") __attribute_pure__ __nonnull((1)); # else extern void *memrchr(const void *__s, int __c, size_t __n) __THROW __attribute_pure__ __nonnull((1)); # endif #endif __BEGIN_NAMESPACE_STD /* Copy SRC to DEST. */ extern char *strcpy(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1, 2)); /* Copy no more than N characters of SRC to DEST. */ extern char *strncpy(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Append SRC onto DEST. */ extern char *strcat(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1, 2)); /* Append no more than N characters from SRC onto DEST. */ extern char *strncat(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Compare S1 and S2. */ extern int strcmp(const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Compare N characters of S1 and S2. */ extern int strncmp(const char *__s1, const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); /* Compare the collated forms of S1 and S2. */ extern int strcoll(const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Put a transformation of SRC into no more than N bytes of DEST. */ extern size_t strxfrm(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((2)); __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* The following functions are equivalent to the both above but they take the locale they use for the collation as an extra argument. This is not standardsized but something like will come. */ # include /* Compare the collated forms of S1 and S2 using rules from L. */ extern int strcoll_l(const char *__s1, const char *__s2, __locale_t __l) __THROW __attribute_pure__ __nonnull((1, 2, 3)); /* Put a transformation of SRC into no more than N bytes of DEST. */ extern size_t strxfrm_l(char *__dest, const char *__src, size_t __n, __locale_t __l) __THROW __nonnull((2, 4)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Duplicate S, returning an identical malloc'd string. */ extern char *strdup(const char *__s) __THROW __attribute_malloc__ __nonnull((1)); #endif /* Return a malloc'd copy of at most N bytes of STRING. The resultant string is terminated even if no null terminator appears before STRING[N]. */ #if defined __USE_XOPEN2K8 extern char *strndup(const char *__string, size_t __n) __THROW __attribute_malloc__ __nonnull((1)); #endif #if defined __USE_GNU && defined __GNUC__ /* Duplicate S, returning an identical alloca'd string. */ # define strdupa(s) \ (__extension__ \ ({ \ const char *__old = (s); \ size_t __len = strlen (__old) + 1; \ char *__new = (char *) __builtin_alloca (__len); \ (char *) memcpy (__new, __old, __len); \ })) /* Return an alloca'd copy of at most N bytes of string. */ # define strndupa(s, n) \ (__extension__ \ ({ \ const char *__old = (s); \ size_t __len = strnlen (__old, (n)); \ char *__new = (char *) __builtin_alloca (__len + 1); \ __new[__len] = '\0'; \ (char *) memcpy (__new, __old, __len); \ })) #endif __BEGIN_NAMESPACE_STD /* Find the first occurrence of C in S. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strchr(char *__s, int __c) __THROW __asm("strchr") __attribute_pure__ __nonnull((1)); extern const char *strchr(const char *__s, int __c) __THROW __asm("strchr") __attribute_pure__ __nonnull((1)); # ifdef __OPTIMIZE__ __extern_always_inline char *strchr(char *__s, int __c) __THROW { return __builtin_strchr(__s, __c); } __extern_always_inline const char *strchr(const char *__s, int __c) __THROW { return __builtin_strchr(__s, __c); } # endif } #else extern char *strchr(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); #endif /* Find the last occurrence of C in S. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strrchr(char *__s, int __c) __THROW __asm("strrchr") __attribute_pure__ __nonnull((1)); extern const char *strrchr(const char *__s, int __c) __THROW __asm("strrchr") __attribute_pure__ __nonnull((1)); # ifdef __OPTIMIZE__ __extern_always_inline char *strrchr(char *__s, int __c) __THROW { return __builtin_strrchr(__s, __c); } __extern_always_inline const char *strrchr(const char *__s, int __c) __THROW { return __builtin_strrchr(__s, __c); } # endif } #else extern char *strrchr(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); #endif __END_NAMESPACE_STD #ifdef __USE_GNU /* This function is similar to `strchr'. But it returns a pointer to the closing NUL byte in case C is not found in S. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *strchrnul(char *__s, int __c) __THROW __asm("strchrnul") __attribute_pure__ __nonnull((1)); extern "C++" const char *strchrnul(const char *__s, int __c) __THROW __asm("strchrnul") __attribute_pure__ __nonnull((1)); # else extern char *strchrnul(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); # endif #endif __BEGIN_NAMESPACE_STD /* Return the length of the initial segment of S which consists entirely of characters not in REJECT. */ extern size_t strcspn(const char *__s, const char *__reject) __THROW __attribute_pure__ __nonnull((1, 2)); /* Return the length of the initial segment of S which consists entirely of characters in ACCEPT. */ extern size_t strspn(const char *__s, const char *__accept) __THROW __attribute_pure__ __nonnull((1, 2)); /* Find the first occurrence in S of any character in ACCEPT. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strpbrk(char *__s, const char *__accept) __THROW __asm("strpbrk") __attribute_pure__ __nonnull((1, 2)); extern const char *strpbrk(const char *__s, const char *__accept) __THROW __asm("strpbrk") __attribute_pure__ __nonnull((1, 2)); # ifdef __OPTIMIZE__ __extern_always_inline char *strpbrk(char *__s, const char *__accept) __THROW { return __builtin_strpbrk(__s, __accept); } __extern_always_inline const char *strpbrk(const char *__s, const char *__accept) __THROW { return __builtin_strpbrk(__s, __accept); } # endif } #else extern char *strpbrk(const char *__s, const char *__accept) __THROW __attribute_pure__ __nonnull((1, 2)); #endif /* Find the first occurrence of NEEDLE in HAYSTACK. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strstr(char *__haystack, const char *__needle) __THROW __asm("strstr") __attribute_pure__ __nonnull((1, 2)); extern const char *strstr(const char *__haystack, const char *__needle) __THROW __asm("strstr") __attribute_pure__ __nonnull((1, 2)); # ifdef __OPTIMIZE__ __extern_always_inline char *strstr(char *__haystack, const char *__needle) __THROW { return __builtin_strstr(__haystack, __needle); } __extern_always_inline const char *strstr(const char *__haystack, const char *__needle) __THROW { return __builtin_strstr(__haystack, __needle); } # endif } #else extern char *strstr(const char *__haystack, const char *__needle) __THROW __attribute_pure__ __nonnull((1, 2)); #endif /* Divide S into tokens separated by characters in DELIM. */ extern char *strtok(char *__restrict __s, const char *__restrict __delim) __THROW __nonnull((2)); __END_NAMESPACE_STD /* Divide S into tokens separated by characters in DELIM. Information passed between calls are stored in SAVE_PTR. */ extern char *__strtok_r(char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __THROW __nonnull((2, 3)); #ifdef __USE_POSIX extern char *strtok_r(char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __THROW __nonnull((2, 3)); #endif #ifdef __USE_GNU /* Similar to `strstr' but this function ignores the case of both strings. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *strcasestr(char *__haystack, const char *__needle) __THROW __asm("strcasestr") __attribute_pure__ __nonnull((1, 2)); extern "C++" const char *strcasestr(const char *__haystack, const char *__needle) __THROW __asm("strcasestr") __attribute_pure__ __nonnull((1, 2)); # else extern char *strcasestr(const char *__haystack, const char *__needle) __THROW __attribute_pure__ __nonnull((1, 2)); # endif #endif #ifdef __USE_GNU /* Find the first occurrence of NEEDLE in HAYSTACK. NEEDLE is NEEDLELEN bytes long; HAYSTACK is HAYSTACKLEN bytes long. */ extern void *memmem(const void *__haystack, size_t __haystacklen, const void *__needle, size_t __needlelen) __THROW __attribute_pure__ __nonnull((1, 3)); /* Copy N bytes of SRC to DEST, return pointer to bytes after the last written byte. */ extern void *__mempcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); extern void *mempcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); #endif __BEGIN_NAMESPACE_STD /* Return the length of S. */ extern size_t strlen(const char *__s) __THROW __attribute_pure__ __nonnull((1)); __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Find the length of STRING, but scan at most MAXLEN characters. If no '\0' terminator is found in that many characters, return MAXLEN. */ extern size_t strnlen(const char *__string, size_t __maxlen) __THROW __attribute_pure__ __nonnull((1)); #endif __BEGIN_NAMESPACE_STD /* Return a string describing the meaning of the `errno' code in ERRNUM. */ extern char *strerror(int __errnum) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K /* Reentrant version of `strerror'. There are 2 flavors of `strerror_r', GNU which returns the string and may or may not use the supplied temporary buffer and POSIX one which fills the string into the buffer. To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L without -D_GNU_SOURCE is needed, otherwise the GNU version is preferred. */ # if defined __USE_XOPEN2K && !defined __USE_GNU /* Fill BUF with a string describing the meaning of the `errno' code in ERRNUM. */ # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(strerror_r, (int __errnum, char *__buf, size_t __buflen), __xpg_strerror_r) __nonnull((2)); # else extern int __xpg_strerror_r(int __errnum, char *__buf, size_t __buflen) __THROW __nonnull((2)); # define strerror_r __xpg_strerror_r # endif # else /* If a temporary buffer is required, at most BUFLEN bytes of BUF will be used. */ extern char *strerror_r(int __errnum, char *__buf, size_t __buflen) __THROW __nonnull((2)) __wur; # endif #endif #ifdef __USE_XOPEN2K8 /* Translate error number to string according to the locale L. */ extern char *strerror_l(int __errnum, __locale_t __l) __THROW; #endif /* We define this function always since `bzero' is sometimes needed when the namespace rules does not allow this. */ extern void __bzero(void *__s, size_t __n) __THROW __nonnull((1)); #ifdef __USE_MISC /* Copy N bytes of SRC to DEST (like memmove, but args reversed). */ extern void bcopy(const void *__src, void *__dest, size_t __n) __THROW __nonnull((1, 2)); /* Set N bytes of S to 0. */ extern void bzero(void *__s, size_t __n) __THROW __nonnull((1)); /* Compare N bytes of S1 and S2 (same as memcmp). */ extern int bcmp(const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); /* Find the first occurrence of C in S (same as strchr). */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *index(char *__s, int __c) __THROW __asm("index") __attribute_pure__ __nonnull((1)); extern const char *index(const char *__s, int __c) __THROW __asm("index") __attribute_pure__ __nonnull((1)); # if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO __extern_always_inline char *index(char *__s, int __c) __THROW { return __builtin_index(__s, __c); } __extern_always_inline const char *index(const char *__s, int __c) __THROW { return __builtin_index(__s, __c); } # endif } # else extern char *index(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); # endif /* Find the last occurrence of C in S (same as strrchr). */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *rindex(char *__s, int __c) __THROW __asm("rindex") __attribute_pure__ __nonnull((1)); extern const char *rindex(const char *__s, int __c) __THROW __asm("rindex") __attribute_pure__ __nonnull((1)); # if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO __extern_always_inline char *rindex(char *__s, int __c) __THROW { return __builtin_rindex(__s, __c); } __extern_always_inline const char *rindex(const char *__s, int __c) __THROW { return __builtin_rindex(__s, __c); } #endif } # else extern char *rindex(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); # endif /* Return the position of the first bit set in I, or 0 if none are set. The least-significant bit is position 1, the most-significant 32. */ extern int ffs(int __i) __THROW __attribute__ ((__const__)); /* The following two functions are non-standard but necessary for non-32 bit platforms. */ # ifdef __USE_GNU extern int ffsl(long int __l) __THROW __attribute__ ((__const__)); __extension__ extern int ffsll(long long int __ll) __THROW __attribute__ ((__const__)); # endif /* Compare S1 and S2, ignoring case. */ extern int strcasecmp(const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int strncasecmp(const char *__s1, const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); #endif /* Use misc. */ #ifdef __USE_GNU /* Again versions of a few functions which use the given locale instead of the global one. */ extern int strcasecmp_l(const char *__s1, const char *__s2, __locale_t __loc) __THROW __attribute_pure__ __nonnull((1, 2, 3)); extern int strncasecmp_l(const char *__s1, const char *__s2, size_t __n, __locale_t __loc) __THROW __attribute_pure__ __nonnull((1, 2, 4)); #endif #ifdef __USE_MISC /* Return the next DELIM-delimited token from *STRINGP, terminating it with a '\0', and update *STRINGP to point past it. */ extern char *strsep(char **__restrict __stringp, const char *__restrict __delim) __THROW __nonnull((1, 2)); #endif #ifdef __USE_XOPEN2K8 /* Return a string describing the meaning of the signal number in SIG. */ extern char *strsignal(int __sig) __THROW; /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ extern char *__stpcpy(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1, 2)); extern char *stpcpy(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1, 2)); /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ extern char *__stpncpy(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); extern char *stpncpy(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); #endif #ifdef __USE_GNU /* Compare S1 and S2 as strings holding name & indices/version numbers. */ extern int strverscmp(const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Sautee STRING briskly. */ extern char *strfry(char *__string) __THROW __nonnull((1)); /* Frobnicate N bytes of S. */ extern void *memfrob(void *__s, size_t __n) __THROW __nonnull((1)); # ifndef basename /* Return the file name within directory of FILENAME. We don't declare the function if the `basename' macro is available (defined in ) which makes the XPG version of this function available. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *basename(char *__filename) __THROW __asm("basename") __nonnull((1)); extern "C++" const char *basename(const char *__filename) __THROW __asm("basename") __nonnull((1)); # else extern char *basename(const char *__filename) __THROW __nonnull((1)); # endif # endif #endif #if defined __GNUC__ && __GNUC__ >= 2 # if defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ \ && !defined __NO_INLINE__ && !defined __cplusplus /* When using GNU CC we provide some optimized versions of selected functions from this header. There are two kinds of optimizations: - machine-dependent optimizations, most probably using inline assembler code; these might be quite expensive since the code size can increase significantly. These optimizations are not used unless the symbol __USE_STRING_INLINES is defined before including this header. - machine-independent optimizations which do not increase the code size significantly and which optimize mainly situations where one or more arguments are compile-time constants. These optimizations are used always when the compiler is taught to optimize. One can inhibit all optimizations by defining __NO_STRING_INLINES. */ /* Get the machine-dependent optimizations (if any). */ # include /* These are generic optimizations which do not add too much inline code. */ # include # endif # if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function /* Functions with security checks. */ # include # endif #endif __END_DECLS #endif /* string.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/strings.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STRINGS_H #define _STRINGS_H 1 /* We don't need and should not read this file if was already read. The one exception being that if __USE_MISC isn't defined, then these aren't defined in string.h, so we need to define them here. */ #if !defined _STRING_H || !defined __USE_MISC # include # define __need_size_t # include /* Tell the caller that we provide correct C++ prototypes. */ # if defined __cplusplus && __GNUC_PREREQ (4, 4) # define __CORRECT_ISO_CPP_STRINGS_H_PROTO # endif __BEGIN_DECLS # if defined __USE_MISC || !defined __USE_XOPEN2K8 /* Compare N bytes of S1 and S2 (same as memcmp). */ extern int bcmp(const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__; /* Copy N bytes of SRC to DEST (like memmove, but args reversed). */ extern void bcopy(const void *__src, void *__dest, size_t __n) __THROW; /* Set N bytes of S to 0. */ extern void bzero(void *__s, size_t __n) __THROW; /* Find the first occurrence of C in S (same as strchr). */ # ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO extern "C++" { extern char *index(char *__s, int __c) __THROW __asm("index") __attribute_pure__ __nonnull((1)); extern const char *index(const char *__s, int __c) __THROW __asm("index") __attribute_pure__ __nonnull((1)); # if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRING_H_PROTO __extern_always_inline char *index(char *__s, int __c) __THROW { return __builtin_index(__s, __c); } __extern_always_inline const char *index(const char *__s, int __c) __THROW { return __builtin_index(__s, __c); } # endif } # else extern char *index(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); # endif /* Find the last occurrence of C in S (same as strrchr). */ # ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO extern "C++" { extern char *rindex(char *__s, int __c) __THROW __asm("rindex") __attribute_pure__ __nonnull((1)); extern const char *rindex(const char *__s, int __c) __THROW __asm("rindex") __attribute_pure__ __nonnull((1)); # if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRING_H_PROTO __extern_always_inline char *rindex(char *__s, int __c) __THROW { return __builtin_rindex(__s, __c); } __extern_always_inline const char *rindex(const char *__s, int __c) __THROW { return __builtin_rindex(__s, __c); } # endif } # else extern char *rindex(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); # endif # endif #if defined __USE_MISC || !defined __USE_XOPEN2K8 || defined __USE_XOPEN2K8XSI /* Return the position of the first bit set in I, or 0 if none are set. The least-significant bit is position 1, the most-significant 32. */ extern int ffs(int __i) __THROW __attribute__ ((const)); #endif /* Compare S1 and S2, ignoring case. */ extern int strcasecmp(const char *__s1, const char *__s2) __THROW __attribute_pure__; /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int strncasecmp(const char *__s1, const char *__s2, size_t __n) __THROW __attribute_pure__; #ifdef __USE_XOPEN2K8 /* The following functions are equivalent to the both above but they take the locale they use for the collation as an extra argument. This is not standardsized but something like will come. */ # include /* Again versions of a few functions which use the given locale instead of the global one. */ extern int strcasecmp_l(const char *__s1, const char *__s2, __locale_t __loc) __THROW __attribute_pure__ __nonnull((1, 2, 3)); extern int strncasecmp_l(const char *__s1, const char *__s2, size_t __n, __locale_t __loc) __THROW __attribute_pure__ __nonnull((1, 2, 4)); #endif __END_DECLS #endif /* string.h */ #endif /* strings.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/cdefs.h ================================================ /* Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_CDEFS_H #define _SYS_CDEFS_H 1 /* We are almost always included from features.h. */ #ifndef _FEATURES_H # include #endif /* The GNU libc does not support any K&R compilers or the traditional mode of ISO C compilers anymore. Check for some of the combinations not anymore supported. */ #if defined __GNUC__ && !defined __STDC__ # error "You need a ISO C conforming compiler to use the glibc headers" #endif /* Some user header file might have defined this before. */ #undef __P #undef __PMT #ifdef __GNUC__ /* All functions, except those with callbacks or those that synchronize memory, are leaf functions. */ # if __GNUC_PREREQ (4, 6) && !defined _LIBC # define __LEAF , __leaf__ # define __LEAF_ATTR __attribute__ ((__leaf__)) # else # define __LEAF # define __LEAF_ATTR # endif /* GCC can always grok prototypes. For C++ programs we add throw() to help it optimize the function calls. But this works only with gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions as non-throwing using a function attribute since programs can use the -fexceptions options for C code as well. */ # if !defined __cplusplus && __GNUC_PREREQ (3, 3) # define __THROW __attribute__ ((__nothrow__ __LEAF)) # define __THROWNL __attribute__ ((__nothrow__)) # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct # else # if defined __cplusplus && __GNUC_PREREQ (2,8) # define __THROW throw () # define __THROWNL throw () # define __NTH(fct) __LEAF_ATTR fct throw () # else # define __THROW # define __THROWNL # define __NTH(fct) fct # endif # endif #else /* Not GCC. */ # define __inline /* No inline functions. */ # define __THROW # define __THROWNL # define __NTH(fct) fct #endif /* GCC. */ /* These two macros are not used in glibc anymore. They are kept here only because some other projects expect the macros to be defined. */ #define __P(args) args #define __PMT(args) args /* For these things, GCC behaves the ANSI way normally, and the non-ANSI way under -traditional. */ #define __CONCAT(x,y) x ## y #define __STRING(x) #x /* This is not a typedef so `const __ptr_t' does the right thing. */ #define __ptr_t void * #define __long_double_t long double /* C++ needs to know that types and declarations are C, not C++. */ #ifdef __cplusplus # define __BEGIN_DECLS extern "C" { # define __END_DECLS } #else # define __BEGIN_DECLS # define __END_DECLS #endif /* The standard library needs the functions from the ISO C90 standard in the std namespace. At the same time we want to be safe for future changes and we include the ISO C99 code in the non-standard namespace __c99. The C++ wrapper header take case of adding the definitions to the global namespace. */ #if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES # define __BEGIN_NAMESPACE_STD namespace std { # define __END_NAMESPACE_STD } # define __USING_NAMESPACE_STD(name) using std::name; # define __BEGIN_NAMESPACE_C99 namespace __c99 { # define __END_NAMESPACE_C99 } # define __USING_NAMESPACE_C99(name) using __c99::name; #else /* For compatibility we do not add the declarations into any namespace. They will end up in the global namespace which is what old code expects. */ # define __BEGIN_NAMESPACE_STD # define __END_NAMESPACE_STD # define __USING_NAMESPACE_STD(name) # define __BEGIN_NAMESPACE_C99 # define __END_NAMESPACE_C99 # define __USING_NAMESPACE_C99(name) #endif /* Fortify support. */ #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) #define __bos0(ptr) __builtin_object_size (ptr, 0) #if __GNUC_PREREQ (4,3) # define __warndecl(name, msg) \ extern void name (void) __attribute__((__warning__ (msg))) # define __warnattr(msg) __attribute__((__warning__ (msg))) # define __errordecl(name, msg) \ extern void name (void) __attribute__((__error__ (msg))) #else # define __warndecl(name, msg) extern void name (void) # define __warnattr(msg) # define __errordecl(name, msg) extern void name (void) #endif /* Support for flexible arrays. */ #if __GNUC_PREREQ (2,97) /* GCC 2.97 supports C99 flexible array members. */ # define __flexarr [] #else # ifdef __GNUC__ # define __flexarr [0] # else # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __flexarr [] # else /* Some other non-C99 compiler. Approximate with [1]. */ # define __flexarr [1] # endif # endif #endif /* __asm__ ("xyz") is used throughout the headers to rename functions at the assembly language level. This is wrapped by the __REDIRECT macro, in order to support compilers that can do this some other way. When compilers don't support asm-names at all, we have to do preprocessor tricks instead (which don't have exactly the right semantics, but it's the best we can do). Example: int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ #if defined __GNUC__ && __GNUC__ >= 2 # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) # ifdef __cplusplus # define __REDIRECT_NTH(name, proto, alias) \ name proto __THROW __asm__ (__ASMNAME (#alias)) # define __REDIRECT_NTHNL(name, proto, alias) \ name proto __THROWNL __asm__ (__ASMNAME (#alias)) # else # define __REDIRECT_NTH(name, proto, alias) \ name proto __asm__ (__ASMNAME (#alias)) __THROW # define __REDIRECT_NTHNL(name, proto, alias) \ name proto __asm__ (__ASMNAME (#alias)) __THROWNL # endif # define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) # define __ASMNAME2(prefix, cname) __STRING (prefix) cname /* #elif __SOME_OTHER_COMPILER__ # define __REDIRECT(name, proto, alias) name proto; \ _Pragma("let " #name " = " #alias) */ #endif /* GCC has various useful declarations that can be made with the `__attribute__' syntax. All of the ways we use this do fine if they are omitted for compilers that don't understand it. */ #if !defined __GNUC__ || __GNUC__ < 2 # define __attribute__(xyz) /* Ignore */ #endif /* At some point during the gcc 2.96 development the `malloc' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,96) # define __attribute_malloc__ __attribute__ ((__malloc__)) #else # define __attribute_malloc__ /* Ignore */ #endif /* Tell the compiler which arguments to an allocation function indicate the size of the allocation. */ #if __GNUC_PREREQ (4, 3) # define __attribute_alloc_size__(params) \ __attribute__ ((__alloc_size__ params)) #else # define __attribute_alloc_size__(params) /* Ignore. */ #endif /* At some point during the gcc 2.96 development the `pure' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,96) # define __attribute_pure__ __attribute__ ((__pure__)) #else # define __attribute_pure__ /* Ignore */ #endif /* This declaration tells the compiler that the value is constant. */ #if __GNUC_PREREQ (2,5) # define __attribute_const__ __attribute__ ((__const__)) #else # define __attribute_const__ /* Ignore */ #endif /* At some point during the gcc 3.1 development the `used' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (3,1) # define __attribute_used__ __attribute__ ((__used__)) # define __attribute_noinline__ __attribute__ ((__noinline__)) #else # define __attribute_used__ __attribute__ ((__unused__)) # define __attribute_noinline__ /* Ignore */ #endif /* gcc allows marking deprecated functions. */ #if __GNUC_PREREQ (3,2) # define __attribute_deprecated__ __attribute__ ((__deprecated__)) #else # define __attribute_deprecated__ /* Ignore */ #endif /* At some point during the gcc 2.8 development the `format_arg' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. If several `format_arg' attributes are given for the same function, in gcc-3.0 and older, all but the last one are ignored. In newer gccs, all designated arguments are considered. */ #if __GNUC_PREREQ (2,8) # define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) #else # define __attribute_format_arg__(x) /* Ignore */ #endif /* At some point during the gcc 2.97 development the `strfmon' format attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,97) # define __attribute_format_strfmon__(a,b) \ __attribute__ ((__format__ (__strfmon__, a, b))) #else # define __attribute_format_strfmon__(a,b) /* Ignore */ #endif /* The nonull function attribute allows to mark pointer parameters which must not be NULL. */ #if __GNUC_PREREQ (3,3) # define __nonnull(params) __attribute__ ((__nonnull__ params)) #else # define __nonnull(params) #endif /* If fortification mode, we warn about unused results of certain function calls which can lead to problems. */ #if __GNUC_PREREQ (3,4) # define __attribute_warn_unused_result__ \ __attribute__ ((__warn_unused_result__)) # if __USE_FORTIFY_LEVEL > 0 # define __wur __attribute_warn_unused_result__ # endif #else # define __attribute_warn_unused_result__ /* empty */ #endif #ifndef __wur # define __wur /* Ignore */ #endif /* Forces a function to be always inlined. */ #if __GNUC_PREREQ (3,2) # define __always_inline __inline __attribute__ ((__always_inline__)) #else # define __always_inline __inline #endif /* Associate error messages with the source location of the call site rather than with the source location inside the function. */ #if __GNUC_PREREQ (4,3) # define __attribute_artificial__ __attribute__ ((__artificial__)) #else # define __attribute_artificial__ /* Ignore */ #endif /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions older than 4.3 may define these macros and still not guarantee GNU inlining semantics. clang++ identifies itself as gcc-4.2, but has support for GNU inlining semantics, that can be checked fot by using the __GNUC_STDC_INLINE_ and __GNUC_GNU_INLINE__ macro definitions. */ #if (!defined __cplusplus || __GNUC_PREREQ (4,3) \ || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \ || defined __GNUC_GNU_INLINE__))) # if defined __GNUC_STDC_INLINE__ || defined __cplusplus # define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) # define __extern_always_inline \ extern __always_inline __attribute__ ((__gnu_inline__)) # else # define __extern_inline extern __inline # define __extern_always_inline extern __always_inline # endif #endif #ifdef __extern_always_inline # define __fortify_function __extern_always_inline __attribute_artificial__ #endif /* GCC 4.3 and above allow passing all anonymous arguments of an __extern_always_inline function to some other vararg function. */ #if __GNUC_PREREQ (4,3) # define __va_arg_pack() __builtin_va_arg_pack () # define __va_arg_pack_len() __builtin_va_arg_pack_len () #endif /* It is possible to compile containing GCC extensions even if GCC is run in pedantic mode if the uses are carefully marked using the `__extension__' keyword. But this is not generally available before version 2.8. */ #if !__GNUC_PREREQ (2,8) # define __extension__ /* Ignore */ #endif /* __restrict is known in EGCS 1.2 and above. */ #if !__GNUC_PREREQ (2,92) # define __restrict /* Ignore */ #endif /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is array_name[restrict] GCC 3.1 supports this. */ #if __GNUC_PREREQ (3,1) && !defined __GNUG__ # define __restrict_arr __restrict #else # ifdef __GNUC__ # define __restrict_arr /* Not supported in old GCC. */ # else # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __restrict_arr restrict # else /* Some other non-C99 compiler. */ # define __restrict_arr /* Not supported. */ # endif # endif #endif #if __GNUC__ >= 3 # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) # define __glibc_likely(cond) __builtin_expect ((cond), 1) #else # define __glibc_unlikely(cond) (cond) # define __glibc_likely(cond) (cond) #endif #if (!defined _Noreturn \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ && !__GNUC_PREREQ (4,7)) # if __GNUC_PREREQ (2,8) # define _Noreturn __attribute__ ((__noreturn__)) # else # define _Noreturn # endif #endif #if (!defined _Static_assert && !defined __cplusplus \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) # define _Static_assert(expr, diagnostic) \ extern int (*__Static_assert_function (void)) \ [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] #endif #include #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH # define __LDBL_COMPAT 1 # ifdef __REDIRECT # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) # define __LDBL_REDIR(name, proto) \ __LDBL_REDIR1 (name, proto, __nldbl_##name) # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) # define __LDBL_REDIR_NTH(name, proto) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) # define __LDBL_REDIR1_DECL(name, alias) \ extern __typeof (name) name __asm (__ASMNAME (#alias)); # define __LDBL_REDIR_DECL(name) \ extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name)); # define __REDIRECT_LDBL(name, proto, alias) \ __LDBL_REDIR1 (name, proto, __nldbl_##alias) # define __REDIRECT_NTH_LDBL(name, proto, alias) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) # endif #endif #if !defined __LDBL_COMPAT || !defined __REDIRECT # define __LDBL_REDIR1(name, proto, alias) name proto # define __LDBL_REDIR(name, proto) name proto # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW # define __LDBL_REDIR_NTH(name, proto) name proto __THROW # define __LDBL_REDIR_DECL(name) # ifdef __REDIRECT # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) # define __REDIRECT_NTH_LDBL(name, proto, alias) \ __REDIRECT_NTH (name, proto, alias) # endif #endif #endif /* sys/cdefs.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/file.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_FILE_H #define _SYS_FILE_H 1 #include #ifndef _FCNTL_H # include #endif __BEGIN_DECLS /* Alternate names for values for the WHENCE argument to `lseek'. These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */ #ifndef L_SET # define L_SET 0 /* Seek from beginning of file. */ # define L_INCR 1 /* Seek from current position. */ # define L_XTND 2 /* Seek from end of file. */ #endif /* Operations for the `flock' call. */ #define LOCK_SH 1 /* Shared lock. */ #define LOCK_EX 2 /* Exclusive lock. */ #define LOCK_UN 8 /* Unlock. */ /* Can be OR'd in to one of the above. */ #define LOCK_NB 4 /* Don't block when locking. */ /* Apply or remove an advisory lock, according to OPERATION, on the file FD refers to. */ extern int flock(int __fd, int __operation) __THROW; __END_DECLS #endif /* sys/file.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/ioctl.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_IOCTL_H #define _SYS_IOCTL_H 1 #include __BEGIN_DECLS /* Get the list of `ioctl' requests and related constants. */ #include /* Define some types used by `ioctl' requests. */ #include /* On a Unix system, the system probably defines some of the symbols we define in (usually with the same values). The code to generate has omitted these symbols to avoid the conflict, but a Unix program expects to define them, so we must include here. */ #include /* Perform the I/O control operation specified by REQUEST on FD. One argument may follow; its presence and type depend on REQUEST. Return value depends on REQUEST. Usually -1 indicates error. */ extern int ioctl(int __fd, unsigned long int __request, ...) __THROW; __END_DECLS #endif /* sys/ioctl.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/mman.h ================================================ /* Definitions for BSD-style memory management. Copyright (C) 1994-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_MMAN_H #define _SYS_MMAN_H 1 #include #include #define __need_size_t #include #ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined #endif #ifndef __mode_t_defined typedef __mode_t mode_t; # define __mode_t_defined #endif #include /* Return value of `mmap' in case of an error. */ #define MAP_FAILED ((void *) -1) __BEGIN_DECLS /* Map addresses starting near ADDR and extending for LEN bytes. from OFFSET into the file FD describes according to PROT and FLAGS. If ADDR is nonzero, it is the desired mapping address. If the MAP_FIXED bit is set in FLAGS, the mapping will be at ADDR exactly (which must be page-aligned); otherwise the system chooses a convenient nearby address. The return value is the actual mapping address chosen or MAP_FAILED for errors (in which case `errno' is set). A successful `mmap' call deallocates any previous mapping for the affected region. */ #ifndef __USE_FILE_OFFSET64 extern void *mmap(void *__addr, size_t __len, int __prot, int __flags, int __fd, __off_t __offset) __THROW; #else # ifdef __REDIRECT_NTH extern void *__REDIRECT_NTH(mmap, (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset), mmap64); # else # define mmap mmap64 # endif #endif #ifdef __USE_LARGEFILE64 extern void *mmap64(void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset) __THROW; #endif /* Deallocate any mapping for the region starting at ADDR and extending LEN bytes. Returns 0 if successful, -1 for errors (and sets errno). */ extern int munmap(void *__addr, size_t __len) __THROW; /* Change the memory protection of the region starting at ADDR and extending LEN bytes to PROT. Returns 0 if successful, -1 for errors (and sets errno). */ extern int mprotect(void *__addr, size_t __len, int __prot) __THROW; /* Synchronize the region starting at ADDR and extending LEN bytes with the file it maps. Filesystem operations on a file being mapped are unpredictable before this is done. Flags are from the MS_* set. This function is a cancellation point and therefore not marked with __THROW. */ extern int msync(void *__addr, size_t __len, int __flags); #ifdef __USE_MISC /* Advise the system about particular usage patterns the program follows for the region starting at ADDR and extending LEN bytes. */ extern int madvise(void *__addr, size_t __len, int __advice) __THROW; #endif #ifdef __USE_XOPEN2K /* This is the POSIX name for this function. */ extern int posix_madvise(void *__addr, size_t __len, int __advice) __THROW; #endif /* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to be memory resident. */ extern int mlock(const void *__addr, size_t __len) __THROW; /* Unlock whole pages previously mapped by the range [ADDR,ADDR+LEN). */ extern int munlock(const void *__addr, size_t __len) __THROW; /* Cause all currently mapped pages of the process to be memory resident until unlocked by a call to the `munlockall', until the process exits, or until the process calls `execve'. */ extern int mlockall(int __flags) __THROW; /* All currently mapped pages of the process' address space become unlocked. */ extern int munlockall(void) __THROW; #ifdef __USE_MISC /* mincore returns the memory residency status of the pages in the current process's address space specified by [start, start + len). The status is returned in a vector of bytes. The least significant bit of each byte is 1 if the referenced page is in memory, otherwise it is zero. */ extern int mincore(void *__start, size_t __len, unsigned char *__vec) __THROW; #endif #ifdef __USE_GNU /* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length NEW_LEN. If MREMAP_MAYMOVE is set in FLAGS the returned address may differ from ADDR. If MREMAP_FIXED is set in FLAGS the function takes another parameter which is a fixed address at which the block resides after a successful call. */ extern void *mremap(void *__addr, size_t __old_len, size_t __new_len, int __flags, ...) __THROW; /* Remap arbitrary pages of a shared backing store within an existing VMA. */ extern int remap_file_pages(void *__start, size_t __size, int __prot, size_t __pgoff, int __flags) __THROW; #endif /* Open shared memory segment. */ extern int shm_open(const char *__name, int __oflag, mode_t __mode); /* Remove shared memory segment. */ extern int shm_unlink(const char *__name); __END_DECLS #endif /* sys/mman.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/param.h ================================================ /* Compatibility header for old-style Unix parameters and limits. Copyright (C) 1995-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_PARAM_H #define _SYS_PARAM_H 1 #define __need_NULL #include #include #include #include /* Define BYTE_ORDER et al. */ #include /* Define NSIG. */ /* This file defines some things in system-specific ways. */ #include /* BSD names for some values. */ #define NBBY CHAR_BIT #if !defined NGROUPS && defined NGROUPS_MAX # define NGROUPS NGROUPS_MAX #endif #if !defined MAXSYMLINKS && defined SYMLOOP_MAX # define MAXSYMLINKS SYMLOOP_MAX #endif #if !defined CANBSIZ && defined MAX_CANON # define CANBSIZ MAX_CANON #endif #if !defined MAXPATHLEN && defined PATH_MAX # define MAXPATHLEN PATH_MAX #endif #if !defined NOFILE && defined OPEN_MAX # define NOFILE OPEN_MAX #endif #ifndef NCARGS # ifdef ARG_MAX # define NCARGS ARG_MAX # else /* ARG_MAX is unlimited, but we define NCARGS for BSD programs that want to compare against some fixed limit. */ # define NCARGS INT_MAX # endif #endif /* Magical constants. */ #ifndef NOGROUP # define NOGROUP 65535 /* Marker for empty group set member. */ #endif #ifndef NODEV # define NODEV ((dev_t) -1) /* Non-existent device. */ #endif /* Unit of `st_blocks'. */ #ifndef DEV_BSIZE # define DEV_BSIZE 512 #endif /* Bit map related macros. */ #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) #define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) #define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) #define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0) /* Macros for counting and rounding. */ #ifndef howmany # define howmany(x, y) (((x) + ((y) - 1)) / (y)) #endif #ifdef __GNUC__ # define roundup(x, y) (__builtin_constant_p (y) && powerof2 (y) \ ? (((x) + (y) - 1) & ~((y) - 1)) \ : ((((x) + ((y) - 1)) / (y)) * (y))) #else # define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) #endif #define powerof2(x) ((((x) - 1) & (x)) == 0) /* Macros for min/max. */ #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* sys/param.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/resource.h ================================================ /* Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_RESOURCE_H #define _SYS_RESOURCE_H 1 #include /* Get the system-dependent definitions of structures and bit values. */ #include #ifndef __id_t_defined typedef __id_t id_t; # define __id_t_defined #endif __BEGIN_DECLS /* The X/Open standard defines that all the functions below must use `int' as the type for the first argument. When we are compiling with GNU extensions we change this slightly to provide better error checking. */ #if defined __USE_GNU && !defined __cplusplus typedef enum __rlimit_resource __rlimit_resource_t; typedef enum __rusage_who __rusage_who_t; typedef enum __priority_which __priority_which_t; #else typedef int __rlimit_resource_t; typedef int __rusage_who_t; typedef int __priority_which_t; #endif /* Put the soft and hard limits for RESOURCE in *RLIMITS. Returns 0 if successful, -1 if not (and sets errno). */ #ifndef __USE_FILE_OFFSET64 extern int getrlimit(__rlimit_resource_t __resource, struct rlimit *__rlimits) __THROW; #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(getrlimit, (__rlimit_resource_t __resource, struct rlimit * __rlimits), getrlimit64); # else # define getrlimit getrlimit64 # endif #endif #ifdef __USE_LARGEFILE64 extern int getrlimit64(__rlimit_resource_t __resource, struct rlimit64 *__rlimits) __THROW; #endif /* Set the soft and hard limits for RESOURCE to *RLIMITS. Only the super-user can increase hard limits. Return 0 if successful, -1 if not (and sets errno). */ #ifndef __USE_FILE_OFFSET64 extern int setrlimit(__rlimit_resource_t __resource, const struct rlimit *__rlimits) __THROW; #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(setrlimit, (__rlimit_resource_t __resource, const struct rlimit * __rlimits), setrlimit64); # else # define setrlimit setrlimit64 # endif #endif #ifdef __USE_LARGEFILE64 extern int setrlimit64(__rlimit_resource_t __resource, const struct rlimit64 *__rlimits) __THROW; #endif /* Return resource usage information on process indicated by WHO and put it in *USAGE. Returns 0 for success, -1 for failure. */ extern int getrusage(__rusage_who_t __who, struct rusage *__usage) __THROW; /* Return the highest priority of any process specified by WHICH and WHO (see above); if WHO is zero, the current process, process group, or user (as specified by WHO) is used. A lower priority number means higher priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */ extern int getpriority(__priority_which_t __which, id_t __who) __THROW; /* Set the priority of all processes specified by WHICH and WHO (see above) to PRIO. Returns 0 on success, -1 on errors. */ extern int setpriority(__priority_which_t __which, id_t __who, int __prio) __THROW; __END_DECLS #endif /* sys/resource.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/select.h ================================================ /* `fd_set' type and related macros, and `select'/`pselect' declarations. Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* POSIX 1003.1g: 6.2 Select from File Descriptor Sets */ #ifndef _SYS_SELECT_H #define _SYS_SELECT_H 1 #include /* Get definition of needed basic types. */ #include /* Get __FD_* definitions. */ #include /* Get __sigset_t. */ #include #ifndef __sigset_t_defined # define __sigset_t_defined typedef __sigset_t sigset_t; #endif /* Get definition of timer specification structures. */ #define __need_time_t #define __need_timespec #include #define __need_timeval #include #ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; # define __suseconds_t_defined #endif /* The fd_set member is required to be an array of longs. */ typedef long int __fd_mask; /* Some versions of define this macros. */ #undef __NFDBITS /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ #define __NFDBITS (8 * (int) sizeof (__fd_mask)) #define __FD_ELT(d) ((d) / __NFDBITS) #define __FD_MASK(d) ((__fd_mask) (1UL << ((d) % __NFDBITS))) /* fd_set for select and pselect. */ typedef struct { /* XPG4.2 requires this member name. Otherwise avoid the name from the global namespace. */ #ifdef __USE_XOPEN __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS]; # define __FDS_BITS(set) ((set)->fds_bits) #else __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS]; # define __FDS_BITS(set) ((set)->__fds_bits) #endif } fd_set; /* Maximum number of file descriptors in `fd_set'. */ #define FD_SETSIZE __FD_SETSIZE #ifdef __USE_MISC /* Sometimes the fd_set member is assumed to have this type. */ typedef __fd_mask fd_mask; /* Number of bits per word of `fd_set' (some code assumes this is 32). */ # define NFDBITS __NFDBITS #endif /* Access macros for `fd_set'. */ #define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp) #define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp) #define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp) #define FD_ZERO(fdsetp) __FD_ZERO (fdsetp) __BEGIN_DECLS /* Check the first NFDS descriptors each in READFDS (if not NULL) for read readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out after waiting the interval specified therein. Returns the number of ready descriptors, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int select(int __nfds, fd_set * __restrict __readfds, fd_set * __restrict __writefds, fd_set * __restrict __exceptfds, struct timeval *__restrict __timeout); #ifdef __USE_XOPEN2K /* Same as above only that the TIMEOUT value is given with higher resolution and a sigmask which is been set temporarily. This version should be used. This function is a cancellation point and therefore not marked with __THROW. */ extern int pselect(int __nfds, fd_set * __restrict __readfds, fd_set * __restrict __writefds, fd_set * __restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t * __restrict __sigmask); #endif /* Define some inlines helping to catch common problems. */ #if __USE_FORTIFY_LEVEL > 0 && defined __GNUC__ # include #endif __END_DECLS #endif /* sys/select.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/socket.h ================================================ /* Declarations of socket constants, types, and functions. Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SOCKET_H #define _SYS_SOCKET_H 1 #include __BEGIN_DECLS #include #define __need_size_t #include #ifdef __USE_GNU /* Get the __sigset_t definition. */ # include #endif /* This operating system-specific header file defines the SOCK_*, PF_*, AF_*, MSG_*, SOL_*, and SO_* constants, and the `struct sockaddr', `struct msghdr', and `struct linger' types. */ #include #ifdef __USE_MISC /* This is the 4.3 BSD `struct sockaddr' format, which is used as wire format in the grotty old 4.3 `talk' protocol. */ struct osockaddr { unsigned short int sa_family; unsigned char sa_data[14]; }; #endif /* The following constants should be used for the second parameter of `shutdown'. */ enum { SHUT_RD = 0, /* No more receptions. */ #define SHUT_RD SHUT_RD SHUT_WR, /* No more transmissions. */ #define SHUT_WR SHUT_WR SHUT_RDWR /* No more receptions or transmissions. */ #define SHUT_RDWR SHUT_RDWR }; /* This is the type we use for generic socket address arguments. With GCC 2.7 and later, the funky union causes redeclarations or uses with any of the listed types to be allowed without complaint. G++ 2.7 does not support transparent unions so there we want the old-style declaration, too. */ #if defined __cplusplus || !__GNUC_PREREQ (2, 7) || !defined __USE_GNU # define __SOCKADDR_ARG struct sockaddr *__restrict # define __CONST_SOCKADDR_ARG const struct sockaddr * #else /* Add more `struct sockaddr_AF' types here as necessary. These are all the ones I found on NetBSD and Linux. */ # define __SOCKADDR_ALLTYPES \ __SOCKADDR_ONETYPE (sockaddr) \ __SOCKADDR_ONETYPE (sockaddr_at) \ __SOCKADDR_ONETYPE (sockaddr_ax25) \ __SOCKADDR_ONETYPE (sockaddr_dl) \ __SOCKADDR_ONETYPE (sockaddr_eon) \ __SOCKADDR_ONETYPE (sockaddr_in) \ __SOCKADDR_ONETYPE (sockaddr_in6) \ __SOCKADDR_ONETYPE (sockaddr_inarp) \ __SOCKADDR_ONETYPE (sockaddr_ipx) \ __SOCKADDR_ONETYPE (sockaddr_iso) \ __SOCKADDR_ONETYPE (sockaddr_ns) \ __SOCKADDR_ONETYPE (sockaddr_un) \ __SOCKADDR_ONETYPE (sockaddr_x25) # define __SOCKADDR_ONETYPE(type) struct type *__restrict __##type##__; typedef union { __SOCKADDR_ALLTYPES} __SOCKADDR_ARG __attribute__ ((__transparent_union__)); # undef __SOCKADDR_ONETYPE # define __SOCKADDR_ONETYPE(type) const struct type *__restrict __##type##__; typedef union { __SOCKADDR_ALLTYPES} __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__)); # undef __SOCKADDR_ONETYPE #endif #ifdef __USE_GNU /* For `recvmmsg' and `sendmmsg'. */ struct mmsghdr { struct msghdr msg_hdr; /* Actual message header. */ unsigned int msg_len; /* Number of received or sent bytes for the entry. */ }; #endif /* Create a new socket of type TYPE in domain DOMAIN, using protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically. Returns a file descriptor for the new socket, or -1 for errors. */ extern int socket(int __domain, int __type, int __protocol) __THROW; /* Create two new sockets, of type TYPE in domain DOMAIN and using protocol PROTOCOL, which are connected to each other, and put file descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero, one will be chosen automatically. Returns 0 on success, -1 for errors. */ extern int socketpair(int __domain, int __type, int __protocol, int __fds[2]) __THROW; /* Give the socket FD the local address ADDR (which is LEN bytes long). */ extern int bind(int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len) __THROW; /* Put the local address of FD into *ADDR and its length in *LEN. */ extern int getsockname(int __fd, __SOCKADDR_ARG __addr, socklen_t * __restrict __len) __THROW; /* Open a connection on socket FD to peer at ADDR (which LEN bytes long). For connectionless socket types, just set the default address to send to and the only address from which to accept transmissions. Return 0 on success, -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int connect(int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len); /* Put the address of the peer connected to socket FD into *ADDR (which is *LEN bytes long), and its actual length into *LEN. */ extern int getpeername(int __fd, __SOCKADDR_ARG __addr, socklen_t * __restrict __len) __THROW; /* Send N bytes of BUF to socket FD. Returns the number sent or -1. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t send(int __fd, const void *__buf, size_t __n, int __flags); /* Read N bytes into BUF from socket FD. Returns the number read or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t recv(int __fd, void *__buf, size_t __n, int __flags); /* Send N bytes of BUF on socket FD to peer at address ADDR (which is ADDR_LEN bytes long). Returns the number sent, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t sendto(int __fd, const void *__buf, size_t __n, int __flags, __CONST_SOCKADDR_ARG __addr, socklen_t __addr_len); /* Read N bytes into BUF through socket FD. If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of the sender, and store the actual size of the address in *ADDR_LEN. Returns the number of bytes read or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t recvfrom(int __fd, void *__restrict __buf, size_t __n, int __flags, __SOCKADDR_ARG __addr, socklen_t * __restrict __addr_len); /* Send a message described MESSAGE on socket FD. Returns the number of bytes sent, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t sendmsg(int __fd, const struct msghdr *__message, int __flags); #ifdef __USE_GNU /* Send a VLEN messages as described by VMESSAGES to socket FD. Returns the number of datagrams successfully written or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int sendmmsg(int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags); #endif /* Receive a message as described by MESSAGE from socket FD. Returns the number of bytes read or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t recvmsg(int __fd, struct msghdr *__message, int __flags); #ifdef __USE_GNU /* Receive up to VLEN messages as described by VMESSAGES from socket FD. Returns the number of messages received or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int recvmmsg(int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags, struct timespec *__tmo); #endif /* Put the current value for socket FD's option OPTNAME at protocol level LEVEL into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's actual length. Returns 0 on success, -1 for errors. */ extern int getsockopt(int __fd, int __level, int __optname, void *__restrict __optval, socklen_t * __restrict __optlen) __THROW; /* Set socket FD's option OPTNAME at protocol level LEVEL to *OPTVAL (which is OPTLEN bytes long). Returns 0 on success, -1 for errors. */ extern int setsockopt(int __fd, int __level, int __optname, const void *__optval, socklen_t __optlen) __THROW; /* Prepare to accept connections on socket FD. N connection requests will be queued before further requests are refused. Returns 0 on success, -1 for errors. */ extern int listen(int __fd, int __n) __THROW; /* Await a connection on socket FD. When a connection arrives, open a new socket to communicate with it, set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting peer and *ADDR_LEN to the address's actual length, and return the new socket's descriptor, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int accept(int __fd, __SOCKADDR_ARG __addr, socklen_t * __restrict __addr_len); #ifdef __USE_GNU /* Similar to 'accept' but takes an additional parameter to specify flags. This function is a cancellation point and therefore not marked with __THROW. */ extern int accept4(int __fd, __SOCKADDR_ARG __addr, socklen_t * __restrict __addr_len, int __flags); #endif /* Shut down all or part of the connection open on socket FD. HOW determines what to shut down: SHUT_RD = No more receptions; SHUT_WR = No more transmissions; SHUT_RDWR = No more receptions or transmissions. Returns 0 on success, -1 for errors. */ extern int shutdown(int __fd, int __how) __THROW; #ifdef __USE_XOPEN2K /* Determine wheter socket is at a out-of-band mark. */ extern int sockatmark(int __fd) __THROW; #endif #ifdef __USE_MISC /* FDTYPE is S_IFSOCK or another S_IF* macro defined in ; returns 1 if FD is open on an object of the indicated type, 0 if not, or -1 for errors (setting errno). */ extern int isfdtype(int __fd, int __fdtype) __THROW; #endif /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif __END_DECLS #endif /* sys/socket.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/stat.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 5.6 File Characteristics */ #ifndef _SYS_STAT_H #define _SYS_STAT_H 1 #include #include /* For __mode_t and __dev_t. */ #if defined __USE_XOPEN || defined __USE_XOPEN2K || defined __USE_ATFILE # if defined __USE_XOPEN || defined __USE_XOPEN2K # define __need_time_t # endif # ifdef __USE_ATFILE # define __need_timespec # endif # include /* For time_t resp. timespec. */ #endif #if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ # ifndef __dev_t_defined typedef __dev_t dev_t; # define __dev_t_defined # endif # ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined # endif # ifndef __ino_t_defined # ifndef __USE_FILE_OFFSET64 typedef __ino_t ino_t; # else typedef __ino64_t ino_t; # endif # define __ino_t_defined # endif # ifndef __mode_t_defined typedef __mode_t mode_t; # define __mode_t_defined # endif # ifndef __nlink_t_defined typedef __nlink_t nlink_t; # define __nlink_t_defined # endif # ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined # endif # ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined # endif #endif /* X/Open */ #ifdef __USE_UNIX98 # ifndef __blkcnt_t_defined # ifndef __USE_FILE_OFFSET64 typedef __blkcnt_t blkcnt_t; # else typedef __blkcnt64_t blkcnt_t; # endif # define __blkcnt_t_defined # endif # ifndef __blksize_t_defined typedef __blksize_t blksize_t; # define __blksize_t_defined # endif #endif /* Unix98 */ __BEGIN_DECLS #include #if defined __USE_MISC || defined __USE_XOPEN # define S_IFMT __S_IFMT # define S_IFDIR __S_IFDIR # define S_IFCHR __S_IFCHR # define S_IFBLK __S_IFBLK # define S_IFREG __S_IFREG # ifdef __S_IFIFO # define S_IFIFO __S_IFIFO # endif # ifdef __S_IFLNK # define S_IFLNK __S_IFLNK # endif # if (defined __USE_MISC || defined __USE_UNIX98) \ && defined __S_IFSOCK # define S_IFSOCK __S_IFSOCK # endif #endif /* Test macros for file types. */ #define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask)) #define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR) #define S_ISCHR(mode) __S_ISTYPE((mode), __S_IFCHR) #define S_ISBLK(mode) __S_ISTYPE((mode), __S_IFBLK) #define S_ISREG(mode) __S_ISTYPE((mode), __S_IFREG) #ifdef __S_IFIFO # define S_ISFIFO(mode) __S_ISTYPE((mode), __S_IFIFO) #endif #ifdef __S_IFLNK # define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK) #endif #if defined __USE_MISC && !defined __S_IFLNK # define S_ISLNK(mode) 0 #endif #if (defined __USE_UNIX98 || defined __USE_XOPEN2K) \ && defined __S_IFSOCK # define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK) #elif defined __USE_XOPEN2K # define S_ISSOCK(mode) 0 #endif /* These are from POSIX.1b. If the objects are not implemented using separate distinct file types, the macros always will evaluate to zero. Unlike the other S_* macros the following three take a pointer to a `struct stat' object as the argument. */ #ifdef __USE_POSIX199309 # define S_TYPEISMQ(buf) __S_TYPEISMQ(buf) # define S_TYPEISSEM(buf) __S_TYPEISSEM(buf) # define S_TYPEISSHM(buf) __S_TYPEISSHM(buf) #endif /* Protection bits. */ #define S_ISUID __S_ISUID /* Set user ID on execution. */ #define S_ISGID __S_ISGID /* Set group ID on execution. */ #if defined __USE_MISC || defined __USE_XOPEN /* Save swapped text after use (sticky bit). This is pretty well obsolete. */ # define S_ISVTX __S_ISVTX #endif #define S_IRUSR __S_IREAD /* Read by owner. */ #define S_IWUSR __S_IWRITE /* Write by owner. */ #define S_IXUSR __S_IEXEC /* Execute by owner. */ /* Read, write, and execute by owner. */ #define S_IRWXU (__S_IREAD|__S_IWRITE|__S_IEXEC) #ifdef __USE_MISC # define S_IREAD S_IRUSR # define S_IWRITE S_IWUSR # define S_IEXEC S_IXUSR #endif #define S_IRGRP (S_IRUSR >> 3) /* Read by group. */ #define S_IWGRP (S_IWUSR >> 3) /* Write by group. */ #define S_IXGRP (S_IXUSR >> 3) /* Execute by group. */ /* Read, write, and execute by group. */ #define S_IRWXG (S_IRWXU >> 3) #define S_IROTH (S_IRGRP >> 3) /* Read by others. */ #define S_IWOTH (S_IWGRP >> 3) /* Write by others. */ #define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */ /* Read, write, and execute by others. */ #define S_IRWXO (S_IRWXG >> 3) #ifdef __USE_MISC /* Macros for common mode bit masks. */ # define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */ # define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */ # define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) /* 0666 */ # define S_BLKSIZE 512 /* Block size for `st_blocks'. */ #endif #ifndef __USE_FILE_OFFSET64 /* Get file attributes for FILE and put them in BUF. */ extern int stat(const char *__restrict __file, struct stat *__restrict __buf) __THROW __nonnull((1, 2)); /* Get file attributes for the file, device, pipe, or socket that file descriptor FD is open on and put them in BUF. */ extern int fstat(int __fd, struct stat *__buf) __THROW __nonnull((2)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(stat, (const char *__restrict __file, struct stat * __restrict __buf), stat64) __nonnull((1, 2)); extern int __REDIRECT_NTH(fstat, (int __fd, struct stat * __buf), fstat64) __nonnull((2)); # else # define stat stat64 # define fstat fstat64 # endif #endif #ifdef __USE_LARGEFILE64 extern int stat64(const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull((1, 2)); extern int fstat64(int __fd, struct stat64 *__buf) __THROW __nonnull((2)); #endif #ifdef __USE_ATFILE /* Similar to stat, get the attributes for FILE and put them in BUF. Relative path names are interpreted relative to FD unless FD is AT_FDCWD. */ # ifndef __USE_FILE_OFFSET64 extern int fstatat(int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __THROW __nonnull((2, 3)); # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(fstatat, (int __fd, const char *__restrict __file, struct stat * __restrict __buf, int __flag), fstatat64) __nonnull((2, 3)); # else # define fstatat fstatat64 # endif # endif # ifdef __USE_LARGEFILE64 extern int fstatat64(int __fd, const char *__restrict __file, struct stat64 *__restrict __buf, int __flag) __THROW __nonnull((2, 3)); # endif #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K # ifndef __USE_FILE_OFFSET64 /* Get file attributes about FILE and put them in BUF. If FILE is a symbolic link, do not follow it. */ extern int lstat(const char *__restrict __file, struct stat *__restrict __buf) __THROW __nonnull((1, 2)); # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(lstat, (const char *__restrict __file, struct stat * __restrict __buf), lstat64) __nonnull((1, 2)); # else # define lstat lstat64 # endif # endif # ifdef __USE_LARGEFILE64 extern int lstat64(const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull((1, 2)); # endif #endif /* Set file access permissions for FILE to MODE. If FILE is a symbolic link, this affects its target instead. */ extern int chmod(const char *__file, __mode_t __mode) __THROW __nonnull((1)); #ifdef __USE_MISC /* Set file access permissions for FILE to MODE. If FILE is a symbolic link, this affects the link itself rather than its target. */ extern int lchmod(const char *__file, __mode_t __mode) __THROW __nonnull((1)); #endif /* Set file access permissions of the file FD is open on to MODE. */ #ifdef __USE_POSIX extern int fchmod(int __fd, __mode_t __mode) __THROW; #endif #ifdef __USE_ATFILE /* Set file access permissions of FILE relative to the directory FD is open on. */ extern int fchmodat(int __fd, const char *__file, __mode_t __mode, int __flag) __THROW __nonnull((2)) __wur; #endif /* Use ATFILE. */ /* Set the file creation mask of the current process to MASK, and return the old creation mask. */ extern __mode_t umask(__mode_t __mask) __THROW; #ifdef __USE_GNU /* Get the current `umask' value without changing it. This function is only available under the GNU Hurd. */ extern __mode_t getumask(void) __THROW; #endif /* Create a new directory named PATH, with permission bits MODE. */ extern int mkdir(const char *__path, __mode_t __mode) __THROW __nonnull((1)); #ifdef __USE_ATFILE /* Like mkdir, create a new directory with permission bits MODE. But interpret relative PATH names relative to the directory associated with FD. */ extern int mkdirat(int __fd, const char *__path, __mode_t __mode) __THROW __nonnull((2)); #endif /* Create a device file named PATH, with permission and special bits MODE and device number DEV (which can be constructed from major and minor device numbers with the `makedev' macro above). */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED extern int mknod(const char *__path, __mode_t __mode, __dev_t __dev) __THROW __nonnull((1)); # ifdef __USE_ATFILE /* Like mknod, create a new device file with permission bits MODE and device number DEV. But interpret relative PATH names relative to the directory associated with FD. */ extern int mknodat(int __fd, const char *__path, __mode_t __mode, __dev_t __dev) __THROW __nonnull((2)); # endif #endif /* Create a new FIFO named PATH, with permission bits MODE. */ extern int mkfifo(const char *__path, __mode_t __mode) __THROW __nonnull((1)); #ifdef __USE_ATFILE /* Like mkfifo, create a new FIFO with permission bits MODE. But interpret relative PATH names relative to the directory associated with FD. */ extern int mkfifoat(int __fd, const char *__path, __mode_t __mode) __THROW __nonnull((2)); #endif #ifdef __USE_ATFILE /* Set file access and modification times relative to directory file descriptor. */ extern int utimensat(int __fd, const char *__path, const struct timespec __times[2], int __flags) __THROW __nonnull((2)); #endif #ifdef __USE_XOPEN2K8 /* Set file access and modification times of the file associated with FD. */ extern int futimens(int __fd, const struct timespec __times[2]) __THROW; #endif /* To allow the `struct stat' structure and the file type `mode_t' bits to vary without changing shared library major version number, the `stat' family of functions and `mknod' are in fact inline wrappers around calls to `xstat', `fxstat', `lxstat', and `xmknod', which all take a leading version-number argument designating the data structure and bits used. defines _STAT_VER with the version number corresponding to `struct stat' as defined in that file; and _MKNOD_VER with the version number corresponding to the S_IF* macros defined therein. It is arranged that when not inlined these function are always statically linked; that way a dynamically-linked executable always encodes the version number corresponding to the data structures it uses, so the `x' functions in the shared library can adapt without needing to recompile all callers. */ #ifndef _STAT_VER # define _STAT_VER 0 #endif #ifndef _MKNOD_VER # define _MKNOD_VER 0 #endif /* Wrappers for stat and mknod system calls. */ #ifndef __USE_FILE_OFFSET64 extern int __fxstat(int __ver, int __fildes, struct stat *__stat_buf) __THROW __nonnull((3)); extern int __xstat(int __ver, const char *__filename, struct stat *__stat_buf) __THROW __nonnull((2, 3)); extern int __lxstat(int __ver, const char *__filename, struct stat *__stat_buf) __THROW __nonnull((2, 3)); extern int __fxstatat(int __ver, int __fildes, const char *__filename, struct stat *__stat_buf, int __flag) __THROW __nonnull((3, 4)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(__fxstat, (int __ver, int __fildes, struct stat * __stat_buf), __fxstat64) __nonnull((3)); extern int __REDIRECT_NTH(__xstat, (int __ver, const char *__filename, struct stat * __stat_buf), __xstat64) __nonnull((2, 3)); extern int __REDIRECT_NTH(__lxstat, (int __ver, const char *__filename, struct stat * __stat_buf), __lxstat64) __nonnull((2, 3)); extern int __REDIRECT_NTH(__fxstatat, (int __ver, int __fildes, const char *__filename, struct stat * __stat_buf, int __flag), __fxstatat64) __nonnull((3, 4)); # else # define __fxstat __fxstat64 # define __xstat __xstat64 # define __lxstat __lxstat64 # endif #endif #ifdef __USE_LARGEFILE64 extern int __fxstat64(int __ver, int __fildes, struct stat64 *__stat_buf) __THROW __nonnull((3)); extern int __xstat64(int __ver, const char *__filename, struct stat64 *__stat_buf) __THROW __nonnull((2, 3)); extern int __lxstat64(int __ver, const char *__filename, struct stat64 *__stat_buf) __THROW __nonnull((2, 3)); extern int __fxstatat64(int __ver, int __fildes, const char *__filename, struct stat64 *__stat_buf, int __flag) __THROW __nonnull((3, 4)); #endif extern int __xmknod(int __ver, const char *__path, __mode_t __mode, __dev_t * __dev) __THROW __nonnull((2, 4)); extern int __xmknodat(int __ver, int __fd, const char *__path, __mode_t __mode, __dev_t * __dev) __THROW __nonnull((3, 5)); #ifdef __USE_EXTERN_INLINES /* Inlined versions of the real stat and mknod functions. */ __extern_inline int __NTH(stat(const char *__path, struct stat *__statbuf)) { return __xstat(_STAT_VER, __path, __statbuf); } # if defined __USE_MISC || defined __USE_XOPEN_EXTENDED __extern_inline int __NTH(lstat(const char *__path, struct stat *__statbuf)) { return __lxstat(_STAT_VER, __path, __statbuf); } # endif __extern_inline int __NTH(fstat(int __fd, struct stat *__statbuf)) { return __fxstat(_STAT_VER, __fd, __statbuf); } # ifdef __USE_ATFILE __extern_inline int __NTH(fstatat(int __fd, const char *__filename, struct stat *__statbuf, int __flag)) { return __fxstatat(_STAT_VER, __fd, __filename, __statbuf, __flag); } # endif # ifdef __USE_MISC __extern_inline int __NTH(mknod(const char *__path, __mode_t __mode, __dev_t __dev)) { return __xmknod(_MKNOD_VER, __path, __mode, &__dev); } # endif # ifdef __USE_ATFILE __extern_inline int __NTH(mknodat(int __fd, const char *__path, __mode_t __mode, __dev_t __dev)) { return __xmknodat(_MKNOD_VER, __fd, __path, __mode, &__dev); } # endif # if defined __USE_LARGEFILE64 \ && (! defined __USE_FILE_OFFSET64 \ || (defined __REDIRECT_NTH && defined __OPTIMIZE__)) __extern_inline int __NTH(stat64(const char *__path, struct stat64 *__statbuf)) { return __xstat64(_STAT_VER, __path, __statbuf); } # if defined __USE_MISC || defined __USE_XOPEN_EXTENDED __extern_inline int __NTH(lstat64(const char *__path, struct stat64 *__statbuf)) { return __lxstat64(_STAT_VER, __path, __statbuf); } # endif __extern_inline int __NTH(fstat64(int __fd, struct stat64 *__statbuf)) { return __fxstat64(_STAT_VER, __fd, __statbuf); } # ifdef __USE_ATFILE __extern_inline int __NTH(fstatat64(int __fd, const char *__filename, struct stat64 *__statbuf, int __flag)) { return __fxstatat64(_STAT_VER, __fd, __filename, __statbuf, __flag); } # endif # endif #endif __END_DECLS #endif /* sys/stat.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/statfs.h ================================================ /* Definitions for getting information about a filesystem. Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_STATFS_H #define _SYS_STATFS_H 1 #include /* Get the system-specific definition of `struct statfs'. */ #include __BEGIN_DECLS /* Return information about the filesystem on which FILE resides. */ #ifndef __USE_FILE_OFFSET64 extern int statfs(const char *__file, struct statfs *__buf) __THROW __nonnull((1, 2)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(statfs, (const char *__file, struct statfs * __buf), statfs64) __nonnull((1, 2)); # else # define statfs statfs64 # endif #endif #ifdef __USE_LARGEFILE64 extern int statfs64(const char *__file, struct statfs64 *__buf) __THROW __nonnull((1, 2)); #endif /* Return information about the filesystem containing the file FILDES refers to. */ #ifndef __USE_FILE_OFFSET64 extern int fstatfs(int __fildes, struct statfs *__buf) __THROW __nonnull((2)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(fstatfs, (int __fildes, struct statfs * __buf), fstatfs64) __nonnull((2)); # else # define fstatfs fstatfs64 # endif #endif #ifdef __USE_LARGEFILE64 extern int fstatfs64(int __fildes, struct statfs64 *__buf) __THROW __nonnull((2)); #endif __END_DECLS #endif /* sys/statfs.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/sysmacros.h ================================================ /* Definitions of macros to access `dev_t' values. Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SYSMACROS_H #define _SYS_SYSMACROS_H 1 #include __BEGIN_DECLS __extension__ extern unsigned int gnu_dev_major(unsigned long long int __dev) __THROW __attribute_const__; __extension__ extern unsigned int gnu_dev_minor(unsigned long long int __dev) __THROW __attribute_const__; __extension__ extern unsigned long long int gnu_dev_makedev(unsigned int __major, unsigned int __minor) __THROW __attribute_const__; #ifdef __USE_EXTERN_INLINES __extension__ __extern_inline __attribute_const__ unsigned int __NTH(gnu_dev_major(unsigned long long int __dev)) { return ((__dev >> 8) & 0xfff) | ((unsigned int)(__dev >> 32) & ~0xfff); } __extension__ __extern_inline __attribute_const__ unsigned int __NTH(gnu_dev_minor(unsigned long long int __dev)) { return (__dev & 0xff) | ((unsigned int)(__dev >> 12) & ~0xff); } __extension__ __extern_inline __attribute_const__ unsigned long long int __NTH(gnu_dev_makedev(unsigned int __major, unsigned int __minor)) { return ((__minor & 0xff) | ((__major & 0xfff) << 8) | (((unsigned long long int)(__minor & ~0xff)) << 12) | (((unsigned long long int)(__major & ~0xfff)) << 32)); } #endif __END_DECLS /* Access the functions with their traditional names. */ #define major(dev) gnu_dev_major (dev) #define minor(dev) gnu_dev_minor (dev) #define makedev(maj, min) gnu_dev_makedev (maj, min) #endif /* sys/sysmacros.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/time.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_TIME_H #define _SYS_TIME_H 1 #include #include #define __need_time_t #include #define __need_timeval #include #include #ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; # define __suseconds_t_defined #endif __BEGIN_DECLS #ifdef __USE_GNU /* Macros for converting between `struct timeval' and `struct timespec'. */ # define TIMEVAL_TO_TIMESPEC(tv, ts) { \ (ts)->tv_sec = (tv)->tv_sec; \ (ts)->tv_nsec = (tv)->tv_usec * 1000; \ } # define TIMESPEC_TO_TIMEVAL(tv, ts) { \ (tv)->tv_sec = (ts)->tv_sec; \ (tv)->tv_usec = (ts)->tv_nsec / 1000; \ } #endif #ifdef __USE_MISC /* Structure crudely representing a timezone. This is obsolete and should never be used. */ struct timezone { int tz_minuteswest; /* Minutes west of GMT. */ int tz_dsttime; /* Nonzero if DST is ever in effect. */ }; typedef struct timezone *__restrict __timezone_ptr_t; #else typedef void *__restrict __timezone_ptr_t; #endif /* Get the current time of day and timezone information, putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled. Returns 0 on success, -1 on errors. NOTE: This form of timezone information is obsolete. Use the functions and variables declared in instead. */ extern int gettimeofday(struct timeval *__restrict __tv, __timezone_ptr_t __tz) __THROW __nonnull((1)); #ifdef __USE_MISC /* Set the current time of day and timezone information. This call is restricted to the super-user. */ extern int settimeofday(const struct timeval *__tv, const struct timezone *__tz) __THROW; /* Adjust the current time of day by the amount in DELTA. If OLDDELTA is not NULL, it is filled in with the amount of time adjustment remaining to be done from the last `adjtime' call. This call is restricted to the super-user. */ extern int adjtime(const struct timeval *__delta, struct timeval *__olddelta) __THROW; #endif /* Values for the first argument to `getitimer' and `setitimer'. */ enum __itimer_which { /* Timers run in real time. */ ITIMER_REAL = 0, #define ITIMER_REAL ITIMER_REAL /* Timers run only when the process is executing. */ ITIMER_VIRTUAL = 1, #define ITIMER_VIRTUAL ITIMER_VIRTUAL /* Timers run when the process is executing and when the system is executing on behalf of the process. */ ITIMER_PROF = 2 #define ITIMER_PROF ITIMER_PROF }; /* Type of the second argument to `getitimer' and the second and third arguments `setitimer'. */ struct itimerval { /* Value to put into `it_value' when the timer expires. */ struct timeval it_interval; /* Time to the next timer expiration. */ struct timeval it_value; }; #if defined __USE_GNU && !defined __cplusplus /* Use the nicer parameter type only in GNU mode and not for C++ since the strict C++ rules prevent the automatic promotion. */ typedef enum __itimer_which __itimer_which_t; #else typedef int __itimer_which_t; #endif /* Set *VALUE to the current setting of timer WHICH. Return 0 on success, -1 on errors. */ extern int getitimer(__itimer_which_t __which, struct itimerval *__value) __THROW; /* Set the timer WHICH to *NEW. If OLD is not NULL, set *OLD to the old value of timer WHICH. Returns 0 on success, -1 on errors. */ extern int setitimer(__itimer_which_t __which, const struct itimerval *__restrict __new, struct itimerval *__restrict __old) __THROW; /* Change the access time of FILE to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ extern int utimes(const char *__file, const struct timeval __tvp[2]) __THROW __nonnull((1)); #ifdef __USE_MISC /* Same as `utimes', but does not follow symbolic links. */ extern int lutimes(const char *__file, const struct timeval __tvp[2]) __THROW __nonnull((1)); /* Same as `utimes', but takes an open file descriptor instead of a name. */ extern int futimes(int __fd, const struct timeval __tvp[2]) __THROW; #endif #ifdef __USE_GNU /* Change the access time of FILE relative to FD to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ extern int futimesat(int __fd, const char *__file, const struct timeval __tvp[2]) __THROW; #endif #ifdef __USE_MISC /* Convenience macros for operations on timevals. NOTE: `timercmp' does not work for >= or <=. */ # define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) # define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) # define timercmp(a, b, CMP) \ (((a)->tv_sec == (b)->tv_sec) ? \ ((a)->tv_usec CMP (b)->tv_usec) : \ ((a)->tv_sec CMP (b)->tv_sec)) # define timeradd(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ if ((result)->tv_usec >= 1000000) \ { \ ++(result)->tv_sec; \ (result)->tv_usec -= 1000000; \ } \ } while (0) # define timersub(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ if ((result)->tv_usec < 0) { \ --(result)->tv_sec; \ (result)->tv_usec += 1000000; \ } \ } while (0) #endif /* Misc. */ __END_DECLS #endif /* sys/time.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/times.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 4.5.2 Process Times */ #ifndef _SYS_TIMES_H #define _SYS_TIMES_H 1 #include #define __need_clock_t #include __BEGIN_DECLS /* Structure describing CPU time used by a process and its children. */ struct tms { clock_t tms_utime; /* User CPU time. */ clock_t tms_stime; /* System CPU time. */ clock_t tms_cutime; /* User CPU time of dead children. */ clock_t tms_cstime; /* System CPU time of dead children. */ }; /* Store the CPU time used by this process and all its dead children (and their dead children) in BUFFER. Return the elapsed real time, or (clock_t) -1 for errors. All times are in CLK_TCKths of a second. */ extern clock_t times(struct tms *__buffer) __THROW; __END_DECLS #endif /* sys/times.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/ttydefaults.h ================================================ /*- * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94 */ /* * System wide defaults for terminal state. Linux version. */ #ifndef _SYS_TTYDEFAULTS_H_ #define _SYS_TTYDEFAULTS_H_ /* * Defaults on "first" open. */ #define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY) #define TTYDEF_OFLAG (OPOST | ONLCR | XTABS) #define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) #define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL) #define TTYDEF_SPEED (B9600) /* * Control Character Defaults */ #define CTRL(x) (x&037) #define CEOF CTRL('d') #ifdef _POSIX_VDISABLE # define CEOL _POSIX_VDISABLE #else # define CEOL '\0' /* XXX avoid _POSIX_VDISABLE */ #endif #define CERASE 0177 #define CINTR CTRL('c') #ifdef _POSIX_VDISABLE # define CSTATUS _POSIX_VDISABLE #else # define CSTATUS '\0' /* XXX avoid _POSIX_VDISABLE */ #endif #define CKILL CTRL('u') #define CMIN 1 #define CQUIT 034 /* FS, ^\ */ #define CSUSP CTRL('z') #define CTIME 0 #define CDSUSP CTRL('y') #define CSTART CTRL('q') #define CSTOP CTRL('s') #define CLNEXT CTRL('v') #define CDISCARD CTRL('o') #define CWERASE CTRL('w') #define CREPRINT CTRL('r') #define CEOT CEOF /* compat */ #define CBRK CEOL #define CRPRNT CREPRINT #define CFLUSH CDISCARD /* PROTECTED INCLUSION ENDS HERE */ #endif /* !_SYS_TTYDEFAULTS_H_ */ /* * #define TTYDEFCHARS to include an array of default control characters. */ #ifdef TTYDEFCHARS cc_t ttydefchars[NCCS] = { CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT, _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT, CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE }; #undef TTYDEFCHARS #endif ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/types.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 2.6 Primitive System Data Types */ #ifndef _SYS_TYPES_H #define _SYS_TYPES_H 1 #include __BEGIN_DECLS #include #ifdef __USE_MISC # ifndef __u_char_defined typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; # define __u_char_defined # endif #endif typedef __loff_t loff_t; #ifndef __ino_t_defined # ifndef __USE_FILE_OFFSET64 typedef __ino_t ino_t; # else typedef __ino64_t ino_t; # endif # define __ino_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __ino64_t_defined typedef __ino64_t ino64_t; # define __ino64_t_defined #endif #ifndef __dev_t_defined typedef __dev_t dev_t; # define __dev_t_defined #endif #ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined #endif #ifndef __mode_t_defined typedef __mode_t mode_t; # define __mode_t_defined #endif #ifndef __nlink_t_defined typedef __nlink_t nlink_t; # define __nlink_t_defined #endif #ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined #endif #ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; # define __off64_t_defined #endif #ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif #if (defined __USE_XOPEN || defined __USE_XOPEN2K8) \ && !defined __id_t_defined typedef __id_t id_t; # define __id_t_defined #endif #ifndef __ssize_t_defined typedef __ssize_t ssize_t; # define __ssize_t_defined #endif #ifdef __USE_MISC # ifndef __daddr_t_defined typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; # define __daddr_t_defined # endif #endif #if (defined __USE_MISC || defined __USE_XOPEN) && !defined __key_t_defined typedef __key_t key_t; # define __key_t_defined #endif #if defined __USE_XOPEN || defined __USE_XOPEN2K8 # define __need_clock_t #endif #define __need_time_t #define __need_timer_t #define __need_clockid_t #include #ifdef __USE_XOPEN # ifndef __useconds_t_defined typedef __useconds_t useconds_t; # define __useconds_t_defined # endif # ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; # define __suseconds_t_defined # endif #endif #define __need_size_t #include #ifdef __USE_MISC /* Old compatibility names for C types. */ typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; #endif /* These size-specific names are used by some of the inet code. */ #if !__GNUC_PREREQ (2, 7) /* These types are defined by the ISO C99 header . */ # ifndef __int8_t_defined # define __int8_t_defined typedef char int8_t; typedef short int int16_t; typedef int int32_t; # if __WORDSIZE == 64 typedef long int int64_t; # else __extension__ typedef long long int int64_t; # endif # endif /* But these were defined by ISO C without the first `_'. */ typedef unsigned char u_int8_t; typedef unsigned short int u_int16_t; typedef unsigned int u_int32_t; # if __WORDSIZE == 64 typedef unsigned long int u_int64_t; # else __extension__ typedef unsigned long long int u_int64_t; # endif typedef int register_t; #else /* For GCC 2.7 and later, we can use specific type-size attributes. */ # define __intN_t(N, MODE) \ typedef int int##N##_t __attribute__ ((__mode__ (MODE))) # define __u_intN_t(N, MODE) \ typedef unsigned int u_int##N##_t __attribute__ ((__mode__ (MODE))) # ifndef __int8_t_defined # define __int8_t_defined __intN_t(8, __QI__); __intN_t(16, __HI__); __intN_t(32, __SI__); __intN_t(64, __DI__); # endif __u_intN_t(8, __QI__); __u_intN_t(16, __HI__); __u_intN_t(32, __SI__); __u_intN_t(64, __DI__); typedef int register_t __attribute__ ((__mode__(__word__))); /* Some code from BIND tests this macro to see if the types above are defined. */ #endif #define __BIT_TYPES_DEFINED__ 1 #ifdef __USE_MISC /* In BSD is expected to define BYTE_ORDER. */ # include /* It also defines `fd_set' and the FD_* macros for `select'. */ # include /* BSD defines these symbols, so we follow. */ # include #endif /* Use misc. */ #if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) \ && !defined __blksize_t_defined typedef __blksize_t blksize_t; # define __blksize_t_defined #endif /* Types from the Large File Support interface. */ #ifndef __USE_FILE_OFFSET64 # ifndef __blkcnt_t_defined typedef __blkcnt_t blkcnt_t; /* Type to count number of disk blocks. */ # define __blkcnt_t_defined # endif # ifndef __fsblkcnt_t_defined typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */ # define __fsblkcnt_t_defined # endif # ifndef __fsfilcnt_t_defined typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */ # define __fsfilcnt_t_defined # endif #else # ifndef __blkcnt_t_defined typedef __blkcnt64_t blkcnt_t; /* Type to count number of disk blocks. */ # define __blkcnt_t_defined # endif # ifndef __fsblkcnt_t_defined typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */ # define __fsblkcnt_t_defined # endif # ifndef __fsfilcnt_t_defined typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */ # define __fsfilcnt_t_defined # endif #endif #ifdef __USE_LARGEFILE64 typedef __blkcnt64_t blkcnt64_t; /* Type to count number of disk blocks. */ typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks. */ typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes. */ #endif /* Now add the thread types. */ #if defined __USE_POSIX199506 || defined __USE_UNIX98 # include #endif __END_DECLS #endif /* sys/types.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/ucontext.h ================================================ /* Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_UCONTEXT_H #define _SYS_UCONTEXT_H 1 #include #include /* We need the signal context definitions even if they are not used included in . */ #include #ifdef __x86_64__ /* Type for general register. */ __extension__ typedef long long int greg_t; /* Number of general registers. */ #define NGREG 23 /* Container for all general registers. */ typedef greg_t gregset_t[NGREG]; #ifdef __USE_GNU /* Number of each register in the `gregset_t' array. */ enum { REG_R8 = 0, # define REG_R8 REG_R8 REG_R9, # define REG_R9 REG_R9 REG_R10, # define REG_R10 REG_R10 REG_R11, # define REG_R11 REG_R11 REG_R12, # define REG_R12 REG_R12 REG_R13, # define REG_R13 REG_R13 REG_R14, # define REG_R14 REG_R14 REG_R15, # define REG_R15 REG_R15 REG_RDI, # define REG_RDI REG_RDI REG_RSI, # define REG_RSI REG_RSI REG_RBP, # define REG_RBP REG_RBP REG_RBX, # define REG_RBX REG_RBX REG_RDX, # define REG_RDX REG_RDX REG_RAX, # define REG_RAX REG_RAX REG_RCX, # define REG_RCX REG_RCX REG_RSP, # define REG_RSP REG_RSP REG_RIP, # define REG_RIP REG_RIP REG_EFL, # define REG_EFL REG_EFL REG_CSGSFS, /* Actually short cs, gs, fs, __pad0. */ # define REG_CSGSFS REG_CSGSFS REG_ERR, # define REG_ERR REG_ERR REG_TRAPNO, # define REG_TRAPNO REG_TRAPNO REG_OLDMASK, # define REG_OLDMASK REG_OLDMASK REG_CR2 # define REG_CR2 REG_CR2 }; #endif struct _libc_fpxreg { unsigned short int significand[4]; unsigned short int exponent; unsigned short int padding[3]; }; struct _libc_xmmreg { __uint32_t element[4]; }; struct _libc_fpstate { /* 64-bit FXSAVE format. */ __uint16_t cwd; __uint16_t swd; __uint16_t ftw; __uint16_t fop; __uint64_t rip; __uint64_t rdp; __uint32_t mxcsr; __uint32_t mxcr_mask; struct _libc_fpxreg _st[8]; struct _libc_xmmreg _xmm[16]; __uint32_t padding[24]; }; /* Structure to describe FPU registers. */ typedef struct _libc_fpstate *fpregset_t; /* Context to describe whole processor state. */ typedef struct { gregset_t gregs; /* Note that fpregs is a pointer. */ fpregset_t fpregs; __extension__ unsigned long long __reserved1[8]; } mcontext_t; /* Userlevel context. */ typedef struct ucontext { unsigned long int uc_flags; struct ucontext *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; __sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; } ucontext_t; #else /* !__x86_64__ */ /* Type for general register. */ typedef int greg_t; /* Number of general registers. */ #define NGREG 19 /* Container for all general registers. */ typedef greg_t gregset_t[NGREG]; #ifdef __USE_GNU /* Number of each register is the `gregset_t' array. */ enum { REG_GS = 0, # define REG_GS REG_GS REG_FS, # define REG_FS REG_FS REG_ES, # define REG_ES REG_ES REG_DS, # define REG_DS REG_DS REG_EDI, # define REG_EDI REG_EDI REG_ESI, # define REG_ESI REG_ESI REG_EBP, # define REG_EBP REG_EBP REG_ESP, # define REG_ESP REG_ESP REG_EBX, # define REG_EBX REG_EBX REG_EDX, # define REG_EDX REG_EDX REG_ECX, # define REG_ECX REG_ECX REG_EAX, # define REG_EAX REG_EAX REG_TRAPNO, # define REG_TRAPNO REG_TRAPNO REG_ERR, # define REG_ERR REG_ERR REG_EIP, # define REG_EIP REG_EIP REG_CS, # define REG_CS REG_CS REG_EFL, # define REG_EFL REG_EFL REG_UESP, # define REG_UESP REG_UESP REG_SS # define REG_SS REG_SS }; #endif /* Definitions taken from the kernel headers. */ struct _libc_fpreg { unsigned short int significand[4]; unsigned short int exponent; }; struct _libc_fpstate { unsigned long int cw; unsigned long int sw; unsigned long int tag; unsigned long int ipoff; unsigned long int cssel; unsigned long int dataoff; unsigned long int datasel; struct _libc_fpreg _st[8]; unsigned long int status; }; /* Structure to describe FPU registers. */ typedef struct _libc_fpstate *fpregset_t; /* Context to describe whole processor state. */ typedef struct { gregset_t gregs; /* Due to Linux's history we have to use a pointer here. The SysV/i386 ABI requires a struct with the values. */ fpregset_t fpregs; unsigned long int oldmask; unsigned long int cr2; } mcontext_t; /* Userlevel context. */ typedef struct ucontext { unsigned long int uc_flags; struct ucontext *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; __sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; } ucontext_t; #endif /* !__x86_64__ */ #endif /* sys/ucontext.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/uio.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_UIO_H #define _SYS_UIO_H 1 #include #include __BEGIN_DECLS /* This file defines `struct iovec'. */ #include /* Read data from file descriptor FD, and put the result in the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's. The buffers are filled in the order specified. Operates just like 'read' (see ) except that data are put in IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t readv(int __fd, const struct iovec *__iovec, int __count) __wur; /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's, to file descriptor FD. The data is written in the order specified. Operates just like 'write' (see ) except that the data are taken from IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t writev(int __fd, const struct iovec *__iovec, int __count) __wur; #ifdef __USE_MISC # ifndef __USE_FILE_OFFSET64 /* Read data from file descriptor FD at the given position OFFSET without change the file pointer, and put the result in the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's. The buffers are filled in the order specified. Operates just like 'pread' (see ) except that data are put in IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t preadv(int __fd, const struct iovec *__iovec, int __count, __off_t __offset) __wur; /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's, to file descriptor FD at the given position OFFSET without change the file pointer. The data is written in the order specified. Operates just like 'pwrite' (see ) except that the data are taken from IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwritev(int __fd, const struct iovec *__iovec, int __count, __off_t __offset) __wur; # else # ifdef __REDIRECT extern ssize_t __REDIRECT(preadv, (int __fd, const struct iovec * __iovec, int __count, __off64_t __offset), preadv64) __wur; extern ssize_t __REDIRECT(pwritev, (int __fd, const struct iovec * __iovec, int __count, __off64_t __offset), pwritev64) __wur; # else # define preadv preadv64 # define pwritev pwritev64 # endif # endif # ifdef __USE_LARGEFILE64 /* Read data from file descriptor FD at the given position OFFSET without change the file pointer, and put the result in the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's. The buffers are filled in the order specified. Operates just like 'pread' (see ) except that data are put in IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t preadv64(int __fd, const struct iovec *__iovec, int __count, __off64_t __offset) __wur; /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's, to file descriptor FD at the given position OFFSET without change the file pointer. The data is written in the order specified. Operates just like 'pwrite' (see ) except that the data are taken from IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwritev64(int __fd, const struct iovec *__iovec, int __count, __off64_t __offset) __wur; # endif #endif /* Use misc. */ __END_DECLS #endif /* sys/uio.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/un.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_UN_H #define _SYS_UN_H 1 #include /* Get the definition of the macro to define the common sockaddr members. */ #include __BEGIN_DECLS /* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */ struct sockaddr_un { __SOCKADDR_COMMON(sun_); char sun_path[108]; /* Path name. */ }; #ifdef __USE_MISC # include /* For prototype of `strlen'. */ /* Evaluate to actual length of the `sockaddr_un' structure. */ # define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ + strlen ((ptr)->sun_path)) #endif __END_DECLS #endif /* sys/un.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/utsname.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 4.4 System Identification */ #ifndef _SYS_UTSNAME_H #define _SYS_UTSNAME_H 1 #include __BEGIN_DECLS #include #ifndef _UTSNAME_SYSNAME_LENGTH # define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_NODENAME_LENGTH # define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_RELEASE_LENGTH # define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_VERSION_LENGTH # define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_MACHINE_LENGTH # define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH #endif /* Structure describing the system and machine. */ struct utsname { /* Name of the implementation of the operating system. */ char sysname[_UTSNAME_SYSNAME_LENGTH]; /* Name of this node on the network. */ char nodename[_UTSNAME_NODENAME_LENGTH]; /* Current release level of this implementation. */ char release[_UTSNAME_RELEASE_LENGTH]; /* Current version level of this release. */ char version[_UTSNAME_VERSION_LENGTH]; /* Name of the hardware type the system is running on. */ char machine[_UTSNAME_MACHINE_LENGTH]; #if _UTSNAME_DOMAIN_LENGTH - 0 /* Name of the domain of this node on the network. */ # ifdef __USE_GNU char domainname[_UTSNAME_DOMAIN_LENGTH]; # else char __domainname[_UTSNAME_DOMAIN_LENGTH]; # endif #endif }; #ifdef __USE_MISC /* Note that SVID assumes all members have the same size. */ # define SYS_NMLN _UTSNAME_LENGTH #endif /* Put information about the system in NAME. */ extern int uname(struct utsname *__name) __THROW; __END_DECLS #endif /* sys/utsname.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/sys/wait.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 3.2.1 Wait for Process Termination */ #ifndef _SYS_WAIT_H #define _SYS_WAIT_H 1 #include __BEGIN_DECLS #include /* These macros could also be defined in . */ #if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8) /* This will define the `W*' macros for the flag bits to `waitpid', `wait3', and `wait4'. */ # include # ifdef __USE_MISC /* Lots of hair to allow traditional BSD use of `union wait' as well as POSIX.1 use of `int' for the status word. */ # if defined __GNUC__ && !defined __cplusplus # define __WAIT_INT(status) \ (__extension__ (((union { __typeof(status) __in; int __i; }) \ { .__in = (status) }).__i)) # else # define __WAIT_INT(status) (*(const int *) &(status)) # endif /* This is the type of the argument to `wait'. The funky union causes redeclarations with either `int *' or `union wait *' to be allowed without complaint. __WAIT_STATUS_DEFN is the type used in the actual function definitions. */ # if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus # define __WAIT_STATUS void * # define __WAIT_STATUS_DEFN void * # else /* This works in GCC 2.6.1 and later. */ typedef union { union wait *__uptr; int *__iptr; } __WAIT_STATUS __attribute__ ((__transparent_union__)); # define __WAIT_STATUS_DEFN int * # endif # else /* Don't use misc. */ # define __WAIT_INT(status) (status) # define __WAIT_STATUS int * # define __WAIT_STATUS_DEFN int * # endif /* Use misc. */ /* This will define all the `__W*' macros. */ # include # define WEXITSTATUS(status) __WEXITSTATUS (__WAIT_INT (status)) # define WTERMSIG(status) __WTERMSIG (__WAIT_INT (status)) # define WSTOPSIG(status) __WSTOPSIG (__WAIT_INT (status)) # define WIFEXITED(status) __WIFEXITED (__WAIT_INT (status)) # define WIFSIGNALED(status) __WIFSIGNALED (__WAIT_INT (status)) # define WIFSTOPPED(status) __WIFSTOPPED (__WAIT_INT (status)) # ifdef __WIFCONTINUED # define WIFCONTINUED(status) __WIFCONTINUED (__WAIT_INT (status)) # endif #endif /* not included. */ #ifdef __USE_MISC # define WCOREFLAG __WCOREFLAG # define WCOREDUMP(status) __WCOREDUMP (__WAIT_INT (status)) # define W_EXITCODE(ret, sig) __W_EXITCODE (ret, sig) # define W_STOPCODE(sig) __W_STOPCODE (sig) #endif /* The following values are used by the `waitid' function. */ #if defined __USE_XOPEN || defined __USE_XOPEN2K8 typedef enum { P_ALL, /* Wait for any child. */ P_PID, /* Wait for specified process. */ P_PGID /* Wait for members of process group. */ } idtype_t; #endif /* Wait for a child to die. When one does, put its status in *STAT_LOC and return its process ID. For errors, return (pid_t) -1. This function is a cancellation point and therefore not marked with __THROW. */ extern __pid_t wait(__WAIT_STATUS __stat_loc); #ifdef __USE_MISC /* Special values for the PID argument to `waitpid' and `wait4'. */ # define WAIT_ANY (-1) /* Any process. */ # define WAIT_MYPGRP 0 /* Any process in my process group. */ #endif /* Wait for a child matching PID to die. If PID is greater than 0, match any process whose process ID is PID. If PID is (pid_t) -1, match any process. If PID is (pid_t) 0, match any process with the same process group as the current process. If PID is less than -1, match any process whose process group is the absolute value of PID. If the WNOHANG bit is set in OPTIONS, and that child is not already dead, return (pid_t) 0. If successful, return PID and store the dead child's status in STAT_LOC. Return (pid_t) -1 for errors. If the WUNTRACED bit is set in OPTIONS, return status for stopped children; otherwise don't. This function is a cancellation point and therefore not marked with __THROW. */ extern __pid_t waitpid(__pid_t __pid, int *__stat_loc, int __options); #if defined __USE_XOPEN || defined __USE_XOPEN2K8 # ifndef __id_t_defined # include typedef __id_t id_t; # define __id_t_defined # endif # define __need_siginfo_t # include /* Wait for a childing matching IDTYPE and ID to change the status and place appropriate information in *INFOP. If IDTYPE is P_PID, match any process whose process ID is ID. If IDTYPE is P_PGID, match any process whose process group is ID. If IDTYPE is P_ALL, match any process. If the WNOHANG bit is set in OPTIONS, and that child is not already dead, clear *INFOP and return 0. If successful, store exit code and status in *INFOP. This function is a cancellation point and therefore not marked with __THROW. */ extern int waitid(idtype_t __idtype, __id_t __id, siginfo_t * __infop, int __options); #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* This being here makes the prototypes valid whether or not we have already included to define `struct rusage'. */ struct rusage; /* Wait for a child to exit. When one does, put its status in *STAT_LOC and return its process ID. For errors return (pid_t) -1. If USAGE is not nil, store information about the child's resource usage there. If the WUNTRACED bit is set in OPTIONS, return status for stopped children; otherwise don't. */ extern __pid_t wait3(__WAIT_STATUS __stat_loc, int __options, struct rusage *__usage) __THROWNL; #endif #ifdef __USE_MISC /* PID is like waitpid. Other args are like wait3. */ extern __pid_t wait4(__pid_t __pid, __WAIT_STATUS __stat_loc, int __options, struct rusage *__usage) __THROWNL; #endif /* Use misc. */ __END_DECLS #endif /* sys/wait.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/termios.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 7.1-2 General Terminal Interface */ #ifndef _TERMIOS_H #define _TERMIOS_H 1 #include #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 /* We need `pid_t'. */ # include # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined # endif #endif __BEGIN_DECLS /* Get the system-dependent definitions of `struct termios', `tcflag_t', `cc_t', `speed_t', and all the macros specifying the flag bits. */ #include #ifdef __USE_MISC /* Compare a character C to a value VAL from the `c_cc' array in a `struct termios'. If VAL is _POSIX_VDISABLE, no character can match it. */ # define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE) #endif /* Return the output baud rate stored in *TERMIOS_P. */ extern speed_t cfgetospeed(const struct termios *__termios_p) __THROW; /* Return the input baud rate stored in *TERMIOS_P. */ extern speed_t cfgetispeed(const struct termios *__termios_p) __THROW; /* Set the output baud rate stored in *TERMIOS_P to SPEED. */ extern int cfsetospeed(struct termios *__termios_p, speed_t __speed) __THROW; /* Set the input baud rate stored in *TERMIOS_P to SPEED. */ extern int cfsetispeed(struct termios *__termios_p, speed_t __speed) __THROW; #ifdef __USE_MISC /* Set both the input and output baud rates in *TERMIOS_OP to SPEED. */ extern int cfsetspeed(struct termios *__termios_p, speed_t __speed) __THROW; #endif /* Put the state of FD into *TERMIOS_P. */ extern int tcgetattr(int __fd, struct termios *__termios_p) __THROW; /* Set the state of FD to *TERMIOS_P. Values for OPTIONAL_ACTIONS (TCSA*) are in . */ extern int tcsetattr(int __fd, int __optional_actions, const struct termios *__termios_p) __THROW; #ifdef __USE_MISC /* Set *TERMIOS_P to indicate raw mode. */ extern void cfmakeraw(struct termios *__termios_p) __THROW; #endif /* Send zero bits on FD. */ extern int tcsendbreak(int __fd, int __duration) __THROW; /* Wait for pending output to be written on FD. This function is a cancellation point and therefore not marked with __THROW. */ extern int tcdrain(int __fd); /* Flush pending data on FD. Values for QUEUE_SELECTOR (TC{I,O,IO}FLUSH) are in . */ extern int tcflush(int __fd, int __queue_selector) __THROW; /* Suspend or restart transmission on FD. Values for ACTION (TC[IO]{OFF,ON}) are in . */ extern int tcflow(int __fd, int __action) __THROW; #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 /* Get process group ID for session leader for controlling terminal FD. */ extern __pid_t tcgetsid(int __fd) __THROW; #endif #ifdef __USE_MISC # include #endif __END_DECLS #endif /* termios.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/time.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.23 Date and time */ #ifndef _TIME_H #if (! defined __need_time_t && !defined __need_clock_t && \ ! defined __need_timespec) # define _TIME_H 1 # include __BEGIN_DECLS #endif #ifdef _TIME_H /* Get size_t and NULL from . */ # define __need_size_t # define __need_NULL # include /* This defines CLOCKS_PER_SEC, which is the number of processor clock ticks per second. */ # include /* This is the obsolete POSIX.1-1988 name for the same constant. */ # if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K # ifndef CLK_TCK # define CLK_TCK CLOCKS_PER_SEC # endif # endif #endif /* included. */ #if !defined __clock_t_defined && (defined _TIME_H || defined __need_clock_t) # define __clock_t_defined 1 # include __BEGIN_NAMESPACE_STD /* Returned by `clock'. */ typedef __clock_t clock_t; __END_NAMESPACE_STD #if defined __USE_XOPEN || defined __USE_POSIX __USING_NAMESPACE_STD(clock_t) #endif #endif /* clock_t not defined and or need clock_t. */ #undef __need_clock_t #if !defined __time_t_defined && (defined _TIME_H || defined __need_time_t) # define __time_t_defined 1 # include __BEGIN_NAMESPACE_STD /* Returned by `time'. */ typedef __time_t time_t; __END_NAMESPACE_STD #ifdef __USE_POSIX __USING_NAMESPACE_STD(time_t) #endif #endif /* time_t not defined and or need time_t. */ #undef __need_time_t #if !defined __clockid_t_defined && \ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_clockid_t) # define __clockid_t_defined 1 # include /* Clock ID used in clock and timer functions. */ typedef __clockid_t clockid_t; #endif /* clockid_t not defined and or need clockid_t. */ #undef __clockid_time_t #if !defined __timer_t_defined && \ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timer_t) # define __timer_t_defined 1 # include /* Timer ID returned by `timer_create'. */ typedef __timer_t timer_t; #endif /* timer_t not defined and or need timer_t. */ #undef __need_timer_t #if (!defined __timespec_defined \ && ((defined _TIME_H \ && (defined __USE_POSIX199309 \ || defined __USE_ISOC11)) \ || defined __need_timespec)) # define __timespec_defined 1 # include /* This defines __time_t for us. */ /* POSIX.1b structure for a time value. This is like a `struct timeval' but has nanoseconds instead of microseconds. */ struct timespec { __time_t tv_sec; /* Seconds. */ __syscall_slong_t tv_nsec; /* Nanoseconds. */ }; #endif /* timespec not defined and or need timespec. */ #undef __need_timespec #ifdef _TIME_H __BEGIN_NAMESPACE_STD /* Used by other time functions. */ struct tm { int tm_sec; /* Seconds. [0-60] (1 leap second) */ int tm_min; /* Minutes. [0-59] */ int tm_hour; /* Hours. [0-23] */ int tm_mday; /* Day. [1-31] */ int tm_mon; /* Month. [0-11] */ int tm_year; /* Year - 1900. */ int tm_wday; /* Day of week. [0-6] */ int tm_yday; /* Days in year.[0-365] */ int tm_isdst; /* DST. [-1/0/1] */ # ifdef __USE_MISC long int tm_gmtoff; /* Seconds east of UTC. */ const char *tm_zone; /* Timezone abbreviation. */ # else long int __tm_gmtoff; /* Seconds east of UTC. */ const char *__tm_zone; /* Timezone abbreviation. */ # endif }; __END_NAMESPACE_STD #if defined __USE_XOPEN || defined __USE_POSIX __USING_NAMESPACE_STD(tm) #endif # ifdef __USE_POSIX199309 /* POSIX.1b structure for timer start values and intervals. */ struct itimerspec { struct timespec it_interval; struct timespec it_value; }; /* We can use a simple forward declaration. */ struct sigevent; # endif /* POSIX.1b */ # ifdef __USE_XOPEN2K # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined # endif # endif # ifdef __USE_ISOC11 /* Time base values for timespec_get. */ # define TIME_UTC 1 # endif __BEGIN_NAMESPACE_STD /* Time used by the program so far (user time + system time). The result / CLOCKS_PER_SECOND is program time in seconds. */ extern clock_t clock(void) __THROW; /* Return the current time and put it in *TIMER if TIMER is not NULL. */ extern time_t time(time_t * __timer) __THROW; /* Return the difference between TIME1 and TIME0. */ extern double difftime(time_t __time1, time_t __time0) __THROW __attribute__ ((__const__)); /* Return the `time_t' representation of TP and normalize TP. */ extern time_t mktime(struct tm *__tp) __THROW; /* Format TP into S according to FORMAT. Write no more than MAXSIZE characters and return the number of characters written, or 0 if it would exceed MAXSIZE. */ extern size_t strftime(char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp) __THROW; __END_NAMESPACE_STD # ifdef __USE_XOPEN /* Parse S according to FORMAT and store binary time information in TP. The return value is a pointer to the first unparsed character in S. */ extern char *strptime(const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp) __THROW; # endif # ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ # include extern size_t strftime_l(char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp, __locale_t __loc) __THROW; # endif # ifdef __USE_GNU extern char *strptime_l(const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp, __locale_t __loc) __THROW; # endif __BEGIN_NAMESPACE_STD /* Return the `struct tm' representation of *TIMER in Universal Coordinated Time (aka Greenwich Mean Time). */ extern struct tm *gmtime(const time_t * __timer) __THROW; /* Return the `struct tm' representation of *TIMER in the local timezone. */ extern struct tm *localtime(const time_t * __timer) __THROW; __END_NAMESPACE_STD # ifdef __USE_POSIX /* Return the `struct tm' representation of *TIMER in UTC, using *TP to store the result. */ extern struct tm *gmtime_r(const time_t * __restrict __timer, struct tm *__restrict __tp) __THROW; /* Return the `struct tm' representation of *TIMER in local time, using *TP to store the result. */ extern struct tm *localtime_r(const time_t * __restrict __timer, struct tm *__restrict __tp) __THROW; # endif /* POSIX */ __BEGIN_NAMESPACE_STD /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ extern char *asctime(const struct tm *__tp) __THROW; /* Equivalent to `asctime (localtime (timer))'. */ extern char *ctime(const time_t * __timer) __THROW; __END_NAMESPACE_STD # ifdef __USE_POSIX /* Reentrant versions of the above functions. */ /* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ extern char *asctime_r(const struct tm *__restrict __tp, char *__restrict __buf) __THROW; /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */ extern char *ctime_r(const time_t * __restrict __timer, char *__restrict __buf) __THROW; # endif /* POSIX */ /* Defined in localtime.c. */ extern char *__tzname[2]; /* Current timezone names. */ extern int __daylight; /* If daylight-saving time is ever in use. */ extern long int __timezone; /* Seconds west of UTC. */ # ifdef __USE_POSIX /* Same as above. */ extern char *tzname[2]; /* Set time conversion information from the TZ environment variable. If TZ is not defined, a locale-dependent default is used. */ extern void tzset(void) __THROW; # endif # if defined __USE_MISC || defined __USE_XOPEN extern int daylight; extern long int timezone; # endif # ifdef __USE_MISC /* Set the system time to *WHEN. This call is restricted to the superuser. */ extern int stime(const time_t * __when) __THROW; # endif /* Nonzero if YEAR is a leap year (every 4 years, except every 100th isn't, and every 400th is). */ # define __isleap(year) \ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) # ifdef __USE_MISC /* Miscellaneous functions many Unices inherited from the public domain localtime package. These are included only for compatibility. */ /* Like `mktime', but for TP represents Universal Time, not local time. */ extern time_t timegm(struct tm *__tp) __THROW; /* Another name for `mktime'. */ extern time_t timelocal(struct tm *__tp) __THROW; /* Return the number of days in YEAR. */ extern int dysize(int __year) __THROW __attribute__ ((__const__)); # endif # ifdef __USE_POSIX199309 /* Pause execution for a number of nanoseconds. This function is a cancellation point and therefore not marked with __THROW. */ extern int nanosleep(const struct timespec *__requested_time, struct timespec *__remaining); /* Get resolution of clock CLOCK_ID. */ extern int clock_getres(clockid_t __clock_id, struct timespec *__res) __THROW; /* Get current value of clock CLOCK_ID and store it in TP. */ extern int clock_gettime(clockid_t __clock_id, struct timespec *__tp) __THROW; /* Set clock CLOCK_ID to value TP. */ extern int clock_settime(clockid_t __clock_id, const struct timespec *__tp) __THROW; # ifdef __USE_XOPEN2K /* High-resolution sleep with the specified clock. This function is a cancellation point and therefore not marked with __THROW. */ extern int clock_nanosleep(clockid_t __clock_id, int __flags, const struct timespec *__req, struct timespec *__rem); /* Return clock ID for CPU-time clock. */ extern int clock_getcpuclockid(pid_t __pid, clockid_t * __clock_id) __THROW; # endif /* Create new per-process timer using CLOCK_ID. */ extern int timer_create(clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t * __restrict __timerid) __THROW; /* Delete timer TIMERID. */ extern int timer_delete(timer_t __timerid) __THROW; /* Set timer TIMERID to VALUE, returning old value in OVALUE. */ extern int timer_settime(timer_t __timerid, int __flags, const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __THROW; /* Get current value of timer TIMERID and store it in VALUE. */ extern int timer_gettime(timer_t __timerid, struct itimerspec *__value) __THROW; /* Get expiration overrun for timer TIMERID. */ extern int timer_getoverrun(timer_t __timerid) __THROW; # endif # ifdef __USE_ISOC11 /* Set TS to calendar time based in time base BASE. */ extern int timespec_get(struct timespec *__ts, int __base) __THROW __nonnull((1)); # endif # ifdef __USE_XOPEN_EXTENDED /* Set to one of the following values to indicate an error. 1 the DATEMSK environment variable is null or undefined, 2 the template file cannot be opened for reading, 3 failed to get file status information, 4 the template file is not a regular file, 5 an error is encountered while reading the template file, 6 memory allication failed (not enough memory available), 7 there is no line in the template that matches the input, 8 invalid input specification Example: February 31 or a time is specified that can not be represented in a time_t (representing the time in seconds since 00:00:00 UTC, January 1, 1970) */ extern int getdate_err; /* Parse the given string as a date specification and return a value representing the value. The templates from the file identified by the environment variable DATEMSK are used. In case of an error `getdate_err' is set. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct tm *getdate(const char *__string); # endif # ifdef __USE_GNU /* Since `getdate' is not reentrant because of the use of `getdate_err' and the static buffer to return the result in, we provide a thread-safe variant. The functionality is the same. The result is returned in the buffer pointed to by RESBUFP and in case of an error the return value is != 0 with the same values as given above for `getdate_err'. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getdate_r(const char *__restrict __string, struct tm *__restrict __resbufp); # endif __END_DECLS #endif /* included. */ #endif /* not already included. */ ================================================ FILE: v2/headers/linux_amd64/usr/include/unistd.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 2.10 Symbolic Constants */ #ifndef _UNISTD_H #define _UNISTD_H 1 #include __BEGIN_DECLS /* These may be used to determine what facilities are present at compile time. Their values can be obtained at run time from `sysconf'. */ #ifdef __USE_XOPEN2K8 /* POSIX Standard approved as ISO/IEC 9945-1 as of September 2008. */ # define _POSIX_VERSION 200809L #elif defined __USE_XOPEN2K /* POSIX Standard approved as ISO/IEC 9945-1 as of December 2001. */ # define _POSIX_VERSION 200112L #elif defined __USE_POSIX199506 /* POSIX Standard approved as ISO/IEC 9945-1 as of June 1995. */ # define _POSIX_VERSION 199506L #elif defined __USE_POSIX199309 /* POSIX Standard approved as ISO/IEC 9945-1 as of September 1993. */ # define _POSIX_VERSION 199309L #else /* POSIX Standard approved as ISO/IEC 9945-1 as of September 1990. */ # define _POSIX_VERSION 199009L #endif /* These are not #ifdef __USE_POSIX2 because they are in the theoretically application-owned namespace. */ #ifdef __USE_XOPEN2K8 # define __POSIX2_THIS_VERSION 200809L /* The utilities on GNU systems also correspond to this version. */ #elif defined __USE_XOPEN2K /* The utilities on GNU systems also correspond to this version. */ # define __POSIX2_THIS_VERSION 200112L #elif defined __USE_POSIX199506 /* The utilities on GNU systems also correspond to this version. */ # define __POSIX2_THIS_VERSION 199506L #else /* The utilities on GNU systems also correspond to this version. */ # define __POSIX2_THIS_VERSION 199209L #endif /* The utilities on GNU systems also correspond to this version. */ #define _POSIX2_VERSION __POSIX2_THIS_VERSION /* This symbol was required until the 2001 edition of POSIX. */ #define _POSIX2_C_VERSION __POSIX2_THIS_VERSION /* If defined, the implementation supports the C Language Bindings Option. */ #define _POSIX2_C_BIND __POSIX2_THIS_VERSION /* If defined, the implementation supports the C Language Development Utilities Option. */ #define _POSIX2_C_DEV __POSIX2_THIS_VERSION /* If defined, the implementation supports the Software Development Utilities Option. */ #define _POSIX2_SW_DEV __POSIX2_THIS_VERSION /* If defined, the implementation supports the creation of locales with the localedef utility. */ #define _POSIX2_LOCALEDEF __POSIX2_THIS_VERSION /* X/Open version number to which the library conforms. It is selectable. */ #ifdef __USE_XOPEN2K8 # define _XOPEN_VERSION 700 #elif defined __USE_XOPEN2K # define _XOPEN_VERSION 600 #elif defined __USE_UNIX98 # define _XOPEN_VERSION 500 #else # define _XOPEN_VERSION 4 #endif /* Commands and utilities from XPG4 are available. */ #define _XOPEN_XCU_VERSION 4 /* We are compatible with the old published standards as well. */ #define _XOPEN_XPG2 1 #define _XOPEN_XPG3 1 #define _XOPEN_XPG4 1 /* The X/Open Unix extensions are available. */ #define _XOPEN_UNIX 1 /* Encryption is present. */ #define _XOPEN_CRYPT 1 /* The enhanced internationalization capabilities according to XPG4.2 are present. */ #define _XOPEN_ENH_I18N 1 /* The legacy interfaces are also available. */ #define _XOPEN_LEGACY 1 /* Get values of POSIX options: If these symbols are defined, the corresponding features are always available. If not, they may be available sometimes. The current values can be obtained with `sysconf'. _POSIX_JOB_CONTROL Job control is supported. _POSIX_SAVED_IDS Processes have a saved set-user-ID and a saved set-group-ID. _POSIX_REALTIME_SIGNALS Real-time, queued signals are supported. _POSIX_PRIORITY_SCHEDULING Priority scheduling is supported. _POSIX_TIMERS POSIX.4 clocks and timers are supported. _POSIX_ASYNCHRONOUS_IO Asynchronous I/O is supported. _POSIX_PRIORITIZED_IO Prioritized asynchronous I/O is supported. _POSIX_SYNCHRONIZED_IO Synchronizing file data is supported. _POSIX_FSYNC The fsync function is present. _POSIX_MAPPED_FILES Mapping of files to memory is supported. _POSIX_MEMLOCK Locking of all memory is supported. _POSIX_MEMLOCK_RANGE Locking of ranges of memory is supported. _POSIX_MEMORY_PROTECTION Setting of memory protections is supported. _POSIX_MESSAGE_PASSING POSIX.4 message queues are supported. _POSIX_SEMAPHORES POSIX.4 counting semaphores are supported. _POSIX_SHARED_MEMORY_OBJECTS POSIX.4 shared memory objects are supported. _POSIX_THREADS POSIX.1c pthreads are supported. _POSIX_THREAD_ATTR_STACKADDR Thread stack address attribute option supported. _POSIX_THREAD_ATTR_STACKSIZE Thread stack size attribute option supported. _POSIX_THREAD_SAFE_FUNCTIONS Thread-safe functions are supported. _POSIX_THREAD_PRIORITY_SCHEDULING POSIX.1c thread execution scheduling supported. _POSIX_THREAD_PRIO_INHERIT Thread priority inheritance option supported. _POSIX_THREAD_PRIO_PROTECT Thread priority protection option supported. _POSIX_THREAD_PROCESS_SHARED Process-shared synchronization supported. _POSIX_PII Protocol-independent interfaces are supported. _POSIX_PII_XTI XTI protocol-indep. interfaces are supported. _POSIX_PII_SOCKET Socket protocol-indep. interfaces are supported. _POSIX_PII_INTERNET Internet family of protocols supported. _POSIX_PII_INTERNET_STREAM Connection-mode Internet protocol supported. _POSIX_PII_INTERNET_DGRAM Connectionless Internet protocol supported. _POSIX_PII_OSI ISO/OSI family of protocols supported. _POSIX_PII_OSI_COTS Connection-mode ISO/OSI service supported. _POSIX_PII_OSI_CLTS Connectionless ISO/OSI service supported. _POSIX_POLL Implementation supports `poll' function. _POSIX_SELECT Implementation supports `select' and `pselect'. _XOPEN_REALTIME X/Open realtime support is available. _XOPEN_REALTIME_THREADS X/Open realtime thread support is available. _XOPEN_SHM Shared memory interface according to XPG4.2. _XBS5_ILP32_OFF32 Implementation provides environment with 32-bit int, long, pointer, and off_t types. _XBS5_ILP32_OFFBIG Implementation provides environment with 32-bit int, long, and pointer and off_t with at least 64 bits. _XBS5_LP64_OFF64 Implementation provides environment with 32-bit int, and 64-bit long, pointer, and off_t types. _XBS5_LPBIG_OFFBIG Implementation provides environment with at least 32 bits int and long, pointer, and off_t with at least 64 bits. If any of these symbols is defined as -1, the corresponding option is not true for any file. If any is defined as other than -1, the corresponding option is true for all files. If a symbol is not defined at all, the value for a specific file can be obtained from `pathconf' and `fpathconf'. _POSIX_CHOWN_RESTRICTED Only the super user can use `chown' to change the owner of a file. `chown' can only be used to change the group ID of a file to a group of which the calling process is a member. _POSIX_NO_TRUNC Pathname components longer than NAME_MAX generate an error. _POSIX_VDISABLE If defined, if the value of an element of the `c_cc' member of `struct termios' is _POSIX_VDISABLE, no character will have the effect associated with that element. _POSIX_SYNC_IO Synchronous I/O may be performed. _POSIX_ASYNC_IO Asynchronous I/O may be performed. _POSIX_PRIO_IO Prioritized Asynchronous I/O may be performed. Support for the Large File Support interface is not generally available. If it is available the following constants are defined to one. _LFS64_LARGEFILE Low-level I/O supports large files. _LFS64_STDIO Standard I/O supports large files. */ #include /* Get the environment definitions from Unix98. */ #if defined __USE_UNIX98 || defined __USE_XOPEN2K # include #endif /* Standard file descriptors. */ #define STDIN_FILENO 0 /* Standard input. */ #define STDOUT_FILENO 1 /* Standard output. */ #define STDERR_FILENO 2 /* Standard error output. */ /* All functions that are not declared anywhere else. */ #include #ifndef __ssize_t_defined typedef __ssize_t ssize_t; # define __ssize_t_defined #endif #define __need_size_t #define __need_NULL #include #if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ # ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined # endif # ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined # endif # ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined # endif # if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; # define __off64_t_defined # endif # ifndef __useconds_t_defined typedef __useconds_t useconds_t; # define __useconds_t_defined # endif # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined # endif #endif /* X/Open */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K # ifndef __intptr_t_defined typedef __intptr_t intptr_t; # define __intptr_t_defined # endif #endif #if defined __USE_MISC || defined __USE_XOPEN # ifndef __socklen_t_defined typedef __socklen_t socklen_t; # define __socklen_t_defined # endif #endif /* Values for the second argument to access. These may be OR'd together. */ #define R_OK 4 /* Test for read permission. */ #define W_OK 2 /* Test for write permission. */ #define X_OK 1 /* Test for execute permission. */ #define F_OK 0 /* Test for existence. */ /* Test for access to NAME using the real UID and real GID. */ extern int access(const char *__name, int __type) __THROW __nonnull((1)); #ifdef __USE_GNU /* Test for access to NAME using the effective UID and GID (as normal file operations use). */ extern int euidaccess(const char *__name, int __type) __THROW __nonnull((1)); /* An alias for `euidaccess', used by some other systems. */ extern int eaccess(const char *__name, int __type) __THROW __nonnull((1)); #endif #ifdef __USE_ATFILE /* Test for access to FILE relative to the directory FD is open on. If AT_EACCESS is set in FLAG, then use effective IDs like `eaccess', otherwise use real IDs like `access'. */ extern int faccessat(int __fd, const char *__file, int __type, int __flag) __THROW __nonnull((2)) __wur; #endif /* Use GNU. */ /* Values for the WHENCE argument to lseek. */ #ifndef _STDIO_H /* has the same definitions. */ # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Seek from end of file. */ # ifdef __USE_GNU # define SEEK_DATA 3 /* Seek to next data. */ # define SEEK_HOLE 4 /* Seek to next hole. */ # endif #endif #if defined __USE_MISC && !defined L_SET /* Old BSD names for the same constants; just for compatibility. */ # define L_SET SEEK_SET # define L_INCR SEEK_CUR # define L_XTND SEEK_END #endif /* Move FD's file position to OFFSET bytes from the beginning of the file (if WHENCE is SEEK_SET), the current position (if WHENCE is SEEK_CUR), or the end of the file (if WHENCE is SEEK_END). Return the new file position. */ #ifndef __USE_FILE_OFFSET64 extern __off_t lseek(int __fd, __off_t __offset, int __whence) __THROW; #else # ifdef __REDIRECT_NTH extern __off64_t __REDIRECT_NTH(lseek, (int __fd, __off64_t __offset, int __whence), lseek64); # else # define lseek lseek64 # endif #endif #ifdef __USE_LARGEFILE64 extern __off64_t lseek64(int __fd, __off64_t __offset, int __whence) __THROW; #endif /* Close the file descriptor FD. This function is a cancellation point and therefore not marked with __THROW. */ extern int close(int __fd); /* Read NBYTES into BUF from FD. Return the number read, -1 for errors or 0 for EOF. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t read(int __fd, void *__buf, size_t __nbytes) __wur; /* Write N bytes of BUF to FD. Return the number written, or -1. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t write(int __fd, const void *__buf, size_t __n) __wur; #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 # ifndef __USE_FILE_OFFSET64 /* Read NBYTES into BUF from FD at the given position OFFSET without changing the file pointer. Return the number read, -1 for errors or 0 for EOF. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pread(int __fd, void *__buf, size_t __nbytes, __off_t __offset) __wur; /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwrite(int __fd, const void *__buf, size_t __n, __off_t __offset) __wur; # else # ifdef __REDIRECT extern ssize_t __REDIRECT(pread, (int __fd, void *__buf, size_t __nbytes, __off64_t __offset), pread64) __wur; extern ssize_t __REDIRECT(pwrite, (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset), pwrite64) __wur; # else # define pread pread64 # define pwrite pwrite64 # endif # endif # ifdef __USE_LARGEFILE64 /* Read NBYTES into BUF from FD at the given position OFFSET without changing the file pointer. Return the number read, -1 for errors or 0 for EOF. */ extern ssize_t pread64(int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __wur; /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. */ extern ssize_t pwrite64(int __fd, const void *__buf, size_t __n, __off64_t __offset) __wur; # endif #endif /* Create a one-way communication channel (pipe). If successful, two file descriptors are stored in PIPEDES; bytes written on PIPEDES[1] can be read from PIPEDES[0]. Returns 0 if successful, -1 if not. */ extern int pipe(int __pipedes[2]) __THROW __wur; #ifdef __USE_GNU /* Same as pipe but apply flags passed in FLAGS to the new file descriptors. */ extern int pipe2(int __pipedes[2], int __flags) __THROW __wur; #endif /* Schedule an alarm. In SECONDS seconds, the process will get a SIGALRM. If SECONDS is zero, any currently scheduled alarm will be cancelled. The function returns the number of seconds remaining until the last alarm scheduled would have signaled, or zero if there wasn't one. There is no return value to indicate an error, but you can set `errno' to 0 and check its value after calling `alarm', and this might tell you. The signal may come late due to processor scheduling. */ extern unsigned int alarm(unsigned int __seconds) __THROW; /* Make the process sleep for SECONDS seconds, or until a signal arrives and is not ignored. The function returns the number of seconds less than SECONDS which it actually slept (thus zero if it slept the full time). If a signal handler does a `longjmp' or modifies the handling of the SIGALRM signal while inside `sleep' call, the handling of the SIGALRM signal afterwards is undefined. There is no return value to indicate error, but if `sleep' returns SECONDS, it probably didn't work. This function is a cancellation point and therefore not marked with __THROW. */ extern unsigned int sleep(unsigned int __seconds); #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_MISC /* Set an alarm to go off (generating a SIGALRM signal) in VALUE microseconds. If INTERVAL is nonzero, when the alarm goes off, the timer is reset to go off every INTERVAL microseconds thereafter. Returns the number of microseconds remaining before the alarm. */ extern __useconds_t ualarm(__useconds_t __value, __useconds_t __interval) __THROW; /* Sleep USECONDS microseconds, or until a signal arrives that is not blocked or ignored. This function is a cancellation point and therefore not marked with __THROW. */ extern int usleep(__useconds_t __useconds); #endif /* Suspend the process until a signal arrives. This always returns -1 and sets `errno' to EINTR. This function is a cancellation point and therefore not marked with __THROW. */ extern int pause(void); /* Change the owner and group of FILE. */ extern int chown(const char *__file, __uid_t __owner, __gid_t __group) __THROW __nonnull((1)) __wur; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Change the owner and group of the file that FD is open on. */ extern int fchown(int __fd, __uid_t __owner, __gid_t __group) __THROW __wur; /* Change owner and group of FILE, if it is a symbolic link the ownership of the symbolic link is changed. */ extern int lchown(const char *__file, __uid_t __owner, __gid_t __group) __THROW __nonnull((1)) __wur; #endif /* Use X/Open Unix. */ #ifdef __USE_ATFILE /* Change the owner and group of FILE relative to the directory FD is open on. */ extern int fchownat(int __fd, const char *__file, __uid_t __owner, __gid_t __group, int __flag) __THROW __nonnull((2)) __wur; #endif /* Use GNU. */ /* Change the process's working directory to PATH. */ extern int chdir(const char *__path) __THROW __nonnull((1)) __wur; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Change the process's working directory to the one FD is open on. */ extern int fchdir(int __fd) __THROW __wur; #endif /* Get the pathname of the current working directory, and put it in SIZE bytes of BUF. Returns NULL if the directory couldn't be determined or SIZE was too small. If successful, returns BUF. In GNU, if BUF is NULL, an array is allocated with `malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as necessary. */ extern char *getcwd(char *__buf, size_t __size) __THROW __wur; #ifdef __USE_GNU /* Return a malloc'd string containing the current directory name. If the environment variable `PWD' is set, and its value is correct, that value is used. */ extern char *get_current_dir_name(void) __THROW; #endif #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_MISC /* Put the absolute pathname of the current working directory in BUF. If successful, return BUF. If not, put an error message in BUF and return NULL. BUF should be at least PATH_MAX bytes long. */ extern char *getwd(char *__buf) __THROW __nonnull((1)) __attribute_deprecated__ __wur; #endif /* Duplicate FD, returning a new file descriptor on the same file. */ extern int dup(int __fd) __THROW __wur; /* Duplicate FD to FD2, closing FD2 and making it open on the same file. */ extern int dup2(int __fd, int __fd2) __THROW; #ifdef __USE_GNU /* Duplicate FD to FD2, closing FD2 and making it open on the same file while setting flags according to FLAGS. */ extern int dup3(int __fd, int __fd2, int __flags) __THROW; #endif /* NULL-terminated array of "NAME=VALUE" environment variables. */ extern char **__environ; #ifdef __USE_GNU extern char **environ; #endif /* Replace the current process, executing PATH with arguments ARGV and environment ENVP. ARGV and ENVP are terminated by NULL pointers. */ extern int execve(const char *__path, char *const __argv[], char *const __envp[]) __THROW __nonnull((1, 2)); #ifdef __USE_XOPEN2K8 /* Execute the file FD refers to, overlaying the running program image. ARGV and ENVP are passed to the new program, as for `execve'. */ extern int fexecve(int __fd, char *const __argv[], char *const __envp[]) __THROW __nonnull((2)); #endif /* Execute PATH with arguments ARGV and environment from `environ'. */ extern int execv(const char *__path, char *const __argv[]) __THROW __nonnull((1, 2)); /* Execute PATH with all arguments after PATH until a NULL pointer, and the argument after that for environment. */ extern int execle(const char *__path, const char *__arg, ...) __THROW __nonnull((1, 2)); /* Execute PATH with all arguments after PATH until a NULL pointer and environment from `environ'. */ extern int execl(const char *__path, const char *__arg, ...) __THROW __nonnull((1, 2)); /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with arguments ARGV and environment from `environ'. */ extern int execvp(const char *__file, char *const __argv[]) __THROW __nonnull((1, 2)); /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with all arguments after FILE until a NULL pointer and environment from `environ'. */ extern int execlp(const char *__file, const char *__arg, ...) __THROW __nonnull((1, 2)); #ifdef __USE_GNU /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with arguments ARGV and environment from `environ'. */ extern int execvpe(const char *__file, char *const __argv[], char *const __envp[]) __THROW __nonnull((1, 2)); #endif #if defined __USE_MISC || defined __USE_XOPEN /* Add INC to priority of the current process. */ extern int nice(int __inc) __THROW __wur; #endif /* Terminate program execution with the low-order 8 bits of STATUS. */ extern void _exit(int __status) __attribute__ ((__noreturn__)); /* Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf'; the `_SC_*' symbols for the NAME argument to `sysconf'; and the `_CS_*' symbols for the NAME argument to `confstr'. */ #include /* Get file-specific configuration information about PATH. */ extern long int pathconf(const char *__path, int __name) __THROW __nonnull((1)); /* Get file-specific configuration about descriptor FD. */ extern long int fpathconf(int __fd, int __name) __THROW; /* Get the value of the system variable NAME. */ extern long int sysconf(int __name) __THROW; #ifdef __USE_POSIX2 /* Get the value of the string-valued system variable NAME. */ extern size_t confstr(int __name, char *__buf, size_t __len) __THROW; #endif /* Get the process ID of the calling process. */ extern __pid_t getpid(void) __THROW; /* Get the process ID of the calling process's parent. */ extern __pid_t getppid(void) __THROW; /* Get the process group ID of the calling process. */ extern __pid_t getpgrp(void) __THROW; /* Get the process group ID of process PID. */ extern __pid_t __getpgid(__pid_t __pid) __THROW; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 extern __pid_t getpgid(__pid_t __pid) __THROW; #endif /* Set the process group ID of the process matching PID to PGID. If PID is zero, the current process's process group ID is set. If PGID is zero, the process ID of the process is used. */ extern int setpgid(__pid_t __pid, __pid_t __pgid) __THROW; #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Both System V and BSD have `setpgrp' functions, but with different calling conventions. The BSD function is the same as POSIX.1 `setpgid' (above). The System V function takes no arguments and puts the calling process in its on group like `setpgid (0, 0)'. New programs should always use `setpgid' instead. GNU provides the POSIX.1 function. */ /* Set the process group ID of the calling process to its own PID. This is exactly the same as `setpgid (0, 0)'. */ extern int setpgrp(void) __THROW; #endif /* Use misc or X/Open. */ /* Create a new session with the calling process as its leader. The process group IDs of the session and the calling process are set to the process ID of the calling process, which is returned. */ extern __pid_t setsid(void) __THROW; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Return the session ID of the given process. */ extern __pid_t getsid(__pid_t __pid) __THROW; #endif /* Get the real user ID of the calling process. */ extern __uid_t getuid(void) __THROW; /* Get the effective user ID of the calling process. */ extern __uid_t geteuid(void) __THROW; /* Get the real group ID of the calling process. */ extern __gid_t getgid(void) __THROW; /* Get the effective group ID of the calling process. */ extern __gid_t getegid(void) __THROW; /* If SIZE is zero, return the number of supplementary groups the calling process is in. Otherwise, fill in the group IDs of its supplementary groups in LIST and return the number written. */ extern int getgroups(int __size, __gid_t __list[]) __THROW __wur; #ifdef __USE_GNU /* Return nonzero iff the calling process is in group GID. */ extern int group_member(__gid_t __gid) __THROW; #endif /* Set the user ID of the calling process to UID. If the calling process is the super-user, set the real and effective user IDs, and the saved set-user-ID to UID; if not, the effective user ID is set to UID. */ extern int setuid(__uid_t __uid) __THROW __wur; #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Set the real user ID of the calling process to RUID, and the effective user ID of the calling process to EUID. */ extern int setreuid(__uid_t __ruid, __uid_t __euid) __THROW __wur; #endif #ifdef __USE_XOPEN2K /* Set the effective user ID of the calling process to UID. */ extern int seteuid(__uid_t __uid) __THROW __wur; #endif /* Use POSIX.1-2001. */ /* Set the group ID of the calling process to GID. If the calling process is the super-user, set the real and effective group IDs, and the saved set-group-ID to GID; if not, the effective group ID is set to GID. */ extern int setgid(__gid_t __gid) __THROW __wur; #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Set the real group ID of the calling process to RGID, and the effective group ID of the calling process to EGID. */ extern int setregid(__gid_t __rgid, __gid_t __egid) __THROW __wur; #endif #ifdef __USE_XOPEN2K /* Set the effective group ID of the calling process to GID. */ extern int setegid(__gid_t __gid) __THROW __wur; #endif /* Use POSIX.1-2001. */ #ifdef __USE_GNU /* Fetch the real user ID, effective user ID, and saved-set user ID, of the calling process. */ extern int getresuid(__uid_t * __ruid, __uid_t * __euid, __uid_t * __suid) __THROW; /* Fetch the real group ID, effective group ID, and saved-set group ID, of the calling process. */ extern int getresgid(__gid_t * __rgid, __gid_t * __egid, __gid_t * __sgid) __THROW; /* Set the real user ID, effective user ID, and saved-set user ID, of the calling process to RUID, EUID, and SUID, respectively. */ extern int setresuid(__uid_t __ruid, __uid_t __euid, __uid_t __suid) __THROW __wur; /* Set the real group ID, effective group ID, and saved-set group ID, of the calling process to RGID, EGID, and SGID, respectively. */ extern int setresgid(__gid_t __rgid, __gid_t __egid, __gid_t __sgid) __THROW __wur; #endif /* Clone the calling process, creating an exact copy. Return -1 for errors, 0 to the new process, and the process ID of the new process to the old process. */ extern __pid_t fork(void) __THROWNL; #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_MISC /* Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is replaced by a call to `execve'. Return -1 for errors, 0 to the new process, and the process ID of the new process to the old process. */ extern __pid_t vfork(void) __THROW; #endif /* Use misc or XPG < 7. */ /* Return the pathname of the terminal FD is open on, or NULL on errors. The returned storage is good only until the next call to this function. */ extern char *ttyname(int __fd) __THROW; /* Store at most BUFLEN characters of the pathname of the terminal FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ttyname_r(int __fd, char *__buf, size_t __buflen) __THROW __nonnull((2)) __wur; /* Return 1 if FD is a valid descriptor associated with a terminal, zero if not. */ extern int isatty(int __fd) __THROW; #if defined __USE_MISC \ || (defined __USE_XOPEN_EXTENDED && !defined __USE_UNIX98) /* Return the index into the active-logins file (utmp) for the controlling terminal. */ extern int ttyslot(void) __THROW; #endif /* Make a link to FROM named TO. */ extern int link(const char *__from, const char *__to) __THROW __nonnull((1, 2)) __wur; #ifdef __USE_ATFILE /* Like link but relative paths in TO and FROM are interpreted relative to FROMFD and TOFD respectively. */ extern int linkat(int __fromfd, const char *__from, int __tofd, const char *__to, int __flags) __THROW __nonnull((2, 4)) __wur; #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K /* Make a symbolic link to FROM named TO. */ extern int symlink(const char *__from, const char *__to) __THROW __nonnull((1, 2)) __wur; /* Read the contents of the symbolic link PATH into no more than LEN bytes of BUF. The contents are not null-terminated. Returns the number of characters read, or -1 for errors. */ extern ssize_t readlink(const char *__restrict __path, char *__restrict __buf, size_t __len) __THROW __nonnull((1, 2)) __wur; #endif /* Use POSIX.1-2001. */ #ifdef __USE_ATFILE /* Like symlink but a relative path in TO is interpreted relative to TOFD. */ extern int symlinkat(const char *__from, int __tofd, const char *__to) __THROW __nonnull((1, 3)) __wur; /* Like readlink but a relative PATH is interpreted relative to FD. */ extern ssize_t readlinkat(int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len) __THROW __nonnull((2, 3)) __wur; #endif /* Remove the link NAME. */ extern int unlink(const char *__name) __THROW __nonnull((1)); #ifdef __USE_ATFILE /* Remove the link NAME relative to FD. */ extern int unlinkat(int __fd, const char *__name, int __flag) __THROW __nonnull((2)); #endif /* Remove the directory PATH. */ extern int rmdir(const char *__path) __THROW __nonnull((1)); /* Return the foreground process group ID of FD. */ extern __pid_t tcgetpgrp(int __fd) __THROW; /* Set the foreground process group ID of FD set PGRP_ID. */ extern int tcsetpgrp(int __fd, __pid_t __pgrp_id) __THROW; /* Return the login name of the user. This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *getlogin(void); #if defined __USE_REENTRANT || defined __USE_POSIX199506 /* Return at most NAME_LEN characters of the login name of the user in NAME. If it cannot be determined or some other error occurred, return the error code. Otherwise return 0. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getlogin_r(char *__name, size_t __name_len) __nonnull((1)); #endif #ifdef __USE_MISC /* Set the login name returned by `getlogin'. */ extern int setlogin(const char *__name) __THROW __nonnull((1)); #endif #ifdef __USE_POSIX2 /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. */ # define __need_getopt # include #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K /* Put the name of the current host in no more than LEN bytes of NAME. The result is null-terminated if LEN is large enough for the full name and the terminator. */ extern int gethostname(char *__name, size_t __len) __THROW __nonnull((1)); #endif #if defined __USE_MISC /* Set the name of the current host to NAME, which is LEN bytes long. This call is restricted to the super-user. */ extern int sethostname(const char *__name, size_t __len) __THROW __nonnull((1)) __wur; /* Set the current machine's Internet number to ID. This call is restricted to the super-user. */ extern int sethostid(long int __id) __THROW __wur; /* Get and set the NIS (aka YP) domain name, if any. Called just like `gethostname' and `sethostname'. The NIS domain name is usually the empty string when not using NIS. */ extern int getdomainname(char *__name, size_t __len) __THROW __nonnull((1)) __wur; extern int setdomainname(const char *__name, size_t __len) __THROW __nonnull((1)) __wur; /* Revoke access permissions to all processes currently communicating with the control terminal, and then send a SIGHUP signal to the process group of the control terminal. */ extern int vhangup(void) __THROW; /* Revoke the access of all descriptors currently open on FILE. */ extern int revoke(const char *__file) __THROW __nonnull((1)) __wur; /* Enable statistical profiling, writing samples of the PC into at most SIZE bytes of SAMPLE_BUFFER; every processor clock tick while profiling is enabled, the system examines the user PC and increments SAMPLE_BUFFER[((PC - OFFSET) / 2) * SCALE / 65536]. If SCALE is zero, disable profiling. Returns zero on success, -1 on error. */ extern int profil(unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale) __THROW __nonnull((1)); /* Turn accounting on if NAME is an existing file. The system will then write a record for each process as it terminates, to this file. If NAME is NULL, turn accounting off. This call is restricted to the super-user. */ extern int acct(const char *__name) __THROW; /* Successive calls return the shells listed in `/etc/shells'. */ extern char *getusershell(void) __THROW; extern void endusershell(void) __THROW; /* Discard cached info. */ extern void setusershell(void) __THROW; /* Rewind and re-read the file. */ /* Put the program in the background, and dissociate from the controlling terminal. If NOCHDIR is zero, do `chdir ("/")'. If NOCLOSE is zero, redirects stdin, stdout, and stderr to /dev/null. */ extern int daemon(int __nochdir, int __noclose) __THROW __wur; #endif /* Use misc. */ #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) /* Make PATH be the root directory (the starting point for absolute paths). This call is restricted to the super-user. */ extern int chroot(const char *__path) __THROW __nonnull((1)) __wur; /* Prompt with PROMPT and read a string from the terminal without echoing. Uses /dev/tty if possible; otherwise stderr and stdin. */ extern char *getpass(const char *__prompt) __nonnull((1)); #endif /* Use misc || X/Open. */ /* Make all changes done to FD actually appear on disk. This function is a cancellation point and therefore not marked with __THROW. */ extern int fsync(int __fd); #ifdef __USE_GNU /* Make all changes done to all files on the file system associated with FD actually appear on disk. */ extern int syncfs(int __fd) __THROW; #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Return identifier for the current host. */ extern long int gethostid(void); /* Make all changes done to all files actually appear on disk. */ extern void sync(void) __THROW; # if defined __USE_MISC || !defined __USE_XOPEN2K /* Return the number of bytes in a page. This is the system's page size, which is not necessarily the same as the hardware page size. */ extern int getpagesize(void) __THROW __attribute__ ((__const__)); /* Return the maximum number of file descriptors the current process could possibly have. */ extern int getdtablesize(void) __THROW; # endif #endif /* Use misc || X/Open Unix. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Truncate FILE to LENGTH bytes. */ # ifndef __USE_FILE_OFFSET64 extern int truncate(const char *__file, __off_t __length) __THROW __nonnull((1)) __wur; # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(truncate, (const char *__file, __off64_t __length), truncate64) __nonnull((1)) __wur; # else # define truncate truncate64 # endif # endif # ifdef __USE_LARGEFILE64 extern int truncate64(const char *__file, __off64_t __length) __THROW __nonnull((1)) __wur; # endif #endif /* Use X/Open Unix || POSIX 2008. */ #if defined __USE_POSIX199309 \ || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K /* Truncate the file FD is open on to LENGTH bytes. */ # ifndef __USE_FILE_OFFSET64 extern int ftruncate(int __fd, __off_t __length) __THROW __wur; # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(ftruncate, (int __fd, __off64_t __length), ftruncate64) __wur; # else # define ftruncate ftruncate64 # endif # endif # ifdef __USE_LARGEFILE64 extern int ftruncate64(int __fd, __off64_t __length) __THROW __wur; # endif #endif /* Use POSIX.1b || X/Open Unix || XPG6. */ #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \ || defined __USE_MISC /* Set the end of accessible data space (aka "the break") to ADDR. Returns zero on success and -1 for errors (with errno set). */ extern int brk(void *__addr) __THROW __wur; /* Increase or decrease the end of accessible data space by DELTA bytes. If successful, returns the address the previous end of data space (i.e. the beginning of the new space, if DELTA > 0); returns (void *) -1 for errors (with errno set). */ extern void *sbrk(intptr_t __delta) __THROW; #endif #ifdef __USE_MISC /* Invoke `system call' number SYSNO, passing it the remaining arguments. This is completely system-dependent, and not often useful. In Unix, `syscall' sets `errno' for all errors and most calls return -1 for errors; in many systems you cannot pass arguments or get return values for all system calls (`pipe', `fork', and `getppid' typically among them). In Mach, all system calls take normal arguments and always return an error code (zero for success). */ extern long int syscall(long int __sysno, ...) __THROW; #endif /* Use misc. */ #if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) && !defined F_LOCK /* NOTE: These declarations also appear in ; be sure to keep both files consistent. Some systems have them there and some here, and some software depends on the macros being defined without including both. */ /* `lockf' is a simpler interface to the locking facilities of `fcntl'. LEN is always relative to the current file position. The CMD argument is one of the following. This function is a cancellation point and therefore not marked with __THROW. */ # define F_ULOCK 0 /* Unlock a previously locked region. */ # define F_LOCK 1 /* Lock a region for exclusive use. */ # define F_TLOCK 2 /* Test and lock a region for exclusive use. */ # define F_TEST 3 /* Test a region for other processes locks. */ # ifndef __USE_FILE_OFFSET64 extern int lockf(int __fd, int __cmd, __off_t __len) __wur; # else # ifdef __REDIRECT extern int __REDIRECT(lockf, (int __fd, int __cmd, __off64_t __len), lockf64) __wur; # else # define lockf lockf64 # endif # endif # ifdef __USE_LARGEFILE64 extern int lockf64(int __fd, int __cmd, __off64_t __len) __wur; # endif #endif /* Use misc and F_LOCK not already defined. */ #ifdef __USE_GNU /* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno' set to EINTR. */ # define TEMP_FAILURE_RETRY(expression) \ (__extension__ \ ({ long int __result; \ do __result = (long int) (expression); \ while (__result == -1L && errno == EINTR); \ __result; })) #endif #if defined __USE_POSIX199309 || defined __USE_UNIX98 /* Synchronize at least the data part of a file with the underlying media. */ extern int fdatasync(int __fildes); #endif /* Use POSIX199309 */ /* XPG4.2 specifies that prototypes for the encryption functions must be defined here. */ #ifdef __USE_XOPEN /* Encrypt at most 8 characters from KEY using salt to perturb DES. */ extern char *crypt(const char *__key, const char *__salt) __THROW __nonnull((1, 2)); /* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt block in place. */ extern void encrypt(char *__glibc_block, int __edflag) __THROW __nonnull((1)); /* Swab pairs bytes in the first N bytes of the area pointed to by FROM and copy the result to TO. The value of TO must not be in the range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM is without partner. */ extern void swab(const void *__restrict __from, void *__restrict __to, ssize_t __n) __THROW __nonnull((1, 2)); #endif /* The Single Unix specification demands this prototype to be here. It is also found in . */ #if defined __USE_XOPEN && !defined __USE_XOPEN2K /* Return the name of the controlling terminal. */ extern char *ctermid(char *__s) __THROW; #endif /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif __END_DECLS #endif /* unistd.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/utime.h ================================================ /* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 5.6.6 Set File Access and Modification Times */ #ifndef _UTIME_H #define _UTIME_H 1 #include __BEGIN_DECLS #include #if defined __USE_XOPEN || defined __USE_XOPEN2K # define __need_time_t # include #endif /* Structure describing file times. */ struct utimbuf { __time_t actime; /* Access time. */ __time_t modtime; /* Modification time. */ }; /* Set the access and modification times of FILE to those given in *FILE_TIMES. If FILE_TIMES is NULL, set them to the current time. */ extern int utime(const char *__file, const struct utimbuf *__file_times) __THROW __nonnull((1)); __END_DECLS #endif /* utime.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/wchar.h ================================================ /* Copyright (C) 1995-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.24 * Extended multibyte and wide character utilities */ #ifndef _WCHAR_H #if !defined __need_mbstate_t && !defined __need_wint_t # define _WCHAR_H 1 # include #endif #ifdef _WCHAR_H /* Get FILE definition. */ # define __need___FILE # if defined __USE_UNIX98 || defined __USE_XOPEN2K # define __need_FILE # endif # include /* Get va_list definition. */ # define __need___va_list # include # include /* Get size_t, wchar_t, wint_t and NULL from . */ # define __need_size_t # define __need_wchar_t # define __need_NULL #endif #if defined _WCHAR_H || defined __need_wint_t || !defined __WINT_TYPE__ # undef __need_wint_t # define __need_wint_t # include /* We try to get wint_t from , but not all GCC versions define it there. So define it ourselves if it remains undefined. */ # ifndef _WINT_T /* Integral type unchanged by default argument promotions that can hold any value corresponding to members of the extended character set, as well as at least one value that does not correspond to any member of the extended character set. */ # define _WINT_T typedef unsigned int wint_t; # else /* Work around problems with the file which doesn't put wint_t in the std namespace. */ # if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES \ && defined __WINT_TYPE__ __BEGIN_NAMESPACE_STD typedef __WINT_TYPE__ wint_t; __END_NAMESPACE_STD # endif # endif /* Tell the caller that we provide correct C++ prototypes. */ # if defined __cplusplus && __GNUC_PREREQ (4, 4) # define __CORRECT_ISO_CPP_WCHAR_H_PROTO # endif #endif #if (defined _WCHAR_H || defined __need_mbstate_t) && !defined ____mbstate_t_defined # define ____mbstate_t_defined 1 /* Conversion state information. */ typedef struct { int __count; union { # ifdef __WINT_TYPE__ __WINT_TYPE__ __wch; # else wint_t __wch; # endif char __wchb[4]; } __value; /* Value so far. */ } __mbstate_t; #endif #undef __need_mbstate_t /* The rest of the file is only used if used if __need_mbstate_t is not defined. */ #ifdef _WCHAR_H # ifndef __mbstate_t_defined __BEGIN_NAMESPACE_C99 /* Public type. */ typedef __mbstate_t mbstate_t; __END_NAMESPACE_C99 # define __mbstate_t_defined 1 # endif #ifdef __USE_GNU __USING_NAMESPACE_C99(mbstate_t) #endif #ifndef WCHAR_MIN /* These constants might also be defined in . */ # define WCHAR_MIN __WCHAR_MIN # define WCHAR_MAX __WCHAR_MAX #endif #ifndef WEOF # define WEOF (0xffffffffu) #endif /* For XPG4 compliance we have to define the stuff from here as well. */ #if defined __USE_XOPEN && !defined __USE_UNIX98 # include #endif __BEGIN_DECLS __BEGIN_NAMESPACE_STD /* This incomplete type is defined in but needed here because of `wcsftime'. */ struct tm; __END_NAMESPACE_STD /* XXX We have to clean this up at some point. Since tm is in the std namespace but wcsftime is in __c99 the type wouldn't be found without inserting it in the global namespace. */ __USING_NAMESPACE_STD(tm) __BEGIN_NAMESPACE_STD /* Copy SRC to DEST. */ extern wchar_t *wcscpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src) __THROW __nonnull((1, 2)); /* Copy no more than N wide-characters of SRC to DEST. */ extern wchar_t *wcsncpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Append SRC onto DEST. */ extern wchar_t *wcscat(wchar_t * __restrict __dest, const wchar_t * __restrict __src) __THROW; /* Append no more than N wide-characters of SRC onto DEST. */ extern wchar_t *wcsncat(wchar_t * __restrict __dest, const wchar_t * __restrict __src, size_t __n) __THROW; /* Compare S1 and S2. */ extern int wcscmp(const wchar_t * __s1, const wchar_t * __s2) __THROW __attribute_pure__; /* Compare N wide-characters of S1 and S2. */ extern int wcsncmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW __attribute_pure__; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Compare S1 and S2, ignoring case. */ extern int wcscasecmp(const wchar_t * __s1, const wchar_t * __s2) __THROW; /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int wcsncasecmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW; /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ # include extern int wcscasecmp_l(const wchar_t * __s1, const wchar_t * __s2, __locale_t __loc) __THROW; extern int wcsncasecmp_l(const wchar_t * __s1, const wchar_t * __s2, size_t __n, __locale_t __loc) __THROW; #endif __BEGIN_NAMESPACE_STD /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the current locale. */ extern int wcscoll(const wchar_t * __s1, const wchar_t * __s2) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm(wchar_t * __restrict __s1, const wchar_t * __restrict __s2, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the given locale. */ extern int wcscoll_l(const wchar_t * __s1, const wchar_t * __s2, __locale_t __loc) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm_l(wchar_t * __s1, const wchar_t * __s2, size_t __n, __locale_t __loc) __THROW; /* Duplicate S, returning an identical malloc'd string. */ extern wchar_t *wcsdup(const wchar_t * __s) __THROW __attribute_malloc__; #endif __BEGIN_NAMESPACE_STD /* Find the first occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcschr(wchar_t * __wcs, wchar_t __wc) __THROW __asm("wcschr") __attribute_pure__; extern "C++" const wchar_t *wcschr(const wchar_t * __wcs, wchar_t __wc) __THROW __asm("wcschr") __attribute_pure__; #else extern wchar_t *wcschr(const wchar_t * __wcs, wchar_t __wc) __THROW __attribute_pure__; #endif /* Find the last occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcsrchr(wchar_t * __wcs, wchar_t __wc) __THROW __asm("wcsrchr") __attribute_pure__; extern "C++" const wchar_t *wcsrchr(const wchar_t * __wcs, wchar_t __wc) __THROW __asm("wcsrchr") __attribute_pure__; #else extern wchar_t *wcsrchr(const wchar_t * __wcs, wchar_t __wc) __THROW __attribute_pure__; #endif __END_NAMESPACE_STD #ifdef __USE_GNU /* This function is similar to `wcschr'. But it returns a pointer to the closing NUL wide character in case C is not found in S. */ extern wchar_t *wcschrnul(const wchar_t * __s, wchar_t __wc) __THROW __attribute_pure__; #endif __BEGIN_NAMESPACE_STD /* Return the length of the initial segmet of WCS which consists entirely of wide characters not in REJECT. */ extern size_t wcscspn(const wchar_t * __wcs, const wchar_t * __reject) __THROW __attribute_pure__; /* Return the length of the initial segmet of WCS which consists entirely of wide characters in ACCEPT. */ extern size_t wcsspn(const wchar_t * __wcs, const wchar_t * __accept) __THROW __attribute_pure__; /* Find the first occurrence in WCS of any character in ACCEPT. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcspbrk(wchar_t * __wcs, const wchar_t * __accept) __THROW __asm("wcspbrk") __attribute_pure__; extern "C++" const wchar_t *wcspbrk(const wchar_t * __wcs, const wchar_t * __accept) __THROW __asm("wcspbrk") __attribute_pure__; #else extern wchar_t *wcspbrk(const wchar_t * __wcs, const wchar_t * __accept) __THROW __attribute_pure__; #endif /* Find the first occurrence of NEEDLE in HAYSTACK. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcsstr(wchar_t * __haystack, const wchar_t * __needle) __THROW __asm("wcsstr") __attribute_pure__; extern "C++" const wchar_t *wcsstr(const wchar_t * __haystack, const wchar_t * __needle) __THROW __asm("wcsstr") __attribute_pure__; #else extern wchar_t *wcsstr(const wchar_t * __haystack, const wchar_t * __needle) __THROW __attribute_pure__; #endif /* Divide WCS into tokens separated by characters in DELIM. */ extern wchar_t *wcstok(wchar_t * __restrict __s, const wchar_t * __restrict __delim, wchar_t ** __restrict __ptr) __THROW; /* Return the number of wide characters in S. */ extern size_t wcslen(const wchar_t * __s) __THROW __attribute_pure__; __END_NAMESPACE_STD #ifdef __USE_XOPEN /* Another name for `wcsstr' from XPG4. */ # ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcswcs(wchar_t * __haystack, const wchar_t * __needle) __THROW __asm("wcswcs") __attribute_pure__; extern "C++" const wchar_t *wcswcs(const wchar_t * __haystack, const wchar_t * __needle) __THROW __asm("wcswcs") __attribute_pure__; # else extern wchar_t *wcswcs(const wchar_t * __haystack, const wchar_t * __needle) __THROW __attribute_pure__; # endif #endif #ifdef __USE_XOPEN2K8 /* Return the number of wide characters in S, but at most MAXLEN. */ extern size_t wcsnlen(const wchar_t * __s, size_t __maxlen) __THROW __attribute_pure__; #endif __BEGIN_NAMESPACE_STD /* Search N wide characters of S for C. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wmemchr(wchar_t * __s, wchar_t __c, size_t __n) __THROW __asm("wmemchr") __attribute_pure__; extern "C++" const wchar_t *wmemchr(const wchar_t * __s, wchar_t __c, size_t __n) __THROW __asm("wmemchr") __attribute_pure__; #else extern wchar_t *wmemchr(const wchar_t * __s, wchar_t __c, size_t __n) __THROW __attribute_pure__; #endif /* Compare N wide characters of S1 and S2. */ extern int wmemcmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW __attribute_pure__; /* Copy N wide characters of SRC to DEST. */ extern wchar_t *wmemcpy(wchar_t * __restrict __s1, const wchar_t * __restrict __s2, size_t __n) __THROW; /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for overlapping strings. */ extern wchar_t *wmemmove(wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW; /* Set N wide characters of S to C. */ extern wchar_t *wmemset(wchar_t * __s, wchar_t __c, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_GNU /* Copy N wide characters of SRC to DEST and return pointer to following wide character. */ extern wchar_t *wmempcpy(wchar_t * __restrict __s1, const wchar_t * __restrict __s2, size_t __n) __THROW; #endif __BEGIN_NAMESPACE_STD /* Determine whether C constitutes a valid (one-byte) multibyte character. */ extern wint_t btowc(int __c) __THROW; /* Determine whether C corresponds to a member of the extended character set whose multibyte representation is a single byte. */ extern int wctob(wint_t __c) __THROW; /* Determine whether PS points to an object representing the initial state. */ extern int mbsinit(const mbstate_t * __ps) __THROW __attribute_pure__; /* Write wide character representation of multibyte character pointed to by S to PWC. */ extern size_t mbrtowc(wchar_t * __restrict __pwc, const char *__restrict __s, size_t __n, mbstate_t * __restrict __p) __THROW; /* Write multibyte representation of wide character WC to S. */ extern size_t wcrtomb(char *__restrict __s, wchar_t __wc, mbstate_t * __restrict __ps) __THROW; /* Return number of bytes in multibyte character pointed to by S. */ extern size_t __mbrlen(const char *__restrict __s, size_t __n, mbstate_t * __restrict __ps) __THROW; extern size_t mbrlen(const char *__restrict __s, size_t __n, mbstate_t * __restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_EXTERN_INLINES /* Define inline function as optimization. */ /* We can use the BTOWC and WCTOB optimizations since we know that all locales must use ASCII encoding for the values in the ASCII range and because the wchar_t encoding is always ISO 10646. */ extern wint_t __btowc_alias(int __c) __asm("btowc"); __extern_inline wint_t __NTH(btowc(int __c)) { return (__builtin_constant_p(__c) && __c >= '\0' && __c <= '\x7f' ? (wint_t) __c : __btowc_alias(__c)); } extern int __wctob_alias(wint_t __c) __asm("wctob"); __extern_inline int __NTH(wctob(wint_t __wc)) { return (__builtin_constant_p(__wc) && __wc >= L'\0' && __wc <= L'\x7f' ? (int)__wc : __wctob_alias(__wc)); } __extern_inline size_t __NTH(mbrlen(const char *__restrict __s, size_t __n, mbstate_t * __restrict __ps)) { return (__ps != NULL ? mbrtowc(NULL, __s, __n, __ps) : __mbrlen(__s, __n, NULL)); } #endif __BEGIN_NAMESPACE_STD /* Write wide character representation of multibyte character string SRC to DST. */ extern size_t mbsrtowcs(wchar_t * __restrict __dst, const char **__restrict __src, size_t __len, mbstate_t * __restrict __ps) __THROW; /* Write multibyte character representation of wide character string SRC to DST. */ extern size_t wcsrtombs(char *__restrict __dst, const wchar_t ** __restrict __src, size_t __len, mbstate_t * __restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Write wide character representation of at most NMC bytes of the multibyte character string SRC to DST. */ extern size_t mbsnrtowcs(wchar_t * __restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t * __restrict __ps) __THROW; /* Write multibyte character representation of at most NWC characters from the wide character string SRC to DST. */ extern size_t wcsnrtombs(char *__restrict __dst, const wchar_t ** __restrict __src, size_t __nwc, size_t __len, mbstate_t * __restrict __ps) __THROW; #endif /* use POSIX 2008 */ /* The following functions are extensions found in X/Open CAE. */ #ifdef __USE_XOPEN /* Determine number of column positions required for C. */ extern int wcwidth(wchar_t __c) __THROW; /* Determine number of column positions required for first N wide characters (or fewer if S ends before this) in S. */ extern int wcswidth(const wchar_t * __s, size_t __n) __THROW; #endif /* Use X/Open. */ __BEGIN_NAMESPACE_STD /* Convert initial portion of the wide string NPTR to `double' representation. */ extern double wcstod(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float wcstof(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; extern long double wcstold(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; __END_NAMESPACE_C99 #endif /* C99 */ __BEGIN_NAMESPACE_STD /* Convert initial portion of wide string NPTR to `long int' representation. */ extern long int wcstol(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long int' representation. */ extern unsigned long int wcstoul(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoll(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstoull(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; __END_NAMESPACE_C99 #endif /* ISO C99. */ #ifdef __USE_GNU /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoq(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstouq(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; #endif /* Use GNU. */ #ifdef __USE_GNU /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ # include /* Special versions of the functions above which take the locale to use as an additional parameter. */ extern long int wcstol_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, __locale_t __loc) __THROW; extern unsigned long int wcstoul_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern long long int wcstoll_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern unsigned long long int wcstoull_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, __locale_t __loc) __THROW; extern double wcstod_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, __locale_t __loc) __THROW; extern float wcstof_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, __locale_t __loc) __THROW; extern long double wcstold_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, __locale_t __loc) __THROW; #endif /* use GNU */ #ifdef __USE_XOPEN2K8 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */ extern wchar_t *wcpcpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src) __THROW; /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ extern wchar_t *wcpncpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src, size_t __n) __THROW; /* Wide character I/O functions. */ /* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces a wide character string. */ extern __FILE *open_wmemstream(wchar_t ** __bufloc, size_t * __sizeloc) __THROW; #endif #if defined __USE_ISOC95 || defined __USE_UNIX98 __BEGIN_NAMESPACE_STD /* Select orientation for stream. */ extern int fwide(__FILE * __fp, int __mode) __THROW; /* Write formatted output to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwprintf(__FILE * __restrict __stream, const wchar_t * __restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */ ; /* Write formatted output to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wprintf(const wchar_t * __restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */ ; /* Write formatted output of at most N characters to S. */ extern int swprintf(wchar_t * __restrict __s, size_t __n, const wchar_t * __restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */ ; /* Write formatted output to S from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwprintf(__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */ ; /* Write formatted output to stdout from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwprintf(const wchar_t * __restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */ ; /* Write formatted output of at most N character to S from argument list ARG. */ extern int vswprintf(wchar_t * __restrict __s, size_t __n, const wchar_t * __restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */ ; /* Read formatted input from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwscanf(__FILE * __restrict __stream, const wchar_t * __restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; /* Read formatted input from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wscanf(const wchar_t * __restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */ ; /* Read formatted input from S. */ extern int swscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; # if defined __USE_ISOC99 && !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT(fwscanf, (__FILE * __restrict __stream, const wchar_t * __restrict __format, ...), __isoc99_fwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; extern int __REDIRECT(wscanf, (const wchar_t * __restrict __format, ...), __isoc99_wscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */ ; extern int __REDIRECT_NTH(swscanf, (const wchar_t * __restrict __s, const wchar_t * __restrict __format, ...), __isoc99_swscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; # else extern int __isoc99_fwscanf(__FILE * __restrict __stream, const wchar_t * __restrict __format, ...); extern int __isoc99_wscanf(const wchar_t * __restrict __format, ...); extern int __isoc99_swscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, ...) __THROW; # define fwscanf __isoc99_fwscanf # define wscanf __isoc99_wscanf # define swscanf __isoc99_swscanf # endif # endif __END_NAMESPACE_STD #endif /* Use ISO C95, C99 and Unix98. */ #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwscanf(__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; /* Read formatted input from stdin into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwscanf(const wchar_t * __restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */ ; /* Read formatted input from S into argument list ARG. */ extern int vswscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; # if !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT extern int __REDIRECT(vfwscanf, (__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg), __isoc99_vfwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; extern int __REDIRECT(vwscanf, (const wchar_t * __restrict __format, __gnuc_va_list __arg), __isoc99_vwscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */ ; extern int __REDIRECT_NTH(vswscanf, (const wchar_t * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg), __isoc99_vswscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; # else extern int __isoc99_vfwscanf(__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg); extern int __isoc99_vwscanf(const wchar_t * __restrict __format, __gnuc_va_list __arg); extern int __isoc99_vswscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) __THROW; # define vfwscanf __isoc99_vfwscanf # define vwscanf __isoc99_vwscanf # define vswscanf __isoc99_vswscanf # endif # endif __END_NAMESPACE_C99 #endif /* Use ISO C99. */ __BEGIN_NAMESPACE_STD /* Read a character from STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fgetwc(__FILE * __stream); extern wint_t getwc(__FILE * __stream); /* Read a character from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t getwchar(void); /* Write a character to STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fputwc(wchar_t __wc, __FILE * __stream); extern wint_t putwc(wchar_t __wc, __FILE * __stream); /* Write a character to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t putwchar(wchar_t __wc); /* Get a newline-terminated wide character string of finite length from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws(wchar_t * __restrict __ws, int __n, __FILE * __restrict __stream); /* Write a string to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fputws(const wchar_t * __restrict __ws, __FILE * __restrict __stream); /* Push a character back onto the input buffer of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t ungetwc(wint_t __wc, __FILE * __stream); __END_NAMESPACE_STD #ifdef __USE_GNU /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t getwc_unlocked(__FILE * __stream); extern wint_t getwchar_unlocked(void); /* This is the wide character version of a GNU extension. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fgetwc_unlocked(__FILE * __stream); /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fputwc_unlocked(wchar_t __wc, __FILE * __stream); /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t putwc_unlocked(wchar_t __wc, __FILE * __stream); extern wint_t putwchar_unlocked(wchar_t __wc); /* This function does the same as `fgetws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws_unlocked(wchar_t * __restrict __ws, int __n, __FILE * __restrict __stream); /* This function does the same as `fputws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputws_unlocked(const wchar_t * __restrict __ws, __FILE * __restrict __stream); #endif __BEGIN_NAMESPACE_C99 /* Format TP into S according to FORMAT. Write no more than MAXSIZE wide characters and return the number of wide characters written, or 0 if it would exceed MAXSIZE. */ extern size_t wcsftime(wchar_t * __restrict __s, size_t __maxsize, const wchar_t * __restrict __format, const struct tm *__restrict __tp) __THROW; __END_NAMESPACE_C99 # ifdef __USE_GNU # include /* Similar to `wcsftime' but takes the information from the provided locale and not the global locale. */ extern size_t wcsftime_l(wchar_t * __restrict __s, size_t __maxsize, const wchar_t * __restrict __format, const struct tm *__restrict __tp, __locale_t __loc) __THROW; # endif /* The X/Open standard demands that most of the functions defined in the header must also appear here. This is probably because some X/Open members wrote their implementation before the ISO C standard was published and introduced the better solution. We have to provide these definitions for compliance reasons but we do this nonsense only if really necessary. */ #if defined __USE_UNIX98 && !defined __USE_GNU # define __need_iswxxx # include #endif /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif #ifdef __LDBL_COMPAT # include #endif __END_DECLS #endif /* _WCHAR_H defined */ #endif /* wchar.h */ /* Undefine all __need_* constants in case we are included to get those constants but the whole file was already read. */ #undef __need_mbstate_t #undef __need_wint_t ================================================ FILE: v2/headers/linux_amd64/usr/include/wctype.h ================================================ /* Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.25 * Wide character classification and mapping utilities */ #ifndef _WCTYPE_H #include #include #ifndef __need_iswxxx # define _WCTYPE_H 1 /* Get wint_t from . */ # define __need_wint_t # include /* Constant expression of type `wint_t' whose value does not correspond to any member of the extended character set. */ # ifndef WEOF # define WEOF (0xffffffffu) # endif #endif #undef __need_iswxxx /* The following part is also used in the header when compiled in the Unix98 compatibility mode. */ #ifndef __iswxxx_defined # define __iswxxx_defined 1 __BEGIN_NAMESPACE_C99 /* Scalar type that can hold values which represent locale-specific character classifications. */ typedef unsigned long int wctype_t; __END_NAMESPACE_C99 # ifndef _ISwbit /* The characteristics are stored always in network byte order (big endian). We define the bit value interpretations here dependent on the machine's byte order. */ # include # if __BYTE_ORDER == __BIG_ENDIAN # define _ISwbit(bit) (1 << (bit)) # else /* __BYTE_ORDER == __LITTLE_ENDIAN */ # define _ISwbit(bit) \ ((bit) < 8 ? (int) ((1UL << (bit)) << 24) \ : ((bit) < 16 ? (int) ((1UL << (bit)) << 8) \ : ((bit) < 24 ? (int) ((1UL << (bit)) >> 8) \ : (int) ((1UL << (bit)) >> 24)))) # endif enum { __ISwupper = 0, /* UPPERCASE. */ __ISwlower = 1, /* lowercase. */ __ISwalpha = 2, /* Alphabetic. */ __ISwdigit = 3, /* Numeric. */ __ISwxdigit = 4, /* Hexadecimal numeric. */ __ISwspace = 5, /* Whitespace. */ __ISwprint = 6, /* Printing. */ __ISwgraph = 7, /* Graphical. */ __ISwblank = 8, /* Blank (usually SPC and TAB). */ __ISwcntrl = 9, /* Control character. */ __ISwpunct = 10, /* Punctuation. */ __ISwalnum = 11, /* Alphanumeric. */ _ISwupper = _ISwbit(__ISwupper), /* UPPERCASE. */ _ISwlower = _ISwbit(__ISwlower), /* lowercase. */ _ISwalpha = _ISwbit(__ISwalpha), /* Alphabetic. */ _ISwdigit = _ISwbit(__ISwdigit), /* Numeric. */ _ISwxdigit = _ISwbit(__ISwxdigit), /* Hexadecimal numeric. */ _ISwspace = _ISwbit(__ISwspace), /* Whitespace. */ _ISwprint = _ISwbit(__ISwprint), /* Printing. */ _ISwgraph = _ISwbit(__ISwgraph), /* Graphical. */ _ISwblank = _ISwbit(__ISwblank), /* Blank (usually SPC and TAB). */ _ISwcntrl = _ISwbit(__ISwcntrl), /* Control character. */ _ISwpunct = _ISwbit(__ISwpunct), /* Punctuation. */ _ISwalnum = _ISwbit(__ISwalnum) /* Alphanumeric. */ }; # endif /* Not _ISwbit */ __BEGIN_DECLS __BEGIN_NAMESPACE_C99 /* * Wide-character classification functions: 7.15.2.1. */ /* Test for any wide character for which `iswalpha' or `iswdigit' is true. */ extern int iswalnum(wint_t __wc) __THROW; /* Test for any wide character for which `iswupper' or 'iswlower' is true, or any wide character that is one of a locale-specific set of wide-characters for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswalpha(wint_t __wc) __THROW; /* Test for any control wide character. */ extern int iswcntrl(wint_t __wc) __THROW; /* Test for any wide character that corresponds to a decimal-digit character. */ extern int iswdigit(wint_t __wc) __THROW; /* Test for any wide character for which `iswprint' is true and `iswspace' is false. */ extern int iswgraph(wint_t __wc) __THROW; /* Test for any wide character that corresponds to a lowercase letter or is one of a locale-specific set of wide characters for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswlower(wint_t __wc) __THROW; /* Test for any printing wide character. */ extern int iswprint(wint_t __wc) __THROW; /* Test for any printing wide character that is one of a locale-specific et of wide characters for which neither `iswspace' nor `iswalnum' is true. */ extern int iswpunct(wint_t __wc) __THROW; /* Test for any wide character that corresponds to a locale-specific set of wide characters for which none of `iswalnum', `iswgraph', or `iswpunct' is true. */ extern int iswspace(wint_t __wc) __THROW; /* Test for any wide character that corresponds to an uppercase letter or is one of a locale-specific set of wide character for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswupper(wint_t __wc) __THROW; /* Test for any wide character that corresponds to a hexadecimal-digit character equivalent to that performed be the functions described in the previous subclause. */ extern int iswxdigit(wint_t __wc) __THROW; /* Test for any wide character that corresponds to a standard blank wide character or a locale-specific set of wide characters for which `iswalnum' is false. */ # ifdef __USE_ISOC99 extern int iswblank(wint_t __wc) __THROW; # endif /* * Extensible wide-character classification functions: 7.15.2.2. */ /* Construct value that describes a class of wide characters identified by the string argument PROPERTY. */ extern wctype_t wctype(const char *__property) __THROW; /* Determine whether the wide-character WC has the property described by DESC. */ extern int iswctype(wint_t __wc, wctype_t __desc) __THROW; __END_NAMESPACE_C99 /* * Wide-character case-mapping functions: 7.15.3.1. */ __BEGIN_NAMESPACE_C99 /* Scalar type that can hold values which represent locale-specific character mappings. */ typedef const __int32_t *wctrans_t; __END_NAMESPACE_C99 #ifdef __USE_GNU __USING_NAMESPACE_C99(wctrans_t) #endif __BEGIN_NAMESPACE_C99 /* Converts an uppercase letter to the corresponding lowercase letter. */ extern wint_t towlower(wint_t __wc) __THROW; /* Converts an lowercase letter to the corresponding uppercase letter. */ extern wint_t towupper(wint_t __wc) __THROW; __END_NAMESPACE_C99 __END_DECLS #endif /* need iswxxx. */ /* The remaining definitions and declarations must not appear in the header. */ #ifdef _WCTYPE_H /* * Extensible wide-character mapping functions: 7.15.3.2. */ __BEGIN_DECLS __BEGIN_NAMESPACE_C99 /* Construct value that describes a mapping between wide characters identified by the string argument PROPERTY. */ extern wctrans_t wctrans(const char *__property) __THROW; /* Map the wide character WC using the mapping described by DESC. */ extern wint_t towctrans(wint_t __wc, wctrans_t __desc) __THROW; __END_NAMESPACE_C99 # ifdef __USE_XOPEN2K8 /* Declare the interface to extended locale model. */ # include /* Test for any wide character for which `iswalpha' or `iswdigit' is true. */ extern int iswalnum_l(wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character for which `iswupper' or 'iswlower' is true, or any wide character that is one of a locale-specific set of wide-characters for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswalpha_l(wint_t __wc, __locale_t __locale) __THROW; /* Test for any control wide character. */ extern int iswcntrl_l(wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character that corresponds to a decimal-digit character. */ extern int iswdigit_l(wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character for which `iswprint' is true and `iswspace' is false. */ extern int iswgraph_l(wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character that corresponds to a lowercase letter or is one of a locale-specific set of wide characters for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswlower_l(wint_t __wc, __locale_t __locale) __THROW; /* Test for any printing wide character. */ extern int iswprint_l(wint_t __wc, __locale_t __locale) __THROW; /* Test for any printing wide character that is one of a locale-specific et of wide characters for which neither `iswspace' nor `iswalnum' is true. */ extern int iswpunct_l(wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character that corresponds to a locale-specific set of wide characters for which none of `iswalnum', `iswgraph', or `iswpunct' is true. */ extern int iswspace_l(wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character that corresponds to an uppercase letter or is one of a locale-specific set of wide character for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswupper_l(wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character that corresponds to a hexadecimal-digit character equivalent to that performed be the functions described in the previous subclause. */ extern int iswxdigit_l(wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character that corresponds to a standard blank wide character or a locale-specific set of wide characters for which `iswalnum' is false. */ extern int iswblank_l(wint_t __wc, __locale_t __locale) __THROW; /* Construct value that describes a class of wide characters identified by the string argument PROPERTY. */ extern wctype_t wctype_l(const char *__property, __locale_t __locale) __THROW; /* Determine whether the wide-character WC has the property described by DESC. */ extern int iswctype_l(wint_t __wc, wctype_t __desc, __locale_t __locale) __THROW; /* * Wide-character case-mapping functions. */ /* Converts an uppercase letter to the corresponding lowercase letter. */ extern wint_t towlower_l(wint_t __wc, __locale_t __locale) __THROW; /* Converts an lowercase letter to the corresponding uppercase letter. */ extern wint_t towupper_l(wint_t __wc, __locale_t __locale) __THROW; /* Construct value that describes a mapping between wide characters identified by the string argument PROPERTY. */ extern wctrans_t wctrans_l(const char *__property, __locale_t __locale) __THROW; /* Map the wide character WC using the mapping described by DESC. */ extern wint_t towctrans_l(wint_t __wc, wctrans_t __desc, __locale_t __locale) __THROW; # endif /* Use POSIX 2008. */ __END_DECLS #endif /* __WCTYPE_H defined. */ #endif /* wctype.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/xlocale.h ================================================ /* Definition of locale datatype. Copyright (C) 1997-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _XLOCALE_H #define _XLOCALE_H 1 /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. The file and this data structure is not standardized. Don't rely on it. It can go away without warning. */ typedef struct __locale_struct { /* Note: LC_ALL is not a valid index into this array. */ struct __locale_data *__locales[13]; /* 13 = __LC_LAST. */ /* To increase the speed of this solution we add some special members. */ const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; /* Note: LC_ALL is not a valid index into this array. */ const char *__names[13]; } *__locale_t; /* POSIX 2008 makes locale_t official. */ typedef __locale_t locale_t; #endif /* xlocale.h */ ================================================ FILE: v2/headers/linux_amd64/usr/include/zconf.h ================================================ /* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-2013 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #ifndef ZCONF_H #define ZCONF_H /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. * Even better than compiling with -DZ_PREFIX would be to use configure to set * this permanently in zconf.h using "./configure --zprefix". */ #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ # define Z_PREFIX_SET /* all linked symbols */ # define _dist_code z__dist_code # define _length_code z__length_code # define _tr_align z__tr_align # define _tr_flush_bits z__tr_flush_bits # define _tr_flush_block z__tr_flush_block # define _tr_init z__tr_init # define _tr_stored_block z__tr_stored_block # define _tr_tally z__tr_tally # define adler32 z_adler32 # define adler32_combine z_adler32_combine # define adler32_combine64 z_adler32_combine64 # ifndef Z_SOLO # define compress z_compress # define compress2 z_compress2 # define compressBound z_compressBound # endif # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 # define deflate z_deflate # define deflateBound z_deflateBound # define deflateCopy z_deflateCopy # define deflateEnd z_deflateEnd # define deflateInit2_ z_deflateInit2_ # define deflateInit_ z_deflateInit_ # define deflateParams z_deflateParams # define deflatePending z_deflatePending # define deflatePrime z_deflatePrime # define deflateReset z_deflateReset # define deflateResetKeep z_deflateResetKeep # define deflateSetDictionary z_deflateSetDictionary # define deflateSetHeader z_deflateSetHeader # define deflateTune z_deflateTune # define deflate_copyright z_deflate_copyright # define get_crc_table z_get_crc_table # ifndef Z_SOLO # define gz_error z_gz_error # define gz_intmax z_gz_intmax # define gz_strwinerror z_gz_strwinerror # define gzbuffer z_gzbuffer # define gzclearerr z_gzclearerr # define gzclose z_gzclose # define gzclose_r z_gzclose_r # define gzclose_w z_gzclose_w # define gzdirect z_gzdirect # define gzdopen z_gzdopen # define gzeof z_gzeof # define gzerror z_gzerror # define gzflush z_gzflush # define gzgetc z_gzgetc # define gzgetc_ z_gzgetc_ # define gzgets z_gzgets # define gzoffset z_gzoffset # define gzoffset64 z_gzoffset64 # define gzopen z_gzopen # define gzopen64 z_gzopen64 # ifdef _WIN32 # define gzopen_w z_gzopen_w # endif # define gzprintf z_gzprintf # define gzvprintf z_gzvprintf # define gzputc z_gzputc # define gzputs z_gzputs # define gzread z_gzread # define gzrewind z_gzrewind # define gzseek z_gzseek # define gzseek64 z_gzseek64 # define gzsetparams z_gzsetparams # define gztell z_gztell # define gztell64 z_gztell64 # define gzungetc z_gzungetc # define gzwrite z_gzwrite # endif # define inflate z_inflate # define inflateBack z_inflateBack # define inflateBackEnd z_inflateBackEnd # define inflateBackInit_ z_inflateBackInit_ # define inflateCopy z_inflateCopy # define inflateEnd z_inflateEnd # define inflateGetHeader z_inflateGetHeader # define inflateInit2_ z_inflateInit2_ # define inflateInit_ z_inflateInit_ # define inflateMark z_inflateMark # define inflatePrime z_inflatePrime # define inflateReset z_inflateReset # define inflateReset2 z_inflateReset2 # define inflateSetDictionary z_inflateSetDictionary # define inflateGetDictionary z_inflateGetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateUndermine z_inflateUndermine # define inflateResetKeep z_inflateResetKeep # define inflate_copyright z_inflate_copyright # define inflate_fast z_inflate_fast # define inflate_table z_inflate_table # ifndef Z_SOLO # define uncompress z_uncompress # endif # define zError z_zError # ifndef Z_SOLO # define zcalloc z_zcalloc # define zcfree z_zcfree # endif # define zlibCompileFlags z_zlibCompileFlags # define zlibVersion z_zlibVersion /* all zlib typedefs in zlib.h and zconf.h */ # define Byte z_Byte # define Bytef z_Bytef # define alloc_func z_alloc_func # define charf z_charf # define free_func z_free_func # ifndef Z_SOLO # define gzFile z_gzFile # endif # define gz_header z_gz_header # define gz_headerp z_gz_headerp # define in_func z_in_func # define intf z_intf # define out_func z_out_func # define uInt z_uInt # define uIntf z_uIntf # define uLong z_uLong # define uLongf z_uLongf # define voidp z_voidp # define voidpc z_voidpc # define voidpf z_voidpf /* all zlib structs in zlib.h and zconf.h */ # define gz_header_s z_gz_header_s # define internal_state z_internal_state #endif #if defined(__MSDOS__) && !defined(MSDOS) # define MSDOS #endif #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) # define OS2 #endif #if defined(_WINDOWS) && !defined(WINDOWS) # define WINDOWS #endif #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) # ifndef WIN32 # define WIN32 # endif #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) # ifndef SYS16BIT # define SYS16BIT # endif # endif #endif /* * Compile with -DMAXSEG_64K if the alloc function cannot allocate more * than 64k bytes at a time (needed on systems with 16-bit int). */ #ifdef SYS16BIT # define MAXSEG_64K #endif #ifdef MSDOS # define UNALIGNED_OK #endif #ifdef __STDC_VERSION__ # ifndef STDC # define STDC # endif # if __STDC_VERSION__ >= 199901L # ifndef STDC99 # define STDC99 # endif # endif #endif #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) # define STDC #endif #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) # define STDC #endif #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) # define STDC #endif #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) # define STDC #endif #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ # define STDC #endif #ifndef STDC # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ # define const /* note: need a more gentle solution here */ # endif #endif #if defined(ZLIB_CONST) && !defined(z_const) # define z_const const #else # define z_const #endif /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL # ifdef MAXSEG_64K # define MAX_MEM_LEVEL 8 # else # define MAX_MEM_LEVEL 9 # endif #endif /* Maximum value for windowBits in deflateInit2 and inflateInit2. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files * created by gzip. (Files created by minigzip can still be extracted by * gzip.) */ #ifndef MAX_WBITS # define MAX_WBITS 15 /* 32K LZ77 window */ #endif /* The memory requirements for deflate are (in bytes): (1 << (windowBits+2)) + (1 << (memLevel+9)) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) plus a few kilobytes for small objects. For example, if you want to reduce the default memory requirements from 256K to 128K, compile with make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits that is, 32K for windowBits=15 (default value) plus a few kilobytes for small objects. */ /* Type declarations */ #ifndef OF /* function prototypes */ # ifdef STDC # define OF(args) args # else # define OF(args) () # endif #endif #ifndef Z_ARG /* function prototypes for stdarg */ # if defined(STDC) || defined(Z_HAVE_STDARG_H) # define Z_ARG(args) args # else # define Z_ARG(args) () # endif #endif /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, * just define FAR to be empty. */ #ifdef SYS16BIT # if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */ # define SMALL_MEDIUM # ifdef _MSC_VER # define FAR _far # else # define FAR far # endif # endif # if (defined(__SMALL__) || defined(__MEDIUM__)) /* Turbo C small or medium model */ # define SMALL_MEDIUM # ifdef __BORLANDC__ # define FAR _far # else # define FAR far # endif # endif #endif #if defined(WINDOWS) || defined(WIN32) /* If building or using zlib as a DLL, define ZLIB_DLL. * This is not mandatory, but it offers a little performance increase. */ # ifdef ZLIB_DLL # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) # ifdef ZLIB_INTERNAL # define ZEXTERN extern __declspec(dllexport) # else # define ZEXTERN extern __declspec(dllimport) # endif # endif # endif /* ZLIB_DLL */ /* If building or using zlib with the WINAPI/WINAPIV calling convention, * define ZLIB_WINAPI. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. */ # ifdef ZLIB_WINAPI # ifdef FAR # undef FAR # endif # include /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ # define ZEXPORT WINAPI # ifdef WIN32 # define ZEXPORTVA WINAPIV # else # define ZEXPORTVA FAR CDECL # endif # endif #endif #if defined (__BEOS__) # ifdef ZLIB_DLL # ifdef ZLIB_INTERNAL # define ZEXPORT __declspec(dllexport) # define ZEXPORTVA __declspec(dllexport) # else # define ZEXPORT __declspec(dllimport) # define ZEXPORTVA __declspec(dllimport) # endif # endif #endif #ifndef ZEXTERN # define ZEXTERN extern #endif #ifndef ZEXPORT # define ZEXPORT #endif #ifndef ZEXPORTVA # define ZEXPORTVA #endif #ifndef FAR # define FAR #endif #if !defined(__MACTYPES__) typedef unsigned char Byte; /* 8 bits */ #endif typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ #ifdef SMALL_MEDIUM /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ # define Bytef Byte FAR #else typedef Byte FAR Bytef; #endif typedef char FAR charf; typedef int FAR intf; typedef uInt FAR uIntf; typedef uLong FAR uLongf; #ifdef STDC typedef void const *voidpc; typedef void FAR *voidpf; typedef void *voidp; #else typedef Byte const *voidpc; typedef Byte FAR *voidpf; typedef Byte *voidp; #endif #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) # include # if (UINT_MAX == 0xffffffffUL) # define Z_U4 unsigned # elif (ULONG_MAX == 0xffffffffUL) # define Z_U4 unsigned long # elif (USHRT_MAX == 0xffffffffUL) # define Z_U4 unsigned short # endif #endif #ifdef Z_U4 typedef Z_U4 z_crc_t; #else typedef unsigned long z_crc_t; #endif #if 1 /* was set to #if 1 by ./configure */ # define Z_HAVE_UNISTD_H #endif #if 1 /* was set to #if 1 by ./configure */ # define Z_HAVE_STDARG_H #endif #ifdef STDC # ifndef Z_SOLO # include /* for off_t */ # endif #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) # ifndef Z_SOLO # include /* for va_list */ # endif #endif #ifdef _WIN32 # ifndef Z_SOLO # include /* for wchar_t */ # endif #endif /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even * though the former does not conform to the LFS document), but considering * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as * equivalently requesting no 64-bit operations */ #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 # undef _LARGEFILE64_SOURCE #endif #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) # define Z_HAVE_UNISTD_H #endif #ifndef Z_SOLO # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) # include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ # ifdef VMS # include /* for off_t */ # endif # ifndef z_off_t # define z_off_t off_t # endif # endif #endif #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 # define Z_LFS64 #endif #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) # define Z_LARGE64 #endif #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) # define Z_WANT64 #endif #if !defined(SEEK_SET) && !defined(Z_SOLO) # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif #ifndef z_off_t # define z_off_t long #endif #if !defined(_WIN32) && defined(Z_LARGE64) # define z_off64_t off64_t #else # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) # define z_off64_t __int64 # else # define z_off64_t z_off_t # endif #endif /* MVS linker does not support external names larger than 8 bytes */ #if defined(__MVS__) #pragma map(deflateInit_,"DEIN") #pragma map(deflateInit2_,"DEIN2") #pragma map(deflateEnd,"DEEND") #pragma map(deflateBound,"DEBND") #pragma map(inflateInit_,"ININ") #pragma map(inflateInit2_,"ININ2") #pragma map(inflateEnd,"INEND") #pragma map(inflateSync,"INSY") #pragma map(inflateSetDictionary,"INSEDI") #pragma map(compressBound,"CMBND") #pragma map(inflate_table,"INTABL") #pragma map(inflate_fast,"INFA") #pragma map(inflate_copyright,"INCOPY") #endif #endif /* ZCONF_H */ ================================================ FILE: v2/headers/linux_amd64/usr/include/zlib.h ================================================ /* zlib.h -- interface of the 'zlib' general purpose compression library version 1.2.8, April 28th, 2013 Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler jloup@gzip.org madler@alumni.caltech.edu The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). */ #ifndef ZLIB_H #define ZLIB_H #include "zconf.h" #ifdef __cplusplus extern "C" { #endif #define ZLIB_VERSION "1.2.8" #define ZLIB_VERNUM 0x1280 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 #define ZLIB_VER_REVISION 8 #define ZLIB_VER_SUBREVISION 0 /* The 'zlib' compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method (deflation) but other algorithms will be added later and will have the same stream interface. Compression can be done in a single step if the buffers are large enough, or can be done by repeated calls of the compression function. In the latter case, the application must provide more input and/or consume the output (providing more output space) before each call. The compressed data format used by default by the in-memory functions is the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped around a deflate stream, which is itself documented in RFC 1951. The library also supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. This library can optionally read and write gzip streams in memory as well. The zlib format was designed to be compact and fast for use in memory and on communications channels. The gzip format was designed for single- file compression on file systems, has a larger header than zlib to maintain directory information, and uses a different, slower check method than zlib. The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash even in case of corrupted input. */ typedef voidpf(*alloc_func) OF((voidpf opaque, uInt items, uInt size)); typedef void (*free_func) OF((voidpf opaque, voidpf address)); struct internal_state; typedef struct z_stream_s { z_const Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total number of input bytes read so far */ Bytef *next_out; /* next output byte should be put there */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total number of bytes output so far */ z_const char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ int data_type; /* best guess about the data type: binary or text */ uLong adler; /* adler32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ } z_stream; typedef z_stream FAR *z_streamp; /* gzip header information passed to and from zlib routines. See RFC 1952 for more details on the meanings of these fields. */ typedef struct gz_header_s { int text; /* true if compressed data believed to be text */ uLong time; /* modification time */ int xflags; /* extra flags (not used when writing a gzip file) */ int os; /* operating system */ Bytef *extra; /* pointer to extra field or Z_NULL if none */ uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ uInt extra_max; /* space at extra (only when reading header) */ Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ uInt name_max; /* space at name (only when reading header) */ Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ uInt comm_max; /* space at comment (only when reading header) */ int hcrc; /* true if there was or will be a header crc */ int done; /* true when done reading gzip header (not used when writing a gzip file) */ } gz_header; typedef gz_header FAR *gz_headerp; /* The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out has dropped to zero. The application must initialize zalloc, zfree and opaque before calling the init function. All other fields are set by the compression library and must not be updated by the application. The opaque value provided by the application will be passed as the first parameter for calls of zalloc and zfree. This can be useful for custom memory management. The compression library attaches no meaning to the opaque value. zalloc must return Z_NULL if there is not enough memory for the object. If zlib is used in a multi-threaded application, zalloc and zfree must be thread safe. On 16-bit systems, the functions zalloc and zfree must be able to allocate exactly 65536 bytes, but will not be required to allocate more than this if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers returned by zalloc for objects of exactly 65536 bytes *must* have their offset normalized to zero. The default allocation function provided by this library ensures this (see zutil.c). To reduce memory requirements and avoid any allocation of 64K objects, at the expense of compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). The fields total_in and total_out can be used for statistics or progress reports. After compression, total_in holds the total size of the uncompressed data and may be saved for use in the decompressor (particularly if the decompressor wants to decompress everything in a single step). */ /* constants */ #define Z_NO_FLUSH 0 #define Z_PARTIAL_FLUSH 1 #define Z_SYNC_FLUSH 2 #define Z_FULL_FLUSH 3 #define Z_FINISH 4 #define Z_BLOCK 5 #define Z_TREES 6 /* Allowed flush values; see deflate() and inflate() below for details */ #define Z_OK 0 #define Z_STREAM_END 1 #define Z_NEED_DICT 2 #define Z_ERRNO (-1) #define Z_STREAM_ERROR (-2) #define Z_DATA_ERROR (-3) #define Z_MEM_ERROR (-4) #define Z_BUF_ERROR (-5) #define Z_VERSION_ERROR (-6) /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ #define Z_NO_COMPRESSION 0 #define Z_BEST_SPEED 1 #define Z_BEST_COMPRESSION 9 #define Z_DEFAULT_COMPRESSION (-1) /* compression levels */ #define Z_FILTERED 1 #define Z_HUFFMAN_ONLY 2 #define Z_RLE 3 #define Z_FIXED 4 #define Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ #define Z_BINARY 0 #define Z_TEXT 1 #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ #define Z_UNKNOWN 2 /* Possible values of the data_type field (though see inflate()) */ #define Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ #define zlib_version zlibVersion() /* for compatibility with versions < 1.0.2 */ /* basic functions */ ZEXTERN const char *ZEXPORT zlibVersion OF((void)); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check is automatically made by deflateInit and inflateInit. */ /* ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If zalloc and zfree are set to Z_NULL, deflateInit updates them to use default allocation functions. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION requests a default compromise between speed and compression (currently equivalent to level 6). deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if level is not a valid compression level, or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); /* deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. deflate performs one or both of the following actions: - Compress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in and avail_in are updated and processing will resume at this point for the next call of deflate(). - Provide more output starting at next_out and update next_out and avail_out accordingly. This action is forced if the parameter flush is non zero. Forcing flush frequently degrades the compression ratio, so this parameter should be set only when necessary (in interactive applications). Some output may be provided even if flush is not set. Before the call of deflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating avail_in or avail_out accordingly; avail_out should never be zero before the call. The application can consume the compressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to decide how much data to accumulate before producing output, in order to maximize compression. If the parameter flush is set to Z_SYNC_FLUSH, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. (In particular avail_in is zero after the call if enough output space has been provided before the call.) Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. This completes the current deflate block and follows it with an empty stored block that is three bits plus filler bits to the next byte, followed by four bytes (00 00 ff ff). If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the output buffer, but the output is not aligned to a byte boundary. All of the input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. This completes the current deflate block and follows it with an empty fixed codes block that is 10 bits long. This assures that enough bytes are output in order for the decompressor to finish the block before the empty fixed code block. If flush is set to Z_BLOCK, a deflate block is completed and emitted, as for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to seven bits of the current block are held to be written as the next byte after the next deflate block is completed. In this case, the decompressor may not be provided enough bits at this point in order to complete decompression of the data provided so far to the compressor. It may need to wait for the next block to be emitted. This is for advanced applications that need to control the emission of deflate blocks. If flush is set to Z_FULL_FLUSH, all output is flushed as with Z_SYNC_FLUSH, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using Z_FULL_FLUSH too often can seriously degrade compression. If deflate returns with avail_out == 0, this function must be called again with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that avail_out is greater than six to avoid repeated flush markers due to avail_out == 0 on return. If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was enough output space; if deflate returns with Z_OK, this function must be called again with Z_FINISH and more output space (updated avail_out) but no more input data, until it returns with Z_STREAM_END or an error. After deflate has returned Z_STREAM_END, the only possible operations on the stream are deflateReset or deflateEnd. Z_FINISH can be used immediately after deflateInit if all the compression is to be done in a single step. In this case, avail_out must be at least the value returned by deflateBound (see below). Then deflate is guaranteed to return Z_STREAM_END. If not enough output space is provided, deflate will not return Z_STREAM_END, and it must be called again as described above. deflate() sets strm->adler to the adler32 checksum of all input read so far (that is, total_in bytes). deflate() may update strm->data_type if it can make a good guess about the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered binary. This field is only for information purposes and does not affect the compression algorithm in any manner. deflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if all input has been consumed and all output has been produced (only when flush is set to Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and deflate() can be called again with more input and more output space to continue compressing. */ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent, Z_DATA_ERROR if the stream was freed prematurely (some input or output was discarded). In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. If next_in is not Z_NULL and avail_in is large enough (the exact value depends on the compression method), inflateInit determines the compression method from the zlib header and allocates all data structures accordingly; otherwise the allocation will be deferred to the first call of inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to use default allocation functions. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit does not perform any decompression apart from possibly reading the zlib header if present: actual decompression will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unused and unchanged.) The current implementation of inflateInit() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. inflate performs one or both of the following actions: - Decompress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in is updated and processing will resume at this point for the next call of inflate(). - Provide more output starting at next_out and update next_out and avail_out accordingly. inflate() provides as much output as possible, until there is no more input data or no more space in the output buffer (see below about the flush parameter). Before the call of inflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating the next_* and avail_* values accordingly. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of inflate(). If inflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much output as possible to the output buffer. Z_BLOCK requests that inflate() stop if and when it gets to the next deflate block boundary. When decoding the zlib or gzip format, this will cause inflate() to return immediately after the header and before the first block. When doing a raw inflate, inflate() will go ahead and process the first block, and will return when it gets to the end of that block, or when it runs out of data. The Z_BLOCK option assists in appending to or combining deflate streams. Also to assist in this, on return inflate() will set strm->data_type to the number of unused bits in the last byte taken from strm->next_in, plus 64 if inflate() is currently decoding the last block in the deflate stream, plus 128 if inflate() returned immediately after decoding an end-of-block code or decoding the complete header up to just before the first byte of the deflate stream. The end-of-block will not be indicated until all of the uncompressed data from that block has been written to strm->next_out. The number of unused bits may in general be greater than seven, except when bit 7 of data_type is set, in which case the number of unused bits will be less than eight. data_type is set as noted here every time inflate() returns for all flush options, and so can be used to determine the amount of currently consumed input in bits. The Z_TREES option behaves as Z_BLOCK does, but it also returns when the end of each deflate block header is reached, before any actual data in that block is decoded. This allows the caller to determine the length of the deflate block header for later use in random access within a deflate block. 256 is added to the value of strm->data_type when inflate() returns immediately after reaching the end of the deflate block header. inflate() should normally be called until it returns Z_STREAM_END or an error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to Z_FINISH. In this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all of the uncompressed data for the operation to complete. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The use of Z_FINISH is not required to perform an inflation in one step. However it may be used to inform inflate that a faster approach can be used for the single inflate() call. Z_FINISH also informs inflate to not maintain a sliding window if the stream completes, which reduces inflate's memory footprint. If the stream does not complete, either because not all of the stream is provided or not enough output space is provided, then a sliding window will be allocated and inflate() can be called again to continue the operation as if Z_NO_FLUSH had been used. In this implementation, inflate() always flushes as much output as possible to the output buffer, and always uses the faster approach on the first call. So the effects of the flush parameter in this implementation are on the return value of inflate() as noted below, when inflate() returns early when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of memory for a sliding window when Z_FINISH is used. If a preset dictionary is needed after this call (see inflateSetDictionary below), inflate sets strm->adler to the Adler-32 checksum of the dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the Adler-32 checksum of all output produced so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described below. At the end of the stream, inflate() checks that its computed adler32 checksum is equal to that saved by the compressor and returns Z_STREAM_END only if the checksum is correct. inflate() can decompress and check either zlib-wrapped or gzip-wrapped deflate data. The header type is detected automatically, if requested when initializing with inflateInit2(). Any information contained in the gzip header is not retained, so applications that need that information should instead use raw inflate, see inflateInit2() below, or inflateBack() and perform their own processing of the gzip header and trailer. When processing gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output producted so far. The CRC-32 is checked against the gzip trailer. inflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced, Z_NEED_DICT if a preset dictionary is needed at this point, Z_DATA_ERROR if the input data was corrupted (input stream not conforming to the zlib format or incorrect check value), Z_STREAM_ERROR if the stream structure was inconsistent (for example next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no progress is possible or if there was not enough room in the output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and inflate() can be called again with more input and more output space to continue decompressing. If Z_DATA_ERROR is returned, the application may then call inflateSync() to look for a good compression block if a partial recovery of the data is desired. */ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent. In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* Advanced functions */ /* The following functions are needed only in some special applications. */ /* ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy)); This is another version of deflateInit with more compression options. The fields next_in, zalloc, zfree and opaque must be initialized before by the caller. The method parameter is the compression method. It must be Z_DEFLATED in this version of the library. The windowBits parameter is the base two logarithm of the window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. Larger values of this parameter result in better compression at the expense of memory usage. The default value is 15 if deflateInit is used instead. windowBits can also be -8..-15 for raw deflate. In this case, -windowBits determines the window size. deflate() will then generate raw deflate data with no zlib header or trailer, and will not compute an adler32 check value. windowBits can also be greater than 15 for optional gzip encoding. Add 16 to windowBits to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper. The gzip header will have no file name, no extra data, no comment, no modification time (set to zero), no header crc, and the operating system will be set to 255 (unknown). If a gzip stream is being written, strm->adler is a crc32 instead of an adler32. The memLevel parameter specifies how much memory should be allocated for the internal compression state. memLevel=1 uses minimum memory but is slow and reduces compression ratio; memLevel=9 uses maximum memory for optimal speed. The default value is 8. See zconf.h for total memory usage as a function of windowBits and memLevel. The strategy parameter is used to tune the compression algorithm. Use the value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no string match), or Z_RLE to limit match distances to one (run-length encoding). Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better. The effect of Z_FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately. Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit2 does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, const Bytef * dictionary, uInt dictLength)); /* Initializes the compression dictionary from the given byte sequence without producing any compressed output. When using the zlib format, this function must be called immediately after deflateInit, deflateInit2 or deflateReset, and before any call of deflate. When doing raw deflate, this function must be called either before any call of deflate, or immediately after the completion of a deflate block, i.e. after all input has been consumed and all output has been delivered when using any of the flush options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The compressor and decompressor must use exactly the same dictionary (see inflateSetDictionary). The dictionary should consist of strings (byte sequences) that are likely to be encountered later in the data to be compressed, with the most commonly used strings preferably put towards the end of the dictionary. Using a dictionary is most useful when the data to be compressed is short and can be predicted with good accuracy; the data can then be compressed better than with the default empty dictionary. Depending on the size of the compression data structures selected by deflateInit or deflateInit2, a part of the dictionary may in effect be discarded, for example if the dictionary is larger than the window size provided in deflateInit or deflateInit2. Thus the strings most likely to be useful should be put at the end of the dictionary, not at the front. In addition, the current implementation of deflate will use at most the window size minus 262 bytes of the provided dictionary. Upon return of this function, strm->adler is set to the adler32 value of the dictionary; the decompressor may later use this value to determine which dictionary has been used by the compressor. (The adler32 value applies to the whole dictionary even if only a subset of the dictionary is actually used by the compressor.) If a raw deflate was requested, then the adler32 value is not computed and strm->adler is not set. deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent (for example if deflate has already been called for this stream or if not at a block boundary for raw deflate). deflateSetDictionary does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when several compression strategies will be tried, for example when there are several ways of pre-processing the input data with a filter. The streams that will be discarded should then be freed by calling deflateEnd. Note that deflateCopy duplicates the internal compression state which can be quite large, so this strategy is slow and can consume lots of memory. deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate all the internal compression state. The stream will keep the same compression level and any other attributes that may have been set by deflateInit2. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, int level, int strategy)); /* Dynamically update the compression level and compression strategy. The interpretation of level and strategy is as in deflateInit2. This can be used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression level is changed, the input available so far is compressed with the old level (and may be flushed); the new level will take effect only at the next call of deflate(). Before the call of deflateParams, the stream state must be set as for a call of deflate(), since the currently available input may have to be compressed and flushed. In particular, strm->avail_out must be non-zero. deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if strm->avail_out was zero. */ ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)); /* Fine tune deflate's internal compression parameters. This should only be used by someone who understands the algorithm used by zlib's deflate for searching for the best matching string, and even then only by the most fanatic optimizer trying to squeeze out the last compressed bit for their specific input data. Read the deflate.c source code for the meaning of the max_lazy, good_length, nice_length, and max_chain parameters. deflateTune() can be called after deflateInit() or deflateInit2(), and returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. */ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, uLong sourceLen)); /* deflateBound() returns an upper bound on the compressed size after deflation of sourceLen bytes. It must be called after deflateInit() or deflateInit2(), and after deflateSetHeader(), if used. This would be used to allocate an output buffer for deflation in a single pass, and so would be called before deflate(). If that first deflate() call is provided the sourceLen input bytes, an output buffer allocated to the size returned by deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed to return Z_STREAM_END. Note that it is possible for the compressed size to be larger than the value returned by deflateBound() if flush options other than Z_FINISH or Z_NO_FLUSH are used. */ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, unsigned *pending, int *bits)); /* deflatePending() returns the number of bytes and bits of output that have been generated, but not yet provided in the available output. The bytes not provided would be due to the available output space having being consumed. The number of bits of output not provided are between 0 and 7, where they await more bits to join them in order to fill out a full byte. If pending or bits are Z_NULL, then those values are not set. deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, int bits, int value)); /* deflatePrime() inserts bits in the deflate output stream. The intent is that this function is used to start off the deflate output with the bits leftover from a previous deflate stream when appending to it. As such, this function can only be used for raw deflate, and must be used before the first deflate() call after a deflateInit2() or deflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the output. deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, gz_headerp head)); /* deflateSetHeader() provides gzip header information for when a gzip stream is requested by deflateInit2(). deflateSetHeader() may be called after deflateInit2() or deflateReset() and before the first call of deflate(). The text, time, os, extra field, name, and comment information in the provided gz_header structure are written to the gzip header (xflag is ignored -- the extra flags are set according to the compression level). The caller must assure that, if not Z_NULL, name and comment are terminated with a zero byte, and that if extra is not Z_NULL, that extra_len bytes are available there. If hcrc is true, a gzip header crc is included. Note that the current versions of the command-line version of gzip (up through version 1.3.x) do not support header crc's, and will report that it is a "multi-part gzip file" and give up. If deflateSetHeader is not used, the default gzip header has text false, the time set to zero, and os set to 255, with no extra, name, or comment fields. The gzip header is returned to the default state by deflateReset(). deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, int windowBits)); This is another version of inflateInit with an extra parameter. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. The windowBits parameter is the base two logarithm of the maximum window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. The default value is 15 if inflateInit is used instead. windowBits must be greater than or equal to the windowBits value provided to deflateInit2() while compressing, or it must be equal to 15 if deflateInit2() was not used. If a compressed stream with a larger window size is given as input, inflate() will return with the error code Z_DATA_ERROR instead of trying to allocate a larger window. windowBits can also be zero to request that inflate use the window size in the zlib header of the compressed stream. windowBits can also be -8..-15 for raw inflate. In this case, -windowBits determines the window size. inflate() will then process raw deflate data, not looking for a zlib or gzip header, not generating a check value, and not looking for any check values for comparison at the end of the stream. This is for use with other formats that use the deflate compressed data format such as zip. Those formats provide their own check values. If a custom format is developed using the raw deflate format for compressed data, it is recommended that a check value such as an adler32 or a crc32 be applied to the uncompressed data as is done in the zlib, gzip, and zip formats. For most applications, the zlib format should be used as is. Note that comments above on the use in deflateInit2() applies to the magnitude of windowBits. windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a crc32 instead of an adler32. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit2 does not perform any decompression apart from possibly reading the zlib header if present: actual decompression will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unused and unchanged.) The current implementation of inflateInit2() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, const Bytef * dictionary, uInt dictLength)); /* Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the adler32 value returned by that call of inflate. The compressor and decompressor must use exactly the same dictionary (see deflateSetDictionary). For raw inflate, this function can be called at any time to set the dictionary. If the provided dictionary is smaller than the window and there is already data in the window, then the provided dictionary will amend what's there. The application must insure that the dictionary that was used for compression is provided. inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the expected one (incorrect adler32 value). inflateSetDictionary does not perform any decompression: this will be done by subsequent calls of inflate(). */ ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, Bytef * dictionary, uInt * dictLength)); /* Returns the sliding dictionary being maintained by inflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied to dictionary. dictionary must have enough space, where 32768 bytes is always enough. If inflateGetDictionary() is called with dictionary equal to Z_NULL, then only the dictionary length is returned, and nothing is copied. Similary, if dictLength is Z_NULL, then it is not set. inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the stream state is inconsistent. */ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); /* Skips invalid compressed data until a possible full flush point (see above for the description of deflate with Z_FULL_FLUSH) can be found, or until all available input is skipped. No output is provided. inflateSync searches for a 00 00 FF FF pattern in the compressed data. All full flush points have this pattern, but not all occurrences of this pattern are full flush points. inflateSync returns Z_OK if a possible full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the success case, the application may save the current current value of total_in which indicates where valid compressed data was found. In the error case, the application may repeatedly call inflateSync, providing more input each time, until success or end of the input data. */ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when randomly accessing a large stream. The first pass through the stream can periodically record the inflate state, allowing restarting inflate at those points when randomly accessing the stream. inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate all the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, int windowBits)); /* This function is the same as inflateReset, but it also permits changing the wrap and window size requests. The windowBits parameter is interpreted the same as it is for inflateInit2. inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL), or if the windowBits parameter is invalid. */ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, int bits, int value)); /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the middle of a byte. The provided bits will be used before any bytes are used from next_in. This function should only be used with raw inflate, and should be used before the first inflate() call after inflateInit2() or inflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the input. If bits is negative, then the input stream bit buffer is emptied. Then inflatePrime() can be called again to put bits in the buffer. This is used to clear out bits leftover after feeding inflate a block description prior to feeding inflate codes. inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); /* This function returns two values, one in the lower 16 bits of the return value, and the other in the remaining upper bits, obtained by shifting the return value down 16 bits. If the upper value is -1 and the lower value is zero, then inflate() is currently decoding information outside of a block. If the upper value is -1 and the lower value is non-zero, then inflate is in the middle of a stored block, with the lower value equaling the number of bytes from the input remaining to copy. If the upper value is not -1, then it is the number of bits back from the current bit position in the input of the code (literal or length/distance pair) currently being processed. In that case the lower value is the number of bytes already emitted for that code. A code is being processed if inflate is waiting for more input to complete decoding of the code, or if it has completed decoding but is waiting for more output space to write the literal or match data. inflateMark() is used to mark locations in the input data for random access, which may be at bit positions, and to note those cases where the output of a code may span boundaries of random access blocks. The current location in the input stream can be determined from avail_in and data_type as noted in the description for the Z_BLOCK flush parameter for inflate. inflateMark returns the value noted above or -1 << 16 if the provided source stream state was inconsistent. */ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, gz_headerp head)); /* inflateGetHeader() requests that gzip header information be stored in the provided gz_header structure. inflateGetHeader() may be called after inflateInit2() or inflateReset(), and before the first call of inflate(). As inflate() processes the gzip stream, head->done is zero until the header is completed, at which time head->done is set to one. If a zlib stream is being decoded, then head->done is set to -1 to indicate that there will be no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be used to force inflate() to return immediately after header processing is complete and before any actual data is decompressed. The text, time, xflags, and os fields are filled in with the gzip header contents. hcrc is set to true if there is a header CRC. (The header CRC was valid if done is set to one.) If extra is not Z_NULL, then extra_max contains the maximum number of bytes to write to extra. Once done is true, extra_len contains the actual extra field length, and extra contains the extra field, or that field truncated if extra_max is less than extra_len. If name is not Z_NULL, then up to name_max characters are written there, terminated with a zero unless the length is greater than name_max. If comment is not Z_NULL, then up to comm_max characters are written there, terminated with a zero unless the length is greater than comm_max. When any of extra, name, or comment are not Z_NULL and the respective field is not present in the header, then that field is set to Z_NULL to signal its absence. This allows the use of deflateSetHeader() with the returned structure to duplicate the header. However if those fields are set to allocated memory, then the application will need to save those pointers elsewhere so that they can be eventually freed. If inflateGetHeader is not used, then the header information is simply discarded. The header is always checked for validity, including the header CRC if present. inflateReset() will reset the process to discard the header information. The application would need to call inflateGetHeader() again to retrieve the header from the next gzip stream. inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, unsigned char FAR *window)); Initialize the internal stream state for decompression using inflateBack() calls. The fields zalloc, zfree and opaque in strm must be initialized before the call. If zalloc and zfree are Z_NULL, then the default library- derived memory allocation routines are used. windowBits is the base two logarithm of the window size, in the range 8..15. window is a caller supplied buffer of that size. Except for special applications where it is assured that deflate was used with small window sizes, windowBits must be 15 and a 32K byte window must be supplied to be able to decompress general deflate streams. See inflateBack() for the usage of these routines. inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of the parameters are invalid, Z_MEM_ERROR if the internal state could not be allocated, or Z_VERSION_ERROR if the version of the library does not match the version of the header file. */ typedef unsigned (*in_func) OF((void FAR *, z_const unsigned char FAR * FAR *)); typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, in_func in, void FAR * in_desc, out_func out, void FAR * out_desc)); /* inflateBack() does a raw inflate with a single call using a call-back interface for input and output. This is potentially more efficient than inflate() for file i/o applications, in that it avoids copying between the output and the sliding window by simply making the window itself the output buffer. inflate() can be faster on modern CPUs when used with large buffers. inflateBack() trusts the application to not change the output buffer passed by the output function, at least until inflateBack() returns. inflateBackInit() must be called first to allocate the internal state and to initialize the state with the user-provided window buffer. inflateBack() may then be used multiple times to inflate a complete, raw deflate stream with each call. inflateBackEnd() is then called to free the allocated state. A raw deflate stream is one with no zlib or gzip header or trailer. This routine would normally be used in a utility that reads zip or gzip files and writes out uncompressed files. The utility would decode the header and process the trailer on its own, hence this routine expects only the raw deflate stream to decompress. This is different from the normal behavior of inflate(), which expects either a zlib or gzip header and trailer around the deflate stream. inflateBack() uses two subroutines supplied by the caller that are then called by inflateBack() for input and output. inflateBack() calls those routines until it reads a complete deflate stream and writes out all of the uncompressed data, or until it encounters an error. The function's parameters and return types are defined above in the in_func and out_func typedefs. inflateBack() will call in(in_desc, &buf) which should return the number of bytes of provided input, and a pointer to that input in buf. If there is no input available, in() must return zero--buf is ignored in that case--and inflateBack() will return a buffer error. inflateBack() will call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() should return zero on success, or non-zero on failure. If out() returns non-zero, inflateBack() will return with an error. Neither in() nor out() are permitted to change the contents of the window provided to inflateBackInit(), which is also the buffer that out() uses to write from. The length written by out() will be at most the window size. Any non-zero amount of input may be provided by in(). For convenience, inflateBack() can be provided input on the first call by setting strm->next_in and strm->avail_in. If that input is exhausted, then in() will be called. Therefore strm->next_in must be initialized before calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in must also be initialized, and then if strm->avail_in is not zero, input will initially be taken from strm->next_in[0 .. strm->avail_in - 1]. The in_desc and out_desc parameters of inflateBack() is passed as the first parameter of in() and out() respectively when they are called. These descriptors can be optionally used to pass any information that the caller- supplied in() and out() functions need to do their job. On return, inflateBack() will set strm->next_in and strm->avail_in to pass back any unused input that was provided by the last in() call. The return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR if in() or out() returned an error, Z_DATA_ERROR if there was a format error in the deflate stream (in which case strm->msg is set to indicate the nature of the error), or Z_STREAM_ERROR if the stream was not properly initialized. In the case of Z_BUF_ERROR, an input or output error can be distinguished using strm->next_in which will be Z_NULL only if in() returned an error. If strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning non-zero. (in() will always be called before out(), so strm->next_in is assured to be defined if out() returns non-zero.) Note that inflateBack() cannot return Z_OK. */ ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); /* All memory allocated by inflateBackInit() is freed. inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream state was inconsistent. */ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); /* Return flags indicating compile-time options. Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: 1.0: size of uInt 3.2: size of uLong 5.4: size of voidpf (pointer) 7.6: size of z_off_t Compiler, assembler, and debug options: 8: DEBUG 9: ASMV or ASMINF -- use ASM code 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention 11: 0 (reserved) One-time table building (smaller code, but not thread-safe if true): 12: BUILDFIXED -- build static block decoding tables when needed 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed 14,15: 0 (reserved) Library content (indicates missing functionality): 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking deflate code when not needed) 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect and decode gzip streams (to avoid linking crc code) 18-19: 0 (reserved) Operation variations (changes in library functionality): 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate 21: FASTEST -- deflate algorithm with only one, lowest compression level 22,23: 0 (reserved) The sprintf variant used by gzprintf (zero is best): 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! 26: 0 = returns value, 1 = void -- 1 means inferred string length returned Remainder: 27-31: 0 (reserved) */ #ifndef Z_SOLO /* utility functions */ /* The following utility functions are implemented on top of the basic stream-oriented functions. To simplify the interface, some default options are assumed (compression level and memory usage, standard memory allocation functions). The source code of these utility functions can be modified if you need special options. */ ZEXTERN int ZEXPORT compress OF((Bytef * dest, uLongf * destLen, const Bytef * source, uLong sourceLen)); /* Compresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed buffer. compress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer. */ ZEXTERN int ZEXPORT compress2 OF((Bytef * dest, uLongf * destLen, const Bytef * source, uLong sourceLen, int level)); /* Compresses the source buffer into the destination buffer. The level parameter has the same meaning as in deflateInit. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed buffer. compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); /* compressBound() returns an upper bound on the compressed size after compress() or compress2() on sourceLen bytes. It would be used before a compress() or compress2() call to allocate the destination buffer. */ ZEXTERN int ZEXPORT uncompress OF((Bytef * dest, uLongf * destLen, const Bytef * source, uLong sourceLen)); /* Decompresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be large enough to hold the entire uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some mechanism outside the scope of this compression library.) Upon exit, destLen is the actual size of the uncompressed buffer. uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In the case where there is not enough room, uncompress() will fill the output buffer with the uncompressed data up to that point. */ /* gzip file access functions */ /* This library supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio, using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. */ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ /* ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); Opens a gzip (.gz) file for reading or writing. The mode parameter is as in fopen ("rb" or "wb") but can also include a compression level ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression as in "wb9F". (See the description of deflateInit2 for more information about the strategy parameter.) 'T' will request transparent writing or appending with no compression and not using the gzip format. "a" can be used instead of "w" to request that the gzip stream that will be written be appended to the file. "+" will result in an error, since reading and writing to the same gzip file is not supported. The addition of "x" when writing will create the file exclusively, which fails if the file already exists. On systems that support it, the addition of "e" when reading or writing will set the flag to close the file on an execve() call. These functions, as well as gzip, will read and decode a sequence of gzip streams in a file. The append function of gzopen() can be used to create such a file. (Also see gzflush() for another way to do this.) When appending, gzopen does not test whether the file begins with a gzip stream, nor does it look for the end of the gzip streams to begin appending. gzopen will simply append a gzip stream to the existing file. gzopen can be used to read a file which is not in gzip format; in this case gzread will directly read from the file without decompression. When reading, this will be detected automatically by looking for the magic two- byte gzip header. gzopen returns NULL if the file could not be opened, if there was insufficient memory to allocate the gzFile state, or if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). errno can be checked to determine if the reason gzopen failed was that the file could not be opened. */ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); /* gzdopen associates a gzFile with the file descriptor fd. File descriptors are obtained from calls like open, dup, creat, pipe or fileno (if the file has been previously opened with fopen). The mode parameter is as in gzopen. The next call of gzclose on the returned gzFile will also close the file descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, mode);. The duplicated descriptor should be saved to avoid a leak, since gzdopen does not close fd if it fails. If you are using fileno() to get the file descriptor from a FILE *, then you will have to use dup() to avoid double-close()ing the file descriptor. Both gzclose() and fclose() will close the associated file descriptor, so they need to have different file descriptors. gzdopen returns NULL if there was insufficient memory to allocate the gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided), or if fd is -1. The file descriptor is not used until the next gz* read, write, seek, or close operation, so gzdopen will not detect if fd is invalid (unless fd is -1). */ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); /* Set the internal buffer size used by this library's functions. The default buffer size is 8192 bytes. This function must be called after gzopen() or gzdopen(), and before any other calls that read or write the file. The buffer memory allocation is always deferred to the first read or write. Two buffers are allocated, either both of the specified size when writing, or one of the specified size and the other twice that size when reading. A larger buffer size of, for example, 64K or 128K bytes will noticeably increase the speed of decompression (reading). The new buffer size also affects the maximum length for gzprintf(). gzbuffer() returns 0 on success, or -1 on failure, such as being called too late. */ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); /* Dynamically update the compression level or strategy. See the description of deflateInit2 for the meaning of these parameters. gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not opened for writing. */ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); /* Reads the given number of uncompressed bytes from the compressed file. If the input file is not in gzip format, gzread copies the given number of bytes into the buffer directly from the file. After reaching the end of a gzip stream in the input, gzread will continue to read, looking for another gzip stream. Any number of gzip streams may be concatenated in the input file, and will all be decompressed by gzread(). If something other than a gzip stream is encountered after a gzip stream, that remaining trailing garbage is ignored (and no error is returned). gzread can be used to read a gzip file that is being concurrently written. Upon reaching the end of the input, gzread will return with the available data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then gzclearerr can be used to clear the end of file indicator in order to permit gzread to be tried again. Z_OK indicates that a gzip stream was completed on the last gzread. Z_BUF_ERROR indicates that the input file ended in the middle of a gzip stream. Note that gzread does not return -1 in the event of an incomplete gzip stream. This error is deferred until gzclose(), which will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip stream. Alternatively, gzerror can be used before gzclose to detect this case. gzread returns the number of uncompressed bytes actually read, less than len for end of file, or -1 for error. */ ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); /* Writes the given number of uncompressed bytes into the compressed file. gzwrite returns the number of uncompressed bytes written or 0 in case of error. */ ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)) #ifdef __GNUC__ __attribute__ ((__format__(__printf__, 2, 3))) #endif ; /* Converts, formats, and writes the arguments to the compressed file under control of the format string, as in fprintf. gzprintf returns the number of uncompressed bytes actually written, or 0 in case of error. The number of uncompressed bytes written is limited to 8191, or one less than the buffer size given to gzbuffer(). The caller should assure that this limit is not exceeded. If it is exceeded, then gzprintf() will return an error (0) with nothing written. In this case, there may also be a buffer overflow with unpredictable consequences, which is possible only if zlib was compiled with the insecure functions sprintf() or vsprintf() because the secure snprintf() or vsnprintf() functions were not available. This can be determined using zlibCompileFlags(). */ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); /* Writes the given null-terminated string to the compressed file, excluding the terminating null character. gzputs returns the number of characters written, or -1 in case of error. */ ZEXTERN char *ZEXPORT gzgets OF((gzFile file, char *buf, int len)); /* Reads bytes from the compressed file until len-1 characters are read, or a newline character is read and transferred to buf, or an end-of-file condition is encountered. If any characters are read or if len == 1, the string is terminated with a null character. If no characters are read due to an end-of-file or len < 1, then the buffer is left untouched. gzgets returns buf which is a null-terminated string, or it returns NULL for end-of-file or in case of error. If there was an error, the contents at buf are indeterminate. */ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); /* Writes c, converted to an unsigned char, into the compressed file. gzputc returns the value that was written, or -1 in case of error. */ ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); /* Reads one byte from the compressed file. gzgetc returns this byte or -1 in case of end of file or error. This is implemented as a macro for speed. As such, it does not do all of the checking the other functions do. I.e. it does not check to see if file is NULL, nor whether the structure file points to has been clobbered or not. */ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); /* Push one character back onto the stream to be read as the first character on the next read. At least one character of push-back is allowed. gzungetc() returns the character pushed, or -1 on failure. gzungetc() will fail if c is -1, and may fail if a character has been pushed but not read yet. If gzungetc is used immediately after gzopen or gzdopen, at least the output buffer size of pushed characters is allowed. (See gzbuffer above.) The pushed character will be discarded if the stream is repositioned with gzseek() or gzrewind(). */ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); /* Flushes all pending output into the compressed file. The parameter flush is as in the deflate() function. The return value is the zlib error number (see function gzerror below). gzflush is only permitted when writing. If the flush parameter is Z_FINISH, the remaining data is written and the gzip stream is completed in the output. If gzwrite() is called again, a new gzip stream will be started in the output. gzread() is able to read such concatented gzip streams. gzflush should be called only when strictly necessary because it will degrade compression if called too often. */ /* ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, z_off_t offset, int whence)); Sets the starting position for the next gzread or gzwrite on the given compressed file. The offset represents a number of bytes in the uncompressed data stream. The whence parameter is defined as in lseek(2); the value SEEK_END is not supported. If the file is opened for reading, this function is emulated but can be extremely slow. If the file is opened for writing, only forward seeks are supported; gzseek then compresses a sequence of zeroes up to the new starting position. gzseek returns the resulting offset location as measured in bytes from the beginning of the uncompressed stream, or -1 in case of error, in particular if the file is opened for writing and the new starting position would be before the current position. */ ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); /* Rewinds the given file. This function is supported only for reading. gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) */ /* ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); Returns the starting position for the next gzread or gzwrite on the given compressed file. This position represents a number of bytes in the uncompressed data stream, and is zero when starting, even if appending or reading a gzip stream from the middle of a file using gzdopen(). gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) */ /* ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); Returns the current offset in the file being read or written. This offset includes the count of bytes that precede the gzip stream, for example when appending or when using gzdopen() for reading. When reading, the offset does not include as yet unused buffered input. This information can be used for a progress indicator. On error, gzoffset() returns -1. */ ZEXTERN int ZEXPORT gzeof OF((gzFile file)); /* Returns true (1) if the end-of-file indicator has been set while reading, false (0) otherwise. Note that the end-of-file indicator is set only if the read tried to go past the end of the input, but came up short. Therefore, just like feof(), gzeof() may return false even if there is no more data to read, in the event that the last read request was for the exact number of bytes remaining in the input file. This will happen if the input file size is an exact multiple of the buffer size. If gzeof() returns true, then the read functions will return no more data, unless the end-of-file indicator is reset by gzclearerr() and the input file has grown since the previous end of file was detected. */ ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); /* Returns true (1) if file is being copied directly while reading, or false (0) if file is a gzip stream being decompressed. If the input file is empty, gzdirect() will return true, since the input does not contain a gzip stream. If gzdirect() is used immediately after gzopen() or gzdopen() it will cause buffers to be allocated to allow reading the file to determine if it is a gzip file. Therefore if gzbuffer() is used, it should be called before gzdirect(). When writing, gzdirect() returns true (1) if transparent writing was requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: gzdirect() is not needed when writing. Transparent writing must be explicitly requested, so the application already knows the answer. When linking statically, using gzdirect() will include all of the zlib code for gzip file reading and decompression, which may not be desired.) */ ZEXTERN int ZEXPORT gzclose OF((gzFile file)); /* Flushes all pending output if necessary, closes the compressed file and deallocates the (de)compression state. Note that once file is closed, you cannot call gzerror with file, since its structures have been deallocated. gzclose must not be called more than once on the same file, just as free must not be called more than once on the same allocation. gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the last read ended in the middle of a gzip stream, or Z_OK on success. */ ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); /* Same as gzclose(), but gzclose_r() is only for use when reading, and gzclose_w() is only for use when writing or appending. The advantage to using these instead of gzclose() is that they avoid linking in zlib compression or decompression code that is not used when only reading or only writing respectively. If gzclose() is used, then both compression and decompression code will be included the application when linking to a static zlib library. */ ZEXTERN const char *ZEXPORT gzerror OF((gzFile file, int *errnum)); /* Returns the error message for the last error which occurred on the given compressed file. errnum is set to zlib error number. If an error occurred in the file system and not in the compression library, errnum is set to Z_ERRNO and the application may consult errno to get the exact error code. The application must not modify the returned string. Future calls to this function may invalidate the previously returned string. If file is closed, then the string previously returned by gzerror will no longer be available. gzerror() should be used to distinguish errors from end-of-file for those functions above that do not distinguish those cases in their return values. */ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); /* Clears the error and end-of-file flags for file. This is analogous to the clearerr() function in stdio. This is useful for continuing to read a gzip file that is being written concurrently. */ #endif /* !Z_SOLO */ /* checksum functions */ /* These functions are not related to compression but are exported anyway because they might be useful in applications using the compression library. */ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef * buf, uInt len)); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. If buf is Z_NULL, this function returns the required initial value for the checksum. An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much faster. Usage example: uLong adler = adler32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { adler = adler32(adler, buffer, length); } if (adler != original_adler) error(); */ /* ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, z_off_t len2)); Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note that the z_off_t type (like off_t) is a signed integer. If len2 is negative, the result has no meaning or utility. */ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef * buf, uInt len)); /* Update a running CRC-32 with the bytes buf[0..len-1] and return the updated CRC-32. If buf is Z_NULL, this function returns the required initial value for the crc. Pre- and post-conditioning (one's complement) is performed within this function so it shouldn't be done by the application. Usage example: uLong crc = crc32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { crc = crc32(crc, buffer, length); } if (crc != original_crc) error(); */ /* ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); Combine two CRC-32 check values into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and len2. */ /* various hacks, don't look :) */ /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, const char *version, int stream_size)); ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, unsigned char FAR * window, const char *version, int stream_size)); #define deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) #define inflateInit(strm) \ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) #define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) #define inflateInit2(strm, windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ (int)sizeof(z_stream)) #define inflateBackInit(strm, windowBits, window) \ inflateBackInit_((strm), (windowBits), (window), \ ZLIB_VERSION, (int)sizeof(z_stream)) #ifndef Z_SOLO /* gzgetc() macro and its supporting function and exposed data structure. Note * that the real internal state is much larger than the exposed structure. * This abbreviated structure exposes just enough for the gzgetc() macro. The * user should not mess with these exposed elements, since their names or * behavior could change in the future, perhaps even capriciously. They can * only be used by the gzgetc() macro. You have been warned. */ struct gzFile_s { unsigned have; unsigned char *next; z_off64_t pos; }; ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ #ifdef Z_PREFIX_SET # undef z_gzgetc # define z_gzgetc(g) \ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) #else # define gzgetc(g) \ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) #endif /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if * both are true, the application gets the *64 functions, and the regular * functions are changed to 64 bits) -- in case these are set on systems * without large file support, _LFS64_LARGEFILE must also be true */ #ifdef Z_LARGE64 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); #endif #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) # ifdef Z_PREFIX_SET # define z_gzopen z_gzopen64 # define z_gzseek z_gzseek64 # define z_gztell z_gztell64 # define z_gzoffset z_gzoffset64 # define z_adler32_combine z_adler32_combine64 # define z_crc32_combine z_crc32_combine64 # else # define gzopen gzopen64 # define gzseek gzseek64 # define gztell gztell64 # define gzoffset gzoffset64 # define adler32_combine adler32_combine64 # define crc32_combine crc32_combine64 # endif # ifndef Z_LARGE64 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); # endif #else ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); #endif #else /* Z_SOLO */ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); #endif /* !Z_SOLO */ /* undocumented functions */ ZEXTERN const char *ZEXPORT zError OF((int)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); ZEXTERN const z_crc_t FAR *ZEXPORT get_crc_table OF((void)); ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); #if defined(_WIN32) && !defined(Z_SOLO) ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t * path, const char *mode)); #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) # ifndef Z_SOLO ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, const char *format, va_list va)); # endif #endif #ifdef __cplusplus } #endif #endif /* ZLIB_H */ ================================================ FILE: v2/headers/linux_amd64/usr/lib64/gcc/x86_64-suse-linux/4.8/include/float.h ================================================ /* Copyright (C) 2002-2013 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* * ISO C Standard: 5.2.4.2.2 Characteristics of floating types */ #ifndef _FLOAT_H___ #define _FLOAT_H___ /* Radix of exponent representation, b. */ #undef FLT_RADIX #define FLT_RADIX __FLT_RADIX__ /* Number of base-FLT_RADIX digits in the significand, p. */ #undef FLT_MANT_DIG #undef DBL_MANT_DIG #undef LDBL_MANT_DIG #define FLT_MANT_DIG __FLT_MANT_DIG__ #define DBL_MANT_DIG __DBL_MANT_DIG__ #define LDBL_MANT_DIG __LDBL_MANT_DIG__ /* Number of decimal digits, q, such that any floating-point number with q decimal digits can be rounded into a floating-point number with p radix b digits and back again without change to the q decimal digits, p * log10(b) if b is a power of 10 floor((p - 1) * log10(b)) otherwise */ #undef FLT_DIG #undef DBL_DIG #undef LDBL_DIG #define FLT_DIG __FLT_DIG__ #define DBL_DIG __DBL_DIG__ #define LDBL_DIG __LDBL_DIG__ /* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */ #undef FLT_MIN_EXP #undef DBL_MIN_EXP #undef LDBL_MIN_EXP #define FLT_MIN_EXP __FLT_MIN_EXP__ #define DBL_MIN_EXP __DBL_MIN_EXP__ #define LDBL_MIN_EXP __LDBL_MIN_EXP__ /* Minimum negative integer such that 10 raised to that power is in the range of normalized floating-point numbers, ceil(log10(b) * (emin - 1)) */ #undef FLT_MIN_10_EXP #undef DBL_MIN_10_EXP #undef LDBL_MIN_10_EXP #define FLT_MIN_10_EXP __FLT_MIN_10_EXP__ #define DBL_MIN_10_EXP __DBL_MIN_10_EXP__ #define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ /* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */ #undef FLT_MAX_EXP #undef DBL_MAX_EXP #undef LDBL_MAX_EXP #define FLT_MAX_EXP __FLT_MAX_EXP__ #define DBL_MAX_EXP __DBL_MAX_EXP__ #define LDBL_MAX_EXP __LDBL_MAX_EXP__ /* Maximum integer such that 10 raised to that power is in the range of representable finite floating-point numbers, floor(log10((1 - b**-p) * b**emax)) */ #undef FLT_MAX_10_EXP #undef DBL_MAX_10_EXP #undef LDBL_MAX_10_EXP #define FLT_MAX_10_EXP __FLT_MAX_10_EXP__ #define DBL_MAX_10_EXP __DBL_MAX_10_EXP__ #define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ /* Maximum representable finite floating-point number, (1 - b**-p) * b**emax */ #undef FLT_MAX #undef DBL_MAX #undef LDBL_MAX #define FLT_MAX __FLT_MAX__ #define DBL_MAX __DBL_MAX__ #define LDBL_MAX __LDBL_MAX__ /* The difference between 1 and the least value greater than 1 that is representable in the given floating point type, b**1-p. */ #undef FLT_EPSILON #undef DBL_EPSILON #undef LDBL_EPSILON #define FLT_EPSILON __FLT_EPSILON__ #define DBL_EPSILON __DBL_EPSILON__ #define LDBL_EPSILON __LDBL_EPSILON__ /* Minimum normalized positive floating-point number, b**(emin - 1). */ #undef FLT_MIN #undef DBL_MIN #undef LDBL_MIN #define FLT_MIN __FLT_MIN__ #define DBL_MIN __DBL_MIN__ #define LDBL_MIN __LDBL_MIN__ /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */ /* ??? This is supposed to change with calls to fesetround in . */ #undef FLT_ROUNDS #define FLT_ROUNDS 1 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* The floating-point expression evaluation method. -1 indeterminate 0 evaluate all operations and constants just to the range and precision of the type 1 evaluate operations and constants of type float and double to the range and precision of the double type, evaluate long double operations and constants to the range and precision of the long double type 2 evaluate all operations and constants to the range and precision of the long double type ??? This ought to change with the setting of the fp control word; the value provided by the compiler assumes the widest setting. */ #undef FLT_EVAL_METHOD #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ /* Number of decimal digits, n, such that any floating-point number in the widest supported floating type with pmax radix b digits can be rounded to a floating-point number with n decimal digits and back again without change to the value, pmax * log10(b) if b is a power of 10 ceil(1 + pmax * log10(b)) otherwise */ #undef DECIMAL_DIG #define DECIMAL_DIG __DECIMAL_DIG__ #endif /* C99 */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L /* Versions of DECIMAL_DIG for each floating-point type. */ #undef FLT_DECIMAL_DIG #undef DBL_DECIMAL_DIG #undef LDBL_DECIMAL_DIG #define FLT_DECIMAL_DIG __FLT_DECIMAL_DIG__ #define DBL_DECIMAL_DIG __DBL_DECIMAL_DIG__ #define LDBL_DECIMAL_DIG __DECIMAL_DIG__ /* Whether types support subnormal numbers. */ #undef FLT_HAS_SUBNORM #undef DBL_HAS_SUBNORM #undef LDBL_HAS_SUBNORM #define FLT_HAS_SUBNORM __FLT_HAS_DENORM__ #define DBL_HAS_SUBNORM __DBL_HAS_DENORM__ #define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__ /* Minimum positive values, including subnormals. */ #undef FLT_TRUE_MIN #undef DBL_TRUE_MIN #undef LDBL_TRUE_MIN #if __FLT_HAS_DENORM__ #define FLT_TRUE_MIN __FLT_DENORM_MIN__ #else #define FLT_TRUE_MIN __FLT_MIN__ #endif #if __DBL_HAS_DENORM__ #define DBL_TRUE_MIN __DBL_DENORM_MIN__ #else #define DBL_TRUE_MIN __DBL_MIN__ #endif #if __LDBL_HAS_DENORM__ #define LDBL_TRUE_MIN __LDBL_DENORM_MIN__ #else #define LDBL_TRUE_MIN __LDBL_MIN__ #endif #endif /* C11 */ #ifdef __STDC_WANT_DEC_FP__ /* Draft Technical Report 24732, extension for decimal floating-point arithmetic: Characteristic of decimal floating types . */ /* Number of base-FLT_RADIX digits in the significand, p. */ #undef DEC32_MANT_DIG #undef DEC64_MANT_DIG #undef DEC128_MANT_DIG #define DEC32_MANT_DIG __DEC32_MANT_DIG__ #define DEC64_MANT_DIG __DEC64_MANT_DIG__ #define DEC128_MANT_DIG __DEC128_MANT_DIG__ /* Minimum exponent. */ #undef DEC32_MIN_EXP #undef DEC64_MIN_EXP #undef DEC128_MIN_EXP #define DEC32_MIN_EXP __DEC32_MIN_EXP__ #define DEC64_MIN_EXP __DEC64_MIN_EXP__ #define DEC128_MIN_EXP __DEC128_MIN_EXP__ /* Maximum exponent. */ #undef DEC32_MAX_EXP #undef DEC64_MAX_EXP #undef DEC128_MAX_EXP #define DEC32_MAX_EXP __DEC32_MAX_EXP__ #define DEC64_MAX_EXP __DEC64_MAX_EXP__ #define DEC128_MAX_EXP __DEC128_MAX_EXP__ /* Maximum representable finite decimal floating-point number (there are 6, 15, and 33 9s after the decimal points respectively). */ #undef DEC32_MAX #undef DEC64_MAX #undef DEC128_MAX #define DEC32_MAX __DEC32_MAX__ #define DEC64_MAX __DEC64_MAX__ #define DEC128_MAX __DEC128_MAX__ /* The difference between 1 and the least value greater than 1 that is representable in the given floating point type. */ #undef DEC32_EPSILON #undef DEC64_EPSILON #undef DEC128_EPSILON #define DEC32_EPSILON __DEC32_EPSILON__ #define DEC64_EPSILON __DEC64_EPSILON__ #define DEC128_EPSILON __DEC128_EPSILON__ /* Minimum normalized positive floating-point number. */ #undef DEC32_MIN #undef DEC64_MIN #undef DEC128_MIN #define DEC32_MIN __DEC32_MIN__ #define DEC64_MIN __DEC64_MIN__ #define DEC128_MIN __DEC128_MIN__ /* Minimum subnormal positive floating-point number. */ #undef DEC32_SUBNORMAL_MIN #undef DEC64_SUBNORMAL_MIN #undef DEC128_SUBNORMAL_MIN #define DEC32_SUBNORMAL_MIN __DEC32_SUBNORMAL_MIN__ #define DEC64_SUBNORMAL_MIN __DEC64_SUBNORMAL_MIN__ #define DEC128_SUBNORMAL_MIN __DEC128_SUBNORMAL_MIN__ /* The floating-point expression evaluation method. -1 indeterminate 0 evaluate all operations and constants just to the range and precision of the type 1 evaluate operations and constants of type _Decimal32 and _Decimal64 to the range and precision of the _Decimal64 type, evaluate _Decimal128 operations and constants to the range and precision of the _Decimal128 type; 2 evaluate all operations and constants to the range and precision of the _Decimal128 type. */ #undef DEC_EVAL_METHOD #define DEC_EVAL_METHOD __DEC_EVAL_METHOD__ #endif /* __STDC_WANT_DEC_FP__ */ #endif /* _FLOAT_H___ */ ================================================ FILE: v2/headers/linux_amd64/usr/lib64/gcc/x86_64-suse-linux/4.8/include/stdarg.h ================================================ /* Copyright (C) 1989-2013 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* * ISO C Standard: 7.15 Variable arguments */ #ifndef _STDARG_H #ifndef _ANSI_STDARG_H_ #ifndef __need___va_list #define _STDARG_H #define _ANSI_STDARG_H_ #endif /* not __need___va_list */ #undef __need___va_list /* Define __gnuc_va_list. */ #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST typedef __builtin_va_list __gnuc_va_list; #endif /* Define the standard macros for the user, if this invocation was from the user program. */ #ifdef _STDARG_H #define va_start(v,l) __builtin_va_start(v,l) #define va_end(v) __builtin_va_end(v) #define va_arg(v,l) __builtin_va_arg(v,l) #if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L || defined(__GXX_EXPERIMENTAL_CXX0X__) #define va_copy(d,s) __builtin_va_copy(d,s) #endif #define __va_copy(d,s) __builtin_va_copy(d,s) /* Define va_list, if desired, from __gnuc_va_list. */ /* We deliberately do not define va_list when called from stdio.h, because ANSI C says that stdio.h is not supposed to define va_list. stdio.h needs to have access to that data type, but must not use that name. It should use the name __gnuc_va_list, which is safe because it is reserved for the implementation. */ #ifdef _BSD_VA_LIST #undef _BSD_VA_LIST #endif #if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST)) /* SVR4.2 uses _VA_LIST for an internal alias for va_list, so we must avoid testing it and setting it here. SVR4 uses _VA_LIST as a flag in stdarg.h, but we should have no conflict with that. */ #ifndef _VA_LIST_ #define _VA_LIST_ #ifdef __i860__ #ifndef _VA_LIST #define _VA_LIST va_list #endif #endif /* __i860__ */ typedef __gnuc_va_list va_list; #ifdef _SCO_DS #define __VA_LIST #endif #endif /* _VA_LIST_ */ #else /* not __svr4__ || _SCO_DS */ /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. But on BSD NET2 we must not test or define or undef it. (Note that the comments in NET 2's ansi.h are incorrect for _VA_LIST_--see stdio.h!) */ #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT) /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */ #ifndef _VA_LIST_DEFINED /* The macro _VA_LIST is used in SCO Unix 3.2. */ #ifndef _VA_LIST /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ #ifndef _VA_LIST_T_H /* The macro __va_list__ is used by BeOS. */ #ifndef __va_list__ typedef __gnuc_va_list va_list; #endif /* not __va_list__ */ #endif /* not _VA_LIST_T_H */ #endif /* not _VA_LIST */ #endif /* not _VA_LIST_DEFINED */ #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) #define _VA_LIST_ #endif #ifndef _VA_LIST #define _VA_LIST #endif #ifndef _VA_LIST_DEFINED #define _VA_LIST_DEFINED #endif #ifndef _VA_LIST_T_H #define _VA_LIST_T_H #endif #ifndef __va_list__ #define __va_list__ #endif #endif /* not _VA_LIST_, except on certain systems */ #endif /* not __svr4__ */ #endif /* _STDARG_H */ #endif /* not _ANSI_STDARG_H_ */ #endif /* not _STDARG_H */ ================================================ FILE: v2/headers/linux_amd64/usr/lib64/gcc/x86_64-suse-linux/4.8/include/stdbool.h ================================================ /* Copyright (C) 1998-2013 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* * ISO C Standard: 7.16 Boolean type and values */ #ifndef _STDBOOL_H #define _STDBOOL_H #ifndef __cplusplus #define bool _Bool #define true 1 #define false 0 #else /* __cplusplus */ /* Supporting in C++ is a GCC extension. */ #define _Bool bool #define bool bool #define false false #define true true #endif /* __cplusplus */ /* Signal that all the definitions are present. */ #define __bool_true_false_are_defined 1 #endif /* stdbool.h */ ================================================ FILE: v2/headers/linux_amd64/usr/lib64/gcc/x86_64-suse-linux/4.8/include/stddef.h ================================================ /* Copyright (C) 1989-2013 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* * ISO C Standard: 7.17 Common definitions */ #if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \ && !defined(__STDDEF_H__)) \ || defined(__need_wchar_t) || defined(__need_size_t) \ || defined(__need_ptrdiff_t) || defined(__need_NULL) \ || defined(__need_wint_t) /* Any one of these symbols __need_* means that GNU libc wants us just to define one data type. So don't define the symbols that indicate this file's entire job has been done. */ #if (!defined(__need_wchar_t) && !defined(__need_size_t) \ && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \ && !defined(__need_wint_t)) #define _STDDEF_H #define _STDDEF_H_ /* snaroff@next.com says the NeXT needs this. */ #define _ANSI_STDDEF_H #endif #ifndef __sys_stdtypes_h /* This avoids lossage on SunOS but only if stdtypes.h comes first. There's no way to win with the other order! Sun lossage. */ /* On 4.3bsd-net2, make sure ansi.h is included, so we have one less case to deal with in the following. */ #if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__) #include #endif /* On FreeBSD 5, machine/ansi.h does not exist anymore... */ #if defined (__FreeBSD__) && (__FreeBSD__ >= 5) #include #endif /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are defined if the corresponding type is *not* defined. FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_. NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_ */ #if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) #if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_) #define _SIZE_T #endif #if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_) #define _PTRDIFF_T #endif /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ instead of _WCHAR_T_. */ #if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_) #ifndef _BSD_WCHAR_T_ #define _WCHAR_T #endif #endif /* Undef _FOO_T_ if we are supposed to define foo_t. */ #if defined (__need_ptrdiff_t) || defined (_STDDEF_H_) #undef _PTRDIFF_T_ #undef _BSD_PTRDIFF_T_ #endif #if defined (__need_size_t) || defined (_STDDEF_H_) #undef _SIZE_T_ #undef _BSD_SIZE_T_ #endif #if defined (__need_wchar_t) || defined (_STDDEF_H_) #undef _WCHAR_T_ #undef _BSD_WCHAR_T_ #endif #endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) */ /* Sequent's header files use _PTRDIFF_T_ in some conflicting way. Just ignore it. */ #if defined (__sequent__) && defined (_PTRDIFF_T_) #undef _PTRDIFF_T_ #endif /* On VxWorks, may have defined macros like _TYPE_size_t which will typedef size_t. fixincludes patched the vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is not defined, and so that defining this macro defines _GCC_SIZE_T. If we find that the macros are still defined at this point, we must invoke them so that the type is defined as expected. */ #if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_)) _TYPE_ptrdiff_t; #undef _TYPE_ptrdiff_t #endif #if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_)) _TYPE_size_t; #undef _TYPE_size_t #endif #if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_)) _TYPE_wchar_t; #undef _TYPE_wchar_t #endif /* In case nobody has defined these types, but we aren't running under GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and __WCHAR_TYPE__ have reasonable values. This can happen if the parts of GCC is compiled by an older compiler, that actually include gstddef.h, such as collect2. */ /* Signed type of difference of two pointers. */ /* Define this type if we are doing the whole job, or if we want this type in particular. */ #if defined (_STDDEF_H) || defined (__need_ptrdiff_t) #ifndef _PTRDIFF_T /* in case has defined it. */ #ifndef _T_PTRDIFF_ #ifndef _T_PTRDIFF #ifndef __PTRDIFF_T #ifndef _PTRDIFF_T_ #ifndef _BSD_PTRDIFF_T_ #ifndef ___int_ptrdiff_t_h #ifndef _GCC_PTRDIFF_T #define _PTRDIFF_T #define _T_PTRDIFF_ #define _T_PTRDIFF #define __PTRDIFF_T #define _PTRDIFF_T_ #define _BSD_PTRDIFF_T_ #define ___int_ptrdiff_t_h #define _GCC_PTRDIFF_T #ifndef __PTRDIFF_TYPE__ #define __PTRDIFF_TYPE__ long int #endif typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif /* _GCC_PTRDIFF_T */ #endif /* ___int_ptrdiff_t_h */ #endif /* _BSD_PTRDIFF_T_ */ #endif /* _PTRDIFF_T_ */ #endif /* __PTRDIFF_T */ #endif /* _T_PTRDIFF */ #endif /* _T_PTRDIFF_ */ #endif /* _PTRDIFF_T */ /* If this symbol has done its job, get rid of it. */ #undef __need_ptrdiff_t #endif /* _STDDEF_H or __need_ptrdiff_t. */ /* Unsigned type of `sizeof' something. */ /* Define this type if we are doing the whole job, or if we want this type in particular. */ #if defined (_STDDEF_H) || defined (__need_size_t) #ifndef __size_t__ /* BeOS */ #ifndef __SIZE_T__ /* Cray Unicos/Mk */ #ifndef _SIZE_T /* in case has defined it. */ #ifndef _SYS_SIZE_T_H #ifndef _T_SIZE_ #ifndef _T_SIZE #ifndef __SIZE_T #ifndef _SIZE_T_ #ifndef _BSD_SIZE_T_ #ifndef _SIZE_T_DEFINED_ #ifndef _SIZE_T_DEFINED #ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */ #ifndef _SIZE_T_DECLARED /* FreeBSD 5 */ #ifndef ___int_size_t_h #ifndef _GCC_SIZE_T #ifndef _SIZET_ #ifndef __size_t #define __size_t__ /* BeOS */ #define __SIZE_T__ /* Cray Unicos/Mk */ #define _SIZE_T #define _SYS_SIZE_T_H #define _T_SIZE_ #define _T_SIZE #define __SIZE_T #define _SIZE_T_ #define _BSD_SIZE_T_ #define _SIZE_T_DEFINED_ #define _SIZE_T_DEFINED #define _BSD_SIZE_T_DEFINED_ /* Darwin */ #define _SIZE_T_DECLARED /* FreeBSD 5 */ #define ___int_size_t_h #define _GCC_SIZE_T #define _SIZET_ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ || defined(__FreeBSD_kernel__) /* __size_t is a typedef on FreeBSD 5, must not trash it. */ #elif defined (__VMS__) /* __size_t is also a typedef on VMS. */ #else #define __size_t #endif #ifndef __SIZE_TYPE__ #define __SIZE_TYPE__ long unsigned int #endif #if !(defined (__GNUG__) && defined (size_t)) typedef __SIZE_TYPE__ size_t; #ifdef __BEOS__ typedef long ssize_t; #endif /* __BEOS__ */ #endif /* !(defined (__GNUG__) && defined (size_t)) */ #endif /* __size_t */ #endif /* _SIZET_ */ #endif /* _GCC_SIZE_T */ #endif /* ___int_size_t_h */ #endif /* _SIZE_T_DECLARED */ #endif /* _BSD_SIZE_T_DEFINED_ */ #endif /* _SIZE_T_DEFINED */ #endif /* _SIZE_T_DEFINED_ */ #endif /* _BSD_SIZE_T_ */ #endif /* _SIZE_T_ */ #endif /* __SIZE_T */ #endif /* _T_SIZE */ #endif /* _T_SIZE_ */ #endif /* _SYS_SIZE_T_H */ #endif /* _SIZE_T */ #endif /* __SIZE_T__ */ #endif /* __size_t__ */ #undef __need_size_t #endif /* _STDDEF_H or __need_size_t. */ /* Wide character type. Locale-writers should change this as necessary to be big enough to hold unique values not between 0 and 127, and not (wchar_t) -1, for each defined multibyte character. */ /* Define this type if we are doing the whole job, or if we want this type in particular. */ #if defined (_STDDEF_H) || defined (__need_wchar_t) #ifndef __wchar_t__ /* BeOS */ #ifndef __WCHAR_T__ /* Cray Unicos/Mk */ #ifndef _WCHAR_T #ifndef _T_WCHAR_ #ifndef _T_WCHAR #ifndef __WCHAR_T #ifndef _WCHAR_T_ #ifndef _BSD_WCHAR_T_ #ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */ #ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */ #ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */ #ifndef _WCHAR_T_DEFINED_ #ifndef _WCHAR_T_DEFINED #ifndef _WCHAR_T_H #ifndef ___int_wchar_t_h #ifndef __INT_WCHAR_T_H #ifndef _GCC_WCHAR_T #define __wchar_t__ /* BeOS */ #define __WCHAR_T__ /* Cray Unicos/Mk */ #define _WCHAR_T #define _T_WCHAR_ #define _T_WCHAR #define __WCHAR_T #define _WCHAR_T_ #define _BSD_WCHAR_T_ #define _WCHAR_T_DEFINED_ #define _WCHAR_T_DEFINED #define _WCHAR_T_H #define ___int_wchar_t_h #define __INT_WCHAR_T_H #define _GCC_WCHAR_T #define _WCHAR_T_DECLARED /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other symbols in the _FOO_T_ family, stays defined even after its corresponding type is defined). If we define wchar_t, then we must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if we undef _WCHAR_T_, then we must also define rune_t, since headers like runetype.h assume that if machine/ansi.h is included, and _BSD_WCHAR_T_ is not defined, then rune_t is available. machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of the same type." */ #ifdef _BSD_WCHAR_T_ #undef _BSD_WCHAR_T_ #ifdef _BSD_RUNE_T_ #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) typedef _BSD_RUNE_T_ rune_t; #define _BSD_WCHAR_T_DEFINED_ #define _BSD_RUNE_T_DEFINED_ /* Darwin */ #if defined (__FreeBSD__) && (__FreeBSD__ < 5) /* Why is this file so hard to maintain properly? In contrast to the comment above regarding BSD/386 1.1, on FreeBSD for as long as the symbol has existed, _BSD_RUNE_T_ must not stay defined or redundant typedefs will occur when stdlib.h is included after this file. */ #undef _BSD_RUNE_T_ #endif #endif #endif #endif /* FreeBSD 5 can't be handled well using "traditional" logic above since it no longer defines _BSD_RUNE_T_ yet still desires to export rune_t in some cases... */ #if defined (__FreeBSD__) && (__FreeBSD__ >= 5) #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) #if __BSD_VISIBLE #ifndef _RUNE_T_DECLARED typedef __rune_t rune_t; #define _RUNE_T_DECLARED #endif #endif #endif #endif #ifndef __WCHAR_TYPE__ #define __WCHAR_TYPE__ int #endif #ifndef __cplusplus typedef __WCHAR_TYPE__ wchar_t; #endif #endif #endif #endif #endif #endif #endif #endif /* _WCHAR_T_DECLARED */ #endif /* _BSD_RUNE_T_DEFINED_ */ #endif #endif #endif #endif #endif #endif #endif #endif /* __WCHAR_T__ */ #endif /* __wchar_t__ */ #undef __need_wchar_t #endif /* _STDDEF_H or __need_wchar_t. */ #if defined (__need_wint_t) #ifndef _WINT_T #define _WINT_T #ifndef __WINT_TYPE__ #define __WINT_TYPE__ unsigned int #endif typedef __WINT_TYPE__ wint_t; #endif #undef __need_wint_t #endif /* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. are already defined. */ /* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */ /* NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here. */ #if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) /* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_ are probably typos and should be removed before 2.8 is released. */ #ifdef _GCC_PTRDIFF_T_ #undef _PTRDIFF_T_ #undef _BSD_PTRDIFF_T_ #endif #ifdef _GCC_SIZE_T_ #undef _SIZE_T_ #undef _BSD_SIZE_T_ #endif #ifdef _GCC_WCHAR_T_ #undef _WCHAR_T_ #undef _BSD_WCHAR_T_ #endif /* The following ones are the real ones. */ #ifdef _GCC_PTRDIFF_T #undef _PTRDIFF_T_ #undef _BSD_PTRDIFF_T_ #endif #ifdef _GCC_SIZE_T #undef _SIZE_T_ #undef _BSD_SIZE_T_ #endif #ifdef _GCC_WCHAR_T #undef _WCHAR_T_ #undef _BSD_WCHAR_T_ #endif #endif /* _ANSI_H_ || _MACHINE_ANSI_H_ || _X86_64_ANSI_H_ || _I386_ANSI_H_ */ #endif /* __sys_stdtypes_h */ /* A null pointer constant. */ #if defined (_STDDEF_H) || defined (__need_NULL) #undef NULL /* in case has defined it. */ #ifdef __GNUG__ #define NULL __null #else /* G++ */ #ifndef __cplusplus #define NULL ((void *)0) #else /* C++ */ #define NULL 0 #endif /* C++ */ #endif /* G++ */ #endif /* NULL not defined and or need NULL. */ #undef __need_NULL #ifdef _STDDEF_H /* Offset of member MEMBER in a struct of type TYPE. */ #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \ || (defined(__cplusplus) && __cplusplus >= 201103L) #ifndef _GCC_MAX_ALIGN_T #define _GCC_MAX_ALIGN_T /* Type whose alignment is supported in every context and is at least as great as that of any standard type not using alignment specifiers. */ typedef struct { long long __max_align_ll __attribute__ ((__aligned__(__alignof__(long long)))); long double __max_align_ld __attribute__ ((__aligned__(__alignof__(long double)))); } max_align_t; #endif #endif /* C11 or C++11. */ #if defined(__cplusplus) && __cplusplus >= 201103L #ifndef _GXX_NULLPTR_T #define _GXX_NULLPTR_T typedef decltype(nullptr) nullptr_t; #endif #endif /* C++11. */ #endif /* _STDDEF_H was defined this time */ #endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__ || __need_XXX was not defined before */ ================================================ FILE: v2/headers/linux_amd64/usr/lib64/gcc/x86_64-suse-linux/4.8/include/stdint.h ================================================ #ifndef _GCC_WRAP_STDINT_H #if __STDC_HOSTED__ # if defined __cplusplus && __cplusplus >= 201103L # undef __STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS # undef __STDC_CONSTANT_MACROS # define __STDC_CONSTANT_MACROS # endif # include_next #else # include "stdint-gcc.h" #endif #define _GCC_WRAP_STDINT_H #endif ================================================ FILE: v2/headers/linux_amd64/usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed/limits.h ================================================ /* Copyright (C) 1992-2013 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* This administrivia gets added to the beginning of limits.h if the system has its own version of limits.h. */ /* We use _GCC_LIMITS_H_ because we want this not to match any macros that the system's limits.h uses for its own purposes. */ #ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */ #define _GCC_LIMITS_H_ #ifndef _LIBC_LIMITS_H_ /* Use "..." so that we find syslimits.h only in this same directory. */ #include "syslimits.h" #endif /* Copyright (C) 1991-2013 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _LIMITS_H___ #define _LIMITS_H___ /* Number of bits in a `char'. */ #undef CHAR_BIT #define CHAR_BIT __CHAR_BIT__ /* Maximum length of a multibyte character. */ #ifndef MB_LEN_MAX #define MB_LEN_MAX 1 #endif /* Minimum and maximum values a `signed char' can hold. */ #undef SCHAR_MIN #define SCHAR_MIN (-SCHAR_MAX - 1) #undef SCHAR_MAX #define SCHAR_MAX __SCHAR_MAX__ /* Maximum value an `unsigned char' can hold. (Minimum is 0). */ #undef UCHAR_MAX #if __SCHAR_MAX__ == __INT_MAX__ # define UCHAR_MAX (SCHAR_MAX * 2U + 1U) #else # define UCHAR_MAX (SCHAR_MAX * 2 + 1) #endif /* Minimum and maximum values a `char' can hold. */ #ifdef __CHAR_UNSIGNED__ # undef CHAR_MIN # if __SCHAR_MAX__ == __INT_MAX__ # define CHAR_MIN 0U # else # define CHAR_MIN 0 # endif # undef CHAR_MAX # define CHAR_MAX UCHAR_MAX #else # undef CHAR_MIN # define CHAR_MIN SCHAR_MIN # undef CHAR_MAX # define CHAR_MAX SCHAR_MAX #endif /* Minimum and maximum values a `signed short int' can hold. */ #undef SHRT_MIN #define SHRT_MIN (-SHRT_MAX - 1) #undef SHRT_MAX #define SHRT_MAX __SHRT_MAX__ /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */ #undef USHRT_MAX #if __SHRT_MAX__ == __INT_MAX__ # define USHRT_MAX (SHRT_MAX * 2U + 1U) #else # define USHRT_MAX (SHRT_MAX * 2 + 1) #endif /* Minimum and maximum values a `signed int' can hold. */ #undef INT_MIN #define INT_MIN (-INT_MAX - 1) #undef INT_MAX #define INT_MAX __INT_MAX__ /* Maximum value an `unsigned int' can hold. (Minimum is 0). */ #undef UINT_MAX #define UINT_MAX (INT_MAX * 2U + 1U) /* Minimum and maximum values a `signed long int' can hold. (Same as `int'). */ #undef LONG_MIN #define LONG_MIN (-LONG_MAX - 1L) #undef LONG_MAX #define LONG_MAX __LONG_MAX__ /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */ #undef ULONG_MAX #define ULONG_MAX (LONG_MAX * 2UL + 1UL) #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* Minimum and maximum values a `signed long long int' can hold. */ # undef LLONG_MIN # define LLONG_MIN (-LLONG_MAX - 1LL) # undef LLONG_MAX # define LLONG_MAX __LONG_LONG_MAX__ /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ # undef ULLONG_MAX # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) #endif #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__) /* Minimum and maximum values a `signed long long int' can hold. */ # undef LONG_LONG_MIN # define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL) # undef LONG_LONG_MAX # define LONG_LONG_MAX __LONG_LONG_MAX__ /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ # undef ULONG_LONG_MAX # define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL) #endif #endif /* _LIMITS_H___ */ /* This administrivia gets added to the end of limits.h if the system has its own version of limits.h. */ #else /* not _GCC_LIMITS_H_ */ #ifdef _GCC_NEXT_LIMITS_H #include_next /* recurse down to the real one */ #endif #endif /* not _GCC_LIMITS_H_ */ ================================================ FILE: v2/headers/linux_amd64/usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed/syslimits.h ================================================ /* syslimits.h stands for the system's own limits.h file. If we can use it ok unmodified, then we install this text. If fixincludes fixes it, then the fixed version is installed instead of this text. */ #define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */ #include_next #undef _GCC_NEXT_LIMITS_H ================================================ FILE: v2/headers/linux_arm/builtin.h ================================================ // Copyright 2018 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore #ifndef _BUILTIN_H_ #define _BUILTIN_H_ #include "predefined.h" typedef struct { void *_[2]; // Go *[]interface{} } *__builtin_va_list; typedef void *__FILE_TYPE__; __SIZE_TYPE__ __builtin_strlen(char *__s); __UINT64_TYPE__ __builtin_bswap64(__UINT64_TYPE__ x); char *__builtin_strchrnul(char *, int); char *__builtin_strcpy(char *__dest, char *__src); double __builtin_copysign(double x, double y); int __builtin_abs(int j); int __builtin_ffs(int i); int __builtin_isprint(int); int __builtin_memcmp(void *__s1, void *__s2, __SIZE_TYPE__ __n); int __builtin_printf(char *__format, ...); int __builtin_sprintf(char *__s, char *__format, ...); int __builtin_strcmp(char *__s1, char *__s2); int __signbit(double x); int __signbitf(float x); void *__builtin_alloca(__SIZE_TYPE__ __size); void *__builtin_memcpy(void *dest, const void *src, __SIZE_TYPE__ n); void *__builtin_memset(void *s, int c, __SIZE_TYPE__ n); #ifdef __ccgo__ extern void *__ccgo_va_end; extern void *__ccgo_va_start; #endif void __GO__(char*); void __builtin_abort(void); void __builtin_exit(int __status); void __builtin_trap(void); void __register_stdfiles(void *, void *, void *, void *); #define __builtin_choose_expr(a, b, c) (a) ? (b) : (c) #define __builtin_expect(exp, c) (exp) #define __builtin_offsetof(st, m) ((__SIZE_TYPE__)(&((st *)0)->m)) #define __builtin_prefetch(addr, ...) (void)(addr) #define __builtin_signbit(x) (sizeof(x) == sizeof(float) ? __signbitf(x) : sizeof (x) == sizeof(double) ? __signbit(x) : __signbitl(x)) #define __builtin_types_compatible_p(type1, type2) __builtin_types_compatible__((type1){}, (type2){}) #define __builtin_va_arg(ap, type) (type)ap #define __builtin_va_copy(dest, src) dest = src #ifdef __ccgo__ #define __builtin_va_end(ap) ap = __ccgo_va_end #define __builtin_va_start(ap, arg) ap = __ccgo_va_start #else #define __builtin_va_end(ap) ap = (void*)0 #define __builtin_va_start(ap, arg) ap = (void*)-1 #endif #define __complex__ _Complex #define __const const #define __extension__ #define __typeof__ typeof #define __volatile volatile #endif /* _BUILTIN_H_ */ ================================================ FILE: v2/headers/linux_arm/paths ================================================ /usr/lib/gcc/arm-linux-gnueabihf/6/include /usr/local/include /usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed /usr/include/arm-linux-gnueabihf /usr/include ================================================ FILE: v2/headers/linux_arm/predefined.h ================================================ // Code generated by $ go generate - DO NOT EDIT. // +build ignore #define __DBL_MIN_EXP__ (-1021) #define __HQ_FBIT__ 15 #define __UINT_LEAST16_MAX__ 0xffff #define __ARM_SIZEOF_WCHAR_T 4 #define __ATOMIC_ACQUIRE 2 #define __SFRACT_IBIT__ 0 #define __FLT_MIN__ 1.1754943508222875e-38F #define __UFRACT_MAX__ 0XFFFFP-16UR #define __UINT_LEAST8_TYPE__ unsigned char #define __DQ_FBIT__ 63 #define __INTMAX_C(c) c ## LL #define __ARM_FEATURE_SAT 1 #define __ULFRACT_FBIT__ 32 #define __SACCUM_EPSILON__ 0x1P-7HK #define __CHAR_BIT__ 8 #define __USQ_IBIT__ 0 #define __UINT8_MAX__ 0xff #define __ACCUM_FBIT__ 15 #define __WINT_MAX__ 0xffffffffU #define __USFRACT_FBIT__ 8 #define __ORDER_LITTLE_ENDIAN__ 1234 #define __SIZE_MAX__ 0xffffffffU #define __ARM_ARCH_ISA_ARM 1 #define __WCHAR_MAX__ 0xffffffffU #define __LACCUM_IBIT__ 32 #define __DBL_DENORM_MIN__ ((double)4.9406564584124654e-324L) #define __FLT_EVAL_METHOD__ 0 #define __unix__ 1 #define __LLACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LLK #define __FRACT_FBIT__ 15 #define __UINT_FAST64_MAX__ 0xffffffffffffffffULL #define __SIG_ATOMIC_TYPE__ int #define __UACCUM_FBIT__ 16 #define __DBL_MIN_10_EXP__ (-307) #define __FINITE_MATH_ONLY__ 0 #define __ARMEL__ 1 #define __ARM_FEATURE_UNALIGNED 1 #define __LFRACT_IBIT__ 0 #define __LFRACT_MAX__ 0X7FFFFFFFP-31LR #define __UINT_FAST8_MAX__ 0xff #define __has_include(STR) __has_include__(STR) #define __DEC64_MAX_EXP__ 385 #define __INT8_C(c) c #define __UINT_LEAST64_MAX__ 0xffffffffffffffffULL #define __SA_FBIT__ 15 #define __SHRT_MAX__ 0x7fff #define __LDBL_MAX__ 1.7976931348623157e+308L #define __FRACT_MAX__ 0X7FFFP-15R #define __UFRACT_FBIT__ 16 #define __ARM_FP 12 #define __UFRACT_MIN__ 0.0UR #define __UINT_LEAST8_MAX__ 0xff #define __UINTMAX_TYPE__ long long unsigned int #define __LLFRACT_EPSILON__ 0x1P-63LLR #define __linux 1 #define __DEC32_EPSILON__ 1E-6DF #define __CHAR_UNSIGNED__ 1 #define __UINT32_MAX__ 0xffffffffU #define __ULFRACT_MAX__ 0XFFFFFFFFP-32ULR #define __TA_IBIT__ 64 #define __LDBL_MAX_EXP__ 1024 #define __WINT_MIN__ 0U #define __linux__ 1 #define __ULLFRACT_MIN__ 0.0ULLR #define __SCHAR_MAX__ 0x7f #define __WCHAR_MIN__ 0U #define __INT64_C(c) c ## LL #define __DBL_DIG__ 15 #define __LLACCUM_MIN__ (-0X1P31LLK-0X1P31LLK) #define __SIZEOF_INT__ 4 #define __SIZEOF_POINTER__ 4 #define __USACCUM_IBIT__ 8 #define __USER_LABEL_PREFIX__ #define __STDC_HOSTED__ 1 #define __LDBL_HAS_INFINITY__ 1 #define __LFRACT_MIN__ (-0.5LR-0.5LR) #define __HA_IBIT__ 8 #define __TQ_IBIT__ 0 #define __FLT_EPSILON__ 1.1920928955078125e-7F #define __APCS_32__ 1 #define __USFRACT_IBIT__ 0 #define __LDBL_MIN__ 2.2250738585072014e-308L #define __FRACT_MIN__ (-0.5R-0.5R) #define __DEC32_MAX__ 9.999999E96DF #define __DA_IBIT__ 32 #define __ARM_SIZEOF_MINIMAL_ENUM 4 #define __INT32_MAX__ 0x7fffffff #define __UQQ_FBIT__ 8 #define __SIZEOF_LONG__ 4 #define __UACCUM_MAX__ 0XFFFFFFFFP-16UK #define __STDC_IEC_559__ 1 #define __STDC_ISO_10646__ 201605L #define __UINT16_C(c) c #define __DECIMAL_DIG__ 17 #define __LFRACT_EPSILON__ 0x1P-31LR #define __ULFRACT_MIN__ 0.0ULR #define __has_include_next(STR) __has_include_next__(STR) #define __ARM_PCS_VFP 1 #define __LDBL_HAS_QUIET_NAN__ 1 #define __ULACCUM_IBIT__ 32 #define __UACCUM_EPSILON__ 0x1P-16UK #define __ULLACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULLK #define __HQ_IBIT__ 0 #define __FLT_HAS_DENORM__ 1 #define __SIZEOF_LONG_DOUBLE__ 8 #define __BIGGEST_ALIGNMENT__ 8 #define __DQ_IBIT__ 0 #define __DBL_MAX__ ((double)1.7976931348623157e+308L) #define __ULFRACT_IBIT__ 0 #define __INT_FAST32_MAX__ 0x7fffffff #define __DBL_HAS_INFINITY__ 1 #define __ACCUM_IBIT__ 16 #define __DEC32_MIN_EXP__ (-94) #define __THUMB_INTERWORK__ 1 #define __LACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LK #define __INT_FAST16_TYPE__ int #define __STRICT_ANSI__ 1 #define __LDBL_HAS_DENORM__ 1 #define __ARM_FEATURE_LDREX 4 #define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL #define __INT_LEAST32_MAX__ 0x7fffffff #define __DEC32_MIN__ 1E-95DF #define __ACCUM_MAX__ 0X7FFFFFFFP-15K #define __DBL_MAX_EXP__ 1024 #define __USACCUM_EPSILON__ 0x1P-8UHK #define __DEC128_EPSILON__ 1E-33DL #define __SFRACT_MAX__ 0X7FP-7HR #define __FRACT_IBIT__ 0 #define __PTRDIFF_MAX__ 0x7fffffff #define __UACCUM_MIN__ 0.0UK #define __STDC_NO_THREADS__ 1 #define __UACCUM_IBIT__ 16 #define __LONG_LONG_MAX__ 0x7fffffffffffffffLL #define __SIZEOF_SIZE_T__ 4 #define __ULACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULK #define __SIZEOF_WINT_T__ 4 #define __SA_IBIT__ 16 #define __ULLACCUM_MIN__ 0.0ULLK #define __GXX_ABI_VERSION 1010 #define __UTA_FBIT__ 64 #define __FLT_MIN_EXP__ (-125) #define __USFRACT_MAX__ 0XFFP-8UHR #define __UFRACT_IBIT__ 0 #define __ARM_FEATURE_QBIT 1 #define __INT_FAST64_TYPE__ long long int #define __DBL_MIN__ ((double)2.2250738585072014e-308L) #define __LACCUM_MIN__ (-0X1P31LK-0X1P31LK) #define __ULLACCUM_FBIT__ 32 #define __GXX_TYPEINFO_EQUALITY_INLINE 0 #define __ULLFRACT_EPSILON__ 0x1P-64ULLR #define __DEC128_MIN__ 1E-6143DL #define __REGISTER_PREFIX__ #define __UINT16_MAX__ 0xffff #define __DBL_HAS_DENORM__ 1 #define __ACCUM_MIN__ (-0X1P15K-0X1P15K) #define __SQ_IBIT__ 0 #define __UINT8_TYPE__ unsigned char #define __UHA_FBIT__ 8 #define __NO_INLINE__ 1 #define __SFRACT_MIN__ (-0.5HR-0.5HR) #define __UTQ_FBIT__ 128 #define __FLT_MANT_DIG__ 24 #define __VERSION__ "6.3.0 20170516" #define __UINT64_C(c) c ## ULL #define __ULLFRACT_FBIT__ 64 #define __FRACT_EPSILON__ 0x1P-15R #define __ULACCUM_MIN__ 0.0ULK #define _STDC_PREDEF_H 1 #define __UDA_FBIT__ 32 #define __LLACCUM_EPSILON__ 0x1P-31LLK #define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __USFRACT_MIN__ 0.0UHR #define __UQQ_IBIT__ 0 #define __STDC_IEC_559_COMPLEX__ 1 #define __INT32_C(c) c #define __DEC64_EPSILON__ 1E-15DD #define __ORDER_PDP_ENDIAN__ 3412 #define __DEC128_MIN_EXP__ (-6142) #define __UHQ_FBIT__ 16 #define __LLACCUM_FBIT__ 31 #define __INT_FAST32_TYPE__ int #define __UINT_LEAST16_TYPE__ short unsigned int #define __INT16_MAX__ 0x7fff #define __SIZE_TYPE__ unsigned int #define __UINT64_MAX__ 0xffffffffffffffffULL #define __UDQ_FBIT__ 64 #define __INT8_TYPE__ signed char #define __ELF__ 1 #define __ULFRACT_EPSILON__ 0x1P-32ULR #define __LLFRACT_FBIT__ 63 #define __FLT_RADIX__ 2 #define __INT_LEAST16_TYPE__ short int #define __LDBL_EPSILON__ 2.2204460492503131e-16L #define __UINTMAX_C(c) c ## ULL #define __SACCUM_MAX__ 0X7FFFP-7HK #define __SIG_ATOMIC_MAX__ 0x7fffffff #define __VFP_FP__ 1 #define __SIZEOF_PTRDIFF_T__ 4 #define __LACCUM_EPSILON__ 0x1P-31LK #define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF #define __INT_FAST16_MAX__ 0x7fffffff #define __ARM_ARCH_6__ 1 #define __UINT_FAST32_MAX__ 0xffffffffU #define __UINT_LEAST64_TYPE__ long long unsigned int #define __USACCUM_MAX__ 0XFFFFP-8UHK #define __SFRACT_EPSILON__ 0x1P-7HR #define __FLT_HAS_QUIET_NAN__ 1 #define __FLT_MAX_10_EXP__ 38 #define __LONG_MAX__ 0x7fffffffL #define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL #define __FLT_HAS_INFINITY__ 1 #define __unix 1 #define __USA_FBIT__ 16 #define __UINT_FAST16_TYPE__ unsigned int #define __DEC64_MAX__ 9.999999999999999E384DD #define __ARM_32BIT_STATE 1 #define __CHAR16_TYPE__ short unsigned int #define __PRAGMA_REDEFINE_EXTNAME 1 #define __INT_LEAST16_MAX__ 0x7fff #define __DEC64_MANT_DIG__ 16 #define __INT64_MAX__ 0x7fffffffffffffffLL #define __UINT_LEAST32_MAX__ 0xffffffffU #define __SACCUM_FBIT__ 7 #define __INT_LEAST64_TYPE__ long long int #define __ARM_FEATURE_CLZ 1 #define __INT16_TYPE__ short int #define __INT_LEAST8_TYPE__ signed char #define __STDC_VERSION__ 199901L #define __SQ_FBIT__ 31 #define __DEC32_MAX_EXP__ 97 #define __ARM_ARCH_ISA_THUMB 1 #define __INT_FAST8_MAX__ 0x7f #define __ARM_ARCH 6 #define __INTPTR_MAX__ 0x7fffffff #define __QQ_FBIT__ 7 #define __UTA_IBIT__ 64 #define __LDBL_MANT_DIG__ 53 #define __SFRACT_FBIT__ 7 #define __SACCUM_MIN__ (-0X1P7HK-0X1P7HK) #define __DBL_HAS_QUIET_NAN__ 1 #define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1) #define __INTPTR_TYPE__ int #define __UINT16_TYPE__ short unsigned int #define __WCHAR_TYPE__ unsigned int #define __SIZEOF_FLOAT__ 4 #define __USQ_FBIT__ 32 #define __UINTPTR_MAX__ 0xffffffffU #define __DEC64_MIN_EXP__ (-382) #define __ULLACCUM_IBIT__ 32 #define __INT_FAST64_MAX__ 0x7fffffffffffffffLL #define __FLT_DIG__ 6 #define __UINT_FAST64_TYPE__ long long unsigned int #define __INT_MAX__ 0x7fffffff #define __LACCUM_FBIT__ 31 #define __USACCUM_MIN__ 0.0UHK #define __UHA_IBIT__ 8 #define __INT64_TYPE__ long long int #define __FLT_MAX_EXP__ 128 #define __UTQ_IBIT__ 0 #define __DBL_MANT_DIG__ 53 #define __INT_LEAST64_MAX__ 0x7fffffffffffffffLL #define __DEC64_MIN__ 1E-383DD #define __WINT_TYPE__ unsigned int #define __UINT_LEAST32_TYPE__ unsigned int #define __SIZEOF_SHORT__ 2 #define __ULLFRACT_IBIT__ 0 #define __LDBL_MIN_EXP__ (-1021) #define __arm__ 1 #define __UDA_IBIT__ 32 #define __INT_LEAST8_MAX__ 0x7f #define __LFRACT_FBIT__ 31 #define __LDBL_MAX_10_EXP__ 308 #define __ATOMIC_RELAXED 0 #define __DBL_EPSILON__ ((double)2.2204460492503131e-16L) #define __ARM_FEATURE_SIMD32 1 #define __UINT8_C(c) c #define __INT_LEAST32_TYPE__ int #define __SIZEOF_WCHAR_T__ 4 #define __UINT64_TYPE__ long long unsigned int #define __LLFRACT_MAX__ 0X7FFFFFFFFFFFFFFFP-63LLR #define __TQ_FBIT__ 127 #define __INT_FAST8_TYPE__ signed char #define __ULLACCUM_EPSILON__ 0x1P-32ULLK #define __UHQ_IBIT__ 0 #define __LLACCUM_IBIT__ 32 #define __DBL_DECIMAL_DIG__ 17 #define __DEC_EVAL_METHOD__ 2 #define __TA_FBIT__ 63 #define __UDQ_IBIT__ 0 #define __ORDER_BIG_ENDIAN__ 4321 #define __ACCUM_EPSILON__ 0x1P-15K #define __UINT32_C(c) c ## U #define __INTMAX_MAX__ 0x7fffffffffffffffLL #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __FLT_DENORM_MIN__ 1.4012984643248171e-45F #define __LLFRACT_IBIT__ 0 #define __INT8_MAX__ 0x7f #define __UINT_FAST32_TYPE__ unsigned int #define __CHAR32_TYPE__ unsigned int #define __FLT_MAX__ 3.4028234663852886e+38F #define __USACCUM_FBIT__ 8 #define __INT32_TYPE__ int #define __SIZEOF_DOUBLE__ 8 #define __FLT_MIN_10_EXP__ (-37) #define __UFRACT_EPSILON__ 0x1P-16UR #define __INTMAX_TYPE__ long long int #define __DEC128_MAX_EXP__ 6145 #define __ATOMIC_CONSUME 1 #define __UINTMAX_MAX__ 0xffffffffffffffffULL #define __DEC32_MANT_DIG__ 7 #define __HA_FBIT__ 7 #define __DBL_MAX_10_EXP__ 308 #define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L #define __INT16_C(c) c #define __STDC__ 1 #define __PTRDIFF_TYPE__ int #define __LLFRACT_MIN__ (-0.5LLR-0.5LLR) #define __ATOMIC_SEQ_CST 5 #define __DA_FBIT__ 31 #define __UINT32_TYPE__ unsigned int #define __UINTPTR_TYPE__ unsigned int #define __USA_IBIT__ 16 #define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD #define __ARM_EABI__ 1 #define __DEC128_MANT_DIG__ 34 #define __LDBL_MIN_10_EXP__ (-307) #define __SIZEOF_LONG_LONG__ 8 #define __ULACCUM_EPSILON__ 0x1P-32ULK #define __SACCUM_IBIT__ 8 #define __LDBL_DIG__ 15 #define __FLT_DECIMAL_DIG__ 9 #define __UINT_FAST16_MAX__ 0xffffffffU #define __ULLFRACT_MAX__ 0XFFFFFFFFFFFFFFFFP-64ULLR #define __UINT_FAST8_TYPE__ unsigned char #define __USFRACT_EPSILON__ 0x1P-8UHR #define __ULACCUM_FBIT__ 32 #define __ARM_FEATURE_DSP 1 #define __QQ_IBIT__ 0 #define __ATOMIC_ACQ_REL 4 #define __ATOMIC_RELEASE 3 ================================================ FILE: v2/headers/linux_arm/usr/include/_G_config.h ================================================ /* This file is needed by libio to define various configuration parameters. These are always the same in the GNU C library. */ #ifndef _G_config_h #define _G_config_h 1 /* Define types for libio in terms of the standard internal type names. */ #include #define __need_size_t #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T #define __need_wchar_t #endif #define __need_NULL #include #define __need_mbstate_t #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T #define __need_wint_t #endif #include typedef struct { __off_t __pos; __mbstate_t __state; } _G_fpos_t; typedef struct { __off64_t __pos; __mbstate_t __state; } _G_fpos64_t; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T #include typedef union { struct __gconv_info __cd; struct { struct __gconv_info __cd; struct __gconv_step_data __data; } __combined; } _G_iconv_t; #endif /* These library features are always available in the GNU C library. */ #define _G_va_list __gnuc_va_list #define _G_HAVE_MMAP 1 #define _G_HAVE_MREMAP 1 #define _G_IO_IO_FILE_VERSION 0x20001 /* This is defined by if `st_blksize' exists. */ #define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE) #define _G_BUFSIZ 8192 #endif /* _G_config.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/alloca.h ================================================ /* Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _ALLOCA_H #define _ALLOCA_H 1 #include #define __need_size_t #include __BEGIN_DECLS /* Remove any previous definitions. */ #undef alloca /* Allocate a block that will be freed when the calling function exits. */ extern void *alloca(size_t __size) __THROW; #ifdef __GNUC__ #define alloca(size) __builtin_alloca (size) #endif /* GCC. */ __END_DECLS #endif /* alloca.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/asm/errno.h ================================================ #include ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/asm/ioctl.h ================================================ #include ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/asm/ioctls.h ================================================ #ifndef __ASM_ARM_IOCTLS_H #define __ASM_ARM_IOCTLS_H #define FIOQSIZE 0x545E #include #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/asm/param.h ================================================ #include ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/asm/sigcontext.h ================================================ #ifndef _ASMARM_SIGCONTEXT_H #define _ASMARM_SIGCONTEXT_H /* * Signal context structure - contains all info to do with the state * before the signal handler was invoked. Note: only add new entries * to the end of the structure. */ struct sigcontext { unsigned long trap_no; unsigned long error_code; unsigned long oldmask; unsigned long arm_r0; unsigned long arm_r1; unsigned long arm_r2; unsigned long arm_r3; unsigned long arm_r4; unsigned long arm_r5; unsigned long arm_r6; unsigned long arm_r7; unsigned long arm_r8; unsigned long arm_r9; unsigned long arm_r10; unsigned long arm_fp; unsigned long arm_ip; unsigned long arm_sp; unsigned long arm_lr; unsigned long arm_pc; unsigned long arm_cpsr; unsigned long fault_address; }; #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/asm/socket.h ================================================ #include ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/asm/sockios.h ================================================ #include ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/byteswap-16.h ================================================ /* Macros to swap the order of bytes in 16-bit integer values. Copyright (C) 2012-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_BYTESWAP_H #error "Never use directly; include instead." #endif #ifdef __GNUC__ #define __bswap_16(x) \ (__extension__ \ ({ unsigned short int __bsx = (unsigned short int) (x); \ __bswap_constant_16 (__bsx); })) #else static __inline unsigned short int __bswap_16(unsigned short int __bsx) { return __bswap_constant_16(__bsx); } #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/byteswap.h ================================================ /* Macros to swap the order of bytes in integer values. Copyright (C) 1997-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H #error "Never use directly; include instead." #endif #ifndef _BITS_BYTESWAP_H #define _BITS_BYTESWAP_H 1 #include #include /* Swap bytes in 16 bit value. */ #define __bswap_constant_16(x) \ ((unsigned short int)((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))) /* Get __bswap_16. */ #include /* Swap bytes in 32 bit value. */ #define __bswap_constant_32(x) \ ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \ (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24)) #ifdef __GNUC__ #if __GNUC_PREREQ (4, 3) static __inline unsigned int __bswap_32(unsigned int __bsx) { return __builtin_bswap32(__bsx); } #else #define __bswap_32(x) \ (__extension__ \ ({ unsigned int __bsx = (x); __bswap_constant_32 (__bsx); })) #endif #else static __inline unsigned int __bswap_32(unsigned int __bsx) { return __bswap_constant_32(__bsx); } #endif /* Swap bytes in 64 bit value. */ #if __GNUC_PREREQ (2, 0) #define __bswap_constant_64(x) \ (__extension__ ((((x) & 0xff00000000000000ull) >> 56) \ | (((x) & 0x00ff000000000000ull) >> 40) \ | (((x) & 0x0000ff0000000000ull) >> 24) \ | (((x) & 0x000000ff00000000ull) >> 8) \ | (((x) & 0x00000000ff000000ull) << 8) \ | (((x) & 0x0000000000ff0000ull) << 24) \ | (((x) & 0x000000000000ff00ull) << 40) \ | (((x) & 0x00000000000000ffull) << 56))) #if __GNUC_PREREQ (4, 3) static __inline __uint64_t __bswap_64(__uint64_t __bsx) { return __builtin_bswap64(__bsx); } #else #define __bswap_64(x) \ (__extension__ \ ({ union { __extension__ __uint64_t __ll; \ unsigned int __l[2]; } __w, __r; \ if (__builtin_constant_p (x)) \ __r.__ll = __bswap_constant_64 (x); \ else \ { \ __w.__ll = (x); \ __r.__l[0] = __bswap_32 (__w.__l[1]); \ __r.__l[1] = __bswap_32 (__w.__l[0]); \ } \ __r.__ll; })) #endif #else #define __bswap_constant_64(x) \ ((((x) & 0xff00000000000000ull) >> 56) \ | (((x) & 0x00ff000000000000ull) >> 40) \ | (((x) & 0x0000ff0000000000ull) >> 24) \ | (((x) & 0x000000ff00000000ull) >> 8) \ | (((x) & 0x00000000ff000000ull) << 8) \ | (((x) & 0x0000000000ff0000ull) << 24) \ | (((x) & 0x000000000000ff00ull) << 40) \ | (((x) & 0x00000000000000ffull) << 56)) static __inline __uint64_t __bswap_64(__uint64_t __bsx) { return __bswap_constant_64(__bsx); } #endif #endif /* _BITS_BYTESWAP_H */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/confname.h ================================================ /* `sysconf', `pathconf', and `confstr' NAME values. Generic version. Copyright (C) 1993-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _UNISTD_H #error "Never use directly; include instead." #endif /* Values for the NAME argument to `pathconf' and `fpathconf'. */ enum { _PC_LINK_MAX, #define _PC_LINK_MAX _PC_LINK_MAX _PC_MAX_CANON, #define _PC_MAX_CANON _PC_MAX_CANON _PC_MAX_INPUT, #define _PC_MAX_INPUT _PC_MAX_INPUT _PC_NAME_MAX, #define _PC_NAME_MAX _PC_NAME_MAX _PC_PATH_MAX, #define _PC_PATH_MAX _PC_PATH_MAX _PC_PIPE_BUF, #define _PC_PIPE_BUF _PC_PIPE_BUF _PC_CHOWN_RESTRICTED, #define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED _PC_NO_TRUNC, #define _PC_NO_TRUNC _PC_NO_TRUNC _PC_VDISABLE, #define _PC_VDISABLE _PC_VDISABLE _PC_SYNC_IO, #define _PC_SYNC_IO _PC_SYNC_IO _PC_ASYNC_IO, #define _PC_ASYNC_IO _PC_ASYNC_IO _PC_PRIO_IO, #define _PC_PRIO_IO _PC_PRIO_IO _PC_SOCK_MAXBUF, #define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF _PC_FILESIZEBITS, #define _PC_FILESIZEBITS _PC_FILESIZEBITS _PC_REC_INCR_XFER_SIZE, #define _PC_REC_INCR_XFER_SIZE _PC_REC_INCR_XFER_SIZE _PC_REC_MAX_XFER_SIZE, #define _PC_REC_MAX_XFER_SIZE _PC_REC_MAX_XFER_SIZE _PC_REC_MIN_XFER_SIZE, #define _PC_REC_MIN_XFER_SIZE _PC_REC_MIN_XFER_SIZE _PC_REC_XFER_ALIGN, #define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN _PC_ALLOC_SIZE_MIN, #define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN _PC_SYMLINK_MAX, #define _PC_SYMLINK_MAX _PC_SYMLINK_MAX _PC_2_SYMLINKS #define _PC_2_SYMLINKS _PC_2_SYMLINKS }; /* Values for the argument to `sysconf'. */ enum { _SC_ARG_MAX, #define _SC_ARG_MAX _SC_ARG_MAX _SC_CHILD_MAX, #define _SC_CHILD_MAX _SC_CHILD_MAX _SC_CLK_TCK, #define _SC_CLK_TCK _SC_CLK_TCK _SC_NGROUPS_MAX, #define _SC_NGROUPS_MAX _SC_NGROUPS_MAX _SC_OPEN_MAX, #define _SC_OPEN_MAX _SC_OPEN_MAX _SC_STREAM_MAX, #define _SC_STREAM_MAX _SC_STREAM_MAX _SC_TZNAME_MAX, #define _SC_TZNAME_MAX _SC_TZNAME_MAX _SC_JOB_CONTROL, #define _SC_JOB_CONTROL _SC_JOB_CONTROL _SC_SAVED_IDS, #define _SC_SAVED_IDS _SC_SAVED_IDS _SC_REALTIME_SIGNALS, #define _SC_REALTIME_SIGNALS _SC_REALTIME_SIGNALS _SC_PRIORITY_SCHEDULING, #define _SC_PRIORITY_SCHEDULING _SC_PRIORITY_SCHEDULING _SC_TIMERS, #define _SC_TIMERS _SC_TIMERS _SC_ASYNCHRONOUS_IO, #define _SC_ASYNCHRONOUS_IO _SC_ASYNCHRONOUS_IO _SC_PRIORITIZED_IO, #define _SC_PRIORITIZED_IO _SC_PRIORITIZED_IO _SC_SYNCHRONIZED_IO, #define _SC_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO _SC_FSYNC, #define _SC_FSYNC _SC_FSYNC _SC_MAPPED_FILES, #define _SC_MAPPED_FILES _SC_MAPPED_FILES _SC_MEMLOCK, #define _SC_MEMLOCK _SC_MEMLOCK _SC_MEMLOCK_RANGE, #define _SC_MEMLOCK_RANGE _SC_MEMLOCK_RANGE _SC_MEMORY_PROTECTION, #define _SC_MEMORY_PROTECTION _SC_MEMORY_PROTECTION _SC_MESSAGE_PASSING, #define _SC_MESSAGE_PASSING _SC_MESSAGE_PASSING _SC_SEMAPHORES, #define _SC_SEMAPHORES _SC_SEMAPHORES _SC_SHARED_MEMORY_OBJECTS, #define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS _SC_AIO_LISTIO_MAX, #define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX _SC_AIO_MAX, #define _SC_AIO_MAX _SC_AIO_MAX _SC_AIO_PRIO_DELTA_MAX, #define _SC_AIO_PRIO_DELTA_MAX _SC_AIO_PRIO_DELTA_MAX _SC_DELAYTIMER_MAX, #define _SC_DELAYTIMER_MAX _SC_DELAYTIMER_MAX _SC_MQ_OPEN_MAX, #define _SC_MQ_OPEN_MAX _SC_MQ_OPEN_MAX _SC_MQ_PRIO_MAX, #define _SC_MQ_PRIO_MAX _SC_MQ_PRIO_MAX _SC_VERSION, #define _SC_VERSION _SC_VERSION _SC_PAGESIZE, #define _SC_PAGESIZE _SC_PAGESIZE #define _SC_PAGE_SIZE _SC_PAGESIZE _SC_RTSIG_MAX, #define _SC_RTSIG_MAX _SC_RTSIG_MAX _SC_SEM_NSEMS_MAX, #define _SC_SEM_NSEMS_MAX _SC_SEM_NSEMS_MAX _SC_SEM_VALUE_MAX, #define _SC_SEM_VALUE_MAX _SC_SEM_VALUE_MAX _SC_SIGQUEUE_MAX, #define _SC_SIGQUEUE_MAX _SC_SIGQUEUE_MAX _SC_TIMER_MAX, #define _SC_TIMER_MAX _SC_TIMER_MAX /* Values for the argument to `sysconf' corresponding to _POSIX2_* symbols. */ _SC_BC_BASE_MAX, #define _SC_BC_BASE_MAX _SC_BC_BASE_MAX _SC_BC_DIM_MAX, #define _SC_BC_DIM_MAX _SC_BC_DIM_MAX _SC_BC_SCALE_MAX, #define _SC_BC_SCALE_MAX _SC_BC_SCALE_MAX _SC_BC_STRING_MAX, #define _SC_BC_STRING_MAX _SC_BC_STRING_MAX _SC_COLL_WEIGHTS_MAX, #define _SC_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX _SC_EQUIV_CLASS_MAX, #define _SC_EQUIV_CLASS_MAX _SC_EQUIV_CLASS_MAX _SC_EXPR_NEST_MAX, #define _SC_EXPR_NEST_MAX _SC_EXPR_NEST_MAX _SC_LINE_MAX, #define _SC_LINE_MAX _SC_LINE_MAX _SC_RE_DUP_MAX, #define _SC_RE_DUP_MAX _SC_RE_DUP_MAX _SC_CHARCLASS_NAME_MAX, #define _SC_CHARCLASS_NAME_MAX _SC_CHARCLASS_NAME_MAX _SC_2_VERSION, #define _SC_2_VERSION _SC_2_VERSION _SC_2_C_BIND, #define _SC_2_C_BIND _SC_2_C_BIND _SC_2_C_DEV, #define _SC_2_C_DEV _SC_2_C_DEV _SC_2_FORT_DEV, #define _SC_2_FORT_DEV _SC_2_FORT_DEV _SC_2_FORT_RUN, #define _SC_2_FORT_RUN _SC_2_FORT_RUN _SC_2_SW_DEV, #define _SC_2_SW_DEV _SC_2_SW_DEV _SC_2_LOCALEDEF, #define _SC_2_LOCALEDEF _SC_2_LOCALEDEF _SC_PII, #define _SC_PII _SC_PII _SC_PII_XTI, #define _SC_PII_XTI _SC_PII_XTI _SC_PII_SOCKET, #define _SC_PII_SOCKET _SC_PII_SOCKET _SC_PII_INTERNET, #define _SC_PII_INTERNET _SC_PII_INTERNET _SC_PII_OSI, #define _SC_PII_OSI _SC_PII_OSI _SC_POLL, #define _SC_POLL _SC_POLL _SC_SELECT, #define _SC_SELECT _SC_SELECT _SC_UIO_MAXIOV, #define _SC_UIO_MAXIOV _SC_UIO_MAXIOV _SC_IOV_MAX = _SC_UIO_MAXIOV, #define _SC_IOV_MAX _SC_IOV_MAX _SC_PII_INTERNET_STREAM, #define _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_DGRAM, #define _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_DGRAM _SC_PII_OSI_COTS, #define _SC_PII_OSI_COTS _SC_PII_OSI_COTS _SC_PII_OSI_CLTS, #define _SC_PII_OSI_CLTS _SC_PII_OSI_CLTS _SC_PII_OSI_M, #define _SC_PII_OSI_M _SC_PII_OSI_M _SC_T_IOV_MAX, #define _SC_T_IOV_MAX _SC_T_IOV_MAX /* Values according to POSIX 1003.1c (POSIX threads). */ _SC_THREADS, #define _SC_THREADS _SC_THREADS _SC_THREAD_SAFE_FUNCTIONS, #define _SC_THREAD_SAFE_FUNCTIONS _SC_THREAD_SAFE_FUNCTIONS _SC_GETGR_R_SIZE_MAX, #define _SC_GETGR_R_SIZE_MAX _SC_GETGR_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX, #define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX _SC_LOGIN_NAME_MAX, #define _SC_LOGIN_NAME_MAX _SC_LOGIN_NAME_MAX _SC_TTY_NAME_MAX, #define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX _SC_THREAD_DESTRUCTOR_ITERATIONS, #define _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_KEYS_MAX, #define _SC_THREAD_KEYS_MAX _SC_THREAD_KEYS_MAX _SC_THREAD_STACK_MIN, #define _SC_THREAD_STACK_MIN _SC_THREAD_STACK_MIN _SC_THREAD_THREADS_MAX, #define _SC_THREAD_THREADS_MAX _SC_THREAD_THREADS_MAX _SC_THREAD_ATTR_STACKADDR, #define _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKSIZE, #define _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_PRIORITY_SCHEDULING, #define _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIO_INHERIT, #define _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_PROTECT, #define _SC_THREAD_PRIO_PROTECT _SC_THREAD_PRIO_PROTECT _SC_THREAD_PROCESS_SHARED, #define _SC_THREAD_PROCESS_SHARED _SC_THREAD_PROCESS_SHARED _SC_NPROCESSORS_CONF, #define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF _SC_NPROCESSORS_ONLN, #define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN _SC_PHYS_PAGES, #define _SC_PHYS_PAGES _SC_PHYS_PAGES _SC_AVPHYS_PAGES, #define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES _SC_ATEXIT_MAX, #define _SC_ATEXIT_MAX _SC_ATEXIT_MAX _SC_PASS_MAX, #define _SC_PASS_MAX _SC_PASS_MAX _SC_XOPEN_VERSION, #define _SC_XOPEN_VERSION _SC_XOPEN_VERSION _SC_XOPEN_XCU_VERSION, #define _SC_XOPEN_XCU_VERSION _SC_XOPEN_XCU_VERSION _SC_XOPEN_UNIX, #define _SC_XOPEN_UNIX _SC_XOPEN_UNIX _SC_XOPEN_CRYPT, #define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT _SC_XOPEN_ENH_I18N, #define _SC_XOPEN_ENH_I18N _SC_XOPEN_ENH_I18N _SC_XOPEN_SHM, #define _SC_XOPEN_SHM _SC_XOPEN_SHM _SC_2_CHAR_TERM, #define _SC_2_CHAR_TERM _SC_2_CHAR_TERM _SC_2_C_VERSION, #define _SC_2_C_VERSION _SC_2_C_VERSION _SC_2_UPE, #define _SC_2_UPE _SC_2_UPE _SC_XOPEN_XPG2, #define _SC_XOPEN_XPG2 _SC_XOPEN_XPG2 _SC_XOPEN_XPG3, #define _SC_XOPEN_XPG3 _SC_XOPEN_XPG3 _SC_XOPEN_XPG4, #define _SC_XOPEN_XPG4 _SC_XOPEN_XPG4 _SC_CHAR_BIT, #define _SC_CHAR_BIT _SC_CHAR_BIT _SC_CHAR_MAX, #define _SC_CHAR_MAX _SC_CHAR_MAX _SC_CHAR_MIN, #define _SC_CHAR_MIN _SC_CHAR_MIN _SC_INT_MAX, #define _SC_INT_MAX _SC_INT_MAX _SC_INT_MIN, #define _SC_INT_MIN _SC_INT_MIN _SC_LONG_BIT, #define _SC_LONG_BIT _SC_LONG_BIT _SC_WORD_BIT, #define _SC_WORD_BIT _SC_WORD_BIT _SC_MB_LEN_MAX, #define _SC_MB_LEN_MAX _SC_MB_LEN_MAX _SC_NZERO, #define _SC_NZERO _SC_NZERO _SC_SSIZE_MAX, #define _SC_SSIZE_MAX _SC_SSIZE_MAX _SC_SCHAR_MAX, #define _SC_SCHAR_MAX _SC_SCHAR_MAX _SC_SCHAR_MIN, #define _SC_SCHAR_MIN _SC_SCHAR_MIN _SC_SHRT_MAX, #define _SC_SHRT_MAX _SC_SHRT_MAX _SC_SHRT_MIN, #define _SC_SHRT_MIN _SC_SHRT_MIN _SC_UCHAR_MAX, #define _SC_UCHAR_MAX _SC_UCHAR_MAX _SC_UINT_MAX, #define _SC_UINT_MAX _SC_UINT_MAX _SC_ULONG_MAX, #define _SC_ULONG_MAX _SC_ULONG_MAX _SC_USHRT_MAX, #define _SC_USHRT_MAX _SC_USHRT_MAX _SC_NL_ARGMAX, #define _SC_NL_ARGMAX _SC_NL_ARGMAX _SC_NL_LANGMAX, #define _SC_NL_LANGMAX _SC_NL_LANGMAX _SC_NL_MSGMAX, #define _SC_NL_MSGMAX _SC_NL_MSGMAX _SC_NL_NMAX, #define _SC_NL_NMAX _SC_NL_NMAX _SC_NL_SETMAX, #define _SC_NL_SETMAX _SC_NL_SETMAX _SC_NL_TEXTMAX, #define _SC_NL_TEXTMAX _SC_NL_TEXTMAX _SC_XBS5_ILP32_OFF32, #define _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFFBIG, #define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG _SC_XBS5_LP64_OFF64, #define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64 _SC_XBS5_LPBIG_OFFBIG, #define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG _SC_XOPEN_LEGACY, #define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY _SC_XOPEN_REALTIME, #define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME_THREADS, #define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS _SC_ADVISORY_INFO, #define _SC_ADVISORY_INFO _SC_ADVISORY_INFO _SC_BARRIERS, #define _SC_BARRIERS _SC_BARRIERS _SC_BASE, #define _SC_BASE _SC_BASE _SC_C_LANG_SUPPORT, #define _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT_R, #define _SC_C_LANG_SUPPORT_R _SC_C_LANG_SUPPORT_R _SC_CLOCK_SELECTION, #define _SC_CLOCK_SELECTION _SC_CLOCK_SELECTION _SC_CPUTIME, #define _SC_CPUTIME _SC_CPUTIME _SC_THREAD_CPUTIME, #define _SC_THREAD_CPUTIME _SC_THREAD_CPUTIME _SC_DEVICE_IO, #define _SC_DEVICE_IO _SC_DEVICE_IO _SC_DEVICE_SPECIFIC, #define _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC_R, #define _SC_DEVICE_SPECIFIC_R _SC_DEVICE_SPECIFIC_R _SC_FD_MGMT, #define _SC_FD_MGMT _SC_FD_MGMT _SC_FIFO, #define _SC_FIFO _SC_FIFO _SC_PIPE, #define _SC_PIPE _SC_PIPE _SC_FILE_ATTRIBUTES, #define _SC_FILE_ATTRIBUTES _SC_FILE_ATTRIBUTES _SC_FILE_LOCKING, #define _SC_FILE_LOCKING _SC_FILE_LOCKING _SC_FILE_SYSTEM, #define _SC_FILE_SYSTEM _SC_FILE_SYSTEM _SC_MONOTONIC_CLOCK, #define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK _SC_MULTI_PROCESS, #define _SC_MULTI_PROCESS _SC_MULTI_PROCESS _SC_SINGLE_PROCESS, #define _SC_SINGLE_PROCESS _SC_SINGLE_PROCESS _SC_NETWORKING, #define _SC_NETWORKING _SC_NETWORKING _SC_READER_WRITER_LOCKS, #define _SC_READER_WRITER_LOCKS _SC_READER_WRITER_LOCKS _SC_SPIN_LOCKS, #define _SC_SPIN_LOCKS _SC_SPIN_LOCKS _SC_REGEXP, #define _SC_REGEXP _SC_REGEXP _SC_REGEX_VERSION, #define _SC_REGEX_VERSION _SC_REGEX_VERSION _SC_SHELL, #define _SC_SHELL _SC_SHELL _SC_SIGNALS, #define _SC_SIGNALS _SC_SIGNALS _SC_SPAWN, #define _SC_SPAWN _SC_SPAWN _SC_SPORADIC_SERVER, #define _SC_SPORADIC_SERVER _SC_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER, #define _SC_THREAD_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER _SC_SYSTEM_DATABASE, #define _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE_R, #define _SC_SYSTEM_DATABASE_R _SC_SYSTEM_DATABASE_R _SC_TIMEOUTS, #define _SC_TIMEOUTS _SC_TIMEOUTS _SC_TYPED_MEMORY_OBJECTS, #define _SC_TYPED_MEMORY_OBJECTS _SC_TYPED_MEMORY_OBJECTS _SC_USER_GROUPS, #define _SC_USER_GROUPS _SC_USER_GROUPS _SC_USER_GROUPS_R, #define _SC_USER_GROUPS_R _SC_USER_GROUPS_R _SC_2_PBS, #define _SC_2_PBS _SC_2_PBS _SC_2_PBS_ACCOUNTING, #define _SC_2_PBS_ACCOUNTING _SC_2_PBS_ACCOUNTING _SC_2_PBS_LOCATE, #define _SC_2_PBS_LOCATE _SC_2_PBS_LOCATE _SC_2_PBS_MESSAGE, #define _SC_2_PBS_MESSAGE _SC_2_PBS_MESSAGE _SC_2_PBS_TRACK, #define _SC_2_PBS_TRACK _SC_2_PBS_TRACK _SC_SYMLOOP_MAX, #define _SC_SYMLOOP_MAX _SC_SYMLOOP_MAX _SC_STREAMS, #define _SC_STREAMS _SC_STREAMS _SC_2_PBS_CHECKPOINT, #define _SC_2_PBS_CHECKPOINT _SC_2_PBS_CHECKPOINT _SC_V6_ILP32_OFF32, #define _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFFBIG, #define _SC_V6_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG _SC_V6_LP64_OFF64, #define _SC_V6_LP64_OFF64 _SC_V6_LP64_OFF64 _SC_V6_LPBIG_OFFBIG, #define _SC_V6_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG _SC_HOST_NAME_MAX, #define _SC_HOST_NAME_MAX _SC_HOST_NAME_MAX _SC_TRACE, #define _SC_TRACE _SC_TRACE _SC_TRACE_EVENT_FILTER, #define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER _SC_TRACE_INHERIT, #define _SC_TRACE_INHERIT _SC_TRACE_INHERIT _SC_TRACE_LOG, #define _SC_TRACE_LOG _SC_TRACE_LOG _SC_LEVEL1_ICACHE_SIZE, #define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_ASSOC, #define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_LINESIZE, #define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_DCACHE_SIZE, #define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_ASSOC, #define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_LINESIZE, #define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL2_CACHE_SIZE, #define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_ASSOC, #define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_LINESIZE, #define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL3_CACHE_SIZE, #define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_ASSOC, #define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_LINESIZE, #define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL4_CACHE_SIZE, #define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_ASSOC, #define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_LINESIZE, #define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE /* Leave room here, maybe we need a few more cache levels some day. */ _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, #define _SC_IPV6 _SC_IPV6 _SC_RAW_SOCKETS, #define _SC_RAW_SOCKETS _SC_RAW_SOCKETS _SC_V7_ILP32_OFF32, #define _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFFBIG, #define _SC_V7_ILP32_OFFBIG _SC_V7_ILP32_OFFBIG _SC_V7_LP64_OFF64, #define _SC_V7_LP64_OFF64 _SC_V7_LP64_OFF64 _SC_V7_LPBIG_OFFBIG, #define _SC_V7_LPBIG_OFFBIG _SC_V7_LPBIG_OFFBIG _SC_SS_REPL_MAX, #define _SC_SS_REPL_MAX _SC_SS_REPL_MAX _SC_TRACE_EVENT_NAME_MAX, #define _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_NAME_MAX, #define _SC_TRACE_NAME_MAX _SC_TRACE_NAME_MAX _SC_TRACE_SYS_MAX, #define _SC_TRACE_SYS_MAX _SC_TRACE_SYS_MAX _SC_TRACE_USER_EVENT_MAX, #define _SC_TRACE_USER_EVENT_MAX _SC_TRACE_USER_EVENT_MAX _SC_XOPEN_STREAMS, #define _SC_XOPEN_STREAMS _SC_XOPEN_STREAMS _SC_THREAD_ROBUST_PRIO_INHERIT, #define _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_PROTECT #define _SC_THREAD_ROBUST_PRIO_PROTECT _SC_THREAD_ROBUST_PRIO_PROTECT }; /* Values for the NAME argument to `confstr'. */ enum { _CS_PATH, /* The default search path. */ #define _CS_PATH _CS_PATH _CS_V6_WIDTH_RESTRICTED_ENVS, #define _CS_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS _CS_GNU_LIBC_VERSION, #define _CS_GNU_LIBC_VERSION _CS_GNU_LIBC_VERSION _CS_GNU_LIBPTHREAD_VERSION, #define _CS_GNU_LIBPTHREAD_VERSION _CS_GNU_LIBPTHREAD_VERSION _CS_V5_WIDTH_RESTRICTED_ENVS, #define _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS, #define _CS_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS _CS_LFS_CFLAGS = 1000, #define _CS_LFS_CFLAGS _CS_LFS_CFLAGS _CS_LFS_LDFLAGS, #define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS _CS_LFS_LIBS, #define _CS_LFS_LIBS _CS_LFS_LIBS _CS_LFS_LINTFLAGS, #define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS _CS_LFS64_CFLAGS, #define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS _CS_LFS64_LDFLAGS, #define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS _CS_LFS64_LIBS, #define _CS_LFS64_LIBS _CS_LFS64_LIBS _CS_LFS64_LINTFLAGS, #define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, #define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS, #define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LIBS, #define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LINTFLAGS, #define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS, #define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS, #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LIBS, #define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_LP64_OFF64_CFLAGS, #define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS, #define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LIBS, #define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LINTFLAGS, #define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LIBS, #define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LIBS, #define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LIBS, #define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS, #define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS, #define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LIBS, #define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, #define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LIBS, #define _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LIBS, #define _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS, #define _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS, #define _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LIBS, #define _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS, #define _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_V6_ENV, #define _CS_V6_ENV _CS_V6_ENV _CS_V7_ENV #define _CS_V7_ENV _CS_V7_ENV }; ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/dirent.h ================================================ /* Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _DIRENT_H #error "Never use directly; include instead." #endif struct dirent { #ifndef __USE_FILE_OFFSET64 __ino_t d_ino; __off_t d_off; #else __ino64_t d_ino; __off64_t d_off; #endif unsigned short int d_reclen; unsigned char d_type; char d_name[256]; /* We must not include limits.h! */ }; #ifdef __USE_LARGEFILE64 struct dirent64 { __ino64_t d_ino; __off64_t d_off; unsigned short int d_reclen; unsigned char d_type; char d_name[256]; /* We must not include limits.h! */ }; #endif #define d_fileno d_ino /* Backwards compatibility. */ #undef _DIRENT_HAVE_D_NAMLEN #define _DIRENT_HAVE_D_RECLEN #define _DIRENT_HAVE_D_OFF #define _DIRENT_HAVE_D_TYPE #if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T /* Inform libc code that these two types are effectively identical. */ #define _DIRENT_MATCHES_DIRENT64 1 #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/dlfcn.h ================================================ /* System dependent definitions for run-time dynamic loading. Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _DLFCN_H #error "Never use directly; include instead." #endif /* The MODE argument to `dlopen' contains one of the following: */ #define RTLD_LAZY 0x00001 /* Lazy function call binding. */ #define RTLD_NOW 0x00002 /* Immediate function call binding. */ #define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */ #define RTLD_NOLOAD 0x00004 /* Do not load the object. */ #define RTLD_DEEPBIND 0x00008 /* Use deep binding. */ /* If the following bit is set in the MODE argument to `dlopen', the symbols of the loaded object and its dependencies are made visible as if the object were linked directly into the program. */ #define RTLD_GLOBAL 0x00100 /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. The implementation does this by default and so we can define the value to zero. */ #define RTLD_LOCAL 0 /* Do not delete object when closed. */ #define RTLD_NODELETE 0x01000 #ifdef __USE_GNU /* To support profiling of shared objects it is a good idea to call the function found using `dlsym' using the following macro since these calls do not use the PLT. But this would mean the dynamic loader has no chance to find out when the function is called. The macro applies the necessary magic so that profiling is possible. Rewrite foo = (*fctp) (arg1, arg2); into foo = DL_CALL_FCT (fctp, (arg1, arg2)); */ #define DL_CALL_FCT(fctp, args) \ (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) __BEGIN_DECLS /* This function calls the profiling functions. */ extern void _dl_mcount_wrapper_check(void *__selfpc) __THROW; __END_DECLS #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/endian.h ================================================ #ifndef _ENDIAN_H #error "Never use directly; include instead." #endif /* ARM can be either big or little endian. */ #ifdef __ARMEB__ #define __BYTE_ORDER __BIG_ENDIAN #else #define __BYTE_ORDER __LITTLE_ENDIAN #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/environments.h ================================================ /* Copyright (C) 1999-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _UNISTD_H #error "Never include this file directly. Use instead" #endif #include /* This header should define the following symbols under the described situations. A value `1' means that the model is always supported, `-1' means it is never supported. Undefined means it cannot be statically decided. _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard and are available only for compatibility. */ #if __WORDSIZE == 64 /* We can never provide environments with 32-bit wide pointers. */ #define _POSIX_V7_ILP32_OFF32 -1 #define _POSIX_V7_ILP32_OFFBIG -1 #define _POSIX_V6_ILP32_OFF32 -1 #define _POSIX_V6_ILP32_OFFBIG -1 #define _XBS5_ILP32_OFF32 -1 #define _XBS5_ILP32_OFFBIG -1 /* We also have no use (for now) for an environment with bigger pointers and offsets. */ #define _POSIX_V7_LPBIG_OFFBIG -1 #define _POSIX_V6_LPBIG_OFFBIG -1 #define _XBS5_LPBIG_OFFBIG -1 /* By default we have 64-bit wide `long int', pointers and `off_t'. */ #define _POSIX_V7_LP64_OFF64 1 #define _POSIX_V6_LP64_OFF64 1 #define _XBS5_LP64_OFF64 1 #else /* __WORDSIZE == 32 */ /* By default we have 32-bit wide `int', `long int', pointers and `off_t' and all platforms support LFS. */ #define _POSIX_V7_ILP32_OFF32 1 #define _POSIX_V7_ILP32_OFFBIG 1 #define _POSIX_V6_ILP32_OFF32 1 #define _POSIX_V6_ILP32_OFFBIG 1 #define _XBS5_ILP32_OFF32 1 #define _XBS5_ILP32_OFFBIG 1 /* We optionally provide an environment with the above size but an 64-bit side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ /* We can never provide environments with 64-bit wide pointers. */ #define _POSIX_V7_LP64_OFF64 -1 #define _POSIX_V7_LPBIG_OFFBIG -1 #define _POSIX_V6_LP64_OFF64 -1 #define _POSIX_V6_LPBIG_OFFBIG -1 #define _XBS5_LP64_OFF64 -1 #define _XBS5_LPBIG_OFFBIG -1 /* CFLAGS. */ #define __ILP32_OFFBIG_CFLAGS "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" #endif /* __WORDSIZE == 32 */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/errno.h ================================================ /* Error constants. Linux specific version. Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifdef _ERRNO_H #undef EDOM #undef EILSEQ #undef ERANGE #include /* Linux has no ENOTSUP error code. */ #define ENOTSUP EOPNOTSUPP /* Older Linux versions also had no ECANCELED error code. */ #ifndef ECANCELED #define ECANCELED 125 #endif /* Support for error codes to support robust mutexes was added later, too. */ #ifndef EOWNERDEAD #define EOWNERDEAD 130 #define ENOTRECOVERABLE 131 #endif #ifndef ERFKILL #define ERFKILL 132 #endif #ifndef EHWPOISON #define EHWPOISON 133 #endif #ifndef __ASSEMBLER__ /* Function to get address of global `errno' variable. */ extern int *__errno_location(void) __THROW __attribute__ ((__const__)); #if !defined _LIBC || defined _LIBC_REENTRANT /* When using threads, errno is a per-thread value. */ #define errno (*__errno_location ()) #endif #endif /* !__ASSEMBLER__ */ #endif /* _ERRNO_H */ #if !defined _ERRNO_H && defined __need_Emath /* This is ugly but the kernel header is not clean enough. We must define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is defined. */ #define EDOM 33 /* Math argument out of domain of function. */ #define EILSEQ 84 /* Illegal byte sequence. */ #define ERANGE 34 /* Math result not representable. */ #endif /* !_ERRNO_H && __need_Emath */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/fcntl-linux.h ================================================ /* O_*, F_*, FD_* bit values for Linux. Copyright (C) 2001-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _FCNTL_H #error "Never use directly; include instead." #endif /* This file contains shared definitions between Linux architectures and is included by to declare them. The various #ifndef cases allow the architecture specific file to define those values with different values. A minimal contains just: struct flock {...} #ifdef __USE_LARGEFILE64 struct flock64 {...} #endif #include */ #ifdef __USE_GNU #include #endif /* open/fcntl. */ #define O_ACCMODE 0003 #define O_RDONLY 00 #define O_WRONLY 01 #define O_RDWR 02 #ifndef O_CREAT #define O_CREAT 0100 /* Not fcntl. */ #endif #ifndef O_EXCL #define O_EXCL 0200 /* Not fcntl. */ #endif #ifndef O_NOCTTY #define O_NOCTTY 0400 /* Not fcntl. */ #endif #ifndef O_TRUNC #define O_TRUNC 01000 /* Not fcntl. */ #endif #ifndef O_APPEND #define O_APPEND 02000 #endif #ifndef O_NONBLOCK #define O_NONBLOCK 04000 #endif #ifndef O_NDELAY #define O_NDELAY O_NONBLOCK #endif #ifndef O_SYNC #define O_SYNC 04010000 #endif #define O_FSYNC O_SYNC #ifndef O_ASYNC #define O_ASYNC 020000 #endif #ifndef __O_LARGEFILE #define __O_LARGEFILE 0100000 #endif #ifndef __O_DIRECTORY #define __O_DIRECTORY 0200000 #endif #ifndef __O_NOFOLLOW #define __O_NOFOLLOW 0400000 #endif #ifndef __O_CLOEXEC #define __O_CLOEXEC 02000000 #endif #ifndef __O_DIRECT #define __O_DIRECT 040000 #endif #ifndef __O_NOATIME #define __O_NOATIME 01000000 #endif #ifndef __O_PATH #define __O_PATH 010000000 #endif #ifndef __O_DSYNC #define __O_DSYNC 010000 #endif #ifndef __O_TMPFILE #define __O_TMPFILE (020000000 | __O_DIRECTORY) #endif #ifndef F_GETLK #ifndef __USE_FILE_OFFSET64 #define F_GETLK 5 /* Get record locking info. */ #define F_SETLK 6 /* Set record locking info (non-blocking). */ #define F_SETLKW 7 /* Set record locking info (blocking). */ #else #define F_GETLK F_GETLK64 /* Get record locking info. */ #define F_SETLK F_SETLK64 /* Set record locking info (non-blocking). */ #define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ #endif #endif #ifndef F_GETLK64 #define F_GETLK64 12 /* Get record locking info. */ #define F_SETLK64 13 /* Set record locking info (non-blocking). */ #define F_SETLKW64 14 /* Set record locking info (blocking). */ #endif /* open file description locks. Usually record locks held by a process are released on *any* close and are not inherited across a fork. These cmd values will set locks that conflict with process-associated record locks, but are "owned" by the opened file description, not the process. This means that they are inherited across fork or clone with CLONE_FILES like BSD (flock) locks, and they are only released automatically when the last reference to the the file description against which they were acquired is put. */ #ifdef __USE_GNU #define F_OFD_GETLK 36 #define F_OFD_SETLK 37 #define F_OFD_SETLKW 38 #endif #ifdef __USE_LARGEFILE64 #define O_LARGEFILE __O_LARGEFILE #endif #ifdef __USE_XOPEN2K8 #define O_DIRECTORY __O_DIRECTORY /* Must be a directory. */ #define O_NOFOLLOW __O_NOFOLLOW /* Do not follow links. */ #define O_CLOEXEC __O_CLOEXEC /* Set close_on_exec. */ #endif #ifdef __USE_GNU #define O_DIRECT __O_DIRECT /* Direct disk access. */ #define O_NOATIME __O_NOATIME /* Do not set atime. */ #define O_PATH __O_PATH /* Resolve pathname but do not open file. */ #define O_TMPFILE __O_TMPFILE /* Atomically create nameless file. */ #endif /* For now, Linux has no separate synchronicitiy options for read operations. We define O_RSYNC therefore as the same as O_SYNC since this is a superset. */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 #define O_DSYNC __O_DSYNC /* Synchronize data. */ #if defined __O_RSYNC #define O_RSYNC __O_RSYNC /* Synchronize read operations. */ #else #define O_RSYNC O_SYNC /* Synchronize read operations. */ #endif #endif /* Values for the second argument to `fcntl'. */ #define F_DUPFD 0 /* Duplicate file descriptor. */ #define F_GETFD 1 /* Get file descriptor flags. */ #define F_SETFD 2 /* Set file descriptor flags. */ #define F_GETFL 3 /* Get file status flags. */ #define F_SETFL 4 /* Set file status flags. */ #ifndef __F_SETOWN #define __F_SETOWN 8 #define __F_GETOWN 9 #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 #define F_SETOWN __F_SETOWN /* Get owner (process receiving SIGIO). */ #define F_GETOWN __F_GETOWN /* Set owner (process receiving SIGIO). */ #endif #ifndef __F_SETSIG #define __F_SETSIG 10 /* Set number of signal to be sent. */ #define __F_GETSIG 11 /* Get number of signal to be sent. */ #endif #ifndef __F_SETOWN_EX #define __F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ #define __F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU #define F_SETSIG __F_SETSIG /* Set number of signal to be sent. */ #define F_GETSIG __F_GETSIG /* Get number of signal to be sent. */ #define F_SETOWN_EX __F_SETOWN_EX /* Get owner (thread receiving SIGIO). */ #define F_GETOWN_EX __F_GETOWN_EX /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU #define F_SETLEASE 1024 /* Set a lease. */ #define F_GETLEASE 1025 /* Enquire what lease is active. */ #define F_NOTIFY 1026 /* Request notifications on a directory. */ #define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ #define F_GETPIPE_SZ 1032 /* Set pipe page size array. */ #endif #ifdef __USE_XOPEN2K8 #define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with close-on-exit set. */ #endif /* For F_[GET|SET]FD. */ #define FD_CLOEXEC 1 /* Actually anything with low bit set goes */ #ifndef F_RDLCK /* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ #define F_RDLCK 0 /* Read lock. */ #define F_WRLCK 1 /* Write lock. */ #define F_UNLCK 2 /* Remove lock. */ #endif /* For old implementation of BSD flock. */ #ifndef F_EXLCK #define F_EXLCK 4 /* or 3 */ #define F_SHLCK 8 /* or 4 */ #endif #ifdef __USE_MISC /* Operations for BSD flock, also used by the kernel implementation. */ #define LOCK_SH 1 /* Shared lock. */ #define LOCK_EX 2 /* Exclusive lock. */ #define LOCK_NB 4 /* Or'd with one of the above to prevent blocking. */ #define LOCK_UN 8 /* Remove lock. */ #endif #ifdef __USE_GNU #define LOCK_MAND 32 /* This is a mandatory flock: */ #define LOCK_READ 64 /* ... which allows concurrent read operations. */ #define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ #define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ #endif #ifdef __USE_GNU /* Types of directory notifications that may be requested with F_NOTIFY. */ #define DN_ACCESS 0x00000001 /* File accessed. */ #define DN_MODIFY 0x00000002 /* File modified. */ #define DN_CREATE 0x00000004 /* File created. */ #define DN_DELETE 0x00000008 /* File removed. */ #define DN_RENAME 0x00000010 /* File renamed. */ #define DN_ATTRIB 0x00000020 /* File changed attributes. */ #define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ #endif #ifdef __USE_GNU /* Owner types. */ enum __pid_type { F_OWNER_TID = 0, /* Kernel thread. */ F_OWNER_PID, /* Process. */ F_OWNER_PGRP, /* Process group. */ F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ }; /* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ struct f_owner_ex { enum __pid_type type; /* Owner type of ID. */ __pid_t pid; /* ID of owner. */ }; #endif /* Define some more compatibility macros to be backward compatible with BSD systems which did not managed to hide these kernel macros. */ #ifdef __USE_MISC #define FAPPEND O_APPEND #define FFSYNC O_FSYNC #define FASYNC O_ASYNC #define FNONBLOCK O_NONBLOCK #define FNDELAY O_NDELAY #endif /* Use misc. */ #ifndef __POSIX_FADV_DONTNEED #define __POSIX_FADV_DONTNEED 4 #define __POSIX_FADV_NOREUSE 5 #endif /* Advise to `posix_fadvise'. */ #ifdef __USE_XOPEN2K #define POSIX_FADV_NORMAL 0 /* No further special treatment. */ #define POSIX_FADV_RANDOM 1 /* Expect random page references. */ #define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ #define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ #define POSIX_FADV_DONTNEED __POSIX_FADV_DONTNEED /* Don't need these pages. */ #define POSIX_FADV_NOREUSE __POSIX_FADV_NOREUSE /* Data will be accessed once. */ #endif #ifdef __USE_GNU /* Flags for SYNC_FILE_RANGE. */ #define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the write. */ #define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those dirty pages in the range which are not presently under writeback. */ #define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ /* Flags for SPLICE and VMSPLICE. */ #define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ #define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing (but we may still block on the fd we splice from/to). */ #define SPLICE_F_MORE 4 /* Expect more data. */ #define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ /* Flags for fallocate. */ #define FALLOC_FL_KEEP_SIZE 1 /* Don't extend size of file even if offset + len is greater than file size. */ #define FALLOC_FL_PUNCH_HOLE 2 /* Create a hole in the file. */ #define FALLOC_FL_COLLAPSE_RANGE 8 /* Remove a range of a file without leaving a hole. */ #define FALLOC_FL_ZERO_RANGE 16 /* Convert a range of a file to zeros. */ /* File handle structure. */ struct file_handle { unsigned int handle_bytes; int handle_type; /* File identifier. */ unsigned char f_handle[0]; }; /* Maximum handle size (for now). */ #define MAX_HANDLE_SZ 128 #endif /* Values for `*at' functions. */ #ifdef __USE_ATFILE #define AT_FDCWD -100 /* Special value used to indicate the *at functions should use the current working directory. */ #define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */ #define AT_REMOVEDIR 0x200 /* Remove directory instead of unlinking file. */ #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ #ifdef __USE_GNU #define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal. */ #define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname. */ #endif #define AT_EACCESS 0x200 /* Test access permitted for effective IDs, not real IDs. */ #endif __BEGIN_DECLS #ifdef __USE_GNU /* Provide kernel hint to read ahead. */ extern ssize_t readahead(int __fd, __off64_t __offset, size_t __count) __THROW; /* Selective file content synch'ing. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int sync_file_range(int __fd, __off64_t __offset, __off64_t __count, unsigned int __flags); /* Splice address range into a pipe. This function is a possible cancellation point and therefore not marked with __THROW. */ extern ssize_t vmsplice(int __fdout, const struct iovec *__iov, size_t __count, unsigned int __flags); /* Splice two files together. This function is a possible cancellation point and therefore not marked with __THROW. */ extern ssize_t splice(int __fdin, __off64_t * __offin, int __fdout, __off64_t * __offout, size_t __len, unsigned int __flags); /* In-kernel implementation of tee for pipe buffers. This function is a possible cancellation point and therefore not marked with __THROW. */ extern ssize_t tee(int __fdin, int __fdout, size_t __len, unsigned int __flags); /* Reserve storage for the data of the file associated with FD. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int fallocate(int __fd, int __mode, __off_t __offset, __off_t __len); #else #ifdef __REDIRECT extern int __REDIRECT(fallocate, (int __fd, int __mode, __off64_t __offset, __off64_t __len), fallocate64); #else #define fallocate fallocate64 #endif #endif #ifdef __USE_LARGEFILE64 extern int fallocate64(int __fd, int __mode, __off64_t __offset, __off64_t __len); #endif /* Map file name to file handle. */ extern int name_to_handle_at(int __dfd, const char *__name, struct file_handle *__handle, int *__mnt_id, int __flags) __THROW; /* Open file using the file handle. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int open_by_handle_at(int __mountdirfd, struct file_handle *__handle, int __flags); #endif /* use GNU */ __END_DECLS ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/fcntl.h ================================================ /* O_*, F_*, FD_* bit values for Linux. Copyright (C) 1995-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library. If not, see . */ #ifndef _FCNTL_H #error "Never use directly; include instead." #endif #define __O_DIRECTORY 040000 /* Must be a directory. */ #define __O_NOFOLLOW 0100000 /* Do not follow links. */ #define __O_DIRECT 0200000 /* Direct disk access. */ #define __O_LARGEFILE 0400000 struct flock { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ #ifndef __USE_FILE_OFFSET64 __off_t l_start; /* Offset where the lock begins. */ __off_t l_len; /* Size of the locked area; zero means until EOF. */ #else __off64_t l_start; /* Offset where the lock begins. */ __off64_t l_len; /* Size of the locked area; zero means until EOF. */ #endif __pid_t l_pid; /* Process holding the lock. */ }; #ifdef __USE_LARGEFILE64 struct flock64 { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ __off64_t l_start; /* Offset where the lock begins. */ __off64_t l_len; /* Size of the locked area; zero means until EOF. */ __pid_t l_pid; /* Process holding the lock. */ }; #endif /* Include generic Linux declarations. */ #include ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/huge_val.h ================================================ /* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity). Used by and functions for overflow. Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H #error "Never use directly; include instead." #endif /* IEEE positive infinity (-HUGE_VAL is negative infinity). */ #if __GNUC_PREREQ(3,3) #define HUGE_VAL (__builtin_huge_val()) #elif __GNUC_PREREQ(2,96) #define HUGE_VAL (__extension__ 0x1.0p2047) #elif defined __GNUC__ #define HUGE_VAL \ (__extension__ \ ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ { __l: 0x7ff0000000000000ULL }).__d) #else /* not GCC */ #include typedef union { unsigned char __c[8]; double __d; } __huge_val_t; #if __BYTE_ORDER == __BIG_ENDIAN #define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } #endif #if __BYTE_ORDER == __LITTLE_ENDIAN #define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } #endif static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; #define HUGE_VAL (__huge_val.__d) #endif /* GCC. */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/huge_valf.h ================================================ /* `HUGE_VALF' constant for IEEE 754 machines (where it is infinity). Used by and functions for overflow. Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H #error "Never use directly; include instead." #endif /* IEEE positive infinity (-HUGE_VAL is negative infinity). */ #if __GNUC_PREREQ(3,3) #define HUGE_VALF (__builtin_huge_valf()) #elif __GNUC_PREREQ(2,96) #define HUGE_VALF (__extension__ 0x1.0p255f) #elif defined __GNUC__ #define HUGE_VALF \ (__extension__ \ ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ { __l: 0x7f800000UL }).__d) #else /* not GCC */ typedef union { unsigned char __c[4]; float __f; } __huge_valf_t; #if __BYTE_ORDER == __BIG_ENDIAN #define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } #endif #if __BYTE_ORDER == __LITTLE_ENDIAN #define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } #endif static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; #define HUGE_VALF (__huge_valf.__f) #endif /* GCC. */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/huge_vall.h ================================================ /* Default `HUGE_VALL' constant. Used by and functions for overflow. Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H #error "Never use directly; include instead." #endif #if __GNUC_PREREQ(3,3) #define HUGE_VALL (__builtin_huge_vall()) #else #define HUGE_VALL ((long double) HUGE_VAL) #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/in.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* Linux version. */ #ifndef _NETINET_IN_H #error "Never use directly; include instead." #endif /* If the application has already included linux/in6.h from a linux-based kernel then we will not define the IPv6 IPPROTO_* defines, in6_addr (nor the defines), sockaddr_in6, or ipv6_mreq. Same for in6_ptkinfo or ip6_mtuinfo in linux/ipv6.h. The ABI used by the linux-kernel and glibc match exactly. Neither the linux kernel nor glibc should break this ABI without coordination. In upstream kernel 56c176c9 the _UAPI prefix was stripped so we need to check for _LINUX_IN6_H and _IPV6_H now, and keep checking the old versions for maximum backwards compatibility. */ #if defined _UAPI_LINUX_IN6_H \ || defined _UAPI_IPV6_H \ || defined _LINUX_IN6_H \ || defined _IPV6_H /* This is not quite the same API since the kernel always defines s6_addr16 and s6_addr32. This is not a violation of POSIX since POSIX says "at least the following member" and that holds true. */ #define __USE_KERNEL_IPV6_DEFS 1 #else #define __USE_KERNEL_IPV6_DEFS 0 #endif /* Options for use with `getsockopt' and `setsockopt' at the IP level. The first word in the comment at the right is the data type used; "bool" means a boolean value stored in an `int'. */ #define IP_OPTIONS 4 /* ip_opts; IP per-packet options. */ #define IP_HDRINCL 3 /* int; Header is included with data. */ #define IP_TOS 1 /* int; IP type of service and precedence. */ #define IP_TTL 2 /* int; IP time to live. */ #define IP_RECVOPTS 6 /* bool; Receive all IP options w/datagram. */ /* For BSD compatibility. */ #define IP_RECVRETOPTS IP_RETOPTS /* bool; Receive IP options for response. */ #define IP_RETOPTS 7 /* ip_opts; Set/get IP per-packet options. */ #define IP_MULTICAST_IF 32 /* in_addr; set/get IP multicast i/f */ #define IP_MULTICAST_TTL 33 /* u_char; set/get IP multicast ttl */ #define IP_MULTICAST_LOOP 34 /* i_char; set/get IP multicast loopback */ #define IP_ADD_MEMBERSHIP 35 /* ip_mreq; add an IP group membership */ #define IP_DROP_MEMBERSHIP 36 /* ip_mreq; drop an IP group membership */ #define IP_UNBLOCK_SOURCE 37 /* ip_mreq_source: unblock data from source */ #define IP_BLOCK_SOURCE 38 /* ip_mreq_source: block data from source */ #define IP_ADD_SOURCE_MEMBERSHIP 39 /* ip_mreq_source: join source group */ #define IP_DROP_SOURCE_MEMBERSHIP 40 /* ip_mreq_source: leave source group */ #define IP_MSFILTER 41 #ifdef __USE_MISC #define MCAST_JOIN_GROUP 42 /* group_req: join any-source group */ #define MCAST_BLOCK_SOURCE 43 /* group_source_req: block from given group */ #define MCAST_UNBLOCK_SOURCE 44 /* group_source_req: unblock from given group */ #define MCAST_LEAVE_GROUP 45 /* group_req: leave any-source group */ #define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */ #define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr */ #define MCAST_MSFILTER 48 #define IP_MULTICAST_ALL 49 #define IP_UNICAST_IF 50 #define MCAST_EXCLUDE 0 #define MCAST_INCLUDE 1 #endif #define IP_ROUTER_ALERT 5 /* bool */ #define IP_PKTINFO 8 /* bool */ #define IP_PKTOPTIONS 9 #define IP_PMTUDISC 10 /* obsolete name? */ #define IP_MTU_DISCOVER 10 /* int; see below */ #define IP_RECVERR 11 /* bool */ #define IP_RECVTTL 12 /* bool */ #define IP_RECVTOS 13 /* bool */ #define IP_MTU 14 /* int */ #define IP_FREEBIND 15 #define IP_IPSEC_POLICY 16 #define IP_XFRM_POLICY 17 #define IP_PASSSEC 18 #define IP_TRANSPARENT 19 #define IP_MULTICAST_ALL 49 /* bool */ /* TProxy original addresses */ #define IP_ORIGDSTADDR 20 #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR #define IP_MINTTL 21 #define IP_NODEFRAG 22 #define IP_CHECKSUM 23 #define IP_BIND_ADDRESS_NO_PORT 24 /* IP_MTU_DISCOVER arguments. */ #define IP_PMTUDISC_DONT 0 /* Never send DF frames. */ #define IP_PMTUDISC_WANT 1 /* Use per route hints. */ #define IP_PMTUDISC_DO 2 /* Always DF. */ #define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */ /* Always use interface mtu (ignores dst pmtu) but don't set DF flag. Also incoming ICMP frag_needed notifications will be ignored on this socket to prevent accepting spoofed ones. */ #define IP_PMTUDISC_INTERFACE 4 /* Like IP_PMTUDISC_INTERFACE but allow packets to be fragmented. */ #define IP_PMTUDISC_OMIT 5 #define IP_MULTICAST_IF 32 #define IP_MULTICAST_TTL 33 #define IP_MULTICAST_LOOP 34 #define IP_ADD_MEMBERSHIP 35 #define IP_DROP_MEMBERSHIP 36 #define IP_UNBLOCK_SOURCE 37 #define IP_BLOCK_SOURCE 38 #define IP_ADD_SOURCE_MEMBERSHIP 39 #define IP_DROP_SOURCE_MEMBERSHIP 40 #define IP_MSFILTER 41 #define IP_MULTICAST_ALL 49 #define IP_UNICAST_IF 50 /* To select the IP level. */ #define SOL_IP 0 #define IP_DEFAULT_MULTICAST_TTL 1 #define IP_DEFAULT_MULTICAST_LOOP 1 #define IP_MAX_MEMBERSHIPS 20 #ifdef __USE_MISC /* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS. The `ip_dst' field is used for the first-hop gateway when using a source route (this gets put into the header proper). */ struct ip_opts { struct in_addr ip_dst; /* First hop; zero without source route. */ char ip_opts[40]; /* Actually variable in size. */ }; /* Like `struct ip_mreq' but including interface specification by index. */ struct ip_mreqn { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_address; /* local IP address of interface */ int imr_ifindex; /* Interface index */ }; /* Structure used for IP_PKTINFO. */ struct in_pktinfo { int ipi_ifindex; /* Interface index */ struct in_addr ipi_spec_dst; /* Routing destination address */ struct in_addr ipi_addr; /* Header destination address */ }; #endif /* Options for use with `getsockopt' and `setsockopt' at the IPv6 level. The first word in the comment at the right is the data type used; "bool" means a boolean value stored in an `int'. */ #define IPV6_ADDRFORM 1 #define IPV6_2292PKTINFO 2 #define IPV6_2292HOPOPTS 3 #define IPV6_2292DSTOPTS 4 #define IPV6_2292RTHDR 5 #define IPV6_2292PKTOPTIONS 6 #define IPV6_CHECKSUM 7 #define IPV6_2292HOPLIMIT 8 #define SCM_SRCRT IPV6_RXSRCRT #define IPV6_NEXTHOP 9 #define IPV6_AUTHHDR 10 #define IPV6_UNICAST_HOPS 16 #define IPV6_MULTICAST_IF 17 #define IPV6_MULTICAST_HOPS 18 #define IPV6_MULTICAST_LOOP 19 #define IPV6_JOIN_GROUP 20 #define IPV6_LEAVE_GROUP 21 #define IPV6_ROUTER_ALERT 22 #define IPV6_MTU_DISCOVER 23 #define IPV6_MTU 24 #define IPV6_RECVERR 25 #define IPV6_V6ONLY 26 #define IPV6_JOIN_ANYCAST 27 #define IPV6_LEAVE_ANYCAST 28 #define IPV6_IPSEC_POLICY 34 #define IPV6_XFRM_POLICY 35 #define IPV6_HDRINCL 36 /* Advanced API (RFC3542) (1). */ #define IPV6_RECVPKTINFO 49 #define IPV6_PKTINFO 50 #define IPV6_RECVHOPLIMIT 51 #define IPV6_HOPLIMIT 52 #define IPV6_RECVHOPOPTS 53 #define IPV6_HOPOPTS 54 #define IPV6_RTHDRDSTOPTS 55 #define IPV6_RECVRTHDR 56 #define IPV6_RTHDR 57 #define IPV6_RECVDSTOPTS 58 #define IPV6_DSTOPTS 59 #define IPV6_RECVPATHMTU 60 #define IPV6_PATHMTU 61 #define IPV6_DONTFRAG 62 /* Advanced API (RFC3542) (2). */ #define IPV6_RECVTCLASS 66 #define IPV6_TCLASS 67 /* Obsolete synonyms for the above. */ #if !__USE_KERNEL_IPV6_DEFS #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP #endif #define IPV6_RXHOPOPTS IPV6_HOPOPTS #define IPV6_RXDSTOPTS IPV6_DSTOPTS /* IPV6_MTU_DISCOVER values. */ #define IPV6_PMTUDISC_DONT 0 /* Never send DF frames. */ #define IPV6_PMTUDISC_WANT 1 /* Use per route hints. */ #define IPV6_PMTUDISC_DO 2 /* Always DF. */ #define IPV6_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */ #define IPV6_PMTUDISC_INTERFACE 4 /* See IP_PMTUDISC_INTERFACE. */ #define IPV6_PMTUDISC_OMIT 5 /* See IP_PMTUDISC_OMIT. */ /* Socket level values for IPv6. */ #define SOL_IPV6 41 #define SOL_ICMPV6 58 /* Routing header options for IPv6. */ #define IPV6_RTHDR_LOOSE 0 /* Hop doesn't need to be neighbour. */ #define IPV6_RTHDR_STRICT 1 /* Hop must be a neighbour. */ #define IPV6_RTHDR_TYPE_0 0 /* IPv6 Routing header type 0. */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/inf.h ================================================ /* `INFINITY' constant for IEEE 754 machines. Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H #error "Never use directly; include instead." #endif /* IEEE positive infinity. */ #if __GNUC_PREREQ(3,3) #define INFINITY (__builtin_inff()) #else #define INFINITY HUGE_VALF #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/ioctl-types.h ================================================ /* Structure types for pre-termios terminal ioctls. Linux version. Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_IOCTL_H #error "Never use directly; include instead." #endif /* Get definition of constants for use with `ioctl'. */ #include struct winsize { unsigned short int ws_row; unsigned short int ws_col; unsigned short int ws_xpixel; unsigned short int ws_ypixel; }; #define NCC 8 struct termio { unsigned short int c_iflag; /* input mode flags */ unsigned short int c_oflag; /* output mode flags */ unsigned short int c_cflag; /* control mode flags */ unsigned short int c_lflag; /* local mode flags */ unsigned char c_line; /* line discipline */ unsigned char c_cc[NCC]; /* control characters */ }; /* modem lines */ #define TIOCM_LE 0x001 #define TIOCM_DTR 0x002 #define TIOCM_RTS 0x004 #define TIOCM_ST 0x008 #define TIOCM_SR 0x010 #define TIOCM_CTS 0x020 #define TIOCM_CAR 0x040 #define TIOCM_RNG 0x080 #define TIOCM_DSR 0x100 #define TIOCM_CD TIOCM_CAR #define TIOCM_RI TIOCM_RNG /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ /* line disciplines */ #define N_TTY 0 #define N_SLIP 1 #define N_MOUSE 2 #define N_PPP 3 #define N_STRIP 4 #define N_AX25 5 #define N_X25 6 /* X.25 async */ #define N_6PACK 7 #define N_MASC 8 /* Mobitex module */ #define N_R3964 9 /* Simatic R3964 module */ #define N_PROFIBUS_FDL 10 /* Profibus */ #define N_IRDA 11 /* Linux IR */ #define N_SMSBLOCK 12 /* SMS block mode */ #define N_HDLC 13 /* synchronous HDLC */ #define N_SYNC_PPP 14 /* synchronous PPP */ #define N_HCI 15 /* Bluetooth HCI UART */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/ioctls.h ================================================ /* Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_IOCTL_H #error "Never use directly; include instead." #endif /* Use the definitions from the kernel header files. */ #include /* Routing table calls. */ #define SIOCADDRT 0x890B /* add routing table entry */ #define SIOCDELRT 0x890C /* delete routing table entry */ #define SIOCRTMSG 0x890D /* call to routing system */ /* Socket configuration controls. */ #define SIOCGIFNAME 0x8910 /* get iface name */ #define SIOCSIFLINK 0x8911 /* set iface channel */ #define SIOCGIFCONF 0x8912 /* get iface list */ #define SIOCGIFFLAGS 0x8913 /* get flags */ #define SIOCSIFFLAGS 0x8914 /* set flags */ #define SIOCGIFADDR 0x8915 /* get PA address */ #define SIOCSIFADDR 0x8916 /* set PA address */ #define SIOCGIFDSTADDR 0x8917 /* get remote PA address */ #define SIOCSIFDSTADDR 0x8918 /* set remote PA address */ #define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */ #define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */ #define SIOCGIFNETMASK 0x891b /* get network PA mask */ #define SIOCSIFNETMASK 0x891c /* set network PA mask */ #define SIOCGIFMETRIC 0x891d /* get metric */ #define SIOCSIFMETRIC 0x891e /* set metric */ #define SIOCGIFMEM 0x891f /* get memory address (BSD) */ #define SIOCSIFMEM 0x8920 /* set memory address (BSD) */ #define SIOCGIFMTU 0x8921 /* get MTU size */ #define SIOCSIFMTU 0x8922 /* set MTU size */ #define SIOCSIFNAME 0x8923 /* set interface name */ #define SIOCSIFHWADDR 0x8924 /* set hardware address */ #define SIOCGIFENCAP 0x8925 /* get/set encapsulations */ #define SIOCSIFENCAP 0x8926 #define SIOCGIFHWADDR 0x8927 /* Get hardware address */ #define SIOCGIFSLAVE 0x8929 /* Driver slaving support */ #define SIOCSIFSLAVE 0x8930 #define SIOCADDMULTI 0x8931 /* Multicast address lists */ #define SIOCDELMULTI 0x8932 #define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */ #define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */ #define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */ #define SIOCGIFPFLAGS 0x8935 #define SIOCDIFADDR 0x8936 /* delete PA address */ #define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */ #define SIOCGIFCOUNT 0x8938 /* get number of devices */ #define SIOCGIFBR 0x8940 /* Bridging support */ #define SIOCSIFBR 0x8941 /* Set bridging options */ #define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ #define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ /* ARP cache control calls. */ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */ #define SIOCDARP 0x8953 /* delete ARP table entry */ #define SIOCGARP 0x8954 /* get ARP table entry */ #define SIOCSARP 0x8955 /* set ARP table entry */ /* RARP cache control calls. */ #define SIOCDRARP 0x8960 /* delete RARP table entry */ #define SIOCGRARP 0x8961 /* get RARP table entry */ #define SIOCSRARP 0x8962 /* set RARP table entry */ /* Driver configuration calls */ #define SIOCGIFMAP 0x8970 /* Get device parameters */ #define SIOCSIFMAP 0x8971 /* Set device parameters */ /* DLCI configuration calls */ #define SIOCADDDLCI 0x8980 /* Create new DLCI device */ #define SIOCDELDLCI 0x8981 /* Delete DLCI device */ /* Device private ioctl calls. */ /* These 16 ioctls are available to devices via the do_ioctl() device vector. Each device should include this file and redefine these names as their own. Because these are device dependent it is a good idea _NOT_ to issue them to random objects and hope. */ #define SIOCDEVPRIVATE 0x89F0 /* to 89FF */ /* * These 16 ioctl calls are protocol private */ #define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/libm-simd-decl-stubs.h ================================================ /* Empty definitions required for __MATHCALL_VEC unfolding in mathcalls.h. Copyright (C) 2014-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H #error "Never include directly;\ include instead." #endif /* Needed definitions could be generated with: for func in $(grep __MATHCALL_VEC math/bits/mathcalls.h |\ sed -r "s|__MATHCALL_VEC.?\(||; s|,.*||"); do echo "#define __DECL_SIMD_${func}"; echo "#define __DECL_SIMD_${func}f"; echo "#define __DECL_SIMD_${func}l"; done */ #ifndef _BITS_LIBM_SIMD_DECL_STUBS_H #define _BITS_LIBM_SIMD_DECL_STUBS_H 1 #define __DECL_SIMD_cos #define __DECL_SIMD_cosf #define __DECL_SIMD_cosl #define __DECL_SIMD_sin #define __DECL_SIMD_sinf #define __DECL_SIMD_sinl #define __DECL_SIMD_sincos #define __DECL_SIMD_sincosf #define __DECL_SIMD_sincosl #define __DECL_SIMD_log #define __DECL_SIMD_logf #define __DECL_SIMD_logl #define __DECL_SIMD_exp #define __DECL_SIMD_expf #define __DECL_SIMD_expl #define __DECL_SIMD_pow #define __DECL_SIMD_powf #define __DECL_SIMD_powl #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/local_lim.h ================================================ /* Minimum guaranteed maximum values for system limits. Linux version. Copyright (C) 1993-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see . */ /* The kernel header pollutes the namespace with the NR_OPEN symbol and defines LINK_MAX although filesystems have different maxima. A similar thing is true for OPEN_MAX: the limit can be changed at runtime and therefore the macro must not be defined. Remove this after including the header if necessary. */ #ifndef NR_OPEN #define __undef_NR_OPEN #endif #ifndef LINK_MAX #define __undef_LINK_MAX #endif #ifndef OPEN_MAX #define __undef_OPEN_MAX #endif #ifndef ARG_MAX #define __undef_ARG_MAX #endif /* The kernel sources contain a file with all the needed information. */ #include /* Have to remove NR_OPEN? */ #ifdef __undef_NR_OPEN #undef NR_OPEN #undef __undef_NR_OPEN #endif /* Have to remove LINK_MAX? */ #ifdef __undef_LINK_MAX #undef LINK_MAX #undef __undef_LINK_MAX #endif /* Have to remove OPEN_MAX? */ #ifdef __undef_OPEN_MAX #undef OPEN_MAX #undef __undef_OPEN_MAX #endif /* Have to remove ARG_MAX? */ #ifdef __undef_ARG_MAX #undef ARG_MAX #undef __undef_ARG_MAX #endif /* The number of data keys per process. */ #define _POSIX_THREAD_KEYS_MAX 128 /* This is the value this implementation supports. */ #define PTHREAD_KEYS_MAX 1024 /* Controlling the iterations of destructors for thread-specific data. */ #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 /* Number of iterations this implementation does. */ #define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS /* The number of threads per process. */ #define _POSIX_THREAD_THREADS_MAX 64 /* We have no predefined limit on the number of threads. */ #undef PTHREAD_THREADS_MAX /* Maximum amount by which a process can descrease its asynchronous I/O priority level. */ #define AIO_PRIO_DELTA_MAX 20 /* Minimum size for a thread. We are free to choose a reasonable value. */ #define PTHREAD_STACK_MIN 16384 /* Maximum number of timer expiration overruns. */ #define DELAYTIMER_MAX 2147483647 /* Maximum tty name length. */ #define TTY_NAME_MAX 32 /* Maximum login name length. This is arbitrary. */ #define LOGIN_NAME_MAX 256 /* Maximum host name length. */ #define HOST_NAME_MAX 64 /* Maximum message queue priority level. */ #define MQ_PRIO_MAX 32768 /* Maximum value the semaphore can have. */ #define SEM_VALUE_MAX (2147483647) ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/locale.h ================================================ /* Definition of locale category symbol values. Copyright (C) 2001-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _LOCALE_H && !defined _LANGINFO_H #error "Never use directly; include instead." #endif #ifndef _BITS_LOCALE_H #define _BITS_LOCALE_H 1 #define __LC_CTYPE 0 #define __LC_NUMERIC 1 #define __LC_TIME 2 #define __LC_COLLATE 3 #define __LC_MONETARY 4 #define __LC_MESSAGES 5 #define __LC_ALL 6 #define __LC_PAPER 7 #define __LC_NAME 8 #define __LC_ADDRESS 9 #define __LC_TELEPHONE 10 #define __LC_MEASUREMENT 11 #define __LC_IDENTIFICATION 12 #endif /* bits/locale.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/math-vector.h ================================================ /* Platform-specific SIMD declarations of math functions. Copyright (C) 2014-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H #error "Never include directly;\ include instead." #endif /* Get default empty definitions required for __MATHCALL_VEC unfolding. Plaform-specific analogue of this header should redefine them with specific SIMD declarations. */ #include ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/mathcalls.h ================================================ /* Prototype declarations for math functions; helper file for . Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* NOTE: Because of the special way this file is used by , this file must NOT be protected from multiple inclusion as header files usually are. This file provides prototype declarations for the math functions. Most functions are declared using the macro: __MATHCALL (NAME,[_r], (ARGS...)); This means there is a function `NAME' returning `double' and a function `NAMEf' returning `float'. Each place `_Mdouble_' appears in the prototype, that is actually `double' in the prototype for `NAME' and `float' in the prototype for `NAMEf'. Reentrant variant functions are called `NAME_r' and `NAMEf_r'. Functions returning other types like `int' are declared using the macro: __MATHDECL (TYPE, NAME,[_r], (ARGS...)); This is just like __MATHCALL but for a function returning `TYPE' instead of `_Mdouble_'. In all of these cases, there is still both a `NAME' and a `NAMEf' that takes `float' arguments. Note that there must be no whitespace before the argument passed for NAME, to make token pasting work with -traditional. */ #ifndef _MATH_H #error "Never include directly; include instead." #endif /* Trigonometric functions. */ _Mdouble_BEGIN_NAMESPACE /* Arc cosine of X. */ __MATHCALL(acos,, (_Mdouble_ __x)); /* Arc sine of X. */ __MATHCALL(asin,, (_Mdouble_ __x)); /* Arc tangent of X. */ __MATHCALL(atan,, (_Mdouble_ __x)); /* Arc tangent of Y/X. */ __MATHCALL(atan2,, (_Mdouble_ __y, _Mdouble_ __x)); /* Cosine of X. */ __MATHCALL_VEC(cos,, (_Mdouble_ __x)); /* Sine of X. */ __MATHCALL_VEC(sin,, (_Mdouble_ __x)); /* Tangent of X. */ __MATHCALL(tan,, (_Mdouble_ __x)); /* Hyperbolic functions. */ /* Hyperbolic cosine of X. */ __MATHCALL(cosh,, (_Mdouble_ __x)); /* Hyperbolic sine of X. */ __MATHCALL(sinh,, (_Mdouble_ __x)); /* Hyperbolic tangent of X. */ __MATHCALL(tanh,, (_Mdouble_ __x)); _Mdouble_END_NAMESPACE #ifdef __USE_GNU /* Cosine and sine of X. */ __MATHDECL_VEC(void, sincos,, (_Mdouble_ __x, _Mdouble_ * __sinx, _Mdouble_ * __cosx)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Hyperbolic arc cosine of X. */ __MATHCALL(acosh,, (_Mdouble_ __x)); /* Hyperbolic arc sine of X. */ __MATHCALL(asinh,, (_Mdouble_ __x)); /* Hyperbolic arc tangent of X. */ __MATHCALL(atanh,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif /* Exponential and logarithmic functions. */ _Mdouble_BEGIN_NAMESPACE /* Exponential function of X. */ __MATHCALL_VEC(exp,, (_Mdouble_ __x)); /* Break VALUE into a normalized fraction and an integral power of 2. */ __MATHCALL(frexp,, (_Mdouble_ __x, int *__exponent)); /* X times (two to the EXP power). */ __MATHCALL(ldexp,, (_Mdouble_ __x, int __exponent)); /* Natural logarithm of X. */ __MATHCALL_VEC(log,, (_Mdouble_ __x)); /* Base-ten logarithm of X. */ __MATHCALL(log10,, (_Mdouble_ __x)); /* Break VALUE into integral and fractional parts. */ __MATHCALL(modf,, (_Mdouble_ __x, _Mdouble_ * __iptr)) __nonnull((2)); _Mdouble_END_NAMESPACE #ifdef __USE_GNU /* A function missing in all standards: compute exponent to base ten. */ __MATHCALL(exp10,, (_Mdouble_ __x)); /* Another name occasionally used. */ __MATHCALL(pow10,, (_Mdouble_ __x)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return exp(X) - 1. */ __MATHCALL(expm1,, (_Mdouble_ __x)); /* Return log(1 + X). */ __MATHCALL(log1p,, (_Mdouble_ __x)); /* Return the base 2 signed integral exponent of X. */ __MATHCALL(logb,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Compute base-2 exponential of X. */ __MATHCALL(exp2,, (_Mdouble_ __x)); /* Compute base-2 logarithm of X. */ __MATHCALL(log2,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif /* Power functions. */ _Mdouble_BEGIN_NAMESPACE /* Return X to the Y power. */ __MATHCALL_VEC(pow,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the square root of X. */ __MATHCALL(sqrt,, (_Mdouble_ __x)); _Mdouble_END_NAMESPACE #if defined __USE_XOPEN || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return `sqrt(X*X + Y*Y)'. */ __MATHCALL(hypot,, (_Mdouble_ __x, _Mdouble_ __y)); __END_NAMESPACE_C99 #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return the cube root of X. */ __MATHCALL(cbrt,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif /* Nearest integer, absolute value, and remainder functions. */ _Mdouble_BEGIN_NAMESPACE /* Smallest integral value not less than X. */ __MATHCALLX(ceil,, (_Mdouble_ __x), (__const__)); /* Absolute value of X. */ __MATHCALLX(fabs,, (_Mdouble_ __x), (__const__)); /* Largest integer not greater than X. */ __MATHCALLX(floor,, (_Mdouble_ __x), (__const__)); /* Floating-point modulo remainder of X/Y. */ __MATHCALL(fmod,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1(int, __isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. */ __MATHDECL_1(int, __finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); _Mdouble_END_NAMESPACE #ifdef __USE_MISC #if (!defined __cplusplus \ || __cplusplus < 201103L /* isinf conflicts with C++11. */ \ || __MATH_DECLARING_DOUBLE == 0) /* isinff or isinfl don't. */ /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1(int, isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); #endif /* Return nonzero if VALUE is finite and not NaN. */ __MATHDECL_1(int, finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return the remainder of X/Y. */ __MATHCALL(drem,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the fractional part of X after dividing out `ilogb (X)'. */ __MATHCALL(significand,, (_Mdouble_ __x)); #endif /* Use misc. */ #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return X with its signed changed to Y's. */ __MATHCALLX(copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); __END_NAMESPACE_C99 #endif #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return representation of qNaN for double type. */ __MATHCALLX(nan,, (const char *__tagb), (__const__)); __END_NAMESPACE_C99 #endif /* Return nonzero if VALUE is not a number. */ __MATHDECL_1(int, __isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) #if (!defined __cplusplus \ || __cplusplus < 201103L /* isnan conflicts with C++11. */ \ || __MATH_DECLARING_DOUBLE == 0) /* isnanf or isnanl don't. */ /* Return nonzero if VALUE is not a number. */ __MATHDECL_1(int, isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); #endif #endif #if defined __USE_MISC || (defined __USE_XOPEN && __MATH_DECLARING_DOUBLE) /* Bessel functions. */ __MATHCALL(j0,, (_Mdouble_)); __MATHCALL(j1,, (_Mdouble_)); __MATHCALL(jn,, (int, _Mdouble_)); __MATHCALL(y0,, (_Mdouble_)); __MATHCALL(y1,, (_Mdouble_)); __MATHCALL(yn,, (int, _Mdouble_)); #endif #if defined __USE_XOPEN || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Error and gamma functions. */ __MATHCALL(erf,, (_Mdouble_)); __MATHCALL(erfc,, (_Mdouble_)); __MATHCALL(lgamma,, (_Mdouble_)); __END_NAMESPACE_C99 #endif #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* True gamma function. */ __MATHCALL(tgamma,, (_Mdouble_)); __END_NAMESPACE_C99 #endif #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) /* Obsolete alias for `lgamma'. */ __MATHCALL(gamma,, (_Mdouble_)); #endif #ifdef __USE_MISC /* Reentrant version of lgamma. This function uses the global variable `signgam'. The reentrant version instead takes a pointer and stores the value through it. */ __MATHCALL(lgamma, _r, (_Mdouble_, int *__signgamp)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return the integer nearest X in the direction of the prevailing rounding mode. */ __MATHCALL(rint,, (_Mdouble_ __x)); /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ __MATHCALLX(nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); #if defined __USE_ISOC99 && !defined __LDBL_COMPAT __MATHCALLX(nexttoward,, (_Mdouble_ __x, long double __y), (__const__)); #endif #ifdef __USE_GNU /* Return X - epsilon. */ __MATHCALL(nextdown,, (_Mdouble_ __x)); /* Return X + epsilon. */ __MATHCALL(nextup,, (_Mdouble_ __x)); #endif /* Return the remainder of integer divison X / Y with infinite precision. */ __MATHCALL(remainder,, (_Mdouble_ __x, _Mdouble_ __y)); #ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL(scalbn,, (_Mdouble_ __x, int __n)); #endif /* Return the binary exponent of X, which must be nonzero. */ __MATHDECL(int, ilogb,, (_Mdouble_ __x)); #endif #ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL(scalbln,, (_Mdouble_ __x, long int __n)); /* Round X to integral value in floating-point format using current rounding direction, but do not raise inexact exception. */ __MATHCALL(nearbyint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHCALLX(round,, (_Mdouble_ __x), (__const__)); /* Round X to the integral value in floating-point format nearest but not larger in magnitude. */ __MATHCALLX(trunc,, (_Mdouble_ __x), (__const__)); /* Compute remainder of X and Y and put in *QUO a value with sign of x/y and magnitude congruent `mod 2^n' to the magnitude of the integral quotient x/y, with n >= 3. */ __MATHCALL(remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo)); /* Conversion functions. */ /* Round X to nearest integral value according to current rounding direction. */ __MATHDECL(long int, lrint,, (_Mdouble_ __x)); __extension__ __MATHDECL(long long int, llrint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHDECL(long int, lround,, (_Mdouble_ __x)); __extension__ __MATHDECL(long long int, llround,, (_Mdouble_ __x)); /* Return positive difference between X and Y. */ __MATHCALL(fdim,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return maximum numeric value from X and Y. */ __MATHCALLX(fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Return minimum numeric value from X and Y. */ __MATHCALLX(fmin,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Classify given number. */ __MATHDECL_1(int, __fpclassify,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Test for negative number. */ __MATHDECL_1(int, __signbit,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Multiply-add function computed as a ternary operation. */ __MATHCALL(fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); #endif /* Use ISO C99. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __END_NAMESPACE_C99 #endif #ifdef __USE_GNU /* Test for signaling NaN. */ __MATHDECL_1(int, __issignaling,, (_Mdouble_ __value)) __attribute__ ((__const__)); #endif #if defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \ && __MATH_DECLARING_DOUBLE \ && !defined __USE_XOPEN2K8) /* Return X times (2 to the Nth power). */ __MATHCALL(scalb,, (_Mdouble_ __x, _Mdouble_ __n)); #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/mathdef.h ================================================ /* Copyright (C) 1999-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library. If not, see . */ #if !defined _MATH_H && !defined _COMPLEX_H #error "Never use directly; include instead" #endif #if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF #define _MATH_H_MATHDEF 1 /* GCC does not promote `float' values to `double'. */ typedef float float_t; /* `float' expressions are evaluated as `float'. */ typedef double double_t; /* `double' expressions are evaluated as `double'. */ /* The values returned by `ilogb' for 0 and NaN respectively. */ #define FP_ILOGB0 (-2147483647) #define FP_ILOGBNAN (2147483647) /* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l} builtins are supported. */ #ifdef __FP_FAST_FMA #define FP_FAST_FMA 1 #endif #ifdef __FP_FAST_FMAF #define FP_FAST_FMAF 1 #endif #ifdef __FP_FAST_FMAL #define FP_FAST_FMAL 1 #endif #endif /* ISO C99 */ #ifndef __NO_LONG_DOUBLE_MATH /* Signal that we do not really have a `long double'. This disables the declaration of all the `long double' function variants. */ #define __NO_LONG_DOUBLE_MATH 1 #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/mman-linux.h ================================================ /* Definitions for POSIX memory map interface. Linux generic version. Copyright (C) 2001-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_MMAN_H #error "Never use directly; include instead." #endif /* The following definitions basically come from the kernel headers. But the kernel header is not namespace clean. This file is also used by some non-Linux configurations of the GNU C Library, for other systems that use these same bit values. */ /* Protections are chosen from these bits, OR'd together. The implementation does not necessarily support PROT_EXEC or PROT_WRITE without PROT_READ. The only guarantees are that no writing will be allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ #define PROT_READ 0x1 /* Page can be read. */ #define PROT_WRITE 0x2 /* Page can be written. */ #define PROT_EXEC 0x4 /* Page can be executed. */ #define PROT_NONE 0x0 /* Page can not be accessed. */ #define PROT_GROWSDOWN 0x01000000 /* Extend change to start of growsdown vma (mprotect only). */ #define PROT_GROWSUP 0x02000000 /* Extend change to start of growsup vma (mprotect only). */ /* Sharing types (must choose one and only one of these). */ #define MAP_SHARED 0x01 /* Share changes. */ #define MAP_PRIVATE 0x02 /* Changes are private. */ #ifdef __USE_MISC #define MAP_TYPE 0x0f /* Mask for type of mapping. */ #endif /* Other flags. */ #define MAP_FIXED 0x10 /* Interpret addr exactly. */ #ifdef __USE_MISC #define MAP_FILE 0 #ifdef __MAP_ANONYMOUS #define MAP_ANONYMOUS __MAP_ANONYMOUS /* Don't use a file. */ #else #define MAP_ANONYMOUS 0x20 /* Don't use a file. */ #endif #define MAP_ANON MAP_ANONYMOUS /* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */ #define MAP_HUGE_SHIFT 26 #define MAP_HUGE_MASK 0x3f #endif /* Flags to `msync'. */ #define MS_ASYNC 1 /* Sync memory asynchronously. */ #define MS_SYNC 4 /* Synchronous memory sync. */ #define MS_INVALIDATE 2 /* Invalidate the caches. */ /* Flags for `mremap'. */ #ifdef __USE_GNU #define MREMAP_MAYMOVE 1 #define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ #ifdef __USE_MISC #define MADV_NORMAL 0 /* No further special treatment. */ #define MADV_RANDOM 1 /* Expect random page references. */ #define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ #define MADV_WILLNEED 3 /* Will need these pages. */ #define MADV_DONTNEED 4 /* Don't need these pages. */ #define MADV_FREE 8 /* Free pages only if memory pressure. */ #define MADV_REMOVE 9 /* Remove these pages and resources. */ #define MADV_DONTFORK 10 /* Do not inherit across fork. */ #define MADV_DOFORK 11 /* Do inherit across fork. */ #define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ #define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */ #define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */ #define MADV_DONTDUMP 16 /* Explicity exclude from the core dump, overrides the coredump filter bits. */ #define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */ #define MADV_HWPOISON 100 /* Poison a page for testing. */ #endif /* The POSIX people had to invent similar names for the same things. */ #ifdef __USE_XOPEN2K #define POSIX_MADV_NORMAL 0 /* No further special treatment. */ #define POSIX_MADV_RANDOM 1 /* Expect random page references. */ #define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ #define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ #define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ #endif /* Flags for `mlockall'. */ #ifndef MCL_CURRENT #define MCL_CURRENT 1 /* Lock all currently mapped pages. */ #define MCL_FUTURE 2 /* Lock all additions to address space. */ #define MCL_ONFAULT 4 /* Lock all pages that are faulted in. */ #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/mman.h ================================================ /* Definitions for POSIX memory map interface. Linux/ARM version. Copyright (C) 1997-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library. If not, see . */ #ifndef _SYS_MMAN_H #error "Never use directly; include instead." #endif /* The following definitions basically come from the kernel headers. But the kernel header is not namespace clean. */ /* These are Linux-specific. */ #ifdef __USE_MISC #define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */ #define MAP_DENYWRITE 0x00800 /* ETXTBSY */ #define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */ #define MAP_LOCKED 0x02000 /* Lock the mapping. */ #define MAP_NORESERVE 0x04000 /* Don't check for reservations. */ #define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */ #define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ #define MAP_STACK 0x20000 /* Allocation is for a stack. */ #define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ #endif /* Include generic Linux declarations. */ #include ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/nan.h ================================================ /* `NAN' constant for IEEE 754 machines. Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H #error "Never use directly; include instead." #endif /* IEEE Not A Number. */ #if __GNUC_PREREQ(3,3) #define NAN (__builtin_nanf ("")) #elif defined __GNUC__ #define NAN \ (__extension__ \ ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; }) \ { __l: 0x7fc00000UL }).__d) #else #include #if __BYTE_ORDER == __BIG_ENDIAN #define __qnan_bytes { 0x7f, 0xc0, 0, 0 } #endif #if __BYTE_ORDER == __LITTLE_ENDIAN #define __qnan_bytes { 0, 0, 0xc0, 0x7f } #endif static union { unsigned char __c[4]; float __d; } __qnan_union __attribute__ ((__unused__)) = { __qnan_bytes}; #define NAN (__qnan_union.__d) #endif /* GCC. */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/netdb.h ================================================ /* Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _NETDB_H #error "Never include directly; use instead." #endif /* Description of data base entry for a single network. NOTE: here a poor assumption is made. The network number is expected to fit into an unsigned long int variable. */ struct netent { char *n_name; /* Official name of network. */ char **n_aliases; /* Alias list. */ int n_addrtype; /* Net address type. */ uint32_t n_net; /* Network number. */ }; ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/param.h ================================================ /* Old-style Unix parameters and limits. Linux version. Copyright (C) 1995-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_PARAM_H #error "Never use directly; include instead." #endif #ifndef ARG_MAX #define __undef_ARG_MAX #endif #include #include /* The kernel headers define ARG_MAX. The value is wrong, though. */ #ifdef __undef_ARG_MAX #undef ARG_MAX #undef __undef_ARG_MAX #endif #define MAXSYMLINKS 20 /* The following are not really correct but it is a value we used for a long time and which seems to be usable. People should not use NOFILE and NCARGS anyway. */ #define NOFILE 256 #define NCARGS 131072 ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/posix1_lim.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 2.9.2 Minimum Values Added to * * Never include this file directly; use instead. */ #ifndef _BITS_POSIX1_LIM_H #define _BITS_POSIX1_LIM_H 1 /* These are the standard-mandated minimum values. */ /* Minimum number of operations in one list I/O call. */ #define _POSIX_AIO_LISTIO_MAX 2 /* Minimal number of outstanding asynchronous I/O operations. */ #define _POSIX_AIO_MAX 1 /* Maximum length of arguments to `execve', including environment. */ #define _POSIX_ARG_MAX 4096 /* Maximum simultaneous processes per real user ID. */ #ifdef __USE_XOPEN2K #define _POSIX_CHILD_MAX 25 #else #define _POSIX_CHILD_MAX 6 #endif /* Minimal number of timer expiration overruns. */ #define _POSIX_DELAYTIMER_MAX 32 /* Maximum length of a host name (not including the terminating null) as returned from the GETHOSTNAME function. */ #define _POSIX_HOST_NAME_MAX 255 /* Maximum link count of a file. */ #define _POSIX_LINK_MAX 8 /* Maximum length of login name. */ #define _POSIX_LOGIN_NAME_MAX 9 /* Number of bytes in a terminal canonical input queue. */ #define _POSIX_MAX_CANON 255 /* Number of bytes for which space will be available in a terminal input queue. */ #define _POSIX_MAX_INPUT 255 /* Maximum number of message queues open for a process. */ #define _POSIX_MQ_OPEN_MAX 8 /* Maximum number of supported message priorities. */ #define _POSIX_MQ_PRIO_MAX 32 /* Number of bytes in a filename. */ #define _POSIX_NAME_MAX 14 /* Number of simultaneous supplementary group IDs per process. */ #ifdef __USE_XOPEN2K #define _POSIX_NGROUPS_MAX 8 #else #define _POSIX_NGROUPS_MAX 0 #endif /* Number of files one process can have open at once. */ #ifdef __USE_XOPEN2K #define _POSIX_OPEN_MAX 20 #else #define _POSIX_OPEN_MAX 16 #endif #if !defined __USE_XOPEN2K || defined __USE_GNU /* Number of descriptors that a process may examine with `pselect' or `select'. */ #define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX #endif /* Number of bytes in a pathname. */ #define _POSIX_PATH_MAX 256 /* Number of bytes than can be written atomically to a pipe. */ #define _POSIX_PIPE_BUF 512 /* The number of repeated occurrences of a BRE permitted by the REGEXEC and REGCOMP functions when using the interval notation. */ #define _POSIX_RE_DUP_MAX 255 /* Minimal number of realtime signals reserved for the application. */ #define _POSIX_RTSIG_MAX 8 /* Number of semaphores a process can have. */ #define _POSIX_SEM_NSEMS_MAX 256 /* Maximal value of a semaphore. */ #define _POSIX_SEM_VALUE_MAX 32767 /* Number of pending realtime signals. */ #define _POSIX_SIGQUEUE_MAX 32 /* Largest value of a `ssize_t'. */ #define _POSIX_SSIZE_MAX 32767 /* Number of streams a process can have open at once. */ #define _POSIX_STREAM_MAX 8 /* The number of bytes in a symbolic link. */ #define _POSIX_SYMLINK_MAX 255 /* The number of symbolic links that can be traversed in the resolution of a pathname in the absence of a loop. */ #define _POSIX_SYMLOOP_MAX 8 /* Number of timer for a process. */ #define _POSIX_TIMER_MAX 32 /* Maximum number of characters in a tty name. */ #define _POSIX_TTY_NAME_MAX 9 /* Maximum length of a timezone name (element of `tzname'). */ #ifdef __USE_XOPEN2K #define _POSIX_TZNAME_MAX 6 #else #define _POSIX_TZNAME_MAX 3 #endif #if !defined __USE_XOPEN2K || defined __USE_GNU /* Maximum number of connections that can be queued on a socket. */ #define _POSIX_QLIMIT 1 /* Maximum number of bytes that can be buffered on a socket for send or receive. */ #define _POSIX_HIWAT _POSIX_PIPE_BUF /* Maximum number of elements in an `iovec' array. */ #define _POSIX_UIO_MAXIOV 16 #endif /* Maximum clock resolution in nanoseconds. */ #define _POSIX_CLOCKRES_MIN 20000000 /* Get the implementation-specific values for the above. */ #include #ifndef SSIZE_MAX #define SSIZE_MAX LONG_MAX #endif /* This value is a guaranteed minimum maximum. The current maximum can be got from `sysconf'. */ #ifndef NGROUPS_MAX #define NGROUPS_MAX 8 #endif #endif /* bits/posix1_lim.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/posix2_lim.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; include instead. */ #ifndef _BITS_POSIX2_LIM_H #define _BITS_POSIX2_LIM_H 1 /* The maximum `ibase' and `obase' values allowed by the `bc' utility. */ #define _POSIX2_BC_BASE_MAX 99 /* The maximum number of elements allowed in an array by the `bc' utility. */ #define _POSIX2_BC_DIM_MAX 2048 /* The maximum `scale' value allowed by the `bc' utility. */ #define _POSIX2_BC_SCALE_MAX 99 /* The maximum length of a string constant accepted by the `bc' utility. */ #define _POSIX2_BC_STRING_MAX 1000 /* The maximum number of weights that can be assigned to an entry of the LC_COLLATE `order' keyword in the locale definition file. */ #define _POSIX2_COLL_WEIGHTS_MAX 2 /* The maximum number of expressions that can be nested within parentheses by the `expr' utility. */ #define _POSIX2_EXPR_NEST_MAX 32 /* The maximum length, in bytes, of an input line. */ #define _POSIX2_LINE_MAX 2048 /* The maximum number of repeated occurrences of a regular expression permitted when using the interval notation `\{M,N\}'. */ #define _POSIX2_RE_DUP_MAX 255 /* The maximum number of bytes in a character class name. We have no fixed limit, 2048 is a high number. */ #define _POSIX2_CHARCLASS_NAME_MAX 14 /* These values are implementation-specific, and may vary within the implementation. Their precise values can be obtained from sysconf. */ #ifndef BC_BASE_MAX #define BC_BASE_MAX _POSIX2_BC_BASE_MAX #endif #ifndef BC_DIM_MAX #define BC_DIM_MAX _POSIX2_BC_DIM_MAX #endif #ifndef BC_SCALE_MAX #define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX #endif #ifndef BC_STRING_MAX #define BC_STRING_MAX _POSIX2_BC_STRING_MAX #endif #ifndef COLL_WEIGHTS_MAX #define COLL_WEIGHTS_MAX 255 #endif #ifndef EXPR_NEST_MAX #define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX #endif #ifndef LINE_MAX #define LINE_MAX _POSIX2_LINE_MAX #endif #ifndef CHARCLASS_NAME_MAX #define CHARCLASS_NAME_MAX 2048 #endif /* This value is defined like this in regex.h. */ #define RE_DUP_MAX (0x7fff) #endif /* bits/posix2_lim.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/posix_opt.h ================================================ /* Define POSIX options for Linux. Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see . */ #ifndef _BITS_POSIX_OPT_H #define _BITS_POSIX_OPT_H 1 /* Job control is supported. */ #define _POSIX_JOB_CONTROL 1 /* Processes have a saved set-user-ID and a saved set-group-ID. */ #define _POSIX_SAVED_IDS 1 /* Priority scheduling is supported. */ #define _POSIX_PRIORITY_SCHEDULING 200809L /* Synchronizing file data is supported. */ #define _POSIX_SYNCHRONIZED_IO 200809L /* The fsync function is present. */ #define _POSIX_FSYNC 200809L /* Mapping of files to memory is supported. */ #define _POSIX_MAPPED_FILES 200809L /* Locking of all memory is supported. */ #define _POSIX_MEMLOCK 200809L /* Locking of ranges of memory is supported. */ #define _POSIX_MEMLOCK_RANGE 200809L /* Setting of memory protections is supported. */ #define _POSIX_MEMORY_PROTECTION 200809L /* Some filesystems allow all users to change file ownership. */ #define _POSIX_CHOWN_RESTRICTED 0 /* `c_cc' member of 'struct termios' structure can be disabled by using the value _POSIX_VDISABLE. */ #define _POSIX_VDISABLE '\0' /* Filenames are not silently truncated. */ #define _POSIX_NO_TRUNC 1 /* X/Open realtime support is available. */ #define _XOPEN_REALTIME 1 /* X/Open thread realtime support is available. */ #define _XOPEN_REALTIME_THREADS 1 /* XPG4.2 shared memory is supported. */ #define _XOPEN_SHM 1 /* Tell we have POSIX threads. */ #define _POSIX_THREADS 200809L /* We have the reentrant functions described in POSIX. */ #define _POSIX_REENTRANT_FUNCTIONS 1 #define _POSIX_THREAD_SAFE_FUNCTIONS 200809L /* We provide priority scheduling for threads. */ #define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L /* We support user-defined stack sizes. */ #define _POSIX_THREAD_ATTR_STACKSIZE 200809L /* We support user-defined stacks. */ #define _POSIX_THREAD_ATTR_STACKADDR 200809L /* We support priority inheritence. */ #define _POSIX_THREAD_PRIO_INHERIT 200809L /* We support priority protection, though only for non-robust mutexes. */ #define _POSIX_THREAD_PRIO_PROTECT 200809L #ifdef __USE_XOPEN2K8 /* We support priority inheritence for robust mutexes. */ #define _POSIX_THREAD_ROBUST_PRIO_INHERIT 200809L /* We do not support priority protection for robust mutexes. */ #define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1 #endif /* We support POSIX.1b semaphores. */ #define _POSIX_SEMAPHORES 200809L /* Real-time signals are supported. */ #define _POSIX_REALTIME_SIGNALS 200809L /* We support asynchronous I/O. */ #define _POSIX_ASYNCHRONOUS_IO 200809L #define _POSIX_ASYNC_IO 1 /* Alternative name for Unix98. */ #define _LFS_ASYNCHRONOUS_IO 1 /* Support for prioritization is also available. */ #define _POSIX_PRIORITIZED_IO 200809L /* The LFS support in asynchronous I/O is also available. */ #define _LFS64_ASYNCHRONOUS_IO 1 /* The rest of the LFS is also available. */ #define _LFS_LARGEFILE 1 #define _LFS64_LARGEFILE 1 #define _LFS64_STDIO 1 /* POSIX shared memory objects are implemented. */ #define _POSIX_SHARED_MEMORY_OBJECTS 200809L /* CPU-time clocks support needs to be checked at runtime. */ #define _POSIX_CPUTIME 0 /* Clock support in threads must be also checked at runtime. */ #define _POSIX_THREAD_CPUTIME 0 /* GNU libc provides regular expression handling. */ #define _POSIX_REGEXP 1 /* Reader/Writer locks are available. */ #define _POSIX_READER_WRITER_LOCKS 200809L /* We have a POSIX shell. */ #define _POSIX_SHELL 1 /* We support the Timeouts option. */ #define _POSIX_TIMEOUTS 200809L /* We support spinlocks. */ #define _POSIX_SPIN_LOCKS 200809L /* The `spawn' function family is supported. */ #define _POSIX_SPAWN 200809L /* We have POSIX timers. */ #define _POSIX_TIMERS 200809L /* The barrier functions are available. */ #define _POSIX_BARRIERS 200809L /* POSIX message queues are available. */ #define _POSIX_MESSAGE_PASSING 200809L /* Thread process-shared synchronization is supported. */ #define _POSIX_THREAD_PROCESS_SHARED 200809L /* The monotonic clock might be available. */ #define _POSIX_MONOTONIC_CLOCK 0 /* The clock selection interfaces are available. */ #define _POSIX_CLOCK_SELECTION 200809L /* Advisory information interfaces are available. */ #define _POSIX_ADVISORY_INFO 200809L /* IPv6 support is available. */ #define _POSIX_IPV6 200809L /* Raw socket support is available. */ #define _POSIX_RAW_SOCKETS 200809L /* We have at least one terminal. */ #define _POSIX2_CHAR_TERM 200809L /* Neither process nor thread sporadic server interfaces is available. */ #define _POSIX_SPORADIC_SERVER -1 #define _POSIX_THREAD_SPORADIC_SERVER -1 /* trace.h is not available. */ #define _POSIX_TRACE -1 #define _POSIX_TRACE_EVENT_FILTER -1 #define _POSIX_TRACE_INHERIT -1 #define _POSIX_TRACE_LOG -1 /* Typed memory objects are not available. */ #define _POSIX_TYPED_MEMORY_OBJECTS -1 #endif /* bits/posix_opt.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/pthreadtypes.h ================================================ /* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library. If not, see . */ #ifndef _BITS_PTHREADTYPES_H #define _BITS_PTHREADTYPES_H 1 #include #define __SIZEOF_PTHREAD_ATTR_T 36 #define __SIZEOF_PTHREAD_MUTEX_T 24 #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 #define __SIZEOF_PTHREAD_COND_T 48 #define __SIZEOF_PTHREAD_COND_COMPAT_T 12 #define __SIZEOF_PTHREAD_CONDATTR_T 4 #define __SIZEOF_PTHREAD_RWLOCK_T 32 #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 #define __SIZEOF_PTHREAD_BARRIER_T 20 #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 /* Thread identifiers. The structure of the attribute type is not exposed on purpose. */ typedef unsigned long int pthread_t; union pthread_attr_t { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; }; #ifndef __have_pthread_attr_t typedef union pthread_attr_t pthread_attr_t; #define __have_pthread_attr_t 1 #endif typedef struct __pthread_internal_slist { struct __pthread_internal_slist *__next; } __pthread_slist_t; /* Data structures for mutex handling. The structure of the attribute type is not exposed on purpose. */ typedef union { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; /* KIND must stay at this position in the structure to maintain binary compatibility. */ int __kind; unsigned int __nusers; __extension__ union { int __spins; __pthread_slist_t __list; }; } __data; char __size[__SIZEOF_PTHREAD_MUTEX_T]; long int __align; } pthread_mutex_t; /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ #define __PTHREAD_SPINS 0 typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; long int __align; } pthread_mutexattr_t; /* Data structure for conditional variable handling. The structure of the attribute type is not exposed on purpose. */ typedef union { struct { int __lock; unsigned int __futex; __extension__ unsigned long long int __total_seq; __extension__ unsigned long long int __wakeup_seq; __extension__ unsigned long long int __woken_seq; void *__mutex; unsigned int __nwaiters; unsigned int __broadcast_seq; } __data; char __size[__SIZEOF_PTHREAD_COND_T]; __extension__ long long int __align; } pthread_cond_t; typedef union { char __size[__SIZEOF_PTHREAD_CONDATTR_T]; long int __align; } pthread_condattr_t; /* Keys for thread-specific data */ typedef unsigned int pthread_key_t; /* Once-only execution */ typedef int pthread_once_t; #if defined __USE_UNIX98 || defined __USE_XOPEN2K /* Data structure for read-write lock variable handling. The structure of the attribute type is not exposed on purpose. */ typedef union { struct { int __lock; unsigned int __nr_readers; unsigned int __readers_wakeup; unsigned int __writer_wakeup; unsigned int __nr_readers_queued; unsigned int __nr_writers_queued; #if __BYTE_ORDER == __BIG_ENDIAN unsigned char __pad1; unsigned char __pad2; unsigned char __shared; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned char __flags; #else /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned char __flags; unsigned char __shared; unsigned char __pad1; unsigned char __pad2; #endif int __writer; } __data; char __size[__SIZEOF_PTHREAD_RWLOCK_T]; long int __align; } pthread_rwlock_t; #define __PTHREAD_RWLOCK_ELISION_EXTRA 0 typedef union { char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; long int __align; } pthread_rwlockattr_t; #endif #ifdef __USE_XOPEN2K /* POSIX spinlock data type. */ typedef volatile int pthread_spinlock_t; /* POSIX barriers data type. The structure of the type is deliberately not exposed. */ typedef union { char __size[__SIZEOF_PTHREAD_BARRIER_T]; long int __align; } pthread_barrier_t; typedef union { char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; int __align; } pthread_barrierattr_t; #endif #endif /* bits/pthreadtypes.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/resource.h ================================================ /* Bit values & structures for resource limits. Linux version. Copyright (C) 1994-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_RESOURCE_H #error "Never use directly; include instead." #endif #include /* Transmute defines to enumerations. The macro re-definitions are necessary because some programs want to test for operating system features with #ifdef RUSAGE_SELF. In ISO C the reflexive definition is a no-op. */ /* Kinds of resource limit. */ enum __rlimit_resource { /* Per-process CPU limit, in seconds. */ RLIMIT_CPU = 0, #define RLIMIT_CPU RLIMIT_CPU /* Largest file that can be created, in bytes. */ RLIMIT_FSIZE = 1, #define RLIMIT_FSIZE RLIMIT_FSIZE /* Maximum size of data segment, in bytes. */ RLIMIT_DATA = 2, #define RLIMIT_DATA RLIMIT_DATA /* Maximum size of stack segment, in bytes. */ RLIMIT_STACK = 3, #define RLIMIT_STACK RLIMIT_STACK /* Largest core file that can be created, in bytes. */ RLIMIT_CORE = 4, #define RLIMIT_CORE RLIMIT_CORE /* Largest resident set size, in bytes. This affects swapping; processes that are exceeding their resident set size will be more likely to have physical memory taken from them. */ __RLIMIT_RSS = 5, #define RLIMIT_RSS __RLIMIT_RSS /* Number of open files. */ RLIMIT_NOFILE = 7, __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ #define RLIMIT_NOFILE RLIMIT_NOFILE #define RLIMIT_OFILE __RLIMIT_OFILE /* Address space limit. */ RLIMIT_AS = 9, #define RLIMIT_AS RLIMIT_AS /* Number of processes. */ __RLIMIT_NPROC = 6, #define RLIMIT_NPROC __RLIMIT_NPROC /* Locked-in-memory address space. */ __RLIMIT_MEMLOCK = 8, #define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK /* Maximum number of file locks. */ __RLIMIT_LOCKS = 10, #define RLIMIT_LOCKS __RLIMIT_LOCKS /* Maximum number of pending signals. */ __RLIMIT_SIGPENDING = 11, #define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING /* Maximum bytes in POSIX message queues. */ __RLIMIT_MSGQUEUE = 12, #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE /* Maximum nice priority allowed to raise to. Nice levels 19 .. -20 correspond to 0 .. 39 values of this resource limit. */ __RLIMIT_NICE = 13, #define RLIMIT_NICE __RLIMIT_NICE /* Maximum realtime priority allowed for non-priviledged processes. */ __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO /* Maximum CPU time in µs that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, #define RLIMIT_RTTIME __RLIMIT_RTTIME __RLIMIT_NLIMITS = 16, __RLIM_NLIMITS = __RLIMIT_NLIMITS #define RLIMIT_NLIMITS __RLIMIT_NLIMITS #define RLIM_NLIMITS __RLIM_NLIMITS }; /* Value to indicate that there is no limit. */ #ifndef __USE_FILE_OFFSET64 #define RLIM_INFINITY ((__rlim_t) -1) #else #define RLIM_INFINITY 0xffffffffffffffffuLL #endif #ifdef __USE_LARGEFILE64 #define RLIM64_INFINITY 0xffffffffffffffffuLL #endif /* We can represent all limits. */ #define RLIM_SAVED_MAX RLIM_INFINITY #define RLIM_SAVED_CUR RLIM_INFINITY /* Type for resource quantity measurement. */ #ifndef __USE_FILE_OFFSET64 typedef __rlim_t rlim_t; #else typedef __rlim64_t rlim_t; #endif #ifdef __USE_LARGEFILE64 typedef __rlim64_t rlim64_t; #endif struct rlimit { /* The current (soft) limit. */ rlim_t rlim_cur; /* The hard limit. */ rlim_t rlim_max; }; #ifdef __USE_LARGEFILE64 struct rlimit64 { /* The current (soft) limit. */ rlim64_t rlim_cur; /* The hard limit. */ rlim64_t rlim_max; }; #endif /* Whose usage statistics do you want? */ enum __rusage_who { /* The calling process. */ RUSAGE_SELF = 0, #define RUSAGE_SELF RUSAGE_SELF /* All of its terminated child processes. */ RUSAGE_CHILDREN = -1 #define RUSAGE_CHILDREN RUSAGE_CHILDREN #ifdef __USE_GNU , /* The calling thread. */ RUSAGE_THREAD = 1 #define RUSAGE_THREAD RUSAGE_THREAD /* Name for the same functionality on Solaris. */ #define RUSAGE_LWP RUSAGE_THREAD #endif }; #define __need_timeval #include /* For `struct timeval'. */ /* Structure which says how much of each resource has been used. */ /* The purpose of all the unions is to have the kernel-compatible layout while keeping the API type as 'long int', and among machines where __syscall_slong_t is not 'long int', this only does the right thing for little-endian ones, like x32. */ struct rusage { /* Total amount of user time used. */ struct timeval ru_utime; /* Total amount of system time used. */ struct timeval ru_stime; /* Maximum resident set size (in kilobytes). */ __extension__ union { long int ru_maxrss; __syscall_slong_t __ru_maxrss_word; }; /* Amount of sharing of text segment memory with other processes (kilobyte-seconds). */ /* Maximum resident set size (in kilobytes). */ __extension__ union { long int ru_ixrss; __syscall_slong_t __ru_ixrss_word; }; /* Amount of data segment memory used (kilobyte-seconds). */ __extension__ union { long int ru_idrss; __syscall_slong_t __ru_idrss_word; }; /* Amount of stack memory used (kilobyte-seconds). */ __extension__ union { long int ru_isrss; __syscall_slong_t __ru_isrss_word; }; /* Number of soft page faults (i.e. those serviced by reclaiming a page from the list of pages awaiting reallocation. */ __extension__ union { long int ru_minflt; __syscall_slong_t __ru_minflt_word; }; /* Number of hard page faults (i.e. those that required I/O). */ __extension__ union { long int ru_majflt; __syscall_slong_t __ru_majflt_word; }; /* Number of times a process was swapped out of physical memory. */ __extension__ union { long int ru_nswap; __syscall_slong_t __ru_nswap_word; }; /* Number of input operations via the file system. Note: This and `ru_oublock' do not include operations with the cache. */ __extension__ union { long int ru_inblock; __syscall_slong_t __ru_inblock_word; }; /* Number of output operations via the file system. */ __extension__ union { long int ru_oublock; __syscall_slong_t __ru_oublock_word; }; /* Number of IPC messages sent. */ __extension__ union { long int ru_msgsnd; __syscall_slong_t __ru_msgsnd_word; }; /* Number of IPC messages received. */ __extension__ union { long int ru_msgrcv; __syscall_slong_t __ru_msgrcv_word; }; /* Number of signals delivered. */ __extension__ union { long int ru_nsignals; __syscall_slong_t __ru_nsignals_word; }; /* Number of voluntary context switches, i.e. because the process gave up the process before it had to (usually to wait for some resource to be available). */ __extension__ union { long int ru_nvcsw; __syscall_slong_t __ru_nvcsw_word; }; /* Number of involuntary context switches, i.e. a higher priority process became runnable or the current process used up its time slice. */ __extension__ union { long int ru_nivcsw; __syscall_slong_t __ru_nivcsw_word; }; }; /* Priority limits. */ #define PRIO_MIN -20 /* Minimum priority a process can have. */ #define PRIO_MAX 20 /* Maximum priority a process can have. */ /* The type of the WHICH argument to `getpriority' and `setpriority', indicating what flavor of entity the WHO argument specifies. */ enum __priority_which { PRIO_PROCESS = 0, /* WHO is a process ID. */ #define PRIO_PROCESS PRIO_PROCESS PRIO_PGRP = 1, /* WHO is a process group ID. */ #define PRIO_PGRP PRIO_PGRP PRIO_USER = 2 /* WHO is a user ID. */ #define PRIO_USER PRIO_USER }; __BEGIN_DECLS #ifdef __USE_GNU /* Modify and return resource limits of a process atomically. */ #ifndef __USE_FILE_OFFSET64 extern int prlimit(__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit *__new_limit, struct rlimit *__old_limit) __THROW; #else #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(prlimit, (__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit * __new_limit, struct rlimit * __old_limit), prlimit64); #else #define prlimit prlimit64 #endif #endif #ifdef __USE_LARGEFILE64 extern int prlimit64(__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit64 *__new_limit, struct rlimit64 *__old_limit) __THROW; #endif #endif __END_DECLS ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/sched.h ================================================ /* Definitions of constants and data structure for POSIX 1003.1b-1993 scheduling interface. Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef __need_schedparam #ifndef _SCHED_H #error "Never include directly; use instead." #endif /* Scheduling algorithms. */ #define SCHED_OTHER 0 #define SCHED_FIFO 1 #define SCHED_RR 2 #ifdef __USE_GNU #define SCHED_BATCH 3 #define SCHED_IDLE 5 #define SCHED_RESET_ON_FORK 0x40000000 #endif #ifdef __USE_GNU /* Cloning flags. */ #define CSIGNAL 0x000000ff /* Signal mask to be sent at exit. */ #define CLONE_VM 0x00000100 /* Set if VM shared between processes. */ #define CLONE_FS 0x00000200 /* Set if fs info shared between processes. */ #define CLONE_FILES 0x00000400 /* Set if open files shared between processes. */ #define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared. */ #define CLONE_PTRACE 0x00002000 /* Set if tracing continues on the child. */ #define CLONE_VFORK 0x00004000 /* Set if the parent wants the child to wake it up on mm_release. */ #define CLONE_PARENT 0x00008000 /* Set if we want to have the same parent as the cloner. */ #define CLONE_THREAD 0x00010000 /* Set to add to same thread group. */ #define CLONE_NEWNS 0x00020000 /* Set to create new namespace. */ #define CLONE_SYSVSEM 0x00040000 /* Set to shared SVID SEM_UNDO semantics. */ #define CLONE_SETTLS 0x00080000 /* Set TLS info. */ #define CLONE_PARENT_SETTID 0x00100000 /* Store TID in userlevel buffer before MM copy. */ #define CLONE_CHILD_CLEARTID 0x00200000 /* Register exit futex and memory location to clear. */ #define CLONE_DETACHED 0x00400000 /* Create clone detached. */ #define CLONE_UNTRACED 0x00800000 /* Set if the tracing process can't force CLONE_PTRACE on this clone. */ #define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in the child. */ #define CLONE_NEWCGROUP 0x02000000 /* New cgroup namespace. */ #define CLONE_NEWUTS 0x04000000 /* New utsname group. */ #define CLONE_NEWIPC 0x08000000 /* New ipcs. */ #define CLONE_NEWUSER 0x10000000 /* New user namespace. */ #define CLONE_NEWPID 0x20000000 /* New pid namespace. */ #define CLONE_NEWNET 0x40000000 /* New network namespace. */ #define CLONE_IO 0x80000000 /* Clone I/O context. */ #endif /* The official definition. */ struct sched_param { int __sched_priority; }; __BEGIN_DECLS #ifdef __USE_GNU /* Clone current process. */ extern int clone(int (*__fn) (void *__arg), void *__child_stack, int __flags, void *__arg, ...) __THROW; /* Unshare the specified resources. */ extern int unshare(int __flags) __THROW; /* Get index of currently used CPU. */ extern int sched_getcpu(void) __THROW; /* Switch process to namespace of type NSTYPE indicated by FD. */ extern int setns(int __fd, int __nstype) __THROW; #endif __END_DECLS #endif /* need schedparam */ #if !defined __defined_schedparam \ && (defined __need_schedparam || defined _SCHED_H) #define __defined_schedparam 1 /* Data structure to describe a process' schedulability. */ struct __sched_param { int __sched_priority; }; #undef __need_schedparam #endif #if defined _SCHED_H && !defined __cpu_set_t_defined #define __cpu_set_t_defined /* Size definition for CPU sets. */ #define __CPU_SETSIZE 1024 #define __NCPUBITS (8 * sizeof (__cpu_mask)) /* Type for array elements in 'cpu_set_t'. */ typedef __CPU_MASK_TYPE __cpu_mask; /* Basic access functions. */ #define __CPUELT(cpu) ((cpu) / __NCPUBITS) #define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) /* Data structure to describe CPU mask. */ typedef struct { __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS]; } cpu_set_t; /* Access functions for CPU masks. */ #if __GNUC_PREREQ (2, 91) #define __CPU_ZERO_S(setsize, cpusetp) \ do __builtin_memset (cpusetp, '\0', setsize); while (0) #else #define __CPU_ZERO_S(setsize, cpusetp) \ do { \ size_t __i; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ __cpu_mask *__bits = (cpusetp)->__bits; \ for (__i = 0; __i < __imax; ++__i) \ __bits[__i] = 0; \ } while (0) #endif #define __CPU_SET_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ |= __CPUMASK (__cpu)) \ : 0; })) #define __CPU_CLR_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ &= ~__CPUMASK (__cpu)) \ : 0; })) #define __CPU_ISSET_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? ((((const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ & __CPUMASK (__cpu))) != 0 \ : 0; })) #define __CPU_COUNT_S(setsize, cpusetp) \ __sched_cpucount (setsize, cpusetp) #if __GNUC_PREREQ (2, 91) #define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ (__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0) #else #define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ (__extension__ \ ({ const __cpu_mask *__arr1 = (cpusetp1)->__bits; \ const __cpu_mask *__arr2 = (cpusetp2)->__bits; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ size_t __i; \ for (__i = 0; __i < __imax; ++__i) \ if (__arr1[__i] != __arr2[__i]) \ break; \ __i == __imax; })) #endif #define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \ (__extension__ \ ({ cpu_set_t *__dest = (destset); \ const __cpu_mask *__arr1 = (srcset1)->__bits; \ const __cpu_mask *__arr2 = (srcset2)->__bits; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ size_t __i; \ for (__i = 0; __i < __imax; ++__i) \ ((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i]; \ __dest; })) #define __CPU_ALLOC_SIZE(count) \ ((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask)) #define __CPU_ALLOC(count) __sched_cpualloc (count) #define __CPU_FREE(cpuset) __sched_cpufree (cpuset) __BEGIN_DECLS extern int __sched_cpucount(size_t __setsize, const cpu_set_t * __setp) __THROW; extern cpu_set_t *__sched_cpualloc(size_t __count) __THROW __wur; extern void __sched_cpufree(cpu_set_t * __set) __THROW; __END_DECLS #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/select.h ================================================ /* Copyright (C) 1997-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SELECT_H #error "Never use directly; include instead." #endif /* We don't use `memset' because this would require a prototype and the array isn't too big. */ #define __FD_ZERO(s) \ do { \ unsigned int __i; \ fd_set *__arr = (s); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) #define __FD_SET(d, s) \ ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d))) #define __FD_CLR(d, s) \ ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d))) #define __FD_ISSET(d, s) \ ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0) ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/setjmp.h ================================================ /* Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library. If not, see . */ /* Define the machine-dependent type `jmp_buf'. ARM EABI version. */ #ifndef _BITS_SETJMP_H #define _BITS_SETJMP_H 1 #if !defined _SETJMP_H && !defined _PTHREAD_H #error "Never include directly; use instead." #endif #ifndef __ASSEMBLER__ /* The exact set of registers saved may depend on the particular core in use, as some coprocessor registers may need to be saved. The C Library ABI requires that the buffer be 8-byte aligned, and recommends that the buffer contain 64 words. The first 26 words are occupied by sp, lr, v1-v6, sl, fp, and d8-d15. */ typedef int __jmp_buf[64] __attribute__ ((__aligned__(8))); #endif #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/sigaction.h ================================================ /* The proper definitions for Linux's sigaction. Copyright (C) 1993-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SIGNAL_H #error "Never include directly; use instead." #endif /* Structure describing the action to be taken when a signal arrives. */ struct sigaction { /* Signal handler. */ #ifdef __USE_POSIX199309 union { /* Used if SA_SIGINFO is not set. */ __sighandler_t sa_handler; /* Used if SA_SIGINFO is set. */ void (*sa_sigaction) (int, siginfo_t *, void *); } __sigaction_handler; #define sa_handler __sigaction_handler.sa_handler #define sa_sigaction __sigaction_handler.sa_sigaction #else __sighandler_t sa_handler; #endif /* Additional set of signals to be blocked. */ __sigset_t sa_mask; /* Special flags. */ int sa_flags; /* Restore handler. */ void (*sa_restorer) (void); }; /* Bits in `sa_flags'. */ #define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */ #define SA_NOCLDWAIT 2 /* Don't create zombie on child death. */ #define SA_SIGINFO 4 /* Invoke signal-catching function with three arguments instead of one. */ #if defined __USE_UNIX98 || defined __USE_MISC #define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 #define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ #define SA_NODEFER 0x40000000 /* Don't automatically block the signal when its handler is being executed. */ #define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ #endif #ifdef __USE_MISC #define SA_INTERRUPT 0x20000000 /* Historical no-op. */ /* Some aliases for the SA_ constants. */ #define SA_NOMASK SA_NODEFER #define SA_ONESHOT SA_RESETHAND #define SA_STACK SA_ONSTACK #endif /* Values for the HOW argument to `sigprocmask'. */ #define SIG_BLOCK 0 /* Block signals. */ #define SIG_UNBLOCK 1 /* Unblock signals. */ #define SIG_SETMASK 2 /* Set the set of blocked signals. */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/sigcontext.h ================================================ /* Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H #error "Never use directly; include instead." #endif #ifndef sigcontext_struct /* Kernel headers before 2.1.1 define a struct sigcontext_struct, but we need sigcontext. */ #define sigcontext_struct sigcontext #include /* The Linux kernel headers redefine NULL wrongly, so cleanup afterwards. */ #define __need_NULL #include #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/siginfo.h ================================================ /* siginfo_t, sigevent and constants. Linux version. Copyright (C) 1997-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SIGNAL_H && !defined __need_siginfo_t \ && !defined __need_sigevent_t #error "Never include this file directly. Use instead" #endif #include #if (!defined __have_sigval_t \ && (defined _SIGNAL_H || defined __need_siginfo_t \ || defined __need_sigevent_t)) #define __have_sigval_t 1 /* Type for data associated with a signal. */ typedef union sigval { int sival_int; void *sival_ptr; } sigval_t; #endif #if (!defined __have_siginfo_t \ && (defined _SIGNAL_H || defined __need_siginfo_t)) #define __have_siginfo_t 1 #define __SI_MAX_SIZE 128 #if __WORDSIZE == 64 #define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) #else #define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) #endif typedef struct { int si_signo; /* Signal number. */ int si_errno; /* If non-zero, an errno value associated with this signal, as defined in . */ int si_code; /* Signal code. */ union { int _pad[__SI_PAD_SIZE]; /* kill(). */ struct { __pid_t si_pid; /* Sending process ID. */ __uid_t si_uid; /* Real user ID of sending process. */ } _kill; /* POSIX.1b timers. */ struct { int si_tid; /* Timer ID. */ int si_overrun; /* Overrun count. */ sigval_t si_sigval; /* Signal value. */ } _timer; /* POSIX.1b signals. */ struct { __pid_t si_pid; /* Sending process ID. */ __uid_t si_uid; /* Real user ID of sending process. */ sigval_t si_sigval; /* Signal value. */ } _rt; /* SIGCHLD. */ struct { __pid_t si_pid; /* Which child. */ __uid_t si_uid; /* Real user ID of sending process. */ int si_status; /* Exit value or signal. */ __clock_t si_utime; __clock_t si_stime; } _sigchld; /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */ struct { void *si_addr; /* Faulting insn/memory ref. */ short int si_addr_lsb; /* Valid LSB of the reported address. */ } _sigfault; /* SIGPOLL. */ struct { long int si_band; /* Band event for SIGPOLL. */ int si_fd; } _sigpoll; /* SIGSYS. */ struct { void *_call_addr; /* Calling user insn. */ int _syscall; /* Triggering system call number. */ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */ } _sigsys; } _sifields; } siginfo_t; /* X/Open requires some more fields with fixed names. */ #define si_pid _sifields._kill.si_pid #define si_uid _sifields._kill.si_uid #define si_timerid _sifields._timer.si_tid #define si_overrun _sifields._timer.si_overrun #define si_status _sifields._sigchld.si_status #define si_utime _sifields._sigchld.si_utime #define si_stime _sifields._sigchld.si_stime #define si_value _sifields._rt.si_sigval #define si_int _sifields._rt.si_sigval.sival_int #define si_ptr _sifields._rt.si_sigval.sival_ptr #define si_addr _sifields._sigfault.si_addr #define si_addr_lsb _sifields._sigfault.si_addr_lsb #define si_band _sifields._sigpoll.si_band #define si_fd _sifields._sigpoll.si_fd #define si_call_addr _sifields._sigsys._call_addr #define si_syscall _sifields._sigsys._syscall #define si_arch _sifields._sigsys._arch /* Values for `si_code'. Positive values are reserved for kernel-generated signals. */ enum { SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */ #define SI_ASYNCNL SI_ASYNCNL SI_TKILL = -6, /* Sent by tkill. */ #define SI_TKILL SI_TKILL SI_SIGIO, /* Sent by queued SIGIO. */ #define SI_SIGIO SI_SIGIO SI_ASYNCIO, /* Sent by AIO completion. */ #define SI_ASYNCIO SI_ASYNCIO SI_MESGQ, /* Sent by real time mesq state change. */ #define SI_MESGQ SI_MESGQ SI_TIMER, /* Sent by timer expiration. */ #define SI_TIMER SI_TIMER SI_QUEUE, /* Sent by sigqueue. */ #define SI_QUEUE SI_QUEUE SI_USER, /* Sent by kill, sigsend. */ #define SI_USER SI_USER SI_KERNEL = 0x80 /* Send by kernel. */ #define SI_KERNEL SI_KERNEL }; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* `si_code' values for SIGILL signal. */ enum { ILL_ILLOPC = 1, /* Illegal opcode. */ #define ILL_ILLOPC ILL_ILLOPC ILL_ILLOPN, /* Illegal operand. */ #define ILL_ILLOPN ILL_ILLOPN ILL_ILLADR, /* Illegal addressing mode. */ #define ILL_ILLADR ILL_ILLADR ILL_ILLTRP, /* Illegal trap. */ #define ILL_ILLTRP ILL_ILLTRP ILL_PRVOPC, /* Privileged opcode. */ #define ILL_PRVOPC ILL_PRVOPC ILL_PRVREG, /* Privileged register. */ #define ILL_PRVREG ILL_PRVREG ILL_COPROC, /* Coprocessor error. */ #define ILL_COPROC ILL_COPROC ILL_BADSTK /* Internal stack error. */ #define ILL_BADSTK ILL_BADSTK }; /* `si_code' values for SIGFPE signal. */ enum { FPE_INTDIV = 1, /* Integer divide by zero. */ #define FPE_INTDIV FPE_INTDIV FPE_INTOVF, /* Integer overflow. */ #define FPE_INTOVF FPE_INTOVF FPE_FLTDIV, /* Floating point divide by zero. */ #define FPE_FLTDIV FPE_FLTDIV FPE_FLTOVF, /* Floating point overflow. */ #define FPE_FLTOVF FPE_FLTOVF FPE_FLTUND, /* Floating point underflow. */ #define FPE_FLTUND FPE_FLTUND FPE_FLTRES, /* Floating point inexact result. */ #define FPE_FLTRES FPE_FLTRES FPE_FLTINV, /* Floating point invalid operation. */ #define FPE_FLTINV FPE_FLTINV FPE_FLTSUB /* Subscript out of range. */ #define FPE_FLTSUB FPE_FLTSUB }; /* `si_code' values for SIGSEGV signal. */ enum { SEGV_MAPERR = 1, /* Address not mapped to object. */ #define SEGV_MAPERR SEGV_MAPERR SEGV_ACCERR /* Invalid permissions for mapped object. */ #define SEGV_ACCERR SEGV_ACCERR }; /* `si_code' values for SIGBUS signal. */ enum { BUS_ADRALN = 1, /* Invalid address alignment. */ #define BUS_ADRALN BUS_ADRALN BUS_ADRERR, /* Non-existant physical address. */ #define BUS_ADRERR BUS_ADRERR BUS_OBJERR, /* Object specific hardware error. */ #define BUS_OBJERR BUS_OBJERR BUS_MCEERR_AR, /* Hardware memory error: action required. */ #define BUS_MCEERR_AR BUS_MCEERR_AR BUS_MCEERR_AO /* Hardware memory error: action optional. */ #define BUS_MCEERR_AO BUS_MCEERR_AO }; #endif #ifdef __USE_XOPEN_EXTENDED /* `si_code' values for SIGTRAP signal. */ enum { TRAP_BRKPT = 1, /* Process breakpoint. */ #define TRAP_BRKPT TRAP_BRKPT TRAP_TRACE /* Process trace trap. */ #define TRAP_TRACE TRAP_TRACE }; #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* `si_code' values for SIGCHLD signal. */ enum { CLD_EXITED = 1, /* Child has exited. */ #define CLD_EXITED CLD_EXITED CLD_KILLED, /* Child was killed. */ #define CLD_KILLED CLD_KILLED CLD_DUMPED, /* Child terminated abnormally. */ #define CLD_DUMPED CLD_DUMPED CLD_TRAPPED, /* Traced child has trapped. */ #define CLD_TRAPPED CLD_TRAPPED CLD_STOPPED, /* Child has stopped. */ #define CLD_STOPPED CLD_STOPPED CLD_CONTINUED /* Stopped child has continued. */ #define CLD_CONTINUED CLD_CONTINUED }; /* `si_code' values for SIGPOLL signal. */ enum { POLL_IN = 1, /* Data input available. */ #define POLL_IN POLL_IN POLL_OUT, /* Output buffers available. */ #define POLL_OUT POLL_OUT POLL_MSG, /* Input message available. */ #define POLL_MSG POLL_MSG POLL_ERR, /* I/O error. */ #define POLL_ERR POLL_ERR POLL_PRI, /* High priority input available. */ #define POLL_PRI POLL_PRI POLL_HUP /* Device disconnected. */ #define POLL_HUP POLL_HUP }; #endif #undef __need_siginfo_t #endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ #if (defined _SIGNAL_H || defined __need_sigevent_t) \ && !defined __have_sigevent_t #define __have_sigevent_t 1 /* Structure to transport application-defined values with signals. */ #define __SIGEV_MAX_SIZE 64 #if __WORDSIZE == 64 #define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4) #else #define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) #endif /* Forward declaration. */ #ifndef __have_pthread_attr_t typedef union pthread_attr_t pthread_attr_t; #define __have_pthread_attr_t 1 #endif typedef struct sigevent { sigval_t sigev_value; int sigev_signo; int sigev_notify; union { int _pad[__SIGEV_PAD_SIZE]; /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the thread to receive the signal. */ __pid_t _tid; struct { void (*_function) (sigval_t); /* Function to start. */ pthread_attr_t *_attribute; /* Thread attributes. */ } _sigev_thread; } _sigev_un; } sigevent_t; /* POSIX names to access some of the members. */ #define sigev_notify_function _sigev_un._sigev_thread._function #define sigev_notify_attributes _sigev_un._sigev_thread._attribute /* `sigev_notify' values. */ enum { SIGEV_SIGNAL = 0, /* Notify via signal. */ #define SIGEV_SIGNAL SIGEV_SIGNAL SIGEV_NONE, /* Other notification: meaningless. */ #define SIGEV_NONE SIGEV_NONE SIGEV_THREAD, /* Deliver via thread creation. */ #define SIGEV_THREAD SIGEV_THREAD SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */ #define SIGEV_THREAD_ID SIGEV_THREAD_ID }; #endif /* have _SIGNAL_H. */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/signum.h ================================================ /* Signal number definitions. Linux version. Copyright (C) 1995-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifdef _SIGNAL_H /* Fake signal functions. */ #define SIG_ERR ((__sighandler_t) -1) /* Error return. */ #define SIG_DFL ((__sighandler_t) 0) /* Default action. */ #define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ #ifdef __USE_UNIX98 #define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */ #endif /* Signals. */ #define SIGHUP 1 /* Hangup (POSIX). */ #define SIGINT 2 /* Interrupt (ANSI). */ #define SIGQUIT 3 /* Quit (POSIX). */ #define SIGILL 4 /* Illegal instruction (ANSI). */ #define SIGTRAP 5 /* Trace trap (POSIX). */ #define SIGABRT 6 /* Abort (ANSI). */ #define SIGIOT 6 /* IOT trap (4.2 BSD). */ #define SIGBUS 7 /* BUS error (4.2 BSD). */ #define SIGFPE 8 /* Floating-point exception (ANSI). */ #define SIGKILL 9 /* Kill, unblockable (POSIX). */ #define SIGUSR1 10 /* User-defined signal 1 (POSIX). */ #define SIGSEGV 11 /* Segmentation violation (ANSI). */ #define SIGUSR2 12 /* User-defined signal 2 (POSIX). */ #define SIGPIPE 13 /* Broken pipe (POSIX). */ #define SIGALRM 14 /* Alarm clock (POSIX). */ #define SIGTERM 15 /* Termination (ANSI). */ #define SIGSTKFLT 16 /* Stack fault. */ #define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ #define SIGCHLD 17 /* Child status has changed (POSIX). */ #define SIGCONT 18 /* Continue (POSIX). */ #define SIGSTOP 19 /* Stop, unblockable (POSIX). */ #define SIGTSTP 20 /* Keyboard stop (POSIX). */ #define SIGTTIN 21 /* Background read from tty (POSIX). */ #define SIGTTOU 22 /* Background write to tty (POSIX). */ #define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */ #define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */ #define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */ #define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */ #define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */ #define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ #define SIGPOLL SIGIO /* Pollable event occurred (System V). */ #define SIGIO 29 /* I/O now possible (4.2 BSD). */ #define SIGPWR 30 /* Power failure restart (System V). */ #define SIGSYS 31 /* Bad system call. */ #define SIGUNUSED 31 #define _NSIG 65 /* Biggest signal number + 1 (including real-time signals). */ #define SIGRTMIN (__libc_current_sigrtmin ()) #define SIGRTMAX (__libc_current_sigrtmax ()) /* These are the hard limits of the kernel. These values should not be used directly at user level. */ #define __SIGRTMIN 32 #define __SIGRTMAX (_NSIG - 1) #endif /* included. */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/sigset.h ================================================ /* __sig_atomic_t, __sigset_t, and related definitions. Linux version. Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SIGSET_H_types #define _SIGSET_H_types 1 typedef int __sig_atomic_t; /* A `sigset_t' has a bit for each signal. */ #define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) typedef struct { unsigned long int __val[_SIGSET_NWORDS]; } __sigset_t; #endif /* We only want to define these functions if was actually included; otherwise we were included just to define the types. Since we are namespace-clean, it wouldn't hurt to define extra macros. But trouble can be caused by functions being defined (e.g., any global register vars declared later will cause compilation errors). */ #if !defined _SIGSET_H_fns && defined _SIGNAL_H #define _SIGSET_H_fns 1 #ifndef _EXTERN_INLINE #define _EXTERN_INLINE __extern_inline #endif /* Return a mask that includes the bit for SIG only. */ #define __sigmask(sig) \ (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int)))) /* Return the word index for SIG. */ #define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int))) #if defined __GNUC__ && __GNUC__ >= 2 #define __sigemptyset(set) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ sigset_t *__set = (set); \ while (--__cnt >= 0) __set->__val[__cnt] = 0; \ 0; })) #define __sigfillset(set) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ sigset_t *__set = (set); \ while (--__cnt >= 0) __set->__val[__cnt] = ~0UL; \ 0; })) #ifdef __USE_GNU /* The POSIX does not specify for handling the whole signal set in one command. This is often wanted and so we define three more functions here. */ #define __sigisemptyset(set) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ const sigset_t *__set = (set); \ int __ret = __set->__val[--__cnt]; \ while (!__ret && --__cnt >= 0) \ __ret = __set->__val[__cnt]; \ __ret == 0; })) #define __sigandset(dest, left, right) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ sigset_t *__dest = (dest); \ const sigset_t *__left = (left); \ const sigset_t *__right = (right); \ while (--__cnt >= 0) \ __dest->__val[__cnt] = (__left->__val[__cnt] \ & __right->__val[__cnt]); \ 0; })) #define __sigorset(dest, left, right) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ sigset_t *__dest = (dest); \ const sigset_t *__left = (left); \ const sigset_t *__right = (right); \ while (--__cnt >= 0) \ __dest->__val[__cnt] = (__left->__val[__cnt] \ | __right->__val[__cnt]); \ 0; })) #endif #endif /* These functions needn't check for a bogus signal number -- error checking is done in the non __ versions. */ extern int __sigismember(const __sigset_t *, int); extern int __sigaddset(__sigset_t *, int); extern int __sigdelset(__sigset_t *, int); #ifdef __USE_EXTERN_INLINES #define __SIGSETFN(NAME, BODY, CONST) \ _EXTERN_INLINE int \ NAME (CONST __sigset_t *__set, int __sig) \ { \ unsigned long int __mask = __sigmask (__sig); \ unsigned long int __word = __sigword (__sig); \ return BODY; \ } __SIGSETFN(__sigismember, (__set->__val[__word] & __mask) ? 1 : 0, const) __SIGSETFN(__sigaddset, ((__set->__val[__word] |= __mask), 0),) __SIGSETFN(__sigdelset, ((__set->__val[__word] &= ~__mask), 0),) #undef __SIGSETFN #endif #endif /* ! _SIGSET_H_fns. */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/sigstack.h ================================================ /* sigstack, sigaltstack definitions. Copyright (C) 1998-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SIGNAL_H #error "Never include this file directly. Use instead" #endif /* Structure describing a signal stack (obsolete). */ struct sigstack { void *ss_sp; /* Signal stack pointer. */ int ss_onstack; /* Nonzero if executing on this stack. */ }; /* Possible values for `ss_flags.'. */ enum { SS_ONSTACK = 1, #define SS_ONSTACK SS_ONSTACK SS_DISABLE #define SS_DISABLE SS_DISABLE }; /* Minimum stack size for a signal handler. */ #define MINSIGSTKSZ 2048 /* System default stack size. */ #define SIGSTKSZ 8192 /* Alternate, preferred interface. */ typedef struct sigaltstack { void *ss_sp; int ss_flags; size_t ss_size; } stack_t; ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/sigthread.h ================================================ /* Signal handling function for threaded programs. Copyright (C) 1998-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see . */ #ifndef _BITS_SIGTHREAD_H #define _BITS_SIGTHREAD_H 1 #if !defined _SIGNAL_H && !defined _PTHREAD_H #error "Never include this file directly. Use instead" #endif /* Functions for handling signals. */ /* Modify the signal mask for the calling thread. The arguments have the same meaning as for sigprocmask(2). */ extern int pthread_sigmask(int __how, const __sigset_t * __restrict __newmask, __sigset_t * __restrict __oldmask) __THROW; /* Send signal SIGNO to the given thread. */ extern int pthread_kill(pthread_t __threadid, int __signo) __THROW; #ifdef __USE_GNU /* Queue signal and data to a thread. */ extern int pthread_sigqueue(pthread_t __threadid, int __signo, const union sigval __value) __THROW; #endif #endif /* bits/sigthread.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/sockaddr.h ================================================ /* Definition of struct sockaddr_* common members and sizes, generic version. Copyright (C) 1995-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ #ifndef _BITS_SOCKADDR_H #define _BITS_SOCKADDR_H 1 /* POSIX.1g specifies this type name for the `sa_family' member. */ typedef unsigned short int sa_family_t; /* This macro is used to declare the initial common members of the data types used for socket addresses, `struct sockaddr', `struct sockaddr_in', `struct sockaddr_un', etc. */ #define __SOCKADDR_COMMON(sa_prefix) \ sa_family_t sa_prefix##family #define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) /* Size of struct sockaddr_storage. */ #define _SS_SIZE 128 #endif /* bits/sockaddr.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/socket.h ================================================ /* System-specific socket constants and types. Linux version. Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef __BITS_SOCKET_H #define __BITS_SOCKET_H #ifndef _SYS_SOCKET_H #error "Never include directly; use instead." #endif #define __need_size_t #include #include /* Type for length arguments in socket calls. */ #ifndef __socklen_t_defined typedef __socklen_t socklen_t; #define __socklen_t_defined #endif /* Get the architecture-dependent definition of enum __socket_type. */ #include /* Protocol families. */ #define PF_UNSPEC 0 /* Unspecified. */ #define PF_LOCAL 1 /* Local to host (pipes and file-domain). */ #define PF_UNIX PF_LOCAL /* POSIX name for PF_LOCAL. */ #define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */ #define PF_INET 2 /* IP protocol family. */ #define PF_AX25 3 /* Amateur Radio AX.25. */ #define PF_IPX 4 /* Novell Internet Protocol. */ #define PF_APPLETALK 5 /* Appletalk DDP. */ #define PF_NETROM 6 /* Amateur radio NetROM. */ #define PF_BRIDGE 7 /* Multiprotocol bridge. */ #define PF_ATMPVC 8 /* ATM PVCs. */ #define PF_X25 9 /* Reserved for X.25 project. */ #define PF_INET6 10 /* IP version 6. */ #define PF_ROSE 11 /* Amateur Radio X.25 PLP. */ #define PF_DECnet 12 /* Reserved for DECnet project. */ #define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */ #define PF_SECURITY 14 /* Security callback pseudo AF. */ #define PF_KEY 15 /* PF_KEY key management API. */ #define PF_NETLINK 16 #define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */ #define PF_PACKET 17 /* Packet family. */ #define PF_ASH 18 /* Ash. */ #define PF_ECONET 19 /* Acorn Econet. */ #define PF_ATMSVC 20 /* ATM SVCs. */ #define PF_RDS 21 /* RDS sockets. */ #define PF_SNA 22 /* Linux SNA Project */ #define PF_IRDA 23 /* IRDA sockets. */ #define PF_PPPOX 24 /* PPPoX sockets. */ #define PF_WANPIPE 25 /* Wanpipe API sockets. */ #define PF_LLC 26 /* Linux LLC. */ #define PF_IB 27 /* Native InfiniBand address. */ #define PF_MPLS 28 /* MPLS. */ #define PF_CAN 29 /* Controller Area Network. */ #define PF_TIPC 30 /* TIPC sockets. */ #define PF_BLUETOOTH 31 /* Bluetooth sockets. */ #define PF_IUCV 32 /* IUCV sockets. */ #define PF_RXRPC 33 /* RxRPC sockets. */ #define PF_ISDN 34 /* mISDN sockets. */ #define PF_PHONET 35 /* Phonet sockets. */ #define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */ #define PF_CAIF 37 /* CAIF sockets. */ #define PF_ALG 38 /* Algorithm sockets. */ #define PF_NFC 39 /* NFC sockets. */ #define PF_VSOCK 40 /* vSockets. */ #define PF_KCM 41 /* Kernel Connection Multiplexor. */ #define PF_MAX 42 /* For now.. */ /* Address families. */ #define AF_UNSPEC PF_UNSPEC #define AF_LOCAL PF_LOCAL #define AF_UNIX PF_UNIX #define AF_FILE PF_FILE #define AF_INET PF_INET #define AF_AX25 PF_AX25 #define AF_IPX PF_IPX #define AF_APPLETALK PF_APPLETALK #define AF_NETROM PF_NETROM #define AF_BRIDGE PF_BRIDGE #define AF_ATMPVC PF_ATMPVC #define AF_X25 PF_X25 #define AF_INET6 PF_INET6 #define AF_ROSE PF_ROSE #define AF_DECnet PF_DECnet #define AF_NETBEUI PF_NETBEUI #define AF_SECURITY PF_SECURITY #define AF_KEY PF_KEY #define AF_NETLINK PF_NETLINK #define AF_ROUTE PF_ROUTE #define AF_PACKET PF_PACKET #define AF_ASH PF_ASH #define AF_ECONET PF_ECONET #define AF_ATMSVC PF_ATMSVC #define AF_RDS PF_RDS #define AF_SNA PF_SNA #define AF_IRDA PF_IRDA #define AF_PPPOX PF_PPPOX #define AF_WANPIPE PF_WANPIPE #define AF_LLC PF_LLC #define AF_IB PF_IB #define AF_MPLS PF_MPLS #define AF_CAN PF_CAN #define AF_TIPC PF_TIPC #define AF_BLUETOOTH PF_BLUETOOTH #define AF_IUCV PF_IUCV #define AF_RXRPC PF_RXRPC #define AF_ISDN PF_ISDN #define AF_PHONET PF_PHONET #define AF_IEEE802154 PF_IEEE802154 #define AF_CAIF PF_CAIF #define AF_ALG PF_ALG #define AF_NFC PF_NFC #define AF_VSOCK PF_VSOCK #define AF_KCM PF_KCM #define AF_MAX PF_MAX /* Socket level values. Others are defined in the appropriate headers. XXX These definitions also should go into the appropriate headers as far as they are available. */ #define SOL_RAW 255 #define SOL_DECNET 261 #define SOL_X25 262 #define SOL_PACKET 263 #define SOL_ATM 264 /* ATM layer (cell level). */ #define SOL_AAL 265 /* ATM Adaption Layer (packet level). */ #define SOL_IRDA 266 #define SOL_NETBEUI 267 #define SOL_LLC 268 #define SOL_DCCP 269 #define SOL_NETLINK 270 #define SOL_TIPC 271 #define SOL_RXRPC 272 #define SOL_PPPOL2TP 273 #define SOL_BLUETOOTH 274 #define SOL_PNPIPE 275 #define SOL_RDS 276 #define SOL_IUCV 277 #define SOL_CAIF 278 #define SOL_ALG 279 #define SOL_NFC 280 #define SOL_KCM 281 /* Maximum queue length specifiable by listen. */ #define SOMAXCONN 128 /* Get the definition of the macro to define the common sockaddr members. */ #include /* Structure describing a generic socket address. */ struct sockaddr { __SOCKADDR_COMMON(sa_); /* Common data: address family and length. */ char sa_data[14]; /* Address data. */ }; /* Structure large enough to hold any socket address (with the historical exception of AF_UNIX). */ #define __ss_aligntype unsigned long int #define _SS_PADSIZE \ (_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype)) struct sockaddr_storage { __SOCKADDR_COMMON(ss_); /* Address family, etc. */ char __ss_padding[_SS_PADSIZE]; __ss_aligntype __ss_align; /* Force desired alignment. */ }; /* Bits in the FLAGS argument to `send', `recv', et al. */ enum { MSG_OOB = 0x01, /* Process out-of-band data. */ #define MSG_OOB MSG_OOB MSG_PEEK = 0x02, /* Peek at incoming messages. */ #define MSG_PEEK MSG_PEEK MSG_DONTROUTE = 0x04, /* Don't use local routing. */ #define MSG_DONTROUTE MSG_DONTROUTE #ifdef __USE_GNU /* DECnet uses a different name. */ MSG_TRYHARD = MSG_DONTROUTE, #define MSG_TRYHARD MSG_DONTROUTE #endif MSG_CTRUNC = 0x08, /* Control data lost before delivery. */ #define MSG_CTRUNC MSG_CTRUNC MSG_PROXY = 0x10, /* Supply or ask second address. */ #define MSG_PROXY MSG_PROXY MSG_TRUNC = 0x20, #define MSG_TRUNC MSG_TRUNC MSG_DONTWAIT = 0x40, /* Nonblocking IO. */ #define MSG_DONTWAIT MSG_DONTWAIT MSG_EOR = 0x80, /* End of record. */ #define MSG_EOR MSG_EOR MSG_WAITALL = 0x100, /* Wait for a full request. */ #define MSG_WAITALL MSG_WAITALL MSG_FIN = 0x200, #define MSG_FIN MSG_FIN MSG_SYN = 0x400, #define MSG_SYN MSG_SYN MSG_CONFIRM = 0x800, /* Confirm path validity. */ #define MSG_CONFIRM MSG_CONFIRM MSG_RST = 0x1000, #define MSG_RST MSG_RST MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */ #define MSG_ERRQUEUE MSG_ERRQUEUE MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */ #define MSG_NOSIGNAL MSG_NOSIGNAL MSG_MORE = 0x8000, /* Sender will send more. */ #define MSG_MORE MSG_MORE MSG_WAITFORONE = 0x10000, /* Wait for at least one packet to return. */ #define MSG_WAITFORONE MSG_WAITFORONE MSG_BATCH = 0x40000, /* sendmmsg: more messages coming. */ #define MSG_BATCH MSG_BATCH MSG_FASTOPEN = 0x20000000, /* Send data in TCP SYN. */ #define MSG_FASTOPEN MSG_FASTOPEN MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file descriptor received through SCM_RIGHTS. */ #define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC }; /* Structure describing messages sent by `sendmsg' and received by `recvmsg'. */ struct msghdr { void *msg_name; /* Address to send to/receive from. */ socklen_t msg_namelen; /* Length of address data. */ struct iovec *msg_iov; /* Vector of data to send/receive into. */ size_t msg_iovlen; /* Number of elements in the vector. */ void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ size_t msg_controllen; /* Ancillary data buffer length. !! The type should be socklen_t but the definition of the kernel is incompatible with this. */ int msg_flags; /* Flags on received message. */ }; /* Structure used for storage of ancillary data object information. */ struct cmsghdr { size_t cmsg_len; /* Length of data in cmsg_data plus length of cmsghdr structure. !! The type should be socklen_t but the definition of the kernel is incompatible with this. */ int cmsg_level; /* Originating protocol. */ int cmsg_type; /* Protocol specific type. */ #if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */ #endif }; /* Ancillary data object manipulation macros. */ #if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L #define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data) #else #define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) #endif #define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg) #define CMSG_FIRSTHDR(mhdr) \ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0) #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \ & (size_t) ~(sizeof (size_t) - 1)) #define CMSG_SPACE(len) (CMSG_ALIGN (len) \ + CMSG_ALIGN (sizeof (struct cmsghdr))) #define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) extern struct cmsghdr *__cmsg_nxthdr(struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW; #ifdef __USE_EXTERN_INLINES #ifndef _EXTERN_INLINE #define _EXTERN_INLINE __extern_inline #endif _EXTERN_INLINE struct cmsghdr *__NTH(__cmsg_nxthdr(struct msghdr *__mhdr, struct cmsghdr *__cmsg)) { if ((size_t) __cmsg->cmsg_len < sizeof(struct cmsghdr)) /* The kernel header does this so there may be a reason. */ return (struct cmsghdr *)0; __cmsg = (struct cmsghdr *)((unsigned char *)__cmsg + CMSG_ALIGN(__cmsg->cmsg_len)); if ((unsigned char *)(__cmsg + 1) > ((unsigned char *)__mhdr->msg_control + __mhdr->msg_controllen) || ((unsigned char *)__cmsg + CMSG_ALIGN(__cmsg->cmsg_len) > ((unsigned char *)__mhdr->msg_control + __mhdr->msg_controllen))) /* No more entries. */ return (struct cmsghdr *)0; return __cmsg; } #endif /* Use `extern inline'. */ /* Socket level message types. This must match the definitions in . */ enum { SCM_RIGHTS = 0x01 /* Transfer file descriptors. */ #define SCM_RIGHTS SCM_RIGHTS #ifdef __USE_GNU , SCM_CREDENTIALS = 0x02 /* Credentials passing. */ #define SCM_CREDENTIALS SCM_CREDENTIALS #endif }; #ifdef __USE_GNU /* User visible structure for SCM_CREDENTIALS message */ struct ucred { pid_t pid; /* PID of sending process. */ uid_t uid; /* UID of sending process. */ gid_t gid; /* GID of sending process. */ }; #endif /* Ugly workaround for unclean kernel headers. */ #ifndef __USE_MISC #ifndef FIOGETOWN #define __SYS_SOCKET_H_undef_FIOGETOWN #endif #ifndef FIOSETOWN #define __SYS_SOCKET_H_undef_FIOSETOWN #endif #ifndef SIOCATMARK #define __SYS_SOCKET_H_undef_SIOCATMARK #endif #ifndef SIOCGPGRP #define __SYS_SOCKET_H_undef_SIOCGPGRP #endif #ifndef SIOCGSTAMP #define __SYS_SOCKET_H_undef_SIOCGSTAMP #endif #ifndef SIOCGSTAMPNS #define __SYS_SOCKET_H_undef_SIOCGSTAMPNS #endif #ifndef SIOCSPGRP #define __SYS_SOCKET_H_undef_SIOCSPGRP #endif #endif /* Get socket manipulation related informations from kernel headers. */ #include #ifndef __USE_MISC #ifdef __SYS_SOCKET_H_undef_FIOGETOWN #undef __SYS_SOCKET_H_undef_FIOGETOWN #undef FIOGETOWN #endif #ifdef __SYS_SOCKET_H_undef_FIOSETOWN #undef __SYS_SOCKET_H_undef_FIOSETOWN #undef FIOSETOWN #endif #ifdef __SYS_SOCKET_H_undef_SIOCATMARK #undef __SYS_SOCKET_H_undef_SIOCATMARK #undef SIOCATMARK #endif #ifdef __SYS_SOCKET_H_undef_SIOCGPGRP #undef __SYS_SOCKET_H_undef_SIOCGPGRP #undef SIOCGPGRP #endif #ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP #undef __SYS_SOCKET_H_undef_SIOCGSTAMP #undef SIOCGSTAMP #endif #ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS #undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS #undef SIOCGSTAMPNS #endif #ifdef __SYS_SOCKET_H_undef_SIOCSPGRP #undef __SYS_SOCKET_H_undef_SIOCSPGRP #undef SIOCSPGRP #endif #endif /* Structure used to manipulate the SO_LINGER option. */ struct linger { int l_onoff; /* Nonzero to linger on close. */ int l_linger; /* Time to linger. */ }; #endif /* bits/socket.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/socket_type.h ================================================ /* Define enum __socket_type for generic Linux. Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SOCKET_H #error "Never include directly; use instead." #endif /* Types of sockets. */ enum __socket_type { SOCK_STREAM = 1, /* Sequenced, reliable, connection-based byte streams. */ #define SOCK_STREAM SOCK_STREAM SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams of fixed maximum length. */ #define SOCK_DGRAM SOCK_DGRAM SOCK_RAW = 3, /* Raw protocol interface. */ #define SOCK_RAW SOCK_RAW SOCK_RDM = 4, /* Reliably-delivered messages. */ #define SOCK_RDM SOCK_RDM SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, datagrams of fixed maximum length. */ #define SOCK_SEQPACKET SOCK_SEQPACKET SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */ #define SOCK_DCCP SOCK_DCCP SOCK_PACKET = 10, /* Linux specific way of getting packets at the dev level. For writing rarp and other similar things on the user level. */ #define SOCK_PACKET SOCK_PACKET /* Flags to be ORed into the type parameter of socket and socketpair and used for the flags parameter of paccept. */ SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the new descriptor(s). */ #define SOCK_CLOEXEC SOCK_CLOEXEC SOCK_NONBLOCK = 00004000 /* Atomically mark descriptor(s) as non-blocking. */ #define SOCK_NONBLOCK SOCK_NONBLOCK }; ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/stat.h ================================================ /* Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SYS_STAT_H && !defined _FCNTL_H #error "Never include directly; use instead." #endif #ifndef _BITS_STAT_H #define _BITS_STAT_H 1 /* Versions of the `struct stat' data structure. */ #define _STAT_VER_LINUX_OLD 1 #define _STAT_VER_KERNEL 1 #define _STAT_VER_SVR4 2 #define _STAT_VER_LINUX 3 #define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ /* Versions of the `xmknod' interface. */ #define _MKNOD_VER_LINUX 1 #define _MKNOD_VER_SVR4 2 #define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ struct stat { __dev_t st_dev; /* Device. */ unsigned short int __pad1; #ifndef __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ #else __ino_t __st_ino; /* 32bit file serial number. */ #endif __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group. */ __dev_t st_rdev; /* Device number, if device. */ unsigned short int __pad2; #ifndef __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ #else __off64_t st_size; /* Size of file, in bytes. */ #endif __blksize_t st_blksize; /* Optimal block size for I/O. */ #ifndef __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ #else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif #ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the identifier 'timespec' to appear in the header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ #define st_atime st_atim.tv_sec /* Backward compatibility. */ #define st_mtime st_mtim.tv_sec #define st_ctime st_ctim.tv_sec #else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ #endif #ifndef __USE_FILE_OFFSET64 unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; #else __ino64_t st_ino; /* File serial number. */ #endif }; #ifdef __USE_LARGEFILE64 struct stat64 { __dev_t st_dev; /* Device. */ unsigned int __pad1; __ino_t __st_ino; /* 32bit file serial number. */ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group. */ __dev_t st_rdev; /* Device number, if device. */ unsigned int __pad2; __off64_t st_size; /* Size of file, in bytes. */ __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the identifier 'timespec' to appear in the header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ #else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ #endif __ino64_t st_ino; /* File serial number. */ }; #endif /* Tell code we have these members. */ #define _STATBUF_ST_BLKSIZE #define _STATBUF_ST_RDEV /* Nanosecond resolution time values are supported. */ #define _STATBUF_ST_NSEC /* Encoding of the file mode. */ #define __S_IFMT 0170000 /* These bits determine file type. */ /* File types. */ #define __S_IFDIR 0040000 /* Directory. */ #define __S_IFCHR 0020000 /* Character device. */ #define __S_IFBLK 0060000 /* Block device. */ #define __S_IFREG 0100000 /* Regular file. */ #define __S_IFIFO 0010000 /* FIFO. */ #define __S_IFLNK 0120000 /* Symbolic link. */ #define __S_IFSOCK 0140000 /* Socket. */ /* POSIX.1b objects. Note that these macros always evaluate to zero. But they do it by enforcing the correct use of the macros. */ #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) /* Protection bits. */ #define __S_ISUID 04000 /* Set user ID on execution. */ #define __S_ISGID 02000 /* Set group ID on execution. */ #define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ #define __S_IREAD 0400 /* Read by owner. */ #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ #ifdef __USE_ATFILE #define UTIME_NOW ((1l << 30) - 1l) #define UTIME_OMIT ((1l << 30) - 2l) #endif #endif /* bits/stat.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/statfs.h ================================================ /* Copyright (C) 1997-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_STATFS_H #error "Never include directly; use instead." #endif #include struct statfs { __fsword_t f_type; __fsword_t f_bsize; #ifndef __USE_FILE_OFFSET64 __fsblkcnt_t f_blocks; __fsblkcnt_t f_bfree; __fsblkcnt_t f_bavail; __fsfilcnt_t f_files; __fsfilcnt_t f_ffree; #else __fsblkcnt64_t f_blocks; __fsblkcnt64_t f_bfree; __fsblkcnt64_t f_bavail; __fsfilcnt64_t f_files; __fsfilcnt64_t f_ffree; #endif __fsid_t f_fsid; __fsword_t f_namelen; __fsword_t f_frsize; __fsword_t f_flags; __fsword_t f_spare[4]; }; #ifdef __USE_LARGEFILE64 struct statfs64 { __fsword_t f_type; __fsword_t f_bsize; __fsblkcnt64_t f_blocks; __fsblkcnt64_t f_bfree; __fsblkcnt64_t f_bavail; __fsfilcnt64_t f_files; __fsfilcnt64_t f_ffree; __fsid_t f_fsid; __fsword_t f_namelen; __fsword_t f_frsize; __fsword_t f_flags; __fsword_t f_spare[4]; }; #endif /* Tell code we have these members. */ #define _STATFS_F_NAMELEN #define _STATFS_F_FRSIZE #define _STATFS_F_FLAGS ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/stdio_lim.h ================================================ /* Copyright (C) 1994-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX #error "Never include directly; use instead." #endif #ifdef _STDIO_H #define L_tmpnam 20 #define TMP_MAX 238328 #define FILENAME_MAX 4096 #ifdef __USE_POSIX #define L_ctermid 9 #if !defined __USE_XOPEN2K || defined __USE_GNU #define L_cuserid 9 #endif #endif #endif #if defined __need_FOPEN_MAX || defined _STDIO_H #undef FOPEN_MAX #define FOPEN_MAX 16 #endif #if defined __need_IOV_MAX && !defined IOV_MAX #define IOV_MAX 1024 #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/stdlib-float.h ================================================ /* Floating-point inline functions for stdlib.h. Copyright (C) 2012-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STDLIB_H #error "Never use directly; include instead." #endif #ifdef __USE_EXTERN_INLINES __BEGIN_NAMESPACE_STD __extern_inline double __NTH(atof(const char *__nptr)) { return strtod(__nptr, (char **)NULL); } __END_NAMESPACE_STD #endif /* Optimizing and Inlining. */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/sys_errlist.h ================================================ /* Declare sys_errlist and sys_nerr, or don't. Compatibility (do) version. Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STDIO_H #error "Never include directly; use instead." #endif /* sys_errlist and sys_nerr are deprecated. Use strerror instead. */ #ifdef __USE_MISC extern int sys_nerr; extern const char *const sys_errlist[]; #endif #ifdef __USE_GNU extern int _sys_nerr; extern const char *const _sys_errlist[]; #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/termios.h ================================================ /* termios type and macro definitions. Linux version. Copyright (C) 1993-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _TERMIOS_H #error "Never include directly; use instead." #endif typedef unsigned char cc_t; typedef unsigned int speed_t; typedef unsigned int tcflag_t; #define NCCS 32 struct termios { tcflag_t c_iflag; /* input mode flags */ tcflag_t c_oflag; /* output mode flags */ tcflag_t c_cflag; /* control mode flags */ tcflag_t c_lflag; /* local mode flags */ cc_t c_line; /* line discipline */ cc_t c_cc[NCCS]; /* control characters */ speed_t c_ispeed; /* input speed */ speed_t c_ospeed; /* output speed */ #define _HAVE_STRUCT_TERMIOS_C_ISPEED 1 #define _HAVE_STRUCT_TERMIOS_C_OSPEED 1 }; /* c_cc characters */ #define VINTR 0 #define VQUIT 1 #define VERASE 2 #define VKILL 3 #define VEOF 4 #define VTIME 5 #define VMIN 6 #define VSWTC 7 #define VSTART 8 #define VSTOP 9 #define VSUSP 10 #define VEOL 11 #define VREPRINT 12 #define VDISCARD 13 #define VWERASE 14 #define VLNEXT 15 #define VEOL2 16 /* c_iflag bits */ #define IGNBRK 0000001 #define BRKINT 0000002 #define IGNPAR 0000004 #define PARMRK 0000010 #define INPCK 0000020 #define ISTRIP 0000040 #define INLCR 0000100 #define IGNCR 0000200 #define ICRNL 0000400 #define IUCLC 0001000 #define IXON 0002000 #define IXANY 0004000 #define IXOFF 0010000 #define IMAXBEL 0020000 #define IUTF8 0040000 /* c_oflag bits */ #define OPOST 0000001 #define OLCUC 0000002 #define ONLCR 0000004 #define OCRNL 0000010 #define ONOCR 0000020 #define ONLRET 0000040 #define OFILL 0000100 #define OFDEL 0000200 #if defined __USE_MISC || defined __USE_XOPEN #define NLDLY 0000400 #define NL0 0000000 #define NL1 0000400 #define CRDLY 0003000 #define CR0 0000000 #define CR1 0001000 #define CR2 0002000 #define CR3 0003000 #define TABDLY 0014000 #define TAB0 0000000 #define TAB1 0004000 #define TAB2 0010000 #define TAB3 0014000 #define BSDLY 0020000 #define BS0 0000000 #define BS1 0020000 #define FFDLY 0100000 #define FF0 0000000 #define FF1 0100000 #endif #define VTDLY 0040000 #define VT0 0000000 #define VT1 0040000 #ifdef __USE_MISC #define XTABS 0014000 #endif /* c_cflag bit meaning */ #ifdef __USE_MISC #define CBAUD 0010017 #endif #define B0 0000000 /* hang up */ #define B50 0000001 #define B75 0000002 #define B110 0000003 #define B134 0000004 #define B150 0000005 #define B200 0000006 #define B300 0000007 #define B600 0000010 #define B1200 0000011 #define B1800 0000012 #define B2400 0000013 #define B4800 0000014 #define B9600 0000015 #define B19200 0000016 #define B38400 0000017 #ifdef __USE_MISC #define EXTA B19200 #define EXTB B38400 #endif #define CSIZE 0000060 #define CS5 0000000 #define CS6 0000020 #define CS7 0000040 #define CS8 0000060 #define CSTOPB 0000100 #define CREAD 0000200 #define PARENB 0000400 #define PARODD 0001000 #define HUPCL 0002000 #define CLOCAL 0004000 #ifdef __USE_MISC #define CBAUDEX 0010000 #endif #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 #define __MAX_BAUD B4000000 #ifdef __USE_MISC #define CIBAUD 002003600000 /* input baud rate (not used) */ #define CMSPAR 010000000000 /* mark or space (stick) parity */ #define CRTSCTS 020000000000 /* flow control */ #endif /* c_lflag bits */ #define ISIG 0000001 #define ICANON 0000002 #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) #define XCASE 0000004 #endif #define ECHO 0000010 #define ECHOE 0000020 #define ECHOK 0000040 #define ECHONL 0000100 #define NOFLSH 0000200 #define TOSTOP 0000400 #ifdef __USE_MISC #define ECHOCTL 0001000 #define ECHOPRT 0002000 #define ECHOKE 0004000 #define FLUSHO 0010000 #define PENDIN 0040000 #endif #define IEXTEN 0100000 #ifdef __USE_MISC #define EXTPROC 0200000 #endif /* tcflow() and TCXONC use these */ #define TCOOFF 0 #define TCOON 1 #define TCIOFF 2 #define TCION 3 /* tcflush() and TCFLSH use these */ #define TCIFLUSH 0 #define TCOFLUSH 1 #define TCIOFLUSH 2 /* tcsetattr uses these */ #define TCSANOW 0 #define TCSADRAIN 1 #define TCSAFLUSH 2 #define _IOT_termios /* Hurd ioctl type field. */ \ _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/time.h ================================================ /* System-dependent timing definitions. Linux version. Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ #if defined __need_timeval || defined __USE_GNU #ifndef _STRUCT_TIMEVAL #define _STRUCT_TIMEVAL 1 #include /* A time value that is accurate to the nearest microsecond but also has a range of years. */ struct timeval { __time_t tv_sec; /* Seconds. */ __suseconds_t tv_usec; /* Microseconds. */ }; #endif /* struct timeval */ #endif #ifndef __need_timeval #ifndef _BITS_TIME_H #define _BITS_TIME_H 1 /* ISO/IEC 9899:1999 7.23.1: Components of time The macro `CLOCKS_PER_SEC' is an expression with type `clock_t' that is the number per second of the value returned by the `clock' function. */ /* CAE XSH, Issue 4, Version 2: The value of CLOCKS_PER_SEC is required to be 1 million on all XSI-conformant systems. */ #define CLOCKS_PER_SEC ((clock_t) 1000000) #if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \ && !defined __USE_XOPEN2K /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK presents the real value for clock ticks per second for the system. */ #include extern long int __sysconf(int); #define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */ #endif #ifdef __USE_POSIX199309 /* Identifier for system-wide realtime clock. */ #define CLOCK_REALTIME 0 /* Monotonic system-wide clock. */ #define CLOCK_MONOTONIC 1 /* High-resolution timer from the CPU. */ #define CLOCK_PROCESS_CPUTIME_ID 2 /* Thread-specific CPU-time clock. */ #define CLOCK_THREAD_CPUTIME_ID 3 /* Monotonic system-wide clock, not adjusted for frequency scaling. */ #define CLOCK_MONOTONIC_RAW 4 /* Identifier for system-wide realtime clock, updated only on ticks. */ #define CLOCK_REALTIME_COARSE 5 /* Monotonic system-wide clock, updated only on ticks. */ #define CLOCK_MONOTONIC_COARSE 6 /* Monotonic system-wide clock that includes time spent in suspension. */ #define CLOCK_BOOTTIME 7 /* Like CLOCK_REALTIME but also wakes suspended system. */ #define CLOCK_REALTIME_ALARM 8 /* Like CLOCK_BOOTTIME but also wakes suspended system. */ #define CLOCK_BOOTTIME_ALARM 9 /* Like CLOCK_REALTIME but in International Atomic Time. */ #define CLOCK_TAI 11 /* Flag to indicate time is absolute. */ #define TIMER_ABSTIME 1 #endif #ifdef __USE_GNU #include __BEGIN_DECLS /* Tune a POSIX clock. */ extern int clock_adjtime(__clockid_t __clock_id, struct timex *__utx) __THROW; __END_DECLS #endif /* use GNU */ #endif /* bits/time.h */ #endif #undef __need_timeval ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/types.h ================================================ /* bits/types.h -- definitions of __*_t types underlying *_t types. Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ #ifndef _BITS_TYPES_H #define _BITS_TYPES_H 1 #include #include /* Convenience types. */ typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; /* Fixed-size types, underlying types depend on word size and compiler. */ typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; #if __WORDSIZE == 64 typedef signed long int __int64_t; typedef unsigned long int __uint64_t; #else __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; #endif /* quad_t is also 64 bits. */ #if __WORDSIZE == 64 typedef long int __quad_t; typedef unsigned long int __u_quad_t; #else __extension__ typedef long long int __quad_t; __extension__ typedef unsigned long long int __u_quad_t; #endif /* The machine-dependent file defines __*_T_TYPE macros for each of the OS types we define below. The definitions of those macros must use the following macros for underlying types. We define __S_TYPE and __U_TYPE for the signed and unsigned variants of each of the following integer types on this machine. 16 -- "natural" 16-bit type (always short) 32 -- "natural" 32-bit type (always int) 64 -- "natural" 64-bit type (long or long long) LONG32 -- 32-bit type, traditionally long QUAD -- 64-bit type, always long long WORD -- natural type of __WORDSIZE bits (int or long) LONGWORD -- type of __WORDSIZE bits, traditionally long We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the conventional uses of `long' or `long long' type modifiers match the types we define, even when a less-adorned type would be the same size. This matters for (somewhat) portably writing printf/scanf formats for these types, where using the appropriate l or ll format modifiers can make the typedefs and the formats match up across all GNU platforms. If we used `long' when it's 64 bits where `long long' is expected, then the compiler would warn about the formats not matching the argument types, and the programmer changing them to shut up the compiler would break the program's portability. Here we assume what is presently the case in all the GCC configurations we support: long long is always 64 bits, long is always word/address size, and int is always 32 bits. */ #define __S16_TYPE short int #define __U16_TYPE unsigned short int #define __S32_TYPE int #define __U32_TYPE unsigned int #define __SLONGWORD_TYPE long int #define __ULONGWORD_TYPE unsigned long int #if __WORDSIZE == 32 #define __SQUAD_TYPE __quad_t #define __UQUAD_TYPE __u_quad_t #define __SWORD_TYPE int #define __UWORD_TYPE unsigned int #define __SLONG32_TYPE long int #define __ULONG32_TYPE unsigned long int #define __S64_TYPE __quad_t #define __U64_TYPE __u_quad_t /* We want __extension__ before typedef's that use nonstandard base types such as `long long' in C89 mode. */ #define __STD_TYPE __extension__ typedef #elif __WORDSIZE == 64 #define __SQUAD_TYPE long int #define __UQUAD_TYPE unsigned long int #define __SWORD_TYPE long int #define __UWORD_TYPE unsigned long int #define __SLONG32_TYPE int #define __ULONG32_TYPE unsigned int #define __S64_TYPE long int #define __U64_TYPE unsigned long int /* No need to mark the typedef with __extension__. */ #define __STD_TYPE typedef #else #error #endif #include /* Defines __*_T_TYPE macros. */ __STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */ __STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */ __STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */ __STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */ __STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS). */ __STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */ __STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */ __STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */ __STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */ __STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */ __STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */ __STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */ __STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */ __STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */ __STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */ __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ __STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ __STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ __STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ /* Clock ID used in clock and timer functions. */ __STD_TYPE __CLOCKID_T_TYPE __clockid_t; /* Timer ID returned by `timer_create'. */ __STD_TYPE __TIMER_T_TYPE __timer_t; /* Type to represent block size. */ __STD_TYPE __BLKSIZE_T_TYPE __blksize_t; /* Types from the Large File Support interface. */ /* Type to count number of disk blocks. */ __STD_TYPE __BLKCNT_T_TYPE __blkcnt_t; __STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t; /* Type to count file system blocks. */ __STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t; __STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t; /* Type to count file system nodes. */ __STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t; __STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t; /* Type of miscellaneous file system fields. */ __STD_TYPE __FSWORD_T_TYPE __fsword_t; __STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */ /* Signed long type used in system calls. */ __STD_TYPE __SYSCALL_SLONG_TYPE __syscall_slong_t; /* Unsigned long type used in system calls. */ __STD_TYPE __SYSCALL_ULONG_TYPE __syscall_ulong_t; /* These few don't really vary by system, they always correspond to one of the other defined types. */ typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */ typedef __quad_t *__qaddr_t; typedef char *__caddr_t; /* Duplicates info from stdint.h but this is used in unistd.h. */ __STD_TYPE __SWORD_TYPE __intptr_t; /* Duplicate info from sys/socket.h. */ __STD_TYPE __U32_TYPE __socklen_t; #undef __STD_TYPE #endif /* bits/types.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/typesizes.h ================================================ /* bits/typesizes.h -- underlying types for *_t. Generic version. Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_TYPES_H #error "Never include directly; use instead." #endif #ifndef _BITS_TYPESIZES_H #define _BITS_TYPESIZES_H 1 /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE #define __INO_T_TYPE __ULONGWORD_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #define __NLINK_T_TYPE __UWORD_TYPE #define __OFF_T_TYPE __SLONGWORD_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE #define __RLIM_T_TYPE __ULONGWORD_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE #define __BLKCNT_T_TYPE __SLONGWORD_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE #define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE #define __FSFILCNT_T_TYPE __ULONGWORD_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __FSWORD_T_TYPE __SWORD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SLONGWORD_TYPE #define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SLONGWORD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE #define __TIMER_T_TYPE void * #define __BLKSIZE_T_TYPE __SLONGWORD_TYPE #define __FSID_T_TYPE struct { int __val[2]; } #define __SSIZE_T_TYPE __SWORD_TYPE #define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #define __CPU_MASK_TYPE __ULONGWORD_TYPE #ifdef __LP64__ /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ #define __OFF_T_MATCHES_OFF64_T 1 /* Same for ino_t and ino64_t. */ #define __INO_T_MATCHES_INO64_T 1 #endif /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 #endif /* bits/typesizes.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/uio.h ================================================ /* Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SYS_UIO_H && !defined _FCNTL_H #error "Never include directly; use instead." #endif #ifndef _BITS_UIO_H #define _BITS_UIO_H 1 #include /* We should normally use the Linux kernel header file to define this type and macros but this calls for trouble because of the header includes other kernel headers. */ /* Size of object which can be written atomically. This macro has different values in different kernel versions. The latest versions of the kernel use 1024 and this is good choice. Since the C library implementation of readv/writev is able to emulate the functionality even if the currently running kernel does not support this large value the readv/writev call will not fail because of this. */ #define UIO_MAXIOV 1024 /* Structure for scatter/gather I/O. */ struct iovec { void *iov_base; /* Pointer to data. */ size_t iov_len; /* Length of data. */ }; #endif #ifdef __USE_GNU #if defined _SYS_UIO_H && !defined _BITS_UIO_H_FOR_SYS_UIO_H #define _BITS_UIO_H_FOR_SYS_UIO_H 1 __BEGIN_DECLS /* Read from another process' address space. */ extern ssize_t process_vm_readv(pid_t __pid, const struct iovec *__lvec, unsigned long int __liovcnt, const struct iovec *__rvec, unsigned long int __riovcnt, unsigned long int __flags) __THROW; /* Write to another process' address space. */ extern ssize_t process_vm_writev(pid_t __pid, const struct iovec *__lvec, unsigned long int __liovcnt, const struct iovec *__rvec, unsigned long int __riovcnt, unsigned long int __flags) __THROW; __END_DECLS #endif #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/utsname.h ================================================ /* Copyright (C) 1995-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_UTSNAME_H #error "Never include directly; use instead." #endif /* Length of the entries in `struct utsname' is 65. */ #define _UTSNAME_LENGTH 65 /* Linux provides as additional information in the `struct utsname' the name of the current domain. Define _UTSNAME_DOMAIN_LENGTH to a value != 0 to activate this entry. */ #define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/waitflags.h ================================================ /* Definitions of flag bits for `waitpid' et al. Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SYS_WAIT_H && !defined _STDLIB_H #error "Never include directly; use instead." #endif /* Bits in the third argument to `waitpid'. */ #define WNOHANG 1 /* Don't block waiting. */ #define WUNTRACED 2 /* Report status of stopped children. */ /* Bits in the fourth argument to `waitid'. */ #define WSTOPPED 2 /* Report stopped child (same as WUNTRACED). */ #define WEXITED 4 /* Report dead child. */ #define WCONTINUED 8 /* Report continued child. */ #define WNOWAIT 0x01000000 /* Don't reap, just poll status. */ #define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads in this group */ #define __WALL 0x40000000 /* Wait for any child. */ #define __WCLONE 0x80000000 /* Wait for cloned process. */ /* The following values are used by the `waitid' function. */ #if defined __USE_XOPEN || defined __USE_XOPEN2K8 #ifndef __ENUM_IDTYPE_T #define __ENUM_IDTYPE_T 1 /* The Linux kernel defines these bare, rather than an enum, which causes a conflict if the include order is reversed. */ #undef P_ALL #undef P_PID #undef P_PGID typedef enum { P_ALL, /* Wait for any child. */ P_PID, /* Wait for specified process. */ P_PGID /* Wait for members of process group. */ } idtype_t; #endif #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/waitstatus.h ================================================ /* Definitions of status bits for `wait' et al. Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SYS_WAIT_H && !defined _STDLIB_H #error "Never include directly; use instead." #endif /* Everything extant so far uses these same bits. */ /* If WIFEXITED(STATUS), the low-order 8 bits of the status. */ #define __WEXITSTATUS(status) (((status) & 0xff00) >> 8) /* If WIFSIGNALED(STATUS), the terminating signal. */ #define __WTERMSIG(status) ((status) & 0x7f) /* If WIFSTOPPED(STATUS), the signal that stopped the child. */ #define __WSTOPSIG(status) __WEXITSTATUS(status) /* Nonzero if STATUS indicates normal termination. */ #define __WIFEXITED(status) (__WTERMSIG(status) == 0) /* Nonzero if STATUS indicates termination by a signal. */ #define __WIFSIGNALED(status) \ (((signed char) (((status) & 0x7f) + 1) >> 1) > 0) /* Nonzero if STATUS indicates the child is stopped. */ #define __WIFSTOPPED(status) (((status) & 0xff) == 0x7f) /* Nonzero if STATUS indicates the child continued after a stop. We only define this if provides the WCONTINUED flag bit. */ #ifdef WCONTINUED #define __WIFCONTINUED(status) ((status) == __W_CONTINUED) #endif /* Nonzero if STATUS indicates the child dumped core. */ #define __WCOREDUMP(status) ((status) & __WCOREFLAG) /* Macros for constructing status values. */ #define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) #define __W_STOPCODE(sig) ((sig) << 8 | 0x7f) #define __W_CONTINUED 0xffff #define __WCOREFLAG 0x80 ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/wchar.h ================================================ /* wchar_t type related definitions. Copyright (C) 2000-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_WCHAR_H #define _BITS_WCHAR_H 1 /* The fallback definitions, for when __WCHAR_MAX__ or __WCHAR_MIN__ are not defined, give the right value and type as long as both int and wchar_t are 32-bit types. Adding L'\0' to a constant value ensures that the type is correct; it is necessary to use (L'\0' + 0) rather than just L'\0' so that the type in C++ is the promoted version of wchar_t rather than the distinct wchar_t type itself. Because wchar_t in preprocessor #if expressions is treated as intmax_t or uintmax_t, the expression (L'\0' - 1) would have the wrong value for WCHAR_MAX in such expressions and so cannot be used to define __WCHAR_MAX in the unsigned case. */ #ifdef __WCHAR_MAX__ #define __WCHAR_MAX __WCHAR_MAX__ #elif L'\0' - 1 > 0 #define __WCHAR_MAX (0xffffffffu + L'\0') #else #define __WCHAR_MAX (0x7fffffff + L'\0') #endif #ifdef __WCHAR_MIN__ #define __WCHAR_MIN __WCHAR_MIN__ #elif L'\0' - 1 > 0 #define __WCHAR_MIN (L'\0' + 0) #else #define __WCHAR_MIN (-__WCHAR_MAX - 1) #endif #endif /* bits/wchar.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/wordsize.h ================================================ /* Copyright (C) 1999-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #define __WORDSIZE 32 ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/gnu/stubs-hard.h ================================================ /* This file is automatically generated. It defines a symbol `__stub_FUNCTION' for each function in the C library which is a stub, meaning it will fail every time called, usually setting errno to ENOSYS. */ #ifdef _LIBC #error Applications may not define the macro _LIBC #endif #define __stub___compat_create_module #define __stub___compat_get_kernel_syms #define __stub___compat_query_module #define __stub_chflags #define __stub_fattach #define __stub_fchflags #define __stub_fdetach #define __stub_getmsg #define __stub_getpmsg #define __stub_gtty #define __stub_lchmod #define __stub_putmsg #define __stub_putpmsg #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn #define __stub_sstk #define __stub_stty ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/gnu/stubs.h ================================================ /* This file is automatically generated. This file selects the right generated file of `__stub_FUNCTION' macros based on the architecture being compiled for. */ #if !defined __ARM_PCS_VFP #include #endif #if defined __ARM_PCS_VFP #include #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/cdefs.h ================================================ /* Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_CDEFS_H #define _SYS_CDEFS_H 1 /* We are almost always included from features.h. */ #ifndef _FEATURES_H #include #endif /* The GNU libc does not support any K&R compilers or the traditional mode of ISO C compilers anymore. Check for some of the combinations not anymore supported. */ #if defined __GNUC__ && !defined __STDC__ #error "You need a ISO C conforming compiler to use the glibc headers" #endif /* Some user header file might have defined this before. */ #undef __P #undef __PMT #ifdef __GNUC__ /* All functions, except those with callbacks or those that synchronize memory, are leaf functions. */ #if __GNUC_PREREQ (4, 6) && !defined _LIBC #define __LEAF , __leaf__ #define __LEAF_ATTR __attribute__ ((__leaf__)) #else #define __LEAF #define __LEAF_ATTR #endif /* GCC can always grok prototypes. For C++ programs we add throw() to help it optimize the function calls. But this works only with gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions as non-throwing using a function attribute since programs can use the -fexceptions options for C code as well. */ #if !defined __cplusplus && __GNUC_PREREQ (3, 3) #define __THROW __attribute__ ((__nothrow__ __LEAF)) #define __THROWNL __attribute__ ((__nothrow__)) #define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct #else #if defined __cplusplus && __GNUC_PREREQ (2,8) #define __THROW throw () #define __THROWNL throw () #define __NTH(fct) __LEAF_ATTR fct throw () #else #define __THROW #define __THROWNL #define __NTH(fct) fct #endif #endif #else /* Not GCC. */ #define __inline /* No inline functions. */ #define __THROW #define __THROWNL #define __NTH(fct) fct #endif /* GCC. */ /* These two macros are not used in glibc anymore. They are kept here only because some other projects expect the macros to be defined. */ #define __P(args) args #define __PMT(args) args /* For these things, GCC behaves the ANSI way normally, and the non-ANSI way under -traditional. */ #define __CONCAT(x,y) x ## y #define __STRING(x) #x /* This is not a typedef so `const __ptr_t' does the right thing. */ #define __ptr_t void * #define __long_double_t long double /* C++ needs to know that types and declarations are C, not C++. */ #ifdef __cplusplus #define __BEGIN_DECLS extern "C" { #define __END_DECLS } #else #define __BEGIN_DECLS #define __END_DECLS #endif /* The standard library needs the functions from the ISO C90 standard in the std namespace. At the same time we want to be safe for future changes and we include the ISO C99 code in the non-standard namespace __c99. The C++ wrapper header take case of adding the definitions to the global namespace. */ #if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES #define __BEGIN_NAMESPACE_STD namespace std { #define __END_NAMESPACE_STD } #define __USING_NAMESPACE_STD(name) using std::name; #define __BEGIN_NAMESPACE_C99 namespace __c99 { #define __END_NAMESPACE_C99 } #define __USING_NAMESPACE_C99(name) using __c99::name; #else /* For compatibility we do not add the declarations into any namespace. They will end up in the global namespace which is what old code expects. */ #define __BEGIN_NAMESPACE_STD #define __END_NAMESPACE_STD #define __USING_NAMESPACE_STD(name) #define __BEGIN_NAMESPACE_C99 #define __END_NAMESPACE_C99 #define __USING_NAMESPACE_C99(name) #endif /* Fortify support. */ #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) #define __bos0(ptr) __builtin_object_size (ptr, 0) #if __GNUC_PREREQ (4,3) #define __warndecl(name, msg) \ extern void name (void) __attribute__((__warning__ (msg))) #define __warnattr(msg) __attribute__((__warning__ (msg))) #define __errordecl(name, msg) \ extern void name (void) __attribute__((__error__ (msg))) #else #define __warndecl(name, msg) extern void name (void) #define __warnattr(msg) #define __errordecl(name, msg) extern void name (void) #endif /* Support for flexible arrays. */ #if __GNUC_PREREQ (2,97) /* GCC 2.97 supports C99 flexible array members. */ #define __flexarr [] #else #ifdef __GNUC__ #define __flexarr [0] #else #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L #define __flexarr [] #else /* Some other non-C99 compiler. Approximate with [1]. */ #define __flexarr [1] #endif #endif #endif /* __asm__ ("xyz") is used throughout the headers to rename functions at the assembly language level. This is wrapped by the __REDIRECT macro, in order to support compilers that can do this some other way. When compilers don't support asm-names at all, we have to do preprocessor tricks instead (which don't have exactly the right semantics, but it's the best we can do). Example: int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ #if defined __GNUC__ && __GNUC__ >= 2 #define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) #ifdef __cplusplus #define __REDIRECT_NTH(name, proto, alias) \ name proto __THROW __asm__ (__ASMNAME (#alias)) #define __REDIRECT_NTHNL(name, proto, alias) \ name proto __THROWNL __asm__ (__ASMNAME (#alias)) #else #define __REDIRECT_NTH(name, proto, alias) \ name proto __asm__ (__ASMNAME (#alias)) __THROW #define __REDIRECT_NTHNL(name, proto, alias) \ name proto __asm__ (__ASMNAME (#alias)) __THROWNL #endif #define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) #define __ASMNAME2(prefix, cname) __STRING (prefix) cname /* #elif __SOME_OTHER_COMPILER__ # define __REDIRECT(name, proto, alias) name proto; \ _Pragma("let " #name " = " #alias) */ #endif /* GCC has various useful declarations that can be made with the `__attribute__' syntax. All of the ways we use this do fine if they are omitted for compilers that don't understand it. */ #if !defined __GNUC__ || __GNUC__ < 2 #define __attribute__(xyz) /* Ignore */ #endif /* At some point during the gcc 2.96 development the `malloc' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,96) #define __attribute_malloc__ __attribute__ ((__malloc__)) #else #define __attribute_malloc__ /* Ignore */ #endif /* Tell the compiler which arguments to an allocation function indicate the size of the allocation. */ #if __GNUC_PREREQ (4, 3) #define __attribute_alloc_size__(params) \ __attribute__ ((__alloc_size__ params)) #else #define __attribute_alloc_size__(params) /* Ignore. */ #endif /* At some point during the gcc 2.96 development the `pure' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,96) #define __attribute_pure__ __attribute__ ((__pure__)) #else #define __attribute_pure__ /* Ignore */ #endif /* This declaration tells the compiler that the value is constant. */ #if __GNUC_PREREQ (2,5) #define __attribute_const__ __attribute__ ((__const__)) #else #define __attribute_const__ /* Ignore */ #endif /* At some point during the gcc 3.1 development the `used' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (3,1) #define __attribute_used__ __attribute__ ((__used__)) #define __attribute_noinline__ __attribute__ ((__noinline__)) #else #define __attribute_used__ __attribute__ ((__unused__)) #define __attribute_noinline__ /* Ignore */ #endif /* gcc allows marking deprecated functions. */ #if __GNUC_PREREQ (3,2) #define __attribute_deprecated__ __attribute__ ((__deprecated__)) #else #define __attribute_deprecated__ /* Ignore */ #endif /* At some point during the gcc 2.8 development the `format_arg' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. If several `format_arg' attributes are given for the same function, in gcc-3.0 and older, all but the last one are ignored. In newer gccs, all designated arguments are considered. */ #if __GNUC_PREREQ (2,8) #define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) #else #define __attribute_format_arg__(x) /* Ignore */ #endif /* At some point during the gcc 2.97 development the `strfmon' format attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,97) #define __attribute_format_strfmon__(a,b) \ __attribute__ ((__format__ (__strfmon__, a, b))) #else #define __attribute_format_strfmon__(a,b) /* Ignore */ #endif /* The nonull function attribute allows to mark pointer parameters which must not be NULL. */ #if __GNUC_PREREQ (3,3) #define __nonnull(params) __attribute__ ((__nonnull__ params)) #else #define __nonnull(params) #endif /* If fortification mode, we warn about unused results of certain function calls which can lead to problems. */ #if __GNUC_PREREQ (3,4) #define __attribute_warn_unused_result__ \ __attribute__ ((__warn_unused_result__)) #if __USE_FORTIFY_LEVEL > 0 #define __wur __attribute_warn_unused_result__ #endif #else #define __attribute_warn_unused_result__ /* empty */ #endif #ifndef __wur #define __wur /* Ignore */ #endif /* Forces a function to be always inlined. */ #if __GNUC_PREREQ (3,2) /* The Linux kernel defines __always_inline in stddef.h (283d7573), and it conflicts with this definition. Therefore undefine it first to allow either header to be included first. */ #undef __always_inline #define __always_inline __inline __attribute__ ((__always_inline__)) #else #undef __always_inline #define __always_inline __inline #endif /* Associate error messages with the source location of the call site rather than with the source location inside the function. */ #if __GNUC_PREREQ (4,3) #define __attribute_artificial__ __attribute__ ((__artificial__)) #else #define __attribute_artificial__ /* Ignore */ #endif /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions older than 4.3 may define these macros and still not guarantee GNU inlining semantics. clang++ identifies itself as gcc-4.2, but has support for GNU inlining semantics, that can be checked fot by using the __GNUC_STDC_INLINE_ and __GNUC_GNU_INLINE__ macro definitions. */ #if (!defined __cplusplus || __GNUC_PREREQ (4,3) \ || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \ || defined __GNUC_GNU_INLINE__))) #if defined __GNUC_STDC_INLINE__ || defined __cplusplus #define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) #define __extern_always_inline \ extern __always_inline __attribute__ ((__gnu_inline__)) #else #define __extern_inline extern __inline #define __extern_always_inline extern __always_inline #endif #endif #ifdef __extern_always_inline #define __fortify_function __extern_always_inline __attribute_artificial__ #endif /* GCC 4.3 and above allow passing all anonymous arguments of an __extern_always_inline function to some other vararg function. */ #if __GNUC_PREREQ (4,3) #define __va_arg_pack() __builtin_va_arg_pack () #define __va_arg_pack_len() __builtin_va_arg_pack_len () #endif /* It is possible to compile containing GCC extensions even if GCC is run in pedantic mode if the uses are carefully marked using the `__extension__' keyword. But this is not generally available before version 2.8. */ #if !__GNUC_PREREQ (2,8) #define __extension__ /* Ignore */ #endif /* __restrict is known in EGCS 1.2 and above. */ #if !__GNUC_PREREQ (2,92) #define __restrict /* Ignore */ #endif /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is array_name[restrict] GCC 3.1 supports this. */ #if __GNUC_PREREQ (3,1) && !defined __GNUG__ #define __restrict_arr __restrict #else #ifdef __GNUC__ #define __restrict_arr /* Not supported in old GCC. */ #else #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L #define __restrict_arr restrict #else /* Some other non-C99 compiler. */ #define __restrict_arr /* Not supported. */ #endif #endif #endif #if __GNUC__ >= 3 #define __glibc_unlikely(cond) __builtin_expect ((cond), 0) #define __glibc_likely(cond) __builtin_expect ((cond), 1) #else #define __glibc_unlikely(cond) (cond) #define __glibc_likely(cond) (cond) #endif #if (!defined _Noreturn \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ && !__GNUC_PREREQ (4,7)) #if __GNUC_PREREQ (2,8) #define _Noreturn __attribute__ ((__noreturn__)) #else #define _Noreturn #endif #endif #if (!defined _Static_assert && !defined __cplusplus \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) #define _Static_assert(expr, diagnostic) \ extern int (*__Static_assert_function (void)) \ [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] #endif #include #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH #define __LDBL_COMPAT 1 #ifdef __REDIRECT #define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) #define __LDBL_REDIR(name, proto) \ __LDBL_REDIR1 (name, proto, __nldbl_##name) #define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) #define __LDBL_REDIR_NTH(name, proto) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) #define __LDBL_REDIR1_DECL(name, alias) \ extern __typeof (name) name __asm (__ASMNAME (#alias)); #define __LDBL_REDIR_DECL(name) \ extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name)); #define __REDIRECT_LDBL(name, proto, alias) \ __LDBL_REDIR1 (name, proto, __nldbl_##alias) #define __REDIRECT_NTH_LDBL(name, proto, alias) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) #endif #endif #if !defined __LDBL_COMPAT || !defined __REDIRECT #define __LDBL_REDIR1(name, proto, alias) name proto #define __LDBL_REDIR(name, proto) name proto #define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW #define __LDBL_REDIR_NTH(name, proto) name proto __THROW #define __LDBL_REDIR_DECL(name) #ifdef __REDIRECT #define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) #define __REDIRECT_NTH_LDBL(name, proto, alias) \ __REDIRECT_NTH (name, proto, alias) #endif #endif #endif /* sys/cdefs.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/file.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_FILE_H #define _SYS_FILE_H 1 #include #ifndef _FCNTL_H #include #endif __BEGIN_DECLS /* Alternate names for values for the WHENCE argument to `lseek'. These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */ #ifndef L_SET #define L_SET 0 /* Seek from beginning of file. */ #define L_INCR 1 /* Seek from current position. */ #define L_XTND 2 /* Seek from end of file. */ #endif /* Operations for the `flock' call. */ #define LOCK_SH 1 /* Shared lock. */ #define LOCK_EX 2 /* Exclusive lock. */ #define LOCK_UN 8 /* Unlock. */ #define __LOCK_ATOMIC 16 /* Atomic update. */ /* Can be OR'd in to one of the above. */ #define LOCK_NB 4 /* Don't block when locking. */ /* Apply or remove an advisory lock, according to OPERATION, on the file FD refers to. */ extern int flock(int __fd, int __operation) __THROW; __END_DECLS #endif /* sys/file.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/ioctl.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_IOCTL_H #define _SYS_IOCTL_H 1 #include __BEGIN_DECLS /* Get the list of `ioctl' requests and related constants. */ #include /* Define some types used by `ioctl' requests. */ #include /* On a Unix system, the system probably defines some of the symbols we define in (usually with the same values). The code to generate has omitted these symbols to avoid the conflict, but a Unix program expects to define them, so we must include here. */ #include /* Perform the I/O control operation specified by REQUEST on FD. One argument may follow; its presence and type depend on REQUEST. Return value depends on REQUEST. Usually -1 indicates error. */ extern int ioctl(int __fd, unsigned long int __request, ...) __THROW; __END_DECLS #endif /* sys/ioctl.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/mman.h ================================================ /* Definitions for BSD-style memory management. Copyright (C) 1994-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_MMAN_H #define _SYS_MMAN_H 1 #include #include #define __need_size_t #include #ifndef __off_t_defined #ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; #else typedef __off64_t off_t; #endif #define __off_t_defined #endif #ifndef __mode_t_defined typedef __mode_t mode_t; #define __mode_t_defined #endif #include /* Return value of `mmap' in case of an error. */ #define MAP_FAILED ((void *) -1) __BEGIN_DECLS /* Map addresses starting near ADDR and extending for LEN bytes. from OFFSET into the file FD describes according to PROT and FLAGS. If ADDR is nonzero, it is the desired mapping address. If the MAP_FIXED bit is set in FLAGS, the mapping will be at ADDR exactly (which must be page-aligned); otherwise the system chooses a convenient nearby address. The return value is the actual mapping address chosen or MAP_FAILED for errors (in which case `errno' is set). A successful `mmap' call deallocates any previous mapping for the affected region. */ #ifndef __USE_FILE_OFFSET64 extern void *mmap(void *__addr, size_t __len, int __prot, int __flags, int __fd, __off_t __offset) __THROW; #else #ifdef __REDIRECT_NTH extern void *__REDIRECT_NTH(mmap, (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset), mmap64); #else #define mmap mmap64 #endif #endif #ifdef __USE_LARGEFILE64 extern void *mmap64(void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset) __THROW; #endif /* Deallocate any mapping for the region starting at ADDR and extending LEN bytes. Returns 0 if successful, -1 for errors (and sets errno). */ extern int munmap(void *__addr, size_t __len) __THROW; /* Change the memory protection of the region starting at ADDR and extending LEN bytes to PROT. Returns 0 if successful, -1 for errors (and sets errno). */ extern int mprotect(void *__addr, size_t __len, int __prot) __THROW; /* Synchronize the region starting at ADDR and extending LEN bytes with the file it maps. Filesystem operations on a file being mapped are unpredictable before this is done. Flags are from the MS_* set. This function is a cancellation point and therefore not marked with __THROW. */ extern int msync(void *__addr, size_t __len, int __flags); #ifdef __USE_MISC /* Advise the system about particular usage patterns the program follows for the region starting at ADDR and extending LEN bytes. */ extern int madvise(void *__addr, size_t __len, int __advice) __THROW; #endif #ifdef __USE_XOPEN2K /* This is the POSIX name for this function. */ extern int posix_madvise(void *__addr, size_t __len, int __advice) __THROW; #endif /* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to be memory resident. */ extern int mlock(const void *__addr, size_t __len) __THROW; /* Unlock whole pages previously mapped by the range [ADDR,ADDR+LEN). */ extern int munlock(const void *__addr, size_t __len) __THROW; /* Cause all currently mapped pages of the process to be memory resident until unlocked by a call to the `munlockall', until the process exits, or until the process calls `execve'. */ extern int mlockall(int __flags) __THROW; /* All currently mapped pages of the process' address space become unlocked. */ extern int munlockall(void) __THROW; #ifdef __USE_MISC /* mincore returns the memory residency status of the pages in the current process's address space specified by [start, start + len). The status is returned in a vector of bytes. The least significant bit of each byte is 1 if the referenced page is in memory, otherwise it is zero. */ extern int mincore(void *__start, size_t __len, unsigned char *__vec) __THROW; #endif #ifdef __USE_GNU /* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length NEW_LEN. If MREMAP_MAYMOVE is set in FLAGS the returned address may differ from ADDR. If MREMAP_FIXED is set in FLAGS the function takes another parameter which is a fixed address at which the block resides after a successful call. */ extern void *mremap(void *__addr, size_t __old_len, size_t __new_len, int __flags, ...) __THROW; /* Remap arbitrary pages of a shared backing store within an existing VMA. */ extern int remap_file_pages(void *__start, size_t __size, int __prot, size_t __pgoff, int __flags) __THROW; #endif /* Open shared memory segment. */ extern int shm_open(const char *__name, int __oflag, mode_t __mode); /* Remove shared memory segment. */ extern int shm_unlink(const char *__name); __END_DECLS #endif /* sys/mman.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/param.h ================================================ /* Compatibility header for old-style Unix parameters and limits. Copyright (C) 1995-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_PARAM_H #define _SYS_PARAM_H 1 #define __need_NULL #include #include #include #include /* Define BYTE_ORDER et al. */ #include /* Define NSIG. */ /* This file defines some things in system-specific ways. */ #include /* BSD names for some values. */ #define NBBY CHAR_BIT #if !defined NGROUPS && defined NGROUPS_MAX #define NGROUPS NGROUPS_MAX #endif #if !defined MAXSYMLINKS && defined SYMLOOP_MAX #define MAXSYMLINKS SYMLOOP_MAX #endif #if !defined CANBSIZ && defined MAX_CANON #define CANBSIZ MAX_CANON #endif #if !defined MAXPATHLEN && defined PATH_MAX #define MAXPATHLEN PATH_MAX #endif #if !defined NOFILE && defined OPEN_MAX #define NOFILE OPEN_MAX #endif #if !defined MAXHOSTNAMELEN && defined HOST_NAME_MAX #define MAXHOSTNAMELEN HOST_NAME_MAX #endif #ifndef NCARGS #ifdef ARG_MAX #define NCARGS ARG_MAX #else /* ARG_MAX is unlimited, but we define NCARGS for BSD programs that want to compare against some fixed limit. */ #define NCARGS INT_MAX #endif #endif /* Magical constants. */ #ifndef NOGROUP #define NOGROUP 65535 /* Marker for empty group set member. */ #endif #ifndef NODEV #define NODEV ((dev_t) -1) /* Non-existent device. */ #endif /* Unit of `st_blocks'. */ #ifndef DEV_BSIZE #define DEV_BSIZE 512 #endif /* Bit map related macros. */ #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) #define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) #define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) #define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0) /* Macros for counting and rounding. */ #ifndef howmany #define howmany(x, y) (((x) + ((y) - 1)) / (y)) #endif #ifdef __GNUC__ #define roundup(x, y) (__builtin_constant_p (y) && powerof2 (y) \ ? (((x) + (y) - 1) & ~((y) - 1)) \ : ((((x) + ((y) - 1)) / (y)) * (y))) #else #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) #endif #define powerof2(x) ((((x) - 1) & (x)) == 0) /* Macros for min/max. */ #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* sys/param.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/resource.h ================================================ /* Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_RESOURCE_H #define _SYS_RESOURCE_H 1 #include /* Get the system-dependent definitions of structures and bit values. */ #include #ifndef __id_t_defined typedef __id_t id_t; #define __id_t_defined #endif __BEGIN_DECLS /* The X/Open standard defines that all the functions below must use `int' as the type for the first argument. When we are compiling with GNU extensions we change this slightly to provide better error checking. */ #if defined __USE_GNU && !defined __cplusplus typedef enum __rlimit_resource __rlimit_resource_t; typedef enum __rusage_who __rusage_who_t; typedef enum __priority_which __priority_which_t; #else typedef int __rlimit_resource_t; typedef int __rusage_who_t; typedef int __priority_which_t; #endif /* Put the soft and hard limits for RESOURCE in *RLIMITS. Returns 0 if successful, -1 if not (and sets errno). */ #ifndef __USE_FILE_OFFSET64 extern int getrlimit(__rlimit_resource_t __resource, struct rlimit *__rlimits) __THROW; #else #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(getrlimit, (__rlimit_resource_t __resource, struct rlimit * __rlimits), getrlimit64); #else #define getrlimit getrlimit64 #endif #endif #ifdef __USE_LARGEFILE64 extern int getrlimit64(__rlimit_resource_t __resource, struct rlimit64 *__rlimits) __THROW; #endif /* Set the soft and hard limits for RESOURCE to *RLIMITS. Only the super-user can increase hard limits. Return 0 if successful, -1 if not (and sets errno). */ #ifndef __USE_FILE_OFFSET64 extern int setrlimit(__rlimit_resource_t __resource, const struct rlimit *__rlimits) __THROW; #else #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(setrlimit, (__rlimit_resource_t __resource, const struct rlimit * __rlimits), setrlimit64); #else #define setrlimit setrlimit64 #endif #endif #ifdef __USE_LARGEFILE64 extern int setrlimit64(__rlimit_resource_t __resource, const struct rlimit64 *__rlimits) __THROW; #endif /* Return resource usage information on process indicated by WHO and put it in *USAGE. Returns 0 for success, -1 for failure. */ extern int getrusage(__rusage_who_t __who, struct rusage *__usage) __THROW; /* Return the highest priority of any process specified by WHICH and WHO (see above); if WHO is zero, the current process, process group, or user (as specified by WHO) is used. A lower priority number means higher priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */ extern int getpriority(__priority_which_t __which, id_t __who) __THROW; /* Set the priority of all processes specified by WHICH and WHO (see above) to PRIO. Returns 0 on success, -1 on errors. */ extern int setpriority(__priority_which_t __which, id_t __who, int __prio) __THROW; __END_DECLS #endif /* sys/resource.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/select.h ================================================ /* `fd_set' type and related macros, and `select'/`pselect' declarations. Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* POSIX 1003.1g: 6.2 Select from File Descriptor Sets */ #ifndef _SYS_SELECT_H #define _SYS_SELECT_H 1 #include /* Get definition of needed basic types. */ #include /* Get __FD_* definitions. */ #include /* Get __sigset_t. */ #include #ifndef __sigset_t_defined #define __sigset_t_defined typedef __sigset_t sigset_t; #endif /* Get definition of timer specification structures. */ #define __need_time_t #ifdef __USE_XOPEN2K #define __need_timespec #endif #include #define __need_timeval #include #ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; #define __suseconds_t_defined #endif /* The fd_set member is required to be an array of longs. */ typedef long int __fd_mask; /* Some versions of define this macros. */ #undef __NFDBITS /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ #define __NFDBITS (8 * (int) sizeof (__fd_mask)) #define __FD_ELT(d) ((d) / __NFDBITS) #define __FD_MASK(d) ((__fd_mask) (1UL << ((d) % __NFDBITS))) /* fd_set for select and pselect. */ typedef struct { /* XPG4.2 requires this member name. Otherwise avoid the name from the global namespace. */ #ifdef __USE_XOPEN __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS]; #define __FDS_BITS(set) ((set)->fds_bits) #else __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS]; #define __FDS_BITS(set) ((set)->__fds_bits) #endif } fd_set; /* Maximum number of file descriptors in `fd_set'. */ #define FD_SETSIZE __FD_SETSIZE #ifdef __USE_MISC /* Sometimes the fd_set member is assumed to have this type. */ typedef __fd_mask fd_mask; /* Number of bits per word of `fd_set' (some code assumes this is 32). */ #define NFDBITS __NFDBITS #endif /* Access macros for `fd_set'. */ #define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp) #define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp) #define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp) #define FD_ZERO(fdsetp) __FD_ZERO (fdsetp) __BEGIN_DECLS /* Check the first NFDS descriptors each in READFDS (if not NULL) for read readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out after waiting the interval specified therein. Returns the number of ready descriptors, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int select(int __nfds, fd_set * __restrict __readfds, fd_set * __restrict __writefds, fd_set * __restrict __exceptfds, struct timeval *__restrict __timeout); #ifdef __USE_XOPEN2K /* Same as above only that the TIMEOUT value is given with higher resolution and a sigmask which is been set temporarily. This version should be used. This function is a cancellation point and therefore not marked with __THROW. */ extern int pselect(int __nfds, fd_set * __restrict __readfds, fd_set * __restrict __writefds, fd_set * __restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t * __restrict __sigmask); #endif /* Define some inlines helping to catch common problems. */ #if __USE_FORTIFY_LEVEL > 0 && defined __GNUC__ #include #endif __END_DECLS #endif /* sys/select.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/socket.h ================================================ /* Declarations of socket constants, types, and functions. Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SOCKET_H #define _SYS_SOCKET_H 1 #include __BEGIN_DECLS #include #define __need_size_t #include #ifdef __USE_GNU /* Get the __sigset_t definition. */ #include #endif /* This operating system-specific header file defines the SOCK_*, PF_*, AF_*, MSG_*, SOL_*, and SO_* constants, and the `struct sockaddr', `struct msghdr', and `struct linger' types. */ #include #ifdef __USE_MISC /* This is the 4.3 BSD `struct sockaddr' format, which is used as wire format in the grotty old 4.3 `talk' protocol. */ struct osockaddr { unsigned short int sa_family; unsigned char sa_data[14]; }; #endif /* The following constants should be used for the second parameter of `shutdown'. */ enum { SHUT_RD = 0, /* No more receptions. */ #define SHUT_RD SHUT_RD SHUT_WR, /* No more transmissions. */ #define SHUT_WR SHUT_WR SHUT_RDWR /* No more receptions or transmissions. */ #define SHUT_RDWR SHUT_RDWR }; /* This is the type we use for generic socket address arguments. With GCC 2.7 and later, the funky union causes redeclarations or uses with any of the listed types to be allowed without complaint. G++ 2.7 does not support transparent unions so there we want the old-style declaration, too. */ #if defined __cplusplus || !__GNUC_PREREQ (2, 7) || !defined __USE_GNU #define __SOCKADDR_ARG struct sockaddr *__restrict #define __CONST_SOCKADDR_ARG const struct sockaddr * #else /* Add more `struct sockaddr_AF' types here as necessary. These are all the ones I found on NetBSD and Linux. */ #define __SOCKADDR_ALLTYPES \ __SOCKADDR_ONETYPE (sockaddr) \ __SOCKADDR_ONETYPE (sockaddr_at) \ __SOCKADDR_ONETYPE (sockaddr_ax25) \ __SOCKADDR_ONETYPE (sockaddr_dl) \ __SOCKADDR_ONETYPE (sockaddr_eon) \ __SOCKADDR_ONETYPE (sockaddr_in) \ __SOCKADDR_ONETYPE (sockaddr_in6) \ __SOCKADDR_ONETYPE (sockaddr_inarp) \ __SOCKADDR_ONETYPE (sockaddr_ipx) \ __SOCKADDR_ONETYPE (sockaddr_iso) \ __SOCKADDR_ONETYPE (sockaddr_ns) \ __SOCKADDR_ONETYPE (sockaddr_un) \ __SOCKADDR_ONETYPE (sockaddr_x25) #define __SOCKADDR_ONETYPE(type) struct type *__restrict __##type##__; typedef union { __SOCKADDR_ALLTYPES} __SOCKADDR_ARG __attribute__ ((__transparent_union__)); #undef __SOCKADDR_ONETYPE #define __SOCKADDR_ONETYPE(type) const struct type *__restrict __##type##__; typedef union { __SOCKADDR_ALLTYPES} __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__)); #undef __SOCKADDR_ONETYPE #endif #ifdef __USE_GNU /* For `recvmmsg' and `sendmmsg'. */ struct mmsghdr { struct msghdr msg_hdr; /* Actual message header. */ unsigned int msg_len; /* Number of received or sent bytes for the entry. */ }; #endif /* Create a new socket of type TYPE in domain DOMAIN, using protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically. Returns a file descriptor for the new socket, or -1 for errors. */ extern int socket(int __domain, int __type, int __protocol) __THROW; /* Create two new sockets, of type TYPE in domain DOMAIN and using protocol PROTOCOL, which are connected to each other, and put file descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero, one will be chosen automatically. Returns 0 on success, -1 for errors. */ extern int socketpair(int __domain, int __type, int __protocol, int __fds[2]) __THROW; /* Give the socket FD the local address ADDR (which is LEN bytes long). */ extern int bind(int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len) __THROW; /* Put the local address of FD into *ADDR and its length in *LEN. */ extern int getsockname(int __fd, __SOCKADDR_ARG __addr, socklen_t * __restrict __len) __THROW; /* Open a connection on socket FD to peer at ADDR (which LEN bytes long). For connectionless socket types, just set the default address to send to and the only address from which to accept transmissions. Return 0 on success, -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int connect(int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len); /* Put the address of the peer connected to socket FD into *ADDR (which is *LEN bytes long), and its actual length into *LEN. */ extern int getpeername(int __fd, __SOCKADDR_ARG __addr, socklen_t * __restrict __len) __THROW; /* Send N bytes of BUF to socket FD. Returns the number sent or -1. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t send(int __fd, const void *__buf, size_t __n, int __flags); /* Read N bytes into BUF from socket FD. Returns the number read or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t recv(int __fd, void *__buf, size_t __n, int __flags); /* Send N bytes of BUF on socket FD to peer at address ADDR (which is ADDR_LEN bytes long). Returns the number sent, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t sendto(int __fd, const void *__buf, size_t __n, int __flags, __CONST_SOCKADDR_ARG __addr, socklen_t __addr_len); /* Read N bytes into BUF through socket FD. If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of the sender, and store the actual size of the address in *ADDR_LEN. Returns the number of bytes read or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t recvfrom(int __fd, void *__restrict __buf, size_t __n, int __flags, __SOCKADDR_ARG __addr, socklen_t * __restrict __addr_len); /* Send a message described MESSAGE on socket FD. Returns the number of bytes sent, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t sendmsg(int __fd, const struct msghdr *__message, int __flags); #ifdef __USE_GNU /* Send a VLEN messages as described by VMESSAGES to socket FD. Returns the number of datagrams successfully written or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int sendmmsg(int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags); #endif /* Receive a message as described by MESSAGE from socket FD. Returns the number of bytes read or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t recvmsg(int __fd, struct msghdr *__message, int __flags); #ifdef __USE_GNU /* Receive up to VLEN messages as described by VMESSAGES from socket FD. Returns the number of messages received or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int recvmmsg(int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags, struct timespec *__tmo); #endif /* Put the current value for socket FD's option OPTNAME at protocol level LEVEL into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's actual length. Returns 0 on success, -1 for errors. */ extern int getsockopt(int __fd, int __level, int __optname, void *__restrict __optval, socklen_t * __restrict __optlen) __THROW; /* Set socket FD's option OPTNAME at protocol level LEVEL to *OPTVAL (which is OPTLEN bytes long). Returns 0 on success, -1 for errors. */ extern int setsockopt(int __fd, int __level, int __optname, const void *__optval, socklen_t __optlen) __THROW; /* Prepare to accept connections on socket FD. N connection requests will be queued before further requests are refused. Returns 0 on success, -1 for errors. */ extern int listen(int __fd, int __n) __THROW; /* Await a connection on socket FD. When a connection arrives, open a new socket to communicate with it, set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting peer and *ADDR_LEN to the address's actual length, and return the new socket's descriptor, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int accept(int __fd, __SOCKADDR_ARG __addr, socklen_t * __restrict __addr_len); #ifdef __USE_GNU /* Similar to 'accept' but takes an additional parameter to specify flags. This function is a cancellation point and therefore not marked with __THROW. */ extern int accept4(int __fd, __SOCKADDR_ARG __addr, socklen_t * __restrict __addr_len, int __flags); #endif /* Shut down all or part of the connection open on socket FD. HOW determines what to shut down: SHUT_RD = No more receptions; SHUT_WR = No more transmissions; SHUT_RDWR = No more receptions or transmissions. Returns 0 on success, -1 for errors. */ extern int shutdown(int __fd, int __how) __THROW; #ifdef __USE_XOPEN2K /* Determine wheter socket is at a out-of-band mark. */ extern int sockatmark(int __fd) __THROW; #endif #ifdef __USE_MISC /* FDTYPE is S_IFSOCK or another S_IF* macro defined in ; returns 1 if FD is open on an object of the indicated type, 0 if not, or -1 for errors (setting errno). */ extern int isfdtype(int __fd, int __fdtype) __THROW; #endif /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function #include #endif __END_DECLS #endif /* sys/socket.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/stat.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 5.6 File Characteristics */ #ifndef _SYS_STAT_H #define _SYS_STAT_H 1 #include #include /* For __mode_t and __dev_t. */ #if defined __USE_XOPEN || defined __USE_XOPEN2K || defined __USE_ATFILE #if defined __USE_XOPEN || defined __USE_XOPEN2K #define __need_time_t #endif #ifdef __USE_ATFILE #define __need_timespec #endif #include /* For time_t resp. timespec. */ #endif #if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ #ifndef __dev_t_defined typedef __dev_t dev_t; #define __dev_t_defined #endif #ifndef __gid_t_defined typedef __gid_t gid_t; #define __gid_t_defined #endif #ifndef __ino_t_defined #ifndef __USE_FILE_OFFSET64 typedef __ino_t ino_t; #else typedef __ino64_t ino_t; #endif #define __ino_t_defined #endif #ifndef __mode_t_defined typedef __mode_t mode_t; #define __mode_t_defined #endif #ifndef __nlink_t_defined typedef __nlink_t nlink_t; #define __nlink_t_defined #endif #ifndef __off_t_defined #ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; #else typedef __off64_t off_t; #endif #define __off_t_defined #endif #ifndef __uid_t_defined typedef __uid_t uid_t; #define __uid_t_defined #endif #endif /* X/Open */ #ifdef __USE_UNIX98 #ifndef __blkcnt_t_defined #ifndef __USE_FILE_OFFSET64 typedef __blkcnt_t blkcnt_t; #else typedef __blkcnt64_t blkcnt_t; #endif #define __blkcnt_t_defined #endif #ifndef __blksize_t_defined typedef __blksize_t blksize_t; #define __blksize_t_defined #endif #endif /* Unix98 */ __BEGIN_DECLS #include #if defined __USE_MISC || defined __USE_XOPEN #define S_IFMT __S_IFMT #define S_IFDIR __S_IFDIR #define S_IFCHR __S_IFCHR #define S_IFBLK __S_IFBLK #define S_IFREG __S_IFREG #ifdef __S_IFIFO #define S_IFIFO __S_IFIFO #endif #ifdef __S_IFLNK #define S_IFLNK __S_IFLNK #endif #if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) \ && defined __S_IFSOCK #define S_IFSOCK __S_IFSOCK #endif #endif /* Test macros for file types. */ #define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask)) #define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR) #define S_ISCHR(mode) __S_ISTYPE((mode), __S_IFCHR) #define S_ISBLK(mode) __S_ISTYPE((mode), __S_IFBLK) #define S_ISREG(mode) __S_ISTYPE((mode), __S_IFREG) #ifdef __S_IFIFO #define S_ISFIFO(mode) __S_ISTYPE((mode), __S_IFIFO) #endif #ifdef __S_IFLNK #define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK) #endif #if defined __USE_MISC && !defined __S_IFLNK #define S_ISLNK(mode) 0 #endif #if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K) \ && defined __S_IFSOCK #define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK) #elif defined __USE_XOPEN2K #define S_ISSOCK(mode) 0 #endif /* These are from POSIX.1b. If the objects are not implemented using separate distinct file types, the macros always will evaluate to zero. Unlike the other S_* macros the following three take a pointer to a `struct stat' object as the argument. */ #ifdef __USE_POSIX199309 #define S_TYPEISMQ(buf) __S_TYPEISMQ(buf) #define S_TYPEISSEM(buf) __S_TYPEISSEM(buf) #define S_TYPEISSHM(buf) __S_TYPEISSHM(buf) #endif /* Protection bits. */ #define S_ISUID __S_ISUID /* Set user ID on execution. */ #define S_ISGID __S_ISGID /* Set group ID on execution. */ #if defined __USE_MISC || defined __USE_XOPEN /* Save swapped text after use (sticky bit). This is pretty well obsolete. */ #define S_ISVTX __S_ISVTX #endif #define S_IRUSR __S_IREAD /* Read by owner. */ #define S_IWUSR __S_IWRITE /* Write by owner. */ #define S_IXUSR __S_IEXEC /* Execute by owner. */ /* Read, write, and execute by owner. */ #define S_IRWXU (__S_IREAD|__S_IWRITE|__S_IEXEC) #ifdef __USE_MISC #define S_IREAD S_IRUSR #define S_IWRITE S_IWUSR #define S_IEXEC S_IXUSR #endif #define S_IRGRP (S_IRUSR >> 3) /* Read by group. */ #define S_IWGRP (S_IWUSR >> 3) /* Write by group. */ #define S_IXGRP (S_IXUSR >> 3) /* Execute by group. */ /* Read, write, and execute by group. */ #define S_IRWXG (S_IRWXU >> 3) #define S_IROTH (S_IRGRP >> 3) /* Read by others. */ #define S_IWOTH (S_IWGRP >> 3) /* Write by others. */ #define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */ /* Read, write, and execute by others. */ #define S_IRWXO (S_IRWXG >> 3) #ifdef __USE_MISC /* Macros for common mode bit masks. */ #define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */ #define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */ #define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) /* 0666 */ #define S_BLKSIZE 512 /* Block size for `st_blocks'. */ #endif #ifndef __USE_FILE_OFFSET64 /* Get file attributes for FILE and put them in BUF. */ extern int stat(const char *__restrict __file, struct stat *__restrict __buf) __THROW __nonnull((1, 2)); /* Get file attributes for the file, device, pipe, or socket that file descriptor FD is open on and put them in BUF. */ extern int fstat(int __fd, struct stat *__buf) __THROW __nonnull((2)); #else #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(stat, (const char *__restrict __file, struct stat * __restrict __buf), stat64) __nonnull((1, 2)); extern int __REDIRECT_NTH(fstat, (int __fd, struct stat * __buf), fstat64) __nonnull((2)); #else #define stat stat64 #define fstat fstat64 #endif #endif #ifdef __USE_LARGEFILE64 extern int stat64(const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull((1, 2)); extern int fstat64(int __fd, struct stat64 *__buf) __THROW __nonnull((2)); #endif #ifdef __USE_ATFILE /* Similar to stat, get the attributes for FILE and put them in BUF. Relative path names are interpreted relative to FD unless FD is AT_FDCWD. */ #ifndef __USE_FILE_OFFSET64 extern int fstatat(int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __THROW __nonnull((2, 3)); #else #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(fstatat, (int __fd, const char *__restrict __file, struct stat * __restrict __buf, int __flag), fstatat64) __nonnull((2, 3)); #else #define fstatat fstatat64 #endif #endif #ifdef __USE_LARGEFILE64 extern int fstatat64(int __fd, const char *__restrict __file, struct stat64 *__restrict __buf, int __flag) __THROW __nonnull((2, 3)); #endif #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K #ifndef __USE_FILE_OFFSET64 /* Get file attributes about FILE and put them in BUF. If FILE is a symbolic link, do not follow it. */ extern int lstat(const char *__restrict __file, struct stat *__restrict __buf) __THROW __nonnull((1, 2)); #else #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(lstat, (const char *__restrict __file, struct stat * __restrict __buf), lstat64) __nonnull((1, 2)); #else #define lstat lstat64 #endif #endif #ifdef __USE_LARGEFILE64 extern int lstat64(const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull((1, 2)); #endif #endif /* Set file access permissions for FILE to MODE. If FILE is a symbolic link, this affects its target instead. */ extern int chmod(const char *__file, __mode_t __mode) __THROW __nonnull((1)); #ifdef __USE_MISC /* Set file access permissions for FILE to MODE. If FILE is a symbolic link, this affects the link itself rather than its target. */ extern int lchmod(const char *__file, __mode_t __mode) __THROW __nonnull((1)); #endif /* Set file access permissions of the file FD is open on to MODE. */ #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED extern int fchmod(int __fd, __mode_t __mode) __THROW; #endif #ifdef __USE_ATFILE /* Set file access permissions of FILE relative to the directory FD is open on. */ extern int fchmodat(int __fd, const char *__file, __mode_t __mode, int __flag) __THROW __nonnull((2)) __wur; #endif /* Use ATFILE. */ /* Set the file creation mask of the current process to MASK, and return the old creation mask. */ extern __mode_t umask(__mode_t __mask) __THROW; #ifdef __USE_GNU /* Get the current `umask' value without changing it. This function is only available under the GNU Hurd. */ extern __mode_t getumask(void) __THROW; #endif /* Create a new directory named PATH, with permission bits MODE. */ extern int mkdir(const char *__path, __mode_t __mode) __THROW __nonnull((1)); #ifdef __USE_ATFILE /* Like mkdir, create a new directory with permission bits MODE. But interpret relative PATH names relative to the directory associated with FD. */ extern int mkdirat(int __fd, const char *__path, __mode_t __mode) __THROW __nonnull((2)); #endif /* Create a device file named PATH, with permission and special bits MODE and device number DEV (which can be constructed from major and minor device numbers with the `makedev' macro above). */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED extern int mknod(const char *__path, __mode_t __mode, __dev_t __dev) __THROW __nonnull((1)); #ifdef __USE_ATFILE /* Like mknod, create a new device file with permission bits MODE and device number DEV. But interpret relative PATH names relative to the directory associated with FD. */ extern int mknodat(int __fd, const char *__path, __mode_t __mode, __dev_t __dev) __THROW __nonnull((2)); #endif #endif /* Create a new FIFO named PATH, with permission bits MODE. */ extern int mkfifo(const char *__path, __mode_t __mode) __THROW __nonnull((1)); #ifdef __USE_ATFILE /* Like mkfifo, create a new FIFO with permission bits MODE. But interpret relative PATH names relative to the directory associated with FD. */ extern int mkfifoat(int __fd, const char *__path, __mode_t __mode) __THROW __nonnull((2)); #endif #ifdef __USE_ATFILE /* Set file access and modification times relative to directory file descriptor. */ extern int utimensat(int __fd, const char *__path, const struct timespec __times[2], int __flags) __THROW __nonnull((2)); #endif #ifdef __USE_XOPEN2K8 /* Set file access and modification times of the file associated with FD. */ extern int futimens(int __fd, const struct timespec __times[2]) __THROW; #endif /* To allow the `struct stat' structure and the file type `mode_t' bits to vary without changing shared library major version number, the `stat' family of functions and `mknod' are in fact inline wrappers around calls to `xstat', `fxstat', `lxstat', and `xmknod', which all take a leading version-number argument designating the data structure and bits used. defines _STAT_VER with the version number corresponding to `struct stat' as defined in that file; and _MKNOD_VER with the version number corresponding to the S_IF* macros defined therein. It is arranged that when not inlined these function are always statically linked; that way a dynamically-linked executable always encodes the version number corresponding to the data structures it uses, so the `x' functions in the shared library can adapt without needing to recompile all callers. */ #ifndef _STAT_VER #define _STAT_VER 0 #endif #ifndef _MKNOD_VER #define _MKNOD_VER 0 #endif /* Wrappers for stat and mknod system calls. */ #ifndef __USE_FILE_OFFSET64 extern int __fxstat(int __ver, int __fildes, struct stat *__stat_buf) __THROW __nonnull((3)); extern int __xstat(int __ver, const char *__filename, struct stat *__stat_buf) __THROW __nonnull((2, 3)); extern int __lxstat(int __ver, const char *__filename, struct stat *__stat_buf) __THROW __nonnull((2, 3)); extern int __fxstatat(int __ver, int __fildes, const char *__filename, struct stat *__stat_buf, int __flag) __THROW __nonnull((3, 4)); #else #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(__fxstat, (int __ver, int __fildes, struct stat * __stat_buf), __fxstat64) __nonnull((3)); extern int __REDIRECT_NTH(__xstat, (int __ver, const char *__filename, struct stat * __stat_buf), __xstat64) __nonnull((2, 3)); extern int __REDIRECT_NTH(__lxstat, (int __ver, const char *__filename, struct stat * __stat_buf), __lxstat64) __nonnull((2, 3)); extern int __REDIRECT_NTH(__fxstatat, (int __ver, int __fildes, const char *__filename, struct stat * __stat_buf, int __flag), __fxstatat64) __nonnull((3, 4)); #else #define __fxstat __fxstat64 #define __xstat __xstat64 #define __lxstat __lxstat64 #endif #endif #ifdef __USE_LARGEFILE64 extern int __fxstat64(int __ver, int __fildes, struct stat64 *__stat_buf) __THROW __nonnull((3)); extern int __xstat64(int __ver, const char *__filename, struct stat64 *__stat_buf) __THROW __nonnull((2, 3)); extern int __lxstat64(int __ver, const char *__filename, struct stat64 *__stat_buf) __THROW __nonnull((2, 3)); extern int __fxstatat64(int __ver, int __fildes, const char *__filename, struct stat64 *__stat_buf, int __flag) __THROW __nonnull((3, 4)); #endif extern int __xmknod(int __ver, const char *__path, __mode_t __mode, __dev_t * __dev) __THROW __nonnull((2, 4)); extern int __xmknodat(int __ver, int __fd, const char *__path, __mode_t __mode, __dev_t * __dev) __THROW __nonnull((3, 5)); #ifdef __USE_EXTERN_INLINES /* Inlined versions of the real stat and mknod functions. */ __extern_inline int __NTH(stat(const char *__path, struct stat *__statbuf)) { return __xstat(_STAT_VER, __path, __statbuf); } #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED __extern_inline int __NTH(lstat(const char *__path, struct stat *__statbuf)) { return __lxstat(_STAT_VER, __path, __statbuf); } #endif __extern_inline int __NTH(fstat(int __fd, struct stat *__statbuf)) { return __fxstat(_STAT_VER, __fd, __statbuf); } #ifdef __USE_ATFILE __extern_inline int __NTH(fstatat(int __fd, const char *__filename, struct stat *__statbuf, int __flag)) { return __fxstatat(_STAT_VER, __fd, __filename, __statbuf, __flag); } #endif #ifdef __USE_MISC __extern_inline int __NTH(mknod(const char *__path, __mode_t __mode, __dev_t __dev)) { return __xmknod(_MKNOD_VER, __path, __mode, &__dev); } #endif #ifdef __USE_ATFILE __extern_inline int __NTH(mknodat(int __fd, const char *__path, __mode_t __mode, __dev_t __dev)) { return __xmknodat(_MKNOD_VER, __fd, __path, __mode, &__dev); } #endif #if defined __USE_LARGEFILE64 \ && (! defined __USE_FILE_OFFSET64 \ || (defined __REDIRECT_NTH && defined __OPTIMIZE__)) __extern_inline int __NTH(stat64(const char *__path, struct stat64 *__statbuf)) { return __xstat64(_STAT_VER, __path, __statbuf); } #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED __extern_inline int __NTH(lstat64(const char *__path, struct stat64 *__statbuf)) { return __lxstat64(_STAT_VER, __path, __statbuf); } #endif __extern_inline int __NTH(fstat64(int __fd, struct stat64 *__statbuf)) { return __fxstat64(_STAT_VER, __fd, __statbuf); } #ifdef __USE_ATFILE __extern_inline int __NTH(fstatat64(int __fd, const char *__filename, struct stat64 *__statbuf, int __flag)) { return __fxstatat64(_STAT_VER, __fd, __filename, __statbuf, __flag); } #endif #endif #endif __END_DECLS #endif /* sys/stat.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/statfs.h ================================================ /* Definitions for getting information about a filesystem. Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_STATFS_H #define _SYS_STATFS_H 1 #include /* Get the system-specific definition of `struct statfs'. */ #include __BEGIN_DECLS /* Return information about the filesystem on which FILE resides. */ #ifndef __USE_FILE_OFFSET64 extern int statfs(const char *__file, struct statfs *__buf) __THROW __nonnull((1, 2)); #else #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(statfs, (const char *__file, struct statfs * __buf), statfs64) __nonnull((1, 2)); #else #define statfs statfs64 #endif #endif #ifdef __USE_LARGEFILE64 extern int statfs64(const char *__file, struct statfs64 *__buf) __THROW __nonnull((1, 2)); #endif /* Return information about the filesystem containing the file FILDES refers to. */ #ifndef __USE_FILE_OFFSET64 extern int fstatfs(int __fildes, struct statfs *__buf) __THROW __nonnull((2)); #else #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(fstatfs, (int __fildes, struct statfs * __buf), fstatfs64) __nonnull((2)); #else #define fstatfs fstatfs64 #endif #endif #ifdef __USE_LARGEFILE64 extern int fstatfs64(int __fildes, struct statfs64 *__buf) __THROW __nonnull((2)); #endif __END_DECLS #endif /* sys/statfs.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/sysmacros.h ================================================ /* Definitions of macros to access `dev_t' values. Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SYSMACROS_H #define _SYS_SYSMACROS_H 1 #include __BEGIN_DECLS __extension__ extern unsigned int gnu_dev_major(unsigned long long int __dev) __THROW __attribute_const__; __extension__ extern unsigned int gnu_dev_minor(unsigned long long int __dev) __THROW __attribute_const__; __extension__ extern unsigned long long int gnu_dev_makedev(unsigned int __major, unsigned int __minor) __THROW __attribute_const__; #ifdef __USE_EXTERN_INLINES __extension__ __extern_inline __attribute_const__ unsigned int __NTH(gnu_dev_major(unsigned long long int __dev)) { return ((__dev >> 8) & 0xfff) | ((unsigned int)(__dev >> 32) & ~0xfff); } __extension__ __extern_inline __attribute_const__ unsigned int __NTH(gnu_dev_minor(unsigned long long int __dev)) { return (__dev & 0xff) | ((unsigned int)(__dev >> 12) & ~0xff); } __extension__ __extern_inline __attribute_const__ unsigned long long int __NTH(gnu_dev_makedev(unsigned int __major, unsigned int __minor)) { return ((__minor & 0xff) | ((__major & 0xfff) << 8) | (((unsigned long long int)(__minor & ~0xff)) << 12) | (((unsigned long long int)(__major & ~0xfff)) << 32)); } #endif __END_DECLS /* Access the functions with their traditional names. */ #define major(dev) gnu_dev_major (dev) #define minor(dev) gnu_dev_minor (dev) #define makedev(maj, min) gnu_dev_makedev (maj, min) #endif /* sys/sysmacros.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/time.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_TIME_H #define _SYS_TIME_H 1 #include #include #define __need_time_t #include #define __need_timeval #include #include #ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; #define __suseconds_t_defined #endif __BEGIN_DECLS #ifdef __USE_GNU /* Macros for converting between `struct timeval' and `struct timespec'. */ #define TIMEVAL_TO_TIMESPEC(tv, ts) { \ (ts)->tv_sec = (tv)->tv_sec; \ (ts)->tv_nsec = (tv)->tv_usec * 1000; \ } #define TIMESPEC_TO_TIMEVAL(tv, ts) { \ (tv)->tv_sec = (ts)->tv_sec; \ (tv)->tv_usec = (ts)->tv_nsec / 1000; \ } #endif #ifdef __USE_MISC /* Structure crudely representing a timezone. This is obsolete and should never be used. */ struct timezone { int tz_minuteswest; /* Minutes west of GMT. */ int tz_dsttime; /* Nonzero if DST is ever in effect. */ }; typedef struct timezone *__restrict __timezone_ptr_t; #else typedef void *__restrict __timezone_ptr_t; #endif /* Get the current time of day and timezone information, putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled. Returns 0 on success, -1 on errors. NOTE: This form of timezone information is obsolete. Use the functions and variables declared in instead. */ extern int gettimeofday(struct timeval *__restrict __tv, __timezone_ptr_t __tz) __THROW __nonnull((1)); #ifdef __USE_MISC /* Set the current time of day and timezone information. This call is restricted to the super-user. */ extern int settimeofday(const struct timeval *__tv, const struct timezone *__tz) __THROW; /* Adjust the current time of day by the amount in DELTA. If OLDDELTA is not NULL, it is filled in with the amount of time adjustment remaining to be done from the last `adjtime' call. This call is restricted to the super-user. */ extern int adjtime(const struct timeval *__delta, struct timeval *__olddelta) __THROW; #endif /* Values for the first argument to `getitimer' and `setitimer'. */ enum __itimer_which { /* Timers run in real time. */ ITIMER_REAL = 0, #define ITIMER_REAL ITIMER_REAL /* Timers run only when the process is executing. */ ITIMER_VIRTUAL = 1, #define ITIMER_VIRTUAL ITIMER_VIRTUAL /* Timers run when the process is executing and when the system is executing on behalf of the process. */ ITIMER_PROF = 2 #define ITIMER_PROF ITIMER_PROF }; /* Type of the second argument to `getitimer' and the second and third arguments `setitimer'. */ struct itimerval { /* Value to put into `it_value' when the timer expires. */ struct timeval it_interval; /* Time to the next timer expiration. */ struct timeval it_value; }; #if defined __USE_GNU && !defined __cplusplus /* Use the nicer parameter type only in GNU mode and not for C++ since the strict C++ rules prevent the automatic promotion. */ typedef enum __itimer_which __itimer_which_t; #else typedef int __itimer_which_t; #endif /* Set *VALUE to the current setting of timer WHICH. Return 0 on success, -1 on errors. */ extern int getitimer(__itimer_which_t __which, struct itimerval *__value) __THROW; /* Set the timer WHICH to *NEW. If OLD is not NULL, set *OLD to the old value of timer WHICH. Returns 0 on success, -1 on errors. */ extern int setitimer(__itimer_which_t __which, const struct itimerval *__restrict __new, struct itimerval *__restrict __old) __THROW; /* Change the access time of FILE to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ extern int utimes(const char *__file, const struct timeval __tvp[2]) __THROW __nonnull((1)); #ifdef __USE_MISC /* Same as `utimes', but does not follow symbolic links. */ extern int lutimes(const char *__file, const struct timeval __tvp[2]) __THROW __nonnull((1)); /* Same as `utimes', but takes an open file descriptor instead of a name. */ extern int futimes(int __fd, const struct timeval __tvp[2]) __THROW; #endif #ifdef __USE_GNU /* Change the access time of FILE relative to FD to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ extern int futimesat(int __fd, const char *__file, const struct timeval __tvp[2]) __THROW; #endif #ifdef __USE_MISC /* Convenience macros for operations on timevals. NOTE: `timercmp' does not work for >= or <=. */ #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) #define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) #define timercmp(a, b, CMP) \ (((a)->tv_sec == (b)->tv_sec) ? \ ((a)->tv_usec CMP (b)->tv_usec) : \ ((a)->tv_sec CMP (b)->tv_sec)) #define timeradd(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ if ((result)->tv_usec >= 1000000) \ { \ ++(result)->tv_sec; \ (result)->tv_usec -= 1000000; \ } \ } while (0) #define timersub(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ if ((result)->tv_usec < 0) { \ --(result)->tv_sec; \ (result)->tv_usec += 1000000; \ } \ } while (0) #endif /* Misc. */ __END_DECLS #endif /* sys/time.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/ttydefaults.h ================================================ /*- * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94 */ /* * System wide defaults for terminal state. Linux version. */ #ifndef _SYS_TTYDEFAULTS_H_ #define _SYS_TTYDEFAULTS_H_ /* * Defaults on "first" open. */ #define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY) #define TTYDEF_OFLAG (OPOST | ONLCR | XTABS) #define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) #define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL) #define TTYDEF_SPEED (B9600) /* * Control Character Defaults */ #define CTRL(x) (x&037) #define CEOF CTRL('d') #ifdef _POSIX_VDISABLE #define CEOL _POSIX_VDISABLE #else #define CEOL '\0' /* XXX avoid _POSIX_VDISABLE */ #endif #define CERASE 0177 #define CINTR CTRL('c') #ifdef _POSIX_VDISABLE #define CSTATUS _POSIX_VDISABLE #else #define CSTATUS '\0' /* XXX avoid _POSIX_VDISABLE */ #endif #define CKILL CTRL('u') #define CMIN 1 #define CQUIT 034 /* FS, ^\ */ #define CSUSP CTRL('z') #define CTIME 0 #define CDSUSP CTRL('y') #define CSTART CTRL('q') #define CSTOP CTRL('s') #define CLNEXT CTRL('v') #define CDISCARD CTRL('o') #define CWERASE CTRL('w') #define CREPRINT CTRL('r') #define CEOT CEOF /* compat */ #define CBRK CEOL #define CRPRNT CREPRINT #define CFLUSH CDISCARD /* PROTECTED INCLUSION ENDS HERE */ #endif /* !_SYS_TTYDEFAULTS_H_ */ /* * #define TTYDEFCHARS to include an array of default control characters. */ #ifdef TTYDEFCHARS cc_t ttydefchars[NCCS] = { CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT, _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT, CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE }; #undef TTYDEFCHARS #endif ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/types.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 2.6 Primitive System Data Types */ #ifndef _SYS_TYPES_H #define _SYS_TYPES_H 1 #include __BEGIN_DECLS #include #ifdef __USE_MISC #ifndef __u_char_defined typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; #define __u_char_defined #endif #endif typedef __loff_t loff_t; #ifndef __ino_t_defined #ifndef __USE_FILE_OFFSET64 typedef __ino_t ino_t; #else typedef __ino64_t ino_t; #endif #define __ino_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __ino64_t_defined typedef __ino64_t ino64_t; #define __ino64_t_defined #endif #ifndef __dev_t_defined typedef __dev_t dev_t; #define __dev_t_defined #endif #ifndef __gid_t_defined typedef __gid_t gid_t; #define __gid_t_defined #endif #ifndef __mode_t_defined typedef __mode_t mode_t; #define __mode_t_defined #endif #ifndef __nlink_t_defined typedef __nlink_t nlink_t; #define __nlink_t_defined #endif #ifndef __uid_t_defined typedef __uid_t uid_t; #define __uid_t_defined #endif #ifndef __off_t_defined #ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; #else typedef __off64_t off_t; #endif #define __off_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; #define __off64_t_defined #endif #ifndef __pid_t_defined typedef __pid_t pid_t; #define __pid_t_defined #endif #if (defined __USE_XOPEN || defined __USE_XOPEN2K8) \ && !defined __id_t_defined typedef __id_t id_t; #define __id_t_defined #endif #ifndef __ssize_t_defined typedef __ssize_t ssize_t; #define __ssize_t_defined #endif #ifdef __USE_MISC #ifndef __daddr_t_defined typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; #define __daddr_t_defined #endif #endif #if (defined __USE_MISC || defined __USE_XOPEN) && !defined __key_t_defined typedef __key_t key_t; #define __key_t_defined #endif #if defined __USE_XOPEN || defined __USE_XOPEN2K8 #define __need_clock_t #endif #define __need_time_t #define __need_timer_t #define __need_clockid_t #include #ifdef __USE_XOPEN #ifndef __useconds_t_defined typedef __useconds_t useconds_t; #define __useconds_t_defined #endif #ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; #define __suseconds_t_defined #endif #endif #define __need_size_t #include #ifdef __USE_MISC /* Old compatibility names for C types. */ typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; #endif /* These size-specific names are used by some of the inet code. */ #if !__GNUC_PREREQ (2, 7) /* These types are defined by the ISO C99 header . */ #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int int16_t; typedef int int32_t; #if __WORDSIZE == 64 typedef long int int64_t; #else __extension__ typedef long long int int64_t; #endif #endif /* But these were defined by ISO C without the first `_'. */ typedef unsigned char u_int8_t; typedef unsigned short int u_int16_t; typedef unsigned int u_int32_t; #if __WORDSIZE == 64 typedef unsigned long int u_int64_t; #else __extension__ typedef unsigned long long int u_int64_t; #endif typedef int register_t; #else /* For GCC 2.7 and later, we can use specific type-size attributes. */ #define __intN_t(N, MODE) \ typedef int int##N##_t __attribute__ ((__mode__ (MODE))) #define __u_intN_t(N, MODE) \ typedef unsigned int u_int##N##_t __attribute__ ((__mode__ (MODE))) #ifndef __int8_t_defined #define __int8_t_defined __intN_t(8, __QI__); __intN_t(16, __HI__); __intN_t(32, __SI__); __intN_t(64, __DI__); #endif __u_intN_t(8, __QI__); __u_intN_t(16, __HI__); __u_intN_t(32, __SI__); __u_intN_t(64, __DI__); typedef int register_t __attribute__ ((__mode__(__word__))); /* Some code from BIND tests this macro to see if the types above are defined. */ #endif #define __BIT_TYPES_DEFINED__ 1 #ifdef __USE_MISC /* In BSD is expected to define BYTE_ORDER. */ #include /* It also defines `fd_set' and the FD_* macros for `select'. */ #include /* BSD defines these symbols, so we follow. */ #include #endif /* Use misc. */ #if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) \ && !defined __blksize_t_defined typedef __blksize_t blksize_t; #define __blksize_t_defined #endif /* Types from the Large File Support interface. */ #ifndef __USE_FILE_OFFSET64 #ifndef __blkcnt_t_defined typedef __blkcnt_t blkcnt_t; /* Type to count number of disk blocks. */ #define __blkcnt_t_defined #endif #ifndef __fsblkcnt_t_defined typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */ #define __fsblkcnt_t_defined #endif #ifndef __fsfilcnt_t_defined typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */ #define __fsfilcnt_t_defined #endif #else #ifndef __blkcnt_t_defined typedef __blkcnt64_t blkcnt_t; /* Type to count number of disk blocks. */ #define __blkcnt_t_defined #endif #ifndef __fsblkcnt_t_defined typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */ #define __fsblkcnt_t_defined #endif #ifndef __fsfilcnt_t_defined typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */ #define __fsfilcnt_t_defined #endif #endif #ifdef __USE_LARGEFILE64 typedef __blkcnt64_t blkcnt64_t; /* Type to count number of disk blocks. */ typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks. */ typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes. */ #endif /* Now add the thread types. */ #if defined __USE_POSIX199506 || defined __USE_UNIX98 #include #endif __END_DECLS #endif /* sys/types.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/ucontext.h ================================================ /* Copyright (C) 1998-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library. If not, see . */ /* System V/ARM ABI compliant context switching support. */ #ifndef _SYS_UCONTEXT_H #define _SYS_UCONTEXT_H 1 #include #include /* We need the signal context definitions even if they are not used included in . */ #include typedef int greg_t; /* Number of general registers. */ #define NGREG 18 /* Container for all general registers. */ typedef greg_t gregset_t[NGREG]; /* Number of each register is the `gregset_t' array. */ enum { REG_R0 = 0, #define REG_R0 REG_R0 REG_R1 = 1, #define REG_R1 REG_R1 REG_R2 = 2, #define REG_R2 REG_R2 REG_R3 = 3, #define REG_R3 REG_R3 REG_R4 = 4, #define REG_R4 REG_R4 REG_R5 = 5, #define REG_R5 REG_R5 REG_R6 = 6, #define REG_R6 REG_R6 REG_R7 = 7, #define REG_R7 REG_R7 REG_R8 = 8, #define REG_R8 REG_R8 REG_R9 = 9, #define REG_R9 REG_R9 REG_R10 = 10, #define REG_R10 REG_R10 REG_R11 = 11, #define REG_R11 REG_R11 REG_R12 = 12, #define REG_R12 REG_R12 REG_R13 = 13, #define REG_R13 REG_R13 REG_R14 = 14, #define REG_R14 REG_R14 REG_R15 = 15 #define REG_R15 REG_R15 }; struct _libc_fpstate { struct { unsigned int sign1:1; unsigned int unused:15; unsigned int sign2:1; unsigned int exponent:14; unsigned int j:1; unsigned int mantissa1:31; unsigned int mantissa0:32; } fpregs[8]; unsigned int fpsr:32; unsigned int fpcr:32; unsigned char ftype[8]; unsigned int init_flag; }; /* Structure to describe FPU registers. */ typedef struct _libc_fpstate fpregset_t; /* Context to describe whole processor state. This only describes the core registers; coprocessor registers get saved elsewhere (e.g. in uc_regspace, or somewhere unspecified on the stack during non-RT signal handlers). */ typedef struct sigcontext mcontext_t; /* Userlevel context. */ typedef struct ucontext { unsigned long uc_flags; struct ucontext *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; __sigset_t uc_sigmask; unsigned long uc_regspace[128] __attribute__ ((__aligned__(8))); } ucontext_t; #endif /* sys/ucontext.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/uio.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_UIO_H #define _SYS_UIO_H 1 #include #include __BEGIN_DECLS /* This file defines `struct iovec'. */ #include /* Read data from file descriptor FD, and put the result in the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's. The buffers are filled in the order specified. Operates just like 'read' (see ) except that data are put in IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t readv(int __fd, const struct iovec *__iovec, int __count) __wur; /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's, to file descriptor FD. The data is written in the order specified. Operates just like 'write' (see ) except that the data are taken from IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t writev(int __fd, const struct iovec *__iovec, int __count) __wur; #ifdef __USE_MISC #ifndef __USE_FILE_OFFSET64 /* Read data from file descriptor FD at the given position OFFSET without change the file pointer, and put the result in the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's. The buffers are filled in the order specified. Operates just like 'pread' (see ) except that data are put in IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t preadv(int __fd, const struct iovec *__iovec, int __count, __off_t __offset) __wur; /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's, to file descriptor FD at the given position OFFSET without change the file pointer. The data is written in the order specified. Operates just like 'pwrite' (see ) except that the data are taken from IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwritev(int __fd, const struct iovec *__iovec, int __count, __off_t __offset) __wur; #else #ifdef __REDIRECT extern ssize_t __REDIRECT(preadv, (int __fd, const struct iovec * __iovec, int __count, __off64_t __offset), preadv64) __wur; extern ssize_t __REDIRECT(pwritev, (int __fd, const struct iovec * __iovec, int __count, __off64_t __offset), pwritev64) __wur; #else #define preadv preadv64 #define pwritev pwritev64 #endif #endif #ifdef __USE_LARGEFILE64 /* Read data from file descriptor FD at the given position OFFSET without change the file pointer, and put the result in the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's. The buffers are filled in the order specified. Operates just like 'pread' (see ) except that data are put in IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t preadv64(int __fd, const struct iovec *__iovec, int __count, __off64_t __offset) __wur; /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's, to file descriptor FD at the given position OFFSET without change the file pointer. The data is written in the order specified. Operates just like 'pwrite' (see ) except that the data are taken from IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwritev64(int __fd, const struct iovec *__iovec, int __count, __off64_t __offset) __wur; #endif #endif /* Use misc. */ __END_DECLS #endif /* sys/uio.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/un.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_UN_H #define _SYS_UN_H 1 #include /* Get the definition of the macro to define the common sockaddr members. */ #include __BEGIN_DECLS /* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */ struct sockaddr_un { __SOCKADDR_COMMON(sun_); char sun_path[108]; /* Path name. */ }; #ifdef __USE_MISC #include /* For prototype of `strlen'. */ /* Evaluate to actual length of the `sockaddr_un' structure. */ #define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ + strlen ((ptr)->sun_path)) #endif __END_DECLS #endif /* sys/un.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/utsname.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 4.4 System Identification */ #ifndef _SYS_UTSNAME_H #define _SYS_UTSNAME_H 1 #include __BEGIN_DECLS #include #ifndef _UTSNAME_SYSNAME_LENGTH #define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_NODENAME_LENGTH #define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_RELEASE_LENGTH #define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_VERSION_LENGTH #define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_MACHINE_LENGTH #define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH #endif /* Structure describing the system and machine. */ struct utsname { /* Name of the implementation of the operating system. */ char sysname[_UTSNAME_SYSNAME_LENGTH]; /* Name of this node on the network. */ char nodename[_UTSNAME_NODENAME_LENGTH]; /* Current release level of this implementation. */ char release[_UTSNAME_RELEASE_LENGTH]; /* Current version level of this release. */ char version[_UTSNAME_VERSION_LENGTH]; /* Name of the hardware type the system is running on. */ char machine[_UTSNAME_MACHINE_LENGTH]; #if _UTSNAME_DOMAIN_LENGTH - 0 /* Name of the domain of this node on the network. */ #ifdef __USE_GNU char domainname[_UTSNAME_DOMAIN_LENGTH]; #else char __domainname[_UTSNAME_DOMAIN_LENGTH]; #endif #endif }; #ifdef __USE_MISC /* Note that SVID assumes all members have the same size. */ #define SYS_NMLN _UTSNAME_LENGTH #endif /* Put information about the system in NAME. */ extern int uname(struct utsname *__name) __THROW; __END_DECLS #endif /* sys/utsname.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/wait.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 3.2.1 Wait for Process Termination */ #ifndef _SYS_WAIT_H #define _SYS_WAIT_H 1 #include __BEGIN_DECLS #include /* These macros could also be defined in . */ #if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8) /* This will define the `W*' macros for the flag bits to `waitpid', `wait3', and `wait4'. */ #include /* This will define all the `__W*' macros. */ #include #define WEXITSTATUS(status) __WEXITSTATUS (status) #define WTERMSIG(status) __WTERMSIG (status) #define WSTOPSIG(status) __WSTOPSIG (status) #define WIFEXITED(status) __WIFEXITED (status) #define WIFSIGNALED(status) __WIFSIGNALED (status) #define WIFSTOPPED(status) __WIFSTOPPED (status) #ifdef __WIFCONTINUED #define WIFCONTINUED(status) __WIFCONTINUED (status) #endif #endif /* not included. */ #ifdef __USE_MISC #define WCOREFLAG __WCOREFLAG #define WCOREDUMP(status) __WCOREDUMP (status) #define W_EXITCODE(ret, sig) __W_EXITCODE (ret, sig) #define W_STOPCODE(sig) __W_STOPCODE (sig) #endif /* Wait for a child to die. When one does, put its status in *STAT_LOC and return its process ID. For errors, return (pid_t) -1. This function is a cancellation point and therefore not marked with __THROW. */ extern __pid_t wait(int *__stat_loc); #ifdef __USE_MISC /* Special values for the PID argument to `waitpid' and `wait4'. */ #define WAIT_ANY (-1) /* Any process. */ #define WAIT_MYPGRP 0 /* Any process in my process group. */ #endif /* Wait for a child matching PID to die. If PID is greater than 0, match any process whose process ID is PID. If PID is (pid_t) -1, match any process. If PID is (pid_t) 0, match any process with the same process group as the current process. If PID is less than -1, match any process whose process group is the absolute value of PID. If the WNOHANG bit is set in OPTIONS, and that child is not already dead, return (pid_t) 0. If successful, return PID and store the dead child's status in STAT_LOC. Return (pid_t) -1 for errors. If the WUNTRACED bit is set in OPTIONS, return status for stopped children; otherwise don't. This function is a cancellation point and therefore not marked with __THROW. */ extern __pid_t waitpid(__pid_t __pid, int *__stat_loc, int __options); #if defined __USE_XOPEN || defined __USE_XOPEN2K8 #ifndef __id_t_defined #include typedef __id_t id_t; #define __id_t_defined #endif #define __need_siginfo_t #include /* Wait for a childing matching IDTYPE and ID to change the status and place appropriate information in *INFOP. If IDTYPE is P_PID, match any process whose process ID is ID. If IDTYPE is P_PGID, match any process whose process group is ID. If IDTYPE is P_ALL, match any process. If the WNOHANG bit is set in OPTIONS, and that child is not already dead, clear *INFOP and return 0. If successful, store exit code and status in *INFOP. This function is a cancellation point and therefore not marked with __THROW. */ extern int waitid(idtype_t __idtype, __id_t __id, siginfo_t * __infop, int __options); #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* This being here makes the prototypes valid whether or not we have already included to define `struct rusage'. */ struct rusage; /* Wait for a child to exit. When one does, put its status in *STAT_LOC and return its process ID. For errors return (pid_t) -1. If USAGE is not nil, store information about the child's resource usage there. If the WUNTRACED bit is set in OPTIONS, return status for stopped children; otherwise don't. */ extern __pid_t wait3(int *__stat_loc, int __options, struct rusage *__usage) __THROWNL; #endif #ifdef __USE_MISC /* PID is like waitpid. Other args are like wait3. */ extern __pid_t wait4(__pid_t __pid, int *__stat_loc, int __options, struct rusage *__usage) __THROWNL; #endif /* Use misc. */ __END_DECLS #endif /* sys/wait.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/arpa/inet.h ================================================ /* Copyright (C) 1997-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _ARPA_INET_H #define _ARPA_INET_H 1 #include #include /* To define `struct in_addr'. */ /* Type for length arguments in socket calls. */ #ifndef __socklen_t_defined typedef __socklen_t socklen_t; #define __socklen_t_defined #endif __BEGIN_DECLS /* Convert Internet host address from numbers-and-dots notation in CP into binary data in network byte order. */ extern in_addr_t inet_addr(const char *__cp) __THROW; /* Return the local host address part of the Internet address in IN. */ extern in_addr_t inet_lnaof(struct in_addr __in) __THROW; /* Make Internet host address in network byte order by combining the network number NET with the local address HOST. */ extern struct in_addr inet_makeaddr(in_addr_t __net, in_addr_t __host) __THROW; /* Return network number part of the Internet address IN. */ extern in_addr_t inet_netof(struct in_addr __in) __THROW; /* Extract the network number in network byte order from the address in numbers-and-dots natation starting at CP. */ extern in_addr_t inet_network(const char *__cp) __THROW; /* Convert Internet number in IN to ASCII representation. The return value is a pointer to an internal array containing the string. */ extern char *inet_ntoa(struct in_addr __in) __THROW; /* Convert from presentation format of an Internet number in buffer starting at CP to the binary network format and store result for interface type AF in buffer starting at BUF. */ extern int inet_pton(int __af, const char *__restrict __cp, void *__restrict __buf) __THROW; /* Convert a Internet address in binary network format for interface type AF in buffer starting at CP to presentation form and place result in buffer of length LEN astarting at BUF. */ extern const char *inet_ntop(int __af, const void *__restrict __cp, char *__restrict __buf, socklen_t __len) __THROW; /* The following functions are not part of XNS 5.2. */ #ifdef __USE_MISC /* Convert Internet host address from numbers-and-dots notation in CP into binary data and store the result in the structure INP. */ extern int inet_aton(const char *__cp, struct in_addr *__inp) __THROW; /* Format a network number NET into presentation format and place result in buffer starting at BUF with length of LEN bytes. */ extern char *inet_neta(in_addr_t __net, char *__buf, size_t __len) __THROW; /* Convert network number for interface type AF in buffer starting at CP to presentation format. The result will specifiy BITS bits of the number. */ extern char *inet_net_ntop(int __af, const void *__cp, int __bits, char *__buf, size_t __len) __THROW; /* Convert network number for interface type AF from presentation in buffer starting at CP to network format and store result int buffer starting at BUF of size LEN. */ extern int inet_net_pton(int __af, const char *__cp, void *__buf, size_t __len) __THROW; /* Convert ASCII representation in hexadecimal form of the Internet address to binary form and place result in buffer of length LEN starting at BUF. */ extern unsigned int inet_nsap_addr(const char *__cp, unsigned char *__buf, int __len) __THROW; /* Convert internet address in binary form in LEN bytes starting at CP a presentation form and place result in BUF. */ extern char *inet_nsap_ntoa(int __len, const unsigned char *__cp, char *__buf) __THROW; #endif __END_DECLS #endif /* arpa/inet.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/asm-generic/errno-base.h ================================================ #ifndef _ASM_GENERIC_ERRNO_BASE_H #define _ASM_GENERIC_ERRNO_BASE_H #define EPERM 1 /* Operation not permitted */ #define ENOENT 2 /* No such file or directory */ #define ESRCH 3 /* No such process */ #define EINTR 4 /* Interrupted system call */ #define EIO 5 /* I/O error */ #define ENXIO 6 /* No such device or address */ #define E2BIG 7 /* Argument list too long */ #define ENOEXEC 8 /* Exec format error */ #define EBADF 9 /* Bad file number */ #define ECHILD 10 /* No child processes */ #define EAGAIN 11 /* Try again */ #define ENOMEM 12 /* Out of memory */ #define EACCES 13 /* Permission denied */ #define EFAULT 14 /* Bad address */ #define ENOTBLK 15 /* Block device required */ #define EBUSY 16 /* Device or resource busy */ #define EEXIST 17 /* File exists */ #define EXDEV 18 /* Cross-device link */ #define ENODEV 19 /* No such device */ #define ENOTDIR 20 /* Not a directory */ #define EISDIR 21 /* Is a directory */ #define EINVAL 22 /* Invalid argument */ #define ENFILE 23 /* File table overflow */ #define EMFILE 24 /* Too many open files */ #define ENOTTY 25 /* Not a typewriter */ #define ETXTBSY 26 /* Text file busy */ #define EFBIG 27 /* File too large */ #define ENOSPC 28 /* No space left on device */ #define ESPIPE 29 /* Illegal seek */ #define EROFS 30 /* Read-only file system */ #define EMLINK 31 /* Too many links */ #define EPIPE 32 /* Broken pipe */ #define EDOM 33 /* Math argument out of domain of func */ #define ERANGE 34 /* Math result not representable */ #endif ================================================ FILE: v2/headers/linux_arm/usr/include/asm-generic/errno.h ================================================ #ifndef _ASM_GENERIC_ERRNO_H #define _ASM_GENERIC_ERRNO_H #include #define EDEADLK 35 /* Resource deadlock would occur */ #define ENAMETOOLONG 36 /* File name too long */ #define ENOLCK 37 /* No record locks available */ /* * This error code is special: arch syscall entry code will return * -ENOSYS if users try to call a syscall that doesn't exist. To keep * failures of syscalls that really do exist distinguishable from * failures due to attempts to use a nonexistent syscall, syscall * implementations should refrain from returning -ENOSYS. */ #define ENOSYS 38 /* Invalid system call number */ #define ENOTEMPTY 39 /* Directory not empty */ #define ELOOP 40 /* Too many symbolic links encountered */ #define EWOULDBLOCK EAGAIN /* Operation would block */ #define ENOMSG 42 /* No message of desired type */ #define EIDRM 43 /* Identifier removed */ #define ECHRNG 44 /* Channel number out of range */ #define EL2NSYNC 45 /* Level 2 not synchronized */ #define EL3HLT 46 /* Level 3 halted */ #define EL3RST 47 /* Level 3 reset */ #define ELNRNG 48 /* Link number out of range */ #define EUNATCH 49 /* Protocol driver not attached */ #define ENOCSI 50 /* No CSI structure available */ #define EL2HLT 51 /* Level 2 halted */ #define EBADE 52 /* Invalid exchange */ #define EBADR 53 /* Invalid request descriptor */ #define EXFULL 54 /* Exchange full */ #define ENOANO 55 /* No anode */ #define EBADRQC 56 /* Invalid request code */ #define EBADSLT 57 /* Invalid slot */ #define EDEADLOCK EDEADLK #define EBFONT 59 /* Bad font file format */ #define ENOSTR 60 /* Device not a stream */ #define ENODATA 61 /* No data available */ #define ETIME 62 /* Timer expired */ #define ENOSR 63 /* Out of streams resources */ #define ENONET 64 /* Machine is not on the network */ #define ENOPKG 65 /* Package not installed */ #define EREMOTE 66 /* Object is remote */ #define ENOLINK 67 /* Link has been severed */ #define EADV 68 /* Advertise error */ #define ESRMNT 69 /* Srmount error */ #define ECOMM 70 /* Communication error on send */ #define EPROTO 71 /* Protocol error */ #define EMULTIHOP 72 /* Multihop attempted */ #define EDOTDOT 73 /* RFS specific error */ #define EBADMSG 74 /* Not a data message */ #define EOVERFLOW 75 /* Value too large for defined data type */ #define ENOTUNIQ 76 /* Name not unique on network */ #define EBADFD 77 /* File descriptor in bad state */ #define EREMCHG 78 /* Remote address changed */ #define ELIBACC 79 /* Can not access a needed shared library */ #define ELIBBAD 80 /* Accessing a corrupted shared library */ #define ELIBSCN 81 /* .lib section in a.out corrupted */ #define ELIBMAX 82 /* Attempting to link in too many shared libraries */ #define ELIBEXEC 83 /* Cannot exec a shared library directly */ #define EILSEQ 84 /* Illegal byte sequence */ #define ERESTART 85 /* Interrupted system call should be restarted */ #define ESTRPIPE 86 /* Streams pipe error */ #define EUSERS 87 /* Too many users */ #define ENOTSOCK 88 /* Socket operation on non-socket */ #define EDESTADDRREQ 89 /* Destination address required */ #define EMSGSIZE 90 /* Message too long */ #define EPROTOTYPE 91 /* Protocol wrong type for socket */ #define ENOPROTOOPT 92 /* Protocol not available */ #define EPROTONOSUPPORT 93 /* Protocol not supported */ #define ESOCKTNOSUPPORT 94 /* Socket type not supported */ #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ #define EPFNOSUPPORT 96 /* Protocol family not supported */ #define EAFNOSUPPORT 97 /* Address family not supported by protocol */ #define EADDRINUSE 98 /* Address already in use */ #define EADDRNOTAVAIL 99 /* Cannot assign requested address */ #define ENETDOWN 100 /* Network is down */ #define ENETUNREACH 101 /* Network is unreachable */ #define ENETRESET 102 /* Network dropped connection because of reset */ #define ECONNABORTED 103 /* Software caused connection abort */ #define ECONNRESET 104 /* Connection reset by peer */ #define ENOBUFS 105 /* No buffer space available */ #define EISCONN 106 /* Transport endpoint is already connected */ #define ENOTCONN 107 /* Transport endpoint is not connected */ #define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ #define ETOOMANYREFS 109 /* Too many references: cannot splice */ #define ETIMEDOUT 110 /* Connection timed out */ #define ECONNREFUSED 111 /* Connection refused */ #define EHOSTDOWN 112 /* Host is down */ #define EHOSTUNREACH 113 /* No route to host */ #define EALREADY 114 /* Operation already in progress */ #define EINPROGRESS 115 /* Operation now in progress */ #define ESTALE 116 /* Stale file handle */ #define EUCLEAN 117 /* Structure needs cleaning */ #define ENOTNAM 118 /* Not a XENIX named type file */ #define ENAVAIL 119 /* No XENIX semaphores available */ #define EISNAM 120 /* Is a named type file */ #define EREMOTEIO 121 /* Remote I/O error */ #define EDQUOT 122 /* Quota exceeded */ #define ENOMEDIUM 123 /* No medium found */ #define EMEDIUMTYPE 124 /* Wrong medium type */ #define ECANCELED 125 /* Operation Canceled */ #define ENOKEY 126 /* Required key not available */ #define EKEYEXPIRED 127 /* Key has expired */ #define EKEYREVOKED 128 /* Key has been revoked */ #define EKEYREJECTED 129 /* Key was rejected by service */ /* for robust mutexes */ #define EOWNERDEAD 130 /* Owner died */ #define ENOTRECOVERABLE 131 /* State not recoverable */ #define ERFKILL 132 /* Operation not possible due to RF-kill */ #define EHWPOISON 133 /* Memory page has hardware error */ #endif ================================================ FILE: v2/headers/linux_arm/usr/include/asm-generic/ioctl.h ================================================ #ifndef _ASM_GENERIC_IOCTL_H #define _ASM_GENERIC_IOCTL_H /* ioctl command encoding: 32 bits total, command in lower 16 bits, * size of the parameter structure in the lower 14 bits of the * upper 16 bits. * Encoding the size of the parameter structure in the ioctl request * is useful for catching programs compiled with old versions * and to avoid overwriting user space outside the user buffer area. * The highest 2 bits are reserved for indicating the ``access mode''. * NOTE: This limits the max parameter size to 16kB -1 ! */ /* * The following is for compatibility across the various Linux * platforms. The generic ioctl numbering scheme doesn't really enforce * a type field. De facto, however, the top 8 bits of the lower 16 * bits are indeed used as a type field, so we might just as well make * this explicit here. Please be sure to use the decoding macros * below from now on. */ #define _IOC_NRBITS 8 #define _IOC_TYPEBITS 8 /* * Let any architecture override either of the following before * including this file. */ #ifndef _IOC_SIZEBITS #define _IOC_SIZEBITS 14 #endif #ifndef _IOC_DIRBITS #define _IOC_DIRBITS 2 #endif #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) #define _IOC_NRSHIFT 0 #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) /* * Direction bits, which any architecture can choose to override * before including this file. */ #ifndef _IOC_NONE #define _IOC_NONE 0U #endif #ifndef _IOC_WRITE #define _IOC_WRITE 1U #endif #ifndef _IOC_READ #define _IOC_READ 2U #endif #define _IOC(dir,type,nr,size) \ (((dir) << _IOC_DIRSHIFT) | \ ((type) << _IOC_TYPESHIFT) | \ ((nr) << _IOC_NRSHIFT) | \ ((size) << _IOC_SIZESHIFT)) #define _IOC_TYPECHECK(t) (sizeof(t)) /* used to create numbers */ #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size))) #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) #define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) #define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) #define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) /* used to decode ioctl numbers.. */ #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) /* ...and for the drivers/sound files... */ #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) #endif /* _ASM_GENERIC_IOCTL_H */ ================================================ FILE: v2/headers/linux_arm/usr/include/asm-generic/ioctls.h ================================================ #ifndef __ASM_GENERIC_IOCTLS_H #define __ASM_GENERIC_IOCTLS_H #include /* * These are the most common definitions for tty ioctl numbers. * Most of them do not use the recommended _IOC(), but there is * probably some source code out there hardcoding the number, * so we might as well use them for all new platforms. * * The architectures that use different values here typically * try to be compatible with some Unix variants for the same * architecture. */ /* 0x54 is just a magic number to make these relatively unique ('T') */ #define TCGETS 0x5401 #define TCSETS 0x5402 #define TCSETSW 0x5403 #define TCSETSF 0x5404 #define TCGETA 0x5405 #define TCSETA 0x5406 #define TCSETAW 0x5407 #define TCSETAF 0x5408 #define TCSBRK 0x5409 #define TCXONC 0x540A #define TCFLSH 0x540B #define TIOCEXCL 0x540C #define TIOCNXCL 0x540D #define TIOCSCTTY 0x540E #define TIOCGPGRP 0x540F #define TIOCSPGRP 0x5410 #define TIOCOUTQ 0x5411 #define TIOCSTI 0x5412 #define TIOCGWINSZ 0x5413 #define TIOCSWINSZ 0x5414 #define TIOCMGET 0x5415 #define TIOCMBIS 0x5416 #define TIOCMBIC 0x5417 #define TIOCMSET 0x5418 #define TIOCGSOFTCAR 0x5419 #define TIOCSSOFTCAR 0x541A #define FIONREAD 0x541B #define TIOCINQ FIONREAD #define TIOCLINUX 0x541C #define TIOCCONS 0x541D #define TIOCGSERIAL 0x541E #define TIOCSSERIAL 0x541F #define TIOCPKT 0x5420 #define FIONBIO 0x5421 #define TIOCNOTTY 0x5422 #define TIOCSETD 0x5423 #define TIOCGETD 0x5424 #define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ #define TIOCSBRK 0x5427 /* BSD compatibility */ #define TIOCCBRK 0x5428 /* BSD compatibility */ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TCGETS2 _IOR('T', 0x2A, struct termios2) #define TCSETS2 _IOW('T', 0x2B, struct termios2) #define TCSETSW2 _IOW('T', 0x2C, struct termios2) #define TCSETSF2 _IOW('T', 0x2D, struct termios2) #define TIOCGRS485 0x542E #ifndef TIOCSRS485 #define TIOCSRS485 0x542F #endif #define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ #define TIOCGDEV _IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */ #define TCGETX 0x5432 /* SYS5 TCGETX compatibility */ #define TCSETX 0x5433 #define TCSETXF 0x5434 #define TCSETXW 0x5435 #define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */ #define TIOCVHANGUP 0x5437 #define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */ #define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */ #define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */ #define FIONCLEX 0x5450 #define FIOCLEX 0x5451 #define FIOASYNC 0x5452 #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 #define TIOCSERSWILD 0x5455 #define TIOCGLCKTRMIOS 0x5456 #define TIOCSLCKTRMIOS 0x5457 #define TIOCSERGSTRUCT 0x5458 /* For debugging only */ #define TIOCSERGETLSR 0x5459 /* Get line status register */ #define TIOCSERGETMULTI 0x545A /* Get multiport config */ #define TIOCSERSETMULTI 0x545B /* Set multiport config */ #define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ #define TIOCGICOUNT 0x545D /* read serial port __inline__ interrupt counts */ /* * Some arches already define FIOQSIZE due to a historical * conflict with a Hayes modem-specific ioctl value. */ #ifndef FIOQSIZE #define FIOQSIZE 0x5460 #endif /* Used for packet mode */ #define TIOCPKT_DATA 0 #define TIOCPKT_FLUSHREAD 1 #define TIOCPKT_FLUSHWRITE 2 #define TIOCPKT_STOP 4 #define TIOCPKT_START 8 #define TIOCPKT_NOSTOP 16 #define TIOCPKT_DOSTOP 32 #define TIOCPKT_IOCTL 64 #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ #endif /* __ASM_GENERIC_IOCTLS_H */ ================================================ FILE: v2/headers/linux_arm/usr/include/asm-generic/param.h ================================================ #ifndef __ASM_GENERIC_PARAM_H #define __ASM_GENERIC_PARAM_H #ifndef HZ #define HZ 100 #endif #ifndef EXEC_PAGESIZE #define EXEC_PAGESIZE 4096 #endif #ifndef NOGROUP #define NOGROUP (-1) #endif #define MAXHOSTNAMELEN 64 /* max length of hostname */ #endif /* __ASM_GENERIC_PARAM_H */ ================================================ FILE: v2/headers/linux_arm/usr/include/asm-generic/socket.h ================================================ #ifndef __ASM_GENERIC_SOCKET_H #define __ASM_GENERIC_SOCKET_H #include /* For setsockopt(2) */ #define SOL_SOCKET 1 #define SO_DEBUG 1 #define SO_REUSEADDR 2 #define SO_TYPE 3 #define SO_ERROR 4 #define SO_DONTROUTE 5 #define SO_BROADCAST 6 #define SO_SNDBUF 7 #define SO_RCVBUF 8 #define SO_SNDBUFFORCE 32 #define SO_RCVBUFFORCE 33 #define SO_KEEPALIVE 9 #define SO_OOBINLINE 10 #define SO_NO_CHECK 11 #define SO_PRIORITY 12 #define SO_LINGER 13 #define SO_BSDCOMPAT 14 #define SO_REUSEPORT 15 #ifndef SO_PASSCRED /* powerpc only differs in these */ #define SO_PASSCRED 16 #define SO_PEERCRED 17 #define SO_RCVLOWAT 18 #define SO_SNDLOWAT 19 #define SO_RCVTIMEO 20 #define SO_SNDTIMEO 21 #endif /* Security levels - as per NRL IPv6 - don't actually do anything */ #define SO_SECURITY_AUTHENTICATION 22 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 #define SO_SECURITY_ENCRYPTION_NETWORK 24 #define SO_BINDTODEVICE 25 /* Socket filtering */ #define SO_ATTACH_FILTER 26 #define SO_DETACH_FILTER 27 #define SO_GET_FILTER SO_ATTACH_FILTER #define SO_PEERNAME 28 #define SO_TIMESTAMP 29 #define SCM_TIMESTAMP SO_TIMESTAMP #define SO_ACCEPTCONN 30 #define SO_PEERSEC 31 #define SO_PASSSEC 34 #define SO_TIMESTAMPNS 35 #define SCM_TIMESTAMPNS SO_TIMESTAMPNS #define SO_MARK 36 #define SO_TIMESTAMPING 37 #define SCM_TIMESTAMPING SO_TIMESTAMPING #define SO_PROTOCOL 38 #define SO_DOMAIN 39 #define SO_RXQ_OVFL 40 #define SO_WIFI_STATUS 41 #define SCM_WIFI_STATUS SO_WIFI_STATUS #define SO_PEEK_OFF 42 /* Instruct lower device to use last 4-bytes of skb data as FCS */ #define SO_NOFCS 43 #define SO_LOCK_FILTER 44 #define SO_SELECT_ERR_QUEUE 45 #define SO_BUSY_POLL 46 #define SO_MAX_PACING_RATE 47 #define SO_BPF_EXTENSIONS 48 #define SO_INCOMING_CPU 49 #define SO_ATTACH_BPF 50 #define SO_DETACH_BPF SO_DETACH_FILTER #define SO_ATTACH_REUSEPORT_CBPF 51 #define SO_ATTACH_REUSEPORT_EBPF 52 #define SO_CNX_ADVICE 53 #endif /* __ASM_GENERIC_SOCKET_H */ ================================================ FILE: v2/headers/linux_arm/usr/include/asm-generic/sockios.h ================================================ #ifndef __ASM_GENERIC_SOCKIOS_H #define __ASM_GENERIC_SOCKIOS_H /* Socket-level I/O control calls. */ #define FIOSETOWN 0x8901 #define SIOCSPGRP 0x8902 #define FIOGETOWN 0x8903 #define SIOCGPGRP 0x8904 #define SIOCATMARK 0x8905 #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ #endif /* __ASM_GENERIC_SOCKIOS_H */ ================================================ FILE: v2/headers/linux_arm/usr/include/assert.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.2 Diagnostics */ #ifdef _ASSERT_H #undef _ASSERT_H #undef assert #undef __ASSERT_VOID_CAST #ifdef __USE_GNU #undef assert_perror #endif #endif /* assert.h */ #define _ASSERT_H 1 #include #if defined __cplusplus && __GNUC_PREREQ (2,95) #define __ASSERT_VOID_CAST static_cast #else #define __ASSERT_VOID_CAST (void) #endif /* void assert (int expression); If NDEBUG is defined, do nothing. If not, and EXPRESSION is zero, print an error message and abort. */ #ifdef NDEBUG #define assert(expr) (__ASSERT_VOID_CAST (0)) /* void assert_perror (int errnum); If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an error message with the error text for ERRNUM and abort. (This is a GNU extension.) */ #ifdef __USE_GNU #define assert_perror(errnum) (__ASSERT_VOID_CAST (0)) #endif #else /* Not NDEBUG. */ #ifndef _ASSERT_H_DECLS #define _ASSERT_H_DECLS __BEGIN_DECLS /* This prints an "Assertion failed" message and aborts. */ extern void __assert_fail(const char *__assertion, const char *__file, unsigned int __line, const char *__function) __THROW __attribute__ ((__noreturn__)); /* Likewise, but prints the error text for ERRNUM. */ extern void __assert_perror_fail(int __errnum, const char *__file, unsigned int __line, const char *__function) __THROW __attribute__ ((__noreturn__)); /* The following is not at all used here but needed for standard compliance. */ extern void __assert(const char *__assertion, const char *__file, int __line) __THROW __attribute__ ((__noreturn__)); __END_DECLS #endif /* Not _ASSERT_H_DECLS */ #define assert(expr) \ ((expr) \ ? __ASSERT_VOID_CAST (0) \ : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION)) #ifdef __USE_GNU #define assert_perror(errnum) \ (!(errnum) \ ? __ASSERT_VOID_CAST (0) \ : __assert_perror_fail ((errnum), __FILE__, __LINE__, __ASSERT_FUNCTION)) #endif /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__' which contains the name of the function currently being defined. This is broken in G++ before version 2.6. C9x has a similar variable called __func__, but prefer the GCC one since it demangles C++ function names. */ #if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4) #define __ASSERT_FUNCTION __PRETTY_FUNCTION__ #else #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L #define __ASSERT_FUNCTION __func__ #else #define __ASSERT_FUNCTION ((const char *) 0) #endif #endif #endif /* NDEBUG. */ #if defined __USE_ISOC11 && !defined __cplusplus #undef static_assert #define static_assert _Static_assert #endif ================================================ FILE: v2/headers/linux_arm/usr/include/ctype.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard 7.4: Character handling */ #ifndef _CTYPE_H #define _CTYPE_H 1 #include #include __BEGIN_DECLS #ifndef _ISbit /* These are all the characteristics of characters. If there get to be more than 16 distinct characteristics, many things must be changed that use `unsigned short int's. The characteristics are stored always in network byte order (big endian). We define the bit value interpretations here dependent on the machine's byte order. */ #include #if __BYTE_ORDER == __BIG_ENDIAN #define _ISbit(bit) (1 << (bit)) #else /* __BYTE_ORDER == __LITTLE_ENDIAN */ #define _ISbit(bit) ((bit) < 8 ? ((1 << (bit)) << 8) : ((1 << (bit)) >> 8)) #endif enum { _ISupper = _ISbit(0), /* UPPERCASE. */ _ISlower = _ISbit(1), /* lowercase. */ _ISalpha = _ISbit(2), /* Alphabetic. */ _ISdigit = _ISbit(3), /* Numeric. */ _ISxdigit = _ISbit(4), /* Hexadecimal numeric. */ _ISspace = _ISbit(5), /* Whitespace. */ _ISprint = _ISbit(6), /* Printing. */ _ISgraph = _ISbit(7), /* Graphical. */ _ISblank = _ISbit(8), /* Blank (usually SPC and TAB). */ _IScntrl = _ISbit(9), /* Control character. */ _ISpunct = _ISbit(10), /* Punctuation. */ _ISalnum = _ISbit(11) /* Alphanumeric. */ }; #endif /* ! _ISbit */ /* These are defined in ctype-info.c. The declarations here must match those in localeinfo.h. In the thread-specific locale model (see `uselocale' in ) we cannot use global variables for these as was done in the past. Instead, the following accessor functions return the address of each variable, which is local to the current thread if multithreaded. These point into arrays of 384, so they can be indexed by any `unsigned char' value [0,255]; by EOF (-1); or by any `signed char' value [-128,-1). ISO C requires that the ctype functions work for `unsigned char' values and for EOF; we also support negative `signed char' values for broken old programs. The case conversion arrays are of `int's rather than `unsigned char's because tolower (EOF) must be EOF, which doesn't fit into an `unsigned char'. But today more important is that the arrays are also used for multi-byte character sets. */ extern const unsigned short int **__ctype_b_loc(void) __THROW __attribute__ ((__const__)); extern const __int32_t **__ctype_tolower_loc(void) __THROW __attribute__ ((__const__)); extern const __int32_t **__ctype_toupper_loc(void) __THROW __attribute__ ((__const__)); #ifndef __cplusplus #define __isctype(c, type) \ ((*__ctype_b_loc ())[(int) (c)] & (unsigned short int) type) #elif defined __USE_EXTERN_INLINES #define __isctype_f(type) \ __extern_inline int \ is##type (int __c) __THROW \ { \ return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _IS##type; \ } #endif #define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */ #define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */ #define __exctype(name) extern int name (int) __THROW __BEGIN_NAMESPACE_STD /* The following names are all functions: int isCHARACTERISTIC(int c); which return nonzero iff C has CHARACTERISTIC. For the meaning of the characteristic names, see the `enum' above. */ __exctype(isalnum); __exctype(isalpha); __exctype(iscntrl); __exctype(isdigit); __exctype(islower); __exctype(isgraph); __exctype(isprint); __exctype(ispunct); __exctype(isspace); __exctype(isupper); __exctype(isxdigit); /* Return the lowercase version of C. */ extern int tolower(int __c) __THROW; /* Return the uppercase version of C. */ extern int toupper(int __c) __THROW; __END_NAMESPACE_STD /* ISO C99 introduced one new function. */ #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 __exctype(isblank); __END_NAMESPACE_C99 #endif #ifdef __USE_GNU /* Test C for a set of character classes according to MASK. */ extern int isctype(int __c, int __mask) __THROW; #endif #if defined __USE_MISC || defined __USE_XOPEN /* Return nonzero iff C is in the ASCII set (i.e., is no more than 7 bits wide). */ extern int isascii(int __c) __THROW; /* Return the part of C that is in the ASCII set (i.e., the low-order 7 bits of C). */ extern int toascii(int __c) __THROW; /* These are the same as `toupper' and `tolower' except that they do not check the argument for being in the range of a `char'. */ __exctype(_toupper); __exctype(_tolower); #endif /* Use X/Open or use misc. */ /* This code is needed for the optimized mapping functions. */ #define __tobody(c, f, a, args) \ (__extension__ \ ({ int __res; \ if (sizeof (c) > 1) \ { \ if (__builtin_constant_p (c)) \ { \ int __c = (c); \ __res = __c < -128 || __c > 255 ? __c : (a)[__c]; \ } \ else \ __res = f args; \ } \ else \ __res = (a)[(int) (c)]; \ __res; })) #if !defined __NO_CTYPE #ifdef __isctype_f __isctype_f(alnum) __isctype_f(alpha) __isctype_f(cntrl) __isctype_f(digit) __isctype_f(lower) __isctype_f(graph) __isctype_f(print) __isctype_f(punct) __isctype_f(space) __isctype_f(upper) __isctype_f(xdigit) #ifdef __USE_ISOC99 __isctype_f(blank) #endif #elif defined __isctype #define isalnum(c) __isctype((c), _ISalnum) #define isalpha(c) __isctype((c), _ISalpha) #define iscntrl(c) __isctype((c), _IScntrl) #define isdigit(c) __isctype((c), _ISdigit) #define islower(c) __isctype((c), _ISlower) #define isgraph(c) __isctype((c), _ISgraph) #define isprint(c) __isctype((c), _ISprint) #define ispunct(c) __isctype((c), _ISpunct) #define isspace(c) __isctype((c), _ISspace) #define isupper(c) __isctype((c), _ISupper) #define isxdigit(c) __isctype((c), _ISxdigit) #ifdef __USE_ISOC99 #define isblank(c) __isctype((c), _ISblank) #endif #endif #ifdef __USE_EXTERN_INLINES __extern_inline int __NTH(tolower(int __c)) { return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc())[__c] : __c; } __extern_inline int __NTH(toupper(int __c)) { return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc())[__c] : __c; } #endif #if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus #define tolower(c) __tobody (c, tolower, *__ctype_tolower_loc (), (c)) #define toupper(c) __tobody (c, toupper, *__ctype_toupper_loc (), (c)) #endif /* Optimizing gcc */ #if defined __USE_MISC || defined __USE_XOPEN #define isascii(c) __isascii (c) #define toascii(c) __toascii (c) #define _tolower(c) ((int) (*__ctype_tolower_loc ())[(int) (c)]) #define _toupper(c) ((int) (*__ctype_toupper_loc ())[(int) (c)]) #endif #endif /* Not __NO_CTYPE. */ #ifdef __USE_XOPEN2K8 /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ #include /* These definitions are similar to the ones above but all functions take as an argument a handle for the locale which shall be used. */ #define __isctype_l(c, type, locale) \ ((locale)->__ctype_b[(int) (c)] & (unsigned short int) type) #define __exctype_l(name) \ extern int name (int, __locale_t) __THROW /* The following names are all functions: int isCHARACTERISTIC(int c, locale_t *locale); which return nonzero iff C has CHARACTERISTIC. For the meaning of the characteristic names, see the `enum' above. */ __exctype_l(isalnum_l); __exctype_l(isalpha_l); __exctype_l(iscntrl_l); __exctype_l(isdigit_l); __exctype_l(islower_l); __exctype_l(isgraph_l); __exctype_l(isprint_l); __exctype_l(ispunct_l); __exctype_l(isspace_l); __exctype_l(isupper_l); __exctype_l(isxdigit_l); __exctype_l(isblank_l); /* Return the lowercase version of C in locale L. */ extern int __tolower_l(int __c, __locale_t __l) __THROW; extern int tolower_l(int __c, __locale_t __l) __THROW; /* Return the uppercase version of C. */ extern int __toupper_l(int __c, __locale_t __l) __THROW; extern int toupper_l(int __c, __locale_t __l) __THROW; #if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus #define __tolower_l(c, locale) \ __tobody (c, __tolower_l, (locale)->__ctype_tolower, (c, locale)) #define __toupper_l(c, locale) \ __tobody (c, __toupper_l, (locale)->__ctype_toupper, (c, locale)) #define tolower_l(c, locale) __tolower_l ((c), (locale)) #define toupper_l(c, locale) __toupper_l ((c), (locale)) #endif /* Optimizing gcc */ #ifndef __NO_CTYPE #define __isalnum_l(c,l) __isctype_l((c), _ISalnum, (l)) #define __isalpha_l(c,l) __isctype_l((c), _ISalpha, (l)) #define __iscntrl_l(c,l) __isctype_l((c), _IScntrl, (l)) #define __isdigit_l(c,l) __isctype_l((c), _ISdigit, (l)) #define __islower_l(c,l) __isctype_l((c), _ISlower, (l)) #define __isgraph_l(c,l) __isctype_l((c), _ISgraph, (l)) #define __isprint_l(c,l) __isctype_l((c), _ISprint, (l)) #define __ispunct_l(c,l) __isctype_l((c), _ISpunct, (l)) #define __isspace_l(c,l) __isctype_l((c), _ISspace, (l)) #define __isupper_l(c,l) __isctype_l((c), _ISupper, (l)) #define __isxdigit_l(c,l) __isctype_l((c), _ISxdigit, (l)) #define __isblank_l(c,l) __isctype_l((c), _ISblank, (l)) #ifdef __USE_MISC #define __isascii_l(c,l) ((l), __isascii (c)) #define __toascii_l(c,l) ((l), __toascii (c)) #endif #define isalnum_l(c,l) __isalnum_l ((c), (l)) #define isalpha_l(c,l) __isalpha_l ((c), (l)) #define iscntrl_l(c,l) __iscntrl_l ((c), (l)) #define isdigit_l(c,l) __isdigit_l ((c), (l)) #define islower_l(c,l) __islower_l ((c), (l)) #define isgraph_l(c,l) __isgraph_l ((c), (l)) #define isprint_l(c,l) __isprint_l ((c), (l)) #define ispunct_l(c,l) __ispunct_l ((c), (l)) #define isspace_l(c,l) __isspace_l ((c), (l)) #define isupper_l(c,l) __isupper_l ((c), (l)) #define isxdigit_l(c,l) __isxdigit_l ((c), (l)) #define isblank_l(c,l) __isblank_l ((c), (l)) #ifdef __USE_MISC #define isascii_l(c,l) __isascii_l ((c), (l)) #define toascii_l(c,l) __toascii_l ((c), (l)) #endif #endif /* Not __NO_CTYPE. */ #endif /* Use POSIX 2008. */ __END_DECLS #endif /* ctype.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/dirent.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 5.1.2 Directory Operations */ #ifndef _DIRENT_H #define _DIRENT_H 1 #include __BEGIN_DECLS #include #ifdef __USE_XOPEN #ifndef __ino_t_defined #ifndef __USE_FILE_OFFSET64 typedef __ino_t ino_t; #else typedef __ino64_t ino_t; #endif #define __ino_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __ino64_t_defined typedef __ino64_t ino64_t; #define __ino64_t_defined #endif #endif /* This file defines `struct dirent'. It defines the macro `_DIRENT_HAVE_D_NAMLEN' iff there is a `d_namlen' member that gives the length of `d_name'. It defines the macro `_DIRENT_HAVE_D_RECLEN' iff there is a `d_reclen' member that gives the size of the entire directory entry. It defines the macro `_DIRENT_HAVE_D_OFF' iff there is a `d_off' member that gives the file offset of the next directory entry. It defines the macro `_DIRENT_HAVE_D_TYPE' iff there is a `d_type' member that gives the type of the file. */ #include #if defined __USE_MISC && !defined d_fileno #define d_ino d_fileno /* Backward compatibility. */ #endif /* These macros extract size information from a `struct dirent *'. They may evaluate their argument multiple times, so it must not have side effects. Each of these may involve a relatively costly call to `strlen' on some systems, so these values should be cached. _D_EXACT_NAMLEN (DP) returns the length of DP->d_name, not including its terminating null character. _D_ALLOC_NAMLEN (DP) returns a size at least (_D_EXACT_NAMLEN (DP) + 1); that is, the allocation size needed to hold the DP->d_name string. Use this macro when you don't need the exact length, just an upper bound. This macro is less likely to require calling `strlen' than _D_EXACT_NAMLEN. */ #ifdef _DIRENT_HAVE_D_NAMLEN #define _D_EXACT_NAMLEN(d) ((d)->d_namlen) #define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1) #else #define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name)) #ifdef _DIRENT_HAVE_D_RECLEN #define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0]) #else #define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name : \ _D_EXACT_NAMLEN (d) + 1) #endif #endif #ifdef __USE_MISC /* File types for `d_type'. */ enum { DT_UNKNOWN = 0, #define DT_UNKNOWN DT_UNKNOWN DT_FIFO = 1, #define DT_FIFO DT_FIFO DT_CHR = 2, #define DT_CHR DT_CHR DT_DIR = 4, #define DT_DIR DT_DIR DT_BLK = 6, #define DT_BLK DT_BLK DT_REG = 8, #define DT_REG DT_REG DT_LNK = 10, #define DT_LNK DT_LNK DT_SOCK = 12, #define DT_SOCK DT_SOCK DT_WHT = 14 #define DT_WHT DT_WHT }; /* Convert between stat structure types and directory types. */ #define IFTODT(mode) (((mode) & 0170000) >> 12) #define DTTOIF(dirtype) ((dirtype) << 12) #endif /* This is the data type of directory stream objects. The actual structure is opaque to users. */ typedef struct __dirstream DIR; /* Open a directory stream on NAME. Return a DIR stream on the directory, or NULL if it could not be opened. This function is a possible cancellation point and therefore not marked with __THROW. */ extern DIR *opendir(const char *__name) __nonnull((1)); #ifdef __USE_XOPEN2K8 /* Same as opendir, but open the stream on the file descriptor FD. This function is a possible cancellation point and therefore not marked with __THROW. */ extern DIR *fdopendir(int __fd); #endif /* Close the directory stream DIRP. Return 0 if successful, -1 if not. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int closedir(DIR * __dirp) __nonnull((1)); /* Read a directory entry from DIRP. Return a pointer to a `struct dirent' describing the entry, or NULL for EOF or error. The storage returned may be overwritten by a later readdir call on the same DIR stream. If the Large File Support API is selected we have to use the appropriate interface. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern struct dirent *readdir(DIR * __dirp) __nonnull((1)); #else #ifdef __REDIRECT extern struct dirent *__REDIRECT(readdir, (DIR * __dirp), readdir64) __nonnull((1)); #else #define readdir readdir64 #endif #endif #ifdef __USE_LARGEFILE64 extern struct dirent64 *readdir64(DIR * __dirp) __nonnull((1)); #endif #ifdef __USE_POSIX /* Reentrant version of `readdir'. Return in RESULT a pointer to the next entry. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int readdir_r(DIR * __restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __nonnull((1, 2, 3)) __attribute_deprecated__; #else #ifdef __REDIRECT extern int __REDIRECT(readdir_r, (DIR * __restrict __dirp, struct dirent * __restrict __entry, struct dirent ** __restrict __result), readdir64_r) __nonnull((1, 2, 3)) __attribute_deprecated__; #else #define readdir_r readdir64_r #endif #endif #ifdef __USE_LARGEFILE64 extern int readdir64_r(DIR * __restrict __dirp, struct dirent64 *__restrict __entry, struct dirent64 **__restrict __result) __nonnull((1, 2, 3)) __attribute_deprecated__; #endif #endif /* POSIX or misc */ /* Rewind DIRP to the beginning of the directory. */ extern void rewinddir(DIR * __dirp) __THROW __nonnull((1)); #if defined __USE_MISC || defined __USE_XOPEN #include /* Seek to position POS on DIRP. */ extern void seekdir(DIR * __dirp, long int __pos) __THROW __nonnull((1)); /* Return the current position of DIRP. */ extern long int telldir(DIR * __dirp) __THROW __nonnull((1)); #endif #ifdef __USE_XOPEN2K8 /* Return the file descriptor used by DIRP. */ extern int dirfd(DIR * __dirp) __THROW __nonnull((1)); #if defined __OPTIMIZE__ && defined _DIR_dirfd #define dirfd(dirp) _DIR_dirfd (dirp) #endif #ifdef __USE_MISC #ifndef MAXNAMLEN /* Get the definitions of the POSIX.1 limits. */ #include /* `MAXNAMLEN' is the BSD name for what POSIX calls `NAME_MAX'. */ #ifdef NAME_MAX #define MAXNAMLEN NAME_MAX #else #define MAXNAMLEN 255 #endif #endif #endif #define __need_size_t #include /* Scan the directory DIR, calling SELECTOR on each directory entry. Entries for which SELECT returns nonzero are individually malloc'd, sorted using qsort with CMP, and collected in a malloc'd array in *NAMELIST. Returns the number of entries selected, or -1 on error. This function is a cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int scandir(const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __nonnull((1, 2)); #else #ifdef __REDIRECT extern int __REDIRECT(scandir, (const char *__restrict __dir, struct dirent *** __restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)), scandir64) __nonnull((1, 2)); #else #define scandir scandir64 #endif #endif #if defined __USE_GNU && defined __USE_LARGEFILE64 /* This function is like `scandir' but it uses the 64bit dirent structure. Please note that the CMP function must now work with struct dirent64 **. */ extern int scandir64(const char *__restrict __dir, struct dirent64 ***__restrict __namelist, int (*__selector) (const struct dirent64 *), int (*__cmp) (const struct dirent64 **, const struct dirent64 **)) __nonnull((1, 2)); #endif #ifdef __USE_GNU /* Similar to `scandir' but a relative DIR name is interpreted relative to the directory for which DFD is a descriptor. This function is a cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int scandirat(int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __nonnull((2, 3)); #else #ifdef __REDIRECT extern int __REDIRECT(scandirat, (int __dfd, const char *__restrict __dir, struct dirent *** __restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)), scandirat64) __nonnull((2, 3)); #else #define scandirat scandirat64 #endif #endif /* This function is like `scandir' but it uses the 64bit dirent structure. Please note that the CMP function must now work with struct dirent64 **. */ extern int scandirat64(int __dfd, const char *__restrict __dir, struct dirent64 ***__restrict __namelist, int (*__selector) (const struct dirent64 *), int (*__cmp) (const struct dirent64 **, const struct dirent64 **)) __nonnull((2, 3)); #endif /* Function to compare two `struct dirent's alphabetically. */ #ifndef __USE_FILE_OFFSET64 extern int alphasort(const struct dirent **__e1, const struct dirent **__e2) __THROW __attribute_pure__ __nonnull((1, 2)); #else #ifdef __REDIRECT extern int __REDIRECT_NTH(alphasort, (const struct dirent ** __e1, const struct dirent ** __e2), alphasort64) __attribute_pure__ __nonnull((1, 2)); #else #define alphasort alphasort64 #endif #endif #if defined __USE_GNU && defined __USE_LARGEFILE64 extern int alphasort64(const struct dirent64 **__e1, const struct dirent64 **__e2) __THROW __attribute_pure__ __nonnull((1, 2)); #endif #endif /* Use XPG7. */ #ifdef __USE_MISC /* Read directory entries from FD into BUF, reading at most NBYTES. Reading starts at offset *BASEP, and *BASEP is updated with the new position after reading. Returns the number of bytes read; zero when at end of directory; or -1 for errors. */ #ifndef __USE_FILE_OFFSET64 extern __ssize_t getdirentries(int __fd, char *__restrict __buf, size_t __nbytes, __off_t * __restrict __basep) __THROW __nonnull((2, 4)); #else #ifdef __REDIRECT extern __ssize_t __REDIRECT_NTH(getdirentries, (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t * __restrict __basep), getdirentries64) __nonnull((2, 4)); #else #define getdirentries getdirentries64 #endif #endif #ifdef __USE_LARGEFILE64 extern __ssize_t getdirentries64(int __fd, char *__restrict __buf, size_t __nbytes, __off64_t * __restrict __basep) __THROW __nonnull((2, 4)); #endif #endif /* Use misc. */ #ifdef __USE_GNU /* Function to compare two `struct dirent's by name & version. */ #ifndef __USE_FILE_OFFSET64 extern int versionsort(const struct dirent **__e1, const struct dirent **__e2) __THROW __attribute_pure__ __nonnull((1, 2)); #else #ifdef __REDIRECT extern int __REDIRECT_NTH(versionsort, (const struct dirent ** __e1, const struct dirent ** __e2), versionsort64) __attribute_pure__ __nonnull((1, 2)); #else #define versionsort versionsort64 #endif #endif #ifdef __USE_LARGEFILE64 extern int versionsort64(const struct dirent64 **__e1, const struct dirent64 **__e2) __THROW __attribute_pure__ __nonnull((1, 2)); #endif #endif /* Use GNU. */ __END_DECLS #endif /* dirent.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/dlfcn.h ================================================ /* User functions for run-time dynamic loading. Copyright (C) 1995-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _DLFCN_H #define _DLFCN_H 1 #include #define __need_size_t #include /* Collect various system dependent definitions and declarations. */ #include #ifdef __USE_GNU /* If the first argument of `dlsym' or `dlvsym' is set to RTLD_NEXT the run-time address of the symbol called NAME in the next shared object is returned. The "next" relation is defined by the order the shared objects were loaded. */ #define RTLD_NEXT ((void *) -1l) /* If the first argument to `dlsym' or `dlvsym' is set to RTLD_DEFAULT the run-time address of the symbol called NAME in the global scope is returned. */ #define RTLD_DEFAULT ((void *) 0) /* Type for namespace indeces. */ typedef long int Lmid_t; /* Special namespace ID values. */ #define LM_ID_BASE 0 /* Initial namespace. */ #define LM_ID_NEWLM -1 /* For dlmopen: request new namespace. */ #endif __BEGIN_DECLS /* Open the shared object FILE and map it in; return a handle that can be passed to `dlsym' to get symbol values from it. */ extern void *dlopen(const char *__file, int __mode) __THROWNL; /* Unmap and close a shared object opened by `dlopen'. The handle cannot be used again after calling `dlclose'. */ extern int dlclose(void *__handle) __THROWNL __nonnull((1)); /* Find the run-time address in the shared object HANDLE refers to of the symbol called NAME. */ extern void *dlsym(void *__restrict __handle, const char *__restrict __name) __THROW __nonnull((2)); #ifdef __USE_GNU /* Like `dlopen', but request object to be allocated in a new namespace. */ extern void *dlmopen(Lmid_t __nsid, const char *__file, int __mode) __THROWNL; /* Find the run-time address in the shared object HANDLE refers to of the symbol called NAME with VERSION. */ extern void *dlvsym(void *__restrict __handle, const char *__restrict __name, const char *__restrict __version) __THROW __nonnull((2, 3)); #endif /* When any of the above functions fails, call this function to return a string describing the error. Each call resets the error string so that a following call returns null. */ extern char *dlerror(void) __THROW; #ifdef __USE_GNU /* Structure containing information about object searched using `dladdr'. */ typedef struct { const char *dli_fname; /* File name of defining object. */ void *dli_fbase; /* Load address of that object. */ const char *dli_sname; /* Name of nearest symbol. */ void *dli_saddr; /* Exact value of nearest symbol. */ } Dl_info; /* Fill in *INFO with the following information about ADDRESS. Returns 0 iff no shared object's segments contain that address. */ extern int dladdr(const void *__address, Dl_info * __info) __THROW __nonnull((2)); /* Same as `dladdr', but additionally sets *EXTRA_INFO according to FLAGS. */ extern int dladdr1(const void *__address, Dl_info * __info, void **__extra_info, int __flags) __THROW __nonnull((2)); /* These are the possible values for the FLAGS argument to `dladdr1'. This indicates what extra information is stored at *EXTRA_INFO. It may also be zero, in which case the EXTRA_INFO argument is not used. */ enum { /* Matching symbol table entry (const ElfNN_Sym *). */ RTLD_DL_SYMENT = 1, /* The object containing the address (struct link_map *). */ RTLD_DL_LINKMAP = 2 }; /* Get information about the shared object HANDLE refers to. REQUEST is from among the values below, and determines the use of ARG. On success, returns zero. On failure, returns -1 and records an error message to be fetched with `dlerror'. */ extern int dlinfo(void *__restrict __handle, int __request, void *__restrict __arg) __THROW __nonnull((1, 3)); /* These are the possible values for the REQUEST argument to `dlinfo'. */ enum { /* Treat ARG as `lmid_t *'; store namespace ID for HANDLE there. */ RTLD_DI_LMID = 1, /* Treat ARG as `struct link_map **'; store the `struct link_map *' for HANDLE there. */ RTLD_DI_LINKMAP = 2, RTLD_DI_CONFIGADDR = 3, /* Unsupported, defined by Solaris. */ /* Treat ARG as `Dl_serinfo *' (see below), and fill in to describe the directories that will be searched for dependencies of this object. RTLD_DI_SERINFOSIZE fills in just the `dls_cnt' and `dls_size' entries to indicate the size of the buffer that must be passed to RTLD_DI_SERINFO to fill in the full information. */ RTLD_DI_SERINFO = 4, RTLD_DI_SERINFOSIZE = 5, /* Treat ARG as `char *', and store there the directory name used to expand $ORIGIN in this shared object's dependency file names. */ RTLD_DI_ORIGIN = 6, RTLD_DI_PROFILENAME = 7, /* Unsupported, defined by Solaris. */ RTLD_DI_PROFILEOUT = 8, /* Unsupported, defined by Solaris. */ /* Treat ARG as `size_t *', and store there the TLS module ID of this object's PT_TLS segment, as used in TLS relocations; store zero if this object does not define a PT_TLS segment. */ RTLD_DI_TLS_MODID = 9, /* Treat ARG as `void **', and store there a pointer to the calling thread's TLS block corresponding to this object's PT_TLS segment. Store a null pointer if this object does not define a PT_TLS segment, or if the calling thread has not allocated a block for it. */ RTLD_DI_TLS_DATA = 10, RTLD_DI_MAX = 10 }; /* This is the type of elements in `Dl_serinfo', below. The `dls_name' member points to space in the buffer passed to `dlinfo'. */ typedef struct { char *dls_name; /* Name of library search path directory. */ unsigned int dls_flags; /* Indicates where this directory came from. */ } Dl_serpath; /* This is the structure that must be passed (by reference) to `dlinfo' for the RTLD_DI_SERINFO and RTLD_DI_SERINFOSIZE requests. */ typedef struct { size_t dls_size; /* Size in bytes of the whole buffer. */ unsigned int dls_cnt; /* Number of elements in `dls_serpath'. */ Dl_serpath dls_serpath[1]; /* Actually longer, dls_cnt elements. */ } Dl_serinfo; #endif /* __USE_GNU */ __END_DECLS #endif /* dlfcn.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/endian.h ================================================ /* Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _ENDIAN_H #define _ENDIAN_H 1 #include /* Definitions for byte order, according to significance of bytes, from low addresses to high addresses. The value is what you get by putting '4' in the most significant byte, '3' in the second most significant byte, '2' in the second least significant byte, and '1' in the least significant byte, and then writing down one digit for each byte, starting with the byte at the lowest address at the left, and proceeding to the byte with the highest address at the right. */ #define __LITTLE_ENDIAN 1234 #define __BIG_ENDIAN 4321 #define __PDP_ENDIAN 3412 /* This file defines `__BYTE_ORDER' for the particular machine. */ #include /* Some machines may need to use a different endianness for floating point values. */ #ifndef __FLOAT_WORD_ORDER #define __FLOAT_WORD_ORDER __BYTE_ORDER #endif #ifdef __USE_MISC #define LITTLE_ENDIAN __LITTLE_ENDIAN #define BIG_ENDIAN __BIG_ENDIAN #define PDP_ENDIAN __PDP_ENDIAN #define BYTE_ORDER __BYTE_ORDER #endif #if __BYTE_ORDER == __LITTLE_ENDIAN #define __LONG_LONG_PAIR(HI, LO) LO, HI #elif __BYTE_ORDER == __BIG_ENDIAN #define __LONG_LONG_PAIR(HI, LO) HI, LO #endif #if defined __USE_MISC && !defined __ASSEMBLER__ /* Conversion interfaces. */ #include #if __BYTE_ORDER == __LITTLE_ENDIAN #define htobe16(x) __bswap_16 (x) #define htole16(x) (x) #define be16toh(x) __bswap_16 (x) #define le16toh(x) (x) #define htobe32(x) __bswap_32 (x) #define htole32(x) (x) #define be32toh(x) __bswap_32 (x) #define le32toh(x) (x) #define htobe64(x) __bswap_64 (x) #define htole64(x) (x) #define be64toh(x) __bswap_64 (x) #define le64toh(x) (x) #else #define htobe16(x) (x) #define htole16(x) __bswap_16 (x) #define be16toh(x) (x) #define le16toh(x) __bswap_16 (x) #define htobe32(x) (x) #define htole32(x) __bswap_32 (x) #define be32toh(x) (x) #define le32toh(x) __bswap_32 (x) #define htobe64(x) (x) #define htole64(x) __bswap_64 (x) #define be64toh(x) (x) #define le64toh(x) __bswap_64 (x) #endif #endif #endif /* endian.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/errno.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.5 Errors */ #ifndef _ERRNO_H /* The includer defined __need_Emath if he wants only the definitions of EDOM and ERANGE, and not everything else. */ #ifndef __need_Emath #define _ERRNO_H 1 #include #endif __BEGIN_DECLS /* Get the error number constants from the system-specific file. This file will test __need_Emath and _ERRNO_H. */ #include #undef __need_Emath #ifdef _ERRNO_H /* Declare the `errno' variable, unless it's defined as a macro by bits/errno.h. This is the case in GNU, where it is a per-thread variable. This redeclaration using the macro still works, but it will be a function declaration without a prototype and may trigger a -Wstrict-prototypes warning. */ #ifndef errno extern int errno; #endif #ifdef __USE_GNU /* The full and simple forms of the name with which the program was invoked. These variables are set up automatically at startup based on the value of ARGV[0] (this works only if you use GNU ld). */ extern char *program_invocation_name, *program_invocation_short_name; #endif /* __USE_GNU */ #endif /* _ERRNO_H */ __END_DECLS #endif /* _ERRNO_H */ /* The Hurd defines `error_t' as an enumerated type so that printing `error_t' values in the debugger shows the names. We might need this definition sometimes even if this file was included before. */ #if defined __USE_GNU || defined __need_error_t #ifndef __error_t_defined typedef int error_t; #define __error_t_defined 1 #endif #undef __need_error_t #endif ================================================ FILE: v2/headers/linux_arm/usr/include/execinfo.h ================================================ /* Copyright (C) 1998-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _EXECINFO_H #define _EXECINFO_H 1 #include __BEGIN_DECLS /* Store up to SIZE return address of the current program state in ARRAY and return the exact number of values stored. */ extern int backtrace(void **__array, int __size) __nonnull((1)); /* Return names of functions from the backtrace list in ARRAY in a newly malloc()ed memory block. */ extern char **backtrace_symbols(void *const *__array, int __size) __THROW __nonnull((1)); /* This function is similar to backtrace_symbols() but it writes the result immediately to a file. */ extern void backtrace_symbols_fd(void *const *__array, int __size, int __fd) __THROW __nonnull((1)); __END_DECLS #endif /* execinfo.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/fcntl.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 6.5 File Control Operations */ #ifndef _FCNTL_H #define _FCNTL_H 1 #include /* This must be early so can define types winningly. */ __BEGIN_DECLS /* Get __mode_t, __dev_t and __off_t .*/ #include /* Get the definitions of O_*, F_*, FD_*: all the numbers and flag bits for `open', `fcntl', et al. */ #include /* Detect if open needs mode as a third argument (or for openat as a fourth argument). */ #ifdef __O_TMPFILE #define __OPEN_NEEDS_MODE(oflag) \ (((oflag) & O_CREAT) != 0 || ((oflag) & __O_TMPFILE) == __O_TMPFILE) #else #define __OPEN_NEEDS_MODE(oflag) (((oflag) & O_CREAT) != 0) #endif /* POSIX.1-2001 specifies that these types are defined by . Earlier POSIX standards permitted any type ending in `_t' to be defined by any POSIX header, so we don't conditionalize the definitions here. */ #ifndef __mode_t_defined typedef __mode_t mode_t; #define __mode_t_defined #endif #ifndef __off_t_defined #ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; #else typedef __off64_t off_t; #endif #define __off_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; #define __off64_t_defined #endif #ifndef __pid_t_defined typedef __pid_t pid_t; #define __pid_t_defined #endif /* For XPG all symbols from should also be available. */ #ifdef __USE_XOPEN2K8 #define __need_timespec #include #endif #if defined __USE_XOPEN || defined __USE_XOPEN2K8 #include #define S_IFMT __S_IFMT #define S_IFDIR __S_IFDIR #define S_IFCHR __S_IFCHR #define S_IFBLK __S_IFBLK #define S_IFREG __S_IFREG #ifdef __S_IFIFO #define S_IFIFO __S_IFIFO #endif #ifdef __S_IFLNK #define S_IFLNK __S_IFLNK #endif #if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) && defined __S_IFSOCK #define S_IFSOCK __S_IFSOCK #endif /* Protection bits. */ #define S_ISUID __S_ISUID /* Set user ID on execution. */ #define S_ISGID __S_ISGID /* Set group ID on execution. */ #if defined __USE_MISC || defined __USE_XOPEN /* Save swapped text after use (sticky bit). This is pretty well obsolete. */ #define S_ISVTX __S_ISVTX #endif #define S_IRUSR __S_IREAD /* Read by owner. */ #define S_IWUSR __S_IWRITE /* Write by owner. */ #define S_IXUSR __S_IEXEC /* Execute by owner. */ /* Read, write, and execute by owner. */ #define S_IRWXU (__S_IREAD|__S_IWRITE|__S_IEXEC) #define S_IRGRP (S_IRUSR >> 3) /* Read by group. */ #define S_IWGRP (S_IWUSR >> 3) /* Write by group. */ #define S_IXGRP (S_IXUSR >> 3) /* Execute by group. */ /* Read, write, and execute by group. */ #define S_IRWXG (S_IRWXU >> 3) #define S_IROTH (S_IRGRP >> 3) /* Read by others. */ #define S_IWOTH (S_IWGRP >> 3) /* Write by others. */ #define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */ /* Read, write, and execute by others. */ #define S_IRWXO (S_IRWXG >> 3) #endif #ifdef __USE_MISC #ifndef R_OK /* Verbatim from . Ugh. */ /* Values for the second argument to access. These may be OR'd together. */ #define R_OK 4 /* Test for read permission. */ #define W_OK 2 /* Test for write permission. */ #define X_OK 1 /* Test for execute permission. */ #define F_OK 0 /* Test for existence. */ #endif #endif /* Use misc. */ /* XPG wants the following symbols. has the same definitions. */ #if defined __USE_XOPEN || defined __USE_XOPEN2K8 #define SEEK_SET 0 /* Seek from beginning of file. */ #define SEEK_CUR 1 /* Seek from current position. */ #define SEEK_END 2 /* Seek from end of file. */ #endif /* XPG */ /* Do the file control operation described by CMD on FD. The remaining arguments are interpreted depending on CMD. This function is a cancellation point and therefore not marked with __THROW. */ extern int fcntl(int __fd, int __cmd, ...); /* Open FILE and return a new file descriptor for it, or -1 on error. OFLAG determines the type of access used. If O_CREAT or O_TMPFILE is set in OFLAG, the third argument is taken as a `mode_t', the mode of the created file. This function is a cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int open(const char *__file, int __oflag, ...) __nonnull((1)); #else #ifdef __REDIRECT extern int __REDIRECT(open, (const char *__file, int __oflag, ...), open64) __nonnull((1)); #else #define open open64 #endif #endif #ifdef __USE_LARGEFILE64 extern int open64(const char *__file, int __oflag, ...) __nonnull((1)); #endif #ifdef __USE_ATFILE /* Similar to `open' but a relative path name is interpreted relative to the directory for which FD is a descriptor. NOTE: some other `openat' implementation support additional functionality through this interface, especially using the O_XATTR flag. This is not yet supported here. This function is a cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int openat(int __fd, const char *__file, int __oflag, ...) __nonnull((2)); #else #ifdef __REDIRECT extern int __REDIRECT(openat, (int __fd, const char *__file, int __oflag, ...), openat64) __nonnull((2)); #else #define openat openat64 #endif #endif #ifdef __USE_LARGEFILE64 extern int openat64(int __fd, const char *__file, int __oflag, ...) __nonnull((2)); #endif #endif /* Create and open FILE, with mode MODE. This takes an `int' MODE argument because that is what `mode_t' will be widened to. This function is a cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int creat(const char *__file, mode_t __mode) __nonnull((1)); #else #ifdef __REDIRECT extern int __REDIRECT(creat, (const char *__file, mode_t __mode), creat64) __nonnull((1)); #else #define creat creat64 #endif #endif #ifdef __USE_LARGEFILE64 extern int creat64(const char *__file, mode_t __mode) __nonnull((1)); #endif #if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \ && !defined __USE_POSIX)) /* NOTE: These declarations also appear in ; be sure to keep both files consistent. Some systems have them there and some here, and some software depends on the macros being defined without including both. */ /* `lockf' is a simpler interface to the locking facilities of `fcntl'. LEN is always relative to the current file position. The CMD argument is one of the following. */ #define F_ULOCK 0 /* Unlock a previously locked region. */ #define F_LOCK 1 /* Lock a region for exclusive use. */ #define F_TLOCK 2 /* Test and lock a region for exclusive use. */ #define F_TEST 3 /* Test a region for other processes locks. */ #ifndef __USE_FILE_OFFSET64 extern int lockf(int __fd, int __cmd, off_t __len); #else #ifdef __REDIRECT extern int __REDIRECT(lockf, (int __fd, int __cmd, __off64_t __len), lockf64); #else #define lockf lockf64 #endif #endif #ifdef __USE_LARGEFILE64 extern int lockf64(int __fd, int __cmd, off64_t __len); #endif #endif #ifdef __USE_XOPEN2K /* Advice the system about the expected behaviour of the application with respect to the file associated with FD. */ #ifndef __USE_FILE_OFFSET64 extern int posix_fadvise(int __fd, off_t __offset, off_t __len, int __advise) __THROW; #else #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(posix_fadvise, (int __fd, __off64_t __offset, __off64_t __len, int __advise), posix_fadvise64); #else #define posix_fadvise posix_fadvise64 #endif #endif #ifdef __USE_LARGEFILE64 extern int posix_fadvise64(int __fd, off64_t __offset, off64_t __len, int __advise) __THROW; #endif /* Reserve storage for the data of the file associated with FD. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int posix_fallocate(int __fd, off_t __offset, off_t __len); #else #ifdef __REDIRECT extern int __REDIRECT(posix_fallocate, (int __fd, __off64_t __offset, __off64_t __len), posix_fallocate64); #else #define posix_fallocate posix_fallocate64 #endif #endif #ifdef __USE_LARGEFILE64 extern int posix_fallocate64(int __fd, off64_t __offset, off64_t __len); #endif #endif /* Define some inlines helping to catch common problems. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function \ && defined __va_arg_pack_len #include #endif __END_DECLS #endif /* fcntl.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/features.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _FEATURES_H #define _FEATURES_H 1 /* These are defined by the user (or the compiler) to specify the desired environment: __STRICT_ANSI__ ISO Standard C. _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. _ISOC11_SOURCE Extensions to ISO C99 from ISO C11. _POSIX_SOURCE IEEE Std 1003.1. _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; if >=199309L, add IEEE Std 1003.1b-1993; if >=199506L, add IEEE Std 1003.1c-1995; if >=200112L, all of IEEE 1003.1-2004 if >=200809L, all of IEEE 1003.1-2008 _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if Single Unix conformance is wanted, to 600 for the sixth revision, to 700 for the seventh revision. _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. _LARGEFILE_SOURCE Some more functions for correct standard I/O. _LARGEFILE64_SOURCE Additional functionality from LFS for large files. _FILE_OFFSET_BITS=N Select default filesystem interface. _ATFILE_SOURCE Additional *at interfaces. _GNU_SOURCE All of the above, plus GNU extensions. _DEFAULT_SOURCE The default set of features (taking precedence over __STRICT_ANSI__). _REENTRANT Select additionally reentrant object. _THREAD_SAFE Same as _REENTRANT, often used by other systems. _FORTIFY_SOURCE If set to numeric value > 0 additional security measures are defined, according to level. The `-ansi' switch to the GNU C compiler, and standards conformance options such as `-std=c99', define __STRICT_ANSI__. If none of these are defined, or if _DEFAULT_SOURCE is defined, the default is to have _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to 200809L, as well as enabling miscellaneous functions from BSD and SVID. If more than one of these are defined, they accumulate. For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE together give you ISO C, 1003.1, and 1003.2, but nothing else. These are defined by this file and are used by the header files to decide what to declare or define: __USE_ISOC11 Define ISO C11 things. __USE_ISOC99 Define ISO C99 things. __USE_ISOC95 Define ISO C90 AMD1 (C95) things. __USE_POSIX Define IEEE Std 1003.1 things. __USE_POSIX2 Define IEEE Std 1003.2 things. __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things. __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things. __USE_XOPEN Define XPG things. __USE_XOPEN_EXTENDED Define X/Open Unix things. __USE_UNIX98 Define Single Unix V2 things. __USE_XOPEN2K Define XPG6 things. __USE_XOPEN2KXSI Define XPG6 XSI things. __USE_XOPEN2K8 Define XPG7 things. __USE_XOPEN2K8XSI Define XPG7 XSI things. __USE_LARGEFILE Define correct standard I/O things. __USE_LARGEFILE64 Define LFS things with separate names. __USE_FILE_OFFSET64 Define 64bit interface as default. __USE_MISC Define things from 4.3BSD or System V Unix. __USE_ATFILE Define *at interfaces and AT_* constants for them. __USE_GNU Define GNU extensions. __USE_REENTRANT Define reentrant/thread-safe *_r functions. __USE_FORTIFY_LEVEL Additional security measures used, according to level. The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are defined by this file unconditionally. `__GNU_LIBRARY__' is provided only for compatibility. All new code should use the other symbols to test for features. All macros listed above as possibly being defined by this file are explicitly undefined if they are not explicitly defined. Feature-test macros that are not defined by the user or compiler but are implied by the other feature-test macros defined (or by the lack of any definitions) are defined by the file. */ /* Undefine everything, so we get a clean slate. */ #undef __USE_ISOC11 #undef __USE_ISOC99 #undef __USE_ISOC95 #undef __USE_ISOCXX11 #undef __USE_POSIX #undef __USE_POSIX2 #undef __USE_POSIX199309 #undef __USE_POSIX199506 #undef __USE_XOPEN #undef __USE_XOPEN_EXTENDED #undef __USE_UNIX98 #undef __USE_XOPEN2K #undef __USE_XOPEN2KXSI #undef __USE_XOPEN2K8 #undef __USE_XOPEN2K8XSI #undef __USE_LARGEFILE #undef __USE_LARGEFILE64 #undef __USE_FILE_OFFSET64 #undef __USE_MISC #undef __USE_ATFILE #undef __USE_GNU #undef __USE_REENTRANT #undef __USE_FORTIFY_LEVEL #undef __KERNEL_STRICT_NAMES /* Suppress kernel-name space pollution unless user expressedly asks for it. */ #ifndef _LOOSE_KERNEL_NAMES #define __KERNEL_STRICT_NAMES #endif /* Convenience macros to test the versions of glibc and gcc. Use them like this: #if __GNUC_PREREQ (2,8) ... code requiring gcc 2.8 or later ... #endif Note - they won't work for gcc1 or glibc1, since the _MINOR macros were not defined then. */ #if defined __GNUC__ && defined __GNUC_MINOR__ #define __GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #else #define __GNUC_PREREQ(maj, min) 0 #endif /* _BSD_SOURCE and _SVID_SOURCE are deprecated aliases for _DEFAULT_SOURCE. If _DEFAULT_SOURCE is present we do not issue a warning; the expectation is that the source is being transitioned to use the new macro. */ #if (defined _BSD_SOURCE || defined _SVID_SOURCE) \ && !defined _DEFAULT_SOURCE #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" #undef _DEFAULT_SOURCE #define _DEFAULT_SOURCE 1 #endif /* If _GNU_SOURCE was defined by the user, turn on all the other features. */ #ifdef _GNU_SOURCE #undef _ISOC95_SOURCE #define _ISOC95_SOURCE 1 #undef _ISOC99_SOURCE #define _ISOC99_SOURCE 1 #undef _ISOC11_SOURCE #define _ISOC11_SOURCE 1 #undef _POSIX_SOURCE #define _POSIX_SOURCE 1 #undef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200809L #undef _XOPEN_SOURCE #define _XOPEN_SOURCE 700 #undef _XOPEN_SOURCE_EXTENDED #define _XOPEN_SOURCE_EXTENDED 1 #undef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE 1 #undef _DEFAULT_SOURCE #define _DEFAULT_SOURCE 1 #undef _ATFILE_SOURCE #define _ATFILE_SOURCE 1 #endif /* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined, define _DEFAULT_SOURCE. */ #if (defined _DEFAULT_SOURCE \ || (!defined __STRICT_ANSI__ \ && !defined _ISOC99_SOURCE \ && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE \ && !defined _XOPEN_SOURCE)) #undef _DEFAULT_SOURCE #define _DEFAULT_SOURCE 1 #endif /* This is to enable the ISO C11 extension. */ #if (defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) #define __USE_ISOC11 1 #endif /* This is to enable the ISO C99 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) #define __USE_ISOC99 1 #endif /* This is to enable the ISO C90 Amendment 1:1995 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L)) #define __USE_ISOC95 1 #endif /* This is to enable compatibility for ISO C++11. So far g++ does not provide a macro. Check the temporary macro for now, too. */ #if ((defined __cplusplus && __cplusplus >= 201103L) \ || defined __GXX_EXPERIMENTAL_CXX0X__) #define __USE_ISOCXX11 1 #endif /* If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE is defined, use POSIX.1-2008 (or another version depending on _XOPEN_SOURCE). */ #ifdef _DEFAULT_SOURCE #if !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE #define __USE_POSIX_IMPLICITLY 1 #endif #undef _POSIX_SOURCE #define _POSIX_SOURCE 1 #undef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200809L #endif #if ((!defined __STRICT_ANSI__ \ || (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500)) \ && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE) #define _POSIX_SOURCE 1 #if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500 #define _POSIX_C_SOURCE 2 #elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 600 #define _POSIX_C_SOURCE 199506L #elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 700 #define _POSIX_C_SOURCE 200112L #else #define _POSIX_C_SOURCE 200809L #endif #define __USE_POSIX_IMPLICITLY 1 #endif #if (defined _POSIX_SOURCE \ || (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 1) \ || defined _XOPEN_SOURCE) #define __USE_POSIX 1 #endif #if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE #define __USE_POSIX2 1 #endif #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199309L #define __USE_POSIX199309 1 #endif #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199506L #define __USE_POSIX199506 1 #endif #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200112L #define __USE_XOPEN2K 1 #undef __USE_ISOC95 #define __USE_ISOC95 1 #undef __USE_ISOC99 #define __USE_ISOC99 1 #endif #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200809L #define __USE_XOPEN2K8 1 #undef _ATFILE_SOURCE #define _ATFILE_SOURCE 1 #endif #ifdef _XOPEN_SOURCE #define __USE_XOPEN 1 #if (_XOPEN_SOURCE - 0) >= 500 #define __USE_XOPEN_EXTENDED 1 #define __USE_UNIX98 1 #undef _LARGEFILE_SOURCE #define _LARGEFILE_SOURCE 1 #if (_XOPEN_SOURCE - 0) >= 600 #if (_XOPEN_SOURCE - 0) >= 700 #define __USE_XOPEN2K8 1 #define __USE_XOPEN2K8XSI 1 #endif #define __USE_XOPEN2K 1 #define __USE_XOPEN2KXSI 1 #undef __USE_ISOC95 #define __USE_ISOC95 1 #undef __USE_ISOC99 #define __USE_ISOC99 1 #endif #else #ifdef _XOPEN_SOURCE_EXTENDED #define __USE_XOPEN_EXTENDED 1 #endif #endif #endif #ifdef _LARGEFILE_SOURCE #define __USE_LARGEFILE 1 #endif #ifdef _LARGEFILE64_SOURCE #define __USE_LARGEFILE64 1 #endif #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 #define __USE_FILE_OFFSET64 1 #endif #if defined _DEFAULT_SOURCE #define __USE_MISC 1 #endif #ifdef _ATFILE_SOURCE #define __USE_ATFILE 1 #endif #ifdef _GNU_SOURCE #define __USE_GNU 1 #endif #if defined _REENTRANT || defined _THREAD_SAFE #define __USE_REENTRANT 1 #endif #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \ && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0 #if _FORTIFY_SOURCE > 1 #define __USE_FORTIFY_LEVEL 2 #else #define __USE_FORTIFY_LEVEL 1 #endif #else #define __USE_FORTIFY_LEVEL 0 #endif /* Get definitions of __STDC_* predefined macros, if the compiler has not preincluded this header automatically. */ #include /* This macro indicates that the installed library is the GNU C Library. For historic reasons the value now is 6 and this will stay from now on. The use of this variable is deprecated. Use __GLIBC__ and __GLIBC_MINOR__ now (see below) when you want to test for a specific GNU C library version and use the values in to get the sonames of the shared libraries. */ #undef __GNU_LIBRARY__ #define __GNU_LIBRARY__ 6 /* Major and minor version number of the GNU C library package. Use these macros to test for features in specific releases. */ #define __GLIBC__ 2 #define __GLIBC_MINOR__ 24 #define __GLIBC_PREREQ(maj, min) \ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) /* This is here only because every header file already includes this one. */ #ifndef __ASSEMBLER__ #ifndef _SYS_CDEFS_H #include #endif /* If we don't have __REDIRECT, prototypes will be missing if __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */ #if defined __USE_FILE_OFFSET64 && !defined __REDIRECT #define __USE_LARGEFILE 1 #define __USE_LARGEFILE64 1 #endif #endif /* !ASSEMBLER */ /* Decide whether we can define 'extern inline' functions in headers. */ #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \ && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \ && defined __extern_inline #define __USE_EXTERN_INLINES 1 #endif /* This is here only because every header file already includes this one. Get the definitions of all the appropriate `__stub_FUNCTION' symbols. contains `#define __stub_FUNCTION' when FUNCTION is a stub that will always return failure (and set errno to ENOSYS). */ #include #endif /* features.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/fts.h ================================================ /* File tree traversal functions declarations. Copyright (C) 1994-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)fts.h 8.3 (Berkeley) 8/14/94 */ #ifndef _FTS_H #define _FTS_H 1 #include #include typedef struct { struct _ftsent *fts_cur; /* current node */ struct _ftsent *fts_child; /* linked list of children */ struct _ftsent **fts_array; /* sort array */ dev_t fts_dev; /* starting device # */ char *fts_path; /* path for this descent */ int fts_rfd; /* fd for root */ int fts_pathlen; /* sizeof(path) */ int fts_nitems; /* elements in the sort array */ int (*fts_compar) (const void *, const void *); /* compare fn */ #define FTS_COMFOLLOW 0x0001 /* follow command line symlinks */ #define FTS_LOGICAL 0x0002 /* logical walk */ #define FTS_NOCHDIR 0x0004 /* don't change directories */ #define FTS_NOSTAT 0x0008 /* don't get stat info */ #define FTS_PHYSICAL 0x0010 /* physical walk */ #define FTS_SEEDOT 0x0020 /* return dot and dot-dot */ #define FTS_XDEV 0x0040 /* don't cross devices */ #define FTS_WHITEOUT 0x0080 /* return whiteout information */ #define FTS_OPTIONMASK 0x00ff /* valid user option mask */ #define FTS_NAMEONLY 0x0100 /* (private) child names only */ #define FTS_STOP 0x0200 /* (private) unrecoverable error */ int fts_options; /* fts_open options, global flags */ } FTS; #ifdef __USE_LARGEFILE64 typedef struct { struct _ftsent64 *fts_cur; /* current node */ struct _ftsent64 *fts_child; /* linked list of children */ struct _ftsent64 **fts_array; /* sort array */ dev_t fts_dev; /* starting device # */ char *fts_path; /* path for this descent */ int fts_rfd; /* fd for root */ int fts_pathlen; /* sizeof(path) */ int fts_nitems; /* elements in the sort array */ int (*fts_compar) (const void *, const void *); /* compare fn */ int fts_options; /* fts_open options, global flags */ } FTS64; #endif typedef struct _ftsent { struct _ftsent *fts_cycle; /* cycle node */ struct _ftsent *fts_parent; /* parent directory */ struct _ftsent *fts_link; /* next file in directory */ long fts_number; /* local numeric value */ void *fts_pointer; /* local address value */ char *fts_accpath; /* access path */ char *fts_path; /* root path */ int fts_errno; /* errno for this node */ int fts_symfd; /* fd for symlink */ u_short fts_pathlen; /* strlen(fts_path) */ u_short fts_namelen; /* strlen(fts_name) */ ino_t fts_ino; /* inode */ dev_t fts_dev; /* device */ nlink_t fts_nlink; /* link count */ #define FTS_ROOTPARENTLEVEL -1 #define FTS_ROOTLEVEL 0 short fts_level; /* depth (-1 to N) */ #define FTS_D 1 /* preorder directory */ #define FTS_DC 2 /* directory that causes cycles */ #define FTS_DEFAULT 3 /* none of the above */ #define FTS_DNR 4 /* unreadable directory */ #define FTS_DOT 5 /* dot or dot-dot */ #define FTS_DP 6 /* postorder directory */ #define FTS_ERR 7 /* error; errno is set */ #define FTS_F 8 /* regular file */ #define FTS_INIT 9 /* initialized only */ #define FTS_NS 10 /* stat(2) failed */ #define FTS_NSOK 11 /* no stat(2) requested */ #define FTS_SL 12 /* symbolic link */ #define FTS_SLNONE 13 /* symbolic link without target */ #define FTS_W 14 /* whiteout object */ u_short fts_info; /* user flags for FTSENT structure */ #define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */ #define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */ u_short fts_flags; /* private flags for FTSENT structure */ #define FTS_AGAIN 1 /* read node again */ #define FTS_FOLLOW 2 /* follow symbolic link */ #define FTS_NOINSTR 3 /* no instructions */ #define FTS_SKIP 4 /* discard node */ u_short fts_instr; /* fts_set() instructions */ struct stat *fts_statp; /* stat(2) information */ char fts_name[1]; /* file name */ } FTSENT; #ifdef __USE_LARGEFILE64 typedef struct _ftsent64 { struct _ftsent64 *fts_cycle; /* cycle node */ struct _ftsent64 *fts_parent; /* parent directory */ struct _ftsent64 *fts_link; /* next file in directory */ long fts_number; /* local numeric value */ void *fts_pointer; /* local address value */ char *fts_accpath; /* access path */ char *fts_path; /* root path */ int fts_errno; /* errno for this node */ int fts_symfd; /* fd for symlink */ u_short fts_pathlen; /* strlen(fts_path) */ u_short fts_namelen; /* strlen(fts_name) */ ino64_t fts_ino; /* inode */ dev_t fts_dev; /* device */ nlink_t fts_nlink; /* link count */ short fts_level; /* depth (-1 to N) */ u_short fts_info; /* user flags for FTSENT structure */ u_short fts_flags; /* private flags for FTSENT structure */ u_short fts_instr; /* fts_set() instructions */ struct stat64 *fts_statp; /* stat(2) information */ char fts_name[1]; /* file name */ } FTSENT64; #endif __BEGIN_DECLS #ifndef __USE_FILE_OFFSET64 FTSENT * fts_children(FTS *, int); int fts_close(FTS *); FTS *fts_open(char *const *, int, int (*)(const FTSENT **, const FTSENT **)); FTSENT *fts_read(FTS *); int fts_set(FTS *, FTSENT *, int) __THROW; #else #ifdef __REDIRECT FTSENT * __REDIRECT(fts_children, (FTS *, int), fts64_children); int __REDIRECT(fts_close, (FTS *), fts64_close); FTS *__REDIRECT(fts_open, (char *const *, int, int (*)(const FTSENT **, const FTSENT **)), fts64_open); FTSENT *__REDIRECT(fts_read, (FTS *), fts64_read); int __REDIRECT_NTH(fts_set, (FTS *, FTSENT *, int), fts64_set); #else #define fts_children fts64_children #define fts_close fts64_close #define fts_open fts64_open #define fts_read fts64_read #define fts_set fts64_set #endif #endif #ifdef __USE_LARGEFILE64 FTSENT64 * fts64_children(FTS64 *, int); int fts64_close(FTS64 *); FTS64 *fts64_open(char *const *, int, int (*)(const FTSENT64 **, const FTSENT64 **)); FTSENT64 *fts64_read(FTS64 *); int fts64_set(FTS64 *, FTSENT64 *, int) __THROW; #endif __END_DECLS #endif /* fts.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/getopt.h ================================================ /* Declarations for getopt. Copyright (C) 1989-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _GETOPT_H #ifndef __need_getopt #define _GETOPT_H 1 #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ #include #endif #ifndef __THROW #ifndef __GNUC_PREREQ #define __GNUC_PREREQ(maj, min) (0) #endif #if defined __cplusplus && __GNUC_PREREQ (2,8) #define __THROW throw () #else #define __THROW #endif #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt(int ___argc, char *const *___argv, const char *__shortopts) __THROW; #if defined __need_getopt && defined __USE_POSIX2 \ && !defined __USE_POSIX_IMPLICITLY && !defined __USE_GNU /* The GNU getopt has more functionality than the standard version. The additional functionality can be disable at runtime. This redirection helps to also do this at runtime. */ #ifdef __REDIRECT extern int __REDIRECT_NTH(getopt, (int ___argc, char *const *___argv, const char *__shortopts), __posix_getopt); #else extern int __posix_getopt(int ___argc, char *const *___argv, const char *__shortopts) __THROW; #define getopt __posix_getopt #endif #endif #else /* not __GNU_LIBRARY__ */ extern int getopt(); #endif /* __GNU_LIBRARY__ */ #ifndef __need_getopt extern int getopt_long(int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; extern int getopt_long_only(int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; #endif #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/grp.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 9.2.1 Group Database Access */ #ifndef _GRP_H #define _GRP_H 1 #include __BEGIN_DECLS #include #define __need_size_t #include /* For the Single Unix specification we must define this type here. */ #if (defined __USE_XOPEN || defined __USE_XOPEN2K) && !defined __gid_t_defined typedef __gid_t gid_t; #define __gid_t_defined #endif /* The group structure. */ struct group { char *gr_name; /* Group name. */ char *gr_passwd; /* Password. */ __gid_t gr_gid; /* Group ID. */ char **gr_mem; /* Member list. */ }; #ifdef __USE_MISC #define __need_FILE #include #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Rewind the group-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setgrent(void); /* Close the group-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endgrent(void); /* Read an entry from the group-file stream, opening it if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct group *getgrent(void); #endif #ifdef __USE_MISC /* Read a group entry from STREAM. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct group *fgetgrent(FILE * __stream); #endif #ifdef __USE_GNU /* Write the given entry onto the given stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int putgrent(const struct group *__restrict __p, FILE * __restrict __f); #endif /* Search for an entry with a matching group ID. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct group *getgrgid(__gid_t __gid); /* Search for an entry with a matching group name. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct group *getgrnam(const char *__name); #ifdef __USE_POSIX #ifdef __USE_MISC /* Reasonable value for the buffer sized used in the reentrant functions below. But better use `sysconf'. */ #define NSS_BUFLEN_GROUP 1024 #endif /* Reentrant versions of some of the functions above. PLEASE NOTE: the `getgrent_r' function is not (yet) standardized. The interface may change in later versions of this library. But the interface is designed following the principals used for the other reentrant functions so the chances are good this is what the POSIX people would choose. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ #ifdef __USE_GNU extern int getgrent_r(struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); #endif /* Search for an entry with a matching group ID. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getgrgid_r(__gid_t __gid, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); /* Search for an entry with a matching group name. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getgrnam_r(const char *__restrict __name, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); #ifdef __USE_MISC /* Read a group entry from STREAM. This function is not standardized an probably never will. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fgetgrent_r(FILE * __restrict __stream, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); #endif #endif /* POSIX or reentrant */ #ifdef __USE_MISC #define __need_size_t #include /* Set the group set for the current user to GROUPS (N of them). */ extern int setgroups(size_t __n, const __gid_t * __groups) __THROW; /* Store at most *NGROUPS members of the group set for USER into *GROUPS. Also include GROUP. The actual number of groups found is returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getgrouplist(const char *__user, __gid_t __group, __gid_t * __groups, int *__ngroups); /* Initialize the group set for the current user by reading the group database and using all groups of which USER is a member. Also include GROUP. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int initgroups(const char *__user, __gid_t __group); #endif /* Use misc. */ __END_DECLS #endif /* grp.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/inttypes.h ================================================ /* Copyright (C) 1997-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99: 7.8 Format conversion of integer types */ #ifndef _INTTYPES_H #define _INTTYPES_H 1 #include /* Get the type definitions. */ #include /* Get a definition for wchar_t. But we must not define wchar_t itself. */ #ifndef ____gwchar_t_defined #ifdef __cplusplus #define __gwchar_t wchar_t #elif defined __WCHAR_TYPE__ typedef __WCHAR_TYPE__ __gwchar_t; #else #define __need_wchar_t #include typedef wchar_t __gwchar_t; #endif #define ____gwchar_t_defined 1 #endif #if __WORDSIZE == 64 #define __PRI64_PREFIX "l" #define __PRIPTR_PREFIX "l" #else #define __PRI64_PREFIX "ll" #define __PRIPTR_PREFIX #endif /* Macros for printing format specifiers. */ /* Decimal notation. */ #define PRId8 "d" #define PRId16 "d" #define PRId32 "d" #define PRId64 __PRI64_PREFIX "d" #define PRIdLEAST8 "d" #define PRIdLEAST16 "d" #define PRIdLEAST32 "d" #define PRIdLEAST64 __PRI64_PREFIX "d" #define PRIdFAST8 "d" #define PRIdFAST16 __PRIPTR_PREFIX "d" #define PRIdFAST32 __PRIPTR_PREFIX "d" #define PRIdFAST64 __PRI64_PREFIX "d" #define PRIi8 "i" #define PRIi16 "i" #define PRIi32 "i" #define PRIi64 __PRI64_PREFIX "i" #define PRIiLEAST8 "i" #define PRIiLEAST16 "i" #define PRIiLEAST32 "i" #define PRIiLEAST64 __PRI64_PREFIX "i" #define PRIiFAST8 "i" #define PRIiFAST16 __PRIPTR_PREFIX "i" #define PRIiFAST32 __PRIPTR_PREFIX "i" #define PRIiFAST64 __PRI64_PREFIX "i" /* Octal notation. */ #define PRIo8 "o" #define PRIo16 "o" #define PRIo32 "o" #define PRIo64 __PRI64_PREFIX "o" #define PRIoLEAST8 "o" #define PRIoLEAST16 "o" #define PRIoLEAST32 "o" #define PRIoLEAST64 __PRI64_PREFIX "o" #define PRIoFAST8 "o" #define PRIoFAST16 __PRIPTR_PREFIX "o" #define PRIoFAST32 __PRIPTR_PREFIX "o" #define PRIoFAST64 __PRI64_PREFIX "o" /* Unsigned integers. */ #define PRIu8 "u" #define PRIu16 "u" #define PRIu32 "u" #define PRIu64 __PRI64_PREFIX "u" #define PRIuLEAST8 "u" #define PRIuLEAST16 "u" #define PRIuLEAST32 "u" #define PRIuLEAST64 __PRI64_PREFIX "u" #define PRIuFAST8 "u" #define PRIuFAST16 __PRIPTR_PREFIX "u" #define PRIuFAST32 __PRIPTR_PREFIX "u" #define PRIuFAST64 __PRI64_PREFIX "u" /* lowercase hexadecimal notation. */ #define PRIx8 "x" #define PRIx16 "x" #define PRIx32 "x" #define PRIx64 __PRI64_PREFIX "x" #define PRIxLEAST8 "x" #define PRIxLEAST16 "x" #define PRIxLEAST32 "x" #define PRIxLEAST64 __PRI64_PREFIX "x" #define PRIxFAST8 "x" #define PRIxFAST16 __PRIPTR_PREFIX "x" #define PRIxFAST32 __PRIPTR_PREFIX "x" #define PRIxFAST64 __PRI64_PREFIX "x" /* UPPERCASE hexadecimal notation. */ #define PRIX8 "X" #define PRIX16 "X" #define PRIX32 "X" #define PRIX64 __PRI64_PREFIX "X" #define PRIXLEAST8 "X" #define PRIXLEAST16 "X" #define PRIXLEAST32 "X" #define PRIXLEAST64 __PRI64_PREFIX "X" #define PRIXFAST8 "X" #define PRIXFAST16 __PRIPTR_PREFIX "X" #define PRIXFAST32 __PRIPTR_PREFIX "X" #define PRIXFAST64 __PRI64_PREFIX "X" /* Macros for printing `intmax_t' and `uintmax_t'. */ #define PRIdMAX __PRI64_PREFIX "d" #define PRIiMAX __PRI64_PREFIX "i" #define PRIoMAX __PRI64_PREFIX "o" #define PRIuMAX __PRI64_PREFIX "u" #define PRIxMAX __PRI64_PREFIX "x" #define PRIXMAX __PRI64_PREFIX "X" /* Macros for printing `intptr_t' and `uintptr_t'. */ #define PRIdPTR __PRIPTR_PREFIX "d" #define PRIiPTR __PRIPTR_PREFIX "i" #define PRIoPTR __PRIPTR_PREFIX "o" #define PRIuPTR __PRIPTR_PREFIX "u" #define PRIxPTR __PRIPTR_PREFIX "x" #define PRIXPTR __PRIPTR_PREFIX "X" /* Macros for scanning format specifiers. */ /* Signed decimal notation. */ #define SCNd8 "hhd" #define SCNd16 "hd" #define SCNd32 "d" #define SCNd64 __PRI64_PREFIX "d" #define SCNdLEAST8 "hhd" #define SCNdLEAST16 "hd" #define SCNdLEAST32 "d" #define SCNdLEAST64 __PRI64_PREFIX "d" #define SCNdFAST8 "hhd" #define SCNdFAST16 __PRIPTR_PREFIX "d" #define SCNdFAST32 __PRIPTR_PREFIX "d" #define SCNdFAST64 __PRI64_PREFIX "d" /* Signed decimal notation. */ #define SCNi8 "hhi" #define SCNi16 "hi" #define SCNi32 "i" #define SCNi64 __PRI64_PREFIX "i" #define SCNiLEAST8 "hhi" #define SCNiLEAST16 "hi" #define SCNiLEAST32 "i" #define SCNiLEAST64 __PRI64_PREFIX "i" #define SCNiFAST8 "hhi" #define SCNiFAST16 __PRIPTR_PREFIX "i" #define SCNiFAST32 __PRIPTR_PREFIX "i" #define SCNiFAST64 __PRI64_PREFIX "i" /* Unsigned decimal notation. */ #define SCNu8 "hhu" #define SCNu16 "hu" #define SCNu32 "u" #define SCNu64 __PRI64_PREFIX "u" #define SCNuLEAST8 "hhu" #define SCNuLEAST16 "hu" #define SCNuLEAST32 "u" #define SCNuLEAST64 __PRI64_PREFIX "u" #define SCNuFAST8 "hhu" #define SCNuFAST16 __PRIPTR_PREFIX "u" #define SCNuFAST32 __PRIPTR_PREFIX "u" #define SCNuFAST64 __PRI64_PREFIX "u" /* Octal notation. */ #define SCNo8 "hho" #define SCNo16 "ho" #define SCNo32 "o" #define SCNo64 __PRI64_PREFIX "o" #define SCNoLEAST8 "hho" #define SCNoLEAST16 "ho" #define SCNoLEAST32 "o" #define SCNoLEAST64 __PRI64_PREFIX "o" #define SCNoFAST8 "hho" #define SCNoFAST16 __PRIPTR_PREFIX "o" #define SCNoFAST32 __PRIPTR_PREFIX "o" #define SCNoFAST64 __PRI64_PREFIX "o" /* Hexadecimal notation. */ #define SCNx8 "hhx" #define SCNx16 "hx" #define SCNx32 "x" #define SCNx64 __PRI64_PREFIX "x" #define SCNxLEAST8 "hhx" #define SCNxLEAST16 "hx" #define SCNxLEAST32 "x" #define SCNxLEAST64 __PRI64_PREFIX "x" #define SCNxFAST8 "hhx" #define SCNxFAST16 __PRIPTR_PREFIX "x" #define SCNxFAST32 __PRIPTR_PREFIX "x" #define SCNxFAST64 __PRI64_PREFIX "x" /* Macros for scanning `intmax_t' and `uintmax_t'. */ #define SCNdMAX __PRI64_PREFIX "d" #define SCNiMAX __PRI64_PREFIX "i" #define SCNoMAX __PRI64_PREFIX "o" #define SCNuMAX __PRI64_PREFIX "u" #define SCNxMAX __PRI64_PREFIX "x" /* Macros for scaning `intptr_t' and `uintptr_t'. */ #define SCNdPTR __PRIPTR_PREFIX "d" #define SCNiPTR __PRIPTR_PREFIX "i" #define SCNoPTR __PRIPTR_PREFIX "o" #define SCNuPTR __PRIPTR_PREFIX "u" #define SCNxPTR __PRIPTR_PREFIX "x" __BEGIN_DECLS #if __WORDSIZE == 64 /* We have to define the `uintmax_t' type using `ldiv_t'. */ typedef struct { long int quot; /* Quotient. */ long int rem; /* Remainder. */ } imaxdiv_t; #else /* We have to define the `uintmax_t' type using `lldiv_t'. */ typedef struct { __extension__ long long int quot; /* Quotient. */ __extension__ long long int rem; /* Remainder. */ } imaxdiv_t; #endif /* Compute absolute value of N. */ extern intmax_t imaxabs(intmax_t __n) __THROW __attribute__ ((__const__)); /* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */ extern imaxdiv_t imaxdiv(intmax_t __numer, intmax_t __denom) __THROW __attribute__ ((__const__)); /* Like `strtol' but convert to `intmax_t'. */ extern intmax_t strtoimax(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW; /* Like `strtoul' but convert to `uintmax_t'. */ extern uintmax_t strtoumax(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW; /* Like `wcstol' but convert to `intmax_t'. */ extern intmax_t wcstoimax(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base) __THROW; /* Like `wcstoul' but convert to `uintmax_t'. */ extern uintmax_t wcstoumax(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base) __THROW; #ifdef __USE_EXTERN_INLINES #if __WORDSIZE == 64 extern long int __strtol_internal(const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH(strtoimax(const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtol_internal(nptr, endptr, base, 0); } extern unsigned long int __strtoul_internal(const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH(strtoumax(const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoul_internal(nptr, endptr, base, 0); } extern long int __wcstol_internal(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH(wcstoimax(const __gwchar_t * __restrict nptr, __gwchar_t ** __restrict endptr, int base)) { return __wcstol_internal(nptr, endptr, base, 0); } extern unsigned long int __wcstoul_internal(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH(wcstoumax(const __gwchar_t * __restrict nptr, __gwchar_t ** __restrict endptr, int base)) { return __wcstoul_internal(nptr, endptr, base, 0); } #else /* __WORDSIZE == 32 */ __extension__ extern long long int __strtoll_internal(const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH(strtoimax(const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoll_internal(nptr, endptr, base, 0); } __extension__ extern unsigned long long int __strtoull_internal(const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH(strtoumax(const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoull_internal(nptr, endptr, base, 0); } __extension__ extern long long int __wcstoll_internal(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH(wcstoimax(const __gwchar_t * __restrict nptr, __gwchar_t ** __restrict endptr, int base)) { return __wcstoll_internal(nptr, endptr, base, 0); } __extension__ extern unsigned long long int __wcstoull_internal(const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH(wcstoumax(const __gwchar_t * __restrict nptr, __gwchar_t ** __restrict endptr, int base)) { return __wcstoull_internal(nptr, endptr, base, 0); } #endif /* __WORDSIZE == 32 */ #endif /* Use extern inlines. */ __END_DECLS #endif /* inttypes.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/libio.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Per Bothner . The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . As a special exception, if you link the code in this file with files compiled with a GNU compiler to produce an executable, that does not cause the resulting executable to be covered by the GNU Lesser General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Lesser General Public License. This exception applies to code released by its copyright holders in files containing the exception. */ #ifndef _IO_STDIO_H #define _IO_STDIO_H #include <_G_config.h> /* ALL of these should be defined in _G_config.h */ #define _IO_fpos_t _G_fpos_t #define _IO_fpos64_t _G_fpos64_t #define _IO_size_t size_t #define _IO_ssize_t __ssize_t #define _IO_off_t __off_t #define _IO_off64_t __off64_t #define _IO_pid_t __pid_t #define _IO_uid_t __uid_t #define _IO_iconv_t _G_iconv_t #define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE #define _IO_BUFSIZ _G_BUFSIZ #define _IO_va_list _G_va_list #define _IO_wint_t wint_t /* This define avoids name pollution if we're using GNU stdarg.h */ #define __need___va_list #include #ifdef __GNUC_VA_LIST #undef _IO_va_list #define _IO_va_list __gnuc_va_list #endif /* __GNUC_VA_LIST */ #ifndef __P #include #endif /*!__P */ #define _IO_UNIFIED_JUMPTABLES 1 #ifndef EOF #define EOF (-1) #endif #ifndef NULL #if defined __GNUG__ && \ (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) #define NULL (__null) #else #if !defined(__cplusplus) #define NULL ((void*)0) #else #define NULL (0) #endif #endif #endif #define _IOS_INPUT 1 #define _IOS_OUTPUT 2 #define _IOS_ATEND 4 #define _IOS_APPEND 8 #define _IOS_TRUNC 16 #define _IOS_NOCREATE 32 #define _IOS_NOREPLACE 64 #define _IOS_BIN 128 /* Magic numbers and bits for the _flags field. The magic numbers use the high-order bits of _flags; the remaining bits are available for variable flags. Note: The magic numbers must all be negative if stdio emulation is desired. */ #define _IO_MAGIC 0xFBAD0000 /* Magic number */ #define _OLD_STDIO_MAGIC 0xFABC0000 /* Emulate old stdio. */ #define _IO_MAGIC_MASK 0xFFFF0000 #define _IO_USER_BUF 1 /* User owns buffer; don't delete it on close. */ #define _IO_UNBUFFERED 2 #define _IO_NO_READS 4 /* Reading not allowed */ #define _IO_NO_WRITES 8 /* Writing not allowd */ #define _IO_EOF_SEEN 0x10 #define _IO_ERR_SEEN 0x20 #define _IO_DELETE_DONT_CLOSE 0x40 /* Don't call close(_fileno) on cleanup. */ #define _IO_LINKED 0x80 /* Set if linked (using _chain) to streambuf::_list_all. */ #define _IO_IN_BACKUP 0x100 #define _IO_LINE_BUF 0x200 #define _IO_TIED_PUT_GET 0x400 /* Set if put and get pointer logicly tied. */ #define _IO_CURRENTLY_PUTTING 0x800 #define _IO_IS_APPENDING 0x1000 #define _IO_IS_FILEBUF 0x2000 #define _IO_BAD_SEEN 0x4000 #define _IO_USER_LOCK 0x8000 #define _IO_FLAGS2_MMAP 1 #define _IO_FLAGS2_NOTCANCEL 2 #ifdef _LIBC #define _IO_FLAGS2_FORTIFY 4 #endif #define _IO_FLAGS2_USER_WBUF 8 #ifdef _LIBC #define _IO_FLAGS2_SCANF_STD 16 #define _IO_FLAGS2_NOCLOSE 32 #define _IO_FLAGS2_CLOEXEC 64 #endif /* These are "formatting flags" matching the iostream fmtflags enum values. */ #define _IO_SKIPWS 01 #define _IO_LEFT 02 #define _IO_RIGHT 04 #define _IO_INTERNAL 010 #define _IO_DEC 020 #define _IO_OCT 040 #define _IO_HEX 0100 #define _IO_SHOWBASE 0200 #define _IO_SHOWPOINT 0400 #define _IO_UPPERCASE 01000 #define _IO_SHOWPOS 02000 #define _IO_SCIENTIFIC 04000 #define _IO_FIXED 010000 #define _IO_UNITBUF 020000 #define _IO_STDIO 040000 #define _IO_DONT_CLOSE 0100000 #define _IO_BOOLALPHA 0200000 struct _IO_jump_t; struct _IO_FILE; /* Handle lock. */ #ifdef _IO_MTSAFE_IO /* _IO_lock_t defined in internal headers during the glibc build. */ #else typedef void _IO_lock_t; #endif /* A streammarker remembers a position in a buffer. */ struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; /* If _pos >= 0 it points to _buf->Gbase()+_pos. FIXME comment */ /* if _pos < 0, it points to _buf->eBptr()+_pos. FIXME comment */ int _pos; #if 0 void set_streampos(streampos sp) { _spos = sp; } void set_offset(int offset) { _pos = offset; _spos = (streampos) (-2); } public: streammarker(streambuf * sb); ~streammarker(); int saving() { return _spos == -2; } int delta(streammarker &); int delta(); #endif }; /* This is the structure from the libstdc++ codecvt class. */ enum __codecvt_result { __codecvt_ok, __codecvt_partial, __codecvt_error, __codecvt_noconv }; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T /* The order of the elements in the following struct must match the order of the virtual functions in the libstdc++ codecvt class. */ struct _IO_codecvt { void (*__codecvt_destr) (struct _IO_codecvt *); enum __codecvt_result (*__codecvt_do_out) (struct _IO_codecvt *, __mbstate_t *, const wchar_t *, const wchar_t *, const wchar_t **, char *, char *, char **); enum __codecvt_result (*__codecvt_do_unshift) (struct _IO_codecvt *, __mbstate_t *, char *, char *, char **); enum __codecvt_result (*__codecvt_do_in) (struct _IO_codecvt *, __mbstate_t *, const char *, const char *, const char **, wchar_t *, wchar_t *, wchar_t **); int (*__codecvt_do_encoding) (struct _IO_codecvt *); int (*__codecvt_do_always_noconv) (struct _IO_codecvt *); int (*__codecvt_do_length) (struct _IO_codecvt *, __mbstate_t *, const char *, const char *, _IO_size_t); int (*__codecvt_do_max_length) (struct _IO_codecvt *); _IO_iconv_t __cd_in; _IO_iconv_t __cd_out; }; /* Extra data for wide character streams. */ struct _IO_wide_data { wchar_t *_IO_read_ptr; /* Current read pointer */ wchar_t *_IO_read_end; /* End of get area. */ wchar_t *_IO_read_base; /* Start of putback+get area. */ wchar_t *_IO_write_base; /* Start of put area. */ wchar_t *_IO_write_ptr; /* Current put pointer. */ wchar_t *_IO_write_end; /* End of put area. */ wchar_t *_IO_buf_base; /* Start of reserve area. */ wchar_t *_IO_buf_end; /* End of reserve area. */ /* The following fields are used to support backing up and undo. */ wchar_t *_IO_save_base; /* Pointer to start of non-current get area. */ wchar_t *_IO_backup_base; /* Pointer to first valid character of backup area */ wchar_t *_IO_save_end; /* Pointer to end of non-current get area. */ __mbstate_t _IO_state; __mbstate_t _IO_last_state; struct _IO_codecvt _codecvt; wchar_t _shortbuf[1]; const struct _IO_jump_t *_wide_vtable; }; #endif struct _IO_FILE { int _flags; /* High-order word is _IO_MAGIC; rest is flags. */ #define _IO_file_flags _flags /* The following pointers correspond to the C++ streambuf protocol. */ /* Note: Tk uses the _IO_read_ptr and _IO_read_end fields directly. */ char *_IO_read_ptr; /* Current read pointer */ char *_IO_read_end; /* End of get area. */ char *_IO_read_base; /* Start of putback+get area. */ char *_IO_write_base; /* Start of put area. */ char *_IO_write_ptr; /* Current put pointer. */ char *_IO_write_end; /* End of put area. */ char *_IO_buf_base; /* Start of reserve area. */ char *_IO_buf_end; /* End of reserve area. */ /* The following fields are used to support backing up and undo. */ char *_IO_save_base; /* Pointer to start of non-current get area. */ char *_IO_backup_base; /* Pointer to first valid character of backup area */ char *_IO_save_end; /* Pointer to end of non-current get area. */ struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; #if 0 int _blksize; #else int _flags2; #endif _IO_off_t _old_offset; /* This used to be _offset but it's too small. */ #define __HAVE_COLUMN /* temporary */ /* 1+column number of pbase(); 0 is unknown. */ unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; /* char* _save_gptr; char* _save_egptr; */ _IO_lock_t *_lock; #ifdef _IO_USE_OLD_IO_FILE }; struct _IO_FILE_complete { struct _IO_FILE _file; #endif #if defined _G_IO_IO_FILE_VERSION && _G_IO_IO_FILE_VERSION == 0x20001 _IO_off64_t _offset; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T /* Wide character stream stuff. */ struct _IO_codecvt *_codecvt; struct _IO_wide_data *_wide_data; struct _IO_FILE *_freeres_list; void *_freeres_buf; #else void *__pad1; void *__pad2; void *__pad3; void *__pad4; #endif size_t __pad5; int _mode; /* Make sure we don't get into trouble again. */ char _unused2[15 * sizeof(int) - 4 * sizeof(void *) - sizeof(size_t)]; #endif }; #ifndef __cplusplus typedef struct _IO_FILE _IO_FILE; #endif struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; extern struct _IO_FILE_plus _IO_2_1_stderr_; #ifndef _LIBC #define _IO_stdin ((_IO_FILE*)(&_IO_2_1_stdin_)) #define _IO_stdout ((_IO_FILE*)(&_IO_2_1_stdout_)) #define _IO_stderr ((_IO_FILE*)(&_IO_2_1_stderr_)) #else extern _IO_FILE *_IO_stdin attribute_hidden; extern _IO_FILE *_IO_stdout attribute_hidden; extern _IO_FILE *_IO_stderr attribute_hidden; #endif /* Functions to do I/O and file management for a stream. */ /* Read NBYTES bytes from COOKIE into a buffer pointed to by BUF. Return number of bytes read. */ typedef __ssize_t __io_read_fn(void *__cookie, char *__buf, size_t __nbytes); /* Write N bytes pointed to by BUF to COOKIE. Write all N bytes unless there is an error. Return number of bytes written. If there is an error, return 0 and do not write anything. If the file has been opened for append (__mode.__append set), then set the file pointer to the end of the file and then do the write; if not, just write at the current file pointer. */ typedef __ssize_t __io_write_fn(void *__cookie, const char *__buf, size_t __n); /* Move COOKIE's file position to *POS bytes from the beginning of the file (if W is SEEK_SET), the current position (if W is SEEK_CUR), or the end of the file (if W is SEEK_END). Set *POS to the new file position. Returns zero if successful, nonzero if not. */ typedef int __io_seek_fn(void *__cookie, _IO_off64_t * __pos, int __w); /* Close COOKIE. */ typedef int __io_close_fn(void *__cookie); #ifdef _GNU_SOURCE /* User-visible names for the above. */ typedef __io_read_fn cookie_read_function_t; typedef __io_write_fn cookie_write_function_t; typedef __io_seek_fn cookie_seek_function_t; typedef __io_close_fn cookie_close_function_t; /* The structure with the cookie function pointers. */ typedef struct { __io_read_fn *read; /* Read bytes. */ __io_write_fn *write; /* Write bytes. */ __io_seek_fn *seek; /* Seek/tell file position. */ __io_close_fn *close; /* Close file. */ } _IO_cookie_io_functions_t; typedef _IO_cookie_io_functions_t cookie_io_functions_t; struct _IO_cookie_file; /* Initialize one of those. */ extern void _IO_cookie_init(struct _IO_cookie_file *__cfile, int __read_write, void *__cookie, _IO_cookie_io_functions_t __fns); #endif #ifdef __cplusplus extern "C" { #endif extern int __underflow(_IO_FILE *); extern int __uflow(_IO_FILE *); extern int __overflow(_IO_FILE *, int); #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T extern _IO_wint_t __wunderflow(_IO_FILE *); extern _IO_wint_t __wuflow(_IO_FILE *); extern _IO_wint_t __woverflow(_IO_FILE *, _IO_wint_t); #endif #if __GNUC__ >= 3 #define _IO_BE(expr, res) __builtin_expect ((expr), res) #else #define _IO_BE(expr, res) (expr) #endif #define _IO_getc_unlocked(_fp) \ (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \ ? __uflow (_fp) : *(unsigned char *) (_fp)->_IO_read_ptr++) #define _IO_peekc_unlocked(_fp) \ (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \ && __underflow (_fp) == EOF ? EOF \ : *(unsigned char *) (_fp)->_IO_read_ptr) #define _IO_putc_unlocked(_ch, _fp) \ (_IO_BE ((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end, 0) \ ? __overflow (_fp, (unsigned char) (_ch)) \ : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch))) #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T #define _IO_getwc_unlocked(_fp) \ (_IO_BE ((_fp)->_wide_data == NULL \ || ((_fp)->_wide_data->_IO_read_ptr \ >= (_fp)->_wide_data->_IO_read_end), 0) \ ? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++) #define _IO_putwc_unlocked(_wch, _fp) \ (_IO_BE ((_fp)->_wide_data == NULL \ || ((_fp)->_wide_data->_IO_write_ptr \ >= (_fp)->_wide_data->_IO_write_end), 0) \ ? __woverflow (_fp, _wch) \ : (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch))) #endif #define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0) #define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0) extern int _IO_getc(_IO_FILE * __fp); extern int _IO_putc(int __c, _IO_FILE * __fp); extern int _IO_feof(_IO_FILE * __fp) __THROW; extern int _IO_ferror(_IO_FILE * __fp) __THROW; extern int _IO_peekc_locked(_IO_FILE * __fp); /* This one is for Emacs. */ #define _IO_PENDING_OUTPUT_COUNT(_fp) \ ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base) extern void _IO_flockfile(_IO_FILE *) __THROW; extern void _IO_funlockfile(_IO_FILE *) __THROW; extern int _IO_ftrylockfile(_IO_FILE *) __THROW; #ifdef _IO_MTSAFE_IO #define _IO_peekc(_fp) _IO_peekc_locked (_fp) #define _IO_flockfile(_fp) \ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_flockfile (_fp) #define _IO_funlockfile(_fp) \ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_funlockfile (_fp) #else #define _IO_peekc(_fp) _IO_peekc_unlocked (_fp) #define _IO_flockfile(_fp) /**/ #define _IO_funlockfile(_fp) /**/ #define _IO_ftrylockfile(_fp) /**/ #define _IO_cleanup_region_start(_fct, _fp) /**/ #define _IO_cleanup_region_end(_Doit) /**/ #endif /* !_IO_MTSAFE_IO */ extern int _IO_vfscanf(_IO_FILE * __restrict, const char *__restrict, _IO_va_list, int *__restrict); extern int _IO_vfprintf(_IO_FILE * __restrict, const char *__restrict, _IO_va_list); extern _IO_ssize_t _IO_padn(_IO_FILE *, int, _IO_ssize_t); extern _IO_size_t _IO_sgetn(_IO_FILE *, void *, _IO_size_t); extern _IO_off64_t _IO_seekoff(_IO_FILE *, _IO_off64_t, int, int); extern _IO_off64_t _IO_seekpos(_IO_FILE *, _IO_off64_t, int); extern void _IO_free_backup_area(_IO_FILE *) __THROW; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T extern _IO_wint_t _IO_getwc(_IO_FILE * __fp); extern _IO_wint_t _IO_putwc(wchar_t __wc, _IO_FILE * __fp); extern int _IO_fwide(_IO_FILE * __fp, int __mode) __THROW; #if __GNUC__ >= 2 /* While compiling glibc we have to handle compatibility with very old versions. */ #if defined _LIBC && defined SHARED #include #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) #define _IO_fwide_maybe_incompatible \ (__builtin_expect (&_IO_stdin_used == NULL, 0)) extern const int _IO_stdin_used; weak_extern(_IO_stdin_used); #endif #endif #ifndef _IO_fwide_maybe_incompatible #define _IO_fwide_maybe_incompatible (0) #endif /* A special optimized version of the function above. It optimizes the case of initializing an unoriented byte stream. */ #define _IO_fwide(__fp, __mode) \ ({ int __result = (__mode); \ if (__result < 0 && ! _IO_fwide_maybe_incompatible) \ { \ if ((__fp)->_mode == 0) \ /* We know that all we have to do is to set the flag. */ \ (__fp)->_mode = -1; \ __result = (__fp)->_mode; \ } \ else if (__builtin_constant_p (__mode) && (__mode) == 0) \ __result = _IO_fwide_maybe_incompatible ? -1 : (__fp)->_mode; \ else \ __result = _IO_fwide (__fp, __result); \ __result; }) #endif extern int _IO_vfwscanf(_IO_FILE * __restrict, const wchar_t * __restrict, _IO_va_list, int *__restrict); extern int _IO_vfwprintf(_IO_FILE * __restrict, const wchar_t * __restrict, _IO_va_list); extern _IO_ssize_t _IO_wpadn(_IO_FILE *, wint_t, _IO_ssize_t); extern void _IO_free_wbackup_area(_IO_FILE *) __THROW; #endif #ifdef __LDBL_COMPAT #include #endif #ifdef __cplusplus } #endif #endif /* _IO_STDIO_H */ ================================================ FILE: v2/headers/linux_arm/usr/include/limits.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types */ #ifndef _LIBC_LIMITS_H_ #define _LIBC_LIMITS_H_ 1 #include /* Maximum length of any multibyte character in any locale. We define this value here since the gcc header does not define the correct value. */ #define MB_LEN_MAX 16 /* If we are not using GNU CC we have to define all the symbols ourself. Otherwise use gcc's definitions (see below). */ #if !defined __GNUC__ || __GNUC__ < 2 /* We only protect from multiple inclusion here, because all the other #include's protect themselves, and in GCC 2 we may #include_next through multiple copies of this file before we get to GCC's. */ #ifndef _LIMITS_H #define _LIMITS_H 1 #include /* We don't have #include_next. Define ANSI for standard 32-bit words. */ /* These assume 8-bit `char's, 16-bit `short int's, and 32-bit `int's and `long int's. */ /* Number of bits in a `char'. */ #define CHAR_BIT 8 /* Minimum and maximum values a `signed char' can hold. */ #define SCHAR_MIN (-128) #define SCHAR_MAX 127 /* Maximum value an `unsigned char' can hold. (Minimum is 0.) */ #define UCHAR_MAX 255 /* Minimum and maximum values a `char' can hold. */ #ifdef __CHAR_UNSIGNED__ #define CHAR_MIN 0 #define CHAR_MAX UCHAR_MAX #else #define CHAR_MIN SCHAR_MIN #define CHAR_MAX SCHAR_MAX #endif /* Minimum and maximum values a `signed short int' can hold. */ #define SHRT_MIN (-32768) #define SHRT_MAX 32767 /* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */ #define USHRT_MAX 65535 /* Minimum and maximum values a `signed int' can hold. */ #define INT_MIN (-INT_MAX - 1) #define INT_MAX 2147483647 /* Maximum value an `unsigned int' can hold. (Minimum is 0.) */ #define UINT_MAX 4294967295U /* Minimum and maximum values a `signed long int' can hold. */ #if __WORDSIZE == 64 #define LONG_MAX 9223372036854775807L #else #define LONG_MAX 2147483647L #endif #define LONG_MIN (-LONG_MAX - 1L) /* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */ #if __WORDSIZE == 64 #define ULONG_MAX 18446744073709551615UL #else #define ULONG_MAX 4294967295UL #endif #ifdef __USE_ISOC99 /* Minimum and maximum values a `signed long long int' can hold. */ #define LLONG_MAX 9223372036854775807LL #define LLONG_MIN (-LLONG_MAX - 1LL) /* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */ #define ULLONG_MAX 18446744073709551615ULL #endif /* ISO C99 */ #endif /* limits.h */ #endif /* GCC 2. */ #endif /* !_LIBC_LIMITS_H_ */ /* Get the compiler's limits.h, which defines almost all the ISO constants. We put this #include_next outside the double inclusion check because it should be possible to include this file more than once and still get the definitions from gcc's header. */ #if defined __GNUC__ && !defined _GCC_LIMITS_H_ /* `_GCC_LIMITS_H_' is what GCC's file defines. */ #include_next #endif /* The files in some gcc versions don't define LLONG_MIN, LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for ages are available. */ #if defined __USE_ISOC99 && defined __GNUC__ #ifndef LLONG_MIN #define LLONG_MIN (-LLONG_MAX-1) #endif #ifndef LLONG_MAX #define LLONG_MAX __LONG_LONG_MAX__ #endif #ifndef ULLONG_MAX #define ULLONG_MAX (LLONG_MAX * 2ULL + 1) #endif #endif #ifdef __USE_POSIX /* POSIX adds things to . */ #include #endif #ifdef __USE_POSIX2 #include #endif #ifdef __USE_XOPEN #include #endif ================================================ FILE: v2/headers/linux_arm/usr/include/linux/errno.h ================================================ #include ================================================ FILE: v2/headers/linux_arm/usr/include/linux/ioctl.h ================================================ #ifndef _LINUX_IOCTL_H #define _LINUX_IOCTL_H #include #endif /* _LINUX_IOCTL_H */ ================================================ FILE: v2/headers/linux_arm/usr/include/linux/limits.h ================================================ #ifndef _LINUX_LIMITS_H #define _LINUX_LIMITS_H #define NR_OPEN 1024 #define NGROUPS_MAX 65536 /* supplemental group IDs are available */ #define ARG_MAX 131072 /* # bytes of args + environ for exec() */ #define LINK_MAX 127 /* # links a file may have */ #define MAX_CANON 255 /* size of the canonical input queue */ #define MAX_INPUT 255 /* size of the type-ahead buffer */ #define NAME_MAX 255 /* # chars in a file name */ #define PATH_MAX 4096 /* # chars in a path name including nul */ #define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */ #define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */ #define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */ #define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */ #define RTSIG_MAX 32 #endif ================================================ FILE: v2/headers/linux_arm/usr/include/linux/param.h ================================================ #ifndef _LINUX_PARAM_H #define _LINUX_PARAM_H #include #endif ================================================ FILE: v2/headers/linux_arm/usr/include/locale.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.11 Localization */ #ifndef _LOCALE_H #define _LOCALE_H 1 #include #define __need_NULL #include #include __BEGIN_DECLS /* These are the possibilities for the first argument to setlocale. The code assumes that the lowest LC_* symbol has the value zero. */ #define LC_CTYPE __LC_CTYPE #define LC_NUMERIC __LC_NUMERIC #define LC_TIME __LC_TIME #define LC_COLLATE __LC_COLLATE #define LC_MONETARY __LC_MONETARY #define LC_MESSAGES __LC_MESSAGES #define LC_ALL __LC_ALL #define LC_PAPER __LC_PAPER #define LC_NAME __LC_NAME #define LC_ADDRESS __LC_ADDRESS #define LC_TELEPHONE __LC_TELEPHONE #define LC_MEASUREMENT __LC_MEASUREMENT #define LC_IDENTIFICATION __LC_IDENTIFICATION __BEGIN_NAMESPACE_STD /* Structure giving information about numeric and monetary notation. */ struct lconv { /* Numeric (non-monetary) information. */ char *decimal_point; /* Decimal point character. */ char *thousands_sep; /* Thousands separator. */ /* Each element is the number of digits in each group; elements with higher indices are farther left. An element with value CHAR_MAX means that no further grouping is done. An element with value 0 means that the previous element is used for all groups farther left. */ char *grouping; /* Monetary information. */ /* First three chars are a currency symbol from ISO 4217. Fourth char is the separator. Fifth char is '\0'. */ char *int_curr_symbol; char *currency_symbol; /* Local currency symbol. */ char *mon_decimal_point; /* Decimal point character. */ char *mon_thousands_sep; /* Thousands separator. */ char *mon_grouping; /* Like `grouping' element (above). */ char *positive_sign; /* Sign for positive values. */ char *negative_sign; /* Sign for negative values. */ char int_frac_digits; /* Int'l fractional digits. */ char frac_digits; /* Local fractional digits. */ /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */ char p_cs_precedes; /* 1 iff a space separates currency_symbol from a positive value. */ char p_sep_by_space; /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */ char n_cs_precedes; /* 1 iff a space separates currency_symbol from a negative value. */ char n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and currency_symbol. 1 The sign string precedes the quantity and currency_symbol. 2 The sign string follows the quantity and currency_symbol. 3 The sign string immediately precedes the currency_symbol. 4 The sign string immediately follows the currency_symbol. */ char p_sign_posn; char n_sign_posn; #ifdef __USE_ISOC99 /* 1 if int_curr_symbol precedes a positive value, 0 if succeeds. */ char int_p_cs_precedes; /* 1 iff a space separates int_curr_symbol from a positive value. */ char int_p_sep_by_space; /* 1 if int_curr_symbol precedes a negative value, 0 if succeeds. */ char int_n_cs_precedes; /* 1 iff a space separates int_curr_symbol from a negative value. */ char int_n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and int_curr_symbol. 1 The sign string precedes the quantity and int_curr_symbol. 2 The sign string follows the quantity and int_curr_symbol. 3 The sign string immediately precedes the int_curr_symbol. 4 The sign string immediately follows the int_curr_symbol. */ char int_p_sign_posn; char int_n_sign_posn; #else char __int_p_cs_precedes; char __int_p_sep_by_space; char __int_n_cs_precedes; char __int_n_sep_by_space; char __int_p_sign_posn; char __int_n_sign_posn; #endif }; /* Set and/or return the current locale. */ extern char *setlocale(int __category, const char *__locale) __THROW; /* Return the numeric/monetary information for the current locale. */ extern struct lconv *localeconv(void) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ /* Get locale datatype definition. */ #include /* Return a reference to a data structure representing a set of locale datasets. Unlike for the CATEGORY parameter for `setlocale' the CATEGORY_MASK parameter here uses a single bit for each category, made by OR'ing together LC_*_MASK bits above. */ extern __locale_t newlocale(int __category_mask, const char *__locale, __locale_t __base) __THROW; /* These are the bits that can be set in the CATEGORY_MASK argument to `newlocale'. In the GNU implementation, LC_FOO_MASK has the value of (1 << LC_FOO), but this is not a part of the interface that callers can assume will be true. */ #define LC_CTYPE_MASK (1 << __LC_CTYPE) #define LC_NUMERIC_MASK (1 << __LC_NUMERIC) #define LC_TIME_MASK (1 << __LC_TIME) #define LC_COLLATE_MASK (1 << __LC_COLLATE) #define LC_MONETARY_MASK (1 << __LC_MONETARY) #define LC_MESSAGES_MASK (1 << __LC_MESSAGES) #define LC_PAPER_MASK (1 << __LC_PAPER) #define LC_NAME_MASK (1 << __LC_NAME) #define LC_ADDRESS_MASK (1 << __LC_ADDRESS) #define LC_TELEPHONE_MASK (1 << __LC_TELEPHONE) #define LC_MEASUREMENT_MASK (1 << __LC_MEASUREMENT) #define LC_IDENTIFICATION_MASK (1 << __LC_IDENTIFICATION) #define LC_ALL_MASK (LC_CTYPE_MASK \ | LC_NUMERIC_MASK \ | LC_TIME_MASK \ | LC_COLLATE_MASK \ | LC_MONETARY_MASK \ | LC_MESSAGES_MASK \ | LC_PAPER_MASK \ | LC_NAME_MASK \ | LC_ADDRESS_MASK \ | LC_TELEPHONE_MASK \ | LC_MEASUREMENT_MASK \ | LC_IDENTIFICATION_MASK \ ) /* Return a duplicate of the set of locale in DATASET. All usage counters are increased if necessary. */ extern __locale_t duplocale(__locale_t __dataset) __THROW; /* Free the data associated with a locale dataset previously returned by a call to `setlocale_r'. */ extern void freelocale(__locale_t __dataset) __THROW; /* Switch the current thread's locale to DATASET. If DATASET is null, instead just return the current setting. The special value LC_GLOBAL_LOCALE is the initial setting for all threads and can also be installed any time, meaning the thread uses the global settings controlled by `setlocale'. */ extern __locale_t uselocale(__locale_t __dataset) __THROW; /* This value can be passed to `uselocale' and may be returned by it. Passing this value to any other function has undefined behavior. */ #define LC_GLOBAL_LOCALE ((__locale_t) -1L) #endif __END_DECLS #endif /* locale.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/malloc.h ================================================ /* Prototypes and definition for malloc implementation. Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MALLOC_H #define _MALLOC_H 1 #include #include #include #ifdef _LIBC #define __MALLOC_HOOK_VOLATILE #define __MALLOC_DEPRECATED #else #define __MALLOC_HOOK_VOLATILE volatile #define __MALLOC_DEPRECATED __attribute_deprecated__ #endif __BEGIN_DECLS /* Allocate SIZE bytes of memory. */ extern void *malloc(size_t __size) __THROW __attribute_malloc__ __wur; /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ extern void *calloc(size_t __nmemb, size_t __size) __THROW __attribute_malloc__ __wur; /* Re-allocate the previously allocated block in __ptr, making the new block SIZE bytes long. */ /* __attribute_malloc__ is not used, because if realloc returns the same pointer that was passed to it, aliasing needs to be allowed between objects pointed by the old and new pointers. */ extern void *realloc(void *__ptr, size_t __size) __THROW __attribute_warn_unused_result__; /* Free a block allocated by `malloc', `realloc' or `calloc'. */ extern void free(void *__ptr) __THROW; /* Free a block allocated by `calloc'. */ extern void cfree(void *__ptr) __THROW; /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ extern void *memalign(size_t __alignment, size_t __size) __THROW __attribute_malloc__ __wur; /* Allocate SIZE bytes on a page boundary. */ extern void *valloc(size_t __size) __THROW __attribute_malloc__ __wur; /* Equivalent to valloc(minimum-page-that-holds(n)), that is, round up __size to nearest pagesize. */ extern void *pvalloc(size_t __size) __THROW __attribute_malloc__ __wur; /* Underlying allocation function; successive calls should return contiguous pieces of memory. */ extern void *(*__morecore) (ptrdiff_t __size); /* Default value of `__morecore'. */ extern void *__default_morecore(ptrdiff_t __size) __THROW __attribute_malloc__; /* SVID2/XPG mallinfo structure */ struct mallinfo { int arena; /* non-mmapped space allocated from system */ int ordblks; /* number of free chunks */ int smblks; /* number of fastbin blocks */ int hblks; /* number of mmapped regions */ int hblkhd; /* space in mmapped regions */ int usmblks; /* always 0, preserved for backwards compatibility */ int fsmblks; /* space available in freed fastbin blocks */ int uordblks; /* total allocated space */ int fordblks; /* total free space */ int keepcost; /* top-most, releasable (via malloc_trim) space */ }; /* Returns a copy of the updated current mallinfo. */ extern struct mallinfo mallinfo(void) __THROW; /* SVID2/XPG mallopt options */ #ifndef M_MXFAST #define M_MXFAST 1 /* maximum request size for "fastbins" */ #endif #ifndef M_NLBLKS #define M_NLBLKS 2 /* UNUSED in this malloc */ #endif #ifndef M_GRAIN #define M_GRAIN 3 /* UNUSED in this malloc */ #endif #ifndef M_KEEP #define M_KEEP 4 /* UNUSED in this malloc */ #endif /* mallopt options that actually do something */ #define M_TRIM_THRESHOLD -1 #define M_TOP_PAD -2 #define M_MMAP_THRESHOLD -3 #define M_MMAP_MAX -4 #define M_CHECK_ACTION -5 #define M_PERTURB -6 #define M_ARENA_TEST -7 #define M_ARENA_MAX -8 /* General SVID/XPG interface to tunable parameters. */ extern int mallopt(int __param, int __val) __THROW; /* Release all but __pad bytes of freed top-most memory back to the system. Return 1 if successful, else 0. */ extern int malloc_trim(size_t __pad) __THROW; /* Report the number of usable allocated bytes associated with allocated chunk __ptr. */ extern size_t malloc_usable_size(void *__ptr) __THROW; /* Prints brief summary statistics on stderr. */ extern void malloc_stats(void) __THROW; /* Output information about state of allocator to stream FP. */ extern int malloc_info(int __options, FILE * __fp) __THROW; /* Record the state of all malloc variables in an opaque data structure. */ extern void *malloc_get_state(void) __THROW; /* Restore the state of all malloc variables from data obtained with malloc_get_state(). */ extern int malloc_set_state(void *__ptr) __THROW; /* Hooks for debugging and user-defined versions. */ extern void (*__MALLOC_HOOK_VOLATILE __free_hook) (void *__ptr, const void *)__MALLOC_DEPRECATED; extern void *(*__MALLOC_HOOK_VOLATILE __malloc_hook) (size_t __size, const void *)__MALLOC_DEPRECATED; extern void *(*__MALLOC_HOOK_VOLATILE __realloc_hook) (void *__ptr, size_t __size, const void *)__MALLOC_DEPRECATED; extern void *(*__MALLOC_HOOK_VOLATILE __memalign_hook) (size_t __alignment, size_t __size, const void *)__MALLOC_DEPRECATED; extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void); /* Activate a standard set of debugging hooks. */ extern void __malloc_check_init(void) __THROW __MALLOC_DEPRECATED; __END_DECLS #endif /* malloc.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/math.h ================================================ /* Declarations for math functions. Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.12 Mathematics */ #ifndef _MATH_H #define _MATH_H 1 #include __BEGIN_DECLS /* Get machine-dependent vector math functions declarations. */ #include /* Get machine-dependent HUGE_VAL value (returned on overflow). On all IEEE754 machines, this is +Infinity. */ #include #ifdef __USE_ISOC99 #include #include /* Get machine-dependent INFINITY value. */ #include /* Get machine-dependent NAN value (returned for some domain errors). */ #include #endif /* __USE_ISOC99 */ /* Get general and ISO C99 specific information. */ #include /* The file contains the prototypes for all the actual math functions. These macros are used for those prototypes, so we can easily declare each function as both `name' and `__name', and can declare the float versions `namef' and `__namef'. */ #define __SIMD_DECL(function) __CONCAT (__DECL_SIMD_, function) #define __MATHCALL_VEC(function, suffix, args) \ __SIMD_DECL (__MATH_PRECNAME (function, suffix)) \ __MATHCALL (function, suffix, args) #define __MATHDECL_VEC(type, function,suffix, args) \ __SIMD_DECL (__MATH_PRECNAME (function, suffix)) \ __MATHDECL(type, function,suffix, args) #define __MATHCALL(function,suffix, args) \ __MATHDECL (_Mdouble_,function,suffix, args) #define __MATHDECL(type, function,suffix, args) \ __MATHDECL_1(type, function,suffix, args); \ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) #define __MATHCALLX(function,suffix, args, attrib) \ __MATHDECLX (_Mdouble_,function,suffix, args, attrib) #define __MATHDECLX(type, function,suffix, args, attrib) \ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib) #define __MATHDECL_1(type, function,suffix, args) \ extern type __MATH_PRECNAME(function,suffix) args __THROW #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) #define __MATH_DECLARING_DOUBLE 1 #define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD #define _Mdouble_END_NAMESPACE __END_NAMESPACE_STD #include #undef _Mdouble_ #undef _Mdouble_BEGIN_NAMESPACE #undef _Mdouble_END_NAMESPACE #undef __MATH_PRECNAME #undef __MATH_DECLARING_DOUBLE #ifdef __USE_ISOC99 /* Include the file of declarations again, this time using `float' instead of `double' and appending f to each function name. */ #ifndef _Mfloat_ #define _Mfloat_ float #endif #define _Mdouble_ _Mfloat_ #define __MATH_PRECNAME(name,r) name##f##r #define __MATH_DECLARING_DOUBLE 0 #define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99 #define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99 #include #undef _Mdouble_ #undef _Mdouble_BEGIN_NAMESPACE #undef _Mdouble_END_NAMESPACE #undef __MATH_PRECNAME #undef __MATH_DECLARING_DOUBLE #if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) \ || defined __LDBL_COMPAT \ || defined _LIBC_TEST #ifdef __LDBL_COMPAT #ifdef __USE_ISOC99 extern float __nldbl_nexttowardf(float __x, long double __y) __THROW __attribute__ ((__const__)); #ifdef __REDIRECT_NTH extern float __REDIRECT_NTH(nexttowardf, (float __x, long double __y), __nldbl_nexttowardf) __attribute__ ((__const__)); extern double __REDIRECT_NTH(nexttoward, (double __x, long double __y), nextafter) __attribute__ ((__const__)); extern long double __REDIRECT_NTH(nexttowardl, (long double __x, long double __y), nextafter) __attribute__ ((__const__)); #endif #endif #undef __MATHDECL_1 #define __MATHDECL_2(type, function,suffix, args, alias) \ extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \ args, alias) #define __MATHDECL_1(type, function,suffix, args) \ __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix)) #endif /* Include the file of declarations again, this time using `long double' instead of `double' and appending l to each function name. */ #ifndef _Mlong_double_ #define _Mlong_double_ long double #endif #define _Mdouble_ _Mlong_double_ #define __MATH_PRECNAME(name,r) name##l##r #define __MATH_DECLARING_DOUBLE 0 #define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99 #define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99 #define __MATH_DECLARE_LDOUBLE 1 #include #undef _Mdouble_ #undef _Mdouble_BEGIN_NAMESPACE #undef _Mdouble_END_NAMESPACE #undef __MATH_PRECNAME #undef __MATH_DECLARING_DOUBLE #endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */ #endif /* Use ISO C99. */ #undef __MATHDECL_1 #undef __MATHDECL #undef __MATHCALL #if defined __USE_MISC || defined __USE_XOPEN /* This variable is used by `gamma' and `lgamma'. */ extern int signgam; #endif /* ISO C99 defines some generic macros which work on any data type. */ #ifdef __USE_ISOC99 /* Get the architecture specific values describing the floating-point evaluation. The following symbols will get defined: float_t floating-point type at least as wide as `float' used to evaluate `float' expressions double_t floating-point type at least as wide as `double' used to evaluate `double' expressions FLT_EVAL_METHOD Defined to 0 if `float_t' is `float' and `double_t' is `double' 1 if `float_t' and `double_t' are `double' 2 if `float_t' and `double_t' are `long double' else `float_t' and `double_t' are unspecified INFINITY representation of the infinity value of type `float' FP_FAST_FMA FP_FAST_FMAF FP_FAST_FMAL If defined it indicates that the `fma' function generally executes about as fast as a multiply and an add. This macro is defined only iff the `fma' function is implemented directly with a hardware multiply-add instructions. FP_ILOGB0 Expands to a value returned by `ilogb (0.0)'. FP_ILOGBNAN Expands to a value returned by `ilogb (NAN)'. DECIMAL_DIG Number of decimal digits supported by conversion between decimal and all internal floating-point formats. */ /* All floating-point numbers can be put in one of these categories. */ enum { FP_NAN = #define FP_NAN 0 FP_NAN, FP_INFINITE = #define FP_INFINITE 1 FP_INFINITE, FP_ZERO = #define FP_ZERO 2 FP_ZERO, FP_SUBNORMAL = #define FP_SUBNORMAL 3 FP_SUBNORMAL, FP_NORMAL = #define FP_NORMAL 4 FP_NORMAL }; /* GCC bug 66462 means we cannot use the math builtins with -fsignaling-nan, so disable builtins if this is enabled. When fixed in a newer GCC, the __SUPPORT_SNAN__ check may be skipped for those versions. */ /* Return number of classification appropriate for X. */ #if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__ \ && !defined __OPTIMIZE_SIZE__ #define fpclassify(x) __builtin_fpclassify (FP_NAN, FP_INFINITE, \ FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x) #elif defined __NO_LONG_DOUBLE_MATH #define fpclassify(x) \ (sizeof (x) == sizeof (float) ? __fpclassifyf (x) : __fpclassify (x)) #else #define fpclassify(x) \ (sizeof (x) == sizeof (float) \ ? __fpclassifyf (x) \ : sizeof (x) == sizeof (double) \ ? __fpclassify (x) : __fpclassifyl (x)) #endif /* Return nonzero value if sign of X is negative. */ #if __GNUC_PREREQ (4,0) #define signbit(x) \ (sizeof (x) == sizeof (float) \ ? __builtin_signbitf (x) \ : sizeof (x) == sizeof (double) \ ? __builtin_signbit (x) : __builtin_signbitl (x)) #else #ifdef __NO_LONG_DOUBLE_MATH #define signbit(x) \ (sizeof (x) == sizeof (float) ? __signbitf (x) : __signbit (x)) #else #define signbit(x) \ (sizeof (x) == sizeof (float) \ ? __signbitf (x) \ : sizeof (x) == sizeof (double) \ ? __signbit (x) : __signbitl (x)) #endif #endif /* Return nonzero value if X is not +-Inf or NaN. */ #if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__ #define isfinite(x) __builtin_isfinite (x) #elif defined __NO_LONG_DOUBLE_MATH #define isfinite(x) \ (sizeof (x) == sizeof (float) ? __finitef (x) : __finite (x)) #else #define isfinite(x) \ (sizeof (x) == sizeof (float) \ ? __finitef (x) \ : sizeof (x) == sizeof (double) \ ? __finite (x) : __finitel (x)) #endif /* Return nonzero value if X is neither zero, subnormal, Inf, nor NaN. */ #if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__ #define isnormal(x) __builtin_isnormal (x) #else #define isnormal(x) (fpclassify (x) == FP_NORMAL) #endif /* Return nonzero value if X is a NaN. We could use `fpclassify' but we already have this functions `__isnan' and it is faster. */ #if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__ #define isnan(x) __builtin_isnan (x) #elif defined __NO_LONG_DOUBLE_MATH #define isnan(x) \ (sizeof (x) == sizeof (float) ? __isnanf (x) : __isnan (x)) #else #define isnan(x) \ (sizeof (x) == sizeof (float) \ ? __isnanf (x) \ : sizeof (x) == sizeof (double) \ ? __isnan (x) : __isnanl (x)) #endif /* Return nonzero value if X is positive or negative infinity. */ #if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__ #define isinf(x) __builtin_isinf_sign (x) #elif defined __NO_LONG_DOUBLE_MATH #define isinf(x) \ (sizeof (x) == sizeof (float) ? __isinff (x) : __isinf (x)) #else #define isinf(x) \ (sizeof (x) == sizeof (float) \ ? __isinff (x) \ : sizeof (x) == sizeof (double) \ ? __isinf (x) : __isinfl (x)) #endif /* Bitmasks for the math_errhandling macro. */ #define MATH_ERRNO 1 /* errno set by math functions. */ #define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */ /* By default all functions support both errno and exception handling. In gcc's fast math mode and if inline functions are defined this might not be true. */ #ifndef __FAST_MATH__ #define math_errhandling (MATH_ERRNO | MATH_ERREXCEPT) #endif #endif /* Use ISO C99. */ #ifdef __USE_GNU /* Return nonzero value if X is a signaling NaN. */ #ifdef __NO_LONG_DOUBLE_MATH #define issignaling(x) \ (sizeof (x) == sizeof (float) ? __issignalingf (x) : __issignaling (x)) #else #define issignaling(x) \ (sizeof (x) == sizeof (float) \ ? __issignalingf (x) \ : sizeof (x) == sizeof (double) \ ? __issignaling (x) : __issignalingl (x)) #endif #endif /* Use GNU. */ #ifdef __USE_MISC /* Support for various different standard error handling behaviors. */ typedef enum { _IEEE_ = -1, /* According to IEEE 754/IEEE 854. */ _SVID_, /* According to System V, release 4. */ _XOPEN_, /* Nowadays also Unix98. */ _POSIX_, _ISOC_ /* Actually this is ISO C99. */ } _LIB_VERSION_TYPE; /* This variable can be changed at run-time to any of the values above to affect floating point error handling behavior (it may also be necessary to change the hardware FPU exception settings). */ extern _LIB_VERSION_TYPE _LIB_VERSION; #endif #ifdef __USE_MISC /* In SVID error handling, `matherr' is called with this description of the exceptional condition. We have a problem when using C++ since `exception' is a reserved name in C++. */ #ifdef __cplusplus struct __exception #else struct exception #endif { int type; char *name; double arg1; double arg2; double retval; }; #ifdef __cplusplus extern int matherr(struct __exception *__exc) throw(); #else extern int matherr(struct exception *__exc); #endif #define X_TLOSS 1.41484755040568800000e+16 /* Types of exceptions in the `type' field. */ #define DOMAIN 1 #define SING 2 #define OVERFLOW 3 #define UNDERFLOW 4 #define TLOSS 5 #define PLOSS 6 /* SVID mode specifies returning this large value instead of infinity. */ #define HUGE 3.40282347e+38F #else /* !Misc. */ #ifdef __USE_XOPEN /* X/Open wants another strange constant. */ #define MAXFLOAT 3.40282347e+38F #endif #endif /* Misc. */ /* Some useful constants. */ #if defined __USE_MISC || defined __USE_XOPEN #define M_E 2.7182818284590452354 /* e */ #define M_LOG2E 1.4426950408889634074 /* log_2 e */ #define M_LOG10E 0.43429448190325182765 /* log_10 e */ #define M_LN2 0.69314718055994530942 /* log_e 2 */ #define M_LN10 2.30258509299404568402 /* log_e 10 */ #define M_PI 3.14159265358979323846 /* pi */ #define M_PI_2 1.57079632679489661923 /* pi/2 */ #define M_PI_4 0.78539816339744830962 /* pi/4 */ #define M_1_PI 0.31830988618379067154 /* 1/pi */ #define M_2_PI 0.63661977236758134308 /* 2/pi */ #define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ #endif /* The above constants are not adequate for computation using `long double's. Therefore we provide as an extension constants with similar names as a GNU extension. Provide enough digits for the 128-bit IEEE quad. */ #ifdef __USE_GNU #define M_El 2.718281828459045235360287471352662498L /* e */ #define M_LOG2El 1.442695040888963407359924681001892137L /* log_2 e */ #define M_LOG10El 0.434294481903251827651128918916605082L /* log_10 e */ #define M_LN2l 0.693147180559945309417232121458176568L /* log_e 2 */ #define M_LN10l 2.302585092994045684017991454684364208L /* log_e 10 */ #define M_PIl 3.141592653589793238462643383279502884L /* pi */ #define M_PI_2l 1.570796326794896619231321691639751442L /* pi/2 */ #define M_PI_4l 0.785398163397448309615660845819875721L /* pi/4 */ #define M_1_PIl 0.318309886183790671537767526745028724L /* 1/pi */ #define M_2_PIl 0.636619772367581343075535053490057448L /* 2/pi */ #define M_2_SQRTPIl 1.128379167095512573896158903121545172L /* 2/sqrt(pi) */ #define M_SQRT2l 1.414213562373095048801688724209698079L /* sqrt(2) */ #define M_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */ #endif /* When compiling in strict ISO C compatible mode we must not use the inline functions since they, among other things, do not set the `errno' variable correctly. */ #if defined __STRICT_ANSI__ && !defined __NO_MATH_INLINES #define __NO_MATH_INLINES 1 #endif #if defined __USE_ISOC99 && __GNUC_PREREQ(2,97) /* ISO C99 defines some macros to compare number while taking care for unordered numbers. Many FPUs provide special instructions to support these operations. Generic support in GCC for these as builtins went in before 3.0.0, but not all cpus added their patterns. We define versions that use the builtins here, and will undef/redefine as appropriate for the specific GCC version in use. */ #define isgreater(x, y) __builtin_isgreater(x, y) #define isgreaterequal(x, y) __builtin_isgreaterequal(x, y) #define isless(x, y) __builtin_isless(x, y) #define islessequal(x, y) __builtin_islessequal(x, y) #define islessgreater(x, y) __builtin_islessgreater(x, y) #define isunordered(u, v) __builtin_isunordered(u, v) #endif /* Get machine-dependent inline versions (if there are any). */ #ifdef __USE_EXTERN_INLINES #include #endif /* Define special entry points to use when the compiler got told to only expect finite results. */ #if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 #include #endif #ifdef __USE_ISOC99 /* If we've still got undefined comparison macros, provide defaults. */ /* Return nonzero value if X is greater than Y. */ #ifndef isgreater #define isgreater(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && __x > __y; })) #endif /* Return nonzero value if X is greater than or equal to Y. */ #ifndef isgreaterequal #define isgreaterequal(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && __x >= __y; })) #endif /* Return nonzero value if X is less than Y. */ #ifndef isless #define isless(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && __x < __y; })) #endif /* Return nonzero value if X is less than or equal to Y. */ #ifndef islessequal #define islessequal(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && __x <= __y; })) #endif /* Return nonzero value if either X is less than Y or Y is less than X. */ #ifndef islessgreater #define islessgreater(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && (__x < __y || __y < __x); })) #endif /* Return nonzero value if arguments are unordered. */ #ifndef isunordered #define isunordered(u, v) \ (__extension__ \ ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \ fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; })) #endif #endif __END_DECLS #endif /* math.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/memory.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * SVID */ #ifndef _MEMORY_H #define _MEMORY_H 1 #include #ifndef _STRING_H #include #endif /* string.h */ #endif /* memory.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/netdb.h ================================================ /* Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* All data returned by the network data base library are supplied in host order and returned in network order (suitable for use in system calls). */ #ifndef _NETDB_H #define _NETDB_H 1 #include #include #include #ifdef __USE_MISC /* This is necessary to make this include file properly replace the Sun version. */ #include #endif #ifdef __USE_GNU #define __need_sigevent_t #include #define __need_timespec #include #endif #include /* Absolute file name for network data base files. */ #define _PATH_HEQUIV "/etc/hosts.equiv" #define _PATH_HOSTS "/etc/hosts" #define _PATH_NETWORKS "/etc/networks" #define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf" #define _PATH_PROTOCOLS "/etc/protocols" #define _PATH_SERVICES "/etc/services" __BEGIN_DECLS #if defined __USE_MISC || !defined __USE_XOPEN2K8 /* Error status for non-reentrant lookup functions. We use a macro to access always the thread-specific `h_errno' variable. */ #define h_errno (*__h_errno_location ()) /* Function to get address of global `h_errno' variable. */ extern int *__h_errno_location(void) __THROW __attribute__ ((__const__)); /* Possible values left in `h_errno'. */ #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found. */ #define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL. */ #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP. */ #define NO_DATA 4 /* Valid name, no data record of requested type. */ #endif #ifdef __USE_MISC #define NETDB_INTERNAL -1 /* See errno. */ #define NETDB_SUCCESS 0 /* No problem. */ #define NO_ADDRESS NO_DATA /* No address, look for MX record. */ #endif #if defined __USE_XOPEN2K || defined __USE_XOPEN_EXTENDED /* Highest reserved Internet port number. */ #define IPPORT_RESERVED 1024 #endif #ifdef __USE_GNU /* Scope delimiter for getaddrinfo(), getnameinfo(). */ #define SCOPE_DELIMITER '%' #endif #ifdef __USE_MISC /* Print error indicated by `h_errno' variable on standard error. STR if non-null is printed before the error string. */ extern void herror(const char *__str) __THROW; /* Return string associated with error ERR_NUM. */ extern const char *hstrerror(int __err_num) __THROW; #endif /* Description of data base entry for a single host. */ struct hostent { char *h_name; /* Official name of host. */ char **h_aliases; /* Alias list. */ int h_addrtype; /* Host address type. */ int h_length; /* Length of address. */ char **h_addr_list; /* List of addresses from name server. */ #ifdef __USE_MISC #define h_addr h_addr_list[0] /* Address, for backward compatibility. */ #endif }; /* Open host data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void sethostent(int __stay_open); /* Close host data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endhostent(void); /* Get next entry from host data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostent(void); /* Return entry from host data base which address match ADDR with length LEN and type TYPE. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostbyaddr(const void *__addr, __socklen_t __len, int __type); /* Return entry from host data base for host with NAME. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostbyname(const char *__name); #ifdef __USE_MISC /* Return entry from host data base for host with NAME. AF must be set to the address type which is `AF_INET' for IPv4 or `AF_INET6' for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostbyname2(const char *__name, int __af); /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. The last argument is a pointer to a variable which gets the value which would be stored in the global variable `herrno' by the non-reentrant functions. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int gethostent_r(struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); extern int gethostbyaddr_r(const void *__restrict __addr, __socklen_t __len, int __type, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); extern int gethostbyname_r(const char *__restrict __name, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); extern int gethostbyname2_r(const char *__restrict __name, int __af, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); #endif /* misc */ /* Open network data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setnetent(int __stay_open); /* Close network data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endnetent(void); /* Get next entry from network data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct netent *getnetent(void); /* Return entry from network data base which address match NET and type TYPE. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct netent *getnetbyaddr(uint32_t __net, int __type); /* Return entry from network data base for network with NAME. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct netent *getnetbyname(const char *__name); #ifdef __USE_MISC /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. The last argument is a pointer to a variable which gets the value which would be stored in the global variable `herrno' by the non-reentrant functions. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int getnetent_r(struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); extern int getnetbyaddr_r(uint32_t __net, int __type, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); extern int getnetbyname_r(const char *__restrict __name, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); #endif /* misc */ /* Description of data base entry for a single service. */ struct servent { char *s_name; /* Official service name. */ char **s_aliases; /* Alias list. */ int s_port; /* Port number. */ char *s_proto; /* Protocol to use. */ }; /* Open service data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setservent(int __stay_open); /* Close service data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endservent(void); /* Get next entry from service data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct servent *getservent(void); /* Return entry from network data base for network with NAME and protocol PROTO. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct servent *getservbyname(const char *__name, const char *__proto); /* Return entry from service data base which matches port PORT and protocol PROTO. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct servent *getservbyport(int __port, const char *__proto); #ifdef __USE_MISC /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int getservent_r(struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); extern int getservbyname_r(const char *__restrict __name, const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); extern int getservbyport_r(int __port, const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); #endif /* misc */ /* Description of data base entry for a single service. */ struct protoent { char *p_name; /* Official protocol name. */ char **p_aliases; /* Alias list. */ int p_proto; /* Protocol number. */ }; /* Open protocol data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setprotoent(int __stay_open); /* Close protocol data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endprotoent(void); /* Get next entry from protocol data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct protoent *getprotoent(void); /* Return entry from protocol data base for network with NAME. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct protoent *getprotobyname(const char *__name); /* Return entry from protocol data base which number is PROTO. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct protoent *getprotobynumber(int __proto); #ifdef __USE_MISC /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int getprotoent_r(struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); extern int getprotobyname_r(const char *__restrict __name, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); extern int getprotobynumber_r(int __proto, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); /* Establish network group NETGROUP for enumeration. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int setnetgrent(const char *__netgroup); /* Free all space allocated by previous `setnetgrent' call. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern void endnetgrent(void); /* Get next member of netgroup established by last `setnetgrent' call and return pointers to elements in HOSTP, USERP, and DOMAINP. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getnetgrent(char **__restrict __hostp, char **__restrict __userp, char **__restrict __domainp); /* Test whether NETGROUP contains the triple (HOST,USER,DOMAIN). This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int innetgr(const char *__netgroup, const char *__host, const char *__user, const char *__domain); /* Reentrant version of `getnetgrent' where result is placed in BUFFER. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getnetgrent_r(char **__restrict __hostp, char **__restrict __userp, char **__restrict __domainp, char *__restrict __buffer, size_t __buflen); #endif /* misc */ #ifdef __USE_MISC /* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD. The local user is LOCUSER, on the remote machine the command is executed as REMUSER. In *FD2P the descriptor to the socket for the connection is returned. The caller must have the right to use a reserved port. When the function returns *AHOST contains the official host name. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rcmd(char **__restrict __ahost, unsigned short int __rport, const char *__restrict __locuser, const char *__restrict __remuser, const char *__restrict __cmd, int *__restrict __fd2p); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rcmd_af(char **__restrict __ahost, unsigned short int __rport, const char *__restrict __locuser, const char *__restrict __remuser, const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af); /* Call `rexecd' at port RPORT on remote machine *AHOST to execute CMD. The process runs at the remote machine using the ID of user NAME whose cleartext password is PASSWD. In *FD2P the descriptor to the socket for the connection is returned. When the function returns *AHOST contains the official host name. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rexec(char **__restrict __ahost, int __rport, const char *__restrict __name, const char *__restrict __pass, const char *__restrict __cmd, int *__restrict __fd2p); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rexec_af(char **__restrict __ahost, int __rport, const char *__restrict __name, const char *__restrict __pass, const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af); /* Check whether user REMUSER on system RHOST is allowed to login as LOCUSER. If SUSER is not zero the user tries to become superuser. Return 0 if it is possible. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int ruserok(const char *__rhost, int __suser, const char *__remuser, const char *__locuser); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int ruserok_af(const char *__rhost, int __suser, const char *__remuser, const char *__locuser, sa_family_t __af); /* Check whether user REMUSER on system indicated by IPv4 address RADDR is allowed to login as LOCUSER. Non-IPv4 (e.g., IPv6) are not supported. If SUSER is not zero the user tries to become superuser. Return 0 if it is possible. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int iruserok(uint32_t __raddr, int __suser, const char *__remuser, const char *__locuser); /* This is the equivalent function where the pfamiliy if the address pointed to by RADDR is determined by the value of AF. It therefore can be used for IPv6 This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int iruserok_af(const void *__raddr, int __suser, const char *__remuser, const char *__locuser, sa_family_t __af); /* Try to allocate reserved port, returning a descriptor for a socket opened at this port or -1 if unsuccessful. The search for an available port will start at ALPORT and continues with lower numbers. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rresvport(int *__alport); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rresvport_af(int *__alport, sa_family_t __af); #endif /* Extension from POSIX.1:2001. */ #ifdef __USE_XOPEN2K /* Structure to contain information about address of a service provider. */ struct addrinfo { int ai_flags; /* Input flags. */ int ai_family; /* Protocol family for socket. */ int ai_socktype; /* Socket type. */ int ai_protocol; /* Protocol for socket. */ socklen_t ai_addrlen; /* Length of socket address. */ struct sockaddr *ai_addr; /* Socket address for socket. */ char *ai_canonname; /* Canonical name for service location. */ struct addrinfo *ai_next; /* Pointer to next in list. */ }; #ifdef __USE_GNU /* Structure used as control block for asynchronous lookup. */ struct gaicb { const char *ar_name; /* Name to look up. */ const char *ar_service; /* Service name. */ const struct addrinfo *ar_request; /* Additional request specification. */ struct addrinfo *ar_result; /* Pointer to result. */ /* The following are internal elements. */ int __return; int __glibc_reserved[5]; }; /* Lookup mode. */ #define GAI_WAIT 0 #define GAI_NOWAIT 1 #endif /* Possible values for `ai_flags' field in `addrinfo' structure. */ #define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */ #define AI_CANONNAME 0x0002 /* Request for canonical name. */ #define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */ #define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */ #define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */ #define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose returned address type.. */ #ifdef __USE_GNU #define AI_IDN 0x0040 /* IDN encode input (assuming it is encoded in the current locale's character set) before looking it up. */ #define AI_CANONIDN 0x0080 /* Translate canonical name from IDN format. */ #define AI_IDN_ALLOW_UNASSIGNED 0x0100 /* Don't reject unassigned Unicode code points. */ #define AI_IDN_USE_STD3_ASCII_RULES 0x0200 /* Validate strings according to STD3 rules. */ #endif #define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */ /* Error values for `getaddrinfo' function. */ #define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */ #define EAI_NONAME -2 /* NAME or SERVICE is unknown. */ #define EAI_AGAIN -3 /* Temporary failure in name resolution. */ #define EAI_FAIL -4 /* Non-recoverable failure in name res. */ #define EAI_FAMILY -6 /* `ai_family' not supported. */ #define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */ #define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */ #define EAI_MEMORY -10 /* Memory allocation failure. */ #define EAI_SYSTEM -11 /* System error returned in `errno'. */ #define EAI_OVERFLOW -12 /* Argument buffer overflow. */ #ifdef __USE_GNU #define EAI_NODATA -5 /* No address associated with NAME. */ #define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */ #define EAI_INPROGRESS -100 /* Processing request in progress. */ #define EAI_CANCELED -101 /* Request canceled. */ #define EAI_NOTCANCELED -102 /* Request not canceled. */ #define EAI_ALLDONE -103 /* All requests done. */ #define EAI_INTR -104 /* Interrupted by a signal. */ #define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ #endif #ifdef __USE_MISC #define NI_MAXHOST 1025 #define NI_MAXSERV 32 #endif #define NI_NUMERICHOST 1 /* Don't try to look up hostname. */ #define NI_NUMERICSERV 2 /* Don't convert port number to name. */ #define NI_NOFQDN 4 /* Only return nodename portion. */ #define NI_NAMEREQD 8 /* Don't return numeric addresses. */ #define NI_DGRAM 16 /* Look up UDP service rather than TCP. */ #ifdef __USE_GNU #define NI_IDN 32 /* Convert name from IDN format. */ #define NI_IDN_ALLOW_UNASSIGNED 64 /* Don't reject unassigned Unicode code points. */ #define NI_IDN_USE_STD3_ASCII_RULES 128 /* Validate strings according to STD3 rules. */ #endif /* Translate name of a service location and/or a service name to set of socket addresses. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getaddrinfo(const char *__restrict __name, const char *__restrict __service, const struct addrinfo *__restrict __req, struct addrinfo **__restrict __pai); /* Free `addrinfo' structure AI including associated storage. */ extern void freeaddrinfo(struct addrinfo *__ai) __THROW; /* Convert error return from getaddrinfo() to a string. */ extern const char *gai_strerror(int __ecode) __THROW; /* Translate a socket address to a location and service name. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getnameinfo(const struct sockaddr *__restrict __sa, socklen_t __salen, char *__restrict __host, socklen_t __hostlen, char *__restrict __serv, socklen_t __servlen, int __flags); #endif /* POSIX */ #ifdef __USE_GNU /* Enqueue ENT requests from the LIST. If MODE is GAI_WAIT wait until all requests are handled. If WAIT is GAI_NOWAIT return immediately after queueing the requests and signal completion according to SIG. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getaddrinfo_a(int __mode, struct gaicb *__list[__restrict_arr], int __ent, struct sigevent *__restrict __sig); /* Suspend execution of the thread until at least one of the ENT requests in LIST is handled. If TIMEOUT is not a null pointer it specifies the longest time the function keeps waiting before returning with an error. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int gai_suspend(const struct gaicb *const __list[], int __ent, const struct timespec *__timeout); /* Get the error status of the request REQ. */ extern int gai_error(struct gaicb *__req) __THROW; /* Cancel the requests associated with GAICBP. */ extern int gai_cancel(struct gaicb *__gaicbp) __THROW; #endif /* GNU */ __END_DECLS #endif /* netdb.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/netinet/in.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _NETINET_IN_H #define _NETINET_IN_H 1 #include #include #include #include __BEGIN_DECLS /* Internet address. */ typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr; }; /* Get system-specific definitions. */ #include /* Standard well-defined IP protocols. */ enum { IPPROTO_IP = 0, /* Dummy protocol for TCP. */ #define IPPROTO_IP IPPROTO_IP IPPROTO_ICMP = 1, /* Internet Control Message Protocol. */ #define IPPROTO_ICMP IPPROTO_ICMP IPPROTO_IGMP = 2, /* Internet Group Management Protocol. */ #define IPPROTO_IGMP IPPROTO_IGMP IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94). */ #define IPPROTO_IPIP IPPROTO_IPIP IPPROTO_TCP = 6, /* Transmission Control Protocol. */ #define IPPROTO_TCP IPPROTO_TCP IPPROTO_EGP = 8, /* Exterior Gateway Protocol. */ #define IPPROTO_EGP IPPROTO_EGP IPPROTO_PUP = 12, /* PUP protocol. */ #define IPPROTO_PUP IPPROTO_PUP IPPROTO_UDP = 17, /* User Datagram Protocol. */ #define IPPROTO_UDP IPPROTO_UDP IPPROTO_IDP = 22, /* XNS IDP protocol. */ #define IPPROTO_IDP IPPROTO_IDP IPPROTO_TP = 29, /* SO Transport Protocol Class 4. */ #define IPPROTO_TP IPPROTO_TP IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol. */ #define IPPROTO_DCCP IPPROTO_DCCP IPPROTO_IPV6 = 41, /* IPv6 header. */ #define IPPROTO_IPV6 IPPROTO_IPV6 IPPROTO_RSVP = 46, /* Reservation Protocol. */ #define IPPROTO_RSVP IPPROTO_RSVP IPPROTO_GRE = 47, /* General Routing Encapsulation. */ #define IPPROTO_GRE IPPROTO_GRE IPPROTO_ESP = 50, /* encapsulating security payload. */ #define IPPROTO_ESP IPPROTO_ESP IPPROTO_AH = 51, /* authentication header. */ #define IPPROTO_AH IPPROTO_AH IPPROTO_MTP = 92, /* Multicast Transport Protocol. */ #define IPPROTO_MTP IPPROTO_MTP IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET. */ #define IPPROTO_BEETPH IPPROTO_BEETPH IPPROTO_ENCAP = 98, /* Encapsulation Header. */ #define IPPROTO_ENCAP IPPROTO_ENCAP IPPROTO_PIM = 103, /* Protocol Independent Multicast. */ #define IPPROTO_PIM IPPROTO_PIM IPPROTO_COMP = 108, /* Compression Header Protocol. */ #define IPPROTO_COMP IPPROTO_COMP IPPROTO_SCTP = 132, /* Stream Control Transmission Protocol. */ #define IPPROTO_SCTP IPPROTO_SCTP IPPROTO_UDPLITE = 136, /* UDP-Lite protocol. */ #define IPPROTO_UDPLITE IPPROTO_UDPLITE IPPROTO_MPLS = 137, /* MPLS in IP. */ #define IPPROTO_MPLS IPPROTO_MPLS IPPROTO_RAW = 255, /* Raw IP packets. */ #define IPPROTO_RAW IPPROTO_RAW IPPROTO_MAX }; /* If __USE_KERNEL_IPV6_DEFS is 1 then the user has included the kernel network headers first and we should use those ABI-identical definitions instead of our own, otherwise 0. */ #if !__USE_KERNEL_IPV6_DEFS enum { IPPROTO_HOPOPTS = 0, /* IPv6 Hop-by-Hop options. */ #define IPPROTO_HOPOPTS IPPROTO_HOPOPTS IPPROTO_ROUTING = 43, /* IPv6 routing header. */ #define IPPROTO_ROUTING IPPROTO_ROUTING IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header. */ #define IPPROTO_FRAGMENT IPPROTO_FRAGMENT IPPROTO_ICMPV6 = 58, /* ICMPv6. */ #define IPPROTO_ICMPV6 IPPROTO_ICMPV6 IPPROTO_NONE = 59, /* IPv6 no next header. */ #define IPPROTO_NONE IPPROTO_NONE IPPROTO_DSTOPTS = 60, /* IPv6 destination options. */ #define IPPROTO_DSTOPTS IPPROTO_DSTOPTS IPPROTO_MH = 135 /* IPv6 mobility header. */ #define IPPROTO_MH IPPROTO_MH }; #endif /* !__USE_KERNEL_IPV6_DEFS */ /* Type to represent a port. */ typedef uint16_t in_port_t; /* Standard well-known ports. */ enum { IPPORT_ECHO = 7, /* Echo service. */ IPPORT_DISCARD = 9, /* Discard transmissions service. */ IPPORT_SYSTAT = 11, /* System status service. */ IPPORT_DAYTIME = 13, /* Time of day service. */ IPPORT_NETSTAT = 15, /* Network status service. */ IPPORT_FTP = 21, /* File Transfer Protocol. */ IPPORT_TELNET = 23, /* Telnet protocol. */ IPPORT_SMTP = 25, /* Simple Mail Transfer Protocol. */ IPPORT_TIMESERVER = 37, /* Timeserver service. */ IPPORT_NAMESERVER = 42, /* Domain Name Service. */ IPPORT_WHOIS = 43, /* Internet Whois service. */ IPPORT_MTP = 57, IPPORT_TFTP = 69, /* Trivial File Transfer Protocol. */ IPPORT_RJE = 77, IPPORT_FINGER = 79, /* Finger service. */ IPPORT_TTYLINK = 87, IPPORT_SUPDUP = 95, /* SUPDUP protocol. */ IPPORT_EXECSERVER = 512, /* execd service. */ IPPORT_LOGINSERVER = 513, /* rlogind service. */ IPPORT_CMDSERVER = 514, IPPORT_EFSSERVER = 520, /* UDP ports. */ IPPORT_BIFFUDP = 512, IPPORT_WHOSERVER = 513, IPPORT_ROUTESERVER = 520, /* Ports less than this value are reserved for privileged processes. */ IPPORT_RESERVED = 1024, /* Ports greater this value are reserved for (non-privileged) servers. */ IPPORT_USERRESERVED = 5000 }; /* Definitions of the bits in an Internet address integer. On subnets, host and network parts are found according to the subnet mask, not these masks. */ #define IN_CLASSA(a) ((((in_addr_t)(a)) & 0x80000000) == 0) #define IN_CLASSA_NET 0xff000000 #define IN_CLASSA_NSHIFT 24 #define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET) #define IN_CLASSA_MAX 128 #define IN_CLASSB(a) ((((in_addr_t)(a)) & 0xc0000000) == 0x80000000) #define IN_CLASSB_NET 0xffff0000 #define IN_CLASSB_NSHIFT 16 #define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET) #define IN_CLASSB_MAX 65536 #define IN_CLASSC(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000) #define IN_CLASSC_NET 0xffffff00 #define IN_CLASSC_NSHIFT 8 #define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET) #define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000) #define IN_MULTICAST(a) IN_CLASSD(a) #define IN_EXPERIMENTAL(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000) #define IN_BADCLASS(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000) /* Address to accept any incoming messages. */ #define INADDR_ANY ((in_addr_t) 0x00000000) /* Address to send to all hosts. */ #define INADDR_BROADCAST ((in_addr_t) 0xffffffff) /* Address indicating an error return. */ #define INADDR_NONE ((in_addr_t) 0xffffffff) /* Network number for local host loopback. */ #define IN_LOOPBACKNET 127 /* Address to loopback in software to local host. */ #ifndef INADDR_LOOPBACK #define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) /* Inet 127.0.0.1. */ #endif /* Defines for Multicast INADDR. */ #define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) /* 224.0.0.0 */ #define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001) /* 224.0.0.1 */ #define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002) /* 224.0.0.2 */ #define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */ #if !__USE_KERNEL_IPV6_DEFS /* IPv6 address */ struct in6_addr { union { uint8_t __u6_addr8[16]; #ifdef __USE_MISC uint16_t __u6_addr16[8]; uint32_t __u6_addr32[4]; #endif } __in6_u; #define s6_addr __in6_u.__u6_addr8 #ifdef __USE_MISC #define s6_addr16 __in6_u.__u6_addr16 #define s6_addr32 __in6_u.__u6_addr32 #endif }; #endif /* !__USE_KERNEL_IPV6_DEFS */ extern const struct in6_addr in6addr_any; /* :: */ extern const struct in6_addr in6addr_loopback; /* ::1 */ #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } #define INET_ADDRSTRLEN 16 #define INET6_ADDRSTRLEN 46 /* Structure describing an Internet socket address. */ struct sockaddr_in { __SOCKADDR_COMMON(sin_); in_port_t sin_port; /* Port number. */ struct in_addr sin_addr; /* Internet address. */ /* Pad to size of `struct sockaddr'. */ unsigned char sin_zero[sizeof(struct sockaddr) - __SOCKADDR_COMMON_SIZE - sizeof(in_port_t) - sizeof(struct in_addr)]; }; #if !__USE_KERNEL_IPV6_DEFS /* Ditto, for IPv6. */ struct sockaddr_in6 { __SOCKADDR_COMMON(sin6_); in_port_t sin6_port; /* Transport layer port # */ uint32_t sin6_flowinfo; /* IPv6 flow information */ struct in6_addr sin6_addr; /* IPv6 address */ uint32_t sin6_scope_id; /* IPv6 scope-id */ }; #endif /* !__USE_KERNEL_IPV6_DEFS */ #ifdef __USE_MISC /* IPv4 multicast request. */ struct ip_mreq { /* IP multicast address of group. */ struct in_addr imr_multiaddr; /* Local IP address of interface. */ struct in_addr imr_interface; }; struct ip_mreq_source { /* IP multicast address of group. */ struct in_addr imr_multiaddr; /* IP address of source. */ struct in_addr imr_interface; /* IP address of interface. */ struct in_addr imr_sourceaddr; }; #endif #if !__USE_KERNEL_IPV6_DEFS /* Likewise, for IPv6. */ struct ipv6_mreq { /* IPv6 multicast address of group */ struct in6_addr ipv6mr_multiaddr; /* local interface */ unsigned int ipv6mr_interface; }; #endif /* !__USE_KERNEL_IPV6_DEFS */ #ifdef __USE_MISC /* Multicast group request. */ struct group_req { /* Interface index. */ uint32_t gr_interface; /* Group address. */ struct sockaddr_storage gr_group; }; struct group_source_req { /* Interface index. */ uint32_t gsr_interface; /* Group address. */ struct sockaddr_storage gsr_group; /* Source address. */ struct sockaddr_storage gsr_source; }; /* Full-state filter operations. */ struct ip_msfilter { /* IP multicast address of group. */ struct in_addr imsf_multiaddr; /* Local IP address of interface. */ struct in_addr imsf_interface; /* Filter mode. */ uint32_t imsf_fmode; /* Number of source addresses. */ uint32_t imsf_numsrc; /* Source addresses. */ struct in_addr imsf_slist[1]; }; #define IP_MSFILTER_SIZE(numsrc) (sizeof (struct ip_msfilter) \ - sizeof (struct in_addr) \ + (numsrc) * sizeof (struct in_addr)) struct group_filter { /* Interface index. */ uint32_t gf_interface; /* Group address. */ struct sockaddr_storage gf_group; /* Filter mode. */ uint32_t gf_fmode; /* Number of source addresses. */ uint32_t gf_numsrc; /* Source addresses. */ struct sockaddr_storage gf_slist[1]; }; #define GROUP_FILTER_SIZE(numsrc) (sizeof (struct group_filter) \ - sizeof (struct sockaddr_storage) \ + ((numsrc) \ * sizeof (struct sockaddr_storage))) #endif /* Functions to convert between host and network byte order. Please note that these functions normally take `unsigned long int' or `unsigned short int' values as arguments and also return them. But this was a short-sighted decision since on different systems the types may have different representations but the values are always the same. */ extern uint32_t ntohl(uint32_t __netlong) __THROW __attribute__ ((__const__)); extern uint16_t ntohs(uint16_t __netshort) __THROW __attribute__ ((__const__)); extern uint32_t htonl(uint32_t __hostlong) __THROW __attribute__ ((__const__)); extern uint16_t htons(uint16_t __hostshort) __THROW __attribute__ ((__const__)); #include /* Get machine dependent optimized versions of byte swapping functions. */ #include #ifdef __OPTIMIZE__ /* We can optimize calls to the conversion functions. Either nothing has to be done or we are using directly the byte-swapping functions which often can be inlined. */ #if __BYTE_ORDER == __BIG_ENDIAN /* The host byte order is the same as network byte order, so these functions are all just identity. */ #define ntohl(x) (x) #define ntohs(x) (x) #define htonl(x) (x) #define htons(x) (x) #else #if __BYTE_ORDER == __LITTLE_ENDIAN #define ntohl(x) __bswap_32 (x) #define ntohs(x) __bswap_16 (x) #define htonl(x) __bswap_32 (x) #define htons(x) __bswap_16 (x) #endif #endif #endif #ifdef __GNUC__ #define IN6_IS_ADDR_UNSPECIFIED(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ __a->s6_addr32[0] == 0 \ && __a->s6_addr32[1] == 0 \ && __a->s6_addr32[2] == 0 \ && __a->s6_addr32[3] == 0; })) #define IN6_IS_ADDR_LOOPBACK(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ __a->s6_addr32[0] == 0 \ && __a->s6_addr32[1] == 0 \ && __a->s6_addr32[2] == 0 \ && __a->s6_addr32[3] == htonl (1); })) #define IN6_IS_ADDR_LINKLOCAL(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ (__a->s6_addr32[0] & htonl (0xffc00000)) == htonl (0xfe800000); })) #define IN6_IS_ADDR_SITELOCAL(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ (__a->s6_addr32[0] & htonl (0xffc00000)) == htonl (0xfec00000); })) #define IN6_IS_ADDR_V4MAPPED(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ __a->s6_addr32[0] == 0 \ && __a->s6_addr32[1] == 0 \ && __a->s6_addr32[2] == htonl (0xffff); })) #define IN6_IS_ADDR_V4COMPAT(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ __a->s6_addr32[0] == 0 \ && __a->s6_addr32[1] == 0 \ && __a->s6_addr32[2] == 0 \ && ntohl (__a->s6_addr32[3]) > 1; })) #define IN6_ARE_ADDR_EQUAL(a,b) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ const struct in6_addr *__b = (const struct in6_addr *) (b); \ __a->s6_addr32[0] == __b->s6_addr32[0] \ && __a->s6_addr32[1] == __b->s6_addr32[1] \ && __a->s6_addr32[2] == __b->s6_addr32[2] \ && __a->s6_addr32[3] == __b->s6_addr32[3]; })) #else #define IN6_IS_ADDR_UNSPECIFIED(a) \ (((const uint32_t *) (a))[0] == 0 \ && ((const uint32_t *) (a))[1] == 0 \ && ((const uint32_t *) (a))[2] == 0 \ && ((const uint32_t *) (a))[3] == 0) #define IN6_IS_ADDR_LOOPBACK(a) \ (((const uint32_t *) (a))[0] == 0 \ && ((const uint32_t *) (a))[1] == 0 \ && ((const uint32_t *) (a))[2] == 0 \ && ((const uint32_t *) (a))[3] == htonl (1)) #define IN6_IS_ADDR_LINKLOCAL(a) \ ((((const uint32_t *) (a))[0] & htonl (0xffc00000)) \ == htonl (0xfe800000)) #define IN6_IS_ADDR_SITELOCAL(a) \ ((((const uint32_t *) (a))[0] & htonl (0xffc00000)) \ == htonl (0xfec00000)) #define IN6_IS_ADDR_V4MAPPED(a) \ ((((const uint32_t *) (a))[0] == 0) \ && (((const uint32_t *) (a))[1] == 0) \ && (((const uint32_t *) (a))[2] == htonl (0xffff))) #define IN6_IS_ADDR_V4COMPAT(a) \ ((((const uint32_t *) (a))[0] == 0) \ && (((const uint32_t *) (a))[1] == 0) \ && (((const uint32_t *) (a))[2] == 0) \ && (ntohl (((const uint32_t *) (a))[3]) > 1)) #define IN6_ARE_ADDR_EQUAL(a,b) \ ((((const uint32_t *) (a))[0] == ((const uint32_t *) (b))[0]) \ && (((const uint32_t *) (a))[1] == ((const uint32_t *) (b))[1]) \ && (((const uint32_t *) (a))[2] == ((const uint32_t *) (b))[2]) \ && (((const uint32_t *) (a))[3] == ((const uint32_t *) (b))[3])) #endif #define IN6_IS_ADDR_MULTICAST(a) (((const uint8_t *) (a))[0] == 0xff) #ifdef __USE_MISC /* Bind socket to a privileged IP port. */ extern int bindresvport(int __sockfd, struct sockaddr_in *__sock_in) __THROW; /* The IPv6 version of this function. */ extern int bindresvport6(int __sockfd, struct sockaddr_in6 *__sock_in) __THROW; #endif #define IN6_IS_ADDR_MC_NODELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0x1)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0x2)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0x5)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0x8)) #define IN6_IS_ADDR_MC_GLOBAL(a) \ (IN6_IS_ADDR_MULTICAST(a) \ && ((((const uint8_t *) (a))[1] & 0xf) == 0xe)) #ifdef __USE_GNU struct cmsghdr; /* Forward declaration. */ #if !__USE_KERNEL_IPV6_DEFS /* IPv6 packet information. */ struct in6_pktinfo { struct in6_addr ipi6_addr; /* src/dst IPv6 address */ unsigned int ipi6_ifindex; /* send/recv interface index */ }; /* IPv6 MTU information. */ struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; /* dst address including zone ID */ uint32_t ip6m_mtu; /* path MTU in host byte order */ }; #endif /* !__USE_KERNEL_IPV6_DEFS */ /* Obsolete hop-by-hop and Destination Options Processing (RFC 2292). */ extern int inet6_option_space(int __nbytes) __THROW __attribute_deprecated__; extern int inet6_option_init(void *__bp, struct cmsghdr **__cmsgp, int __type) __THROW __attribute_deprecated__; extern int inet6_option_append(struct cmsghdr *__cmsg, const uint8_t * __typep, int __multx, int __plusy) __THROW __attribute_deprecated__; extern uint8_t *inet6_option_alloc(struct cmsghdr *__cmsg, int __datalen, int __multx, int __plusy) __THROW __attribute_deprecated__; extern int inet6_option_next(const struct cmsghdr *__cmsg, uint8_t ** __tptrp) __THROW __attribute_deprecated__; extern int inet6_option_find(const struct cmsghdr *__cmsg, uint8_t ** __tptrp, int __type) __THROW __attribute_deprecated__; /* Hop-by-Hop and Destination Options Processing (RFC 3542). */ extern int inet6_opt_init(void *__extbuf, socklen_t __extlen) __THROW; extern int inet6_opt_append(void *__extbuf, socklen_t __extlen, int __offset, uint8_t __type, socklen_t __len, uint8_t __align, void **__databufp) __THROW; extern int inet6_opt_finish(void *__extbuf, socklen_t __extlen, int __offset) __THROW; extern int inet6_opt_set_val(void *__databuf, int __offset, void *__val, socklen_t __vallen) __THROW; extern int inet6_opt_next(void *__extbuf, socklen_t __extlen, int __offset, uint8_t * __typep, socklen_t * __lenp, void **__databufp) __THROW; extern int inet6_opt_find(void *__extbuf, socklen_t __extlen, int __offset, uint8_t __type, socklen_t * __lenp, void **__databufp) __THROW; extern int inet6_opt_get_val(void *__databuf, int __offset, void *__val, socklen_t __vallen) __THROW; /* Routing Header Option (RFC 3542). */ extern socklen_t inet6_rth_space(int __type, int __segments) __THROW; extern void *inet6_rth_init(void *__bp, socklen_t __bp_len, int __type, int __segments) __THROW; extern int inet6_rth_add(void *__bp, const struct in6_addr *__addr) __THROW; extern int inet6_rth_reverse(const void *__in, void *__out) __THROW; extern int inet6_rth_segments(const void *__bp) __THROW; extern struct in6_addr *inet6_rth_getaddr(const void *__bp, int __index) __THROW; /* Multicast source filter support. */ /* Get IPv4 source filter. */ extern int getipv4sourcefilter(int __s, struct in_addr __interface_addr, struct in_addr __group, uint32_t * __fmode, uint32_t * __numsrc, struct in_addr *__slist) __THROW; /* Set IPv4 source filter. */ extern int setipv4sourcefilter(int __s, struct in_addr __interface_addr, struct in_addr __group, uint32_t __fmode, uint32_t __numsrc, const struct in_addr *__slist) __THROW; /* Get source filter. */ extern int getsourcefilter(int __s, uint32_t __interface_addr, const struct sockaddr *__group, socklen_t __grouplen, uint32_t * __fmode, uint32_t * __numsrc, struct sockaddr_storage *__slist) __THROW; /* Set source filter. */ extern int setsourcefilter(int __s, uint32_t __interface_addr, const struct sockaddr *__group, socklen_t __grouplen, uint32_t __fmode, uint32_t __numsrc, const struct sockaddr_storage *__slist) __THROW; #endif /* use GNU */ __END_DECLS #endif /* netinet/in.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/pthread.h ================================================ /* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _PTHREAD_H #define _PTHREAD_H 1 #include #include #include #include #include #include #include /* Detach state. */ enum { PTHREAD_CREATE_JOINABLE, #define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_DETACHED #define PTHREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED }; /* Mutex types. */ enum { PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_ADAPTIVE_NP #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 , PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL #endif #ifdef __USE_GNU /* For compatibility. */ , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP #endif }; #ifdef __USE_XOPEN2K /* Robust mutex or not flags. */ enum { PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_ROBUST, PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST }; #endif #if defined __USE_POSIX199506 || defined __USE_UNIX98 /* Mutex protocols. */ enum { PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT }; #endif #ifdef __PTHREAD_MUTEX_HAVE_PREV #define PTHREAD_MUTEX_INITIALIZER \ { { 0, 0, 0, 0, 0, __PTHREAD_SPINS, { 0, 0 } } } #ifdef __USE_GNU #define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, __PTHREAD_SPINS, { 0, 0 } } } #define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, __PTHREAD_SPINS, { 0, 0 } } } #define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, __PTHREAD_SPINS, { 0, 0 } } } #endif #else #define PTHREAD_MUTEX_INITIALIZER \ { { 0, 0, 0, 0, 0, { __PTHREAD_SPINS } } } #ifdef __USE_GNU #define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { __PTHREAD_SPINS } } } #define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { __PTHREAD_SPINS } } } #define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { __PTHREAD_SPINS } } } #endif #endif /* Read-write lock types. */ #if defined __USE_UNIX98 || defined __USE_XOPEN2K enum { PTHREAD_RWLOCK_PREFER_READER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP }; /* Define __PTHREAD_RWLOCK_INT_FLAGS_SHARED to 1 if pthread_rwlock_t has the shared field. All 64-bit architectures have the shared field in pthread_rwlock_t. */ #ifndef __PTHREAD_RWLOCK_INT_FLAGS_SHARED #if __WORDSIZE == 64 #define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 #endif #endif /* Read-write lock initializers. */ #define PTHREAD_RWLOCK_INITIALIZER \ { { 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0 } } #ifdef __USE_GNU #ifdef __PTHREAD_RWLOCK_INT_FLAGS_SHARED #define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, \ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } #else #if __BYTE_ORDER == __LITTLE_ENDIAN #define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \ 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0 } } #else #define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\ 0 } } #endif #endif #endif #endif /* Unix98 or XOpen2K */ /* Scheduler inheritance. */ enum { PTHREAD_INHERIT_SCHED, #define PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED PTHREAD_EXPLICIT_SCHED #define PTHREAD_EXPLICIT_SCHED PTHREAD_EXPLICIT_SCHED }; /* Scope handling. */ enum { PTHREAD_SCOPE_SYSTEM, #define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_PROCESS #define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS }; /* Process shared or private flag. */ enum { PTHREAD_PROCESS_PRIVATE, #define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_SHARED #define PTHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED }; /* Conditional variable handling. */ #define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } } /* Cleanup buffers */ struct _pthread_cleanup_buffer { void (*__routine) (void *); /* Function to call. */ void *__arg; /* Its argument. */ int __canceltype; /* Saved cancellation type. */ struct _pthread_cleanup_buffer *__prev; /* Chaining of cleanup functions. */ }; /* Cancellation */ enum { PTHREAD_CANCEL_ENABLE, #define PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_DISABLE #define PTHREAD_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE }; enum { PTHREAD_CANCEL_DEFERRED, #define PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_ASYNCHRONOUS #define PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS }; #define PTHREAD_CANCELED ((void *) -1) /* Single execution handling. */ #define PTHREAD_ONCE_INIT 0 #ifdef __USE_XOPEN2K /* Value returned by 'pthread_barrier_wait' for one of the threads after the required number of threads have called this function. -1 is distinct from 0 and all errno constants */ #define PTHREAD_BARRIER_SERIAL_THREAD -1 #endif __BEGIN_DECLS /* Create a new thread, starting with execution of START-ROUTINE getting passed ARG. Creation attributed come from ATTR. The new handle is stored in *NEWTHREAD. */ extern int pthread_create(pthread_t * __restrict __newthread, const pthread_attr_t * __restrict __attr, void *(*__start_routine) (void *), void *__restrict __arg) __THROWNL __nonnull((1, 3)); /* Terminate calling thread. The registered cleanup handlers are called via exception handling so we cannot mark this function with __THROW.*/ extern void pthread_exit(void *__retval) __attribute__ ((__noreturn__)); /* Make calling thread wait for termination of the thread TH. The exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN is not NULL. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_join(pthread_t __th, void **__thread_return); #ifdef __USE_GNU /* Check whether thread TH has terminated. If yes return the status of the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */ extern int pthread_tryjoin_np(pthread_t __th, void **__thread_return) __THROW; /* Make calling thread wait for termination of the thread TH, but only until TIMEOUT. The exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN is not NULL. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_timedjoin_np(pthread_t __th, void **__thread_return, const struct timespec *__abstime); #endif /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN. The resources of TH will therefore be freed immediately when it terminates, instead of waiting for another thread to perform PTHREAD_JOIN on it. */ extern int pthread_detach(pthread_t __th) __THROW; /* Obtain the identifier of the current thread. */ extern pthread_t pthread_self(void) __THROW __attribute__ ((__const__)); /* Compare two thread identifiers. */ extern int pthread_equal(pthread_t __thread1, pthread_t __thread2) __THROW __attribute__ ((__const__)); /* Thread attribute handling. */ /* Initialize thread attribute *ATTR with default attributes (detachstate is PTHREAD_JOINABLE, scheduling policy is SCHED_OTHER, no user-provided stack). */ extern int pthread_attr_init(pthread_attr_t * __attr) __THROW __nonnull((1)); /* Destroy thread attribute *ATTR. */ extern int pthread_attr_destroy(pthread_attr_t * __attr) __THROW __nonnull((1)); /* Get detach state attribute. */ extern int pthread_attr_getdetachstate(const pthread_attr_t * __attr, int *__detachstate) __THROW __nonnull((1, 2)); /* Set detach state attribute. */ extern int pthread_attr_setdetachstate(pthread_attr_t * __attr, int __detachstate) __THROW __nonnull((1)); /* Get the size of the guard area created for stack overflow protection. */ extern int pthread_attr_getguardsize(const pthread_attr_t * __attr, size_t * __guardsize) __THROW __nonnull((1, 2)); /* Set the size of the guard area created for stack overflow protection. */ extern int pthread_attr_setguardsize(pthread_attr_t * __attr, size_t __guardsize) __THROW __nonnull((1)); /* Return in *PARAM the scheduling parameters of *ATTR. */ extern int pthread_attr_getschedparam(const pthread_attr_t * __restrict __attr, struct sched_param *__restrict __param) __THROW __nonnull((1, 2)); /* Set scheduling parameters (priority, etc) in *ATTR according to PARAM. */ extern int pthread_attr_setschedparam(pthread_attr_t * __restrict __attr, const struct sched_param *__restrict __param) __THROW __nonnull((1, 2)); /* Return in *POLICY the scheduling policy of *ATTR. */ extern int pthread_attr_getschedpolicy(const pthread_attr_t * __restrict __attr, int *__restrict __policy) __THROW __nonnull((1, 2)); /* Set scheduling policy in *ATTR according to POLICY. */ extern int pthread_attr_setschedpolicy(pthread_attr_t * __attr, int __policy) __THROW __nonnull((1)); /* Return in *INHERIT the scheduling inheritance mode of *ATTR. */ extern int pthread_attr_getinheritsched(const pthread_attr_t * __restrict __attr, int *__restrict __inherit) __THROW __nonnull((1, 2)); /* Set scheduling inheritance mode in *ATTR according to INHERIT. */ extern int pthread_attr_setinheritsched(pthread_attr_t * __attr, int __inherit) __THROW __nonnull((1)); /* Return in *SCOPE the scheduling contention scope of *ATTR. */ extern int pthread_attr_getscope(const pthread_attr_t * __restrict __attr, int *__restrict __scope) __THROW __nonnull((1, 2)); /* Set scheduling contention scope in *ATTR according to SCOPE. */ extern int pthread_attr_setscope(pthread_attr_t * __attr, int __scope) __THROW __nonnull((1)); /* Return the previously set address for the stack. */ extern int pthread_attr_getstackaddr(const pthread_attr_t * __restrict __attr, void **__restrict __stackaddr) __THROW __nonnull((1, 2)) __attribute_deprecated__; /* Set the starting address of the stack of the thread to be created. Depending on whether the stack grows up or down the value must either be higher or lower than all the address in the memory block. The minimal size of the block must be PTHREAD_STACK_MIN. */ extern int pthread_attr_setstackaddr(pthread_attr_t * __attr, void *__stackaddr) __THROW __nonnull((1)) __attribute_deprecated__; /* Return the currently used minimal stack size. */ extern int pthread_attr_getstacksize(const pthread_attr_t * __restrict __attr, size_t * __restrict __stacksize) __THROW __nonnull((1, 2)); /* Add information about the minimum stack size needed for the thread to be started. This size must never be less than PTHREAD_STACK_MIN and must also not exceed the system limits. */ extern int pthread_attr_setstacksize(pthread_attr_t * __attr, size_t __stacksize) __THROW __nonnull((1)); #ifdef __USE_XOPEN2K /* Return the previously set address for the stack. */ extern int pthread_attr_getstack(const pthread_attr_t * __restrict __attr, void **__restrict __stackaddr, size_t * __restrict __stacksize) __THROW __nonnull((1, 2, 3)); /* The following two interfaces are intended to replace the last two. They require setting the address as well as the size since only setting the address will make the implementation on some architectures impossible. */ extern int pthread_attr_setstack(pthread_attr_t * __attr, void *__stackaddr, size_t __stacksize) __THROW __nonnull((1)); #endif #ifdef __USE_GNU /* Thread created with attribute ATTR will be limited to run only on the processors represented in CPUSET. */ extern int pthread_attr_setaffinity_np(pthread_attr_t * __attr, size_t __cpusetsize, const cpu_set_t * __cpuset) __THROW __nonnull((1, 3)); /* Get bit set in CPUSET representing the processors threads created with ATTR can run on. */ extern int pthread_attr_getaffinity_np(const pthread_attr_t * __attr, size_t __cpusetsize, cpu_set_t * __cpuset) __THROW __nonnull((1, 3)); /* Get the default attributes used by pthread_create in this process. */ extern int pthread_getattr_default_np(pthread_attr_t * __attr) __THROW __nonnull((1)); /* Set the default attributes to be used by pthread_create in this process. */ extern int pthread_setattr_default_np(const pthread_attr_t * __attr) __THROW __nonnull((1)); /* Initialize thread attribute *ATTR with attributes corresponding to the already running thread TH. It shall be called on uninitialized ATTR and destroyed with pthread_attr_destroy when no longer needed. */ extern int pthread_getattr_np(pthread_t __th, pthread_attr_t * __attr) __THROW __nonnull((2)); #endif /* Functions for scheduling control. */ /* Set the scheduling parameters for TARGET_THREAD according to POLICY and *PARAM. */ extern int pthread_setschedparam(pthread_t __target_thread, int __policy, const struct sched_param *__param) __THROW __nonnull((3)); /* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */ extern int pthread_getschedparam(pthread_t __target_thread, int *__restrict __policy, struct sched_param *__restrict __param) __THROW __nonnull((2, 3)); /* Set the scheduling priority for TARGET_THREAD. */ extern int pthread_setschedprio(pthread_t __target_thread, int __prio) __THROW; #ifdef __USE_GNU /* Get thread name visible in the kernel and its interfaces. */ extern int pthread_getname_np(pthread_t __target_thread, char *__buf, size_t __buflen) __THROW __nonnull((2)); /* Set thread name visible in the kernel and its interfaces. */ extern int pthread_setname_np(pthread_t __target_thread, const char *__name) __THROW __nonnull((2)); #endif #ifdef __USE_UNIX98 /* Determine level of concurrency. */ extern int pthread_getconcurrency(void) __THROW; /* Set new concurrency level to LEVEL. */ extern int pthread_setconcurrency(int __level) __THROW; #endif #ifdef __USE_GNU /* Yield the processor to another thread or process. This function is similar to the POSIX `sched_yield' function but might be differently implemented in the case of a m-on-n thread implementation. */ extern int pthread_yield(void) __THROW; /* Limit specified thread TH to run only on the processors represented in CPUSET. */ extern int pthread_setaffinity_np(pthread_t __th, size_t __cpusetsize, const cpu_set_t * __cpuset) __THROW __nonnull((3)); /* Get bit set in CPUSET representing the processors TH can run on. */ extern int pthread_getaffinity_np(pthread_t __th, size_t __cpusetsize, cpu_set_t * __cpuset) __THROW __nonnull((3)); #endif /* Functions for handling initialization. */ /* Guarantee that the initialization function INIT_ROUTINE will be called only once, even if pthread_once is executed several times with the same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or extern variable initialized to PTHREAD_ONCE_INIT. The initialization functions might throw exception which is why this function is not marked with __THROW. */ extern int pthread_once(pthread_once_t * __once_control, void (*__init_routine) (void)) __nonnull((1, 2)); /* Functions for handling cancellation. Note that these functions are explicitly not marked to not throw an exception in C++ code. If cancellation is implemented by unwinding this is necessary to have the compiler generate the unwind information. */ /* Set cancelability state of current thread to STATE, returning old state in *OLDSTATE if OLDSTATE is not NULL. */ extern int pthread_setcancelstate(int __state, int *__oldstate); /* Set cancellation state of current thread to TYPE, returning the old type in *OLDTYPE if OLDTYPE is not NULL. */ extern int pthread_setcanceltype(int __type, int *__oldtype); /* Cancel THREAD immediately or at the next possibility. */ extern int pthread_cancel(pthread_t __th); /* Test for pending cancellation for the current thread and terminate the thread as per pthread_exit(PTHREAD_CANCELED) if it has been cancelled. */ extern void pthread_testcancel(void); /* Cancellation handling with integration into exception handling. */ typedef struct { struct { __jmp_buf __cancel_jmp_buf; int __mask_was_saved; } __cancel_jmp_buf[1]; void *__pad[4]; } __pthread_unwind_buf_t __attribute__ ((__aligned__)); /* No special attributes by default. */ #ifndef __cleanup_fct_attribute #define __cleanup_fct_attribute #endif /* Structure to hold the cleanup handler information. */ struct __pthread_cleanup_frame { void (*__cancel_routine) (void *); void *__cancel_arg; int __do_it; int __cancel_type; }; #if defined __GNUC__ && defined __EXCEPTIONS #ifdef __cplusplus /* Class to handle cancellation handler invocation. */ class __pthread_cleanup_class { void (*__cancel_routine) (void *); void *__cancel_arg; int __do_it; int __cancel_type; public: __pthread_cleanup_class(void (*__fct) (void *), void *__arg) :__cancel_routine(__fct), __cancel_arg(__arg), __do_it(1) { } ~__pthread_cleanup_class() { if (__do_it) __cancel_routine(__cancel_arg); } void __setdoit(int __newval) { __do_it = __newval; } void __defer() { pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &__cancel_type); } void __restore() const { pthread_setcanceltype(__cancel_type, 0); }}; /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ #define pthread_cleanup_push(routine, arg) \ do { \ __pthread_cleanup_class __clframe (routine, arg) /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ #define pthread_cleanup_pop(execute) \ __clframe.__setdoit (execute); \ } while (0) #ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ #define pthread_cleanup_push_defer_np(routine, arg) \ do { \ __pthread_cleanup_class __clframe (routine, arg); \ __clframe.__defer () /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ #define pthread_cleanup_pop_restore_np(execute) \ __clframe.__restore (); \ __clframe.__setdoit (execute); \ } while (0) #endif #else /* Function called to call the cleanup handler. As an extern inline function the compiler is free to decide inlining the change when needed or fall back on the copy which must exist somewhere else. */ __extern_inline void __pthread_cleanup_routine(struct __pthread_cleanup_frame *__frame) { if (__frame->__do_it) __frame->__cancel_routine(__frame->__cancel_arg); } /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ #define pthread_cleanup_push(routine, arg) \ do { \ struct __pthread_cleanup_frame __clframe \ __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \ = { .__cancel_routine = (routine), .__cancel_arg = (arg), \ .__do_it = 1 }; /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ #define pthread_cleanup_pop(execute) \ __clframe.__do_it = (execute); \ } while (0) #ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ #define pthread_cleanup_push_defer_np(routine, arg) \ do { \ struct __pthread_cleanup_frame __clframe \ __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \ = { .__cancel_routine = (routine), .__cancel_arg = (arg), \ .__do_it = 1 }; \ (void) pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, \ &__clframe.__cancel_type) /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ #define pthread_cleanup_pop_restore_np(execute) \ (void) pthread_setcanceltype (__clframe.__cancel_type, NULL); \ __clframe.__do_it = (execute); \ } while (0) #endif #endif #else /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ #define pthread_cleanup_push(routine, arg) \ do { \ __pthread_unwind_buf_t __cancel_buf; \ void (*__cancel_routine) (void *) = (routine); \ void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ /* NOTREACHED */ \ } \ \ __pthread_register_cancel (&__cancel_buf); \ do { extern void __pthread_register_cancel(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute; /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ #define pthread_cleanup_pop(execute) \ do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ } while (0); \ __pthread_unregister_cancel (&__cancel_buf); \ if (execute) \ __cancel_routine (__cancel_arg); \ } while (0) extern void __pthread_unregister_cancel(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute; #ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ #define pthread_cleanup_push_defer_np(routine, arg) \ do { \ __pthread_unwind_buf_t __cancel_buf; \ void (*__cancel_routine) (void *) = (routine); \ void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ /* NOTREACHED */ \ } \ \ __pthread_register_cancel_defer (&__cancel_buf); \ do { extern void __pthread_register_cancel_defer(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute; /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ #define pthread_cleanup_pop_restore_np(execute) \ do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ } while (0); \ __pthread_unregister_cancel_restore (&__cancel_buf); \ if (execute) \ __cancel_routine (__cancel_arg); \ } while (0) extern void __pthread_unregister_cancel_restore(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute; #endif /* Internal interface to initiate cleanup. */ extern void __pthread_unwind_next(__pthread_unwind_buf_t * __buf) __cleanup_fct_attribute __attribute__ ((__noreturn__)) #ifndef SHARED __attribute__ ((__weak__)) #endif ; #endif /* Function used in the macros. */ struct __jmp_buf_tag; extern int __sigsetjmp(struct __jmp_buf_tag *__env, int __savemask) __THROWNL; /* Mutex handling. */ /* Initialize a mutex. */ extern int pthread_mutex_init(pthread_mutex_t * __mutex, const pthread_mutexattr_t * __mutexattr) __THROW __nonnull((1)); /* Destroy a mutex. */ extern int pthread_mutex_destroy(pthread_mutex_t * __mutex) __THROW __nonnull((1)); /* Try locking a mutex. */ extern int pthread_mutex_trylock(pthread_mutex_t * __mutex) __THROWNL __nonnull((1)); /* Lock a mutex. */ extern int pthread_mutex_lock(pthread_mutex_t * __mutex) __THROWNL __nonnull((1)); #ifdef __USE_XOPEN2K /* Wait until lock becomes available, or specified time passes. */ extern int pthread_mutex_timedlock(pthread_mutex_t * __restrict __mutex, const struct timespec *__restrict __abstime) __THROWNL __nonnull((1, 2)); #endif /* Unlock a mutex. */ extern int pthread_mutex_unlock(pthread_mutex_t * __mutex) __THROWNL __nonnull((1)); /* Get the priority ceiling of MUTEX. */ extern int pthread_mutex_getprioceiling(const pthread_mutex_t * __restrict __mutex, int *__restrict __prioceiling) __THROW __nonnull((1, 2)); /* Set the priority ceiling of MUTEX to PRIOCEILING, return old priority ceiling value in *OLD_CEILING. */ extern int pthread_mutex_setprioceiling(pthread_mutex_t * __restrict __mutex, int __prioceiling, int *__restrict __old_ceiling) __THROW __nonnull((1, 3)); #ifdef __USE_XOPEN2K8 /* Declare the state protected by MUTEX as consistent. */ extern int pthread_mutex_consistent(pthread_mutex_t * __mutex) __THROW __nonnull((1)); #ifdef __USE_GNU extern int pthread_mutex_consistent_np(pthread_mutex_t * __mutex) __THROW __nonnull((1)); #endif #endif /* Functions for handling mutex attributes. */ /* Initialize mutex attribute object ATTR with default attributes (kind is PTHREAD_MUTEX_TIMED_NP). */ extern int pthread_mutexattr_init(pthread_mutexattr_t * __attr) __THROW __nonnull((1)); /* Destroy mutex attribute object ATTR. */ extern int pthread_mutexattr_destroy(pthread_mutexattr_t * __attr) __THROW __nonnull((1)); /* Get the process-shared flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull((1, 2)); /* Set the process-shared flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_setpshared(pthread_mutexattr_t * __attr, int __pshared) __THROW __nonnull((1)); #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 /* Return in *KIND the mutex kind attribute in *ATTR. */ extern int pthread_mutexattr_gettype(const pthread_mutexattr_t * __restrict __attr, int *__restrict __kind) __THROW __nonnull((1, 2)); /* Set the mutex kind attribute in *ATTR to KIND (either PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, or PTHREAD_MUTEX_DEFAULT). */ extern int pthread_mutexattr_settype(pthread_mutexattr_t * __attr, int __kind) __THROW __nonnull((1)); #endif /* Return in *PROTOCOL the mutex protocol attribute in *ATTR. */ extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t * __restrict __attr, int *__restrict __protocol) __THROW __nonnull((1, 2)); /* Set the mutex protocol attribute in *ATTR to PROTOCOL (either PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, or PTHREAD_PRIO_PROTECT). */ extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t * __attr, int __protocol) __THROW __nonnull((1)); /* Return in *PRIOCEILING the mutex prioceiling attribute in *ATTR. */ extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t * __restrict __attr, int *__restrict __prioceiling) __THROW __nonnull((1, 2)); /* Set the mutex prioceiling attribute in *ATTR to PRIOCEILING. */ extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t * __attr, int __prioceiling) __THROW __nonnull((1)); #ifdef __USE_XOPEN2K /* Get the robustness flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_getrobust(const pthread_mutexattr_t * __attr, int *__robustness) __THROW __nonnull((1, 2)); #ifdef __USE_GNU extern int pthread_mutexattr_getrobust_np(const pthread_mutexattr_t * __attr, int *__robustness) __THROW __nonnull((1, 2)); #endif /* Set the robustness flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_setrobust(pthread_mutexattr_t * __attr, int __robustness) __THROW __nonnull((1)); #ifdef __USE_GNU extern int pthread_mutexattr_setrobust_np(pthread_mutexattr_t * __attr, int __robustness) __THROW __nonnull((1)); #endif #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K /* Functions for handling read-write locks. */ /* Initialize read-write lock RWLOCK using attributes ATTR, or use the default values if later is NULL. */ extern int pthread_rwlock_init(pthread_rwlock_t * __restrict __rwlock, const pthread_rwlockattr_t * __restrict __attr) __THROW __nonnull((1)); /* Destroy read-write lock RWLOCK. */ extern int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock) __THROW __nonnull((1)); /* Acquire read lock for RWLOCK. */ extern int pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); /* Try to acquire read lock for RWLOCK. */ extern int pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); #ifdef __USE_XOPEN2K /* Try to acquire read lock for RWLOCK or return after specfied time. */ extern int pthread_rwlock_timedrdlock(pthread_rwlock_t * __restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull((1, 2)); #endif /* Acquire write lock for RWLOCK. */ extern int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); /* Try to acquire write lock for RWLOCK. */ extern int pthread_rwlock_trywrlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); #ifdef __USE_XOPEN2K /* Try to acquire write lock for RWLOCK or return after specfied time. */ extern int pthread_rwlock_timedwrlock(pthread_rwlock_t * __restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull((1, 2)); #endif /* Unlock RWLOCK. */ extern int pthread_rwlock_unlock(pthread_rwlock_t * __rwlock) __THROWNL __nonnull((1)); /* Functions for handling read-write lock attributes. */ /* Initialize attribute object ATTR with default values. */ extern int pthread_rwlockattr_init(pthread_rwlockattr_t * __attr) __THROW __nonnull((1)); /* Destroy attribute object ATTR. */ extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t * __attr) __THROW __nonnull((1)); /* Return current setting of process-shared attribute of ATTR in PSHARED. */ extern int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull((1, 2)); /* Set process-shared attribute of ATTR to PSHARED. */ extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t * __attr, int __pshared) __THROW __nonnull((1)); /* Return current setting of reader/writer preference. */ extern int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pref) __THROW __nonnull((1, 2)); /* Set reader/write preference. */ extern int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t * __attr, int __pref) __THROW __nonnull((1)); #endif /* Functions for handling conditional variables. */ /* Initialize condition variable COND using attributes ATTR, or use the default values if later is NULL. */ extern int pthread_cond_init(pthread_cond_t * __restrict __cond, const pthread_condattr_t * __restrict __cond_attr) __THROW __nonnull((1)); /* Destroy condition variable COND. */ extern int pthread_cond_destroy(pthread_cond_t * __cond) __THROW __nonnull((1)); /* Wake up one thread waiting for condition variable COND. */ extern int pthread_cond_signal(pthread_cond_t * __cond) __THROWNL __nonnull((1)); /* Wake up all threads waiting for condition variables COND. */ extern int pthread_cond_broadcast(pthread_cond_t * __cond) __THROWNL __nonnull((1)); /* Wait for condition variable COND to be signaled or broadcast. MUTEX is assumed to be locked before. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_cond_wait(pthread_cond_t * __restrict __cond, pthread_mutex_t * __restrict __mutex) __nonnull((1, 2)); /* Wait for condition variable COND to be signaled or broadcast until ABSTIME. MUTEX is assumed to be locked before. ABSTIME is an absolute time specification; zero is the beginning of the epoch (00:00:00 GMT, January 1, 1970). This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_cond_timedwait(pthread_cond_t * __restrict __cond, pthread_mutex_t * __restrict __mutex, const struct timespec *__restrict __abstime) __nonnull((1, 2, 3)); /* Functions for handling condition variable attributes. */ /* Initialize condition variable attribute ATTR. */ extern int pthread_condattr_init(pthread_condattr_t * __attr) __THROW __nonnull((1)); /* Destroy condition variable attribute ATTR. */ extern int pthread_condattr_destroy(pthread_condattr_t * __attr) __THROW __nonnull((1)); /* Get the process-shared flag of the condition variable attribute ATTR. */ extern int pthread_condattr_getpshared(const pthread_condattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull((1, 2)); /* Set the process-shared flag of the condition variable attribute ATTR. */ extern int pthread_condattr_setpshared(pthread_condattr_t * __attr, int __pshared) __THROW __nonnull((1)); #ifdef __USE_XOPEN2K /* Get the clock selected for the condition variable attribute ATTR. */ extern int pthread_condattr_getclock(const pthread_condattr_t * __restrict __attr, __clockid_t * __restrict __clock_id) __THROW __nonnull((1, 2)); /* Set the clock selected for the condition variable attribute ATTR. */ extern int pthread_condattr_setclock(pthread_condattr_t * __attr, __clockid_t __clock_id) __THROW __nonnull((1)); #endif #ifdef __USE_XOPEN2K /* Functions to handle spinlocks. */ /* Initialize the spinlock LOCK. If PSHARED is nonzero the spinlock can be shared between different processes. */ extern int pthread_spin_init(pthread_spinlock_t * __lock, int __pshared) __THROW __nonnull((1)); /* Destroy the spinlock LOCK. */ extern int pthread_spin_destroy(pthread_spinlock_t * __lock) __THROW __nonnull((1)); /* Wait until spinlock LOCK is retrieved. */ extern int pthread_spin_lock(pthread_spinlock_t * __lock) __THROWNL __nonnull((1)); /* Try to lock spinlock LOCK. */ extern int pthread_spin_trylock(pthread_spinlock_t * __lock) __THROWNL __nonnull((1)); /* Release spinlock LOCK. */ extern int pthread_spin_unlock(pthread_spinlock_t * __lock) __THROWNL __nonnull((1)); /* Functions to handle barriers. */ /* Initialize BARRIER with the attributes in ATTR. The barrier is opened when COUNT waiters arrived. */ extern int pthread_barrier_init(pthread_barrier_t * __restrict __barrier, const pthread_barrierattr_t * __restrict __attr, unsigned int __count) __THROW __nonnull((1)); /* Destroy a previously dynamically initialized barrier BARRIER. */ extern int pthread_barrier_destroy(pthread_barrier_t * __barrier) __THROW __nonnull((1)); /* Wait on barrier BARRIER. */ extern int pthread_barrier_wait(pthread_barrier_t * __barrier) __THROWNL __nonnull((1)); /* Initialize barrier attribute ATTR. */ extern int pthread_barrierattr_init(pthread_barrierattr_t * __attr) __THROW __nonnull((1)); /* Destroy previously dynamically initialized barrier attribute ATTR. */ extern int pthread_barrierattr_destroy(pthread_barrierattr_t * __attr) __THROW __nonnull((1)); /* Get the process-shared flag of the barrier attribute ATTR. */ extern int pthread_barrierattr_getpshared(const pthread_barrierattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull((1, 2)); /* Set the process-shared flag of the barrier attribute ATTR. */ extern int pthread_barrierattr_setpshared(pthread_barrierattr_t * __attr, int __pshared) __THROW __nonnull((1)); #endif /* Functions for handling thread-specific data. */ /* Create a key value identifying a location in the thread-specific data area. Each thread maintains a distinct thread-specific data area. DESTR_FUNCTION, if non-NULL, is called with the value associated to that key when the key is destroyed. DESTR_FUNCTION is not called if the value associated is NULL when the key is destroyed. */ extern int pthread_key_create(pthread_key_t * __key, void (*__destr_function) (void *)) __THROW __nonnull((1)); /* Destroy KEY. */ extern int pthread_key_delete(pthread_key_t __key) __THROW; /* Return current value of the thread-specific data slot identified by KEY. */ extern void *pthread_getspecific(pthread_key_t __key) __THROW; /* Store POINTER in the thread-specific data slot identified by KEY. */ extern int pthread_setspecific(pthread_key_t __key, const void *__pointer) __THROW; #ifdef __USE_XOPEN2K /* Get ID of CPU-time clock for thread THREAD_ID. */ extern int pthread_getcpuclockid(pthread_t __thread_id, __clockid_t * __clock_id) __THROW __nonnull((2)); #endif /* Install handlers to be called when a new process is created with FORK. The PREPARE handler is called in the parent process just before performing FORK. The PARENT handler is called in the parent process just after FORK. The CHILD handler is called in the child process. Each of the three handlers can be NULL, meaning that no handler needs to be called at that point. PTHREAD_ATFORK can be called several times, in which case the PREPARE handlers are called in LIFO order (last added with PTHREAD_ATFORK, first called before FORK), and the PARENT and CHILD handlers are called in FIFO (first added, first called). */ extern int pthread_atfork(void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)) __THROW; #ifdef __USE_EXTERN_INLINES /* Optimizations. */ __extern_inline int __NTH(pthread_equal(pthread_t __thread1, pthread_t __thread2)) { return __thread1 == __thread2; } #endif __END_DECLS #endif /* pthread.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/pwd.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 9.2.2 User Database Access */ #ifndef _PWD_H #define _PWD_H 1 #include __BEGIN_DECLS #include #define __need_size_t #include #if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ #ifndef __gid_t_defined typedef __gid_t gid_t; #define __gid_t_defined #endif #ifndef __uid_t_defined typedef __uid_t uid_t; #define __uid_t_defined #endif #endif /* The passwd structure. */ struct passwd { char *pw_name; /* Username. */ char *pw_passwd; /* Password. */ __uid_t pw_uid; /* User ID. */ __gid_t pw_gid; /* Group ID. */ char *pw_gecos; /* Real name. */ char *pw_dir; /* Home directory. */ char *pw_shell; /* Shell program. */ }; #ifdef __USE_MISC #define __need_FILE #include #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Rewind the password-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setpwent(void); /* Close the password-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endpwent(void); /* Read an entry from the password-file stream, opening it if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwent(void); #endif #ifdef __USE_MISC /* Read an entry from STREAM. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct passwd *fgetpwent(FILE * __stream) __nonnull((1)); /* Write the given entry onto the given stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int putpwent(const struct passwd *__restrict __p, FILE * __restrict __f); #endif /* Search for an entry with a matching user ID. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwuid(__uid_t __uid); /* Search for an entry with a matching username. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwnam(const char *__name) __nonnull((1)); #ifdef __USE_POSIX #ifdef __USE_MISC /* Reasonable value for the buffer sized used in the reentrant functions below. But better use `sysconf'. */ #define NSS_BUFLEN_PASSWD 1024 #endif /* Reentrant versions of some of the functions above. PLEASE NOTE: the `getpwent_r' function is not (yet) standardized. The interface may change in later versions of this library. But the interface is designed following the principals used for the other reentrant functions so the chances are good this is what the POSIX people would choose. */ #ifdef __USE_MISC /* This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getpwent_r(struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull((1, 2, 4)); #endif extern int getpwuid_r(__uid_t __uid, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull((2, 3, 5)); extern int getpwnam_r(const char *__restrict __name, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull((1, 2, 3, 5)); #ifdef __USE_MISC /* Read an entry from STREAM. This function is not standardized and probably never will. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fgetpwent_r(FILE * __restrict __stream, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull((1, 2, 3, 5)); #endif #endif /* POSIX or reentrant */ #ifdef __USE_GNU /* Re-construct the password-file line for the given uid in the given buffer. This knows the format that the caller will expect, but this need not be the format of the password file. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getpw(__uid_t __uid, char *__buffer); #endif __END_DECLS #endif /* pwd.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/rpc/netdb.h ================================================ /* @(#)netdb.h 2.1 88/07/29 3.9 RPCSRC */ /* * Copyright (c) 2010, Oracle America, Inc. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the "Oracle America, Inc." nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Cleaned up for GNU C library roland@gnu.ai.mit.edu: added multiple inclusion protection and use of . In GNU this file is #include'd by . */ #ifndef _RPC_NETDB_H #define _RPC_NETDB_H 1 #include #define __need_size_t #include __BEGIN_DECLS struct rpcent { char *r_name; /* Name of server for this rpc program. */ char **r_aliases; /* Alias list. */ int r_number; /* RPC program number. */ }; extern void setrpcent(int __stayopen) __THROW; extern void endrpcent(void) __THROW; extern struct rpcent *getrpcbyname(const char *__name) __THROW; extern struct rpcent *getrpcbynumber(int __number) __THROW; extern struct rpcent *getrpcent(void) __THROW; #ifdef __USE_MISC extern int getrpcbyname_r(const char *__name, struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) __THROW; extern int getrpcbynumber_r(int __number, struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) __THROW; extern int getrpcent_r(struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) __THROW; #endif __END_DECLS #endif /* rpc/netdb.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/sched.h ================================================ /* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface. Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SCHED_H #define _SCHED_H 1 #include /* Get type definitions. */ #include #define __need_size_t #include #ifdef __USE_XOPEN2K #define __need_time_t #define __need_timespec #endif #include #ifndef __pid_t_defined typedef __pid_t pid_t; #define __pid_t_defined #endif /* Get system specific constant and data structure definitions. */ #include /* Define the real names for the elements of `struct sched_param'. */ #define sched_priority __sched_priority __BEGIN_DECLS /* Set scheduling parameters for a process. */ extern int sched_setparam(__pid_t __pid, const struct sched_param *__param) __THROW; /* Retrieve scheduling parameters for a particular process. */ extern int sched_getparam(__pid_t __pid, struct sched_param *__param) __THROW; /* Set scheduling algorithm and/or parameters for a process. */ extern int sched_setscheduler(__pid_t __pid, int __policy, const struct sched_param *__param) __THROW; /* Retrieve scheduling algorithm for a particular purpose. */ extern int sched_getscheduler(__pid_t __pid) __THROW; /* Yield the processor. */ extern int sched_yield(void) __THROW; /* Get maximum priority value for a scheduler. */ extern int sched_get_priority_max(int __algorithm) __THROW; /* Get minimum priority value for a scheduler. */ extern int sched_get_priority_min(int __algorithm) __THROW; /* Get the SCHED_RR interval for the named process. */ extern int sched_rr_get_interval(__pid_t __pid, struct timespec *__t) __THROW; #ifdef __USE_GNU /* Access macros for `cpu_set'. */ #define CPU_SETSIZE __CPU_SETSIZE #define CPU_SET(cpu, cpusetp) __CPU_SET_S (cpu, sizeof (cpu_set_t), cpusetp) #define CPU_CLR(cpu, cpusetp) __CPU_CLR_S (cpu, sizeof (cpu_set_t), cpusetp) #define CPU_ISSET(cpu, cpusetp) __CPU_ISSET_S (cpu, sizeof (cpu_set_t), \ cpusetp) #define CPU_ZERO(cpusetp) __CPU_ZERO_S (sizeof (cpu_set_t), cpusetp) #define CPU_COUNT(cpusetp) __CPU_COUNT_S (sizeof (cpu_set_t), cpusetp) #define CPU_SET_S(cpu, setsize, cpusetp) __CPU_SET_S (cpu, setsize, cpusetp) #define CPU_CLR_S(cpu, setsize, cpusetp) __CPU_CLR_S (cpu, setsize, cpusetp) #define CPU_ISSET_S(cpu, setsize, cpusetp) __CPU_ISSET_S (cpu, setsize, \ cpusetp) #define CPU_ZERO_S(setsize, cpusetp) __CPU_ZERO_S (setsize, cpusetp) #define CPU_COUNT_S(setsize, cpusetp) __CPU_COUNT_S (setsize, cpusetp) #define CPU_EQUAL(cpusetp1, cpusetp2) \ __CPU_EQUAL_S (sizeof (cpu_set_t), cpusetp1, cpusetp2) #define CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ __CPU_EQUAL_S (setsize, cpusetp1, cpusetp2) #define CPU_AND(destset, srcset1, srcset2) \ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, &) #define CPU_OR(destset, srcset1, srcset2) \ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, |) #define CPU_XOR(destset, srcset1, srcset2) \ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, ^) #define CPU_AND_S(setsize, destset, srcset1, srcset2) \ __CPU_OP_S (setsize, destset, srcset1, srcset2, &) #define CPU_OR_S(setsize, destset, srcset1, srcset2) \ __CPU_OP_S (setsize, destset, srcset1, srcset2, |) #define CPU_XOR_S(setsize, destset, srcset1, srcset2) \ __CPU_OP_S (setsize, destset, srcset1, srcset2, ^) #define CPU_ALLOC_SIZE(count) __CPU_ALLOC_SIZE (count) #define CPU_ALLOC(count) __CPU_ALLOC (count) #define CPU_FREE(cpuset) __CPU_FREE (cpuset) /* Set the CPU affinity for a task */ extern int sched_setaffinity(__pid_t __pid, size_t __cpusetsize, const cpu_set_t * __cpuset) __THROW; /* Get the CPU affinity for a task */ extern int sched_getaffinity(__pid_t __pid, size_t __cpusetsize, cpu_set_t * __cpuset) __THROW; #endif __END_DECLS #endif /* sched.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/setjmp.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.13 Nonlocal jumps */ #ifndef _SETJMP_H #define _SETJMP_H 1 #include __BEGIN_DECLS #include /* Get `__jmp_buf'. */ #include /* Get `__sigset_t'. */ /* Calling environment, plus possibly a saved signal mask. */ struct __jmp_buf_tag { /* NOTE: The machine-dependent definitions of `__sigsetjmp' assume that a `jmp_buf' begins with a `__jmp_buf' and that `__mask_was_saved' follows it. Do not move these members or add others before it. */ __jmp_buf __jmpbuf; /* Calling environment. */ int __mask_was_saved; /* Saved the signal mask? */ __sigset_t __saved_mask; /* Saved signal mask. */ }; __BEGIN_NAMESPACE_STD typedef struct __jmp_buf_tag jmp_buf[1]; /* Store the calling environment in ENV, also saving the signal mask. Return 0. */ extern int setjmp(jmp_buf __env) __THROWNL; __END_NAMESPACE_STD /* Store the calling environment in ENV, also saving the signal mask if SAVEMASK is nonzero. Return 0. This is the internal name for `sigsetjmp'. */ extern int __sigsetjmp(struct __jmp_buf_tag __env[1], int __savemask) __THROWNL; /* Store the calling environment in ENV, not saving the signal mask. Return 0. */ extern int _setjmp(struct __jmp_buf_tag __env[1]) __THROWNL; /* Do not save the signal mask. This is equivalent to the `_setjmp' BSD function. */ #define setjmp(env) _setjmp (env) __BEGIN_NAMESPACE_STD /* Jump to the environment saved in ENV, making the `setjmp' call there return VAL, or 1 if VAL is 0. */ extern void longjmp(struct __jmp_buf_tag __env[1], int __val) __THROWNL __attribute__ ((__noreturn__)); __END_NAMESPACE_STD #if defined __USE_MISC || defined __USE_XOPEN /* Same. Usually `_longjmp' is used with `_setjmp', which does not save the signal mask. But it is how ENV was saved that determines whether `longjmp' restores the mask; `_longjmp' is just an alias. */ extern void _longjmp(struct __jmp_buf_tag __env[1], int __val) __THROWNL __attribute__ ((__noreturn__)); #endif #ifdef __USE_POSIX /* Use the same type for `jmp_buf' and `sigjmp_buf'. The `__mask_was_saved' flag determines whether or not `longjmp' will restore the signal mask. */ typedef struct __jmp_buf_tag sigjmp_buf[1]; /* Store the calling environment in ENV, also saving the signal mask if SAVEMASK is nonzero. Return 0. */ #define sigsetjmp(env, savemask) __sigsetjmp (env, savemask) /* Jump to the environment saved in ENV, making the sigsetjmp call there return VAL, or 1 if VAL is 0. Restore the signal mask if that sigsetjmp call saved it. This is just an alias `longjmp'. */ extern void siglongjmp(sigjmp_buf __env, int __val) __THROWNL __attribute__ ((__noreturn__)); #endif /* Use POSIX. */ /* Define helper functions to catch unsafe code. */ #if __USE_FORTIFY_LEVEL > 0 #include #endif __END_DECLS #endif /* setjmp.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/signal.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.14 Signal handling */ #ifndef _SIGNAL_H #if !defined __need_sig_atomic_t && !defined __need_sigset_t #define _SIGNAL_H #endif #include __BEGIN_DECLS #include /* __sigset_t, __sig_atomic_t. */ /* An integral type that can be modified atomically, without the possibility of a signal arriving in the middle of the operation. */ #if defined __need_sig_atomic_t || defined _SIGNAL_H #ifndef __sig_atomic_t_defined #define __sig_atomic_t_defined __BEGIN_NAMESPACE_STD typedef __sig_atomic_t sig_atomic_t; __END_NAMESPACE_STD #endif #undef __need_sig_atomic_t #endif #if defined __need_sigset_t || (defined _SIGNAL_H && defined __USE_POSIX) #ifndef __sigset_t_defined #define __sigset_t_defined typedef __sigset_t sigset_t; #endif #undef __need_sigset_t #endif #ifdef _SIGNAL_H #include #include #if defined __USE_XOPEN || defined __USE_XOPEN2K #ifndef __pid_t_defined typedef __pid_t pid_t; #define __pid_t_defined #endif #ifdef __USE_XOPEN #endif #ifndef __uid_t_defined typedef __uid_t uid_t; #define __uid_t_defined #endif #endif /* Unix98 */ #ifdef __USE_POSIX199309 /* We need `struct timespec' later on. */ #define __need_timespec #include #endif #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED /* Get the `siginfo_t' type plus the needed symbols. */ #include #endif /* Type of a signal handler. */ typedef void (*__sighandler_t) (int); /* The X/Open definition of `signal' specifies the SVID semantic. Use the additional function `sysv_signal' when X/Open compatibility is requested. */ extern __sighandler_t __sysv_signal(int __sig, __sighandler_t __handler) __THROW; #ifdef __USE_GNU extern __sighandler_t sysv_signal(int __sig, __sighandler_t __handler) __THROW; #endif /* Set the handler for the signal SIG to HANDLER, returning the old handler, or SIG_ERR on error. By default `signal' has the BSD semantic. */ __BEGIN_NAMESPACE_STD #ifdef __USE_MISC extern __sighandler_t signal(int __sig, __sighandler_t __handler) __THROW; #else /* Make sure the used `signal' implementation is the SVID version. */ #ifdef __REDIRECT_NTH extern __sighandler_t __REDIRECT_NTH(signal, (int __sig, __sighandler_t __handler), __sysv_signal); #else #define signal __sysv_signal #endif #endif __END_NAMESPACE_STD #ifdef __USE_XOPEN /* The X/Open definition of `signal' conflicts with the BSD version. So they defined another function `bsd_signal'. */ extern __sighandler_t bsd_signal(int __sig, __sighandler_t __handler) __THROW; #endif /* Send signal SIG to process number PID. If PID is zero, send SIG to all processes in the current process's process group. If PID is < -1, send SIG to all processes in process group - PID. */ #ifdef __USE_POSIX extern int kill(__pid_t __pid, int __sig) __THROW; #endif /* Use POSIX. */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Send SIG to all processes in process group PGRP. If PGRP is zero, send SIG to all processes in the current process's process group. */ extern int killpg(__pid_t __pgrp, int __sig) __THROW; #endif /* Use misc || X/Open Unix. */ __BEGIN_NAMESPACE_STD /* Raise signal SIG, i.e., send SIG to yourself. */ extern int raise(int __sig) __THROW; __END_NAMESPACE_STD #ifdef __USE_MISC /* SVID names for the same things. */ extern __sighandler_t ssignal(int __sig, __sighandler_t __handler) __THROW; extern int gsignal(int __sig) __THROW; #endif /* Use misc. */ #ifdef __USE_XOPEN2K8 /* Print a message describing the meaning of the given signal number. */ extern void psignal(int __sig, const char *__s); /* Print a message describing the meaning of the given signal information. */ extern void psiginfo(const siginfo_t * __pinfo, const char *__s); #endif /* POSIX 2008. */ /* The `sigpause' function in X/Open defines the argument as the signal number. This requires redirecting to another function because the default version in glibc uses an old BSD interface. This function is a cancellation point and therefore not marked with __THROW. */ #ifdef __USE_XOPEN #ifdef __GNUC__ extern int sigpause(int __sig) __asm__("__xpg_sigpause"); #else extern int __sigpause(int __sig_or_mask, int __is_sig); /* Remove a signal from the signal mask and suspend the process. */ #define sigpause(sig) __sigpause ((sig), 1) #endif #endif #ifdef __USE_MISC /* None of the following functions should be used anymore. They are here only for compatibility. A single word (`int') is not guaranteed to be enough to hold a complete signal mask and therefore these functions simply do not work in many situations. Use `sigprocmask' instead. */ /* Compute mask for signal SIG. */ #define sigmask(sig) __sigmask(sig) /* Block signals in MASK, returning the old mask. */ extern int sigblock(int __mask) __THROW __attribute_deprecated__; /* Set the mask of blocked signals to MASK, returning the old mask. */ extern int sigsetmask(int __mask) __THROW __attribute_deprecated__; /* Return currently selected signal mask. */ extern int siggetmask(void) __THROW __attribute_deprecated__; #endif /* Use misc. */ #ifdef __USE_MISC #define NSIG _NSIG #endif #ifdef __USE_GNU typedef __sighandler_t sighandler_t; #endif /* 4.4 BSD uses the name `sig_t' for this. */ #ifdef __USE_MISC typedef __sighandler_t sig_t; #endif #ifdef __USE_POSIX /* Clear all signals from SET. */ extern int sigemptyset(sigset_t * __set) __THROW __nonnull((1)); /* Set all signals in SET. */ extern int sigfillset(sigset_t * __set) __THROW __nonnull((1)); /* Add SIGNO to SET. */ extern int sigaddset(sigset_t * __set, int __signo) __THROW __nonnull((1)); /* Remove SIGNO from SET. */ extern int sigdelset(sigset_t * __set, int __signo) __THROW __nonnull((1)); /* Return 1 if SIGNO is in SET, 0 if not. */ extern int sigismember(const sigset_t * __set, int __signo) __THROW __nonnull((1)); #ifdef __USE_GNU /* Return non-empty value is SET is not empty. */ extern int sigisemptyset(const sigset_t * __set) __THROW __nonnull((1)); /* Build new signal set by combining the two inputs set using logical AND. */ extern int sigandset(sigset_t * __set, const sigset_t * __left, const sigset_t * __right) __THROW __nonnull((1, 2, 3)); /* Build new signal set by combining the two inputs set using logical OR. */ extern int sigorset(sigset_t * __set, const sigset_t * __left, const sigset_t * __right) __THROW __nonnull((1, 2, 3)); #endif /* GNU */ /* Get the system-specific definitions of `struct sigaction' and the `SA_*' and `SIG_*'. constants. */ #include /* Get and/or change the set of blocked signals. */ extern int sigprocmask(int __how, const sigset_t * __restrict __set, sigset_t * __restrict __oset) __THROW; /* Change the set of blocked signals to SET, wait until a signal arrives, and restore the set of blocked signals. This function is a cancellation point and therefore not marked with __THROW. */ extern int sigsuspend(const sigset_t * __set) __nonnull((1)); /* Get and/or set the action for signal SIG. */ extern int sigaction(int __sig, const struct sigaction *__restrict __act, struct sigaction *__restrict __oact) __THROW; /* Put in SET all signals that are blocked and waiting to be delivered. */ extern int sigpending(sigset_t * __set) __THROW __nonnull((1)); /* Select any of pending signals from SET or wait for any to arrive. This function is a cancellation point and therefore not marked with __THROW. */ extern int sigwait(const sigset_t * __restrict __set, int *__restrict __sig) __nonnull((1, 2)); #ifdef __USE_POSIX199309 /* Select any of pending signals from SET and place information in INFO. This function is a cancellation point and therefore not marked with __THROW. */ extern int sigwaitinfo(const sigset_t * __restrict __set, siginfo_t * __restrict __info) __nonnull((1)); /* Select any of pending signals from SET and place information in INFO. Wait the time specified by TIMEOUT if no signal is pending. This function is a cancellation point and therefore not marked with __THROW. */ extern int sigtimedwait(const sigset_t * __restrict __set, siginfo_t * __restrict __info, const struct timespec *__restrict __timeout) __nonnull((1)); /* Send signal SIG to the process PID. Associate data in VAL with the signal. */ extern int sigqueue(__pid_t __pid, int __sig, const union sigval __val) __THROW; #endif /* Use POSIX 199306. */ #endif /* Use POSIX. */ #ifdef __USE_MISC /* Names of the signals. This variable exists only for compatibility. Use `strsignal' instead (see ). */ extern const char *const _sys_siglist[_NSIG]; extern const char *const sys_siglist[_NSIG]; /* Get machine-dependent `struct sigcontext' and signal subcodes. */ #include /* Restore the state saved in SCP. */ extern int sigreturn(struct sigcontext *__scp) __THROW; #endif /* Use misc. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 #define __need_size_t #include /* If INTERRUPT is nonzero, make signal SIG interrupt system calls (causing them to fail with EINTR); if INTERRUPT is zero, make system calls be restarted after signal SIG. */ extern int siginterrupt(int __sig, int __interrupt) __THROW; #include #if defined __USE_XOPEN || defined __USE_XOPEN2K8 /* This will define `ucontext_t' and `mcontext_t'. */ #include #endif /* Run signals handlers on the stack specified by SS (if not NULL). If OSS is not NULL, it is filled in with the old signal stack status. This interface is obsolete and on many platform not implemented. */ extern int sigstack(struct sigstack *__ss, struct sigstack *__oss) __THROW __attribute_deprecated__; /* Alternate signal handler stack interface. This interface should always be preferred over `sigstack'. */ extern int sigaltstack(const struct sigaltstack *__restrict __ss, struct sigaltstack *__restrict __oss) __THROW; #endif /* Use POSIX.1-2008 or X/Open Unix. */ #ifdef __USE_XOPEN_EXTENDED /* Simplified interface for signal management. */ /* Add SIG to the calling process' signal mask. */ extern int sighold(int __sig) __THROW; /* Remove SIG from the calling process' signal mask. */ extern int sigrelse(int __sig) __THROW; /* Set the disposition of SIG to SIG_IGN. */ extern int sigignore(int __sig) __THROW; /* Set the disposition of SIG. */ extern __sighandler_t sigset(int __sig, __sighandler_t __disp) __THROW; #endif #if defined __USE_POSIX199506 || defined __USE_UNIX98 /* Some of the functions for handling signals in threaded programs must be defined here. */ #include #include #endif /* use Unix98 */ /* The following functions are used internally in the C library and in other code which need deep insights. */ /* Return number of available real-time signal with highest priority. */ extern int __libc_current_sigrtmin(void) __THROW; /* Return number of available real-time signal with lowest priority. */ extern int __libc_current_sigrtmax(void) __THROW; #endif /* signal.h */ __END_DECLS #endif /* not signal.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/stdc-predef.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STDC_PREDEF_H #define _STDC_PREDEF_H 1 /* This header is separate from features.h so that the compiler can include it implicitly at the start of every compilation. It must not itself include or any other header that includes because the implicit include comes before any feature test macros that may be defined in a source file before it first explicitly includes a system header. GCC knows the name of this header in order to preinclude it. */ /* glibc's intent is to support the IEC 559 math functionality, real and complex. If the GCC (4.9 and later) predefined macros specifying compiler intent are available, use them to determine whether the overall intent is to support these features; otherwise, presume an older compiler has intent to support these features and define these macros by default. */ #ifdef __GCC_IEC_559 #if __GCC_IEC_559 > 0 #define __STDC_IEC_559__ 1 #endif #else #define __STDC_IEC_559__ 1 #endif #ifdef __GCC_IEC_559_COMPLEX #if __GCC_IEC_559_COMPLEX > 0 #define __STDC_IEC_559_COMPLEX__ 1 #endif #else #define __STDC_IEC_559_COMPLEX__ 1 #endif /* wchar_t uses Unicode 9.0.0. Version 9.0 of the Unicode Standard is synchronized with ISO/IEC 10646:2014, fourth edition, plus Amd. 1 and Amd. 2 and 273 characters from forthcoming 10646, fifth edition. (Amd. 2 was published 2016-05-01, see https://www.iso.org/obp/ui/#iso:std:iso-iec:10646:ed-4:v1:amd:2:v1:en) */ #define __STDC_ISO_10646__ 201605L /* We do not support C11 . */ #define __STDC_NO_THREADS__ 1 #endif ================================================ FILE: v2/headers/linux_arm/usr/include/stdint.h ================================================ /* Copyright (C) 1997-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99: 7.18 Integer types */ #ifndef _STDINT_H #define _STDINT_H 1 #include #include #include /* Exact integral types. */ /* Signed. */ /* There is some amount of overlap with as known by inet code */ #ifndef __int8_t_defined #define __int8_t_defined typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; #if __WORDSIZE == 64 typedef long int int64_t; #else __extension__ typedef long long int int64_t; #endif #endif /* Unsigned. */ typedef unsigned char uint8_t; typedef unsigned short int uint16_t; #ifndef __uint32_t_defined typedef unsigned int uint32_t; #define __uint32_t_defined #endif #if __WORDSIZE == 64 typedef unsigned long int uint64_t; #else __extension__ typedef unsigned long long int uint64_t; #endif /* Small types. */ /* Signed. */ typedef signed char int_least8_t; typedef short int int_least16_t; typedef int int_least32_t; #if __WORDSIZE == 64 typedef long int int_least64_t; #else __extension__ typedef long long int int_least64_t; #endif /* Unsigned. */ typedef unsigned char uint_least8_t; typedef unsigned short int uint_least16_t; typedef unsigned int uint_least32_t; #if __WORDSIZE == 64 typedef unsigned long int uint_least64_t; #else __extension__ typedef unsigned long long int uint_least64_t; #endif /* Fast types. */ /* Signed. */ typedef signed char int_fast8_t; #if __WORDSIZE == 64 typedef long int int_fast16_t; typedef long int int_fast32_t; typedef long int int_fast64_t; #else typedef int int_fast16_t; typedef int int_fast32_t; __extension__ typedef long long int int_fast64_t; #endif /* Unsigned. */ typedef unsigned char uint_fast8_t; #if __WORDSIZE == 64 typedef unsigned long int uint_fast16_t; typedef unsigned long int uint_fast32_t; typedef unsigned long int uint_fast64_t; #else typedef unsigned int uint_fast16_t; typedef unsigned int uint_fast32_t; __extension__ typedef unsigned long long int uint_fast64_t; #endif /* Types for `void *' pointers. */ #if __WORDSIZE == 64 #ifndef __intptr_t_defined typedef long int intptr_t; #define __intptr_t_defined #endif typedef unsigned long int uintptr_t; #else #ifndef __intptr_t_defined typedef int intptr_t; #define __intptr_t_defined #endif typedef unsigned int uintptr_t; #endif /* Largest integral types. */ #if __WORDSIZE == 64 typedef long int intmax_t; typedef unsigned long int uintmax_t; #else __extension__ typedef long long int intmax_t; __extension__ typedef unsigned long long int uintmax_t; #endif #if __WORDSIZE == 64 #define __INT64_C(c) c ## L #define __UINT64_C(c) c ## UL #else #define __INT64_C(c) c ## LL #define __UINT64_C(c) c ## ULL #endif /* Limits of integral types. */ /* Minimum of signed integral types. */ #define INT8_MIN (-128) #define INT16_MIN (-32767-1) #define INT32_MIN (-2147483647-1) #define INT64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of signed integral types. */ #define INT8_MAX (127) #define INT16_MAX (32767) #define INT32_MAX (2147483647) #define INT64_MAX (__INT64_C(9223372036854775807)) /* Maximum of unsigned integral types. */ #define UINT8_MAX (255) #define UINT16_MAX (65535) #define UINT32_MAX (4294967295U) #define UINT64_MAX (__UINT64_C(18446744073709551615)) /* Minimum of signed integral types having a minimum size. */ #define INT_LEAST8_MIN (-128) #define INT_LEAST16_MIN (-32767-1) #define INT_LEAST32_MIN (-2147483647-1) #define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of signed integral types having a minimum size. */ #define INT_LEAST8_MAX (127) #define INT_LEAST16_MAX (32767) #define INT_LEAST32_MAX (2147483647) #define INT_LEAST64_MAX (__INT64_C(9223372036854775807)) /* Maximum of unsigned integral types having a minimum size. */ #define UINT_LEAST8_MAX (255) #define UINT_LEAST16_MAX (65535) #define UINT_LEAST32_MAX (4294967295U) #define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615)) /* Minimum of fast signed integral types having a minimum size. */ #define INT_FAST8_MIN (-128) #if __WORDSIZE == 64 #define INT_FAST16_MIN (-9223372036854775807L-1) #define INT_FAST32_MIN (-9223372036854775807L-1) #else #define INT_FAST16_MIN (-2147483647-1) #define INT_FAST32_MIN (-2147483647-1) #endif #define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of fast signed integral types having a minimum size. */ #define INT_FAST8_MAX (127) #if __WORDSIZE == 64 #define INT_FAST16_MAX (9223372036854775807L) #define INT_FAST32_MAX (9223372036854775807L) #else #define INT_FAST16_MAX (2147483647) #define INT_FAST32_MAX (2147483647) #endif #define INT_FAST64_MAX (__INT64_C(9223372036854775807)) /* Maximum of fast unsigned integral types having a minimum size. */ #define UINT_FAST8_MAX (255) #if __WORDSIZE == 64 #define UINT_FAST16_MAX (18446744073709551615UL) #define UINT_FAST32_MAX (18446744073709551615UL) #else #define UINT_FAST16_MAX (4294967295U) #define UINT_FAST32_MAX (4294967295U) #endif #define UINT_FAST64_MAX (__UINT64_C(18446744073709551615)) /* Values to test for integral types holding `void *' pointer. */ #if __WORDSIZE == 64 #define INTPTR_MIN (-9223372036854775807L-1) #define INTPTR_MAX (9223372036854775807L) #define UINTPTR_MAX (18446744073709551615UL) #else #define INTPTR_MIN (-2147483647-1) #define INTPTR_MAX (2147483647) #define UINTPTR_MAX (4294967295U) #endif /* Minimum for largest signed integral type. */ #define INTMAX_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum for largest signed integral type. */ #define INTMAX_MAX (__INT64_C(9223372036854775807)) /* Maximum for largest unsigned integral type. */ #define UINTMAX_MAX (__UINT64_C(18446744073709551615)) /* Limits of other integer types. */ /* Limits of `ptrdiff_t' type. */ #if __WORDSIZE == 64 #define PTRDIFF_MIN (-9223372036854775807L-1) #define PTRDIFF_MAX (9223372036854775807L) #else #define PTRDIFF_MIN (-2147483647-1) #define PTRDIFF_MAX (2147483647) #endif /* Limits of `sig_atomic_t'. */ #define SIG_ATOMIC_MIN (-2147483647-1) #define SIG_ATOMIC_MAX (2147483647) /* Limit of `size_t' type. */ #if __WORDSIZE == 64 #define SIZE_MAX (18446744073709551615UL) #else #ifdef __WORDSIZE32_SIZE_ULONG #define SIZE_MAX (4294967295UL) #else #define SIZE_MAX (4294967295U) #endif #endif /* Limits of `wchar_t'. */ #ifndef WCHAR_MIN /* These constants might also be defined in . */ #define WCHAR_MIN __WCHAR_MIN #define WCHAR_MAX __WCHAR_MAX #endif /* Limits of `wint_t'. */ #define WINT_MIN (0u) #define WINT_MAX (4294967295u) /* Signed. */ #define INT8_C(c) c #define INT16_C(c) c #define INT32_C(c) c #if __WORDSIZE == 64 #define INT64_C(c) c ## L #else #define INT64_C(c) c ## LL #endif /* Unsigned. */ #define UINT8_C(c) c #define UINT16_C(c) c #define UINT32_C(c) c ## U #if __WORDSIZE == 64 #define UINT64_C(c) c ## UL #else #define UINT64_C(c) c ## ULL #endif /* Maximal type. */ #if __WORDSIZE == 64 #define INTMAX_C(c) c ## L #define UINTMAX_C(c) c ## UL #else #define INTMAX_C(c) c ## LL #define UINTMAX_C(c) c ## ULL #endif #endif /* stdint.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/stdio.h ================================================ /* Define ISO C stdio on top of C++ iostreams. Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.19 Input/output */ #ifndef _STDIO_H #if !defined __need_FILE && !defined __need___FILE #define _STDIO_H 1 #include __BEGIN_DECLS #define __need_size_t #define __need_NULL #include #include #define __need_FILE #define __need___FILE #endif /* Don't need FILE. */ #if !defined __FILE_defined && defined __need_FILE /* Define outside of namespace so the C++ is happy. */ struct _IO_FILE; __BEGIN_NAMESPACE_STD /* The opaque type of streams. This is the definition used elsewhere. */ typedef struct _IO_FILE FILE; __END_NAMESPACE_STD #if defined __USE_LARGEFILE64 || defined __USE_POSIX \ || defined __USE_ISOC99 || defined __USE_XOPEN \ || defined __USE_POSIX2 __USING_NAMESPACE_STD(FILE) #endif #define __FILE_defined 1 #endif /* FILE not defined. */ #undef __need_FILE #if !defined ____FILE_defined && defined __need___FILE /* The opaque type of streams. This is the definition used elsewhere. */ typedef struct _IO_FILE __FILE; #define ____FILE_defined 1 #endif /* __FILE not defined. */ #undef __need___FILE #ifdef _STDIO_H #define _STDIO_USES_IOSTREAM #include #if defined __USE_XOPEN || defined __USE_XOPEN2K8 #ifdef __GNUC__ #ifndef _VA_LIST_DEFINED typedef _G_va_list va_list; #define _VA_LIST_DEFINED #endif #else #include #endif #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K #ifndef __off_t_defined #ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; #else typedef __off64_t off_t; #endif #define __off_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; #define __off64_t_defined #endif #endif #ifdef __USE_XOPEN2K8 #ifndef __ssize_t_defined typedef __ssize_t ssize_t; #define __ssize_t_defined #endif #endif /* The type of the second argument to `fgetpos' and `fsetpos'. */ __BEGIN_NAMESPACE_STD #ifndef __USE_FILE_OFFSET64 typedef _G_fpos_t fpos_t; #else typedef _G_fpos64_t fpos_t; #endif __END_NAMESPACE_STD #ifdef __USE_LARGEFILE64 typedef _G_fpos64_t fpos64_t; #endif /* The possibilities for the third argument to `setvbuf'. */ #define _IOFBF 0 /* Fully buffered. */ #define _IOLBF 1 /* Line buffered. */ #define _IONBF 2 /* No buffering. */ /* Default buffer size. */ #ifndef BUFSIZ #define BUFSIZ _IO_BUFSIZ #endif /* End of file character. Some things throughout the library rely on this being -1. */ #ifndef EOF #define EOF (-1) #endif /* The possibilities for the third argument to `fseek'. These values should not be changed. */ #define SEEK_SET 0 /* Seek from beginning of file. */ #define SEEK_CUR 1 /* Seek from current position. */ #define SEEK_END 2 /* Seek from end of file. */ #ifdef __USE_GNU #define SEEK_DATA 3 /* Seek to next data. */ #define SEEK_HOLE 4 /* Seek to next hole. */ #endif #if defined __USE_MISC || defined __USE_XOPEN /* Default path prefix for `tempnam' and `tmpnam'. */ #define P_tmpdir "/tmp" #endif /* Get the values: L_tmpnam How long an array of chars must be to be passed to `tmpnam'. TMP_MAX The minimum number of unique filenames generated by tmpnam (and tempnam when it uses tmpnam's name space), or tempnam (the two are separate). L_ctermid How long an array to pass to `ctermid'. L_cuserid How long an array to pass to `cuserid'. FOPEN_MAX Minimum number of files that can be open at once. FILENAME_MAX Maximum length of a filename. */ #include /* Standard streams. */ extern struct _IO_FILE *stdin; /* Standard input stream. */ extern struct _IO_FILE *stdout; /* Standard output stream. */ extern struct _IO_FILE *stderr; /* Standard error output stream. */ /* C89/C99 say they're macros. Make them happy. */ #define stdin stdin #define stdout stdout #define stderr stderr __BEGIN_NAMESPACE_STD /* Remove file FILENAME. */ extern int remove(const char *__filename) __THROW; /* Rename file OLD to NEW. */ extern int rename(const char *__old, const char *__new) __THROW; __END_NAMESPACE_STD #ifdef __USE_ATFILE /* Rename file OLD relative to OLDFD to NEW relative to NEWFD. */ extern int renameat(int __oldfd, const char *__old, int __newfd, const char *__new) __THROW; #endif __BEGIN_NAMESPACE_STD /* Create a temporary file and open it read/write. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern FILE *tmpfile(void) __wur; #else #ifdef __REDIRECT extern FILE *__REDIRECT(tmpfile, (void), tmpfile64) __wur; #else #define tmpfile tmpfile64 #endif #endif #ifdef __USE_LARGEFILE64 extern FILE *tmpfile64(void) __wur; #endif /* Generate a temporary filename. */ extern char *tmpnam(char *__s) __THROW __wur; __END_NAMESPACE_STD #ifdef __USE_MISC /* This is the reentrant variant of `tmpnam'. The only difference is that it does not allow S to be NULL. */ extern char *tmpnam_r(char *__s) __THROW __wur; #endif #if defined __USE_MISC || defined __USE_XOPEN /* Generate a unique temporary filename using up to five characters of PFX if it is not NULL. The directory to put this file in is searched for as follows: First the environment variable "TMPDIR" is checked. If it contains the name of a writable directory, that directory is used. If not and if DIR is not NULL, that value is checked. If that fails, P_tmpdir is tried and finally "/tmp". The storage for the filename is allocated by `malloc'. */ extern char *tempnam(const char *__dir, const char *__pfx) __THROW __attribute_malloc__ __wur; #endif __BEGIN_NAMESPACE_STD /* Close STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fclose(FILE * __stream); /* Flush STREAM, or all streams if STREAM is NULL. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fflush(FILE * __stream); __END_NAMESPACE_STD #ifdef __USE_MISC /* Faster versions when locking is not required. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fflush_unlocked(FILE * __stream); #endif #ifdef __USE_GNU /* Close all streams. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fcloseall(void); #endif __BEGIN_NAMESPACE_STD #ifndef __USE_FILE_OFFSET64 /* Open a file and create a new stream for it. This function is a possible cancellation point and therefore not marked with __THROW. */ extern FILE *fopen(const char *__restrict __filename, const char *__restrict __modes) __wur; /* Open a file, replacing an existing stream with it. This function is a possible cancellation point and therefore not marked with __THROW. */ extern FILE *freopen(const char *__restrict __filename, const char *__restrict __modes, FILE * __restrict __stream) __wur; #else #ifdef __REDIRECT extern FILE *__REDIRECT(fopen, (const char *__restrict __filename, const char *__restrict __modes), fopen64) __wur; extern FILE *__REDIRECT(freopen, (const char *__restrict __filename, const char *__restrict __modes, FILE * __restrict __stream), freopen64) __wur; #else #define fopen fopen64 #define freopen freopen64 #endif #endif __END_NAMESPACE_STD #ifdef __USE_LARGEFILE64 extern FILE *fopen64(const char *__restrict __filename, const char *__restrict __modes) __wur; extern FILE *freopen64(const char *__restrict __filename, const char *__restrict __modes, FILE * __restrict __stream) __wur; #endif #ifdef __USE_POSIX /* Create a new stream that refers to an existing system file descriptor. */ extern FILE *fdopen(int __fd, const char *__modes) __THROW __wur; #endif #ifdef __USE_GNU /* Create a new stream that refers to the given magic cookie, and uses the given functions for input and output. */ extern FILE *fopencookie(void *__restrict __magic_cookie, const char *__restrict __modes, _IO_cookie_io_functions_t __io_funcs) __THROW __wur; #endif #ifdef __USE_XOPEN2K8 /* Create a new stream that refers to a memory buffer. */ extern FILE *fmemopen(void *__s, size_t __len, const char *__modes) __THROW __wur; /* Open a stream that writes into a malloc'd buffer that is expanded as necessary. *BUFLOC and *SIZELOC are updated with the buffer's location and the number of characters written on fflush or fclose. */ extern FILE *open_memstream(char **__bufloc, size_t * __sizeloc) __THROW __wur; #endif __BEGIN_NAMESPACE_STD /* If BUF is NULL, make STREAM unbuffered. Else make it use buffer BUF, of size BUFSIZ. */ extern void setbuf(FILE * __restrict __stream, char *__restrict __buf) __THROW; /* Make STREAM use buffering mode MODE. If BUF is not NULL, use N bytes of it for buffering; else allocate an internal buffer N bytes long. */ extern int setvbuf(FILE * __restrict __stream, char *__restrict __buf, int __modes, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_MISC /* If BUF is NULL, make STREAM unbuffered. Else make it use SIZE bytes of BUF for buffering. */ extern void setbuffer(FILE * __restrict __stream, char *__restrict __buf, size_t __size) __THROW; /* Make STREAM line-buffered. */ extern void setlinebuf(FILE * __stream) __THROW; #endif __BEGIN_NAMESPACE_STD /* Write formatted output to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fprintf(FILE * __restrict __stream, const char *__restrict __format, ...); /* Write formatted output to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int printf(const char *__restrict __format, ...); /* Write formatted output to S. */ extern int sprintf(char *__restrict __s, const char *__restrict __format, ...) __THROWNL; /* Write formatted output to S from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfprintf(FILE * __restrict __s, const char *__restrict __format, _G_va_list __arg); /* Write formatted output to stdout from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vprintf(const char *__restrict __format, _G_va_list __arg); /* Write formatted output to S from argument list ARG. */ extern int vsprintf(char *__restrict __s, const char *__restrict __format, _G_va_list __arg) __THROWNL; __END_NAMESPACE_STD #if defined __USE_ISOC99 || defined __USE_UNIX98 __BEGIN_NAMESPACE_C99 /* Maximum chars of output to write in MAXLEN. */ extern int snprintf(char *__restrict __s, size_t __maxlen, const char *__restrict __format, ...) __THROWNL __attribute__ ((__format__(__printf__, 3, 4))); extern int vsnprintf(char *__restrict __s, size_t __maxlen, const char *__restrict __format, _G_va_list __arg) __THROWNL __attribute__ ((__format__(__printf__, 3, 0))); __END_NAMESPACE_C99 #endif #ifdef __USE_GNU /* Write formatted output to a string dynamically allocated with `malloc'. Store the address of the string in *PTR. */ extern int vasprintf(char **__restrict __ptr, const char *__restrict __f, _G_va_list __arg) __THROWNL __attribute__ ((__format__(__printf__, 2, 0))) __wur; extern int __asprintf(char **__restrict __ptr, const char *__restrict __fmt, ...) __THROWNL __attribute__ ((__format__(__printf__, 2, 3))) __wur; extern int asprintf(char **__restrict __ptr, const char *__restrict __fmt, ...) __THROWNL __attribute__ ((__format__(__printf__, 2, 3))) __wur; #endif #ifdef __USE_XOPEN2K8 /* Write formatted output to a file descriptor. */ extern int vdprintf(int __fd, const char *__restrict __fmt, _G_va_list __arg) __attribute__ ((__format__(__printf__, 2, 0))); extern int dprintf(int __fd, const char *__restrict __fmt, ...) __attribute__ ((__format__(__printf__, 2, 3))); #endif __BEGIN_NAMESPACE_STD /* Read formatted input from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fscanf(FILE * __restrict __stream, const char *__restrict __format, ...) __wur; /* Read formatted input from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int scanf(const char *__restrict __format, ...) __wur; /* Read formatted input from S. */ extern int sscanf(const char *__restrict __s, const char *__restrict __format, ...) __THROW; #if defined __USE_ISOC99 && !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) #ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT(fscanf, (FILE * __restrict __stream, const char *__restrict __format, ...), __isoc99_fscanf) __wur; extern int __REDIRECT(scanf, (const char *__restrict __format, ...), __isoc99_scanf) __wur; extern int __REDIRECT_NTH(sscanf, (const char *__restrict __s, const char *__restrict __format, ...), __isoc99_sscanf); #else extern int __isoc99_fscanf(FILE * __restrict __stream, const char *__restrict __format, ...) __wur; extern int __isoc99_scanf(const char *__restrict __format, ...) __wur; extern int __isoc99_sscanf(const char *__restrict __s, const char *__restrict __format, ...) __THROW; #define fscanf __isoc99_fscanf #define scanf __isoc99_scanf #define sscanf __isoc99_sscanf #endif #endif __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfscanf(FILE * __restrict __s, const char *__restrict __format, _G_va_list __arg) __attribute__ ((__format__(__scanf__, 2, 0))) __wur; /* Read formatted input from stdin into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vscanf(const char *__restrict __format, _G_va_list __arg) __attribute__ ((__format__(__scanf__, 1, 0))) __wur; /* Read formatted input from S into argument list ARG. */ extern int vsscanf(const char *__restrict __s, const char *__restrict __format, _G_va_list __arg) __THROW __attribute__ ((__format__(__scanf__, 2, 0))); #if !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) #ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT(vfscanf, (FILE * __restrict __s, const char *__restrict __format, _G_va_list __arg), __isoc99_vfscanf) __attribute__ ((__format__(__scanf__, 2, 0))) __wur; extern int __REDIRECT(vscanf, (const char *__restrict __format, _G_va_list __arg), __isoc99_vscanf) __attribute__ ((__format__(__scanf__, 1, 0))) __wur; extern int __REDIRECT_NTH(vsscanf, (const char *__restrict __s, const char *__restrict __format, _G_va_list __arg), __isoc99_vsscanf) __attribute__ ((__format__(__scanf__, 2, 0))); #else extern int __isoc99_vfscanf(FILE * __restrict __s, const char *__restrict __format, _G_va_list __arg) __wur; extern int __isoc99_vscanf(const char *__restrict __format, _G_va_list __arg) __wur; extern int __isoc99_vsscanf(const char *__restrict __s, const char *__restrict __format, _G_va_list __arg) __THROW; #define vfscanf __isoc99_vfscanf #define vscanf __isoc99_vscanf #define vsscanf __isoc99_vsscanf #endif #endif __END_NAMESPACE_C99 #endif /* Use ISO C9x. */ __BEGIN_NAMESPACE_STD /* Read a character from STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern int fgetc(FILE * __stream); extern int getc(FILE * __stream); /* Read a character from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getchar(void); __END_NAMESPACE_STD /* The C standard explicitly says this is a macro, so we always do the optimization for it. */ #define getc(_fp) _IO_getc (_fp) #ifdef __USE_POSIX199506 /* These are defined in POSIX.1:1996. These functions are possible cancellation points and therefore not marked with __THROW. */ extern int getc_unlocked(FILE * __stream); extern int getchar_unlocked(void); #endif /* Use POSIX. */ #ifdef __USE_MISC /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fgetc_unlocked(FILE * __stream); #endif /* Use MISC. */ __BEGIN_NAMESPACE_STD /* Write a character to STREAM. These functions are possible cancellation points and therefore not marked with __THROW. These functions is a possible cancellation point and therefore not marked with __THROW. */ extern int fputc(int __c, FILE * __stream); extern int putc(int __c, FILE * __stream); /* Write a character to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int putchar(int __c); __END_NAMESPACE_STD /* The C standard explicitly says this can be a macro, so we always do the optimization for it. */ #define putc(_ch, _fp) _IO_putc (_ch, _fp) #ifdef __USE_MISC /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputc_unlocked(int __c, FILE * __stream); #endif /* Use MISC. */ #ifdef __USE_POSIX199506 /* These are defined in POSIX.1:1996. These functions are possible cancellation points and therefore not marked with __THROW. */ extern int putc_unlocked(int __c, FILE * __stream); extern int putchar_unlocked(int __c); #endif /* Use POSIX. */ #if defined __USE_MISC \ || (defined __USE_XOPEN && !defined __USE_XOPEN2K) /* Get a word (int) from STREAM. */ extern int getw(FILE * __stream); /* Write a word (int) to STREAM. */ extern int putw(int __w, FILE * __stream); #endif __BEGIN_NAMESPACE_STD /* Get a newline-terminated string of finite length from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *fgets(char *__restrict __s, int __n, FILE * __restrict __stream) __wur; #if !defined __USE_ISOC11 \ || (defined __cplusplus && __cplusplus <= 201103L) /* Get a newline-terminated string from stdin, removing the newline. DO NOT USE THIS FUNCTION!! There is no limit on how much it will read. The function has been officially removed in ISO C11. This opportunity is used to also remove it from the GNU feature list. It is now only available when explicitly using an old ISO C, Unix, or POSIX standard. GCC defines _GNU_SOURCE when building C++ code and the function is still in C++11, so it is also available for C++. This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *gets(char *__s) __wur __attribute_deprecated__; #endif __END_NAMESPACE_STD #ifdef __USE_GNU /* This function does the same as `fgets' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern char *fgets_unlocked(char *__restrict __s, int __n, FILE * __restrict __stream) __wur; #endif #ifdef __USE_XOPEN2K8 /* Read up to (and including) a DELIMITER from STREAM into *LINEPTR (and null-terminate it). *LINEPTR is a pointer returned from malloc (or NULL), pointing to *N characters of space. It is realloc'd as necessary. Returns the number of characters read (not including the null terminator), or -1 on error or EOF. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern _IO_ssize_t __getdelim(char **__restrict __lineptr, size_t * __restrict __n, int __delimiter, FILE * __restrict __stream) __wur; extern _IO_ssize_t getdelim(char **__restrict __lineptr, size_t * __restrict __n, int __delimiter, FILE * __restrict __stream) __wur; /* Like `getdelim', but reads up to a newline. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern _IO_ssize_t getline(char **__restrict __lineptr, size_t * __restrict __n, FILE * __restrict __stream) __wur; #endif __BEGIN_NAMESPACE_STD /* Write a string to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fputs(const char *__restrict __s, FILE * __restrict __stream); /* Write a string, followed by a newline, to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int puts(const char *__s); /* Push a character back onto the input buffer of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int ungetc(int __c, FILE * __stream); /* Read chunks of generic data from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern size_t fread(void *__restrict __ptr, size_t __size, size_t __n, FILE * __restrict __stream) __wur; /* Write chunks of generic data to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern size_t fwrite(const void *__restrict __ptr, size_t __size, size_t __n, FILE * __restrict __s); __END_NAMESPACE_STD #ifdef __USE_GNU /* This function does the same as `fputs' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputs_unlocked(const char *__restrict __s, FILE * __restrict __stream); #endif #ifdef __USE_MISC /* Faster versions when locking is not necessary. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern size_t fread_unlocked(void *__restrict __ptr, size_t __size, size_t __n, FILE * __restrict __stream) __wur; extern size_t fwrite_unlocked(const void *__restrict __ptr, size_t __size, size_t __n, FILE * __restrict __stream); #endif __BEGIN_NAMESPACE_STD /* Seek to a certain position on STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fseek(FILE * __stream, long int __off, int __whence); /* Return the current position of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern long int ftell(FILE * __stream) __wur; /* Rewind to the beginning of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void rewind(FILE * __stream); __END_NAMESPACE_STD /* The Single Unix Specification, Version 2, specifies an alternative, more adequate interface for the two functions above which deal with file offset. `long int' is not the right type. These definitions are originally defined in the Large File Support API. */ #if defined __USE_LARGEFILE || defined __USE_XOPEN2K #ifndef __USE_FILE_OFFSET64 /* Seek to a certain position on STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fseeko(FILE * __stream, __off_t __off, int __whence); /* Return the current position of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern __off_t ftello(FILE * __stream) __wur; #else #ifdef __REDIRECT extern int __REDIRECT(fseeko, (FILE * __stream, __off64_t __off, int __whence), fseeko64); extern __off64_t __REDIRECT(ftello, (FILE * __stream), ftello64); #else #define fseeko fseeko64 #define ftello ftello64 #endif #endif #endif __BEGIN_NAMESPACE_STD #ifndef __USE_FILE_OFFSET64 /* Get STREAM's position. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fgetpos(FILE * __restrict __stream, fpos_t * __restrict __pos); /* Set STREAM's position. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fsetpos(FILE * __stream, const fpos_t * __pos); #else #ifdef __REDIRECT extern int __REDIRECT(fgetpos, (FILE * __restrict __stream, fpos_t * __restrict __pos), fgetpos64); extern int __REDIRECT(fsetpos, (FILE * __stream, const fpos_t * __pos), fsetpos64); #else #define fgetpos fgetpos64 #define fsetpos fsetpos64 #endif #endif __END_NAMESPACE_STD #ifdef __USE_LARGEFILE64 extern int fseeko64(FILE * __stream, __off64_t __off, int __whence); extern __off64_t ftello64(FILE * __stream) __wur; extern int fgetpos64(FILE * __restrict __stream, fpos64_t * __restrict __pos); extern int fsetpos64(FILE * __stream, const fpos64_t * __pos); #endif __BEGIN_NAMESPACE_STD /* Clear the error and EOF indicators for STREAM. */ extern void clearerr(FILE * __stream) __THROW; /* Return the EOF indicator for STREAM. */ extern int feof(FILE * __stream) __THROW __wur; /* Return the error indicator for STREAM. */ extern int ferror(FILE * __stream) __THROW __wur; __END_NAMESPACE_STD #ifdef __USE_MISC /* Faster versions when locking is not required. */ extern void clearerr_unlocked(FILE * __stream) __THROW; extern int feof_unlocked(FILE * __stream) __THROW __wur; extern int ferror_unlocked(FILE * __stream) __THROW __wur; #endif __BEGIN_NAMESPACE_STD /* Print a message describing the meaning of the value of errno. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void perror(const char *__s); __END_NAMESPACE_STD /* Provide the declarations for `sys_errlist' and `sys_nerr' if they are available on this system. Even if available, these variables should not be used directly. The `strerror' function provides all the necessary functionality. */ #include #ifdef __USE_POSIX /* Return the system file descriptor for STREAM. */ extern int fileno(FILE * __stream) __THROW __wur; #endif /* Use POSIX. */ #ifdef __USE_MISC /* Faster version when locking is not required. */ extern int fileno_unlocked(FILE * __stream) __THROW __wur; #endif #ifdef __USE_POSIX2 /* Create a new stream connected to a pipe running the given command. This function is a possible cancellation point and therefore not marked with __THROW. */ extern FILE *popen(const char *__command, const char *__modes) __wur; /* Close a stream opened by popen and return the status of its child. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int pclose(FILE * __stream); #endif #ifdef __USE_POSIX /* Return the name of the controlling terminal. */ extern char *ctermid(char *__s) __THROW; #endif /* Use POSIX. */ #if (defined __USE_XOPEN && !defined __USE_XOPEN2K) || defined __USE_GNU /* Return the name of the current user. */ extern char *cuserid(char *__s); #endif /* Use X/Open, but not issue 6. */ #ifdef __USE_GNU struct obstack; /* See . */ /* Write formatted output to an obstack. */ extern int obstack_printf(struct obstack *__restrict __obstack, const char *__restrict __format, ...) __THROWNL __attribute__ ((__format__(__printf__, 2, 3))); extern int obstack_vprintf(struct obstack *__restrict __obstack, const char *__restrict __format, _G_va_list __args) __THROWNL __attribute__ ((__format__(__printf__, 2, 0))); #endif /* Use GNU. */ #ifdef __USE_POSIX199506 /* These are defined in POSIX.1:1996. */ /* Acquire ownership of STREAM. */ extern void flockfile(FILE * __stream) __THROW; /* Try to acquire ownership of STREAM but do not block if it is not possible. */ extern int ftrylockfile(FILE * __stream) __THROW __wur; /* Relinquish the ownership granted for STREAM. */ extern void funlockfile(FILE * __stream) __THROW; #endif /* POSIX */ #if defined __USE_XOPEN && !defined __USE_XOPEN2K && !defined __USE_GNU /* The X/Open standard requires some functions and variables to be declared here which do not belong into this header. But we have to follow. In GNU mode we don't do this nonsense. */ #define __need_getopt #include #endif /* X/Open, but not issue 6 and not for GNU. */ /* If we are compiling with optimizing read this file. It contains several optimizing inline functions and macros. */ #ifdef __USE_EXTERN_INLINES #include #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function #include #endif #ifdef __LDBL_COMPAT #include #endif __END_DECLS #endif /* included. */ #endif /* !_STDIO_H */ ================================================ FILE: v2/headers/linux_arm/usr/include/stdlib.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.20 General utilities */ #ifndef _STDLIB_H #include /* Get size_t, wchar_t and NULL from . */ #define __need_size_t #ifndef __need_malloc_and_calloc #define __need_wchar_t #define __need_NULL #endif #include __BEGIN_DECLS #ifndef __need_malloc_and_calloc #define _STDLIB_H 1 #if (defined __USE_XOPEN || defined __USE_XOPEN2K8) && !defined _SYS_WAIT_H /* XPG requires a few symbols from being defined. */ #include #include /* Define the macros also would define this way. */ #define WEXITSTATUS(status) __WEXITSTATUS (status) #define WTERMSIG(status) __WTERMSIG (status) #define WSTOPSIG(status) __WSTOPSIG (status) #define WIFEXITED(status) __WIFEXITED (status) #define WIFSIGNALED(status) __WIFSIGNALED (status) #define WIFSTOPPED(status) __WIFSTOPPED (status) #ifdef __WIFCONTINUED #define WIFCONTINUED(status) __WIFCONTINUED (status) #endif #endif /* X/Open or XPG7 and not included. */ __BEGIN_NAMESPACE_STD /* Returned by `div'. */ typedef struct { int quot; /* Quotient. */ int rem; /* Remainder. */ } div_t; /* Returned by `ldiv'. */ #ifndef __ldiv_t_defined typedef struct { long int quot; /* Quotient. */ long int rem; /* Remainder. */ } ldiv_t; #define __ldiv_t_defined 1 #endif __END_NAMESPACE_STD #if defined __USE_ISOC99 && !defined __lldiv_t_defined __BEGIN_NAMESPACE_C99 /* Returned by `lldiv'. */ __extension__ typedef struct { long long int quot; /* Quotient. */ long long int rem; /* Remainder. */ } lldiv_t; #define __lldiv_t_defined 1 __END_NAMESPACE_C99 #endif /* The largest number rand will return (same as INT_MAX). */ #define RAND_MAX 2147483647 /* We define these the same for all machines. Changes from this to the outside world should be done in `_exit'. */ #define EXIT_FAILURE 1 /* Failing exit status. */ #define EXIT_SUCCESS 0 /* Successful exit status. */ /* Maximum length of a multibyte character in the current locale. */ #define MB_CUR_MAX (__ctype_get_mb_cur_max ()) extern size_t __ctype_get_mb_cur_max(void) __THROW __wur; __BEGIN_NAMESPACE_STD /* Convert a string to a floating-point number. */ extern double atof(const char *__nptr) __THROW __attribute_pure__ __nonnull((1)) __wur; /* Convert a string to an integer. */ extern int atoi(const char *__nptr) __THROW __attribute_pure__ __nonnull((1)) __wur; /* Convert a string to a long integer. */ extern long int atol(const char *__nptr) __THROW __attribute_pure__ __nonnull((1)) __wur; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Convert a string to a long long integer. */ __extension__ extern long long int atoll(const char *__nptr) __THROW __attribute_pure__ __nonnull((1)) __wur; __END_NAMESPACE_C99 #endif __BEGIN_NAMESPACE_STD /* Convert a string to a floating-point number. */ extern double strtod(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float strtof(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); extern long double strtold(const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull((1)); __END_NAMESPACE_C99 #endif __BEGIN_NAMESPACE_STD /* Convert a string to a long integer. */ extern long int strtol(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); /* Convert a string to an unsigned long integer. */ extern unsigned long int strtoul(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); __END_NAMESPACE_STD #ifdef __USE_MISC /* Convert a string to a quadword integer. */ __extension__ extern long long int strtoq(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); /* Convert a string to an unsigned quadword integer. */ __extension__ extern unsigned long long int strtouq(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); #endif /* Use misc. */ #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Convert a string to a quadword integer. */ __extension__ extern long long int strtoll(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); /* Convert a string to an unsigned quadword integer. */ __extension__ extern unsigned long long int strtoull(const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull((1)); __END_NAMESPACE_C99 #endif /* ISO C99 or use MISC. */ #ifdef __USE_GNU /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another problem is the implementation of the internationalization handling in the ISO C++ standard library. To support this another set of the functions using locale data exist which take an additional argument. Attention: even though several *_l interfaces are part of POSIX:2008, these are not. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ #include /* Special versions of the functions above which take the locale to use as an additional parameter. */ extern long int strtol_l(const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW __nonnull((1, 4)); extern unsigned long int strtoul_l(const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW __nonnull((1, 4)); __extension__ extern long long int strtoll_l(const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW __nonnull((1, 4)); __extension__ extern unsigned long long int strtoull_l(const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW __nonnull((1, 4)); extern double strtod_l(const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __THROW __nonnull((1, 3)); extern float strtof_l(const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __THROW __nonnull((1, 3)); extern long double strtold_l(const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __THROW __nonnull((1, 3)); #endif /* GNU */ #ifdef __USE_EXTERN_INLINES __BEGIN_NAMESPACE_STD __extern_inline int __NTH(atoi(const char *__nptr)) { return (int)strtol(__nptr, (char **)NULL, 10); } __extern_inline long int __NTH(atol(const char *__nptr)) { return strtol(__nptr, (char **)NULL, 10); } __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 __extension__ __extern_inline long long int __NTH(atoll(const char *__nptr)) { return strtoll(__nptr, (char **)NULL, 10); } __END_NAMESPACE_C99 #endif #endif /* Optimizing and Inlining. */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Convert N to base 64 using the digits "./0-9A-Za-z", least-significant digit first. Returns a pointer to static storage overwritten by the next call. */ extern char *l64a(long int __n) __THROW __wur; /* Read a number from a string S in base 64 as above. */ extern long int a64l(const char *__s) __THROW __attribute_pure__ __nonnull((1)) __wur; #endif /* Use misc || extended X/Open. */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED #include /* we need int32_t... */ /* These are the functions that actually do things. The `random', `srandom', `initstate' and `setstate' functions are those from BSD Unices. The `rand' and `srand' functions are required by the ANSI standard. We provide both interfaces to the same random number generator. */ /* Return a random long integer between 0 and RAND_MAX inclusive. */ extern long int random(void) __THROW; /* Seed the random number generator with the given number. */ extern void srandom(unsigned int __seed) __THROW; /* Initialize the random number generator to use state buffer STATEBUF, of length STATELEN, and seed it with SEED. Optimal lengths are 8, 16, 32, 64, 128 and 256, the bigger the better; values less than 8 will cause an error and values greater than 256 will be rounded down. */ extern char *initstate(unsigned int __seed, char *__statebuf, size_t __statelen) __THROW __nonnull((2)); /* Switch the random number generator to state buffer STATEBUF, which should have been previously initialized by `initstate'. */ extern char *setstate(char *__statebuf) __THROW __nonnull((1)); #ifdef __USE_MISC /* Reentrant versions of the `random' family of functions. These functions all use the following data structure to contain state, rather than global state variables. */ struct random_data { int32_t *fptr; /* Front pointer. */ int32_t *rptr; /* Rear pointer. */ int32_t *state; /* Array of state values. */ int rand_type; /* Type of random number generator. */ int rand_deg; /* Degree of random number generator. */ int rand_sep; /* Distance between front and rear. */ int32_t *end_ptr; /* Pointer behind state table. */ }; extern int random_r(struct random_data *__restrict __buf, int32_t * __restrict __result) __THROW __nonnull((1, 2)); extern int srandom_r(unsigned int __seed, struct random_data *__buf) __THROW __nonnull((2)); extern int initstate_r(unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) __THROW __nonnull((2, 4)); extern int setstate_r(char *__restrict __statebuf, struct random_data *__restrict __buf) __THROW __nonnull((1, 2)); #endif /* Use misc. */ #endif /* Use extended X/Open || misc. */ __BEGIN_NAMESPACE_STD /* Return a random integer between 0 and RAND_MAX inclusive. */ extern int rand(void) __THROW; /* Seed the random number generator with the given number. */ extern void srand(unsigned int __seed) __THROW; __END_NAMESPACE_STD #ifdef __USE_POSIX199506 /* Reentrant interface according to POSIX.1. */ extern int rand_r(unsigned int *__seed) __THROW; #endif #if defined __USE_MISC || defined __USE_XOPEN /* System V style 48-bit random number generator functions. */ /* Return non-negative, double-precision floating-point value in [0.0,1.0). */ extern double drand48(void) __THROW; extern double erand48(unsigned short int __xsubi[3]) __THROW __nonnull((1)); /* Return non-negative, long integer in [0,2^31). */ extern long int lrand48(void) __THROW; extern long int nrand48(unsigned short int __xsubi[3]) __THROW __nonnull((1)); /* Return signed, long integers in [-2^31,2^31). */ extern long int mrand48(void) __THROW; extern long int jrand48(unsigned short int __xsubi[3]) __THROW __nonnull((1)); /* Seed random number generator. */ extern void srand48(long int __seedval) __THROW; extern unsigned short int *seed48(unsigned short int __seed16v[3]) __THROW __nonnull((1)); extern void lcong48(unsigned short int __param[7]) __THROW __nonnull((1)); #ifdef __USE_MISC /* Data structure for communication with thread safe versions. This type is to be regarded as opaque. It's only exported because users have to allocate objects of this type. */ struct drand48_data { unsigned short int __x[3]; /* Current state. */ unsigned short int __old_x[3]; /* Old state. */ unsigned short int __c; /* Additive const. in congruential formula. */ unsigned short int __init; /* Flag for initializing. */ __extension__ unsigned long long int __a; /* Factor in congruential formula. */ }; /* Return non-negative, double-precision floating-point value in [0.0,1.0). */ extern int drand48_r(struct drand48_data *__restrict __buffer, double *__restrict __result) __THROW __nonnull((1, 2)); extern int erand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) __THROW __nonnull((1, 2)); /* Return non-negative, long integer in [0,2^31). */ extern int lrand48_r(struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull((1, 2)); extern int nrand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull((1, 2)); /* Return signed, long integers in [-2^31,2^31). */ extern int mrand48_r(struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull((1, 2)); extern int jrand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull((1, 2)); /* Seed random number generator. */ extern int srand48_r(long int __seedval, struct drand48_data *__buffer) __THROW __nonnull((2)); extern int seed48_r(unsigned short int __seed16v[3], struct drand48_data *__buffer) __THROW __nonnull((1, 2)); extern int lcong48_r(unsigned short int __param[7], struct drand48_data *__buffer) __THROW __nonnull((1, 2)); #endif /* Use misc. */ #endif /* Use misc or X/Open. */ #endif /* don't just need malloc and calloc */ #ifndef __malloc_and_calloc_defined #define __malloc_and_calloc_defined __BEGIN_NAMESPACE_STD /* Allocate SIZE bytes of memory. */ extern void *malloc(size_t __size) __THROW __attribute_malloc__ __wur; /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ extern void *calloc(size_t __nmemb, size_t __size) __THROW __attribute_malloc__ __wur; __END_NAMESPACE_STD #endif #ifndef __need_malloc_and_calloc __BEGIN_NAMESPACE_STD /* Re-allocate the previously allocated block in PTR, making the new block SIZE bytes long. */ /* __attribute_malloc__ is not used, because if realloc returns the same pointer that was passed to it, aliasing needs to be allowed between objects pointed by the old and new pointers. */ extern void *realloc(void *__ptr, size_t __size) __THROW __attribute_warn_unused_result__; /* Free a block allocated by `malloc', `realloc' or `calloc'. */ extern void free(void *__ptr) __THROW; __END_NAMESPACE_STD #ifdef __USE_MISC /* Free a block. An alias for `free'. (Sun Unices). */ extern void cfree(void *__ptr) __THROW; #endif /* Use misc. */ #ifdef __USE_MISC #include #endif /* Use misc. */ #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \ || defined __USE_MISC /* Allocate SIZE bytes on a page boundary. The storage cannot be freed. */ extern void *valloc(size_t __size) __THROW __attribute_malloc__ __wur; #endif #ifdef __USE_XOPEN2K /* Allocate memory of SIZE bytes with an alignment of ALIGNMENT. */ extern int posix_memalign(void **__memptr, size_t __alignment, size_t __size) __THROW __nonnull((1)) __wur; #endif #ifdef __USE_ISOC11 /* ISO C variant of aligned allocation. */ extern void *aligned_alloc(size_t __alignment, size_t __size) __THROW __attribute_malloc__ __attribute_alloc_size__((2)) __wur; #endif __BEGIN_NAMESPACE_STD /* Abort execution and generate a core-dump. */ extern void abort(void) __THROW __attribute__ ((__noreturn__)); /* Register a function to be called when `exit' is called. */ extern int atexit(void (*__func) (void)) __THROW __nonnull((1)); #if defined __USE_ISOC11 || defined __USE_ISOCXX11 /* Register a function to be called when `quick_exit' is called. */ #ifdef __cplusplus extern "C++" int at_quick_exit(void (*__func) (void)) __THROW __asm("at_quick_exit") __nonnull((1)); #else extern int at_quick_exit(void (*__func) (void)) __THROW __nonnull((1)); #endif #endif __END_NAMESPACE_STD #ifdef __USE_MISC /* Register a function to be called with the status given to `exit' and the given argument. */ extern int on_exit(void (*__func) (int __status, void *__arg), void *__arg) __THROW __nonnull((1)); #endif __BEGIN_NAMESPACE_STD /* Call all functions registered with `atexit' and `on_exit', in the reverse of the order in which they were registered, perform stdio cleanup, and terminate program execution with STATUS. */ extern void exit(int __status) __THROW __attribute__ ((__noreturn__)); #if defined __USE_ISOC11 || defined __USE_ISOCXX11 /* Call all functions registered with `at_quick_exit' in the reverse of the order in which they were registered and terminate program execution with STATUS. */ extern void quick_exit(int __status) __THROW __attribute__ ((__noreturn__)); #endif __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Terminate the program with STATUS without calling any of the functions registered with `atexit' or `on_exit'. */ extern void _Exit(int __status) __THROW __attribute__ ((__noreturn__)); __END_NAMESPACE_C99 #endif __BEGIN_NAMESPACE_STD /* Return the value of envariable NAME, or NULL if it doesn't exist. */ extern char *getenv(const char *__name) __THROW __nonnull((1)) __wur; __END_NAMESPACE_STD #ifdef __USE_GNU /* This function is similar to the above but returns NULL if the programs is running with SUID or SGID enabled. */ extern char *secure_getenv(const char *__name) __THROW __nonnull((1)) __wur; #endif #if defined __USE_MISC || defined __USE_XOPEN /* The SVID says this is in , but this seems a better place. */ /* Put STRING, which is of the form "NAME=VALUE", in the environment. If there is no `=', remove NAME from the environment. */ extern int putenv(char *__string) __THROW __nonnull((1)); #endif #ifdef __USE_XOPEN2K /* Set NAME to VALUE in the environment. If REPLACE is nonzero, overwrite an existing value. */ extern int setenv(const char *__name, const char *__value, int __replace) __THROW __nonnull((2)); /* Remove the variable NAME from the environment. */ extern int unsetenv(const char *__name) __THROW __nonnull((1)); #endif #ifdef __USE_MISC /* The `clearenv' was planned to be added to POSIX.1 but probably never made it. Nevertheless the POSIX.9 standard (POSIX bindings for Fortran 77) requires this function. */ extern int clearenv(void) __THROW; #endif #if defined __USE_MISC \ || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) /* Generate a unique temporary file name from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the file name unique. Always returns TEMPLATE, it's either a temporary file name or a null string if it cannot get a unique file name. */ extern char *mktemp(char *__template) __THROW __nonnull((1)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Generate a unique temporary file name from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the filename unique. Returns a file descriptor open on the file for reading and writing, or -1 if it cannot create a uniquely-named file. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int mkstemp(char *__template) __nonnull((1)) __wur; #else #ifdef __REDIRECT extern int __REDIRECT(mkstemp, (char *__template), mkstemp64) __nonnull((1)) __wur; #else #define mkstemp mkstemp64 #endif #endif #ifdef __USE_LARGEFILE64 extern int mkstemp64(char *__template) __nonnull((1)) __wur; #endif #endif #ifdef __USE_MISC /* Similar to mkstemp, but the template can have a suffix after the XXXXXX. The length of the suffix is specified in the second parameter. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int mkstemps(char *__template, int __suffixlen) __nonnull((1)) __wur; #else #ifdef __REDIRECT extern int __REDIRECT(mkstemps, (char *__template, int __suffixlen), mkstemps64) __nonnull((1)) __wur; #else #define mkstemps mkstemps64 #endif #endif #ifdef __USE_LARGEFILE64 extern int mkstemps64(char *__template, int __suffixlen) __nonnull((1)) __wur; #endif #endif #ifdef __USE_XOPEN2K8 /* Create a unique temporary directory from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the directory name unique. Returns TEMPLATE, or a null pointer if it cannot get a unique name. The directory is created mode 700. */ extern char *mkdtemp(char *__template) __THROW __nonnull((1)) __wur; #endif #ifdef __USE_GNU /* Generate a unique temporary file name from TEMPLATE similar to mkstemp. But allow the caller to pass additional flags which are used in the open call to create the file.. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int mkostemp(char *__template, int __flags) __nonnull((1)) __wur; #else #ifdef __REDIRECT extern int __REDIRECT(mkostemp, (char *__template, int __flags), mkostemp64) __nonnull((1)) __wur; #else #define mkostemp mkostemp64 #endif #endif #ifdef __USE_LARGEFILE64 extern int mkostemp64(char *__template, int __flags) __nonnull((1)) __wur; #endif /* Similar to mkostemp, but the template can have a suffix after the XXXXXX. The length of the suffix is specified in the second parameter. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern int mkostemps(char *__template, int __suffixlen, int __flags) __nonnull((1)) __wur; #else #ifdef __REDIRECT extern int __REDIRECT(mkostemps, (char *__template, int __suffixlen, int __flags), mkostemps64) __nonnull((1)) __wur; #else #define mkostemps mkostemps64 #endif #endif #ifdef __USE_LARGEFILE64 extern int mkostemps64(char *__template, int __suffixlen, int __flags) __nonnull((1)) __wur; #endif #endif __BEGIN_NAMESPACE_STD /* Execute the given line as a shell command. This function is a cancellation point and therefore not marked with __THROW. */ extern int system(const char *__command) __wur; __END_NAMESPACE_STD #ifdef __USE_GNU /* Return a malloc'd string containing the canonical absolute name of the existing named file. */ extern char *canonicalize_file_name(const char *__name) __THROW __nonnull((1)) __wur; #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Return the canonical absolute name of file NAME. If RESOLVED is null, the result is malloc'd; otherwise, if the canonical name is PATH_MAX chars or more, returns null with `errno' set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, returns the name in RESOLVED. */ extern char *realpath(const char *__restrict __name, char *__restrict __resolved) __THROW __wur; #endif /* Shorthand for type of comparison functions. */ #ifndef __COMPAR_FN_T #define __COMPAR_FN_T typedef int (*__compar_fn_t) (const void *, const void *); #ifdef __USE_GNU typedef __compar_fn_t comparison_fn_t; #endif #endif #ifdef __USE_GNU typedef int (*__compar_d_fn_t) (const void *, const void *, void *); #endif __BEGIN_NAMESPACE_STD /* Do a binary search for KEY in BASE, which consists of NMEMB elements of SIZE bytes each, using COMPAR to perform the comparisons. */ extern void *bsearch(const void *__key, const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __nonnull((1, 2, 5)) __wur; #ifdef __USE_EXTERN_INLINES #include #endif /* Sort NMEMB elements of BASE, of SIZE bytes each, using COMPAR to perform the comparisons. */ extern void qsort(void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __nonnull((1, 4)); #ifdef __USE_GNU extern void qsort_r(void *__base, size_t __nmemb, size_t __size, __compar_d_fn_t __compar, void *__arg) __nonnull((1, 4)); #endif /* Return the absolute value of X. */ extern int abs(int __x) __THROW __attribute__ ((__const__)) __wur; extern long int labs(long int __x) __THROW __attribute__ ((__const__)) __wur; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __extension__ extern long long int llabs(long long int __x) __THROW __attribute__ ((__const__)) __wur; #endif __BEGIN_NAMESPACE_STD /* Return the `div_t', `ldiv_t' or `lldiv_t' representation of the value of NUMER over DENOM. */ /* GCC may have built-ins for these someday. */ extern div_t div(int __numer, int __denom) __THROW __attribute__ ((__const__)) __wur; extern ldiv_t ldiv(long int __numer, long int __denom) __THROW __attribute__ ((__const__)) __wur; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 __extension__ extern lldiv_t lldiv(long long int __numer, long long int __denom) __THROW __attribute__ ((__const__)) __wur; __END_NAMESPACE_C99 #endif #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_MISC /* Convert floating point numbers to strings. The returned values are valid only until another call to the same function. */ /* Convert VALUE to a string with NDIGIT digits and return a pointer to this. Set *DECPT with the position of the decimal character and *SIGN with the sign of the number. */ extern char *ecvt(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull((3, 4)) __wur; /* Convert VALUE to a string rounded to NDIGIT decimal digits. Set *DECPT with the position of the decimal character and *SIGN with the sign of the number. */ extern char *fcvt(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull((3, 4)) __wur; /* If possible convert VALUE to a string with NDIGIT significant digits. Otherwise use exponential representation. The resulting string will be written to BUF. */ extern char *gcvt(double __value, int __ndigit, char *__buf) __THROW __nonnull((3)) __wur; #endif #ifdef __USE_MISC /* Long double versions of above functions. */ extern char *qecvt(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull((3, 4)) __wur; extern char *qfcvt(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull((3, 4)) __wur; extern char *qgcvt(long double __value, int __ndigit, char *__buf) __THROW __nonnull((3)) __wur; /* Reentrant version of the functions above which provide their own buffers. */ extern int ecvt_r(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull((3, 4, 5)); extern int fcvt_r(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull((3, 4, 5)); extern int qecvt_r(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull((3, 4, 5)); extern int qfcvt_r(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull((3, 4, 5)); #endif /* misc */ __BEGIN_NAMESPACE_STD /* Return the length of the multibyte character in S, which is no longer than N. */ extern int mblen(const char *__s, size_t __n) __THROW; /* Return the length of the given multibyte character, putting its `wchar_t' representation in *PWC. */ extern int mbtowc(wchar_t * __restrict __pwc, const char *__restrict __s, size_t __n) __THROW; /* Put the multibyte character represented by WCHAR in S, returning its length. */ extern int wctomb(char *__s, wchar_t __wchar) __THROW; /* Convert a multibyte string to a wide char string. */ extern size_t mbstowcs(wchar_t * __restrict __pwcs, const char *__restrict __s, size_t __n) __THROW; /* Convert a wide char string to multibyte string. */ extern size_t wcstombs(char *__restrict __s, const wchar_t * __restrict __pwcs, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_MISC /* Determine whether the string value of RESPONSE matches the affirmation or negative response expression as specified by the LC_MESSAGES category in the program's current locale. Returns 1 if affirmative, 0 if negative, and -1 if not matching. */ extern int rpmatch(const char *__response) __THROW __nonnull((1)) __wur; #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Parse comma separated suboption from *OPTIONP and match against strings in TOKENS. If found return index and set *VALUEP to optional value introduced by an equal sign. If the suboption is not part of TOKENS return in *VALUEP beginning of unknown suboption. On exit *OPTIONP is set to the beginning of the next token or at the terminating NUL character. */ extern int getsubopt(char **__restrict __optionp, char *const *__restrict __tokens, char **__restrict __valuep) __THROW __nonnull((1, 2, 3)) __wur; #endif #ifdef __USE_XOPEN /* Setup DES tables according KEY. */ extern void setkey(const char *__key) __THROW __nonnull((1)); #endif /* X/Open pseudo terminal handling. */ #ifdef __USE_XOPEN2KXSI /* Return a master pseudo-terminal handle. */ extern int posix_openpt(int __oflag) __wur; #endif #ifdef __USE_XOPEN_EXTENDED /* The next four functions all take a master pseudo-tty fd and perform an operation on the associated slave: */ /* Chown the slave to the calling user. */ extern int grantpt(int __fd) __THROW; /* Release an internal lock so the slave can be opened. Call after grantpt(). */ extern int unlockpt(int __fd) __THROW; /* Return the pathname of the pseudo terminal slave associated with the master FD is open on, or NULL on errors. The returned storage is good until the next call to this function. */ extern char *ptsname(int __fd) __THROW __wur; #endif #ifdef __USE_GNU /* Store at most BUFLEN characters of the pathname of the slave pseudo terminal associated with the master FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ptsname_r(int __fd, char *__buf, size_t __buflen) __THROW __nonnull((2)); /* Open a master pseudo terminal and return its file descriptor. */ extern int getpt(void); #endif #ifdef __USE_MISC /* Put the 1 minute, 5 minute and 15 minute load averages into the first NELEM elements of LOADAVG. Return the number written (never more than three, but may be less than NELEM), or -1 if an error occurred. */ extern int getloadavg(double __loadavg[], int __nelem) __THROW __nonnull((1)); #endif #if defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K /* Return the index into the active-logins file (utmp) for the controlling terminal. */ extern int ttyslot(void) __THROW; #endif #include /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function #include #endif #ifdef __LDBL_COMPAT #include #endif #endif /* don't just need malloc and calloc */ #undef __need_malloc_and_calloc __END_DECLS #endif /* stdlib.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/string.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.21 String handling */ #ifndef _STRING_H #define _STRING_H 1 #include __BEGIN_DECLS /* Get size_t and NULL from . */ #define __need_size_t #define __need_NULL #include /* Tell the caller that we provide correct C++ prototypes. */ #if defined __cplusplus && __GNUC_PREREQ (4, 4) #define __CORRECT_ISO_CPP_STRING_H_PROTO #endif __BEGIN_NAMESPACE_STD /* Copy N bytes of SRC to DEST. */ extern void *memcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Copy N bytes of SRC to DEST, guaranteeing correct behavior for overlapping strings. */ extern void *memmove(void *__dest, const void *__src, size_t __n) __THROW __nonnull((1, 2)); __END_NAMESPACE_STD /* Copy no more than N bytes of SRC to DEST, stopping when C is found. Return the position in DEST one byte past where C was copied, or NULL if C was not found in the first N bytes of SRC. */ #if defined __USE_MISC || defined __USE_XOPEN extern void *memccpy(void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) __THROW __nonnull((1, 2)); #endif /* Misc || X/Open. */ __BEGIN_NAMESPACE_STD /* Set N bytes of S to C. */ extern void *memset(void *__s, int __c, size_t __n) __THROW __nonnull((1)); /* Compare N bytes of S1 and S2. */ extern int memcmp(const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); /* Search N bytes of S for C. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern void *memchr(void *__s, int __c, size_t __n) __THROW __asm("memchr") __attribute_pure__ __nonnull((1)); extern const void *memchr(const void *__s, int __c, size_t __n) __THROW __asm("memchr") __attribute_pure__ __nonnull((1)); #ifdef __OPTIMIZE__ __extern_always_inline void *memchr(void *__s, int __c, size_t __n) __THROW { return __builtin_memchr(__s, __c, __n); } __extern_always_inline const void *memchr(const void *__s, int __c, size_t __n) __THROW { return __builtin_memchr(__s, __c, __n); } #endif } #else extern void *memchr(const void *__s, int __c, size_t __n) __THROW __attribute_pure__ __nonnull((1)); #endif __END_NAMESPACE_STD #ifdef __USE_GNU /* Search in S for C. This is similar to `memchr' but there is no length limit. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" void *rawmemchr(void *__s, int __c) __THROW __asm("rawmemchr") __attribute_pure__ __nonnull((1)); extern "C++" const void *rawmemchr(const void *__s, int __c) __THROW __asm("rawmemchr") __attribute_pure__ __nonnull((1)); #else extern void *rawmemchr(const void *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); #endif /* Search N bytes of S for the final occurrence of C. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" void *memrchr(void *__s, int __c, size_t __n) __THROW __asm("memrchr") __attribute_pure__ __nonnull((1)); extern "C++" const void *memrchr(const void *__s, int __c, size_t __n) __THROW __asm("memrchr") __attribute_pure__ __nonnull((1)); #else extern void *memrchr(const void *__s, int __c, size_t __n) __THROW __attribute_pure__ __nonnull((1)); #endif #endif __BEGIN_NAMESPACE_STD /* Copy SRC to DEST. */ extern char *strcpy(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1, 2)); /* Copy no more than N characters of SRC to DEST. */ extern char *strncpy(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Append SRC onto DEST. */ extern char *strcat(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1, 2)); /* Append no more than N characters from SRC onto DEST. */ extern char *strncat(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Compare S1 and S2. */ extern int strcmp(const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Compare N characters of S1 and S2. */ extern int strncmp(const char *__s1, const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); /* Compare the collated forms of S1 and S2. */ extern int strcoll(const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Put a transformation of SRC into no more than N bytes of DEST. */ extern size_t strxfrm(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((2)); __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* The following functions are equivalent to the both above but they take the locale they use for the collation as an extra argument. This is not standardsized but something like will come. */ #include /* Compare the collated forms of S1 and S2 using rules from L. */ extern int strcoll_l(const char *__s1, const char *__s2, __locale_t __l) __THROW __attribute_pure__ __nonnull((1, 2, 3)); /* Put a transformation of SRC into no more than N bytes of DEST. */ extern size_t strxfrm_l(char *__dest, const char *__src, size_t __n, __locale_t __l) __THROW __nonnull((2, 4)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Duplicate S, returning an identical malloc'd string. */ extern char *strdup(const char *__s) __THROW __attribute_malloc__ __nonnull((1)); #endif /* Return a malloc'd copy of at most N bytes of STRING. The resultant string is terminated even if no null terminator appears before STRING[N]. */ #if defined __USE_XOPEN2K8 extern char *strndup(const char *__string, size_t __n) __THROW __attribute_malloc__ __nonnull((1)); #endif #if defined __USE_GNU && defined __GNUC__ /* Duplicate S, returning an identical alloca'd string. */ #define strdupa(s) \ (__extension__ \ ({ \ const char *__old = (s); \ size_t __len = strlen (__old) + 1; \ char *__new = (char *) __builtin_alloca (__len); \ (char *) memcpy (__new, __old, __len); \ })) /* Return an alloca'd copy of at most N bytes of string. */ #define strndupa(s, n) \ (__extension__ \ ({ \ const char *__old = (s); \ size_t __len = strnlen (__old, (n)); \ char *__new = (char *) __builtin_alloca (__len + 1); \ __new[__len] = '\0'; \ (char *) memcpy (__new, __old, __len); \ })) #endif __BEGIN_NAMESPACE_STD /* Find the first occurrence of C in S. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strchr(char *__s, int __c) __THROW __asm("strchr") __attribute_pure__ __nonnull((1)); extern const char *strchr(const char *__s, int __c) __THROW __asm("strchr") __attribute_pure__ __nonnull((1)); #ifdef __OPTIMIZE__ __extern_always_inline char *strchr(char *__s, int __c) __THROW { return __builtin_strchr(__s, __c); } __extern_always_inline const char *strchr(const char *__s, int __c) __THROW { return __builtin_strchr(__s, __c); } #endif } #else extern char *strchr(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); #endif /* Find the last occurrence of C in S. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strrchr(char *__s, int __c) __THROW __asm("strrchr") __attribute_pure__ __nonnull((1)); extern const char *strrchr(const char *__s, int __c) __THROW __asm("strrchr") __attribute_pure__ __nonnull((1)); #ifdef __OPTIMIZE__ __extern_always_inline char *strrchr(char *__s, int __c) __THROW { return __builtin_strrchr(__s, __c); } __extern_always_inline const char *strrchr(const char *__s, int __c) __THROW { return __builtin_strrchr(__s, __c); } #endif } #else extern char *strrchr(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); #endif __END_NAMESPACE_STD #ifdef __USE_GNU /* This function is similar to `strchr'. But it returns a pointer to the closing NUL byte in case C is not found in S. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *strchrnul(char *__s, int __c) __THROW __asm("strchrnul") __attribute_pure__ __nonnull((1)); extern "C++" const char *strchrnul(const char *__s, int __c) __THROW __asm("strchrnul") __attribute_pure__ __nonnull((1)); #else extern char *strchrnul(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); #endif #endif __BEGIN_NAMESPACE_STD /* Return the length of the initial segment of S which consists entirely of characters not in REJECT. */ extern size_t strcspn(const char *__s, const char *__reject) __THROW __attribute_pure__ __nonnull((1, 2)); /* Return the length of the initial segment of S which consists entirely of characters in ACCEPT. */ extern size_t strspn(const char *__s, const char *__accept) __THROW __attribute_pure__ __nonnull((1, 2)); /* Find the first occurrence in S of any character in ACCEPT. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strpbrk(char *__s, const char *__accept) __THROW __asm("strpbrk") __attribute_pure__ __nonnull((1, 2)); extern const char *strpbrk(const char *__s, const char *__accept) __THROW __asm("strpbrk") __attribute_pure__ __nonnull((1, 2)); #ifdef __OPTIMIZE__ __extern_always_inline char *strpbrk(char *__s, const char *__accept) __THROW { return __builtin_strpbrk(__s, __accept); } __extern_always_inline const char *strpbrk(const char *__s, const char *__accept) __THROW { return __builtin_strpbrk(__s, __accept); } #endif } #else extern char *strpbrk(const char *__s, const char *__accept) __THROW __attribute_pure__ __nonnull((1, 2)); #endif /* Find the first occurrence of NEEDLE in HAYSTACK. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strstr(char *__haystack, const char *__needle) __THROW __asm("strstr") __attribute_pure__ __nonnull((1, 2)); extern const char *strstr(const char *__haystack, const char *__needle) __THROW __asm("strstr") __attribute_pure__ __nonnull((1, 2)); #ifdef __OPTIMIZE__ __extern_always_inline char *strstr(char *__haystack, const char *__needle) __THROW { return __builtin_strstr(__haystack, __needle); } __extern_always_inline const char *strstr(const char *__haystack, const char *__needle) __THROW { return __builtin_strstr(__haystack, __needle); } #endif } #else extern char *strstr(const char *__haystack, const char *__needle) __THROW __attribute_pure__ __nonnull((1, 2)); #endif /* Divide S into tokens separated by characters in DELIM. */ extern char *strtok(char *__restrict __s, const char *__restrict __delim) __THROW __nonnull((2)); __END_NAMESPACE_STD /* Divide S into tokens separated by characters in DELIM. Information passed between calls are stored in SAVE_PTR. */ extern char *__strtok_r(char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __THROW __nonnull((2, 3)); #ifdef __USE_POSIX extern char *strtok_r(char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __THROW __nonnull((2, 3)); #endif #ifdef __USE_GNU /* Similar to `strstr' but this function ignores the case of both strings. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *strcasestr(char *__haystack, const char *__needle) __THROW __asm("strcasestr") __attribute_pure__ __nonnull((1, 2)); extern "C++" const char *strcasestr(const char *__haystack, const char *__needle) __THROW __asm("strcasestr") __attribute_pure__ __nonnull((1, 2)); #else extern char *strcasestr(const char *__haystack, const char *__needle) __THROW __attribute_pure__ __nonnull((1, 2)); #endif #endif #ifdef __USE_GNU /* Find the first occurrence of NEEDLE in HAYSTACK. NEEDLE is NEEDLELEN bytes long; HAYSTACK is HAYSTACKLEN bytes long. */ extern void *memmem(const void *__haystack, size_t __haystacklen, const void *__needle, size_t __needlelen) __THROW __attribute_pure__ __nonnull((1, 3)); /* Copy N bytes of SRC to DEST, return pointer to bytes after the last written byte. */ extern void *__mempcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); extern void *mempcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); #endif __BEGIN_NAMESPACE_STD /* Return the length of S. */ extern size_t strlen(const char *__s) __THROW __attribute_pure__ __nonnull((1)); __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Find the length of STRING, but scan at most MAXLEN characters. If no '\0' terminator is found in that many characters, return MAXLEN. */ extern size_t strnlen(const char *__string, size_t __maxlen) __THROW __attribute_pure__ __nonnull((1)); #endif __BEGIN_NAMESPACE_STD /* Return a string describing the meaning of the `errno' code in ERRNUM. */ extern char *strerror(int __errnum) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K /* Reentrant version of `strerror'. There are 2 flavors of `strerror_r', GNU which returns the string and may or may not use the supplied temporary buffer and POSIX one which fills the string into the buffer. To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L without -D_GNU_SOURCE is needed, otherwise the GNU version is preferred. */ #if defined __USE_XOPEN2K && !defined __USE_GNU /* Fill BUF with a string describing the meaning of the `errno' code in ERRNUM. */ #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(strerror_r, (int __errnum, char *__buf, size_t __buflen), __xpg_strerror_r) __nonnull((2)); #else extern int __xpg_strerror_r(int __errnum, char *__buf, size_t __buflen) __THROW __nonnull((2)); #define strerror_r __xpg_strerror_r #endif #else /* If a temporary buffer is required, at most BUFLEN bytes of BUF will be used. */ extern char *strerror_r(int __errnum, char *__buf, size_t __buflen) __THROW __nonnull((2)) __wur; #endif #endif #ifdef __USE_XOPEN2K8 /* Translate error number to string according to the locale L. */ extern char *strerror_l(int __errnum, __locale_t __l) __THROW; #endif /* We define this function always since `bzero' is sometimes needed when the namespace rules does not allow this. */ extern void __bzero(void *__s, size_t __n) __THROW __nonnull((1)); #ifdef __USE_MISC /* Copy N bytes of SRC to DEST (like memmove, but args reversed). */ extern void bcopy(const void *__src, void *__dest, size_t __n) __THROW __nonnull((1, 2)); /* Set N bytes of S to 0. */ extern void bzero(void *__s, size_t __n) __THROW __nonnull((1)); /* Compare N bytes of S1 and S2 (same as memcmp). */ extern int bcmp(const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); /* Find the first occurrence of C in S (same as strchr). */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *index(char *__s, int __c) __THROW __asm("index") __attribute_pure__ __nonnull((1)); extern const char *index(const char *__s, int __c) __THROW __asm("index") __attribute_pure__ __nonnull((1)); #if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO __extern_always_inline char *index(char *__s, int __c) __THROW { return __builtin_index(__s, __c); } __extern_always_inline const char *index(const char *__s, int __c) __THROW { return __builtin_index(__s, __c); } #endif } #else extern char *index(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); #endif /* Find the last occurrence of C in S (same as strrchr). */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *rindex(char *__s, int __c) __THROW __asm("rindex") __attribute_pure__ __nonnull((1)); extern const char *rindex(const char *__s, int __c) __THROW __asm("rindex") __attribute_pure__ __nonnull((1)); #if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO __extern_always_inline char *rindex(char *__s, int __c) __THROW { return __builtin_rindex(__s, __c); } __extern_always_inline const char *rindex(const char *__s, int __c) __THROW { return __builtin_rindex(__s, __c); } #endif } #else extern char *rindex(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); #endif /* Return the position of the first bit set in I, or 0 if none are set. The least-significant bit is position 1, the most-significant 32. */ extern int ffs(int __i) __THROW __attribute__ ((__const__)); /* The following two functions are non-standard but necessary for non-32 bit platforms. */ #ifdef __USE_GNU extern int ffsl(long int __l) __THROW __attribute__ ((__const__)); __extension__ extern int ffsll(long long int __ll) __THROW __attribute__ ((__const__)); #endif /* Compare S1 and S2, ignoring case. */ extern int strcasecmp(const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int strncasecmp(const char *__s1, const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); #endif /* Use misc. */ #ifdef __USE_GNU /* Again versions of a few functions which use the given locale instead of the global one. */ extern int strcasecmp_l(const char *__s1, const char *__s2, __locale_t __loc) __THROW __attribute_pure__ __nonnull((1, 2, 3)); extern int strncasecmp_l(const char *__s1, const char *__s2, size_t __n, __locale_t __loc) __THROW __attribute_pure__ __nonnull((1, 2, 4)); #endif #ifdef __USE_MISC /* Return the next DELIM-delimited token from *STRINGP, terminating it with a '\0', and update *STRINGP to point past it. */ extern char *strsep(char **__restrict __stringp, const char *__restrict __delim) __THROW __nonnull((1, 2)); #endif #ifdef __USE_XOPEN2K8 /* Return a string describing the meaning of the signal number in SIG. */ extern char *strsignal(int __sig) __THROW; /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ extern char *__stpcpy(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1, 2)); extern char *stpcpy(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1, 2)); /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ extern char *__stpncpy(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); extern char *stpncpy(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((1, 2)); #endif #ifdef __USE_GNU /* Compare S1 and S2 as strings holding name & indices/version numbers. */ extern int strverscmp(const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Sautee STRING briskly. */ extern char *strfry(char *__string) __THROW __nonnull((1)); /* Frobnicate N bytes of S. */ extern void *memfrob(void *__s, size_t __n) __THROW __nonnull((1)); #ifndef basename /* Return the file name within directory of FILENAME. We don't declare the function if the `basename' macro is available (defined in ) which makes the XPG version of this function available. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *basename(char *__filename) __THROW __asm("basename") __nonnull((1)); extern "C++" const char *basename(const char *__filename) __THROW __asm("basename") __nonnull((1)); #else extern char *basename(const char *__filename) __THROW __nonnull((1)); #endif #endif #endif #if __GNUC_PREREQ (3,4) #if defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ \ && !defined __NO_INLINE__ && !defined __cplusplus /* When using GNU CC we provide some optimized versions of selected functions from this header. There are two kinds of optimizations: - machine-dependent optimizations, most probably using inline assembler code; these might be quite expensive since the code size can increase significantly. These optimizations are not used unless the symbol __USE_STRING_INLINES is defined before including this header. - machine-independent optimizations which do not increase the code size significantly and which optimize mainly situations where one or more arguments are compile-time constants. These optimizations are used always when the compiler is taught to optimize. One can inhibit all optimizations by defining __NO_STRING_INLINES. */ /* Get the machine-dependent optimizations (if any). */ #include /* These are generic optimizations which do not add too much inline code. */ #include #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function /* Functions with security checks. */ #include #endif #endif #if defined __USE_GNU && defined __OPTIMIZE__ \ && defined __extern_always_inline && __GNUC_PREREQ (3,2) #if !defined _FORCE_INLINES && !defined _HAVE_STRING_ARCH_mempcpy #define mempcpy(dest, src, n) __mempcpy_inline (dest, src, n) #define __mempcpy(dest, src, n) __mempcpy_inline (dest, src, n) __extern_always_inline void *__mempcpy_inline(void *__restrict __dest, const void *__restrict __src, size_t __n) { return (char *)memcpy(__dest, __src, __n) + __n; } #endif #endif __END_DECLS #endif /* string.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/strings.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STRINGS_H #define _STRINGS_H 1 /* We don't need and should not read this file if was already read. The one exception being that if __USE_MISC isn't defined, then these aren't defined in string.h, so we need to define them here. */ #if !defined _STRING_H || !defined __USE_MISC #include #define __need_size_t #include /* Tell the caller that we provide correct C++ prototypes. */ #if defined __cplusplus && __GNUC_PREREQ (4, 4) #define __CORRECT_ISO_CPP_STRINGS_H_PROTO #endif __BEGIN_DECLS #if defined __USE_MISC || !defined __USE_XOPEN2K8 /* Compare N bytes of S1 and S2 (same as memcmp). */ extern int bcmp(const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__; /* Copy N bytes of SRC to DEST (like memmove, but args reversed). */ extern void bcopy(const void *__src, void *__dest, size_t __n) __THROW; /* Set N bytes of S to 0. */ extern void bzero(void *__s, size_t __n) __THROW; /* Find the first occurrence of C in S (same as strchr). */ #ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO extern "C++" { extern char *index(char *__s, int __c) __THROW __asm("index") __attribute_pure__ __nonnull((1)); extern const char *index(const char *__s, int __c) __THROW __asm("index") __attribute_pure__ __nonnull((1)); #if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRING_H_PROTO __extern_always_inline char *index(char *__s, int __c) __THROW { return __builtin_index(__s, __c); } __extern_always_inline const char *index(const char *__s, int __c) __THROW { return __builtin_index(__s, __c); } #endif } #else extern char *index(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); #endif /* Find the last occurrence of C in S (same as strrchr). */ #ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO extern "C++" { extern char *rindex(char *__s, int __c) __THROW __asm("rindex") __attribute_pure__ __nonnull((1)); extern const char *rindex(const char *__s, int __c) __THROW __asm("rindex") __attribute_pure__ __nonnull((1)); #if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRING_H_PROTO __extern_always_inline char *rindex(char *__s, int __c) __THROW { return __builtin_rindex(__s, __c); } __extern_always_inline const char *rindex(const char *__s, int __c) __THROW { return __builtin_rindex(__s, __c); } #endif } #else extern char *rindex(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1)); #endif #endif #if defined __USE_MISC || !defined __USE_XOPEN2K8 || defined __USE_XOPEN2K8XSI /* Return the position of the first bit set in I, or 0 if none are set. The least-significant bit is position 1, the most-significant 32. */ extern int ffs(int __i) __THROW __attribute__ ((const)); #endif /* Compare S1 and S2, ignoring case. */ extern int strcasecmp(const char *__s1, const char *__s2) __THROW __attribute_pure__; /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int strncasecmp(const char *__s1, const char *__s2, size_t __n) __THROW __attribute_pure__; #ifdef __USE_XOPEN2K8 /* The following functions are equivalent to the both above but they take the locale they use for the collation as an extra argument. This is not standardsized but something like will come. */ #include /* Again versions of a few functions which use the given locale instead of the global one. */ extern int strcasecmp_l(const char *__s1, const char *__s2, __locale_t __loc) __THROW __attribute_pure__ __nonnull((1, 2, 3)); extern int strncasecmp_l(const char *__s1, const char *__s2, size_t __n, __locale_t __loc) __THROW __attribute_pure__ __nonnull((1, 2, 4)); #endif __END_DECLS #endif /* string.h */ #endif /* strings.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/termios.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 7.1-2 General Terminal Interface */ #ifndef _TERMIOS_H #define _TERMIOS_H 1 #include #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* We need `pid_t'. */ #include #ifndef __pid_t_defined typedef __pid_t pid_t; #define __pid_t_defined #endif #endif __BEGIN_DECLS /* Get the system-dependent definitions of `struct termios', `tcflag_t', `cc_t', `speed_t', and all the macros specifying the flag bits. */ #include #ifdef __USE_MISC /* Compare a character C to a value VAL from the `c_cc' array in a `struct termios'. If VAL is _POSIX_VDISABLE, no character can match it. */ #define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE) #endif /* Return the output baud rate stored in *TERMIOS_P. */ extern speed_t cfgetospeed(const struct termios *__termios_p) __THROW; /* Return the input baud rate stored in *TERMIOS_P. */ extern speed_t cfgetispeed(const struct termios *__termios_p) __THROW; /* Set the output baud rate stored in *TERMIOS_P to SPEED. */ extern int cfsetospeed(struct termios *__termios_p, speed_t __speed) __THROW; /* Set the input baud rate stored in *TERMIOS_P to SPEED. */ extern int cfsetispeed(struct termios *__termios_p, speed_t __speed) __THROW; #ifdef __USE_MISC /* Set both the input and output baud rates in *TERMIOS_OP to SPEED. */ extern int cfsetspeed(struct termios *__termios_p, speed_t __speed) __THROW; #endif /* Put the state of FD into *TERMIOS_P. */ extern int tcgetattr(int __fd, struct termios *__termios_p) __THROW; /* Set the state of FD to *TERMIOS_P. Values for OPTIONAL_ACTIONS (TCSA*) are in . */ extern int tcsetattr(int __fd, int __optional_actions, const struct termios *__termios_p) __THROW; #ifdef __USE_MISC /* Set *TERMIOS_P to indicate raw mode. */ extern void cfmakeraw(struct termios *__termios_p) __THROW; #endif /* Send zero bits on FD. */ extern int tcsendbreak(int __fd, int __duration) __THROW; /* Wait for pending output to be written on FD. This function is a cancellation point and therefore not marked with __THROW. */ extern int tcdrain(int __fd); /* Flush pending data on FD. Values for QUEUE_SELECTOR (TC{I,O,IO}FLUSH) are in . */ extern int tcflush(int __fd, int __queue_selector) __THROW; /* Suspend or restart transmission on FD. Values for ACTION (TC[IO]{OFF,ON}) are in . */ extern int tcflow(int __fd, int __action) __THROW; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Get process group ID for session leader for controlling terminal FD. */ extern __pid_t tcgetsid(int __fd) __THROW; #endif #ifdef __USE_MISC #include #endif __END_DECLS #endif /* termios.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/time.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.23 Date and time */ #ifndef _TIME_H #if (! defined __need_time_t && !defined __need_clock_t && \ ! defined __need_timespec) #define _TIME_H 1 #include __BEGIN_DECLS #endif #ifdef _TIME_H /* Get size_t and NULL from . */ #define __need_size_t #define __need_NULL #include /* This defines CLOCKS_PER_SEC, which is the number of processor clock ticks per second. */ #include /* This is the obsolete POSIX.1-1988 name for the same constant. */ #if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K #ifndef CLK_TCK #define CLK_TCK CLOCKS_PER_SEC #endif #endif #endif /* included. */ #if !defined __clock_t_defined && (defined _TIME_H || defined __need_clock_t) #define __clock_t_defined 1 #include __BEGIN_NAMESPACE_STD /* Returned by `clock'. */ typedef __clock_t clock_t; __END_NAMESPACE_STD #if defined __USE_XOPEN || defined __USE_POSIX __USING_NAMESPACE_STD(clock_t) #endif #endif /* clock_t not defined and or need clock_t. */ #undef __need_clock_t #if !defined __time_t_defined && (defined _TIME_H || defined __need_time_t) #define __time_t_defined 1 #include __BEGIN_NAMESPACE_STD /* Returned by `time'. */ typedef __time_t time_t; __END_NAMESPACE_STD #ifdef __USE_POSIX __USING_NAMESPACE_STD(time_t) #endif #endif /* time_t not defined and or need time_t. */ #undef __need_time_t #if !defined __clockid_t_defined && \ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_clockid_t) #define __clockid_t_defined 1 #include /* Clock ID used in clock and timer functions. */ typedef __clockid_t clockid_t; #endif /* clockid_t not defined and or need clockid_t. */ #undef __clockid_time_t #if !defined __timer_t_defined && \ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timer_t) #define __timer_t_defined 1 #include /* Timer ID returned by `timer_create'. */ typedef __timer_t timer_t; #endif /* timer_t not defined and or need timer_t. */ #undef __need_timer_t #if (!defined __timespec_defined \ && ((defined _TIME_H \ && (defined __USE_POSIX199309 \ || defined __USE_ISOC11)) \ || defined __need_timespec)) #define __timespec_defined 1 #include /* This defines __time_t for us. */ /* POSIX.1b structure for a time value. This is like a `struct timeval' but has nanoseconds instead of microseconds. */ struct timespec { __time_t tv_sec; /* Seconds. */ __syscall_slong_t tv_nsec; /* Nanoseconds. */ }; #endif /* timespec not defined and or need timespec. */ #undef __need_timespec #ifdef _TIME_H __BEGIN_NAMESPACE_STD /* Used by other time functions. */ struct tm { int tm_sec; /* Seconds. [0-60] (1 leap second) */ int tm_min; /* Minutes. [0-59] */ int tm_hour; /* Hours. [0-23] */ int tm_mday; /* Day. [1-31] */ int tm_mon; /* Month. [0-11] */ int tm_year; /* Year - 1900. */ int tm_wday; /* Day of week. [0-6] */ int tm_yday; /* Days in year.[0-365] */ int tm_isdst; /* DST. [-1/0/1] */ #ifdef __USE_MISC long int tm_gmtoff; /* Seconds east of UTC. */ const char *tm_zone; /* Timezone abbreviation. */ #else long int __tm_gmtoff; /* Seconds east of UTC. */ const char *__tm_zone; /* Timezone abbreviation. */ #endif }; __END_NAMESPACE_STD #if defined __USE_XOPEN || defined __USE_POSIX __USING_NAMESPACE_STD(tm) #endif #ifdef __USE_POSIX199309 /* POSIX.1b structure for timer start values and intervals. */ struct itimerspec { struct timespec it_interval; struct timespec it_value; }; /* We can use a simple forward declaration. */ struct sigevent; #endif /* POSIX.1b */ #ifdef __USE_XOPEN2K #ifndef __pid_t_defined typedef __pid_t pid_t; #define __pid_t_defined #endif #endif #ifdef __USE_ISOC11 /* Time base values for timespec_get. */ #define TIME_UTC 1 #endif __BEGIN_NAMESPACE_STD /* Time used by the program so far (user time + system time). The result / CLOCKS_PER_SECOND is program time in seconds. */ extern clock_t clock(void) __THROW; /* Return the current time and put it in *TIMER if TIMER is not NULL. */ extern time_t time(time_t * __timer) __THROW; /* Return the difference between TIME1 and TIME0. */ extern double difftime(time_t __time1, time_t __time0) __THROW __attribute__ ((__const__)); /* Return the `time_t' representation of TP and normalize TP. */ extern time_t mktime(struct tm *__tp) __THROW; /* Format TP into S according to FORMAT. Write no more than MAXSIZE characters and return the number of characters written, or 0 if it would exceed MAXSIZE. */ extern size_t strftime(char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN /* Parse S according to FORMAT and store binary time information in TP. The return value is a pointer to the first unparsed character in S. */ extern char *strptime(const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp) __THROW; #endif #ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ #include extern size_t strftime_l(char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp, __locale_t __loc) __THROW; #endif #ifdef __USE_GNU extern char *strptime_l(const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp, __locale_t __loc) __THROW; #endif __BEGIN_NAMESPACE_STD /* Return the `struct tm' representation of *TIMER in Universal Coordinated Time (aka Greenwich Mean Time). */ extern struct tm *gmtime(const time_t * __timer) __THROW; /* Return the `struct tm' representation of *TIMER in the local timezone. */ extern struct tm *localtime(const time_t * __timer) __THROW; __END_NAMESPACE_STD #ifdef __USE_POSIX /* Return the `struct tm' representation of *TIMER in UTC, using *TP to store the result. */ extern struct tm *gmtime_r(const time_t * __restrict __timer, struct tm *__restrict __tp) __THROW; /* Return the `struct tm' representation of *TIMER in local time, using *TP to store the result. */ extern struct tm *localtime_r(const time_t * __restrict __timer, struct tm *__restrict __tp) __THROW; #endif /* POSIX */ __BEGIN_NAMESPACE_STD /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ extern char *asctime(const struct tm *__tp) __THROW; /* Equivalent to `asctime (localtime (timer))'. */ extern char *ctime(const time_t * __timer) __THROW; __END_NAMESPACE_STD #ifdef __USE_POSIX /* Reentrant versions of the above functions. */ /* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ extern char *asctime_r(const struct tm *__restrict __tp, char *__restrict __buf) __THROW; /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */ extern char *ctime_r(const time_t * __restrict __timer, char *__restrict __buf) __THROW; #endif /* POSIX */ /* Defined in localtime.c. */ extern char *__tzname[2]; /* Current timezone names. */ extern int __daylight; /* If daylight-saving time is ever in use. */ extern long int __timezone; /* Seconds west of UTC. */ #ifdef __USE_POSIX /* Same as above. */ extern char *tzname[2]; /* Set time conversion information from the TZ environment variable. If TZ is not defined, a locale-dependent default is used. */ extern void tzset(void) __THROW; #endif #if defined __USE_MISC || defined __USE_XOPEN extern int daylight; extern long int timezone; #endif #ifdef __USE_MISC /* Set the system time to *WHEN. This call is restricted to the superuser. */ extern int stime(const time_t * __when) __THROW; #endif /* Nonzero if YEAR is a leap year (every 4 years, except every 100th isn't, and every 400th is). */ #define __isleap(year) \ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) #ifdef __USE_MISC /* Miscellaneous functions many Unices inherited from the public domain localtime package. These are included only for compatibility. */ /* Like `mktime', but for TP represents Universal Time, not local time. */ extern time_t timegm(struct tm *__tp) __THROW; /* Another name for `mktime'. */ extern time_t timelocal(struct tm *__tp) __THROW; /* Return the number of days in YEAR. */ extern int dysize(int __year) __THROW __attribute__ ((__const__)); #endif #ifdef __USE_POSIX199309 /* Pause execution for a number of nanoseconds. This function is a cancellation point and therefore not marked with __THROW. */ extern int nanosleep(const struct timespec *__requested_time, struct timespec *__remaining); /* Get resolution of clock CLOCK_ID. */ extern int clock_getres(clockid_t __clock_id, struct timespec *__res) __THROW; /* Get current value of clock CLOCK_ID and store it in TP. */ extern int clock_gettime(clockid_t __clock_id, struct timespec *__tp) __THROW; /* Set clock CLOCK_ID to value TP. */ extern int clock_settime(clockid_t __clock_id, const struct timespec *__tp) __THROW; #ifdef __USE_XOPEN2K /* High-resolution sleep with the specified clock. This function is a cancellation point and therefore not marked with __THROW. */ extern int clock_nanosleep(clockid_t __clock_id, int __flags, const struct timespec *__req, struct timespec *__rem); /* Return clock ID for CPU-time clock. */ extern int clock_getcpuclockid(pid_t __pid, clockid_t * __clock_id) __THROW; #endif /* Create new per-process timer using CLOCK_ID. */ extern int timer_create(clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t * __restrict __timerid) __THROW; /* Delete timer TIMERID. */ extern int timer_delete(timer_t __timerid) __THROW; /* Set timer TIMERID to VALUE, returning old value in OVALUE. */ extern int timer_settime(timer_t __timerid, int __flags, const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __THROW; /* Get current value of timer TIMERID and store it in VALUE. */ extern int timer_gettime(timer_t __timerid, struct itimerspec *__value) __THROW; /* Get expiration overrun for timer TIMERID. */ extern int timer_getoverrun(timer_t __timerid) __THROW; #endif #ifdef __USE_ISOC11 /* Set TS to calendar time based in time base BASE. */ extern int timespec_get(struct timespec *__ts, int __base) __THROW __nonnull((1)); #endif #ifdef __USE_XOPEN_EXTENDED /* Set to one of the following values to indicate an error. 1 the DATEMSK environment variable is null or undefined, 2 the template file cannot be opened for reading, 3 failed to get file status information, 4 the template file is not a regular file, 5 an error is encountered while reading the template file, 6 memory allication failed (not enough memory available), 7 there is no line in the template that matches the input, 8 invalid input specification Example: February 31 or a time is specified that can not be represented in a time_t (representing the time in seconds since 00:00:00 UTC, January 1, 1970) */ extern int getdate_err; /* Parse the given string as a date specification and return a value representing the value. The templates from the file identified by the environment variable DATEMSK are used. In case of an error `getdate_err' is set. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct tm *getdate(const char *__string); #endif #ifdef __USE_GNU /* Since `getdate' is not reentrant because of the use of `getdate_err' and the static buffer to return the result in, we provide a thread-safe variant. The functionality is the same. The result is returned in the buffer pointed to by RESBUFP and in case of an error the return value is != 0 with the same values as given above for `getdate_err'. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getdate_r(const char *__restrict __string, struct tm *__restrict __resbufp); #endif __END_DECLS #endif /* included. */ #endif /* not already included. */ ================================================ FILE: v2/headers/linux_arm/usr/include/unistd.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 2.10 Symbolic Constants */ #ifndef _UNISTD_H #define _UNISTD_H 1 #include __BEGIN_DECLS /* These may be used to determine what facilities are present at compile time. Their values can be obtained at run time from `sysconf'. */ #ifdef __USE_XOPEN2K8 /* POSIX Standard approved as ISO/IEC 9945-1 as of September 2008. */ #define _POSIX_VERSION 200809L #elif defined __USE_XOPEN2K /* POSIX Standard approved as ISO/IEC 9945-1 as of December 2001. */ #define _POSIX_VERSION 200112L #elif defined __USE_POSIX199506 /* POSIX Standard approved as ISO/IEC 9945-1 as of June 1995. */ #define _POSIX_VERSION 199506L #elif defined __USE_POSIX199309 /* POSIX Standard approved as ISO/IEC 9945-1 as of September 1993. */ #define _POSIX_VERSION 199309L #else /* POSIX Standard approved as ISO/IEC 9945-1 as of September 1990. */ #define _POSIX_VERSION 199009L #endif /* These are not #ifdef __USE_POSIX2 because they are in the theoretically application-owned namespace. */ #ifdef __USE_XOPEN2K8 #define __POSIX2_THIS_VERSION 200809L /* The utilities on GNU systems also correspond to this version. */ #elif defined __USE_XOPEN2K /* The utilities on GNU systems also correspond to this version. */ #define __POSIX2_THIS_VERSION 200112L #elif defined __USE_POSIX199506 /* The utilities on GNU systems also correspond to this version. */ #define __POSIX2_THIS_VERSION 199506L #else /* The utilities on GNU systems also correspond to this version. */ #define __POSIX2_THIS_VERSION 199209L #endif /* The utilities on GNU systems also correspond to this version. */ #define _POSIX2_VERSION __POSIX2_THIS_VERSION /* This symbol was required until the 2001 edition of POSIX. */ #define _POSIX2_C_VERSION __POSIX2_THIS_VERSION /* If defined, the implementation supports the C Language Bindings Option. */ #define _POSIX2_C_BIND __POSIX2_THIS_VERSION /* If defined, the implementation supports the C Language Development Utilities Option. */ #define _POSIX2_C_DEV __POSIX2_THIS_VERSION /* If defined, the implementation supports the Software Development Utilities Option. */ #define _POSIX2_SW_DEV __POSIX2_THIS_VERSION /* If defined, the implementation supports the creation of locales with the localedef utility. */ #define _POSIX2_LOCALEDEF __POSIX2_THIS_VERSION /* X/Open version number to which the library conforms. It is selectable. */ #ifdef __USE_XOPEN2K8 #define _XOPEN_VERSION 700 #elif defined __USE_XOPEN2K #define _XOPEN_VERSION 600 #elif defined __USE_UNIX98 #define _XOPEN_VERSION 500 #else #define _XOPEN_VERSION 4 #endif /* Commands and utilities from XPG4 are available. */ #define _XOPEN_XCU_VERSION 4 /* We are compatible with the old published standards as well. */ #define _XOPEN_XPG2 1 #define _XOPEN_XPG3 1 #define _XOPEN_XPG4 1 /* The X/Open Unix extensions are available. */ #define _XOPEN_UNIX 1 /* Encryption is present. */ #define _XOPEN_CRYPT 1 /* The enhanced internationalization capabilities according to XPG4.2 are present. */ #define _XOPEN_ENH_I18N 1 /* The legacy interfaces are also available. */ #define _XOPEN_LEGACY 1 /* Get values of POSIX options: If these symbols are defined, the corresponding features are always available. If not, they may be available sometimes. The current values can be obtained with `sysconf'. _POSIX_JOB_CONTROL Job control is supported. _POSIX_SAVED_IDS Processes have a saved set-user-ID and a saved set-group-ID. _POSIX_REALTIME_SIGNALS Real-time, queued signals are supported. _POSIX_PRIORITY_SCHEDULING Priority scheduling is supported. _POSIX_TIMERS POSIX.4 clocks and timers are supported. _POSIX_ASYNCHRONOUS_IO Asynchronous I/O is supported. _POSIX_PRIORITIZED_IO Prioritized asynchronous I/O is supported. _POSIX_SYNCHRONIZED_IO Synchronizing file data is supported. _POSIX_FSYNC The fsync function is present. _POSIX_MAPPED_FILES Mapping of files to memory is supported. _POSIX_MEMLOCK Locking of all memory is supported. _POSIX_MEMLOCK_RANGE Locking of ranges of memory is supported. _POSIX_MEMORY_PROTECTION Setting of memory protections is supported. _POSIX_MESSAGE_PASSING POSIX.4 message queues are supported. _POSIX_SEMAPHORES POSIX.4 counting semaphores are supported. _POSIX_SHARED_MEMORY_OBJECTS POSIX.4 shared memory objects are supported. _POSIX_THREADS POSIX.1c pthreads are supported. _POSIX_THREAD_ATTR_STACKADDR Thread stack address attribute option supported. _POSIX_THREAD_ATTR_STACKSIZE Thread stack size attribute option supported. _POSIX_THREAD_SAFE_FUNCTIONS Thread-safe functions are supported. _POSIX_THREAD_PRIORITY_SCHEDULING POSIX.1c thread execution scheduling supported. _POSIX_THREAD_PRIO_INHERIT Thread priority inheritance option supported. _POSIX_THREAD_PRIO_PROTECT Thread priority protection option supported. _POSIX_THREAD_PROCESS_SHARED Process-shared synchronization supported. _POSIX_PII Protocol-independent interfaces are supported. _POSIX_PII_XTI XTI protocol-indep. interfaces are supported. _POSIX_PII_SOCKET Socket protocol-indep. interfaces are supported. _POSIX_PII_INTERNET Internet family of protocols supported. _POSIX_PII_INTERNET_STREAM Connection-mode Internet protocol supported. _POSIX_PII_INTERNET_DGRAM Connectionless Internet protocol supported. _POSIX_PII_OSI ISO/OSI family of protocols supported. _POSIX_PII_OSI_COTS Connection-mode ISO/OSI service supported. _POSIX_PII_OSI_CLTS Connectionless ISO/OSI service supported. _POSIX_POLL Implementation supports `poll' function. _POSIX_SELECT Implementation supports `select' and `pselect'. _XOPEN_REALTIME X/Open realtime support is available. _XOPEN_REALTIME_THREADS X/Open realtime thread support is available. _XOPEN_SHM Shared memory interface according to XPG4.2. _XBS5_ILP32_OFF32 Implementation provides environment with 32-bit int, long, pointer, and off_t types. _XBS5_ILP32_OFFBIG Implementation provides environment with 32-bit int, long, and pointer and off_t with at least 64 bits. _XBS5_LP64_OFF64 Implementation provides environment with 32-bit int, and 64-bit long, pointer, and off_t types. _XBS5_LPBIG_OFFBIG Implementation provides environment with at least 32 bits int and long, pointer, and off_t with at least 64 bits. If any of these symbols is defined as -1, the corresponding option is not true for any file. If any is defined as other than -1, the corresponding option is true for all files. If a symbol is not defined at all, the value for a specific file can be obtained from `pathconf' and `fpathconf'. _POSIX_CHOWN_RESTRICTED Only the super user can use `chown' to change the owner of a file. `chown' can only be used to change the group ID of a file to a group of which the calling process is a member. _POSIX_NO_TRUNC Pathname components longer than NAME_MAX generate an error. _POSIX_VDISABLE If defined, if the value of an element of the `c_cc' member of `struct termios' is _POSIX_VDISABLE, no character will have the effect associated with that element. _POSIX_SYNC_IO Synchronous I/O may be performed. _POSIX_ASYNC_IO Asynchronous I/O may be performed. _POSIX_PRIO_IO Prioritized Asynchronous I/O may be performed. Support for the Large File Support interface is not generally available. If it is available the following constants are defined to one. _LFS64_LARGEFILE Low-level I/O supports large files. _LFS64_STDIO Standard I/O supports large files. */ #include /* Get the environment definitions from Unix98. */ #if defined __USE_UNIX98 || defined __USE_XOPEN2K #include #endif /* Standard file descriptors. */ #define STDIN_FILENO 0 /* Standard input. */ #define STDOUT_FILENO 1 /* Standard output. */ #define STDERR_FILENO 2 /* Standard error output. */ /* All functions that are not declared anywhere else. */ #include #ifndef __ssize_t_defined typedef __ssize_t ssize_t; #define __ssize_t_defined #endif #define __need_size_t #define __need_NULL #include #if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ #ifndef __gid_t_defined typedef __gid_t gid_t; #define __gid_t_defined #endif #ifndef __uid_t_defined typedef __uid_t uid_t; #define __uid_t_defined #endif #ifndef __off_t_defined #ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; #else typedef __off64_t off_t; #endif #define __off_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; #define __off64_t_defined #endif #ifndef __useconds_t_defined typedef __useconds_t useconds_t; #define __useconds_t_defined #endif #ifndef __pid_t_defined typedef __pid_t pid_t; #define __pid_t_defined #endif #endif /* X/Open */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K #ifndef __intptr_t_defined typedef __intptr_t intptr_t; #define __intptr_t_defined #endif #endif #if defined __USE_MISC || defined __USE_XOPEN #ifndef __socklen_t_defined typedef __socklen_t socklen_t; #define __socklen_t_defined #endif #endif /* Values for the second argument to access. These may be OR'd together. */ #define R_OK 4 /* Test for read permission. */ #define W_OK 2 /* Test for write permission. */ #define X_OK 1 /* Test for execute permission. */ #define F_OK 0 /* Test for existence. */ /* Test for access to NAME using the real UID and real GID. */ extern int access(const char *__name, int __type) __THROW __nonnull((1)); #ifdef __USE_GNU /* Test for access to NAME using the effective UID and GID (as normal file operations use). */ extern int euidaccess(const char *__name, int __type) __THROW __nonnull((1)); /* An alias for `euidaccess', used by some other systems. */ extern int eaccess(const char *__name, int __type) __THROW __nonnull((1)); #endif #ifdef __USE_ATFILE /* Test for access to FILE relative to the directory FD is open on. If AT_EACCESS is set in FLAG, then use effective IDs like `eaccess', otherwise use real IDs like `access'. */ extern int faccessat(int __fd, const char *__file, int __type, int __flag) __THROW __nonnull((2)) __wur; #endif /* Use GNU. */ /* Values for the WHENCE argument to lseek. */ #ifndef _STDIO_H /* has the same definitions. */ #define SEEK_SET 0 /* Seek from beginning of file. */ #define SEEK_CUR 1 /* Seek from current position. */ #define SEEK_END 2 /* Seek from end of file. */ #ifdef __USE_GNU #define SEEK_DATA 3 /* Seek to next data. */ #define SEEK_HOLE 4 /* Seek to next hole. */ #endif #endif #if defined __USE_MISC && !defined L_SET /* Old BSD names for the same constants; just for compatibility. */ #define L_SET SEEK_SET #define L_INCR SEEK_CUR #define L_XTND SEEK_END #endif /* Move FD's file position to OFFSET bytes from the beginning of the file (if WHENCE is SEEK_SET), the current position (if WHENCE is SEEK_CUR), or the end of the file (if WHENCE is SEEK_END). Return the new file position. */ #ifndef __USE_FILE_OFFSET64 extern __off_t lseek(int __fd, __off_t __offset, int __whence) __THROW; #else #ifdef __REDIRECT_NTH extern __off64_t __REDIRECT_NTH(lseek, (int __fd, __off64_t __offset, int __whence), lseek64); #else #define lseek lseek64 #endif #endif #ifdef __USE_LARGEFILE64 extern __off64_t lseek64(int __fd, __off64_t __offset, int __whence) __THROW; #endif /* Close the file descriptor FD. This function is a cancellation point and therefore not marked with __THROW. */ extern int close(int __fd); /* Read NBYTES into BUF from FD. Return the number read, -1 for errors or 0 for EOF. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t read(int __fd, void *__buf, size_t __nbytes) __wur; /* Write N bytes of BUF to FD. Return the number written, or -1. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t write(int __fd, const void *__buf, size_t __n) __wur; #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 #ifndef __USE_FILE_OFFSET64 /* Read NBYTES into BUF from FD at the given position OFFSET without changing the file pointer. Return the number read, -1 for errors or 0 for EOF. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pread(int __fd, void *__buf, size_t __nbytes, __off_t __offset) __wur; /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwrite(int __fd, const void *__buf, size_t __n, __off_t __offset) __wur; #else #ifdef __REDIRECT extern ssize_t __REDIRECT(pread, (int __fd, void *__buf, size_t __nbytes, __off64_t __offset), pread64) __wur; extern ssize_t __REDIRECT(pwrite, (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset), pwrite64) __wur; #else #define pread pread64 #define pwrite pwrite64 #endif #endif #ifdef __USE_LARGEFILE64 /* Read NBYTES into BUF from FD at the given position OFFSET without changing the file pointer. Return the number read, -1 for errors or 0 for EOF. */ extern ssize_t pread64(int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __wur; /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. */ extern ssize_t pwrite64(int __fd, const void *__buf, size_t __n, __off64_t __offset) __wur; #endif #endif /* Create a one-way communication channel (pipe). If successful, two file descriptors are stored in PIPEDES; bytes written on PIPEDES[1] can be read from PIPEDES[0]. Returns 0 if successful, -1 if not. */ extern int pipe(int __pipedes[2]) __THROW __wur; #ifdef __USE_GNU /* Same as pipe but apply flags passed in FLAGS to the new file descriptors. */ extern int pipe2(int __pipedes[2], int __flags) __THROW __wur; #endif /* Schedule an alarm. In SECONDS seconds, the process will get a SIGALRM. If SECONDS is zero, any currently scheduled alarm will be cancelled. The function returns the number of seconds remaining until the last alarm scheduled would have signaled, or zero if there wasn't one. There is no return value to indicate an error, but you can set `errno' to 0 and check its value after calling `alarm', and this might tell you. The signal may come late due to processor scheduling. */ extern unsigned int alarm(unsigned int __seconds) __THROW; /* Make the process sleep for SECONDS seconds, or until a signal arrives and is not ignored. The function returns the number of seconds less than SECONDS which it actually slept (thus zero if it slept the full time). If a signal handler does a `longjmp' or modifies the handling of the SIGALRM signal while inside `sleep' call, the handling of the SIGALRM signal afterwards is undefined. There is no return value to indicate error, but if `sleep' returns SECONDS, it probably didn't work. This function is a cancellation point and therefore not marked with __THROW. */ extern unsigned int sleep(unsigned int __seconds); #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_MISC /* Set an alarm to go off (generating a SIGALRM signal) in VALUE microseconds. If INTERVAL is nonzero, when the alarm goes off, the timer is reset to go off every INTERVAL microseconds thereafter. Returns the number of microseconds remaining before the alarm. */ extern __useconds_t ualarm(__useconds_t __value, __useconds_t __interval) __THROW; /* Sleep USECONDS microseconds, or until a signal arrives that is not blocked or ignored. This function is a cancellation point and therefore not marked with __THROW. */ extern int usleep(__useconds_t __useconds); #endif /* Suspend the process until a signal arrives. This always returns -1 and sets `errno' to EINTR. This function is a cancellation point and therefore not marked with __THROW. */ extern int pause(void); /* Change the owner and group of FILE. */ extern int chown(const char *__file, __uid_t __owner, __gid_t __group) __THROW __nonnull((1)) __wur; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Change the owner and group of the file that FD is open on. */ extern int fchown(int __fd, __uid_t __owner, __gid_t __group) __THROW __wur; /* Change owner and group of FILE, if it is a symbolic link the ownership of the symbolic link is changed. */ extern int lchown(const char *__file, __uid_t __owner, __gid_t __group) __THROW __nonnull((1)) __wur; #endif /* Use X/Open Unix. */ #ifdef __USE_ATFILE /* Change the owner and group of FILE relative to the directory FD is open on. */ extern int fchownat(int __fd, const char *__file, __uid_t __owner, __gid_t __group, int __flag) __THROW __nonnull((2)) __wur; #endif /* Use GNU. */ /* Change the process's working directory to PATH. */ extern int chdir(const char *__path) __THROW __nonnull((1)) __wur; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Change the process's working directory to the one FD is open on. */ extern int fchdir(int __fd) __THROW __wur; #endif /* Get the pathname of the current working directory, and put it in SIZE bytes of BUF. Returns NULL if the directory couldn't be determined or SIZE was too small. If successful, returns BUF. In GNU, if BUF is NULL, an array is allocated with `malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as necessary. */ extern char *getcwd(char *__buf, size_t __size) __THROW __wur; #ifdef __USE_GNU /* Return a malloc'd string containing the current directory name. If the environment variable `PWD' is set, and its value is correct, that value is used. */ extern char *get_current_dir_name(void) __THROW; #endif #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_MISC /* Put the absolute pathname of the current working directory in BUF. If successful, return BUF. If not, put an error message in BUF and return NULL. BUF should be at least PATH_MAX bytes long. */ extern char *getwd(char *__buf) __THROW __nonnull((1)) __attribute_deprecated__ __wur; #endif /* Duplicate FD, returning a new file descriptor on the same file. */ extern int dup(int __fd) __THROW __wur; /* Duplicate FD to FD2, closing FD2 and making it open on the same file. */ extern int dup2(int __fd, int __fd2) __THROW; #ifdef __USE_GNU /* Duplicate FD to FD2, closing FD2 and making it open on the same file while setting flags according to FLAGS. */ extern int dup3(int __fd, int __fd2, int __flags) __THROW; #endif /* NULL-terminated array of "NAME=VALUE" environment variables. */ extern char **__environ; #ifdef __USE_GNU extern char **environ; #endif /* Replace the current process, executing PATH with arguments ARGV and environment ENVP. ARGV and ENVP are terminated by NULL pointers. */ extern int execve(const char *__path, char *const __argv[], char *const __envp[]) __THROW __nonnull((1, 2)); #ifdef __USE_XOPEN2K8 /* Execute the file FD refers to, overlaying the running program image. ARGV and ENVP are passed to the new program, as for `execve'. */ extern int fexecve(int __fd, char *const __argv[], char *const __envp[]) __THROW __nonnull((2)); #endif /* Execute PATH with arguments ARGV and environment from `environ'. */ extern int execv(const char *__path, char *const __argv[]) __THROW __nonnull((1, 2)); /* Execute PATH with all arguments after PATH until a NULL pointer, and the argument after that for environment. */ extern int execle(const char *__path, const char *__arg, ...) __THROW __nonnull((1, 2)); /* Execute PATH with all arguments after PATH until a NULL pointer and environment from `environ'. */ extern int execl(const char *__path, const char *__arg, ...) __THROW __nonnull((1, 2)); /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with arguments ARGV and environment from `environ'. */ extern int execvp(const char *__file, char *const __argv[]) __THROW __nonnull((1, 2)); /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with all arguments after FILE until a NULL pointer and environment from `environ'. */ extern int execlp(const char *__file, const char *__arg, ...) __THROW __nonnull((1, 2)); #ifdef __USE_GNU /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with arguments ARGV and environment from `environ'. */ extern int execvpe(const char *__file, char *const __argv[], char *const __envp[]) __THROW __nonnull((1, 2)); #endif #if defined __USE_MISC || defined __USE_XOPEN /* Add INC to priority of the current process. */ extern int nice(int __inc) __THROW __wur; #endif /* Terminate program execution with the low-order 8 bits of STATUS. */ extern void _exit(int __status) __attribute__ ((__noreturn__)); /* Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf'; the `_SC_*' symbols for the NAME argument to `sysconf'; and the `_CS_*' symbols for the NAME argument to `confstr'. */ #include /* Get file-specific configuration information about PATH. */ extern long int pathconf(const char *__path, int __name) __THROW __nonnull((1)); /* Get file-specific configuration about descriptor FD. */ extern long int fpathconf(int __fd, int __name) __THROW; /* Get the value of the system variable NAME. */ extern long int sysconf(int __name) __THROW; #ifdef __USE_POSIX2 /* Get the value of the string-valued system variable NAME. */ extern size_t confstr(int __name, char *__buf, size_t __len) __THROW; #endif /* Get the process ID of the calling process. */ extern __pid_t getpid(void) __THROW; /* Get the process ID of the calling process's parent. */ extern __pid_t getppid(void) __THROW; /* Get the process group ID of the calling process. */ extern __pid_t getpgrp(void) __THROW; /* Get the process group ID of process PID. */ extern __pid_t __getpgid(__pid_t __pid) __THROW; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 extern __pid_t getpgid(__pid_t __pid) __THROW; #endif /* Set the process group ID of the process matching PID to PGID. If PID is zero, the current process's process group ID is set. If PGID is zero, the process ID of the process is used. */ extern int setpgid(__pid_t __pid, __pid_t __pgid) __THROW; #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Both System V and BSD have `setpgrp' functions, but with different calling conventions. The BSD function is the same as POSIX.1 `setpgid' (above). The System V function takes no arguments and puts the calling process in its on group like `setpgid (0, 0)'. New programs should always use `setpgid' instead. GNU provides the POSIX.1 function. */ /* Set the process group ID of the calling process to its own PID. This is exactly the same as `setpgid (0, 0)'. */ extern int setpgrp(void) __THROW; #endif /* Use misc or X/Open. */ /* Create a new session with the calling process as its leader. The process group IDs of the session and the calling process are set to the process ID of the calling process, which is returned. */ extern __pid_t setsid(void) __THROW; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Return the session ID of the given process. */ extern __pid_t getsid(__pid_t __pid) __THROW; #endif /* Get the real user ID of the calling process. */ extern __uid_t getuid(void) __THROW; /* Get the effective user ID of the calling process. */ extern __uid_t geteuid(void) __THROW; /* Get the real group ID of the calling process. */ extern __gid_t getgid(void) __THROW; /* Get the effective group ID of the calling process. */ extern __gid_t getegid(void) __THROW; /* If SIZE is zero, return the number of supplementary groups the calling process is in. Otherwise, fill in the group IDs of its supplementary groups in LIST and return the number written. */ extern int getgroups(int __size, __gid_t __list[]) __THROW __wur; #ifdef __USE_GNU /* Return nonzero iff the calling process is in group GID. */ extern int group_member(__gid_t __gid) __THROW; #endif /* Set the user ID of the calling process to UID. If the calling process is the super-user, set the real and effective user IDs, and the saved set-user-ID to UID; if not, the effective user ID is set to UID. */ extern int setuid(__uid_t __uid) __THROW __wur; #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Set the real user ID of the calling process to RUID, and the effective user ID of the calling process to EUID. */ extern int setreuid(__uid_t __ruid, __uid_t __euid) __THROW __wur; #endif #ifdef __USE_XOPEN2K /* Set the effective user ID of the calling process to UID. */ extern int seteuid(__uid_t __uid) __THROW __wur; #endif /* Use POSIX.1-2001. */ /* Set the group ID of the calling process to GID. If the calling process is the super-user, set the real and effective group IDs, and the saved set-group-ID to GID; if not, the effective group ID is set to GID. */ extern int setgid(__gid_t __gid) __THROW __wur; #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Set the real group ID of the calling process to RGID, and the effective group ID of the calling process to EGID. */ extern int setregid(__gid_t __rgid, __gid_t __egid) __THROW __wur; #endif #ifdef __USE_XOPEN2K /* Set the effective group ID of the calling process to GID. */ extern int setegid(__gid_t __gid) __THROW __wur; #endif /* Use POSIX.1-2001. */ #ifdef __USE_GNU /* Fetch the real user ID, effective user ID, and saved-set user ID, of the calling process. */ extern int getresuid(__uid_t * __ruid, __uid_t * __euid, __uid_t * __suid) __THROW; /* Fetch the real group ID, effective group ID, and saved-set group ID, of the calling process. */ extern int getresgid(__gid_t * __rgid, __gid_t * __egid, __gid_t * __sgid) __THROW; /* Set the real user ID, effective user ID, and saved-set user ID, of the calling process to RUID, EUID, and SUID, respectively. */ extern int setresuid(__uid_t __ruid, __uid_t __euid, __uid_t __suid) __THROW __wur; /* Set the real group ID, effective group ID, and saved-set group ID, of the calling process to RGID, EGID, and SGID, respectively. */ extern int setresgid(__gid_t __rgid, __gid_t __egid, __gid_t __sgid) __THROW __wur; #endif /* Clone the calling process, creating an exact copy. Return -1 for errors, 0 to the new process, and the process ID of the new process to the old process. */ extern __pid_t fork(void) __THROWNL; #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_MISC /* Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is replaced by a call to `execve'. Return -1 for errors, 0 to the new process, and the process ID of the new process to the old process. */ extern __pid_t vfork(void) __THROW; #endif /* Use misc or XPG < 7. */ /* Return the pathname of the terminal FD is open on, or NULL on errors. The returned storage is good only until the next call to this function. */ extern char *ttyname(int __fd) __THROW; /* Store at most BUFLEN characters of the pathname of the terminal FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ttyname_r(int __fd, char *__buf, size_t __buflen) __THROW __nonnull((2)) __wur; /* Return 1 if FD is a valid descriptor associated with a terminal, zero if not. */ extern int isatty(int __fd) __THROW; #ifdef __USE_MISC /* Return the index into the active-logins file (utmp) for the controlling terminal. */ extern int ttyslot(void) __THROW; #endif /* Make a link to FROM named TO. */ extern int link(const char *__from, const char *__to) __THROW __nonnull((1, 2)) __wur; #ifdef __USE_ATFILE /* Like link but relative paths in TO and FROM are interpreted relative to FROMFD and TOFD respectively. */ extern int linkat(int __fromfd, const char *__from, int __tofd, const char *__to, int __flags) __THROW __nonnull((2, 4)) __wur; #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K /* Make a symbolic link to FROM named TO. */ extern int symlink(const char *__from, const char *__to) __THROW __nonnull((1, 2)) __wur; /* Read the contents of the symbolic link PATH into no more than LEN bytes of BUF. The contents are not null-terminated. Returns the number of characters read, or -1 for errors. */ extern ssize_t readlink(const char *__restrict __path, char *__restrict __buf, size_t __len) __THROW __nonnull((1, 2)) __wur; #endif /* Use POSIX.1-2001. */ #ifdef __USE_ATFILE /* Like symlink but a relative path in TO is interpreted relative to TOFD. */ extern int symlinkat(const char *__from, int __tofd, const char *__to) __THROW __nonnull((1, 3)) __wur; /* Like readlink but a relative PATH is interpreted relative to FD. */ extern ssize_t readlinkat(int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len) __THROW __nonnull((2, 3)) __wur; #endif /* Remove the link NAME. */ extern int unlink(const char *__name) __THROW __nonnull((1)); #ifdef __USE_ATFILE /* Remove the link NAME relative to FD. */ extern int unlinkat(int __fd, const char *__name, int __flag) __THROW __nonnull((2)); #endif /* Remove the directory PATH. */ extern int rmdir(const char *__path) __THROW __nonnull((1)); /* Return the foreground process group ID of FD. */ extern __pid_t tcgetpgrp(int __fd) __THROW; /* Set the foreground process group ID of FD set PGRP_ID. */ extern int tcsetpgrp(int __fd, __pid_t __pgrp_id) __THROW; /* Return the login name of the user. This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *getlogin(void); #if defined __USE_REENTRANT || defined __USE_POSIX199506 /* Return at most NAME_LEN characters of the login name of the user in NAME. If it cannot be determined or some other error occurred, return the error code. Otherwise return 0. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getlogin_r(char *__name, size_t __name_len) __nonnull((1)); #endif #ifdef __USE_MISC /* Set the login name returned by `getlogin'. */ extern int setlogin(const char *__name) __THROW __nonnull((1)); #endif #ifdef __USE_POSIX2 /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. */ #define __need_getopt #include #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K /* Put the name of the current host in no more than LEN bytes of NAME. The result is null-terminated if LEN is large enough for the full name and the terminator. */ extern int gethostname(char *__name, size_t __len) __THROW __nonnull((1)); #endif #if defined __USE_MISC /* Set the name of the current host to NAME, which is LEN bytes long. This call is restricted to the super-user. */ extern int sethostname(const char *__name, size_t __len) __THROW __nonnull((1)) __wur; /* Set the current machine's Internet number to ID. This call is restricted to the super-user. */ extern int sethostid(long int __id) __THROW __wur; /* Get and set the NIS (aka YP) domain name, if any. Called just like `gethostname' and `sethostname'. The NIS domain name is usually the empty string when not using NIS. */ extern int getdomainname(char *__name, size_t __len) __THROW __nonnull((1)) __wur; extern int setdomainname(const char *__name, size_t __len) __THROW __nonnull((1)) __wur; /* Revoke access permissions to all processes currently communicating with the control terminal, and then send a SIGHUP signal to the process group of the control terminal. */ extern int vhangup(void) __THROW; /* Revoke the access of all descriptors currently open on FILE. */ extern int revoke(const char *__file) __THROW __nonnull((1)) __wur; /* Enable statistical profiling, writing samples of the PC into at most SIZE bytes of SAMPLE_BUFFER; every processor clock tick while profiling is enabled, the system examines the user PC and increments SAMPLE_BUFFER[((PC - OFFSET) / 2) * SCALE / 65536]. If SCALE is zero, disable profiling. Returns zero on success, -1 on error. */ extern int profil(unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale) __THROW __nonnull((1)); /* Turn accounting on if NAME is an existing file. The system will then write a record for each process as it terminates, to this file. If NAME is NULL, turn accounting off. This call is restricted to the super-user. */ extern int acct(const char *__name) __THROW; /* Successive calls return the shells listed in `/etc/shells'. */ extern char *getusershell(void) __THROW; extern void endusershell(void) __THROW; /* Discard cached info. */ extern void setusershell(void) __THROW; /* Rewind and re-read the file. */ /* Put the program in the background, and dissociate from the controlling terminal. If NOCHDIR is zero, do `chdir ("/")'. If NOCLOSE is zero, redirects stdin, stdout, and stderr to /dev/null. */ extern int daemon(int __nochdir, int __noclose) __THROW __wur; #endif /* Use misc. */ #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) /* Make PATH be the root directory (the starting point for absolute paths). This call is restricted to the super-user. */ extern int chroot(const char *__path) __THROW __nonnull((1)) __wur; /* Prompt with PROMPT and read a string from the terminal without echoing. Uses /dev/tty if possible; otherwise stderr and stdin. */ extern char *getpass(const char *__prompt) __nonnull((1)); #endif /* Use misc || X/Open. */ /* Make all changes done to FD actually appear on disk. This function is a cancellation point and therefore not marked with __THROW. */ extern int fsync(int __fd); #ifdef __USE_GNU /* Make all changes done to all files on the file system associated with FD actually appear on disk. */ extern int syncfs(int __fd) __THROW; #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Return identifier for the current host. */ extern long int gethostid(void); /* Make all changes done to all files actually appear on disk. */ extern void sync(void) __THROW; #if defined __USE_MISC || !defined __USE_XOPEN2K /* Return the number of bytes in a page. This is the system's page size, which is not necessarily the same as the hardware page size. */ extern int getpagesize(void) __THROW __attribute__ ((__const__)); /* Return the maximum number of file descriptors the current process could possibly have. */ extern int getdtablesize(void) __THROW; #endif #endif /* Use misc || X/Open Unix. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Truncate FILE to LENGTH bytes. */ #ifndef __USE_FILE_OFFSET64 extern int truncate(const char *__file, __off_t __length) __THROW __nonnull((1)) __wur; #else #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(truncate, (const char *__file, __off64_t __length), truncate64) __nonnull((1)) __wur; #else #define truncate truncate64 #endif #endif #ifdef __USE_LARGEFILE64 extern int truncate64(const char *__file, __off64_t __length) __THROW __nonnull((1)) __wur; #endif #endif /* Use X/Open Unix || POSIX 2008. */ #if defined __USE_POSIX199309 \ || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K /* Truncate the file FD is open on to LENGTH bytes. */ #ifndef __USE_FILE_OFFSET64 extern int ftruncate(int __fd, __off_t __length) __THROW __wur; #else #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH(ftruncate, (int __fd, __off64_t __length), ftruncate64) __wur; #else #define ftruncate ftruncate64 #endif #endif #ifdef __USE_LARGEFILE64 extern int ftruncate64(int __fd, __off64_t __length) __THROW __wur; #endif #endif /* Use POSIX.1b || X/Open Unix || XPG6. */ #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \ || defined __USE_MISC /* Set the end of accessible data space (aka "the break") to ADDR. Returns zero on success and -1 for errors (with errno set). */ extern int brk(void *__addr) __THROW __wur; /* Increase or decrease the end of accessible data space by DELTA bytes. If successful, returns the address the previous end of data space (i.e. the beginning of the new space, if DELTA > 0); returns (void *) -1 for errors (with errno set). */ extern void *sbrk(intptr_t __delta) __THROW; #endif #ifdef __USE_MISC /* Invoke `system call' number SYSNO, passing it the remaining arguments. This is completely system-dependent, and not often useful. In Unix, `syscall' sets `errno' for all errors and most calls return -1 for errors; in many systems you cannot pass arguments or get return values for all system calls (`pipe', `fork', and `getppid' typically among them). In Mach, all system calls take normal arguments and always return an error code (zero for success). */ extern long int syscall(long int __sysno, ...) __THROW; #endif /* Use misc. */ #if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) && !defined F_LOCK /* NOTE: These declarations also appear in ; be sure to keep both files consistent. Some systems have them there and some here, and some software depends on the macros being defined without including both. */ /* `lockf' is a simpler interface to the locking facilities of `fcntl'. LEN is always relative to the current file position. The CMD argument is one of the following. This function is a cancellation point and therefore not marked with __THROW. */ #define F_ULOCK 0 /* Unlock a previously locked region. */ #define F_LOCK 1 /* Lock a region for exclusive use. */ #define F_TLOCK 2 /* Test and lock a region for exclusive use. */ #define F_TEST 3 /* Test a region for other processes locks. */ #ifndef __USE_FILE_OFFSET64 extern int lockf(int __fd, int __cmd, __off_t __len) __wur; #else #ifdef __REDIRECT extern int __REDIRECT(lockf, (int __fd, int __cmd, __off64_t __len), lockf64) __wur; #else #define lockf lockf64 #endif #endif #ifdef __USE_LARGEFILE64 extern int lockf64(int __fd, int __cmd, __off64_t __len) __wur; #endif #endif /* Use misc and F_LOCK not already defined. */ #ifdef __USE_GNU /* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno' set to EINTR. */ #define TEMP_FAILURE_RETRY(expression) \ (__extension__ \ ({ long int __result; \ do __result = (long int) (expression); \ while (__result == -1L && errno == EINTR); \ __result; })) #endif #if defined __USE_POSIX199309 || defined __USE_UNIX98 /* Synchronize at least the data part of a file with the underlying media. */ extern int fdatasync(int __fildes); #endif /* Use POSIX199309 */ /* XPG4.2 specifies that prototypes for the encryption functions must be defined here. */ #ifdef __USE_XOPEN /* Encrypt at most 8 characters from KEY using salt to perturb DES. */ extern char *crypt(const char *__key, const char *__salt) __THROW __nonnull((1, 2)); /* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt block in place. */ extern void encrypt(char *__glibc_block, int __edflag) __THROW __nonnull((1)); /* Swab pairs bytes in the first N bytes of the area pointed to by FROM and copy the result to TO. The value of TO must not be in the range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM is without partner. */ extern void swab(const void *__restrict __from, void *__restrict __to, ssize_t __n) __THROW __nonnull((1, 2)); #endif /* Prior to Issue 6, the Single Unix Specification required these prototypes to appear in this header. They are also found in . */ #if defined __USE_XOPEN && !defined __USE_XOPEN2K /* Return the name of the controlling terminal. */ extern char *ctermid(char *__s) __THROW; /* Return the name of the current user. */ extern char *cuserid(char *__s); #endif /* Unix98 requires this function to be declared here. In other standards it is in . */ #if defined __USE_UNIX98 && !defined __USE_XOPEN2K extern int pthread_atfork(void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)) __THROW; #endif /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function #include #endif __END_DECLS #endif /* unistd.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/utime.h ================================================ /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 5.6.6 Set File Access and Modification Times */ #ifndef _UTIME_H #define _UTIME_H 1 #include __BEGIN_DECLS #include #if defined __USE_XOPEN || defined __USE_XOPEN2K #define __need_time_t #include #endif /* Structure describing file times. */ struct utimbuf { __time_t actime; /* Access time. */ __time_t modtime; /* Modification time. */ }; /* Set the access and modification times of FILE to those given in *FILE_TIMES. If FILE_TIMES is NULL, set them to the current time. */ extern int utime(const char *__file, const struct utimbuf *__file_times) __THROW __nonnull((1)); __END_DECLS #endif /* utime.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/wchar.h ================================================ /* Copyright (C) 1995-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.24 * Extended multibyte and wide character utilities */ #ifndef _WCHAR_H #if !defined __need_mbstate_t && !defined __need_wint_t #define _WCHAR_H 1 #include #endif #ifdef _WCHAR_H /* Get FILE definition. */ #define __need___FILE #if defined __USE_UNIX98 || defined __USE_XOPEN2K #define __need_FILE #endif #include /* Get va_list definition. */ #define __need___va_list #include #include /* Get size_t, wchar_t, wint_t and NULL from . */ #define __need_size_t #define __need_wchar_t #define __need_NULL #endif #if defined _WCHAR_H || defined __need_wint_t || !defined __WINT_TYPE__ #undef __need_wint_t #define __need_wint_t #include /* We try to get wint_t from , but not all GCC versions define it there. So define it ourselves if it remains undefined. */ #ifndef _WINT_T /* Integral type unchanged by default argument promotions that can hold any value corresponding to members of the extended character set, as well as at least one value that does not correspond to any member of the extended character set. */ #define _WINT_T typedef unsigned int wint_t; #else /* Work around problems with the file which doesn't put wint_t in the std namespace. */ #if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES \ && defined __WINT_TYPE__ __BEGIN_NAMESPACE_STD typedef __WINT_TYPE__ wint_t; __END_NAMESPACE_STD #endif #endif /* Tell the caller that we provide correct C++ prototypes. */ #if defined __cplusplus && __GNUC_PREREQ (4, 4) #define __CORRECT_ISO_CPP_WCHAR_H_PROTO #endif #endif #if (defined _WCHAR_H || defined __need_mbstate_t) && !defined ____mbstate_t_defined #define ____mbstate_t_defined 1 /* Conversion state information. */ typedef struct { int __count; union { #ifdef __WINT_TYPE__ __WINT_TYPE__ __wch; #else wint_t __wch; #endif char __wchb[4]; } __value; /* Value so far. */ } __mbstate_t; #endif #undef __need_mbstate_t /* The rest of the file is only used if used if __need_mbstate_t is not defined. */ #ifdef _WCHAR_H #ifndef __mbstate_t_defined __BEGIN_NAMESPACE_C99 /* Public type. */ typedef __mbstate_t mbstate_t; __END_NAMESPACE_C99 #define __mbstate_t_defined 1 #endif #ifdef __USE_GNU __USING_NAMESPACE_C99(mbstate_t) #endif #ifndef WCHAR_MIN /* These constants might also be defined in . */ #define WCHAR_MIN __WCHAR_MIN #define WCHAR_MAX __WCHAR_MAX #endif #ifndef WEOF #define WEOF (0xffffffffu) #endif /* For XPG4 compliance we have to define the stuff from here as well. */ #if defined __USE_XOPEN && !defined __USE_UNIX98 #include #endif __BEGIN_DECLS __BEGIN_NAMESPACE_STD /* This incomplete type is defined in but needed here because of `wcsftime'. */ struct tm; __END_NAMESPACE_STD /* XXX We have to clean this up at some point. Since tm is in the std namespace but wcsftime is in __c99 the type wouldn't be found without inserting it in the global namespace. */ __USING_NAMESPACE_STD(tm) __BEGIN_NAMESPACE_STD /* Copy SRC to DEST. */ extern wchar_t *wcscpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src) __THROW __nonnull((1, 2)); /* Copy no more than N wide-characters of SRC to DEST. */ extern wchar_t *wcsncpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Append SRC onto DEST. */ extern wchar_t *wcscat(wchar_t * __restrict __dest, const wchar_t * __restrict __src) __THROW __nonnull((1, 2)); /* Append no more than N wide-characters of SRC onto DEST. */ extern wchar_t *wcsncat(wchar_t * __restrict __dest, const wchar_t * __restrict __src, size_t __n) __THROW __nonnull((1, 2)); /* Compare S1 and S2. */ extern int wcscmp(const wchar_t * __s1, const wchar_t * __s2) __THROW __attribute_pure__ __nonnull((1, 2)); /* Compare N wide-characters of S1 and S2. */ extern int wcsncmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW __attribute_pure__ __nonnull((1, 2)); __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Compare S1 and S2, ignoring case. */ extern int wcscasecmp(const wchar_t * __s1, const wchar_t * __s2) __THROW; /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int wcsncasecmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW; /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ #include extern int wcscasecmp_l(const wchar_t * __s1, const wchar_t * __s2, __locale_t __loc) __THROW; extern int wcsncasecmp_l(const wchar_t * __s1, const wchar_t * __s2, size_t __n, __locale_t __loc) __THROW; #endif __BEGIN_NAMESPACE_STD /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the current locale. */ extern int wcscoll(const wchar_t * __s1, const wchar_t * __s2) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm(wchar_t * __restrict __s1, const wchar_t * __restrict __s2, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the given locale. */ extern int wcscoll_l(const wchar_t * __s1, const wchar_t * __s2, __locale_t __loc) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm_l(wchar_t * __s1, const wchar_t * __s2, size_t __n, __locale_t __loc) __THROW; /* Duplicate S, returning an identical malloc'd string. */ extern wchar_t *wcsdup(const wchar_t * __s) __THROW __attribute_malloc__; #endif __BEGIN_NAMESPACE_STD /* Find the first occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcschr(wchar_t * __wcs, wchar_t __wc) __THROW __asm("wcschr") __attribute_pure__; extern "C++" const wchar_t *wcschr(const wchar_t * __wcs, wchar_t __wc) __THROW __asm("wcschr") __attribute_pure__; #else extern wchar_t *wcschr(const wchar_t * __wcs, wchar_t __wc) __THROW __attribute_pure__; #endif /* Find the last occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcsrchr(wchar_t * __wcs, wchar_t __wc) __THROW __asm("wcsrchr") __attribute_pure__; extern "C++" const wchar_t *wcsrchr(const wchar_t * __wcs, wchar_t __wc) __THROW __asm("wcsrchr") __attribute_pure__; #else extern wchar_t *wcsrchr(const wchar_t * __wcs, wchar_t __wc) __THROW __attribute_pure__; #endif __END_NAMESPACE_STD #ifdef __USE_GNU /* This function is similar to `wcschr'. But it returns a pointer to the closing NUL wide character in case C is not found in S. */ extern wchar_t *wcschrnul(const wchar_t * __s, wchar_t __wc) __THROW __attribute_pure__; #endif __BEGIN_NAMESPACE_STD /* Return the length of the initial segmet of WCS which consists entirely of wide characters not in REJECT. */ extern size_t wcscspn(const wchar_t * __wcs, const wchar_t * __reject) __THROW __attribute_pure__; /* Return the length of the initial segmet of WCS which consists entirely of wide characters in ACCEPT. */ extern size_t wcsspn(const wchar_t * __wcs, const wchar_t * __accept) __THROW __attribute_pure__; /* Find the first occurrence in WCS of any character in ACCEPT. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcspbrk(wchar_t * __wcs, const wchar_t * __accept) __THROW __asm("wcspbrk") __attribute_pure__; extern "C++" const wchar_t *wcspbrk(const wchar_t * __wcs, const wchar_t * __accept) __THROW __asm("wcspbrk") __attribute_pure__; #else extern wchar_t *wcspbrk(const wchar_t * __wcs, const wchar_t * __accept) __THROW __attribute_pure__; #endif /* Find the first occurrence of NEEDLE in HAYSTACK. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcsstr(wchar_t * __haystack, const wchar_t * __needle) __THROW __asm("wcsstr") __attribute_pure__; extern "C++" const wchar_t *wcsstr(const wchar_t * __haystack, const wchar_t * __needle) __THROW __asm("wcsstr") __attribute_pure__; #else extern wchar_t *wcsstr(const wchar_t * __haystack, const wchar_t * __needle) __THROW __attribute_pure__; #endif /* Divide WCS into tokens separated by characters in DELIM. */ extern wchar_t *wcstok(wchar_t * __restrict __s, const wchar_t * __restrict __delim, wchar_t ** __restrict __ptr) __THROW; /* Return the number of wide characters in S. */ extern size_t wcslen(const wchar_t * __s) __THROW __attribute_pure__; __END_NAMESPACE_STD #ifdef __USE_XOPEN /* Another name for `wcsstr' from XPG4. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wcswcs(wchar_t * __haystack, const wchar_t * __needle) __THROW __asm("wcswcs") __attribute_pure__; extern "C++" const wchar_t *wcswcs(const wchar_t * __haystack, const wchar_t * __needle) __THROW __asm("wcswcs") __attribute_pure__; #else extern wchar_t *wcswcs(const wchar_t * __haystack, const wchar_t * __needle) __THROW __attribute_pure__; #endif #endif #ifdef __USE_XOPEN2K8 /* Return the number of wide characters in S, but at most MAXLEN. */ extern size_t wcsnlen(const wchar_t * __s, size_t __maxlen) __THROW __attribute_pure__; #endif __BEGIN_NAMESPACE_STD /* Search N wide characters of S for C. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t * wmemchr(wchar_t * __s, wchar_t __c, size_t __n) __THROW __asm("wmemchr") __attribute_pure__; extern "C++" const wchar_t *wmemchr(const wchar_t * __s, wchar_t __c, size_t __n) __THROW __asm("wmemchr") __attribute_pure__; #else extern wchar_t *wmemchr(const wchar_t * __s, wchar_t __c, size_t __n) __THROW __attribute_pure__; #endif /* Compare N wide characters of S1 and S2. */ extern int wmemcmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW __attribute_pure__; /* Copy N wide characters of SRC to DEST. */ extern wchar_t *wmemcpy(wchar_t * __restrict __s1, const wchar_t * __restrict __s2, size_t __n) __THROW; /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for overlapping strings. */ extern wchar_t *wmemmove(wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW; /* Set N wide characters of S to C. */ extern wchar_t *wmemset(wchar_t * __s, wchar_t __c, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_GNU /* Copy N wide characters of SRC to DEST and return pointer to following wide character. */ extern wchar_t *wmempcpy(wchar_t * __restrict __s1, const wchar_t * __restrict __s2, size_t __n) __THROW; #endif __BEGIN_NAMESPACE_STD /* Determine whether C constitutes a valid (one-byte) multibyte character. */ extern wint_t btowc(int __c) __THROW; /* Determine whether C corresponds to a member of the extended character set whose multibyte representation is a single byte. */ extern int wctob(wint_t __c) __THROW; /* Determine whether PS points to an object representing the initial state. */ extern int mbsinit(const mbstate_t * __ps) __THROW __attribute_pure__; /* Write wide character representation of multibyte character pointed to by S to PWC. */ extern size_t mbrtowc(wchar_t * __restrict __pwc, const char *__restrict __s, size_t __n, mbstate_t * __restrict __p) __THROW; /* Write multibyte representation of wide character WC to S. */ extern size_t wcrtomb(char *__restrict __s, wchar_t __wc, mbstate_t * __restrict __ps) __THROW; /* Return number of bytes in multibyte character pointed to by S. */ extern size_t __mbrlen(const char *__restrict __s, size_t __n, mbstate_t * __restrict __ps) __THROW; extern size_t mbrlen(const char *__restrict __s, size_t __n, mbstate_t * __restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_EXTERN_INLINES /* Define inline function as optimization. */ /* We can use the BTOWC and WCTOB optimizations since we know that all locales must use ASCII encoding for the values in the ASCII range and because the wchar_t encoding is always ISO 10646. */ extern wint_t __btowc_alias(int __c) __asm("btowc"); __extern_inline wint_t __NTH(btowc(int __c)) { return (__builtin_constant_p(__c) && __c >= '\0' && __c <= '\x7f' ? (wint_t) __c : __btowc_alias(__c)); } extern int __wctob_alias(wint_t __c) __asm("wctob"); __extern_inline int __NTH(wctob(wint_t __wc)) { return (__builtin_constant_p(__wc) && __wc >= L'\0' && __wc <= L'\x7f' ? (int)__wc : __wctob_alias(__wc)); } __extern_inline size_t __NTH(mbrlen(const char *__restrict __s, size_t __n, mbstate_t * __restrict __ps)) { return (__ps != NULL ? mbrtowc(NULL, __s, __n, __ps) : __mbrlen(__s, __n, NULL)); } #endif __BEGIN_NAMESPACE_STD /* Write wide character representation of multibyte character string SRC to DST. */ extern size_t mbsrtowcs(wchar_t * __restrict __dst, const char **__restrict __src, size_t __len, mbstate_t * __restrict __ps) __THROW; /* Write multibyte character representation of wide character string SRC to DST. */ extern size_t wcsrtombs(char *__restrict __dst, const wchar_t ** __restrict __src, size_t __len, mbstate_t * __restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Write wide character representation of at most NMC bytes of the multibyte character string SRC to DST. */ extern size_t mbsnrtowcs(wchar_t * __restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t * __restrict __ps) __THROW; /* Write multibyte character representation of at most NWC characters from the wide character string SRC to DST. */ extern size_t wcsnrtombs(char *__restrict __dst, const wchar_t ** __restrict __src, size_t __nwc, size_t __len, mbstate_t * __restrict __ps) __THROW; #endif /* use POSIX 2008 */ /* The following functions are extensions found in X/Open CAE. */ #ifdef __USE_XOPEN /* Determine number of column positions required for C. */ extern int wcwidth(wchar_t __c) __THROW; /* Determine number of column positions required for first N wide characters (or fewer if S ends before this) in S. */ extern int wcswidth(const wchar_t * __s, size_t __n) __THROW; #endif /* Use X/Open. */ __BEGIN_NAMESPACE_STD /* Convert initial portion of the wide string NPTR to `double' representation. */ extern double wcstod(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float wcstof(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; extern long double wcstold(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; __END_NAMESPACE_C99 #endif /* C99 */ __BEGIN_NAMESPACE_STD /* Convert initial portion of wide string NPTR to `long int' representation. */ extern long int wcstol(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long int' representation. */ extern unsigned long int wcstoul(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoll(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstoull(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; __END_NAMESPACE_C99 #endif /* ISO C99. */ #ifdef __USE_GNU /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoq(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstouq(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; #endif /* Use GNU. */ #ifdef __USE_GNU /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ #include /* Special versions of the functions above which take the locale to use as an additional parameter. */ extern long int wcstol_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, __locale_t __loc) __THROW; extern unsigned long int wcstoul_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern long long int wcstoll_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern unsigned long long int wcstoull_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, __locale_t __loc) __THROW; extern double wcstod_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, __locale_t __loc) __THROW; extern float wcstof_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, __locale_t __loc) __THROW; extern long double wcstold_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, __locale_t __loc) __THROW; #endif /* use GNU */ #ifdef __USE_XOPEN2K8 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */ extern wchar_t *wcpcpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src) __THROW; /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ extern wchar_t *wcpncpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src, size_t __n) __THROW; /* Wide character I/O functions. */ /* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces a wide character string. */ extern __FILE *open_wmemstream(wchar_t ** __bufloc, size_t * __sizeloc) __THROW; #endif #if defined __USE_ISOC95 || defined __USE_UNIX98 __BEGIN_NAMESPACE_STD /* Select orientation for stream. */ extern int fwide(__FILE * __fp, int __mode) __THROW; /* Write formatted output to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwprintf(__FILE * __restrict __stream, const wchar_t * __restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */ ; /* Write formatted output to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wprintf(const wchar_t * __restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */ ; /* Write formatted output of at most N characters to S. */ extern int swprintf(wchar_t * __restrict __s, size_t __n, const wchar_t * __restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */ ; /* Write formatted output to S from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwprintf(__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */ ; /* Write formatted output to stdout from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwprintf(const wchar_t * __restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */ ; /* Write formatted output of at most N character to S from argument list ARG. */ extern int vswprintf(wchar_t * __restrict __s, size_t __n, const wchar_t * __restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */ ; /* Read formatted input from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwscanf(__FILE * __restrict __stream, const wchar_t * __restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; /* Read formatted input from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wscanf(const wchar_t * __restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */ ; /* Read formatted input from S. */ extern int swscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; #if defined __USE_ISOC99 && !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) #ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT(fwscanf, (__FILE * __restrict __stream, const wchar_t * __restrict __format, ...), __isoc99_fwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; extern int __REDIRECT(wscanf, (const wchar_t * __restrict __format, ...), __isoc99_wscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */ ; extern int __REDIRECT_NTH(swscanf, (const wchar_t * __restrict __s, const wchar_t * __restrict __format, ...), __isoc99_swscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; #else extern int __isoc99_fwscanf(__FILE * __restrict __stream, const wchar_t * __restrict __format, ...); extern int __isoc99_wscanf(const wchar_t * __restrict __format, ...); extern int __isoc99_swscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, ...) __THROW; #define fwscanf __isoc99_fwscanf #define wscanf __isoc99_wscanf #define swscanf __isoc99_swscanf #endif #endif __END_NAMESPACE_STD #endif /* Use ISO C95, C99 and Unix98. */ #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwscanf(__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; /* Read formatted input from stdin into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwscanf(const wchar_t * __restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */ ; /* Read formatted input from S into argument list ARG. */ extern int vswscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; #if !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) #ifdef __REDIRECT extern int __REDIRECT(vfwscanf, (__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg), __isoc99_vfwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; extern int __REDIRECT(vwscanf, (const wchar_t * __restrict __format, __gnuc_va_list __arg), __isoc99_vwscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */ ; extern int __REDIRECT_NTH(vswscanf, (const wchar_t * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg), __isoc99_vswscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; #else extern int __isoc99_vfwscanf(__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg); extern int __isoc99_vwscanf(const wchar_t * __restrict __format, __gnuc_va_list __arg); extern int __isoc99_vswscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) __THROW; #define vfwscanf __isoc99_vfwscanf #define vwscanf __isoc99_vwscanf #define vswscanf __isoc99_vswscanf #endif #endif __END_NAMESPACE_C99 #endif /* Use ISO C99. */ __BEGIN_NAMESPACE_STD /* Read a character from STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fgetwc(__FILE * __stream); extern wint_t getwc(__FILE * __stream); /* Read a character from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t getwchar(void); /* Write a character to STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fputwc(wchar_t __wc, __FILE * __stream); extern wint_t putwc(wchar_t __wc, __FILE * __stream); /* Write a character to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t putwchar(wchar_t __wc); /* Get a newline-terminated wide character string of finite length from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws(wchar_t * __restrict __ws, int __n, __FILE * __restrict __stream); /* Write a string to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fputws(const wchar_t * __restrict __ws, __FILE * __restrict __stream); /* Push a character back onto the input buffer of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t ungetwc(wint_t __wc, __FILE * __stream); __END_NAMESPACE_STD #ifdef __USE_GNU /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t getwc_unlocked(__FILE * __stream); extern wint_t getwchar_unlocked(void); /* This is the wide character version of a GNU extension. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fgetwc_unlocked(__FILE * __stream); /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fputwc_unlocked(wchar_t __wc, __FILE * __stream); /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t putwc_unlocked(wchar_t __wc, __FILE * __stream); extern wint_t putwchar_unlocked(wchar_t __wc); /* This function does the same as `fgetws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws_unlocked(wchar_t * __restrict __ws, int __n, __FILE * __restrict __stream); /* This function does the same as `fputws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputws_unlocked(const wchar_t * __restrict __ws, __FILE * __restrict __stream); #endif __BEGIN_NAMESPACE_C99 /* Format TP into S according to FORMAT. Write no more than MAXSIZE wide characters and return the number of wide characters written, or 0 if it would exceed MAXSIZE. */ extern size_t wcsftime(wchar_t * __restrict __s, size_t __maxsize, const wchar_t * __restrict __format, const struct tm *__restrict __tp) __THROW; __END_NAMESPACE_C99 #ifdef __USE_GNU #include /* Similar to `wcsftime' but takes the information from the provided locale and not the global locale. */ extern size_t wcsftime_l(wchar_t * __restrict __s, size_t __maxsize, const wchar_t * __restrict __format, const struct tm *__restrict __tp, __locale_t __loc) __THROW; #endif /* The X/Open standard demands that most of the functions defined in the header must also appear here. This is probably because some X/Open members wrote their implementation before the ISO C standard was published and introduced the better solution. We have to provide these definitions for compliance reasons but we do this nonsense only if really necessary. */ #if defined __USE_UNIX98 && !defined __USE_GNU #define __need_iswxxx #include #endif /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function #include #endif #ifdef __LDBL_COMPAT #include #endif __END_DECLS #endif /* _WCHAR_H defined */ #endif /* wchar.h */ /* Undefine all __need_* constants in case we are included to get those constants but the whole file was already read. */ #undef __need_mbstate_t #undef __need_wint_t ================================================ FILE: v2/headers/linux_arm/usr/include/xlocale.h ================================================ /* Definition of locale datatype. Copyright (C) 1997-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _XLOCALE_H #define _XLOCALE_H 1 /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. The file and this data structure is not standardized. Don't rely on it. It can go away without warning. */ typedef struct __locale_struct { /* Note: LC_ALL is not a valid index into this array. */ struct __locale_data *__locales[13]; /* 13 = __LC_LAST. */ /* To increase the speed of this solution we add some special members. */ const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; /* Note: LC_ALL is not a valid index into this array. */ const char *__names[13]; } *__locale_t; /* POSIX 2008 makes locale_t official. */ typedef __locale_t locale_t; #endif /* xlocale.h */ ================================================ FILE: v2/headers/linux_arm/usr/include/zconf.h ================================================ /* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-2013 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #ifndef ZCONF_H #define ZCONF_H /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. * Even better than compiling with -DZ_PREFIX would be to use configure to set * this permanently in zconf.h using "./configure --zprefix". */ #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ #define Z_PREFIX_SET /* all linked symbols */ #define _dist_code z__dist_code #define _length_code z__length_code #define _tr_align z__tr_align #define _tr_flush_bits z__tr_flush_bits #define _tr_flush_block z__tr_flush_block #define _tr_init z__tr_init #define _tr_stored_block z__tr_stored_block #define _tr_tally z__tr_tally #define adler32 z_adler32 #define adler32_combine z_adler32_combine #define adler32_combine64 z_adler32_combine64 #ifndef Z_SOLO #define compress z_compress #define compress2 z_compress2 #define compressBound z_compressBound #endif #define crc32 z_crc32 #define crc32_combine z_crc32_combine #define crc32_combine64 z_crc32_combine64 #define deflate z_deflate #define deflateBound z_deflateBound #define deflateCopy z_deflateCopy #define deflateEnd z_deflateEnd #define deflateInit2_ z_deflateInit2_ #define deflateInit_ z_deflateInit_ #define deflateParams z_deflateParams #define deflatePending z_deflatePending #define deflatePrime z_deflatePrime #define deflateReset z_deflateReset #define deflateResetKeep z_deflateResetKeep #define deflateSetDictionary z_deflateSetDictionary #define deflateSetHeader z_deflateSetHeader #define deflateTune z_deflateTune #define deflate_copyright z_deflate_copyright #define get_crc_table z_get_crc_table #ifndef Z_SOLO #define gz_error z_gz_error #define gz_intmax z_gz_intmax #define gz_strwinerror z_gz_strwinerror #define gzbuffer z_gzbuffer #define gzclearerr z_gzclearerr #define gzclose z_gzclose #define gzclose_r z_gzclose_r #define gzclose_w z_gzclose_w #define gzdirect z_gzdirect #define gzdopen z_gzdopen #define gzeof z_gzeof #define gzerror z_gzerror #define gzflush z_gzflush #define gzgetc z_gzgetc #define gzgetc_ z_gzgetc_ #define gzgets z_gzgets #define gzoffset z_gzoffset #define gzoffset64 z_gzoffset64 #define gzopen z_gzopen #define gzopen64 z_gzopen64 #ifdef _WIN32 #define gzopen_w z_gzopen_w #endif #define gzprintf z_gzprintf #define gzvprintf z_gzvprintf #define gzputc z_gzputc #define gzputs z_gzputs #define gzread z_gzread #define gzrewind z_gzrewind #define gzseek z_gzseek #define gzseek64 z_gzseek64 #define gzsetparams z_gzsetparams #define gztell z_gztell #define gztell64 z_gztell64 #define gzungetc z_gzungetc #define gzwrite z_gzwrite #endif #define inflate z_inflate #define inflateBack z_inflateBack #define inflateBackEnd z_inflateBackEnd #define inflateBackInit_ z_inflateBackInit_ #define inflateCopy z_inflateCopy #define inflateEnd z_inflateEnd #define inflateGetHeader z_inflateGetHeader #define inflateInit2_ z_inflateInit2_ #define inflateInit_ z_inflateInit_ #define inflateMark z_inflateMark #define inflatePrime z_inflatePrime #define inflateReset z_inflateReset #define inflateReset2 z_inflateReset2 #define inflateSetDictionary z_inflateSetDictionary #define inflateGetDictionary z_inflateGetDictionary #define inflateSync z_inflateSync #define inflateSyncPoint z_inflateSyncPoint #define inflateUndermine z_inflateUndermine #define inflateResetKeep z_inflateResetKeep #define inflate_copyright z_inflate_copyright #define inflate_fast z_inflate_fast #define inflate_table z_inflate_table #ifndef Z_SOLO #define uncompress z_uncompress #endif #define zError z_zError #ifndef Z_SOLO #define zcalloc z_zcalloc #define zcfree z_zcfree #endif #define zlibCompileFlags z_zlibCompileFlags #define zlibVersion z_zlibVersion /* all zlib typedefs in zlib.h and zconf.h */ #define Byte z_Byte #define Bytef z_Bytef #define alloc_func z_alloc_func #define charf z_charf #define free_func z_free_func #ifndef Z_SOLO #define gzFile z_gzFile #endif #define gz_header z_gz_header #define gz_headerp z_gz_headerp #define in_func z_in_func #define intf z_intf #define out_func z_out_func #define uInt z_uInt #define uIntf z_uIntf #define uLong z_uLong #define uLongf z_uLongf #define voidp z_voidp #define voidpc z_voidpc #define voidpf z_voidpf /* all zlib structs in zlib.h and zconf.h */ #define gz_header_s z_gz_header_s #define internal_state z_internal_state #endif #if defined(__MSDOS__) && !defined(MSDOS) #define MSDOS #endif #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) #define OS2 #endif #if defined(_WINDOWS) && !defined(WINDOWS) #define WINDOWS #endif #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) #ifndef WIN32 #define WIN32 #endif #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) #if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) #ifndef SYS16BIT #define SYS16BIT #endif #endif #endif /* * Compile with -DMAXSEG_64K if the alloc function cannot allocate more * than 64k bytes at a time (needed on systems with 16-bit int). */ #ifdef SYS16BIT #define MAXSEG_64K #endif #ifdef MSDOS #define UNALIGNED_OK #endif #ifdef __STDC_VERSION__ #ifndef STDC #define STDC #endif #if __STDC_VERSION__ >= 199901L #ifndef STDC99 #define STDC99 #endif #endif #endif #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) #define STDC #endif #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) #define STDC #endif #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) #define STDC #endif #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) #define STDC #endif #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ #define STDC #endif #ifndef STDC #ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ #define const /* note: need a more gentle solution here */ #endif #endif #if defined(ZLIB_CONST) && !defined(z_const) #define z_const const #else #define z_const #endif /* Some Mac compilers merge all .h files incorrectly: */ #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) #define NO_DUMMY_DECL #endif /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL #ifdef MAXSEG_64K #define MAX_MEM_LEVEL 8 #else #define MAX_MEM_LEVEL 9 #endif #endif /* Maximum value for windowBits in deflateInit2 and inflateInit2. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files * created by gzip. (Files created by minigzip can still be extracted by * gzip.) */ #ifndef MAX_WBITS #define MAX_WBITS 15 /* 32K LZ77 window */ #endif /* The memory requirements for deflate are (in bytes): (1 << (windowBits+2)) + (1 << (memLevel+9)) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) plus a few kilobytes for small objects. For example, if you want to reduce the default memory requirements from 256K to 128K, compile with make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits that is, 32K for windowBits=15 (default value) plus a few kilobytes for small objects. */ /* Type declarations */ #ifndef OF /* function prototypes */ #ifdef STDC #define OF(args) args #else #define OF(args) () #endif #endif #ifndef Z_ARG /* function prototypes for stdarg */ #if defined(STDC) || defined(Z_HAVE_STDARG_H) #define Z_ARG(args) args #else #define Z_ARG(args) () #endif #endif /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, * just define FAR to be empty. */ #ifdef SYS16BIT #if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */ #define SMALL_MEDIUM #ifdef _MSC_VER #define FAR _far #else #define FAR far #endif #endif #if (defined(__SMALL__) || defined(__MEDIUM__)) /* Turbo C small or medium model */ #define SMALL_MEDIUM #ifdef __BORLANDC__ #define FAR _far #else #define FAR far #endif #endif #endif #if defined(WINDOWS) || defined(WIN32) /* If building or using zlib as a DLL, define ZLIB_DLL. * This is not mandatory, but it offers a little performance increase. */ #ifdef ZLIB_DLL #if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) #ifdef ZLIB_INTERNAL #define ZEXTERN extern __declspec(dllexport) #else #define ZEXTERN extern __declspec(dllimport) #endif #endif #endif /* ZLIB_DLL */ /* If building or using zlib with the WINAPI/WINAPIV calling convention, * define ZLIB_WINAPI. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. */ #ifdef ZLIB_WINAPI #ifdef FAR #undef FAR #endif #include /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ #define ZEXPORT WINAPI #ifdef WIN32 #define ZEXPORTVA WINAPIV #else #define ZEXPORTVA FAR CDECL #endif #endif #endif #if defined (__BEOS__) #ifdef ZLIB_DLL #ifdef ZLIB_INTERNAL #define ZEXPORT __declspec(dllexport) #define ZEXPORTVA __declspec(dllexport) #else #define ZEXPORT __declspec(dllimport) #define ZEXPORTVA __declspec(dllimport) #endif #endif #endif #ifndef ZEXTERN #define ZEXTERN extern #endif #ifndef ZEXPORT #define ZEXPORT #endif #ifndef ZEXPORTVA #define ZEXPORTVA #endif #ifndef FAR #define FAR #endif #if !defined(__MACTYPES__) typedef unsigned char Byte; /* 8 bits */ #endif typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ #ifdef SMALL_MEDIUM /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ #define Bytef Byte FAR #else typedef Byte FAR Bytef; #endif typedef char FAR charf; typedef int FAR intf; typedef uInt FAR uIntf; typedef uLong FAR uLongf; #ifdef STDC typedef void const *voidpc; typedef void FAR *voidpf; typedef void *voidp; #else typedef Byte const *voidpc; typedef Byte FAR *voidpf; typedef Byte *voidp; #endif #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) #include #if (UINT_MAX == 0xffffffffUL) #define Z_U4 unsigned #elif (ULONG_MAX == 0xffffffffUL) #define Z_U4 unsigned long #elif (USHRT_MAX == 0xffffffffUL) #define Z_U4 unsigned short #endif #endif #ifdef Z_U4 typedef Z_U4 z_crc_t; #else typedef unsigned long z_crc_t; #endif #if 1 /* was set to #if 1 by ./configure */ #define Z_HAVE_UNISTD_H #endif #if 1 /* was set to #if 1 by ./configure */ #define Z_HAVE_STDARG_H #endif #ifdef STDC #ifndef Z_SOLO #include /* for off_t */ #endif #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) #ifndef Z_SOLO #include /* for va_list */ #endif #endif #ifdef _WIN32 #ifndef Z_SOLO #include /* for wchar_t */ #endif #endif /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even * though the former does not conform to the LFS document), but considering * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as * equivalently requesting no 64-bit operations */ #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 #undef _LARGEFILE64_SOURCE #endif #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) #define Z_HAVE_UNISTD_H #endif #ifndef Z_SOLO #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) #include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ #ifdef VMS #include /* for off_t */ #endif #ifndef z_off_t #define z_off_t off_t #endif #endif #endif #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 #define Z_LFS64 #endif #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) #define Z_LARGE64 #endif #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) #define Z_WANT64 #endif #if !defined(SEEK_SET) && !defined(Z_SOLO) #define SEEK_SET 0 /* Seek from beginning of file. */ #define SEEK_CUR 1 /* Seek from current position. */ #define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif #ifndef z_off_t #define z_off_t long #endif #if !defined(_WIN32) && defined(Z_LARGE64) #define z_off64_t off64_t #else #if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) #define z_off64_t __int64 #else #define z_off64_t z_off_t #endif #endif /* MVS linker does not support external names larger than 8 bytes */ #if defined(__MVS__) #pragma map(deflateInit_,"DEIN") #pragma map(deflateInit2_,"DEIN2") #pragma map(deflateEnd,"DEEND") #pragma map(deflateBound,"DEBND") #pragma map(inflateInit_,"ININ") #pragma map(inflateInit2_,"ININ2") #pragma map(inflateEnd,"INEND") #pragma map(inflateSync,"INSY") #pragma map(inflateSetDictionary,"INSEDI") #pragma map(compressBound,"CMBND") #pragma map(inflate_table,"INTABL") #pragma map(inflate_fast,"INFA") #pragma map(inflate_copyright,"INCOPY") #endif #endif /* ZCONF_H */ ================================================ FILE: v2/headers/linux_arm/usr/include/zlib.h ================================================ /* zlib.h -- interface of the 'zlib' general purpose compression library version 1.2.8, April 28th, 2013 Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler jloup@gzip.org madler@alumni.caltech.edu The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). */ #ifndef ZLIB_H #define ZLIB_H #include "zconf.h" #ifdef __cplusplus extern "C" { #endif #define ZLIB_VERSION "1.2.8" #define ZLIB_VERNUM 0x1280 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 #define ZLIB_VER_REVISION 8 #define ZLIB_VER_SUBREVISION 0 /* The 'zlib' compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method (deflation) but other algorithms will be added later and will have the same stream interface. Compression can be done in a single step if the buffers are large enough, or can be done by repeated calls of the compression function. In the latter case, the application must provide more input and/or consume the output (providing more output space) before each call. The compressed data format used by default by the in-memory functions is the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped around a deflate stream, which is itself documented in RFC 1951. The library also supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. This library can optionally read and write gzip streams in memory as well. The zlib format was designed to be compact and fast for use in memory and on communications channels. The gzip format was designed for single- file compression on file systems, has a larger header than zlib to maintain directory information, and uses a different, slower check method than zlib. The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash even in case of corrupted input. */ typedef voidpf(*alloc_func) OF((voidpf opaque, uInt items, uInt size)); typedef void (*free_func) OF((voidpf opaque, voidpf address)); struct internal_state; typedef struct z_stream_s { z_const Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total number of input bytes read so far */ Bytef *next_out; /* next output byte should be put there */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total number of bytes output so far */ z_const char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ int data_type; /* best guess about the data type: binary or text */ uLong adler; /* adler32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ } z_stream; typedef z_stream FAR *z_streamp; /* gzip header information passed to and from zlib routines. See RFC 1952 for more details on the meanings of these fields. */ typedef struct gz_header_s { int text; /* true if compressed data believed to be text */ uLong time; /* modification time */ int xflags; /* extra flags (not used when writing a gzip file) */ int os; /* operating system */ Bytef *extra; /* pointer to extra field or Z_NULL if none */ uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ uInt extra_max; /* space at extra (only when reading header) */ Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ uInt name_max; /* space at name (only when reading header) */ Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ uInt comm_max; /* space at comment (only when reading header) */ int hcrc; /* true if there was or will be a header crc */ int done; /* true when done reading gzip header (not used when writing a gzip file) */ } gz_header; typedef gz_header FAR *gz_headerp; /* The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out has dropped to zero. The application must initialize zalloc, zfree and opaque before calling the init function. All other fields are set by the compression library and must not be updated by the application. The opaque value provided by the application will be passed as the first parameter for calls of zalloc and zfree. This can be useful for custom memory management. The compression library attaches no meaning to the opaque value. zalloc must return Z_NULL if there is not enough memory for the object. If zlib is used in a multi-threaded application, zalloc and zfree must be thread safe. On 16-bit systems, the functions zalloc and zfree must be able to allocate exactly 65536 bytes, but will not be required to allocate more than this if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers returned by zalloc for objects of exactly 65536 bytes *must* have their offset normalized to zero. The default allocation function provided by this library ensures this (see zutil.c). To reduce memory requirements and avoid any allocation of 64K objects, at the expense of compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). The fields total_in and total_out can be used for statistics or progress reports. After compression, total_in holds the total size of the uncompressed data and may be saved for use in the decompressor (particularly if the decompressor wants to decompress everything in a single step). */ /* constants */ #define Z_NO_FLUSH 0 #define Z_PARTIAL_FLUSH 1 #define Z_SYNC_FLUSH 2 #define Z_FULL_FLUSH 3 #define Z_FINISH 4 #define Z_BLOCK 5 #define Z_TREES 6 /* Allowed flush values; see deflate() and inflate() below for details */ #define Z_OK 0 #define Z_STREAM_END 1 #define Z_NEED_DICT 2 #define Z_ERRNO (-1) #define Z_STREAM_ERROR (-2) #define Z_DATA_ERROR (-3) #define Z_MEM_ERROR (-4) #define Z_BUF_ERROR (-5) #define Z_VERSION_ERROR (-6) /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ #define Z_NO_COMPRESSION 0 #define Z_BEST_SPEED 1 #define Z_BEST_COMPRESSION 9 #define Z_DEFAULT_COMPRESSION (-1) /* compression levels */ #define Z_FILTERED 1 #define Z_HUFFMAN_ONLY 2 #define Z_RLE 3 #define Z_FIXED 4 #define Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ #define Z_BINARY 0 #define Z_TEXT 1 #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ #define Z_UNKNOWN 2 /* Possible values of the data_type field (though see inflate()) */ #define Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ #define zlib_version zlibVersion() /* for compatibility with versions < 1.0.2 */ /* basic functions */ ZEXTERN const char *ZEXPORT zlibVersion OF((void)); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check is automatically made by deflateInit and inflateInit. */ /* ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If zalloc and zfree are set to Z_NULL, deflateInit updates them to use default allocation functions. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION requests a default compromise between speed and compression (currently equivalent to level 6). deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if level is not a valid compression level, or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); /* deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. deflate performs one or both of the following actions: - Compress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in and avail_in are updated and processing will resume at this point for the next call of deflate(). - Provide more output starting at next_out and update next_out and avail_out accordingly. This action is forced if the parameter flush is non zero. Forcing flush frequently degrades the compression ratio, so this parameter should be set only when necessary (in interactive applications). Some output may be provided even if flush is not set. Before the call of deflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating avail_in or avail_out accordingly; avail_out should never be zero before the call. The application can consume the compressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to decide how much data to accumulate before producing output, in order to maximize compression. If the parameter flush is set to Z_SYNC_FLUSH, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. (In particular avail_in is zero after the call if enough output space has been provided before the call.) Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. This completes the current deflate block and follows it with an empty stored block that is three bits plus filler bits to the next byte, followed by four bytes (00 00 ff ff). If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the output buffer, but the output is not aligned to a byte boundary. All of the input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. This completes the current deflate block and follows it with an empty fixed codes block that is 10 bits long. This assures that enough bytes are output in order for the decompressor to finish the block before the empty fixed code block. If flush is set to Z_BLOCK, a deflate block is completed and emitted, as for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to seven bits of the current block are held to be written as the next byte after the next deflate block is completed. In this case, the decompressor may not be provided enough bits at this point in order to complete decompression of the data provided so far to the compressor. It may need to wait for the next block to be emitted. This is for advanced applications that need to control the emission of deflate blocks. If flush is set to Z_FULL_FLUSH, all output is flushed as with Z_SYNC_FLUSH, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using Z_FULL_FLUSH too often can seriously degrade compression. If deflate returns with avail_out == 0, this function must be called again with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that avail_out is greater than six to avoid repeated flush markers due to avail_out == 0 on return. If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was enough output space; if deflate returns with Z_OK, this function must be called again with Z_FINISH and more output space (updated avail_out) but no more input data, until it returns with Z_STREAM_END or an error. After deflate has returned Z_STREAM_END, the only possible operations on the stream are deflateReset or deflateEnd. Z_FINISH can be used immediately after deflateInit if all the compression is to be done in a single step. In this case, avail_out must be at least the value returned by deflateBound (see below). Then deflate is guaranteed to return Z_STREAM_END. If not enough output space is provided, deflate will not return Z_STREAM_END, and it must be called again as described above. deflate() sets strm->adler to the adler32 checksum of all input read so far (that is, total_in bytes). deflate() may update strm->data_type if it can make a good guess about the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered binary. This field is only for information purposes and does not affect the compression algorithm in any manner. deflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if all input has been consumed and all output has been produced (only when flush is set to Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and deflate() can be called again with more input and more output space to continue compressing. */ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent, Z_DATA_ERROR if the stream was freed prematurely (some input or output was discarded). In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. If next_in is not Z_NULL and avail_in is large enough (the exact value depends on the compression method), inflateInit determines the compression method from the zlib header and allocates all data structures accordingly; otherwise the allocation will be deferred to the first call of inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to use default allocation functions. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit does not perform any decompression apart from possibly reading the zlib header if present: actual decompression will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unused and unchanged.) The current implementation of inflateInit() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. inflate performs one or both of the following actions: - Decompress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in is updated and processing will resume at this point for the next call of inflate(). - Provide more output starting at next_out and update next_out and avail_out accordingly. inflate() provides as much output as possible, until there is no more input data or no more space in the output buffer (see below about the flush parameter). Before the call of inflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating the next_* and avail_* values accordingly. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of inflate(). If inflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much output as possible to the output buffer. Z_BLOCK requests that inflate() stop if and when it gets to the next deflate block boundary. When decoding the zlib or gzip format, this will cause inflate() to return immediately after the header and before the first block. When doing a raw inflate, inflate() will go ahead and process the first block, and will return when it gets to the end of that block, or when it runs out of data. The Z_BLOCK option assists in appending to or combining deflate streams. Also to assist in this, on return inflate() will set strm->data_type to the number of unused bits in the last byte taken from strm->next_in, plus 64 if inflate() is currently decoding the last block in the deflate stream, plus 128 if inflate() returned immediately after decoding an end-of-block code or decoding the complete header up to just before the first byte of the deflate stream. The end-of-block will not be indicated until all of the uncompressed data from that block has been written to strm->next_out. The number of unused bits may in general be greater than seven, except when bit 7 of data_type is set, in which case the number of unused bits will be less than eight. data_type is set as noted here every time inflate() returns for all flush options, and so can be used to determine the amount of currently consumed input in bits. The Z_TREES option behaves as Z_BLOCK does, but it also returns when the end of each deflate block header is reached, before any actual data in that block is decoded. This allows the caller to determine the length of the deflate block header for later use in random access within a deflate block. 256 is added to the value of strm->data_type when inflate() returns immediately after reaching the end of the deflate block header. inflate() should normally be called until it returns Z_STREAM_END or an error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to Z_FINISH. In this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all of the uncompressed data for the operation to complete. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The use of Z_FINISH is not required to perform an inflation in one step. However it may be used to inform inflate that a faster approach can be used for the single inflate() call. Z_FINISH also informs inflate to not maintain a sliding window if the stream completes, which reduces inflate's memory footprint. If the stream does not complete, either because not all of the stream is provided or not enough output space is provided, then a sliding window will be allocated and inflate() can be called again to continue the operation as if Z_NO_FLUSH had been used. In this implementation, inflate() always flushes as much output as possible to the output buffer, and always uses the faster approach on the first call. So the effects of the flush parameter in this implementation are on the return value of inflate() as noted below, when inflate() returns early when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of memory for a sliding window when Z_FINISH is used. If a preset dictionary is needed after this call (see inflateSetDictionary below), inflate sets strm->adler to the Adler-32 checksum of the dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the Adler-32 checksum of all output produced so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described below. At the end of the stream, inflate() checks that its computed adler32 checksum is equal to that saved by the compressor and returns Z_STREAM_END only if the checksum is correct. inflate() can decompress and check either zlib-wrapped or gzip-wrapped deflate data. The header type is detected automatically, if requested when initializing with inflateInit2(). Any information contained in the gzip header is not retained, so applications that need that information should instead use raw inflate, see inflateInit2() below, or inflateBack() and perform their own processing of the gzip header and trailer. When processing gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output producted so far. The CRC-32 is checked against the gzip trailer. inflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced, Z_NEED_DICT if a preset dictionary is needed at this point, Z_DATA_ERROR if the input data was corrupted (input stream not conforming to the zlib format or incorrect check value), Z_STREAM_ERROR if the stream structure was inconsistent (for example next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no progress is possible or if there was not enough room in the output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and inflate() can be called again with more input and more output space to continue decompressing. If Z_DATA_ERROR is returned, the application may then call inflateSync() to look for a good compression block if a partial recovery of the data is desired. */ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent. In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* Advanced functions */ /* The following functions are needed only in some special applications. */ /* ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy)); This is another version of deflateInit with more compression options. The fields next_in, zalloc, zfree and opaque must be initialized before by the caller. The method parameter is the compression method. It must be Z_DEFLATED in this version of the library. The windowBits parameter is the base two logarithm of the window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. Larger values of this parameter result in better compression at the expense of memory usage. The default value is 15 if deflateInit is used instead. windowBits can also be -8..-15 for raw deflate. In this case, -windowBits determines the window size. deflate() will then generate raw deflate data with no zlib header or trailer, and will not compute an adler32 check value. windowBits can also be greater than 15 for optional gzip encoding. Add 16 to windowBits to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper. The gzip header will have no file name, no extra data, no comment, no modification time (set to zero), no header crc, and the operating system will be set to 255 (unknown). If a gzip stream is being written, strm->adler is a crc32 instead of an adler32. The memLevel parameter specifies how much memory should be allocated for the internal compression state. memLevel=1 uses minimum memory but is slow and reduces compression ratio; memLevel=9 uses maximum memory for optimal speed. The default value is 8. See zconf.h for total memory usage as a function of windowBits and memLevel. The strategy parameter is used to tune the compression algorithm. Use the value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no string match), or Z_RLE to limit match distances to one (run-length encoding). Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better. The effect of Z_FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately. Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit2 does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, const Bytef * dictionary, uInt dictLength)); /* Initializes the compression dictionary from the given byte sequence without producing any compressed output. When using the zlib format, this function must be called immediately after deflateInit, deflateInit2 or deflateReset, and before any call of deflate. When doing raw deflate, this function must be called either before any call of deflate, or immediately after the completion of a deflate block, i.e. after all input has been consumed and all output has been delivered when using any of the flush options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The compressor and decompressor must use exactly the same dictionary (see inflateSetDictionary). The dictionary should consist of strings (byte sequences) that are likely to be encountered later in the data to be compressed, with the most commonly used strings preferably put towards the end of the dictionary. Using a dictionary is most useful when the data to be compressed is short and can be predicted with good accuracy; the data can then be compressed better than with the default empty dictionary. Depending on the size of the compression data structures selected by deflateInit or deflateInit2, a part of the dictionary may in effect be discarded, for example if the dictionary is larger than the window size provided in deflateInit or deflateInit2. Thus the strings most likely to be useful should be put at the end of the dictionary, not at the front. In addition, the current implementation of deflate will use at most the window size minus 262 bytes of the provided dictionary. Upon return of this function, strm->adler is set to the adler32 value of the dictionary; the decompressor may later use this value to determine which dictionary has been used by the compressor. (The adler32 value applies to the whole dictionary even if only a subset of the dictionary is actually used by the compressor.) If a raw deflate was requested, then the adler32 value is not computed and strm->adler is not set. deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent (for example if deflate has already been called for this stream or if not at a block boundary for raw deflate). deflateSetDictionary does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when several compression strategies will be tried, for example when there are several ways of pre-processing the input data with a filter. The streams that will be discarded should then be freed by calling deflateEnd. Note that deflateCopy duplicates the internal compression state which can be quite large, so this strategy is slow and can consume lots of memory. deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate all the internal compression state. The stream will keep the same compression level and any other attributes that may have been set by deflateInit2. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, int level, int strategy)); /* Dynamically update the compression level and compression strategy. The interpretation of level and strategy is as in deflateInit2. This can be used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression level is changed, the input available so far is compressed with the old level (and may be flushed); the new level will take effect only at the next call of deflate(). Before the call of deflateParams, the stream state must be set as for a call of deflate(), since the currently available input may have to be compressed and flushed. In particular, strm->avail_out must be non-zero. deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if strm->avail_out was zero. */ ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)); /* Fine tune deflate's internal compression parameters. This should only be used by someone who understands the algorithm used by zlib's deflate for searching for the best matching string, and even then only by the most fanatic optimizer trying to squeeze out the last compressed bit for their specific input data. Read the deflate.c source code for the meaning of the max_lazy, good_length, nice_length, and max_chain parameters. deflateTune() can be called after deflateInit() or deflateInit2(), and returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. */ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, uLong sourceLen)); /* deflateBound() returns an upper bound on the compressed size after deflation of sourceLen bytes. It must be called after deflateInit() or deflateInit2(), and after deflateSetHeader(), if used. This would be used to allocate an output buffer for deflation in a single pass, and so would be called before deflate(). If that first deflate() call is provided the sourceLen input bytes, an output buffer allocated to the size returned by deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed to return Z_STREAM_END. Note that it is possible for the compressed size to be larger than the value returned by deflateBound() if flush options other than Z_FINISH or Z_NO_FLUSH are used. */ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, unsigned *pending, int *bits)); /* deflatePending() returns the number of bytes and bits of output that have been generated, but not yet provided in the available output. The bytes not provided would be due to the available output space having being consumed. The number of bits of output not provided are between 0 and 7, where they await more bits to join them in order to fill out a full byte. If pending or bits are Z_NULL, then those values are not set. deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, int bits, int value)); /* deflatePrime() inserts bits in the deflate output stream. The intent is that this function is used to start off the deflate output with the bits leftover from a previous deflate stream when appending to it. As such, this function can only be used for raw deflate, and must be used before the first deflate() call after a deflateInit2() or deflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the output. deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, gz_headerp head)); /* deflateSetHeader() provides gzip header information for when a gzip stream is requested by deflateInit2(). deflateSetHeader() may be called after deflateInit2() or deflateReset() and before the first call of deflate(). The text, time, os, extra field, name, and comment information in the provided gz_header structure are written to the gzip header (xflag is ignored -- the extra flags are set according to the compression level). The caller must assure that, if not Z_NULL, name and comment are terminated with a zero byte, and that if extra is not Z_NULL, that extra_len bytes are available there. If hcrc is true, a gzip header crc is included. Note that the current versions of the command-line version of gzip (up through version 1.3.x) do not support header crc's, and will report that it is a "multi-part gzip file" and give up. If deflateSetHeader is not used, the default gzip header has text false, the time set to zero, and os set to 255, with no extra, name, or comment fields. The gzip header is returned to the default state by deflateReset(). deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, int windowBits)); This is another version of inflateInit with an extra parameter. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. The windowBits parameter is the base two logarithm of the maximum window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. The default value is 15 if inflateInit is used instead. windowBits must be greater than or equal to the windowBits value provided to deflateInit2() while compressing, or it must be equal to 15 if deflateInit2() was not used. If a compressed stream with a larger window size is given as input, inflate() will return with the error code Z_DATA_ERROR instead of trying to allocate a larger window. windowBits can also be zero to request that inflate use the window size in the zlib header of the compressed stream. windowBits can also be -8..-15 for raw inflate. In this case, -windowBits determines the window size. inflate() will then process raw deflate data, not looking for a zlib or gzip header, not generating a check value, and not looking for any check values for comparison at the end of the stream. This is for use with other formats that use the deflate compressed data format such as zip. Those formats provide their own check values. If a custom format is developed using the raw deflate format for compressed data, it is recommended that a check value such as an adler32 or a crc32 be applied to the uncompressed data as is done in the zlib, gzip, and zip formats. For most applications, the zlib format should be used as is. Note that comments above on the use in deflateInit2() applies to the magnitude of windowBits. windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a crc32 instead of an adler32. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit2 does not perform any decompression apart from possibly reading the zlib header if present: actual decompression will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unused and unchanged.) The current implementation of inflateInit2() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, const Bytef * dictionary, uInt dictLength)); /* Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the adler32 value returned by that call of inflate. The compressor and decompressor must use exactly the same dictionary (see deflateSetDictionary). For raw inflate, this function can be called at any time to set the dictionary. If the provided dictionary is smaller than the window and there is already data in the window, then the provided dictionary will amend what's there. The application must insure that the dictionary that was used for compression is provided. inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the expected one (incorrect adler32 value). inflateSetDictionary does not perform any decompression: this will be done by subsequent calls of inflate(). */ ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, Bytef * dictionary, uInt * dictLength)); /* Returns the sliding dictionary being maintained by inflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied to dictionary. dictionary must have enough space, where 32768 bytes is always enough. If inflateGetDictionary() is called with dictionary equal to Z_NULL, then only the dictionary length is returned, and nothing is copied. Similary, if dictLength is Z_NULL, then it is not set. inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the stream state is inconsistent. */ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); /* Skips invalid compressed data until a possible full flush point (see above for the description of deflate with Z_FULL_FLUSH) can be found, or until all available input is skipped. No output is provided. inflateSync searches for a 00 00 FF FF pattern in the compressed data. All full flush points have this pattern, but not all occurrences of this pattern are full flush points. inflateSync returns Z_OK if a possible full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the success case, the application may save the current current value of total_in which indicates where valid compressed data was found. In the error case, the application may repeatedly call inflateSync, providing more input each time, until success or end of the input data. */ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when randomly accessing a large stream. The first pass through the stream can periodically record the inflate state, allowing restarting inflate at those points when randomly accessing the stream. inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate all the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, int windowBits)); /* This function is the same as inflateReset, but it also permits changing the wrap and window size requests. The windowBits parameter is interpreted the same as it is for inflateInit2. inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL), or if the windowBits parameter is invalid. */ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, int bits, int value)); /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the middle of a byte. The provided bits will be used before any bytes are used from next_in. This function should only be used with raw inflate, and should be used before the first inflate() call after inflateInit2() or inflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the input. If bits is negative, then the input stream bit buffer is emptied. Then inflatePrime() can be called again to put bits in the buffer. This is used to clear out bits leftover after feeding inflate a block description prior to feeding inflate codes. inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); /* This function returns two values, one in the lower 16 bits of the return value, and the other in the remaining upper bits, obtained by shifting the return value down 16 bits. If the upper value is -1 and the lower value is zero, then inflate() is currently decoding information outside of a block. If the upper value is -1 and the lower value is non-zero, then inflate is in the middle of a stored block, with the lower value equaling the number of bytes from the input remaining to copy. If the upper value is not -1, then it is the number of bits back from the current bit position in the input of the code (literal or length/distance pair) currently being processed. In that case the lower value is the number of bytes already emitted for that code. A code is being processed if inflate is waiting for more input to complete decoding of the code, or if it has completed decoding but is waiting for more output space to write the literal or match data. inflateMark() is used to mark locations in the input data for random access, which may be at bit positions, and to note those cases where the output of a code may span boundaries of random access blocks. The current location in the input stream can be determined from avail_in and data_type as noted in the description for the Z_BLOCK flush parameter for inflate. inflateMark returns the value noted above or -1 << 16 if the provided source stream state was inconsistent. */ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, gz_headerp head)); /* inflateGetHeader() requests that gzip header information be stored in the provided gz_header structure. inflateGetHeader() may be called after inflateInit2() or inflateReset(), and before the first call of inflate(). As inflate() processes the gzip stream, head->done is zero until the header is completed, at which time head->done is set to one. If a zlib stream is being decoded, then head->done is set to -1 to indicate that there will be no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be used to force inflate() to return immediately after header processing is complete and before any actual data is decompressed. The text, time, xflags, and os fields are filled in with the gzip header contents. hcrc is set to true if there is a header CRC. (The header CRC was valid if done is set to one.) If extra is not Z_NULL, then extra_max contains the maximum number of bytes to write to extra. Once done is true, extra_len contains the actual extra field length, and extra contains the extra field, or that field truncated if extra_max is less than extra_len. If name is not Z_NULL, then up to name_max characters are written there, terminated with a zero unless the length is greater than name_max. If comment is not Z_NULL, then up to comm_max characters are written there, terminated with a zero unless the length is greater than comm_max. When any of extra, name, or comment are not Z_NULL and the respective field is not present in the header, then that field is set to Z_NULL to signal its absence. This allows the use of deflateSetHeader() with the returned structure to duplicate the header. However if those fields are set to allocated memory, then the application will need to save those pointers elsewhere so that they can be eventually freed. If inflateGetHeader is not used, then the header information is simply discarded. The header is always checked for validity, including the header CRC if present. inflateReset() will reset the process to discard the header information. The application would need to call inflateGetHeader() again to retrieve the header from the next gzip stream. inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, unsigned char FAR *window)); Initialize the internal stream state for decompression using inflateBack() calls. The fields zalloc, zfree and opaque in strm must be initialized before the call. If zalloc and zfree are Z_NULL, then the default library- derived memory allocation routines are used. windowBits is the base two logarithm of the window size, in the range 8..15. window is a caller supplied buffer of that size. Except for special applications where it is assured that deflate was used with small window sizes, windowBits must be 15 and a 32K byte window must be supplied to be able to decompress general deflate streams. See inflateBack() for the usage of these routines. inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of the parameters are invalid, Z_MEM_ERROR if the internal state could not be allocated, or Z_VERSION_ERROR if the version of the library does not match the version of the header file. */ typedef unsigned (*in_func) OF((void FAR *, z_const unsigned char FAR * FAR *)); typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, in_func in, void FAR * in_desc, out_func out, void FAR * out_desc)); /* inflateBack() does a raw inflate with a single call using a call-back interface for input and output. This is potentially more efficient than inflate() for file i/o applications, in that it avoids copying between the output and the sliding window by simply making the window itself the output buffer. inflate() can be faster on modern CPUs when used with large buffers. inflateBack() trusts the application to not change the output buffer passed by the output function, at least until inflateBack() returns. inflateBackInit() must be called first to allocate the internal state and to initialize the state with the user-provided window buffer. inflateBack() may then be used multiple times to inflate a complete, raw deflate stream with each call. inflateBackEnd() is then called to free the allocated state. A raw deflate stream is one with no zlib or gzip header or trailer. This routine would normally be used in a utility that reads zip or gzip files and writes out uncompressed files. The utility would decode the header and process the trailer on its own, hence this routine expects only the raw deflate stream to decompress. This is different from the normal behavior of inflate(), which expects either a zlib or gzip header and trailer around the deflate stream. inflateBack() uses two subroutines supplied by the caller that are then called by inflateBack() for input and output. inflateBack() calls those routines until it reads a complete deflate stream and writes out all of the uncompressed data, or until it encounters an error. The function's parameters and return types are defined above in the in_func and out_func typedefs. inflateBack() will call in(in_desc, &buf) which should return the number of bytes of provided input, and a pointer to that input in buf. If there is no input available, in() must return zero--buf is ignored in that case--and inflateBack() will return a buffer error. inflateBack() will call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() should return zero on success, or non-zero on failure. If out() returns non-zero, inflateBack() will return with an error. Neither in() nor out() are permitted to change the contents of the window provided to inflateBackInit(), which is also the buffer that out() uses to write from. The length written by out() will be at most the window size. Any non-zero amount of input may be provided by in(). For convenience, inflateBack() can be provided input on the first call by setting strm->next_in and strm->avail_in. If that input is exhausted, then in() will be called. Therefore strm->next_in must be initialized before calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in must also be initialized, and then if strm->avail_in is not zero, input will initially be taken from strm->next_in[0 .. strm->avail_in - 1]. The in_desc and out_desc parameters of inflateBack() is passed as the first parameter of in() and out() respectively when they are called. These descriptors can be optionally used to pass any information that the caller- supplied in() and out() functions need to do their job. On return, inflateBack() will set strm->next_in and strm->avail_in to pass back any unused input that was provided by the last in() call. The return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR if in() or out() returned an error, Z_DATA_ERROR if there was a format error in the deflate stream (in which case strm->msg is set to indicate the nature of the error), or Z_STREAM_ERROR if the stream was not properly initialized. In the case of Z_BUF_ERROR, an input or output error can be distinguished using strm->next_in which will be Z_NULL only if in() returned an error. If strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning non-zero. (in() will always be called before out(), so strm->next_in is assured to be defined if out() returns non-zero.) Note that inflateBack() cannot return Z_OK. */ ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); /* All memory allocated by inflateBackInit() is freed. inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream state was inconsistent. */ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); /* Return flags indicating compile-time options. Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: 1.0: size of uInt 3.2: size of uLong 5.4: size of voidpf (pointer) 7.6: size of z_off_t Compiler, assembler, and debug options: 8: DEBUG 9: ASMV or ASMINF -- use ASM code 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention 11: 0 (reserved) One-time table building (smaller code, but not thread-safe if true): 12: BUILDFIXED -- build static block decoding tables when needed 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed 14,15: 0 (reserved) Library content (indicates missing functionality): 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking deflate code when not needed) 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect and decode gzip streams (to avoid linking crc code) 18-19: 0 (reserved) Operation variations (changes in library functionality): 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate 21: FASTEST -- deflate algorithm with only one, lowest compression level 22,23: 0 (reserved) The sprintf variant used by gzprintf (zero is best): 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! 26: 0 = returns value, 1 = void -- 1 means inferred string length returned Remainder: 27-31: 0 (reserved) */ #ifndef Z_SOLO /* utility functions */ /* The following utility functions are implemented on top of the basic stream-oriented functions. To simplify the interface, some default options are assumed (compression level and memory usage, standard memory allocation functions). The source code of these utility functions can be modified if you need special options. */ ZEXTERN int ZEXPORT compress OF((Bytef * dest, uLongf * destLen, const Bytef * source, uLong sourceLen)); /* Compresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed buffer. compress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer. */ ZEXTERN int ZEXPORT compress2 OF((Bytef * dest, uLongf * destLen, const Bytef * source, uLong sourceLen, int level)); /* Compresses the source buffer into the destination buffer. The level parameter has the same meaning as in deflateInit. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed buffer. compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); /* compressBound() returns an upper bound on the compressed size after compress() or compress2() on sourceLen bytes. It would be used before a compress() or compress2() call to allocate the destination buffer. */ ZEXTERN int ZEXPORT uncompress OF((Bytef * dest, uLongf * destLen, const Bytef * source, uLong sourceLen)); /* Decompresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be large enough to hold the entire uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some mechanism outside the scope of this compression library.) Upon exit, destLen is the actual size of the uncompressed buffer. uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In the case where there is not enough room, uncompress() will fill the output buffer with the uncompressed data up to that point. */ /* gzip file access functions */ /* This library supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio, using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. */ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ /* ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); Opens a gzip (.gz) file for reading or writing. The mode parameter is as in fopen ("rb" or "wb") but can also include a compression level ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression as in "wb9F". (See the description of deflateInit2 for more information about the strategy parameter.) 'T' will request transparent writing or appending with no compression and not using the gzip format. "a" can be used instead of "w" to request that the gzip stream that will be written be appended to the file. "+" will result in an error, since reading and writing to the same gzip file is not supported. The addition of "x" when writing will create the file exclusively, which fails if the file already exists. On systems that support it, the addition of "e" when reading or writing will set the flag to close the file on an execve() call. These functions, as well as gzip, will read and decode a sequence of gzip streams in a file. The append function of gzopen() can be used to create such a file. (Also see gzflush() for another way to do this.) When appending, gzopen does not test whether the file begins with a gzip stream, nor does it look for the end of the gzip streams to begin appending. gzopen will simply append a gzip stream to the existing file. gzopen can be used to read a file which is not in gzip format; in this case gzread will directly read from the file without decompression. When reading, this will be detected automatically by looking for the magic two- byte gzip header. gzopen returns NULL if the file could not be opened, if there was insufficient memory to allocate the gzFile state, or if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). errno can be checked to determine if the reason gzopen failed was that the file could not be opened. */ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); /* gzdopen associates a gzFile with the file descriptor fd. File descriptors are obtained from calls like open, dup, creat, pipe or fileno (if the file has been previously opened with fopen). The mode parameter is as in gzopen. The next call of gzclose on the returned gzFile will also close the file descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, mode);. The duplicated descriptor should be saved to avoid a leak, since gzdopen does not close fd if it fails. If you are using fileno() to get the file descriptor from a FILE *, then you will have to use dup() to avoid double-close()ing the file descriptor. Both gzclose() and fclose() will close the associated file descriptor, so they need to have different file descriptors. gzdopen returns NULL if there was insufficient memory to allocate the gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided), or if fd is -1. The file descriptor is not used until the next gz* read, write, seek, or close operation, so gzdopen will not detect if fd is invalid (unless fd is -1). */ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); /* Set the internal buffer size used by this library's functions. The default buffer size is 8192 bytes. This function must be called after gzopen() or gzdopen(), and before any other calls that read or write the file. The buffer memory allocation is always deferred to the first read or write. Two buffers are allocated, either both of the specified size when writing, or one of the specified size and the other twice that size when reading. A larger buffer size of, for example, 64K or 128K bytes will noticeably increase the speed of decompression (reading). The new buffer size also affects the maximum length for gzprintf(). gzbuffer() returns 0 on success, or -1 on failure, such as being called too late. */ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); /* Dynamically update the compression level or strategy. See the description of deflateInit2 for the meaning of these parameters. gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not opened for writing. */ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); /* Reads the given number of uncompressed bytes from the compressed file. If the input file is not in gzip format, gzread copies the given number of bytes into the buffer directly from the file. After reaching the end of a gzip stream in the input, gzread will continue to read, looking for another gzip stream. Any number of gzip streams may be concatenated in the input file, and will all be decompressed by gzread(). If something other than a gzip stream is encountered after a gzip stream, that remaining trailing garbage is ignored (and no error is returned). gzread can be used to read a gzip file that is being concurrently written. Upon reaching the end of the input, gzread will return with the available data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then gzclearerr can be used to clear the end of file indicator in order to permit gzread to be tried again. Z_OK indicates that a gzip stream was completed on the last gzread. Z_BUF_ERROR indicates that the input file ended in the middle of a gzip stream. Note that gzread does not return -1 in the event of an incomplete gzip stream. This error is deferred until gzclose(), which will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip stream. Alternatively, gzerror can be used before gzclose to detect this case. gzread returns the number of uncompressed bytes actually read, less than len for end of file, or -1 for error. */ ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); /* Writes the given number of uncompressed bytes into the compressed file. gzwrite returns the number of uncompressed bytes written or 0 in case of error. */ ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); /* Converts, formats, and writes the arguments to the compressed file under control of the format string, as in fprintf. gzprintf returns the number of uncompressed bytes actually written, or 0 in case of error. The number of uncompressed bytes written is limited to 8191, or one less than the buffer size given to gzbuffer(). The caller should assure that this limit is not exceeded. If it is exceeded, then gzprintf() will return an error (0) with nothing written. In this case, there may also be a buffer overflow with unpredictable consequences, which is possible only if zlib was compiled with the insecure functions sprintf() or vsprintf() because the secure snprintf() or vsnprintf() functions were not available. This can be determined using zlibCompileFlags(). */ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); /* Writes the given null-terminated string to the compressed file, excluding the terminating null character. gzputs returns the number of characters written, or -1 in case of error. */ ZEXTERN char *ZEXPORT gzgets OF((gzFile file, char *buf, int len)); /* Reads bytes from the compressed file until len-1 characters are read, or a newline character is read and transferred to buf, or an end-of-file condition is encountered. If any characters are read or if len == 1, the string is terminated with a null character. If no characters are read due to an end-of-file or len < 1, then the buffer is left untouched. gzgets returns buf which is a null-terminated string, or it returns NULL for end-of-file or in case of error. If there was an error, the contents at buf are indeterminate. */ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); /* Writes c, converted to an unsigned char, into the compressed file. gzputc returns the value that was written, or -1 in case of error. */ ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); /* Reads one byte from the compressed file. gzgetc returns this byte or -1 in case of end of file or error. This is implemented as a macro for speed. As such, it does not do all of the checking the other functions do. I.e. it does not check to see if file is NULL, nor whether the structure file points to has been clobbered or not. */ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); /* Push one character back onto the stream to be read as the first character on the next read. At least one character of push-back is allowed. gzungetc() returns the character pushed, or -1 on failure. gzungetc() will fail if c is -1, and may fail if a character has been pushed but not read yet. If gzungetc is used immediately after gzopen or gzdopen, at least the output buffer size of pushed characters is allowed. (See gzbuffer above.) The pushed character will be discarded if the stream is repositioned with gzseek() or gzrewind(). */ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); /* Flushes all pending output into the compressed file. The parameter flush is as in the deflate() function. The return value is the zlib error number (see function gzerror below). gzflush is only permitted when writing. If the flush parameter is Z_FINISH, the remaining data is written and the gzip stream is completed in the output. If gzwrite() is called again, a new gzip stream will be started in the output. gzread() is able to read such concatented gzip streams. gzflush should be called only when strictly necessary because it will degrade compression if called too often. */ /* ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, z_off_t offset, int whence)); Sets the starting position for the next gzread or gzwrite on the given compressed file. The offset represents a number of bytes in the uncompressed data stream. The whence parameter is defined as in lseek(2); the value SEEK_END is not supported. If the file is opened for reading, this function is emulated but can be extremely slow. If the file is opened for writing, only forward seeks are supported; gzseek then compresses a sequence of zeroes up to the new starting position. gzseek returns the resulting offset location as measured in bytes from the beginning of the uncompressed stream, or -1 in case of error, in particular if the file is opened for writing and the new starting position would be before the current position. */ ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); /* Rewinds the given file. This function is supported only for reading. gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) */ /* ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); Returns the starting position for the next gzread or gzwrite on the given compressed file. This position represents a number of bytes in the uncompressed data stream, and is zero when starting, even if appending or reading a gzip stream from the middle of a file using gzdopen(). gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) */ /* ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); Returns the current offset in the file being read or written. This offset includes the count of bytes that precede the gzip stream, for example when appending or when using gzdopen() for reading. When reading, the offset does not include as yet unused buffered input. This information can be used for a progress indicator. On error, gzoffset() returns -1. */ ZEXTERN int ZEXPORT gzeof OF((gzFile file)); /* Returns true (1) if the end-of-file indicator has been set while reading, false (0) otherwise. Note that the end-of-file indicator is set only if the read tried to go past the end of the input, but came up short. Therefore, just like feof(), gzeof() may return false even if there is no more data to read, in the event that the last read request was for the exact number of bytes remaining in the input file. This will happen if the input file size is an exact multiple of the buffer size. If gzeof() returns true, then the read functions will return no more data, unless the end-of-file indicator is reset by gzclearerr() and the input file has grown since the previous end of file was detected. */ ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); /* Returns true (1) if file is being copied directly while reading, or false (0) if file is a gzip stream being decompressed. If the input file is empty, gzdirect() will return true, since the input does not contain a gzip stream. If gzdirect() is used immediately after gzopen() or gzdopen() it will cause buffers to be allocated to allow reading the file to determine if it is a gzip file. Therefore if gzbuffer() is used, it should be called before gzdirect(). When writing, gzdirect() returns true (1) if transparent writing was requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: gzdirect() is not needed when writing. Transparent writing must be explicitly requested, so the application already knows the answer. When linking statically, using gzdirect() will include all of the zlib code for gzip file reading and decompression, which may not be desired.) */ ZEXTERN int ZEXPORT gzclose OF((gzFile file)); /* Flushes all pending output if necessary, closes the compressed file and deallocates the (de)compression state. Note that once file is closed, you cannot call gzerror with file, since its structures have been deallocated. gzclose must not be called more than once on the same file, just as free must not be called more than once on the same allocation. gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the last read ended in the middle of a gzip stream, or Z_OK on success. */ ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); /* Same as gzclose(), but gzclose_r() is only for use when reading, and gzclose_w() is only for use when writing or appending. The advantage to using these instead of gzclose() is that they avoid linking in zlib compression or decompression code that is not used when only reading or only writing respectively. If gzclose() is used, then both compression and decompression code will be included the application when linking to a static zlib library. */ ZEXTERN const char *ZEXPORT gzerror OF((gzFile file, int *errnum)); /* Returns the error message for the last error which occurred on the given compressed file. errnum is set to zlib error number. If an error occurred in the file system and not in the compression library, errnum is set to Z_ERRNO and the application may consult errno to get the exact error code. The application must not modify the returned string. Future calls to this function may invalidate the previously returned string. If file is closed, then the string previously returned by gzerror will no longer be available. gzerror() should be used to distinguish errors from end-of-file for those functions above that do not distinguish those cases in their return values. */ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); /* Clears the error and end-of-file flags for file. This is analogous to the clearerr() function in stdio. This is useful for continuing to read a gzip file that is being written concurrently. */ #endif /* !Z_SOLO */ /* checksum functions */ /* These functions are not related to compression but are exported anyway because they might be useful in applications using the compression library. */ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef * buf, uInt len)); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. If buf is Z_NULL, this function returns the required initial value for the checksum. An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much faster. Usage example: uLong adler = adler32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { adler = adler32(adler, buffer, length); } if (adler != original_adler) error(); */ /* ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, z_off_t len2)); Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note that the z_off_t type (like off_t) is a signed integer. If len2 is negative, the result has no meaning or utility. */ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef * buf, uInt len)); /* Update a running CRC-32 with the bytes buf[0..len-1] and return the updated CRC-32. If buf is Z_NULL, this function returns the required initial value for the crc. Pre- and post-conditioning (one's complement) is performed within this function so it shouldn't be done by the application. Usage example: uLong crc = crc32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { crc = crc32(crc, buffer, length); } if (crc != original_crc) error(); */ /* ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); Combine two CRC-32 check values into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and len2. */ /* various hacks, don't look :) */ /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, const char *version, int stream_size)); ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, unsigned char FAR * window, const char *version, int stream_size)); #define deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) #define inflateInit(strm) \ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) #define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) #define inflateInit2(strm, windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ (int)sizeof(z_stream)) #define inflateBackInit(strm, windowBits, window) \ inflateBackInit_((strm), (windowBits), (window), \ ZLIB_VERSION, (int)sizeof(z_stream)) #ifndef Z_SOLO /* gzgetc() macro and its supporting function and exposed data structure. Note * that the real internal state is much larger than the exposed structure. * This abbreviated structure exposes just enough for the gzgetc() macro. The * user should not mess with these exposed elements, since their names or * behavior could change in the future, perhaps even capriciously. They can * only be used by the gzgetc() macro. You have been warned. */ struct gzFile_s { unsigned have; unsigned char *next; z_off64_t pos; }; ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ #ifdef Z_PREFIX_SET #undef z_gzgetc #define z_gzgetc(g) \ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) #else #define gzgetc(g) \ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) #endif /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if * both are true, the application gets the *64 functions, and the regular * functions are changed to 64 bits) -- in case these are set on systems * without large file support, _LFS64_LARGEFILE must also be true */ #ifdef Z_LARGE64 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); #endif #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) #ifdef Z_PREFIX_SET #define z_gzopen z_gzopen64 #define z_gzseek z_gzseek64 #define z_gztell z_gztell64 #define z_gzoffset z_gzoffset64 #define z_adler32_combine z_adler32_combine64 #define z_crc32_combine z_crc32_combine64 #else #define gzopen gzopen64 #define gzseek gzseek64 #define gztell gztell64 #define gzoffset gzoffset64 #define adler32_combine adler32_combine64 #define crc32_combine crc32_combine64 #endif #ifndef Z_LARGE64 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); #endif #else ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); #endif #else /* Z_SOLO */ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); #endif /* !Z_SOLO */ /* hack for buggy compilers */ #if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) struct internal_state { int dummy; }; #endif /* undocumented functions */ ZEXTERN const char *ZEXPORT zError OF((int)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); ZEXTERN const z_crc_t FAR *ZEXPORT get_crc_table OF((void)); ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); #if defined(_WIN32) && !defined(Z_SOLO) ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t * path, const char *mode)); #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) #ifndef Z_SOLO ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, const char *format, va_list va)); #endif #endif #ifdef __cplusplus } #endif #endif /* ZLIB_H */ ================================================ FILE: v2/headers/linux_arm/usr/lib/gcc/arm-linux-gnueabihf/6/include/float.h ================================================ /* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* * ISO C Standard: 5.2.4.2.2 Characteristics of floating types */ #ifndef _FLOAT_H___ #define _FLOAT_H___ /* Radix of exponent representation, b. */ #undef FLT_RADIX #define FLT_RADIX __FLT_RADIX__ /* Number of base-FLT_RADIX digits in the significand, p. */ #undef FLT_MANT_DIG #undef DBL_MANT_DIG #undef LDBL_MANT_DIG #define FLT_MANT_DIG __FLT_MANT_DIG__ #define DBL_MANT_DIG __DBL_MANT_DIG__ #define LDBL_MANT_DIG __LDBL_MANT_DIG__ /* Number of decimal digits, q, such that any floating-point number with q decimal digits can be rounded into a floating-point number with p radix b digits and back again without change to the q decimal digits, p * log10(b) if b is a power of 10 floor((p - 1) * log10(b)) otherwise */ #undef FLT_DIG #undef DBL_DIG #undef LDBL_DIG #define FLT_DIG __FLT_DIG__ #define DBL_DIG __DBL_DIG__ #define LDBL_DIG __LDBL_DIG__ /* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */ #undef FLT_MIN_EXP #undef DBL_MIN_EXP #undef LDBL_MIN_EXP #define FLT_MIN_EXP __FLT_MIN_EXP__ #define DBL_MIN_EXP __DBL_MIN_EXP__ #define LDBL_MIN_EXP __LDBL_MIN_EXP__ /* Minimum negative integer such that 10 raised to that power is in the range of normalized floating-point numbers, ceil(log10(b) * (emin - 1)) */ #undef FLT_MIN_10_EXP #undef DBL_MIN_10_EXP #undef LDBL_MIN_10_EXP #define FLT_MIN_10_EXP __FLT_MIN_10_EXP__ #define DBL_MIN_10_EXP __DBL_MIN_10_EXP__ #define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ /* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */ #undef FLT_MAX_EXP #undef DBL_MAX_EXP #undef LDBL_MAX_EXP #define FLT_MAX_EXP __FLT_MAX_EXP__ #define DBL_MAX_EXP __DBL_MAX_EXP__ #define LDBL_MAX_EXP __LDBL_MAX_EXP__ /* Maximum integer such that 10 raised to that power is in the range of representable finite floating-point numbers, floor(log10((1 - b**-p) * b**emax)) */ #undef FLT_MAX_10_EXP #undef DBL_MAX_10_EXP #undef LDBL_MAX_10_EXP #define FLT_MAX_10_EXP __FLT_MAX_10_EXP__ #define DBL_MAX_10_EXP __DBL_MAX_10_EXP__ #define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ /* Maximum representable finite floating-point number, (1 - b**-p) * b**emax */ #undef FLT_MAX #undef DBL_MAX #undef LDBL_MAX #define FLT_MAX __FLT_MAX__ #define DBL_MAX __DBL_MAX__ #define LDBL_MAX __LDBL_MAX__ /* The difference between 1 and the least value greater than 1 that is representable in the given floating point type, b**1-p. */ #undef FLT_EPSILON #undef DBL_EPSILON #undef LDBL_EPSILON #define FLT_EPSILON __FLT_EPSILON__ #define DBL_EPSILON __DBL_EPSILON__ #define LDBL_EPSILON __LDBL_EPSILON__ /* Minimum normalized positive floating-point number, b**(emin - 1). */ #undef FLT_MIN #undef DBL_MIN #undef LDBL_MIN #define FLT_MIN __FLT_MIN__ #define DBL_MIN __DBL_MIN__ #define LDBL_MIN __LDBL_MIN__ /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */ /* ??? This is supposed to change with calls to fesetround in . */ #undef FLT_ROUNDS #define FLT_ROUNDS 1 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ || (defined (__cplusplus) && __cplusplus >= 201103L) /* The floating-point expression evaluation method. -1 indeterminate 0 evaluate all operations and constants just to the range and precision of the type 1 evaluate operations and constants of type float and double to the range and precision of the double type, evaluate long double operations and constants to the range and precision of the long double type 2 evaluate all operations and constants to the range and precision of the long double type ??? This ought to change with the setting of the fp control word; the value provided by the compiler assumes the widest setting. */ #undef FLT_EVAL_METHOD #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ /* Number of decimal digits, n, such that any floating-point number in the widest supported floating type with pmax radix b digits can be rounded to a floating-point number with n decimal digits and back again without change to the value, pmax * log10(b) if b is a power of 10 ceil(1 + pmax * log10(b)) otherwise */ #undef DECIMAL_DIG #define DECIMAL_DIG __DECIMAL_DIG__ #endif /* C99 */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L /* Versions of DECIMAL_DIG for each floating-point type. */ #undef FLT_DECIMAL_DIG #undef DBL_DECIMAL_DIG #undef LDBL_DECIMAL_DIG #define FLT_DECIMAL_DIG __FLT_DECIMAL_DIG__ #define DBL_DECIMAL_DIG __DBL_DECIMAL_DIG__ #define LDBL_DECIMAL_DIG __DECIMAL_DIG__ /* Whether types support subnormal numbers. */ #undef FLT_HAS_SUBNORM #undef DBL_HAS_SUBNORM #undef LDBL_HAS_SUBNORM #define FLT_HAS_SUBNORM __FLT_HAS_DENORM__ #define DBL_HAS_SUBNORM __DBL_HAS_DENORM__ #define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__ /* Minimum positive values, including subnormals. */ #undef FLT_TRUE_MIN #undef DBL_TRUE_MIN #undef LDBL_TRUE_MIN #define FLT_TRUE_MIN __FLT_DENORM_MIN__ #define DBL_TRUE_MIN __DBL_DENORM_MIN__ #define LDBL_TRUE_MIN __LDBL_DENORM_MIN__ #endif /* C11 */ #ifdef __STDC_WANT_DEC_FP__ /* Draft Technical Report 24732, extension for decimal floating-point arithmetic: Characteristic of decimal floating types . */ /* Number of base-FLT_RADIX digits in the significand, p. */ #undef DEC32_MANT_DIG #undef DEC64_MANT_DIG #undef DEC128_MANT_DIG #define DEC32_MANT_DIG __DEC32_MANT_DIG__ #define DEC64_MANT_DIG __DEC64_MANT_DIG__ #define DEC128_MANT_DIG __DEC128_MANT_DIG__ /* Minimum exponent. */ #undef DEC32_MIN_EXP #undef DEC64_MIN_EXP #undef DEC128_MIN_EXP #define DEC32_MIN_EXP __DEC32_MIN_EXP__ #define DEC64_MIN_EXP __DEC64_MIN_EXP__ #define DEC128_MIN_EXP __DEC128_MIN_EXP__ /* Maximum exponent. */ #undef DEC32_MAX_EXP #undef DEC64_MAX_EXP #undef DEC128_MAX_EXP #define DEC32_MAX_EXP __DEC32_MAX_EXP__ #define DEC64_MAX_EXP __DEC64_MAX_EXP__ #define DEC128_MAX_EXP __DEC128_MAX_EXP__ /* Maximum representable finite decimal floating-point number (there are 6, 15, and 33 9s after the decimal points respectively). */ #undef DEC32_MAX #undef DEC64_MAX #undef DEC128_MAX #define DEC32_MAX __DEC32_MAX__ #define DEC64_MAX __DEC64_MAX__ #define DEC128_MAX __DEC128_MAX__ /* The difference between 1 and the least value greater than 1 that is representable in the given floating point type. */ #undef DEC32_EPSILON #undef DEC64_EPSILON #undef DEC128_EPSILON #define DEC32_EPSILON __DEC32_EPSILON__ #define DEC64_EPSILON __DEC64_EPSILON__ #define DEC128_EPSILON __DEC128_EPSILON__ /* Minimum normalized positive floating-point number. */ #undef DEC32_MIN #undef DEC64_MIN #undef DEC128_MIN #define DEC32_MIN __DEC32_MIN__ #define DEC64_MIN __DEC64_MIN__ #define DEC128_MIN __DEC128_MIN__ /* Minimum subnormal positive floating-point number. */ #undef DEC32_SUBNORMAL_MIN #undef DEC64_SUBNORMAL_MIN #undef DEC128_SUBNORMAL_MIN #define DEC32_SUBNORMAL_MIN __DEC32_SUBNORMAL_MIN__ #define DEC64_SUBNORMAL_MIN __DEC64_SUBNORMAL_MIN__ #define DEC128_SUBNORMAL_MIN __DEC128_SUBNORMAL_MIN__ /* The floating-point expression evaluation method. -1 indeterminate 0 evaluate all operations and constants just to the range and precision of the type 1 evaluate operations and constants of type _Decimal32 and _Decimal64 to the range and precision of the _Decimal64 type, evaluate _Decimal128 operations and constants to the range and precision of the _Decimal128 type; 2 evaluate all operations and constants to the range and precision of the _Decimal128 type. */ #undef DEC_EVAL_METHOD #define DEC_EVAL_METHOD __DEC_EVAL_METHOD__ #endif /* __STDC_WANT_DEC_FP__ */ #endif /* _FLOAT_H___ */ ================================================ FILE: v2/headers/linux_arm/usr/lib/gcc/arm-linux-gnueabihf/6/include/stdarg.h ================================================ /* Copyright (C) 1989-2016 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* * ISO C Standard: 7.15 Variable arguments */ #ifndef _STDARG_H #ifndef _ANSI_STDARG_H_ #ifndef __need___va_list #define _STDARG_H #define _ANSI_STDARG_H_ #endif /* not __need___va_list */ #undef __need___va_list /* Define __gnuc_va_list. */ #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST typedef __builtin_va_list __gnuc_va_list; #endif /* Define the standard macros for the user, if this invocation was from the user program. */ #ifdef _STDARG_H #define va_start(v,l) __builtin_va_start(v,l) #define va_end(v) __builtin_va_end(v) #define va_arg(v,l) __builtin_va_arg(v,l) #if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L \ || __cplusplus + 0 >= 201103L #define va_copy(d,s) __builtin_va_copy(d,s) #endif #define __va_copy(d,s) __builtin_va_copy(d,s) /* Define va_list, if desired, from __gnuc_va_list. */ /* We deliberately do not define va_list when called from stdio.h, because ANSI C says that stdio.h is not supposed to define va_list. stdio.h needs to have access to that data type, but must not use that name. It should use the name __gnuc_va_list, which is safe because it is reserved for the implementation. */ #ifdef _BSD_VA_LIST #undef _BSD_VA_LIST #endif #if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST)) /* SVR4.2 uses _VA_LIST for an internal alias for va_list, so we must avoid testing it and setting it here. SVR4 uses _VA_LIST as a flag in stdarg.h, but we should have no conflict with that. */ #ifndef _VA_LIST_ #define _VA_LIST_ #ifdef __i860__ #ifndef _VA_LIST #define _VA_LIST va_list #endif #endif /* __i860__ */ typedef __gnuc_va_list va_list; #ifdef _SCO_DS #define __VA_LIST #endif #endif /* _VA_LIST_ */ #else /* not __svr4__ || _SCO_DS */ /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. But on BSD NET2 we must not test or define or undef it. (Note that the comments in NET 2's ansi.h are incorrect for _VA_LIST_--see stdio.h!) */ #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT) /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */ #ifndef _VA_LIST_DEFINED /* The macro _VA_LIST is used in SCO Unix 3.2. */ #ifndef _VA_LIST /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ #ifndef _VA_LIST_T_H /* The macro __va_list__ is used by BeOS. */ #ifndef __va_list__ typedef __gnuc_va_list va_list; #endif /* not __va_list__ */ #endif /* not _VA_LIST_T_H */ #endif /* not _VA_LIST */ #endif /* not _VA_LIST_DEFINED */ #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) #define _VA_LIST_ #endif #ifndef _VA_LIST #define _VA_LIST #endif #ifndef _VA_LIST_DEFINED #define _VA_LIST_DEFINED #endif #ifndef _VA_LIST_T_H #define _VA_LIST_T_H #endif #ifndef __va_list__ #define __va_list__ #endif #endif /* not _VA_LIST_, except on certain systems */ #endif /* not __svr4__ */ #endif /* _STDARG_H */ #endif /* not _ANSI_STDARG_H_ */ #endif /* not _STDARG_H */ ================================================ FILE: v2/headers/linux_arm/usr/lib/gcc/arm-linux-gnueabihf/6/include/stdbool.h ================================================ /* Copyright (C) 1998-2016 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* * ISO C Standard: 7.16 Boolean type and values */ #ifndef _STDBOOL_H #define _STDBOOL_H #ifndef __cplusplus #define bool _Bool #define true 1 #define false 0 #else /* __cplusplus */ /* Supporting _Bool in C++ is a GCC extension. */ #define _Bool bool #if __cplusplus < 201103L /* Defining these macros in C++98 is a GCC extension. */ #define bool bool #define false false #define true true #endif #endif /* __cplusplus */ /* Signal that all the definitions are present. */ #define __bool_true_false_are_defined 1 #endif /* stdbool.h */ ================================================ FILE: v2/headers/linux_arm/usr/lib/gcc/arm-linux-gnueabihf/6/include/stddef.h ================================================ /* Copyright (C) 1989-2016 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* * ISO C Standard: 7.17 Common definitions */ #if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \ && !defined(__STDDEF_H__)) \ || defined(__need_wchar_t) || defined(__need_size_t) \ || defined(__need_ptrdiff_t) || defined(__need_NULL) \ || defined(__need_wint_t) /* Any one of these symbols __need_* means that GNU libc wants us just to define one data type. So don't define the symbols that indicate this file's entire job has been done. */ #if (!defined(__need_wchar_t) && !defined(__need_size_t) \ && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \ && !defined(__need_wint_t)) #define _STDDEF_H #define _STDDEF_H_ /* snaroff@next.com says the NeXT needs this. */ #define _ANSI_STDDEF_H #endif #ifndef __sys_stdtypes_h /* This avoids lossage on SunOS but only if stdtypes.h comes first. There's no way to win with the other order! Sun lossage. */ /* On 4.3bsd-net2, make sure ansi.h is included, so we have one less case to deal with in the following. */ #if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__) #include #endif /* On FreeBSD 5, machine/ansi.h does not exist anymore... */ #if defined (__FreeBSD__) && (__FreeBSD__ >= 5) #include #endif /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are defined if the corresponding type is *not* defined. FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_. NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_ */ #if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) #if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_) #define _SIZE_T #endif #if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_) #define _PTRDIFF_T #endif /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ instead of _WCHAR_T_. */ #if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_) #ifndef _BSD_WCHAR_T_ #define _WCHAR_T #endif #endif /* Undef _FOO_T_ if we are supposed to define foo_t. */ #if defined (__need_ptrdiff_t) || defined (_STDDEF_H_) #undef _PTRDIFF_T_ #undef _BSD_PTRDIFF_T_ #endif #if defined (__need_size_t) || defined (_STDDEF_H_) #undef _SIZE_T_ #undef _BSD_SIZE_T_ #endif #if defined (__need_wchar_t) || defined (_STDDEF_H_) #undef _WCHAR_T_ #undef _BSD_WCHAR_T_ #endif #endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) */ /* Sequent's header files use _PTRDIFF_T_ in some conflicting way. Just ignore it. */ #if defined (__sequent__) && defined (_PTRDIFF_T_) #undef _PTRDIFF_T_ #endif /* On VxWorks, may have defined macros like _TYPE_size_t which will typedef size_t. fixincludes patched the vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is not defined, and so that defining this macro defines _GCC_SIZE_T. If we find that the macros are still defined at this point, we must invoke them so that the type is defined as expected. */ #if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_)) _TYPE_ptrdiff_t; #undef _TYPE_ptrdiff_t #endif #if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_)) _TYPE_size_t; #undef _TYPE_size_t #endif #if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_)) _TYPE_wchar_t; #undef _TYPE_wchar_t #endif /* In case nobody has defined these types, but we aren't running under GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and __WCHAR_TYPE__ have reasonable values. This can happen if the parts of GCC is compiled by an older compiler, that actually include gstddef.h, such as collect2. */ /* Signed type of difference of two pointers. */ /* Define this type if we are doing the whole job, or if we want this type in particular. */ #if defined (_STDDEF_H) || defined (__need_ptrdiff_t) #ifndef _PTRDIFF_T /* in case has defined it. */ #ifndef _T_PTRDIFF_ #ifndef _T_PTRDIFF #ifndef __PTRDIFF_T #ifndef _PTRDIFF_T_ #ifndef _BSD_PTRDIFF_T_ #ifndef ___int_ptrdiff_t_h #ifndef _GCC_PTRDIFF_T #ifndef _PTRDIFF_T_DECLARED /* DragonFly */ #define _PTRDIFF_T #define _T_PTRDIFF_ #define _T_PTRDIFF #define __PTRDIFF_T #define _PTRDIFF_T_ #define _BSD_PTRDIFF_T_ #define ___int_ptrdiff_t_h #define _GCC_PTRDIFF_T #define _PTRDIFF_T_DECLARED #ifndef __PTRDIFF_TYPE__ #define __PTRDIFF_TYPE__ long int #endif typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif /* _PTRDIFF_T_DECLARED */ #endif /* _GCC_PTRDIFF_T */ #endif /* ___int_ptrdiff_t_h */ #endif /* _BSD_PTRDIFF_T_ */ #endif /* _PTRDIFF_T_ */ #endif /* __PTRDIFF_T */ #endif /* _T_PTRDIFF */ #endif /* _T_PTRDIFF_ */ #endif /* _PTRDIFF_T */ /* If this symbol has done its job, get rid of it. */ #undef __need_ptrdiff_t #endif /* _STDDEF_H or __need_ptrdiff_t. */ /* Unsigned type of `sizeof' something. */ /* Define this type if we are doing the whole job, or if we want this type in particular. */ #if defined (_STDDEF_H) || defined (__need_size_t) #ifndef __size_t__ /* BeOS */ #ifndef __SIZE_T__ /* Cray Unicos/Mk */ #ifndef _SIZE_T /* in case has defined it. */ #ifndef _SYS_SIZE_T_H #ifndef _T_SIZE_ #ifndef _T_SIZE #ifndef __SIZE_T #ifndef _SIZE_T_ #ifndef _BSD_SIZE_T_ #ifndef _SIZE_T_DEFINED_ #ifndef _SIZE_T_DEFINED #ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */ #ifndef _SIZE_T_DECLARED /* FreeBSD 5 */ #ifndef ___int_size_t_h #ifndef _GCC_SIZE_T #ifndef _SIZET_ #ifndef __size_t #define __size_t__ /* BeOS */ #define __SIZE_T__ /* Cray Unicos/Mk */ #define _SIZE_T #define _SYS_SIZE_T_H #define _T_SIZE_ #define _T_SIZE #define __SIZE_T #define _SIZE_T_ #define _BSD_SIZE_T_ #define _SIZE_T_DEFINED_ #define _SIZE_T_DEFINED #define _BSD_SIZE_T_DEFINED_ /* Darwin */ #define _SIZE_T_DECLARED /* FreeBSD 5 */ #define ___int_size_t_h #define _GCC_SIZE_T #define _SIZET_ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ || defined(__DragonFly__) \ || defined(__FreeBSD_kernel__) /* __size_t is a typedef on FreeBSD 5, must not trash it. */ #elif defined (__VMS__) /* __size_t is also a typedef on VMS. */ #else #define __size_t #endif #ifndef __SIZE_TYPE__ #define __SIZE_TYPE__ long unsigned int #endif #if !(defined (__GNUG__) && defined (size_t)) typedef __SIZE_TYPE__ size_t; #ifdef __BEOS__ typedef long ssize_t; #endif /* __BEOS__ */ #endif /* !(defined (__GNUG__) && defined (size_t)) */ #endif /* __size_t */ #endif /* _SIZET_ */ #endif /* _GCC_SIZE_T */ #endif /* ___int_size_t_h */ #endif /* _SIZE_T_DECLARED */ #endif /* _BSD_SIZE_T_DEFINED_ */ #endif /* _SIZE_T_DEFINED */ #endif /* _SIZE_T_DEFINED_ */ #endif /* _BSD_SIZE_T_ */ #endif /* _SIZE_T_ */ #endif /* __SIZE_T */ #endif /* _T_SIZE */ #endif /* _T_SIZE_ */ #endif /* _SYS_SIZE_T_H */ #endif /* _SIZE_T */ #endif /* __SIZE_T__ */ #endif /* __size_t__ */ #undef __need_size_t #endif /* _STDDEF_H or __need_size_t. */ /* Wide character type. Locale-writers should change this as necessary to be big enough to hold unique values not between 0 and 127, and not (wchar_t) -1, for each defined multibyte character. */ /* Define this type if we are doing the whole job, or if we want this type in particular. */ #if defined (_STDDEF_H) || defined (__need_wchar_t) #ifndef __wchar_t__ /* BeOS */ #ifndef __WCHAR_T__ /* Cray Unicos/Mk */ #ifndef _WCHAR_T #ifndef _T_WCHAR_ #ifndef _T_WCHAR #ifndef __WCHAR_T #ifndef _WCHAR_T_ #ifndef _BSD_WCHAR_T_ #ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */ #ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */ #ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */ #ifndef _WCHAR_T_DEFINED_ #ifndef _WCHAR_T_DEFINED #ifndef _WCHAR_T_H #ifndef ___int_wchar_t_h #ifndef __INT_WCHAR_T_H #ifndef _GCC_WCHAR_T #define __wchar_t__ /* BeOS */ #define __WCHAR_T__ /* Cray Unicos/Mk */ #define _WCHAR_T #define _T_WCHAR_ #define _T_WCHAR #define __WCHAR_T #define _WCHAR_T_ #define _BSD_WCHAR_T_ #define _WCHAR_T_DEFINED_ #define _WCHAR_T_DEFINED #define _WCHAR_T_H #define ___int_wchar_t_h #define __INT_WCHAR_T_H #define _GCC_WCHAR_T #define _WCHAR_T_DECLARED /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other symbols in the _FOO_T_ family, stays defined even after its corresponding type is defined). If we define wchar_t, then we must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if we undef _WCHAR_T_, then we must also define rune_t, since headers like runetype.h assume that if machine/ansi.h is included, and _BSD_WCHAR_T_ is not defined, then rune_t is available. machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of the same type." */ #ifdef _BSD_WCHAR_T_ #undef _BSD_WCHAR_T_ #ifdef _BSD_RUNE_T_ #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) typedef _BSD_RUNE_T_ rune_t; #define _BSD_WCHAR_T_DEFINED_ #define _BSD_RUNE_T_DEFINED_ /* Darwin */ #if defined (__FreeBSD__) && (__FreeBSD__ < 5) /* Why is this file so hard to maintain properly? In contrast to the comment above regarding BSD/386 1.1, on FreeBSD for as long as the symbol has existed, _BSD_RUNE_T_ must not stay defined or redundant typedefs will occur when stdlib.h is included after this file. */ #undef _BSD_RUNE_T_ #endif #endif #endif #endif /* FreeBSD 5 can't be handled well using "traditional" logic above since it no longer defines _BSD_RUNE_T_ yet still desires to export rune_t in some cases... */ #if defined (__FreeBSD__) && (__FreeBSD__ >= 5) #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) #if __BSD_VISIBLE #ifndef _RUNE_T_DECLARED typedef __rune_t rune_t; #define _RUNE_T_DECLARED #endif #endif #endif #endif #ifndef __WCHAR_TYPE__ #define __WCHAR_TYPE__ int #endif #ifndef __cplusplus typedef __WCHAR_TYPE__ wchar_t; #endif #endif #endif #endif #endif #endif #endif #endif /* _WCHAR_T_DECLARED */ #endif /* _BSD_RUNE_T_DEFINED_ */ #endif #endif #endif #endif #endif #endif #endif #endif /* __WCHAR_T__ */ #endif /* __wchar_t__ */ #undef __need_wchar_t #endif /* _STDDEF_H or __need_wchar_t. */ #if defined (__need_wint_t) #ifndef _WINT_T #define _WINT_T #ifndef __WINT_TYPE__ #define __WINT_TYPE__ unsigned int #endif typedef __WINT_TYPE__ wint_t; #endif #undef __need_wint_t #endif /* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. are already defined. */ /* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */ /* NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here. */ #if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) /* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_ are probably typos and should be removed before 2.8 is released. */ #ifdef _GCC_PTRDIFF_T_ #undef _PTRDIFF_T_ #undef _BSD_PTRDIFF_T_ #endif #ifdef _GCC_SIZE_T_ #undef _SIZE_T_ #undef _BSD_SIZE_T_ #endif #ifdef _GCC_WCHAR_T_ #undef _WCHAR_T_ #undef _BSD_WCHAR_T_ #endif /* The following ones are the real ones. */ #ifdef _GCC_PTRDIFF_T #undef _PTRDIFF_T_ #undef _BSD_PTRDIFF_T_ #endif #ifdef _GCC_SIZE_T #undef _SIZE_T_ #undef _BSD_SIZE_T_ #endif #ifdef _GCC_WCHAR_T #undef _WCHAR_T_ #undef _BSD_WCHAR_T_ #endif #endif /* _ANSI_H_ || _MACHINE_ANSI_H_ || _X86_64_ANSI_H_ || _I386_ANSI_H_ */ #endif /* __sys_stdtypes_h */ /* A null pointer constant. */ #if defined (_STDDEF_H) || defined (__need_NULL) #undef NULL /* in case has defined it. */ #ifdef __GNUG__ #define NULL __null #else /* G++ */ #ifndef __cplusplus #define NULL ((void *)0) #else /* C++ */ #define NULL 0 #endif /* C++ */ #endif /* G++ */ #endif /* NULL not defined and or need NULL. */ #undef __need_NULL #ifdef _STDDEF_H /* Offset of member MEMBER in a struct of type TYPE. */ #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \ || (defined(__cplusplus) && __cplusplus >= 201103L) #ifndef _GCC_MAX_ALIGN_T #define _GCC_MAX_ALIGN_T /* Type whose alignment is supported in every context and is at least as great as that of any standard type not using alignment specifiers. */ typedef struct { long long __max_align_ll __attribute__ ((__aligned__(__alignof__(long long)))); long double __max_align_ld __attribute__ ((__aligned__(__alignof__(long double)))); } max_align_t; #endif #endif /* C11 or C++11. */ #if defined(__cplusplus) && __cplusplus >= 201103L #ifndef _GXX_NULLPTR_T #define _GXX_NULLPTR_T typedef decltype(nullptr) nullptr_t; #endif #endif /* C++11. */ #endif /* _STDDEF_H was defined this time */ #endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__ || __need_XXX was not defined before */ ================================================ FILE: v2/headers/linux_arm/usr/lib/gcc/arm-linux-gnueabihf/6/include/stdint.h ================================================ #ifndef _GCC_WRAP_STDINT_H #if __STDC_HOSTED__ #if defined __cplusplus && __cplusplus >= 201103L #undef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS #undef __STDC_CONSTANT_MACROS #define __STDC_CONSTANT_MACROS #endif #include_next #else #include "stdint-gcc.h" #endif #define _GCC_WRAP_STDINT_H #endif ================================================ FILE: v2/headers/linux_arm/usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed/limits.h ================================================ /* Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* This administrivia gets added to the beginning of limits.h if the system has its own version of limits.h. */ /* We use _GCC_LIMITS_H_ because we want this not to match any macros that the system's limits.h uses for its own purposes. */ #ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */ #define _GCC_LIMITS_H_ #ifndef _LIBC_LIMITS_H_ /* Use "..." so that we find syslimits.h only in this same directory. */ #include "syslimits.h" #endif /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _LIMITS_H___ #define _LIMITS_H___ /* Number of bits in a `char'. */ #undef CHAR_BIT #define CHAR_BIT __CHAR_BIT__ /* Maximum length of a multibyte character. */ #ifndef MB_LEN_MAX #define MB_LEN_MAX 1 #endif /* Minimum and maximum values a `signed char' can hold. */ #undef SCHAR_MIN #define SCHAR_MIN (-SCHAR_MAX - 1) #undef SCHAR_MAX #define SCHAR_MAX __SCHAR_MAX__ /* Maximum value an `unsigned char' can hold. (Minimum is 0). */ #undef UCHAR_MAX #if __SCHAR_MAX__ == __INT_MAX__ #define UCHAR_MAX (SCHAR_MAX * 2U + 1U) #else #define UCHAR_MAX (SCHAR_MAX * 2 + 1) #endif /* Minimum and maximum values a `char' can hold. */ #ifdef __CHAR_UNSIGNED__ #undef CHAR_MIN #if __SCHAR_MAX__ == __INT_MAX__ #define CHAR_MIN 0U #else #define CHAR_MIN 0 #endif #undef CHAR_MAX #define CHAR_MAX UCHAR_MAX #else #undef CHAR_MIN #define CHAR_MIN SCHAR_MIN #undef CHAR_MAX #define CHAR_MAX SCHAR_MAX #endif /* Minimum and maximum values a `signed short int' can hold. */ #undef SHRT_MIN #define SHRT_MIN (-SHRT_MAX - 1) #undef SHRT_MAX #define SHRT_MAX __SHRT_MAX__ /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */ #undef USHRT_MAX #if __SHRT_MAX__ == __INT_MAX__ #define USHRT_MAX (SHRT_MAX * 2U + 1U) #else #define USHRT_MAX (SHRT_MAX * 2 + 1) #endif /* Minimum and maximum values a `signed int' can hold. */ #undef INT_MIN #define INT_MIN (-INT_MAX - 1) #undef INT_MAX #define INT_MAX __INT_MAX__ /* Maximum value an `unsigned int' can hold. (Minimum is 0). */ #undef UINT_MAX #define UINT_MAX (INT_MAX * 2U + 1U) /* Minimum and maximum values a `signed long int' can hold. (Same as `int'). */ #undef LONG_MIN #define LONG_MIN (-LONG_MAX - 1L) #undef LONG_MAX #define LONG_MAX __LONG_MAX__ /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */ #undef ULONG_MAX #define ULONG_MAX (LONG_MAX * 2UL + 1UL) #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* Minimum and maximum values a `signed long long int' can hold. */ #undef LLONG_MIN #define LLONG_MIN (-LLONG_MAX - 1LL) #undef LLONG_MAX #define LLONG_MAX __LONG_LONG_MAX__ /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ #undef ULLONG_MAX #define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) #endif #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__) /* Minimum and maximum values a `signed long long int' can hold. */ #undef LONG_LONG_MIN #define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL) #undef LONG_LONG_MAX #define LONG_LONG_MAX __LONG_LONG_MAX__ /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ #undef ULONG_LONG_MAX #define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL) #endif #endif /* _LIMITS_H___ */ /* This administrivia gets added to the end of limits.h if the system has its own version of limits.h. */ #else /* not _GCC_LIMITS_H_ */ #ifdef _GCC_NEXT_LIMITS_H #include_next /* recurse down to the real one */ #endif #endif /* not _GCC_LIMITS_H_ */ ================================================ FILE: v2/headers/linux_arm/usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed/syslimits.h ================================================ /* syslimits.h stands for the system's own limits.h file. If we can use it ok unmodified, then we install this text. If fixincludes fixes it, then the fixed version is installed instead of this text. */ #define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */ #include_next #undef _GCC_NEXT_LIMITS_H ================================================ FILE: v2/lexer.go ================================================ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc // [0]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf import ( "bufio" "fmt" "go/token" "io" "github.com/cznic/golex/lex" "github.com/cznic/mathutil" "github.com/cznic/xc" ) var ( noTypedefNameAfter = map[int]struct{}{ '*': {}, '.': {}, ARROW: {}, BOOL: {}, CHAR: {}, COMPLEX: {}, DOUBLE: {}, ENUM: {}, FLOAT: {}, GOTO: {}, IDENTIFIER: {}, INT: {}, LONG: {}, SHORT: {}, SIGNED: {}, STRUCT: {}, TYPEDEF_NAME: {}, UNION: {}, UNSIGNED: {}, VOID: {}, } ) const ( intBits = mathutil.IntBits bitShift = intBits>>6 + 5 bitMask = intBits - 1 scINITIAL = 0 // Start condition (shared value). ) const ( // Character class is an 8 bit encoding of an Unicode rune for the // golex generated FSM. // // Every ASCII rune is its own class. DO NOT change any of the // existing values. Adding new classes is OK. ccEOF = iota + 0x80 _ // ccError ccOther // Any other rune. ccUCNDigit // [0], Annex D, Universal character names for identifiers - digits. ccUCNNonDigit // [0], Annex D, Universal character names for identifiers - non digits. ) type trigraphs struct { *lex.Lexer pos token.Pos r *bufio.Reader sc int } func newTrigraphs(ctx *context, file *token.File, r io.Reader) (*trigraphs, error) { sc := scINITIAL if ctx.tweaks.EnableTrigraphs { sc = scTRIGRAPHS } t := &trigraphs{ pos: file.Pos(0), r: bufio.NewReader(r), sc: sc, } lx, err := lex.New( file, t, lex.ErrorFunc(func(pos token.Pos, msg string) { ctx.errPos(pos, msg) }), lex.RuneClass(func(r rune) int { return int(r) }), ) if err != nil { return nil, err } t.Lexer = lx return t, nil } func (t *trigraphs) ReadRune() (rune, int, error) { panic("internal error 9") } func (t *trigraphs) ReadChar() (c lex.Char, size int, err error) { size = 1 b, err := t.r.ReadByte() if err != nil { return lex.NewChar(t.pos, rune(b)), 0, err } c = lex.NewChar(t.pos, rune(b)) t.pos++ return c, 1, nil } type ungetBuffer []cppToken func (u *ungetBuffer) unget(t cppToken) { *u = append(*u, t) } func (u *ungetBuffer) read() (t cppToken) { s := *u n := len(s) - 1 t = s[n] *u = s[:n] return t } func (u *ungetBuffer) ungets(toks ...cppToken) { s := *u for i := len(toks) - 1; i >= 0; i-- { s = append(s, toks[i]) } *u = s } type lexer struct { *context *lex.Lexer ast Node attr [][]xc.Token attr2 [][]xc.Token commentPos0 token.Pos currFn int // [0]6.4.2.2 last lex.Char mode int // CONSTANT_EXPRESSION, TRANSLATION_UNIT prev int // Most recent result returned by Lex sc int t *trigraphs tc *tokenPipe noTypedefName bool // Do not consider next token a TYPEDEF_NAME typedef bool // Prev token returned was TYPEDEF_NAME ungetBuffer } func newLexer(ctx *context, nm string, sz int, r io.Reader) (*lexer, error) { file := fset.AddFile(nm, -1, sz) t, err := newTrigraphs(ctx, file, r) if err != nil { return nil, err } l := &lexer{ context: ctx, t: t, } lx, err := lex.New( file, l, lex.ErrorFunc(func(pos token.Pos, msg string) { l.errPos(pos, msg) }), lex.RuneClass(rune2class), ) if err != nil { return nil, err } l.Lexer = lx return l, nil } func (l *lexer) Error(msg string) { l.err(l.First, "%v", msg) } func (l *lexer) ReadRune() (rune, int, error) { panic("internal error 10") } func (l *lexer) comment(general bool) { /*TODO*/ } func (l *lexer) parseExpr() bool { return l.parse(CONSTANT_EXPRESSION) } func (l *lexer) Lex(lval *yySymType) (r int) { more: //TODO use follow set to recover from errors. l.lex(lval) lval.Token.Rune = l.toC(lval.Token.Rune, lval.Token.Val) typedef := l.typedef l.typedef = false noTypedefName := l.noTypedefName l.noTypedefName = false switch lval.Token.Rune { case NON_REPL: lval.Token.Rune = IDENTIFIER fallthrough case IDENTIFIER: if lval.Token.Val == idAttribute { if len(l.attr) != 0 { panic(fmt.Errorf("%v:", l.position(lval.Token))) } l.attr = nil l.parseAttr(lval) goto more } if noTypedefName || typedef || !followSetHasTypedefName[lval.yys] { break } if _, ok := noTypedefNameAfter[l.prev]; ok { break } if l.scope.isTypedef(lval.Token.Val) { // https://en.wikipedia.org/wiki/The_lexer_hack lval.Token.Rune = TYPEDEF_NAME l.typedef = true } case PPNUMBER: lval.Token.Rune = INTCONST val := dict.S(lval.Token.Val) if !(len(val) > 1 && val[0] == '0' && (val[1] == 'x' || val[1] == 'X')) { for _, v := range val { switch v { case '.', '+', '-', 'e', 'E', 'p', 'P': lval.Token.Rune = FLOATCONST } } } case ccEOF: lval.Token.Rune = lex.RuneEOF lval.Token.Val = 0 } if l.prev == FOR { l.newScope() } l.prev = int(lval.Token.Rune) return l.prev } func (l *lexer) attrs() (r [][]xc.Token) { l.attr, r = nil, l.attr return r } func (l *lexer) parseAttr(lval *yySymType) { l.lex(lval) if lval.Token.Rune != '(' { panic("TODO") } l.lex(lval) if lval.Token.Rune != '(' { panic("TODO") } l.parseAttrList(lval) l.lex(lval) if lval.Token.Rune != ')' { panic("TODO") } l.lex(lval) if lval.Token.Rune != ')' { panic("TODO") } } func (l *lexer) parseAttrList(lval *yySymType) { for { l.lex(lval) switch t := lval.Token; t.Rune { case IDENTIFIER: l.attr = append(l.attr, []xc.Token{t}) case ')': l.unget(cppToken{Token: t}) return case '(': l.parseAttrParams(lval) case ',': // ok default: panic(fmt.Errorf("%v: %v", l.position(lval.Token), PrettyString(lval.Token))) } } } func (l *lexer) parseAttrParams(lval *yySymType) { for { l.lex(lval) switch t := lval.Token; t.Rune { case STRINGLITERAL: n := len(l.attr) l.attr[n-1] = append(l.attr[n-1], t) case ')': return default: panic(fmt.Errorf("%v: %v", l.position(lval.Token), PrettyString(lval.Token))) } } } func (l *lexer) ReadChar() (c lex.Char, size int, err error) { if c = l.t.Lookahead(); c.Rune == lex.RuneEOF { return c, 0, io.EOF } ch := l.t.scan() return lex.NewChar(l.t.First.Pos(), rune(ch)), 1, nil } func (l *lexer) Reduced(rule, state int, lval *yySymType) (stop bool) { if rule != l.exampleRule { return false } switch x := lval.node.(type) { case interface { fragment() interface{} }: l.exampleAST = x.fragment() default: l.exampleAST = x } return true } func (l *lexer) cppScan() lex.Char { again: r := l.scan() if r == ' ' && l.last.Rune == ' ' { goto again } l.last = lex.NewChar(l.First.Pos(), rune(r)) return l.last } func (l *lexer) lex(lval *yySymType) { if len(l.ungetBuffer) != 0 { lval.Token = l.ungetBuffer.read().Token return } if l.tc != nil { lval.Token = l.tc.read().Token l.First = lval.Token.Char return } ch := l.scanChar() lval.Token = xc.Token{Char: ch} if _, ok := tokHasVal[ch.Rune]; ok { lval.Token = xc.Token{Char: ch, Val: dict.ID(l.TokenBytes(nil))} } } // static const char __func__[] = "function-name"; // [0], 6.4.2.2. func (l *lexer) declareFuncName() { pos := l.First.Pos() // '{' l.ungets( cppToken{Token: xc.Token{Char: lex.NewChar(pos, STATIC), Val: idStatic}}, cppToken{Token: xc.Token{Char: lex.NewChar(pos, CONST), Val: idConst}}, cppToken{Token: xc.Token{Char: lex.NewChar(pos, CHAR), Val: idChar}}, cppToken{Token: xc.Token{Char: lex.NewChar(pos, IDENTIFIER), Val: idFuncName}}, cppToken{Token: xc.Token{Char: lex.NewChar(pos, '[')}}, cppToken{Token: xc.Token{Char: lex.NewChar(pos, ']')}}, cppToken{Token: xc.Token{Char: lex.NewChar(pos, '=')}}, cppToken{Token: xc.Token{Char: lex.NewChar(pos, STRINGLITERAL), Val: dict.SID(`"` + string(dict.S(l.currFn)) + `"`)}}, cppToken{Token: xc.Token{Char: lex.NewChar(pos, ';')}}, ) } func (l *lexer) parse(mode int) bool { var tok xc.Token tok.Rune = rune(mode) l.ungetBuffer = append(l.ungetBuffer, cppToken{Token: tok}) l.mode = mode l.last.Rune = '\n' return yyParse(l) == 0 } func (l *lexer) scanChar() (c lex.Char) { again: r := l.scan() if r == ' ' { goto again } l.last = lex.NewChar(l.First.Pos(), rune(r)) switch r { case CONSTANT_EXPRESSION, TRANSLATION_UNIT: l.mode = r } return l.last } ================================================ FILE: v2/model.go ================================================ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc import ( "fmt" "runtime" "github.com/cznic/ir" "github.com/cznic/mathutil" ) // Model describes properties of scalar Types. type Model map[TypeKind]ModelItem // ModelItem describers properties of a particular Type. type ModelItem struct { Size int Align int StructAlign int } // NewModel returns the model appropriate for the current OS and architecture // or according to the environment variables GOOS and GOARCH, if set. func NewModel() (m Model, err error) { switch arch := env("GOARCH", runtime.GOARCH); arch { case "arm": return Model{ Bool: {1, 1, 1}, Char: {1, 1, 1}, Int: {4, 4, 4}, Long: {4, 4, 4}, LongLong: {8, 4, 4}, SChar: {1, 1, 1}, Short: {2, 2, 2}, UChar: {1, 1, 1}, UInt: {4, 4, 4}, ULong: {4, 4, 4}, ULongLong: {8, 4, 4}, UShort: {2, 2, 2}, Float: {4, 4, 4}, Double: {8, 4, 4}, LongDouble: {8, 4, 4}, FloatComplex: {8, 4, 4}, DoubleComplex: {16, 4, 4}, LongDoubleComplex: {16, 4, 4}, Void: {1, 1, 1}, Ptr: {4, 4, 4}, }, nil case "386": return Model{ Bool: {1, 1, 1}, Char: {1, 1, 1}, Int: {4, 4, 4}, Long: {4, 4, 4}, LongLong: {8, 8, 4}, SChar: {1, 1, 1}, Short: {2, 2, 2}, UChar: {1, 1, 1}, UInt: {4, 4, 4}, ULong: {4, 4, 4}, ULongLong: {8, 8, 4}, UShort: {2, 2, 2}, Float: {4, 4, 4}, Double: {8, 8, 4}, LongDouble: {8, 8, 4}, FloatComplex: {8, 8, 4}, DoubleComplex: {16, 8, 4}, LongDoubleComplex: {16, 8, 4}, Void: {1, 1, 1}, Ptr: {4, 4, 4}, }, nil case "amd64": var longLength = 8 if env("GOOS", runtime.GOOS) == "windows" { longLength = 4 } model := Model{ Bool: {1, 1, 1}, Char: {1, 1, 1}, Int: {4, 4, 4}, Long: {longLength, longLength, longLength}, LongLong: {8, 8, 8}, SChar: {1, 1, 1}, Short: {2, 2, 2}, UChar: {1, 1, 1}, UInt: {4, 4, 4}, ULong: {longLength, longLength, longLength}, ULongLong: {8, 8, 8}, UShort: {2, 2, 2}, Float: {4, 4, 4}, Double: {8, 8, 8}, LongDouble: {8, 8, 8}, FloatComplex: {8, 8, 4}, DoubleComplex: {16, 8, 4}, LongDoubleComplex: {16, 8, 4}, Void: {1, 1, 1}, Ptr: {8, 8, 8}, } return model, nil default: return nil, fmt.Errorf("unknown/unsupported architecture %s", arch) } } // Equal returns whether m equals n. func (m Model) Equal(n Model) bool { if len(m) != len(n) { return false } for k, v := range m { if v != n[k] { return false } } return true } // Sizeof returns the size in bytes of a variable of type t. func (m Model) Sizeof(t Type) int64 { switch x := UnderlyingType(t).(type) { case *ArrayType: if x.Size.Type == nil && x.Size.Value == nil { // T[], but not T[i+2] return int64(m[Ptr].Size) } return m.Sizeof(x.Item) * x.Size.Value.(*ir.Int64Value).Value case *EnumType: return m.Sizeof(x.Enums[0].Operand.Type) case *NamedType: return m.Sizeof(x.Type) case *PointerType: return int64(m[Ptr].Size) case *StructType: layout := m.Layout(x) if len(layout) == 0 { return 0 } lf := layout[len(layout)-1] return lf.Offset + lf.Size + int64(lf.Padding) case *TaggedStructType: u := x.getType() if u == x { panic("TODO") } return m.Sizeof(u) case TypeKind: return int64(m[x].Size) case *UnionType: var sz int64 for _, v := range m.Layout(x) { if v.Size > sz { sz = v.Size } } return roundup(sz, int64(m.Alignof(x))) case nil: panic("internal error") default: panic(x) } } // FieldProperties describe a struct/union field. type FieldProperties struct { Bitoff int // Zero based bit number of a bitfield Bits int // Width of a bit field or zero otherwise. Declarator *Declarator Offset int64 // Byte offset relative to start of the struct/union. PackedType Type // Bits != 0: Storage type holding the bit field. Padding int // Adjustment to enforce proper alignment. Size int64 // Field size for copying. Type Type Anonymous bool } // Mask returns the bit mask of bit field described by f. func (f *FieldProperties) Mask() uint64 { if f.Bits == 0 { return 1<<64 - 1 } return (1< 0: r[i] = FieldProperties{Offset: off, Bitoff: bitoff, Bits: v.Bits, Declarator: v.Declarator, Type: v.Type} bitoff = v.Bits default: if v.Bits < 0 { if n := m.packBits(bitoff, i-1, off, r); bitoff != 0 { off = n } r[i] = FieldProperties{Offset: off, Bits: -1, Declarator: v.Declarator, Type: v.Type} bitoff = 0 break } n := bitoff + v.Bits if n > 32 { off = m.packBits(bitoff, i-1, off, r) r[i] = FieldProperties{Offset: off, Bits: v.Bits, Declarator: v.Declarator, Type: v.Type} bitoff = v.Bits break } r[i] = FieldProperties{Offset: off, Bitoff: bitoff, Bits: v.Bits, Declarator: v.Declarator, Type: v.Type} bitoff = n } default: if bitoff != 0 { off = m.packBits(bitoff, i-1, off, r) bitoff = 0 } sz := m.Sizeof(v.Type) a := m.StructAlignof(v.Type) z := off if a != 0 { off = roundup(off, int64(a)) } if off != z { r[i-1].Padding = int(off - z) } r[i] = FieldProperties{Offset: off, Size: sz, Declarator: v.Declarator, Type: v.Type, Anonymous: v.Anonymous} if sz == 0 && i == len(x.Fields)-1 { sz = 1 zeroFix = true } off += sz } } i := len(r) - 1 if bitoff != 0 { off = m.packBits(bitoff, i, off, r) } for i, v := range r { if v.Bits > 0 { x.Fields[i].PackedType = v.PackedType } } align := 0 for i, v := range x.Fields { if r[i].Bits < 0 { continue } t := v.Type if v.PackedType != nil { t = v.PackedType } align = mathutil.Max(align, m.StructAlignof(t)) } z := off off = roundup(off, int64(align)) if zeroFix { z-- } if off != z { r[len(r)-1].Padding = int(off - z) } return r case *UnionType: if len(x.Fields) == 0 { return nil } if x.layout != nil { return x.layout } defer func() { x.layout = r }() r = make([]FieldProperties, len(x.Fields)) for i, v := range x.Fields { switch { case v.Bits < 0: m.packBits(v.Bits, i, 0, r) case v.Bits > 0: r[i] = FieldProperties{Bits: v.Bits, Declarator: v.Declarator, Type: v.Type} m.packBits(v.Bits, i, 0, r) x.Fields[i].PackedType = r[i].PackedType default: sz := m.Sizeof(v.Type) r[i] = FieldProperties{Size: sz, Bits: v.Bits, Declarator: v.Declarator, Type: v.Type} } } for i, v := range r { if v.Bits != 0 { x.Fields[i].PackedType = v.PackedType } } return r case nil: panic("internal error") default: panic(x) } } func (m *Model) packBits(bitoff, i int, off int64, r []FieldProperties) int64 { var t Type switch { case bitoff <= 8: t = UChar case bitoff <= 16: t = UShort case bitoff <= 32: t = UInt case bitoff <= 64: t = ULongLong default: panic("internal error") } sz := m.Sizeof(t) a := m.StructAlignof(t) z := off if a != 0 { off = roundup(off, int64(a)) } var first int for first = i; first >= 0 && r[first].Bits > 0 && r[first].PackedType == nil; first-- { } first++ if off != z { r[first-1].Padding = int(off - z) } for j := first; j <= i; j++ { r[j].Offset = off r[j].Size = sz r[j].PackedType = t } return off + sz } // Alignof computes the memory alignment requirements of t. One is returned // for a struct/union type with no fields. func (m Model) Alignof(t Type) int { switch x := t.(type) { case *ArrayType: if x.Size.Value != nil { return m.Alignof(x.Item) } return m[Ptr].Align case *EnumType: return m.Alignof(x.Enums[0].Operand.Type) case *NamedType: return m.Alignof(x.Type) case *PointerType: return m[Ptr].Align case *StructType: m.Layout(x) r := 1 for _, v := range x.Fields { t := v.Type if v.Bits < 0 { continue } if v.Bits > 0 { t = v.PackedType } if a := m.StructAlignof(t); a > r { r = a } } return r case *TaggedEnumType: u := x.getType() if u == x { panic("TODO") } return m.Alignof(u) case *TaggedStructType: u := x.getType() if u == x { panic("TODO") } return m.Alignof(u) case *TaggedUnionType: u := x.getType() if u == x { panic("TODO") } return m.Alignof(u) case TypeKind: return m[x].Align case *UnionType: m.Layout(x) r := 1 for _, v := range x.Fields { t := v.Type if v.Bits < 0 { continue } if v.Bits > 0 { t = v.PackedType } if a := m.StructAlignof(t); a > r { r = a } } return r case nil: panic("internal error") default: panic(x) } } // StructAlignof computes the memory alignment requirements of t when its // instance is a struct field. One is returned for a struct/union type with no // fields. func (m Model) StructAlignof(t Type) int { switch x := t.(type) { case *ArrayType: if x.Size.Value != nil { return m.StructAlignof(x.Item) } return m[Ptr].StructAlign case *EnumType: return m.StructAlignof(x.Enums[0].Operand.Type) case *NamedType: return m.StructAlignof(x.Type) case *PointerType: return m[Ptr].StructAlign case *StructType: m.Layout(x) r := 1 for _, v := range x.Fields { t := v.Type if v.Bits < 0 { continue } if v.Bits > 0 { t = v.PackedType } if a := m.StructAlignof(t); a > r { r = a } } return r case *TaggedEnumType: u := x.getType() if u == x { panic("TODO") } return m.StructAlignof(u) case *TaggedStructType: u := x.getType() if u == x { panic("TODO") } return m.StructAlignof(u) case *TaggedUnionType: u := x.getType() if u == x { panic("TODO") } return m.StructAlignof(u) case TypeKind: return m[x].StructAlign case *UnionType: m.Layout(x) r := 1 for _, v := range x.Fields { t := v.Type if v.Bits < 0 { continue } if v.Bits > 0 { t = v.PackedType } if a := m.StructAlignof(t); a > r { r = a } } return r default: panic(fmt.Errorf("%T", x)) } } func roundup(n, to int64) int64 { if r := n % to; r != 0 { return n + to - r } return n } func (m Model) defaultArgumentPromotion(op Operand) (r Operand) { u := op.Type for { switch x := u.(type) { case *EnumType: u = x.Enums[0].Operand.Type case *NamedType: u = x.Type case *PointerType, *StructType, *TaggedStructType, *TaggedUnionType, *UnionType: op.Type = x return op case *TaggedEnumType: u = x.getType() case TypeKind: op.Type = x switch x { case Float: return op.ConvertTo(m, Double) case Double, LongDouble: return op case Char, Int, Long, LongLong, SChar, Short, UChar, UInt, ULong, ULongLong, UShort: return op.integerPromotion(m) default: panic(x) } default: panic(x) } } } ================================================ FILE: v2/operand.go ================================================ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cc // [0]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf import ( "fmt" "math" "math/bits" "github.com/cznic/ir" ) var ( // [0]6.3.1.1-1 // // Every integer type has an integer conversion rank defined as // follows: intConvRank = [maxTypeKind]int{ Bool: 1, Char: 2, SChar: 2, UChar: 2, Short: 3, UShort: 3, Int: 4, UInt: 4, Long: 5, ULong: 5, LongLong: 6, ULongLong: 6, } isSigned = [maxTypeKind]bool{ Bool: true, Char: true, SChar: true, Short: true, Int: true, Long: true, LongLong: true, } isArithmeticType = [maxTypeKind]bool{ Bool: true, Char: true, Enum: true, Int: true, Long: true, LongLong: true, SChar: true, Short: true, UChar: true, UInt: true, ULong: true, ULongLong: true, UShort: true, Float: true, Double: true, LongDouble: true, FloatComplex: true, DoubleComplex: true, LongDoubleComplex: true, } ) // Address represents the address of a variable. type Address struct { //TODO- Declarator *Declarator Offset uintptr } func (a *Address) String() string { return fmt.Sprintf("(%s+%d, %s)", dict.S(a.Declarator.Name()), a.Offset, a.Declarator.Linkage) } // UsualArithmeticConversions performs transformations of operands of a binary // operation. The function panics if either of the operands is not an // artithmetic type. // // [0]6.3.1.8 // // Many operators that expect operands of arithmetic type cause conversions and // yield result types in a similar way. The purpose is to determine a common // real type for the operands and result. For the specified operands, each // operand is converted, without change of type domain, to a type whose // corresponding real type is the common real type. Unless explicitly stated // otherwise, the common real type is also the corresponding real type of the // result, whose type domain is the type domain of the operands if they are the // same, and complex otherwise. This pattern is called the usual arithmetic // conversions: func UsualArithmeticConversions(m Model, a, b Operand) (Operand, Operand) { if !a.isArithmeticType() || !b.isArithmeticType() { panic(fmt.Sprint(a, b)) } a = a.normalize(m) b = b.normalize(m) // First, if the corresponding real type of either operand is long // double, the other operand is converted, without change of type // domain, to a type whose corresponding real type is long double. if a.Type.Kind() == LongDoubleComplex || b.Type.Kind() == LongDoubleComplex { return a.ConvertTo(m, LongDoubleComplex), b.ConvertTo(m, LongDoubleComplex) } if a.Type.Kind() == LongDouble || b.Type.Kind() == LongDouble { return a.ConvertTo(m, LongDouble), b.ConvertTo(m, LongDouble) } // Otherwise, if the corresponding real type of either operand is // double, the other operand is converted, without change of type // domain, to a type whose corresponding real type is double. if a.Type.Kind() == DoubleComplex || b.Type.Kind() == DoubleComplex { return a.ConvertTo(m, DoubleComplex), b.ConvertTo(m, DoubleComplex) } if a.Type.Kind() == Double || b.Type.Kind() == Double { return a.ConvertTo(m, Double), b.ConvertTo(m, Double) } // Otherwise, if the corresponding real type of either operand is // float, the other operand is converted, without change of type // domain, to a type whose corresponding real type is float.) if a.Type.Kind() == FloatComplex || b.Type.Kind() == FloatComplex { return a.ConvertTo(m, FloatComplex), b.ConvertTo(m, FloatComplex) } if a.Type.Kind() == Float || b.Type.Kind() == Float { return a.ConvertTo(m, Float), b.ConvertTo(m, Float) } // Otherwise, the integer promotions are performed on both operands. // Then the following rules are applied to the promoted operands: if !a.isIntegerType() || !b.isIntegerType() { //dbg("", a) //dbg("", b) panic("TODO") } a = a.integerPromotion(m) b = b.integerPromotion(m) // If both operands have the same type, then no further conversion is // needed. if a.Type.Equal(b.Type) { return a, b } // Otherwise, if both operands have signed integer types or both have // unsigned integer types, the operand with the type of lesser integer // conversion rank is converted to the type of the operand with greater // rank. if a.isSigned() == b.isSigned() { t := a.Type if intConvRank[b.Type.Kind()] > intConvRank[a.Type.Kind()] { t = b.Type } return a.ConvertTo(m, t), b.ConvertTo(m, t) } // Otherwise, if the operand that has unsigned integer type has rank // greater or equal to the rank of the type of the other operand, then // the operand with signed integer type is converted to the type of the // operand with unsigned integer type. switch { case a.isSigned(): // b is unsigned if intConvRank[b.Type.Kind()] >= intConvRank[a.Type.Kind()] { return a.ConvertTo(m, b.Type), b } case b.isSigned(): // a is unsigned if intConvRank[a.Type.Kind()] >= intConvRank[b.Type.Kind()] { return a, b.ConvertTo(m, a.Type) } default: panic(fmt.Errorf("TODO %v %v", a, b)) } var signed Type // Otherwise, if the type of the operand with signed integer type can // represent all of the values of the type of the operand with unsigned // integer type, then the operand with unsigned integer type is // converted to the type of the operand with signed integer type. switch { case a.isSigned(): // b is unsigned signed = a.Type if m.Sizeof(a.Type) > m.Sizeof(b.Type) { return a, b.ConvertTo(m, a.Type) } case b.isSigned(): // a is unsigned signed = b.Type if m.Sizeof(b.Type) > m.Sizeof(a.Type) { return a.ConvertTo(m, b.Type), b } default: panic(fmt.Errorf("TODO %v %v", a, b)) } // Otherwise, both operands are converted to the unsigned integer type // corresponding to the type of the operand with signed integer type. switch signed.Kind() { case Int: if a.IsEnumConst || b.IsEnumConst { return a, b } return a.ConvertTo(m, UInt), b.ConvertTo(m, UInt) case Long: return a.ConvertTo(m, ULong), b.ConvertTo(m, ULong) case LongLong: return a.ConvertTo(m, ULongLong), b.ConvertTo(m, ULongLong) default: panic(signed) } } // Operand represents the type and optionally the value of an expression. type Operand struct { Type Type ir.Value FieldProperties *FieldProperties IsEnumConst bool // Blocks int -> unsigned int promotions. See [0]6.4.4.3/2 } // Bits return the width of a bit field operand or zero othewise func (o *Operand) Bits() int { if fp := o.FieldProperties; fp != nil { return fp.Bits } return 0 } func newIntConst(ctx *context, n Node, v uint64, t ...TypeKind) (r Operand) { b := bits.Len64(v) for _, t := range t { sign := 1 if t.IsUnsigned() { sign = 0 } if ctx.model[t].Size*8 >= b+sign { return Operand{Type: t, Value: &ir.Int64Value{Value: int64(v)}}.normalize(ctx.model) } } last := t[len(t)-1] if ctx.model[last].Size*8 == b { return Operand{Type: last, Value: &ir.Int64Value{Value: int64(v)}}.normalize(ctx.model) } ctx.err(n, "invalid integer constant") return Operand{Type: Int}.normalize(ctx.model) } func (o Operand) String() string { return fmt.Sprintf("(type %v, value %v, fieldProps %+v)", o.Type, o.Value, o.FieldProperties) } func (o Operand) isArithmeticType() bool { return o.Type.IsArithmeticType() } func (o Operand) isIntegerType() bool { return o.Type.IsIntegerType() } func (o Operand) isPointerType() bool { return o.Type.IsPointerType() } func (o Operand) isScalarType() bool { return o.Type.IsScalarType() } // [0]6.2.5-21 func (o Operand) isSigned() bool { return isSigned[o.Type.Kind()] } func (o Operand) add(ctx *context, p Operand) (r Operand) { o, p = UsualArithmeticConversions(ctx.model, o, p) if p.IsZero() { return o.normalize(ctx.model) } if o.Value == nil || p.Value == nil { o.Value = nil return o.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: return Operand{Type: o.Type, Value: &ir.Int64Value{Value: x.Value + p.Value.(*ir.Int64Value).Value}}.normalize(ctx.model) case *ir.Float64Value: return Operand{Type: o.Type, Value: &ir.Float64Value{Value: x.Value + p.Value.(*ir.Float64Value).Value}}.normalize(ctx.model) default: panic(fmt.Errorf("TODO %T %v %v", x, o, p)) } } func (o Operand) and(ctx *context, p Operand) (r Operand) { if !o.isIntegerType() || !p.isIntegerType() { panic(fmt.Errorf("TODO %v & %v", o.Type, p.Type)) } o, p = UsualArithmeticConversions(ctx.model, o, p) if o.IsZero() || p.IsZero() { return Operand{Type: o.Type, Value: &ir.Int64Value{Value: 0}}.normalize(ctx.model) } if o.Value == nil || p.Value == nil { return Operand{Type: o.Type}.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: return Operand{Type: o.Type, Value: &ir.Int64Value{Value: x.Value & p.Value.(*ir.Int64Value).Value}}.normalize(ctx.model) default: panic(fmt.Errorf("TODO %T", x)) } } // ConvertTo converts o to type t. func (o Operand) ConvertTo(m Model, t Type) (r Operand) { if o.Type.Equal(t) { return o.normalize(m) } switch x := t.(type) { case *EnumType, *PointerType, *TaggedEnumType, *TaggedUnionType: // ok case TypeKind: switch x { case Bool, Char, Double, DoubleComplex, Float, FloatComplex, Int, Long, LongDouble, LongDoubleComplex, LongLong, SChar, Short, UChar, UInt, ULong, ULongLong, UShort: // ok default: panic(x) } case *NamedType: return o.ConvertTo(m, x.Type) default: panic(fmt.Errorf("%T", x)) } if o.Value == nil { o.Type = t return o.normalize(m) } if o.isIntegerType() { v := *o.Value.(*ir.Int64Value) if t.IsIntegerType() { return Operand{Type: t, Value: &v}.normalize(m) } if t.IsPointerType() { // [0]6.3.2.3 if o.IsZero() { // 3. An integer constant expression with the // value 0, or such an expression cast to type // void *, is called a null pointer constant. // If a null pointer constant is converted to a // pointer type, the resulting pointer, called // a null pointer, is guaranteed to compare // unequal to a pointer to any object or // function. return Operand{Type: t, Value: Null} } return Operand{Type: t, Value: &v}.normalize(m) } if t.Kind() == Union { if v.Value != 0 { panic("TODO") } return Operand{Type: t} } switch { case o.Type.IsUnsigned(): val := uint64(v.Value) switch t.Kind() { case Double, LongDouble: return Operand{Type: t, Value: &ir.Float64Value{Value: float64(val)}}.normalize(m) case DoubleComplex: return Operand{Type: t, Value: &ir.Complex128Value{Value: complex(float64(val), 0)}}.normalize(m) case Float: return Operand{Type: t, Value: &ir.Float32Value{Value: float32(val)}}.normalize(m) case FloatComplex: return Operand{Type: t, Value: &ir.Complex64Value{Value: complex(float32(val), 0)}}.normalize(m) default: panic(t) } default: val := v.Value switch t.Kind() { case Double, LongDouble: return Operand{Type: t, Value: &ir.Float64Value{Value: float64(val)}}.normalize(m) case DoubleComplex: return Operand{Type: t, Value: &ir.Complex128Value{Value: complex(float64(val), 0)}}.normalize(m) case Float: return Operand{Type: t, Value: &ir.Float32Value{Value: float32(val)}}.normalize(m) case FloatComplex: return Operand{Type: t, Value: &ir.Complex64Value{Value: complex(float32(val), 0)}}.normalize(m) default: panic(t) } } } if o.Type.Kind() == Double { v := o.Value.(*ir.Float64Value).Value if t.IsIntegerType() { return Operand{Type: t, Value: &ir.Int64Value{Value: ConvertFloat64(v, t, m)}}.normalize(m) } switch x := t.(type) { case TypeKind: switch x { case Float: return Operand{Type: t, Value: &ir.Float32Value{Value: float32(o.Value.(*ir.Float64Value).Value)}}.normalize(m) case LongDouble: v := *o.Value.(*ir.Float64Value) return Operand{Type: t, Value: &v}.normalize(m) default: panic(x) } default: panic(x) } } if o.Type.Kind() == Float { v := o.Value.(*ir.Float32Value).Value if t.IsIntegerType() { return Operand{Type: t, Value: &ir.Int64Value{Value: ConvertFloat64(float64(v), t, m)}}.normalize(m) } switch x := t.(type) { case TypeKind: switch x { case Double, LongDouble: return Operand{Type: t, Value: &ir.Float64Value{Value: float64(v)}}.normalize(m) default: panic(x) } default: panic(x) } } if o.isPointerType() && t.IsPointerType() { o.Type = t return o.normalize(m) } if o.isPointerType() && t.IsIntegerType() { o.Type = t switch x := o.Value.(type) { case *ir.AddressValue: if x.NameID != 0 { o.Value = nil break } o.Value = &ir.Int64Value{Value: int64(x.Offset)} case *ir.Int64Value: // nop default: //fmt.Printf("TODO405 %T %v -> %v\n", x, o, t) //TODO- panic(fmt.Errorf("%T %v -> %v", x, o, t)) } return o.normalize(m) } panic(fmt.Errorf("%T(%v) -> %T(%v)", o.Type, o, t, t)) } func (o Operand) cpl(ctx *context) Operand { if o.isIntegerType() { o = o.integerPromotion(ctx.model) } switch x := o.Value.(type) { case nil: return o case *ir.Int64Value: o.Value = &ir.Int64Value{Value: ^o.Value.(*ir.Int64Value).Value} return o.normalize(ctx.model) default: panic(fmt.Errorf("TODO %T", x)) } } func (o Operand) div(ctx *context, n Node, p Operand) (r Operand) { o, p = UsualArithmeticConversions(ctx.model, o, p) if o.Value == nil || p.Value == nil { o.Value = nil return o.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: if p.IsZero() { ctx.err(n, "division by zero") return Operand{Type: o.Type}.normalize(ctx.model) } switch { case o.Type.IsUnsigned(): return Operand{Type: o.Type, Value: &ir.Int64Value{Value: int64(uint64(x.Value) / uint64(p.Value.(*ir.Int64Value).Value))}}.normalize(ctx.model) default: return Operand{Type: o.Type, Value: &ir.Int64Value{Value: x.Value / p.Value.(*ir.Int64Value).Value}}.normalize(ctx.model) } case *ir.Float32Value: return Operand{Type: o.Type, Value: &ir.Float32Value{Value: x.Value / p.Value.(*ir.Float32Value).Value}}.normalize(ctx.model) case *ir.Float64Value: return Operand{Type: o.Type, Value: &ir.Float64Value{Value: x.Value / p.Value.(*ir.Float64Value).Value}}.normalize(ctx.model) default: panic(fmt.Errorf("TODO %T", x)) } } func (o Operand) eq(ctx *context, p Operand) (r Operand) { r = Operand{Type: Int} if o.isArithmeticType() && p.isArithmeticType() { o, p = UsualArithmeticConversions(ctx.model, o, p) } if o.Value == nil || p.Value == nil { return r.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: var val int64 if x.Value == p.Value.(*ir.Int64Value).Value { val = 1 } r.Value = &ir.Int64Value{Value: val} case *ir.Float64Value: var val int64 if x.Value == p.Value.(*ir.Float64Value).Value { val = 1 } r.Value = &ir.Int64Value{Value: val} default: panic(fmt.Errorf("TODO %T", x)) } return r.normalize(ctx.model) } func (o Operand) ge(ctx *context, p Operand) (r Operand) { r = Operand{Type: Int} if o.isArithmeticType() && p.isArithmeticType() { o, p = UsualArithmeticConversions(ctx.model, o, p) } if o.Value == nil || p.Value == nil { return r.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: var val int64 switch { case o.isSigned(): if x.Value >= p.Value.(*ir.Int64Value).Value { val = 1 } default: if uint64(x.Value) >= uint64(p.Value.(*ir.Int64Value).Value) { val = 1 } } r.Value = &ir.Int64Value{Value: val} case *ir.Float64Value: var val int64 if x.Value >= p.Value.(*ir.Float64Value).Value { val = 1 } r.Value = &ir.Int64Value{Value: val} default: panic(fmt.Errorf("TODO %T", x)) } return r.normalize(ctx.model) } func (o Operand) gt(ctx *context, p Operand) (r Operand) { r = Operand{Type: Int} if o.isArithmeticType() && p.isArithmeticType() { o, p = UsualArithmeticConversions(ctx.model, o, p) } if o.Value == nil || p.Value == nil { return r.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: var val int64 switch { case o.isSigned(): if x.Value > p.Value.(*ir.Int64Value).Value { val = 1 } default: if uint64(x.Value) > uint64(p.Value.(*ir.Int64Value).Value) { val = 1 } } r.Value = &ir.Int64Value{Value: val} case *ir.Float64Value: var val int64 if x.Value > p.Value.(*ir.Float64Value).Value { val = 1 } r.Value = &ir.Int64Value{Value: val} default: panic(fmt.Errorf("TODO %T", x)) } return r.normalize(ctx.model) } // integerPromotion computes the integer promotion of o. // // [0]6.3.1.1-2 // // If an int can represent all values of the original type, the value is // converted to an int; otherwise, it is converted to an unsigned int. These // are called the integer promotions. All other types are unchanged by the // integer promotions. func (o Operand) integerPromotion(m Model) Operand { t := o.Type for { switch x := t.(type) { case *EnumType: t = x.Enums[0].Operand.Type case *NamedType: t = x.Type case *TaggedEnumType: t = x.getType().(*EnumType).Enums[0].Operand.Type case TypeKind: // github.com/gcc-mirror/gcc/gcc/testsuite/gcc.c-torture/execute/bf-sign-2.c // // This test checks promotion of bitfields. Bitfields // should be promoted very much like chars and shorts: // // Bitfields (signed or unsigned) should be promoted to // signed int if their value will fit in a signed int, // otherwise to an unsigned int if their value will fit // in an unsigned int, otherwise we don't promote them // (ANSI/ISO does not specify the behavior of bitfields // larger than an unsigned int). if x.IsIntegerType() && o.Bits() != 0 { bits := m[Int].Size * 8 switch { case x.IsUnsigned(): if o.Bits() < bits { return o.ConvertTo(m, Int) } default: if o.Bits() < bits-1 { return o.ConvertTo(m, Int) } } } switch x { case Double, Float, Int, Long, LongDouble, LongLong, UInt, ULong, ULongLong: return o case Char, SChar, Short, UChar, UShort: return o.ConvertTo(m, Int) default: panic(x) } default: panic(x) } } } // IsNonZero returns true when the value of o is known to be non-zero. func (o Operand) IsNonZero() bool { switch x := o.Value.(type) { case nil: return false case *ir.Float32Value: return x.Value != 0 case *ir.Float64Value: return x.Value != 0 case *ir.Int64Value: return x.Value != 0 case *ir.StringValue: return true case *ir.AddressValue: return x != Null default: panic(fmt.Errorf("TODO %T", x)) } } // IsZero returns true when the value of o is known to be zero. func (o Operand) IsZero() bool { switch x := o.Value.(type) { case nil: return false case *ir.Complex128Value: return x.Value == 0 case *ir.Float32Value: return x.Value == 0 case *ir.Float64Value: return x.Value == 0 case *ir.Int64Value: return x.Value == 0 case *ir.StringValue, *ir.WideStringValue: return false case *ir.AddressValue: return x == Null default: panic(fmt.Errorf("TODO %T", x)) } } func (o Operand) isNullPtrConst() bool { return o.isIntegerType() && o.IsZero() || o.Value == Null } func (o Operand) le(ctx *context, p Operand) (r Operand) { r = Operand{Type: Int} if o.isArithmeticType() && p.isArithmeticType() { o, p = UsualArithmeticConversions(ctx.model, o, p) } if o.Value == nil || p.Value == nil { return r.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: var val int64 switch { case o.isSigned(): if x.Value <= p.Value.(*ir.Int64Value).Value { val = 1 } default: if uint64(x.Value) <= uint64(p.Value.(*ir.Int64Value).Value) { val = 1 } } r.Value = &ir.Int64Value{Value: val} case *ir.Float64Value: var val int64 if x.Value <= p.Value.(*ir.Float64Value).Value { val = 1 } r.Value = &ir.Int64Value{Value: val} default: panic(fmt.Errorf("TODO %T", x)) } return r.normalize(ctx.model) } func (o Operand) lsh(ctx *context, p Operand) (r Operand) { // [0]6.5.7 // 2. Each of the operands shall have integer type. if !o.isIntegerType() || !p.isIntegerType() { panic("TODO") } // 3. The integer promotions are performed on each of the operands. The // type of the result is that of the promoted left operand. If the // value of the right operand is negative or is greater than or equal // to the width of the promoted left operand, the behavior is // undefined. o = o.integerPromotion(ctx.model) p = p.integerPromotion(ctx.model) if o.IsZero() { return o.normalize(ctx.model) } m := uint64(32) if ctx.model.Sizeof(o.Type) > 4 { m = 64 } if o.Value == nil || p.Value == nil { return Operand{Type: o.Type}.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: return Operand{Type: o.Type, Value: &ir.Int64Value{Value: x.Value << (uint64(p.Value.(*ir.Int64Value).Value) % m)}}.normalize(ctx.model) default: panic(fmt.Errorf("TODO %T", x)) } } func (o Operand) lt(ctx *context, p Operand) (r Operand) { r = Operand{Type: Int} if o.isArithmeticType() && p.isArithmeticType() { o, p = UsualArithmeticConversions(ctx.model, o, p) } if o.Value == nil || p.Value == nil { return r.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: var val int64 switch { case o.isSigned(): if x.Value < p.Value.(*ir.Int64Value).Value { val = 1 } default: if uint64(x.Value) < uint64(p.Value.(*ir.Int64Value).Value) { val = 1 } } r.Value = &ir.Int64Value{Value: val} case *ir.Float64Value: var val int64 if x.Value < p.Value.(*ir.Float64Value).Value { val = 1 } r.Value = &ir.Int64Value{Value: val} default: panic(fmt.Errorf("TODO %T", x)) } return r.normalize(ctx.model) } func (o Operand) mod(ctx *context, n Node, p Operand) (r Operand) { o, p = UsualArithmeticConversions(ctx.model, o, p) if p.IsZero() { ctx.err(n, "division by zero") return p.normalize(ctx.model) } if o.IsZero() { // 0 % x == 0 return o.normalize(ctx.model) } if y, ok := p.Value.(*ir.Int64Value); ok && (y.Value == 1 || y.Value == -1) { return Operand{Type: o.Type, Value: &ir.Int64Value{Value: 0}}.normalize(ctx.model) // y % {1,-1} == 0 } if o.Value == nil || p.Value == nil { return Operand{Type: o.Type}.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: return Operand{Type: o.Type, Value: &ir.Int64Value{Value: x.Value % p.Value.(*ir.Int64Value).Value}}.normalize(ctx.model) default: panic(fmt.Errorf("TODO %T", x)) } } func (o Operand) mul(ctx *context, p Operand) (r Operand) { o, p = UsualArithmeticConversions(ctx.model, o, p) if o.IsZero() || p.IsZero() { switch x := UnderlyingType(o.Type).(type) { case TypeKind: if x.IsIntegerType() { return Operand{Type: o.Type, Value: &ir.Int64Value{Value: 0}}.normalize(ctx.model) } default: panic(fmt.Errorf("TODO %T", x)) } } if o.Value == nil || p.Value == nil { return Operand{Type: o.Type}.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: return Operand{Type: o.Type, Value: &ir.Int64Value{Value: x.Value * p.Value.(*ir.Int64Value).Value}}.normalize(ctx.model) case *ir.Float32Value: return Operand{Type: o.Type, Value: &ir.Float32Value{Value: x.Value * p.Value.(*ir.Float32Value).Value}} case *ir.Float64Value: return Operand{Type: o.Type, Value: &ir.Float64Value{Value: x.Value * p.Value.(*ir.Float64Value).Value}} default: panic(fmt.Errorf("TODO %T", x)) } } func (o Operand) ne(ctx *context, p Operand) (r Operand) { r = Operand{Type: Int} if o.isArithmeticType() && p.isArithmeticType() { o, p = UsualArithmeticConversions(ctx.model, o, p) } if o.Value == nil || p.Value == nil { return r.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: var val int64 if x.Value != p.Value.(*ir.Int64Value).Value { val = 1 } r.Value = &ir.Int64Value{Value: val} case *ir.Float32Value: var val int64 if x.Value != p.Value.(*ir.Float32Value).Value { val = 1 } r.Value = &ir.Int64Value{Value: val} case *ir.Float64Value: var val int64 if x.Value != p.Value.(*ir.Float64Value).Value { val = 1 } r.Value = &ir.Int64Value{Value: val} default: panic(fmt.Errorf("TODO %T", x)) } return r.normalize(ctx.model) } // ConvertFloat64 converts v to t, which must be an integer type. func ConvertFloat64(v float64, t Type, m Model) int64 { if !t.IsIntegerType() { panic(fmt.Errorf("ConvertFloat64: %T", t)) } switch sz := m.Sizeof(t); { case t.IsUnsigned(): switch sz { case 1: if v > math.Nextafter(math.MaxUint8, 0) { return math.MaxUint8 } if v <= 0 { return 0 } case 2: if v > math.Nextafter(math.MaxUint16, 0) { return math.MaxUint16 } if v <= 0 { return 0 } case 4: if v > math.Nextafter(math.MaxUint32, 0) { return math.MaxUint32 } if v <= 0 { return 0 } case 8: if v > math.Nextafter(math.MaxUint64, 0) { return -1 // int64(math,MaxUint64) } if v <= 0 { return 0 } default: panic(sz) } default: switch sz { case 1: if v > math.Nextafter(math.MaxInt8, 0) { return math.MaxInt8 } if v < math.Nextafter(math.MinInt8, 0) { return math.MinInt8 } case 2: if v > math.Nextafter(math.MaxInt16, 0) { return math.MaxInt16 } if v < math.Nextafter(math.MinInt16, 0) { return math.MinInt16 } case 4: if v > math.Nextafter(math.MaxInt32, 0) { return math.MaxInt32 } if v < math.Nextafter(math.MinInt32, 0) { return math.MinInt32 } case 8: if v > math.Nextafter(math.MaxInt64, 0) { return math.MaxInt64 } if v < math.Nextafter(math.MinInt64, 0) { return math.MinInt64 } default: panic(sz) } } return int64(v) } // ConvertInt64 converts n to t, which must be an integer or enum type, doing // masking and/or sign extending as appropriate. func ConvertInt64(n int64, t Type, m Model) int64 { switch x := UnderlyingType(t).(type) { case *EnumType: t = x.Enums[0].Operand.Type } signed := !t.IsUnsigned() switch sz := m[UnderlyingType(t).Kind()].Size; sz { case 1: switch { case signed: switch { case int8(n) < 0: return n | ^math.MaxUint8 default: return n & math.MaxUint8 } default: return n & math.MaxUint8 } case 2: switch { case signed: switch { case int16(n) < 0: return n | ^math.MaxUint16 default: return n & math.MaxUint16 } default: return n & math.MaxUint16 } case 4: switch { case signed: switch { case int32(n) < 0: return n | ^math.MaxUint32 default: return n & math.MaxUint32 } default: return n & math.MaxUint32 } case 8: return n default: panic(fmt.Errorf("TODO %v %T %v", sz, t, t)) } } func (o Operand) normalize(m Model) (r Operand) { switch x := o.Value.(type) { case *ir.Int64Value: if v := ConvertInt64(x.Value, o.Type, m); v != x.Value { n := *x n.Value = v x = &n o.Value = x } case nil: // nop case *ir.AddressValue, *ir.Complex128Value, *ir.Complex64Value, *ir.Float32Value, *ir.Float64Value, *ir.StringValue, *ir.WideStringValue: // nop default: panic(fmt.Errorf("TODO %T", x)) } return o } func (o Operand) or(ctx *context, p Operand) (r Operand) { if !o.isIntegerType() || !p.isIntegerType() { panic("TODO") } o, p = UsualArithmeticConversions(ctx.model, o, p) r.Type = o.Type if o.Value == nil || p.Value == nil { return Operand{Type: o.Type}.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: return Operand{Type: o.Type, Value: &ir.Int64Value{Value: x.Value | p.Value.(*ir.Int64Value).Value}}.normalize(ctx.model) default: panic(fmt.Errorf("TODO %T", x)) } } func (o Operand) rsh(ctx *context, p Operand) (r Operand) { // [0]6.5.7 // 2. Each of the operands shall have integer type. if !o.isIntegerType() || !p.isIntegerType() { panic("TODO") } // 3. The integer promotions are performed on each of the operands. The // type of the result is that of the promoted left operand. If the // value of the right operand is negative or is greater than or equal // to the width of the promoted left operand, the behavior is // undefined. o = o.integerPromotion(ctx.model) p = p.integerPromotion(ctx.model) r.Type = o.Type m := uint64(32) if ctx.model.Sizeof(o.Type) > 4 { m = 64 } if o.Value == nil || p.Value == nil { return Operand{Type: o.Type}.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: switch { case o.isSigned(): return Operand{Type: o.Type, Value: &ir.Int64Value{Value: x.Value >> (uint64(p.Value.(*ir.Int64Value).Value) % m)}}.normalize(ctx.model) default: return Operand{Type: o.Type, Value: &ir.Int64Value{Value: int64(uint64(x.Value) >> (uint64(p.Value.(*ir.Int64Value).Value) % m))}}.normalize(ctx.model) } default: panic(fmt.Errorf("TODO %T", x)) } } func (o Operand) sub(ctx *context, p Operand) (r Operand) { o, p = UsualArithmeticConversions(ctx.model, o, p) if p.IsZero() { return o.normalize(ctx.model) } if o.Value == nil || p.Value == nil { return Operand{Type: o.Type}.normalize(ctx.model) } switch x := o.Value.(type) { case *ir.Int64Value: return Operand{Type: o.Type, Value: &ir.Int64Value{Value: x.Value - p.Value.(*ir.Int64Value).Value}}.normalize(ctx.model) case *ir.Float32Value: return Operand{Type: o.Type, Value: &ir.Float32Value{Value: x.Value - p.Value.(*ir.Float32Value).Value}}.normalize(ctx.model) case *ir.Float64Value: return Operand{Type: o.Type, Value: &ir.Float64Value{Value: x.Value - p.Value.(*ir.Float64Value).Value}}.normalize(ctx.model) default: panic(fmt.Errorf("TODO %T", x)) } } func (o Operand) unaryMinus(ctx *context) Operand { if o.isIntegerType() { o = o.integerPromotion(ctx.model) } switch x := o.Value.(type) { case nil: return o case *ir.Int64Value: return Operand{Type: o.Type, Value: &ir.Int64Value{Value: -x.Value}}.normalize(ctx.model) case *ir.Float32Value: return Operand{Type: o.Type, Value: &ir.Float32Value{Value: -x.Value}} case *ir.Float64Value: return Operand{Type: o.Type, Value: &ir.Float64Value{Value: -x.Value}} default: panic(fmt.Errorf("TODO %T", x)) } } func (o Operand) xor(ctx *context, p Operand) (r Operand) { if !o.isIntegerType() || !p.isIntegerType() { panic("TODO") } o, p = UsualArithmeticConversions(ctx.model, o, p) if o.Value == nil || p.Value == nil { return Operand{Type: o.Type} } switch x := o.Value.(type) { case *ir.Int64Value: return Operand{Type: o.Type, Value: &ir.Int64Value{Value: x.Value ^ p.Value.(*ir.Int64Value).Value}}.normalize(ctx.model) default: panic(fmt.Errorf("TODO %T", x)) } } ================================================ FILE: v2/parser.go ================================================ // Code generated by goyacc - DO NOT EDIT. // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on [0], 6.5-6.10. Substantial portions of expression AST size // optimizations are from [1], license of which follows. // // [0]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf // [1]: https://github.com/rsc/c2go/blob/fc8cbfad5a47373828c81c7a56cccab8b221d310/cc/cc.y // ---------------------------------------------------------------------------- // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This grammar is derived from the C grammar in the 'ansitize' // program, which carried this notice: // // Copyright (c) 2006 Russ Cox, // Massachusetts Institute of Technology // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated // documentation files (the "Software"), to deal in the // Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, // sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, // subject to the following conditions: // // The above copyright notice and this permission notice shall // be included in all copies or substantial portions of the // Software. // // The software is provided "as is", without warranty of any // kind, express or implied, including but not limited to the // warranties of merchantability, fitness for a particular // purpose and noninfringement. In no event shall the authors // or copyright holders be liable for any claim, damages or // other liability, whether in an action of contract, tort or // otherwise, arising from, out of or in connection with the // software or the use or other dealings in the software. package cc import __yyfmt__ "fmt" import __sync__ "sync" import ( "github.com/cznic/xc" ) var yyPool = __sync__.Pool{New: func() interface{} { s := make([]yySymType, 200); return &s }} type yySymType struct { yys int Token xc.Token node Node } type yyXError struct { state, xsym int } const ( yyDefault = 57432 yyEofCode = 57344 ADDASSIGN = 57346 ALIGNOF = 57347 ANDAND = 57348 ANDASSIGN = 57349 ARROW = 57350 AUTO = 57351 BOOL = 57352 BREAK = 57353 CASE = 57354 CAST = 57355 CHAR = 57356 CHARCONST = 57357 COMPLEX = 57358 CONST = 57359 CONSTANT_EXPRESSION = 1048576 CONTINUE = 57360 DDD = 57361 DEC = 57362 DEFAULT = 57363 DIRECTIVE = 57364 DIVASSIGN = 57365 DO = 57366 DOUBLE = 57367 ELSE = 57368 ENUM = 57369 EQ = 57370 EXTERN = 57371 FLOAT = 57372 FLOATCONST = 57373 FOR = 57374 GEQ = 57375 GOTO = 57376 IDENTIFIER = 57377 IF = 57378 INC = 57379 INLINE = 57380 INT = 57381 INTCONST = 57382 LEQ = 57383 LONG = 57384 LONGCHARCONST = 57385 LONGSTRINGLITERAL = 57386 LSH = 57387 LSHASSIGN = 57388 MODASSIGN = 57389 MULASSIGN = 57390 NEQ = 57391 NOELSE = 57392 NON_REPL = 57393 NOSEMI = 57394 ORASSIGN = 57395 OROR = 57396 PPNUMBER = 57397 PPPASTE = 57398 REGISTER = 57399 RESTRICT = 57400 RETURN = 57401 RSH = 57402 RSHASSIGN = 57403 SHORT = 57404 SIGNED = 57405 SIZEOF = 57406 STATIC = 57407 STRINGLITERAL = 57408 STRUCT = 57409 SUBASSIGN = 57410 SWITCH = 57411 TRANSLATION_UNIT = 1048577 TYPEDEF = 57412 TYPEDEF_NAME = 57413 TYPEOF = 57414 UNARY = 57415 UNION = 57416 UNSIGNED = 57417 VOID = 57418 VOLATILE = 57419 WHILE = 57420 XORASSIGN = 57421 yyErrCode = 57345 yyMaxDepth = 200 yyTabOfs = -247 ) var ( yyPrec = map[int]int{ NOSEMI: 0, ';': 1, NOELSE: 2, ELSE: 3, '=': 4, ADDASSIGN: 4, ANDASSIGN: 4, DIVASSIGN: 4, LSHASSIGN: 4, MODASSIGN: 4, MULASSIGN: 4, ORASSIGN: 4, RSHASSIGN: 4, SUBASSIGN: 4, XORASSIGN: 4, ':': 5, '?': 5, OROR: 6, ANDAND: 7, '|': 8, '^': 9, '&': 10, EQ: 11, NEQ: 11, '<': 12, '>': 12, GEQ: 12, LEQ: 12, LSH: 13, RSH: 13, '+': 14, '-': 14, '%': 15, '*': 15, '/': 15, CAST: 16, '!': 17, '~': 17, ALIGNOF: 17, SIZEOF: 17, UNARY: 17, '(': 18, '.': 18, '[': 18, ARROW: 18, DEC: 18, INC: 18, } yyFollow = [][]int{ {1048576, 57490, 1048577}, // state 0 {57344}, // state 1 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57442, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 2 {40, 42, 57351, 57352, 57356, 57358, 57359, 57367, 57443, 57446, 57448, 57369, 57371, 57456, 57465, 57466, 57372, 57468, 57469, 57377, 57380, 57381, 57384, 57485, 57486, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 3 {57344, 40, 42, 57351, 57352, 57356, 57358, 57359, 57367, 57443, 57446, 57448, 57369, 57371, 57456, 57465, 57372, 57468, 57469, 57377, 57380, 57381, 57384, 57485, 57486, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 4 {40, 42, 59, 57448, 57377, 57473, 57474, 57475, 57485, 57486}, // state 5 {40, 41, 42, 44, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57446, 57447, 57369, 57371, 57456, 57372, 57469, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 6 {40, 41, 42, 44, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57446, 57447, 57369, 57371, 57456, 57372, 57469, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 7 {40, 41, 42, 44, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57446, 57447, 57369, 57371, 57456, 57372, 57469, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 8 {40, 41, 42, 44, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57446, 57447, 57369, 57371, 57456, 57372, 57469, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 9 {40, 41, 42, 44, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 10 {40, 41, 42, 44, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 11 {40, 41, 42, 44, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 12 {40, 41, 42, 44, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 13 {40, 41, 42, 44, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 14 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 15 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 16 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 17 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 18 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 19 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 20 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 21 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 22 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 23 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 24 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 25 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 26 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 27 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 28 {40}, // state 29 {123, 57377, 57472}, // state 30 {123, 57377}, // state 31 {123, 57377}, // state 32 {123, 57377, 57472}, // state 33 {33, 38, 40, 41, 42, 43, 44, 45, 58, 59, 91, 93, 126, 57347, 57351, 57352, 57356, 57357, 57358, 57359, 57362, 57367, 57369, 57371, 57372, 57373, 57377, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57404, 57405, 57406, 57407, 57408, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 34 {33, 38, 40, 41, 42, 43, 44, 45, 58, 59, 91, 93, 126, 57347, 57351, 57352, 57356, 57357, 57358, 57359, 57362, 57367, 57369, 57371, 57372, 57373, 57377, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57404, 57405, 57406, 57407, 57408, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 35 {33, 38, 40, 41, 42, 43, 44, 45, 58, 59, 91, 93, 126, 57347, 57351, 57352, 57356, 57357, 57358, 57359, 57362, 57367, 57369, 57371, 57372, 57373, 57377, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57404, 57405, 57406, 57407, 57408, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 36 {40, 41, 42, 44, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 37 {40, 57455, 57377}, // state 38 {40, 41, 42, 44, 91, 57359, 57377, 57400, 57500, 57501, 57502, 57419}, // state 39 {40, 57377}, // state 40 {57344, 40, 42, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 41 {57344, 40, 42, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 42 {57344, 40, 42, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 43 {57431, 123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 44 {123, 57351, 57352, 57356, 57358, 57359, 57367, 57443, 57444, 57445, 57446, 57369, 57371, 57456, 57372, 57469, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 45 {40, 42, 59, 57448, 57377, 57473, 57474, 57475, 57485, 57486}, // state 46 {57423, 123, 57467}, // state 47 {123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 48 {123, 57351, 57352, 57356, 57358, 57359, 57367, 57443, 57446, 57369, 57371, 57456, 57372, 57469, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 49 {123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 50 {57344, 40, 42, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 51 {123, 57441}, // state 52 {57429, 33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 53 {57344, 40, 42, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 54 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57437, 57438, 57439, 57354, 57356, 57357, 57358, 57359, 57360, 57441, 57362, 57363, 57366, 57367, 57443, 57446, 57369, 57371, 57456, 57460, 57461, 57462, 57464, 57372, 57373, 57374, 57469, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57478, 57479, 57384, 57385, 57386, 57480, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57487, 57491, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419, 57420}, // state 55 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 56 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 57 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 58 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 59 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 60 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 61 {33, 38, 40, 42, 43, 45, 123, 126, 57347, 57352, 57356, 57357, 57358, 57359, 57441, 57362, 57367, 57369, 57456, 57460, 57461, 57372, 57373, 57377, 57379, 57381, 57382, 57384, 57385, 57386, 57400, 57404, 57405, 57406, 57408, 57409, 57488, 57497, 57498, 57413, 57414, 57499, 57500, 57503, 57416, 57417, 57418, 57419}, // state 62 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 63 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 64 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 65 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 66 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 67 {37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 68 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 69 {37, 38, 40, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 94, 124, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 70 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 71 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 72 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 73 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 74 {41, 44, 59}, // state 75 {40, 42, 58, 59, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 76 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 77 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 78 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 79 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 80 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 81 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 82 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57442, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 83 {58}, // state 84 {125}, // state 85 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 86 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57437, 57354, 57356, 57357, 57358, 57359, 57360, 57441, 57362, 57363, 57366, 57367, 57443, 57446, 57369, 57371, 57456, 57460, 57461, 57462, 57464, 57372, 57373, 57374, 57469, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57478, 57479, 57384, 57385, 57386, 57480, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57487, 57491, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419, 57420}, // state 87 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 88 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 89 {59}, // state 90 {40}, // state 91 {40}, // state 92 {33, 38, 40, 42, 43, 45, 59, 123, 126, 57347, 57353, 57354, 57357, 57360, 57441, 57362, 57363, 57366, 57460, 57461, 57462, 57464, 57373, 57374, 57376, 57377, 57378, 57379, 57382, 57478, 57479, 57385, 57386, 57480, 57401, 57406, 57408, 57411, 57487, 57491, 57413, 57420}, // state 93 {40}, // state 94 {40}, // state 95 {59}, // state 96 {59}, // state 97 {57377}, // state 98 {33, 38, 40, 42, 43, 45, 59, 126, 57347, 57357, 57362, 57460, 57461, 57462, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 99 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 100 {59}, // state 101 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 102 {59}, // state 103 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 104 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 105 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 106 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57461, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 107 {41, 44}, // state 108 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 109 {33, 38, 40, 42, 43, 45, 59, 123, 126, 57347, 57353, 57354, 57357, 57360, 57441, 57362, 57363, 57366, 57460, 57461, 57462, 57464, 57373, 57374, 57376, 57377, 57378, 57379, 57382, 57478, 57479, 57385, 57386, 57480, 57401, 57406, 57408, 57411, 57487, 57491, 57413, 57420}, // state 110 {58}, // state 111 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 112 {33, 38, 40, 42, 43, 45, 59, 123, 126, 57347, 57353, 57354, 57357, 57360, 57441, 57362, 57363, 57366, 57460, 57461, 57462, 57464, 57373, 57374, 57376, 57377, 57378, 57379, 57382, 57478, 57479, 57385, 57386, 57480, 57401, 57406, 57408, 57411, 57487, 57491, 57413, 57420}, // state 113 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 114 {37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 115 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 116 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 117 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 118 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 119 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 120 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 121 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 122 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 123 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 124 {57377}, // state 125 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 126 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 127 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 128 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 129 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 130 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 131 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 132 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 133 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 134 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 135 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 136 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 137 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 138 {33, 38, 40, 41, 42, 43, 45, 126, 57347, 57435, 57436, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 139 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 140 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 141 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 142 {57377}, // state 143 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 144 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 145 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 146 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 147 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57461, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 148 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57461, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 149 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 150 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 151 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 152 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 153 {44, 93}, // state 154 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 155 {44, 58}, // state 156 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 157 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 158 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 159 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 160 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 161 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 162 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 163 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 164 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 165 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 166 {37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 60, 61, 62, 63, 91, 94, 124, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 167 {41, 44}, // state 168 {41}, // state 169 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 170 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 171 {37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 60, 61, 62, 63, 91, 94, 124, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 172 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 173 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 174 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 175 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 176 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 177 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 178 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 179 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 180 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 181 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 182 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 183 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 184 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 185 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 186 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 187 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 188 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 189 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 190 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 191 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 192 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 193 {33, 38, 40, 42, 43, 45, 59, 126, 57347, 57351, 57352, 57356, 57357, 57358, 57359, 57362, 57367, 57443, 57446, 57369, 57371, 57456, 57460, 57461, 57462, 57372, 57373, 57469, 57377, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57404, 57405, 57406, 57407, 57408, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 194 {33, 38, 40, 42, 43, 45, 59, 126, 57347, 57357, 57362, 57460, 57461, 57462, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 195 {59}, // state 196 {33, 38, 40, 42, 43, 45, 59, 126, 57347, 57357, 57362, 57460, 57461, 57462, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 197 {59}, // state 198 {33, 38, 40, 41, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57461, 57462, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 199 {41}, // state 200 {33, 38, 40, 42, 43, 45, 59, 123, 126, 57347, 57353, 57354, 57357, 57360, 57441, 57362, 57363, 57366, 57460, 57461, 57462, 57464, 57373, 57374, 57376, 57377, 57378, 57379, 57382, 57478, 57479, 57385, 57386, 57480, 57401, 57406, 57408, 57411, 57487, 57491, 57413, 57420}, // state 201 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 202 {59}, // state 203 {33, 38, 40, 41, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57461, 57462, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 204 {41}, // state 205 {33, 38, 40, 42, 43, 45, 59, 123, 126, 57347, 57353, 57354, 57357, 57360, 57441, 57362, 57363, 57366, 57460, 57461, 57462, 57464, 57373, 57374, 57376, 57377, 57378, 57379, 57382, 57478, 57479, 57385, 57386, 57480, 57401, 57406, 57408, 57411, 57487, 57491, 57413, 57420}, // state 206 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 207 {57420}, // state 208 {40}, // state 209 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57461, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 210 {41, 44}, // state 211 {59}, // state 212 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 213 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57461, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 214 {41, 44}, // state 215 {33, 38, 40, 42, 43, 45, 59, 123, 126, 57347, 57353, 57354, 57357, 57360, 57441, 57362, 57363, 57366, 57460, 57461, 57462, 57464, 57373, 57374, 57376, 57377, 57378, 57379, 57382, 57478, 57479, 57385, 57386, 57480, 57401, 57406, 57408, 57411, 57487, 57491, 57413, 57420}, // state 216 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 217 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57461, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 218 {41, 44}, // state 219 {33, 38, 40, 42, 43, 45, 59, 123, 126, 57347, 57353, 57354, 57357, 57360, 57441, 57362, 57363, 57366, 57460, 57461, 57462, 57464, 57373, 57374, 57376, 57377, 57378, 57379, 57382, 57478, 57479, 57385, 57386, 57480, 57401, 57406, 57408, 57411, 57487, 57491, 57413, 57420}, // state 220 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 221 {33, 38, 40, 42, 43, 45, 59, 123, 126, 57347, 57353, 57354, 57357, 57360, 57441, 57362, 57363, 57366, 57460, 57461, 57462, 57464, 57373, 57374, 57376, 57377, 57378, 57379, 57382, 57478, 57479, 57385, 57386, 57480, 57401, 57406, 57408, 57411, 57487, 57491, 57413, 57420}, // state 222 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 223 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 224 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 225 {57344, 33, 38, 40, 41, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 226 {33, 38, 40, 42, 43, 45, 59, 123, 126, 57347, 57353, 57354, 57357, 57360, 57441, 57362, 57363, 57366, 57460, 57461, 57462, 57464, 57373, 57374, 57376, 57377, 57378, 57379, 57382, 57478, 57479, 57385, 57386, 57480, 57401, 57406, 57408, 57411, 57487, 57491, 57413, 57420}, // state 227 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 228 {57344, 37, 38, 40, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 229 {58}, // state 230 {33, 38, 40, 42, 43, 45, 59, 123, 126, 57347, 57353, 57354, 57357, 57360, 57441, 57362, 57363, 57366, 57460, 57461, 57462, 57464, 57373, 57374, 57376, 57377, 57378, 57379, 57382, 57478, 57479, 57385, 57386, 57480, 57401, 57406, 57408, 57411, 57487, 57491, 57413, 57420}, // state 231 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 232 {33, 38, 40, 42, 43, 45, 59, 123, 126, 57347, 57353, 57354, 57357, 57360, 57441, 57362, 57363, 57366, 57460, 57461, 57462, 57464, 57373, 57374, 57376, 57377, 57378, 57379, 57382, 57478, 57479, 57385, 57386, 57480, 57401, 57406, 57408, 57411, 57487, 57491, 57413, 57420}, // state 233 {33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57368, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 234 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 235 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 236 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 237 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 238 {41}, // state 239 {41, 44}, // state 240 {41}, // state 241 {40, 41, 42, 58, 59, 91, 57352, 57356, 57358, 57359, 57367, 57369, 57456, 57372, 57377, 57381, 57384, 57400, 57404, 57405, 57409, 57488, 57489, 57497, 57498, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 242 {40, 41, 42, 58, 59, 91, 57352, 57356, 57358, 57359, 57367, 57369, 57456, 57372, 57377, 57381, 57384, 57400, 57404, 57405, 57409, 57488, 57489, 57497, 57498, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 243 {40, 41, 42, 91, 57433, 57434, 57485, 57486}, // state 244 {40, 41, 44, 91, 57377}, // state 245 {41}, // state 246 {40, 91, 57453, 57454}, // state 247 {41, 44}, // state 248 {40, 41, 44, 91}, // state 249 {40, 41, 42, 91, 57351, 57433, 57352, 57356, 57358, 57359, 57367, 57446, 57369, 57371, 57456, 57372, 57469, 57380, 57381, 57384, 57481, 57482, 57483, 57484, 57485, 57486, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 250 {91}, // state 251 {33, 38, 40, 42, 43, 45, 93, 126, 57347, 57357, 57359, 57362, 57460, 57463, 57373, 57377, 57379, 57382, 57385, 57386, 57400, 57406, 57407, 57408, 57500, 57501, 57419}, // state 252 {33, 38, 40, 42, 43, 45, 93, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 253 {37, 38, 40, 42, 43, 45, 46, 47, 60, 61, 62, 63, 91, 93, 94, 124, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 254 {33, 38, 40, 41, 42, 43, 44, 45, 91, 93, 126, 57347, 57357, 57359, 57362, 57373, 57377, 57379, 57382, 57385, 57386, 57400, 57406, 57407, 57408, 57419}, // state 255 {33, 38, 40, 42, 43, 45, 93, 126, 57347, 57357, 57359, 57362, 57460, 57463, 57373, 57377, 57379, 57382, 57385, 57386, 57400, 57406, 57407, 57408, 57500, 57419}, // state 256 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57359, 57362, 57373, 57377, 57379, 57382, 57385, 57386, 57400, 57406, 57408, 57500, 57501, 57502, 57419}, // state 257 {93}, // state 258 {40, 41, 44, 91}, // state 259 {33, 38, 40, 41, 42, 43, 44, 45, 91, 126, 57347, 57357, 57359, 57362, 57373, 57377, 57379, 57382, 57385, 57386, 57400, 57406, 57408, 57500, 57419}, // state 260 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 261 {37, 38, 40, 42, 43, 45, 46, 47, 60, 61, 62, 63, 91, 93, 94, 124, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 262 {40, 41, 44, 91}, // state 263 {33, 38, 40, 41, 42, 43, 44, 45, 91, 93, 126, 57347, 57357, 57359, 57362, 57373, 57377, 57379, 57382, 57385, 57386, 57400, 57406, 57407, 57408, 57419}, // state 264 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 265 {93}, // state 266 {40, 41, 44, 91}, // state 267 {37, 38, 40, 42, 43, 45, 46, 47, 60, 61, 62, 63, 91, 93, 94, 124, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 268 {40, 41, 44, 91}, // state 269 {40, 41, 44, 91}, // state 270 {41, 44}, // state 271 {41}, // state 272 {41, 44}, // state 273 {40, 41, 42, 44, 91, 57433, 57434, 57448, 57377, 57485, 57486}, // state 274 {41}, // state 275 {41}, // state 276 {40, 41, 44, 91}, // state 277 {40, 41, 44, 91}, // state 278 {40, 91, 57453, 57454, 57455, 57377}, // state 279 {41, 44}, // state 280 {41, 44}, // state 281 {40, 41, 44, 58, 59, 61, 91, 123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 282 {40, 41, 42, 91, 57351, 57433, 57352, 57356, 57358, 57359, 57367, 57446, 57448, 57369, 57371, 57456, 57372, 57469, 57377, 57380, 57381, 57384, 57481, 57482, 57483, 57484, 57485, 57486, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 283 {40, 41, 44, 58, 59, 61, 91, 123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 284 {41}, // state 285 {40, 41, 44, 58, 59, 61, 91, 123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 286 {57427, 57428, 41, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 287 {33, 38, 40, 42, 43, 45, 93, 126, 57347, 57357, 57359, 57362, 57373, 57377, 57379, 57382, 57385, 57386, 57400, 57406, 57407, 57408, 57500, 57501, 57502, 57419}, // state 288 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57359, 57362, 57373, 57377, 57379, 57382, 57385, 57386, 57400, 57406, 57408, 57500, 57501, 57502, 57419}, // state 289 {33, 38, 40, 42, 43, 45, 93, 126, 57347, 57357, 57359, 57362, 57373, 57377, 57379, 57382, 57385, 57386, 57400, 57406, 57407, 57408, 57500, 57419}, // state 290 {33, 38, 40, 42, 43, 45, 93, 126, 57347, 57357, 57362, 57460, 57463, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 291 {33, 38, 40, 42, 43, 45, 93, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 292 {93}, // state 293 {40, 41, 44, 58, 59, 61, 91, 123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 294 {40, 41, 44, 58, 59, 61, 91, 123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 295 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 296 {37, 38, 40, 42, 43, 45, 46, 47, 60, 61, 62, 63, 91, 93, 94, 124, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 297 {40, 41, 44, 58, 59, 61, 91, 123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 298 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 299 {37, 38, 40, 42, 43, 45, 46, 47, 60, 61, 62, 63, 91, 93, 94, 124, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 300 {40, 41, 44, 58, 59, 61, 91, 123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 301 {41, 57377, 57470, 57471}, // state 302 {57351, 57352, 57356, 57358, 57359, 57367, 57446, 57369, 57371, 57456, 57372, 57469, 57380, 57381, 57384, 57481, 57482, 57483, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 303 {41}, // state 304 {40, 41, 44, 58, 59, 61, 91, 123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 305 {41}, // state 306 {41, 44}, // state 307 {41, 44}, // state 308 {57377}, // state 309 {41, 44}, // state 310 {40, 41, 44, 58, 59, 61, 91, 123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 311 {57351, 57352, 57356, 57358, 57359, 57361, 57367, 57446, 57369, 57371, 57456, 57372, 57469, 57380, 57381, 57384, 57481, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 312 {41}, // state 313 {41, 44}, // state 314 {41, 57351, 57352, 57356, 57358, 57359, 57367, 57446, 57369, 57371, 57456, 57372, 57469, 57380, 57381, 57384, 57481, 57482, 57483, 57484, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 315 {41}, // state 316 {40, 41, 44, 91}, // state 317 {40, 41, 42, 58, 59, 91, 57377}, // state 318 {40, 41, 42, 58, 59, 91, 57377}, // state 319 {40, 41, 42, 58, 59, 91, 57377}, // state 320 {33, 38, 40, 42, 43, 45, 123, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 321 {33, 38, 40, 42, 43, 44, 45, 46, 91, 123, 125, 126, 57347, 57357, 57362, 57450, 57451, 57452, 57460, 57373, 57377, 57379, 57382, 57476, 57477, 57385, 57386, 57406, 57408}, // state 322 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 323 {44, 125, 57440}, // state 324 {37, 38, 40, 42, 43, 44, 45, 46, 47, 59, 60, 61, 62, 63, 91, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 325 {33, 38, 40, 42, 43, 44, 45, 46, 91, 123, 125, 126, 57347, 57357, 57362, 57450, 57451, 57452, 57460, 57373, 57377, 57379, 57382, 57476, 57477, 57385, 57386, 57406, 57408}, // state 326 {44, 125}, // state 327 {33, 38, 40, 42, 43, 45, 123, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57476, 57385, 57386, 57406, 57408}, // state 328 {46, 61, 91, 57451}, // state 329 {46, 61, 91}, // state 330 {57377}, // state 331 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57442, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 332 {93}, // state 333 {46, 61, 91}, // state 334 {46, 61, 91}, // state 335 {33, 38, 40, 42, 43, 45, 123, 126, 57347, 57357, 57362, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 336 {46, 61, 91}, // state 337 {44, 125}, // state 338 {44, 125, 57440}, // state 339 {33, 38, 40, 42, 43, 45, 46, 91, 123, 125, 126, 57347, 57357, 57362, 57450, 57451, 57452, 57460, 57373, 57377, 57379, 57382, 57476, 57385, 57386, 57406, 57408}, // state 340 {125}, // state 341 {44, 59, 125}, // state 342 {44, 125}, // state 343 {33, 38, 40, 42, 43, 45, 123, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57476, 57385, 57386, 57406, 57408}, // state 344 {44, 125}, // state 345 {125}, // state 346 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 347 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 348 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 349 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 350 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 351 {33, 38, 40, 42, 43, 45, 123, 126, 57347, 57352, 57356, 57357, 57358, 57359, 57441, 57362, 57367, 57369, 57456, 57460, 57461, 57372, 57373, 57377, 57379, 57381, 57382, 57384, 57385, 57386, 57400, 57404, 57405, 57406, 57408, 57409, 57488, 57497, 57498, 57413, 57414, 57499, 57500, 57503, 57416, 57417, 57418, 57419}, // state 352 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 353 {41}, // state 354 {57344, 33, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 123, 124, 125, 126, 57346, 57347, 57348, 57349, 57350, 57357, 57362, 57365, 57370, 57460, 57373, 57375, 57377, 57379, 57382, 57383, 57385, 57386, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57406, 57408, 57410, 57421}, // state 355 {33, 38, 40, 42, 43, 45, 123, 126, 57347, 57352, 57356, 57357, 57358, 57359, 57441, 57362, 57367, 57369, 57456, 57460, 57461, 57372, 57373, 57377, 57379, 57381, 57382, 57384, 57385, 57386, 57400, 57404, 57405, 57406, 57408, 57409, 57488, 57497, 57498, 57413, 57414, 57499, 57500, 57503, 57416, 57417, 57418, 57419}, // state 356 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 357 {41}, // state 358 {57344, 33, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 123, 124, 125, 126, 57346, 57347, 57348, 57349, 57350, 57357, 57362, 57365, 57370, 57460, 57373, 57375, 57377, 57379, 57382, 57383, 57385, 57386, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57406, 57408, 57410, 57421}, // state 359 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 360 {57344, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 94, 124, 125, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 361 {57422, 59}, // state 362 {44, 59}, // state 363 {44, 59}, // state 364 {44, 59, 61}, // state 365 {33, 38, 40, 42, 43, 45, 123, 126, 57347, 57357, 57362, 57460, 57373, 57377, 57379, 57382, 57476, 57385, 57386, 57406, 57408}, // state 366 {44, 59}, // state 367 {40, 42, 57448, 57377, 57473, 57485, 57486}, // state 368 {44, 59}, // state 369 {59}, // state 370 {57344, 33, 38, 40, 42, 43, 45, 59, 123, 125, 126, 57347, 57351, 57352, 57353, 57354, 57356, 57357, 57358, 57359, 57360, 57362, 57363, 57366, 57367, 57369, 57371, 57372, 57373, 57374, 57376, 57377, 57378, 57379, 57380, 57381, 57382, 57384, 57385, 57386, 57399, 57400, 57401, 57404, 57405, 57406, 57407, 57408, 57409, 57411, 57412, 57413, 57414, 57416, 57417, 57418, 57419, 57420}, // state 371 {40, 41, 42, 44, 91, 57377, 57485}, // state 372 {40, 41, 44, 91, 57377}, // state 373 {40, 42, 57448, 57377, 57485, 57486}, // state 374 {40, 41, 42, 44, 58, 59, 91, 123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 375 {123}, // state 376 {57457, 57458, 57459, 57377}, // state 377 {44, 61, 125}, // state 378 {44, 125, 57440}, // state 379 {44, 125}, // state 380 {44, 61, 125}, // state 381 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57442, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 382 {44, 125}, // state 383 {125, 57457, 57458, 57377}, // state 384 {125}, // state 385 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 386 {44, 125}, // state 387 {40, 41, 42, 44, 58, 59, 91, 123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 388 {123}, // state 389 {57424, 57425, 125, 57352, 57356, 57358, 57359, 57367, 57369, 57372, 57381, 57384, 57400, 57404, 57405, 57409, 57413, 57414, 57416, 57417, 57418, 57419}, // state 390 {125}, // state 391 {57352, 57356, 57358, 57359, 57367, 57369, 57456, 57372, 57381, 57384, 57400, 57404, 57405, 57409, 57488, 57493, 57494, 57497, 57498, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 392 {57426, 125, 57352, 57356, 57358, 57359, 57367, 57369, 57456, 57372, 57381, 57384, 57400, 57404, 57405, 57409, 57488, 57493, 57497, 57498, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 393 {125, 57352, 57356, 57358, 57359, 57367, 57369, 57372, 57381, 57384, 57400, 57404, 57405, 57409, 57413, 57414, 57416, 57417, 57418, 57419}, // state 394 {40, 42, 58, 59, 57448, 57449, 57377, 57485, 57486, 57495, 57496}, // state 395 {44, 59}, // state 396 {125, 57352, 57356, 57358, 57359, 57367, 57369, 57372, 57381, 57384, 57400, 57404, 57405, 57409, 57413, 57414, 57416, 57417, 57418, 57419}, // state 397 {44, 59}, // state 398 {44, 58, 59}, // state 399 {58}, // state 400 {33, 38, 40, 42, 43, 45, 126, 57347, 57357, 57442, 57362, 57460, 57373, 57377, 57379, 57382, 57385, 57386, 57406, 57408}, // state 401 {44, 59}, // state 402 {125, 57352, 57356, 57358, 57359, 57367, 57369, 57372, 57381, 57384, 57400, 57404, 57405, 57409, 57413, 57414, 57416, 57417, 57418, 57419}, // state 403 {40, 42, 58, 57448, 57449, 57377, 57485, 57486, 57495}, // state 404 {44, 59}, // state 405 {125}, // state 406 {125, 57352, 57356, 57358, 57359, 57367, 57369, 57372, 57381, 57384, 57400, 57404, 57405, 57409, 57413, 57414, 57416, 57417, 57418, 57419}, // state 407 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 408 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 409 {33, 38, 40, 42, 43, 45, 126, 57347, 57352, 57356, 57357, 57358, 57359, 57362, 57367, 57369, 57456, 57460, 57372, 57373, 57377, 57379, 57381, 57382, 57384, 57385, 57386, 57400, 57404, 57405, 57406, 57408, 57409, 57488, 57497, 57498, 57413, 57414, 57499, 57500, 57503, 57416, 57417, 57418, 57419}, // state 410 {37, 38, 40, 41, 42, 43, 45, 46, 47, 60, 61, 62, 63, 91, 94, 124, 57346, 57348, 57349, 57350, 57362, 57365, 57370, 57375, 57379, 57383, 57387, 57388, 57389, 57390, 57391, 57395, 57396, 57402, 57403, 57410, 57421}, // state 411 {41}, // state 412 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 413 {40, 41, 42, 44, 58, 59, 91, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 414 {40, 41, 42, 44, 59, 91, 57377}, // state 415 {40, 41, 42, 44, 59, 91, 57377}, // state 416 {40, 41, 42, 44, 59, 91, 57377}, // state 417 {40, 41, 42, 44, 59, 91, 57377}, // state 418 {40, 41, 42, 44, 59, 91, 57377}, // state 419 {57430, 44, 59, 61, 123, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 420 {123, 57351, 57352, 57356, 57358, 57359, 57367, 57443, 57444, 57445, 57446, 57369, 57371, 57456, 57372, 57469, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57492, 57497, 57498, 57412, 57413, 57414, 57500, 57503, 57416, 57417, 57418, 57419}, // state 421 {57423, 123, 57467}, // state 422 {57344, 40, 42, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 423 {57344, 40, 42, 57351, 57352, 57356, 57358, 57359, 57367, 57369, 57371, 57372, 57377, 57380, 57381, 57384, 57399, 57400, 57404, 57405, 57407, 57409, 57412, 57413, 57414, 57416, 57417, 57418, 57419}, // state 424 {57344}, // state 425 } yyXLAT = map[int]int{ 40: 0, // '(' (298x) 42: 1, // '*' (268x) 57377: 2, // IDENTIFIER (214x) 38: 3, // '&' (205x) 43: 4, // '+' (205x) 45: 5, // '-' (205x) 57362: 6, // DEC (205x) 57379: 7, // INC (205x) 59: 8, // ';' (191x) 41: 9, // ')' (177x) 44: 10, // ',' (175x) 91: 11, // '[' (156x) 33: 12, // '!' (135x) 126: 13, // '~' (135x) 57347: 14, // ALIGNOF (135x) 57357: 15, // CHARCONST (135x) 57373: 16, // FLOATCONST (135x) 57382: 17, // INTCONST (135x) 57385: 18, // LONGCHARCONST (135x) 57386: 19, // LONGSTRINGLITERAL (135x) 57406: 20, // SIZEOF (135x) 57408: 21, // STRINGLITERAL (135x) 57413: 22, // TYPEDEF_NAME (122x) 125: 23, // '}' (121x) 57359: 24, // CONST (121x) 57400: 25, // RESTRICT (121x) 57419: 26, // VOLATILE (121x) 57352: 27, // BOOL (111x) 57356: 28, // CHAR (111x) 57358: 29, // COMPLEX (111x) 57367: 30, // DOUBLE (111x) 57369: 31, // ENUM (111x) 57372: 32, // FLOAT (111x) 57381: 33, // INT (111x) 57384: 34, // LONG (111x) 57404: 35, // SHORT (111x) 57405: 36, // SIGNED (111x) 57409: 37, // STRUCT (111x) 57414: 38, // TYPEOF (111x) 57416: 39, // UNION (111x) 57417: 40, // UNSIGNED (111x) 57418: 41, // VOID (111x) 58: 42, // ':' (110x) 57407: 43, // STATIC (104x) 57351: 44, // AUTO (98x) 57371: 45, // EXTERN (98x) 57380: 46, // INLINE (98x) 57399: 47, // REGISTER (98x) 57412: 48, // TYPEDEF (98x) 57460: 49, // Expr (95x) 61: 50, // '=' (90x) 93: 51, // ']' (84x) 123: 52, // '{' (82x) 46: 53, // '.' (80x) 57344: 54, // $end (72x) 37: 55, // '%' (72x) 47: 56, // '/' (72x) 60: 57, // '<' (72x) 62: 58, // '>' (72x) 63: 59, // '?' (72x) 94: 60, // '^' (72x) 124: 61, // '|' (72x) 57346: 62, // ADDASSIGN (72x) 57348: 63, // ANDAND (72x) 57349: 64, // ANDASSIGN (72x) 57350: 65, // ARROW (72x) 57365: 66, // DIVASSIGN (72x) 57370: 67, // EQ (72x) 57375: 68, // GEQ (72x) 57383: 69, // LEQ (72x) 57387: 70, // LSH (72x) 57388: 71, // LSHASSIGN (72x) 57389: 72, // MODASSIGN (72x) 57390: 73, // MULASSIGN (72x) 57391: 74, // NEQ (72x) 57395: 75, // ORASSIGN (72x) 57396: 76, // OROR (72x) 57402: 77, // RSH (72x) 57403: 78, // RSHASSIGN (72x) 57410: 79, // SUBASSIGN (72x) 57421: 80, // XORASSIGN (72x) 57420: 81, // WHILE (43x) 57353: 82, // BREAK (42x) 57354: 83, // CASE (42x) 57360: 84, // CONTINUE (42x) 57363: 85, // DEFAULT (42x) 57366: 86, // DO (42x) 57374: 87, // FOR (42x) 57376: 88, // GOTO (42x) 57378: 89, // IF (42x) 57401: 90, // RETURN (42x) 57411: 91, // SWITCH (42x) 57500: 92, // TypeQualifier (33x) 57461: 93, // ExprList (28x) 57456: 94, // EnumSpecifier (25x) 57497: 95, // StructOrUnion (25x) 57498: 96, // StructOrUnionSpecifier (25x) 57503: 97, // TypeSpecifier (25x) 57368: 98, // ELSE (23x) 57462: 99, // ExprListOpt (19x) 57441: 100, // CompoundStmt (17x) 57446: 101, // DeclarationSpecifiers (17x) 57469: 102, // FunctionSpecifier (17x) 57492: 103, // StorageClassSpecifier (17x) 57464: 104, // ExprStmt (13x) 57478: 105, // IterationStmt (13x) 57479: 106, // JumpStmt (13x) 57480: 107, // LabeledStmt (13x) 57485: 108, // Pointer (13x) 57487: 109, // SelectionStmt (13x) 57491: 110, // Stmt (13x) 57486: 111, // PointerOpt (12x) 57448: 112, // Declarator (10x) 57443: 113, // Declaration (8x) 57488: 114, // SpecifierQualifierList (8x) 57476: 115, // Initializer (6x) 57442: 116, // ConstExpr (5x) 57481: 117, // ParameterDeclaration (5x) 57501: 118, // TypeQualifierList (5x) 57433: 119, // AbstractDeclarator (4x) 57447: 120, // DeclarationSpecifiersOpt (4x) 57451: 121, // Designator (4x) 57482: 122, // ParameterList (4x) 57483: 123, // ParameterTypeList (4x) 57499: 124, // TypeName (4x) 57502: 125, // TypeQualifierListOpt (4x) 57440: 126, // CommaOpt (3x) 57450: 127, // Designation (3x) 57452: 128, // DesignatorList (3x) 57463: 129, // ExprOpt (3x) 57473: 130, // InitDeclarator (3x) 57484: 131, // ParameterTypeListOpt (3x) 57423: 132, // $@10 (2x) 57434: 133, // AbstractDeclaratorOpt (2x) 57437: 134, // BlockItem (2x) 57444: 135, // DeclarationList (2x) 57445: 136, // DeclarationListOpt (2x) 57449: 137, // DeclaratorOpt (2x) 57453: 138, // DirectAbstractDeclarator (2x) 57454: 139, // DirectAbstractDeclaratorOpt (2x) 57455: 140, // DirectDeclarator (2x) 57457: 141, // EnumerationConstant (2x) 57458: 142, // Enumerator (2x) 57465: 143, // ExternalDeclaration (2x) 57467: 144, // FunctionBody (2x) 57468: 145, // FunctionDefinition (2x) 57472: 146, // IdentifierOpt (2x) 57474: 147, // InitDeclaratorList (2x) 57475: 148, // InitDeclaratorListOpt (2x) 57477: 149, // InitializerList (2x) 57489: 150, // SpecifierQualifierListOpt (2x) 57493: 151, // StructDeclaration (2x) 57495: 152, // StructDeclarator (2x) 57422: 153, // $@1 (1x) 57424: 154, // $@2 (1x) 57425: 155, // $@3 (1x) 57426: 156, // $@4 (1x) 57427: 157, // $@5 (1x) 57428: 158, // $@6 (1x) 57429: 159, // $@7 (1x) 57430: 160, // $@8 (1x) 57431: 161, // $@9 (1x) 57435: 162, // ArgumentExprList (1x) 57436: 163, // ArgumentExprListOpt (1x) 57438: 164, // BlockItemList (1x) 57439: 165, // BlockItemListOpt (1x) 1048576: 166, // CONSTANT_EXPRESSION (1x) 57361: 167, // DDD (1x) 57459: 168, // EnumeratorList (1x) 57466: 169, // ExternalDeclarationList (1x) 57470: 170, // IdentifierList (1x) 57471: 171, // IdentifierListOpt (1x) 57490: 172, // Start (1x) 57494: 173, // StructDeclarationList (1x) 57496: 174, // StructDeclaratorList (1x) 1048577: 175, // TRANSLATION_UNIT (1x) 57432: 176, // $default (0x) 57355: 177, // CAST (0x) 57364: 178, // DIRECTIVE (0x) 57345: 179, // error (0x) 57392: 180, // NOELSE (0x) 57393: 181, // NON_REPL (0x) 57394: 182, // NOSEMI (0x) 57397: 183, // PPNUMBER (0x) 57398: 184, // PPPASTE (0x) 57415: 185, // UNARY (0x) 57504: 186, // VolatileOpt (0x) } yySymNames = []string{ "'('", "'*'", "IDENTIFIER", "'&'", "'+'", "'-'", "DEC", "INC", "';'", "')'", "','", "'['", "'!'", "'~'", "ALIGNOF", "CHARCONST", "FLOATCONST", "INTCONST", "LONGCHARCONST", "LONGSTRINGLITERAL", "SIZEOF", "STRINGLITERAL", "TYPEDEF_NAME", "'}'", "CONST", "RESTRICT", "VOLATILE", "BOOL", "CHAR", "COMPLEX", "DOUBLE", "ENUM", "FLOAT", "INT", "LONG", "SHORT", "SIGNED", "STRUCT", "TYPEOF", "UNION", "UNSIGNED", "VOID", "':'", "STATIC", "AUTO", "EXTERN", "INLINE", "REGISTER", "TYPEDEF", "Expr", "'='", "']'", "'{'", "'.'", "$end", "'%'", "'/'", "'<'", "'>'", "'?'", "'^'", "'|'", "ADDASSIGN", "ANDAND", "ANDASSIGN", "ARROW", "DIVASSIGN", "EQ", "GEQ", "LEQ", "LSH", "LSHASSIGN", "MODASSIGN", "MULASSIGN", "NEQ", "ORASSIGN", "OROR", "RSH", "RSHASSIGN", "SUBASSIGN", "XORASSIGN", "WHILE", "BREAK", "CASE", "CONTINUE", "DEFAULT", "DO", "FOR", "GOTO", "IF", "RETURN", "SWITCH", "TypeQualifier", "ExprList", "EnumSpecifier", "StructOrUnion", "StructOrUnionSpecifier", "TypeSpecifier", "ELSE", "ExprListOpt", "CompoundStmt", "DeclarationSpecifiers", "FunctionSpecifier", "StorageClassSpecifier", "ExprStmt", "IterationStmt", "JumpStmt", "LabeledStmt", "Pointer", "SelectionStmt", "Stmt", "PointerOpt", "Declarator", "Declaration", "SpecifierQualifierList", "Initializer", "ConstExpr", "ParameterDeclaration", "TypeQualifierList", "AbstractDeclarator", "DeclarationSpecifiersOpt", "Designator", "ParameterList", "ParameterTypeList", "TypeName", "TypeQualifierListOpt", "CommaOpt", "Designation", "DesignatorList", "ExprOpt", "InitDeclarator", "ParameterTypeListOpt", "$@10", "AbstractDeclaratorOpt", "BlockItem", "DeclarationList", "DeclarationListOpt", "DeclaratorOpt", "DirectAbstractDeclarator", "DirectAbstractDeclaratorOpt", "DirectDeclarator", "EnumerationConstant", "Enumerator", "ExternalDeclaration", "FunctionBody", "FunctionDefinition", "IdentifierOpt", "InitDeclaratorList", "InitDeclaratorListOpt", "InitializerList", "SpecifierQualifierListOpt", "StructDeclaration", "StructDeclarator", "$@1", "$@2", "$@3", "$@4", "$@5", "$@6", "$@7", "$@8", "$@9", "ArgumentExprList", "ArgumentExprListOpt", "BlockItemList", "BlockItemListOpt", "CONSTANT_EXPRESSION", "DDD", "EnumeratorList", "ExternalDeclarationList", "IdentifierList", "IdentifierListOpt", "Start", "StructDeclarationList", "StructDeclaratorList", "TRANSLATION_UNIT", "$default", "CAST", "DIRECTIVE", "error", "NOELSE", "NON_REPL", "NOSEMI", "PPNUMBER", "PPPASTE", "UNARY", "VolatileOpt", } yyTokenLiteralStrings = map[int]string{ 57377: "identifier", 57362: "--", 57379: "++", 57347: "__alignof__", 57357: "character constant", 57373: "floating-point constant", 57382: "integer constant", 57385: "long character constant", 57386: "long string constant", 57406: "sizeof", 57408: "string literal", 57413: "typedef name", 57359: "const", 57400: "restrict", 57419: "volatile", 57352: "_Bool", 57356: "char", 57358: "_Complex", 57367: "double", 57369: "enum", 57372: "float", 57381: "int", 57384: "long", 57404: "short", 57405: "signed", 57409: "struct", 57414: "typeof", 57416: "union", 57417: "unsigned", 57418: "void", 57407: "static", 57351: "auto", 57371: "extern", 57380: "inline", 57399: "register", 57412: "typedef", 57346: "+=", 57348: "&&", 57349: "&=", 57350: "->", 57365: "/=", 57370: "==", 57375: ">=", 57383: "<=", 57387: "<<", 57388: "<<=", 57389: "%=", 57390: "*=", 57391: "!=", 57395: "|=", 57396: "||", 57402: ">>", 57403: ">>=", 57410: "-=", 57421: "^=", 57420: "while", 57353: "break", 57354: "case", 57360: "continue", 57363: "default", 57366: "do", 57374: "for", 57376: "goto", 57378: "if", 57401: "return", 57411: "switch", 57368: "else", 1048576: "constant expression prefix", 57361: "...", 1048577: "translation unit prefix", 57397: "preprocessing number", 57398: "##", } yyReductions = map[int]struct{ xsym, components int }{ 0: {0, 1}, 1: {172, 2}, 2: {172, 2}, 3: {141, 1}, 4: {162, 1}, 5: {162, 3}, 6: {163, 0}, 7: {163, 1}, 8: {49, 2}, 9: {49, 2}, 10: {49, 4}, 11: {49, 2}, 12: {49, 4}, 13: {49, 2}, 14: {49, 2}, 15: {49, 2}, 16: {49, 3}, 17: {49, 3}, 18: {49, 7}, 19: {49, 4}, 20: {49, 2}, 21: {49, 2}, 22: {49, 2}, 23: {49, 2}, 24: {49, 1}, 25: {49, 3}, 26: {49, 3}, 27: {49, 3}, 28: {49, 3}, 29: {49, 3}, 30: {49, 2}, 31: {49, 3}, 32: {49, 2}, 33: {49, 3}, 34: {49, 3}, 35: {49, 3}, 36: {49, 3}, 37: {49, 3}, 38: {49, 3}, 39: {49, 3}, 40: {49, 3}, 41: {49, 3}, 42: {49, 3}, 43: {49, 3}, 44: {49, 3}, 45: {49, 3}, 46: {49, 3}, 47: {49, 3}, 48: {49, 4}, 49: {49, 3}, 50: {49, 3}, 51: {49, 3}, 52: {49, 3}, 53: {49, 3}, 54: {49, 3}, 55: {49, 3}, 56: {49, 3}, 57: {49, 5}, 58: {49, 4}, 59: {49, 3}, 60: {49, 3}, 61: {49, 1}, 62: {49, 1}, 63: {49, 1}, 64: {49, 1}, 65: {49, 1}, 66: {49, 1}, 67: {129, 0}, 68: {129, 1}, 69: {93, 1}, 70: {93, 3}, 71: {99, 0}, 72: {99, 1}, 73: {116, 1}, 74: {153, 0}, 75: {113, 4}, 76: {101, 2}, 77: {101, 2}, 78: {101, 2}, 79: {101, 2}, 80: {120, 0}, 81: {120, 1}, 82: {147, 1}, 83: {147, 3}, 84: {148, 0}, 85: {148, 1}, 86: {130, 1}, 87: {130, 3}, 88: {103, 1}, 89: {103, 1}, 90: {103, 1}, 91: {103, 1}, 92: {103, 1}, 93: {97, 1}, 94: {97, 1}, 95: {97, 1}, 96: {97, 1}, 97: {97, 1}, 98: {97, 1}, 99: {97, 1}, 100: {97, 1}, 101: {97, 1}, 102: {97, 1}, 103: {97, 1}, 104: {97, 1}, 105: {97, 1}, 106: {97, 1}, 107: {97, 4}, 108: {97, 4}, 109: {96, 2}, 110: {154, 0}, 111: {96, 5}, 112: {155, 0}, 113: {156, 0}, 114: {96, 7}, 115: {95, 1}, 116: {95, 1}, 117: {173, 1}, 118: {173, 2}, 119: {151, 3}, 120: {151, 2}, 121: {114, 2}, 122: {114, 2}, 123: {150, 0}, 124: {150, 1}, 125: {174, 1}, 126: {174, 3}, 127: {152, 1}, 128: {152, 3}, 129: {126, 0}, 130: {126, 1}, 131: {94, 2}, 132: {94, 6}, 133: {168, 1}, 134: {168, 3}, 135: {142, 1}, 136: {142, 3}, 137: {92, 1}, 138: {92, 1}, 139: {92, 1}, 140: {102, 1}, 141: {112, 2}, 142: {137, 0}, 143: {137, 1}, 144: {140, 3}, 145: {157, 0}, 146: {140, 5}, 147: {158, 0}, 148: {140, 5}, 149: {140, 6}, 150: {140, 6}, 151: {140, 5}, 152: {140, 5}, 153: {140, 1}, 154: {108, 2}, 155: {108, 3}, 156: {111, 0}, 157: {111, 1}, 158: {118, 1}, 159: {118, 2}, 160: {125, 0}, 161: {125, 1}, 162: {123, 1}, 163: {123, 3}, 164: {131, 0}, 165: {131, 1}, 166: {122, 1}, 167: {122, 3}, 168: {117, 2}, 169: {117, 2}, 170: {170, 1}, 171: {170, 3}, 172: {171, 0}, 173: {171, 1}, 174: {146, 0}, 175: {146, 1}, 176: {124, 2}, 177: {119, 1}, 178: {119, 2}, 179: {133, 0}, 180: {133, 1}, 181: {138, 3}, 182: {138, 3}, 183: {138, 4}, 184: {138, 6}, 185: {138, 4}, 186: {138, 4}, 187: {138, 6}, 188: {138, 5}, 189: {139, 0}, 190: {139, 1}, 191: {115, 4}, 192: {115, 1}, 193: {149, 0}, 194: {149, 1}, 195: {149, 2}, 196: {149, 3}, 197: {149, 4}, 198: {127, 2}, 199: {128, 1}, 200: {128, 2}, 201: {121, 2}, 202: {121, 3}, 203: {110, 1}, 204: {110, 1}, 205: {110, 1}, 206: {110, 1}, 207: {110, 1}, 208: {110, 1}, 209: {107, 4}, 210: {107, 3}, 211: {107, 3}, 212: {107, 3}, 213: {159, 0}, 214: {100, 4}, 215: {164, 1}, 216: {164, 2}, 217: {165, 0}, 218: {165, 1}, 219: {134, 1}, 220: {134, 1}, 221: {104, 2}, 222: {109, 7}, 223: {109, 5}, 224: {109, 5}, 225: {105, 7}, 226: {105, 8}, 227: {105, 9}, 228: {105, 5}, 229: {106, 2}, 230: {106, 2}, 231: {106, 3}, 232: {106, 3}, 233: {169, 1}, 234: {169, 2}, 235: {143, 1}, 236: {143, 1}, 237: {160, 0}, 238: {145, 5}, 239: {161, 0}, 240: {145, 4}, 241: {132, 0}, 242: {144, 2}, 243: {135, 1}, 244: {135, 2}, 245: {136, 0}, 246: {136, 1}, 247: {186, 0}, 248: {186, 1}, } yyXErrors = map[yyXError]string{ {0, 54}: "invalid empty input", {1, -1}: "expected $end", {425, -1}: "expected $end", {29, -1}: "expected '('", {91, -1}: "expected '('", {92, -1}: "expected '('", {94, -1}: "expected '('", {95, -1}: "expected '('", {209, -1}: "expected '('", {169, -1}: "expected ')'", {200, -1}: "expected ')'", {205, -1}: "expected ')'", {239, -1}: "expected ')'", {241, -1}: "expected ')'", {246, -1}: "expected ')'", {272, -1}: "expected ')'", {275, -1}: "expected ')'", {276, -1}: "expected ')'", {285, -1}: "expected ')'", {304, -1}: "expected ')'", {306, -1}: "expected ')'", {313, -1}: "expected ')'", {316, -1}: "expected ')'", {354, -1}: "expected ')'", {358, -1}: "expected ')'", {412, -1}: "expected ')'", {84, -1}: "expected ':'", {111, -1}: "expected ':'", {230, -1}: "expected ':'", {400, -1}: "expected ':'", {90, -1}: "expected ';'", {96, -1}: "expected ';'", {97, -1}: "expected ';'", {101, -1}: "expected ';'", {103, -1}: "expected ';'", {196, -1}: "expected ';'", {198, -1}: "expected ';'", {203, -1}: "expected ';'", {212, -1}: "expected ';'", {362, -1}: "expected ';'", {370, -1}: "expected ';'", {251, -1}: "expected '['", {258, -1}: "expected ']'", {266, -1}: "expected ']'", {293, -1}: "expected ']'", {333, -1}: "expected ']'", {376, -1}: "expected '{'", {389, -1}: "expected '{'", {85, -1}: "expected '}'", {341, -1}: "expected '}'", {346, -1}: "expected '}'", {385, -1}: "expected '}'", {391, -1}: "expected '}'", {406, -1}: "expected '}'", {0, -1}: "expected Start or one of [constant expression prefix, translation unit prefix]", {283, -1}: "expected abstract declarator or declarator or optional parameter type list or one of ['(', ')', '*', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {250, -1}: "expected abstract declarator or optional parameter type list or one of ['(', ')', '*', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {87, -1}: "expected block item or one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {52, -1}: "expected compound statement or '{'", {62, -1}: "expected compound statement or expression list or type name or one of ['!', '&', '(', '*', '+', '-', '{', '~', ++, --, _Bool, _Complex, __alignof__, char, character constant, const, double, enum, float, floating-point constant, identifier, int, integer constant, long, long character constant, long string constant, restrict, short, signed, sizeof, string literal, struct, typedef name, typeof, union, unsigned, void, volatile]", {352, -1}: "expected compound statement or expression list or type name or one of ['!', '&', '(', '*', '+', '-', '{', '~', ++, --, _Bool, _Complex, __alignof__, char, character constant, const, double, enum, float, floating-point constant, identifier, int, integer constant, long, long character constant, long string constant, restrict, short, signed, sizeof, string literal, struct, typedef name, typeof, union, unsigned, void, volatile]", {356, -1}: "expected compound statement or expression list or type name or one of ['!', '&', '(', '*', '+', '-', '{', '~', ++, --, _Bool, _Complex, __alignof__, char, character constant, const, double, enum, float, floating-point constant, identifier, int, integer constant, long, long character constant, long string constant, restrict, short, signed, sizeof, string literal, struct, typedef name, typeof, union, unsigned, void, volatile]", {2, -1}: "expected constant expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {83, -1}: "expected constant expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {332, -1}: "expected constant expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {382, -1}: "expected constant expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {401, -1}: "expected constant expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {49, -1}: "expected declaration or one of ['{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {194, -1}: "expected declaration or optional expression list or one of ['!', '&', '(', '*', '+', '-', ';', '~', ++, --, _Bool, _Complex, __alignof__, auto, char, character constant, const, double, enum, extern, float, floating-point constant, identifier, inline, int, integer constant, long, long character constant, long string constant, register, restrict, short, signed, sizeof, static, string literal, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {374, -1}: "expected declarator or one of ['(', '*', identifier]", {274, -1}: "expected declarator or optional abstract declarator or one of ['(', ')', '*', ',', '[', identifier]", {5, -1}: "expected declarator or optional init declarator list or one of ['(', '*', ';', identifier]", {340, -1}: "expected designation or initializer or one of ['!', '&', '(', '*', '+', '-', '.', '[', '{', '}', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {329, -1}: "expected designator or one of ['.', '=', '[']", {279, -1}: "expected direct abstract declarator or direct declarator or one of ['(', '[', identifier]", {247, -1}: "expected direct abstract declarator or one of ['(', '[']", {38, -1}: "expected direct declarator or one of ['(', identifier]", {377, -1}: "expected enumerator list or identifier", {384, -1}: "expected enumerator or one of ['}', identifier]", {107, -1}: "expected expression list or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {148, -1}: "expected expression list or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {149, -1}: "expected expression list or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {210, -1}: "expected expression list or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {214, -1}: "expected expression list or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {218, -1}: "expected expression list or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {355, -1}: "expected expression or one of [!=, $end, %=, &&, &=, '!', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '{', '|', '}', '~', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal, |=, ||]", {359, -1}: "expected expression or one of [!=, $end, %=, &&, &=, '!', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '{', '|', '}', '~', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal, |=, ||]", {253, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', ']', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {292, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', ']', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {321, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '{', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {56, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {57, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {58, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {59, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {60, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {61, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {63, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {64, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {65, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {66, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {109, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {116, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {117, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {118, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {119, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {120, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {122, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {124, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {126, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {127, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {128, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {129, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {130, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {131, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {132, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {133, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {134, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {135, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {136, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {137, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {138, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {140, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {141, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {142, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {144, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {145, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {146, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {147, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {150, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {151, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {157, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {171, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {261, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {265, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {296, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {299, -1}: "expected expression or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {257, -1}: "expected expression or optional type qualifier list or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, string literal, volatile]", {289, -1}: "expected expression or optional type qualifier list or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, __alignof__, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, string literal, volatile]", {410, -1}: "expected expression or type name or one of ['!', '&', '(', '*', '+', '-', '~', ++, --, _Bool, _Complex, __alignof__, char, character constant, const, double, enum, float, floating-point constant, identifier, int, integer constant, long, long character constant, long string constant, restrict, short, signed, sizeof, string literal, struct, typedef name, typeof, union, unsigned, void, volatile]", {3, -1}: "expected external declaration list or one of ['(', '*', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {4, -1}: "expected external declaration or one of [$end, '(', '*', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {47, -1}: "expected function body or '{'", {422, -1}: "expected function body or '{'", {420, -1}: "expected function body or optional declaration list or one of [',', ';', '=', '{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {44, -1}: "expected function body or optional declaration list or one of ['{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {45, -1}: "expected function body or optional declaration list or one of ['{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {421, -1}: "expected function body or optional declaration list or one of ['{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {98, -1}: "expected identifier", {125, -1}: "expected identifier", {143, -1}: "expected identifier", {309, -1}: "expected identifier", {331, -1}: "expected identifier", {368, -1}: "expected init declarator or one of ['(', '*', identifier]", {322, -1}: "expected initializer list or optional comma or one of ['!', '&', '(', '*', '+', ',', '-', '.', '[', '{', '}', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {326, -1}: "expected initializer list or optional comma or one of ['!', '&', '(', '*', '+', ',', '-', '.', '[', '{', '}', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {328, -1}: "expected initializer or one of ['!', '&', '(', '*', '+', '-', '{', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {344, -1}: "expected initializer or one of ['!', '&', '(', '*', '+', '-', '{', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {366, -1}: "expected initializer or one of ['!', '&', '(', '*', '+', '-', '{', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {67, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {69, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {71, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {72, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {73, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {74, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {100, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {121, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {123, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {152, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {153, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {155, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {158, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {159, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {160, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {161, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {162, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {163, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {164, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {165, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {166, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {170, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {173, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {174, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {175, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {176, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {177, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {178, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {179, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {180, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {181, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {182, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {183, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {184, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {185, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {186, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {187, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {188, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {189, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {190, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {191, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {192, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {193, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {235, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {236, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {237, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {238, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {323, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {347, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {348, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {349, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {350, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {351, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {353, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {357, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {360, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {361, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {229, -1}: "expected one of [!=, $end, %=, &&, &=, '%', '&', '(', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {68, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {115, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {167, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', '<', '=', '>', '?', '[', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {172, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', '<', '=', '>', '?', '[', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {411, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', ')', '*', '+', '-', '.', '/', '<', '=', '>', '?', '[', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {70, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '[', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {325, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', ',', '-', '.', '/', ';', '<', '=', '>', '?', '[', '^', '|', '}', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {254, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', '-', '.', '/', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {262, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', '-', '.', '/', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {268, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', '-', '.', '/', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {297, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', '-', '.', '/', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {300, -1}: "expected one of [!=, %=, &&, &=, '%', '&', '(', '*', '+', '-', '.', '/', '<', '=', '>', '?', '[', ']', '^', '|', *=, ++, +=, --, -=, ->, /=, <<, <<=, <=, ==, >=, >>, >>=, ^=, |=, ||]", {226, -1}: "expected one of [$end, '!', '&', '(', ')', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {371, -1}: "expected one of [$end, '!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {41, -1}: "expected one of [$end, '(', '*', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {42, -1}: "expected one of [$end, '(', '*', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {43, -1}: "expected one of [$end, '(', '*', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {51, -1}: "expected one of [$end, '(', '*', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {54, -1}: "expected one of [$end, '(', '*', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {423, -1}: "expected one of [$end, '(', '*', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {424, -1}: "expected one of [$end, '(', '*', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {34, -1}: "expected one of ['!', '&', '(', ')', '*', '+', ',', '-', ':', ';', '[', ']', '~', ++, --, _Bool, _Complex, __alignof__, auto, char, character constant, const, double, enum, extern, float, floating-point constant, identifier, inline, int, integer constant, long, long character constant, long string constant, register, restrict, short, signed, sizeof, static, string literal, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {35, -1}: "expected one of ['!', '&', '(', ')', '*', '+', ',', '-', ':', ';', '[', ']', '~', ++, --, _Bool, _Complex, __alignof__, auto, char, character constant, const, double, enum, extern, float, floating-point constant, identifier, inline, int, integer constant, long, long character constant, long string constant, register, restrict, short, signed, sizeof, static, string literal, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {36, -1}: "expected one of ['!', '&', '(', ')', '*', '+', ',', '-', ':', ';', '[', ']', '~', ++, --, _Bool, _Complex, __alignof__, auto, char, character constant, const, double, enum, extern, float, floating-point constant, identifier, inline, int, integer constant, long, long character constant, long string constant, register, restrict, short, signed, sizeof, static, string literal, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {255, -1}: "expected one of ['!', '&', '(', ')', '*', '+', ',', '-', '[', ']', '~', ++, --, __alignof__, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, static, string literal, volatile]", {264, -1}: "expected one of ['!', '&', '(', ')', '*', '+', ',', '-', '[', ']', '~', ++, --, __alignof__, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, static, string literal, volatile]", {77, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {78, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {79, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {80, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {81, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {82, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {102, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {104, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {105, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {106, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {112, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {114, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {202, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {207, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {213, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {217, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {221, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {223, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {224, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {228, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {232, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {234, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, else, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {86, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {88, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {89, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {225, -1}: "expected one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {336, -1}: "expected one of ['!', '&', '(', '*', '+', '-', '{', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {375, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', '{', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {388, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', '{', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {15, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {16, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {17, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {18, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {19, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {20, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {21, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {22, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {23, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {24, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {25, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {26, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {27, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {28, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {386, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {408, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {409, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {413, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {414, -1}: "expected one of ['(', ')', '*', ',', ':', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {10, -1}: "expected one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {11, -1}: "expected one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {12, -1}: "expected one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {13, -1}: "expected one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {14, -1}: "expected one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {37, -1}: "expected one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {415, -1}: "expected one of ['(', ')', '*', ',', ';', '[', identifier]", {416, -1}: "expected one of ['(', ')', '*', ',', ';', '[', identifier]", {417, -1}: "expected one of ['(', ')', '*', ',', ';', '[', identifier]", {418, -1}: "expected one of ['(', ')', '*', ',', ';', '[', identifier]", {419, -1}: "expected one of ['(', ')', '*', ',', ';', '[', identifier]", {318, -1}: "expected one of ['(', ')', '*', ':', ';', '[', identifier]", {319, -1}: "expected one of ['(', ')', '*', ':', ';', '[', identifier]", {320, -1}: "expected one of ['(', ')', '*', ':', ';', '[', identifier]", {282, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {284, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {286, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {294, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {295, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {298, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {301, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {305, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {311, -1}: "expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {245, -1}: "expected one of ['(', ')', ',', '[', identifier]", {373, -1}: "expected one of ['(', ')', ',', '[', identifier]", {249, -1}: "expected one of ['(', ')', ',', '[']", {259, -1}: "expected one of ['(', ')', ',', '[']", {263, -1}: "expected one of ['(', ')', ',', '[']", {267, -1}: "expected one of ['(', ')', ',', '[']", {269, -1}: "expected one of ['(', ')', ',', '[']", {270, -1}: "expected one of ['(', ')', ',', '[']", {277, -1}: "expected one of ['(', ')', ',', '[']", {278, -1}: "expected one of ['(', ')', ',', '[']", {317, -1}: "expected one of ['(', ')', ',', '[']", {76, -1}: "expected one of ['(', '*', ':', ';', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {40, -1}: "expected one of ['(', identifier]", {75, -1}: "expected one of [')', ',', ';']", {108, -1}: "expected one of [')', ',']", {168, -1}: "expected one of [')', ',']", {211, -1}: "expected one of [')', ',']", {215, -1}: "expected one of [')', ',']", {219, -1}: "expected one of [')', ',']", {240, -1}: "expected one of [')', ',']", {248, -1}: "expected one of [')', ',']", {271, -1}: "expected one of [')', ',']", {273, -1}: "expected one of [')', ',']", {280, -1}: "expected one of [')', ',']", {281, -1}: "expected one of [')', ',']", {307, -1}: "expected one of [')', ',']", {308, -1}: "expected one of [')', ',']", {310, -1}: "expected one of [')', ',']", {314, -1}: "expected one of [')', ',']", {399, -1}: "expected one of [',', ':', ';']", {156, -1}: "expected one of [',', ':']", {365, -1}: "expected one of [',', ';', '=']", {342, -1}: "expected one of [',', ';', '}']", {363, -1}: "expected one of [',', ';']", {364, -1}: "expected one of [',', ';']", {367, -1}: "expected one of [',', ';']", {369, -1}: "expected one of [',', ';']", {396, -1}: "expected one of [',', ';']", {398, -1}: "expected one of [',', ';']", {402, -1}: "expected one of [',', ';']", {405, -1}: "expected one of [',', ';']", {378, -1}: "expected one of [',', '=', '}']", {381, -1}: "expected one of [',', '=', '}']", {154, -1}: "expected one of [',', ']']", {327, -1}: "expected one of [',', '}']", {338, -1}: "expected one of [',', '}']", {343, -1}: "expected one of [',', '}']", {345, -1}: "expected one of [',', '}']", {380, -1}: "expected one of [',', '}']", {383, -1}: "expected one of [',', '}']", {387, -1}: "expected one of [',', '}']", {330, -1}: "expected one of ['.', '=', '[']", {334, -1}: "expected one of ['.', '=', '[']", {335, -1}: "expected one of ['.', '=', '[']", {337, -1}: "expected one of ['.', '=', '[']", {48, -1}: "expected one of ['{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {50, -1}: "expected one of ['{', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {31, -1}: "expected one of ['{', identifier]", {32, -1}: "expected one of ['{', identifier]", {394, -1}: "expected one of ['}', _Bool, _Complex, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedef name, typeof, union, unsigned, void, volatile]", {397, -1}: "expected one of ['}', _Bool, _Complex, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedef name, typeof, union, unsigned, void, volatile]", {403, -1}: "expected one of ['}', _Bool, _Complex, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedef name, typeof, union, unsigned, void, volatile]", {407, -1}: "expected one of ['}', _Bool, _Complex, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedef name, typeof, union, unsigned, void, volatile]", {244, -1}: "expected optional abstract declarator or one of ['(', ')', '*', '[']", {139, -1}: "expected optional argument expression list or one of ['!', '&', '(', ')', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {53, -1}: "expected optional block item list or one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {55, -1}: "expected optional block item list or one of ['!', '&', '(', '*', '+', '-', ';', '{', '}', '~', ++, --, _Bool, _Complex, __alignof__, auto, break, case, char, character constant, const, continue, default, do, double, enum, extern, float, floating-point constant, for, goto, identifier, if, inline, int, integer constant, long, long character constant, long string constant, register, restrict, return, short, signed, sizeof, static, string literal, struct, switch, typedef, typedef name, typeof, union, unsigned, void, volatile, while]", {324, -1}: "expected optional comma or one of [',', '}']", {339, -1}: "expected optional comma or one of [',', '}']", {379, -1}: "expected optional comma or one of [',', '}']", {6, -1}: "expected optional declaration specifiers or one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {7, -1}: "expected optional declaration specifiers or one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {8, -1}: "expected optional declaration specifiers or one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {9, -1}: "expected optional declaration specifiers or one of ['(', ')', '*', ',', ';', '[', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {199, -1}: "expected optional expression list or one of ['!', '&', '(', ')', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {204, -1}: "expected optional expression list or one of ['!', '&', '(', ')', '*', '+', '-', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {99, -1}: "expected optional expression list or one of ['!', '&', '(', '*', '+', '-', ';', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {195, -1}: "expected optional expression list or one of ['!', '&', '(', '*', '+', '-', ';', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {197, -1}: "expected optional expression list or one of ['!', '&', '(', '*', '+', '-', ';', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {291, -1}: "expected optional expression or one of ['!', '&', '(', '*', '+', '-', ']', '~', ++, --, __alignof__, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]", {288, -1}: "expected optional expression or optional type qualifier list or type qualifier list or one of ['!', '&', '(', '*', '+', '-', ']', '~', ++, --, __alignof__, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, static, string literal, volatile]", {252, -1}: "expected optional expression or type qualifier list or one of ['!', '&', '(', '*', '+', '-', ']', '~', ++, --, __alignof__, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, static, string literal, volatile]", {256, -1}: "expected optional expression or type qualifier or one of ['!', '&', '(', '*', '+', '-', ']', '~', ++, --, __alignof__, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, static, string literal, volatile]", {302, -1}: "expected optional identifier list or one of [')', identifier]", {287, -1}: "expected optional identifier list or parameter type list or one of [')', _Bool, _Complex, auto, char, const, double, enum, extern, float, identifier, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {30, -1}: "expected optional identifier or one of ['{', identifier]", {33, -1}: "expected optional identifier or one of ['{', identifier]", {46, -1}: "expected optional init declarator list or one of ['(', '*', ';', identifier]", {315, -1}: "expected optional parameter type list or one of [')', _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {242, -1}: "expected optional specifier qualifier list or one of ['(', ')', '*', ':', ';', '[', _Bool, _Complex, char, const, double, enum, float, identifier, int, long, restrict, short, signed, struct, typedef name, typeof, union, unsigned, void, volatile]", {243, -1}: "expected optional specifier qualifier list or one of ['(', ')', '*', ':', ';', '[', _Bool, _Complex, char, const, double, enum, float, identifier, int, long, restrict, short, signed, struct, typedef name, typeof, union, unsigned, void, volatile]", {39, -1}: "expected optional type qualifier list or pointer or one of ['(', ')', '*', ',', '[', const, identifier, restrict, volatile]", {312, -1}: "expected parameter declaration or one of [..., _Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {303, -1}: "expected parameter type list or one of [_Bool, _Complex, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedef name, typeof, union, unsigned, void, volatile]", {372, -1}: "expected pointer or one of ['(', ')', '*', ',', '[', identifier]", {93, -1}: "expected statement or one of ['!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, __alignof__, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, typedef name, while]", {110, -1}: "expected statement or one of ['!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, __alignof__, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, typedef name, while]", {113, -1}: "expected statement or one of ['!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, __alignof__, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, typedef name, while]", {201, -1}: "expected statement or one of ['!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, __alignof__, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, typedef name, while]", {206, -1}: "expected statement or one of ['!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, __alignof__, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, typedef name, while]", {216, -1}: "expected statement or one of ['!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, __alignof__, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, typedef name, while]", {220, -1}: "expected statement or one of ['!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, __alignof__, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, typedef name, while]", {222, -1}: "expected statement or one of ['!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, __alignof__, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, typedef name, while]", {227, -1}: "expected statement or one of ['!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, __alignof__, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, typedef name, while]", {231, -1}: "expected statement or one of ['!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, __alignof__, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, typedef name, while]", {233, -1}: "expected statement or one of ['!', '&', '(', '*', '+', '-', ';', '{', '~', ++, --, __alignof__, break, case, character constant, continue, default, do, floating-point constant, for, goto, identifier, if, integer constant, long character constant, long string constant, return, sizeof, string literal, switch, typedef name, while]", {390, -1}: "expected struct declaration list or one of ['}', _Bool, _Complex, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedef name, typeof, union, unsigned, void, volatile]", {392, -1}: "expected struct declaration list or one of [_Bool, _Complex, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedef name, typeof, union, unsigned, void, volatile]", {393, -1}: "expected struct declaration or one of ['}', _Bool, _Complex, char, const, double, enum, float, int, long, restrict, short, signed, struct, typedef name, typeof, union, unsigned, void, volatile]", {395, -1}: "expected struct declarator list or one of ['(', '*', ':', ';', identifier]", {404, -1}: "expected struct declarator or one of ['(', '*', ':', identifier]", {260, -1}: "expected type qualifier or one of ['!', '&', '(', ')', '*', '+', ',', '-', '[', '~', ++, --, __alignof__, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, string literal, volatile]", {290, -1}: "expected type qualifier or one of ['!', '&', '(', '*', '+', '-', ']', '~', ++, --, __alignof__, character constant, const, floating-point constant, identifier, integer constant, long character constant, long string constant, restrict, sizeof, static, string literal, volatile]", {208, -1}: "expected while", } yyParseTab = [426][]uint16{ // 0 {166: 249, 172: 248, 175: 250}, {54: 247}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 476, 116: 672}, {91, 286, 91, 22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 92: 255, 94: 273, 277, 274, 256, 101: 252, 253, 254, 108: 287, 111: 285, 291, 289, 143: 288, 145: 290, 169: 251}, {91, 286, 91, 22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 54: 245, 92: 255, 94: 273, 277, 274, 256, 101: 252, 253, 254, 108: 287, 111: 285, 291, 289, 143: 671, 145: 290}, // 5 {91, 286, 91, 8: 163, 108: 287, 111: 285, 667, 130: 610, 147: 611, 609}, {167, 167, 167, 8: 167, 167, 167, 167, 22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 92: 255, 94: 273, 277, 274, 256, 101: 663, 253, 254, 120: 666}, {167, 167, 167, 8: 167, 167, 167, 167, 22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 92: 255, 94: 273, 277, 274, 256, 101: 663, 253, 254, 120: 665}, {167, 167, 167, 8: 167, 167, 167, 167, 22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 92: 255, 94: 273, 277, 274, 256, 101: 663, 253, 254, 120: 664}, {167, 167, 167, 8: 167, 167, 167, 167, 22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 92: 255, 94: 273, 277, 274, 256, 101: 663, 253, 254, 120: 662}, // 10 {159, 159, 159, 8: 159, 159, 159, 159, 22: 159, 24: 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 43: 159, 159, 159, 159, 159, 159}, {158, 158, 158, 8: 158, 158, 158, 158, 22: 158, 24: 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 43: 158, 158, 158, 158, 158, 158}, {157, 157, 157, 8: 157, 157, 157, 157, 22: 157, 24: 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 43: 157, 157, 157, 157, 157, 157}, {156, 156, 156, 8: 156, 156, 156, 156, 22: 156, 24: 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 43: 156, 156, 156, 156, 156, 156}, {155, 155, 155, 8: 155, 155, 155, 155, 22: 155, 24: 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 43: 155, 155, 155, 155, 155, 155}, // 15 {154, 154, 154, 8: 154, 154, 154, 154, 22: 154, 24: 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154}, {153, 153, 153, 8: 153, 153, 153, 153, 22: 153, 24: 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153}, {152, 152, 152, 8: 152, 152, 152, 152, 22: 152, 24: 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152}, {151, 151, 151, 8: 151, 151, 151, 151, 22: 151, 24: 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151}, {150, 150, 150, 8: 150, 150, 150, 150, 22: 150, 24: 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150}, // 20 {149, 149, 149, 8: 149, 149, 149, 149, 22: 149, 24: 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149}, {148, 148, 148, 8: 148, 148, 148, 148, 22: 148, 24: 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148}, {147, 147, 147, 8: 147, 147, 147, 147, 22: 147, 24: 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147}, {146, 146, 146, 8: 146, 146, 146, 146, 22: 146, 24: 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146}, {145, 145, 145, 8: 145, 145, 145, 145, 22: 145, 24: 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145}, // 25 {144, 144, 144, 8: 144, 144, 144, 144, 22: 144, 24: 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144}, {143, 143, 143, 8: 143, 143, 143, 143, 22: 143, 24: 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143}, {142, 142, 142, 8: 142, 142, 142, 142, 22: 142, 24: 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142}, {141, 141, 141, 8: 141, 141, 141, 141, 22: 141, 24: 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141}, {657}, // 30 {2: 635, 52: 73, 146: 636}, {2: 132, 52: 132}, {2: 131, 52: 131}, {2: 622, 52: 73, 146: 623}, {110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 24: 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 51: 110}, // 35 {109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 24: 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 51: 109}, {108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 24: 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 51: 108}, {107, 107, 107, 8: 107, 107, 107, 107, 22: 107, 24: 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 43: 107, 107, 107, 107, 107, 107}, {621, 2: 531, 140: 529}, {87, 87, 87, 9: 87, 87, 87, 24: 281, 282, 283, 92: 502, 118: 507, 125: 619}, // 40 {90, 2: 90}, {14, 14, 14, 22: 14, 24: 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 43: 14, 14, 14, 14, 14, 14, 54: 14}, {12, 12, 12, 22: 12, 24: 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 43: 12, 12, 12, 12, 12, 12, 54: 12}, {11, 11, 11, 22: 11, 24: 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 43: 11, 11, 11, 11, 11, 11, 54: 11}, {22: 8, 24: 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 43: 8, 8, 8, 8, 8, 8, 52: 8, 161: 292}, // 45 {22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 52: 2, 92: 255, 94: 273, 277, 274, 256, 101: 293, 253, 254, 113: 295, 135: 296, 294}, {91, 286, 91, 8: 163, 108: 287, 111: 285, 612, 130: 610, 147: 611, 609}, {52: 6, 132: 299, 144: 298}, {22: 4, 24: 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 43: 4, 4, 4, 4, 4, 4, 52: 4}, {22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 52: 1, 92: 255, 94: 273, 277, 274, 256, 101: 293, 253, 254, 113: 297}, // 50 {22: 3, 24: 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 43: 3, 3, 3, 3, 3, 3, 52: 3}, {7, 7, 7, 22: 7, 24: 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 43: 7, 7, 7, 7, 7, 7, 54: 7}, {52: 300, 100: 301}, {34, 34, 34, 34, 34, 34, 34, 34, 34, 12: 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 43: 34, 34, 34, 34, 34, 34, 52: 34, 81: 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 159: 302}, {5, 5, 5, 22: 5, 24: 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 43: 5, 5, 5, 5, 5, 5, 54: 5}, // 55 {309, 310, 317, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 323, 30, 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 315, 52: 300, 81: 342, 343, 330, 344, 331, 340, 341, 345, 338, 346, 339, 255, 322, 273, 277, 274, 256, 99: 337, 324, 293, 253, 254, 325, 326, 327, 328, 109: 329, 336, 113: 335, 134: 333, 164: 334, 332}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 608}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 607}, {603, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 604}, {599, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 600}, // 60 {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 598}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 597}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 49: 315, 52: 300, 92: 489, 487, 273, 277, 274, 490, 100: 486, 114: 491, 124: 488}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 485}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 484}, // 65 {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 483}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 482}, {223, 223, 3: 223, 223, 223, 223, 223, 223, 223, 223, 223, 23: 223, 42: 223, 50: 223, 223, 53: 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223}, {386, 387, 3: 385, 388, 389, 370, 368, 178, 178, 178, 396, 42: 178, 50: 393, 178, 53: 390, 55: 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {186, 186, 3: 186, 186, 186, 186, 186, 186, 186, 186, 186, 23: 186, 42: 186, 50: 186, 186, 53: 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186}, // 70 {185, 185, 3: 185, 185, 185, 185, 185, 185, 10: 185, 185, 42: 480, 50: 185, 53: 185, 55: 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185}, {184, 184, 3: 184, 184, 184, 184, 184, 184, 184, 184, 184, 23: 184, 42: 184, 50: 184, 184, 53: 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184}, {183, 183, 3: 183, 183, 183, 183, 183, 183, 183, 183, 183, 23: 183, 42: 183, 50: 183, 183, 53: 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183}, {182, 182, 3: 182, 182, 182, 182, 182, 182, 182, 182, 182, 23: 182, 42: 182, 50: 182, 182, 53: 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182}, {181, 181, 3: 181, 181, 181, 181, 181, 181, 181, 181, 181, 23: 181, 42: 181, 50: 181, 181, 53: 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181}, // 75 {8: 175, 175, 356}, {141, 141, 141, 8: 141, 22: 141, 24: 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 360, 141, 141, 141, 141, 141, 141}, {44, 44, 44, 44, 44, 44, 44, 44, 44, 12: 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 43: 44, 44, 44, 44, 44, 44, 52: 44, 81: 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 98: 44}, {43, 43, 43, 43, 43, 43, 43, 43, 43, 12: 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43: 43, 43, 43, 43, 43, 43, 52: 43, 81: 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 98: 43}, {42, 42, 42, 42, 42, 42, 42, 42, 42, 12: 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 43: 42, 42, 42, 42, 42, 42, 52: 42, 81: 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 98: 42}, // 80 {41, 41, 41, 41, 41, 41, 41, 41, 41, 12: 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 43: 41, 41, 41, 41, 41, 41, 52: 41, 81: 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 98: 41}, {40, 40, 40, 40, 40, 40, 40, 40, 40, 12: 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 43: 40, 40, 40, 40, 40, 40, 52: 40, 81: 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 98: 40}, {39, 39, 39, 39, 39, 39, 39, 39, 39, 12: 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 43: 39, 39, 39, 39, 39, 39, 52: 39, 81: 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 98: 39}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 476, 116: 477}, {42: 474}, // 85 {23: 473}, {32, 32, 32, 32, 32, 32, 32, 32, 32, 12: 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 43: 32, 32, 32, 32, 32, 32, 52: 32, 81: 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}, {309, 310, 317, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 323, 29, 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 315, 52: 300, 81: 342, 343, 330, 344, 331, 340, 341, 345, 338, 346, 339, 255, 322, 273, 277, 274, 256, 99: 337, 324, 293, 253, 254, 325, 326, 327, 328, 109: 329, 336, 113: 335, 134: 472}, {28, 28, 28, 28, 28, 28, 28, 28, 28, 12: 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 43: 28, 28, 28, 28, 28, 28, 52: 28, 81: 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28}, {27, 27, 27, 27, 27, 27, 27, 27, 27, 12: 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 43: 27, 27, 27, 27, 27, 27, 52: 27, 81: 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27}, // 90 {8: 471}, {465}, {461}, {309, 310, 317, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 358, 49: 315, 52: 300, 81: 342, 343, 330, 344, 331, 340, 341, 345, 338, 346, 339, 93: 322, 99: 337, 324, 104: 325, 326, 327, 328, 109: 329, 455}, {441}, // 95 {354}, {8: 353}, {8: 352}, {2: 350}, {309, 310, 347, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 315, 93: 322, 99: 348}, // 100 {185, 185, 3: 185, 185, 185, 185, 185, 185, 185, 185, 185, 23: 185, 42: 185, 50: 185, 185, 53: 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185}, {8: 349}, {15, 15, 15, 15, 15, 15, 15, 15, 15, 12: 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 43: 15, 15, 15, 15, 15, 15, 52: 15, 81: 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 98: 15}, {8: 351}, {16, 16, 16, 16, 16, 16, 16, 16, 16, 12: 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 43: 16, 16, 16, 16, 16, 16, 52: 16, 81: 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 98: 16}, // 105 {17, 17, 17, 17, 17, 17, 17, 17, 17, 12: 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 43: 17, 17, 17, 17, 17, 17, 52: 17, 81: 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 98: 17}, {18, 18, 18, 18, 18, 18, 18, 18, 18, 12: 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 43: 18, 18, 18, 18, 18, 18, 52: 18, 81: 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 98: 18}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 315, 93: 355}, {9: 357, 356}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 362}, // 110 {309, 310, 317, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 358, 49: 315, 52: 300, 81: 342, 343, 330, 344, 331, 340, 341, 345, 338, 346, 339, 93: 322, 99: 337, 324, 104: 325, 326, 327, 328, 109: 329, 359}, {42: 360}, {19, 19, 19, 19, 19, 19, 19, 19, 19, 12: 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 43: 19, 19, 19, 19, 19, 19, 52: 19, 81: 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 98: 19}, {309, 310, 317, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 358, 49: 315, 52: 300, 81: 342, 343, 330, 344, 331, 340, 341, 345, 338, 346, 339, 93: 322, 99: 337, 324, 104: 325, 326, 327, 328, 109: 329, 361}, {35, 35, 35, 35, 35, 35, 35, 35, 35, 12: 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 43: 35, 35, 35, 35, 35, 35, 52: 35, 81: 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 98: 35}, // 115 {386, 387, 3: 385, 388, 389, 370, 368, 177, 177, 177, 396, 42: 177, 50: 393, 177, 53: 390, 55: 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 440}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 439}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 438}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 437}, // 120 {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 436}, {217, 217, 3: 217, 217, 217, 217, 217, 217, 217, 217, 217, 23: 217, 42: 217, 50: 217, 217, 53: 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 435}, {215, 215, 3: 215, 215, 215, 215, 215, 215, 215, 215, 215, 23: 215, 42: 215, 50: 215, 215, 53: 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 434}, // 125 {2: 433}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 432}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 431}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 430}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 429}, // 130 {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 428}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 427}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 426}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 425}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 424}, // 135 {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 423}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 422}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 421}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 420}, {309, 310, 347, 308, 311, 312, 304, 303, 9: 241, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 414, 162: 415, 416}, // 140 {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 413}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 412}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 411}, {2: 410}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 409}, // 145 {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 408}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 407}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 406}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 315, 93: 403}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 315, 93: 401}, // 150 {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 400}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 399}, {386, 387, 3: 385, 388, 389, 370, 368, 187, 187, 187, 396, 23: 187, 42: 187, 50: 187, 187, 53: 390, 187, 384, 391, 392, 394, 187, 397, 187, 187, 187, 187, 372, 187, 377, 378, 376, 374, 187, 187, 187, 363, 187, 187, 379, 187, 187, 187}, {386, 387, 3: 385, 388, 389, 370, 368, 188, 188, 188, 396, 23: 188, 42: 188, 50: 188, 188, 53: 390, 188, 384, 391, 392, 394, 188, 188, 188, 188, 188, 188, 372, 188, 377, 378, 376, 374, 188, 188, 188, 363, 188, 188, 379, 188, 188, 188}, {10: 356, 51: 402}, // 155 {189, 189, 3: 189, 189, 189, 189, 189, 189, 189, 189, 189, 23: 189, 42: 189, 50: 189, 189, 53: 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189}, {10: 356, 42: 404}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 405}, {386, 387, 3: 385, 388, 389, 370, 368, 190, 190, 190, 396, 23: 190, 42: 190, 50: 190, 190, 53: 390, 190, 384, 391, 392, 394, 395, 397, 398, 190, 365, 190, 372, 190, 377, 378, 376, 374, 190, 190, 190, 363, 190, 383, 379, 190, 190, 190}, {386, 387, 3: 191, 388, 389, 370, 368, 191, 191, 191, 396, 23: 191, 42: 191, 50: 191, 191, 53: 390, 191, 384, 391, 191, 191, 191, 191, 191, 191, 191, 191, 372, 191, 191, 191, 191, 374, 191, 191, 191, 191, 191, 191, 379, 191, 191, 191}, // 160 {386, 387, 3: 385, 388, 389, 370, 368, 192, 192, 192, 396, 23: 192, 42: 192, 50: 393, 192, 53: 390, 192, 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {386, 387, 3: 193, 388, 389, 370, 368, 193, 193, 193, 396, 23: 193, 42: 193, 50: 193, 193, 53: 390, 193, 384, 391, 193, 193, 193, 193, 193, 193, 193, 193, 372, 193, 193, 193, 193, 374, 193, 193, 193, 193, 193, 193, 379, 193, 193, 193}, {386, 194, 3: 194, 194, 194, 370, 368, 194, 194, 194, 396, 23: 194, 42: 194, 50: 194, 194, 53: 390, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 372, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194}, {195, 195, 3: 195, 195, 195, 195, 195, 195, 195, 195, 195, 23: 195, 42: 195, 50: 195, 195, 53: 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195}, {386, 387, 3: 196, 196, 196, 370, 368, 196, 196, 196, 396, 23: 196, 42: 196, 50: 196, 196, 53: 390, 196, 384, 391, 196, 196, 196, 196, 196, 196, 196, 196, 372, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196}, // 165 {386, 387, 3: 197, 197, 197, 370, 368, 197, 197, 197, 396, 23: 197, 42: 197, 50: 197, 197, 53: 390, 197, 384, 391, 197, 197, 197, 197, 197, 197, 197, 197, 372, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197}, {386, 198, 3: 198, 198, 198, 370, 368, 198, 198, 198, 396, 23: 198, 42: 198, 50: 198, 198, 53: 390, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 372, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198}, {386, 387, 3: 385, 388, 389, 370, 368, 9: 243, 243, 396, 50: 393, 53: 390, 55: 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {9: 240, 418}, {9: 417}, // 170 {199, 199, 3: 199, 199, 199, 199, 199, 199, 199, 199, 199, 23: 199, 42: 199, 50: 199, 199, 53: 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 419}, {386, 387, 3: 385, 388, 389, 370, 368, 9: 242, 242, 396, 50: 393, 53: 390, 55: 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {386, 387, 3: 200, 388, 389, 370, 368, 200, 200, 200, 396, 23: 200, 42: 200, 50: 200, 200, 53: 390, 200, 384, 391, 392, 394, 200, 200, 200, 200, 200, 200, 372, 200, 377, 378, 376, 374, 200, 200, 200, 363, 200, 200, 379, 200, 200, 200}, {386, 201, 3: 201, 201, 201, 370, 368, 201, 201, 201, 396, 23: 201, 42: 201, 50: 201, 201, 53: 390, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 372, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201}, // 175 {386, 387, 3: 385, 388, 389, 370, 368, 202, 202, 202, 396, 23: 202, 42: 202, 50: 202, 202, 53: 390, 202, 384, 391, 392, 394, 202, 397, 398, 202, 365, 202, 372, 202, 377, 378, 376, 374, 202, 202, 202, 363, 202, 202, 379, 202, 202, 202}, {386, 387, 3: 385, 388, 389, 370, 368, 203, 203, 203, 396, 23: 203, 42: 203, 50: 393, 203, 53: 390, 203, 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {386, 387, 3: 385, 388, 389, 370, 368, 204, 204, 204, 396, 23: 204, 42: 204, 50: 393, 204, 53: 390, 204, 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {386, 387, 3: 385, 388, 389, 370, 368, 205, 205, 205, 396, 23: 205, 42: 205, 50: 393, 205, 53: 390, 205, 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {386, 387, 3: 206, 388, 389, 370, 368, 206, 206, 206, 396, 23: 206, 42: 206, 50: 206, 206, 53: 390, 206, 384, 391, 206, 206, 206, 206, 206, 206, 206, 206, 372, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206}, // 180 {386, 387, 3: 207, 388, 389, 370, 368, 207, 207, 207, 396, 23: 207, 42: 207, 50: 207, 207, 53: 390, 207, 384, 391, 207, 207, 207, 207, 207, 207, 207, 207, 372, 207, 207, 207, 207, 374, 207, 207, 207, 207, 207, 207, 379, 207, 207, 207}, {386, 387, 3: 208, 388, 389, 370, 368, 208, 208, 208, 396, 23: 208, 42: 208, 50: 208, 208, 53: 390, 208, 384, 391, 392, 394, 208, 208, 208, 208, 208, 208, 372, 208, 208, 378, 376, 374, 208, 208, 208, 208, 208, 208, 379, 208, 208, 208}, {386, 387, 3: 209, 388, 389, 370, 368, 209, 209, 209, 396, 23: 209, 42: 209, 50: 209, 209, 53: 390, 209, 384, 391, 209, 209, 209, 209, 209, 209, 209, 209, 372, 209, 209, 209, 209, 374, 209, 209, 209, 209, 209, 209, 379, 209, 209, 209}, {386, 387, 3: 385, 388, 389, 370, 368, 210, 210, 210, 396, 23: 210, 42: 210, 50: 393, 210, 53: 390, 210, 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {386, 387, 3: 211, 388, 389, 370, 368, 211, 211, 211, 396, 23: 211, 42: 211, 50: 211, 211, 53: 390, 211, 384, 391, 211, 211, 211, 211, 211, 211, 211, 211, 372, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211}, // 185 {386, 387, 3: 385, 388, 389, 370, 368, 212, 212, 212, 396, 23: 212, 42: 212, 50: 393, 212, 53: 390, 212, 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {213, 213, 3: 213, 213, 213, 213, 213, 213, 213, 213, 213, 23: 213, 42: 213, 50: 213, 213, 53: 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213}, {386, 387, 3: 385, 388, 389, 370, 368, 214, 214, 214, 396, 23: 214, 42: 214, 50: 393, 214, 53: 390, 214, 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {386, 387, 3: 385, 388, 389, 370, 368, 216, 216, 216, 396, 23: 216, 42: 216, 50: 393, 216, 53: 390, 216, 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {386, 387, 3: 385, 388, 389, 370, 368, 218, 218, 218, 396, 23: 218, 42: 218, 50: 393, 218, 53: 390, 218, 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, // 190 {386, 387, 3: 385, 388, 389, 370, 368, 219, 219, 219, 396, 23: 219, 42: 219, 50: 393, 219, 53: 390, 219, 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {386, 387, 3: 385, 388, 389, 370, 368, 220, 220, 220, 396, 23: 220, 42: 220, 50: 220, 220, 53: 390, 220, 384, 391, 392, 394, 220, 397, 398, 220, 220, 220, 372, 220, 377, 378, 376, 374, 220, 220, 220, 363, 220, 220, 379, 220, 220, 220}, {386, 387, 3: 385, 388, 389, 370, 368, 221, 221, 221, 396, 23: 221, 42: 221, 50: 393, 221, 53: 390, 221, 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {386, 387, 3: 222, 388, 389, 370, 368, 222, 222, 222, 396, 23: 222, 42: 222, 50: 222, 222, 53: 390, 222, 384, 391, 392, 394, 222, 222, 222, 222, 222, 222, 372, 222, 222, 378, 376, 374, 222, 222, 222, 222, 222, 222, 379, 222, 222, 222}, {309, 310, 347, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 315, 92: 255, 322, 273, 277, 274, 256, 99: 443, 101: 293, 253, 254, 113: 442}, // 195 {309, 310, 347, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 315, 93: 322, 99: 450}, {8: 444}, {309, 310, 347, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 315, 93: 322, 99: 445}, {8: 446}, {309, 310, 347, 308, 311, 312, 304, 303, 9: 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 315, 93: 322, 99: 447}, // 200 {9: 448}, {309, 310, 317, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 358, 49: 315, 52: 300, 81: 342, 343, 330, 344, 331, 340, 341, 345, 338, 346, 339, 93: 322, 99: 337, 324, 104: 325, 326, 327, 328, 109: 329, 449}, {20, 20, 20, 20, 20, 20, 20, 20, 20, 12: 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 43: 20, 20, 20, 20, 20, 20, 52: 20, 81: 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 98: 20}, {8: 451}, {309, 310, 347, 308, 311, 312, 304, 303, 9: 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 315, 93: 322, 99: 452}, // 205 {9: 453}, {309, 310, 317, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 358, 49: 315, 52: 300, 81: 342, 343, 330, 344, 331, 340, 341, 345, 338, 346, 339, 93: 322, 99: 337, 324, 104: 325, 326, 327, 328, 109: 329, 454}, {21, 21, 21, 21, 21, 21, 21, 21, 21, 12: 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 43: 21, 21, 21, 21, 21, 21, 52: 21, 81: 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 98: 21}, {81: 456}, {457}, // 210 {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 315, 93: 458}, {9: 459, 356}, {8: 460}, {22, 22, 22, 22, 22, 22, 22, 22, 22, 12: 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 43: 22, 22, 22, 22, 22, 22, 52: 22, 81: 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 98: 22}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 315, 93: 462}, // 215 {9: 463, 356}, {309, 310, 317, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 358, 49: 315, 52: 300, 81: 342, 343, 330, 344, 331, 340, 341, 345, 338, 346, 339, 93: 322, 99: 337, 324, 104: 325, 326, 327, 328, 109: 329, 464}, {23, 23, 23, 23, 23, 23, 23, 23, 23, 12: 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 43: 23, 23, 23, 23, 23, 23, 52: 23, 81: 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 98: 23}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 315, 93: 466}, {9: 467, 356}, // 220 {309, 310, 317, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 358, 49: 315, 52: 300, 81: 342, 343, 330, 344, 331, 340, 341, 345, 338, 346, 339, 93: 322, 99: 337, 324, 104: 325, 326, 327, 328, 109: 329, 468}, {24, 24, 24, 24, 24, 24, 24, 24, 24, 12: 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 43: 24, 24, 24, 24, 24, 24, 52: 24, 81: 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 98: 469}, {309, 310, 317, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 358, 49: 315, 52: 300, 81: 342, 343, 330, 344, 331, 340, 341, 345, 338, 346, 339, 93: 322, 99: 337, 324, 104: 325, 326, 327, 328, 109: 329, 470}, {25, 25, 25, 25, 25, 25, 25, 25, 25, 12: 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 43: 25, 25, 25, 25, 25, 25, 52: 25, 81: 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 98: 25}, {26, 26, 26, 26, 26, 26, 26, 26, 26, 12: 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 43: 26, 26, 26, 26, 26, 26, 52: 26, 81: 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 98: 26}, // 225 {31, 31, 31, 31, 31, 31, 31, 31, 31, 12: 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 43: 31, 31, 31, 31, 31, 31, 52: 31, 81: 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31}, {33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 12: 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 43: 33, 33, 33, 33, 33, 33, 52: 33, 54: 33, 81: 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 98: 33}, {309, 310, 317, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 358, 49: 315, 52: 300, 81: 342, 343, 330, 344, 331, 340, 341, 345, 338, 346, 339, 93: 322, 99: 337, 324, 104: 325, 326, 327, 328, 109: 329, 475}, {37, 37, 37, 37, 37, 37, 37, 37, 37, 12: 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 43: 37, 37, 37, 37, 37, 37, 52: 37, 81: 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 98: 37}, {386, 387, 3: 385, 388, 389, 370, 368, 174, 10: 174, 396, 23: 174, 42: 174, 50: 393, 174, 53: 390, 174, 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, // 230 {42: 478}, {309, 310, 317, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 358, 49: 315, 52: 300, 81: 342, 343, 330, 344, 331, 340, 341, 345, 338, 346, 339, 93: 322, 99: 337, 324, 104: 325, 326, 327, 328, 109: 329, 479}, {38, 38, 38, 38, 38, 38, 38, 38, 38, 12: 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 43: 38, 38, 38, 38, 38, 38, 52: 38, 81: 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 98: 38}, {309, 310, 317, 308, 311, 312, 304, 303, 176, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 358, 49: 315, 52: 300, 81: 342, 343, 330, 344, 331, 340, 341, 345, 338, 346, 339, 93: 322, 99: 337, 324, 104: 325, 326, 327, 328, 109: 329, 481}, {36, 36, 36, 36, 36, 36, 36, 36, 36, 12: 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 43: 36, 36, 36, 36, 36, 36, 52: 36, 81: 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 98: 36}, // 235 {386, 224, 3: 224, 224, 224, 370, 368, 224, 224, 224, 396, 23: 224, 42: 224, 50: 224, 224, 53: 390, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 372, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224}, {386, 225, 3: 225, 225, 225, 370, 368, 225, 225, 225, 396, 23: 225, 42: 225, 50: 225, 225, 53: 390, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 372, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225}, {386, 226, 3: 226, 226, 226, 370, 368, 226, 226, 226, 396, 23: 226, 42: 226, 50: 226, 226, 53: 390, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 372, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226}, {386, 227, 3: 227, 227, 227, 370, 368, 227, 227, 227, 396, 23: 227, 42: 227, 50: 227, 227, 53: 390, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 372, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227}, {9: 596}, // 240 {9: 595, 356}, {9: 568}, {124, 124, 124, 8: 124, 124, 11: 124, 22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 124, 92: 489, 94: 273, 277, 274, 490, 114: 566, 150: 567}, {124, 124, 124, 8: 124, 124, 11: 124, 22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 124, 92: 489, 94: 273, 277, 274, 490, 114: 566, 150: 565}, {91, 286, 9: 68, 11: 91, 108: 492, 111: 494, 119: 495, 133: 493}, // 245 {90, 2: 90, 9: 70, 70, 90}, {9: 71}, {497, 11: 58, 138: 496, 498}, {9: 67, 67}, {562, 9: 69, 69, 57}, // 250 {91, 286, 9: 83, 11: 91, 22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 92: 255, 94: 273, 277, 274, 256, 101: 521, 253, 254, 108: 492, 111: 494, 117: 520, 119: 522, 122: 518, 519, 131: 523}, {11: 499}, {309, 500, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 24: 281, 282, 283, 43: 504, 49: 501, 51: 180, 92: 502, 118: 503, 129: 505}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 485, 51: 517}, {386, 387, 3: 385, 388, 389, 370, 368, 11: 396, 50: 393, 179, 53: 390, 55: 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, // 255 {89, 89, 89, 89, 89, 89, 89, 89, 9: 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 24: 89, 89, 89, 43: 89, 51: 89}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 24: 281, 282, 283, 43: 512, 49: 501, 51: 180, 92: 511, 129: 513}, {87, 87, 87, 87, 87, 87, 87, 87, 12: 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 24: 281, 282, 283, 92: 502, 118: 507, 125: 508}, {51: 506}, {61, 9: 61, 61, 61}, // 260 {86, 86, 86, 86, 86, 86, 86, 86, 9: 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 24: 281, 282, 283, 92: 511}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 509}, {386, 387, 3: 385, 388, 389, 370, 368, 11: 396, 50: 393, 510, 53: 390, 55: 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {63, 9: 63, 63, 63}, {88, 88, 88, 88, 88, 88, 88, 88, 9: 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 24: 88, 88, 88, 43: 88, 51: 88}, // 265 {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 515}, {51: 514}, {59, 9: 59, 59, 59}, {386, 387, 3: 385, 388, 389, 370, 368, 11: 396, 50: 393, 516, 53: 390, 55: 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {60, 9: 60, 60, 60}, // 270 {62, 9: 62, 62, 62}, {9: 85, 559}, {9: 82}, {9: 81, 81}, {91, 286, 91, 9: 68, 68, 91, 108: 492, 111: 526, 528, 119: 495, 133: 527}, // 275 {9: 525}, {9: 524}, {65, 9: 65, 65, 65}, {66, 9: 66, 66, 66}, {530, 2: 531, 11: 58, 138: 496, 498, 529}, // 280 {9: 79, 79}, {9: 78, 78}, {534, 8: 106, 106, 106, 535, 22: 106, 24: 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 50: 106, 52: 106}, {91, 286, 91, 9: 83, 11: 91, 22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 92: 255, 94: 273, 277, 274, 256, 101: 521, 253, 254, 108: 492, 111: 526, 532, 117: 520, 119: 522, 122: 518, 519, 131: 523}, {94, 8: 94, 94, 94, 94, 22: 94, 24: 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 50: 94, 52: 94}, // 285 {9: 533}, {103, 8: 103, 103, 103, 103, 22: 103, 24: 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 50: 103, 52: 103}, {2: 102, 9: 102, 22: 100, 24: 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 43: 100, 100, 100, 100, 100, 100, 157: 549, 550}, {87, 87, 87, 87, 87, 87, 87, 87, 12: 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 24: 281, 282, 283, 43: 536, 51: 87, 92: 502, 118: 537, 125: 538}, {87, 87, 87, 87, 87, 87, 87, 87, 12: 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 24: 281, 282, 283, 92: 502, 118: 507, 125: 546}, // 290 {86, 86, 86, 86, 86, 86, 86, 86, 12: 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 24: 281, 282, 283, 43: 543, 51: 86, 92: 511}, {309, 539, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 501, 51: 180, 129: 540}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 485, 51: 542}, {51: 541}, {95, 8: 95, 95, 95, 95, 22: 95, 24: 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 50: 95, 52: 95}, // 295 {96, 8: 96, 96, 96, 96, 22: 96, 24: 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 50: 96, 52: 96}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 544}, {386, 387, 3: 385, 388, 389, 370, 368, 11: 396, 50: 393, 545, 53: 390, 55: 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {97, 8: 97, 97, 97, 97, 22: 97, 24: 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 50: 97, 52: 97}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 547}, // 300 {386, 387, 3: 385, 388, 389, 370, 368, 11: 396, 50: 393, 548, 53: 390, 55: 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {98, 8: 98, 98, 98, 98, 22: 98, 24: 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 50: 98, 52: 98}, {2: 554, 9: 75, 170: 555, 553}, {22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 92: 255, 94: 273, 277, 274, 256, 101: 521, 253, 254, 117: 520, 122: 518, 551}, {9: 552}, // 305 {99, 8: 99, 99, 99, 99, 22: 99, 24: 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 50: 99, 52: 99}, {9: 558}, {9: 77, 77}, {9: 74, 556}, {2: 557}, // 310 {9: 76, 76}, {101, 8: 101, 101, 101, 101, 22: 101, 24: 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 50: 101, 52: 101}, {22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 92: 255, 94: 273, 277, 274, 256, 101: 521, 253, 254, 117: 561, 167: 560}, {9: 84}, {9: 80, 80}, // 315 {9: 83, 22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 92: 255, 94: 273, 277, 274, 256, 101: 521, 253, 254, 117: 520, 122: 518, 519, 131: 563}, {9: 564}, {64, 9: 64, 64, 64}, {125, 125, 125, 8: 125, 125, 11: 125, 42: 125}, {123, 123, 123, 8: 123, 123, 11: 123, 42: 123}, // 320 {126, 126, 126, 8: 126, 126, 11: 126, 42: 126}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 570, 52: 569}, {309, 310, 347, 308, 311, 312, 304, 303, 10: 54, 579, 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 23: 54, 49: 572, 52: 573, 578, 115: 574, 121: 577, 127: 575, 576, 149: 571}, {386, 228, 3: 228, 228, 228, 370, 368, 228, 228, 228, 396, 23: 228, 42: 228, 50: 228, 228, 53: 390, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 372, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228}, {10: 587, 23: 118, 126: 593}, // 325 {386, 387, 3: 385, 388, 389, 370, 368, 55, 10: 55, 396, 23: 55, 50: 393, 53: 390, 55: 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {309, 310, 347, 308, 311, 312, 304, 303, 10: 54, 579, 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 23: 54, 49: 572, 52: 573, 578, 115: 574, 121: 577, 127: 575, 576, 149: 586}, {10: 53, 23: 53}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 572, 52: 573, 115: 585}, {11: 579, 50: 583, 53: 578, 121: 584}, // 330 {11: 48, 50: 48, 53: 48}, {2: 582}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 476, 116: 580}, {51: 581}, {11: 45, 50: 45, 53: 45}, // 335 {11: 46, 50: 46, 53: 46}, {49, 49, 49, 49, 49, 49, 49, 49, 12: 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 52: 49}, {11: 47, 50: 47, 53: 47}, {10: 52, 23: 52}, {10: 587, 23: 118, 126: 588}, // 340 {309, 310, 347, 308, 311, 312, 304, 303, 11: 579, 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 23: 117, 49: 572, 52: 573, 578, 115: 590, 121: 577, 127: 591, 576}, {23: 589}, {8: 56, 10: 56, 23: 56}, {10: 51, 23: 51}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 572, 52: 573, 115: 592}, // 345 {10: 50, 23: 50}, {23: 594}, {229, 229, 3: 229, 229, 229, 229, 229, 229, 229, 229, 229, 23: 229, 42: 229, 50: 229, 229, 53: 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229}, {230, 230, 3: 230, 230, 230, 230, 230, 230, 230, 230, 230, 23: 230, 42: 230, 50: 230, 230, 53: 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230}, {231, 231, 3: 231, 231, 231, 231, 231, 231, 231, 231, 231, 23: 231, 42: 231, 50: 231, 231, 53: 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231}, // 350 {386, 232, 3: 232, 232, 232, 370, 368, 232, 232, 232, 396, 23: 232, 42: 232, 50: 232, 232, 53: 390, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 372, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232}, {386, 233, 3: 233, 233, 233, 370, 368, 233, 233, 233, 396, 23: 233, 42: 233, 50: 233, 233, 53: 390, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 372, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 49: 315, 52: 300, 92: 489, 487, 273, 277, 274, 490, 100: 486, 114: 491, 124: 601}, {386, 234, 3: 234, 234, 234, 370, 368, 234, 234, 234, 396, 23: 234, 42: 234, 50: 234, 234, 53: 390, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 372, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234}, {9: 602}, // 355 {309, 235, 347, 235, 235, 235, 304, 303, 235, 235, 235, 235, 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 23: 235, 42: 235, 49: 570, 235, 235, 569, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 49: 315, 52: 300, 92: 489, 487, 273, 277, 274, 490, 100: 486, 114: 491, 124: 605}, {386, 236, 3: 236, 236, 236, 370, 368, 236, 236, 236, 396, 23: 236, 42: 236, 50: 236, 236, 53: 390, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 372, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236}, {9: 606}, {309, 237, 347, 237, 237, 237, 304, 303, 237, 237, 237, 237, 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 23: 237, 42: 237, 49: 570, 237, 237, 569, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237}, // 360 {386, 238, 3: 238, 238, 238, 370, 368, 238, 238, 238, 396, 23: 238, 42: 238, 50: 238, 238, 53: 390, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 372, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238}, {386, 239, 3: 239, 239, 239, 370, 368, 239, 239, 239, 396, 23: 239, 42: 239, 50: 239, 239, 53: 390, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 372, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239}, {8: 173, 153: 617}, {8: 165, 10: 165}, {8: 162, 10: 615}, // 365 {8: 161, 10: 161, 50: 613}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 572, 52: 573, 115: 614}, {8: 160, 10: 160}, {91, 286, 91, 108: 287, 111: 285, 612, 130: 616}, {8: 164, 10: 164}, // 370 {8: 618}, {172, 172, 172, 172, 172, 172, 172, 172, 172, 12: 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 43: 172, 172, 172, 172, 172, 172, 52: 172, 54: 172, 81: 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172}, {93, 286, 93, 9: 93, 93, 93, 108: 620}, {92, 2: 92, 9: 92, 92, 92}, {91, 286, 91, 108: 287, 111: 285, 532}, // 375 {116, 116, 116, 8: 116, 116, 116, 116, 22: 116, 24: 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 52: 72}, {52: 624}, {2: 625, 141: 628, 627, 168: 626}, {10: 244, 23: 244, 50: 244}, {10: 631, 23: 118, 126: 632}, // 380 {10: 114, 23: 114}, {10: 112, 23: 112, 50: 629}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 476, 116: 630}, {10: 111, 23: 111}, {2: 625, 23: 117, 141: 628, 634}, // 385 {23: 633}, {115, 115, 115, 8: 115, 115, 115, 115, 22: 115, 24: 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115}, {10: 113, 23: 113}, {138, 138, 138, 8: 138, 138, 138, 138, 22: 138, 24: 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 52: 72}, {52: 637}, // 390 {22: 135, 137, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 154: 638, 639}, {23: 656}, {22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 92: 489, 94: 273, 277, 274, 490, 114: 642, 151: 641, 173: 640}, {22: 275, 134, 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 92: 489, 94: 273, 277, 274, 490, 114: 642, 151: 654, 156: 653}, {22: 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130}, // 395 {91, 286, 91, 8: 644, 42: 105, 108: 287, 111: 285, 646, 137: 647, 152: 645, 174: 643}, {8: 650, 10: 651}, {22: 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127}, {8: 122, 10: 122}, {8: 120, 10: 120, 42: 104}, // 400 {42: 648}, {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 49: 476, 116: 649}, {8: 119, 10: 119}, {22: 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, {91, 286, 91, 42: 105, 108: 287, 111: 285, 646, 137: 647, 152: 652}, // 405 {8: 121, 10: 121}, {23: 655}, {22: 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129}, {133, 133, 133, 8: 133, 133, 133, 133, 22: 133, 24: 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133}, {136, 136, 136, 8: 136, 136, 136, 136, 22: 136, 24: 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136}, // 410 {309, 310, 347, 308, 311, 312, 304, 303, 12: 307, 313, 305, 314, 316, 318, 319, 320, 306, 321, 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 49: 658, 92: 489, 94: 273, 277, 274, 490, 114: 491, 124: 659}, {386, 387, 3: 385, 388, 389, 370, 368, 9: 661, 11: 396, 50: 393, 53: 390, 55: 384, 391, 392, 394, 395, 397, 398, 369, 365, 366, 372, 373, 377, 378, 376, 374, 375, 364, 367, 363, 382, 383, 379, 380, 371, 381}, {9: 660}, {139, 139, 139, 8: 139, 139, 139, 139, 22: 139, 24: 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139}, {140, 140, 140, 8: 140, 140, 140, 140, 22: 140, 24: 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140}, // 415 {168, 168, 168, 8: 168, 168, 168, 168}, {166, 166, 166, 8: 166, 166, 166, 166}, {169, 169, 169, 8: 169, 169, 169, 169}, {170, 170, 170, 8: 170, 170, 170, 170}, {171, 171, 171, 8: 171, 171, 171, 171}, // 420 {8: 161, 10: 161, 22: 10, 24: 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 43: 10, 10, 10, 10, 10, 10, 50: 613, 52: 10, 160: 668}, {22: 275, 24: 281, 282, 283, 262, 264, 263, 265, 280, 266, 267, 268, 269, 270, 278, 276, 279, 271, 272, 43: 260, 257, 258, 284, 259, 261, 52: 2, 92: 255, 94: 273, 277, 274, 256, 101: 293, 253, 254, 113: 295, 135: 296, 669}, {52: 6, 132: 299, 144: 670}, {9, 9, 9, 22: 9, 24: 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 43: 9, 9, 9, 9, 9, 9, 54: 9}, {13, 13, 13, 22: 13, 24: 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 43: 13, 13, 13, 13, 13, 13, 54: 13}, // 425 {54: 246}, } ) var yyDebug = 0 type yyLexer interface { Lex(lval *yySymType) int Error(s string) } type yyLexerEx interface { yyLexer Reduced(rule, state int, lval *yySymType) bool } func yySymName(c int) (s string) { x, ok := yyXLAT[c] if ok { return yySymNames[x] } if c < 0x7f { return __yyfmt__.Sprintf("%q", c) } return __yyfmt__.Sprintf("%d", c) } func yylex1(yylex yyLexer, lval *yySymType) (n int) { n = yylex.Lex(lval) if n <= 0 { n = yyEofCode } if yyDebug >= 3 { __yyfmt__.Printf("\nlex %s(%#x %d), PrettyString(lval.Token): %v\n", yySymName(n), n, n, PrettyString(lval.Token)) } return n } func yyParse(yylex yyLexer) int { const yyError = 179 yyEx, _ := yylex.(yyLexerEx) var yyn int var yylval yySymType var yyVAL yySymType p := yyPool.Get().(*[]yySymType) yyS := *p defer func() { var v yySymType for i := range yyS { yyS[i] = v } yyPool.Put(p) }() Nerrs := 0 /* number of errors */ Errflag := 0 /* error recovery flag */ yyerrok := func() { if yyDebug >= 2 { __yyfmt__.Printf("yyerrok()\n") } Errflag = 0 } _ = yyerrok yystate := 0 yychar := -1 var yyxchar int var yyshift int yyp := -1 goto yystack ret0: return 0 ret1: return 1 yystack: /* put a state and value onto the stack */ yyp++ if yyp >= len(yyS) { nyys := make([]yySymType, len(yyS)*2) copy(nyys, yyS) yyS = nyys } yyS[yyp] = yyVAL yyS[yyp].yys = yystate yynewstate: if yychar < 0 { yylval.yys = yystate yychar = yylex1(yylex, &yylval) var ok bool if yyxchar, ok = yyXLAT[yychar]; !ok { yyxchar = len(yySymNames) // > tab width } } if yyDebug >= 4 { var a []int for _, v := range yyS[:yyp+1] { a = append(a, v.yys) } __yyfmt__.Printf("state stack %v\n", a) } row := yyParseTab[yystate] yyn = 0 if yyxchar < len(row) { if yyn = int(row[yyxchar]); yyn != 0 { yyn += yyTabOfs } } switch { case yyn > 0: // shift yychar = -1 yyVAL = yylval yystate = yyn yyshift = yyn if yyDebug >= 2 { __yyfmt__.Printf("shift, and goto state %d\n", yystate) } if Errflag > 0 { Errflag-- } goto yystack case yyn < 0: // reduce case yystate == 1: // accept if yyDebug >= 2 { __yyfmt__.Println("accept") } goto ret0 } if yyn == 0 { /* error ... attempt to resume parsing */ switch Errflag { case 0: /* brand new error */ if yyDebug >= 1 { __yyfmt__.Printf("no action for %s in state %d\n", yySymName(yychar), yystate) } msg, ok := yyXErrors[yyXError{yystate, yyxchar}] if !ok { msg, ok = yyXErrors[yyXError{yystate, -1}] } if !ok && yyshift != 0 { msg, ok = yyXErrors[yyXError{yyshift, yyxchar}] } if !ok { msg, ok = yyXErrors[yyXError{yyshift, -1}] } if yychar > 0 { ls := yyTokenLiteralStrings[yychar] if ls == "" { ls = yySymName(yychar) } if ls != "" { switch { case msg == "": msg = __yyfmt__.Sprintf("unexpected %s", ls) default: msg = __yyfmt__.Sprintf("unexpected %s, %s", ls, msg) } } } if msg == "" { msg = "syntax error" } yylex.Error(msg) Nerrs++ fallthrough case 1, 2: /* incompletely recovered error ... try again */ Errflag = 3 /* find a state where "error" is a legal shift action */ for yyp >= 0 { row := yyParseTab[yyS[yyp].yys] if yyError < len(row) { yyn = int(row[yyError]) + yyTabOfs if yyn > 0 { // hit if yyDebug >= 2 { __yyfmt__.Printf("error recovery found error shift in state %d\n", yyS[yyp].yys) } yystate = yyn /* simulate a shift of "error" */ goto yystack } } /* the current p has no shift on "error", pop stack */ if yyDebug >= 2 { __yyfmt__.Printf("error recovery pops state %d\n", yyS[yyp].yys) } yyp-- } /* there is no state on the stack with an error shift ... abort */ if yyDebug >= 2 { __yyfmt__.Printf("error recovery failed\n") } goto ret1 case 3: /* no shift yet; clobber input char */ if yyDebug >= 2 { __yyfmt__.Printf("error recovery discards %s\n", yySymName(yychar)) } if yychar == yyEofCode { goto ret1 } yychar = -1 goto yynewstate /* try again in the same state */ } } r := -yyn x0 := yyReductions[r] x, n := x0.xsym, x0.components yypt := yyp _ = yypt // guard against "declared and not used" yyp -= n if yyp+1 >= len(yyS) { nyys := make([]yySymType, len(yyS)*2) copy(nyys, yyS) yyS = nyys } yyVAL = yyS[yyp+1] /* consult goto table to find next state */ exState := yystate yystate = int(yyParseTab[yyS[yyp].yys][x]) + yyTabOfs /* reduction by production r */ if yyDebug >= 2 { __yyfmt__.Printf("reduce using rule %v (%s), and goto state %d\n", r, yySymNames[x], yystate) } switch r { case 1: { lx := yylex.(*lexer) lx.ast = yyS[yypt-0].node } case 2: { lx := yylex.(*lexer) lx.ast = &TranslationUnit{ ExternalDeclarationList: yyS[yypt-0].node.(*ExternalDeclarationList).reverse(), FileScope: lx.scope, FileSet: fset, Model: lx.model, } } case 3: { yyVAL.node = &EnumerationConstant{ Token: yyS[yypt-0].Token, } } case 4: { yyVAL.node = &ArgumentExprList{ Expr: yyS[yypt-0].node.(*Expr), } } case 5: { yyVAL.node = &ArgumentExprList{ Case: 1, ArgumentExprList: yyS[yypt-2].node.(*ArgumentExprList), Token: yyS[yypt-1].Token, Expr: yyS[yypt-0].node.(*Expr), } } case 6: { yyVAL.node = (*ArgumentExprListOpt)(nil) } case 7: { yyVAL.node = &ArgumentExprListOpt{ ArgumentExprList: yyS[yypt-0].node.(*ArgumentExprList).reverse(), } } case 8: { yyVAL.node = &Expr{ Case: ExprPreInc, Token: yyS[yypt-1].Token, Expr: yyS[yypt-0].node.(*Expr), } } case 9: { yyVAL.node = &Expr{ Case: ExprPreDec, Token: yyS[yypt-1].Token, Expr: yyS[yypt-0].node.(*Expr), } } case 10: { yyVAL.node = &Expr{ Case: ExprAlignofType, Token: yyS[yypt-3].Token, Token2: yyS[yypt-2].Token, TypeName: yyS[yypt-1].node.(*TypeName), Token3: yyS[yypt-0].Token, } } case 11: { yyVAL.node = &Expr{ Case: ExprAlignofExpr, Token: yyS[yypt-1].Token, Expr: yyS[yypt-0].node.(*Expr), } } case 12: { yyVAL.node = &Expr{ Case: ExprSizeofType, Token: yyS[yypt-3].Token, Token2: yyS[yypt-2].Token, TypeName: yyS[yypt-1].node.(*TypeName), Token3: yyS[yypt-0].Token, } } case 13: { yyVAL.node = &Expr{ Case: ExprSizeofExpr, Token: yyS[yypt-1].Token, Expr: yyS[yypt-0].node.(*Expr), } } case 14: { yyVAL.node = &Expr{ Case: ExprNot, Token: yyS[yypt-1].Token, Expr: yyS[yypt-0].node.(*Expr), } } case 15: { yyVAL.node = &Expr{ Case: ExprAddrof, Token: yyS[yypt-1].Token, Expr: yyS[yypt-0].node.(*Expr), } } case 16: { yyVAL.node = &Expr{ Case: ExprStatement, Token: yyS[yypt-2].Token, CompoundStmt: yyS[yypt-1].node.(*CompoundStmt), Token2: yyS[yypt-0].Token, } } case 17: { yyVAL.node = &Expr{ Case: ExprPExprList, Token: yyS[yypt-2].Token, ExprList: yyS[yypt-1].node.(*ExprList).reverse(), Token2: yyS[yypt-0].Token, } } case 18: { lx := yylex.(*lexer) lhs := &Expr{ Case: ExprCompLit, Token: yyS[yypt-6].Token, TypeName: yyS[yypt-5].node.(*TypeName), Token2: yyS[yypt-4].Token, Token3: yyS[yypt-3].Token, InitializerList: yyS[yypt-2].node.(*InitializerList).reverse(), CommaOpt: yyS[yypt-1].node.(*CommaOpt), Token4: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.Scope = lx.scope } case 19: { yyVAL.node = &Expr{ Case: ExprCast, Token: yyS[yypt-3].Token, TypeName: yyS[yypt-2].node.(*TypeName), Token2: yyS[yypt-1].Token, Expr: yyS[yypt-0].node.(*Expr), } } case 20: { yyVAL.node = &Expr{ Case: ExprDeref, Token: yyS[yypt-1].Token, Expr: yyS[yypt-0].node.(*Expr), } } case 21: { yyVAL.node = &Expr{ Case: ExprUnaryPlus, Token: yyS[yypt-1].Token, Expr: yyS[yypt-0].node.(*Expr), } } case 22: { yyVAL.node = &Expr{ Case: ExprUnaryMinus, Token: yyS[yypt-1].Token, Expr: yyS[yypt-0].node.(*Expr), } } case 23: { yyVAL.node = &Expr{ Case: ExprCpl, Token: yyS[yypt-1].Token, Expr: yyS[yypt-0].node.(*Expr), } } case 24: { yyVAL.node = &Expr{ Case: ExprChar, Token: yyS[yypt-0].Token, } } case 25: { yyVAL.node = &Expr{ Case: ExprNe, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 26: { yyVAL.node = &Expr{ Case: ExprModAssign, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 27: { yyVAL.node = &Expr{ Case: ExprLAnd, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 28: { yyVAL.node = &Expr{ Case: ExprAndAssign, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 29: { yyVAL.node = &Expr{ Case: ExprMulAssign, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 30: { yyVAL.node = &Expr{ Case: ExprPostInc, Expr: yyS[yypt-1].node.(*Expr), Token: yyS[yypt-0].Token, } } case 31: { yyVAL.node = &Expr{ Case: ExprAddAssign, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 32: { yyVAL.node = &Expr{ Case: ExprPostDec, Expr: yyS[yypt-1].node.(*Expr), Token: yyS[yypt-0].Token, } } case 33: { yyVAL.node = &Expr{ Case: ExprSubAssign, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 34: { yyVAL.node = &Expr{ Case: ExprPSelect, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 35: { yyVAL.node = &Expr{ Case: ExprDivAssign, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 36: { yyVAL.node = &Expr{ Case: ExprLsh, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 37: { yyVAL.node = &Expr{ Case: ExprLshAssign, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 38: { yyVAL.node = &Expr{ Case: ExprLe, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 39: { yyVAL.node = &Expr{ Case: ExprEq, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 40: { yyVAL.node = &Expr{ Case: ExprGe, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 41: { yyVAL.node = &Expr{ Case: ExprRsh, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 42: { yyVAL.node = &Expr{ Case: ExprRshAssign, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 43: { yyVAL.node = &Expr{ Case: ExprXorAssign, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 44: { yyVAL.node = &Expr{ Case: ExprOrAssign, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 45: { yyVAL.node = &Expr{ Case: ExprLOr, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 46: { yyVAL.node = &Expr{ Case: ExprMod, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 47: { yyVAL.node = &Expr{ Case: ExprAnd, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 48: { yyVAL.node = &Expr{ Case: ExprCall, Expr: yyS[yypt-3].node.(*Expr), Token: yyS[yypt-2].Token, ArgumentExprListOpt: yyS[yypt-1].node.(*ArgumentExprListOpt), Token2: yyS[yypt-0].Token, } } case 49: { yyVAL.node = &Expr{ Case: ExprMul, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 50: { yyVAL.node = &Expr{ Case: ExprAdd, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 51: { yyVAL.node = &Expr{ Case: ExprSub, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 52: { yyVAL.node = &Expr{ Case: ExprSelect, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 53: { yyVAL.node = &Expr{ Case: ExprDiv, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 54: { yyVAL.node = &Expr{ Case: ExprLt, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 55: { yyVAL.node = &Expr{ Case: ExprAssign, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 56: { yyVAL.node = &Expr{ Case: ExprGt, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 57: { yyVAL.node = &Expr{ Case: ExprCond, Expr: yyS[yypt-4].node.(*Expr), Token: yyS[yypt-3].Token, ExprList: yyS[yypt-2].node.(*ExprList).reverse(), Token2: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 58: { yyVAL.node = &Expr{ Case: ExprIndex, Expr: yyS[yypt-3].node.(*Expr), Token: yyS[yypt-2].Token, ExprList: yyS[yypt-1].node.(*ExprList).reverse(), Token2: yyS[yypt-0].Token, } } case 59: { yyVAL.node = &Expr{ Case: ExprXor, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 60: { yyVAL.node = &Expr{ Case: ExprOr, Expr: yyS[yypt-2].node.(*Expr), Token: yyS[yypt-1].Token, Expr2: yyS[yypt-0].node.(*Expr), } } case 61: { yyVAL.node = &Expr{ Case: ExprFloat, Token: yyS[yypt-0].Token, } } case 62: { lx := yylex.(*lexer) lhs := &Expr{ Case: ExprIdent, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.Scope = lx.scope } case 63: { yyVAL.node = &Expr{ Case: ExprInt, Token: yyS[yypt-0].Token, } } case 64: { yyVAL.node = &Expr{ Case: ExprLChar, Token: yyS[yypt-0].Token, } } case 65: { yyVAL.node = &Expr{ Case: ExprLString, Token: yyS[yypt-0].Token, } } case 66: { yyVAL.node = &Expr{ Case: ExprString, Token: yyS[yypt-0].Token, } } case 67: { yyVAL.node = (*ExprOpt)(nil) } case 68: { yyVAL.node = &ExprOpt{ Expr: yyS[yypt-0].node.(*Expr), } } case 69: { yyVAL.node = &ExprList{ Expr: yyS[yypt-0].node.(*Expr), } } case 70: { yyVAL.node = &ExprList{ Case: 1, ExprList: yyS[yypt-2].node.(*ExprList), Token: yyS[yypt-1].Token, Expr: yyS[yypt-0].node.(*Expr), } } case 71: { yyVAL.node = (*ExprListOpt)(nil) } case 72: { yyVAL.node = &ExprListOpt{ ExprList: yyS[yypt-0].node.(*ExprList).reverse(), } } case 73: { yyVAL.node = &ConstExpr{ Expr: yyS[yypt-0].node.(*Expr), } } case 74: { lx := yylex.(*lexer) lx.attr2 = lx.attr } case 75: { lx := yylex.(*lexer) lhs := &Declaration{ DeclarationSpecifiers: yyS[yypt-3].node.(*DeclarationSpecifiers), InitDeclaratorListOpt: yyS[yypt-2].node.(*InitDeclaratorListOpt), Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.Scope = lx.scope if len(lx.attr2) != 0 { lhs.Attributes = lx.attrs() } lx.scope.typedef = false } case 76: { yyVAL.node = &DeclarationSpecifiers{ Case: DeclarationSpecifiersFunc, FunctionSpecifier: yyS[yypt-1].node.(*FunctionSpecifier), DeclarationSpecifiersOpt: yyS[yypt-0].node.(*DeclarationSpecifiersOpt), } } case 77: { yyVAL.node = &DeclarationSpecifiers{ Case: DeclarationSpecifiersStorage, StorageClassSpecifier: yyS[yypt-1].node.(*StorageClassSpecifier), DeclarationSpecifiersOpt: yyS[yypt-0].node.(*DeclarationSpecifiersOpt), } } case 78: { yyVAL.node = &DeclarationSpecifiers{ Case: DeclarationSpecifiersQualifier, TypeQualifier: yyS[yypt-1].node.(*TypeQualifier), DeclarationSpecifiersOpt: yyS[yypt-0].node.(*DeclarationSpecifiersOpt), } } case 79: { yyVAL.node = &DeclarationSpecifiers{ Case: DeclarationSpecifiersSpecifier, TypeSpecifier: yyS[yypt-1].node.(*TypeSpecifier), DeclarationSpecifiersOpt: yyS[yypt-0].node.(*DeclarationSpecifiersOpt), } } case 80: { yyVAL.node = (*DeclarationSpecifiersOpt)(nil) } case 81: { yyVAL.node = &DeclarationSpecifiersOpt{ DeclarationSpecifiers: yyS[yypt-0].node.(*DeclarationSpecifiers), } } case 82: { yyVAL.node = &InitDeclaratorList{ InitDeclarator: yyS[yypt-0].node.(*InitDeclarator), } } case 83: { yyVAL.node = &InitDeclaratorList{ Case: 1, InitDeclaratorList: yyS[yypt-2].node.(*InitDeclaratorList), Token: yyS[yypt-1].Token, InitDeclarator: yyS[yypt-0].node.(*InitDeclarator), } } case 84: { yyVAL.node = (*InitDeclaratorListOpt)(nil) } case 85: { yyVAL.node = &InitDeclaratorListOpt{ InitDeclaratorList: yyS[yypt-0].node.(*InitDeclaratorList).reverse(), } } case 86: { yyVAL.node = &InitDeclarator{ Case: InitDeclaratorBase, Declarator: yyS[yypt-0].node.(*Declarator), } } case 87: { yyVAL.node = &InitDeclarator{ Case: InitDeclaratorInit, Declarator: yyS[yypt-2].node.(*Declarator), Token: yyS[yypt-1].Token, Initializer: yyS[yypt-0].node.(*Initializer), } } case 88: { yyVAL.node = &StorageClassSpecifier{ Case: StorageClassSpecifierAuto, Token: yyS[yypt-0].Token, } } case 89: { yyVAL.node = &StorageClassSpecifier{ Case: StorageClassSpecifierExtern, Token: yyS[yypt-0].Token, } } case 90: { yyVAL.node = &StorageClassSpecifier{ Case: StorageClassSpecifierRegister, Token: yyS[yypt-0].Token, } } case 91: { yyVAL.node = &StorageClassSpecifier{ Case: StorageClassSpecifierStatic, Token: yyS[yypt-0].Token, } } case 92: { lx := yylex.(*lexer) yyVAL.node = &StorageClassSpecifier{ Case: StorageClassSpecifierTypedef, Token: yyS[yypt-0].Token, } lx.scope.typedef = true } case 93: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierBool, Token: yyS[yypt-0].Token, } } case 94: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierComplex, Token: yyS[yypt-0].Token, } } case 95: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierChar, Token: yyS[yypt-0].Token, } } case 96: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierDouble, Token: yyS[yypt-0].Token, } } case 97: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierFloat, Token: yyS[yypt-0].Token, } } case 98: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierInt, Token: yyS[yypt-0].Token, } } case 99: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierLong, Token: yyS[yypt-0].Token, } } case 100: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierShort, Token: yyS[yypt-0].Token, } } case 101: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierSigned, Token: yyS[yypt-0].Token, } } case 102: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierUnsigned, Token: yyS[yypt-0].Token, } } case 103: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierVoid, Token: yyS[yypt-0].Token, } } case 104: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierEnum, EnumSpecifier: yyS[yypt-0].node.(*EnumSpecifier), } } case 105: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierStruct, StructOrUnionSpecifier: yyS[yypt-0].node.(*StructOrUnionSpecifier), } } case 106: { lx := yylex.(*lexer) lhs := &TypeSpecifier{ Case: TypeSpecifierName, Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.scope = lx.scope } case 107: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierTypeofExpr, Token: yyS[yypt-3].Token, Token2: yyS[yypt-2].Token, Expr: yyS[yypt-1].node.(*Expr), Token3: yyS[yypt-0].Token, } } case 108: { yyVAL.node = &TypeSpecifier{ Case: TypeSpecifierTypeof, Token: yyS[yypt-3].Token, Token2: yyS[yypt-2].Token, TypeName: yyS[yypt-1].node.(*TypeName), Token3: yyS[yypt-0].Token, } } case 109: { lx := yylex.(*lexer) lhs := &StructOrUnionSpecifier{ Case: StructOrUnionSpecifierTag, StructOrUnion: yyS[yypt-1].node.(*StructOrUnion), Token: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.scope = lx.scope } case 110: { lx := yylex.(*lexer) lx.noTypedefName = true // https://github.com/cznic/sqlite2go/issues/9 } case 111: { lx := yylex.(*lexer) yyVAL.node = &StructOrUnionSpecifier{ Case: StructOrUnionSpecifierEmpty, StructOrUnion: yyS[yypt-4].node.(*StructOrUnion), IdentifierOpt: yyS[yypt-3].node.(*IdentifierOpt), Token: yyS[yypt-2].Token, Token2: yyS[yypt-0].Token, } if !lx.tweaks.EnableEmptyStructs { lx.err(yyS[yypt-4].node, "empty structs/unions not allowed") } } case 112: { lx := yylex.(*lexer) lx.newStructScope() } case 113: { lx := yylex.(*lexer) lx.noTypedefName = true // https://github.com/cznic/sqlite2go/issues/9 } case 114: { lx := yylex.(*lexer) lhs := &StructOrUnionSpecifier{ Case: StructOrUnionSpecifierDefine, StructOrUnion: yyS[yypt-6].node.(*StructOrUnion), IdentifierOpt: yyS[yypt-5].node.(*IdentifierOpt), Token: yyS[yypt-4].Token, StructDeclarationList: yyS[yypt-2].node.(*StructDeclarationList).reverse(), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.scope, _ = lx.popScope() } case 115: { yyVAL.node = &StructOrUnion{ Case: StructOrUnionStruct, Token: yyS[yypt-0].Token, } } case 116: { yyVAL.node = &StructOrUnion{ Case: StructOrUnionUnion, Token: yyS[yypt-0].Token, } } case 117: { yyVAL.node = &StructDeclarationList{ StructDeclaration: yyS[yypt-0].node.(*StructDeclaration), } } case 118: { yyVAL.node = &StructDeclarationList{ Case: 1, StructDeclarationList: yyS[yypt-1].node.(*StructDeclarationList), StructDeclaration: yyS[yypt-0].node.(*StructDeclaration), } } case 119: { yyVAL.node = &StructDeclaration{ Case: StructDeclarationBase, SpecifierQualifierList: yyS[yypt-2].node.(*SpecifierQualifierList), StructDeclaratorList: yyS[yypt-1].node.(*StructDeclaratorList).reverse(), Token: yyS[yypt-0].Token, } } case 120: { lx := yylex.(*lexer) yyVAL.node = &StructDeclaration{ Case: StructDeclarationAnon, SpecifierQualifierList: yyS[yypt-1].node.(*SpecifierQualifierList), Token: yyS[yypt-0].Token, } if !lx.tweaks.EnableAnonymousStructFields { lx.err(yyS[yypt-1].node, "anonymous structs/unions members not allowed") } } case 121: { yyVAL.node = &SpecifierQualifierList{ Case: SpecifierQualifierListQualifier, TypeQualifier: yyS[yypt-1].node.(*TypeQualifier), SpecifierQualifierListOpt: yyS[yypt-0].node.(*SpecifierQualifierListOpt), } } case 122: { yyVAL.node = &SpecifierQualifierList{ Case: SpecifierQualifierListSpecifier, TypeSpecifier: yyS[yypt-1].node.(*TypeSpecifier), SpecifierQualifierListOpt: yyS[yypt-0].node.(*SpecifierQualifierListOpt), } } case 123: { yyVAL.node = (*SpecifierQualifierListOpt)(nil) } case 124: { yyVAL.node = &SpecifierQualifierListOpt{ SpecifierQualifierList: yyS[yypt-0].node.(*SpecifierQualifierList), } } case 125: { yyVAL.node = &StructDeclaratorList{ StructDeclarator: yyS[yypt-0].node.(*StructDeclarator), } } case 126: { yyVAL.node = &StructDeclaratorList{ Case: 1, StructDeclaratorList: yyS[yypt-2].node.(*StructDeclaratorList), Token: yyS[yypt-1].Token, StructDeclarator: yyS[yypt-0].node.(*StructDeclarator), } } case 127: { yyVAL.node = &StructDeclarator{ Case: StructDeclaratorBase, Declarator: yyS[yypt-0].node.(*Declarator), } } case 128: { yyVAL.node = &StructDeclarator{ Case: StructDeclaratorBits, DeclaratorOpt: yyS[yypt-2].node.(*DeclaratorOpt), Token: yyS[yypt-1].Token, ConstExpr: yyS[yypt-0].node.(*ConstExpr), } } case 129: { yyVAL.node = (*CommaOpt)(nil) } case 130: { yyVAL.node = &CommaOpt{ Token: yyS[yypt-0].Token, } } case 131: { lx := yylex.(*lexer) lhs := &EnumSpecifier{ Case: EnumSpecifierTag, Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.scope = lx.scope } case 132: { lx := yylex.(*lexer) lhs := &EnumSpecifier{ Case: EnumSpecifierDefine, Token: yyS[yypt-5].Token, IdentifierOpt: yyS[yypt-4].node.(*IdentifierOpt), Token2: yyS[yypt-3].Token, EnumeratorList: yyS[yypt-2].node.(*EnumeratorList).reverse(), CommaOpt: yyS[yypt-1].node.(*CommaOpt), Token3: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.scope = lx.scope } case 133: { yyVAL.node = &EnumeratorList{ Enumerator: yyS[yypt-0].node.(*Enumerator), } } case 134: { yyVAL.node = &EnumeratorList{ Case: 1, EnumeratorList: yyS[yypt-2].node.(*EnumeratorList), Token: yyS[yypt-1].Token, Enumerator: yyS[yypt-0].node.(*Enumerator), } } case 135: { yyVAL.node = &Enumerator{ Case: EnumeratorBase, EnumerationConstant: yyS[yypt-0].node.(*EnumerationConstant), } } case 136: { yyVAL.node = &Enumerator{ Case: EnumeratorInit, EnumerationConstant: yyS[yypt-2].node.(*EnumerationConstant), Token: yyS[yypt-1].Token, ConstExpr: yyS[yypt-0].node.(*ConstExpr), } } case 137: { yyVAL.node = &TypeQualifier{ Case: TypeQualifierConst, Token: yyS[yypt-0].Token, } } case 138: { yyVAL.node = &TypeQualifier{ Case: TypeQualifierRestrict, Token: yyS[yypt-0].Token, } } case 139: { yyVAL.node = &TypeQualifier{ Case: TypeQualifierVolatile, Token: yyS[yypt-0].Token, } } case 140: { yyVAL.node = &FunctionSpecifier{ Token: yyS[yypt-0].Token, } } case 141: { lx := yylex.(*lexer) lhs := &Declarator{ PointerOpt: yyS[yypt-1].node.(*PointerOpt), DirectDeclarator: yyS[yypt-0].node.(*DirectDeclarator), } yyVAL.node = lhs lhs.Attributes = lx.attrs() lhs.Scope = lx.scope if lx.scope.typedef { delete(lx.scope.Idents, lhs.DirectDeclarator.nm()) lx.scope.insertTypedef(lx.context, lhs) } } case 142: { yyVAL.node = (*DeclaratorOpt)(nil) } case 143: { yyVAL.node = &DeclaratorOpt{ Declarator: yyS[yypt-0].node.(*Declarator), } } case 144: { lhs := &DirectDeclarator{ Case: DirectDeclaratorParen, Token: yyS[yypt-2].Token, Declarator: yyS[yypt-1].node.(*Declarator), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.Declarator.Embedded = true } case 145: { lx := yylex.(*lexer) lx.newScope() } case 146: { lx := yylex.(*lexer) lhs := &DirectDeclarator{ Case: DirectDeclaratorIdentList, DirectDeclarator: yyS[yypt-4].node.(*DirectDeclarator), Token: yyS[yypt-3].Token, IdentifierListOpt: yyS[yypt-1].node.(*IdentifierListOpt), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.paramScope, _ = lx.popScope() } case 147: { lx := yylex.(*lexer) lx.newScope() } case 148: { lx := yylex.(*lexer) lhs := &DirectDeclarator{ Case: DirectDeclaratorParamList, DirectDeclarator: yyS[yypt-4].node.(*DirectDeclarator), Token: yyS[yypt-3].Token, ParameterTypeList: yyS[yypt-1].node.(*ParameterTypeList), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.paramScope, _ = lx.popScope() } case 149: { yyVAL.node = &DirectDeclarator{ Case: DirectDeclaratorArraySize, DirectDeclarator: yyS[yypt-5].node.(*DirectDeclarator), Token: yyS[yypt-4].Token, Token2: yyS[yypt-3].Token, TypeQualifierListOpt: yyS[yypt-2].node.(*TypeQualifierListOpt), Expr: yyS[yypt-1].node.(*Expr), Token3: yyS[yypt-0].Token, } } case 150: { yyVAL.node = &DirectDeclarator{ Case: DirectDeclaratorArraySize2, DirectDeclarator: yyS[yypt-5].node.(*DirectDeclarator), Token: yyS[yypt-4].Token, TypeQualifierList: yyS[yypt-3].node.(*TypeQualifierList).reverse(), Token2: yyS[yypt-2].Token, Expr: yyS[yypt-1].node.(*Expr), Token3: yyS[yypt-0].Token, } } case 151: { yyVAL.node = &DirectDeclarator{ Case: DirectDeclaratorArrayVar, DirectDeclarator: yyS[yypt-4].node.(*DirectDeclarator), Token: yyS[yypt-3].Token, TypeQualifierListOpt: yyS[yypt-2].node.(*TypeQualifierListOpt), Token2: yyS[yypt-1].Token, Token3: yyS[yypt-0].Token, } } case 152: { yyVAL.node = &DirectDeclarator{ Case: DirectDeclaratorArray, DirectDeclarator: yyS[yypt-4].node.(*DirectDeclarator), Token: yyS[yypt-3].Token, TypeQualifierListOpt: yyS[yypt-2].node.(*TypeQualifierListOpt), ExprOpt: yyS[yypt-1].node.(*ExprOpt), Token2: yyS[yypt-0].Token, } } case 153: { yyVAL.node = &DirectDeclarator{ Case: DirectDeclaratorIdent, Token: yyS[yypt-0].Token, } } case 154: { yyVAL.node = &Pointer{ Case: PointerBase, Token: yyS[yypt-1].Token, TypeQualifierListOpt: yyS[yypt-0].node.(*TypeQualifierListOpt), } } case 155: { yyVAL.node = &Pointer{ Case: PointerPtr, Token: yyS[yypt-2].Token, TypeQualifierListOpt: yyS[yypt-1].node.(*TypeQualifierListOpt), Pointer: yyS[yypt-0].node.(*Pointer), } } case 156: { yyVAL.node = (*PointerOpt)(nil) } case 157: { yyVAL.node = &PointerOpt{ Pointer: yyS[yypt-0].node.(*Pointer), } } case 158: { yyVAL.node = &TypeQualifierList{ TypeQualifier: yyS[yypt-0].node.(*TypeQualifier), } } case 159: { yyVAL.node = &TypeQualifierList{ Case: 1, TypeQualifierList: yyS[yypt-1].node.(*TypeQualifierList), TypeQualifier: yyS[yypt-0].node.(*TypeQualifier), } } case 160: { yyVAL.node = (*TypeQualifierListOpt)(nil) } case 161: { yyVAL.node = &TypeQualifierListOpt{ TypeQualifierList: yyS[yypt-0].node.(*TypeQualifierList).reverse(), } } case 162: { yyVAL.node = &ParameterTypeList{ Case: ParameterTypeListBase, ParameterList: yyS[yypt-0].node.(*ParameterList).reverse(), } } case 163: { yyVAL.node = &ParameterTypeList{ Case: ParameterTypeListDots, ParameterList: yyS[yypt-2].node.(*ParameterList).reverse(), Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 164: { yyVAL.node = (*ParameterTypeListOpt)(nil) } case 165: { yyVAL.node = &ParameterTypeListOpt{ ParameterTypeList: yyS[yypt-0].node.(*ParameterTypeList), } } case 166: { yyVAL.node = &ParameterList{ ParameterDeclaration: yyS[yypt-0].node.(*ParameterDeclaration), } } case 167: { yyVAL.node = &ParameterList{ Case: 1, ParameterList: yyS[yypt-2].node.(*ParameterList), Token: yyS[yypt-1].Token, ParameterDeclaration: yyS[yypt-0].node.(*ParameterDeclaration), } } case 168: { lx := yylex.(*lexer) yyVAL.node = &ParameterDeclaration{ Case: ParameterDeclarationAbstract, DeclarationSpecifiers: yyS[yypt-1].node.(*DeclarationSpecifiers), AbstractDeclaratorOpt: yyS[yypt-0].node.(*AbstractDeclaratorOpt), } lx.scope.typedef = false } case 169: { lx := yylex.(*lexer) yyVAL.node = &ParameterDeclaration{ Case: ParameterDeclarationDeclarator, DeclarationSpecifiers: yyS[yypt-1].node.(*DeclarationSpecifiers), Declarator: yyS[yypt-0].node.(*Declarator), } lx.scope.typedef = false } case 170: { yyVAL.node = &IdentifierList{ Token: yyS[yypt-0].Token, } } case 171: { yyVAL.node = &IdentifierList{ Case: 1, IdentifierList: yyS[yypt-2].node.(*IdentifierList), Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 172: { yyVAL.node = (*IdentifierListOpt)(nil) } case 173: { yyVAL.node = &IdentifierListOpt{ IdentifierList: yyS[yypt-0].node.(*IdentifierList).reverse(), } } case 174: { yyVAL.node = (*IdentifierOpt)(nil) } case 175: { yyVAL.node = &IdentifierOpt{ Token: yyS[yypt-0].Token, } } case 176: { yyVAL.node = &TypeName{ SpecifierQualifierList: yyS[yypt-1].node.(*SpecifierQualifierList), AbstractDeclaratorOpt: yyS[yypt-0].node.(*AbstractDeclaratorOpt), } } case 177: { yyVAL.node = &AbstractDeclarator{ Case: AbstractDeclaratorPointer, Pointer: yyS[yypt-0].node.(*Pointer), } } case 178: { yyVAL.node = &AbstractDeclarator{ Case: AbstractDeclaratorAbstract, PointerOpt: yyS[yypt-1].node.(*PointerOpt), DirectAbstractDeclarator: yyS[yypt-0].node.(*DirectAbstractDeclarator), } } case 179: { yyVAL.node = (*AbstractDeclaratorOpt)(nil) } case 180: { yyVAL.node = &AbstractDeclaratorOpt{ AbstractDeclarator: yyS[yypt-0].node.(*AbstractDeclarator), } } case 181: { yyVAL.node = &DirectAbstractDeclarator{ Case: DirectAbstractDeclaratorAbstract, Token: yyS[yypt-2].Token, AbstractDeclarator: yyS[yypt-1].node.(*AbstractDeclarator), Token2: yyS[yypt-0].Token, } } case 182: { yyVAL.node = &DirectAbstractDeclarator{ Case: DirectAbstractDeclaratorParamList, Token: yyS[yypt-2].Token, ParameterTypeListOpt: yyS[yypt-1].node.(*ParameterTypeListOpt), Token2: yyS[yypt-0].Token, } } case 183: { yyVAL.node = &DirectAbstractDeclarator{ Case: DirectAbstractDeclaratorDFn, DirectAbstractDeclarator: yyS[yypt-3].node.(*DirectAbstractDeclarator), Token: yyS[yypt-2].Token, ParameterTypeListOpt: yyS[yypt-1].node.(*ParameterTypeListOpt), Token2: yyS[yypt-0].Token, } } case 184: { yyVAL.node = &DirectAbstractDeclarator{ Case: DirectAbstractDeclaratorDArrSize, DirectAbstractDeclaratorOpt: yyS[yypt-5].node.(*DirectAbstractDeclaratorOpt), Token: yyS[yypt-4].Token, Token2: yyS[yypt-3].Token, TypeQualifierListOpt: yyS[yypt-2].node.(*TypeQualifierListOpt), Expr: yyS[yypt-1].node.(*Expr), Token3: yyS[yypt-0].Token, } } case 185: { yyVAL.node = &DirectAbstractDeclarator{ Case: DirectAbstractDeclaratorDArrVL, DirectAbstractDeclaratorOpt: yyS[yypt-3].node.(*DirectAbstractDeclaratorOpt), Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, Token3: yyS[yypt-0].Token, } } case 186: { yyVAL.node = &DirectAbstractDeclarator{ Case: DirectAbstractDeclaratorDArr, DirectAbstractDeclaratorOpt: yyS[yypt-3].node.(*DirectAbstractDeclaratorOpt), Token: yyS[yypt-2].Token, ExprOpt: yyS[yypt-1].node.(*ExprOpt), Token2: yyS[yypt-0].Token, } } case 187: { yyVAL.node = &DirectAbstractDeclarator{ Case: DirectAbstractDeclaratorDArrSize2, DirectAbstractDeclaratorOpt: yyS[yypt-5].node.(*DirectAbstractDeclaratorOpt), Token: yyS[yypt-4].Token, TypeQualifierList: yyS[yypt-3].node.(*TypeQualifierList).reverse(), Token2: yyS[yypt-2].Token, Expr: yyS[yypt-1].node.(*Expr), Token3: yyS[yypt-0].Token, } } case 188: { yyVAL.node = &DirectAbstractDeclarator{ Case: DirectAbstractDeclaratorDArr2, DirectAbstractDeclaratorOpt: yyS[yypt-4].node.(*DirectAbstractDeclaratorOpt), Token: yyS[yypt-3].Token, TypeQualifierList: yyS[yypt-2].node.(*TypeQualifierList).reverse(), ExprOpt: yyS[yypt-1].node.(*ExprOpt), Token2: yyS[yypt-0].Token, } } case 189: { yyVAL.node = (*DirectAbstractDeclaratorOpt)(nil) } case 190: { yyVAL.node = &DirectAbstractDeclaratorOpt{ DirectAbstractDeclarator: yyS[yypt-0].node.(*DirectAbstractDeclarator), } } case 191: { yyVAL.node = &Initializer{ Case: InitializerCompLit, Token: yyS[yypt-3].Token, InitializerList: yyS[yypt-2].node.(*InitializerList).reverse(), CommaOpt: yyS[yypt-1].node.(*CommaOpt), Token2: yyS[yypt-0].Token, } } case 192: { yyVAL.node = &Initializer{ Case: InitializerExpr, Expr: yyS[yypt-0].node.(*Expr), } } case 193: { yyVAL.node = (*InitializerList)(nil) } case 194: { yyVAL.node = &InitializerList{ Case: 1, Initializer: yyS[yypt-0].node.(*Initializer), } } case 195: { yyVAL.node = &InitializerList{ Case: 2, Designation: yyS[yypt-1].node.(*Designation), Initializer: yyS[yypt-0].node.(*Initializer), } } case 196: { yyVAL.node = &InitializerList{ Case: 3, InitializerList: yyS[yypt-2].node.(*InitializerList), Token: yyS[yypt-1].Token, Initializer: yyS[yypt-0].node.(*Initializer), } } case 197: { yyVAL.node = &InitializerList{ Case: 4, InitializerList: yyS[yypt-3].node.(*InitializerList), Token: yyS[yypt-2].Token, Designation: yyS[yypt-1].node.(*Designation), Initializer: yyS[yypt-0].node.(*Initializer), } } case 198: { yyVAL.node = &Designation{ DesignatorList: yyS[yypt-1].node.(*DesignatorList).reverse(), Token: yyS[yypt-0].Token, } } case 199: { yyVAL.node = &DesignatorList{ Designator: yyS[yypt-0].node.(*Designator), } } case 200: { yyVAL.node = &DesignatorList{ Case: 1, DesignatorList: yyS[yypt-1].node.(*DesignatorList), Designator: yyS[yypt-0].node.(*Designator), } } case 201: { yyVAL.node = &Designator{ Case: DesignatorField, Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 202: { yyVAL.node = &Designator{ Case: DesignatorIndex, Token: yyS[yypt-2].Token, ConstExpr: yyS[yypt-1].node.(*ConstExpr), Token2: yyS[yypt-0].Token, } } case 203: { yyVAL.node = &Stmt{ Case: StmtBlock, CompoundStmt: yyS[yypt-0].node.(*CompoundStmt), } } case 204: { yyVAL.node = &Stmt{ Case: StmtExpr, ExprStmt: yyS[yypt-0].node.(*ExprStmt), } } case 205: { yyVAL.node = &Stmt{ Case: StmtIter, IterationStmt: yyS[yypt-0].node.(*IterationStmt), } } case 206: { yyVAL.node = &Stmt{ Case: StmtJump, JumpStmt: yyS[yypt-0].node.(*JumpStmt), } } case 207: { yyVAL.node = &Stmt{ Case: StmtLabeled, LabeledStmt: yyS[yypt-0].node.(*LabeledStmt), } } case 208: { yyVAL.node = &Stmt{ Case: StmtSelect, SelectionStmt: yyS[yypt-0].node.(*SelectionStmt), } } case 209: { yyVAL.node = &LabeledStmt{ Case: LabeledStmtSwitchCase, Token: yyS[yypt-3].Token, ConstExpr: yyS[yypt-2].node.(*ConstExpr), Token2: yyS[yypt-1].Token, Stmt: yyS[yypt-0].node.(*Stmt), } } case 210: { yyVAL.node = &LabeledStmt{ Case: LabeledStmtDefault, Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, Stmt: yyS[yypt-0].node.(*Stmt), } } case 211: { lx := yylex.(*lexer) lhs := &LabeledStmt{ Case: LabeledStmtLabel, Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, Stmt: yyS[yypt-0].node.(*Stmt), } yyVAL.node = lhs lx.scope.insertLabel(lx.context, lhs) } case 212: { lx := yylex.(*lexer) lhs := &LabeledStmt{ Case: LabeledStmtLabel2, Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, Stmt: yyS[yypt-0].node.(*Stmt), } yyVAL.node = lhs lx.scope.insertLabel(lx.context, lhs) } case 213: { lx := yylex.(*lexer) lx.newScope() } case 214: { lx := yylex.(*lexer) lhs := &CompoundStmt{ Token: yyS[yypt-3].Token, BlockItemListOpt: yyS[yypt-1].node.(*BlockItemListOpt), Token2: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.scope, _ = lx.popScope() } case 215: { yyVAL.node = &BlockItemList{ BlockItem: yyS[yypt-0].node.(*BlockItem), } } case 216: { yyVAL.node = &BlockItemList{ Case: 1, BlockItemList: yyS[yypt-1].node.(*BlockItemList), BlockItem: yyS[yypt-0].node.(*BlockItem), } } case 217: { yyVAL.node = (*BlockItemListOpt)(nil) } case 218: { yyVAL.node = &BlockItemListOpt{ BlockItemList: yyS[yypt-0].node.(*BlockItemList).reverse(), } } case 219: { yyVAL.node = &BlockItem{ Case: BlockItemDecl, Declaration: yyS[yypt-0].node.(*Declaration), } } case 220: { yyVAL.node = &BlockItem{ Case: BlockItemStmt, Stmt: yyS[yypt-0].node.(*Stmt), } } case 221: { yyVAL.node = &ExprStmt{ ExprListOpt: yyS[yypt-1].node.(*ExprListOpt), Token: yyS[yypt-0].Token, } } case 222: { yyVAL.node = &SelectionStmt{ Case: SelectionStmtIfElse, Token: yyS[yypt-6].Token, Token2: yyS[yypt-5].Token, ExprList: yyS[yypt-4].node.(*ExprList).reverse(), Token3: yyS[yypt-3].Token, Stmt: yyS[yypt-2].node.(*Stmt), Token4: yyS[yypt-1].Token, Stmt2: yyS[yypt-0].node.(*Stmt), } } case 223: { yyVAL.node = &SelectionStmt{ Case: SelectionStmtIf, Token: yyS[yypt-4].Token, Token2: yyS[yypt-3].Token, ExprList: yyS[yypt-2].node.(*ExprList).reverse(), Token3: yyS[yypt-1].Token, Stmt: yyS[yypt-0].node.(*Stmt), } } case 224: { yyVAL.node = &SelectionStmt{ Case: SelectionStmtSwitch, Token: yyS[yypt-4].Token, Token2: yyS[yypt-3].Token, ExprList: yyS[yypt-2].node.(*ExprList).reverse(), Token3: yyS[yypt-1].Token, Stmt: yyS[yypt-0].node.(*Stmt), } } case 225: { yyVAL.node = &IterationStmt{ Case: IterationStmtDo, Token: yyS[yypt-6].Token, Stmt: yyS[yypt-5].node.(*Stmt), Token2: yyS[yypt-4].Token, Token3: yyS[yypt-3].Token, ExprList: yyS[yypt-2].node.(*ExprList).reverse(), Token4: yyS[yypt-1].Token, Token5: yyS[yypt-0].Token, } } case 226: { lx := yylex.(*lexer) yyVAL.node = &IterationStmt{ Case: IterationStmtForDecl, Token: yyS[yypt-7].Token, Token2: yyS[yypt-6].Token, Declaration: yyS[yypt-5].node.(*Declaration), ExprListOpt: yyS[yypt-4].node.(*ExprListOpt), Token3: yyS[yypt-3].Token, ExprListOpt2: yyS[yypt-2].node.(*ExprListOpt), Token4: yyS[yypt-1].Token, Stmt: yyS[yypt-0].node.(*Stmt), } lx.popScope() } case 227: { lx := yylex.(*lexer) yyVAL.node = &IterationStmt{ Case: IterationStmtFor, Token: yyS[yypt-8].Token, Token2: yyS[yypt-7].Token, ExprListOpt: yyS[yypt-6].node.(*ExprListOpt), Token3: yyS[yypt-5].Token, ExprListOpt2: yyS[yypt-4].node.(*ExprListOpt), Token4: yyS[yypt-3].Token, ExprListOpt3: yyS[yypt-2].node.(*ExprListOpt), Token5: yyS[yypt-1].Token, Stmt: yyS[yypt-0].node.(*Stmt), } lx.popScope() } case 228: { yyVAL.node = &IterationStmt{ Case: IterationStmtWhile, Token: yyS[yypt-4].Token, Token2: yyS[yypt-3].Token, ExprList: yyS[yypt-2].node.(*ExprList).reverse(), Token3: yyS[yypt-1].Token, Stmt: yyS[yypt-0].node.(*Stmt), } } case 229: { yyVAL.node = &JumpStmt{ Case: JumpStmtBreak, Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 230: { yyVAL.node = &JumpStmt{ Case: JumpStmtContinue, Token: yyS[yypt-1].Token, Token2: yyS[yypt-0].Token, } } case 231: { lx := yylex.(*lexer) lhs := &JumpStmt{ Case: JumpStmtGoto, Token: yyS[yypt-2].Token, Token2: yyS[yypt-1].Token, Token3: yyS[yypt-0].Token, } yyVAL.node = lhs lhs.scope = lx.scope } case 232: { yyVAL.node = &JumpStmt{ Case: JumpStmtReturn, Token: yyS[yypt-2].Token, ExprListOpt: yyS[yypt-1].node.(*ExprListOpt), Token2: yyS[yypt-0].Token, } } case 233: { yyVAL.node = &ExternalDeclarationList{ ExternalDeclaration: yyS[yypt-0].node.(*ExternalDeclaration), } } case 234: { yyVAL.node = &ExternalDeclarationList{ Case: 1, ExternalDeclarationList: yyS[yypt-1].node.(*ExternalDeclarationList), ExternalDeclaration: yyS[yypt-0].node.(*ExternalDeclaration), } } case 235: { yyVAL.node = &ExternalDeclaration{ Case: ExternalDeclarationDecl, Declaration: yyS[yypt-0].node.(*Declaration), } } case 236: { yyVAL.node = &ExternalDeclaration{ Case: ExternalDeclarationFunc, FunctionDefinition: yyS[yypt-0].node.(*FunctionDefinition), } } case 237: { lx := yylex.(*lexer) lx.scope.typedef = false lx.currFn = yyS[yypt-0].node.(*Declarator).Name() } case 238: { lx := yylex.(*lexer) lhs := &FunctionDefinition{ Case: FunctionDefinitionSpec, DeclarationSpecifiers: yyS[yypt-4].node.(*DeclarationSpecifiers), Declarator: yyS[yypt-3].node.(*Declarator), DeclarationListOpt: yyS[yypt-1].node.(*DeclarationListOpt), FunctionBody: yyS[yypt-0].node.(*FunctionBody), } yyVAL.node = lhs lhs.Declarator.FunctionDefinition = lhs if lx.scope.Parent != nil { panic("internal error") } } case 239: { lx := yylex.(*lexer) if !lx.tweaks.EnableOmitFuncDeclSpec { lx.err(yyS[yypt-0].node, "omitting function declaration specifiers not allowed") } lx.scope.typedef = false lx.currFn = yyS[yypt-0].node.(*Declarator).Name() } case 240: { lx := yylex.(*lexer) lhs := &FunctionDefinition{ Case: FunctionDefinitionInt, Declarator: yyS[yypt-3].node.(*Declarator), DeclarationListOpt: yyS[yypt-1].node.(*DeclarationListOpt), FunctionBody: yyS[yypt-0].node.(*FunctionBody), } yyVAL.node = lhs lhs.Declarator.FunctionDefinition = lhs if lx.scope.Parent != nil { panic("internal error") } } case 241: { lx := yylex.(*lexer) lx.declareFuncName() // [0], 6.4.2.2. } case 242: { yyVAL.node = &FunctionBody{ CompoundStmt: yyS[yypt-0].node.(*CompoundStmt), } } case 243: { yyVAL.node = &DeclarationList{ Declaration: yyS[yypt-0].node.(*Declaration), } } case 244: { yyVAL.node = &DeclarationList{ Case: 1, DeclarationList: yyS[yypt-1].node.(*DeclarationList), Declaration: yyS[yypt-0].node.(*Declaration), } } case 245: { yyVAL.node = (*DeclarationListOpt)(nil) } case 246: { yyVAL.node = &DeclarationListOpt{ DeclarationList: yyS[yypt-0].node.(*DeclarationList).reverse(), } } case 247: { yyVAL.node = (*VolatileOpt)(nil) } case 248: { yyVAL.node = &VolatileOpt{ Token: yyS[yypt-0].Token, } } } if yyEx != nil && yyEx.Reduced(r, exState, &yyVAL) { return -1 } goto yystack /* stack new state and value */ } ================================================ FILE: v2/parser.yy ================================================ %{ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on [0], 6.5-6.10. Substantial portions of expression AST size // optimizations are from [1], license of which follows. // // [0]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf // [1]: https://github.com/rsc/c2go/blob/fc8cbfad5a47373828c81c7a56cccab8b221d310/cc/cc.y // ---------------------------------------------------------------------------- // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This grammar is derived from the C grammar in the 'ansitize' // program, which carried this notice: // // Copyright (c) 2006 Russ Cox, // Massachusetts Institute of Technology // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated // documentation files (the "Software"), to deal in the // Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, // sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, // subject to the following conditions: // // The above copyright notice and this permission notice shall // be included in all copies or substantial portions of the // Software. // // The software is provided "as is", without warranty of any // kind, express or implied, including but not limited to the // warranties of merchantability, fitness for a particular // purpose and noninfringement. In no event shall the authors // or copyright holders be liable for any claim, damages or // other liability, whether in an action of contract, tort or // otherwise, arising from, out of or in connection with the // software or the use or other dealings in the software. package cc import ( "github.com/cznic/xc" ) %} %union { Token xc.Token // Must be exported node Node } %token /*yy:token "'%c'" */ CHARCONST "character constant" /*yy:token "1.%d" */ FLOATCONST "floating-point constant" /*yy:token "%c" */ IDENTIFIER "identifier" /*yy:token "%d" */ INTCONST "integer constant" /*yy:token "L'%c'" */ LONGCHARCONST "long character constant" /*yy:token "L\"%c\"" */ LONGSTRINGLITERAL "long string constant" /*yy:token "%d" */ PPNUMBER "preprocessing number" /*yy:token "\"%c\"" */ STRINGLITERAL "string literal" /*yy:token "\U00100000" */ CONSTANT_EXPRESSION 1048576 "constant expression prefix" // 0x100000 = 1048576 /*yy:token "\U00100001" */ TRANSLATION_UNIT 1048577 "translation unit prefix" ADDASSIGN "+=" ANDAND "&&" ANDASSIGN "&=" ARROW "->" ALIGNOF "__alignof__" AUTO "auto" BOOL "_Bool" BREAK "break" CASE "case" CHAR "char" COMPLEX "_Complex" CONST "const" CONTINUE "continue" DDD "..." DEC "--" DEFAULT "default" DIRECTIVE // # when it's the first non white token on a line. DIVASSIGN "/=" DO "do" DOUBLE "double" ELSE "else" ENUM "enum" EQ "==" EXTERN "extern" FLOAT "float" FOR "for" GEQ ">=" GOTO "goto" IF "if" INC "++" INLINE "inline" INT "int" LEQ "<=" LONG "long" LSH "<<" LSHASSIGN "<<=" MODASSIGN "%=" MULASSIGN "*=" NEQ "!=" NON_REPL // [0]6.10.3.4-2 ORASSIGN "|=" OROR "||" PPPASTE "##" REGISTER "register" RESTRICT "restrict" RETURN "return" RSH ">>" RSHASSIGN ">>=" SHORT "short" SIGNED "signed" SIZEOF "sizeof" STATIC "static" STRUCT "struct" SUBASSIGN "-=" SWITCH "switch" TYPEDEF "typedef" TYPEDEF_NAME "typedef name" TYPEOF "typeof" UNION "union" UNSIGNED "unsigned" VOID "void" VOLATILE "volatile" WHILE "while" XORASSIGN "^=" %type AbstractDeclarator "abstract declarator" AbstractDeclaratorOpt "optional abstract declarator" ArgumentExprList "argument expression list" ArgumentExprListOpt "optional argument expression list" BlockItem "block item" BlockItemList "block item list" BlockItemListOpt "optional block item list" CommaOpt "optional comma" CompoundStmt "compound statement" ConstExpr "constant expression" Declaration "declaration" DeclarationList "declaration list" DeclarationListOpt "optional declaration list" DeclarationSpecifiers "declaration specifiers" DeclarationSpecifiersOpt "optional declaration specifiers" Declarator "declarator" DeclaratorOpt "optional declarator" Designation "designation" Designator "designator" DesignatorList "designator list" DirectAbstractDeclarator "direct abstract declarator" DirectAbstractDeclaratorOpt "optional direct abstract declarator" DirectDeclarator "direct declarator" EnumSpecifier "enum specifier" EnumerationConstant "enumearation constant" Enumerator "enumerator" EnumeratorList "enumerator list" Expr "expression" ExprList "expression list" ExprListOpt "optional expression list" ExprOpt "optional expression" ExprStmt "expression statement" ExternalDeclaration "external declaration" ExternalDeclarationList "external declaration list" FunctionBody "function body" FunctionDefinition "function definition" FunctionSpecifier "function specifier" IdentifierList "identifier list" IdentifierListOpt "optional identifier list" IdentifierOpt "optional identifier" InitDeclarator "init declarator" InitDeclaratorList "init declarator list" InitDeclaratorListOpt "optional init declarator list" Initializer "initializer" InitializerList "initializer list" IterationStmt "iteration statement" JumpStmt "jump statement" LabeledStmt "labeled statement" ParameterDeclaration "parameter declaration" ParameterList "parameter list" ParameterTypeList "parameter type list" ParameterTypeListOpt "optional parameter type list" Pointer "pointer" PointerOpt "optional pointer" SelectionStmt "selection statement" SpecifierQualifierList "specifier qualifier list" SpecifierQualifierListOpt "optional specifier qualifier list" Stmt "statement" StorageClassSpecifier "storage class specifier" StructDeclaration "struct declaration" StructDeclarationList "struct declaration list" StructDeclarator "struct declarator" StructDeclaratorList "struct declarator list" StructOrUnion "struct-or-union" StructOrUnionSpecifier "struct-or-union specifier" TypeName "type name" TypeQualifier "type qualifier" TypeQualifierList "type qualifier list" TypeQualifierListOpt "optional type qualifier list" TypeSpecifier "type specifier" VolatileOpt "optional volatile" %precedence NOSEMI %precedence ';' %precedence NOELSE %precedence ELSE %right '=' ADDASSIGN ANDASSIGN DIVASSIGN LSHASSIGN MODASSIGN MULASSIGN ORASSIGN RSHASSIGN SUBASSIGN XORASSIGN %right ':' '?' %left OROR %left ANDAND %left '|' %left '^' %left '&' %left EQ NEQ %left '<' '>' GEQ LEQ %left LSH RSH %left '+' '-' %left '%' '*' '/' %precedence CAST %left '!' '~' ALIGNOF SIZEOF UNARY %right '(' '.' '[' ARROW DEC INC %% /*yy:ignore */ Start: CONSTANT_EXPRESSION ConstExpr { lx.ast = $2 } | TRANSLATION_UNIT ExternalDeclarationList { lx.ast = &TranslationUnit{ ExternalDeclarationList: $2.(*ExternalDeclarationList).reverse(), FileScope: lx.scope, FileSet: fset, Model: lx.model, } } // [0]6.4.4.3 //yy:field Operand Operand EnumerationConstant: IDENTIFIER // [0]6.5.2 ArgumentExprList: Expr | ArgumentExprList ',' Expr ArgumentExprListOpt: /* empty */ {} | ArgumentExprList // [0]6.5.16 //yy:field CallArgs []Operand // Promoted arguments of Call. //yy:field Declarator *Declarator // Case Ident. //yy:field Operand Operand //yy:field Scope *Scope // Case Ident, CompLit. //yy:field enum *EnumType //yy:field AssignedTo bool // Expression appears at the left side of assignment. /*yy:case PreInc */ Expr: "++" Expr /*yy:case PreDec */ | "--" Expr /*yy:case AlignofType*/ | "__alignof__" '(' TypeName ')' %prec ALIGNOF /*yy:case AlignofExpr*/ | "__alignof__" Expr /*yy:case SizeofType */ | "sizeof" '(' TypeName ')' %prec SIZEOF /*yy:case SizeofExpr */ | "sizeof" Expr /*yy:case Not */ | '!' Expr /*yy:case Addrof */ | '&' Expr %prec UNARY /*yy:case Statement */ | '(' CompoundStmt ')' /*yy:case PExprList */ | '(' ExprList ')' /*yy:case CompLit */ | '(' TypeName ')' '{' InitializerList CommaOpt '}' { lhs.Scope = lx.scope } /*yy:case Cast */ | '(' TypeName ')' Expr %prec CAST /*yy:case Deref */ | '*' Expr %prec UNARY /*yy:case UnaryPlus */ | '+' Expr %prec UNARY /*yy:case UnaryMinus */ | '-' Expr %prec UNARY /*yy:case Cpl */ | '~' Expr /*yy:case Char */ | CHARCONST /*yy:case Ne */ | Expr "!=" Expr /*yy:case ModAssign */ | Expr "%=" Expr /*yy:case LAnd */ | Expr "&&" Expr /*yy:case AndAssign */ | Expr "&=" Expr /*yy:case MulAssign */ | Expr "*=" Expr /*yy:case PostInc */ | Expr "++" /*yy:case AddAssign */ | Expr "+=" Expr /*yy:case PostDec */ | Expr "--" /*yy:case SubAssign */ | Expr "-=" Expr /*yy:case PSelect */ | Expr "->" IDENTIFIER /*yy:case DivAssign */ | Expr "/=" Expr /*yy:case Lsh */ | Expr "<<" Expr /*yy:case LshAssign */ | Expr "<<=" Expr /*yy:case Le */ | Expr "<=" Expr /*yy:case Eq */ | Expr "==" Expr /*yy:case Ge */ | Expr ">=" Expr /*yy:case Rsh */ | Expr ">>" Expr /*yy:case RshAssign */ | Expr ">>=" Expr /*yy:case XorAssign */ | Expr "^=" Expr /*yy:case OrAssign */ | Expr "|=" Expr /*yy:case LOr */ | Expr "||" Expr /*yy:case Mod */ | Expr '%' Expr /*yy:case And */ | Expr '&' Expr /*yy:case Call */ | Expr '(' ArgumentExprListOpt ')' /*yy:case Mul */ | Expr '*' Expr /*yy:case Add */ | Expr '+' Expr /*yy:case Sub */ | Expr '-' Expr /*yy:case Select */ | Expr '.' IDENTIFIER /*yy:case Div */ | Expr '/' Expr /*yy:case Lt */ | Expr '<' Expr /*yy:case Assign */ | Expr '=' Expr /*yy:case Gt */ | Expr '>' Expr /*yy:case Cond */ | Expr '?' ExprList ':' Expr /*yy:case Index */ | Expr '[' ExprList ']' /*yy:case Xor */ | Expr '^' Expr /*yy:case Or */ | Expr '|' Expr /*yy:case Float */ | FLOATCONST /*yy:case Ident */ | IDENTIFIER %prec NOSEMI { lhs.Scope = lx.scope } /*yy:case Int */ | INTCONST /*yy:case LChar */ | LONGCHARCONST /*yy:case LString */ | LONGSTRINGLITERAL /*yy:case String */ | STRINGLITERAL ExprOpt: /* empty */ {} | Expr // [0]6.5.17 //yy:list //yy:field Operand Operand ExprList: Expr | ExprList ',' Expr ExprListOpt: /* empty */ {} | ExprList // [0]6.6 //yy:field Operand Operand ConstExpr: Expr // [0]6.7 //yy:field Attributes [][]xc.Token //yy:field Scope *Scope Declaration: DeclarationSpecifiers InitDeclaratorListOpt { lx.attr2 = lx.attr } ';' { lhs.Scope = lx.scope if len(lx.attr2) != 0 { lhs.Attributes = lx.attrs() } lx.scope.typedef = false } // [0]6.7 /*yy:case Func */ DeclarationSpecifiers: FunctionSpecifier DeclarationSpecifiersOpt /*yy:case Storage */ | StorageClassSpecifier DeclarationSpecifiersOpt /*yy:case Qualifier */ | TypeQualifier DeclarationSpecifiersOpt /*yy:case Specifier */ | TypeSpecifier DeclarationSpecifiersOpt DeclarationSpecifiersOpt: /* empty */ {} | DeclarationSpecifiers // [0]6.7 InitDeclaratorList: InitDeclarator | InitDeclaratorList ',' InitDeclarator InitDeclaratorListOpt: /* empty */ {} | InitDeclaratorList // [0]6.7 /*yy:case Base */ InitDeclarator: Declarator /*yy:case Init */ | Declarator '=' Initializer // [0]6.7.1 /*yy:case Auto */ StorageClassSpecifier: "auto" /*yy:case Extern */ | "extern" /*yy:case Register */ | "register" /*yy:case Static */ | "static" /*yy:case Typedef */ | "typedef" { lx.scope.typedef = true } // [0]6.7.2 //yy:field scope *Scope //yy:field typ Type // typeof /*yy:case Bool */ TypeSpecifier: "_Bool" /*yy:case Complex */ | "_Complex" /*yy:case Char */ | "char" /*yy:case Double */ | "double" /*yy:case Float */ | "float" /*yy:case Int */ | "int" /*yy:case Long */ | "long" /*yy:case Short */ | "short" /*yy:case Signed */ | "signed" /*yy:case Unsigned */ | "unsigned" /*yy:case Void */ | "void" /*yy:case Enum */ | EnumSpecifier /*yy:case Struct */ | StructOrUnionSpecifier /*yy:example "\U00100001 typedef int foo; foo bar;" */ /*yy:case Name */ | TYPEDEF_NAME { lhs.scope = lx.scope } /*yy:case TypeofExpr */ | "typeof" '(' Expr ')' /*yy:case Typeof */ | "typeof" '(' TypeName ')' // [0]6.7.2.1 //yy:field scope *Scope // Declare the struct tag in scope.parent. //yy:field typ Type /*yy:case Tag */ StructOrUnionSpecifier: StructOrUnion IDENTIFIER { lhs.scope = lx.scope } /*yy:case Empty */ | StructOrUnion IdentifierOpt '{' { lx.noTypedefName = true // https://github.com/cznic/sqlite2go/issues/9 } '}' { if !lx.tweaks.EnableEmptyStructs { lx.err($1, "empty structs/unions not allowed") } } /*yy:case Define */ | StructOrUnion IdentifierOpt '{' { lx.newStructScope() } StructDeclarationList { lx.noTypedefName = true // https://github.com/cznic/sqlite2go/issues/9 } '}' { lhs.scope, _ = lx.popScope() } // [0]6.7.2.1 /*yy:case Struct */ StructOrUnion: "struct" /*yy:case Union */ | "union" // [0]6.7.2.1 StructDeclarationList: StructDeclaration | StructDeclarationList StructDeclaration // [0]6.7.2.1 /*yy:case Base */ StructDeclaration: SpecifierQualifierList StructDeclaratorList ';' /*yy:case Anon */ | SpecifierQualifierList ';' { if !lx.tweaks.EnableAnonymousStructFields { lx.err($1, "anonymous structs/unions members not allowed") } } // [0]6.7.2.1 /*yy:case Qualifier */ SpecifierQualifierList: TypeQualifier SpecifierQualifierListOpt /*yy:case Specifier */ | TypeSpecifier SpecifierQualifierListOpt SpecifierQualifierListOpt: /* empty */ {} | SpecifierQualifierList // [0]6.7.2.1 StructDeclaratorList: StructDeclarator | StructDeclaratorList ',' StructDeclarator // [0]6.7.2.1 //yy:field Bits int /*yy:case Base */ StructDeclarator: Declarator /*yy:case Bits */ | DeclaratorOpt ':' ConstExpr CommaOpt: /* empty */ {} | ',' // [0]6.7.2.2 //yy:field Tag int //yy:field scope *Scope // Where to declare enumeration constants. //yy:field typ Type /*yy:case Tag */ EnumSpecifier: "enum" IDENTIFIER { lhs.scope = lx.scope } /*yy:case Define */ | "enum" IdentifierOpt '{' EnumeratorList CommaOpt '}' { lhs.scope = lx.scope } // [0]6.7.2.2 EnumeratorList: Enumerator | EnumeratorList ',' Enumerator // [0]6.7.2.2 /*yy:case Base */ Enumerator: EnumerationConstant /*yy:case Init */ | EnumerationConstant '=' ConstExpr // [0]6.7.3 /*yy:case Const */ TypeQualifier: "const" /*yy:case Restrict */ | "restrict" /*yy:case Volatile */ | "volatile" // [0]6.7.4 FunctionSpecifier: "inline" // [0]6.7.5 //yy:field AssignedTo int // Declarator appears at the left side of assignment. //yy:field Attributes [][]xc.Token //yy:field Bits int // StructDeclarator: bit width when a bit field. //yy:field DeclarationSpecifier *DeclarationSpecifier // Nil for embedded declarators. //yy:field Definition *Declarator // Declaration -> definition. //yy:field Field int // Declaration order# if struct field declarator. //yy:field FunctionDefinition *FunctionDefinition // When the declarator defines a function. //yy:field Initializer *Initializer // Only when part of an InitDeclarator. //yy:field Linkage Linkage // Linkage of the declared name, [0]6.2.2. //yy:field Parameters []*Declarator // Of the function declarator. //yy:field Referenced int //yy:field Scope *Scope // Declaration scope. //yy:field ScopeNum int // Sequential scope number within function body. //yy:field StorageDuration StorageDuration // Storage duration of the declared name, [0]6.2.4. //yy:field Type Type // Declared type. //yy:field TypeQualifiers []*TypeQualifier // From the PointerOpt production, if any. //yy:field unnamed int //yy:field vars []*Declarator // Function declarator only. //yy:field AddressTaken bool //yy:field Alloca bool // Function declarator: Body calls __builtin_alloca //yy:field Embedded bool // [0]6.7.5-3: Not a full declarator. //yy:field IsField bool //yy:field IsFunctionParameter bool //yy:field IsBuiltin bool Declarator: PointerOpt DirectDeclarator { lhs.Attributes = lx.attrs() lhs.Scope = lx.scope if lx.scope.typedef { delete(lx.scope.Idents, lhs.DirectDeclarator.nm()) lx.scope.insertTypedef(lx.context, lhs) } } DeclaratorOpt: /* empty */ {} | Declarator // [0]6.7.5 //yy:field paramScope *Scope /*yy:case Paren */ DirectDeclarator: '(' Declarator ')' { lhs.Declarator.Embedded = true } /*yy:case IdentList */ | DirectDeclarator '(' { lx.newScope() } IdentifierListOpt ')' { lhs.paramScope, _ = lx.popScope() } /*yy:case ParamList */ | DirectDeclarator '(' { lx.newScope() } ParameterTypeList ')' { lhs.paramScope, _ = lx.popScope() } /*yy:case ArraySize */ | DirectDeclarator '[' "static" TypeQualifierListOpt Expr ']' /*yy:case ArraySize2 */ | DirectDeclarator '[' TypeQualifierList "static" Expr ']' /*yy:case ArrayVar */ | DirectDeclarator '[' TypeQualifierListOpt '*' ']' /*yy:case Array */ | DirectDeclarator '[' TypeQualifierListOpt ExprOpt ']' /*yy:case Ident */ | IDENTIFIER // [0]6.7.5 /*yy:case Base */ Pointer: '*' TypeQualifierListOpt /*yy:case Ptr */ | '*' TypeQualifierListOpt Pointer PointerOpt: /* empty */ {} | Pointer // [0]6.7.5 TypeQualifierList: TypeQualifier | TypeQualifierList TypeQualifier TypeQualifierListOpt: /* empty */ {} | TypeQualifierList // [0]6.7.5 /*yy:case Base */ ParameterTypeList: ParameterList /*yy:case Dots */ | ParameterList ',' "..." ParameterTypeListOpt: /* empty */ {} | ParameterTypeList // [0]6.7.5 ParameterList: ParameterDeclaration | ParameterList ',' ParameterDeclaration // [0]6.7.5 /*yy:case Abstract */ ParameterDeclaration: DeclarationSpecifiers AbstractDeclaratorOpt { lx.scope.typedef = false } /*yy:case Declarator */ | DeclarationSpecifiers Declarator { lx.scope.typedef = false } // [0]6.7.5 IdentifierList: IDENTIFIER | IdentifierList ',' IDENTIFIER IdentifierListOpt: /* empty */ {} | IdentifierList IdentifierOpt: /* empty */ {} | IDENTIFIER // [0]6.7.6 //yy:field Type Type TypeName: SpecifierQualifierList AbstractDeclaratorOpt // [0]6.7.6 //yy:field DeclarationSpecifier *DeclarationSpecifier //yy:field Type Type //yy:field TypeQualifiers []*TypeQualifier // From the PointerOpt production, if any. /*yy:case Pointer */ AbstractDeclarator: Pointer /*yy:case Abstract */ | PointerOpt DirectAbstractDeclarator AbstractDeclaratorOpt: /* empty */ {} | AbstractDeclarator // [0]6.7.6 /*yy:case Abstract */ DirectAbstractDeclarator: '(' AbstractDeclarator ')' /*yy:case ParamList */ | '(' ParameterTypeListOpt ')' /*yy:case DFn */ | DirectAbstractDeclarator '(' ParameterTypeListOpt ')' /*yy:case DArrSize */ | DirectAbstractDeclaratorOpt '[' "static" TypeQualifierListOpt Expr ']' /*yy:case DArrVL */ | DirectAbstractDeclaratorOpt '[' '*' ']' /*yy:case DArr */ | DirectAbstractDeclaratorOpt '[' ExprOpt ']' /*yy:case DArrSize2 */ | DirectAbstractDeclaratorOpt '[' TypeQualifierList "static" Expr ']' /*yy:case DArr2 */ | DirectAbstractDeclaratorOpt '[' TypeQualifierList ExprOpt ']' DirectAbstractDeclaratorOpt: /* empty */ {} | DirectAbstractDeclarator // [0]6.7.8 /*yy:case CompLit */ Initializer: '{' InitializerList CommaOpt '}' /*yy:case Expr */ | Expr // [0]6.7.8 //yy:field Operand Operand //TODO- //yy:field Len int InitializerList: /* empty */ {} | Initializer | Designation Initializer | InitializerList ',' Initializer | InitializerList ',' Designation Initializer // [0]6.7.8 //yy:field List []int64 Designation: DesignatorList '=' // [0]6.7.8 DesignatorList: Designator | DesignatorList Designator // [0]6.7.8 /*yy:case Field */ Designator: '.' IDENTIFIER /*yy:case Index */ | '[' ConstExpr ']' // [0]6.8 /*yy:case Block */ Stmt: CompoundStmt /*yy:case Expr */ | ExprStmt /*yy:case Iter */ | IterationStmt /*yy:case Jump */ | JumpStmt /*yy:case Labeled */ | LabeledStmt /*yy:case Select */ | SelectionStmt // [0]6.8.1 /*yy:case SwitchCase */ LabeledStmt: "case" ConstExpr ':' Stmt /*yy:case Default */ | "default" ':' Stmt /*yy:case Label */ | IDENTIFIER ':' Stmt { lx.scope.insertLabel(lx.context, lhs) } /*yy:case Label2 */ | TYPEDEF_NAME ':' Stmt { lx.scope.insertLabel(lx.context, lhs) } // [0]6.8.2 //yy:field scope *Scope CompoundStmt: '{' { lx.newScope() } BlockItemListOpt '}' { lhs.scope, _ = lx.popScope() } // [0]6.8.2 BlockItemList: BlockItem | BlockItemList BlockItem BlockItemListOpt: /* empty */ {} | BlockItemList // [0]6.8.2 /*yy:case Decl */ BlockItem: Declaration /*yy:case Stmt */ | Stmt // [0]6.8.3 ExprStmt: ExprListOpt ';' // [0]6.8.4 //yy:field Cases []*LabeledStmt //yy:field SwitchOp Operand // Promoted switch operand /*yy:case IfElse */ SelectionStmt: "if" '(' ExprList ')' Stmt "else" Stmt /*yy:case If */ | "if" '(' ExprList ')' Stmt %prec NOELSE /*yy:case Switch */ | "switch" '(' ExprList ')' Stmt // [0]6.8.5 /*yy:case Do */ IterationStmt: "do" Stmt "while" '(' ExprList ')' ';' /*yy:case ForDecl */ | "for" '(' Declaration ExprListOpt ';' ExprListOpt ')' Stmt { lx.popScope() } /*yy:case For */ | "for" '(' ExprListOpt ';' ExprListOpt ';' ExprListOpt ')' Stmt { lx.popScope() } /*yy:case While */ | "while" '(' ExprList ')' Stmt // [0]6.8.6 //yy:field ReturnOperand Operand //yy:field scope *Scope /*yy:case Break */ JumpStmt: "break" ';' /*yy:case Continue */ | "continue" ';' /*yy:case Goto */ | "goto" IDENTIFIER ';' { lhs.scope = lx.scope } /*yy:case Return */ | "return" ExprListOpt ';' // [0]6.9 //yy:list ExternalDeclarationList: ExternalDeclaration | ExternalDeclarationList ExternalDeclaration // [0]6.9 /*yy:case Decl */ ExternalDeclaration: Declaration /*yy:case Func */ | FunctionDefinition // [0]6.9.1 /*yy:case Spec */ FunctionDefinition: DeclarationSpecifiers Declarator { lx.scope.typedef = false lx.currFn = $2.(*Declarator).Name() } DeclarationListOpt FunctionBody { lhs.Declarator.FunctionDefinition = lhs if lx.scope.Parent != nil { panic("internal error") } } /*yy:case Int */ | Declarator { if !lx.tweaks.EnableOmitFuncDeclSpec { lx.err($1, "omitting function declaration specifiers not allowed") } lx.scope.typedef = false lx.currFn = $1.(*Declarator).Name() } DeclarationListOpt FunctionBody { lhs.Declarator.FunctionDefinition = lhs if lx.scope.Parent != nil { panic("internal error") } } FunctionBody: { lx.declareFuncName() // [0], 6.4.2.2. } CompoundStmt // [0]6.9.1 DeclarationList: Declaration | DeclarationList Declaration DeclarationListOpt: /* empty */ {} | DeclarationList VolatileOpt: /* empty */ {} | "volatile" ================================================ FILE: v2/scanner.go ================================================ // Code generated by golex. DO NOT EDIT. // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on [0], 6.4. // // [0]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf package cc import ( "fmt" "github.com/cznic/golex/lex" ) const ( _ = iota scCOMMENT // [`/*`, `*/`] ) func (l *lexer) scan() (r int) { c := l.Enter() yystate0: yyrule := -1 _ = yyrule c = l.Rule0() switch yyt := l.sc; yyt { default: panic(fmt.Errorf(`invalid start condition %d`, yyt)) case 0: // start condition: INITIAL goto yystart1 case 1: // start condition: COMMENT goto yystart123 } goto yystate0 // silence unused label error goto yyAction // silence unused label error yyAction: switch yyrule { case 1: goto yyrule1 case 2: goto yyrule2 case 3: goto yyrule3 case 4: goto yyrule4 case 5: goto yyrule5 case 6: goto yyrule6 case 7: goto yyrule7 case 8: goto yyrule8 case 9: goto yyrule9 case 10: goto yyrule10 case 11: goto yyrule11 case 12: goto yyrule12 case 13: goto yyrule13 case 14: goto yyrule14 case 15: goto yyrule15 case 16: goto yyrule16 case 17: goto yyrule17 case 18: goto yyrule18 case 19: goto yyrule19 case 20: goto yyrule20 case 21: goto yyrule21 case 22: goto yyrule22 case 23: goto yyrule23 case 24: goto yyrule24 case 25: goto yyrule25 case 26: goto yyrule26 case 27: goto yyrule27 case 28: goto yyrule28 case 29: goto yyrule29 case 30: goto yyrule30 case 31: goto yyrule31 case 32: goto yyrule32 case 33: goto yyrule33 case 34: goto yyrule34 case 35: goto yyrule35 case 36: goto yyrule36 case 37: goto yyrule37 case 38: goto yyrule38 case 39: goto yyrule39 case 40: goto yyrule40 case 41: goto yyrule41 case 42: goto yyrule42 case 43: goto yyrule43 } goto yystate1 // silence unused label error yystate1: c = l.Next() yystart1: switch { default: goto yyabort case c == '!': goto yystate3 case c == '"': goto yystate5 case c == '#': goto yystate16 case c == '%': goto yystate20 case c == '&': goto yystate27 case c == '*': goto yystate42 case c == '+': goto yystate44 case c == '-': goto yystate47 case c == '.': goto yystate51 case c == '/': goto yystate65 case c == ':': goto yystate69 case c == '<': goto yystate71 case c == '=': goto yystate77 case c == '>': goto yystate79 case c == 'L': goto yystate93 case c == '\'': goto yystate30 case c == '\\': goto yystate84 case c == '\t' || c == '\v' || c == '\f' || c == ' ': goto yystate2 case c == '\u0080': goto yystate122 case c == '^': goto yystate117 case c == '|': goto yystate119 case c >= '0' && c <= '9': goto yystate54 case c >= 'A' && c <= 'K' || c >= 'M' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0084': goto yystate83 } yystate2: c = l.Next() yyrule = 1 l.Mark() switch { default: goto yyrule1 case c == '\t' || c == '\v' || c == '\f' || c == ' ': goto yystate2 } yystate3: c = l.Next() switch { default: goto yyabort case c == '=': goto yystate4 } yystate4: c = l.Next() yyrule = 7 l.Mark() goto yyrule7 yystate5: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate6 case c == '\\': goto yystate7 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate5 } yystate6: c = l.Next() yyrule = 43 l.Mark() goto yyrule43 yystate7: c = l.Next() switch { default: goto yyabort case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v': goto yystate5 case c == 'U': goto yystate8 case c == 'u': goto yystate12 case c == 'x': goto yystate15 } yystate8: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate9 } yystate9: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate10 } yystate10: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate11 } yystate11: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate12 } yystate12: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate13 } yystate13: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate14 } yystate14: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate15 } yystate15: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate5 } yystate16: c = l.Next() switch { default: goto yyabort case c == '#': goto yystate17 case c == '%': goto yystate18 } yystate17: c = l.Next() yyrule = 34 l.Mark() goto yyrule34 yystate18: c = l.Next() switch { default: goto yyabort case c == ':': goto yystate19 } yystate19: c = l.Next() yyrule = 35 l.Mark() goto yyrule35 yystate20: c = l.Next() switch { default: goto yyabort case c == ':': goto yystate21 case c == '=': goto yystate25 case c == '>': goto yystate26 } yystate21: c = l.Next() yyrule = 8 l.Mark() switch { default: goto yyrule8 case c == '#': goto yystate22 case c == '%': goto yystate23 } yystate22: c = l.Next() yyrule = 36 l.Mark() goto yyrule36 yystate23: c = l.Next() switch { default: goto yyabort case c == ':': goto yystate24 } yystate24: c = l.Next() yyrule = 37 l.Mark() goto yyrule37 yystate25: c = l.Next() yyrule = 9 l.Mark() goto yyrule9 yystate26: c = l.Next() yyrule = 10 l.Mark() goto yyrule10 yystate27: c = l.Next() switch { default: goto yyabort case c == '&': goto yystate28 case c == '=': goto yystate29 } yystate28: c = l.Next() yyrule = 11 l.Mark() goto yyrule11 yystate29: c = l.Next() yyrule = 12 l.Mark() goto yyrule12 yystate30: c = l.Next() switch { default: goto yyabort case c == '\\': goto yystate33 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '&' || c >= '(' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate31 } yystate31: c = l.Next() switch { default: goto yyabort case c == '\'': goto yystate32 case c == '\\': goto yystate33 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '&' || c >= '(' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate31 } yystate32: c = l.Next() yyrule = 40 l.Mark() goto yyrule40 yystate33: c = l.Next() switch { default: goto yyabort case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v': goto yystate31 case c == 'U': goto yystate34 case c == 'u': goto yystate38 case c == 'x': goto yystate41 } yystate34: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate35 } yystate35: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate36 } yystate36: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate37 } yystate37: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate38 } yystate38: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate39 } yystate39: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate40 } yystate40: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate41 } yystate41: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate31 } yystate42: c = l.Next() switch { default: goto yyabort case c == '=': goto yystate43 } yystate43: c = l.Next() yyrule = 13 l.Mark() goto yyrule13 yystate44: c = l.Next() switch { default: goto yyabort case c == '+': goto yystate45 case c == '=': goto yystate46 } yystate45: c = l.Next() yyrule = 14 l.Mark() goto yyrule14 yystate46: c = l.Next() yyrule = 15 l.Mark() goto yyrule15 yystate47: c = l.Next() switch { default: goto yyabort case c == '-': goto yystate48 case c == '=': goto yystate49 case c == '>': goto yystate50 } yystate48: c = l.Next() yyrule = 16 l.Mark() goto yyrule16 yystate49: c = l.Next() yyrule = 17 l.Mark() goto yyrule17 yystate50: c = l.Next() yyrule = 18 l.Mark() goto yyrule18 yystate51: c = l.Next() switch { default: goto yyabort case c == '.': goto yystate52 case c >= '0' && c <= '9': goto yystate54 } yystate52: c = l.Next() switch { default: goto yyabort case c == '.': goto yystate53 } yystate53: c = l.Next() yyrule = 19 l.Mark() goto yyrule19 yystate54: c = l.Next() yyrule = 42 l.Mark() switch { default: goto yyrule42 case c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate54 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate55 case c == '\\': goto yystate56 } yystate55: c = l.Next() yyrule = 42 l.Mark() switch { default: goto yyrule42 case c == '+' || c == '-' || c == '.' || c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'o' || c >= 'q' && c <= 'z' || c == '\u0084': goto yystate54 case c == 'E' || c == 'P' || c == 'e' || c == 'p': goto yystate55 case c == '\\': goto yystate56 } yystate56: c = l.Next() switch { default: goto yyabort case c == 'U': goto yystate57 case c == 'u': goto yystate61 } yystate57: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate58 } yystate58: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate59 } yystate59: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate60 } yystate60: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate61 } yystate61: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate62 } yystate62: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate63 } yystate63: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate64 } yystate64: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate54 } yystate65: c = l.Next() switch { default: goto yyabort case c == '*': goto yystate66 case c == '/': goto yystate67 case c == '=': goto yystate68 } yystate66: c = l.Next() yyrule = 3 l.Mark() goto yyrule3 yystate67: c = l.Next() yyrule = 2 l.Mark() switch { default: goto yyrule2 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate67 } yystate68: c = l.Next() yyrule = 20 l.Mark() goto yyrule20 yystate69: c = l.Next() switch { default: goto yyabort case c == '>': goto yystate70 } yystate70: c = l.Next() yyrule = 21 l.Mark() goto yyrule21 yystate71: c = l.Next() switch { default: goto yyabort case c == '%': goto yystate72 case c == ':': goto yystate73 case c == '<': goto yystate74 case c == '=': goto yystate76 } yystate72: c = l.Next() yyrule = 22 l.Mark() goto yyrule22 yystate73: c = l.Next() yyrule = 23 l.Mark() goto yyrule23 yystate74: c = l.Next() yyrule = 24 l.Mark() switch { default: goto yyrule24 case c == '=': goto yystate75 } yystate75: c = l.Next() yyrule = 25 l.Mark() goto yyrule25 yystate76: c = l.Next() yyrule = 26 l.Mark() goto yyrule26 yystate77: c = l.Next() switch { default: goto yyabort case c == '=': goto yystate78 } yystate78: c = l.Next() yyrule = 27 l.Mark() goto yyrule27 yystate79: c = l.Next() switch { default: goto yyabort case c == '=': goto yystate80 case c == '>': goto yystate81 } yystate80: c = l.Next() yyrule = 28 l.Mark() goto yyrule28 yystate81: c = l.Next() yyrule = 29 l.Mark() switch { default: goto yyrule29 case c == '=': goto yystate82 } yystate82: c = l.Next() yyrule = 30 l.Mark() goto yyrule30 yystate83: c = l.Next() yyrule = 41 l.Mark() switch { default: goto yyrule41 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate83 case c == '\\': goto yystate84 } yystate84: c = l.Next() switch { default: goto yyabort case c == 'U': goto yystate85 case c == 'u': goto yystate89 } yystate85: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate86 } yystate86: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate87 } yystate87: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate88 } yystate88: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate89 } yystate89: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate90 } yystate90: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate91 } yystate91: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate92 } yystate92: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate83 } yystate93: c = l.Next() yyrule = 41 l.Mark() switch { default: goto yyrule41 case c == '"': goto yystate94 case c == '$' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c == '\u0083' || c == '\u0084': goto yystate83 case c == '\'': goto yystate105 case c == '\\': goto yystate84 } yystate94: c = l.Next() switch { default: goto yyabort case c == '"': goto yystate95 case c == '\\': goto yystate96 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '!' || c >= '#' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate94 } yystate95: c = l.Next() yyrule = 39 l.Mark() goto yyrule39 yystate96: c = l.Next() switch { default: goto yyabort case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v': goto yystate94 case c == 'U': goto yystate97 case c == 'u': goto yystate101 case c == 'x': goto yystate104 } yystate97: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate98 } yystate98: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate99 } yystate99: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate100 } yystate100: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate101 } yystate101: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate102 } yystate102: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate103 } yystate103: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate104 } yystate104: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate94 } yystate105: c = l.Next() switch { default: goto yyabort case c == '\\': goto yystate108 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '&' || c >= '(' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate106 } yystate106: c = l.Next() switch { default: goto yyabort case c == '\'': goto yystate107 case c == '\\': goto yystate108 case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '&' || c >= '(' && c <= '[' || c >= ']' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate106 } yystate107: c = l.Next() yyrule = 38 l.Mark() goto yyrule38 yystate108: c = l.Next() switch { default: goto yyabort case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v': goto yystate106 case c == 'U': goto yystate109 case c == 'u': goto yystate113 case c == 'x': goto yystate116 } yystate109: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate110 } yystate110: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate111 } yystate111: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate112 } yystate112: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate113 } yystate113: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate114 } yystate114: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate115 } yystate115: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate116 } yystate116: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': goto yystate106 } yystate117: c = l.Next() switch { default: goto yyabort case c == '=': goto yystate118 } yystate118: c = l.Next() yyrule = 31 l.Mark() goto yyrule31 yystate119: c = l.Next() switch { default: goto yyabort case c == '=': goto yystate120 case c == '|': goto yystate121 } yystate120: c = l.Next() yyrule = 32 l.Mark() goto yyrule32 yystate121: c = l.Next() yyrule = 33 l.Mark() goto yyrule33 yystate122: c = l.Next() yyrule = 6 l.Mark() goto yyrule6 goto yystate123 // silence unused label error yystate123: c = l.Next() yystart123: switch { default: goto yyabort case c == '*': goto yystate125 case c == '\u0080': goto yystate127 case c >= '\x01' && c <= ')' || c >= '+' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate124 } yystate124: c = l.Next() switch { default: goto yyabort case c == '*': goto yystate125 case c >= '\x01' && c <= ')' || c >= '+' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate124 } yystate125: c = l.Next() switch { default: goto yyabort case c == '*': goto yystate125 case c == '/': goto yystate126 case c >= '\x01' && c <= ')' || c >= '+' && c <= '.' || c >= '0' && c <= '\u007f' || c >= '\u0081' && c <= 'ÿ': goto yystate124 } yystate126: c = l.Next() yyrule = 4 l.Mark() goto yyrule4 yystate127: c = l.Next() yyrule = 5 l.Mark() goto yyrule5 yyrule1: // [ \t\f\v]+ { return ' ' } yyrule2: // "//"[^\x80\n]* { l.comment(false) return ' ' } yyrule3: // "/*" { l.commentPos0 = l.First.Pos() l.sc = scCOMMENT goto yystate0 } yyrule4: // {comment-close} { l.sc = scINITIAL l.First = lex.NewChar(l.commentPos0, l.First.Rune) l.comment(true) return ' ' } yyrule5: // {eof} { l.errPos(l.commentPos0, "unterminated comment") l.sc = scINITIAL return rune2class(lex.RuneEOF) } yyrule6: // {eof} { return rune2class(lex.RuneEOF) } yyrule7: // "!=" { return NEQ } yyrule8: // "%:" { return '#' } yyrule9: // "%=" { return MODASSIGN } yyrule10: // "%>" { return '}' } yyrule11: // "&&" { return ANDAND } yyrule12: // "&=" { return ANDASSIGN } yyrule13: // "*=" { return MULASSIGN } yyrule14: // "++" { return INC } yyrule15: // "+=" { return ADDASSIGN } yyrule16: // "--" { return DEC } yyrule17: // "-=" { return SUBASSIGN } yyrule18: // "->" { return ARROW } yyrule19: // "..." { return DDD } yyrule20: // "/=" { return DIVASSIGN } yyrule21: // ":>" { return ']' } yyrule22: // "<%" { return '{' } yyrule23: // "<:" { return '[' } yyrule24: // "<<" { return LSH } yyrule25: // "<<=" { return LSHASSIGN } yyrule26: // "<=" { return LEQ } yyrule27: // "==" { return EQ } yyrule28: // ">=" { return GEQ } yyrule29: // ">>" { return RSH } yyrule30: // ">>=" { return RSHASSIGN } yyrule31: // "^=" { return XORASSIGN } yyrule32: // "|=" { return ORASSIGN } yyrule33: // "||" { return OROR } yyrule34: // "##" yyrule35: // "#%:" yyrule36: // "%:#" yyrule37: // "%:%:" { return PPPASTE } yyrule38: // L{character-constant} { return LONGCHARCONST } yyrule39: // L{string-literal} { return LONGSTRINGLITERAL } yyrule40: // {character-constant} { return CHARCONST } yyrule41: // {identifier} { return IDENTIFIER } yyrule42: // {pp-number} { return PPNUMBER } yyrule43: // {string-literal} { return STRINGLITERAL } panic("unreachable") goto yyabort // silence unused label error yyabort: // no lexem recognized if c, ok := l.Abort(); ok { return c } goto yyAction } ================================================ FILE: v2/scanner.l ================================================ %{ // Copyright 2017 The CC Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on [0], 6.4. // // [0]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf %} %yyc c %yyn c = l.Next() %yym l.Mark() %yyt l.sc %x COMMENT %{ package cc import ( "fmt" "github.com/cznic/golex/lex" ) const ( _ = iota scCOMMENT // [`/*`, `*/`] ) func (l *lexer) scan() (r int) { c := l.Enter() %} binary-constant {binary-prefix}{binary-digit}+ binary-digit [01] binary-exponent-part [pP]{sign}?{digit-sequence} binary-prefix 0[bB] c-char [^'\n\x80\\]|{escape-sequence} c-char-sequence {c-char}+ character-constant '{c-char-sequence}' comment-close ([^*\x80]|\*+[^*/\x80])*\*+\/ decimal-constant {nonzero-digit}{digit}* digit [0-9] digit-sequence {digit}+ eof \x80 escape-sequence {simple-sequence}|{octal-escape-sequence}|{hexadecimal-escape-sequence}|{universal-character-name} exponent-part [eE]{sign}?{digit-sequence} fractional-constant {digit-sequence}?\.{digit-sequence}|{digit-sequence}\. h-char [^>\n\x80] h-char-sequence {h-char}+ hex-quad {hexadecimal-digit}{hexadecimal-digit}{hexadecimal-digit}{hexadecimal-digit} hexadecimal-constant {hexadecimal-prefix}{hexadecimal-digit}+ hexadecimal-digit [0-9a-fA-F] hexadecimal-digit-sequence {hexadecimal-digit}+ hexadecimal-escape-sequence \\x{hexadecimal-digit}+ hexadecimal-prefix 0[xX] identifier {identifier-nondigit}({identifier-nondigit}|{digit}|{ucn-digit}|"$")* identifier-nondigit {nondigit}|{universal-character-name}|{ucn-nondigit} nondigit [_a-zA-Z] nonzero-digit [1-9] octal-constant 0{octal-digit}* octal-digit [0-7] octal-escape-sequence \\{octal-digit}{octal-digit}?{octal-digit}? pp-number ({digit}|\.{digit})({digit}|{identifier-nondigit}|[eEpP]{sign}|\.)* q-char [^\n\x22\x80] q-char-sequence {q-char}+ s-char [^\x22\n\x80\\]|{escape-sequence} s-char-sequence {s-char}+ sign [-+] simple-sequence \\['\x22?\\abfnrtv] string-literal \x22{s-char-sequence}?\x22 ucn-digit \x83 ucn-nondigit \x84 universal-character-name \\u{hex-quad}|\\U{hex-quad}{hex-quad} unsigned-suffix [uU] %% c = l.Rule0() [ \t\f\v]+ return ' ' "//"[^\x80\n]* l.comment(false) return ' ' "/*" l.commentPos0 = l.First.Pos() l.sc = scCOMMENT {comment-close} l.sc = scINITIAL l.First = lex.NewChar(l.commentPos0, l.First.Rune) l.comment(true) return ' ' {eof} l.errPos(l.commentPos0, "unterminated comment") l.sc = scINITIAL return rune2class(lex.RuneEOF) <*>{eof} return rune2class(lex.RuneEOF) "!=" return NEQ "%:" return '#' "%=" return MODASSIGN "%>" return '}' "&&" return ANDAND "&=" return ANDASSIGN "*=" return MULASSIGN "++" return INC "+=" return ADDASSIGN "--" return DEC "-=" return SUBASSIGN "->" return ARROW "..." return DDD "/=" return DIVASSIGN ":>" return ']' "<%" return '{' "<:" return '[' "<<" return LSH "<<=" return LSHASSIGN "<=" return LEQ "==" return EQ ">=" return GEQ ">>" return RSH ">>=" return RSHASSIGN "^=" return XORASSIGN "|=" return ORASSIGN "||" return OROR "##" | "#%:" | "%:#" | "%:%:" return PPPASTE L{character-constant} return LONGCHARCONST L{string-literal} return LONGSTRINGLITERAL {character-constant} return CHARCONST {identifier} return IDENTIFIER {pp-number} return PPNUMBER {string-literal} return STRINGLITERAL %% if c, ok := l.Abort(); ok { return c } goto yyAction } ================================================ FILE: v2/stringer.go ================================================ // Code generated by "stringer -output stringer.go -type=cond,Linkage,StorageDuration enum.go"; DO NOT EDIT. package cc import "strconv" const _cond_name = "condZerocondIfOffcondIfOncondIfSkipmaxCond" var _cond_index = [...]uint8{0, 8, 17, 25, 35, 42} func (i cond) String() string { if i < 0 || i >= cond(len(_cond_index)-1) { return "cond(" + strconv.FormatInt(int64(i), 10) + ")" } return _cond_name[_cond_index[i]:_cond_index[i+1]] } const _Linkage_name = "LinkageNoneLinkageExternalLinkageInternal" var _Linkage_index = [...]uint8{0, 11, 26, 41} func (i Linkage) String() string { if i < 0 || i >= Linkage(len(_Linkage_index)-1) { return "Linkage(" + strconv.FormatInt(int64(i), 10) + ")" } return _Linkage_name[_Linkage_index[i]:_Linkage_index[i+1]] } const _StorageDuration_name = "StorageDurationAutomaticStorageDurationStatic" var _StorageDuration_index = [...]uint8{0, 24, 45} func (i StorageDuration) String() string { if i < 0 || i >= StorageDuration(len(_StorageDuration_index)-1) { return "StorageDuration(" + strconv.FormatInt(int64(i), 10) + ")" } return _StorageDuration_name[_StorageDuration_index[i]:_StorageDuration_index[i+1]] } ================================================ FILE: v2/testdata/_sqlite/LICENSE ================================================ SQLite Is Public Domain All of the code and documentation in SQLite has been dedicated to the public domain by the authors. All code authors, and representatives of the companies they work for, have signed affidavits dedicating their contributions to the public domain and originals of those signed affidavits are stored in a firesafe at the main offices of Hwaci. Anyone is free to copy, modify, publish, use, compile, sell, or distribute the original SQLite code, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. The previous paragraph applies to the deliverable code and documentation in SQLite - those parts of the SQLite library that you actually bundle and ship with a larger application. Some scripts used as part of the build process (for example the "configure" scripts generated by autoconf) might fall under other open-source licenses. Nothing from these build scripts ever reaches the final deliverable SQLite library, however, and so the licenses associated with those scripts should not be a factor in assessing your rights to copy and use the SQLite library. All of the deliverable code in SQLite has been written from scratch. No code has been taken from other projects or from the open internet. Every line of code can be traced back to its original author, and all of those authors have public domain dedications on file. So the SQLite code base is clean and is uncontaminated with licensed code from other projects. src: https://sqlite.org/copyright.html ================================================ FILE: v2/testdata/_sqlite/ext/README.md ================================================ ## Loadable Extensions Various [loadable extensions](https://www.sqlite.org/loadext.html) for SQLite are found in subfolders. Most subfolders are dedicated to a single loadable extension (for example FTS5, or RTREE). But the misc/ subfolder contains a collection of smaller single-file extensions. ================================================ FILE: v2/testdata/_sqlite/ext/async/README.txt ================================================ NOTE (2012-11-29): The functionality implemented by this extension has been superseded by WAL-mode. This module is no longer supported or maintained. The code is retained for historical reference only. ------------------------------------------------------------------------------ Normally, when SQLite writes to a database file, it waits until the write operation is finished before returning control to the calling application. Since writing to the file-system is usually very slow compared with CPU bound operations, this can be a performance bottleneck. This directory contains an extension that causes SQLite to perform all write requests using a separate thread running in the background. Although this does not reduce the overall system resources (CPU, disk bandwidth etc.) at all, it allows SQLite to return control to the caller quickly even when writing to the database, eliminating the bottleneck. 1. Functionality 1.1 How it Works 1.2 Limitations 1.3 Locking and Concurrency 2. Compilation and Usage 3. Porting 1. FUNCTIONALITY With asynchronous I/O, write requests are handled by a separate thread running in the background. This means that the thread that initiates a database write does not have to wait for (sometimes slow) disk I/O to occur. The write seems to happen very quickly, though in reality it is happening at its usual slow pace in the background. Asynchronous I/O appears to give better responsiveness, but at a price. You lose the Durable property. With the default I/O backend of SQLite, once a write completes, you know that the information you wrote is safely on disk. With the asynchronous I/O, this is not the case. If your program crashes or if a power loss occurs after the database write but before the asynchronous write thread has completed, then the database change might never make it to disk and the next user of the database might not see your change. You lose Durability with asynchronous I/O, but you still retain the other parts of ACID: Atomic, Consistent, and Isolated. Many appliations get along fine without the Durablity. 1.1 How it Works Asynchronous I/O works by creating a special SQLite "vfs" structure and registering it with sqlite3_vfs_register(). When files opened via this vfs are written to (using the vfs xWrite() method), the data is not written directly to disk, but is placed in the "write-queue" to be handled by the background thread. When files opened with the asynchronous vfs are read from (using the vfs xRead() method), the data is read from the file on disk and the write-queue, so that from the point of view of the vfs reader the xWrite() appears to have already completed. The special vfs is registered (and unregistered) by calls to the API functions sqlite3async_initialize() and sqlite3async_shutdown(). See section "Compilation and Usage" below for details. 1.2 Limitations In order to gain experience with the main ideas surrounding asynchronous IO, this implementation is deliberately kept simple. Additional capabilities may be added in the future. For example, as currently implemented, if writes are happening at a steady stream that exceeds the I/O capability of the background writer thread, the queue of pending write operations will grow without bound. If this goes on for long enough, the host system could run out of memory. A more sophisticated module could to keep track of the quantity of pending writes and stop accepting new write requests when the queue of pending writes grows too large. 1.3 Locking and Concurrency Multiple connections from within a single process that use this implementation of asynchronous IO may access a single database file concurrently. From the point of view of the user, if all connections are from within a single process, there is no difference between the concurrency offered by "normal" SQLite and SQLite using the asynchronous backend. If file-locking is enabled (it is enabled by default), then connections from multiple processes may also read and write the database file. However concurrency is reduced as follows: * When a connection using asynchronous IO begins a database transaction, the database is locked immediately. However the lock is not released until after all relevant operations in the write-queue have been flushed to disk. This means (for example) that the database may remain locked for some time after a "COMMIT" or "ROLLBACK" is issued. * If an application using asynchronous IO executes transactions in quick succession, other database users may be effectively locked out of the database. This is because when a BEGIN is executed, a database lock is established immediately. But when the corresponding COMMIT or ROLLBACK occurs, the lock is not released until the relevant part of the write-queue has been flushed through. As a result, if a COMMIT is followed by a BEGIN before the write-queue is flushed through, the database is never unlocked,preventing other processes from accessing the database. File-locking may be disabled at runtime using the sqlite3async_control() API (see below). This may improve performance when an NFS or other network file-system, as the synchronous round-trips to the server be required to establish file locks are avoided. However, if multiple connections attempt to access the same database file when file-locking is disabled, application crashes and database corruption is a likely outcome. 2. COMPILATION AND USAGE The asynchronous IO extension consists of a single file of C code (sqlite3async.c), and a header file (sqlite3async.h) that defines the C API used by applications to activate and control the modules functionality. To use the asynchronous IO extension, compile sqlite3async.c as part of the application that uses SQLite. Then use the API defined in sqlite3async.h to initialize and configure the module. The asynchronous IO VFS API is described in detail in comments in sqlite3async.h. Using the API usually consists of the following steps: 1. Register the asynchronous IO VFS with SQLite by calling the sqlite3async_initialize() function. 2. Create a background thread to perform write operations and call sqlite3async_run(). 3. Use the normal SQLite API to read and write to databases via the asynchronous IO VFS. Refer to sqlite3async.h for details. 3. PORTING Currently the asynchronous IO extension is compatible with win32 systems and systems that support the pthreads interface, including Mac OSX, Linux, and other varieties of Unix. To port the asynchronous IO extension to another platform, the user must implement mutex and condition variable primitives for the new platform. Currently there is no externally available interface to allow this, but modifying the code within sqlite3async.c to include the new platforms concurrency primitives is relatively easy. Search within sqlite3async.c for the comment string "PORTING FUNCTIONS" for details. Then implement new versions of each of the following: static void async_mutex_enter(int eMutex); static void async_mutex_leave(int eMutex); static void async_cond_wait(int eCond, int eMutex); static void async_cond_signal(int eCond); static void async_sched_yield(void); The functionality required of each of the above functions is described in comments in sqlite3async.c. ================================================ FILE: v2/testdata/_sqlite/ext/async/sqlite3async.c ================================================ /* ** 2005 December 14 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** $Id: sqlite3async.c,v 1.7 2009/07/18 11:52:04 danielk1977 Exp $ ** ** This file contains the implementation of an asynchronous IO backend ** for SQLite. */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ASYNCIO) #include "sqlite3async.h" #include "sqlite3.h" #include #include #include /* Useful macros used in several places */ #define MIN(x,y) ((x)<(y)?(x):(y)) #define MAX(x,y) ((x)>(y)?(x):(y)) #ifndef SQLITE_AMALGAMATION /* Macro to mark parameters as unused and silence compiler warnings. */ #define UNUSED_PARAMETER(x) (void)(x) #endif /* Forward references */ typedef struct AsyncWrite AsyncWrite; typedef struct AsyncFile AsyncFile; typedef struct AsyncFileData AsyncFileData; typedef struct AsyncFileLock AsyncFileLock; typedef struct AsyncLock AsyncLock; /* Enable for debugging */ #ifndef NDEBUG #include static int sqlite3async_trace = 0; # define ASYNC_TRACE(X) if( sqlite3async_trace ) asyncTrace X static void asyncTrace(const char *zFormat, ...){ char *z; va_list ap; va_start(ap, zFormat); z = sqlite3_vmprintf(zFormat, ap); va_end(ap); fprintf(stderr, "[%d] %s", 0 /* (int)pthread_self() */, z); sqlite3_free(z); } #else # define ASYNC_TRACE(X) #endif /* ** THREAD SAFETY NOTES ** ** Basic rules: ** ** * Both read and write access to the global write-op queue must be ** protected by the async.queueMutex. As are the async.ioError and ** async.nFile variables. ** ** * The async.pLock list and all AsyncLock and AsyncFileLock ** structures must be protected by the async.lockMutex mutex. ** ** * The file handles from the underlying system are not assumed to ** be thread safe. ** ** * See the last two paragraphs under "The Writer Thread" for ** an assumption to do with file-handle synchronization by the Os. ** ** Deadlock prevention: ** ** There are three mutex used by the system: the "writer" mutex, ** the "queue" mutex and the "lock" mutex. Rules are: ** ** * It is illegal to block on the writer mutex when any other mutex ** are held, and ** ** * It is illegal to block on the queue mutex when the lock mutex ** is held. ** ** i.e. mutex's must be grabbed in the order "writer", "queue", "lock". ** ** File system operations (invoked by SQLite thread): ** ** xOpen ** xDelete ** xFileExists ** ** File handle operations (invoked by SQLite thread): ** ** asyncWrite, asyncClose, asyncTruncate, asyncSync ** ** The operations above add an entry to the global write-op list. They ** prepare the entry, acquire the async.queueMutex momentarily while ** list pointers are manipulated to insert the new entry, then release ** the mutex and signal the writer thread to wake up in case it happens ** to be asleep. ** ** ** asyncRead, asyncFileSize. ** ** Read operations. Both of these read from both the underlying file ** first then adjust their result based on pending writes in the ** write-op queue. So async.queueMutex is held for the duration ** of these operations to prevent other threads from changing the ** queue in mid operation. ** ** ** asyncLock, asyncUnlock, asyncCheckReservedLock ** ** These primitives implement in-process locking using a hash table ** on the file name. Files are locked correctly for connections coming ** from the same process. But other processes cannot see these locks ** and will therefore not honor them. ** ** ** The writer thread: ** ** The async.writerMutex is used to make sure only there is only ** a single writer thread running at a time. ** ** Inside the writer thread is a loop that works like this: ** ** WHILE (write-op list is not empty) ** Do IO operation at head of write-op list ** Remove entry from head of write-op list ** END WHILE ** ** The async.queueMutex is always held during the test, and when the entry is removed from the head ** of the write-op list. Sometimes it is held for the interim ** period (while the IO is performed), and sometimes it is ** relinquished. It is relinquished if (a) the IO op is an ** ASYNC_CLOSE or (b) when the file handle was opened, two of ** the underlying systems handles were opened on the same ** file-system entry. ** ** If condition (b) above is true, then one file-handle ** (AsyncFile.pBaseRead) is used exclusively by sqlite threads to read the ** file, the other (AsyncFile.pBaseWrite) by sqlite3_async_flush() ** threads to perform write() operations. This means that read ** operations are not blocked by asynchronous writes (although ** asynchronous writes may still be blocked by reads). ** ** This assumes that the OS keeps two handles open on the same file ** properly in sync. That is, any read operation that starts after a ** write operation on the same file system entry has completed returns ** data consistent with the write. We also assume that if one thread ** reads a file while another is writing it all bytes other than the ** ones actually being written contain valid data. ** ** If the above assumptions are not true, set the preprocessor symbol ** SQLITE_ASYNC_TWO_FILEHANDLES to 0. */ #ifndef NDEBUG # define TESTONLY( X ) X #else # define TESTONLY( X ) #endif /* ** PORTING FUNCTIONS ** ** There are two definitions of the following functions. One for pthreads ** compatible systems and one for Win32. These functions isolate the OS ** specific code required by each platform. ** ** The system uses three mutexes and a single condition variable. To ** block on a mutex, async_mutex_enter() is called. The parameter passed ** to async_mutex_enter(), which must be one of ASYNC_MUTEX_LOCK, ** ASYNC_MUTEX_QUEUE or ASYNC_MUTEX_WRITER, identifies which of the three ** mutexes to lock. Similarly, to unlock a mutex, async_mutex_leave() is ** called with a parameter identifying the mutex being unlocked. Mutexes ** are not recursive - it is an error to call async_mutex_enter() to ** lock a mutex that is already locked, or to call async_mutex_leave() ** to unlock a mutex that is not currently locked. ** ** The async_cond_wait() and async_cond_signal() functions are modelled ** on the pthreads functions with similar names. The first parameter to ** both functions is always ASYNC_COND_QUEUE. When async_cond_wait() ** is called the mutex identified by the second parameter must be held. ** The mutex is unlocked, and the calling thread simultaneously begins ** waiting for the condition variable to be signalled by another thread. ** After another thread signals the condition variable, the calling ** thread stops waiting, locks mutex eMutex and returns. The ** async_cond_signal() function is used to signal the condition variable. ** It is assumed that the mutex used by the thread calling async_cond_wait() ** is held by the caller of async_cond_signal() (otherwise there would be ** a race condition). ** ** It is guaranteed that no other thread will call async_cond_wait() when ** there is already a thread waiting on the condition variable. ** ** The async_sched_yield() function is called to suggest to the operating ** system that it would be a good time to shift the current thread off the ** CPU. The system will still work if this function is not implemented ** (it is not currently implemented for win32), but it might be marginally ** more efficient if it is. */ static void async_mutex_enter(int eMutex); static void async_mutex_leave(int eMutex); static void async_cond_wait(int eCond, int eMutex); static void async_cond_signal(int eCond); static void async_sched_yield(void); /* ** There are also two definitions of the following. async_os_initialize() ** is called when the asynchronous VFS is first installed, and os_shutdown() ** is called when it is uninstalled (from within sqlite3async_shutdown()). ** ** For pthreads builds, both of these functions are no-ops. For win32, ** they provide an opportunity to initialize and finalize the required ** mutex and condition variables. ** ** If async_os_initialize() returns other than zero, then the initialization ** fails and SQLITE_ERROR is returned to the user. */ static int async_os_initialize(void); static void async_os_shutdown(void); /* Values for use as the 'eMutex' argument of the above functions. The ** integer values assigned to these constants are important for assert() ** statements that verify that mutexes are locked in the correct order. ** Specifically, it is unsafe to try to lock mutex N while holding a lock ** on mutex M if (M<=N). */ #define ASYNC_MUTEX_LOCK 0 #define ASYNC_MUTEX_QUEUE 1 #define ASYNC_MUTEX_WRITER 2 /* Values for use as the 'eCond' argument of the above functions. */ #define ASYNC_COND_QUEUE 0 /************************************************************************* ** Start of OS specific code. */ #if SQLITE_OS_WIN || defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__) #include /* The following block contains the win32 specific code. */ #define mutex_held(X) (GetCurrentThreadId()==primitives.aHolder[X]) static struct AsyncPrimitives { int isInit; DWORD aHolder[3]; CRITICAL_SECTION aMutex[3]; HANDLE aCond[1]; } primitives = { 0 }; static int async_os_initialize(void){ if( !primitives.isInit ){ primitives.aCond[0] = CreateEvent(NULL, TRUE, FALSE, 0); if( primitives.aCond[0]==NULL ){ return 1; } InitializeCriticalSection(&primitives.aMutex[0]); InitializeCriticalSection(&primitives.aMutex[1]); InitializeCriticalSection(&primitives.aMutex[2]); primitives.isInit = 1; } return 0; } static void async_os_shutdown(void){ if( primitives.isInit ){ DeleteCriticalSection(&primitives.aMutex[0]); DeleteCriticalSection(&primitives.aMutex[1]); DeleteCriticalSection(&primitives.aMutex[2]); CloseHandle(primitives.aCond[0]); primitives.isInit = 0; } } /* The following block contains the Win32 specific code. */ static void async_mutex_enter(int eMutex){ assert( eMutex==0 || eMutex==1 || eMutex==2 ); assert( eMutex!=2 || (!mutex_held(0) && !mutex_held(1) && !mutex_held(2)) ); assert( eMutex!=1 || (!mutex_held(0) && !mutex_held(1)) ); assert( eMutex!=0 || (!mutex_held(0)) ); EnterCriticalSection(&primitives.aMutex[eMutex]); TESTONLY( primitives.aHolder[eMutex] = GetCurrentThreadId(); ) } static void async_mutex_leave(int eMutex){ assert( eMutex==0 || eMutex==1 || eMutex==2 ); assert( mutex_held(eMutex) ); TESTONLY( primitives.aHolder[eMutex] = 0; ) LeaveCriticalSection(&primitives.aMutex[eMutex]); } static void async_cond_wait(int eCond, int eMutex){ ResetEvent(primitives.aCond[eCond]); async_mutex_leave(eMutex); WaitForSingleObject(primitives.aCond[eCond], INFINITE); async_mutex_enter(eMutex); } static void async_cond_signal(int eCond){ assert( mutex_held(ASYNC_MUTEX_QUEUE) ); SetEvent(primitives.aCond[eCond]); } static void async_sched_yield(void){ Sleep(0); } #else /* The following block contains the pthreads specific code. */ #include #include #define mutex_held(X) pthread_equal(primitives.aHolder[X], pthread_self()) static int async_os_initialize(void) {return 0;} static void async_os_shutdown(void) {} static struct AsyncPrimitives { pthread_mutex_t aMutex[3]; pthread_cond_t aCond[1]; pthread_t aHolder[3]; } primitives = { { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER } , { PTHREAD_COND_INITIALIZER } , { 0, 0, 0 } }; static void async_mutex_enter(int eMutex){ assert( eMutex==0 || eMutex==1 || eMutex==2 ); assert( eMutex!=2 || (!mutex_held(0) && !mutex_held(1) && !mutex_held(2)) ); assert( eMutex!=1 || (!mutex_held(0) && !mutex_held(1)) ); assert( eMutex!=0 || (!mutex_held(0)) ); pthread_mutex_lock(&primitives.aMutex[eMutex]); TESTONLY( primitives.aHolder[eMutex] = pthread_self(); ) } static void async_mutex_leave(int eMutex){ assert( eMutex==0 || eMutex==1 || eMutex==2 ); assert( mutex_held(eMutex) ); TESTONLY( primitives.aHolder[eMutex] = 0; ) pthread_mutex_unlock(&primitives.aMutex[eMutex]); } static void async_cond_wait(int eCond, int eMutex){ assert( eMutex==0 || eMutex==1 || eMutex==2 ); assert( mutex_held(eMutex) ); TESTONLY( primitives.aHolder[eMutex] = 0; ) pthread_cond_wait(&primitives.aCond[eCond], &primitives.aMutex[eMutex]); TESTONLY( primitives.aHolder[eMutex] = pthread_self(); ) } static void async_cond_signal(int eCond){ assert( mutex_held(ASYNC_MUTEX_QUEUE) ); pthread_cond_signal(&primitives.aCond[eCond]); } static void async_sched_yield(void){ sched_yield(); } #endif /* ** End of OS specific code. *************************************************************************/ #define assert_mutex_is_held(X) assert( mutex_held(X) ) #ifndef SQLITE_ASYNC_TWO_FILEHANDLES /* #define SQLITE_ASYNC_TWO_FILEHANDLES 0 */ #define SQLITE_ASYNC_TWO_FILEHANDLES 1 #endif /* ** State information is held in the static variable "async" defined ** as the following structure. ** ** Both async.ioError and async.nFile are protected by async.queueMutex. */ static struct TestAsyncStaticData { AsyncWrite *pQueueFirst; /* Next write operation to be processed */ AsyncWrite *pQueueLast; /* Last write operation on the list */ AsyncLock *pLock; /* Linked list of all AsyncLock structures */ volatile int ioDelay; /* Extra delay between write operations */ volatile int eHalt; /* One of the SQLITEASYNC_HALT_XXX values */ volatile int bLockFiles; /* Current value of "lockfiles" parameter */ int ioError; /* True if an IO error has occurred */ int nFile; /* Number of open files (from sqlite pov) */ } async = { 0,0,0,0,0,1,0,0 }; /* Possible values of AsyncWrite.op */ #define ASYNC_NOOP 0 #define ASYNC_WRITE 1 #define ASYNC_SYNC 2 #define ASYNC_TRUNCATE 3 #define ASYNC_CLOSE 4 #define ASYNC_DELETE 5 #define ASYNC_OPENEXCLUSIVE 6 #define ASYNC_UNLOCK 7 /* Names of opcodes. Used for debugging only. ** Make sure these stay in sync with the macros above! */ static const char *azOpcodeName[] = { "NOOP", "WRITE", "SYNC", "TRUNCATE", "CLOSE", "DELETE", "OPENEX", "UNLOCK" }; /* ** Entries on the write-op queue are instances of the AsyncWrite ** structure, defined here. ** ** The interpretation of the iOffset and nByte variables varies depending ** on the value of AsyncWrite.op: ** ** ASYNC_NOOP: ** No values used. ** ** ASYNC_WRITE: ** iOffset -> Offset in file to write to. ** nByte -> Number of bytes of data to write (pointed to by zBuf). ** ** ASYNC_SYNC: ** nByte -> flags to pass to sqlite3OsSync(). ** ** ASYNC_TRUNCATE: ** iOffset -> Size to truncate file to. ** nByte -> Unused. ** ** ASYNC_CLOSE: ** iOffset -> Unused. ** nByte -> Unused. ** ** ASYNC_DELETE: ** iOffset -> Contains the "syncDir" flag. ** nByte -> Number of bytes of zBuf points to (file name). ** ** ASYNC_OPENEXCLUSIVE: ** iOffset -> Value of "delflag". ** nByte -> Number of bytes of zBuf points to (file name). ** ** ASYNC_UNLOCK: ** nByte -> Argument to sqlite3OsUnlock(). ** ** ** For an ASYNC_WRITE operation, zBuf points to the data to write to the file. ** This space is sqlite3_malloc()d along with the AsyncWrite structure in a ** single blob, so is deleted when sqlite3_free() is called on the parent ** structure. */ struct AsyncWrite { AsyncFileData *pFileData; /* File to write data to or sync */ int op; /* One of ASYNC_xxx etc. */ sqlite_int64 iOffset; /* See above */ int nByte; /* See above */ char *zBuf; /* Data to write to file (or NULL if op!=ASYNC_WRITE) */ AsyncWrite *pNext; /* Next write operation (to any file) */ }; /* ** An instance of this structure is created for each distinct open file ** (i.e. if two handles are opened on the one file, only one of these ** structures is allocated) and stored in the async.aLock hash table. The ** keys for async.aLock are the full pathnames of the opened files. ** ** AsyncLock.pList points to the head of a linked list of AsyncFileLock ** structures, one for each handle currently open on the file. ** ** If the opened file is not a main-database (the SQLITE_OPEN_MAIN_DB is ** not passed to the sqlite3OsOpen() call), or if async.bLockFiles is ** false, variables AsyncLock.pFile and AsyncLock.eLock are never used. ** Otherwise, pFile is a file handle opened on the file in question and ** used to obtain the file-system locks required by database connections ** within this process. ** ** See comments above the asyncLock() function for more details on ** the implementation of database locking used by this backend. */ struct AsyncLock { char *zFile; int nFile; sqlite3_file *pFile; int eLock; AsyncFileLock *pList; AsyncLock *pNext; /* Next in linked list headed by async.pLock */ }; /* ** An instance of the following structure is allocated along with each ** AsyncFileData structure (see AsyncFileData.lock), but is only used if the ** file was opened with the SQLITE_OPEN_MAIN_DB. */ struct AsyncFileLock { int eLock; /* Internally visible lock state (sqlite pov) */ int eAsyncLock; /* Lock-state with write-queue unlock */ AsyncFileLock *pNext; }; /* ** The AsyncFile structure is a subclass of sqlite3_file used for ** asynchronous IO. ** ** All of the actual data for the structure is stored in the structure ** pointed to by AsyncFile.pData, which is allocated as part of the ** sqlite3OsOpen() using sqlite3_malloc(). The reason for this is that the ** lifetime of the AsyncFile structure is ended by the caller after OsClose() ** is called, but the data in AsyncFileData may be required by the ** writer thread after that point. */ struct AsyncFile { sqlite3_io_methods *pMethod; AsyncFileData *pData; }; struct AsyncFileData { char *zName; /* Underlying OS filename - used for debugging */ int nName; /* Number of characters in zName */ sqlite3_file *pBaseRead; /* Read handle to the underlying Os file */ sqlite3_file *pBaseWrite; /* Write handle to the underlying Os file */ AsyncFileLock lock; /* Lock state for this handle */ AsyncLock *pLock; /* AsyncLock object for this file system entry */ AsyncWrite closeOp; /* Preallocated close operation */ }; /* ** Add an entry to the end of the global write-op list. pWrite should point ** to an AsyncWrite structure allocated using sqlite3_malloc(). The writer ** thread will call sqlite3_free() to free the structure after the specified ** operation has been completed. ** ** Once an AsyncWrite structure has been added to the list, it becomes the ** property of the writer thread and must not be read or modified by the ** caller. */ static void addAsyncWrite(AsyncWrite *pWrite){ /* We must hold the queue mutex in order to modify the queue pointers */ if( pWrite->op!=ASYNC_UNLOCK ){ async_mutex_enter(ASYNC_MUTEX_QUEUE); } /* Add the record to the end of the write-op queue */ assert( !pWrite->pNext ); if( async.pQueueLast ){ assert( async.pQueueFirst ); async.pQueueLast->pNext = pWrite; }else{ async.pQueueFirst = pWrite; } async.pQueueLast = pWrite; ASYNC_TRACE(("PUSH %p (%s %s %d)\n", pWrite, azOpcodeName[pWrite->op], pWrite->pFileData ? pWrite->pFileData->zName : "-", pWrite->iOffset)); if( pWrite->op==ASYNC_CLOSE ){ async.nFile--; } /* The writer thread might have been idle because there was nothing ** on the write-op queue for it to do. So wake it up. */ async_cond_signal(ASYNC_COND_QUEUE); /* Drop the queue mutex */ if( pWrite->op!=ASYNC_UNLOCK ){ async_mutex_leave(ASYNC_MUTEX_QUEUE); } } /* ** Increment async.nFile in a thread-safe manner. */ static void incrOpenFileCount(void){ /* We must hold the queue mutex in order to modify async.nFile */ async_mutex_enter(ASYNC_MUTEX_QUEUE); if( async.nFile==0 ){ async.ioError = SQLITE_OK; } async.nFile++; async_mutex_leave(ASYNC_MUTEX_QUEUE); } /* ** This is a utility function to allocate and populate a new AsyncWrite ** structure and insert it (via addAsyncWrite() ) into the global list. */ static int addNewAsyncWrite( AsyncFileData *pFileData, int op, sqlite3_int64 iOffset, int nByte, const char *zByte ){ AsyncWrite *p; if( op!=ASYNC_CLOSE && async.ioError ){ return async.ioError; } p = sqlite3_malloc(sizeof(AsyncWrite) + (zByte?nByte:0)); if( !p ){ /* The upper layer does not expect operations like OsWrite() to ** return SQLITE_NOMEM. This is partly because under normal conditions ** SQLite is required to do rollback without calling malloc(). So ** if malloc() fails here, treat it as an I/O error. The above ** layer knows how to handle that. */ return SQLITE_IOERR; } p->op = op; p->iOffset = iOffset; p->nByte = nByte; p->pFileData = pFileData; p->pNext = 0; if( zByte ){ p->zBuf = (char *)&p[1]; memcpy(p->zBuf, zByte, nByte); }else{ p->zBuf = 0; } addAsyncWrite(p); return SQLITE_OK; } /* ** Close the file. This just adds an entry to the write-op list, the file is ** not actually closed. */ static int asyncClose(sqlite3_file *pFile){ AsyncFileData *p = ((AsyncFile *)pFile)->pData; /* Unlock the file, if it is locked */ async_mutex_enter(ASYNC_MUTEX_LOCK); p->lock.eLock = 0; async_mutex_leave(ASYNC_MUTEX_LOCK); addAsyncWrite(&p->closeOp); return SQLITE_OK; } /* ** Implementation of sqlite3OsWrite() for asynchronous files. Instead of ** writing to the underlying file, this function adds an entry to the end of ** the global AsyncWrite list. Either SQLITE_OK or SQLITE_NOMEM may be ** returned. */ static int asyncWrite( sqlite3_file *pFile, const void *pBuf, int amt, sqlite3_int64 iOff ){ AsyncFileData *p = ((AsyncFile *)pFile)->pData; return addNewAsyncWrite(p, ASYNC_WRITE, iOff, amt, pBuf); } /* ** Read data from the file. First we read from the filesystem, then adjust ** the contents of the buffer based on ASYNC_WRITE operations in the ** write-op queue. ** ** This method holds the mutex from start to finish. */ static int asyncRead( sqlite3_file *pFile, void *zOut, int iAmt, sqlite3_int64 iOffset ){ AsyncFileData *p = ((AsyncFile *)pFile)->pData; int rc = SQLITE_OK; sqlite3_int64 filesize = 0; sqlite3_file *pBase = p->pBaseRead; sqlite3_int64 iAmt64 = (sqlite3_int64)iAmt; /* Grab the write queue mutex for the duration of the call */ async_mutex_enter(ASYNC_MUTEX_QUEUE); /* If an I/O error has previously occurred in this virtual file ** system, then all subsequent operations fail. */ if( async.ioError!=SQLITE_OK ){ rc = async.ioError; goto asyncread_out; } if( pBase->pMethods ){ sqlite3_int64 nRead; rc = pBase->pMethods->xFileSize(pBase, &filesize); if( rc!=SQLITE_OK ){ goto asyncread_out; } nRead = MIN(filesize - iOffset, iAmt64); if( nRead>0 ){ rc = pBase->pMethods->xRead(pBase, zOut, (int)nRead, iOffset); ASYNC_TRACE(("READ %s %d bytes at %d\n", p->zName, nRead, iOffset)); } } if( rc==SQLITE_OK ){ AsyncWrite *pWrite; char *zName = p->zName; for(pWrite=async.pQueueFirst; pWrite; pWrite = pWrite->pNext){ if( pWrite->op==ASYNC_WRITE && ( (pWrite->pFileData==p) || (zName && pWrite->pFileData->zName==zName) )){ sqlite3_int64 nCopy; sqlite3_int64 nByte64 = (sqlite3_int64)pWrite->nByte; /* Set variable iBeginIn to the offset in buffer pWrite->zBuf[] from ** which data should be copied. Set iBeginOut to the offset within ** the output buffer to which data should be copied. If either of ** these offsets is a negative number, set them to 0. */ sqlite3_int64 iBeginOut = (pWrite->iOffset-iOffset); sqlite3_int64 iBeginIn = -iBeginOut; if( iBeginIn<0 ) iBeginIn = 0; if( iBeginOut<0 ) iBeginOut = 0; filesize = MAX(filesize, pWrite->iOffset+nByte64); nCopy = MIN(nByte64-iBeginIn, iAmt64-iBeginOut); if( nCopy>0 ){ memcpy(&((char *)zOut)[iBeginOut], &pWrite->zBuf[iBeginIn], (size_t)nCopy); ASYNC_TRACE(("OVERREAD %d bytes at %d\n", nCopy, iBeginOut+iOffset)); } } } } asyncread_out: async_mutex_leave(ASYNC_MUTEX_QUEUE); if( rc==SQLITE_OK && filesize<(iOffset+iAmt) ){ rc = SQLITE_IOERR_SHORT_READ; } return rc; } /* ** Truncate the file to nByte bytes in length. This just adds an entry to ** the write-op list, no IO actually takes place. */ static int asyncTruncate(sqlite3_file *pFile, sqlite3_int64 nByte){ AsyncFileData *p = ((AsyncFile *)pFile)->pData; return addNewAsyncWrite(p, ASYNC_TRUNCATE, nByte, 0, 0); } /* ** Sync the file. This just adds an entry to the write-op list, the ** sync() is done later by sqlite3_async_flush(). */ static int asyncSync(sqlite3_file *pFile, int flags){ AsyncFileData *p = ((AsyncFile *)pFile)->pData; return addNewAsyncWrite(p, ASYNC_SYNC, 0, flags, 0); } /* ** Read the size of the file. First we read the size of the file system ** entry, then adjust for any ASYNC_WRITE or ASYNC_TRUNCATE operations ** currently in the write-op list. ** ** This method holds the mutex from start to finish. */ int asyncFileSize(sqlite3_file *pFile, sqlite3_int64 *piSize){ AsyncFileData *p = ((AsyncFile *)pFile)->pData; int rc = SQLITE_OK; sqlite3_int64 s = 0; sqlite3_file *pBase; async_mutex_enter(ASYNC_MUTEX_QUEUE); /* Read the filesystem size from the base file. If pMethods is NULL, this ** means the file hasn't been opened yet. In this case all relevant data ** must be in the write-op queue anyway, so we can omit reading from the ** file-system. */ pBase = p->pBaseRead; if( pBase->pMethods ){ rc = pBase->pMethods->xFileSize(pBase, &s); } if( rc==SQLITE_OK ){ AsyncWrite *pWrite; for(pWrite=async.pQueueFirst; pWrite; pWrite = pWrite->pNext){ if( pWrite->op==ASYNC_DELETE && p->zName && strcmp(p->zName, pWrite->zBuf)==0 ){ s = 0; }else if( pWrite->pFileData && ( (pWrite->pFileData==p) || (p->zName && pWrite->pFileData->zName==p->zName) )){ switch( pWrite->op ){ case ASYNC_WRITE: s = MAX(pWrite->iOffset + (sqlite3_int64)(pWrite->nByte), s); break; case ASYNC_TRUNCATE: s = MIN(s, pWrite->iOffset); break; } } } *piSize = s; } async_mutex_leave(ASYNC_MUTEX_QUEUE); return rc; } /* ** Lock or unlock the actual file-system entry. */ static int getFileLock(AsyncLock *pLock){ int rc = SQLITE_OK; AsyncFileLock *pIter; int eRequired = 0; if( pLock->pFile ){ for(pIter=pLock->pList; pIter; pIter=pIter->pNext){ assert(pIter->eAsyncLock>=pIter->eLock); if( pIter->eAsyncLock>eRequired ){ eRequired = pIter->eAsyncLock; assert(eRequired>=0 && eRequired<=SQLITE_LOCK_EXCLUSIVE); } } if( eRequired>pLock->eLock ){ rc = pLock->pFile->pMethods->xLock(pLock->pFile, eRequired); if( rc==SQLITE_OK ){ pLock->eLock = eRequired; } } else if( eRequiredeLock && eRequired<=SQLITE_LOCK_SHARED ){ rc = pLock->pFile->pMethods->xUnlock(pLock->pFile, eRequired); if( rc==SQLITE_OK ){ pLock->eLock = eRequired; } } } return rc; } /* ** Return the AsyncLock structure from the global async.pLock list ** associated with the file-system entry identified by path zName ** (a string of nName bytes). If no such structure exists, return 0. */ static AsyncLock *findLock(const char *zName, int nName){ AsyncLock *p = async.pLock; while( p && (p->nFile!=nName || memcmp(p->zFile, zName, nName)) ){ p = p->pNext; } return p; } /* ** The following two methods - asyncLock() and asyncUnlock() - are used ** to obtain and release locks on database files opened with the ** asynchronous backend. */ static int asyncLock(sqlite3_file *pFile, int eLock){ int rc = SQLITE_OK; AsyncFileData *p = ((AsyncFile *)pFile)->pData; if( p->zName ){ async_mutex_enter(ASYNC_MUTEX_LOCK); if( p->lock.eLockpLock; AsyncFileLock *pIter; assert(pLock && pLock->pList); for(pIter=pLock->pList; pIter; pIter=pIter->pNext){ if( pIter!=&p->lock && ( (eLock==SQLITE_LOCK_EXCLUSIVE && pIter->eLock>=SQLITE_LOCK_SHARED) || (eLock==SQLITE_LOCK_PENDING && pIter->eLock>=SQLITE_LOCK_RESERVED) || (eLock==SQLITE_LOCK_RESERVED && pIter->eLock>=SQLITE_LOCK_RESERVED) || (eLock==SQLITE_LOCK_SHARED && pIter->eLock>=SQLITE_LOCK_PENDING) )){ rc = SQLITE_BUSY; } } if( rc==SQLITE_OK ){ p->lock.eLock = eLock; p->lock.eAsyncLock = MAX(p->lock.eAsyncLock, eLock); } assert(p->lock.eAsyncLock>=p->lock.eLock); if( rc==SQLITE_OK ){ rc = getFileLock(pLock); } } async_mutex_leave(ASYNC_MUTEX_LOCK); } ASYNC_TRACE(("LOCK %d (%s) rc=%d\n", eLock, p->zName, rc)); return rc; } static int asyncUnlock(sqlite3_file *pFile, int eLock){ int rc = SQLITE_OK; AsyncFileData *p = ((AsyncFile *)pFile)->pData; if( p->zName ){ AsyncFileLock *pLock = &p->lock; async_mutex_enter(ASYNC_MUTEX_QUEUE); async_mutex_enter(ASYNC_MUTEX_LOCK); pLock->eLock = MIN(pLock->eLock, eLock); rc = addNewAsyncWrite(p, ASYNC_UNLOCK, 0, eLock, 0); async_mutex_leave(ASYNC_MUTEX_LOCK); async_mutex_leave(ASYNC_MUTEX_QUEUE); } return rc; } /* ** This function is called when the pager layer first opens a database file ** and is checking for a hot-journal. */ static int asyncCheckReservedLock(sqlite3_file *pFile, int *pResOut){ int ret = 0; AsyncFileLock *pIter; AsyncFileData *p = ((AsyncFile *)pFile)->pData; async_mutex_enter(ASYNC_MUTEX_LOCK); for(pIter=p->pLock->pList; pIter; pIter=pIter->pNext){ if( pIter->eLock>=SQLITE_LOCK_RESERVED ){ ret = 1; break; } } async_mutex_leave(ASYNC_MUTEX_LOCK); ASYNC_TRACE(("CHECK-LOCK %d (%s)\n", ret, p->zName)); *pResOut = ret; return SQLITE_OK; } /* ** sqlite3_file_control() implementation. */ static int asyncFileControl(sqlite3_file *id, int op, void *pArg){ switch( op ){ case SQLITE_FCNTL_LOCKSTATE: { async_mutex_enter(ASYNC_MUTEX_LOCK); *(int*)pArg = ((AsyncFile*)id)->pData->lock.eLock; async_mutex_leave(ASYNC_MUTEX_LOCK); return SQLITE_OK; } } return SQLITE_NOTFOUND; } /* ** Return the device characteristics and sector-size of the device. It ** is tricky to implement these correctly, as this backend might ** not have an open file handle at this point. */ static int asyncSectorSize(sqlite3_file *pFile){ UNUSED_PARAMETER(pFile); return 512; } static int asyncDeviceCharacteristics(sqlite3_file *pFile){ UNUSED_PARAMETER(pFile); return 0; } static int unlinkAsyncFile(AsyncFileData *pData){ AsyncFileLock **ppIter; int rc = SQLITE_OK; if( pData->zName ){ AsyncLock *pLock = pData->pLock; for(ppIter=&pLock->pList; *ppIter; ppIter=&((*ppIter)->pNext)){ if( (*ppIter)==&pData->lock ){ *ppIter = pData->lock.pNext; break; } } if( !pLock->pList ){ AsyncLock **pp; if( pLock->pFile ){ pLock->pFile->pMethods->xClose(pLock->pFile); } for(pp=&async.pLock; *pp!=pLock; pp=&((*pp)->pNext)); *pp = pLock->pNext; sqlite3_free(pLock); }else{ rc = getFileLock(pLock); } } return rc; } /* ** The parameter passed to this function is a copy of a 'flags' parameter ** passed to this modules xOpen() method. This function returns true ** if the file should be opened asynchronously, or false if it should ** be opened immediately. ** ** If the file is to be opened asynchronously, then asyncOpen() will add ** an entry to the event queue and the file will not actually be opened ** until the event is processed. Otherwise, the file is opened directly ** by the caller. */ static int doAsynchronousOpen(int flags){ return (flags&SQLITE_OPEN_CREATE) && ( (flags&SQLITE_OPEN_MAIN_JOURNAL) || (flags&SQLITE_OPEN_TEMP_JOURNAL) || (flags&SQLITE_OPEN_DELETEONCLOSE) ); } /* ** Open a file. */ static int asyncOpen( sqlite3_vfs *pAsyncVfs, const char *zName, sqlite3_file *pFile, int flags, int *pOutFlags ){ static sqlite3_io_methods async_methods = { 1, /* iVersion */ asyncClose, /* xClose */ asyncRead, /* xRead */ asyncWrite, /* xWrite */ asyncTruncate, /* xTruncate */ asyncSync, /* xSync */ asyncFileSize, /* xFileSize */ asyncLock, /* xLock */ asyncUnlock, /* xUnlock */ asyncCheckReservedLock, /* xCheckReservedLock */ asyncFileControl, /* xFileControl */ asyncSectorSize, /* xSectorSize */ asyncDeviceCharacteristics /* xDeviceCharacteristics */ }; sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; AsyncFile *p = (AsyncFile *)pFile; int nName = 0; int rc = SQLITE_OK; int nByte; AsyncFileData *pData; AsyncLock *pLock = 0; char *z; int isAsyncOpen = doAsynchronousOpen(flags); /* If zName is NULL, then the upper layer is requesting an anonymous file. ** Otherwise, allocate enough space to make a copy of the file name (along ** with the second nul-terminator byte required by xOpen). */ if( zName ){ nName = (int)strlen(zName); } nByte = ( sizeof(AsyncFileData) + /* AsyncFileData structure */ 2 * pVfs->szOsFile + /* AsyncFileData.pBaseRead and pBaseWrite */ nName + 2 /* AsyncFileData.zName */ ); z = sqlite3_malloc(nByte); if( !z ){ return SQLITE_NOMEM; } memset(z, 0, nByte); pData = (AsyncFileData*)z; z += sizeof(pData[0]); pData->pBaseRead = (sqlite3_file*)z; z += pVfs->szOsFile; pData->pBaseWrite = (sqlite3_file*)z; pData->closeOp.pFileData = pData; pData->closeOp.op = ASYNC_CLOSE; if( zName ){ z += pVfs->szOsFile; pData->zName = z; pData->nName = nName; memcpy(pData->zName, zName, nName); } if( !isAsyncOpen ){ int flagsout; rc = pVfs->xOpen(pVfs, pData->zName, pData->pBaseRead, flags, &flagsout); if( rc==SQLITE_OK && (flagsout&SQLITE_OPEN_READWRITE) && (flags&SQLITE_OPEN_EXCLUSIVE)==0 ){ rc = pVfs->xOpen(pVfs, pData->zName, pData->pBaseWrite, flags, 0); } if( pOutFlags ){ *pOutFlags = flagsout; } } async_mutex_enter(ASYNC_MUTEX_LOCK); if( zName && rc==SQLITE_OK ){ pLock = findLock(pData->zName, pData->nName); if( !pLock ){ int nByte = pVfs->szOsFile + sizeof(AsyncLock) + pData->nName + 1; pLock = (AsyncLock *)sqlite3_malloc(nByte); if( pLock ){ memset(pLock, 0, nByte); if( async.bLockFiles && (flags&SQLITE_OPEN_MAIN_DB) ){ pLock->pFile = (sqlite3_file *)&pLock[1]; rc = pVfs->xOpen(pVfs, pData->zName, pLock->pFile, flags, 0); if( rc!=SQLITE_OK ){ sqlite3_free(pLock); pLock = 0; } } if( pLock ){ pLock->nFile = pData->nName; pLock->zFile = &((char *)(&pLock[1]))[pVfs->szOsFile]; memcpy(pLock->zFile, pData->zName, pLock->nFile); pLock->pNext = async.pLock; async.pLock = pLock; } }else{ rc = SQLITE_NOMEM; } } } if( rc==SQLITE_OK ){ p->pMethod = &async_methods; p->pData = pData; /* Link AsyncFileData.lock into the linked list of ** AsyncFileLock structures for this file. */ if( zName ){ pData->lock.pNext = pLock->pList; pLock->pList = &pData->lock; pData->zName = pLock->zFile; } }else{ if( pData->pBaseRead->pMethods ){ pData->pBaseRead->pMethods->xClose(pData->pBaseRead); } if( pData->pBaseWrite->pMethods ){ pData->pBaseWrite->pMethods->xClose(pData->pBaseWrite); } sqlite3_free(pData); } async_mutex_leave(ASYNC_MUTEX_LOCK); if( rc==SQLITE_OK ){ pData->pLock = pLock; } if( rc==SQLITE_OK && isAsyncOpen ){ rc = addNewAsyncWrite(pData, ASYNC_OPENEXCLUSIVE, (sqlite3_int64)flags,0,0); if( rc==SQLITE_OK ){ if( pOutFlags ) *pOutFlags = flags; }else{ async_mutex_enter(ASYNC_MUTEX_LOCK); unlinkAsyncFile(pData); async_mutex_leave(ASYNC_MUTEX_LOCK); sqlite3_free(pData); } } if( rc!=SQLITE_OK ){ p->pMethod = 0; }else{ incrOpenFileCount(); } return rc; } /* ** Implementation of sqlite3OsDelete. Add an entry to the end of the ** write-op queue to perform the delete. */ static int asyncDelete(sqlite3_vfs *pAsyncVfs, const char *z, int syncDir){ UNUSED_PARAMETER(pAsyncVfs); return addNewAsyncWrite(0, ASYNC_DELETE, syncDir, (int)strlen(z)+1, z); } /* ** Implementation of sqlite3OsAccess. This method holds the mutex from ** start to finish. */ static int asyncAccess( sqlite3_vfs *pAsyncVfs, const char *zName, int flags, int *pResOut ){ int rc; int ret; AsyncWrite *p; sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; assert(flags==SQLITE_ACCESS_READWRITE || flags==SQLITE_ACCESS_READ || flags==SQLITE_ACCESS_EXISTS ); async_mutex_enter(ASYNC_MUTEX_QUEUE); rc = pVfs->xAccess(pVfs, zName, flags, &ret); if( rc==SQLITE_OK && flags==SQLITE_ACCESS_EXISTS ){ for(p=async.pQueueFirst; p; p = p->pNext){ if( p->op==ASYNC_DELETE && 0==strcmp(p->zBuf, zName) ){ ret = 0; }else if( p->op==ASYNC_OPENEXCLUSIVE && p->pFileData->zName && 0==strcmp(p->pFileData->zName, zName) ){ ret = 1; } } } ASYNC_TRACE(("ACCESS(%s): %s = %d\n", flags==SQLITE_ACCESS_READWRITE?"read-write": flags==SQLITE_ACCESS_READ?"read":"exists" , zName, ret) ); async_mutex_leave(ASYNC_MUTEX_QUEUE); *pResOut = ret; return rc; } /* ** Fill in zPathOut with the full path to the file identified by zPath. */ static int asyncFullPathname( sqlite3_vfs *pAsyncVfs, const char *zPath, int nPathOut, char *zPathOut ){ int rc; sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; rc = pVfs->xFullPathname(pVfs, zPath, nPathOut, zPathOut); /* Because of the way intra-process file locking works, this backend ** needs to return a canonical path. The following block assumes the ** file-system uses unix style paths. */ if( rc==SQLITE_OK ){ int i, j; char *z = zPathOut; int n = (int)strlen(z); while( n>1 && z[n-1]=='/' ){ n--; } for(i=j=0; i0 && z[j-1]!='/' ){ j--; } if( j>0 ){ j--; } i += 2; continue; } } z[j++] = z[i]; } z[j] = 0; } return rc; } static void *asyncDlOpen(sqlite3_vfs *pAsyncVfs, const char *zPath){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; return pVfs->xDlOpen(pVfs, zPath); } static void asyncDlError(sqlite3_vfs *pAsyncVfs, int nByte, char *zErrMsg){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; pVfs->xDlError(pVfs, nByte, zErrMsg); } static void (*asyncDlSym( sqlite3_vfs *pAsyncVfs, void *pHandle, const char *zSymbol ))(void){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; return pVfs->xDlSym(pVfs, pHandle, zSymbol); } static void asyncDlClose(sqlite3_vfs *pAsyncVfs, void *pHandle){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; pVfs->xDlClose(pVfs, pHandle); } static int asyncRandomness(sqlite3_vfs *pAsyncVfs, int nByte, char *zBufOut){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; return pVfs->xRandomness(pVfs, nByte, zBufOut); } static int asyncSleep(sqlite3_vfs *pAsyncVfs, int nMicro){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; return pVfs->xSleep(pVfs, nMicro); } static int asyncCurrentTime(sqlite3_vfs *pAsyncVfs, double *pTimeOut){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; return pVfs->xCurrentTime(pVfs, pTimeOut); } static sqlite3_vfs async_vfs = { 1, /* iVersion */ sizeof(AsyncFile), /* szOsFile */ 0, /* mxPathname */ 0, /* pNext */ SQLITEASYNC_VFSNAME, /* zName */ 0, /* pAppData */ asyncOpen, /* xOpen */ asyncDelete, /* xDelete */ asyncAccess, /* xAccess */ asyncFullPathname, /* xFullPathname */ asyncDlOpen, /* xDlOpen */ asyncDlError, /* xDlError */ asyncDlSym, /* xDlSym */ asyncDlClose, /* xDlClose */ asyncRandomness, /* xDlError */ asyncSleep, /* xDlSym */ asyncCurrentTime /* xDlClose */ }; /* ** This procedure runs in a separate thread, reading messages off of the ** write queue and processing them one by one. ** ** If async.writerHaltNow is true, then this procedure exits ** after processing a single message. ** ** If async.writerHaltWhenIdle is true, then this procedure exits when ** the write queue is empty. ** ** If both of the above variables are false, this procedure runs ** indefinately, waiting for operations to be added to the write queue ** and processing them in the order in which they arrive. ** ** An artifical delay of async.ioDelay milliseconds is inserted before ** each write operation in order to simulate the effect of a slow disk. ** ** Only one instance of this procedure may be running at a time. */ static void asyncWriterThread(void){ sqlite3_vfs *pVfs = (sqlite3_vfs *)(async_vfs.pAppData); AsyncWrite *p = 0; int rc = SQLITE_OK; int holdingMutex = 0; async_mutex_enter(ASYNC_MUTEX_WRITER); while( async.eHalt!=SQLITEASYNC_HALT_NOW ){ int doNotFree = 0; sqlite3_file *pBase = 0; if( !holdingMutex ){ async_mutex_enter(ASYNC_MUTEX_QUEUE); } while( (p = async.pQueueFirst)==0 ){ if( async.eHalt!=SQLITEASYNC_HALT_NEVER ){ async_mutex_leave(ASYNC_MUTEX_QUEUE); break; }else{ ASYNC_TRACE(("IDLE\n")); async_cond_wait(ASYNC_COND_QUEUE, ASYNC_MUTEX_QUEUE); ASYNC_TRACE(("WAKEUP\n")); } } if( p==0 ) break; holdingMutex = 1; /* Right now this thread is holding the mutex on the write-op queue. ** Variable 'p' points to the first entry in the write-op queue. In ** the general case, we hold on to the mutex for the entire body of ** the loop. ** ** However in the cases enumerated below, we relinquish the mutex, ** perform the IO, and then re-request the mutex before removing 'p' from ** the head of the write-op queue. The idea is to increase concurrency with ** sqlite threads. ** ** * An ASYNC_CLOSE operation. ** * An ASYNC_OPENEXCLUSIVE operation. For this one, we relinquish ** the mutex, call the underlying xOpenExclusive() function, then ** re-aquire the mutex before seting the AsyncFile.pBaseRead ** variable. ** * ASYNC_SYNC and ASYNC_WRITE operations, if ** SQLITE_ASYNC_TWO_FILEHANDLES was set at compile time and two ** file-handles are open for the particular file being "synced". */ if( async.ioError!=SQLITE_OK && p->op!=ASYNC_CLOSE ){ p->op = ASYNC_NOOP; } if( p->pFileData ){ pBase = p->pFileData->pBaseWrite; if( p->op==ASYNC_CLOSE || p->op==ASYNC_OPENEXCLUSIVE || (pBase->pMethods && (p->op==ASYNC_SYNC || p->op==ASYNC_WRITE) ) ){ async_mutex_leave(ASYNC_MUTEX_QUEUE); holdingMutex = 0; } if( !pBase->pMethods ){ pBase = p->pFileData->pBaseRead; } } switch( p->op ){ case ASYNC_NOOP: break; case ASYNC_WRITE: assert( pBase ); ASYNC_TRACE(("WRITE %s %d bytes at %d\n", p->pFileData->zName, p->nByte, p->iOffset)); rc = pBase->pMethods->xWrite(pBase, (void *)(p->zBuf), p->nByte, p->iOffset); break; case ASYNC_SYNC: assert( pBase ); ASYNC_TRACE(("SYNC %s\n", p->pFileData->zName)); rc = pBase->pMethods->xSync(pBase, p->nByte); break; case ASYNC_TRUNCATE: assert( pBase ); ASYNC_TRACE(("TRUNCATE %s to %d bytes\n", p->pFileData->zName, p->iOffset)); rc = pBase->pMethods->xTruncate(pBase, p->iOffset); break; case ASYNC_CLOSE: { AsyncFileData *pData = p->pFileData; ASYNC_TRACE(("CLOSE %s\n", p->pFileData->zName)); if( pData->pBaseWrite->pMethods ){ pData->pBaseWrite->pMethods->xClose(pData->pBaseWrite); } if( pData->pBaseRead->pMethods ){ pData->pBaseRead->pMethods->xClose(pData->pBaseRead); } /* Unlink AsyncFileData.lock from the linked list of AsyncFileLock ** structures for this file. Obtain the async.lockMutex mutex ** before doing so. */ async_mutex_enter(ASYNC_MUTEX_LOCK); rc = unlinkAsyncFile(pData); async_mutex_leave(ASYNC_MUTEX_LOCK); if( !holdingMutex ){ async_mutex_enter(ASYNC_MUTEX_QUEUE); holdingMutex = 1; } assert_mutex_is_held(ASYNC_MUTEX_QUEUE); async.pQueueFirst = p->pNext; sqlite3_free(pData); doNotFree = 1; break; } case ASYNC_UNLOCK: { AsyncWrite *pIter; AsyncFileData *pData = p->pFileData; int eLock = p->nByte; /* When a file is locked by SQLite using the async backend, it is ** locked within the 'real' file-system synchronously. When it is ** unlocked, an ASYNC_UNLOCK event is added to the write-queue to ** unlock the file asynchronously. The design of the async backend ** requires that the 'real' file-system file be locked from the ** time that SQLite first locks it (and probably reads from it) ** until all asynchronous write events that were scheduled before ** SQLite unlocked the file have been processed. ** ** This is more complex if SQLite locks and unlocks the file multiple ** times in quick succession. For example, if SQLite does: ** ** lock, write, unlock, lock, write, unlock ** ** Each "lock" operation locks the file immediately. Each "write" ** and "unlock" operation adds an event to the event queue. If the ** second "lock" operation is performed before the first "unlock" ** operation has been processed asynchronously, then the first ** "unlock" cannot be safely processed as is, since this would mean ** the file was unlocked when the second "write" operation is ** processed. To work around this, when processing an ASYNC_UNLOCK ** operation, SQLite: ** ** 1) Unlocks the file to the minimum of the argument passed to ** the xUnlock() call and the current lock from SQLite's point ** of view, and ** ** 2) Only unlocks the file at all if this event is the last ** ASYNC_UNLOCK event on this file in the write-queue. */ assert( holdingMutex==1 ); assert( async.pQueueFirst==p ); for(pIter=async.pQueueFirst->pNext; pIter; pIter=pIter->pNext){ if( pIter->pFileData==pData && pIter->op==ASYNC_UNLOCK ) break; } if( !pIter ){ async_mutex_enter(ASYNC_MUTEX_LOCK); pData->lock.eAsyncLock = MIN( pData->lock.eAsyncLock, MAX(pData->lock.eLock, eLock) ); assert(pData->lock.eAsyncLock>=pData->lock.eLock); rc = getFileLock(pData->pLock); async_mutex_leave(ASYNC_MUTEX_LOCK); } break; } case ASYNC_DELETE: ASYNC_TRACE(("DELETE %s\n", p->zBuf)); rc = pVfs->xDelete(pVfs, p->zBuf, (int)p->iOffset); if( rc==SQLITE_IOERR_DELETE_NOENT ) rc = SQLITE_OK; break; case ASYNC_OPENEXCLUSIVE: { int flags = (int)p->iOffset; AsyncFileData *pData = p->pFileData; ASYNC_TRACE(("OPEN %s flags=%d\n", p->zBuf, (int)p->iOffset)); assert(pData->pBaseRead->pMethods==0 && pData->pBaseWrite->pMethods==0); rc = pVfs->xOpen(pVfs, pData->zName, pData->pBaseRead, flags, 0); assert( holdingMutex==0 ); async_mutex_enter(ASYNC_MUTEX_QUEUE); holdingMutex = 1; break; } default: assert(!"Illegal value for AsyncWrite.op"); } /* If we didn't hang on to the mutex during the IO op, obtain it now ** so that the AsyncWrite structure can be safely removed from the ** global write-op queue. */ if( !holdingMutex ){ async_mutex_enter(ASYNC_MUTEX_QUEUE); holdingMutex = 1; } /* ASYNC_TRACE(("UNLINK %p\n", p)); */ if( p==async.pQueueLast ){ async.pQueueLast = 0; } if( !doNotFree ){ assert_mutex_is_held(ASYNC_MUTEX_QUEUE); async.pQueueFirst = p->pNext; sqlite3_free(p); } assert( holdingMutex ); /* An IO error has occurred. We cannot report the error back to the ** connection that requested the I/O since the error happened ** asynchronously. The connection has already moved on. There ** really is nobody to report the error to. ** ** The file for which the error occurred may have been a database or ** journal file. Regardless, none of the currently queued operations ** associated with the same database should now be performed. Nor should ** any subsequently requested IO on either a database or journal file ** handle for the same database be accepted until the main database ** file handle has been closed and reopened. ** ** Furthermore, no further IO should be queued or performed on any file ** handle associated with a database that may have been part of a ** multi-file transaction that included the database associated with ** the IO error (i.e. a database ATTACHed to the same handle at some ** point in time). */ if( rc!=SQLITE_OK ){ async.ioError = rc; } if( async.ioError && !async.pQueueFirst ){ async_mutex_enter(ASYNC_MUTEX_LOCK); if( 0==async.pLock ){ async.ioError = SQLITE_OK; } async_mutex_leave(ASYNC_MUTEX_LOCK); } /* Drop the queue mutex before continuing to the next write operation ** in order to give other threads a chance to work with the write queue. */ if( !async.pQueueFirst || !async.ioError ){ async_mutex_leave(ASYNC_MUTEX_QUEUE); holdingMutex = 0; if( async.ioDelay>0 ){ pVfs->xSleep(pVfs, async.ioDelay*1000); }else{ async_sched_yield(); } } } async_mutex_leave(ASYNC_MUTEX_WRITER); return; } /* ** Install the asynchronous VFS. */ int sqlite3async_initialize(const char *zParent, int isDefault){ int rc = SQLITE_OK; if( async_vfs.pAppData==0 ){ sqlite3_vfs *pParent = sqlite3_vfs_find(zParent); if( !pParent || async_os_initialize() ){ rc = SQLITE_ERROR; }else if( SQLITE_OK!=(rc = sqlite3_vfs_register(&async_vfs, isDefault)) ){ async_os_shutdown(); }else{ async_vfs.pAppData = (void *)pParent; async_vfs.mxPathname = ((sqlite3_vfs *)async_vfs.pAppData)->mxPathname; } } return rc; } /* ** Uninstall the asynchronous VFS. */ void sqlite3async_shutdown(void){ if( async_vfs.pAppData ){ async_os_shutdown(); sqlite3_vfs_unregister((sqlite3_vfs *)&async_vfs); async_vfs.pAppData = 0; } } /* ** Process events on the write-queue. */ void sqlite3async_run(void){ asyncWriterThread(); } /* ** Control/configure the asynchronous IO system. */ int sqlite3async_control(int op, ...){ int rc = SQLITE_OK; va_list ap; va_start(ap, op); switch( op ){ case SQLITEASYNC_HALT: { int eWhen = va_arg(ap, int); if( eWhen!=SQLITEASYNC_HALT_NEVER && eWhen!=SQLITEASYNC_HALT_NOW && eWhen!=SQLITEASYNC_HALT_IDLE ){ rc = SQLITE_MISUSE; break; } async.eHalt = eWhen; async_mutex_enter(ASYNC_MUTEX_QUEUE); async_cond_signal(ASYNC_COND_QUEUE); async_mutex_leave(ASYNC_MUTEX_QUEUE); break; } case SQLITEASYNC_DELAY: { int iDelay = va_arg(ap, int); if( iDelay<0 ){ rc = SQLITE_MISUSE; break; } async.ioDelay = iDelay; break; } case SQLITEASYNC_LOCKFILES: { int bLock = va_arg(ap, int); async_mutex_enter(ASYNC_MUTEX_QUEUE); if( async.nFile || async.pQueueFirst ){ async_mutex_leave(ASYNC_MUTEX_QUEUE); rc = SQLITE_MISUSE; break; } async.bLockFiles = bLock; async_mutex_leave(ASYNC_MUTEX_QUEUE); break; } case SQLITEASYNC_GET_HALT: { int *peWhen = va_arg(ap, int *); *peWhen = async.eHalt; break; } case SQLITEASYNC_GET_DELAY: { int *piDelay = va_arg(ap, int *); *piDelay = async.ioDelay; break; } case SQLITEASYNC_GET_LOCKFILES: { int *piDelay = va_arg(ap, int *); *piDelay = async.bLockFiles; break; } default: rc = SQLITE_ERROR; break; } va_end(ap); return rc; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ASYNCIO) */ ================================================ FILE: v2/testdata/_sqlite/ext/async/sqlite3async.h ================================================ #ifndef __SQLITEASYNC_H_ #define __SQLITEASYNC_H_ 1 /* ** Make sure we can call this stuff from C++. */ #ifdef __cplusplus extern "C" { #endif #define SQLITEASYNC_VFSNAME "sqlite3async" /* ** THREAD SAFETY NOTES: ** ** Of the four API functions in this file, the following are not threadsafe: ** ** sqlite3async_initialize() ** sqlite3async_shutdown() ** ** Care must be taken that neither of these functions is called while ** another thread may be calling either any sqlite3async_XXX() function ** or an sqlite3_XXX() API function related to a database handle that ** is using the asynchronous IO VFS. ** ** These functions: ** ** sqlite3async_run() ** sqlite3async_control() ** ** are threadsafe. It is quite safe to call either of these functions even ** if another thread may also be calling one of them or an sqlite3_XXX() ** function related to a database handle that uses the asynchronous IO VFS. */ /* ** Initialize the asynchronous IO VFS and register it with SQLite using ** sqlite3_vfs_register(). If the asynchronous VFS is already initialized ** and registered, this function is a no-op. The asynchronous IO VFS ** is registered as "sqlite3async". ** ** The asynchronous IO VFS does not make operating system IO requests ** directly. Instead, it uses an existing VFS implementation for all ** required file-system operations. If the first parameter to this function ** is NULL, then the current default VFS is used for IO. If it is not ** NULL, then it must be the name of an existing VFS. In other words, the ** first argument to this function is passed to sqlite3_vfs_find() to ** locate the VFS to use for all real IO operations. This VFS is known ** as the "parent VFS". ** ** If the second parameter to this function is non-zero, then the ** asynchronous IO VFS is registered as the default VFS for all SQLite ** database connections within the process. Otherwise, the asynchronous IO ** VFS is only used by connections opened using sqlite3_open_v2() that ** specifically request VFS "sqlite3async". ** ** If a parent VFS cannot be located, then SQLITE_ERROR is returned. ** In the unlikely event that operating system specific initialization ** fails (win32 systems create the required critical section and event ** objects within this function), then SQLITE_ERROR is also returned. ** Finally, if the call to sqlite3_vfs_register() returns an error, then ** the error code is returned to the user by this function. In all three ** of these cases, intialization has failed and the asynchronous IO VFS ** is not registered with SQLite. ** ** Otherwise, if no error occurs, SQLITE_OK is returned. */ int sqlite3async_initialize(const char *zParent, int isDefault); /* ** This function unregisters the asynchronous IO VFS using ** sqlite3_vfs_unregister(). ** ** On win32 platforms, this function also releases the small number of ** critical section and event objects created by sqlite3async_initialize(). */ void sqlite3async_shutdown(void); /* ** This function may only be called when the asynchronous IO VFS is ** installed (after a call to sqlite3async_initialize()). It processes ** zero or more queued write operations before returning. It is expected ** (but not required) that this function will be called by a different ** thread than those threads that use SQLite. The "background thread" ** that performs IO. ** ** How many queued write operations are performed before returning ** depends on the global setting configured by passing the SQLITEASYNC_HALT ** verb to sqlite3async_control() (see below for details). By default ** this function never returns - it processes all pending operations and ** then blocks waiting for new ones. ** ** If multiple simultaneous calls are made to sqlite3async_run() from two ** or more threads, then the calls are serialized internally. */ void sqlite3async_run(void); /* ** This function may only be called when the asynchronous IO VFS is ** installed (after a call to sqlite3async_initialize()). It is used ** to query or configure various parameters that affect the operation ** of the asynchronous IO VFS. At present there are three parameters ** supported: ** ** * The "halt" parameter, which configures the circumstances under ** which the sqlite3async_run() parameter is configured. ** ** * The "delay" parameter. Setting the delay parameter to a non-zero ** value causes the sqlite3async_run() function to sleep for the ** configured number of milliseconds between each queued write ** operation. ** ** * The "lockfiles" parameter. This parameter determines whether or ** not the asynchronous IO VFS locks the database files it operates ** on. Disabling file locking can improve throughput. ** ** This function is always passed two arguments. When setting the value ** of a parameter, the first argument must be one of SQLITEASYNC_HALT, ** SQLITEASYNC_DELAY or SQLITEASYNC_LOCKFILES. The second argument must ** be passed the new value for the parameter as type "int". ** ** When querying the current value of a paramter, the first argument must ** be one of SQLITEASYNC_GET_HALT, GET_DELAY or GET_LOCKFILES. The second ** argument to this function must be of type (int *). The current value ** of the queried parameter is copied to the memory pointed to by the ** second argument. For example: ** ** int eCurrentHalt; ** int eNewHalt = SQLITEASYNC_HALT_IDLE; ** ** sqlite3async_control(SQLITEASYNC_HALT, eNewHalt); ** sqlite3async_control(SQLITEASYNC_GET_HALT, &eCurrentHalt); ** assert( eNewHalt==eCurrentHalt ); ** ** See below for more detail on each configuration parameter. ** ** SQLITEASYNC_HALT: ** ** This is used to set the value of the "halt" parameter. The second ** argument must be one of the SQLITEASYNC_HALT_XXX symbols defined ** below (either NEVER, IDLE and NOW). ** ** If the parameter is set to NEVER, then calls to sqlite3async_run() ** never return. This is the default setting. If the parameter is set ** to IDLE, then calls to sqlite3async_run() return as soon as the ** queue of pending write operations is empty. If the parameter is set ** to NOW, then calls to sqlite3async_run() return as quickly as ** possible, without processing any pending write requests. ** ** If an attempt is made to set this parameter to an integer value other ** than SQLITEASYNC_HALT_NEVER, IDLE or NOW, then sqlite3async_control() ** returns SQLITE_MISUSE and the current value of the parameter is not ** modified. ** ** Modifying the "halt" parameter affects calls to sqlite3async_run() ** made by other threads that are currently in progress. ** ** SQLITEASYNC_DELAY: ** ** This is used to set the value of the "delay" parameter. If set to ** a non-zero value, then after completing a pending write request, the ** sqlite3async_run() function sleeps for the configured number of ** milliseconds. ** ** If an attempt is made to set this parameter to a negative value, ** sqlite3async_control() returns SQLITE_MISUSE and the current value ** of the parameter is not modified. ** ** Modifying the "delay" parameter affects calls to sqlite3async_run() ** made by other threads that are currently in progress. ** ** SQLITEASYNC_LOCKFILES: ** ** This is used to set the value of the "lockfiles" parameter. This ** parameter must be set to either 0 or 1. If set to 1, then the ** asynchronous IO VFS uses the xLock() and xUnlock() methods of the ** parent VFS to lock database files being read and/or written. If ** the parameter is set to 0, then these locks are omitted. ** ** This parameter may only be set when there are no open database ** connections using the VFS and the queue of pending write requests ** is empty. Attempting to set it when this is not true, or to set it ** to a value other than 0 or 1 causes sqlite3async_control() to return ** SQLITE_MISUSE and the value of the parameter to remain unchanged. ** ** If this parameter is set to zero, then it is only safe to access the ** database via the asynchronous IO VFS from within a single process. If ** while writing to the database via the asynchronous IO VFS the database ** is also read or written from within another process, or via another ** connection that does not use the asynchronous IO VFS within the same ** process, the results are undefined (and may include crashes or database ** corruption). ** ** Alternatively, if this parameter is set to 1, then it is safe to access ** the database from multiple connections within multiple processes using ** either the asynchronous IO VFS or the parent VFS directly. */ int sqlite3async_control(int op, ...); /* ** Values that can be used as the first argument to sqlite3async_control(). */ #define SQLITEASYNC_HALT 1 #define SQLITEASYNC_GET_HALT 2 #define SQLITEASYNC_DELAY 3 #define SQLITEASYNC_GET_DELAY 4 #define SQLITEASYNC_LOCKFILES 5 #define SQLITEASYNC_GET_LOCKFILES 6 /* ** If the first argument to sqlite3async_control() is SQLITEASYNC_HALT, ** the second argument should be one of the following. */ #define SQLITEASYNC_HALT_NEVER 0 /* Never halt (default value) */ #define SQLITEASYNC_HALT_NOW 1 /* Halt as soon as possible */ #define SQLITEASYNC_HALT_IDLE 2 /* Halt when write-queue is empty */ #ifdef __cplusplus } /* End of the 'extern "C"' block */ #endif #endif /* ifndef __SQLITEASYNC_H_ */ ================================================ FILE: v2/testdata/_sqlite/ext/fts1/README.txt ================================================ This folder contains source code to the first full-text search extension for SQLite. ================================================ FILE: v2/testdata/_sqlite/ext/fts1/ft_hash.c ================================================ /* ** 2001 September 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the implementation of generic hash-tables used in SQLite. ** We've modified it slightly to serve as a standalone hash table ** implementation for the full-text indexing module. */ #include #include #include #include "ft_hash.h" void *malloc_and_zero(int n){ void *p = malloc(n); if( p ){ memset(p, 0, n); } return p; } /* Turn bulk memory into a hash table object by initializing the ** fields of the Hash structure. ** ** "pNew" is a pointer to the hash table that is to be initialized. ** keyClass is one of the constants HASH_INT, HASH_POINTER, ** HASH_BINARY, or HASH_STRING. The value of keyClass ** determines what kind of key the hash table will use. "copyKey" is ** true if the hash table should make its own private copy of keys and ** false if it should just use the supplied pointer. CopyKey only makes ** sense for HASH_STRING and HASH_BINARY and is ignored ** for other key classes. */ void HashInit(Hash *pNew, int keyClass, int copyKey){ assert( pNew!=0 ); assert( keyClass>=HASH_STRING && keyClass<=HASH_BINARY ); pNew->keyClass = keyClass; #if 0 if( keyClass==HASH_POINTER || keyClass==HASH_INT ) copyKey = 0; #endif pNew->copyKey = copyKey; pNew->first = 0; pNew->count = 0; pNew->htsize = 0; pNew->ht = 0; pNew->xMalloc = malloc_and_zero; pNew->xFree = free; } /* Remove all entries from a hash table. Reclaim all memory. ** Call this routine to delete a hash table or to reset a hash table ** to the empty state. */ void HashClear(Hash *pH){ HashElem *elem; /* For looping over all elements of the table */ assert( pH!=0 ); elem = pH->first; pH->first = 0; if( pH->ht ) pH->xFree(pH->ht); pH->ht = 0; pH->htsize = 0; while( elem ){ HashElem *next_elem = elem->next; if( pH->copyKey && elem->pKey ){ pH->xFree(elem->pKey); } pH->xFree(elem); elem = next_elem; } pH->count = 0; } #if 0 /* NOT USED */ /* ** Hash and comparison functions when the mode is HASH_INT */ static int intHash(const void *pKey, int nKey){ return nKey ^ (nKey<<8) ^ (nKey>>8); } static int intCompare(const void *pKey1, int n1, const void *pKey2, int n2){ return n2 - n1; } #endif #if 0 /* NOT USED */ /* ** Hash and comparison functions when the mode is HASH_POINTER */ static int ptrHash(const void *pKey, int nKey){ uptr x = Addr(pKey); return x ^ (x<<8) ^ (x>>8); } static int ptrCompare(const void *pKey1, int n1, const void *pKey2, int n2){ if( pKey1==pKey2 ) return 0; if( pKey1 0 ){ h = (h<<3) ^ h ^ *z++; nKey--; } return h & 0x7fffffff; } static int strCompare(const void *pKey1, int n1, const void *pKey2, int n2){ if( n1!=n2 ) return 1; return strncmp((const char*)pKey1,(const char*)pKey2,n1); } /* ** Hash and comparison functions when the mode is HASH_BINARY */ static int binHash(const void *pKey, int nKey){ int h = 0; const char *z = (const char *)pKey; while( nKey-- > 0 ){ h = (h<<3) ^ h ^ *(z++); } return h & 0x7fffffff; } static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){ if( n1!=n2 ) return 1; return memcmp(pKey1,pKey2,n1); } /* ** Return a pointer to the appropriate hash function given the key class. ** ** The C syntax in this function definition may be unfamilar to some ** programmers, so we provide the following additional explanation: ** ** The name of the function is "hashFunction". The function takes a ** single parameter "keyClass". The return value of hashFunction() ** is a pointer to another function. Specifically, the return value ** of hashFunction() is a pointer to a function that takes two parameters ** with types "const void*" and "int" and returns an "int". */ static int (*hashFunction(int keyClass))(const void*,int){ #if 0 /* HASH_INT and HASH_POINTER are never used */ switch( keyClass ){ case HASH_INT: return &intHash; case HASH_POINTER: return &ptrHash; case HASH_STRING: return &strHash; case HASH_BINARY: return &binHash;; default: break; } return 0; #else if( keyClass==HASH_STRING ){ return &strHash; }else{ assert( keyClass==HASH_BINARY ); return &binHash; } #endif } /* ** Return a pointer to the appropriate hash function given the key class. ** ** For help in interpreted the obscure C code in the function definition, ** see the header comment on the previous function. */ static int (*compareFunction(int keyClass))(const void*,int,const void*,int){ #if 0 /* HASH_INT and HASH_POINTER are never used */ switch( keyClass ){ case HASH_INT: return &intCompare; case HASH_POINTER: return &ptrCompare; case HASH_STRING: return &strCompare; case HASH_BINARY: return &binCompare; default: break; } return 0; #else if( keyClass==HASH_STRING ){ return &strCompare; }else{ assert( keyClass==HASH_BINARY ); return &binCompare; } #endif } /* Link an element into the hash table */ static void insertElement( Hash *pH, /* The complete hash table */ struct _ht *pEntry, /* The entry into which pNew is inserted */ HashElem *pNew /* The element to be inserted */ ){ HashElem *pHead; /* First element already in pEntry */ pHead = pEntry->chain; if( pHead ){ pNew->next = pHead; pNew->prev = pHead->prev; if( pHead->prev ){ pHead->prev->next = pNew; } else { pH->first = pNew; } pHead->prev = pNew; }else{ pNew->next = pH->first; if( pH->first ){ pH->first->prev = pNew; } pNew->prev = 0; pH->first = pNew; } pEntry->count++; pEntry->chain = pNew; } /* Resize the hash table so that it cantains "new_size" buckets. ** "new_size" must be a power of 2. The hash table might fail ** to resize if sqliteMalloc() fails. */ static void rehash(Hash *pH, int new_size){ struct _ht *new_ht; /* The new hash table */ HashElem *elem, *next_elem; /* For looping over existing elements */ int (*xHash)(const void*,int); /* The hash function */ assert( (new_size & (new_size-1))==0 ); new_ht = (struct _ht *)pH->xMalloc( new_size*sizeof(struct _ht) ); if( new_ht==0 ) return; if( pH->ht ) pH->xFree(pH->ht); pH->ht = new_ht; pH->htsize = new_size; xHash = hashFunction(pH->keyClass); for(elem=pH->first, pH->first=0; elem; elem = next_elem){ int h = (*xHash)(elem->pKey, elem->nKey) & (new_size-1); next_elem = elem->next; insertElement(pH, &new_ht[h], elem); } } /* This function (for internal use only) locates an element in an ** hash table that matches the given key. The hash for this key has ** already been computed and is passed as the 4th parameter. */ static HashElem *findElementGivenHash( const Hash *pH, /* The pH to be searched */ const void *pKey, /* The key we are searching for */ int nKey, int h /* The hash for this key. */ ){ HashElem *elem; /* Used to loop thru the element list */ int count; /* Number of elements left to test */ int (*xCompare)(const void*,int,const void*,int); /* comparison function */ if( pH->ht ){ struct _ht *pEntry = &pH->ht[h]; elem = pEntry->chain; count = pEntry->count; xCompare = compareFunction(pH->keyClass); while( count-- && elem ){ if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ return elem; } elem = elem->next; } } return 0; } /* Remove a single entry from the hash table given a pointer to that ** element and a hash on the element's key. */ static void removeElementGivenHash( Hash *pH, /* The pH containing "elem" */ HashElem* elem, /* The element to be removed from the pH */ int h /* Hash value for the element */ ){ struct _ht *pEntry; if( elem->prev ){ elem->prev->next = elem->next; }else{ pH->first = elem->next; } if( elem->next ){ elem->next->prev = elem->prev; } pEntry = &pH->ht[h]; if( pEntry->chain==elem ){ pEntry->chain = elem->next; } pEntry->count--; if( pEntry->count<=0 ){ pEntry->chain = 0; } if( pH->copyKey && elem->pKey ){ pH->xFree(elem->pKey); } pH->xFree( elem ); pH->count--; if( pH->count<=0 ){ assert( pH->first==0 ); assert( pH->count==0 ); HashClear(pH); } } /* Attempt to locate an element of the hash table pH with a key ** that matches pKey,nKey. Return the data for this element if it is ** found, or NULL if there is no match. */ void *HashFind(const Hash *pH, const void *pKey, int nKey){ int h; /* A hash on key */ HashElem *elem; /* The element that matches key */ int (*xHash)(const void*,int); /* The hash function */ if( pH==0 || pH->ht==0 ) return 0; xHash = hashFunction(pH->keyClass); assert( xHash!=0 ); h = (*xHash)(pKey,nKey); assert( (pH->htsize & (pH->htsize-1))==0 ); elem = findElementGivenHash(pH,pKey,nKey, h & (pH->htsize-1)); return elem ? elem->data : 0; } /* Insert an element into the hash table pH. The key is pKey,nKey ** and the data is "data". ** ** If no element exists with a matching key, then a new ** element is created. A copy of the key is made if the copyKey ** flag is set. NULL is returned. ** ** If another element already exists with the same key, then the ** new data replaces the old data and the old data is returned. ** The key is not copied in this instance. If a malloc fails, then ** the new data is returned and the hash table is unchanged. ** ** If the "data" parameter to this function is NULL, then the ** element corresponding to "key" is removed from the hash table. */ void *HashInsert(Hash *pH, const void *pKey, int nKey, void *data){ int hraw; /* Raw hash value of the key */ int h; /* the hash of the key modulo hash table size */ HashElem *elem; /* Used to loop thru the element list */ HashElem *new_elem; /* New element added to the pH */ int (*xHash)(const void*,int); /* The hash function */ assert( pH!=0 ); xHash = hashFunction(pH->keyClass); assert( xHash!=0 ); hraw = (*xHash)(pKey, nKey); assert( (pH->htsize & (pH->htsize-1))==0 ); h = hraw & (pH->htsize-1); elem = findElementGivenHash(pH,pKey,nKey,h); if( elem ){ void *old_data = elem->data; if( data==0 ){ removeElementGivenHash(pH,elem,h); }else{ elem->data = data; } return old_data; } if( data==0 ) return 0; new_elem = (HashElem*)pH->xMalloc( sizeof(HashElem) ); if( new_elem==0 ) return data; if( pH->copyKey && pKey!=0 ){ new_elem->pKey = pH->xMalloc( nKey ); if( new_elem->pKey==0 ){ pH->xFree(new_elem); return data; } memcpy((void*)new_elem->pKey, pKey, nKey); }else{ new_elem->pKey = (void*)pKey; } new_elem->nKey = nKey; pH->count++; if( pH->htsize==0 ){ rehash(pH,8); if( pH->htsize==0 ){ pH->count = 0; pH->xFree(new_elem); return data; } } if( pH->count > pH->htsize ){ rehash(pH,pH->htsize*2); } assert( pH->htsize>0 ); assert( (pH->htsize & (pH->htsize-1))==0 ); h = hraw & (pH->htsize-1); insertElement(pH, &pH->ht[h], new_elem); new_elem->data = data; return 0; } ================================================ FILE: v2/testdata/_sqlite/ext/fts1/ft_hash.h ================================================ /* ** 2001 September 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the header file for the generic hash-table implementation ** used in SQLite. We've modified it slightly to serve as a standalone ** hash table implementation for the full-text indexing module. ** */ #ifndef _HASH_H_ #define _HASH_H_ /* Forward declarations of structures. */ typedef struct Hash Hash; typedef struct HashElem HashElem; /* A complete hash table is an instance of the following structure. ** The internals of this structure are intended to be opaque -- client ** code should not attempt to access or modify the fields of this structure ** directly. Change this structure only by using the routines below. ** However, many of the "procedures" and "functions" for modifying and ** accessing this structure are really macros, so we can't really make ** this structure opaque. */ struct Hash { char keyClass; /* HASH_INT, _POINTER, _STRING, _BINARY */ char copyKey; /* True if copy of key made on insert */ int count; /* Number of entries in this table */ HashElem *first; /* The first element of the array */ void *(*xMalloc)(int); /* malloc() function to use */ void (*xFree)(void *); /* free() function to use */ int htsize; /* Number of buckets in the hash table */ struct _ht { /* the hash table */ int count; /* Number of entries with this hash */ HashElem *chain; /* Pointer to first entry with this hash */ } *ht; }; /* Each element in the hash table is an instance of the following ** structure. All elements are stored on a single doubly-linked list. ** ** Again, this structure is intended to be opaque, but it can't really ** be opaque because it is used by macros. */ struct HashElem { HashElem *next, *prev; /* Next and previous elements in the table */ void *data; /* Data associated with this element */ void *pKey; int nKey; /* Key associated with this element */ }; /* ** There are 4 different modes of operation for a hash table: ** ** HASH_INT nKey is used as the key and pKey is ignored. ** ** HASH_POINTER pKey is used as the key and nKey is ignored. ** ** HASH_STRING pKey points to a string that is nKey bytes long ** (including the null-terminator, if any). Case ** is respected in comparisons. ** ** HASH_BINARY pKey points to binary data nKey bytes long. ** memcmp() is used to compare keys. ** ** A copy of the key is made for HASH_STRING and HASH_BINARY ** if the copyKey parameter to HashInit is 1. */ /* #define HASH_INT 1 // NOT USED */ /* #define HASH_POINTER 2 // NOT USED */ #define HASH_STRING 3 #define HASH_BINARY 4 /* ** Access routines. To delete, insert a NULL pointer. */ void HashInit(Hash*, int keytype, int copyKey); void *HashInsert(Hash*, const void *pKey, int nKey, void *pData); void *HashFind(const Hash*, const void *pKey, int nKey); void HashClear(Hash*); /* ** Macros for looping over all elements of a hash table. The idiom is ** like this: ** ** Hash h; ** HashElem *p; ** ... ** for(p=HashFirst(&h); p; p=HashNext(p)){ ** SomeStructure *pData = HashData(p); ** // do something with pData ** } */ #define HashFirst(H) ((H)->first) #define HashNext(E) ((E)->next) #define HashData(E) ((E)->data) #define HashKey(E) ((E)->pKey) #define HashKeysize(E) ((E)->nKey) /* ** Number of entries in a hash table */ #define HashCount(H) ((H)->count) #endif /* _HASH_H_ */ ================================================ FILE: v2/testdata/_sqlite/ext/fts1/fts1.c ================================================ /* fts1 has a design flaw which can lead to database corruption (see ** below). It is recommended not to use it any longer, instead use ** fts3 (or higher). If you believe that your use of fts1 is safe, ** add -DSQLITE_ENABLE_BROKEN_FTS1=1 to your CFLAGS. */ #if (!defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS1)) \ && !defined(SQLITE_ENABLE_BROKEN_FTS1) #error fts1 has a design flaw and has been deprecated. #endif /* The flaw is that fts1 uses the content table's unaliased rowid as ** the unique docid. fts1 embeds the rowid in the index it builds, ** and expects the rowid to not change. The SQLite VACUUM operation ** will renumber such rowids, thereby breaking fts1. If you are using ** fts1 in a system which has disabled VACUUM, then you can continue ** to use it safely. Note that PRAGMA auto_vacuum does NOT disable ** VACUUM, though systems using auto_vacuum are unlikely to invoke ** VACUUM. ** ** fts1 should be safe even across VACUUM if you only insert documents ** and never delete. */ /* The author disclaims copyright to this source code. * * This is an SQLite module implementing full-text search. */ /* ** The code in this file is only compiled if: ** ** * The FTS1 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS1 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS1 is defined). */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS1) #if defined(SQLITE_ENABLE_FTS1) && !defined(SQLITE_CORE) # define SQLITE_CORE 1 #endif #include #include #include #include #include #include "fts1.h" #include "fts1_hash.h" #include "fts1_tokenizer.h" #include "sqlite3.h" #include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 #if 0 # define TRACE(A) printf A; fflush(stdout) #else # define TRACE(A) #endif /* utility functions */ typedef struct StringBuffer { int len; /* length, not including null terminator */ int alloced; /* Space allocated for s[] */ char *s; /* Content of the string */ } StringBuffer; static void initStringBuffer(StringBuffer *sb){ sb->len = 0; sb->alloced = 100; sb->s = malloc(100); sb->s[0] = '\0'; } static void nappend(StringBuffer *sb, const char *zFrom, int nFrom){ if( sb->len + nFrom >= sb->alloced ){ sb->alloced = sb->len + nFrom + 100; sb->s = realloc(sb->s, sb->alloced+1); if( sb->s==0 ){ initStringBuffer(sb); return; } } memcpy(sb->s + sb->len, zFrom, nFrom); sb->len += nFrom; sb->s[sb->len] = 0; } static void append(StringBuffer *sb, const char *zFrom){ nappend(sb, zFrom, strlen(zFrom)); } /* We encode variable-length integers in little-endian order using seven bits * per byte as follows: ** ** KEY: ** A = 0xxxxxxx 7 bits of data and one flag bit ** B = 1xxxxxxx 7 bits of data and one flag bit ** ** 7 bits - A ** 14 bits - BA ** 21 bits - BBA ** and so on. */ /* We may need up to VARINT_MAX bytes to store an encoded 64-bit integer. */ #define VARINT_MAX 10 /* Write a 64-bit variable-length integer to memory starting at p[0]. * The length of data written will be between 1 and VARINT_MAX bytes. * The number of bytes written is returned. */ static int putVarint(char *p, sqlite_int64 v){ unsigned char *q = (unsigned char *) p; sqlite_uint64 vu = v; do{ *q++ = (unsigned char) ((vu & 0x7f) | 0x80); vu >>= 7; }while( vu!=0 ); q[-1] &= 0x7f; /* turn off high bit in final byte */ assert( q - (unsigned char *)p <= VARINT_MAX ); return (int) (q - (unsigned char *)p); } /* Read a 64-bit variable-length integer from memory starting at p[0]. * Return the number of bytes read, or 0 on error. * The value is stored in *v. */ static int getVarint(const char *p, sqlite_int64 *v){ const unsigned char *q = (const unsigned char *) p; sqlite_uint64 x = 0, y = 1; while( (*q & 0x80) == 0x80 ){ x += y * (*q++ & 0x7f); y <<= 7; if( q - (unsigned char *)p >= VARINT_MAX ){ /* bad data */ assert( 0 ); return 0; } } x += y * (*q++); *v = (sqlite_int64) x; return (int) (q - (unsigned char *)p); } static int getVarint32(const char *p, int *pi){ sqlite_int64 i; int ret = getVarint(p, &i); *pi = (int) i; assert( *pi==i ); return ret; } /*** Document lists *** * * A document list holds a sorted list of varint-encoded document IDs. * * A doclist with type DL_POSITIONS_OFFSETS is stored like this: * * array { * varint docid; * array { * varint position; (delta from previous position plus POS_BASE) * varint startOffset; (delta from previous startOffset) * varint endOffset; (delta from startOffset) * } * } * * Here, array { X } means zero or more occurrences of X, adjacent in memory. * * A position list may hold positions for text in multiple columns. A position * POS_COLUMN is followed by a varint containing the index of the column for * following positions in the list. Any positions appearing before any * occurrences of POS_COLUMN are for column 0. * * A doclist with type DL_POSITIONS is like the above, but holds only docids * and positions without offset information. * * A doclist with type DL_DOCIDS is like the above, but holds only docids * without positions or offset information. * * On disk, every document list has positions and offsets, so we don't bother * to serialize a doclist's type. * * We don't yet delta-encode document IDs; doing so will probably be a * modest win. * * NOTE(shess) I've thought of a slightly (1%) better offset encoding. * After the first offset, estimate the next offset by using the * current token position and the previous token position and offset, * offset to handle some variance. So the estimate would be * (iPosition*w->iStartOffset/w->iPosition-64), which is delta-encoded * as normal. Offsets more than 64 chars from the estimate are * encoded as the delta to the previous start offset + 128. An * additional tiny increment can be gained by using the end offset of * the previous token to make the estimate a tiny bit more precise. */ /* It is not safe to call isspace(), tolower(), or isalnum() on ** hi-bit-set characters. This is the same solution used in the ** tokenizer. */ /* TODO(shess) The snippet-generation code should be using the ** tokenizer-generated tokens rather than doing its own local ** tokenization. */ /* TODO(shess) Is __isascii() a portable version of (c&0x80)==0? */ static int safe_isspace(char c){ return (c&0x80)==0 ? isspace((unsigned char)c) : 0; } static int safe_tolower(char c){ return (c&0x80)==0 ? tolower((unsigned char)c) : c; } static int safe_isalnum(char c){ return (c&0x80)==0 ? isalnum((unsigned char)c) : 0; } typedef enum DocListType { DL_DOCIDS, /* docids only */ DL_POSITIONS, /* docids + positions */ DL_POSITIONS_OFFSETS /* docids + positions + offsets */ } DocListType; /* ** By default, only positions and not offsets are stored in the doclists. ** To change this so that offsets are stored too, compile with ** ** -DDL_DEFAULT=DL_POSITIONS_OFFSETS ** */ #ifndef DL_DEFAULT # define DL_DEFAULT DL_POSITIONS #endif typedef struct DocList { char *pData; int nData; DocListType iType; int iLastColumn; /* the last column written */ int iLastPos; /* the last position written */ int iLastOffset; /* the last start offset written */ } DocList; enum { POS_END = 0, /* end of this position list */ POS_COLUMN, /* followed by new column number */ POS_BASE }; /* Initialize a new DocList to hold the given data. */ static void docListInit(DocList *d, DocListType iType, const char *pData, int nData){ d->nData = nData; if( nData>0 ){ d->pData = malloc(nData); memcpy(d->pData, pData, nData); } else { d->pData = NULL; } d->iType = iType; d->iLastColumn = 0; d->iLastPos = d->iLastOffset = 0; } /* Create a new dynamically-allocated DocList. */ static DocList *docListNew(DocListType iType){ DocList *d = (DocList *) malloc(sizeof(DocList)); docListInit(d, iType, 0, 0); return d; } static void docListDestroy(DocList *d){ free(d->pData); #ifndef NDEBUG memset(d, 0x55, sizeof(*d)); #endif } static void docListDelete(DocList *d){ docListDestroy(d); free(d); } static char *docListEnd(DocList *d){ return d->pData + d->nData; } /* Append a varint to a DocList's data. */ static void appendVarint(DocList *d, sqlite_int64 i){ char c[VARINT_MAX]; int n = putVarint(c, i); d->pData = realloc(d->pData, d->nData + n); memcpy(d->pData + d->nData, c, n); d->nData += n; } static void docListAddDocid(DocList *d, sqlite_int64 iDocid){ appendVarint(d, iDocid); if( d->iType>=DL_POSITIONS ){ appendVarint(d, POS_END); /* initially empty position list */ d->iLastColumn = 0; d->iLastPos = d->iLastOffset = 0; } } /* helper function for docListAddPos and docListAddPosOffset */ static void addPos(DocList *d, int iColumn, int iPos){ assert( d->nData>0 ); --d->nData; /* remove previous terminator */ if( iColumn!=d->iLastColumn ){ assert( iColumn>d->iLastColumn ); appendVarint(d, POS_COLUMN); appendVarint(d, iColumn); d->iLastColumn = iColumn; d->iLastPos = d->iLastOffset = 0; } assert( iPos>=d->iLastPos ); appendVarint(d, iPos-d->iLastPos+POS_BASE); d->iLastPos = iPos; } /* Add a position to the last position list in a doclist. */ static void docListAddPos(DocList *d, int iColumn, int iPos){ assert( d->iType==DL_POSITIONS ); addPos(d, iColumn, iPos); appendVarint(d, POS_END); /* add new terminator */ } /* ** Add a position and starting and ending offsets to a doclist. ** ** If the doclist is setup to handle only positions, then insert ** the position only and ignore the offsets. */ static void docListAddPosOffset( DocList *d, /* Doclist under construction */ int iColumn, /* Column the inserted term is part of */ int iPos, /* Position of the inserted term */ int iStartOffset, /* Starting offset of inserted term */ int iEndOffset /* Ending offset of inserted term */ ){ assert( d->iType>=DL_POSITIONS ); addPos(d, iColumn, iPos); if( d->iType==DL_POSITIONS_OFFSETS ){ assert( iStartOffset>=d->iLastOffset ); appendVarint(d, iStartOffset-d->iLastOffset); d->iLastOffset = iStartOffset; assert( iEndOffset>=iStartOffset ); appendVarint(d, iEndOffset-iStartOffset); } appendVarint(d, POS_END); /* add new terminator */ } /* ** A DocListReader object is a cursor into a doclist. Initialize ** the cursor to the beginning of the doclist by calling readerInit(). ** Then use routines ** ** peekDocid() ** readDocid() ** readPosition() ** skipPositionList() ** and so forth... ** ** to read information out of the doclist. When we reach the end ** of the doclist, atEnd() returns TRUE. */ typedef struct DocListReader { DocList *pDoclist; /* The document list we are stepping through */ char *p; /* Pointer to next unread byte in the doclist */ int iLastColumn; int iLastPos; /* the last position read, or -1 when not in a position list */ } DocListReader; /* ** Initialize the DocListReader r to point to the beginning of pDoclist. */ static void readerInit(DocListReader *r, DocList *pDoclist){ r->pDoclist = pDoclist; if( pDoclist!=NULL ){ r->p = pDoclist->pData; } r->iLastColumn = -1; r->iLastPos = -1; } /* ** Return TRUE if we have reached then end of pReader and there is ** nothing else left to read. */ static int atEnd(DocListReader *pReader){ return pReader->pDoclist==0 || (pReader->p >= docListEnd(pReader->pDoclist)); } /* Peek at the next docid without advancing the read pointer. */ static sqlite_int64 peekDocid(DocListReader *pReader){ sqlite_int64 ret; assert( !atEnd(pReader) ); assert( pReader->iLastPos==-1 ); getVarint(pReader->p, &ret); return ret; } /* Read the next docid. See also nextDocid(). */ static sqlite_int64 readDocid(DocListReader *pReader){ sqlite_int64 ret; assert( !atEnd(pReader) ); assert( pReader->iLastPos==-1 ); pReader->p += getVarint(pReader->p, &ret); if( pReader->pDoclist->iType>=DL_POSITIONS ){ pReader->iLastColumn = 0; pReader->iLastPos = 0; } return ret; } /* Read the next position and column index from a position list. * Returns the position, or -1 at the end of the list. */ static int readPosition(DocListReader *pReader, int *iColumn){ int i; int iType = pReader->pDoclist->iType; if( pReader->iLastPos==-1 ){ return -1; } assert( !atEnd(pReader) ); if( iTypep += getVarint32(pReader->p, &i); if( i==POS_END ){ pReader->iLastColumn = pReader->iLastPos = -1; *iColumn = -1; return -1; } if( i==POS_COLUMN ){ pReader->p += getVarint32(pReader->p, &pReader->iLastColumn); pReader->iLastPos = 0; pReader->p += getVarint32(pReader->p, &i); assert( i>=POS_BASE ); } pReader->iLastPos += ((int) i)-POS_BASE; if( iType>=DL_POSITIONS_OFFSETS ){ /* Skip over offsets, ignoring them for now. */ int iStart, iEnd; pReader->p += getVarint32(pReader->p, &iStart); pReader->p += getVarint32(pReader->p, &iEnd); } *iColumn = pReader->iLastColumn; return pReader->iLastPos; } /* Skip past the end of a position list. */ static void skipPositionList(DocListReader *pReader){ DocList *p = pReader->pDoclist; if( p && p->iType>=DL_POSITIONS ){ int iColumn; while( readPosition(pReader, &iColumn)!=-1 ){} } } /* Skip over a docid, including its position list if the doclist has * positions. */ static void skipDocument(DocListReader *pReader){ readDocid(pReader); skipPositionList(pReader); } /* Skip past all docids which are less than [iDocid]. Returns 1 if a docid * matching [iDocid] was found. */ static int skipToDocid(DocListReader *pReader, sqlite_int64 iDocid){ sqlite_int64 d = 0; while( !atEnd(pReader) && (d=peekDocid(pReader))iType>=DL_POSITIONS ){ int iPos, iCol; const char *zDiv = ""; printf("("); while( (iPos = readPosition(&r, &iCol))>=0 ){ printf("%s%d:%d", zDiv, iCol, iPos); zDiv = ":"; } printf(")"); } } printf("\n"); fflush(stdout); } #endif /* SQLITE_DEBUG */ /* Trim the given doclist to contain only positions in column * [iRestrictColumn]. */ static void docListRestrictColumn(DocList *in, int iRestrictColumn){ DocListReader r; DocList out; assert( in->iType>=DL_POSITIONS ); readerInit(&r, in); docListInit(&out, DL_POSITIONS, NULL, 0); while( !atEnd(&r) ){ sqlite_int64 iDocid = readDocid(&r); int iPos, iColumn; docListAddDocid(&out, iDocid); while( (iPos = readPosition(&r, &iColumn)) != -1 ){ if( iColumn==iRestrictColumn ){ docListAddPos(&out, iColumn, iPos); } } } docListDestroy(in); *in = out; } /* Trim the given doclist by discarding any docids without any remaining * positions. */ static void docListDiscardEmpty(DocList *in) { DocListReader r; DocList out; /* TODO: It would be nice to implement this operation in place; that * could save a significant amount of memory in queries with long doclists. */ assert( in->iType>=DL_POSITIONS ); readerInit(&r, in); docListInit(&out, DL_POSITIONS, NULL, 0); while( !atEnd(&r) ){ sqlite_int64 iDocid = readDocid(&r); int match = 0; int iPos, iColumn; while( (iPos = readPosition(&r, &iColumn)) != -1 ){ if( !match ){ docListAddDocid(&out, iDocid); match = 1; } docListAddPos(&out, iColumn, iPos); } } docListDestroy(in); *in = out; } /* Helper function for docListUpdate() and docListAccumulate(). ** Splices a doclist element into the doclist represented by r, ** leaving r pointing after the newly spliced element. */ static void docListSpliceElement(DocListReader *r, sqlite_int64 iDocid, const char *pSource, int nSource){ DocList *d = r->pDoclist; char *pTarget; int nTarget, found; found = skipToDocid(r, iDocid); /* Describe slice in d to place pSource/nSource. */ pTarget = r->p; if( found ){ skipDocument(r); nTarget = r->p-pTarget; }else{ nTarget = 0; } /* The sense of the following is that there are three possibilities. ** If nTarget==nSource, we should not move any memory nor realloc. ** If nTarget>nSource, trim target and realloc. ** If nTargetnSource ){ memmove(pTarget+nSource, pTarget+nTarget, docListEnd(d)-(pTarget+nTarget)); } if( nTarget!=nSource ){ int iDoclist = pTarget-d->pData; d->pData = realloc(d->pData, d->nData+nSource-nTarget); pTarget = d->pData+iDoclist; } if( nTargetnData += nSource-nTarget; r->p = pTarget+nSource; } /* Insert/update pUpdate into the doclist. */ static void docListUpdate(DocList *d, DocList *pUpdate){ DocListReader reader; assert( d!=NULL && pUpdate!=NULL ); assert( d->iType==pUpdate->iType); readerInit(&reader, d); docListSpliceElement(&reader, firstDocid(pUpdate), pUpdate->pData, pUpdate->nData); } /* Propagate elements from pUpdate to pAcc, overwriting elements with ** matching docids. */ static void docListAccumulate(DocList *pAcc, DocList *pUpdate){ DocListReader accReader, updateReader; /* Handle edge cases where one doclist is empty. */ assert( pAcc!=NULL ); if( pUpdate==NULL || pUpdate->nData==0 ) return; if( pAcc->nData==0 ){ pAcc->pData = malloc(pUpdate->nData); memcpy(pAcc->pData, pUpdate->pData, pUpdate->nData); pAcc->nData = pUpdate->nData; return; } readerInit(&accReader, pAcc); readerInit(&updateReader, pUpdate); while( !atEnd(&updateReader) ){ char *pSource = updateReader.p; sqlite_int64 iDocid = readDocid(&updateReader); skipPositionList(&updateReader); docListSpliceElement(&accReader, iDocid, pSource, updateReader.p-pSource); } } /* ** Read the next docid off of pIn. Return 0 if we reach the end. * * TODO: This assumes that docids are never 0, but they may actually be 0 since * users can choose docids when inserting into a full-text table. Fix this. */ static sqlite_int64 nextDocid(DocListReader *pIn){ skipPositionList(pIn); return atEnd(pIn) ? 0 : readDocid(pIn); } /* ** pLeft and pRight are two DocListReaders that are pointing to ** positions lists of the same document: iDocid. ** ** If there are no instances in pLeft or pRight where the position ** of pLeft is one less than the position of pRight, then this ** routine adds nothing to pOut. ** ** If there are one or more instances where positions from pLeft ** are exactly one less than positions from pRight, then add a new ** document record to pOut. If pOut wants to hold positions, then ** include the positions from pRight that are one more than a ** position in pLeft. In other words: pRight.iPos==pLeft.iPos+1. ** ** pLeft and pRight are left pointing at the next document record. */ static void mergePosList( DocListReader *pLeft, /* Left position list */ DocListReader *pRight, /* Right position list */ sqlite_int64 iDocid, /* The docid from pLeft and pRight */ DocList *pOut /* Write the merged document record here */ ){ int iLeftCol, iLeftPos = readPosition(pLeft, &iLeftCol); int iRightCol, iRightPos = readPosition(pRight, &iRightCol); int match = 0; /* Loop until we've reached the end of both position lists. */ while( iLeftPos!=-1 && iRightPos!=-1 ){ if( iLeftCol==iRightCol && iLeftPos+1==iRightPos ){ if( !match ){ docListAddDocid(pOut, iDocid); match = 1; } if( pOut->iType>=DL_POSITIONS ){ docListAddPos(pOut, iRightCol, iRightPos); } iLeftPos = readPosition(pLeft, &iLeftCol); iRightPos = readPosition(pRight, &iRightCol); }else if( iRightCol=0 ) skipPositionList(pLeft); if( iRightPos>=0 ) skipPositionList(pRight); } /* We have two doclists: pLeft and pRight. ** Write the phrase intersection of these two doclists into pOut. ** ** A phrase intersection means that two documents only match ** if pLeft.iPos+1==pRight.iPos. ** ** The output pOut may or may not contain positions. If pOut ** does contain positions, they are the positions of pRight. */ static void docListPhraseMerge( DocList *pLeft, /* Doclist resulting from the words on the left */ DocList *pRight, /* Doclist for the next word to the right */ DocList *pOut /* Write the combined doclist here */ ){ DocListReader left, right; sqlite_int64 docidLeft, docidRight; readerInit(&left, pLeft); readerInit(&right, pRight); docidLeft = nextDocid(&left); docidRight = nextDocid(&right); while( docidLeft>0 && docidRight>0 ){ if( docidLeftiType0 && docidRight>0 ){ if( docidLeft0 && docidRight>0 ){ if( docidLeft<=docidRight ){ docListAddDocid(pOut, docidLeft); }else{ docListAddDocid(pOut, docidRight); } priorLeft = docidLeft; if( docidLeft<=docidRight ){ docidLeft = nextDocid(&left); } if( docidRight>0 && docidRight<=priorLeft ){ docidRight = nextDocid(&right); } } while( docidLeft>0 ){ docListAddDocid(pOut, docidLeft); docidLeft = nextDocid(&left); } while( docidRight>0 ){ docListAddDocid(pOut, docidRight); docidRight = nextDocid(&right); } } /* We have two doclists: pLeft and pRight. ** Write into pOut all documents that occur in pLeft but not ** in pRight. ** ** Only docids are matched. Position information is ignored. ** ** The output pOut never holds positions. */ static void docListExceptMerge( DocList *pLeft, /* Doclist resulting from the words on the left */ DocList *pRight, /* Doclist for the next word to the right */ DocList *pOut /* Write the combined doclist here */ ){ DocListReader left, right; sqlite_int64 docidLeft, docidRight, priorLeft; readerInit(&left, pLeft); readerInit(&right, pRight); docidLeft = nextDocid(&left); docidRight = nextDocid(&right); while( docidLeft>0 && docidRight>0 ){ priorLeft = docidLeft; if( docidLeft0 && docidRight<=priorLeft ){ docidRight = nextDocid(&right); } } while( docidLeft>0 ){ docListAddDocid(pOut, docidLeft); docidLeft = nextDocid(&left); } } static char *string_dup_n(const char *s, int n){ char *str = malloc(n + 1); memcpy(str, s, n); str[n] = '\0'; return str; } /* Duplicate a string; the caller must free() the returned string. * (We don't use strdup() since it is not part of the standard C library and * may not be available everywhere.) */ static char *string_dup(const char *s){ return string_dup_n(s, strlen(s)); } /* Format a string, replacing each occurrence of the % character with * zDb.zName. This may be more convenient than sqlite_mprintf() * when one string is used repeatedly in a format string. * The caller must free() the returned string. */ static char *string_format(const char *zFormat, const char *zDb, const char *zName){ const char *p; size_t len = 0; size_t nDb = strlen(zDb); size_t nName = strlen(zName); size_t nFullTableName = nDb+1+nName; char *result; char *r; /* first compute length needed */ for(p = zFormat ; *p ; ++p){ len += (*p=='%' ? nFullTableName : 1); } len += 1; /* for null terminator */ r = result = malloc(len); for(p = zFormat; *p; ++p){ if( *p=='%' ){ memcpy(r, zDb, nDb); r += nDb; *r++ = '.'; memcpy(r, zName, nName); r += nName; } else { *r++ = *p; } } *r++ = '\0'; assert( r == result + len ); return result; } static int sql_exec(sqlite3 *db, const char *zDb, const char *zName, const char *zFormat){ char *zCommand = string_format(zFormat, zDb, zName); int rc; TRACE(("FTS1 sql: %s\n", zCommand)); rc = sqlite3_exec(db, zCommand, NULL, 0, NULL); free(zCommand); return rc; } static int sql_prepare(sqlite3 *db, const char *zDb, const char *zName, sqlite3_stmt **ppStmt, const char *zFormat){ char *zCommand = string_format(zFormat, zDb, zName); int rc; TRACE(("FTS1 prepare: %s\n", zCommand)); rc = sqlite3_prepare(db, zCommand, -1, ppStmt, NULL); free(zCommand); return rc; } /* end utility functions */ /* Forward reference */ typedef struct fulltext_vtab fulltext_vtab; /* A single term in a query is represented by an instances of ** the following structure. */ typedef struct QueryTerm { short int nPhrase; /* How many following terms are part of the same phrase */ short int iPhrase; /* This is the i-th term of a phrase. */ short int iColumn; /* Column of the index that must match this term */ signed char isOr; /* this term is preceded by "OR" */ signed char isNot; /* this term is preceded by "-" */ char *pTerm; /* text of the term. '\000' terminated. malloced */ int nTerm; /* Number of bytes in pTerm[] */ } QueryTerm; /* A query string is parsed into a Query structure. * * We could, in theory, allow query strings to be complicated * nested expressions with precedence determined by parentheses. * But none of the major search engines do this. (Perhaps the * feeling is that an parenthesized expression is two complex of * an idea for the average user to grasp.) Taking our lead from * the major search engines, we will allow queries to be a list * of terms (with an implied AND operator) or phrases in double-quotes, * with a single optional "-" before each non-phrase term to designate * negation and an optional OR connector. * * OR binds more tightly than the implied AND, which is what the * major search engines seem to do. So, for example: * * [one two OR three] ==> one AND (two OR three) * [one OR two three] ==> (one OR two) AND three * * A "-" before a term matches all entries that lack that term. * The "-" must occur immediately before the term with in intervening * space. This is how the search engines do it. * * A NOT term cannot be the right-hand operand of an OR. If this * occurs in the query string, the NOT is ignored: * * [one OR -two] ==> one OR two * */ typedef struct Query { fulltext_vtab *pFts; /* The full text index */ int nTerms; /* Number of terms in the query */ QueryTerm *pTerms; /* Array of terms. Space obtained from malloc() */ int nextIsOr; /* Set the isOr flag on the next inserted term */ int nextColumn; /* Next word parsed must be in this column */ int dfltColumn; /* The default column */ } Query; /* ** An instance of the following structure keeps track of generated ** matching-word offset information and snippets. */ typedef struct Snippet { int nMatch; /* Total number of matches */ int nAlloc; /* Space allocated for aMatch[] */ struct snippetMatch { /* One entry for each matching term */ char snStatus; /* Status flag for use while constructing snippets */ short int iCol; /* The column that contains the match */ short int iTerm; /* The index in Query.pTerms[] of the matching term */ short int nByte; /* Number of bytes in the term */ int iStart; /* The offset to the first character of the term */ } *aMatch; /* Points to space obtained from malloc */ char *zOffset; /* Text rendering of aMatch[] */ int nOffset; /* strlen(zOffset) */ char *zSnippet; /* Snippet text */ int nSnippet; /* strlen(zSnippet) */ } Snippet; typedef enum QueryType { QUERY_GENERIC, /* table scan */ QUERY_ROWID, /* lookup by rowid */ QUERY_FULLTEXT /* QUERY_FULLTEXT + [i] is a full-text search for column i*/ } QueryType; /* TODO(shess) CHUNK_MAX controls how much data we allow in segment 0 ** before we start aggregating into larger segments. Lower CHUNK_MAX ** means that for a given input we have more individual segments per ** term, which means more rows in the table and a bigger index (due to ** both more rows and bigger rowids). But it also reduces the average ** cost of adding new elements to the segment 0 doclist, and it seems ** to reduce the number of pages read and written during inserts. 256 ** was chosen by measuring insertion times for a certain input (first ** 10k documents of Enron corpus), though including query performance ** in the decision may argue for a larger value. */ #define CHUNK_MAX 256 typedef enum fulltext_statement { CONTENT_INSERT_STMT, CONTENT_SELECT_STMT, CONTENT_UPDATE_STMT, CONTENT_DELETE_STMT, TERM_SELECT_STMT, TERM_SELECT_ALL_STMT, TERM_INSERT_STMT, TERM_UPDATE_STMT, TERM_DELETE_STMT, MAX_STMT /* Always at end! */ } fulltext_statement; /* These must exactly match the enum above. */ /* TODO(adam): Is there some risk that a statement (in particular, ** pTermSelectStmt) will be used in two cursors at once, e.g. if a ** query joins a virtual table to itself? If so perhaps we should ** move some of these to the cursor object. */ static const char *const fulltext_zStatement[MAX_STMT] = { /* CONTENT_INSERT */ NULL, /* generated in contentInsertStatement() */ /* CONTENT_SELECT */ "select * from %_content where rowid = ?", /* CONTENT_UPDATE */ NULL, /* generated in contentUpdateStatement() */ /* CONTENT_DELETE */ "delete from %_content where rowid = ?", /* TERM_SELECT */ "select rowid, doclist from %_term where term = ? and segment = ?", /* TERM_SELECT_ALL */ "select doclist from %_term where term = ? order by segment", /* TERM_INSERT */ "insert into %_term (rowid, term, segment, doclist) values (?, ?, ?, ?)", /* TERM_UPDATE */ "update %_term set doclist = ? where rowid = ?", /* TERM_DELETE */ "delete from %_term where rowid = ?", }; /* ** A connection to a fulltext index is an instance of the following ** structure. The xCreate and xConnect methods create an instance ** of this structure and xDestroy and xDisconnect free that instance. ** All other methods receive a pointer to the structure as one of their ** arguments. */ struct fulltext_vtab { sqlite3_vtab base; /* Base class used by SQLite core */ sqlite3 *db; /* The database connection */ const char *zDb; /* logical database name */ const char *zName; /* virtual table name */ int nColumn; /* number of columns in virtual table */ char **azColumn; /* column names. malloced */ char **azContentColumn; /* column names in content table; malloced */ sqlite3_tokenizer *pTokenizer; /* tokenizer for inserts and queries */ /* Precompiled statements which we keep as long as the table is ** open. */ sqlite3_stmt *pFulltextStatements[MAX_STMT]; }; /* ** When the core wants to do a query, it create a cursor using a ** call to xOpen. This structure is an instance of a cursor. It ** is destroyed by xClose. */ typedef struct fulltext_cursor { sqlite3_vtab_cursor base; /* Base class used by SQLite core */ QueryType iCursorType; /* Copy of sqlite3_index_info.idxNum */ sqlite3_stmt *pStmt; /* Prepared statement in use by the cursor */ int eof; /* True if at End Of Results */ Query q; /* Parsed query string */ Snippet snippet; /* Cached snippet for the current row */ int iColumn; /* Column being searched */ DocListReader result; /* used when iCursorType == QUERY_FULLTEXT */ } fulltext_cursor; static struct fulltext_vtab *cursor_vtab(fulltext_cursor *c){ return (fulltext_vtab *) c->base.pVtab; } static const sqlite3_module fulltextModule; /* forward declaration */ /* Append a list of strings separated by commas to a StringBuffer. */ static void appendList(StringBuffer *sb, int nString, char **azString){ int i; for(i=0; i0 ) append(sb, ", "); append(sb, azString[i]); } } /* Return a dynamically generated statement of the form * insert into %_content (rowid, ...) values (?, ...) */ static const char *contentInsertStatement(fulltext_vtab *v){ StringBuffer sb; int i; initStringBuffer(&sb); append(&sb, "insert into %_content (rowid, "); appendList(&sb, v->nColumn, v->azContentColumn); append(&sb, ") values (?"); for(i=0; inColumn; ++i) append(&sb, ", ?"); append(&sb, ")"); return sb.s; } /* Return a dynamically generated statement of the form * update %_content set [col_0] = ?, [col_1] = ?, ... * where rowid = ? */ static const char *contentUpdateStatement(fulltext_vtab *v){ StringBuffer sb; int i; initStringBuffer(&sb); append(&sb, "update %_content set "); for(i=0; inColumn; ++i) { if( i>0 ){ append(&sb, ", "); } append(&sb, v->azContentColumn[i]); append(&sb, " = ?"); } append(&sb, " where rowid = ?"); return sb.s; } /* Puts a freshly-prepared statement determined by iStmt in *ppStmt. ** If the indicated statement has never been prepared, it is prepared ** and cached, otherwise the cached version is reset. */ static int sql_get_statement(fulltext_vtab *v, fulltext_statement iStmt, sqlite3_stmt **ppStmt){ assert( iStmtpFulltextStatements[iStmt]==NULL ){ const char *zStmt; int rc; switch( iStmt ){ case CONTENT_INSERT_STMT: zStmt = contentInsertStatement(v); break; case CONTENT_UPDATE_STMT: zStmt = contentUpdateStatement(v); break; default: zStmt = fulltext_zStatement[iStmt]; } rc = sql_prepare(v->db, v->zDb, v->zName, &v->pFulltextStatements[iStmt], zStmt); if( zStmt != fulltext_zStatement[iStmt]) free((void *) zStmt); if( rc!=SQLITE_OK ) return rc; } else { int rc = sqlite3_reset(v->pFulltextStatements[iStmt]); if( rc!=SQLITE_OK ) return rc; } *ppStmt = v->pFulltextStatements[iStmt]; return SQLITE_OK; } /* Step the indicated statement, handling errors SQLITE_BUSY (by ** retrying) and SQLITE_SCHEMA (by re-preparing and transferring ** bindings to the new statement). ** TODO(adam): We should extend this function so that it can work with ** statements declared locally, not only globally cached statements. */ static int sql_step_statement(fulltext_vtab *v, fulltext_statement iStmt, sqlite3_stmt **ppStmt){ int rc; sqlite3_stmt *s = *ppStmt; assert( iStmtpFulltextStatements[iStmt] ); while( (rc=sqlite3_step(s))!=SQLITE_DONE && rc!=SQLITE_ROW ){ if( rc==SQLITE_BUSY ) continue; if( rc!=SQLITE_ERROR ) return rc; /* If an SQLITE_SCHEMA error has occurred, then finalizing this * statement is going to delete the fulltext_vtab structure. If * the statement just executed is in the pFulltextStatements[] * array, it will be finalized twice. So remove it before * calling sqlite3_finalize(). */ v->pFulltextStatements[iStmt] = NULL; rc = sqlite3_finalize(s); break; } return rc; err: sqlite3_finalize(s); return rc; } /* Like sql_step_statement(), but convert SQLITE_DONE to SQLITE_OK. ** Useful for statements like UPDATE, where we expect no results. */ static int sql_single_step_statement(fulltext_vtab *v, fulltext_statement iStmt, sqlite3_stmt **ppStmt){ int rc = sql_step_statement(v, iStmt, ppStmt); return (rc==SQLITE_DONE) ? SQLITE_OK : rc; } /* insert into %_content (rowid, ...) values ([rowid], [pValues]) */ static int content_insert(fulltext_vtab *v, sqlite3_value *rowid, sqlite3_value **pValues){ sqlite3_stmt *s; int i; int rc = sql_get_statement(v, CONTENT_INSERT_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_value(s, 1, rowid); if( rc!=SQLITE_OK ) return rc; for(i=0; inColumn; ++i){ rc = sqlite3_bind_value(s, 2+i, pValues[i]); if( rc!=SQLITE_OK ) return rc; } return sql_single_step_statement(v, CONTENT_INSERT_STMT, &s); } /* update %_content set col0 = pValues[0], col1 = pValues[1], ... * where rowid = [iRowid] */ static int content_update(fulltext_vtab *v, sqlite3_value **pValues, sqlite_int64 iRowid){ sqlite3_stmt *s; int i; int rc = sql_get_statement(v, CONTENT_UPDATE_STMT, &s); if( rc!=SQLITE_OK ) return rc; for(i=0; inColumn; ++i){ rc = sqlite3_bind_value(s, 1+i, pValues[i]); if( rc!=SQLITE_OK ) return rc; } rc = sqlite3_bind_int64(s, 1+v->nColumn, iRowid); if( rc!=SQLITE_OK ) return rc; return sql_single_step_statement(v, CONTENT_UPDATE_STMT, &s); } static void freeStringArray(int nString, const char **pString){ int i; for (i=0 ; i < nString ; ++i) { if( pString[i]!=NULL ) free((void *) pString[i]); } free((void *) pString); } /* select * from %_content where rowid = [iRow] * The caller must delete the returned array and all strings in it. * null fields will be NULL in the returned array. * * TODO: Perhaps we should return pointer/length strings here for consistency * with other code which uses pointer/length. */ static int content_select(fulltext_vtab *v, sqlite_int64 iRow, const char ***pValues){ sqlite3_stmt *s; const char **values; int i; int rc; *pValues = NULL; rc = sql_get_statement(v, CONTENT_SELECT_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 1, iRow); if( rc!=SQLITE_OK ) return rc; rc = sql_step_statement(v, CONTENT_SELECT_STMT, &s); if( rc!=SQLITE_ROW ) return rc; values = (const char **) malloc(v->nColumn * sizeof(const char *)); for(i=0; inColumn; ++i){ if( sqlite3_column_type(s, i)==SQLITE_NULL ){ values[i] = NULL; }else{ values[i] = string_dup((char*)sqlite3_column_text(s, i)); } } /* We expect only one row. We must execute another sqlite3_step() * to complete the iteration; otherwise the table will remain locked. */ rc = sqlite3_step(s); if( rc==SQLITE_DONE ){ *pValues = values; return SQLITE_OK; } freeStringArray(v->nColumn, values); return rc; } /* delete from %_content where rowid = [iRow ] */ static int content_delete(fulltext_vtab *v, sqlite_int64 iRow){ sqlite3_stmt *s; int rc = sql_get_statement(v, CONTENT_DELETE_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 1, iRow); if( rc!=SQLITE_OK ) return rc; return sql_single_step_statement(v, CONTENT_DELETE_STMT, &s); } /* select rowid, doclist from %_term * where term = [pTerm] and segment = [iSegment] * If found, returns SQLITE_ROW; the caller must free the * returned doclist. If no rows found, returns SQLITE_DONE. */ static int term_select(fulltext_vtab *v, const char *pTerm, int nTerm, int iSegment, sqlite_int64 *rowid, DocList *out){ sqlite3_stmt *s; int rc = sql_get_statement(v, TERM_SELECT_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_text(s, 1, pTerm, nTerm, SQLITE_STATIC); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int(s, 2, iSegment); if( rc!=SQLITE_OK ) return rc; rc = sql_step_statement(v, TERM_SELECT_STMT, &s); if( rc!=SQLITE_ROW ) return rc; *rowid = sqlite3_column_int64(s, 0); docListInit(out, DL_DEFAULT, sqlite3_column_blob(s, 1), sqlite3_column_bytes(s, 1)); /* We expect only one row. We must execute another sqlite3_step() * to complete the iteration; otherwise the table will remain locked. */ rc = sqlite3_step(s); return rc==SQLITE_DONE ? SQLITE_ROW : rc; } /* Load the segment doclists for term pTerm and merge them in ** appropriate order into out. Returns SQLITE_OK if successful. If ** there are no segments for pTerm, successfully returns an empty ** doclist in out. ** ** Each document consists of 1 or more "columns". The number of ** columns is v->nColumn. If iColumn==v->nColumn, then return ** position information about all columns. If iColumnnColumn, ** then only return position information about the iColumn-th column ** (where the first column is 0). */ static int term_select_all( fulltext_vtab *v, /* The fulltext index we are querying against */ int iColumn, /* If nColumn ){ /* querying a single column */ docListRestrictColumn(&old, iColumn); } /* doclist contains the newer data, so write it over old. Then ** steal accumulated result for doclist. */ docListAccumulate(&old, &doclist); docListDestroy(&doclist); doclist = old; } if( rc!=SQLITE_DONE ){ docListDestroy(&doclist); return rc; } docListDiscardEmpty(&doclist); *out = doclist; return SQLITE_OK; } /* insert into %_term (rowid, term, segment, doclist) values ([piRowid], [pTerm], [iSegment], [doclist]) ** Lets sqlite select rowid if piRowid is NULL, else uses *piRowid. ** ** NOTE(shess) piRowid is IN, with values of "space of int64" plus ** null, it is not used to pass data back to the caller. */ static int term_insert(fulltext_vtab *v, sqlite_int64 *piRowid, const char *pTerm, int nTerm, int iSegment, DocList *doclist){ sqlite3_stmt *s; int rc = sql_get_statement(v, TERM_INSERT_STMT, &s); if( rc!=SQLITE_OK ) return rc; if( piRowid==NULL ){ rc = sqlite3_bind_null(s, 1); }else{ rc = sqlite3_bind_int64(s, 1, *piRowid); } if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_text(s, 2, pTerm, nTerm, SQLITE_STATIC); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int(s, 3, iSegment); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_blob(s, 4, doclist->pData, doclist->nData, SQLITE_STATIC); if( rc!=SQLITE_OK ) return rc; return sql_single_step_statement(v, TERM_INSERT_STMT, &s); } /* update %_term set doclist = [doclist] where rowid = [rowid] */ static int term_update(fulltext_vtab *v, sqlite_int64 rowid, DocList *doclist){ sqlite3_stmt *s; int rc = sql_get_statement(v, TERM_UPDATE_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_blob(s, 1, doclist->pData, doclist->nData, SQLITE_STATIC); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 2, rowid); if( rc!=SQLITE_OK ) return rc; return sql_single_step_statement(v, TERM_UPDATE_STMT, &s); } static int term_delete(fulltext_vtab *v, sqlite_int64 rowid){ sqlite3_stmt *s; int rc = sql_get_statement(v, TERM_DELETE_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 1, rowid); if( rc!=SQLITE_OK ) return rc; return sql_single_step_statement(v, TERM_DELETE_STMT, &s); } /* ** Free the memory used to contain a fulltext_vtab structure. */ static void fulltext_vtab_destroy(fulltext_vtab *v){ int iStmt, i; TRACE(("FTS1 Destroy %p\n", v)); for( iStmt=0; iStmtpFulltextStatements[iStmt]!=NULL ){ sqlite3_finalize(v->pFulltextStatements[iStmt]); v->pFulltextStatements[iStmt] = NULL; } } if( v->pTokenizer!=NULL ){ v->pTokenizer->pModule->xDestroy(v->pTokenizer); v->pTokenizer = NULL; } free(v->azColumn); for(i = 0; i < v->nColumn; ++i) { sqlite3_free(v->azContentColumn[i]); } free(v->azContentColumn); free(v); } /* ** Token types for parsing the arguments to xConnect or xCreate. */ #define TOKEN_EOF 0 /* End of file */ #define TOKEN_SPACE 1 /* Any kind of whitespace */ #define TOKEN_ID 2 /* An identifier */ #define TOKEN_STRING 3 /* A string literal */ #define TOKEN_PUNCT 4 /* A single punctuation character */ /* ** If X is a character that can be used in an identifier then ** IdChar(X) will be true. Otherwise it is false. ** ** For ASCII, any character with the high-order bit set is ** allowed in an identifier. For 7-bit characters, ** sqlite3IsIdChar[X] must be 1. ** ** Ticket #1066. the SQL standard does not allow '$' in the ** middle of identfiers. But many SQL implementations do. ** SQLite will allow '$' in identifiers for compatibility. ** But the feature is undocumented. */ static const char isIdChar[] = { /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 3x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 7x */ }; #define IdChar(C) (((c=C)&0x80)!=0 || (c>0x1f && isIdChar[c-0x20])) /* ** Return the length of the token that begins at z[0]. ** Store the token type in *tokenType before returning. */ static int getToken(const char *z, int *tokenType){ int i, c; switch( *z ){ case 0: { *tokenType = TOKEN_EOF; return 0; } case ' ': case '\t': case '\n': case '\f': case '\r': { for(i=1; safe_isspace(z[i]); i++){} *tokenType = TOKEN_SPACE; return i; } case '`': case '\'': case '"': { int delim = z[0]; for(i=1; (c=z[i])!=0; i++){ if( c==delim ){ if( z[i+1]==delim ){ i++; }else{ break; } } } *tokenType = TOKEN_STRING; return i + (c!=0); } case '[': { for(i=1, c=z[0]; c!=']' && (c=z[i])!=0; i++){} *tokenType = TOKEN_ID; return i; } default: { if( !IdChar(*z) ){ break; } for(i=1; IdChar(z[i]); i++){} *tokenType = TOKEN_ID; return i; } } *tokenType = TOKEN_PUNCT; return 1; } /* ** A token extracted from a string is an instance of the following ** structure. */ typedef struct Token { const char *z; /* Pointer to token text. Not '\000' terminated */ short int n; /* Length of the token text in bytes. */ } Token; /* ** Given a input string (which is really one of the argv[] parameters ** passed into xConnect or xCreate) split the string up into tokens. ** Return an array of pointers to '\000' terminated strings, one string ** for each non-whitespace token. ** ** The returned array is terminated by a single NULL pointer. ** ** Space to hold the returned array is obtained from a single ** malloc and should be freed by passing the return value to free(). ** The individual strings within the token list are all a part of ** the single memory allocation and will all be freed at once. */ static char **tokenizeString(const char *z, int *pnToken){ int nToken = 0; Token *aToken = malloc( strlen(z) * sizeof(aToken[0]) ); int n = 1; int e, i; int totalSize = 0; char **azToken; char *zCopy; while( n>0 ){ n = getToken(z, &e); if( e!=TOKEN_SPACE ){ aToken[nToken].z = z; aToken[nToken].n = n; nToken++; totalSize += n+1; } z += n; } azToken = (char**)malloc( nToken*sizeof(char*) + totalSize ); zCopy = (char*)&azToken[nToken]; nToken--; for(i=0; i=0 ){ azIn[j] = azIn[i]; } j++; } } azIn[j] = 0; } } /* ** Find the first alphanumeric token in the string zIn. Null-terminate ** this token. Remove any quotation marks. And return a pointer to ** the result. */ static char *firstToken(char *zIn, char **pzTail){ int n, ttype; while(1){ n = getToken(zIn, &ttype); if( ttype==TOKEN_SPACE ){ zIn += n; }else if( ttype==TOKEN_EOF ){ *pzTail = zIn; return 0; }else{ zIn[n] = 0; *pzTail = &zIn[1]; dequoteString(zIn); return zIn; } } /*NOTREACHED*/ } /* Return true if... ** ** * s begins with the string t, ignoring case ** * s is longer than t ** * The first character of s beyond t is not a alphanumeric ** ** Ignore leading space in *s. ** ** To put it another way, return true if the first token of ** s[] is t[]. */ static int startsWith(const char *s, const char *t){ while( safe_isspace(*s) ){ s++; } while( *t ){ if( safe_tolower(*s++)!=safe_tolower(*t++) ) return 0; } return *s!='_' && !safe_isalnum(*s); } /* ** An instance of this structure defines the "spec" of a ** full text index. This structure is populated by parseSpec ** and use by fulltextConnect and fulltextCreate. */ typedef struct TableSpec { const char *zDb; /* Logical database name */ const char *zName; /* Name of the full-text index */ int nColumn; /* Number of columns to be indexed */ char **azColumn; /* Original names of columns to be indexed */ char **azContentColumn; /* Column names for %_content */ char **azTokenizer; /* Name of tokenizer and its arguments */ } TableSpec; /* ** Reclaim all of the memory used by a TableSpec */ static void clearTableSpec(TableSpec *p) { free(p->azColumn); free(p->azContentColumn); free(p->azTokenizer); } /* Parse a CREATE VIRTUAL TABLE statement, which looks like this: * * CREATE VIRTUAL TABLE email * USING fts1(subject, body, tokenize mytokenizer(myarg)) * * We return parsed information in a TableSpec structure. * */ static int parseSpec(TableSpec *pSpec, int argc, const char *const*argv, char**pzErr){ int i, n; char *z, *zDummy; char **azArg; const char *zTokenizer = 0; /* argv[] entry describing the tokenizer */ assert( argc>=3 ); /* Current interface: ** argv[0] - module name ** argv[1] - database name ** argv[2] - table name ** argv[3..] - columns, optionally followed by tokenizer specification ** and snippet delimiters specification. */ /* Make a copy of the complete argv[][] array in a single allocation. ** The argv[][] array is read-only and transient. We can write to the ** copy in order to modify things and the copy is persistent. */ memset(pSpec, 0, sizeof(*pSpec)); for(i=n=0; izDb = azArg[1]; pSpec->zName = azArg[2]; pSpec->nColumn = 0; pSpec->azColumn = azArg; zTokenizer = "tokenize simple"; for(i=3; inColumn] = firstToken(azArg[i], &zDummy); pSpec->nColumn++; } } if( pSpec->nColumn==0 ){ azArg[0] = "content"; pSpec->nColumn = 1; } /* ** Construct the list of content column names. ** ** Each content column name will be of the form cNNAAAA ** where NN is the column number and AAAA is the sanitized ** column name. "sanitized" means that special characters are ** converted to "_". The cNN prefix guarantees that all column ** names are unique. ** ** The AAAA suffix is not strictly necessary. It is included ** for the convenience of people who might examine the generated ** %_content table and wonder what the columns are used for. */ pSpec->azContentColumn = malloc( pSpec->nColumn * sizeof(char *) ); if( pSpec->azContentColumn==0 ){ clearTableSpec(pSpec); return SQLITE_NOMEM; } for(i=0; inColumn; i++){ char *p; pSpec->azContentColumn[i] = sqlite3_mprintf("c%d%s", i, azArg[i]); for (p = pSpec->azContentColumn[i]; *p ; ++p) { if( !safe_isalnum(*p) ) *p = '_'; } } /* ** Parse the tokenizer specification string. */ pSpec->azTokenizer = tokenizeString(zTokenizer, &n); tokenListToIdList(pSpec->azTokenizer); return SQLITE_OK; } /* ** Generate a CREATE TABLE statement that describes the schema of ** the virtual table. Return a pointer to this schema string. ** ** Space is obtained from sqlite3_mprintf() and should be freed ** using sqlite3_free(). */ static char *fulltextSchema( int nColumn, /* Number of columns */ const char *const* azColumn, /* List of columns */ const char *zTableName /* Name of the table */ ){ int i; char *zSchema, *zNext; const char *zSep = "("; zSchema = sqlite3_mprintf("CREATE TABLE x"); for(i=0; ibase */ v->db = db; v->zDb = spec->zDb; /* Freed when azColumn is freed */ v->zName = spec->zName; /* Freed when azColumn is freed */ v->nColumn = spec->nColumn; v->azContentColumn = spec->azContentColumn; spec->azContentColumn = 0; v->azColumn = spec->azColumn; spec->azColumn = 0; if( spec->azTokenizer==0 ){ return SQLITE_NOMEM; } /* TODO(shess) For now, add new tokenizers as else if clauses. */ if( spec->azTokenizer[0]==0 || startsWith(spec->azTokenizer[0], "simple") ){ sqlite3Fts1SimpleTokenizerModule(&m); }else if( startsWith(spec->azTokenizer[0], "porter") ){ sqlite3Fts1PorterTokenizerModule(&m); }else{ *pzErr = sqlite3_mprintf("unknown tokenizer: %s", spec->azTokenizer[0]); rc = SQLITE_ERROR; goto err; } for(n=0; spec->azTokenizer[n]; n++){} if( n ){ rc = m->xCreate(n-1, (const char*const*)&spec->azTokenizer[1], &v->pTokenizer); }else{ rc = m->xCreate(0, 0, &v->pTokenizer); } if( rc!=SQLITE_OK ) goto err; v->pTokenizer->pModule = m; /* TODO: verify the existence of backing tables foo_content, foo_term */ schema = fulltextSchema(v->nColumn, (const char*const*)v->azColumn, spec->zName); rc = sqlite3_declare_vtab(db, schema); sqlite3_free(schema); if( rc!=SQLITE_OK ) goto err; memset(v->pFulltextStatements, 0, sizeof(v->pFulltextStatements)); *ppVTab = &v->base; TRACE(("FTS1 Connect %p\n", v)); return rc; err: fulltext_vtab_destroy(v); return rc; } static int fulltextConnect( sqlite3 *db, void *pAux, int argc, const char *const*argv, sqlite3_vtab **ppVTab, char **pzErr ){ TableSpec spec; int rc = parseSpec(&spec, argc, argv, pzErr); if( rc!=SQLITE_OK ) return rc; rc = constructVtab(db, &spec, ppVTab, pzErr); clearTableSpec(&spec); return rc; } /* The %_content table holds the text of each document, with ** the rowid used as the docid. ** ** The %_term table maps each term to a document list blob ** containing elements sorted by ascending docid, each element ** encoded as: ** ** docid varint-encoded ** token elements: ** position+1 varint-encoded as delta from previous position ** start offset varint-encoded as delta from previous start offset ** end offset varint-encoded as delta from start offset ** ** The sentinel position of 0 indicates the end of the token list. ** ** Additionally, doclist blobs are chunked into multiple segments, ** using segment to order the segments. New elements are added to ** the segment at segment 0, until it exceeds CHUNK_MAX. Then ** segment 0 is deleted, and the doclist is inserted at segment 1. ** If there is already a doclist at segment 1, the segment 0 doclist ** is merged with it, the segment 1 doclist is deleted, and the ** merged doclist is inserted at segment 2, repeating those ** operations until an insert succeeds. ** ** Since this structure doesn't allow us to update elements in place ** in case of deletion or update, these are simply written to ** segment 0 (with an empty token list in case of deletion), with ** docListAccumulate() taking care to retain lower-segment ** information in preference to higher-segment information. */ /* TODO(shess) Provide a VACUUM type operation which both removes ** deleted elements which are no longer necessary, and duplicated ** elements. I suspect this will probably not be necessary in ** practice, though. */ static int fulltextCreate(sqlite3 *db, void *pAux, int argc, const char * const *argv, sqlite3_vtab **ppVTab, char **pzErr){ int rc; TableSpec spec; StringBuffer schema; TRACE(("FTS1 Create\n")); rc = parseSpec(&spec, argc, argv, pzErr); if( rc!=SQLITE_OK ) return rc; initStringBuffer(&schema); append(&schema, "CREATE TABLE %_content("); appendList(&schema, spec.nColumn, spec.azContentColumn); append(&schema, ")"); rc = sql_exec(db, spec.zDb, spec.zName, schema.s); free(schema.s); if( rc!=SQLITE_OK ) goto out; rc = sql_exec(db, spec.zDb, spec.zName, "create table %_term(term text, segment integer, doclist blob, " "primary key(term, segment));"); if( rc!=SQLITE_OK ) goto out; rc = constructVtab(db, &spec, ppVTab, pzErr); out: clearTableSpec(&spec); return rc; } /* Decide how to handle an SQL query. */ static int fulltextBestIndex(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ int i; TRACE(("FTS1 BestIndex\n")); for(i=0; inConstraint; ++i){ const struct sqlite3_index_constraint *pConstraint; pConstraint = &pInfo->aConstraint[i]; if( pConstraint->usable ) { if( pConstraint->iColumn==-1 && pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){ pInfo->idxNum = QUERY_ROWID; /* lookup by rowid */ TRACE(("FTS1 QUERY_ROWID\n")); } else if( pConstraint->iColumn>=0 && pConstraint->op==SQLITE_INDEX_CONSTRAINT_MATCH ){ /* full-text search */ pInfo->idxNum = QUERY_FULLTEXT + pConstraint->iColumn; TRACE(("FTS1 QUERY_FULLTEXT %d\n", pConstraint->iColumn)); } else continue; pInfo->aConstraintUsage[i].argvIndex = 1; pInfo->aConstraintUsage[i].omit = 1; /* An arbitrary value for now. * TODO: Perhaps rowid matches should be considered cheaper than * full-text searches. */ pInfo->estimatedCost = 1.0; return SQLITE_OK; } } pInfo->idxNum = QUERY_GENERIC; return SQLITE_OK; } static int fulltextDisconnect(sqlite3_vtab *pVTab){ TRACE(("FTS1 Disconnect %p\n", pVTab)); fulltext_vtab_destroy((fulltext_vtab *)pVTab); return SQLITE_OK; } static int fulltextDestroy(sqlite3_vtab *pVTab){ fulltext_vtab *v = (fulltext_vtab *)pVTab; int rc; TRACE(("FTS1 Destroy %p\n", pVTab)); rc = sql_exec(v->db, v->zDb, v->zName, "drop table if exists %_content;" "drop table if exists %_term;" ); if( rc!=SQLITE_OK ) return rc; fulltext_vtab_destroy((fulltext_vtab *)pVTab); return SQLITE_OK; } static int fulltextOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ fulltext_cursor *c; c = (fulltext_cursor *) calloc(sizeof(fulltext_cursor), 1); /* sqlite will initialize c->base */ *ppCursor = &c->base; TRACE(("FTS1 Open %p: %p\n", pVTab, c)); return SQLITE_OK; } /* Free all of the dynamically allocated memory held by *q */ static void queryClear(Query *q){ int i; for(i = 0; i < q->nTerms; ++i){ free(q->pTerms[i].pTerm); } free(q->pTerms); memset(q, 0, sizeof(*q)); } /* Free all of the dynamically allocated memory held by the ** Snippet */ static void snippetClear(Snippet *p){ free(p->aMatch); free(p->zOffset); free(p->zSnippet); memset(p, 0, sizeof(*p)); } /* ** Append a single entry to the p->aMatch[] log. */ static void snippetAppendMatch( Snippet *p, /* Append the entry to this snippet */ int iCol, int iTerm, /* The column and query term */ int iStart, int nByte /* Offset and size of the match */ ){ int i; struct snippetMatch *pMatch; if( p->nMatch+1>=p->nAlloc ){ p->nAlloc = p->nAlloc*2 + 10; p->aMatch = realloc(p->aMatch, p->nAlloc*sizeof(p->aMatch[0]) ); if( p->aMatch==0 ){ p->nMatch = 0; p->nAlloc = 0; return; } } i = p->nMatch++; pMatch = &p->aMatch[i]; pMatch->iCol = iCol; pMatch->iTerm = iTerm; pMatch->iStart = iStart; pMatch->nByte = nByte; } /* ** Sizing information for the circular buffer used in snippetOffsetsOfColumn() */ #define FTS1_ROTOR_SZ (32) #define FTS1_ROTOR_MASK (FTS1_ROTOR_SZ-1) /* ** Add entries to pSnippet->aMatch[] for every match that occurs against ** document zDoc[0..nDoc-1] which is stored in column iColumn. */ static void snippetOffsetsOfColumn( Query *pQuery, Snippet *pSnippet, int iColumn, const char *zDoc, int nDoc ){ const sqlite3_tokenizer_module *pTModule; /* The tokenizer module */ sqlite3_tokenizer *pTokenizer; /* The specific tokenizer */ sqlite3_tokenizer_cursor *pTCursor; /* Tokenizer cursor */ fulltext_vtab *pVtab; /* The full text index */ int nColumn; /* Number of columns in the index */ const QueryTerm *aTerm; /* Query string terms */ int nTerm; /* Number of query string terms */ int i, j; /* Loop counters */ int rc; /* Return code */ unsigned int match, prevMatch; /* Phrase search bitmasks */ const char *zToken; /* Next token from the tokenizer */ int nToken; /* Size of zToken */ int iBegin, iEnd, iPos; /* Offsets of beginning and end */ /* The following variables keep a circular buffer of the last ** few tokens */ unsigned int iRotor = 0; /* Index of current token */ int iRotorBegin[FTS1_ROTOR_SZ]; /* Beginning offset of token */ int iRotorLen[FTS1_ROTOR_SZ]; /* Length of token */ pVtab = pQuery->pFts; nColumn = pVtab->nColumn; pTokenizer = pVtab->pTokenizer; pTModule = pTokenizer->pModule; rc = pTModule->xOpen(pTokenizer, zDoc, nDoc, &pTCursor); if( rc ) return; pTCursor->pTokenizer = pTokenizer; aTerm = pQuery->pTerms; nTerm = pQuery->nTerms; if( nTerm>=FTS1_ROTOR_SZ ){ nTerm = FTS1_ROTOR_SZ - 1; } prevMatch = 0; while(1){ rc = pTModule->xNext(pTCursor, &zToken, &nToken, &iBegin, &iEnd, &iPos); if( rc ) break; iRotorBegin[iRotor&FTS1_ROTOR_MASK] = iBegin; iRotorLen[iRotor&FTS1_ROTOR_MASK] = iEnd-iBegin; match = 0; for(i=0; i=0 && iCol1 && (prevMatch & (1<=0; j--){ int k = (iRotor-j) & FTS1_ROTOR_MASK; snippetAppendMatch(pSnippet, iColumn, i-j, iRotorBegin[k], iRotorLen[k]); } } } prevMatch = match<<1; iRotor++; } pTModule->xClose(pTCursor); } /* ** Compute all offsets for the current row of the query. ** If the offsets have already been computed, this routine is a no-op. */ static void snippetAllOffsets(fulltext_cursor *p){ int nColumn; int iColumn, i; int iFirst, iLast; fulltext_vtab *pFts; if( p->snippet.nMatch ) return; if( p->q.nTerms==0 ) return; pFts = p->q.pFts; nColumn = pFts->nColumn; iColumn = p->iCursorType - QUERY_FULLTEXT; if( iColumn<0 || iColumn>=nColumn ){ iFirst = 0; iLast = nColumn-1; }else{ iFirst = iColumn; iLast = iColumn; } for(i=iFirst; i<=iLast; i++){ const char *zDoc; int nDoc; zDoc = (const char*)sqlite3_column_text(p->pStmt, i+1); nDoc = sqlite3_column_bytes(p->pStmt, i+1); snippetOffsetsOfColumn(&p->q, &p->snippet, i, zDoc, nDoc); } } /* ** Convert the information in the aMatch[] array of the snippet ** into the string zOffset[0..nOffset-1]. */ static void snippetOffsetText(Snippet *p){ int i; int cnt = 0; StringBuffer sb; char zBuf[200]; if( p->zOffset ) return; initStringBuffer(&sb); for(i=0; inMatch; i++){ struct snippetMatch *pMatch = &p->aMatch[i]; zBuf[0] = ' '; sqlite3_snprintf(sizeof(zBuf)-1, &zBuf[cnt>0], "%d %d %d %d", pMatch->iCol, pMatch->iTerm, pMatch->iStart, pMatch->nByte); append(&sb, zBuf); cnt++; } p->zOffset = sb.s; p->nOffset = sb.len; } /* ** zDoc[0..nDoc-1] is phrase of text. aMatch[0..nMatch-1] are a set ** of matching words some of which might be in zDoc. zDoc is column ** number iCol. ** ** iBreak is suggested spot in zDoc where we could begin or end an ** excerpt. Return a value similar to iBreak but possibly adjusted ** to be a little left or right so that the break point is better. */ static int wordBoundary( int iBreak, /* The suggested break point */ const char *zDoc, /* Document text */ int nDoc, /* Number of bytes in zDoc[] */ struct snippetMatch *aMatch, /* Matching words */ int nMatch, /* Number of entries in aMatch[] */ int iCol /* The column number for zDoc[] */ ){ int i; if( iBreak<=10 ){ return 0; } if( iBreak>=nDoc-10 ){ return nDoc; } for(i=0; i0 && aMatch[i-1].iStart+aMatch[i-1].nByte>=iBreak ){ return aMatch[i-1].iStart; } } for(i=1; i<=10; i++){ if( safe_isspace(zDoc[iBreak-i]) ){ return iBreak - i + 1; } if( safe_isspace(zDoc[iBreak+i]) ){ return iBreak + i + 1; } } return iBreak; } /* ** If the StringBuffer does not end in white space, add a single ** space character to the end. */ static void appendWhiteSpace(StringBuffer *p){ if( p->len==0 ) return; if( safe_isspace(p->s[p->len-1]) ) return; append(p, " "); } /* ** Remove white space from teh end of the StringBuffer */ static void trimWhiteSpace(StringBuffer *p){ while( p->len>0 && safe_isspace(p->s[p->len-1]) ){ p->len--; } } /* ** Allowed values for Snippet.aMatch[].snStatus */ #define SNIPPET_IGNORE 0 /* It is ok to omit this match from the snippet */ #define SNIPPET_DESIRED 1 /* We want to include this match in the snippet */ /* ** Generate the text of a snippet. */ static void snippetText( fulltext_cursor *pCursor, /* The cursor we need the snippet for */ const char *zStartMark, /* Markup to appear before each match */ const char *zEndMark, /* Markup to appear after each match */ const char *zEllipsis /* Ellipsis mark */ ){ int i, j; struct snippetMatch *aMatch; int nMatch; int nDesired; StringBuffer sb; int tailCol; int tailOffset; int iCol; int nDoc; const char *zDoc; int iStart, iEnd; int tailEllipsis = 0; int iMatch; free(pCursor->snippet.zSnippet); pCursor->snippet.zSnippet = 0; aMatch = pCursor->snippet.aMatch; nMatch = pCursor->snippet.nMatch; initStringBuffer(&sb); for(i=0; iq.nTerms; i++){ for(j=0; j0; i++){ if( aMatch[i].snStatus!=SNIPPET_DESIRED ) continue; nDesired--; iCol = aMatch[i].iCol; zDoc = (const char*)sqlite3_column_text(pCursor->pStmt, iCol+1); nDoc = sqlite3_column_bytes(pCursor->pStmt, iCol+1); iStart = aMatch[i].iStart - 40; iStart = wordBoundary(iStart, zDoc, nDoc, aMatch, nMatch, iCol); if( iStart<=10 ){ iStart = 0; } if( iCol==tailCol && iStart<=tailOffset+20 ){ iStart = tailOffset; } if( (iCol!=tailCol && tailCol>=0) || iStart!=tailOffset ){ trimWhiteSpace(&sb); appendWhiteSpace(&sb); append(&sb, zEllipsis); appendWhiteSpace(&sb); } iEnd = aMatch[i].iStart + aMatch[i].nByte + 40; iEnd = wordBoundary(iEnd, zDoc, nDoc, aMatch, nMatch, iCol); if( iEnd>=nDoc-10 ){ iEnd = nDoc; tailEllipsis = 0; }else{ tailEllipsis = 1; } while( iMatchsnippet.zSnippet = sb.s; pCursor->snippet.nSnippet = sb.len; } /* ** Close the cursor. For additional information see the documentation ** on the xClose method of the virtual table interface. */ static int fulltextClose(sqlite3_vtab_cursor *pCursor){ fulltext_cursor *c = (fulltext_cursor *) pCursor; TRACE(("FTS1 Close %p\n", c)); sqlite3_finalize(c->pStmt); queryClear(&c->q); snippetClear(&c->snippet); if( c->result.pDoclist!=NULL ){ docListDelete(c->result.pDoclist); } free(c); return SQLITE_OK; } static int fulltextNext(sqlite3_vtab_cursor *pCursor){ fulltext_cursor *c = (fulltext_cursor *) pCursor; sqlite_int64 iDocid; int rc; TRACE(("FTS1 Next %p\n", pCursor)); snippetClear(&c->snippet); if( c->iCursorType < QUERY_FULLTEXT ){ /* TODO(shess) Handle SQLITE_SCHEMA AND SQLITE_BUSY. */ rc = sqlite3_step(c->pStmt); switch( rc ){ case SQLITE_ROW: c->eof = 0; return SQLITE_OK; case SQLITE_DONE: c->eof = 1; return SQLITE_OK; default: c->eof = 1; return rc; } } else { /* full-text query */ rc = sqlite3_reset(c->pStmt); if( rc!=SQLITE_OK ) return rc; iDocid = nextDocid(&c->result); if( iDocid==0 ){ c->eof = 1; return SQLITE_OK; } rc = sqlite3_bind_int64(c->pStmt, 1, iDocid); if( rc!=SQLITE_OK ) return rc; /* TODO(shess) Handle SQLITE_SCHEMA AND SQLITE_BUSY. */ rc = sqlite3_step(c->pStmt); if( rc==SQLITE_ROW ){ /* the case we expect */ c->eof = 0; return SQLITE_OK; } /* an error occurred; abort */ return rc==SQLITE_DONE ? SQLITE_ERROR : rc; } } /* Return a DocList corresponding to the query term *pTerm. If *pTerm ** is the first term of a phrase query, go ahead and evaluate the phrase ** query and return the doclist for the entire phrase query. ** ** The result is stored in pTerm->doclist. */ static int docListOfTerm( fulltext_vtab *v, /* The full text index */ int iColumn, /* column to restrict to. No restrition if >=nColumn */ QueryTerm *pQTerm, /* Term we are looking for, or 1st term of a phrase */ DocList **ppResult /* Write the result here */ ){ DocList *pLeft, *pRight, *pNew; int i, rc; pLeft = docListNew(DL_POSITIONS); rc = term_select_all(v, iColumn, pQTerm->pTerm, pQTerm->nTerm, pLeft); if( rc ){ docListDelete(pLeft); return rc; } for(i=1; i<=pQTerm->nPhrase; i++){ pRight = docListNew(DL_POSITIONS); rc = term_select_all(v, iColumn, pQTerm[i].pTerm, pQTerm[i].nTerm, pRight); if( rc ){ docListDelete(pLeft); return rc; } pNew = docListNew(inPhrase ? DL_POSITIONS : DL_DOCIDS); docListPhraseMerge(pLeft, pRight, pNew); docListDelete(pLeft); docListDelete(pRight); pLeft = pNew; } *ppResult = pLeft; return SQLITE_OK; } /* Add a new term pTerm[0..nTerm-1] to the query *q. */ static void queryAdd(Query *q, const char *pTerm, int nTerm){ QueryTerm *t; ++q->nTerms; q->pTerms = realloc(q->pTerms, q->nTerms * sizeof(q->pTerms[0])); if( q->pTerms==0 ){ q->nTerms = 0; return; } t = &q->pTerms[q->nTerms - 1]; memset(t, 0, sizeof(*t)); t->pTerm = malloc(nTerm+1); memcpy(t->pTerm, pTerm, nTerm); t->pTerm[nTerm] = 0; t->nTerm = nTerm; t->isOr = q->nextIsOr; q->nextIsOr = 0; t->iColumn = q->nextColumn; q->nextColumn = q->dfltColumn; } /* ** Check to see if the string zToken[0...nToken-1] matches any ** column name in the virtual table. If it does, ** return the zero-indexed column number. If not, return -1. */ static int checkColumnSpecifier( fulltext_vtab *pVtab, /* The virtual table */ const char *zToken, /* Text of the token */ int nToken /* Number of characters in the token */ ){ int i; for(i=0; inColumn; i++){ if( memcmp(pVtab->azColumn[i], zToken, nToken)==0 && pVtab->azColumn[i][nToken]==0 ){ return i; } } return -1; } /* ** Parse the text at pSegment[0..nSegment-1]. Add additional terms ** to the query being assemblied in pQuery. ** ** inPhrase is true if pSegment[0..nSegement-1] is contained within ** double-quotes. If inPhrase is true, then the first term ** is marked with the number of terms in the phrase less one and ** OR and "-" syntax is ignored. If inPhrase is false, then every ** term found is marked with nPhrase=0 and OR and "-" syntax is significant. */ static int tokenizeSegment( sqlite3_tokenizer *pTokenizer, /* The tokenizer to use */ const char *pSegment, int nSegment, /* Query expression being parsed */ int inPhrase, /* True if within "..." */ Query *pQuery /* Append results here */ ){ const sqlite3_tokenizer_module *pModule = pTokenizer->pModule; sqlite3_tokenizer_cursor *pCursor; int firstIndex = pQuery->nTerms; int iCol; int nTerm = 1; int rc = pModule->xOpen(pTokenizer, pSegment, nSegment, &pCursor); if( rc!=SQLITE_OK ) return rc; pCursor->pTokenizer = pTokenizer; while( 1 ){ const char *pToken; int nToken, iBegin, iEnd, iPos; rc = pModule->xNext(pCursor, &pToken, &nToken, &iBegin, &iEnd, &iPos); if( rc!=SQLITE_OK ) break; if( !inPhrase && pSegment[iEnd]==':' && (iCol = checkColumnSpecifier(pQuery->pFts, pToken, nToken))>=0 ){ pQuery->nextColumn = iCol; continue; } if( !inPhrase && pQuery->nTerms>0 && nToken==2 && pSegment[iBegin]=='O' && pSegment[iBegin+1]=='R' ){ pQuery->nextIsOr = 1; continue; } queryAdd(pQuery, pToken, nToken); if( !inPhrase && iBegin>0 && pSegment[iBegin-1]=='-' ){ pQuery->pTerms[pQuery->nTerms-1].isNot = 1; } pQuery->pTerms[pQuery->nTerms-1].iPhrase = nTerm; if( inPhrase ){ nTerm++; } } if( inPhrase && pQuery->nTerms>firstIndex ){ pQuery->pTerms[firstIndex].nPhrase = pQuery->nTerms - firstIndex - 1; } return pModule->xClose(pCursor); } /* Parse a query string, yielding a Query object pQuery. ** ** The calling function will need to queryClear() to clean up ** the dynamically allocated memory held by pQuery. */ static int parseQuery( fulltext_vtab *v, /* The fulltext index */ const char *zInput, /* Input text of the query string */ int nInput, /* Size of the input text */ int dfltColumn, /* Default column of the index to match against */ Query *pQuery /* Write the parse results here. */ ){ int iInput, inPhrase = 0; if( zInput==0 ) nInput = 0; if( nInput<0 ) nInput = strlen(zInput); pQuery->nTerms = 0; pQuery->pTerms = NULL; pQuery->nextIsOr = 0; pQuery->nextColumn = dfltColumn; pQuery->dfltColumn = dfltColumn; pQuery->pFts = v; for(iInput=0; iInputiInput ){ tokenizeSegment(v->pTokenizer, zInput+iInput, i-iInput, inPhrase, pQuery); } iInput = i; if( i=nColumn ** they are allowed to match against any column. */ static int fulltextQuery( fulltext_vtab *v, /* The full text index */ int iColumn, /* Match against this column by default */ const char *zInput, /* The query string */ int nInput, /* Number of bytes in zInput[] */ DocList **pResult, /* Write the result doclist here */ Query *pQuery /* Put parsed query string here */ ){ int i, iNext, rc; DocList *pLeft = NULL; DocList *pRight, *pNew, *pOr; int nNot = 0; QueryTerm *aTerm; rc = parseQuery(v, zInput, nInput, iColumn, pQuery); if( rc!=SQLITE_OK ) return rc; /* Merge AND terms. */ aTerm = pQuery->pTerms; for(i = 0; inTerms; i=iNext){ if( aTerm[i].isNot ){ /* Handle all NOT terms in a separate pass */ nNot++; iNext = i + aTerm[i].nPhrase+1; continue; } iNext = i + aTerm[i].nPhrase + 1; rc = docListOfTerm(v, aTerm[i].iColumn, &aTerm[i], &pRight); if( rc ){ queryClear(pQuery); return rc; } while( iNextnTerms && aTerm[iNext].isOr ){ rc = docListOfTerm(v, aTerm[iNext].iColumn, &aTerm[iNext], &pOr); iNext += aTerm[iNext].nPhrase + 1; if( rc ){ queryClear(pQuery); return rc; } pNew = docListNew(DL_DOCIDS); docListOrMerge(pRight, pOr, pNew); docListDelete(pRight); docListDelete(pOr); pRight = pNew; } if( pLeft==0 ){ pLeft = pRight; }else{ pNew = docListNew(DL_DOCIDS); docListAndMerge(pLeft, pRight, pNew); docListDelete(pRight); docListDelete(pLeft); pLeft = pNew; } } if( nNot && pLeft==0 ){ /* We do not yet know how to handle a query of only NOT terms */ return SQLITE_ERROR; } /* Do the EXCEPT terms */ for(i=0; inTerms; i += aTerm[i].nPhrase + 1){ if( !aTerm[i].isNot ) continue; rc = docListOfTerm(v, aTerm[i].iColumn, &aTerm[i], &pRight); if( rc ){ queryClear(pQuery); docListDelete(pLeft); return rc; } pNew = docListNew(DL_DOCIDS); docListExceptMerge(pLeft, pRight, pNew); docListDelete(pRight); docListDelete(pLeft); pLeft = pNew; } *pResult = pLeft; return rc; } /* ** This is the xFilter interface for the virtual table. See ** the virtual table xFilter method documentation for additional ** information. ** ** If idxNum==QUERY_GENERIC then do a full table scan against ** the %_content table. ** ** If idxNum==QUERY_ROWID then do a rowid lookup for a single entry ** in the %_content table. ** ** If idxNum>=QUERY_FULLTEXT then use the full text index. The ** column on the left-hand side of the MATCH operator is column ** number idxNum-QUERY_FULLTEXT, 0 indexed. argv[0] is the right-hand ** side of the MATCH operator. */ /* TODO(shess) Upgrade the cursor initialization and destruction to ** account for fulltextFilter() being called multiple times on the ** same cursor. The current solution is very fragile. Apply fix to ** fts2 as appropriate. */ static int fulltextFilter( sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */ int idxNum, const char *idxStr, /* Which indexing scheme to use */ int argc, sqlite3_value **argv /* Arguments for the indexing scheme */ ){ fulltext_cursor *c = (fulltext_cursor *) pCursor; fulltext_vtab *v = cursor_vtab(c); int rc; char *zSql; TRACE(("FTS1 Filter %p\n",pCursor)); zSql = sqlite3_mprintf("select rowid, * from %%_content %s", idxNum==QUERY_GENERIC ? "" : "where rowid=?"); sqlite3_finalize(c->pStmt); rc = sql_prepare(v->db, v->zDb, v->zName, &c->pStmt, zSql); sqlite3_free(zSql); if( rc!=SQLITE_OK ) return rc; c->iCursorType = idxNum; switch( idxNum ){ case QUERY_GENERIC: break; case QUERY_ROWID: rc = sqlite3_bind_int64(c->pStmt, 1, sqlite3_value_int64(argv[0])); if( rc!=SQLITE_OK ) return rc; break; default: /* full-text search */ { const char *zQuery = (const char *)sqlite3_value_text(argv[0]); DocList *pResult; assert( idxNum<=QUERY_FULLTEXT+v->nColumn); assert( argc==1 ); queryClear(&c->q); rc = fulltextQuery(v, idxNum-QUERY_FULLTEXT, zQuery, -1, &pResult, &c->q); if( rc!=SQLITE_OK ) return rc; if( c->result.pDoclist!=NULL ) docListDelete(c->result.pDoclist); readerInit(&c->result, pResult); break; } } return fulltextNext(pCursor); } /* This is the xEof method of the virtual table. The SQLite core ** calls this routine to find out if it has reached the end of ** a query's results set. */ static int fulltextEof(sqlite3_vtab_cursor *pCursor){ fulltext_cursor *c = (fulltext_cursor *) pCursor; return c->eof; } /* This is the xColumn method of the virtual table. The SQLite ** core calls this method during a query when it needs the value ** of a column from the virtual table. This method needs to use ** one of the sqlite3_result_*() routines to store the requested ** value back in the pContext. */ static int fulltextColumn(sqlite3_vtab_cursor *pCursor, sqlite3_context *pContext, int idxCol){ fulltext_cursor *c = (fulltext_cursor *) pCursor; fulltext_vtab *v = cursor_vtab(c); if( idxColnColumn ){ sqlite3_value *pVal = sqlite3_column_value(c->pStmt, idxCol+1); sqlite3_result_value(pContext, pVal); }else if( idxCol==v->nColumn ){ /* The extra column whose name is the same as the table. ** Return a blob which is a pointer to the cursor */ sqlite3_result_blob(pContext, &c, sizeof(c), SQLITE_TRANSIENT); } return SQLITE_OK; } /* This is the xRowid method. The SQLite core calls this routine to ** retrive the rowid for the current row of the result set. The ** rowid should be written to *pRowid. */ static int fulltextRowid(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ fulltext_cursor *c = (fulltext_cursor *) pCursor; *pRowid = sqlite3_column_int64(c->pStmt, 0); return SQLITE_OK; } /* Add all terms in [zText] to the given hash table. If [iColumn] > 0, * we also store positions and offsets in the hash table using the given * column number. */ static int buildTerms(fulltext_vtab *v, fts1Hash *terms, sqlite_int64 iDocid, const char *zText, int iColumn){ sqlite3_tokenizer *pTokenizer = v->pTokenizer; sqlite3_tokenizer_cursor *pCursor; const char *pToken; int nTokenBytes; int iStartOffset, iEndOffset, iPosition; int rc; rc = pTokenizer->pModule->xOpen(pTokenizer, zText, -1, &pCursor); if( rc!=SQLITE_OK ) return rc; pCursor->pTokenizer = pTokenizer; while( SQLITE_OK==pTokenizer->pModule->xNext(pCursor, &pToken, &nTokenBytes, &iStartOffset, &iEndOffset, &iPosition) ){ DocList *p; /* Positions can't be negative; we use -1 as a terminator internally. */ if( iPosition<0 ){ pTokenizer->pModule->xClose(pCursor); return SQLITE_ERROR; } p = fts1HashFind(terms, pToken, nTokenBytes); if( p==NULL ){ p = docListNew(DL_DEFAULT); docListAddDocid(p, iDocid); fts1HashInsert(terms, pToken, nTokenBytes, p); } if( iColumn>=0 ){ docListAddPosOffset(p, iColumn, iPosition, iStartOffset, iEndOffset); } } /* TODO(shess) Check return? Should this be able to cause errors at ** this point? Actually, same question about sqlite3_finalize(), ** though one could argue that failure there means that the data is ** not durable. *ponder* */ pTokenizer->pModule->xClose(pCursor); return rc; } /* Update the %_terms table to map the term [pTerm] to the given rowid. */ static int index_insert_term(fulltext_vtab *v, const char *pTerm, int nTerm, DocList *d){ sqlite_int64 iIndexRow; DocList doclist; int iSegment = 0, rc; rc = term_select(v, pTerm, nTerm, iSegment, &iIndexRow, &doclist); if( rc==SQLITE_DONE ){ docListInit(&doclist, DL_DEFAULT, 0, 0); docListUpdate(&doclist, d); /* TODO(shess) Consider length(doclist)>CHUNK_MAX? */ rc = term_insert(v, NULL, pTerm, nTerm, iSegment, &doclist); goto err; } if( rc!=SQLITE_ROW ) return SQLITE_ERROR; docListUpdate(&doclist, d); if( doclist.nData<=CHUNK_MAX ){ rc = term_update(v, iIndexRow, &doclist); goto err; } /* Doclist doesn't fit, delete what's there, and accumulate ** forward. */ rc = term_delete(v, iIndexRow); if( rc!=SQLITE_OK ) goto err; /* Try to insert the doclist into a higher segment bucket. On ** failure, accumulate existing doclist with the doclist from that ** bucket, and put results in the next bucket. */ iSegment++; while( (rc=term_insert(v, &iIndexRow, pTerm, nTerm, iSegment, &doclist))!=SQLITE_OK ){ sqlite_int64 iSegmentRow; DocList old; int rc2; /* Retain old error in case the term_insert() error was really an ** error rather than a bounced insert. */ rc2 = term_select(v, pTerm, nTerm, iSegment, &iSegmentRow, &old); if( rc2!=SQLITE_ROW ) goto err; rc = term_delete(v, iSegmentRow); if( rc!=SQLITE_OK ) goto err; /* Reusing lowest-number deleted row keeps the index smaller. */ if( iSegmentRownColumn ; ++i){ char *zText = (char*)sqlite3_value_text(pValues[i]); int rc = buildTerms(v, terms, iRowid, zText, i); if( rc!=SQLITE_OK ) return rc; } return SQLITE_OK; } /* Add empty doclists for all terms in the given row's content to the hash * table [pTerms]. */ static int deleteTerms(fulltext_vtab *v, fts1Hash *pTerms, sqlite_int64 iRowid){ const char **pValues; int i; int rc = content_select(v, iRowid, &pValues); if( rc!=SQLITE_OK ) return rc; for(i = 0 ; i < v->nColumn; ++i) { rc = buildTerms(v, pTerms, iRowid, pValues[i], -1); if( rc!=SQLITE_OK ) break; } freeStringArray(v->nColumn, pValues); return SQLITE_OK; } /* Insert a row into the %_content table; set *piRowid to be the ID of the * new row. Fill [pTerms] with new doclists for the %_term table. */ static int index_insert(fulltext_vtab *v, sqlite3_value *pRequestRowid, sqlite3_value **pValues, sqlite_int64 *piRowid, fts1Hash *pTerms){ int rc; rc = content_insert(v, pRequestRowid, pValues); /* execute an SQL INSERT */ if( rc!=SQLITE_OK ) return rc; *piRowid = sqlite3_last_insert_rowid(v->db); return insertTerms(v, pTerms, *piRowid, pValues); } /* Delete a row from the %_content table; fill [pTerms] with empty doclists * to be written to the %_term table. */ static int index_delete(fulltext_vtab *v, sqlite_int64 iRow, fts1Hash *pTerms){ int rc = deleteTerms(v, pTerms, iRow); if( rc!=SQLITE_OK ) return rc; return content_delete(v, iRow); /* execute an SQL DELETE */ } /* Update a row in the %_content table; fill [pTerms] with new doclists for the * %_term table. */ static int index_update(fulltext_vtab *v, sqlite_int64 iRow, sqlite3_value **pValues, fts1Hash *pTerms){ /* Generate an empty doclist for each term that previously appeared in this * row. */ int rc = deleteTerms(v, pTerms, iRow); if( rc!=SQLITE_OK ) return rc; rc = content_update(v, pValues, iRow); /* execute an SQL UPDATE */ if( rc!=SQLITE_OK ) return rc; /* Now add positions for terms which appear in the updated row. */ return insertTerms(v, pTerms, iRow, pValues); } /* This function implements the xUpdate callback; it is the top-level entry * point for inserting, deleting or updating a row in a full-text table. */ static int fulltextUpdate(sqlite3_vtab *pVtab, int nArg, sqlite3_value **ppArg, sqlite_int64 *pRowid){ fulltext_vtab *v = (fulltext_vtab *) pVtab; fts1Hash terms; /* maps term string -> PosList */ int rc; fts1HashElem *e; TRACE(("FTS1 Update %p\n", pVtab)); fts1HashInit(&terms, FTS1_HASH_STRING, 1); if( nArg<2 ){ rc = index_delete(v, sqlite3_value_int64(ppArg[0]), &terms); } else if( sqlite3_value_type(ppArg[0]) != SQLITE_NULL ){ /* An update: * ppArg[0] = old rowid * ppArg[1] = new rowid * ppArg[2..2+v->nColumn-1] = values * ppArg[2+v->nColumn] = value for magic column (we ignore this) */ sqlite_int64 rowid = sqlite3_value_int64(ppArg[0]); if( sqlite3_value_type(ppArg[1]) != SQLITE_INTEGER || sqlite3_value_int64(ppArg[1]) != rowid ){ rc = SQLITE_ERROR; /* we don't allow changing the rowid */ } else { assert( nArg==2+v->nColumn+1); rc = index_update(v, rowid, &ppArg[2], &terms); } } else { /* An insert: * ppArg[1] = requested rowid * ppArg[2..2+v->nColumn-1] = values * ppArg[2+v->nColumn] = value for magic column (we ignore this) */ assert( nArg==2+v->nColumn+1); rc = index_insert(v, ppArg[1], &ppArg[2], pRowid, &terms); } if( rc==SQLITE_OK ){ /* Write updated doclists to disk. */ for(e=fts1HashFirst(&terms); e; e=fts1HashNext(e)){ DocList *p = fts1HashData(e); rc = index_insert_term(v, fts1HashKey(e), fts1HashKeysize(e), p); if( rc!=SQLITE_OK ) break; } } /* clean up */ for(e=fts1HashFirst(&terms); e; e=fts1HashNext(e)){ DocList *p = fts1HashData(e); docListDelete(p); } fts1HashClear(&terms); return rc; } /* ** Implementation of the snippet() function for FTS1 */ static void snippetFunc( sqlite3_context *pContext, int argc, sqlite3_value **argv ){ fulltext_cursor *pCursor; if( argc<1 ) return; if( sqlite3_value_type(argv[0])!=SQLITE_BLOB || sqlite3_value_bytes(argv[0])!=sizeof(pCursor) ){ sqlite3_result_error(pContext, "illegal first argument to html_snippet",-1); }else{ const char *zStart = ""; const char *zEnd = ""; const char *zEllipsis = "..."; memcpy(&pCursor, sqlite3_value_blob(argv[0]), sizeof(pCursor)); if( argc>=2 ){ zStart = (const char*)sqlite3_value_text(argv[1]); if( argc>=3 ){ zEnd = (const char*)sqlite3_value_text(argv[2]); if( argc>=4 ){ zEllipsis = (const char*)sqlite3_value_text(argv[3]); } } } snippetAllOffsets(pCursor); snippetText(pCursor, zStart, zEnd, zEllipsis); sqlite3_result_text(pContext, pCursor->snippet.zSnippet, pCursor->snippet.nSnippet, SQLITE_STATIC); } } /* ** Implementation of the offsets() function for FTS1 */ static void snippetOffsetsFunc( sqlite3_context *pContext, int argc, sqlite3_value **argv ){ fulltext_cursor *pCursor; if( argc<1 ) return; if( sqlite3_value_type(argv[0])!=SQLITE_BLOB || sqlite3_value_bytes(argv[0])!=sizeof(pCursor) ){ sqlite3_result_error(pContext, "illegal first argument to offsets",-1); }else{ memcpy(&pCursor, sqlite3_value_blob(argv[0]), sizeof(pCursor)); snippetAllOffsets(pCursor); snippetOffsetText(&pCursor->snippet); sqlite3_result_text(pContext, pCursor->snippet.zOffset, pCursor->snippet.nOffset, SQLITE_STATIC); } } /* ** This routine implements the xFindFunction method for the FTS1 ** virtual table. */ static int fulltextFindFunction( sqlite3_vtab *pVtab, int nArg, const char *zName, void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), void **ppArg ){ if( strcmp(zName,"snippet")==0 ){ *pxFunc = snippetFunc; return 1; }else if( strcmp(zName,"offsets")==0 ){ *pxFunc = snippetOffsetsFunc; return 1; } return 0; } /* ** Rename an fts1 table. */ static int fulltextRename( sqlite3_vtab *pVtab, const char *zName ){ fulltext_vtab *p = (fulltext_vtab *)pVtab; int rc = SQLITE_NOMEM; char *zSql = sqlite3_mprintf( "ALTER TABLE %Q.'%q_content' RENAME TO '%q_content';" "ALTER TABLE %Q.'%q_term' RENAME TO '%q_term';" , p->zDb, p->zName, zName , p->zDb, p->zName, zName ); if( zSql ){ rc = sqlite3_exec(p->db, zSql, 0, 0, 0); sqlite3_free(zSql); } return rc; } static const sqlite3_module fulltextModule = { /* iVersion */ 0, /* xCreate */ fulltextCreate, /* xConnect */ fulltextConnect, /* xBestIndex */ fulltextBestIndex, /* xDisconnect */ fulltextDisconnect, /* xDestroy */ fulltextDestroy, /* xOpen */ fulltextOpen, /* xClose */ fulltextClose, /* xFilter */ fulltextFilter, /* xNext */ fulltextNext, /* xEof */ fulltextEof, /* xColumn */ fulltextColumn, /* xRowid */ fulltextRowid, /* xUpdate */ fulltextUpdate, /* xBegin */ 0, /* xSync */ 0, /* xCommit */ 0, /* xRollback */ 0, /* xFindFunction */ fulltextFindFunction, /* xRename */ fulltextRename, }; int sqlite3Fts1Init(sqlite3 *db){ sqlite3_overload_function(db, "snippet", -1); sqlite3_overload_function(db, "offsets", -1); return sqlite3_create_module(db, "fts1", &fulltextModule, 0); } #if !SQLITE_CORE #ifdef _WIN32 __declspec(dllexport) #endif int sqlite3_fts1_init(sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi){ SQLITE_EXTENSION_INIT2(pApi) return sqlite3Fts1Init(db); } #endif #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS1) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts1/fts1.h ================================================ #include "sqlite3.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ int sqlite3Fts1Init(sqlite3 *db); #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ ================================================ FILE: v2/testdata/_sqlite/ext/fts1/fts1_hash.c ================================================ /* ** 2001 September 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the implementation of generic hash-tables used in SQLite. ** We've modified it slightly to serve as a standalone hash table ** implementation for the full-text indexing module. */ #include #include #include /* ** The code in this file is only compiled if: ** ** * The FTS1 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS1 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS1 is defined). */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS1) #include "fts1_hash.h" static void *malloc_and_zero(int n){ void *p = malloc(n); if( p ){ memset(p, 0, n); } return p; } /* Turn bulk memory into a hash table object by initializing the ** fields of the Hash structure. ** ** "pNew" is a pointer to the hash table that is to be initialized. ** keyClass is one of the constants ** FTS1_HASH_BINARY or FTS1_HASH_STRING. The value of keyClass ** determines what kind of key the hash table will use. "copyKey" is ** true if the hash table should make its own private copy of keys and ** false if it should just use the supplied pointer. */ void sqlite3Fts1HashInit(fts1Hash *pNew, int keyClass, int copyKey){ assert( pNew!=0 ); assert( keyClass>=FTS1_HASH_STRING && keyClass<=FTS1_HASH_BINARY ); pNew->keyClass = keyClass; pNew->copyKey = copyKey; pNew->first = 0; pNew->count = 0; pNew->htsize = 0; pNew->ht = 0; pNew->xMalloc = malloc_and_zero; pNew->xFree = free; } /* Remove all entries from a hash table. Reclaim all memory. ** Call this routine to delete a hash table or to reset a hash table ** to the empty state. */ void sqlite3Fts1HashClear(fts1Hash *pH){ fts1HashElem *elem; /* For looping over all elements of the table */ assert( pH!=0 ); elem = pH->first; pH->first = 0; if( pH->ht ) pH->xFree(pH->ht); pH->ht = 0; pH->htsize = 0; while( elem ){ fts1HashElem *next_elem = elem->next; if( pH->copyKey && elem->pKey ){ pH->xFree(elem->pKey); } pH->xFree(elem); elem = next_elem; } pH->count = 0; } /* ** Hash and comparison functions when the mode is FTS1_HASH_STRING */ static int strHash(const void *pKey, int nKey){ const char *z = (const char *)pKey; int h = 0; if( nKey<=0 ) nKey = (int) strlen(z); while( nKey > 0 ){ h = (h<<3) ^ h ^ *z++; nKey--; } return h & 0x7fffffff; } static int strCompare(const void *pKey1, int n1, const void *pKey2, int n2){ if( n1!=n2 ) return 1; return strncmp((const char*)pKey1,(const char*)pKey2,n1); } /* ** Hash and comparison functions when the mode is FTS1_HASH_BINARY */ static int binHash(const void *pKey, int nKey){ int h = 0; const char *z = (const char *)pKey; while( nKey-- > 0 ){ h = (h<<3) ^ h ^ *(z++); } return h & 0x7fffffff; } static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){ if( n1!=n2 ) return 1; return memcmp(pKey1,pKey2,n1); } /* ** Return a pointer to the appropriate hash function given the key class. ** ** The C syntax in this function definition may be unfamilar to some ** programmers, so we provide the following additional explanation: ** ** The name of the function is "hashFunction". The function takes a ** single parameter "keyClass". The return value of hashFunction() ** is a pointer to another function. Specifically, the return value ** of hashFunction() is a pointer to a function that takes two parameters ** with types "const void*" and "int" and returns an "int". */ static int (*hashFunction(int keyClass))(const void*,int){ if( keyClass==FTS1_HASH_STRING ){ return &strHash; }else{ assert( keyClass==FTS1_HASH_BINARY ); return &binHash; } } /* ** Return a pointer to the appropriate hash function given the key class. ** ** For help in interpreted the obscure C code in the function definition, ** see the header comment on the previous function. */ static int (*compareFunction(int keyClass))(const void*,int,const void*,int){ if( keyClass==FTS1_HASH_STRING ){ return &strCompare; }else{ assert( keyClass==FTS1_HASH_BINARY ); return &binCompare; } } /* Link an element into the hash table */ static void insertElement( fts1Hash *pH, /* The complete hash table */ struct _fts1ht *pEntry, /* The entry into which pNew is inserted */ fts1HashElem *pNew /* The element to be inserted */ ){ fts1HashElem *pHead; /* First element already in pEntry */ pHead = pEntry->chain; if( pHead ){ pNew->next = pHead; pNew->prev = pHead->prev; if( pHead->prev ){ pHead->prev->next = pNew; } else { pH->first = pNew; } pHead->prev = pNew; }else{ pNew->next = pH->first; if( pH->first ){ pH->first->prev = pNew; } pNew->prev = 0; pH->first = pNew; } pEntry->count++; pEntry->chain = pNew; } /* Resize the hash table so that it cantains "new_size" buckets. ** "new_size" must be a power of 2. The hash table might fail ** to resize if sqliteMalloc() fails. */ static void rehash(fts1Hash *pH, int new_size){ struct _fts1ht *new_ht; /* The new hash table */ fts1HashElem *elem, *next_elem; /* For looping over existing elements */ int (*xHash)(const void*,int); /* The hash function */ assert( (new_size & (new_size-1))==0 ); new_ht = (struct _fts1ht *)pH->xMalloc( new_size*sizeof(struct _fts1ht) ); if( new_ht==0 ) return; if( pH->ht ) pH->xFree(pH->ht); pH->ht = new_ht; pH->htsize = new_size; xHash = hashFunction(pH->keyClass); for(elem=pH->first, pH->first=0; elem; elem = next_elem){ int h = (*xHash)(elem->pKey, elem->nKey) & (new_size-1); next_elem = elem->next; insertElement(pH, &new_ht[h], elem); } } /* This function (for internal use only) locates an element in an ** hash table that matches the given key. The hash for this key has ** already been computed and is passed as the 4th parameter. */ static fts1HashElem *findElementGivenHash( const fts1Hash *pH, /* The pH to be searched */ const void *pKey, /* The key we are searching for */ int nKey, int h /* The hash for this key. */ ){ fts1HashElem *elem; /* Used to loop thru the element list */ int count; /* Number of elements left to test */ int (*xCompare)(const void*,int,const void*,int); /* comparison function */ if( pH->ht ){ struct _fts1ht *pEntry = &pH->ht[h]; elem = pEntry->chain; count = pEntry->count; xCompare = compareFunction(pH->keyClass); while( count-- && elem ){ if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ return elem; } elem = elem->next; } } return 0; } /* Remove a single entry from the hash table given a pointer to that ** element and a hash on the element's key. */ static void removeElementGivenHash( fts1Hash *pH, /* The pH containing "elem" */ fts1HashElem* elem, /* The element to be removed from the pH */ int h /* Hash value for the element */ ){ struct _fts1ht *pEntry; if( elem->prev ){ elem->prev->next = elem->next; }else{ pH->first = elem->next; } if( elem->next ){ elem->next->prev = elem->prev; } pEntry = &pH->ht[h]; if( pEntry->chain==elem ){ pEntry->chain = elem->next; } pEntry->count--; if( pEntry->count<=0 ){ pEntry->chain = 0; } if( pH->copyKey && elem->pKey ){ pH->xFree(elem->pKey); } pH->xFree( elem ); pH->count--; if( pH->count<=0 ){ assert( pH->first==0 ); assert( pH->count==0 ); fts1HashClear(pH); } } /* Attempt to locate an element of the hash table pH with a key ** that matches pKey,nKey. Return the data for this element if it is ** found, or NULL if there is no match. */ void *sqlite3Fts1HashFind(const fts1Hash *pH, const void *pKey, int nKey){ int h; /* A hash on key */ fts1HashElem *elem; /* The element that matches key */ int (*xHash)(const void*,int); /* The hash function */ if( pH==0 || pH->ht==0 ) return 0; xHash = hashFunction(pH->keyClass); assert( xHash!=0 ); h = (*xHash)(pKey,nKey); assert( (pH->htsize & (pH->htsize-1))==0 ); elem = findElementGivenHash(pH,pKey,nKey, h & (pH->htsize-1)); return elem ? elem->data : 0; } /* Insert an element into the hash table pH. The key is pKey,nKey ** and the data is "data". ** ** If no element exists with a matching key, then a new ** element is created. A copy of the key is made if the copyKey ** flag is set. NULL is returned. ** ** If another element already exists with the same key, then the ** new data replaces the old data and the old data is returned. ** The key is not copied in this instance. If a malloc fails, then ** the new data is returned and the hash table is unchanged. ** ** If the "data" parameter to this function is NULL, then the ** element corresponding to "key" is removed from the hash table. */ void *sqlite3Fts1HashInsert( fts1Hash *pH, /* The hash table to insert into */ const void *pKey, /* The key */ int nKey, /* Number of bytes in the key */ void *data /* The data */ ){ int hraw; /* Raw hash value of the key */ int h; /* the hash of the key modulo hash table size */ fts1HashElem *elem; /* Used to loop thru the element list */ fts1HashElem *new_elem; /* New element added to the pH */ int (*xHash)(const void*,int); /* The hash function */ assert( pH!=0 ); xHash = hashFunction(pH->keyClass); assert( xHash!=0 ); hraw = (*xHash)(pKey, nKey); assert( (pH->htsize & (pH->htsize-1))==0 ); h = hraw & (pH->htsize-1); elem = findElementGivenHash(pH,pKey,nKey,h); if( elem ){ void *old_data = elem->data; if( data==0 ){ removeElementGivenHash(pH,elem,h); }else{ elem->data = data; } return old_data; } if( data==0 ) return 0; new_elem = (fts1HashElem*)pH->xMalloc( sizeof(fts1HashElem) ); if( new_elem==0 ) return data; if( pH->copyKey && pKey!=0 ){ new_elem->pKey = pH->xMalloc( nKey ); if( new_elem->pKey==0 ){ pH->xFree(new_elem); return data; } memcpy((void*)new_elem->pKey, pKey, nKey); }else{ new_elem->pKey = (void*)pKey; } new_elem->nKey = nKey; pH->count++; if( pH->htsize==0 ){ rehash(pH,8); if( pH->htsize==0 ){ pH->count = 0; pH->xFree(new_elem); return data; } } if( pH->count > pH->htsize ){ rehash(pH,pH->htsize*2); } assert( pH->htsize>0 ); assert( (pH->htsize & (pH->htsize-1))==0 ); h = hraw & (pH->htsize-1); insertElement(pH, &pH->ht[h], new_elem); new_elem->data = data; return 0; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS1) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts1/fts1_hash.h ================================================ /* ** 2001 September 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the header file for the generic hash-table implementation ** used in SQLite. We've modified it slightly to serve as a standalone ** hash table implementation for the full-text indexing module. ** */ #ifndef _FTS1_HASH_H_ #define _FTS1_HASH_H_ /* Forward declarations of structures. */ typedef struct fts1Hash fts1Hash; typedef struct fts1HashElem fts1HashElem; /* A complete hash table is an instance of the following structure. ** The internals of this structure are intended to be opaque -- client ** code should not attempt to access or modify the fields of this structure ** directly. Change this structure only by using the routines below. ** However, many of the "procedures" and "functions" for modifying and ** accessing this structure are really macros, so we can't really make ** this structure opaque. */ struct fts1Hash { char keyClass; /* HASH_INT, _POINTER, _STRING, _BINARY */ char copyKey; /* True if copy of key made on insert */ int count; /* Number of entries in this table */ fts1HashElem *first; /* The first element of the array */ void *(*xMalloc)(int); /* malloc() function to use */ void (*xFree)(void *); /* free() function to use */ int htsize; /* Number of buckets in the hash table */ struct _fts1ht { /* the hash table */ int count; /* Number of entries with this hash */ fts1HashElem *chain; /* Pointer to first entry with this hash */ } *ht; }; /* Each element in the hash table is an instance of the following ** structure. All elements are stored on a single doubly-linked list. ** ** Again, this structure is intended to be opaque, but it can't really ** be opaque because it is used by macros. */ struct fts1HashElem { fts1HashElem *next, *prev; /* Next and previous elements in the table */ void *data; /* Data associated with this element */ void *pKey; int nKey; /* Key associated with this element */ }; /* ** There are 2 different modes of operation for a hash table: ** ** FTS1_HASH_STRING pKey points to a string that is nKey bytes long ** (including the null-terminator, if any). Case ** is respected in comparisons. ** ** FTS1_HASH_BINARY pKey points to binary data nKey bytes long. ** memcmp() is used to compare keys. ** ** A copy of the key is made if the copyKey parameter to fts1HashInit is 1. */ #define FTS1_HASH_STRING 1 #define FTS1_HASH_BINARY 2 /* ** Access routines. To delete, insert a NULL pointer. */ void sqlite3Fts1HashInit(fts1Hash*, int keytype, int copyKey); void *sqlite3Fts1HashInsert(fts1Hash*, const void *pKey, int nKey, void *pData); void *sqlite3Fts1HashFind(const fts1Hash*, const void *pKey, int nKey); void sqlite3Fts1HashClear(fts1Hash*); /* ** Shorthand for the functions above */ #define fts1HashInit sqlite3Fts1HashInit #define fts1HashInsert sqlite3Fts1HashInsert #define fts1HashFind sqlite3Fts1HashFind #define fts1HashClear sqlite3Fts1HashClear /* ** Macros for looping over all elements of a hash table. The idiom is ** like this: ** ** fts1Hash h; ** fts1HashElem *p; ** ... ** for(p=fts1HashFirst(&h); p; p=fts1HashNext(p)){ ** SomeStructure *pData = fts1HashData(p); ** // do something with pData ** } */ #define fts1HashFirst(H) ((H)->first) #define fts1HashNext(E) ((E)->next) #define fts1HashData(E) ((E)->data) #define fts1HashKey(E) ((E)->pKey) #define fts1HashKeysize(E) ((E)->nKey) /* ** Number of entries in a hash table */ #define fts1HashCount(H) ((H)->count) #endif /* _FTS1_HASH_H_ */ ================================================ FILE: v2/testdata/_sqlite/ext/fts1/fts1_porter.c ================================================ /* ** 2006 September 30 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Implementation of the full-text-search tokenizer that implements ** a Porter stemmer. */ /* ** The code in this file is only compiled if: ** ** * The FTS1 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS1 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS1 is defined). */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS1) #include #include #include #include #include #include "fts1_tokenizer.h" /* ** Class derived from sqlite3_tokenizer */ typedef struct porter_tokenizer { sqlite3_tokenizer base; /* Base class */ } porter_tokenizer; /* ** Class derived from sqlit3_tokenizer_cursor */ typedef struct porter_tokenizer_cursor { sqlite3_tokenizer_cursor base; const char *zInput; /* input we are tokenizing */ int nInput; /* size of the input */ int iOffset; /* current position in zInput */ int iToken; /* index of next token to be returned */ char *zToken; /* storage for current token */ int nAllocated; /* space allocated to zToken buffer */ } porter_tokenizer_cursor; /* Forward declaration */ static const sqlite3_tokenizer_module porterTokenizerModule; /* ** Create a new tokenizer instance. */ static int porterCreate( int argc, const char * const *argv, sqlite3_tokenizer **ppTokenizer ){ porter_tokenizer *t; t = (porter_tokenizer *) calloc(sizeof(*t), 1); if( t==NULL ) return SQLITE_NOMEM; *ppTokenizer = &t->base; return SQLITE_OK; } /* ** Destroy a tokenizer */ static int porterDestroy(sqlite3_tokenizer *pTokenizer){ free(pTokenizer); return SQLITE_OK; } /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is zInput[0..nInput-1]. A cursor ** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int porterOpen( sqlite3_tokenizer *pTokenizer, /* The tokenizer */ const char *zInput, int nInput, /* String to be tokenized */ sqlite3_tokenizer_cursor **ppCursor /* OUT: Tokenization cursor */ ){ porter_tokenizer_cursor *c; c = (porter_tokenizer_cursor *) malloc(sizeof(*c)); if( c==NULL ) return SQLITE_NOMEM; c->zInput = zInput; if( zInput==0 ){ c->nInput = 0; }else if( nInput<0 ){ c->nInput = (int)strlen(zInput); }else{ c->nInput = nInput; } c->iOffset = 0; /* start tokenizing at the beginning */ c->iToken = 0; c->zToken = NULL; /* no space allocated, yet. */ c->nAllocated = 0; *ppCursor = &c->base; return SQLITE_OK; } /* ** Close a tokenization cursor previously opened by a call to ** porterOpen() above. */ static int porterClose(sqlite3_tokenizer_cursor *pCursor){ porter_tokenizer_cursor *c = (porter_tokenizer_cursor *) pCursor; free(c->zToken); free(c); return SQLITE_OK; } /* ** Vowel or consonant */ static const char cType[] = { 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1 }; /* ** isConsonant() and isVowel() determine if their first character in ** the string they point to is a consonant or a vowel, according ** to Porter ruls. ** ** A consonate is any letter other than 'a', 'e', 'i', 'o', or 'u'. ** 'Y' is a consonant unless it follows another consonant, ** in which case it is a vowel. ** ** In these routine, the letters are in reverse order. So the 'y' rule ** is that 'y' is a consonant unless it is followed by another ** consonent. */ static int isVowel(const char*); static int isConsonant(const char *z){ int j; char x = *z; if( x==0 ) return 0; assert( x>='a' && x<='z' ); j = cType[x-'a']; if( j<2 ) return j; return z[1]==0 || isVowel(z + 1); } static int isVowel(const char *z){ int j; char x = *z; if( x==0 ) return 0; assert( x>='a' && x<='z' ); j = cType[x-'a']; if( j<2 ) return 1-j; return isConsonant(z + 1); } /* ** Let any sequence of one or more vowels be represented by V and let ** C be sequence of one or more consonants. Then every word can be ** represented as: ** ** [C] (VC){m} [V] ** ** In prose: A word is an optional consonant followed by zero or ** vowel-consonant pairs followed by an optional vowel. "m" is the ** number of vowel consonant pairs. This routine computes the value ** of m for the first i bytes of a word. ** ** Return true if the m-value for z is 1 or more. In other words, ** return true if z contains at least one vowel that is followed ** by a consonant. ** ** In this routine z[] is in reverse order. So we are really looking ** for an instance of of a consonant followed by a vowel. */ static int m_gt_0(const char *z){ while( isVowel(z) ){ z++; } if( *z==0 ) return 0; while( isConsonant(z) ){ z++; } return *z!=0; } /* Like mgt0 above except we are looking for a value of m which is ** exactly 1 */ static int m_eq_1(const char *z){ while( isVowel(z) ){ z++; } if( *z==0 ) return 0; while( isConsonant(z) ){ z++; } if( *z==0 ) return 0; while( isVowel(z) ){ z++; } if( *z==0 ) return 1; while( isConsonant(z) ){ z++; } return *z==0; } /* Like mgt0 above except we are looking for a value of m>1 instead ** or m>0 */ static int m_gt_1(const char *z){ while( isVowel(z) ){ z++; } if( *z==0 ) return 0; while( isConsonant(z) ){ z++; } if( *z==0 ) return 0; while( isVowel(z) ){ z++; } if( *z==0 ) return 0; while( isConsonant(z) ){ z++; } return *z!=0; } /* ** Return TRUE if there is a vowel anywhere within z[0..n-1] */ static int hasVowel(const char *z){ while( isConsonant(z) ){ z++; } return *z!=0; } /* ** Return TRUE if the word ends in a double consonant. ** ** The text is reversed here. So we are really looking at ** the first two characters of z[]. */ static int doubleConsonant(const char *z){ return isConsonant(z) && z[0]==z[1] && isConsonant(z+1); } /* ** Return TRUE if the word ends with three letters which ** are consonant-vowel-consonent and where the final consonant ** is not 'w', 'x', or 'y'. ** ** The word is reversed here. So we are really checking the ** first three letters and the first one cannot be in [wxy]. */ static int star_oh(const char *z){ return z[0]!=0 && isConsonant(z) && z[0]!='w' && z[0]!='x' && z[0]!='y' && z[1]!=0 && isVowel(z+1) && z[2]!=0 && isConsonant(z+2); } /* ** If the word ends with zFrom and xCond() is true for the stem ** of the word that preceeds the zFrom ending, then change the ** ending to zTo. ** ** The input word *pz and zFrom are both in reverse order. zTo ** is in normal order. ** ** Return TRUE if zFrom matches. Return FALSE if zFrom does not ** match. Not that TRUE is returned even if xCond() fails and ** no substitution occurs. */ static int stem( char **pz, /* The word being stemmed (Reversed) */ const char *zFrom, /* If the ending matches this... (Reversed) */ const char *zTo, /* ... change the ending to this (not reversed) */ int (*xCond)(const char*) /* Condition that must be true */ ){ char *z = *pz; while( *zFrom && *zFrom==*z ){ z++; zFrom++; } if( *zFrom!=0 ) return 0; if( xCond && !xCond(z) ) return 1; while( *zTo ){ *(--z) = *(zTo++); } *pz = z; return 1; } /* ** This is the fallback stemmer used when the porter stemmer is ** inappropriate. The input word is copied into the output with ** US-ASCII case folding. If the input word is too long (more ** than 20 bytes if it contains no digits or more than 6 bytes if ** it contains digits) then word is truncated to 20 or 6 bytes ** by taking 10 or 3 bytes from the beginning and end. */ static void copy_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ int i, mx, j; int hasDigit = 0; for(i=0; i='A' && c<='Z' ){ zOut[i] = c - 'A' + 'a'; }else{ if( c>='0' && c<='9' ) hasDigit = 1; zOut[i] = c; } } mx = hasDigit ? 3 : 10; if( nIn>mx*2 ){ for(j=mx, i=nIn-mx; i=sizeof(zReverse)-7 ){ /* The word is too big or too small for the porter stemmer. ** Fallback to the copy stemmer */ copy_stemmer(zIn, nIn, zOut, pnOut); return; } for(i=0, j=sizeof(zReverse)-6; i='A' && c<='Z' ){ zReverse[j] = c + 'a' - 'A'; }else if( c>='a' && c<='z' ){ zReverse[j] = c; }else{ /* The use of a character not in [a-zA-Z] means that we fallback ** to the copy stemmer */ copy_stemmer(zIn, nIn, zOut, pnOut); return; } } memset(&zReverse[sizeof(zReverse)-5], 0, 5); z = &zReverse[j+1]; /* Step 1a */ if( z[0]=='s' ){ if( !stem(&z, "sess", "ss", 0) && !stem(&z, "sei", "i", 0) && !stem(&z, "ss", "ss", 0) ){ z++; } } /* Step 1b */ z2 = z; if( stem(&z, "dee", "ee", m_gt_0) ){ /* Do nothing. The work was all in the test */ }else if( (stem(&z, "gni", "", hasVowel) || stem(&z, "de", "", hasVowel)) && z!=z2 ){ if( stem(&z, "ta", "ate", 0) || stem(&z, "lb", "ble", 0) || stem(&z, "zi", "ize", 0) ){ /* Do nothing. The work was all in the test */ }else if( doubleConsonant(z) && (*z!='l' && *z!='s' && *z!='z') ){ z++; }else if( m_eq_1(z) && star_oh(z) ){ *(--z) = 'e'; } } /* Step 1c */ if( z[0]=='y' && hasVowel(z+1) ){ z[0] = 'i'; } /* Step 2 */ switch( z[1] ){ case 'a': stem(&z, "lanoita", "ate", m_gt_0) || stem(&z, "lanoit", "tion", m_gt_0); break; case 'c': stem(&z, "icne", "ence", m_gt_0) || stem(&z, "icna", "ance", m_gt_0); break; case 'e': stem(&z, "rezi", "ize", m_gt_0); break; case 'g': stem(&z, "igol", "log", m_gt_0); break; case 'l': stem(&z, "ilb", "ble", m_gt_0) || stem(&z, "illa", "al", m_gt_0) || stem(&z, "iltne", "ent", m_gt_0) || stem(&z, "ile", "e", m_gt_0) || stem(&z, "ilsuo", "ous", m_gt_0); break; case 'o': stem(&z, "noitazi", "ize", m_gt_0) || stem(&z, "noita", "ate", m_gt_0) || stem(&z, "rota", "ate", m_gt_0); break; case 's': stem(&z, "msila", "al", m_gt_0) || stem(&z, "ssenevi", "ive", m_gt_0) || stem(&z, "ssenluf", "ful", m_gt_0) || stem(&z, "ssensuo", "ous", m_gt_0); break; case 't': stem(&z, "itila", "al", m_gt_0) || stem(&z, "itivi", "ive", m_gt_0) || stem(&z, "itilib", "ble", m_gt_0); break; } /* Step 3 */ switch( z[0] ){ case 'e': stem(&z, "etaci", "ic", m_gt_0) || stem(&z, "evita", "", m_gt_0) || stem(&z, "ezila", "al", m_gt_0); break; case 'i': stem(&z, "itici", "ic", m_gt_0); break; case 'l': stem(&z, "laci", "ic", m_gt_0) || stem(&z, "luf", "", m_gt_0); break; case 's': stem(&z, "ssen", "", m_gt_0); break; } /* Step 4 */ switch( z[1] ){ case 'a': if( z[0]=='l' && m_gt_1(z+2) ){ z += 2; } break; case 'c': if( z[0]=='e' && z[2]=='n' && (z[3]=='a' || z[3]=='e') && m_gt_1(z+4) ){ z += 4; } break; case 'e': if( z[0]=='r' && m_gt_1(z+2) ){ z += 2; } break; case 'i': if( z[0]=='c' && m_gt_1(z+2) ){ z += 2; } break; case 'l': if( z[0]=='e' && z[2]=='b' && (z[3]=='a' || z[3]=='i') && m_gt_1(z+4) ){ z += 4; } break; case 'n': if( z[0]=='t' ){ if( z[2]=='a' ){ if( m_gt_1(z+3) ){ z += 3; } }else if( z[2]=='e' ){ stem(&z, "tneme", "", m_gt_1) || stem(&z, "tnem", "", m_gt_1) || stem(&z, "tne", "", m_gt_1); } } break; case 'o': if( z[0]=='u' ){ if( m_gt_1(z+2) ){ z += 2; } }else if( z[3]=='s' || z[3]=='t' ){ stem(&z, "noi", "", m_gt_1); } break; case 's': if( z[0]=='m' && z[2]=='i' && m_gt_1(z+3) ){ z += 3; } break; case 't': stem(&z, "eta", "", m_gt_1) || stem(&z, "iti", "", m_gt_1); break; case 'u': if( z[0]=='s' && z[2]=='o' && m_gt_1(z+3) ){ z += 3; } break; case 'v': case 'z': if( z[0]=='e' && z[2]=='i' && m_gt_1(z+3) ){ z += 3; } break; } /* Step 5a */ if( z[0]=='e' ){ if( m_gt_1(z+1) ){ z++; }else if( m_eq_1(z+1) && !star_oh(z+1) ){ z++; } } /* Step 5b */ if( m_gt_1(z) && z[0]=='l' && z[1]=='l' ){ z++; } /* z[] is now the stemmed word in reverse order. Flip it back ** around into forward order and return. */ *pnOut = i = strlen(z); zOut[i] = 0; while( *z ){ zOut[--i] = *(z++); } } /* ** Characters that can be part of a token. We assume any character ** whose value is greater than 0x80 (any UTF character) can be ** part of a token. In other words, delimiters all must have ** values of 0x7f or lower. */ static const char isIdChar[] = { /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 3x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 7x */ }; #define idChar(C) (((ch=C)&0x80)!=0 || (ch>0x2f && isIdChar[ch-0x30])) #define isDelim(C) (((ch=C)&0x80)==0 && (ch<0x30 || !isIdChar[ch-0x30])) /* ** Extract the next token from a tokenization cursor. The cursor must ** have been opened by a prior call to porterOpen(). */ static int porterNext( sqlite3_tokenizer_cursor *pCursor, /* Cursor returned by porterOpen */ const char **pzToken, /* OUT: *pzToken is the token text */ int *pnBytes, /* OUT: Number of bytes in token */ int *piStartOffset, /* OUT: Starting offset of token */ int *piEndOffset, /* OUT: Ending offset of token */ int *piPosition /* OUT: Position integer of token */ ){ porter_tokenizer_cursor *c = (porter_tokenizer_cursor *) pCursor; const char *z = c->zInput; while( c->iOffsetnInput ){ int iStartOffset, ch; /* Scan past delimiter characters */ while( c->iOffsetnInput && isDelim(z[c->iOffset]) ){ c->iOffset++; } /* Count non-delimiter characters. */ iStartOffset = c->iOffset; while( c->iOffsetnInput && !isDelim(z[c->iOffset]) ){ c->iOffset++; } if( c->iOffset>iStartOffset ){ int n = c->iOffset-iStartOffset; if( n>c->nAllocated ){ c->nAllocated = n+20; c->zToken = realloc(c->zToken, c->nAllocated); if( c->zToken==NULL ) return SQLITE_NOMEM; } porter_stemmer(&z[iStartOffset], n, c->zToken, pnBytes); *pzToken = c->zToken; *piStartOffset = iStartOffset; *piEndOffset = c->iOffset; *piPosition = c->iToken++; return SQLITE_OK; } } return SQLITE_DONE; } /* ** The set of routines that implement the porter-stemmer tokenizer */ static const sqlite3_tokenizer_module porterTokenizerModule = { 0, porterCreate, porterDestroy, porterOpen, porterClose, porterNext, }; /* ** Allocate a new porter tokenizer. Return a pointer to the new ** tokenizer in *ppModule */ void sqlite3Fts1PorterTokenizerModule( sqlite3_tokenizer_module const**ppModule ){ *ppModule = &porterTokenizerModule; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS1) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts1/fts1_tokenizer.h ================================================ /* ** 2006 July 10 ** ** The author disclaims copyright to this source code. ** ************************************************************************* ** Defines the interface to tokenizers used by fulltext-search. There ** are three basic components: ** ** sqlite3_tokenizer_module is a singleton defining the tokenizer ** interface functions. This is essentially the class structure for ** tokenizers. ** ** sqlite3_tokenizer is used to define a particular tokenizer, perhaps ** including customization information defined at creation time. ** ** sqlite3_tokenizer_cursor is generated by a tokenizer to generate ** tokens from a particular input. */ #ifndef _FTS1_TOKENIZER_H_ #define _FTS1_TOKENIZER_H_ /* TODO(shess) Only used for SQLITE_OK and SQLITE_DONE at this time. ** If tokenizers are to be allowed to call sqlite3_*() functions, then ** we will need a way to register the API consistently. */ #include "sqlite3.h" /* ** Structures used by the tokenizer interface. */ typedef struct sqlite3_tokenizer sqlite3_tokenizer; typedef struct sqlite3_tokenizer_cursor sqlite3_tokenizer_cursor; typedef struct sqlite3_tokenizer_module sqlite3_tokenizer_module; struct sqlite3_tokenizer_module { int iVersion; /* currently 0 */ /* ** Create and destroy a tokenizer. argc/argv are passed down from ** the fulltext virtual table creation to allow customization. */ int (*xCreate)(int argc, const char *const*argv, sqlite3_tokenizer **ppTokenizer); int (*xDestroy)(sqlite3_tokenizer *pTokenizer); /* ** Tokenize a particular input. Call xOpen() to prepare to ** tokenize, xNext() repeatedly until it returns SQLITE_DONE, then ** xClose() to free any internal state. The pInput passed to ** xOpen() must exist until the cursor is closed. The ppToken ** result from xNext() is only valid until the next call to xNext() ** or until xClose() is called. */ /* TODO(shess) current implementation requires pInput to be ** nul-terminated. This should either be fixed, or pInput/nBytes ** should be converted to zInput. */ int (*xOpen)(sqlite3_tokenizer *pTokenizer, const char *pInput, int nBytes, sqlite3_tokenizer_cursor **ppCursor); int (*xClose)(sqlite3_tokenizer_cursor *pCursor); int (*xNext)(sqlite3_tokenizer_cursor *pCursor, const char **ppToken, int *pnBytes, int *piStartOffset, int *piEndOffset, int *piPosition); }; struct sqlite3_tokenizer { const sqlite3_tokenizer_module *pModule; /* The module for this tokenizer */ /* Tokenizer implementations will typically add additional fields */ }; struct sqlite3_tokenizer_cursor { sqlite3_tokenizer *pTokenizer; /* Tokenizer for this cursor. */ /* Tokenizer implementations will typically add additional fields */ }; /* ** Get the module for a tokenizer which generates tokens based on a ** set of non-token characters. The default is to break tokens at any ** non-alnum character, though the set of delimiters can also be ** specified by the first argv argument to xCreate(). */ /* TODO(shess) This doesn't belong here. Need some sort of ** registration process. */ void sqlite3Fts1SimpleTokenizerModule(sqlite3_tokenizer_module const**ppModule); void sqlite3Fts1PorterTokenizerModule(sqlite3_tokenizer_module const**ppModule); #endif /* _FTS1_TOKENIZER_H_ */ ================================================ FILE: v2/testdata/_sqlite/ext/fts1/fts1_tokenizer1.c ================================================ /* ** The author disclaims copyright to this source code. ** ************************************************************************* ** Implementation of the "simple" full-text-search tokenizer. */ /* ** The code in this file is only compiled if: ** ** * The FTS1 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS1 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS1 is defined). */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS1) #include #include #include #include #include #include "fts1_tokenizer.h" typedef struct simple_tokenizer { sqlite3_tokenizer base; char delim[128]; /* flag ASCII delimiters */ } simple_tokenizer; typedef struct simple_tokenizer_cursor { sqlite3_tokenizer_cursor base; const char *pInput; /* input we are tokenizing */ int nBytes; /* size of the input */ int iOffset; /* current position in pInput */ int iToken; /* index of next token to be returned */ char *pToken; /* storage for current token */ int nTokenAllocated; /* space allocated to zToken buffer */ } simple_tokenizer_cursor; /* Forward declaration */ static const sqlite3_tokenizer_module simpleTokenizerModule; static int isDelim(simple_tokenizer *t, unsigned char c){ return c<0x80 && t->delim[c]; } /* ** Create a new tokenizer instance. */ static int simpleCreate( int argc, const char * const *argv, sqlite3_tokenizer **ppTokenizer ){ simple_tokenizer *t; t = (simple_tokenizer *) calloc(sizeof(*t), 1); if( t==NULL ) return SQLITE_NOMEM; /* TODO(shess) Delimiters need to remain the same from run to run, ** else we need to reindex. One solution would be a meta-table to ** track such information in the database, then we'd only want this ** information on the initial create. */ if( argc>1 ){ int i, n = strlen(argv[1]); for(i=0; i=0x80 ){ free(t); return SQLITE_ERROR; } t->delim[ch] = 1; } } else { /* Mark non-alphanumeric ASCII characters as delimiters */ int i; for(i=1; i<0x80; i++){ t->delim[i] = !isalnum(i); } } *ppTokenizer = &t->base; return SQLITE_OK; } /* ** Destroy a tokenizer */ static int simpleDestroy(sqlite3_tokenizer *pTokenizer){ free(pTokenizer); return SQLITE_OK; } /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is pInput[0..nBytes-1]. A cursor ** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int simpleOpen( sqlite3_tokenizer *pTokenizer, /* The tokenizer */ const char *pInput, int nBytes, /* String to be tokenized */ sqlite3_tokenizer_cursor **ppCursor /* OUT: Tokenization cursor */ ){ simple_tokenizer_cursor *c; c = (simple_tokenizer_cursor *) malloc(sizeof(*c)); if( c==NULL ) return SQLITE_NOMEM; c->pInput = pInput; if( pInput==0 ){ c->nBytes = 0; }else if( nBytes<0 ){ c->nBytes = (int)strlen(pInput); }else{ c->nBytes = nBytes; } c->iOffset = 0; /* start tokenizing at the beginning */ c->iToken = 0; c->pToken = NULL; /* no space allocated, yet. */ c->nTokenAllocated = 0; *ppCursor = &c->base; return SQLITE_OK; } /* ** Close a tokenization cursor previously opened by a call to ** simpleOpen() above. */ static int simpleClose(sqlite3_tokenizer_cursor *pCursor){ simple_tokenizer_cursor *c = (simple_tokenizer_cursor *) pCursor; free(c->pToken); free(c); return SQLITE_OK; } /* ** Extract the next token from a tokenization cursor. The cursor must ** have been opened by a prior call to simpleOpen(). */ static int simpleNext( sqlite3_tokenizer_cursor *pCursor, /* Cursor returned by simpleOpen */ const char **ppToken, /* OUT: *ppToken is the token text */ int *pnBytes, /* OUT: Number of bytes in token */ int *piStartOffset, /* OUT: Starting offset of token */ int *piEndOffset, /* OUT: Ending offset of token */ int *piPosition /* OUT: Position integer of token */ ){ simple_tokenizer_cursor *c = (simple_tokenizer_cursor *) pCursor; simple_tokenizer *t = (simple_tokenizer *) pCursor->pTokenizer; unsigned char *p = (unsigned char *)c->pInput; while( c->iOffsetnBytes ){ int iStartOffset; /* Scan past delimiter characters */ while( c->iOffsetnBytes && isDelim(t, p[c->iOffset]) ){ c->iOffset++; } /* Count non-delimiter characters. */ iStartOffset = c->iOffset; while( c->iOffsetnBytes && !isDelim(t, p[c->iOffset]) ){ c->iOffset++; } if( c->iOffset>iStartOffset ){ int i, n = c->iOffset-iStartOffset; if( n>c->nTokenAllocated ){ c->nTokenAllocated = n+20; c->pToken = realloc(c->pToken, c->nTokenAllocated); if( c->pToken==NULL ) return SQLITE_NOMEM; } for(i=0; ipToken[i] = ch<0x80 ? tolower(ch) : ch; } *ppToken = c->pToken; *pnBytes = n; *piStartOffset = iStartOffset; *piEndOffset = c->iOffset; *piPosition = c->iToken++; return SQLITE_OK; } } return SQLITE_DONE; } /* ** The set of routines that implement the simple tokenizer */ static const sqlite3_tokenizer_module simpleTokenizerModule = { 0, simpleCreate, simpleDestroy, simpleOpen, simpleClose, simpleNext, }; /* ** Allocate a new simple tokenizer. Return a pointer to the new ** tokenizer in *ppModule */ void sqlite3Fts1SimpleTokenizerModule( sqlite3_tokenizer_module const**ppModule ){ *ppModule = &simpleTokenizerModule; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS1) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts1/fulltext.c ================================================ /* The author disclaims copyright to this source code. * * This is an SQLite module implementing full-text search. */ #include #if !defined(__APPLE__) #include #else #include #endif #include #include #include #include "fulltext.h" #include "ft_hash.h" #include "tokenizer.h" #include "sqlite3.h" #include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 /* utility functions */ /* We encode variable-length integers in little-endian order using seven bits * per byte as follows: ** ** KEY: ** A = 0xxxxxxx 7 bits of data and one flag bit ** B = 1xxxxxxx 7 bits of data and one flag bit ** ** 7 bits - A ** 14 bits - BA ** 21 bits - BBA ** and so on. */ /* We may need up to VARINT_MAX bytes to store an encoded 64-bit integer. */ #define VARINT_MAX 10 /* Write a 64-bit variable-length integer to memory starting at p[0]. * The length of data written will be between 1 and VARINT_MAX bytes. * The number of bytes written is returned. */ static int putVarint(char *p, sqlite_int64 v){ unsigned char *q = (unsigned char *) p; sqlite_uint64 vu = v; do{ *q++ = (unsigned char) ((vu & 0x7f) | 0x80); vu >>= 7; }while( vu!=0 ); q[-1] &= 0x7f; /* turn off high bit in final byte */ assert( q - (unsigned char *)p <= VARINT_MAX ); return (int) (q - (unsigned char *)p); } /* Read a 64-bit variable-length integer from memory starting at p[0]. * Return the number of bytes read, or 0 on error. * The value is stored in *v. */ static int getVarint(const char *p, sqlite_int64 *v){ const unsigned char *q = (const unsigned char *) p; sqlite_uint64 x = 0, y = 1; while( (*q & 0x80) == 0x80 ){ x += y * (*q++ & 0x7f); y <<= 7; if( q - (unsigned char *)p >= VARINT_MAX ){ /* bad data */ assert( 0 ); return 0; } } x += y * (*q++); *v = (sqlite_int64) x; return (int) (q - (unsigned char *)p); } static int getVarint32(const char *p, int *pi){ sqlite_int64 i; int ret = getVarint(p, &i); *pi = (int) i; assert( *pi==i ); return ret; } /*** Document lists *** * * A document list holds a sorted list of varint-encoded document IDs. * * A doclist with type DL_POSITIONS_OFFSETS is stored like this: * * array { * varint docid; * array { * varint position; (delta from previous position plus 1, or 0 for end) * varint startOffset; (delta from previous startOffset) * varint endOffset; (delta from startOffset) * } * } * * Here, array { X } means zero or more occurrences of X, adjacent in memory. * * A doclist with type DL_POSITIONS is like the above, but holds only docids * and positions without offset information. * * A doclist with type DL_DOCIDS is like the above, but holds only docids * without positions or offset information. * * On disk, every document list has positions and offsets, so we don't bother * to serialize a doclist's type. * * We don't yet delta-encode document IDs; doing so will probably be a * modest win. * * NOTE(shess) I've thought of a slightly (1%) better offset encoding. * After the first offset, estimate the next offset by using the * current token position and the previous token position and offset, * offset to handle some variance. So the estimate would be * (iPosition*w->iStartOffset/w->iPosition-64), which is delta-encoded * as normal. Offsets more than 64 chars from the estimate are * encoded as the delta to the previous start offset + 128. An * additional tiny increment can be gained by using the end offset of * the previous token to make the estimate a tiny bit more precise. */ typedef enum DocListType { DL_DOCIDS, /* docids only */ DL_POSITIONS, /* docids + positions */ DL_POSITIONS_OFFSETS /* docids + positions + offsets */ } DocListType; typedef struct DocList { char *pData; int nData; DocListType iType; int iLastPos; /* the last position written */ int iLastOffset; /* the last start offset written */ } DocList; /* Initialize a new DocList to hold the given data. */ static void docListInit(DocList *d, DocListType iType, const char *pData, int nData){ d->nData = nData; if( nData>0 ){ d->pData = malloc(nData); memcpy(d->pData, pData, nData); } else { d->pData = NULL; } d->iType = iType; d->iLastPos = 0; d->iLastOffset = 0; } /* Create a new dynamically-allocated DocList. */ static DocList *docListNew(DocListType iType){ DocList *d = (DocList *) malloc(sizeof(DocList)); docListInit(d, iType, 0, 0); return d; } static void docListDestroy(DocList *d){ free(d->pData); #ifndef NDEBUG memset(d, 0x55, sizeof(*d)); #endif } static void docListDelete(DocList *d){ docListDestroy(d); free(d); } static char *docListEnd(DocList *d){ return d->pData + d->nData; } /* Append a varint to a DocList's data. */ static void appendVarint(DocList *d, sqlite_int64 i){ char c[VARINT_MAX]; int n = putVarint(c, i); d->pData = realloc(d->pData, d->nData + n); memcpy(d->pData + d->nData, c, n); d->nData += n; } static void docListAddDocid(DocList *d, sqlite_int64 iDocid){ appendVarint(d, iDocid); d->iLastPos = 0; } /* Add a position to the last position list in a doclist. */ static void docListAddPos(DocList *d, int iPos){ assert( d->iType>=DL_POSITIONS ); appendVarint(d, iPos-d->iLastPos+1); d->iLastPos = iPos; } static void docListAddPosOffset(DocList *d, int iPos, int iStartOffset, int iEndOffset){ assert( d->iType==DL_POSITIONS_OFFSETS ); docListAddPos(d, iPos); appendVarint(d, iStartOffset-d->iLastOffset); d->iLastOffset = iStartOffset; appendVarint(d, iEndOffset-iStartOffset); } /* Terminate the last position list in the given doclist. */ static void docListAddEndPos(DocList *d){ appendVarint(d, 0); } typedef struct DocListReader { DocList *pDoclist; char *p; int iLastPos; /* the last position read */ } DocListReader; static void readerInit(DocListReader *r, DocList *pDoclist){ r->pDoclist = pDoclist; if( pDoclist!=NULL ){ r->p = pDoclist->pData; } r->iLastPos = 0; } static int readerAtEnd(DocListReader *pReader){ return pReader->p >= docListEnd(pReader->pDoclist); } /* Peek at the next docid without advancing the read pointer. */ static sqlite_int64 peekDocid(DocListReader *pReader){ sqlite_int64 ret; assert( !readerAtEnd(pReader) ); getVarint(pReader->p, &ret); return ret; } /* Read the next docid. */ static sqlite_int64 readDocid(DocListReader *pReader){ sqlite_int64 ret; assert( !readerAtEnd(pReader) ); pReader->p += getVarint(pReader->p, &ret); pReader->iLastPos = 0; return ret; } /* Read the next position from a position list. * Returns the position, or -1 at the end of the list. */ static int readPosition(DocListReader *pReader){ int i; int iType = pReader->pDoclist->iType; assert( iType>=DL_POSITIONS ); assert( !readerAtEnd(pReader) ); pReader->p += getVarint32(pReader->p, &i); if( i==0 ){ pReader->iLastPos = -1; return -1; } pReader->iLastPos += ((int) i)-1; if( iType>=DL_POSITIONS_OFFSETS ){ /* Skip over offsets, ignoring them for now. */ int iStart, iEnd; pReader->p += getVarint32(pReader->p, &iStart); pReader->p += getVarint32(pReader->p, &iEnd); } return pReader->iLastPos; } /* Skip past the end of a position list. */ static void skipPositionList(DocListReader *pReader){ while( readPosition(pReader)!=-1 ) ; } /* Skip over a docid, including its position list if the doclist has * positions. */ static void skipDocument(DocListReader *pReader){ readDocid(pReader); if( pReader->pDoclist->iType >= DL_POSITIONS ){ skipPositionList(pReader); } } static sqlite_int64 firstDocid(DocList *d){ DocListReader r; readerInit(&r, d); return readDocid(&r); } /* Doclist multi-tool. Pass pUpdate==NULL to delete the indicated docid; * otherwise pUpdate, which must contain only the single docid [iDocid], is * inserted (if not present) or updated (if already present). */ static int docListUpdate(DocList *d, sqlite_int64 iDocid, DocList *pUpdate){ int modified = 0; DocListReader reader; char *p; if( pUpdate!=NULL ){ assert( d->iType==pUpdate->iType); assert( iDocid==firstDocid(pUpdate) ); } readerInit(&reader, d); while( !readerAtEnd(&reader) && peekDocid(&reader)nData -= (reader.p - p); modified = 1; } /* Insert if indicated. */ if( pUpdate!=NULL ){ int iDoclist = p-d->pData; docListAddEndPos(pUpdate); d->pData = realloc(d->pData, d->nData+pUpdate->nData); p = d->pData + iDoclist; memmove(p+pUpdate->nData, p, docListEnd(d) - p); memcpy(p, pUpdate->pData, pUpdate->nData); d->nData += pUpdate->nData; modified = 1; } return modified; } /* Split the second half of doclist d into a separate doclist d2. Returns 1 * if successful, or 0 if d contains a single document and hence can't be * split. */ static int docListSplit(DocList *d, DocList *d2){ const char *pSplitPoint = d->pData + d->nData / 2; DocListReader reader; readerInit(&reader, d); while( reader.piType, reader.p, docListEnd(d) - reader.p); d->nData = reader.p - d->pData; d->pData = realloc(d->pData, d->nData); return 1; } /* A DocListMerge computes the AND of an in-memory DocList [in] and a chunked * on-disk doclist, resulting in another in-memory DocList [out]. [in] * and [out] may or may not store position information according to the * caller's wishes. The on-disk doclist always comes with positions. * * The caller must read each chunk of the on-disk doclist in succession and * pass it to mergeBlock(). * * If [in] has positions, then the merge output contains only documents with * matching positions in the two input doclists. If [in] does not have * positions, then the merge output contains all documents common to the two * input doclists. * * If [in] is NULL, then the on-disk doclist is copied to [out] directly. * * A merge is performed using an integer [iOffset] provided by the caller. * [iOffset] is subtracted from each position in the on-disk doclist for the * purpose of position comparison; this is helpful in implementing phrase * searches. * * A DocListMerge is not yet able to propagate offsets through query * processing; we should add that capability soon. */ typedef struct DocListMerge { DocListReader in; DocList *pOut; int iOffset; } DocListMerge; static void mergeInit(DocListMerge *m, DocList *pIn, int iOffset, DocList *pOut){ readerInit(&m->in, pIn); m->pOut = pOut; m->iOffset = iOffset; /* can't handle offsets yet */ assert( pIn==NULL || pIn->iType <= DL_POSITIONS ); assert( pOut->iType <= DL_POSITIONS ); } /* A helper function for mergeBlock(), below. Merge the position lists * pointed to by m->in and pBlockReader. * If the merge matches, write [iDocid] to m->pOut; if m->pOut * has positions then write all matching positions as well. */ static void mergePosList(DocListMerge *m, sqlite_int64 iDocid, DocListReader *pBlockReader){ int block_pos = readPosition(pBlockReader); int in_pos = readPosition(&m->in); int match = 0; while( block_pos!=-1 || in_pos!=-1 ){ if( block_pos-m->iOffset==in_pos ){ if( !match ){ docListAddDocid(m->pOut, iDocid); match = 1; } if( m->pOut->iType >= DL_POSITIONS ){ docListAddPos(m->pOut, in_pos); } block_pos = readPosition(pBlockReader); in_pos = readPosition(&m->in); } else if( in_pos==-1 || (block_pos!=-1 && block_pos-m->iOffsetin); } } if( m->pOut->iType >= DL_POSITIONS && match ){ docListAddEndPos(m->pOut); } } /* Merge one block of an on-disk doclist into a DocListMerge. */ static void mergeBlock(DocListMerge *m, DocList *pBlock){ DocListReader blockReader; assert( pBlock->iType >= DL_POSITIONS ); readerInit(&blockReader, pBlock); while( !readerAtEnd(&blockReader) ){ sqlite_int64 iDocid = readDocid(&blockReader); if( m->in.pDoclist!=NULL ){ while( 1 ){ if( readerAtEnd(&m->in) ) return; /* nothing more to merge */ if( peekDocid(&m->in)>=iDocid ) break; skipDocument(&m->in); } if( peekDocid(&m->in)>iDocid ){ /* [pIn] has no match with iDocid */ skipPositionList(&blockReader); /* skip this docid in the block */ continue; } readDocid(&m->in); } /* We have a document match. */ if( m->in.pDoclist==NULL || m->in.pDoclist->iType < DL_POSITIONS ){ /* We don't need to do a poslist merge. */ docListAddDocid(m->pOut, iDocid); if( m->pOut->iType >= DL_POSITIONS ){ /* Copy all positions to the output doclist. */ while( 1 ){ int pos = readPosition(&blockReader); if( pos==-1 ) break; docListAddPos(m->pOut, pos); } docListAddEndPos(m->pOut); } else skipPositionList(&blockReader); continue; } mergePosList(m, iDocid, &blockReader); } } static char *string_dup_n(const char *s, int n){ char *str = malloc(n + 1); memcpy(str, s, n); str[n] = '\0'; return str; } /* Duplicate a string; the caller must free() the returned string. * (We don't use strdup() since it's not part of the standard C library and * may not be available everywhere.) */ static char *string_dup(const char *s){ return string_dup_n(s, strlen(s)); } /* Format a string, replacing each occurrence of the % character with * zName. This may be more convenient than sqlite_mprintf() * when one string is used repeatedly in a format string. * The caller must free() the returned string. */ static char *string_format(const char *zFormat, const char *zName){ const char *p; size_t len = 0; size_t nName = strlen(zName); char *result; char *r; /* first compute length needed */ for(p = zFormat ; *p ; ++p){ len += (*p=='%' ? nName : 1); } len += 1; /* for null terminator */ r = result = malloc(len); for(p = zFormat; *p; ++p){ if( *p=='%' ){ memcpy(r, zName, nName); r += nName; } else { *r++ = *p; } } *r++ = '\0'; assert( r == result + len ); return result; } static int sql_exec(sqlite3 *db, const char *zName, const char *zFormat){ char *zCommand = string_format(zFormat, zName); int rc = sqlite3_exec(db, zCommand, NULL, 0, NULL); free(zCommand); return rc; } static int sql_prepare(sqlite3 *db, const char *zName, sqlite3_stmt **ppStmt, const char *zFormat){ char *zCommand = string_format(zFormat, zName); int rc = sqlite3_prepare(db, zCommand, -1, ppStmt, NULL); free(zCommand); return rc; } /* end utility functions */ #define QUERY_GENERIC 0 #define QUERY_FULLTEXT 1 #define CHUNK_MAX 1024 typedef enum fulltext_statement { CONTENT_INSERT_STMT, CONTENT_SELECT_STMT, CONTENT_DELETE_STMT, TERM_SELECT_STMT, TERM_CHUNK_SELECT_STMT, TERM_INSERT_STMT, TERM_UPDATE_STMT, TERM_DELETE_STMT, MAX_STMT /* Always at end! */ } fulltext_statement; /* These must exactly match the enum above. */ /* TODO(adam): Is there some risk that a statement (in particular, ** pTermSelectStmt) will be used in two cursors at once, e.g. if a ** query joins a virtual table to itself? If so perhaps we should ** move some of these to the cursor object. */ static const char *fulltext_zStatement[MAX_STMT] = { /* CONTENT_INSERT */ "insert into %_content (rowid, content) values (?, ?)", /* CONTENT_SELECT */ "select content from %_content where rowid = ?", /* CONTENT_DELETE */ "delete from %_content where rowid = ?", /* TERM_SELECT */ "select rowid, doclist from %_term where term = ? and first = ?", /* TERM_CHUNK_SELECT */ "select max(first) from %_term where term = ? and first <= ?", /* TERM_INSERT */ "insert into %_term (term, first, doclist) values (?, ?, ?)", /* TERM_UPDATE */ "update %_term set doclist = ? where rowid = ?", /* TERM_DELETE */ "delete from %_term where rowid = ?", }; typedef struct fulltext_vtab { sqlite3_vtab base; sqlite3 *db; const char *zName; /* virtual table name */ sqlite3_tokenizer *pTokenizer; /* tokenizer for inserts and queries */ /* Precompiled statements which we keep as long as the table is ** open. */ sqlite3_stmt *pFulltextStatements[MAX_STMT]; } fulltext_vtab; typedef struct fulltext_cursor { sqlite3_vtab_cursor base; int iCursorType; /* QUERY_GENERIC or QUERY_FULLTEXT */ sqlite3_stmt *pStmt; int eof; /* The following is used only when iCursorType == QUERY_FULLTEXT. */ DocListReader result; } fulltext_cursor; static struct fulltext_vtab *cursor_vtab(fulltext_cursor *c){ return (fulltext_vtab *) c->base.pVtab; } static sqlite3_module fulltextModule; /* forward declaration */ /* Puts a freshly-prepared statement determined by iStmt in *ppStmt. ** If the indicated statement has never been prepared, it is prepared ** and cached, otherwise the cached version is reset. */ static int sql_get_statement(fulltext_vtab *v, fulltext_statement iStmt, sqlite3_stmt **ppStmt){ assert( iStmtpFulltextStatements[iStmt]==NULL ){ int rc = sql_prepare(v->db, v->zName, &v->pFulltextStatements[iStmt], fulltext_zStatement[iStmt]); if( rc!=SQLITE_OK ) return rc; } else { int rc = sqlite3_reset(v->pFulltextStatements[iStmt]); if( rc!=SQLITE_OK ) return rc; } *ppStmt = v->pFulltextStatements[iStmt]; return SQLITE_OK; } /* Step the indicated statement, handling errors SQLITE_BUSY (by ** retrying) and SQLITE_SCHEMA (by re-preparing and transferring ** bindings to the new statement). ** TODO(adam): We should extend this function so that it can work with ** statements declared locally, not only globally cached statements. */ static int sql_step_statement(fulltext_vtab *v, fulltext_statement iStmt, sqlite3_stmt **ppStmt){ int rc; sqlite3_stmt *s = *ppStmt; assert( iStmtpFulltextStatements[iStmt] ); while( (rc=sqlite3_step(s))!=SQLITE_DONE && rc!=SQLITE_ROW ){ sqlite3_stmt *pNewStmt; if( rc==SQLITE_BUSY ) continue; if( rc!=SQLITE_ERROR ) return rc; rc = sqlite3_reset(s); if( rc!=SQLITE_SCHEMA ) return SQLITE_ERROR; v->pFulltextStatements[iStmt] = NULL; /* Still in s */ rc = sql_get_statement(v, iStmt, &pNewStmt); if( rc!=SQLITE_OK ) goto err; *ppStmt = pNewStmt; rc = sqlite3_transfer_bindings(s, pNewStmt); if( rc!=SQLITE_OK ) goto err; rc = sqlite3_finalize(s); if( rc!=SQLITE_OK ) return rc; s = pNewStmt; } return rc; err: sqlite3_finalize(s); return rc; } /* Like sql_step_statement(), but convert SQLITE_DONE to SQLITE_OK. ** Useful for statements like UPDATE, where we expect no results. */ static int sql_single_step_statement(fulltext_vtab *v, fulltext_statement iStmt, sqlite3_stmt **ppStmt){ int rc = sql_step_statement(v, iStmt, ppStmt); return (rc==SQLITE_DONE) ? SQLITE_OK : rc; } /* insert into %_content (rowid, content) values ([rowid], [zContent]) */ static int content_insert(fulltext_vtab *v, sqlite3_value *rowid, const char *zContent, int nContent){ sqlite3_stmt *s; int rc = sql_get_statement(v, CONTENT_INSERT_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_value(s, 1, rowid); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_text(s, 2, zContent, nContent, SQLITE_STATIC); if( rc!=SQLITE_OK ) return rc; return sql_single_step_statement(v, CONTENT_INSERT_STMT, &s); } /* select content from %_content where rowid = [iRow] * The caller must delete the returned string. */ static int content_select(fulltext_vtab *v, sqlite_int64 iRow, char **pzContent){ sqlite3_stmt *s; int rc = sql_get_statement(v, CONTENT_SELECT_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 1, iRow); if( rc!=SQLITE_OK ) return rc; rc = sql_step_statement(v, CONTENT_SELECT_STMT, &s); if( rc!=SQLITE_ROW ) return rc; *pzContent = string_dup((const char *)sqlite3_column_text(s, 0)); /* We expect only one row. We must execute another sqlite3_step() * to complete the iteration; otherwise the table will remain locked. */ rc = sqlite3_step(s); if( rc==SQLITE_DONE ) return SQLITE_OK; free(*pzContent); return rc; } /* delete from %_content where rowid = [iRow ] */ static int content_delete(fulltext_vtab *v, sqlite_int64 iRow){ sqlite3_stmt *s; int rc = sql_get_statement(v, CONTENT_DELETE_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 1, iRow); if( rc!=SQLITE_OK ) return rc; return sql_single_step_statement(v, CONTENT_DELETE_STMT, &s); } /* select rowid, doclist from %_term where term = [zTerm] and first = [iFirst] * If found, returns SQLITE_OK; the caller must free the returned doclist. * If no rows found, returns SQLITE_ERROR. */ static int term_select(fulltext_vtab *v, const char *zTerm, int nTerm, sqlite_int64 iFirst, sqlite_int64 *rowid, DocList *out){ sqlite3_stmt *s; int rc = sql_get_statement(v, TERM_SELECT_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_text(s, 1, zTerm, nTerm, SQLITE_TRANSIENT); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 2, iFirst); if( rc!=SQLITE_OK ) return rc; rc = sql_step_statement(v, TERM_SELECT_STMT, &s); if( rc!=SQLITE_ROW ) return rc==SQLITE_DONE ? SQLITE_ERROR : rc; *rowid = sqlite3_column_int64(s, 0); docListInit(out, DL_POSITIONS_OFFSETS, sqlite3_column_blob(s, 1), sqlite3_column_bytes(s, 1)); /* We expect only one row. We must execute another sqlite3_step() * to complete the iteration; otherwise the table will remain locked. */ rc = sqlite3_step(s); return rc==SQLITE_DONE ? SQLITE_OK : rc; } /* select max(first) from %_term where term = [zTerm] and first <= [iFirst] * If found, returns SQLITE_ROW and result in *piResult; if the query returns * NULL (meaning no row found) returns SQLITE_DONE. */ static int term_chunk_select(fulltext_vtab *v, const char *zTerm, int nTerm, sqlite_int64 iFirst, sqlite_int64 *piResult){ sqlite3_stmt *s; int rc = sql_get_statement(v, TERM_CHUNK_SELECT_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_text(s, 1, zTerm, nTerm, SQLITE_STATIC); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 2, iFirst); if( rc!=SQLITE_OK ) return rc; rc = sql_step_statement(v, TERM_CHUNK_SELECT_STMT, &s); if( rc!=SQLITE_ROW ) return rc==SQLITE_DONE ? SQLITE_ERROR : rc; switch( sqlite3_column_type(s, 0) ){ case SQLITE_NULL: rc = SQLITE_DONE; break; case SQLITE_INTEGER: *piResult = sqlite3_column_int64(s, 0); break; default: return SQLITE_ERROR; } /* We expect only one row. We must execute another sqlite3_step() * to complete the iteration; otherwise the table will remain locked. */ if( sqlite3_step(s) != SQLITE_DONE ) return SQLITE_ERROR; return rc; } /* insert into %_term (term, first, doclist) values ([zTerm], [iFirst], [doclist]) */ static int term_insert(fulltext_vtab *v, const char *zTerm, int nTerm, sqlite_int64 iFirst, DocList *doclist){ sqlite3_stmt *s; int rc = sql_get_statement(v, TERM_INSERT_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_text(s, 1, zTerm, nTerm, SQLITE_STATIC); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 2, iFirst); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_blob(s, 3, doclist->pData, doclist->nData, SQLITE_STATIC); if( rc!=SQLITE_OK ) return rc; return sql_single_step_statement(v, TERM_INSERT_STMT, &s); } /* update %_term set doclist = [doclist] where rowid = [rowid] */ static int term_update(fulltext_vtab *v, sqlite_int64 rowid, DocList *doclist){ sqlite3_stmt *s; int rc = sql_get_statement(v, TERM_UPDATE_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_blob(s, 1, doclist->pData, doclist->nData, SQLITE_STATIC); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 2, rowid); if( rc!=SQLITE_OK ) return rc; return sql_single_step_statement(v, TERM_UPDATE_STMT, &s); } static int term_delete(fulltext_vtab *v, sqlite_int64 rowid){ sqlite3_stmt *s; int rc = sql_get_statement(v, TERM_DELETE_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 1, rowid); if( rc!=SQLITE_OK ) return rc; return sql_single_step_statement(v, TERM_DELETE_STMT, &s); } static void fulltext_vtab_destroy(fulltext_vtab *v){ int iStmt; for( iStmt=0; iStmtpFulltextStatements[iStmt]!=NULL ){ sqlite3_finalize(v->pFulltextStatements[iStmt]); v->pFulltextStatements[iStmt] = NULL; } } if( v->pTokenizer!=NULL ){ v->pTokenizer->pModule->xDestroy(v->pTokenizer); v->pTokenizer = NULL; } free((void *) v->zName); free(v); } /* Current interface: ** argv[0] - module name ** argv[1] - database name ** argv[2] - table name ** argv[3] - tokenizer name (optional, a sensible default is provided) ** argv[4..] - passed to tokenizer (optional based on tokenizer) **/ static int fulltextConnect( sqlite3 *db, void *pAux, int argc, const char * const *argv, sqlite3_vtab **ppVTab, char **pzErr ){ int rc; fulltext_vtab *v; sqlite3_tokenizer_module *m = NULL; assert( argc>=3 ); v = (fulltext_vtab *) malloc(sizeof(fulltext_vtab)); /* sqlite will initialize v->base */ v->db = db; v->zName = string_dup(argv[2]); v->pTokenizer = NULL; if( argc==3 ){ get_simple_tokenizer_module(&m); } else { /* TODO(shess) For now, add new tokenizers as else if clauses. */ if( !strcmp(argv[3], "simple") ){ get_simple_tokenizer_module(&m); } else { assert( "unrecognized tokenizer"==NULL ); } } /* TODO(shess) Since tokenization impacts the index, the parameters ** to the tokenizer need to be identical when a persistent virtual ** table is re-created. One solution would be a meta-table to track ** such information in the database. Then we could verify that the ** information is identical on subsequent creates. */ /* TODO(shess) Why isn't argv already (const char **)? */ rc = m->xCreate(argc-3, (const char **) (argv+3), &v->pTokenizer); if( rc!=SQLITE_OK ) return rc; v->pTokenizer->pModule = m; /* TODO: verify the existence of backing tables foo_content, foo_term */ rc = sqlite3_declare_vtab(db, "create table x(content text)"); if( rc!=SQLITE_OK ) return rc; memset(v->pFulltextStatements, 0, sizeof(v->pFulltextStatements)); *ppVTab = &v->base; return SQLITE_OK; } static int fulltextCreate( sqlite3 *db, void *pAux, int argc, const char * const *argv, sqlite3_vtab **ppVTab, char **pzErr ){ int rc; assert( argc>=3 ); /* The %_content table holds the text of each full-text item, with ** the rowid used as the docid. ** ** The %_term table maps each term to a document list blob ** containing elements sorted by ascending docid, each element ** encoded as: ** ** docid varint-encoded ** token count varint-encoded ** "count" token elements (poslist): ** position varint-encoded as delta from previous position ** start offset varint-encoded as delta from previous start offset ** end offset varint-encoded as delta from start offset ** ** Additionally, doclist blobs can be chunked into multiple rows, ** using "first" to order the blobs. "first" is simply the first ** docid in the blob. */ /* ** NOTE(shess) That last sentence is incorrect in the face of ** deletion, which can leave a doclist that doesn't contain the ** first from that row. I _believe_ this does not matter to the ** operation of the system, but it might be reasonable to update ** appropriately in case this assumption becomes more important. */ rc = sql_exec(db, argv[2], "create table %_content(content text);" "create table %_term(term text, first integer, doclist blob);" "create index %_index on %_term(term, first)"); if( rc!=SQLITE_OK ) return rc; return fulltextConnect(db, pAux, argc, argv, ppVTab, pzErr); } /* Decide how to handle an SQL query. * At the moment, MATCH queries can include implicit boolean ANDs; we * haven't implemented phrase searches or OR yet. */ static int fulltextBestIndex(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ int i; for(i=0; inConstraint; ++i){ const struct sqlite3_index_constraint *pConstraint; pConstraint = &pInfo->aConstraint[i]; if( pConstraint->iColumn==0 && pConstraint->op==SQLITE_INDEX_CONSTRAINT_MATCH && pConstraint->usable ){ /* a full-text search */ pInfo->aConstraintUsage[i].argvIndex = 1; pInfo->aConstraintUsage[i].omit = 1; pInfo->idxNum = QUERY_FULLTEXT; pInfo->estimatedCost = 1.0; /* an arbitrary value for now */ return SQLITE_OK; } } pInfo->idxNum = QUERY_GENERIC; return SQLITE_OK; } static int fulltextDisconnect(sqlite3_vtab *pVTab){ fulltext_vtab_destroy((fulltext_vtab *)pVTab); return SQLITE_OK; } static int fulltextDestroy(sqlite3_vtab *pVTab){ fulltext_vtab *v = (fulltext_vtab *)pVTab; int rc = sql_exec(v->db, v->zName, "drop table %_content; drop table %_term"); if( rc!=SQLITE_OK ) return rc; fulltext_vtab_destroy((fulltext_vtab *)pVTab); return SQLITE_OK; } static int fulltextOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ fulltext_cursor *c; c = (fulltext_cursor *) calloc(sizeof(fulltext_cursor), 1); /* sqlite will initialize c->base */ *ppCursor = &c->base; return SQLITE_OK; } static int fulltextClose(sqlite3_vtab_cursor *pCursor){ fulltext_cursor *c = (fulltext_cursor *) pCursor; sqlite3_finalize(c->pStmt); if( c->result.pDoclist!=NULL ){ docListDelete(c->result.pDoclist); } free(c); return SQLITE_OK; } static int fulltextNext(sqlite3_vtab_cursor *pCursor){ fulltext_cursor *c = (fulltext_cursor *) pCursor; sqlite_int64 iDocid; int rc; switch( c->iCursorType ){ case QUERY_GENERIC: /* TODO(shess) Handle SQLITE_SCHEMA AND SQLITE_BUSY. */ rc = sqlite3_step(c->pStmt); switch( rc ){ case SQLITE_ROW: c->eof = 0; return SQLITE_OK; case SQLITE_DONE: c->eof = 1; return SQLITE_OK; default: c->eof = 1; return rc; } case QUERY_FULLTEXT: rc = sqlite3_reset(c->pStmt); if( rc!=SQLITE_OK ) return rc; if( readerAtEnd(&c->result)){ c->eof = 1; return SQLITE_OK; } iDocid = readDocid(&c->result); rc = sqlite3_bind_int64(c->pStmt, 1, iDocid); if( rc!=SQLITE_OK ) return rc; /* TODO(shess) Handle SQLITE_SCHEMA AND SQLITE_BUSY. */ rc = sqlite3_step(c->pStmt); if( rc==SQLITE_ROW ){ /* the case we expect */ c->eof = 0; return SQLITE_OK; } /* an error occurred; abort */ return rc==SQLITE_DONE ? SQLITE_ERROR : rc; default: assert( 0 ); return SQLITE_ERROR; /* not reached */ } } static int term_select_doclist(fulltext_vtab *v, const char *pTerm, int nTerm, sqlite3_stmt **ppStmt){ int rc; if( *ppStmt ){ rc = sqlite3_reset(*ppStmt); } else { rc = sql_prepare(v->db, v->zName, ppStmt, "select doclist from %_term where term = ? order by first"); } if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_text(*ppStmt, 1, pTerm, nTerm, SQLITE_TRANSIENT); if( rc!=SQLITE_OK ) return rc; return sqlite3_step(*ppStmt); /* TODO(adamd): handle schema error */ } /* Read the posting list for [zTerm]; AND it with the doclist [in] to * produce the doclist [out], using the given offset [iOffset] for phrase * matching. * (*pSelect) is used to hold an SQLite statement used inside this function; * the caller should initialize *pSelect to NULL before the first call. */ static int query_merge(fulltext_vtab *v, sqlite3_stmt **pSelect, const char *zTerm, DocList *pIn, int iOffset, DocList *out){ int rc; DocListMerge merge; if( pIn!=NULL && !pIn->nData ){ /* If [pIn] is already empty, there's no point in reading the * posting list to AND it in; return immediately. */ return SQLITE_OK; } rc = term_select_doclist(v, zTerm, -1, pSelect); if( rc!=SQLITE_ROW && rc!=SQLITE_DONE ) return rc; mergeInit(&merge, pIn, iOffset, out); while( rc==SQLITE_ROW ){ DocList block; docListInit(&block, DL_POSITIONS_OFFSETS, sqlite3_column_blob(*pSelect, 0), sqlite3_column_bytes(*pSelect, 0)); mergeBlock(&merge, &block); docListDestroy(&block); rc = sqlite3_step(*pSelect); if( rc!=SQLITE_ROW && rc!=SQLITE_DONE ){ return rc; } } return SQLITE_OK; } typedef struct QueryTerm { int is_phrase; /* true if this term begins a new phrase */ const char *zTerm; } QueryTerm; /* A parsed query. * * As an example, parsing the query ["four score" years "new nation"] will * yield a Query with 5 terms: * "four", is_phrase = 1 * "score", is_phrase = 0 * "years", is_phrase = 1 * "new", is_phrase = 1 * "nation", is_phrase = 0 */ typedef struct Query { int nTerms; QueryTerm *pTerm; } Query; static void query_add(Query *q, int is_phrase, const char *zTerm){ QueryTerm *t; ++q->nTerms; q->pTerm = realloc(q->pTerm, q->nTerms * sizeof(q->pTerm[0])); t = &q->pTerm[q->nTerms - 1]; t->is_phrase = is_phrase; t->zTerm = zTerm; } static void query_free(Query *q){ int i; for(i = 0; i < q->nTerms; ++i){ free((void *) q->pTerm[i].zTerm); } free(q->pTerm); } static int tokenize_segment(sqlite3_tokenizer *pTokenizer, const char *zQuery, int in_phrase, Query *pQuery){ sqlite3_tokenizer_module *pModule = pTokenizer->pModule; sqlite3_tokenizer_cursor *pCursor; int is_first = 1; int rc = pModule->xOpen(pTokenizer, zQuery, -1, &pCursor); if( rc!=SQLITE_OK ) return rc; pCursor->pTokenizer = pTokenizer; while( 1 ){ const char *zToken; int nToken, iStartOffset, iEndOffset, dummy_pos; rc = pModule->xNext(pCursor, &zToken, &nToken, &iStartOffset, &iEndOffset, &dummy_pos); if( rc!=SQLITE_OK ) break; query_add(pQuery, !in_phrase || is_first, string_dup_n(zToken, nToken)); is_first = 0; } return pModule->xClose(pCursor); } /* Parse a query string, yielding a Query object. */ static int parse_query(fulltext_vtab *v, const char *zQuery, Query *pQuery){ char *zQuery1 = string_dup(zQuery); int in_phrase = 0; char *s = zQuery1; pQuery->nTerms = 0; pQuery->pTerm = NULL; while( *s ){ char *t = s; while( *t ){ if( *t=='"' ){ *t++ = '\0'; break; } ++t; } if( *s ){ tokenize_segment(v->pTokenizer, s, in_phrase, pQuery); } s = t; in_phrase = !in_phrase; } free(zQuery1); return SQLITE_OK; } /* Perform a full-text query; return a list of documents in [pResult]. */ static int fulltext_query(fulltext_vtab *v, const char *zQuery, DocList **pResult){ Query q; int phrase_start = -1; int i; sqlite3_stmt *pSelect = NULL; DocList *d = NULL; int rc = parse_query(v, zQuery, &q); if( rc!=SQLITE_OK ) return rc; /* Merge terms. */ for(i = 0 ; i < q.nTerms ; ++i){ /* In each merge step, we need to generate positions whenever we're * processing a phrase which hasn't ended yet. */ int need_positions = iiCursorType = idxNum; switch( idxNum ){ case QUERY_GENERIC: zStatement = "select rowid, content from %_content"; break; case QUERY_FULLTEXT: /* full-text search */ { const char *zQuery = (const char *)sqlite3_value_text(argv[0]); DocList *pResult; assert( argc==1 ); rc = fulltext_query(v, zQuery, &pResult); if( rc!=SQLITE_OK ) return rc; readerInit(&c->result, pResult); zStatement = "select rowid, content from %_content where rowid = ?"; break; } default: assert( 0 ); } rc = sql_prepare(v->db, v->zName, &c->pStmt, zStatement); if( rc!=SQLITE_OK ) return rc; return fulltextNext(pCursor); } static int fulltextEof(sqlite3_vtab_cursor *pCursor){ fulltext_cursor *c = (fulltext_cursor *) pCursor; return c->eof; } static int fulltextColumn(sqlite3_vtab_cursor *pCursor, sqlite3_context *pContext, int idxCol){ fulltext_cursor *c = (fulltext_cursor *) pCursor; const char *s; assert( idxCol==0 ); s = (const char *) sqlite3_column_text(c->pStmt, 1); sqlite3_result_text(pContext, s, -1, SQLITE_TRANSIENT); return SQLITE_OK; } static int fulltextRowid(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ fulltext_cursor *c = (fulltext_cursor *) pCursor; *pRowid = sqlite3_column_int64(c->pStmt, 0); return SQLITE_OK; } /* Build a hash table containing all terms in zText. */ static int build_terms(Hash *terms, sqlite3_tokenizer *pTokenizer, const char *zText, sqlite_int64 iDocid){ sqlite3_tokenizer_cursor *pCursor; const char *pToken; int nTokenBytes; int iStartOffset, iEndOffset, iPosition; int rc = pTokenizer->pModule->xOpen(pTokenizer, zText, -1, &pCursor); if( rc!=SQLITE_OK ) return rc; pCursor->pTokenizer = pTokenizer; HashInit(terms, HASH_STRING, 1); while( SQLITE_OK==pTokenizer->pModule->xNext(pCursor, &pToken, &nTokenBytes, &iStartOffset, &iEndOffset, &iPosition) ){ DocList *p; /* Positions can't be negative; we use -1 as a terminator internally. */ if( iPosition<0 ) { rc = SQLITE_ERROR; goto err; } p = HashFind(terms, pToken, nTokenBytes); if( p==NULL ){ p = docListNew(DL_POSITIONS_OFFSETS); docListAddDocid(p, iDocid); HashInsert(terms, pToken, nTokenBytes, p); } docListAddPosOffset(p, iPosition, iStartOffset, iEndOffset); } err: /* TODO(shess) Check return? Should this be able to cause errors at ** this point? Actually, same question about sqlite3_finalize(), ** though one could argue that failure there means that the data is ** not durable. *ponder* */ pTokenizer->pModule->xClose(pCursor); return rc; } /* Update the %_terms table to map the term [zTerm] to the given rowid. */ static int index_insert_term(fulltext_vtab *v, const char *zTerm, int nTerm, sqlite_int64 iDocid, DocList *p){ sqlite_int64 iFirst; sqlite_int64 iIndexRow; DocList doclist; int rc = term_chunk_select(v, zTerm, nTerm, iDocid, &iFirst); if( rc==SQLITE_DONE ){ docListInit(&doclist, DL_POSITIONS_OFFSETS, 0, 0); if( docListUpdate(&doclist, iDocid, p) ){ rc = term_insert(v, zTerm, nTerm, iDocid, &doclist); docListDestroy(&doclist); return rc; } return SQLITE_OK; } if( rc!=SQLITE_ROW ) return SQLITE_ERROR; /* This word is in the index; add this document ID to its blob. */ rc = term_select(v, zTerm, nTerm, iFirst, &iIndexRow, &doclist); if( rc!=SQLITE_OK ) return rc; if( docListUpdate(&doclist, iDocid, p) ){ /* If the blob is too big, split it in half. */ if( doclist.nData>CHUNK_MAX ){ DocList half; if( docListSplit(&doclist, &half) ){ rc = term_insert(v, zTerm, nTerm, firstDocid(&half), &half); docListDestroy(&half); if( rc!=SQLITE_OK ) goto err; } } rc = term_update(v, iIndexRow, &doclist); } err: docListDestroy(&doclist); return rc; } /* Insert a row into the full-text index; set *piRowid to be the ID of the * new row. */ static int index_insert(fulltext_vtab *v, sqlite3_value *pRequestRowid, const char *zText, sqlite_int64 *piRowid){ Hash terms; /* maps term string -> PosList */ HashElem *e; int rc = content_insert(v, pRequestRowid, zText, -1); if( rc!=SQLITE_OK ) return rc; *piRowid = sqlite3_last_insert_rowid(v->db); if( !zText ) return SQLITE_OK; /* nothing to index */ rc = build_terms(&terms, v->pTokenizer, zText, *piRowid); if( rc!=SQLITE_OK ) return rc; for(e=HashFirst(&terms); e; e=HashNext(e)){ DocList *p = HashData(e); rc = index_insert_term(v, HashKey(e), HashKeysize(e), *piRowid, p); if( rc!=SQLITE_OK ) break; } for(e=HashFirst(&terms); e; e=HashNext(e)){ DocList *p = HashData(e); docListDelete(p); } HashClear(&terms); return rc; } static int index_delete_term(fulltext_vtab *v, const char *zTerm, int nTerm, sqlite_int64 iDocid){ sqlite_int64 iFirst; sqlite_int64 iIndexRow; DocList doclist; int rc = term_chunk_select(v, zTerm, nTerm, iDocid, &iFirst); if( rc!=SQLITE_ROW ) return SQLITE_ERROR; rc = term_select(v, zTerm, nTerm, iFirst, &iIndexRow, &doclist); if( rc!=SQLITE_OK ) return rc; if( docListUpdate(&doclist, iDocid, NULL) ){ if( doclist.nData>0 ){ rc = term_update(v, iIndexRow, &doclist); } else { /* empty posting list */ rc = term_delete(v, iIndexRow); } } docListDestroy(&doclist); return rc; } /* Delete a row from the full-text index. */ static int index_delete(fulltext_vtab *v, sqlite_int64 iRow){ char *zText; Hash terms; HashElem *e; int rc = content_select(v, iRow, &zText); if( rc!=SQLITE_OK ) return rc; rc = build_terms(&terms, v->pTokenizer, zText, iRow); free(zText); if( rc!=SQLITE_OK ) return rc; for(e=HashFirst(&terms); e; e=HashNext(e)){ rc = index_delete_term(v, HashKey(e), HashKeysize(e), iRow); if( rc!=SQLITE_OK ) break; } for(e=HashFirst(&terms); e; e=HashNext(e)){ DocList *p = HashData(e); docListDelete(p); } HashClear(&terms); return content_delete(v, iRow); } static int fulltextUpdate(sqlite3_vtab *pVtab, int nArg, sqlite3_value **ppArg, sqlite_int64 *pRowid){ fulltext_vtab *v = (fulltext_vtab *) pVtab; if( nArg<2 ){ return index_delete(v, sqlite3_value_int64(ppArg[0])); } if( sqlite3_value_type(ppArg[0]) != SQLITE_NULL ){ return SQLITE_ERROR; /* an update; not yet supported */ } assert( nArg==3 ); /* ppArg[1] = rowid, ppArg[2] = content */ return index_insert(v, ppArg[1], (const char *)sqlite3_value_text(ppArg[2]), pRowid); } static sqlite3_module fulltextModule = { 0, fulltextCreate, fulltextConnect, fulltextBestIndex, fulltextDisconnect, fulltextDestroy, fulltextOpen, fulltextClose, fulltextFilter, fulltextNext, fulltextEof, fulltextColumn, fulltextRowid, fulltextUpdate }; int fulltext_init(sqlite3 *db){ return sqlite3_create_module(db, "fulltext", &fulltextModule, 0); } #if !SQLITE_CORE #ifdef _WIN32 __declspec(dllexport) #endif int sqlite3_fulltext_init(sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi){ SQLITE_EXTENSION_INIT2(pApi) return fulltext_init(db); } #endif ================================================ FILE: v2/testdata/_sqlite/ext/fts1/fulltext.h ================================================ #include "sqlite3.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ int fulltext_init(sqlite3 *db); #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ ================================================ FILE: v2/testdata/_sqlite/ext/fts1/simple_tokenizer.c ================================================ /* ** The author disclaims copyright to this source code. ** ************************************************************************* ** Implementation of the "simple" full-text-search tokenizer. */ #include #if !defined(__APPLE__) #include #else #include #endif #include #include #include #include "tokenizer.h" /* Duplicate a string; the caller must free() the returned string. * (We don't use strdup() since it's not part of the standard C library and * may not be available everywhere.) */ /* TODO(shess) Copied from fulltext.c, consider util.c for such ** things. */ static char *string_dup(const char *s){ char *str = malloc(strlen(s) + 1); strcpy(str, s); return str; } typedef struct simple_tokenizer { sqlite3_tokenizer base; const char *zDelim; /* token delimiters */ } simple_tokenizer; typedef struct simple_tokenizer_cursor { sqlite3_tokenizer_cursor base; const char *pInput; /* input we are tokenizing */ int nBytes; /* size of the input */ const char *pCurrent; /* current position in pInput */ int iToken; /* index of next token to be returned */ char *zToken; /* storage for current token */ int nTokenBytes; /* actual size of current token */ int nTokenAllocated; /* space allocated to zToken buffer */ } simple_tokenizer_cursor; static sqlite3_tokenizer_module simpleTokenizerModule;/* forward declaration */ static int simpleCreate( int argc, const char **argv, sqlite3_tokenizer **ppTokenizer ){ simple_tokenizer *t; t = (simple_tokenizer *) malloc(sizeof(simple_tokenizer)); /* TODO(shess) Delimiters need to remain the same from run to run, ** else we need to reindex. One solution would be a meta-table to ** track such information in the database, then we'd only want this ** information on the initial create. */ if( argc>1 ){ t->zDelim = string_dup(argv[1]); } else { /* Build a string excluding alphanumeric ASCII characters */ char zDelim[0x80]; /* nul-terminated, so nul not a member */ int i, j; for(i=1, j=0; i<0x80; i++){ if( !isalnum(i) ){ zDelim[j++] = i; } } zDelim[j++] = '\0'; assert( j<=sizeof(zDelim) ); t->zDelim = string_dup(zDelim); } *ppTokenizer = &t->base; return SQLITE_OK; } static int simpleDestroy(sqlite3_tokenizer *pTokenizer){ simple_tokenizer *t = (simple_tokenizer *) pTokenizer; free((void *) t->zDelim); free(t); return SQLITE_OK; } static int simpleOpen( sqlite3_tokenizer *pTokenizer, const char *pInput, int nBytes, sqlite3_tokenizer_cursor **ppCursor ){ simple_tokenizer_cursor *c; c = (simple_tokenizer_cursor *) malloc(sizeof(simple_tokenizer_cursor)); c->pInput = pInput; c->nBytes = nBytes<0 ? (int) strlen(pInput) : nBytes; c->pCurrent = c->pInput; /* start tokenizing at the beginning */ c->iToken = 0; c->zToken = NULL; /* no space allocated, yet. */ c->nTokenBytes = 0; c->nTokenAllocated = 0; *ppCursor = &c->base; return SQLITE_OK; } static int simpleClose(sqlite3_tokenizer_cursor *pCursor){ simple_tokenizer_cursor *c = (simple_tokenizer_cursor *) pCursor; if( NULL!=c->zToken ){ free(c->zToken); } free(c); return SQLITE_OK; } static int simpleNext( sqlite3_tokenizer_cursor *pCursor, const char **ppToken, int *pnBytes, int *piStartOffset, int *piEndOffset, int *piPosition ){ simple_tokenizer_cursor *c = (simple_tokenizer_cursor *) pCursor; simple_tokenizer *t = (simple_tokenizer *) pCursor->pTokenizer; int ii; while( c->pCurrent-c->pInputnBytes ){ int n = (int) strcspn(c->pCurrent, t->zDelim); if( n>0 ){ if( n+1>c->nTokenAllocated ){ c->zToken = realloc(c->zToken, n+1); } for(ii=0; iipCurrent[ii]; c->zToken[ii] = (unsigned char)ch<0x80 ? tolower((unsigned char)ch):ch; } c->zToken[n] = '\0'; *ppToken = c->zToken; *pnBytes = n; *piStartOffset = (int) (c->pCurrent-c->pInput); *piEndOffset = *piStartOffset+n; *piPosition = c->iToken++; c->pCurrent += n + 1; return SQLITE_OK; } c->pCurrent += n + 1; /* TODO(shess) could strspn() to skip delimiters en masse. Needs ** to happen in two places, though, which is annoying. */ } return SQLITE_DONE; } static sqlite3_tokenizer_module simpleTokenizerModule = { 0, simpleCreate, simpleDestroy, simpleOpen, simpleClose, simpleNext, }; void get_simple_tokenizer_module( sqlite3_tokenizer_module **ppModule ){ *ppModule = &simpleTokenizerModule; } ================================================ FILE: v2/testdata/_sqlite/ext/fts1/tokenizer.h ================================================ /* ** 2006 July 10 ** ** The author disclaims copyright to this source code. ** ************************************************************************* ** Defines the interface to tokenizers used by fulltext-search. There ** are three basic components: ** ** sqlite3_tokenizer_module is a singleton defining the tokenizer ** interface functions. This is essentially the class structure for ** tokenizers. ** ** sqlite3_tokenizer is used to define a particular tokenizer, perhaps ** including customization information defined at creation time. ** ** sqlite3_tokenizer_cursor is generated by a tokenizer to generate ** tokens from a particular input. */ #ifndef _TOKENIZER_H_ #define _TOKENIZER_H_ /* TODO(shess) Only used for SQLITE_OK and SQLITE_DONE at this time. ** If tokenizers are to be allowed to call sqlite3_*() functions, then ** we will need a way to register the API consistently. */ #include "sqlite3.h" /* ** Structures used by the tokenizer interface. */ typedef struct sqlite3_tokenizer sqlite3_tokenizer; typedef struct sqlite3_tokenizer_cursor sqlite3_tokenizer_cursor; typedef struct sqlite3_tokenizer_module sqlite3_tokenizer_module; struct sqlite3_tokenizer_module { int iVersion; /* currently 0 */ /* ** Create and destroy a tokenizer. argc/argv are passed down from ** the fulltext virtual table creation to allow customization. */ int (*xCreate)(int argc, const char **argv, sqlite3_tokenizer **ppTokenizer); int (*xDestroy)(sqlite3_tokenizer *pTokenizer); /* ** Tokenize a particular input. Call xOpen() to prepare to ** tokenize, xNext() repeatedly until it returns SQLITE_DONE, then ** xClose() to free any internal state. The pInput passed to ** xOpen() must exist until the cursor is closed. The ppToken ** result from xNext() is only valid until the next call to xNext() ** or until xClose() is called. */ /* TODO(shess) current implementation requires pInput to be ** nul-terminated. This should either be fixed, or pInput/nBytes ** should be converted to zInput. */ int (*xOpen)(sqlite3_tokenizer *pTokenizer, const char *pInput, int nBytes, sqlite3_tokenizer_cursor **ppCursor); int (*xClose)(sqlite3_tokenizer_cursor *pCursor); int (*xNext)(sqlite3_tokenizer_cursor *pCursor, const char **ppToken, int *pnBytes, int *piStartOffset, int *piEndOffset, int *piPosition); }; struct sqlite3_tokenizer { sqlite3_tokenizer_module *pModule; /* The module for this tokenizer */ /* Tokenizer implementations will typically add additional fields */ }; struct sqlite3_tokenizer_cursor { sqlite3_tokenizer *pTokenizer; /* Tokenizer for this cursor. */ /* Tokenizer implementations will typically add additional fields */ }; /* ** Get the module for a tokenizer which generates tokens based on a ** set of non-token characters. The default is to break tokens at any ** non-alnum character, though the set of delimiters can also be ** specified by the first argv argument to xCreate(). */ /* TODO(shess) This doesn't belong here. Need some sort of ** registration process. */ void get_simple_tokenizer_module(sqlite3_tokenizer_module **ppModule); #endif /* _TOKENIZER_H_ */ ================================================ FILE: v2/testdata/_sqlite/ext/fts2/README.tokenizers ================================================ 1. FTS2 Tokenizers When creating a new full-text table, FTS2 allows the user to select the text tokenizer implementation to be used when indexing text by specifying a "tokenizer" clause as part of the CREATE VIRTUAL TABLE statement: CREATE VIRTUAL TABLE USING fts2( [, tokenizer []] ); The built-in tokenizers (valid values to pass as ) are "simple" and "porter". should consist of zero or more white-space separated arguments to pass to the selected tokenizer implementation. The interpretation of the arguments, if any, depends on the individual tokenizer. 2. Custom Tokenizers FTS2 allows users to provide custom tokenizer implementations. The interface used to create a new tokenizer is defined and described in the fts2_tokenizer.h source file. Registering a new FTS2 tokenizer is similar to registering a new virtual table module with SQLite. The user passes a pointer to a structure containing pointers to various callback functions that make up the implementation of the new tokenizer type. For tokenizers, the structure (defined in fts2_tokenizer.h) is called "sqlite3_tokenizer_module". FTS2 does not expose a C-function that users call to register new tokenizer types with a database handle. Instead, the pointer must be encoded as an SQL blob value and passed to FTS2 through the SQL engine by evaluating a special scalar function, "fts2_tokenizer()". The fts2_tokenizer() function may be called with one or two arguments, as follows: SELECT fts2_tokenizer(); SELECT fts2_tokenizer(, ); Where is a string identifying the tokenizer and is a pointer to an sqlite3_tokenizer_module structure encoded as an SQL blob. If the second argument is present, it is registered as tokenizer and a copy of it returned. If only one argument is passed, a pointer to the tokenizer implementation currently registered as is returned, encoded as a blob. Or, if no such tokenizer exists, an SQL exception (error) is raised. SECURITY: If the fts2 extension is used in an environment where potentially malicious users may execute arbitrary SQL (i.e. gears), they should be prevented from invoking the fts2_tokenizer() function, possibly using the authorisation callback. See "Sample code" below for an example of calling the fts2_tokenizer() function from C code. 3. ICU Library Tokenizers If this extension is compiled with the SQLITE_ENABLE_ICU pre-processor symbol defined, then there exists a built-in tokenizer named "icu" implemented using the ICU library. The first argument passed to the xCreate() method (see fts2_tokenizer.h) of this tokenizer may be an ICU locale identifier. For example "tr_TR" for Turkish as used in Turkey, or "en_AU" for English as used in Australia. For example: "CREATE VIRTUAL TABLE thai_text USING fts2(text, tokenizer icu th_TH)" The ICU tokenizer implementation is very simple. It splits the input text according to the ICU rules for finding word boundaries and discards any tokens that consist entirely of white-space. This may be suitable for some applications in some locales, but not all. If more complex processing is required, for example to implement stemming or discard punctuation, this can be done by creating a tokenizer implementation that uses the ICU tokenizer as part of its implementation. When using the ICU tokenizer this way, it is safe to overwrite the contents of the strings returned by the xNext() method (see fts2_tokenizer.h). 4. Sample code. The following two code samples illustrate the way C code should invoke the fts2_tokenizer() scalar function: int registerTokenizer( sqlite3 *db, char *zName, const sqlite3_tokenizer_module *p ){ int rc; sqlite3_stmt *pStmt; const char zSql[] = "SELECT fts2_tokenizer(?, ?)"; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ return rc; } sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); sqlite3_bind_blob(pStmt, 2, &p, sizeof(p), SQLITE_STATIC); sqlite3_step(pStmt); return sqlite3_finalize(pStmt); } int queryTokenizer( sqlite3 *db, char *zName, const sqlite3_tokenizer_module **pp ){ int rc; sqlite3_stmt *pStmt; const char zSql[] = "SELECT fts2_tokenizer(?)"; *pp = 0; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ return rc; } sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); if( SQLITE_ROW==sqlite3_step(pStmt) ){ if( sqlite3_column_type(pStmt, 0)==SQLITE_BLOB ){ memcpy(pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp)); } } return sqlite3_finalize(pStmt); } ================================================ FILE: v2/testdata/_sqlite/ext/fts2/README.txt ================================================ This folder contains source code to the second full-text search extension for SQLite. While the API is the same, this version uses a substantially different storage schema from fts1, so tables will need to be rebuilt. ================================================ FILE: v2/testdata/_sqlite/ext/fts2/fts2.c ================================================ /* fts2 has a design flaw which can lead to database corruption (see ** below). It is recommended not to use it any longer, instead use ** fts3 (or higher). If you believe that your use of fts2 is safe, ** add -DSQLITE_ENABLE_BROKEN_FTS2=1 to your CFLAGS. */ #if (!defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2)) \ && !defined(SQLITE_ENABLE_BROKEN_FTS2) #error fts2 has a design flaw and has been deprecated. #endif /* The flaw is that fts2 uses the content table's unaliased rowid as ** the unique docid. fts2 embeds the rowid in the index it builds, ** and expects the rowid to not change. The SQLite VACUUM operation ** will renumber such rowids, thereby breaking fts2. If you are using ** fts2 in a system which has disabled VACUUM, then you can continue ** to use it safely. Note that PRAGMA auto_vacuum does NOT disable ** VACUUM, though systems using auto_vacuum are unlikely to invoke ** VACUUM. ** ** Unlike fts1, which is safe across VACUUM if you never delete ** documents, fts2 has a second exposure to this flaw, in the segments ** table. So fts2 should be considered unsafe across VACUUM in all ** cases. */ /* ** 2006 Oct 10 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This is an SQLite module implementing full-text search. */ /* ** The code in this file is only compiled if: ** ** * The FTS2 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS2 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS2 is defined). */ /* TODO(shess) Consider exporting this comment to an HTML file or the ** wiki. */ /* The full-text index is stored in a series of b+tree (-like) ** structures called segments which map terms to doclists. The ** structures are like b+trees in layout, but are constructed from the ** bottom up in optimal fashion and are not updatable. Since trees ** are built from the bottom up, things will be described from the ** bottom up. ** ** **** Varints **** ** The basic unit of encoding is a variable-length integer called a ** varint. We encode variable-length integers in little-endian order ** using seven bits * per byte as follows: ** ** KEY: ** A = 0xxxxxxx 7 bits of data and one flag bit ** B = 1xxxxxxx 7 bits of data and one flag bit ** ** 7 bits - A ** 14 bits - BA ** 21 bits - BBA ** and so on. ** ** This is identical to how sqlite encodes varints (see util.c). ** ** **** Document lists **** ** A doclist (document list) holds a docid-sorted list of hits for a ** given term. Doclists hold docids, and can optionally associate ** token positions and offsets with docids. ** ** A DL_POSITIONS_OFFSETS doclist is stored like this: ** ** array { ** varint docid; ** array { (position list for column 0) ** varint position; (delta from previous position plus POS_BASE) ** varint startOffset; (delta from previous startOffset) ** varint endOffset; (delta from startOffset) ** } ** array { ** varint POS_COLUMN; (marks start of position list for new column) ** varint column; (index of new column) ** array { ** varint position; (delta from previous position plus POS_BASE) ** varint startOffset;(delta from previous startOffset) ** varint endOffset; (delta from startOffset) ** } ** } ** varint POS_END; (marks end of positions for this document. ** } ** ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer, while an "offset" is a byte offset, ** both based at 0. Note that POS_END and POS_COLUMN occur in the ** same logical place as the position element, and act as sentinals ** ending a position list array. ** ** A DL_POSITIONS doclist omits the startOffset and endOffset ** information. A DL_DOCIDS doclist omits both the position and ** offset information, becoming an array of varint-encoded docids. ** ** On-disk data is stored as type DL_DEFAULT, so we don't serialize ** the type. Due to how deletion is implemented in the segmentation ** system, on-disk doclists MUST store at least positions. ** ** **** Segment leaf nodes **** ** Segment leaf nodes store terms and doclists, ordered by term. Leaf ** nodes are written using LeafWriter, and read using LeafReader (to ** iterate through a single leaf node's data) and LeavesReader (to ** iterate through a segment's entire leaf layer). Leaf nodes have ** the format: ** ** varint iHeight; (height from leaf level, always 0) ** varint nTerm; (length of first term) ** char pTerm[nTerm]; (content of first term) ** varint nDoclist; (length of term's associated doclist) ** char pDoclist[nDoclist]; (content of doclist) ** array { ** (further terms are delta-encoded) ** varint nPrefix; (length of prefix shared with previous term) ** varint nSuffix; (length of unshared suffix) ** char pTermSuffix[nSuffix];(unshared suffix of next term) ** varint nDoclist; (length of term's associated doclist) ** char pDoclist[nDoclist]; (content of doclist) ** } ** ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. ** ** Leaf nodes are broken into blocks which are stored contiguously in ** the %_segments table in sorted order. This means that when the end ** of a node is reached, the next term is in the node with the next ** greater node id. ** ** New data is spilled to a new leaf node when the current node ** exceeds LEAF_MAX bytes (default 2048). New data which itself is ** larger than STANDALONE_MIN (default 1024) is placed in a standalone ** node (a leaf node with a single term and doclist). The goal of ** these settings is to pack together groups of small doclists while ** making it efficient to directly access large doclists. The ** assumption is that large doclists represent terms which are more ** likely to be query targets. ** ** TODO(shess) It may be useful for blocking decisions to be more ** dynamic. For instance, it may make more sense to have a 2.5k leaf ** node rather than splitting into 2k and .5k nodes. My intuition is ** that this might extend through 2x or 4x the pagesize. ** ** **** Segment interior nodes **** ** Segment interior nodes store blockids for subtree nodes and terms ** to describe what data is stored by the each subtree. Interior ** nodes are written using InteriorWriter, and read using ** InteriorReader. InteriorWriters are created as needed when ** SegmentWriter creates new leaf nodes, or when an interior node ** itself grows too big and must be split. The format of interior ** nodes: ** ** varint iHeight; (height from leaf level, always >0) ** varint iBlockid; (block id of node's leftmost subtree) ** optional { ** varint nTerm; (length of first term) ** char pTerm[nTerm]; (content of first term) ** array { ** (further terms are delta-encoded) ** varint nPrefix; (length of shared prefix with previous term) ** varint nSuffix; (length of unshared suffix) ** char pTermSuffix[nSuffix]; (unshared suffix of next term) ** } ** } ** ** Here, optional { X } means an optional element, while array { X } ** means zero or more occurrences of X, adjacent in memory. ** ** An interior node encodes n terms separating n+1 subtrees. The ** subtree blocks are contiguous, so only the first subtree's blockid ** is encoded. The subtree at iBlockid will contain all terms less ** than the first term encoded (or all terms if no term is encoded). ** Otherwise, for terms greater than or equal to pTerm[i] but less ** than pTerm[i+1], the subtree for that term will be rooted at ** iBlockid+i. Interior nodes only store enough term data to ** distinguish adjacent children (if the rightmost term of the left ** child is "something", and the leftmost term of the right child is ** "wicked", only "w" is stored). ** ** New data is spilled to a new interior node at the same height when ** the current node exceeds INTERIOR_MAX bytes (default 2048). ** INTERIOR_MIN_TERMS (default 7) keeps large terms from monopolizing ** interior nodes and making the tree too skinny. The interior nodes ** at a given height are naturally tracked by interior nodes at ** height+1, and so on. ** ** **** Segment directory **** ** The segment directory in table %_segdir stores meta-information for ** merging and deleting segments, and also the root node of the ** segment's tree. ** ** The root node is the top node of the segment's tree after encoding ** the entire segment, restricted to ROOT_MAX bytes (default 1024). ** This could be either a leaf node or an interior node. If the top ** node requires more than ROOT_MAX bytes, it is flushed to %_segments ** and a new root interior node is generated (which should always fit ** within ROOT_MAX because it only needs space for 2 varints, the ** height and the blockid of the previous root). ** ** The meta-information in the segment directory is: ** level - segment level (see below) ** idx - index within level ** - (level,idx uniquely identify a segment) ** start_block - first leaf node ** leaves_end_block - last leaf node ** end_block - last block (including interior nodes) ** root - contents of root node ** ** If the root node is a leaf node, then start_block, ** leaves_end_block, and end_block are all 0. ** ** **** Segment merging **** ** To amortize update costs, segments are groups into levels and ** merged in matches. Each increase in level represents exponentially ** more documents. ** ** New documents (actually, document updates) are tokenized and ** written individually (using LeafWriter) to a level 0 segment, with ** incrementing idx. When idx reaches MERGE_COUNT (default 16), all ** level 0 segments are merged into a single level 1 segment. Level 1 ** is populated like level 0, and eventually MERGE_COUNT level 1 ** segments are merged to a single level 2 segment (representing ** MERGE_COUNT^2 updates), and so on. ** ** A segment merge traverses all segments at a given level in ** parallel, performing a straightforward sorted merge. Since segment ** leaf nodes are written in to the %_segments table in order, this ** merge traverses the underlying sqlite disk structures efficiently. ** After the merge, all segment blocks from the merged level are ** deleted. ** ** MERGE_COUNT controls how often we merge segments. 16 seems to be ** somewhat of a sweet spot for insertion performance. 32 and 64 show ** very similar performance numbers to 16 on insertion, though they're ** a tiny bit slower (perhaps due to more overhead in merge-time ** sorting). 8 is about 20% slower than 16, 4 about 50% slower than ** 16, 2 about 66% slower than 16. ** ** At query time, high MERGE_COUNT increases the number of segments ** which need to be scanned and merged. For instance, with 100k docs ** inserted: ** ** MERGE_COUNT segments ** 16 25 ** 8 12 ** 4 10 ** 2 6 ** ** This appears to have only a moderate impact on queries for very ** frequent terms (which are somewhat dominated by segment merge ** costs), and infrequent and non-existent terms still seem to be fast ** even with many segments. ** ** TODO(shess) That said, it would be nice to have a better query-side ** argument for MERGE_COUNT of 16. Also, it is possible/likely that ** optimizations to things like doclist merging will swing the sweet ** spot around. ** ** ** **** Handling of deletions and updates **** ** Since we're using a segmented structure, with no docid-oriented ** index into the term index, we clearly cannot simply update the term ** index when a document is deleted or updated. For deletions, we ** write an empty doclist (varint(docid) varint(POS_END)), for updates ** we simply write the new doclist. Segment merges overwrite older ** data for a particular docid with newer data, so deletes or updates ** will eventually overtake the earlier data and knock it out. The ** query logic likewise merges doclists so that newer data knocks out ** older data. ** ** TODO(shess) Provide a VACUUM type operation to clear out all ** deletions and duplications. This would basically be a forced merge ** into a single segment. */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) #if defined(SQLITE_ENABLE_FTS2) && !defined(SQLITE_CORE) # define SQLITE_CORE 1 #endif #include #include #include #include #include "fts2.h" #include "fts2_hash.h" #include "fts2_tokenizer.h" #include "sqlite3.h" #include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 /* TODO(shess) MAN, this thing needs some refactoring. At minimum, it ** would be nice to order the file better, perhaps something along the ** lines of: ** ** - utility functions ** - table setup functions ** - table update functions ** - table query functions ** ** Put the query functions last because they're likely to reference ** typedefs or functions from the table update section. */ #if 0 # define TRACE(A) printf A; fflush(stdout) #else # define TRACE(A) #endif /* It is not safe to call isspace(), tolower(), or isalnum() on ** hi-bit-set characters. This is the same solution used in the ** tokenizer. */ /* TODO(shess) The snippet-generation code should be using the ** tokenizer-generated tokens rather than doing its own local ** tokenization. */ /* TODO(shess) Is __isascii() a portable version of (c&0x80)==0? */ static int safe_isspace(char c){ return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; } static int safe_tolower(char c){ return (c>='A' && c<='Z') ? (c - 'A' + 'a') : c; } static int safe_isalnum(char c){ return (c>='0' && c<='9') || (c>='A' && c<='Z') || (c>='a' && c<='z'); } typedef enum DocListType { DL_DOCIDS, /* docids only */ DL_POSITIONS, /* docids + positions */ DL_POSITIONS_OFFSETS /* docids + positions + offsets */ } DocListType; /* ** By default, only positions and not offsets are stored in the doclists. ** To change this so that offsets are stored too, compile with ** ** -DDL_DEFAULT=DL_POSITIONS_OFFSETS ** ** If DL_DEFAULT is set to DL_DOCIDS, your table can only be inserted ** into (no deletes or updates). */ #ifndef DL_DEFAULT # define DL_DEFAULT DL_POSITIONS #endif enum { POS_END = 0, /* end of this position list */ POS_COLUMN, /* followed by new column number */ POS_BASE }; /* MERGE_COUNT controls how often we merge segments (see comment at ** top of file). */ #define MERGE_COUNT 16 /* utility functions */ /* CLEAR() and SCRAMBLE() abstract memset() on a pointer to a single ** record to prevent errors of the form: ** ** my_function(SomeType *b){ ** memset(b, '\0', sizeof(b)); // sizeof(b)!=sizeof(*b) ** } */ /* TODO(shess) Obvious candidates for a header file. */ #define CLEAR(b) memset(b, '\0', sizeof(*(b))) #ifndef NDEBUG # define SCRAMBLE(b) memset(b, 0x55, sizeof(*(b))) #else # define SCRAMBLE(b) #endif /* We may need up to VARINT_MAX bytes to store an encoded 64-bit integer. */ #define VARINT_MAX 10 /* Write a 64-bit variable-length integer to memory starting at p[0]. * The length of data written will be between 1 and VARINT_MAX bytes. * The number of bytes written is returned. */ static int putVarint(char *p, sqlite_int64 v){ unsigned char *q = (unsigned char *) p; sqlite_uint64 vu = v; do{ *q++ = (unsigned char) ((vu & 0x7f) | 0x80); vu >>= 7; }while( vu!=0 ); q[-1] &= 0x7f; /* turn off high bit in final byte */ assert( q - (unsigned char *)p <= VARINT_MAX ); return (int) (q - (unsigned char *)p); } /* Read a 64-bit variable-length integer from memory starting at p[0]. * Return the number of bytes read, or 0 on error. * The value is stored in *v. */ static int getVarint(const char *p, sqlite_int64 *v){ const unsigned char *q = (const unsigned char *) p; sqlite_uint64 x = 0, y = 1; while( (*q & 0x80) == 0x80 ){ x += y * (*q++ & 0x7f); y <<= 7; if( q - (unsigned char *)p >= VARINT_MAX ){ /* bad data */ assert( 0 ); return 0; } } x += y * (*q++); *v = (sqlite_int64) x; return (int) (q - (unsigned char *)p); } static int getVarint32(const char *p, int *pi){ sqlite_int64 i; int ret = getVarint(p, &i); *pi = (int) i; assert( *pi==i ); return ret; } /*******************************************************************/ /* DataBuffer is used to collect data into a buffer in piecemeal ** fashion. It implements the usual distinction between amount of ** data currently stored (nData) and buffer capacity (nCapacity). ** ** dataBufferInit - create a buffer with given initial capacity. ** dataBufferReset - forget buffer's data, retaining capacity. ** dataBufferDestroy - free buffer's data. ** dataBufferSwap - swap contents of two buffers. ** dataBufferExpand - expand capacity without adding data. ** dataBufferAppend - append data. ** dataBufferAppend2 - append two pieces of data at once. ** dataBufferReplace - replace buffer's data. */ typedef struct DataBuffer { char *pData; /* Pointer to malloc'ed buffer. */ int nCapacity; /* Size of pData buffer. */ int nData; /* End of data loaded into pData. */ } DataBuffer; static void dataBufferInit(DataBuffer *pBuffer, int nCapacity){ assert( nCapacity>=0 ); pBuffer->nData = 0; pBuffer->nCapacity = nCapacity; pBuffer->pData = nCapacity==0 ? NULL : sqlite3_malloc(nCapacity); } static void dataBufferReset(DataBuffer *pBuffer){ pBuffer->nData = 0; } static void dataBufferDestroy(DataBuffer *pBuffer){ if( pBuffer->pData!=NULL ) sqlite3_free(pBuffer->pData); SCRAMBLE(pBuffer); } static void dataBufferSwap(DataBuffer *pBuffer1, DataBuffer *pBuffer2){ DataBuffer tmp = *pBuffer1; *pBuffer1 = *pBuffer2; *pBuffer2 = tmp; } static void dataBufferExpand(DataBuffer *pBuffer, int nAddCapacity){ assert( nAddCapacity>0 ); /* TODO(shess) Consider expanding more aggressively. Note that the ** underlying malloc implementation may take care of such things for ** us already. */ if( pBuffer->nData+nAddCapacity>pBuffer->nCapacity ){ pBuffer->nCapacity = pBuffer->nData+nAddCapacity; pBuffer->pData = sqlite3_realloc(pBuffer->pData, pBuffer->nCapacity); } } static void dataBufferAppend(DataBuffer *pBuffer, const char *pSource, int nSource){ assert( nSource>0 && pSource!=NULL ); dataBufferExpand(pBuffer, nSource); memcpy(pBuffer->pData+pBuffer->nData, pSource, nSource); pBuffer->nData += nSource; } static void dataBufferAppend2(DataBuffer *pBuffer, const char *pSource1, int nSource1, const char *pSource2, int nSource2){ assert( nSource1>0 && pSource1!=NULL ); assert( nSource2>0 && pSource2!=NULL ); dataBufferExpand(pBuffer, nSource1+nSource2); memcpy(pBuffer->pData+pBuffer->nData, pSource1, nSource1); memcpy(pBuffer->pData+pBuffer->nData+nSource1, pSource2, nSource2); pBuffer->nData += nSource1+nSource2; } static void dataBufferReplace(DataBuffer *pBuffer, const char *pSource, int nSource){ dataBufferReset(pBuffer); dataBufferAppend(pBuffer, pSource, nSource); } /* StringBuffer is a null-terminated version of DataBuffer. */ typedef struct StringBuffer { DataBuffer b; /* Includes null terminator. */ } StringBuffer; static void initStringBuffer(StringBuffer *sb){ dataBufferInit(&sb->b, 100); dataBufferReplace(&sb->b, "", 1); } static int stringBufferLength(StringBuffer *sb){ return sb->b.nData-1; } static char *stringBufferData(StringBuffer *sb){ return sb->b.pData; } static void stringBufferDestroy(StringBuffer *sb){ dataBufferDestroy(&sb->b); } static void nappend(StringBuffer *sb, const char *zFrom, int nFrom){ assert( sb->b.nData>0 ); if( nFrom>0 ){ sb->b.nData--; dataBufferAppend2(&sb->b, zFrom, nFrom, "", 1); } } static void append(StringBuffer *sb, const char *zFrom){ nappend(sb, zFrom, strlen(zFrom)); } /* Append a list of strings separated by commas. */ static void appendList(StringBuffer *sb, int nString, char **azString){ int i; for(i=0; i0 ) append(sb, ", "); append(sb, azString[i]); } } static int endsInWhiteSpace(StringBuffer *p){ return stringBufferLength(p)>0 && safe_isspace(stringBufferData(p)[stringBufferLength(p)-1]); } /* If the StringBuffer ends in something other than white space, add a ** single space character to the end. */ static void appendWhiteSpace(StringBuffer *p){ if( stringBufferLength(p)==0 ) return; if( !endsInWhiteSpace(p) ) append(p, " "); } /* Remove white space from the end of the StringBuffer */ static void trimWhiteSpace(StringBuffer *p){ while( endsInWhiteSpace(p) ){ p->b.pData[--p->b.nData-1] = '\0'; } } /*******************************************************************/ /* DLReader is used to read document elements from a doclist. The ** current docid is cached, so dlrDocid() is fast. DLReader does not ** own the doclist buffer. ** ** dlrAtEnd - true if there's no more data to read. ** dlrDocid - docid of current document. ** dlrDocData - doclist data for current document (including docid). ** dlrDocDataBytes - length of same. ** dlrAllDataBytes - length of all remaining data. ** dlrPosData - position data for current document. ** dlrPosDataLen - length of pos data for current document (incl POS_END). ** dlrStep - step to current document. ** dlrInit - initial for doclist of given type against given data. ** dlrDestroy - clean up. ** ** Expected usage is something like: ** ** DLReader reader; ** dlrInit(&reader, pData, nData); ** while( !dlrAtEnd(&reader) ){ ** // calls to dlrDocid() and kin. ** dlrStep(&reader); ** } ** dlrDestroy(&reader); */ typedef struct DLReader { DocListType iType; const char *pData; int nData; sqlite_int64 iDocid; int nElement; } DLReader; static int dlrAtEnd(DLReader *pReader){ assert( pReader->nData>=0 ); return pReader->nData==0; } static sqlite_int64 dlrDocid(DLReader *pReader){ assert( !dlrAtEnd(pReader) ); return pReader->iDocid; } static const char *dlrDocData(DLReader *pReader){ assert( !dlrAtEnd(pReader) ); return pReader->pData; } static int dlrDocDataBytes(DLReader *pReader){ assert( !dlrAtEnd(pReader) ); return pReader->nElement; } static int dlrAllDataBytes(DLReader *pReader){ assert( !dlrAtEnd(pReader) ); return pReader->nData; } /* TODO(shess) Consider adding a field to track iDocid varint length ** to make these two functions faster. This might matter (a tiny bit) ** for queries. */ static const char *dlrPosData(DLReader *pReader){ sqlite_int64 iDummy; int n = getVarint(pReader->pData, &iDummy); assert( !dlrAtEnd(pReader) ); return pReader->pData+n; } static int dlrPosDataLen(DLReader *pReader){ sqlite_int64 iDummy; int n = getVarint(pReader->pData, &iDummy); assert( !dlrAtEnd(pReader) ); return pReader->nElement-n; } static void dlrStep(DLReader *pReader){ assert( !dlrAtEnd(pReader) ); /* Skip past current doclist element. */ assert( pReader->nElement<=pReader->nData ); pReader->pData += pReader->nElement; pReader->nData -= pReader->nElement; /* If there is more data, read the next doclist element. */ if( pReader->nData!=0 ){ sqlite_int64 iDocidDelta; int iDummy, n = getVarint(pReader->pData, &iDocidDelta); pReader->iDocid += iDocidDelta; if( pReader->iType>=DL_POSITIONS ){ assert( nnData ); while( 1 ){ n += getVarint32(pReader->pData+n, &iDummy); assert( n<=pReader->nData ); if( iDummy==POS_END ) break; if( iDummy==POS_COLUMN ){ n += getVarint32(pReader->pData+n, &iDummy); assert( nnData ); }else if( pReader->iType==DL_POSITIONS_OFFSETS ){ n += getVarint32(pReader->pData+n, &iDummy); n += getVarint32(pReader->pData+n, &iDummy); assert( nnData ); } } } pReader->nElement = n; assert( pReader->nElement<=pReader->nData ); } } static void dlrInit(DLReader *pReader, DocListType iType, const char *pData, int nData){ assert( pData!=NULL && nData!=0 ); pReader->iType = iType; pReader->pData = pData; pReader->nData = nData; pReader->nElement = 0; pReader->iDocid = 0; /* Load the first element's data. There must be a first element. */ dlrStep(pReader); } static void dlrDestroy(DLReader *pReader){ SCRAMBLE(pReader); } #ifndef NDEBUG /* Verify that the doclist can be validly decoded. Also returns the ** last docid found because it is convenient in other assertions for ** DLWriter. */ static void docListValidate(DocListType iType, const char *pData, int nData, sqlite_int64 *pLastDocid){ sqlite_int64 iPrevDocid = 0; assert( nData>0 ); assert( pData!=0 ); assert( pData+nData>pData ); while( nData!=0 ){ sqlite_int64 iDocidDelta; int n = getVarint(pData, &iDocidDelta); iPrevDocid += iDocidDelta; if( iType>DL_DOCIDS ){ int iDummy; while( 1 ){ n += getVarint32(pData+n, &iDummy); if( iDummy==POS_END ) break; if( iDummy==POS_COLUMN ){ n += getVarint32(pData+n, &iDummy); }else if( iType>DL_POSITIONS ){ n += getVarint32(pData+n, &iDummy); n += getVarint32(pData+n, &iDummy); } assert( n<=nData ); } } assert( n<=nData ); pData += n; nData -= n; } if( pLastDocid ) *pLastDocid = iPrevDocid; } #define ASSERT_VALID_DOCLIST(i, p, n, o) docListValidate(i, p, n, o) #else #define ASSERT_VALID_DOCLIST(i, p, n, o) assert( 1 ) #endif /*******************************************************************/ /* DLWriter is used to write doclist data to a DataBuffer. DLWriter ** always appends to the buffer and does not own it. ** ** dlwInit - initialize to write a given type doclistto a buffer. ** dlwDestroy - clear the writer's memory. Does not free buffer. ** dlwAppend - append raw doclist data to buffer. ** dlwCopy - copy next doclist from reader to writer. ** dlwAdd - construct doclist element and append to buffer. ** Only apply dlwAdd() to DL_DOCIDS doclists (else use PLWriter). */ typedef struct DLWriter { DocListType iType; DataBuffer *b; sqlite_int64 iPrevDocid; #ifndef NDEBUG int has_iPrevDocid; #endif } DLWriter; static void dlwInit(DLWriter *pWriter, DocListType iType, DataBuffer *b){ pWriter->b = b; pWriter->iType = iType; pWriter->iPrevDocid = 0; #ifndef NDEBUG pWriter->has_iPrevDocid = 0; #endif } static void dlwDestroy(DLWriter *pWriter){ SCRAMBLE(pWriter); } /* iFirstDocid is the first docid in the doclist in pData. It is ** needed because pData may point within a larger doclist, in which ** case the first item would be delta-encoded. ** ** iLastDocid is the final docid in the doclist in pData. It is ** needed to create the new iPrevDocid for future delta-encoding. The ** code could decode the passed doclist to recreate iLastDocid, but ** the only current user (docListMerge) already has decoded this ** information. */ /* TODO(shess) This has become just a helper for docListMerge. ** Consider a refactor to make this cleaner. */ static void dlwAppend(DLWriter *pWriter, const char *pData, int nData, sqlite_int64 iFirstDocid, sqlite_int64 iLastDocid){ sqlite_int64 iDocid = 0; char c[VARINT_MAX]; int nFirstOld, nFirstNew; /* Old and new varint len of first docid. */ #ifndef NDEBUG sqlite_int64 iLastDocidDelta; #endif /* Recode the initial docid as delta from iPrevDocid. */ nFirstOld = getVarint(pData, &iDocid); assert( nFirstOldiType==DL_DOCIDS) ); nFirstNew = putVarint(c, iFirstDocid-pWriter->iPrevDocid); /* Verify that the incoming doclist is valid AND that it ends with ** the expected docid. This is essential because we'll trust this ** docid in future delta-encoding. */ ASSERT_VALID_DOCLIST(pWriter->iType, pData, nData, &iLastDocidDelta); assert( iLastDocid==iFirstDocid-iDocid+iLastDocidDelta ); /* Append recoded initial docid and everything else. Rest of docids ** should have been delta-encoded from previous initial docid. */ if( nFirstOldb, c, nFirstNew, pData+nFirstOld, nData-nFirstOld); }else{ dataBufferAppend(pWriter->b, c, nFirstNew); } pWriter->iPrevDocid = iLastDocid; } static void dlwCopy(DLWriter *pWriter, DLReader *pReader){ dlwAppend(pWriter, dlrDocData(pReader), dlrDocDataBytes(pReader), dlrDocid(pReader), dlrDocid(pReader)); } static void dlwAdd(DLWriter *pWriter, sqlite_int64 iDocid){ char c[VARINT_MAX]; int n = putVarint(c, iDocid-pWriter->iPrevDocid); /* Docids must ascend. */ assert( !pWriter->has_iPrevDocid || iDocid>pWriter->iPrevDocid ); assert( pWriter->iType==DL_DOCIDS ); dataBufferAppend(pWriter->b, c, n); pWriter->iPrevDocid = iDocid; #ifndef NDEBUG pWriter->has_iPrevDocid = 1; #endif } /*******************************************************************/ /* PLReader is used to read data from a document's position list. As ** the caller steps through the list, data is cached so that varints ** only need to be decoded once. ** ** plrInit, plrDestroy - create/destroy a reader. ** plrColumn, plrPosition, plrStartOffset, plrEndOffset - accessors ** plrAtEnd - at end of stream, only call plrDestroy once true. ** plrStep - step to the next element. */ typedef struct PLReader { /* These refer to the next position's data. nData will reach 0 when ** reading the last position, so plrStep() signals EOF by setting ** pData to NULL. */ const char *pData; int nData; DocListType iType; int iColumn; /* the last column read */ int iPosition; /* the last position read */ int iStartOffset; /* the last start offset read */ int iEndOffset; /* the last end offset read */ } PLReader; static int plrAtEnd(PLReader *pReader){ return pReader->pData==NULL; } static int plrColumn(PLReader *pReader){ assert( !plrAtEnd(pReader) ); return pReader->iColumn; } static int plrPosition(PLReader *pReader){ assert( !plrAtEnd(pReader) ); return pReader->iPosition; } static int plrStartOffset(PLReader *pReader){ assert( !plrAtEnd(pReader) ); return pReader->iStartOffset; } static int plrEndOffset(PLReader *pReader){ assert( !plrAtEnd(pReader) ); return pReader->iEndOffset; } static void plrStep(PLReader *pReader){ int i, n; assert( !plrAtEnd(pReader) ); if( pReader->nData==0 ){ pReader->pData = NULL; return; } n = getVarint32(pReader->pData, &i); if( i==POS_COLUMN ){ n += getVarint32(pReader->pData+n, &pReader->iColumn); pReader->iPosition = 0; pReader->iStartOffset = 0; n += getVarint32(pReader->pData+n, &i); } /* Should never see adjacent column changes. */ assert( i!=POS_COLUMN ); if( i==POS_END ){ pReader->nData = 0; pReader->pData = NULL; return; } pReader->iPosition += i-POS_BASE; if( pReader->iType==DL_POSITIONS_OFFSETS ){ n += getVarint32(pReader->pData+n, &i); pReader->iStartOffset += i; n += getVarint32(pReader->pData+n, &i); pReader->iEndOffset = pReader->iStartOffset+i; } assert( n<=pReader->nData ); pReader->pData += n; pReader->nData -= n; } static void plrInit(PLReader *pReader, DLReader *pDLReader){ pReader->pData = dlrPosData(pDLReader); pReader->nData = dlrPosDataLen(pDLReader); pReader->iType = pDLReader->iType; pReader->iColumn = 0; pReader->iPosition = 0; pReader->iStartOffset = 0; pReader->iEndOffset = 0; plrStep(pReader); } static void plrDestroy(PLReader *pReader){ SCRAMBLE(pReader); } /*******************************************************************/ /* PLWriter is used in constructing a document's position list. As a ** convenience, if iType is DL_DOCIDS, PLWriter becomes a no-op. ** PLWriter writes to the associated DLWriter's buffer. ** ** plwInit - init for writing a document's poslist. ** plwDestroy - clear a writer. ** plwAdd - append position and offset information. ** plwCopy - copy next position's data from reader to writer. ** plwTerminate - add any necessary doclist terminator. ** ** Calling plwAdd() after plwTerminate() may result in a corrupt ** doclist. */ /* TODO(shess) Until we've written the second item, we can cache the ** first item's information. Then we'd have three states: ** ** - initialized with docid, no positions. ** - docid and one position. ** - docid and multiple positions. ** ** Only the last state needs to actually write to dlw->b, which would ** be an improvement in the DLCollector case. */ typedef struct PLWriter { DLWriter *dlw; int iColumn; /* the last column written */ int iPos; /* the last position written */ int iOffset; /* the last start offset written */ } PLWriter; /* TODO(shess) In the case where the parent is reading these values ** from a PLReader, we could optimize to a copy if that PLReader has ** the same type as pWriter. */ static void plwAdd(PLWriter *pWriter, int iColumn, int iPos, int iStartOffset, int iEndOffset){ /* Worst-case space for POS_COLUMN, iColumn, iPosDelta, ** iStartOffsetDelta, and iEndOffsetDelta. */ char c[5*VARINT_MAX]; int n = 0; /* Ban plwAdd() after plwTerminate(). */ assert( pWriter->iPos!=-1 ); if( pWriter->dlw->iType==DL_DOCIDS ) return; if( iColumn!=pWriter->iColumn ){ n += putVarint(c+n, POS_COLUMN); n += putVarint(c+n, iColumn); pWriter->iColumn = iColumn; pWriter->iPos = 0; pWriter->iOffset = 0; } assert( iPos>=pWriter->iPos ); n += putVarint(c+n, POS_BASE+(iPos-pWriter->iPos)); pWriter->iPos = iPos; if( pWriter->dlw->iType==DL_POSITIONS_OFFSETS ){ assert( iStartOffset>=pWriter->iOffset ); n += putVarint(c+n, iStartOffset-pWriter->iOffset); pWriter->iOffset = iStartOffset; assert( iEndOffset>=iStartOffset ); n += putVarint(c+n, iEndOffset-iStartOffset); } dataBufferAppend(pWriter->dlw->b, c, n); } static void plwCopy(PLWriter *pWriter, PLReader *pReader){ plwAdd(pWriter, plrColumn(pReader), plrPosition(pReader), plrStartOffset(pReader), plrEndOffset(pReader)); } static void plwInit(PLWriter *pWriter, DLWriter *dlw, sqlite_int64 iDocid){ char c[VARINT_MAX]; int n; pWriter->dlw = dlw; /* Docids must ascend. */ assert( !pWriter->dlw->has_iPrevDocid || iDocid>pWriter->dlw->iPrevDocid ); n = putVarint(c, iDocid-pWriter->dlw->iPrevDocid); dataBufferAppend(pWriter->dlw->b, c, n); pWriter->dlw->iPrevDocid = iDocid; #ifndef NDEBUG pWriter->dlw->has_iPrevDocid = 1; #endif pWriter->iColumn = 0; pWriter->iPos = 0; pWriter->iOffset = 0; } /* TODO(shess) Should plwDestroy() also terminate the doclist? But ** then plwDestroy() would no longer be just a destructor, it would ** also be doing work, which isn't consistent with the overall idiom. ** Another option would be for plwAdd() to always append any necessary ** terminator, so that the output is always correct. But that would ** add incremental work to the common case with the only benefit being ** API elegance. Punt for now. */ static void plwTerminate(PLWriter *pWriter){ if( pWriter->dlw->iType>DL_DOCIDS ){ char c[VARINT_MAX]; int n = putVarint(c, POS_END); dataBufferAppend(pWriter->dlw->b, c, n); } #ifndef NDEBUG /* Mark as terminated for assert in plwAdd(). */ pWriter->iPos = -1; #endif } static void plwDestroy(PLWriter *pWriter){ SCRAMBLE(pWriter); } /*******************************************************************/ /* DLCollector wraps PLWriter and DLWriter to provide a ** dynamically-allocated doclist area to use during tokenization. ** ** dlcNew - malloc up and initialize a collector. ** dlcDelete - destroy a collector and all contained items. ** dlcAddPos - append position and offset information. ** dlcAddDoclist - add the collected doclist to the given buffer. ** dlcNext - terminate the current document and open another. */ typedef struct DLCollector { DataBuffer b; DLWriter dlw; PLWriter plw; } DLCollector; /* TODO(shess) This could also be done by calling plwTerminate() and ** dataBufferAppend(). I tried that, expecting nominal performance ** differences, but it seemed to pretty reliably be worth 1% to code ** it this way. I suspect it is the incremental malloc overhead (some ** percentage of the plwTerminate() calls will cause a realloc), so ** this might be worth revisiting if the DataBuffer implementation ** changes. */ static void dlcAddDoclist(DLCollector *pCollector, DataBuffer *b){ if( pCollector->dlw.iType>DL_DOCIDS ){ char c[VARINT_MAX]; int n = putVarint(c, POS_END); dataBufferAppend2(b, pCollector->b.pData, pCollector->b.nData, c, n); }else{ dataBufferAppend(b, pCollector->b.pData, pCollector->b.nData); } } static void dlcNext(DLCollector *pCollector, sqlite_int64 iDocid){ plwTerminate(&pCollector->plw); plwDestroy(&pCollector->plw); plwInit(&pCollector->plw, &pCollector->dlw, iDocid); } static void dlcAddPos(DLCollector *pCollector, int iColumn, int iPos, int iStartOffset, int iEndOffset){ plwAdd(&pCollector->plw, iColumn, iPos, iStartOffset, iEndOffset); } static DLCollector *dlcNew(sqlite_int64 iDocid, DocListType iType){ DLCollector *pCollector = sqlite3_malloc(sizeof(DLCollector)); dataBufferInit(&pCollector->b, 0); dlwInit(&pCollector->dlw, iType, &pCollector->b); plwInit(&pCollector->plw, &pCollector->dlw, iDocid); return pCollector; } static void dlcDelete(DLCollector *pCollector){ plwDestroy(&pCollector->plw); dlwDestroy(&pCollector->dlw); dataBufferDestroy(&pCollector->b); SCRAMBLE(pCollector); sqlite3_free(pCollector); } /* Copy the doclist data of iType in pData/nData into *out, trimming ** unnecessary data as we go. Only columns matching iColumn are ** copied, all columns copied if iColumn is -1. Elements with no ** matching columns are dropped. The output is an iOutType doclist. */ /* NOTE(shess) This code is only valid after all doclists are merged. ** If this is run before merges, then doclist items which represent ** deletion will be trimmed, and will thus not effect a deletion ** during the merge. */ static void docListTrim(DocListType iType, const char *pData, int nData, int iColumn, DocListType iOutType, DataBuffer *out){ DLReader dlReader; DLWriter dlWriter; assert( iOutType<=iType ); dlrInit(&dlReader, iType, pData, nData); dlwInit(&dlWriter, iOutType, out); while( !dlrAtEnd(&dlReader) ){ PLReader plReader; PLWriter plWriter; int match = 0; plrInit(&plReader, &dlReader); while( !plrAtEnd(&plReader) ){ if( iColumn==-1 || plrColumn(&plReader)==iColumn ){ if( !match ){ plwInit(&plWriter, &dlWriter, dlrDocid(&dlReader)); match = 1; } plwAdd(&plWriter, plrColumn(&plReader), plrPosition(&plReader), plrStartOffset(&plReader), plrEndOffset(&plReader)); } plrStep(&plReader); } if( match ){ plwTerminate(&plWriter); plwDestroy(&plWriter); } plrDestroy(&plReader); dlrStep(&dlReader); } dlwDestroy(&dlWriter); dlrDestroy(&dlReader); } /* Used by docListMerge() to keep doclists in the ascending order by ** docid, then ascending order by age (so the newest comes first). */ typedef struct OrderedDLReader { DLReader *pReader; /* TODO(shess) If we assume that docListMerge pReaders is ordered by ** age (which we do), then we could use pReader comparisons to break ** ties. */ int idx; } OrderedDLReader; /* Order eof to end, then by docid asc, idx desc. */ static int orderedDLReaderCmp(OrderedDLReader *r1, OrderedDLReader *r2){ if( dlrAtEnd(r1->pReader) ){ if( dlrAtEnd(r2->pReader) ) return 0; /* Both atEnd(). */ return 1; /* Only r1 atEnd(). */ } if( dlrAtEnd(r2->pReader) ) return -1; /* Only r2 atEnd(). */ if( dlrDocid(r1->pReader)pReader) ) return -1; if( dlrDocid(r1->pReader)>dlrDocid(r2->pReader) ) return 1; /* Descending on idx. */ return r2->idx-r1->idx; } /* Bubble p[0] to appropriate place in p[1..n-1]. Assumes that ** p[1..n-1] is already sorted. */ /* TODO(shess) Is this frequent enough to warrant a binary search? ** Before implementing that, instrument the code to check. In most ** current usage, I expect that p[0] will be less than p[1] a very ** high proportion of the time. */ static void orderedDLReaderReorder(OrderedDLReader *p, int n){ while( n>1 && orderedDLReaderCmp(p, p+1)>0 ){ OrderedDLReader tmp = p[0]; p[0] = p[1]; p[1] = tmp; n--; p++; } } /* Given an array of doclist readers, merge their doclist elements ** into out in sorted order (by docid), dropping elements from older ** readers when there is a duplicate docid. pReaders is assumed to be ** ordered by age, oldest first. */ /* TODO(shess) nReaders must be <= MERGE_COUNT. This should probably ** be fixed. */ static void docListMerge(DataBuffer *out, DLReader *pReaders, int nReaders){ OrderedDLReader readers[MERGE_COUNT]; DLWriter writer; int i, n; const char *pStart = 0; int nStart = 0; sqlite_int64 iFirstDocid = 0, iLastDocid = 0; assert( nReaders>0 ); if( nReaders==1 ){ dataBufferAppend(out, dlrDocData(pReaders), dlrAllDataBytes(pReaders)); return; } assert( nReaders<=MERGE_COUNT ); n = 0; for(i=0; i0 ){ orderedDLReaderReorder(readers+i, nReaders-i); } dlwInit(&writer, pReaders[0].iType, out); while( !dlrAtEnd(readers[0].pReader) ){ sqlite_int64 iDocid = dlrDocid(readers[0].pReader); /* If this is a continuation of the current buffer to copy, extend ** that buffer. memcpy() seems to be more efficient if it has a ** lots of data to copy. */ if( dlrDocData(readers[0].pReader)==pStart+nStart ){ nStart += dlrDocDataBytes(readers[0].pReader); }else{ if( pStart!=0 ){ dlwAppend(&writer, pStart, nStart, iFirstDocid, iLastDocid); } pStart = dlrDocData(readers[0].pReader); nStart = dlrDocDataBytes(readers[0].pReader); iFirstDocid = iDocid; } iLastDocid = iDocid; dlrStep(readers[0].pReader); /* Drop all of the older elements with the same docid. */ for(i=1; i0 ){ orderedDLReaderReorder(readers+i, nReaders-i); } } /* Copy over any remaining elements. */ if( nStart>0 ) dlwAppend(&writer, pStart, nStart, iFirstDocid, iLastDocid); dlwDestroy(&writer); } /* Helper function for posListUnion(). Compares the current position ** between left and right, returning as standard C idiom of <0 if ** left0 if left>right, and 0 if left==right. "End" always ** compares greater. */ static int posListCmp(PLReader *pLeft, PLReader *pRight){ assert( pLeft->iType==pRight->iType ); if( pLeft->iType==DL_DOCIDS ) return 0; if( plrAtEnd(pLeft) ) return plrAtEnd(pRight) ? 0 : 1; if( plrAtEnd(pRight) ) return -1; if( plrColumn(pLeft)plrColumn(pRight) ) return 1; if( plrPosition(pLeft)plrPosition(pRight) ) return 1; if( pLeft->iType==DL_POSITIONS ) return 0; if( plrStartOffset(pLeft)plrStartOffset(pRight) ) return 1; if( plrEndOffset(pLeft)plrEndOffset(pRight) ) return 1; return 0; } /* Write the union of position lists in pLeft and pRight to pOut. ** "Union" in this case meaning "All unique position tuples". Should ** work with any doclist type, though both inputs and the output ** should be the same type. */ static void posListUnion(DLReader *pLeft, DLReader *pRight, DLWriter *pOut){ PLReader left, right; PLWriter writer; assert( dlrDocid(pLeft)==dlrDocid(pRight) ); assert( pLeft->iType==pRight->iType ); assert( pLeft->iType==pOut->iType ); plrInit(&left, pLeft); plrInit(&right, pRight); plwInit(&writer, pOut, dlrDocid(pLeft)); while( !plrAtEnd(&left) || !plrAtEnd(&right) ){ int c = posListCmp(&left, &right); if( c<0 ){ plwCopy(&writer, &left); plrStep(&left); }else if( c>0 ){ plwCopy(&writer, &right); plrStep(&right); }else{ plwCopy(&writer, &left); plrStep(&left); plrStep(&right); } } plwTerminate(&writer); plwDestroy(&writer); plrDestroy(&left); plrDestroy(&right); } /* Write the union of doclists in pLeft and pRight to pOut. For ** docids in common between the inputs, the union of the position ** lists is written. Inputs and outputs are always type DL_DEFAULT. */ static void docListUnion( const char *pLeft, int nLeft, const char *pRight, int nRight, DataBuffer *pOut /* Write the combined doclist here */ ){ DLReader left, right; DLWriter writer; if( nLeft==0 ){ if( nRight!=0) dataBufferAppend(pOut, pRight, nRight); return; } if( nRight==0 ){ dataBufferAppend(pOut, pLeft, nLeft); return; } dlrInit(&left, DL_DEFAULT, pLeft, nLeft); dlrInit(&right, DL_DEFAULT, pRight, nRight); dlwInit(&writer, DL_DEFAULT, pOut); while( !dlrAtEnd(&left) || !dlrAtEnd(&right) ){ if( dlrAtEnd(&right) ){ dlwCopy(&writer, &left); dlrStep(&left); }else if( dlrAtEnd(&left) ){ dlwCopy(&writer, &right); dlrStep(&right); }else if( dlrDocid(&left)dlrDocid(&right) ){ dlwCopy(&writer, &right); dlrStep(&right); }else{ posListUnion(&left, &right, &writer); dlrStep(&left); dlrStep(&right); } } dlrDestroy(&left); dlrDestroy(&right); dlwDestroy(&writer); } /* pLeft and pRight are DLReaders positioned to the same docid. ** ** If there are no instances in pLeft or pRight where the position ** of pLeft is one less than the position of pRight, then this ** routine adds nothing to pOut. ** ** If there are one or more instances where positions from pLeft ** are exactly one less than positions from pRight, then add a new ** document record to pOut. If pOut wants to hold positions, then ** include the positions from pRight that are one more than a ** position in pLeft. In other words: pRight.iPos==pLeft.iPos+1. */ static void posListPhraseMerge(DLReader *pLeft, DLReader *pRight, DLWriter *pOut){ PLReader left, right; PLWriter writer; int match = 0; assert( dlrDocid(pLeft)==dlrDocid(pRight) ); assert( pOut->iType!=DL_POSITIONS_OFFSETS ); plrInit(&left, pLeft); plrInit(&right, pRight); while( !plrAtEnd(&left) && !plrAtEnd(&right) ){ if( plrColumn(&left)plrColumn(&right) ){ plrStep(&right); }else if( plrPosition(&left)+1plrPosition(&right) ){ plrStep(&right); }else{ if( !match ){ plwInit(&writer, pOut, dlrDocid(pLeft)); match = 1; } plwAdd(&writer, plrColumn(&right), plrPosition(&right), 0, 0); plrStep(&left); plrStep(&right); } } if( match ){ plwTerminate(&writer); plwDestroy(&writer); } plrDestroy(&left); plrDestroy(&right); } /* We have two doclists with positions: pLeft and pRight. ** Write the phrase intersection of these two doclists into pOut. ** ** A phrase intersection means that two documents only match ** if pLeft.iPos+1==pRight.iPos. ** ** iType controls the type of data written to pOut. If iType is ** DL_POSITIONS, the positions are those from pRight. */ static void docListPhraseMerge( const char *pLeft, int nLeft, const char *pRight, int nRight, DocListType iType, DataBuffer *pOut /* Write the combined doclist here */ ){ DLReader left, right; DLWriter writer; if( nLeft==0 || nRight==0 ) return; assert( iType!=DL_POSITIONS_OFFSETS ); dlrInit(&left, DL_POSITIONS, pLeft, nLeft); dlrInit(&right, DL_POSITIONS, pRight, nRight); dlwInit(&writer, iType, pOut); while( !dlrAtEnd(&left) && !dlrAtEnd(&right) ){ if( dlrDocid(&left) one AND (two OR three) * [one OR two three] ==> (one OR two) AND three * * A "-" before a term matches all entries that lack that term. * The "-" must occur immediately before the term with in intervening * space. This is how the search engines do it. * * A NOT term cannot be the right-hand operand of an OR. If this * occurs in the query string, the NOT is ignored: * * [one OR -two] ==> one OR two * */ typedef struct Query { fulltext_vtab *pFts; /* The full text index */ int nTerms; /* Number of terms in the query */ QueryTerm *pTerms; /* Array of terms. Space obtained from malloc() */ int nextIsOr; /* Set the isOr flag on the next inserted term */ int nextColumn; /* Next word parsed must be in this column */ int dfltColumn; /* The default column */ } Query; /* ** An instance of the following structure keeps track of generated ** matching-word offset information and snippets. */ typedef struct Snippet { int nMatch; /* Total number of matches */ int nAlloc; /* Space allocated for aMatch[] */ struct snippetMatch { /* One entry for each matching term */ char snStatus; /* Status flag for use while constructing snippets */ short int iCol; /* The column that contains the match */ short int iTerm; /* The index in Query.pTerms[] of the matching term */ short int nByte; /* Number of bytes in the term */ int iStart; /* The offset to the first character of the term */ } *aMatch; /* Points to space obtained from malloc */ char *zOffset; /* Text rendering of aMatch[] */ int nOffset; /* strlen(zOffset) */ char *zSnippet; /* Snippet text */ int nSnippet; /* strlen(zSnippet) */ } Snippet; typedef enum QueryType { QUERY_GENERIC, /* table scan */ QUERY_ROWID, /* lookup by rowid */ QUERY_FULLTEXT /* QUERY_FULLTEXT + [i] is a full-text search for column i*/ } QueryType; typedef enum fulltext_statement { CONTENT_INSERT_STMT, CONTENT_SELECT_STMT, CONTENT_UPDATE_STMT, CONTENT_DELETE_STMT, CONTENT_EXISTS_STMT, BLOCK_INSERT_STMT, BLOCK_SELECT_STMT, BLOCK_DELETE_STMT, BLOCK_DELETE_ALL_STMT, SEGDIR_MAX_INDEX_STMT, SEGDIR_SET_STMT, SEGDIR_SELECT_LEVEL_STMT, SEGDIR_SPAN_STMT, SEGDIR_DELETE_STMT, SEGDIR_SELECT_SEGMENT_STMT, SEGDIR_SELECT_ALL_STMT, SEGDIR_DELETE_ALL_STMT, SEGDIR_COUNT_STMT, MAX_STMT /* Always at end! */ } fulltext_statement; /* These must exactly match the enum above. */ /* TODO(shess): Is there some risk that a statement will be used in two ** cursors at once, e.g. if a query joins a virtual table to itself? ** If so perhaps we should move some of these to the cursor object. */ static const char *const fulltext_zStatement[MAX_STMT] = { /* CONTENT_INSERT */ NULL, /* generated in contentInsertStatement() */ /* CONTENT_SELECT */ "select * from %_content where rowid = ?", /* CONTENT_UPDATE */ NULL, /* generated in contentUpdateStatement() */ /* CONTENT_DELETE */ "delete from %_content where rowid = ?", /* CONTENT_EXISTS */ "select rowid from %_content limit 1", /* BLOCK_INSERT */ "insert into %_segments values (?)", /* BLOCK_SELECT */ "select block from %_segments where rowid = ?", /* BLOCK_DELETE */ "delete from %_segments where rowid between ? and ?", /* BLOCK_DELETE_ALL */ "delete from %_segments", /* SEGDIR_MAX_INDEX */ "select max(idx) from %_segdir where level = ?", /* SEGDIR_SET */ "insert into %_segdir values (?, ?, ?, ?, ?, ?)", /* SEGDIR_SELECT_LEVEL */ "select start_block, leaves_end_block, root from %_segdir " " where level = ? order by idx", /* SEGDIR_SPAN */ "select min(start_block), max(end_block) from %_segdir " " where level = ? and start_block <> 0", /* SEGDIR_DELETE */ "delete from %_segdir where level = ?", /* NOTE(shess): The first three results of the following two ** statements must match. */ /* SEGDIR_SELECT_SEGMENT */ "select start_block, leaves_end_block, root from %_segdir " " where level = ? and idx = ?", /* SEGDIR_SELECT_ALL */ "select start_block, leaves_end_block, root from %_segdir " " order by level desc, idx asc", /* SEGDIR_DELETE_ALL */ "delete from %_segdir", /* SEGDIR_COUNT */ "select count(*), ifnull(max(level),0) from %_segdir", }; /* ** A connection to a fulltext index is an instance of the following ** structure. The xCreate and xConnect methods create an instance ** of this structure and xDestroy and xDisconnect free that instance. ** All other methods receive a pointer to the structure as one of their ** arguments. */ struct fulltext_vtab { sqlite3_vtab base; /* Base class used by SQLite core */ sqlite3 *db; /* The database connection */ const char *zDb; /* logical database name */ const char *zName; /* virtual table name */ int nColumn; /* number of columns in virtual table */ char **azColumn; /* column names. malloced */ char **azContentColumn; /* column names in content table; malloced */ sqlite3_tokenizer *pTokenizer; /* tokenizer for inserts and queries */ /* Precompiled statements which we keep as long as the table is ** open. */ sqlite3_stmt *pFulltextStatements[MAX_STMT]; /* Precompiled statements used for segment merges. We run a ** separate select across the leaf level of each tree being merged. */ sqlite3_stmt *pLeafSelectStmts[MERGE_COUNT]; /* The statement used to prepare pLeafSelectStmts. */ #define LEAF_SELECT \ "select block from %_segments where rowid between ? and ? order by rowid" /* These buffer pending index updates during transactions. ** nPendingData estimates the memory size of the pending data. It ** doesn't include the hash-bucket overhead, nor any malloc ** overhead. When nPendingData exceeds kPendingThreshold, the ** buffer is flushed even before the transaction closes. ** pendingTerms stores the data, and is only valid when nPendingData ** is >=0 (nPendingData<0 means pendingTerms has not been ** initialized). iPrevDocid is the last docid written, used to make ** certain we're inserting in sorted order. */ int nPendingData; #define kPendingThreshold (1*1024*1024) sqlite_int64 iPrevDocid; fts2Hash pendingTerms; }; /* ** When the core wants to do a query, it create a cursor using a ** call to xOpen. This structure is an instance of a cursor. It ** is destroyed by xClose. */ typedef struct fulltext_cursor { sqlite3_vtab_cursor base; /* Base class used by SQLite core */ QueryType iCursorType; /* Copy of sqlite3_index_info.idxNum */ sqlite3_stmt *pStmt; /* Prepared statement in use by the cursor */ int eof; /* True if at End Of Results */ Query q; /* Parsed query string */ Snippet snippet; /* Cached snippet for the current row */ int iColumn; /* Column being searched */ DataBuffer result; /* Doclist results from fulltextQuery */ DLReader reader; /* Result reader if result not empty */ } fulltext_cursor; static struct fulltext_vtab *cursor_vtab(fulltext_cursor *c){ return (fulltext_vtab *) c->base.pVtab; } static const sqlite3_module fts2Module; /* forward declaration */ /* Return a dynamically generated statement of the form * insert into %_content (rowid, ...) values (?, ...) */ static const char *contentInsertStatement(fulltext_vtab *v){ StringBuffer sb; int i; initStringBuffer(&sb); append(&sb, "insert into %_content (rowid, "); appendList(&sb, v->nColumn, v->azContentColumn); append(&sb, ") values (?"); for(i=0; inColumn; ++i) append(&sb, ", ?"); append(&sb, ")"); return stringBufferData(&sb); } /* Return a dynamically generated statement of the form * update %_content set [col_0] = ?, [col_1] = ?, ... * where rowid = ? */ static const char *contentUpdateStatement(fulltext_vtab *v){ StringBuffer sb; int i; initStringBuffer(&sb); append(&sb, "update %_content set "); for(i=0; inColumn; ++i) { if( i>0 ){ append(&sb, ", "); } append(&sb, v->azContentColumn[i]); append(&sb, " = ?"); } append(&sb, " where rowid = ?"); return stringBufferData(&sb); } /* Puts a freshly-prepared statement determined by iStmt in *ppStmt. ** If the indicated statement has never been prepared, it is prepared ** and cached, otherwise the cached version is reset. */ static int sql_get_statement(fulltext_vtab *v, fulltext_statement iStmt, sqlite3_stmt **ppStmt){ assert( iStmtpFulltextStatements[iStmt]==NULL ){ const char *zStmt; int rc; switch( iStmt ){ case CONTENT_INSERT_STMT: zStmt = contentInsertStatement(v); break; case CONTENT_UPDATE_STMT: zStmt = contentUpdateStatement(v); break; default: zStmt = fulltext_zStatement[iStmt]; } rc = sql_prepare(v->db, v->zDb, v->zName, &v->pFulltextStatements[iStmt], zStmt); if( zStmt != fulltext_zStatement[iStmt]) sqlite3_free((void *) zStmt); if( rc!=SQLITE_OK ) return rc; } else { int rc = sqlite3_reset(v->pFulltextStatements[iStmt]); if( rc!=SQLITE_OK ) return rc; } *ppStmt = v->pFulltextStatements[iStmt]; return SQLITE_OK; } /* Like sqlite3_step(), but convert SQLITE_DONE to SQLITE_OK and ** SQLITE_ROW to SQLITE_ERROR. Useful for statements like UPDATE, ** where we expect no results. */ static int sql_single_step(sqlite3_stmt *s){ int rc = sqlite3_step(s); return (rc==SQLITE_DONE) ? SQLITE_OK : rc; } /* Like sql_get_statement(), but for special replicated LEAF_SELECT ** statements. idx -1 is a special case for an uncached version of ** the statement (used in the optimize implementation). */ /* TODO(shess) Write version for generic statements and then share ** that between the cached-statement functions. */ static int sql_get_leaf_statement(fulltext_vtab *v, int idx, sqlite3_stmt **ppStmt){ assert( idx>=-1 && idxdb, v->zDb, v->zName, ppStmt, LEAF_SELECT); }else if( v->pLeafSelectStmts[idx]==NULL ){ int rc = sql_prepare(v->db, v->zDb, v->zName, &v->pLeafSelectStmts[idx], LEAF_SELECT); if( rc!=SQLITE_OK ) return rc; }else{ int rc = sqlite3_reset(v->pLeafSelectStmts[idx]); if( rc!=SQLITE_OK ) return rc; } *ppStmt = v->pLeafSelectStmts[idx]; return SQLITE_OK; } /* insert into %_content (rowid, ...) values ([rowid], [pValues]) */ static int content_insert(fulltext_vtab *v, sqlite3_value *rowid, sqlite3_value **pValues){ sqlite3_stmt *s; int i; int rc = sql_get_statement(v, CONTENT_INSERT_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_value(s, 1, rowid); if( rc!=SQLITE_OK ) return rc; for(i=0; inColumn; ++i){ rc = sqlite3_bind_value(s, 2+i, pValues[i]); if( rc!=SQLITE_OK ) return rc; } return sql_single_step(s); } /* update %_content set col0 = pValues[0], col1 = pValues[1], ... * where rowid = [iRowid] */ static int content_update(fulltext_vtab *v, sqlite3_value **pValues, sqlite_int64 iRowid){ sqlite3_stmt *s; int i; int rc = sql_get_statement(v, CONTENT_UPDATE_STMT, &s); if( rc!=SQLITE_OK ) return rc; for(i=0; inColumn; ++i){ rc = sqlite3_bind_value(s, 1+i, pValues[i]); if( rc!=SQLITE_OK ) return rc; } rc = sqlite3_bind_int64(s, 1+v->nColumn, iRowid); if( rc!=SQLITE_OK ) return rc; return sql_single_step(s); } static void freeStringArray(int nString, const char **pString){ int i; for (i=0 ; i < nString ; ++i) { if( pString[i]!=NULL ) sqlite3_free((void *) pString[i]); } sqlite3_free((void *) pString); } /* select * from %_content where rowid = [iRow] * The caller must delete the returned array and all strings in it. * null fields will be NULL in the returned array. * * TODO: Perhaps we should return pointer/length strings here for consistency * with other code which uses pointer/length. */ static int content_select(fulltext_vtab *v, sqlite_int64 iRow, const char ***pValues){ sqlite3_stmt *s; const char **values; int i; int rc; *pValues = NULL; rc = sql_get_statement(v, CONTENT_SELECT_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 1, iRow); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_step(s); if( rc!=SQLITE_ROW ) return rc; values = (const char **) sqlite3_malloc(v->nColumn * sizeof(const char *)); for(i=0; inColumn; ++i){ if( sqlite3_column_type(s, i)==SQLITE_NULL ){ values[i] = NULL; }else{ values[i] = string_dup((char*)sqlite3_column_text(s, i)); } } /* We expect only one row. We must execute another sqlite3_step() * to complete the iteration; otherwise the table will remain locked. */ rc = sqlite3_step(s); if( rc==SQLITE_DONE ){ *pValues = values; return SQLITE_OK; } freeStringArray(v->nColumn, values); return rc; } /* delete from %_content where rowid = [iRow ] */ static int content_delete(fulltext_vtab *v, sqlite_int64 iRow){ sqlite3_stmt *s; int rc = sql_get_statement(v, CONTENT_DELETE_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 1, iRow); if( rc!=SQLITE_OK ) return rc; return sql_single_step(s); } /* Returns SQLITE_ROW if any rows exist in %_content, SQLITE_DONE if ** no rows exist, and any error in case of failure. */ static int content_exists(fulltext_vtab *v){ sqlite3_stmt *s; int rc = sql_get_statement(v, CONTENT_EXISTS_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_step(s); if( rc!=SQLITE_ROW ) return rc; /* We expect only one row. We must execute another sqlite3_step() * to complete the iteration; otherwise the table will remain locked. */ rc = sqlite3_step(s); if( rc==SQLITE_DONE ) return SQLITE_ROW; if( rc==SQLITE_ROW ) return SQLITE_ERROR; return rc; } /* insert into %_segments values ([pData]) ** returns assigned rowid in *piBlockid */ static int block_insert(fulltext_vtab *v, const char *pData, int nData, sqlite_int64 *piBlockid){ sqlite3_stmt *s; int rc = sql_get_statement(v, BLOCK_INSERT_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_blob(s, 1, pData, nData, SQLITE_STATIC); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_step(s); if( rc==SQLITE_ROW ) return SQLITE_ERROR; if( rc!=SQLITE_DONE ) return rc; *piBlockid = sqlite3_last_insert_rowid(v->db); return SQLITE_OK; } /* delete from %_segments ** where rowid between [iStartBlockid] and [iEndBlockid] ** ** Deletes the range of blocks, inclusive, used to delete the blocks ** which form a segment. */ static int block_delete(fulltext_vtab *v, sqlite_int64 iStartBlockid, sqlite_int64 iEndBlockid){ sqlite3_stmt *s; int rc = sql_get_statement(v, BLOCK_DELETE_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 1, iStartBlockid); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 2, iEndBlockid); if( rc!=SQLITE_OK ) return rc; return sql_single_step(s); } /* Returns SQLITE_ROW with *pidx set to the maximum segment idx found ** at iLevel. Returns SQLITE_DONE if there are no segments at ** iLevel. Otherwise returns an error. */ static int segdir_max_index(fulltext_vtab *v, int iLevel, int *pidx){ sqlite3_stmt *s; int rc = sql_get_statement(v, SEGDIR_MAX_INDEX_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int(s, 1, iLevel); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_step(s); /* Should always get at least one row due to how max() works. */ if( rc==SQLITE_DONE ) return SQLITE_DONE; if( rc!=SQLITE_ROW ) return rc; /* NULL means that there were no inputs to max(). */ if( SQLITE_NULL==sqlite3_column_type(s, 0) ){ rc = sqlite3_step(s); if( rc==SQLITE_ROW ) return SQLITE_ERROR; return rc; } *pidx = sqlite3_column_int(s, 0); /* We expect only one row. We must execute another sqlite3_step() * to complete the iteration; otherwise the table will remain locked. */ rc = sqlite3_step(s); if( rc==SQLITE_ROW ) return SQLITE_ERROR; if( rc!=SQLITE_DONE ) return rc; return SQLITE_ROW; } /* insert into %_segdir values ( ** [iLevel], [idx], ** [iStartBlockid], [iLeavesEndBlockid], [iEndBlockid], ** [pRootData] ** ) */ static int segdir_set(fulltext_vtab *v, int iLevel, int idx, sqlite_int64 iStartBlockid, sqlite_int64 iLeavesEndBlockid, sqlite_int64 iEndBlockid, const char *pRootData, int nRootData){ sqlite3_stmt *s; int rc = sql_get_statement(v, SEGDIR_SET_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int(s, 1, iLevel); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int(s, 2, idx); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 3, iStartBlockid); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 4, iLeavesEndBlockid); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 5, iEndBlockid); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_blob(s, 6, pRootData, nRootData, SQLITE_STATIC); if( rc!=SQLITE_OK ) return rc; return sql_single_step(s); } /* Queries %_segdir for the block span of the segments in level ** iLevel. Returns SQLITE_DONE if there are no blocks for iLevel, ** SQLITE_ROW if there are blocks, else an error. */ static int segdir_span(fulltext_vtab *v, int iLevel, sqlite_int64 *piStartBlockid, sqlite_int64 *piEndBlockid){ sqlite3_stmt *s; int rc = sql_get_statement(v, SEGDIR_SPAN_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int(s, 1, iLevel); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_step(s); if( rc==SQLITE_DONE ) return SQLITE_DONE; /* Should never happen */ if( rc!=SQLITE_ROW ) return rc; /* This happens if all segments at this level are entirely inline. */ if( SQLITE_NULL==sqlite3_column_type(s, 0) ){ /* We expect only one row. We must execute another sqlite3_step() * to complete the iteration; otherwise the table will remain locked. */ int rc2 = sqlite3_step(s); if( rc2==SQLITE_ROW ) return SQLITE_ERROR; return rc2; } *piStartBlockid = sqlite3_column_int64(s, 0); *piEndBlockid = sqlite3_column_int64(s, 1); /* We expect only one row. We must execute another sqlite3_step() * to complete the iteration; otherwise the table will remain locked. */ rc = sqlite3_step(s); if( rc==SQLITE_ROW ) return SQLITE_ERROR; if( rc!=SQLITE_DONE ) return rc; return SQLITE_ROW; } /* Delete the segment blocks and segment directory records for all ** segments at iLevel. */ static int segdir_delete(fulltext_vtab *v, int iLevel){ sqlite3_stmt *s; sqlite_int64 iStartBlockid, iEndBlockid; int rc = segdir_span(v, iLevel, &iStartBlockid, &iEndBlockid); if( rc!=SQLITE_ROW && rc!=SQLITE_DONE ) return rc; if( rc==SQLITE_ROW ){ rc = block_delete(v, iStartBlockid, iEndBlockid); if( rc!=SQLITE_OK ) return rc; } /* Delete the segment directory itself. */ rc = sql_get_statement(v, SEGDIR_DELETE_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 1, iLevel); if( rc!=SQLITE_OK ) return rc; return sql_single_step(s); } /* Delete entire fts index, SQLITE_OK on success, relevant error on ** failure. */ static int segdir_delete_all(fulltext_vtab *v){ sqlite3_stmt *s; int rc = sql_get_statement(v, SEGDIR_DELETE_ALL_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sql_single_step(s); if( rc!=SQLITE_OK ) return rc; rc = sql_get_statement(v, BLOCK_DELETE_ALL_STMT, &s); if( rc!=SQLITE_OK ) return rc; return sql_single_step(s); } /* Returns SQLITE_OK with *pnSegments set to the number of entries in ** %_segdir and *piMaxLevel set to the highest level which has a ** segment. Otherwise returns the SQLite error which caused failure. */ static int segdir_count(fulltext_vtab *v, int *pnSegments, int *piMaxLevel){ sqlite3_stmt *s; int rc = sql_get_statement(v, SEGDIR_COUNT_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_step(s); /* TODO(shess): This case should not be possible? Should stronger ** measures be taken if it happens? */ if( rc==SQLITE_DONE ){ *pnSegments = 0; *piMaxLevel = 0; return SQLITE_OK; } if( rc!=SQLITE_ROW ) return rc; *pnSegments = sqlite3_column_int(s, 0); *piMaxLevel = sqlite3_column_int(s, 1); /* We expect only one row. We must execute another sqlite3_step() * to complete the iteration; otherwise the table will remain locked. */ rc = sqlite3_step(s); if( rc==SQLITE_DONE ) return SQLITE_OK; if( rc==SQLITE_ROW ) return SQLITE_ERROR; return rc; } /* TODO(shess) clearPendingTerms() is far down the file because ** writeZeroSegment() is far down the file because LeafWriter is far ** down the file. Consider refactoring the code to move the non-vtab ** code above the vtab code so that we don't need this forward ** reference. */ static int clearPendingTerms(fulltext_vtab *v); /* ** Free the memory used to contain a fulltext_vtab structure. */ static void fulltext_vtab_destroy(fulltext_vtab *v){ int iStmt, i; TRACE(("FTS2 Destroy %p\n", v)); for( iStmt=0; iStmtpFulltextStatements[iStmt]!=NULL ){ sqlite3_finalize(v->pFulltextStatements[iStmt]); v->pFulltextStatements[iStmt] = NULL; } } for( i=0; ipLeafSelectStmts[i]!=NULL ){ sqlite3_finalize(v->pLeafSelectStmts[i]); v->pLeafSelectStmts[i] = NULL; } } if( v->pTokenizer!=NULL ){ v->pTokenizer->pModule->xDestroy(v->pTokenizer); v->pTokenizer = NULL; } clearPendingTerms(v); sqlite3_free(v->azColumn); for(i = 0; i < v->nColumn; ++i) { sqlite3_free(v->azContentColumn[i]); } sqlite3_free(v->azContentColumn); sqlite3_free(v); } /* ** Token types for parsing the arguments to xConnect or xCreate. */ #define TOKEN_EOF 0 /* End of file */ #define TOKEN_SPACE 1 /* Any kind of whitespace */ #define TOKEN_ID 2 /* An identifier */ #define TOKEN_STRING 3 /* A string literal */ #define TOKEN_PUNCT 4 /* A single punctuation character */ /* ** If X is a character that can be used in an identifier then ** IdChar(X) will be true. Otherwise it is false. ** ** For ASCII, any character with the high-order bit set is ** allowed in an identifier. For 7-bit characters, ** sqlite3IsIdChar[X] must be 1. ** ** Ticket #1066. the SQL standard does not allow '$' in the ** middle of identfiers. But many SQL implementations do. ** SQLite will allow '$' in identifiers for compatibility. ** But the feature is undocumented. */ static const char isIdChar[] = { /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 3x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 7x */ }; #define IdChar(C) (((c=C)&0x80)!=0 || (c>0x1f && isIdChar[c-0x20])) /* ** Return the length of the token that begins at z[0]. ** Store the token type in *tokenType before returning. */ static int getToken(const char *z, int *tokenType){ int i, c; switch( *z ){ case 0: { *tokenType = TOKEN_EOF; return 0; } case ' ': case '\t': case '\n': case '\f': case '\r': { for(i=1; safe_isspace(z[i]); i++){} *tokenType = TOKEN_SPACE; return i; } case '`': case '\'': case '"': { int delim = z[0]; for(i=1; (c=z[i])!=0; i++){ if( c==delim ){ if( z[i+1]==delim ){ i++; }else{ break; } } } *tokenType = TOKEN_STRING; return i + (c!=0); } case '[': { for(i=1, c=z[0]; c!=']' && (c=z[i])!=0; i++){} *tokenType = TOKEN_ID; return i; } default: { if( !IdChar(*z) ){ break; } for(i=1; IdChar(z[i]); i++){} *tokenType = TOKEN_ID; return i; } } *tokenType = TOKEN_PUNCT; return 1; } /* ** A token extracted from a string is an instance of the following ** structure. */ typedef struct Token { const char *z; /* Pointer to token text. Not '\000' terminated */ short int n; /* Length of the token text in bytes. */ } Token; /* ** Given a input string (which is really one of the argv[] parameters ** passed into xConnect or xCreate) split the string up into tokens. ** Return an array of pointers to '\000' terminated strings, one string ** for each non-whitespace token. ** ** The returned array is terminated by a single NULL pointer. ** ** Space to hold the returned array is obtained from a single ** malloc and should be freed by passing the return value to free(). ** The individual strings within the token list are all a part of ** the single memory allocation and will all be freed at once. */ static char **tokenizeString(const char *z, int *pnToken){ int nToken = 0; Token *aToken = sqlite3_malloc( strlen(z) * sizeof(aToken[0]) ); int n = 1; int e, i; int totalSize = 0; char **azToken; char *zCopy; while( n>0 ){ n = getToken(z, &e); if( e!=TOKEN_SPACE ){ aToken[nToken].z = z; aToken[nToken].n = n; nToken++; totalSize += n+1; } z += n; } azToken = (char**)sqlite3_malloc( nToken*sizeof(char*) + totalSize ); zCopy = (char*)&azToken[nToken]; nToken--; for(i=0; i=0 ){ azIn[j] = azIn[i]; } j++; } } azIn[j] = 0; } } /* ** Find the first alphanumeric token in the string zIn. Null-terminate ** this token. Remove any quotation marks. And return a pointer to ** the result. */ static char *firstToken(char *zIn, char **pzTail){ int n, ttype; while(1){ n = getToken(zIn, &ttype); if( ttype==TOKEN_SPACE ){ zIn += n; }else if( ttype==TOKEN_EOF ){ *pzTail = zIn; return 0; }else{ zIn[n] = 0; *pzTail = &zIn[1]; dequoteString(zIn); return zIn; } } /*NOTREACHED*/ } /* Return true if... ** ** * s begins with the string t, ignoring case ** * s is longer than t ** * The first character of s beyond t is not a alphanumeric ** ** Ignore leading space in *s. ** ** To put it another way, return true if the first token of ** s[] is t[]. */ static int startsWith(const char *s, const char *t){ while( safe_isspace(*s) ){ s++; } while( *t ){ if( safe_tolower(*s++)!=safe_tolower(*t++) ) return 0; } return *s!='_' && !safe_isalnum(*s); } /* ** An instance of this structure defines the "spec" of a ** full text index. This structure is populated by parseSpec ** and use by fulltextConnect and fulltextCreate. */ typedef struct TableSpec { const char *zDb; /* Logical database name */ const char *zName; /* Name of the full-text index */ int nColumn; /* Number of columns to be indexed */ char **azColumn; /* Original names of columns to be indexed */ char **azContentColumn; /* Column names for %_content */ char **azTokenizer; /* Name of tokenizer and its arguments */ } TableSpec; /* ** Reclaim all of the memory used by a TableSpec */ static void clearTableSpec(TableSpec *p) { sqlite3_free(p->azColumn); sqlite3_free(p->azContentColumn); sqlite3_free(p->azTokenizer); } /* Parse a CREATE VIRTUAL TABLE statement, which looks like this: * * CREATE VIRTUAL TABLE email * USING fts2(subject, body, tokenize mytokenizer(myarg)) * * We return parsed information in a TableSpec structure. * */ static int parseSpec(TableSpec *pSpec, int argc, const char *const*argv, char**pzErr){ int i, n; char *z, *zDummy; char **azArg; const char *zTokenizer = 0; /* argv[] entry describing the tokenizer */ assert( argc>=3 ); /* Current interface: ** argv[0] - module name ** argv[1] - database name ** argv[2] - table name ** argv[3..] - columns, optionally followed by tokenizer specification ** and snippet delimiters specification. */ /* Make a copy of the complete argv[][] array in a single allocation. ** The argv[][] array is read-only and transient. We can write to the ** copy in order to modify things and the copy is persistent. */ CLEAR(pSpec); for(i=n=0; izDb = azArg[1]; pSpec->zName = azArg[2]; pSpec->nColumn = 0; pSpec->azColumn = azArg; zTokenizer = "tokenize simple"; for(i=3; inColumn] = firstToken(azArg[i], &zDummy); pSpec->nColumn++; } } if( pSpec->nColumn==0 ){ azArg[0] = "content"; pSpec->nColumn = 1; } /* ** Construct the list of content column names. ** ** Each content column name will be of the form cNNAAAA ** where NN is the column number and AAAA is the sanitized ** column name. "sanitized" means that special characters are ** converted to "_". The cNN prefix guarantees that all column ** names are unique. ** ** The AAAA suffix is not strictly necessary. It is included ** for the convenience of people who might examine the generated ** %_content table and wonder what the columns are used for. */ pSpec->azContentColumn = sqlite3_malloc( pSpec->nColumn * sizeof(char *) ); if( pSpec->azContentColumn==0 ){ clearTableSpec(pSpec); return SQLITE_NOMEM; } for(i=0; inColumn; i++){ char *p; pSpec->azContentColumn[i] = sqlite3_mprintf("c%d%s", i, azArg[i]); for (p = pSpec->azContentColumn[i]; *p ; ++p) { if( !safe_isalnum(*p) ) *p = '_'; } } /* ** Parse the tokenizer specification string. */ pSpec->azTokenizer = tokenizeString(zTokenizer, &n); tokenListToIdList(pSpec->azTokenizer); return SQLITE_OK; } /* ** Generate a CREATE TABLE statement that describes the schema of ** the virtual table. Return a pointer to this schema string. ** ** Space is obtained from sqlite3_mprintf() and should be freed ** using sqlite3_free(). */ static char *fulltextSchema( int nColumn, /* Number of columns */ const char *const* azColumn, /* List of columns */ const char *zTableName /* Name of the table */ ){ int i; char *zSchema, *zNext; const char *zSep = "("; zSchema = sqlite3_mprintf("CREATE TABLE x"); for(i=0; ibase */ v->db = db; v->zDb = spec->zDb; /* Freed when azColumn is freed */ v->zName = spec->zName; /* Freed when azColumn is freed */ v->nColumn = spec->nColumn; v->azContentColumn = spec->azContentColumn; spec->azContentColumn = 0; v->azColumn = spec->azColumn; spec->azColumn = 0; if( spec->azTokenizer==0 ){ return SQLITE_NOMEM; } zTok = spec->azTokenizer[0]; if( !zTok ){ zTok = "simple"; } nTok = strlen(zTok)+1; m = (sqlite3_tokenizer_module *)sqlite3Fts2HashFind(pHash, zTok, nTok); if( !m ){ *pzErr = sqlite3_mprintf("unknown tokenizer: %s", spec->azTokenizer[0]); rc = SQLITE_ERROR; goto err; } for(n=0; spec->azTokenizer[n]; n++){} if( n ){ rc = m->xCreate(n-1, (const char*const*)&spec->azTokenizer[1], &v->pTokenizer); }else{ rc = m->xCreate(0, 0, &v->pTokenizer); } if( rc!=SQLITE_OK ) goto err; v->pTokenizer->pModule = m; /* TODO: verify the existence of backing tables foo_content, foo_term */ schema = fulltextSchema(v->nColumn, (const char*const*)v->azColumn, spec->zName); rc = sqlite3_declare_vtab(db, schema); sqlite3_free(schema); if( rc!=SQLITE_OK ) goto err; memset(v->pFulltextStatements, 0, sizeof(v->pFulltextStatements)); /* Indicate that the buffer is not live. */ v->nPendingData = -1; *ppVTab = &v->base; TRACE(("FTS2 Connect %p\n", v)); return rc; err: fulltext_vtab_destroy(v); return rc; } static int fulltextConnect( sqlite3 *db, void *pAux, int argc, const char *const*argv, sqlite3_vtab **ppVTab, char **pzErr ){ TableSpec spec; int rc = parseSpec(&spec, argc, argv, pzErr); if( rc!=SQLITE_OK ) return rc; rc = constructVtab(db, (fts2Hash *)pAux, &spec, ppVTab, pzErr); clearTableSpec(&spec); return rc; } /* The %_content table holds the text of each document, with ** the rowid used as the docid. */ /* TODO(shess) This comment needs elaboration to match the updated ** code. Work it into the top-of-file comment at that time. */ static int fulltextCreate(sqlite3 *db, void *pAux, int argc, const char * const *argv, sqlite3_vtab **ppVTab, char **pzErr){ int rc; TableSpec spec; StringBuffer schema; TRACE(("FTS2 Create\n")); rc = parseSpec(&spec, argc, argv, pzErr); if( rc!=SQLITE_OK ) return rc; initStringBuffer(&schema); append(&schema, "CREATE TABLE %_content("); appendList(&schema, spec.nColumn, spec.azContentColumn); append(&schema, ")"); rc = sql_exec(db, spec.zDb, spec.zName, stringBufferData(&schema)); stringBufferDestroy(&schema); if( rc!=SQLITE_OK ) goto out; rc = sql_exec(db, spec.zDb, spec.zName, "create table %_segments(block blob);"); if( rc!=SQLITE_OK ) goto out; rc = sql_exec(db, spec.zDb, spec.zName, "create table %_segdir(" " level integer," " idx integer," " start_block integer," " leaves_end_block integer," " end_block integer," " root blob," " primary key(level, idx)" ");"); if( rc!=SQLITE_OK ) goto out; rc = constructVtab(db, (fts2Hash *)pAux, &spec, ppVTab, pzErr); out: clearTableSpec(&spec); return rc; } /* Decide how to handle an SQL query. */ static int fulltextBestIndex(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ int i; TRACE(("FTS2 BestIndex\n")); for(i=0; inConstraint; ++i){ const struct sqlite3_index_constraint *pConstraint; pConstraint = &pInfo->aConstraint[i]; if( pConstraint->usable ) { if( pConstraint->iColumn==-1 && pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){ pInfo->idxNum = QUERY_ROWID; /* lookup by rowid */ TRACE(("FTS2 QUERY_ROWID\n")); } else if( pConstraint->iColumn>=0 && pConstraint->op==SQLITE_INDEX_CONSTRAINT_MATCH ){ /* full-text search */ pInfo->idxNum = QUERY_FULLTEXT + pConstraint->iColumn; TRACE(("FTS2 QUERY_FULLTEXT %d\n", pConstraint->iColumn)); } else continue; pInfo->aConstraintUsage[i].argvIndex = 1; pInfo->aConstraintUsage[i].omit = 1; /* An arbitrary value for now. * TODO: Perhaps rowid matches should be considered cheaper than * full-text searches. */ pInfo->estimatedCost = 1.0; return SQLITE_OK; } } pInfo->idxNum = QUERY_GENERIC; return SQLITE_OK; } static int fulltextDisconnect(sqlite3_vtab *pVTab){ TRACE(("FTS2 Disconnect %p\n", pVTab)); fulltext_vtab_destroy((fulltext_vtab *)pVTab); return SQLITE_OK; } static int fulltextDestroy(sqlite3_vtab *pVTab){ fulltext_vtab *v = (fulltext_vtab *)pVTab; int rc; TRACE(("FTS2 Destroy %p\n", pVTab)); rc = sql_exec(v->db, v->zDb, v->zName, "drop table if exists %_content;" "drop table if exists %_segments;" "drop table if exists %_segdir;" ); if( rc!=SQLITE_OK ) return rc; fulltext_vtab_destroy((fulltext_vtab *)pVTab); return SQLITE_OK; } static int fulltextOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ fulltext_cursor *c; c = (fulltext_cursor *) sqlite3_malloc(sizeof(fulltext_cursor)); if( c ){ memset(c, 0, sizeof(fulltext_cursor)); /* sqlite will initialize c->base */ *ppCursor = &c->base; TRACE(("FTS2 Open %p: %p\n", pVTab, c)); return SQLITE_OK; }else{ return SQLITE_NOMEM; } } /* Free all of the dynamically allocated memory held by *q */ static void queryClear(Query *q){ int i; for(i = 0; i < q->nTerms; ++i){ sqlite3_free(q->pTerms[i].pTerm); } sqlite3_free(q->pTerms); CLEAR(q); } /* Free all of the dynamically allocated memory held by the ** Snippet */ static void snippetClear(Snippet *p){ sqlite3_free(p->aMatch); sqlite3_free(p->zOffset); sqlite3_free(p->zSnippet); CLEAR(p); } /* ** Append a single entry to the p->aMatch[] log. */ static void snippetAppendMatch( Snippet *p, /* Append the entry to this snippet */ int iCol, int iTerm, /* The column and query term */ int iStart, int nByte /* Offset and size of the match */ ){ int i; struct snippetMatch *pMatch; if( p->nMatch+1>=p->nAlloc ){ p->nAlloc = p->nAlloc*2 + 10; p->aMatch = sqlite3_realloc(p->aMatch, p->nAlloc*sizeof(p->aMatch[0]) ); if( p->aMatch==0 ){ p->nMatch = 0; p->nAlloc = 0; return; } } i = p->nMatch++; pMatch = &p->aMatch[i]; pMatch->iCol = iCol; pMatch->iTerm = iTerm; pMatch->iStart = iStart; pMatch->nByte = nByte; } /* ** Sizing information for the circular buffer used in snippetOffsetsOfColumn() */ #define FTS2_ROTOR_SZ (32) #define FTS2_ROTOR_MASK (FTS2_ROTOR_SZ-1) /* ** Add entries to pSnippet->aMatch[] for every match that occurs against ** document zDoc[0..nDoc-1] which is stored in column iColumn. */ static void snippetOffsetsOfColumn( Query *pQuery, Snippet *pSnippet, int iColumn, const char *zDoc, int nDoc ){ const sqlite3_tokenizer_module *pTModule; /* The tokenizer module */ sqlite3_tokenizer *pTokenizer; /* The specific tokenizer */ sqlite3_tokenizer_cursor *pTCursor; /* Tokenizer cursor */ fulltext_vtab *pVtab; /* The full text index */ int nColumn; /* Number of columns in the index */ const QueryTerm *aTerm; /* Query string terms */ int nTerm; /* Number of query string terms */ int i, j; /* Loop counters */ int rc; /* Return code */ unsigned int match, prevMatch; /* Phrase search bitmasks */ const char *zToken; /* Next token from the tokenizer */ int nToken; /* Size of zToken */ int iBegin, iEnd, iPos; /* Offsets of beginning and end */ /* The following variables keep a circular buffer of the last ** few tokens */ unsigned int iRotor = 0; /* Index of current token */ int iRotorBegin[FTS2_ROTOR_SZ]; /* Beginning offset of token */ int iRotorLen[FTS2_ROTOR_SZ]; /* Length of token */ pVtab = pQuery->pFts; nColumn = pVtab->nColumn; pTokenizer = pVtab->pTokenizer; pTModule = pTokenizer->pModule; rc = pTModule->xOpen(pTokenizer, zDoc, nDoc, &pTCursor); if( rc ) return; pTCursor->pTokenizer = pTokenizer; aTerm = pQuery->pTerms; nTerm = pQuery->nTerms; if( nTerm>=FTS2_ROTOR_SZ ){ nTerm = FTS2_ROTOR_SZ - 1; } prevMatch = 0; while(1){ rc = pTModule->xNext(pTCursor, &zToken, &nToken, &iBegin, &iEnd, &iPos); if( rc ) break; iRotorBegin[iRotor&FTS2_ROTOR_MASK] = iBegin; iRotorLen[iRotor&FTS2_ROTOR_MASK] = iEnd-iBegin; match = 0; for(i=0; i=0 && iColnToken ) continue; if( !aTerm[i].isPrefix && aTerm[i].nTerm1 && (prevMatch & (1<=0; j--){ int k = (iRotor-j) & FTS2_ROTOR_MASK; snippetAppendMatch(pSnippet, iColumn, i-j, iRotorBegin[k], iRotorLen[k]); } } } prevMatch = match<<1; iRotor++; } pTModule->xClose(pTCursor); } /* ** Compute all offsets for the current row of the query. ** If the offsets have already been computed, this routine is a no-op. */ static void snippetAllOffsets(fulltext_cursor *p){ int nColumn; int iColumn, i; int iFirst, iLast; fulltext_vtab *pFts; if( p->snippet.nMatch ) return; if( p->q.nTerms==0 ) return; pFts = p->q.pFts; nColumn = pFts->nColumn; iColumn = (p->iCursorType - QUERY_FULLTEXT); if( iColumn<0 || iColumn>=nColumn ){ iFirst = 0; iLast = nColumn-1; }else{ iFirst = iColumn; iLast = iColumn; } for(i=iFirst; i<=iLast; i++){ const char *zDoc; int nDoc; zDoc = (const char*)sqlite3_column_text(p->pStmt, i+1); nDoc = sqlite3_column_bytes(p->pStmt, i+1); snippetOffsetsOfColumn(&p->q, &p->snippet, i, zDoc, nDoc); } } /* ** Convert the information in the aMatch[] array of the snippet ** into the string zOffset[0..nOffset-1]. */ static void snippetOffsetText(Snippet *p){ int i; int cnt = 0; StringBuffer sb; char zBuf[200]; if( p->zOffset ) return; initStringBuffer(&sb); for(i=0; inMatch; i++){ struct snippetMatch *pMatch = &p->aMatch[i]; zBuf[0] = ' '; sqlite3_snprintf(sizeof(zBuf)-1, &zBuf[cnt>0], "%d %d %d %d", pMatch->iCol, pMatch->iTerm, pMatch->iStart, pMatch->nByte); append(&sb, zBuf); cnt++; } p->zOffset = stringBufferData(&sb); p->nOffset = stringBufferLength(&sb); } /* ** zDoc[0..nDoc-1] is phrase of text. aMatch[0..nMatch-1] are a set ** of matching words some of which might be in zDoc. zDoc is column ** number iCol. ** ** iBreak is suggested spot in zDoc where we could begin or end an ** excerpt. Return a value similar to iBreak but possibly adjusted ** to be a little left or right so that the break point is better. */ static int wordBoundary( int iBreak, /* The suggested break point */ const char *zDoc, /* Document text */ int nDoc, /* Number of bytes in zDoc[] */ struct snippetMatch *aMatch, /* Matching words */ int nMatch, /* Number of entries in aMatch[] */ int iCol /* The column number for zDoc[] */ ){ int i; if( iBreak<=10 ){ return 0; } if( iBreak>=nDoc-10 ){ return nDoc; } for(i=0; i0 && aMatch[i-1].iStart+aMatch[i-1].nByte>=iBreak ){ return aMatch[i-1].iStart; } } for(i=1; i<=10; i++){ if( safe_isspace(zDoc[iBreak-i]) ){ return iBreak - i + 1; } if( safe_isspace(zDoc[iBreak+i]) ){ return iBreak + i + 1; } } return iBreak; } /* ** Allowed values for Snippet.aMatch[].snStatus */ #define SNIPPET_IGNORE 0 /* It is ok to omit this match from the snippet */ #define SNIPPET_DESIRED 1 /* We want to include this match in the snippet */ /* ** Generate the text of a snippet. */ static void snippetText( fulltext_cursor *pCursor, /* The cursor we need the snippet for */ const char *zStartMark, /* Markup to appear before each match */ const char *zEndMark, /* Markup to appear after each match */ const char *zEllipsis /* Ellipsis mark */ ){ int i, j; struct snippetMatch *aMatch; int nMatch; int nDesired; StringBuffer sb; int tailCol; int tailOffset; int iCol; int nDoc; const char *zDoc; int iStart, iEnd; int tailEllipsis = 0; int iMatch; sqlite3_free(pCursor->snippet.zSnippet); pCursor->snippet.zSnippet = 0; aMatch = pCursor->snippet.aMatch; nMatch = pCursor->snippet.nMatch; initStringBuffer(&sb); for(i=0; iq.nTerms; i++){ for(j=0; j0; i++){ if( aMatch[i].snStatus!=SNIPPET_DESIRED ) continue; nDesired--; iCol = aMatch[i].iCol; zDoc = (const char*)sqlite3_column_text(pCursor->pStmt, iCol+1); nDoc = sqlite3_column_bytes(pCursor->pStmt, iCol+1); iStart = aMatch[i].iStart - 40; iStart = wordBoundary(iStart, zDoc, nDoc, aMatch, nMatch, iCol); if( iStart<=10 ){ iStart = 0; } if( iCol==tailCol && iStart<=tailOffset+20 ){ iStart = tailOffset; } if( (iCol!=tailCol && tailCol>=0) || iStart!=tailOffset ){ trimWhiteSpace(&sb); appendWhiteSpace(&sb); append(&sb, zEllipsis); appendWhiteSpace(&sb); } iEnd = aMatch[i].iStart + aMatch[i].nByte + 40; iEnd = wordBoundary(iEnd, zDoc, nDoc, aMatch, nMatch, iCol); if( iEnd>=nDoc-10 ){ iEnd = nDoc; tailEllipsis = 0; }else{ tailEllipsis = 1; } while( iMatchsnippet.zSnippet = stringBufferData(&sb); pCursor->snippet.nSnippet = stringBufferLength(&sb); } /* ** Close the cursor. For additional information see the documentation ** on the xClose method of the virtual table interface. */ static int fulltextClose(sqlite3_vtab_cursor *pCursor){ fulltext_cursor *c = (fulltext_cursor *) pCursor; TRACE(("FTS2 Close %p\n", c)); sqlite3_finalize(c->pStmt); queryClear(&c->q); snippetClear(&c->snippet); if( c->result.nData!=0 ) dlrDestroy(&c->reader); dataBufferDestroy(&c->result); sqlite3_free(c); return SQLITE_OK; } static int fulltextNext(sqlite3_vtab_cursor *pCursor){ fulltext_cursor *c = (fulltext_cursor *) pCursor; int rc; TRACE(("FTS2 Next %p\n", pCursor)); snippetClear(&c->snippet); if( c->iCursorType < QUERY_FULLTEXT ){ /* TODO(shess) Handle SQLITE_SCHEMA AND SQLITE_BUSY. */ rc = sqlite3_step(c->pStmt); switch( rc ){ case SQLITE_ROW: c->eof = 0; return SQLITE_OK; case SQLITE_DONE: c->eof = 1; return SQLITE_OK; default: c->eof = 1; return rc; } } else { /* full-text query */ rc = sqlite3_reset(c->pStmt); if( rc!=SQLITE_OK ) return rc; if( c->result.nData==0 || dlrAtEnd(&c->reader) ){ c->eof = 1; return SQLITE_OK; } rc = sqlite3_bind_int64(c->pStmt, 1, dlrDocid(&c->reader)); dlrStep(&c->reader); if( rc!=SQLITE_OK ) return rc; /* TODO(shess) Handle SQLITE_SCHEMA AND SQLITE_BUSY. */ rc = sqlite3_step(c->pStmt); if( rc==SQLITE_ROW ){ /* the case we expect */ c->eof = 0; return SQLITE_OK; } /* an error occurred; abort */ return rc==SQLITE_DONE ? SQLITE_ERROR : rc; } } /* TODO(shess) If we pushed LeafReader to the top of the file, or to ** another file, term_select() could be pushed above ** docListOfTerm(). */ static int termSelect(fulltext_vtab *v, int iColumn, const char *pTerm, int nTerm, int isPrefix, DocListType iType, DataBuffer *out); /* Return a DocList corresponding to the query term *pTerm. If *pTerm ** is the first term of a phrase query, go ahead and evaluate the phrase ** query and return the doclist for the entire phrase query. ** ** The resulting DL_DOCIDS doclist is stored in pResult, which is ** overwritten. */ static int docListOfTerm( fulltext_vtab *v, /* The full text index */ int iColumn, /* column to restrict to. No restriction if >=nColumn */ QueryTerm *pQTerm, /* Term we are looking for, or 1st term of a phrase */ DataBuffer *pResult /* Write the result here */ ){ DataBuffer left, right, new; int i, rc; /* No phrase search if no position info. */ assert( pQTerm->nPhrase==0 || DL_DEFAULT!=DL_DOCIDS ); /* This code should never be called with buffered updates. */ assert( v->nPendingData<0 ); dataBufferInit(&left, 0); rc = termSelect(v, iColumn, pQTerm->pTerm, pQTerm->nTerm, pQTerm->isPrefix, 0nPhrase ? DL_POSITIONS : DL_DOCIDS, &left); if( rc ) return rc; for(i=1; i<=pQTerm->nPhrase && left.nData>0; i++){ dataBufferInit(&right, 0); rc = termSelect(v, iColumn, pQTerm[i].pTerm, pQTerm[i].nTerm, pQTerm[i].isPrefix, DL_POSITIONS, &right); if( rc ){ dataBufferDestroy(&left); return rc; } dataBufferInit(&new, 0); docListPhraseMerge(left.pData, left.nData, right.pData, right.nData, inPhrase ? DL_POSITIONS : DL_DOCIDS, &new); dataBufferDestroy(&left); dataBufferDestroy(&right); left = new; } *pResult = left; return SQLITE_OK; } /* Add a new term pTerm[0..nTerm-1] to the query *q. */ static void queryAdd(Query *q, const char *pTerm, int nTerm){ QueryTerm *t; ++q->nTerms; q->pTerms = sqlite3_realloc(q->pTerms, q->nTerms * sizeof(q->pTerms[0])); if( q->pTerms==0 ){ q->nTerms = 0; return; } t = &q->pTerms[q->nTerms - 1]; CLEAR(t); t->pTerm = sqlite3_malloc(nTerm+1); memcpy(t->pTerm, pTerm, nTerm); t->pTerm[nTerm] = 0; t->nTerm = nTerm; t->isOr = q->nextIsOr; t->isPrefix = 0; q->nextIsOr = 0; t->iColumn = q->nextColumn; q->nextColumn = q->dfltColumn; } /* ** Check to see if the string zToken[0...nToken-1] matches any ** column name in the virtual table. If it does, ** return the zero-indexed column number. If not, return -1. */ static int checkColumnSpecifier( fulltext_vtab *pVtab, /* The virtual table */ const char *zToken, /* Text of the token */ int nToken /* Number of characters in the token */ ){ int i; for(i=0; inColumn; i++){ if( memcmp(pVtab->azColumn[i], zToken, nToken)==0 && pVtab->azColumn[i][nToken]==0 ){ return i; } } return -1; } /* ** Parse the text at pSegment[0..nSegment-1]. Add additional terms ** to the query being assemblied in pQuery. ** ** inPhrase is true if pSegment[0..nSegement-1] is contained within ** double-quotes. If inPhrase is true, then the first term ** is marked with the number of terms in the phrase less one and ** OR and "-" syntax is ignored. If inPhrase is false, then every ** term found is marked with nPhrase=0 and OR and "-" syntax is significant. */ static int tokenizeSegment( sqlite3_tokenizer *pTokenizer, /* The tokenizer to use */ const char *pSegment, int nSegment, /* Query expression being parsed */ int inPhrase, /* True if within "..." */ Query *pQuery /* Append results here */ ){ const sqlite3_tokenizer_module *pModule = pTokenizer->pModule; sqlite3_tokenizer_cursor *pCursor; int firstIndex = pQuery->nTerms; int iCol; int nTerm = 1; int rc = pModule->xOpen(pTokenizer, pSegment, nSegment, &pCursor); if( rc!=SQLITE_OK ) return rc; pCursor->pTokenizer = pTokenizer; while( 1 ){ const char *pToken; int nToken, iBegin, iEnd, iPos; rc = pModule->xNext(pCursor, &pToken, &nToken, &iBegin, &iEnd, &iPos); if( rc!=SQLITE_OK ) break; if( !inPhrase && pSegment[iEnd]==':' && (iCol = checkColumnSpecifier(pQuery->pFts, pToken, nToken))>=0 ){ pQuery->nextColumn = iCol; continue; } if( !inPhrase && pQuery->nTerms>0 && nToken==2 && pSegment[iBegin]=='O' && pSegment[iBegin+1]=='R' ){ pQuery->nextIsOr = 1; continue; } queryAdd(pQuery, pToken, nToken); if( !inPhrase && iBegin>0 && pSegment[iBegin-1]=='-' ){ pQuery->pTerms[pQuery->nTerms-1].isNot = 1; } if( iEndpTerms[pQuery->nTerms-1].isPrefix = 1; } pQuery->pTerms[pQuery->nTerms-1].iPhrase = nTerm; if( inPhrase ){ nTerm++; } } if( inPhrase && pQuery->nTerms>firstIndex ){ pQuery->pTerms[firstIndex].nPhrase = pQuery->nTerms - firstIndex - 1; } return pModule->xClose(pCursor); } /* Parse a query string, yielding a Query object pQuery. ** ** The calling function will need to queryClear() to clean up ** the dynamically allocated memory held by pQuery. */ static int parseQuery( fulltext_vtab *v, /* The fulltext index */ const char *zInput, /* Input text of the query string */ int nInput, /* Size of the input text */ int dfltColumn, /* Default column of the index to match against */ Query *pQuery /* Write the parse results here. */ ){ int iInput, inPhrase = 0; if( zInput==0 ) nInput = 0; if( nInput<0 ) nInput = strlen(zInput); pQuery->nTerms = 0; pQuery->pTerms = NULL; pQuery->nextIsOr = 0; pQuery->nextColumn = dfltColumn; pQuery->dfltColumn = dfltColumn; pQuery->pFts = v; for(iInput=0; iInputiInput ){ tokenizeSegment(v->pTokenizer, zInput+iInput, i-iInput, inPhrase, pQuery); } iInput = i; if( i=nColumn ** they are allowed to match against any column. */ static int fulltextQuery( fulltext_vtab *v, /* The full text index */ int iColumn, /* Match against this column by default */ const char *zInput, /* The query string */ int nInput, /* Number of bytes in zInput[] */ DataBuffer *pResult, /* Write the result doclist here */ Query *pQuery /* Put parsed query string here */ ){ int i, iNext, rc; DataBuffer left, right, or, new; int nNot = 0; QueryTerm *aTerm; /* TODO(shess) Instead of flushing pendingTerms, we could query for ** the relevant term and merge the doclist into what we receive from ** the database. Wait and see if this is a common issue, first. ** ** A good reason not to flush is to not generate update-related ** error codes from here. */ /* Flush any buffered updates before executing the query. */ rc = flushPendingTerms(v); if( rc!=SQLITE_OK ) return rc; /* TODO(shess) I think that the queryClear() calls below are not ** necessary, because fulltextClose() already clears the query. */ rc = parseQuery(v, zInput, nInput, iColumn, pQuery); if( rc!=SQLITE_OK ) return rc; /* Empty or NULL queries return no results. */ if( pQuery->nTerms==0 ){ dataBufferInit(pResult, 0); return SQLITE_OK; } /* Merge AND terms. */ /* TODO(shess) I think we can early-exit if( i>nNot && left.nData==0 ). */ aTerm = pQuery->pTerms; for(i = 0; inTerms; i=iNext){ if( aTerm[i].isNot ){ /* Handle all NOT terms in a separate pass */ nNot++; iNext = i + aTerm[i].nPhrase+1; continue; } iNext = i + aTerm[i].nPhrase + 1; rc = docListOfTerm(v, aTerm[i].iColumn, &aTerm[i], &right); if( rc ){ if( i!=nNot ) dataBufferDestroy(&left); queryClear(pQuery); return rc; } while( iNextnTerms && aTerm[iNext].isOr ){ rc = docListOfTerm(v, aTerm[iNext].iColumn, &aTerm[iNext], &or); iNext += aTerm[iNext].nPhrase + 1; if( rc ){ if( i!=nNot ) dataBufferDestroy(&left); dataBufferDestroy(&right); queryClear(pQuery); return rc; } dataBufferInit(&new, 0); docListOrMerge(right.pData, right.nData, or.pData, or.nData, &new); dataBufferDestroy(&right); dataBufferDestroy(&or); right = new; } if( i==nNot ){ /* first term processed. */ left = right; }else{ dataBufferInit(&new, 0); docListAndMerge(left.pData, left.nData, right.pData, right.nData, &new); dataBufferDestroy(&right); dataBufferDestroy(&left); left = new; } } if( nNot==pQuery->nTerms ){ /* We do not yet know how to handle a query of only NOT terms */ return SQLITE_ERROR; } /* Do the EXCEPT terms */ for(i=0; inTerms; i += aTerm[i].nPhrase + 1){ if( !aTerm[i].isNot ) continue; rc = docListOfTerm(v, aTerm[i].iColumn, &aTerm[i], &right); if( rc ){ queryClear(pQuery); dataBufferDestroy(&left); return rc; } dataBufferInit(&new, 0); docListExceptMerge(left.pData, left.nData, right.pData, right.nData, &new); dataBufferDestroy(&right); dataBufferDestroy(&left); left = new; } *pResult = left; return rc; } /* ** This is the xFilter interface for the virtual table. See ** the virtual table xFilter method documentation for additional ** information. ** ** If idxNum==QUERY_GENERIC then do a full table scan against ** the %_content table. ** ** If idxNum==QUERY_ROWID then do a rowid lookup for a single entry ** in the %_content table. ** ** If idxNum>=QUERY_FULLTEXT then use the full text index. The ** column on the left-hand side of the MATCH operator is column ** number idxNum-QUERY_FULLTEXT, 0 indexed. argv[0] is the right-hand ** side of the MATCH operator. */ /* TODO(shess) Upgrade the cursor initialization and destruction to ** account for fulltextFilter() being called multiple times on the ** same cursor. The current solution is very fragile. Apply fix to ** fts2 as appropriate. */ static int fulltextFilter( sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */ int idxNum, const char *idxStr, /* Which indexing scheme to use */ int argc, sqlite3_value **argv /* Arguments for the indexing scheme */ ){ fulltext_cursor *c = (fulltext_cursor *) pCursor; fulltext_vtab *v = cursor_vtab(c); int rc; TRACE(("FTS2 Filter %p\n",pCursor)); /* If the cursor has a statement that was not prepared according to ** idxNum, clear it. I believe all calls to fulltextFilter with a ** given cursor will have the same idxNum , but in this case it's ** easy to be safe. */ if( c->pStmt && c->iCursorType!=idxNum ){ sqlite3_finalize(c->pStmt); c->pStmt = NULL; } /* Get a fresh statement appropriate to idxNum. */ /* TODO(shess): Add a prepared-statement cache in the vt structure. ** The cache must handle multiple open cursors. Easier to cache the ** statement variants at the vt to reduce malloc/realloc/free here. ** Or we could have a StringBuffer variant which allowed stack ** construction for small values. */ if( !c->pStmt ){ char *zSql = sqlite3_mprintf("select rowid, * from %%_content %s", idxNum==QUERY_GENERIC ? "" : "where rowid=?"); rc = sql_prepare(v->db, v->zDb, v->zName, &c->pStmt, zSql); sqlite3_free(zSql); if( rc!=SQLITE_OK ) return rc; c->iCursorType = idxNum; }else{ sqlite3_reset(c->pStmt); assert( c->iCursorType==idxNum ); } switch( idxNum ){ case QUERY_GENERIC: break; case QUERY_ROWID: rc = sqlite3_bind_int64(c->pStmt, 1, sqlite3_value_int64(argv[0])); if( rc!=SQLITE_OK ) return rc; break; default: /* full-text search */ { const char *zQuery = (const char *)sqlite3_value_text(argv[0]); assert( idxNum<=QUERY_FULLTEXT+v->nColumn); assert( argc==1 ); queryClear(&c->q); if( c->result.nData!=0 ){ /* This case happens if the same cursor is used repeatedly. */ dlrDestroy(&c->reader); dataBufferReset(&c->result); }else{ dataBufferInit(&c->result, 0); } rc = fulltextQuery(v, idxNum-QUERY_FULLTEXT, zQuery, -1, &c->result, &c->q); if( rc!=SQLITE_OK ) return rc; if( c->result.nData!=0 ){ dlrInit(&c->reader, DL_DOCIDS, c->result.pData, c->result.nData); } break; } } return fulltextNext(pCursor); } /* This is the xEof method of the virtual table. The SQLite core ** calls this routine to find out if it has reached the end of ** a query's results set. */ static int fulltextEof(sqlite3_vtab_cursor *pCursor){ fulltext_cursor *c = (fulltext_cursor *) pCursor; return c->eof; } /* This is the xColumn method of the virtual table. The SQLite ** core calls this method during a query when it needs the value ** of a column from the virtual table. This method needs to use ** one of the sqlite3_result_*() routines to store the requested ** value back in the pContext. */ static int fulltextColumn(sqlite3_vtab_cursor *pCursor, sqlite3_context *pContext, int idxCol){ fulltext_cursor *c = (fulltext_cursor *) pCursor; fulltext_vtab *v = cursor_vtab(c); if( idxColnColumn ){ sqlite3_value *pVal = sqlite3_column_value(c->pStmt, idxCol+1); sqlite3_result_value(pContext, pVal); }else if( idxCol==v->nColumn ){ /* The extra column whose name is the same as the table. ** Return a blob which is a pointer to the cursor */ sqlite3_result_blob(pContext, &c, sizeof(c), SQLITE_TRANSIENT); } return SQLITE_OK; } /* This is the xRowid method. The SQLite core calls this routine to ** retrive the rowid for the current row of the result set. The ** rowid should be written to *pRowid. */ static int fulltextRowid(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ fulltext_cursor *c = (fulltext_cursor *) pCursor; *pRowid = sqlite3_column_int64(c->pStmt, 0); return SQLITE_OK; } /* Add all terms in [zText] to pendingTerms table. If [iColumn] > 0, ** we also store positions and offsets in the hash table using that ** column number. */ static int buildTerms(fulltext_vtab *v, sqlite_int64 iDocid, const char *zText, int iColumn){ sqlite3_tokenizer *pTokenizer = v->pTokenizer; sqlite3_tokenizer_cursor *pCursor; const char *pToken; int nTokenBytes; int iStartOffset, iEndOffset, iPosition; int rc; rc = pTokenizer->pModule->xOpen(pTokenizer, zText, -1, &pCursor); if( rc!=SQLITE_OK ) return rc; pCursor->pTokenizer = pTokenizer; while( SQLITE_OK==(rc=pTokenizer->pModule->xNext(pCursor, &pToken, &nTokenBytes, &iStartOffset, &iEndOffset, &iPosition)) ){ DLCollector *p; int nData; /* Size of doclist before our update. */ /* Positions can't be negative; we use -1 as a terminator * internally. Token can't be NULL or empty. */ if( iPosition<0 || pToken == NULL || nTokenBytes == 0 ){ rc = SQLITE_ERROR; break; } p = fts2HashFind(&v->pendingTerms, pToken, nTokenBytes); if( p==NULL ){ nData = 0; p = dlcNew(iDocid, DL_DEFAULT); fts2HashInsert(&v->pendingTerms, pToken, nTokenBytes, p); /* Overhead for our hash table entry, the key, and the value. */ v->nPendingData += sizeof(struct fts2HashElem)+sizeof(*p)+nTokenBytes; }else{ nData = p->b.nData; if( p->dlw.iPrevDocid!=iDocid ) dlcNext(p, iDocid); } if( iColumn>=0 ){ dlcAddPos(p, iColumn, iPosition, iStartOffset, iEndOffset); } /* Accumulate data added by dlcNew or dlcNext, and dlcAddPos. */ v->nPendingData += p->b.nData-nData; } /* TODO(shess) Check return? Should this be able to cause errors at ** this point? Actually, same question about sqlite3_finalize(), ** though one could argue that failure there means that the data is ** not durable. *ponder* */ pTokenizer->pModule->xClose(pCursor); if( SQLITE_DONE == rc ) return SQLITE_OK; return rc; } /* Add doclists for all terms in [pValues] to pendingTerms table. */ static int insertTerms(fulltext_vtab *v, sqlite_int64 iRowid, sqlite3_value **pValues){ int i; for(i = 0; i < v->nColumn ; ++i){ char *zText = (char*)sqlite3_value_text(pValues[i]); int rc = buildTerms(v, iRowid, zText, i); if( rc!=SQLITE_OK ) return rc; } return SQLITE_OK; } /* Add empty doclists for all terms in the given row's content to ** pendingTerms. */ static int deleteTerms(fulltext_vtab *v, sqlite_int64 iRowid){ const char **pValues; int i, rc; /* TODO(shess) Should we allow such tables at all? */ if( DL_DEFAULT==DL_DOCIDS ) return SQLITE_ERROR; rc = content_select(v, iRowid, &pValues); if( rc!=SQLITE_OK ) return rc; for(i = 0 ; i < v->nColumn; ++i) { rc = buildTerms(v, iRowid, pValues[i], -1); if( rc!=SQLITE_OK ) break; } freeStringArray(v->nColumn, pValues); return SQLITE_OK; } /* TODO(shess) Refactor the code to remove this forward decl. */ static int initPendingTerms(fulltext_vtab *v, sqlite_int64 iDocid); /* Insert a row into the %_content table; set *piRowid to be the ID of the ** new row. Add doclists for terms to pendingTerms. */ static int index_insert(fulltext_vtab *v, sqlite3_value *pRequestRowid, sqlite3_value **pValues, sqlite_int64 *piRowid){ int rc; rc = content_insert(v, pRequestRowid, pValues); /* execute an SQL INSERT */ if( rc!=SQLITE_OK ) return rc; *piRowid = sqlite3_last_insert_rowid(v->db); rc = initPendingTerms(v, *piRowid); if( rc!=SQLITE_OK ) return rc; return insertTerms(v, *piRowid, pValues); } /* Delete a row from the %_content table; add empty doclists for terms ** to pendingTerms. */ static int index_delete(fulltext_vtab *v, sqlite_int64 iRow){ int rc = initPendingTerms(v, iRow); if( rc!=SQLITE_OK ) return rc; rc = deleteTerms(v, iRow); if( rc!=SQLITE_OK ) return rc; return content_delete(v, iRow); /* execute an SQL DELETE */ } /* Update a row in the %_content table; add delete doclists to ** pendingTerms for old terms not in the new data, add insert doclists ** to pendingTerms for terms in the new data. */ static int index_update(fulltext_vtab *v, sqlite_int64 iRow, sqlite3_value **pValues){ int rc = initPendingTerms(v, iRow); if( rc!=SQLITE_OK ) return rc; /* Generate an empty doclist for each term that previously appeared in this * row. */ rc = deleteTerms(v, iRow); if( rc!=SQLITE_OK ) return rc; rc = content_update(v, pValues, iRow); /* execute an SQL UPDATE */ if( rc!=SQLITE_OK ) return rc; /* Now add positions for terms which appear in the updated row. */ return insertTerms(v, iRow, pValues); } /*******************************************************************/ /* InteriorWriter is used to collect terms and block references into ** interior nodes in %_segments. See commentary at top of file for ** format. */ /* How large interior nodes can grow. */ #define INTERIOR_MAX 2048 /* Minimum number of terms per interior node (except the root). This ** prevents large terms from making the tree too skinny - must be >0 ** so that the tree always makes progress. Note that the min tree ** fanout will be INTERIOR_MIN_TERMS+1. */ #define INTERIOR_MIN_TERMS 7 #if INTERIOR_MIN_TERMS<1 # error INTERIOR_MIN_TERMS must be greater than 0. #endif /* ROOT_MAX controls how much data is stored inline in the segment ** directory. */ /* TODO(shess) Push ROOT_MAX down to whoever is writing things. It's ** only here so that interiorWriterRootInfo() and leafWriterRootInfo() ** can both see it, but if the caller passed it in, we wouldn't even ** need a define. */ #define ROOT_MAX 1024 #if ROOT_MAXterm, 0); dataBufferReplace(&block->term, pTerm, nTerm); n = putVarint(c, iHeight); n += putVarint(c+n, iChildBlock); dataBufferInit(&block->data, INTERIOR_MAX); dataBufferReplace(&block->data, c, n); } return block; } #ifndef NDEBUG /* Verify that the data is readable as an interior node. */ static void interiorBlockValidate(InteriorBlock *pBlock){ const char *pData = pBlock->data.pData; int nData = pBlock->data.nData; int n, iDummy; sqlite_int64 iBlockid; assert( nData>0 ); assert( pData!=0 ); assert( pData+nData>pData ); /* Must lead with height of node as a varint(n), n>0 */ n = getVarint32(pData, &iDummy); assert( n>0 ); assert( iDummy>0 ); assert( n0 ); assert( n<=nData ); pData += n; nData -= n; /* Zero or more terms of positive length */ if( nData!=0 ){ /* First term is not delta-encoded. */ n = getVarint32(pData, &iDummy); assert( n>0 ); assert( iDummy>0 ); assert( n+iDummy>0); assert( n+iDummy<=nData ); pData += n+iDummy; nData -= n+iDummy; /* Following terms delta-encoded. */ while( nData!=0 ){ /* Length of shared prefix. */ n = getVarint32(pData, &iDummy); assert( n>0 ); assert( iDummy>=0 ); assert( n0 ); assert( iDummy>0 ); assert( n+iDummy>0); assert( n+iDummy<=nData ); pData += n+iDummy; nData -= n+iDummy; } } } #define ASSERT_VALID_INTERIOR_BLOCK(x) interiorBlockValidate(x) #else #define ASSERT_VALID_INTERIOR_BLOCK(x) assert( 1 ) #endif typedef struct InteriorWriter { int iHeight; /* from 0 at leaves. */ InteriorBlock *first, *last; struct InteriorWriter *parentWriter; DataBuffer term; /* Last term written to block "last". */ sqlite_int64 iOpeningChildBlock; /* First child block in block "last". */ #ifndef NDEBUG sqlite_int64 iLastChildBlock; /* for consistency checks. */ #endif } InteriorWriter; /* Initialize an interior node where pTerm[nTerm] marks the leftmost ** term in the tree. iChildBlock is the leftmost child block at the ** next level down the tree. */ static void interiorWriterInit(int iHeight, const char *pTerm, int nTerm, sqlite_int64 iChildBlock, InteriorWriter *pWriter){ InteriorBlock *block; assert( iHeight>0 ); CLEAR(pWriter); pWriter->iHeight = iHeight; pWriter->iOpeningChildBlock = iChildBlock; #ifndef NDEBUG pWriter->iLastChildBlock = iChildBlock; #endif block = interiorBlockNew(iHeight, iChildBlock, pTerm, nTerm); pWriter->last = pWriter->first = block; ASSERT_VALID_INTERIOR_BLOCK(pWriter->last); dataBufferInit(&pWriter->term, 0); } /* Append the child node rooted at iChildBlock to the interior node, ** with pTerm[nTerm] as the leftmost term in iChildBlock's subtree. */ static void interiorWriterAppend(InteriorWriter *pWriter, const char *pTerm, int nTerm, sqlite_int64 iChildBlock){ char c[VARINT_MAX+VARINT_MAX]; int n, nPrefix = 0; ASSERT_VALID_INTERIOR_BLOCK(pWriter->last); /* The first term written into an interior node is actually ** associated with the second child added (the first child was added ** in interiorWriterInit, or in the if clause at the bottom of this ** function). That term gets encoded straight up, with nPrefix left ** at 0. */ if( pWriter->term.nData==0 ){ n = putVarint(c, nTerm); }else{ while( nPrefixterm.nData && pTerm[nPrefix]==pWriter->term.pData[nPrefix] ){ nPrefix++; } n = putVarint(c, nPrefix); n += putVarint(c+n, nTerm-nPrefix); } #ifndef NDEBUG pWriter->iLastChildBlock++; #endif assert( pWriter->iLastChildBlock==iChildBlock ); /* Overflow to a new block if the new term makes the current block ** too big, and the current block already has enough terms. */ if( pWriter->last->data.nData+n+nTerm-nPrefix>INTERIOR_MAX && iChildBlock-pWriter->iOpeningChildBlock>INTERIOR_MIN_TERMS ){ pWriter->last->next = interiorBlockNew(pWriter->iHeight, iChildBlock, pTerm, nTerm); pWriter->last = pWriter->last->next; pWriter->iOpeningChildBlock = iChildBlock; dataBufferReset(&pWriter->term); }else{ dataBufferAppend2(&pWriter->last->data, c, n, pTerm+nPrefix, nTerm-nPrefix); dataBufferReplace(&pWriter->term, pTerm, nTerm); } ASSERT_VALID_INTERIOR_BLOCK(pWriter->last); } /* Free the space used by pWriter, including the linked-list of ** InteriorBlocks, and parentWriter, if present. */ static int interiorWriterDestroy(InteriorWriter *pWriter){ InteriorBlock *block = pWriter->first; while( block!=NULL ){ InteriorBlock *b = block; block = block->next; dataBufferDestroy(&b->term); dataBufferDestroy(&b->data); sqlite3_free(b); } if( pWriter->parentWriter!=NULL ){ interiorWriterDestroy(pWriter->parentWriter); sqlite3_free(pWriter->parentWriter); } dataBufferDestroy(&pWriter->term); SCRAMBLE(pWriter); return SQLITE_OK; } /* If pWriter can fit entirely in ROOT_MAX, return it as the root info ** directly, leaving *piEndBlockid unchanged. Otherwise, flush ** pWriter to %_segments, building a new layer of interior nodes, and ** recursively ask for their root into. */ static int interiorWriterRootInfo(fulltext_vtab *v, InteriorWriter *pWriter, char **ppRootInfo, int *pnRootInfo, sqlite_int64 *piEndBlockid){ InteriorBlock *block = pWriter->first; sqlite_int64 iBlockid = 0; int rc; /* If we can fit the segment inline */ if( block==pWriter->last && block->data.nDatadata.pData; *pnRootInfo = block->data.nData; return SQLITE_OK; } /* Flush the first block to %_segments, and create a new level of ** interior node. */ ASSERT_VALID_INTERIOR_BLOCK(block); rc = block_insert(v, block->data.pData, block->data.nData, &iBlockid); if( rc!=SQLITE_OK ) return rc; *piEndBlockid = iBlockid; pWriter->parentWriter = sqlite3_malloc(sizeof(*pWriter->parentWriter)); interiorWriterInit(pWriter->iHeight+1, block->term.pData, block->term.nData, iBlockid, pWriter->parentWriter); /* Flush additional blocks and append to the higher interior ** node. */ for(block=block->next; block!=NULL; block=block->next){ ASSERT_VALID_INTERIOR_BLOCK(block); rc = block_insert(v, block->data.pData, block->data.nData, &iBlockid); if( rc!=SQLITE_OK ) return rc; *piEndBlockid = iBlockid; interiorWriterAppend(pWriter->parentWriter, block->term.pData, block->term.nData, iBlockid); } /* Parent node gets the chance to be the root. */ return interiorWriterRootInfo(v, pWriter->parentWriter, ppRootInfo, pnRootInfo, piEndBlockid); } /****************************************************************/ /* InteriorReader is used to read off the data from an interior node ** (see comment at top of file for the format). */ typedef struct InteriorReader { const char *pData; int nData; DataBuffer term; /* previous term, for decoding term delta. */ sqlite_int64 iBlockid; } InteriorReader; static void interiorReaderDestroy(InteriorReader *pReader){ dataBufferDestroy(&pReader->term); SCRAMBLE(pReader); } /* TODO(shess) The assertions are great, but what if we're in NDEBUG ** and the blob is empty or otherwise contains suspect data? */ static void interiorReaderInit(const char *pData, int nData, InteriorReader *pReader){ int n, nTerm; /* Require at least the leading flag byte */ assert( nData>0 ); assert( pData[0]!='\0' ); CLEAR(pReader); /* Decode the base blockid, and set the cursor to the first term. */ n = getVarint(pData+1, &pReader->iBlockid); assert( 1+n<=nData ); pReader->pData = pData+1+n; pReader->nData = nData-(1+n); /* A single-child interior node (such as when a leaf node was too ** large for the segment directory) won't have any terms. ** Otherwise, decode the first term. */ if( pReader->nData==0 ){ dataBufferInit(&pReader->term, 0); }else{ n = getVarint32(pReader->pData, &nTerm); dataBufferInit(&pReader->term, nTerm); dataBufferReplace(&pReader->term, pReader->pData+n, nTerm); assert( n+nTerm<=pReader->nData ); pReader->pData += n+nTerm; pReader->nData -= n+nTerm; } } static int interiorReaderAtEnd(InteriorReader *pReader){ return pReader->term.nData==0; } static sqlite_int64 interiorReaderCurrentBlockid(InteriorReader *pReader){ return pReader->iBlockid; } static int interiorReaderTermBytes(InteriorReader *pReader){ assert( !interiorReaderAtEnd(pReader) ); return pReader->term.nData; } static const char *interiorReaderTerm(InteriorReader *pReader){ assert( !interiorReaderAtEnd(pReader) ); return pReader->term.pData; } /* Step forward to the next term in the node. */ static void interiorReaderStep(InteriorReader *pReader){ assert( !interiorReaderAtEnd(pReader) ); /* If the last term has been read, signal eof, else construct the ** next term. */ if( pReader->nData==0 ){ dataBufferReset(&pReader->term); }else{ int n, nPrefix, nSuffix; n = getVarint32(pReader->pData, &nPrefix); n += getVarint32(pReader->pData+n, &nSuffix); /* Truncate the current term and append suffix data. */ pReader->term.nData = nPrefix; dataBufferAppend(&pReader->term, pReader->pData+n, nSuffix); assert( n+nSuffix<=pReader->nData ); pReader->pData += n+nSuffix; pReader->nData -= n+nSuffix; } pReader->iBlockid++; } /* Compare the current term to pTerm[nTerm], returning strcmp-style ** results. If isPrefix, equality means equal through nTerm bytes. */ static int interiorReaderTermCmp(InteriorReader *pReader, const char *pTerm, int nTerm, int isPrefix){ const char *pReaderTerm = interiorReaderTerm(pReader); int nReaderTerm = interiorReaderTermBytes(pReader); int c, n = nReaderTerm0 ) return -1; if( nTerm>0 ) return 1; return 0; } c = memcmp(pReaderTerm, pTerm, n); if( c!=0 ) return c; if( isPrefix && n==nTerm ) return 0; return nReaderTerm - nTerm; } /****************************************************************/ /* LeafWriter is used to collect terms and associated doclist data ** into leaf blocks in %_segments (see top of file for format info). ** Expected usage is: ** ** LeafWriter writer; ** leafWriterInit(0, 0, &writer); ** while( sorted_terms_left_to_process ){ ** // data is doclist data for that term. ** rc = leafWriterStep(v, &writer, pTerm, nTerm, pData, nData); ** if( rc!=SQLITE_OK ) goto err; ** } ** rc = leafWriterFinalize(v, &writer); **err: ** leafWriterDestroy(&writer); ** return rc; ** ** leafWriterStep() may write a collected leaf out to %_segments. ** leafWriterFinalize() finishes writing any buffered data and stores ** a root node in %_segdir. leafWriterDestroy() frees all buffers and ** InteriorWriters allocated as part of writing this segment. ** ** TODO(shess) Document leafWriterStepMerge(). */ /* Put terms with data this big in their own block. */ #define STANDALONE_MIN 1024 /* Keep leaf blocks below this size. */ #define LEAF_MAX 2048 typedef struct LeafWriter { int iLevel; int idx; sqlite_int64 iStartBlockid; /* needed to create the root info */ sqlite_int64 iEndBlockid; /* when we're done writing. */ DataBuffer term; /* previous encoded term */ DataBuffer data; /* encoding buffer */ /* bytes of first term in the current node which distinguishes that ** term from the last term of the previous node. */ int nTermDistinct; InteriorWriter parentWriter; /* if we overflow */ int has_parent; } LeafWriter; static void leafWriterInit(int iLevel, int idx, LeafWriter *pWriter){ CLEAR(pWriter); pWriter->iLevel = iLevel; pWriter->idx = idx; dataBufferInit(&pWriter->term, 32); /* Start out with a reasonably sized block, though it can grow. */ dataBufferInit(&pWriter->data, LEAF_MAX); } #ifndef NDEBUG /* Verify that the data is readable as a leaf node. */ static void leafNodeValidate(const char *pData, int nData){ int n, iDummy; if( nData==0 ) return; assert( nData>0 ); assert( pData!=0 ); assert( pData+nData>pData ); /* Must lead with a varint(0) */ n = getVarint32(pData, &iDummy); assert( iDummy==0 ); assert( n>0 ); assert( n0 ); assert( iDummy>0 ); assert( n+iDummy>0 ); assert( n+iDummy0 ); assert( iDummy>0 ); assert( n+iDummy>0 ); assert( n+iDummy<=nData ); ASSERT_VALID_DOCLIST(DL_DEFAULT, pData+n, iDummy, NULL); pData += n+iDummy; nData -= n+iDummy; /* Verify that trailing terms and doclists also are readable. */ while( nData!=0 ){ n = getVarint32(pData, &iDummy); assert( n>0 ); assert( iDummy>=0 ); assert( n0 ); assert( iDummy>0 ); assert( n+iDummy>0 ); assert( n+iDummy0 ); assert( iDummy>0 ); assert( n+iDummy>0 ); assert( n+iDummy<=nData ); ASSERT_VALID_DOCLIST(DL_DEFAULT, pData+n, iDummy, NULL); pData += n+iDummy; nData -= n+iDummy; } } #define ASSERT_VALID_LEAF_NODE(p, n) leafNodeValidate(p, n) #else #define ASSERT_VALID_LEAF_NODE(p, n) assert( 1 ) #endif /* Flush the current leaf node to %_segments, and adding the resulting ** blockid and the starting term to the interior node which will ** contain it. */ static int leafWriterInternalFlush(fulltext_vtab *v, LeafWriter *pWriter, int iData, int nData){ sqlite_int64 iBlockid = 0; const char *pStartingTerm; int nStartingTerm, rc, n; /* Must have the leading varint(0) flag, plus at least some ** valid-looking data. */ assert( nData>2 ); assert( iData>=0 ); assert( iData+nData<=pWriter->data.nData ); ASSERT_VALID_LEAF_NODE(pWriter->data.pData+iData, nData); rc = block_insert(v, pWriter->data.pData+iData, nData, &iBlockid); if( rc!=SQLITE_OK ) return rc; assert( iBlockid!=0 ); /* Reconstruct the first term in the leaf for purposes of building ** the interior node. */ n = getVarint32(pWriter->data.pData+iData+1, &nStartingTerm); pStartingTerm = pWriter->data.pData+iData+1+n; assert( pWriter->data.nData>iData+1+n+nStartingTerm ); assert( pWriter->nTermDistinct>0 ); assert( pWriter->nTermDistinct<=nStartingTerm ); nStartingTerm = pWriter->nTermDistinct; if( pWriter->has_parent ){ interiorWriterAppend(&pWriter->parentWriter, pStartingTerm, nStartingTerm, iBlockid); }else{ interiorWriterInit(1, pStartingTerm, nStartingTerm, iBlockid, &pWriter->parentWriter); pWriter->has_parent = 1; } /* Track the span of this segment's leaf nodes. */ if( pWriter->iEndBlockid==0 ){ pWriter->iEndBlockid = pWriter->iStartBlockid = iBlockid; }else{ pWriter->iEndBlockid++; assert( iBlockid==pWriter->iEndBlockid ); } return SQLITE_OK; } static int leafWriterFlush(fulltext_vtab *v, LeafWriter *pWriter){ int rc = leafWriterInternalFlush(v, pWriter, 0, pWriter->data.nData); if( rc!=SQLITE_OK ) return rc; /* Re-initialize the output buffer. */ dataBufferReset(&pWriter->data); return SQLITE_OK; } /* Fetch the root info for the segment. If the entire leaf fits ** within ROOT_MAX, then it will be returned directly, otherwise it ** will be flushed and the root info will be returned from the ** interior node. *piEndBlockid is set to the blockid of the last ** interior or leaf node written to disk (0 if none are written at ** all). */ static int leafWriterRootInfo(fulltext_vtab *v, LeafWriter *pWriter, char **ppRootInfo, int *pnRootInfo, sqlite_int64 *piEndBlockid){ /* we can fit the segment entirely inline */ if( !pWriter->has_parent && pWriter->data.nDatadata.pData; *pnRootInfo = pWriter->data.nData; *piEndBlockid = 0; return SQLITE_OK; } /* Flush remaining leaf data. */ if( pWriter->data.nData>0 ){ int rc = leafWriterFlush(v, pWriter); if( rc!=SQLITE_OK ) return rc; } /* We must have flushed a leaf at some point. */ assert( pWriter->has_parent ); /* Tenatively set the end leaf blockid as the end blockid. If the ** interior node can be returned inline, this will be the final ** blockid, otherwise it will be overwritten by ** interiorWriterRootInfo(). */ *piEndBlockid = pWriter->iEndBlockid; return interiorWriterRootInfo(v, &pWriter->parentWriter, ppRootInfo, pnRootInfo, piEndBlockid); } /* Collect the rootInfo data and store it into the segment directory. ** This has the effect of flushing the segment's leaf data to ** %_segments, and also flushing any interior nodes to %_segments. */ static int leafWriterFinalize(fulltext_vtab *v, LeafWriter *pWriter){ sqlite_int64 iEndBlockid; char *pRootInfo; int rc, nRootInfo; rc = leafWriterRootInfo(v, pWriter, &pRootInfo, &nRootInfo, &iEndBlockid); if( rc!=SQLITE_OK ) return rc; /* Don't bother storing an entirely empty segment. */ if( iEndBlockid==0 && nRootInfo==0 ) return SQLITE_OK; return segdir_set(v, pWriter->iLevel, pWriter->idx, pWriter->iStartBlockid, pWriter->iEndBlockid, iEndBlockid, pRootInfo, nRootInfo); } static void leafWriterDestroy(LeafWriter *pWriter){ if( pWriter->has_parent ) interiorWriterDestroy(&pWriter->parentWriter); dataBufferDestroy(&pWriter->term); dataBufferDestroy(&pWriter->data); } /* Encode a term into the leafWriter, delta-encoding as appropriate. ** Returns the length of the new term which distinguishes it from the ** previous term, which can be used to set nTermDistinct when a node ** boundary is crossed. */ static int leafWriterEncodeTerm(LeafWriter *pWriter, const char *pTerm, int nTerm){ char c[VARINT_MAX+VARINT_MAX]; int n, nPrefix = 0; assert( nTerm>0 ); while( nPrefixterm.nData && pTerm[nPrefix]==pWriter->term.pData[nPrefix] ){ nPrefix++; /* Failing this implies that the terms weren't in order. */ assert( nPrefixdata.nData==0 ){ /* Encode the node header and leading term as: ** varint(0) ** varint(nTerm) ** char pTerm[nTerm] */ n = putVarint(c, '\0'); n += putVarint(c+n, nTerm); dataBufferAppend2(&pWriter->data, c, n, pTerm, nTerm); }else{ /* Delta-encode the term as: ** varint(nPrefix) ** varint(nSuffix) ** char pTermSuffix[nSuffix] */ n = putVarint(c, nPrefix); n += putVarint(c+n, nTerm-nPrefix); dataBufferAppend2(&pWriter->data, c, n, pTerm+nPrefix, nTerm-nPrefix); } dataBufferReplace(&pWriter->term, pTerm, nTerm); return nPrefix+1; } /* Used to avoid a memmove when a large amount of doclist data is in ** the buffer. This constructs a node and term header before ** iDoclistData and flushes the resulting complete node using ** leafWriterInternalFlush(). */ static int leafWriterInlineFlush(fulltext_vtab *v, LeafWriter *pWriter, const char *pTerm, int nTerm, int iDoclistData){ char c[VARINT_MAX+VARINT_MAX]; int iData, n = putVarint(c, 0); n += putVarint(c+n, nTerm); /* There should always be room for the header. Even if pTerm shared ** a substantial prefix with the previous term, the entire prefix ** could be constructed from earlier data in the doclist, so there ** should be room. */ assert( iDoclistData>=n+nTerm ); iData = iDoclistData-(n+nTerm); memcpy(pWriter->data.pData+iData, c, n); memcpy(pWriter->data.pData+iData+n, pTerm, nTerm); return leafWriterInternalFlush(v, pWriter, iData, pWriter->data.nData-iData); } /* Push pTerm[nTerm] along with the doclist data to the leaf layer of ** %_segments. */ static int leafWriterStepMerge(fulltext_vtab *v, LeafWriter *pWriter, const char *pTerm, int nTerm, DLReader *pReaders, int nReaders){ char c[VARINT_MAX+VARINT_MAX]; int iTermData = pWriter->data.nData, iDoclistData; int i, nData, n, nActualData, nActual, rc, nTermDistinct; ASSERT_VALID_LEAF_NODE(pWriter->data.pData, pWriter->data.nData); nTermDistinct = leafWriterEncodeTerm(pWriter, pTerm, nTerm); /* Remember nTermDistinct if opening a new node. */ if( iTermData==0 ) pWriter->nTermDistinct = nTermDistinct; iDoclistData = pWriter->data.nData; /* Estimate the length of the merged doclist so we can leave space ** to encode it. */ for(i=0, nData=0; idata, c, n); docListMerge(&pWriter->data, pReaders, nReaders); ASSERT_VALID_DOCLIST(DL_DEFAULT, pWriter->data.pData+iDoclistData+n, pWriter->data.nData-iDoclistData-n, NULL); /* The actual amount of doclist data at this point could be smaller ** than the length we encoded. Additionally, the space required to ** encode this length could be smaller. For small doclists, this is ** not a big deal, we can just use memmove() to adjust things. */ nActualData = pWriter->data.nData-(iDoclistData+n); nActual = putVarint(c, nActualData); assert( nActualData<=nData ); assert( nActual<=n ); /* If the new doclist is big enough for force a standalone leaf ** node, we can immediately flush it inline without doing the ** memmove(). */ /* TODO(shess) This test matches leafWriterStep(), which does this ** test before it knows the cost to varint-encode the term and ** doclist lengths. At some point, change to ** pWriter->data.nData-iTermData>STANDALONE_MIN. */ if( nTerm+nActualData>STANDALONE_MIN ){ /* Push leaf node from before this term. */ if( iTermData>0 ){ rc = leafWriterInternalFlush(v, pWriter, 0, iTermData); if( rc!=SQLITE_OK ) return rc; pWriter->nTermDistinct = nTermDistinct; } /* Fix the encoded doclist length. */ iDoclistData += n - nActual; memcpy(pWriter->data.pData+iDoclistData, c, nActual); /* Push the standalone leaf node. */ rc = leafWriterInlineFlush(v, pWriter, pTerm, nTerm, iDoclistData); if( rc!=SQLITE_OK ) return rc; /* Leave the node empty. */ dataBufferReset(&pWriter->data); return rc; } /* At this point, we know that the doclist was small, so do the ** memmove if indicated. */ if( nActualdata.pData+iDoclistData+nActual, pWriter->data.pData+iDoclistData+n, pWriter->data.nData-(iDoclistData+n)); pWriter->data.nData -= n-nActual; } /* Replace written length with actual length. */ memcpy(pWriter->data.pData+iDoclistData, c, nActual); /* If the node is too large, break things up. */ /* TODO(shess) This test matches leafWriterStep(), which does this ** test before it knows the cost to varint-encode the term and ** doclist lengths. At some point, change to ** pWriter->data.nData>LEAF_MAX. */ if( iTermData+nTerm+nActualData>LEAF_MAX ){ /* Flush out the leading data as a node */ rc = leafWriterInternalFlush(v, pWriter, 0, iTermData); if( rc!=SQLITE_OK ) return rc; pWriter->nTermDistinct = nTermDistinct; /* Rebuild header using the current term */ n = putVarint(pWriter->data.pData, 0); n += putVarint(pWriter->data.pData+n, nTerm); memcpy(pWriter->data.pData+n, pTerm, nTerm); n += nTerm; /* There should always be room, because the previous encoding ** included all data necessary to construct the term. */ assert( ndata.nData-iDoclistDatadata.pData+n, pWriter->data.pData+iDoclistData, pWriter->data.nData-iDoclistData); pWriter->data.nData -= iDoclistData-n; } ASSERT_VALID_LEAF_NODE(pWriter->data.pData, pWriter->data.nData); return SQLITE_OK; } /* Push pTerm[nTerm] along with the doclist data to the leaf layer of ** %_segments. */ /* TODO(shess) Revise writeZeroSegment() so that doclists are ** constructed directly in pWriter->data. */ static int leafWriterStep(fulltext_vtab *v, LeafWriter *pWriter, const char *pTerm, int nTerm, const char *pData, int nData){ int rc; DLReader reader; dlrInit(&reader, DL_DEFAULT, pData, nData); rc = leafWriterStepMerge(v, pWriter, pTerm, nTerm, &reader, 1); dlrDestroy(&reader); return rc; } /****************************************************************/ /* LeafReader is used to iterate over an individual leaf node. */ typedef struct LeafReader { DataBuffer term; /* copy of current term. */ const char *pData; /* data for current term. */ int nData; } LeafReader; static void leafReaderDestroy(LeafReader *pReader){ dataBufferDestroy(&pReader->term); SCRAMBLE(pReader); } static int leafReaderAtEnd(LeafReader *pReader){ return pReader->nData<=0; } /* Access the current term. */ static int leafReaderTermBytes(LeafReader *pReader){ return pReader->term.nData; } static const char *leafReaderTerm(LeafReader *pReader){ assert( pReader->term.nData>0 ); return pReader->term.pData; } /* Access the doclist data for the current term. */ static int leafReaderDataBytes(LeafReader *pReader){ int nData; assert( pReader->term.nData>0 ); getVarint32(pReader->pData, &nData); return nData; } static const char *leafReaderData(LeafReader *pReader){ int n, nData; assert( pReader->term.nData>0 ); n = getVarint32(pReader->pData, &nData); return pReader->pData+n; } static void leafReaderInit(const char *pData, int nData, LeafReader *pReader){ int nTerm, n; assert( nData>0 ); assert( pData[0]=='\0' ); CLEAR(pReader); /* Read the first term, skipping the header byte. */ n = getVarint32(pData+1, &nTerm); dataBufferInit(&pReader->term, nTerm); dataBufferReplace(&pReader->term, pData+1+n, nTerm); /* Position after the first term. */ assert( 1+n+nTermpData = pData+1+n+nTerm; pReader->nData = nData-1-n-nTerm; } /* Step the reader forward to the next term. */ static void leafReaderStep(LeafReader *pReader){ int n, nData, nPrefix, nSuffix; assert( !leafReaderAtEnd(pReader) ); /* Skip previous entry's data block. */ n = getVarint32(pReader->pData, &nData); assert( n+nData<=pReader->nData ); pReader->pData += n+nData; pReader->nData -= n+nData; if( !leafReaderAtEnd(pReader) ){ /* Construct the new term using a prefix from the old term plus a ** suffix from the leaf data. */ n = getVarint32(pReader->pData, &nPrefix); n += getVarint32(pReader->pData+n, &nSuffix); assert( n+nSuffixnData ); pReader->term.nData = nPrefix; dataBufferAppend(&pReader->term, pReader->pData+n, nSuffix); pReader->pData += n+nSuffix; pReader->nData -= n+nSuffix; } } /* strcmp-style comparison of pReader's current term against pTerm. ** If isPrefix, equality means equal through nTerm bytes. */ static int leafReaderTermCmp(LeafReader *pReader, const char *pTerm, int nTerm, int isPrefix){ int c, n = pReader->term.nDataterm.nData : nTerm; if( n==0 ){ if( pReader->term.nData>0 ) return -1; if(nTerm>0 ) return 1; return 0; } c = memcmp(pReader->term.pData, pTerm, n); if( c!=0 ) return c; if( isPrefix && n==nTerm ) return 0; return pReader->term.nData - nTerm; } /****************************************************************/ /* LeavesReader wraps LeafReader to allow iterating over the entire ** leaf layer of the tree. */ typedef struct LeavesReader { int idx; /* Index within the segment. */ sqlite3_stmt *pStmt; /* Statement we're streaming leaves from. */ int eof; /* we've seen SQLITE_DONE from pStmt. */ LeafReader leafReader; /* reader for the current leaf. */ DataBuffer rootData; /* root data for inline. */ } LeavesReader; /* Access the current term. */ static int leavesReaderTermBytes(LeavesReader *pReader){ assert( !pReader->eof ); return leafReaderTermBytes(&pReader->leafReader); } static const char *leavesReaderTerm(LeavesReader *pReader){ assert( !pReader->eof ); return leafReaderTerm(&pReader->leafReader); } /* Access the doclist data for the current term. */ static int leavesReaderDataBytes(LeavesReader *pReader){ assert( !pReader->eof ); return leafReaderDataBytes(&pReader->leafReader); } static const char *leavesReaderData(LeavesReader *pReader){ assert( !pReader->eof ); return leafReaderData(&pReader->leafReader); } static int leavesReaderAtEnd(LeavesReader *pReader){ return pReader->eof; } /* loadSegmentLeaves() may not read all the way to SQLITE_DONE, thus ** leaving the statement handle open, which locks the table. */ /* TODO(shess) This "solution" is not satisfactory. Really, there ** should be check-in function for all statement handles which ** arranges to call sqlite3_reset(). This most likely will require ** modification to control flow all over the place, though, so for now ** just punt. ** ** Note the current system assumes that segment merges will run to ** completion, which is why this particular probably hasn't arisen in ** this case. Probably a brittle assumption. */ static int leavesReaderReset(LeavesReader *pReader){ return sqlite3_reset(pReader->pStmt); } static void leavesReaderDestroy(LeavesReader *pReader){ /* If idx is -1, that means we're using a non-cached statement ** handle in the optimize() case, so we need to release it. */ if( pReader->pStmt!=NULL && pReader->idx==-1 ){ sqlite3_finalize(pReader->pStmt); } leafReaderDestroy(&pReader->leafReader); dataBufferDestroy(&pReader->rootData); SCRAMBLE(pReader); } /* Initialize pReader with the given root data (if iStartBlockid==0 ** the leaf data was entirely contained in the root), or from the ** stream of blocks between iStartBlockid and iEndBlockid, inclusive. */ static int leavesReaderInit(fulltext_vtab *v, int idx, sqlite_int64 iStartBlockid, sqlite_int64 iEndBlockid, const char *pRootData, int nRootData, LeavesReader *pReader){ CLEAR(pReader); pReader->idx = idx; dataBufferInit(&pReader->rootData, 0); if( iStartBlockid==0 ){ /* Entire leaf level fit in root data. */ dataBufferReplace(&pReader->rootData, pRootData, nRootData); leafReaderInit(pReader->rootData.pData, pReader->rootData.nData, &pReader->leafReader); }else{ sqlite3_stmt *s; int rc = sql_get_leaf_statement(v, idx, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 1, iStartBlockid); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 2, iEndBlockid); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_step(s); if( rc==SQLITE_DONE ){ pReader->eof = 1; return SQLITE_OK; } if( rc!=SQLITE_ROW ) return rc; pReader->pStmt = s; leafReaderInit(sqlite3_column_blob(pReader->pStmt, 0), sqlite3_column_bytes(pReader->pStmt, 0), &pReader->leafReader); } return SQLITE_OK; } /* Step the current leaf forward to the next term. If we reach the ** end of the current leaf, step forward to the next leaf block. */ static int leavesReaderStep(fulltext_vtab *v, LeavesReader *pReader){ assert( !leavesReaderAtEnd(pReader) ); leafReaderStep(&pReader->leafReader); if( leafReaderAtEnd(&pReader->leafReader) ){ int rc; if( pReader->rootData.pData ){ pReader->eof = 1; return SQLITE_OK; } rc = sqlite3_step(pReader->pStmt); if( rc!=SQLITE_ROW ){ pReader->eof = 1; return rc==SQLITE_DONE ? SQLITE_OK : rc; } leafReaderDestroy(&pReader->leafReader); leafReaderInit(sqlite3_column_blob(pReader->pStmt, 0), sqlite3_column_bytes(pReader->pStmt, 0), &pReader->leafReader); } return SQLITE_OK; } /* Order LeavesReaders by their term, ignoring idx. Readers at eof ** always sort to the end. */ static int leavesReaderTermCmp(LeavesReader *lr1, LeavesReader *lr2){ if( leavesReaderAtEnd(lr1) ){ if( leavesReaderAtEnd(lr2) ) return 0; return 1; } if( leavesReaderAtEnd(lr2) ) return -1; return leafReaderTermCmp(&lr1->leafReader, leavesReaderTerm(lr2), leavesReaderTermBytes(lr2), 0); } /* Similar to leavesReaderTermCmp(), with additional ordering by idx ** so that older segments sort before newer segments. */ static int leavesReaderCmp(LeavesReader *lr1, LeavesReader *lr2){ int c = leavesReaderTermCmp(lr1, lr2); if( c!=0 ) return c; return lr1->idx-lr2->idx; } /* Assume that pLr[1]..pLr[nLr] are sorted. Bubble pLr[0] into its ** sorted position. */ static void leavesReaderReorder(LeavesReader *pLr, int nLr){ while( nLr>1 && leavesReaderCmp(pLr, pLr+1)>0 ){ LeavesReader tmp = pLr[0]; pLr[0] = pLr[1]; pLr[1] = tmp; nLr--; pLr++; } } /* Initializes pReaders with the segments from level iLevel, returning ** the number of segments in *piReaders. Leaves pReaders in sorted ** order. */ static int leavesReadersInit(fulltext_vtab *v, int iLevel, LeavesReader *pReaders, int *piReaders){ sqlite3_stmt *s; int i, rc = sql_get_statement(v, SEGDIR_SELECT_LEVEL_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int(s, 1, iLevel); if( rc!=SQLITE_OK ) return rc; i = 0; while( (rc = sqlite3_step(s))==SQLITE_ROW ){ sqlite_int64 iStart = sqlite3_column_int64(s, 0); sqlite_int64 iEnd = sqlite3_column_int64(s, 1); const char *pRootData = sqlite3_column_blob(s, 2); int nRootData = sqlite3_column_bytes(s, 2); assert( i0 ){ leavesReaderDestroy(&pReaders[i]); } return rc; } *piReaders = i; /* Leave our results sorted by term, then age. */ while( i-- ){ leavesReaderReorder(pReaders+i, *piReaders-i); } return SQLITE_OK; } /* Merge doclists from pReaders[nReaders] into a single doclist, which ** is written to pWriter. Assumes pReaders is ordered oldest to ** newest. */ /* TODO(shess) Consider putting this inline in segmentMerge(). */ static int leavesReadersMerge(fulltext_vtab *v, LeavesReader *pReaders, int nReaders, LeafWriter *pWriter){ DLReader dlReaders[MERGE_COUNT]; const char *pTerm = leavesReaderTerm(pReaders); int i, nTerm = leavesReaderTermBytes(pReaders); assert( nReaders<=MERGE_COUNT ); for(i=0; i0 ){ rc = leavesReaderStep(v, lrs+i); if( rc!=SQLITE_OK ) goto err; /* Reorder by term, then by age. */ leavesReaderReorder(lrs+i, MERGE_COUNT-i); } } for(i=0; i0 ); for(rc=SQLITE_OK; rc==SQLITE_OK && !leavesReaderAtEnd(pReader); rc=leavesReaderStep(v, pReader)){ /* TODO(shess) Really want leavesReaderTermCmp(), but that name is ** already taken to compare the terms of two LeavesReaders. Think ** on a better name. [Meanwhile, break encapsulation rather than ** use a confusing name.] */ int c = leafReaderTermCmp(&pReader->leafReader, pTerm, nTerm, isPrefix); if( c>0 ) break; /* Past any possible matches. */ if( c==0 ){ const char *pData = leavesReaderData(pReader); int iBuffer, nData = leavesReaderDataBytes(pReader); /* Find the first empty buffer. */ for(iBuffer=0; iBuffer0 ){ assert(pBuffers!=NULL); memcpy(p, pBuffers, nBuffers*sizeof(*pBuffers)); sqlite3_free(pBuffers); } pBuffers = p; } dataBufferInit(&(pBuffers[nBuffers]), 0); nBuffers++; } /* At this point, must have an empty at iBuffer. */ assert(iBufferpData, p->nData); /* dataBufferReset() could allow a large doclist to blow up ** our memory requirements. */ if( p->nCapacity<1024 ){ dataBufferReset(p); }else{ dataBufferDestroy(p); dataBufferInit(p, 0); } } } } } /* Union all the doclists together into *out. */ /* TODO(shess) What if *out is big? Sigh. */ if( rc==SQLITE_OK && nBuffers>0 ){ int iBuffer; for(iBuffer=0; iBuffer0 ){ if( out->nData==0 ){ dataBufferSwap(out, &(pBuffers[iBuffer])); }else{ docListAccumulateUnion(out, pBuffers[iBuffer].pData, pBuffers[iBuffer].nData); } } } } while( nBuffers-- ){ dataBufferDestroy(&(pBuffers[nBuffers])); } if( pBuffers!=NULL ) sqlite3_free(pBuffers); return rc; } /* Call loadSegmentLeavesInt() with pData/nData as input. */ static int loadSegmentLeaf(fulltext_vtab *v, const char *pData, int nData, const char *pTerm, int nTerm, int isPrefix, DataBuffer *out){ LeavesReader reader; int rc; assert( nData>1 ); assert( *pData=='\0' ); rc = leavesReaderInit(v, 0, 0, 0, pData, nData, &reader); if( rc!=SQLITE_OK ) return rc; rc = loadSegmentLeavesInt(v, &reader, pTerm, nTerm, isPrefix, out); leavesReaderReset(&reader); leavesReaderDestroy(&reader); return rc; } /* Call loadSegmentLeavesInt() with the leaf nodes from iStartLeaf to ** iEndLeaf (inclusive) as input, and merge the resulting doclist into ** out. */ static int loadSegmentLeaves(fulltext_vtab *v, sqlite_int64 iStartLeaf, sqlite_int64 iEndLeaf, const char *pTerm, int nTerm, int isPrefix, DataBuffer *out){ int rc; LeavesReader reader; assert( iStartLeaf<=iEndLeaf ); rc = leavesReaderInit(v, 0, iStartLeaf, iEndLeaf, NULL, 0, &reader); if( rc!=SQLITE_OK ) return rc; rc = loadSegmentLeavesInt(v, &reader, pTerm, nTerm, isPrefix, out); leavesReaderReset(&reader); leavesReaderDestroy(&reader); return rc; } /* Taking pData/nData as an interior node, find the sequence of child ** nodes which could include pTerm/nTerm/isPrefix. Note that the ** interior node terms logically come between the blocks, so there is ** one more blockid than there are terms (that block contains terms >= ** the last interior-node term). */ /* TODO(shess) The calling code may already know that the end child is ** not worth calculating, because the end may be in a later sibling ** node. Consider whether breaking symmetry is worthwhile. I suspect ** it is not worthwhile. */ static void getChildrenContaining(const char *pData, int nData, const char *pTerm, int nTerm, int isPrefix, sqlite_int64 *piStartChild, sqlite_int64 *piEndChild){ InteriorReader reader; assert( nData>1 ); assert( *pData!='\0' ); interiorReaderInit(pData, nData, &reader); /* Scan for the first child which could contain pTerm/nTerm. */ while( !interiorReaderAtEnd(&reader) ){ if( interiorReaderTermCmp(&reader, pTerm, nTerm, 0)>0 ) break; interiorReaderStep(&reader); } *piStartChild = interiorReaderCurrentBlockid(&reader); /* Keep scanning to find a term greater than our term, using prefix ** comparison if indicated. If isPrefix is false, this will be the ** same blockid as the starting block. */ while( !interiorReaderAtEnd(&reader) ){ if( interiorReaderTermCmp(&reader, pTerm, nTerm, isPrefix)>0 ) break; interiorReaderStep(&reader); } *piEndChild = interiorReaderCurrentBlockid(&reader); interiorReaderDestroy(&reader); /* Children must ascend, and if !prefix, both must be the same. */ assert( *piEndChild>=*piStartChild ); assert( isPrefix || *piStartChild==*piEndChild ); } /* Read block at iBlockid and pass it with other params to ** getChildrenContaining(). */ static int loadAndGetChildrenContaining( fulltext_vtab *v, sqlite_int64 iBlockid, const char *pTerm, int nTerm, int isPrefix, sqlite_int64 *piStartChild, sqlite_int64 *piEndChild ){ sqlite3_stmt *s = NULL; int rc; assert( iBlockid!=0 ); assert( pTerm!=NULL ); assert( nTerm!=0 ); /* TODO(shess) Why not allow this? */ assert( piStartChild!=NULL ); assert( piEndChild!=NULL ); rc = sql_get_statement(v, BLOCK_SELECT_STMT, &s); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_bind_int64(s, 1, iBlockid); if( rc!=SQLITE_OK ) return rc; rc = sqlite3_step(s); if( rc==SQLITE_DONE ) return SQLITE_ERROR; if( rc!=SQLITE_ROW ) return rc; getChildrenContaining(sqlite3_column_blob(s, 0), sqlite3_column_bytes(s, 0), pTerm, nTerm, isPrefix, piStartChild, piEndChild); /* We expect only one row. We must execute another sqlite3_step() * to complete the iteration; otherwise the table will remain * locked. */ rc = sqlite3_step(s); if( rc==SQLITE_ROW ) return SQLITE_ERROR; if( rc!=SQLITE_DONE ) return rc; return SQLITE_OK; } /* Traverse the tree represented by pData[nData] looking for ** pTerm[nTerm], placing its doclist into *out. This is internal to ** loadSegment() to make error-handling cleaner. */ static int loadSegmentInt(fulltext_vtab *v, const char *pData, int nData, sqlite_int64 iLeavesEnd, const char *pTerm, int nTerm, int isPrefix, DataBuffer *out){ /* Special case where root is a leaf. */ if( *pData=='\0' ){ return loadSegmentLeaf(v, pData, nData, pTerm, nTerm, isPrefix, out); }else{ int rc; sqlite_int64 iStartChild, iEndChild; /* Process pData as an interior node, then loop down the tree ** until we find the set of leaf nodes to scan for the term. */ getChildrenContaining(pData, nData, pTerm, nTerm, isPrefix, &iStartChild, &iEndChild); while( iStartChild>iLeavesEnd ){ sqlite_int64 iNextStart, iNextEnd; rc = loadAndGetChildrenContaining(v, iStartChild, pTerm, nTerm, isPrefix, &iNextStart, &iNextEnd); if( rc!=SQLITE_OK ) return rc; /* If we've branched, follow the end branch, too. */ if( iStartChild!=iEndChild ){ sqlite_int64 iDummy; rc = loadAndGetChildrenContaining(v, iEndChild, pTerm, nTerm, isPrefix, &iDummy, &iNextEnd); if( rc!=SQLITE_OK ) return rc; } assert( iNextStart<=iNextEnd ); iStartChild = iNextStart; iEndChild = iNextEnd; } assert( iStartChild<=iLeavesEnd ); assert( iEndChild<=iLeavesEnd ); /* Scan through the leaf segments for doclists. */ return loadSegmentLeaves(v, iStartChild, iEndChild, pTerm, nTerm, isPrefix, out); } } /* Call loadSegmentInt() to collect the doclist for pTerm/nTerm, then ** merge its doclist over *out (any duplicate doclists read from the ** segment rooted at pData will overwrite those in *out). */ /* TODO(shess) Consider changing this to determine the depth of the ** leaves using either the first characters of interior nodes (when ** ==1, we're one level above the leaves), or the first character of ** the root (which will describe the height of the tree directly). ** Either feels somewhat tricky to me. */ /* TODO(shess) The current merge is likely to be slow for large ** doclists (though it should process from newest/smallest to ** oldest/largest, so it may not be that bad). It might be useful to ** modify things to allow for N-way merging. This could either be ** within a segment, with pairwise merges across segments, or across ** all segments at once. */ static int loadSegment(fulltext_vtab *v, const char *pData, int nData, sqlite_int64 iLeavesEnd, const char *pTerm, int nTerm, int isPrefix, DataBuffer *out){ DataBuffer result; int rc; assert( nData>1 ); /* This code should never be called with buffered updates. */ assert( v->nPendingData<0 ); dataBufferInit(&result, 0); rc = loadSegmentInt(v, pData, nData, iLeavesEnd, pTerm, nTerm, isPrefix, &result); if( rc==SQLITE_OK && result.nData>0 ){ if( out->nData==0 ){ DataBuffer tmp = *out; *out = result; result = tmp; }else{ DataBuffer merged; DLReader readers[2]; dlrInit(&readers[0], DL_DEFAULT, out->pData, out->nData); dlrInit(&readers[1], DL_DEFAULT, result.pData, result.nData); dataBufferInit(&merged, out->nData+result.nData); docListMerge(&merged, readers, 2); dataBufferDestroy(out); *out = merged; dlrDestroy(&readers[0]); dlrDestroy(&readers[1]); } } dataBufferDestroy(&result); return rc; } /* Scan the database and merge together the posting lists for the term ** into *out. */ static int termSelect(fulltext_vtab *v, int iColumn, const char *pTerm, int nTerm, int isPrefix, DocListType iType, DataBuffer *out){ DataBuffer doclist; sqlite3_stmt *s; int rc = sql_get_statement(v, SEGDIR_SELECT_ALL_STMT, &s); if( rc!=SQLITE_OK ) return rc; /* This code should never be called with buffered updates. */ assert( v->nPendingData<0 ); dataBufferInit(&doclist, 0); /* Traverse the segments from oldest to newest so that newer doclist ** elements for given docids overwrite older elements. */ while( (rc = sqlite3_step(s))==SQLITE_ROW ){ const char *pData = sqlite3_column_blob(s, 2); const int nData = sqlite3_column_bytes(s, 2); const sqlite_int64 iLeavesEnd = sqlite3_column_int64(s, 1); rc = loadSegment(v, pData, nData, iLeavesEnd, pTerm, nTerm, isPrefix, &doclist); if( rc!=SQLITE_OK ) goto err; } if( rc==SQLITE_DONE ){ if( doclist.nData!=0 ){ /* TODO(shess) The old term_select_all() code applied the column ** restrict as we merged segments, leading to smaller buffers. ** This is probably worthwhile to bring back, once the new storage ** system is checked in. */ if( iColumn==v->nColumn) iColumn = -1; docListTrim(DL_DEFAULT, doclist.pData, doclist.nData, iColumn, iType, out); } rc = SQLITE_OK; } err: dataBufferDestroy(&doclist); return rc; } /****************************************************************/ /* Used to hold hashtable data for sorting. */ typedef struct TermData { const char *pTerm; int nTerm; DLCollector *pCollector; } TermData; /* Orders TermData elements in strcmp fashion ( <0 for less-than, 0 ** for equal, >0 for greater-than). */ static int termDataCmp(const void *av, const void *bv){ const TermData *a = (const TermData *)av; const TermData *b = (const TermData *)bv; int n = a->nTermnTerm ? a->nTerm : b->nTerm; int c = memcmp(a->pTerm, b->pTerm, n); if( c!=0 ) return c; return a->nTerm-b->nTerm; } /* Order pTerms data by term, then write a new level 0 segment using ** LeafWriter. */ static int writeZeroSegment(fulltext_vtab *v, fts2Hash *pTerms){ fts2HashElem *e; int idx, rc, i, n; TermData *pData; LeafWriter writer; DataBuffer dl; /* Determine the next index at level 0, merging as necessary. */ rc = segdirNextIndex(v, 0, &idx); if( rc!=SQLITE_OK ) return rc; n = fts2HashCount(pTerms); pData = sqlite3_malloc(n*sizeof(TermData)); for(i = 0, e = fts2HashFirst(pTerms); e; i++, e = fts2HashNext(e)){ assert( i1 ) qsort(pData, n, sizeof(*pData), termDataCmp); /* TODO(shess) Refactor so that we can write directly to the segment ** DataBuffer, as happens for segment merges. */ leafWriterInit(0, idx, &writer); dataBufferInit(&dl, 0); for(i=0; inPendingData>=0 ){ fts2HashElem *e; for(e=fts2HashFirst(&v->pendingTerms); e; e=fts2HashNext(e)){ dlcDelete(fts2HashData(e)); } fts2HashClear(&v->pendingTerms); v->nPendingData = -1; } return SQLITE_OK; } /* If pendingTerms has data, flush it to a level-zero segment, and ** free it. */ static int flushPendingTerms(fulltext_vtab *v){ if( v->nPendingData>=0 ){ int rc = writeZeroSegment(v, &v->pendingTerms); if( rc==SQLITE_OK ) clearPendingTerms(v); return rc; } return SQLITE_OK; } /* If pendingTerms is "too big", or docid is out of order, flush it. ** Regardless, be certain that pendingTerms is initialized for use. */ static int initPendingTerms(fulltext_vtab *v, sqlite_int64 iDocid){ /* TODO(shess) Explore whether partially flushing the buffer on ** forced-flush would provide better performance. I suspect that if ** we ordered the doclists by size and flushed the largest until the ** buffer was half empty, that would let the less frequent terms ** generate longer doclists. */ if( iDocid<=v->iPrevDocid || v->nPendingData>kPendingThreshold ){ int rc = flushPendingTerms(v); if( rc!=SQLITE_OK ) return rc; } if( v->nPendingData<0 ){ fts2HashInit(&v->pendingTerms, FTS2_HASH_STRING, 1); v->nPendingData = 0; } v->iPrevDocid = iDocid; return SQLITE_OK; } /* This function implements the xUpdate callback; it is the top-level entry * point for inserting, deleting or updating a row in a full-text table. */ static int fulltextUpdate(sqlite3_vtab *pVtab, int nArg, sqlite3_value **ppArg, sqlite_int64 *pRowid){ fulltext_vtab *v = (fulltext_vtab *) pVtab; int rc; TRACE(("FTS2 Update %p\n", pVtab)); if( nArg<2 ){ rc = index_delete(v, sqlite3_value_int64(ppArg[0])); if( rc==SQLITE_OK ){ /* If we just deleted the last row in the table, clear out the ** index data. */ rc = content_exists(v); if( rc==SQLITE_ROW ){ rc = SQLITE_OK; }else if( rc==SQLITE_DONE ){ /* Clear the pending terms so we don't flush a useless level-0 ** segment when the transaction closes. */ rc = clearPendingTerms(v); if( rc==SQLITE_OK ){ rc = segdir_delete_all(v); } } } } else if( sqlite3_value_type(ppArg[0]) != SQLITE_NULL ){ /* An update: * ppArg[0] = old rowid * ppArg[1] = new rowid * ppArg[2..2+v->nColumn-1] = values * ppArg[2+v->nColumn] = value for magic column (we ignore this) */ sqlite_int64 rowid = sqlite3_value_int64(ppArg[0]); if( sqlite3_value_type(ppArg[1]) != SQLITE_INTEGER || sqlite3_value_int64(ppArg[1]) != rowid ){ rc = SQLITE_ERROR; /* we don't allow changing the rowid */ } else { assert( nArg==2+v->nColumn+1); rc = index_update(v, rowid, &ppArg[2]); } } else { /* An insert: * ppArg[1] = requested rowid * ppArg[2..2+v->nColumn-1] = values * ppArg[2+v->nColumn] = value for magic column (we ignore this) */ assert( nArg==2+v->nColumn+1); rc = index_insert(v, ppArg[1], &ppArg[2], pRowid); } return rc; } static int fulltextSync(sqlite3_vtab *pVtab){ TRACE(("FTS2 xSync()\n")); return flushPendingTerms((fulltext_vtab *)pVtab); } static int fulltextBegin(sqlite3_vtab *pVtab){ fulltext_vtab *v = (fulltext_vtab *) pVtab; TRACE(("FTS2 xBegin()\n")); /* Any buffered updates should have been cleared by the previous ** transaction. */ assert( v->nPendingData<0 ); return clearPendingTerms(v); } static int fulltextCommit(sqlite3_vtab *pVtab){ fulltext_vtab *v = (fulltext_vtab *) pVtab; TRACE(("FTS2 xCommit()\n")); /* Buffered updates should have been cleared by fulltextSync(). */ assert( v->nPendingData<0 ); return clearPendingTerms(v); } static int fulltextRollback(sqlite3_vtab *pVtab){ TRACE(("FTS2 xRollback()\n")); return clearPendingTerms((fulltext_vtab *)pVtab); } /* ** Implementation of the snippet() function for FTS2 */ static void snippetFunc( sqlite3_context *pContext, int argc, sqlite3_value **argv ){ fulltext_cursor *pCursor; if( argc<1 ) return; if( sqlite3_value_type(argv[0])!=SQLITE_BLOB || sqlite3_value_bytes(argv[0])!=sizeof(pCursor) ){ sqlite3_result_error(pContext, "illegal first argument to html_snippet",-1); }else{ const char *zStart = ""; const char *zEnd = ""; const char *zEllipsis = "..."; memcpy(&pCursor, sqlite3_value_blob(argv[0]), sizeof(pCursor)); if( argc>=2 ){ zStart = (const char*)sqlite3_value_text(argv[1]); if( argc>=3 ){ zEnd = (const char*)sqlite3_value_text(argv[2]); if( argc>=4 ){ zEllipsis = (const char*)sqlite3_value_text(argv[3]); } } } snippetAllOffsets(pCursor); snippetText(pCursor, zStart, zEnd, zEllipsis); sqlite3_result_text(pContext, pCursor->snippet.zSnippet, pCursor->snippet.nSnippet, SQLITE_STATIC); } } /* ** Implementation of the offsets() function for FTS2 */ static void snippetOffsetsFunc( sqlite3_context *pContext, int argc, sqlite3_value **argv ){ fulltext_cursor *pCursor; if( argc<1 ) return; if( sqlite3_value_type(argv[0])!=SQLITE_BLOB || sqlite3_value_bytes(argv[0])!=sizeof(pCursor) ){ sqlite3_result_error(pContext, "illegal first argument to offsets",-1); }else{ memcpy(&pCursor, sqlite3_value_blob(argv[0]), sizeof(pCursor)); snippetAllOffsets(pCursor); snippetOffsetText(&pCursor->snippet); sqlite3_result_text(pContext, pCursor->snippet.zOffset, pCursor->snippet.nOffset, SQLITE_STATIC); } } /* OptLeavesReader is nearly identical to LeavesReader, except that ** where LeavesReader is geared towards the merging of complete ** segment levels (with exactly MERGE_COUNT segments), OptLeavesReader ** is geared towards implementation of the optimize() function, and ** can merge all segments simultaneously. This version may be ** somewhat less efficient than LeavesReader because it merges into an ** accumulator rather than doing an N-way merge, but since segment ** size grows exponentially (so segment count logrithmically) this is ** probably not an immediate problem. */ /* TODO(shess): Prove that assertion, or extend the merge code to ** merge tree fashion (like the prefix-searching code does). */ /* TODO(shess): OptLeavesReader and LeavesReader could probably be ** merged with little or no loss of performance for LeavesReader. The ** merged code would need to handle >MERGE_COUNT segments, and would ** also need to be able to optionally optimize away deletes. */ typedef struct OptLeavesReader { /* Segment number, to order readers by age. */ int segment; LeavesReader reader; } OptLeavesReader; static int optLeavesReaderAtEnd(OptLeavesReader *pReader){ return leavesReaderAtEnd(&pReader->reader); } static int optLeavesReaderTermBytes(OptLeavesReader *pReader){ return leavesReaderTermBytes(&pReader->reader); } static const char *optLeavesReaderData(OptLeavesReader *pReader){ return leavesReaderData(&pReader->reader); } static int optLeavesReaderDataBytes(OptLeavesReader *pReader){ return leavesReaderDataBytes(&pReader->reader); } static const char *optLeavesReaderTerm(OptLeavesReader *pReader){ return leavesReaderTerm(&pReader->reader); } static int optLeavesReaderStep(fulltext_vtab *v, OptLeavesReader *pReader){ return leavesReaderStep(v, &pReader->reader); } static int optLeavesReaderTermCmp(OptLeavesReader *lr1, OptLeavesReader *lr2){ return leavesReaderTermCmp(&lr1->reader, &lr2->reader); } /* Order by term ascending, segment ascending (oldest to newest), with ** exhausted readers to the end. */ static int optLeavesReaderCmp(OptLeavesReader *lr1, OptLeavesReader *lr2){ int c = optLeavesReaderTermCmp(lr1, lr2); if( c!=0 ) return c; return lr1->segment-lr2->segment; } /* Bubble pLr[0] to appropriate place in pLr[1..nLr-1]. Assumes that ** pLr[1..nLr-1] is already sorted. */ static void optLeavesReaderReorder(OptLeavesReader *pLr, int nLr){ while( nLr>1 && optLeavesReaderCmp(pLr, pLr+1)>0 ){ OptLeavesReader tmp = pLr[0]; pLr[0] = pLr[1]; pLr[1] = tmp; nLr--; pLr++; } } /* optimize() helper function. Put the readers in order and iterate ** through them, merging doclists for matching terms into pWriter. ** Returns SQLITE_OK on success, or the SQLite error code which ** prevented success. */ static int optimizeInternal(fulltext_vtab *v, OptLeavesReader *readers, int nReaders, LeafWriter *pWriter){ int i, rc = SQLITE_OK; DataBuffer doclist, merged, tmp; /* Order the readers. */ i = nReaders; while( i-- > 0 ){ optLeavesReaderReorder(&readers[i], nReaders-i); } dataBufferInit(&doclist, LEAF_MAX); dataBufferInit(&merged, LEAF_MAX); /* Exhausted readers bubble to the end, so when the first reader is ** at eof, all are at eof. */ while( !optLeavesReaderAtEnd(&readers[0]) ){ /* Figure out how many readers share the next term. */ for(i=1; i 0 ){ dlrDestroy(&dlReaders[nReaders]); } /* Accumulated doclist to reader 0 for next pass. */ dlrInit(&dlReaders[0], DL_DEFAULT, doclist.pData, doclist.nData); } /* Destroy reader that was left in the pipeline. */ dlrDestroy(&dlReaders[0]); /* Trim deletions from the doclist. */ dataBufferReset(&merged); docListTrim(DL_DEFAULT, doclist.pData, doclist.nData, -1, DL_DEFAULT, &merged); } /* Only pass doclists with hits (skip if all hits deleted). */ if( merged.nData>0 ){ rc = leafWriterStep(v, pWriter, optLeavesReaderTerm(&readers[0]), optLeavesReaderTermBytes(&readers[0]), merged.pData, merged.nData); if( rc!=SQLITE_OK ) goto err; } /* Step merged readers to next term and reorder. */ while( i-- > 0 ){ rc = optLeavesReaderStep(v, &readers[i]); if( rc!=SQLITE_OK ) goto err; optLeavesReaderReorder(&readers[i], nReaders-i); } } err: dataBufferDestroy(&doclist); dataBufferDestroy(&merged); return rc; } /* Implement optimize() function for FTS3. optimize(t) merges all ** segments in the fts index into a single segment. 't' is the magic ** table-named column. */ static void optimizeFunc(sqlite3_context *pContext, int argc, sqlite3_value **argv){ fulltext_cursor *pCursor; if( argc>1 ){ sqlite3_result_error(pContext, "excess arguments to optimize()",-1); }else if( sqlite3_value_type(argv[0])!=SQLITE_BLOB || sqlite3_value_bytes(argv[0])!=sizeof(pCursor) ){ sqlite3_result_error(pContext, "illegal first argument to optimize",-1); }else{ fulltext_vtab *v; int i, rc, iMaxLevel; OptLeavesReader *readers; int nReaders; LeafWriter writer; sqlite3_stmt *s; memcpy(&pCursor, sqlite3_value_blob(argv[0]), sizeof(pCursor)); v = cursor_vtab(pCursor); /* Flush any buffered updates before optimizing. */ rc = flushPendingTerms(v); if( rc!=SQLITE_OK ) goto err; rc = segdir_count(v, &nReaders, &iMaxLevel); if( rc!=SQLITE_OK ) goto err; if( nReaders==0 || nReaders==1 ){ sqlite3_result_text(pContext, "Index already optimal", -1, SQLITE_STATIC); return; } rc = sql_get_statement(v, SEGDIR_SELECT_ALL_STMT, &s); if( rc!=SQLITE_OK ) goto err; readers = sqlite3_malloc(nReaders*sizeof(readers[0])); if( readers==NULL ) goto err; /* Note that there will already be a segment at this position ** until we call segdir_delete() on iMaxLevel. */ leafWriterInit(iMaxLevel, 0, &writer); i = 0; while( (rc = sqlite3_step(s))==SQLITE_ROW ){ sqlite_int64 iStart = sqlite3_column_int64(s, 0); sqlite_int64 iEnd = sqlite3_column_int64(s, 1); const char *pRootData = sqlite3_column_blob(s, 2); int nRootData = sqlite3_column_bytes(s, 2); assert( i 0 ){ leavesReaderDestroy(&readers[i].reader); } sqlite3_free(readers); /* If we've successfully gotten to here, delete the old segments ** and flush the interior structure of the new segment. */ if( rc==SQLITE_OK ){ for( i=0; i<=iMaxLevel; i++ ){ rc = segdir_delete(v, i); if( rc!=SQLITE_OK ) break; } if( rc==SQLITE_OK ) rc = leafWriterFinalize(v, &writer); } leafWriterDestroy(&writer); if( rc!=SQLITE_OK ) goto err; sqlite3_result_text(pContext, "Index optimized", -1, SQLITE_STATIC); return; /* TODO(shess): Error-handling needs to be improved along the ** lines of the dump_ functions. */ err: { char buf[512]; sqlite3_snprintf(sizeof(buf), buf, "Error in optimize: %s", sqlite3_errmsg(sqlite3_context_db_handle(pContext))); sqlite3_result_error(pContext, buf, -1); } } } #ifdef SQLITE_TEST /* Generate an error of the form ": ". If msg is NULL, ** pull the error from the context's db handle. */ static void generateError(sqlite3_context *pContext, const char *prefix, const char *msg){ char buf[512]; if( msg==NULL ) msg = sqlite3_errmsg(sqlite3_context_db_handle(pContext)); sqlite3_snprintf(sizeof(buf), buf, "%s: %s", prefix, msg); sqlite3_result_error(pContext, buf, -1); } /* Helper function to collect the set of terms in the segment into ** pTerms. The segment is defined by the leaf nodes between ** iStartBlockid and iEndBlockid, inclusive, or by the contents of ** pRootData if iStartBlockid is 0 (in which case the entire segment ** fit in a leaf). */ static int collectSegmentTerms(fulltext_vtab *v, sqlite3_stmt *s, fts2Hash *pTerms){ const sqlite_int64 iStartBlockid = sqlite3_column_int64(s, 0); const sqlite_int64 iEndBlockid = sqlite3_column_int64(s, 1); const char *pRootData = sqlite3_column_blob(s, 2); const int nRootData = sqlite3_column_bytes(s, 2); LeavesReader reader; int rc = leavesReaderInit(v, 0, iStartBlockid, iEndBlockid, pRootData, nRootData, &reader); if( rc!=SQLITE_OK ) return rc; while( rc==SQLITE_OK && !leavesReaderAtEnd(&reader) ){ const char *pTerm = leavesReaderTerm(&reader); const int nTerm = leavesReaderTermBytes(&reader); void *oldValue = sqlite3Fts2HashFind(pTerms, pTerm, nTerm); void *newValue = (void *)((char *)oldValue+1); /* From the comment before sqlite3Fts2HashInsert in fts2_hash.c, ** the data value passed is returned in case of malloc failure. */ if( newValue==sqlite3Fts2HashInsert(pTerms, pTerm, nTerm, newValue) ){ rc = SQLITE_NOMEM; }else{ rc = leavesReaderStep(v, &reader); } } leavesReaderDestroy(&reader); return rc; } /* Helper function to build the result string for dump_terms(). */ static int generateTermsResult(sqlite3_context *pContext, fts2Hash *pTerms){ int iTerm, nTerms, nResultBytes, iByte; char *result; TermData *pData; fts2HashElem *e; /* Iterate pTerms to generate an array of terms in pData for ** sorting. */ nTerms = fts2HashCount(pTerms); assert( nTerms>0 ); pData = sqlite3_malloc(nTerms*sizeof(TermData)); if( pData==NULL ) return SQLITE_NOMEM; nResultBytes = 0; for(iTerm = 0, e = fts2HashFirst(pTerms); e; iTerm++, e = fts2HashNext(e)){ nResultBytes += fts2HashKeysize(e)+1; /* Term plus trailing space */ assert( iTerm0 ); /* nTerms>0, nResultsBytes must be, too. */ result = sqlite3_malloc(nResultBytes); if( result==NULL ){ sqlite3_free(pData); return SQLITE_NOMEM; } if( nTerms>1 ) qsort(pData, nTerms, sizeof(*pData), termDataCmp); /* Read the terms in order to build the result. */ iByte = 0; for(iTerm=0; iTerm0 ){ rc = generateTermsResult(pContext, &terms); if( rc==SQLITE_NOMEM ){ generateError(pContext, "dump_terms", "out of memory"); }else{ assert( rc==SQLITE_OK ); } }else if( argc==3 ){ /* The specific segment asked for could not be found. */ generateError(pContext, "dump_terms", "segment not found"); }else{ /* No segments found. */ /* TODO(shess): It should be impossible to reach this. This ** case can only happen for an empty table, in which case ** SQLite has no rows to call this function on. */ sqlite3_result_null(pContext); } } sqlite3Fts2HashClear(&terms); } } /* Expand the DL_DEFAULT doclist in pData into a text result in ** pContext. */ static void createDoclistResult(sqlite3_context *pContext, const char *pData, int nData){ DataBuffer dump; DLReader dlReader; assert( pData!=NULL && nData>0 ); dataBufferInit(&dump, 0); dlrInit(&dlReader, DL_DEFAULT, pData, nData); for( ; !dlrAtEnd(&dlReader); dlrStep(&dlReader) ){ char buf[256]; PLReader plReader; plrInit(&plReader, &dlReader); if( DL_DEFAULT==DL_DOCIDS || plrAtEnd(&plReader) ){ sqlite3_snprintf(sizeof(buf), buf, "[%lld] ", dlrDocid(&dlReader)); dataBufferAppend(&dump, buf, strlen(buf)); }else{ int iColumn = plrColumn(&plReader); sqlite3_snprintf(sizeof(buf), buf, "[%lld %d[", dlrDocid(&dlReader), iColumn); dataBufferAppend(&dump, buf, strlen(buf)); for( ; !plrAtEnd(&plReader); plrStep(&plReader) ){ if( plrColumn(&plReader)!=iColumn ){ iColumn = plrColumn(&plReader); sqlite3_snprintf(sizeof(buf), buf, "] %d[", iColumn); assert( dump.nData>0 ); dump.nData--; /* Overwrite trailing space. */ assert( dump.pData[dump.nData]==' '); dataBufferAppend(&dump, buf, strlen(buf)); } if( DL_DEFAULT==DL_POSITIONS_OFFSETS ){ sqlite3_snprintf(sizeof(buf), buf, "%d,%d,%d ", plrPosition(&plReader), plrStartOffset(&plReader), plrEndOffset(&plReader)); }else if( DL_DEFAULT==DL_POSITIONS ){ sqlite3_snprintf(sizeof(buf), buf, "%d ", plrPosition(&plReader)); }else{ assert( NULL=="Unhandled DL_DEFAULT value"); } dataBufferAppend(&dump, buf, strlen(buf)); } plrDestroy(&plReader); assert( dump.nData>0 ); dump.nData--; /* Overwrite trailing space. */ assert( dump.pData[dump.nData]==' '); dataBufferAppend(&dump, "]] ", 3); } } dlrDestroy(&dlReader); assert( dump.nData>0 ); dump.nData--; /* Overwrite trailing space. */ assert( dump.pData[dump.nData]==' '); dump.pData[dump.nData] = '\0'; assert( dump.nData>0 ); /* Passes ownership of dump's buffer to pContext. */ sqlite3_result_text(pContext, dump.pData, dump.nData, sqlite3_free); dump.pData = NULL; dump.nData = dump.nCapacity = 0; } /* Implements dump_doclist() for use in inspecting the fts2 index from ** tests. TEXT result containing a string representation of the ** doclist for the indicated term. dump_doclist(t, term, level, idx) ** dumps the doclist for term from the segment specified by level, idx ** (in %_segdir), while dump_doclist(t, term) dumps the logical ** doclist for the term across all segments. The per-segment doclist ** can contain deletions, while the full-index doclist will not ** (deletions are omitted). ** ** Result formats differ with the setting of DL_DEFAULTS. Examples: ** ** DL_DOCIDS: [1] [3] [7] ** DL_POSITIONS: [1 0[0 4] 1[17]] [3 1[5]] ** DL_POSITIONS_OFFSETS: [1 0[0,0,3 4,23,26] 1[17,102,105]] [3 1[5,20,23]] ** ** In each case the number after the outer '[' is the docid. In the ** latter two cases, the number before the inner '[' is the column ** associated with the values within. For DL_POSITIONS the numbers ** within are the positions, for DL_POSITIONS_OFFSETS they are the ** position, the start offset, and the end offset. */ static void dumpDoclistFunc( sqlite3_context *pContext, int argc, sqlite3_value **argv ){ fulltext_cursor *pCursor; if( argc!=2 && argc!=4 ){ generateError(pContext, "dump_doclist", "incorrect arguments"); }else if( sqlite3_value_type(argv[0])!=SQLITE_BLOB || sqlite3_value_bytes(argv[0])!=sizeof(pCursor) ){ generateError(pContext, "dump_doclist", "illegal first argument"); }else if( sqlite3_value_text(argv[1])==NULL || sqlite3_value_text(argv[1])[0]=='\0' ){ generateError(pContext, "dump_doclist", "empty second argument"); }else{ const char *pTerm = (const char *)sqlite3_value_text(argv[1]); const int nTerm = strlen(pTerm); fulltext_vtab *v; int rc; DataBuffer doclist; memcpy(&pCursor, sqlite3_value_blob(argv[0]), sizeof(pCursor)); v = cursor_vtab(pCursor); dataBufferInit(&doclist, 0); /* termSelect() yields the same logical doclist that queries are ** run against. */ if( argc==2 ){ rc = termSelect(v, v->nColumn, pTerm, nTerm, 0, DL_DEFAULT, &doclist); }else{ sqlite3_stmt *s = NULL; /* Get our specific segment's information. */ rc = sql_get_statement(v, SEGDIR_SELECT_SEGMENT_STMT, &s); if( rc==SQLITE_OK ){ rc = sqlite3_bind_int(s, 1, sqlite3_value_int(argv[2])); if( rc==SQLITE_OK ){ rc = sqlite3_bind_int(s, 2, sqlite3_value_int(argv[3])); } } if( rc==SQLITE_OK ){ rc = sqlite3_step(s); if( rc==SQLITE_DONE ){ dataBufferDestroy(&doclist); generateError(pContext, "dump_doclist", "segment not found"); return; } /* Found a segment, load it into doclist. */ if( rc==SQLITE_ROW ){ const sqlite_int64 iLeavesEnd = sqlite3_column_int64(s, 1); const char *pData = sqlite3_column_blob(s, 2); const int nData = sqlite3_column_bytes(s, 2); /* loadSegment() is used by termSelect() to load each ** segment's data. */ rc = loadSegment(v, pData, nData, iLeavesEnd, pTerm, nTerm, 0, &doclist); if( rc==SQLITE_OK ){ rc = sqlite3_step(s); /* Should not have more than one matching segment. */ if( rc!=SQLITE_DONE ){ sqlite3_reset(s); dataBufferDestroy(&doclist); generateError(pContext, "dump_doclist", "invalid segdir"); return; } rc = SQLITE_OK; } } } sqlite3_reset(s); } if( rc==SQLITE_OK ){ if( doclist.nData>0 ){ createDoclistResult(pContext, doclist.pData, doclist.nData); }else{ /* TODO(shess): This can happen if the term is not present, or ** if all instances of the term have been deleted and this is ** an all-index dump. It may be interesting to distinguish ** these cases. */ sqlite3_result_text(pContext, "", 0, SQLITE_STATIC); } }else if( rc==SQLITE_NOMEM ){ /* Handle out-of-memory cases specially because if they are ** generated in fts2 code they may not be reflected in the db ** handle. */ /* TODO(shess): Handle this more comprehensively. ** sqlite3ErrStr() has what I need, but is internal. */ generateError(pContext, "dump_doclist", "out of memory"); }else{ generateError(pContext, "dump_doclist", NULL); } dataBufferDestroy(&doclist); } } #endif /* ** This routine implements the xFindFunction method for the FTS2 ** virtual table. */ static int fulltextFindFunction( sqlite3_vtab *pVtab, int nArg, const char *zName, void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), void **ppArg ){ if( strcmp(zName,"snippet")==0 ){ *pxFunc = snippetFunc; return 1; }else if( strcmp(zName,"offsets")==0 ){ *pxFunc = snippetOffsetsFunc; return 1; }else if( strcmp(zName,"optimize")==0 ){ *pxFunc = optimizeFunc; return 1; #ifdef SQLITE_TEST /* NOTE(shess): These functions are present only for testing ** purposes. No particular effort is made to optimize their ** execution or how they build their results. */ }else if( strcmp(zName,"dump_terms")==0 ){ /* fprintf(stderr, "Found dump_terms\n"); */ *pxFunc = dumpTermsFunc; return 1; }else if( strcmp(zName,"dump_doclist")==0 ){ /* fprintf(stderr, "Found dump_doclist\n"); */ *pxFunc = dumpDoclistFunc; return 1; #endif } return 0; } /* ** Rename an fts2 table. */ static int fulltextRename( sqlite3_vtab *pVtab, const char *zName ){ fulltext_vtab *p = (fulltext_vtab *)pVtab; int rc = SQLITE_NOMEM; char *zSql = sqlite3_mprintf( "ALTER TABLE %Q.'%q_content' RENAME TO '%q_content';" "ALTER TABLE %Q.'%q_segments' RENAME TO '%q_segments';" "ALTER TABLE %Q.'%q_segdir' RENAME TO '%q_segdir';" , p->zDb, p->zName, zName , p->zDb, p->zName, zName , p->zDb, p->zName, zName ); if( zSql ){ rc = sqlite3_exec(p->db, zSql, 0, 0, 0); sqlite3_free(zSql); } return rc; } static const sqlite3_module fts2Module = { /* iVersion */ 0, /* xCreate */ fulltextCreate, /* xConnect */ fulltextConnect, /* xBestIndex */ fulltextBestIndex, /* xDisconnect */ fulltextDisconnect, /* xDestroy */ fulltextDestroy, /* xOpen */ fulltextOpen, /* xClose */ fulltextClose, /* xFilter */ fulltextFilter, /* xNext */ fulltextNext, /* xEof */ fulltextEof, /* xColumn */ fulltextColumn, /* xRowid */ fulltextRowid, /* xUpdate */ fulltextUpdate, /* xBegin */ fulltextBegin, /* xSync */ fulltextSync, /* xCommit */ fulltextCommit, /* xRollback */ fulltextRollback, /* xFindFunction */ fulltextFindFunction, /* xRename */ fulltextRename, }; static void hashDestroy(void *p){ fts2Hash *pHash = (fts2Hash *)p; sqlite3Fts2HashClear(pHash); sqlite3_free(pHash); } /* ** The fts2 built-in tokenizers - "simple" and "porter" - are implemented ** in files fts2_tokenizer1.c and fts2_porter.c respectively. The following ** two forward declarations are for functions declared in these files ** used to retrieve the respective implementations. ** ** Calling sqlite3Fts2SimpleTokenizerModule() sets the value pointed ** to by the argument to point a the "simple" tokenizer implementation. ** Function ...PorterTokenizerModule() sets *pModule to point to the ** porter tokenizer/stemmer implementation. */ void sqlite3Fts2SimpleTokenizerModule(sqlite3_tokenizer_module const**ppModule); void sqlite3Fts2PorterTokenizerModule(sqlite3_tokenizer_module const**ppModule); void sqlite3Fts2IcuTokenizerModule(sqlite3_tokenizer_module const**ppModule); int sqlite3Fts2InitHashTable(sqlite3 *, fts2Hash *, const char *); /* ** Initialize the fts2 extension. If this extension is built as part ** of the sqlite library, then this function is called directly by ** SQLite. If fts2 is built as a dynamically loadable extension, this ** function is called by the sqlite3_extension_init() entry point. */ int sqlite3Fts2Init(sqlite3 *db){ int rc = SQLITE_OK; fts2Hash *pHash = 0; const sqlite3_tokenizer_module *pSimple = 0; const sqlite3_tokenizer_module *pPorter = 0; const sqlite3_tokenizer_module *pIcu = 0; sqlite3Fts2SimpleTokenizerModule(&pSimple); sqlite3Fts2PorterTokenizerModule(&pPorter); #ifdef SQLITE_ENABLE_ICU sqlite3Fts2IcuTokenizerModule(&pIcu); #endif /* Allocate and initialize the hash-table used to store tokenizers. */ pHash = sqlite3_malloc(sizeof(fts2Hash)); if( !pHash ){ rc = SQLITE_NOMEM; }else{ sqlite3Fts2HashInit(pHash, FTS2_HASH_STRING, 1); } /* Load the built-in tokenizers into the hash table */ if( rc==SQLITE_OK ){ if( sqlite3Fts2HashInsert(pHash, "simple", 7, (void *)pSimple) || sqlite3Fts2HashInsert(pHash, "porter", 7, (void *)pPorter) || (pIcu && sqlite3Fts2HashInsert(pHash, "icu", 4, (void *)pIcu)) ){ rc = SQLITE_NOMEM; } } /* Create the virtual table wrapper around the hash-table and overload ** the two scalar functions. If this is successful, register the ** module with sqlite. */ if( SQLITE_OK==rc && SQLITE_OK==(rc = sqlite3Fts2InitHashTable(db, pHash, "fts2_tokenizer")) && SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1)) && SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", -1)) && SQLITE_OK==(rc = sqlite3_overload_function(db, "optimize", -1)) #ifdef SQLITE_TEST && SQLITE_OK==(rc = sqlite3_overload_function(db, "dump_terms", -1)) && SQLITE_OK==(rc = sqlite3_overload_function(db, "dump_doclist", -1)) #endif ){ return sqlite3_create_module_v2( db, "fts2", &fts2Module, (void *)pHash, hashDestroy ); } /* An error has occurred. Delete the hash table and return the error code. */ assert( rc!=SQLITE_OK ); if( pHash ){ sqlite3Fts2HashClear(pHash); sqlite3_free(pHash); } return rc; } #if !SQLITE_CORE #ifdef _WIN32 __declspec(dllexport) #endif int sqlite3_fts2_init( sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ SQLITE_EXTENSION_INIT2(pApi) return sqlite3Fts2Init(db); } #endif #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts2/fts2.h ================================================ /* ** 2006 Oct 10 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This header file is used by programs that want to link against the ** FTS2 library. All it does is declare the sqlite3Fts2Init() interface. */ #include "sqlite3.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ int sqlite3Fts2Init(sqlite3 *db); #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ ================================================ FILE: v2/testdata/_sqlite/ext/fts2/fts2_hash.c ================================================ /* ** 2001 September 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the implementation of generic hash-tables used in SQLite. ** We've modified it slightly to serve as a standalone hash table ** implementation for the full-text indexing module. */ /* ** The code in this file is only compiled if: ** ** * The FTS2 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS2 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS2 is defined). */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) #include #include #include #include "sqlite3.h" #include "sqlite3ext.h" SQLITE_EXTENSION_INIT3 #include "fts2_hash.h" /* ** Malloc and Free functions */ static void *fts2HashMalloc(int n){ void *p = sqlite3_malloc(n); if( p ){ memset(p, 0, n); } return p; } static void fts2HashFree(void *p){ sqlite3_free(p); } /* Turn bulk memory into a hash table object by initializing the ** fields of the Hash structure. ** ** "pNew" is a pointer to the hash table that is to be initialized. ** keyClass is one of the constants ** FTS2_HASH_BINARY or FTS2_HASH_STRING. The value of keyClass ** determines what kind of key the hash table will use. "copyKey" is ** true if the hash table should make its own private copy of keys and ** false if it should just use the supplied pointer. */ void sqlite3Fts2HashInit(fts2Hash *pNew, int keyClass, int copyKey){ assert( pNew!=0 ); assert( keyClass>=FTS2_HASH_STRING && keyClass<=FTS2_HASH_BINARY ); pNew->keyClass = keyClass; pNew->copyKey = copyKey; pNew->first = 0; pNew->count = 0; pNew->htsize = 0; pNew->ht = 0; } /* Remove all entries from a hash table. Reclaim all memory. ** Call this routine to delete a hash table or to reset a hash table ** to the empty state. */ void sqlite3Fts2HashClear(fts2Hash *pH){ fts2HashElem *elem; /* For looping over all elements of the table */ assert( pH!=0 ); elem = pH->first; pH->first = 0; fts2HashFree(pH->ht); pH->ht = 0; pH->htsize = 0; while( elem ){ fts2HashElem *next_elem = elem->next; if( pH->copyKey && elem->pKey ){ fts2HashFree(elem->pKey); } fts2HashFree(elem); elem = next_elem; } pH->count = 0; } /* ** Hash and comparison functions when the mode is FTS2_HASH_STRING */ static int strHash(const void *pKey, int nKey){ const char *z = (const char *)pKey; int h = 0; if( nKey<=0 ) nKey = (int) strlen(z); while( nKey > 0 ){ h = (h<<3) ^ h ^ *z++; nKey--; } return h & 0x7fffffff; } static int strCompare(const void *pKey1, int n1, const void *pKey2, int n2){ if( n1!=n2 ) return 1; return strncmp((const char*)pKey1,(const char*)pKey2,n1); } /* ** Hash and comparison functions when the mode is FTS2_HASH_BINARY */ static int binHash(const void *pKey, int nKey){ int h = 0; const char *z = (const char *)pKey; while( nKey-- > 0 ){ h = (h<<3) ^ h ^ *(z++); } return h & 0x7fffffff; } static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){ if( n1!=n2 ) return 1; return memcmp(pKey1,pKey2,n1); } /* ** Return a pointer to the appropriate hash function given the key class. ** ** The C syntax in this function definition may be unfamilar to some ** programmers, so we provide the following additional explanation: ** ** The name of the function is "hashFunction". The function takes a ** single parameter "keyClass". The return value of hashFunction() ** is a pointer to another function. Specifically, the return value ** of hashFunction() is a pointer to a function that takes two parameters ** with types "const void*" and "int" and returns an "int". */ static int (*hashFunction(int keyClass))(const void*,int){ if( keyClass==FTS2_HASH_STRING ){ return &strHash; }else{ assert( keyClass==FTS2_HASH_BINARY ); return &binHash; } } /* ** Return a pointer to the appropriate hash function given the key class. ** ** For help in interpreted the obscure C code in the function definition, ** see the header comment on the previous function. */ static int (*compareFunction(int keyClass))(const void*,int,const void*,int){ if( keyClass==FTS2_HASH_STRING ){ return &strCompare; }else{ assert( keyClass==FTS2_HASH_BINARY ); return &binCompare; } } /* Link an element into the hash table */ static void insertElement( fts2Hash *pH, /* The complete hash table */ struct _fts2ht *pEntry, /* The entry into which pNew is inserted */ fts2HashElem *pNew /* The element to be inserted */ ){ fts2HashElem *pHead; /* First element already in pEntry */ pHead = pEntry->chain; if( pHead ){ pNew->next = pHead; pNew->prev = pHead->prev; if( pHead->prev ){ pHead->prev->next = pNew; } else { pH->first = pNew; } pHead->prev = pNew; }else{ pNew->next = pH->first; if( pH->first ){ pH->first->prev = pNew; } pNew->prev = 0; pH->first = pNew; } pEntry->count++; pEntry->chain = pNew; } /* Resize the hash table so that it cantains "new_size" buckets. ** "new_size" must be a power of 2. The hash table might fail ** to resize if sqliteMalloc() fails. */ static void rehash(fts2Hash *pH, int new_size){ struct _fts2ht *new_ht; /* The new hash table */ fts2HashElem *elem, *next_elem; /* For looping over existing elements */ int (*xHash)(const void*,int); /* The hash function */ assert( (new_size & (new_size-1))==0 ); new_ht = (struct _fts2ht *)fts2HashMalloc( new_size*sizeof(struct _fts2ht) ); if( new_ht==0 ) return; fts2HashFree(pH->ht); pH->ht = new_ht; pH->htsize = new_size; xHash = hashFunction(pH->keyClass); for(elem=pH->first, pH->first=0; elem; elem = next_elem){ int h = (*xHash)(elem->pKey, elem->nKey) & (new_size-1); next_elem = elem->next; insertElement(pH, &new_ht[h], elem); } } /* This function (for internal use only) locates an element in an ** hash table that matches the given key. The hash for this key has ** already been computed and is passed as the 4th parameter. */ static fts2HashElem *findElementGivenHash( const fts2Hash *pH, /* The pH to be searched */ const void *pKey, /* The key we are searching for */ int nKey, int h /* The hash for this key. */ ){ fts2HashElem *elem; /* Used to loop thru the element list */ int count; /* Number of elements left to test */ int (*xCompare)(const void*,int,const void*,int); /* comparison function */ if( pH->ht ){ struct _fts2ht *pEntry = &pH->ht[h]; elem = pEntry->chain; count = pEntry->count; xCompare = compareFunction(pH->keyClass); while( count-- && elem ){ if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ return elem; } elem = elem->next; } } return 0; } /* Remove a single entry from the hash table given a pointer to that ** element and a hash on the element's key. */ static void removeElementGivenHash( fts2Hash *pH, /* The pH containing "elem" */ fts2HashElem* elem, /* The element to be removed from the pH */ int h /* Hash value for the element */ ){ struct _fts2ht *pEntry; if( elem->prev ){ elem->prev->next = elem->next; }else{ pH->first = elem->next; } if( elem->next ){ elem->next->prev = elem->prev; } pEntry = &pH->ht[h]; if( pEntry->chain==elem ){ pEntry->chain = elem->next; } pEntry->count--; if( pEntry->count<=0 ){ pEntry->chain = 0; } if( pH->copyKey && elem->pKey ){ fts2HashFree(elem->pKey); } fts2HashFree( elem ); pH->count--; if( pH->count<=0 ){ assert( pH->first==0 ); assert( pH->count==0 ); fts2HashClear(pH); } } /* Attempt to locate an element of the hash table pH with a key ** that matches pKey,nKey. Return the data for this element if it is ** found, or NULL if there is no match. */ void *sqlite3Fts2HashFind(const fts2Hash *pH, const void *pKey, int nKey){ int h; /* A hash on key */ fts2HashElem *elem; /* The element that matches key */ int (*xHash)(const void*,int); /* The hash function */ if( pH==0 || pH->ht==0 ) return 0; xHash = hashFunction(pH->keyClass); assert( xHash!=0 ); h = (*xHash)(pKey,nKey); assert( (pH->htsize & (pH->htsize-1))==0 ); elem = findElementGivenHash(pH,pKey,nKey, h & (pH->htsize-1)); return elem ? elem->data : 0; } /* Insert an element into the hash table pH. The key is pKey,nKey ** and the data is "data". ** ** If no element exists with a matching key, then a new ** element is created. A copy of the key is made if the copyKey ** flag is set. NULL is returned. ** ** If another element already exists with the same key, then the ** new data replaces the old data and the old data is returned. ** The key is not copied in this instance. If a malloc fails, then ** the new data is returned and the hash table is unchanged. ** ** If the "data" parameter to this function is NULL, then the ** element corresponding to "key" is removed from the hash table. */ void *sqlite3Fts2HashInsert( fts2Hash *pH, /* The hash table to insert into */ const void *pKey, /* The key */ int nKey, /* Number of bytes in the key */ void *data /* The data */ ){ int hraw; /* Raw hash value of the key */ int h; /* the hash of the key modulo hash table size */ fts2HashElem *elem; /* Used to loop thru the element list */ fts2HashElem *new_elem; /* New element added to the pH */ int (*xHash)(const void*,int); /* The hash function */ assert( pH!=0 ); xHash = hashFunction(pH->keyClass); assert( xHash!=0 ); hraw = (*xHash)(pKey, nKey); assert( (pH->htsize & (pH->htsize-1))==0 ); h = hraw & (pH->htsize-1); elem = findElementGivenHash(pH,pKey,nKey,h); if( elem ){ void *old_data = elem->data; if( data==0 ){ removeElementGivenHash(pH,elem,h); }else{ elem->data = data; } return old_data; } if( data==0 ) return 0; new_elem = (fts2HashElem*)fts2HashMalloc( sizeof(fts2HashElem) ); if( new_elem==0 ) return data; if( pH->copyKey && pKey!=0 ){ new_elem->pKey = fts2HashMalloc( nKey ); if( new_elem->pKey==0 ){ fts2HashFree(new_elem); return data; } memcpy((void*)new_elem->pKey, pKey, nKey); }else{ new_elem->pKey = (void*)pKey; } new_elem->nKey = nKey; pH->count++; if( pH->htsize==0 ){ rehash(pH,8); if( pH->htsize==0 ){ pH->count = 0; fts2HashFree(new_elem); return data; } } if( pH->count > pH->htsize ){ rehash(pH,pH->htsize*2); } assert( pH->htsize>0 ); assert( (pH->htsize & (pH->htsize-1))==0 ); h = hraw & (pH->htsize-1); insertElement(pH, &pH->ht[h], new_elem); new_elem->data = data; return 0; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts2/fts2_hash.h ================================================ /* ** 2001 September 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the header file for the generic hash-table implementation ** used in SQLite. We've modified it slightly to serve as a standalone ** hash table implementation for the full-text indexing module. ** */ #ifndef _FTS2_HASH_H_ #define _FTS2_HASH_H_ /* Forward declarations of structures. */ typedef struct fts2Hash fts2Hash; typedef struct fts2HashElem fts2HashElem; /* A complete hash table is an instance of the following structure. ** The internals of this structure are intended to be opaque -- client ** code should not attempt to access or modify the fields of this structure ** directly. Change this structure only by using the routines below. ** However, many of the "procedures" and "functions" for modifying and ** accessing this structure are really macros, so we can't really make ** this structure opaque. */ struct fts2Hash { char keyClass; /* HASH_INT, _POINTER, _STRING, _BINARY */ char copyKey; /* True if copy of key made on insert */ int count; /* Number of entries in this table */ fts2HashElem *first; /* The first element of the array */ int htsize; /* Number of buckets in the hash table */ struct _fts2ht { /* the hash table */ int count; /* Number of entries with this hash */ fts2HashElem *chain; /* Pointer to first entry with this hash */ } *ht; }; /* Each element in the hash table is an instance of the following ** structure. All elements are stored on a single doubly-linked list. ** ** Again, this structure is intended to be opaque, but it can't really ** be opaque because it is used by macros. */ struct fts2HashElem { fts2HashElem *next, *prev; /* Next and previous elements in the table */ void *data; /* Data associated with this element */ void *pKey; int nKey; /* Key associated with this element */ }; /* ** There are 2 different modes of operation for a hash table: ** ** FTS2_HASH_STRING pKey points to a string that is nKey bytes long ** (including the null-terminator, if any). Case ** is respected in comparisons. ** ** FTS2_HASH_BINARY pKey points to binary data nKey bytes long. ** memcmp() is used to compare keys. ** ** A copy of the key is made if the copyKey parameter to fts2HashInit is 1. */ #define FTS2_HASH_STRING 1 #define FTS2_HASH_BINARY 2 /* ** Access routines. To delete, insert a NULL pointer. */ void sqlite3Fts2HashInit(fts2Hash*, int keytype, int copyKey); void *sqlite3Fts2HashInsert(fts2Hash*, const void *pKey, int nKey, void *pData); void *sqlite3Fts2HashFind(const fts2Hash*, const void *pKey, int nKey); void sqlite3Fts2HashClear(fts2Hash*); /* ** Shorthand for the functions above */ #define fts2HashInit sqlite3Fts2HashInit #define fts2HashInsert sqlite3Fts2HashInsert #define fts2HashFind sqlite3Fts2HashFind #define fts2HashClear sqlite3Fts2HashClear /* ** Macros for looping over all elements of a hash table. The idiom is ** like this: ** ** fts2Hash h; ** fts2HashElem *p; ** ... ** for(p=fts2HashFirst(&h); p; p=fts2HashNext(p)){ ** SomeStructure *pData = fts2HashData(p); ** // do something with pData ** } */ #define fts2HashFirst(H) ((H)->first) #define fts2HashNext(E) ((E)->next) #define fts2HashData(E) ((E)->data) #define fts2HashKey(E) ((E)->pKey) #define fts2HashKeysize(E) ((E)->nKey) /* ** Number of entries in a hash table */ #define fts2HashCount(H) ((H)->count) #endif /* _FTS2_HASH_H_ */ ================================================ FILE: v2/testdata/_sqlite/ext/fts2/fts2_icu.c ================================================ /* ** 2007 June 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file implements a tokenizer for fts2 based on the ICU library. ** ** $Id: fts2_icu.c,v 1.3 2008/12/18 05:30:26 danielk1977 Exp $ */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) #ifdef SQLITE_ENABLE_ICU #include #include #include "fts2_tokenizer.h" #include #include #include #include typedef struct IcuTokenizer IcuTokenizer; typedef struct IcuCursor IcuCursor; struct IcuTokenizer { sqlite3_tokenizer base; char *zLocale; }; struct IcuCursor { sqlite3_tokenizer_cursor base; UBreakIterator *pIter; /* ICU break-iterator object */ int nChar; /* Number of UChar elements in pInput */ UChar *aChar; /* Copy of input using utf-16 encoding */ int *aOffset; /* Offsets of each character in utf-8 input */ int nBuffer; char *zBuffer; int iToken; }; /* ** Create a new tokenizer instance. */ static int icuCreate( int argc, /* Number of entries in argv[] */ const char * const *argv, /* Tokenizer creation arguments */ sqlite3_tokenizer **ppTokenizer /* OUT: Created tokenizer */ ){ IcuTokenizer *p; int n = 0; if( argc>0 ){ n = strlen(argv[0])+1; } p = (IcuTokenizer *)sqlite3_malloc(sizeof(IcuTokenizer)+n); if( !p ){ return SQLITE_NOMEM; } memset(p, 0, sizeof(IcuTokenizer)); if( n ){ p->zLocale = (char *)&p[1]; memcpy(p->zLocale, argv[0], n); } *ppTokenizer = (sqlite3_tokenizer *)p; return SQLITE_OK; } /* ** Destroy a tokenizer */ static int icuDestroy(sqlite3_tokenizer *pTokenizer){ IcuTokenizer *p = (IcuTokenizer *)pTokenizer; sqlite3_free(p); return SQLITE_OK; } /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is pInput[0..nBytes-1]. A cursor ** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int icuOpen( sqlite3_tokenizer *pTokenizer, /* The tokenizer */ const char *zInput, /* Input string */ int nInput, /* Length of zInput in bytes */ sqlite3_tokenizer_cursor **ppCursor /* OUT: Tokenization cursor */ ){ IcuTokenizer *p = (IcuTokenizer *)pTokenizer; IcuCursor *pCsr; const int32_t opt = U_FOLD_CASE_DEFAULT; UErrorCode status = U_ZERO_ERROR; int nChar; UChar32 c; int iInput = 0; int iOut = 0; *ppCursor = 0; if( nInput<0 ){ nInput = strlen(zInput); } nChar = nInput+1; pCsr = (IcuCursor *)sqlite3_malloc( sizeof(IcuCursor) + /* IcuCursor */ ((nChar+3)&~3) * sizeof(UChar) + /* IcuCursor.aChar[] */ (nChar+1) * sizeof(int) /* IcuCursor.aOffset[] */ ); if( !pCsr ){ return SQLITE_NOMEM; } memset(pCsr, 0, sizeof(IcuCursor)); pCsr->aChar = (UChar *)&pCsr[1]; pCsr->aOffset = (int *)&pCsr->aChar[(nChar+3)&~3]; pCsr->aOffset[iOut] = iInput; U8_NEXT(zInput, iInput, nInput, c); while( c>0 ){ int isError = 0; c = u_foldCase(c, opt); U16_APPEND(pCsr->aChar, iOut, nChar, c, isError); if( isError ){ sqlite3_free(pCsr); return SQLITE_ERROR; } pCsr->aOffset[iOut] = iInput; if( iInputpIter = ubrk_open(UBRK_WORD, p->zLocale, pCsr->aChar, iOut, &status); if( !U_SUCCESS(status) ){ sqlite3_free(pCsr); return SQLITE_ERROR; } pCsr->nChar = iOut; ubrk_first(pCsr->pIter); *ppCursor = (sqlite3_tokenizer_cursor *)pCsr; return SQLITE_OK; } /* ** Close a tokenization cursor previously opened by a call to icuOpen(). */ static int icuClose(sqlite3_tokenizer_cursor *pCursor){ IcuCursor *pCsr = (IcuCursor *)pCursor; ubrk_close(pCsr->pIter); sqlite3_free(pCsr->zBuffer); sqlite3_free(pCsr); return SQLITE_OK; } /* ** Extract the next token from a tokenization cursor. */ static int icuNext( sqlite3_tokenizer_cursor *pCursor, /* Cursor returned by simpleOpen */ const char **ppToken, /* OUT: *ppToken is the token text */ int *pnBytes, /* OUT: Number of bytes in token */ int *piStartOffset, /* OUT: Starting offset of token */ int *piEndOffset, /* OUT: Ending offset of token */ int *piPosition /* OUT: Position integer of token */ ){ IcuCursor *pCsr = (IcuCursor *)pCursor; int iStart = 0; int iEnd = 0; int nByte = 0; while( iStart==iEnd ){ UChar32 c; iStart = ubrk_current(pCsr->pIter); iEnd = ubrk_next(pCsr->pIter); if( iEnd==UBRK_DONE ){ return SQLITE_DONE; } while( iStartaChar, iWhite, pCsr->nChar, c); if( u_isspace(c) ){ iStart = iWhite; }else{ break; } } assert(iStart<=iEnd); } do { UErrorCode status = U_ZERO_ERROR; if( nByte ){ char *zNew = sqlite3_realloc(pCsr->zBuffer, nByte); if( !zNew ){ return SQLITE_NOMEM; } pCsr->zBuffer = zNew; pCsr->nBuffer = nByte; } u_strToUTF8( pCsr->zBuffer, pCsr->nBuffer, &nByte, /* Output vars */ &pCsr->aChar[iStart], iEnd-iStart, /* Input vars */ &status /* Output success/failure */ ); } while( nByte>pCsr->nBuffer ); *ppToken = pCsr->zBuffer; *pnBytes = nByte; *piStartOffset = pCsr->aOffset[iStart]; *piEndOffset = pCsr->aOffset[iEnd]; *piPosition = pCsr->iToken++; return SQLITE_OK; } /* ** The set of routines that implement the simple tokenizer */ static const sqlite3_tokenizer_module icuTokenizerModule = { 0, /* iVersion */ icuCreate, /* xCreate */ icuDestroy, /* xCreate */ icuOpen, /* xOpen */ icuClose, /* xClose */ icuNext, /* xNext */ }; /* ** Set *ppModule to point at the implementation of the ICU tokenizer. */ void sqlite3Fts2IcuTokenizerModule( sqlite3_tokenizer_module const**ppModule ){ *ppModule = &icuTokenizerModule; } #endif /* defined(SQLITE_ENABLE_ICU) */ #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts2/fts2_porter.c ================================================ /* ** 2006 September 30 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Implementation of the full-text-search tokenizer that implements ** a Porter stemmer. */ /* ** The code in this file is only compiled if: ** ** * The FTS2 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS2 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS2 is defined). */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) #include #include #include #include #include "sqlite3.h" #include "sqlite3ext.h" SQLITE_EXTENSION_INIT3 #include "fts2_tokenizer.h" /* ** Class derived from sqlite3_tokenizer */ typedef struct porter_tokenizer { sqlite3_tokenizer base; /* Base class */ } porter_tokenizer; /* ** Class derived from sqlit3_tokenizer_cursor */ typedef struct porter_tokenizer_cursor { sqlite3_tokenizer_cursor base; const char *zInput; /* input we are tokenizing */ int nInput; /* size of the input */ int iOffset; /* current position in zInput */ int iToken; /* index of next token to be returned */ char *zToken; /* storage for current token */ int nAllocated; /* space allocated to zToken buffer */ } porter_tokenizer_cursor; /* Forward declaration */ static const sqlite3_tokenizer_module porterTokenizerModule; /* ** Create a new tokenizer instance. */ static int porterCreate( int argc, const char * const *argv, sqlite3_tokenizer **ppTokenizer ){ porter_tokenizer *t; t = (porter_tokenizer *) sqlite3_malloc(sizeof(*t)); if( t==NULL ) return SQLITE_NOMEM; memset(t, 0, sizeof(*t)); *ppTokenizer = &t->base; return SQLITE_OK; } /* ** Destroy a tokenizer */ static int porterDestroy(sqlite3_tokenizer *pTokenizer){ sqlite3_free(pTokenizer); return SQLITE_OK; } /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is zInput[0..nInput-1]. A cursor ** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int porterOpen( sqlite3_tokenizer *pTokenizer, /* The tokenizer */ const char *zInput, int nInput, /* String to be tokenized */ sqlite3_tokenizer_cursor **ppCursor /* OUT: Tokenization cursor */ ){ porter_tokenizer_cursor *c; c = (porter_tokenizer_cursor *) sqlite3_malloc(sizeof(*c)); if( c==NULL ) return SQLITE_NOMEM; c->zInput = zInput; if( zInput==0 ){ c->nInput = 0; }else if( nInput<0 ){ c->nInput = (int)strlen(zInput); }else{ c->nInput = nInput; } c->iOffset = 0; /* start tokenizing at the beginning */ c->iToken = 0; c->zToken = NULL; /* no space allocated, yet. */ c->nAllocated = 0; *ppCursor = &c->base; return SQLITE_OK; } /* ** Close a tokenization cursor previously opened by a call to ** porterOpen() above. */ static int porterClose(sqlite3_tokenizer_cursor *pCursor){ porter_tokenizer_cursor *c = (porter_tokenizer_cursor *) pCursor; sqlite3_free(c->zToken); sqlite3_free(c); return SQLITE_OK; } /* ** Vowel or consonant */ static const char cType[] = { 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1 }; /* ** isConsonant() and isVowel() determine if their first character in ** the string they point to is a consonant or a vowel, according ** to Porter ruls. ** ** A consonate is any letter other than 'a', 'e', 'i', 'o', or 'u'. ** 'Y' is a consonant unless it follows another consonant, ** in which case it is a vowel. ** ** In these routine, the letters are in reverse order. So the 'y' rule ** is that 'y' is a consonant unless it is followed by another ** consonent. */ static int isVowel(const char*); static int isConsonant(const char *z){ int j; char x = *z; if( x==0 ) return 0; assert( x>='a' && x<='z' ); j = cType[x-'a']; if( j<2 ) return j; return z[1]==0 || isVowel(z + 1); } static int isVowel(const char *z){ int j; char x = *z; if( x==0 ) return 0; assert( x>='a' && x<='z' ); j = cType[x-'a']; if( j<2 ) return 1-j; return isConsonant(z + 1); } /* ** Let any sequence of one or more vowels be represented by V and let ** C be sequence of one or more consonants. Then every word can be ** represented as: ** ** [C] (VC){m} [V] ** ** In prose: A word is an optional consonant followed by zero or ** vowel-consonant pairs followed by an optional vowel. "m" is the ** number of vowel consonant pairs. This routine computes the value ** of m for the first i bytes of a word. ** ** Return true if the m-value for z is 1 or more. In other words, ** return true if z contains at least one vowel that is followed ** by a consonant. ** ** In this routine z[] is in reverse order. So we are really looking ** for an instance of of a consonant followed by a vowel. */ static int m_gt_0(const char *z){ while( isVowel(z) ){ z++; } if( *z==0 ) return 0; while( isConsonant(z) ){ z++; } return *z!=0; } /* Like mgt0 above except we are looking for a value of m which is ** exactly 1 */ static int m_eq_1(const char *z){ while( isVowel(z) ){ z++; } if( *z==0 ) return 0; while( isConsonant(z) ){ z++; } if( *z==0 ) return 0; while( isVowel(z) ){ z++; } if( *z==0 ) return 1; while( isConsonant(z) ){ z++; } return *z==0; } /* Like mgt0 above except we are looking for a value of m>1 instead ** or m>0 */ static int m_gt_1(const char *z){ while( isVowel(z) ){ z++; } if( *z==0 ) return 0; while( isConsonant(z) ){ z++; } if( *z==0 ) return 0; while( isVowel(z) ){ z++; } if( *z==0 ) return 0; while( isConsonant(z) ){ z++; } return *z!=0; } /* ** Return TRUE if there is a vowel anywhere within z[0..n-1] */ static int hasVowel(const char *z){ while( isConsonant(z) ){ z++; } return *z!=0; } /* ** Return TRUE if the word ends in a double consonant. ** ** The text is reversed here. So we are really looking at ** the first two characters of z[]. */ static int doubleConsonant(const char *z){ return isConsonant(z) && z[0]==z[1] && isConsonant(z+1); } /* ** Return TRUE if the word ends with three letters which ** are consonant-vowel-consonent and where the final consonant ** is not 'w', 'x', or 'y'. ** ** The word is reversed here. So we are really checking the ** first three letters and the first one cannot be in [wxy]. */ static int star_oh(const char *z){ return z[0]!=0 && isConsonant(z) && z[0]!='w' && z[0]!='x' && z[0]!='y' && z[1]!=0 && isVowel(z+1) && z[2]!=0 && isConsonant(z+2); } /* ** If the word ends with zFrom and xCond() is true for the stem ** of the word that preceeds the zFrom ending, then change the ** ending to zTo. ** ** The input word *pz and zFrom are both in reverse order. zTo ** is in normal order. ** ** Return TRUE if zFrom matches. Return FALSE if zFrom does not ** match. Not that TRUE is returned even if xCond() fails and ** no substitution occurs. */ static int stem( char **pz, /* The word being stemmed (Reversed) */ const char *zFrom, /* If the ending matches this... (Reversed) */ const char *zTo, /* ... change the ending to this (not reversed) */ int (*xCond)(const char*) /* Condition that must be true */ ){ char *z = *pz; while( *zFrom && *zFrom==*z ){ z++; zFrom++; } if( *zFrom!=0 ) return 0; if( xCond && !xCond(z) ) return 1; while( *zTo ){ *(--z) = *(zTo++); } *pz = z; return 1; } /* ** This is the fallback stemmer used when the porter stemmer is ** inappropriate. The input word is copied into the output with ** US-ASCII case folding. If the input word is too long (more ** than 20 bytes if it contains no digits or more than 6 bytes if ** it contains digits) then word is truncated to 20 or 6 bytes ** by taking 10 or 3 bytes from the beginning and end. */ static void copy_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ int i, mx, j; int hasDigit = 0; for(i=0; i='A' && c<='Z' ){ zOut[i] = c - 'A' + 'a'; }else{ if( c>='0' && c<='9' ) hasDigit = 1; zOut[i] = c; } } mx = hasDigit ? 3 : 10; if( nIn>mx*2 ){ for(j=mx, i=nIn-mx; i=sizeof(zReverse)-7 ){ /* The word is too big or too small for the porter stemmer. ** Fallback to the copy stemmer */ copy_stemmer(zIn, nIn, zOut, pnOut); return; } for(i=0, j=sizeof(zReverse)-6; i='A' && c<='Z' ){ zReverse[j] = c + 'a' - 'A'; }else if( c>='a' && c<='z' ){ zReverse[j] = c; }else{ /* The use of a character not in [a-zA-Z] means that we fallback ** to the copy stemmer */ copy_stemmer(zIn, nIn, zOut, pnOut); return; } } memset(&zReverse[sizeof(zReverse)-5], 0, 5); z = &zReverse[j+1]; /* Step 1a */ if( z[0]=='s' ){ if( !stem(&z, "sess", "ss", 0) && !stem(&z, "sei", "i", 0) && !stem(&z, "ss", "ss", 0) ){ z++; } } /* Step 1b */ z2 = z; if( stem(&z, "dee", "ee", m_gt_0) ){ /* Do nothing. The work was all in the test */ }else if( (stem(&z, "gni", "", hasVowel) || stem(&z, "de", "", hasVowel)) && z!=z2 ){ if( stem(&z, "ta", "ate", 0) || stem(&z, "lb", "ble", 0) || stem(&z, "zi", "ize", 0) ){ /* Do nothing. The work was all in the test */ }else if( doubleConsonant(z) && (*z!='l' && *z!='s' && *z!='z') ){ z++; }else if( m_eq_1(z) && star_oh(z) ){ *(--z) = 'e'; } } /* Step 1c */ if( z[0]=='y' && hasVowel(z+1) ){ z[0] = 'i'; } /* Step 2 */ switch( z[1] ){ case 'a': stem(&z, "lanoita", "ate", m_gt_0) || stem(&z, "lanoit", "tion", m_gt_0); break; case 'c': stem(&z, "icne", "ence", m_gt_0) || stem(&z, "icna", "ance", m_gt_0); break; case 'e': stem(&z, "rezi", "ize", m_gt_0); break; case 'g': stem(&z, "igol", "log", m_gt_0); break; case 'l': stem(&z, "ilb", "ble", m_gt_0) || stem(&z, "illa", "al", m_gt_0) || stem(&z, "iltne", "ent", m_gt_0) || stem(&z, "ile", "e", m_gt_0) || stem(&z, "ilsuo", "ous", m_gt_0); break; case 'o': stem(&z, "noitazi", "ize", m_gt_0) || stem(&z, "noita", "ate", m_gt_0) || stem(&z, "rota", "ate", m_gt_0); break; case 's': stem(&z, "msila", "al", m_gt_0) || stem(&z, "ssenevi", "ive", m_gt_0) || stem(&z, "ssenluf", "ful", m_gt_0) || stem(&z, "ssensuo", "ous", m_gt_0); break; case 't': stem(&z, "itila", "al", m_gt_0) || stem(&z, "itivi", "ive", m_gt_0) || stem(&z, "itilib", "ble", m_gt_0); break; } /* Step 3 */ switch( z[0] ){ case 'e': stem(&z, "etaci", "ic", m_gt_0) || stem(&z, "evita", "", m_gt_0) || stem(&z, "ezila", "al", m_gt_0); break; case 'i': stem(&z, "itici", "ic", m_gt_0); break; case 'l': stem(&z, "laci", "ic", m_gt_0) || stem(&z, "luf", "", m_gt_0); break; case 's': stem(&z, "ssen", "", m_gt_0); break; } /* Step 4 */ switch( z[1] ){ case 'a': if( z[0]=='l' && m_gt_1(z+2) ){ z += 2; } break; case 'c': if( z[0]=='e' && z[2]=='n' && (z[3]=='a' || z[3]=='e') && m_gt_1(z+4) ){ z += 4; } break; case 'e': if( z[0]=='r' && m_gt_1(z+2) ){ z += 2; } break; case 'i': if( z[0]=='c' && m_gt_1(z+2) ){ z += 2; } break; case 'l': if( z[0]=='e' && z[2]=='b' && (z[3]=='a' || z[3]=='i') && m_gt_1(z+4) ){ z += 4; } break; case 'n': if( z[0]=='t' ){ if( z[2]=='a' ){ if( m_gt_1(z+3) ){ z += 3; } }else if( z[2]=='e' ){ stem(&z, "tneme", "", m_gt_1) || stem(&z, "tnem", "", m_gt_1) || stem(&z, "tne", "", m_gt_1); } } break; case 'o': if( z[0]=='u' ){ if( m_gt_1(z+2) ){ z += 2; } }else if( z[3]=='s' || z[3]=='t' ){ stem(&z, "noi", "", m_gt_1); } break; case 's': if( z[0]=='m' && z[2]=='i' && m_gt_1(z+3) ){ z += 3; } break; case 't': stem(&z, "eta", "", m_gt_1) || stem(&z, "iti", "", m_gt_1); break; case 'u': if( z[0]=='s' && z[2]=='o' && m_gt_1(z+3) ){ z += 3; } break; case 'v': case 'z': if( z[0]=='e' && z[2]=='i' && m_gt_1(z+3) ){ z += 3; } break; } /* Step 5a */ if( z[0]=='e' ){ if( m_gt_1(z+1) ){ z++; }else if( m_eq_1(z+1) && !star_oh(z+1) ){ z++; } } /* Step 5b */ if( m_gt_1(z) && z[0]=='l' && z[1]=='l' ){ z++; } /* z[] is now the stemmed word in reverse order. Flip it back ** around into forward order and return. */ *pnOut = i = strlen(z); zOut[i] = 0; while( *z ){ zOut[--i] = *(z++); } } /* ** Characters that can be part of a token. We assume any character ** whose value is greater than 0x80 (any UTF character) can be ** part of a token. In other words, delimiters all must have ** values of 0x7f or lower. */ static const char porterIdChar[] = { /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 3x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 7x */ }; #define isDelim(C) (((ch=C)&0x80)==0 && (ch<0x30 || !porterIdChar[ch-0x30])) /* ** Extract the next token from a tokenization cursor. The cursor must ** have been opened by a prior call to porterOpen(). */ static int porterNext( sqlite3_tokenizer_cursor *pCursor, /* Cursor returned by porterOpen */ const char **pzToken, /* OUT: *pzToken is the token text */ int *pnBytes, /* OUT: Number of bytes in token */ int *piStartOffset, /* OUT: Starting offset of token */ int *piEndOffset, /* OUT: Ending offset of token */ int *piPosition /* OUT: Position integer of token */ ){ porter_tokenizer_cursor *c = (porter_tokenizer_cursor *) pCursor; const char *z = c->zInput; while( c->iOffsetnInput ){ int iStartOffset, ch; /* Scan past delimiter characters */ while( c->iOffsetnInput && isDelim(z[c->iOffset]) ){ c->iOffset++; } /* Count non-delimiter characters. */ iStartOffset = c->iOffset; while( c->iOffsetnInput && !isDelim(z[c->iOffset]) ){ c->iOffset++; } if( c->iOffset>iStartOffset ){ int n = c->iOffset-iStartOffset; if( n>c->nAllocated ){ c->nAllocated = n+20; c->zToken = sqlite3_realloc(c->zToken, c->nAllocated); if( c->zToken==NULL ) return SQLITE_NOMEM; } porter_stemmer(&z[iStartOffset], n, c->zToken, pnBytes); *pzToken = c->zToken; *piStartOffset = iStartOffset; *piEndOffset = c->iOffset; *piPosition = c->iToken++; return SQLITE_OK; } } return SQLITE_DONE; } /* ** The set of routines that implement the porter-stemmer tokenizer */ static const sqlite3_tokenizer_module porterTokenizerModule = { 0, porterCreate, porterDestroy, porterOpen, porterClose, porterNext, }; /* ** Allocate a new porter tokenizer. Return a pointer to the new ** tokenizer in *ppModule */ void sqlite3Fts2PorterTokenizerModule( sqlite3_tokenizer_module const**ppModule ){ *ppModule = &porterTokenizerModule; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts2/fts2_tokenizer.c ================================================ /* ** 2007 June 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This is part of an SQLite module implementing full-text search. ** This particular file implements the generic tokenizer interface. */ /* ** The code in this file is only compiled if: ** ** * The FTS2 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS2 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS2 is defined). */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) #include "sqlite3.h" #include "sqlite3ext.h" SQLITE_EXTENSION_INIT3 #include "fts2_hash.h" #include "fts2_tokenizer.h" #include /* ** Implementation of the SQL scalar function for accessing the underlying ** hash table. This function may be called as follows: ** ** SELECT (); ** SELECT (, ); ** ** where is the name passed as the second argument ** to the sqlite3Fts2InitHashTable() function (e.g. 'fts2_tokenizer'). ** ** If the argument is specified, it must be a blob value ** containing a pointer to be stored as the hash data corresponding ** to the string . If is not specified, then ** the string must already exist in the has table. Otherwise, ** an error is returned. ** ** Whether or not the argument is specified, the value returned ** is a blob containing the pointer stored as the hash data corresponding ** to string (after the hash-table is updated, if applicable). */ static void scalarFunc( sqlite3_context *context, int argc, sqlite3_value **argv ){ fts2Hash *pHash; void *pPtr = 0; const unsigned char *zName; int nName; assert( argc==1 || argc==2 ); pHash = (fts2Hash *)sqlite3_user_data(context); zName = sqlite3_value_text(argv[0]); nName = sqlite3_value_bytes(argv[0])+1; if( argc==2 ){ void *pOld; int n = sqlite3_value_bytes(argv[1]); if( n!=sizeof(pPtr) ){ sqlite3_result_error(context, "argument type mismatch", -1); return; } pPtr = *(void **)sqlite3_value_blob(argv[1]); pOld = sqlite3Fts2HashInsert(pHash, (void *)zName, nName, pPtr); if( pOld==pPtr ){ sqlite3_result_error(context, "out of memory", -1); return; } }else{ pPtr = sqlite3Fts2HashFind(pHash, zName, nName); if( !pPtr ){ char *zErr = sqlite3_mprintf("unknown tokenizer: %s", zName); sqlite3_result_error(context, zErr, -1); sqlite3_free(zErr); return; } } sqlite3_result_blob(context, (void *)&pPtr, sizeof(pPtr), SQLITE_TRANSIENT); } #ifdef SQLITE_TEST #if defined(INCLUDE_SQLITE_TCL_H) # include "sqlite_tcl.h" #else # include "tcl.h" #endif #include /* ** Implementation of a special SQL scalar function for testing tokenizers ** designed to be used in concert with the Tcl testing framework. This ** function must be called with two arguments: ** ** SELECT (, ); ** SELECT (, ); ** ** where is the name passed as the second argument ** to the sqlite3Fts2InitHashTable() function (e.g. 'fts2_tokenizer') ** concatenated with the string '_test' (e.g. 'fts2_tokenizer_test'). ** ** The return value is a string that may be interpreted as a Tcl ** list. For each token in the , three elements are ** added to the returned list. The first is the token position, the ** second is the token text (folded, stemmed, etc.) and the third is the ** substring of associated with the token. For example, ** using the built-in "simple" tokenizer: ** ** SELECT fts_tokenizer_test('simple', 'I don't see how'); ** ** will return the string: ** ** "{0 i I 1 dont don't 2 see see 3 how how}" ** */ static void testFunc( sqlite3_context *context, int argc, sqlite3_value **argv ){ fts2Hash *pHash; sqlite3_tokenizer_module *p; sqlite3_tokenizer *pTokenizer = 0; sqlite3_tokenizer_cursor *pCsr = 0; const char *zErr = 0; const char *zName; int nName; const char *zInput; int nInput; const char *zArg = 0; const char *zToken; int nToken; int iStart; int iEnd; int iPos; Tcl_Obj *pRet; assert( argc==2 || argc==3 ); nName = sqlite3_value_bytes(argv[0]); zName = (const char *)sqlite3_value_text(argv[0]); nInput = sqlite3_value_bytes(argv[argc-1]); zInput = (const char *)sqlite3_value_text(argv[argc-1]); if( argc==3 ){ zArg = (const char *)sqlite3_value_text(argv[1]); } pHash = (fts2Hash *)sqlite3_user_data(context); p = (sqlite3_tokenizer_module *)sqlite3Fts2HashFind(pHash, zName, nName+1); if( !p ){ char *zErr = sqlite3_mprintf("unknown tokenizer: %s", zName); sqlite3_result_error(context, zErr, -1); sqlite3_free(zErr); return; } pRet = Tcl_NewObj(); Tcl_IncrRefCount(pRet); if( SQLITE_OK!=p->xCreate(zArg ? 1 : 0, &zArg, &pTokenizer) ){ zErr = "error in xCreate()"; goto finish; } pTokenizer->pModule = p; if( SQLITE_OK!=p->xOpen(pTokenizer, zInput, nInput, &pCsr) ){ zErr = "error in xOpen()"; goto finish; } pCsr->pTokenizer = pTokenizer; while( SQLITE_OK==p->xNext(pCsr, &zToken, &nToken, &iStart, &iEnd, &iPos) ){ Tcl_ListObjAppendElement(0, pRet, Tcl_NewIntObj(iPos)); Tcl_ListObjAppendElement(0, pRet, Tcl_NewStringObj(zToken, nToken)); zToken = &zInput[iStart]; nToken = iEnd-iStart; Tcl_ListObjAppendElement(0, pRet, Tcl_NewStringObj(zToken, nToken)); } if( SQLITE_OK!=p->xClose(pCsr) ){ zErr = "error in xClose()"; goto finish; } if( SQLITE_OK!=p->xDestroy(pTokenizer) ){ zErr = "error in xDestroy()"; goto finish; } finish: if( zErr ){ sqlite3_result_error(context, zErr, -1); }else{ sqlite3_result_text(context, Tcl_GetString(pRet), -1, SQLITE_TRANSIENT); } Tcl_DecrRefCount(pRet); } static int registerTokenizer( sqlite3 *db, char *zName, const sqlite3_tokenizer_module *p ){ int rc; sqlite3_stmt *pStmt; const char zSql[] = "SELECT fts2_tokenizer(?, ?)"; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ return rc; } sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); sqlite3_bind_blob(pStmt, 2, &p, sizeof(p), SQLITE_STATIC); sqlite3_step(pStmt); return sqlite3_finalize(pStmt); } static int queryFts2Tokenizer( sqlite3 *db, char *zName, const sqlite3_tokenizer_module **pp ){ int rc; sqlite3_stmt *pStmt; const char zSql[] = "SELECT fts2_tokenizer(?)"; *pp = 0; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ return rc; } sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); if( SQLITE_ROW==sqlite3_step(pStmt) ){ if( sqlite3_column_type(pStmt, 0)==SQLITE_BLOB ){ memcpy(pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp)); } } return sqlite3_finalize(pStmt); } void sqlite3Fts2SimpleTokenizerModule(sqlite3_tokenizer_module const**ppModule); /* ** Implementation of the scalar function fts2_tokenizer_internal_test(). ** This function is used for testing only, it is not included in the ** build unless SQLITE_TEST is defined. ** ** The purpose of this is to test that the fts2_tokenizer() function ** can be used as designed by the C-code in the queryFts2Tokenizer and ** registerTokenizer() functions above. These two functions are repeated ** in the README.tokenizer file as an example, so it is important to ** test them. ** ** To run the tests, evaluate the fts2_tokenizer_internal_test() scalar ** function with no arguments. An assert() will fail if a problem is ** detected. i.e.: ** ** SELECT fts2_tokenizer_internal_test(); ** */ static void intTestFunc( sqlite3_context *context, int argc, sqlite3_value **argv ){ int rc; const sqlite3_tokenizer_module *p1; const sqlite3_tokenizer_module *p2; sqlite3 *db = (sqlite3 *)sqlite3_user_data(context); /* Test the query function */ sqlite3Fts2SimpleTokenizerModule(&p1); rc = queryFts2Tokenizer(db, "simple", &p2); assert( rc==SQLITE_OK ); assert( p1==p2 ); rc = queryFts2Tokenizer(db, "nosuchtokenizer", &p2); assert( rc==SQLITE_ERROR ); assert( p2==0 ); assert( 0==strcmp(sqlite3_errmsg(db), "unknown tokenizer: nosuchtokenizer") ); /* Test the storage function */ rc = registerTokenizer(db, "nosuchtokenizer", p1); assert( rc==SQLITE_OK ); rc = queryFts2Tokenizer(db, "nosuchtokenizer", &p2); assert( rc==SQLITE_OK ); assert( p2==p1 ); sqlite3_result_text(context, "ok", -1, SQLITE_STATIC); } #endif /* ** Set up SQL objects in database db used to access the contents of ** the hash table pointed to by argument pHash. The hash table must ** been initialized to use string keys, and to take a private copy ** of the key when a value is inserted. i.e. by a call similar to: ** ** sqlite3Fts2HashInit(pHash, FTS2_HASH_STRING, 1); ** ** This function adds a scalar function (see header comment above ** scalarFunc() in this file for details) and, if ENABLE_TABLE is ** defined at compilation time, a temporary virtual table (see header ** comment above struct HashTableVtab) to the database schema. Both ** provide read/write access to the contents of *pHash. ** ** The third argument to this function, zName, is used as the name ** of both the scalar and, if created, the virtual table. */ int sqlite3Fts2InitHashTable( sqlite3 *db, fts2Hash *pHash, const char *zName ){ int rc = SQLITE_OK; void *p = (void *)pHash; const int any = SQLITE_ANY; char *zTest = 0; char *zTest2 = 0; #ifdef SQLITE_TEST void *pdb = (void *)db; zTest = sqlite3_mprintf("%s_test", zName); zTest2 = sqlite3_mprintf("%s_internal_test", zName); if( !zTest || !zTest2 ){ rc = SQLITE_NOMEM; } #endif if( rc!=SQLITE_OK || (rc = sqlite3_create_function(db, zName, 1, any, p, scalarFunc, 0, 0)) || (rc = sqlite3_create_function(db, zName, 2, any, p, scalarFunc, 0, 0)) #ifdef SQLITE_TEST || (rc = sqlite3_create_function(db, zTest, 2, any, p, testFunc, 0, 0)) || (rc = sqlite3_create_function(db, zTest, 3, any, p, testFunc, 0, 0)) || (rc = sqlite3_create_function(db, zTest2, 0, any, pdb, intTestFunc, 0, 0)) #endif ); sqlite3_free(zTest); sqlite3_free(zTest2); return rc; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts2/fts2_tokenizer.h ================================================ /* ** 2006 July 10 ** ** The author disclaims copyright to this source code. ** ************************************************************************* ** Defines the interface to tokenizers used by fulltext-search. There ** are three basic components: ** ** sqlite3_tokenizer_module is a singleton defining the tokenizer ** interface functions. This is essentially the class structure for ** tokenizers. ** ** sqlite3_tokenizer is used to define a particular tokenizer, perhaps ** including customization information defined at creation time. ** ** sqlite3_tokenizer_cursor is generated by a tokenizer to generate ** tokens from a particular input. */ #ifndef _FTS2_TOKENIZER_H_ #define _FTS2_TOKENIZER_H_ /* TODO(shess) Only used for SQLITE_OK and SQLITE_DONE at this time. ** If tokenizers are to be allowed to call sqlite3_*() functions, then ** we will need a way to register the API consistently. */ #include "sqlite3.h" /* ** Structures used by the tokenizer interface. When a new tokenizer ** implementation is registered, the caller provides a pointer to ** an sqlite3_tokenizer_module containing pointers to the callback ** functions that make up an implementation. ** ** When an fts2 table is created, it passes any arguments passed to ** the tokenizer clause of the CREATE VIRTUAL TABLE statement to the ** sqlite3_tokenizer_module.xCreate() function of the requested tokenizer ** implementation. The xCreate() function in turn returns an ** sqlite3_tokenizer structure representing the specific tokenizer to ** be used for the fts2 table (customized by the tokenizer clause arguments). ** ** To tokenize an input buffer, the sqlite3_tokenizer_module.xOpen() ** method is called. It returns an sqlite3_tokenizer_cursor object ** that may be used to tokenize a specific input buffer based on ** the tokenization rules supplied by a specific sqlite3_tokenizer ** object. */ typedef struct sqlite3_tokenizer_module sqlite3_tokenizer_module; typedef struct sqlite3_tokenizer sqlite3_tokenizer; typedef struct sqlite3_tokenizer_cursor sqlite3_tokenizer_cursor; struct sqlite3_tokenizer_module { /* ** Structure version. Should always be set to 0. */ int iVersion; /* ** Create a new tokenizer. The values in the argv[] array are the ** arguments passed to the "tokenizer" clause of the CREATE VIRTUAL ** TABLE statement that created the fts2 table. For example, if ** the following SQL is executed: ** ** CREATE .. USING fts2( ... , tokenizer arg1 arg2) ** ** then argc is set to 2, and the argv[] array contains pointers ** to the strings "arg1" and "arg2". ** ** This method should return either SQLITE_OK (0), or an SQLite error ** code. If SQLITE_OK is returned, then *ppTokenizer should be set ** to point at the newly created tokenizer structure. The generic ** sqlite3_tokenizer.pModule variable should not be initialized by ** this callback. The caller will do so. */ int (*xCreate)( int argc, /* Size of argv array */ const char *const*argv, /* Tokenizer argument strings */ sqlite3_tokenizer **ppTokenizer /* OUT: Created tokenizer */ ); /* ** Destroy an existing tokenizer. The fts2 module calls this method ** exactly once for each successful call to xCreate(). */ int (*xDestroy)(sqlite3_tokenizer *pTokenizer); /* ** Create a tokenizer cursor to tokenize an input buffer. The caller ** is responsible for ensuring that the input buffer remains valid ** until the cursor is closed (using the xClose() method). */ int (*xOpen)( sqlite3_tokenizer *pTokenizer, /* Tokenizer object */ const char *pInput, int nBytes, /* Input buffer */ sqlite3_tokenizer_cursor **ppCursor /* OUT: Created tokenizer cursor */ ); /* ** Destroy an existing tokenizer cursor. The fts2 module calls this ** method exactly once for each successful call to xOpen(). */ int (*xClose)(sqlite3_tokenizer_cursor *pCursor); /* ** Retrieve the next token from the tokenizer cursor pCursor. This ** method should either return SQLITE_OK and set the values of the ** "OUT" variables identified below, or SQLITE_DONE to indicate that ** the end of the buffer has been reached, or an SQLite error code. ** ** *ppToken should be set to point at a buffer containing the ** normalized version of the token (i.e. after any case-folding and/or ** stemming has been performed). *pnBytes should be set to the length ** of this buffer in bytes. The input text that generated the token is ** identified by the byte offsets returned in *piStartOffset and ** *piEndOffset. ** ** The buffer *ppToken is set to point at is managed by the tokenizer ** implementation. It is only required to be valid until the next call ** to xNext() or xClose(). */ /* TODO(shess) current implementation requires pInput to be ** nul-terminated. This should either be fixed, or pInput/nBytes ** should be converted to zInput. */ int (*xNext)( sqlite3_tokenizer_cursor *pCursor, /* Tokenizer cursor */ const char **ppToken, int *pnBytes, /* OUT: Normalized text for token */ int *piStartOffset, /* OUT: Byte offset of token in input buffer */ int *piEndOffset, /* OUT: Byte offset of end of token in input buffer */ int *piPosition /* OUT: Number of tokens returned before this one */ ); }; struct sqlite3_tokenizer { const sqlite3_tokenizer_module *pModule; /* The module for this tokenizer */ /* Tokenizer implementations will typically add additional fields */ }; struct sqlite3_tokenizer_cursor { sqlite3_tokenizer *pTokenizer; /* Tokenizer for this cursor. */ /* Tokenizer implementations will typically add additional fields */ }; #endif /* _FTS2_TOKENIZER_H_ */ ================================================ FILE: v2/testdata/_sqlite/ext/fts2/fts2_tokenizer1.c ================================================ /* ** 2006 Oct 10 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** Implementation of the "simple" full-text-search tokenizer. */ /* ** The code in this file is only compiled if: ** ** * The FTS2 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS2 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS2 is defined). */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) #include #include #include #include #include "sqlite3.h" #include "sqlite3ext.h" SQLITE_EXTENSION_INIT3 #include "fts2_tokenizer.h" typedef struct simple_tokenizer { sqlite3_tokenizer base; char delim[128]; /* flag ASCII delimiters */ } simple_tokenizer; typedef struct simple_tokenizer_cursor { sqlite3_tokenizer_cursor base; const char *pInput; /* input we are tokenizing */ int nBytes; /* size of the input */ int iOffset; /* current position in pInput */ int iToken; /* index of next token to be returned */ char *pToken; /* storage for current token */ int nTokenAllocated; /* space allocated to zToken buffer */ } simple_tokenizer_cursor; /* Forward declaration */ static const sqlite3_tokenizer_module simpleTokenizerModule; static int simpleDelim(simple_tokenizer *t, unsigned char c){ return c<0x80 && t->delim[c]; } /* ** Create a new tokenizer instance. */ static int simpleCreate( int argc, const char * const *argv, sqlite3_tokenizer **ppTokenizer ){ simple_tokenizer *t; t = (simple_tokenizer *) sqlite3_malloc(sizeof(*t)); if( t==NULL ) return SQLITE_NOMEM; memset(t, 0, sizeof(*t)); /* TODO(shess) Delimiters need to remain the same from run to run, ** else we need to reindex. One solution would be a meta-table to ** track such information in the database, then we'd only want this ** information on the initial create. */ if( argc>1 ){ int i, n = strlen(argv[1]); for(i=0; i=0x80 ){ sqlite3_free(t); return SQLITE_ERROR; } t->delim[ch] = 1; } } else { /* Mark non-alphanumeric ASCII characters as delimiters */ int i; for(i=1; i<0x80; i++){ t->delim[i] = !((i>='0' && i<='9') || (i>='A' && i<='Z') || (i>='a' && i<='z')); } } *ppTokenizer = &t->base; return SQLITE_OK; } /* ** Destroy a tokenizer */ static int simpleDestroy(sqlite3_tokenizer *pTokenizer){ sqlite3_free(pTokenizer); return SQLITE_OK; } /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is pInput[0..nBytes-1]. A cursor ** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int simpleOpen( sqlite3_tokenizer *pTokenizer, /* The tokenizer */ const char *pInput, int nBytes, /* String to be tokenized */ sqlite3_tokenizer_cursor **ppCursor /* OUT: Tokenization cursor */ ){ simple_tokenizer_cursor *c; c = (simple_tokenizer_cursor *) sqlite3_malloc(sizeof(*c)); if( c==NULL ) return SQLITE_NOMEM; c->pInput = pInput; if( pInput==0 ){ c->nBytes = 0; }else if( nBytes<0 ){ c->nBytes = (int)strlen(pInput); }else{ c->nBytes = nBytes; } c->iOffset = 0; /* start tokenizing at the beginning */ c->iToken = 0; c->pToken = NULL; /* no space allocated, yet. */ c->nTokenAllocated = 0; *ppCursor = &c->base; return SQLITE_OK; } /* ** Close a tokenization cursor previously opened by a call to ** simpleOpen() above. */ static int simpleClose(sqlite3_tokenizer_cursor *pCursor){ simple_tokenizer_cursor *c = (simple_tokenizer_cursor *) pCursor; sqlite3_free(c->pToken); sqlite3_free(c); return SQLITE_OK; } /* ** Extract the next token from a tokenization cursor. The cursor must ** have been opened by a prior call to simpleOpen(). */ static int simpleNext( sqlite3_tokenizer_cursor *pCursor, /* Cursor returned by simpleOpen */ const char **ppToken, /* OUT: *ppToken is the token text */ int *pnBytes, /* OUT: Number of bytes in token */ int *piStartOffset, /* OUT: Starting offset of token */ int *piEndOffset, /* OUT: Ending offset of token */ int *piPosition /* OUT: Position integer of token */ ){ simple_tokenizer_cursor *c = (simple_tokenizer_cursor *) pCursor; simple_tokenizer *t = (simple_tokenizer *) pCursor->pTokenizer; unsigned char *p = (unsigned char *)c->pInput; while( c->iOffsetnBytes ){ int iStartOffset; /* Scan past delimiter characters */ while( c->iOffsetnBytes && simpleDelim(t, p[c->iOffset]) ){ c->iOffset++; } /* Count non-delimiter characters. */ iStartOffset = c->iOffset; while( c->iOffsetnBytes && !simpleDelim(t, p[c->iOffset]) ){ c->iOffset++; } if( c->iOffset>iStartOffset ){ int i, n = c->iOffset-iStartOffset; if( n>c->nTokenAllocated ){ c->nTokenAllocated = n+20; c->pToken = sqlite3_realloc(c->pToken, c->nTokenAllocated); if( c->pToken==NULL ) return SQLITE_NOMEM; } for(i=0; ipToken[i] = (ch>='A' && ch<='Z') ? (ch - 'A' + 'a') : ch; } *ppToken = c->pToken; *pnBytes = n; *piStartOffset = iStartOffset; *piEndOffset = c->iOffset; *piPosition = c->iToken++; return SQLITE_OK; } } return SQLITE_DONE; } /* ** The set of routines that implement the simple tokenizer */ static const sqlite3_tokenizer_module simpleTokenizerModule = { 0, simpleCreate, simpleDestroy, simpleOpen, simpleClose, simpleNext, }; /* ** Allocate a new simple tokenizer. Return a pointer to the new ** tokenizer in *ppModule */ void sqlite3Fts2SimpleTokenizerModule( sqlite3_tokenizer_module const**ppModule ){ *ppModule = &simpleTokenizerModule; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts2/mkfts2amal.tcl ================================================ #!/usr/bin/tclsh # # This script builds a single C code file holding all of FTS2 code. # The name of the output file is fts2amal.c. To build this file, # first do: # # make target_source # # The make target above moves all of the source code files into # a subdirectory named "tsrc". (This script expects to find the files # there and will not work if they are not found.) # # After the "tsrc" directory has been created and populated, run # this script: # # tclsh mkfts2amal.tcl # # The amalgamated FTS2 code will be written into fts2amal.c # # Open the output file and write a header comment at the beginning # of the file. # set out [open fts2amal.c w] set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1] puts $out [subst \ {/****************************************************************************** ** This file is an amalgamation of separate C source files from the SQLite ** Full Text Search extension 2 (fts2). By combining all the individual C ** code files into this single large file, the entire code can be compiled ** as a one translation unit. This allows many compilers to do optimizations ** that would not be possible if the files were compiled separately. It also ** makes the code easier to import into other projects. ** ** This amalgamation was generated on $today. */}] # These are the header files used by FTS2. The first time any of these # files are seen in a #include statement in the C code, include the complete # text of the file in-line. The file only needs to be included once. # foreach hdr { fts2.h fts2_hash.h fts2_tokenizer.h sqlite3.h sqlite3ext.h } { set available_hdr($hdr) 1 } # 78 stars used for comment formatting. set s78 \ {*****************************************************************************} # Insert a comment into the code # proc section_comment {text} { global out s78 set n [string length $text] set nstar [expr {60 - $n}] set stars [string range $s78 0 $nstar] puts $out "/************** $text $stars/" } # Read the source file named $filename and write it into the # sqlite3.c output file. If any #include statements are seen, # process them approprately. # proc copy_file {filename} { global seen_hdr available_hdr out set tail [file tail $filename] section_comment "Begin file $tail" set in [open $filename r] while {![eof $in]} { set line [gets $in] if {[regexp {^#\s*include\s+["<]([^">]+)[">]} $line all hdr]} { if {[info exists available_hdr($hdr)]} { if {$available_hdr($hdr)} { section_comment "Include $hdr in the middle of $tail" copy_file tsrc/$hdr section_comment "Continuing where we left off in $tail" } } elseif {![info exists seen_hdr($hdr)]} { set seen_hdr($hdr) 1 puts $out $line } } elseif {[regexp {^#ifdef __cplusplus} $line]} { puts $out "#if 0" } elseif {[regexp {^#line} $line]} { # Skip #line directives. } else { puts $out $line } } close $in section_comment "End of $tail" } # Process the source files. Process files containing commonly # used subroutines first in order to help the compiler find # inlining opportunities. # foreach file { fts2.c fts2_hash.c fts2_porter.c fts2_tokenizer.c fts2_tokenizer1.c fts2_icu.c } { copy_file tsrc/$file } close $out ================================================ FILE: v2/testdata/_sqlite/ext/fts3/README.content ================================================ FTS4 CONTENT OPTION Normally, in order to create a full-text index on a dataset, the FTS4 module stores a copy of all indexed documents in a specially created database table. As of SQLite version 3.7.9, FTS4 supports a new option - "content" - designed to extend FTS4 to support the creation of full-text indexes where: * The indexed documents are not stored within the SQLite database at all (a "contentless" FTS4 table), or * The indexed documents are stored in a database table created and managed by the user (an "external content" FTS4 table). Because the indexed documents themselves are usually much larger than the full-text index, the content option can sometimes be used to achieve significant space savings. CONTENTLESS FTS4 TABLES In order to create an FTS4 table that does not store a copy of the indexed documents at all, the content option should be set to an empty string. For example, the following SQL creates such an FTS4 table with three columns - "a", "b", and "c": CREATE VIRTUAL TABLE t1 USING fts4(content="", a, b, c); Data can be inserted into such an FTS4 table using an INSERT statements. However, unlike ordinary FTS4 tables, the user must supply an explicit integer docid value. For example: -- This statement is Ok: INSERT INTO t1(docid, a, b, c) VALUES(1, 'a b c', 'd e f', 'g h i'); -- This statement causes an error, as no docid value has been provided: INSERT INTO t1(a, b, c) VALUES('j k l', 'm n o', 'p q r'); It is not possible to UPDATE or DELETE a row stored in a contentless FTS4 table. Attempting to do so is an error. Contentless FTS4 tables also support SELECT statements. However, it is an error to attempt to retrieve the value of any table column other than the docid column. The auxiliary function matchinfo() may be used, but snippet() and offsets() may not. For example: -- The following statements are Ok: SELECT docid FROM t1 WHERE t1 MATCH 'xxx'; SELECT docid FROM t1 WHERE a MATCH 'xxx'; SELECT matchinfo(t1) FROM t1 WHERE t1 MATCH 'xxx'; -- The following statements all cause errors, as the value of columns -- other than docid are required to evaluate them. SELECT * FROM t1; SELECT a, b FROM t1 WHERE t1 MATCH 'xxx'; SELECT docid FROM t1 WHERE a LIKE 'xxx%'; SELECT snippet(t1) FROM t1 WHERE t1 MATCH 'xxx'; Errors related to attempting to retrieve column values other than docid are runtime errors that occur within sqlite3_step(). In some cases, for example if the MATCH expression in a SELECT query matches zero rows, there may be no error at all even if a statement does refer to column values other than docid. EXTERNAL CONTENT FTS4 TABLES An "external content" FTS4 table is similar to a contentless table, except that if evaluation of a query requires the value of a column other than docid, FTS4 attempts to retrieve that value from a table (or view, or virtual table) nominated by the user (hereafter referred to as the "content table"). The FTS4 module never writes to the content table, and writing to the content table does not affect the full-text index. It is the responsibility of the user to ensure that the content table and the full-text index are consistent. An external content FTS4 table is created by setting the content option to the name of a table (or view, or virtual table) that may be queried by FTS4 to retrieve column values when required. If the nominated table does not exist, then an external content table behaves in the same way as a contentless table. For example: CREATE TABLE t2(id INTEGER PRIMARY KEY, a, b, c); CREATE VIRTUAL TABLE t3 USING fts4(content="t2", a, c); Assuming the nominated table does exist, then its columns must be the same as or a superset of those defined for the FTS table. When a users query on the FTS table requires a column value other than docid, FTS attempts to read this value from the corresponding column of the row in the content table with a rowid value equal to the current FTS docid. Or, if such a row cannot be found in the content table, a NULL value is used instead. For example: CREATE TABLE t2(id INTEGER PRIMARY KEY, a, b, c, d); CREATE VIRTUAL TABLE t3 USING fts4(content="t2", b, c); INSERT INTO t2 VALUES(2, 'a b', 'c d', 'e f'); INSERT INTO t2 VALUES(3, 'g h', 'i j', 'k l'); INSERT INTO t3(docid, b, c) SELECT id, b, c FROM t2; -- The following query returns a single row with two columns containing -- the text values "i j" and "k l". -- -- The query uses the full-text index to discover that the MATCH -- term matches the row with docid=3. It then retrieves the values -- of columns b and c from the row with rowid=3 in the content table -- to return. -- SELECT * FROM t3 WHERE t3 MATCH 'k'; -- Following the UPDATE, the query still returns a single row, this -- time containing the text values "xxx" and "yyy". This is because the -- full-text index still indicates that the row with docid=3 matches -- the FTS4 query 'k', even though the documents stored in the content -- table have been modified. -- UPDATE t2 SET b = 'xxx', c = 'yyy' WHERE rowid = 3; SELECT * FROM t3 WHERE t3 MATCH 'k'; -- Following the DELETE below, the query returns one row containing two -- NULL values. NULL values are returned because FTS is unable to find -- a row with rowid=3 within the content table. -- DELETE FROM t2; SELECT * FROM t3 WHERE t3 MATCH 'k'; When a row is deleted from an external content FTS4 table, FTS4 needs to retrieve the column values of the row being deleted from the content table. This is so that FTS4 can update the full-text index entries for each token that occurs within the deleted row to indicate that that row has been deleted. If the content table row cannot be found, or if it contains values inconsistent with the contents of the FTS index, the results can be difficult to predict. The FTS index may be left containing entries corresponding to the deleted row, which can lead to seemingly nonsensical results being returned by subsequent SELECT queries. The same applies when a row is updated, as internally an UPDATE is the same as a DELETE followed by an INSERT. Instead of writing separately to the full-text index and the content table, some users may wish to use database triggers to keep the full-text index up to date with respect to the set of documents stored in the content table. For example, using the tables from earlier examples: CREATE TRIGGER t2_bu BEFORE UPDATE ON t2 BEGIN DELETE FROM t3 WHERE docid=old.rowid; END; CREATE TRIGGER t2_bd BEFORE DELETE ON t2 BEGIN DELETE FROM t3 WHERE docid=old.rowid; END; CREATE TRIGGER t2_bu AFTER UPDATE ON t2 BEGIN INSERT INTO t3(docid, b, c) VALUES(new.rowid, new.b, new.c); END; CREATE TRIGGER t2_bd AFTER INSERT ON t2 BEGIN INSERT INTO t3(docid, b, c) VALUES(new.rowid, new.b, new.c); END; The DELETE trigger must be fired before the actual delete takes place on the content table. This is so that FTS4 can still retrieve the original values in order to update the full-text index. And the INSERT trigger must be fired after the new row is inserted, so as to handle the case where the rowid is assigned automatically within the system. The UPDATE trigger must be split into two parts, one fired before and one after the update of the content table, for the same reasons. FTS4 features a special command similar to the 'optimize' command that deletes the entire full-text index and rebuilds it based on the current set of documents in the content table. Assuming again that "t3" is the name of the external content FTS4 table, the command is: INSERT INTO t3(t3) VALUES('rebuild'); This command may also be used with ordinary FTS4 tables, although it may only be useful if the full-text index has somehow become corrupt. It is an error to attempt to rebuild the full-text index maintained by a contentless FTS4 table. ================================================ FILE: v2/testdata/_sqlite/ext/fts3/README.syntax ================================================ 1. OVERVIEW This README file describes the syntax of the arguments that may be passed to the FTS3 MATCH operator used for full-text queries. For example, if table "t1" is an Fts3 virtual table, the following SQL query: SELECT * FROM t1 WHERE MATCH may be used to retrieve all rows that match a specified for full-text query. The text "" should be replaced by either the name of the fts3 table (in this case "t1"), or by the name of one of the columns of the fts3 table. should be replaced by an SQL expression that computes to a string containing an Fts3 query. If the left-hand-side of the MATCH operator is set to the name of the fts3 table, then by default the query may be matched against any column of the table. If it is set to a column name, then by default the query may only match the specified column. In both cases this may be overriden as part of the query text (see sections 2 and 3 below). As of SQLite version 3.6.8, Fts3 supports two slightly different query formats; the standard syntax, which is used by default, and the enhanced query syntax which can be selected by compiling with the pre-processor symbol SQLITE_ENABLE_FTS3_PARENTHESIS defined. -DSQLITE_ENABLE_FTS3_PARENTHESIS 2. STANDARD QUERY SYNTAX When using the standard Fts3 query syntax, a query usually consists of a list of terms (words) separated by white-space characters. To match a query, a row (or column) of an Fts3 table must contain each of the specified terms. For example, the following query: MATCH 'hello world' matches rows (or columns, if is the name of a column name) that contain at least one instance of the token "hello", and at least one instance of the token "world". Tokens may be grouped into phrases using quotation marks. In this case, a matching row or column must contain each of the tokens in the phrase in the order specified, with no intervening tokens. For example, the query: MATCH '"hello world" joe" matches the first of the following two documents, but not the second or third: "'Hello world', said Joe." "One should always greet the world with a cheery hello, thought Joe." "How many hello world programs could their be?" As well as grouping tokens together by phrase, the binary NEAR operator may be used to search for rows that contain two or more specified tokens or phrases within a specified proximity of each other. The NEAR operator must always be specified in upper case. The word "near" in lower or mixed case is treated as an ordinary token. For example, the following query: MATCH 'engineering NEAR consultancy' matches rows that contain both the "engineering" and "consultancy" tokens in the same column with not more than 10 other words between them. It does not matter which of the two terms occurs first in the document, only that they be seperated by only 10 tokens or less. The user may also specify a different required proximity by adding "/N" immediately after the NEAR operator, where N is an integer. For example: MATCH 'engineering NEAR/5 consultancy' searches for a row containing an instance of each specified token seperated by not more than 5 other tokens. More than one NEAR operator can be used in as sequence. For example this query: MATCH 'reliable NEAR/2 engineering NEAR/5 consultancy' searches for a row that contains an instance of the token "reliable" seperated by not more than two tokens from an instance of "engineering", which is in turn separated by not more than 5 other tokens from an instance of the term "consultancy". Phrases enclosed in quotes may also be used as arguments to the NEAR operator. Similar to the NEAR operator, one or more tokens or phrases may be separated by OR operators. In this case, only one of the specified tokens or phrases must appear in the document. For example, the query: MATCH 'hello OR world' matches rows that contain either the term "hello", or the term "world", or both. Note that unlike in many programming languages, the OR operator has a higher precedence than the AND operators implied between white-space separated tokens. The following query matches documents that contain the term 'sqlite' and at least one of the terms 'fantastic' or 'impressive', not those that contain both 'sqlite' and 'fantastic' or 'impressive': MATCH 'sqlite fantastic OR impressive' Any token that is part of an Fts3 query expression, whether or not it is part of a phrase enclosed in quotes, may have a '*' character appended to it. In this case, the token matches all terms that begin with the characters of the token, not just those that exactly match it. For example, the following query: MATCH 'sql*' matches all rows that contain the term "SQLite", as well as those that contain "SQL". A token that is not part of a quoted phrase may be preceded by a '-' character, which indicates that matching rows must not contain the specified term. For example, the following: MATCH '"database engine" -sqlite' matches rows that contain the phrase "database engine" but do not contain the term "sqlite". If the '-' character occurs inside a quoted phrase, it is ignored. It is possible to use both the '-' prefix and the '*' postfix on a single term. At this time, all Fts3 queries must contain at least one term or phrase that is not preceded by the '-' prefix. Regardless of whether or not a table name or column name is used on the left hand side of the MATCH operator, a specific column of the fts3 table may be associated with each token in a query by preceding a token with a column name followed by a ':' character. For example, regardless of what is specified for , the following query requires that column "col1" of the table contains the term "hello", and that column "col2" of the table contains the term "world". If the table does not contain columns named "col1" and "col2", then an error is returned and the query is not run. MATCH 'col1:hello col2:world' It is not possible to associate a specific table column with a quoted phrase or a term preceded by a '-' operator. A '*' character may be appended to a term associated with a specific column for prefix matching. 3. ENHANCED QUERY SYNTAX The enhanced query syntax is quite similar to the standard query syntax, with the following four differences: 1) Parenthesis are supported. When using the enhanced query syntax, parenthesis may be used to overcome the built-in precedence of the supplied binary operators. For example, the following query: MATCH '(hello world) OR (simple example)' matches documents that contain both "hello" and "world", and documents that contain both "simple" and "example". It is not possible to forumlate such a query using the standard syntax. 2) Instead of separating tokens and phrases by whitespace, an AND operator may be explicitly specified. This does not change query processing at all, but may be used to improve readability. For example, the following query is handled identically to the one above: MATCH '(hello AND world) OR (simple AND example)' As with the OR and NEAR operators, the AND operator must be specified in upper case. The word "and" specified in lower or mixed case is handled as a regular token. 3) The '-' token prefix is not supported. Instead, a new binary operator, NOT, is included. The NOT operator requires that the query specified as its left-hand operator matches, but that the query specified as the right-hand operator does not. For example, to query for all rows that contain the term "example" but not the term "simple", the following query could be used: MATCH 'example NOT simple' As for all other operators, the NOT operator must be specified in upper case. Otherwise it will be treated as a regular token. 4) Unlike in the standard syntax, where the OR operator has a higher precedence than the implicit AND operator, when using the enhanced syntax implicit and explict AND operators have a higher precedence than OR operators. Using the enhanced syntax, the following two queries are equivalent: MATCH 'sqlite fantastic OR impressive' MATCH '(sqlite AND fantastic) OR impressive' however, when using the standard syntax, the query: MATCH 'sqlite fantastic OR impressive' is equivalent to the enhanced syntax query: MATCH 'sqlite AND (fantastic OR impressive)' The precedence of all enhanced syntax operators, in order from highest to lowest, is: NEAR (highest precedence, tightest grouping) NOT AND OR (lowest precedence, loosest grouping) Using the advanced syntax, it is possible to specify expressions enclosed in parenthesis as operands to the NOT, AND and OR operators. However both the left and right hand side operands of NEAR operators must be either tokens or phrases. Attempting the following query will return an error: MATCH 'sqlite NEAR (fantastic OR impressive)' Queries of this form must be re-written as: MATCH 'sqlite NEAR fantastic OR sqlite NEAR impressive' ================================================ FILE: v2/testdata/_sqlite/ext/fts3/README.tokenizers ================================================ 1. FTS3 Tokenizers When creating a new full-text table, FTS3 allows the user to select the text tokenizer implementation to be used when indexing text by specifying a "tokenize" clause as part of the CREATE VIRTUAL TABLE statement: CREATE VIRTUAL TABLE USING fts3( [, tokenize []] ); The built-in tokenizers (valid values to pass as ) are "simple", "porter" and "unicode". should consist of zero or more white-space separated arguments to pass to the selected tokenizer implementation. The interpretation of the arguments, if any, depends on the individual tokenizer. 2. Custom Tokenizers FTS3 allows users to provide custom tokenizer implementations. The interface used to create a new tokenizer is defined and described in the fts3_tokenizer.h source file. Registering a new FTS3 tokenizer is similar to registering a new virtual table module with SQLite. The user passes a pointer to a structure containing pointers to various callback functions that make up the implementation of the new tokenizer type. For tokenizers, the structure (defined in fts3_tokenizer.h) is called "sqlite3_tokenizer_module". FTS3 does not expose a C-function that users call to register new tokenizer types with a database handle. Instead, the pointer must be encoded as an SQL blob value and passed to FTS3 through the SQL engine by evaluating a special scalar function, "fts3_tokenizer()". The fts3_tokenizer() function may be called with one or two arguments, as follows: SELECT fts3_tokenizer(); SELECT fts3_tokenizer(, ); Where is a string identifying the tokenizer and is a pointer to an sqlite3_tokenizer_module structure encoded as an SQL blob. If the second argument is present, it is registered as tokenizer and a copy of it returned. If only one argument is passed, a pointer to the tokenizer implementation currently registered as is returned, encoded as a blob. Or, if no such tokenizer exists, an SQL exception (error) is raised. SECURITY: If the fts3 extension is used in an environment where potentially malicious users may execute arbitrary SQL (i.e. gears), they should be prevented from invoking the fts3_tokenizer() function, possibly using the authorisation callback. See "Sample code" below for an example of calling the fts3_tokenizer() function from C code. 3. ICU Library Tokenizers If this extension is compiled with the SQLITE_ENABLE_ICU pre-processor symbol defined, then there exists a built-in tokenizer named "icu" implemented using the ICU library. The first argument passed to the xCreate() method (see fts3_tokenizer.h) of this tokenizer may be an ICU locale identifier. For example "tr_TR" for Turkish as used in Turkey, or "en_AU" for English as used in Australia. For example: "CREATE VIRTUAL TABLE thai_text USING fts3(text, tokenizer icu th_TH)" The ICU tokenizer implementation is very simple. It splits the input text according to the ICU rules for finding word boundaries and discards any tokens that consist entirely of white-space. This may be suitable for some applications in some locales, but not all. If more complex processing is required, for example to implement stemming or discard punctuation, this can be done by creating a tokenizer implementation that uses the ICU tokenizer as part of its implementation. When using the ICU tokenizer this way, it is safe to overwrite the contents of the strings returned by the xNext() method (see fts3_tokenizer.h). 4. Sample code. The following two code samples illustrate the way C code should invoke the fts3_tokenizer() scalar function: int registerTokenizer( sqlite3 *db, char *zName, const sqlite3_tokenizer_module *p ){ int rc; sqlite3_stmt *pStmt; const char zSql[] = "SELECT fts3_tokenizer(?, ?)"; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ return rc; } sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); sqlite3_bind_blob(pStmt, 2, &p, sizeof(p), SQLITE_STATIC); sqlite3_step(pStmt); return sqlite3_finalize(pStmt); } int queryTokenizer( sqlite3 *db, char *zName, const sqlite3_tokenizer_module **pp ){ int rc; sqlite3_stmt *pStmt; const char zSql[] = "SELECT fts3_tokenizer(?)"; *pp = 0; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ return rc; } sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); if( SQLITE_ROW==sqlite3_step(pStmt) ){ if( sqlite3_column_type(pStmt, 0)==SQLITE_BLOB ){ memcpy(pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp)); } } return sqlite3_finalize(pStmt); } ================================================ FILE: v2/testdata/_sqlite/ext/fts3/README.txt ================================================ This folder contains source code to the second full-text search extension for SQLite. While the API is the same, this version uses a substantially different storage schema from fts1, so tables will need to be rebuilt. ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3.c ================================================ /* ** 2006 Oct 10 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This is an SQLite module implementing full-text search. */ /* ** The code in this file is only compiled if: ** ** * The FTS3 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS3 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS3 is defined). */ /* The full-text index is stored in a series of b+tree (-like) ** structures called segments which map terms to doclists. The ** structures are like b+trees in layout, but are constructed from the ** bottom up in optimal fashion and are not updatable. Since trees ** are built from the bottom up, things will be described from the ** bottom up. ** ** **** Varints **** ** The basic unit of encoding is a variable-length integer called a ** varint. We encode variable-length integers in little-endian order ** using seven bits * per byte as follows: ** ** KEY: ** A = 0xxxxxxx 7 bits of data and one flag bit ** B = 1xxxxxxx 7 bits of data and one flag bit ** ** 7 bits - A ** 14 bits - BA ** 21 bits - BBA ** and so on. ** ** This is similar in concept to how sqlite encodes "varints" but ** the encoding is not the same. SQLite varints are big-endian ** are are limited to 9 bytes in length whereas FTS3 varints are ** little-endian and can be up to 10 bytes in length (in theory). ** ** Example encodings: ** ** 1: 0x01 ** 127: 0x7f ** 128: 0x81 0x00 ** ** **** Document lists **** ** A doclist (document list) holds a docid-sorted list of hits for a ** given term. Doclists hold docids and associated token positions. ** A docid is the unique integer identifier for a single document. ** A position is the index of a word within the document. The first ** word of the document has a position of 0. ** ** FTS3 used to optionally store character offsets using a compile-time ** option. But that functionality is no longer supported. ** ** A doclist is stored like this: ** ** array { ** varint docid; (delta from previous doclist) ** array { (position list for column 0) ** varint position; (2 more than the delta from previous position) ** } ** array { ** varint POS_COLUMN; (marks start of position list for new column) ** varint column; (index of new column) ** array { ** varint position; (2 more than the delta from previous position) ** } ** } ** varint POS_END; (marks end of positions for this document. ** } ** ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur ** in the same logical place as the position element, and act as sentinals ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus ** 2 for the first position. Example: ** ** label: A B C D E F G H I J K ** value: 123 5 9 1 1 14 35 0 234 72 0 ** ** The 123 value is the first docid. For column zero in this document ** there are two matches at positions 3 and 10 (5-2 and 9-2+3). The 1 ** at D signals the start of a new column; the 1 at E indicates that the ** new column is column number 1. There are two positions at 12 and 45 ** (14-2 and 35-2+12). The 0 at H indicate the end-of-document. The ** 234 at I is the delta to next docid (357). It has one position 70 ** (72-2) and then terminates with the 0 at K. ** ** A "position-list" is the list of positions for multiple columns for ** a single docid. A "column-list" is the set of positions for a single ** column. Hence, a position-list consists of one or more column-lists, ** a document record consists of a docid followed by a position-list and ** a doclist consists of one or more document records. ** ** A bare doclist omits the position information, becoming an ** array of varint-encoded docids. ** **** Segment leaf nodes **** ** Segment leaf nodes store terms and doclists, ordered by term. Leaf ** nodes are written using LeafWriter, and read using LeafReader (to ** iterate through a single leaf node's data) and LeavesReader (to ** iterate through a segment's entire leaf layer). Leaf nodes have ** the format: ** ** varint iHeight; (height from leaf level, always 0) ** varint nTerm; (length of first term) ** char pTerm[nTerm]; (content of first term) ** varint nDoclist; (length of term's associated doclist) ** char pDoclist[nDoclist]; (content of doclist) ** array { ** (further terms are delta-encoded) ** varint nPrefix; (length of prefix shared with previous term) ** varint nSuffix; (length of unshared suffix) ** char pTermSuffix[nSuffix];(unshared suffix of next term) ** varint nDoclist; (length of term's associated doclist) ** char pDoclist[nDoclist]; (content of doclist) ** } ** ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. ** ** Leaf nodes are broken into blocks which are stored contiguously in ** the %_segments table in sorted order. This means that when the end ** of a node is reached, the next term is in the node with the next ** greater node id. ** ** New data is spilled to a new leaf node when the current node ** exceeds LEAF_MAX bytes (default 2048). New data which itself is ** larger than STANDALONE_MIN (default 1024) is placed in a standalone ** node (a leaf node with a single term and doclist). The goal of ** these settings is to pack together groups of small doclists while ** making it efficient to directly access large doclists. The ** assumption is that large doclists represent terms which are more ** likely to be query targets. ** ** TODO(shess) It may be useful for blocking decisions to be more ** dynamic. For instance, it may make more sense to have a 2.5k leaf ** node rather than splitting into 2k and .5k nodes. My intuition is ** that this might extend through 2x or 4x the pagesize. ** ** **** Segment interior nodes **** ** Segment interior nodes store blockids for subtree nodes and terms ** to describe what data is stored by the each subtree. Interior ** nodes are written using InteriorWriter, and read using ** InteriorReader. InteriorWriters are created as needed when ** SegmentWriter creates new leaf nodes, or when an interior node ** itself grows too big and must be split. The format of interior ** nodes: ** ** varint iHeight; (height from leaf level, always >0) ** varint iBlockid; (block id of node's leftmost subtree) ** optional { ** varint nTerm; (length of first term) ** char pTerm[nTerm]; (content of first term) ** array { ** (further terms are delta-encoded) ** varint nPrefix; (length of shared prefix with previous term) ** varint nSuffix; (length of unshared suffix) ** char pTermSuffix[nSuffix]; (unshared suffix of next term) ** } ** } ** ** Here, optional { X } means an optional element, while array { X } ** means zero or more occurrences of X, adjacent in memory. ** ** An interior node encodes n terms separating n+1 subtrees. The ** subtree blocks are contiguous, so only the first subtree's blockid ** is encoded. The subtree at iBlockid will contain all terms less ** than the first term encoded (or all terms if no term is encoded). ** Otherwise, for terms greater than or equal to pTerm[i] but less ** than pTerm[i+1], the subtree for that term will be rooted at ** iBlockid+i. Interior nodes only store enough term data to ** distinguish adjacent children (if the rightmost term of the left ** child is "something", and the leftmost term of the right child is ** "wicked", only "w" is stored). ** ** New data is spilled to a new interior node at the same height when ** the current node exceeds INTERIOR_MAX bytes (default 2048). ** INTERIOR_MIN_TERMS (default 7) keeps large terms from monopolizing ** interior nodes and making the tree too skinny. The interior nodes ** at a given height are naturally tracked by interior nodes at ** height+1, and so on. ** ** **** Segment directory **** ** The segment directory in table %_segdir stores meta-information for ** merging and deleting segments, and also the root node of the ** segment's tree. ** ** The root node is the top node of the segment's tree after encoding ** the entire segment, restricted to ROOT_MAX bytes (default 1024). ** This could be either a leaf node or an interior node. If the top ** node requires more than ROOT_MAX bytes, it is flushed to %_segments ** and a new root interior node is generated (which should always fit ** within ROOT_MAX because it only needs space for 2 varints, the ** height and the blockid of the previous root). ** ** The meta-information in the segment directory is: ** level - segment level (see below) ** idx - index within level ** - (level,idx uniquely identify a segment) ** start_block - first leaf node ** leaves_end_block - last leaf node ** end_block - last block (including interior nodes) ** root - contents of root node ** ** If the root node is a leaf node, then start_block, ** leaves_end_block, and end_block are all 0. ** ** **** Segment merging **** ** To amortize update costs, segments are grouped into levels and ** merged in batches. Each increase in level represents exponentially ** more documents. ** ** New documents (actually, document updates) are tokenized and ** written individually (using LeafWriter) to a level 0 segment, with ** incrementing idx. When idx reaches MERGE_COUNT (default 16), all ** level 0 segments are merged into a single level 1 segment. Level 1 ** is populated like level 0, and eventually MERGE_COUNT level 1 ** segments are merged to a single level 2 segment (representing ** MERGE_COUNT^2 updates), and so on. ** ** A segment merge traverses all segments at a given level in ** parallel, performing a straightforward sorted merge. Since segment ** leaf nodes are written in to the %_segments table in order, this ** merge traverses the underlying sqlite disk structures efficiently. ** After the merge, all segment blocks from the merged level are ** deleted. ** ** MERGE_COUNT controls how often we merge segments. 16 seems to be ** somewhat of a sweet spot for insertion performance. 32 and 64 show ** very similar performance numbers to 16 on insertion, though they're ** a tiny bit slower (perhaps due to more overhead in merge-time ** sorting). 8 is about 20% slower than 16, 4 about 50% slower than ** 16, 2 about 66% slower than 16. ** ** At query time, high MERGE_COUNT increases the number of segments ** which need to be scanned and merged. For instance, with 100k docs ** inserted: ** ** MERGE_COUNT segments ** 16 25 ** 8 12 ** 4 10 ** 2 6 ** ** This appears to have only a moderate impact on queries for very ** frequent terms (which are somewhat dominated by segment merge ** costs), and infrequent and non-existent terms still seem to be fast ** even with many segments. ** ** TODO(shess) That said, it would be nice to have a better query-side ** argument for MERGE_COUNT of 16. Also, it is possible/likely that ** optimizations to things like doclist merging will swing the sweet ** spot around. ** ** ** **** Handling of deletions and updates **** ** Since we're using a segmented structure, with no docid-oriented ** index into the term index, we clearly cannot simply update the term ** index when a document is deleted or updated. For deletions, we ** write an empty doclist (varint(docid) varint(POS_END)), for updates ** we simply write the new doclist. Segment merges overwrite older ** data for a particular docid with newer data, so deletes or updates ** will eventually overtake the earlier data and knock it out. The ** query logic likewise merges doclists so that newer data knocks out ** older data. */ #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE) # define SQLITE_CORE 1 #endif #include #include #include #include #include #include #include "fts3.h" #ifndef SQLITE_CORE # include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 #endif static int fts3EvalNext(Fts3Cursor *pCsr); static int fts3EvalStart(Fts3Cursor *pCsr); static int fts3TermSegReaderCursor( Fts3Cursor *, const char *, int, int, Fts3MultiSegReader **); #ifndef SQLITE_AMALGAMATION # if defined(SQLITE_DEBUG) int sqlite3Fts3Always(int b) { assert( b ); return b; } int sqlite3Fts3Never(int b) { assert( !b ); return b; } # endif #endif /* ** Write a 64-bit variable-length integer to memory starting at p[0]. ** The length of data written will be between 1 and FTS3_VARINT_MAX bytes. ** The number of bytes written is returned. */ int sqlite3Fts3PutVarint(char *p, sqlite_int64 v){ unsigned char *q = (unsigned char *) p; sqlite_uint64 vu = v; do{ *q++ = (unsigned char) ((vu & 0x7f) | 0x80); vu >>= 7; }while( vu!=0 ); q[-1] &= 0x7f; /* turn off high bit in final byte */ assert( q - (unsigned char *)p <= FTS3_VARINT_MAX ); return (int) (q - (unsigned char *)p); } #define GETVARINT_STEP(v, ptr, shift, mask1, mask2, var, ret) \ v = (v & mask1) | ( (*ptr++) << shift ); \ if( (v & mask2)==0 ){ var = v; return ret; } #define GETVARINT_INIT(v, ptr, shift, mask1, mask2, var, ret) \ v = (*ptr++); \ if( (v & mask2)==0 ){ var = v; return ret; } /* ** Read a 64-bit variable-length integer from memory starting at p[0]. ** Return the number of bytes read, or 0 on error. ** The value is stored in *v. */ int sqlite3Fts3GetVarint(const char *pBuf, sqlite_int64 *v){ const unsigned char *p = (const unsigned char*)pBuf; const unsigned char *pStart = p; u32 a; u64 b; int shift; GETVARINT_INIT(a, p, 0, 0x00, 0x80, *v, 1); GETVARINT_STEP(a, p, 7, 0x7F, 0x4000, *v, 2); GETVARINT_STEP(a, p, 14, 0x3FFF, 0x200000, *v, 3); GETVARINT_STEP(a, p, 21, 0x1FFFFF, 0x10000000, *v, 4); b = (a & 0x0FFFFFFF ); for(shift=28; shift<=63; shift+=7){ u64 c = *p++; b += (c&0x7F) << shift; if( (c & 0x80)==0 ) break; } *v = b; return (int)(p - pStart); } /* ** Similar to sqlite3Fts3GetVarint(), except that the output is truncated to ** a non-negative 32-bit integer before it is returned. */ int sqlite3Fts3GetVarint32(const char *p, int *pi){ u32 a; #ifndef fts3GetVarint32 GETVARINT_INIT(a, p, 0, 0x00, 0x80, *pi, 1); #else a = (*p++); assert( a & 0x80 ); #endif GETVARINT_STEP(a, p, 7, 0x7F, 0x4000, *pi, 2); GETVARINT_STEP(a, p, 14, 0x3FFF, 0x200000, *pi, 3); GETVARINT_STEP(a, p, 21, 0x1FFFFF, 0x10000000, *pi, 4); a = (a & 0x0FFFFFFF ); *pi = (int)(a | ((u32)(*p & 0x07) << 28)); assert( 0==(a & 0x80000000) ); assert( *pi>=0 ); return 5; } /* ** Return the number of bytes required to encode v as a varint */ int sqlite3Fts3VarintLen(sqlite3_uint64 v){ int i = 0; do{ i++; v >>= 7; }while( v!=0 ); return i; } /* ** Convert an SQL-style quoted string into a normal string by removing ** the quote characters. The conversion is done in-place. If the ** input does not begin with a quote character, then this routine ** is a no-op. ** ** Examples: ** ** "abc" becomes abc ** 'xyz' becomes xyz ** [pqr] becomes pqr ** `mno` becomes mno ** */ void sqlite3Fts3Dequote(char *z){ char quote; /* Quote character (if any ) */ quote = z[0]; if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){ int iIn = 1; /* Index of next byte to read from input */ int iOut = 0; /* Index of next byte to write to output */ /* If the first byte was a '[', then the close-quote character is a ']' */ if( quote=='[' ) quote = ']'; while( z[iIn] ){ if( z[iIn]==quote ){ if( z[iIn+1]!=quote ) break; z[iOut++] = quote; iIn += 2; }else{ z[iOut++] = z[iIn++]; } } z[iOut] = '\0'; } } /* ** Read a single varint from the doclist at *pp and advance *pp to point ** to the first byte past the end of the varint. Add the value of the varint ** to *pVal. */ static void fts3GetDeltaVarint(char **pp, sqlite3_int64 *pVal){ sqlite3_int64 iVal; *pp += sqlite3Fts3GetVarint(*pp, &iVal); *pVal += iVal; } /* ** When this function is called, *pp points to the first byte following a ** varint that is part of a doclist (or position-list, or any other list ** of varints). This function moves *pp to point to the start of that varint, ** and sets *pVal by the varint value. ** ** Argument pStart points to the first byte of the doclist that the ** varint is part of. */ static void fts3GetReverseVarint( char **pp, char *pStart, sqlite3_int64 *pVal ){ sqlite3_int64 iVal; char *p; /* Pointer p now points at the first byte past the varint we are ** interested in. So, unless the doclist is corrupt, the 0x80 bit is ** clear on character p[-1]. */ for(p = (*pp)-2; p>=pStart && *p&0x80; p--); p++; *pp = p; sqlite3Fts3GetVarint(p, &iVal); *pVal = iVal; } /* ** The xDisconnect() virtual table method. */ static int fts3DisconnectMethod(sqlite3_vtab *pVtab){ Fts3Table *p = (Fts3Table *)pVtab; int i; assert( p->nPendingData==0 ); assert( p->pSegments==0 ); /* Free any prepared statements held */ sqlite3_finalize(p->pSeekStmt); for(i=0; iaStmt); i++){ sqlite3_finalize(p->aStmt[i]); } sqlite3_free(p->zSegmentsTbl); sqlite3_free(p->zReadExprlist); sqlite3_free(p->zWriteExprlist); sqlite3_free(p->zContentTbl); sqlite3_free(p->zLanguageid); /* Invoke the tokenizer destructor to free the tokenizer. */ p->pTokenizer->pModule->xDestroy(p->pTokenizer); sqlite3_free(p); return SQLITE_OK; } /* ** Write an error message into *pzErr */ void sqlite3Fts3ErrMsg(char **pzErr, const char *zFormat, ...){ va_list ap; sqlite3_free(*pzErr); va_start(ap, zFormat); *pzErr = sqlite3_vmprintf(zFormat, ap); va_end(ap); } /* ** Construct one or more SQL statements from the format string given ** and then evaluate those statements. The success code is written ** into *pRc. ** ** If *pRc is initially non-zero then this routine is a no-op. */ static void fts3DbExec( int *pRc, /* Success code */ sqlite3 *db, /* Database in which to run SQL */ const char *zFormat, /* Format string for SQL */ ... /* Arguments to the format string */ ){ va_list ap; char *zSql; if( *pRc ) return; va_start(ap, zFormat); zSql = sqlite3_vmprintf(zFormat, ap); va_end(ap); if( zSql==0 ){ *pRc = SQLITE_NOMEM; }else{ *pRc = sqlite3_exec(db, zSql, 0, 0, 0); sqlite3_free(zSql); } } /* ** The xDestroy() virtual table method. */ static int fts3DestroyMethod(sqlite3_vtab *pVtab){ Fts3Table *p = (Fts3Table *)pVtab; int rc = SQLITE_OK; /* Return code */ const char *zDb = p->zDb; /* Name of database (e.g. "main", "temp") */ sqlite3 *db = p->db; /* Database handle */ /* Drop the shadow tables */ if( p->zContentTbl==0 ){ fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_content'", zDb, p->zName); } fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_segments'", zDb,p->zName); fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_segdir'", zDb, p->zName); fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_docsize'", zDb, p->zName); fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_stat'", zDb, p->zName); /* If everything has worked, invoke fts3DisconnectMethod() to free the ** memory associated with the Fts3Table structure and return SQLITE_OK. ** Otherwise, return an SQLite error code. */ return (rc==SQLITE_OK ? fts3DisconnectMethod(pVtab) : rc); } /* ** Invoke sqlite3_declare_vtab() to declare the schema for the FTS3 table ** passed as the first argument. This is done as part of the xConnect() ** and xCreate() methods. ** ** If *pRc is non-zero when this function is called, it is a no-op. ** Otherwise, if an error occurs, an SQLite error code is stored in *pRc ** before returning. */ static void fts3DeclareVtab(int *pRc, Fts3Table *p){ if( *pRc==SQLITE_OK ){ int i; /* Iterator variable */ int rc; /* Return code */ char *zSql; /* SQL statement passed to declare_vtab() */ char *zCols; /* List of user defined columns */ const char *zLanguageid; zLanguageid = (p->zLanguageid ? p->zLanguageid : "__langid"); sqlite3_vtab_config(p->db, SQLITE_VTAB_CONSTRAINT_SUPPORT, 1); /* Create a list of user columns for the virtual table */ zCols = sqlite3_mprintf("%Q, ", p->azColumn[0]); for(i=1; zCols && inColumn; i++){ zCols = sqlite3_mprintf("%z%Q, ", zCols, p->azColumn[i]); } /* Create the whole "CREATE TABLE" statement to pass to SQLite */ zSql = sqlite3_mprintf( "CREATE TABLE x(%s %Q HIDDEN, docid HIDDEN, %Q HIDDEN)", zCols, p->zName, zLanguageid ); if( !zCols || !zSql ){ rc = SQLITE_NOMEM; }else{ rc = sqlite3_declare_vtab(p->db, zSql); } sqlite3_free(zSql); sqlite3_free(zCols); *pRc = rc; } } /* ** Create the %_stat table if it does not already exist. */ void sqlite3Fts3CreateStatTable(int *pRc, Fts3Table *p){ fts3DbExec(pRc, p->db, "CREATE TABLE IF NOT EXISTS %Q.'%q_stat'" "(id INTEGER PRIMARY KEY, value BLOB);", p->zDb, p->zName ); if( (*pRc)==SQLITE_OK ) p->bHasStat = 1; } /* ** Create the backing store tables (%_content, %_segments and %_segdir) ** required by the FTS3 table passed as the only argument. This is done ** as part of the vtab xCreate() method. ** ** If the p->bHasDocsize boolean is true (indicating that this is an ** FTS4 table, not an FTS3 table) then also create the %_docsize and ** %_stat tables required by FTS4. */ static int fts3CreateTables(Fts3Table *p){ int rc = SQLITE_OK; /* Return code */ int i; /* Iterator variable */ sqlite3 *db = p->db; /* The database connection */ if( p->zContentTbl==0 ){ const char *zLanguageid = p->zLanguageid; char *zContentCols; /* Columns of %_content table */ /* Create a list of user columns for the content table */ zContentCols = sqlite3_mprintf("docid INTEGER PRIMARY KEY"); for(i=0; zContentCols && inColumn; i++){ char *z = p->azColumn[i]; zContentCols = sqlite3_mprintf("%z, 'c%d%q'", zContentCols, i, z); } if( zLanguageid && zContentCols ){ zContentCols = sqlite3_mprintf("%z, langid", zContentCols, zLanguageid); } if( zContentCols==0 ) rc = SQLITE_NOMEM; /* Create the content table */ fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_content'(%s)", p->zDb, p->zName, zContentCols ); sqlite3_free(zContentCols); } /* Create other tables */ fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_segments'(blockid INTEGER PRIMARY KEY, block BLOB);", p->zDb, p->zName ); fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_segdir'(" "level INTEGER," "idx INTEGER," "start_block INTEGER," "leaves_end_block INTEGER," "end_block INTEGER," "root BLOB," "PRIMARY KEY(level, idx)" ");", p->zDb, p->zName ); if( p->bHasDocsize ){ fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_docsize'(docid INTEGER PRIMARY KEY, size BLOB);", p->zDb, p->zName ); } assert( p->bHasStat==p->bFts4 ); if( p->bHasStat ){ sqlite3Fts3CreateStatTable(&rc, p); } return rc; } /* ** Store the current database page-size in bytes in p->nPgsz. ** ** If *pRc is non-zero when this function is called, it is a no-op. ** Otherwise, if an error occurs, an SQLite error code is stored in *pRc ** before returning. */ static void fts3DatabasePageSize(int *pRc, Fts3Table *p){ if( *pRc==SQLITE_OK ){ int rc; /* Return code */ char *zSql; /* SQL text "PRAGMA %Q.page_size" */ sqlite3_stmt *pStmt; /* Compiled "PRAGMA %Q.page_size" statement */ zSql = sqlite3_mprintf("PRAGMA %Q.page_size", p->zDb); if( !zSql ){ rc = SQLITE_NOMEM; }else{ rc = sqlite3_prepare(p->db, zSql, -1, &pStmt, 0); if( rc==SQLITE_OK ){ sqlite3_step(pStmt); p->nPgsz = sqlite3_column_int(pStmt, 0); rc = sqlite3_finalize(pStmt); }else if( rc==SQLITE_AUTH ){ p->nPgsz = 1024; rc = SQLITE_OK; } } assert( p->nPgsz>0 || rc!=SQLITE_OK ); sqlite3_free(zSql); *pRc = rc; } } /* ** "Special" FTS4 arguments are column specifications of the following form: ** ** = ** ** There may not be whitespace surrounding the "=" character. The ** term may be quoted, but the may not. */ static int fts3IsSpecialColumn( const char *z, int *pnKey, char **pzValue ){ char *zValue; const char *zCsr = z; while( *zCsr!='=' ){ if( *zCsr=='\0' ) return 0; zCsr++; } *pnKey = (int)(zCsr-z); zValue = sqlite3_mprintf("%s", &zCsr[1]); if( zValue ){ sqlite3Fts3Dequote(zValue); } *pzValue = zValue; return 1; } /* ** Append the output of a printf() style formatting to an existing string. */ static void fts3Appendf( int *pRc, /* IN/OUT: Error code */ char **pz, /* IN/OUT: Pointer to string buffer */ const char *zFormat, /* Printf format string to append */ ... /* Arguments for printf format string */ ){ if( *pRc==SQLITE_OK ){ va_list ap; char *z; va_start(ap, zFormat); z = sqlite3_vmprintf(zFormat, ap); va_end(ap); if( z && *pz ){ char *z2 = sqlite3_mprintf("%s%s", *pz, z); sqlite3_free(z); z = z2; } if( z==0 ) *pRc = SQLITE_NOMEM; sqlite3_free(*pz); *pz = z; } } /* ** Return a copy of input string zInput enclosed in double-quotes (") and ** with all double quote characters escaped. For example: ** ** fts3QuoteId("un \"zip\"") -> "un \"\"zip\"\"" ** ** The pointer returned points to memory obtained from sqlite3_malloc(). It ** is the callers responsibility to call sqlite3_free() to release this ** memory. */ static char *fts3QuoteId(char const *zInput){ int nRet; char *zRet; nRet = 2 + (int)strlen(zInput)*2 + 1; zRet = sqlite3_malloc(nRet); if( zRet ){ int i; char *z = zRet; *(z++) = '"'; for(i=0; zInput[i]; i++){ if( zInput[i]=='"' ) *(z++) = '"'; *(z++) = zInput[i]; } *(z++) = '"'; *(z++) = '\0'; } return zRet; } /* ** Return a list of comma separated SQL expressions and a FROM clause that ** could be used in a SELECT statement such as the following: ** ** SELECT FROM %_content AS x ... ** ** to return the docid, followed by each column of text data in order ** from left to write. If parameter zFunc is not NULL, then instead of ** being returned directly each column of text data is passed to an SQL ** function named zFunc first. For example, if zFunc is "unzip" and the ** table has the three user-defined columns "a", "b", and "c", the following ** string is returned: ** ** "docid, unzip(x.'a'), unzip(x.'b'), unzip(x.'c') FROM %_content AS x" ** ** The pointer returned points to a buffer allocated by sqlite3_malloc(). It ** is the responsibility of the caller to eventually free it. ** ** If *pRc is not SQLITE_OK when this function is called, it is a no-op (and ** a NULL pointer is returned). Otherwise, if an OOM error is encountered ** by this function, NULL is returned and *pRc is set to SQLITE_NOMEM. If ** no error occurs, *pRc is left unmodified. */ static char *fts3ReadExprList(Fts3Table *p, const char *zFunc, int *pRc){ char *zRet = 0; char *zFree = 0; char *zFunction; int i; if( p->zContentTbl==0 ){ if( !zFunc ){ zFunction = ""; }else{ zFree = zFunction = fts3QuoteId(zFunc); } fts3Appendf(pRc, &zRet, "docid"); for(i=0; inColumn; i++){ fts3Appendf(pRc, &zRet, ",%s(x.'c%d%q')", zFunction, i, p->azColumn[i]); } if( p->zLanguageid ){ fts3Appendf(pRc, &zRet, ", x.%Q", "langid"); } sqlite3_free(zFree); }else{ fts3Appendf(pRc, &zRet, "rowid"); for(i=0; inColumn; i++){ fts3Appendf(pRc, &zRet, ", x.'%q'", p->azColumn[i]); } if( p->zLanguageid ){ fts3Appendf(pRc, &zRet, ", x.%Q", p->zLanguageid); } } fts3Appendf(pRc, &zRet, " FROM '%q'.'%q%s' AS x", p->zDb, (p->zContentTbl ? p->zContentTbl : p->zName), (p->zContentTbl ? "" : "_content") ); return zRet; } /* ** Return a list of N comma separated question marks, where N is the number ** of columns in the %_content table (one for the docid plus one for each ** user-defined text column). ** ** If argument zFunc is not NULL, then all but the first question mark ** is preceded by zFunc and an open bracket, and followed by a closed ** bracket. For example, if zFunc is "zip" and the FTS3 table has three ** user-defined text columns, the following string is returned: ** ** "?, zip(?), zip(?), zip(?)" ** ** The pointer returned points to a buffer allocated by sqlite3_malloc(). It ** is the responsibility of the caller to eventually free it. ** ** If *pRc is not SQLITE_OK when this function is called, it is a no-op (and ** a NULL pointer is returned). Otherwise, if an OOM error is encountered ** by this function, NULL is returned and *pRc is set to SQLITE_NOMEM. If ** no error occurs, *pRc is left unmodified. */ static char *fts3WriteExprList(Fts3Table *p, const char *zFunc, int *pRc){ char *zRet = 0; char *zFree = 0; char *zFunction; int i; if( !zFunc ){ zFunction = ""; }else{ zFree = zFunction = fts3QuoteId(zFunc); } fts3Appendf(pRc, &zRet, "?"); for(i=0; inColumn; i++){ fts3Appendf(pRc, &zRet, ",%s(?)", zFunction); } if( p->zLanguageid ){ fts3Appendf(pRc, &zRet, ", ?"); } sqlite3_free(zFree); return zRet; } /* ** This function interprets the string at (*pp) as a non-negative integer ** value. It reads the integer and sets *pnOut to the value read, then ** sets *pp to point to the byte immediately following the last byte of ** the integer value. ** ** Only decimal digits ('0'..'9') may be part of an integer value. ** ** If *pp does not being with a decimal digit SQLITE_ERROR is returned and ** the output value undefined. Otherwise SQLITE_OK is returned. ** ** This function is used when parsing the "prefix=" FTS4 parameter. */ static int fts3GobbleInt(const char **pp, int *pnOut){ const int MAX_NPREFIX = 10000000; const char *p; /* Iterator pointer */ int nInt = 0; /* Output value */ for(p=*pp; p[0]>='0' && p[0]<='9'; p++){ nInt = nInt * 10 + (p[0] - '0'); if( nInt>MAX_NPREFIX ){ nInt = 0; break; } } if( p==*pp ) return SQLITE_ERROR; *pnOut = nInt; *pp = p; return SQLITE_OK; } /* ** This function is called to allocate an array of Fts3Index structures ** representing the indexes maintained by the current FTS table. FTS tables ** always maintain the main "terms" index, but may also maintain one or ** more "prefix" indexes, depending on the value of the "prefix=" parameter ** (if any) specified as part of the CREATE VIRTUAL TABLE statement. ** ** Argument zParam is passed the value of the "prefix=" option if one was ** specified, or NULL otherwise. ** ** If no error occurs, SQLITE_OK is returned and *apIndex set to point to ** the allocated array. *pnIndex is set to the number of elements in the ** array. If an error does occur, an SQLite error code is returned. ** ** Regardless of whether or not an error is returned, it is the responsibility ** of the caller to call sqlite3_free() on the output array to free it. */ static int fts3PrefixParameter( const char *zParam, /* ABC in prefix=ABC parameter to parse */ int *pnIndex, /* OUT: size of *apIndex[] array */ struct Fts3Index **apIndex /* OUT: Array of indexes for this table */ ){ struct Fts3Index *aIndex; /* Allocated array */ int nIndex = 1; /* Number of entries in array */ if( zParam && zParam[0] ){ const char *p; nIndex++; for(p=zParam; *p; p++){ if( *p==',' ) nIndex++; } } aIndex = sqlite3_malloc(sizeof(struct Fts3Index) * nIndex); *apIndex = aIndex; if( !aIndex ){ return SQLITE_NOMEM; } memset(aIndex, 0, sizeof(struct Fts3Index) * nIndex); if( zParam ){ const char *p = zParam; int i; for(i=1; i=0 ); if( nPrefix==0 ){ nIndex--; i--; }else{ aIndex[i].nPrefix = nPrefix; } p++; } } *pnIndex = nIndex; return SQLITE_OK; } /* ** This function is called when initializing an FTS4 table that uses the ** content=xxx option. It determines the number of and names of the columns ** of the new FTS4 table. ** ** The third argument passed to this function is the value passed to the ** config=xxx option (i.e. "xxx"). This function queries the database for ** a table of that name. If found, the output variables are populated ** as follows: ** ** *pnCol: Set to the number of columns table xxx has, ** ** *pnStr: Set to the total amount of space required to store a copy ** of each columns name, including the nul-terminator. ** ** *pazCol: Set to point to an array of *pnCol strings. Each string is ** the name of the corresponding column in table xxx. The array ** and its contents are allocated using a single allocation. It ** is the responsibility of the caller to free this allocation ** by eventually passing the *pazCol value to sqlite3_free(). ** ** If the table cannot be found, an error code is returned and the output ** variables are undefined. Or, if an OOM is encountered, SQLITE_NOMEM is ** returned (and the output variables are undefined). */ static int fts3ContentColumns( sqlite3 *db, /* Database handle */ const char *zDb, /* Name of db (i.e. "main", "temp" etc.) */ const char *zTbl, /* Name of content table */ const char ***pazCol, /* OUT: Malloc'd array of column names */ int *pnCol, /* OUT: Size of array *pazCol */ int *pnStr, /* OUT: Bytes of string content */ char **pzErr /* OUT: error message */ ){ int rc = SQLITE_OK; /* Return code */ char *zSql; /* "SELECT *" statement on zTbl */ sqlite3_stmt *pStmt = 0; /* Compiled version of zSql */ zSql = sqlite3_mprintf("SELECT * FROM %Q.%Q", zDb, zTbl); if( !zSql ){ rc = SQLITE_NOMEM; }else{ rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ sqlite3Fts3ErrMsg(pzErr, "%s", sqlite3_errmsg(db)); } } sqlite3_free(zSql); if( rc==SQLITE_OK ){ const char **azCol; /* Output array */ int nStr = 0; /* Size of all column names (incl. 0x00) */ int nCol; /* Number of table columns */ int i; /* Used to iterate through columns */ /* Loop through the returned columns. Set nStr to the number of bytes of ** space required to store a copy of each column name, including the ** nul-terminator byte. */ nCol = sqlite3_column_count(pStmt); for(i=0; i module name ("fts3" or "fts4") ** argv[1] -> database name ** argv[2] -> table name ** argv[...] -> "column name" and other module argument fields. */ static int fts3InitVtab( int isCreate, /* True for xCreate, false for xConnect */ sqlite3 *db, /* The SQLite database connection */ void *pAux, /* Hash table containing tokenizers */ int argc, /* Number of elements in argv array */ const char * const *argv, /* xCreate/xConnect argument array */ sqlite3_vtab **ppVTab, /* Write the resulting vtab structure here */ char **pzErr /* Write any error message here */ ){ Fts3Hash *pHash = (Fts3Hash *)pAux; Fts3Table *p = 0; /* Pointer to allocated vtab */ int rc = SQLITE_OK; /* Return code */ int i; /* Iterator variable */ int nByte; /* Size of allocation used for *p */ int iCol; /* Column index */ int nString = 0; /* Bytes required to hold all column names */ int nCol = 0; /* Number of columns in the FTS table */ char *zCsr; /* Space for holding column names */ int nDb; /* Bytes required to hold database name */ int nName; /* Bytes required to hold table name */ int isFts4 = (argv[0][3]=='4'); /* True for FTS4, false for FTS3 */ const char **aCol; /* Array of column names */ sqlite3_tokenizer *pTokenizer = 0; /* Tokenizer for this table */ int nIndex = 0; /* Size of aIndex[] array */ struct Fts3Index *aIndex = 0; /* Array of indexes for this table */ /* The results of parsing supported FTS4 key=value options: */ int bNoDocsize = 0; /* True to omit %_docsize table */ int bDescIdx = 0; /* True to store descending indexes */ char *zPrefix = 0; /* Prefix parameter value (or NULL) */ char *zCompress = 0; /* compress=? parameter (or NULL) */ char *zUncompress = 0; /* uncompress=? parameter (or NULL) */ char *zContent = 0; /* content=? parameter (or NULL) */ char *zLanguageid = 0; /* languageid=? parameter (or NULL) */ char **azNotindexed = 0; /* The set of notindexed= columns */ int nNotindexed = 0; /* Size of azNotindexed[] array */ assert( strlen(argv[0])==4 ); assert( (sqlite3_strnicmp(argv[0], "fts4", 4)==0 && isFts4) || (sqlite3_strnicmp(argv[0], "fts3", 4)==0 && !isFts4) ); nDb = (int)strlen(argv[1]) + 1; nName = (int)strlen(argv[2]) + 1; nByte = sizeof(const char *) * (argc-2); aCol = (const char **)sqlite3_malloc(nByte); if( aCol ){ memset((void*)aCol, 0, nByte); azNotindexed = (char **)sqlite3_malloc(nByte); } if( azNotindexed ){ memset(azNotindexed, 0, nByte); } if( !aCol || !azNotindexed ){ rc = SQLITE_NOMEM; goto fts3_init_out; } /* Loop through all of the arguments passed by the user to the FTS3/4 ** module (i.e. all the column names and special arguments). This loop ** does the following: ** ** + Figures out the number of columns the FTSX table will have, and ** the number of bytes of space that must be allocated to store copies ** of the column names. ** ** + If there is a tokenizer specification included in the arguments, ** initializes the tokenizer pTokenizer. */ for(i=3; rc==SQLITE_OK && i8 && 0==sqlite3_strnicmp(z, "tokenize", 8) && 0==sqlite3Fts3IsIdChar(z[8]) ){ rc = sqlite3Fts3InitTokenizer(pHash, &z[9], &pTokenizer, pzErr); } /* Check if it is an FTS4 special argument. */ else if( isFts4 && fts3IsSpecialColumn(z, &nKey, &zVal) ){ struct Fts4Option { const char *zOpt; int nOpt; } aFts4Opt[] = { { "matchinfo", 9 }, /* 0 -> MATCHINFO */ { "prefix", 6 }, /* 1 -> PREFIX */ { "compress", 8 }, /* 2 -> COMPRESS */ { "uncompress", 10 }, /* 3 -> UNCOMPRESS */ { "order", 5 }, /* 4 -> ORDER */ { "content", 7 }, /* 5 -> CONTENT */ { "languageid", 10 }, /* 6 -> LANGUAGEID */ { "notindexed", 10 } /* 7 -> NOTINDEXED */ }; int iOpt; if( !zVal ){ rc = SQLITE_NOMEM; }else{ for(iOpt=0; iOptnOpt && !sqlite3_strnicmp(z, pOp->zOpt, pOp->nOpt) ){ break; } } switch( iOpt ){ case 0: /* MATCHINFO */ if( strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "fts3", 4) ){ sqlite3Fts3ErrMsg(pzErr, "unrecognized matchinfo: %s", zVal); rc = SQLITE_ERROR; } bNoDocsize = 1; break; case 1: /* PREFIX */ sqlite3_free(zPrefix); zPrefix = zVal; zVal = 0; break; case 2: /* COMPRESS */ sqlite3_free(zCompress); zCompress = zVal; zVal = 0; break; case 3: /* UNCOMPRESS */ sqlite3_free(zUncompress); zUncompress = zVal; zVal = 0; break; case 4: /* ORDER */ if( (strlen(zVal)!=3 || sqlite3_strnicmp(zVal, "asc", 3)) && (strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "desc", 4)) ){ sqlite3Fts3ErrMsg(pzErr, "unrecognized order: %s", zVal); rc = SQLITE_ERROR; } bDescIdx = (zVal[0]=='d' || zVal[0]=='D'); break; case 5: /* CONTENT */ sqlite3_free(zContent); zContent = zVal; zVal = 0; break; case 6: /* LANGUAGEID */ assert( iOpt==6 ); sqlite3_free(zLanguageid); zLanguageid = zVal; zVal = 0; break; case 7: /* NOTINDEXED */ azNotindexed[nNotindexed++] = zVal; zVal = 0; break; default: assert( iOpt==SizeofArray(aFts4Opt) ); sqlite3Fts3ErrMsg(pzErr, "unrecognized parameter: %s", z); rc = SQLITE_ERROR; break; } sqlite3_free(zVal); } } /* Otherwise, the argument is a column name. */ else { nString += (int)(strlen(z) + 1); aCol[nCol++] = z; } } /* If a content=xxx option was specified, the following: ** ** 1. Ignore any compress= and uncompress= options. ** ** 2. If no column names were specified as part of the CREATE VIRTUAL ** TABLE statement, use all columns from the content table. */ if( rc==SQLITE_OK && zContent ){ sqlite3_free(zCompress); sqlite3_free(zUncompress); zCompress = 0; zUncompress = 0; if( nCol==0 ){ sqlite3_free((void*)aCol); aCol = 0; rc = fts3ContentColumns(db, argv[1], zContent,&aCol,&nCol,&nString,pzErr); /* If a languageid= option was specified, remove the language id ** column from the aCol[] array. */ if( rc==SQLITE_OK && zLanguageid ){ int j; for(j=0; jdb = db; p->nColumn = nCol; p->nPendingData = 0; p->azColumn = (char **)&p[1]; p->pTokenizer = pTokenizer; p->nMaxPendingData = FTS3_MAX_PENDING_DATA; p->bHasDocsize = (isFts4 && bNoDocsize==0); p->bHasStat = (u8)isFts4; p->bFts4 = (u8)isFts4; p->bDescIdx = (u8)bDescIdx; p->nAutoincrmerge = 0xff; /* 0xff means setting unknown */ p->zContentTbl = zContent; p->zLanguageid = zLanguageid; zContent = 0; zLanguageid = 0; TESTONLY( p->inTransaction = -1 ); TESTONLY( p->mxSavepoint = -1 ); p->aIndex = (struct Fts3Index *)&p->azColumn[nCol]; memcpy(p->aIndex, aIndex, sizeof(struct Fts3Index) * nIndex); p->nIndex = nIndex; for(i=0; iaIndex[i].hPending, FTS3_HASH_STRING, 1); } p->abNotindexed = (u8 *)&p->aIndex[nIndex]; /* Fill in the zName and zDb fields of the vtab structure. */ zCsr = (char *)&p->abNotindexed[nCol]; p->zName = zCsr; memcpy(zCsr, argv[2], nName); zCsr += nName; p->zDb = zCsr; memcpy(zCsr, argv[1], nDb); zCsr += nDb; /* Fill in the azColumn array */ for(iCol=0; iCol0 ){ memcpy(zCsr, z, n); } zCsr[n] = '\0'; sqlite3Fts3Dequote(zCsr); p->azColumn[iCol] = zCsr; zCsr += n+1; assert( zCsr <= &((char *)p)[nByte] ); } /* Fill in the abNotindexed array */ for(iCol=0; iColazColumn[iCol]); for(i=0; iazColumn[iCol], zNot, n) ){ p->abNotindexed[iCol] = 1; sqlite3_free(zNot); azNotindexed[i] = 0; } } } for(i=0; izReadExprlist = fts3ReadExprList(p, zUncompress, &rc); p->zWriteExprlist = fts3WriteExprList(p, zCompress, &rc); if( rc!=SQLITE_OK ) goto fts3_init_out; /* If this is an xCreate call, create the underlying tables in the ** database. TODO: For xConnect(), it could verify that said tables exist. */ if( isCreate ){ rc = fts3CreateTables(p); } /* Check to see if a legacy fts3 table has been "upgraded" by the ** addition of a %_stat table so that it can use incremental merge. */ if( !isFts4 && !isCreate ){ p->bHasStat = 2; } /* Figure out the page-size for the database. This is required in order to ** estimate the cost of loading large doclists from the database. */ fts3DatabasePageSize(&rc, p); p->nNodeSize = p->nPgsz-35; /* Declare the table schema to SQLite. */ fts3DeclareVtab(&rc, p); fts3_init_out: sqlite3_free(zPrefix); sqlite3_free(aIndex); sqlite3_free(zCompress); sqlite3_free(zUncompress); sqlite3_free(zContent); sqlite3_free(zLanguageid); for(i=0; ipModule->xDestroy(pTokenizer); } }else{ assert( p->pSegments==0 ); *ppVTab = &p->base; } return rc; } /* ** The xConnect() and xCreate() methods for the virtual table. All the ** work is done in function fts3InitVtab(). */ static int fts3ConnectMethod( sqlite3 *db, /* Database connection */ void *pAux, /* Pointer to tokenizer hash table */ int argc, /* Number of elements in argv array */ const char * const *argv, /* xCreate/xConnect argument array */ sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */ char **pzErr /* OUT: sqlite3_malloc'd error message */ ){ return fts3InitVtab(0, db, pAux, argc, argv, ppVtab, pzErr); } static int fts3CreateMethod( sqlite3 *db, /* Database connection */ void *pAux, /* Pointer to tokenizer hash table */ int argc, /* Number of elements in argv array */ const char * const *argv, /* xCreate/xConnect argument array */ sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */ char **pzErr /* OUT: sqlite3_malloc'd error message */ ){ return fts3InitVtab(1, db, pAux, argc, argv, ppVtab, pzErr); } /* ** Set the pIdxInfo->estimatedRows variable to nRow. Unless this ** extension is currently being used by a version of SQLite too old to ** support estimatedRows. In that case this function is a no-op. */ static void fts3SetEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){ #if SQLITE_VERSION_NUMBER>=3008002 if( sqlite3_libversion_number()>=3008002 ){ pIdxInfo->estimatedRows = nRow; } #endif } /* ** Set the SQLITE_INDEX_SCAN_UNIQUE flag in pIdxInfo->flags. Unless this ** extension is currently being used by a version of SQLite too old to ** support index-info flags. In that case this function is a no-op. */ static void fts3SetUniqueFlag(sqlite3_index_info *pIdxInfo){ #if SQLITE_VERSION_NUMBER>=3008012 if( sqlite3_libversion_number()>=3008012 ){ pIdxInfo->idxFlags |= SQLITE_INDEX_SCAN_UNIQUE; } #endif } /* ** Implementation of the xBestIndex method for FTS3 tables. There ** are three possible strategies, in order of preference: ** ** 1. Direct lookup by rowid or docid. ** 2. Full-text search using a MATCH operator on a non-docid column. ** 3. Linear scan of %_content table. */ static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ Fts3Table *p = (Fts3Table *)pVTab; int i; /* Iterator variable */ int iCons = -1; /* Index of constraint to use */ int iLangidCons = -1; /* Index of langid=x constraint, if present */ int iDocidGe = -1; /* Index of docid>=x constraint, if present */ int iDocidLe = -1; /* Index of docid<=x constraint, if present */ int iIdx; /* By default use a full table scan. This is an expensive option, ** so search through the constraints to see if a more efficient ** strategy is possible. */ pInfo->idxNum = FTS3_FULLSCAN_SEARCH; pInfo->estimatedCost = 5000000; for(i=0; inConstraint; i++){ int bDocid; /* True if this constraint is on docid */ struct sqlite3_index_constraint *pCons = &pInfo->aConstraint[i]; if( pCons->usable==0 ){ if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH ){ /* There exists an unusable MATCH constraint. This means that if ** the planner does elect to use the results of this call as part ** of the overall query plan the user will see an "unable to use ** function MATCH in the requested context" error. To discourage ** this, return a very high cost here. */ pInfo->idxNum = FTS3_FULLSCAN_SEARCH; pInfo->estimatedCost = 1e50; fts3SetEstimatedRows(pInfo, ((sqlite3_int64)1) << 50); return SQLITE_OK; } continue; } bDocid = (pCons->iColumn<0 || pCons->iColumn==p->nColumn+1); /* A direct lookup on the rowid or docid column. Assign a cost of 1.0. */ if( iCons<0 && pCons->op==SQLITE_INDEX_CONSTRAINT_EQ && bDocid ){ pInfo->idxNum = FTS3_DOCID_SEARCH; pInfo->estimatedCost = 1.0; iCons = i; } /* A MATCH constraint. Use a full-text search. ** ** If there is more than one MATCH constraint available, use the first ** one encountered. If there is both a MATCH constraint and a direct ** rowid/docid lookup, prefer the MATCH strategy. This is done even ** though the rowid/docid lookup is faster than a MATCH query, selecting ** it would lead to an "unable to use function MATCH in the requested ** context" error. */ if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH && pCons->iColumn>=0 && pCons->iColumn<=p->nColumn ){ pInfo->idxNum = FTS3_FULLTEXT_SEARCH + pCons->iColumn; pInfo->estimatedCost = 2.0; iCons = i; } /* Equality constraint on the langid column */ if( pCons->op==SQLITE_INDEX_CONSTRAINT_EQ && pCons->iColumn==p->nColumn + 2 ){ iLangidCons = i; } if( bDocid ){ switch( pCons->op ){ case SQLITE_INDEX_CONSTRAINT_GE: case SQLITE_INDEX_CONSTRAINT_GT: iDocidGe = i; break; case SQLITE_INDEX_CONSTRAINT_LE: case SQLITE_INDEX_CONSTRAINT_LT: iDocidLe = i; break; } } } /* If using a docid=? or rowid=? strategy, set the UNIQUE flag. */ if( pInfo->idxNum==FTS3_DOCID_SEARCH ) fts3SetUniqueFlag(pInfo); iIdx = 1; if( iCons>=0 ){ pInfo->aConstraintUsage[iCons].argvIndex = iIdx++; pInfo->aConstraintUsage[iCons].omit = 1; } if( iLangidCons>=0 ){ pInfo->idxNum |= FTS3_HAVE_LANGID; pInfo->aConstraintUsage[iLangidCons].argvIndex = iIdx++; } if( iDocidGe>=0 ){ pInfo->idxNum |= FTS3_HAVE_DOCID_GE; pInfo->aConstraintUsage[iDocidGe].argvIndex = iIdx++; } if( iDocidLe>=0 ){ pInfo->idxNum |= FTS3_HAVE_DOCID_LE; pInfo->aConstraintUsage[iDocidLe].argvIndex = iIdx++; } /* Regardless of the strategy selected, FTS can deliver rows in rowid (or ** docid) order. Both ascending and descending are possible. */ if( pInfo->nOrderBy==1 ){ struct sqlite3_index_orderby *pOrder = &pInfo->aOrderBy[0]; if( pOrder->iColumn<0 || pOrder->iColumn==p->nColumn+1 ){ if( pOrder->desc ){ pInfo->idxStr = "DESC"; }else{ pInfo->idxStr = "ASC"; } pInfo->orderByConsumed = 1; } } assert( p->pSegments==0 ); return SQLITE_OK; } /* ** Implementation of xOpen method. */ static int fts3OpenMethod(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr){ sqlite3_vtab_cursor *pCsr; /* Allocated cursor */ UNUSED_PARAMETER(pVTab); /* Allocate a buffer large enough for an Fts3Cursor structure. If the ** allocation succeeds, zero it and return SQLITE_OK. Otherwise, ** if the allocation fails, return SQLITE_NOMEM. */ *ppCsr = pCsr = (sqlite3_vtab_cursor *)sqlite3_malloc(sizeof(Fts3Cursor)); if( !pCsr ){ return SQLITE_NOMEM; } memset(pCsr, 0, sizeof(Fts3Cursor)); return SQLITE_OK; } /* ** Finalize the statement handle at pCsr->pStmt. ** ** Or, if that statement handle is one created by fts3CursorSeekStmt(), ** and the Fts3Table.pSeekStmt slot is currently NULL, save the statement ** pointer there instead of finalizing it. */ static void fts3CursorFinalizeStmt(Fts3Cursor *pCsr){ if( pCsr->bSeekStmt ){ Fts3Table *p = (Fts3Table *)pCsr->base.pVtab; if( p->pSeekStmt==0 ){ p->pSeekStmt = pCsr->pStmt; sqlite3_reset(pCsr->pStmt); pCsr->pStmt = 0; } pCsr->bSeekStmt = 0; } sqlite3_finalize(pCsr->pStmt); } /* ** Free all resources currently held by the cursor passed as the only ** argument. */ static void fts3ClearCursor(Fts3Cursor *pCsr){ fts3CursorFinalizeStmt(pCsr); sqlite3Fts3FreeDeferredTokens(pCsr); sqlite3_free(pCsr->aDoclist); sqlite3Fts3MIBufferFree(pCsr->pMIBuffer); sqlite3Fts3ExprFree(pCsr->pExpr); memset(&(&pCsr->base)[1], 0, sizeof(Fts3Cursor)-sizeof(sqlite3_vtab_cursor)); } /* ** Close the cursor. For additional information see the documentation ** on the xClose method of the virtual table interface. */ static int fts3CloseMethod(sqlite3_vtab_cursor *pCursor){ Fts3Cursor *pCsr = (Fts3Cursor *)pCursor; assert( ((Fts3Table *)pCsr->base.pVtab)->pSegments==0 ); fts3ClearCursor(pCsr); assert( ((Fts3Table *)pCsr->base.pVtab)->pSegments==0 ); sqlite3_free(pCsr); return SQLITE_OK; } /* ** If pCsr->pStmt has not been prepared (i.e. if pCsr->pStmt==0), then ** compose and prepare an SQL statement of the form: ** ** "SELECT FROM %_content WHERE rowid = ?" ** ** (or the equivalent for a content=xxx table) and set pCsr->pStmt to ** it. If an error occurs, return an SQLite error code. */ static int fts3CursorSeekStmt(Fts3Cursor *pCsr){ int rc = SQLITE_OK; if( pCsr->pStmt==0 ){ Fts3Table *p = (Fts3Table *)pCsr->base.pVtab; char *zSql; if( p->pSeekStmt ){ pCsr->pStmt = p->pSeekStmt; p->pSeekStmt = 0; }else{ zSql = sqlite3_mprintf("SELECT %s WHERE rowid = ?", p->zReadExprlist); if( !zSql ) return SQLITE_NOMEM; rc = sqlite3_prepare_v3(p->db, zSql,-1,SQLITE_PREPARE_PERSISTENT,&pCsr->pStmt,0); sqlite3_free(zSql); } if( rc==SQLITE_OK ) pCsr->bSeekStmt = 1; } return rc; } /* ** Position the pCsr->pStmt statement so that it is on the row ** of the %_content table that contains the last match. Return ** SQLITE_OK on success. */ static int fts3CursorSeek(sqlite3_context *pContext, Fts3Cursor *pCsr){ int rc = SQLITE_OK; if( pCsr->isRequireSeek ){ rc = fts3CursorSeekStmt(pCsr); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pCsr->pStmt, 1, pCsr->iPrevId); pCsr->isRequireSeek = 0; if( SQLITE_ROW==sqlite3_step(pCsr->pStmt) ){ return SQLITE_OK; }else{ rc = sqlite3_reset(pCsr->pStmt); if( rc==SQLITE_OK && ((Fts3Table *)pCsr->base.pVtab)->zContentTbl==0 ){ /* If no row was found and no error has occurred, then the %_content ** table is missing a row that is present in the full-text index. ** The data structures are corrupt. */ rc = FTS_CORRUPT_VTAB; pCsr->isEof = 1; } } } } if( rc!=SQLITE_OK && pContext ){ sqlite3_result_error_code(pContext, rc); } return rc; } /* ** This function is used to process a single interior node when searching ** a b-tree for a term or term prefix. The node data is passed to this ** function via the zNode/nNode parameters. The term to search for is ** passed in zTerm/nTerm. ** ** If piFirst is not NULL, then this function sets *piFirst to the blockid ** of the child node that heads the sub-tree that may contain the term. ** ** If piLast is not NULL, then *piLast is set to the right-most child node ** that heads a sub-tree that may contain a term for which zTerm/nTerm is ** a prefix. ** ** If an OOM error occurs, SQLITE_NOMEM is returned. Otherwise, SQLITE_OK. */ static int fts3ScanInteriorNode( const char *zTerm, /* Term to select leaves for */ int nTerm, /* Size of term zTerm in bytes */ const char *zNode, /* Buffer containing segment interior node */ int nNode, /* Size of buffer at zNode */ sqlite3_int64 *piFirst, /* OUT: Selected child node */ sqlite3_int64 *piLast /* OUT: Selected child node */ ){ int rc = SQLITE_OK; /* Return code */ const char *zCsr = zNode; /* Cursor to iterate through node */ const char *zEnd = &zCsr[nNode];/* End of interior node buffer */ char *zBuffer = 0; /* Buffer to load terms into */ int nAlloc = 0; /* Size of allocated buffer */ int isFirstTerm = 1; /* True when processing first term on page */ sqlite3_int64 iChild; /* Block id of child node to descend to */ /* Skip over the 'height' varint that occurs at the start of every ** interior node. Then load the blockid of the left-child of the b-tree ** node into variable iChild. ** ** Even if the data structure on disk is corrupted, this (reading two ** varints from the buffer) does not risk an overread. If zNode is a ** root node, then the buffer comes from a SELECT statement. SQLite does ** not make this guarantee explicitly, but in practice there are always ** either more than 20 bytes of allocated space following the nNode bytes of ** contents, or two zero bytes. Or, if the node is read from the %_segments ** table, then there are always 20 bytes of zeroed padding following the ** nNode bytes of content (see sqlite3Fts3ReadBlock() for details). */ zCsr += sqlite3Fts3GetVarint(zCsr, &iChild); zCsr += sqlite3Fts3GetVarint(zCsr, &iChild); if( zCsr>zEnd ){ return FTS_CORRUPT_VTAB; } while( zCsr=0 && nSuffix>=0 ); if( &zCsr[nSuffix]>zEnd ){ rc = FTS_CORRUPT_VTAB; goto finish_scan; } if( nPrefix+nSuffix>nAlloc ){ char *zNew; nAlloc = (nPrefix+nSuffix) * 2; zNew = (char *)sqlite3_realloc(zBuffer, nAlloc); if( !zNew ){ rc = SQLITE_NOMEM; goto finish_scan; } zBuffer = zNew; } assert( zBuffer ); memcpy(&zBuffer[nPrefix], zCsr, nSuffix); nBuffer = nPrefix + nSuffix; zCsr += nSuffix; /* Compare the term we are searching for with the term just loaded from ** the interior node. If the specified term is greater than or equal ** to the term from the interior node, then all terms on the sub-tree ** headed by node iChild are smaller than zTerm. No need to search ** iChild. ** ** If the interior node term is larger than the specified term, then ** the tree headed by iChild may contain the specified term. */ cmp = memcmp(zTerm, zBuffer, (nBuffer>nTerm ? nTerm : nBuffer)); if( piFirst && (cmp<0 || (cmp==0 && nBuffer>nTerm)) ){ *piFirst = iChild; piFirst = 0; } if( piLast && cmp<0 ){ *piLast = iChild; piLast = 0; } iChild++; }; if( piFirst ) *piFirst = iChild; if( piLast ) *piLast = iChild; finish_scan: sqlite3_free(zBuffer); return rc; } /* ** The buffer pointed to by argument zNode (size nNode bytes) contains an ** interior node of a b-tree segment. The zTerm buffer (size nTerm bytes) ** contains a term. This function searches the sub-tree headed by the zNode ** node for the range of leaf nodes that may contain the specified term ** or terms for which the specified term is a prefix. ** ** If piLeaf is not NULL, then *piLeaf is set to the blockid of the ** left-most leaf node in the tree that may contain the specified term. ** If piLeaf2 is not NULL, then *piLeaf2 is set to the blockid of the ** right-most leaf node that may contain a term for which the specified ** term is a prefix. ** ** It is possible that the range of returned leaf nodes does not contain ** the specified term or any terms for which it is a prefix. However, if the ** segment does contain any such terms, they are stored within the identified ** range. Because this function only inspects interior segment nodes (and ** never loads leaf nodes into memory), it is not possible to be sure. ** ** If an error occurs, an error code other than SQLITE_OK is returned. */ static int fts3SelectLeaf( Fts3Table *p, /* Virtual table handle */ const char *zTerm, /* Term to select leaves for */ int nTerm, /* Size of term zTerm in bytes */ const char *zNode, /* Buffer containing segment interior node */ int nNode, /* Size of buffer at zNode */ sqlite3_int64 *piLeaf, /* Selected leaf node */ sqlite3_int64 *piLeaf2 /* Selected leaf node */ ){ int rc = SQLITE_OK; /* Return code */ int iHeight; /* Height of this node in tree */ assert( piLeaf || piLeaf2 ); fts3GetVarint32(zNode, &iHeight); rc = fts3ScanInteriorNode(zTerm, nTerm, zNode, nNode, piLeaf, piLeaf2); assert( !piLeaf2 || !piLeaf || rc!=SQLITE_OK || (*piLeaf<=*piLeaf2) ); if( rc==SQLITE_OK && iHeight>1 ){ char *zBlob = 0; /* Blob read from %_segments table */ int nBlob = 0; /* Size of zBlob in bytes */ if( piLeaf && piLeaf2 && (*piLeaf!=*piLeaf2) ){ rc = sqlite3Fts3ReadBlock(p, *piLeaf, &zBlob, &nBlob, 0); if( rc==SQLITE_OK ){ rc = fts3SelectLeaf(p, zTerm, nTerm, zBlob, nBlob, piLeaf, 0); } sqlite3_free(zBlob); piLeaf = 0; zBlob = 0; } if( rc==SQLITE_OK ){ rc = sqlite3Fts3ReadBlock(p, piLeaf?*piLeaf:*piLeaf2, &zBlob, &nBlob, 0); } if( rc==SQLITE_OK ){ rc = fts3SelectLeaf(p, zTerm, nTerm, zBlob, nBlob, piLeaf, piLeaf2); } sqlite3_free(zBlob); } return rc; } /* ** This function is used to create delta-encoded serialized lists of FTS3 ** varints. Each call to this function appends a single varint to a list. */ static void fts3PutDeltaVarint( char **pp, /* IN/OUT: Output pointer */ sqlite3_int64 *piPrev, /* IN/OUT: Previous value written to list */ sqlite3_int64 iVal /* Write this value to the list */ ){ assert( iVal-*piPrev > 0 || (*piPrev==0 && iVal==0) ); *pp += sqlite3Fts3PutVarint(*pp, iVal-*piPrev); *piPrev = iVal; } /* ** When this function is called, *ppPoslist is assumed to point to the ** start of a position-list. After it returns, *ppPoslist points to the ** first byte after the position-list. ** ** A position list is list of positions (delta encoded) and columns for ** a single document record of a doclist. So, in other words, this ** routine advances *ppPoslist so that it points to the next docid in ** the doclist, or to the first byte past the end of the doclist. ** ** If pp is not NULL, then the contents of the position list are copied ** to *pp. *pp is set to point to the first byte past the last byte copied ** before this function returns. */ static void fts3PoslistCopy(char **pp, char **ppPoslist){ char *pEnd = *ppPoslist; char c = 0; /* The end of a position list is marked by a zero encoded as an FTS3 ** varint. A single POS_END (0) byte. Except, if the 0 byte is preceded by ** a byte with the 0x80 bit set, then it is not a varint 0, but the tail ** of some other, multi-byte, value. ** ** The following while-loop moves pEnd to point to the first byte that is not ** immediately preceded by a byte with the 0x80 bit set. Then increments ** pEnd once more so that it points to the byte immediately following the ** last byte in the position-list. */ while( *pEnd | c ){ c = *pEnd++ & 0x80; testcase( c!=0 && (*pEnd)==0 ); } pEnd++; /* Advance past the POS_END terminator byte */ if( pp ){ int n = (int)(pEnd - *ppPoslist); char *p = *pp; memcpy(p, *ppPoslist, n); p += n; *pp = p; } *ppPoslist = pEnd; } /* ** When this function is called, *ppPoslist is assumed to point to the ** start of a column-list. After it returns, *ppPoslist points to the ** to the terminator (POS_COLUMN or POS_END) byte of the column-list. ** ** A column-list is list of delta-encoded positions for a single column ** within a single document within a doclist. ** ** The column-list is terminated either by a POS_COLUMN varint (1) or ** a POS_END varint (0). This routine leaves *ppPoslist pointing to ** the POS_COLUMN or POS_END that terminates the column-list. ** ** If pp is not NULL, then the contents of the column-list are copied ** to *pp. *pp is set to point to the first byte past the last byte copied ** before this function returns. The POS_COLUMN or POS_END terminator ** is not copied into *pp. */ static void fts3ColumnlistCopy(char **pp, char **ppPoslist){ char *pEnd = *ppPoslist; char c = 0; /* A column-list is terminated by either a 0x01 or 0x00 byte that is ** not part of a multi-byte varint. */ while( 0xFE & (*pEnd | c) ){ c = *pEnd++ & 0x80; testcase( c!=0 && ((*pEnd)&0xfe)==0 ); } if( pp ){ int n = (int)(pEnd - *ppPoslist); char *p = *pp; memcpy(p, *ppPoslist, n); p += n; *pp = p; } *ppPoslist = pEnd; } /* ** Value used to signify the end of an position-list. This is safe because ** it is not possible to have a document with 2^31 terms. */ #define POSITION_LIST_END 0x7fffffff /* ** This function is used to help parse position-lists. When this function is ** called, *pp may point to the start of the next varint in the position-list ** being parsed, or it may point to 1 byte past the end of the position-list ** (in which case **pp will be a terminator bytes POS_END (0) or ** (1)). ** ** If *pp points past the end of the current position-list, set *pi to ** POSITION_LIST_END and return. Otherwise, read the next varint from *pp, ** increment the current value of *pi by the value read, and set *pp to ** point to the next value before returning. ** ** Before calling this routine *pi must be initialized to the value of ** the previous position, or zero if we are reading the first position ** in the position-list. Because positions are delta-encoded, the value ** of the previous position is needed in order to compute the value of ** the next position. */ static void fts3ReadNextPos( char **pp, /* IN/OUT: Pointer into position-list buffer */ sqlite3_int64 *pi /* IN/OUT: Value read from position-list */ ){ if( (**pp)&0xFE ){ fts3GetDeltaVarint(pp, pi); *pi -= 2; }else{ *pi = POSITION_LIST_END; } } /* ** If parameter iCol is not 0, write an POS_COLUMN (1) byte followed by ** the value of iCol encoded as a varint to *pp. This will start a new ** column list. ** ** Set *pp to point to the byte just after the last byte written before ** returning (do not modify it if iCol==0). Return the total number of bytes ** written (0 if iCol==0). */ static int fts3PutColNumber(char **pp, int iCol){ int n = 0; /* Number of bytes written */ if( iCol ){ char *p = *pp; /* Output pointer */ n = 1 + sqlite3Fts3PutVarint(&p[1], iCol); *p = 0x01; *pp = &p[n]; } return n; } /* ** Compute the union of two position lists. The output written ** into *pp contains all positions of both *pp1 and *pp2 in sorted ** order and with any duplicates removed. All pointers are ** updated appropriately. The caller is responsible for insuring ** that there is enough space in *pp to hold the complete output. */ static void fts3PoslistMerge( char **pp, /* Output buffer */ char **pp1, /* Left input list */ char **pp2 /* Right input list */ ){ char *p = *pp; char *p1 = *pp1; char *p2 = *pp2; while( *p1 || *p2 ){ int iCol1; /* The current column index in pp1 */ int iCol2; /* The current column index in pp2 */ if( *p1==POS_COLUMN ) fts3GetVarint32(&p1[1], &iCol1); else if( *p1==POS_END ) iCol1 = POSITION_LIST_END; else iCol1 = 0; if( *p2==POS_COLUMN ) fts3GetVarint32(&p2[1], &iCol2); else if( *p2==POS_END ) iCol2 = POSITION_LIST_END; else iCol2 = 0; if( iCol1==iCol2 ){ sqlite3_int64 i1 = 0; /* Last position from pp1 */ sqlite3_int64 i2 = 0; /* Last position from pp2 */ sqlite3_int64 iPrev = 0; int n = fts3PutColNumber(&p, iCol1); p1 += n; p2 += n; /* At this point, both p1 and p2 point to the start of column-lists ** for the same column (the column with index iCol1 and iCol2). ** A column-list is a list of non-negative delta-encoded varints, each ** incremented by 2 before being stored. Each list is terminated by a ** POS_END (0) or POS_COLUMN (1). The following block merges the two lists ** and writes the results to buffer p. p is left pointing to the byte ** after the list written. No terminator (POS_END or POS_COLUMN) is ** written to the output. */ fts3GetDeltaVarint(&p1, &i1); fts3GetDeltaVarint(&p2, &i2); do { fts3PutDeltaVarint(&p, &iPrev, (i1pos(*pp1) && pos(*pp2)-pos(*pp1)<=nToken). i.e. ** when the *pp1 token appears before the *pp2 token, but not more than nToken ** slots before it. ** ** e.g. nToken==1 searches for adjacent positions. */ static int fts3PoslistPhraseMerge( char **pp, /* IN/OUT: Preallocated output buffer */ int nToken, /* Maximum difference in token positions */ int isSaveLeft, /* Save the left position */ int isExact, /* If *pp1 is exactly nTokens before *pp2 */ char **pp1, /* IN/OUT: Left input list */ char **pp2 /* IN/OUT: Right input list */ ){ char *p = *pp; char *p1 = *pp1; char *p2 = *pp2; int iCol1 = 0; int iCol2 = 0; /* Never set both isSaveLeft and isExact for the same invocation. */ assert( isSaveLeft==0 || isExact==0 ); assert( p!=0 && *p1!=0 && *p2!=0 ); if( *p1==POS_COLUMN ){ p1++; p1 += fts3GetVarint32(p1, &iCol1); } if( *p2==POS_COLUMN ){ p2++; p2 += fts3GetVarint32(p2, &iCol2); } while( 1 ){ if( iCol1==iCol2 ){ char *pSave = p; sqlite3_int64 iPrev = 0; sqlite3_int64 iPos1 = 0; sqlite3_int64 iPos2 = 0; if( iCol1 ){ *p++ = POS_COLUMN; p += sqlite3Fts3PutVarint(p, iCol1); } assert( *p1!=POS_END && *p1!=POS_COLUMN ); assert( *p2!=POS_END && *p2!=POS_COLUMN ); fts3GetDeltaVarint(&p1, &iPos1); iPos1 -= 2; fts3GetDeltaVarint(&p2, &iPos2); iPos2 -= 2; while( 1 ){ if( iPos2==iPos1+nToken || (isExact==0 && iPos2>iPos1 && iPos2<=iPos1+nToken) ){ sqlite3_int64 iSave; iSave = isSaveLeft ? iPos1 : iPos2; fts3PutDeltaVarint(&p, &iPrev, iSave+2); iPrev -= 2; pSave = 0; assert( p ); } if( (!isSaveLeft && iPos2<=(iPos1+nToken)) || iPos2<=iPos1 ){ if( (*p2&0xFE)==0 ) break; fts3GetDeltaVarint(&p2, &iPos2); iPos2 -= 2; }else{ if( (*p1&0xFE)==0 ) break; fts3GetDeltaVarint(&p1, &iPos1); iPos1 -= 2; } } if( pSave ){ assert( pp && p ); p = pSave; } fts3ColumnlistCopy(0, &p1); fts3ColumnlistCopy(0, &p2); assert( (*p1&0xFE)==0 && (*p2&0xFE)==0 ); if( 0==*p1 || 0==*p2 ) break; p1++; p1 += fts3GetVarint32(p1, &iCol1); p2++; p2 += fts3GetVarint32(p2, &iCol2); } /* Advance pointer p1 or p2 (whichever corresponds to the smaller of ** iCol1 and iCol2) so that it points to either the 0x00 that marks the ** end of the position list, or the 0x01 that precedes the next ** column-number in the position list. */ else if( iCol1=pEnd ){ *pp = 0; }else{ sqlite3_int64 iVal; *pp += sqlite3Fts3GetVarint(*pp, &iVal); if( bDescIdx ){ *pVal -= iVal; }else{ *pVal += iVal; } } } /* ** This function is used to write a single varint to a buffer. The varint ** is written to *pp. Before returning, *pp is set to point 1 byte past the ** end of the value written. ** ** If *pbFirst is zero when this function is called, the value written to ** the buffer is that of parameter iVal. ** ** If *pbFirst is non-zero when this function is called, then the value ** written is either (iVal-*piPrev) (if bDescIdx is zero) or (*piPrev-iVal) ** (if bDescIdx is non-zero). ** ** Before returning, this function always sets *pbFirst to 1 and *piPrev ** to the value of parameter iVal. */ static void fts3PutDeltaVarint3( char **pp, /* IN/OUT: Output pointer */ int bDescIdx, /* True for descending docids */ sqlite3_int64 *piPrev, /* IN/OUT: Previous value written to list */ int *pbFirst, /* IN/OUT: True after first int written */ sqlite3_int64 iVal /* Write this value to the list */ ){ sqlite3_int64 iWrite; if( bDescIdx==0 || *pbFirst==0 ){ iWrite = iVal - *piPrev; }else{ iWrite = *piPrev - iVal; } assert( *pbFirst || *piPrev==0 ); assert( *pbFirst==0 || iWrite>0 ); *pp += sqlite3Fts3PutVarint(*pp, iWrite); *piPrev = iVal; *pbFirst = 1; } /* ** This macro is used by various functions that merge doclists. The two ** arguments are 64-bit docid values. If the value of the stack variable ** bDescDoclist is 0 when this macro is invoked, then it returns (i1-i2). ** Otherwise, (i2-i1). ** ** Using this makes it easier to write code that can merge doclists that are ** sorted in either ascending or descending order. */ #define DOCID_CMP(i1, i2) ((bDescDoclist?-1:1) * (i1-i2)) /* ** This function does an "OR" merge of two doclists (output contains all ** positions contained in either argument doclist). If the docids in the ** input doclists are sorted in ascending order, parameter bDescDoclist ** should be false. If they are sorted in ascending order, it should be ** passed a non-zero value. ** ** If no error occurs, *paOut is set to point at an sqlite3_malloc'd buffer ** containing the output doclist and SQLITE_OK is returned. In this case ** *pnOut is set to the number of bytes in the output doclist. ** ** If an error occurs, an SQLite error code is returned. The output values ** are undefined in this case. */ static int fts3DoclistOrMerge( int bDescDoclist, /* True if arguments are desc */ char *a1, int n1, /* First doclist */ char *a2, int n2, /* Second doclist */ char **paOut, int *pnOut /* OUT: Malloc'd doclist */ ){ sqlite3_int64 i1 = 0; sqlite3_int64 i2 = 0; sqlite3_int64 iPrev = 0; char *pEnd1 = &a1[n1]; char *pEnd2 = &a2[n2]; char *p1 = a1; char *p2 = a2; char *p; char *aOut; int bFirstOut = 0; *paOut = 0; *pnOut = 0; /* Allocate space for the output. Both the input and output doclists ** are delta encoded. If they are in ascending order (bDescDoclist==0), ** then the first docid in each list is simply encoded as a varint. For ** each subsequent docid, the varint stored is the difference between the ** current and previous docid (a positive number - since the list is in ** ascending order). ** ** The first docid written to the output is therefore encoded using the ** same number of bytes as it is in whichever of the input lists it is ** read from. And each subsequent docid read from the same input list ** consumes either the same or less bytes as it did in the input (since ** the difference between it and the previous value in the output must ** be a positive value less than or equal to the delta value read from ** the input list). The same argument applies to all but the first docid ** read from the 'other' list. And to the contents of all position lists ** that will be copied and merged from the input to the output. ** ** However, if the first docid copied to the output is a negative number, ** then the encoding of the first docid from the 'other' input list may ** be larger in the output than it was in the input (since the delta value ** may be a larger positive integer than the actual docid). ** ** The space required to store the output is therefore the sum of the ** sizes of the two inputs, plus enough space for exactly one of the input ** docids to grow. ** ** A symetric argument may be made if the doclists are in descending ** order. */ aOut = sqlite3_malloc(n1+n2+FTS3_VARINT_MAX-1); if( !aOut ) return SQLITE_NOMEM; p = aOut; fts3GetDeltaVarint3(&p1, pEnd1, 0, &i1); fts3GetDeltaVarint3(&p2, pEnd2, 0, &i2); while( p1 || p2 ){ sqlite3_int64 iDiff = DOCID_CMP(i1, i2); if( p2 && p1 && iDiff==0 ){ fts3PutDeltaVarint3(&p, bDescDoclist, &iPrev, &bFirstOut, i1); fts3PoslistMerge(&p, &p1, &p2); fts3GetDeltaVarint3(&p1, pEnd1, bDescDoclist, &i1); fts3GetDeltaVarint3(&p2, pEnd2, bDescDoclist, &i2); }else if( !p2 || (p1 && iDiff<0) ){ fts3PutDeltaVarint3(&p, bDescDoclist, &iPrev, &bFirstOut, i1); fts3PoslistCopy(&p, &p1); fts3GetDeltaVarint3(&p1, pEnd1, bDescDoclist, &i1); }else{ fts3PutDeltaVarint3(&p, bDescDoclist, &iPrev, &bFirstOut, i2); fts3PoslistCopy(&p, &p2); fts3GetDeltaVarint3(&p2, pEnd2, bDescDoclist, &i2); } } *paOut = aOut; *pnOut = (int)(p-aOut); assert( *pnOut<=n1+n2+FTS3_VARINT_MAX-1 ); return SQLITE_OK; } /* ** This function does a "phrase" merge of two doclists. In a phrase merge, ** the output contains a copy of each position from the right-hand input ** doclist for which there is a position in the left-hand input doclist ** exactly nDist tokens before it. ** ** If the docids in the input doclists are sorted in ascending order, ** parameter bDescDoclist should be false. If they are sorted in ascending ** order, it should be passed a non-zero value. ** ** The right-hand input doclist is overwritten by this function. */ static int fts3DoclistPhraseMerge( int bDescDoclist, /* True if arguments are desc */ int nDist, /* Distance from left to right (1=adjacent) */ char *aLeft, int nLeft, /* Left doclist */ char **paRight, int *pnRight /* IN/OUT: Right/output doclist */ ){ sqlite3_int64 i1 = 0; sqlite3_int64 i2 = 0; sqlite3_int64 iPrev = 0; char *aRight = *paRight; char *pEnd1 = &aLeft[nLeft]; char *pEnd2 = &aRight[*pnRight]; char *p1 = aLeft; char *p2 = aRight; char *p; int bFirstOut = 0; char *aOut; assert( nDist>0 ); if( bDescDoclist ){ aOut = sqlite3_malloc(*pnRight + FTS3_VARINT_MAX); if( aOut==0 ) return SQLITE_NOMEM; }else{ aOut = aRight; } p = aOut; fts3GetDeltaVarint3(&p1, pEnd1, 0, &i1); fts3GetDeltaVarint3(&p2, pEnd2, 0, &i2); while( p1 && p2 ){ sqlite3_int64 iDiff = DOCID_CMP(i1, i2); if( iDiff==0 ){ char *pSave = p; sqlite3_int64 iPrevSave = iPrev; int bFirstOutSave = bFirstOut; fts3PutDeltaVarint3(&p, bDescDoclist, &iPrev, &bFirstOut, i1); if( 0==fts3PoslistPhraseMerge(&p, nDist, 0, 1, &p1, &p2) ){ p = pSave; iPrev = iPrevSave; bFirstOut = bFirstOutSave; } fts3GetDeltaVarint3(&p1, pEnd1, bDescDoclist, &i1); fts3GetDeltaVarint3(&p2, pEnd2, bDescDoclist, &i2); }else if( iDiff<0 ){ fts3PoslistCopy(0, &p1); fts3GetDeltaVarint3(&p1, pEnd1, bDescDoclist, &i1); }else{ fts3PoslistCopy(0, &p2); fts3GetDeltaVarint3(&p2, pEnd2, bDescDoclist, &i2); } } *pnRight = (int)(p - aOut); if( bDescDoclist ){ sqlite3_free(aRight); *paRight = aOut; } return SQLITE_OK; } /* ** Argument pList points to a position list nList bytes in size. This ** function checks to see if the position list contains any entries for ** a token in position 0 (of any column). If so, it writes argument iDelta ** to the output buffer pOut, followed by a position list consisting only ** of the entries from pList at position 0, and terminated by an 0x00 byte. ** The value returned is the number of bytes written to pOut (if any). */ int sqlite3Fts3FirstFilter( sqlite3_int64 iDelta, /* Varint that may be written to pOut */ char *pList, /* Position list (no 0x00 term) */ int nList, /* Size of pList in bytes */ char *pOut /* Write output here */ ){ int nOut = 0; int bWritten = 0; /* True once iDelta has been written */ char *p = pList; char *pEnd = &pList[nList]; if( *p!=0x01 ){ if( *p==0x02 ){ nOut += sqlite3Fts3PutVarint(&pOut[nOut], iDelta); pOut[nOut++] = 0x02; bWritten = 1; } fts3ColumnlistCopy(0, &p); } while( paaOutput); i++){ if( pTS->aaOutput[i] ){ if( !aOut ){ aOut = pTS->aaOutput[i]; nOut = pTS->anOutput[i]; pTS->aaOutput[i] = 0; }else{ int nNew; char *aNew; int rc = fts3DoclistOrMerge(p->bDescIdx, pTS->aaOutput[i], pTS->anOutput[i], aOut, nOut, &aNew, &nNew ); if( rc!=SQLITE_OK ){ sqlite3_free(aOut); return rc; } sqlite3_free(pTS->aaOutput[i]); sqlite3_free(aOut); pTS->aaOutput[i] = 0; aOut = aNew; nOut = nNew; } } } pTS->aaOutput[0] = aOut; pTS->anOutput[0] = nOut; return SQLITE_OK; } /* ** Merge the doclist aDoclist/nDoclist into the TermSelect object passed ** as the first argument. The merge is an "OR" merge (see function ** fts3DoclistOrMerge() for details). ** ** This function is called with the doclist for each term that matches ** a queried prefix. It merges all these doclists into one, the doclist ** for the specified prefix. Since there can be a very large number of ** doclists to merge, the merging is done pair-wise using the TermSelect ** object. ** ** This function returns SQLITE_OK if the merge is successful, or an ** SQLite error code (SQLITE_NOMEM) if an error occurs. */ static int fts3TermSelectMerge( Fts3Table *p, /* FTS table handle */ TermSelect *pTS, /* TermSelect object to merge into */ char *aDoclist, /* Pointer to doclist */ int nDoclist /* Size of aDoclist in bytes */ ){ if( pTS->aaOutput[0]==0 ){ /* If this is the first term selected, copy the doclist to the output ** buffer using memcpy(). ** ** Add FTS3_VARINT_MAX bytes of unused space to the end of the ** allocation. This is so as to ensure that the buffer is big enough ** to hold the current doclist AND'd with any other doclist. If the ** doclists are stored in order=ASC order, this padding would not be ** required (since the size of [doclistA AND doclistB] is always less ** than or equal to the size of [doclistA] in that case). But this is ** not true for order=DESC. For example, a doclist containing (1, -1) ** may be smaller than (-1), as in the first example the -1 may be stored ** as a single-byte delta, whereas in the second it must be stored as a ** FTS3_VARINT_MAX byte varint. ** ** Similar padding is added in the fts3DoclistOrMerge() function. */ pTS->aaOutput[0] = sqlite3_malloc(nDoclist + FTS3_VARINT_MAX + 1); pTS->anOutput[0] = nDoclist; if( pTS->aaOutput[0] ){ memcpy(pTS->aaOutput[0], aDoclist, nDoclist); }else{ return SQLITE_NOMEM; } }else{ char *aMerge = aDoclist; int nMerge = nDoclist; int iOut; for(iOut=0; iOutaaOutput); iOut++){ if( pTS->aaOutput[iOut]==0 ){ assert( iOut>0 ); pTS->aaOutput[iOut] = aMerge; pTS->anOutput[iOut] = nMerge; break; }else{ char *aNew; int nNew; int rc = fts3DoclistOrMerge(p->bDescIdx, aMerge, nMerge, pTS->aaOutput[iOut], pTS->anOutput[iOut], &aNew, &nNew ); if( rc!=SQLITE_OK ){ if( aMerge!=aDoclist ) sqlite3_free(aMerge); return rc; } if( aMerge!=aDoclist ) sqlite3_free(aMerge); sqlite3_free(pTS->aaOutput[iOut]); pTS->aaOutput[iOut] = 0; aMerge = aNew; nMerge = nNew; if( (iOut+1)==SizeofArray(pTS->aaOutput) ){ pTS->aaOutput[iOut] = aMerge; pTS->anOutput[iOut] = nMerge; } } } } return SQLITE_OK; } /* ** Append SegReader object pNew to the end of the pCsr->apSegment[] array. */ static int fts3SegReaderCursorAppend( Fts3MultiSegReader *pCsr, Fts3SegReader *pNew ){ if( (pCsr->nSegment%16)==0 ){ Fts3SegReader **apNew; int nByte = (pCsr->nSegment + 16)*sizeof(Fts3SegReader*); apNew = (Fts3SegReader **)sqlite3_realloc(pCsr->apSegment, nByte); if( !apNew ){ sqlite3Fts3SegReaderFree(pNew); return SQLITE_NOMEM; } pCsr->apSegment = apNew; } pCsr->apSegment[pCsr->nSegment++] = pNew; return SQLITE_OK; } /* ** Add seg-reader objects to the Fts3MultiSegReader object passed as the ** 8th argument. ** ** This function returns SQLITE_OK if successful, or an SQLite error code ** otherwise. */ static int fts3SegReaderCursor( Fts3Table *p, /* FTS3 table handle */ int iLangid, /* Language id */ int iIndex, /* Index to search (from 0 to p->nIndex-1) */ int iLevel, /* Level of segments to scan */ const char *zTerm, /* Term to query for */ int nTerm, /* Size of zTerm in bytes */ int isPrefix, /* True for a prefix search */ int isScan, /* True to scan from zTerm to EOF */ Fts3MultiSegReader *pCsr /* Cursor object to populate */ ){ int rc = SQLITE_OK; /* Error code */ sqlite3_stmt *pStmt = 0; /* Statement to iterate through segments */ int rc2; /* Result of sqlite3_reset() */ /* If iLevel is less than 0 and this is not a scan, include a seg-reader ** for the pending-terms. If this is a scan, then this call must be being ** made by an fts4aux module, not an FTS table. In this case calling ** Fts3SegReaderPending might segfault, as the data structures used by ** fts4aux are not completely populated. So it's easiest to filter these ** calls out here. */ if( iLevel<0 && p->aIndex ){ Fts3SegReader *pSeg = 0; rc = sqlite3Fts3SegReaderPending(p, iIndex, zTerm, nTerm, isPrefix||isScan, &pSeg); if( rc==SQLITE_OK && pSeg ){ rc = fts3SegReaderCursorAppend(pCsr, pSeg); } } if( iLevel!=FTS3_SEGCURSOR_PENDING ){ if( rc==SQLITE_OK ){ rc = sqlite3Fts3AllSegdirs(p, iLangid, iIndex, iLevel, &pStmt); } while( rc==SQLITE_OK && SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){ Fts3SegReader *pSeg = 0; /* Read the values returned by the SELECT into local variables. */ sqlite3_int64 iStartBlock = sqlite3_column_int64(pStmt, 1); sqlite3_int64 iLeavesEndBlock = sqlite3_column_int64(pStmt, 2); sqlite3_int64 iEndBlock = sqlite3_column_int64(pStmt, 3); int nRoot = sqlite3_column_bytes(pStmt, 4); char const *zRoot = sqlite3_column_blob(pStmt, 4); /* If zTerm is not NULL, and this segment is not stored entirely on its ** root node, the range of leaves scanned can be reduced. Do this. */ if( iStartBlock && zTerm ){ sqlite3_int64 *pi = (isPrefix ? &iLeavesEndBlock : 0); rc = fts3SelectLeaf(p, zTerm, nTerm, zRoot, nRoot, &iStartBlock, pi); if( rc!=SQLITE_OK ) goto finished; if( isPrefix==0 && isScan==0 ) iLeavesEndBlock = iStartBlock; } rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1, (isPrefix==0 && isScan==0), iStartBlock, iLeavesEndBlock, iEndBlock, zRoot, nRoot, &pSeg ); if( rc!=SQLITE_OK ) goto finished; rc = fts3SegReaderCursorAppend(pCsr, pSeg); } } finished: rc2 = sqlite3_reset(pStmt); if( rc==SQLITE_DONE ) rc = rc2; return rc; } /* ** Set up a cursor object for iterating through a full-text index or a ** single level therein. */ int sqlite3Fts3SegReaderCursor( Fts3Table *p, /* FTS3 table handle */ int iLangid, /* Language-id to search */ int iIndex, /* Index to search (from 0 to p->nIndex-1) */ int iLevel, /* Level of segments to scan */ const char *zTerm, /* Term to query for */ int nTerm, /* Size of zTerm in bytes */ int isPrefix, /* True for a prefix search */ int isScan, /* True to scan from zTerm to EOF */ Fts3MultiSegReader *pCsr /* Cursor object to populate */ ){ assert( iIndex>=0 && iIndexnIndex ); assert( iLevel==FTS3_SEGCURSOR_ALL || iLevel==FTS3_SEGCURSOR_PENDING || iLevel>=0 ); assert( iLevelbase.pVtab; if( isPrefix ){ for(i=1; bFound==0 && inIndex; i++){ if( p->aIndex[i].nPrefix==nTerm ){ bFound = 1; rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, i, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 0, 0, pSegcsr ); pSegcsr->bLookup = 1; } } for(i=1; bFound==0 && inIndex; i++){ if( p->aIndex[i].nPrefix==nTerm+1 ){ bFound = 1; rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, i, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 1, 0, pSegcsr ); if( rc==SQLITE_OK ){ rc = fts3SegReaderCursorAddZero( p, pCsr->iLangid, zTerm, nTerm, pSegcsr ); } } } } if( bFound==0 ){ rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, 0, FTS3_SEGCURSOR_ALL, zTerm, nTerm, isPrefix, 0, pSegcsr ); pSegcsr->bLookup = !isPrefix; } } *ppSegcsr = pSegcsr; return rc; } /* ** Free an Fts3MultiSegReader allocated by fts3TermSegReaderCursor(). */ static void fts3SegReaderCursorFree(Fts3MultiSegReader *pSegcsr){ sqlite3Fts3SegReaderFinish(pSegcsr); sqlite3_free(pSegcsr); } /* ** This function retrieves the doclist for the specified term (or term ** prefix) from the database. */ static int fts3TermSelect( Fts3Table *p, /* Virtual table handle */ Fts3PhraseToken *pTok, /* Token to query for */ int iColumn, /* Column to query (or -ve for all columns) */ int *pnOut, /* OUT: Size of buffer at *ppOut */ char **ppOut /* OUT: Malloced result buffer */ ){ int rc; /* Return code */ Fts3MultiSegReader *pSegcsr; /* Seg-reader cursor for this term */ TermSelect tsc; /* Object for pair-wise doclist merging */ Fts3SegFilter filter; /* Segment term filter configuration */ pSegcsr = pTok->pSegcsr; memset(&tsc, 0, sizeof(TermSelect)); filter.flags = FTS3_SEGMENT_IGNORE_EMPTY | FTS3_SEGMENT_REQUIRE_POS | (pTok->isPrefix ? FTS3_SEGMENT_PREFIX : 0) | (pTok->bFirst ? FTS3_SEGMENT_FIRST : 0) | (iColumnnColumn ? FTS3_SEGMENT_COLUMN_FILTER : 0); filter.iCol = iColumn; filter.zTerm = pTok->z; filter.nTerm = pTok->n; rc = sqlite3Fts3SegReaderStart(p, pSegcsr, &filter); while( SQLITE_OK==rc && SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, pSegcsr)) ){ rc = fts3TermSelectMerge(p, &tsc, pSegcsr->aDoclist, pSegcsr->nDoclist); } if( rc==SQLITE_OK ){ rc = fts3TermSelectFinishMerge(p, &tsc); } if( rc==SQLITE_OK ){ *ppOut = tsc.aaOutput[0]; *pnOut = tsc.anOutput[0]; }else{ int i; for(i=0; ipSegcsr = 0; return rc; } /* ** This function counts the total number of docids in the doclist stored ** in buffer aList[], size nList bytes. ** ** If the isPoslist argument is true, then it is assumed that the doclist ** contains a position-list following each docid. Otherwise, it is assumed ** that the doclist is simply a list of docids stored as delta encoded ** varints. */ static int fts3DoclistCountDocids(char *aList, int nList){ int nDoc = 0; /* Return value */ if( aList ){ char *aEnd = &aList[nList]; /* Pointer to one byte after EOF */ char *p = aList; /* Cursor */ while( peSearch==FTS3_DOCID_SEARCH || pCsr->eSearch==FTS3_FULLSCAN_SEARCH ){ if( SQLITE_ROW!=sqlite3_step(pCsr->pStmt) ){ pCsr->isEof = 1; rc = sqlite3_reset(pCsr->pStmt); }else{ pCsr->iPrevId = sqlite3_column_int64(pCsr->pStmt, 0); rc = SQLITE_OK; } }else{ rc = fts3EvalNext((Fts3Cursor *)pCursor); } assert( ((Fts3Table *)pCsr->base.pVtab)->pSegments==0 ); return rc; } /* ** The following are copied from sqliteInt.h. ** ** Constants for the largest and smallest possible 64-bit signed integers. ** These macros are designed to work correctly on both 32-bit and 64-bit ** compilers. */ #ifndef SQLITE_AMALGAMATION # define LARGEST_INT64 (0xffffffff|(((sqlite3_int64)0x7fffffff)<<32)) # define SMALLEST_INT64 (((sqlite3_int64)-1) - LARGEST_INT64) #endif /* ** If the numeric type of argument pVal is "integer", then return it ** converted to a 64-bit signed integer. Otherwise, return a copy of ** the second parameter, iDefault. */ static sqlite3_int64 fts3DocidRange(sqlite3_value *pVal, i64 iDefault){ if( pVal ){ int eType = sqlite3_value_numeric_type(pVal); if( eType==SQLITE_INTEGER ){ return sqlite3_value_int64(pVal); } } return iDefault; } /* ** This is the xFilter interface for the virtual table. See ** the virtual table xFilter method documentation for additional ** information. ** ** If idxNum==FTS3_FULLSCAN_SEARCH then do a full table scan against ** the %_content table. ** ** If idxNum==FTS3_DOCID_SEARCH then do a docid lookup for a single entry ** in the %_content table. ** ** If idxNum>=FTS3_FULLTEXT_SEARCH then use the full text index. The ** column on the left-hand side of the MATCH operator is column ** number idxNum-FTS3_FULLTEXT_SEARCH, 0 indexed. argv[0] is the right-hand ** side of the MATCH operator. */ static int fts3FilterMethod( sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */ int idxNum, /* Strategy index */ const char *idxStr, /* Unused */ int nVal, /* Number of elements in apVal */ sqlite3_value **apVal /* Arguments for the indexing scheme */ ){ int rc = SQLITE_OK; char *zSql; /* SQL statement used to access %_content */ int eSearch; Fts3Table *p = (Fts3Table *)pCursor->pVtab; Fts3Cursor *pCsr = (Fts3Cursor *)pCursor; sqlite3_value *pCons = 0; /* The MATCH or rowid constraint, if any */ sqlite3_value *pLangid = 0; /* The "langid = ?" constraint, if any */ sqlite3_value *pDocidGe = 0; /* The "docid >= ?" constraint, if any */ sqlite3_value *pDocidLe = 0; /* The "docid <= ?" constraint, if any */ int iIdx; UNUSED_PARAMETER(idxStr); UNUSED_PARAMETER(nVal); eSearch = (idxNum & 0x0000FFFF); assert( eSearch>=0 && eSearch<=(FTS3_FULLTEXT_SEARCH+p->nColumn) ); assert( p->pSegments==0 ); /* Collect arguments into local variables */ iIdx = 0; if( eSearch!=FTS3_FULLSCAN_SEARCH ) pCons = apVal[iIdx++]; if( idxNum & FTS3_HAVE_LANGID ) pLangid = apVal[iIdx++]; if( idxNum & FTS3_HAVE_DOCID_GE ) pDocidGe = apVal[iIdx++]; if( idxNum & FTS3_HAVE_DOCID_LE ) pDocidLe = apVal[iIdx++]; assert( iIdx==nVal ); /* In case the cursor has been used before, clear it now. */ fts3ClearCursor(pCsr); /* Set the lower and upper bounds on docids to return */ pCsr->iMinDocid = fts3DocidRange(pDocidGe, SMALLEST_INT64); pCsr->iMaxDocid = fts3DocidRange(pDocidLe, LARGEST_INT64); if( idxStr ){ pCsr->bDesc = (idxStr[0]=='D'); }else{ pCsr->bDesc = p->bDescIdx; } pCsr->eSearch = (i16)eSearch; if( eSearch!=FTS3_DOCID_SEARCH && eSearch!=FTS3_FULLSCAN_SEARCH ){ int iCol = eSearch-FTS3_FULLTEXT_SEARCH; const char *zQuery = (const char *)sqlite3_value_text(pCons); if( zQuery==0 && sqlite3_value_type(pCons)!=SQLITE_NULL ){ return SQLITE_NOMEM; } pCsr->iLangid = 0; if( pLangid ) pCsr->iLangid = sqlite3_value_int(pLangid); assert( p->base.zErrMsg==0 ); rc = sqlite3Fts3ExprParse(p->pTokenizer, pCsr->iLangid, p->azColumn, p->bFts4, p->nColumn, iCol, zQuery, -1, &pCsr->pExpr, &p->base.zErrMsg ); if( rc!=SQLITE_OK ){ return rc; } rc = fts3EvalStart(pCsr); sqlite3Fts3SegmentsClose(p); if( rc!=SQLITE_OK ) return rc; pCsr->pNextId = pCsr->aDoclist; pCsr->iPrevId = 0; } /* Compile a SELECT statement for this cursor. For a full-table-scan, the ** statement loops through all rows of the %_content table. For a ** full-text query or docid lookup, the statement retrieves a single ** row by docid. */ if( eSearch==FTS3_FULLSCAN_SEARCH ){ if( pDocidGe || pDocidLe ){ zSql = sqlite3_mprintf( "SELECT %s WHERE rowid BETWEEN %lld AND %lld ORDER BY rowid %s", p->zReadExprlist, pCsr->iMinDocid, pCsr->iMaxDocid, (pCsr->bDesc ? "DESC" : "ASC") ); }else{ zSql = sqlite3_mprintf("SELECT %s ORDER BY rowid %s", p->zReadExprlist, (pCsr->bDesc ? "DESC" : "ASC") ); } if( zSql ){ rc = sqlite3_prepare_v3(p->db,zSql,-1,SQLITE_PREPARE_PERSISTENT,&pCsr->pStmt,0); sqlite3_free(zSql); }else{ rc = SQLITE_NOMEM; } }else if( eSearch==FTS3_DOCID_SEARCH ){ rc = fts3CursorSeekStmt(pCsr); if( rc==SQLITE_OK ){ rc = sqlite3_bind_value(pCsr->pStmt, 1, pCons); } } if( rc!=SQLITE_OK ) return rc; return fts3NextMethod(pCursor); } /* ** This is the xEof method of the virtual table. SQLite calls this ** routine to find out if it has reached the end of a result set. */ static int fts3EofMethod(sqlite3_vtab_cursor *pCursor){ Fts3Cursor *pCsr = (Fts3Cursor*)pCursor; if( pCsr->isEof ){ fts3ClearCursor(pCsr); pCsr->isEof = 1; } return pCsr->isEof; } /* ** This is the xRowid method. The SQLite core calls this routine to ** retrieve the rowid for the current row of the result set. fts3 ** exposes %_content.docid as the rowid for the virtual table. The ** rowid should be written to *pRowid. */ static int fts3RowidMethod(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ Fts3Cursor *pCsr = (Fts3Cursor *) pCursor; *pRowid = pCsr->iPrevId; return SQLITE_OK; } /* ** This is the xColumn method, called by SQLite to request a value from ** the row that the supplied cursor currently points to. ** ** If: ** ** (iCol < p->nColumn) -> The value of the iCol'th user column. ** (iCol == p->nColumn) -> Magic column with the same name as the table. ** (iCol == p->nColumn+1) -> Docid column ** (iCol == p->nColumn+2) -> Langid column */ static int fts3ColumnMethod( sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ sqlite3_context *pCtx, /* Context for sqlite3_result_xxx() calls */ int iCol /* Index of column to read value from */ ){ int rc = SQLITE_OK; /* Return Code */ Fts3Cursor *pCsr = (Fts3Cursor *) pCursor; Fts3Table *p = (Fts3Table *)pCursor->pVtab; /* The column value supplied by SQLite must be in range. */ assert( iCol>=0 && iCol<=p->nColumn+2 ); switch( iCol-p->nColumn ){ case 0: /* The special 'table-name' column */ sqlite3_result_pointer(pCtx, pCsr, "fts3cursor", 0); break; case 1: /* The docid column */ sqlite3_result_int64(pCtx, pCsr->iPrevId); break; case 2: if( pCsr->pExpr ){ sqlite3_result_int64(pCtx, pCsr->iLangid); break; }else if( p->zLanguageid==0 ){ sqlite3_result_int(pCtx, 0); break; }else{ iCol = p->nColumn; /* fall-through */ } default: /* A user column. Or, if this is a full-table scan, possibly the ** language-id column. Seek the cursor. */ rc = fts3CursorSeek(0, pCsr); if( rc==SQLITE_OK && sqlite3_data_count(pCsr->pStmt)-1>iCol ){ sqlite3_result_value(pCtx, sqlite3_column_value(pCsr->pStmt, iCol+1)); } break; } assert( ((Fts3Table *)pCsr->base.pVtab)->pSegments==0 ); return rc; } /* ** This function is the implementation of the xUpdate callback used by ** FTS3 virtual tables. It is invoked by SQLite each time a row is to be ** inserted, updated or deleted. */ static int fts3UpdateMethod( sqlite3_vtab *pVtab, /* Virtual table handle */ int nArg, /* Size of argument array */ sqlite3_value **apVal, /* Array of arguments */ sqlite_int64 *pRowid /* OUT: The affected (or effected) rowid */ ){ return sqlite3Fts3UpdateMethod(pVtab, nArg, apVal, pRowid); } /* ** Implementation of xSync() method. Flush the contents of the pending-terms ** hash-table to the database. */ static int fts3SyncMethod(sqlite3_vtab *pVtab){ /* Following an incremental-merge operation, assuming that the input ** segments are not completely consumed (the usual case), they are updated ** in place to remove the entries that have already been merged. This ** involves updating the leaf block that contains the smallest unmerged ** entry and each block (if any) between the leaf and the root node. So ** if the height of the input segment b-trees is N, and input segments ** are merged eight at a time, updating the input segments at the end ** of an incremental-merge requires writing (8*(1+N)) blocks. N is usually ** small - often between 0 and 2. So the overhead of the incremental ** merge is somewhere between 8 and 24 blocks. To avoid this overhead ** dwarfing the actual productive work accomplished, the incremental merge ** is only attempted if it will write at least 64 leaf blocks. Hence ** nMinMerge. ** ** Of course, updating the input segments also involves deleting a bunch ** of blocks from the segments table. But this is not considered overhead ** as it would also be required by a crisis-merge that used the same input ** segments. */ const u32 nMinMerge = 64; /* Minimum amount of incr-merge work to do */ Fts3Table *p = (Fts3Table*)pVtab; int rc; i64 iLastRowid = sqlite3_last_insert_rowid(p->db); rc = sqlite3Fts3PendingTermsFlush(p); if( rc==SQLITE_OK && p->nLeafAdd>(nMinMerge/16) && p->nAutoincrmerge && p->nAutoincrmerge!=0xff ){ int mxLevel = 0; /* Maximum relative level value in db */ int A; /* Incr-merge parameter A */ rc = sqlite3Fts3MaxLevel(p, &mxLevel); assert( rc==SQLITE_OK || mxLevel==0 ); A = p->nLeafAdd * mxLevel; A += (A/2); if( A>(int)nMinMerge ) rc = sqlite3Fts3Incrmerge(p, A, p->nAutoincrmerge); } sqlite3Fts3SegmentsClose(p); sqlite3_set_last_insert_rowid(p->db, iLastRowid); return rc; } /* ** If it is currently unknown whether or not the FTS table has an %_stat ** table (if p->bHasStat==2), attempt to determine this (set p->bHasStat ** to 0 or 1). Return SQLITE_OK if successful, or an SQLite error code ** if an error occurs. */ static int fts3SetHasStat(Fts3Table *p){ int rc = SQLITE_OK; if( p->bHasStat==2 ){ char *zTbl = sqlite3_mprintf("%s_stat", p->zName); if( zTbl ){ int res = sqlite3_table_column_metadata(p->db, p->zDb, zTbl, 0,0,0,0,0,0); sqlite3_free(zTbl); p->bHasStat = (res==SQLITE_OK); }else{ rc = SQLITE_NOMEM; } } return rc; } /* ** Implementation of xBegin() method. */ static int fts3BeginMethod(sqlite3_vtab *pVtab){ Fts3Table *p = (Fts3Table*)pVtab; UNUSED_PARAMETER(pVtab); assert( p->pSegments==0 ); assert( p->nPendingData==0 ); assert( p->inTransaction!=1 ); TESTONLY( p->inTransaction = 1 ); TESTONLY( p->mxSavepoint = -1; ); p->nLeafAdd = 0; return fts3SetHasStat(p); } /* ** Implementation of xCommit() method. This is a no-op. The contents of ** the pending-terms hash-table have already been flushed into the database ** by fts3SyncMethod(). */ static int fts3CommitMethod(sqlite3_vtab *pVtab){ TESTONLY( Fts3Table *p = (Fts3Table*)pVtab ); UNUSED_PARAMETER(pVtab); assert( p->nPendingData==0 ); assert( p->inTransaction!=0 ); assert( p->pSegments==0 ); TESTONLY( p->inTransaction = 0 ); TESTONLY( p->mxSavepoint = -1; ); return SQLITE_OK; } /* ** Implementation of xRollback(). Discard the contents of the pending-terms ** hash-table. Any changes made to the database are reverted by SQLite. */ static int fts3RollbackMethod(sqlite3_vtab *pVtab){ Fts3Table *p = (Fts3Table*)pVtab; sqlite3Fts3PendingTermsClear(p); assert( p->inTransaction!=0 ); TESTONLY( p->inTransaction = 0 ); TESTONLY( p->mxSavepoint = -1; ); return SQLITE_OK; } /* ** When called, *ppPoslist must point to the byte immediately following the ** end of a position-list. i.e. ( (*ppPoslist)[-1]==POS_END ). This function ** moves *ppPoslist so that it instead points to the first byte of the ** same position list. */ static void fts3ReversePoslist(char *pStart, char **ppPoslist){ char *p = &(*ppPoslist)[-2]; char c = 0; /* Skip backwards passed any trailing 0x00 bytes added by NearTrim() */ while( p>pStart && (c=*p--)==0 ); /* Search backwards for a varint with value zero (the end of the previous ** poslist). This is an 0x00 byte preceded by some byte that does not ** have the 0x80 bit set. */ while( p>pStart && (*p & 0x80) | c ){ c = *p--; } assert( p==pStart || c==0 ); /* At this point p points to that preceding byte without the 0x80 bit ** set. So to find the start of the poslist, skip forward 2 bytes then ** over a varint. ** ** Normally. The other case is that p==pStart and the poslist to return ** is the first in the doclist. In this case do not skip forward 2 bytes. ** The second part of the if condition (c==0 && *ppPoslist>&p[2]) ** is required for cases where the first byte of a doclist and the ** doclist is empty. For example, if the first docid is 10, a doclist ** that begins with: ** ** 0x0A 0x00 */ if( p>pStart || (c==0 && *ppPoslist>&p[2]) ){ p = &p[2]; } while( *p++&0x80 ); *ppPoslist = p; } /* ** Helper function used by the implementation of the overloaded snippet(), ** offsets() and optimize() SQL functions. ** ** If the value passed as the third argument is a blob of size ** sizeof(Fts3Cursor*), then the blob contents are copied to the ** output variable *ppCsr and SQLITE_OK is returned. Otherwise, an error ** message is written to context pContext and SQLITE_ERROR returned. The ** string passed via zFunc is used as part of the error message. */ static int fts3FunctionArg( sqlite3_context *pContext, /* SQL function call context */ const char *zFunc, /* Function name */ sqlite3_value *pVal, /* argv[0] passed to function */ Fts3Cursor **ppCsr /* OUT: Store cursor handle here */ ){ int rc; *ppCsr = (Fts3Cursor*)sqlite3_value_pointer(pVal, "fts3cursor"); if( (*ppCsr)!=0 ){ rc = SQLITE_OK; }else{ char *zErr = sqlite3_mprintf("illegal first argument to %s", zFunc); sqlite3_result_error(pContext, zErr, -1); sqlite3_free(zErr); rc = SQLITE_ERROR; } return rc; } /* ** Implementation of the snippet() function for FTS3 */ static void fts3SnippetFunc( sqlite3_context *pContext, /* SQLite function call context */ int nVal, /* Size of apVal[] array */ sqlite3_value **apVal /* Array of arguments */ ){ Fts3Cursor *pCsr; /* Cursor handle passed through apVal[0] */ const char *zStart = ""; const char *zEnd = ""; const char *zEllipsis = "..."; int iCol = -1; int nToken = 15; /* Default number of tokens in snippet */ /* There must be at least one argument passed to this function (otherwise ** the non-overloaded version would have been called instead of this one). */ assert( nVal>=1 ); if( nVal>6 ){ sqlite3_result_error(pContext, "wrong number of arguments to function snippet()", -1); return; } if( fts3FunctionArg(pContext, "snippet", apVal[0], &pCsr) ) return; switch( nVal ){ case 6: nToken = sqlite3_value_int(apVal[5]); case 5: iCol = sqlite3_value_int(apVal[4]); case 4: zEllipsis = (const char*)sqlite3_value_text(apVal[3]); case 3: zEnd = (const char*)sqlite3_value_text(apVal[2]); case 2: zStart = (const char*)sqlite3_value_text(apVal[1]); } if( !zEllipsis || !zEnd || !zStart ){ sqlite3_result_error_nomem(pContext); }else if( nToken==0 ){ sqlite3_result_text(pContext, "", -1, SQLITE_STATIC); }else if( SQLITE_OK==fts3CursorSeek(pContext, pCsr) ){ sqlite3Fts3Snippet(pContext, pCsr, zStart, zEnd, zEllipsis, iCol, nToken); } } /* ** Implementation of the offsets() function for FTS3 */ static void fts3OffsetsFunc( sqlite3_context *pContext, /* SQLite function call context */ int nVal, /* Size of argument array */ sqlite3_value **apVal /* Array of arguments */ ){ Fts3Cursor *pCsr; /* Cursor handle passed through apVal[0] */ UNUSED_PARAMETER(nVal); assert( nVal==1 ); if( fts3FunctionArg(pContext, "offsets", apVal[0], &pCsr) ) return; assert( pCsr ); if( SQLITE_OK==fts3CursorSeek(pContext, pCsr) ){ sqlite3Fts3Offsets(pContext, pCsr); } } /* ** Implementation of the special optimize() function for FTS3. This ** function merges all segments in the database to a single segment. ** Example usage is: ** ** SELECT optimize(t) FROM t LIMIT 1; ** ** where 't' is the name of an FTS3 table. */ static void fts3OptimizeFunc( sqlite3_context *pContext, /* SQLite function call context */ int nVal, /* Size of argument array */ sqlite3_value **apVal /* Array of arguments */ ){ int rc; /* Return code */ Fts3Table *p; /* Virtual table handle */ Fts3Cursor *pCursor; /* Cursor handle passed through apVal[0] */ UNUSED_PARAMETER(nVal); assert( nVal==1 ); if( fts3FunctionArg(pContext, "optimize", apVal[0], &pCursor) ) return; p = (Fts3Table *)pCursor->base.pVtab; assert( p ); rc = sqlite3Fts3Optimize(p); switch( rc ){ case SQLITE_OK: sqlite3_result_text(pContext, "Index optimized", -1, SQLITE_STATIC); break; case SQLITE_DONE: sqlite3_result_text(pContext, "Index already optimal", -1, SQLITE_STATIC); break; default: sqlite3_result_error_code(pContext, rc); break; } } /* ** Implementation of the matchinfo() function for FTS3 */ static void fts3MatchinfoFunc( sqlite3_context *pContext, /* SQLite function call context */ int nVal, /* Size of argument array */ sqlite3_value **apVal /* Array of arguments */ ){ Fts3Cursor *pCsr; /* Cursor handle passed through apVal[0] */ assert( nVal==1 || nVal==2 ); if( SQLITE_OK==fts3FunctionArg(pContext, "matchinfo", apVal[0], &pCsr) ){ const char *zArg = 0; if( nVal>1 ){ zArg = (const char *)sqlite3_value_text(apVal[1]); } sqlite3Fts3Matchinfo(pContext, pCsr, zArg); } } /* ** This routine implements the xFindFunction method for the FTS3 ** virtual table. */ static int fts3FindFunctionMethod( sqlite3_vtab *pVtab, /* Virtual table handle */ int nArg, /* Number of SQL function arguments */ const char *zName, /* Name of SQL function */ void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), /* OUT: Result */ void **ppArg /* Unused */ ){ struct Overloaded { const char *zName; void (*xFunc)(sqlite3_context*,int,sqlite3_value**); } aOverload[] = { { "snippet", fts3SnippetFunc }, { "offsets", fts3OffsetsFunc }, { "optimize", fts3OptimizeFunc }, { "matchinfo", fts3MatchinfoFunc }, }; int i; /* Iterator variable */ UNUSED_PARAMETER(pVtab); UNUSED_PARAMETER(nArg); UNUSED_PARAMETER(ppArg); for(i=0; idb; /* Database connection */ int rc; /* Return Code */ /* At this point it must be known if the %_stat table exists or not. ** So bHasStat may not be 2. */ rc = fts3SetHasStat(p); /* As it happens, the pending terms table is always empty here. This is ** because an "ALTER TABLE RENAME TABLE" statement inside a transaction ** always opens a savepoint transaction. And the xSavepoint() method ** flushes the pending terms table. But leave the (no-op) call to ** PendingTermsFlush() in in case that changes. */ assert( p->nPendingData==0 ); if( rc==SQLITE_OK ){ rc = sqlite3Fts3PendingTermsFlush(p); } if( p->zContentTbl==0 ){ fts3DbExec(&rc, db, "ALTER TABLE %Q.'%q_content' RENAME TO '%q_content';", p->zDb, p->zName, zName ); } if( p->bHasDocsize ){ fts3DbExec(&rc, db, "ALTER TABLE %Q.'%q_docsize' RENAME TO '%q_docsize';", p->zDb, p->zName, zName ); } if( p->bHasStat ){ fts3DbExec(&rc, db, "ALTER TABLE %Q.'%q_stat' RENAME TO '%q_stat';", p->zDb, p->zName, zName ); } fts3DbExec(&rc, db, "ALTER TABLE %Q.'%q_segments' RENAME TO '%q_segments';", p->zDb, p->zName, zName ); fts3DbExec(&rc, db, "ALTER TABLE %Q.'%q_segdir' RENAME TO '%q_segdir';", p->zDb, p->zName, zName ); return rc; } /* ** The xSavepoint() method. ** ** Flush the contents of the pending-terms table to disk. */ static int fts3SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){ int rc = SQLITE_OK; UNUSED_PARAMETER(iSavepoint); assert( ((Fts3Table *)pVtab)->inTransaction ); assert( ((Fts3Table *)pVtab)->mxSavepoint < iSavepoint ); TESTONLY( ((Fts3Table *)pVtab)->mxSavepoint = iSavepoint ); if( ((Fts3Table *)pVtab)->bIgnoreSavepoint==0 ){ rc = fts3SyncMethod(pVtab); } return rc; } /* ** The xRelease() method. ** ** This is a no-op. */ static int fts3ReleaseMethod(sqlite3_vtab *pVtab, int iSavepoint){ TESTONLY( Fts3Table *p = (Fts3Table*)pVtab ); UNUSED_PARAMETER(iSavepoint); UNUSED_PARAMETER(pVtab); assert( p->inTransaction ); assert( p->mxSavepoint >= iSavepoint ); TESTONLY( p->mxSavepoint = iSavepoint-1 ); return SQLITE_OK; } /* ** The xRollbackTo() method. ** ** Discard the contents of the pending terms table. */ static int fts3RollbackToMethod(sqlite3_vtab *pVtab, int iSavepoint){ Fts3Table *p = (Fts3Table*)pVtab; UNUSED_PARAMETER(iSavepoint); assert( p->inTransaction ); assert( p->mxSavepoint >= iSavepoint ); TESTONLY( p->mxSavepoint = iSavepoint ); sqlite3Fts3PendingTermsClear(p); return SQLITE_OK; } static const sqlite3_module fts3Module = { /* iVersion */ 2, /* xCreate */ fts3CreateMethod, /* xConnect */ fts3ConnectMethod, /* xBestIndex */ fts3BestIndexMethod, /* xDisconnect */ fts3DisconnectMethod, /* xDestroy */ fts3DestroyMethod, /* xOpen */ fts3OpenMethod, /* xClose */ fts3CloseMethod, /* xFilter */ fts3FilterMethod, /* xNext */ fts3NextMethod, /* xEof */ fts3EofMethod, /* xColumn */ fts3ColumnMethod, /* xRowid */ fts3RowidMethod, /* xUpdate */ fts3UpdateMethod, /* xBegin */ fts3BeginMethod, /* xSync */ fts3SyncMethod, /* xCommit */ fts3CommitMethod, /* xRollback */ fts3RollbackMethod, /* xFindFunction */ fts3FindFunctionMethod, /* xRename */ fts3RenameMethod, /* xSavepoint */ fts3SavepointMethod, /* xRelease */ fts3ReleaseMethod, /* xRollbackTo */ fts3RollbackToMethod, }; /* ** This function is registered as the module destructor (called when an ** FTS3 enabled database connection is closed). It frees the memory ** allocated for the tokenizer hash table. */ static void hashDestroy(void *p){ Fts3Hash *pHash = (Fts3Hash *)p; sqlite3Fts3HashClear(pHash); sqlite3_free(pHash); } /* ** The fts3 built-in tokenizers - "simple", "porter" and "icu"- are ** implemented in files fts3_tokenizer1.c, fts3_porter.c and fts3_icu.c ** respectively. The following three forward declarations are for functions ** declared in these files used to retrieve the respective implementations. ** ** Calling sqlite3Fts3SimpleTokenizerModule() sets the value pointed ** to by the argument to point to the "simple" tokenizer implementation. ** And so on. */ void sqlite3Fts3SimpleTokenizerModule(sqlite3_tokenizer_module const**ppModule); void sqlite3Fts3PorterTokenizerModule(sqlite3_tokenizer_module const**ppModule); #ifndef SQLITE_DISABLE_FTS3_UNICODE void sqlite3Fts3UnicodeTokenizer(sqlite3_tokenizer_module const**ppModule); #endif #ifdef SQLITE_ENABLE_ICU void sqlite3Fts3IcuTokenizerModule(sqlite3_tokenizer_module const**ppModule); #endif /* ** Initialize the fts3 extension. If this extension is built as part ** of the sqlite library, then this function is called directly by ** SQLite. If fts3 is built as a dynamically loadable extension, this ** function is called by the sqlite3_extension_init() entry point. */ int sqlite3Fts3Init(sqlite3 *db){ int rc = SQLITE_OK; Fts3Hash *pHash = 0; const sqlite3_tokenizer_module *pSimple = 0; const sqlite3_tokenizer_module *pPorter = 0; #ifndef SQLITE_DISABLE_FTS3_UNICODE const sqlite3_tokenizer_module *pUnicode = 0; #endif #ifdef SQLITE_ENABLE_ICU const sqlite3_tokenizer_module *pIcu = 0; sqlite3Fts3IcuTokenizerModule(&pIcu); #endif #ifndef SQLITE_DISABLE_FTS3_UNICODE sqlite3Fts3UnicodeTokenizer(&pUnicode); #endif #ifdef SQLITE_TEST rc = sqlite3Fts3InitTerm(db); if( rc!=SQLITE_OK ) return rc; #endif rc = sqlite3Fts3InitAux(db); if( rc!=SQLITE_OK ) return rc; sqlite3Fts3SimpleTokenizerModule(&pSimple); sqlite3Fts3PorterTokenizerModule(&pPorter); /* Allocate and initialize the hash-table used to store tokenizers. */ pHash = sqlite3_malloc(sizeof(Fts3Hash)); if( !pHash ){ rc = SQLITE_NOMEM; }else{ sqlite3Fts3HashInit(pHash, FTS3_HASH_STRING, 1); } /* Load the built-in tokenizers into the hash table */ if( rc==SQLITE_OK ){ if( sqlite3Fts3HashInsert(pHash, "simple", 7, (void *)pSimple) || sqlite3Fts3HashInsert(pHash, "porter", 7, (void *)pPorter) #ifndef SQLITE_DISABLE_FTS3_UNICODE || sqlite3Fts3HashInsert(pHash, "unicode61", 10, (void *)pUnicode) #endif #ifdef SQLITE_ENABLE_ICU || (pIcu && sqlite3Fts3HashInsert(pHash, "icu", 4, (void *)pIcu)) #endif ){ rc = SQLITE_NOMEM; } } #ifdef SQLITE_TEST if( rc==SQLITE_OK ){ rc = sqlite3Fts3ExprInitTestInterface(db); } #endif /* Create the virtual table wrapper around the hash-table and overload ** the four scalar functions. If this is successful, register the ** module with sqlite. */ if( SQLITE_OK==rc && SQLITE_OK==(rc = sqlite3Fts3InitHashTable(db, pHash, "fts3_tokenizer")) && SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1)) && SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", 1)) && SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 1)) && SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 2)) && SQLITE_OK==(rc = sqlite3_overload_function(db, "optimize", 1)) ){ rc = sqlite3_create_module_v2( db, "fts3", &fts3Module, (void *)pHash, hashDestroy ); if( rc==SQLITE_OK ){ rc = sqlite3_create_module_v2( db, "fts4", &fts3Module, (void *)pHash, 0 ); } if( rc==SQLITE_OK ){ rc = sqlite3Fts3InitTok(db, (void *)pHash); } return rc; } /* An error has occurred. Delete the hash table and return the error code. */ assert( rc!=SQLITE_OK ); if( pHash ){ sqlite3Fts3HashClear(pHash); sqlite3_free(pHash); } return rc; } /* ** Allocate an Fts3MultiSegReader for each token in the expression headed ** by pExpr. ** ** An Fts3SegReader object is a cursor that can seek or scan a range of ** entries within a single segment b-tree. An Fts3MultiSegReader uses multiple ** Fts3SegReader objects internally to provide an interface to seek or scan ** within the union of all segments of a b-tree. Hence the name. ** ** If the allocated Fts3MultiSegReader just seeks to a single entry in a ** segment b-tree (if the term is not a prefix or it is a prefix for which ** there exists prefix b-tree of the right length) then it may be traversed ** and merged incrementally. Otherwise, it has to be merged into an in-memory ** doclist and then traversed. */ static void fts3EvalAllocateReaders( Fts3Cursor *pCsr, /* FTS cursor handle */ Fts3Expr *pExpr, /* Allocate readers for this expression */ int *pnToken, /* OUT: Total number of tokens in phrase. */ int *pnOr, /* OUT: Total number of OR nodes in expr. */ int *pRc /* IN/OUT: Error code */ ){ if( pExpr && SQLITE_OK==*pRc ){ if( pExpr->eType==FTSQUERY_PHRASE ){ int i; int nToken = pExpr->pPhrase->nToken; *pnToken += nToken; for(i=0; ipPhrase->aToken[i]; int rc = fts3TermSegReaderCursor(pCsr, pToken->z, pToken->n, pToken->isPrefix, &pToken->pSegcsr ); if( rc!=SQLITE_OK ){ *pRc = rc; return; } } assert( pExpr->pPhrase->iDoclistToken==0 ); pExpr->pPhrase->iDoclistToken = -1; }else{ *pnOr += (pExpr->eType==FTSQUERY_OR); fts3EvalAllocateReaders(pCsr, pExpr->pLeft, pnToken, pnOr, pRc); fts3EvalAllocateReaders(pCsr, pExpr->pRight, pnToken, pnOr, pRc); } } } /* ** Arguments pList/nList contain the doclist for token iToken of phrase p. ** It is merged into the main doclist stored in p->doclist.aAll/nAll. ** ** This function assumes that pList points to a buffer allocated using ** sqlite3_malloc(). This function takes responsibility for eventually ** freeing the buffer. ** ** SQLITE_OK is returned if successful, or SQLITE_NOMEM if an error occurs. */ static int fts3EvalPhraseMergeToken( Fts3Table *pTab, /* FTS Table pointer */ Fts3Phrase *p, /* Phrase to merge pList/nList into */ int iToken, /* Token pList/nList corresponds to */ char *pList, /* Pointer to doclist */ int nList /* Number of bytes in pList */ ){ int rc = SQLITE_OK; assert( iToken!=p->iDoclistToken ); if( pList==0 ){ sqlite3_free(p->doclist.aAll); p->doclist.aAll = 0; p->doclist.nAll = 0; } else if( p->iDoclistToken<0 ){ p->doclist.aAll = pList; p->doclist.nAll = nList; } else if( p->doclist.aAll==0 ){ sqlite3_free(pList); } else { char *pLeft; char *pRight; int nLeft; int nRight; int nDiff; if( p->iDoclistTokendoclist.aAll; nLeft = p->doclist.nAll; pRight = pList; nRight = nList; nDiff = iToken - p->iDoclistToken; }else{ pRight = p->doclist.aAll; nRight = p->doclist.nAll; pLeft = pList; nLeft = nList; nDiff = p->iDoclistToken - iToken; } rc = fts3DoclistPhraseMerge( pTab->bDescIdx, nDiff, pLeft, nLeft, &pRight, &nRight ); sqlite3_free(pLeft); p->doclist.aAll = pRight; p->doclist.nAll = nRight; } if( iToken>p->iDoclistToken ) p->iDoclistToken = iToken; return rc; } /* ** Load the doclist for phrase p into p->doclist.aAll/nAll. The loaded doclist ** does not take deferred tokens into account. ** ** SQLITE_OK is returned if no error occurs, otherwise an SQLite error code. */ static int fts3EvalPhraseLoad( Fts3Cursor *pCsr, /* FTS Cursor handle */ Fts3Phrase *p /* Phrase object */ ){ Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; int iToken; int rc = SQLITE_OK; for(iToken=0; rc==SQLITE_OK && iTokennToken; iToken++){ Fts3PhraseToken *pToken = &p->aToken[iToken]; assert( pToken->pDeferred==0 || pToken->pSegcsr==0 ); if( pToken->pSegcsr ){ int nThis = 0; char *pThis = 0; rc = fts3TermSelect(pTab, pToken, p->iColumn, &nThis, &pThis); if( rc==SQLITE_OK ){ rc = fts3EvalPhraseMergeToken(pTab, p, iToken, pThis, nThis); } } assert( pToken->pSegcsr==0 ); } return rc; } /* ** This function is called on each phrase after the position lists for ** any deferred tokens have been loaded into memory. It updates the phrases ** current position list to include only those positions that are really ** instances of the phrase (after considering deferred tokens). If this ** means that the phrase does not appear in the current row, doclist.pList ** and doclist.nList are both zeroed. ** ** SQLITE_OK is returned if no error occurs, otherwise an SQLite error code. */ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){ int iToken; /* Used to iterate through phrase tokens */ char *aPoslist = 0; /* Position list for deferred tokens */ int nPoslist = 0; /* Number of bytes in aPoslist */ int iPrev = -1; /* Token number of previous deferred token */ assert( pPhrase->doclist.bFreeList==0 ); for(iToken=0; iTokennToken; iToken++){ Fts3PhraseToken *pToken = &pPhrase->aToken[iToken]; Fts3DeferredToken *pDeferred = pToken->pDeferred; if( pDeferred ){ char *pList; int nList; int rc = sqlite3Fts3DeferredTokenList(pDeferred, &pList, &nList); if( rc!=SQLITE_OK ) return rc; if( pList==0 ){ sqlite3_free(aPoslist); pPhrase->doclist.pList = 0; pPhrase->doclist.nList = 0; return SQLITE_OK; }else if( aPoslist==0 ){ aPoslist = pList; nPoslist = nList; }else{ char *aOut = pList; char *p1 = aPoslist; char *p2 = aOut; assert( iPrev>=0 ); fts3PoslistPhraseMerge(&aOut, iToken-iPrev, 0, 1, &p1, &p2); sqlite3_free(aPoslist); aPoslist = pList; nPoslist = (int)(aOut - aPoslist); if( nPoslist==0 ){ sqlite3_free(aPoslist); pPhrase->doclist.pList = 0; pPhrase->doclist.nList = 0; return SQLITE_OK; } } iPrev = iToken; } } if( iPrev>=0 ){ int nMaxUndeferred = pPhrase->iDoclistToken; if( nMaxUndeferred<0 ){ pPhrase->doclist.pList = aPoslist; pPhrase->doclist.nList = nPoslist; pPhrase->doclist.iDocid = pCsr->iPrevId; pPhrase->doclist.bFreeList = 1; }else{ int nDistance; char *p1; char *p2; char *aOut; if( nMaxUndeferred>iPrev ){ p1 = aPoslist; p2 = pPhrase->doclist.pList; nDistance = nMaxUndeferred - iPrev; }else{ p1 = pPhrase->doclist.pList; p2 = aPoslist; nDistance = iPrev - nMaxUndeferred; } aOut = (char *)sqlite3_malloc(nPoslist+8); if( !aOut ){ sqlite3_free(aPoslist); return SQLITE_NOMEM; } pPhrase->doclist.pList = aOut; if( fts3PoslistPhraseMerge(&aOut, nDistance, 0, 1, &p1, &p2) ){ pPhrase->doclist.bFreeList = 1; pPhrase->doclist.nList = (int)(aOut - pPhrase->doclist.pList); }else{ sqlite3_free(aOut); pPhrase->doclist.pList = 0; pPhrase->doclist.nList = 0; } sqlite3_free(aPoslist); } } return SQLITE_OK; } /* ** Maximum number of tokens a phrase may have to be considered for the ** incremental doclists strategy. */ #define MAX_INCR_PHRASE_TOKENS 4 /* ** This function is called for each Fts3Phrase in a full-text query ** expression to initialize the mechanism for returning rows. Once this ** function has been called successfully on an Fts3Phrase, it may be ** used with fts3EvalPhraseNext() to iterate through the matching docids. ** ** If parameter bOptOk is true, then the phrase may (or may not) use the ** incremental loading strategy. Otherwise, the entire doclist is loaded into ** memory within this call. ** ** SQLITE_OK is returned if no error occurs, otherwise an SQLite error code. */ static int fts3EvalPhraseStart(Fts3Cursor *pCsr, int bOptOk, Fts3Phrase *p){ Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; int rc = SQLITE_OK; /* Error code */ int i; /* Determine if doclists may be loaded from disk incrementally. This is ** possible if the bOptOk argument is true, the FTS doclists will be ** scanned in forward order, and the phrase consists of ** MAX_INCR_PHRASE_TOKENS or fewer tokens, none of which are are "^first" ** tokens or prefix tokens that cannot use a prefix-index. */ int bHaveIncr = 0; int bIncrOk = (bOptOk && pCsr->bDesc==pTab->bDescIdx && p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 #ifdef SQLITE_TEST && pTab->bNoIncrDoclist==0 #endif ); for(i=0; bIncrOk==1 && inToken; i++){ Fts3PhraseToken *pToken = &p->aToken[i]; if( pToken->bFirst || (pToken->pSegcsr!=0 && !pToken->pSegcsr->bLookup) ){ bIncrOk = 0; } if( pToken->pSegcsr ) bHaveIncr = 1; } if( bIncrOk && bHaveIncr ){ /* Use the incremental approach. */ int iCol = (p->iColumn >= pTab->nColumn ? -1 : p->iColumn); for(i=0; rc==SQLITE_OK && inToken; i++){ Fts3PhraseToken *pToken = &p->aToken[i]; Fts3MultiSegReader *pSegcsr = pToken->pSegcsr; if( pSegcsr ){ rc = sqlite3Fts3MsrIncrStart(pTab, pSegcsr, iCol, pToken->z, pToken->n); } } p->bIncr = 1; }else{ /* Load the full doclist for the phrase into memory. */ rc = fts3EvalPhraseLoad(pCsr, p); p->bIncr = 0; } assert( rc!=SQLITE_OK || p->nToken<1 || p->aToken[0].pSegcsr==0 || p->bIncr ); return rc; } /* ** This function is used to iterate backwards (from the end to start) ** through doclists. It is used by this module to iterate through phrase ** doclists in reverse and by the fts3_write.c module to iterate through ** pending-terms lists when writing to databases with "order=desc". ** ** The doclist may be sorted in ascending (parameter bDescIdx==0) or ** descending (parameter bDescIdx==1) order of docid. Regardless, this ** function iterates from the end of the doclist to the beginning. */ void sqlite3Fts3DoclistPrev( int bDescIdx, /* True if the doclist is desc */ char *aDoclist, /* Pointer to entire doclist */ int nDoclist, /* Length of aDoclist in bytes */ char **ppIter, /* IN/OUT: Iterator pointer */ sqlite3_int64 *piDocid, /* IN/OUT: Docid pointer */ int *pnList, /* OUT: List length pointer */ u8 *pbEof /* OUT: End-of-file flag */ ){ char *p = *ppIter; assert( nDoclist>0 ); assert( *pbEof==0 ); assert( p || *piDocid==0 ); assert( !p || (p>aDoclist && p<&aDoclist[nDoclist]) ); if( p==0 ){ sqlite3_int64 iDocid = 0; char *pNext = 0; char *pDocid = aDoclist; char *pEnd = &aDoclist[nDoclist]; int iMul = 1; while( pDocid0 ); assert( *pbEof==0 ); assert( p || *piDocid==0 ); assert( !p || (p>=aDoclist && p<=&aDoclist[nDoclist]) ); if( p==0 ){ p = aDoclist; p += sqlite3Fts3GetVarint(p, piDocid); }else{ fts3PoslistCopy(0, &p); while( p<&aDoclist[nDoclist] && *p==0 ) p++; if( p>=&aDoclist[nDoclist] ){ *pbEof = 1; }else{ sqlite3_int64 iVar; p += sqlite3Fts3GetVarint(p, &iVar); *piDocid += ((bDescIdx ? -1 : 1) * iVar); } } *ppIter = p; } /* ** Advance the iterator pDL to the next entry in pDL->aAll/nAll. Set *pbEof ** to true if EOF is reached. */ static void fts3EvalDlPhraseNext( Fts3Table *pTab, Fts3Doclist *pDL, u8 *pbEof ){ char *pIter; /* Used to iterate through aAll */ char *pEnd = &pDL->aAll[pDL->nAll]; /* 1 byte past end of aAll */ if( pDL->pNextDocid ){ pIter = pDL->pNextDocid; }else{ pIter = pDL->aAll; } if( pIter>=pEnd ){ /* We have already reached the end of this doclist. EOF. */ *pbEof = 1; }else{ sqlite3_int64 iDelta; pIter += sqlite3Fts3GetVarint(pIter, &iDelta); if( pTab->bDescIdx==0 || pDL->pNextDocid==0 ){ pDL->iDocid += iDelta; }else{ pDL->iDocid -= iDelta; } pDL->pList = pIter; fts3PoslistCopy(0, &pIter); pDL->nList = (int)(pIter - pDL->pList); /* pIter now points just past the 0x00 that terminates the position- ** list for document pDL->iDocid. However, if this position-list was ** edited in place by fts3EvalNearTrim(), then pIter may not actually ** point to the start of the next docid value. The following line deals ** with this case by advancing pIter past the zero-padding added by ** fts3EvalNearTrim(). */ while( pIterpNextDocid = pIter; assert( pIter>=&pDL->aAll[pDL->nAll] || *pIter ); *pbEof = 0; } } /* ** Helper type used by fts3EvalIncrPhraseNext() and incrPhraseTokenNext(). */ typedef struct TokenDoclist TokenDoclist; struct TokenDoclist { int bIgnore; sqlite3_int64 iDocid; char *pList; int nList; }; /* ** Token pToken is an incrementally loaded token that is part of a ** multi-token phrase. Advance it to the next matching document in the ** database and populate output variable *p with the details of the new ** entry. Or, if the iterator has reached EOF, set *pbEof to true. ** ** If an error occurs, return an SQLite error code. Otherwise, return ** SQLITE_OK. */ static int incrPhraseTokenNext( Fts3Table *pTab, /* Virtual table handle */ Fts3Phrase *pPhrase, /* Phrase to advance token of */ int iToken, /* Specific token to advance */ TokenDoclist *p, /* OUT: Docid and doclist for new entry */ u8 *pbEof /* OUT: True if iterator is at EOF */ ){ int rc = SQLITE_OK; if( pPhrase->iDoclistToken==iToken ){ assert( p->bIgnore==0 ); assert( pPhrase->aToken[iToken].pSegcsr==0 ); fts3EvalDlPhraseNext(pTab, &pPhrase->doclist, pbEof); p->pList = pPhrase->doclist.pList; p->nList = pPhrase->doclist.nList; p->iDocid = pPhrase->doclist.iDocid; }else{ Fts3PhraseToken *pToken = &pPhrase->aToken[iToken]; assert( pToken->pDeferred==0 ); assert( pToken->pSegcsr || pPhrase->iDoclistToken>=0 ); if( pToken->pSegcsr ){ assert( p->bIgnore==0 ); rc = sqlite3Fts3MsrIncrNext( pTab, pToken->pSegcsr, &p->iDocid, &p->pList, &p->nList ); if( p->pList==0 ) *pbEof = 1; }else{ p->bIgnore = 1; } } return rc; } /* ** The phrase iterator passed as the second argument: ** ** * features at least one token that uses an incremental doclist, and ** ** * does not contain any deferred tokens. ** ** Advance it to the next matching documnent in the database and populate ** the Fts3Doclist.pList and nList fields. ** ** If there is no "next" entry and no error occurs, then *pbEof is set to ** 1 before returning. Otherwise, if no error occurs and the iterator is ** successfully advanced, *pbEof is set to 0. ** ** If an error occurs, return an SQLite error code. Otherwise, return ** SQLITE_OK. */ static int fts3EvalIncrPhraseNext( Fts3Cursor *pCsr, /* FTS Cursor handle */ Fts3Phrase *p, /* Phrase object to advance to next docid */ u8 *pbEof /* OUT: Set to 1 if EOF */ ){ int rc = SQLITE_OK; Fts3Doclist *pDL = &p->doclist; Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; u8 bEof = 0; /* This is only called if it is guaranteed that the phrase has at least ** one incremental token. In which case the bIncr flag is set. */ assert( p->bIncr==1 ); if( p->nToken==1 ){ rc = sqlite3Fts3MsrIncrNext(pTab, p->aToken[0].pSegcsr, &pDL->iDocid, &pDL->pList, &pDL->nList ); if( pDL->pList==0 ) bEof = 1; }else{ int bDescDoclist = pCsr->bDesc; struct TokenDoclist a[MAX_INCR_PHRASE_TOKENS]; memset(a, 0, sizeof(a)); assert( p->nToken<=MAX_INCR_PHRASE_TOKENS ); assert( p->iDoclistTokennToken && bEof==0; i++){ rc = incrPhraseTokenNext(pTab, p, i, &a[i], &bEof); if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ iMax = a[i].iDocid; bMaxSet = 1; } } assert( rc!=SQLITE_OK || (p->nToken>=1 && a[p->nToken-1].bIgnore==0) ); assert( rc!=SQLITE_OK || bMaxSet ); /* Keep advancing iterators until they all point to the same document */ for(i=0; inToken; i++){ while( rc==SQLITE_OK && bEof==0 && a[i].bIgnore==0 && DOCID_CMP(a[i].iDocid, iMax)<0 ){ rc = incrPhraseTokenNext(pTab, p, i, &a[i], &bEof); if( DOCID_CMP(a[i].iDocid, iMax)>0 ){ iMax = a[i].iDocid; i = 0; } } } /* Check if the current entries really are a phrase match */ if( bEof==0 ){ int nList = 0; int nByte = a[p->nToken-1].nList; char *aDoclist = sqlite3_malloc(nByte+1); if( !aDoclist ) return SQLITE_NOMEM; memcpy(aDoclist, a[p->nToken-1].pList, nByte+1); for(i=0; i<(p->nToken-1); i++){ if( a[i].bIgnore==0 ){ char *pL = a[i].pList; char *pR = aDoclist; char *pOut = aDoclist; int nDist = p->nToken-1-i; int res = fts3PoslistPhraseMerge(&pOut, nDist, 0, 1, &pL, &pR); if( res==0 ) break; nList = (int)(pOut - aDoclist); } } if( i==(p->nToken-1) ){ pDL->iDocid = iMax; pDL->pList = aDoclist; pDL->nList = nList; pDL->bFreeList = 1; break; } sqlite3_free(aDoclist); } } } *pbEof = bEof; return rc; } /* ** Attempt to move the phrase iterator to point to the next matching docid. ** If an error occurs, return an SQLite error code. Otherwise, return ** SQLITE_OK. ** ** If there is no "next" entry and no error occurs, then *pbEof is set to ** 1 before returning. Otherwise, if no error occurs and the iterator is ** successfully advanced, *pbEof is set to 0. */ static int fts3EvalPhraseNext( Fts3Cursor *pCsr, /* FTS Cursor handle */ Fts3Phrase *p, /* Phrase object to advance to next docid */ u8 *pbEof /* OUT: Set to 1 if EOF */ ){ int rc = SQLITE_OK; Fts3Doclist *pDL = &p->doclist; Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; if( p->bIncr ){ rc = fts3EvalIncrPhraseNext(pCsr, p, pbEof); }else if( pCsr->bDesc!=pTab->bDescIdx && pDL->nAll ){ sqlite3Fts3DoclistPrev(pTab->bDescIdx, pDL->aAll, pDL->nAll, &pDL->pNextDocid, &pDL->iDocid, &pDL->nList, pbEof ); pDL->pList = pDL->pNextDocid; }else{ fts3EvalDlPhraseNext(pTab, pDL, pbEof); } return rc; } /* ** ** If *pRc is not SQLITE_OK when this function is called, it is a no-op. ** Otherwise, fts3EvalPhraseStart() is called on all phrases within the ** expression. Also the Fts3Expr.bDeferred variable is set to true for any ** expressions for which all descendent tokens are deferred. ** ** If parameter bOptOk is zero, then it is guaranteed that the ** Fts3Phrase.doclist.aAll/nAll variables contain the entire doclist for ** each phrase in the expression (subject to deferred token processing). ** Or, if bOptOk is non-zero, then one or more tokens within the expression ** may be loaded incrementally, meaning doclist.aAll/nAll is not available. ** ** If an error occurs within this function, *pRc is set to an SQLite error ** code before returning. */ static void fts3EvalStartReaders( Fts3Cursor *pCsr, /* FTS Cursor handle */ Fts3Expr *pExpr, /* Expression to initialize phrases in */ int *pRc /* IN/OUT: Error code */ ){ if( pExpr && SQLITE_OK==*pRc ){ if( pExpr->eType==FTSQUERY_PHRASE ){ int nToken = pExpr->pPhrase->nToken; if( nToken ){ int i; for(i=0; ipPhrase->aToken[i].pDeferred==0 ) break; } pExpr->bDeferred = (i==nToken); } *pRc = fts3EvalPhraseStart(pCsr, 1, pExpr->pPhrase); }else{ fts3EvalStartReaders(pCsr, pExpr->pLeft, pRc); fts3EvalStartReaders(pCsr, pExpr->pRight, pRc); pExpr->bDeferred = (pExpr->pLeft->bDeferred && pExpr->pRight->bDeferred); } } } /* ** An array of the following structures is assembled as part of the process ** of selecting tokens to defer before the query starts executing (as part ** of the xFilter() method). There is one element in the array for each ** token in the FTS expression. ** ** Tokens are divided into AND/NEAR clusters. All tokens in a cluster belong ** to phrases that are connected only by AND and NEAR operators (not OR or ** NOT). When determining tokens to defer, each AND/NEAR cluster is considered ** separately. The root of a tokens AND/NEAR cluster is stored in ** Fts3TokenAndCost.pRoot. */ typedef struct Fts3TokenAndCost Fts3TokenAndCost; struct Fts3TokenAndCost { Fts3Phrase *pPhrase; /* The phrase the token belongs to */ int iToken; /* Position of token in phrase */ Fts3PhraseToken *pToken; /* The token itself */ Fts3Expr *pRoot; /* Root of NEAR/AND cluster */ int nOvfl; /* Number of overflow pages to load doclist */ int iCol; /* The column the token must match */ }; /* ** This function is used to populate an allocated Fts3TokenAndCost array. ** ** If *pRc is not SQLITE_OK when this function is called, it is a no-op. ** Otherwise, if an error occurs during execution, *pRc is set to an ** SQLite error code. */ static void fts3EvalTokenCosts( Fts3Cursor *pCsr, /* FTS Cursor handle */ Fts3Expr *pRoot, /* Root of current AND/NEAR cluster */ Fts3Expr *pExpr, /* Expression to consider */ Fts3TokenAndCost **ppTC, /* Write new entries to *(*ppTC)++ */ Fts3Expr ***ppOr, /* Write new OR root to *(*ppOr)++ */ int *pRc /* IN/OUT: Error code */ ){ if( *pRc==SQLITE_OK ){ if( pExpr->eType==FTSQUERY_PHRASE ){ Fts3Phrase *pPhrase = pExpr->pPhrase; int i; for(i=0; *pRc==SQLITE_OK && inToken; i++){ Fts3TokenAndCost *pTC = (*ppTC)++; pTC->pPhrase = pPhrase; pTC->iToken = i; pTC->pRoot = pRoot; pTC->pToken = &pPhrase->aToken[i]; pTC->iCol = pPhrase->iColumn; *pRc = sqlite3Fts3MsrOvfl(pCsr, pTC->pToken->pSegcsr, &pTC->nOvfl); } }else if( pExpr->eType!=FTSQUERY_NOT ){ assert( pExpr->eType==FTSQUERY_OR || pExpr->eType==FTSQUERY_AND || pExpr->eType==FTSQUERY_NEAR ); assert( pExpr->pLeft && pExpr->pRight ); if( pExpr->eType==FTSQUERY_OR ){ pRoot = pExpr->pLeft; **ppOr = pRoot; (*ppOr)++; } fts3EvalTokenCosts(pCsr, pRoot, pExpr->pLeft, ppTC, ppOr, pRc); if( pExpr->eType==FTSQUERY_OR ){ pRoot = pExpr->pRight; **ppOr = pRoot; (*ppOr)++; } fts3EvalTokenCosts(pCsr, pRoot, pExpr->pRight, ppTC, ppOr, pRc); } } } /* ** Determine the average document (row) size in pages. If successful, ** write this value to *pnPage and return SQLITE_OK. Otherwise, return ** an SQLite error code. ** ** The average document size in pages is calculated by first calculating ** determining the average size in bytes, B. If B is less than the amount ** of data that will fit on a single leaf page of an intkey table in ** this database, then the average docsize is 1. Otherwise, it is 1 plus ** the number of overflow pages consumed by a record B bytes in size. */ static int fts3EvalAverageDocsize(Fts3Cursor *pCsr, int *pnPage){ int rc = SQLITE_OK; if( pCsr->nRowAvg==0 ){ /* The average document size, which is required to calculate the cost ** of each doclist, has not yet been determined. Read the required ** data from the %_stat table to calculate it. ** ** Entry 0 of the %_stat table is a blob containing (nCol+1) FTS3 ** varints, where nCol is the number of columns in the FTS3 table. ** The first varint is the number of documents currently stored in ** the table. The following nCol varints contain the total amount of ** data stored in all rows of each column of the table, from left ** to right. */ Fts3Table *p = (Fts3Table*)pCsr->base.pVtab; sqlite3_stmt *pStmt; sqlite3_int64 nDoc = 0; sqlite3_int64 nByte = 0; const char *pEnd; const char *a; rc = sqlite3Fts3SelectDoctotal(p, &pStmt); if( rc!=SQLITE_OK ) return rc; a = sqlite3_column_blob(pStmt, 0); assert( a ); pEnd = &a[sqlite3_column_bytes(pStmt, 0)]; a += sqlite3Fts3GetVarint(a, &nDoc); while( anDoc = nDoc; pCsr->nRowAvg = (int)(((nByte / nDoc) + p->nPgsz) / p->nPgsz); assert( pCsr->nRowAvg>0 ); rc = sqlite3_reset(pStmt); } *pnPage = pCsr->nRowAvg; return rc; } /* ** This function is called to select the tokens (if any) that will be ** deferred. The array aTC[] has already been populated when this is ** called. ** ** This function is called once for each AND/NEAR cluster in the ** expression. Each invocation determines which tokens to defer within ** the cluster with root node pRoot. See comments above the definition ** of struct Fts3TokenAndCost for more details. ** ** If no error occurs, SQLITE_OK is returned and sqlite3Fts3DeferToken() ** called on each token to defer. Otherwise, an SQLite error code is ** returned. */ static int fts3EvalSelectDeferred( Fts3Cursor *pCsr, /* FTS Cursor handle */ Fts3Expr *pRoot, /* Consider tokens with this root node */ Fts3TokenAndCost *aTC, /* Array of expression tokens and costs */ int nTC /* Number of entries in aTC[] */ ){ Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; int nDocSize = 0; /* Number of pages per doc loaded */ int rc = SQLITE_OK; /* Return code */ int ii; /* Iterator variable for various purposes */ int nOvfl = 0; /* Total overflow pages used by doclists */ int nToken = 0; /* Total number of tokens in cluster */ int nMinEst = 0; /* The minimum count for any phrase so far. */ int nLoad4 = 1; /* (Phrases that will be loaded)^4. */ /* Tokens are never deferred for FTS tables created using the content=xxx ** option. The reason being that it is not guaranteed that the content ** table actually contains the same data as the index. To prevent this from ** causing any problems, the deferred token optimization is completely ** disabled for content=xxx tables. */ if( pTab->zContentTbl ){ return SQLITE_OK; } /* Count the tokens in this AND/NEAR cluster. If none of the doclists ** associated with the tokens spill onto overflow pages, or if there is ** only 1 token, exit early. No tokens to defer in this case. */ for(ii=0; ii0 ); /* Iterate through all tokens in this AND/NEAR cluster, in ascending order ** of the number of overflow pages that will be loaded by the pager layer ** to retrieve the entire doclist for the token from the full-text index. ** Load the doclists for tokens that are either: ** ** a. The cheapest token in the entire query (i.e. the one visited by the ** first iteration of this loop), or ** ** b. Part of a multi-token phrase. ** ** After each token doclist is loaded, merge it with the others from the ** same phrase and count the number of documents that the merged doclist ** contains. Set variable "nMinEst" to the smallest number of documents in ** any phrase doclist for which 1 or more token doclists have been loaded. ** Let nOther be the number of other phrases for which it is certain that ** one or more tokens will not be deferred. ** ** Then, for each token, defer it if loading the doclist would result in ** loading N or more overflow pages into memory, where N is computed as: ** ** (nMinEst + 4^nOther - 1) / (4^nOther) */ for(ii=0; iinOvfl) ){ pTC = &aTC[iTC]; } } assert( pTC ); if( ii && pTC->nOvfl>=((nMinEst+(nLoad4/4)-1)/(nLoad4/4))*nDocSize ){ /* The number of overflow pages to load for this (and therefore all ** subsequent) tokens is greater than the estimated number of pages ** that will be loaded if all subsequent tokens are deferred. */ Fts3PhraseToken *pToken = pTC->pToken; rc = sqlite3Fts3DeferToken(pCsr, pToken, pTC->iCol); fts3SegReaderCursorFree(pToken->pSegcsr); pToken->pSegcsr = 0; }else{ /* Set nLoad4 to the value of (4^nOther) for the next iteration of the ** for-loop. Except, limit the value to 2^24 to prevent it from ** overflowing the 32-bit integer it is stored in. */ if( ii<12 ) nLoad4 = nLoad4*4; if( ii==0 || (pTC->pPhrase->nToken>1 && ii!=nToken-1) ){ /* Either this is the cheapest token in the entire query, or it is ** part of a multi-token phrase. Either way, the entire doclist will ** (eventually) be loaded into memory. It may as well be now. */ Fts3PhraseToken *pToken = pTC->pToken; int nList = 0; char *pList = 0; rc = fts3TermSelect(pTab, pToken, pTC->iCol, &nList, &pList); assert( rc==SQLITE_OK || pList==0 ); if( rc==SQLITE_OK ){ rc = fts3EvalPhraseMergeToken( pTab, pTC->pPhrase, pTC->iToken,pList,nList ); } if( rc==SQLITE_OK ){ int nCount; nCount = fts3DoclistCountDocids( pTC->pPhrase->doclist.aAll, pTC->pPhrase->doclist.nAll ); if( ii==0 || nCountpToken = 0; } return rc; } /* ** This function is called from within the xFilter method. It initializes ** the full-text query currently stored in pCsr->pExpr. To iterate through ** the results of a query, the caller does: ** ** fts3EvalStart(pCsr); ** while( 1 ){ ** fts3EvalNext(pCsr); ** if( pCsr->bEof ) break; ** ... return row pCsr->iPrevId to the caller ... ** } */ static int fts3EvalStart(Fts3Cursor *pCsr){ Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; int rc = SQLITE_OK; int nToken = 0; int nOr = 0; /* Allocate a MultiSegReader for each token in the expression. */ fts3EvalAllocateReaders(pCsr, pCsr->pExpr, &nToken, &nOr, &rc); /* Determine which, if any, tokens in the expression should be deferred. */ #ifndef SQLITE_DISABLE_FTS4_DEFERRED if( rc==SQLITE_OK && nToken>1 && pTab->bFts4 ){ Fts3TokenAndCost *aTC; Fts3Expr **apOr; aTC = (Fts3TokenAndCost *)sqlite3_malloc( sizeof(Fts3TokenAndCost) * nToken + sizeof(Fts3Expr *) * nOr * 2 ); apOr = (Fts3Expr **)&aTC[nToken]; if( !aTC ){ rc = SQLITE_NOMEM; }else{ int ii; Fts3TokenAndCost *pTC = aTC; Fts3Expr **ppOr = apOr; fts3EvalTokenCosts(pCsr, 0, pCsr->pExpr, &pTC, &ppOr, &rc); nToken = (int)(pTC-aTC); nOr = (int)(ppOr-apOr); if( rc==SQLITE_OK ){ rc = fts3EvalSelectDeferred(pCsr, 0, aTC, nToken); for(ii=0; rc==SQLITE_OK && iipExpr, &rc); return rc; } /* ** Invalidate the current position list for phrase pPhrase. */ static void fts3EvalInvalidatePoslist(Fts3Phrase *pPhrase){ if( pPhrase->doclist.bFreeList ){ sqlite3_free(pPhrase->doclist.pList); } pPhrase->doclist.pList = 0; pPhrase->doclist.nList = 0; pPhrase->doclist.bFreeList = 0; } /* ** This function is called to edit the position list associated with ** the phrase object passed as the fifth argument according to a NEAR ** condition. For example: ** ** abc NEAR/5 "def ghi" ** ** Parameter nNear is passed the NEAR distance of the expression (5 in ** the example above). When this function is called, *paPoslist points to ** the position list, and *pnToken is the number of phrase tokens in, the ** phrase on the other side of the NEAR operator to pPhrase. For example, ** if pPhrase refers to the "def ghi" phrase, then *paPoslist points to ** the position list associated with phrase "abc". ** ** All positions in the pPhrase position list that are not sufficiently ** close to a position in the *paPoslist position list are removed. If this ** leaves 0 positions, zero is returned. Otherwise, non-zero. ** ** Before returning, *paPoslist is set to point to the position lsit ** associated with pPhrase. And *pnToken is set to the number of tokens in ** pPhrase. */ static int fts3EvalNearTrim( int nNear, /* NEAR distance. As in "NEAR/nNear". */ char *aTmp, /* Temporary space to use */ char **paPoslist, /* IN/OUT: Position list */ int *pnToken, /* IN/OUT: Tokens in phrase of *paPoslist */ Fts3Phrase *pPhrase /* The phrase object to trim the doclist of */ ){ int nParam1 = nNear + pPhrase->nToken; int nParam2 = nNear + *pnToken; int nNew; char *p2; char *pOut; int res; assert( pPhrase->doclist.pList ); p2 = pOut = pPhrase->doclist.pList; res = fts3PoslistNearMerge( &pOut, aTmp, nParam1, nParam2, paPoslist, &p2 ); if( res ){ nNew = (int)(pOut - pPhrase->doclist.pList) - 1; assert( pPhrase->doclist.pList[nNew]=='\0' ); assert( nNew<=pPhrase->doclist.nList && nNew>0 ); memset(&pPhrase->doclist.pList[nNew], 0, pPhrase->doclist.nList - nNew); pPhrase->doclist.nList = nNew; *paPoslist = pPhrase->doclist.pList; *pnToken = pPhrase->nToken; } return res; } /* ** This function is a no-op if *pRc is other than SQLITE_OK when it is called. ** Otherwise, it advances the expression passed as the second argument to ** point to the next matching row in the database. Expressions iterate through ** matching rows in docid order. Ascending order if Fts3Cursor.bDesc is zero, ** or descending if it is non-zero. ** ** If an error occurs, *pRc is set to an SQLite error code. Otherwise, if ** successful, the following variables in pExpr are set: ** ** Fts3Expr.bEof (non-zero if EOF - there is no next row) ** Fts3Expr.iDocid (valid if bEof==0. The docid of the next row) ** ** If the expression is of type FTSQUERY_PHRASE, and the expression is not ** at EOF, then the following variables are populated with the position list ** for the phrase for the visited row: ** ** FTs3Expr.pPhrase->doclist.nList (length of pList in bytes) ** FTs3Expr.pPhrase->doclist.pList (pointer to position list) ** ** It says above that this function advances the expression to the next ** matching row. This is usually true, but there are the following exceptions: ** ** 1. Deferred tokens are not taken into account. If a phrase consists ** entirely of deferred tokens, it is assumed to match every row in ** the db. In this case the position-list is not populated at all. ** ** Or, if a phrase contains one or more deferred tokens and one or ** more non-deferred tokens, then the expression is advanced to the ** next possible match, considering only non-deferred tokens. In other ** words, if the phrase is "A B C", and "B" is deferred, the expression ** is advanced to the next row that contains an instance of "A * C", ** where "*" may match any single token. The position list in this case ** is populated as for "A * C" before returning. ** ** 2. NEAR is treated as AND. If the expression is "x NEAR y", it is ** advanced to point to the next row that matches "x AND y". ** ** See sqlite3Fts3EvalTestDeferred() for details on testing if a row is ** really a match, taking into account deferred tokens and NEAR operators. */ static void fts3EvalNextRow( Fts3Cursor *pCsr, /* FTS Cursor handle */ Fts3Expr *pExpr, /* Expr. to advance to next matching row */ int *pRc /* IN/OUT: Error code */ ){ if( *pRc==SQLITE_OK ){ int bDescDoclist = pCsr->bDesc; /* Used by DOCID_CMP() macro */ assert( pExpr->bEof==0 ); pExpr->bStart = 1; switch( pExpr->eType ){ case FTSQUERY_NEAR: case FTSQUERY_AND: { Fts3Expr *pLeft = pExpr->pLeft; Fts3Expr *pRight = pExpr->pRight; assert( !pLeft->bDeferred || !pRight->bDeferred ); if( pLeft->bDeferred ){ /* LHS is entirely deferred. So we assume it matches every row. ** Advance the RHS iterator to find the next row visited. */ fts3EvalNextRow(pCsr, pRight, pRc); pExpr->iDocid = pRight->iDocid; pExpr->bEof = pRight->bEof; }else if( pRight->bDeferred ){ /* RHS is entirely deferred. So we assume it matches every row. ** Advance the LHS iterator to find the next row visited. */ fts3EvalNextRow(pCsr, pLeft, pRc); pExpr->iDocid = pLeft->iDocid; pExpr->bEof = pLeft->bEof; }else{ /* Neither the RHS or LHS are deferred. */ fts3EvalNextRow(pCsr, pLeft, pRc); fts3EvalNextRow(pCsr, pRight, pRc); while( !pLeft->bEof && !pRight->bEof && *pRc==SQLITE_OK ){ sqlite3_int64 iDiff = DOCID_CMP(pLeft->iDocid, pRight->iDocid); if( iDiff==0 ) break; if( iDiff<0 ){ fts3EvalNextRow(pCsr, pLeft, pRc); }else{ fts3EvalNextRow(pCsr, pRight, pRc); } } pExpr->iDocid = pLeft->iDocid; pExpr->bEof = (pLeft->bEof || pRight->bEof); if( pExpr->eType==FTSQUERY_NEAR && pExpr->bEof ){ assert( pRight->eType==FTSQUERY_PHRASE ); if( pRight->pPhrase->doclist.aAll ){ Fts3Doclist *pDl = &pRight->pPhrase->doclist; while( *pRc==SQLITE_OK && pRight->bEof==0 ){ memset(pDl->pList, 0, pDl->nList); fts3EvalNextRow(pCsr, pRight, pRc); } } if( pLeft->pPhrase && pLeft->pPhrase->doclist.aAll ){ Fts3Doclist *pDl = &pLeft->pPhrase->doclist; while( *pRc==SQLITE_OK && pLeft->bEof==0 ){ memset(pDl->pList, 0, pDl->nList); fts3EvalNextRow(pCsr, pLeft, pRc); } } } } break; } case FTSQUERY_OR: { Fts3Expr *pLeft = pExpr->pLeft; Fts3Expr *pRight = pExpr->pRight; sqlite3_int64 iCmp = DOCID_CMP(pLeft->iDocid, pRight->iDocid); assert( pLeft->bStart || pLeft->iDocid==pRight->iDocid ); assert( pRight->bStart || pLeft->iDocid==pRight->iDocid ); if( pRight->bEof || (pLeft->bEof==0 && iCmp<0) ){ fts3EvalNextRow(pCsr, pLeft, pRc); }else if( pLeft->bEof || iCmp>0 ){ fts3EvalNextRow(pCsr, pRight, pRc); }else{ fts3EvalNextRow(pCsr, pLeft, pRc); fts3EvalNextRow(pCsr, pRight, pRc); } pExpr->bEof = (pLeft->bEof && pRight->bEof); iCmp = DOCID_CMP(pLeft->iDocid, pRight->iDocid); if( pRight->bEof || (pLeft->bEof==0 && iCmp<0) ){ pExpr->iDocid = pLeft->iDocid; }else{ pExpr->iDocid = pRight->iDocid; } break; } case FTSQUERY_NOT: { Fts3Expr *pLeft = pExpr->pLeft; Fts3Expr *pRight = pExpr->pRight; if( pRight->bStart==0 ){ fts3EvalNextRow(pCsr, pRight, pRc); assert( *pRc!=SQLITE_OK || pRight->bStart ); } fts3EvalNextRow(pCsr, pLeft, pRc); if( pLeft->bEof==0 ){ while( !*pRc && !pRight->bEof && DOCID_CMP(pLeft->iDocid, pRight->iDocid)>0 ){ fts3EvalNextRow(pCsr, pRight, pRc); } } pExpr->iDocid = pLeft->iDocid; pExpr->bEof = pLeft->bEof; break; } default: { Fts3Phrase *pPhrase = pExpr->pPhrase; fts3EvalInvalidatePoslist(pPhrase); *pRc = fts3EvalPhraseNext(pCsr, pPhrase, &pExpr->bEof); pExpr->iDocid = pPhrase->doclist.iDocid; break; } } } } /* ** If *pRc is not SQLITE_OK, or if pExpr is not the root node of a NEAR ** cluster, then this function returns 1 immediately. ** ** Otherwise, it checks if the current row really does match the NEAR ** expression, using the data currently stored in the position lists ** (Fts3Expr->pPhrase.doclist.pList/nList) for each phrase in the expression. ** ** If the current row is a match, the position list associated with each ** phrase in the NEAR expression is edited in place to contain only those ** phrase instances sufficiently close to their peers to satisfy all NEAR ** constraints. In this case it returns 1. If the NEAR expression does not ** match the current row, 0 is returned. The position lists may or may not ** be edited if 0 is returned. */ static int fts3EvalNearTest(Fts3Expr *pExpr, int *pRc){ int res = 1; /* The following block runs if pExpr is the root of a NEAR query. ** For example, the query: ** ** "w" NEAR "x" NEAR "y" NEAR "z" ** ** which is represented in tree form as: ** ** | ** +--NEAR--+ <-- root of NEAR query ** | | ** +--NEAR--+ "z" ** | | ** +--NEAR--+ "y" ** | | ** "w" "x" ** ** The right-hand child of a NEAR node is always a phrase. The ** left-hand child may be either a phrase or a NEAR node. There are ** no exceptions to this - it's the way the parser in fts3_expr.c works. */ if( *pRc==SQLITE_OK && pExpr->eType==FTSQUERY_NEAR && (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) ){ Fts3Expr *p; int nTmp = 0; /* Bytes of temp space */ char *aTmp; /* Temp space for PoslistNearMerge() */ /* Allocate temporary working space. */ for(p=pExpr; p->pLeft; p=p->pLeft){ assert( p->pRight->pPhrase->doclist.nList>0 ); nTmp += p->pRight->pPhrase->doclist.nList; } nTmp += p->pPhrase->doclist.nList; aTmp = sqlite3_malloc(nTmp*2); if( !aTmp ){ *pRc = SQLITE_NOMEM; res = 0; }else{ char *aPoslist = p->pPhrase->doclist.pList; int nToken = p->pPhrase->nToken; for(p=p->pParent;res && p && p->eType==FTSQUERY_NEAR; p=p->pParent){ Fts3Phrase *pPhrase = p->pRight->pPhrase; int nNear = p->nNear; res = fts3EvalNearTrim(nNear, aTmp, &aPoslist, &nToken, pPhrase); } aPoslist = pExpr->pRight->pPhrase->doclist.pList; nToken = pExpr->pRight->pPhrase->nToken; for(p=pExpr->pLeft; p && res; p=p->pLeft){ int nNear; Fts3Phrase *pPhrase; assert( p->pParent && p->pParent->pLeft==p ); nNear = p->pParent->nNear; pPhrase = ( p->eType==FTSQUERY_NEAR ? p->pRight->pPhrase : p->pPhrase ); res = fts3EvalNearTrim(nNear, aTmp, &aPoslist, &nToken, pPhrase); } } sqlite3_free(aTmp); } return res; } /* ** This function is a helper function for sqlite3Fts3EvalTestDeferred(). ** Assuming no error occurs or has occurred, It returns non-zero if the ** expression passed as the second argument matches the row that pCsr ** currently points to, or zero if it does not. ** ** If *pRc is not SQLITE_OK when this function is called, it is a no-op. ** If an error occurs during execution of this function, *pRc is set to ** the appropriate SQLite error code. In this case the returned value is ** undefined. */ static int fts3EvalTestExpr( Fts3Cursor *pCsr, /* FTS cursor handle */ Fts3Expr *pExpr, /* Expr to test. May or may not be root. */ int *pRc /* IN/OUT: Error code */ ){ int bHit = 1; /* Return value */ if( *pRc==SQLITE_OK ){ switch( pExpr->eType ){ case FTSQUERY_NEAR: case FTSQUERY_AND: bHit = ( fts3EvalTestExpr(pCsr, pExpr->pLeft, pRc) && fts3EvalTestExpr(pCsr, pExpr->pRight, pRc) && fts3EvalNearTest(pExpr, pRc) ); /* If the NEAR expression does not match any rows, zero the doclist for ** all phrases involved in the NEAR. This is because the snippet(), ** offsets() and matchinfo() functions are not supposed to recognize ** any instances of phrases that are part of unmatched NEAR queries. ** For example if this expression: ** ** ... MATCH 'a OR (b NEAR c)' ** ** is matched against a row containing: ** ** 'a b d e' ** ** then any snippet() should ony highlight the "a" term, not the "b" ** (as "b" is part of a non-matching NEAR clause). */ if( bHit==0 && pExpr->eType==FTSQUERY_NEAR && (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) ){ Fts3Expr *p; for(p=pExpr; p->pPhrase==0; p=p->pLeft){ if( p->pRight->iDocid==pCsr->iPrevId ){ fts3EvalInvalidatePoslist(p->pRight->pPhrase); } } if( p->iDocid==pCsr->iPrevId ){ fts3EvalInvalidatePoslist(p->pPhrase); } } break; case FTSQUERY_OR: { int bHit1 = fts3EvalTestExpr(pCsr, pExpr->pLeft, pRc); int bHit2 = fts3EvalTestExpr(pCsr, pExpr->pRight, pRc); bHit = bHit1 || bHit2; break; } case FTSQUERY_NOT: bHit = ( fts3EvalTestExpr(pCsr, pExpr->pLeft, pRc) && !fts3EvalTestExpr(pCsr, pExpr->pRight, pRc) ); break; default: { #ifndef SQLITE_DISABLE_FTS4_DEFERRED if( pCsr->pDeferred && (pExpr->iDocid==pCsr->iPrevId || pExpr->bDeferred) ){ Fts3Phrase *pPhrase = pExpr->pPhrase; assert( pExpr->bDeferred || pPhrase->doclist.bFreeList==0 ); if( pExpr->bDeferred ){ fts3EvalInvalidatePoslist(pPhrase); } *pRc = fts3EvalDeferredPhrase(pCsr, pPhrase); bHit = (pPhrase->doclist.pList!=0); pExpr->iDocid = pCsr->iPrevId; }else #endif { bHit = (pExpr->bEof==0 && pExpr->iDocid==pCsr->iPrevId); } break; } } } return bHit; } /* ** This function is called as the second part of each xNext operation when ** iterating through the results of a full-text query. At this point the ** cursor points to a row that matches the query expression, with the ** following caveats: ** ** * Up until this point, "NEAR" operators in the expression have been ** treated as "AND". ** ** * Deferred tokens have not yet been considered. ** ** If *pRc is not SQLITE_OK when this function is called, it immediately ** returns 0. Otherwise, it tests whether or not after considering NEAR ** operators and deferred tokens the current row is still a match for the ** expression. It returns 1 if both of the following are true: ** ** 1. *pRc is SQLITE_OK when this function returns, and ** ** 2. After scanning the current FTS table row for the deferred tokens, ** it is determined that the row does *not* match the query. ** ** Or, if no error occurs and it seems the current row does match the FTS ** query, return 0. */ int sqlite3Fts3EvalTestDeferred(Fts3Cursor *pCsr, int *pRc){ int rc = *pRc; int bMiss = 0; if( rc==SQLITE_OK ){ /* If there are one or more deferred tokens, load the current row into ** memory and scan it to determine the position list for each deferred ** token. Then, see if this row is really a match, considering deferred ** tokens and NEAR operators (neither of which were taken into account ** earlier, by fts3EvalNextRow()). */ if( pCsr->pDeferred ){ rc = fts3CursorSeek(0, pCsr); if( rc==SQLITE_OK ){ rc = sqlite3Fts3CacheDeferredDoclists(pCsr); } } bMiss = (0==fts3EvalTestExpr(pCsr, pCsr->pExpr, &rc)); /* Free the position-lists accumulated for each deferred token above. */ sqlite3Fts3FreeDeferredDoclists(pCsr); *pRc = rc; } return (rc==SQLITE_OK && bMiss); } /* ** Advance to the next document that matches the FTS expression in ** Fts3Cursor.pExpr. */ static int fts3EvalNext(Fts3Cursor *pCsr){ int rc = SQLITE_OK; /* Return Code */ Fts3Expr *pExpr = pCsr->pExpr; assert( pCsr->isEof==0 ); if( pExpr==0 ){ pCsr->isEof = 1; }else{ do { if( pCsr->isRequireSeek==0 ){ sqlite3_reset(pCsr->pStmt); } assert( sqlite3_data_count(pCsr->pStmt)==0 ); fts3EvalNextRow(pCsr, pExpr, &rc); pCsr->isEof = pExpr->bEof; pCsr->isRequireSeek = 1; pCsr->isMatchinfoNeeded = 1; pCsr->iPrevId = pExpr->iDocid; }while( pCsr->isEof==0 && sqlite3Fts3EvalTestDeferred(pCsr, &rc) ); } /* Check if the cursor is past the end of the docid range specified ** by Fts3Cursor.iMinDocid/iMaxDocid. If so, set the EOF flag. */ if( rc==SQLITE_OK && ( (pCsr->bDesc==0 && pCsr->iPrevId>pCsr->iMaxDocid) || (pCsr->bDesc!=0 && pCsr->iPrevIdiMinDocid) )){ pCsr->isEof = 1; } return rc; } /* ** Restart interation for expression pExpr so that the next call to ** fts3EvalNext() visits the first row. Do not allow incremental ** loading or merging of phrase doclists for this iteration. ** ** If *pRc is other than SQLITE_OK when this function is called, it is ** a no-op. If an error occurs within this function, *pRc is set to an ** SQLite error code before returning. */ static void fts3EvalRestart( Fts3Cursor *pCsr, Fts3Expr *pExpr, int *pRc ){ if( pExpr && *pRc==SQLITE_OK ){ Fts3Phrase *pPhrase = pExpr->pPhrase; if( pPhrase ){ fts3EvalInvalidatePoslist(pPhrase); if( pPhrase->bIncr ){ int i; for(i=0; inToken; i++){ Fts3PhraseToken *pToken = &pPhrase->aToken[i]; assert( pToken->pDeferred==0 ); if( pToken->pSegcsr ){ sqlite3Fts3MsrIncrRestart(pToken->pSegcsr); } } *pRc = fts3EvalPhraseStart(pCsr, 0, pPhrase); } pPhrase->doclist.pNextDocid = 0; pPhrase->doclist.iDocid = 0; pPhrase->pOrPoslist = 0; } pExpr->iDocid = 0; pExpr->bEof = 0; pExpr->bStart = 0; fts3EvalRestart(pCsr, pExpr->pLeft, pRc); fts3EvalRestart(pCsr, pExpr->pRight, pRc); } } /* ** After allocating the Fts3Expr.aMI[] array for each phrase in the ** expression rooted at pExpr, the cursor iterates through all rows matched ** by pExpr, calling this function for each row. This function increments ** the values in Fts3Expr.aMI[] according to the position-list currently ** found in Fts3Expr.pPhrase->doclist.pList for each of the phrase ** expression nodes. */ static void fts3EvalUpdateCounts(Fts3Expr *pExpr){ if( pExpr ){ Fts3Phrase *pPhrase = pExpr->pPhrase; if( pPhrase && pPhrase->doclist.pList ){ int iCol = 0; char *p = pPhrase->doclist.pList; assert( *p ); while( 1 ){ u8 c = 0; int iCnt = 0; while( 0xFE & (*p | c) ){ if( (c&0x80)==0 ) iCnt++; c = *p++ & 0x80; } /* aMI[iCol*3 + 1] = Number of occurrences ** aMI[iCol*3 + 2] = Number of rows containing at least one instance */ pExpr->aMI[iCol*3 + 1] += iCnt; pExpr->aMI[iCol*3 + 2] += (iCnt>0); if( *p==0x00 ) break; p++; p += fts3GetVarint32(p, &iCol); } } fts3EvalUpdateCounts(pExpr->pLeft); fts3EvalUpdateCounts(pExpr->pRight); } } /* ** Expression pExpr must be of type FTSQUERY_PHRASE. ** ** If it is not already allocated and populated, this function allocates and ** populates the Fts3Expr.aMI[] array for expression pExpr. If pExpr is part ** of a NEAR expression, then it also allocates and populates the same array ** for all other phrases that are part of the NEAR expression. ** ** SQLITE_OK is returned if the aMI[] array is successfully allocated and ** populated. Otherwise, if an error occurs, an SQLite error code is returned. */ static int fts3EvalGatherStats( Fts3Cursor *pCsr, /* Cursor object */ Fts3Expr *pExpr /* FTSQUERY_PHRASE expression */ ){ int rc = SQLITE_OK; /* Return code */ assert( pExpr->eType==FTSQUERY_PHRASE ); if( pExpr->aMI==0 ){ Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; Fts3Expr *pRoot; /* Root of NEAR expression */ Fts3Expr *p; /* Iterator used for several purposes */ sqlite3_int64 iPrevId = pCsr->iPrevId; sqlite3_int64 iDocid; u8 bEof; /* Find the root of the NEAR expression */ pRoot = pExpr; while( pRoot->pParent && pRoot->pParent->eType==FTSQUERY_NEAR ){ pRoot = pRoot->pParent; } iDocid = pRoot->iDocid; bEof = pRoot->bEof; assert( pRoot->bStart ); /* Allocate space for the aMSI[] array of each FTSQUERY_PHRASE node */ for(p=pRoot; p; p=p->pLeft){ Fts3Expr *pE = (p->eType==FTSQUERY_PHRASE?p:p->pRight); assert( pE->aMI==0 ); pE->aMI = (u32 *)sqlite3_malloc(pTab->nColumn * 3 * sizeof(u32)); if( !pE->aMI ) return SQLITE_NOMEM; memset(pE->aMI, 0, pTab->nColumn * 3 * sizeof(u32)); } fts3EvalRestart(pCsr, pRoot, &rc); while( pCsr->isEof==0 && rc==SQLITE_OK ){ do { /* Ensure the %_content statement is reset. */ if( pCsr->isRequireSeek==0 ) sqlite3_reset(pCsr->pStmt); assert( sqlite3_data_count(pCsr->pStmt)==0 ); /* Advance to the next document */ fts3EvalNextRow(pCsr, pRoot, &rc); pCsr->isEof = pRoot->bEof; pCsr->isRequireSeek = 1; pCsr->isMatchinfoNeeded = 1; pCsr->iPrevId = pRoot->iDocid; }while( pCsr->isEof==0 && pRoot->eType==FTSQUERY_NEAR && sqlite3Fts3EvalTestDeferred(pCsr, &rc) ); if( rc==SQLITE_OK && pCsr->isEof==0 ){ fts3EvalUpdateCounts(pRoot); } } pCsr->isEof = 0; pCsr->iPrevId = iPrevId; if( bEof ){ pRoot->bEof = bEof; }else{ /* Caution: pRoot may iterate through docids in ascending or descending ** order. For this reason, even though it seems more defensive, the ** do loop can not be written: ** ** do {...} while( pRoot->iDocidbEof==0 ); }while( pRoot->iDocid!=iDocid && rc==SQLITE_OK ); } } return rc; } /* ** This function is used by the matchinfo() module to query a phrase ** expression node for the following information: ** ** 1. The total number of occurrences of the phrase in each column of ** the FTS table (considering all rows), and ** ** 2. For each column, the number of rows in the table for which the ** column contains at least one instance of the phrase. ** ** If no error occurs, SQLITE_OK is returned and the values for each column ** written into the array aiOut as follows: ** ** aiOut[iCol*3 + 1] = Number of occurrences ** aiOut[iCol*3 + 2] = Number of rows containing at least one instance ** ** Caveats: ** ** * If a phrase consists entirely of deferred tokens, then all output ** values are set to the number of documents in the table. In other ** words we assume that very common tokens occur exactly once in each ** column of each row of the table. ** ** * If a phrase contains some deferred tokens (and some non-deferred ** tokens), count the potential occurrence identified by considering ** the non-deferred tokens instead of actual phrase occurrences. ** ** * If the phrase is part of a NEAR expression, then only phrase instances ** that meet the NEAR constraint are included in the counts. */ int sqlite3Fts3EvalPhraseStats( Fts3Cursor *pCsr, /* FTS cursor handle */ Fts3Expr *pExpr, /* Phrase expression */ u32 *aiOut /* Array to write results into (see above) */ ){ Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; int rc = SQLITE_OK; int iCol; if( pExpr->bDeferred && pExpr->pParent->eType!=FTSQUERY_NEAR ){ assert( pCsr->nDoc>0 ); for(iCol=0; iColnColumn; iCol++){ aiOut[iCol*3 + 1] = (u32)pCsr->nDoc; aiOut[iCol*3 + 2] = (u32)pCsr->nDoc; } }else{ rc = fts3EvalGatherStats(pCsr, pExpr); if( rc==SQLITE_OK ){ assert( pExpr->aMI ); for(iCol=0; iColnColumn; iCol++){ aiOut[iCol*3 + 1] = pExpr->aMI[iCol*3 + 1]; aiOut[iCol*3 + 2] = pExpr->aMI[iCol*3 + 2]; } } } return rc; } /* ** The expression pExpr passed as the second argument to this function ** must be of type FTSQUERY_PHRASE. ** ** The returned value is either NULL or a pointer to a buffer containing ** a position-list indicating the occurrences of the phrase in column iCol ** of the current row. ** ** More specifically, the returned buffer contains 1 varint for each ** occurrence of the phrase in the column, stored using the normal (delta+2) ** compression and is terminated by either an 0x01 or 0x00 byte. For example, ** if the requested column contains "a b X c d X X" and the position-list ** for 'X' is requested, the buffer returned may contain: ** ** 0x04 0x05 0x03 0x01 or 0x04 0x05 0x03 0x00 ** ** This function works regardless of whether or not the phrase is deferred, ** incremental, or neither. */ int sqlite3Fts3EvalPhrasePoslist( Fts3Cursor *pCsr, /* FTS3 cursor object */ Fts3Expr *pExpr, /* Phrase to return doclist for */ int iCol, /* Column to return position list for */ char **ppOut /* OUT: Pointer to position list */ ){ Fts3Phrase *pPhrase = pExpr->pPhrase; Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; char *pIter; int iThis; sqlite3_int64 iDocid; /* If this phrase is applies specifically to some column other than ** column iCol, return a NULL pointer. */ *ppOut = 0; assert( iCol>=0 && iColnColumn ); if( (pPhrase->iColumnnColumn && pPhrase->iColumn!=iCol) ){ return SQLITE_OK; } iDocid = pExpr->iDocid; pIter = pPhrase->doclist.pList; if( iDocid!=pCsr->iPrevId || pExpr->bEof ){ int rc = SQLITE_OK; int bDescDoclist = pTab->bDescIdx; /* For DOCID_CMP macro */ int bOr = 0; u8 bTreeEof = 0; Fts3Expr *p; /* Used to iterate from pExpr to root */ Fts3Expr *pNear; /* Most senior NEAR ancestor (or pExpr) */ int bMatch; /* Check if this phrase descends from an OR expression node. If not, ** return NULL. Otherwise, the entry that corresponds to docid ** pCsr->iPrevId may lie earlier in the doclist buffer. Or, if the ** tree that the node is part of has been marked as EOF, but the node ** itself is not EOF, then it may point to an earlier entry. */ pNear = pExpr; for(p=pExpr->pParent; p; p=p->pParent){ if( p->eType==FTSQUERY_OR ) bOr = 1; if( p->eType==FTSQUERY_NEAR ) pNear = p; if( p->bEof ) bTreeEof = 1; } if( bOr==0 ) return SQLITE_OK; /* This is the descendent of an OR node. In this case we cannot use ** an incremental phrase. Load the entire doclist for the phrase ** into memory in this case. */ if( pPhrase->bIncr ){ int bEofSave = pNear->bEof; fts3EvalRestart(pCsr, pNear, &rc); while( rc==SQLITE_OK && !pNear->bEof ){ fts3EvalNextRow(pCsr, pNear, &rc); if( bEofSave==0 && pNear->iDocid==iDocid ) break; } assert( rc!=SQLITE_OK || pPhrase->bIncr==0 ); } if( bTreeEof ){ while( rc==SQLITE_OK && !pNear->bEof ){ fts3EvalNextRow(pCsr, pNear, &rc); } } if( rc!=SQLITE_OK ) return rc; bMatch = 1; for(p=pNear; p; p=p->pLeft){ u8 bEof = 0; Fts3Expr *pTest = p; Fts3Phrase *pPh; assert( pTest->eType==FTSQUERY_NEAR || pTest->eType==FTSQUERY_PHRASE ); if( pTest->eType==FTSQUERY_NEAR ) pTest = pTest->pRight; assert( pTest->eType==FTSQUERY_PHRASE ); pPh = pTest->pPhrase; pIter = pPh->pOrPoslist; iDocid = pPh->iOrDocid; if( pCsr->bDesc==bDescDoclist ){ bEof = !pPh->doclist.nAll || (pIter >= (pPh->doclist.aAll + pPh->doclist.nAll)); while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)<0 ) && bEof==0 ){ sqlite3Fts3DoclistNext( bDescDoclist, pPh->doclist.aAll, pPh->doclist.nAll, &pIter, &iDocid, &bEof ); } }else{ bEof = !pPh->doclist.nAll || (pIter && pIter<=pPh->doclist.aAll); while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)>0 ) && bEof==0 ){ int dummy; sqlite3Fts3DoclistPrev( bDescDoclist, pPh->doclist.aAll, pPh->doclist.nAll, &pIter, &iDocid, &dummy, &bEof ); } } pPh->pOrPoslist = pIter; pPh->iOrDocid = iDocid; if( bEof || iDocid!=pCsr->iPrevId ) bMatch = 0; } if( bMatch ){ pIter = pPhrase->pOrPoslist; }else{ pIter = 0; } } if( pIter==0 ) return SQLITE_OK; if( *pIter==0x01 ){ pIter++; pIter += fts3GetVarint32(pIter, &iThis); }else{ iThis = 0; } while( iThisdoclist, and ** * any Fts3MultiSegReader objects held by phrase tokens. */ void sqlite3Fts3EvalPhraseCleanup(Fts3Phrase *pPhrase){ if( pPhrase ){ int i; sqlite3_free(pPhrase->doclist.aAll); fts3EvalInvalidatePoslist(pPhrase); memset(&pPhrase->doclist, 0, sizeof(Fts3Doclist)); for(i=0; inToken; i++){ fts3SegReaderCursorFree(pPhrase->aToken[i].pSegcsr); pPhrase->aToken[i].pSegcsr = 0; } } } /* ** Return SQLITE_CORRUPT_VTAB. */ #ifdef SQLITE_DEBUG int sqlite3Fts3Corrupt(){ return SQLITE_CORRUPT_VTAB; } #endif #if !SQLITE_CORE /* ** Initialize API pointer table, if required. */ #ifdef _WIN32 __declspec(dllexport) #endif int sqlite3_fts3_init( sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ SQLITE_EXTENSION_INIT2(pApi) return sqlite3Fts3Init(db); } #endif #endif ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3.h ================================================ /* ** 2006 Oct 10 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This header file is used by programs that want to link against the ** FTS3 library. All it does is declare the sqlite3Fts3Init() interface. */ #include "sqlite3.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ int sqlite3Fts3Init(sqlite3 *db); #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3Int.h ================================================ /* ** 2009 Nov 12 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** */ #ifndef _FTSINT_H #define _FTSINT_H #if !defined(NDEBUG) && !defined(SQLITE_DEBUG) # define NDEBUG 1 #endif /* FTS3/FTS4 require virtual tables */ #ifdef SQLITE_OMIT_VIRTUALTABLE # undef SQLITE_ENABLE_FTS3 # undef SQLITE_ENABLE_FTS4 #endif /* ** FTS4 is really an extension for FTS3. It is enabled using the ** SQLITE_ENABLE_FTS3 macro. But to avoid confusion we also all ** the SQLITE_ENABLE_FTS4 macro to serve as an alisse for SQLITE_ENABLE_FTS3. */ #if defined(SQLITE_ENABLE_FTS4) && !defined(SQLITE_ENABLE_FTS3) # define SQLITE_ENABLE_FTS3 #endif #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) /* If not building as part of the core, include sqlite3ext.h. */ #ifndef SQLITE_CORE # include "sqlite3ext.h" SQLITE_EXTENSION_INIT3 #endif #include "sqlite3.h" #include "fts3_tokenizer.h" #include "fts3_hash.h" /* ** This constant determines the maximum depth of an FTS expression tree ** that the library will create and use. FTS uses recursion to perform ** various operations on the query tree, so the disadvantage of a large ** limit is that it may allow very large queries to use large amounts ** of stack space (perhaps causing a stack overflow). */ #ifndef SQLITE_FTS3_MAX_EXPR_DEPTH # define SQLITE_FTS3_MAX_EXPR_DEPTH 12 #endif /* ** This constant controls how often segments are merged. Once there are ** FTS3_MERGE_COUNT segments of level N, they are merged into a single ** segment of level N+1. */ #define FTS3_MERGE_COUNT 16 /* ** This is the maximum amount of data (in bytes) to store in the ** Fts3Table.pendingTerms hash table. Normally, the hash table is ** populated as documents are inserted/updated/deleted in a transaction ** and used to create a new segment when the transaction is committed. ** However if this limit is reached midway through a transaction, a new ** segment is created and the hash table cleared immediately. */ #define FTS3_MAX_PENDING_DATA (1*1024*1024) /* ** Macro to return the number of elements in an array. SQLite has a ** similar macro called ArraySize(). Use a different name to avoid ** a collision when building an amalgamation with built-in FTS3. */ #define SizeofArray(X) ((int)(sizeof(X)/sizeof(X[0]))) #ifndef MIN # define MIN(x,y) ((x)<(y)?(x):(y)) #endif #ifndef MAX # define MAX(x,y) ((x)>(y)?(x):(y)) #endif /* ** Maximum length of a varint encoded integer. The varint format is different ** from that used by SQLite, so the maximum length is 10, not 9. */ #define FTS3_VARINT_MAX 10 /* ** FTS4 virtual tables may maintain multiple indexes - one index of all terms ** in the document set and zero or more prefix indexes. All indexes are stored ** as one or more b+-trees in the %_segments and %_segdir tables. ** ** It is possible to determine which index a b+-tree belongs to based on the ** value stored in the "%_segdir.level" column. Given this value L, the index ** that the b+-tree belongs to is (L<<10). In other words, all b+-trees with ** level values between 0 and 1023 (inclusive) belong to index 0, all levels ** between 1024 and 2047 to index 1, and so on. ** ** It is considered impossible for an index to use more than 1024 levels. In ** theory though this may happen, but only after at least ** (FTS3_MERGE_COUNT^1024) separate flushes of the pending-terms tables. */ #define FTS3_SEGDIR_MAXLEVEL 1024 #define FTS3_SEGDIR_MAXLEVEL_STR "1024" /* ** The testcase() macro is only used by the amalgamation. If undefined, ** make it a no-op. */ #ifndef testcase # define testcase(X) #endif /* ** Terminator values for position-lists and column-lists. */ #define POS_COLUMN (1) /* Column-list terminator */ #define POS_END (0) /* Position-list terminator */ /* ** This section provides definitions to allow the ** FTS3 extension to be compiled outside of the ** amalgamation. */ #ifndef SQLITE_AMALGAMATION /* ** Macros indicating that conditional expressions are always true or ** false. */ #ifdef SQLITE_COVERAGE_TEST # define ALWAYS(x) (1) # define NEVER(X) (0) #elif defined(SQLITE_DEBUG) # define ALWAYS(x) sqlite3Fts3Always((x)!=0) # define NEVER(x) sqlite3Fts3Never((x)!=0) int sqlite3Fts3Always(int b); int sqlite3Fts3Never(int b); #else # define ALWAYS(x) (x) # define NEVER(x) (x) #endif /* ** Internal types used by SQLite. */ typedef unsigned char u8; /* 1-byte (or larger) unsigned integer */ typedef short int i16; /* 2-byte (or larger) signed integer */ typedef unsigned int u32; /* 4-byte unsigned integer */ typedef sqlite3_uint64 u64; /* 8-byte unsigned integer */ typedef sqlite3_int64 i64; /* 8-byte signed integer */ /* ** Macro used to suppress compiler warnings for unused parameters. */ #define UNUSED_PARAMETER(x) (void)(x) /* ** Activate assert() only if SQLITE_TEST is enabled. */ #if !defined(NDEBUG) && !defined(SQLITE_DEBUG) # define NDEBUG 1 #endif /* ** The TESTONLY macro is used to enclose variable declarations or ** other bits of code that are needed to support the arguments ** within testcase() and assert() macros. */ #if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) # define TESTONLY(X) X #else # define TESTONLY(X) #endif #endif /* SQLITE_AMALGAMATION */ #ifdef SQLITE_DEBUG int sqlite3Fts3Corrupt(void); # define FTS_CORRUPT_VTAB sqlite3Fts3Corrupt() #else # define FTS_CORRUPT_VTAB SQLITE_CORRUPT_VTAB #endif typedef struct Fts3Table Fts3Table; typedef struct Fts3Cursor Fts3Cursor; typedef struct Fts3Expr Fts3Expr; typedef struct Fts3Phrase Fts3Phrase; typedef struct Fts3PhraseToken Fts3PhraseToken; typedef struct Fts3Doclist Fts3Doclist; typedef struct Fts3SegFilter Fts3SegFilter; typedef struct Fts3DeferredToken Fts3DeferredToken; typedef struct Fts3SegReader Fts3SegReader; typedef struct Fts3MultiSegReader Fts3MultiSegReader; typedef struct MatchinfoBuffer MatchinfoBuffer; /* ** A connection to a fulltext index is an instance of the following ** structure. The xCreate and xConnect methods create an instance ** of this structure and xDestroy and xDisconnect free that instance. ** All other methods receive a pointer to the structure as one of their ** arguments. */ struct Fts3Table { sqlite3_vtab base; /* Base class used by SQLite core */ sqlite3 *db; /* The database connection */ const char *zDb; /* logical database name */ const char *zName; /* virtual table name */ int nColumn; /* number of named columns in virtual table */ char **azColumn; /* column names. malloced */ u8 *abNotindexed; /* True for 'notindexed' columns */ sqlite3_tokenizer *pTokenizer; /* tokenizer for inserts and queries */ char *zContentTbl; /* content=xxx option, or NULL */ char *zLanguageid; /* languageid=xxx option, or NULL */ int nAutoincrmerge; /* Value configured by 'automerge' */ u32 nLeafAdd; /* Number of leaf blocks added this trans */ /* Precompiled statements used by the implementation. Each of these ** statements is run and reset within a single virtual table API call. */ sqlite3_stmt *aStmt[40]; sqlite3_stmt *pSeekStmt; /* Cache for fts3CursorSeekStmt() */ char *zReadExprlist; char *zWriteExprlist; int nNodeSize; /* Soft limit for node size */ u8 bFts4; /* True for FTS4, false for FTS3 */ u8 bHasStat; /* True if %_stat table exists (2==unknown) */ u8 bHasDocsize; /* True if %_docsize table exists */ u8 bDescIdx; /* True if doclists are in reverse order */ u8 bIgnoreSavepoint; /* True to ignore xSavepoint invocations */ int nPgsz; /* Page size for host database */ char *zSegmentsTbl; /* Name of %_segments table */ sqlite3_blob *pSegments; /* Blob handle open on %_segments table */ /* ** The following array of hash tables is used to buffer pending index ** updates during transactions. All pending updates buffered at any one ** time must share a common language-id (see the FTS4 langid= feature). ** The current language id is stored in variable iPrevLangid. ** ** A single FTS4 table may have multiple full-text indexes. For each index ** there is an entry in the aIndex[] array. Index 0 is an index of all the ** terms that appear in the document set. Each subsequent index in aIndex[] ** is an index of prefixes of a specific length. ** ** Variable nPendingData contains an estimate the memory consumed by the ** pending data structures, including hash table overhead, but not including ** malloc overhead. When nPendingData exceeds nMaxPendingData, all hash ** tables are flushed to disk. Variable iPrevDocid is the docid of the most ** recently inserted record. */ int nIndex; /* Size of aIndex[] */ struct Fts3Index { int nPrefix; /* Prefix length (0 for main terms index) */ Fts3Hash hPending; /* Pending terms table for this index */ } *aIndex; int nMaxPendingData; /* Max pending data before flush to disk */ int nPendingData; /* Current bytes of pending data */ sqlite_int64 iPrevDocid; /* Docid of most recently inserted document */ int iPrevLangid; /* Langid of recently inserted document */ int bPrevDelete; /* True if last operation was a delete */ #if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) /* State variables used for validating that the transaction control ** methods of the virtual table are called at appropriate times. These ** values do not contribute to FTS functionality; they are used for ** verifying the operation of the SQLite core. */ int inTransaction; /* True after xBegin but before xCommit/xRollback */ int mxSavepoint; /* Largest valid xSavepoint integer */ #endif #ifdef SQLITE_TEST /* True to disable the incremental doclist optimization. This is controled ** by special insert command 'test-no-incr-doclist'. */ int bNoIncrDoclist; #endif }; /* ** When the core wants to read from the virtual table, it creates a ** virtual table cursor (an instance of the following structure) using ** the xOpen method. Cursors are destroyed using the xClose method. */ struct Fts3Cursor { sqlite3_vtab_cursor base; /* Base class used by SQLite core */ i16 eSearch; /* Search strategy (see below) */ u8 isEof; /* True if at End Of Results */ u8 isRequireSeek; /* True if must seek pStmt to %_content row */ u8 bSeekStmt; /* True if pStmt is a seek */ sqlite3_stmt *pStmt; /* Prepared statement in use by the cursor */ Fts3Expr *pExpr; /* Parsed MATCH query string */ int iLangid; /* Language being queried for */ int nPhrase; /* Number of matchable phrases in query */ Fts3DeferredToken *pDeferred; /* Deferred search tokens, if any */ sqlite3_int64 iPrevId; /* Previous id read from aDoclist */ char *pNextId; /* Pointer into the body of aDoclist */ char *aDoclist; /* List of docids for full-text queries */ int nDoclist; /* Size of buffer at aDoclist */ u8 bDesc; /* True to sort in descending order */ int eEvalmode; /* An FTS3_EVAL_XX constant */ int nRowAvg; /* Average size of database rows, in pages */ sqlite3_int64 nDoc; /* Documents in table */ i64 iMinDocid; /* Minimum docid to return */ i64 iMaxDocid; /* Maximum docid to return */ int isMatchinfoNeeded; /* True when aMatchinfo[] needs filling in */ MatchinfoBuffer *pMIBuffer; /* Buffer for matchinfo data */ }; #define FTS3_EVAL_FILTER 0 #define FTS3_EVAL_NEXT 1 #define FTS3_EVAL_MATCHINFO 2 /* ** The Fts3Cursor.eSearch member is always set to one of the following. ** Actualy, Fts3Cursor.eSearch can be greater than or equal to ** FTS3_FULLTEXT_SEARCH. If so, then Fts3Cursor.eSearch - 2 is the index ** of the column to be searched. For example, in ** ** CREATE VIRTUAL TABLE ex1 USING fts3(a,b,c,d); ** SELECT docid FROM ex1 WHERE b MATCH 'one two three'; ** ** Because the LHS of the MATCH operator is 2nd column "b", ** Fts3Cursor.eSearch will be set to FTS3_FULLTEXT_SEARCH+1. (+0 for a, ** +1 for b, +2 for c, +3 for d.) If the LHS of MATCH were "ex1" ** indicating that all columns should be searched, ** then eSearch would be set to FTS3_FULLTEXT_SEARCH+4. */ #define FTS3_FULLSCAN_SEARCH 0 /* Linear scan of %_content table */ #define FTS3_DOCID_SEARCH 1 /* Lookup by rowid on %_content table */ #define FTS3_FULLTEXT_SEARCH 2 /* Full-text index search */ /* ** The lower 16-bits of the sqlite3_index_info.idxNum value set by ** the xBestIndex() method contains the Fts3Cursor.eSearch value described ** above. The upper 16-bits contain a combination of the following ** bits, used to describe extra constraints on full-text searches. */ #define FTS3_HAVE_LANGID 0x00010000 /* languageid=? */ #define FTS3_HAVE_DOCID_GE 0x00020000 /* docid>=? */ #define FTS3_HAVE_DOCID_LE 0x00040000 /* docid<=? */ struct Fts3Doclist { char *aAll; /* Array containing doclist (or NULL) */ int nAll; /* Size of a[] in bytes */ char *pNextDocid; /* Pointer to next docid */ sqlite3_int64 iDocid; /* Current docid (if pList!=0) */ int bFreeList; /* True if pList should be sqlite3_free()d */ char *pList; /* Pointer to position list following iDocid */ int nList; /* Length of position list */ }; /* ** A "phrase" is a sequence of one or more tokens that must match in ** sequence. A single token is the base case and the most common case. ** For a sequence of tokens contained in double-quotes (i.e. "one two three") ** nToken will be the number of tokens in the string. */ struct Fts3PhraseToken { char *z; /* Text of the token */ int n; /* Number of bytes in buffer z */ int isPrefix; /* True if token ends with a "*" character */ int bFirst; /* True if token must appear at position 0 */ /* Variables above this point are populated when the expression is ** parsed (by code in fts3_expr.c). Below this point the variables are ** used when evaluating the expression. */ Fts3DeferredToken *pDeferred; /* Deferred token object for this token */ Fts3MultiSegReader *pSegcsr; /* Segment-reader for this token */ }; struct Fts3Phrase { /* Cache of doclist for this phrase. */ Fts3Doclist doclist; int bIncr; /* True if doclist is loaded incrementally */ int iDoclistToken; /* Used by sqlite3Fts3EvalPhrasePoslist() if this is a descendent of an ** OR condition. */ char *pOrPoslist; i64 iOrDocid; /* Variables below this point are populated by fts3_expr.c when parsing ** a MATCH expression. Everything above is part of the evaluation phase. */ int nToken; /* Number of tokens in the phrase */ int iColumn; /* Index of column this phrase must match */ Fts3PhraseToken aToken[1]; /* One entry for each token in the phrase */ }; /* ** A tree of these objects forms the RHS of a MATCH operator. ** ** If Fts3Expr.eType is FTSQUERY_PHRASE and isLoaded is true, then aDoclist ** points to a malloced buffer, size nDoclist bytes, containing the results ** of this phrase query in FTS3 doclist format. As usual, the initial ** "Length" field found in doclists stored on disk is omitted from this ** buffer. ** ** Variable aMI is used only for FTSQUERY_NEAR nodes to store the global ** matchinfo data. If it is not NULL, it points to an array of size nCol*3, ** where nCol is the number of columns in the queried FTS table. The array ** is populated as follows: ** ** aMI[iCol*3 + 0] = Undefined ** aMI[iCol*3 + 1] = Number of occurrences ** aMI[iCol*3 + 2] = Number of rows containing at least one instance ** ** The aMI array is allocated using sqlite3_malloc(). It should be freed ** when the expression node is. */ struct Fts3Expr { int eType; /* One of the FTSQUERY_XXX values defined below */ int nNear; /* Valid if eType==FTSQUERY_NEAR */ Fts3Expr *pParent; /* pParent->pLeft==this or pParent->pRight==this */ Fts3Expr *pLeft; /* Left operand */ Fts3Expr *pRight; /* Right operand */ Fts3Phrase *pPhrase; /* Valid if eType==FTSQUERY_PHRASE */ /* The following are used by the fts3_eval.c module. */ sqlite3_int64 iDocid; /* Current docid */ u8 bEof; /* True this expression is at EOF already */ u8 bStart; /* True if iDocid is valid */ u8 bDeferred; /* True if this expression is entirely deferred */ /* The following are used by the fts3_snippet.c module. */ int iPhrase; /* Index of this phrase in matchinfo() results */ u32 *aMI; /* See above */ }; /* ** Candidate values for Fts3Query.eType. Note that the order of the first ** four values is in order of precedence when parsing expressions. For ** example, the following: ** ** "a OR b AND c NOT d NEAR e" ** ** is equivalent to: ** ** "a OR (b AND (c NOT (d NEAR e)))" */ #define FTSQUERY_NEAR 1 #define FTSQUERY_NOT 2 #define FTSQUERY_AND 3 #define FTSQUERY_OR 4 #define FTSQUERY_PHRASE 5 /* fts3_write.c */ int sqlite3Fts3UpdateMethod(sqlite3_vtab*,int,sqlite3_value**,sqlite3_int64*); int sqlite3Fts3PendingTermsFlush(Fts3Table *); void sqlite3Fts3PendingTermsClear(Fts3Table *); int sqlite3Fts3Optimize(Fts3Table *); int sqlite3Fts3SegReaderNew(int, int, sqlite3_int64, sqlite3_int64, sqlite3_int64, const char *, int, Fts3SegReader**); int sqlite3Fts3SegReaderPending( Fts3Table*,int,const char*,int,int,Fts3SegReader**); void sqlite3Fts3SegReaderFree(Fts3SegReader *); int sqlite3Fts3AllSegdirs(Fts3Table*, int, int, int, sqlite3_stmt **); int sqlite3Fts3ReadBlock(Fts3Table*, sqlite3_int64, char **, int*, int*); int sqlite3Fts3SelectDoctotal(Fts3Table *, sqlite3_stmt **); int sqlite3Fts3SelectDocsize(Fts3Table *, sqlite3_int64, sqlite3_stmt **); #ifndef SQLITE_DISABLE_FTS4_DEFERRED void sqlite3Fts3FreeDeferredTokens(Fts3Cursor *); int sqlite3Fts3DeferToken(Fts3Cursor *, Fts3PhraseToken *, int); int sqlite3Fts3CacheDeferredDoclists(Fts3Cursor *); void sqlite3Fts3FreeDeferredDoclists(Fts3Cursor *); int sqlite3Fts3DeferredTokenList(Fts3DeferredToken *, char **, int *); #else # define sqlite3Fts3FreeDeferredTokens(x) # define sqlite3Fts3DeferToken(x,y,z) SQLITE_OK # define sqlite3Fts3CacheDeferredDoclists(x) SQLITE_OK # define sqlite3Fts3FreeDeferredDoclists(x) # define sqlite3Fts3DeferredTokenList(x,y,z) SQLITE_OK #endif void sqlite3Fts3SegmentsClose(Fts3Table *); int sqlite3Fts3MaxLevel(Fts3Table *, int *); /* Special values interpreted by sqlite3SegReaderCursor() */ #define FTS3_SEGCURSOR_PENDING -1 #define FTS3_SEGCURSOR_ALL -2 int sqlite3Fts3SegReaderStart(Fts3Table*, Fts3MultiSegReader*, Fts3SegFilter*); int sqlite3Fts3SegReaderStep(Fts3Table *, Fts3MultiSegReader *); void sqlite3Fts3SegReaderFinish(Fts3MultiSegReader *); int sqlite3Fts3SegReaderCursor(Fts3Table *, int, int, int, const char *, int, int, int, Fts3MultiSegReader *); /* Flags allowed as part of the 4th argument to SegmentReaderIterate() */ #define FTS3_SEGMENT_REQUIRE_POS 0x00000001 #define FTS3_SEGMENT_IGNORE_EMPTY 0x00000002 #define FTS3_SEGMENT_COLUMN_FILTER 0x00000004 #define FTS3_SEGMENT_PREFIX 0x00000008 #define FTS3_SEGMENT_SCAN 0x00000010 #define FTS3_SEGMENT_FIRST 0x00000020 /* Type passed as 4th argument to SegmentReaderIterate() */ struct Fts3SegFilter { const char *zTerm; int nTerm; int iCol; int flags; }; struct Fts3MultiSegReader { /* Used internally by sqlite3Fts3SegReaderXXX() calls */ Fts3SegReader **apSegment; /* Array of Fts3SegReader objects */ int nSegment; /* Size of apSegment array */ int nAdvance; /* How many seg-readers to advance */ Fts3SegFilter *pFilter; /* Pointer to filter object */ char *aBuffer; /* Buffer to merge doclists in */ int nBuffer; /* Allocated size of aBuffer[] in bytes */ int iColFilter; /* If >=0, filter for this column */ int bRestart; /* Used by fts3.c only. */ int nCost; /* Cost of running iterator */ int bLookup; /* True if a lookup of a single entry. */ /* Output values. Valid only after Fts3SegReaderStep() returns SQLITE_ROW. */ char *zTerm; /* Pointer to term buffer */ int nTerm; /* Size of zTerm in bytes */ char *aDoclist; /* Pointer to doclist buffer */ int nDoclist; /* Size of aDoclist[] in bytes */ }; int sqlite3Fts3Incrmerge(Fts3Table*,int,int); #define fts3GetVarint32(p, piVal) ( \ (*(u8*)(p)&0x80) ? sqlite3Fts3GetVarint32(p, piVal) : (*piVal=*(u8*)(p), 1) \ ) /* fts3.c */ void sqlite3Fts3ErrMsg(char**,const char*,...); int sqlite3Fts3PutVarint(char *, sqlite3_int64); int sqlite3Fts3GetVarint(const char *, sqlite_int64 *); int sqlite3Fts3GetVarint32(const char *, int *); int sqlite3Fts3VarintLen(sqlite3_uint64); void sqlite3Fts3Dequote(char *); void sqlite3Fts3DoclistPrev(int,char*,int,char**,sqlite3_int64*,int*,u8*); int sqlite3Fts3EvalPhraseStats(Fts3Cursor *, Fts3Expr *, u32 *); int sqlite3Fts3FirstFilter(sqlite3_int64, char *, int, char *); void sqlite3Fts3CreateStatTable(int*, Fts3Table*); int sqlite3Fts3EvalTestDeferred(Fts3Cursor *pCsr, int *pRc); /* fts3_tokenizer.c */ const char *sqlite3Fts3NextToken(const char *, int *); int sqlite3Fts3InitHashTable(sqlite3 *, Fts3Hash *, const char *); int sqlite3Fts3InitTokenizer(Fts3Hash *pHash, const char *, sqlite3_tokenizer **, char ** ); int sqlite3Fts3IsIdChar(char); /* fts3_snippet.c */ void sqlite3Fts3Offsets(sqlite3_context*, Fts3Cursor*); void sqlite3Fts3Snippet(sqlite3_context *, Fts3Cursor *, const char *, const char *, const char *, int, int ); void sqlite3Fts3Matchinfo(sqlite3_context *, Fts3Cursor *, const char *); void sqlite3Fts3MIBufferFree(MatchinfoBuffer *p); /* fts3_expr.c */ int sqlite3Fts3ExprParse(sqlite3_tokenizer *, int, char **, int, int, int, const char *, int, Fts3Expr **, char ** ); void sqlite3Fts3ExprFree(Fts3Expr *); #ifdef SQLITE_TEST int sqlite3Fts3ExprInitTestInterface(sqlite3 *db); int sqlite3Fts3InitTerm(sqlite3 *db); #endif int sqlite3Fts3OpenTokenizer(sqlite3_tokenizer *, int, const char *, int, sqlite3_tokenizer_cursor ** ); /* fts3_aux.c */ int sqlite3Fts3InitAux(sqlite3 *db); void sqlite3Fts3EvalPhraseCleanup(Fts3Phrase *); int sqlite3Fts3MsrIncrStart( Fts3Table*, Fts3MultiSegReader*, int, const char*, int); int sqlite3Fts3MsrIncrNext( Fts3Table *, Fts3MultiSegReader *, sqlite3_int64 *, char **, int *); int sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iCol, char **); int sqlite3Fts3MsrOvfl(Fts3Cursor *, Fts3MultiSegReader *, int *); int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr); /* fts3_tokenize_vtab.c */ int sqlite3Fts3InitTok(sqlite3*, Fts3Hash *); /* fts3_unicode2.c (functions generated by parsing unicode text files) */ #ifndef SQLITE_DISABLE_FTS3_UNICODE int sqlite3FtsUnicodeFold(int, int); int sqlite3FtsUnicodeIsalnum(int); int sqlite3FtsUnicodeIsdiacritic(int); #endif #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */ #endif /* _FTSINT_H */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_aux.c ================================================ /* ** 2011 Jan 27 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** */ #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) #include #include typedef struct Fts3auxTable Fts3auxTable; typedef struct Fts3auxCursor Fts3auxCursor; struct Fts3auxTable { sqlite3_vtab base; /* Base class used by SQLite core */ Fts3Table *pFts3Tab; }; struct Fts3auxCursor { sqlite3_vtab_cursor base; /* Base class used by SQLite core */ Fts3MultiSegReader csr; /* Must be right after "base" */ Fts3SegFilter filter; char *zStop; int nStop; /* Byte-length of string zStop */ int iLangid; /* Language id to query */ int isEof; /* True if cursor is at EOF */ sqlite3_int64 iRowid; /* Current rowid */ int iCol; /* Current value of 'col' column */ int nStat; /* Size of aStat[] array */ struct Fts3auxColstats { sqlite3_int64 nDoc; /* 'documents' values for current csr row */ sqlite3_int64 nOcc; /* 'occurrences' values for current csr row */ } *aStat; }; /* ** Schema of the terms table. */ #define FTS3_AUX_SCHEMA \ "CREATE TABLE x(term, col, documents, occurrences, languageid HIDDEN)" /* ** This function does all the work for both the xConnect and xCreate methods. ** These tables have no persistent representation of their own, so xConnect ** and xCreate are identical operations. */ static int fts3auxConnectMethod( sqlite3 *db, /* Database connection */ void *pUnused, /* Unused */ int argc, /* Number of elements in argv array */ const char * const *argv, /* xCreate/xConnect argument array */ sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */ char **pzErr /* OUT: sqlite3_malloc'd error message */ ){ char const *zDb; /* Name of database (e.g. "main") */ char const *zFts3; /* Name of fts3 table */ int nDb; /* Result of strlen(zDb) */ int nFts3; /* Result of strlen(zFts3) */ int nByte; /* Bytes of space to allocate here */ int rc; /* value returned by declare_vtab() */ Fts3auxTable *p; /* Virtual table object to return */ UNUSED_PARAMETER(pUnused); /* The user should invoke this in one of two forms: ** ** CREATE VIRTUAL TABLE xxx USING fts4aux(fts4-table); ** CREATE VIRTUAL TABLE xxx USING fts4aux(fts4-table-db, fts4-table); */ if( argc!=4 && argc!=5 ) goto bad_args; zDb = argv[1]; nDb = (int)strlen(zDb); if( argc==5 ){ if( nDb==4 && 0==sqlite3_strnicmp("temp", zDb, 4) ){ zDb = argv[3]; nDb = (int)strlen(zDb); zFts3 = argv[4]; }else{ goto bad_args; } }else{ zFts3 = argv[3]; } nFts3 = (int)strlen(zFts3); rc = sqlite3_declare_vtab(db, FTS3_AUX_SCHEMA); if( rc!=SQLITE_OK ) return rc; nByte = sizeof(Fts3auxTable) + sizeof(Fts3Table) + nDb + nFts3 + 2; p = (Fts3auxTable *)sqlite3_malloc(nByte); if( !p ) return SQLITE_NOMEM; memset(p, 0, nByte); p->pFts3Tab = (Fts3Table *)&p[1]; p->pFts3Tab->zDb = (char *)&p->pFts3Tab[1]; p->pFts3Tab->zName = &p->pFts3Tab->zDb[nDb+1]; p->pFts3Tab->db = db; p->pFts3Tab->nIndex = 1; memcpy((char *)p->pFts3Tab->zDb, zDb, nDb); memcpy((char *)p->pFts3Tab->zName, zFts3, nFts3); sqlite3Fts3Dequote((char *)p->pFts3Tab->zName); *ppVtab = (sqlite3_vtab *)p; return SQLITE_OK; bad_args: sqlite3Fts3ErrMsg(pzErr, "invalid arguments to fts4aux constructor"); return SQLITE_ERROR; } /* ** This function does the work for both the xDisconnect and xDestroy methods. ** These tables have no persistent representation of their own, so xDisconnect ** and xDestroy are identical operations. */ static int fts3auxDisconnectMethod(sqlite3_vtab *pVtab){ Fts3auxTable *p = (Fts3auxTable *)pVtab; Fts3Table *pFts3 = p->pFts3Tab; int i; /* Free any prepared statements held */ for(i=0; iaStmt); i++){ sqlite3_finalize(pFts3->aStmt[i]); } sqlite3_free(pFts3->zSegmentsTbl); sqlite3_free(p); return SQLITE_OK; } #define FTS4AUX_EQ_CONSTRAINT 1 #define FTS4AUX_GE_CONSTRAINT 2 #define FTS4AUX_LE_CONSTRAINT 4 /* ** xBestIndex - Analyze a WHERE and ORDER BY clause. */ static int fts3auxBestIndexMethod( sqlite3_vtab *pVTab, sqlite3_index_info *pInfo ){ int i; int iEq = -1; int iGe = -1; int iLe = -1; int iLangid = -1; int iNext = 1; /* Next free argvIndex value */ UNUSED_PARAMETER(pVTab); /* This vtab delivers always results in "ORDER BY term ASC" order. */ if( pInfo->nOrderBy==1 && pInfo->aOrderBy[0].iColumn==0 && pInfo->aOrderBy[0].desc==0 ){ pInfo->orderByConsumed = 1; } /* Search for equality and range constraints on the "term" column. ** And equality constraints on the hidden "languageid" column. */ for(i=0; inConstraint; i++){ if( pInfo->aConstraint[i].usable ){ int op = pInfo->aConstraint[i].op; int iCol = pInfo->aConstraint[i].iColumn; if( iCol==0 ){ if( op==SQLITE_INDEX_CONSTRAINT_EQ ) iEq = i; if( op==SQLITE_INDEX_CONSTRAINT_LT ) iLe = i; if( op==SQLITE_INDEX_CONSTRAINT_LE ) iLe = i; if( op==SQLITE_INDEX_CONSTRAINT_GT ) iGe = i; if( op==SQLITE_INDEX_CONSTRAINT_GE ) iGe = i; } if( iCol==4 ){ if( op==SQLITE_INDEX_CONSTRAINT_EQ ) iLangid = i; } } } if( iEq>=0 ){ pInfo->idxNum = FTS4AUX_EQ_CONSTRAINT; pInfo->aConstraintUsage[iEq].argvIndex = iNext++; pInfo->estimatedCost = 5; }else{ pInfo->idxNum = 0; pInfo->estimatedCost = 20000; if( iGe>=0 ){ pInfo->idxNum += FTS4AUX_GE_CONSTRAINT; pInfo->aConstraintUsage[iGe].argvIndex = iNext++; pInfo->estimatedCost /= 2; } if( iLe>=0 ){ pInfo->idxNum += FTS4AUX_LE_CONSTRAINT; pInfo->aConstraintUsage[iLe].argvIndex = iNext++; pInfo->estimatedCost /= 2; } } if( iLangid>=0 ){ pInfo->aConstraintUsage[iLangid].argvIndex = iNext++; pInfo->estimatedCost--; } return SQLITE_OK; } /* ** xOpen - Open a cursor. */ static int fts3auxOpenMethod(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr){ Fts3auxCursor *pCsr; /* Pointer to cursor object to return */ UNUSED_PARAMETER(pVTab); pCsr = (Fts3auxCursor *)sqlite3_malloc(sizeof(Fts3auxCursor)); if( !pCsr ) return SQLITE_NOMEM; memset(pCsr, 0, sizeof(Fts3auxCursor)); *ppCsr = (sqlite3_vtab_cursor *)pCsr; return SQLITE_OK; } /* ** xClose - Close a cursor. */ static int fts3auxCloseMethod(sqlite3_vtab_cursor *pCursor){ Fts3Table *pFts3 = ((Fts3auxTable *)pCursor->pVtab)->pFts3Tab; Fts3auxCursor *pCsr = (Fts3auxCursor *)pCursor; sqlite3Fts3SegmentsClose(pFts3); sqlite3Fts3SegReaderFinish(&pCsr->csr); sqlite3_free((void *)pCsr->filter.zTerm); sqlite3_free(pCsr->zStop); sqlite3_free(pCsr->aStat); sqlite3_free(pCsr); return SQLITE_OK; } static int fts3auxGrowStatArray(Fts3auxCursor *pCsr, int nSize){ if( nSize>pCsr->nStat ){ struct Fts3auxColstats *aNew; aNew = (struct Fts3auxColstats *)sqlite3_realloc(pCsr->aStat, sizeof(struct Fts3auxColstats) * nSize ); if( aNew==0 ) return SQLITE_NOMEM; memset(&aNew[pCsr->nStat], 0, sizeof(struct Fts3auxColstats) * (nSize - pCsr->nStat) ); pCsr->aStat = aNew; pCsr->nStat = nSize; } return SQLITE_OK; } /* ** xNext - Advance the cursor to the next row, if any. */ static int fts3auxNextMethod(sqlite3_vtab_cursor *pCursor){ Fts3auxCursor *pCsr = (Fts3auxCursor *)pCursor; Fts3Table *pFts3 = ((Fts3auxTable *)pCursor->pVtab)->pFts3Tab; int rc; /* Increment our pretend rowid value. */ pCsr->iRowid++; for(pCsr->iCol++; pCsr->iColnStat; pCsr->iCol++){ if( pCsr->aStat[pCsr->iCol].nDoc>0 ) return SQLITE_OK; } rc = sqlite3Fts3SegReaderStep(pFts3, &pCsr->csr); if( rc==SQLITE_ROW ){ int i = 0; int nDoclist = pCsr->csr.nDoclist; char *aDoclist = pCsr->csr.aDoclist; int iCol; int eState = 0; if( pCsr->zStop ){ int n = (pCsr->nStopcsr.nTerm) ? pCsr->nStop : pCsr->csr.nTerm; int mc = memcmp(pCsr->zStop, pCsr->csr.zTerm, n); if( mc<0 || (mc==0 && pCsr->csr.nTerm>pCsr->nStop) ){ pCsr->isEof = 1; return SQLITE_OK; } } if( fts3auxGrowStatArray(pCsr, 2) ) return SQLITE_NOMEM; memset(pCsr->aStat, 0, sizeof(struct Fts3auxColstats) * pCsr->nStat); iCol = 0; while( iaStat[0].nDoc++; eState = 1; iCol = 0; break; /* State 1. In this state we are expecting either a 1, indicating ** that the following integer will be a column number, or the ** start of a position list for column 0. ** ** The only difference between state 1 and state 2 is that if the ** integer encountered in state 1 is not 0 or 1, then we need to ** increment the column 0 "nDoc" count for this term. */ case 1: assert( iCol==0 ); if( v>1 ){ pCsr->aStat[1].nDoc++; } eState = 2; /* fall through */ case 2: if( v==0 ){ /* 0x00. Next integer will be a docid. */ eState = 0; }else if( v==1 ){ /* 0x01. Next integer will be a column number. */ eState = 3; }else{ /* 2 or greater. A position. */ pCsr->aStat[iCol+1].nOcc++; pCsr->aStat[0].nOcc++; } break; /* State 3. The integer just read is a column number. */ default: assert( eState==3 ); iCol = (int)v; if( fts3auxGrowStatArray(pCsr, iCol+2) ) return SQLITE_NOMEM; pCsr->aStat[iCol+1].nDoc++; eState = 2; break; } } pCsr->iCol = 0; rc = SQLITE_OK; }else{ pCsr->isEof = 1; } return rc; } /* ** xFilter - Initialize a cursor to point at the start of its data. */ static int fts3auxFilterMethod( sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */ int idxNum, /* Strategy index */ const char *idxStr, /* Unused */ int nVal, /* Number of elements in apVal */ sqlite3_value **apVal /* Arguments for the indexing scheme */ ){ Fts3auxCursor *pCsr = (Fts3auxCursor *)pCursor; Fts3Table *pFts3 = ((Fts3auxTable *)pCursor->pVtab)->pFts3Tab; int rc; int isScan = 0; int iLangVal = 0; /* Language id to query */ int iEq = -1; /* Index of term=? value in apVal */ int iGe = -1; /* Index of term>=? value in apVal */ int iLe = -1; /* Index of term<=? value in apVal */ int iLangid = -1; /* Index of languageid=? value in apVal */ int iNext = 0; UNUSED_PARAMETER(nVal); UNUSED_PARAMETER(idxStr); assert( idxStr==0 ); assert( idxNum==FTS4AUX_EQ_CONSTRAINT || idxNum==0 || idxNum==FTS4AUX_LE_CONSTRAINT || idxNum==FTS4AUX_GE_CONSTRAINT || idxNum==(FTS4AUX_LE_CONSTRAINT|FTS4AUX_GE_CONSTRAINT) ); if( idxNum==FTS4AUX_EQ_CONSTRAINT ){ iEq = iNext++; }else{ isScan = 1; if( idxNum & FTS4AUX_GE_CONSTRAINT ){ iGe = iNext++; } if( idxNum & FTS4AUX_LE_CONSTRAINT ){ iLe = iNext++; } } if( iNextfilter.zTerm); sqlite3Fts3SegReaderFinish(&pCsr->csr); sqlite3_free((void *)pCsr->filter.zTerm); sqlite3_free(pCsr->aStat); memset(&pCsr->csr, 0, ((u8*)&pCsr[1]) - (u8*)&pCsr->csr); pCsr->filter.flags = FTS3_SEGMENT_REQUIRE_POS|FTS3_SEGMENT_IGNORE_EMPTY; if( isScan ) pCsr->filter.flags |= FTS3_SEGMENT_SCAN; if( iEq>=0 || iGe>=0 ){ const unsigned char *zStr = sqlite3_value_text(apVal[0]); assert( (iEq==0 && iGe==-1) || (iEq==-1 && iGe==0) ); if( zStr ){ pCsr->filter.zTerm = sqlite3_mprintf("%s", zStr); pCsr->filter.nTerm = sqlite3_value_bytes(apVal[0]); if( pCsr->filter.zTerm==0 ) return SQLITE_NOMEM; } } if( iLe>=0 ){ pCsr->zStop = sqlite3_mprintf("%s", sqlite3_value_text(apVal[iLe])); pCsr->nStop = sqlite3_value_bytes(apVal[iLe]); if( pCsr->zStop==0 ) return SQLITE_NOMEM; } if( iLangid>=0 ){ iLangVal = sqlite3_value_int(apVal[iLangid]); /* If the user specified a negative value for the languageid, use zero ** instead. This works, as the "languageid=?" constraint will also ** be tested by the VDBE layer. The test will always be false (since ** this module will not return a row with a negative languageid), and ** so the overall query will return zero rows. */ if( iLangVal<0 ) iLangVal = 0; } pCsr->iLangid = iLangVal; rc = sqlite3Fts3SegReaderCursor(pFts3, iLangVal, 0, FTS3_SEGCURSOR_ALL, pCsr->filter.zTerm, pCsr->filter.nTerm, 0, isScan, &pCsr->csr ); if( rc==SQLITE_OK ){ rc = sqlite3Fts3SegReaderStart(pFts3, &pCsr->csr, &pCsr->filter); } if( rc==SQLITE_OK ) rc = fts3auxNextMethod(pCursor); return rc; } /* ** xEof - Return true if the cursor is at EOF, or false otherwise. */ static int fts3auxEofMethod(sqlite3_vtab_cursor *pCursor){ Fts3auxCursor *pCsr = (Fts3auxCursor *)pCursor; return pCsr->isEof; } /* ** xColumn - Return a column value. */ static int fts3auxColumnMethod( sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ sqlite3_context *pCtx, /* Context for sqlite3_result_xxx() calls */ int iCol /* Index of column to read value from */ ){ Fts3auxCursor *p = (Fts3auxCursor *)pCursor; assert( p->isEof==0 ); switch( iCol ){ case 0: /* term */ sqlite3_result_text(pCtx, p->csr.zTerm, p->csr.nTerm, SQLITE_TRANSIENT); break; case 1: /* col */ if( p->iCol ){ sqlite3_result_int(pCtx, p->iCol-1); }else{ sqlite3_result_text(pCtx, "*", -1, SQLITE_STATIC); } break; case 2: /* documents */ sqlite3_result_int64(pCtx, p->aStat[p->iCol].nDoc); break; case 3: /* occurrences */ sqlite3_result_int64(pCtx, p->aStat[p->iCol].nOcc); break; default: /* languageid */ assert( iCol==4 ); sqlite3_result_int(pCtx, p->iLangid); break; } return SQLITE_OK; } /* ** xRowid - Return the current rowid for the cursor. */ static int fts3auxRowidMethod( sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ sqlite_int64 *pRowid /* OUT: Rowid value */ ){ Fts3auxCursor *pCsr = (Fts3auxCursor *)pCursor; *pRowid = pCsr->iRowid; return SQLITE_OK; } /* ** Register the fts3aux module with database connection db. Return SQLITE_OK ** if successful or an error code if sqlite3_create_module() fails. */ int sqlite3Fts3InitAux(sqlite3 *db){ static const sqlite3_module fts3aux_module = { 0, /* iVersion */ fts3auxConnectMethod, /* xCreate */ fts3auxConnectMethod, /* xConnect */ fts3auxBestIndexMethod, /* xBestIndex */ fts3auxDisconnectMethod, /* xDisconnect */ fts3auxDisconnectMethod, /* xDestroy */ fts3auxOpenMethod, /* xOpen */ fts3auxCloseMethod, /* xClose */ fts3auxFilterMethod, /* xFilter */ fts3auxNextMethod, /* xNext */ fts3auxEofMethod, /* xEof */ fts3auxColumnMethod, /* xColumn */ fts3auxRowidMethod, /* xRowid */ 0, /* xUpdate */ 0, /* xBegin */ 0, /* xSync */ 0, /* xCommit */ 0, /* xRollback */ 0, /* xFindFunction */ 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ 0 /* xRollbackTo */ }; int rc; /* Return code */ rc = sqlite3_create_module(db, "fts4aux", &fts3aux_module, 0); return rc; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_expr.c ================================================ /* ** 2008 Nov 28 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This module contains code that implements a parser for fts3 query strings ** (the right-hand argument to the MATCH operator). Because the supported ** syntax is relatively simple, the whole tokenizer/parser system is ** hand-coded. */ #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) /* ** By default, this module parses the legacy syntax that has been ** traditionally used by fts3. Or, if SQLITE_ENABLE_FTS3_PARENTHESIS ** is defined, then it uses the new syntax. The differences between ** the new and the old syntaxes are: ** ** a) The new syntax supports parenthesis. The old does not. ** ** b) The new syntax supports the AND and NOT operators. The old does not. ** ** c) The old syntax supports the "-" token qualifier. This is not ** supported by the new syntax (it is replaced by the NOT operator). ** ** d) When using the old syntax, the OR operator has a greater precedence ** than an implicit AND. When using the new, both implicity and explicit ** AND operators have a higher precedence than OR. ** ** If compiled with SQLITE_TEST defined, then this module exports the ** symbol "int sqlite3_fts3_enable_parentheses". Setting this variable ** to zero causes the module to use the old syntax. If it is set to ** non-zero the new syntax is activated. This is so both syntaxes can ** be tested using a single build of testfixture. ** ** The following describes the syntax supported by the fts3 MATCH ** operator in a similar format to that used by the lemon parser ** generator. This module does not use actually lemon, it uses a ** custom parser. ** ** query ::= andexpr (OR andexpr)*. ** ** andexpr ::= notexpr (AND? notexpr)*. ** ** notexpr ::= nearexpr (NOT nearexpr|-TOKEN)*. ** notexpr ::= LP query RP. ** ** nearexpr ::= phrase (NEAR distance_opt nearexpr)*. ** ** distance_opt ::= . ** distance_opt ::= / INTEGER. ** ** phrase ::= TOKEN. ** phrase ::= COLUMN:TOKEN. ** phrase ::= "TOKEN TOKEN TOKEN...". */ #ifdef SQLITE_TEST int sqlite3_fts3_enable_parentheses = 0; #else # ifdef SQLITE_ENABLE_FTS3_PARENTHESIS # define sqlite3_fts3_enable_parentheses 1 # else # define sqlite3_fts3_enable_parentheses 0 # endif #endif /* ** Default span for NEAR operators. */ #define SQLITE_FTS3_DEFAULT_NEAR_PARAM 10 #include #include /* ** isNot: ** This variable is used by function getNextNode(). When getNextNode() is ** called, it sets ParseContext.isNot to true if the 'next node' is a ** FTSQUERY_PHRASE with a unary "-" attached to it. i.e. "mysql" in the ** FTS3 query "sqlite -mysql". Otherwise, ParseContext.isNot is set to ** zero. */ typedef struct ParseContext ParseContext; struct ParseContext { sqlite3_tokenizer *pTokenizer; /* Tokenizer module */ int iLangid; /* Language id used with tokenizer */ const char **azCol; /* Array of column names for fts3 table */ int bFts4; /* True to allow FTS4-only syntax */ int nCol; /* Number of entries in azCol[] */ int iDefaultCol; /* Default column to query */ int isNot; /* True if getNextNode() sees a unary - */ sqlite3_context *pCtx; /* Write error message here */ int nNest; /* Number of nested brackets */ }; /* ** This function is equivalent to the standard isspace() function. ** ** The standard isspace() can be awkward to use safely, because although it ** is defined to accept an argument of type int, its behavior when passed ** an integer that falls outside of the range of the unsigned char type ** is undefined (and sometimes, "undefined" means segfault). This wrapper ** is defined to accept an argument of type char, and always returns 0 for ** any values that fall outside of the range of the unsigned char type (i.e. ** negative values). */ static int fts3isspace(char c){ return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; } /* ** Allocate nByte bytes of memory using sqlite3_malloc(). If successful, ** zero the memory before returning a pointer to it. If unsuccessful, ** return NULL. */ static void *fts3MallocZero(int nByte){ void *pRet = sqlite3_malloc(nByte); if( pRet ) memset(pRet, 0, nByte); return pRet; } int sqlite3Fts3OpenTokenizer( sqlite3_tokenizer *pTokenizer, int iLangid, const char *z, int n, sqlite3_tokenizer_cursor **ppCsr ){ sqlite3_tokenizer_module const *pModule = pTokenizer->pModule; sqlite3_tokenizer_cursor *pCsr = 0; int rc; rc = pModule->xOpen(pTokenizer, z, n, &pCsr); assert( rc==SQLITE_OK || pCsr==0 ); if( rc==SQLITE_OK ){ pCsr->pTokenizer = pTokenizer; if( pModule->iVersion>=1 ){ rc = pModule->xLanguageid(pCsr, iLangid); if( rc!=SQLITE_OK ){ pModule->xClose(pCsr); pCsr = 0; } } } *ppCsr = pCsr; return rc; } /* ** Function getNextNode(), which is called by fts3ExprParse(), may itself ** call fts3ExprParse(). So this forward declaration is required. */ static int fts3ExprParse(ParseContext *, const char *, int, Fts3Expr **, int *); /* ** Extract the next token from buffer z (length n) using the tokenizer ** and other information (column names etc.) in pParse. Create an Fts3Expr ** structure of type FTSQUERY_PHRASE containing a phrase consisting of this ** single token and set *ppExpr to point to it. If the end of the buffer is ** reached before a token is found, set *ppExpr to zero. It is the ** responsibility of the caller to eventually deallocate the allocated ** Fts3Expr structure (if any) by passing it to sqlite3_free(). ** ** Return SQLITE_OK if successful, or SQLITE_NOMEM if a memory allocation ** fails. */ static int getNextToken( ParseContext *pParse, /* fts3 query parse context */ int iCol, /* Value for Fts3Phrase.iColumn */ const char *z, int n, /* Input string */ Fts3Expr **ppExpr, /* OUT: expression */ int *pnConsumed /* OUT: Number of bytes consumed */ ){ sqlite3_tokenizer *pTokenizer = pParse->pTokenizer; sqlite3_tokenizer_module const *pModule = pTokenizer->pModule; int rc; sqlite3_tokenizer_cursor *pCursor; Fts3Expr *pRet = 0; int i = 0; /* Set variable i to the maximum number of bytes of input to tokenize. */ for(i=0; iiLangid, z, i, &pCursor); if( rc==SQLITE_OK ){ const char *zToken; int nToken = 0, iStart = 0, iEnd = 0, iPosition = 0; int nByte; /* total space to allocate */ rc = pModule->xNext(pCursor, &zToken, &nToken, &iStart, &iEnd, &iPosition); if( rc==SQLITE_OK ){ nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase) + nToken; pRet = (Fts3Expr *)fts3MallocZero(nByte); if( !pRet ){ rc = SQLITE_NOMEM; }else{ pRet->eType = FTSQUERY_PHRASE; pRet->pPhrase = (Fts3Phrase *)&pRet[1]; pRet->pPhrase->nToken = 1; pRet->pPhrase->iColumn = iCol; pRet->pPhrase->aToken[0].n = nToken; pRet->pPhrase->aToken[0].z = (char *)&pRet->pPhrase[1]; memcpy(pRet->pPhrase->aToken[0].z, zToken, nToken); if( iEndpPhrase->aToken[0].isPrefix = 1; iEnd++; } while( 1 ){ if( !sqlite3_fts3_enable_parentheses && iStart>0 && z[iStart-1]=='-' ){ pParse->isNot = 1; iStart--; }else if( pParse->bFts4 && iStart>0 && z[iStart-1]=='^' ){ pRet->pPhrase->aToken[0].bFirst = 1; iStart--; }else{ break; } } } *pnConsumed = iEnd; }else if( i && rc==SQLITE_DONE ){ rc = SQLITE_OK; } pModule->xClose(pCursor); } *ppExpr = pRet; return rc; } /* ** Enlarge a memory allocation. If an out-of-memory allocation occurs, ** then free the old allocation. */ static void *fts3ReallocOrFree(void *pOrig, int nNew){ void *pRet = sqlite3_realloc(pOrig, nNew); if( !pRet ){ sqlite3_free(pOrig); } return pRet; } /* ** Buffer zInput, length nInput, contains the contents of a quoted string ** that appeared as part of an fts3 query expression. Neither quote character ** is included in the buffer. This function attempts to tokenize the entire ** input buffer and create an Fts3Expr structure of type FTSQUERY_PHRASE ** containing the results. ** ** If successful, SQLITE_OK is returned and *ppExpr set to point at the ** allocated Fts3Expr structure. Otherwise, either SQLITE_NOMEM (out of memory ** error) or SQLITE_ERROR (tokenization error) is returned and *ppExpr set ** to 0. */ static int getNextString( ParseContext *pParse, /* fts3 query parse context */ const char *zInput, int nInput, /* Input string */ Fts3Expr **ppExpr /* OUT: expression */ ){ sqlite3_tokenizer *pTokenizer = pParse->pTokenizer; sqlite3_tokenizer_module const *pModule = pTokenizer->pModule; int rc; Fts3Expr *p = 0; sqlite3_tokenizer_cursor *pCursor = 0; char *zTemp = 0; int nTemp = 0; const int nSpace = sizeof(Fts3Expr) + sizeof(Fts3Phrase); int nToken = 0; /* The final Fts3Expr data structure, including the Fts3Phrase, ** Fts3PhraseToken structures token buffers are all stored as a single ** allocation so that the expression can be freed with a single call to ** sqlite3_free(). Setting this up requires a two pass approach. ** ** The first pass, in the block below, uses a tokenizer cursor to iterate ** through the tokens in the expression. This pass uses fts3ReallocOrFree() ** to assemble data in two dynamic buffers: ** ** Buffer p: Points to the Fts3Expr structure, followed by the Fts3Phrase ** structure, followed by the array of Fts3PhraseToken ** structures. This pass only populates the Fts3PhraseToken array. ** ** Buffer zTemp: Contains copies of all tokens. ** ** The second pass, in the block that begins "if( rc==SQLITE_DONE )" below, ** appends buffer zTemp to buffer p, and fills in the Fts3Expr and Fts3Phrase ** structures. */ rc = sqlite3Fts3OpenTokenizer( pTokenizer, pParse->iLangid, zInput, nInput, &pCursor); if( rc==SQLITE_OK ){ int ii; for(ii=0; rc==SQLITE_OK; ii++){ const char *zByte; int nByte = 0, iBegin = 0, iEnd = 0, iPos = 0; rc = pModule->xNext(pCursor, &zByte, &nByte, &iBegin, &iEnd, &iPos); if( rc==SQLITE_OK ){ Fts3PhraseToken *pToken; p = fts3ReallocOrFree(p, nSpace + ii*sizeof(Fts3PhraseToken)); if( !p ) goto no_mem; zTemp = fts3ReallocOrFree(zTemp, nTemp + nByte); if( !zTemp ) goto no_mem; assert( nToken==ii ); pToken = &((Fts3Phrase *)(&p[1]))->aToken[ii]; memset(pToken, 0, sizeof(Fts3PhraseToken)); memcpy(&zTemp[nTemp], zByte, nByte); nTemp += nByte; pToken->n = nByte; pToken->isPrefix = (iEndbFirst = (iBegin>0 && zInput[iBegin-1]=='^'); nToken = ii+1; } } pModule->xClose(pCursor); pCursor = 0; } if( rc==SQLITE_DONE ){ int jj; char *zBuf = 0; p = fts3ReallocOrFree(p, nSpace + nToken*sizeof(Fts3PhraseToken) + nTemp); if( !p ) goto no_mem; memset(p, 0, (char *)&(((Fts3Phrase *)&p[1])->aToken[0])-(char *)p); p->eType = FTSQUERY_PHRASE; p->pPhrase = (Fts3Phrase *)&p[1]; p->pPhrase->iColumn = pParse->iDefaultCol; p->pPhrase->nToken = nToken; zBuf = (char *)&p->pPhrase->aToken[nToken]; if( zTemp ){ memcpy(zBuf, zTemp, nTemp); sqlite3_free(zTemp); }else{ assert( nTemp==0 ); } for(jj=0; jjpPhrase->nToken; jj++){ p->pPhrase->aToken[jj].z = zBuf; zBuf += p->pPhrase->aToken[jj].n; } rc = SQLITE_OK; } *ppExpr = p; return rc; no_mem: if( pCursor ){ pModule->xClose(pCursor); } sqlite3_free(zTemp); sqlite3_free(p); *ppExpr = 0; return SQLITE_NOMEM; } /* ** The output variable *ppExpr is populated with an allocated Fts3Expr ** structure, or set to 0 if the end of the input buffer is reached. ** ** Returns an SQLite error code. SQLITE_OK if everything works, SQLITE_NOMEM ** if a malloc failure occurs, or SQLITE_ERROR if a parse error is encountered. ** If SQLITE_ERROR is returned, pContext is populated with an error message. */ static int getNextNode( ParseContext *pParse, /* fts3 query parse context */ const char *z, int n, /* Input string */ Fts3Expr **ppExpr, /* OUT: expression */ int *pnConsumed /* OUT: Number of bytes consumed */ ){ static const struct Fts3Keyword { char *z; /* Keyword text */ unsigned char n; /* Length of the keyword */ unsigned char parenOnly; /* Only valid in paren mode */ unsigned char eType; /* Keyword code */ } aKeyword[] = { { "OR" , 2, 0, FTSQUERY_OR }, { "AND", 3, 1, FTSQUERY_AND }, { "NOT", 3, 1, FTSQUERY_NOT }, { "NEAR", 4, 0, FTSQUERY_NEAR } }; int ii; int iCol; int iColLen; int rc; Fts3Expr *pRet = 0; const char *zInput = z; int nInput = n; pParse->isNot = 0; /* Skip over any whitespace before checking for a keyword, an open or ** close bracket, or a quoted string. */ while( nInput>0 && fts3isspace(*zInput) ){ nInput--; zInput++; } if( nInput==0 ){ return SQLITE_DONE; } /* See if we are dealing with a keyword. */ for(ii=0; ii<(int)(sizeof(aKeyword)/sizeof(struct Fts3Keyword)); ii++){ const struct Fts3Keyword *pKey = &aKeyword[ii]; if( (pKey->parenOnly & ~sqlite3_fts3_enable_parentheses)!=0 ){ continue; } if( nInput>=pKey->n && 0==memcmp(zInput, pKey->z, pKey->n) ){ int nNear = SQLITE_FTS3_DEFAULT_NEAR_PARAM; int nKey = pKey->n; char cNext; /* If this is a "NEAR" keyword, check for an explicit nearness. */ if( pKey->eType==FTSQUERY_NEAR ){ assert( nKey==4 ); if( zInput[4]=='/' && zInput[5]>='0' && zInput[5]<='9' ){ nNear = 0; for(nKey=5; zInput[nKey]>='0' && zInput[nKey]<='9'; nKey++){ nNear = nNear * 10 + (zInput[nKey] - '0'); } } } /* At this point this is probably a keyword. But for that to be true, ** the next byte must contain either whitespace, an open or close ** parenthesis, a quote character, or EOF. */ cNext = zInput[nKey]; if( fts3isspace(cNext) || cNext=='"' || cNext=='(' || cNext==')' || cNext==0 ){ pRet = (Fts3Expr *)fts3MallocZero(sizeof(Fts3Expr)); if( !pRet ){ return SQLITE_NOMEM; } pRet->eType = pKey->eType; pRet->nNear = nNear; *ppExpr = pRet; *pnConsumed = (int)((zInput - z) + nKey); return SQLITE_OK; } /* Turns out that wasn't a keyword after all. This happens if the ** user has supplied a token such as "ORacle". Continue. */ } } /* See if we are dealing with a quoted phrase. If this is the case, then ** search for the closing quote and pass the whole string to getNextString() ** for processing. This is easy to do, as fts3 has no syntax for escaping ** a quote character embedded in a string. */ if( *zInput=='"' ){ for(ii=1; iinNest++; rc = fts3ExprParse(pParse, zInput+1, nInput-1, ppExpr, &nConsumed); if( rc==SQLITE_OK && !*ppExpr ){ rc = SQLITE_DONE; } *pnConsumed = (int)(zInput - z) + 1 + nConsumed; return rc; }else if( *zInput==')' ){ pParse->nNest--; *pnConsumed = (int)((zInput - z) + 1); *ppExpr = 0; return SQLITE_DONE; } } /* If control flows to this point, this must be a regular token, or ** the end of the input. Read a regular token using the sqlite3_tokenizer ** interface. Before doing so, figure out if there is an explicit ** column specifier for the token. ** ** TODO: Strangely, it is not possible to associate a column specifier ** with a quoted phrase, only with a single token. Not sure if this was ** an implementation artifact or an intentional decision when fts3 was ** first implemented. Whichever it was, this module duplicates the ** limitation. */ iCol = pParse->iDefaultCol; iColLen = 0; for(ii=0; iinCol; ii++){ const char *zStr = pParse->azCol[ii]; int nStr = (int)strlen(zStr); if( nInput>nStr && zInput[nStr]==':' && sqlite3_strnicmp(zStr, zInput, nStr)==0 ){ iCol = ii; iColLen = (int)((zInput - z) + nStr + 1); break; } } rc = getNextToken(pParse, iCol, &z[iColLen], n-iColLen, ppExpr, pnConsumed); *pnConsumed += iColLen; return rc; } /* ** The argument is an Fts3Expr structure for a binary operator (any type ** except an FTSQUERY_PHRASE). Return an integer value representing the ** precedence of the operator. Lower values have a higher precedence (i.e. ** group more tightly). For example, in the C language, the == operator ** groups more tightly than ||, and would therefore have a higher precedence. ** ** When using the new fts3 query syntax (when SQLITE_ENABLE_FTS3_PARENTHESIS ** is defined), the order of the operators in precedence from highest to ** lowest is: ** ** NEAR ** NOT ** AND (including implicit ANDs) ** OR ** ** Note that when using the old query syntax, the OR operator has a higher ** precedence than the AND operator. */ static int opPrecedence(Fts3Expr *p){ assert( p->eType!=FTSQUERY_PHRASE ); if( sqlite3_fts3_enable_parentheses ){ return p->eType; }else if( p->eType==FTSQUERY_NEAR ){ return 1; }else if( p->eType==FTSQUERY_OR ){ return 2; } assert( p->eType==FTSQUERY_AND ); return 3; } /* ** Argument ppHead contains a pointer to the current head of a query ** expression tree being parsed. pPrev is the expression node most recently ** inserted into the tree. This function adds pNew, which is always a binary ** operator node, into the expression tree based on the relative precedence ** of pNew and the existing nodes of the tree. This may result in the head ** of the tree changing, in which case *ppHead is set to the new root node. */ static void insertBinaryOperator( Fts3Expr **ppHead, /* Pointer to the root node of a tree */ Fts3Expr *pPrev, /* Node most recently inserted into the tree */ Fts3Expr *pNew /* New binary node to insert into expression tree */ ){ Fts3Expr *pSplit = pPrev; while( pSplit->pParent && opPrecedence(pSplit->pParent)<=opPrecedence(pNew) ){ pSplit = pSplit->pParent; } if( pSplit->pParent ){ assert( pSplit->pParent->pRight==pSplit ); pSplit->pParent->pRight = pNew; pNew->pParent = pSplit->pParent; }else{ *ppHead = pNew; } pNew->pLeft = pSplit; pSplit->pParent = pNew; } /* ** Parse the fts3 query expression found in buffer z, length n. This function ** returns either when the end of the buffer is reached or an unmatched ** closing bracket - ')' - is encountered. ** ** If successful, SQLITE_OK is returned, *ppExpr is set to point to the ** parsed form of the expression and *pnConsumed is set to the number of ** bytes read from buffer z. Otherwise, *ppExpr is set to 0 and SQLITE_NOMEM ** (out of memory error) or SQLITE_ERROR (parse error) is returned. */ static int fts3ExprParse( ParseContext *pParse, /* fts3 query parse context */ const char *z, int n, /* Text of MATCH query */ Fts3Expr **ppExpr, /* OUT: Parsed query structure */ int *pnConsumed /* OUT: Number of bytes consumed */ ){ Fts3Expr *pRet = 0; Fts3Expr *pPrev = 0; Fts3Expr *pNotBranch = 0; /* Only used in legacy parse mode */ int nIn = n; const char *zIn = z; int rc = SQLITE_OK; int isRequirePhrase = 1; while( rc==SQLITE_OK ){ Fts3Expr *p = 0; int nByte = 0; rc = getNextNode(pParse, zIn, nIn, &p, &nByte); assert( nByte>0 || (rc!=SQLITE_OK && p==0) ); if( rc==SQLITE_OK ){ if( p ){ int isPhrase; if( !sqlite3_fts3_enable_parentheses && p->eType==FTSQUERY_PHRASE && pParse->isNot ){ /* Create an implicit NOT operator. */ Fts3Expr *pNot = fts3MallocZero(sizeof(Fts3Expr)); if( !pNot ){ sqlite3Fts3ExprFree(p); rc = SQLITE_NOMEM; goto exprparse_out; } pNot->eType = FTSQUERY_NOT; pNot->pRight = p; p->pParent = pNot; if( pNotBranch ){ pNot->pLeft = pNotBranch; pNotBranch->pParent = pNot; } pNotBranch = pNot; p = pPrev; }else{ int eType = p->eType; isPhrase = (eType==FTSQUERY_PHRASE || p->pLeft); /* The isRequirePhrase variable is set to true if a phrase or ** an expression contained in parenthesis is required. If a ** binary operator (AND, OR, NOT or NEAR) is encounted when ** isRequirePhrase is set, this is a syntax error. */ if( !isPhrase && isRequirePhrase ){ sqlite3Fts3ExprFree(p); rc = SQLITE_ERROR; goto exprparse_out; } if( isPhrase && !isRequirePhrase ){ /* Insert an implicit AND operator. */ Fts3Expr *pAnd; assert( pRet && pPrev ); pAnd = fts3MallocZero(sizeof(Fts3Expr)); if( !pAnd ){ sqlite3Fts3ExprFree(p); rc = SQLITE_NOMEM; goto exprparse_out; } pAnd->eType = FTSQUERY_AND; insertBinaryOperator(&pRet, pPrev, pAnd); pPrev = pAnd; } /* This test catches attempts to make either operand of a NEAR ** operator something other than a phrase. For example, either of ** the following: ** ** (bracketed expression) NEAR phrase ** phrase NEAR (bracketed expression) ** ** Return an error in either case. */ if( pPrev && ( (eType==FTSQUERY_NEAR && !isPhrase && pPrev->eType!=FTSQUERY_PHRASE) || (eType!=FTSQUERY_PHRASE && isPhrase && pPrev->eType==FTSQUERY_NEAR) )){ sqlite3Fts3ExprFree(p); rc = SQLITE_ERROR; goto exprparse_out; } if( isPhrase ){ if( pRet ){ assert( pPrev && pPrev->pLeft && pPrev->pRight==0 ); pPrev->pRight = p; p->pParent = pPrev; }else{ pRet = p; } }else{ insertBinaryOperator(&pRet, pPrev, p); } isRequirePhrase = !isPhrase; } pPrev = p; } assert( nByte>0 ); } assert( rc!=SQLITE_OK || (nByte>0 && nByte<=nIn) ); nIn -= nByte; zIn += nByte; } if( rc==SQLITE_DONE && pRet && isRequirePhrase ){ rc = SQLITE_ERROR; } if( rc==SQLITE_DONE ){ rc = SQLITE_OK; if( !sqlite3_fts3_enable_parentheses && pNotBranch ){ if( !pRet ){ rc = SQLITE_ERROR; }else{ Fts3Expr *pIter = pNotBranch; while( pIter->pLeft ){ pIter = pIter->pLeft; } pIter->pLeft = pRet; pRet->pParent = pIter; pRet = pNotBranch; } } } *pnConsumed = n - nIn; exprparse_out: if( rc!=SQLITE_OK ){ sqlite3Fts3ExprFree(pRet); sqlite3Fts3ExprFree(pNotBranch); pRet = 0; } *ppExpr = pRet; return rc; } /* ** Return SQLITE_ERROR if the maximum depth of the expression tree passed ** as the only argument is more than nMaxDepth. */ static int fts3ExprCheckDepth(Fts3Expr *p, int nMaxDepth){ int rc = SQLITE_OK; if( p ){ if( nMaxDepth<0 ){ rc = SQLITE_TOOBIG; }else{ rc = fts3ExprCheckDepth(p->pLeft, nMaxDepth-1); if( rc==SQLITE_OK ){ rc = fts3ExprCheckDepth(p->pRight, nMaxDepth-1); } } } return rc; } /* ** This function attempts to transform the expression tree at (*pp) to ** an equivalent but more balanced form. The tree is modified in place. ** If successful, SQLITE_OK is returned and (*pp) set to point to the ** new root expression node. ** ** nMaxDepth is the maximum allowable depth of the balanced sub-tree. ** ** Otherwise, if an error occurs, an SQLite error code is returned and ** expression (*pp) freed. */ static int fts3ExprBalance(Fts3Expr **pp, int nMaxDepth){ int rc = SQLITE_OK; /* Return code */ Fts3Expr *pRoot = *pp; /* Initial root node */ Fts3Expr *pFree = 0; /* List of free nodes. Linked by pParent. */ int eType = pRoot->eType; /* Type of node in this tree */ if( nMaxDepth==0 ){ rc = SQLITE_ERROR; } if( rc==SQLITE_OK ){ if( (eType==FTSQUERY_AND || eType==FTSQUERY_OR) ){ Fts3Expr **apLeaf; apLeaf = (Fts3Expr **)sqlite3_malloc(sizeof(Fts3Expr *) * nMaxDepth); if( 0==apLeaf ){ rc = SQLITE_NOMEM; }else{ memset(apLeaf, 0, sizeof(Fts3Expr *) * nMaxDepth); } if( rc==SQLITE_OK ){ int i; Fts3Expr *p; /* Set $p to point to the left-most leaf in the tree of eType nodes. */ for(p=pRoot; p->eType==eType; p=p->pLeft){ assert( p->pParent==0 || p->pParent->pLeft==p ); assert( p->pLeft && p->pRight ); } /* This loop runs once for each leaf in the tree of eType nodes. */ while( 1 ){ int iLvl; Fts3Expr *pParent = p->pParent; /* Current parent of p */ assert( pParent==0 || pParent->pLeft==p ); p->pParent = 0; if( pParent ){ pParent->pLeft = 0; }else{ pRoot = 0; } rc = fts3ExprBalance(&p, nMaxDepth-1); if( rc!=SQLITE_OK ) break; for(iLvl=0; p && iLvlpLeft = apLeaf[iLvl]; pFree->pRight = p; pFree->pLeft->pParent = pFree; pFree->pRight->pParent = pFree; p = pFree; pFree = pFree->pParent; p->pParent = 0; apLeaf[iLvl] = 0; } } if( p ){ sqlite3Fts3ExprFree(p); rc = SQLITE_TOOBIG; break; } /* If that was the last leaf node, break out of the loop */ if( pParent==0 ) break; /* Set $p to point to the next leaf in the tree of eType nodes */ for(p=pParent->pRight; p->eType==eType; p=p->pLeft); /* Remove pParent from the original tree. */ assert( pParent->pParent==0 || pParent->pParent->pLeft==pParent ); pParent->pRight->pParent = pParent->pParent; if( pParent->pParent ){ pParent->pParent->pLeft = pParent->pRight; }else{ assert( pParent==pRoot ); pRoot = pParent->pRight; } /* Link pParent into the free node list. It will be used as an ** internal node of the new tree. */ pParent->pParent = pFree; pFree = pParent; } if( rc==SQLITE_OK ){ p = 0; for(i=0; ipParent = 0; }else{ assert( pFree!=0 ); pFree->pRight = p; pFree->pLeft = apLeaf[i]; pFree->pLeft->pParent = pFree; pFree->pRight->pParent = pFree; p = pFree; pFree = pFree->pParent; p->pParent = 0; } } } pRoot = p; }else{ /* An error occurred. Delete the contents of the apLeaf[] array ** and pFree list. Everything else is cleaned up by the call to ** sqlite3Fts3ExprFree(pRoot) below. */ Fts3Expr *pDel; for(i=0; ipParent; sqlite3_free(pDel); } } assert( pFree==0 ); sqlite3_free( apLeaf ); } }else if( eType==FTSQUERY_NOT ){ Fts3Expr *pLeft = pRoot->pLeft; Fts3Expr *pRight = pRoot->pRight; pRoot->pLeft = 0; pRoot->pRight = 0; pLeft->pParent = 0; pRight->pParent = 0; rc = fts3ExprBalance(&pLeft, nMaxDepth-1); if( rc==SQLITE_OK ){ rc = fts3ExprBalance(&pRight, nMaxDepth-1); } if( rc!=SQLITE_OK ){ sqlite3Fts3ExprFree(pRight); sqlite3Fts3ExprFree(pLeft); }else{ assert( pLeft && pRight ); pRoot->pLeft = pLeft; pLeft->pParent = pRoot; pRoot->pRight = pRight; pRight->pParent = pRoot; } } } if( rc!=SQLITE_OK ){ sqlite3Fts3ExprFree(pRoot); pRoot = 0; } *pp = pRoot; return rc; } /* ** This function is similar to sqlite3Fts3ExprParse(), with the following ** differences: ** ** 1. It does not do expression rebalancing. ** 2. It does not check that the expression does not exceed the ** maximum allowable depth. ** 3. Even if it fails, *ppExpr may still be set to point to an ** expression tree. It should be deleted using sqlite3Fts3ExprFree() ** in this case. */ static int fts3ExprParseUnbalanced( sqlite3_tokenizer *pTokenizer, /* Tokenizer module */ int iLangid, /* Language id for tokenizer */ char **azCol, /* Array of column names for fts3 table */ int bFts4, /* True to allow FTS4-only syntax */ int nCol, /* Number of entries in azCol[] */ int iDefaultCol, /* Default column to query */ const char *z, int n, /* Text of MATCH query */ Fts3Expr **ppExpr /* OUT: Parsed query structure */ ){ int nParsed; int rc; ParseContext sParse; memset(&sParse, 0, sizeof(ParseContext)); sParse.pTokenizer = pTokenizer; sParse.iLangid = iLangid; sParse.azCol = (const char **)azCol; sParse.nCol = nCol; sParse.iDefaultCol = iDefaultCol; sParse.bFts4 = bFts4; if( z==0 ){ *ppExpr = 0; return SQLITE_OK; } if( n<0 ){ n = (int)strlen(z); } rc = fts3ExprParse(&sParse, z, n, ppExpr, &nParsed); assert( rc==SQLITE_OK || *ppExpr==0 ); /* Check for mismatched parenthesis */ if( rc==SQLITE_OK && sParse.nNest ){ rc = SQLITE_ERROR; } return rc; } /* ** Parameters z and n contain a pointer to and length of a buffer containing ** an fts3 query expression, respectively. This function attempts to parse the ** query expression and create a tree of Fts3Expr structures representing the ** parsed expression. If successful, *ppExpr is set to point to the head ** of the parsed expression tree and SQLITE_OK is returned. If an error ** occurs, either SQLITE_NOMEM (out-of-memory error) or SQLITE_ERROR (parse ** error) is returned and *ppExpr is set to 0. ** ** If parameter n is a negative number, then z is assumed to point to a ** nul-terminated string and the length is determined using strlen(). ** ** The first parameter, pTokenizer, is passed the fts3 tokenizer module to ** use to normalize query tokens while parsing the expression. The azCol[] ** array, which is assumed to contain nCol entries, should contain the names ** of each column in the target fts3 table, in order from left to right. ** Column names must be nul-terminated strings. ** ** The iDefaultCol parameter should be passed the index of the table column ** that appears on the left-hand-side of the MATCH operator (the default ** column to match against for tokens for which a column name is not explicitly ** specified as part of the query string), or -1 if tokens may by default ** match any table column. */ int sqlite3Fts3ExprParse( sqlite3_tokenizer *pTokenizer, /* Tokenizer module */ int iLangid, /* Language id for tokenizer */ char **azCol, /* Array of column names for fts3 table */ int bFts4, /* True to allow FTS4-only syntax */ int nCol, /* Number of entries in azCol[] */ int iDefaultCol, /* Default column to query */ const char *z, int n, /* Text of MATCH query */ Fts3Expr **ppExpr, /* OUT: Parsed query structure */ char **pzErr /* OUT: Error message (sqlite3_malloc) */ ){ int rc = fts3ExprParseUnbalanced( pTokenizer, iLangid, azCol, bFts4, nCol, iDefaultCol, z, n, ppExpr ); /* Rebalance the expression. And check that its depth does not exceed ** SQLITE_FTS3_MAX_EXPR_DEPTH. */ if( rc==SQLITE_OK && *ppExpr ){ rc = fts3ExprBalance(ppExpr, SQLITE_FTS3_MAX_EXPR_DEPTH); if( rc==SQLITE_OK ){ rc = fts3ExprCheckDepth(*ppExpr, SQLITE_FTS3_MAX_EXPR_DEPTH); } } if( rc!=SQLITE_OK ){ sqlite3Fts3ExprFree(*ppExpr); *ppExpr = 0; if( rc==SQLITE_TOOBIG ){ sqlite3Fts3ErrMsg(pzErr, "FTS expression tree is too large (maximum depth %d)", SQLITE_FTS3_MAX_EXPR_DEPTH ); rc = SQLITE_ERROR; }else if( rc==SQLITE_ERROR ){ sqlite3Fts3ErrMsg(pzErr, "malformed MATCH expression: [%s]", z); } } return rc; } /* ** Free a single node of an expression tree. */ static void fts3FreeExprNode(Fts3Expr *p){ assert( p->eType==FTSQUERY_PHRASE || p->pPhrase==0 ); sqlite3Fts3EvalPhraseCleanup(p->pPhrase); sqlite3_free(p->aMI); sqlite3_free(p); } /* ** Free a parsed fts3 query expression allocated by sqlite3Fts3ExprParse(). ** ** This function would be simpler if it recursively called itself. But ** that would mean passing a sufficiently large expression to ExprParse() ** could cause a stack overflow. */ void sqlite3Fts3ExprFree(Fts3Expr *pDel){ Fts3Expr *p; assert( pDel==0 || pDel->pParent==0 ); for(p=pDel; p && (p->pLeft||p->pRight); p=(p->pLeft ? p->pLeft : p->pRight)){ assert( p->pParent==0 || p==p->pParent->pRight || p==p->pParent->pLeft ); } while( p ){ Fts3Expr *pParent = p->pParent; fts3FreeExprNode(p); if( pParent && p==pParent->pLeft && pParent->pRight ){ p = pParent->pRight; while( p && (p->pLeft || p->pRight) ){ assert( p==p->pParent->pRight || p==p->pParent->pLeft ); p = (p->pLeft ? p->pLeft : p->pRight); } }else{ p = pParent; } } } /**************************************************************************** ***************************************************************************** ** Everything after this point is just test code. */ #ifdef SQLITE_TEST #include /* ** Function to query the hash-table of tokenizers (see README.tokenizers). */ static int queryTestTokenizer( sqlite3 *db, const char *zName, const sqlite3_tokenizer_module **pp ){ int rc; sqlite3_stmt *pStmt; const char zSql[] = "SELECT fts3_tokenizer(?)"; *pp = 0; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ return rc; } sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); if( SQLITE_ROW==sqlite3_step(pStmt) ){ if( sqlite3_column_type(pStmt, 0)==SQLITE_BLOB ){ memcpy((void *)pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp)); } } return sqlite3_finalize(pStmt); } /* ** Return a pointer to a buffer containing a text representation of the ** expression passed as the first argument. The buffer is obtained from ** sqlite3_malloc(). It is the responsibility of the caller to use ** sqlite3_free() to release the memory. If an OOM condition is encountered, ** NULL is returned. ** ** If the second argument is not NULL, then its contents are prepended to ** the returned expression text and then freed using sqlite3_free(). */ static char *exprToString(Fts3Expr *pExpr, char *zBuf){ if( pExpr==0 ){ return sqlite3_mprintf(""); } switch( pExpr->eType ){ case FTSQUERY_PHRASE: { Fts3Phrase *pPhrase = pExpr->pPhrase; int i; zBuf = sqlite3_mprintf( "%zPHRASE %d 0", zBuf, pPhrase->iColumn); for(i=0; zBuf && inToken; i++){ zBuf = sqlite3_mprintf("%z %.*s%s", zBuf, pPhrase->aToken[i].n, pPhrase->aToken[i].z, (pPhrase->aToken[i].isPrefix?"+":"") ); } return zBuf; } case FTSQUERY_NEAR: zBuf = sqlite3_mprintf("%zNEAR/%d ", zBuf, pExpr->nNear); break; case FTSQUERY_NOT: zBuf = sqlite3_mprintf("%zNOT ", zBuf); break; case FTSQUERY_AND: zBuf = sqlite3_mprintf("%zAND ", zBuf); break; case FTSQUERY_OR: zBuf = sqlite3_mprintf("%zOR ", zBuf); break; } if( zBuf ) zBuf = sqlite3_mprintf("%z{", zBuf); if( zBuf ) zBuf = exprToString(pExpr->pLeft, zBuf); if( zBuf ) zBuf = sqlite3_mprintf("%z} {", zBuf); if( zBuf ) zBuf = exprToString(pExpr->pRight, zBuf); if( zBuf ) zBuf = sqlite3_mprintf("%z}", zBuf); return zBuf; } /* ** This is the implementation of a scalar SQL function used to test the ** expression parser. It should be called as follows: ** ** fts3_exprtest(, , , ...); ** ** The first argument, , is the name of the fts3 tokenizer used ** to parse the query expression (see README.tokenizers). The second argument ** is the query expression to parse. Each subsequent argument is the name ** of a column of the fts3 table that the query expression may refer to. ** For example: ** ** SELECT fts3_exprtest('simple', 'Bill col2:Bloggs', 'col1', 'col2'); */ static void fts3ExprTest( sqlite3_context *context, int argc, sqlite3_value **argv ){ sqlite3_tokenizer_module const *pModule = 0; sqlite3_tokenizer *pTokenizer = 0; int rc; char **azCol = 0; const char *zExpr; int nExpr; int nCol; int ii; Fts3Expr *pExpr; char *zBuf = 0; sqlite3 *db = sqlite3_context_db_handle(context); if( argc<3 ){ sqlite3_result_error(context, "Usage: fts3_exprtest(tokenizer, expr, col1, ...", -1 ); return; } rc = queryTestTokenizer(db, (const char *)sqlite3_value_text(argv[0]), &pModule); if( rc==SQLITE_NOMEM ){ sqlite3_result_error_nomem(context); goto exprtest_out; }else if( !pModule ){ sqlite3_result_error(context, "No such tokenizer module", -1); goto exprtest_out; } rc = pModule->xCreate(0, 0, &pTokenizer); assert( rc==SQLITE_NOMEM || rc==SQLITE_OK ); if( rc==SQLITE_NOMEM ){ sqlite3_result_error_nomem(context); goto exprtest_out; } pTokenizer->pModule = pModule; zExpr = (const char *)sqlite3_value_text(argv[1]); nExpr = sqlite3_value_bytes(argv[1]); nCol = argc-2; azCol = (char **)sqlite3_malloc(nCol*sizeof(char *)); if( !azCol ){ sqlite3_result_error_nomem(context); goto exprtest_out; } for(ii=0; iixDestroy(pTokenizer); } sqlite3_free(azCol); } /* ** Register the query expression parser test function fts3_exprtest() ** with database connection db. */ int sqlite3Fts3ExprInitTestInterface(sqlite3* db){ int rc = sqlite3_create_function( db, "fts3_exprtest", -1, SQLITE_UTF8, 0, fts3ExprTest, 0, 0 ); if( rc==SQLITE_OK ){ rc = sqlite3_create_function(db, "fts3_exprtest_rebalance", -1, SQLITE_UTF8, (void *)1, fts3ExprTest, 0, 0 ); } return rc; } #endif #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_hash.c ================================================ /* ** 2001 September 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the implementation of generic hash-tables used in SQLite. ** We've modified it slightly to serve as a standalone hash table ** implementation for the full-text indexing module. */ /* ** The code in this file is only compiled if: ** ** * The FTS3 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS3 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS3 is defined). */ #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) #include #include #include #include "fts3_hash.h" /* ** Malloc and Free functions */ static void *fts3HashMalloc(int n){ void *p = sqlite3_malloc(n); if( p ){ memset(p, 0, n); } return p; } static void fts3HashFree(void *p){ sqlite3_free(p); } /* Turn bulk memory into a hash table object by initializing the ** fields of the Hash structure. ** ** "pNew" is a pointer to the hash table that is to be initialized. ** keyClass is one of the constants ** FTS3_HASH_BINARY or FTS3_HASH_STRING. The value of keyClass ** determines what kind of key the hash table will use. "copyKey" is ** true if the hash table should make its own private copy of keys and ** false if it should just use the supplied pointer. */ void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey){ assert( pNew!=0 ); assert( keyClass>=FTS3_HASH_STRING && keyClass<=FTS3_HASH_BINARY ); pNew->keyClass = keyClass; pNew->copyKey = copyKey; pNew->first = 0; pNew->count = 0; pNew->htsize = 0; pNew->ht = 0; } /* Remove all entries from a hash table. Reclaim all memory. ** Call this routine to delete a hash table or to reset a hash table ** to the empty state. */ void sqlite3Fts3HashClear(Fts3Hash *pH){ Fts3HashElem *elem; /* For looping over all elements of the table */ assert( pH!=0 ); elem = pH->first; pH->first = 0; fts3HashFree(pH->ht); pH->ht = 0; pH->htsize = 0; while( elem ){ Fts3HashElem *next_elem = elem->next; if( pH->copyKey && elem->pKey ){ fts3HashFree(elem->pKey); } fts3HashFree(elem); elem = next_elem; } pH->count = 0; } /* ** Hash and comparison functions when the mode is FTS3_HASH_STRING */ static int fts3StrHash(const void *pKey, int nKey){ const char *z = (const char *)pKey; unsigned h = 0; if( nKey<=0 ) nKey = (int) strlen(z); while( nKey > 0 ){ h = (h<<3) ^ h ^ *z++; nKey--; } return (int)(h & 0x7fffffff); } static int fts3StrCompare(const void *pKey1, int n1, const void *pKey2, int n2){ if( n1!=n2 ) return 1; return strncmp((const char*)pKey1,(const char*)pKey2,n1); } /* ** Hash and comparison functions when the mode is FTS3_HASH_BINARY */ static int fts3BinHash(const void *pKey, int nKey){ int h = 0; const char *z = (const char *)pKey; while( nKey-- > 0 ){ h = (h<<3) ^ h ^ *(z++); } return h & 0x7fffffff; } static int fts3BinCompare(const void *pKey1, int n1, const void *pKey2, int n2){ if( n1!=n2 ) return 1; return memcmp(pKey1,pKey2,n1); } /* ** Return a pointer to the appropriate hash function given the key class. ** ** The C syntax in this function definition may be unfamilar to some ** programmers, so we provide the following additional explanation: ** ** The name of the function is "ftsHashFunction". The function takes a ** single parameter "keyClass". The return value of ftsHashFunction() ** is a pointer to another function. Specifically, the return value ** of ftsHashFunction() is a pointer to a function that takes two parameters ** with types "const void*" and "int" and returns an "int". */ static int (*ftsHashFunction(int keyClass))(const void*,int){ if( keyClass==FTS3_HASH_STRING ){ return &fts3StrHash; }else{ assert( keyClass==FTS3_HASH_BINARY ); return &fts3BinHash; } } /* ** Return a pointer to the appropriate hash function given the key class. ** ** For help in interpreted the obscure C code in the function definition, ** see the header comment on the previous function. */ static int (*ftsCompareFunction(int keyClass))(const void*,int,const void*,int){ if( keyClass==FTS3_HASH_STRING ){ return &fts3StrCompare; }else{ assert( keyClass==FTS3_HASH_BINARY ); return &fts3BinCompare; } } /* Link an element into the hash table */ static void fts3HashInsertElement( Fts3Hash *pH, /* The complete hash table */ struct _fts3ht *pEntry, /* The entry into which pNew is inserted */ Fts3HashElem *pNew /* The element to be inserted */ ){ Fts3HashElem *pHead; /* First element already in pEntry */ pHead = pEntry->chain; if( pHead ){ pNew->next = pHead; pNew->prev = pHead->prev; if( pHead->prev ){ pHead->prev->next = pNew; } else { pH->first = pNew; } pHead->prev = pNew; }else{ pNew->next = pH->first; if( pH->first ){ pH->first->prev = pNew; } pNew->prev = 0; pH->first = pNew; } pEntry->count++; pEntry->chain = pNew; } /* Resize the hash table so that it cantains "new_size" buckets. ** "new_size" must be a power of 2. The hash table might fail ** to resize if sqliteMalloc() fails. ** ** Return non-zero if a memory allocation error occurs. */ static int fts3Rehash(Fts3Hash *pH, int new_size){ struct _fts3ht *new_ht; /* The new hash table */ Fts3HashElem *elem, *next_elem; /* For looping over existing elements */ int (*xHash)(const void*,int); /* The hash function */ assert( (new_size & (new_size-1))==0 ); new_ht = (struct _fts3ht *)fts3HashMalloc( new_size*sizeof(struct _fts3ht) ); if( new_ht==0 ) return 1; fts3HashFree(pH->ht); pH->ht = new_ht; pH->htsize = new_size; xHash = ftsHashFunction(pH->keyClass); for(elem=pH->first, pH->first=0; elem; elem = next_elem){ int h = (*xHash)(elem->pKey, elem->nKey) & (new_size-1); next_elem = elem->next; fts3HashInsertElement(pH, &new_ht[h], elem); } return 0; } /* This function (for internal use only) locates an element in an ** hash table that matches the given key. The hash for this key has ** already been computed and is passed as the 4th parameter. */ static Fts3HashElem *fts3FindElementByHash( const Fts3Hash *pH, /* The pH to be searched */ const void *pKey, /* The key we are searching for */ int nKey, int h /* The hash for this key. */ ){ Fts3HashElem *elem; /* Used to loop thru the element list */ int count; /* Number of elements left to test */ int (*xCompare)(const void*,int,const void*,int); /* comparison function */ if( pH->ht ){ struct _fts3ht *pEntry = &pH->ht[h]; elem = pEntry->chain; count = pEntry->count; xCompare = ftsCompareFunction(pH->keyClass); while( count-- && elem ){ if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ return elem; } elem = elem->next; } } return 0; } /* Remove a single entry from the hash table given a pointer to that ** element and a hash on the element's key. */ static void fts3RemoveElementByHash( Fts3Hash *pH, /* The pH containing "elem" */ Fts3HashElem* elem, /* The element to be removed from the pH */ int h /* Hash value for the element */ ){ struct _fts3ht *pEntry; if( elem->prev ){ elem->prev->next = elem->next; }else{ pH->first = elem->next; } if( elem->next ){ elem->next->prev = elem->prev; } pEntry = &pH->ht[h]; if( pEntry->chain==elem ){ pEntry->chain = elem->next; } pEntry->count--; if( pEntry->count<=0 ){ pEntry->chain = 0; } if( pH->copyKey && elem->pKey ){ fts3HashFree(elem->pKey); } fts3HashFree( elem ); pH->count--; if( pH->count<=0 ){ assert( pH->first==0 ); assert( pH->count==0 ); fts3HashClear(pH); } } Fts3HashElem *sqlite3Fts3HashFindElem( const Fts3Hash *pH, const void *pKey, int nKey ){ int h; /* A hash on key */ int (*xHash)(const void*,int); /* The hash function */ if( pH==0 || pH->ht==0 ) return 0; xHash = ftsHashFunction(pH->keyClass); assert( xHash!=0 ); h = (*xHash)(pKey,nKey); assert( (pH->htsize & (pH->htsize-1))==0 ); return fts3FindElementByHash(pH,pKey,nKey, h & (pH->htsize-1)); } /* ** Attempt to locate an element of the hash table pH with a key ** that matches pKey,nKey. Return the data for this element if it is ** found, or NULL if there is no match. */ void *sqlite3Fts3HashFind(const Fts3Hash *pH, const void *pKey, int nKey){ Fts3HashElem *pElem; /* The element that matches key (if any) */ pElem = sqlite3Fts3HashFindElem(pH, pKey, nKey); return pElem ? pElem->data : 0; } /* Insert an element into the hash table pH. The key is pKey,nKey ** and the data is "data". ** ** If no element exists with a matching key, then a new ** element is created. A copy of the key is made if the copyKey ** flag is set. NULL is returned. ** ** If another element already exists with the same key, then the ** new data replaces the old data and the old data is returned. ** The key is not copied in this instance. If a malloc fails, then ** the new data is returned and the hash table is unchanged. ** ** If the "data" parameter to this function is NULL, then the ** element corresponding to "key" is removed from the hash table. */ void *sqlite3Fts3HashInsert( Fts3Hash *pH, /* The hash table to insert into */ const void *pKey, /* The key */ int nKey, /* Number of bytes in the key */ void *data /* The data */ ){ int hraw; /* Raw hash value of the key */ int h; /* the hash of the key modulo hash table size */ Fts3HashElem *elem; /* Used to loop thru the element list */ Fts3HashElem *new_elem; /* New element added to the pH */ int (*xHash)(const void*,int); /* The hash function */ assert( pH!=0 ); xHash = ftsHashFunction(pH->keyClass); assert( xHash!=0 ); hraw = (*xHash)(pKey, nKey); assert( (pH->htsize & (pH->htsize-1))==0 ); h = hraw & (pH->htsize-1); elem = fts3FindElementByHash(pH,pKey,nKey,h); if( elem ){ void *old_data = elem->data; if( data==0 ){ fts3RemoveElementByHash(pH,elem,h); }else{ elem->data = data; } return old_data; } if( data==0 ) return 0; if( (pH->htsize==0 && fts3Rehash(pH,8)) || (pH->count>=pH->htsize && fts3Rehash(pH, pH->htsize*2)) ){ pH->count = 0; return data; } assert( pH->htsize>0 ); new_elem = (Fts3HashElem*)fts3HashMalloc( sizeof(Fts3HashElem) ); if( new_elem==0 ) return data; if( pH->copyKey && pKey!=0 ){ new_elem->pKey = fts3HashMalloc( nKey ); if( new_elem->pKey==0 ){ fts3HashFree(new_elem); return data; } memcpy((void*)new_elem->pKey, pKey, nKey); }else{ new_elem->pKey = (void*)pKey; } new_elem->nKey = nKey; pH->count++; assert( pH->htsize>0 ); assert( (pH->htsize & (pH->htsize-1))==0 ); h = hraw & (pH->htsize-1); fts3HashInsertElement(pH, &pH->ht[h], new_elem); new_elem->data = data; return 0; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_hash.h ================================================ /* ** 2001 September 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the header file for the generic hash-table implementation ** used in SQLite. We've modified it slightly to serve as a standalone ** hash table implementation for the full-text indexing module. ** */ #ifndef _FTS3_HASH_H_ #define _FTS3_HASH_H_ /* Forward declarations of structures. */ typedef struct Fts3Hash Fts3Hash; typedef struct Fts3HashElem Fts3HashElem; /* A complete hash table is an instance of the following structure. ** The internals of this structure are intended to be opaque -- client ** code should not attempt to access or modify the fields of this structure ** directly. Change this structure only by using the routines below. ** However, many of the "procedures" and "functions" for modifying and ** accessing this structure are really macros, so we can't really make ** this structure opaque. */ struct Fts3Hash { char keyClass; /* HASH_INT, _POINTER, _STRING, _BINARY */ char copyKey; /* True if copy of key made on insert */ int count; /* Number of entries in this table */ Fts3HashElem *first; /* The first element of the array */ int htsize; /* Number of buckets in the hash table */ struct _fts3ht { /* the hash table */ int count; /* Number of entries with this hash */ Fts3HashElem *chain; /* Pointer to first entry with this hash */ } *ht; }; /* Each element in the hash table is an instance of the following ** structure. All elements are stored on a single doubly-linked list. ** ** Again, this structure is intended to be opaque, but it can't really ** be opaque because it is used by macros. */ struct Fts3HashElem { Fts3HashElem *next, *prev; /* Next and previous elements in the table */ void *data; /* Data associated with this element */ void *pKey; int nKey; /* Key associated with this element */ }; /* ** There are 2 different modes of operation for a hash table: ** ** FTS3_HASH_STRING pKey points to a string that is nKey bytes long ** (including the null-terminator, if any). Case ** is respected in comparisons. ** ** FTS3_HASH_BINARY pKey points to binary data nKey bytes long. ** memcmp() is used to compare keys. ** ** A copy of the key is made if the copyKey parameter to fts3HashInit is 1. */ #define FTS3_HASH_STRING 1 #define FTS3_HASH_BINARY 2 /* ** Access routines. To delete, insert a NULL pointer. */ void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey); void *sqlite3Fts3HashInsert(Fts3Hash*, const void *pKey, int nKey, void *pData); void *sqlite3Fts3HashFind(const Fts3Hash*, const void *pKey, int nKey); void sqlite3Fts3HashClear(Fts3Hash*); Fts3HashElem *sqlite3Fts3HashFindElem(const Fts3Hash *, const void *, int); /* ** Shorthand for the functions above */ #define fts3HashInit sqlite3Fts3HashInit #define fts3HashInsert sqlite3Fts3HashInsert #define fts3HashFind sqlite3Fts3HashFind #define fts3HashClear sqlite3Fts3HashClear #define fts3HashFindElem sqlite3Fts3HashFindElem /* ** Macros for looping over all elements of a hash table. The idiom is ** like this: ** ** Fts3Hash h; ** Fts3HashElem *p; ** ... ** for(p=fts3HashFirst(&h); p; p=fts3HashNext(p)){ ** SomeStructure *pData = fts3HashData(p); ** // do something with pData ** } */ #define fts3HashFirst(H) ((H)->first) #define fts3HashNext(E) ((E)->next) #define fts3HashData(E) ((E)->data) #define fts3HashKey(E) ((E)->pKey) #define fts3HashKeysize(E) ((E)->nKey) /* ** Number of entries in a hash table */ #define fts3HashCount(H) ((H)->count) #endif /* _FTS3_HASH_H_ */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_icu.c ================================================ /* ** 2007 June 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file implements a tokenizer for fts3 based on the ICU library. */ #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) #ifdef SQLITE_ENABLE_ICU #include #include #include "fts3_tokenizer.h" #include #include #include #include typedef struct IcuTokenizer IcuTokenizer; typedef struct IcuCursor IcuCursor; struct IcuTokenizer { sqlite3_tokenizer base; char *zLocale; }; struct IcuCursor { sqlite3_tokenizer_cursor base; UBreakIterator *pIter; /* ICU break-iterator object */ int nChar; /* Number of UChar elements in pInput */ UChar *aChar; /* Copy of input using utf-16 encoding */ int *aOffset; /* Offsets of each character in utf-8 input */ int nBuffer; char *zBuffer; int iToken; }; /* ** Create a new tokenizer instance. */ static int icuCreate( int argc, /* Number of entries in argv[] */ const char * const *argv, /* Tokenizer creation arguments */ sqlite3_tokenizer **ppTokenizer /* OUT: Created tokenizer */ ){ IcuTokenizer *p; int n = 0; if( argc>0 ){ n = strlen(argv[0])+1; } p = (IcuTokenizer *)sqlite3_malloc(sizeof(IcuTokenizer)+n); if( !p ){ return SQLITE_NOMEM; } memset(p, 0, sizeof(IcuTokenizer)); if( n ){ p->zLocale = (char *)&p[1]; memcpy(p->zLocale, argv[0], n); } *ppTokenizer = (sqlite3_tokenizer *)p; return SQLITE_OK; } /* ** Destroy a tokenizer */ static int icuDestroy(sqlite3_tokenizer *pTokenizer){ IcuTokenizer *p = (IcuTokenizer *)pTokenizer; sqlite3_free(p); return SQLITE_OK; } /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is pInput[0..nBytes-1]. A cursor ** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int icuOpen( sqlite3_tokenizer *pTokenizer, /* The tokenizer */ const char *zInput, /* Input string */ int nInput, /* Length of zInput in bytes */ sqlite3_tokenizer_cursor **ppCursor /* OUT: Tokenization cursor */ ){ IcuTokenizer *p = (IcuTokenizer *)pTokenizer; IcuCursor *pCsr; const int32_t opt = U_FOLD_CASE_DEFAULT; UErrorCode status = U_ZERO_ERROR; int nChar; UChar32 c; int iInput = 0; int iOut = 0; *ppCursor = 0; if( zInput==0 ){ nInput = 0; zInput = ""; }else if( nInput<0 ){ nInput = strlen(zInput); } nChar = nInput+1; pCsr = (IcuCursor *)sqlite3_malloc( sizeof(IcuCursor) + /* IcuCursor */ ((nChar+3)&~3) * sizeof(UChar) + /* IcuCursor.aChar[] */ (nChar+1) * sizeof(int) /* IcuCursor.aOffset[] */ ); if( !pCsr ){ return SQLITE_NOMEM; } memset(pCsr, 0, sizeof(IcuCursor)); pCsr->aChar = (UChar *)&pCsr[1]; pCsr->aOffset = (int *)&pCsr->aChar[(nChar+3)&~3]; pCsr->aOffset[iOut] = iInput; U8_NEXT(zInput, iInput, nInput, c); while( c>0 ){ int isError = 0; c = u_foldCase(c, opt); U16_APPEND(pCsr->aChar, iOut, nChar, c, isError); if( isError ){ sqlite3_free(pCsr); return SQLITE_ERROR; } pCsr->aOffset[iOut] = iInput; if( iInputpIter = ubrk_open(UBRK_WORD, p->zLocale, pCsr->aChar, iOut, &status); if( !U_SUCCESS(status) ){ sqlite3_free(pCsr); return SQLITE_ERROR; } pCsr->nChar = iOut; ubrk_first(pCsr->pIter); *ppCursor = (sqlite3_tokenizer_cursor *)pCsr; return SQLITE_OK; } /* ** Close a tokenization cursor previously opened by a call to icuOpen(). */ static int icuClose(sqlite3_tokenizer_cursor *pCursor){ IcuCursor *pCsr = (IcuCursor *)pCursor; ubrk_close(pCsr->pIter); sqlite3_free(pCsr->zBuffer); sqlite3_free(pCsr); return SQLITE_OK; } /* ** Extract the next token from a tokenization cursor. */ static int icuNext( sqlite3_tokenizer_cursor *pCursor, /* Cursor returned by simpleOpen */ const char **ppToken, /* OUT: *ppToken is the token text */ int *pnBytes, /* OUT: Number of bytes in token */ int *piStartOffset, /* OUT: Starting offset of token */ int *piEndOffset, /* OUT: Ending offset of token */ int *piPosition /* OUT: Position integer of token */ ){ IcuCursor *pCsr = (IcuCursor *)pCursor; int iStart = 0; int iEnd = 0; int nByte = 0; while( iStart==iEnd ){ UChar32 c; iStart = ubrk_current(pCsr->pIter); iEnd = ubrk_next(pCsr->pIter); if( iEnd==UBRK_DONE ){ return SQLITE_DONE; } while( iStartaChar, iWhite, pCsr->nChar, c); if( u_isspace(c) ){ iStart = iWhite; }else{ break; } } assert(iStart<=iEnd); } do { UErrorCode status = U_ZERO_ERROR; if( nByte ){ char *zNew = sqlite3_realloc(pCsr->zBuffer, nByte); if( !zNew ){ return SQLITE_NOMEM; } pCsr->zBuffer = zNew; pCsr->nBuffer = nByte; } u_strToUTF8( pCsr->zBuffer, pCsr->nBuffer, &nByte, /* Output vars */ &pCsr->aChar[iStart], iEnd-iStart, /* Input vars */ &status /* Output success/failure */ ); } while( nByte>pCsr->nBuffer ); *ppToken = pCsr->zBuffer; *pnBytes = nByte; *piStartOffset = pCsr->aOffset[iStart]; *piEndOffset = pCsr->aOffset[iEnd]; *piPosition = pCsr->iToken++; return SQLITE_OK; } /* ** The set of routines that implement the simple tokenizer */ static const sqlite3_tokenizer_module icuTokenizerModule = { 0, /* iVersion */ icuCreate, /* xCreate */ icuDestroy, /* xCreate */ icuOpen, /* xOpen */ icuClose, /* xClose */ icuNext, /* xNext */ 0, /* xLanguageid */ }; /* ** Set *ppModule to point at the implementation of the ICU tokenizer. */ void sqlite3Fts3IcuTokenizerModule( sqlite3_tokenizer_module const**ppModule ){ *ppModule = &icuTokenizerModule; } #endif /* defined(SQLITE_ENABLE_ICU) */ #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_porter.c ================================================ /* ** 2006 September 30 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Implementation of the full-text-search tokenizer that implements ** a Porter stemmer. */ /* ** The code in this file is only compiled if: ** ** * The FTS3 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS3 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS3 is defined). */ #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) #include #include #include #include #include "fts3_tokenizer.h" /* ** Class derived from sqlite3_tokenizer */ typedef struct porter_tokenizer { sqlite3_tokenizer base; /* Base class */ } porter_tokenizer; /* ** Class derived from sqlite3_tokenizer_cursor */ typedef struct porter_tokenizer_cursor { sqlite3_tokenizer_cursor base; const char *zInput; /* input we are tokenizing */ int nInput; /* size of the input */ int iOffset; /* current position in zInput */ int iToken; /* index of next token to be returned */ char *zToken; /* storage for current token */ int nAllocated; /* space allocated to zToken buffer */ } porter_tokenizer_cursor; /* ** Create a new tokenizer instance. */ static int porterCreate( int argc, const char * const *argv, sqlite3_tokenizer **ppTokenizer ){ porter_tokenizer *t; UNUSED_PARAMETER(argc); UNUSED_PARAMETER(argv); t = (porter_tokenizer *) sqlite3_malloc(sizeof(*t)); if( t==NULL ) return SQLITE_NOMEM; memset(t, 0, sizeof(*t)); *ppTokenizer = &t->base; return SQLITE_OK; } /* ** Destroy a tokenizer */ static int porterDestroy(sqlite3_tokenizer *pTokenizer){ sqlite3_free(pTokenizer); return SQLITE_OK; } /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is zInput[0..nInput-1]. A cursor ** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int porterOpen( sqlite3_tokenizer *pTokenizer, /* The tokenizer */ const char *zInput, int nInput, /* String to be tokenized */ sqlite3_tokenizer_cursor **ppCursor /* OUT: Tokenization cursor */ ){ porter_tokenizer_cursor *c; UNUSED_PARAMETER(pTokenizer); c = (porter_tokenizer_cursor *) sqlite3_malloc(sizeof(*c)); if( c==NULL ) return SQLITE_NOMEM; c->zInput = zInput; if( zInput==0 ){ c->nInput = 0; }else if( nInput<0 ){ c->nInput = (int)strlen(zInput); }else{ c->nInput = nInput; } c->iOffset = 0; /* start tokenizing at the beginning */ c->iToken = 0; c->zToken = NULL; /* no space allocated, yet. */ c->nAllocated = 0; *ppCursor = &c->base; return SQLITE_OK; } /* ** Close a tokenization cursor previously opened by a call to ** porterOpen() above. */ static int porterClose(sqlite3_tokenizer_cursor *pCursor){ porter_tokenizer_cursor *c = (porter_tokenizer_cursor *) pCursor; sqlite3_free(c->zToken); sqlite3_free(c); return SQLITE_OK; } /* ** Vowel or consonant */ static const char cType[] = { 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1 }; /* ** isConsonant() and isVowel() determine if their first character in ** the string they point to is a consonant or a vowel, according ** to Porter ruls. ** ** A consonate is any letter other than 'a', 'e', 'i', 'o', or 'u'. ** 'Y' is a consonant unless it follows another consonant, ** in which case it is a vowel. ** ** In these routine, the letters are in reverse order. So the 'y' rule ** is that 'y' is a consonant unless it is followed by another ** consonent. */ static int isVowel(const char*); static int isConsonant(const char *z){ int j; char x = *z; if( x==0 ) return 0; assert( x>='a' && x<='z' ); j = cType[x-'a']; if( j<2 ) return j; return z[1]==0 || isVowel(z + 1); } static int isVowel(const char *z){ int j; char x = *z; if( x==0 ) return 0; assert( x>='a' && x<='z' ); j = cType[x-'a']; if( j<2 ) return 1-j; return isConsonant(z + 1); } /* ** Let any sequence of one or more vowels be represented by V and let ** C be sequence of one or more consonants. Then every word can be ** represented as: ** ** [C] (VC){m} [V] ** ** In prose: A word is an optional consonant followed by zero or ** vowel-consonant pairs followed by an optional vowel. "m" is the ** number of vowel consonant pairs. This routine computes the value ** of m for the first i bytes of a word. ** ** Return true if the m-value for z is 1 or more. In other words, ** return true if z contains at least one vowel that is followed ** by a consonant. ** ** In this routine z[] is in reverse order. So we are really looking ** for an instance of a consonant followed by a vowel. */ static int m_gt_0(const char *z){ while( isVowel(z) ){ z++; } if( *z==0 ) return 0; while( isConsonant(z) ){ z++; } return *z!=0; } /* Like mgt0 above except we are looking for a value of m which is ** exactly 1 */ static int m_eq_1(const char *z){ while( isVowel(z) ){ z++; } if( *z==0 ) return 0; while( isConsonant(z) ){ z++; } if( *z==0 ) return 0; while( isVowel(z) ){ z++; } if( *z==0 ) return 1; while( isConsonant(z) ){ z++; } return *z==0; } /* Like mgt0 above except we are looking for a value of m>1 instead ** or m>0 */ static int m_gt_1(const char *z){ while( isVowel(z) ){ z++; } if( *z==0 ) return 0; while( isConsonant(z) ){ z++; } if( *z==0 ) return 0; while( isVowel(z) ){ z++; } if( *z==0 ) return 0; while( isConsonant(z) ){ z++; } return *z!=0; } /* ** Return TRUE if there is a vowel anywhere within z[0..n-1] */ static int hasVowel(const char *z){ while( isConsonant(z) ){ z++; } return *z!=0; } /* ** Return TRUE if the word ends in a double consonant. ** ** The text is reversed here. So we are really looking at ** the first two characters of z[]. */ static int doubleConsonant(const char *z){ return isConsonant(z) && z[0]==z[1]; } /* ** Return TRUE if the word ends with three letters which ** are consonant-vowel-consonent and where the final consonant ** is not 'w', 'x', or 'y'. ** ** The word is reversed here. So we are really checking the ** first three letters and the first one cannot be in [wxy]. */ static int star_oh(const char *z){ return isConsonant(z) && z[0]!='w' && z[0]!='x' && z[0]!='y' && isVowel(z+1) && isConsonant(z+2); } /* ** If the word ends with zFrom and xCond() is true for the stem ** of the word that preceeds the zFrom ending, then change the ** ending to zTo. ** ** The input word *pz and zFrom are both in reverse order. zTo ** is in normal order. ** ** Return TRUE if zFrom matches. Return FALSE if zFrom does not ** match. Not that TRUE is returned even if xCond() fails and ** no substitution occurs. */ static int stem( char **pz, /* The word being stemmed (Reversed) */ const char *zFrom, /* If the ending matches this... (Reversed) */ const char *zTo, /* ... change the ending to this (not reversed) */ int (*xCond)(const char*) /* Condition that must be true */ ){ char *z = *pz; while( *zFrom && *zFrom==*z ){ z++; zFrom++; } if( *zFrom!=0 ) return 0; if( xCond && !xCond(z) ) return 1; while( *zTo ){ *(--z) = *(zTo++); } *pz = z; return 1; } /* ** This is the fallback stemmer used when the porter stemmer is ** inappropriate. The input word is copied into the output with ** US-ASCII case folding. If the input word is too long (more ** than 20 bytes if it contains no digits or more than 6 bytes if ** it contains digits) then word is truncated to 20 or 6 bytes ** by taking 10 or 3 bytes from the beginning and end. */ static void copy_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ int i, mx, j; int hasDigit = 0; for(i=0; i='A' && c<='Z' ){ zOut[i] = c - 'A' + 'a'; }else{ if( c>='0' && c<='9' ) hasDigit = 1; zOut[i] = c; } } mx = hasDigit ? 3 : 10; if( nIn>mx*2 ){ for(j=mx, i=nIn-mx; i=(int)sizeof(zReverse)-7 ){ /* The word is too big or too small for the porter stemmer. ** Fallback to the copy stemmer */ copy_stemmer(zIn, nIn, zOut, pnOut); return; } for(i=0, j=sizeof(zReverse)-6; i='A' && c<='Z' ){ zReverse[j] = c + 'a' - 'A'; }else if( c>='a' && c<='z' ){ zReverse[j] = c; }else{ /* The use of a character not in [a-zA-Z] means that we fallback ** to the copy stemmer */ copy_stemmer(zIn, nIn, zOut, pnOut); return; } } memset(&zReverse[sizeof(zReverse)-5], 0, 5); z = &zReverse[j+1]; /* Step 1a */ if( z[0]=='s' ){ if( !stem(&z, "sess", "ss", 0) && !stem(&z, "sei", "i", 0) && !stem(&z, "ss", "ss", 0) ){ z++; } } /* Step 1b */ z2 = z; if( stem(&z, "dee", "ee", m_gt_0) ){ /* Do nothing. The work was all in the test */ }else if( (stem(&z, "gni", "", hasVowel) || stem(&z, "de", "", hasVowel)) && z!=z2 ){ if( stem(&z, "ta", "ate", 0) || stem(&z, "lb", "ble", 0) || stem(&z, "zi", "ize", 0) ){ /* Do nothing. The work was all in the test */ }else if( doubleConsonant(z) && (*z!='l' && *z!='s' && *z!='z') ){ z++; }else if( m_eq_1(z) && star_oh(z) ){ *(--z) = 'e'; } } /* Step 1c */ if( z[0]=='y' && hasVowel(z+1) ){ z[0] = 'i'; } /* Step 2 */ switch( z[1] ){ case 'a': if( !stem(&z, "lanoita", "ate", m_gt_0) ){ stem(&z, "lanoit", "tion", m_gt_0); } break; case 'c': if( !stem(&z, "icne", "ence", m_gt_0) ){ stem(&z, "icna", "ance", m_gt_0); } break; case 'e': stem(&z, "rezi", "ize", m_gt_0); break; case 'g': stem(&z, "igol", "log", m_gt_0); break; case 'l': if( !stem(&z, "ilb", "ble", m_gt_0) && !stem(&z, "illa", "al", m_gt_0) && !stem(&z, "iltne", "ent", m_gt_0) && !stem(&z, "ile", "e", m_gt_0) ){ stem(&z, "ilsuo", "ous", m_gt_0); } break; case 'o': if( !stem(&z, "noitazi", "ize", m_gt_0) && !stem(&z, "noita", "ate", m_gt_0) ){ stem(&z, "rota", "ate", m_gt_0); } break; case 's': if( !stem(&z, "msila", "al", m_gt_0) && !stem(&z, "ssenevi", "ive", m_gt_0) && !stem(&z, "ssenluf", "ful", m_gt_0) ){ stem(&z, "ssensuo", "ous", m_gt_0); } break; case 't': if( !stem(&z, "itila", "al", m_gt_0) && !stem(&z, "itivi", "ive", m_gt_0) ){ stem(&z, "itilib", "ble", m_gt_0); } break; } /* Step 3 */ switch( z[0] ){ case 'e': if( !stem(&z, "etaci", "ic", m_gt_0) && !stem(&z, "evita", "", m_gt_0) ){ stem(&z, "ezila", "al", m_gt_0); } break; case 'i': stem(&z, "itici", "ic", m_gt_0); break; case 'l': if( !stem(&z, "laci", "ic", m_gt_0) ){ stem(&z, "luf", "", m_gt_0); } break; case 's': stem(&z, "ssen", "", m_gt_0); break; } /* Step 4 */ switch( z[1] ){ case 'a': if( z[0]=='l' && m_gt_1(z+2) ){ z += 2; } break; case 'c': if( z[0]=='e' && z[2]=='n' && (z[3]=='a' || z[3]=='e') && m_gt_1(z+4) ){ z += 4; } break; case 'e': if( z[0]=='r' && m_gt_1(z+2) ){ z += 2; } break; case 'i': if( z[0]=='c' && m_gt_1(z+2) ){ z += 2; } break; case 'l': if( z[0]=='e' && z[2]=='b' && (z[3]=='a' || z[3]=='i') && m_gt_1(z+4) ){ z += 4; } break; case 'n': if( z[0]=='t' ){ if( z[2]=='a' ){ if( m_gt_1(z+3) ){ z += 3; } }else if( z[2]=='e' ){ if( !stem(&z, "tneme", "", m_gt_1) && !stem(&z, "tnem", "", m_gt_1) ){ stem(&z, "tne", "", m_gt_1); } } } break; case 'o': if( z[0]=='u' ){ if( m_gt_1(z+2) ){ z += 2; } }else if( z[3]=='s' || z[3]=='t' ){ stem(&z, "noi", "", m_gt_1); } break; case 's': if( z[0]=='m' && z[2]=='i' && m_gt_1(z+3) ){ z += 3; } break; case 't': if( !stem(&z, "eta", "", m_gt_1) ){ stem(&z, "iti", "", m_gt_1); } break; case 'u': if( z[0]=='s' && z[2]=='o' && m_gt_1(z+3) ){ z += 3; } break; case 'v': case 'z': if( z[0]=='e' && z[2]=='i' && m_gt_1(z+3) ){ z += 3; } break; } /* Step 5a */ if( z[0]=='e' ){ if( m_gt_1(z+1) ){ z++; }else if( m_eq_1(z+1) && !star_oh(z+1) ){ z++; } } /* Step 5b */ if( m_gt_1(z) && z[0]=='l' && z[1]=='l' ){ z++; } /* z[] is now the stemmed word in reverse order. Flip it back ** around into forward order and return. */ *pnOut = i = (int)strlen(z); zOut[i] = 0; while( *z ){ zOut[--i] = *(z++); } } /* ** Characters that can be part of a token. We assume any character ** whose value is greater than 0x80 (any UTF character) can be ** part of a token. In other words, delimiters all must have ** values of 0x7f or lower. */ static const char porterIdChar[] = { /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 3x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 7x */ }; #define isDelim(C) (((ch=C)&0x80)==0 && (ch<0x30 || !porterIdChar[ch-0x30])) /* ** Extract the next token from a tokenization cursor. The cursor must ** have been opened by a prior call to porterOpen(). */ static int porterNext( sqlite3_tokenizer_cursor *pCursor, /* Cursor returned by porterOpen */ const char **pzToken, /* OUT: *pzToken is the token text */ int *pnBytes, /* OUT: Number of bytes in token */ int *piStartOffset, /* OUT: Starting offset of token */ int *piEndOffset, /* OUT: Ending offset of token */ int *piPosition /* OUT: Position integer of token */ ){ porter_tokenizer_cursor *c = (porter_tokenizer_cursor *) pCursor; const char *z = c->zInput; while( c->iOffsetnInput ){ int iStartOffset, ch; /* Scan past delimiter characters */ while( c->iOffsetnInput && isDelim(z[c->iOffset]) ){ c->iOffset++; } /* Count non-delimiter characters. */ iStartOffset = c->iOffset; while( c->iOffsetnInput && !isDelim(z[c->iOffset]) ){ c->iOffset++; } if( c->iOffset>iStartOffset ){ int n = c->iOffset-iStartOffset; if( n>c->nAllocated ){ char *pNew; c->nAllocated = n+20; pNew = sqlite3_realloc(c->zToken, c->nAllocated); if( !pNew ) return SQLITE_NOMEM; c->zToken = pNew; } porter_stemmer(&z[iStartOffset], n, c->zToken, pnBytes); *pzToken = c->zToken; *piStartOffset = iStartOffset; *piEndOffset = c->iOffset; *piPosition = c->iToken++; return SQLITE_OK; } } return SQLITE_DONE; } /* ** The set of routines that implement the porter-stemmer tokenizer */ static const sqlite3_tokenizer_module porterTokenizerModule = { 0, porterCreate, porterDestroy, porterOpen, porterClose, porterNext, 0 }; /* ** Allocate a new porter tokenizer. Return a pointer to the new ** tokenizer in *ppModule */ void sqlite3Fts3PorterTokenizerModule( sqlite3_tokenizer_module const**ppModule ){ *ppModule = &porterTokenizerModule; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_snippet.c ================================================ /* ** 2009 Oct 23 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** */ #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) #include #include /* ** Characters that may appear in the second argument to matchinfo(). */ #define FTS3_MATCHINFO_NPHRASE 'p' /* 1 value */ #define FTS3_MATCHINFO_NCOL 'c' /* 1 value */ #define FTS3_MATCHINFO_NDOC 'n' /* 1 value */ #define FTS3_MATCHINFO_AVGLENGTH 'a' /* nCol values */ #define FTS3_MATCHINFO_LENGTH 'l' /* nCol values */ #define FTS3_MATCHINFO_LCS 's' /* nCol values */ #define FTS3_MATCHINFO_HITS 'x' /* 3*nCol*nPhrase values */ #define FTS3_MATCHINFO_LHITS 'y' /* nCol*nPhrase values */ #define FTS3_MATCHINFO_LHITS_BM 'b' /* nCol*nPhrase values */ /* ** The default value for the second argument to matchinfo(). */ #define FTS3_MATCHINFO_DEFAULT "pcx" /* ** Used as an fts3ExprIterate() context when loading phrase doclists to ** Fts3Expr.aDoclist[]/nDoclist. */ typedef struct LoadDoclistCtx LoadDoclistCtx; struct LoadDoclistCtx { Fts3Cursor *pCsr; /* FTS3 Cursor */ int nPhrase; /* Number of phrases seen so far */ int nToken; /* Number of tokens seen so far */ }; /* ** The following types are used as part of the implementation of the ** fts3BestSnippet() routine. */ typedef struct SnippetIter SnippetIter; typedef struct SnippetPhrase SnippetPhrase; typedef struct SnippetFragment SnippetFragment; struct SnippetIter { Fts3Cursor *pCsr; /* Cursor snippet is being generated from */ int iCol; /* Extract snippet from this column */ int nSnippet; /* Requested snippet length (in tokens) */ int nPhrase; /* Number of phrases in query */ SnippetPhrase *aPhrase; /* Array of size nPhrase */ int iCurrent; /* First token of current snippet */ }; struct SnippetPhrase { int nToken; /* Number of tokens in phrase */ char *pList; /* Pointer to start of phrase position list */ int iHead; /* Next value in position list */ char *pHead; /* Position list data following iHead */ int iTail; /* Next value in trailing position list */ char *pTail; /* Position list data following iTail */ }; struct SnippetFragment { int iCol; /* Column snippet is extracted from */ int iPos; /* Index of first token in snippet */ u64 covered; /* Mask of query phrases covered */ u64 hlmask; /* Mask of snippet terms to highlight */ }; /* ** This type is used as an fts3ExprIterate() context object while ** accumulating the data returned by the matchinfo() function. */ typedef struct MatchInfo MatchInfo; struct MatchInfo { Fts3Cursor *pCursor; /* FTS3 Cursor */ int nCol; /* Number of columns in table */ int nPhrase; /* Number of matchable phrases in query */ sqlite3_int64 nDoc; /* Number of docs in database */ char flag; u32 *aMatchinfo; /* Pre-allocated buffer */ }; /* ** An instance of this structure is used to manage a pair of buffers, each ** (nElem * sizeof(u32)) bytes in size. See the MatchinfoBuffer code below ** for details. */ struct MatchinfoBuffer { u8 aRef[3]; int nElem; int bGlobal; /* Set if global data is loaded */ char *zMatchinfo; u32 aMatchinfo[1]; }; /* ** The snippet() and offsets() functions both return text values. An instance ** of the following structure is used to accumulate those values while the ** functions are running. See fts3StringAppend() for details. */ typedef struct StrBuffer StrBuffer; struct StrBuffer { char *z; /* Pointer to buffer containing string */ int n; /* Length of z in bytes (excl. nul-term) */ int nAlloc; /* Allocated size of buffer z in bytes */ }; /************************************************************************* ** Start of MatchinfoBuffer code. */ /* ** Allocate a two-slot MatchinfoBuffer object. */ static MatchinfoBuffer *fts3MIBufferNew(int nElem, const char *zMatchinfo){ MatchinfoBuffer *pRet; int nByte = sizeof(u32) * (2*nElem + 1) + sizeof(MatchinfoBuffer); int nStr = (int)strlen(zMatchinfo); pRet = sqlite3_malloc(nByte + nStr+1); if( pRet ){ memset(pRet, 0, nByte); pRet->aMatchinfo[0] = (u8*)(&pRet->aMatchinfo[1]) - (u8*)pRet; pRet->aMatchinfo[1+nElem] = pRet->aMatchinfo[0] + sizeof(u32)*(nElem+1); pRet->nElem = nElem; pRet->zMatchinfo = ((char*)pRet) + nByte; memcpy(pRet->zMatchinfo, zMatchinfo, nStr+1); pRet->aRef[0] = 1; } return pRet; } static void fts3MIBufferFree(void *p){ MatchinfoBuffer *pBuf = (MatchinfoBuffer*)((u8*)p - ((u32*)p)[-1]); assert( (u32*)p==&pBuf->aMatchinfo[1] || (u32*)p==&pBuf->aMatchinfo[pBuf->nElem+2] ); if( (u32*)p==&pBuf->aMatchinfo[1] ){ pBuf->aRef[1] = 0; }else{ pBuf->aRef[2] = 0; } if( pBuf->aRef[0]==0 && pBuf->aRef[1]==0 && pBuf->aRef[2]==0 ){ sqlite3_free(pBuf); } } static void (*fts3MIBufferAlloc(MatchinfoBuffer *p, u32 **paOut))(void*){ void (*xRet)(void*) = 0; u32 *aOut = 0; if( p->aRef[1]==0 ){ p->aRef[1] = 1; aOut = &p->aMatchinfo[1]; xRet = fts3MIBufferFree; } else if( p->aRef[2]==0 ){ p->aRef[2] = 1; aOut = &p->aMatchinfo[p->nElem+2]; xRet = fts3MIBufferFree; }else{ aOut = (u32*)sqlite3_malloc(p->nElem * sizeof(u32)); if( aOut ){ xRet = sqlite3_free; if( p->bGlobal ) memcpy(aOut, &p->aMatchinfo[1], p->nElem*sizeof(u32)); } } *paOut = aOut; return xRet; } static void fts3MIBufferSetGlobal(MatchinfoBuffer *p){ p->bGlobal = 1; memcpy(&p->aMatchinfo[2+p->nElem], &p->aMatchinfo[1], p->nElem*sizeof(u32)); } /* ** Free a MatchinfoBuffer object allocated using fts3MIBufferNew() */ void sqlite3Fts3MIBufferFree(MatchinfoBuffer *p){ if( p ){ assert( p->aRef[0]==1 ); p->aRef[0] = 0; if( p->aRef[0]==0 && p->aRef[1]==0 && p->aRef[2]==0 ){ sqlite3_free(p); } } } /* ** End of MatchinfoBuffer code. *************************************************************************/ /* ** This function is used to help iterate through a position-list. A position ** list is a list of unique integers, sorted from smallest to largest. Each ** element of the list is represented by an FTS3 varint that takes the value ** of the difference between the current element and the previous one plus ** two. For example, to store the position-list: ** ** 4 9 113 ** ** the three varints: ** ** 6 7 106 ** ** are encoded. ** ** When this function is called, *pp points to the start of an element of ** the list. *piPos contains the value of the previous entry in the list. ** After it returns, *piPos contains the value of the next element of the ** list and *pp is advanced to the following varint. */ static void fts3GetDeltaPosition(char **pp, int *piPos){ int iVal; *pp += fts3GetVarint32(*pp, &iVal); *piPos += (iVal-2); } /* ** Helper function for fts3ExprIterate() (see below). */ static int fts3ExprIterate2( Fts3Expr *pExpr, /* Expression to iterate phrases of */ int *piPhrase, /* Pointer to phrase counter */ int (*x)(Fts3Expr*,int,void*), /* Callback function to invoke for phrases */ void *pCtx /* Second argument to pass to callback */ ){ int rc; /* Return code */ int eType = pExpr->eType; /* Type of expression node pExpr */ if( eType!=FTSQUERY_PHRASE ){ assert( pExpr->pLeft && pExpr->pRight ); rc = fts3ExprIterate2(pExpr->pLeft, piPhrase, x, pCtx); if( rc==SQLITE_OK && eType!=FTSQUERY_NOT ){ rc = fts3ExprIterate2(pExpr->pRight, piPhrase, x, pCtx); } }else{ rc = x(pExpr, *piPhrase, pCtx); (*piPhrase)++; } return rc; } /* ** Iterate through all phrase nodes in an FTS3 query, except those that ** are part of a sub-tree that is the right-hand-side of a NOT operator. ** For each phrase node found, the supplied callback function is invoked. ** ** If the callback function returns anything other than SQLITE_OK, ** the iteration is abandoned and the error code returned immediately. ** Otherwise, SQLITE_OK is returned after a callback has been made for ** all eligible phrase nodes. */ static int fts3ExprIterate( Fts3Expr *pExpr, /* Expression to iterate phrases of */ int (*x)(Fts3Expr*,int,void*), /* Callback function to invoke for phrases */ void *pCtx /* Second argument to pass to callback */ ){ int iPhrase = 0; /* Variable used as the phrase counter */ return fts3ExprIterate2(pExpr, &iPhrase, x, pCtx); } /* ** This is an fts3ExprIterate() callback used while loading the doclists ** for each phrase into Fts3Expr.aDoclist[]/nDoclist. See also ** fts3ExprLoadDoclists(). */ static int fts3ExprLoadDoclistsCb(Fts3Expr *pExpr, int iPhrase, void *ctx){ int rc = SQLITE_OK; Fts3Phrase *pPhrase = pExpr->pPhrase; LoadDoclistCtx *p = (LoadDoclistCtx *)ctx; UNUSED_PARAMETER(iPhrase); p->nPhrase++; p->nToken += pPhrase->nToken; return rc; } /* ** Load the doclists for each phrase in the query associated with FTS3 cursor ** pCsr. ** ** If pnPhrase is not NULL, then *pnPhrase is set to the number of matchable ** phrases in the expression (all phrases except those directly or ** indirectly descended from the right-hand-side of a NOT operator). If ** pnToken is not NULL, then it is set to the number of tokens in all ** matchable phrases of the expression. */ static int fts3ExprLoadDoclists( Fts3Cursor *pCsr, /* Fts3 cursor for current query */ int *pnPhrase, /* OUT: Number of phrases in query */ int *pnToken /* OUT: Number of tokens in query */ ){ int rc; /* Return Code */ LoadDoclistCtx sCtx = {0,0,0}; /* Context for fts3ExprIterate() */ sCtx.pCsr = pCsr; rc = fts3ExprIterate(pCsr->pExpr, fts3ExprLoadDoclistsCb, (void *)&sCtx); if( pnPhrase ) *pnPhrase = sCtx.nPhrase; if( pnToken ) *pnToken = sCtx.nToken; return rc; } static int fts3ExprPhraseCountCb(Fts3Expr *pExpr, int iPhrase, void *ctx){ (*(int *)ctx)++; pExpr->iPhrase = iPhrase; return SQLITE_OK; } static int fts3ExprPhraseCount(Fts3Expr *pExpr){ int nPhrase = 0; (void)fts3ExprIterate(pExpr, fts3ExprPhraseCountCb, (void *)&nPhrase); return nPhrase; } /* ** Advance the position list iterator specified by the first two ** arguments so that it points to the first element with a value greater ** than or equal to parameter iNext. */ static void fts3SnippetAdvance(char **ppIter, int *piIter, int iNext){ char *pIter = *ppIter; if( pIter ){ int iIter = *piIter; while( iIteriCurrent<0 ){ /* The SnippetIter object has just been initialized. The first snippet ** candidate always starts at offset 0 (even if this candidate has a ** score of 0.0). */ pIter->iCurrent = 0; /* Advance the 'head' iterator of each phrase to the first offset that ** is greater than or equal to (iNext+nSnippet). */ for(i=0; inPhrase; i++){ SnippetPhrase *pPhrase = &pIter->aPhrase[i]; fts3SnippetAdvance(&pPhrase->pHead, &pPhrase->iHead, pIter->nSnippet); } }else{ int iStart; int iEnd = 0x7FFFFFFF; for(i=0; inPhrase; i++){ SnippetPhrase *pPhrase = &pIter->aPhrase[i]; if( pPhrase->pHead && pPhrase->iHeadiHead; } } if( iEnd==0x7FFFFFFF ){ return 1; } pIter->iCurrent = iStart = iEnd - pIter->nSnippet + 1; for(i=0; inPhrase; i++){ SnippetPhrase *pPhrase = &pIter->aPhrase[i]; fts3SnippetAdvance(&pPhrase->pHead, &pPhrase->iHead, iEnd+1); fts3SnippetAdvance(&pPhrase->pTail, &pPhrase->iTail, iStart); } } return 0; } /* ** Retrieve information about the current candidate snippet of snippet ** iterator pIter. */ static void fts3SnippetDetails( SnippetIter *pIter, /* Snippet iterator */ u64 mCovered, /* Bitmask of phrases already covered */ int *piToken, /* OUT: First token of proposed snippet */ int *piScore, /* OUT: "Score" for this snippet */ u64 *pmCover, /* OUT: Bitmask of phrases covered */ u64 *pmHighlight /* OUT: Bitmask of terms to highlight */ ){ int iStart = pIter->iCurrent; /* First token of snippet */ int iScore = 0; /* Score of this snippet */ int i; /* Loop counter */ u64 mCover = 0; /* Mask of phrases covered by this snippet */ u64 mHighlight = 0; /* Mask of tokens to highlight in snippet */ for(i=0; inPhrase; i++){ SnippetPhrase *pPhrase = &pIter->aPhrase[i]; if( pPhrase->pTail ){ char *pCsr = pPhrase->pTail; int iCsr = pPhrase->iTail; while( iCsr<(iStart+pIter->nSnippet) ){ int j; u64 mPhrase = (u64)1 << i; u64 mPos = (u64)1 << (iCsr - iStart); assert( iCsr>=iStart ); if( (mCover|mCovered)&mPhrase ){ iScore++; }else{ iScore += 1000; } mCover |= mPhrase; for(j=0; jnToken; j++){ mHighlight |= (mPos>>j); } if( 0==(*pCsr & 0x0FE) ) break; fts3GetDeltaPosition(&pCsr, &iCsr); } } } /* Set the output variables before returning. */ *piToken = iStart; *piScore = iScore; *pmCover = mCover; *pmHighlight = mHighlight; } /* ** This function is an fts3ExprIterate() callback used by fts3BestSnippet(). ** Each invocation populates an element of the SnippetIter.aPhrase[] array. */ static int fts3SnippetFindPositions(Fts3Expr *pExpr, int iPhrase, void *ctx){ SnippetIter *p = (SnippetIter *)ctx; SnippetPhrase *pPhrase = &p->aPhrase[iPhrase]; char *pCsr; int rc; pPhrase->nToken = pExpr->pPhrase->nToken; rc = sqlite3Fts3EvalPhrasePoslist(p->pCsr, pExpr, p->iCol, &pCsr); assert( rc==SQLITE_OK || pCsr==0 ); if( pCsr ){ int iFirst = 0; pPhrase->pList = pCsr; fts3GetDeltaPosition(&pCsr, &iFirst); assert( iFirst>=0 ); pPhrase->pHead = pCsr; pPhrase->pTail = pCsr; pPhrase->iHead = iFirst; pPhrase->iTail = iFirst; }else{ assert( rc!=SQLITE_OK || ( pPhrase->pList==0 && pPhrase->pHead==0 && pPhrase->pTail==0 )); } return rc; } /* ** Select the fragment of text consisting of nFragment contiguous tokens ** from column iCol that represent the "best" snippet. The best snippet ** is the snippet with the highest score, where scores are calculated ** by adding: ** ** (a) +1 point for each occurrence of a matchable phrase in the snippet. ** ** (b) +1000 points for the first occurrence of each matchable phrase in ** the snippet for which the corresponding mCovered bit is not set. ** ** The selected snippet parameters are stored in structure *pFragment before ** returning. The score of the selected snippet is stored in *piScore ** before returning. */ static int fts3BestSnippet( int nSnippet, /* Desired snippet length */ Fts3Cursor *pCsr, /* Cursor to create snippet for */ int iCol, /* Index of column to create snippet from */ u64 mCovered, /* Mask of phrases already covered */ u64 *pmSeen, /* IN/OUT: Mask of phrases seen */ SnippetFragment *pFragment, /* OUT: Best snippet found */ int *piScore /* OUT: Score of snippet pFragment */ ){ int rc; /* Return Code */ int nList; /* Number of phrases in expression */ SnippetIter sIter; /* Iterates through snippet candidates */ int nByte; /* Number of bytes of space to allocate */ int iBestScore = -1; /* Best snippet score found so far */ int i; /* Loop counter */ memset(&sIter, 0, sizeof(sIter)); /* Iterate through the phrases in the expression to count them. The same ** callback makes sure the doclists are loaded for each phrase. */ rc = fts3ExprLoadDoclists(pCsr, &nList, 0); if( rc!=SQLITE_OK ){ return rc; } /* Now that it is known how many phrases there are, allocate and zero ** the required space using malloc(). */ nByte = sizeof(SnippetPhrase) * nList; sIter.aPhrase = (SnippetPhrase *)sqlite3_malloc(nByte); if( !sIter.aPhrase ){ return SQLITE_NOMEM; } memset(sIter.aPhrase, 0, nByte); /* Initialize the contents of the SnippetIter object. Then iterate through ** the set of phrases in the expression to populate the aPhrase[] array. */ sIter.pCsr = pCsr; sIter.iCol = iCol; sIter.nSnippet = nSnippet; sIter.nPhrase = nList; sIter.iCurrent = -1; rc = fts3ExprIterate(pCsr->pExpr, fts3SnippetFindPositions, (void*)&sIter); if( rc==SQLITE_OK ){ /* Set the *pmSeen output variable. */ for(i=0; iiCol = iCol; while( !fts3SnippetNextCandidate(&sIter) ){ int iPos; int iScore; u64 mCover; u64 mHighlite; fts3SnippetDetails(&sIter, mCovered, &iPos, &iScore, &mCover,&mHighlite); assert( iScore>=0 ); if( iScore>iBestScore ){ pFragment->iPos = iPos; pFragment->hlmask = mHighlite; pFragment->covered = mCover; iBestScore = iScore; } } *piScore = iBestScore; } sqlite3_free(sIter.aPhrase); return rc; } /* ** Append a string to the string-buffer passed as the first argument. ** ** If nAppend is negative, then the length of the string zAppend is ** determined using strlen(). */ static int fts3StringAppend( StrBuffer *pStr, /* Buffer to append to */ const char *zAppend, /* Pointer to data to append to buffer */ int nAppend /* Size of zAppend in bytes (or -1) */ ){ if( nAppend<0 ){ nAppend = (int)strlen(zAppend); } /* If there is insufficient space allocated at StrBuffer.z, use realloc() ** to grow the buffer until so that it is big enough to accomadate the ** appended data. */ if( pStr->n+nAppend+1>=pStr->nAlloc ){ int nAlloc = pStr->nAlloc+nAppend+100; char *zNew = sqlite3_realloc(pStr->z, nAlloc); if( !zNew ){ return SQLITE_NOMEM; } pStr->z = zNew; pStr->nAlloc = nAlloc; } assert( pStr->z!=0 && (pStr->nAlloc >= pStr->n+nAppend+1) ); /* Append the data to the string buffer. */ memcpy(&pStr->z[pStr->n], zAppend, nAppend); pStr->n += nAppend; pStr->z[pStr->n] = '\0'; return SQLITE_OK; } /* ** The fts3BestSnippet() function often selects snippets that end with a ** query term. That is, the final term of the snippet is always a term ** that requires highlighting. For example, if 'X' is a highlighted term ** and '.' is a non-highlighted term, BestSnippet() may select: ** ** ........X.....X ** ** This function "shifts" the beginning of the snippet forward in the ** document so that there are approximately the same number of ** non-highlighted terms to the right of the final highlighted term as there ** are to the left of the first highlighted term. For example, to this: ** ** ....X.....X.... ** ** This is done as part of extracting the snippet text, not when selecting ** the snippet. Snippet selection is done based on doclists only, so there ** is no way for fts3BestSnippet() to know whether or not the document ** actually contains terms that follow the final highlighted term. */ static int fts3SnippetShift( Fts3Table *pTab, /* FTS3 table snippet comes from */ int iLangid, /* Language id to use in tokenizing */ int nSnippet, /* Number of tokens desired for snippet */ const char *zDoc, /* Document text to extract snippet from */ int nDoc, /* Size of buffer zDoc in bytes */ int *piPos, /* IN/OUT: First token of snippet */ u64 *pHlmask /* IN/OUT: Mask of tokens to highlight */ ){ u64 hlmask = *pHlmask; /* Local copy of initial highlight-mask */ if( hlmask ){ int nLeft; /* Tokens to the left of first highlight */ int nRight; /* Tokens to the right of last highlight */ int nDesired; /* Ideal number of tokens to shift forward */ for(nLeft=0; !(hlmask & ((u64)1 << nLeft)); nLeft++); for(nRight=0; !(hlmask & ((u64)1 << (nSnippet-1-nRight))); nRight++); nDesired = (nLeft-nRight)/2; /* Ideally, the start of the snippet should be pushed forward in the ** document nDesired tokens. This block checks if there are actually ** nDesired tokens to the right of the snippet. If so, *piPos and ** *pHlMask are updated to shift the snippet nDesired tokens to the ** right. Otherwise, the snippet is shifted by the number of tokens ** available. */ if( nDesired>0 ){ int nShift; /* Number of tokens to shift snippet by */ int iCurrent = 0; /* Token counter */ int rc; /* Return Code */ sqlite3_tokenizer_module *pMod; sqlite3_tokenizer_cursor *pC; pMod = (sqlite3_tokenizer_module *)pTab->pTokenizer->pModule; /* Open a cursor on zDoc/nDoc. Check if there are (nSnippet+nDesired) ** or more tokens in zDoc/nDoc. */ rc = sqlite3Fts3OpenTokenizer(pTab->pTokenizer, iLangid, zDoc, nDoc, &pC); if( rc!=SQLITE_OK ){ return rc; } while( rc==SQLITE_OK && iCurrent<(nSnippet+nDesired) ){ const char *ZDUMMY; int DUMMY1 = 0, DUMMY2 = 0, DUMMY3 = 0; rc = pMod->xNext(pC, &ZDUMMY, &DUMMY1, &DUMMY2, &DUMMY3, &iCurrent); } pMod->xClose(pC); if( rc!=SQLITE_OK && rc!=SQLITE_DONE ){ return rc; } nShift = (rc==SQLITE_DONE)+iCurrent-nSnippet; assert( nShift<=nDesired ); if( nShift>0 ){ *piPos += nShift; *pHlmask = hlmask >> nShift; } } } return SQLITE_OK; } /* ** Extract the snippet text for fragment pFragment from cursor pCsr and ** append it to string buffer pOut. */ static int fts3SnippetText( Fts3Cursor *pCsr, /* FTS3 Cursor */ SnippetFragment *pFragment, /* Snippet to extract */ int iFragment, /* Fragment number */ int isLast, /* True for final fragment in snippet */ int nSnippet, /* Number of tokens in extracted snippet */ const char *zOpen, /* String inserted before highlighted term */ const char *zClose, /* String inserted after highlighted term */ const char *zEllipsis, /* String inserted between snippets */ StrBuffer *pOut /* Write output here */ ){ Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; int rc; /* Return code */ const char *zDoc; /* Document text to extract snippet from */ int nDoc; /* Size of zDoc in bytes */ int iCurrent = 0; /* Current token number of document */ int iEnd = 0; /* Byte offset of end of current token */ int isShiftDone = 0; /* True after snippet is shifted */ int iPos = pFragment->iPos; /* First token of snippet */ u64 hlmask = pFragment->hlmask; /* Highlight-mask for snippet */ int iCol = pFragment->iCol+1; /* Query column to extract text from */ sqlite3_tokenizer_module *pMod; /* Tokenizer module methods object */ sqlite3_tokenizer_cursor *pC; /* Tokenizer cursor open on zDoc/nDoc */ zDoc = (const char *)sqlite3_column_text(pCsr->pStmt, iCol); if( zDoc==0 ){ if( sqlite3_column_type(pCsr->pStmt, iCol)!=SQLITE_NULL ){ return SQLITE_NOMEM; } return SQLITE_OK; } nDoc = sqlite3_column_bytes(pCsr->pStmt, iCol); /* Open a token cursor on the document. */ pMod = (sqlite3_tokenizer_module *)pTab->pTokenizer->pModule; rc = sqlite3Fts3OpenTokenizer(pTab->pTokenizer, pCsr->iLangid, zDoc,nDoc,&pC); if( rc!=SQLITE_OK ){ return rc; } while( rc==SQLITE_OK ){ const char *ZDUMMY; /* Dummy argument used with tokenizer */ int DUMMY1 = -1; /* Dummy argument used with tokenizer */ int iBegin = 0; /* Offset in zDoc of start of token */ int iFin = 0; /* Offset in zDoc of end of token */ int isHighlight = 0; /* True for highlighted terms */ /* Variable DUMMY1 is initialized to a negative value above. Elsewhere ** in the FTS code the variable that the third argument to xNext points to ** is initialized to zero before the first (*but not necessarily ** subsequent*) call to xNext(). This is done for a particular application ** that needs to know whether or not the tokenizer is being used for ** snippet generation or for some other purpose. ** ** Extreme care is required when writing code to depend on this ** initialization. It is not a documented part of the tokenizer interface. ** If a tokenizer is used directly by any code outside of FTS, this ** convention might not be respected. */ rc = pMod->xNext(pC, &ZDUMMY, &DUMMY1, &iBegin, &iFin, &iCurrent); if( rc!=SQLITE_OK ){ if( rc==SQLITE_DONE ){ /* Special case - the last token of the snippet is also the last token ** of the column. Append any punctuation that occurred between the end ** of the previous token and the end of the document to the output. ** Then break out of the loop. */ rc = fts3StringAppend(pOut, &zDoc[iEnd], -1); } break; } if( iCurrentiLangid, nSnippet, &zDoc[iBegin], n, &iPos, &hlmask ); isShiftDone = 1; /* Now that the shift has been done, check if the initial "..." are ** required. They are required if (a) this is not the first fragment, ** or (b) this fragment does not begin at position 0 of its column. */ if( rc==SQLITE_OK ){ if( iPos>0 || iFragment>0 ){ rc = fts3StringAppend(pOut, zEllipsis, -1); }else if( iBegin ){ rc = fts3StringAppend(pOut, zDoc, iBegin); } } if( rc!=SQLITE_OK || iCurrent=(iPos+nSnippet) ){ if( isLast ){ rc = fts3StringAppend(pOut, zEllipsis, -1); } break; } /* Set isHighlight to true if this term should be highlighted. */ isHighlight = (hlmask & ((u64)1 << (iCurrent-iPos)))!=0; if( iCurrent>iPos ) rc = fts3StringAppend(pOut, &zDoc[iEnd], iBegin-iEnd); if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zOpen, -1); if( rc==SQLITE_OK ) rc = fts3StringAppend(pOut, &zDoc[iBegin], iFin-iBegin); if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zClose, -1); iEnd = iFin; } pMod->xClose(pC); return rc; } /* ** This function is used to count the entries in a column-list (a ** delta-encoded list of term offsets within a single column of a single ** row). When this function is called, *ppCollist should point to the ** beginning of the first varint in the column-list (the varint that ** contains the position of the first matching term in the column data). ** Before returning, *ppCollist is set to point to the first byte after ** the last varint in the column-list (either the 0x00 signifying the end ** of the position-list, or the 0x01 that precedes the column number of ** the next column in the position-list). ** ** The number of elements in the column-list is returned. */ static int fts3ColumnlistCount(char **ppCollist){ char *pEnd = *ppCollist; char c = 0; int nEntry = 0; /* A column-list is terminated by either a 0x01 or 0x00. */ while( 0xFE & (*pEnd | c) ){ c = *pEnd++ & 0x80; if( !c ) nEntry++; } *ppCollist = pEnd; return nEntry; } /* ** This function gathers 'y' or 'b' data for a single phrase. */ static void fts3ExprLHits( Fts3Expr *pExpr, /* Phrase expression node */ MatchInfo *p /* Matchinfo context */ ){ Fts3Table *pTab = (Fts3Table *)p->pCursor->base.pVtab; int iStart; Fts3Phrase *pPhrase = pExpr->pPhrase; char *pIter = pPhrase->doclist.pList; int iCol = 0; assert( p->flag==FTS3_MATCHINFO_LHITS_BM || p->flag==FTS3_MATCHINFO_LHITS ); if( p->flag==FTS3_MATCHINFO_LHITS ){ iStart = pExpr->iPhrase * p->nCol; }else{ iStart = pExpr->iPhrase * ((p->nCol + 31) / 32); } while( 1 ){ int nHit = fts3ColumnlistCount(&pIter); if( (pPhrase->iColumn>=pTab->nColumn || pPhrase->iColumn==iCol) ){ if( p->flag==FTS3_MATCHINFO_LHITS ){ p->aMatchinfo[iStart + iCol] = (u32)nHit; }else if( nHit ){ p->aMatchinfo[iStart + (iCol+1)/32] |= (1 << (iCol&0x1F)); } } assert( *pIter==0x00 || *pIter==0x01 ); if( *pIter!=0x01 ) break; pIter++; pIter += fts3GetVarint32(pIter, &iCol); } } /* ** Gather the results for matchinfo directives 'y' and 'b'. */ static void fts3ExprLHitGather( Fts3Expr *pExpr, MatchInfo *p ){ assert( (pExpr->pLeft==0)==(pExpr->pRight==0) ); if( pExpr->bEof==0 && pExpr->iDocid==p->pCursor->iPrevId ){ if( pExpr->pLeft ){ fts3ExprLHitGather(pExpr->pLeft, p); fts3ExprLHitGather(pExpr->pRight, p); }else{ fts3ExprLHits(pExpr, p); } } } /* ** fts3ExprIterate() callback used to collect the "global" matchinfo stats ** for a single query. ** ** fts3ExprIterate() callback to load the 'global' elements of a ** FTS3_MATCHINFO_HITS matchinfo array. The global stats are those elements ** of the matchinfo array that are constant for all rows returned by the ** current query. ** ** Argument pCtx is actually a pointer to a struct of type MatchInfo. This ** function populates Matchinfo.aMatchinfo[] as follows: ** ** for(iCol=0; iColpCursor, pExpr, &p->aMatchinfo[3*iPhrase*p->nCol] ); } /* ** fts3ExprIterate() callback used to collect the "local" part of the ** FTS3_MATCHINFO_HITS array. The local stats are those elements of the ** array that are different for each row returned by the query. */ static int fts3ExprLocalHitsCb( Fts3Expr *pExpr, /* Phrase expression node */ int iPhrase, /* Phrase number */ void *pCtx /* Pointer to MatchInfo structure */ ){ int rc = SQLITE_OK; MatchInfo *p = (MatchInfo *)pCtx; int iStart = iPhrase * p->nCol * 3; int i; for(i=0; inCol && rc==SQLITE_OK; i++){ char *pCsr; rc = sqlite3Fts3EvalPhrasePoslist(p->pCursor, pExpr, i, &pCsr); if( pCsr ){ p->aMatchinfo[iStart+i*3] = fts3ColumnlistCount(&pCsr); }else{ p->aMatchinfo[iStart+i*3] = 0; } } return rc; } static int fts3MatchinfoCheck( Fts3Table *pTab, char cArg, char **pzErr ){ if( (cArg==FTS3_MATCHINFO_NPHRASE) || (cArg==FTS3_MATCHINFO_NCOL) || (cArg==FTS3_MATCHINFO_NDOC && pTab->bFts4) || (cArg==FTS3_MATCHINFO_AVGLENGTH && pTab->bFts4) || (cArg==FTS3_MATCHINFO_LENGTH && pTab->bHasDocsize) || (cArg==FTS3_MATCHINFO_LCS) || (cArg==FTS3_MATCHINFO_HITS) || (cArg==FTS3_MATCHINFO_LHITS) || (cArg==FTS3_MATCHINFO_LHITS_BM) ){ return SQLITE_OK; } sqlite3Fts3ErrMsg(pzErr, "unrecognized matchinfo request: %c", cArg); return SQLITE_ERROR; } static int fts3MatchinfoSize(MatchInfo *pInfo, char cArg){ int nVal; /* Number of integers output by cArg */ switch( cArg ){ case FTS3_MATCHINFO_NDOC: case FTS3_MATCHINFO_NPHRASE: case FTS3_MATCHINFO_NCOL: nVal = 1; break; case FTS3_MATCHINFO_AVGLENGTH: case FTS3_MATCHINFO_LENGTH: case FTS3_MATCHINFO_LCS: nVal = pInfo->nCol; break; case FTS3_MATCHINFO_LHITS: nVal = pInfo->nCol * pInfo->nPhrase; break; case FTS3_MATCHINFO_LHITS_BM: nVal = pInfo->nPhrase * ((pInfo->nCol + 31) / 32); break; default: assert( cArg==FTS3_MATCHINFO_HITS ); nVal = pInfo->nCol * pInfo->nPhrase * 3; break; } return nVal; } static int fts3MatchinfoSelectDoctotal( Fts3Table *pTab, sqlite3_stmt **ppStmt, sqlite3_int64 *pnDoc, const char **paLen ){ sqlite3_stmt *pStmt; const char *a; sqlite3_int64 nDoc; if( !*ppStmt ){ int rc = sqlite3Fts3SelectDoctotal(pTab, ppStmt); if( rc!=SQLITE_OK ) return rc; } pStmt = *ppStmt; assert( sqlite3_data_count(pStmt)==1 ); a = sqlite3_column_blob(pStmt, 0); a += sqlite3Fts3GetVarint(a, &nDoc); if( nDoc==0 ) return FTS_CORRUPT_VTAB; *pnDoc = (u32)nDoc; if( paLen ) *paLen = a; return SQLITE_OK; } /* ** An instance of the following structure is used to store state while ** iterating through a multi-column position-list corresponding to the ** hits for a single phrase on a single row in order to calculate the ** values for a matchinfo() FTS3_MATCHINFO_LCS request. */ typedef struct LcsIterator LcsIterator; struct LcsIterator { Fts3Expr *pExpr; /* Pointer to phrase expression */ int iPosOffset; /* Tokens count up to end of this phrase */ char *pRead; /* Cursor used to iterate through aDoclist */ int iPos; /* Current position */ }; /* ** If LcsIterator.iCol is set to the following value, the iterator has ** finished iterating through all offsets for all columns. */ #define LCS_ITERATOR_FINISHED 0x7FFFFFFF; static int fts3MatchinfoLcsCb( Fts3Expr *pExpr, /* Phrase expression node */ int iPhrase, /* Phrase number (numbered from zero) */ void *pCtx /* Pointer to MatchInfo structure */ ){ LcsIterator *aIter = (LcsIterator *)pCtx; aIter[iPhrase].pExpr = pExpr; return SQLITE_OK; } /* ** Advance the iterator passed as an argument to the next position. Return ** 1 if the iterator is at EOF or if it now points to the start of the ** position list for the next column. */ static int fts3LcsIteratorAdvance(LcsIterator *pIter){ char *pRead = pIter->pRead; sqlite3_int64 iRead; int rc = 0; pRead += sqlite3Fts3GetVarint(pRead, &iRead); if( iRead==0 || iRead==1 ){ pRead = 0; rc = 1; }else{ pIter->iPos += (int)(iRead-2); } pIter->pRead = pRead; return rc; } /* ** This function implements the FTS3_MATCHINFO_LCS matchinfo() flag. ** ** If the call is successful, the longest-common-substring lengths for each ** column are written into the first nCol elements of the pInfo->aMatchinfo[] ** array before returning. SQLITE_OK is returned in this case. ** ** Otherwise, if an error occurs, an SQLite error code is returned and the ** data written to the first nCol elements of pInfo->aMatchinfo[] is ** undefined. */ static int fts3MatchinfoLcs(Fts3Cursor *pCsr, MatchInfo *pInfo){ LcsIterator *aIter; int i; int iCol; int nToken = 0; /* Allocate and populate the array of LcsIterator objects. The array ** contains one element for each matchable phrase in the query. **/ aIter = sqlite3_malloc(sizeof(LcsIterator) * pCsr->nPhrase); if( !aIter ) return SQLITE_NOMEM; memset(aIter, 0, sizeof(LcsIterator) * pCsr->nPhrase); (void)fts3ExprIterate(pCsr->pExpr, fts3MatchinfoLcsCb, (void*)aIter); for(i=0; inPhrase; i++){ LcsIterator *pIter = &aIter[i]; nToken -= pIter->pExpr->pPhrase->nToken; pIter->iPosOffset = nToken; } for(iCol=0; iColnCol; iCol++){ int nLcs = 0; /* LCS value for this column */ int nLive = 0; /* Number of iterators in aIter not at EOF */ for(i=0; inPhrase; i++){ int rc; LcsIterator *pIt = &aIter[i]; rc = sqlite3Fts3EvalPhrasePoslist(pCsr, pIt->pExpr, iCol, &pIt->pRead); if( rc!=SQLITE_OK ) return rc; if( pIt->pRead ){ pIt->iPos = pIt->iPosOffset; fts3LcsIteratorAdvance(&aIter[i]); nLive++; } } while( nLive>0 ){ LcsIterator *pAdv = 0; /* The iterator to advance by one position */ int nThisLcs = 0; /* LCS for the current iterator positions */ for(i=0; inPhrase; i++){ LcsIterator *pIter = &aIter[i]; if( pIter->pRead==0 ){ /* This iterator is already at EOF for this column. */ nThisLcs = 0; }else{ if( pAdv==0 || pIter->iPosiPos ){ pAdv = pIter; } if( nThisLcs==0 || pIter->iPos==pIter[-1].iPos ){ nThisLcs++; }else{ nThisLcs = 1; } if( nThisLcs>nLcs ) nLcs = nThisLcs; } } if( fts3LcsIteratorAdvance(pAdv) ) nLive--; } pInfo->aMatchinfo[iCol] = nLcs; } sqlite3_free(aIter); return SQLITE_OK; } /* ** Populate the buffer pInfo->aMatchinfo[] with an array of integers to ** be returned by the matchinfo() function. Argument zArg contains the ** format string passed as the second argument to matchinfo (or the ** default value "pcx" if no second argument was specified). The format ** string has already been validated and the pInfo->aMatchinfo[] array ** is guaranteed to be large enough for the output. ** ** If bGlobal is true, then populate all fields of the matchinfo() output. ** If it is false, then assume that those fields that do not change between ** rows (i.e. FTS3_MATCHINFO_NPHRASE, NCOL, NDOC, AVGLENGTH and part of HITS) ** have already been populated. ** ** Return SQLITE_OK if successful, or an SQLite error code if an error ** occurs. If a value other than SQLITE_OK is returned, the state the ** pInfo->aMatchinfo[] buffer is left in is undefined. */ static int fts3MatchinfoValues( Fts3Cursor *pCsr, /* FTS3 cursor object */ int bGlobal, /* True to grab the global stats */ MatchInfo *pInfo, /* Matchinfo context object */ const char *zArg /* Matchinfo format string */ ){ int rc = SQLITE_OK; int i; Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; sqlite3_stmt *pSelect = 0; for(i=0; rc==SQLITE_OK && zArg[i]; i++){ pInfo->flag = zArg[i]; switch( zArg[i] ){ case FTS3_MATCHINFO_NPHRASE: if( bGlobal ) pInfo->aMatchinfo[0] = pInfo->nPhrase; break; case FTS3_MATCHINFO_NCOL: if( bGlobal ) pInfo->aMatchinfo[0] = pInfo->nCol; break; case FTS3_MATCHINFO_NDOC: if( bGlobal ){ sqlite3_int64 nDoc = 0; rc = fts3MatchinfoSelectDoctotal(pTab, &pSelect, &nDoc, 0); pInfo->aMatchinfo[0] = (u32)nDoc; } break; case FTS3_MATCHINFO_AVGLENGTH: if( bGlobal ){ sqlite3_int64 nDoc; /* Number of rows in table */ const char *a; /* Aggregate column length array */ rc = fts3MatchinfoSelectDoctotal(pTab, &pSelect, &nDoc, &a); if( rc==SQLITE_OK ){ int iCol; for(iCol=0; iColnCol; iCol++){ u32 iVal; sqlite3_int64 nToken; a += sqlite3Fts3GetVarint(a, &nToken); iVal = (u32)(((u32)(nToken&0xffffffff)+nDoc/2)/nDoc); pInfo->aMatchinfo[iCol] = iVal; } } } break; case FTS3_MATCHINFO_LENGTH: { sqlite3_stmt *pSelectDocsize = 0; rc = sqlite3Fts3SelectDocsize(pTab, pCsr->iPrevId, &pSelectDocsize); if( rc==SQLITE_OK ){ int iCol; const char *a = sqlite3_column_blob(pSelectDocsize, 0); for(iCol=0; iColnCol; iCol++){ sqlite3_int64 nToken; a += sqlite3Fts3GetVarint(a, &nToken); pInfo->aMatchinfo[iCol] = (u32)nToken; } } sqlite3_reset(pSelectDocsize); break; } case FTS3_MATCHINFO_LCS: rc = fts3ExprLoadDoclists(pCsr, 0, 0); if( rc==SQLITE_OK ){ rc = fts3MatchinfoLcs(pCsr, pInfo); } break; case FTS3_MATCHINFO_LHITS_BM: case FTS3_MATCHINFO_LHITS: { int nZero = fts3MatchinfoSize(pInfo, zArg[i]) * sizeof(u32); memset(pInfo->aMatchinfo, 0, nZero); fts3ExprLHitGather(pCsr->pExpr, pInfo); break; } default: { Fts3Expr *pExpr; assert( zArg[i]==FTS3_MATCHINFO_HITS ); pExpr = pCsr->pExpr; rc = fts3ExprLoadDoclists(pCsr, 0, 0); if( rc!=SQLITE_OK ) break; if( bGlobal ){ if( pCsr->pDeferred ){ rc = fts3MatchinfoSelectDoctotal(pTab, &pSelect, &pInfo->nDoc, 0); if( rc!=SQLITE_OK ) break; } rc = fts3ExprIterate(pExpr, fts3ExprGlobalHitsCb,(void*)pInfo); sqlite3Fts3EvalTestDeferred(pCsr, &rc); if( rc!=SQLITE_OK ) break; } (void)fts3ExprIterate(pExpr, fts3ExprLocalHitsCb,(void*)pInfo); break; } } pInfo->aMatchinfo += fts3MatchinfoSize(pInfo, zArg[i]); } sqlite3_reset(pSelect); return rc; } /* ** Populate pCsr->aMatchinfo[] with data for the current row. The ** 'matchinfo' data is an array of 32-bit unsigned integers (C type u32). */ static void fts3GetMatchinfo( sqlite3_context *pCtx, /* Return results here */ Fts3Cursor *pCsr, /* FTS3 Cursor object */ const char *zArg /* Second argument to matchinfo() function */ ){ MatchInfo sInfo; Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; int rc = SQLITE_OK; int bGlobal = 0; /* Collect 'global' stats as well as local */ u32 *aOut = 0; void (*xDestroyOut)(void*) = 0; memset(&sInfo, 0, sizeof(MatchInfo)); sInfo.pCursor = pCsr; sInfo.nCol = pTab->nColumn; /* If there is cached matchinfo() data, but the format string for the ** cache does not match the format string for this request, discard ** the cached data. */ if( pCsr->pMIBuffer && strcmp(pCsr->pMIBuffer->zMatchinfo, zArg) ){ sqlite3Fts3MIBufferFree(pCsr->pMIBuffer); pCsr->pMIBuffer = 0; } /* If Fts3Cursor.pMIBuffer is NULL, then this is the first time the ** matchinfo function has been called for this query. In this case ** allocate the array used to accumulate the matchinfo data and ** initialize those elements that are constant for every row. */ if( pCsr->pMIBuffer==0 ){ int nMatchinfo = 0; /* Number of u32 elements in match-info */ int i; /* Used to iterate through zArg */ /* Determine the number of phrases in the query */ pCsr->nPhrase = fts3ExprPhraseCount(pCsr->pExpr); sInfo.nPhrase = pCsr->nPhrase; /* Determine the number of integers in the buffer returned by this call. */ for(i=0; zArg[i]; i++){ char *zErr = 0; if( fts3MatchinfoCheck(pTab, zArg[i], &zErr) ){ sqlite3_result_error(pCtx, zErr, -1); sqlite3_free(zErr); return; } nMatchinfo += fts3MatchinfoSize(&sInfo, zArg[i]); } /* Allocate space for Fts3Cursor.aMatchinfo[] and Fts3Cursor.zMatchinfo. */ pCsr->pMIBuffer = fts3MIBufferNew(nMatchinfo, zArg); if( !pCsr->pMIBuffer ) rc = SQLITE_NOMEM; pCsr->isMatchinfoNeeded = 1; bGlobal = 1; } if( rc==SQLITE_OK ){ xDestroyOut = fts3MIBufferAlloc(pCsr->pMIBuffer, &aOut); if( xDestroyOut==0 ){ rc = SQLITE_NOMEM; } } if( rc==SQLITE_OK ){ sInfo.aMatchinfo = aOut; sInfo.nPhrase = pCsr->nPhrase; rc = fts3MatchinfoValues(pCsr, bGlobal, &sInfo, zArg); if( bGlobal ){ fts3MIBufferSetGlobal(pCsr->pMIBuffer); } } if( rc!=SQLITE_OK ){ sqlite3_result_error_code(pCtx, rc); if( xDestroyOut ) xDestroyOut(aOut); }else{ int n = pCsr->pMIBuffer->nElem * sizeof(u32); sqlite3_result_blob(pCtx, aOut, n, xDestroyOut); } } /* ** Implementation of snippet() function. */ void sqlite3Fts3Snippet( sqlite3_context *pCtx, /* SQLite function call context */ Fts3Cursor *pCsr, /* Cursor object */ const char *zStart, /* Snippet start text - "" */ const char *zEnd, /* Snippet end text - "" */ const char *zEllipsis, /* Snippet ellipsis text - "..." */ int iCol, /* Extract snippet from this column */ int nToken /* Approximate number of tokens in snippet */ ){ Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; int rc = SQLITE_OK; int i; StrBuffer res = {0, 0, 0}; /* The returned text includes up to four fragments of text extracted from ** the data in the current row. The first iteration of the for(...) loop ** below attempts to locate a single fragment of text nToken tokens in ** size that contains at least one instance of all phrases in the query ** expression that appear in the current row. If such a fragment of text ** cannot be found, the second iteration of the loop attempts to locate ** a pair of fragments, and so on. */ int nSnippet = 0; /* Number of fragments in this snippet */ SnippetFragment aSnippet[4]; /* Maximum of 4 fragments per snippet */ int nFToken = -1; /* Number of tokens in each fragment */ if( !pCsr->pExpr ){ sqlite3_result_text(pCtx, "", 0, SQLITE_STATIC); return; } for(nSnippet=1; 1; nSnippet++){ int iSnip; /* Loop counter 0..nSnippet-1 */ u64 mCovered = 0; /* Bitmask of phrases covered by snippet */ u64 mSeen = 0; /* Bitmask of phrases seen by BestSnippet() */ if( nToken>=0 ){ nFToken = (nToken+nSnippet-1) / nSnippet; }else{ nFToken = -1 * nToken; } for(iSnip=0; iSnipnColumn; iRead++){ SnippetFragment sF = {0, 0, 0, 0}; int iS = 0; if( iCol>=0 && iRead!=iCol ) continue; /* Find the best snippet of nFToken tokens in column iRead. */ rc = fts3BestSnippet(nFToken, pCsr, iRead, mCovered, &mSeen, &sF, &iS); if( rc!=SQLITE_OK ){ goto snippet_out; } if( iS>iBestScore ){ *pFragment = sF; iBestScore = iS; } } mCovered |= pFragment->covered; } /* If all query phrases seen by fts3BestSnippet() are present in at least ** one of the nSnippet snippet fragments, break out of the loop. */ assert( (mCovered&mSeen)==mCovered ); if( mSeen==mCovered || nSnippet==SizeofArray(aSnippet) ) break; } assert( nFToken>0 ); for(i=0; ipCsr, pExpr, p->iCol, &pList); nTerm = pExpr->pPhrase->nToken; if( pList ){ fts3GetDeltaPosition(&pList, &iPos); assert( iPos>=0 ); } for(iTerm=0; iTermaTerm[p->iTerm++]; pT->iOff = nTerm-iTerm-1; pT->pList = pList; pT->iPos = iPos; } return rc; } /* ** Implementation of offsets() function. */ void sqlite3Fts3Offsets( sqlite3_context *pCtx, /* SQLite function call context */ Fts3Cursor *pCsr /* Cursor object */ ){ Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; sqlite3_tokenizer_module const *pMod = pTab->pTokenizer->pModule; int rc; /* Return Code */ int nToken; /* Number of tokens in query */ int iCol; /* Column currently being processed */ StrBuffer res = {0, 0, 0}; /* Result string */ TermOffsetCtx sCtx; /* Context for fts3ExprTermOffsetInit() */ if( !pCsr->pExpr ){ sqlite3_result_text(pCtx, "", 0, SQLITE_STATIC); return; } memset(&sCtx, 0, sizeof(sCtx)); assert( pCsr->isRequireSeek==0 ); /* Count the number of terms in the query */ rc = fts3ExprLoadDoclists(pCsr, 0, &nToken); if( rc!=SQLITE_OK ) goto offsets_out; /* Allocate the array of TermOffset iterators. */ sCtx.aTerm = (TermOffset *)sqlite3_malloc(sizeof(TermOffset)*nToken); if( 0==sCtx.aTerm ){ rc = SQLITE_NOMEM; goto offsets_out; } sCtx.iDocid = pCsr->iPrevId; sCtx.pCsr = pCsr; /* Loop through the table columns, appending offset information to ** string-buffer res for each column. */ for(iCol=0; iColnColumn; iCol++){ sqlite3_tokenizer_cursor *pC; /* Tokenizer cursor */ const char *ZDUMMY; /* Dummy argument used with xNext() */ int NDUMMY = 0; /* Dummy argument used with xNext() */ int iStart = 0; int iEnd = 0; int iCurrent = 0; const char *zDoc; int nDoc; /* Initialize the contents of sCtx.aTerm[] for column iCol. There is ** no way that this operation can fail, so the return code from ** fts3ExprIterate() can be discarded. */ sCtx.iCol = iCol; sCtx.iTerm = 0; (void)fts3ExprIterate(pCsr->pExpr, fts3ExprTermOffsetInit, (void*)&sCtx); /* Retreive the text stored in column iCol. If an SQL NULL is stored ** in column iCol, jump immediately to the next iteration of the loop. ** If an OOM occurs while retrieving the data (this can happen if SQLite ** needs to transform the data from utf-16 to utf-8), return SQLITE_NOMEM ** to the caller. */ zDoc = (const char *)sqlite3_column_text(pCsr->pStmt, iCol+1); nDoc = sqlite3_column_bytes(pCsr->pStmt, iCol+1); if( zDoc==0 ){ if( sqlite3_column_type(pCsr->pStmt, iCol+1)==SQLITE_NULL ){ continue; } rc = SQLITE_NOMEM; goto offsets_out; } /* Initialize a tokenizer iterator to iterate through column iCol. */ rc = sqlite3Fts3OpenTokenizer(pTab->pTokenizer, pCsr->iLangid, zDoc, nDoc, &pC ); if( rc!=SQLITE_OK ) goto offsets_out; rc = pMod->xNext(pC, &ZDUMMY, &NDUMMY, &iStart, &iEnd, &iCurrent); while( rc==SQLITE_OK ){ int i; /* Used to loop through terms */ int iMinPos = 0x7FFFFFFF; /* Position of next token */ TermOffset *pTerm = 0; /* TermOffset associated with next token */ for(i=0; ipList && (pT->iPos-pT->iOff)iPos-pT->iOff; pTerm = pT; } } if( !pTerm ){ /* All offsets for this column have been gathered. */ rc = SQLITE_DONE; }else{ assert( iCurrent<=iMinPos ); if( 0==(0xFE&*pTerm->pList) ){ pTerm->pList = 0; }else{ fts3GetDeltaPosition(&pTerm->pList, &pTerm->iPos); } while( rc==SQLITE_OK && iCurrentxNext(pC, &ZDUMMY, &NDUMMY, &iStart, &iEnd, &iCurrent); } if( rc==SQLITE_OK ){ char aBuffer[64]; sqlite3_snprintf(sizeof(aBuffer), aBuffer, "%d %d %d %d ", iCol, pTerm-sCtx.aTerm, iStart, iEnd-iStart ); rc = fts3StringAppend(&res, aBuffer, -1); }else if( rc==SQLITE_DONE && pTab->zContentTbl==0 ){ rc = FTS_CORRUPT_VTAB; } } } if( rc==SQLITE_DONE ){ rc = SQLITE_OK; } pMod->xClose(pC); if( rc!=SQLITE_OK ) goto offsets_out; } offsets_out: sqlite3_free(sCtx.aTerm); assert( rc!=SQLITE_DONE ); sqlite3Fts3SegmentsClose(pTab); if( rc!=SQLITE_OK ){ sqlite3_result_error_code(pCtx, rc); sqlite3_free(res.z); }else{ sqlite3_result_text(pCtx, res.z, res.n-1, sqlite3_free); } return; } /* ** Implementation of matchinfo() function. */ void sqlite3Fts3Matchinfo( sqlite3_context *pContext, /* Function call context */ Fts3Cursor *pCsr, /* FTS3 table cursor */ const char *zArg /* Second arg to matchinfo() function */ ){ Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; const char *zFormat; if( zArg ){ zFormat = zArg; }else{ zFormat = FTS3_MATCHINFO_DEFAULT; } if( !pCsr->pExpr ){ sqlite3_result_blob(pContext, "", 0, SQLITE_STATIC); return; }else{ /* Retrieve matchinfo() data. */ fts3GetMatchinfo(pContext, pCsr, zFormat); sqlite3Fts3SegmentsClose(pTab); } } #endif ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_term.c ================================================ /* ** 2011 Jan 27 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This file is not part of the production FTS code. It is only used for ** testing. It contains a virtual table implementation that provides direct ** access to the full-text index of an FTS table. */ #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) #ifdef SQLITE_TEST #include #include #include typedef struct Fts3termTable Fts3termTable; typedef struct Fts3termCursor Fts3termCursor; struct Fts3termTable { sqlite3_vtab base; /* Base class used by SQLite core */ int iIndex; /* Index for Fts3Table.aIndex[] */ Fts3Table *pFts3Tab; }; struct Fts3termCursor { sqlite3_vtab_cursor base; /* Base class used by SQLite core */ Fts3MultiSegReader csr; /* Must be right after "base" */ Fts3SegFilter filter; int isEof; /* True if cursor is at EOF */ char *pNext; sqlite3_int64 iRowid; /* Current 'rowid' value */ sqlite3_int64 iDocid; /* Current 'docid' value */ int iCol; /* Current 'col' value */ int iPos; /* Current 'pos' value */ }; /* ** Schema of the terms table. */ #define FTS3_TERMS_SCHEMA "CREATE TABLE x(term, docid, col, pos)" /* ** This function does all the work for both the xConnect and xCreate methods. ** These tables have no persistent representation of their own, so xConnect ** and xCreate are identical operations. */ static int fts3termConnectMethod( sqlite3 *db, /* Database connection */ void *pCtx, /* Non-zero for an fts4prefix table */ int argc, /* Number of elements in argv array */ const char * const *argv, /* xCreate/xConnect argument array */ sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */ char **pzErr /* OUT: sqlite3_malloc'd error message */ ){ char const *zDb; /* Name of database (e.g. "main") */ char const *zFts3; /* Name of fts3 table */ int nDb; /* Result of strlen(zDb) */ int nFts3; /* Result of strlen(zFts3) */ int nByte; /* Bytes of space to allocate here */ int rc; /* value returned by declare_vtab() */ Fts3termTable *p; /* Virtual table object to return */ int iIndex = 0; UNUSED_PARAMETER(pCtx); if( argc==5 ){ iIndex = atoi(argv[4]); argc--; } /* The user should specify a single argument - the name of an fts3 table. */ if( argc!=4 ){ sqlite3Fts3ErrMsg(pzErr, "wrong number of arguments to fts4term constructor" ); return SQLITE_ERROR; } zDb = argv[1]; nDb = (int)strlen(zDb); zFts3 = argv[3]; nFts3 = (int)strlen(zFts3); rc = sqlite3_declare_vtab(db, FTS3_TERMS_SCHEMA); if( rc!=SQLITE_OK ) return rc; nByte = sizeof(Fts3termTable) + sizeof(Fts3Table) + nDb + nFts3 + 2; p = (Fts3termTable *)sqlite3_malloc(nByte); if( !p ) return SQLITE_NOMEM; memset(p, 0, nByte); p->pFts3Tab = (Fts3Table *)&p[1]; p->pFts3Tab->zDb = (char *)&p->pFts3Tab[1]; p->pFts3Tab->zName = &p->pFts3Tab->zDb[nDb+1]; p->pFts3Tab->db = db; p->pFts3Tab->nIndex = iIndex+1; p->iIndex = iIndex; memcpy((char *)p->pFts3Tab->zDb, zDb, nDb); memcpy((char *)p->pFts3Tab->zName, zFts3, nFts3); sqlite3Fts3Dequote((char *)p->pFts3Tab->zName); *ppVtab = (sqlite3_vtab *)p; return SQLITE_OK; } /* ** This function does the work for both the xDisconnect and xDestroy methods. ** These tables have no persistent representation of their own, so xDisconnect ** and xDestroy are identical operations. */ static int fts3termDisconnectMethod(sqlite3_vtab *pVtab){ Fts3termTable *p = (Fts3termTable *)pVtab; Fts3Table *pFts3 = p->pFts3Tab; int i; /* Free any prepared statements held */ for(i=0; iaStmt); i++){ sqlite3_finalize(pFts3->aStmt[i]); } sqlite3_free(pFts3->zSegmentsTbl); sqlite3_free(p); return SQLITE_OK; } #define FTS4AUX_EQ_CONSTRAINT 1 #define FTS4AUX_GE_CONSTRAINT 2 #define FTS4AUX_LE_CONSTRAINT 4 /* ** xBestIndex - Analyze a WHERE and ORDER BY clause. */ static int fts3termBestIndexMethod( sqlite3_vtab *pVTab, sqlite3_index_info *pInfo ){ UNUSED_PARAMETER(pVTab); /* This vtab naturally does "ORDER BY term, docid, col, pos". */ if( pInfo->nOrderBy ){ int i; for(i=0; inOrderBy; i++){ if( pInfo->aOrderBy[i].iColumn!=i || pInfo->aOrderBy[i].desc ) break; } if( i==pInfo->nOrderBy ){ pInfo->orderByConsumed = 1; } } return SQLITE_OK; } /* ** xOpen - Open a cursor. */ static int fts3termOpenMethod(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr){ Fts3termCursor *pCsr; /* Pointer to cursor object to return */ UNUSED_PARAMETER(pVTab); pCsr = (Fts3termCursor *)sqlite3_malloc(sizeof(Fts3termCursor)); if( !pCsr ) return SQLITE_NOMEM; memset(pCsr, 0, sizeof(Fts3termCursor)); *ppCsr = (sqlite3_vtab_cursor *)pCsr; return SQLITE_OK; } /* ** xClose - Close a cursor. */ static int fts3termCloseMethod(sqlite3_vtab_cursor *pCursor){ Fts3Table *pFts3 = ((Fts3termTable *)pCursor->pVtab)->pFts3Tab; Fts3termCursor *pCsr = (Fts3termCursor *)pCursor; sqlite3Fts3SegmentsClose(pFts3); sqlite3Fts3SegReaderFinish(&pCsr->csr); sqlite3_free(pCsr); return SQLITE_OK; } /* ** xNext - Advance the cursor to the next row, if any. */ static int fts3termNextMethod(sqlite3_vtab_cursor *pCursor){ Fts3termCursor *pCsr = (Fts3termCursor *)pCursor; Fts3Table *pFts3 = ((Fts3termTable *)pCursor->pVtab)->pFts3Tab; int rc; sqlite3_int64 v; /* Increment our pretend rowid value. */ pCsr->iRowid++; /* Advance to the next term in the full-text index. */ if( pCsr->csr.aDoclist==0 || pCsr->pNext>=&pCsr->csr.aDoclist[pCsr->csr.nDoclist-1] ){ rc = sqlite3Fts3SegReaderStep(pFts3, &pCsr->csr); if( rc!=SQLITE_ROW ){ pCsr->isEof = 1; return rc; } pCsr->iCol = 0; pCsr->iPos = 0; pCsr->iDocid = 0; pCsr->pNext = pCsr->csr.aDoclist; /* Read docid */ pCsr->pNext += sqlite3Fts3GetVarint(pCsr->pNext, &pCsr->iDocid); } pCsr->pNext += sqlite3Fts3GetVarint(pCsr->pNext, &v); if( v==0 ){ pCsr->pNext += sqlite3Fts3GetVarint(pCsr->pNext, &v); pCsr->iDocid += v; pCsr->pNext += sqlite3Fts3GetVarint(pCsr->pNext, &v); pCsr->iCol = 0; pCsr->iPos = 0; } if( v==1 ){ pCsr->pNext += sqlite3Fts3GetVarint(pCsr->pNext, &v); pCsr->iCol += (int)v; pCsr->iPos = 0; pCsr->pNext += sqlite3Fts3GetVarint(pCsr->pNext, &v); } pCsr->iPos += (int)(v - 2); return SQLITE_OK; } /* ** xFilter - Initialize a cursor to point at the start of its data. */ static int fts3termFilterMethod( sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */ int idxNum, /* Strategy index */ const char *idxStr, /* Unused */ int nVal, /* Number of elements in apVal */ sqlite3_value **apVal /* Arguments for the indexing scheme */ ){ Fts3termCursor *pCsr = (Fts3termCursor *)pCursor; Fts3termTable *p = (Fts3termTable *)pCursor->pVtab; Fts3Table *pFts3 = p->pFts3Tab; int rc; UNUSED_PARAMETER(nVal); UNUSED_PARAMETER(idxNum); UNUSED_PARAMETER(idxStr); UNUSED_PARAMETER(apVal); assert( idxStr==0 && idxNum==0 ); /* In case this cursor is being reused, close and zero it. */ testcase(pCsr->filter.zTerm); sqlite3Fts3SegReaderFinish(&pCsr->csr); memset(&pCsr->csr, 0, ((u8*)&pCsr[1]) - (u8*)&pCsr->csr); pCsr->filter.flags = FTS3_SEGMENT_REQUIRE_POS|FTS3_SEGMENT_IGNORE_EMPTY; pCsr->filter.flags |= FTS3_SEGMENT_SCAN; rc = sqlite3Fts3SegReaderCursor(pFts3, 0, p->iIndex, FTS3_SEGCURSOR_ALL, pCsr->filter.zTerm, pCsr->filter.nTerm, 0, 1, &pCsr->csr ); if( rc==SQLITE_OK ){ rc = sqlite3Fts3SegReaderStart(pFts3, &pCsr->csr, &pCsr->filter); } if( rc==SQLITE_OK ){ rc = fts3termNextMethod(pCursor); } return rc; } /* ** xEof - Return true if the cursor is at EOF, or false otherwise. */ static int fts3termEofMethod(sqlite3_vtab_cursor *pCursor){ Fts3termCursor *pCsr = (Fts3termCursor *)pCursor; return pCsr->isEof; } /* ** xColumn - Return a column value. */ static int fts3termColumnMethod( sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ sqlite3_context *pCtx, /* Context for sqlite3_result_xxx() calls */ int iCol /* Index of column to read value from */ ){ Fts3termCursor *p = (Fts3termCursor *)pCursor; assert( iCol>=0 && iCol<=3 ); switch( iCol ){ case 0: sqlite3_result_text(pCtx, p->csr.zTerm, p->csr.nTerm, SQLITE_TRANSIENT); break; case 1: sqlite3_result_int64(pCtx, p->iDocid); break; case 2: sqlite3_result_int64(pCtx, p->iCol); break; default: sqlite3_result_int64(pCtx, p->iPos); break; } return SQLITE_OK; } /* ** xRowid - Return the current rowid for the cursor. */ static int fts3termRowidMethod( sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ sqlite_int64 *pRowid /* OUT: Rowid value */ ){ Fts3termCursor *pCsr = (Fts3termCursor *)pCursor; *pRowid = pCsr->iRowid; return SQLITE_OK; } /* ** Register the fts3term module with database connection db. Return SQLITE_OK ** if successful or an error code if sqlite3_create_module() fails. */ int sqlite3Fts3InitTerm(sqlite3 *db){ static const sqlite3_module fts3term_module = { 0, /* iVersion */ fts3termConnectMethod, /* xCreate */ fts3termConnectMethod, /* xConnect */ fts3termBestIndexMethod, /* xBestIndex */ fts3termDisconnectMethod, /* xDisconnect */ fts3termDisconnectMethod, /* xDestroy */ fts3termOpenMethod, /* xOpen */ fts3termCloseMethod, /* xClose */ fts3termFilterMethod, /* xFilter */ fts3termNextMethod, /* xNext */ fts3termEofMethod, /* xEof */ fts3termColumnMethod, /* xColumn */ fts3termRowidMethod, /* xRowid */ 0, /* xUpdate */ 0, /* xBegin */ 0, /* xSync */ 0, /* xCommit */ 0, /* xRollback */ 0, /* xFindFunction */ 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ 0 /* xRollbackTo */ }; int rc; /* Return code */ rc = sqlite3_create_module(db, "fts4term", &fts3term_module, 0); return rc; } #endif #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_test.c ================================================ /* ** 2011 Jun 13 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This file is not part of the production FTS code. It is only used for ** testing. It contains a Tcl command that can be used to test if a document ** matches an FTS NEAR expression. ** ** As of March 2012, it also contains a version 1 tokenizer used for testing ** that the sqlite3_tokenizer_module.xLanguage() method is invoked correctly. */ #if defined(INCLUDE_SQLITE_TCL_H) # include "sqlite_tcl.h" #else # include "tcl.h" # ifndef SQLITE_TCLAPI # define SQLITE_TCLAPI # endif #endif #include #include #if defined(SQLITE_TEST) #if defined(SQLITE_ENABLE_FTS3) || defined(SQLITE_ENABLE_FTS4) /* Required so that the "ifdef SQLITE_ENABLE_FTS3" below works */ #include "fts3Int.h" #define NM_MAX_TOKEN 12 typedef struct NearPhrase NearPhrase; typedef struct NearDocument NearDocument; typedef struct NearToken NearToken; struct NearDocument { int nToken; /* Length of token in bytes */ NearToken *aToken; /* Token array */ }; struct NearToken { int n; /* Length of token in bytes */ const char *z; /* Pointer to token string */ }; struct NearPhrase { int nNear; /* Preceding NEAR value */ int nToken; /* Number of tokens in this phrase */ NearToken aToken[NM_MAX_TOKEN]; /* Array of tokens in this phrase */ }; static int nm_phrase_match( NearPhrase *p, NearToken *aToken ){ int ii; for(ii=0; iinToken; ii++){ NearToken *pToken = &p->aToken[ii]; if( pToken->n>0 && pToken->z[pToken->n-1]=='*' ){ if( aToken[ii].n<(pToken->n-1) ) return 0; if( memcmp(aToken[ii].z, pToken->z, pToken->n-1) ) return 0; }else{ if( aToken[ii].n!=pToken->n ) return 0; if( memcmp(aToken[ii].z, pToken->z, pToken->n) ) return 0; } } return 1; } static int nm_near_chain( int iDir, /* Direction to iterate through aPhrase[] */ NearDocument *pDoc, /* Document to match against */ int iPos, /* Position at which iPhrase was found */ int nPhrase, /* Size of phrase array */ NearPhrase *aPhrase, /* Phrase array */ int iPhrase /* Index of phrase found */ ){ int iStart; int iStop; int ii; int nNear; int iPhrase2; NearPhrase *p; NearPhrase *pPrev; assert( iDir==1 || iDir==-1 ); if( iDir==1 ){ if( (iPhrase+1)==nPhrase ) return 1; nNear = aPhrase[iPhrase+1].nNear; }else{ if( iPhrase==0 ) return 1; nNear = aPhrase[iPhrase].nNear; } pPrev = &aPhrase[iPhrase]; iPhrase2 = iPhrase+iDir; p = &aPhrase[iPhrase2]; iStart = iPos - nNear - p->nToken; iStop = iPos + nNear + pPrev->nToken; if( iStart<0 ) iStart = 0; if( iStop > pDoc->nToken - p->nToken ) iStop = pDoc->nToken - p->nToken; for(ii=iStart; ii<=iStop; ii++){ if( nm_phrase_match(p, &pDoc->aToken[ii]) ){ if( nm_near_chain(iDir, pDoc, ii, nPhrase, aPhrase, iPhrase2) ) return 1; } } return 0; } static int nm_match_count( NearDocument *pDoc, /* Document to match against */ int nPhrase, /* Size of phrase array */ NearPhrase *aPhrase, /* Phrase array */ int iPhrase /* Index of phrase to count matches for */ ){ int nOcc = 0; int ii; NearPhrase *p = &aPhrase[iPhrase]; for(ii=0; ii<(pDoc->nToken + 1 - p->nToken); ii++){ if( nm_phrase_match(p, &pDoc->aToken[ii]) ){ /* Test forward NEAR chain (i>iPhrase) */ if( 0==nm_near_chain(1, pDoc, ii, nPhrase, aPhrase, iPhrase) ) continue; /* Test reverse NEAR chain (iNM_MAX_TOKEN ){ Tcl_AppendResult(interp, "Too many tokens in phrase", 0); rc = TCL_ERROR; goto near_match_out; } for(jj=0; jjz = Tcl_GetStringFromObj(apToken[jj], &pT->n); } aPhrase[ii].nToken = nToken; } for(ii=1; ii0)); near_match_out: ckfree((char *)aPhrase); ckfree((char *)doc.aToken); return rc; } /* ** Tclcmd: fts3_configure_incr_load ?CHUNKSIZE THRESHOLD? ** ** Normally, FTS uses hard-coded values to determine the minimum doclist ** size eligible for incremental loading, and the size of the chunks loaded ** when a doclist is incrementally loaded. This command allows the built-in ** values to be overridden for testing purposes. ** ** If present, the first argument is the chunksize in bytes to load doclists ** in. The second argument is the minimum doclist size in bytes to use ** incremental loading with. ** ** Whether or not the arguments are present, this command returns a list of ** two integers - the initial chunksize and threshold when the command is ** invoked. This can be used to restore the default behavior after running ** tests. For example: ** ** # Override incr-load settings for testing: ** set cfg [fts3_configure_incr_load $new_chunksize $new_threshold] ** ** .... run tests .... ** ** # Restore initial incr-load settings: ** eval fts3_configure_incr_load $cfg */ static int SQLITE_TCLAPI fts3_configure_incr_load_cmd( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ #ifdef SQLITE_ENABLE_FTS3 extern int test_fts3_node_chunksize; extern int test_fts3_node_chunk_threshold; Tcl_Obj *pRet; if( objc!=1 && objc!=3 ){ Tcl_WrongNumArgs(interp, 1, objv, "?CHUNKSIZE THRESHOLD?"); return TCL_ERROR; } pRet = Tcl_NewObj(); Tcl_IncrRefCount(pRet); Tcl_ListObjAppendElement( interp, pRet, Tcl_NewIntObj(test_fts3_node_chunksize)); Tcl_ListObjAppendElement( interp, pRet, Tcl_NewIntObj(test_fts3_node_chunk_threshold)); if( objc==3 ){ int iArg1; int iArg2; if( Tcl_GetIntFromObj(interp, objv[1], &iArg1) || Tcl_GetIntFromObj(interp, objv[2], &iArg2) ){ Tcl_DecrRefCount(pRet); return TCL_ERROR; } test_fts3_node_chunksize = iArg1; test_fts3_node_chunk_threshold = iArg2; } Tcl_SetObjResult(interp, pRet); Tcl_DecrRefCount(pRet); #endif UNUSED_PARAMETER(clientData); return TCL_OK; } #ifdef SQLITE_ENABLE_FTS3 /************************************************************************** ** Beginning of test tokenizer code. ** ** For language 0, this tokenizer is similar to the default 'simple' ** tokenizer. For other languages L, the following: ** ** * Odd numbered languages are case-sensitive. Even numbered ** languages are not. ** ** * Language ids 100 or greater are considered an error. ** ** The implementation assumes that the input contains only ASCII characters ** (i.e. those that may be encoded in UTF-8 using a single byte). */ typedef struct test_tokenizer { sqlite3_tokenizer base; } test_tokenizer; typedef struct test_tokenizer_cursor { sqlite3_tokenizer_cursor base; const char *aInput; /* Input being tokenized */ int nInput; /* Size of the input in bytes */ int iInput; /* Current offset in aInput */ int iToken; /* Index of next token to be returned */ char *aBuffer; /* Buffer containing current token */ int nBuffer; /* Number of bytes allocated at pToken */ int iLangid; /* Configured language id */ } test_tokenizer_cursor; static int testTokenizerCreate( int argc, const char * const *argv, sqlite3_tokenizer **ppTokenizer ){ test_tokenizer *pNew; UNUSED_PARAMETER(argc); UNUSED_PARAMETER(argv); pNew = sqlite3_malloc(sizeof(test_tokenizer)); if( !pNew ) return SQLITE_NOMEM; memset(pNew, 0, sizeof(test_tokenizer)); *ppTokenizer = (sqlite3_tokenizer *)pNew; return SQLITE_OK; } static int testTokenizerDestroy(sqlite3_tokenizer *pTokenizer){ test_tokenizer *p = (test_tokenizer *)pTokenizer; sqlite3_free(p); return SQLITE_OK; } static int testTokenizerOpen( sqlite3_tokenizer *pTokenizer, /* The tokenizer */ const char *pInput, int nBytes, /* String to be tokenized */ sqlite3_tokenizer_cursor **ppCursor /* OUT: Tokenization cursor */ ){ int rc = SQLITE_OK; /* Return code */ test_tokenizer_cursor *pCsr; /* New cursor object */ UNUSED_PARAMETER(pTokenizer); pCsr = (test_tokenizer_cursor *)sqlite3_malloc(sizeof(test_tokenizer_cursor)); if( pCsr==0 ){ rc = SQLITE_NOMEM; }else{ memset(pCsr, 0, sizeof(test_tokenizer_cursor)); pCsr->aInput = pInput; if( nBytes<0 ){ pCsr->nInput = (int)strlen(pInput); }else{ pCsr->nInput = nBytes; } } *ppCursor = (sqlite3_tokenizer_cursor *)pCsr; return rc; } static int testTokenizerClose(sqlite3_tokenizer_cursor *pCursor){ test_tokenizer_cursor *pCsr = (test_tokenizer_cursor *)pCursor; sqlite3_free(pCsr->aBuffer); sqlite3_free(pCsr); return SQLITE_OK; } static int testIsTokenChar(char c){ return (c>='a' && c<='z') || (c>='A' && c<='Z'); } static int testTolower(char c){ char ret = c; if( ret>='A' && ret<='Z') ret = ret - ('A'-'a'); return ret; } static int testTokenizerNext( sqlite3_tokenizer_cursor *pCursor, /* Cursor returned by testTokenizerOpen */ const char **ppToken, /* OUT: *ppToken is the token text */ int *pnBytes, /* OUT: Number of bytes in token */ int *piStartOffset, /* OUT: Starting offset of token */ int *piEndOffset, /* OUT: Ending offset of token */ int *piPosition /* OUT: Position integer of token */ ){ test_tokenizer_cursor *pCsr = (test_tokenizer_cursor *)pCursor; int rc = SQLITE_OK; const char *p; const char *pEnd; p = &pCsr->aInput[pCsr->iInput]; pEnd = &pCsr->aInput[pCsr->nInput]; /* Skip past any white-space */ assert( p<=pEnd ); while( ppCsr->nBuffer ){ sqlite3_free(pCsr->aBuffer); pCsr->aBuffer = sqlite3_malloc(nToken); } if( pCsr->aBuffer==0 ){ rc = SQLITE_NOMEM; }else{ int i; if( pCsr->iLangid & 0x00000001 ){ for(i=0; iaBuffer[i] = pToken[i]; }else{ for(i=0; iaBuffer[i] = (char)testTolower(pToken[i]); } pCsr->iToken++; pCsr->iInput = (int)(p - pCsr->aInput); *ppToken = pCsr->aBuffer; *pnBytes = nToken; *piStartOffset = (int)(pToken - pCsr->aInput); *piEndOffset = (int)(p - pCsr->aInput); *piPosition = pCsr->iToken; } } return rc; } static int testTokenizerLanguage( sqlite3_tokenizer_cursor *pCursor, int iLangid ){ int rc = SQLITE_OK; test_tokenizer_cursor *pCsr = (test_tokenizer_cursor *)pCursor; pCsr->iLangid = iLangid; if( pCsr->iLangid>=100 ){ rc = SQLITE_ERROR; } return rc; } #endif static int SQLITE_TCLAPI fts3_test_tokenizer_cmd( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ #ifdef SQLITE_ENABLE_FTS3 static const sqlite3_tokenizer_module testTokenizerModule = { 1, testTokenizerCreate, testTokenizerDestroy, testTokenizerOpen, testTokenizerClose, testTokenizerNext, testTokenizerLanguage }; const sqlite3_tokenizer_module *pPtr = &testTokenizerModule; if( objc!=1 ){ Tcl_WrongNumArgs(interp, 1, objv, ""); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewByteArrayObj( (const unsigned char *)&pPtr, sizeof(sqlite3_tokenizer_module *) )); #endif UNUSED_PARAMETER(clientData); return TCL_OK; } static int SQLITE_TCLAPI fts3_test_varint_cmd( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ #ifdef SQLITE_ENABLE_FTS3 char aBuf[24]; int rc; Tcl_WideInt w; sqlite3_int64 w2; int nByte, nByte2; if( objc!=2 ){ Tcl_WrongNumArgs(interp, 1, objv, "INTEGER"); return TCL_ERROR; } rc = Tcl_GetWideIntFromObj(interp, objv[1], &w); if( rc!=TCL_OK ) return rc; nByte = sqlite3Fts3PutVarint(aBuf, w); nByte2 = sqlite3Fts3GetVarint(aBuf, &w2); if( w!=w2 || nByte!=nByte2 ){ char *zErr = sqlite3_mprintf("error testing %lld", w); Tcl_ResetResult(interp); Tcl_AppendResult(interp, zErr, 0); return TCL_ERROR; } if( w<=2147483647 && w>=0 ){ int i; nByte2 = fts3GetVarint32(aBuf, &i); if( (int)w!=i || nByte!=nByte2 ){ char *zErr = sqlite3_mprintf("error testing %lld (32-bit)", w); Tcl_ResetResult(interp); Tcl_AppendResult(interp, zErr, 0); return TCL_ERROR; } } #endif UNUSED_PARAMETER(clientData); return TCL_OK; } /* ** End of tokenizer code. **************************************************************************/ int Sqlitetestfts3_Init(Tcl_Interp *interp){ Tcl_CreateObjCommand(interp, "fts3_near_match", fts3_near_match_cmd, 0, 0); Tcl_CreateObjCommand(interp, "fts3_configure_incr_load", fts3_configure_incr_load_cmd, 0, 0 ); Tcl_CreateObjCommand( interp, "fts3_test_tokenizer", fts3_test_tokenizer_cmd, 0, 0 ); Tcl_CreateObjCommand( interp, "fts3_test_varint", fts3_test_varint_cmd, 0, 0 ); return TCL_OK; } #endif /* SQLITE_ENABLE_FTS3 || SQLITE_ENABLE_FTS4 */ #endif /* ifdef SQLITE_TEST */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_tokenize_vtab.c ================================================ /* ** 2013 Apr 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This file contains code for the "fts3tokenize" virtual table module. ** An fts3tokenize virtual table is created as follows: ** ** CREATE VIRTUAL TABLE USING fts3tokenize( ** , , ... ** ); ** ** The table created has the following schema: ** ** CREATE TABLE (input, token, start, end, position) ** ** When queried, the query must include a WHERE clause of type: ** ** input = ** ** The virtual table module tokenizes this , using the FTS3 ** tokenizer specified by the arguments to the CREATE VIRTUAL TABLE ** statement and returns one row for each token in the result. With ** fields set as follows: ** ** input: Always set to a copy of ** token: A token from the input. ** start: Byte offset of the token within the input . ** end: Byte offset of the byte immediately following the end of the ** token within the input string. ** pos: Token offset of token within input. ** */ #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) #include #include typedef struct Fts3tokTable Fts3tokTable; typedef struct Fts3tokCursor Fts3tokCursor; /* ** Virtual table structure. */ struct Fts3tokTable { sqlite3_vtab base; /* Base class used by SQLite core */ const sqlite3_tokenizer_module *pMod; sqlite3_tokenizer *pTok; }; /* ** Virtual table cursor structure. */ struct Fts3tokCursor { sqlite3_vtab_cursor base; /* Base class used by SQLite core */ char *zInput; /* Input string */ sqlite3_tokenizer_cursor *pCsr; /* Cursor to iterate through zInput */ int iRowid; /* Current 'rowid' value */ const char *zToken; /* Current 'token' value */ int nToken; /* Size of zToken in bytes */ int iStart; /* Current 'start' value */ int iEnd; /* Current 'end' value */ int iPos; /* Current 'pos' value */ }; /* ** Query FTS for the tokenizer implementation named zName. */ static int fts3tokQueryTokenizer( Fts3Hash *pHash, const char *zName, const sqlite3_tokenizer_module **pp, char **pzErr ){ sqlite3_tokenizer_module *p; int nName = (int)strlen(zName); p = (sqlite3_tokenizer_module *)sqlite3Fts3HashFind(pHash, zName, nName+1); if( !p ){ sqlite3Fts3ErrMsg(pzErr, "unknown tokenizer: %s", zName); return SQLITE_ERROR; } *pp = p; return SQLITE_OK; } /* ** The second argument, argv[], is an array of pointers to nul-terminated ** strings. This function makes a copy of the array and strings into a ** single block of memory. It then dequotes any of the strings that appear ** to be quoted. ** ** If successful, output parameter *pazDequote is set to point at the ** array of dequoted strings and SQLITE_OK is returned. The caller is ** responsible for eventually calling sqlite3_free() to free the array ** in this case. Or, if an error occurs, an SQLite error code is returned. ** The final value of *pazDequote is undefined in this case. */ static int fts3tokDequoteArray( int argc, /* Number of elements in argv[] */ const char * const *argv, /* Input array */ char ***pazDequote /* Output array */ ){ int rc = SQLITE_OK; /* Return code */ if( argc==0 ){ *pazDequote = 0; }else{ int i; int nByte = 0; char **azDequote; for(i=0; ixCreate((nDequote>1 ? nDequote-1 : 0), azArg, &pTok); } if( rc==SQLITE_OK ){ pTab = (Fts3tokTable *)sqlite3_malloc(sizeof(Fts3tokTable)); if( pTab==0 ){ rc = SQLITE_NOMEM; } } if( rc==SQLITE_OK ){ memset(pTab, 0, sizeof(Fts3tokTable)); pTab->pMod = pMod; pTab->pTok = pTok; *ppVtab = &pTab->base; }else{ if( pTok ){ pMod->xDestroy(pTok); } } sqlite3_free(azDequote); return rc; } /* ** This function does the work for both the xDisconnect and xDestroy methods. ** These tables have no persistent representation of their own, so xDisconnect ** and xDestroy are identical operations. */ static int fts3tokDisconnectMethod(sqlite3_vtab *pVtab){ Fts3tokTable *pTab = (Fts3tokTable *)pVtab; pTab->pMod->xDestroy(pTab->pTok); sqlite3_free(pTab); return SQLITE_OK; } /* ** xBestIndex - Analyze a WHERE and ORDER BY clause. */ static int fts3tokBestIndexMethod( sqlite3_vtab *pVTab, sqlite3_index_info *pInfo ){ int i; UNUSED_PARAMETER(pVTab); for(i=0; inConstraint; i++){ if( pInfo->aConstraint[i].usable && pInfo->aConstraint[i].iColumn==0 && pInfo->aConstraint[i].op==SQLITE_INDEX_CONSTRAINT_EQ ){ pInfo->idxNum = 1; pInfo->aConstraintUsage[i].argvIndex = 1; pInfo->aConstraintUsage[i].omit = 1; pInfo->estimatedCost = 1; return SQLITE_OK; } } pInfo->idxNum = 0; assert( pInfo->estimatedCost>1000000.0 ); return SQLITE_OK; } /* ** xOpen - Open a cursor. */ static int fts3tokOpenMethod(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr){ Fts3tokCursor *pCsr; UNUSED_PARAMETER(pVTab); pCsr = (Fts3tokCursor *)sqlite3_malloc(sizeof(Fts3tokCursor)); if( pCsr==0 ){ return SQLITE_NOMEM; } memset(pCsr, 0, sizeof(Fts3tokCursor)); *ppCsr = (sqlite3_vtab_cursor *)pCsr; return SQLITE_OK; } /* ** Reset the tokenizer cursor passed as the only argument. As if it had ** just been returned by fts3tokOpenMethod(). */ static void fts3tokResetCursor(Fts3tokCursor *pCsr){ if( pCsr->pCsr ){ Fts3tokTable *pTab = (Fts3tokTable *)(pCsr->base.pVtab); pTab->pMod->xClose(pCsr->pCsr); pCsr->pCsr = 0; } sqlite3_free(pCsr->zInput); pCsr->zInput = 0; pCsr->zToken = 0; pCsr->nToken = 0; pCsr->iStart = 0; pCsr->iEnd = 0; pCsr->iPos = 0; pCsr->iRowid = 0; } /* ** xClose - Close a cursor. */ static int fts3tokCloseMethod(sqlite3_vtab_cursor *pCursor){ Fts3tokCursor *pCsr = (Fts3tokCursor *)pCursor; fts3tokResetCursor(pCsr); sqlite3_free(pCsr); return SQLITE_OK; } /* ** xNext - Advance the cursor to the next row, if any. */ static int fts3tokNextMethod(sqlite3_vtab_cursor *pCursor){ Fts3tokCursor *pCsr = (Fts3tokCursor *)pCursor; Fts3tokTable *pTab = (Fts3tokTable *)(pCursor->pVtab); int rc; /* Return code */ pCsr->iRowid++; rc = pTab->pMod->xNext(pCsr->pCsr, &pCsr->zToken, &pCsr->nToken, &pCsr->iStart, &pCsr->iEnd, &pCsr->iPos ); if( rc!=SQLITE_OK ){ fts3tokResetCursor(pCsr); if( rc==SQLITE_DONE ) rc = SQLITE_OK; } return rc; } /* ** xFilter - Initialize a cursor to point at the start of its data. */ static int fts3tokFilterMethod( sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */ int idxNum, /* Strategy index */ const char *idxStr, /* Unused */ int nVal, /* Number of elements in apVal */ sqlite3_value **apVal /* Arguments for the indexing scheme */ ){ int rc = SQLITE_ERROR; Fts3tokCursor *pCsr = (Fts3tokCursor *)pCursor; Fts3tokTable *pTab = (Fts3tokTable *)(pCursor->pVtab); UNUSED_PARAMETER(idxStr); UNUSED_PARAMETER(nVal); fts3tokResetCursor(pCsr); if( idxNum==1 ){ const char *zByte = (const char *)sqlite3_value_text(apVal[0]); int nByte = sqlite3_value_bytes(apVal[0]); pCsr->zInput = sqlite3_malloc(nByte+1); if( pCsr->zInput==0 ){ rc = SQLITE_NOMEM; }else{ memcpy(pCsr->zInput, zByte, nByte); pCsr->zInput[nByte] = 0; rc = pTab->pMod->xOpen(pTab->pTok, pCsr->zInput, nByte, &pCsr->pCsr); if( rc==SQLITE_OK ){ pCsr->pCsr->pTokenizer = pTab->pTok; } } } if( rc!=SQLITE_OK ) return rc; return fts3tokNextMethod(pCursor); } /* ** xEof - Return true if the cursor is at EOF, or false otherwise. */ static int fts3tokEofMethod(sqlite3_vtab_cursor *pCursor){ Fts3tokCursor *pCsr = (Fts3tokCursor *)pCursor; return (pCsr->zToken==0); } /* ** xColumn - Return a column value. */ static int fts3tokColumnMethod( sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ sqlite3_context *pCtx, /* Context for sqlite3_result_xxx() calls */ int iCol /* Index of column to read value from */ ){ Fts3tokCursor *pCsr = (Fts3tokCursor *)pCursor; /* CREATE TABLE x(input, token, start, end, position) */ switch( iCol ){ case 0: sqlite3_result_text(pCtx, pCsr->zInput, -1, SQLITE_TRANSIENT); break; case 1: sqlite3_result_text(pCtx, pCsr->zToken, pCsr->nToken, SQLITE_TRANSIENT); break; case 2: sqlite3_result_int(pCtx, pCsr->iStart); break; case 3: sqlite3_result_int(pCtx, pCsr->iEnd); break; default: assert( iCol==4 ); sqlite3_result_int(pCtx, pCsr->iPos); break; } return SQLITE_OK; } /* ** xRowid - Return the current rowid for the cursor. */ static int fts3tokRowidMethod( sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ sqlite_int64 *pRowid /* OUT: Rowid value */ ){ Fts3tokCursor *pCsr = (Fts3tokCursor *)pCursor; *pRowid = (sqlite3_int64)pCsr->iRowid; return SQLITE_OK; } /* ** Register the fts3tok module with database connection db. Return SQLITE_OK ** if successful or an error code if sqlite3_create_module() fails. */ int sqlite3Fts3InitTok(sqlite3 *db, Fts3Hash *pHash){ static const sqlite3_module fts3tok_module = { 0, /* iVersion */ fts3tokConnectMethod, /* xCreate */ fts3tokConnectMethod, /* xConnect */ fts3tokBestIndexMethod, /* xBestIndex */ fts3tokDisconnectMethod, /* xDisconnect */ fts3tokDisconnectMethod, /* xDestroy */ fts3tokOpenMethod, /* xOpen */ fts3tokCloseMethod, /* xClose */ fts3tokFilterMethod, /* xFilter */ fts3tokNextMethod, /* xNext */ fts3tokEofMethod, /* xEof */ fts3tokColumnMethod, /* xColumn */ fts3tokRowidMethod, /* xRowid */ 0, /* xUpdate */ 0, /* xBegin */ 0, /* xSync */ 0, /* xCommit */ 0, /* xRollback */ 0, /* xFindFunction */ 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ 0 /* xRollbackTo */ }; int rc; /* Return code */ rc = sqlite3_create_module(db, "fts3tokenize", &fts3tok_module, (void*)pHash); return rc; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_tokenizer.c ================================================ /* ** 2007 June 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This is part of an SQLite module implementing full-text search. ** This particular file implements the generic tokenizer interface. */ /* ** The code in this file is only compiled if: ** ** * The FTS3 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS3 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS3 is defined). */ #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) #include #include /* ** Return true if the two-argument version of fts3_tokenizer() ** has been activated via a prior call to sqlite3_db_config(db, ** SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, 0); */ static int fts3TokenizerEnabled(sqlite3_context *context){ sqlite3 *db = sqlite3_context_db_handle(context); int isEnabled = 0; sqlite3_db_config(db,SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER,-1,&isEnabled); return isEnabled; } /* ** Implementation of the SQL scalar function for accessing the underlying ** hash table. This function may be called as follows: ** ** SELECT (); ** SELECT (, ); ** ** where is the name passed as the second argument ** to the sqlite3Fts3InitHashTable() function (e.g. 'fts3_tokenizer'). ** ** If the argument is specified, it must be a blob value ** containing a pointer to be stored as the hash data corresponding ** to the string . If is not specified, then ** the string must already exist in the has table. Otherwise, ** an error is returned. ** ** Whether or not the argument is specified, the value returned ** is a blob containing the pointer stored as the hash data corresponding ** to string (after the hash-table is updated, if applicable). */ static void fts3TokenizerFunc( sqlite3_context *context, int argc, sqlite3_value **argv ){ Fts3Hash *pHash; void *pPtr = 0; const unsigned char *zName; int nName; assert( argc==1 || argc==2 ); pHash = (Fts3Hash *)sqlite3_user_data(context); zName = sqlite3_value_text(argv[0]); nName = sqlite3_value_bytes(argv[0])+1; if( argc==2 ){ if( fts3TokenizerEnabled(context) ){ void *pOld; int n = sqlite3_value_bytes(argv[1]); if( zName==0 || n!=sizeof(pPtr) ){ sqlite3_result_error(context, "argument type mismatch", -1); return; } pPtr = *(void **)sqlite3_value_blob(argv[1]); pOld = sqlite3Fts3HashInsert(pHash, (void *)zName, nName, pPtr); if( pOld==pPtr ){ sqlite3_result_error(context, "out of memory", -1); } }else{ sqlite3_result_error(context, "fts3tokenize disabled", -1); return; } }else{ if( zName ){ pPtr = sqlite3Fts3HashFind(pHash, zName, nName); } if( !pPtr ){ char *zErr = sqlite3_mprintf("unknown tokenizer: %s", zName); sqlite3_result_error(context, zErr, -1); sqlite3_free(zErr); return; } } sqlite3_result_blob(context, (void *)&pPtr, sizeof(pPtr), SQLITE_TRANSIENT); } int sqlite3Fts3IsIdChar(char c){ static const char isFtsIdChar[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 1x */ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 3x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 7x */ }; return (c&0x80 || isFtsIdChar[(int)(c)]); } const char *sqlite3Fts3NextToken(const char *zStr, int *pn){ const char *z1; const char *z2 = 0; /* Find the start of the next token. */ z1 = zStr; while( z2==0 ){ char c = *z1; switch( c ){ case '\0': return 0; /* No more tokens here */ case '\'': case '"': case '`': { z2 = z1; while( *++z2 && (*z2!=c || *++z2==c) ); break; } case '[': z2 = &z1[1]; while( *z2 && z2[0]!=']' ) z2++; if( *z2 ) z2++; break; default: if( sqlite3Fts3IsIdChar(*z1) ){ z2 = &z1[1]; while( sqlite3Fts3IsIdChar(*z2) ) z2++; }else{ z1++; } } } *pn = (int)(z2-z1); return z1; } int sqlite3Fts3InitTokenizer( Fts3Hash *pHash, /* Tokenizer hash table */ const char *zArg, /* Tokenizer name */ sqlite3_tokenizer **ppTok, /* OUT: Tokenizer (if applicable) */ char **pzErr /* OUT: Set to malloced error message */ ){ int rc; char *z = (char *)zArg; int n = 0; char *zCopy; char *zEnd; /* Pointer to nul-term of zCopy */ sqlite3_tokenizer_module *m; zCopy = sqlite3_mprintf("%s", zArg); if( !zCopy ) return SQLITE_NOMEM; zEnd = &zCopy[strlen(zCopy)]; z = (char *)sqlite3Fts3NextToken(zCopy, &n); if( z==0 ){ assert( n==0 ); z = zCopy; } z[n] = '\0'; sqlite3Fts3Dequote(z); m = (sqlite3_tokenizer_module *)sqlite3Fts3HashFind(pHash,z,(int)strlen(z)+1); if( !m ){ sqlite3Fts3ErrMsg(pzErr, "unknown tokenizer: %s", z); rc = SQLITE_ERROR; }else{ char const **aArg = 0; int iArg = 0; z = &z[n+1]; while( zxCreate(iArg, aArg, ppTok); assert( rc!=SQLITE_OK || *ppTok ); if( rc!=SQLITE_OK ){ sqlite3Fts3ErrMsg(pzErr, "unknown tokenizer"); }else{ (*ppTok)->pModule = m; } sqlite3_free((void *)aArg); } sqlite3_free(zCopy); return rc; } #ifdef SQLITE_TEST #if defined(INCLUDE_SQLITE_TCL_H) # include "sqlite_tcl.h" #else # include "tcl.h" #endif #include /* ** Implementation of a special SQL scalar function for testing tokenizers ** designed to be used in concert with the Tcl testing framework. This ** function must be called with two or more arguments: ** ** SELECT (, ..., ); ** ** where is the name passed as the second argument ** to the sqlite3Fts3InitHashTable() function (e.g. 'fts3_tokenizer') ** concatenated with the string '_test' (e.g. 'fts3_tokenizer_test'). ** ** The return value is a string that may be interpreted as a Tcl ** list. For each token in the , three elements are ** added to the returned list. The first is the token position, the ** second is the token text (folded, stemmed, etc.) and the third is the ** substring of associated with the token. For example, ** using the built-in "simple" tokenizer: ** ** SELECT fts_tokenizer_test('simple', 'I don't see how'); ** ** will return the string: ** ** "{0 i I 1 dont don't 2 see see 3 how how}" ** */ static void testFunc( sqlite3_context *context, int argc, sqlite3_value **argv ){ Fts3Hash *pHash; sqlite3_tokenizer_module *p; sqlite3_tokenizer *pTokenizer = 0; sqlite3_tokenizer_cursor *pCsr = 0; const char *zErr = 0; const char *zName; int nName; const char *zInput; int nInput; const char *azArg[64]; const char *zToken; int nToken = 0; int iStart = 0; int iEnd = 0; int iPos = 0; int i; Tcl_Obj *pRet; if( argc<2 ){ sqlite3_result_error(context, "insufficient arguments", -1); return; } nName = sqlite3_value_bytes(argv[0]); zName = (const char *)sqlite3_value_text(argv[0]); nInput = sqlite3_value_bytes(argv[argc-1]); zInput = (const char *)sqlite3_value_text(argv[argc-1]); pHash = (Fts3Hash *)sqlite3_user_data(context); p = (sqlite3_tokenizer_module *)sqlite3Fts3HashFind(pHash, zName, nName+1); if( !p ){ char *zErr2 = sqlite3_mprintf("unknown tokenizer: %s", zName); sqlite3_result_error(context, zErr2, -1); sqlite3_free(zErr2); return; } pRet = Tcl_NewObj(); Tcl_IncrRefCount(pRet); for(i=1; ixCreate(argc-2, azArg, &pTokenizer) ){ zErr = "error in xCreate()"; goto finish; } pTokenizer->pModule = p; if( sqlite3Fts3OpenTokenizer(pTokenizer, 0, zInput, nInput, &pCsr) ){ zErr = "error in xOpen()"; goto finish; } while( SQLITE_OK==p->xNext(pCsr, &zToken, &nToken, &iStart, &iEnd, &iPos) ){ Tcl_ListObjAppendElement(0, pRet, Tcl_NewIntObj(iPos)); Tcl_ListObjAppendElement(0, pRet, Tcl_NewStringObj(zToken, nToken)); zToken = &zInput[iStart]; nToken = iEnd-iStart; Tcl_ListObjAppendElement(0, pRet, Tcl_NewStringObj(zToken, nToken)); } if( SQLITE_OK!=p->xClose(pCsr) ){ zErr = "error in xClose()"; goto finish; } if( SQLITE_OK!=p->xDestroy(pTokenizer) ){ zErr = "error in xDestroy()"; goto finish; } finish: if( zErr ){ sqlite3_result_error(context, zErr, -1); }else{ sqlite3_result_text(context, Tcl_GetString(pRet), -1, SQLITE_TRANSIENT); } Tcl_DecrRefCount(pRet); } static int registerTokenizer( sqlite3 *db, char *zName, const sqlite3_tokenizer_module *p ){ int rc; sqlite3_stmt *pStmt; const char zSql[] = "SELECT fts3_tokenizer(?, ?)"; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ return rc; } sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); sqlite3_bind_blob(pStmt, 2, &p, sizeof(p), SQLITE_STATIC); sqlite3_step(pStmt); return sqlite3_finalize(pStmt); } static int queryTokenizer( sqlite3 *db, char *zName, const sqlite3_tokenizer_module **pp ){ int rc; sqlite3_stmt *pStmt; const char zSql[] = "SELECT fts3_tokenizer(?)"; *pp = 0; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ return rc; } sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); if( SQLITE_ROW==sqlite3_step(pStmt) ){ if( sqlite3_column_type(pStmt, 0)==SQLITE_BLOB ){ memcpy((void *)pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp)); } } return sqlite3_finalize(pStmt); } void sqlite3Fts3SimpleTokenizerModule(sqlite3_tokenizer_module const**ppModule); /* ** Implementation of the scalar function fts3_tokenizer_internal_test(). ** This function is used for testing only, it is not included in the ** build unless SQLITE_TEST is defined. ** ** The purpose of this is to test that the fts3_tokenizer() function ** can be used as designed by the C-code in the queryTokenizer and ** registerTokenizer() functions above. These two functions are repeated ** in the README.tokenizer file as an example, so it is important to ** test them. ** ** To run the tests, evaluate the fts3_tokenizer_internal_test() scalar ** function with no arguments. An assert() will fail if a problem is ** detected. i.e.: ** ** SELECT fts3_tokenizer_internal_test(); ** */ static void intTestFunc( sqlite3_context *context, int argc, sqlite3_value **argv ){ int rc; const sqlite3_tokenizer_module *p1; const sqlite3_tokenizer_module *p2; sqlite3 *db = (sqlite3 *)sqlite3_user_data(context); UNUSED_PARAMETER(argc); UNUSED_PARAMETER(argv); /* Test the query function */ sqlite3Fts3SimpleTokenizerModule(&p1); rc = queryTokenizer(db, "simple", &p2); assert( rc==SQLITE_OK ); assert( p1==p2 ); rc = queryTokenizer(db, "nosuchtokenizer", &p2); assert( rc==SQLITE_ERROR ); assert( p2==0 ); assert( 0==strcmp(sqlite3_errmsg(db), "unknown tokenizer: nosuchtokenizer") ); /* Test the storage function */ if( fts3TokenizerEnabled(context) ){ rc = registerTokenizer(db, "nosuchtokenizer", p1); assert( rc==SQLITE_OK ); rc = queryTokenizer(db, "nosuchtokenizer", &p2); assert( rc==SQLITE_OK ); assert( p2==p1 ); } sqlite3_result_text(context, "ok", -1, SQLITE_STATIC); } #endif /* ** Set up SQL objects in database db used to access the contents of ** the hash table pointed to by argument pHash. The hash table must ** been initialized to use string keys, and to take a private copy ** of the key when a value is inserted. i.e. by a call similar to: ** ** sqlite3Fts3HashInit(pHash, FTS3_HASH_STRING, 1); ** ** This function adds a scalar function (see header comment above ** fts3TokenizerFunc() in this file for details) and, if ENABLE_TABLE is ** defined at compilation time, a temporary virtual table (see header ** comment above struct HashTableVtab) to the database schema. Both ** provide read/write access to the contents of *pHash. ** ** The third argument to this function, zName, is used as the name ** of both the scalar and, if created, the virtual table. */ int sqlite3Fts3InitHashTable( sqlite3 *db, Fts3Hash *pHash, const char *zName ){ int rc = SQLITE_OK; void *p = (void *)pHash; const int any = SQLITE_ANY; #ifdef SQLITE_TEST char *zTest = 0; char *zTest2 = 0; void *pdb = (void *)db; zTest = sqlite3_mprintf("%s_test", zName); zTest2 = sqlite3_mprintf("%s_internal_test", zName); if( !zTest || !zTest2 ){ rc = SQLITE_NOMEM; } #endif if( SQLITE_OK==rc ){ rc = sqlite3_create_function(db, zName, 1, any, p, fts3TokenizerFunc, 0, 0); } if( SQLITE_OK==rc ){ rc = sqlite3_create_function(db, zName, 2, any, p, fts3TokenizerFunc, 0, 0); } #ifdef SQLITE_TEST if( SQLITE_OK==rc ){ rc = sqlite3_create_function(db, zTest, -1, any, p, testFunc, 0, 0); } if( SQLITE_OK==rc ){ rc = sqlite3_create_function(db, zTest2, 0, any, pdb, intTestFunc, 0, 0); } #endif #ifdef SQLITE_TEST sqlite3_free(zTest); sqlite3_free(zTest2); #endif return rc; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_tokenizer.h ================================================ /* ** 2006 July 10 ** ** The author disclaims copyright to this source code. ** ************************************************************************* ** Defines the interface to tokenizers used by fulltext-search. There ** are three basic components: ** ** sqlite3_tokenizer_module is a singleton defining the tokenizer ** interface functions. This is essentially the class structure for ** tokenizers. ** ** sqlite3_tokenizer is used to define a particular tokenizer, perhaps ** including customization information defined at creation time. ** ** sqlite3_tokenizer_cursor is generated by a tokenizer to generate ** tokens from a particular input. */ #ifndef _FTS3_TOKENIZER_H_ #define _FTS3_TOKENIZER_H_ /* TODO(shess) Only used for SQLITE_OK and SQLITE_DONE at this time. ** If tokenizers are to be allowed to call sqlite3_*() functions, then ** we will need a way to register the API consistently. */ #include "sqlite3.h" /* ** Structures used by the tokenizer interface. When a new tokenizer ** implementation is registered, the caller provides a pointer to ** an sqlite3_tokenizer_module containing pointers to the callback ** functions that make up an implementation. ** ** When an fts3 table is created, it passes any arguments passed to ** the tokenizer clause of the CREATE VIRTUAL TABLE statement to the ** sqlite3_tokenizer_module.xCreate() function of the requested tokenizer ** implementation. The xCreate() function in turn returns an ** sqlite3_tokenizer structure representing the specific tokenizer to ** be used for the fts3 table (customized by the tokenizer clause arguments). ** ** To tokenize an input buffer, the sqlite3_tokenizer_module.xOpen() ** method is called. It returns an sqlite3_tokenizer_cursor object ** that may be used to tokenize a specific input buffer based on ** the tokenization rules supplied by a specific sqlite3_tokenizer ** object. */ typedef struct sqlite3_tokenizer_module sqlite3_tokenizer_module; typedef struct sqlite3_tokenizer sqlite3_tokenizer; typedef struct sqlite3_tokenizer_cursor sqlite3_tokenizer_cursor; struct sqlite3_tokenizer_module { /* ** Structure version. Should always be set to 0 or 1. */ int iVersion; /* ** Create a new tokenizer. The values in the argv[] array are the ** arguments passed to the "tokenizer" clause of the CREATE VIRTUAL ** TABLE statement that created the fts3 table. For example, if ** the following SQL is executed: ** ** CREATE .. USING fts3( ... , tokenizer arg1 arg2) ** ** then argc is set to 2, and the argv[] array contains pointers ** to the strings "arg1" and "arg2". ** ** This method should return either SQLITE_OK (0), or an SQLite error ** code. If SQLITE_OK is returned, then *ppTokenizer should be set ** to point at the newly created tokenizer structure. The generic ** sqlite3_tokenizer.pModule variable should not be initialized by ** this callback. The caller will do so. */ int (*xCreate)( int argc, /* Size of argv array */ const char *const*argv, /* Tokenizer argument strings */ sqlite3_tokenizer **ppTokenizer /* OUT: Created tokenizer */ ); /* ** Destroy an existing tokenizer. The fts3 module calls this method ** exactly once for each successful call to xCreate(). */ int (*xDestroy)(sqlite3_tokenizer *pTokenizer); /* ** Create a tokenizer cursor to tokenize an input buffer. The caller ** is responsible for ensuring that the input buffer remains valid ** until the cursor is closed (using the xClose() method). */ int (*xOpen)( sqlite3_tokenizer *pTokenizer, /* Tokenizer object */ const char *pInput, int nBytes, /* Input buffer */ sqlite3_tokenizer_cursor **ppCursor /* OUT: Created tokenizer cursor */ ); /* ** Destroy an existing tokenizer cursor. The fts3 module calls this ** method exactly once for each successful call to xOpen(). */ int (*xClose)(sqlite3_tokenizer_cursor *pCursor); /* ** Retrieve the next token from the tokenizer cursor pCursor. This ** method should either return SQLITE_OK and set the values of the ** "OUT" variables identified below, or SQLITE_DONE to indicate that ** the end of the buffer has been reached, or an SQLite error code. ** ** *ppToken should be set to point at a buffer containing the ** normalized version of the token (i.e. after any case-folding and/or ** stemming has been performed). *pnBytes should be set to the length ** of this buffer in bytes. The input text that generated the token is ** identified by the byte offsets returned in *piStartOffset and ** *piEndOffset. *piStartOffset should be set to the index of the first ** byte of the token in the input buffer. *piEndOffset should be set ** to the index of the first byte just past the end of the token in ** the input buffer. ** ** The buffer *ppToken is set to point at is managed by the tokenizer ** implementation. It is only required to be valid until the next call ** to xNext() or xClose(). */ /* TODO(shess) current implementation requires pInput to be ** nul-terminated. This should either be fixed, or pInput/nBytes ** should be converted to zInput. */ int (*xNext)( sqlite3_tokenizer_cursor *pCursor, /* Tokenizer cursor */ const char **ppToken, int *pnBytes, /* OUT: Normalized text for token */ int *piStartOffset, /* OUT: Byte offset of token in input buffer */ int *piEndOffset, /* OUT: Byte offset of end of token in input buffer */ int *piPosition /* OUT: Number of tokens returned before this one */ ); /*********************************************************************** ** Methods below this point are only available if iVersion>=1. */ /* ** Configure the language id of a tokenizer cursor. */ int (*xLanguageid)(sqlite3_tokenizer_cursor *pCsr, int iLangid); }; struct sqlite3_tokenizer { const sqlite3_tokenizer_module *pModule; /* The module for this tokenizer */ /* Tokenizer implementations will typically add additional fields */ }; struct sqlite3_tokenizer_cursor { sqlite3_tokenizer *pTokenizer; /* Tokenizer for this cursor. */ /* Tokenizer implementations will typically add additional fields */ }; int fts3_global_term_cnt(int iTerm, int iCol); int fts3_term_cnt(int iTerm, int iCol); #endif /* _FTS3_TOKENIZER_H_ */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_tokenizer1.c ================================================ /* ** 2006 Oct 10 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** Implementation of the "simple" full-text-search tokenizer. */ /* ** The code in this file is only compiled if: ** ** * The FTS3 module is being built as an extension ** (in which case SQLITE_CORE is not defined), or ** ** * The FTS3 module is being built into the core of ** SQLite (in which case SQLITE_ENABLE_FTS3 is defined). */ #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) #include #include #include #include #include "fts3_tokenizer.h" typedef struct simple_tokenizer { sqlite3_tokenizer base; char delim[128]; /* flag ASCII delimiters */ } simple_tokenizer; typedef struct simple_tokenizer_cursor { sqlite3_tokenizer_cursor base; const char *pInput; /* input we are tokenizing */ int nBytes; /* size of the input */ int iOffset; /* current position in pInput */ int iToken; /* index of next token to be returned */ char *pToken; /* storage for current token */ int nTokenAllocated; /* space allocated to zToken buffer */ } simple_tokenizer_cursor; static int simpleDelim(simple_tokenizer *t, unsigned char c){ return c<0x80 && t->delim[c]; } static int fts3_isalnum(int x){ return (x>='0' && x<='9') || (x>='A' && x<='Z') || (x>='a' && x<='z'); } /* ** Create a new tokenizer instance. */ static int simpleCreate( int argc, const char * const *argv, sqlite3_tokenizer **ppTokenizer ){ simple_tokenizer *t; t = (simple_tokenizer *) sqlite3_malloc(sizeof(*t)); if( t==NULL ) return SQLITE_NOMEM; memset(t, 0, sizeof(*t)); /* TODO(shess) Delimiters need to remain the same from run to run, ** else we need to reindex. One solution would be a meta-table to ** track such information in the database, then we'd only want this ** information on the initial create. */ if( argc>1 ){ int i, n = (int)strlen(argv[1]); for(i=0; i=0x80 ){ sqlite3_free(t); return SQLITE_ERROR; } t->delim[ch] = 1; } } else { /* Mark non-alphanumeric ASCII characters as delimiters */ int i; for(i=1; i<0x80; i++){ t->delim[i] = !fts3_isalnum(i) ? -1 : 0; } } *ppTokenizer = &t->base; return SQLITE_OK; } /* ** Destroy a tokenizer */ static int simpleDestroy(sqlite3_tokenizer *pTokenizer){ sqlite3_free(pTokenizer); return SQLITE_OK; } /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is pInput[0..nBytes-1]. A cursor ** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int simpleOpen( sqlite3_tokenizer *pTokenizer, /* The tokenizer */ const char *pInput, int nBytes, /* String to be tokenized */ sqlite3_tokenizer_cursor **ppCursor /* OUT: Tokenization cursor */ ){ simple_tokenizer_cursor *c; UNUSED_PARAMETER(pTokenizer); c = (simple_tokenizer_cursor *) sqlite3_malloc(sizeof(*c)); if( c==NULL ) return SQLITE_NOMEM; c->pInput = pInput; if( pInput==0 ){ c->nBytes = 0; }else if( nBytes<0 ){ c->nBytes = (int)strlen(pInput); }else{ c->nBytes = nBytes; } c->iOffset = 0; /* start tokenizing at the beginning */ c->iToken = 0; c->pToken = NULL; /* no space allocated, yet. */ c->nTokenAllocated = 0; *ppCursor = &c->base; return SQLITE_OK; } /* ** Close a tokenization cursor previously opened by a call to ** simpleOpen() above. */ static int simpleClose(sqlite3_tokenizer_cursor *pCursor){ simple_tokenizer_cursor *c = (simple_tokenizer_cursor *) pCursor; sqlite3_free(c->pToken); sqlite3_free(c); return SQLITE_OK; } /* ** Extract the next token from a tokenization cursor. The cursor must ** have been opened by a prior call to simpleOpen(). */ static int simpleNext( sqlite3_tokenizer_cursor *pCursor, /* Cursor returned by simpleOpen */ const char **ppToken, /* OUT: *ppToken is the token text */ int *pnBytes, /* OUT: Number of bytes in token */ int *piStartOffset, /* OUT: Starting offset of token */ int *piEndOffset, /* OUT: Ending offset of token */ int *piPosition /* OUT: Position integer of token */ ){ simple_tokenizer_cursor *c = (simple_tokenizer_cursor *) pCursor; simple_tokenizer *t = (simple_tokenizer *) pCursor->pTokenizer; unsigned char *p = (unsigned char *)c->pInput; while( c->iOffsetnBytes ){ int iStartOffset; /* Scan past delimiter characters */ while( c->iOffsetnBytes && simpleDelim(t, p[c->iOffset]) ){ c->iOffset++; } /* Count non-delimiter characters. */ iStartOffset = c->iOffset; while( c->iOffsetnBytes && !simpleDelim(t, p[c->iOffset]) ){ c->iOffset++; } if( c->iOffset>iStartOffset ){ int i, n = c->iOffset-iStartOffset; if( n>c->nTokenAllocated ){ char *pNew; c->nTokenAllocated = n+20; pNew = sqlite3_realloc(c->pToken, c->nTokenAllocated); if( !pNew ) return SQLITE_NOMEM; c->pToken = pNew; } for(i=0; ipToken[i] = (char)((ch>='A' && ch<='Z') ? ch-'A'+'a' : ch); } *ppToken = c->pToken; *pnBytes = n; *piStartOffset = iStartOffset; *piEndOffset = c->iOffset; *piPosition = c->iToken++; return SQLITE_OK; } } return SQLITE_DONE; } /* ** The set of routines that implement the simple tokenizer */ static const sqlite3_tokenizer_module simpleTokenizerModule = { 0, simpleCreate, simpleDestroy, simpleOpen, simpleClose, simpleNext, 0, }; /* ** Allocate a new simple tokenizer. Return a pointer to the new ** tokenizer in *ppModule */ void sqlite3Fts3SimpleTokenizerModule( sqlite3_tokenizer_module const**ppModule ){ *ppModule = &simpleTokenizerModule; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_unicode.c ================================================ /* ** 2012 May 24 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** Implementation of the "unicode" full-text-search tokenizer. */ #ifndef SQLITE_DISABLE_FTS3_UNICODE #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) #include #include #include #include #include "fts3_tokenizer.h" /* ** The following two macros - READ_UTF8 and WRITE_UTF8 - have been copied ** from the sqlite3 source file utf.c. If this file is compiled as part ** of the amalgamation, they are not required. */ #ifndef SQLITE_AMALGAMATION static const unsigned char sqlite3Utf8Trans1[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x00, 0x00, }; #define READ_UTF8(zIn, zTerm, c) \ c = *(zIn++); \ if( c>=0xc0 ){ \ c = sqlite3Utf8Trans1[c-0xc0]; \ while( zIn!=zTerm && (*zIn & 0xc0)==0x80 ){ \ c = (c<<6) + (0x3f & *(zIn++)); \ } \ if( c<0x80 \ || (c&0xFFFFF800)==0xD800 \ || (c&0xFFFFFFFE)==0xFFFE ){ c = 0xFFFD; } \ } #define WRITE_UTF8(zOut, c) { \ if( c<0x00080 ){ \ *zOut++ = (u8)(c&0xFF); \ } \ else if( c<0x00800 ){ \ *zOut++ = 0xC0 + (u8)((c>>6)&0x1F); \ *zOut++ = 0x80 + (u8)(c & 0x3F); \ } \ else if( c<0x10000 ){ \ *zOut++ = 0xE0 + (u8)((c>>12)&0x0F); \ *zOut++ = 0x80 + (u8)((c>>6) & 0x3F); \ *zOut++ = 0x80 + (u8)(c & 0x3F); \ }else{ \ *zOut++ = 0xF0 + (u8)((c>>18) & 0x07); \ *zOut++ = 0x80 + (u8)((c>>12) & 0x3F); \ *zOut++ = 0x80 + (u8)((c>>6) & 0x3F); \ *zOut++ = 0x80 + (u8)(c & 0x3F); \ } \ } #endif /* ifndef SQLITE_AMALGAMATION */ typedef struct unicode_tokenizer unicode_tokenizer; typedef struct unicode_cursor unicode_cursor; struct unicode_tokenizer { sqlite3_tokenizer base; int bRemoveDiacritic; int nException; int *aiException; }; struct unicode_cursor { sqlite3_tokenizer_cursor base; const unsigned char *aInput; /* Input text being tokenized */ int nInput; /* Size of aInput[] in bytes */ int iOff; /* Current offset within aInput[] */ int iToken; /* Index of next token to be returned */ char *zToken; /* storage for current token */ int nAlloc; /* space allocated at zToken */ }; /* ** Destroy a tokenizer allocated by unicodeCreate(). */ static int unicodeDestroy(sqlite3_tokenizer *pTokenizer){ if( pTokenizer ){ unicode_tokenizer *p = (unicode_tokenizer *)pTokenizer; sqlite3_free(p->aiException); sqlite3_free(p); } return SQLITE_OK; } /* ** As part of a tokenchars= or separators= option, the CREATE VIRTUAL TABLE ** statement has specified that the tokenizer for this table shall consider ** all characters in string zIn/nIn to be separators (if bAlnum==0) or ** token characters (if bAlnum==1). ** ** For each codepoint in the zIn/nIn string, this function checks if the ** sqlite3FtsUnicodeIsalnum() function already returns the desired result. ** If so, no action is taken. Otherwise, the codepoint is added to the ** unicode_tokenizer.aiException[] array. For the purposes of tokenization, ** the return value of sqlite3FtsUnicodeIsalnum() is inverted for all ** codepoints in the aiException[] array. ** ** If a standalone diacritic mark (one that sqlite3FtsUnicodeIsdiacritic() ** identifies as a diacritic) occurs in the zIn/nIn string it is ignored. ** It is not possible to change the behavior of the tokenizer with respect ** to these codepoints. */ static int unicodeAddExceptions( unicode_tokenizer *p, /* Tokenizer to add exceptions to */ int bAlnum, /* Replace Isalnum() return value with this */ const char *zIn, /* Array of characters to make exceptions */ int nIn /* Length of z in bytes */ ){ const unsigned char *z = (const unsigned char *)zIn; const unsigned char *zTerm = &z[nIn]; unsigned int iCode; int nEntry = 0; assert( bAlnum==0 || bAlnum==1 ); while( zaiException, (p->nException+nEntry)*sizeof(int)); if( aNew==0 ) return SQLITE_NOMEM; nNew = p->nException; z = (const unsigned char *)zIn; while( zi; j--) aNew[j] = aNew[j-1]; aNew[i] = (int)iCode; nNew++; } } p->aiException = aNew; p->nException = nNew; } return SQLITE_OK; } /* ** Return true if the p->aiException[] array contains the value iCode. */ static int unicodeIsException(unicode_tokenizer *p, int iCode){ if( p->nException>0 ){ int *a = p->aiException; int iLo = 0; int iHi = p->nException-1; while( iHi>=iLo ){ int iTest = (iHi + iLo) / 2; if( iCode==a[iTest] ){ return 1; }else if( iCode>a[iTest] ){ iLo = iTest+1; }else{ iHi = iTest-1; } } } return 0; } /* ** Return true if, for the purposes of tokenization, codepoint iCode is ** considered a token character (not a separator). */ static int unicodeIsAlnum(unicode_tokenizer *p, int iCode){ assert( (sqlite3FtsUnicodeIsalnum(iCode) & 0xFFFFFFFE)==0 ); return sqlite3FtsUnicodeIsalnum(iCode) ^ unicodeIsException(p, iCode); } /* ** Create a new tokenizer instance. */ static int unicodeCreate( int nArg, /* Size of array argv[] */ const char * const *azArg, /* Tokenizer creation arguments */ sqlite3_tokenizer **pp /* OUT: New tokenizer handle */ ){ unicode_tokenizer *pNew; /* New tokenizer object */ int i; int rc = SQLITE_OK; pNew = (unicode_tokenizer *) sqlite3_malloc(sizeof(unicode_tokenizer)); if( pNew==NULL ) return SQLITE_NOMEM; memset(pNew, 0, sizeof(unicode_tokenizer)); pNew->bRemoveDiacritic = 1; for(i=0; rc==SQLITE_OK && ibRemoveDiacritic = 1; } else if( n==19 && memcmp("remove_diacritics=0", z, 19)==0 ){ pNew->bRemoveDiacritic = 0; } else if( n>=11 && memcmp("tokenchars=", z, 11)==0 ){ rc = unicodeAddExceptions(pNew, 1, &z[11], n-11); } else if( n>=11 && memcmp("separators=", z, 11)==0 ){ rc = unicodeAddExceptions(pNew, 0, &z[11], n-11); } else{ /* Unrecognized argument */ rc = SQLITE_ERROR; } } if( rc!=SQLITE_OK ){ unicodeDestroy((sqlite3_tokenizer *)pNew); pNew = 0; } *pp = (sqlite3_tokenizer *)pNew; return rc; } /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is pInput[0..nBytes-1]. A cursor ** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int unicodeOpen( sqlite3_tokenizer *p, /* The tokenizer */ const char *aInput, /* Input string */ int nInput, /* Size of string aInput in bytes */ sqlite3_tokenizer_cursor **pp /* OUT: New cursor object */ ){ unicode_cursor *pCsr; pCsr = (unicode_cursor *)sqlite3_malloc(sizeof(unicode_cursor)); if( pCsr==0 ){ return SQLITE_NOMEM; } memset(pCsr, 0, sizeof(unicode_cursor)); pCsr->aInput = (const unsigned char *)aInput; if( aInput==0 ){ pCsr->nInput = 0; }else if( nInput<0 ){ pCsr->nInput = (int)strlen(aInput); }else{ pCsr->nInput = nInput; } *pp = &pCsr->base; UNUSED_PARAMETER(p); return SQLITE_OK; } /* ** Close a tokenization cursor previously opened by a call to ** simpleOpen() above. */ static int unicodeClose(sqlite3_tokenizer_cursor *pCursor){ unicode_cursor *pCsr = (unicode_cursor *) pCursor; sqlite3_free(pCsr->zToken); sqlite3_free(pCsr); return SQLITE_OK; } /* ** Extract the next token from a tokenization cursor. The cursor must ** have been opened by a prior call to simpleOpen(). */ static int unicodeNext( sqlite3_tokenizer_cursor *pC, /* Cursor returned by simpleOpen */ const char **paToken, /* OUT: Token text */ int *pnToken, /* OUT: Number of bytes at *paToken */ int *piStart, /* OUT: Starting offset of token */ int *piEnd, /* OUT: Ending offset of token */ int *piPos /* OUT: Position integer of token */ ){ unicode_cursor *pCsr = (unicode_cursor *)pC; unicode_tokenizer *p = ((unicode_tokenizer *)pCsr->base.pTokenizer); unsigned int iCode = 0; char *zOut; const unsigned char *z = &pCsr->aInput[pCsr->iOff]; const unsigned char *zStart = z; const unsigned char *zEnd; const unsigned char *zTerm = &pCsr->aInput[pCsr->nInput]; /* Scan past any delimiter characters before the start of the next token. ** Return SQLITE_DONE early if this takes us all the way to the end of ** the input. */ while( z=zTerm ) return SQLITE_DONE; zOut = pCsr->zToken; do { int iOut; /* Grow the output buffer if required. */ if( (zOut-pCsr->zToken)>=(pCsr->nAlloc-4) ){ char *zNew = sqlite3_realloc(pCsr->zToken, pCsr->nAlloc+64); if( !zNew ) return SQLITE_NOMEM; zOut = &zNew[zOut - pCsr->zToken]; pCsr->zToken = zNew; pCsr->nAlloc += 64; } /* Write the folded case of the last character read to the output */ zEnd = z; iOut = sqlite3FtsUnicodeFold((int)iCode, p->bRemoveDiacritic); if( iOut ){ WRITE_UTF8(zOut, iOut); } /* If the cursor is not at EOF, read the next character */ if( z>=zTerm ) break; READ_UTF8(z, zTerm, iCode); }while( unicodeIsAlnum(p, (int)iCode) || sqlite3FtsUnicodeIsdiacritic((int)iCode) ); /* Set the output variables and return. */ pCsr->iOff = (int)(z - pCsr->aInput); *paToken = pCsr->zToken; *pnToken = (int)(zOut - pCsr->zToken); *piStart = (int)(zStart - pCsr->aInput); *piEnd = (int)(zEnd - pCsr->aInput); *piPos = pCsr->iToken++; return SQLITE_OK; } /* ** Set *ppModule to a pointer to the sqlite3_tokenizer_module ** structure for the unicode tokenizer. */ void sqlite3Fts3UnicodeTokenizer(sqlite3_tokenizer_module const **ppModule){ static const sqlite3_tokenizer_module module = { 0, unicodeCreate, unicodeDestroy, unicodeOpen, unicodeClose, unicodeNext, 0, }; *ppModule = &module; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ #endif /* ifndef SQLITE_DISABLE_FTS3_UNICODE */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_unicode2.c ================================================ /* ** 2012 May 25 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** */ /* ** DO NOT EDIT THIS MACHINE GENERATED FILE. */ #ifndef SQLITE_DISABLE_FTS3_UNICODE #if defined(SQLITE_ENABLE_FTS3) || defined(SQLITE_ENABLE_FTS4) #include /* ** Return true if the argument corresponds to a unicode codepoint ** classified as either a letter or a number. Otherwise false. ** ** The results are undefined if the value passed to this function ** is less than zero. */ int sqlite3FtsUnicodeIsalnum(int c){ /* Each unsigned integer in the following array corresponds to a contiguous ** range of unicode codepoints that are not either letters or numbers (i.e. ** codepoints for which this function should return 0). ** ** The most significant 22 bits in each 32-bit value contain the first ** codepoint in the range. The least significant 10 bits are used to store ** the size of the range (always at least 1). In other words, the value ** ((C<<22) + N) represents a range of N codepoints starting with codepoint ** C. It is not possible to represent a range larger than 1023 codepoints ** using this format. */ static const unsigned int aEntry[] = { 0x00000030, 0x0000E807, 0x00016C06, 0x0001EC2F, 0x0002AC07, 0x0002D001, 0x0002D803, 0x0002EC01, 0x0002FC01, 0x00035C01, 0x0003DC01, 0x000B0804, 0x000B480E, 0x000B9407, 0x000BB401, 0x000BBC81, 0x000DD401, 0x000DF801, 0x000E1002, 0x000E1C01, 0x000FD801, 0x00120808, 0x00156806, 0x00162402, 0x00163C01, 0x00164437, 0x0017CC02, 0x00180005, 0x00181816, 0x00187802, 0x00192C15, 0x0019A804, 0x0019C001, 0x001B5001, 0x001B580F, 0x001B9C07, 0x001BF402, 0x001C000E, 0x001C3C01, 0x001C4401, 0x001CC01B, 0x001E980B, 0x001FAC09, 0x001FD804, 0x00205804, 0x00206C09, 0x00209403, 0x0020A405, 0x0020C00F, 0x00216403, 0x00217801, 0x0023901B, 0x00240004, 0x0024E803, 0x0024F812, 0x00254407, 0x00258804, 0x0025C001, 0x00260403, 0x0026F001, 0x0026F807, 0x00271C02, 0x00272C03, 0x00275C01, 0x00278802, 0x0027C802, 0x0027E802, 0x00280403, 0x0028F001, 0x0028F805, 0x00291C02, 0x00292C03, 0x00294401, 0x0029C002, 0x0029D401, 0x002A0403, 0x002AF001, 0x002AF808, 0x002B1C03, 0x002B2C03, 0x002B8802, 0x002BC002, 0x002C0403, 0x002CF001, 0x002CF807, 0x002D1C02, 0x002D2C03, 0x002D5802, 0x002D8802, 0x002DC001, 0x002E0801, 0x002EF805, 0x002F1803, 0x002F2804, 0x002F5C01, 0x002FCC08, 0x00300403, 0x0030F807, 0x00311803, 0x00312804, 0x00315402, 0x00318802, 0x0031FC01, 0x00320802, 0x0032F001, 0x0032F807, 0x00331803, 0x00332804, 0x00335402, 0x00338802, 0x00340802, 0x0034F807, 0x00351803, 0x00352804, 0x00355C01, 0x00358802, 0x0035E401, 0x00360802, 0x00372801, 0x00373C06, 0x00375801, 0x00376008, 0x0037C803, 0x0038C401, 0x0038D007, 0x0038FC01, 0x00391C09, 0x00396802, 0x003AC401, 0x003AD006, 0x003AEC02, 0x003B2006, 0x003C041F, 0x003CD00C, 0x003DC417, 0x003E340B, 0x003E6424, 0x003EF80F, 0x003F380D, 0x0040AC14, 0x00412806, 0x00415804, 0x00417803, 0x00418803, 0x00419C07, 0x0041C404, 0x0042080C, 0x00423C01, 0x00426806, 0x0043EC01, 0x004D740C, 0x004E400A, 0x00500001, 0x0059B402, 0x005A0001, 0x005A6C02, 0x005BAC03, 0x005C4803, 0x005CC805, 0x005D4802, 0x005DC802, 0x005ED023, 0x005F6004, 0x005F7401, 0x0060000F, 0x0062A401, 0x0064800C, 0x0064C00C, 0x00650001, 0x00651002, 0x0066C011, 0x00672002, 0x00677822, 0x00685C05, 0x00687802, 0x0069540A, 0x0069801D, 0x0069FC01, 0x006A8007, 0x006AA006, 0x006C0005, 0x006CD011, 0x006D6823, 0x006E0003, 0x006E840D, 0x006F980E, 0x006FF004, 0x00709014, 0x0070EC05, 0x0071F802, 0x00730008, 0x00734019, 0x0073B401, 0x0073C803, 0x00770027, 0x0077F004, 0x007EF401, 0x007EFC03, 0x007F3403, 0x007F7403, 0x007FB403, 0x007FF402, 0x00800065, 0x0081A806, 0x0081E805, 0x00822805, 0x0082801A, 0x00834021, 0x00840002, 0x00840C04, 0x00842002, 0x00845001, 0x00845803, 0x00847806, 0x00849401, 0x00849C01, 0x0084A401, 0x0084B801, 0x0084E802, 0x00850005, 0x00852804, 0x00853C01, 0x00864264, 0x00900027, 0x0091000B, 0x0092704E, 0x00940200, 0x009C0475, 0x009E53B9, 0x00AD400A, 0x00B39406, 0x00B3BC03, 0x00B3E404, 0x00B3F802, 0x00B5C001, 0x00B5FC01, 0x00B7804F, 0x00B8C00C, 0x00BA001A, 0x00BA6C59, 0x00BC00D6, 0x00BFC00C, 0x00C00005, 0x00C02019, 0x00C0A807, 0x00C0D802, 0x00C0F403, 0x00C26404, 0x00C28001, 0x00C3EC01, 0x00C64002, 0x00C6580A, 0x00C70024, 0x00C8001F, 0x00C8A81E, 0x00C94001, 0x00C98020, 0x00CA2827, 0x00CB003F, 0x00CC0100, 0x01370040, 0x02924037, 0x0293F802, 0x02983403, 0x0299BC10, 0x029A7C01, 0x029BC008, 0x029C0017, 0x029C8002, 0x029E2402, 0x02A00801, 0x02A01801, 0x02A02C01, 0x02A08C09, 0x02A0D804, 0x02A1D004, 0x02A20002, 0x02A2D011, 0x02A33802, 0x02A38012, 0x02A3E003, 0x02A4980A, 0x02A51C0D, 0x02A57C01, 0x02A60004, 0x02A6CC1B, 0x02A77802, 0x02A8A40E, 0x02A90C01, 0x02A93002, 0x02A97004, 0x02A9DC03, 0x02A9EC01, 0x02AAC001, 0x02AAC803, 0x02AADC02, 0x02AAF802, 0x02AB0401, 0x02AB7802, 0x02ABAC07, 0x02ABD402, 0x02AF8C0B, 0x03600001, 0x036DFC02, 0x036FFC02, 0x037FFC01, 0x03EC7801, 0x03ECA401, 0x03EEC810, 0x03F4F802, 0x03F7F002, 0x03F8001A, 0x03F88007, 0x03F8C023, 0x03F95013, 0x03F9A004, 0x03FBFC01, 0x03FC040F, 0x03FC6807, 0x03FCEC06, 0x03FD6C0B, 0x03FF8007, 0x03FFA007, 0x03FFE405, 0x04040003, 0x0404DC09, 0x0405E411, 0x0406400C, 0x0407402E, 0x040E7C01, 0x040F4001, 0x04215C01, 0x04247C01, 0x0424FC01, 0x04280403, 0x04281402, 0x04283004, 0x0428E003, 0x0428FC01, 0x04294009, 0x0429FC01, 0x042CE407, 0x04400003, 0x0440E016, 0x04420003, 0x0442C012, 0x04440003, 0x04449C0E, 0x04450004, 0x04460003, 0x0446CC0E, 0x04471404, 0x045AAC0D, 0x0491C004, 0x05BD442E, 0x05BE3C04, 0x074000F6, 0x07440027, 0x0744A4B5, 0x07480046, 0x074C0057, 0x075B0401, 0x075B6C01, 0x075BEC01, 0x075C5401, 0x075CD401, 0x075D3C01, 0x075DBC01, 0x075E2401, 0x075EA401, 0x075F0C01, 0x07BBC002, 0x07C0002C, 0x07C0C064, 0x07C2800F, 0x07C2C40E, 0x07C3040F, 0x07C3440F, 0x07C4401F, 0x07C4C03C, 0x07C5C02B, 0x07C7981D, 0x07C8402B, 0x07C90009, 0x07C94002, 0x07CC0021, 0x07CCC006, 0x07CCDC46, 0x07CE0014, 0x07CE8025, 0x07CF1805, 0x07CF8011, 0x07D0003F, 0x07D10001, 0x07D108B6, 0x07D3E404, 0x07D4003E, 0x07D50004, 0x07D54018, 0x07D7EC46, 0x07D9140B, 0x07DA0046, 0x07DC0074, 0x38000401, 0x38008060, 0x380400F0, }; static const unsigned int aAscii[4] = { 0xFFFFFFFF, 0xFC00FFFF, 0xF8000001, 0xF8000001, }; if( (unsigned int)c<128 ){ return ( (aAscii[c >> 5] & ((unsigned int)1 << (c & 0x001F)))==0 ); }else if( (unsigned int)c<(1<<22) ){ unsigned int key = (((unsigned int)c)<<10) | 0x000003FF; int iRes = 0; int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; int iLo = 0; while( iHi>=iLo ){ int iTest = (iHi + iLo) / 2; if( key >= aEntry[iTest] ){ iRes = iTest; iLo = iTest+1; }else{ iHi = iTest-1; } } assert( aEntry[0]=aEntry[iRes] ); return (((unsigned int)c) >= ((aEntry[iRes]>>10) + (aEntry[iRes]&0x3FF))); } return 1; } /* ** If the argument is a codepoint corresponding to a lowercase letter ** in the ASCII range with a diacritic added, return the codepoint ** of the ASCII letter only. For example, if passed 235 - "LATIN ** SMALL LETTER E WITH DIAERESIS" - return 65 ("LATIN SMALL LETTER ** E"). The resuls of passing a codepoint that corresponds to an ** uppercase letter are undefined. */ static int remove_diacritic(int c){ unsigned short aDia[] = { 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, 62924, 63050, 63082, 63274, 63390, }; char aChar[] = { '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', 'e', 'i', 'o', 'u', 'y', }; unsigned int key = (((unsigned int)c)<<3) | 0x00000007; int iRes = 0; int iHi = sizeof(aDia)/sizeof(aDia[0]) - 1; int iLo = 0; while( iHi>=iLo ){ int iTest = (iHi + iLo) / 2; if( key >= aDia[iTest] ){ iRes = iTest; iLo = iTest+1; }else{ iHi = iTest-1; } } assert( key>=aDia[iRes] ); return ((c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : (int)aChar[iRes]); } /* ** Return true if the argument interpreted as a unicode codepoint ** is a diacritical modifier character. */ int sqlite3FtsUnicodeIsdiacritic(int c){ unsigned int mask0 = 0x08029FDF; unsigned int mask1 = 0x000361F8; if( c<768 || c>817 ) return 0; return (c < 768+32) ? (mask0 & (1 << (c-768))) : (mask1 & (1 << (c-768-32))); } /* ** Interpret the argument as a unicode codepoint. If the codepoint ** is an upper case character that has a lower case equivalent, ** return the codepoint corresponding to the lower case version. ** Otherwise, return a copy of the argument. ** ** The results are undefined if the value passed to this function ** is less than zero. */ int sqlite3FtsUnicodeFold(int c, int bRemoveDiacritic){ /* Each entry in the following array defines a rule for folding a range ** of codepoints to lower case. The rule applies to a range of nRange ** codepoints starting at codepoint iCode. ** ** If the least significant bit in flags is clear, then the rule applies ** to all nRange codepoints (i.e. all nRange codepoints are upper case and ** need to be folded). Or, if it is set, then the rule only applies to ** every second codepoint in the range, starting with codepoint C. ** ** The 7 most significant bits in flags are an index into the aiOff[] ** array. If a specific codepoint C does require folding, then its lower ** case equivalent is ((C + aiOff[flags>>1]) & 0xFFFF). ** ** The contents of this array are generated by parsing the CaseFolding.txt ** file distributed as part of the "Unicode Character Database". See ** http://www.unicode.org for details. */ static const struct TableEntry { unsigned short iCode; unsigned char flags; unsigned char nRange; } aEntry[] = { {65, 14, 26}, {181, 64, 1}, {192, 14, 23}, {216, 14, 7}, {256, 1, 48}, {306, 1, 6}, {313, 1, 16}, {330, 1, 46}, {376, 116, 1}, {377, 1, 6}, {383, 104, 1}, {385, 50, 1}, {386, 1, 4}, {390, 44, 1}, {391, 0, 1}, {393, 42, 2}, {395, 0, 1}, {398, 32, 1}, {399, 38, 1}, {400, 40, 1}, {401, 0, 1}, {403, 42, 1}, {404, 46, 1}, {406, 52, 1}, {407, 48, 1}, {408, 0, 1}, {412, 52, 1}, {413, 54, 1}, {415, 56, 1}, {416, 1, 6}, {422, 60, 1}, {423, 0, 1}, {425, 60, 1}, {428, 0, 1}, {430, 60, 1}, {431, 0, 1}, {433, 58, 2}, {435, 1, 4}, {439, 62, 1}, {440, 0, 1}, {444, 0, 1}, {452, 2, 1}, {453, 0, 1}, {455, 2, 1}, {456, 0, 1}, {458, 2, 1}, {459, 1, 18}, {478, 1, 18}, {497, 2, 1}, {498, 1, 4}, {502, 122, 1}, {503, 134, 1}, {504, 1, 40}, {544, 110, 1}, {546, 1, 18}, {570, 70, 1}, {571, 0, 1}, {573, 108, 1}, {574, 68, 1}, {577, 0, 1}, {579, 106, 1}, {580, 28, 1}, {581, 30, 1}, {582, 1, 10}, {837, 36, 1}, {880, 1, 4}, {886, 0, 1}, {902, 18, 1}, {904, 16, 3}, {908, 26, 1}, {910, 24, 2}, {913, 14, 17}, {931, 14, 9}, {962, 0, 1}, {975, 4, 1}, {976, 140, 1}, {977, 142, 1}, {981, 146, 1}, {982, 144, 1}, {984, 1, 24}, {1008, 136, 1}, {1009, 138, 1}, {1012, 130, 1}, {1013, 128, 1}, {1015, 0, 1}, {1017, 152, 1}, {1018, 0, 1}, {1021, 110, 3}, {1024, 34, 16}, {1040, 14, 32}, {1120, 1, 34}, {1162, 1, 54}, {1216, 6, 1}, {1217, 1, 14}, {1232, 1, 88}, {1329, 22, 38}, {4256, 66, 38}, {4295, 66, 1}, {4301, 66, 1}, {7680, 1, 150}, {7835, 132, 1}, {7838, 96, 1}, {7840, 1, 96}, {7944, 150, 8}, {7960, 150, 6}, {7976, 150, 8}, {7992, 150, 8}, {8008, 150, 6}, {8025, 151, 8}, {8040, 150, 8}, {8072, 150, 8}, {8088, 150, 8}, {8104, 150, 8}, {8120, 150, 2}, {8122, 126, 2}, {8124, 148, 1}, {8126, 100, 1}, {8136, 124, 4}, {8140, 148, 1}, {8152, 150, 2}, {8154, 120, 2}, {8168, 150, 2}, {8170, 118, 2}, {8172, 152, 1}, {8184, 112, 2}, {8186, 114, 2}, {8188, 148, 1}, {8486, 98, 1}, {8490, 92, 1}, {8491, 94, 1}, {8498, 12, 1}, {8544, 8, 16}, {8579, 0, 1}, {9398, 10, 26}, {11264, 22, 47}, {11360, 0, 1}, {11362, 88, 1}, {11363, 102, 1}, {11364, 90, 1}, {11367, 1, 6}, {11373, 84, 1}, {11374, 86, 1}, {11375, 80, 1}, {11376, 82, 1}, {11378, 0, 1}, {11381, 0, 1}, {11390, 78, 2}, {11392, 1, 100}, {11499, 1, 4}, {11506, 0, 1}, {42560, 1, 46}, {42624, 1, 24}, {42786, 1, 14}, {42802, 1, 62}, {42873, 1, 4}, {42877, 76, 1}, {42878, 1, 10}, {42891, 0, 1}, {42893, 74, 1}, {42896, 1, 4}, {42912, 1, 10}, {42922, 72, 1}, {65313, 14, 26}, }; static const unsigned short aiOff[] = { 1, 2, 8, 15, 16, 26, 28, 32, 37, 38, 40, 48, 63, 64, 69, 71, 79, 80, 116, 202, 203, 205, 206, 207, 209, 210, 211, 213, 214, 217, 218, 219, 775, 7264, 10792, 10795, 23228, 23256, 30204, 54721, 54753, 54754, 54756, 54787, 54793, 54809, 57153, 57274, 57921, 58019, 58363, 61722, 65268, 65341, 65373, 65406, 65408, 65410, 65415, 65424, 65436, 65439, 65450, 65462, 65472, 65476, 65478, 65480, 65482, 65488, 65506, 65511, 65514, 65521, 65527, 65528, 65529, }; int ret = c; assert( sizeof(unsigned short)==2 && sizeof(unsigned char)==1 ); if( c<128 ){ if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); }else if( c<65536 ){ const struct TableEntry *p; int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; int iLo = 0; int iRes = -1; assert( c>aEntry[0].iCode ); while( iHi>=iLo ){ int iTest = (iHi + iLo) / 2; int cmp = (c - aEntry[iTest].iCode); if( cmp>=0 ){ iRes = iTest; iLo = iTest+1; }else{ iHi = iTest-1; } } assert( iRes>=0 && c>=aEntry[iRes].iCode ); p = &aEntry[iRes]; if( c<(p->iCode + p->nRange) && 0==(0x01 & p->flags & (p->iCode ^ c)) ){ ret = (c + (aiOff[p->flags>>1])) & 0x0000FFFF; assert( ret>0 ); } if( bRemoveDiacritic ) ret = remove_diacritic(ret); } else if( c>=66560 && c<66600 ){ ret = c + 40; } return ret; } #endif /* defined(SQLITE_ENABLE_FTS3) || defined(SQLITE_ENABLE_FTS4) */ #endif /* !defined(SQLITE_DISABLE_FTS3_UNICODE) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3_write.c ================================================ /* ** 2009 Oct 23 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This file is part of the SQLite FTS3 extension module. Specifically, ** this file contains code to insert, update and delete rows from FTS3 ** tables. It also contains code to merge FTS3 b-tree segments. Some ** of the sub-routines used to merge segments are also used by the query ** code in fts3.c. */ #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) #include #include #include #define FTS_MAX_APPENDABLE_HEIGHT 16 /* ** When full-text index nodes are loaded from disk, the buffer that they ** are loaded into has the following number of bytes of padding at the end ** of it. i.e. if a full-text index node is 900 bytes in size, then a buffer ** of 920 bytes is allocated for it. ** ** This means that if we have a pointer into a buffer containing node data, ** it is always safe to read up to two varints from it without risking an ** overread, even if the node data is corrupted. */ #define FTS3_NODE_PADDING (FTS3_VARINT_MAX*2) /* ** Under certain circumstances, b-tree nodes (doclists) can be loaded into ** memory incrementally instead of all at once. This can be a big performance ** win (reduced IO and CPU) if SQLite stops calling the virtual table xNext() ** method before retrieving all query results (as may happen, for example, ** if a query has a LIMIT clause). ** ** Incremental loading is used for b-tree nodes FTS3_NODE_CHUNK_THRESHOLD ** bytes and larger. Nodes are loaded in chunks of FTS3_NODE_CHUNKSIZE bytes. ** The code is written so that the hard lower-limit for each of these values ** is 1. Clearly such small values would be inefficient, but can be useful ** for testing purposes. ** ** If this module is built with SQLITE_TEST defined, these constants may ** be overridden at runtime for testing purposes. File fts3_test.c contains ** a Tcl interface to read and write the values. */ #ifdef SQLITE_TEST int test_fts3_node_chunksize = (4*1024); int test_fts3_node_chunk_threshold = (4*1024)*4; # define FTS3_NODE_CHUNKSIZE test_fts3_node_chunksize # define FTS3_NODE_CHUNK_THRESHOLD test_fts3_node_chunk_threshold #else # define FTS3_NODE_CHUNKSIZE (4*1024) # define FTS3_NODE_CHUNK_THRESHOLD (FTS3_NODE_CHUNKSIZE*4) #endif /* ** The two values that may be meaningfully bound to the :1 parameter in ** statements SQL_REPLACE_STAT and SQL_SELECT_STAT. */ #define FTS_STAT_DOCTOTAL 0 #define FTS_STAT_INCRMERGEHINT 1 #define FTS_STAT_AUTOINCRMERGE 2 /* ** If FTS_LOG_MERGES is defined, call sqlite3_log() to report each automatic ** and incremental merge operation that takes place. This is used for ** debugging FTS only, it should not usually be turned on in production ** systems. */ #ifdef FTS3_LOG_MERGES static void fts3LogMerge(int nMerge, sqlite3_int64 iAbsLevel){ sqlite3_log(SQLITE_OK, "%d-way merge from level %d", nMerge, (int)iAbsLevel); } #else #define fts3LogMerge(x, y) #endif typedef struct PendingList PendingList; typedef struct SegmentNode SegmentNode; typedef struct SegmentWriter SegmentWriter; /* ** An instance of the following data structure is used to build doclists ** incrementally. See function fts3PendingListAppend() for details. */ struct PendingList { int nData; char *aData; int nSpace; sqlite3_int64 iLastDocid; sqlite3_int64 iLastCol; sqlite3_int64 iLastPos; }; /* ** Each cursor has a (possibly empty) linked list of the following objects. */ struct Fts3DeferredToken { Fts3PhraseToken *pToken; /* Pointer to corresponding expr token */ int iCol; /* Column token must occur in */ Fts3DeferredToken *pNext; /* Next in list of deferred tokens */ PendingList *pList; /* Doclist is assembled here */ }; /* ** An instance of this structure is used to iterate through the terms on ** a contiguous set of segment b-tree leaf nodes. Although the details of ** this structure are only manipulated by code in this file, opaque handles ** of type Fts3SegReader* are also used by code in fts3.c to iterate through ** terms when querying the full-text index. See functions: ** ** sqlite3Fts3SegReaderNew() ** sqlite3Fts3SegReaderFree() ** sqlite3Fts3SegReaderIterate() ** ** Methods used to manipulate Fts3SegReader structures: ** ** fts3SegReaderNext() ** fts3SegReaderFirstDocid() ** fts3SegReaderNextDocid() */ struct Fts3SegReader { int iIdx; /* Index within level, or 0x7FFFFFFF for PT */ u8 bLookup; /* True for a lookup only */ u8 rootOnly; /* True for a root-only reader */ sqlite3_int64 iStartBlock; /* Rowid of first leaf block to traverse */ sqlite3_int64 iLeafEndBlock; /* Rowid of final leaf block to traverse */ sqlite3_int64 iEndBlock; /* Rowid of final block in segment (or 0) */ sqlite3_int64 iCurrentBlock; /* Current leaf block (or 0) */ char *aNode; /* Pointer to node data (or NULL) */ int nNode; /* Size of buffer at aNode (or 0) */ int nPopulate; /* If >0, bytes of buffer aNode[] loaded */ sqlite3_blob *pBlob; /* If not NULL, blob handle to read node */ Fts3HashElem **ppNextElem; /* Variables set by fts3SegReaderNext(). These may be read directly ** by the caller. They are valid from the time SegmentReaderNew() returns ** until SegmentReaderNext() returns something other than SQLITE_OK ** (i.e. SQLITE_DONE). */ int nTerm; /* Number of bytes in current term */ char *zTerm; /* Pointer to current term */ int nTermAlloc; /* Allocated size of zTerm buffer */ char *aDoclist; /* Pointer to doclist of current entry */ int nDoclist; /* Size of doclist in current entry */ /* The following variables are used by fts3SegReaderNextDocid() to iterate ** through the current doclist (aDoclist/nDoclist). */ char *pOffsetList; int nOffsetList; /* For descending pending seg-readers only */ sqlite3_int64 iDocid; }; #define fts3SegReaderIsPending(p) ((p)->ppNextElem!=0) #define fts3SegReaderIsRootOnly(p) ((p)->rootOnly!=0) /* ** An instance of this structure is used to create a segment b-tree in the ** database. The internal details of this type are only accessed by the ** following functions: ** ** fts3SegWriterAdd() ** fts3SegWriterFlush() ** fts3SegWriterFree() */ struct SegmentWriter { SegmentNode *pTree; /* Pointer to interior tree structure */ sqlite3_int64 iFirst; /* First slot in %_segments written */ sqlite3_int64 iFree; /* Next free slot in %_segments */ char *zTerm; /* Pointer to previous term buffer */ int nTerm; /* Number of bytes in zTerm */ int nMalloc; /* Size of malloc'd buffer at zMalloc */ char *zMalloc; /* Malloc'd space (possibly) used for zTerm */ int nSize; /* Size of allocation at aData */ int nData; /* Bytes of data in aData */ char *aData; /* Pointer to block from malloc() */ i64 nLeafData; /* Number of bytes of leaf data written */ }; /* ** Type SegmentNode is used by the following three functions to create ** the interior part of the segment b+-tree structures (everything except ** the leaf nodes). These functions and type are only ever used by code ** within the fts3SegWriterXXX() family of functions described above. ** ** fts3NodeAddTerm() ** fts3NodeWrite() ** fts3NodeFree() ** ** When a b+tree is written to the database (either as a result of a merge ** or the pending-terms table being flushed), leaves are written into the ** database file as soon as they are completely populated. The interior of ** the tree is assembled in memory and written out only once all leaves have ** been populated and stored. This is Ok, as the b+-tree fanout is usually ** very large, meaning that the interior of the tree consumes relatively ** little memory. */ struct SegmentNode { SegmentNode *pParent; /* Parent node (or NULL for root node) */ SegmentNode *pRight; /* Pointer to right-sibling */ SegmentNode *pLeftmost; /* Pointer to left-most node of this depth */ int nEntry; /* Number of terms written to node so far */ char *zTerm; /* Pointer to previous term buffer */ int nTerm; /* Number of bytes in zTerm */ int nMalloc; /* Size of malloc'd buffer at zMalloc */ char *zMalloc; /* Malloc'd space (possibly) used for zTerm */ int nData; /* Bytes of valid data so far */ char *aData; /* Node data */ }; /* ** Valid values for the second argument to fts3SqlStmt(). */ #define SQL_DELETE_CONTENT 0 #define SQL_IS_EMPTY 1 #define SQL_DELETE_ALL_CONTENT 2 #define SQL_DELETE_ALL_SEGMENTS 3 #define SQL_DELETE_ALL_SEGDIR 4 #define SQL_DELETE_ALL_DOCSIZE 5 #define SQL_DELETE_ALL_STAT 6 #define SQL_SELECT_CONTENT_BY_ROWID 7 #define SQL_NEXT_SEGMENT_INDEX 8 #define SQL_INSERT_SEGMENTS 9 #define SQL_NEXT_SEGMENTS_ID 10 #define SQL_INSERT_SEGDIR 11 #define SQL_SELECT_LEVEL 12 #define SQL_SELECT_LEVEL_RANGE 13 #define SQL_SELECT_LEVEL_COUNT 14 #define SQL_SELECT_SEGDIR_MAX_LEVEL 15 #define SQL_DELETE_SEGDIR_LEVEL 16 #define SQL_DELETE_SEGMENTS_RANGE 17 #define SQL_CONTENT_INSERT 18 #define SQL_DELETE_DOCSIZE 19 #define SQL_REPLACE_DOCSIZE 20 #define SQL_SELECT_DOCSIZE 21 #define SQL_SELECT_STAT 22 #define SQL_REPLACE_STAT 23 #define SQL_SELECT_ALL_PREFIX_LEVEL 24 #define SQL_DELETE_ALL_TERMS_SEGDIR 25 #define SQL_DELETE_SEGDIR_RANGE 26 #define SQL_SELECT_ALL_LANGID 27 #define SQL_FIND_MERGE_LEVEL 28 #define SQL_MAX_LEAF_NODE_ESTIMATE 29 #define SQL_DELETE_SEGDIR_ENTRY 30 #define SQL_SHIFT_SEGDIR_ENTRY 31 #define SQL_SELECT_SEGDIR 32 #define SQL_CHOMP_SEGDIR 33 #define SQL_SEGMENT_IS_APPENDABLE 34 #define SQL_SELECT_INDEXES 35 #define SQL_SELECT_MXLEVEL 36 #define SQL_SELECT_LEVEL_RANGE2 37 #define SQL_UPDATE_LEVEL_IDX 38 #define SQL_UPDATE_LEVEL 39 /* ** This function is used to obtain an SQLite prepared statement handle ** for the statement identified by the second argument. If successful, ** *pp is set to the requested statement handle and SQLITE_OK returned. ** Otherwise, an SQLite error code is returned and *pp is set to 0. ** ** If argument apVal is not NULL, then it must point to an array with ** at least as many entries as the requested statement has bound ** parameters. The values are bound to the statements parameters before ** returning. */ static int fts3SqlStmt( Fts3Table *p, /* Virtual table handle */ int eStmt, /* One of the SQL_XXX constants above */ sqlite3_stmt **pp, /* OUT: Statement handle */ sqlite3_value **apVal /* Values to bind to statement */ ){ const char *azSql[] = { /* 0 */ "DELETE FROM %Q.'%q_content' WHERE rowid = ?", /* 1 */ "SELECT NOT EXISTS(SELECT docid FROM %Q.'%q_content' WHERE rowid!=?)", /* 2 */ "DELETE FROM %Q.'%q_content'", /* 3 */ "DELETE FROM %Q.'%q_segments'", /* 4 */ "DELETE FROM %Q.'%q_segdir'", /* 5 */ "DELETE FROM %Q.'%q_docsize'", /* 6 */ "DELETE FROM %Q.'%q_stat'", /* 7 */ "SELECT %s WHERE rowid=?", /* 8 */ "SELECT (SELECT max(idx) FROM %Q.'%q_segdir' WHERE level = ?) + 1", /* 9 */ "REPLACE INTO %Q.'%q_segments'(blockid, block) VALUES(?, ?)", /* 10 */ "SELECT coalesce((SELECT max(blockid) FROM %Q.'%q_segments') + 1, 1)", /* 11 */ "REPLACE INTO %Q.'%q_segdir' VALUES(?,?,?,?,?,?)", /* Return segments in order from oldest to newest.*/ /* 12 */ "SELECT idx, start_block, leaves_end_block, end_block, root " "FROM %Q.'%q_segdir' WHERE level = ? ORDER BY idx ASC", /* 13 */ "SELECT idx, start_block, leaves_end_block, end_block, root " "FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?" "ORDER BY level DESC, idx ASC", /* 14 */ "SELECT count(*) FROM %Q.'%q_segdir' WHERE level = ?", /* 15 */ "SELECT max(level) FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?", /* 16 */ "DELETE FROM %Q.'%q_segdir' WHERE level = ?", /* 17 */ "DELETE FROM %Q.'%q_segments' WHERE blockid BETWEEN ? AND ?", /* 18 */ "INSERT INTO %Q.'%q_content' VALUES(%s)", /* 19 */ "DELETE FROM %Q.'%q_docsize' WHERE docid = ?", /* 20 */ "REPLACE INTO %Q.'%q_docsize' VALUES(?,?)", /* 21 */ "SELECT size FROM %Q.'%q_docsize' WHERE docid=?", /* 22 */ "SELECT value FROM %Q.'%q_stat' WHERE id=?", /* 23 */ "REPLACE INTO %Q.'%q_stat' VALUES(?,?)", /* 24 */ "", /* 25 */ "", /* 26 */ "DELETE FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?", /* 27 */ "SELECT ? UNION SELECT level / (1024 * ?) FROM %Q.'%q_segdir'", /* This statement is used to determine which level to read the input from ** when performing an incremental merge. It returns the absolute level number ** of the oldest level in the db that contains at least ? segments. Or, ** if no level in the FTS index contains more than ? segments, the statement ** returns zero rows. */ /* 28 */ "SELECT level, count(*) AS cnt FROM %Q.'%q_segdir' " " GROUP BY level HAVING cnt>=?" " ORDER BY (level %% 1024) ASC LIMIT 1", /* Estimate the upper limit on the number of leaf nodes in a new segment ** created by merging the oldest :2 segments from absolute level :1. See ** function sqlite3Fts3Incrmerge() for details. */ /* 29 */ "SELECT 2 * total(1 + leaves_end_block - start_block) " " FROM %Q.'%q_segdir' WHERE level = ? AND idx < ?", /* SQL_DELETE_SEGDIR_ENTRY ** Delete the %_segdir entry on absolute level :1 with index :2. */ /* 30 */ "DELETE FROM %Q.'%q_segdir' WHERE level = ? AND idx = ?", /* SQL_SHIFT_SEGDIR_ENTRY ** Modify the idx value for the segment with idx=:3 on absolute level :2 ** to :1. */ /* 31 */ "UPDATE %Q.'%q_segdir' SET idx = ? WHERE level=? AND idx=?", /* SQL_SELECT_SEGDIR ** Read a single entry from the %_segdir table. The entry from absolute ** level :1 with index value :2. */ /* 32 */ "SELECT idx, start_block, leaves_end_block, end_block, root " "FROM %Q.'%q_segdir' WHERE level = ? AND idx = ?", /* SQL_CHOMP_SEGDIR ** Update the start_block (:1) and root (:2) fields of the %_segdir ** entry located on absolute level :3 with index :4. */ /* 33 */ "UPDATE %Q.'%q_segdir' SET start_block = ?, root = ?" "WHERE level = ? AND idx = ?", /* SQL_SEGMENT_IS_APPENDABLE ** Return a single row if the segment with end_block=? is appendable. Or ** no rows otherwise. */ /* 34 */ "SELECT 1 FROM %Q.'%q_segments' WHERE blockid=? AND block IS NULL", /* SQL_SELECT_INDEXES ** Return the list of valid segment indexes for absolute level ? */ /* 35 */ "SELECT idx FROM %Q.'%q_segdir' WHERE level=? ORDER BY 1 ASC", /* SQL_SELECT_MXLEVEL ** Return the largest relative level in the FTS index or indexes. */ /* 36 */ "SELECT max( level %% 1024 ) FROM %Q.'%q_segdir'", /* Return segments in order from oldest to newest.*/ /* 37 */ "SELECT level, idx, end_block " "FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ? " "ORDER BY level DESC, idx ASC", /* Update statements used while promoting segments */ /* 38 */ "UPDATE OR FAIL %Q.'%q_segdir' SET level=-1,idx=? " "WHERE level=? AND idx=?", /* 39 */ "UPDATE OR FAIL %Q.'%q_segdir' SET level=? WHERE level=-1" }; int rc = SQLITE_OK; sqlite3_stmt *pStmt; assert( SizeofArray(azSql)==SizeofArray(p->aStmt) ); assert( eStmt=0 ); pStmt = p->aStmt[eStmt]; if( !pStmt ){ char *zSql; if( eStmt==SQL_CONTENT_INSERT ){ zSql = sqlite3_mprintf(azSql[eStmt], p->zDb, p->zName, p->zWriteExprlist); }else if( eStmt==SQL_SELECT_CONTENT_BY_ROWID ){ zSql = sqlite3_mprintf(azSql[eStmt], p->zReadExprlist); }else{ zSql = sqlite3_mprintf(azSql[eStmt], p->zDb, p->zName); } if( !zSql ){ rc = SQLITE_NOMEM; }else{ rc = sqlite3_prepare_v3(p->db, zSql, -1, SQLITE_PREPARE_PERSISTENT, &pStmt, NULL); sqlite3_free(zSql); assert( rc==SQLITE_OK || pStmt==0 ); p->aStmt[eStmt] = pStmt; } } if( apVal ){ int i; int nParam = sqlite3_bind_parameter_count(pStmt); for(i=0; rc==SQLITE_OK && inPendingData==0 ){ sqlite3_stmt *pStmt; rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_LEVEL, &pStmt, 0); if( rc==SQLITE_OK ){ sqlite3_bind_null(pStmt, 1); sqlite3_step(pStmt); rc = sqlite3_reset(pStmt); } } return rc; } /* ** FTS maintains a separate indexes for each language-id (a 32-bit integer). ** Within each language id, a separate index is maintained to store the ** document terms, and each configured prefix size (configured the FTS ** "prefix=" option). And each index consists of multiple levels ("relative ** levels"). ** ** All three of these values (the language id, the specific index and the ** level within the index) are encoded in 64-bit integer values stored ** in the %_segdir table on disk. This function is used to convert three ** separate component values into the single 64-bit integer value that ** can be used to query the %_segdir table. ** ** Specifically, each language-id/index combination is allocated 1024 ** 64-bit integer level values ("absolute levels"). The main terms index ** for language-id 0 is allocate values 0-1023. The first prefix index ** (if any) for language-id 0 is allocated values 1024-2047. And so on. ** Language 1 indexes are allocated immediately following language 0. ** ** So, for a system with nPrefix prefix indexes configured, the block of ** absolute levels that corresponds to language-id iLangid and index ** iIndex starts at absolute level ((iLangid * (nPrefix+1) + iIndex) * 1024). */ static sqlite3_int64 getAbsoluteLevel( Fts3Table *p, /* FTS3 table handle */ int iLangid, /* Language id */ int iIndex, /* Index in p->aIndex[] */ int iLevel /* Level of segments */ ){ sqlite3_int64 iBase; /* First absolute level for iLangid/iIndex */ assert( iLangid>=0 ); assert( p->nIndex>0 ); assert( iIndex>=0 && iIndexnIndex ); iBase = ((sqlite3_int64)iLangid * p->nIndex + iIndex) * FTS3_SEGDIR_MAXLEVEL; return iBase + iLevel; } /* ** Set *ppStmt to a statement handle that may be used to iterate through ** all rows in the %_segdir table, from oldest to newest. If successful, ** return SQLITE_OK. If an error occurs while preparing the statement, ** return an SQLite error code. ** ** There is only ever one instance of this SQL statement compiled for ** each FTS3 table. ** ** The statement returns the following columns from the %_segdir table: ** ** 0: idx ** 1: start_block ** 2: leaves_end_block ** 3: end_block ** 4: root */ int sqlite3Fts3AllSegdirs( Fts3Table *p, /* FTS3 table */ int iLangid, /* Language being queried */ int iIndex, /* Index for p->aIndex[] */ int iLevel, /* Level to select (relative level) */ sqlite3_stmt **ppStmt /* OUT: Compiled statement */ ){ int rc; sqlite3_stmt *pStmt = 0; assert( iLevel==FTS3_SEGCURSOR_ALL || iLevel>=0 ); assert( iLevel=0 && iIndexnIndex ); if( iLevel<0 ){ /* "SELECT * FROM %_segdir WHERE level BETWEEN ? AND ? ORDER BY ..." */ rc = fts3SqlStmt(p, SQL_SELECT_LEVEL_RANGE, &pStmt, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pStmt, 1, getAbsoluteLevel(p, iLangid, iIndex, 0)); sqlite3_bind_int64(pStmt, 2, getAbsoluteLevel(p, iLangid, iIndex, FTS3_SEGDIR_MAXLEVEL-1) ); } }else{ /* "SELECT * FROM %_segdir WHERE level = ? ORDER BY ..." */ rc = fts3SqlStmt(p, SQL_SELECT_LEVEL, &pStmt, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pStmt, 1, getAbsoluteLevel(p, iLangid, iIndex,iLevel)); } } *ppStmt = pStmt; return rc; } /* ** Append a single varint to a PendingList buffer. SQLITE_OK is returned ** if successful, or an SQLite error code otherwise. ** ** This function also serves to allocate the PendingList structure itself. ** For example, to create a new PendingList structure containing two ** varints: ** ** PendingList *p = 0; ** fts3PendingListAppendVarint(&p, 1); ** fts3PendingListAppendVarint(&p, 2); */ static int fts3PendingListAppendVarint( PendingList **pp, /* IN/OUT: Pointer to PendingList struct */ sqlite3_int64 i /* Value to append to data */ ){ PendingList *p = *pp; /* Allocate or grow the PendingList as required. */ if( !p ){ p = sqlite3_malloc(sizeof(*p) + 100); if( !p ){ return SQLITE_NOMEM; } p->nSpace = 100; p->aData = (char *)&p[1]; p->nData = 0; } else if( p->nData+FTS3_VARINT_MAX+1>p->nSpace ){ int nNew = p->nSpace * 2; p = sqlite3_realloc(p, sizeof(*p) + nNew); if( !p ){ sqlite3_free(*pp); *pp = 0; return SQLITE_NOMEM; } p->nSpace = nNew; p->aData = (char *)&p[1]; } /* Append the new serialized varint to the end of the list. */ p->nData += sqlite3Fts3PutVarint(&p->aData[p->nData], i); p->aData[p->nData] = '\0'; *pp = p; return SQLITE_OK; } /* ** Add a docid/column/position entry to a PendingList structure. Non-zero ** is returned if the structure is sqlite3_realloced as part of adding ** the entry. Otherwise, zero. ** ** If an OOM error occurs, *pRc is set to SQLITE_NOMEM before returning. ** Zero is always returned in this case. Otherwise, if no OOM error occurs, ** it is set to SQLITE_OK. */ static int fts3PendingListAppend( PendingList **pp, /* IN/OUT: PendingList structure */ sqlite3_int64 iDocid, /* Docid for entry to add */ sqlite3_int64 iCol, /* Column for entry to add */ sqlite3_int64 iPos, /* Position of term for entry to add */ int *pRc /* OUT: Return code */ ){ PendingList *p = *pp; int rc = SQLITE_OK; assert( !p || p->iLastDocid<=iDocid ); if( !p || p->iLastDocid!=iDocid ){ sqlite3_int64 iDelta = iDocid - (p ? p->iLastDocid : 0); if( p ){ assert( p->nDatanSpace ); assert( p->aData[p->nData]==0 ); p->nData++; } if( SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, iDelta)) ){ goto pendinglistappend_out; } p->iLastCol = -1; p->iLastPos = 0; p->iLastDocid = iDocid; } if( iCol>0 && p->iLastCol!=iCol ){ if( SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, 1)) || SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, iCol)) ){ goto pendinglistappend_out; } p->iLastCol = iCol; p->iLastPos = 0; } if( iCol>=0 ){ assert( iPos>p->iLastPos || (iPos==0 && p->iLastPos==0) ); rc = fts3PendingListAppendVarint(&p, 2+iPos-p->iLastPos); if( rc==SQLITE_OK ){ p->iLastPos = iPos; } } pendinglistappend_out: *pRc = rc; if( p!=*pp ){ *pp = p; return 1; } return 0; } /* ** Free a PendingList object allocated by fts3PendingListAppend(). */ static void fts3PendingListDelete(PendingList *pList){ sqlite3_free(pList); } /* ** Add an entry to one of the pending-terms hash tables. */ static int fts3PendingTermsAddOne( Fts3Table *p, int iCol, int iPos, Fts3Hash *pHash, /* Pending terms hash table to add entry to */ const char *zToken, int nToken ){ PendingList *pList; int rc = SQLITE_OK; pList = (PendingList *)fts3HashFind(pHash, zToken, nToken); if( pList ){ p->nPendingData -= (pList->nData + nToken + sizeof(Fts3HashElem)); } if( fts3PendingListAppend(&pList, p->iPrevDocid, iCol, iPos, &rc) ){ if( pList==fts3HashInsert(pHash, zToken, nToken, pList) ){ /* Malloc failed while inserting the new entry. This can only ** happen if there was no previous entry for this token. */ assert( 0==fts3HashFind(pHash, zToken, nToken) ); sqlite3_free(pList); rc = SQLITE_NOMEM; } } if( rc==SQLITE_OK ){ p->nPendingData += (pList->nData + nToken + sizeof(Fts3HashElem)); } return rc; } /* ** Tokenize the nul-terminated string zText and add all tokens to the ** pending-terms hash-table. The docid used is that currently stored in ** p->iPrevDocid, and the column is specified by argument iCol. ** ** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code. */ static int fts3PendingTermsAdd( Fts3Table *p, /* Table into which text will be inserted */ int iLangid, /* Language id to use */ const char *zText, /* Text of document to be inserted */ int iCol, /* Column into which text is being inserted */ u32 *pnWord /* IN/OUT: Incr. by number tokens inserted */ ){ int rc; int iStart = 0; int iEnd = 0; int iPos = 0; int nWord = 0; char const *zToken; int nToken = 0; sqlite3_tokenizer *pTokenizer = p->pTokenizer; sqlite3_tokenizer_module const *pModule = pTokenizer->pModule; sqlite3_tokenizer_cursor *pCsr; int (*xNext)(sqlite3_tokenizer_cursor *pCursor, const char**,int*,int*,int*,int*); assert( pTokenizer && pModule ); /* If the user has inserted a NULL value, this function may be called with ** zText==0. In this case, add zero token entries to the hash table and ** return early. */ if( zText==0 ){ *pnWord = 0; return SQLITE_OK; } rc = sqlite3Fts3OpenTokenizer(pTokenizer, iLangid, zText, -1, &pCsr); if( rc!=SQLITE_OK ){ return rc; } xNext = pModule->xNext; while( SQLITE_OK==rc && SQLITE_OK==(rc = xNext(pCsr, &zToken, &nToken, &iStart, &iEnd, &iPos)) ){ int i; if( iPos>=nWord ) nWord = iPos+1; /* Positions cannot be negative; we use -1 as a terminator internally. ** Tokens must have a non-zero length. */ if( iPos<0 || !zToken || nToken<=0 ){ rc = SQLITE_ERROR; break; } /* Add the term to the terms index */ rc = fts3PendingTermsAddOne( p, iCol, iPos, &p->aIndex[0].hPending, zToken, nToken ); /* Add the term to each of the prefix indexes that it is not too ** short for. */ for(i=1; rc==SQLITE_OK && inIndex; i++){ struct Fts3Index *pIndex = &p->aIndex[i]; if( nTokennPrefix ) continue; rc = fts3PendingTermsAddOne( p, iCol, iPos, &pIndex->hPending, zToken, pIndex->nPrefix ); } } pModule->xClose(pCsr); *pnWord += nWord; return (rc==SQLITE_DONE ? SQLITE_OK : rc); } /* ** Calling this function indicates that subsequent calls to ** fts3PendingTermsAdd() are to add term/position-list pairs for the ** contents of the document with docid iDocid. */ static int fts3PendingTermsDocid( Fts3Table *p, /* Full-text table handle */ int bDelete, /* True if this op is a delete */ int iLangid, /* Language id of row being written */ sqlite_int64 iDocid /* Docid of row being written */ ){ assert( iLangid>=0 ); assert( bDelete==1 || bDelete==0 ); /* TODO(shess) Explore whether partially flushing the buffer on ** forced-flush would provide better performance. I suspect that if ** we ordered the doclists by size and flushed the largest until the ** buffer was half empty, that would let the less frequent terms ** generate longer doclists. */ if( iDocidiPrevDocid || (iDocid==p->iPrevDocid && p->bPrevDelete==0) || p->iPrevLangid!=iLangid || p->nPendingData>p->nMaxPendingData ){ int rc = sqlite3Fts3PendingTermsFlush(p); if( rc!=SQLITE_OK ) return rc; } p->iPrevDocid = iDocid; p->iPrevLangid = iLangid; p->bPrevDelete = bDelete; return SQLITE_OK; } /* ** Discard the contents of the pending-terms hash tables. */ void sqlite3Fts3PendingTermsClear(Fts3Table *p){ int i; for(i=0; inIndex; i++){ Fts3HashElem *pElem; Fts3Hash *pHash = &p->aIndex[i].hPending; for(pElem=fts3HashFirst(pHash); pElem; pElem=fts3HashNext(pElem)){ PendingList *pList = (PendingList *)fts3HashData(pElem); fts3PendingListDelete(pList); } fts3HashClear(pHash); } p->nPendingData = 0; } /* ** This function is called by the xUpdate() method as part of an INSERT ** operation. It adds entries for each term in the new record to the ** pendingTerms hash table. ** ** Argument apVal is the same as the similarly named argument passed to ** fts3InsertData(). Parameter iDocid is the docid of the new row. */ static int fts3InsertTerms( Fts3Table *p, int iLangid, sqlite3_value **apVal, u32 *aSz ){ int i; /* Iterator variable */ for(i=2; inColumn+2; i++){ int iCol = i-2; if( p->abNotindexed[iCol]==0 ){ const char *zText = (const char *)sqlite3_value_text(apVal[i]); int rc = fts3PendingTermsAdd(p, iLangid, zText, iCol, &aSz[iCol]); if( rc!=SQLITE_OK ){ return rc; } aSz[p->nColumn] += sqlite3_value_bytes(apVal[i]); } } return SQLITE_OK; } /* ** This function is called by the xUpdate() method for an INSERT operation. ** The apVal parameter is passed a copy of the apVal argument passed by ** SQLite to the xUpdate() method. i.e: ** ** apVal[0] Not used for INSERT. ** apVal[1] rowid ** apVal[2] Left-most user-defined column ** ... ** apVal[p->nColumn+1] Right-most user-defined column ** apVal[p->nColumn+2] Hidden column with same name as table ** apVal[p->nColumn+3] Hidden "docid" column (alias for rowid) ** apVal[p->nColumn+4] Hidden languageid column */ static int fts3InsertData( Fts3Table *p, /* Full-text table */ sqlite3_value **apVal, /* Array of values to insert */ sqlite3_int64 *piDocid /* OUT: Docid for row just inserted */ ){ int rc; /* Return code */ sqlite3_stmt *pContentInsert; /* INSERT INTO %_content VALUES(...) */ if( p->zContentTbl ){ sqlite3_value *pRowid = apVal[p->nColumn+3]; if( sqlite3_value_type(pRowid)==SQLITE_NULL ){ pRowid = apVal[1]; } if( sqlite3_value_type(pRowid)!=SQLITE_INTEGER ){ return SQLITE_CONSTRAINT; } *piDocid = sqlite3_value_int64(pRowid); return SQLITE_OK; } /* Locate the statement handle used to insert data into the %_content ** table. The SQL for this statement is: ** ** INSERT INTO %_content VALUES(?, ?, ?, ...) ** ** The statement features N '?' variables, where N is the number of user ** defined columns in the FTS3 table, plus one for the docid field. */ rc = fts3SqlStmt(p, SQL_CONTENT_INSERT, &pContentInsert, &apVal[1]); if( rc==SQLITE_OK && p->zLanguageid ){ rc = sqlite3_bind_int( pContentInsert, p->nColumn+2, sqlite3_value_int(apVal[p->nColumn+4]) ); } if( rc!=SQLITE_OK ) return rc; /* There is a quirk here. The users INSERT statement may have specified ** a value for the "rowid" field, for the "docid" field, or for both. ** Which is a problem, since "rowid" and "docid" are aliases for the ** same value. For example: ** ** INSERT INTO fts3tbl(rowid, docid) VALUES(1, 2); ** ** In FTS3, this is an error. It is an error to specify non-NULL values ** for both docid and some other rowid alias. */ if( SQLITE_NULL!=sqlite3_value_type(apVal[3+p->nColumn]) ){ if( SQLITE_NULL==sqlite3_value_type(apVal[0]) && SQLITE_NULL!=sqlite3_value_type(apVal[1]) ){ /* A rowid/docid conflict. */ return SQLITE_ERROR; } rc = sqlite3_bind_value(pContentInsert, 1, apVal[3+p->nColumn]); if( rc!=SQLITE_OK ) return rc; } /* Execute the statement to insert the record. Set *piDocid to the ** new docid value. */ sqlite3_step(pContentInsert); rc = sqlite3_reset(pContentInsert); *piDocid = sqlite3_last_insert_rowid(p->db); return rc; } /* ** Remove all data from the FTS3 table. Clear the hash table containing ** pending terms. */ static int fts3DeleteAll(Fts3Table *p, int bContent){ int rc = SQLITE_OK; /* Return code */ /* Discard the contents of the pending-terms hash table. */ sqlite3Fts3PendingTermsClear(p); /* Delete everything from the shadow tables. Except, leave %_content as ** is if bContent is false. */ assert( p->zContentTbl==0 || bContent==0 ); if( bContent ) fts3SqlExec(&rc, p, SQL_DELETE_ALL_CONTENT, 0); fts3SqlExec(&rc, p, SQL_DELETE_ALL_SEGMENTS, 0); fts3SqlExec(&rc, p, SQL_DELETE_ALL_SEGDIR, 0); if( p->bHasDocsize ){ fts3SqlExec(&rc, p, SQL_DELETE_ALL_DOCSIZE, 0); } if( p->bHasStat ){ fts3SqlExec(&rc, p, SQL_DELETE_ALL_STAT, 0); } return rc; } /* ** */ static int langidFromSelect(Fts3Table *p, sqlite3_stmt *pSelect){ int iLangid = 0; if( p->zLanguageid ) iLangid = sqlite3_column_int(pSelect, p->nColumn+1); return iLangid; } /* ** The first element in the apVal[] array is assumed to contain the docid ** (an integer) of a row about to be deleted. Remove all terms from the ** full-text index. */ static void fts3DeleteTerms( int *pRC, /* Result code */ Fts3Table *p, /* The FTS table to delete from */ sqlite3_value *pRowid, /* The docid to be deleted */ u32 *aSz, /* Sizes of deleted document written here */ int *pbFound /* OUT: Set to true if row really does exist */ ){ int rc; sqlite3_stmt *pSelect; assert( *pbFound==0 ); if( *pRC ) return; rc = fts3SqlStmt(p, SQL_SELECT_CONTENT_BY_ROWID, &pSelect, &pRowid); if( rc==SQLITE_OK ){ if( SQLITE_ROW==sqlite3_step(pSelect) ){ int i; int iLangid = langidFromSelect(p, pSelect); i64 iDocid = sqlite3_column_int64(pSelect, 0); rc = fts3PendingTermsDocid(p, 1, iLangid, iDocid); for(i=1; rc==SQLITE_OK && i<=p->nColumn; i++){ int iCol = i-1; if( p->abNotindexed[iCol]==0 ){ const char *zText = (const char *)sqlite3_column_text(pSelect, i); rc = fts3PendingTermsAdd(p, iLangid, zText, -1, &aSz[iCol]); aSz[p->nColumn] += sqlite3_column_bytes(pSelect, i); } } if( rc!=SQLITE_OK ){ sqlite3_reset(pSelect); *pRC = rc; return; } *pbFound = 1; } rc = sqlite3_reset(pSelect); }else{ sqlite3_reset(pSelect); } *pRC = rc; } /* ** Forward declaration to account for the circular dependency between ** functions fts3SegmentMerge() and fts3AllocateSegdirIdx(). */ static int fts3SegmentMerge(Fts3Table *, int, int, int); /* ** This function allocates a new level iLevel index in the segdir table. ** Usually, indexes are allocated within a level sequentially starting ** with 0, so the allocated index is one greater than the value returned ** by: ** ** SELECT max(idx) FROM %_segdir WHERE level = :iLevel ** ** However, if there are already FTS3_MERGE_COUNT indexes at the requested ** level, they are merged into a single level (iLevel+1) segment and the ** allocated index is 0. ** ** If successful, *piIdx is set to the allocated index slot and SQLITE_OK ** returned. Otherwise, an SQLite error code is returned. */ static int fts3AllocateSegdirIdx( Fts3Table *p, int iLangid, /* Language id */ int iIndex, /* Index for p->aIndex */ int iLevel, int *piIdx ){ int rc; /* Return Code */ sqlite3_stmt *pNextIdx; /* Query for next idx at level iLevel */ int iNext = 0; /* Result of query pNextIdx */ assert( iLangid>=0 ); assert( p->nIndex>=1 ); /* Set variable iNext to the next available segdir index at level iLevel. */ rc = fts3SqlStmt(p, SQL_NEXT_SEGMENT_INDEX, &pNextIdx, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64( pNextIdx, 1, getAbsoluteLevel(p, iLangid, iIndex, iLevel) ); if( SQLITE_ROW==sqlite3_step(pNextIdx) ){ iNext = sqlite3_column_int(pNextIdx, 0); } rc = sqlite3_reset(pNextIdx); } if( rc==SQLITE_OK ){ /* If iNext is FTS3_MERGE_COUNT, indicating that level iLevel is already ** full, merge all segments in level iLevel into a single iLevel+1 ** segment and allocate (newly freed) index 0 at level iLevel. Otherwise, ** if iNext is less than FTS3_MERGE_COUNT, allocate index iNext. */ if( iNext>=FTS3_MERGE_COUNT ){ fts3LogMerge(16, getAbsoluteLevel(p, iLangid, iIndex, iLevel)); rc = fts3SegmentMerge(p, iLangid, iIndex, iLevel); *piIdx = 0; }else{ *piIdx = iNext; } } return rc; } /* ** The %_segments table is declared as follows: ** ** CREATE TABLE %_segments(blockid INTEGER PRIMARY KEY, block BLOB) ** ** This function reads data from a single row of the %_segments table. The ** specific row is identified by the iBlockid parameter. If paBlob is not ** NULL, then a buffer is allocated using sqlite3_malloc() and populated ** with the contents of the blob stored in the "block" column of the ** identified table row is. Whether or not paBlob is NULL, *pnBlob is set ** to the size of the blob in bytes before returning. ** ** If an error occurs, or the table does not contain the specified row, ** an SQLite error code is returned. Otherwise, SQLITE_OK is returned. If ** paBlob is non-NULL, then it is the responsibility of the caller to ** eventually free the returned buffer. ** ** This function may leave an open sqlite3_blob* handle in the ** Fts3Table.pSegments variable. This handle is reused by subsequent calls ** to this function. The handle may be closed by calling the ** sqlite3Fts3SegmentsClose() function. Reusing a blob handle is a handy ** performance improvement, but the blob handle should always be closed ** before control is returned to the user (to prevent a lock being held ** on the database file for longer than necessary). Thus, any virtual table ** method (xFilter etc.) that may directly or indirectly call this function ** must call sqlite3Fts3SegmentsClose() before returning. */ int sqlite3Fts3ReadBlock( Fts3Table *p, /* FTS3 table handle */ sqlite3_int64 iBlockid, /* Access the row with blockid=$iBlockid */ char **paBlob, /* OUT: Blob data in malloc'd buffer */ int *pnBlob, /* OUT: Size of blob data */ int *pnLoad /* OUT: Bytes actually loaded */ ){ int rc; /* Return code */ /* pnBlob must be non-NULL. paBlob may be NULL or non-NULL. */ assert( pnBlob ); if( p->pSegments ){ rc = sqlite3_blob_reopen(p->pSegments, iBlockid); }else{ if( 0==p->zSegmentsTbl ){ p->zSegmentsTbl = sqlite3_mprintf("%s_segments", p->zName); if( 0==p->zSegmentsTbl ) return SQLITE_NOMEM; } rc = sqlite3_blob_open( p->db, p->zDb, p->zSegmentsTbl, "block", iBlockid, 0, &p->pSegments ); } if( rc==SQLITE_OK ){ int nByte = sqlite3_blob_bytes(p->pSegments); *pnBlob = nByte; if( paBlob ){ char *aByte = sqlite3_malloc(nByte + FTS3_NODE_PADDING); if( !aByte ){ rc = SQLITE_NOMEM; }else{ if( pnLoad && nByte>(FTS3_NODE_CHUNK_THRESHOLD) ){ nByte = FTS3_NODE_CHUNKSIZE; *pnLoad = nByte; } rc = sqlite3_blob_read(p->pSegments, aByte, nByte, 0); memset(&aByte[nByte], 0, FTS3_NODE_PADDING); if( rc!=SQLITE_OK ){ sqlite3_free(aByte); aByte = 0; } } *paBlob = aByte; } } return rc; } /* ** Close the blob handle at p->pSegments, if it is open. See comments above ** the sqlite3Fts3ReadBlock() function for details. */ void sqlite3Fts3SegmentsClose(Fts3Table *p){ sqlite3_blob_close(p->pSegments); p->pSegments = 0; } static int fts3SegReaderIncrRead(Fts3SegReader *pReader){ int nRead; /* Number of bytes to read */ int rc; /* Return code */ nRead = MIN(pReader->nNode - pReader->nPopulate, FTS3_NODE_CHUNKSIZE); rc = sqlite3_blob_read( pReader->pBlob, &pReader->aNode[pReader->nPopulate], nRead, pReader->nPopulate ); if( rc==SQLITE_OK ){ pReader->nPopulate += nRead; memset(&pReader->aNode[pReader->nPopulate], 0, FTS3_NODE_PADDING); if( pReader->nPopulate==pReader->nNode ){ sqlite3_blob_close(pReader->pBlob); pReader->pBlob = 0; pReader->nPopulate = 0; } } return rc; } static int fts3SegReaderRequire(Fts3SegReader *pReader, char *pFrom, int nByte){ int rc = SQLITE_OK; assert( !pReader->pBlob || (pFrom>=pReader->aNode && pFrom<&pReader->aNode[pReader->nNode]) ); while( pReader->pBlob && rc==SQLITE_OK && (pFrom - pReader->aNode + nByte)>pReader->nPopulate ){ rc = fts3SegReaderIncrRead(pReader); } return rc; } /* ** Set an Fts3SegReader cursor to point at EOF. */ static void fts3SegReaderSetEof(Fts3SegReader *pSeg){ if( !fts3SegReaderIsRootOnly(pSeg) ){ sqlite3_free(pSeg->aNode); sqlite3_blob_close(pSeg->pBlob); pSeg->pBlob = 0; } pSeg->aNode = 0; } /* ** Move the iterator passed as the first argument to the next term in the ** segment. If successful, SQLITE_OK is returned. If there is no next term, ** SQLITE_DONE. Otherwise, an SQLite error code. */ static int fts3SegReaderNext( Fts3Table *p, Fts3SegReader *pReader, int bIncr ){ int rc; /* Return code of various sub-routines */ char *pNext; /* Cursor variable */ int nPrefix; /* Number of bytes in term prefix */ int nSuffix; /* Number of bytes in term suffix */ if( !pReader->aDoclist ){ pNext = pReader->aNode; }else{ pNext = &pReader->aDoclist[pReader->nDoclist]; } if( !pNext || pNext>=&pReader->aNode[pReader->nNode] ){ if( fts3SegReaderIsPending(pReader) ){ Fts3HashElem *pElem = *(pReader->ppNextElem); sqlite3_free(pReader->aNode); pReader->aNode = 0; if( pElem ){ char *aCopy; PendingList *pList = (PendingList *)fts3HashData(pElem); int nCopy = pList->nData+1; pReader->zTerm = (char *)fts3HashKey(pElem); pReader->nTerm = fts3HashKeysize(pElem); aCopy = (char*)sqlite3_malloc(nCopy); if( !aCopy ) return SQLITE_NOMEM; memcpy(aCopy, pList->aData, nCopy); pReader->nNode = pReader->nDoclist = nCopy; pReader->aNode = pReader->aDoclist = aCopy; pReader->ppNextElem++; assert( pReader->aNode ); } return SQLITE_OK; } fts3SegReaderSetEof(pReader); /* If iCurrentBlock>=iLeafEndBlock, this is an EOF condition. All leaf ** blocks have already been traversed. */ assert( pReader->iCurrentBlock<=pReader->iLeafEndBlock ); if( pReader->iCurrentBlock>=pReader->iLeafEndBlock ){ return SQLITE_OK; } rc = sqlite3Fts3ReadBlock( p, ++pReader->iCurrentBlock, &pReader->aNode, &pReader->nNode, (bIncr ? &pReader->nPopulate : 0) ); if( rc!=SQLITE_OK ) return rc; assert( pReader->pBlob==0 ); if( bIncr && pReader->nPopulatenNode ){ pReader->pBlob = p->pSegments; p->pSegments = 0; } pNext = pReader->aNode; } assert( !fts3SegReaderIsPending(pReader) ); rc = fts3SegReaderRequire(pReader, pNext, FTS3_VARINT_MAX*2); if( rc!=SQLITE_OK ) return rc; /* Because of the FTS3_NODE_PADDING bytes of padding, the following is ** safe (no risk of overread) even if the node data is corrupted. */ pNext += fts3GetVarint32(pNext, &nPrefix); pNext += fts3GetVarint32(pNext, &nSuffix); if( nPrefix<0 || nSuffix<=0 || &pNext[nSuffix]>&pReader->aNode[pReader->nNode] ){ return FTS_CORRUPT_VTAB; } if( nPrefix+nSuffix>pReader->nTermAlloc ){ int nNew = (nPrefix+nSuffix)*2; char *zNew = sqlite3_realloc(pReader->zTerm, nNew); if( !zNew ){ return SQLITE_NOMEM; } pReader->zTerm = zNew; pReader->nTermAlloc = nNew; } rc = fts3SegReaderRequire(pReader, pNext, nSuffix+FTS3_VARINT_MAX); if( rc!=SQLITE_OK ) return rc; memcpy(&pReader->zTerm[nPrefix], pNext, nSuffix); pReader->nTerm = nPrefix+nSuffix; pNext += nSuffix; pNext += fts3GetVarint32(pNext, &pReader->nDoclist); pReader->aDoclist = pNext; pReader->pOffsetList = 0; /* Check that the doclist does not appear to extend past the end of the ** b-tree node. And that the final byte of the doclist is 0x00. If either ** of these statements is untrue, then the data structure is corrupt. */ if( &pReader->aDoclist[pReader->nDoclist]>&pReader->aNode[pReader->nNode] || (pReader->nPopulate==0 && pReader->aDoclist[pReader->nDoclist-1]) ){ return FTS_CORRUPT_VTAB; } return SQLITE_OK; } /* ** Set the SegReader to point to the first docid in the doclist associated ** with the current term. */ static int fts3SegReaderFirstDocid(Fts3Table *pTab, Fts3SegReader *pReader){ int rc = SQLITE_OK; assert( pReader->aDoclist ); assert( !pReader->pOffsetList ); if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){ u8 bEof = 0; pReader->iDocid = 0; pReader->nOffsetList = 0; sqlite3Fts3DoclistPrev(0, pReader->aDoclist, pReader->nDoclist, &pReader->pOffsetList, &pReader->iDocid, &pReader->nOffsetList, &bEof ); }else{ rc = fts3SegReaderRequire(pReader, pReader->aDoclist, FTS3_VARINT_MAX); if( rc==SQLITE_OK ){ int n = sqlite3Fts3GetVarint(pReader->aDoclist, &pReader->iDocid); pReader->pOffsetList = &pReader->aDoclist[n]; } } return rc; } /* ** Advance the SegReader to point to the next docid in the doclist ** associated with the current term. ** ** If arguments ppOffsetList and pnOffsetList are not NULL, then ** *ppOffsetList is set to point to the first column-offset list ** in the doclist entry (i.e. immediately past the docid varint). ** *pnOffsetList is set to the length of the set of column-offset ** lists, not including the nul-terminator byte. For example: */ static int fts3SegReaderNextDocid( Fts3Table *pTab, Fts3SegReader *pReader, /* Reader to advance to next docid */ char **ppOffsetList, /* OUT: Pointer to current position-list */ int *pnOffsetList /* OUT: Length of *ppOffsetList in bytes */ ){ int rc = SQLITE_OK; char *p = pReader->pOffsetList; char c = 0; assert( p ); if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){ /* A pending-terms seg-reader for an FTS4 table that uses order=desc. ** Pending-terms doclists are always built up in ascending order, so ** we have to iterate through them backwards here. */ u8 bEof = 0; if( ppOffsetList ){ *ppOffsetList = pReader->pOffsetList; *pnOffsetList = pReader->nOffsetList - 1; } sqlite3Fts3DoclistPrev(0, pReader->aDoclist, pReader->nDoclist, &p, &pReader->iDocid, &pReader->nOffsetList, &bEof ); if( bEof ){ pReader->pOffsetList = 0; }else{ pReader->pOffsetList = p; } }else{ char *pEnd = &pReader->aDoclist[pReader->nDoclist]; /* Pointer p currently points at the first byte of an offset list. The ** following block advances it to point one byte past the end of ** the same offset list. */ while( 1 ){ /* The following line of code (and the "p++" below the while() loop) is ** normally all that is required to move pointer p to the desired ** position. The exception is if this node is being loaded from disk ** incrementally and pointer "p" now points to the first byte past ** the populated part of pReader->aNode[]. */ while( *p | c ) c = *p++ & 0x80; assert( *p==0 ); if( pReader->pBlob==0 || p<&pReader->aNode[pReader->nPopulate] ) break; rc = fts3SegReaderIncrRead(pReader); if( rc!=SQLITE_OK ) return rc; } p++; /* If required, populate the output variables with a pointer to and the ** size of the previous offset-list. */ if( ppOffsetList ){ *ppOffsetList = pReader->pOffsetList; *pnOffsetList = (int)(p - pReader->pOffsetList - 1); } /* List may have been edited in place by fts3EvalNearTrim() */ while( p=pEnd ){ pReader->pOffsetList = 0; }else{ rc = fts3SegReaderRequire(pReader, p, FTS3_VARINT_MAX); if( rc==SQLITE_OK ){ sqlite3_int64 iDelta; pReader->pOffsetList = p + sqlite3Fts3GetVarint(p, &iDelta); if( pTab->bDescIdx ){ pReader->iDocid -= iDelta; }else{ pReader->iDocid += iDelta; } } } } return SQLITE_OK; } int sqlite3Fts3MsrOvfl( Fts3Cursor *pCsr, Fts3MultiSegReader *pMsr, int *pnOvfl ){ Fts3Table *p = (Fts3Table*)pCsr->base.pVtab; int nOvfl = 0; int ii; int rc = SQLITE_OK; int pgsz = p->nPgsz; assert( p->bFts4 ); assert( pgsz>0 ); for(ii=0; rc==SQLITE_OK && iinSegment; ii++){ Fts3SegReader *pReader = pMsr->apSegment[ii]; if( !fts3SegReaderIsPending(pReader) && !fts3SegReaderIsRootOnly(pReader) ){ sqlite3_int64 jj; for(jj=pReader->iStartBlock; jj<=pReader->iLeafEndBlock; jj++){ int nBlob; rc = sqlite3Fts3ReadBlock(p, jj, 0, &nBlob, 0); if( rc!=SQLITE_OK ) break; if( (nBlob+35)>pgsz ){ nOvfl += (nBlob + 34)/pgsz; } } } } *pnOvfl = nOvfl; return rc; } /* ** Free all allocations associated with the iterator passed as the ** second argument. */ void sqlite3Fts3SegReaderFree(Fts3SegReader *pReader){ if( pReader ){ if( !fts3SegReaderIsPending(pReader) ){ sqlite3_free(pReader->zTerm); } if( !fts3SegReaderIsRootOnly(pReader) ){ sqlite3_free(pReader->aNode); } sqlite3_blob_close(pReader->pBlob); } sqlite3_free(pReader); } /* ** Allocate a new SegReader object. */ int sqlite3Fts3SegReaderNew( int iAge, /* Segment "age". */ int bLookup, /* True for a lookup only */ sqlite3_int64 iStartLeaf, /* First leaf to traverse */ sqlite3_int64 iEndLeaf, /* Final leaf to traverse */ sqlite3_int64 iEndBlock, /* Final block of segment */ const char *zRoot, /* Buffer containing root node */ int nRoot, /* Size of buffer containing root node */ Fts3SegReader **ppReader /* OUT: Allocated Fts3SegReader */ ){ Fts3SegReader *pReader; /* Newly allocated SegReader object */ int nExtra = 0; /* Bytes to allocate segment root node */ assert( iStartLeaf<=iEndLeaf ); if( iStartLeaf==0 ){ nExtra = nRoot + FTS3_NODE_PADDING; } pReader = (Fts3SegReader *)sqlite3_malloc(sizeof(Fts3SegReader) + nExtra); if( !pReader ){ return SQLITE_NOMEM; } memset(pReader, 0, sizeof(Fts3SegReader)); pReader->iIdx = iAge; pReader->bLookup = bLookup!=0; pReader->iStartBlock = iStartLeaf; pReader->iLeafEndBlock = iEndLeaf; pReader->iEndBlock = iEndBlock; if( nExtra ){ /* The entire segment is stored in the root node. */ pReader->aNode = (char *)&pReader[1]; pReader->rootOnly = 1; pReader->nNode = nRoot; memcpy(pReader->aNode, zRoot, nRoot); memset(&pReader->aNode[nRoot], 0, FTS3_NODE_PADDING); }else{ pReader->iCurrentBlock = iStartLeaf-1; } *ppReader = pReader; return SQLITE_OK; } /* ** This is a comparison function used as a qsort() callback when sorting ** an array of pending terms by term. This occurs as part of flushing ** the contents of the pending-terms hash table to the database. */ static int SQLITE_CDECL fts3CompareElemByTerm( const void *lhs, const void *rhs ){ char *z1 = fts3HashKey(*(Fts3HashElem **)lhs); char *z2 = fts3HashKey(*(Fts3HashElem **)rhs); int n1 = fts3HashKeysize(*(Fts3HashElem **)lhs); int n2 = fts3HashKeysize(*(Fts3HashElem **)rhs); int n = (n1aIndex */ const char *zTerm, /* Term to search for */ int nTerm, /* Size of buffer zTerm */ int bPrefix, /* True for a prefix iterator */ Fts3SegReader **ppReader /* OUT: SegReader for pending-terms */ ){ Fts3SegReader *pReader = 0; /* Fts3SegReader object to return */ Fts3HashElem *pE; /* Iterator variable */ Fts3HashElem **aElem = 0; /* Array of term hash entries to scan */ int nElem = 0; /* Size of array at aElem */ int rc = SQLITE_OK; /* Return Code */ Fts3Hash *pHash; pHash = &p->aIndex[iIndex].hPending; if( bPrefix ){ int nAlloc = 0; /* Size of allocated array at aElem */ for(pE=fts3HashFirst(pHash); pE; pE=fts3HashNext(pE)){ char *zKey = (char *)fts3HashKey(pE); int nKey = fts3HashKeysize(pE); if( nTerm==0 || (nKey>=nTerm && 0==memcmp(zKey, zTerm, nTerm)) ){ if( nElem==nAlloc ){ Fts3HashElem **aElem2; nAlloc += 16; aElem2 = (Fts3HashElem **)sqlite3_realloc( aElem, nAlloc*sizeof(Fts3HashElem *) ); if( !aElem2 ){ rc = SQLITE_NOMEM; nElem = 0; break; } aElem = aElem2; } aElem[nElem++] = pE; } } /* If more than one term matches the prefix, sort the Fts3HashElem ** objects in term order using qsort(). This uses the same comparison ** callback as is used when flushing terms to disk. */ if( nElem>1 ){ qsort(aElem, nElem, sizeof(Fts3HashElem *), fts3CompareElemByTerm); } }else{ /* The query is a simple term lookup that matches at most one term in ** the index. All that is required is a straight hash-lookup. ** ** Because the stack address of pE may be accessed via the aElem pointer ** below, the "Fts3HashElem *pE" must be declared so that it is valid ** within this entire function, not just this "else{...}" block. */ pE = fts3HashFindElem(pHash, zTerm, nTerm); if( pE ){ aElem = &pE; nElem = 1; } } if( nElem>0 ){ int nByte = sizeof(Fts3SegReader) + (nElem+1)*sizeof(Fts3HashElem *); pReader = (Fts3SegReader *)sqlite3_malloc(nByte); if( !pReader ){ rc = SQLITE_NOMEM; }else{ memset(pReader, 0, nByte); pReader->iIdx = 0x7FFFFFFF; pReader->ppNextElem = (Fts3HashElem **)&pReader[1]; memcpy(pReader->ppNextElem, aElem, nElem*sizeof(Fts3HashElem *)); } } if( bPrefix ){ sqlite3_free(aElem); } *ppReader = pReader; return rc; } /* ** Compare the entries pointed to by two Fts3SegReader structures. ** Comparison is as follows: ** ** 1) EOF is greater than not EOF. ** ** 2) The current terms (if any) are compared using memcmp(). If one ** term is a prefix of another, the longer term is considered the ** larger. ** ** 3) By segment age. An older segment is considered larger. */ static int fts3SegReaderCmp(Fts3SegReader *pLhs, Fts3SegReader *pRhs){ int rc; if( pLhs->aNode && pRhs->aNode ){ int rc2 = pLhs->nTerm - pRhs->nTerm; if( rc2<0 ){ rc = memcmp(pLhs->zTerm, pRhs->zTerm, pLhs->nTerm); }else{ rc = memcmp(pLhs->zTerm, pRhs->zTerm, pRhs->nTerm); } if( rc==0 ){ rc = rc2; } }else{ rc = (pLhs->aNode==0) - (pRhs->aNode==0); } if( rc==0 ){ rc = pRhs->iIdx - pLhs->iIdx; } assert( rc!=0 ); return rc; } /* ** A different comparison function for SegReader structures. In this ** version, it is assumed that each SegReader points to an entry in ** a doclist for identical terms. Comparison is made as follows: ** ** 1) EOF (end of doclist in this case) is greater than not EOF. ** ** 2) By current docid. ** ** 3) By segment age. An older segment is considered larger. */ static int fts3SegReaderDoclistCmp(Fts3SegReader *pLhs, Fts3SegReader *pRhs){ int rc = (pLhs->pOffsetList==0)-(pRhs->pOffsetList==0); if( rc==0 ){ if( pLhs->iDocid==pRhs->iDocid ){ rc = pRhs->iIdx - pLhs->iIdx; }else{ rc = (pLhs->iDocid > pRhs->iDocid) ? 1 : -1; } } assert( pLhs->aNode && pRhs->aNode ); return rc; } static int fts3SegReaderDoclistCmpRev(Fts3SegReader *pLhs, Fts3SegReader *pRhs){ int rc = (pLhs->pOffsetList==0)-(pRhs->pOffsetList==0); if( rc==0 ){ if( pLhs->iDocid==pRhs->iDocid ){ rc = pRhs->iIdx - pLhs->iIdx; }else{ rc = (pLhs->iDocid < pRhs->iDocid) ? 1 : -1; } } assert( pLhs->aNode && pRhs->aNode ); return rc; } /* ** Compare the term that the Fts3SegReader object passed as the first argument ** points to with the term specified by arguments zTerm and nTerm. ** ** If the pSeg iterator is already at EOF, return 0. Otherwise, return ** -ve if the pSeg term is less than zTerm/nTerm, 0 if the two terms are ** equal, or +ve if the pSeg term is greater than zTerm/nTerm. */ static int fts3SegReaderTermCmp( Fts3SegReader *pSeg, /* Segment reader object */ const char *zTerm, /* Term to compare to */ int nTerm /* Size of term zTerm in bytes */ ){ int res = 0; if( pSeg->aNode ){ if( pSeg->nTerm>nTerm ){ res = memcmp(pSeg->zTerm, zTerm, nTerm); }else{ res = memcmp(pSeg->zTerm, zTerm, pSeg->nTerm); } if( res==0 ){ res = pSeg->nTerm-nTerm; } } return res; } /* ** Argument apSegment is an array of nSegment elements. It is known that ** the final (nSegment-nSuspect) members are already in sorted order ** (according to the comparison function provided). This function shuffles ** the array around until all entries are in sorted order. */ static void fts3SegReaderSort( Fts3SegReader **apSegment, /* Array to sort entries of */ int nSegment, /* Size of apSegment array */ int nSuspect, /* Unsorted entry count */ int (*xCmp)(Fts3SegReader *, Fts3SegReader *) /* Comparison function */ ){ int i; /* Iterator variable */ assert( nSuspect<=nSegment ); if( nSuspect==nSegment ) nSuspect--; for(i=nSuspect-1; i>=0; i--){ int j; for(j=i; j<(nSegment-1); j++){ Fts3SegReader *pTmp; if( xCmp(apSegment[j], apSegment[j+1])<0 ) break; pTmp = apSegment[j+1]; apSegment[j+1] = apSegment[j]; apSegment[j] = pTmp; } } #ifndef NDEBUG /* Check that the list really is sorted now. */ for(i=0; i<(nSuspect-1); i++){ assert( xCmp(apSegment[i], apSegment[i+1])<0 ); } #endif } /* ** Insert a record into the %_segments table. */ static int fts3WriteSegment( Fts3Table *p, /* Virtual table handle */ sqlite3_int64 iBlock, /* Block id for new block */ char *z, /* Pointer to buffer containing block data */ int n /* Size of buffer z in bytes */ ){ sqlite3_stmt *pStmt; int rc = fts3SqlStmt(p, SQL_INSERT_SEGMENTS, &pStmt, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pStmt, 1, iBlock); sqlite3_bind_blob(pStmt, 2, z, n, SQLITE_STATIC); sqlite3_step(pStmt); rc = sqlite3_reset(pStmt); } return rc; } /* ** Find the largest relative level number in the table. If successful, set ** *pnMax to this value and return SQLITE_OK. Otherwise, if an error occurs, ** set *pnMax to zero and return an SQLite error code. */ int sqlite3Fts3MaxLevel(Fts3Table *p, int *pnMax){ int rc; int mxLevel = 0; sqlite3_stmt *pStmt = 0; rc = fts3SqlStmt(p, SQL_SELECT_MXLEVEL, &pStmt, 0); if( rc==SQLITE_OK ){ if( SQLITE_ROW==sqlite3_step(pStmt) ){ mxLevel = sqlite3_column_int(pStmt, 0); } rc = sqlite3_reset(pStmt); } *pnMax = mxLevel; return rc; } /* ** Insert a record into the %_segdir table. */ static int fts3WriteSegdir( Fts3Table *p, /* Virtual table handle */ sqlite3_int64 iLevel, /* Value for "level" field (absolute level) */ int iIdx, /* Value for "idx" field */ sqlite3_int64 iStartBlock, /* Value for "start_block" field */ sqlite3_int64 iLeafEndBlock, /* Value for "leaves_end_block" field */ sqlite3_int64 iEndBlock, /* Value for "end_block" field */ sqlite3_int64 nLeafData, /* Bytes of leaf data in segment */ char *zRoot, /* Blob value for "root" field */ int nRoot /* Number of bytes in buffer zRoot */ ){ sqlite3_stmt *pStmt; int rc = fts3SqlStmt(p, SQL_INSERT_SEGDIR, &pStmt, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pStmt, 1, iLevel); sqlite3_bind_int(pStmt, 2, iIdx); sqlite3_bind_int64(pStmt, 3, iStartBlock); sqlite3_bind_int64(pStmt, 4, iLeafEndBlock); if( nLeafData==0 ){ sqlite3_bind_int64(pStmt, 5, iEndBlock); }else{ char *zEnd = sqlite3_mprintf("%lld %lld", iEndBlock, nLeafData); if( !zEnd ) return SQLITE_NOMEM; sqlite3_bind_text(pStmt, 5, zEnd, -1, sqlite3_free); } sqlite3_bind_blob(pStmt, 6, zRoot, nRoot, SQLITE_STATIC); sqlite3_step(pStmt); rc = sqlite3_reset(pStmt); } return rc; } /* ** Return the size of the common prefix (if any) shared by zPrev and ** zNext, in bytes. For example, ** ** fts3PrefixCompress("abc", 3, "abcdef", 6) // returns 3 ** fts3PrefixCompress("abX", 3, "abcdef", 6) // returns 2 ** fts3PrefixCompress("abX", 3, "Xbcdef", 6) // returns 0 */ static int fts3PrefixCompress( const char *zPrev, /* Buffer containing previous term */ int nPrev, /* Size of buffer zPrev in bytes */ const char *zNext, /* Buffer containing next term */ int nNext /* Size of buffer zNext in bytes */ ){ int n; UNUSED_PARAMETER(nNext); for(n=0; nnData; /* Current size of node in bytes */ int nReq = nData; /* Required space after adding zTerm */ int nPrefix; /* Number of bytes of prefix compression */ int nSuffix; /* Suffix length */ nPrefix = fts3PrefixCompress(pTree->zTerm, pTree->nTerm, zTerm, nTerm); nSuffix = nTerm-nPrefix; nReq += sqlite3Fts3VarintLen(nPrefix)+sqlite3Fts3VarintLen(nSuffix)+nSuffix; if( nReq<=p->nNodeSize || !pTree->zTerm ){ if( nReq>p->nNodeSize ){ /* An unusual case: this is the first term to be added to the node ** and the static node buffer (p->nNodeSize bytes) is not large ** enough. Use a separately malloced buffer instead This wastes ** p->nNodeSize bytes, but since this scenario only comes about when ** the database contain two terms that share a prefix of almost 2KB, ** this is not expected to be a serious problem. */ assert( pTree->aData==(char *)&pTree[1] ); pTree->aData = (char *)sqlite3_malloc(nReq); if( !pTree->aData ){ return SQLITE_NOMEM; } } if( pTree->zTerm ){ /* There is no prefix-length field for first term in a node */ nData += sqlite3Fts3PutVarint(&pTree->aData[nData], nPrefix); } nData += sqlite3Fts3PutVarint(&pTree->aData[nData], nSuffix); memcpy(&pTree->aData[nData], &zTerm[nPrefix], nSuffix); pTree->nData = nData + nSuffix; pTree->nEntry++; if( isCopyTerm ){ if( pTree->nMalloczMalloc, nTerm*2); if( !zNew ){ return SQLITE_NOMEM; } pTree->nMalloc = nTerm*2; pTree->zMalloc = zNew; } pTree->zTerm = pTree->zMalloc; memcpy(pTree->zTerm, zTerm, nTerm); pTree->nTerm = nTerm; }else{ pTree->zTerm = (char *)zTerm; pTree->nTerm = nTerm; } return SQLITE_OK; } } /* If control flows to here, it was not possible to append zTerm to the ** current node. Create a new node (a right-sibling of the current node). ** If this is the first node in the tree, the term is added to it. ** ** Otherwise, the term is not added to the new node, it is left empty for ** now. Instead, the term is inserted into the parent of pTree. If pTree ** has no parent, one is created here. */ pNew = (SegmentNode *)sqlite3_malloc(sizeof(SegmentNode) + p->nNodeSize); if( !pNew ){ return SQLITE_NOMEM; } memset(pNew, 0, sizeof(SegmentNode)); pNew->nData = 1 + FTS3_VARINT_MAX; pNew->aData = (char *)&pNew[1]; if( pTree ){ SegmentNode *pParent = pTree->pParent; rc = fts3NodeAddTerm(p, &pParent, isCopyTerm, zTerm, nTerm); if( pTree->pParent==0 ){ pTree->pParent = pParent; } pTree->pRight = pNew; pNew->pLeftmost = pTree->pLeftmost; pNew->pParent = pParent; pNew->zMalloc = pTree->zMalloc; pNew->nMalloc = pTree->nMalloc; pTree->zMalloc = 0; }else{ pNew->pLeftmost = pNew; rc = fts3NodeAddTerm(p, &pNew, isCopyTerm, zTerm, nTerm); } *ppTree = pNew; return rc; } /* ** Helper function for fts3NodeWrite(). */ static int fts3TreeFinishNode( SegmentNode *pTree, int iHeight, sqlite3_int64 iLeftChild ){ int nStart; assert( iHeight>=1 && iHeight<128 ); nStart = FTS3_VARINT_MAX - sqlite3Fts3VarintLen(iLeftChild); pTree->aData[nStart] = (char)iHeight; sqlite3Fts3PutVarint(&pTree->aData[nStart+1], iLeftChild); return nStart; } /* ** Write the buffer for the segment node pTree and all of its peers to the ** database. Then call this function recursively to write the parent of ** pTree and its peers to the database. ** ** Except, if pTree is a root node, do not write it to the database. Instead, ** set output variables *paRoot and *pnRoot to contain the root node. ** ** If successful, SQLITE_OK is returned and output variable *piLast is ** set to the largest blockid written to the database (or zero if no ** blocks were written to the db). Otherwise, an SQLite error code is ** returned. */ static int fts3NodeWrite( Fts3Table *p, /* Virtual table handle */ SegmentNode *pTree, /* SegmentNode handle */ int iHeight, /* Height of this node in tree */ sqlite3_int64 iLeaf, /* Block id of first leaf node */ sqlite3_int64 iFree, /* Block id of next free slot in %_segments */ sqlite3_int64 *piLast, /* OUT: Block id of last entry written */ char **paRoot, /* OUT: Data for root node */ int *pnRoot /* OUT: Size of root node in bytes */ ){ int rc = SQLITE_OK; if( !pTree->pParent ){ /* Root node of the tree. */ int nStart = fts3TreeFinishNode(pTree, iHeight, iLeaf); *piLast = iFree-1; *pnRoot = pTree->nData - nStart; *paRoot = &pTree->aData[nStart]; }else{ SegmentNode *pIter; sqlite3_int64 iNextFree = iFree; sqlite3_int64 iNextLeaf = iLeaf; for(pIter=pTree->pLeftmost; pIter && rc==SQLITE_OK; pIter=pIter->pRight){ int nStart = fts3TreeFinishNode(pIter, iHeight, iNextLeaf); int nWrite = pIter->nData - nStart; rc = fts3WriteSegment(p, iNextFree, &pIter->aData[nStart], nWrite); iNextFree++; iNextLeaf += (pIter->nEntry+1); } if( rc==SQLITE_OK ){ assert( iNextLeaf==iFree ); rc = fts3NodeWrite( p, pTree->pParent, iHeight+1, iFree, iNextFree, piLast, paRoot, pnRoot ); } } return rc; } /* ** Free all memory allocations associated with the tree pTree. */ static void fts3NodeFree(SegmentNode *pTree){ if( pTree ){ SegmentNode *p = pTree->pLeftmost; fts3NodeFree(p->pParent); while( p ){ SegmentNode *pRight = p->pRight; if( p->aData!=(char *)&p[1] ){ sqlite3_free(p->aData); } assert( pRight==0 || p->zMalloc==0 ); sqlite3_free(p->zMalloc); sqlite3_free(p); p = pRight; } } } /* ** Add a term to the segment being constructed by the SegmentWriter object ** *ppWriter. When adding the first term to a segment, *ppWriter should ** be passed NULL. This function will allocate a new SegmentWriter object ** and return it via the input/output variable *ppWriter in this case. ** ** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code. */ static int fts3SegWriterAdd( Fts3Table *p, /* Virtual table handle */ SegmentWriter **ppWriter, /* IN/OUT: SegmentWriter handle */ int isCopyTerm, /* True if buffer zTerm must be copied */ const char *zTerm, /* Pointer to buffer containing term */ int nTerm, /* Size of term in bytes */ const char *aDoclist, /* Pointer to buffer containing doclist */ int nDoclist /* Size of doclist in bytes */ ){ int nPrefix; /* Size of term prefix in bytes */ int nSuffix; /* Size of term suffix in bytes */ int nReq; /* Number of bytes required on leaf page */ int nData; SegmentWriter *pWriter = *ppWriter; if( !pWriter ){ int rc; sqlite3_stmt *pStmt; /* Allocate the SegmentWriter structure */ pWriter = (SegmentWriter *)sqlite3_malloc(sizeof(SegmentWriter)); if( !pWriter ) return SQLITE_NOMEM; memset(pWriter, 0, sizeof(SegmentWriter)); *ppWriter = pWriter; /* Allocate a buffer in which to accumulate data */ pWriter->aData = (char *)sqlite3_malloc(p->nNodeSize); if( !pWriter->aData ) return SQLITE_NOMEM; pWriter->nSize = p->nNodeSize; /* Find the next free blockid in the %_segments table */ rc = fts3SqlStmt(p, SQL_NEXT_SEGMENTS_ID, &pStmt, 0); if( rc!=SQLITE_OK ) return rc; if( SQLITE_ROW==sqlite3_step(pStmt) ){ pWriter->iFree = sqlite3_column_int64(pStmt, 0); pWriter->iFirst = pWriter->iFree; } rc = sqlite3_reset(pStmt); if( rc!=SQLITE_OK ) return rc; } nData = pWriter->nData; nPrefix = fts3PrefixCompress(pWriter->zTerm, pWriter->nTerm, zTerm, nTerm); nSuffix = nTerm-nPrefix; /* Figure out how many bytes are required by this new entry */ nReq = sqlite3Fts3VarintLen(nPrefix) + /* varint containing prefix size */ sqlite3Fts3VarintLen(nSuffix) + /* varint containing suffix size */ nSuffix + /* Term suffix */ sqlite3Fts3VarintLen(nDoclist) + /* Size of doclist */ nDoclist; /* Doclist data */ if( nData>0 && nData+nReq>p->nNodeSize ){ int rc; /* The current leaf node is full. Write it out to the database. */ rc = fts3WriteSegment(p, pWriter->iFree++, pWriter->aData, nData); if( rc!=SQLITE_OK ) return rc; p->nLeafAdd++; /* Add the current term to the interior node tree. The term added to ** the interior tree must: ** ** a) be greater than the largest term on the leaf node just written ** to the database (still available in pWriter->zTerm), and ** ** b) be less than or equal to the term about to be added to the new ** leaf node (zTerm/nTerm). ** ** In other words, it must be the prefix of zTerm 1 byte longer than ** the common prefix (if any) of zTerm and pWriter->zTerm. */ assert( nPrefixpTree, isCopyTerm, zTerm, nPrefix+1); if( rc!=SQLITE_OK ) return rc; nData = 0; pWriter->nTerm = 0; nPrefix = 0; nSuffix = nTerm; nReq = 1 + /* varint containing prefix size */ sqlite3Fts3VarintLen(nTerm) + /* varint containing suffix size */ nTerm + /* Term suffix */ sqlite3Fts3VarintLen(nDoclist) + /* Size of doclist */ nDoclist; /* Doclist data */ } /* Increase the total number of bytes written to account for the new entry. */ pWriter->nLeafData += nReq; /* If the buffer currently allocated is too small for this entry, realloc ** the buffer to make it large enough. */ if( nReq>pWriter->nSize ){ char *aNew = sqlite3_realloc(pWriter->aData, nReq); if( !aNew ) return SQLITE_NOMEM; pWriter->aData = aNew; pWriter->nSize = nReq; } assert( nData+nReq<=pWriter->nSize ); /* Append the prefix-compressed term and doclist to the buffer. */ nData += sqlite3Fts3PutVarint(&pWriter->aData[nData], nPrefix); nData += sqlite3Fts3PutVarint(&pWriter->aData[nData], nSuffix); memcpy(&pWriter->aData[nData], &zTerm[nPrefix], nSuffix); nData += nSuffix; nData += sqlite3Fts3PutVarint(&pWriter->aData[nData], nDoclist); memcpy(&pWriter->aData[nData], aDoclist, nDoclist); pWriter->nData = nData + nDoclist; /* Save the current term so that it can be used to prefix-compress the next. ** If the isCopyTerm parameter is true, then the buffer pointed to by ** zTerm is transient, so take a copy of the term data. Otherwise, just ** store a copy of the pointer. */ if( isCopyTerm ){ if( nTerm>pWriter->nMalloc ){ char *zNew = sqlite3_realloc(pWriter->zMalloc, nTerm*2); if( !zNew ){ return SQLITE_NOMEM; } pWriter->nMalloc = nTerm*2; pWriter->zMalloc = zNew; pWriter->zTerm = zNew; } assert( pWriter->zTerm==pWriter->zMalloc ); memcpy(pWriter->zTerm, zTerm, nTerm); }else{ pWriter->zTerm = (char *)zTerm; } pWriter->nTerm = nTerm; return SQLITE_OK; } /* ** Flush all data associated with the SegmentWriter object pWriter to the ** database. This function must be called after all terms have been added ** to the segment using fts3SegWriterAdd(). If successful, SQLITE_OK is ** returned. Otherwise, an SQLite error code. */ static int fts3SegWriterFlush( Fts3Table *p, /* Virtual table handle */ SegmentWriter *pWriter, /* SegmentWriter to flush to the db */ sqlite3_int64 iLevel, /* Value for 'level' column of %_segdir */ int iIdx /* Value for 'idx' column of %_segdir */ ){ int rc; /* Return code */ if( pWriter->pTree ){ sqlite3_int64 iLast = 0; /* Largest block id written to database */ sqlite3_int64 iLastLeaf; /* Largest leaf block id written to db */ char *zRoot = NULL; /* Pointer to buffer containing root node */ int nRoot = 0; /* Size of buffer zRoot */ iLastLeaf = pWriter->iFree; rc = fts3WriteSegment(p, pWriter->iFree++, pWriter->aData, pWriter->nData); if( rc==SQLITE_OK ){ rc = fts3NodeWrite(p, pWriter->pTree, 1, pWriter->iFirst, pWriter->iFree, &iLast, &zRoot, &nRoot); } if( rc==SQLITE_OK ){ rc = fts3WriteSegdir(p, iLevel, iIdx, pWriter->iFirst, iLastLeaf, iLast, pWriter->nLeafData, zRoot, nRoot); } }else{ /* The entire tree fits on the root node. Write it to the segdir table. */ rc = fts3WriteSegdir(p, iLevel, iIdx, 0, 0, 0, pWriter->nLeafData, pWriter->aData, pWriter->nData); } p->nLeafAdd++; return rc; } /* ** Release all memory held by the SegmentWriter object passed as the ** first argument. */ static void fts3SegWriterFree(SegmentWriter *pWriter){ if( pWriter ){ sqlite3_free(pWriter->aData); sqlite3_free(pWriter->zMalloc); fts3NodeFree(pWriter->pTree); sqlite3_free(pWriter); } } /* ** The first value in the apVal[] array is assumed to contain an integer. ** This function tests if there exist any documents with docid values that ** are different from that integer. i.e. if deleting the document with docid ** pRowid would mean the FTS3 table were empty. ** ** If successful, *pisEmpty is set to true if the table is empty except for ** document pRowid, or false otherwise, and SQLITE_OK is returned. If an ** error occurs, an SQLite error code is returned. */ static int fts3IsEmpty(Fts3Table *p, sqlite3_value *pRowid, int *pisEmpty){ sqlite3_stmt *pStmt; int rc; if( p->zContentTbl ){ /* If using the content=xxx option, assume the table is never empty */ *pisEmpty = 0; rc = SQLITE_OK; }else{ rc = fts3SqlStmt(p, SQL_IS_EMPTY, &pStmt, &pRowid); if( rc==SQLITE_OK ){ if( SQLITE_ROW==sqlite3_step(pStmt) ){ *pisEmpty = sqlite3_column_int(pStmt, 0); } rc = sqlite3_reset(pStmt); } } return rc; } /* ** Set *pnMax to the largest segment level in the database for the index ** iIndex. ** ** Segment levels are stored in the 'level' column of the %_segdir table. ** ** Return SQLITE_OK if successful, or an SQLite error code if not. */ static int fts3SegmentMaxLevel( Fts3Table *p, int iLangid, int iIndex, sqlite3_int64 *pnMax ){ sqlite3_stmt *pStmt; int rc; assert( iIndex>=0 && iIndexnIndex ); /* Set pStmt to the compiled version of: ** ** SELECT max(level) FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ? ** ** (1024 is actually the value of macro FTS3_SEGDIR_PREFIXLEVEL_STR). */ rc = fts3SqlStmt(p, SQL_SELECT_SEGDIR_MAX_LEVEL, &pStmt, 0); if( rc!=SQLITE_OK ) return rc; sqlite3_bind_int64(pStmt, 1, getAbsoluteLevel(p, iLangid, iIndex, 0)); sqlite3_bind_int64(pStmt, 2, getAbsoluteLevel(p, iLangid, iIndex, FTS3_SEGDIR_MAXLEVEL-1) ); if( SQLITE_ROW==sqlite3_step(pStmt) ){ *pnMax = sqlite3_column_int64(pStmt, 0); } return sqlite3_reset(pStmt); } /* ** iAbsLevel is an absolute level that may be assumed to exist within ** the database. This function checks if it is the largest level number ** within its index. Assuming no error occurs, *pbMax is set to 1 if ** iAbsLevel is indeed the largest level, or 0 otherwise, and SQLITE_OK ** is returned. If an error occurs, an error code is returned and the ** final value of *pbMax is undefined. */ static int fts3SegmentIsMaxLevel(Fts3Table *p, i64 iAbsLevel, int *pbMax){ /* Set pStmt to the compiled version of: ** ** SELECT max(level) FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ? ** ** (1024 is actually the value of macro FTS3_SEGDIR_PREFIXLEVEL_STR). */ sqlite3_stmt *pStmt; int rc = fts3SqlStmt(p, SQL_SELECT_SEGDIR_MAX_LEVEL, &pStmt, 0); if( rc!=SQLITE_OK ) return rc; sqlite3_bind_int64(pStmt, 1, iAbsLevel+1); sqlite3_bind_int64(pStmt, 2, ((iAbsLevel/FTS3_SEGDIR_MAXLEVEL)+1) * FTS3_SEGDIR_MAXLEVEL ); *pbMax = 0; if( SQLITE_ROW==sqlite3_step(pStmt) ){ *pbMax = sqlite3_column_type(pStmt, 0)==SQLITE_NULL; } return sqlite3_reset(pStmt); } /* ** Delete all entries in the %_segments table associated with the segment ** opened with seg-reader pSeg. This function does not affect the contents ** of the %_segdir table. */ static int fts3DeleteSegment( Fts3Table *p, /* FTS table handle */ Fts3SegReader *pSeg /* Segment to delete */ ){ int rc = SQLITE_OK; /* Return code */ if( pSeg->iStartBlock ){ sqlite3_stmt *pDelete; /* SQL statement to delete rows */ rc = fts3SqlStmt(p, SQL_DELETE_SEGMENTS_RANGE, &pDelete, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pDelete, 1, pSeg->iStartBlock); sqlite3_bind_int64(pDelete, 2, pSeg->iEndBlock); sqlite3_step(pDelete); rc = sqlite3_reset(pDelete); } } return rc; } /* ** This function is used after merging multiple segments into a single large ** segment to delete the old, now redundant, segment b-trees. Specifically, ** it: ** ** 1) Deletes all %_segments entries for the segments associated with ** each of the SegReader objects in the array passed as the third ** argument, and ** ** 2) deletes all %_segdir entries with level iLevel, or all %_segdir ** entries regardless of level if (iLevel<0). ** ** SQLITE_OK is returned if successful, otherwise an SQLite error code. */ static int fts3DeleteSegdir( Fts3Table *p, /* Virtual table handle */ int iLangid, /* Language id */ int iIndex, /* Index for p->aIndex */ int iLevel, /* Level of %_segdir entries to delete */ Fts3SegReader **apSegment, /* Array of SegReader objects */ int nReader /* Size of array apSegment */ ){ int rc = SQLITE_OK; /* Return Code */ int i; /* Iterator variable */ sqlite3_stmt *pDelete = 0; /* SQL statement to delete rows */ for(i=0; rc==SQLITE_OK && i=0 || iLevel==FTS3_SEGCURSOR_ALL ); if( iLevel==FTS3_SEGCURSOR_ALL ){ rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_RANGE, &pDelete, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pDelete, 1, getAbsoluteLevel(p, iLangid, iIndex, 0)); sqlite3_bind_int64(pDelete, 2, getAbsoluteLevel(p, iLangid, iIndex, FTS3_SEGDIR_MAXLEVEL-1) ); } }else{ rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_LEVEL, &pDelete, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64( pDelete, 1, getAbsoluteLevel(p, iLangid, iIndex, iLevel) ); } } if( rc==SQLITE_OK ){ sqlite3_step(pDelete); rc = sqlite3_reset(pDelete); } return rc; } /* ** When this function is called, buffer *ppList (size *pnList bytes) contains ** a position list that may (or may not) feature multiple columns. This ** function adjusts the pointer *ppList and the length *pnList so that they ** identify the subset of the position list that corresponds to column iCol. ** ** If there are no entries in the input position list for column iCol, then ** *pnList is set to zero before returning. ** ** If parameter bZero is non-zero, then any part of the input list following ** the end of the output list is zeroed before returning. */ static void fts3ColumnFilter( int iCol, /* Column to filter on */ int bZero, /* Zero out anything following *ppList */ char **ppList, /* IN/OUT: Pointer to position list */ int *pnList /* IN/OUT: Size of buffer *ppList in bytes */ ){ char *pList = *ppList; int nList = *pnList; char *pEnd = &pList[nList]; int iCurrent = 0; char *p = pList; assert( iCol>=0 ); while( 1 ){ char c = 0; while( ppMsr->nBuffer ){ char *pNew; pMsr->nBuffer = nList*2; pNew = (char *)sqlite3_realloc(pMsr->aBuffer, pMsr->nBuffer); if( !pNew ) return SQLITE_NOMEM; pMsr->aBuffer = pNew; } memcpy(pMsr->aBuffer, pList, nList); return SQLITE_OK; } int sqlite3Fts3MsrIncrNext( Fts3Table *p, /* Virtual table handle */ Fts3MultiSegReader *pMsr, /* Multi-segment-reader handle */ sqlite3_int64 *piDocid, /* OUT: Docid value */ char **paPoslist, /* OUT: Pointer to position list */ int *pnPoslist /* OUT: Size of position list in bytes */ ){ int nMerge = pMsr->nAdvance; Fts3SegReader **apSegment = pMsr->apSegment; int (*xCmp)(Fts3SegReader *, Fts3SegReader *) = ( p->bDescIdx ? fts3SegReaderDoclistCmpRev : fts3SegReaderDoclistCmp ); if( nMerge==0 ){ *paPoslist = 0; return SQLITE_OK; } while( 1 ){ Fts3SegReader *pSeg; pSeg = pMsr->apSegment[0]; if( pSeg->pOffsetList==0 ){ *paPoslist = 0; break; }else{ int rc; char *pList; int nList; int j; sqlite3_int64 iDocid = apSegment[0]->iDocid; rc = fts3SegReaderNextDocid(p, apSegment[0], &pList, &nList); j = 1; while( rc==SQLITE_OK && jpOffsetList && apSegment[j]->iDocid==iDocid ){ rc = fts3SegReaderNextDocid(p, apSegment[j], 0, 0); j++; } if( rc!=SQLITE_OK ) return rc; fts3SegReaderSort(pMsr->apSegment, nMerge, j, xCmp); if( nList>0 && fts3SegReaderIsPending(apSegment[0]) ){ rc = fts3MsrBufferData(pMsr, pList, nList+1); if( rc!=SQLITE_OK ) return rc; assert( (pMsr->aBuffer[nList] & 0xFE)==0x00 ); pList = pMsr->aBuffer; } if( pMsr->iColFilter>=0 ){ fts3ColumnFilter(pMsr->iColFilter, 1, &pList, &nList); } if( nList>0 ){ *paPoslist = pList; *piDocid = iDocid; *pnPoslist = nList; break; } } } return SQLITE_OK; } static int fts3SegReaderStart( Fts3Table *p, /* Virtual table handle */ Fts3MultiSegReader *pCsr, /* Cursor object */ const char *zTerm, /* Term searched for (or NULL) */ int nTerm /* Length of zTerm in bytes */ ){ int i; int nSeg = pCsr->nSegment; /* If the Fts3SegFilter defines a specific term (or term prefix) to search ** for, then advance each segment iterator until it points to a term of ** equal or greater value than the specified term. This prevents many ** unnecessary merge/sort operations for the case where single segment ** b-tree leaf nodes contain more than one term. */ for(i=0; pCsr->bRestart==0 && inSegment; i++){ int res = 0; Fts3SegReader *pSeg = pCsr->apSegment[i]; do { int rc = fts3SegReaderNext(p, pSeg, 0); if( rc!=SQLITE_OK ) return rc; }while( zTerm && (res = fts3SegReaderTermCmp(pSeg, zTerm, nTerm))<0 ); if( pSeg->bLookup && res!=0 ){ fts3SegReaderSetEof(pSeg); } } fts3SegReaderSort(pCsr->apSegment, nSeg, nSeg, fts3SegReaderCmp); return SQLITE_OK; } int sqlite3Fts3SegReaderStart( Fts3Table *p, /* Virtual table handle */ Fts3MultiSegReader *pCsr, /* Cursor object */ Fts3SegFilter *pFilter /* Restrictions on range of iteration */ ){ pCsr->pFilter = pFilter; return fts3SegReaderStart(p, pCsr, pFilter->zTerm, pFilter->nTerm); } int sqlite3Fts3MsrIncrStart( Fts3Table *p, /* Virtual table handle */ Fts3MultiSegReader *pCsr, /* Cursor object */ int iCol, /* Column to match on. */ const char *zTerm, /* Term to iterate through a doclist for */ int nTerm /* Number of bytes in zTerm */ ){ int i; int rc; int nSegment = pCsr->nSegment; int (*xCmp)(Fts3SegReader *, Fts3SegReader *) = ( p->bDescIdx ? fts3SegReaderDoclistCmpRev : fts3SegReaderDoclistCmp ); assert( pCsr->pFilter==0 ); assert( zTerm && nTerm>0 ); /* Advance each segment iterator until it points to the term zTerm/nTerm. */ rc = fts3SegReaderStart(p, pCsr, zTerm, nTerm); if( rc!=SQLITE_OK ) return rc; /* Determine how many of the segments actually point to zTerm/nTerm. */ for(i=0; iapSegment[i]; if( !pSeg->aNode || fts3SegReaderTermCmp(pSeg, zTerm, nTerm) ){ break; } } pCsr->nAdvance = i; /* Advance each of the segments to point to the first docid. */ for(i=0; inAdvance; i++){ rc = fts3SegReaderFirstDocid(p, pCsr->apSegment[i]); if( rc!=SQLITE_OK ) return rc; } fts3SegReaderSort(pCsr->apSegment, i, i, xCmp); assert( iCol<0 || iColnColumn ); pCsr->iColFilter = iCol; return SQLITE_OK; } /* ** This function is called on a MultiSegReader that has been started using ** sqlite3Fts3MsrIncrStart(). One or more calls to MsrIncrNext() may also ** have been made. Calling this function puts the MultiSegReader in such ** a state that if the next two calls are: ** ** sqlite3Fts3SegReaderStart() ** sqlite3Fts3SegReaderStep() ** ** then the entire doclist for the term is available in ** MultiSegReader.aDoclist/nDoclist. */ int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr){ int i; /* Used to iterate through segment-readers */ assert( pCsr->zTerm==0 ); assert( pCsr->nTerm==0 ); assert( pCsr->aDoclist==0 ); assert( pCsr->nDoclist==0 ); pCsr->nAdvance = 0; pCsr->bRestart = 1; for(i=0; inSegment; i++){ pCsr->apSegment[i]->pOffsetList = 0; pCsr->apSegment[i]->nOffsetList = 0; pCsr->apSegment[i]->iDocid = 0; } return SQLITE_OK; } int sqlite3Fts3SegReaderStep( Fts3Table *p, /* Virtual table handle */ Fts3MultiSegReader *pCsr /* Cursor object */ ){ int rc = SQLITE_OK; int isIgnoreEmpty = (pCsr->pFilter->flags & FTS3_SEGMENT_IGNORE_EMPTY); int isRequirePos = (pCsr->pFilter->flags & FTS3_SEGMENT_REQUIRE_POS); int isColFilter = (pCsr->pFilter->flags & FTS3_SEGMENT_COLUMN_FILTER); int isPrefix = (pCsr->pFilter->flags & FTS3_SEGMENT_PREFIX); int isScan = (pCsr->pFilter->flags & FTS3_SEGMENT_SCAN); int isFirst = (pCsr->pFilter->flags & FTS3_SEGMENT_FIRST); Fts3SegReader **apSegment = pCsr->apSegment; int nSegment = pCsr->nSegment; Fts3SegFilter *pFilter = pCsr->pFilter; int (*xCmp)(Fts3SegReader *, Fts3SegReader *) = ( p->bDescIdx ? fts3SegReaderDoclistCmpRev : fts3SegReaderDoclistCmp ); if( pCsr->nSegment==0 ) return SQLITE_OK; do { int nMerge; int i; /* Advance the first pCsr->nAdvance entries in the apSegment[] array ** forward. Then sort the list in order of current term again. */ for(i=0; inAdvance; i++){ Fts3SegReader *pSeg = apSegment[i]; if( pSeg->bLookup ){ fts3SegReaderSetEof(pSeg); }else{ rc = fts3SegReaderNext(p, pSeg, 0); } if( rc!=SQLITE_OK ) return rc; } fts3SegReaderSort(apSegment, nSegment, pCsr->nAdvance, fts3SegReaderCmp); pCsr->nAdvance = 0; /* If all the seg-readers are at EOF, we're finished. return SQLITE_OK. */ assert( rc==SQLITE_OK ); if( apSegment[0]->aNode==0 ) break; pCsr->nTerm = apSegment[0]->nTerm; pCsr->zTerm = apSegment[0]->zTerm; /* If this is a prefix-search, and if the term that apSegment[0] points ** to does not share a suffix with pFilter->zTerm/nTerm, then all ** required callbacks have been made. In this case exit early. ** ** Similarly, if this is a search for an exact match, and the first term ** of segment apSegment[0] is not a match, exit early. */ if( pFilter->zTerm && !isScan ){ if( pCsr->nTermnTerm || (!isPrefix && pCsr->nTerm>pFilter->nTerm) || memcmp(pCsr->zTerm, pFilter->zTerm, pFilter->nTerm) ){ break; } } nMerge = 1; while( nMergeaNode && apSegment[nMerge]->nTerm==pCsr->nTerm && 0==memcmp(pCsr->zTerm, apSegment[nMerge]->zTerm, pCsr->nTerm) ){ nMerge++; } assert( isIgnoreEmpty || (isRequirePos && !isColFilter) ); if( nMerge==1 && !isIgnoreEmpty && !isFirst && (p->bDescIdx==0 || fts3SegReaderIsPending(apSegment[0])==0) ){ pCsr->nDoclist = apSegment[0]->nDoclist; if( fts3SegReaderIsPending(apSegment[0]) ){ rc = fts3MsrBufferData(pCsr, apSegment[0]->aDoclist, pCsr->nDoclist); pCsr->aDoclist = pCsr->aBuffer; }else{ pCsr->aDoclist = apSegment[0]->aDoclist; } if( rc==SQLITE_OK ) rc = SQLITE_ROW; }else{ int nDoclist = 0; /* Size of doclist */ sqlite3_int64 iPrev = 0; /* Previous docid stored in doclist */ /* The current term of the first nMerge entries in the array ** of Fts3SegReader objects is the same. The doclists must be merged ** and a single term returned with the merged doclist. */ for(i=0; ipOffsetList ){ int j; /* Number of segments that share a docid */ char *pList = 0; int nList = 0; int nByte; sqlite3_int64 iDocid = apSegment[0]->iDocid; fts3SegReaderNextDocid(p, apSegment[0], &pList, &nList); j = 1; while( jpOffsetList && apSegment[j]->iDocid==iDocid ){ fts3SegReaderNextDocid(p, apSegment[j], 0, 0); j++; } if( isColFilter ){ fts3ColumnFilter(pFilter->iCol, 0, &pList, &nList); } if( !isIgnoreEmpty || nList>0 ){ /* Calculate the 'docid' delta value to write into the merged ** doclist. */ sqlite3_int64 iDelta; if( p->bDescIdx && nDoclist>0 ){ iDelta = iPrev - iDocid; }else{ iDelta = iDocid - iPrev; } assert( iDelta>0 || (nDoclist==0 && iDelta==iDocid) ); assert( nDoclist>0 || iDelta==iDocid ); nByte = sqlite3Fts3VarintLen(iDelta) + (isRequirePos?nList+1:0); if( nDoclist+nByte>pCsr->nBuffer ){ char *aNew; pCsr->nBuffer = (nDoclist+nByte)*2; aNew = sqlite3_realloc(pCsr->aBuffer, pCsr->nBuffer); if( !aNew ){ return SQLITE_NOMEM; } pCsr->aBuffer = aNew; } if( isFirst ){ char *a = &pCsr->aBuffer[nDoclist]; int nWrite; nWrite = sqlite3Fts3FirstFilter(iDelta, pList, nList, a); if( nWrite ){ iPrev = iDocid; nDoclist += nWrite; } }else{ nDoclist += sqlite3Fts3PutVarint(&pCsr->aBuffer[nDoclist], iDelta); iPrev = iDocid; if( isRequirePos ){ memcpy(&pCsr->aBuffer[nDoclist], pList, nList); nDoclist += nList; pCsr->aBuffer[nDoclist++] = '\0'; } } } fts3SegReaderSort(apSegment, nMerge, j, xCmp); } if( nDoclist>0 ){ pCsr->aDoclist = pCsr->aBuffer; pCsr->nDoclist = nDoclist; rc = SQLITE_ROW; } } pCsr->nAdvance = nMerge; }while( rc==SQLITE_OK ); return rc; } void sqlite3Fts3SegReaderFinish( Fts3MultiSegReader *pCsr /* Cursor object */ ){ if( pCsr ){ int i; for(i=0; inSegment; i++){ sqlite3Fts3SegReaderFree(pCsr->apSegment[i]); } sqlite3_free(pCsr->apSegment); sqlite3_free(pCsr->aBuffer); pCsr->nSegment = 0; pCsr->apSegment = 0; pCsr->aBuffer = 0; } } /* ** Decode the "end_block" field, selected by column iCol of the SELECT ** statement passed as the first argument. ** ** The "end_block" field may contain either an integer, or a text field ** containing the text representation of two non-negative integers separated ** by one or more space (0x20) characters. In the first case, set *piEndBlock ** to the integer value and *pnByte to zero before returning. In the second, ** set *piEndBlock to the first value and *pnByte to the second. */ static void fts3ReadEndBlockField( sqlite3_stmt *pStmt, int iCol, i64 *piEndBlock, i64 *pnByte ){ const unsigned char *zText = sqlite3_column_text(pStmt, iCol); if( zText ){ int i; int iMul = 1; i64 iVal = 0; for(i=0; zText[i]>='0' && zText[i]<='9'; i++){ iVal = iVal*10 + (zText[i] - '0'); } *piEndBlock = iVal; while( zText[i]==' ' ) i++; iVal = 0; if( zText[i]=='-' ){ i++; iMul = -1; } for(/* no-op */; zText[i]>='0' && zText[i]<='9'; i++){ iVal = iVal*10 + (zText[i] - '0'); } *pnByte = (iVal * (i64)iMul); } } /* ** A segment of size nByte bytes has just been written to absolute level ** iAbsLevel. Promote any segments that should be promoted as a result. */ static int fts3PromoteSegments( Fts3Table *p, /* FTS table handle */ sqlite3_int64 iAbsLevel, /* Absolute level just updated */ sqlite3_int64 nByte /* Size of new segment at iAbsLevel */ ){ int rc = SQLITE_OK; sqlite3_stmt *pRange; rc = fts3SqlStmt(p, SQL_SELECT_LEVEL_RANGE2, &pRange, 0); if( rc==SQLITE_OK ){ int bOk = 0; i64 iLast = (iAbsLevel/FTS3_SEGDIR_MAXLEVEL + 1) * FTS3_SEGDIR_MAXLEVEL - 1; i64 nLimit = (nByte*3)/2; /* Loop through all entries in the %_segdir table corresponding to ** segments in this index on levels greater than iAbsLevel. If there is ** at least one such segment, and it is possible to determine that all ** such segments are smaller than nLimit bytes in size, they will be ** promoted to level iAbsLevel. */ sqlite3_bind_int64(pRange, 1, iAbsLevel+1); sqlite3_bind_int64(pRange, 2, iLast); while( SQLITE_ROW==sqlite3_step(pRange) ){ i64 nSize = 0, dummy; fts3ReadEndBlockField(pRange, 2, &dummy, &nSize); if( nSize<=0 || nSize>nLimit ){ /* If nSize==0, then the %_segdir.end_block field does not not ** contain a size value. This happens if it was written by an ** old version of FTS. In this case it is not possible to determine ** the size of the segment, and so segment promotion does not ** take place. */ bOk = 0; break; } bOk = 1; } rc = sqlite3_reset(pRange); if( bOk ){ int iIdx = 0; sqlite3_stmt *pUpdate1 = 0; sqlite3_stmt *pUpdate2 = 0; if( rc==SQLITE_OK ){ rc = fts3SqlStmt(p, SQL_UPDATE_LEVEL_IDX, &pUpdate1, 0); } if( rc==SQLITE_OK ){ rc = fts3SqlStmt(p, SQL_UPDATE_LEVEL, &pUpdate2, 0); } if( rc==SQLITE_OK ){ /* Loop through all %_segdir entries for segments in this index with ** levels equal to or greater than iAbsLevel. As each entry is visited, ** updated it to set (level = -1) and (idx = N), where N is 0 for the ** oldest segment in the range, 1 for the next oldest, and so on. ** ** In other words, move all segments being promoted to level -1, ** setting the "idx" fields as appropriate to keep them in the same ** order. The contents of level -1 (which is never used, except ** transiently here), will be moved back to level iAbsLevel below. */ sqlite3_bind_int64(pRange, 1, iAbsLevel); while( SQLITE_ROW==sqlite3_step(pRange) ){ sqlite3_bind_int(pUpdate1, 1, iIdx++); sqlite3_bind_int(pUpdate1, 2, sqlite3_column_int(pRange, 0)); sqlite3_bind_int(pUpdate1, 3, sqlite3_column_int(pRange, 1)); sqlite3_step(pUpdate1); rc = sqlite3_reset(pUpdate1); if( rc!=SQLITE_OK ){ sqlite3_reset(pRange); break; } } } if( rc==SQLITE_OK ){ rc = sqlite3_reset(pRange); } /* Move level -1 to level iAbsLevel */ if( rc==SQLITE_OK ){ sqlite3_bind_int64(pUpdate2, 1, iAbsLevel); sqlite3_step(pUpdate2); rc = sqlite3_reset(pUpdate2); } } } return rc; } /* ** Merge all level iLevel segments in the database into a single ** iLevel+1 segment. Or, if iLevel<0, merge all segments into a ** single segment with a level equal to the numerically largest level ** currently present in the database. ** ** If this function is called with iLevel<0, but there is only one ** segment in the database, SQLITE_DONE is returned immediately. ** Otherwise, if successful, SQLITE_OK is returned. If an error occurs, ** an SQLite error code is returned. */ static int fts3SegmentMerge( Fts3Table *p, int iLangid, /* Language id to merge */ int iIndex, /* Index in p->aIndex[] to merge */ int iLevel /* Level to merge */ ){ int rc; /* Return code */ int iIdx = 0; /* Index of new segment */ sqlite3_int64 iNewLevel = 0; /* Level/index to create new segment at */ SegmentWriter *pWriter = 0; /* Used to write the new, merged, segment */ Fts3SegFilter filter; /* Segment term filter condition */ Fts3MultiSegReader csr; /* Cursor to iterate through level(s) */ int bIgnoreEmpty = 0; /* True to ignore empty segments */ i64 iMaxLevel = 0; /* Max level number for this index/langid */ assert( iLevel==FTS3_SEGCURSOR_ALL || iLevel==FTS3_SEGCURSOR_PENDING || iLevel>=0 ); assert( iLevel=0 && iIndexnIndex ); rc = sqlite3Fts3SegReaderCursor(p, iLangid, iIndex, iLevel, 0, 0, 1, 0, &csr); if( rc!=SQLITE_OK || csr.nSegment==0 ) goto finished; if( iLevel!=FTS3_SEGCURSOR_PENDING ){ rc = fts3SegmentMaxLevel(p, iLangid, iIndex, &iMaxLevel); if( rc!=SQLITE_OK ) goto finished; } if( iLevel==FTS3_SEGCURSOR_ALL ){ /* This call is to merge all segments in the database to a single ** segment. The level of the new segment is equal to the numerically ** greatest segment level currently present in the database for this ** index. The idx of the new segment is always 0. */ if( csr.nSegment==1 && 0==fts3SegReaderIsPending(csr.apSegment[0]) ){ rc = SQLITE_DONE; goto finished; } iNewLevel = iMaxLevel; bIgnoreEmpty = 1; }else{ /* This call is to merge all segments at level iLevel. find the next ** available segment index at level iLevel+1. The call to ** fts3AllocateSegdirIdx() will merge the segments at level iLevel+1 to ** a single iLevel+2 segment if necessary. */ assert( FTS3_SEGCURSOR_PENDING==-1 ); iNewLevel = getAbsoluteLevel(p, iLangid, iIndex, iLevel+1); rc = fts3AllocateSegdirIdx(p, iLangid, iIndex, iLevel+1, &iIdx); bIgnoreEmpty = (iLevel!=FTS3_SEGCURSOR_PENDING) && (iNewLevel>iMaxLevel); } if( rc!=SQLITE_OK ) goto finished; assert( csr.nSegment>0 ); assert( iNewLevel>=getAbsoluteLevel(p, iLangid, iIndex, 0) ); assert( iNewLevelnLeafData); } } } finished: fts3SegWriterFree(pWriter); sqlite3Fts3SegReaderFinish(&csr); return rc; } /* ** Flush the contents of pendingTerms to level 0 segments. */ int sqlite3Fts3PendingTermsFlush(Fts3Table *p){ int rc = SQLITE_OK; int i; for(i=0; rc==SQLITE_OK && inIndex; i++){ rc = fts3SegmentMerge(p, p->iPrevLangid, i, FTS3_SEGCURSOR_PENDING); if( rc==SQLITE_DONE ) rc = SQLITE_OK; } sqlite3Fts3PendingTermsClear(p); /* Determine the auto-incr-merge setting if unknown. If enabled, ** estimate the number of leaf blocks of content to be written */ if( rc==SQLITE_OK && p->bHasStat && p->nAutoincrmerge==0xff && p->nLeafAdd>0 ){ sqlite3_stmt *pStmt = 0; rc = fts3SqlStmt(p, SQL_SELECT_STAT, &pStmt, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int(pStmt, 1, FTS_STAT_AUTOINCRMERGE); rc = sqlite3_step(pStmt); if( rc==SQLITE_ROW ){ p->nAutoincrmerge = sqlite3_column_int(pStmt, 0); if( p->nAutoincrmerge==1 ) p->nAutoincrmerge = 8; }else if( rc==SQLITE_DONE ){ p->nAutoincrmerge = 0; } rc = sqlite3_reset(pStmt); } } return rc; } /* ** Encode N integers as varints into a blob. */ static void fts3EncodeIntArray( int N, /* The number of integers to encode */ u32 *a, /* The integer values */ char *zBuf, /* Write the BLOB here */ int *pNBuf /* Write number of bytes if zBuf[] used here */ ){ int i, j; for(i=j=0; iiPrevDocid. The sizes are encoded as ** a blob of varints. */ static void fts3InsertDocsize( int *pRC, /* Result code */ Fts3Table *p, /* Table into which to insert */ u32 *aSz /* Sizes of each column, in tokens */ ){ char *pBlob; /* The BLOB encoding of the document size */ int nBlob; /* Number of bytes in the BLOB */ sqlite3_stmt *pStmt; /* Statement used to insert the encoding */ int rc; /* Result code from subfunctions */ if( *pRC ) return; pBlob = sqlite3_malloc( 10*p->nColumn ); if( pBlob==0 ){ *pRC = SQLITE_NOMEM; return; } fts3EncodeIntArray(p->nColumn, aSz, pBlob, &nBlob); rc = fts3SqlStmt(p, SQL_REPLACE_DOCSIZE, &pStmt, 0); if( rc ){ sqlite3_free(pBlob); *pRC = rc; return; } sqlite3_bind_int64(pStmt, 1, p->iPrevDocid); sqlite3_bind_blob(pStmt, 2, pBlob, nBlob, sqlite3_free); sqlite3_step(pStmt); *pRC = sqlite3_reset(pStmt); } /* ** Record 0 of the %_stat table contains a blob consisting of N varints, ** where N is the number of user defined columns in the fts3 table plus ** two. If nCol is the number of user defined columns, then values of the ** varints are set as follows: ** ** Varint 0: Total number of rows in the table. ** ** Varint 1..nCol: For each column, the total number of tokens stored in ** the column for all rows of the table. ** ** Varint 1+nCol: The total size, in bytes, of all text values in all ** columns of all rows of the table. ** */ static void fts3UpdateDocTotals( int *pRC, /* The result code */ Fts3Table *p, /* Table being updated */ u32 *aSzIns, /* Size increases */ u32 *aSzDel, /* Size decreases */ int nChng /* Change in the number of documents */ ){ char *pBlob; /* Storage for BLOB written into %_stat */ int nBlob; /* Size of BLOB written into %_stat */ u32 *a; /* Array of integers that becomes the BLOB */ sqlite3_stmt *pStmt; /* Statement for reading and writing */ int i; /* Loop counter */ int rc; /* Result code from subfunctions */ const int nStat = p->nColumn+2; if( *pRC ) return; a = sqlite3_malloc( (sizeof(u32)+10)*nStat ); if( a==0 ){ *pRC = SQLITE_NOMEM; return; } pBlob = (char*)&a[nStat]; rc = fts3SqlStmt(p, SQL_SELECT_STAT, &pStmt, 0); if( rc ){ sqlite3_free(a); *pRC = rc; return; } sqlite3_bind_int(pStmt, 1, FTS_STAT_DOCTOTAL); if( sqlite3_step(pStmt)==SQLITE_ROW ){ fts3DecodeIntArray(nStat, a, sqlite3_column_blob(pStmt, 0), sqlite3_column_bytes(pStmt, 0)); }else{ memset(a, 0, sizeof(u32)*(nStat) ); } rc = sqlite3_reset(pStmt); if( rc!=SQLITE_OK ){ sqlite3_free(a); *pRC = rc; return; } if( nChng<0 && a[0]<(u32)(-nChng) ){ a[0] = 0; }else{ a[0] += nChng; } for(i=0; inColumn+1; i++){ u32 x = a[i+1]; if( x+aSzIns[i] < aSzDel[i] ){ x = 0; }else{ x = x + aSzIns[i] - aSzDel[i]; } a[i+1] = x; } fts3EncodeIntArray(nStat, a, pBlob, &nBlob); rc = fts3SqlStmt(p, SQL_REPLACE_STAT, &pStmt, 0); if( rc ){ sqlite3_free(a); *pRC = rc; return; } sqlite3_bind_int(pStmt, 1, FTS_STAT_DOCTOTAL); sqlite3_bind_blob(pStmt, 2, pBlob, nBlob, SQLITE_STATIC); sqlite3_step(pStmt); *pRC = sqlite3_reset(pStmt); sqlite3_free(a); } /* ** Merge the entire database so that there is one segment for each ** iIndex/iLangid combination. */ static int fts3DoOptimize(Fts3Table *p, int bReturnDone){ int bSeenDone = 0; int rc; sqlite3_stmt *pAllLangid = 0; rc = fts3SqlStmt(p, SQL_SELECT_ALL_LANGID, &pAllLangid, 0); if( rc==SQLITE_OK ){ int rc2; sqlite3_bind_int(pAllLangid, 1, p->iPrevLangid); sqlite3_bind_int(pAllLangid, 2, p->nIndex); while( sqlite3_step(pAllLangid)==SQLITE_ROW ){ int i; int iLangid = sqlite3_column_int(pAllLangid, 0); for(i=0; rc==SQLITE_OK && inIndex; i++){ rc = fts3SegmentMerge(p, iLangid, i, FTS3_SEGCURSOR_ALL); if( rc==SQLITE_DONE ){ bSeenDone = 1; rc = SQLITE_OK; } } } rc2 = sqlite3_reset(pAllLangid); if( rc==SQLITE_OK ) rc = rc2; } sqlite3Fts3SegmentsClose(p); sqlite3Fts3PendingTermsClear(p); return (rc==SQLITE_OK && bReturnDone && bSeenDone) ? SQLITE_DONE : rc; } /* ** This function is called when the user executes the following statement: ** ** INSERT INTO () VALUES('rebuild'); ** ** The entire FTS index is discarded and rebuilt. If the table is one ** created using the content=xxx option, then the new index is based on ** the current contents of the xxx table. Otherwise, it is rebuilt based ** on the contents of the %_content table. */ static int fts3DoRebuild(Fts3Table *p){ int rc; /* Return Code */ rc = fts3DeleteAll(p, 0); if( rc==SQLITE_OK ){ u32 *aSz = 0; u32 *aSzIns = 0; u32 *aSzDel = 0; sqlite3_stmt *pStmt = 0; int nEntry = 0; /* Compose and prepare an SQL statement to loop through the content table */ char *zSql = sqlite3_mprintf("SELECT %s" , p->zReadExprlist); if( !zSql ){ rc = SQLITE_NOMEM; }else{ rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); } if( rc==SQLITE_OK ){ int nByte = sizeof(u32) * (p->nColumn+1)*3; aSz = (u32 *)sqlite3_malloc(nByte); if( aSz==0 ){ rc = SQLITE_NOMEM; }else{ memset(aSz, 0, nByte); aSzIns = &aSz[p->nColumn+1]; aSzDel = &aSzIns[p->nColumn+1]; } } while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ int iCol; int iLangid = langidFromSelect(p, pStmt); rc = fts3PendingTermsDocid(p, 0, iLangid, sqlite3_column_int64(pStmt, 0)); memset(aSz, 0, sizeof(aSz[0]) * (p->nColumn+1)); for(iCol=0; rc==SQLITE_OK && iColnColumn; iCol++){ if( p->abNotindexed[iCol]==0 ){ const char *z = (const char *) sqlite3_column_text(pStmt, iCol+1); rc = fts3PendingTermsAdd(p, iLangid, z, iCol, &aSz[iCol]); aSz[p->nColumn] += sqlite3_column_bytes(pStmt, iCol+1); } } if( p->bHasDocsize ){ fts3InsertDocsize(&rc, p, aSz); } if( rc!=SQLITE_OK ){ sqlite3_finalize(pStmt); pStmt = 0; }else{ nEntry++; for(iCol=0; iCol<=p->nColumn; iCol++){ aSzIns[iCol] += aSz[iCol]; } } } if( p->bFts4 ){ fts3UpdateDocTotals(&rc, p, aSzIns, aSzDel, nEntry); } sqlite3_free(aSz); if( pStmt ){ int rc2 = sqlite3_finalize(pStmt); if( rc==SQLITE_OK ){ rc = rc2; } } } return rc; } /* ** This function opens a cursor used to read the input data for an ** incremental merge operation. Specifically, it opens a cursor to scan ** the oldest nSeg segments (idx=0 through idx=(nSeg-1)) in absolute ** level iAbsLevel. */ static int fts3IncrmergeCsr( Fts3Table *p, /* FTS3 table handle */ sqlite3_int64 iAbsLevel, /* Absolute level to open */ int nSeg, /* Number of segments to merge */ Fts3MultiSegReader *pCsr /* Cursor object to populate */ ){ int rc; /* Return Code */ sqlite3_stmt *pStmt = 0; /* Statement used to read %_segdir entry */ int nByte; /* Bytes allocated at pCsr->apSegment[] */ /* Allocate space for the Fts3MultiSegReader.aCsr[] array */ memset(pCsr, 0, sizeof(*pCsr)); nByte = sizeof(Fts3SegReader *) * nSeg; pCsr->apSegment = (Fts3SegReader **)sqlite3_malloc(nByte); if( pCsr->apSegment==0 ){ rc = SQLITE_NOMEM; }else{ memset(pCsr->apSegment, 0, nByte); rc = fts3SqlStmt(p, SQL_SELECT_LEVEL, &pStmt, 0); } if( rc==SQLITE_OK ){ int i; int rc2; sqlite3_bind_int64(pStmt, 1, iAbsLevel); assert( pCsr->nSegment==0 ); for(i=0; rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW && iapSegment[i] ); pCsr->nSegment++; } rc2 = sqlite3_reset(pStmt); if( rc==SQLITE_OK ) rc = rc2; } return rc; } typedef struct IncrmergeWriter IncrmergeWriter; typedef struct NodeWriter NodeWriter; typedef struct Blob Blob; typedef struct NodeReader NodeReader; /* ** An instance of the following structure is used as a dynamic buffer ** to build up nodes or other blobs of data in. ** ** The function blobGrowBuffer() is used to extend the allocation. */ struct Blob { char *a; /* Pointer to allocation */ int n; /* Number of valid bytes of data in a[] */ int nAlloc; /* Allocated size of a[] (nAlloc>=n) */ }; /* ** This structure is used to build up buffers containing segment b-tree ** nodes (blocks). */ struct NodeWriter { sqlite3_int64 iBlock; /* Current block id */ Blob key; /* Last key written to the current block */ Blob block; /* Current block image */ }; /* ** An object of this type contains the state required to create or append ** to an appendable b-tree segment. */ struct IncrmergeWriter { int nLeafEst; /* Space allocated for leaf blocks */ int nWork; /* Number of leaf pages flushed */ sqlite3_int64 iAbsLevel; /* Absolute level of input segments */ int iIdx; /* Index of *output* segment in iAbsLevel+1 */ sqlite3_int64 iStart; /* Block number of first allocated block */ sqlite3_int64 iEnd; /* Block number of last allocated block */ sqlite3_int64 nLeafData; /* Bytes of leaf page data so far */ u8 bNoLeafData; /* If true, store 0 for segment size */ NodeWriter aNodeWriter[FTS_MAX_APPENDABLE_HEIGHT]; }; /* ** An object of the following type is used to read data from a single ** FTS segment node. See the following functions: ** ** nodeReaderInit() ** nodeReaderNext() ** nodeReaderRelease() */ struct NodeReader { const char *aNode; int nNode; int iOff; /* Current offset within aNode[] */ /* Output variables. Containing the current node entry. */ sqlite3_int64 iChild; /* Pointer to child node */ Blob term; /* Current term */ const char *aDoclist; /* Pointer to doclist */ int nDoclist; /* Size of doclist in bytes */ }; /* ** If *pRc is not SQLITE_OK when this function is called, it is a no-op. ** Otherwise, if the allocation at pBlob->a is not already at least nMin ** bytes in size, extend (realloc) it to be so. ** ** If an OOM error occurs, set *pRc to SQLITE_NOMEM and leave pBlob->a ** unmodified. Otherwise, if the allocation succeeds, update pBlob->nAlloc ** to reflect the new size of the pBlob->a[] buffer. */ static void blobGrowBuffer(Blob *pBlob, int nMin, int *pRc){ if( *pRc==SQLITE_OK && nMin>pBlob->nAlloc ){ int nAlloc = nMin; char *a = (char *)sqlite3_realloc(pBlob->a, nAlloc); if( a ){ pBlob->nAlloc = nAlloc; pBlob->a = a; }else{ *pRc = SQLITE_NOMEM; } } } /* ** Attempt to advance the node-reader object passed as the first argument to ** the next entry on the node. ** ** Return an error code if an error occurs (SQLITE_NOMEM is possible). ** Otherwise return SQLITE_OK. If there is no next entry on the node ** (e.g. because the current entry is the last) set NodeReader->aNode to ** NULL to indicate EOF. Otherwise, populate the NodeReader structure output ** variables for the new entry. */ static int nodeReaderNext(NodeReader *p){ int bFirst = (p->term.n==0); /* True for first term on the node */ int nPrefix = 0; /* Bytes to copy from previous term */ int nSuffix = 0; /* Bytes to append to the prefix */ int rc = SQLITE_OK; /* Return code */ assert( p->aNode ); if( p->iChild && bFirst==0 ) p->iChild++; if( p->iOff>=p->nNode ){ /* EOF */ p->aNode = 0; }else{ if( bFirst==0 ){ p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &nPrefix); } p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &nSuffix); blobGrowBuffer(&p->term, nPrefix+nSuffix, &rc); if( rc==SQLITE_OK ){ memcpy(&p->term.a[nPrefix], &p->aNode[p->iOff], nSuffix); p->term.n = nPrefix+nSuffix; p->iOff += nSuffix; if( p->iChild==0 ){ p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &p->nDoclist); p->aDoclist = &p->aNode[p->iOff]; p->iOff += p->nDoclist; } } } assert( p->iOff<=p->nNode ); return rc; } /* ** Release all dynamic resources held by node-reader object *p. */ static void nodeReaderRelease(NodeReader *p){ sqlite3_free(p->term.a); } /* ** Initialize a node-reader object to read the node in buffer aNode/nNode. ** ** If successful, SQLITE_OK is returned and the NodeReader object set to ** point to the first entry on the node (if any). Otherwise, an SQLite ** error code is returned. */ static int nodeReaderInit(NodeReader *p, const char *aNode, int nNode){ memset(p, 0, sizeof(NodeReader)); p->aNode = aNode; p->nNode = nNode; /* Figure out if this is a leaf or an internal node. */ if( p->aNode[0] ){ /* An internal node. */ p->iOff = 1 + sqlite3Fts3GetVarint(&p->aNode[1], &p->iChild); }else{ p->iOff = 1; } return nodeReaderNext(p); } /* ** This function is called while writing an FTS segment each time a leaf o ** node is finished and written to disk. The key (zTerm/nTerm) is guaranteed ** to be greater than the largest key on the node just written, but smaller ** than or equal to the first key that will be written to the next leaf ** node. ** ** The block id of the leaf node just written to disk may be found in ** (pWriter->aNodeWriter[0].iBlock) when this function is called. */ static int fts3IncrmergePush( Fts3Table *p, /* Fts3 table handle */ IncrmergeWriter *pWriter, /* Writer object */ const char *zTerm, /* Term to write to internal node */ int nTerm /* Bytes at zTerm */ ){ sqlite3_int64 iPtr = pWriter->aNodeWriter[0].iBlock; int iLayer; assert( nTerm>0 ); for(iLayer=1; ALWAYS(iLayeraNodeWriter[iLayer]; int rc = SQLITE_OK; int nPrefix; int nSuffix; int nSpace; /* Figure out how much space the key will consume if it is written to ** the current node of layer iLayer. Due to the prefix compression, ** the space required changes depending on which node the key is to ** be added to. */ nPrefix = fts3PrefixCompress(pNode->key.a, pNode->key.n, zTerm, nTerm); nSuffix = nTerm - nPrefix; nSpace = sqlite3Fts3VarintLen(nPrefix); nSpace += sqlite3Fts3VarintLen(nSuffix) + nSuffix; if( pNode->key.n==0 || (pNode->block.n + nSpace)<=p->nNodeSize ){ /* If the current node of layer iLayer contains zero keys, or if adding ** the key to it will not cause it to grow to larger than nNodeSize ** bytes in size, write the key here. */ Blob *pBlk = &pNode->block; if( pBlk->n==0 ){ blobGrowBuffer(pBlk, p->nNodeSize, &rc); if( rc==SQLITE_OK ){ pBlk->a[0] = (char)iLayer; pBlk->n = 1 + sqlite3Fts3PutVarint(&pBlk->a[1], iPtr); } } blobGrowBuffer(pBlk, pBlk->n + nSpace, &rc); blobGrowBuffer(&pNode->key, nTerm, &rc); if( rc==SQLITE_OK ){ if( pNode->key.n ){ pBlk->n += sqlite3Fts3PutVarint(&pBlk->a[pBlk->n], nPrefix); } pBlk->n += sqlite3Fts3PutVarint(&pBlk->a[pBlk->n], nSuffix); memcpy(&pBlk->a[pBlk->n], &zTerm[nPrefix], nSuffix); pBlk->n += nSuffix; memcpy(pNode->key.a, zTerm, nTerm); pNode->key.n = nTerm; } }else{ /* Otherwise, flush the current node of layer iLayer to disk. ** Then allocate a new, empty sibling node. The key will be written ** into the parent of this node. */ rc = fts3WriteSegment(p, pNode->iBlock, pNode->block.a, pNode->block.n); assert( pNode->block.nAlloc>=p->nNodeSize ); pNode->block.a[0] = (char)iLayer; pNode->block.n = 1 + sqlite3Fts3PutVarint(&pNode->block.a[1], iPtr+1); iNextPtr = pNode->iBlock; pNode->iBlock++; pNode->key.n = 0; } if( rc!=SQLITE_OK || iNextPtr==0 ) return rc; iPtr = iNextPtr; } assert( 0 ); return 0; } /* ** Append a term and (optionally) doclist to the FTS segment node currently ** stored in blob *pNode. The node need not contain any terms, but the ** header must be written before this function is called. ** ** A node header is a single 0x00 byte for a leaf node, or a height varint ** followed by the left-hand-child varint for an internal node. ** ** The term to be appended is passed via arguments zTerm/nTerm. For a ** leaf node, the doclist is passed as aDoclist/nDoclist. For an internal ** node, both aDoclist and nDoclist must be passed 0. ** ** If the size of the value in blob pPrev is zero, then this is the first ** term written to the node. Otherwise, pPrev contains a copy of the ** previous term. Before this function returns, it is updated to contain a ** copy of zTerm/nTerm. ** ** It is assumed that the buffer associated with pNode is already large ** enough to accommodate the new entry. The buffer associated with pPrev ** is extended by this function if requrired. ** ** If an error (i.e. OOM condition) occurs, an SQLite error code is ** returned. Otherwise, SQLITE_OK. */ static int fts3AppendToNode( Blob *pNode, /* Current node image to append to */ Blob *pPrev, /* Buffer containing previous term written */ const char *zTerm, /* New term to write */ int nTerm, /* Size of zTerm in bytes */ const char *aDoclist, /* Doclist (or NULL) to write */ int nDoclist /* Size of aDoclist in bytes */ ){ int rc = SQLITE_OK; /* Return code */ int bFirst = (pPrev->n==0); /* True if this is the first term written */ int nPrefix; /* Size of term prefix in bytes */ int nSuffix; /* Size of term suffix in bytes */ /* Node must have already been started. There must be a doclist for a ** leaf node, and there must not be a doclist for an internal node. */ assert( pNode->n>0 ); assert( (pNode->a[0]=='\0')==(aDoclist!=0) ); blobGrowBuffer(pPrev, nTerm, &rc); if( rc!=SQLITE_OK ) return rc; nPrefix = fts3PrefixCompress(pPrev->a, pPrev->n, zTerm, nTerm); nSuffix = nTerm - nPrefix; memcpy(pPrev->a, zTerm, nTerm); pPrev->n = nTerm; if( bFirst==0 ){ pNode->n += sqlite3Fts3PutVarint(&pNode->a[pNode->n], nPrefix); } pNode->n += sqlite3Fts3PutVarint(&pNode->a[pNode->n], nSuffix); memcpy(&pNode->a[pNode->n], &zTerm[nPrefix], nSuffix); pNode->n += nSuffix; if( aDoclist ){ pNode->n += sqlite3Fts3PutVarint(&pNode->a[pNode->n], nDoclist); memcpy(&pNode->a[pNode->n], aDoclist, nDoclist); pNode->n += nDoclist; } assert( pNode->n<=pNode->nAlloc ); return SQLITE_OK; } /* ** Append the current term and doclist pointed to by cursor pCsr to the ** appendable b-tree segment opened for writing by pWriter. ** ** Return SQLITE_OK if successful, or an SQLite error code otherwise. */ static int fts3IncrmergeAppend( Fts3Table *p, /* Fts3 table handle */ IncrmergeWriter *pWriter, /* Writer object */ Fts3MultiSegReader *pCsr /* Cursor containing term and doclist */ ){ const char *zTerm = pCsr->zTerm; int nTerm = pCsr->nTerm; const char *aDoclist = pCsr->aDoclist; int nDoclist = pCsr->nDoclist; int rc = SQLITE_OK; /* Return code */ int nSpace; /* Total space in bytes required on leaf */ int nPrefix; /* Size of prefix shared with previous term */ int nSuffix; /* Size of suffix (nTerm - nPrefix) */ NodeWriter *pLeaf; /* Object used to write leaf nodes */ pLeaf = &pWriter->aNodeWriter[0]; nPrefix = fts3PrefixCompress(pLeaf->key.a, pLeaf->key.n, zTerm, nTerm); nSuffix = nTerm - nPrefix; nSpace = sqlite3Fts3VarintLen(nPrefix); nSpace += sqlite3Fts3VarintLen(nSuffix) + nSuffix; nSpace += sqlite3Fts3VarintLen(nDoclist) + nDoclist; /* If the current block is not empty, and if adding this term/doclist ** to the current block would make it larger than Fts3Table.nNodeSize ** bytes, write this block out to the database. */ if( pLeaf->block.n>0 && (pLeaf->block.n + nSpace)>p->nNodeSize ){ rc = fts3WriteSegment(p, pLeaf->iBlock, pLeaf->block.a, pLeaf->block.n); pWriter->nWork++; /* Add the current term to the parent node. The term added to the ** parent must: ** ** a) be greater than the largest term on the leaf node just written ** to the database (still available in pLeaf->key), and ** ** b) be less than or equal to the term about to be added to the new ** leaf node (zTerm/nTerm). ** ** In other words, it must be the prefix of zTerm 1 byte longer than ** the common prefix (if any) of zTerm and pWriter->zTerm. */ if( rc==SQLITE_OK ){ rc = fts3IncrmergePush(p, pWriter, zTerm, nPrefix+1); } /* Advance to the next output block */ pLeaf->iBlock++; pLeaf->key.n = 0; pLeaf->block.n = 0; nSuffix = nTerm; nSpace = 1; nSpace += sqlite3Fts3VarintLen(nSuffix) + nSuffix; nSpace += sqlite3Fts3VarintLen(nDoclist) + nDoclist; } pWriter->nLeafData += nSpace; blobGrowBuffer(&pLeaf->block, pLeaf->block.n + nSpace, &rc); if( rc==SQLITE_OK ){ if( pLeaf->block.n==0 ){ pLeaf->block.n = 1; pLeaf->block.a[0] = '\0'; } rc = fts3AppendToNode( &pLeaf->block, &pLeaf->key, zTerm, nTerm, aDoclist, nDoclist ); } return rc; } /* ** This function is called to release all dynamic resources held by the ** merge-writer object pWriter, and if no error has occurred, to flush ** all outstanding node buffers held by pWriter to disk. ** ** If *pRc is not SQLITE_OK when this function is called, then no attempt ** is made to write any data to disk. Instead, this function serves only ** to release outstanding resources. ** ** Otherwise, if *pRc is initially SQLITE_OK and an error occurs while ** flushing buffers to disk, *pRc is set to an SQLite error code before ** returning. */ static void fts3IncrmergeRelease( Fts3Table *p, /* FTS3 table handle */ IncrmergeWriter *pWriter, /* Merge-writer object */ int *pRc /* IN/OUT: Error code */ ){ int i; /* Used to iterate through non-root layers */ int iRoot; /* Index of root in pWriter->aNodeWriter */ NodeWriter *pRoot; /* NodeWriter for root node */ int rc = *pRc; /* Error code */ /* Set iRoot to the index in pWriter->aNodeWriter[] of the output segment ** root node. If the segment fits entirely on a single leaf node, iRoot ** will be set to 0. If the root node is the parent of the leaves, iRoot ** will be 1. And so on. */ for(iRoot=FTS_MAX_APPENDABLE_HEIGHT-1; iRoot>=0; iRoot--){ NodeWriter *pNode = &pWriter->aNodeWriter[iRoot]; if( pNode->block.n>0 ) break; assert( *pRc || pNode->block.nAlloc==0 ); assert( *pRc || pNode->key.nAlloc==0 ); sqlite3_free(pNode->block.a); sqlite3_free(pNode->key.a); } /* Empty output segment. This is a no-op. */ if( iRoot<0 ) return; /* The entire output segment fits on a single node. Normally, this means ** the node would be stored as a blob in the "root" column of the %_segdir ** table. However, this is not permitted in this case. The problem is that ** space has already been reserved in the %_segments table, and so the ** start_block and end_block fields of the %_segdir table must be populated. ** And, by design or by accident, released versions of FTS cannot handle ** segments that fit entirely on the root node with start_block!=0. ** ** Instead, create a synthetic root node that contains nothing but a ** pointer to the single content node. So that the segment consists of a ** single leaf and a single interior (root) node. ** ** Todo: Better might be to defer allocating space in the %_segments ** table until we are sure it is needed. */ if( iRoot==0 ){ Blob *pBlock = &pWriter->aNodeWriter[1].block; blobGrowBuffer(pBlock, 1 + FTS3_VARINT_MAX, &rc); if( rc==SQLITE_OK ){ pBlock->a[0] = 0x01; pBlock->n = 1 + sqlite3Fts3PutVarint( &pBlock->a[1], pWriter->aNodeWriter[0].iBlock ); } iRoot = 1; } pRoot = &pWriter->aNodeWriter[iRoot]; /* Flush all currently outstanding nodes to disk. */ for(i=0; iaNodeWriter[i]; if( pNode->block.n>0 && rc==SQLITE_OK ){ rc = fts3WriteSegment(p, pNode->iBlock, pNode->block.a, pNode->block.n); } sqlite3_free(pNode->block.a); sqlite3_free(pNode->key.a); } /* Write the %_segdir record. */ if( rc==SQLITE_OK ){ rc = fts3WriteSegdir(p, pWriter->iAbsLevel+1, /* level */ pWriter->iIdx, /* idx */ pWriter->iStart, /* start_block */ pWriter->aNodeWriter[0].iBlock, /* leaves_end_block */ pWriter->iEnd, /* end_block */ (pWriter->bNoLeafData==0 ? pWriter->nLeafData : 0), /* end_block */ pRoot->block.a, pRoot->block.n /* root */ ); } sqlite3_free(pRoot->block.a); sqlite3_free(pRoot->key.a); *pRc = rc; } /* ** Compare the term in buffer zLhs (size in bytes nLhs) with that in ** zRhs (size in bytes nRhs) using memcmp. If one term is a prefix of ** the other, it is considered to be smaller than the other. ** ** Return -ve if zLhs is smaller than zRhs, 0 if it is equal, or +ve ** if it is greater. */ static int fts3TermCmp( const char *zLhs, int nLhs, /* LHS of comparison */ const char *zRhs, int nRhs /* RHS of comparison */ ){ int nCmp = MIN(nLhs, nRhs); int res; res = memcmp(zLhs, zRhs, nCmp); if( res==0 ) res = nLhs - nRhs; return res; } /* ** Query to see if the entry in the %_segments table with blockid iEnd is ** NULL. If no error occurs and the entry is NULL, set *pbRes 1 before ** returning. Otherwise, set *pbRes to 0. ** ** Or, if an error occurs while querying the database, return an SQLite ** error code. The final value of *pbRes is undefined in this case. ** ** This is used to test if a segment is an "appendable" segment. If it ** is, then a NULL entry has been inserted into the %_segments table ** with blockid %_segdir.end_block. */ static int fts3IsAppendable(Fts3Table *p, sqlite3_int64 iEnd, int *pbRes){ int bRes = 0; /* Result to set *pbRes to */ sqlite3_stmt *pCheck = 0; /* Statement to query database with */ int rc; /* Return code */ rc = fts3SqlStmt(p, SQL_SEGMENT_IS_APPENDABLE, &pCheck, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pCheck, 1, iEnd); if( SQLITE_ROW==sqlite3_step(pCheck) ) bRes = 1; rc = sqlite3_reset(pCheck); } *pbRes = bRes; return rc; } /* ** This function is called when initializing an incremental-merge operation. ** It checks if the existing segment with index value iIdx at absolute level ** (iAbsLevel+1) can be appended to by the incremental merge. If it can, the ** merge-writer object *pWriter is initialized to write to it. ** ** An existing segment can be appended to by an incremental merge if: ** ** * It was initially created as an appendable segment (with all required ** space pre-allocated), and ** ** * The first key read from the input (arguments zKey and nKey) is ** greater than the largest key currently stored in the potential ** output segment. */ static int fts3IncrmergeLoad( Fts3Table *p, /* Fts3 table handle */ sqlite3_int64 iAbsLevel, /* Absolute level of input segments */ int iIdx, /* Index of candidate output segment */ const char *zKey, /* First key to write */ int nKey, /* Number of bytes in nKey */ IncrmergeWriter *pWriter /* Populate this object */ ){ int rc; /* Return code */ sqlite3_stmt *pSelect = 0; /* SELECT to read %_segdir entry */ rc = fts3SqlStmt(p, SQL_SELECT_SEGDIR, &pSelect, 0); if( rc==SQLITE_OK ){ sqlite3_int64 iStart = 0; /* Value of %_segdir.start_block */ sqlite3_int64 iLeafEnd = 0; /* Value of %_segdir.leaves_end_block */ sqlite3_int64 iEnd = 0; /* Value of %_segdir.end_block */ const char *aRoot = 0; /* Pointer to %_segdir.root buffer */ int nRoot = 0; /* Size of aRoot[] in bytes */ int rc2; /* Return code from sqlite3_reset() */ int bAppendable = 0; /* Set to true if segment is appendable */ /* Read the %_segdir entry for index iIdx absolute level (iAbsLevel+1) */ sqlite3_bind_int64(pSelect, 1, iAbsLevel+1); sqlite3_bind_int(pSelect, 2, iIdx); if( sqlite3_step(pSelect)==SQLITE_ROW ){ iStart = sqlite3_column_int64(pSelect, 1); iLeafEnd = sqlite3_column_int64(pSelect, 2); fts3ReadEndBlockField(pSelect, 3, &iEnd, &pWriter->nLeafData); if( pWriter->nLeafData<0 ){ pWriter->nLeafData = pWriter->nLeafData * -1; } pWriter->bNoLeafData = (pWriter->nLeafData==0); nRoot = sqlite3_column_bytes(pSelect, 4); aRoot = sqlite3_column_blob(pSelect, 4); }else{ return sqlite3_reset(pSelect); } /* Check for the zero-length marker in the %_segments table */ rc = fts3IsAppendable(p, iEnd, &bAppendable); /* Check that zKey/nKey is larger than the largest key the candidate */ if( rc==SQLITE_OK && bAppendable ){ char *aLeaf = 0; int nLeaf = 0; rc = sqlite3Fts3ReadBlock(p, iLeafEnd, &aLeaf, &nLeaf, 0); if( rc==SQLITE_OK ){ NodeReader reader; for(rc = nodeReaderInit(&reader, aLeaf, nLeaf); rc==SQLITE_OK && reader.aNode; rc = nodeReaderNext(&reader) ){ assert( reader.aNode ); } if( fts3TermCmp(zKey, nKey, reader.term.a, reader.term.n)<=0 ){ bAppendable = 0; } nodeReaderRelease(&reader); } sqlite3_free(aLeaf); } if( rc==SQLITE_OK && bAppendable ){ /* It is possible to append to this segment. Set up the IncrmergeWriter ** object to do so. */ int i; int nHeight = (int)aRoot[0]; NodeWriter *pNode; pWriter->nLeafEst = (int)((iEnd - iStart) + 1)/FTS_MAX_APPENDABLE_HEIGHT; pWriter->iStart = iStart; pWriter->iEnd = iEnd; pWriter->iAbsLevel = iAbsLevel; pWriter->iIdx = iIdx; for(i=nHeight+1; iaNodeWriter[i].iBlock = pWriter->iStart + i*pWriter->nLeafEst; } pNode = &pWriter->aNodeWriter[nHeight]; pNode->iBlock = pWriter->iStart + pWriter->nLeafEst*nHeight; blobGrowBuffer(&pNode->block, MAX(nRoot, p->nNodeSize), &rc); if( rc==SQLITE_OK ){ memcpy(pNode->block.a, aRoot, nRoot); pNode->block.n = nRoot; } for(i=nHeight; i>=0 && rc==SQLITE_OK; i--){ NodeReader reader; pNode = &pWriter->aNodeWriter[i]; rc = nodeReaderInit(&reader, pNode->block.a, pNode->block.n); while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader); blobGrowBuffer(&pNode->key, reader.term.n, &rc); if( rc==SQLITE_OK ){ memcpy(pNode->key.a, reader.term.a, reader.term.n); pNode->key.n = reader.term.n; if( i>0 ){ char *aBlock = 0; int nBlock = 0; pNode = &pWriter->aNodeWriter[i-1]; pNode->iBlock = reader.iChild; rc = sqlite3Fts3ReadBlock(p, reader.iChild, &aBlock, &nBlock, 0); blobGrowBuffer(&pNode->block, MAX(nBlock, p->nNodeSize), &rc); if( rc==SQLITE_OK ){ memcpy(pNode->block.a, aBlock, nBlock); pNode->block.n = nBlock; } sqlite3_free(aBlock); } } nodeReaderRelease(&reader); } } rc2 = sqlite3_reset(pSelect); if( rc==SQLITE_OK ) rc = rc2; } return rc; } /* ** Determine the largest segment index value that exists within absolute ** level iAbsLevel+1. If no error occurs, set *piIdx to this value plus ** one before returning SQLITE_OK. Or, if there are no segments at all ** within level iAbsLevel, set *piIdx to zero. ** ** If an error occurs, return an SQLite error code. The final value of ** *piIdx is undefined in this case. */ static int fts3IncrmergeOutputIdx( Fts3Table *p, /* FTS Table handle */ sqlite3_int64 iAbsLevel, /* Absolute index of input segments */ int *piIdx /* OUT: Next free index at iAbsLevel+1 */ ){ int rc; sqlite3_stmt *pOutputIdx = 0; /* SQL used to find output index */ rc = fts3SqlStmt(p, SQL_NEXT_SEGMENT_INDEX, &pOutputIdx, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pOutputIdx, 1, iAbsLevel+1); sqlite3_step(pOutputIdx); *piIdx = sqlite3_column_int(pOutputIdx, 0); rc = sqlite3_reset(pOutputIdx); } return rc; } /* ** Allocate an appendable output segment on absolute level iAbsLevel+1 ** with idx value iIdx. ** ** In the %_segdir table, a segment is defined by the values in three ** columns: ** ** start_block ** leaves_end_block ** end_block ** ** When an appendable segment is allocated, it is estimated that the ** maximum number of leaf blocks that may be required is the sum of the ** number of leaf blocks consumed by the input segments, plus the number ** of input segments, multiplied by two. This value is stored in stack ** variable nLeafEst. ** ** A total of 16*nLeafEst blocks are allocated when an appendable segment ** is created ((1 + end_block - start_block)==16*nLeafEst). The contiguous ** array of leaf nodes starts at the first block allocated. The array ** of interior nodes that are parents of the leaf nodes start at block ** (start_block + (1 + end_block - start_block) / 16). And so on. ** ** In the actual code below, the value "16" is replaced with the ** pre-processor macro FTS_MAX_APPENDABLE_HEIGHT. */ static int fts3IncrmergeWriter( Fts3Table *p, /* Fts3 table handle */ sqlite3_int64 iAbsLevel, /* Absolute level of input segments */ int iIdx, /* Index of new output segment */ Fts3MultiSegReader *pCsr, /* Cursor that data will be read from */ IncrmergeWriter *pWriter /* Populate this object */ ){ int rc; /* Return Code */ int i; /* Iterator variable */ int nLeafEst = 0; /* Blocks allocated for leaf nodes */ sqlite3_stmt *pLeafEst = 0; /* SQL used to determine nLeafEst */ sqlite3_stmt *pFirstBlock = 0; /* SQL used to determine first block */ /* Calculate nLeafEst. */ rc = fts3SqlStmt(p, SQL_MAX_LEAF_NODE_ESTIMATE, &pLeafEst, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pLeafEst, 1, iAbsLevel); sqlite3_bind_int64(pLeafEst, 2, pCsr->nSegment); if( SQLITE_ROW==sqlite3_step(pLeafEst) ){ nLeafEst = sqlite3_column_int(pLeafEst, 0); } rc = sqlite3_reset(pLeafEst); } if( rc!=SQLITE_OK ) return rc; /* Calculate the first block to use in the output segment */ rc = fts3SqlStmt(p, SQL_NEXT_SEGMENTS_ID, &pFirstBlock, 0); if( rc==SQLITE_OK ){ if( SQLITE_ROW==sqlite3_step(pFirstBlock) ){ pWriter->iStart = sqlite3_column_int64(pFirstBlock, 0); pWriter->iEnd = pWriter->iStart - 1; pWriter->iEnd += nLeafEst * FTS_MAX_APPENDABLE_HEIGHT; } rc = sqlite3_reset(pFirstBlock); } if( rc!=SQLITE_OK ) return rc; /* Insert the marker in the %_segments table to make sure nobody tries ** to steal the space just allocated. This is also used to identify ** appendable segments. */ rc = fts3WriteSegment(p, pWriter->iEnd, 0, 0); if( rc!=SQLITE_OK ) return rc; pWriter->iAbsLevel = iAbsLevel; pWriter->nLeafEst = nLeafEst; pWriter->iIdx = iIdx; /* Set up the array of NodeWriter objects */ for(i=0; iaNodeWriter[i].iBlock = pWriter->iStart + i*pWriter->nLeafEst; } return SQLITE_OK; } /* ** Remove an entry from the %_segdir table. This involves running the ** following two statements: ** ** DELETE FROM %_segdir WHERE level = :iAbsLevel AND idx = :iIdx ** UPDATE %_segdir SET idx = idx - 1 WHERE level = :iAbsLevel AND idx > :iIdx ** ** The DELETE statement removes the specific %_segdir level. The UPDATE ** statement ensures that the remaining segments have contiguously allocated ** idx values. */ static int fts3RemoveSegdirEntry( Fts3Table *p, /* FTS3 table handle */ sqlite3_int64 iAbsLevel, /* Absolute level to delete from */ int iIdx /* Index of %_segdir entry to delete */ ){ int rc; /* Return code */ sqlite3_stmt *pDelete = 0; /* DELETE statement */ rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_ENTRY, &pDelete, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pDelete, 1, iAbsLevel); sqlite3_bind_int(pDelete, 2, iIdx); sqlite3_step(pDelete); rc = sqlite3_reset(pDelete); } return rc; } /* ** One or more segments have just been removed from absolute level iAbsLevel. ** Update the 'idx' values of the remaining segments in the level so that ** the idx values are a contiguous sequence starting from 0. */ static int fts3RepackSegdirLevel( Fts3Table *p, /* FTS3 table handle */ sqlite3_int64 iAbsLevel /* Absolute level to repack */ ){ int rc; /* Return code */ int *aIdx = 0; /* Array of remaining idx values */ int nIdx = 0; /* Valid entries in aIdx[] */ int nAlloc = 0; /* Allocated size of aIdx[] */ int i; /* Iterator variable */ sqlite3_stmt *pSelect = 0; /* Select statement to read idx values */ sqlite3_stmt *pUpdate = 0; /* Update statement to modify idx values */ rc = fts3SqlStmt(p, SQL_SELECT_INDEXES, &pSelect, 0); if( rc==SQLITE_OK ){ int rc2; sqlite3_bind_int64(pSelect, 1, iAbsLevel); while( SQLITE_ROW==sqlite3_step(pSelect) ){ if( nIdx>=nAlloc ){ int *aNew; nAlloc += 16; aNew = sqlite3_realloc(aIdx, nAlloc*sizeof(int)); if( !aNew ){ rc = SQLITE_NOMEM; break; } aIdx = aNew; } aIdx[nIdx++] = sqlite3_column_int(pSelect, 0); } rc2 = sqlite3_reset(pSelect); if( rc==SQLITE_OK ) rc = rc2; } if( rc==SQLITE_OK ){ rc = fts3SqlStmt(p, SQL_SHIFT_SEGDIR_ENTRY, &pUpdate, 0); } if( rc==SQLITE_OK ){ sqlite3_bind_int64(pUpdate, 2, iAbsLevel); } assert( p->bIgnoreSavepoint==0 ); p->bIgnoreSavepoint = 1; for(i=0; rc==SQLITE_OK && ibIgnoreSavepoint = 0; sqlite3_free(aIdx); return rc; } static void fts3StartNode(Blob *pNode, int iHeight, sqlite3_int64 iChild){ pNode->a[0] = (char)iHeight; if( iChild ){ assert( pNode->nAlloc>=1+sqlite3Fts3VarintLen(iChild) ); pNode->n = 1 + sqlite3Fts3PutVarint(&pNode->a[1], iChild); }else{ assert( pNode->nAlloc>=1 ); pNode->n = 1; } } /* ** The first two arguments are a pointer to and the size of a segment b-tree ** node. The node may be a leaf or an internal node. ** ** This function creates a new node image in blob object *pNew by copying ** all terms that are greater than or equal to zTerm/nTerm (for leaf nodes) ** or greater than zTerm/nTerm (for internal nodes) from aNode/nNode. */ static int fts3TruncateNode( const char *aNode, /* Current node image */ int nNode, /* Size of aNode in bytes */ Blob *pNew, /* OUT: Write new node image here */ const char *zTerm, /* Omit all terms smaller than this */ int nTerm, /* Size of zTerm in bytes */ sqlite3_int64 *piBlock /* OUT: Block number in next layer down */ ){ NodeReader reader; /* Reader object */ Blob prev = {0, 0, 0}; /* Previous term written to new node */ int rc = SQLITE_OK; /* Return code */ int bLeaf = aNode[0]=='\0'; /* True for a leaf node */ /* Allocate required output space */ blobGrowBuffer(pNew, nNode, &rc); if( rc!=SQLITE_OK ) return rc; pNew->n = 0; /* Populate new node buffer */ for(rc = nodeReaderInit(&reader, aNode, nNode); rc==SQLITE_OK && reader.aNode; rc = nodeReaderNext(&reader) ){ if( pNew->n==0 ){ int res = fts3TermCmp(reader.term.a, reader.term.n, zTerm, nTerm); if( res<0 || (bLeaf==0 && res==0) ) continue; fts3StartNode(pNew, (int)aNode[0], reader.iChild); *piBlock = reader.iChild; } rc = fts3AppendToNode( pNew, &prev, reader.term.a, reader.term.n, reader.aDoclist, reader.nDoclist ); if( rc!=SQLITE_OK ) break; } if( pNew->n==0 ){ fts3StartNode(pNew, (int)aNode[0], reader.iChild); *piBlock = reader.iChild; } assert( pNew->n<=pNew->nAlloc ); nodeReaderRelease(&reader); sqlite3_free(prev.a); return rc; } /* ** Remove all terms smaller than zTerm/nTerm from segment iIdx in absolute ** level iAbsLevel. This may involve deleting entries from the %_segments ** table, and modifying existing entries in both the %_segments and %_segdir ** tables. ** ** SQLITE_OK is returned if the segment is updated successfully. Or an ** SQLite error code otherwise. */ static int fts3TruncateSegment( Fts3Table *p, /* FTS3 table handle */ sqlite3_int64 iAbsLevel, /* Absolute level of segment to modify */ int iIdx, /* Index within level of segment to modify */ const char *zTerm, /* Remove terms smaller than this */ int nTerm /* Number of bytes in buffer zTerm */ ){ int rc = SQLITE_OK; /* Return code */ Blob root = {0,0,0}; /* New root page image */ Blob block = {0,0,0}; /* Buffer used for any other block */ sqlite3_int64 iBlock = 0; /* Block id */ sqlite3_int64 iNewStart = 0; /* New value for iStartBlock */ sqlite3_int64 iOldStart = 0; /* Old value for iStartBlock */ sqlite3_stmt *pFetch = 0; /* Statement used to fetch segdir */ rc = fts3SqlStmt(p, SQL_SELECT_SEGDIR, &pFetch, 0); if( rc==SQLITE_OK ){ int rc2; /* sqlite3_reset() return code */ sqlite3_bind_int64(pFetch, 1, iAbsLevel); sqlite3_bind_int(pFetch, 2, iIdx); if( SQLITE_ROW==sqlite3_step(pFetch) ){ const char *aRoot = sqlite3_column_blob(pFetch, 4); int nRoot = sqlite3_column_bytes(pFetch, 4); iOldStart = sqlite3_column_int64(pFetch, 1); rc = fts3TruncateNode(aRoot, nRoot, &root, zTerm, nTerm, &iBlock); } rc2 = sqlite3_reset(pFetch); if( rc==SQLITE_OK ) rc = rc2; } while( rc==SQLITE_OK && iBlock ){ char *aBlock = 0; int nBlock = 0; iNewStart = iBlock; rc = sqlite3Fts3ReadBlock(p, iBlock, &aBlock, &nBlock, 0); if( rc==SQLITE_OK ){ rc = fts3TruncateNode(aBlock, nBlock, &block, zTerm, nTerm, &iBlock); } if( rc==SQLITE_OK ){ rc = fts3WriteSegment(p, iNewStart, block.a, block.n); } sqlite3_free(aBlock); } /* Variable iNewStart now contains the first valid leaf node. */ if( rc==SQLITE_OK && iNewStart ){ sqlite3_stmt *pDel = 0; rc = fts3SqlStmt(p, SQL_DELETE_SEGMENTS_RANGE, &pDel, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pDel, 1, iOldStart); sqlite3_bind_int64(pDel, 2, iNewStart-1); sqlite3_step(pDel); rc = sqlite3_reset(pDel); } } if( rc==SQLITE_OK ){ sqlite3_stmt *pChomp = 0; rc = fts3SqlStmt(p, SQL_CHOMP_SEGDIR, &pChomp, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pChomp, 1, iNewStart); sqlite3_bind_blob(pChomp, 2, root.a, root.n, SQLITE_STATIC); sqlite3_bind_int64(pChomp, 3, iAbsLevel); sqlite3_bind_int(pChomp, 4, iIdx); sqlite3_step(pChomp); rc = sqlite3_reset(pChomp); } } sqlite3_free(root.a); sqlite3_free(block.a); return rc; } /* ** This function is called after an incrmental-merge operation has run to ** merge (or partially merge) two or more segments from absolute level ** iAbsLevel. ** ** Each input segment is either removed from the db completely (if all of ** its data was copied to the output segment by the incrmerge operation) ** or modified in place so that it no longer contains those entries that ** have been duplicated in the output segment. */ static int fts3IncrmergeChomp( Fts3Table *p, /* FTS table handle */ sqlite3_int64 iAbsLevel, /* Absolute level containing segments */ Fts3MultiSegReader *pCsr, /* Chomp all segments opened by this cursor */ int *pnRem /* Number of segments not deleted */ ){ int i; int nRem = 0; int rc = SQLITE_OK; for(i=pCsr->nSegment-1; i>=0 && rc==SQLITE_OK; i--){ Fts3SegReader *pSeg = 0; int j; /* Find the Fts3SegReader object with Fts3SegReader.iIdx==i. It is hiding ** somewhere in the pCsr->apSegment[] array. */ for(j=0; ALWAYS(jnSegment); j++){ pSeg = pCsr->apSegment[j]; if( pSeg->iIdx==i ) break; } assert( jnSegment && pSeg->iIdx==i ); if( pSeg->aNode==0 ){ /* Seg-reader is at EOF. Remove the entire input segment. */ rc = fts3DeleteSegment(p, pSeg); if( rc==SQLITE_OK ){ rc = fts3RemoveSegdirEntry(p, iAbsLevel, pSeg->iIdx); } *pnRem = 0; }else{ /* The incremental merge did not copy all the data from this ** segment to the upper level. The segment is modified in place ** so that it contains no keys smaller than zTerm/nTerm. */ const char *zTerm = pSeg->zTerm; int nTerm = pSeg->nTerm; rc = fts3TruncateSegment(p, iAbsLevel, pSeg->iIdx, zTerm, nTerm); nRem++; } } if( rc==SQLITE_OK && nRem!=pCsr->nSegment ){ rc = fts3RepackSegdirLevel(p, iAbsLevel); } *pnRem = nRem; return rc; } /* ** Store an incr-merge hint in the database. */ static int fts3IncrmergeHintStore(Fts3Table *p, Blob *pHint){ sqlite3_stmt *pReplace = 0; int rc; /* Return code */ rc = fts3SqlStmt(p, SQL_REPLACE_STAT, &pReplace, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int(pReplace, 1, FTS_STAT_INCRMERGEHINT); sqlite3_bind_blob(pReplace, 2, pHint->a, pHint->n, SQLITE_STATIC); sqlite3_step(pReplace); rc = sqlite3_reset(pReplace); } return rc; } /* ** Load an incr-merge hint from the database. The incr-merge hint, if one ** exists, is stored in the rowid==1 row of the %_stat table. ** ** If successful, populate blob *pHint with the value read from the %_stat ** table and return SQLITE_OK. Otherwise, if an error occurs, return an ** SQLite error code. */ static int fts3IncrmergeHintLoad(Fts3Table *p, Blob *pHint){ sqlite3_stmt *pSelect = 0; int rc; pHint->n = 0; rc = fts3SqlStmt(p, SQL_SELECT_STAT, &pSelect, 0); if( rc==SQLITE_OK ){ int rc2; sqlite3_bind_int(pSelect, 1, FTS_STAT_INCRMERGEHINT); if( SQLITE_ROW==sqlite3_step(pSelect) ){ const char *aHint = sqlite3_column_blob(pSelect, 0); int nHint = sqlite3_column_bytes(pSelect, 0); if( aHint ){ blobGrowBuffer(pHint, nHint, &rc); if( rc==SQLITE_OK ){ memcpy(pHint->a, aHint, nHint); pHint->n = nHint; } } } rc2 = sqlite3_reset(pSelect); if( rc==SQLITE_OK ) rc = rc2; } return rc; } /* ** If *pRc is not SQLITE_OK when this function is called, it is a no-op. ** Otherwise, append an entry to the hint stored in blob *pHint. Each entry ** consists of two varints, the absolute level number of the input segments ** and the number of input segments. ** ** If successful, leave *pRc set to SQLITE_OK and return. If an error occurs, ** set *pRc to an SQLite error code before returning. */ static void fts3IncrmergeHintPush( Blob *pHint, /* Hint blob to append to */ i64 iAbsLevel, /* First varint to store in hint */ int nInput, /* Second varint to store in hint */ int *pRc /* IN/OUT: Error code */ ){ blobGrowBuffer(pHint, pHint->n + 2*FTS3_VARINT_MAX, pRc); if( *pRc==SQLITE_OK ){ pHint->n += sqlite3Fts3PutVarint(&pHint->a[pHint->n], iAbsLevel); pHint->n += sqlite3Fts3PutVarint(&pHint->a[pHint->n], (i64)nInput); } } /* ** Read the last entry (most recently pushed) from the hint blob *pHint ** and then remove the entry. Write the two values read to *piAbsLevel and ** *pnInput before returning. ** ** If no error occurs, return SQLITE_OK. If the hint blob in *pHint does ** not contain at least two valid varints, return SQLITE_CORRUPT_VTAB. */ static int fts3IncrmergeHintPop(Blob *pHint, i64 *piAbsLevel, int *pnInput){ const int nHint = pHint->n; int i; i = pHint->n-2; while( i>0 && (pHint->a[i-1] & 0x80) ) i--; while( i>0 && (pHint->a[i-1] & 0x80) ) i--; pHint->n = i; i += sqlite3Fts3GetVarint(&pHint->a[i], piAbsLevel); i += fts3GetVarint32(&pHint->a[i], pnInput); if( i!=nHint ) return FTS_CORRUPT_VTAB; return SQLITE_OK; } /* ** Attempt an incremental merge that writes nMerge leaf blocks. ** ** Incremental merges happen nMin segments at a time. The segments ** to be merged are the nMin oldest segments (the ones with the smallest ** values for the _segdir.idx field) in the highest level that contains ** at least nMin segments. Multiple merges might occur in an attempt to ** write the quota of nMerge leaf blocks. */ int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ int rc; /* Return code */ int nRem = nMerge; /* Number of leaf pages yet to be written */ Fts3MultiSegReader *pCsr; /* Cursor used to read input data */ Fts3SegFilter *pFilter; /* Filter used with cursor pCsr */ IncrmergeWriter *pWriter; /* Writer object */ int nSeg = 0; /* Number of input segments */ sqlite3_int64 iAbsLevel = 0; /* Absolute level number to work on */ Blob hint = {0, 0, 0}; /* Hint read from %_stat table */ int bDirtyHint = 0; /* True if blob 'hint' has been modified */ /* Allocate space for the cursor, filter and writer objects */ const int nAlloc = sizeof(*pCsr) + sizeof(*pFilter) + sizeof(*pWriter); pWriter = (IncrmergeWriter *)sqlite3_malloc(nAlloc); if( !pWriter ) return SQLITE_NOMEM; pFilter = (Fts3SegFilter *)&pWriter[1]; pCsr = (Fts3MultiSegReader *)&pFilter[1]; rc = fts3IncrmergeHintLoad(p, &hint); while( rc==SQLITE_OK && nRem>0 ){ const i64 nMod = FTS3_SEGDIR_MAXLEVEL * p->nIndex; sqlite3_stmt *pFindLevel = 0; /* SQL used to determine iAbsLevel */ int bUseHint = 0; /* True if attempting to append */ int iIdx = 0; /* Largest idx in level (iAbsLevel+1) */ /* Search the %_segdir table for the absolute level with the smallest ** relative level number that contains at least nMin segments, if any. ** If one is found, set iAbsLevel to the absolute level number and ** nSeg to nMin. If no level with at least nMin segments can be found, ** set nSeg to -1. */ rc = fts3SqlStmt(p, SQL_FIND_MERGE_LEVEL, &pFindLevel, 0); sqlite3_bind_int(pFindLevel, 1, MAX(2, nMin)); if( sqlite3_step(pFindLevel)==SQLITE_ROW ){ iAbsLevel = sqlite3_column_int64(pFindLevel, 0); nSeg = sqlite3_column_int(pFindLevel, 1); assert( nSeg>=2 ); }else{ nSeg = -1; } rc = sqlite3_reset(pFindLevel); /* If the hint read from the %_stat table is not empty, check if the ** last entry in it specifies a relative level smaller than or equal ** to the level identified by the block above (if any). If so, this ** iteration of the loop will work on merging at the hinted level. */ if( rc==SQLITE_OK && hint.n ){ int nHint = hint.n; sqlite3_int64 iHintAbsLevel = 0; /* Hint level */ int nHintSeg = 0; /* Hint number of segments */ rc = fts3IncrmergeHintPop(&hint, &iHintAbsLevel, &nHintSeg); if( nSeg<0 || (iAbsLevel % nMod) >= (iHintAbsLevel % nMod) ){ iAbsLevel = iHintAbsLevel; nSeg = nHintSeg; bUseHint = 1; bDirtyHint = 1; }else{ /* This undoes the effect of the HintPop() above - so that no entry ** is removed from the hint blob. */ hint.n = nHint; } } /* If nSeg is less that zero, then there is no level with at least ** nMin segments and no hint in the %_stat table. No work to do. ** Exit early in this case. */ if( nSeg<0 ) break; /* Open a cursor to iterate through the contents of the oldest nSeg ** indexes of absolute level iAbsLevel. If this cursor is opened using ** the 'hint' parameters, it is possible that there are less than nSeg ** segments available in level iAbsLevel. In this case, no work is ** done on iAbsLevel - fall through to the next iteration of the loop ** to start work on some other level. */ memset(pWriter, 0, nAlloc); pFilter->flags = FTS3_SEGMENT_REQUIRE_POS; if( rc==SQLITE_OK ){ rc = fts3IncrmergeOutputIdx(p, iAbsLevel, &iIdx); assert( bUseHint==1 || bUseHint==0 ); if( iIdx==0 || (bUseHint && iIdx==1) ){ int bIgnore = 0; rc = fts3SegmentIsMaxLevel(p, iAbsLevel+1, &bIgnore); if( bIgnore ){ pFilter->flags |= FTS3_SEGMENT_IGNORE_EMPTY; } } } if( rc==SQLITE_OK ){ rc = fts3IncrmergeCsr(p, iAbsLevel, nSeg, pCsr); } if( SQLITE_OK==rc && pCsr->nSegment==nSeg && SQLITE_OK==(rc = sqlite3Fts3SegReaderStart(p, pCsr, pFilter)) && SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, pCsr)) ){ if( bUseHint && iIdx>0 ){ const char *zKey = pCsr->zTerm; int nKey = pCsr->nTerm; rc = fts3IncrmergeLoad(p, iAbsLevel, iIdx-1, zKey, nKey, pWriter); }else{ rc = fts3IncrmergeWriter(p, iAbsLevel, iIdx, pCsr, pWriter); } if( rc==SQLITE_OK && pWriter->nLeafEst ){ fts3LogMerge(nSeg, iAbsLevel); do { rc = fts3IncrmergeAppend(p, pWriter, pCsr); if( rc==SQLITE_OK ) rc = sqlite3Fts3SegReaderStep(p, pCsr); if( pWriter->nWork>=nRem && rc==SQLITE_ROW ) rc = SQLITE_OK; }while( rc==SQLITE_ROW ); /* Update or delete the input segments */ if( rc==SQLITE_OK ){ nRem -= (1 + pWriter->nWork); rc = fts3IncrmergeChomp(p, iAbsLevel, pCsr, &nSeg); if( nSeg!=0 ){ bDirtyHint = 1; fts3IncrmergeHintPush(&hint, iAbsLevel, nSeg, &rc); } } } if( nSeg!=0 ){ pWriter->nLeafData = pWriter->nLeafData * -1; } fts3IncrmergeRelease(p, pWriter, &rc); if( nSeg==0 && pWriter->bNoLeafData==0 ){ fts3PromoteSegments(p, iAbsLevel+1, pWriter->nLeafData); } } sqlite3Fts3SegReaderFinish(pCsr); } /* Write the hint values into the %_stat table for the next incr-merger */ if( bDirtyHint && rc==SQLITE_OK ){ rc = fts3IncrmergeHintStore(p, &hint); } sqlite3_free(pWriter); sqlite3_free(hint.a); return rc; } /* ** Convert the text beginning at *pz into an integer and return ** its value. Advance *pz to point to the first character past ** the integer. ** ** This function used for parameters to merge= and incrmerge= ** commands. */ static int fts3Getint(const char **pz){ const char *z = *pz; int i = 0; while( (*z)>='0' && (*z)<='9' && i<214748363 ) i = 10*i + *(z++) - '0'; *pz = z; return i; } /* ** Process statements of the form: ** ** INSERT INTO table(table) VALUES('merge=A,B'); ** ** A and B are integers that decode to be the number of leaf pages ** written for the merge, and the minimum number of segments on a level ** before it will be selected for a merge, respectively. */ static int fts3DoIncrmerge( Fts3Table *p, /* FTS3 table handle */ const char *zParam /* Nul-terminated string containing "A,B" */ ){ int rc; int nMin = (FTS3_MERGE_COUNT / 2); int nMerge = 0; const char *z = zParam; /* Read the first integer value */ nMerge = fts3Getint(&z); /* If the first integer value is followed by a ',', read the second ** integer value. */ if( z[0]==',' && z[1]!='\0' ){ z++; nMin = fts3Getint(&z); } if( z[0]!='\0' || nMin<2 ){ rc = SQLITE_ERROR; }else{ rc = SQLITE_OK; if( !p->bHasStat ){ assert( p->bFts4==0 ); sqlite3Fts3CreateStatTable(&rc, p); } if( rc==SQLITE_OK ){ rc = sqlite3Fts3Incrmerge(p, nMerge, nMin); } sqlite3Fts3SegmentsClose(p); } return rc; } /* ** Process statements of the form: ** ** INSERT INTO table(table) VALUES('automerge=X'); ** ** where X is an integer. X==0 means to turn automerge off. X!=0 means ** turn it on. The setting is persistent. */ static int fts3DoAutoincrmerge( Fts3Table *p, /* FTS3 table handle */ const char *zParam /* Nul-terminated string containing boolean */ ){ int rc = SQLITE_OK; sqlite3_stmt *pStmt = 0; p->nAutoincrmerge = fts3Getint(&zParam); if( p->nAutoincrmerge==1 || p->nAutoincrmerge>FTS3_MERGE_COUNT ){ p->nAutoincrmerge = 8; } if( !p->bHasStat ){ assert( p->bFts4==0 ); sqlite3Fts3CreateStatTable(&rc, p); if( rc ) return rc; } rc = fts3SqlStmt(p, SQL_REPLACE_STAT, &pStmt, 0); if( rc ) return rc; sqlite3_bind_int(pStmt, 1, FTS_STAT_AUTOINCRMERGE); sqlite3_bind_int(pStmt, 2, p->nAutoincrmerge); sqlite3_step(pStmt); rc = sqlite3_reset(pStmt); return rc; } /* ** Return a 64-bit checksum for the FTS index entry specified by the ** arguments to this function. */ static u64 fts3ChecksumEntry( const char *zTerm, /* Pointer to buffer containing term */ int nTerm, /* Size of zTerm in bytes */ int iLangid, /* Language id for current row */ int iIndex, /* Index (0..Fts3Table.nIndex-1) */ i64 iDocid, /* Docid for current row. */ int iCol, /* Column number */ int iPos /* Position */ ){ int i; u64 ret = (u64)iDocid; ret += (ret<<3) + iLangid; ret += (ret<<3) + iIndex; ret += (ret<<3) + iCol; ret += (ret<<3) + iPos; for(i=0; inIndex-1) */ int *pRc /* OUT: Return code */ ){ Fts3SegFilter filter; Fts3MultiSegReader csr; int rc; u64 cksum = 0; assert( *pRc==SQLITE_OK ); memset(&filter, 0, sizeof(filter)); memset(&csr, 0, sizeof(csr)); filter.flags = FTS3_SEGMENT_REQUIRE_POS|FTS3_SEGMENT_IGNORE_EMPTY; filter.flags |= FTS3_SEGMENT_SCAN; rc = sqlite3Fts3SegReaderCursor( p, iLangid, iIndex, FTS3_SEGCURSOR_ALL, 0, 0, 0, 1,&csr ); if( rc==SQLITE_OK ){ rc = sqlite3Fts3SegReaderStart(p, &csr, &filter); } if( rc==SQLITE_OK ){ while( SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, &csr)) ){ char *pCsr = csr.aDoclist; char *pEnd = &pCsr[csr.nDoclist]; i64 iDocid = 0; i64 iCol = 0; i64 iPos = 0; pCsr += sqlite3Fts3GetVarint(pCsr, &iDocid); while( pCsriPrevLangid); sqlite3_bind_int(pAllLangid, 2, p->nIndex); while( rc==SQLITE_OK && sqlite3_step(pAllLangid)==SQLITE_ROW ){ int iLangid = sqlite3_column_int(pAllLangid, 0); int i; for(i=0; inIndex; i++){ cksum1 = cksum1 ^ fts3ChecksumIndex(p, iLangid, i, &rc); } } rc2 = sqlite3_reset(pAllLangid); if( rc==SQLITE_OK ) rc = rc2; } /* This block calculates the checksum according to the %_content table */ if( rc==SQLITE_OK ){ sqlite3_tokenizer_module const *pModule = p->pTokenizer->pModule; sqlite3_stmt *pStmt = 0; char *zSql; zSql = sqlite3_mprintf("SELECT %s" , p->zReadExprlist); if( !zSql ){ rc = SQLITE_NOMEM; }else{ rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); } while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ i64 iDocid = sqlite3_column_int64(pStmt, 0); int iLang = langidFromSelect(p, pStmt); int iCol; for(iCol=0; rc==SQLITE_OK && iColnColumn; iCol++){ if( p->abNotindexed[iCol]==0 ){ const char *zText = (const char *)sqlite3_column_text(pStmt, iCol+1); int nText = sqlite3_column_bytes(pStmt, iCol+1); sqlite3_tokenizer_cursor *pT = 0; rc = sqlite3Fts3OpenTokenizer(p->pTokenizer, iLang, zText, nText,&pT); while( rc==SQLITE_OK ){ char const *zToken; /* Buffer containing token */ int nToken = 0; /* Number of bytes in token */ int iDum1 = 0, iDum2 = 0; /* Dummy variables */ int iPos = 0; /* Position of token in zText */ rc = pModule->xNext(pT, &zToken, &nToken, &iDum1, &iDum2, &iPos); if( rc==SQLITE_OK ){ int i; cksum2 = cksum2 ^ fts3ChecksumEntry( zToken, nToken, iLang, 0, iDocid, iCol, iPos ); for(i=1; inIndex; i++){ if( p->aIndex[i].nPrefix<=nToken ){ cksum2 = cksum2 ^ fts3ChecksumEntry( zToken, p->aIndex[i].nPrefix, iLang, i, iDocid, iCol, iPos ); } } } } if( pT ) pModule->xClose(pT); if( rc==SQLITE_DONE ) rc = SQLITE_OK; } } } sqlite3_finalize(pStmt); } *pbOk = (cksum1==cksum2); return rc; } /* ** Run the integrity-check. If no error occurs and the current contents of ** the FTS index are correct, return SQLITE_OK. Or, if the contents of the ** FTS index are incorrect, return SQLITE_CORRUPT_VTAB. ** ** Or, if an error (e.g. an OOM or IO error) occurs, return an SQLite ** error code. ** ** The integrity-check works as follows. For each token and indexed token ** prefix in the document set, a 64-bit checksum is calculated (by code ** in fts3ChecksumEntry()) based on the following: ** ** + The index number (0 for the main index, 1 for the first prefix ** index etc.), ** + The token (or token prefix) text itself, ** + The language-id of the row it appears in, ** + The docid of the row it appears in, ** + The column it appears in, and ** + The tokens position within that column. ** ** The checksums for all entries in the index are XORed together to create ** a single checksum for the entire index. ** ** The integrity-check code calculates the same checksum in two ways: ** ** 1. By scanning the contents of the FTS index, and ** 2. By scanning and tokenizing the content table. ** ** If the two checksums are identical, the integrity-check is deemed to have ** passed. */ static int fts3DoIntegrityCheck( Fts3Table *p /* FTS3 table handle */ ){ int rc; int bOk = 0; rc = fts3IntegrityCheck(p, &bOk); if( rc==SQLITE_OK && bOk==0 ) rc = FTS_CORRUPT_VTAB; return rc; } /* ** Handle a 'special' INSERT of the form: ** ** "INSERT INTO tbl(tbl) VALUES()" ** ** Argument pVal contains the result of . Currently the only ** meaningful value to insert is the text 'optimize'. */ static int fts3SpecialInsert(Fts3Table *p, sqlite3_value *pVal){ int rc; /* Return Code */ const char *zVal = (const char *)sqlite3_value_text(pVal); int nVal = sqlite3_value_bytes(pVal); if( !zVal ){ return SQLITE_NOMEM; }else if( nVal==8 && 0==sqlite3_strnicmp(zVal, "optimize", 8) ){ rc = fts3DoOptimize(p, 0); }else if( nVal==7 && 0==sqlite3_strnicmp(zVal, "rebuild", 7) ){ rc = fts3DoRebuild(p); }else if( nVal==15 && 0==sqlite3_strnicmp(zVal, "integrity-check", 15) ){ rc = fts3DoIntegrityCheck(p); }else if( nVal>6 && 0==sqlite3_strnicmp(zVal, "merge=", 6) ){ rc = fts3DoIncrmerge(p, &zVal[6]); }else if( nVal>10 && 0==sqlite3_strnicmp(zVal, "automerge=", 10) ){ rc = fts3DoAutoincrmerge(p, &zVal[10]); #ifdef SQLITE_TEST }else if( nVal>9 && 0==sqlite3_strnicmp(zVal, "nodesize=", 9) ){ p->nNodeSize = atoi(&zVal[9]); rc = SQLITE_OK; }else if( nVal>11 && 0==sqlite3_strnicmp(zVal, "maxpending=", 9) ){ p->nMaxPendingData = atoi(&zVal[11]); rc = SQLITE_OK; }else if( nVal>21 && 0==sqlite3_strnicmp(zVal, "test-no-incr-doclist=", 21) ){ p->bNoIncrDoclist = atoi(&zVal[21]); rc = SQLITE_OK; #endif }else{ rc = SQLITE_ERROR; } return rc; } #ifndef SQLITE_DISABLE_FTS4_DEFERRED /* ** Delete all cached deferred doclists. Deferred doclists are cached ** (allocated) by the sqlite3Fts3CacheDeferredDoclists() function. */ void sqlite3Fts3FreeDeferredDoclists(Fts3Cursor *pCsr){ Fts3DeferredToken *pDef; for(pDef=pCsr->pDeferred; pDef; pDef=pDef->pNext){ fts3PendingListDelete(pDef->pList); pDef->pList = 0; } } /* ** Free all entries in the pCsr->pDeffered list. Entries are added to ** this list using sqlite3Fts3DeferToken(). */ void sqlite3Fts3FreeDeferredTokens(Fts3Cursor *pCsr){ Fts3DeferredToken *pDef; Fts3DeferredToken *pNext; for(pDef=pCsr->pDeferred; pDef; pDef=pNext){ pNext = pDef->pNext; fts3PendingListDelete(pDef->pList); sqlite3_free(pDef); } pCsr->pDeferred = 0; } /* ** Generate deferred-doclists for all tokens in the pCsr->pDeferred list ** based on the row that pCsr currently points to. ** ** A deferred-doclist is like any other doclist with position information ** included, except that it only contains entries for a single row of the ** table, not for all rows. */ int sqlite3Fts3CacheDeferredDoclists(Fts3Cursor *pCsr){ int rc = SQLITE_OK; /* Return code */ if( pCsr->pDeferred ){ int i; /* Used to iterate through table columns */ sqlite3_int64 iDocid; /* Docid of the row pCsr points to */ Fts3DeferredToken *pDef; /* Used to iterate through deferred tokens */ Fts3Table *p = (Fts3Table *)pCsr->base.pVtab; sqlite3_tokenizer *pT = p->pTokenizer; sqlite3_tokenizer_module const *pModule = pT->pModule; assert( pCsr->isRequireSeek==0 ); iDocid = sqlite3_column_int64(pCsr->pStmt, 0); for(i=0; inColumn && rc==SQLITE_OK; i++){ if( p->abNotindexed[i]==0 ){ const char *zText = (const char *)sqlite3_column_text(pCsr->pStmt, i+1); sqlite3_tokenizer_cursor *pTC = 0; rc = sqlite3Fts3OpenTokenizer(pT, pCsr->iLangid, zText, -1, &pTC); while( rc==SQLITE_OK ){ char const *zToken; /* Buffer containing token */ int nToken = 0; /* Number of bytes in token */ int iDum1 = 0, iDum2 = 0; /* Dummy variables */ int iPos = 0; /* Position of token in zText */ rc = pModule->xNext(pTC, &zToken, &nToken, &iDum1, &iDum2, &iPos); for(pDef=pCsr->pDeferred; pDef && rc==SQLITE_OK; pDef=pDef->pNext){ Fts3PhraseToken *pPT = pDef->pToken; if( (pDef->iCol>=p->nColumn || pDef->iCol==i) && (pPT->bFirst==0 || iPos==0) && (pPT->n==nToken || (pPT->isPrefix && pPT->nz, pPT->n)) ){ fts3PendingListAppend(&pDef->pList, iDocid, i, iPos, &rc); } } } if( pTC ) pModule->xClose(pTC); if( rc==SQLITE_DONE ) rc = SQLITE_OK; } } for(pDef=pCsr->pDeferred; pDef && rc==SQLITE_OK; pDef=pDef->pNext){ if( pDef->pList ){ rc = fts3PendingListAppendVarint(&pDef->pList, 0); } } } return rc; } int sqlite3Fts3DeferredTokenList( Fts3DeferredToken *p, char **ppData, int *pnData ){ char *pRet; int nSkip; sqlite3_int64 dummy; *ppData = 0; *pnData = 0; if( p->pList==0 ){ return SQLITE_OK; } pRet = (char *)sqlite3_malloc(p->pList->nData); if( !pRet ) return SQLITE_NOMEM; nSkip = sqlite3Fts3GetVarint(p->pList->aData, &dummy); *pnData = p->pList->nData - nSkip; *ppData = pRet; memcpy(pRet, &p->pList->aData[nSkip], *pnData); return SQLITE_OK; } /* ** Add an entry for token pToken to the pCsr->pDeferred list. */ int sqlite3Fts3DeferToken( Fts3Cursor *pCsr, /* Fts3 table cursor */ Fts3PhraseToken *pToken, /* Token to defer */ int iCol /* Column that token must appear in (or -1) */ ){ Fts3DeferredToken *pDeferred; pDeferred = sqlite3_malloc(sizeof(*pDeferred)); if( !pDeferred ){ return SQLITE_NOMEM; } memset(pDeferred, 0, sizeof(*pDeferred)); pDeferred->pToken = pToken; pDeferred->pNext = pCsr->pDeferred; pDeferred->iCol = iCol; pCsr->pDeferred = pDeferred; assert( pToken->pDeferred==0 ); pToken->pDeferred = pDeferred; return SQLITE_OK; } #endif /* ** SQLite value pRowid contains the rowid of a row that may or may not be ** present in the FTS3 table. If it is, delete it and adjust the contents ** of subsiduary data structures accordingly. */ static int fts3DeleteByRowid( Fts3Table *p, sqlite3_value *pRowid, int *pnChng, /* IN/OUT: Decrement if row is deleted */ u32 *aSzDel ){ int rc = SQLITE_OK; /* Return code */ int bFound = 0; /* True if *pRowid really is in the table */ fts3DeleteTerms(&rc, p, pRowid, aSzDel, &bFound); if( bFound && rc==SQLITE_OK ){ int isEmpty = 0; /* Deleting *pRowid leaves the table empty */ rc = fts3IsEmpty(p, pRowid, &isEmpty); if( rc==SQLITE_OK ){ if( isEmpty ){ /* Deleting this row means the whole table is empty. In this case ** delete the contents of all three tables and throw away any ** data in the pendingTerms hash table. */ rc = fts3DeleteAll(p, 1); *pnChng = 0; memset(aSzDel, 0, sizeof(u32) * (p->nColumn+1) * 2); }else{ *pnChng = *pnChng - 1; if( p->zContentTbl==0 ){ fts3SqlExec(&rc, p, SQL_DELETE_CONTENT, &pRowid); } if( p->bHasDocsize ){ fts3SqlExec(&rc, p, SQL_DELETE_DOCSIZE, &pRowid); } } } } return rc; } /* ** This function does the work for the xUpdate method of FTS3 virtual ** tables. The schema of the virtual table being: ** ** CREATE TABLE ( ** , **
HIDDEN, ** docid HIDDEN, ** HIDDEN ** ); ** ** */ int sqlite3Fts3UpdateMethod( sqlite3_vtab *pVtab, /* FTS3 vtab object */ int nArg, /* Size of argument array */ sqlite3_value **apVal, /* Array of arguments */ sqlite_int64 *pRowid /* OUT: The affected (or effected) rowid */ ){ Fts3Table *p = (Fts3Table *)pVtab; int rc = SQLITE_OK; /* Return Code */ int isRemove = 0; /* True for an UPDATE or DELETE */ u32 *aSzIns = 0; /* Sizes of inserted documents */ u32 *aSzDel = 0; /* Sizes of deleted documents */ int nChng = 0; /* Net change in number of documents */ int bInsertDone = 0; /* At this point it must be known if the %_stat table exists or not. ** So bHasStat may not be 2. */ assert( p->bHasStat==0 || p->bHasStat==1 ); assert( p->pSegments==0 ); assert( nArg==1 /* DELETE operations */ || nArg==(2 + p->nColumn + 3) /* INSERT or UPDATE operations */ ); /* Check for a "special" INSERT operation. One of the form: ** ** INSERT INTO xyz(xyz) VALUES('command'); */ if( nArg>1 && sqlite3_value_type(apVal[0])==SQLITE_NULL && sqlite3_value_type(apVal[p->nColumn+2])!=SQLITE_NULL ){ rc = fts3SpecialInsert(p, apVal[p->nColumn+2]); goto update_out; } if( nArg>1 && sqlite3_value_int(apVal[2 + p->nColumn + 2])<0 ){ rc = SQLITE_CONSTRAINT; goto update_out; } /* Allocate space to hold the change in document sizes */ aSzDel = sqlite3_malloc( sizeof(aSzDel[0])*(p->nColumn+1)*2 ); if( aSzDel==0 ){ rc = SQLITE_NOMEM; goto update_out; } aSzIns = &aSzDel[p->nColumn+1]; memset(aSzDel, 0, sizeof(aSzDel[0])*(p->nColumn+1)*2); rc = fts3Writelock(p); if( rc!=SQLITE_OK ) goto update_out; /* If this is an INSERT operation, or an UPDATE that modifies the rowid ** value, then this operation requires constraint handling. ** ** If the on-conflict mode is REPLACE, this means that the existing row ** should be deleted from the database before inserting the new row. Or, ** if the on-conflict mode is other than REPLACE, then this method must ** detect the conflict and return SQLITE_CONSTRAINT before beginning to ** modify the database file. */ if( nArg>1 && p->zContentTbl==0 ){ /* Find the value object that holds the new rowid value. */ sqlite3_value *pNewRowid = apVal[3+p->nColumn]; if( sqlite3_value_type(pNewRowid)==SQLITE_NULL ){ pNewRowid = apVal[1]; } if( sqlite3_value_type(pNewRowid)!=SQLITE_NULL && ( sqlite3_value_type(apVal[0])==SQLITE_NULL || sqlite3_value_int64(apVal[0])!=sqlite3_value_int64(pNewRowid) )){ /* The new rowid is not NULL (in this case the rowid will be ** automatically assigned and there is no chance of a conflict), and ** the statement is either an INSERT or an UPDATE that modifies the ** rowid column. So if the conflict mode is REPLACE, then delete any ** existing row with rowid=pNewRowid. ** ** Or, if the conflict mode is not REPLACE, insert the new record into ** the %_content table. If we hit the duplicate rowid constraint (or any ** other error) while doing so, return immediately. ** ** This branch may also run if pNewRowid contains a value that cannot ** be losslessly converted to an integer. In this case, the eventual ** call to fts3InsertData() (either just below or further on in this ** function) will return SQLITE_MISMATCH. If fts3DeleteByRowid is ** invoked, it will delete zero rows (since no row will have ** docid=$pNewRowid if $pNewRowid is not an integer value). */ if( sqlite3_vtab_on_conflict(p->db)==SQLITE_REPLACE ){ rc = fts3DeleteByRowid(p, pNewRowid, &nChng, aSzDel); }else{ rc = fts3InsertData(p, apVal, pRowid); bInsertDone = 1; } } } if( rc!=SQLITE_OK ){ goto update_out; } /* If this is a DELETE or UPDATE operation, remove the old record. */ if( sqlite3_value_type(apVal[0])!=SQLITE_NULL ){ assert( sqlite3_value_type(apVal[0])==SQLITE_INTEGER ); rc = fts3DeleteByRowid(p, apVal[0], &nChng, aSzDel); isRemove = 1; } /* If this is an INSERT or UPDATE operation, insert the new record. */ if( nArg>1 && rc==SQLITE_OK ){ int iLangid = sqlite3_value_int(apVal[2 + p->nColumn + 2]); if( bInsertDone==0 ){ rc = fts3InsertData(p, apVal, pRowid); if( rc==SQLITE_CONSTRAINT && p->zContentTbl==0 ){ rc = FTS_CORRUPT_VTAB; } } if( rc==SQLITE_OK && (!isRemove || *pRowid!=p->iPrevDocid ) ){ rc = fts3PendingTermsDocid(p, 0, iLangid, *pRowid); } if( rc==SQLITE_OK ){ assert( p->iPrevDocid==*pRowid ); rc = fts3InsertTerms(p, iLangid, apVal, aSzIns); } if( p->bHasDocsize ){ fts3InsertDocsize(&rc, p, aSzIns); } nChng++; } if( p->bFts4 ){ fts3UpdateDocTotals(&rc, p, aSzIns, aSzDel, nChng); } update_out: sqlite3_free(aSzDel); sqlite3Fts3SegmentsClose(p); return rc; } /* ** Flush any data in the pending-terms hash table to disk. If successful, ** merge all segments in the database (including the new segment, if ** there was any data to flush) into a single segment. */ int sqlite3Fts3Optimize(Fts3Table *p){ int rc; rc = sqlite3_exec(p->db, "SAVEPOINT fts3", 0, 0, 0); if( rc==SQLITE_OK ){ rc = fts3DoOptimize(p, 1); if( rc==SQLITE_OK || rc==SQLITE_DONE ){ int rc2 = sqlite3_exec(p->db, "RELEASE fts3", 0, 0, 0); if( rc2!=SQLITE_OK ) rc = rc2; }else{ sqlite3_exec(p->db, "ROLLBACK TO fts3", 0, 0, 0); sqlite3_exec(p->db, "RELEASE fts3", 0, 0, 0); } } sqlite3Fts3SegmentsClose(p); return rc; } #endif ================================================ FILE: v2/testdata/_sqlite/ext/fts3/fts3speed.tcl ================================================ #-------------------------------------------------------------------------- # This script contains several sub-programs used to test FTS3/FTS4 # performance. It does not run the queries directly, but generates SQL # scripts that can be run using the shell tool. # # The following cases are tested: # # 1. Inserting documents into an FTS3 table. # 2. Optimizing an FTS3 table (i.e. "INSERT INTO t1 VALUES('optimize')"). # 3. Deleting documents from an FTS3 table. # 4. Querying FTS3 tables. # # Number of tokens in vocabulary. And number of tokens in each document. # set VOCAB_SIZE 2000 set DOC_SIZE 100 set NUM_INSERTS 100000 set NUM_SELECTS 1000 # Force everything in this script to be deterministic. # expr {srand(0)} proc usage {} { puts stderr "Usage: $::argv0 " exit -1 } proc sql {sql} { puts $::fd $sql } # Return a list of $nWord randomly generated tokens each between 2 and 10 # characters in length. # proc build_vocab {nWord} { set ret [list] set chars [list a b c d e f g h i j k l m n o p q r s t u v w x y z] for {set i 0} {$i<$nWord} {incr i} { set len [expr {int((rand()*9.0)+2)}] set term "" for {set j 0} {$j<$len} {incr j} { append term [lindex $chars [expr {int(rand()*[llength $chars])}]] } lappend ret $term } set ret } proc select_term {} { set n [llength $::vocab] set t [expr int(rand()*$n*3)] if {$t>=2*$n} { set t [expr {($t-2*$n)/100}] } if {$t>=$n} { set t [expr {($t-$n)/10}] } lindex $::vocab $t } proc select_doc {nTerm} { set ret [list] for {set i 0} {$i<$nTerm} {incr i} { lappend ret [select_term] } set ret } proc test_1 {nInsert} { sql "PRAGMA synchronous = OFF;" sql "DROP TABLE IF EXISTS t1;" sql "CREATE VIRTUAL TABLE t1 USING fts4;" for {set i 0} {$i < $nInsert} {incr i} { set doc [select_doc $::DOC_SIZE] sql "INSERT INTO t1 VALUES('$doc');" } } proc test_2 {} { sql "INSERT INTO t1(t1) VALUES('optimize');" } proc test_3 {nSelect} { for {set i 0} {$i < $nSelect} {incr i} { sql "SELECT count(*) FROM t1 WHERE t1 MATCH '[select_term]';" } } proc test_4 {nSelect} { for {set i 0} {$i < $nSelect} {incr i} { sql "SELECT count(*) FROM t1 WHERE t1 MATCH '[select_term] [select_term]';" } } if {[llength $argv]!=0} usage set ::vocab [build_vocab $::VOCAB_SIZE] set ::fd [open fts3speed_insert.sql w] test_1 $NUM_INSERTS close $::fd set ::fd [open fts3speed_select.sql w] test_3 $NUM_SELECTS close $::fd set ::fd [open fts3speed_select2.sql w] test_4 $NUM_SELECTS close $::fd set ::fd [open fts3speed_optimize.sql w] test_2 close $::fd puts "Success. Created files:" puts " fts3speed_insert.sql" puts " fts3speed_select.sql" puts " fts3speed_select2.sql" puts " fts3speed_optimize.sql" ================================================ FILE: v2/testdata/_sqlite/ext/fts3/mkfts3amal.tcl ================================================ #!/usr/bin/tclsh # # This script builds a single C code file holding all of FTS3 code. # The name of the output file is fts3amal.c. To build this file, # first do: # # make target_source # # The make target above moves all of the source code files into # a subdirectory named "tsrc". (This script expects to find the files # there and will not work if they are not found.) # # After the "tsrc" directory has been created and populated, run # this script: # # tclsh mkfts3amal.tcl # # The amalgamated FTS3 code will be written into fts3amal.c # # Open the output file and write a header comment at the beginning # of the file. # set out [open fts3amal.c w] set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1] puts $out [subst \ {/****************************************************************************** ** This file is an amalgamation of separate C source files from the SQLite ** Full Text Search extension 2 (fts3). By combining all the individual C ** code files into this single large file, the entire code can be compiled ** as a one translation unit. This allows many compilers to do optimizations ** that would not be possible if the files were compiled separately. It also ** makes the code easier to import into other projects. ** ** This amalgamation was generated on $today. */}] # These are the header files used by FTS3. The first time any of these # files are seen in a #include statement in the C code, include the complete # text of the file in-line. The file only needs to be included once. # foreach hdr { fts3.h fts3_hash.h fts3_tokenizer.h sqlite3.h sqlite3ext.h } { set available_hdr($hdr) 1 } # 78 stars used for comment formatting. set s78 \ {*****************************************************************************} # Insert a comment into the code # proc section_comment {text} { global out s78 set n [string length $text] set nstar [expr {60 - $n}] set stars [string range $s78 0 $nstar] puts $out "/************** $text $stars/" } # Read the source file named $filename and write it into the # sqlite3.c output file. If any #include statements are seen, # process them approprately. # proc copy_file {filename} { global seen_hdr available_hdr out set tail [file tail $filename] section_comment "Begin file $tail" set in [open $filename r] while {![eof $in]} { set line [gets $in] if {[regexp {^#\s*include\s+["<]([^">]+)[">]} $line all hdr]} { if {[info exists available_hdr($hdr)]} { if {$available_hdr($hdr)} { section_comment "Include $hdr in the middle of $tail" copy_file tsrc/$hdr section_comment "Continuing where we left off in $tail" } } elseif {![info exists seen_hdr($hdr)]} { set seen_hdr($hdr) 1 puts $out $line } } elseif {[regexp {^#ifdef __cplusplus} $line]} { puts $out "#if 0" } elseif {[regexp {^#line} $line]} { # Skip #line directives. } else { puts $out $line } } close $in section_comment "End of $tail" } # Process the source files. Process files containing commonly # used subroutines first in order to help the compiler find # inlining opportunities. # foreach file { fts3.c fts3_hash.c fts3_porter.c fts3_tokenizer.c fts3_tokenizer1.c } { copy_file tsrc/$file } close $out ================================================ FILE: v2/testdata/_sqlite/ext/fts3/tool/fts3cov.sh ================================================ #!/bin/sh set -e srcdir=`dirname $(dirname $(dirname $(dirname $0)))` ./testfixture $srcdir/test/fts3.test --output=fts3cov-out.txt echo "" for f in `ls $srcdir/ext/fts3/*.c` do f=`basename $f` echo -ne "$f: " gcov -b $f | grep Taken | sed 's/Taken at least once://' done ================================================ FILE: v2/testdata/_sqlite/ext/fts3/tool/fts3view.c ================================================ /* ** This program is a debugging and analysis utility that displays ** information about an FTS3 or FTS4 index. ** ** Link this program against the SQLite3 amalgamation with the ** SQLITE_ENABLE_FTS4 compile-time option. Then run it as: ** ** fts3view DATABASE ** ** to get a list of all FTS3/4 tables in DATABASE, or do ** ** fts3view DATABASE TABLE COMMAND .... ** ** to see various aspects of the TABLE table. Type fts3view with no ** arguments for a list of available COMMANDs. */ #include #include #include #include #include #include "sqlite3.h" /* ** Extra command-line arguments: */ int nExtra; char **azExtra; /* ** Look for a command-line argument. */ const char *findOption(const char *zName, int hasArg, const char *zDefault){ int i; const char *zResult = zDefault; for(i=0; i=2000 ){ n = 0; pStmt = prepare(db, "SELECT count(*) FROM %s" " WHERE col='*' AND occurrences<=%d", zAux, nDoc/1000); while( sqlite3_step(pStmt)==SQLITE_ROW ){ n = sqlite3_column_int(pStmt, 0); } sqlite3_finalize(pStmt); printf("Tokens used in 0.1%% or less of docs...... %9d %5.2f%%\n", n, n*100.0/nToken); } if( nDoc>=200 ){ n = 0; pStmt = prepare(db, "SELECT count(*) FROM %s" " WHERE col='*' AND occurrences<=%d", zAux, nDoc/100); while( sqlite3_step(pStmt)==SQLITE_ROW ){ n = sqlite3_column_int(pStmt, 0); } sqlite3_finalize(pStmt); printf("Tokens used in 1%% or less of docs........ %9d %5.2f%%\n", n, n*100.0/nToken); } nTop = atoi(findOption("top", 1, "25")); printf("The %d most common tokens:\n", nTop); pStmt = prepare(db, "SELECT term, documents FROM %s" " WHERE col='*'" " ORDER BY documents DESC, term" " LIMIT %d", zAux, nTop); i = 0; while( sqlite3_step(pStmt)==SQLITE_ROW ){ i++; n = sqlite3_column_int(pStmt, 1); printf(" %2d. %-30s %9d docs %5.2f%%\n", i, sqlite3_column_text(pStmt, 0), n, n*100.0/nDoc); } sqlite3_finalize(pStmt); end_vocab: runSql(db, "ROLLBACK"); sqlite3_free(zAux); } /* ** Report on the number and sizes of segments */ static void showSegmentStats(sqlite3 *db, const char *zTab){ sqlite3_stmt *pStmt; int nSeg = 0; sqlite3_int64 szSeg = 0, mxSeg = 0; int nIdx = 0; sqlite3_int64 szIdx = 0, mxIdx = 0; int nRoot = 0; sqlite3_int64 szRoot = 0, mxRoot = 0; sqlite3_int64 mx; int nLeaf; int n; int pgsz; int mxLevel; int i; pStmt = prepare(db, "SELECT count(*), sum(length(block)), max(length(block))" " FROM '%q_segments'", zTab); while( sqlite3_step(pStmt)==SQLITE_ROW ){ nSeg = sqlite3_column_int(pStmt, 0); szSeg = sqlite3_column_int64(pStmt, 1); mxSeg = sqlite3_column_int64(pStmt, 2); } sqlite3_finalize(pStmt); pStmt = prepare(db, "SELECT count(*), sum(length(block)), max(length(block))" " FROM '%q_segments' a JOIN '%q_segdir' b" " WHERE a.blockid BETWEEN b.leaves_end_block+1 AND b.end_block", zTab, zTab); while( sqlite3_step(pStmt)==SQLITE_ROW ){ nIdx = sqlite3_column_int(pStmt, 0); szIdx = sqlite3_column_int64(pStmt, 1); mxIdx = sqlite3_column_int64(pStmt, 2); } sqlite3_finalize(pStmt); pStmt = prepare(db, "SELECT count(*), sum(length(root)), max(length(root))" " FROM '%q_segdir'", zTab); while( sqlite3_step(pStmt)==SQLITE_ROW ){ nRoot = sqlite3_column_int(pStmt, 0); szRoot = sqlite3_column_int64(pStmt, 1); mxRoot = sqlite3_column_int64(pStmt, 2); } sqlite3_finalize(pStmt); printf("Number of segments....................... %9d\n", nSeg+nRoot); printf("Number of leaf segments.................. %9d\n", nSeg-nIdx); printf("Number of index segments................. %9d\n", nIdx); printf("Number of root segments.................. %9d\n", nRoot); printf("Total size of all segments............... %9lld\n", szSeg+szRoot); printf("Total size of all leaf segments.......... %9lld\n", szSeg-szIdx); printf("Total size of all index segments......... %9lld\n", szIdx); printf("Total size of all root segments.......... %9lld\n", szRoot); if( nSeg>0 ){ printf("Average size of all segments............. %11.1f\n", (double)(szSeg+szRoot)/(double)(nSeg+nRoot)); printf("Average size of leaf segments............ %11.1f\n", (double)(szSeg-szIdx)/(double)(nSeg-nIdx)); } if( nIdx>0 ){ printf("Average size of index segments........... %11.1f\n", (double)szIdx/(double)nIdx); } if( nRoot>0 ){ printf("Average size of root segments............ %11.1f\n", (double)szRoot/(double)nRoot); } mx = mxSeg; if( mx%d", zTab, zTab, pgsz-45); n = 0; while( sqlite3_step(pStmt)==SQLITE_ROW ){ n = sqlite3_column_int(pStmt, 0); } sqlite3_finalize(pStmt); nLeaf = nSeg - nIdx; printf("Leaf segments larger than %5d bytes.... %9d %5.2f%%\n", pgsz-45, n, nLeaf>0 ? n*100.0/nLeaf : 0.0); pStmt = prepare(db, "SELECT max(level%%1024) FROM '%q_segdir'", zTab); mxLevel = 0; while( sqlite3_step(pStmt)==SQLITE_ROW ){ mxLevel = sqlite3_column_int(pStmt, 0); } sqlite3_finalize(pStmt); for(i=0; i<=mxLevel; i++){ pStmt = prepare(db, "SELECT count(*), sum(len), avg(len), max(len), sum(len>%d)," " count(distinct idx)" " FROM (SELECT length(a.block) AS len, idx" " FROM '%q_segments' a JOIN '%q_segdir' b" " WHERE (a.blockid BETWEEN b.start_block" " AND b.leaves_end_block)" " AND (b.level%%1024)==%d)", pgsz-45, zTab, zTab, i); if( sqlite3_step(pStmt)==SQLITE_ROW && (nLeaf = sqlite3_column_int(pStmt, 0))>0 ){ sqlite3_int64 sz; nIdx = sqlite3_column_int(pStmt, 5); printf("For level %d:\n", i); printf(" Number of indexes...................... %9d\n", nIdx); printf(" Number of leaf segments................ %9d\n", nLeaf); if( nIdx>1 ){ printf(" Average leaf segments per index........ %11.1f\n", (double)nLeaf/(double)nIdx); } printf(" Total size of all leaf segments........ %9lld\n", (sz = sqlite3_column_int64(pStmt, 1))); printf(" Average size of leaf segments.......... %11.1f\n", sqlite3_column_double(pStmt, 2)); if( nIdx>1 ){ printf(" Average leaf segment size per index.... %11.1f\n", (double)sz/(double)nIdx); } printf(" Maximum leaf segment size.............. %9lld\n", sqlite3_column_int64(pStmt, 3)); n = sqlite3_column_int(pStmt, 4); printf(" Leaf segments larger than %5d bytes.. %9d %5.2f%%\n", pgsz-45, n, n*100.0/nLeaf); } sqlite3_finalize(pStmt); } } /* ** Print a single "tree" line of the segdir map output. */ static void printTreeLine(sqlite3_int64 iLower, sqlite3_int64 iUpper){ printf(" tree %9lld", iLower); if( iUpper>iLower ){ printf(" thru %9lld (%lld blocks)", iUpper, iUpper-iLower+1); } printf("\n"); } /* ** Check to see if the block of a %_segments entry is NULL. */ static int isNullSegment(sqlite3 *db, const char *zTab, sqlite3_int64 iBlockId){ sqlite3_stmt *pStmt; int rc = 1; pStmt = prepare(db, "SELECT block IS NULL FROM '%q_segments'" " WHERE blockid=%lld", zTab, iBlockId); if( sqlite3_step(pStmt)==SQLITE_ROW ){ rc = sqlite3_column_int(pStmt, 0); } sqlite3_finalize(pStmt); return rc; } /* ** Show a map of segments derived from the %_segdir table. */ static void showSegdirMap(sqlite3 *db, const char *zTab){ int mxIndex, iIndex; sqlite3_stmt *pStmt = 0; sqlite3_stmt *pStmt2 = 0; int prevLevel; pStmt = prepare(db, "SELECT max(level/1024) FROM '%q_segdir'", zTab); if( sqlite3_step(pStmt)==SQLITE_ROW ){ mxIndex = sqlite3_column_int(pStmt, 0); }else{ mxIndex = 0; } sqlite3_finalize(pStmt); printf("Number of inverted indices............... %3d\n", mxIndex+1); pStmt = prepare(db, "SELECT level, idx, start_block, leaves_end_block, end_block, rowid" " FROM '%q_segdir'" " WHERE level/1024==?" " ORDER BY level DESC, idx", zTab); pStmt2 = prepare(db, "SELECT blockid FROM '%q_segments'" " WHERE blockid BETWEEN ? AND ? ORDER BY blockid", zTab); for(iIndex=0; iIndex<=mxIndex; iIndex++){ if( mxIndex>0 ){ printf("**************************** Index %d " "****************************\n", iIndex); } sqlite3_bind_int(pStmt, 1, iIndex); prevLevel = -1; while( sqlite3_step(pStmt)==SQLITE_ROW ){ int iLevel = sqlite3_column_int(pStmt, 0)%1024; int iIdx = sqlite3_column_int(pStmt, 1); sqlite3_int64 iStart = sqlite3_column_int64(pStmt, 2); sqlite3_int64 iLEnd = sqlite3_column_int64(pStmt, 3); sqlite3_int64 iEnd = sqlite3_column_int64(pStmt, 4); char rtag[20]; if( iLevel!=prevLevel ){ printf("level %2d idx %2d", iLevel, iIdx); prevLevel = iLevel; }else{ printf(" idx %2d", iIdx); } sqlite3_snprintf(sizeof(rtag), rtag, "r%lld", sqlite3_column_int64(pStmt,5)); printf(" root %9s\n", rtag); if( iLEnd>iStart ){ sqlite3_int64 iLower, iPrev = 0, iX; if( iLEnd+1<=iEnd ){ sqlite3_bind_int64(pStmt2, 1, iLEnd+1); sqlite3_bind_int64(pStmt2, 2, iEnd); iLower = -1; while( sqlite3_step(pStmt2)==SQLITE_ROW ){ iX = sqlite3_column_int64(pStmt2, 0); if( iLower<0 ){ iLower = iPrev = iX; }else if( iX==iPrev+1 ){ iPrev = iX; }else{ printTreeLine(iLower, iPrev); iLower = iPrev = iX; } } sqlite3_reset(pStmt2); if( iLower>=0 ){ if( iLower==iPrev && iLower==iEnd && isNullSegment(db,zTab,iLower) ){ printf(" null %9lld\n", iLower); }else{ printTreeLine(iLower, iPrev); } } } printf(" leaves %9lld thru %9lld (%lld blocks)\n", iStart, iLEnd, iLEnd - iStart + 1); } } sqlite3_reset(pStmt); } sqlite3_finalize(pStmt); sqlite3_finalize(pStmt2); } /* ** Decode a single segment block and display the results on stdout. */ static void decodeSegment( const unsigned char *aData, /* Content to print */ int nData /* Number of bytes of content */ ){ sqlite3_int64 iChild = 0; sqlite3_int64 iPrefix; sqlite3_int64 nTerm; sqlite3_int64 n; sqlite3_int64 iDocsz; int iHeight; sqlite3_int64 i = 0; int cnt = 0; char zTerm[1000]; i += getVarint(aData, &n); iHeight = (int)n; printf("height: %d\n", iHeight); if( iHeight>0 ){ i += getVarint(aData+i, &iChild); printf("left-child: %lld\n", iChild); } while( i0 ){ i += getVarint(aData+i, &iPrefix); }else{ iPrefix = 0; } i += getVarint(aData+i, &nTerm); if( iPrefix+nTerm+1 >= sizeof(zTerm) ){ fprintf(stderr, "term to long\n"); exit(1); } memcpy(zTerm+iPrefix, aData+i, (size_t)nTerm); zTerm[iPrefix+nTerm] = 0; i += nTerm; if( iHeight==0 ){ i += getVarint(aData+i, &iDocsz); printf("term: %-25s doclist %7lld bytes offset %lld\n", zTerm, iDocsz, i); i += iDocsz; }else{ printf("term: %-25s child %lld\n", zTerm, ++iChild); } } } /* ** Print a a blob as hex and ascii. */ static void printBlob( const unsigned char *aData, /* Content to print */ int nData /* Number of bytes of content */ ){ int i, j; const char *zOfstFmt; const int perLine = 16; if( (nData&~0xfff)==0 ){ zOfstFmt = " %03x: "; }else if( (nData&~0xffff)==0 ){ zOfstFmt = " %04x: "; }else if( (nData&~0xfffff)==0 ){ zOfstFmt = " %05x: "; }else if( (nData&~0xffffff)==0 ){ zOfstFmt = " %06x: "; }else{ zOfstFmt = " %08x: "; } for(i=0; inData ){ fprintf(stdout, " "); }else{ fprintf(stdout,"%02x ", aData[i+j]); } } for(j=0; jnData ){ fprintf(stdout, " "); }else{ fprintf(stdout,"%c", isprint(aData[i+j]) ? aData[i+j] : '.'); } } fprintf(stdout,"\n"); } } /* ** Convert text to a 64-bit integer */ static sqlite3_int64 atoi64(const char *z){ sqlite3_int64 v = 0; while( z[0]>='0' && z[0]<='9' ){ v = v*10 + z[0] - '0'; z++; } return v; } /* ** Return a prepared statement which, when stepped, will return in its ** first column the blob associated with segment zId. If zId begins with ** 'r' then it is a rowid of a %_segdir entry. Otherwise it is a ** %_segment entry. */ static sqlite3_stmt *prepareToGetSegment( sqlite3 *db, /* The database */ const char *zTab, /* The FTS3/4 table name */ const char *zId /* ID of the segment to open */ ){ sqlite3_stmt *pStmt; if( zId[0]=='r' ){ pStmt = prepare(db, "SELECT root FROM '%q_segdir' WHERE rowid=%lld", zTab, atoi64(zId+1)); }else{ pStmt = prepare(db, "SELECT block FROM '%q_segments' WHERE blockid=%lld", zTab, atoi64(zId)); } return pStmt; } /* ** Print the content of a segment or of the root of a segdir. The segment ** or root is identified by azExtra[0]. If the first character of azExtra[0] ** is 'r' then the remainder is the integer rowid of the %_segdir entry. ** If the first character of azExtra[0] is not 'r' then, then all of ** azExtra[0] is an integer which is the block number. ** ** If the --raw option is present in azExtra, then a hex dump is provided. ** Otherwise a decoding is shown. */ static void showSegment(sqlite3 *db, const char *zTab){ const unsigned char *aData; int nData; sqlite3_stmt *pStmt; pStmt = prepareToGetSegment(db, zTab, azExtra[0]); if( sqlite3_step(pStmt)!=SQLITE_ROW ){ sqlite3_finalize(pStmt); return; } nData = sqlite3_column_bytes(pStmt, 0); aData = sqlite3_column_blob(pStmt, 0); printf("Segment %s of size %d bytes:\n", azExtra[0], nData); if( findOption("raw", 0, 0)!=0 ){ printBlob(aData, nData); }else{ decodeSegment(aData, nData); } sqlite3_finalize(pStmt); } /* ** Decode a single doclist and display the results on stdout. */ static void decodeDoclist( const unsigned char *aData, /* Content to print */ int nData /* Number of bytes of content */ ){ sqlite3_int64 iPrevDocid = 0; sqlite3_int64 iDocid; sqlite3_int64 iPos; sqlite3_int64 iPrevPos = 0; sqlite3_int64 iCol; int i = 0; while( i; ; ; # # # The status field is: # C: common case folding, common mappings shared by both simple and full mappings. # F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. # S: simple case folding, mappings to single characters where different from F. # T: special case for uppercase I and dotted uppercase I # - For non-Turkic languages, this mapping is normally not used. # - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. # Note that the Turkic mappings do not maintain canonical equivalence without additional processing. # See the discussions of case mapping in the Unicode Standard for more information. # # Usage: # A. To do a simple case folding, use the mappings with status C + S. # B. To do a full case folding, use the mappings with status C + F. # # The mappings with status T can be used or omitted depending on the desired case-folding # behavior. (The default option is to exclude them.) # # ================================================================= # Property: Case_Folding # All code points not explicitly listed for Case_Folding # have the value C for the status field, and the code point itself for the mapping field. # @missing: 0000..10FFFF; C; # ================================================================= 0041; C; 0061; # LATIN CAPITAL LETTER A 0042; C; 0062; # LATIN CAPITAL LETTER B 0043; C; 0063; # LATIN CAPITAL LETTER C 0044; C; 0064; # LATIN CAPITAL LETTER D 0045; C; 0065; # LATIN CAPITAL LETTER E 0046; C; 0066; # LATIN CAPITAL LETTER F 0047; C; 0067; # LATIN CAPITAL LETTER G 0048; C; 0068; # LATIN CAPITAL LETTER H 0049; C; 0069; # LATIN CAPITAL LETTER I 0049; T; 0131; # LATIN CAPITAL LETTER I 004A; C; 006A; # LATIN CAPITAL LETTER J 004B; C; 006B; # LATIN CAPITAL LETTER K 004C; C; 006C; # LATIN CAPITAL LETTER L 004D; C; 006D; # LATIN CAPITAL LETTER M 004E; C; 006E; # LATIN CAPITAL LETTER N 004F; C; 006F; # LATIN CAPITAL LETTER O 0050; C; 0070; # LATIN CAPITAL LETTER P 0051; C; 0071; # LATIN CAPITAL LETTER Q 0052; C; 0072; # LATIN CAPITAL LETTER R 0053; C; 0073; # LATIN CAPITAL LETTER S 0054; C; 0074; # LATIN CAPITAL LETTER T 0055; C; 0075; # LATIN CAPITAL LETTER U 0056; C; 0076; # LATIN CAPITAL LETTER V 0057; C; 0077; # LATIN CAPITAL LETTER W 0058; C; 0078; # LATIN CAPITAL LETTER X 0059; C; 0079; # LATIN CAPITAL LETTER Y 005A; C; 007A; # LATIN CAPITAL LETTER Z 00B5; C; 03BC; # MICRO SIGN 00C0; C; 00E0; # LATIN CAPITAL LETTER A WITH GRAVE 00C1; C; 00E1; # LATIN CAPITAL LETTER A WITH ACUTE 00C2; C; 00E2; # LATIN CAPITAL LETTER A WITH CIRCUMFLEX 00C3; C; 00E3; # LATIN CAPITAL LETTER A WITH TILDE 00C4; C; 00E4; # LATIN CAPITAL LETTER A WITH DIAERESIS 00C5; C; 00E5; # LATIN CAPITAL LETTER A WITH RING ABOVE 00C6; C; 00E6; # LATIN CAPITAL LETTER AE 00C7; C; 00E7; # LATIN CAPITAL LETTER C WITH CEDILLA 00C8; C; 00E8; # LATIN CAPITAL LETTER E WITH GRAVE 00C9; C; 00E9; # LATIN CAPITAL LETTER E WITH ACUTE 00CA; C; 00EA; # LATIN CAPITAL LETTER E WITH CIRCUMFLEX 00CB; C; 00EB; # LATIN CAPITAL LETTER E WITH DIAERESIS 00CC; C; 00EC; # LATIN CAPITAL LETTER I WITH GRAVE 00CD; C; 00ED; # LATIN CAPITAL LETTER I WITH ACUTE 00CE; C; 00EE; # LATIN CAPITAL LETTER I WITH CIRCUMFLEX 00CF; C; 00EF; # LATIN CAPITAL LETTER I WITH DIAERESIS 00D0; C; 00F0; # LATIN CAPITAL LETTER ETH 00D1; C; 00F1; # LATIN CAPITAL LETTER N WITH TILDE 00D2; C; 00F2; # LATIN CAPITAL LETTER O WITH GRAVE 00D3; C; 00F3; # LATIN CAPITAL LETTER O WITH ACUTE 00D4; C; 00F4; # LATIN CAPITAL LETTER O WITH CIRCUMFLEX 00D5; C; 00F5; # LATIN CAPITAL LETTER O WITH TILDE 00D6; C; 00F6; # LATIN CAPITAL LETTER O WITH DIAERESIS 00D8; C; 00F8; # LATIN CAPITAL LETTER O WITH STROKE 00D9; C; 00F9; # LATIN CAPITAL LETTER U WITH GRAVE 00DA; C; 00FA; # LATIN CAPITAL LETTER U WITH ACUTE 00DB; C; 00FB; # LATIN CAPITAL LETTER U WITH CIRCUMFLEX 00DC; C; 00FC; # LATIN CAPITAL LETTER U WITH DIAERESIS 00DD; C; 00FD; # LATIN CAPITAL LETTER Y WITH ACUTE 00DE; C; 00FE; # LATIN CAPITAL LETTER THORN 00DF; F; 0073 0073; # LATIN SMALL LETTER SHARP S 0100; C; 0101; # LATIN CAPITAL LETTER A WITH MACRON 0102; C; 0103; # LATIN CAPITAL LETTER A WITH BREVE 0104; C; 0105; # LATIN CAPITAL LETTER A WITH OGONEK 0106; C; 0107; # LATIN CAPITAL LETTER C WITH ACUTE 0108; C; 0109; # LATIN CAPITAL LETTER C WITH CIRCUMFLEX 010A; C; 010B; # LATIN CAPITAL LETTER C WITH DOT ABOVE 010C; C; 010D; # LATIN CAPITAL LETTER C WITH CARON 010E; C; 010F; # LATIN CAPITAL LETTER D WITH CARON 0110; C; 0111; # LATIN CAPITAL LETTER D WITH STROKE 0112; C; 0113; # LATIN CAPITAL LETTER E WITH MACRON 0114; C; 0115; # LATIN CAPITAL LETTER E WITH BREVE 0116; C; 0117; # LATIN CAPITAL LETTER E WITH DOT ABOVE 0118; C; 0119; # LATIN CAPITAL LETTER E WITH OGONEK 011A; C; 011B; # LATIN CAPITAL LETTER E WITH CARON 011C; C; 011D; # LATIN CAPITAL LETTER G WITH CIRCUMFLEX 011E; C; 011F; # LATIN CAPITAL LETTER G WITH BREVE 0120; C; 0121; # LATIN CAPITAL LETTER G WITH DOT ABOVE 0122; C; 0123; # LATIN CAPITAL LETTER G WITH CEDILLA 0124; C; 0125; # LATIN CAPITAL LETTER H WITH CIRCUMFLEX 0126; C; 0127; # LATIN CAPITAL LETTER H WITH STROKE 0128; C; 0129; # LATIN CAPITAL LETTER I WITH TILDE 012A; C; 012B; # LATIN CAPITAL LETTER I WITH MACRON 012C; C; 012D; # LATIN CAPITAL LETTER I WITH BREVE 012E; C; 012F; # LATIN CAPITAL LETTER I WITH OGONEK 0130; F; 0069 0307; # LATIN CAPITAL LETTER I WITH DOT ABOVE 0130; T; 0069; # LATIN CAPITAL LETTER I WITH DOT ABOVE 0132; C; 0133; # LATIN CAPITAL LIGATURE IJ 0134; C; 0135; # LATIN CAPITAL LETTER J WITH CIRCUMFLEX 0136; C; 0137; # LATIN CAPITAL LETTER K WITH CEDILLA 0139; C; 013A; # LATIN CAPITAL LETTER L WITH ACUTE 013B; C; 013C; # LATIN CAPITAL LETTER L WITH CEDILLA 013D; C; 013E; # LATIN CAPITAL LETTER L WITH CARON 013F; C; 0140; # LATIN CAPITAL LETTER L WITH MIDDLE DOT 0141; C; 0142; # LATIN CAPITAL LETTER L WITH STROKE 0143; C; 0144; # LATIN CAPITAL LETTER N WITH ACUTE 0145; C; 0146; # LATIN CAPITAL LETTER N WITH CEDILLA 0147; C; 0148; # LATIN CAPITAL LETTER N WITH CARON 0149; F; 02BC 006E; # LATIN SMALL LETTER N PRECEDED BY APOSTROPHE 014A; C; 014B; # LATIN CAPITAL LETTER ENG 014C; C; 014D; # LATIN CAPITAL LETTER O WITH MACRON 014E; C; 014F; # LATIN CAPITAL LETTER O WITH BREVE 0150; C; 0151; # LATIN CAPITAL LETTER O WITH DOUBLE ACUTE 0152; C; 0153; # LATIN CAPITAL LIGATURE OE 0154; C; 0155; # LATIN CAPITAL LETTER R WITH ACUTE 0156; C; 0157; # LATIN CAPITAL LETTER R WITH CEDILLA 0158; C; 0159; # LATIN CAPITAL LETTER R WITH CARON 015A; C; 015B; # LATIN CAPITAL LETTER S WITH ACUTE 015C; C; 015D; # LATIN CAPITAL LETTER S WITH CIRCUMFLEX 015E; C; 015F; # LATIN CAPITAL LETTER S WITH CEDILLA 0160; C; 0161; # LATIN CAPITAL LETTER S WITH CARON 0162; C; 0163; # LATIN CAPITAL LETTER T WITH CEDILLA 0164; C; 0165; # LATIN CAPITAL LETTER T WITH CARON 0166; C; 0167; # LATIN CAPITAL LETTER T WITH STROKE 0168; C; 0169; # LATIN CAPITAL LETTER U WITH TILDE 016A; C; 016B; # LATIN CAPITAL LETTER U WITH MACRON 016C; C; 016D; # LATIN CAPITAL LETTER U WITH BREVE 016E; C; 016F; # LATIN CAPITAL LETTER U WITH RING ABOVE 0170; C; 0171; # LATIN CAPITAL LETTER U WITH DOUBLE ACUTE 0172; C; 0173; # LATIN CAPITAL LETTER U WITH OGONEK 0174; C; 0175; # LATIN CAPITAL LETTER W WITH CIRCUMFLEX 0176; C; 0177; # LATIN CAPITAL LETTER Y WITH CIRCUMFLEX 0178; C; 00FF; # LATIN CAPITAL LETTER Y WITH DIAERESIS 0179; C; 017A; # LATIN CAPITAL LETTER Z WITH ACUTE 017B; C; 017C; # LATIN CAPITAL LETTER Z WITH DOT ABOVE 017D; C; 017E; # LATIN CAPITAL LETTER Z WITH CARON 017F; C; 0073; # LATIN SMALL LETTER LONG S 0181; C; 0253; # LATIN CAPITAL LETTER B WITH HOOK 0182; C; 0183; # LATIN CAPITAL LETTER B WITH TOPBAR 0184; C; 0185; # LATIN CAPITAL LETTER TONE SIX 0186; C; 0254; # LATIN CAPITAL LETTER OPEN O 0187; C; 0188; # LATIN CAPITAL LETTER C WITH HOOK 0189; C; 0256; # LATIN CAPITAL LETTER AFRICAN D 018A; C; 0257; # LATIN CAPITAL LETTER D WITH HOOK 018B; C; 018C; # LATIN CAPITAL LETTER D WITH TOPBAR 018E; C; 01DD; # LATIN CAPITAL LETTER REVERSED E 018F; C; 0259; # LATIN CAPITAL LETTER SCHWA 0190; C; 025B; # LATIN CAPITAL LETTER OPEN E 0191; C; 0192; # LATIN CAPITAL LETTER F WITH HOOK 0193; C; 0260; # LATIN CAPITAL LETTER G WITH HOOK 0194; C; 0263; # LATIN CAPITAL LETTER GAMMA 0196; C; 0269; # LATIN CAPITAL LETTER IOTA 0197; C; 0268; # LATIN CAPITAL LETTER I WITH STROKE 0198; C; 0199; # LATIN CAPITAL LETTER K WITH HOOK 019C; C; 026F; # LATIN CAPITAL LETTER TURNED M 019D; C; 0272; # LATIN CAPITAL LETTER N WITH LEFT HOOK 019F; C; 0275; # LATIN CAPITAL LETTER O WITH MIDDLE TILDE 01A0; C; 01A1; # LATIN CAPITAL LETTER O WITH HORN 01A2; C; 01A3; # LATIN CAPITAL LETTER OI 01A4; C; 01A5; # LATIN CAPITAL LETTER P WITH HOOK 01A6; C; 0280; # LATIN LETTER YR 01A7; C; 01A8; # LATIN CAPITAL LETTER TONE TWO 01A9; C; 0283; # LATIN CAPITAL LETTER ESH 01AC; C; 01AD; # LATIN CAPITAL LETTER T WITH HOOK 01AE; C; 0288; # LATIN CAPITAL LETTER T WITH RETROFLEX HOOK 01AF; C; 01B0; # LATIN CAPITAL LETTER U WITH HORN 01B1; C; 028A; # LATIN CAPITAL LETTER UPSILON 01B2; C; 028B; # LATIN CAPITAL LETTER V WITH HOOK 01B3; C; 01B4; # LATIN CAPITAL LETTER Y WITH HOOK 01B5; C; 01B6; # LATIN CAPITAL LETTER Z WITH STROKE 01B7; C; 0292; # LATIN CAPITAL LETTER EZH 01B8; C; 01B9; # LATIN CAPITAL LETTER EZH REVERSED 01BC; C; 01BD; # LATIN CAPITAL LETTER TONE FIVE 01C4; C; 01C6; # LATIN CAPITAL LETTER DZ WITH CARON 01C5; C; 01C6; # LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON 01C7; C; 01C9; # LATIN CAPITAL LETTER LJ 01C8; C; 01C9; # LATIN CAPITAL LETTER L WITH SMALL LETTER J 01CA; C; 01CC; # LATIN CAPITAL LETTER NJ 01CB; C; 01CC; # LATIN CAPITAL LETTER N WITH SMALL LETTER J 01CD; C; 01CE; # LATIN CAPITAL LETTER A WITH CARON 01CF; C; 01D0; # LATIN CAPITAL LETTER I WITH CARON 01D1; C; 01D2; # LATIN CAPITAL LETTER O WITH CARON 01D3; C; 01D4; # LATIN CAPITAL LETTER U WITH CARON 01D5; C; 01D6; # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON 01D7; C; 01D8; # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE 01D9; C; 01DA; # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON 01DB; C; 01DC; # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE 01DE; C; 01DF; # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON 01E0; C; 01E1; # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON 01E2; C; 01E3; # LATIN CAPITAL LETTER AE WITH MACRON 01E4; C; 01E5; # LATIN CAPITAL LETTER G WITH STROKE 01E6; C; 01E7; # LATIN CAPITAL LETTER G WITH CARON 01E8; C; 01E9; # LATIN CAPITAL LETTER K WITH CARON 01EA; C; 01EB; # LATIN CAPITAL LETTER O WITH OGONEK 01EC; C; 01ED; # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON 01EE; C; 01EF; # LATIN CAPITAL LETTER EZH WITH CARON 01F0; F; 006A 030C; # LATIN SMALL LETTER J WITH CARON 01F1; C; 01F3; # LATIN CAPITAL LETTER DZ 01F2; C; 01F3; # LATIN CAPITAL LETTER D WITH SMALL LETTER Z 01F4; C; 01F5; # LATIN CAPITAL LETTER G WITH ACUTE 01F6; C; 0195; # LATIN CAPITAL LETTER HWAIR 01F7; C; 01BF; # LATIN CAPITAL LETTER WYNN 01F8; C; 01F9; # LATIN CAPITAL LETTER N WITH GRAVE 01FA; C; 01FB; # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE 01FC; C; 01FD; # LATIN CAPITAL LETTER AE WITH ACUTE 01FE; C; 01FF; # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE 0200; C; 0201; # LATIN CAPITAL LETTER A WITH DOUBLE GRAVE 0202; C; 0203; # LATIN CAPITAL LETTER A WITH INVERTED BREVE 0204; C; 0205; # LATIN CAPITAL LETTER E WITH DOUBLE GRAVE 0206; C; 0207; # LATIN CAPITAL LETTER E WITH INVERTED BREVE 0208; C; 0209; # LATIN CAPITAL LETTER I WITH DOUBLE GRAVE 020A; C; 020B; # LATIN CAPITAL LETTER I WITH INVERTED BREVE 020C; C; 020D; # LATIN CAPITAL LETTER O WITH DOUBLE GRAVE 020E; C; 020F; # LATIN CAPITAL LETTER O WITH INVERTED BREVE 0210; C; 0211; # LATIN CAPITAL LETTER R WITH DOUBLE GRAVE 0212; C; 0213; # LATIN CAPITAL LETTER R WITH INVERTED BREVE 0214; C; 0215; # LATIN CAPITAL LETTER U WITH DOUBLE GRAVE 0216; C; 0217; # LATIN CAPITAL LETTER U WITH INVERTED BREVE 0218; C; 0219; # LATIN CAPITAL LETTER S WITH COMMA BELOW 021A; C; 021B; # LATIN CAPITAL LETTER T WITH COMMA BELOW 021C; C; 021D; # LATIN CAPITAL LETTER YOGH 021E; C; 021F; # LATIN CAPITAL LETTER H WITH CARON 0220; C; 019E; # LATIN CAPITAL LETTER N WITH LONG RIGHT LEG 0222; C; 0223; # LATIN CAPITAL LETTER OU 0224; C; 0225; # LATIN CAPITAL LETTER Z WITH HOOK 0226; C; 0227; # LATIN CAPITAL LETTER A WITH DOT ABOVE 0228; C; 0229; # LATIN CAPITAL LETTER E WITH CEDILLA 022A; C; 022B; # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON 022C; C; 022D; # LATIN CAPITAL LETTER O WITH TILDE AND MACRON 022E; C; 022F; # LATIN CAPITAL LETTER O WITH DOT ABOVE 0230; C; 0231; # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON 0232; C; 0233; # LATIN CAPITAL LETTER Y WITH MACRON 023A; C; 2C65; # LATIN CAPITAL LETTER A WITH STROKE 023B; C; 023C; # LATIN CAPITAL LETTER C WITH STROKE 023D; C; 019A; # LATIN CAPITAL LETTER L WITH BAR 023E; C; 2C66; # LATIN CAPITAL LETTER T WITH DIAGONAL STROKE 0241; C; 0242; # LATIN CAPITAL LETTER GLOTTAL STOP 0243; C; 0180; # LATIN CAPITAL LETTER B WITH STROKE 0244; C; 0289; # LATIN CAPITAL LETTER U BAR 0245; C; 028C; # LATIN CAPITAL LETTER TURNED V 0246; C; 0247; # LATIN CAPITAL LETTER E WITH STROKE 0248; C; 0249; # LATIN CAPITAL LETTER J WITH STROKE 024A; C; 024B; # LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL 024C; C; 024D; # LATIN CAPITAL LETTER R WITH STROKE 024E; C; 024F; # LATIN CAPITAL LETTER Y WITH STROKE 0345; C; 03B9; # COMBINING GREEK YPOGEGRAMMENI 0370; C; 0371; # GREEK CAPITAL LETTER HETA 0372; C; 0373; # GREEK CAPITAL LETTER ARCHAIC SAMPI 0376; C; 0377; # GREEK CAPITAL LETTER PAMPHYLIAN DIGAMMA 0386; C; 03AC; # GREEK CAPITAL LETTER ALPHA WITH TONOS 0388; C; 03AD; # GREEK CAPITAL LETTER EPSILON WITH TONOS 0389; C; 03AE; # GREEK CAPITAL LETTER ETA WITH TONOS 038A; C; 03AF; # GREEK CAPITAL LETTER IOTA WITH TONOS 038C; C; 03CC; # GREEK CAPITAL LETTER OMICRON WITH TONOS 038E; C; 03CD; # GREEK CAPITAL LETTER UPSILON WITH TONOS 038F; C; 03CE; # GREEK CAPITAL LETTER OMEGA WITH TONOS 0390; F; 03B9 0308 0301; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS 0391; C; 03B1; # GREEK CAPITAL LETTER ALPHA 0392; C; 03B2; # GREEK CAPITAL LETTER BETA 0393; C; 03B3; # GREEK CAPITAL LETTER GAMMA 0394; C; 03B4; # GREEK CAPITAL LETTER DELTA 0395; C; 03B5; # GREEK CAPITAL LETTER EPSILON 0396; C; 03B6; # GREEK CAPITAL LETTER ZETA 0397; C; 03B7; # GREEK CAPITAL LETTER ETA 0398; C; 03B8; # GREEK CAPITAL LETTER THETA 0399; C; 03B9; # GREEK CAPITAL LETTER IOTA 039A; C; 03BA; # GREEK CAPITAL LETTER KAPPA 039B; C; 03BB; # GREEK CAPITAL LETTER LAMDA 039C; C; 03BC; # GREEK CAPITAL LETTER MU 039D; C; 03BD; # GREEK CAPITAL LETTER NU 039E; C; 03BE; # GREEK CAPITAL LETTER XI 039F; C; 03BF; # GREEK CAPITAL LETTER OMICRON 03A0; C; 03C0; # GREEK CAPITAL LETTER PI 03A1; C; 03C1; # GREEK CAPITAL LETTER RHO 03A3; C; 03C3; # GREEK CAPITAL LETTER SIGMA 03A4; C; 03C4; # GREEK CAPITAL LETTER TAU 03A5; C; 03C5; # GREEK CAPITAL LETTER UPSILON 03A6; C; 03C6; # GREEK CAPITAL LETTER PHI 03A7; C; 03C7; # GREEK CAPITAL LETTER CHI 03A8; C; 03C8; # GREEK CAPITAL LETTER PSI 03A9; C; 03C9; # GREEK CAPITAL LETTER OMEGA 03AA; C; 03CA; # GREEK CAPITAL LETTER IOTA WITH DIALYTIKA 03AB; C; 03CB; # GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA 03B0; F; 03C5 0308 0301; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS 03C2; C; 03C3; # GREEK SMALL LETTER FINAL SIGMA 03CF; C; 03D7; # GREEK CAPITAL KAI SYMBOL 03D0; C; 03B2; # GREEK BETA SYMBOL 03D1; C; 03B8; # GREEK THETA SYMBOL 03D5; C; 03C6; # GREEK PHI SYMBOL 03D6; C; 03C0; # GREEK PI SYMBOL 03D8; C; 03D9; # GREEK LETTER ARCHAIC KOPPA 03DA; C; 03DB; # GREEK LETTER STIGMA 03DC; C; 03DD; # GREEK LETTER DIGAMMA 03DE; C; 03DF; # GREEK LETTER KOPPA 03E0; C; 03E1; # GREEK LETTER SAMPI 03E2; C; 03E3; # COPTIC CAPITAL LETTER SHEI 03E4; C; 03E5; # COPTIC CAPITAL LETTER FEI 03E6; C; 03E7; # COPTIC CAPITAL LETTER KHEI 03E8; C; 03E9; # COPTIC CAPITAL LETTER HORI 03EA; C; 03EB; # COPTIC CAPITAL LETTER GANGIA 03EC; C; 03ED; # COPTIC CAPITAL LETTER SHIMA 03EE; C; 03EF; # COPTIC CAPITAL LETTER DEI 03F0; C; 03BA; # GREEK KAPPA SYMBOL 03F1; C; 03C1; # GREEK RHO SYMBOL 03F4; C; 03B8; # GREEK CAPITAL THETA SYMBOL 03F5; C; 03B5; # GREEK LUNATE EPSILON SYMBOL 03F7; C; 03F8; # GREEK CAPITAL LETTER SHO 03F9; C; 03F2; # GREEK CAPITAL LUNATE SIGMA SYMBOL 03FA; C; 03FB; # GREEK CAPITAL LETTER SAN 03FD; C; 037B; # GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL 03FE; C; 037C; # GREEK CAPITAL DOTTED LUNATE SIGMA SYMBOL 03FF; C; 037D; # GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL 0400; C; 0450; # CYRILLIC CAPITAL LETTER IE WITH GRAVE 0401; C; 0451; # CYRILLIC CAPITAL LETTER IO 0402; C; 0452; # CYRILLIC CAPITAL LETTER DJE 0403; C; 0453; # CYRILLIC CAPITAL LETTER GJE 0404; C; 0454; # CYRILLIC CAPITAL LETTER UKRAINIAN IE 0405; C; 0455; # CYRILLIC CAPITAL LETTER DZE 0406; C; 0456; # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I 0407; C; 0457; # CYRILLIC CAPITAL LETTER YI 0408; C; 0458; # CYRILLIC CAPITAL LETTER JE 0409; C; 0459; # CYRILLIC CAPITAL LETTER LJE 040A; C; 045A; # CYRILLIC CAPITAL LETTER NJE 040B; C; 045B; # CYRILLIC CAPITAL LETTER TSHE 040C; C; 045C; # CYRILLIC CAPITAL LETTER KJE 040D; C; 045D; # CYRILLIC CAPITAL LETTER I WITH GRAVE 040E; C; 045E; # CYRILLIC CAPITAL LETTER SHORT U 040F; C; 045F; # CYRILLIC CAPITAL LETTER DZHE 0410; C; 0430; # CYRILLIC CAPITAL LETTER A 0411; C; 0431; # CYRILLIC CAPITAL LETTER BE 0412; C; 0432; # CYRILLIC CAPITAL LETTER VE 0413; C; 0433; # CYRILLIC CAPITAL LETTER GHE 0414; C; 0434; # CYRILLIC CAPITAL LETTER DE 0415; C; 0435; # CYRILLIC CAPITAL LETTER IE 0416; C; 0436; # CYRILLIC CAPITAL LETTER ZHE 0417; C; 0437; # CYRILLIC CAPITAL LETTER ZE 0418; C; 0438; # CYRILLIC CAPITAL LETTER I 0419; C; 0439; # CYRILLIC CAPITAL LETTER SHORT I 041A; C; 043A; # CYRILLIC CAPITAL LETTER KA 041B; C; 043B; # CYRILLIC CAPITAL LETTER EL 041C; C; 043C; # CYRILLIC CAPITAL LETTER EM 041D; C; 043D; # CYRILLIC CAPITAL LETTER EN 041E; C; 043E; # CYRILLIC CAPITAL LETTER O 041F; C; 043F; # CYRILLIC CAPITAL LETTER PE 0420; C; 0440; # CYRILLIC CAPITAL LETTER ER 0421; C; 0441; # CYRILLIC CAPITAL LETTER ES 0422; C; 0442; # CYRILLIC CAPITAL LETTER TE 0423; C; 0443; # CYRILLIC CAPITAL LETTER U 0424; C; 0444; # CYRILLIC CAPITAL LETTER EF 0425; C; 0445; # CYRILLIC CAPITAL LETTER HA 0426; C; 0446; # CYRILLIC CAPITAL LETTER TSE 0427; C; 0447; # CYRILLIC CAPITAL LETTER CHE 0428; C; 0448; # CYRILLIC CAPITAL LETTER SHA 0429; C; 0449; # CYRILLIC CAPITAL LETTER SHCHA 042A; C; 044A; # CYRILLIC CAPITAL LETTER HARD SIGN 042B; C; 044B; # CYRILLIC CAPITAL LETTER YERU 042C; C; 044C; # CYRILLIC CAPITAL LETTER SOFT SIGN 042D; C; 044D; # CYRILLIC CAPITAL LETTER E 042E; C; 044E; # CYRILLIC CAPITAL LETTER YU 042F; C; 044F; # CYRILLIC CAPITAL LETTER YA 0460; C; 0461; # CYRILLIC CAPITAL LETTER OMEGA 0462; C; 0463; # CYRILLIC CAPITAL LETTER YAT 0464; C; 0465; # CYRILLIC CAPITAL LETTER IOTIFIED E 0466; C; 0467; # CYRILLIC CAPITAL LETTER LITTLE YUS 0468; C; 0469; # CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS 046A; C; 046B; # CYRILLIC CAPITAL LETTER BIG YUS 046C; C; 046D; # CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS 046E; C; 046F; # CYRILLIC CAPITAL LETTER KSI 0470; C; 0471; # CYRILLIC CAPITAL LETTER PSI 0472; C; 0473; # CYRILLIC CAPITAL LETTER FITA 0474; C; 0475; # CYRILLIC CAPITAL LETTER IZHITSA 0476; C; 0477; # CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT 0478; C; 0479; # CYRILLIC CAPITAL LETTER UK 047A; C; 047B; # CYRILLIC CAPITAL LETTER ROUND OMEGA 047C; C; 047D; # CYRILLIC CAPITAL LETTER OMEGA WITH TITLO 047E; C; 047F; # CYRILLIC CAPITAL LETTER OT 0480; C; 0481; # CYRILLIC CAPITAL LETTER KOPPA 048A; C; 048B; # CYRILLIC CAPITAL LETTER SHORT I WITH TAIL 048C; C; 048D; # CYRILLIC CAPITAL LETTER SEMISOFT SIGN 048E; C; 048F; # CYRILLIC CAPITAL LETTER ER WITH TICK 0490; C; 0491; # CYRILLIC CAPITAL LETTER GHE WITH UPTURN 0492; C; 0493; # CYRILLIC CAPITAL LETTER GHE WITH STROKE 0494; C; 0495; # CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK 0496; C; 0497; # CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER 0498; C; 0499; # CYRILLIC CAPITAL LETTER ZE WITH DESCENDER 049A; C; 049B; # CYRILLIC CAPITAL LETTER KA WITH DESCENDER 049C; C; 049D; # CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE 049E; C; 049F; # CYRILLIC CAPITAL LETTER KA WITH STROKE 04A0; C; 04A1; # CYRILLIC CAPITAL LETTER BASHKIR KA 04A2; C; 04A3; # CYRILLIC CAPITAL LETTER EN WITH DESCENDER 04A4; C; 04A5; # CYRILLIC CAPITAL LIGATURE EN GHE 04A6; C; 04A7; # CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK 04A8; C; 04A9; # CYRILLIC CAPITAL LETTER ABKHASIAN HA 04AA; C; 04AB; # CYRILLIC CAPITAL LETTER ES WITH DESCENDER 04AC; C; 04AD; # CYRILLIC CAPITAL LETTER TE WITH DESCENDER 04AE; C; 04AF; # CYRILLIC CAPITAL LETTER STRAIGHT U 04B0; C; 04B1; # CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE 04B2; C; 04B3; # CYRILLIC CAPITAL LETTER HA WITH DESCENDER 04B4; C; 04B5; # CYRILLIC CAPITAL LIGATURE TE TSE 04B6; C; 04B7; # CYRILLIC CAPITAL LETTER CHE WITH DESCENDER 04B8; C; 04B9; # CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE 04BA; C; 04BB; # CYRILLIC CAPITAL LETTER SHHA 04BC; C; 04BD; # CYRILLIC CAPITAL LETTER ABKHASIAN CHE 04BE; C; 04BF; # CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER 04C0; C; 04CF; # CYRILLIC LETTER PALOCHKA 04C1; C; 04C2; # CYRILLIC CAPITAL LETTER ZHE WITH BREVE 04C3; C; 04C4; # CYRILLIC CAPITAL LETTER KA WITH HOOK 04C5; C; 04C6; # CYRILLIC CAPITAL LETTER EL WITH TAIL 04C7; C; 04C8; # CYRILLIC CAPITAL LETTER EN WITH HOOK 04C9; C; 04CA; # CYRILLIC CAPITAL LETTER EN WITH TAIL 04CB; C; 04CC; # CYRILLIC CAPITAL LETTER KHAKASSIAN CHE 04CD; C; 04CE; # CYRILLIC CAPITAL LETTER EM WITH TAIL 04D0; C; 04D1; # CYRILLIC CAPITAL LETTER A WITH BREVE 04D2; C; 04D3; # CYRILLIC CAPITAL LETTER A WITH DIAERESIS 04D4; C; 04D5; # CYRILLIC CAPITAL LIGATURE A IE 04D6; C; 04D7; # CYRILLIC CAPITAL LETTER IE WITH BREVE 04D8; C; 04D9; # CYRILLIC CAPITAL LETTER SCHWA 04DA; C; 04DB; # CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS 04DC; C; 04DD; # CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS 04DE; C; 04DF; # CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS 04E0; C; 04E1; # CYRILLIC CAPITAL LETTER ABKHASIAN DZE 04E2; C; 04E3; # CYRILLIC CAPITAL LETTER I WITH MACRON 04E4; C; 04E5; # CYRILLIC CAPITAL LETTER I WITH DIAERESIS 04E6; C; 04E7; # CYRILLIC CAPITAL LETTER O WITH DIAERESIS 04E8; C; 04E9; # CYRILLIC CAPITAL LETTER BARRED O 04EA; C; 04EB; # CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS 04EC; C; 04ED; # CYRILLIC CAPITAL LETTER E WITH DIAERESIS 04EE; C; 04EF; # CYRILLIC CAPITAL LETTER U WITH MACRON 04F0; C; 04F1; # CYRILLIC CAPITAL LETTER U WITH DIAERESIS 04F2; C; 04F3; # CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE 04F4; C; 04F5; # CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS 04F6; C; 04F7; # CYRILLIC CAPITAL LETTER GHE WITH DESCENDER 04F8; C; 04F9; # CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS 04FA; C; 04FB; # CYRILLIC CAPITAL LETTER GHE WITH STROKE AND HOOK 04FC; C; 04FD; # CYRILLIC CAPITAL LETTER HA WITH HOOK 04FE; C; 04FF; # CYRILLIC CAPITAL LETTER HA WITH STROKE 0500; C; 0501; # CYRILLIC CAPITAL LETTER KOMI DE 0502; C; 0503; # CYRILLIC CAPITAL LETTER KOMI DJE 0504; C; 0505; # CYRILLIC CAPITAL LETTER KOMI ZJE 0506; C; 0507; # CYRILLIC CAPITAL LETTER KOMI DZJE 0508; C; 0509; # CYRILLIC CAPITAL LETTER KOMI LJE 050A; C; 050B; # CYRILLIC CAPITAL LETTER KOMI NJE 050C; C; 050D; # CYRILLIC CAPITAL LETTER KOMI SJE 050E; C; 050F; # CYRILLIC CAPITAL LETTER KOMI TJE 0510; C; 0511; # CYRILLIC CAPITAL LETTER REVERSED ZE 0512; C; 0513; # CYRILLIC CAPITAL LETTER EL WITH HOOK 0514; C; 0515; # CYRILLIC CAPITAL LETTER LHA 0516; C; 0517; # CYRILLIC CAPITAL LETTER RHA 0518; C; 0519; # CYRILLIC CAPITAL LETTER YAE 051A; C; 051B; # CYRILLIC CAPITAL LETTER QA 051C; C; 051D; # CYRILLIC CAPITAL LETTER WE 051E; C; 051F; # CYRILLIC CAPITAL LETTER ALEUT KA 0520; C; 0521; # CYRILLIC CAPITAL LETTER EL WITH MIDDLE HOOK 0522; C; 0523; # CYRILLIC CAPITAL LETTER EN WITH MIDDLE HOOK 0524; C; 0525; # CYRILLIC CAPITAL LETTER PE WITH DESCENDER 0526; C; 0527; # CYRILLIC CAPITAL LETTER SHHA WITH DESCENDER 0531; C; 0561; # ARMENIAN CAPITAL LETTER AYB 0532; C; 0562; # ARMENIAN CAPITAL LETTER BEN 0533; C; 0563; # ARMENIAN CAPITAL LETTER GIM 0534; C; 0564; # ARMENIAN CAPITAL LETTER DA 0535; C; 0565; # ARMENIAN CAPITAL LETTER ECH 0536; C; 0566; # ARMENIAN CAPITAL LETTER ZA 0537; C; 0567; # ARMENIAN CAPITAL LETTER EH 0538; C; 0568; # ARMENIAN CAPITAL LETTER ET 0539; C; 0569; # ARMENIAN CAPITAL LETTER TO 053A; C; 056A; # ARMENIAN CAPITAL LETTER ZHE 053B; C; 056B; # ARMENIAN CAPITAL LETTER INI 053C; C; 056C; # ARMENIAN CAPITAL LETTER LIWN 053D; C; 056D; # ARMENIAN CAPITAL LETTER XEH 053E; C; 056E; # ARMENIAN CAPITAL LETTER CA 053F; C; 056F; # ARMENIAN CAPITAL LETTER KEN 0540; C; 0570; # ARMENIAN CAPITAL LETTER HO 0541; C; 0571; # ARMENIAN CAPITAL LETTER JA 0542; C; 0572; # ARMENIAN CAPITAL LETTER GHAD 0543; C; 0573; # ARMENIAN CAPITAL LETTER CHEH 0544; C; 0574; # ARMENIAN CAPITAL LETTER MEN 0545; C; 0575; # ARMENIAN CAPITAL LETTER YI 0546; C; 0576; # ARMENIAN CAPITAL LETTER NOW 0547; C; 0577; # ARMENIAN CAPITAL LETTER SHA 0548; C; 0578; # ARMENIAN CAPITAL LETTER VO 0549; C; 0579; # ARMENIAN CAPITAL LETTER CHA 054A; C; 057A; # ARMENIAN CAPITAL LETTER PEH 054B; C; 057B; # ARMENIAN CAPITAL LETTER JHEH 054C; C; 057C; # ARMENIAN CAPITAL LETTER RA 054D; C; 057D; # ARMENIAN CAPITAL LETTER SEH 054E; C; 057E; # ARMENIAN CAPITAL LETTER VEW 054F; C; 057F; # ARMENIAN CAPITAL LETTER TIWN 0550; C; 0580; # ARMENIAN CAPITAL LETTER REH 0551; C; 0581; # ARMENIAN CAPITAL LETTER CO 0552; C; 0582; # ARMENIAN CAPITAL LETTER YIWN 0553; C; 0583; # ARMENIAN CAPITAL LETTER PIWR 0554; C; 0584; # ARMENIAN CAPITAL LETTER KEH 0555; C; 0585; # ARMENIAN CAPITAL LETTER OH 0556; C; 0586; # ARMENIAN CAPITAL LETTER FEH 0587; F; 0565 0582; # ARMENIAN SMALL LIGATURE ECH YIWN 10A0; C; 2D00; # GEORGIAN CAPITAL LETTER AN 10A1; C; 2D01; # GEORGIAN CAPITAL LETTER BAN 10A2; C; 2D02; # GEORGIAN CAPITAL LETTER GAN 10A3; C; 2D03; # GEORGIAN CAPITAL LETTER DON 10A4; C; 2D04; # GEORGIAN CAPITAL LETTER EN 10A5; C; 2D05; # GEORGIAN CAPITAL LETTER VIN 10A6; C; 2D06; # GEORGIAN CAPITAL LETTER ZEN 10A7; C; 2D07; # GEORGIAN CAPITAL LETTER TAN 10A8; C; 2D08; # GEORGIAN CAPITAL LETTER IN 10A9; C; 2D09; # GEORGIAN CAPITAL LETTER KAN 10AA; C; 2D0A; # GEORGIAN CAPITAL LETTER LAS 10AB; C; 2D0B; # GEORGIAN CAPITAL LETTER MAN 10AC; C; 2D0C; # GEORGIAN CAPITAL LETTER NAR 10AD; C; 2D0D; # GEORGIAN CAPITAL LETTER ON 10AE; C; 2D0E; # GEORGIAN CAPITAL LETTER PAR 10AF; C; 2D0F; # GEORGIAN CAPITAL LETTER ZHAR 10B0; C; 2D10; # GEORGIAN CAPITAL LETTER RAE 10B1; C; 2D11; # GEORGIAN CAPITAL LETTER SAN 10B2; C; 2D12; # GEORGIAN CAPITAL LETTER TAR 10B3; C; 2D13; # GEORGIAN CAPITAL LETTER UN 10B4; C; 2D14; # GEORGIAN CAPITAL LETTER PHAR 10B5; C; 2D15; # GEORGIAN CAPITAL LETTER KHAR 10B6; C; 2D16; # GEORGIAN CAPITAL LETTER GHAN 10B7; C; 2D17; # GEORGIAN CAPITAL LETTER QAR 10B8; C; 2D18; # GEORGIAN CAPITAL LETTER SHIN 10B9; C; 2D19; # GEORGIAN CAPITAL LETTER CHIN 10BA; C; 2D1A; # GEORGIAN CAPITAL LETTER CAN 10BB; C; 2D1B; # GEORGIAN CAPITAL LETTER JIL 10BC; C; 2D1C; # GEORGIAN CAPITAL LETTER CIL 10BD; C; 2D1D; # GEORGIAN CAPITAL LETTER CHAR 10BE; C; 2D1E; # GEORGIAN CAPITAL LETTER XAN 10BF; C; 2D1F; # GEORGIAN CAPITAL LETTER JHAN 10C0; C; 2D20; # GEORGIAN CAPITAL LETTER HAE 10C1; C; 2D21; # GEORGIAN CAPITAL LETTER HE 10C2; C; 2D22; # GEORGIAN CAPITAL LETTER HIE 10C3; C; 2D23; # GEORGIAN CAPITAL LETTER WE 10C4; C; 2D24; # GEORGIAN CAPITAL LETTER HAR 10C5; C; 2D25; # GEORGIAN CAPITAL LETTER HOE 10C7; C; 2D27; # GEORGIAN CAPITAL LETTER YN 10CD; C; 2D2D; # GEORGIAN CAPITAL LETTER AEN 1E00; C; 1E01; # LATIN CAPITAL LETTER A WITH RING BELOW 1E02; C; 1E03; # LATIN CAPITAL LETTER B WITH DOT ABOVE 1E04; C; 1E05; # LATIN CAPITAL LETTER B WITH DOT BELOW 1E06; C; 1E07; # LATIN CAPITAL LETTER B WITH LINE BELOW 1E08; C; 1E09; # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE 1E0A; C; 1E0B; # LATIN CAPITAL LETTER D WITH DOT ABOVE 1E0C; C; 1E0D; # LATIN CAPITAL LETTER D WITH DOT BELOW 1E0E; C; 1E0F; # LATIN CAPITAL LETTER D WITH LINE BELOW 1E10; C; 1E11; # LATIN CAPITAL LETTER D WITH CEDILLA 1E12; C; 1E13; # LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW 1E14; C; 1E15; # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE 1E16; C; 1E17; # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE 1E18; C; 1E19; # LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW 1E1A; C; 1E1B; # LATIN CAPITAL LETTER E WITH TILDE BELOW 1E1C; C; 1E1D; # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE 1E1E; C; 1E1F; # LATIN CAPITAL LETTER F WITH DOT ABOVE 1E20; C; 1E21; # LATIN CAPITAL LETTER G WITH MACRON 1E22; C; 1E23; # LATIN CAPITAL LETTER H WITH DOT ABOVE 1E24; C; 1E25; # LATIN CAPITAL LETTER H WITH DOT BELOW 1E26; C; 1E27; # LATIN CAPITAL LETTER H WITH DIAERESIS 1E28; C; 1E29; # LATIN CAPITAL LETTER H WITH CEDILLA 1E2A; C; 1E2B; # LATIN CAPITAL LETTER H WITH BREVE BELOW 1E2C; C; 1E2D; # LATIN CAPITAL LETTER I WITH TILDE BELOW 1E2E; C; 1E2F; # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE 1E30; C; 1E31; # LATIN CAPITAL LETTER K WITH ACUTE 1E32; C; 1E33; # LATIN CAPITAL LETTER K WITH DOT BELOW 1E34; C; 1E35; # LATIN CAPITAL LETTER K WITH LINE BELOW 1E36; C; 1E37; # LATIN CAPITAL LETTER L WITH DOT BELOW 1E38; C; 1E39; # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON 1E3A; C; 1E3B; # LATIN CAPITAL LETTER L WITH LINE BELOW 1E3C; C; 1E3D; # LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW 1E3E; C; 1E3F; # LATIN CAPITAL LETTER M WITH ACUTE 1E40; C; 1E41; # LATIN CAPITAL LETTER M WITH DOT ABOVE 1E42; C; 1E43; # LATIN CAPITAL LETTER M WITH DOT BELOW 1E44; C; 1E45; # LATIN CAPITAL LETTER N WITH DOT ABOVE 1E46; C; 1E47; # LATIN CAPITAL LETTER N WITH DOT BELOW 1E48; C; 1E49; # LATIN CAPITAL LETTER N WITH LINE BELOW 1E4A; C; 1E4B; # LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW 1E4C; C; 1E4D; # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE 1E4E; C; 1E4F; # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS 1E50; C; 1E51; # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE 1E52; C; 1E53; # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE 1E54; C; 1E55; # LATIN CAPITAL LETTER P WITH ACUTE 1E56; C; 1E57; # LATIN CAPITAL LETTER P WITH DOT ABOVE 1E58; C; 1E59; # LATIN CAPITAL LETTER R WITH DOT ABOVE 1E5A; C; 1E5B; # LATIN CAPITAL LETTER R WITH DOT BELOW 1E5C; C; 1E5D; # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON 1E5E; C; 1E5F; # LATIN CAPITAL LETTER R WITH LINE BELOW 1E60; C; 1E61; # LATIN CAPITAL LETTER S WITH DOT ABOVE 1E62; C; 1E63; # LATIN CAPITAL LETTER S WITH DOT BELOW 1E64; C; 1E65; # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE 1E66; C; 1E67; # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE 1E68; C; 1E69; # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE 1E6A; C; 1E6B; # LATIN CAPITAL LETTER T WITH DOT ABOVE 1E6C; C; 1E6D; # LATIN CAPITAL LETTER T WITH DOT BELOW 1E6E; C; 1E6F; # LATIN CAPITAL LETTER T WITH LINE BELOW 1E70; C; 1E71; # LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW 1E72; C; 1E73; # LATIN CAPITAL LETTER U WITH DIAERESIS BELOW 1E74; C; 1E75; # LATIN CAPITAL LETTER U WITH TILDE BELOW 1E76; C; 1E77; # LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW 1E78; C; 1E79; # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE 1E7A; C; 1E7B; # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS 1E7C; C; 1E7D; # LATIN CAPITAL LETTER V WITH TILDE 1E7E; C; 1E7F; # LATIN CAPITAL LETTER V WITH DOT BELOW 1E80; C; 1E81; # LATIN CAPITAL LETTER W WITH GRAVE 1E82; C; 1E83; # LATIN CAPITAL LETTER W WITH ACUTE 1E84; C; 1E85; # LATIN CAPITAL LETTER W WITH DIAERESIS 1E86; C; 1E87; # LATIN CAPITAL LETTER W WITH DOT ABOVE 1E88; C; 1E89; # LATIN CAPITAL LETTER W WITH DOT BELOW 1E8A; C; 1E8B; # LATIN CAPITAL LETTER X WITH DOT ABOVE 1E8C; C; 1E8D; # LATIN CAPITAL LETTER X WITH DIAERESIS 1E8E; C; 1E8F; # LATIN CAPITAL LETTER Y WITH DOT ABOVE 1E90; C; 1E91; # LATIN CAPITAL LETTER Z WITH CIRCUMFLEX 1E92; C; 1E93; # LATIN CAPITAL LETTER Z WITH DOT BELOW 1E94; C; 1E95; # LATIN CAPITAL LETTER Z WITH LINE BELOW 1E96; F; 0068 0331; # LATIN SMALL LETTER H WITH LINE BELOW 1E97; F; 0074 0308; # LATIN SMALL LETTER T WITH DIAERESIS 1E98; F; 0077 030A; # LATIN SMALL LETTER W WITH RING ABOVE 1E99; F; 0079 030A; # LATIN SMALL LETTER Y WITH RING ABOVE 1E9A; F; 0061 02BE; # LATIN SMALL LETTER A WITH RIGHT HALF RING 1E9B; C; 1E61; # LATIN SMALL LETTER LONG S WITH DOT ABOVE 1E9E; F; 0073 0073; # LATIN CAPITAL LETTER SHARP S 1E9E; S; 00DF; # LATIN CAPITAL LETTER SHARP S 1EA0; C; 1EA1; # LATIN CAPITAL LETTER A WITH DOT BELOW 1EA2; C; 1EA3; # LATIN CAPITAL LETTER A WITH HOOK ABOVE 1EA4; C; 1EA5; # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE 1EA6; C; 1EA7; # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE 1EA8; C; 1EA9; # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE 1EAA; C; 1EAB; # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE 1EAC; C; 1EAD; # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW 1EAE; C; 1EAF; # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE 1EB0; C; 1EB1; # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE 1EB2; C; 1EB3; # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE 1EB4; C; 1EB5; # LATIN CAPITAL LETTER A WITH BREVE AND TILDE 1EB6; C; 1EB7; # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW 1EB8; C; 1EB9; # LATIN CAPITAL LETTER E WITH DOT BELOW 1EBA; C; 1EBB; # LATIN CAPITAL LETTER E WITH HOOK ABOVE 1EBC; C; 1EBD; # LATIN CAPITAL LETTER E WITH TILDE 1EBE; C; 1EBF; # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE 1EC0; C; 1EC1; # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE 1EC2; C; 1EC3; # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE 1EC4; C; 1EC5; # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE 1EC6; C; 1EC7; # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW 1EC8; C; 1EC9; # LATIN CAPITAL LETTER I WITH HOOK ABOVE 1ECA; C; 1ECB; # LATIN CAPITAL LETTER I WITH DOT BELOW 1ECC; C; 1ECD; # LATIN CAPITAL LETTER O WITH DOT BELOW 1ECE; C; 1ECF; # LATIN CAPITAL LETTER O WITH HOOK ABOVE 1ED0; C; 1ED1; # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE 1ED2; C; 1ED3; # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE 1ED4; C; 1ED5; # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE 1ED6; C; 1ED7; # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE 1ED8; C; 1ED9; # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW 1EDA; C; 1EDB; # LATIN CAPITAL LETTER O WITH HORN AND ACUTE 1EDC; C; 1EDD; # LATIN CAPITAL LETTER O WITH HORN AND GRAVE 1EDE; C; 1EDF; # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE 1EE0; C; 1EE1; # LATIN CAPITAL LETTER O WITH HORN AND TILDE 1EE2; C; 1EE3; # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW 1EE4; C; 1EE5; # LATIN CAPITAL LETTER U WITH DOT BELOW 1EE6; C; 1EE7; # LATIN CAPITAL LETTER U WITH HOOK ABOVE 1EE8; C; 1EE9; # LATIN CAPITAL LETTER U WITH HORN AND ACUTE 1EEA; C; 1EEB; # LATIN CAPITAL LETTER U WITH HORN AND GRAVE 1EEC; C; 1EED; # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE 1EEE; C; 1EEF; # LATIN CAPITAL LETTER U WITH HORN AND TILDE 1EF0; C; 1EF1; # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW 1EF2; C; 1EF3; # LATIN CAPITAL LETTER Y WITH GRAVE 1EF4; C; 1EF5; # LATIN CAPITAL LETTER Y WITH DOT BELOW 1EF6; C; 1EF7; # LATIN CAPITAL LETTER Y WITH HOOK ABOVE 1EF8; C; 1EF9; # LATIN CAPITAL LETTER Y WITH TILDE 1EFA; C; 1EFB; # LATIN CAPITAL LETTER MIDDLE-WELSH LL 1EFC; C; 1EFD; # LATIN CAPITAL LETTER MIDDLE-WELSH V 1EFE; C; 1EFF; # LATIN CAPITAL LETTER Y WITH LOOP 1F08; C; 1F00; # GREEK CAPITAL LETTER ALPHA WITH PSILI 1F09; C; 1F01; # GREEK CAPITAL LETTER ALPHA WITH DASIA 1F0A; C; 1F02; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA 1F0B; C; 1F03; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA 1F0C; C; 1F04; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA 1F0D; C; 1F05; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA 1F0E; C; 1F06; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI 1F0F; C; 1F07; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI 1F18; C; 1F10; # GREEK CAPITAL LETTER EPSILON WITH PSILI 1F19; C; 1F11; # GREEK CAPITAL LETTER EPSILON WITH DASIA 1F1A; C; 1F12; # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA 1F1B; C; 1F13; # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA 1F1C; C; 1F14; # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA 1F1D; C; 1F15; # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA 1F28; C; 1F20; # GREEK CAPITAL LETTER ETA WITH PSILI 1F29; C; 1F21; # GREEK CAPITAL LETTER ETA WITH DASIA 1F2A; C; 1F22; # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA 1F2B; C; 1F23; # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA 1F2C; C; 1F24; # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA 1F2D; C; 1F25; # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA 1F2E; C; 1F26; # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI 1F2F; C; 1F27; # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI 1F38; C; 1F30; # GREEK CAPITAL LETTER IOTA WITH PSILI 1F39; C; 1F31; # GREEK CAPITAL LETTER IOTA WITH DASIA 1F3A; C; 1F32; # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA 1F3B; C; 1F33; # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA 1F3C; C; 1F34; # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA 1F3D; C; 1F35; # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA 1F3E; C; 1F36; # GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI 1F3F; C; 1F37; # GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI 1F48; C; 1F40; # GREEK CAPITAL LETTER OMICRON WITH PSILI 1F49; C; 1F41; # GREEK CAPITAL LETTER OMICRON WITH DASIA 1F4A; C; 1F42; # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA 1F4B; C; 1F43; # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA 1F4C; C; 1F44; # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA 1F4D; C; 1F45; # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA 1F50; F; 03C5 0313; # GREEK SMALL LETTER UPSILON WITH PSILI 1F52; F; 03C5 0313 0300; # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA 1F54; F; 03C5 0313 0301; # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA 1F56; F; 03C5 0313 0342; # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI 1F59; C; 1F51; # GREEK CAPITAL LETTER UPSILON WITH DASIA 1F5B; C; 1F53; # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA 1F5D; C; 1F55; # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA 1F5F; C; 1F57; # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI 1F68; C; 1F60; # GREEK CAPITAL LETTER OMEGA WITH PSILI 1F69; C; 1F61; # GREEK CAPITAL LETTER OMEGA WITH DASIA 1F6A; C; 1F62; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA 1F6B; C; 1F63; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA 1F6C; C; 1F64; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA 1F6D; C; 1F65; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA 1F6E; C; 1F66; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI 1F6F; C; 1F67; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI 1F80; F; 1F00 03B9; # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI 1F81; F; 1F01 03B9; # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI 1F82; F; 1F02 03B9; # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI 1F83; F; 1F03 03B9; # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI 1F84; F; 1F04 03B9; # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI 1F85; F; 1F05 03B9; # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI 1F86; F; 1F06 03B9; # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI 1F87; F; 1F07 03B9; # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI 1F88; F; 1F00 03B9; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI 1F88; S; 1F80; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI 1F89; F; 1F01 03B9; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI 1F89; S; 1F81; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI 1F8A; F; 1F02 03B9; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI 1F8A; S; 1F82; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI 1F8B; F; 1F03 03B9; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI 1F8B; S; 1F83; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI 1F8C; F; 1F04 03B9; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI 1F8C; S; 1F84; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI 1F8D; F; 1F05 03B9; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI 1F8D; S; 1F85; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI 1F8E; F; 1F06 03B9; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI 1F8E; S; 1F86; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI 1F8F; F; 1F07 03B9; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI 1F8F; S; 1F87; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI 1F90; F; 1F20 03B9; # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI 1F91; F; 1F21 03B9; # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI 1F92; F; 1F22 03B9; # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI 1F93; F; 1F23 03B9; # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI 1F94; F; 1F24 03B9; # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI 1F95; F; 1F25 03B9; # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI 1F96; F; 1F26 03B9; # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI 1F97; F; 1F27 03B9; # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI 1F98; F; 1F20 03B9; # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI 1F98; S; 1F90; # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI 1F99; F; 1F21 03B9; # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI 1F99; S; 1F91; # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI 1F9A; F; 1F22 03B9; # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI 1F9A; S; 1F92; # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI 1F9B; F; 1F23 03B9; # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI 1F9B; S; 1F93; # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI 1F9C; F; 1F24 03B9; # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI 1F9C; S; 1F94; # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI 1F9D; F; 1F25 03B9; # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI 1F9D; S; 1F95; # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI 1F9E; F; 1F26 03B9; # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI 1F9E; S; 1F96; # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI 1F9F; F; 1F27 03B9; # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI 1F9F; S; 1F97; # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI 1FA0; F; 1F60 03B9; # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI 1FA1; F; 1F61 03B9; # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI 1FA2; F; 1F62 03B9; # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI 1FA3; F; 1F63 03B9; # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI 1FA4; F; 1F64 03B9; # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI 1FA5; F; 1F65 03B9; # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI 1FA6; F; 1F66 03B9; # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI 1FA7; F; 1F67 03B9; # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI 1FA8; F; 1F60 03B9; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI 1FA8; S; 1FA0; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI 1FA9; F; 1F61 03B9; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI 1FA9; S; 1FA1; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI 1FAA; F; 1F62 03B9; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI 1FAA; S; 1FA2; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI 1FAB; F; 1F63 03B9; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI 1FAB; S; 1FA3; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI 1FAC; F; 1F64 03B9; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI 1FAC; S; 1FA4; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI 1FAD; F; 1F65 03B9; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI 1FAD; S; 1FA5; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI 1FAE; F; 1F66 03B9; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI 1FAE; S; 1FA6; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI 1FAF; F; 1F67 03B9; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI 1FAF; S; 1FA7; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI 1FB2; F; 1F70 03B9; # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI 1FB3; F; 03B1 03B9; # GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI 1FB4; F; 03AC 03B9; # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI 1FB6; F; 03B1 0342; # GREEK SMALL LETTER ALPHA WITH PERISPOMENI 1FB7; F; 03B1 0342 03B9; # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI 1FB8; C; 1FB0; # GREEK CAPITAL LETTER ALPHA WITH VRACHY 1FB9; C; 1FB1; # GREEK CAPITAL LETTER ALPHA WITH MACRON 1FBA; C; 1F70; # GREEK CAPITAL LETTER ALPHA WITH VARIA 1FBB; C; 1F71; # GREEK CAPITAL LETTER ALPHA WITH OXIA 1FBC; F; 03B1 03B9; # GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI 1FBC; S; 1FB3; # GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI 1FBE; C; 03B9; # GREEK PROSGEGRAMMENI 1FC2; F; 1F74 03B9; # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI 1FC3; F; 03B7 03B9; # GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI 1FC4; F; 03AE 03B9; # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI 1FC6; F; 03B7 0342; # GREEK SMALL LETTER ETA WITH PERISPOMENI 1FC7; F; 03B7 0342 03B9; # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI 1FC8; C; 1F72; # GREEK CAPITAL LETTER EPSILON WITH VARIA 1FC9; C; 1F73; # GREEK CAPITAL LETTER EPSILON WITH OXIA 1FCA; C; 1F74; # GREEK CAPITAL LETTER ETA WITH VARIA 1FCB; C; 1F75; # GREEK CAPITAL LETTER ETA WITH OXIA 1FCC; F; 03B7 03B9; # GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI 1FCC; S; 1FC3; # GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI 1FD2; F; 03B9 0308 0300; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA 1FD3; F; 03B9 0308 0301; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA 1FD6; F; 03B9 0342; # GREEK SMALL LETTER IOTA WITH PERISPOMENI 1FD7; F; 03B9 0308 0342; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI 1FD8; C; 1FD0; # GREEK CAPITAL LETTER IOTA WITH VRACHY 1FD9; C; 1FD1; # GREEK CAPITAL LETTER IOTA WITH MACRON 1FDA; C; 1F76; # GREEK CAPITAL LETTER IOTA WITH VARIA 1FDB; C; 1F77; # GREEK CAPITAL LETTER IOTA WITH OXIA 1FE2; F; 03C5 0308 0300; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA 1FE3; F; 03C5 0308 0301; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA 1FE4; F; 03C1 0313; # GREEK SMALL LETTER RHO WITH PSILI 1FE6; F; 03C5 0342; # GREEK SMALL LETTER UPSILON WITH PERISPOMENI 1FE7; F; 03C5 0308 0342; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI 1FE8; C; 1FE0; # GREEK CAPITAL LETTER UPSILON WITH VRACHY 1FE9; C; 1FE1; # GREEK CAPITAL LETTER UPSILON WITH MACRON 1FEA; C; 1F7A; # GREEK CAPITAL LETTER UPSILON WITH VARIA 1FEB; C; 1F7B; # GREEK CAPITAL LETTER UPSILON WITH OXIA 1FEC; C; 1FE5; # GREEK CAPITAL LETTER RHO WITH DASIA 1FF2; F; 1F7C 03B9; # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI 1FF3; F; 03C9 03B9; # GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI 1FF4; F; 03CE 03B9; # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI 1FF6; F; 03C9 0342; # GREEK SMALL LETTER OMEGA WITH PERISPOMENI 1FF7; F; 03C9 0342 03B9; # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI 1FF8; C; 1F78; # GREEK CAPITAL LETTER OMICRON WITH VARIA 1FF9; C; 1F79; # GREEK CAPITAL LETTER OMICRON WITH OXIA 1FFA; C; 1F7C; # GREEK CAPITAL LETTER OMEGA WITH VARIA 1FFB; C; 1F7D; # GREEK CAPITAL LETTER OMEGA WITH OXIA 1FFC; F; 03C9 03B9; # GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI 1FFC; S; 1FF3; # GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI 2126; C; 03C9; # OHM SIGN 212A; C; 006B; # KELVIN SIGN 212B; C; 00E5; # ANGSTROM SIGN 2132; C; 214E; # TURNED CAPITAL F 2160; C; 2170; # ROMAN NUMERAL ONE 2161; C; 2171; # ROMAN NUMERAL TWO 2162; C; 2172; # ROMAN NUMERAL THREE 2163; C; 2173; # ROMAN NUMERAL FOUR 2164; C; 2174; # ROMAN NUMERAL FIVE 2165; C; 2175; # ROMAN NUMERAL SIX 2166; C; 2176; # ROMAN NUMERAL SEVEN 2167; C; 2177; # ROMAN NUMERAL EIGHT 2168; C; 2178; # ROMAN NUMERAL NINE 2169; C; 2179; # ROMAN NUMERAL TEN 216A; C; 217A; # ROMAN NUMERAL ELEVEN 216B; C; 217B; # ROMAN NUMERAL TWELVE 216C; C; 217C; # ROMAN NUMERAL FIFTY 216D; C; 217D; # ROMAN NUMERAL ONE HUNDRED 216E; C; 217E; # ROMAN NUMERAL FIVE HUNDRED 216F; C; 217F; # ROMAN NUMERAL ONE THOUSAND 2183; C; 2184; # ROMAN NUMERAL REVERSED ONE HUNDRED 24B6; C; 24D0; # CIRCLED LATIN CAPITAL LETTER A 24B7; C; 24D1; # CIRCLED LATIN CAPITAL LETTER B 24B8; C; 24D2; # CIRCLED LATIN CAPITAL LETTER C 24B9; C; 24D3; # CIRCLED LATIN CAPITAL LETTER D 24BA; C; 24D4; # CIRCLED LATIN CAPITAL LETTER E 24BB; C; 24D5; # CIRCLED LATIN CAPITAL LETTER F 24BC; C; 24D6; # CIRCLED LATIN CAPITAL LETTER G 24BD; C; 24D7; # CIRCLED LATIN CAPITAL LETTER H 24BE; C; 24D8; # CIRCLED LATIN CAPITAL LETTER I 24BF; C; 24D9; # CIRCLED LATIN CAPITAL LETTER J 24C0; C; 24DA; # CIRCLED LATIN CAPITAL LETTER K 24C1; C; 24DB; # CIRCLED LATIN CAPITAL LETTER L 24C2; C; 24DC; # CIRCLED LATIN CAPITAL LETTER M 24C3; C; 24DD; # CIRCLED LATIN CAPITAL LETTER N 24C4; C; 24DE; # CIRCLED LATIN CAPITAL LETTER O 24C5; C; 24DF; # CIRCLED LATIN CAPITAL LETTER P 24C6; C; 24E0; # CIRCLED LATIN CAPITAL LETTER Q 24C7; C; 24E1; # CIRCLED LATIN CAPITAL LETTER R 24C8; C; 24E2; # CIRCLED LATIN CAPITAL LETTER S 24C9; C; 24E3; # CIRCLED LATIN CAPITAL LETTER T 24CA; C; 24E4; # CIRCLED LATIN CAPITAL LETTER U 24CB; C; 24E5; # CIRCLED LATIN CAPITAL LETTER V 24CC; C; 24E6; # CIRCLED LATIN CAPITAL LETTER W 24CD; C; 24E7; # CIRCLED LATIN CAPITAL LETTER X 24CE; C; 24E8; # CIRCLED LATIN CAPITAL LETTER Y 24CF; C; 24E9; # CIRCLED LATIN CAPITAL LETTER Z 2C00; C; 2C30; # GLAGOLITIC CAPITAL LETTER AZU 2C01; C; 2C31; # GLAGOLITIC CAPITAL LETTER BUKY 2C02; C; 2C32; # GLAGOLITIC CAPITAL LETTER VEDE 2C03; C; 2C33; # GLAGOLITIC CAPITAL LETTER GLAGOLI 2C04; C; 2C34; # GLAGOLITIC CAPITAL LETTER DOBRO 2C05; C; 2C35; # GLAGOLITIC CAPITAL LETTER YESTU 2C06; C; 2C36; # GLAGOLITIC CAPITAL LETTER ZHIVETE 2C07; C; 2C37; # GLAGOLITIC CAPITAL LETTER DZELO 2C08; C; 2C38; # GLAGOLITIC CAPITAL LETTER ZEMLJA 2C09; C; 2C39; # GLAGOLITIC CAPITAL LETTER IZHE 2C0A; C; 2C3A; # GLAGOLITIC CAPITAL LETTER INITIAL IZHE 2C0B; C; 2C3B; # GLAGOLITIC CAPITAL LETTER I 2C0C; C; 2C3C; # GLAGOLITIC CAPITAL LETTER DJERVI 2C0D; C; 2C3D; # GLAGOLITIC CAPITAL LETTER KAKO 2C0E; C; 2C3E; # GLAGOLITIC CAPITAL LETTER LJUDIJE 2C0F; C; 2C3F; # GLAGOLITIC CAPITAL LETTER MYSLITE 2C10; C; 2C40; # GLAGOLITIC CAPITAL LETTER NASHI 2C11; C; 2C41; # GLAGOLITIC CAPITAL LETTER ONU 2C12; C; 2C42; # GLAGOLITIC CAPITAL LETTER POKOJI 2C13; C; 2C43; # GLAGOLITIC CAPITAL LETTER RITSI 2C14; C; 2C44; # GLAGOLITIC CAPITAL LETTER SLOVO 2C15; C; 2C45; # GLAGOLITIC CAPITAL LETTER TVRIDO 2C16; C; 2C46; # GLAGOLITIC CAPITAL LETTER UKU 2C17; C; 2C47; # GLAGOLITIC CAPITAL LETTER FRITU 2C18; C; 2C48; # GLAGOLITIC CAPITAL LETTER HERU 2C19; C; 2C49; # GLAGOLITIC CAPITAL LETTER OTU 2C1A; C; 2C4A; # GLAGOLITIC CAPITAL LETTER PE 2C1B; C; 2C4B; # GLAGOLITIC CAPITAL LETTER SHTA 2C1C; C; 2C4C; # GLAGOLITIC CAPITAL LETTER TSI 2C1D; C; 2C4D; # GLAGOLITIC CAPITAL LETTER CHRIVI 2C1E; C; 2C4E; # GLAGOLITIC CAPITAL LETTER SHA 2C1F; C; 2C4F; # GLAGOLITIC CAPITAL LETTER YERU 2C20; C; 2C50; # GLAGOLITIC CAPITAL LETTER YERI 2C21; C; 2C51; # GLAGOLITIC CAPITAL LETTER YATI 2C22; C; 2C52; # GLAGOLITIC CAPITAL LETTER SPIDERY HA 2C23; C; 2C53; # GLAGOLITIC CAPITAL LETTER YU 2C24; C; 2C54; # GLAGOLITIC CAPITAL LETTER SMALL YUS 2C25; C; 2C55; # GLAGOLITIC CAPITAL LETTER SMALL YUS WITH TAIL 2C26; C; 2C56; # GLAGOLITIC CAPITAL LETTER YO 2C27; C; 2C57; # GLAGOLITIC CAPITAL LETTER IOTATED SMALL YUS 2C28; C; 2C58; # GLAGOLITIC CAPITAL LETTER BIG YUS 2C29; C; 2C59; # GLAGOLITIC CAPITAL LETTER IOTATED BIG YUS 2C2A; C; 2C5A; # GLAGOLITIC CAPITAL LETTER FITA 2C2B; C; 2C5B; # GLAGOLITIC CAPITAL LETTER IZHITSA 2C2C; C; 2C5C; # GLAGOLITIC CAPITAL LETTER SHTAPIC 2C2D; C; 2C5D; # GLAGOLITIC CAPITAL LETTER TROKUTASTI A 2C2E; C; 2C5E; # GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE 2C60; C; 2C61; # LATIN CAPITAL LETTER L WITH DOUBLE BAR 2C62; C; 026B; # LATIN CAPITAL LETTER L WITH MIDDLE TILDE 2C63; C; 1D7D; # LATIN CAPITAL LETTER P WITH STROKE 2C64; C; 027D; # LATIN CAPITAL LETTER R WITH TAIL 2C67; C; 2C68; # LATIN CAPITAL LETTER H WITH DESCENDER 2C69; C; 2C6A; # LATIN CAPITAL LETTER K WITH DESCENDER 2C6B; C; 2C6C; # LATIN CAPITAL LETTER Z WITH DESCENDER 2C6D; C; 0251; # LATIN CAPITAL LETTER ALPHA 2C6E; C; 0271; # LATIN CAPITAL LETTER M WITH HOOK 2C6F; C; 0250; # LATIN CAPITAL LETTER TURNED A 2C70; C; 0252; # LATIN CAPITAL LETTER TURNED ALPHA 2C72; C; 2C73; # LATIN CAPITAL LETTER W WITH HOOK 2C75; C; 2C76; # LATIN CAPITAL LETTER HALF H 2C7E; C; 023F; # LATIN CAPITAL LETTER S WITH SWASH TAIL 2C7F; C; 0240; # LATIN CAPITAL LETTER Z WITH SWASH TAIL 2C80; C; 2C81; # COPTIC CAPITAL LETTER ALFA 2C82; C; 2C83; # COPTIC CAPITAL LETTER VIDA 2C84; C; 2C85; # COPTIC CAPITAL LETTER GAMMA 2C86; C; 2C87; # COPTIC CAPITAL LETTER DALDA 2C88; C; 2C89; # COPTIC CAPITAL LETTER EIE 2C8A; C; 2C8B; # COPTIC CAPITAL LETTER SOU 2C8C; C; 2C8D; # COPTIC CAPITAL LETTER ZATA 2C8E; C; 2C8F; # COPTIC CAPITAL LETTER HATE 2C90; C; 2C91; # COPTIC CAPITAL LETTER THETHE 2C92; C; 2C93; # COPTIC CAPITAL LETTER IAUDA 2C94; C; 2C95; # COPTIC CAPITAL LETTER KAPA 2C96; C; 2C97; # COPTIC CAPITAL LETTER LAULA 2C98; C; 2C99; # COPTIC CAPITAL LETTER MI 2C9A; C; 2C9B; # COPTIC CAPITAL LETTER NI 2C9C; C; 2C9D; # COPTIC CAPITAL LETTER KSI 2C9E; C; 2C9F; # COPTIC CAPITAL LETTER O 2CA0; C; 2CA1; # COPTIC CAPITAL LETTER PI 2CA2; C; 2CA3; # COPTIC CAPITAL LETTER RO 2CA4; C; 2CA5; # COPTIC CAPITAL LETTER SIMA 2CA6; C; 2CA7; # COPTIC CAPITAL LETTER TAU 2CA8; C; 2CA9; # COPTIC CAPITAL LETTER UA 2CAA; C; 2CAB; # COPTIC CAPITAL LETTER FI 2CAC; C; 2CAD; # COPTIC CAPITAL LETTER KHI 2CAE; C; 2CAF; # COPTIC CAPITAL LETTER PSI 2CB0; C; 2CB1; # COPTIC CAPITAL LETTER OOU 2CB2; C; 2CB3; # COPTIC CAPITAL LETTER DIALECT-P ALEF 2CB4; C; 2CB5; # COPTIC CAPITAL LETTER OLD COPTIC AIN 2CB6; C; 2CB7; # COPTIC CAPITAL LETTER CRYPTOGRAMMIC EIE 2CB8; C; 2CB9; # COPTIC CAPITAL LETTER DIALECT-P KAPA 2CBA; C; 2CBB; # COPTIC CAPITAL LETTER DIALECT-P NI 2CBC; C; 2CBD; # COPTIC CAPITAL LETTER CRYPTOGRAMMIC NI 2CBE; C; 2CBF; # COPTIC CAPITAL LETTER OLD COPTIC OOU 2CC0; C; 2CC1; # COPTIC CAPITAL LETTER SAMPI 2CC2; C; 2CC3; # COPTIC CAPITAL LETTER CROSSED SHEI 2CC4; C; 2CC5; # COPTIC CAPITAL LETTER OLD COPTIC SHEI 2CC6; C; 2CC7; # COPTIC CAPITAL LETTER OLD COPTIC ESH 2CC8; C; 2CC9; # COPTIC CAPITAL LETTER AKHMIMIC KHEI 2CCA; C; 2CCB; # COPTIC CAPITAL LETTER DIALECT-P HORI 2CCC; C; 2CCD; # COPTIC CAPITAL LETTER OLD COPTIC HORI 2CCE; C; 2CCF; # COPTIC CAPITAL LETTER OLD COPTIC HA 2CD0; C; 2CD1; # COPTIC CAPITAL LETTER L-SHAPED HA 2CD2; C; 2CD3; # COPTIC CAPITAL LETTER OLD COPTIC HEI 2CD4; C; 2CD5; # COPTIC CAPITAL LETTER OLD COPTIC HAT 2CD6; C; 2CD7; # COPTIC CAPITAL LETTER OLD COPTIC GANGIA 2CD8; C; 2CD9; # COPTIC CAPITAL LETTER OLD COPTIC DJA 2CDA; C; 2CDB; # COPTIC CAPITAL LETTER OLD COPTIC SHIMA 2CDC; C; 2CDD; # COPTIC CAPITAL LETTER OLD NUBIAN SHIMA 2CDE; C; 2CDF; # COPTIC CAPITAL LETTER OLD NUBIAN NGI 2CE0; C; 2CE1; # COPTIC CAPITAL LETTER OLD NUBIAN NYI 2CE2; C; 2CE3; # COPTIC CAPITAL LETTER OLD NUBIAN WAU 2CEB; C; 2CEC; # COPTIC CAPITAL LETTER CRYPTOGRAMMIC SHEI 2CED; C; 2CEE; # COPTIC CAPITAL LETTER CRYPTOGRAMMIC GANGIA 2CF2; C; 2CF3; # COPTIC CAPITAL LETTER BOHAIRIC KHEI A640; C; A641; # CYRILLIC CAPITAL LETTER ZEMLYA A642; C; A643; # CYRILLIC CAPITAL LETTER DZELO A644; C; A645; # CYRILLIC CAPITAL LETTER REVERSED DZE A646; C; A647; # CYRILLIC CAPITAL LETTER IOTA A648; C; A649; # CYRILLIC CAPITAL LETTER DJERV A64A; C; A64B; # CYRILLIC CAPITAL LETTER MONOGRAPH UK A64C; C; A64D; # CYRILLIC CAPITAL LETTER BROAD OMEGA A64E; C; A64F; # CYRILLIC CAPITAL LETTER NEUTRAL YER A650; C; A651; # CYRILLIC CAPITAL LETTER YERU WITH BACK YER A652; C; A653; # CYRILLIC CAPITAL LETTER IOTIFIED YAT A654; C; A655; # CYRILLIC CAPITAL LETTER REVERSED YU A656; C; A657; # CYRILLIC CAPITAL LETTER IOTIFIED A A658; C; A659; # CYRILLIC CAPITAL LETTER CLOSED LITTLE YUS A65A; C; A65B; # CYRILLIC CAPITAL LETTER BLENDED YUS A65C; C; A65D; # CYRILLIC CAPITAL LETTER IOTIFIED CLOSED LITTLE YUS A65E; C; A65F; # CYRILLIC CAPITAL LETTER YN A660; C; A661; # CYRILLIC CAPITAL LETTER REVERSED TSE A662; C; A663; # CYRILLIC CAPITAL LETTER SOFT DE A664; C; A665; # CYRILLIC CAPITAL LETTER SOFT EL A666; C; A667; # CYRILLIC CAPITAL LETTER SOFT EM A668; C; A669; # CYRILLIC CAPITAL LETTER MONOCULAR O A66A; C; A66B; # CYRILLIC CAPITAL LETTER BINOCULAR O A66C; C; A66D; # CYRILLIC CAPITAL LETTER DOUBLE MONOCULAR O A680; C; A681; # CYRILLIC CAPITAL LETTER DWE A682; C; A683; # CYRILLIC CAPITAL LETTER DZWE A684; C; A685; # CYRILLIC CAPITAL LETTER ZHWE A686; C; A687; # CYRILLIC CAPITAL LETTER CCHE A688; C; A689; # CYRILLIC CAPITAL LETTER DZZE A68A; C; A68B; # CYRILLIC CAPITAL LETTER TE WITH MIDDLE HOOK A68C; C; A68D; # CYRILLIC CAPITAL LETTER TWE A68E; C; A68F; # CYRILLIC CAPITAL LETTER TSWE A690; C; A691; # CYRILLIC CAPITAL LETTER TSSE A692; C; A693; # CYRILLIC CAPITAL LETTER TCHE A694; C; A695; # CYRILLIC CAPITAL LETTER HWE A696; C; A697; # CYRILLIC CAPITAL LETTER SHWE A722; C; A723; # LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF A724; C; A725; # LATIN CAPITAL LETTER EGYPTOLOGICAL AIN A726; C; A727; # LATIN CAPITAL LETTER HENG A728; C; A729; # LATIN CAPITAL LETTER TZ A72A; C; A72B; # LATIN CAPITAL LETTER TRESILLO A72C; C; A72D; # LATIN CAPITAL LETTER CUATRILLO A72E; C; A72F; # LATIN CAPITAL LETTER CUATRILLO WITH COMMA A732; C; A733; # LATIN CAPITAL LETTER AA A734; C; A735; # LATIN CAPITAL LETTER AO A736; C; A737; # LATIN CAPITAL LETTER AU A738; C; A739; # LATIN CAPITAL LETTER AV A73A; C; A73B; # LATIN CAPITAL LETTER AV WITH HORIZONTAL BAR A73C; C; A73D; # LATIN CAPITAL LETTER AY A73E; C; A73F; # LATIN CAPITAL LETTER REVERSED C WITH DOT A740; C; A741; # LATIN CAPITAL LETTER K WITH STROKE A742; C; A743; # LATIN CAPITAL LETTER K WITH DIAGONAL STROKE A744; C; A745; # LATIN CAPITAL LETTER K WITH STROKE AND DIAGONAL STROKE A746; C; A747; # LATIN CAPITAL LETTER BROKEN L A748; C; A749; # LATIN CAPITAL LETTER L WITH HIGH STROKE A74A; C; A74B; # LATIN CAPITAL LETTER O WITH LONG STROKE OVERLAY A74C; C; A74D; # LATIN CAPITAL LETTER O WITH LOOP A74E; C; A74F; # LATIN CAPITAL LETTER OO A750; C; A751; # LATIN CAPITAL LETTER P WITH STROKE THROUGH DESCENDER A752; C; A753; # LATIN CAPITAL LETTER P WITH FLOURISH A754; C; A755; # LATIN CAPITAL LETTER P WITH SQUIRREL TAIL A756; C; A757; # LATIN CAPITAL LETTER Q WITH STROKE THROUGH DESCENDER A758; C; A759; # LATIN CAPITAL LETTER Q WITH DIAGONAL STROKE A75A; C; A75B; # LATIN CAPITAL LETTER R ROTUNDA A75C; C; A75D; # LATIN CAPITAL LETTER RUM ROTUNDA A75E; C; A75F; # LATIN CAPITAL LETTER V WITH DIAGONAL STROKE A760; C; A761; # LATIN CAPITAL LETTER VY A762; C; A763; # LATIN CAPITAL LETTER VISIGOTHIC Z A764; C; A765; # LATIN CAPITAL LETTER THORN WITH STROKE A766; C; A767; # LATIN CAPITAL LETTER THORN WITH STROKE THROUGH DESCENDER A768; C; A769; # LATIN CAPITAL LETTER VEND A76A; C; A76B; # LATIN CAPITAL LETTER ET A76C; C; A76D; # LATIN CAPITAL LETTER IS A76E; C; A76F; # LATIN CAPITAL LETTER CON A779; C; A77A; # LATIN CAPITAL LETTER INSULAR D A77B; C; A77C; # LATIN CAPITAL LETTER INSULAR F A77D; C; 1D79; # LATIN CAPITAL LETTER INSULAR G A77E; C; A77F; # LATIN CAPITAL LETTER TURNED INSULAR G A780; C; A781; # LATIN CAPITAL LETTER TURNED L A782; C; A783; # LATIN CAPITAL LETTER INSULAR R A784; C; A785; # LATIN CAPITAL LETTER INSULAR S A786; C; A787; # LATIN CAPITAL LETTER INSULAR T A78B; C; A78C; # LATIN CAPITAL LETTER SALTILLO A78D; C; 0265; # LATIN CAPITAL LETTER TURNED H A790; C; A791; # LATIN CAPITAL LETTER N WITH DESCENDER A792; C; A793; # LATIN CAPITAL LETTER C WITH BAR A7A0; C; A7A1; # LATIN CAPITAL LETTER G WITH OBLIQUE STROKE A7A2; C; A7A3; # LATIN CAPITAL LETTER K WITH OBLIQUE STROKE A7A4; C; A7A5; # LATIN CAPITAL LETTER N WITH OBLIQUE STROKE A7A6; C; A7A7; # LATIN CAPITAL LETTER R WITH OBLIQUE STROKE A7A8; C; A7A9; # LATIN CAPITAL LETTER S WITH OBLIQUE STROKE A7AA; C; 0266; # LATIN CAPITAL LETTER H WITH HOOK FB00; F; 0066 0066; # LATIN SMALL LIGATURE FF FB01; F; 0066 0069; # LATIN SMALL LIGATURE FI FB02; F; 0066 006C; # LATIN SMALL LIGATURE FL FB03; F; 0066 0066 0069; # LATIN SMALL LIGATURE FFI FB04; F; 0066 0066 006C; # LATIN SMALL LIGATURE FFL FB05; F; 0073 0074; # LATIN SMALL LIGATURE LONG S T FB06; F; 0073 0074; # LATIN SMALL LIGATURE ST FB13; F; 0574 0576; # ARMENIAN SMALL LIGATURE MEN NOW FB14; F; 0574 0565; # ARMENIAN SMALL LIGATURE MEN ECH FB15; F; 0574 056B; # ARMENIAN SMALL LIGATURE MEN INI FB16; F; 057E 0576; # ARMENIAN SMALL LIGATURE VEW NOW FB17; F; 0574 056D; # ARMENIAN SMALL LIGATURE MEN XEH FF21; C; FF41; # FULLWIDTH LATIN CAPITAL LETTER A FF22; C; FF42; # FULLWIDTH LATIN CAPITAL LETTER B FF23; C; FF43; # FULLWIDTH LATIN CAPITAL LETTER C FF24; C; FF44; # FULLWIDTH LATIN CAPITAL LETTER D FF25; C; FF45; # FULLWIDTH LATIN CAPITAL LETTER E FF26; C; FF46; # FULLWIDTH LATIN CAPITAL LETTER F FF27; C; FF47; # FULLWIDTH LATIN CAPITAL LETTER G FF28; C; FF48; # FULLWIDTH LATIN CAPITAL LETTER H FF29; C; FF49; # FULLWIDTH LATIN CAPITAL LETTER I FF2A; C; FF4A; # FULLWIDTH LATIN CAPITAL LETTER J FF2B; C; FF4B; # FULLWIDTH LATIN CAPITAL LETTER K FF2C; C; FF4C; # FULLWIDTH LATIN CAPITAL LETTER L FF2D; C; FF4D; # FULLWIDTH LATIN CAPITAL LETTER M FF2E; C; FF4E; # FULLWIDTH LATIN CAPITAL LETTER N FF2F; C; FF4F; # FULLWIDTH LATIN CAPITAL LETTER O FF30; C; FF50; # FULLWIDTH LATIN CAPITAL LETTER P FF31; C; FF51; # FULLWIDTH LATIN CAPITAL LETTER Q FF32; C; FF52; # FULLWIDTH LATIN CAPITAL LETTER R FF33; C; FF53; # FULLWIDTH LATIN CAPITAL LETTER S FF34; C; FF54; # FULLWIDTH LATIN CAPITAL LETTER T FF35; C; FF55; # FULLWIDTH LATIN CAPITAL LETTER U FF36; C; FF56; # FULLWIDTH LATIN CAPITAL LETTER V FF37; C; FF57; # FULLWIDTH LATIN CAPITAL LETTER W FF38; C; FF58; # FULLWIDTH LATIN CAPITAL LETTER X FF39; C; FF59; # FULLWIDTH LATIN CAPITAL LETTER Y FF3A; C; FF5A; # FULLWIDTH LATIN CAPITAL LETTER Z 10400; C; 10428; # DESERET CAPITAL LETTER LONG I 10401; C; 10429; # DESERET CAPITAL LETTER LONG E 10402; C; 1042A; # DESERET CAPITAL LETTER LONG A 10403; C; 1042B; # DESERET CAPITAL LETTER LONG AH 10404; C; 1042C; # DESERET CAPITAL LETTER LONG O 10405; C; 1042D; # DESERET CAPITAL LETTER LONG OO 10406; C; 1042E; # DESERET CAPITAL LETTER SHORT I 10407; C; 1042F; # DESERET CAPITAL LETTER SHORT E 10408; C; 10430; # DESERET CAPITAL LETTER SHORT A 10409; C; 10431; # DESERET CAPITAL LETTER SHORT AH 1040A; C; 10432; # DESERET CAPITAL LETTER SHORT O 1040B; C; 10433; # DESERET CAPITAL LETTER SHORT OO 1040C; C; 10434; # DESERET CAPITAL LETTER AY 1040D; C; 10435; # DESERET CAPITAL LETTER OW 1040E; C; 10436; # DESERET CAPITAL LETTER WU 1040F; C; 10437; # DESERET CAPITAL LETTER YEE 10410; C; 10438; # DESERET CAPITAL LETTER H 10411; C; 10439; # DESERET CAPITAL LETTER PEE 10412; C; 1043A; # DESERET CAPITAL LETTER BEE 10413; C; 1043B; # DESERET CAPITAL LETTER TEE 10414; C; 1043C; # DESERET CAPITAL LETTER DEE 10415; C; 1043D; # DESERET CAPITAL LETTER CHEE 10416; C; 1043E; # DESERET CAPITAL LETTER JEE 10417; C; 1043F; # DESERET CAPITAL LETTER KAY 10418; C; 10440; # DESERET CAPITAL LETTER GAY 10419; C; 10441; # DESERET CAPITAL LETTER EF 1041A; C; 10442; # DESERET CAPITAL LETTER VEE 1041B; C; 10443; # DESERET CAPITAL LETTER ETH 1041C; C; 10444; # DESERET CAPITAL LETTER THEE 1041D; C; 10445; # DESERET CAPITAL LETTER ES 1041E; C; 10446; # DESERET CAPITAL LETTER ZEE 1041F; C; 10447; # DESERET CAPITAL LETTER ESH 10420; C; 10448; # DESERET CAPITAL LETTER ZHEE 10421; C; 10449; # DESERET CAPITAL LETTER ER 10422; C; 1044A; # DESERET CAPITAL LETTER EL 10423; C; 1044B; # DESERET CAPITAL LETTER EM 10424; C; 1044C; # DESERET CAPITAL LETTER EN 10425; C; 1044D; # DESERET CAPITAL LETTER ENG 10426; C; 1044E; # DESERET CAPITAL LETTER OI 10427; C; 1044F; # DESERET CAPITAL LETTER EW ================================================ FILE: v2/testdata/_sqlite/ext/fts3/unicode/UnicodeData.txt ================================================ 0000;;Cc;0;BN;;;;;N;NULL;;;; 0001;;Cc;0;BN;;;;;N;START OF HEADING;;;; 0002;;Cc;0;BN;;;;;N;START OF TEXT;;;; 0003;;Cc;0;BN;;;;;N;END OF TEXT;;;; 0004;;Cc;0;BN;;;;;N;END OF TRANSMISSION;;;; 0005;;Cc;0;BN;;;;;N;ENQUIRY;;;; 0006;;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; 0007;;Cc;0;BN;;;;;N;BELL;;;; 0008;;Cc;0;BN;;;;;N;BACKSPACE;;;; 0009;;Cc;0;S;;;;;N;CHARACTER TABULATION;;;; 000A;;Cc;0;B;;;;;N;LINE FEED (LF);;;; 000B;;Cc;0;S;;;;;N;LINE TABULATION;;;; 000C;;Cc;0;WS;;;;;N;FORM FEED (FF);;;; 000D;;Cc;0;B;;;;;N;CARRIAGE RETURN (CR);;;; 000E;;Cc;0;BN;;;;;N;SHIFT OUT;;;; 000F;;Cc;0;BN;;;;;N;SHIFT IN;;;; 0010;;Cc;0;BN;;;;;N;DATA LINK ESCAPE;;;; 0011;;Cc;0;BN;;;;;N;DEVICE CONTROL ONE;;;; 0012;;Cc;0;BN;;;;;N;DEVICE CONTROL TWO;;;; 0013;;Cc;0;BN;;;;;N;DEVICE CONTROL THREE;;;; 0014;;Cc;0;BN;;;;;N;DEVICE CONTROL FOUR;;;; 0015;;Cc;0;BN;;;;;N;NEGATIVE ACKNOWLEDGE;;;; 0016;;Cc;0;BN;;;;;N;SYNCHRONOUS IDLE;;;; 0017;;Cc;0;BN;;;;;N;END OF TRANSMISSION BLOCK;;;; 0018;;Cc;0;BN;;;;;N;CANCEL;;;; 0019;;Cc;0;BN;;;;;N;END OF MEDIUM;;;; 001A;;Cc;0;BN;;;;;N;SUBSTITUTE;;;; 001B;;Cc;0;BN;;;;;N;ESCAPE;;;; 001C;;Cc;0;B;;;;;N;INFORMATION SEPARATOR FOUR;;;; 001D;;Cc;0;B;;;;;N;INFORMATION SEPARATOR THREE;;;; 001E;;Cc;0;B;;;;;N;INFORMATION SEPARATOR TWO;;;; 001F;;Cc;0;S;;;;;N;INFORMATION SEPARATOR ONE;;;; 0020;SPACE;Zs;0;WS;;;;;N;;;;; 0021;EXCLAMATION MARK;Po;0;ON;;;;;N;;;;; 0022;QUOTATION MARK;Po;0;ON;;;;;N;;;;; 0023;NUMBER SIGN;Po;0;ET;;;;;N;;;;; 0024;DOLLAR SIGN;Sc;0;ET;;;;;N;;;;; 0025;PERCENT SIGN;Po;0;ET;;;;;N;;;;; 0026;AMPERSAND;Po;0;ON;;;;;N;;;;; 0027;APOSTROPHE;Po;0;ON;;;;;N;APOSTROPHE-QUOTE;;;; 0028;LEFT PARENTHESIS;Ps;0;ON;;;;;Y;OPENING PARENTHESIS;;;; 0029;RIGHT PARENTHESIS;Pe;0;ON;;;;;Y;CLOSING PARENTHESIS;;;; 002A;ASTERISK;Po;0;ON;;;;;N;;;;; 002B;PLUS SIGN;Sm;0;ES;;;;;N;;;;; 002C;COMMA;Po;0;CS;;;;;N;;;;; 002D;HYPHEN-MINUS;Pd;0;ES;;;;;N;;;;; 002E;FULL STOP;Po;0;CS;;;;;N;PERIOD;;;; 002F;SOLIDUS;Po;0;CS;;;;;N;SLASH;;;; 0030;DIGIT ZERO;Nd;0;EN;;0;0;0;N;;;;; 0031;DIGIT ONE;Nd;0;EN;;1;1;1;N;;;;; 0032;DIGIT TWO;Nd;0;EN;;2;2;2;N;;;;; 0033;DIGIT THREE;Nd;0;EN;;3;3;3;N;;;;; 0034;DIGIT FOUR;Nd;0;EN;;4;4;4;N;;;;; 0035;DIGIT FIVE;Nd;0;EN;;5;5;5;N;;;;; 0036;DIGIT SIX;Nd;0;EN;;6;6;6;N;;;;; 0037;DIGIT SEVEN;Nd;0;EN;;7;7;7;N;;;;; 0038;DIGIT EIGHT;Nd;0;EN;;8;8;8;N;;;;; 0039;DIGIT NINE;Nd;0;EN;;9;9;9;N;;;;; 003A;COLON;Po;0;CS;;;;;N;;;;; 003B;SEMICOLON;Po;0;ON;;;;;N;;;;; 003C;LESS-THAN SIGN;Sm;0;ON;;;;;Y;;;;; 003D;EQUALS SIGN;Sm;0;ON;;;;;N;;;;; 003E;GREATER-THAN SIGN;Sm;0;ON;;;;;Y;;;;; 003F;QUESTION MARK;Po;0;ON;;;;;N;;;;; 0040;COMMERCIAL AT;Po;0;ON;;;;;N;;;;; 0041;LATIN CAPITAL LETTER A;Lu;0;L;;;;;N;;;;0061; 0042;LATIN CAPITAL LETTER B;Lu;0;L;;;;;N;;;;0062; 0043;LATIN CAPITAL LETTER C;Lu;0;L;;;;;N;;;;0063; 0044;LATIN CAPITAL LETTER D;Lu;0;L;;;;;N;;;;0064; 0045;LATIN CAPITAL LETTER E;Lu;0;L;;;;;N;;;;0065; 0046;LATIN CAPITAL LETTER F;Lu;0;L;;;;;N;;;;0066; 0047;LATIN CAPITAL LETTER G;Lu;0;L;;;;;N;;;;0067; 0048;LATIN CAPITAL LETTER H;Lu;0;L;;;;;N;;;;0068; 0049;LATIN CAPITAL LETTER I;Lu;0;L;;;;;N;;;;0069; 004A;LATIN CAPITAL LETTER J;Lu;0;L;;;;;N;;;;006A; 004B;LATIN CAPITAL LETTER K;Lu;0;L;;;;;N;;;;006B; 004C;LATIN CAPITAL LETTER L;Lu;0;L;;;;;N;;;;006C; 004D;LATIN CAPITAL LETTER M;Lu;0;L;;;;;N;;;;006D; 004E;LATIN CAPITAL LETTER N;Lu;0;L;;;;;N;;;;006E; 004F;LATIN CAPITAL LETTER O;Lu;0;L;;;;;N;;;;006F; 0050;LATIN CAPITAL LETTER P;Lu;0;L;;;;;N;;;;0070; 0051;LATIN CAPITAL LETTER Q;Lu;0;L;;;;;N;;;;0071; 0052;LATIN CAPITAL LETTER R;Lu;0;L;;;;;N;;;;0072; 0053;LATIN CAPITAL LETTER S;Lu;0;L;;;;;N;;;;0073; 0054;LATIN CAPITAL LETTER T;Lu;0;L;;;;;N;;;;0074; 0055;LATIN CAPITAL LETTER U;Lu;0;L;;;;;N;;;;0075; 0056;LATIN CAPITAL LETTER V;Lu;0;L;;;;;N;;;;0076; 0057;LATIN CAPITAL LETTER W;Lu;0;L;;;;;N;;;;0077; 0058;LATIN CAPITAL LETTER X;Lu;0;L;;;;;N;;;;0078; 0059;LATIN CAPITAL LETTER Y;Lu;0;L;;;;;N;;;;0079; 005A;LATIN CAPITAL LETTER Z;Lu;0;L;;;;;N;;;;007A; 005B;LEFT SQUARE BRACKET;Ps;0;ON;;;;;Y;OPENING SQUARE BRACKET;;;; 005C;REVERSE SOLIDUS;Po;0;ON;;;;;N;BACKSLASH;;;; 005D;RIGHT SQUARE BRACKET;Pe;0;ON;;;;;Y;CLOSING SQUARE BRACKET;;;; 005E;CIRCUMFLEX ACCENT;Sk;0;ON;;;;;N;SPACING CIRCUMFLEX;;;; 005F;LOW LINE;Pc;0;ON;;;;;N;SPACING UNDERSCORE;;;; 0060;GRAVE ACCENT;Sk;0;ON;;;;;N;SPACING GRAVE;;;; 0061;LATIN SMALL LETTER A;Ll;0;L;;;;;N;;;0041;;0041 0062;LATIN SMALL LETTER B;Ll;0;L;;;;;N;;;0042;;0042 0063;LATIN SMALL LETTER C;Ll;0;L;;;;;N;;;0043;;0043 0064;LATIN SMALL LETTER D;Ll;0;L;;;;;N;;;0044;;0044 0065;LATIN SMALL LETTER E;Ll;0;L;;;;;N;;;0045;;0045 0066;LATIN SMALL LETTER F;Ll;0;L;;;;;N;;;0046;;0046 0067;LATIN SMALL LETTER G;Ll;0;L;;;;;N;;;0047;;0047 0068;LATIN SMALL LETTER H;Ll;0;L;;;;;N;;;0048;;0048 0069;LATIN SMALL LETTER I;Ll;0;L;;;;;N;;;0049;;0049 006A;LATIN SMALL LETTER J;Ll;0;L;;;;;N;;;004A;;004A 006B;LATIN SMALL LETTER K;Ll;0;L;;;;;N;;;004B;;004B 006C;LATIN SMALL LETTER L;Ll;0;L;;;;;N;;;004C;;004C 006D;LATIN SMALL LETTER M;Ll;0;L;;;;;N;;;004D;;004D 006E;LATIN SMALL LETTER N;Ll;0;L;;;;;N;;;004E;;004E 006F;LATIN SMALL LETTER O;Ll;0;L;;;;;N;;;004F;;004F 0070;LATIN SMALL LETTER P;Ll;0;L;;;;;N;;;0050;;0050 0071;LATIN SMALL LETTER Q;Ll;0;L;;;;;N;;;0051;;0051 0072;LATIN SMALL LETTER R;Ll;0;L;;;;;N;;;0052;;0052 0073;LATIN SMALL LETTER S;Ll;0;L;;;;;N;;;0053;;0053 0074;LATIN SMALL LETTER T;Ll;0;L;;;;;N;;;0054;;0054 0075;LATIN SMALL LETTER U;Ll;0;L;;;;;N;;;0055;;0055 0076;LATIN SMALL LETTER V;Ll;0;L;;;;;N;;;0056;;0056 0077;LATIN SMALL LETTER W;Ll;0;L;;;;;N;;;0057;;0057 0078;LATIN SMALL LETTER X;Ll;0;L;;;;;N;;;0058;;0058 0079;LATIN SMALL LETTER Y;Ll;0;L;;;;;N;;;0059;;0059 007A;LATIN SMALL LETTER Z;Ll;0;L;;;;;N;;;005A;;005A 007B;LEFT CURLY BRACKET;Ps;0;ON;;;;;Y;OPENING CURLY BRACKET;;;; 007C;VERTICAL LINE;Sm;0;ON;;;;;N;VERTICAL BAR;;;; 007D;RIGHT CURLY BRACKET;Pe;0;ON;;;;;Y;CLOSING CURLY BRACKET;;;; 007E;TILDE;Sm;0;ON;;;;;N;;;;; 007F;;Cc;0;BN;;;;;N;DELETE;;;; 0080;;Cc;0;BN;;;;;N;;;;; 0081;;Cc;0;BN;;;;;N;;;;; 0082;;Cc;0;BN;;;;;N;BREAK PERMITTED HERE;;;; 0083;;Cc;0;BN;;;;;N;NO BREAK HERE;;;; 0084;;Cc;0;BN;;;;;N;;;;; 0085;;Cc;0;B;;;;;N;NEXT LINE (NEL);;;; 0086;;Cc;0;BN;;;;;N;START OF SELECTED AREA;;;; 0087;;Cc;0;BN;;;;;N;END OF SELECTED AREA;;;; 0088;;Cc;0;BN;;;;;N;CHARACTER TABULATION SET;;;; 0089;;Cc;0;BN;;;;;N;CHARACTER TABULATION WITH JUSTIFICATION;;;; 008A;;Cc;0;BN;;;;;N;LINE TABULATION SET;;;; 008B;;Cc;0;BN;;;;;N;PARTIAL LINE FORWARD;;;; 008C;;Cc;0;BN;;;;;N;PARTIAL LINE BACKWARD;;;; 008D;;Cc;0;BN;;;;;N;REVERSE LINE FEED;;;; 008E;;Cc;0;BN;;;;;N;SINGLE SHIFT TWO;;;; 008F;;Cc;0;BN;;;;;N;SINGLE SHIFT THREE;;;; 0090;;Cc;0;BN;;;;;N;DEVICE CONTROL STRING;;;; 0091;;Cc;0;BN;;;;;N;PRIVATE USE ONE;;;; 0092;;Cc;0;BN;;;;;N;PRIVATE USE TWO;;;; 0093;;Cc;0;BN;;;;;N;SET TRANSMIT STATE;;;; 0094;;Cc;0;BN;;;;;N;CANCEL CHARACTER;;;; 0095;;Cc;0;BN;;;;;N;MESSAGE WAITING;;;; 0096;;Cc;0;BN;;;;;N;START OF GUARDED AREA;;;; 0097;;Cc;0;BN;;;;;N;END OF GUARDED AREA;;;; 0098;;Cc;0;BN;;;;;N;START OF STRING;;;; 0099;;Cc;0;BN;;;;;N;;;;; 009A;;Cc;0;BN;;;;;N;SINGLE CHARACTER INTRODUCER;;;; 009B;;Cc;0;BN;;;;;N;CONTROL SEQUENCE INTRODUCER;;;; 009C;;Cc;0;BN;;;;;N;STRING TERMINATOR;;;; 009D;;Cc;0;BN;;;;;N;OPERATING SYSTEM COMMAND;;;; 009E;;Cc;0;BN;;;;;N;PRIVACY MESSAGE;;;; 009F;;Cc;0;BN;;;;;N;APPLICATION PROGRAM COMMAND;;;; 00A0;NO-BREAK SPACE;Zs;0;CS; 0020;;;;N;NON-BREAKING SPACE;;;; 00A1;INVERTED EXCLAMATION MARK;Po;0;ON;;;;;N;;;;; 00A2;CENT SIGN;Sc;0;ET;;;;;N;;;;; 00A3;POUND SIGN;Sc;0;ET;;;;;N;;;;; 00A4;CURRENCY SIGN;Sc;0;ET;;;;;N;;;;; 00A5;YEN SIGN;Sc;0;ET;;;;;N;;;;; 00A6;BROKEN BAR;So;0;ON;;;;;N;BROKEN VERTICAL BAR;;;; 00A7;SECTION SIGN;Po;0;ON;;;;;N;;;;; 00A8;DIAERESIS;Sk;0;ON; 0020 0308;;;;N;SPACING DIAERESIS;;;; 00A9;COPYRIGHT SIGN;So;0;ON;;;;;N;;;;; 00AA;FEMININE ORDINAL INDICATOR;Lo;0;L; 0061;;;;N;;;;; 00AB;LEFT-POINTING DOUBLE ANGLE QUOTATION MARK;Pi;0;ON;;;;;Y;LEFT POINTING GUILLEMET;;;; 00AC;NOT SIGN;Sm;0;ON;;;;;N;;;;; 00AD;SOFT HYPHEN;Cf;0;BN;;;;;N;;;;; 00AE;REGISTERED SIGN;So;0;ON;;;;;N;REGISTERED TRADE MARK SIGN;;;; 00AF;MACRON;Sk;0;ON; 0020 0304;;;;N;SPACING MACRON;;;; 00B0;DEGREE SIGN;So;0;ET;;;;;N;;;;; 00B1;PLUS-MINUS SIGN;Sm;0;ET;;;;;N;PLUS-OR-MINUS SIGN;;;; 00B2;SUPERSCRIPT TWO;No;0;EN; 0032;;2;2;N;SUPERSCRIPT DIGIT TWO;;;; 00B3;SUPERSCRIPT THREE;No;0;EN; 0033;;3;3;N;SUPERSCRIPT DIGIT THREE;;;; 00B4;ACUTE ACCENT;Sk;0;ON; 0020 0301;;;;N;SPACING ACUTE;;;; 00B5;MICRO SIGN;Ll;0;L; 03BC;;;;N;;;039C;;039C 00B6;PILCROW SIGN;Po;0;ON;;;;;N;PARAGRAPH SIGN;;;; 00B7;MIDDLE DOT;Po;0;ON;;;;;N;;;;; 00B8;CEDILLA;Sk;0;ON; 0020 0327;;;;N;SPACING CEDILLA;;;; 00B9;SUPERSCRIPT ONE;No;0;EN; 0031;;1;1;N;SUPERSCRIPT DIGIT ONE;;;; 00BA;MASCULINE ORDINAL INDICATOR;Lo;0;L; 006F;;;;N;;;;; 00BB;RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK;Pf;0;ON;;;;;Y;RIGHT POINTING GUILLEMET;;;; 00BC;VULGAR FRACTION ONE QUARTER;No;0;ON; 0031 2044 0034;;;1/4;N;FRACTION ONE QUARTER;;;; 00BD;VULGAR FRACTION ONE HALF;No;0;ON; 0031 2044 0032;;;1/2;N;FRACTION ONE HALF;;;; 00BE;VULGAR FRACTION THREE QUARTERS;No;0;ON; 0033 2044 0034;;;3/4;N;FRACTION THREE QUARTERS;;;; 00BF;INVERTED QUESTION MARK;Po;0;ON;;;;;N;;;;; 00C0;LATIN CAPITAL LETTER A WITH GRAVE;Lu;0;L;0041 0300;;;;N;LATIN CAPITAL LETTER A GRAVE;;;00E0; 00C1;LATIN CAPITAL LETTER A WITH ACUTE;Lu;0;L;0041 0301;;;;N;LATIN CAPITAL LETTER A ACUTE;;;00E1; 00C2;LATIN CAPITAL LETTER A WITH CIRCUMFLEX;Lu;0;L;0041 0302;;;;N;LATIN CAPITAL LETTER A CIRCUMFLEX;;;00E2; 00C3;LATIN CAPITAL LETTER A WITH TILDE;Lu;0;L;0041 0303;;;;N;LATIN CAPITAL LETTER A TILDE;;;00E3; 00C4;LATIN CAPITAL LETTER A WITH DIAERESIS;Lu;0;L;0041 0308;;;;N;LATIN CAPITAL LETTER A DIAERESIS;;;00E4; 00C5;LATIN CAPITAL LETTER A WITH RING ABOVE;Lu;0;L;0041 030A;;;;N;LATIN CAPITAL LETTER A RING;;;00E5; 00C6;LATIN CAPITAL LETTER AE;Lu;0;L;;;;;N;LATIN CAPITAL LETTER A E;;;00E6; 00C7;LATIN CAPITAL LETTER C WITH CEDILLA;Lu;0;L;0043 0327;;;;N;LATIN CAPITAL LETTER C CEDILLA;;;00E7; 00C8;LATIN CAPITAL LETTER E WITH GRAVE;Lu;0;L;0045 0300;;;;N;LATIN CAPITAL LETTER E GRAVE;;;00E8; 00C9;LATIN CAPITAL LETTER E WITH ACUTE;Lu;0;L;0045 0301;;;;N;LATIN CAPITAL LETTER E ACUTE;;;00E9; 00CA;LATIN CAPITAL LETTER E WITH CIRCUMFLEX;Lu;0;L;0045 0302;;;;N;LATIN CAPITAL LETTER E CIRCUMFLEX;;;00EA; 00CB;LATIN CAPITAL LETTER E WITH DIAERESIS;Lu;0;L;0045 0308;;;;N;LATIN CAPITAL LETTER E DIAERESIS;;;00EB; 00CC;LATIN CAPITAL LETTER I WITH GRAVE;Lu;0;L;0049 0300;;;;N;LATIN CAPITAL LETTER I GRAVE;;;00EC; 00CD;LATIN CAPITAL LETTER I WITH ACUTE;Lu;0;L;0049 0301;;;;N;LATIN CAPITAL LETTER I ACUTE;;;00ED; 00CE;LATIN CAPITAL LETTER I WITH CIRCUMFLEX;Lu;0;L;0049 0302;;;;N;LATIN CAPITAL LETTER I CIRCUMFLEX;;;00EE; 00CF;LATIN CAPITAL LETTER I WITH DIAERESIS;Lu;0;L;0049 0308;;;;N;LATIN CAPITAL LETTER I DIAERESIS;;;00EF; 00D0;LATIN CAPITAL LETTER ETH;Lu;0;L;;;;;N;;;;00F0; 00D1;LATIN CAPITAL LETTER N WITH TILDE;Lu;0;L;004E 0303;;;;N;LATIN CAPITAL LETTER N TILDE;;;00F1; 00D2;LATIN CAPITAL LETTER O WITH GRAVE;Lu;0;L;004F 0300;;;;N;LATIN CAPITAL LETTER O GRAVE;;;00F2; 00D3;LATIN CAPITAL LETTER O WITH ACUTE;Lu;0;L;004F 0301;;;;N;LATIN CAPITAL LETTER O ACUTE;;;00F3; 00D4;LATIN CAPITAL LETTER O WITH CIRCUMFLEX;Lu;0;L;004F 0302;;;;N;LATIN CAPITAL LETTER O CIRCUMFLEX;;;00F4; 00D5;LATIN CAPITAL LETTER O WITH TILDE;Lu;0;L;004F 0303;;;;N;LATIN CAPITAL LETTER O TILDE;;;00F5; 00D6;LATIN CAPITAL LETTER O WITH DIAERESIS;Lu;0;L;004F 0308;;;;N;LATIN CAPITAL LETTER O DIAERESIS;;;00F6; 00D7;MULTIPLICATION SIGN;Sm;0;ON;;;;;N;;;;; 00D8;LATIN CAPITAL LETTER O WITH STROKE;Lu;0;L;;;;;N;LATIN CAPITAL LETTER O SLASH;;;00F8; 00D9;LATIN CAPITAL LETTER U WITH GRAVE;Lu;0;L;0055 0300;;;;N;LATIN CAPITAL LETTER U GRAVE;;;00F9; 00DA;LATIN CAPITAL LETTER U WITH ACUTE;Lu;0;L;0055 0301;;;;N;LATIN CAPITAL LETTER U ACUTE;;;00FA; 00DB;LATIN CAPITAL LETTER U WITH CIRCUMFLEX;Lu;0;L;0055 0302;;;;N;LATIN CAPITAL LETTER U CIRCUMFLEX;;;00FB; 00DC;LATIN CAPITAL LETTER U WITH DIAERESIS;Lu;0;L;0055 0308;;;;N;LATIN CAPITAL LETTER U DIAERESIS;;;00FC; 00DD;LATIN CAPITAL LETTER Y WITH ACUTE;Lu;0;L;0059 0301;;;;N;LATIN CAPITAL LETTER Y ACUTE;;;00FD; 00DE;LATIN CAPITAL LETTER THORN;Lu;0;L;;;;;N;;;;00FE; 00DF;LATIN SMALL LETTER SHARP S;Ll;0;L;;;;;N;;;;; 00E0;LATIN SMALL LETTER A WITH GRAVE;Ll;0;L;0061 0300;;;;N;LATIN SMALL LETTER A GRAVE;;00C0;;00C0 00E1;LATIN SMALL LETTER A WITH ACUTE;Ll;0;L;0061 0301;;;;N;LATIN SMALL LETTER A ACUTE;;00C1;;00C1 00E2;LATIN SMALL LETTER A WITH CIRCUMFLEX;Ll;0;L;0061 0302;;;;N;LATIN SMALL LETTER A CIRCUMFLEX;;00C2;;00C2 00E3;LATIN SMALL LETTER A WITH TILDE;Ll;0;L;0061 0303;;;;N;LATIN SMALL LETTER A TILDE;;00C3;;00C3 00E4;LATIN SMALL LETTER A WITH DIAERESIS;Ll;0;L;0061 0308;;;;N;LATIN SMALL LETTER A DIAERESIS;;00C4;;00C4 00E5;LATIN SMALL LETTER A WITH RING ABOVE;Ll;0;L;0061 030A;;;;N;LATIN SMALL LETTER A RING;;00C5;;00C5 00E6;LATIN SMALL LETTER AE;Ll;0;L;;;;;N;LATIN SMALL LETTER A E;;00C6;;00C6 00E7;LATIN SMALL LETTER C WITH CEDILLA;Ll;0;L;0063 0327;;;;N;LATIN SMALL LETTER C CEDILLA;;00C7;;00C7 00E8;LATIN SMALL LETTER E WITH GRAVE;Ll;0;L;0065 0300;;;;N;LATIN SMALL LETTER E GRAVE;;00C8;;00C8 00E9;LATIN SMALL LETTER E WITH ACUTE;Ll;0;L;0065 0301;;;;N;LATIN SMALL LETTER E ACUTE;;00C9;;00C9 00EA;LATIN SMALL LETTER E WITH CIRCUMFLEX;Ll;0;L;0065 0302;;;;N;LATIN SMALL LETTER E CIRCUMFLEX;;00CA;;00CA 00EB;LATIN SMALL LETTER E WITH DIAERESIS;Ll;0;L;0065 0308;;;;N;LATIN SMALL LETTER E DIAERESIS;;00CB;;00CB 00EC;LATIN SMALL LETTER I WITH GRAVE;Ll;0;L;0069 0300;;;;N;LATIN SMALL LETTER I GRAVE;;00CC;;00CC 00ED;LATIN SMALL LETTER I WITH ACUTE;Ll;0;L;0069 0301;;;;N;LATIN SMALL LETTER I ACUTE;;00CD;;00CD 00EE;LATIN SMALL LETTER I WITH CIRCUMFLEX;Ll;0;L;0069 0302;;;;N;LATIN SMALL LETTER I CIRCUMFLEX;;00CE;;00CE 00EF;LATIN SMALL LETTER I WITH DIAERESIS;Ll;0;L;0069 0308;;;;N;LATIN SMALL LETTER I DIAERESIS;;00CF;;00CF 00F0;LATIN SMALL LETTER ETH;Ll;0;L;;;;;N;;;00D0;;00D0 00F1;LATIN SMALL LETTER N WITH TILDE;Ll;0;L;006E 0303;;;;N;LATIN SMALL LETTER N TILDE;;00D1;;00D1 00F2;LATIN SMALL LETTER O WITH GRAVE;Ll;0;L;006F 0300;;;;N;LATIN SMALL LETTER O GRAVE;;00D2;;00D2 00F3;LATIN SMALL LETTER O WITH ACUTE;Ll;0;L;006F 0301;;;;N;LATIN SMALL LETTER O ACUTE;;00D3;;00D3 00F4;LATIN SMALL LETTER O WITH CIRCUMFLEX;Ll;0;L;006F 0302;;;;N;LATIN SMALL LETTER O CIRCUMFLEX;;00D4;;00D4 00F5;LATIN SMALL LETTER O WITH TILDE;Ll;0;L;006F 0303;;;;N;LATIN SMALL LETTER O TILDE;;00D5;;00D5 00F6;LATIN SMALL LETTER O WITH DIAERESIS;Ll;0;L;006F 0308;;;;N;LATIN SMALL LETTER O DIAERESIS;;00D6;;00D6 00F7;DIVISION SIGN;Sm;0;ON;;;;;N;;;;; 00F8;LATIN SMALL LETTER O WITH STROKE;Ll;0;L;;;;;N;LATIN SMALL LETTER O SLASH;;00D8;;00D8 00F9;LATIN SMALL LETTER U WITH GRAVE;Ll;0;L;0075 0300;;;;N;LATIN SMALL LETTER U GRAVE;;00D9;;00D9 00FA;LATIN SMALL LETTER U WITH ACUTE;Ll;0;L;0075 0301;;;;N;LATIN SMALL LETTER U ACUTE;;00DA;;00DA 00FB;LATIN SMALL LETTER U WITH CIRCUMFLEX;Ll;0;L;0075 0302;;;;N;LATIN SMALL LETTER U CIRCUMFLEX;;00DB;;00DB 00FC;LATIN SMALL LETTER U WITH DIAERESIS;Ll;0;L;0075 0308;;;;N;LATIN SMALL LETTER U DIAERESIS;;00DC;;00DC 00FD;LATIN SMALL LETTER Y WITH ACUTE;Ll;0;L;0079 0301;;;;N;LATIN SMALL LETTER Y ACUTE;;00DD;;00DD 00FE;LATIN SMALL LETTER THORN;Ll;0;L;;;;;N;;;00DE;;00DE 00FF;LATIN SMALL LETTER Y WITH DIAERESIS;Ll;0;L;0079 0308;;;;N;LATIN SMALL LETTER Y DIAERESIS;;0178;;0178 0100;LATIN CAPITAL LETTER A WITH MACRON;Lu;0;L;0041 0304;;;;N;LATIN CAPITAL LETTER A MACRON;;;0101; 0101;LATIN SMALL LETTER A WITH MACRON;Ll;0;L;0061 0304;;;;N;LATIN SMALL LETTER A MACRON;;0100;;0100 0102;LATIN CAPITAL LETTER A WITH BREVE;Lu;0;L;0041 0306;;;;N;LATIN CAPITAL LETTER A BREVE;;;0103; 0103;LATIN SMALL LETTER A WITH BREVE;Ll;0;L;0061 0306;;;;N;LATIN SMALL LETTER A BREVE;;0102;;0102 0104;LATIN CAPITAL LETTER A WITH OGONEK;Lu;0;L;0041 0328;;;;N;LATIN CAPITAL LETTER A OGONEK;;;0105; 0105;LATIN SMALL LETTER A WITH OGONEK;Ll;0;L;0061 0328;;;;N;LATIN SMALL LETTER A OGONEK;;0104;;0104 0106;LATIN CAPITAL LETTER C WITH ACUTE;Lu;0;L;0043 0301;;;;N;LATIN CAPITAL LETTER C ACUTE;;;0107; 0107;LATIN SMALL LETTER C WITH ACUTE;Ll;0;L;0063 0301;;;;N;LATIN SMALL LETTER C ACUTE;;0106;;0106 0108;LATIN CAPITAL LETTER C WITH CIRCUMFLEX;Lu;0;L;0043 0302;;;;N;LATIN CAPITAL LETTER C CIRCUMFLEX;;;0109; 0109;LATIN SMALL LETTER C WITH CIRCUMFLEX;Ll;0;L;0063 0302;;;;N;LATIN SMALL LETTER C CIRCUMFLEX;;0108;;0108 010A;LATIN CAPITAL LETTER C WITH DOT ABOVE;Lu;0;L;0043 0307;;;;N;LATIN CAPITAL LETTER C DOT;;;010B; 010B;LATIN SMALL LETTER C WITH DOT ABOVE;Ll;0;L;0063 0307;;;;N;LATIN SMALL LETTER C DOT;;010A;;010A 010C;LATIN CAPITAL LETTER C WITH CARON;Lu;0;L;0043 030C;;;;N;LATIN CAPITAL LETTER C HACEK;;;010D; 010D;LATIN SMALL LETTER C WITH CARON;Ll;0;L;0063 030C;;;;N;LATIN SMALL LETTER C HACEK;;010C;;010C 010E;LATIN CAPITAL LETTER D WITH CARON;Lu;0;L;0044 030C;;;;N;LATIN CAPITAL LETTER D HACEK;;;010F; 010F;LATIN SMALL LETTER D WITH CARON;Ll;0;L;0064 030C;;;;N;LATIN SMALL LETTER D HACEK;;010E;;010E 0110;LATIN CAPITAL LETTER D WITH STROKE;Lu;0;L;;;;;N;LATIN CAPITAL LETTER D BAR;;;0111; 0111;LATIN SMALL LETTER D WITH STROKE;Ll;0;L;;;;;N;LATIN SMALL LETTER D BAR;;0110;;0110 0112;LATIN CAPITAL LETTER E WITH MACRON;Lu;0;L;0045 0304;;;;N;LATIN CAPITAL LETTER E MACRON;;;0113; 0113;LATIN SMALL LETTER E WITH MACRON;Ll;0;L;0065 0304;;;;N;LATIN SMALL LETTER E MACRON;;0112;;0112 0114;LATIN CAPITAL LETTER E WITH BREVE;Lu;0;L;0045 0306;;;;N;LATIN CAPITAL LETTER E BREVE;;;0115; 0115;LATIN SMALL LETTER E WITH BREVE;Ll;0;L;0065 0306;;;;N;LATIN SMALL LETTER E BREVE;;0114;;0114 0116;LATIN CAPITAL LETTER E WITH DOT ABOVE;Lu;0;L;0045 0307;;;;N;LATIN CAPITAL LETTER E DOT;;;0117; 0117;LATIN SMALL LETTER E WITH DOT ABOVE;Ll;0;L;0065 0307;;;;N;LATIN SMALL LETTER E DOT;;0116;;0116 0118;LATIN CAPITAL LETTER E WITH OGONEK;Lu;0;L;0045 0328;;;;N;LATIN CAPITAL LETTER E OGONEK;;;0119; 0119;LATIN SMALL LETTER E WITH OGONEK;Ll;0;L;0065 0328;;;;N;LATIN SMALL LETTER E OGONEK;;0118;;0118 011A;LATIN CAPITAL LETTER E WITH CARON;Lu;0;L;0045 030C;;;;N;LATIN CAPITAL LETTER E HACEK;;;011B; 011B;LATIN SMALL LETTER E WITH CARON;Ll;0;L;0065 030C;;;;N;LATIN SMALL LETTER E HACEK;;011A;;011A 011C;LATIN CAPITAL LETTER G WITH CIRCUMFLEX;Lu;0;L;0047 0302;;;;N;LATIN CAPITAL LETTER G CIRCUMFLEX;;;011D; 011D;LATIN SMALL LETTER G WITH CIRCUMFLEX;Ll;0;L;0067 0302;;;;N;LATIN SMALL LETTER G CIRCUMFLEX;;011C;;011C 011E;LATIN CAPITAL LETTER G WITH BREVE;Lu;0;L;0047 0306;;;;N;LATIN CAPITAL LETTER G BREVE;;;011F; 011F;LATIN SMALL LETTER G WITH BREVE;Ll;0;L;0067 0306;;;;N;LATIN SMALL LETTER G BREVE;;011E;;011E 0120;LATIN CAPITAL LETTER G WITH DOT ABOVE;Lu;0;L;0047 0307;;;;N;LATIN CAPITAL LETTER G DOT;;;0121; 0121;LATIN SMALL LETTER G WITH DOT ABOVE;Ll;0;L;0067 0307;;;;N;LATIN SMALL LETTER G DOT;;0120;;0120 0122;LATIN CAPITAL LETTER G WITH CEDILLA;Lu;0;L;0047 0327;;;;N;LATIN CAPITAL LETTER G CEDILLA;;;0123; 0123;LATIN SMALL LETTER G WITH CEDILLA;Ll;0;L;0067 0327;;;;N;LATIN SMALL LETTER G CEDILLA;;0122;;0122 0124;LATIN CAPITAL LETTER H WITH CIRCUMFLEX;Lu;0;L;0048 0302;;;;N;LATIN CAPITAL LETTER H CIRCUMFLEX;;;0125; 0125;LATIN SMALL LETTER H WITH CIRCUMFLEX;Ll;0;L;0068 0302;;;;N;LATIN SMALL LETTER H CIRCUMFLEX;;0124;;0124 0126;LATIN CAPITAL LETTER H WITH STROKE;Lu;0;L;;;;;N;LATIN CAPITAL LETTER H BAR;;;0127; 0127;LATIN SMALL LETTER H WITH STROKE;Ll;0;L;;;;;N;LATIN SMALL LETTER H BAR;;0126;;0126 0128;LATIN CAPITAL LETTER I WITH TILDE;Lu;0;L;0049 0303;;;;N;LATIN CAPITAL LETTER I TILDE;;;0129; 0129;LATIN SMALL LETTER I WITH TILDE;Ll;0;L;0069 0303;;;;N;LATIN SMALL LETTER I TILDE;;0128;;0128 012A;LATIN CAPITAL LETTER I WITH MACRON;Lu;0;L;0049 0304;;;;N;LATIN CAPITAL LETTER I MACRON;;;012B; 012B;LATIN SMALL LETTER I WITH MACRON;Ll;0;L;0069 0304;;;;N;LATIN SMALL LETTER I MACRON;;012A;;012A 012C;LATIN CAPITAL LETTER I WITH BREVE;Lu;0;L;0049 0306;;;;N;LATIN CAPITAL LETTER I BREVE;;;012D; 012D;LATIN SMALL LETTER I WITH BREVE;Ll;0;L;0069 0306;;;;N;LATIN SMALL LETTER I BREVE;;012C;;012C 012E;LATIN CAPITAL LETTER I WITH OGONEK;Lu;0;L;0049 0328;;;;N;LATIN CAPITAL LETTER I OGONEK;;;012F; 012F;LATIN SMALL LETTER I WITH OGONEK;Ll;0;L;0069 0328;;;;N;LATIN SMALL LETTER I OGONEK;;012E;;012E 0130;LATIN CAPITAL LETTER I WITH DOT ABOVE;Lu;0;L;0049 0307;;;;N;LATIN CAPITAL LETTER I DOT;;;0069; 0131;LATIN SMALL LETTER DOTLESS I;Ll;0;L;;;;;N;;;0049;;0049 0132;LATIN CAPITAL LIGATURE IJ;Lu;0;L; 0049 004A;;;;N;LATIN CAPITAL LETTER I J;;;0133; 0133;LATIN SMALL LIGATURE IJ;Ll;0;L; 0069 006A;;;;N;LATIN SMALL LETTER I J;;0132;;0132 0134;LATIN CAPITAL LETTER J WITH CIRCUMFLEX;Lu;0;L;004A 0302;;;;N;LATIN CAPITAL LETTER J CIRCUMFLEX;;;0135; 0135;LATIN SMALL LETTER J WITH CIRCUMFLEX;Ll;0;L;006A 0302;;;;N;LATIN SMALL LETTER J CIRCUMFLEX;;0134;;0134 0136;LATIN CAPITAL LETTER K WITH CEDILLA;Lu;0;L;004B 0327;;;;N;LATIN CAPITAL LETTER K CEDILLA;;;0137; 0137;LATIN SMALL LETTER K WITH CEDILLA;Ll;0;L;006B 0327;;;;N;LATIN SMALL LETTER K CEDILLA;;0136;;0136 0138;LATIN SMALL LETTER KRA;Ll;0;L;;;;;N;;;;; 0139;LATIN CAPITAL LETTER L WITH ACUTE;Lu;0;L;004C 0301;;;;N;LATIN CAPITAL LETTER L ACUTE;;;013A; 013A;LATIN SMALL LETTER L WITH ACUTE;Ll;0;L;006C 0301;;;;N;LATIN SMALL LETTER L ACUTE;;0139;;0139 013B;LATIN CAPITAL LETTER L WITH CEDILLA;Lu;0;L;004C 0327;;;;N;LATIN CAPITAL LETTER L CEDILLA;;;013C; 013C;LATIN SMALL LETTER L WITH CEDILLA;Ll;0;L;006C 0327;;;;N;LATIN SMALL LETTER L CEDILLA;;013B;;013B 013D;LATIN CAPITAL LETTER L WITH CARON;Lu;0;L;004C 030C;;;;N;LATIN CAPITAL LETTER L HACEK;;;013E; 013E;LATIN SMALL LETTER L WITH CARON;Ll;0;L;006C 030C;;;;N;LATIN SMALL LETTER L HACEK;;013D;;013D 013F;LATIN CAPITAL LETTER L WITH MIDDLE DOT;Lu;0;L; 004C 00B7;;;;N;;;;0140; 0140;LATIN SMALL LETTER L WITH MIDDLE DOT;Ll;0;L; 006C 00B7;;;;N;;;013F;;013F 0141;LATIN CAPITAL LETTER L WITH STROKE;Lu;0;L;;;;;N;LATIN CAPITAL LETTER L SLASH;;;0142; 0142;LATIN SMALL LETTER L WITH STROKE;Ll;0;L;;;;;N;LATIN SMALL LETTER L SLASH;;0141;;0141 0143;LATIN CAPITAL LETTER N WITH ACUTE;Lu;0;L;004E 0301;;;;N;LATIN CAPITAL LETTER N ACUTE;;;0144; 0144;LATIN SMALL LETTER N WITH ACUTE;Ll;0;L;006E 0301;;;;N;LATIN SMALL LETTER N ACUTE;;0143;;0143 0145;LATIN CAPITAL LETTER N WITH CEDILLA;Lu;0;L;004E 0327;;;;N;LATIN CAPITAL LETTER N CEDILLA;;;0146; 0146;LATIN SMALL LETTER N WITH CEDILLA;Ll;0;L;006E 0327;;;;N;LATIN SMALL LETTER N CEDILLA;;0145;;0145 0147;LATIN CAPITAL LETTER N WITH CARON;Lu;0;L;004E 030C;;;;N;LATIN CAPITAL LETTER N HACEK;;;0148; 0148;LATIN SMALL LETTER N WITH CARON;Ll;0;L;006E 030C;;;;N;LATIN SMALL LETTER N HACEK;;0147;;0147 0149;LATIN SMALL LETTER N PRECEDED BY APOSTROPHE;Ll;0;L; 02BC 006E;;;;N;LATIN SMALL LETTER APOSTROPHE N;;;; 014A;LATIN CAPITAL LETTER ENG;Lu;0;L;;;;;N;;;;014B; 014B;LATIN SMALL LETTER ENG;Ll;0;L;;;;;N;;;014A;;014A 014C;LATIN CAPITAL LETTER O WITH MACRON;Lu;0;L;004F 0304;;;;N;LATIN CAPITAL LETTER O MACRON;;;014D; 014D;LATIN SMALL LETTER O WITH MACRON;Ll;0;L;006F 0304;;;;N;LATIN SMALL LETTER O MACRON;;014C;;014C 014E;LATIN CAPITAL LETTER O WITH BREVE;Lu;0;L;004F 0306;;;;N;LATIN CAPITAL LETTER O BREVE;;;014F; 014F;LATIN SMALL LETTER O WITH BREVE;Ll;0;L;006F 0306;;;;N;LATIN SMALL LETTER O BREVE;;014E;;014E 0150;LATIN CAPITAL LETTER O WITH DOUBLE ACUTE;Lu;0;L;004F 030B;;;;N;LATIN CAPITAL LETTER O DOUBLE ACUTE;;;0151; 0151;LATIN SMALL LETTER O WITH DOUBLE ACUTE;Ll;0;L;006F 030B;;;;N;LATIN SMALL LETTER O DOUBLE ACUTE;;0150;;0150 0152;LATIN CAPITAL LIGATURE OE;Lu;0;L;;;;;N;LATIN CAPITAL LETTER O E;;;0153; 0153;LATIN SMALL LIGATURE OE;Ll;0;L;;;;;N;LATIN SMALL LETTER O E;;0152;;0152 0154;LATIN CAPITAL LETTER R WITH ACUTE;Lu;0;L;0052 0301;;;;N;LATIN CAPITAL LETTER R ACUTE;;;0155; 0155;LATIN SMALL LETTER R WITH ACUTE;Ll;0;L;0072 0301;;;;N;LATIN SMALL LETTER R ACUTE;;0154;;0154 0156;LATIN CAPITAL LETTER R WITH CEDILLA;Lu;0;L;0052 0327;;;;N;LATIN CAPITAL LETTER R CEDILLA;;;0157; 0157;LATIN SMALL LETTER R WITH CEDILLA;Ll;0;L;0072 0327;;;;N;LATIN SMALL LETTER R CEDILLA;;0156;;0156 0158;LATIN CAPITAL LETTER R WITH CARON;Lu;0;L;0052 030C;;;;N;LATIN CAPITAL LETTER R HACEK;;;0159; 0159;LATIN SMALL LETTER R WITH CARON;Ll;0;L;0072 030C;;;;N;LATIN SMALL LETTER R HACEK;;0158;;0158 015A;LATIN CAPITAL LETTER S WITH ACUTE;Lu;0;L;0053 0301;;;;N;LATIN CAPITAL LETTER S ACUTE;;;015B; 015B;LATIN SMALL LETTER S WITH ACUTE;Ll;0;L;0073 0301;;;;N;LATIN SMALL LETTER S ACUTE;;015A;;015A 015C;LATIN CAPITAL LETTER S WITH CIRCUMFLEX;Lu;0;L;0053 0302;;;;N;LATIN CAPITAL LETTER S CIRCUMFLEX;;;015D; 015D;LATIN SMALL LETTER S WITH CIRCUMFLEX;Ll;0;L;0073 0302;;;;N;LATIN SMALL LETTER S CIRCUMFLEX;;015C;;015C 015E;LATIN CAPITAL LETTER S WITH CEDILLA;Lu;0;L;0053 0327;;;;N;LATIN CAPITAL LETTER S CEDILLA;;;015F; 015F;LATIN SMALL LETTER S WITH CEDILLA;Ll;0;L;0073 0327;;;;N;LATIN SMALL LETTER S CEDILLA;;015E;;015E 0160;LATIN CAPITAL LETTER S WITH CARON;Lu;0;L;0053 030C;;;;N;LATIN CAPITAL LETTER S HACEK;;;0161; 0161;LATIN SMALL LETTER S WITH CARON;Ll;0;L;0073 030C;;;;N;LATIN SMALL LETTER S HACEK;;0160;;0160 0162;LATIN CAPITAL LETTER T WITH CEDILLA;Lu;0;L;0054 0327;;;;N;LATIN CAPITAL LETTER T CEDILLA;;;0163; 0163;LATIN SMALL LETTER T WITH CEDILLA;Ll;0;L;0074 0327;;;;N;LATIN SMALL LETTER T CEDILLA;;0162;;0162 0164;LATIN CAPITAL LETTER T WITH CARON;Lu;0;L;0054 030C;;;;N;LATIN CAPITAL LETTER T HACEK;;;0165; 0165;LATIN SMALL LETTER T WITH CARON;Ll;0;L;0074 030C;;;;N;LATIN SMALL LETTER T HACEK;;0164;;0164 0166;LATIN CAPITAL LETTER T WITH STROKE;Lu;0;L;;;;;N;LATIN CAPITAL LETTER T BAR;;;0167; 0167;LATIN SMALL LETTER T WITH STROKE;Ll;0;L;;;;;N;LATIN SMALL LETTER T BAR;;0166;;0166 0168;LATIN CAPITAL LETTER U WITH TILDE;Lu;0;L;0055 0303;;;;N;LATIN CAPITAL LETTER U TILDE;;;0169; 0169;LATIN SMALL LETTER U WITH TILDE;Ll;0;L;0075 0303;;;;N;LATIN SMALL LETTER U TILDE;;0168;;0168 016A;LATIN CAPITAL LETTER U WITH MACRON;Lu;0;L;0055 0304;;;;N;LATIN CAPITAL LETTER U MACRON;;;016B; 016B;LATIN SMALL LETTER U WITH MACRON;Ll;0;L;0075 0304;;;;N;LATIN SMALL LETTER U MACRON;;016A;;016A 016C;LATIN CAPITAL LETTER U WITH BREVE;Lu;0;L;0055 0306;;;;N;LATIN CAPITAL LETTER U BREVE;;;016D; 016D;LATIN SMALL LETTER U WITH BREVE;Ll;0;L;0075 0306;;;;N;LATIN SMALL LETTER U BREVE;;016C;;016C 016E;LATIN CAPITAL LETTER U WITH RING ABOVE;Lu;0;L;0055 030A;;;;N;LATIN CAPITAL LETTER U RING;;;016F; 016F;LATIN SMALL LETTER U WITH RING ABOVE;Ll;0;L;0075 030A;;;;N;LATIN SMALL LETTER U RING;;016E;;016E 0170;LATIN CAPITAL LETTER U WITH DOUBLE ACUTE;Lu;0;L;0055 030B;;;;N;LATIN CAPITAL LETTER U DOUBLE ACUTE;;;0171; 0171;LATIN SMALL LETTER U WITH DOUBLE ACUTE;Ll;0;L;0075 030B;;;;N;LATIN SMALL LETTER U DOUBLE ACUTE;;0170;;0170 0172;LATIN CAPITAL LETTER U WITH OGONEK;Lu;0;L;0055 0328;;;;N;LATIN CAPITAL LETTER U OGONEK;;;0173; 0173;LATIN SMALL LETTER U WITH OGONEK;Ll;0;L;0075 0328;;;;N;LATIN SMALL LETTER U OGONEK;;0172;;0172 0174;LATIN CAPITAL LETTER W WITH CIRCUMFLEX;Lu;0;L;0057 0302;;;;N;LATIN CAPITAL LETTER W CIRCUMFLEX;;;0175; 0175;LATIN SMALL LETTER W WITH CIRCUMFLEX;Ll;0;L;0077 0302;;;;N;LATIN SMALL LETTER W CIRCUMFLEX;;0174;;0174 0176;LATIN CAPITAL LETTER Y WITH CIRCUMFLEX;Lu;0;L;0059 0302;;;;N;LATIN CAPITAL LETTER Y CIRCUMFLEX;;;0177; 0177;LATIN SMALL LETTER Y WITH CIRCUMFLEX;Ll;0;L;0079 0302;;;;N;LATIN SMALL LETTER Y CIRCUMFLEX;;0176;;0176 0178;LATIN CAPITAL LETTER Y WITH DIAERESIS;Lu;0;L;0059 0308;;;;N;LATIN CAPITAL LETTER Y DIAERESIS;;;00FF; 0179;LATIN CAPITAL LETTER Z WITH ACUTE;Lu;0;L;005A 0301;;;;N;LATIN CAPITAL LETTER Z ACUTE;;;017A; 017A;LATIN SMALL LETTER Z WITH ACUTE;Ll;0;L;007A 0301;;;;N;LATIN SMALL LETTER Z ACUTE;;0179;;0179 017B;LATIN CAPITAL LETTER Z WITH DOT ABOVE;Lu;0;L;005A 0307;;;;N;LATIN CAPITAL LETTER Z DOT;;;017C; 017C;LATIN SMALL LETTER Z WITH DOT ABOVE;Ll;0;L;007A 0307;;;;N;LATIN SMALL LETTER Z DOT;;017B;;017B 017D;LATIN CAPITAL LETTER Z WITH CARON;Lu;0;L;005A 030C;;;;N;LATIN CAPITAL LETTER Z HACEK;;;017E; 017E;LATIN SMALL LETTER Z WITH CARON;Ll;0;L;007A 030C;;;;N;LATIN SMALL LETTER Z HACEK;;017D;;017D 017F;LATIN SMALL LETTER LONG S;Ll;0;L; 0073;;;;N;;;0053;;0053 0180;LATIN SMALL LETTER B WITH STROKE;Ll;0;L;;;;;N;LATIN SMALL LETTER B BAR;;0243;;0243 0181;LATIN CAPITAL LETTER B WITH HOOK;Lu;0;L;;;;;N;LATIN CAPITAL LETTER B HOOK;;;0253; 0182;LATIN CAPITAL LETTER B WITH TOPBAR;Lu;0;L;;;;;N;LATIN CAPITAL LETTER B TOPBAR;;;0183; 0183;LATIN SMALL LETTER B WITH TOPBAR;Ll;0;L;;;;;N;LATIN SMALL LETTER B TOPBAR;;0182;;0182 0184;LATIN CAPITAL LETTER TONE SIX;Lu;0;L;;;;;N;;;;0185; 0185;LATIN SMALL LETTER TONE SIX;Ll;0;L;;;;;N;;;0184;;0184 0186;LATIN CAPITAL LETTER OPEN O;Lu;0;L;;;;;N;;;;0254; 0187;LATIN CAPITAL LETTER C WITH HOOK;Lu;0;L;;;;;N;LATIN CAPITAL LETTER C HOOK;;;0188; 0188;LATIN SMALL LETTER C WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER C HOOK;;0187;;0187 0189;LATIN CAPITAL LETTER AFRICAN D;Lu;0;L;;;;;N;;;;0256; 018A;LATIN CAPITAL LETTER D WITH HOOK;Lu;0;L;;;;;N;LATIN CAPITAL LETTER D HOOK;;;0257; 018B;LATIN CAPITAL LETTER D WITH TOPBAR;Lu;0;L;;;;;N;LATIN CAPITAL LETTER D TOPBAR;;;018C; 018C;LATIN SMALL LETTER D WITH TOPBAR;Ll;0;L;;;;;N;LATIN SMALL LETTER D TOPBAR;;018B;;018B 018D;LATIN SMALL LETTER TURNED DELTA;Ll;0;L;;;;;N;;;;; 018E;LATIN CAPITAL LETTER REVERSED E;Lu;0;L;;;;;N;LATIN CAPITAL LETTER TURNED E;;;01DD; 018F;LATIN CAPITAL LETTER SCHWA;Lu;0;L;;;;;N;;;;0259; 0190;LATIN CAPITAL LETTER OPEN E;Lu;0;L;;;;;N;LATIN CAPITAL LETTER EPSILON;;;025B; 0191;LATIN CAPITAL LETTER F WITH HOOK;Lu;0;L;;;;;N;LATIN CAPITAL LETTER F HOOK;;;0192; 0192;LATIN SMALL LETTER F WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER SCRIPT F;;0191;;0191 0193;LATIN CAPITAL LETTER G WITH HOOK;Lu;0;L;;;;;N;LATIN CAPITAL LETTER G HOOK;;;0260; 0194;LATIN CAPITAL LETTER GAMMA;Lu;0;L;;;;;N;;;;0263; 0195;LATIN SMALL LETTER HV;Ll;0;L;;;;;N;LATIN SMALL LETTER H V;;01F6;;01F6 0196;LATIN CAPITAL LETTER IOTA;Lu;0;L;;;;;N;;;;0269; 0197;LATIN CAPITAL LETTER I WITH STROKE;Lu;0;L;;;;;N;LATIN CAPITAL LETTER BARRED I;;;0268; 0198;LATIN CAPITAL LETTER K WITH HOOK;Lu;0;L;;;;;N;LATIN CAPITAL LETTER K HOOK;;;0199; 0199;LATIN SMALL LETTER K WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER K HOOK;;0198;;0198 019A;LATIN SMALL LETTER L WITH BAR;Ll;0;L;;;;;N;LATIN SMALL LETTER BARRED L;;023D;;023D 019B;LATIN SMALL LETTER LAMBDA WITH STROKE;Ll;0;L;;;;;N;LATIN SMALL LETTER BARRED LAMBDA;;;; 019C;LATIN CAPITAL LETTER TURNED M;Lu;0;L;;;;;N;;;;026F; 019D;LATIN CAPITAL LETTER N WITH LEFT HOOK;Lu;0;L;;;;;N;LATIN CAPITAL LETTER N HOOK;;;0272; 019E;LATIN SMALL LETTER N WITH LONG RIGHT LEG;Ll;0;L;;;;;N;;;0220;;0220 019F;LATIN CAPITAL LETTER O WITH MIDDLE TILDE;Lu;0;L;;;;;N;LATIN CAPITAL LETTER BARRED O;;;0275; 01A0;LATIN CAPITAL LETTER O WITH HORN;Lu;0;L;004F 031B;;;;N;LATIN CAPITAL LETTER O HORN;;;01A1; 01A1;LATIN SMALL LETTER O WITH HORN;Ll;0;L;006F 031B;;;;N;LATIN SMALL LETTER O HORN;;01A0;;01A0 01A2;LATIN CAPITAL LETTER OI;Lu;0;L;;;;;N;LATIN CAPITAL LETTER O I;;;01A3; 01A3;LATIN SMALL LETTER OI;Ll;0;L;;;;;N;LATIN SMALL LETTER O I;;01A2;;01A2 01A4;LATIN CAPITAL LETTER P WITH HOOK;Lu;0;L;;;;;N;LATIN CAPITAL LETTER P HOOK;;;01A5; 01A5;LATIN SMALL LETTER P WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER P HOOK;;01A4;;01A4 01A6;LATIN LETTER YR;Lu;0;L;;;;;N;LATIN LETTER Y R;;;0280; 01A7;LATIN CAPITAL LETTER TONE TWO;Lu;0;L;;;;;N;;;;01A8; 01A8;LATIN SMALL LETTER TONE TWO;Ll;0;L;;;;;N;;;01A7;;01A7 01A9;LATIN CAPITAL LETTER ESH;Lu;0;L;;;;;N;;;;0283; 01AA;LATIN LETTER REVERSED ESH LOOP;Ll;0;L;;;;;N;;;;; 01AB;LATIN SMALL LETTER T WITH PALATAL HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER T PALATAL HOOK;;;; 01AC;LATIN CAPITAL LETTER T WITH HOOK;Lu;0;L;;;;;N;LATIN CAPITAL LETTER T HOOK;;;01AD; 01AD;LATIN SMALL LETTER T WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER T HOOK;;01AC;;01AC 01AE;LATIN CAPITAL LETTER T WITH RETROFLEX HOOK;Lu;0;L;;;;;N;LATIN CAPITAL LETTER T RETROFLEX HOOK;;;0288; 01AF;LATIN CAPITAL LETTER U WITH HORN;Lu;0;L;0055 031B;;;;N;LATIN CAPITAL LETTER U HORN;;;01B0; 01B0;LATIN SMALL LETTER U WITH HORN;Ll;0;L;0075 031B;;;;N;LATIN SMALL LETTER U HORN;;01AF;;01AF 01B1;LATIN CAPITAL LETTER UPSILON;Lu;0;L;;;;;N;;;;028A; 01B2;LATIN CAPITAL LETTER V WITH HOOK;Lu;0;L;;;;;N;LATIN CAPITAL LETTER SCRIPT V;;;028B; 01B3;LATIN CAPITAL LETTER Y WITH HOOK;Lu;0;L;;;;;N;LATIN CAPITAL LETTER Y HOOK;;;01B4; 01B4;LATIN SMALL LETTER Y WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER Y HOOK;;01B3;;01B3 01B5;LATIN CAPITAL LETTER Z WITH STROKE;Lu;0;L;;;;;N;LATIN CAPITAL LETTER Z BAR;;;01B6; 01B6;LATIN SMALL LETTER Z WITH STROKE;Ll;0;L;;;;;N;LATIN SMALL LETTER Z BAR;;01B5;;01B5 01B7;LATIN CAPITAL LETTER EZH;Lu;0;L;;;;;N;LATIN CAPITAL LETTER YOGH;;;0292; 01B8;LATIN CAPITAL LETTER EZH REVERSED;Lu;0;L;;;;;N;LATIN CAPITAL LETTER REVERSED YOGH;;;01B9; 01B9;LATIN SMALL LETTER EZH REVERSED;Ll;0;L;;;;;N;LATIN SMALL LETTER REVERSED YOGH;;01B8;;01B8 01BA;LATIN SMALL LETTER EZH WITH TAIL;Ll;0;L;;;;;N;LATIN SMALL LETTER YOGH WITH TAIL;;;; 01BB;LATIN LETTER TWO WITH STROKE;Lo;0;L;;;;;N;LATIN LETTER TWO BAR;;;; 01BC;LATIN CAPITAL LETTER TONE FIVE;Lu;0;L;;;;;N;;;;01BD; 01BD;LATIN SMALL LETTER TONE FIVE;Ll;0;L;;;;;N;;;01BC;;01BC 01BE;LATIN LETTER INVERTED GLOTTAL STOP WITH STROKE;Ll;0;L;;;;;N;LATIN LETTER INVERTED GLOTTAL STOP BAR;;;; 01BF;LATIN LETTER WYNN;Ll;0;L;;;;;N;;;01F7;;01F7 01C0;LATIN LETTER DENTAL CLICK;Lo;0;L;;;;;N;LATIN LETTER PIPE;;;; 01C1;LATIN LETTER LATERAL CLICK;Lo;0;L;;;;;N;LATIN LETTER DOUBLE PIPE;;;; 01C2;LATIN LETTER ALVEOLAR CLICK;Lo;0;L;;;;;N;LATIN LETTER PIPE DOUBLE BAR;;;; 01C3;LATIN LETTER RETROFLEX CLICK;Lo;0;L;;;;;N;LATIN LETTER EXCLAMATION MARK;;;; 01C4;LATIN CAPITAL LETTER DZ WITH CARON;Lu;0;L; 0044 017D;;;;N;LATIN CAPITAL LETTER D Z HACEK;;;01C6;01C5 01C5;LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON;Lt;0;L; 0044 017E;;;;N;LATIN LETTER CAPITAL D SMALL Z HACEK;;01C4;01C6;01C5 01C6;LATIN SMALL LETTER DZ WITH CARON;Ll;0;L; 0064 017E;;;;N;LATIN SMALL LETTER D Z HACEK;;01C4;;01C5 01C7;LATIN CAPITAL LETTER LJ;Lu;0;L; 004C 004A;;;;N;LATIN CAPITAL LETTER L J;;;01C9;01C8 01C8;LATIN CAPITAL LETTER L WITH SMALL LETTER J;Lt;0;L; 004C 006A;;;;N;LATIN LETTER CAPITAL L SMALL J;;01C7;01C9;01C8 01C9;LATIN SMALL LETTER LJ;Ll;0;L; 006C 006A;;;;N;LATIN SMALL LETTER L J;;01C7;;01C8 01CA;LATIN CAPITAL LETTER NJ;Lu;0;L; 004E 004A;;;;N;LATIN CAPITAL LETTER N J;;;01CC;01CB 01CB;LATIN CAPITAL LETTER N WITH SMALL LETTER J;Lt;0;L; 004E 006A;;;;N;LATIN LETTER CAPITAL N SMALL J;;01CA;01CC;01CB 01CC;LATIN SMALL LETTER NJ;Ll;0;L; 006E 006A;;;;N;LATIN SMALL LETTER N J;;01CA;;01CB 01CD;LATIN CAPITAL LETTER A WITH CARON;Lu;0;L;0041 030C;;;;N;LATIN CAPITAL LETTER A HACEK;;;01CE; 01CE;LATIN SMALL LETTER A WITH CARON;Ll;0;L;0061 030C;;;;N;LATIN SMALL LETTER A HACEK;;01CD;;01CD 01CF;LATIN CAPITAL LETTER I WITH CARON;Lu;0;L;0049 030C;;;;N;LATIN CAPITAL LETTER I HACEK;;;01D0; 01D0;LATIN SMALL LETTER I WITH CARON;Ll;0;L;0069 030C;;;;N;LATIN SMALL LETTER I HACEK;;01CF;;01CF 01D1;LATIN CAPITAL LETTER O WITH CARON;Lu;0;L;004F 030C;;;;N;LATIN CAPITAL LETTER O HACEK;;;01D2; 01D2;LATIN SMALL LETTER O WITH CARON;Ll;0;L;006F 030C;;;;N;LATIN SMALL LETTER O HACEK;;01D1;;01D1 01D3;LATIN CAPITAL LETTER U WITH CARON;Lu;0;L;0055 030C;;;;N;LATIN CAPITAL LETTER U HACEK;;;01D4; 01D4;LATIN SMALL LETTER U WITH CARON;Ll;0;L;0075 030C;;;;N;LATIN SMALL LETTER U HACEK;;01D3;;01D3 01D5;LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON;Lu;0;L;00DC 0304;;;;N;LATIN CAPITAL LETTER U DIAERESIS MACRON;;;01D6; 01D6;LATIN SMALL LETTER U WITH DIAERESIS AND MACRON;Ll;0;L;00FC 0304;;;;N;LATIN SMALL LETTER U DIAERESIS MACRON;;01D5;;01D5 01D7;LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE;Lu;0;L;00DC 0301;;;;N;LATIN CAPITAL LETTER U DIAERESIS ACUTE;;;01D8; 01D8;LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE;Ll;0;L;00FC 0301;;;;N;LATIN SMALL LETTER U DIAERESIS ACUTE;;01D7;;01D7 01D9;LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON;Lu;0;L;00DC 030C;;;;N;LATIN CAPITAL LETTER U DIAERESIS HACEK;;;01DA; 01DA;LATIN SMALL LETTER U WITH DIAERESIS AND CARON;Ll;0;L;00FC 030C;;;;N;LATIN SMALL LETTER U DIAERESIS HACEK;;01D9;;01D9 01DB;LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE;Lu;0;L;00DC 0300;;;;N;LATIN CAPITAL LETTER U DIAERESIS GRAVE;;;01DC; 01DC;LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE;Ll;0;L;00FC 0300;;;;N;LATIN SMALL LETTER U DIAERESIS GRAVE;;01DB;;01DB 01DD;LATIN SMALL LETTER TURNED E;Ll;0;L;;;;;N;;;018E;;018E 01DE;LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON;Lu;0;L;00C4 0304;;;;N;LATIN CAPITAL LETTER A DIAERESIS MACRON;;;01DF; 01DF;LATIN SMALL LETTER A WITH DIAERESIS AND MACRON;Ll;0;L;00E4 0304;;;;N;LATIN SMALL LETTER A DIAERESIS MACRON;;01DE;;01DE 01E0;LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON;Lu;0;L;0226 0304;;;;N;LATIN CAPITAL LETTER A DOT MACRON;;;01E1; 01E1;LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON;Ll;0;L;0227 0304;;;;N;LATIN SMALL LETTER A DOT MACRON;;01E0;;01E0 01E2;LATIN CAPITAL LETTER AE WITH MACRON;Lu;0;L;00C6 0304;;;;N;LATIN CAPITAL LETTER A E MACRON;;;01E3; 01E3;LATIN SMALL LETTER AE WITH MACRON;Ll;0;L;00E6 0304;;;;N;LATIN SMALL LETTER A E MACRON;;01E2;;01E2 01E4;LATIN CAPITAL LETTER G WITH STROKE;Lu;0;L;;;;;N;LATIN CAPITAL LETTER G BAR;;;01E5; 01E5;LATIN SMALL LETTER G WITH STROKE;Ll;0;L;;;;;N;LATIN SMALL LETTER G BAR;;01E4;;01E4 01E6;LATIN CAPITAL LETTER G WITH CARON;Lu;0;L;0047 030C;;;;N;LATIN CAPITAL LETTER G HACEK;;;01E7; 01E7;LATIN SMALL LETTER G WITH CARON;Ll;0;L;0067 030C;;;;N;LATIN SMALL LETTER G HACEK;;01E6;;01E6 01E8;LATIN CAPITAL LETTER K WITH CARON;Lu;0;L;004B 030C;;;;N;LATIN CAPITAL LETTER K HACEK;;;01E9; 01E9;LATIN SMALL LETTER K WITH CARON;Ll;0;L;006B 030C;;;;N;LATIN SMALL LETTER K HACEK;;01E8;;01E8 01EA;LATIN CAPITAL LETTER O WITH OGONEK;Lu;0;L;004F 0328;;;;N;LATIN CAPITAL LETTER O OGONEK;;;01EB; 01EB;LATIN SMALL LETTER O WITH OGONEK;Ll;0;L;006F 0328;;;;N;LATIN SMALL LETTER O OGONEK;;01EA;;01EA 01EC;LATIN CAPITAL LETTER O WITH OGONEK AND MACRON;Lu;0;L;01EA 0304;;;;N;LATIN CAPITAL LETTER O OGONEK MACRON;;;01ED; 01ED;LATIN SMALL LETTER O WITH OGONEK AND MACRON;Ll;0;L;01EB 0304;;;;N;LATIN SMALL LETTER O OGONEK MACRON;;01EC;;01EC 01EE;LATIN CAPITAL LETTER EZH WITH CARON;Lu;0;L;01B7 030C;;;;N;LATIN CAPITAL LETTER YOGH HACEK;;;01EF; 01EF;LATIN SMALL LETTER EZH WITH CARON;Ll;0;L;0292 030C;;;;N;LATIN SMALL LETTER YOGH HACEK;;01EE;;01EE 01F0;LATIN SMALL LETTER J WITH CARON;Ll;0;L;006A 030C;;;;N;LATIN SMALL LETTER J HACEK;;;; 01F1;LATIN CAPITAL LETTER DZ;Lu;0;L; 0044 005A;;;;N;;;;01F3;01F2 01F2;LATIN CAPITAL LETTER D WITH SMALL LETTER Z;Lt;0;L; 0044 007A;;;;N;;;01F1;01F3;01F2 01F3;LATIN SMALL LETTER DZ;Ll;0;L; 0064 007A;;;;N;;;01F1;;01F2 01F4;LATIN CAPITAL LETTER G WITH ACUTE;Lu;0;L;0047 0301;;;;N;;;;01F5; 01F5;LATIN SMALL LETTER G WITH ACUTE;Ll;0;L;0067 0301;;;;N;;;01F4;;01F4 01F6;LATIN CAPITAL LETTER HWAIR;Lu;0;L;;;;;N;;;;0195; 01F7;LATIN CAPITAL LETTER WYNN;Lu;0;L;;;;;N;;;;01BF; 01F8;LATIN CAPITAL LETTER N WITH GRAVE;Lu;0;L;004E 0300;;;;N;;;;01F9; 01F9;LATIN SMALL LETTER N WITH GRAVE;Ll;0;L;006E 0300;;;;N;;;01F8;;01F8 01FA;LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE;Lu;0;L;00C5 0301;;;;N;;;;01FB; 01FB;LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE;Ll;0;L;00E5 0301;;;;N;;;01FA;;01FA 01FC;LATIN CAPITAL LETTER AE WITH ACUTE;Lu;0;L;00C6 0301;;;;N;;;;01FD; 01FD;LATIN SMALL LETTER AE WITH ACUTE;Ll;0;L;00E6 0301;;;;N;;;01FC;;01FC 01FE;LATIN CAPITAL LETTER O WITH STROKE AND ACUTE;Lu;0;L;00D8 0301;;;;N;;;;01FF; 01FF;LATIN SMALL LETTER O WITH STROKE AND ACUTE;Ll;0;L;00F8 0301;;;;N;;;01FE;;01FE 0200;LATIN CAPITAL LETTER A WITH DOUBLE GRAVE;Lu;0;L;0041 030F;;;;N;;;;0201; 0201;LATIN SMALL LETTER A WITH DOUBLE GRAVE;Ll;0;L;0061 030F;;;;N;;;0200;;0200 0202;LATIN CAPITAL LETTER A WITH INVERTED BREVE;Lu;0;L;0041 0311;;;;N;;;;0203; 0203;LATIN SMALL LETTER A WITH INVERTED BREVE;Ll;0;L;0061 0311;;;;N;;;0202;;0202 0204;LATIN CAPITAL LETTER E WITH DOUBLE GRAVE;Lu;0;L;0045 030F;;;;N;;;;0205; 0205;LATIN SMALL LETTER E WITH DOUBLE GRAVE;Ll;0;L;0065 030F;;;;N;;;0204;;0204 0206;LATIN CAPITAL LETTER E WITH INVERTED BREVE;Lu;0;L;0045 0311;;;;N;;;;0207; 0207;LATIN SMALL LETTER E WITH INVERTED BREVE;Ll;0;L;0065 0311;;;;N;;;0206;;0206 0208;LATIN CAPITAL LETTER I WITH DOUBLE GRAVE;Lu;0;L;0049 030F;;;;N;;;;0209; 0209;LATIN SMALL LETTER I WITH DOUBLE GRAVE;Ll;0;L;0069 030F;;;;N;;;0208;;0208 020A;LATIN CAPITAL LETTER I WITH INVERTED BREVE;Lu;0;L;0049 0311;;;;N;;;;020B; 020B;LATIN SMALL LETTER I WITH INVERTED BREVE;Ll;0;L;0069 0311;;;;N;;;020A;;020A 020C;LATIN CAPITAL LETTER O WITH DOUBLE GRAVE;Lu;0;L;004F 030F;;;;N;;;;020D; 020D;LATIN SMALL LETTER O WITH DOUBLE GRAVE;Ll;0;L;006F 030F;;;;N;;;020C;;020C 020E;LATIN CAPITAL LETTER O WITH INVERTED BREVE;Lu;0;L;004F 0311;;;;N;;;;020F; 020F;LATIN SMALL LETTER O WITH INVERTED BREVE;Ll;0;L;006F 0311;;;;N;;;020E;;020E 0210;LATIN CAPITAL LETTER R WITH DOUBLE GRAVE;Lu;0;L;0052 030F;;;;N;;;;0211; 0211;LATIN SMALL LETTER R WITH DOUBLE GRAVE;Ll;0;L;0072 030F;;;;N;;;0210;;0210 0212;LATIN CAPITAL LETTER R WITH INVERTED BREVE;Lu;0;L;0052 0311;;;;N;;;;0213; 0213;LATIN SMALL LETTER R WITH INVERTED BREVE;Ll;0;L;0072 0311;;;;N;;;0212;;0212 0214;LATIN CAPITAL LETTER U WITH DOUBLE GRAVE;Lu;0;L;0055 030F;;;;N;;;;0215; 0215;LATIN SMALL LETTER U WITH DOUBLE GRAVE;Ll;0;L;0075 030F;;;;N;;;0214;;0214 0216;LATIN CAPITAL LETTER U WITH INVERTED BREVE;Lu;0;L;0055 0311;;;;N;;;;0217; 0217;LATIN SMALL LETTER U WITH INVERTED BREVE;Ll;0;L;0075 0311;;;;N;;;0216;;0216 0218;LATIN CAPITAL LETTER S WITH COMMA BELOW;Lu;0;L;0053 0326;;;;N;;;;0219; 0219;LATIN SMALL LETTER S WITH COMMA BELOW;Ll;0;L;0073 0326;;;;N;;;0218;;0218 021A;LATIN CAPITAL LETTER T WITH COMMA BELOW;Lu;0;L;0054 0326;;;;N;;;;021B; 021B;LATIN SMALL LETTER T WITH COMMA BELOW;Ll;0;L;0074 0326;;;;N;;;021A;;021A 021C;LATIN CAPITAL LETTER YOGH;Lu;0;L;;;;;N;;;;021D; 021D;LATIN SMALL LETTER YOGH;Ll;0;L;;;;;N;;;021C;;021C 021E;LATIN CAPITAL LETTER H WITH CARON;Lu;0;L;0048 030C;;;;N;;;;021F; 021F;LATIN SMALL LETTER H WITH CARON;Ll;0;L;0068 030C;;;;N;;;021E;;021E 0220;LATIN CAPITAL LETTER N WITH LONG RIGHT LEG;Lu;0;L;;;;;N;;;;019E; 0221;LATIN SMALL LETTER D WITH CURL;Ll;0;L;;;;;N;;;;; 0222;LATIN CAPITAL LETTER OU;Lu;0;L;;;;;N;;;;0223; 0223;LATIN SMALL LETTER OU;Ll;0;L;;;;;N;;;0222;;0222 0224;LATIN CAPITAL LETTER Z WITH HOOK;Lu;0;L;;;;;N;;;;0225; 0225;LATIN SMALL LETTER Z WITH HOOK;Ll;0;L;;;;;N;;;0224;;0224 0226;LATIN CAPITAL LETTER A WITH DOT ABOVE;Lu;0;L;0041 0307;;;;N;;;;0227; 0227;LATIN SMALL LETTER A WITH DOT ABOVE;Ll;0;L;0061 0307;;;;N;;;0226;;0226 0228;LATIN CAPITAL LETTER E WITH CEDILLA;Lu;0;L;0045 0327;;;;N;;;;0229; 0229;LATIN SMALL LETTER E WITH CEDILLA;Ll;0;L;0065 0327;;;;N;;;0228;;0228 022A;LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON;Lu;0;L;00D6 0304;;;;N;;;;022B; 022B;LATIN SMALL LETTER O WITH DIAERESIS AND MACRON;Ll;0;L;00F6 0304;;;;N;;;022A;;022A 022C;LATIN CAPITAL LETTER O WITH TILDE AND MACRON;Lu;0;L;00D5 0304;;;;N;;;;022D; 022D;LATIN SMALL LETTER O WITH TILDE AND MACRON;Ll;0;L;00F5 0304;;;;N;;;022C;;022C 022E;LATIN CAPITAL LETTER O WITH DOT ABOVE;Lu;0;L;004F 0307;;;;N;;;;022F; 022F;LATIN SMALL LETTER O WITH DOT ABOVE;Ll;0;L;006F 0307;;;;N;;;022E;;022E 0230;LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON;Lu;0;L;022E 0304;;;;N;;;;0231; 0231;LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON;Ll;0;L;022F 0304;;;;N;;;0230;;0230 0232;LATIN CAPITAL LETTER Y WITH MACRON;Lu;0;L;0059 0304;;;;N;;;;0233; 0233;LATIN SMALL LETTER Y WITH MACRON;Ll;0;L;0079 0304;;;;N;;;0232;;0232 0234;LATIN SMALL LETTER L WITH CURL;Ll;0;L;;;;;N;;;;; 0235;LATIN SMALL LETTER N WITH CURL;Ll;0;L;;;;;N;;;;; 0236;LATIN SMALL LETTER T WITH CURL;Ll;0;L;;;;;N;;;;; 0237;LATIN SMALL LETTER DOTLESS J;Ll;0;L;;;;;N;;;;; 0238;LATIN SMALL LETTER DB DIGRAPH;Ll;0;L;;;;;N;;;;; 0239;LATIN SMALL LETTER QP DIGRAPH;Ll;0;L;;;;;N;;;;; 023A;LATIN CAPITAL LETTER A WITH STROKE;Lu;0;L;;;;;N;;;;2C65; 023B;LATIN CAPITAL LETTER C WITH STROKE;Lu;0;L;;;;;N;;;;023C; 023C;LATIN SMALL LETTER C WITH STROKE;Ll;0;L;;;;;N;;;023B;;023B 023D;LATIN CAPITAL LETTER L WITH BAR;Lu;0;L;;;;;N;;;;019A; 023E;LATIN CAPITAL LETTER T WITH DIAGONAL STROKE;Lu;0;L;;;;;N;;;;2C66; 023F;LATIN SMALL LETTER S WITH SWASH TAIL;Ll;0;L;;;;;N;;;2C7E;;2C7E 0240;LATIN SMALL LETTER Z WITH SWASH TAIL;Ll;0;L;;;;;N;;;2C7F;;2C7F 0241;LATIN CAPITAL LETTER GLOTTAL STOP;Lu;0;L;;;;;N;;;;0242; 0242;LATIN SMALL LETTER GLOTTAL STOP;Ll;0;L;;;;;N;;;0241;;0241 0243;LATIN CAPITAL LETTER B WITH STROKE;Lu;0;L;;;;;N;;;;0180; 0244;LATIN CAPITAL LETTER U BAR;Lu;0;L;;;;;N;;;;0289; 0245;LATIN CAPITAL LETTER TURNED V;Lu;0;L;;;;;N;;;;028C; 0246;LATIN CAPITAL LETTER E WITH STROKE;Lu;0;L;;;;;N;;;;0247; 0247;LATIN SMALL LETTER E WITH STROKE;Ll;0;L;;;;;N;;;0246;;0246 0248;LATIN CAPITAL LETTER J WITH STROKE;Lu;0;L;;;;;N;;;;0249; 0249;LATIN SMALL LETTER J WITH STROKE;Ll;0;L;;;;;N;;;0248;;0248 024A;LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL;Lu;0;L;;;;;N;;;;024B; 024B;LATIN SMALL LETTER Q WITH HOOK TAIL;Ll;0;L;;;;;N;;;024A;;024A 024C;LATIN CAPITAL LETTER R WITH STROKE;Lu;0;L;;;;;N;;;;024D; 024D;LATIN SMALL LETTER R WITH STROKE;Ll;0;L;;;;;N;;;024C;;024C 024E;LATIN CAPITAL LETTER Y WITH STROKE;Lu;0;L;;;;;N;;;;024F; 024F;LATIN SMALL LETTER Y WITH STROKE;Ll;0;L;;;;;N;;;024E;;024E 0250;LATIN SMALL LETTER TURNED A;Ll;0;L;;;;;N;;;2C6F;;2C6F 0251;LATIN SMALL LETTER ALPHA;Ll;0;L;;;;;N;LATIN SMALL LETTER SCRIPT A;;2C6D;;2C6D 0252;LATIN SMALL LETTER TURNED ALPHA;Ll;0;L;;;;;N;LATIN SMALL LETTER TURNED SCRIPT A;;2C70;;2C70 0253;LATIN SMALL LETTER B WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER B HOOK;;0181;;0181 0254;LATIN SMALL LETTER OPEN O;Ll;0;L;;;;;N;;;0186;;0186 0255;LATIN SMALL LETTER C WITH CURL;Ll;0;L;;;;;N;LATIN SMALL LETTER C CURL;;;; 0256;LATIN SMALL LETTER D WITH TAIL;Ll;0;L;;;;;N;LATIN SMALL LETTER D RETROFLEX HOOK;;0189;;0189 0257;LATIN SMALL LETTER D WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER D HOOK;;018A;;018A 0258;LATIN SMALL LETTER REVERSED E;Ll;0;L;;;;;N;;;;; 0259;LATIN SMALL LETTER SCHWA;Ll;0;L;;;;;N;;;018F;;018F 025A;LATIN SMALL LETTER SCHWA WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER SCHWA HOOK;;;; 025B;LATIN SMALL LETTER OPEN E;Ll;0;L;;;;;N;LATIN SMALL LETTER EPSILON;;0190;;0190 025C;LATIN SMALL LETTER REVERSED OPEN E;Ll;0;L;;;;;N;LATIN SMALL LETTER REVERSED EPSILON;;;; 025D;LATIN SMALL LETTER REVERSED OPEN E WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER REVERSED EPSILON HOOK;;;; 025E;LATIN SMALL LETTER CLOSED REVERSED OPEN E;Ll;0;L;;;;;N;LATIN SMALL LETTER CLOSED REVERSED EPSILON;;;; 025F;LATIN SMALL LETTER DOTLESS J WITH STROKE;Ll;0;L;;;;;N;LATIN SMALL LETTER DOTLESS J BAR;;;; 0260;LATIN SMALL LETTER G WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER G HOOK;;0193;;0193 0261;LATIN SMALL LETTER SCRIPT G;Ll;0;L;;;;;N;;;;; 0262;LATIN LETTER SMALL CAPITAL G;Ll;0;L;;;;;N;;;;; 0263;LATIN SMALL LETTER GAMMA;Ll;0;L;;;;;N;;;0194;;0194 0264;LATIN SMALL LETTER RAMS HORN;Ll;0;L;;;;;N;LATIN SMALL LETTER BABY GAMMA;;;; 0265;LATIN SMALL LETTER TURNED H;Ll;0;L;;;;;N;;;A78D;;A78D 0266;LATIN SMALL LETTER H WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER H HOOK;;A7AA;;A7AA 0267;LATIN SMALL LETTER HENG WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER HENG HOOK;;;; 0268;LATIN SMALL LETTER I WITH STROKE;Ll;0;L;;;;;N;LATIN SMALL LETTER BARRED I;;0197;;0197 0269;LATIN SMALL LETTER IOTA;Ll;0;L;;;;;N;;;0196;;0196 026A;LATIN LETTER SMALL CAPITAL I;Ll;0;L;;;;;N;;;;; 026B;LATIN SMALL LETTER L WITH MIDDLE TILDE;Ll;0;L;;;;;N;;;2C62;;2C62 026C;LATIN SMALL LETTER L WITH BELT;Ll;0;L;;;;;N;LATIN SMALL LETTER L BELT;;;; 026D;LATIN SMALL LETTER L WITH RETROFLEX HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER L RETROFLEX HOOK;;;; 026E;LATIN SMALL LETTER LEZH;Ll;0;L;;;;;N;LATIN SMALL LETTER L YOGH;;;; 026F;LATIN SMALL LETTER TURNED M;Ll;0;L;;;;;N;;;019C;;019C 0270;LATIN SMALL LETTER TURNED M WITH LONG LEG;Ll;0;L;;;;;N;;;;; 0271;LATIN SMALL LETTER M WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER M HOOK;;2C6E;;2C6E 0272;LATIN SMALL LETTER N WITH LEFT HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER N HOOK;;019D;;019D 0273;LATIN SMALL LETTER N WITH RETROFLEX HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER N RETROFLEX HOOK;;;; 0274;LATIN LETTER SMALL CAPITAL N;Ll;0;L;;;;;N;;;;; 0275;LATIN SMALL LETTER BARRED O;Ll;0;L;;;;;N;;;019F;;019F 0276;LATIN LETTER SMALL CAPITAL OE;Ll;0;L;;;;;N;LATIN LETTER SMALL CAPITAL O E;;;; 0277;LATIN SMALL LETTER CLOSED OMEGA;Ll;0;L;;;;;N;;;;; 0278;LATIN SMALL LETTER PHI;Ll;0;L;;;;;N;;;;; 0279;LATIN SMALL LETTER TURNED R;Ll;0;L;;;;;N;;;;; 027A;LATIN SMALL LETTER TURNED R WITH LONG LEG;Ll;0;L;;;;;N;;;;; 027B;LATIN SMALL LETTER TURNED R WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER TURNED R HOOK;;;; 027C;LATIN SMALL LETTER R WITH LONG LEG;Ll;0;L;;;;;N;;;;; 027D;LATIN SMALL LETTER R WITH TAIL;Ll;0;L;;;;;N;LATIN SMALL LETTER R HOOK;;2C64;;2C64 027E;LATIN SMALL LETTER R WITH FISHHOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER FISHHOOK R;;;; 027F;LATIN SMALL LETTER REVERSED R WITH FISHHOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER REVERSED FISHHOOK R;;;; 0280;LATIN LETTER SMALL CAPITAL R;Ll;0;L;;;;;N;;;01A6;;01A6 0281;LATIN LETTER SMALL CAPITAL INVERTED R;Ll;0;L;;;;;N;;;;; 0282;LATIN SMALL LETTER S WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER S HOOK;;;; 0283;LATIN SMALL LETTER ESH;Ll;0;L;;;;;N;;;01A9;;01A9 0284;LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER DOTLESS J BAR HOOK;;;; 0285;LATIN SMALL LETTER SQUAT REVERSED ESH;Ll;0;L;;;;;N;;;;; 0286;LATIN SMALL LETTER ESH WITH CURL;Ll;0;L;;;;;N;LATIN SMALL LETTER ESH CURL;;;; 0287;LATIN SMALL LETTER TURNED T;Ll;0;L;;;;;N;;;;; 0288;LATIN SMALL LETTER T WITH RETROFLEX HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER T RETROFLEX HOOK;;01AE;;01AE 0289;LATIN SMALL LETTER U BAR;Ll;0;L;;;;;N;;;0244;;0244 028A;LATIN SMALL LETTER UPSILON;Ll;0;L;;;;;N;;;01B1;;01B1 028B;LATIN SMALL LETTER V WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER SCRIPT V;;01B2;;01B2 028C;LATIN SMALL LETTER TURNED V;Ll;0;L;;;;;N;;;0245;;0245 028D;LATIN SMALL LETTER TURNED W;Ll;0;L;;;;;N;;;;; 028E;LATIN SMALL LETTER TURNED Y;Ll;0;L;;;;;N;;;;; 028F;LATIN LETTER SMALL CAPITAL Y;Ll;0;L;;;;;N;;;;; 0290;LATIN SMALL LETTER Z WITH RETROFLEX HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER Z RETROFLEX HOOK;;;; 0291;LATIN SMALL LETTER Z WITH CURL;Ll;0;L;;;;;N;LATIN SMALL LETTER Z CURL;;;; 0292;LATIN SMALL LETTER EZH;Ll;0;L;;;;;N;LATIN SMALL LETTER YOGH;;01B7;;01B7 0293;LATIN SMALL LETTER EZH WITH CURL;Ll;0;L;;;;;N;LATIN SMALL LETTER YOGH CURL;;;; 0294;LATIN LETTER GLOTTAL STOP;Lo;0;L;;;;;N;;;;; 0295;LATIN LETTER PHARYNGEAL VOICED FRICATIVE;Ll;0;L;;;;;N;LATIN LETTER REVERSED GLOTTAL STOP;;;; 0296;LATIN LETTER INVERTED GLOTTAL STOP;Ll;0;L;;;;;N;;;;; 0297;LATIN LETTER STRETCHED C;Ll;0;L;;;;;N;;;;; 0298;LATIN LETTER BILABIAL CLICK;Ll;0;L;;;;;N;LATIN LETTER BULLSEYE;;;; 0299;LATIN LETTER SMALL CAPITAL B;Ll;0;L;;;;;N;;;;; 029A;LATIN SMALL LETTER CLOSED OPEN E;Ll;0;L;;;;;N;LATIN SMALL LETTER CLOSED EPSILON;;;; 029B;LATIN LETTER SMALL CAPITAL G WITH HOOK;Ll;0;L;;;;;N;LATIN LETTER SMALL CAPITAL G HOOK;;;; 029C;LATIN LETTER SMALL CAPITAL H;Ll;0;L;;;;;N;;;;; 029D;LATIN SMALL LETTER J WITH CROSSED-TAIL;Ll;0;L;;;;;N;LATIN SMALL LETTER CROSSED-TAIL J;;;; 029E;LATIN SMALL LETTER TURNED K;Ll;0;L;;;;;N;;;;; 029F;LATIN LETTER SMALL CAPITAL L;Ll;0;L;;;;;N;;;;; 02A0;LATIN SMALL LETTER Q WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER Q HOOK;;;; 02A1;LATIN LETTER GLOTTAL STOP WITH STROKE;Ll;0;L;;;;;N;LATIN LETTER GLOTTAL STOP BAR;;;; 02A2;LATIN LETTER REVERSED GLOTTAL STOP WITH STROKE;Ll;0;L;;;;;N;LATIN LETTER REVERSED GLOTTAL STOP BAR;;;; 02A3;LATIN SMALL LETTER DZ DIGRAPH;Ll;0;L;;;;;N;LATIN SMALL LETTER D Z;;;; 02A4;LATIN SMALL LETTER DEZH DIGRAPH;Ll;0;L;;;;;N;LATIN SMALL LETTER D YOGH;;;; 02A5;LATIN SMALL LETTER DZ DIGRAPH WITH CURL;Ll;0;L;;;;;N;LATIN SMALL LETTER D Z CURL;;;; 02A6;LATIN SMALL LETTER TS DIGRAPH;Ll;0;L;;;;;N;LATIN SMALL LETTER T S;;;; 02A7;LATIN SMALL LETTER TESH DIGRAPH;Ll;0;L;;;;;N;LATIN SMALL LETTER T ESH;;;; 02A8;LATIN SMALL LETTER TC DIGRAPH WITH CURL;Ll;0;L;;;;;N;LATIN SMALL LETTER T C CURL;;;; 02A9;LATIN SMALL LETTER FENG DIGRAPH;Ll;0;L;;;;;N;;;;; 02AA;LATIN SMALL LETTER LS DIGRAPH;Ll;0;L;;;;;N;;;;; 02AB;LATIN SMALL LETTER LZ DIGRAPH;Ll;0;L;;;;;N;;;;; 02AC;LATIN LETTER BILABIAL PERCUSSIVE;Ll;0;L;;;;;N;;;;; 02AD;LATIN LETTER BIDENTAL PERCUSSIVE;Ll;0;L;;;;;N;;;;; 02AE;LATIN SMALL LETTER TURNED H WITH FISHHOOK;Ll;0;L;;;;;N;;;;; 02AF;LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL;Ll;0;L;;;;;N;;;;; 02B0;MODIFIER LETTER SMALL H;Lm;0;L; 0068;;;;N;;;;; 02B1;MODIFIER LETTER SMALL H WITH HOOK;Lm;0;L; 0266;;;;N;MODIFIER LETTER SMALL H HOOK;;;; 02B2;MODIFIER LETTER SMALL J;Lm;0;L; 006A;;;;N;;;;; 02B3;MODIFIER LETTER SMALL R;Lm;0;L; 0072;;;;N;;;;; 02B4;MODIFIER LETTER SMALL TURNED R;Lm;0;L; 0279;;;;N;;;;; 02B5;MODIFIER LETTER SMALL TURNED R WITH HOOK;Lm;0;L; 027B;;;;N;MODIFIER LETTER SMALL TURNED R HOOK;;;; 02B6;MODIFIER LETTER SMALL CAPITAL INVERTED R;Lm;0;L; 0281;;;;N;;;;; 02B7;MODIFIER LETTER SMALL W;Lm;0;L; 0077;;;;N;;;;; 02B8;MODIFIER LETTER SMALL Y;Lm;0;L; 0079;;;;N;;;;; 02B9;MODIFIER LETTER PRIME;Lm;0;ON;;;;;N;;;;; 02BA;MODIFIER LETTER DOUBLE PRIME;Lm;0;ON;;;;;N;;;;; 02BB;MODIFIER LETTER TURNED COMMA;Lm;0;L;;;;;N;;;;; 02BC;MODIFIER LETTER APOSTROPHE;Lm;0;L;;;;;N;;;;; 02BD;MODIFIER LETTER REVERSED COMMA;Lm;0;L;;;;;N;;;;; 02BE;MODIFIER LETTER RIGHT HALF RING;Lm;0;L;;;;;N;;;;; 02BF;MODIFIER LETTER LEFT HALF RING;Lm;0;L;;;;;N;;;;; 02C0;MODIFIER LETTER GLOTTAL STOP;Lm;0;L;;;;;N;;;;; 02C1;MODIFIER LETTER REVERSED GLOTTAL STOP;Lm;0;L;;;;;N;;;;; 02C2;MODIFIER LETTER LEFT ARROWHEAD;Sk;0;ON;;;;;N;;;;; 02C3;MODIFIER LETTER RIGHT ARROWHEAD;Sk;0;ON;;;;;N;;;;; 02C4;MODIFIER LETTER UP ARROWHEAD;Sk;0;ON;;;;;N;;;;; 02C5;MODIFIER LETTER DOWN ARROWHEAD;Sk;0;ON;;;;;N;;;;; 02C6;MODIFIER LETTER CIRCUMFLEX ACCENT;Lm;0;ON;;;;;N;MODIFIER LETTER CIRCUMFLEX;;;; 02C7;CARON;Lm;0;ON;;;;;N;MODIFIER LETTER HACEK;;;; 02C8;MODIFIER LETTER VERTICAL LINE;Lm;0;ON;;;;;N;;;;; 02C9;MODIFIER LETTER MACRON;Lm;0;ON;;;;;N;;;;; 02CA;MODIFIER LETTER ACUTE ACCENT;Lm;0;ON;;;;;N;MODIFIER LETTER ACUTE;;;; 02CB;MODIFIER LETTER GRAVE ACCENT;Lm;0;ON;;;;;N;MODIFIER LETTER GRAVE;;;; 02CC;MODIFIER LETTER LOW VERTICAL LINE;Lm;0;ON;;;;;N;;;;; 02CD;MODIFIER LETTER LOW MACRON;Lm;0;ON;;;;;N;;;;; 02CE;MODIFIER LETTER LOW GRAVE ACCENT;Lm;0;ON;;;;;N;MODIFIER LETTER LOW GRAVE;;;; 02CF;MODIFIER LETTER LOW ACUTE ACCENT;Lm;0;ON;;;;;N;MODIFIER LETTER LOW ACUTE;;;; 02D0;MODIFIER LETTER TRIANGULAR COLON;Lm;0;L;;;;;N;;;;; 02D1;MODIFIER LETTER HALF TRIANGULAR COLON;Lm;0;L;;;;;N;;;;; 02D2;MODIFIER LETTER CENTRED RIGHT HALF RING;Sk;0;ON;;;;;N;MODIFIER LETTER CENTERED RIGHT HALF RING;;;; 02D3;MODIFIER LETTER CENTRED LEFT HALF RING;Sk;0;ON;;;;;N;MODIFIER LETTER CENTERED LEFT HALF RING;;;; 02D4;MODIFIER LETTER UP TACK;Sk;0;ON;;;;;N;;;;; 02D5;MODIFIER LETTER DOWN TACK;Sk;0;ON;;;;;N;;;;; 02D6;MODIFIER LETTER PLUS SIGN;Sk;0;ON;;;;;N;;;;; 02D7;MODIFIER LETTER MINUS SIGN;Sk;0;ON;;;;;N;;;;; 02D8;BREVE;Sk;0;ON; 0020 0306;;;;N;SPACING BREVE;;;; 02D9;DOT ABOVE;Sk;0;ON; 0020 0307;;;;N;SPACING DOT ABOVE;;;; 02DA;RING ABOVE;Sk;0;ON; 0020 030A;;;;N;SPACING RING ABOVE;;;; 02DB;OGONEK;Sk;0;ON; 0020 0328;;;;N;SPACING OGONEK;;;; 02DC;SMALL TILDE;Sk;0;ON; 0020 0303;;;;N;SPACING TILDE;;;; 02DD;DOUBLE ACUTE ACCENT;Sk;0;ON; 0020 030B;;;;N;SPACING DOUBLE ACUTE;;;; 02DE;MODIFIER LETTER RHOTIC HOOK;Sk;0;ON;;;;;N;;;;; 02DF;MODIFIER LETTER CROSS ACCENT;Sk;0;ON;;;;;N;;;;; 02E0;MODIFIER LETTER SMALL GAMMA;Lm;0;L; 0263;;;;N;;;;; 02E1;MODIFIER LETTER SMALL L;Lm;0;L; 006C;;;;N;;;;; 02E2;MODIFIER LETTER SMALL S;Lm;0;L; 0073;;;;N;;;;; 02E3;MODIFIER LETTER SMALL X;Lm;0;L; 0078;;;;N;;;;; 02E4;MODIFIER LETTER SMALL REVERSED GLOTTAL STOP;Lm;0;L; 0295;;;;N;;;;; 02E5;MODIFIER LETTER EXTRA-HIGH TONE BAR;Sk;0;ON;;;;;N;;;;; 02E6;MODIFIER LETTER HIGH TONE BAR;Sk;0;ON;;;;;N;;;;; 02E7;MODIFIER LETTER MID TONE BAR;Sk;0;ON;;;;;N;;;;; 02E8;MODIFIER LETTER LOW TONE BAR;Sk;0;ON;;;;;N;;;;; 02E9;MODIFIER LETTER EXTRA-LOW TONE BAR;Sk;0;ON;;;;;N;;;;; 02EA;MODIFIER LETTER YIN DEPARTING TONE MARK;Sk;0;ON;;;;;N;;;;; 02EB;MODIFIER LETTER YANG DEPARTING TONE MARK;Sk;0;ON;;;;;N;;;;; 02EC;MODIFIER LETTER VOICING;Lm;0;ON;;;;;N;;;;; 02ED;MODIFIER LETTER UNASPIRATED;Sk;0;ON;;;;;N;;;;; 02EE;MODIFIER LETTER DOUBLE APOSTROPHE;Lm;0;L;;;;;N;;;;; 02EF;MODIFIER LETTER LOW DOWN ARROWHEAD;Sk;0;ON;;;;;N;;;;; 02F0;MODIFIER LETTER LOW UP ARROWHEAD;Sk;0;ON;;;;;N;;;;; 02F1;MODIFIER LETTER LOW LEFT ARROWHEAD;Sk;0;ON;;;;;N;;;;; 02F2;MODIFIER LETTER LOW RIGHT ARROWHEAD;Sk;0;ON;;;;;N;;;;; 02F3;MODIFIER LETTER LOW RING;Sk;0;ON;;;;;N;;;;; 02F4;MODIFIER LETTER MIDDLE GRAVE ACCENT;Sk;0;ON;;;;;N;;;;; 02F5;MODIFIER LETTER MIDDLE DOUBLE GRAVE ACCENT;Sk;0;ON;;;;;N;;;;; 02F6;MODIFIER LETTER MIDDLE DOUBLE ACUTE ACCENT;Sk;0;ON;;;;;N;;;;; 02F7;MODIFIER LETTER LOW TILDE;Sk;0;ON;;;;;N;;;;; 02F8;MODIFIER LETTER RAISED COLON;Sk;0;ON;;;;;N;;;;; 02F9;MODIFIER LETTER BEGIN HIGH TONE;Sk;0;ON;;;;;N;;;;; 02FA;MODIFIER LETTER END HIGH TONE;Sk;0;ON;;;;;N;;;;; 02FB;MODIFIER LETTER BEGIN LOW TONE;Sk;0;ON;;;;;N;;;;; 02FC;MODIFIER LETTER END LOW TONE;Sk;0;ON;;;;;N;;;;; 02FD;MODIFIER LETTER SHELF;Sk;0;ON;;;;;N;;;;; 02FE;MODIFIER LETTER OPEN SHELF;Sk;0;ON;;;;;N;;;;; 02FF;MODIFIER LETTER LOW LEFT ARROW;Sk;0;ON;;;;;N;;;;; 0300;COMBINING GRAVE ACCENT;Mn;230;NSM;;;;;N;NON-SPACING GRAVE;;;; 0301;COMBINING ACUTE ACCENT;Mn;230;NSM;;;;;N;NON-SPACING ACUTE;;;; 0302;COMBINING CIRCUMFLEX ACCENT;Mn;230;NSM;;;;;N;NON-SPACING CIRCUMFLEX;;;; 0303;COMBINING TILDE;Mn;230;NSM;;;;;N;NON-SPACING TILDE;;;; 0304;COMBINING MACRON;Mn;230;NSM;;;;;N;NON-SPACING MACRON;;;; 0305;COMBINING OVERLINE;Mn;230;NSM;;;;;N;NON-SPACING OVERSCORE;;;; 0306;COMBINING BREVE;Mn;230;NSM;;;;;N;NON-SPACING BREVE;;;; 0307;COMBINING DOT ABOVE;Mn;230;NSM;;;;;N;NON-SPACING DOT ABOVE;;;; 0308;COMBINING DIAERESIS;Mn;230;NSM;;;;;N;NON-SPACING DIAERESIS;;;; 0309;COMBINING HOOK ABOVE;Mn;230;NSM;;;;;N;NON-SPACING HOOK ABOVE;;;; 030A;COMBINING RING ABOVE;Mn;230;NSM;;;;;N;NON-SPACING RING ABOVE;;;; 030B;COMBINING DOUBLE ACUTE ACCENT;Mn;230;NSM;;;;;N;NON-SPACING DOUBLE ACUTE;;;; 030C;COMBINING CARON;Mn;230;NSM;;;;;N;NON-SPACING HACEK;;;; 030D;COMBINING VERTICAL LINE ABOVE;Mn;230;NSM;;;;;N;NON-SPACING VERTICAL LINE ABOVE;;;; 030E;COMBINING DOUBLE VERTICAL LINE ABOVE;Mn;230;NSM;;;;;N;NON-SPACING DOUBLE VERTICAL LINE ABOVE;;;; 030F;COMBINING DOUBLE GRAVE ACCENT;Mn;230;NSM;;;;;N;NON-SPACING DOUBLE GRAVE;;;; 0310;COMBINING CANDRABINDU;Mn;230;NSM;;;;;N;NON-SPACING CANDRABINDU;;;; 0311;COMBINING INVERTED BREVE;Mn;230;NSM;;;;;N;NON-SPACING INVERTED BREVE;;;; 0312;COMBINING TURNED COMMA ABOVE;Mn;230;NSM;;;;;N;NON-SPACING TURNED COMMA ABOVE;;;; 0313;COMBINING COMMA ABOVE;Mn;230;NSM;;;;;N;NON-SPACING COMMA ABOVE;;;; 0314;COMBINING REVERSED COMMA ABOVE;Mn;230;NSM;;;;;N;NON-SPACING REVERSED COMMA ABOVE;;;; 0315;COMBINING COMMA ABOVE RIGHT;Mn;232;NSM;;;;;N;NON-SPACING COMMA ABOVE RIGHT;;;; 0316;COMBINING GRAVE ACCENT BELOW;Mn;220;NSM;;;;;N;NON-SPACING GRAVE BELOW;;;; 0317;COMBINING ACUTE ACCENT BELOW;Mn;220;NSM;;;;;N;NON-SPACING ACUTE BELOW;;;; 0318;COMBINING LEFT TACK BELOW;Mn;220;NSM;;;;;N;NON-SPACING LEFT TACK BELOW;;;; 0319;COMBINING RIGHT TACK BELOW;Mn;220;NSM;;;;;N;NON-SPACING RIGHT TACK BELOW;;;; 031A;COMBINING LEFT ANGLE ABOVE;Mn;232;NSM;;;;;N;NON-SPACING LEFT ANGLE ABOVE;;;; 031B;COMBINING HORN;Mn;216;NSM;;;;;N;NON-SPACING HORN;;;; 031C;COMBINING LEFT HALF RING BELOW;Mn;220;NSM;;;;;N;NON-SPACING LEFT HALF RING BELOW;;;; 031D;COMBINING UP TACK BELOW;Mn;220;NSM;;;;;N;NON-SPACING UP TACK BELOW;;;; 031E;COMBINING DOWN TACK BELOW;Mn;220;NSM;;;;;N;NON-SPACING DOWN TACK BELOW;;;; 031F;COMBINING PLUS SIGN BELOW;Mn;220;NSM;;;;;N;NON-SPACING PLUS SIGN BELOW;;;; 0320;COMBINING MINUS SIGN BELOW;Mn;220;NSM;;;;;N;NON-SPACING MINUS SIGN BELOW;;;; 0321;COMBINING PALATALIZED HOOK BELOW;Mn;202;NSM;;;;;N;NON-SPACING PALATALIZED HOOK BELOW;;;; 0322;COMBINING RETROFLEX HOOK BELOW;Mn;202;NSM;;;;;N;NON-SPACING RETROFLEX HOOK BELOW;;;; 0323;COMBINING DOT BELOW;Mn;220;NSM;;;;;N;NON-SPACING DOT BELOW;;;; 0324;COMBINING DIAERESIS BELOW;Mn;220;NSM;;;;;N;NON-SPACING DOUBLE DOT BELOW;;;; 0325;COMBINING RING BELOW;Mn;220;NSM;;;;;N;NON-SPACING RING BELOW;;;; 0326;COMBINING COMMA BELOW;Mn;220;NSM;;;;;N;NON-SPACING COMMA BELOW;;;; 0327;COMBINING CEDILLA;Mn;202;NSM;;;;;N;NON-SPACING CEDILLA;;;; 0328;COMBINING OGONEK;Mn;202;NSM;;;;;N;NON-SPACING OGONEK;;;; 0329;COMBINING VERTICAL LINE BELOW;Mn;220;NSM;;;;;N;NON-SPACING VERTICAL LINE BELOW;;;; 032A;COMBINING BRIDGE BELOW;Mn;220;NSM;;;;;N;NON-SPACING BRIDGE BELOW;;;; 032B;COMBINING INVERTED DOUBLE ARCH BELOW;Mn;220;NSM;;;;;N;NON-SPACING INVERTED DOUBLE ARCH BELOW;;;; 032C;COMBINING CARON BELOW;Mn;220;NSM;;;;;N;NON-SPACING HACEK BELOW;;;; 032D;COMBINING CIRCUMFLEX ACCENT BELOW;Mn;220;NSM;;;;;N;NON-SPACING CIRCUMFLEX BELOW;;;; 032E;COMBINING BREVE BELOW;Mn;220;NSM;;;;;N;NON-SPACING BREVE BELOW;;;; 032F;COMBINING INVERTED BREVE BELOW;Mn;220;NSM;;;;;N;NON-SPACING INVERTED BREVE BELOW;;;; 0330;COMBINING TILDE BELOW;Mn;220;NSM;;;;;N;NON-SPACING TILDE BELOW;;;; 0331;COMBINING MACRON BELOW;Mn;220;NSM;;;;;N;NON-SPACING MACRON BELOW;;;; 0332;COMBINING LOW LINE;Mn;220;NSM;;;;;N;NON-SPACING UNDERSCORE;;;; 0333;COMBINING DOUBLE LOW LINE;Mn;220;NSM;;;;;N;NON-SPACING DOUBLE UNDERSCORE;;;; 0334;COMBINING TILDE OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING TILDE OVERLAY;;;; 0335;COMBINING SHORT STROKE OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING SHORT BAR OVERLAY;;;; 0336;COMBINING LONG STROKE OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING LONG BAR OVERLAY;;;; 0337;COMBINING SHORT SOLIDUS OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING SHORT SLASH OVERLAY;;;; 0338;COMBINING LONG SOLIDUS OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING LONG SLASH OVERLAY;;;; 0339;COMBINING RIGHT HALF RING BELOW;Mn;220;NSM;;;;;N;NON-SPACING RIGHT HALF RING BELOW;;;; 033A;COMBINING INVERTED BRIDGE BELOW;Mn;220;NSM;;;;;N;NON-SPACING INVERTED BRIDGE BELOW;;;; 033B;COMBINING SQUARE BELOW;Mn;220;NSM;;;;;N;NON-SPACING SQUARE BELOW;;;; 033C;COMBINING SEAGULL BELOW;Mn;220;NSM;;;;;N;NON-SPACING SEAGULL BELOW;;;; 033D;COMBINING X ABOVE;Mn;230;NSM;;;;;N;NON-SPACING X ABOVE;;;; 033E;COMBINING VERTICAL TILDE;Mn;230;NSM;;;;;N;NON-SPACING VERTICAL TILDE;;;; 033F;COMBINING DOUBLE OVERLINE;Mn;230;NSM;;;;;N;NON-SPACING DOUBLE OVERSCORE;;;; 0340;COMBINING GRAVE TONE MARK;Mn;230;NSM;0300;;;;N;NON-SPACING GRAVE TONE MARK;;;; 0341;COMBINING ACUTE TONE MARK;Mn;230;NSM;0301;;;;N;NON-SPACING ACUTE TONE MARK;;;; 0342;COMBINING GREEK PERISPOMENI;Mn;230;NSM;;;;;N;;;;; 0343;COMBINING GREEK KORONIS;Mn;230;NSM;0313;;;;N;;;;; 0344;COMBINING GREEK DIALYTIKA TONOS;Mn;230;NSM;0308 0301;;;;N;GREEK NON-SPACING DIAERESIS TONOS;;;; 0345;COMBINING GREEK YPOGEGRAMMENI;Mn;240;NSM;;;;;N;GREEK NON-SPACING IOTA BELOW;;0399;;0399 0346;COMBINING BRIDGE ABOVE;Mn;230;NSM;;;;;N;;;;; 0347;COMBINING EQUALS SIGN BELOW;Mn;220;NSM;;;;;N;;;;; 0348;COMBINING DOUBLE VERTICAL LINE BELOW;Mn;220;NSM;;;;;N;;;;; 0349;COMBINING LEFT ANGLE BELOW;Mn;220;NSM;;;;;N;;;;; 034A;COMBINING NOT TILDE ABOVE;Mn;230;NSM;;;;;N;;;;; 034B;COMBINING HOMOTHETIC ABOVE;Mn;230;NSM;;;;;N;;;;; 034C;COMBINING ALMOST EQUAL TO ABOVE;Mn;230;NSM;;;;;N;;;;; 034D;COMBINING LEFT RIGHT ARROW BELOW;Mn;220;NSM;;;;;N;;;;; 034E;COMBINING UPWARDS ARROW BELOW;Mn;220;NSM;;;;;N;;;;; 034F;COMBINING GRAPHEME JOINER;Mn;0;NSM;;;;;N;;;;; 0350;COMBINING RIGHT ARROWHEAD ABOVE;Mn;230;NSM;;;;;N;;;;; 0351;COMBINING LEFT HALF RING ABOVE;Mn;230;NSM;;;;;N;;;;; 0352;COMBINING FERMATA;Mn;230;NSM;;;;;N;;;;; 0353;COMBINING X BELOW;Mn;220;NSM;;;;;N;;;;; 0354;COMBINING LEFT ARROWHEAD BELOW;Mn;220;NSM;;;;;N;;;;; 0355;COMBINING RIGHT ARROWHEAD BELOW;Mn;220;NSM;;;;;N;;;;; 0356;COMBINING RIGHT ARROWHEAD AND UP ARROWHEAD BELOW;Mn;220;NSM;;;;;N;;;;; 0357;COMBINING RIGHT HALF RING ABOVE;Mn;230;NSM;;;;;N;;;;; 0358;COMBINING DOT ABOVE RIGHT;Mn;232;NSM;;;;;N;;;;; 0359;COMBINING ASTERISK BELOW;Mn;220;NSM;;;;;N;;;;; 035A;COMBINING DOUBLE RING BELOW;Mn;220;NSM;;;;;N;;;;; 035B;COMBINING ZIGZAG ABOVE;Mn;230;NSM;;;;;N;;;;; 035C;COMBINING DOUBLE BREVE BELOW;Mn;233;NSM;;;;;N;;;;; 035D;COMBINING DOUBLE BREVE;Mn;234;NSM;;;;;N;;;;; 035E;COMBINING DOUBLE MACRON;Mn;234;NSM;;;;;N;;;;; 035F;COMBINING DOUBLE MACRON BELOW;Mn;233;NSM;;;;;N;;;;; 0360;COMBINING DOUBLE TILDE;Mn;234;NSM;;;;;N;;;;; 0361;COMBINING DOUBLE INVERTED BREVE;Mn;234;NSM;;;;;N;;;;; 0362;COMBINING DOUBLE RIGHTWARDS ARROW BELOW;Mn;233;NSM;;;;;N;;;;; 0363;COMBINING LATIN SMALL LETTER A;Mn;230;NSM;;;;;N;;;;; 0364;COMBINING LATIN SMALL LETTER E;Mn;230;NSM;;;;;N;;;;; 0365;COMBINING LATIN SMALL LETTER I;Mn;230;NSM;;;;;N;;;;; 0366;COMBINING LATIN SMALL LETTER O;Mn;230;NSM;;;;;N;;;;; 0367;COMBINING LATIN SMALL LETTER U;Mn;230;NSM;;;;;N;;;;; 0368;COMBINING LATIN SMALL LETTER C;Mn;230;NSM;;;;;N;;;;; 0369;COMBINING LATIN SMALL LETTER D;Mn;230;NSM;;;;;N;;;;; 036A;COMBINING LATIN SMALL LETTER H;Mn;230;NSM;;;;;N;;;;; 036B;COMBINING LATIN SMALL LETTER M;Mn;230;NSM;;;;;N;;;;; 036C;COMBINING LATIN SMALL LETTER R;Mn;230;NSM;;;;;N;;;;; 036D;COMBINING LATIN SMALL LETTER T;Mn;230;NSM;;;;;N;;;;; 036E;COMBINING LATIN SMALL LETTER V;Mn;230;NSM;;;;;N;;;;; 036F;COMBINING LATIN SMALL LETTER X;Mn;230;NSM;;;;;N;;;;; 0370;GREEK CAPITAL LETTER HETA;Lu;0;L;;;;;N;;;;0371; 0371;GREEK SMALL LETTER HETA;Ll;0;L;;;;;N;;;0370;;0370 0372;GREEK CAPITAL LETTER ARCHAIC SAMPI;Lu;0;L;;;;;N;;;;0373; 0373;GREEK SMALL LETTER ARCHAIC SAMPI;Ll;0;L;;;;;N;;;0372;;0372 0374;GREEK NUMERAL SIGN;Lm;0;ON;02B9;;;;N;GREEK UPPER NUMERAL SIGN;;;; 0375;GREEK LOWER NUMERAL SIGN;Sk;0;ON;;;;;N;;;;; 0376;GREEK CAPITAL LETTER PAMPHYLIAN DIGAMMA;Lu;0;L;;;;;N;;;;0377; 0377;GREEK SMALL LETTER PAMPHYLIAN DIGAMMA;Ll;0;L;;;;;N;;;0376;;0376 037A;GREEK YPOGEGRAMMENI;Lm;0;L; 0020 0345;;;;N;GREEK SPACING IOTA BELOW;;;; 037B;GREEK SMALL REVERSED LUNATE SIGMA SYMBOL;Ll;0;L;;;;;N;;;03FD;;03FD 037C;GREEK SMALL DOTTED LUNATE SIGMA SYMBOL;Ll;0;L;;;;;N;;;03FE;;03FE 037D;GREEK SMALL REVERSED DOTTED LUNATE SIGMA SYMBOL;Ll;0;L;;;;;N;;;03FF;;03FF 037E;GREEK QUESTION MARK;Po;0;ON;003B;;;;N;;;;; 0384;GREEK TONOS;Sk;0;ON; 0020 0301;;;;N;GREEK SPACING TONOS;;;; 0385;GREEK DIALYTIKA TONOS;Sk;0;ON;00A8 0301;;;;N;GREEK SPACING DIAERESIS TONOS;;;; 0386;GREEK CAPITAL LETTER ALPHA WITH TONOS;Lu;0;L;0391 0301;;;;N;GREEK CAPITAL LETTER ALPHA TONOS;;;03AC; 0387;GREEK ANO TELEIA;Po;0;ON;00B7;;;;N;;;;; 0388;GREEK CAPITAL LETTER EPSILON WITH TONOS;Lu;0;L;0395 0301;;;;N;GREEK CAPITAL LETTER EPSILON TONOS;;;03AD; 0389;GREEK CAPITAL LETTER ETA WITH TONOS;Lu;0;L;0397 0301;;;;N;GREEK CAPITAL LETTER ETA TONOS;;;03AE; 038A;GREEK CAPITAL LETTER IOTA WITH TONOS;Lu;0;L;0399 0301;;;;N;GREEK CAPITAL LETTER IOTA TONOS;;;03AF; 038C;GREEK CAPITAL LETTER OMICRON WITH TONOS;Lu;0;L;039F 0301;;;;N;GREEK CAPITAL LETTER OMICRON TONOS;;;03CC; 038E;GREEK CAPITAL LETTER UPSILON WITH TONOS;Lu;0;L;03A5 0301;;;;N;GREEK CAPITAL LETTER UPSILON TONOS;;;03CD; 038F;GREEK CAPITAL LETTER OMEGA WITH TONOS;Lu;0;L;03A9 0301;;;;N;GREEK CAPITAL LETTER OMEGA TONOS;;;03CE; 0390;GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS;Ll;0;L;03CA 0301;;;;N;GREEK SMALL LETTER IOTA DIAERESIS TONOS;;;; 0391;GREEK CAPITAL LETTER ALPHA;Lu;0;L;;;;;N;;;;03B1; 0392;GREEK CAPITAL LETTER BETA;Lu;0;L;;;;;N;;;;03B2; 0393;GREEK CAPITAL LETTER GAMMA;Lu;0;L;;;;;N;;;;03B3; 0394;GREEK CAPITAL LETTER DELTA;Lu;0;L;;;;;N;;;;03B4; 0395;GREEK CAPITAL LETTER EPSILON;Lu;0;L;;;;;N;;;;03B5; 0396;GREEK CAPITAL LETTER ZETA;Lu;0;L;;;;;N;;;;03B6; 0397;GREEK CAPITAL LETTER ETA;Lu;0;L;;;;;N;;;;03B7; 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8; 0399;GREEK CAPITAL LETTER IOTA;Lu;0;L;;;;;N;;;;03B9; 039A;GREEK CAPITAL LETTER KAPPA;Lu;0;L;;;;;N;;;;03BA; 039B;GREEK CAPITAL LETTER LAMDA;Lu;0;L;;;;;N;GREEK CAPITAL LETTER LAMBDA;;;03BB; 039C;GREEK CAPITAL LETTER MU;Lu;0;L;;;;;N;;;;03BC; 039D;GREEK CAPITAL LETTER NU;Lu;0;L;;;;;N;;;;03BD; 039E;GREEK CAPITAL LETTER XI;Lu;0;L;;;;;N;;;;03BE; 039F;GREEK CAPITAL LETTER OMICRON;Lu;0;L;;;;;N;;;;03BF; 03A0;GREEK CAPITAL LETTER PI;Lu;0;L;;;;;N;;;;03C0; 03A1;GREEK CAPITAL LETTER RHO;Lu;0;L;;;;;N;;;;03C1; 03A3;GREEK CAPITAL LETTER SIGMA;Lu;0;L;;;;;N;;;;03C3; 03A4;GREEK CAPITAL LETTER TAU;Lu;0;L;;;;;N;;;;03C4; 03A5;GREEK CAPITAL LETTER UPSILON;Lu;0;L;;;;;N;;;;03C5; 03A6;GREEK CAPITAL LETTER PHI;Lu;0;L;;;;;N;;;;03C6; 03A7;GREEK CAPITAL LETTER CHI;Lu;0;L;;;;;N;;;;03C7; 03A8;GREEK CAPITAL LETTER PSI;Lu;0;L;;;;;N;;;;03C8; 03A9;GREEK CAPITAL LETTER OMEGA;Lu;0;L;;;;;N;;;;03C9; 03AA;GREEK CAPITAL LETTER IOTA WITH DIALYTIKA;Lu;0;L;0399 0308;;;;N;GREEK CAPITAL LETTER IOTA DIAERESIS;;;03CA; 03AB;GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA;Lu;0;L;03A5 0308;;;;N;GREEK CAPITAL LETTER UPSILON DIAERESIS;;;03CB; 03AC;GREEK SMALL LETTER ALPHA WITH TONOS;Ll;0;L;03B1 0301;;;;N;GREEK SMALL LETTER ALPHA TONOS;;0386;;0386 03AD;GREEK SMALL LETTER EPSILON WITH TONOS;Ll;0;L;03B5 0301;;;;N;GREEK SMALL LETTER EPSILON TONOS;;0388;;0388 03AE;GREEK SMALL LETTER ETA WITH TONOS;Ll;0;L;03B7 0301;;;;N;GREEK SMALL LETTER ETA TONOS;;0389;;0389 03AF;GREEK SMALL LETTER IOTA WITH TONOS;Ll;0;L;03B9 0301;;;;N;GREEK SMALL LETTER IOTA TONOS;;038A;;038A 03B0;GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS;Ll;0;L;03CB 0301;;;;N;GREEK SMALL LETTER UPSILON DIAERESIS TONOS;;;; 03B1;GREEK SMALL LETTER ALPHA;Ll;0;L;;;;;N;;;0391;;0391 03B2;GREEK SMALL LETTER BETA;Ll;0;L;;;;;N;;;0392;;0392 03B3;GREEK SMALL LETTER GAMMA;Ll;0;L;;;;;N;;;0393;;0393 03B4;GREEK SMALL LETTER DELTA;Ll;0;L;;;;;N;;;0394;;0394 03B5;GREEK SMALL LETTER EPSILON;Ll;0;L;;;;;N;;;0395;;0395 03B6;GREEK SMALL LETTER ZETA;Ll;0;L;;;;;N;;;0396;;0396 03B7;GREEK SMALL LETTER ETA;Ll;0;L;;;;;N;;;0397;;0397 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398 03B9;GREEK SMALL LETTER IOTA;Ll;0;L;;;;;N;;;0399;;0399 03BA;GREEK SMALL LETTER KAPPA;Ll;0;L;;;;;N;;;039A;;039A 03BB;GREEK SMALL LETTER LAMDA;Ll;0;L;;;;;N;GREEK SMALL LETTER LAMBDA;;039B;;039B 03BC;GREEK SMALL LETTER MU;Ll;0;L;;;;;N;;;039C;;039C 03BD;GREEK SMALL LETTER NU;Ll;0;L;;;;;N;;;039D;;039D 03BE;GREEK SMALL LETTER XI;Ll;0;L;;;;;N;;;039E;;039E 03BF;GREEK SMALL LETTER OMICRON;Ll;0;L;;;;;N;;;039F;;039F 03C0;GREEK SMALL LETTER PI;Ll;0;L;;;;;N;;;03A0;;03A0 03C1;GREEK SMALL LETTER RHO;Ll;0;L;;;;;N;;;03A1;;03A1 03C2;GREEK SMALL LETTER FINAL SIGMA;Ll;0;L;;;;;N;;;03A3;;03A3 03C3;GREEK SMALL LETTER SIGMA;Ll;0;L;;;;;N;;;03A3;;03A3 03C4;GREEK SMALL LETTER TAU;Ll;0;L;;;;;N;;;03A4;;03A4 03C5;GREEK SMALL LETTER UPSILON;Ll;0;L;;;;;N;;;03A5;;03A5 03C6;GREEK SMALL LETTER PHI;Ll;0;L;;;;;N;;;03A6;;03A6 03C7;GREEK SMALL LETTER CHI;Ll;0;L;;;;;N;;;03A7;;03A7 03C8;GREEK SMALL LETTER PSI;Ll;0;L;;;;;N;;;03A8;;03A8 03C9;GREEK SMALL LETTER OMEGA;Ll;0;L;;;;;N;;;03A9;;03A9 03CA;GREEK SMALL LETTER IOTA WITH DIALYTIKA;Ll;0;L;03B9 0308;;;;N;GREEK SMALL LETTER IOTA DIAERESIS;;03AA;;03AA 03CB;GREEK SMALL LETTER UPSILON WITH DIALYTIKA;Ll;0;L;03C5 0308;;;;N;GREEK SMALL LETTER UPSILON DIAERESIS;;03AB;;03AB 03CC;GREEK SMALL LETTER OMICRON WITH TONOS;Ll;0;L;03BF 0301;;;;N;GREEK SMALL LETTER OMICRON TONOS;;038C;;038C 03CD;GREEK SMALL LETTER UPSILON WITH TONOS;Ll;0;L;03C5 0301;;;;N;GREEK SMALL LETTER UPSILON TONOS;;038E;;038E 03CE;GREEK SMALL LETTER OMEGA WITH TONOS;Ll;0;L;03C9 0301;;;;N;GREEK SMALL LETTER OMEGA TONOS;;038F;;038F 03CF;GREEK CAPITAL KAI SYMBOL;Lu;0;L;;;;;N;;;;03D7; 03D0;GREEK BETA SYMBOL;Ll;0;L; 03B2;;;;N;GREEK SMALL LETTER CURLED BETA;;0392;;0392 03D1;GREEK THETA SYMBOL;Ll;0;L; 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398 03D2;GREEK UPSILON WITH HOOK SYMBOL;Lu;0;L; 03A5;;;;N;GREEK CAPITAL LETTER UPSILON HOOK;;;; 03D3;GREEK UPSILON WITH ACUTE AND HOOK SYMBOL;Lu;0;L;03D2 0301;;;;N;GREEK CAPITAL LETTER UPSILON HOOK TONOS;;;; 03D4;GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL;Lu;0;L;03D2 0308;;;;N;GREEK CAPITAL LETTER UPSILON HOOK DIAERESIS;;;; 03D5;GREEK PHI SYMBOL;Ll;0;L; 03C6;;;;N;GREEK SMALL LETTER SCRIPT PHI;;03A6;;03A6 03D6;GREEK PI SYMBOL;Ll;0;L; 03C0;;;;N;GREEK SMALL LETTER OMEGA PI;;03A0;;03A0 03D7;GREEK KAI SYMBOL;Ll;0;L;;;;;N;;;03CF;;03CF 03D8;GREEK LETTER ARCHAIC KOPPA;Lu;0;L;;;;;N;;;;03D9; 03D9;GREEK SMALL LETTER ARCHAIC KOPPA;Ll;0;L;;;;;N;;;03D8;;03D8 03DA;GREEK LETTER STIGMA;Lu;0;L;;;;;N;GREEK CAPITAL LETTER STIGMA;;;03DB; 03DB;GREEK SMALL LETTER STIGMA;Ll;0;L;;;;;N;;;03DA;;03DA 03DC;GREEK LETTER DIGAMMA;Lu;0;L;;;;;N;GREEK CAPITAL LETTER DIGAMMA;;;03DD; 03DD;GREEK SMALL LETTER DIGAMMA;Ll;0;L;;;;;N;;;03DC;;03DC 03DE;GREEK LETTER KOPPA;Lu;0;L;;;;;N;GREEK CAPITAL LETTER KOPPA;;;03DF; 03DF;GREEK SMALL LETTER KOPPA;Ll;0;L;;;;;N;;;03DE;;03DE 03E0;GREEK LETTER SAMPI;Lu;0;L;;;;;N;GREEK CAPITAL LETTER SAMPI;;;03E1; 03E1;GREEK SMALL LETTER SAMPI;Ll;0;L;;;;;N;;;03E0;;03E0 03E2;COPTIC CAPITAL LETTER SHEI;Lu;0;L;;;;;N;GREEK CAPITAL LETTER SHEI;;;03E3; 03E3;COPTIC SMALL LETTER SHEI;Ll;0;L;;;;;N;GREEK SMALL LETTER SHEI;;03E2;;03E2 03E4;COPTIC CAPITAL LETTER FEI;Lu;0;L;;;;;N;GREEK CAPITAL LETTER FEI;;;03E5; 03E5;COPTIC SMALL LETTER FEI;Ll;0;L;;;;;N;GREEK SMALL LETTER FEI;;03E4;;03E4 03E6;COPTIC CAPITAL LETTER KHEI;Lu;0;L;;;;;N;GREEK CAPITAL LETTER KHEI;;;03E7; 03E7;COPTIC SMALL LETTER KHEI;Ll;0;L;;;;;N;GREEK SMALL LETTER KHEI;;03E6;;03E6 03E8;COPTIC CAPITAL LETTER HORI;Lu;0;L;;;;;N;GREEK CAPITAL LETTER HORI;;;03E9; 03E9;COPTIC SMALL LETTER HORI;Ll;0;L;;;;;N;GREEK SMALL LETTER HORI;;03E8;;03E8 03EA;COPTIC CAPITAL LETTER GANGIA;Lu;0;L;;;;;N;GREEK CAPITAL LETTER GANGIA;;;03EB; 03EB;COPTIC SMALL LETTER GANGIA;Ll;0;L;;;;;N;GREEK SMALL LETTER GANGIA;;03EA;;03EA 03EC;COPTIC CAPITAL LETTER SHIMA;Lu;0;L;;;;;N;GREEK CAPITAL LETTER SHIMA;;;03ED; 03ED;COPTIC SMALL LETTER SHIMA;Ll;0;L;;;;;N;GREEK SMALL LETTER SHIMA;;03EC;;03EC 03EE;COPTIC CAPITAL LETTER DEI;Lu;0;L;;;;;N;GREEK CAPITAL LETTER DEI;;;03EF; 03EF;COPTIC SMALL LETTER DEI;Ll;0;L;;;;;N;GREEK SMALL LETTER DEI;;03EE;;03EE 03F0;GREEK KAPPA SYMBOL;Ll;0;L; 03BA;;;;N;GREEK SMALL LETTER SCRIPT KAPPA;;039A;;039A 03F1;GREEK RHO SYMBOL;Ll;0;L; 03C1;;;;N;GREEK SMALL LETTER TAILED RHO;;03A1;;03A1 03F2;GREEK LUNATE SIGMA SYMBOL;Ll;0;L; 03C2;;;;N;GREEK SMALL LETTER LUNATE SIGMA;;03F9;;03F9 03F3;GREEK LETTER YOT;Ll;0;L;;;;;N;;;;; 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L; 0398;;;;N;;;;03B8; 03F5;GREEK LUNATE EPSILON SYMBOL;Ll;0;L; 03B5;;;;N;;;0395;;0395 03F6;GREEK REVERSED LUNATE EPSILON SYMBOL;Sm;0;ON;;;;;N;;;;; 03F7;GREEK CAPITAL LETTER SHO;Lu;0;L;;;;;N;;;;03F8; 03F8;GREEK SMALL LETTER SHO;Ll;0;L;;;;;N;;;03F7;;03F7 03F9;GREEK CAPITAL LUNATE SIGMA SYMBOL;Lu;0;L; 03A3;;;;N;;;;03F2; 03FA;GREEK CAPITAL LETTER SAN;Lu;0;L;;;;;N;;;;03FB; 03FB;GREEK SMALL LETTER SAN;Ll;0;L;;;;;N;;;03FA;;03FA 03FC;GREEK RHO WITH STROKE SYMBOL;Ll;0;L;;;;;N;;;;; 03FD;GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL;Lu;0;L;;;;;N;;;;037B; 03FE;GREEK CAPITAL DOTTED LUNATE SIGMA SYMBOL;Lu;0;L;;;;;N;;;;037C; 03FF;GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL;Lu;0;L;;;;;N;;;;037D; 0400;CYRILLIC CAPITAL LETTER IE WITH GRAVE;Lu;0;L;0415 0300;;;;N;;;;0450; 0401;CYRILLIC CAPITAL LETTER IO;Lu;0;L;0415 0308;;;;N;;;;0451; 0402;CYRILLIC CAPITAL LETTER DJE;Lu;0;L;;;;;N;;;;0452; 0403;CYRILLIC CAPITAL LETTER GJE;Lu;0;L;0413 0301;;;;N;;;;0453; 0404;CYRILLIC CAPITAL LETTER UKRAINIAN IE;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER E;;;0454; 0405;CYRILLIC CAPITAL LETTER DZE;Lu;0;L;;;;;N;;;;0455; 0406;CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER I;;;0456; 0407;CYRILLIC CAPITAL LETTER YI;Lu;0;L;0406 0308;;;;N;;;;0457; 0408;CYRILLIC CAPITAL LETTER JE;Lu;0;L;;;;;N;;;;0458; 0409;CYRILLIC CAPITAL LETTER LJE;Lu;0;L;;;;;N;;;;0459; 040A;CYRILLIC CAPITAL LETTER NJE;Lu;0;L;;;;;N;;;;045A; 040B;CYRILLIC CAPITAL LETTER TSHE;Lu;0;L;;;;;N;;;;045B; 040C;CYRILLIC CAPITAL LETTER KJE;Lu;0;L;041A 0301;;;;N;;;;045C; 040D;CYRILLIC CAPITAL LETTER I WITH GRAVE;Lu;0;L;0418 0300;;;;N;;;;045D; 040E;CYRILLIC CAPITAL LETTER SHORT U;Lu;0;L;0423 0306;;;;N;;;;045E; 040F;CYRILLIC CAPITAL LETTER DZHE;Lu;0;L;;;;;N;;;;045F; 0410;CYRILLIC CAPITAL LETTER A;Lu;0;L;;;;;N;;;;0430; 0411;CYRILLIC CAPITAL LETTER BE;Lu;0;L;;;;;N;;;;0431; 0412;CYRILLIC CAPITAL LETTER VE;Lu;0;L;;;;;N;;;;0432; 0413;CYRILLIC CAPITAL LETTER GHE;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER GE;;;0433; 0414;CYRILLIC CAPITAL LETTER DE;Lu;0;L;;;;;N;;;;0434; 0415;CYRILLIC CAPITAL LETTER IE;Lu;0;L;;;;;N;;;;0435; 0416;CYRILLIC CAPITAL LETTER ZHE;Lu;0;L;;;;;N;;;;0436; 0417;CYRILLIC CAPITAL LETTER ZE;Lu;0;L;;;;;N;;;;0437; 0418;CYRILLIC CAPITAL LETTER I;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER II;;;0438; 0419;CYRILLIC CAPITAL LETTER SHORT I;Lu;0;L;0418 0306;;;;N;CYRILLIC CAPITAL LETTER SHORT II;;;0439; 041A;CYRILLIC CAPITAL LETTER KA;Lu;0;L;;;;;N;;;;043A; 041B;CYRILLIC CAPITAL LETTER EL;Lu;0;L;;;;;N;;;;043B; 041C;CYRILLIC CAPITAL LETTER EM;Lu;0;L;;;;;N;;;;043C; 041D;CYRILLIC CAPITAL LETTER EN;Lu;0;L;;;;;N;;;;043D; 041E;CYRILLIC CAPITAL LETTER O;Lu;0;L;;;;;N;;;;043E; 041F;CYRILLIC CAPITAL LETTER PE;Lu;0;L;;;;;N;;;;043F; 0420;CYRILLIC CAPITAL LETTER ER;Lu;0;L;;;;;N;;;;0440; 0421;CYRILLIC CAPITAL LETTER ES;Lu;0;L;;;;;N;;;;0441; 0422;CYRILLIC CAPITAL LETTER TE;Lu;0;L;;;;;N;;;;0442; 0423;CYRILLIC CAPITAL LETTER U;Lu;0;L;;;;;N;;;;0443; 0424;CYRILLIC CAPITAL LETTER EF;Lu;0;L;;;;;N;;;;0444; 0425;CYRILLIC CAPITAL LETTER HA;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER KHA;;;0445; 0426;CYRILLIC CAPITAL LETTER TSE;Lu;0;L;;;;;N;;;;0446; 0427;CYRILLIC CAPITAL LETTER CHE;Lu;0;L;;;;;N;;;;0447; 0428;CYRILLIC CAPITAL LETTER SHA;Lu;0;L;;;;;N;;;;0448; 0429;CYRILLIC CAPITAL LETTER SHCHA;Lu;0;L;;;;;N;;;;0449; 042A;CYRILLIC CAPITAL LETTER HARD SIGN;Lu;0;L;;;;;N;;;;044A; 042B;CYRILLIC CAPITAL LETTER YERU;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER YERI;;;044B; 042C;CYRILLIC CAPITAL LETTER SOFT SIGN;Lu;0;L;;;;;N;;;;044C; 042D;CYRILLIC CAPITAL LETTER E;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER REVERSED E;;;044D; 042E;CYRILLIC CAPITAL LETTER YU;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER IU;;;044E; 042F;CYRILLIC CAPITAL LETTER YA;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER IA;;;044F; 0430;CYRILLIC SMALL LETTER A;Ll;0;L;;;;;N;;;0410;;0410 0431;CYRILLIC SMALL LETTER BE;Ll;0;L;;;;;N;;;0411;;0411 0432;CYRILLIC SMALL LETTER VE;Ll;0;L;;;;;N;;;0412;;0412 0433;CYRILLIC SMALL LETTER GHE;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER GE;;0413;;0413 0434;CYRILLIC SMALL LETTER DE;Ll;0;L;;;;;N;;;0414;;0414 0435;CYRILLIC SMALL LETTER IE;Ll;0;L;;;;;N;;;0415;;0415 0436;CYRILLIC SMALL LETTER ZHE;Ll;0;L;;;;;N;;;0416;;0416 0437;CYRILLIC SMALL LETTER ZE;Ll;0;L;;;;;N;;;0417;;0417 0438;CYRILLIC SMALL LETTER I;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER II;;0418;;0418 0439;CYRILLIC SMALL LETTER SHORT I;Ll;0;L;0438 0306;;;;N;CYRILLIC SMALL LETTER SHORT II;;0419;;0419 043A;CYRILLIC SMALL LETTER KA;Ll;0;L;;;;;N;;;041A;;041A 043B;CYRILLIC SMALL LETTER EL;Ll;0;L;;;;;N;;;041B;;041B 043C;CYRILLIC SMALL LETTER EM;Ll;0;L;;;;;N;;;041C;;041C 043D;CYRILLIC SMALL LETTER EN;Ll;0;L;;;;;N;;;041D;;041D 043E;CYRILLIC SMALL LETTER O;Ll;0;L;;;;;N;;;041E;;041E 043F;CYRILLIC SMALL LETTER PE;Ll;0;L;;;;;N;;;041F;;041F 0440;CYRILLIC SMALL LETTER ER;Ll;0;L;;;;;N;;;0420;;0420 0441;CYRILLIC SMALL LETTER ES;Ll;0;L;;;;;N;;;0421;;0421 0442;CYRILLIC SMALL LETTER TE;Ll;0;L;;;;;N;;;0422;;0422 0443;CYRILLIC SMALL LETTER U;Ll;0;L;;;;;N;;;0423;;0423 0444;CYRILLIC SMALL LETTER EF;Ll;0;L;;;;;N;;;0424;;0424 0445;CYRILLIC SMALL LETTER HA;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER KHA;;0425;;0425 0446;CYRILLIC SMALL LETTER TSE;Ll;0;L;;;;;N;;;0426;;0426 0447;CYRILLIC SMALL LETTER CHE;Ll;0;L;;;;;N;;;0427;;0427 0448;CYRILLIC SMALL LETTER SHA;Ll;0;L;;;;;N;;;0428;;0428 0449;CYRILLIC SMALL LETTER SHCHA;Ll;0;L;;;;;N;;;0429;;0429 044A;CYRILLIC SMALL LETTER HARD SIGN;Ll;0;L;;;;;N;;;042A;;042A 044B;CYRILLIC SMALL LETTER YERU;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER YERI;;042B;;042B 044C;CYRILLIC SMALL LETTER SOFT SIGN;Ll;0;L;;;;;N;;;042C;;042C 044D;CYRILLIC SMALL LETTER E;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER REVERSED E;;042D;;042D 044E;CYRILLIC SMALL LETTER YU;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER IU;;042E;;042E 044F;CYRILLIC SMALL LETTER YA;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER IA;;042F;;042F 0450;CYRILLIC SMALL LETTER IE WITH GRAVE;Ll;0;L;0435 0300;;;;N;;;0400;;0400 0451;CYRILLIC SMALL LETTER IO;Ll;0;L;0435 0308;;;;N;;;0401;;0401 0452;CYRILLIC SMALL LETTER DJE;Ll;0;L;;;;;N;;;0402;;0402 0453;CYRILLIC SMALL LETTER GJE;Ll;0;L;0433 0301;;;;N;;;0403;;0403 0454;CYRILLIC SMALL LETTER UKRAINIAN IE;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER E;;0404;;0404 0455;CYRILLIC SMALL LETTER DZE;Ll;0;L;;;;;N;;;0405;;0405 0456;CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER I;;0406;;0406 0457;CYRILLIC SMALL LETTER YI;Ll;0;L;0456 0308;;;;N;;;0407;;0407 0458;CYRILLIC SMALL LETTER JE;Ll;0;L;;;;;N;;;0408;;0408 0459;CYRILLIC SMALL LETTER LJE;Ll;0;L;;;;;N;;;0409;;0409 045A;CYRILLIC SMALL LETTER NJE;Ll;0;L;;;;;N;;;040A;;040A 045B;CYRILLIC SMALL LETTER TSHE;Ll;0;L;;;;;N;;;040B;;040B 045C;CYRILLIC SMALL LETTER KJE;Ll;0;L;043A 0301;;;;N;;;040C;;040C 045D;CYRILLIC SMALL LETTER I WITH GRAVE;Ll;0;L;0438 0300;;;;N;;;040D;;040D 045E;CYRILLIC SMALL LETTER SHORT U;Ll;0;L;0443 0306;;;;N;;;040E;;040E 045F;CYRILLIC SMALL LETTER DZHE;Ll;0;L;;;;;N;;;040F;;040F 0460;CYRILLIC CAPITAL LETTER OMEGA;Lu;0;L;;;;;N;;;;0461; 0461;CYRILLIC SMALL LETTER OMEGA;Ll;0;L;;;;;N;;;0460;;0460 0462;CYRILLIC CAPITAL LETTER YAT;Lu;0;L;;;;;N;;;;0463; 0463;CYRILLIC SMALL LETTER YAT;Ll;0;L;;;;;N;;;0462;;0462 0464;CYRILLIC CAPITAL LETTER IOTIFIED E;Lu;0;L;;;;;N;;;;0465; 0465;CYRILLIC SMALL LETTER IOTIFIED E;Ll;0;L;;;;;N;;;0464;;0464 0466;CYRILLIC CAPITAL LETTER LITTLE YUS;Lu;0;L;;;;;N;;;;0467; 0467;CYRILLIC SMALL LETTER LITTLE YUS;Ll;0;L;;;;;N;;;0466;;0466 0468;CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS;Lu;0;L;;;;;N;;;;0469; 0469;CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS;Ll;0;L;;;;;N;;;0468;;0468 046A;CYRILLIC CAPITAL LETTER BIG YUS;Lu;0;L;;;;;N;;;;046B; 046B;CYRILLIC SMALL LETTER BIG YUS;Ll;0;L;;;;;N;;;046A;;046A 046C;CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS;Lu;0;L;;;;;N;;;;046D; 046D;CYRILLIC SMALL LETTER IOTIFIED BIG YUS;Ll;0;L;;;;;N;;;046C;;046C 046E;CYRILLIC CAPITAL LETTER KSI;Lu;0;L;;;;;N;;;;046F; 046F;CYRILLIC SMALL LETTER KSI;Ll;0;L;;;;;N;;;046E;;046E 0470;CYRILLIC CAPITAL LETTER PSI;Lu;0;L;;;;;N;;;;0471; 0471;CYRILLIC SMALL LETTER PSI;Ll;0;L;;;;;N;;;0470;;0470 0472;CYRILLIC CAPITAL LETTER FITA;Lu;0;L;;;;;N;;;;0473; 0473;CYRILLIC SMALL LETTER FITA;Ll;0;L;;;;;N;;;0472;;0472 0474;CYRILLIC CAPITAL LETTER IZHITSA;Lu;0;L;;;;;N;;;;0475; 0475;CYRILLIC SMALL LETTER IZHITSA;Ll;0;L;;;;;N;;;0474;;0474 0476;CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT;Lu;0;L;0474 030F;;;;N;CYRILLIC CAPITAL LETTER IZHITSA DOUBLE GRAVE;;;0477; 0477;CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT;Ll;0;L;0475 030F;;;;N;CYRILLIC SMALL LETTER IZHITSA DOUBLE GRAVE;;0476;;0476 0478;CYRILLIC CAPITAL LETTER UK;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER UK DIGRAPH;;;0479; 0479;CYRILLIC SMALL LETTER UK;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER UK DIGRAPH;;0478;;0478 047A;CYRILLIC CAPITAL LETTER ROUND OMEGA;Lu;0;L;;;;;N;;;;047B; 047B;CYRILLIC SMALL LETTER ROUND OMEGA;Ll;0;L;;;;;N;;;047A;;047A 047C;CYRILLIC CAPITAL LETTER OMEGA WITH TITLO;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER OMEGA TITLO;;;047D; 047D;CYRILLIC SMALL LETTER OMEGA WITH TITLO;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER OMEGA TITLO;;047C;;047C 047E;CYRILLIC CAPITAL LETTER OT;Lu;0;L;;;;;N;;;;047F; 047F;CYRILLIC SMALL LETTER OT;Ll;0;L;;;;;N;;;047E;;047E 0480;CYRILLIC CAPITAL LETTER KOPPA;Lu;0;L;;;;;N;;;;0481; 0481;CYRILLIC SMALL LETTER KOPPA;Ll;0;L;;;;;N;;;0480;;0480 0482;CYRILLIC THOUSANDS SIGN;So;0;L;;;;;N;;;;; 0483;COMBINING CYRILLIC TITLO;Mn;230;NSM;;;;;N;CYRILLIC NON-SPACING TITLO;;;; 0484;COMBINING CYRILLIC PALATALIZATION;Mn;230;NSM;;;;;N;CYRILLIC NON-SPACING PALATALIZATION;;;; 0485;COMBINING CYRILLIC DASIA PNEUMATA;Mn;230;NSM;;;;;N;CYRILLIC NON-SPACING DASIA PNEUMATA;;;; 0486;COMBINING CYRILLIC PSILI PNEUMATA;Mn;230;NSM;;;;;N;CYRILLIC NON-SPACING PSILI PNEUMATA;;;; 0487;COMBINING CYRILLIC POKRYTIE;Mn;230;NSM;;;;;N;;;;; 0488;COMBINING CYRILLIC HUNDRED THOUSANDS SIGN;Me;0;NSM;;;;;N;;;;; 0489;COMBINING CYRILLIC MILLIONS SIGN;Me;0;NSM;;;;;N;;;;; 048A;CYRILLIC CAPITAL LETTER SHORT I WITH TAIL;Lu;0;L;;;;;N;;;;048B; 048B;CYRILLIC SMALL LETTER SHORT I WITH TAIL;Ll;0;L;;;;;N;;;048A;;048A 048C;CYRILLIC CAPITAL LETTER SEMISOFT SIGN;Lu;0;L;;;;;N;;;;048D; 048D;CYRILLIC SMALL LETTER SEMISOFT SIGN;Ll;0;L;;;;;N;;;048C;;048C 048E;CYRILLIC CAPITAL LETTER ER WITH TICK;Lu;0;L;;;;;N;;;;048F; 048F;CYRILLIC SMALL LETTER ER WITH TICK;Ll;0;L;;;;;N;;;048E;;048E 0490;CYRILLIC CAPITAL LETTER GHE WITH UPTURN;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER GE WITH UPTURN;;;0491; 0491;CYRILLIC SMALL LETTER GHE WITH UPTURN;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER GE WITH UPTURN;;0490;;0490 0492;CYRILLIC CAPITAL LETTER GHE WITH STROKE;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER GE BAR;;;0493; 0493;CYRILLIC SMALL LETTER GHE WITH STROKE;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER GE BAR;;0492;;0492 0494;CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER GE HOOK;;;0495; 0495;CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER GE HOOK;;0494;;0494 0496;CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER ZHE WITH RIGHT DESCENDER;;;0497; 0497;CYRILLIC SMALL LETTER ZHE WITH DESCENDER;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER ZHE WITH RIGHT DESCENDER;;0496;;0496 0498;CYRILLIC CAPITAL LETTER ZE WITH DESCENDER;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER ZE CEDILLA;;;0499; 0499;CYRILLIC SMALL LETTER ZE WITH DESCENDER;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER ZE CEDILLA;;0498;;0498 049A;CYRILLIC CAPITAL LETTER KA WITH DESCENDER;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER KA WITH RIGHT DESCENDER;;;049B; 049B;CYRILLIC SMALL LETTER KA WITH DESCENDER;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER KA WITH RIGHT DESCENDER;;049A;;049A 049C;CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER KA VERTICAL BAR;;;049D; 049D;CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER KA VERTICAL BAR;;049C;;049C 049E;CYRILLIC CAPITAL LETTER KA WITH STROKE;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER KA BAR;;;049F; 049F;CYRILLIC SMALL LETTER KA WITH STROKE;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER KA BAR;;049E;;049E 04A0;CYRILLIC CAPITAL LETTER BASHKIR KA;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER REVERSED GE KA;;;04A1; 04A1;CYRILLIC SMALL LETTER BASHKIR KA;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER REVERSED GE KA;;04A0;;04A0 04A2;CYRILLIC CAPITAL LETTER EN WITH DESCENDER;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER EN WITH RIGHT DESCENDER;;;04A3; 04A3;CYRILLIC SMALL LETTER EN WITH DESCENDER;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER EN WITH RIGHT DESCENDER;;04A2;;04A2 04A4;CYRILLIC CAPITAL LIGATURE EN GHE;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER EN GE;;;04A5; 04A5;CYRILLIC SMALL LIGATURE EN GHE;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER EN GE;;04A4;;04A4 04A6;CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER PE HOOK;;;04A7; 04A7;CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER PE HOOK;;04A6;;04A6 04A8;CYRILLIC CAPITAL LETTER ABKHASIAN HA;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER O HOOK;;;04A9; 04A9;CYRILLIC SMALL LETTER ABKHASIAN HA;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER O HOOK;;04A8;;04A8 04AA;CYRILLIC CAPITAL LETTER ES WITH DESCENDER;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER ES CEDILLA;;;04AB; 04AB;CYRILLIC SMALL LETTER ES WITH DESCENDER;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER ES CEDILLA;;04AA;;04AA 04AC;CYRILLIC CAPITAL LETTER TE WITH DESCENDER;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER TE WITH RIGHT DESCENDER;;;04AD; 04AD;CYRILLIC SMALL LETTER TE WITH DESCENDER;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER TE WITH RIGHT DESCENDER;;04AC;;04AC 04AE;CYRILLIC CAPITAL LETTER STRAIGHT U;Lu;0;L;;;;;N;;;;04AF; 04AF;CYRILLIC SMALL LETTER STRAIGHT U;Ll;0;L;;;;;N;;;04AE;;04AE 04B0;CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER STRAIGHT U BAR;;;04B1; 04B1;CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER STRAIGHT U BAR;;04B0;;04B0 04B2;CYRILLIC CAPITAL LETTER HA WITH DESCENDER;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER KHA WITH RIGHT DESCENDER;;;04B3; 04B3;CYRILLIC SMALL LETTER HA WITH DESCENDER;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER KHA WITH RIGHT DESCENDER;;04B2;;04B2 04B4;CYRILLIC CAPITAL LIGATURE TE TSE;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER TE TSE;;;04B5; 04B5;CYRILLIC SMALL LIGATURE TE TSE;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER TE TSE;;04B4;;04B4 04B6;CYRILLIC CAPITAL LETTER CHE WITH DESCENDER;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER CHE WITH RIGHT DESCENDER;;;04B7; 04B7;CYRILLIC SMALL LETTER CHE WITH DESCENDER;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER CHE WITH RIGHT DESCENDER;;04B6;;04B6 04B8;CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER CHE VERTICAL BAR;;;04B9; 04B9;CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER CHE VERTICAL BAR;;04B8;;04B8 04BA;CYRILLIC CAPITAL LETTER SHHA;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER H;;;04BB; 04BB;CYRILLIC SMALL LETTER SHHA;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER H;;04BA;;04BA 04BC;CYRILLIC CAPITAL LETTER ABKHASIAN CHE;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER IE HOOK;;;04BD; 04BD;CYRILLIC SMALL LETTER ABKHASIAN CHE;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER IE HOOK;;04BC;;04BC 04BE;CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER IE HOOK OGONEK;;;04BF; 04BF;CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER IE HOOK OGONEK;;04BE;;04BE 04C0;CYRILLIC LETTER PALOCHKA;Lu;0;L;;;;;N;CYRILLIC LETTER I;;;04CF; 04C1;CYRILLIC CAPITAL LETTER ZHE WITH BREVE;Lu;0;L;0416 0306;;;;N;CYRILLIC CAPITAL LETTER SHORT ZHE;;;04C2; 04C2;CYRILLIC SMALL LETTER ZHE WITH BREVE;Ll;0;L;0436 0306;;;;N;CYRILLIC SMALL LETTER SHORT ZHE;;04C1;;04C1 04C3;CYRILLIC CAPITAL LETTER KA WITH HOOK;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER KA HOOK;;;04C4; 04C4;CYRILLIC SMALL LETTER KA WITH HOOK;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER KA HOOK;;04C3;;04C3 04C5;CYRILLIC CAPITAL LETTER EL WITH TAIL;Lu;0;L;;;;;N;;;;04C6; 04C6;CYRILLIC SMALL LETTER EL WITH TAIL;Ll;0;L;;;;;N;;;04C5;;04C5 04C7;CYRILLIC CAPITAL LETTER EN WITH HOOK;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER EN HOOK;;;04C8; 04C8;CYRILLIC SMALL LETTER EN WITH HOOK;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER EN HOOK;;04C7;;04C7 04C9;CYRILLIC CAPITAL LETTER EN WITH TAIL;Lu;0;L;;;;;N;;;;04CA; 04CA;CYRILLIC SMALL LETTER EN WITH TAIL;Ll;0;L;;;;;N;;;04C9;;04C9 04CB;CYRILLIC CAPITAL LETTER KHAKASSIAN CHE;Lu;0;L;;;;;N;CYRILLIC CAPITAL LETTER CHE WITH LEFT DESCENDER;;;04CC; 04CC;CYRILLIC SMALL LETTER KHAKASSIAN CHE;Ll;0;L;;;;;N;CYRILLIC SMALL LETTER CHE WITH LEFT DESCENDER;;04CB;;04CB 04CD;CYRILLIC CAPITAL LETTER EM WITH TAIL;Lu;0;L;;;;;N;;;;04CE; 04CE;CYRILLIC SMALL LETTER EM WITH TAIL;Ll;0;L;;;;;N;;;04CD;;04CD 04CF;CYRILLIC SMALL LETTER PALOCHKA;Ll;0;L;;;;;N;;;04C0;;04C0 04D0;CYRILLIC CAPITAL LETTER A WITH BREVE;Lu;0;L;0410 0306;;;;N;;;;04D1; 04D1;CYRILLIC SMALL LETTER A WITH BREVE;Ll;0;L;0430 0306;;;;N;;;04D0;;04D0 04D2;CYRILLIC CAPITAL LETTER A WITH DIAERESIS;Lu;0;L;0410 0308;;;;N;;;;04D3; 04D3;CYRILLIC SMALL LETTER A WITH DIAERESIS;Ll;0;L;0430 0308;;;;N;;;04D2;;04D2 04D4;CYRILLIC CAPITAL LIGATURE A IE;Lu;0;L;;;;;N;;;;04D5; 04D5;CYRILLIC SMALL LIGATURE A IE;Ll;0;L;;;;;N;;;04D4;;04D4 04D6;CYRILLIC CAPITAL LETTER IE WITH BREVE;Lu;0;L;0415 0306;;;;N;;;;04D7; 04D7;CYRILLIC SMALL LETTER IE WITH BREVE;Ll;0;L;0435 0306;;;;N;;;04D6;;04D6 04D8;CYRILLIC CAPITAL LETTER SCHWA;Lu;0;L;;;;;N;;;;04D9; 04D9;CYRILLIC SMALL LETTER SCHWA;Ll;0;L;;;;;N;;;04D8;;04D8 04DA;CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS;Lu;0;L;04D8 0308;;;;N;;;;04DB; 04DB;CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS;Ll;0;L;04D9 0308;;;;N;;;04DA;;04DA 04DC;CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS;Lu;0;L;0416 0308;;;;N;;;;04DD; 04DD;CYRILLIC SMALL LETTER ZHE WITH DIAERESIS;Ll;0;L;0436 0308;;;;N;;;04DC;;04DC 04DE;CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS;Lu;0;L;0417 0308;;;;N;;;;04DF; 04DF;CYRILLIC SMALL LETTER ZE WITH DIAERESIS;Ll;0;L;0437 0308;;;;N;;;04DE;;04DE 04E0;CYRILLIC CAPITAL LETTER ABKHASIAN DZE;Lu;0;L;;;;;N;;;;04E1; 04E1;CYRILLIC SMALL LETTER ABKHASIAN DZE;Ll;0;L;;;;;N;;;04E0;;04E0 04E2;CYRILLIC CAPITAL LETTER I WITH MACRON;Lu;0;L;0418 0304;;;;N;;;;04E3; 04E3;CYRILLIC SMALL LETTER I WITH MACRON;Ll;0;L;0438 0304;;;;N;;;04E2;;04E2 04E4;CYRILLIC CAPITAL LETTER I WITH DIAERESIS;Lu;0;L;0418 0308;;;;N;;;;04E5; 04E5;CYRILLIC SMALL LETTER I WITH DIAERESIS;Ll;0;L;0438 0308;;;;N;;;04E4;;04E4 04E6;CYRILLIC CAPITAL LETTER O WITH DIAERESIS;Lu;0;L;041E 0308;;;;N;;;;04E7; 04E7;CYRILLIC SMALL LETTER O WITH DIAERESIS;Ll;0;L;043E 0308;;;;N;;;04E6;;04E6 04E8;CYRILLIC CAPITAL LETTER BARRED O;Lu;0;L;;;;;N;;;;04E9; 04E9;CYRILLIC SMALL LETTER BARRED O;Ll;0;L;;;;;N;;;04E8;;04E8 04EA;CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS;Lu;0;L;04E8 0308;;;;N;;;;04EB; 04EB;CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS;Ll;0;L;04E9 0308;;;;N;;;04EA;;04EA 04EC;CYRILLIC CAPITAL LETTER E WITH DIAERESIS;Lu;0;L;042D 0308;;;;N;;;;04ED; 04ED;CYRILLIC SMALL LETTER E WITH DIAERESIS;Ll;0;L;044D 0308;;;;N;;;04EC;;04EC 04EE;CYRILLIC CAPITAL LETTER U WITH MACRON;Lu;0;L;0423 0304;;;;N;;;;04EF; 04EF;CYRILLIC SMALL LETTER U WITH MACRON;Ll;0;L;0443 0304;;;;N;;;04EE;;04EE 04F0;CYRILLIC CAPITAL LETTER U WITH DIAERESIS;Lu;0;L;0423 0308;;;;N;;;;04F1; 04F1;CYRILLIC SMALL LETTER U WITH DIAERESIS;Ll;0;L;0443 0308;;;;N;;;04F0;;04F0 04F2;CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE;Lu;0;L;0423 030B;;;;N;;;;04F3; 04F3;CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE;Ll;0;L;0443 030B;;;;N;;;04F2;;04F2 04F4;CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS;Lu;0;L;0427 0308;;;;N;;;;04F5; 04F5;CYRILLIC SMALL LETTER CHE WITH DIAERESIS;Ll;0;L;0447 0308;;;;N;;;04F4;;04F4 04F6;CYRILLIC CAPITAL LETTER GHE WITH DESCENDER;Lu;0;L;;;;;N;;;;04F7; 04F7;CYRILLIC SMALL LETTER GHE WITH DESCENDER;Ll;0;L;;;;;N;;;04F6;;04F6 04F8;CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS;Lu;0;L;042B 0308;;;;N;;;;04F9; 04F9;CYRILLIC SMALL LETTER YERU WITH DIAERESIS;Ll;0;L;044B 0308;;;;N;;;04F8;;04F8 04FA;CYRILLIC CAPITAL LETTER GHE WITH STROKE AND HOOK;Lu;0;L;;;;;N;;;;04FB; 04FB;CYRILLIC SMALL LETTER GHE WITH STROKE AND HOOK;Ll;0;L;;;;;N;;;04FA;;04FA 04FC;CYRILLIC CAPITAL LETTER HA WITH HOOK;Lu;0;L;;;;;N;;;;04FD; 04FD;CYRILLIC SMALL LETTER HA WITH HOOK;Ll;0;L;;;;;N;;;04FC;;04FC 04FE;CYRILLIC CAPITAL LETTER HA WITH STROKE;Lu;0;L;;;;;N;;;;04FF; 04FF;CYRILLIC SMALL LETTER HA WITH STROKE;Ll;0;L;;;;;N;;;04FE;;04FE 0500;CYRILLIC CAPITAL LETTER KOMI DE;Lu;0;L;;;;;N;;;;0501; 0501;CYRILLIC SMALL LETTER KOMI DE;Ll;0;L;;;;;N;;;0500;;0500 0502;CYRILLIC CAPITAL LETTER KOMI DJE;Lu;0;L;;;;;N;;;;0503; 0503;CYRILLIC SMALL LETTER KOMI DJE;Ll;0;L;;;;;N;;;0502;;0502 0504;CYRILLIC CAPITAL LETTER KOMI ZJE;Lu;0;L;;;;;N;;;;0505; 0505;CYRILLIC SMALL LETTER KOMI ZJE;Ll;0;L;;;;;N;;;0504;;0504 0506;CYRILLIC CAPITAL LETTER KOMI DZJE;Lu;0;L;;;;;N;;;;0507; 0507;CYRILLIC SMALL LETTER KOMI DZJE;Ll;0;L;;;;;N;;;0506;;0506 0508;CYRILLIC CAPITAL LETTER KOMI LJE;Lu;0;L;;;;;N;;;;0509; 0509;CYRILLIC SMALL LETTER KOMI LJE;Ll;0;L;;;;;N;;;0508;;0508 050A;CYRILLIC CAPITAL LETTER KOMI NJE;Lu;0;L;;;;;N;;;;050B; 050B;CYRILLIC SMALL LETTER KOMI NJE;Ll;0;L;;;;;N;;;050A;;050A 050C;CYRILLIC CAPITAL LETTER KOMI SJE;Lu;0;L;;;;;N;;;;050D; 050D;CYRILLIC SMALL LETTER KOMI SJE;Ll;0;L;;;;;N;;;050C;;050C 050E;CYRILLIC CAPITAL LETTER KOMI TJE;Lu;0;L;;;;;N;;;;050F; 050F;CYRILLIC SMALL LETTER KOMI TJE;Ll;0;L;;;;;N;;;050E;;050E 0510;CYRILLIC CAPITAL LETTER REVERSED ZE;Lu;0;L;;;;;N;;;;0511; 0511;CYRILLIC SMALL LETTER REVERSED ZE;Ll;0;L;;;;;N;;;0510;;0510 0512;CYRILLIC CAPITAL LETTER EL WITH HOOK;Lu;0;L;;;;;N;;;;0513; 0513;CYRILLIC SMALL LETTER EL WITH HOOK;Ll;0;L;;;;;N;;;0512;;0512 0514;CYRILLIC CAPITAL LETTER LHA;Lu;0;L;;;;;N;;;;0515; 0515;CYRILLIC SMALL LETTER LHA;Ll;0;L;;;;;N;;;0514;;0514 0516;CYRILLIC CAPITAL LETTER RHA;Lu;0;L;;;;;N;;;;0517; 0517;CYRILLIC SMALL LETTER RHA;Ll;0;L;;;;;N;;;0516;;0516 0518;CYRILLIC CAPITAL LETTER YAE;Lu;0;L;;;;;N;;;;0519; 0519;CYRILLIC SMALL LETTER YAE;Ll;0;L;;;;;N;;;0518;;0518 051A;CYRILLIC CAPITAL LETTER QA;Lu;0;L;;;;;N;;;;051B; 051B;CYRILLIC SMALL LETTER QA;Ll;0;L;;;;;N;;;051A;;051A 051C;CYRILLIC CAPITAL LETTER WE;Lu;0;L;;;;;N;;;;051D; 051D;CYRILLIC SMALL LETTER WE;Ll;0;L;;;;;N;;;051C;;051C 051E;CYRILLIC CAPITAL LETTER ALEUT KA;Lu;0;L;;;;;N;;;;051F; 051F;CYRILLIC SMALL LETTER ALEUT KA;Ll;0;L;;;;;N;;;051E;;051E 0520;CYRILLIC CAPITAL LETTER EL WITH MIDDLE HOOK;Lu;0;L;;;;;N;;;;0521; 0521;CYRILLIC SMALL LETTER EL WITH MIDDLE HOOK;Ll;0;L;;;;;N;;;0520;;0520 0522;CYRILLIC CAPITAL LETTER EN WITH MIDDLE HOOK;Lu;0;L;;;;;N;;;;0523; 0523;CYRILLIC SMALL LETTER EN WITH MIDDLE HOOK;Ll;0;L;;;;;N;;;0522;;0522 0524;CYRILLIC CAPITAL LETTER PE WITH DESCENDER;Lu;0;L;;;;;N;;;;0525; 0525;CYRILLIC SMALL LETTER PE WITH DESCENDER;Ll;0;L;;;;;N;;;0524;;0524 0526;CYRILLIC CAPITAL LETTER SHHA WITH DESCENDER;Lu;0;L;;;;;N;;;;0527; 0527;CYRILLIC SMALL LETTER SHHA WITH DESCENDER;Ll;0;L;;;;;N;;;0526;;0526 0531;ARMENIAN CAPITAL LETTER AYB;Lu;0;L;;;;;N;;;;0561; 0532;ARMENIAN CAPITAL LETTER BEN;Lu;0;L;;;;;N;;;;0562; 0533;ARMENIAN CAPITAL LETTER GIM;Lu;0;L;;;;;N;;;;0563; 0534;ARMENIAN CAPITAL LETTER DA;Lu;0;L;;;;;N;;;;0564; 0535;ARMENIAN CAPITAL LETTER ECH;Lu;0;L;;;;;N;;;;0565; 0536;ARMENIAN CAPITAL LETTER ZA;Lu;0;L;;;;;N;;;;0566; 0537;ARMENIAN CAPITAL LETTER EH;Lu;0;L;;;;;N;;;;0567; 0538;ARMENIAN CAPITAL LETTER ET;Lu;0;L;;;;;N;;;;0568; 0539;ARMENIAN CAPITAL LETTER TO;Lu;0;L;;;;;N;;;;0569; 053A;ARMENIAN CAPITAL LETTER ZHE;Lu;0;L;;;;;N;;;;056A; 053B;ARMENIAN CAPITAL LETTER INI;Lu;0;L;;;;;N;;;;056B; 053C;ARMENIAN CAPITAL LETTER LIWN;Lu;0;L;;;;;N;;;;056C; 053D;ARMENIAN CAPITAL LETTER XEH;Lu;0;L;;;;;N;;;;056D; 053E;ARMENIAN CAPITAL LETTER CA;Lu;0;L;;;;;N;;;;056E; 053F;ARMENIAN CAPITAL LETTER KEN;Lu;0;L;;;;;N;;;;056F; 0540;ARMENIAN CAPITAL LETTER HO;Lu;0;L;;;;;N;;;;0570; 0541;ARMENIAN CAPITAL LETTER JA;Lu;0;L;;;;;N;;;;0571; 0542;ARMENIAN CAPITAL LETTER GHAD;Lu;0;L;;;;;N;ARMENIAN CAPITAL LETTER LAD;;;0572; 0543;ARMENIAN CAPITAL LETTER CHEH;Lu;0;L;;;;;N;;;;0573; 0544;ARMENIAN CAPITAL LETTER MEN;Lu;0;L;;;;;N;;;;0574; 0545;ARMENIAN CAPITAL LETTER YI;Lu;0;L;;;;;N;;;;0575; 0546;ARMENIAN CAPITAL LETTER NOW;Lu;0;L;;;;;N;;;;0576; 0547;ARMENIAN CAPITAL LETTER SHA;Lu;0;L;;;;;N;;;;0577; 0548;ARMENIAN CAPITAL LETTER VO;Lu;0;L;;;;;N;;;;0578; 0549;ARMENIAN CAPITAL LETTER CHA;Lu;0;L;;;;;N;;;;0579; 054A;ARMENIAN CAPITAL LETTER PEH;Lu;0;L;;;;;N;;;;057A; 054B;ARMENIAN CAPITAL LETTER JHEH;Lu;0;L;;;;;N;;;;057B; 054C;ARMENIAN CAPITAL LETTER RA;Lu;0;L;;;;;N;;;;057C; 054D;ARMENIAN CAPITAL LETTER SEH;Lu;0;L;;;;;N;;;;057D; 054E;ARMENIAN CAPITAL LETTER VEW;Lu;0;L;;;;;N;;;;057E; 054F;ARMENIAN CAPITAL LETTER TIWN;Lu;0;L;;;;;N;;;;057F; 0550;ARMENIAN CAPITAL LETTER REH;Lu;0;L;;;;;N;;;;0580; 0551;ARMENIAN CAPITAL LETTER CO;Lu;0;L;;;;;N;;;;0581; 0552;ARMENIAN CAPITAL LETTER YIWN;Lu;0;L;;;;;N;;;;0582; 0553;ARMENIAN CAPITAL LETTER PIWR;Lu;0;L;;;;;N;;;;0583; 0554;ARMENIAN CAPITAL LETTER KEH;Lu;0;L;;;;;N;;;;0584; 0555;ARMENIAN CAPITAL LETTER OH;Lu;0;L;;;;;N;;;;0585; 0556;ARMENIAN CAPITAL LETTER FEH;Lu;0;L;;;;;N;;;;0586; 0559;ARMENIAN MODIFIER LETTER LEFT HALF RING;Lm;0;L;;;;;N;;;;; 055A;ARMENIAN APOSTROPHE;Po;0;L;;;;;N;ARMENIAN MODIFIER LETTER RIGHT HALF RING;;;; 055B;ARMENIAN EMPHASIS MARK;Po;0;L;;;;;N;;;;; 055C;ARMENIAN EXCLAMATION MARK;Po;0;L;;;;;N;;;;; 055D;ARMENIAN COMMA;Po;0;L;;;;;N;;;;; 055E;ARMENIAN QUESTION MARK;Po;0;L;;;;;N;;;;; 055F;ARMENIAN ABBREVIATION MARK;Po;0;L;;;;;N;;;;; 0561;ARMENIAN SMALL LETTER AYB;Ll;0;L;;;;;N;;;0531;;0531 0562;ARMENIAN SMALL LETTER BEN;Ll;0;L;;;;;N;;;0532;;0532 0563;ARMENIAN SMALL LETTER GIM;Ll;0;L;;;;;N;;;0533;;0533 0564;ARMENIAN SMALL LETTER DA;Ll;0;L;;;;;N;;;0534;;0534 0565;ARMENIAN SMALL LETTER ECH;Ll;0;L;;;;;N;;;0535;;0535 0566;ARMENIAN SMALL LETTER ZA;Ll;0;L;;;;;N;;;0536;;0536 0567;ARMENIAN SMALL LETTER EH;Ll;0;L;;;;;N;;;0537;;0537 0568;ARMENIAN SMALL LETTER ET;Ll;0;L;;;;;N;;;0538;;0538 0569;ARMENIAN SMALL LETTER TO;Ll;0;L;;;;;N;;;0539;;0539 056A;ARMENIAN SMALL LETTER ZHE;Ll;0;L;;;;;N;;;053A;;053A 056B;ARMENIAN SMALL LETTER INI;Ll;0;L;;;;;N;;;053B;;053B 056C;ARMENIAN SMALL LETTER LIWN;Ll;0;L;;;;;N;;;053C;;053C 056D;ARMENIAN SMALL LETTER XEH;Ll;0;L;;;;;N;;;053D;;053D 056E;ARMENIAN SMALL LETTER CA;Ll;0;L;;;;;N;;;053E;;053E 056F;ARMENIAN SMALL LETTER KEN;Ll;0;L;;;;;N;;;053F;;053F 0570;ARMENIAN SMALL LETTER HO;Ll;0;L;;;;;N;;;0540;;0540 0571;ARMENIAN SMALL LETTER JA;Ll;0;L;;;;;N;;;0541;;0541 0572;ARMENIAN SMALL LETTER GHAD;Ll;0;L;;;;;N;ARMENIAN SMALL LETTER LAD;;0542;;0542 0573;ARMENIAN SMALL LETTER CHEH;Ll;0;L;;;;;N;;;0543;;0543 0574;ARMENIAN SMALL LETTER MEN;Ll;0;L;;;;;N;;;0544;;0544 0575;ARMENIAN SMALL LETTER YI;Ll;0;L;;;;;N;;;0545;;0545 0576;ARMENIAN SMALL LETTER NOW;Ll;0;L;;;;;N;;;0546;;0546 0577;ARMENIAN SMALL LETTER SHA;Ll;0;L;;;;;N;;;0547;;0547 0578;ARMENIAN SMALL LETTER VO;Ll;0;L;;;;;N;;;0548;;0548 0579;ARMENIAN SMALL LETTER CHA;Ll;0;L;;;;;N;;;0549;;0549 057A;ARMENIAN SMALL LETTER PEH;Ll;0;L;;;;;N;;;054A;;054A 057B;ARMENIAN SMALL LETTER JHEH;Ll;0;L;;;;;N;;;054B;;054B 057C;ARMENIAN SMALL LETTER RA;Ll;0;L;;;;;N;;;054C;;054C 057D;ARMENIAN SMALL LETTER SEH;Ll;0;L;;;;;N;;;054D;;054D 057E;ARMENIAN SMALL LETTER VEW;Ll;0;L;;;;;N;;;054E;;054E 057F;ARMENIAN SMALL LETTER TIWN;Ll;0;L;;;;;N;;;054F;;054F 0580;ARMENIAN SMALL LETTER REH;Ll;0;L;;;;;N;;;0550;;0550 0581;ARMENIAN SMALL LETTER CO;Ll;0;L;;;;;N;;;0551;;0551 0582;ARMENIAN SMALL LETTER YIWN;Ll;0;L;;;;;N;;;0552;;0552 0583;ARMENIAN SMALL LETTER PIWR;Ll;0;L;;;;;N;;;0553;;0553 0584;ARMENIAN SMALL LETTER KEH;Ll;0;L;;;;;N;;;0554;;0554 0585;ARMENIAN SMALL LETTER OH;Ll;0;L;;;;;N;;;0555;;0555 0586;ARMENIAN SMALL LETTER FEH;Ll;0;L;;;;;N;;;0556;;0556 0587;ARMENIAN SMALL LIGATURE ECH YIWN;Ll;0;L; 0565 0582;;;;N;;;;; 0589;ARMENIAN FULL STOP;Po;0;L;;;;;N;ARMENIAN PERIOD;;;; 058A;ARMENIAN HYPHEN;Pd;0;ON;;;;;N;;;;; 058F;ARMENIAN DRAM SIGN;Sc;0;ET;;;;;N;;;;; 0591;HEBREW ACCENT ETNAHTA;Mn;220;NSM;;;;;N;;;;; 0592;HEBREW ACCENT SEGOL;Mn;230;NSM;;;;;N;;;;; 0593;HEBREW ACCENT SHALSHELET;Mn;230;NSM;;;;;N;;;;; 0594;HEBREW ACCENT ZAQEF QATAN;Mn;230;NSM;;;;;N;;;;; 0595;HEBREW ACCENT ZAQEF GADOL;Mn;230;NSM;;;;;N;;;;; 0596;HEBREW ACCENT TIPEHA;Mn;220;NSM;;;;;N;;;;; 0597;HEBREW ACCENT REVIA;Mn;230;NSM;;;;;N;;;;; 0598;HEBREW ACCENT ZARQA;Mn;230;NSM;;;;;N;;;;; 0599;HEBREW ACCENT PASHTA;Mn;230;NSM;;;;;N;;;;; 059A;HEBREW ACCENT YETIV;Mn;222;NSM;;;;;N;;;;; 059B;HEBREW ACCENT TEVIR;Mn;220;NSM;;;;;N;;;;; 059C;HEBREW ACCENT GERESH;Mn;230;NSM;;;;;N;;;;; 059D;HEBREW ACCENT GERESH MUQDAM;Mn;230;NSM;;;;;N;;;;; 059E;HEBREW ACCENT GERSHAYIM;Mn;230;NSM;;;;;N;;;;; 059F;HEBREW ACCENT QARNEY PARA;Mn;230;NSM;;;;;N;;;;; 05A0;HEBREW ACCENT TELISHA GEDOLA;Mn;230;NSM;;;;;N;;;;; 05A1;HEBREW ACCENT PAZER;Mn;230;NSM;;;;;N;;;;; 05A2;HEBREW ACCENT ATNAH HAFUKH;Mn;220;NSM;;;;;N;;;;; 05A3;HEBREW ACCENT MUNAH;Mn;220;NSM;;;;;N;;;;; 05A4;HEBREW ACCENT MAHAPAKH;Mn;220;NSM;;;;;N;;;;; 05A5;HEBREW ACCENT MERKHA;Mn;220;NSM;;;;;N;;;;; 05A6;HEBREW ACCENT MERKHA KEFULA;Mn;220;NSM;;;;;N;;;;; 05A7;HEBREW ACCENT DARGA;Mn;220;NSM;;;;;N;;;;; 05A8;HEBREW ACCENT QADMA;Mn;230;NSM;;;;;N;;;;; 05A9;HEBREW ACCENT TELISHA QETANA;Mn;230;NSM;;;;;N;;;;; 05AA;HEBREW ACCENT YERAH BEN YOMO;Mn;220;NSM;;;;;N;;;;; 05AB;HEBREW ACCENT OLE;Mn;230;NSM;;;;;N;;;;; 05AC;HEBREW ACCENT ILUY;Mn;230;NSM;;;;;N;;;;; 05AD;HEBREW ACCENT DEHI;Mn;222;NSM;;;;;N;;;;; 05AE;HEBREW ACCENT ZINOR;Mn;228;NSM;;;;;N;;;;; 05AF;HEBREW MARK MASORA CIRCLE;Mn;230;NSM;;;;;N;;;;; 05B0;HEBREW POINT SHEVA;Mn;10;NSM;;;;;N;;;;; 05B1;HEBREW POINT HATAF SEGOL;Mn;11;NSM;;;;;N;;;;; 05B2;HEBREW POINT HATAF PATAH;Mn;12;NSM;;;;;N;;;;; 05B3;HEBREW POINT HATAF QAMATS;Mn;13;NSM;;;;;N;;;;; 05B4;HEBREW POINT HIRIQ;Mn;14;NSM;;;;;N;;;;; 05B5;HEBREW POINT TSERE;Mn;15;NSM;;;;;N;;;;; 05B6;HEBREW POINT SEGOL;Mn;16;NSM;;;;;N;;;;; 05B7;HEBREW POINT PATAH;Mn;17;NSM;;;;;N;;;;; 05B8;HEBREW POINT QAMATS;Mn;18;NSM;;;;;N;;;;; 05B9;HEBREW POINT HOLAM;Mn;19;NSM;;;;;N;;;;; 05BA;HEBREW POINT HOLAM HASER FOR VAV;Mn;19;NSM;;;;;N;;;;; 05BB;HEBREW POINT QUBUTS;Mn;20;NSM;;;;;N;;;;; 05BC;HEBREW POINT DAGESH OR MAPIQ;Mn;21;NSM;;;;;N;HEBREW POINT DAGESH;;;; 05BD;HEBREW POINT METEG;Mn;22;NSM;;;;;N;;;;; 05BE;HEBREW PUNCTUATION MAQAF;Pd;0;R;;;;;N;;;;; 05BF;HEBREW POINT RAFE;Mn;23;NSM;;;;;N;;;;; 05C0;HEBREW PUNCTUATION PASEQ;Po;0;R;;;;;N;HEBREW POINT PASEQ;;;; 05C1;HEBREW POINT SHIN DOT;Mn;24;NSM;;;;;N;;;;; 05C2;HEBREW POINT SIN DOT;Mn;25;NSM;;;;;N;;;;; 05C3;HEBREW PUNCTUATION SOF PASUQ;Po;0;R;;;;;N;;;;; 05C4;HEBREW MARK UPPER DOT;Mn;230;NSM;;;;;N;;;;; 05C5;HEBREW MARK LOWER DOT;Mn;220;NSM;;;;;N;;;;; 05C6;HEBREW PUNCTUATION NUN HAFUKHA;Po;0;R;;;;;N;;;;; 05C7;HEBREW POINT QAMATS QATAN;Mn;18;NSM;;;;;N;;;;; 05D0;HEBREW LETTER ALEF;Lo;0;R;;;;;N;;;;; 05D1;HEBREW LETTER BET;Lo;0;R;;;;;N;;;;; 05D2;HEBREW LETTER GIMEL;Lo;0;R;;;;;N;;;;; 05D3;HEBREW LETTER DALET;Lo;0;R;;;;;N;;;;; 05D4;HEBREW LETTER HE;Lo;0;R;;;;;N;;;;; 05D5;HEBREW LETTER VAV;Lo;0;R;;;;;N;;;;; 05D6;HEBREW LETTER ZAYIN;Lo;0;R;;;;;N;;;;; 05D7;HEBREW LETTER HET;Lo;0;R;;;;;N;;;;; 05D8;HEBREW LETTER TET;Lo;0;R;;;;;N;;;;; 05D9;HEBREW LETTER YOD;Lo;0;R;;;;;N;;;;; 05DA;HEBREW LETTER FINAL KAF;Lo;0;R;;;;;N;;;;; 05DB;HEBREW LETTER KAF;Lo;0;R;;;;;N;;;;; 05DC;HEBREW LETTER LAMED;Lo;0;R;;;;;N;;;;; 05DD;HEBREW LETTER FINAL MEM;Lo;0;R;;;;;N;;;;; 05DE;HEBREW LETTER MEM;Lo;0;R;;;;;N;;;;; 05DF;HEBREW LETTER FINAL NUN;Lo;0;R;;;;;N;;;;; 05E0;HEBREW LETTER NUN;Lo;0;R;;;;;N;;;;; 05E1;HEBREW LETTER SAMEKH;Lo;0;R;;;;;N;;;;; 05E2;HEBREW LETTER AYIN;Lo;0;R;;;;;N;;;;; 05E3;HEBREW LETTER FINAL PE;Lo;0;R;;;;;N;;;;; 05E4;HEBREW LETTER PE;Lo;0;R;;;;;N;;;;; 05E5;HEBREW LETTER FINAL TSADI;Lo;0;R;;;;;N;;;;; 05E6;HEBREW LETTER TSADI;Lo;0;R;;;;;N;;;;; 05E7;HEBREW LETTER QOF;Lo;0;R;;;;;N;;;;; 05E8;HEBREW LETTER RESH;Lo;0;R;;;;;N;;;;; 05E9;HEBREW LETTER SHIN;Lo;0;R;;;;;N;;;;; 05EA;HEBREW LETTER TAV;Lo;0;R;;;;;N;;;;; 05F0;HEBREW LIGATURE YIDDISH DOUBLE VAV;Lo;0;R;;;;;N;HEBREW LETTER DOUBLE VAV;;;; 05F1;HEBREW LIGATURE YIDDISH VAV YOD;Lo;0;R;;;;;N;HEBREW LETTER VAV YOD;;;; 05F2;HEBREW LIGATURE YIDDISH DOUBLE YOD;Lo;0;R;;;;;N;HEBREW LETTER DOUBLE YOD;;;; 05F3;HEBREW PUNCTUATION GERESH;Po;0;R;;;;;N;;;;; 05F4;HEBREW PUNCTUATION GERSHAYIM;Po;0;R;;;;;N;;;;; 0600;ARABIC NUMBER SIGN;Cf;0;AN;;;;;N;;;;; 0601;ARABIC SIGN SANAH;Cf;0;AN;;;;;N;;;;; 0602;ARABIC FOOTNOTE MARKER;Cf;0;AN;;;;;N;;;;; 0603;ARABIC SIGN SAFHA;Cf;0;AN;;;;;N;;;;; 0604;ARABIC SIGN SAMVAT;Cf;0;AN;;;;;N;;;;; 0606;ARABIC-INDIC CUBE ROOT;Sm;0;ON;;;;;N;;;;; 0607;ARABIC-INDIC FOURTH ROOT;Sm;0;ON;;;;;N;;;;; 0608;ARABIC RAY;Sm;0;AL;;;;;N;;;;; 0609;ARABIC-INDIC PER MILLE SIGN;Po;0;ET;;;;;N;;;;; 060A;ARABIC-INDIC PER TEN THOUSAND SIGN;Po;0;ET;;;;;N;;;;; 060B;AFGHANI SIGN;Sc;0;AL;;;;;N;;;;; 060C;ARABIC COMMA;Po;0;CS;;;;;N;;;;; 060D;ARABIC DATE SEPARATOR;Po;0;AL;;;;;N;;;;; 060E;ARABIC POETIC VERSE SIGN;So;0;ON;;;;;N;;;;; 060F;ARABIC SIGN MISRA;So;0;ON;;;;;N;;;;; 0610;ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM;Mn;230;NSM;;;;;N;;;;; 0611;ARABIC SIGN ALAYHE ASSALLAM;Mn;230;NSM;;;;;N;;;;; 0612;ARABIC SIGN RAHMATULLAH ALAYHE;Mn;230;NSM;;;;;N;;;;; 0613;ARABIC SIGN RADI ALLAHOU ANHU;Mn;230;NSM;;;;;N;;;;; 0614;ARABIC SIGN TAKHALLUS;Mn;230;NSM;;;;;N;;;;; 0615;ARABIC SMALL HIGH TAH;Mn;230;NSM;;;;;N;;;;; 0616;ARABIC SMALL HIGH LIGATURE ALEF WITH LAM WITH YEH;Mn;230;NSM;;;;;N;;;;; 0617;ARABIC SMALL HIGH ZAIN;Mn;230;NSM;;;;;N;;;;; 0618;ARABIC SMALL FATHA;Mn;30;NSM;;;;;N;;;;; 0619;ARABIC SMALL DAMMA;Mn;31;NSM;;;;;N;;;;; 061A;ARABIC SMALL KASRA;Mn;32;NSM;;;;;N;;;;; 061B;ARABIC SEMICOLON;Po;0;AL;;;;;N;;;;; 061E;ARABIC TRIPLE DOT PUNCTUATION MARK;Po;0;AL;;;;;N;;;;; 061F;ARABIC QUESTION MARK;Po;0;AL;;;;;N;;;;; 0620;ARABIC LETTER KASHMIRI YEH;Lo;0;AL;;;;;N;;;;; 0621;ARABIC LETTER HAMZA;Lo;0;AL;;;;;N;ARABIC LETTER HAMZAH;;;; 0622;ARABIC LETTER ALEF WITH MADDA ABOVE;Lo;0;AL;0627 0653;;;;N;ARABIC LETTER MADDAH ON ALEF;;;; 0623;ARABIC LETTER ALEF WITH HAMZA ABOVE;Lo;0;AL;0627 0654;;;;N;ARABIC LETTER HAMZAH ON ALEF;;;; 0624;ARABIC LETTER WAW WITH HAMZA ABOVE;Lo;0;AL;0648 0654;;;;N;ARABIC LETTER HAMZAH ON WAW;;;; 0625;ARABIC LETTER ALEF WITH HAMZA BELOW;Lo;0;AL;0627 0655;;;;N;ARABIC LETTER HAMZAH UNDER ALEF;;;; 0626;ARABIC LETTER YEH WITH HAMZA ABOVE;Lo;0;AL;064A 0654;;;;N;ARABIC LETTER HAMZAH ON YA;;;; 0627;ARABIC LETTER ALEF;Lo;0;AL;;;;;N;;;;; 0628;ARABIC LETTER BEH;Lo;0;AL;;;;;N;ARABIC LETTER BAA;;;; 0629;ARABIC LETTER TEH MARBUTA;Lo;0;AL;;;;;N;ARABIC LETTER TAA MARBUTAH;;;; 062A;ARABIC LETTER TEH;Lo;0;AL;;;;;N;ARABIC LETTER TAA;;;; 062B;ARABIC LETTER THEH;Lo;0;AL;;;;;N;ARABIC LETTER THAA;;;; 062C;ARABIC LETTER JEEM;Lo;0;AL;;;;;N;;;;; 062D;ARABIC LETTER HAH;Lo;0;AL;;;;;N;ARABIC LETTER HAA;;;; 062E;ARABIC LETTER KHAH;Lo;0;AL;;;;;N;ARABIC LETTER KHAA;;;; 062F;ARABIC LETTER DAL;Lo;0;AL;;;;;N;;;;; 0630;ARABIC LETTER THAL;Lo;0;AL;;;;;N;;;;; 0631;ARABIC LETTER REH;Lo;0;AL;;;;;N;ARABIC LETTER RA;;;; 0632;ARABIC LETTER ZAIN;Lo;0;AL;;;;;N;;;;; 0633;ARABIC LETTER SEEN;Lo;0;AL;;;;;N;;;;; 0634;ARABIC LETTER SHEEN;Lo;0;AL;;;;;N;;;;; 0635;ARABIC LETTER SAD;Lo;0;AL;;;;;N;;;;; 0636;ARABIC LETTER DAD;Lo;0;AL;;;;;N;;;;; 0637;ARABIC LETTER TAH;Lo;0;AL;;;;;N;;;;; 0638;ARABIC LETTER ZAH;Lo;0;AL;;;;;N;ARABIC LETTER DHAH;;;; 0639;ARABIC LETTER AIN;Lo;0;AL;;;;;N;;;;; 063A;ARABIC LETTER GHAIN;Lo;0;AL;;;;;N;;;;; 063B;ARABIC LETTER KEHEH WITH TWO DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 063C;ARABIC LETTER KEHEH WITH THREE DOTS BELOW;Lo;0;AL;;;;;N;;;;; 063D;ARABIC LETTER FARSI YEH WITH INVERTED V;Lo;0;AL;;;;;N;;;;; 063E;ARABIC LETTER FARSI YEH WITH TWO DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 063F;ARABIC LETTER FARSI YEH WITH THREE DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 0640;ARABIC TATWEEL;Lm;0;AL;;;;;N;;;;; 0641;ARABIC LETTER FEH;Lo;0;AL;;;;;N;ARABIC LETTER FA;;;; 0642;ARABIC LETTER QAF;Lo;0;AL;;;;;N;;;;; 0643;ARABIC LETTER KAF;Lo;0;AL;;;;;N;ARABIC LETTER CAF;;;; 0644;ARABIC LETTER LAM;Lo;0;AL;;;;;N;;;;; 0645;ARABIC LETTER MEEM;Lo;0;AL;;;;;N;;;;; 0646;ARABIC LETTER NOON;Lo;0;AL;;;;;N;;;;; 0647;ARABIC LETTER HEH;Lo;0;AL;;;;;N;ARABIC LETTER HA;;;; 0648;ARABIC LETTER WAW;Lo;0;AL;;;;;N;;;;; 0649;ARABIC LETTER ALEF MAKSURA;Lo;0;AL;;;;;N;ARABIC LETTER ALEF MAQSURAH;;;; 064A;ARABIC LETTER YEH;Lo;0;AL;;;;;N;ARABIC LETTER YA;;;; 064B;ARABIC FATHATAN;Mn;27;NSM;;;;;N;;;;; 064C;ARABIC DAMMATAN;Mn;28;NSM;;;;;N;;;;; 064D;ARABIC KASRATAN;Mn;29;NSM;;;;;N;;;;; 064E;ARABIC FATHA;Mn;30;NSM;;;;;N;ARABIC FATHAH;;;; 064F;ARABIC DAMMA;Mn;31;NSM;;;;;N;ARABIC DAMMAH;;;; 0650;ARABIC KASRA;Mn;32;NSM;;;;;N;ARABIC KASRAH;;;; 0651;ARABIC SHADDA;Mn;33;NSM;;;;;N;ARABIC SHADDAH;;;; 0652;ARABIC SUKUN;Mn;34;NSM;;;;;N;;;;; 0653;ARABIC MADDAH ABOVE;Mn;230;NSM;;;;;N;;;;; 0654;ARABIC HAMZA ABOVE;Mn;230;NSM;;;;;N;;;;; 0655;ARABIC HAMZA BELOW;Mn;220;NSM;;;;;N;;;;; 0656;ARABIC SUBSCRIPT ALEF;Mn;220;NSM;;;;;N;;;;; 0657;ARABIC INVERTED DAMMA;Mn;230;NSM;;;;;N;;;;; 0658;ARABIC MARK NOON GHUNNA;Mn;230;NSM;;;;;N;;;;; 0659;ARABIC ZWARAKAY;Mn;230;NSM;;;;;N;;;;; 065A;ARABIC VOWEL SIGN SMALL V ABOVE;Mn;230;NSM;;;;;N;;;;; 065B;ARABIC VOWEL SIGN INVERTED SMALL V ABOVE;Mn;230;NSM;;;;;N;;;;; 065C;ARABIC VOWEL SIGN DOT BELOW;Mn;220;NSM;;;;;N;;;;; 065D;ARABIC REVERSED DAMMA;Mn;230;NSM;;;;;N;;;;; 065E;ARABIC FATHA WITH TWO DOTS;Mn;230;NSM;;;;;N;;;;; 065F;ARABIC WAVY HAMZA BELOW;Mn;220;NSM;;;;;N;;;;; 0660;ARABIC-INDIC DIGIT ZERO;Nd;0;AN;;0;0;0;N;;;;; 0661;ARABIC-INDIC DIGIT ONE;Nd;0;AN;;1;1;1;N;;;;; 0662;ARABIC-INDIC DIGIT TWO;Nd;0;AN;;2;2;2;N;;;;; 0663;ARABIC-INDIC DIGIT THREE;Nd;0;AN;;3;3;3;N;;;;; 0664;ARABIC-INDIC DIGIT FOUR;Nd;0;AN;;4;4;4;N;;;;; 0665;ARABIC-INDIC DIGIT FIVE;Nd;0;AN;;5;5;5;N;;;;; 0666;ARABIC-INDIC DIGIT SIX;Nd;0;AN;;6;6;6;N;;;;; 0667;ARABIC-INDIC DIGIT SEVEN;Nd;0;AN;;7;7;7;N;;;;; 0668;ARABIC-INDIC DIGIT EIGHT;Nd;0;AN;;8;8;8;N;;;;; 0669;ARABIC-INDIC DIGIT NINE;Nd;0;AN;;9;9;9;N;;;;; 066A;ARABIC PERCENT SIGN;Po;0;ET;;;;;N;;;;; 066B;ARABIC DECIMAL SEPARATOR;Po;0;AN;;;;;N;;;;; 066C;ARABIC THOUSANDS SEPARATOR;Po;0;AN;;;;;N;;;;; 066D;ARABIC FIVE POINTED STAR;Po;0;AL;;;;;N;;;;; 066E;ARABIC LETTER DOTLESS BEH;Lo;0;AL;;;;;N;;;;; 066F;ARABIC LETTER DOTLESS QAF;Lo;0;AL;;;;;N;;;;; 0670;ARABIC LETTER SUPERSCRIPT ALEF;Mn;35;NSM;;;;;N;ARABIC ALEF ABOVE;;;; 0671;ARABIC LETTER ALEF WASLA;Lo;0;AL;;;;;N;ARABIC LETTER HAMZAT WASL ON ALEF;;;; 0672;ARABIC LETTER ALEF WITH WAVY HAMZA ABOVE;Lo;0;AL;;;;;N;ARABIC LETTER WAVY HAMZAH ON ALEF;;;; 0673;ARABIC LETTER ALEF WITH WAVY HAMZA BELOW;Lo;0;AL;;;;;N;ARABIC LETTER WAVY HAMZAH UNDER ALEF;;;; 0674;ARABIC LETTER HIGH HAMZA;Lo;0;AL;;;;;N;ARABIC LETTER HIGH HAMZAH;;;; 0675;ARABIC LETTER HIGH HAMZA ALEF;Lo;0;AL; 0627 0674;;;;N;ARABIC LETTER HIGH HAMZAH ALEF;;;; 0676;ARABIC LETTER HIGH HAMZA WAW;Lo;0;AL; 0648 0674;;;;N;ARABIC LETTER HIGH HAMZAH WAW;;;; 0677;ARABIC LETTER U WITH HAMZA ABOVE;Lo;0;AL; 06C7 0674;;;;N;ARABIC LETTER HIGH HAMZAH WAW WITH DAMMAH;;;; 0678;ARABIC LETTER HIGH HAMZA YEH;Lo;0;AL; 064A 0674;;;;N;ARABIC LETTER HIGH HAMZAH YA;;;; 0679;ARABIC LETTER TTEH;Lo;0;AL;;;;;N;ARABIC LETTER TAA WITH SMALL TAH;;;; 067A;ARABIC LETTER TTEHEH;Lo;0;AL;;;;;N;ARABIC LETTER TAA WITH TWO DOTS VERTICAL ABOVE;;;; 067B;ARABIC LETTER BEEH;Lo;0;AL;;;;;N;ARABIC LETTER BAA WITH TWO DOTS VERTICAL BELOW;;;; 067C;ARABIC LETTER TEH WITH RING;Lo;0;AL;;;;;N;ARABIC LETTER TAA WITH RING;;;; 067D;ARABIC LETTER TEH WITH THREE DOTS ABOVE DOWNWARDS;Lo;0;AL;;;;;N;ARABIC LETTER TAA WITH THREE DOTS ABOVE DOWNWARD;;;; 067E;ARABIC LETTER PEH;Lo;0;AL;;;;;N;ARABIC LETTER TAA WITH THREE DOTS BELOW;;;; 067F;ARABIC LETTER TEHEH;Lo;0;AL;;;;;N;ARABIC LETTER TAA WITH FOUR DOTS ABOVE;;;; 0680;ARABIC LETTER BEHEH;Lo;0;AL;;;;;N;ARABIC LETTER BAA WITH FOUR DOTS BELOW;;;; 0681;ARABIC LETTER HAH WITH HAMZA ABOVE;Lo;0;AL;;;;;N;ARABIC LETTER HAMZAH ON HAA;;;; 0682;ARABIC LETTER HAH WITH TWO DOTS VERTICAL ABOVE;Lo;0;AL;;;;;N;ARABIC LETTER HAA WITH TWO DOTS VERTICAL ABOVE;;;; 0683;ARABIC LETTER NYEH;Lo;0;AL;;;;;N;ARABIC LETTER HAA WITH MIDDLE TWO DOTS;;;; 0684;ARABIC LETTER DYEH;Lo;0;AL;;;;;N;ARABIC LETTER HAA WITH MIDDLE TWO DOTS VERTICAL;;;; 0685;ARABIC LETTER HAH WITH THREE DOTS ABOVE;Lo;0;AL;;;;;N;ARABIC LETTER HAA WITH THREE DOTS ABOVE;;;; 0686;ARABIC LETTER TCHEH;Lo;0;AL;;;;;N;ARABIC LETTER HAA WITH MIDDLE THREE DOTS DOWNWARD;;;; 0687;ARABIC LETTER TCHEHEH;Lo;0;AL;;;;;N;ARABIC LETTER HAA WITH MIDDLE FOUR DOTS;;;; 0688;ARABIC LETTER DDAL;Lo;0;AL;;;;;N;ARABIC LETTER DAL WITH SMALL TAH;;;; 0689;ARABIC LETTER DAL WITH RING;Lo;0;AL;;;;;N;;;;; 068A;ARABIC LETTER DAL WITH DOT BELOW;Lo;0;AL;;;;;N;;;;; 068B;ARABIC LETTER DAL WITH DOT BELOW AND SMALL TAH;Lo;0;AL;;;;;N;;;;; 068C;ARABIC LETTER DAHAL;Lo;0;AL;;;;;N;ARABIC LETTER DAL WITH TWO DOTS ABOVE;;;; 068D;ARABIC LETTER DDAHAL;Lo;0;AL;;;;;N;ARABIC LETTER DAL WITH TWO DOTS BELOW;;;; 068E;ARABIC LETTER DUL;Lo;0;AL;;;;;N;ARABIC LETTER DAL WITH THREE DOTS ABOVE;;;; 068F;ARABIC LETTER DAL WITH THREE DOTS ABOVE DOWNWARDS;Lo;0;AL;;;;;N;ARABIC LETTER DAL WITH THREE DOTS ABOVE DOWNWARD;;;; 0690;ARABIC LETTER DAL WITH FOUR DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 0691;ARABIC LETTER RREH;Lo;0;AL;;;;;N;ARABIC LETTER RA WITH SMALL TAH;;;; 0692;ARABIC LETTER REH WITH SMALL V;Lo;0;AL;;;;;N;ARABIC LETTER RA WITH SMALL V;;;; 0693;ARABIC LETTER REH WITH RING;Lo;0;AL;;;;;N;ARABIC LETTER RA WITH RING;;;; 0694;ARABIC LETTER REH WITH DOT BELOW;Lo;0;AL;;;;;N;ARABIC LETTER RA WITH DOT BELOW;;;; 0695;ARABIC LETTER REH WITH SMALL V BELOW;Lo;0;AL;;;;;N;ARABIC LETTER RA WITH SMALL V BELOW;;;; 0696;ARABIC LETTER REH WITH DOT BELOW AND DOT ABOVE;Lo;0;AL;;;;;N;ARABIC LETTER RA WITH DOT BELOW AND DOT ABOVE;;;; 0697;ARABIC LETTER REH WITH TWO DOTS ABOVE;Lo;0;AL;;;;;N;ARABIC LETTER RA WITH TWO DOTS ABOVE;;;; 0698;ARABIC LETTER JEH;Lo;0;AL;;;;;N;ARABIC LETTER RA WITH THREE DOTS ABOVE;;;; 0699;ARABIC LETTER REH WITH FOUR DOTS ABOVE;Lo;0;AL;;;;;N;ARABIC LETTER RA WITH FOUR DOTS ABOVE;;;; 069A;ARABIC LETTER SEEN WITH DOT BELOW AND DOT ABOVE;Lo;0;AL;;;;;N;;;;; 069B;ARABIC LETTER SEEN WITH THREE DOTS BELOW;Lo;0;AL;;;;;N;;;;; 069C;ARABIC LETTER SEEN WITH THREE DOTS BELOW AND THREE DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 069D;ARABIC LETTER SAD WITH TWO DOTS BELOW;Lo;0;AL;;;;;N;;;;; 069E;ARABIC LETTER SAD WITH THREE DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 069F;ARABIC LETTER TAH WITH THREE DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 06A0;ARABIC LETTER AIN WITH THREE DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 06A1;ARABIC LETTER DOTLESS FEH;Lo;0;AL;;;;;N;ARABIC LETTER DOTLESS FA;;;; 06A2;ARABIC LETTER FEH WITH DOT MOVED BELOW;Lo;0;AL;;;;;N;ARABIC LETTER FA WITH DOT MOVED BELOW;;;; 06A3;ARABIC LETTER FEH WITH DOT BELOW;Lo;0;AL;;;;;N;ARABIC LETTER FA WITH DOT BELOW;;;; 06A4;ARABIC LETTER VEH;Lo;0;AL;;;;;N;ARABIC LETTER FA WITH THREE DOTS ABOVE;;;; 06A5;ARABIC LETTER FEH WITH THREE DOTS BELOW;Lo;0;AL;;;;;N;ARABIC LETTER FA WITH THREE DOTS BELOW;;;; 06A6;ARABIC LETTER PEHEH;Lo;0;AL;;;;;N;ARABIC LETTER FA WITH FOUR DOTS ABOVE;;;; 06A7;ARABIC LETTER QAF WITH DOT ABOVE;Lo;0;AL;;;;;N;;;;; 06A8;ARABIC LETTER QAF WITH THREE DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 06A9;ARABIC LETTER KEHEH;Lo;0;AL;;;;;N;ARABIC LETTER OPEN CAF;;;; 06AA;ARABIC LETTER SWASH KAF;Lo;0;AL;;;;;N;ARABIC LETTER SWASH CAF;;;; 06AB;ARABIC LETTER KAF WITH RING;Lo;0;AL;;;;;N;ARABIC LETTER CAF WITH RING;;;; 06AC;ARABIC LETTER KAF WITH DOT ABOVE;Lo;0;AL;;;;;N;ARABIC LETTER CAF WITH DOT ABOVE;;;; 06AD;ARABIC LETTER NG;Lo;0;AL;;;;;N;ARABIC LETTER CAF WITH THREE DOTS ABOVE;;;; 06AE;ARABIC LETTER KAF WITH THREE DOTS BELOW;Lo;0;AL;;;;;N;ARABIC LETTER CAF WITH THREE DOTS BELOW;;;; 06AF;ARABIC LETTER GAF;Lo;0;AL;;;;;N;;;;; 06B0;ARABIC LETTER GAF WITH RING;Lo;0;AL;;;;;N;;;;; 06B1;ARABIC LETTER NGOEH;Lo;0;AL;;;;;N;ARABIC LETTER GAF WITH TWO DOTS ABOVE;;;; 06B2;ARABIC LETTER GAF WITH TWO DOTS BELOW;Lo;0;AL;;;;;N;;;;; 06B3;ARABIC LETTER GUEH;Lo;0;AL;;;;;N;ARABIC LETTER GAF WITH TWO DOTS VERTICAL BELOW;;;; 06B4;ARABIC LETTER GAF WITH THREE DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 06B5;ARABIC LETTER LAM WITH SMALL V;Lo;0;AL;;;;;N;;;;; 06B6;ARABIC LETTER LAM WITH DOT ABOVE;Lo;0;AL;;;;;N;;;;; 06B7;ARABIC LETTER LAM WITH THREE DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 06B8;ARABIC LETTER LAM WITH THREE DOTS BELOW;Lo;0;AL;;;;;N;;;;; 06B9;ARABIC LETTER NOON WITH DOT BELOW;Lo;0;AL;;;;;N;;;;; 06BA;ARABIC LETTER NOON GHUNNA;Lo;0;AL;;;;;N;ARABIC LETTER DOTLESS NOON;;;; 06BB;ARABIC LETTER RNOON;Lo;0;AL;;;;;N;ARABIC LETTER DOTLESS NOON WITH SMALL TAH;;;; 06BC;ARABIC LETTER NOON WITH RING;Lo;0;AL;;;;;N;;;;; 06BD;ARABIC LETTER NOON WITH THREE DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 06BE;ARABIC LETTER HEH DOACHASHMEE;Lo;0;AL;;;;;N;ARABIC LETTER KNOTTED HA;;;; 06BF;ARABIC LETTER TCHEH WITH DOT ABOVE;Lo;0;AL;;;;;N;;;;; 06C0;ARABIC LETTER HEH WITH YEH ABOVE;Lo;0;AL;06D5 0654;;;;N;ARABIC LETTER HAMZAH ON HA;;;; 06C1;ARABIC LETTER HEH GOAL;Lo;0;AL;;;;;N;ARABIC LETTER HA GOAL;;;; 06C2;ARABIC LETTER HEH GOAL WITH HAMZA ABOVE;Lo;0;AL;06C1 0654;;;;N;ARABIC LETTER HAMZAH ON HA GOAL;;;; 06C3;ARABIC LETTER TEH MARBUTA GOAL;Lo;0;AL;;;;;N;ARABIC LETTER TAA MARBUTAH GOAL;;;; 06C4;ARABIC LETTER WAW WITH RING;Lo;0;AL;;;;;N;;;;; 06C5;ARABIC LETTER KIRGHIZ OE;Lo;0;AL;;;;;N;ARABIC LETTER WAW WITH BAR;;;; 06C6;ARABIC LETTER OE;Lo;0;AL;;;;;N;ARABIC LETTER WAW WITH SMALL V;;;; 06C7;ARABIC LETTER U;Lo;0;AL;;;;;N;ARABIC LETTER WAW WITH DAMMAH;;;; 06C8;ARABIC LETTER YU;Lo;0;AL;;;;;N;ARABIC LETTER WAW WITH ALEF ABOVE;;;; 06C9;ARABIC LETTER KIRGHIZ YU;Lo;0;AL;;;;;N;ARABIC LETTER WAW WITH INVERTED SMALL V;;;; 06CA;ARABIC LETTER WAW WITH TWO DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 06CB;ARABIC LETTER VE;Lo;0;AL;;;;;N;ARABIC LETTER WAW WITH THREE DOTS ABOVE;;;; 06CC;ARABIC LETTER FARSI YEH;Lo;0;AL;;;;;N;ARABIC LETTER DOTLESS YA;;;; 06CD;ARABIC LETTER YEH WITH TAIL;Lo;0;AL;;;;;N;ARABIC LETTER YA WITH TAIL;;;; 06CE;ARABIC LETTER YEH WITH SMALL V;Lo;0;AL;;;;;N;ARABIC LETTER YA WITH SMALL V;;;; 06CF;ARABIC LETTER WAW WITH DOT ABOVE;Lo;0;AL;;;;;N;;;;; 06D0;ARABIC LETTER E;Lo;0;AL;;;;;N;ARABIC LETTER YA WITH TWO DOTS VERTICAL BELOW;;;; 06D1;ARABIC LETTER YEH WITH THREE DOTS BELOW;Lo;0;AL;;;;;N;ARABIC LETTER YA WITH THREE DOTS BELOW;;;; 06D2;ARABIC LETTER YEH BARREE;Lo;0;AL;;;;;N;ARABIC LETTER YA BARREE;;;; 06D3;ARABIC LETTER YEH BARREE WITH HAMZA ABOVE;Lo;0;AL;06D2 0654;;;;N;ARABIC LETTER HAMZAH ON YA BARREE;;;; 06D4;ARABIC FULL STOP;Po;0;AL;;;;;N;ARABIC PERIOD;;;; 06D5;ARABIC LETTER AE;Lo;0;AL;;;;;N;;;;; 06D6;ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA;Mn;230;NSM;;;;;N;;;;; 06D7;ARABIC SMALL HIGH LIGATURE QAF WITH LAM WITH ALEF MAKSURA;Mn;230;NSM;;;;;N;;;;; 06D8;ARABIC SMALL HIGH MEEM INITIAL FORM;Mn;230;NSM;;;;;N;;;;; 06D9;ARABIC SMALL HIGH LAM ALEF;Mn;230;NSM;;;;;N;;;;; 06DA;ARABIC SMALL HIGH JEEM;Mn;230;NSM;;;;;N;;;;; 06DB;ARABIC SMALL HIGH THREE DOTS;Mn;230;NSM;;;;;N;;;;; 06DC;ARABIC SMALL HIGH SEEN;Mn;230;NSM;;;;;N;;;;; 06DD;ARABIC END OF AYAH;Cf;0;AN;;;;;N;;;;; 06DE;ARABIC START OF RUB EL HIZB;So;0;ON;;;;;N;;;;; 06DF;ARABIC SMALL HIGH ROUNDED ZERO;Mn;230;NSM;;;;;N;;;;; 06E0;ARABIC SMALL HIGH UPRIGHT RECTANGULAR ZERO;Mn;230;NSM;;;;;N;;;;; 06E1;ARABIC SMALL HIGH DOTLESS HEAD OF KHAH;Mn;230;NSM;;;;;N;;;;; 06E2;ARABIC SMALL HIGH MEEM ISOLATED FORM;Mn;230;NSM;;;;;N;;;;; 06E3;ARABIC SMALL LOW SEEN;Mn;220;NSM;;;;;N;;;;; 06E4;ARABIC SMALL HIGH MADDA;Mn;230;NSM;;;;;N;;;;; 06E5;ARABIC SMALL WAW;Lm;0;AL;;;;;N;;;;; 06E6;ARABIC SMALL YEH;Lm;0;AL;;;;;N;;;;; 06E7;ARABIC SMALL HIGH YEH;Mn;230;NSM;;;;;N;;;;; 06E8;ARABIC SMALL HIGH NOON;Mn;230;NSM;;;;;N;;;;; 06E9;ARABIC PLACE OF SAJDAH;So;0;ON;;;;;N;;;;; 06EA;ARABIC EMPTY CENTRE LOW STOP;Mn;220;NSM;;;;;N;;;;; 06EB;ARABIC EMPTY CENTRE HIGH STOP;Mn;230;NSM;;;;;N;;;;; 06EC;ARABIC ROUNDED HIGH STOP WITH FILLED CENTRE;Mn;230;NSM;;;;;N;;;;; 06ED;ARABIC SMALL LOW MEEM;Mn;220;NSM;;;;;N;;;;; 06EE;ARABIC LETTER DAL WITH INVERTED V;Lo;0;AL;;;;;N;;;;; 06EF;ARABIC LETTER REH WITH INVERTED V;Lo;0;AL;;;;;N;;;;; 06F0;EXTENDED ARABIC-INDIC DIGIT ZERO;Nd;0;EN;;0;0;0;N;EASTERN ARABIC-INDIC DIGIT ZERO;;;; 06F1;EXTENDED ARABIC-INDIC DIGIT ONE;Nd;0;EN;;1;1;1;N;EASTERN ARABIC-INDIC DIGIT ONE;;;; 06F2;EXTENDED ARABIC-INDIC DIGIT TWO;Nd;0;EN;;2;2;2;N;EASTERN ARABIC-INDIC DIGIT TWO;;;; 06F3;EXTENDED ARABIC-INDIC DIGIT THREE;Nd;0;EN;;3;3;3;N;EASTERN ARABIC-INDIC DIGIT THREE;;;; 06F4;EXTENDED ARABIC-INDIC DIGIT FOUR;Nd;0;EN;;4;4;4;N;EASTERN ARABIC-INDIC DIGIT FOUR;;;; 06F5;EXTENDED ARABIC-INDIC DIGIT FIVE;Nd;0;EN;;5;5;5;N;EASTERN ARABIC-INDIC DIGIT FIVE;;;; 06F6;EXTENDED ARABIC-INDIC DIGIT SIX;Nd;0;EN;;6;6;6;N;EASTERN ARABIC-INDIC DIGIT SIX;;;; 06F7;EXTENDED ARABIC-INDIC DIGIT SEVEN;Nd;0;EN;;7;7;7;N;EASTERN ARABIC-INDIC DIGIT SEVEN;;;; 06F8;EXTENDED ARABIC-INDIC DIGIT EIGHT;Nd;0;EN;;8;8;8;N;EASTERN ARABIC-INDIC DIGIT EIGHT;;;; 06F9;EXTENDED ARABIC-INDIC DIGIT NINE;Nd;0;EN;;9;9;9;N;EASTERN ARABIC-INDIC DIGIT NINE;;;; 06FA;ARABIC LETTER SHEEN WITH DOT BELOW;Lo;0;AL;;;;;N;;;;; 06FB;ARABIC LETTER DAD WITH DOT BELOW;Lo;0;AL;;;;;N;;;;; 06FC;ARABIC LETTER GHAIN WITH DOT BELOW;Lo;0;AL;;;;;N;;;;; 06FD;ARABIC SIGN SINDHI AMPERSAND;So;0;AL;;;;;N;;;;; 06FE;ARABIC SIGN SINDHI POSTPOSITION MEN;So;0;AL;;;;;N;;;;; 06FF;ARABIC LETTER HEH WITH INVERTED V;Lo;0;AL;;;;;N;;;;; 0700;SYRIAC END OF PARAGRAPH;Po;0;AL;;;;;N;;;;; 0701;SYRIAC SUPRALINEAR FULL STOP;Po;0;AL;;;;;N;;;;; 0702;SYRIAC SUBLINEAR FULL STOP;Po;0;AL;;;;;N;;;;; 0703;SYRIAC SUPRALINEAR COLON;Po;0;AL;;;;;N;;;;; 0704;SYRIAC SUBLINEAR COLON;Po;0;AL;;;;;N;;;;; 0705;SYRIAC HORIZONTAL COLON;Po;0;AL;;;;;N;;;;; 0706;SYRIAC COLON SKEWED LEFT;Po;0;AL;;;;;N;;;;; 0707;SYRIAC COLON SKEWED RIGHT;Po;0;AL;;;;;N;;;;; 0708;SYRIAC SUPRALINEAR COLON SKEWED LEFT;Po;0;AL;;;;;N;;;;; 0709;SYRIAC SUBLINEAR COLON SKEWED RIGHT;Po;0;AL;;;;;N;;;;; 070A;SYRIAC CONTRACTION;Po;0;AL;;;;;N;;;;; 070B;SYRIAC HARKLEAN OBELUS;Po;0;AL;;;;;N;;;;; 070C;SYRIAC HARKLEAN METOBELUS;Po;0;AL;;;;;N;;;;; 070D;SYRIAC HARKLEAN ASTERISCUS;Po;0;AL;;;;;N;;;;; 070F;SYRIAC ABBREVIATION MARK;Cf;0;AL;;;;;N;;;;; 0710;SYRIAC LETTER ALAPH;Lo;0;AL;;;;;N;;;;; 0711;SYRIAC LETTER SUPERSCRIPT ALAPH;Mn;36;NSM;;;;;N;;;;; 0712;SYRIAC LETTER BETH;Lo;0;AL;;;;;N;;;;; 0713;SYRIAC LETTER GAMAL;Lo;0;AL;;;;;N;;;;; 0714;SYRIAC LETTER GAMAL GARSHUNI;Lo;0;AL;;;;;N;;;;; 0715;SYRIAC LETTER DALATH;Lo;0;AL;;;;;N;;;;; 0716;SYRIAC LETTER DOTLESS DALATH RISH;Lo;0;AL;;;;;N;;;;; 0717;SYRIAC LETTER HE;Lo;0;AL;;;;;N;;;;; 0718;SYRIAC LETTER WAW;Lo;0;AL;;;;;N;;;;; 0719;SYRIAC LETTER ZAIN;Lo;0;AL;;;;;N;;;;; 071A;SYRIAC LETTER HETH;Lo;0;AL;;;;;N;;;;; 071B;SYRIAC LETTER TETH;Lo;0;AL;;;;;N;;;;; 071C;SYRIAC LETTER TETH GARSHUNI;Lo;0;AL;;;;;N;;;;; 071D;SYRIAC LETTER YUDH;Lo;0;AL;;;;;N;;;;; 071E;SYRIAC LETTER YUDH HE;Lo;0;AL;;;;;N;;;;; 071F;SYRIAC LETTER KAPH;Lo;0;AL;;;;;N;;;;; 0720;SYRIAC LETTER LAMADH;Lo;0;AL;;;;;N;;;;; 0721;SYRIAC LETTER MIM;Lo;0;AL;;;;;N;;;;; 0722;SYRIAC LETTER NUN;Lo;0;AL;;;;;N;;;;; 0723;SYRIAC LETTER SEMKATH;Lo;0;AL;;;;;N;;;;; 0724;SYRIAC LETTER FINAL SEMKATH;Lo;0;AL;;;;;N;;;;; 0725;SYRIAC LETTER E;Lo;0;AL;;;;;N;;;;; 0726;SYRIAC LETTER PE;Lo;0;AL;;;;;N;;;;; 0727;SYRIAC LETTER REVERSED PE;Lo;0;AL;;;;;N;;;;; 0728;SYRIAC LETTER SADHE;Lo;0;AL;;;;;N;;;;; 0729;SYRIAC LETTER QAPH;Lo;0;AL;;;;;N;;;;; 072A;SYRIAC LETTER RISH;Lo;0;AL;;;;;N;;;;; 072B;SYRIAC LETTER SHIN;Lo;0;AL;;;;;N;;;;; 072C;SYRIAC LETTER TAW;Lo;0;AL;;;;;N;;;;; 072D;SYRIAC LETTER PERSIAN BHETH;Lo;0;AL;;;;;N;;;;; 072E;SYRIAC LETTER PERSIAN GHAMAL;Lo;0;AL;;;;;N;;;;; 072F;SYRIAC LETTER PERSIAN DHALATH;Lo;0;AL;;;;;N;;;;; 0730;SYRIAC PTHAHA ABOVE;Mn;230;NSM;;;;;N;;;;; 0731;SYRIAC PTHAHA BELOW;Mn;220;NSM;;;;;N;;;;; 0732;SYRIAC PTHAHA DOTTED;Mn;230;NSM;;;;;N;;;;; 0733;SYRIAC ZQAPHA ABOVE;Mn;230;NSM;;;;;N;;;;; 0734;SYRIAC ZQAPHA BELOW;Mn;220;NSM;;;;;N;;;;; 0735;SYRIAC ZQAPHA DOTTED;Mn;230;NSM;;;;;N;;;;; 0736;SYRIAC RBASA ABOVE;Mn;230;NSM;;;;;N;;;;; 0737;SYRIAC RBASA BELOW;Mn;220;NSM;;;;;N;;;;; 0738;SYRIAC DOTTED ZLAMA HORIZONTAL;Mn;220;NSM;;;;;N;;;;; 0739;SYRIAC DOTTED ZLAMA ANGULAR;Mn;220;NSM;;;;;N;;;;; 073A;SYRIAC HBASA ABOVE;Mn;230;NSM;;;;;N;;;;; 073B;SYRIAC HBASA BELOW;Mn;220;NSM;;;;;N;;;;; 073C;SYRIAC HBASA-ESASA DOTTED;Mn;220;NSM;;;;;N;;;;; 073D;SYRIAC ESASA ABOVE;Mn;230;NSM;;;;;N;;;;; 073E;SYRIAC ESASA BELOW;Mn;220;NSM;;;;;N;;;;; 073F;SYRIAC RWAHA;Mn;230;NSM;;;;;N;;;;; 0740;SYRIAC FEMININE DOT;Mn;230;NSM;;;;;N;;;;; 0741;SYRIAC QUSHSHAYA;Mn;230;NSM;;;;;N;;;;; 0742;SYRIAC RUKKAKHA;Mn;220;NSM;;;;;N;;;;; 0743;SYRIAC TWO VERTICAL DOTS ABOVE;Mn;230;NSM;;;;;N;;;;; 0744;SYRIAC TWO VERTICAL DOTS BELOW;Mn;220;NSM;;;;;N;;;;; 0745;SYRIAC THREE DOTS ABOVE;Mn;230;NSM;;;;;N;;;;; 0746;SYRIAC THREE DOTS BELOW;Mn;220;NSM;;;;;N;;;;; 0747;SYRIAC OBLIQUE LINE ABOVE;Mn;230;NSM;;;;;N;;;;; 0748;SYRIAC OBLIQUE LINE BELOW;Mn;220;NSM;;;;;N;;;;; 0749;SYRIAC MUSIC;Mn;230;NSM;;;;;N;;;;; 074A;SYRIAC BARREKH;Mn;230;NSM;;;;;N;;;;; 074D;SYRIAC LETTER SOGDIAN ZHAIN;Lo;0;AL;;;;;N;;;;; 074E;SYRIAC LETTER SOGDIAN KHAPH;Lo;0;AL;;;;;N;;;;; 074F;SYRIAC LETTER SOGDIAN FE;Lo;0;AL;;;;;N;;;;; 0750;ARABIC LETTER BEH WITH THREE DOTS HORIZONTALLY BELOW;Lo;0;AL;;;;;N;;;;; 0751;ARABIC LETTER BEH WITH DOT BELOW AND THREE DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 0752;ARABIC LETTER BEH WITH THREE DOTS POINTING UPWARDS BELOW;Lo;0;AL;;;;;N;;;;; 0753;ARABIC LETTER BEH WITH THREE DOTS POINTING UPWARDS BELOW AND TWO DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 0754;ARABIC LETTER BEH WITH TWO DOTS BELOW AND DOT ABOVE;Lo;0;AL;;;;;N;;;;; 0755;ARABIC LETTER BEH WITH INVERTED SMALL V BELOW;Lo;0;AL;;;;;N;;;;; 0756;ARABIC LETTER BEH WITH SMALL V;Lo;0;AL;;;;;N;;;;; 0757;ARABIC LETTER HAH WITH TWO DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 0758;ARABIC LETTER HAH WITH THREE DOTS POINTING UPWARDS BELOW;Lo;0;AL;;;;;N;;;;; 0759;ARABIC LETTER DAL WITH TWO DOTS VERTICALLY BELOW AND SMALL TAH;Lo;0;AL;;;;;N;;;;; 075A;ARABIC LETTER DAL WITH INVERTED SMALL V BELOW;Lo;0;AL;;;;;N;;;;; 075B;ARABIC LETTER REH WITH STROKE;Lo;0;AL;;;;;N;;;;; 075C;ARABIC LETTER SEEN WITH FOUR DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 075D;ARABIC LETTER AIN WITH TWO DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 075E;ARABIC LETTER AIN WITH THREE DOTS POINTING DOWNWARDS ABOVE;Lo;0;AL;;;;;N;;;;; 075F;ARABIC LETTER AIN WITH TWO DOTS VERTICALLY ABOVE;Lo;0;AL;;;;;N;;;;; 0760;ARABIC LETTER FEH WITH TWO DOTS BELOW;Lo;0;AL;;;;;N;;;;; 0761;ARABIC LETTER FEH WITH THREE DOTS POINTING UPWARDS BELOW;Lo;0;AL;;;;;N;;;;; 0762;ARABIC LETTER KEHEH WITH DOT ABOVE;Lo;0;AL;;;;;N;;;;; 0763;ARABIC LETTER KEHEH WITH THREE DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 0764;ARABIC LETTER KEHEH WITH THREE DOTS POINTING UPWARDS BELOW;Lo;0;AL;;;;;N;;;;; 0765;ARABIC LETTER MEEM WITH DOT ABOVE;Lo;0;AL;;;;;N;;;;; 0766;ARABIC LETTER MEEM WITH DOT BELOW;Lo;0;AL;;;;;N;;;;; 0767;ARABIC LETTER NOON WITH TWO DOTS BELOW;Lo;0;AL;;;;;N;;;;; 0768;ARABIC LETTER NOON WITH SMALL TAH;Lo;0;AL;;;;;N;;;;; 0769;ARABIC LETTER NOON WITH SMALL V;Lo;0;AL;;;;;N;;;;; 076A;ARABIC LETTER LAM WITH BAR;Lo;0;AL;;;;;N;;;;; 076B;ARABIC LETTER REH WITH TWO DOTS VERTICALLY ABOVE;Lo;0;AL;;;;;N;;;;; 076C;ARABIC LETTER REH WITH HAMZA ABOVE;Lo;0;AL;;;;;N;;;;; 076D;ARABIC LETTER SEEN WITH TWO DOTS VERTICALLY ABOVE;Lo;0;AL;;;;;N;;;;; 076E;ARABIC LETTER HAH WITH SMALL ARABIC LETTER TAH BELOW;Lo;0;AL;;;;;N;;;;; 076F;ARABIC LETTER HAH WITH SMALL ARABIC LETTER TAH AND TWO DOTS;Lo;0;AL;;;;;N;;;;; 0770;ARABIC LETTER SEEN WITH SMALL ARABIC LETTER TAH AND TWO DOTS;Lo;0;AL;;;;;N;;;;; 0771;ARABIC LETTER REH WITH SMALL ARABIC LETTER TAH AND TWO DOTS;Lo;0;AL;;;;;N;;;;; 0772;ARABIC LETTER HAH WITH SMALL ARABIC LETTER TAH ABOVE;Lo;0;AL;;;;;N;;;;; 0773;ARABIC LETTER ALEF WITH EXTENDED ARABIC-INDIC DIGIT TWO ABOVE;Lo;0;AL;;;;;N;;;;; 0774;ARABIC LETTER ALEF WITH EXTENDED ARABIC-INDIC DIGIT THREE ABOVE;Lo;0;AL;;;;;N;;;;; 0775;ARABIC LETTER FARSI YEH WITH EXTENDED ARABIC-INDIC DIGIT TWO ABOVE;Lo;0;AL;;;;;N;;;;; 0776;ARABIC LETTER FARSI YEH WITH EXTENDED ARABIC-INDIC DIGIT THREE ABOVE;Lo;0;AL;;;;;N;;;;; 0777;ARABIC LETTER FARSI YEH WITH EXTENDED ARABIC-INDIC DIGIT FOUR BELOW;Lo;0;AL;;;;;N;;;;; 0778;ARABIC LETTER WAW WITH EXTENDED ARABIC-INDIC DIGIT TWO ABOVE;Lo;0;AL;;;;;N;;;;; 0779;ARABIC LETTER WAW WITH EXTENDED ARABIC-INDIC DIGIT THREE ABOVE;Lo;0;AL;;;;;N;;;;; 077A;ARABIC LETTER YEH BARREE WITH EXTENDED ARABIC-INDIC DIGIT TWO ABOVE;Lo;0;AL;;;;;N;;;;; 077B;ARABIC LETTER YEH BARREE WITH EXTENDED ARABIC-INDIC DIGIT THREE ABOVE;Lo;0;AL;;;;;N;;;;; 077C;ARABIC LETTER HAH WITH EXTENDED ARABIC-INDIC DIGIT FOUR BELOW;Lo;0;AL;;;;;N;;;;; 077D;ARABIC LETTER SEEN WITH EXTENDED ARABIC-INDIC DIGIT FOUR ABOVE;Lo;0;AL;;;;;N;;;;; 077E;ARABIC LETTER SEEN WITH INVERTED V;Lo;0;AL;;;;;N;;;;; 077F;ARABIC LETTER KAF WITH TWO DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 0780;THAANA LETTER HAA;Lo;0;AL;;;;;N;;;;; 0781;THAANA LETTER SHAVIYANI;Lo;0;AL;;;;;N;;;;; 0782;THAANA LETTER NOONU;Lo;0;AL;;;;;N;;;;; 0783;THAANA LETTER RAA;Lo;0;AL;;;;;N;;;;; 0784;THAANA LETTER BAA;Lo;0;AL;;;;;N;;;;; 0785;THAANA LETTER LHAVIYANI;Lo;0;AL;;;;;N;;;;; 0786;THAANA LETTER KAAFU;Lo;0;AL;;;;;N;;;;; 0787;THAANA LETTER ALIFU;Lo;0;AL;;;;;N;;;;; 0788;THAANA LETTER VAAVU;Lo;0;AL;;;;;N;;;;; 0789;THAANA LETTER MEEMU;Lo;0;AL;;;;;N;;;;; 078A;THAANA LETTER FAAFU;Lo;0;AL;;;;;N;;;;; 078B;THAANA LETTER DHAALU;Lo;0;AL;;;;;N;;;;; 078C;THAANA LETTER THAA;Lo;0;AL;;;;;N;;;;; 078D;THAANA LETTER LAAMU;Lo;0;AL;;;;;N;;;;; 078E;THAANA LETTER GAAFU;Lo;0;AL;;;;;N;;;;; 078F;THAANA LETTER GNAVIYANI;Lo;0;AL;;;;;N;;;;; 0790;THAANA LETTER SEENU;Lo;0;AL;;;;;N;;;;; 0791;THAANA LETTER DAVIYANI;Lo;0;AL;;;;;N;;;;; 0792;THAANA LETTER ZAVIYANI;Lo;0;AL;;;;;N;;;;; 0793;THAANA LETTER TAVIYANI;Lo;0;AL;;;;;N;;;;; 0794;THAANA LETTER YAA;Lo;0;AL;;;;;N;;;;; 0795;THAANA LETTER PAVIYANI;Lo;0;AL;;;;;N;;;;; 0796;THAANA LETTER JAVIYANI;Lo;0;AL;;;;;N;;;;; 0797;THAANA LETTER CHAVIYANI;Lo;0;AL;;;;;N;;;;; 0798;THAANA LETTER TTAA;Lo;0;AL;;;;;N;;;;; 0799;THAANA LETTER HHAA;Lo;0;AL;;;;;N;;;;; 079A;THAANA LETTER KHAA;Lo;0;AL;;;;;N;;;;; 079B;THAANA LETTER THAALU;Lo;0;AL;;;;;N;;;;; 079C;THAANA LETTER ZAA;Lo;0;AL;;;;;N;;;;; 079D;THAANA LETTER SHEENU;Lo;0;AL;;;;;N;;;;; 079E;THAANA LETTER SAADHU;Lo;0;AL;;;;;N;;;;; 079F;THAANA LETTER DAADHU;Lo;0;AL;;;;;N;;;;; 07A0;THAANA LETTER TO;Lo;0;AL;;;;;N;;;;; 07A1;THAANA LETTER ZO;Lo;0;AL;;;;;N;;;;; 07A2;THAANA LETTER AINU;Lo;0;AL;;;;;N;;;;; 07A3;THAANA LETTER GHAINU;Lo;0;AL;;;;;N;;;;; 07A4;THAANA LETTER QAAFU;Lo;0;AL;;;;;N;;;;; 07A5;THAANA LETTER WAAVU;Lo;0;AL;;;;;N;;;;; 07A6;THAANA ABAFILI;Mn;0;NSM;;;;;N;;;;; 07A7;THAANA AABAAFILI;Mn;0;NSM;;;;;N;;;;; 07A8;THAANA IBIFILI;Mn;0;NSM;;;;;N;;;;; 07A9;THAANA EEBEEFILI;Mn;0;NSM;;;;;N;;;;; 07AA;THAANA UBUFILI;Mn;0;NSM;;;;;N;;;;; 07AB;THAANA OOBOOFILI;Mn;0;NSM;;;;;N;;;;; 07AC;THAANA EBEFILI;Mn;0;NSM;;;;;N;;;;; 07AD;THAANA EYBEYFILI;Mn;0;NSM;;;;;N;;;;; 07AE;THAANA OBOFILI;Mn;0;NSM;;;;;N;;;;; 07AF;THAANA OABOAFILI;Mn;0;NSM;;;;;N;;;;; 07B0;THAANA SUKUN;Mn;0;NSM;;;;;N;;;;; 07B1;THAANA LETTER NAA;Lo;0;AL;;;;;N;;;;; 07C0;NKO DIGIT ZERO;Nd;0;R;;0;0;0;N;;;;; 07C1;NKO DIGIT ONE;Nd;0;R;;1;1;1;N;;;;; 07C2;NKO DIGIT TWO;Nd;0;R;;2;2;2;N;;;;; 07C3;NKO DIGIT THREE;Nd;0;R;;3;3;3;N;;;;; 07C4;NKO DIGIT FOUR;Nd;0;R;;4;4;4;N;;;;; 07C5;NKO DIGIT FIVE;Nd;0;R;;5;5;5;N;;;;; 07C6;NKO DIGIT SIX;Nd;0;R;;6;6;6;N;;;;; 07C7;NKO DIGIT SEVEN;Nd;0;R;;7;7;7;N;;;;; 07C8;NKO DIGIT EIGHT;Nd;0;R;;8;8;8;N;;;;; 07C9;NKO DIGIT NINE;Nd;0;R;;9;9;9;N;;;;; 07CA;NKO LETTER A;Lo;0;R;;;;;N;;;;; 07CB;NKO LETTER EE;Lo;0;R;;;;;N;;;;; 07CC;NKO LETTER I;Lo;0;R;;;;;N;;;;; 07CD;NKO LETTER E;Lo;0;R;;;;;N;;;;; 07CE;NKO LETTER U;Lo;0;R;;;;;N;;;;; 07CF;NKO LETTER OO;Lo;0;R;;;;;N;;;;; 07D0;NKO LETTER O;Lo;0;R;;;;;N;;;;; 07D1;NKO LETTER DAGBASINNA;Lo;0;R;;;;;N;;;;; 07D2;NKO LETTER N;Lo;0;R;;;;;N;;;;; 07D3;NKO LETTER BA;Lo;0;R;;;;;N;;;;; 07D4;NKO LETTER PA;Lo;0;R;;;;;N;;;;; 07D5;NKO LETTER TA;Lo;0;R;;;;;N;;;;; 07D6;NKO LETTER JA;Lo;0;R;;;;;N;;;;; 07D7;NKO LETTER CHA;Lo;0;R;;;;;N;;;;; 07D8;NKO LETTER DA;Lo;0;R;;;;;N;;;;; 07D9;NKO LETTER RA;Lo;0;R;;;;;N;;;;; 07DA;NKO LETTER RRA;Lo;0;R;;;;;N;;;;; 07DB;NKO LETTER SA;Lo;0;R;;;;;N;;;;; 07DC;NKO LETTER GBA;Lo;0;R;;;;;N;;;;; 07DD;NKO LETTER FA;Lo;0;R;;;;;N;;;;; 07DE;NKO LETTER KA;Lo;0;R;;;;;N;;;;; 07DF;NKO LETTER LA;Lo;0;R;;;;;N;;;;; 07E0;NKO LETTER NA WOLOSO;Lo;0;R;;;;;N;;;;; 07E1;NKO LETTER MA;Lo;0;R;;;;;N;;;;; 07E2;NKO LETTER NYA;Lo;0;R;;;;;N;;;;; 07E3;NKO LETTER NA;Lo;0;R;;;;;N;;;;; 07E4;NKO LETTER HA;Lo;0;R;;;;;N;;;;; 07E5;NKO LETTER WA;Lo;0;R;;;;;N;;;;; 07E6;NKO LETTER YA;Lo;0;R;;;;;N;;;;; 07E7;NKO LETTER NYA WOLOSO;Lo;0;R;;;;;N;;;;; 07E8;NKO LETTER JONA JA;Lo;0;R;;;;;N;;;;; 07E9;NKO LETTER JONA CHA;Lo;0;R;;;;;N;;;;; 07EA;NKO LETTER JONA RA;Lo;0;R;;;;;N;;;;; 07EB;NKO COMBINING SHORT HIGH TONE;Mn;230;NSM;;;;;N;;;;; 07EC;NKO COMBINING SHORT LOW TONE;Mn;230;NSM;;;;;N;;;;; 07ED;NKO COMBINING SHORT RISING TONE;Mn;230;NSM;;;;;N;;;;; 07EE;NKO COMBINING LONG DESCENDING TONE;Mn;230;NSM;;;;;N;;;;; 07EF;NKO COMBINING LONG HIGH TONE;Mn;230;NSM;;;;;N;;;;; 07F0;NKO COMBINING LONG LOW TONE;Mn;230;NSM;;;;;N;;;;; 07F1;NKO COMBINING LONG RISING TONE;Mn;230;NSM;;;;;N;;;;; 07F2;NKO COMBINING NASALIZATION MARK;Mn;220;NSM;;;;;N;;;;; 07F3;NKO COMBINING DOUBLE DOT ABOVE;Mn;230;NSM;;;;;N;;;;; 07F4;NKO HIGH TONE APOSTROPHE;Lm;0;R;;;;;N;;;;; 07F5;NKO LOW TONE APOSTROPHE;Lm;0;R;;;;;N;;;;; 07F6;NKO SYMBOL OO DENNEN;So;0;ON;;;;;N;;;;; 07F7;NKO SYMBOL GBAKURUNEN;Po;0;ON;;;;;N;;;;; 07F8;NKO COMMA;Po;0;ON;;;;;N;;;;; 07F9;NKO EXCLAMATION MARK;Po;0;ON;;;;;N;;;;; 07FA;NKO LAJANYALAN;Lm;0;R;;;;;N;;;;; 0800;SAMARITAN LETTER ALAF;Lo;0;R;;;;;N;;;;; 0801;SAMARITAN LETTER BIT;Lo;0;R;;;;;N;;;;; 0802;SAMARITAN LETTER GAMAN;Lo;0;R;;;;;N;;;;; 0803;SAMARITAN LETTER DALAT;Lo;0;R;;;;;N;;;;; 0804;SAMARITAN LETTER IY;Lo;0;R;;;;;N;;;;; 0805;SAMARITAN LETTER BAA;Lo;0;R;;;;;N;;;;; 0806;SAMARITAN LETTER ZEN;Lo;0;R;;;;;N;;;;; 0807;SAMARITAN LETTER IT;Lo;0;R;;;;;N;;;;; 0808;SAMARITAN LETTER TIT;Lo;0;R;;;;;N;;;;; 0809;SAMARITAN LETTER YUT;Lo;0;R;;;;;N;;;;; 080A;SAMARITAN LETTER KAAF;Lo;0;R;;;;;N;;;;; 080B;SAMARITAN LETTER LABAT;Lo;0;R;;;;;N;;;;; 080C;SAMARITAN LETTER MIM;Lo;0;R;;;;;N;;;;; 080D;SAMARITAN LETTER NUN;Lo;0;R;;;;;N;;;;; 080E;SAMARITAN LETTER SINGAAT;Lo;0;R;;;;;N;;;;; 080F;SAMARITAN LETTER IN;Lo;0;R;;;;;N;;;;; 0810;SAMARITAN LETTER FI;Lo;0;R;;;;;N;;;;; 0811;SAMARITAN LETTER TSAADIY;Lo;0;R;;;;;N;;;;; 0812;SAMARITAN LETTER QUF;Lo;0;R;;;;;N;;;;; 0813;SAMARITAN LETTER RISH;Lo;0;R;;;;;N;;;;; 0814;SAMARITAN LETTER SHAN;Lo;0;R;;;;;N;;;;; 0815;SAMARITAN LETTER TAAF;Lo;0;R;;;;;N;;;;; 0816;SAMARITAN MARK IN;Mn;230;NSM;;;;;N;;;;; 0817;SAMARITAN MARK IN-ALAF;Mn;230;NSM;;;;;N;;;;; 0818;SAMARITAN MARK OCCLUSION;Mn;230;NSM;;;;;N;;;;; 0819;SAMARITAN MARK DAGESH;Mn;230;NSM;;;;;N;;;;; 081A;SAMARITAN MODIFIER LETTER EPENTHETIC YUT;Lm;0;R;;;;;N;;;;; 081B;SAMARITAN MARK EPENTHETIC YUT;Mn;230;NSM;;;;;N;;;;; 081C;SAMARITAN VOWEL SIGN LONG E;Mn;230;NSM;;;;;N;;;;; 081D;SAMARITAN VOWEL SIGN E;Mn;230;NSM;;;;;N;;;;; 081E;SAMARITAN VOWEL SIGN OVERLONG AA;Mn;230;NSM;;;;;N;;;;; 081F;SAMARITAN VOWEL SIGN LONG AA;Mn;230;NSM;;;;;N;;;;; 0820;SAMARITAN VOWEL SIGN AA;Mn;230;NSM;;;;;N;;;;; 0821;SAMARITAN VOWEL SIGN OVERLONG A;Mn;230;NSM;;;;;N;;;;; 0822;SAMARITAN VOWEL SIGN LONG A;Mn;230;NSM;;;;;N;;;;; 0823;SAMARITAN VOWEL SIGN A;Mn;230;NSM;;;;;N;;;;; 0824;SAMARITAN MODIFIER LETTER SHORT A;Lm;0;R;;;;;N;;;;; 0825;SAMARITAN VOWEL SIGN SHORT A;Mn;230;NSM;;;;;N;;;;; 0826;SAMARITAN VOWEL SIGN LONG U;Mn;230;NSM;;;;;N;;;;; 0827;SAMARITAN VOWEL SIGN U;Mn;230;NSM;;;;;N;;;;; 0828;SAMARITAN MODIFIER LETTER I;Lm;0;R;;;;;N;;;;; 0829;SAMARITAN VOWEL SIGN LONG I;Mn;230;NSM;;;;;N;;;;; 082A;SAMARITAN VOWEL SIGN I;Mn;230;NSM;;;;;N;;;;; 082B;SAMARITAN VOWEL SIGN O;Mn;230;NSM;;;;;N;;;;; 082C;SAMARITAN VOWEL SIGN SUKUN;Mn;230;NSM;;;;;N;;;;; 082D;SAMARITAN MARK NEQUDAA;Mn;230;NSM;;;;;N;;;;; 0830;SAMARITAN PUNCTUATION NEQUDAA;Po;0;R;;;;;N;;;;; 0831;SAMARITAN PUNCTUATION AFSAAQ;Po;0;R;;;;;N;;;;; 0832;SAMARITAN PUNCTUATION ANGED;Po;0;R;;;;;N;;;;; 0833;SAMARITAN PUNCTUATION BAU;Po;0;R;;;;;N;;;;; 0834;SAMARITAN PUNCTUATION ATMAAU;Po;0;R;;;;;N;;;;; 0835;SAMARITAN PUNCTUATION SHIYYAALAA;Po;0;R;;;;;N;;;;; 0836;SAMARITAN ABBREVIATION MARK;Po;0;R;;;;;N;;;;; 0837;SAMARITAN PUNCTUATION MELODIC QITSA;Po;0;R;;;;;N;;;;; 0838;SAMARITAN PUNCTUATION ZIQAA;Po;0;R;;;;;N;;;;; 0839;SAMARITAN PUNCTUATION QITSA;Po;0;R;;;;;N;;;;; 083A;SAMARITAN PUNCTUATION ZAEF;Po;0;R;;;;;N;;;;; 083B;SAMARITAN PUNCTUATION TURU;Po;0;R;;;;;N;;;;; 083C;SAMARITAN PUNCTUATION ARKAANU;Po;0;R;;;;;N;;;;; 083D;SAMARITAN PUNCTUATION SOF MASHFAAT;Po;0;R;;;;;N;;;;; 083E;SAMARITAN PUNCTUATION ANNAAU;Po;0;R;;;;;N;;;;; 0840;MANDAIC LETTER HALQA;Lo;0;R;;;;;N;;;;; 0841;MANDAIC LETTER AB;Lo;0;R;;;;;N;;;;; 0842;MANDAIC LETTER AG;Lo;0;R;;;;;N;;;;; 0843;MANDAIC LETTER AD;Lo;0;R;;;;;N;;;;; 0844;MANDAIC LETTER AH;Lo;0;R;;;;;N;;;;; 0845;MANDAIC LETTER USHENNA;Lo;0;R;;;;;N;;;;; 0846;MANDAIC LETTER AZ;Lo;0;R;;;;;N;;;;; 0847;MANDAIC LETTER IT;Lo;0;R;;;;;N;;;;; 0848;MANDAIC LETTER ATT;Lo;0;R;;;;;N;;;;; 0849;MANDAIC LETTER AKSA;Lo;0;R;;;;;N;;;;; 084A;MANDAIC LETTER AK;Lo;0;R;;;;;N;;;;; 084B;MANDAIC LETTER AL;Lo;0;R;;;;;N;;;;; 084C;MANDAIC LETTER AM;Lo;0;R;;;;;N;;;;; 084D;MANDAIC LETTER AN;Lo;0;R;;;;;N;;;;; 084E;MANDAIC LETTER AS;Lo;0;R;;;;;N;;;;; 084F;MANDAIC LETTER IN;Lo;0;R;;;;;N;;;;; 0850;MANDAIC LETTER AP;Lo;0;R;;;;;N;;;;; 0851;MANDAIC LETTER ASZ;Lo;0;R;;;;;N;;;;; 0852;MANDAIC LETTER AQ;Lo;0;R;;;;;N;;;;; 0853;MANDAIC LETTER AR;Lo;0;R;;;;;N;;;;; 0854;MANDAIC LETTER ASH;Lo;0;R;;;;;N;;;;; 0855;MANDAIC LETTER AT;Lo;0;R;;;;;N;;;;; 0856;MANDAIC LETTER DUSHENNA;Lo;0;R;;;;;N;;;;; 0857;MANDAIC LETTER KAD;Lo;0;R;;;;;N;;;;; 0858;MANDAIC LETTER AIN;Lo;0;R;;;;;N;;;;; 0859;MANDAIC AFFRICATION MARK;Mn;220;NSM;;;;;N;;;;; 085A;MANDAIC VOCALIZATION MARK;Mn;220;NSM;;;;;N;;;;; 085B;MANDAIC GEMINATION MARK;Mn;220;NSM;;;;;N;;;;; 085E;MANDAIC PUNCTUATION;Po;0;R;;;;;N;;;;; 08A0;ARABIC LETTER BEH WITH SMALL V BELOW;Lo;0;AL;;;;;N;;;;; 08A2;ARABIC LETTER JEEM WITH TWO DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 08A3;ARABIC LETTER TAH WITH TWO DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 08A4;ARABIC LETTER FEH WITH DOT BELOW AND THREE DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 08A5;ARABIC LETTER QAF WITH DOT BELOW;Lo;0;AL;;;;;N;;;;; 08A6;ARABIC LETTER LAM WITH DOUBLE BAR;Lo;0;AL;;;;;N;;;;; 08A7;ARABIC LETTER MEEM WITH THREE DOTS ABOVE;Lo;0;AL;;;;;N;;;;; 08A8;ARABIC LETTER YEH WITH TWO DOTS BELOW AND HAMZA ABOVE;Lo;0;AL;;;;;N;;;;; 08A9;ARABIC LETTER YEH WITH TWO DOTS BELOW AND DOT ABOVE;Lo;0;AL;;;;;N;;;;; 08AA;ARABIC LETTER REH WITH LOOP;Lo;0;AL;;;;;N;;;;; 08AB;ARABIC LETTER WAW WITH DOT WITHIN;Lo;0;AL;;;;;N;;;;; 08AC;ARABIC LETTER ROHINGYA YEH;Lo;0;AL;;;;;N;;;;; 08E4;ARABIC CURLY FATHA;Mn;230;NSM;;;;;N;;;;; 08E5;ARABIC CURLY DAMMA;Mn;230;NSM;;;;;N;;;;; 08E6;ARABIC CURLY KASRA;Mn;220;NSM;;;;;N;;;;; 08E7;ARABIC CURLY FATHATAN;Mn;230;NSM;;;;;N;;;;; 08E8;ARABIC CURLY DAMMATAN;Mn;230;NSM;;;;;N;;;;; 08E9;ARABIC CURLY KASRATAN;Mn;220;NSM;;;;;N;;;;; 08EA;ARABIC TONE ONE DOT ABOVE;Mn;230;NSM;;;;;N;;;;; 08EB;ARABIC TONE TWO DOTS ABOVE;Mn;230;NSM;;;;;N;;;;; 08EC;ARABIC TONE LOOP ABOVE;Mn;230;NSM;;;;;N;;;;; 08ED;ARABIC TONE ONE DOT BELOW;Mn;220;NSM;;;;;N;;;;; 08EE;ARABIC TONE TWO DOTS BELOW;Mn;220;NSM;;;;;N;;;;; 08EF;ARABIC TONE LOOP BELOW;Mn;220;NSM;;;;;N;;;;; 08F0;ARABIC OPEN FATHATAN;Mn;27;NSM;;;;;N;;;;; 08F1;ARABIC OPEN DAMMATAN;Mn;28;NSM;;;;;N;;;;; 08F2;ARABIC OPEN KASRATAN;Mn;29;NSM;;;;;N;;;;; 08F3;ARABIC SMALL HIGH WAW;Mn;230;NSM;;;;;N;;;;; 08F4;ARABIC FATHA WITH RING;Mn;230;NSM;;;;;N;;;;; 08F5;ARABIC FATHA WITH DOT ABOVE;Mn;230;NSM;;;;;N;;;;; 08F6;ARABIC KASRA WITH DOT BELOW;Mn;220;NSM;;;;;N;;;;; 08F7;ARABIC LEFT ARROWHEAD ABOVE;Mn;230;NSM;;;;;N;;;;; 08F8;ARABIC RIGHT ARROWHEAD ABOVE;Mn;230;NSM;;;;;N;;;;; 08F9;ARABIC LEFT ARROWHEAD BELOW;Mn;220;NSM;;;;;N;;;;; 08FA;ARABIC RIGHT ARROWHEAD BELOW;Mn;220;NSM;;;;;N;;;;; 08FB;ARABIC DOUBLE RIGHT ARROWHEAD ABOVE;Mn;230;NSM;;;;;N;;;;; 08FC;ARABIC DOUBLE RIGHT ARROWHEAD ABOVE WITH DOT;Mn;230;NSM;;;;;N;;;;; 08FD;ARABIC RIGHT ARROWHEAD ABOVE WITH DOT;Mn;230;NSM;;;;;N;;;;; 08FE;ARABIC DAMMA WITH DOT;Mn;230;NSM;;;;;N;;;;; 0900;DEVANAGARI SIGN INVERTED CANDRABINDU;Mn;0;NSM;;;;;N;;;;; 0901;DEVANAGARI SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;; 0902;DEVANAGARI SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; 0903;DEVANAGARI SIGN VISARGA;Mc;0;L;;;;;N;;;;; 0904;DEVANAGARI LETTER SHORT A;Lo;0;L;;;;;N;;;;; 0905;DEVANAGARI LETTER A;Lo;0;L;;;;;N;;;;; 0906;DEVANAGARI LETTER AA;Lo;0;L;;;;;N;;;;; 0907;DEVANAGARI LETTER I;Lo;0;L;;;;;N;;;;; 0908;DEVANAGARI LETTER II;Lo;0;L;;;;;N;;;;; 0909;DEVANAGARI LETTER U;Lo;0;L;;;;;N;;;;; 090A;DEVANAGARI LETTER UU;Lo;0;L;;;;;N;;;;; 090B;DEVANAGARI LETTER VOCALIC R;Lo;0;L;;;;;N;;;;; 090C;DEVANAGARI LETTER VOCALIC L;Lo;0;L;;;;;N;;;;; 090D;DEVANAGARI LETTER CANDRA E;Lo;0;L;;;;;N;;;;; 090E;DEVANAGARI LETTER SHORT E;Lo;0;L;;;;;N;;;;; 090F;DEVANAGARI LETTER E;Lo;0;L;;;;;N;;;;; 0910;DEVANAGARI LETTER AI;Lo;0;L;;;;;N;;;;; 0911;DEVANAGARI LETTER CANDRA O;Lo;0;L;;;;;N;;;;; 0912;DEVANAGARI LETTER SHORT O;Lo;0;L;;;;;N;;;;; 0913;DEVANAGARI LETTER O;Lo;0;L;;;;;N;;;;; 0914;DEVANAGARI LETTER AU;Lo;0;L;;;;;N;;;;; 0915;DEVANAGARI LETTER KA;Lo;0;L;;;;;N;;;;; 0916;DEVANAGARI LETTER KHA;Lo;0;L;;;;;N;;;;; 0917;DEVANAGARI LETTER GA;Lo;0;L;;;;;N;;;;; 0918;DEVANAGARI LETTER GHA;Lo;0;L;;;;;N;;;;; 0919;DEVANAGARI LETTER NGA;Lo;0;L;;;;;N;;;;; 091A;DEVANAGARI LETTER CA;Lo;0;L;;;;;N;;;;; 091B;DEVANAGARI LETTER CHA;Lo;0;L;;;;;N;;;;; 091C;DEVANAGARI LETTER JA;Lo;0;L;;;;;N;;;;; 091D;DEVANAGARI LETTER JHA;Lo;0;L;;;;;N;;;;; 091E;DEVANAGARI LETTER NYA;Lo;0;L;;;;;N;;;;; 091F;DEVANAGARI LETTER TTA;Lo;0;L;;;;;N;;;;; 0920;DEVANAGARI LETTER TTHA;Lo;0;L;;;;;N;;;;; 0921;DEVANAGARI LETTER DDA;Lo;0;L;;;;;N;;;;; 0922;DEVANAGARI LETTER DDHA;Lo;0;L;;;;;N;;;;; 0923;DEVANAGARI LETTER NNA;Lo;0;L;;;;;N;;;;; 0924;DEVANAGARI LETTER TA;Lo;0;L;;;;;N;;;;; 0925;DEVANAGARI LETTER THA;Lo;0;L;;;;;N;;;;; 0926;DEVANAGARI LETTER DA;Lo;0;L;;;;;N;;;;; 0927;DEVANAGARI LETTER DHA;Lo;0;L;;;;;N;;;;; 0928;DEVANAGARI LETTER NA;Lo;0;L;;;;;N;;;;; 0929;DEVANAGARI LETTER NNNA;Lo;0;L;0928 093C;;;;N;;;;; 092A;DEVANAGARI LETTER PA;Lo;0;L;;;;;N;;;;; 092B;DEVANAGARI LETTER PHA;Lo;0;L;;;;;N;;;;; 092C;DEVANAGARI LETTER BA;Lo;0;L;;;;;N;;;;; 092D;DEVANAGARI LETTER BHA;Lo;0;L;;;;;N;;;;; 092E;DEVANAGARI LETTER MA;Lo;0;L;;;;;N;;;;; 092F;DEVANAGARI LETTER YA;Lo;0;L;;;;;N;;;;; 0930;DEVANAGARI LETTER RA;Lo;0;L;;;;;N;;;;; 0931;DEVANAGARI LETTER RRA;Lo;0;L;0930 093C;;;;N;;;;; 0932;DEVANAGARI LETTER LA;Lo;0;L;;;;;N;;;;; 0933;DEVANAGARI LETTER LLA;Lo;0;L;;;;;N;;;;; 0934;DEVANAGARI LETTER LLLA;Lo;0;L;0933 093C;;;;N;;;;; 0935;DEVANAGARI LETTER VA;Lo;0;L;;;;;N;;;;; 0936;DEVANAGARI LETTER SHA;Lo;0;L;;;;;N;;;;; 0937;DEVANAGARI LETTER SSA;Lo;0;L;;;;;N;;;;; 0938;DEVANAGARI LETTER SA;Lo;0;L;;;;;N;;;;; 0939;DEVANAGARI LETTER HA;Lo;0;L;;;;;N;;;;; 093A;DEVANAGARI VOWEL SIGN OE;Mn;0;NSM;;;;;N;;;;; 093B;DEVANAGARI VOWEL SIGN OOE;Mc;0;L;;;;;N;;;;; 093C;DEVANAGARI SIGN NUKTA;Mn;7;NSM;;;;;N;;;;; 093D;DEVANAGARI SIGN AVAGRAHA;Lo;0;L;;;;;N;;;;; 093E;DEVANAGARI VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 093F;DEVANAGARI VOWEL SIGN I;Mc;0;L;;;;;N;;;;; 0940;DEVANAGARI VOWEL SIGN II;Mc;0;L;;;;;N;;;;; 0941;DEVANAGARI VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 0942;DEVANAGARI VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 0943;DEVANAGARI VOWEL SIGN VOCALIC R;Mn;0;NSM;;;;;N;;;;; 0944;DEVANAGARI VOWEL SIGN VOCALIC RR;Mn;0;NSM;;;;;N;;;;; 0945;DEVANAGARI VOWEL SIGN CANDRA E;Mn;0;NSM;;;;;N;;;;; 0946;DEVANAGARI VOWEL SIGN SHORT E;Mn;0;NSM;;;;;N;;;;; 0947;DEVANAGARI VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; 0948;DEVANAGARI VOWEL SIGN AI;Mn;0;NSM;;;;;N;;;;; 0949;DEVANAGARI VOWEL SIGN CANDRA O;Mc;0;L;;;;;N;;;;; 094A;DEVANAGARI VOWEL SIGN SHORT O;Mc;0;L;;;;;N;;;;; 094B;DEVANAGARI VOWEL SIGN O;Mc;0;L;;;;;N;;;;; 094C;DEVANAGARI VOWEL SIGN AU;Mc;0;L;;;;;N;;;;; 094D;DEVANAGARI SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 094E;DEVANAGARI VOWEL SIGN PRISHTHAMATRA E;Mc;0;L;;;;;N;;;;; 094F;DEVANAGARI VOWEL SIGN AW;Mc;0;L;;;;;N;;;;; 0950;DEVANAGARI OM;Lo;0;L;;;;;N;;;;; 0951;DEVANAGARI STRESS SIGN UDATTA;Mn;230;NSM;;;;;N;;;;; 0952;DEVANAGARI STRESS SIGN ANUDATTA;Mn;220;NSM;;;;;N;;;;; 0953;DEVANAGARI GRAVE ACCENT;Mn;230;NSM;;;;;N;;;;; 0954;DEVANAGARI ACUTE ACCENT;Mn;230;NSM;;;;;N;;;;; 0955;DEVANAGARI VOWEL SIGN CANDRA LONG E;Mn;0;NSM;;;;;N;;;;; 0956;DEVANAGARI VOWEL SIGN UE;Mn;0;NSM;;;;;N;;;;; 0957;DEVANAGARI VOWEL SIGN UUE;Mn;0;NSM;;;;;N;;;;; 0958;DEVANAGARI LETTER QA;Lo;0;L;0915 093C;;;;N;;;;; 0959;DEVANAGARI LETTER KHHA;Lo;0;L;0916 093C;;;;N;;;;; 095A;DEVANAGARI LETTER GHHA;Lo;0;L;0917 093C;;;;N;;;;; 095B;DEVANAGARI LETTER ZA;Lo;0;L;091C 093C;;;;N;;;;; 095C;DEVANAGARI LETTER DDDHA;Lo;0;L;0921 093C;;;;N;;;;; 095D;DEVANAGARI LETTER RHA;Lo;0;L;0922 093C;;;;N;;;;; 095E;DEVANAGARI LETTER FA;Lo;0;L;092B 093C;;;;N;;;;; 095F;DEVANAGARI LETTER YYA;Lo;0;L;092F 093C;;;;N;;;;; 0960;DEVANAGARI LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; 0961;DEVANAGARI LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;; 0962;DEVANAGARI VOWEL SIGN VOCALIC L;Mn;0;NSM;;;;;N;;;;; 0963;DEVANAGARI VOWEL SIGN VOCALIC LL;Mn;0;NSM;;;;;N;;;;; 0964;DEVANAGARI DANDA;Po;0;L;;;;;N;;;;; 0965;DEVANAGARI DOUBLE DANDA;Po;0;L;;;;;N;;;;; 0966;DEVANAGARI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 0967;DEVANAGARI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 0968;DEVANAGARI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 0969;DEVANAGARI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 096A;DEVANAGARI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 096B;DEVANAGARI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 096C;DEVANAGARI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 096D;DEVANAGARI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 096E;DEVANAGARI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 096F;DEVANAGARI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 0970;DEVANAGARI ABBREVIATION SIGN;Po;0;L;;;;;N;;;;; 0971;DEVANAGARI SIGN HIGH SPACING DOT;Lm;0;L;;;;;N;;;;; 0972;DEVANAGARI LETTER CANDRA A;Lo;0;L;;;;;N;;;;; 0973;DEVANAGARI LETTER OE;Lo;0;L;;;;;N;;;;; 0974;DEVANAGARI LETTER OOE;Lo;0;L;;;;;N;;;;; 0975;DEVANAGARI LETTER AW;Lo;0;L;;;;;N;;;;; 0976;DEVANAGARI LETTER UE;Lo;0;L;;;;;N;;;;; 0977;DEVANAGARI LETTER UUE;Lo;0;L;;;;;N;;;;; 0979;DEVANAGARI LETTER ZHA;Lo;0;L;;;;;N;;;;; 097A;DEVANAGARI LETTER HEAVY YA;Lo;0;L;;;;;N;;;;; 097B;DEVANAGARI LETTER GGA;Lo;0;L;;;;;N;;;;; 097C;DEVANAGARI LETTER JJA;Lo;0;L;;;;;N;;;;; 097D;DEVANAGARI LETTER GLOTTAL STOP;Lo;0;L;;;;;N;;;;; 097E;DEVANAGARI LETTER DDDA;Lo;0;L;;;;;N;;;;; 097F;DEVANAGARI LETTER BBA;Lo;0;L;;;;;N;;;;; 0981;BENGALI SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;; 0982;BENGALI SIGN ANUSVARA;Mc;0;L;;;;;N;;;;; 0983;BENGALI SIGN VISARGA;Mc;0;L;;;;;N;;;;; 0985;BENGALI LETTER A;Lo;0;L;;;;;N;;;;; 0986;BENGALI LETTER AA;Lo;0;L;;;;;N;;;;; 0987;BENGALI LETTER I;Lo;0;L;;;;;N;;;;; 0988;BENGALI LETTER II;Lo;0;L;;;;;N;;;;; 0989;BENGALI LETTER U;Lo;0;L;;;;;N;;;;; 098A;BENGALI LETTER UU;Lo;0;L;;;;;N;;;;; 098B;BENGALI LETTER VOCALIC R;Lo;0;L;;;;;N;;;;; 098C;BENGALI LETTER VOCALIC L;Lo;0;L;;;;;N;;;;; 098F;BENGALI LETTER E;Lo;0;L;;;;;N;;;;; 0990;BENGALI LETTER AI;Lo;0;L;;;;;N;;;;; 0993;BENGALI LETTER O;Lo;0;L;;;;;N;;;;; 0994;BENGALI LETTER AU;Lo;0;L;;;;;N;;;;; 0995;BENGALI LETTER KA;Lo;0;L;;;;;N;;;;; 0996;BENGALI LETTER KHA;Lo;0;L;;;;;N;;;;; 0997;BENGALI LETTER GA;Lo;0;L;;;;;N;;;;; 0998;BENGALI LETTER GHA;Lo;0;L;;;;;N;;;;; 0999;BENGALI LETTER NGA;Lo;0;L;;;;;N;;;;; 099A;BENGALI LETTER CA;Lo;0;L;;;;;N;;;;; 099B;BENGALI LETTER CHA;Lo;0;L;;;;;N;;;;; 099C;BENGALI LETTER JA;Lo;0;L;;;;;N;;;;; 099D;BENGALI LETTER JHA;Lo;0;L;;;;;N;;;;; 099E;BENGALI LETTER NYA;Lo;0;L;;;;;N;;;;; 099F;BENGALI LETTER TTA;Lo;0;L;;;;;N;;;;; 09A0;BENGALI LETTER TTHA;Lo;0;L;;;;;N;;;;; 09A1;BENGALI LETTER DDA;Lo;0;L;;;;;N;;;;; 09A2;BENGALI LETTER DDHA;Lo;0;L;;;;;N;;;;; 09A3;BENGALI LETTER NNA;Lo;0;L;;;;;N;;;;; 09A4;BENGALI LETTER TA;Lo;0;L;;;;;N;;;;; 09A5;BENGALI LETTER THA;Lo;0;L;;;;;N;;;;; 09A6;BENGALI LETTER DA;Lo;0;L;;;;;N;;;;; 09A7;BENGALI LETTER DHA;Lo;0;L;;;;;N;;;;; 09A8;BENGALI LETTER NA;Lo;0;L;;;;;N;;;;; 09AA;BENGALI LETTER PA;Lo;0;L;;;;;N;;;;; 09AB;BENGALI LETTER PHA;Lo;0;L;;;;;N;;;;; 09AC;BENGALI LETTER BA;Lo;0;L;;;;;N;;;;; 09AD;BENGALI LETTER BHA;Lo;0;L;;;;;N;;;;; 09AE;BENGALI LETTER MA;Lo;0;L;;;;;N;;;;; 09AF;BENGALI LETTER YA;Lo;0;L;;;;;N;;;;; 09B0;BENGALI LETTER RA;Lo;0;L;;;;;N;;;;; 09B2;BENGALI LETTER LA;Lo;0;L;;;;;N;;;;; 09B6;BENGALI LETTER SHA;Lo;0;L;;;;;N;;;;; 09B7;BENGALI LETTER SSA;Lo;0;L;;;;;N;;;;; 09B8;BENGALI LETTER SA;Lo;0;L;;;;;N;;;;; 09B9;BENGALI LETTER HA;Lo;0;L;;;;;N;;;;; 09BC;BENGALI SIGN NUKTA;Mn;7;NSM;;;;;N;;;;; 09BD;BENGALI SIGN AVAGRAHA;Lo;0;L;;;;;N;;;;; 09BE;BENGALI VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 09BF;BENGALI VOWEL SIGN I;Mc;0;L;;;;;N;;;;; 09C0;BENGALI VOWEL SIGN II;Mc;0;L;;;;;N;;;;; 09C1;BENGALI VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 09C2;BENGALI VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 09C3;BENGALI VOWEL SIGN VOCALIC R;Mn;0;NSM;;;;;N;;;;; 09C4;BENGALI VOWEL SIGN VOCALIC RR;Mn;0;NSM;;;;;N;;;;; 09C7;BENGALI VOWEL SIGN E;Mc;0;L;;;;;N;;;;; 09C8;BENGALI VOWEL SIGN AI;Mc;0;L;;;;;N;;;;; 09CB;BENGALI VOWEL SIGN O;Mc;0;L;09C7 09BE;;;;N;;;;; 09CC;BENGALI VOWEL SIGN AU;Mc;0;L;09C7 09D7;;;;N;;;;; 09CD;BENGALI SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 09CE;BENGALI LETTER KHANDA TA;Lo;0;L;;;;;N;;;;; 09D7;BENGALI AU LENGTH MARK;Mc;0;L;;;;;N;;;;; 09DC;BENGALI LETTER RRA;Lo;0;L;09A1 09BC;;;;N;;;;; 09DD;BENGALI LETTER RHA;Lo;0;L;09A2 09BC;;;;N;;;;; 09DF;BENGALI LETTER YYA;Lo;0;L;09AF 09BC;;;;N;;;;; 09E0;BENGALI LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; 09E1;BENGALI LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;; 09E2;BENGALI VOWEL SIGN VOCALIC L;Mn;0;NSM;;;;;N;;;;; 09E3;BENGALI VOWEL SIGN VOCALIC LL;Mn;0;NSM;;;;;N;;;;; 09E6;BENGALI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 09E7;BENGALI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 09E8;BENGALI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 09E9;BENGALI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 09EA;BENGALI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 09EB;BENGALI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 09EC;BENGALI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 09ED;BENGALI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 09EE;BENGALI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 09EF;BENGALI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 09F0;BENGALI LETTER RA WITH MIDDLE DIAGONAL;Lo;0;L;;;;;N;;;;; 09F1;BENGALI LETTER RA WITH LOWER DIAGONAL;Lo;0;L;;;;;N;BENGALI LETTER VA WITH LOWER DIAGONAL;;;; 09F2;BENGALI RUPEE MARK;Sc;0;ET;;;;;N;;;;; 09F3;BENGALI RUPEE SIGN;Sc;0;ET;;;;;N;;;;; 09F4;BENGALI CURRENCY NUMERATOR ONE;No;0;L;;;;1/16;N;;;;; 09F5;BENGALI CURRENCY NUMERATOR TWO;No;0;L;;;;1/8;N;;;;; 09F6;BENGALI CURRENCY NUMERATOR THREE;No;0;L;;;;3/16;N;;;;; 09F7;BENGALI CURRENCY NUMERATOR FOUR;No;0;L;;;;1/4;N;;;;; 09F8;BENGALI CURRENCY NUMERATOR ONE LESS THAN THE DENOMINATOR;No;0;L;;;;3/4;N;;;;; 09F9;BENGALI CURRENCY DENOMINATOR SIXTEEN;No;0;L;;;;16;N;;;;; 09FA;BENGALI ISSHAR;So;0;L;;;;;N;;;;; 09FB;BENGALI GANDA MARK;Sc;0;ET;;;;;N;;;;; 0A01;GURMUKHI SIGN ADAK BINDI;Mn;0;NSM;;;;;N;;;;; 0A02;GURMUKHI SIGN BINDI;Mn;0;NSM;;;;;N;;;;; 0A03;GURMUKHI SIGN VISARGA;Mc;0;L;;;;;N;;;;; 0A05;GURMUKHI LETTER A;Lo;0;L;;;;;N;;;;; 0A06;GURMUKHI LETTER AA;Lo;0;L;;;;;N;;;;; 0A07;GURMUKHI LETTER I;Lo;0;L;;;;;N;;;;; 0A08;GURMUKHI LETTER II;Lo;0;L;;;;;N;;;;; 0A09;GURMUKHI LETTER U;Lo;0;L;;;;;N;;;;; 0A0A;GURMUKHI LETTER UU;Lo;0;L;;;;;N;;;;; 0A0F;GURMUKHI LETTER EE;Lo;0;L;;;;;N;;;;; 0A10;GURMUKHI LETTER AI;Lo;0;L;;;;;N;;;;; 0A13;GURMUKHI LETTER OO;Lo;0;L;;;;;N;;;;; 0A14;GURMUKHI LETTER AU;Lo;0;L;;;;;N;;;;; 0A15;GURMUKHI LETTER KA;Lo;0;L;;;;;N;;;;; 0A16;GURMUKHI LETTER KHA;Lo;0;L;;;;;N;;;;; 0A17;GURMUKHI LETTER GA;Lo;0;L;;;;;N;;;;; 0A18;GURMUKHI LETTER GHA;Lo;0;L;;;;;N;;;;; 0A19;GURMUKHI LETTER NGA;Lo;0;L;;;;;N;;;;; 0A1A;GURMUKHI LETTER CA;Lo;0;L;;;;;N;;;;; 0A1B;GURMUKHI LETTER CHA;Lo;0;L;;;;;N;;;;; 0A1C;GURMUKHI LETTER JA;Lo;0;L;;;;;N;;;;; 0A1D;GURMUKHI LETTER JHA;Lo;0;L;;;;;N;;;;; 0A1E;GURMUKHI LETTER NYA;Lo;0;L;;;;;N;;;;; 0A1F;GURMUKHI LETTER TTA;Lo;0;L;;;;;N;;;;; 0A20;GURMUKHI LETTER TTHA;Lo;0;L;;;;;N;;;;; 0A21;GURMUKHI LETTER DDA;Lo;0;L;;;;;N;;;;; 0A22;GURMUKHI LETTER DDHA;Lo;0;L;;;;;N;;;;; 0A23;GURMUKHI LETTER NNA;Lo;0;L;;;;;N;;;;; 0A24;GURMUKHI LETTER TA;Lo;0;L;;;;;N;;;;; 0A25;GURMUKHI LETTER THA;Lo;0;L;;;;;N;;;;; 0A26;GURMUKHI LETTER DA;Lo;0;L;;;;;N;;;;; 0A27;GURMUKHI LETTER DHA;Lo;0;L;;;;;N;;;;; 0A28;GURMUKHI LETTER NA;Lo;0;L;;;;;N;;;;; 0A2A;GURMUKHI LETTER PA;Lo;0;L;;;;;N;;;;; 0A2B;GURMUKHI LETTER PHA;Lo;0;L;;;;;N;;;;; 0A2C;GURMUKHI LETTER BA;Lo;0;L;;;;;N;;;;; 0A2D;GURMUKHI LETTER BHA;Lo;0;L;;;;;N;;;;; 0A2E;GURMUKHI LETTER MA;Lo;0;L;;;;;N;;;;; 0A2F;GURMUKHI LETTER YA;Lo;0;L;;;;;N;;;;; 0A30;GURMUKHI LETTER RA;Lo;0;L;;;;;N;;;;; 0A32;GURMUKHI LETTER LA;Lo;0;L;;;;;N;;;;; 0A33;GURMUKHI LETTER LLA;Lo;0;L;0A32 0A3C;;;;N;;;;; 0A35;GURMUKHI LETTER VA;Lo;0;L;;;;;N;;;;; 0A36;GURMUKHI LETTER SHA;Lo;0;L;0A38 0A3C;;;;N;;;;; 0A38;GURMUKHI LETTER SA;Lo;0;L;;;;;N;;;;; 0A39;GURMUKHI LETTER HA;Lo;0;L;;;;;N;;;;; 0A3C;GURMUKHI SIGN NUKTA;Mn;7;NSM;;;;;N;;;;; 0A3E;GURMUKHI VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 0A3F;GURMUKHI VOWEL SIGN I;Mc;0;L;;;;;N;;;;; 0A40;GURMUKHI VOWEL SIGN II;Mc;0;L;;;;;N;;;;; 0A41;GURMUKHI VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 0A42;GURMUKHI VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 0A47;GURMUKHI VOWEL SIGN EE;Mn;0;NSM;;;;;N;;;;; 0A48;GURMUKHI VOWEL SIGN AI;Mn;0;NSM;;;;;N;;;;; 0A4B;GURMUKHI VOWEL SIGN OO;Mn;0;NSM;;;;;N;;;;; 0A4C;GURMUKHI VOWEL SIGN AU;Mn;0;NSM;;;;;N;;;;; 0A4D;GURMUKHI SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 0A51;GURMUKHI SIGN UDAAT;Mn;0;NSM;;;;;N;;;;; 0A59;GURMUKHI LETTER KHHA;Lo;0;L;0A16 0A3C;;;;N;;;;; 0A5A;GURMUKHI LETTER GHHA;Lo;0;L;0A17 0A3C;;;;N;;;;; 0A5B;GURMUKHI LETTER ZA;Lo;0;L;0A1C 0A3C;;;;N;;;;; 0A5C;GURMUKHI LETTER RRA;Lo;0;L;;;;;N;;;;; 0A5E;GURMUKHI LETTER FA;Lo;0;L;0A2B 0A3C;;;;N;;;;; 0A66;GURMUKHI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 0A67;GURMUKHI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 0A68;GURMUKHI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 0A69;GURMUKHI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 0A6A;GURMUKHI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 0A6B;GURMUKHI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 0A6C;GURMUKHI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 0A6D;GURMUKHI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 0A6E;GURMUKHI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 0A6F;GURMUKHI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 0A70;GURMUKHI TIPPI;Mn;0;NSM;;;;;N;;;;; 0A71;GURMUKHI ADDAK;Mn;0;NSM;;;;;N;;;;; 0A72;GURMUKHI IRI;Lo;0;L;;;;;N;;;;; 0A73;GURMUKHI URA;Lo;0;L;;;;;N;;;;; 0A74;GURMUKHI EK ONKAR;Lo;0;L;;;;;N;;;;; 0A75;GURMUKHI SIGN YAKASH;Mn;0;NSM;;;;;N;;;;; 0A81;GUJARATI SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;; 0A82;GUJARATI SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; 0A83;GUJARATI SIGN VISARGA;Mc;0;L;;;;;N;;;;; 0A85;GUJARATI LETTER A;Lo;0;L;;;;;N;;;;; 0A86;GUJARATI LETTER AA;Lo;0;L;;;;;N;;;;; 0A87;GUJARATI LETTER I;Lo;0;L;;;;;N;;;;; 0A88;GUJARATI LETTER II;Lo;0;L;;;;;N;;;;; 0A89;GUJARATI LETTER U;Lo;0;L;;;;;N;;;;; 0A8A;GUJARATI LETTER UU;Lo;0;L;;;;;N;;;;; 0A8B;GUJARATI LETTER VOCALIC R;Lo;0;L;;;;;N;;;;; 0A8C;GUJARATI LETTER VOCALIC L;Lo;0;L;;;;;N;;;;; 0A8D;GUJARATI VOWEL CANDRA E;Lo;0;L;;;;;N;;;;; 0A8F;GUJARATI LETTER E;Lo;0;L;;;;;N;;;;; 0A90;GUJARATI LETTER AI;Lo;0;L;;;;;N;;;;; 0A91;GUJARATI VOWEL CANDRA O;Lo;0;L;;;;;N;;;;; 0A93;GUJARATI LETTER O;Lo;0;L;;;;;N;;;;; 0A94;GUJARATI LETTER AU;Lo;0;L;;;;;N;;;;; 0A95;GUJARATI LETTER KA;Lo;0;L;;;;;N;;;;; 0A96;GUJARATI LETTER KHA;Lo;0;L;;;;;N;;;;; 0A97;GUJARATI LETTER GA;Lo;0;L;;;;;N;;;;; 0A98;GUJARATI LETTER GHA;Lo;0;L;;;;;N;;;;; 0A99;GUJARATI LETTER NGA;Lo;0;L;;;;;N;;;;; 0A9A;GUJARATI LETTER CA;Lo;0;L;;;;;N;;;;; 0A9B;GUJARATI LETTER CHA;Lo;0;L;;;;;N;;;;; 0A9C;GUJARATI LETTER JA;Lo;0;L;;;;;N;;;;; 0A9D;GUJARATI LETTER JHA;Lo;0;L;;;;;N;;;;; 0A9E;GUJARATI LETTER NYA;Lo;0;L;;;;;N;;;;; 0A9F;GUJARATI LETTER TTA;Lo;0;L;;;;;N;;;;; 0AA0;GUJARATI LETTER TTHA;Lo;0;L;;;;;N;;;;; 0AA1;GUJARATI LETTER DDA;Lo;0;L;;;;;N;;;;; 0AA2;GUJARATI LETTER DDHA;Lo;0;L;;;;;N;;;;; 0AA3;GUJARATI LETTER NNA;Lo;0;L;;;;;N;;;;; 0AA4;GUJARATI LETTER TA;Lo;0;L;;;;;N;;;;; 0AA5;GUJARATI LETTER THA;Lo;0;L;;;;;N;;;;; 0AA6;GUJARATI LETTER DA;Lo;0;L;;;;;N;;;;; 0AA7;GUJARATI LETTER DHA;Lo;0;L;;;;;N;;;;; 0AA8;GUJARATI LETTER NA;Lo;0;L;;;;;N;;;;; 0AAA;GUJARATI LETTER PA;Lo;0;L;;;;;N;;;;; 0AAB;GUJARATI LETTER PHA;Lo;0;L;;;;;N;;;;; 0AAC;GUJARATI LETTER BA;Lo;0;L;;;;;N;;;;; 0AAD;GUJARATI LETTER BHA;Lo;0;L;;;;;N;;;;; 0AAE;GUJARATI LETTER MA;Lo;0;L;;;;;N;;;;; 0AAF;GUJARATI LETTER YA;Lo;0;L;;;;;N;;;;; 0AB0;GUJARATI LETTER RA;Lo;0;L;;;;;N;;;;; 0AB2;GUJARATI LETTER LA;Lo;0;L;;;;;N;;;;; 0AB3;GUJARATI LETTER LLA;Lo;0;L;;;;;N;;;;; 0AB5;GUJARATI LETTER VA;Lo;0;L;;;;;N;;;;; 0AB6;GUJARATI LETTER SHA;Lo;0;L;;;;;N;;;;; 0AB7;GUJARATI LETTER SSA;Lo;0;L;;;;;N;;;;; 0AB8;GUJARATI LETTER SA;Lo;0;L;;;;;N;;;;; 0AB9;GUJARATI LETTER HA;Lo;0;L;;;;;N;;;;; 0ABC;GUJARATI SIGN NUKTA;Mn;7;NSM;;;;;N;;;;; 0ABD;GUJARATI SIGN AVAGRAHA;Lo;0;L;;;;;N;;;;; 0ABE;GUJARATI VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 0ABF;GUJARATI VOWEL SIGN I;Mc;0;L;;;;;N;;;;; 0AC0;GUJARATI VOWEL SIGN II;Mc;0;L;;;;;N;;;;; 0AC1;GUJARATI VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 0AC2;GUJARATI VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 0AC3;GUJARATI VOWEL SIGN VOCALIC R;Mn;0;NSM;;;;;N;;;;; 0AC4;GUJARATI VOWEL SIGN VOCALIC RR;Mn;0;NSM;;;;;N;;;;; 0AC5;GUJARATI VOWEL SIGN CANDRA E;Mn;0;NSM;;;;;N;;;;; 0AC7;GUJARATI VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; 0AC8;GUJARATI VOWEL SIGN AI;Mn;0;NSM;;;;;N;;;;; 0AC9;GUJARATI VOWEL SIGN CANDRA O;Mc;0;L;;;;;N;;;;; 0ACB;GUJARATI VOWEL SIGN O;Mc;0;L;;;;;N;;;;; 0ACC;GUJARATI VOWEL SIGN AU;Mc;0;L;;;;;N;;;;; 0ACD;GUJARATI SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 0AD0;GUJARATI OM;Lo;0;L;;;;;N;;;;; 0AE0;GUJARATI LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; 0AE1;GUJARATI LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;; 0AE2;GUJARATI VOWEL SIGN VOCALIC L;Mn;0;NSM;;;;;N;;;;; 0AE3;GUJARATI VOWEL SIGN VOCALIC LL;Mn;0;NSM;;;;;N;;;;; 0AE6;GUJARATI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 0AE7;GUJARATI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 0AE8;GUJARATI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 0AE9;GUJARATI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 0AEA;GUJARATI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 0AEB;GUJARATI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 0AEC;GUJARATI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 0AED;GUJARATI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 0AEE;GUJARATI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 0AEF;GUJARATI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 0AF0;GUJARATI ABBREVIATION SIGN;Po;0;L;;;;;N;;;;; 0AF1;GUJARATI RUPEE SIGN;Sc;0;ET;;;;;N;;;;; 0B01;ORIYA SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;; 0B02;ORIYA SIGN ANUSVARA;Mc;0;L;;;;;N;;;;; 0B03;ORIYA SIGN VISARGA;Mc;0;L;;;;;N;;;;; 0B05;ORIYA LETTER A;Lo;0;L;;;;;N;;;;; 0B06;ORIYA LETTER AA;Lo;0;L;;;;;N;;;;; 0B07;ORIYA LETTER I;Lo;0;L;;;;;N;;;;; 0B08;ORIYA LETTER II;Lo;0;L;;;;;N;;;;; 0B09;ORIYA LETTER U;Lo;0;L;;;;;N;;;;; 0B0A;ORIYA LETTER UU;Lo;0;L;;;;;N;;;;; 0B0B;ORIYA LETTER VOCALIC R;Lo;0;L;;;;;N;;;;; 0B0C;ORIYA LETTER VOCALIC L;Lo;0;L;;;;;N;;;;; 0B0F;ORIYA LETTER E;Lo;0;L;;;;;N;;;;; 0B10;ORIYA LETTER AI;Lo;0;L;;;;;N;;;;; 0B13;ORIYA LETTER O;Lo;0;L;;;;;N;;;;; 0B14;ORIYA LETTER AU;Lo;0;L;;;;;N;;;;; 0B15;ORIYA LETTER KA;Lo;0;L;;;;;N;;;;; 0B16;ORIYA LETTER KHA;Lo;0;L;;;;;N;;;;; 0B17;ORIYA LETTER GA;Lo;0;L;;;;;N;;;;; 0B18;ORIYA LETTER GHA;Lo;0;L;;;;;N;;;;; 0B19;ORIYA LETTER NGA;Lo;0;L;;;;;N;;;;; 0B1A;ORIYA LETTER CA;Lo;0;L;;;;;N;;;;; 0B1B;ORIYA LETTER CHA;Lo;0;L;;;;;N;;;;; 0B1C;ORIYA LETTER JA;Lo;0;L;;;;;N;;;;; 0B1D;ORIYA LETTER JHA;Lo;0;L;;;;;N;;;;; 0B1E;ORIYA LETTER NYA;Lo;0;L;;;;;N;;;;; 0B1F;ORIYA LETTER TTA;Lo;0;L;;;;;N;;;;; 0B20;ORIYA LETTER TTHA;Lo;0;L;;;;;N;;;;; 0B21;ORIYA LETTER DDA;Lo;0;L;;;;;N;;;;; 0B22;ORIYA LETTER DDHA;Lo;0;L;;;;;N;;;;; 0B23;ORIYA LETTER NNA;Lo;0;L;;;;;N;;;;; 0B24;ORIYA LETTER TA;Lo;0;L;;;;;N;;;;; 0B25;ORIYA LETTER THA;Lo;0;L;;;;;N;;;;; 0B26;ORIYA LETTER DA;Lo;0;L;;;;;N;;;;; 0B27;ORIYA LETTER DHA;Lo;0;L;;;;;N;;;;; 0B28;ORIYA LETTER NA;Lo;0;L;;;;;N;;;;; 0B2A;ORIYA LETTER PA;Lo;0;L;;;;;N;;;;; 0B2B;ORIYA LETTER PHA;Lo;0;L;;;;;N;;;;; 0B2C;ORIYA LETTER BA;Lo;0;L;;;;;N;;;;; 0B2D;ORIYA LETTER BHA;Lo;0;L;;;;;N;;;;; 0B2E;ORIYA LETTER MA;Lo;0;L;;;;;N;;;;; 0B2F;ORIYA LETTER YA;Lo;0;L;;;;;N;;;;; 0B30;ORIYA LETTER RA;Lo;0;L;;;;;N;;;;; 0B32;ORIYA LETTER LA;Lo;0;L;;;;;N;;;;; 0B33;ORIYA LETTER LLA;Lo;0;L;;;;;N;;;;; 0B35;ORIYA LETTER VA;Lo;0;L;;;;;N;;;;; 0B36;ORIYA LETTER SHA;Lo;0;L;;;;;N;;;;; 0B37;ORIYA LETTER SSA;Lo;0;L;;;;;N;;;;; 0B38;ORIYA LETTER SA;Lo;0;L;;;;;N;;;;; 0B39;ORIYA LETTER HA;Lo;0;L;;;;;N;;;;; 0B3C;ORIYA SIGN NUKTA;Mn;7;NSM;;;;;N;;;;; 0B3D;ORIYA SIGN AVAGRAHA;Lo;0;L;;;;;N;;;;; 0B3E;ORIYA VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 0B3F;ORIYA VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 0B40;ORIYA VOWEL SIGN II;Mc;0;L;;;;;N;;;;; 0B41;ORIYA VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 0B42;ORIYA VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 0B43;ORIYA VOWEL SIGN VOCALIC R;Mn;0;NSM;;;;;N;;;;; 0B44;ORIYA VOWEL SIGN VOCALIC RR;Mn;0;NSM;;;;;N;;;;; 0B47;ORIYA VOWEL SIGN E;Mc;0;L;;;;;N;;;;; 0B48;ORIYA VOWEL SIGN AI;Mc;0;L;0B47 0B56;;;;N;;;;; 0B4B;ORIYA VOWEL SIGN O;Mc;0;L;0B47 0B3E;;;;N;;;;; 0B4C;ORIYA VOWEL SIGN AU;Mc;0;L;0B47 0B57;;;;N;;;;; 0B4D;ORIYA SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 0B56;ORIYA AI LENGTH MARK;Mn;0;NSM;;;;;N;;;;; 0B57;ORIYA AU LENGTH MARK;Mc;0;L;;;;;N;;;;; 0B5C;ORIYA LETTER RRA;Lo;0;L;0B21 0B3C;;;;N;;;;; 0B5D;ORIYA LETTER RHA;Lo;0;L;0B22 0B3C;;;;N;;;;; 0B5F;ORIYA LETTER YYA;Lo;0;L;;;;;N;;;;; 0B60;ORIYA LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; 0B61;ORIYA LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;; 0B62;ORIYA VOWEL SIGN VOCALIC L;Mn;0;NSM;;;;;N;;;;; 0B63;ORIYA VOWEL SIGN VOCALIC LL;Mn;0;NSM;;;;;N;;;;; 0B66;ORIYA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 0B67;ORIYA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 0B68;ORIYA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 0B69;ORIYA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 0B6A;ORIYA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 0B6B;ORIYA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 0B6C;ORIYA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 0B6D;ORIYA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 0B6E;ORIYA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 0B6F;ORIYA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 0B70;ORIYA ISSHAR;So;0;L;;;;;N;;;;; 0B71;ORIYA LETTER WA;Lo;0;L;;;;;N;;;;; 0B72;ORIYA FRACTION ONE QUARTER;No;0;L;;;;1/4;N;;;;; 0B73;ORIYA FRACTION ONE HALF;No;0;L;;;;1/2;N;;;;; 0B74;ORIYA FRACTION THREE QUARTERS;No;0;L;;;;3/4;N;;;;; 0B75;ORIYA FRACTION ONE SIXTEENTH;No;0;L;;;;1/16;N;;;;; 0B76;ORIYA FRACTION ONE EIGHTH;No;0;L;;;;1/8;N;;;;; 0B77;ORIYA FRACTION THREE SIXTEENTHS;No;0;L;;;;3/16;N;;;;; 0B82;TAMIL SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; 0B83;TAMIL SIGN VISARGA;Lo;0;L;;;;;N;;;;; 0B85;TAMIL LETTER A;Lo;0;L;;;;;N;;;;; 0B86;TAMIL LETTER AA;Lo;0;L;;;;;N;;;;; 0B87;TAMIL LETTER I;Lo;0;L;;;;;N;;;;; 0B88;TAMIL LETTER II;Lo;0;L;;;;;N;;;;; 0B89;TAMIL LETTER U;Lo;0;L;;;;;N;;;;; 0B8A;TAMIL LETTER UU;Lo;0;L;;;;;N;;;;; 0B8E;TAMIL LETTER E;Lo;0;L;;;;;N;;;;; 0B8F;TAMIL LETTER EE;Lo;0;L;;;;;N;;;;; 0B90;TAMIL LETTER AI;Lo;0;L;;;;;N;;;;; 0B92;TAMIL LETTER O;Lo;0;L;;;;;N;;;;; 0B93;TAMIL LETTER OO;Lo;0;L;;;;;N;;;;; 0B94;TAMIL LETTER AU;Lo;0;L;0B92 0BD7;;;;N;;;;; 0B95;TAMIL LETTER KA;Lo;0;L;;;;;N;;;;; 0B99;TAMIL LETTER NGA;Lo;0;L;;;;;N;;;;; 0B9A;TAMIL LETTER CA;Lo;0;L;;;;;N;;;;; 0B9C;TAMIL LETTER JA;Lo;0;L;;;;;N;;;;; 0B9E;TAMIL LETTER NYA;Lo;0;L;;;;;N;;;;; 0B9F;TAMIL LETTER TTA;Lo;0;L;;;;;N;;;;; 0BA3;TAMIL LETTER NNA;Lo;0;L;;;;;N;;;;; 0BA4;TAMIL LETTER TA;Lo;0;L;;;;;N;;;;; 0BA8;TAMIL LETTER NA;Lo;0;L;;;;;N;;;;; 0BA9;TAMIL LETTER NNNA;Lo;0;L;;;;;N;;;;; 0BAA;TAMIL LETTER PA;Lo;0;L;;;;;N;;;;; 0BAE;TAMIL LETTER MA;Lo;0;L;;;;;N;;;;; 0BAF;TAMIL LETTER YA;Lo;0;L;;;;;N;;;;; 0BB0;TAMIL LETTER RA;Lo;0;L;;;;;N;;;;; 0BB1;TAMIL LETTER RRA;Lo;0;L;;;;;N;;;;; 0BB2;TAMIL LETTER LA;Lo;0;L;;;;;N;;;;; 0BB3;TAMIL LETTER LLA;Lo;0;L;;;;;N;;;;; 0BB4;TAMIL LETTER LLLA;Lo;0;L;;;;;N;;;;; 0BB5;TAMIL LETTER VA;Lo;0;L;;;;;N;;;;; 0BB6;TAMIL LETTER SHA;Lo;0;L;;;;;N;;;;; 0BB7;TAMIL LETTER SSA;Lo;0;L;;;;;N;;;;; 0BB8;TAMIL LETTER SA;Lo;0;L;;;;;N;;;;; 0BB9;TAMIL LETTER HA;Lo;0;L;;;;;N;;;;; 0BBE;TAMIL VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 0BBF;TAMIL VOWEL SIGN I;Mc;0;L;;;;;N;;;;; 0BC0;TAMIL VOWEL SIGN II;Mn;0;NSM;;;;;N;;;;; 0BC1;TAMIL VOWEL SIGN U;Mc;0;L;;;;;N;;;;; 0BC2;TAMIL VOWEL SIGN UU;Mc;0;L;;;;;N;;;;; 0BC6;TAMIL VOWEL SIGN E;Mc;0;L;;;;;N;;;;; 0BC7;TAMIL VOWEL SIGN EE;Mc;0;L;;;;;N;;;;; 0BC8;TAMIL VOWEL SIGN AI;Mc;0;L;;;;;N;;;;; 0BCA;TAMIL VOWEL SIGN O;Mc;0;L;0BC6 0BBE;;;;N;;;;; 0BCB;TAMIL VOWEL SIGN OO;Mc;0;L;0BC7 0BBE;;;;N;;;;; 0BCC;TAMIL VOWEL SIGN AU;Mc;0;L;0BC6 0BD7;;;;N;;;;; 0BCD;TAMIL SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 0BD0;TAMIL OM;Lo;0;L;;;;;N;;;;; 0BD7;TAMIL AU LENGTH MARK;Mc;0;L;;;;;N;;;;; 0BE6;TAMIL DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 0BE7;TAMIL DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 0BE8;TAMIL DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 0BE9;TAMIL DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 0BEA;TAMIL DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 0BEB;TAMIL DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 0BEC;TAMIL DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 0BED;TAMIL DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 0BEE;TAMIL DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 0BEF;TAMIL DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 0BF0;TAMIL NUMBER TEN;No;0;L;;;;10;N;;;;; 0BF1;TAMIL NUMBER ONE HUNDRED;No;0;L;;;;100;N;;;;; 0BF2;TAMIL NUMBER ONE THOUSAND;No;0;L;;;;1000;N;;;;; 0BF3;TAMIL DAY SIGN;So;0;ON;;;;;N;;;;; 0BF4;TAMIL MONTH SIGN;So;0;ON;;;;;N;;;;; 0BF5;TAMIL YEAR SIGN;So;0;ON;;;;;N;;;;; 0BF6;TAMIL DEBIT SIGN;So;0;ON;;;;;N;;;;; 0BF7;TAMIL CREDIT SIGN;So;0;ON;;;;;N;;;;; 0BF8;TAMIL AS ABOVE SIGN;So;0;ON;;;;;N;;;;; 0BF9;TAMIL RUPEE SIGN;Sc;0;ET;;;;;N;;;;; 0BFA;TAMIL NUMBER SIGN;So;0;ON;;;;;N;;;;; 0C01;TELUGU SIGN CANDRABINDU;Mc;0;L;;;;;N;;;;; 0C02;TELUGU SIGN ANUSVARA;Mc;0;L;;;;;N;;;;; 0C03;TELUGU SIGN VISARGA;Mc;0;L;;;;;N;;;;; 0C05;TELUGU LETTER A;Lo;0;L;;;;;N;;;;; 0C06;TELUGU LETTER AA;Lo;0;L;;;;;N;;;;; 0C07;TELUGU LETTER I;Lo;0;L;;;;;N;;;;; 0C08;TELUGU LETTER II;Lo;0;L;;;;;N;;;;; 0C09;TELUGU LETTER U;Lo;0;L;;;;;N;;;;; 0C0A;TELUGU LETTER UU;Lo;0;L;;;;;N;;;;; 0C0B;TELUGU LETTER VOCALIC R;Lo;0;L;;;;;N;;;;; 0C0C;TELUGU LETTER VOCALIC L;Lo;0;L;;;;;N;;;;; 0C0E;TELUGU LETTER E;Lo;0;L;;;;;N;;;;; 0C0F;TELUGU LETTER EE;Lo;0;L;;;;;N;;;;; 0C10;TELUGU LETTER AI;Lo;0;L;;;;;N;;;;; 0C12;TELUGU LETTER O;Lo;0;L;;;;;N;;;;; 0C13;TELUGU LETTER OO;Lo;0;L;;;;;N;;;;; 0C14;TELUGU LETTER AU;Lo;0;L;;;;;N;;;;; 0C15;TELUGU LETTER KA;Lo;0;L;;;;;N;;;;; 0C16;TELUGU LETTER KHA;Lo;0;L;;;;;N;;;;; 0C17;TELUGU LETTER GA;Lo;0;L;;;;;N;;;;; 0C18;TELUGU LETTER GHA;Lo;0;L;;;;;N;;;;; 0C19;TELUGU LETTER NGA;Lo;0;L;;;;;N;;;;; 0C1A;TELUGU LETTER CA;Lo;0;L;;;;;N;;;;; 0C1B;TELUGU LETTER CHA;Lo;0;L;;;;;N;;;;; 0C1C;TELUGU LETTER JA;Lo;0;L;;;;;N;;;;; 0C1D;TELUGU LETTER JHA;Lo;0;L;;;;;N;;;;; 0C1E;TELUGU LETTER NYA;Lo;0;L;;;;;N;;;;; 0C1F;TELUGU LETTER TTA;Lo;0;L;;;;;N;;;;; 0C20;TELUGU LETTER TTHA;Lo;0;L;;;;;N;;;;; 0C21;TELUGU LETTER DDA;Lo;0;L;;;;;N;;;;; 0C22;TELUGU LETTER DDHA;Lo;0;L;;;;;N;;;;; 0C23;TELUGU LETTER NNA;Lo;0;L;;;;;N;;;;; 0C24;TELUGU LETTER TA;Lo;0;L;;;;;N;;;;; 0C25;TELUGU LETTER THA;Lo;0;L;;;;;N;;;;; 0C26;TELUGU LETTER DA;Lo;0;L;;;;;N;;;;; 0C27;TELUGU LETTER DHA;Lo;0;L;;;;;N;;;;; 0C28;TELUGU LETTER NA;Lo;0;L;;;;;N;;;;; 0C2A;TELUGU LETTER PA;Lo;0;L;;;;;N;;;;; 0C2B;TELUGU LETTER PHA;Lo;0;L;;;;;N;;;;; 0C2C;TELUGU LETTER BA;Lo;0;L;;;;;N;;;;; 0C2D;TELUGU LETTER BHA;Lo;0;L;;;;;N;;;;; 0C2E;TELUGU LETTER MA;Lo;0;L;;;;;N;;;;; 0C2F;TELUGU LETTER YA;Lo;0;L;;;;;N;;;;; 0C30;TELUGU LETTER RA;Lo;0;L;;;;;N;;;;; 0C31;TELUGU LETTER RRA;Lo;0;L;;;;;N;;;;; 0C32;TELUGU LETTER LA;Lo;0;L;;;;;N;;;;; 0C33;TELUGU LETTER LLA;Lo;0;L;;;;;N;;;;; 0C35;TELUGU LETTER VA;Lo;0;L;;;;;N;;;;; 0C36;TELUGU LETTER SHA;Lo;0;L;;;;;N;;;;; 0C37;TELUGU LETTER SSA;Lo;0;L;;;;;N;;;;; 0C38;TELUGU LETTER SA;Lo;0;L;;;;;N;;;;; 0C39;TELUGU LETTER HA;Lo;0;L;;;;;N;;;;; 0C3D;TELUGU SIGN AVAGRAHA;Lo;0;L;;;;;N;;;;; 0C3E;TELUGU VOWEL SIGN AA;Mn;0;NSM;;;;;N;;;;; 0C3F;TELUGU VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 0C40;TELUGU VOWEL SIGN II;Mn;0;NSM;;;;;N;;;;; 0C41;TELUGU VOWEL SIGN U;Mc;0;L;;;;;N;;;;; 0C42;TELUGU VOWEL SIGN UU;Mc;0;L;;;;;N;;;;; 0C43;TELUGU VOWEL SIGN VOCALIC R;Mc;0;L;;;;;N;;;;; 0C44;TELUGU VOWEL SIGN VOCALIC RR;Mc;0;L;;;;;N;;;;; 0C46;TELUGU VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; 0C47;TELUGU VOWEL SIGN EE;Mn;0;NSM;;;;;N;;;;; 0C48;TELUGU VOWEL SIGN AI;Mn;0;NSM;0C46 0C56;;;;N;;;;; 0C4A;TELUGU VOWEL SIGN O;Mn;0;NSM;;;;;N;;;;; 0C4B;TELUGU VOWEL SIGN OO;Mn;0;NSM;;;;;N;;;;; 0C4C;TELUGU VOWEL SIGN AU;Mn;0;NSM;;;;;N;;;;; 0C4D;TELUGU SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 0C55;TELUGU LENGTH MARK;Mn;84;NSM;;;;;N;;;;; 0C56;TELUGU AI LENGTH MARK;Mn;91;NSM;;;;;N;;;;; 0C58;TELUGU LETTER TSA;Lo;0;L;;;;;N;;;;; 0C59;TELUGU LETTER DZA;Lo;0;L;;;;;N;;;;; 0C60;TELUGU LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; 0C61;TELUGU LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;; 0C62;TELUGU VOWEL SIGN VOCALIC L;Mn;0;NSM;;;;;N;;;;; 0C63;TELUGU VOWEL SIGN VOCALIC LL;Mn;0;NSM;;;;;N;;;;; 0C66;TELUGU DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 0C67;TELUGU DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 0C68;TELUGU DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 0C69;TELUGU DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 0C6A;TELUGU DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 0C6B;TELUGU DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 0C6C;TELUGU DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 0C6D;TELUGU DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 0C6E;TELUGU DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 0C6F;TELUGU DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 0C78;TELUGU FRACTION DIGIT ZERO FOR ODD POWERS OF FOUR;No;0;ON;;;;0;N;;;;; 0C79;TELUGU FRACTION DIGIT ONE FOR ODD POWERS OF FOUR;No;0;ON;;;;1;N;;;;; 0C7A;TELUGU FRACTION DIGIT TWO FOR ODD POWERS OF FOUR;No;0;ON;;;;2;N;;;;; 0C7B;TELUGU FRACTION DIGIT THREE FOR ODD POWERS OF FOUR;No;0;ON;;;;3;N;;;;; 0C7C;TELUGU FRACTION DIGIT ONE FOR EVEN POWERS OF FOUR;No;0;ON;;;;1;N;;;;; 0C7D;TELUGU FRACTION DIGIT TWO FOR EVEN POWERS OF FOUR;No;0;ON;;;;2;N;;;;; 0C7E;TELUGU FRACTION DIGIT THREE FOR EVEN POWERS OF FOUR;No;0;ON;;;;3;N;;;;; 0C7F;TELUGU SIGN TUUMU;So;0;L;;;;;N;;;;; 0C82;KANNADA SIGN ANUSVARA;Mc;0;L;;;;;N;;;;; 0C83;KANNADA SIGN VISARGA;Mc;0;L;;;;;N;;;;; 0C85;KANNADA LETTER A;Lo;0;L;;;;;N;;;;; 0C86;KANNADA LETTER AA;Lo;0;L;;;;;N;;;;; 0C87;KANNADA LETTER I;Lo;0;L;;;;;N;;;;; 0C88;KANNADA LETTER II;Lo;0;L;;;;;N;;;;; 0C89;KANNADA LETTER U;Lo;0;L;;;;;N;;;;; 0C8A;KANNADA LETTER UU;Lo;0;L;;;;;N;;;;; 0C8B;KANNADA LETTER VOCALIC R;Lo;0;L;;;;;N;;;;; 0C8C;KANNADA LETTER VOCALIC L;Lo;0;L;;;;;N;;;;; 0C8E;KANNADA LETTER E;Lo;0;L;;;;;N;;;;; 0C8F;KANNADA LETTER EE;Lo;0;L;;;;;N;;;;; 0C90;KANNADA LETTER AI;Lo;0;L;;;;;N;;;;; 0C92;KANNADA LETTER O;Lo;0;L;;;;;N;;;;; 0C93;KANNADA LETTER OO;Lo;0;L;;;;;N;;;;; 0C94;KANNADA LETTER AU;Lo;0;L;;;;;N;;;;; 0C95;KANNADA LETTER KA;Lo;0;L;;;;;N;;;;; 0C96;KANNADA LETTER KHA;Lo;0;L;;;;;N;;;;; 0C97;KANNADA LETTER GA;Lo;0;L;;;;;N;;;;; 0C98;KANNADA LETTER GHA;Lo;0;L;;;;;N;;;;; 0C99;KANNADA LETTER NGA;Lo;0;L;;;;;N;;;;; 0C9A;KANNADA LETTER CA;Lo;0;L;;;;;N;;;;; 0C9B;KANNADA LETTER CHA;Lo;0;L;;;;;N;;;;; 0C9C;KANNADA LETTER JA;Lo;0;L;;;;;N;;;;; 0C9D;KANNADA LETTER JHA;Lo;0;L;;;;;N;;;;; 0C9E;KANNADA LETTER NYA;Lo;0;L;;;;;N;;;;; 0C9F;KANNADA LETTER TTA;Lo;0;L;;;;;N;;;;; 0CA0;KANNADA LETTER TTHA;Lo;0;L;;;;;N;;;;; 0CA1;KANNADA LETTER DDA;Lo;0;L;;;;;N;;;;; 0CA2;KANNADA LETTER DDHA;Lo;0;L;;;;;N;;;;; 0CA3;KANNADA LETTER NNA;Lo;0;L;;;;;N;;;;; 0CA4;KANNADA LETTER TA;Lo;0;L;;;;;N;;;;; 0CA5;KANNADA LETTER THA;Lo;0;L;;;;;N;;;;; 0CA6;KANNADA LETTER DA;Lo;0;L;;;;;N;;;;; 0CA7;KANNADA LETTER DHA;Lo;0;L;;;;;N;;;;; 0CA8;KANNADA LETTER NA;Lo;0;L;;;;;N;;;;; 0CAA;KANNADA LETTER PA;Lo;0;L;;;;;N;;;;; 0CAB;KANNADA LETTER PHA;Lo;0;L;;;;;N;;;;; 0CAC;KANNADA LETTER BA;Lo;0;L;;;;;N;;;;; 0CAD;KANNADA LETTER BHA;Lo;0;L;;;;;N;;;;; 0CAE;KANNADA LETTER MA;Lo;0;L;;;;;N;;;;; 0CAF;KANNADA LETTER YA;Lo;0;L;;;;;N;;;;; 0CB0;KANNADA LETTER RA;Lo;0;L;;;;;N;;;;; 0CB1;KANNADA LETTER RRA;Lo;0;L;;;;;N;;;;; 0CB2;KANNADA LETTER LA;Lo;0;L;;;;;N;;;;; 0CB3;KANNADA LETTER LLA;Lo;0;L;;;;;N;;;;; 0CB5;KANNADA LETTER VA;Lo;0;L;;;;;N;;;;; 0CB6;KANNADA LETTER SHA;Lo;0;L;;;;;N;;;;; 0CB7;KANNADA LETTER SSA;Lo;0;L;;;;;N;;;;; 0CB8;KANNADA LETTER SA;Lo;0;L;;;;;N;;;;; 0CB9;KANNADA LETTER HA;Lo;0;L;;;;;N;;;;; 0CBC;KANNADA SIGN NUKTA;Mn;7;NSM;;;;;N;;;;; 0CBD;KANNADA SIGN AVAGRAHA;Lo;0;L;;;;;N;;;;; 0CBE;KANNADA VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 0CBF;KANNADA VOWEL SIGN I;Mn;0;L;;;;;N;;;;; 0CC0;KANNADA VOWEL SIGN II;Mc;0;L;0CBF 0CD5;;;;N;;;;; 0CC1;KANNADA VOWEL SIGN U;Mc;0;L;;;;;N;;;;; 0CC2;KANNADA VOWEL SIGN UU;Mc;0;L;;;;;N;;;;; 0CC3;KANNADA VOWEL SIGN VOCALIC R;Mc;0;L;;;;;N;;;;; 0CC4;KANNADA VOWEL SIGN VOCALIC RR;Mc;0;L;;;;;N;;;;; 0CC6;KANNADA VOWEL SIGN E;Mn;0;L;;;;;N;;;;; 0CC7;KANNADA VOWEL SIGN EE;Mc;0;L;0CC6 0CD5;;;;N;;;;; 0CC8;KANNADA VOWEL SIGN AI;Mc;0;L;0CC6 0CD6;;;;N;;;;; 0CCA;KANNADA VOWEL SIGN O;Mc;0;L;0CC6 0CC2;;;;N;;;;; 0CCB;KANNADA VOWEL SIGN OO;Mc;0;L;0CCA 0CD5;;;;N;;;;; 0CCC;KANNADA VOWEL SIGN AU;Mn;0;NSM;;;;;N;;;;; 0CCD;KANNADA SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 0CD5;KANNADA LENGTH MARK;Mc;0;L;;;;;N;;;;; 0CD6;KANNADA AI LENGTH MARK;Mc;0;L;;;;;N;;;;; 0CDE;KANNADA LETTER FA;Lo;0;L;;;;;N;;;;; 0CE0;KANNADA LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; 0CE1;KANNADA LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;; 0CE2;KANNADA VOWEL SIGN VOCALIC L;Mn;0;NSM;;;;;N;;;;; 0CE3;KANNADA VOWEL SIGN VOCALIC LL;Mn;0;NSM;;;;;N;;;;; 0CE6;KANNADA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 0CE7;KANNADA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 0CE8;KANNADA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 0CE9;KANNADA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 0CEA;KANNADA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 0CEB;KANNADA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 0CEC;KANNADA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 0CED;KANNADA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 0CEE;KANNADA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 0CEF;KANNADA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 0CF1;KANNADA SIGN JIHVAMULIYA;Lo;0;L;;;;;N;;;;; 0CF2;KANNADA SIGN UPADHMANIYA;Lo;0;L;;;;;N;;;;; 0D02;MALAYALAM SIGN ANUSVARA;Mc;0;L;;;;;N;;;;; 0D03;MALAYALAM SIGN VISARGA;Mc;0;L;;;;;N;;;;; 0D05;MALAYALAM LETTER A;Lo;0;L;;;;;N;;;;; 0D06;MALAYALAM LETTER AA;Lo;0;L;;;;;N;;;;; 0D07;MALAYALAM LETTER I;Lo;0;L;;;;;N;;;;; 0D08;MALAYALAM LETTER II;Lo;0;L;;;;;N;;;;; 0D09;MALAYALAM LETTER U;Lo;0;L;;;;;N;;;;; 0D0A;MALAYALAM LETTER UU;Lo;0;L;;;;;N;;;;; 0D0B;MALAYALAM LETTER VOCALIC R;Lo;0;L;;;;;N;;;;; 0D0C;MALAYALAM LETTER VOCALIC L;Lo;0;L;;;;;N;;;;; 0D0E;MALAYALAM LETTER E;Lo;0;L;;;;;N;;;;; 0D0F;MALAYALAM LETTER EE;Lo;0;L;;;;;N;;;;; 0D10;MALAYALAM LETTER AI;Lo;0;L;;;;;N;;;;; 0D12;MALAYALAM LETTER O;Lo;0;L;;;;;N;;;;; 0D13;MALAYALAM LETTER OO;Lo;0;L;;;;;N;;;;; 0D14;MALAYALAM LETTER AU;Lo;0;L;;;;;N;;;;; 0D15;MALAYALAM LETTER KA;Lo;0;L;;;;;N;;;;; 0D16;MALAYALAM LETTER KHA;Lo;0;L;;;;;N;;;;; 0D17;MALAYALAM LETTER GA;Lo;0;L;;;;;N;;;;; 0D18;MALAYALAM LETTER GHA;Lo;0;L;;;;;N;;;;; 0D19;MALAYALAM LETTER NGA;Lo;0;L;;;;;N;;;;; 0D1A;MALAYALAM LETTER CA;Lo;0;L;;;;;N;;;;; 0D1B;MALAYALAM LETTER CHA;Lo;0;L;;;;;N;;;;; 0D1C;MALAYALAM LETTER JA;Lo;0;L;;;;;N;;;;; 0D1D;MALAYALAM LETTER JHA;Lo;0;L;;;;;N;;;;; 0D1E;MALAYALAM LETTER NYA;Lo;0;L;;;;;N;;;;; 0D1F;MALAYALAM LETTER TTA;Lo;0;L;;;;;N;;;;; 0D20;MALAYALAM LETTER TTHA;Lo;0;L;;;;;N;;;;; 0D21;MALAYALAM LETTER DDA;Lo;0;L;;;;;N;;;;; 0D22;MALAYALAM LETTER DDHA;Lo;0;L;;;;;N;;;;; 0D23;MALAYALAM LETTER NNA;Lo;0;L;;;;;N;;;;; 0D24;MALAYALAM LETTER TA;Lo;0;L;;;;;N;;;;; 0D25;MALAYALAM LETTER THA;Lo;0;L;;;;;N;;;;; 0D26;MALAYALAM LETTER DA;Lo;0;L;;;;;N;;;;; 0D27;MALAYALAM LETTER DHA;Lo;0;L;;;;;N;;;;; 0D28;MALAYALAM LETTER NA;Lo;0;L;;;;;N;;;;; 0D29;MALAYALAM LETTER NNNA;Lo;0;L;;;;;N;;;;; 0D2A;MALAYALAM LETTER PA;Lo;0;L;;;;;N;;;;; 0D2B;MALAYALAM LETTER PHA;Lo;0;L;;;;;N;;;;; 0D2C;MALAYALAM LETTER BA;Lo;0;L;;;;;N;;;;; 0D2D;MALAYALAM LETTER BHA;Lo;0;L;;;;;N;;;;; 0D2E;MALAYALAM LETTER MA;Lo;0;L;;;;;N;;;;; 0D2F;MALAYALAM LETTER YA;Lo;0;L;;;;;N;;;;; 0D30;MALAYALAM LETTER RA;Lo;0;L;;;;;N;;;;; 0D31;MALAYALAM LETTER RRA;Lo;0;L;;;;;N;;;;; 0D32;MALAYALAM LETTER LA;Lo;0;L;;;;;N;;;;; 0D33;MALAYALAM LETTER LLA;Lo;0;L;;;;;N;;;;; 0D34;MALAYALAM LETTER LLLA;Lo;0;L;;;;;N;;;;; 0D35;MALAYALAM LETTER VA;Lo;0;L;;;;;N;;;;; 0D36;MALAYALAM LETTER SHA;Lo;0;L;;;;;N;;;;; 0D37;MALAYALAM LETTER SSA;Lo;0;L;;;;;N;;;;; 0D38;MALAYALAM LETTER SA;Lo;0;L;;;;;N;;;;; 0D39;MALAYALAM LETTER HA;Lo;0;L;;;;;N;;;;; 0D3A;MALAYALAM LETTER TTTA;Lo;0;L;;;;;N;;;;; 0D3D;MALAYALAM SIGN AVAGRAHA;Lo;0;L;;;;;N;;;;; 0D3E;MALAYALAM VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 0D3F;MALAYALAM VOWEL SIGN I;Mc;0;L;;;;;N;;;;; 0D40;MALAYALAM VOWEL SIGN II;Mc;0;L;;;;;N;;;;; 0D41;MALAYALAM VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 0D42;MALAYALAM VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 0D43;MALAYALAM VOWEL SIGN VOCALIC R;Mn;0;NSM;;;;;N;;;;; 0D44;MALAYALAM VOWEL SIGN VOCALIC RR;Mn;0;NSM;;;;;N;;;;; 0D46;MALAYALAM VOWEL SIGN E;Mc;0;L;;;;;N;;;;; 0D47;MALAYALAM VOWEL SIGN EE;Mc;0;L;;;;;N;;;;; 0D48;MALAYALAM VOWEL SIGN AI;Mc;0;L;;;;;N;;;;; 0D4A;MALAYALAM VOWEL SIGN O;Mc;0;L;0D46 0D3E;;;;N;;;;; 0D4B;MALAYALAM VOWEL SIGN OO;Mc;0;L;0D47 0D3E;;;;N;;;;; 0D4C;MALAYALAM VOWEL SIGN AU;Mc;0;L;0D46 0D57;;;;N;;;;; 0D4D;MALAYALAM SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 0D4E;MALAYALAM LETTER DOT REPH;Lo;0;L;;;;;N;;;;; 0D57;MALAYALAM AU LENGTH MARK;Mc;0;L;;;;;N;;;;; 0D60;MALAYALAM LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; 0D61;MALAYALAM LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;; 0D62;MALAYALAM VOWEL SIGN VOCALIC L;Mn;0;NSM;;;;;N;;;;; 0D63;MALAYALAM VOWEL SIGN VOCALIC LL;Mn;0;NSM;;;;;N;;;;; 0D66;MALAYALAM DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 0D67;MALAYALAM DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 0D68;MALAYALAM DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 0D69;MALAYALAM DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 0D6A;MALAYALAM DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 0D6B;MALAYALAM DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 0D6C;MALAYALAM DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 0D6D;MALAYALAM DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 0D6E;MALAYALAM DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 0D6F;MALAYALAM DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 0D70;MALAYALAM NUMBER TEN;No;0;L;;;;10;N;;;;; 0D71;MALAYALAM NUMBER ONE HUNDRED;No;0;L;;;;100;N;;;;; 0D72;MALAYALAM NUMBER ONE THOUSAND;No;0;L;;;;1000;N;;;;; 0D73;MALAYALAM FRACTION ONE QUARTER;No;0;L;;;;1/4;N;;;;; 0D74;MALAYALAM FRACTION ONE HALF;No;0;L;;;;1/2;N;;;;; 0D75;MALAYALAM FRACTION THREE QUARTERS;No;0;L;;;;3/4;N;;;;; 0D79;MALAYALAM DATE MARK;So;0;L;;;;;N;;;;; 0D7A;MALAYALAM LETTER CHILLU NN;Lo;0;L;;;;;N;;;;; 0D7B;MALAYALAM LETTER CHILLU N;Lo;0;L;;;;;N;;;;; 0D7C;MALAYALAM LETTER CHILLU RR;Lo;0;L;;;;;N;;;;; 0D7D;MALAYALAM LETTER CHILLU L;Lo;0;L;;;;;N;;;;; 0D7E;MALAYALAM LETTER CHILLU LL;Lo;0;L;;;;;N;;;;; 0D7F;MALAYALAM LETTER CHILLU K;Lo;0;L;;;;;N;;;;; 0D82;SINHALA SIGN ANUSVARAYA;Mc;0;L;;;;;N;;;;; 0D83;SINHALA SIGN VISARGAYA;Mc;0;L;;;;;N;;;;; 0D85;SINHALA LETTER AYANNA;Lo;0;L;;;;;N;;;;; 0D86;SINHALA LETTER AAYANNA;Lo;0;L;;;;;N;;;;; 0D87;SINHALA LETTER AEYANNA;Lo;0;L;;;;;N;;;;; 0D88;SINHALA LETTER AEEYANNA;Lo;0;L;;;;;N;;;;; 0D89;SINHALA LETTER IYANNA;Lo;0;L;;;;;N;;;;; 0D8A;SINHALA LETTER IIYANNA;Lo;0;L;;;;;N;;;;; 0D8B;SINHALA LETTER UYANNA;Lo;0;L;;;;;N;;;;; 0D8C;SINHALA LETTER UUYANNA;Lo;0;L;;;;;N;;;;; 0D8D;SINHALA LETTER IRUYANNA;Lo;0;L;;;;;N;;;;; 0D8E;SINHALA LETTER IRUUYANNA;Lo;0;L;;;;;N;;;;; 0D8F;SINHALA LETTER ILUYANNA;Lo;0;L;;;;;N;;;;; 0D90;SINHALA LETTER ILUUYANNA;Lo;0;L;;;;;N;;;;; 0D91;SINHALA LETTER EYANNA;Lo;0;L;;;;;N;;;;; 0D92;SINHALA LETTER EEYANNA;Lo;0;L;;;;;N;;;;; 0D93;SINHALA LETTER AIYANNA;Lo;0;L;;;;;N;;;;; 0D94;SINHALA LETTER OYANNA;Lo;0;L;;;;;N;;;;; 0D95;SINHALA LETTER OOYANNA;Lo;0;L;;;;;N;;;;; 0D96;SINHALA LETTER AUYANNA;Lo;0;L;;;;;N;;;;; 0D9A;SINHALA LETTER ALPAPRAANA KAYANNA;Lo;0;L;;;;;N;;;;; 0D9B;SINHALA LETTER MAHAAPRAANA KAYANNA;Lo;0;L;;;;;N;;;;; 0D9C;SINHALA LETTER ALPAPRAANA GAYANNA;Lo;0;L;;;;;N;;;;; 0D9D;SINHALA LETTER MAHAAPRAANA GAYANNA;Lo;0;L;;;;;N;;;;; 0D9E;SINHALA LETTER KANTAJA NAASIKYAYA;Lo;0;L;;;;;N;;;;; 0D9F;SINHALA LETTER SANYAKA GAYANNA;Lo;0;L;;;;;N;;;;; 0DA0;SINHALA LETTER ALPAPRAANA CAYANNA;Lo;0;L;;;;;N;;;;; 0DA1;SINHALA LETTER MAHAAPRAANA CAYANNA;Lo;0;L;;;;;N;;;;; 0DA2;SINHALA LETTER ALPAPRAANA JAYANNA;Lo;0;L;;;;;N;;;;; 0DA3;SINHALA LETTER MAHAAPRAANA JAYANNA;Lo;0;L;;;;;N;;;;; 0DA4;SINHALA LETTER TAALUJA NAASIKYAYA;Lo;0;L;;;;;N;;;;; 0DA5;SINHALA LETTER TAALUJA SANYOOGA NAAKSIKYAYA;Lo;0;L;;;;;N;;;;; 0DA6;SINHALA LETTER SANYAKA JAYANNA;Lo;0;L;;;;;N;;;;; 0DA7;SINHALA LETTER ALPAPRAANA TTAYANNA;Lo;0;L;;;;;N;;;;; 0DA8;SINHALA LETTER MAHAAPRAANA TTAYANNA;Lo;0;L;;;;;N;;;;; 0DA9;SINHALA LETTER ALPAPRAANA DDAYANNA;Lo;0;L;;;;;N;;;;; 0DAA;SINHALA LETTER MAHAAPRAANA DDAYANNA;Lo;0;L;;;;;N;;;;; 0DAB;SINHALA LETTER MUURDHAJA NAYANNA;Lo;0;L;;;;;N;;;;; 0DAC;SINHALA LETTER SANYAKA DDAYANNA;Lo;0;L;;;;;N;;;;; 0DAD;SINHALA LETTER ALPAPRAANA TAYANNA;Lo;0;L;;;;;N;;;;; 0DAE;SINHALA LETTER MAHAAPRAANA TAYANNA;Lo;0;L;;;;;N;;;;; 0DAF;SINHALA LETTER ALPAPRAANA DAYANNA;Lo;0;L;;;;;N;;;;; 0DB0;SINHALA LETTER MAHAAPRAANA DAYANNA;Lo;0;L;;;;;N;;;;; 0DB1;SINHALA LETTER DANTAJA NAYANNA;Lo;0;L;;;;;N;;;;; 0DB3;SINHALA LETTER SANYAKA DAYANNA;Lo;0;L;;;;;N;;;;; 0DB4;SINHALA LETTER ALPAPRAANA PAYANNA;Lo;0;L;;;;;N;;;;; 0DB5;SINHALA LETTER MAHAAPRAANA PAYANNA;Lo;0;L;;;;;N;;;;; 0DB6;SINHALA LETTER ALPAPRAANA BAYANNA;Lo;0;L;;;;;N;;;;; 0DB7;SINHALA LETTER MAHAAPRAANA BAYANNA;Lo;0;L;;;;;N;;;;; 0DB8;SINHALA LETTER MAYANNA;Lo;0;L;;;;;N;;;;; 0DB9;SINHALA LETTER AMBA BAYANNA;Lo;0;L;;;;;N;;;;; 0DBA;SINHALA LETTER YAYANNA;Lo;0;L;;;;;N;;;;; 0DBB;SINHALA LETTER RAYANNA;Lo;0;L;;;;;N;;;;; 0DBD;SINHALA LETTER DANTAJA LAYANNA;Lo;0;L;;;;;N;;;;; 0DC0;SINHALA LETTER VAYANNA;Lo;0;L;;;;;N;;;;; 0DC1;SINHALA LETTER TAALUJA SAYANNA;Lo;0;L;;;;;N;;;;; 0DC2;SINHALA LETTER MUURDHAJA SAYANNA;Lo;0;L;;;;;N;;;;; 0DC3;SINHALA LETTER DANTAJA SAYANNA;Lo;0;L;;;;;N;;;;; 0DC4;SINHALA LETTER HAYANNA;Lo;0;L;;;;;N;;;;; 0DC5;SINHALA LETTER MUURDHAJA LAYANNA;Lo;0;L;;;;;N;;;;; 0DC6;SINHALA LETTER FAYANNA;Lo;0;L;;;;;N;;;;; 0DCA;SINHALA SIGN AL-LAKUNA;Mn;9;NSM;;;;;N;;;;; 0DCF;SINHALA VOWEL SIGN AELA-PILLA;Mc;0;L;;;;;N;;;;; 0DD0;SINHALA VOWEL SIGN KETTI AEDA-PILLA;Mc;0;L;;;;;N;;;;; 0DD1;SINHALA VOWEL SIGN DIGA AEDA-PILLA;Mc;0;L;;;;;N;;;;; 0DD2;SINHALA VOWEL SIGN KETTI IS-PILLA;Mn;0;NSM;;;;;N;;;;; 0DD3;SINHALA VOWEL SIGN DIGA IS-PILLA;Mn;0;NSM;;;;;N;;;;; 0DD4;SINHALA VOWEL SIGN KETTI PAA-PILLA;Mn;0;NSM;;;;;N;;;;; 0DD6;SINHALA VOWEL SIGN DIGA PAA-PILLA;Mn;0;NSM;;;;;N;;;;; 0DD8;SINHALA VOWEL SIGN GAETTA-PILLA;Mc;0;L;;;;;N;;;;; 0DD9;SINHALA VOWEL SIGN KOMBUVA;Mc;0;L;;;;;N;;;;; 0DDA;SINHALA VOWEL SIGN DIGA KOMBUVA;Mc;0;L;0DD9 0DCA;;;;N;;;;; 0DDB;SINHALA VOWEL SIGN KOMBU DEKA;Mc;0;L;;;;;N;;;;; 0DDC;SINHALA VOWEL SIGN KOMBUVA HAA AELA-PILLA;Mc;0;L;0DD9 0DCF;;;;N;;;;; 0DDD;SINHALA VOWEL SIGN KOMBUVA HAA DIGA AELA-PILLA;Mc;0;L;0DDC 0DCA;;;;N;;;;; 0DDE;SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA;Mc;0;L;0DD9 0DDF;;;;N;;;;; 0DDF;SINHALA VOWEL SIGN GAYANUKITTA;Mc;0;L;;;;;N;;;;; 0DF2;SINHALA VOWEL SIGN DIGA GAETTA-PILLA;Mc;0;L;;;;;N;;;;; 0DF3;SINHALA VOWEL SIGN DIGA GAYANUKITTA;Mc;0;L;;;;;N;;;;; 0DF4;SINHALA PUNCTUATION KUNDDALIYA;Po;0;L;;;;;N;;;;; 0E01;THAI CHARACTER KO KAI;Lo;0;L;;;;;N;THAI LETTER KO KAI;;;; 0E02;THAI CHARACTER KHO KHAI;Lo;0;L;;;;;N;THAI LETTER KHO KHAI;;;; 0E03;THAI CHARACTER KHO KHUAT;Lo;0;L;;;;;N;THAI LETTER KHO KHUAT;;;; 0E04;THAI CHARACTER KHO KHWAI;Lo;0;L;;;;;N;THAI LETTER KHO KHWAI;;;; 0E05;THAI CHARACTER KHO KHON;Lo;0;L;;;;;N;THAI LETTER KHO KHON;;;; 0E06;THAI CHARACTER KHO RAKHANG;Lo;0;L;;;;;N;THAI LETTER KHO RAKHANG;;;; 0E07;THAI CHARACTER NGO NGU;Lo;0;L;;;;;N;THAI LETTER NGO NGU;;;; 0E08;THAI CHARACTER CHO CHAN;Lo;0;L;;;;;N;THAI LETTER CHO CHAN;;;; 0E09;THAI CHARACTER CHO CHING;Lo;0;L;;;;;N;THAI LETTER CHO CHING;;;; 0E0A;THAI CHARACTER CHO CHANG;Lo;0;L;;;;;N;THAI LETTER CHO CHANG;;;; 0E0B;THAI CHARACTER SO SO;Lo;0;L;;;;;N;THAI LETTER SO SO;;;; 0E0C;THAI CHARACTER CHO CHOE;Lo;0;L;;;;;N;THAI LETTER CHO CHOE;;;; 0E0D;THAI CHARACTER YO YING;Lo;0;L;;;;;N;THAI LETTER YO YING;;;; 0E0E;THAI CHARACTER DO CHADA;Lo;0;L;;;;;N;THAI LETTER DO CHADA;;;; 0E0F;THAI CHARACTER TO PATAK;Lo;0;L;;;;;N;THAI LETTER TO PATAK;;;; 0E10;THAI CHARACTER THO THAN;Lo;0;L;;;;;N;THAI LETTER THO THAN;;;; 0E11;THAI CHARACTER THO NANGMONTHO;Lo;0;L;;;;;N;THAI LETTER THO NANGMONTHO;;;; 0E12;THAI CHARACTER THO PHUTHAO;Lo;0;L;;;;;N;THAI LETTER THO PHUTHAO;;;; 0E13;THAI CHARACTER NO NEN;Lo;0;L;;;;;N;THAI LETTER NO NEN;;;; 0E14;THAI CHARACTER DO DEK;Lo;0;L;;;;;N;THAI LETTER DO DEK;;;; 0E15;THAI CHARACTER TO TAO;Lo;0;L;;;;;N;THAI LETTER TO TAO;;;; 0E16;THAI CHARACTER THO THUNG;Lo;0;L;;;;;N;THAI LETTER THO THUNG;;;; 0E17;THAI CHARACTER THO THAHAN;Lo;0;L;;;;;N;THAI LETTER THO THAHAN;;;; 0E18;THAI CHARACTER THO THONG;Lo;0;L;;;;;N;THAI LETTER THO THONG;;;; 0E19;THAI CHARACTER NO NU;Lo;0;L;;;;;N;THAI LETTER NO NU;;;; 0E1A;THAI CHARACTER BO BAIMAI;Lo;0;L;;;;;N;THAI LETTER BO BAIMAI;;;; 0E1B;THAI CHARACTER PO PLA;Lo;0;L;;;;;N;THAI LETTER PO PLA;;;; 0E1C;THAI CHARACTER PHO PHUNG;Lo;0;L;;;;;N;THAI LETTER PHO PHUNG;;;; 0E1D;THAI CHARACTER FO FA;Lo;0;L;;;;;N;THAI LETTER FO FA;;;; 0E1E;THAI CHARACTER PHO PHAN;Lo;0;L;;;;;N;THAI LETTER PHO PHAN;;;; 0E1F;THAI CHARACTER FO FAN;Lo;0;L;;;;;N;THAI LETTER FO FAN;;;; 0E20;THAI CHARACTER PHO SAMPHAO;Lo;0;L;;;;;N;THAI LETTER PHO SAMPHAO;;;; 0E21;THAI CHARACTER MO MA;Lo;0;L;;;;;N;THAI LETTER MO MA;;;; 0E22;THAI CHARACTER YO YAK;Lo;0;L;;;;;N;THAI LETTER YO YAK;;;; 0E23;THAI CHARACTER RO RUA;Lo;0;L;;;;;N;THAI LETTER RO RUA;;;; 0E24;THAI CHARACTER RU;Lo;0;L;;;;;N;THAI LETTER RU;;;; 0E25;THAI CHARACTER LO LING;Lo;0;L;;;;;N;THAI LETTER LO LING;;;; 0E26;THAI CHARACTER LU;Lo;0;L;;;;;N;THAI LETTER LU;;;; 0E27;THAI CHARACTER WO WAEN;Lo;0;L;;;;;N;THAI LETTER WO WAEN;;;; 0E28;THAI CHARACTER SO SALA;Lo;0;L;;;;;N;THAI LETTER SO SALA;;;; 0E29;THAI CHARACTER SO RUSI;Lo;0;L;;;;;N;THAI LETTER SO RUSI;;;; 0E2A;THAI CHARACTER SO SUA;Lo;0;L;;;;;N;THAI LETTER SO SUA;;;; 0E2B;THAI CHARACTER HO HIP;Lo;0;L;;;;;N;THAI LETTER HO HIP;;;; 0E2C;THAI CHARACTER LO CHULA;Lo;0;L;;;;;N;THAI LETTER LO CHULA;;;; 0E2D;THAI CHARACTER O ANG;Lo;0;L;;;;;N;THAI LETTER O ANG;;;; 0E2E;THAI CHARACTER HO NOKHUK;Lo;0;L;;;;;N;THAI LETTER HO NOK HUK;;;; 0E2F;THAI CHARACTER PAIYANNOI;Lo;0;L;;;;;N;THAI PAI YAN NOI;;;; 0E30;THAI CHARACTER SARA A;Lo;0;L;;;;;N;THAI VOWEL SIGN SARA A;;;; 0E31;THAI CHARACTER MAI HAN-AKAT;Mn;0;NSM;;;;;N;THAI VOWEL SIGN MAI HAN-AKAT;;;; 0E32;THAI CHARACTER SARA AA;Lo;0;L;;;;;N;THAI VOWEL SIGN SARA AA;;;; 0E33;THAI CHARACTER SARA AM;Lo;0;L; 0E4D 0E32;;;;N;THAI VOWEL SIGN SARA AM;;;; 0E34;THAI CHARACTER SARA I;Mn;0;NSM;;;;;N;THAI VOWEL SIGN SARA I;;;; 0E35;THAI CHARACTER SARA II;Mn;0;NSM;;;;;N;THAI VOWEL SIGN SARA II;;;; 0E36;THAI CHARACTER SARA UE;Mn;0;NSM;;;;;N;THAI VOWEL SIGN SARA UE;;;; 0E37;THAI CHARACTER SARA UEE;Mn;0;NSM;;;;;N;THAI VOWEL SIGN SARA UEE;;;; 0E38;THAI CHARACTER SARA U;Mn;103;NSM;;;;;N;THAI VOWEL SIGN SARA U;;;; 0E39;THAI CHARACTER SARA UU;Mn;103;NSM;;;;;N;THAI VOWEL SIGN SARA UU;;;; 0E3A;THAI CHARACTER PHINTHU;Mn;9;NSM;;;;;N;THAI VOWEL SIGN PHINTHU;;;; 0E3F;THAI CURRENCY SYMBOL BAHT;Sc;0;ET;;;;;N;THAI BAHT SIGN;;;; 0E40;THAI CHARACTER SARA E;Lo;0;L;;;;;N;THAI VOWEL SIGN SARA E;;;; 0E41;THAI CHARACTER SARA AE;Lo;0;L;;;;;N;THAI VOWEL SIGN SARA AE;;;; 0E42;THAI CHARACTER SARA O;Lo;0;L;;;;;N;THAI VOWEL SIGN SARA O;;;; 0E43;THAI CHARACTER SARA AI MAIMUAN;Lo;0;L;;;;;N;THAI VOWEL SIGN SARA MAI MUAN;;;; 0E44;THAI CHARACTER SARA AI MAIMALAI;Lo;0;L;;;;;N;THAI VOWEL SIGN SARA MAI MALAI;;;; 0E45;THAI CHARACTER LAKKHANGYAO;Lo;0;L;;;;;N;THAI LAK KHANG YAO;;;; 0E46;THAI CHARACTER MAIYAMOK;Lm;0;L;;;;;N;THAI MAI YAMOK;;;; 0E47;THAI CHARACTER MAITAIKHU;Mn;0;NSM;;;;;N;THAI VOWEL SIGN MAI TAI KHU;;;; 0E48;THAI CHARACTER MAI EK;Mn;107;NSM;;;;;N;THAI TONE MAI EK;;;; 0E49;THAI CHARACTER MAI THO;Mn;107;NSM;;;;;N;THAI TONE MAI THO;;;; 0E4A;THAI CHARACTER MAI TRI;Mn;107;NSM;;;;;N;THAI TONE MAI TRI;;;; 0E4B;THAI CHARACTER MAI CHATTAWA;Mn;107;NSM;;;;;N;THAI TONE MAI CHATTAWA;;;; 0E4C;THAI CHARACTER THANTHAKHAT;Mn;0;NSM;;;;;N;THAI THANTHAKHAT;;;; 0E4D;THAI CHARACTER NIKHAHIT;Mn;0;NSM;;;;;N;THAI NIKKHAHIT;;;; 0E4E;THAI CHARACTER YAMAKKAN;Mn;0;NSM;;;;;N;THAI YAMAKKAN;;;; 0E4F;THAI CHARACTER FONGMAN;Po;0;L;;;;;N;THAI FONGMAN;;;; 0E50;THAI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 0E51;THAI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 0E52;THAI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 0E53;THAI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 0E54;THAI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 0E55;THAI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 0E56;THAI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 0E57;THAI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 0E58;THAI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 0E59;THAI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 0E5A;THAI CHARACTER ANGKHANKHU;Po;0;L;;;;;N;THAI ANGKHANKHU;;;; 0E5B;THAI CHARACTER KHOMUT;Po;0;L;;;;;N;THAI KHOMUT;;;; 0E81;LAO LETTER KO;Lo;0;L;;;;;N;;;;; 0E82;LAO LETTER KHO SUNG;Lo;0;L;;;;;N;;;;; 0E84;LAO LETTER KHO TAM;Lo;0;L;;;;;N;;;;; 0E87;LAO LETTER NGO;Lo;0;L;;;;;N;;;;; 0E88;LAO LETTER CO;Lo;0;L;;;;;N;;;;; 0E8A;LAO LETTER SO TAM;Lo;0;L;;;;;N;;;;; 0E8D;LAO LETTER NYO;Lo;0;L;;;;;N;;;;; 0E94;LAO LETTER DO;Lo;0;L;;;;;N;;;;; 0E95;LAO LETTER TO;Lo;0;L;;;;;N;;;;; 0E96;LAO LETTER THO SUNG;Lo;0;L;;;;;N;;;;; 0E97;LAO LETTER THO TAM;Lo;0;L;;;;;N;;;;; 0E99;LAO LETTER NO;Lo;0;L;;;;;N;;;;; 0E9A;LAO LETTER BO;Lo;0;L;;;;;N;;;;; 0E9B;LAO LETTER PO;Lo;0;L;;;;;N;;;;; 0E9C;LAO LETTER PHO SUNG;Lo;0;L;;;;;N;;;;; 0E9D;LAO LETTER FO TAM;Lo;0;L;;;;;N;;;;; 0E9E;LAO LETTER PHO TAM;Lo;0;L;;;;;N;;;;; 0E9F;LAO LETTER FO SUNG;Lo;0;L;;;;;N;;;;; 0EA1;LAO LETTER MO;Lo;0;L;;;;;N;;;;; 0EA2;LAO LETTER YO;Lo;0;L;;;;;N;;;;; 0EA3;LAO LETTER LO LING;Lo;0;L;;;;;N;;;;; 0EA5;LAO LETTER LO LOOT;Lo;0;L;;;;;N;;;;; 0EA7;LAO LETTER WO;Lo;0;L;;;;;N;;;;; 0EAA;LAO LETTER SO SUNG;Lo;0;L;;;;;N;;;;; 0EAB;LAO LETTER HO SUNG;Lo;0;L;;;;;N;;;;; 0EAD;LAO LETTER O;Lo;0;L;;;;;N;;;;; 0EAE;LAO LETTER HO TAM;Lo;0;L;;;;;N;;;;; 0EAF;LAO ELLIPSIS;Lo;0;L;;;;;N;;;;; 0EB0;LAO VOWEL SIGN A;Lo;0;L;;;;;N;;;;; 0EB1;LAO VOWEL SIGN MAI KAN;Mn;0;NSM;;;;;N;;;;; 0EB2;LAO VOWEL SIGN AA;Lo;0;L;;;;;N;;;;; 0EB3;LAO VOWEL SIGN AM;Lo;0;L; 0ECD 0EB2;;;;N;;;;; 0EB4;LAO VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 0EB5;LAO VOWEL SIGN II;Mn;0;NSM;;;;;N;;;;; 0EB6;LAO VOWEL SIGN Y;Mn;0;NSM;;;;;N;;;;; 0EB7;LAO VOWEL SIGN YY;Mn;0;NSM;;;;;N;;;;; 0EB8;LAO VOWEL SIGN U;Mn;118;NSM;;;;;N;;;;; 0EB9;LAO VOWEL SIGN UU;Mn;118;NSM;;;;;N;;;;; 0EBB;LAO VOWEL SIGN MAI KON;Mn;0;NSM;;;;;N;;;;; 0EBC;LAO SEMIVOWEL SIGN LO;Mn;0;NSM;;;;;N;;;;; 0EBD;LAO SEMIVOWEL SIGN NYO;Lo;0;L;;;;;N;;;;; 0EC0;LAO VOWEL SIGN E;Lo;0;L;;;;;N;;;;; 0EC1;LAO VOWEL SIGN EI;Lo;0;L;;;;;N;;;;; 0EC2;LAO VOWEL SIGN O;Lo;0;L;;;;;N;;;;; 0EC3;LAO VOWEL SIGN AY;Lo;0;L;;;;;N;;;;; 0EC4;LAO VOWEL SIGN AI;Lo;0;L;;;;;N;;;;; 0EC6;LAO KO LA;Lm;0;L;;;;;N;;;;; 0EC8;LAO TONE MAI EK;Mn;122;NSM;;;;;N;;;;; 0EC9;LAO TONE MAI THO;Mn;122;NSM;;;;;N;;;;; 0ECA;LAO TONE MAI TI;Mn;122;NSM;;;;;N;;;;; 0ECB;LAO TONE MAI CATAWA;Mn;122;NSM;;;;;N;;;;; 0ECC;LAO CANCELLATION MARK;Mn;0;NSM;;;;;N;;;;; 0ECD;LAO NIGGAHITA;Mn;0;NSM;;;;;N;;;;; 0ED0;LAO DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 0ED1;LAO DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 0ED2;LAO DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 0ED3;LAO DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 0ED4;LAO DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 0ED5;LAO DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 0ED6;LAO DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 0ED7;LAO DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 0ED8;LAO DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 0ED9;LAO DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 0EDC;LAO HO NO;Lo;0;L; 0EAB 0E99;;;;N;;;;; 0EDD;LAO HO MO;Lo;0;L; 0EAB 0EA1;;;;N;;;;; 0EDE;LAO LETTER KHMU GO;Lo;0;L;;;;;N;;;;; 0EDF;LAO LETTER KHMU NYO;Lo;0;L;;;;;N;;;;; 0F00;TIBETAN SYLLABLE OM;Lo;0;L;;;;;N;;;;; 0F01;TIBETAN MARK GTER YIG MGO TRUNCATED A;So;0;L;;;;;N;;;;; 0F02;TIBETAN MARK GTER YIG MGO -UM RNAM BCAD MA;So;0;L;;;;;N;;;;; 0F03;TIBETAN MARK GTER YIG MGO -UM GTER TSHEG MA;So;0;L;;;;;N;;;;; 0F04;TIBETAN MARK INITIAL YIG MGO MDUN MA;Po;0;L;;;;;N;TIBETAN SINGLE ORNAMENT;;;; 0F05;TIBETAN MARK CLOSING YIG MGO SGAB MA;Po;0;L;;;;;N;;;;; 0F06;TIBETAN MARK CARET YIG MGO PHUR SHAD MA;Po;0;L;;;;;N;;;;; 0F07;TIBETAN MARK YIG MGO TSHEG SHAD MA;Po;0;L;;;;;N;;;;; 0F08;TIBETAN MARK SBRUL SHAD;Po;0;L;;;;;N;TIBETAN RGYANSHAD;;;; 0F09;TIBETAN MARK BSKUR YIG MGO;Po;0;L;;;;;N;;;;; 0F0A;TIBETAN MARK BKA- SHOG YIG MGO;Po;0;L;;;;;N;;;;; 0F0B;TIBETAN MARK INTERSYLLABIC TSHEG;Po;0;L;;;;;N;TIBETAN TSEG;;;; 0F0C;TIBETAN MARK DELIMITER TSHEG BSTAR;Po;0;L; 0F0B;;;;N;;;;; 0F0D;TIBETAN MARK SHAD;Po;0;L;;;;;N;TIBETAN SHAD;;;; 0F0E;TIBETAN MARK NYIS SHAD;Po;0;L;;;;;N;TIBETAN DOUBLE SHAD;;;; 0F0F;TIBETAN MARK TSHEG SHAD;Po;0;L;;;;;N;;;;; 0F10;TIBETAN MARK NYIS TSHEG SHAD;Po;0;L;;;;;N;;;;; 0F11;TIBETAN MARK RIN CHEN SPUNGS SHAD;Po;0;L;;;;;N;TIBETAN RINCHANPHUNGSHAD;;;; 0F12;TIBETAN MARK RGYA GRAM SHAD;Po;0;L;;;;;N;;;;; 0F13;TIBETAN MARK CARET -DZUD RTAGS ME LONG CAN;So;0;L;;;;;N;;;;; 0F14;TIBETAN MARK GTER TSHEG;Po;0;L;;;;;N;TIBETAN COMMA;;;; 0F15;TIBETAN LOGOTYPE SIGN CHAD RTAGS;So;0;L;;;;;N;;;;; 0F16;TIBETAN LOGOTYPE SIGN LHAG RTAGS;So;0;L;;;;;N;;;;; 0F17;TIBETAN ASTROLOGICAL SIGN SGRA GCAN -CHAR RTAGS;So;0;L;;;;;N;;;;; 0F18;TIBETAN ASTROLOGICAL SIGN -KHYUD PA;Mn;220;NSM;;;;;N;;;;; 0F19;TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS;Mn;220;NSM;;;;;N;;;;; 0F1A;TIBETAN SIGN RDEL DKAR GCIG;So;0;L;;;;;N;;;;; 0F1B;TIBETAN SIGN RDEL DKAR GNYIS;So;0;L;;;;;N;;;;; 0F1C;TIBETAN SIGN RDEL DKAR GSUM;So;0;L;;;;;N;;;;; 0F1D;TIBETAN SIGN RDEL NAG GCIG;So;0;L;;;;;N;;;;; 0F1E;TIBETAN SIGN RDEL NAG GNYIS;So;0;L;;;;;N;;;;; 0F1F;TIBETAN SIGN RDEL DKAR RDEL NAG;So;0;L;;;;;N;;;;; 0F20;TIBETAN DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 0F21;TIBETAN DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 0F22;TIBETAN DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 0F23;TIBETAN DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 0F24;TIBETAN DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 0F25;TIBETAN DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 0F26;TIBETAN DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 0F27;TIBETAN DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 0F28;TIBETAN DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 0F29;TIBETAN DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 0F2A;TIBETAN DIGIT HALF ONE;No;0;L;;;;1/2;N;;;;; 0F2B;TIBETAN DIGIT HALF TWO;No;0;L;;;;3/2;N;;;;; 0F2C;TIBETAN DIGIT HALF THREE;No;0;L;;;;5/2;N;;;;; 0F2D;TIBETAN DIGIT HALF FOUR;No;0;L;;;;7/2;N;;;;; 0F2E;TIBETAN DIGIT HALF FIVE;No;0;L;;;;9/2;N;;;;; 0F2F;TIBETAN DIGIT HALF SIX;No;0;L;;;;11/2;N;;;;; 0F30;TIBETAN DIGIT HALF SEVEN;No;0;L;;;;13/2;N;;;;; 0F31;TIBETAN DIGIT HALF EIGHT;No;0;L;;;;15/2;N;;;;; 0F32;TIBETAN DIGIT HALF NINE;No;0;L;;;;17/2;N;;;;; 0F33;TIBETAN DIGIT HALF ZERO;No;0;L;;;;-1/2;N;;;;; 0F34;TIBETAN MARK BSDUS RTAGS;So;0;L;;;;;N;;;;; 0F35;TIBETAN MARK NGAS BZUNG NYI ZLA;Mn;220;NSM;;;;;N;TIBETAN HONORIFIC UNDER RING;;;; 0F36;TIBETAN MARK CARET -DZUD RTAGS BZHI MIG CAN;So;0;L;;;;;N;;;;; 0F37;TIBETAN MARK NGAS BZUNG SGOR RTAGS;Mn;220;NSM;;;;;N;TIBETAN UNDER RING;;;; 0F38;TIBETAN MARK CHE MGO;So;0;L;;;;;N;;;;; 0F39;TIBETAN MARK TSA -PHRU;Mn;216;NSM;;;;;N;TIBETAN LENITION MARK;;;; 0F3A;TIBETAN MARK GUG RTAGS GYON;Ps;0;ON;;;;;Y;;;;; 0F3B;TIBETAN MARK GUG RTAGS GYAS;Pe;0;ON;;;;;Y;;;;; 0F3C;TIBETAN MARK ANG KHANG GYON;Ps;0;ON;;;;;Y;TIBETAN LEFT BRACE;;;; 0F3D;TIBETAN MARK ANG KHANG GYAS;Pe;0;ON;;;;;Y;TIBETAN RIGHT BRACE;;;; 0F3E;TIBETAN SIGN YAR TSHES;Mc;0;L;;;;;N;;;;; 0F3F;TIBETAN SIGN MAR TSHES;Mc;0;L;;;;;N;;;;; 0F40;TIBETAN LETTER KA;Lo;0;L;;;;;N;;;;; 0F41;TIBETAN LETTER KHA;Lo;0;L;;;;;N;;;;; 0F42;TIBETAN LETTER GA;Lo;0;L;;;;;N;;;;; 0F43;TIBETAN LETTER GHA;Lo;0;L;0F42 0FB7;;;;N;;;;; 0F44;TIBETAN LETTER NGA;Lo;0;L;;;;;N;;;;; 0F45;TIBETAN LETTER CA;Lo;0;L;;;;;N;;;;; 0F46;TIBETAN LETTER CHA;Lo;0;L;;;;;N;;;;; 0F47;TIBETAN LETTER JA;Lo;0;L;;;;;N;;;;; 0F49;TIBETAN LETTER NYA;Lo;0;L;;;;;N;;;;; 0F4A;TIBETAN LETTER TTA;Lo;0;L;;;;;N;TIBETAN LETTER REVERSED TA;;;; 0F4B;TIBETAN LETTER TTHA;Lo;0;L;;;;;N;TIBETAN LETTER REVERSED THA;;;; 0F4C;TIBETAN LETTER DDA;Lo;0;L;;;;;N;TIBETAN LETTER REVERSED DA;;;; 0F4D;TIBETAN LETTER DDHA;Lo;0;L;0F4C 0FB7;;;;N;;;;; 0F4E;TIBETAN LETTER NNA;Lo;0;L;;;;;N;TIBETAN LETTER REVERSED NA;;;; 0F4F;TIBETAN LETTER TA;Lo;0;L;;;;;N;;;;; 0F50;TIBETAN LETTER THA;Lo;0;L;;;;;N;;;;; 0F51;TIBETAN LETTER DA;Lo;0;L;;;;;N;;;;; 0F52;TIBETAN LETTER DHA;Lo;0;L;0F51 0FB7;;;;N;;;;; 0F53;TIBETAN LETTER NA;Lo;0;L;;;;;N;;;;; 0F54;TIBETAN LETTER PA;Lo;0;L;;;;;N;;;;; 0F55;TIBETAN LETTER PHA;Lo;0;L;;;;;N;;;;; 0F56;TIBETAN LETTER BA;Lo;0;L;;;;;N;;;;; 0F57;TIBETAN LETTER BHA;Lo;0;L;0F56 0FB7;;;;N;;;;; 0F58;TIBETAN LETTER MA;Lo;0;L;;;;;N;;;;; 0F59;TIBETAN LETTER TSA;Lo;0;L;;;;;N;;;;; 0F5A;TIBETAN LETTER TSHA;Lo;0;L;;;;;N;;;;; 0F5B;TIBETAN LETTER DZA;Lo;0;L;;;;;N;;;;; 0F5C;TIBETAN LETTER DZHA;Lo;0;L;0F5B 0FB7;;;;N;;;;; 0F5D;TIBETAN LETTER WA;Lo;0;L;;;;;N;;;;; 0F5E;TIBETAN LETTER ZHA;Lo;0;L;;;;;N;;;;; 0F5F;TIBETAN LETTER ZA;Lo;0;L;;;;;N;;;;; 0F60;TIBETAN LETTER -A;Lo;0;L;;;;;N;TIBETAN LETTER AA;;;; 0F61;TIBETAN LETTER YA;Lo;0;L;;;;;N;;;;; 0F62;TIBETAN LETTER RA;Lo;0;L;;;;;N;;;;; 0F63;TIBETAN LETTER LA;Lo;0;L;;;;;N;;;;; 0F64;TIBETAN LETTER SHA;Lo;0;L;;;;;N;;;;; 0F65;TIBETAN LETTER SSA;Lo;0;L;;;;;N;TIBETAN LETTER REVERSED SHA;;;; 0F66;TIBETAN LETTER SA;Lo;0;L;;;;;N;;;;; 0F67;TIBETAN LETTER HA;Lo;0;L;;;;;N;;;;; 0F68;TIBETAN LETTER A;Lo;0;L;;;;;N;;;;; 0F69;TIBETAN LETTER KSSA;Lo;0;L;0F40 0FB5;;;;N;;;;; 0F6A;TIBETAN LETTER FIXED-FORM RA;Lo;0;L;;;;;N;;;;; 0F6B;TIBETAN LETTER KKA;Lo;0;L;;;;;N;;;;; 0F6C;TIBETAN LETTER RRA;Lo;0;L;;;;;N;;;;; 0F71;TIBETAN VOWEL SIGN AA;Mn;129;NSM;;;;;N;;;;; 0F72;TIBETAN VOWEL SIGN I;Mn;130;NSM;;;;;N;;;;; 0F73;TIBETAN VOWEL SIGN II;Mn;0;NSM;0F71 0F72;;;;N;;;;; 0F74;TIBETAN VOWEL SIGN U;Mn;132;NSM;;;;;N;;;;; 0F75;TIBETAN VOWEL SIGN UU;Mn;0;NSM;0F71 0F74;;;;N;;;;; 0F76;TIBETAN VOWEL SIGN VOCALIC R;Mn;0;NSM;0FB2 0F80;;;;N;;;;; 0F77;TIBETAN VOWEL SIGN VOCALIC RR;Mn;0;NSM; 0FB2 0F81;;;;N;;;;; 0F78;TIBETAN VOWEL SIGN VOCALIC L;Mn;0;NSM;0FB3 0F80;;;;N;;;;; 0F79;TIBETAN VOWEL SIGN VOCALIC LL;Mn;0;NSM; 0FB3 0F81;;;;N;;;;; 0F7A;TIBETAN VOWEL SIGN E;Mn;130;NSM;;;;;N;;;;; 0F7B;TIBETAN VOWEL SIGN EE;Mn;130;NSM;;;;;N;TIBETAN VOWEL SIGN AI;;;; 0F7C;TIBETAN VOWEL SIGN O;Mn;130;NSM;;;;;N;;;;; 0F7D;TIBETAN VOWEL SIGN OO;Mn;130;NSM;;;;;N;TIBETAN VOWEL SIGN AU;;;; 0F7E;TIBETAN SIGN RJES SU NGA RO;Mn;0;NSM;;;;;N;TIBETAN ANUSVARA;;;; 0F7F;TIBETAN SIGN RNAM BCAD;Mc;0;L;;;;;N;TIBETAN VISARGA;;;; 0F80;TIBETAN VOWEL SIGN REVERSED I;Mn;130;NSM;;;;;N;TIBETAN VOWEL SIGN SHORT I;;;; 0F81;TIBETAN VOWEL SIGN REVERSED II;Mn;0;NSM;0F71 0F80;;;;N;;;;; 0F82;TIBETAN SIGN NYI ZLA NAA DA;Mn;230;NSM;;;;;N;TIBETAN CANDRABINDU WITH ORNAMENT;;;; 0F83;TIBETAN SIGN SNA LDAN;Mn;230;NSM;;;;;N;TIBETAN CANDRABINDU;;;; 0F84;TIBETAN MARK HALANTA;Mn;9;NSM;;;;;N;TIBETAN VIRAMA;;;; 0F85;TIBETAN MARK PALUTA;Po;0;L;;;;;N;TIBETAN CHUCHENYIGE;;;; 0F86;TIBETAN SIGN LCI RTAGS;Mn;230;NSM;;;;;N;;;;; 0F87;TIBETAN SIGN YANG RTAGS;Mn;230;NSM;;;;;N;;;;; 0F88;TIBETAN SIGN LCE TSA CAN;Lo;0;L;;;;;N;;;;; 0F89;TIBETAN SIGN MCHU CAN;Lo;0;L;;;;;N;;;;; 0F8A;TIBETAN SIGN GRU CAN RGYINGS;Lo;0;L;;;;;N;;;;; 0F8B;TIBETAN SIGN GRU MED RGYINGS;Lo;0;L;;;;;N;;;;; 0F8C;TIBETAN SIGN INVERTED MCHU CAN;Lo;0;L;;;;;N;;;;; 0F8D;TIBETAN SUBJOINED SIGN LCE TSA CAN;Mn;0;NSM;;;;;N;;;;; 0F8E;TIBETAN SUBJOINED SIGN MCHU CAN;Mn;0;NSM;;;;;N;;;;; 0F8F;TIBETAN SUBJOINED SIGN INVERTED MCHU CAN;Mn;0;NSM;;;;;N;;;;; 0F90;TIBETAN SUBJOINED LETTER KA;Mn;0;NSM;;;;;N;;;;; 0F91;TIBETAN SUBJOINED LETTER KHA;Mn;0;NSM;;;;;N;;;;; 0F92;TIBETAN SUBJOINED LETTER GA;Mn;0;NSM;;;;;N;;;;; 0F93;TIBETAN SUBJOINED LETTER GHA;Mn;0;NSM;0F92 0FB7;;;;N;;;;; 0F94;TIBETAN SUBJOINED LETTER NGA;Mn;0;NSM;;;;;N;;;;; 0F95;TIBETAN SUBJOINED LETTER CA;Mn;0;NSM;;;;;N;;;;; 0F96;TIBETAN SUBJOINED LETTER CHA;Mn;0;NSM;;;;;N;;;;; 0F97;TIBETAN SUBJOINED LETTER JA;Mn;0;NSM;;;;;N;;;;; 0F99;TIBETAN SUBJOINED LETTER NYA;Mn;0;NSM;;;;;N;;;;; 0F9A;TIBETAN SUBJOINED LETTER TTA;Mn;0;NSM;;;;;N;;;;; 0F9B;TIBETAN SUBJOINED LETTER TTHA;Mn;0;NSM;;;;;N;;;;; 0F9C;TIBETAN SUBJOINED LETTER DDA;Mn;0;NSM;;;;;N;;;;; 0F9D;TIBETAN SUBJOINED LETTER DDHA;Mn;0;NSM;0F9C 0FB7;;;;N;;;;; 0F9E;TIBETAN SUBJOINED LETTER NNA;Mn;0;NSM;;;;;N;;;;; 0F9F;TIBETAN SUBJOINED LETTER TA;Mn;0;NSM;;;;;N;;;;; 0FA0;TIBETAN SUBJOINED LETTER THA;Mn;0;NSM;;;;;N;;;;; 0FA1;TIBETAN SUBJOINED LETTER DA;Mn;0;NSM;;;;;N;;;;; 0FA2;TIBETAN SUBJOINED LETTER DHA;Mn;0;NSM;0FA1 0FB7;;;;N;;;;; 0FA3;TIBETAN SUBJOINED LETTER NA;Mn;0;NSM;;;;;N;;;;; 0FA4;TIBETAN SUBJOINED LETTER PA;Mn;0;NSM;;;;;N;;;;; 0FA5;TIBETAN SUBJOINED LETTER PHA;Mn;0;NSM;;;;;N;;;;; 0FA6;TIBETAN SUBJOINED LETTER BA;Mn;0;NSM;;;;;N;;;;; 0FA7;TIBETAN SUBJOINED LETTER BHA;Mn;0;NSM;0FA6 0FB7;;;;N;;;;; 0FA8;TIBETAN SUBJOINED LETTER MA;Mn;0;NSM;;;;;N;;;;; 0FA9;TIBETAN SUBJOINED LETTER TSA;Mn;0;NSM;;;;;N;;;;; 0FAA;TIBETAN SUBJOINED LETTER TSHA;Mn;0;NSM;;;;;N;;;;; 0FAB;TIBETAN SUBJOINED LETTER DZA;Mn;0;NSM;;;;;N;;;;; 0FAC;TIBETAN SUBJOINED LETTER DZHA;Mn;0;NSM;0FAB 0FB7;;;;N;;;;; 0FAD;TIBETAN SUBJOINED LETTER WA;Mn;0;NSM;;;;;N;;;;; 0FAE;TIBETAN SUBJOINED LETTER ZHA;Mn;0;NSM;;;;;N;;;;; 0FAF;TIBETAN SUBJOINED LETTER ZA;Mn;0;NSM;;;;;N;;;;; 0FB0;TIBETAN SUBJOINED LETTER -A;Mn;0;NSM;;;;;N;;;;; 0FB1;TIBETAN SUBJOINED LETTER YA;Mn;0;NSM;;;;;N;;;;; 0FB2;TIBETAN SUBJOINED LETTER RA;Mn;0;NSM;;;;;N;;;;; 0FB3;TIBETAN SUBJOINED LETTER LA;Mn;0;NSM;;;;;N;;;;; 0FB4;TIBETAN SUBJOINED LETTER SHA;Mn;0;NSM;;;;;N;;;;; 0FB5;TIBETAN SUBJOINED LETTER SSA;Mn;0;NSM;;;;;N;;;;; 0FB6;TIBETAN SUBJOINED LETTER SA;Mn;0;NSM;;;;;N;;;;; 0FB7;TIBETAN SUBJOINED LETTER HA;Mn;0;NSM;;;;;N;;;;; 0FB8;TIBETAN SUBJOINED LETTER A;Mn;0;NSM;;;;;N;;;;; 0FB9;TIBETAN SUBJOINED LETTER KSSA;Mn;0;NSM;0F90 0FB5;;;;N;;;;; 0FBA;TIBETAN SUBJOINED LETTER FIXED-FORM WA;Mn;0;NSM;;;;;N;;;;; 0FBB;TIBETAN SUBJOINED LETTER FIXED-FORM YA;Mn;0;NSM;;;;;N;;;;; 0FBC;TIBETAN SUBJOINED LETTER FIXED-FORM RA;Mn;0;NSM;;;;;N;;;;; 0FBE;TIBETAN KU RU KHA;So;0;L;;;;;N;;;;; 0FBF;TIBETAN KU RU KHA BZHI MIG CAN;So;0;L;;;;;N;;;;; 0FC0;TIBETAN CANTILLATION SIGN HEAVY BEAT;So;0;L;;;;;N;;;;; 0FC1;TIBETAN CANTILLATION SIGN LIGHT BEAT;So;0;L;;;;;N;;;;; 0FC2;TIBETAN CANTILLATION SIGN CANG TE-U;So;0;L;;;;;N;;;;; 0FC3;TIBETAN CANTILLATION SIGN SBUB -CHAL;So;0;L;;;;;N;;;;; 0FC4;TIBETAN SYMBOL DRIL BU;So;0;L;;;;;N;;;;; 0FC5;TIBETAN SYMBOL RDO RJE;So;0;L;;;;;N;;;;; 0FC6;TIBETAN SYMBOL PADMA GDAN;Mn;220;NSM;;;;;N;;;;; 0FC7;TIBETAN SYMBOL RDO RJE RGYA GRAM;So;0;L;;;;;N;;;;; 0FC8;TIBETAN SYMBOL PHUR PA;So;0;L;;;;;N;;;;; 0FC9;TIBETAN SYMBOL NOR BU;So;0;L;;;;;N;;;;; 0FCA;TIBETAN SYMBOL NOR BU NYIS -KHYIL;So;0;L;;;;;N;;;;; 0FCB;TIBETAN SYMBOL NOR BU GSUM -KHYIL;So;0;L;;;;;N;;;;; 0FCC;TIBETAN SYMBOL NOR BU BZHI -KHYIL;So;0;L;;;;;N;;;;; 0FCE;TIBETAN SIGN RDEL NAG RDEL DKAR;So;0;L;;;;;N;;;;; 0FCF;TIBETAN SIGN RDEL NAG GSUM;So;0;L;;;;;N;;;;; 0FD0;TIBETAN MARK BSKA- SHOG GI MGO RGYAN;Po;0;L;;;;;N;;;;; 0FD1;TIBETAN MARK MNYAM YIG GI MGO RGYAN;Po;0;L;;;;;N;;;;; 0FD2;TIBETAN MARK NYIS TSHEG;Po;0;L;;;;;N;;;;; 0FD3;TIBETAN MARK INITIAL BRDA RNYING YIG MGO MDUN MA;Po;0;L;;;;;N;;;;; 0FD4;TIBETAN MARK CLOSING BRDA RNYING YIG MGO SGAB MA;Po;0;L;;;;;N;;;;; 0FD5;RIGHT-FACING SVASTI SIGN;So;0;L;;;;;N;;;;; 0FD6;LEFT-FACING SVASTI SIGN;So;0;L;;;;;N;;;;; 0FD7;RIGHT-FACING SVASTI SIGN WITH DOTS;So;0;L;;;;;N;;;;; 0FD8;LEFT-FACING SVASTI SIGN WITH DOTS;So;0;L;;;;;N;;;;; 0FD9;TIBETAN MARK LEADING MCHAN RTAGS;Po;0;L;;;;;N;;;;; 0FDA;TIBETAN MARK TRAILING MCHAN RTAGS;Po;0;L;;;;;N;;;;; 1000;MYANMAR LETTER KA;Lo;0;L;;;;;N;;;;; 1001;MYANMAR LETTER KHA;Lo;0;L;;;;;N;;;;; 1002;MYANMAR LETTER GA;Lo;0;L;;;;;N;;;;; 1003;MYANMAR LETTER GHA;Lo;0;L;;;;;N;;;;; 1004;MYANMAR LETTER NGA;Lo;0;L;;;;;N;;;;; 1005;MYANMAR LETTER CA;Lo;0;L;;;;;N;;;;; 1006;MYANMAR LETTER CHA;Lo;0;L;;;;;N;;;;; 1007;MYANMAR LETTER JA;Lo;0;L;;;;;N;;;;; 1008;MYANMAR LETTER JHA;Lo;0;L;;;;;N;;;;; 1009;MYANMAR LETTER NYA;Lo;0;L;;;;;N;;;;; 100A;MYANMAR LETTER NNYA;Lo;0;L;;;;;N;;;;; 100B;MYANMAR LETTER TTA;Lo;0;L;;;;;N;;;;; 100C;MYANMAR LETTER TTHA;Lo;0;L;;;;;N;;;;; 100D;MYANMAR LETTER DDA;Lo;0;L;;;;;N;;;;; 100E;MYANMAR LETTER DDHA;Lo;0;L;;;;;N;;;;; 100F;MYANMAR LETTER NNA;Lo;0;L;;;;;N;;;;; 1010;MYANMAR LETTER TA;Lo;0;L;;;;;N;;;;; 1011;MYANMAR LETTER THA;Lo;0;L;;;;;N;;;;; 1012;MYANMAR LETTER DA;Lo;0;L;;;;;N;;;;; 1013;MYANMAR LETTER DHA;Lo;0;L;;;;;N;;;;; 1014;MYANMAR LETTER NA;Lo;0;L;;;;;N;;;;; 1015;MYANMAR LETTER PA;Lo;0;L;;;;;N;;;;; 1016;MYANMAR LETTER PHA;Lo;0;L;;;;;N;;;;; 1017;MYANMAR LETTER BA;Lo;0;L;;;;;N;;;;; 1018;MYANMAR LETTER BHA;Lo;0;L;;;;;N;;;;; 1019;MYANMAR LETTER MA;Lo;0;L;;;;;N;;;;; 101A;MYANMAR LETTER YA;Lo;0;L;;;;;N;;;;; 101B;MYANMAR LETTER RA;Lo;0;L;;;;;N;;;;; 101C;MYANMAR LETTER LA;Lo;0;L;;;;;N;;;;; 101D;MYANMAR LETTER WA;Lo;0;L;;;;;N;;;;; 101E;MYANMAR LETTER SA;Lo;0;L;;;;;N;;;;; 101F;MYANMAR LETTER HA;Lo;0;L;;;;;N;;;;; 1020;MYANMAR LETTER LLA;Lo;0;L;;;;;N;;;;; 1021;MYANMAR LETTER A;Lo;0;L;;;;;N;;;;; 1022;MYANMAR LETTER SHAN A;Lo;0;L;;;;;N;;;;; 1023;MYANMAR LETTER I;Lo;0;L;;;;;N;;;;; 1024;MYANMAR LETTER II;Lo;0;L;;;;;N;;;;; 1025;MYANMAR LETTER U;Lo;0;L;;;;;N;;;;; 1026;MYANMAR LETTER UU;Lo;0;L;1025 102E;;;;N;;;;; 1027;MYANMAR LETTER E;Lo;0;L;;;;;N;;;;; 1028;MYANMAR LETTER MON E;Lo;0;L;;;;;N;;;;; 1029;MYANMAR LETTER O;Lo;0;L;;;;;N;;;;; 102A;MYANMAR LETTER AU;Lo;0;L;;;;;N;;;;; 102B;MYANMAR VOWEL SIGN TALL AA;Mc;0;L;;;;;N;;;;; 102C;MYANMAR VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 102D;MYANMAR VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 102E;MYANMAR VOWEL SIGN II;Mn;0;NSM;;;;;N;;;;; 102F;MYANMAR VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 1030;MYANMAR VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 1031;MYANMAR VOWEL SIGN E;Mc;0;L;;;;;N;;;;; 1032;MYANMAR VOWEL SIGN AI;Mn;0;NSM;;;;;N;;;;; 1033;MYANMAR VOWEL SIGN MON II;Mn;0;NSM;;;;;N;;;;; 1034;MYANMAR VOWEL SIGN MON O;Mn;0;NSM;;;;;N;;;;; 1035;MYANMAR VOWEL SIGN E ABOVE;Mn;0;NSM;;;;;N;;;;; 1036;MYANMAR SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; 1037;MYANMAR SIGN DOT BELOW;Mn;7;NSM;;;;;N;;;;; 1038;MYANMAR SIGN VISARGA;Mc;0;L;;;;;N;;;;; 1039;MYANMAR SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 103A;MYANMAR SIGN ASAT;Mn;9;NSM;;;;;N;;;;; 103B;MYANMAR CONSONANT SIGN MEDIAL YA;Mc;0;L;;;;;N;;;;; 103C;MYANMAR CONSONANT SIGN MEDIAL RA;Mc;0;L;;;;;N;;;;; 103D;MYANMAR CONSONANT SIGN MEDIAL WA;Mn;0;NSM;;;;;N;;;;; 103E;MYANMAR CONSONANT SIGN MEDIAL HA;Mn;0;NSM;;;;;N;;;;; 103F;MYANMAR LETTER GREAT SA;Lo;0;L;;;;;N;;;;; 1040;MYANMAR DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 1041;MYANMAR DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 1042;MYANMAR DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 1043;MYANMAR DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 1044;MYANMAR DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 1045;MYANMAR DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 1046;MYANMAR DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 1047;MYANMAR DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 1048;MYANMAR DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 1049;MYANMAR DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 104A;MYANMAR SIGN LITTLE SECTION;Po;0;L;;;;;N;;;;; 104B;MYANMAR SIGN SECTION;Po;0;L;;;;;N;;;;; 104C;MYANMAR SYMBOL LOCATIVE;Po;0;L;;;;;N;;;;; 104D;MYANMAR SYMBOL COMPLETED;Po;0;L;;;;;N;;;;; 104E;MYANMAR SYMBOL AFOREMENTIONED;Po;0;L;;;;;N;;;;; 104F;MYANMAR SYMBOL GENITIVE;Po;0;L;;;;;N;;;;; 1050;MYANMAR LETTER SHA;Lo;0;L;;;;;N;;;;; 1051;MYANMAR LETTER SSA;Lo;0;L;;;;;N;;;;; 1052;MYANMAR LETTER VOCALIC R;Lo;0;L;;;;;N;;;;; 1053;MYANMAR LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; 1054;MYANMAR LETTER VOCALIC L;Lo;0;L;;;;;N;;;;; 1055;MYANMAR LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;; 1056;MYANMAR VOWEL SIGN VOCALIC R;Mc;0;L;;;;;N;;;;; 1057;MYANMAR VOWEL SIGN VOCALIC RR;Mc;0;L;;;;;N;;;;; 1058;MYANMAR VOWEL SIGN VOCALIC L;Mn;0;NSM;;;;;N;;;;; 1059;MYANMAR VOWEL SIGN VOCALIC LL;Mn;0;NSM;;;;;N;;;;; 105A;MYANMAR LETTER MON NGA;Lo;0;L;;;;;N;;;;; 105B;MYANMAR LETTER MON JHA;Lo;0;L;;;;;N;;;;; 105C;MYANMAR LETTER MON BBA;Lo;0;L;;;;;N;;;;; 105D;MYANMAR LETTER MON BBE;Lo;0;L;;;;;N;;;;; 105E;MYANMAR CONSONANT SIGN MON MEDIAL NA;Mn;0;NSM;;;;;N;;;;; 105F;MYANMAR CONSONANT SIGN MON MEDIAL MA;Mn;0;NSM;;;;;N;;;;; 1060;MYANMAR CONSONANT SIGN MON MEDIAL LA;Mn;0;NSM;;;;;N;;;;; 1061;MYANMAR LETTER SGAW KAREN SHA;Lo;0;L;;;;;N;;;;; 1062;MYANMAR VOWEL SIGN SGAW KAREN EU;Mc;0;L;;;;;N;;;;; 1063;MYANMAR TONE MARK SGAW KAREN HATHI;Mc;0;L;;;;;N;;;;; 1064;MYANMAR TONE MARK SGAW KAREN KE PHO;Mc;0;L;;;;;N;;;;; 1065;MYANMAR LETTER WESTERN PWO KAREN THA;Lo;0;L;;;;;N;;;;; 1066;MYANMAR LETTER WESTERN PWO KAREN PWA;Lo;0;L;;;;;N;;;;; 1067;MYANMAR VOWEL SIGN WESTERN PWO KAREN EU;Mc;0;L;;;;;N;;;;; 1068;MYANMAR VOWEL SIGN WESTERN PWO KAREN UE;Mc;0;L;;;;;N;;;;; 1069;MYANMAR SIGN WESTERN PWO KAREN TONE-1;Mc;0;L;;;;;N;;;;; 106A;MYANMAR SIGN WESTERN PWO KAREN TONE-2;Mc;0;L;;;;;N;;;;; 106B;MYANMAR SIGN WESTERN PWO KAREN TONE-3;Mc;0;L;;;;;N;;;;; 106C;MYANMAR SIGN WESTERN PWO KAREN TONE-4;Mc;0;L;;;;;N;;;;; 106D;MYANMAR SIGN WESTERN PWO KAREN TONE-5;Mc;0;L;;;;;N;;;;; 106E;MYANMAR LETTER EASTERN PWO KAREN NNA;Lo;0;L;;;;;N;;;;; 106F;MYANMAR LETTER EASTERN PWO KAREN YWA;Lo;0;L;;;;;N;;;;; 1070;MYANMAR LETTER EASTERN PWO KAREN GHWA;Lo;0;L;;;;;N;;;;; 1071;MYANMAR VOWEL SIGN GEBA KAREN I;Mn;0;NSM;;;;;N;;;;; 1072;MYANMAR VOWEL SIGN KAYAH OE;Mn;0;NSM;;;;;N;;;;; 1073;MYANMAR VOWEL SIGN KAYAH U;Mn;0;NSM;;;;;N;;;;; 1074;MYANMAR VOWEL SIGN KAYAH EE;Mn;0;NSM;;;;;N;;;;; 1075;MYANMAR LETTER SHAN KA;Lo;0;L;;;;;N;;;;; 1076;MYANMAR LETTER SHAN KHA;Lo;0;L;;;;;N;;;;; 1077;MYANMAR LETTER SHAN GA;Lo;0;L;;;;;N;;;;; 1078;MYANMAR LETTER SHAN CA;Lo;0;L;;;;;N;;;;; 1079;MYANMAR LETTER SHAN ZA;Lo;0;L;;;;;N;;;;; 107A;MYANMAR LETTER SHAN NYA;Lo;0;L;;;;;N;;;;; 107B;MYANMAR LETTER SHAN DA;Lo;0;L;;;;;N;;;;; 107C;MYANMAR LETTER SHAN NA;Lo;0;L;;;;;N;;;;; 107D;MYANMAR LETTER SHAN PHA;Lo;0;L;;;;;N;;;;; 107E;MYANMAR LETTER SHAN FA;Lo;0;L;;;;;N;;;;; 107F;MYANMAR LETTER SHAN BA;Lo;0;L;;;;;N;;;;; 1080;MYANMAR LETTER SHAN THA;Lo;0;L;;;;;N;;;;; 1081;MYANMAR LETTER SHAN HA;Lo;0;L;;;;;N;;;;; 1082;MYANMAR CONSONANT SIGN SHAN MEDIAL WA;Mn;0;NSM;;;;;N;;;;; 1083;MYANMAR VOWEL SIGN SHAN AA;Mc;0;L;;;;;N;;;;; 1084;MYANMAR VOWEL SIGN SHAN E;Mc;0;L;;;;;N;;;;; 1085;MYANMAR VOWEL SIGN SHAN E ABOVE;Mn;0;NSM;;;;;N;;;;; 1086;MYANMAR VOWEL SIGN SHAN FINAL Y;Mn;0;NSM;;;;;N;;;;; 1087;MYANMAR SIGN SHAN TONE-2;Mc;0;L;;;;;N;;;;; 1088;MYANMAR SIGN SHAN TONE-3;Mc;0;L;;;;;N;;;;; 1089;MYANMAR SIGN SHAN TONE-5;Mc;0;L;;;;;N;;;;; 108A;MYANMAR SIGN SHAN TONE-6;Mc;0;L;;;;;N;;;;; 108B;MYANMAR SIGN SHAN COUNCIL TONE-2;Mc;0;L;;;;;N;;;;; 108C;MYANMAR SIGN SHAN COUNCIL TONE-3;Mc;0;L;;;;;N;;;;; 108D;MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE;Mn;220;NSM;;;;;N;;;;; 108E;MYANMAR LETTER RUMAI PALAUNG FA;Lo;0;L;;;;;N;;;;; 108F;MYANMAR SIGN RUMAI PALAUNG TONE-5;Mc;0;L;;;;;N;;;;; 1090;MYANMAR SHAN DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 1091;MYANMAR SHAN DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 1092;MYANMAR SHAN DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 1093;MYANMAR SHAN DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 1094;MYANMAR SHAN DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 1095;MYANMAR SHAN DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 1096;MYANMAR SHAN DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 1097;MYANMAR SHAN DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 1098;MYANMAR SHAN DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 1099;MYANMAR SHAN DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 109A;MYANMAR SIGN KHAMTI TONE-1;Mc;0;L;;;;;N;;;;; 109B;MYANMAR SIGN KHAMTI TONE-3;Mc;0;L;;;;;N;;;;; 109C;MYANMAR VOWEL SIGN AITON A;Mc;0;L;;;;;N;;;;; 109D;MYANMAR VOWEL SIGN AITON AI;Mn;0;NSM;;;;;N;;;;; 109E;MYANMAR SYMBOL SHAN ONE;So;0;L;;;;;N;;;;; 109F;MYANMAR SYMBOL SHAN EXCLAMATION;So;0;L;;;;;N;;;;; 10A0;GEORGIAN CAPITAL LETTER AN;Lu;0;L;;;;;N;;;;2D00; 10A1;GEORGIAN CAPITAL LETTER BAN;Lu;0;L;;;;;N;;;;2D01; 10A2;GEORGIAN CAPITAL LETTER GAN;Lu;0;L;;;;;N;;;;2D02; 10A3;GEORGIAN CAPITAL LETTER DON;Lu;0;L;;;;;N;;;;2D03; 10A4;GEORGIAN CAPITAL LETTER EN;Lu;0;L;;;;;N;;;;2D04; 10A5;GEORGIAN CAPITAL LETTER VIN;Lu;0;L;;;;;N;;;;2D05; 10A6;GEORGIAN CAPITAL LETTER ZEN;Lu;0;L;;;;;N;;;;2D06; 10A7;GEORGIAN CAPITAL LETTER TAN;Lu;0;L;;;;;N;;;;2D07; 10A8;GEORGIAN CAPITAL LETTER IN;Lu;0;L;;;;;N;;;;2D08; 10A9;GEORGIAN CAPITAL LETTER KAN;Lu;0;L;;;;;N;;;;2D09; 10AA;GEORGIAN CAPITAL LETTER LAS;Lu;0;L;;;;;N;;;;2D0A; 10AB;GEORGIAN CAPITAL LETTER MAN;Lu;0;L;;;;;N;;;;2D0B; 10AC;GEORGIAN CAPITAL LETTER NAR;Lu;0;L;;;;;N;;;;2D0C; 10AD;GEORGIAN CAPITAL LETTER ON;Lu;0;L;;;;;N;;;;2D0D; 10AE;GEORGIAN CAPITAL LETTER PAR;Lu;0;L;;;;;N;;;;2D0E; 10AF;GEORGIAN CAPITAL LETTER ZHAR;Lu;0;L;;;;;N;;;;2D0F; 10B0;GEORGIAN CAPITAL LETTER RAE;Lu;0;L;;;;;N;;;;2D10; 10B1;GEORGIAN CAPITAL LETTER SAN;Lu;0;L;;;;;N;;;;2D11; 10B2;GEORGIAN CAPITAL LETTER TAR;Lu;0;L;;;;;N;;;;2D12; 10B3;GEORGIAN CAPITAL LETTER UN;Lu;0;L;;;;;N;;;;2D13; 10B4;GEORGIAN CAPITAL LETTER PHAR;Lu;0;L;;;;;N;;;;2D14; 10B5;GEORGIAN CAPITAL LETTER KHAR;Lu;0;L;;;;;N;;;;2D15; 10B6;GEORGIAN CAPITAL LETTER GHAN;Lu;0;L;;;;;N;;;;2D16; 10B7;GEORGIAN CAPITAL LETTER QAR;Lu;0;L;;;;;N;;;;2D17; 10B8;GEORGIAN CAPITAL LETTER SHIN;Lu;0;L;;;;;N;;;;2D18; 10B9;GEORGIAN CAPITAL LETTER CHIN;Lu;0;L;;;;;N;;;;2D19; 10BA;GEORGIAN CAPITAL LETTER CAN;Lu;0;L;;;;;N;;;;2D1A; 10BB;GEORGIAN CAPITAL LETTER JIL;Lu;0;L;;;;;N;;;;2D1B; 10BC;GEORGIAN CAPITAL LETTER CIL;Lu;0;L;;;;;N;;;;2D1C; 10BD;GEORGIAN CAPITAL LETTER CHAR;Lu;0;L;;;;;N;;;;2D1D; 10BE;GEORGIAN CAPITAL LETTER XAN;Lu;0;L;;;;;N;;;;2D1E; 10BF;GEORGIAN CAPITAL LETTER JHAN;Lu;0;L;;;;;N;;;;2D1F; 10C0;GEORGIAN CAPITAL LETTER HAE;Lu;0;L;;;;;N;;;;2D20; 10C1;GEORGIAN CAPITAL LETTER HE;Lu;0;L;;;;;N;;;;2D21; 10C2;GEORGIAN CAPITAL LETTER HIE;Lu;0;L;;;;;N;;;;2D22; 10C3;GEORGIAN CAPITAL LETTER WE;Lu;0;L;;;;;N;;;;2D23; 10C4;GEORGIAN CAPITAL LETTER HAR;Lu;0;L;;;;;N;;;;2D24; 10C5;GEORGIAN CAPITAL LETTER HOE;Lu;0;L;;;;;N;;;;2D25; 10C7;GEORGIAN CAPITAL LETTER YN;Lu;0;L;;;;;N;;;;2D27; 10CD;GEORGIAN CAPITAL LETTER AEN;Lu;0;L;;;;;N;;;;2D2D; 10D0;GEORGIAN LETTER AN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER AN;;;; 10D1;GEORGIAN LETTER BAN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER BAN;;;; 10D2;GEORGIAN LETTER GAN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER GAN;;;; 10D3;GEORGIAN LETTER DON;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER DON;;;; 10D4;GEORGIAN LETTER EN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER EN;;;; 10D5;GEORGIAN LETTER VIN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER VIN;;;; 10D6;GEORGIAN LETTER ZEN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER ZEN;;;; 10D7;GEORGIAN LETTER TAN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER TAN;;;; 10D8;GEORGIAN LETTER IN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER IN;;;; 10D9;GEORGIAN LETTER KAN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER KAN;;;; 10DA;GEORGIAN LETTER LAS;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER LAS;;;; 10DB;GEORGIAN LETTER MAN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER MAN;;;; 10DC;GEORGIAN LETTER NAR;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER NAR;;;; 10DD;GEORGIAN LETTER ON;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER ON;;;; 10DE;GEORGIAN LETTER PAR;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER PAR;;;; 10DF;GEORGIAN LETTER ZHAR;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER ZHAR;;;; 10E0;GEORGIAN LETTER RAE;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER RAE;;;; 10E1;GEORGIAN LETTER SAN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER SAN;;;; 10E2;GEORGIAN LETTER TAR;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER TAR;;;; 10E3;GEORGIAN LETTER UN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER UN;;;; 10E4;GEORGIAN LETTER PHAR;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER PHAR;;;; 10E5;GEORGIAN LETTER KHAR;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER KHAR;;;; 10E6;GEORGIAN LETTER GHAN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER GHAN;;;; 10E7;GEORGIAN LETTER QAR;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER QAR;;;; 10E8;GEORGIAN LETTER SHIN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER SHIN;;;; 10E9;GEORGIAN LETTER CHIN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER CHIN;;;; 10EA;GEORGIAN LETTER CAN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER CAN;;;; 10EB;GEORGIAN LETTER JIL;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER JIL;;;; 10EC;GEORGIAN LETTER CIL;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER CIL;;;; 10ED;GEORGIAN LETTER CHAR;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER CHAR;;;; 10EE;GEORGIAN LETTER XAN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER XAN;;;; 10EF;GEORGIAN LETTER JHAN;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER JHAN;;;; 10F0;GEORGIAN LETTER HAE;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER HAE;;;; 10F1;GEORGIAN LETTER HE;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER HE;;;; 10F2;GEORGIAN LETTER HIE;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER HIE;;;; 10F3;GEORGIAN LETTER WE;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER WE;;;; 10F4;GEORGIAN LETTER HAR;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER HAR;;;; 10F5;GEORGIAN LETTER HOE;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER HOE;;;; 10F6;GEORGIAN LETTER FI;Lo;0;L;;;;;N;GEORGIAN SMALL LETTER FI;;;; 10F7;GEORGIAN LETTER YN;Lo;0;L;;;;;N;;;;; 10F8;GEORGIAN LETTER ELIFI;Lo;0;L;;;;;N;;;;; 10F9;GEORGIAN LETTER TURNED GAN;Lo;0;L;;;;;N;;;;; 10FA;GEORGIAN LETTER AIN;Lo;0;L;;;;;N;;;;; 10FB;GEORGIAN PARAGRAPH SEPARATOR;Po;0;L;;;;;N;;;;; 10FC;MODIFIER LETTER GEORGIAN NAR;Lm;0;L; 10DC;;;;N;;;;; 10FD;GEORGIAN LETTER AEN;Lo;0;L;;;;;N;;;;; 10FE;GEORGIAN LETTER HARD SIGN;Lo;0;L;;;;;N;;;;; 10FF;GEORGIAN LETTER LABIAL SIGN;Lo;0;L;;;;;N;;;;; 1100;HANGUL CHOSEONG KIYEOK;Lo;0;L;;;;;N;;;;; 1101;HANGUL CHOSEONG SSANGKIYEOK;Lo;0;L;;;;;N;;;;; 1102;HANGUL CHOSEONG NIEUN;Lo;0;L;;;;;N;;;;; 1103;HANGUL CHOSEONG TIKEUT;Lo;0;L;;;;;N;;;;; 1104;HANGUL CHOSEONG SSANGTIKEUT;Lo;0;L;;;;;N;;;;; 1105;HANGUL CHOSEONG RIEUL;Lo;0;L;;;;;N;;;;; 1106;HANGUL CHOSEONG MIEUM;Lo;0;L;;;;;N;;;;; 1107;HANGUL CHOSEONG PIEUP;Lo;0;L;;;;;N;;;;; 1108;HANGUL CHOSEONG SSANGPIEUP;Lo;0;L;;;;;N;;;;; 1109;HANGUL CHOSEONG SIOS;Lo;0;L;;;;;N;;;;; 110A;HANGUL CHOSEONG SSANGSIOS;Lo;0;L;;;;;N;;;;; 110B;HANGUL CHOSEONG IEUNG;Lo;0;L;;;;;N;;;;; 110C;HANGUL CHOSEONG CIEUC;Lo;0;L;;;;;N;;;;; 110D;HANGUL CHOSEONG SSANGCIEUC;Lo;0;L;;;;;N;;;;; 110E;HANGUL CHOSEONG CHIEUCH;Lo;0;L;;;;;N;;;;; 110F;HANGUL CHOSEONG KHIEUKH;Lo;0;L;;;;;N;;;;; 1110;HANGUL CHOSEONG THIEUTH;Lo;0;L;;;;;N;;;;; 1111;HANGUL CHOSEONG PHIEUPH;Lo;0;L;;;;;N;;;;; 1112;HANGUL CHOSEONG HIEUH;Lo;0;L;;;;;N;;;;; 1113;HANGUL CHOSEONG NIEUN-KIYEOK;Lo;0;L;;;;;N;;;;; 1114;HANGUL CHOSEONG SSANGNIEUN;Lo;0;L;;;;;N;;;;; 1115;HANGUL CHOSEONG NIEUN-TIKEUT;Lo;0;L;;;;;N;;;;; 1116;HANGUL CHOSEONG NIEUN-PIEUP;Lo;0;L;;;;;N;;;;; 1117;HANGUL CHOSEONG TIKEUT-KIYEOK;Lo;0;L;;;;;N;;;;; 1118;HANGUL CHOSEONG RIEUL-NIEUN;Lo;0;L;;;;;N;;;;; 1119;HANGUL CHOSEONG SSANGRIEUL;Lo;0;L;;;;;N;;;;; 111A;HANGUL CHOSEONG RIEUL-HIEUH;Lo;0;L;;;;;N;;;;; 111B;HANGUL CHOSEONG KAPYEOUNRIEUL;Lo;0;L;;;;;N;;;;; 111C;HANGUL CHOSEONG MIEUM-PIEUP;Lo;0;L;;;;;N;;;;; 111D;HANGUL CHOSEONG KAPYEOUNMIEUM;Lo;0;L;;;;;N;;;;; 111E;HANGUL CHOSEONG PIEUP-KIYEOK;Lo;0;L;;;;;N;;;;; 111F;HANGUL CHOSEONG PIEUP-NIEUN;Lo;0;L;;;;;N;;;;; 1120;HANGUL CHOSEONG PIEUP-TIKEUT;Lo;0;L;;;;;N;;;;; 1121;HANGUL CHOSEONG PIEUP-SIOS;Lo;0;L;;;;;N;;;;; 1122;HANGUL CHOSEONG PIEUP-SIOS-KIYEOK;Lo;0;L;;;;;N;;;;; 1123;HANGUL CHOSEONG PIEUP-SIOS-TIKEUT;Lo;0;L;;;;;N;;;;; 1124;HANGUL CHOSEONG PIEUP-SIOS-PIEUP;Lo;0;L;;;;;N;;;;; 1125;HANGUL CHOSEONG PIEUP-SSANGSIOS;Lo;0;L;;;;;N;;;;; 1126;HANGUL CHOSEONG PIEUP-SIOS-CIEUC;Lo;0;L;;;;;N;;;;; 1127;HANGUL CHOSEONG PIEUP-CIEUC;Lo;0;L;;;;;N;;;;; 1128;HANGUL CHOSEONG PIEUP-CHIEUCH;Lo;0;L;;;;;N;;;;; 1129;HANGUL CHOSEONG PIEUP-THIEUTH;Lo;0;L;;;;;N;;;;; 112A;HANGUL CHOSEONG PIEUP-PHIEUPH;Lo;0;L;;;;;N;;;;; 112B;HANGUL CHOSEONG KAPYEOUNPIEUP;Lo;0;L;;;;;N;;;;; 112C;HANGUL CHOSEONG KAPYEOUNSSANGPIEUP;Lo;0;L;;;;;N;;;;; 112D;HANGUL CHOSEONG SIOS-KIYEOK;Lo;0;L;;;;;N;;;;; 112E;HANGUL CHOSEONG SIOS-NIEUN;Lo;0;L;;;;;N;;;;; 112F;HANGUL CHOSEONG SIOS-TIKEUT;Lo;0;L;;;;;N;;;;; 1130;HANGUL CHOSEONG SIOS-RIEUL;Lo;0;L;;;;;N;;;;; 1131;HANGUL CHOSEONG SIOS-MIEUM;Lo;0;L;;;;;N;;;;; 1132;HANGUL CHOSEONG SIOS-PIEUP;Lo;0;L;;;;;N;;;;; 1133;HANGUL CHOSEONG SIOS-PIEUP-KIYEOK;Lo;0;L;;;;;N;;;;; 1134;HANGUL CHOSEONG SIOS-SSANGSIOS;Lo;0;L;;;;;N;;;;; 1135;HANGUL CHOSEONG SIOS-IEUNG;Lo;0;L;;;;;N;;;;; 1136;HANGUL CHOSEONG SIOS-CIEUC;Lo;0;L;;;;;N;;;;; 1137;HANGUL CHOSEONG SIOS-CHIEUCH;Lo;0;L;;;;;N;;;;; 1138;HANGUL CHOSEONG SIOS-KHIEUKH;Lo;0;L;;;;;N;;;;; 1139;HANGUL CHOSEONG SIOS-THIEUTH;Lo;0;L;;;;;N;;;;; 113A;HANGUL CHOSEONG SIOS-PHIEUPH;Lo;0;L;;;;;N;;;;; 113B;HANGUL CHOSEONG SIOS-HIEUH;Lo;0;L;;;;;N;;;;; 113C;HANGUL CHOSEONG CHITUEUMSIOS;Lo;0;L;;;;;N;;;;; 113D;HANGUL CHOSEONG CHITUEUMSSANGSIOS;Lo;0;L;;;;;N;;;;; 113E;HANGUL CHOSEONG CEONGCHIEUMSIOS;Lo;0;L;;;;;N;;;;; 113F;HANGUL CHOSEONG CEONGCHIEUMSSANGSIOS;Lo;0;L;;;;;N;;;;; 1140;HANGUL CHOSEONG PANSIOS;Lo;0;L;;;;;N;;;;; 1141;HANGUL CHOSEONG IEUNG-KIYEOK;Lo;0;L;;;;;N;;;;; 1142;HANGUL CHOSEONG IEUNG-TIKEUT;Lo;0;L;;;;;N;;;;; 1143;HANGUL CHOSEONG IEUNG-MIEUM;Lo;0;L;;;;;N;;;;; 1144;HANGUL CHOSEONG IEUNG-PIEUP;Lo;0;L;;;;;N;;;;; 1145;HANGUL CHOSEONG IEUNG-SIOS;Lo;0;L;;;;;N;;;;; 1146;HANGUL CHOSEONG IEUNG-PANSIOS;Lo;0;L;;;;;N;;;;; 1147;HANGUL CHOSEONG SSANGIEUNG;Lo;0;L;;;;;N;;;;; 1148;HANGUL CHOSEONG IEUNG-CIEUC;Lo;0;L;;;;;N;;;;; 1149;HANGUL CHOSEONG IEUNG-CHIEUCH;Lo;0;L;;;;;N;;;;; 114A;HANGUL CHOSEONG IEUNG-THIEUTH;Lo;0;L;;;;;N;;;;; 114B;HANGUL CHOSEONG IEUNG-PHIEUPH;Lo;0;L;;;;;N;;;;; 114C;HANGUL CHOSEONG YESIEUNG;Lo;0;L;;;;;N;;;;; 114D;HANGUL CHOSEONG CIEUC-IEUNG;Lo;0;L;;;;;N;;;;; 114E;HANGUL CHOSEONG CHITUEUMCIEUC;Lo;0;L;;;;;N;;;;; 114F;HANGUL CHOSEONG CHITUEUMSSANGCIEUC;Lo;0;L;;;;;N;;;;; 1150;HANGUL CHOSEONG CEONGCHIEUMCIEUC;Lo;0;L;;;;;N;;;;; 1151;HANGUL CHOSEONG CEONGCHIEUMSSANGCIEUC;Lo;0;L;;;;;N;;;;; 1152;HANGUL CHOSEONG CHIEUCH-KHIEUKH;Lo;0;L;;;;;N;;;;; 1153;HANGUL CHOSEONG CHIEUCH-HIEUH;Lo;0;L;;;;;N;;;;; 1154;HANGUL CHOSEONG CHITUEUMCHIEUCH;Lo;0;L;;;;;N;;;;; 1155;HANGUL CHOSEONG CEONGCHIEUMCHIEUCH;Lo;0;L;;;;;N;;;;; 1156;HANGUL CHOSEONG PHIEUPH-PIEUP;Lo;0;L;;;;;N;;;;; 1157;HANGUL CHOSEONG KAPYEOUNPHIEUPH;Lo;0;L;;;;;N;;;;; 1158;HANGUL CHOSEONG SSANGHIEUH;Lo;0;L;;;;;N;;;;; 1159;HANGUL CHOSEONG YEORINHIEUH;Lo;0;L;;;;;N;;;;; 115A;HANGUL CHOSEONG KIYEOK-TIKEUT;Lo;0;L;;;;;N;;;;; 115B;HANGUL CHOSEONG NIEUN-SIOS;Lo;0;L;;;;;N;;;;; 115C;HANGUL CHOSEONG NIEUN-CIEUC;Lo;0;L;;;;;N;;;;; 115D;HANGUL CHOSEONG NIEUN-HIEUH;Lo;0;L;;;;;N;;;;; 115E;HANGUL CHOSEONG TIKEUT-RIEUL;Lo;0;L;;;;;N;;;;; 115F;HANGUL CHOSEONG FILLER;Lo;0;L;;;;;N;;;;; 1160;HANGUL JUNGSEONG FILLER;Lo;0;L;;;;;N;;;;; 1161;HANGUL JUNGSEONG A;Lo;0;L;;;;;N;;;;; 1162;HANGUL JUNGSEONG AE;Lo;0;L;;;;;N;;;;; 1163;HANGUL JUNGSEONG YA;Lo;0;L;;;;;N;;;;; 1164;HANGUL JUNGSEONG YAE;Lo;0;L;;;;;N;;;;; 1165;HANGUL JUNGSEONG EO;Lo;0;L;;;;;N;;;;; 1166;HANGUL JUNGSEONG E;Lo;0;L;;;;;N;;;;; 1167;HANGUL JUNGSEONG YEO;Lo;0;L;;;;;N;;;;; 1168;HANGUL JUNGSEONG YE;Lo;0;L;;;;;N;;;;; 1169;HANGUL JUNGSEONG O;Lo;0;L;;;;;N;;;;; 116A;HANGUL JUNGSEONG WA;Lo;0;L;;;;;N;;;;; 116B;HANGUL JUNGSEONG WAE;Lo;0;L;;;;;N;;;;; 116C;HANGUL JUNGSEONG OE;Lo;0;L;;;;;N;;;;; 116D;HANGUL JUNGSEONG YO;Lo;0;L;;;;;N;;;;; 116E;HANGUL JUNGSEONG U;Lo;0;L;;;;;N;;;;; 116F;HANGUL JUNGSEONG WEO;Lo;0;L;;;;;N;;;;; 1170;HANGUL JUNGSEONG WE;Lo;0;L;;;;;N;;;;; 1171;HANGUL JUNGSEONG WI;Lo;0;L;;;;;N;;;;; 1172;HANGUL JUNGSEONG YU;Lo;0;L;;;;;N;;;;; 1173;HANGUL JUNGSEONG EU;Lo;0;L;;;;;N;;;;; 1174;HANGUL JUNGSEONG YI;Lo;0;L;;;;;N;;;;; 1175;HANGUL JUNGSEONG I;Lo;0;L;;;;;N;;;;; 1176;HANGUL JUNGSEONG A-O;Lo;0;L;;;;;N;;;;; 1177;HANGUL JUNGSEONG A-U;Lo;0;L;;;;;N;;;;; 1178;HANGUL JUNGSEONG YA-O;Lo;0;L;;;;;N;;;;; 1179;HANGUL JUNGSEONG YA-YO;Lo;0;L;;;;;N;;;;; 117A;HANGUL JUNGSEONG EO-O;Lo;0;L;;;;;N;;;;; 117B;HANGUL JUNGSEONG EO-U;Lo;0;L;;;;;N;;;;; 117C;HANGUL JUNGSEONG EO-EU;Lo;0;L;;;;;N;;;;; 117D;HANGUL JUNGSEONG YEO-O;Lo;0;L;;;;;N;;;;; 117E;HANGUL JUNGSEONG YEO-U;Lo;0;L;;;;;N;;;;; 117F;HANGUL JUNGSEONG O-EO;Lo;0;L;;;;;N;;;;; 1180;HANGUL JUNGSEONG O-E;Lo;0;L;;;;;N;;;;; 1181;HANGUL JUNGSEONG O-YE;Lo;0;L;;;;;N;;;;; 1182;HANGUL JUNGSEONG O-O;Lo;0;L;;;;;N;;;;; 1183;HANGUL JUNGSEONG O-U;Lo;0;L;;;;;N;;;;; 1184;HANGUL JUNGSEONG YO-YA;Lo;0;L;;;;;N;;;;; 1185;HANGUL JUNGSEONG YO-YAE;Lo;0;L;;;;;N;;;;; 1186;HANGUL JUNGSEONG YO-YEO;Lo;0;L;;;;;N;;;;; 1187;HANGUL JUNGSEONG YO-O;Lo;0;L;;;;;N;;;;; 1188;HANGUL JUNGSEONG YO-I;Lo;0;L;;;;;N;;;;; 1189;HANGUL JUNGSEONG U-A;Lo;0;L;;;;;N;;;;; 118A;HANGUL JUNGSEONG U-AE;Lo;0;L;;;;;N;;;;; 118B;HANGUL JUNGSEONG U-EO-EU;Lo;0;L;;;;;N;;;;; 118C;HANGUL JUNGSEONG U-YE;Lo;0;L;;;;;N;;;;; 118D;HANGUL JUNGSEONG U-U;Lo;0;L;;;;;N;;;;; 118E;HANGUL JUNGSEONG YU-A;Lo;0;L;;;;;N;;;;; 118F;HANGUL JUNGSEONG YU-EO;Lo;0;L;;;;;N;;;;; 1190;HANGUL JUNGSEONG YU-E;Lo;0;L;;;;;N;;;;; 1191;HANGUL JUNGSEONG YU-YEO;Lo;0;L;;;;;N;;;;; 1192;HANGUL JUNGSEONG YU-YE;Lo;0;L;;;;;N;;;;; 1193;HANGUL JUNGSEONG YU-U;Lo;0;L;;;;;N;;;;; 1194;HANGUL JUNGSEONG YU-I;Lo;0;L;;;;;N;;;;; 1195;HANGUL JUNGSEONG EU-U;Lo;0;L;;;;;N;;;;; 1196;HANGUL JUNGSEONG EU-EU;Lo;0;L;;;;;N;;;;; 1197;HANGUL JUNGSEONG YI-U;Lo;0;L;;;;;N;;;;; 1198;HANGUL JUNGSEONG I-A;Lo;0;L;;;;;N;;;;; 1199;HANGUL JUNGSEONG I-YA;Lo;0;L;;;;;N;;;;; 119A;HANGUL JUNGSEONG I-O;Lo;0;L;;;;;N;;;;; 119B;HANGUL JUNGSEONG I-U;Lo;0;L;;;;;N;;;;; 119C;HANGUL JUNGSEONG I-EU;Lo;0;L;;;;;N;;;;; 119D;HANGUL JUNGSEONG I-ARAEA;Lo;0;L;;;;;N;;;;; 119E;HANGUL JUNGSEONG ARAEA;Lo;0;L;;;;;N;;;;; 119F;HANGUL JUNGSEONG ARAEA-EO;Lo;0;L;;;;;N;;;;; 11A0;HANGUL JUNGSEONG ARAEA-U;Lo;0;L;;;;;N;;;;; 11A1;HANGUL JUNGSEONG ARAEA-I;Lo;0;L;;;;;N;;;;; 11A2;HANGUL JUNGSEONG SSANGARAEA;Lo;0;L;;;;;N;;;;; 11A3;HANGUL JUNGSEONG A-EU;Lo;0;L;;;;;N;;;;; 11A4;HANGUL JUNGSEONG YA-U;Lo;0;L;;;;;N;;;;; 11A5;HANGUL JUNGSEONG YEO-YA;Lo;0;L;;;;;N;;;;; 11A6;HANGUL JUNGSEONG O-YA;Lo;0;L;;;;;N;;;;; 11A7;HANGUL JUNGSEONG O-YAE;Lo;0;L;;;;;N;;;;; 11A8;HANGUL JONGSEONG KIYEOK;Lo;0;L;;;;;N;;;;; 11A9;HANGUL JONGSEONG SSANGKIYEOK;Lo;0;L;;;;;N;;;;; 11AA;HANGUL JONGSEONG KIYEOK-SIOS;Lo;0;L;;;;;N;;;;; 11AB;HANGUL JONGSEONG NIEUN;Lo;0;L;;;;;N;;;;; 11AC;HANGUL JONGSEONG NIEUN-CIEUC;Lo;0;L;;;;;N;;;;; 11AD;HANGUL JONGSEONG NIEUN-HIEUH;Lo;0;L;;;;;N;;;;; 11AE;HANGUL JONGSEONG TIKEUT;Lo;0;L;;;;;N;;;;; 11AF;HANGUL JONGSEONG RIEUL;Lo;0;L;;;;;N;;;;; 11B0;HANGUL JONGSEONG RIEUL-KIYEOK;Lo;0;L;;;;;N;;;;; 11B1;HANGUL JONGSEONG RIEUL-MIEUM;Lo;0;L;;;;;N;;;;; 11B2;HANGUL JONGSEONG RIEUL-PIEUP;Lo;0;L;;;;;N;;;;; 11B3;HANGUL JONGSEONG RIEUL-SIOS;Lo;0;L;;;;;N;;;;; 11B4;HANGUL JONGSEONG RIEUL-THIEUTH;Lo;0;L;;;;;N;;;;; 11B5;HANGUL JONGSEONG RIEUL-PHIEUPH;Lo;0;L;;;;;N;;;;; 11B6;HANGUL JONGSEONG RIEUL-HIEUH;Lo;0;L;;;;;N;;;;; 11B7;HANGUL JONGSEONG MIEUM;Lo;0;L;;;;;N;;;;; 11B8;HANGUL JONGSEONG PIEUP;Lo;0;L;;;;;N;;;;; 11B9;HANGUL JONGSEONG PIEUP-SIOS;Lo;0;L;;;;;N;;;;; 11BA;HANGUL JONGSEONG SIOS;Lo;0;L;;;;;N;;;;; 11BB;HANGUL JONGSEONG SSANGSIOS;Lo;0;L;;;;;N;;;;; 11BC;HANGUL JONGSEONG IEUNG;Lo;0;L;;;;;N;;;;; 11BD;HANGUL JONGSEONG CIEUC;Lo;0;L;;;;;N;;;;; 11BE;HANGUL JONGSEONG CHIEUCH;Lo;0;L;;;;;N;;;;; 11BF;HANGUL JONGSEONG KHIEUKH;Lo;0;L;;;;;N;;;;; 11C0;HANGUL JONGSEONG THIEUTH;Lo;0;L;;;;;N;;;;; 11C1;HANGUL JONGSEONG PHIEUPH;Lo;0;L;;;;;N;;;;; 11C2;HANGUL JONGSEONG HIEUH;Lo;0;L;;;;;N;;;;; 11C3;HANGUL JONGSEONG KIYEOK-RIEUL;Lo;0;L;;;;;N;;;;; 11C4;HANGUL JONGSEONG KIYEOK-SIOS-KIYEOK;Lo;0;L;;;;;N;;;;; 11C5;HANGUL JONGSEONG NIEUN-KIYEOK;Lo;0;L;;;;;N;;;;; 11C6;HANGUL JONGSEONG NIEUN-TIKEUT;Lo;0;L;;;;;N;;;;; 11C7;HANGUL JONGSEONG NIEUN-SIOS;Lo;0;L;;;;;N;;;;; 11C8;HANGUL JONGSEONG NIEUN-PANSIOS;Lo;0;L;;;;;N;;;;; 11C9;HANGUL JONGSEONG NIEUN-THIEUTH;Lo;0;L;;;;;N;;;;; 11CA;HANGUL JONGSEONG TIKEUT-KIYEOK;Lo;0;L;;;;;N;;;;; 11CB;HANGUL JONGSEONG TIKEUT-RIEUL;Lo;0;L;;;;;N;;;;; 11CC;HANGUL JONGSEONG RIEUL-KIYEOK-SIOS;Lo;0;L;;;;;N;;;;; 11CD;HANGUL JONGSEONG RIEUL-NIEUN;Lo;0;L;;;;;N;;;;; 11CE;HANGUL JONGSEONG RIEUL-TIKEUT;Lo;0;L;;;;;N;;;;; 11CF;HANGUL JONGSEONG RIEUL-TIKEUT-HIEUH;Lo;0;L;;;;;N;;;;; 11D0;HANGUL JONGSEONG SSANGRIEUL;Lo;0;L;;;;;N;;;;; 11D1;HANGUL JONGSEONG RIEUL-MIEUM-KIYEOK;Lo;0;L;;;;;N;;;;; 11D2;HANGUL JONGSEONG RIEUL-MIEUM-SIOS;Lo;0;L;;;;;N;;;;; 11D3;HANGUL JONGSEONG RIEUL-PIEUP-SIOS;Lo;0;L;;;;;N;;;;; 11D4;HANGUL JONGSEONG RIEUL-PIEUP-HIEUH;Lo;0;L;;;;;N;;;;; 11D5;HANGUL JONGSEONG RIEUL-KAPYEOUNPIEUP;Lo;0;L;;;;;N;;;;; 11D6;HANGUL JONGSEONG RIEUL-SSANGSIOS;Lo;0;L;;;;;N;;;;; 11D7;HANGUL JONGSEONG RIEUL-PANSIOS;Lo;0;L;;;;;N;;;;; 11D8;HANGUL JONGSEONG RIEUL-KHIEUKH;Lo;0;L;;;;;N;;;;; 11D9;HANGUL JONGSEONG RIEUL-YEORINHIEUH;Lo;0;L;;;;;N;;;;; 11DA;HANGUL JONGSEONG MIEUM-KIYEOK;Lo;0;L;;;;;N;;;;; 11DB;HANGUL JONGSEONG MIEUM-RIEUL;Lo;0;L;;;;;N;;;;; 11DC;HANGUL JONGSEONG MIEUM-PIEUP;Lo;0;L;;;;;N;;;;; 11DD;HANGUL JONGSEONG MIEUM-SIOS;Lo;0;L;;;;;N;;;;; 11DE;HANGUL JONGSEONG MIEUM-SSANGSIOS;Lo;0;L;;;;;N;;;;; 11DF;HANGUL JONGSEONG MIEUM-PANSIOS;Lo;0;L;;;;;N;;;;; 11E0;HANGUL JONGSEONG MIEUM-CHIEUCH;Lo;0;L;;;;;N;;;;; 11E1;HANGUL JONGSEONG MIEUM-HIEUH;Lo;0;L;;;;;N;;;;; 11E2;HANGUL JONGSEONG KAPYEOUNMIEUM;Lo;0;L;;;;;N;;;;; 11E3;HANGUL JONGSEONG PIEUP-RIEUL;Lo;0;L;;;;;N;;;;; 11E4;HANGUL JONGSEONG PIEUP-PHIEUPH;Lo;0;L;;;;;N;;;;; 11E5;HANGUL JONGSEONG PIEUP-HIEUH;Lo;0;L;;;;;N;;;;; 11E6;HANGUL JONGSEONG KAPYEOUNPIEUP;Lo;0;L;;;;;N;;;;; 11E7;HANGUL JONGSEONG SIOS-KIYEOK;Lo;0;L;;;;;N;;;;; 11E8;HANGUL JONGSEONG SIOS-TIKEUT;Lo;0;L;;;;;N;;;;; 11E9;HANGUL JONGSEONG SIOS-RIEUL;Lo;0;L;;;;;N;;;;; 11EA;HANGUL JONGSEONG SIOS-PIEUP;Lo;0;L;;;;;N;;;;; 11EB;HANGUL JONGSEONG PANSIOS;Lo;0;L;;;;;N;;;;; 11EC;HANGUL JONGSEONG IEUNG-KIYEOK;Lo;0;L;;;;;N;;;;; 11ED;HANGUL JONGSEONG IEUNG-SSANGKIYEOK;Lo;0;L;;;;;N;;;;; 11EE;HANGUL JONGSEONG SSANGIEUNG;Lo;0;L;;;;;N;;;;; 11EF;HANGUL JONGSEONG IEUNG-KHIEUKH;Lo;0;L;;;;;N;;;;; 11F0;HANGUL JONGSEONG YESIEUNG;Lo;0;L;;;;;N;;;;; 11F1;HANGUL JONGSEONG YESIEUNG-SIOS;Lo;0;L;;;;;N;;;;; 11F2;HANGUL JONGSEONG YESIEUNG-PANSIOS;Lo;0;L;;;;;N;;;;; 11F3;HANGUL JONGSEONG PHIEUPH-PIEUP;Lo;0;L;;;;;N;;;;; 11F4;HANGUL JONGSEONG KAPYEOUNPHIEUPH;Lo;0;L;;;;;N;;;;; 11F5;HANGUL JONGSEONG HIEUH-NIEUN;Lo;0;L;;;;;N;;;;; 11F6;HANGUL JONGSEONG HIEUH-RIEUL;Lo;0;L;;;;;N;;;;; 11F7;HANGUL JONGSEONG HIEUH-MIEUM;Lo;0;L;;;;;N;;;;; 11F8;HANGUL JONGSEONG HIEUH-PIEUP;Lo;0;L;;;;;N;;;;; 11F9;HANGUL JONGSEONG YEORINHIEUH;Lo;0;L;;;;;N;;;;; 11FA;HANGUL JONGSEONG KIYEOK-NIEUN;Lo;0;L;;;;;N;;;;; 11FB;HANGUL JONGSEONG KIYEOK-PIEUP;Lo;0;L;;;;;N;;;;; 11FC;HANGUL JONGSEONG KIYEOK-CHIEUCH;Lo;0;L;;;;;N;;;;; 11FD;HANGUL JONGSEONG KIYEOK-KHIEUKH;Lo;0;L;;;;;N;;;;; 11FE;HANGUL JONGSEONG KIYEOK-HIEUH;Lo;0;L;;;;;N;;;;; 11FF;HANGUL JONGSEONG SSANGNIEUN;Lo;0;L;;;;;N;;;;; 1200;ETHIOPIC SYLLABLE HA;Lo;0;L;;;;;N;;;;; 1201;ETHIOPIC SYLLABLE HU;Lo;0;L;;;;;N;;;;; 1202;ETHIOPIC SYLLABLE HI;Lo;0;L;;;;;N;;;;; 1203;ETHIOPIC SYLLABLE HAA;Lo;0;L;;;;;N;;;;; 1204;ETHIOPIC SYLLABLE HEE;Lo;0;L;;;;;N;;;;; 1205;ETHIOPIC SYLLABLE HE;Lo;0;L;;;;;N;;;;; 1206;ETHIOPIC SYLLABLE HO;Lo;0;L;;;;;N;;;;; 1207;ETHIOPIC SYLLABLE HOA;Lo;0;L;;;;;N;;;;; 1208;ETHIOPIC SYLLABLE LA;Lo;0;L;;;;;N;;;;; 1209;ETHIOPIC SYLLABLE LU;Lo;0;L;;;;;N;;;;; 120A;ETHIOPIC SYLLABLE LI;Lo;0;L;;;;;N;;;;; 120B;ETHIOPIC SYLLABLE LAA;Lo;0;L;;;;;N;;;;; 120C;ETHIOPIC SYLLABLE LEE;Lo;0;L;;;;;N;;;;; 120D;ETHIOPIC SYLLABLE LE;Lo;0;L;;;;;N;;;;; 120E;ETHIOPIC SYLLABLE LO;Lo;0;L;;;;;N;;;;; 120F;ETHIOPIC SYLLABLE LWA;Lo;0;L;;;;;N;;;;; 1210;ETHIOPIC SYLLABLE HHA;Lo;0;L;;;;;N;;;;; 1211;ETHIOPIC SYLLABLE HHU;Lo;0;L;;;;;N;;;;; 1212;ETHIOPIC SYLLABLE HHI;Lo;0;L;;;;;N;;;;; 1213;ETHIOPIC SYLLABLE HHAA;Lo;0;L;;;;;N;;;;; 1214;ETHIOPIC SYLLABLE HHEE;Lo;0;L;;;;;N;;;;; 1215;ETHIOPIC SYLLABLE HHE;Lo;0;L;;;;;N;;;;; 1216;ETHIOPIC SYLLABLE HHO;Lo;0;L;;;;;N;;;;; 1217;ETHIOPIC SYLLABLE HHWA;Lo;0;L;;;;;N;;;;; 1218;ETHIOPIC SYLLABLE MA;Lo;0;L;;;;;N;;;;; 1219;ETHIOPIC SYLLABLE MU;Lo;0;L;;;;;N;;;;; 121A;ETHIOPIC SYLLABLE MI;Lo;0;L;;;;;N;;;;; 121B;ETHIOPIC SYLLABLE MAA;Lo;0;L;;;;;N;;;;; 121C;ETHIOPIC SYLLABLE MEE;Lo;0;L;;;;;N;;;;; 121D;ETHIOPIC SYLLABLE ME;Lo;0;L;;;;;N;;;;; 121E;ETHIOPIC SYLLABLE MO;Lo;0;L;;;;;N;;;;; 121F;ETHIOPIC SYLLABLE MWA;Lo;0;L;;;;;N;;;;; 1220;ETHIOPIC SYLLABLE SZA;Lo;0;L;;;;;N;;;;; 1221;ETHIOPIC SYLLABLE SZU;Lo;0;L;;;;;N;;;;; 1222;ETHIOPIC SYLLABLE SZI;Lo;0;L;;;;;N;;;;; 1223;ETHIOPIC SYLLABLE SZAA;Lo;0;L;;;;;N;;;;; 1224;ETHIOPIC SYLLABLE SZEE;Lo;0;L;;;;;N;;;;; 1225;ETHIOPIC SYLLABLE SZE;Lo;0;L;;;;;N;;;;; 1226;ETHIOPIC SYLLABLE SZO;Lo;0;L;;;;;N;;;;; 1227;ETHIOPIC SYLLABLE SZWA;Lo;0;L;;;;;N;;;;; 1228;ETHIOPIC SYLLABLE RA;Lo;0;L;;;;;N;;;;; 1229;ETHIOPIC SYLLABLE RU;Lo;0;L;;;;;N;;;;; 122A;ETHIOPIC SYLLABLE RI;Lo;0;L;;;;;N;;;;; 122B;ETHIOPIC SYLLABLE RAA;Lo;0;L;;;;;N;;;;; 122C;ETHIOPIC SYLLABLE REE;Lo;0;L;;;;;N;;;;; 122D;ETHIOPIC SYLLABLE RE;Lo;0;L;;;;;N;;;;; 122E;ETHIOPIC SYLLABLE RO;Lo;0;L;;;;;N;;;;; 122F;ETHIOPIC SYLLABLE RWA;Lo;0;L;;;;;N;;;;; 1230;ETHIOPIC SYLLABLE SA;Lo;0;L;;;;;N;;;;; 1231;ETHIOPIC SYLLABLE SU;Lo;0;L;;;;;N;;;;; 1232;ETHIOPIC SYLLABLE SI;Lo;0;L;;;;;N;;;;; 1233;ETHIOPIC SYLLABLE SAA;Lo;0;L;;;;;N;;;;; 1234;ETHIOPIC SYLLABLE SEE;Lo;0;L;;;;;N;;;;; 1235;ETHIOPIC SYLLABLE SE;Lo;0;L;;;;;N;;;;; 1236;ETHIOPIC SYLLABLE SO;Lo;0;L;;;;;N;;;;; 1237;ETHIOPIC SYLLABLE SWA;Lo;0;L;;;;;N;;;;; 1238;ETHIOPIC SYLLABLE SHA;Lo;0;L;;;;;N;;;;; 1239;ETHIOPIC SYLLABLE SHU;Lo;0;L;;;;;N;;;;; 123A;ETHIOPIC SYLLABLE SHI;Lo;0;L;;;;;N;;;;; 123B;ETHIOPIC SYLLABLE SHAA;Lo;0;L;;;;;N;;;;; 123C;ETHIOPIC SYLLABLE SHEE;Lo;0;L;;;;;N;;;;; 123D;ETHIOPIC SYLLABLE SHE;Lo;0;L;;;;;N;;;;; 123E;ETHIOPIC SYLLABLE SHO;Lo;0;L;;;;;N;;;;; 123F;ETHIOPIC SYLLABLE SHWA;Lo;0;L;;;;;N;;;;; 1240;ETHIOPIC SYLLABLE QA;Lo;0;L;;;;;N;;;;; 1241;ETHIOPIC SYLLABLE QU;Lo;0;L;;;;;N;;;;; 1242;ETHIOPIC SYLLABLE QI;Lo;0;L;;;;;N;;;;; 1243;ETHIOPIC SYLLABLE QAA;Lo;0;L;;;;;N;;;;; 1244;ETHIOPIC SYLLABLE QEE;Lo;0;L;;;;;N;;;;; 1245;ETHIOPIC SYLLABLE QE;Lo;0;L;;;;;N;;;;; 1246;ETHIOPIC SYLLABLE QO;Lo;0;L;;;;;N;;;;; 1247;ETHIOPIC SYLLABLE QOA;Lo;0;L;;;;;N;;;;; 1248;ETHIOPIC SYLLABLE QWA;Lo;0;L;;;;;N;;;;; 124A;ETHIOPIC SYLLABLE QWI;Lo;0;L;;;;;N;;;;; 124B;ETHIOPIC SYLLABLE QWAA;Lo;0;L;;;;;N;;;;; 124C;ETHIOPIC SYLLABLE QWEE;Lo;0;L;;;;;N;;;;; 124D;ETHIOPIC SYLLABLE QWE;Lo;0;L;;;;;N;;;;; 1250;ETHIOPIC SYLLABLE QHA;Lo;0;L;;;;;N;;;;; 1251;ETHIOPIC SYLLABLE QHU;Lo;0;L;;;;;N;;;;; 1252;ETHIOPIC SYLLABLE QHI;Lo;0;L;;;;;N;;;;; 1253;ETHIOPIC SYLLABLE QHAA;Lo;0;L;;;;;N;;;;; 1254;ETHIOPIC SYLLABLE QHEE;Lo;0;L;;;;;N;;;;; 1255;ETHIOPIC SYLLABLE QHE;Lo;0;L;;;;;N;;;;; 1256;ETHIOPIC SYLLABLE QHO;Lo;0;L;;;;;N;;;;; 1258;ETHIOPIC SYLLABLE QHWA;Lo;0;L;;;;;N;;;;; 125A;ETHIOPIC SYLLABLE QHWI;Lo;0;L;;;;;N;;;;; 125B;ETHIOPIC SYLLABLE QHWAA;Lo;0;L;;;;;N;;;;; 125C;ETHIOPIC SYLLABLE QHWEE;Lo;0;L;;;;;N;;;;; 125D;ETHIOPIC SYLLABLE QHWE;Lo;0;L;;;;;N;;;;; 1260;ETHIOPIC SYLLABLE BA;Lo;0;L;;;;;N;;;;; 1261;ETHIOPIC SYLLABLE BU;Lo;0;L;;;;;N;;;;; 1262;ETHIOPIC SYLLABLE BI;Lo;0;L;;;;;N;;;;; 1263;ETHIOPIC SYLLABLE BAA;Lo;0;L;;;;;N;;;;; 1264;ETHIOPIC SYLLABLE BEE;Lo;0;L;;;;;N;;;;; 1265;ETHIOPIC SYLLABLE BE;Lo;0;L;;;;;N;;;;; 1266;ETHIOPIC SYLLABLE BO;Lo;0;L;;;;;N;;;;; 1267;ETHIOPIC SYLLABLE BWA;Lo;0;L;;;;;N;;;;; 1268;ETHIOPIC SYLLABLE VA;Lo;0;L;;;;;N;;;;; 1269;ETHIOPIC SYLLABLE VU;Lo;0;L;;;;;N;;;;; 126A;ETHIOPIC SYLLABLE VI;Lo;0;L;;;;;N;;;;; 126B;ETHIOPIC SYLLABLE VAA;Lo;0;L;;;;;N;;;;; 126C;ETHIOPIC SYLLABLE VEE;Lo;0;L;;;;;N;;;;; 126D;ETHIOPIC SYLLABLE VE;Lo;0;L;;;;;N;;;;; 126E;ETHIOPIC SYLLABLE VO;Lo;0;L;;;;;N;;;;; 126F;ETHIOPIC SYLLABLE VWA;Lo;0;L;;;;;N;;;;; 1270;ETHIOPIC SYLLABLE TA;Lo;0;L;;;;;N;;;;; 1271;ETHIOPIC SYLLABLE TU;Lo;0;L;;;;;N;;;;; 1272;ETHIOPIC SYLLABLE TI;Lo;0;L;;;;;N;;;;; 1273;ETHIOPIC SYLLABLE TAA;Lo;0;L;;;;;N;;;;; 1274;ETHIOPIC SYLLABLE TEE;Lo;0;L;;;;;N;;;;; 1275;ETHIOPIC SYLLABLE TE;Lo;0;L;;;;;N;;;;; 1276;ETHIOPIC SYLLABLE TO;Lo;0;L;;;;;N;;;;; 1277;ETHIOPIC SYLLABLE TWA;Lo;0;L;;;;;N;;;;; 1278;ETHIOPIC SYLLABLE CA;Lo;0;L;;;;;N;;;;; 1279;ETHIOPIC SYLLABLE CU;Lo;0;L;;;;;N;;;;; 127A;ETHIOPIC SYLLABLE CI;Lo;0;L;;;;;N;;;;; 127B;ETHIOPIC SYLLABLE CAA;Lo;0;L;;;;;N;;;;; 127C;ETHIOPIC SYLLABLE CEE;Lo;0;L;;;;;N;;;;; 127D;ETHIOPIC SYLLABLE CE;Lo;0;L;;;;;N;;;;; 127E;ETHIOPIC SYLLABLE CO;Lo;0;L;;;;;N;;;;; 127F;ETHIOPIC SYLLABLE CWA;Lo;0;L;;;;;N;;;;; 1280;ETHIOPIC SYLLABLE XA;Lo;0;L;;;;;N;;;;; 1281;ETHIOPIC SYLLABLE XU;Lo;0;L;;;;;N;;;;; 1282;ETHIOPIC SYLLABLE XI;Lo;0;L;;;;;N;;;;; 1283;ETHIOPIC SYLLABLE XAA;Lo;0;L;;;;;N;;;;; 1284;ETHIOPIC SYLLABLE XEE;Lo;0;L;;;;;N;;;;; 1285;ETHIOPIC SYLLABLE XE;Lo;0;L;;;;;N;;;;; 1286;ETHIOPIC SYLLABLE XO;Lo;0;L;;;;;N;;;;; 1287;ETHIOPIC SYLLABLE XOA;Lo;0;L;;;;;N;;;;; 1288;ETHIOPIC SYLLABLE XWA;Lo;0;L;;;;;N;;;;; 128A;ETHIOPIC SYLLABLE XWI;Lo;0;L;;;;;N;;;;; 128B;ETHIOPIC SYLLABLE XWAA;Lo;0;L;;;;;N;;;;; 128C;ETHIOPIC SYLLABLE XWEE;Lo;0;L;;;;;N;;;;; 128D;ETHIOPIC SYLLABLE XWE;Lo;0;L;;;;;N;;;;; 1290;ETHIOPIC SYLLABLE NA;Lo;0;L;;;;;N;;;;; 1291;ETHIOPIC SYLLABLE NU;Lo;0;L;;;;;N;;;;; 1292;ETHIOPIC SYLLABLE NI;Lo;0;L;;;;;N;;;;; 1293;ETHIOPIC SYLLABLE NAA;Lo;0;L;;;;;N;;;;; 1294;ETHIOPIC SYLLABLE NEE;Lo;0;L;;;;;N;;;;; 1295;ETHIOPIC SYLLABLE NE;Lo;0;L;;;;;N;;;;; 1296;ETHIOPIC SYLLABLE NO;Lo;0;L;;;;;N;;;;; 1297;ETHIOPIC SYLLABLE NWA;Lo;0;L;;;;;N;;;;; 1298;ETHIOPIC SYLLABLE NYA;Lo;0;L;;;;;N;;;;; 1299;ETHIOPIC SYLLABLE NYU;Lo;0;L;;;;;N;;;;; 129A;ETHIOPIC SYLLABLE NYI;Lo;0;L;;;;;N;;;;; 129B;ETHIOPIC SYLLABLE NYAA;Lo;0;L;;;;;N;;;;; 129C;ETHIOPIC SYLLABLE NYEE;Lo;0;L;;;;;N;;;;; 129D;ETHIOPIC SYLLABLE NYE;Lo;0;L;;;;;N;;;;; 129E;ETHIOPIC SYLLABLE NYO;Lo;0;L;;;;;N;;;;; 129F;ETHIOPIC SYLLABLE NYWA;Lo;0;L;;;;;N;;;;; 12A0;ETHIOPIC SYLLABLE GLOTTAL A;Lo;0;L;;;;;N;;;;; 12A1;ETHIOPIC SYLLABLE GLOTTAL U;Lo;0;L;;;;;N;;;;; 12A2;ETHIOPIC SYLLABLE GLOTTAL I;Lo;0;L;;;;;N;;;;; 12A3;ETHIOPIC SYLLABLE GLOTTAL AA;Lo;0;L;;;;;N;;;;; 12A4;ETHIOPIC SYLLABLE GLOTTAL EE;Lo;0;L;;;;;N;;;;; 12A5;ETHIOPIC SYLLABLE GLOTTAL E;Lo;0;L;;;;;N;;;;; 12A6;ETHIOPIC SYLLABLE GLOTTAL O;Lo;0;L;;;;;N;;;;; 12A7;ETHIOPIC SYLLABLE GLOTTAL WA;Lo;0;L;;;;;N;;;;; 12A8;ETHIOPIC SYLLABLE KA;Lo;0;L;;;;;N;;;;; 12A9;ETHIOPIC SYLLABLE KU;Lo;0;L;;;;;N;;;;; 12AA;ETHIOPIC SYLLABLE KI;Lo;0;L;;;;;N;;;;; 12AB;ETHIOPIC SYLLABLE KAA;Lo;0;L;;;;;N;;;;; 12AC;ETHIOPIC SYLLABLE KEE;Lo;0;L;;;;;N;;;;; 12AD;ETHIOPIC SYLLABLE KE;Lo;0;L;;;;;N;;;;; 12AE;ETHIOPIC SYLLABLE KO;Lo;0;L;;;;;N;;;;; 12AF;ETHIOPIC SYLLABLE KOA;Lo;0;L;;;;;N;;;;; 12B0;ETHIOPIC SYLLABLE KWA;Lo;0;L;;;;;N;;;;; 12B2;ETHIOPIC SYLLABLE KWI;Lo;0;L;;;;;N;;;;; 12B3;ETHIOPIC SYLLABLE KWAA;Lo;0;L;;;;;N;;;;; 12B4;ETHIOPIC SYLLABLE KWEE;Lo;0;L;;;;;N;;;;; 12B5;ETHIOPIC SYLLABLE KWE;Lo;0;L;;;;;N;;;;; 12B8;ETHIOPIC SYLLABLE KXA;Lo;0;L;;;;;N;;;;; 12B9;ETHIOPIC SYLLABLE KXU;Lo;0;L;;;;;N;;;;; 12BA;ETHIOPIC SYLLABLE KXI;Lo;0;L;;;;;N;;;;; 12BB;ETHIOPIC SYLLABLE KXAA;Lo;0;L;;;;;N;;;;; 12BC;ETHIOPIC SYLLABLE KXEE;Lo;0;L;;;;;N;;;;; 12BD;ETHIOPIC SYLLABLE KXE;Lo;0;L;;;;;N;;;;; 12BE;ETHIOPIC SYLLABLE KXO;Lo;0;L;;;;;N;;;;; 12C0;ETHIOPIC SYLLABLE KXWA;Lo;0;L;;;;;N;;;;; 12C2;ETHIOPIC SYLLABLE KXWI;Lo;0;L;;;;;N;;;;; 12C3;ETHIOPIC SYLLABLE KXWAA;Lo;0;L;;;;;N;;;;; 12C4;ETHIOPIC SYLLABLE KXWEE;Lo;0;L;;;;;N;;;;; 12C5;ETHIOPIC SYLLABLE KXWE;Lo;0;L;;;;;N;;;;; 12C8;ETHIOPIC SYLLABLE WA;Lo;0;L;;;;;N;;;;; 12C9;ETHIOPIC SYLLABLE WU;Lo;0;L;;;;;N;;;;; 12CA;ETHIOPIC SYLLABLE WI;Lo;0;L;;;;;N;;;;; 12CB;ETHIOPIC SYLLABLE WAA;Lo;0;L;;;;;N;;;;; 12CC;ETHIOPIC SYLLABLE WEE;Lo;0;L;;;;;N;;;;; 12CD;ETHIOPIC SYLLABLE WE;Lo;0;L;;;;;N;;;;; 12CE;ETHIOPIC SYLLABLE WO;Lo;0;L;;;;;N;;;;; 12CF;ETHIOPIC SYLLABLE WOA;Lo;0;L;;;;;N;;;;; 12D0;ETHIOPIC SYLLABLE PHARYNGEAL A;Lo;0;L;;;;;N;;;;; 12D1;ETHIOPIC SYLLABLE PHARYNGEAL U;Lo;0;L;;;;;N;;;;; 12D2;ETHIOPIC SYLLABLE PHARYNGEAL I;Lo;0;L;;;;;N;;;;; 12D3;ETHIOPIC SYLLABLE PHARYNGEAL AA;Lo;0;L;;;;;N;;;;; 12D4;ETHIOPIC SYLLABLE PHARYNGEAL EE;Lo;0;L;;;;;N;;;;; 12D5;ETHIOPIC SYLLABLE PHARYNGEAL E;Lo;0;L;;;;;N;;;;; 12D6;ETHIOPIC SYLLABLE PHARYNGEAL O;Lo;0;L;;;;;N;;;;; 12D8;ETHIOPIC SYLLABLE ZA;Lo;0;L;;;;;N;;;;; 12D9;ETHIOPIC SYLLABLE ZU;Lo;0;L;;;;;N;;;;; 12DA;ETHIOPIC SYLLABLE ZI;Lo;0;L;;;;;N;;;;; 12DB;ETHIOPIC SYLLABLE ZAA;Lo;0;L;;;;;N;;;;; 12DC;ETHIOPIC SYLLABLE ZEE;Lo;0;L;;;;;N;;;;; 12DD;ETHIOPIC SYLLABLE ZE;Lo;0;L;;;;;N;;;;; 12DE;ETHIOPIC SYLLABLE ZO;Lo;0;L;;;;;N;;;;; 12DF;ETHIOPIC SYLLABLE ZWA;Lo;0;L;;;;;N;;;;; 12E0;ETHIOPIC SYLLABLE ZHA;Lo;0;L;;;;;N;;;;; 12E1;ETHIOPIC SYLLABLE ZHU;Lo;0;L;;;;;N;;;;; 12E2;ETHIOPIC SYLLABLE ZHI;Lo;0;L;;;;;N;;;;; 12E3;ETHIOPIC SYLLABLE ZHAA;Lo;0;L;;;;;N;;;;; 12E4;ETHIOPIC SYLLABLE ZHEE;Lo;0;L;;;;;N;;;;; 12E5;ETHIOPIC SYLLABLE ZHE;Lo;0;L;;;;;N;;;;; 12E6;ETHIOPIC SYLLABLE ZHO;Lo;0;L;;;;;N;;;;; 12E7;ETHIOPIC SYLLABLE ZHWA;Lo;0;L;;;;;N;;;;; 12E8;ETHIOPIC SYLLABLE YA;Lo;0;L;;;;;N;;;;; 12E9;ETHIOPIC SYLLABLE YU;Lo;0;L;;;;;N;;;;; 12EA;ETHIOPIC SYLLABLE YI;Lo;0;L;;;;;N;;;;; 12EB;ETHIOPIC SYLLABLE YAA;Lo;0;L;;;;;N;;;;; 12EC;ETHIOPIC SYLLABLE YEE;Lo;0;L;;;;;N;;;;; 12ED;ETHIOPIC SYLLABLE YE;Lo;0;L;;;;;N;;;;; 12EE;ETHIOPIC SYLLABLE YO;Lo;0;L;;;;;N;;;;; 12EF;ETHIOPIC SYLLABLE YOA;Lo;0;L;;;;;N;;;;; 12F0;ETHIOPIC SYLLABLE DA;Lo;0;L;;;;;N;;;;; 12F1;ETHIOPIC SYLLABLE DU;Lo;0;L;;;;;N;;;;; 12F2;ETHIOPIC SYLLABLE DI;Lo;0;L;;;;;N;;;;; 12F3;ETHIOPIC SYLLABLE DAA;Lo;0;L;;;;;N;;;;; 12F4;ETHIOPIC SYLLABLE DEE;Lo;0;L;;;;;N;;;;; 12F5;ETHIOPIC SYLLABLE DE;Lo;0;L;;;;;N;;;;; 12F6;ETHIOPIC SYLLABLE DO;Lo;0;L;;;;;N;;;;; 12F7;ETHIOPIC SYLLABLE DWA;Lo;0;L;;;;;N;;;;; 12F8;ETHIOPIC SYLLABLE DDA;Lo;0;L;;;;;N;;;;; 12F9;ETHIOPIC SYLLABLE DDU;Lo;0;L;;;;;N;;;;; 12FA;ETHIOPIC SYLLABLE DDI;Lo;0;L;;;;;N;;;;; 12FB;ETHIOPIC SYLLABLE DDAA;Lo;0;L;;;;;N;;;;; 12FC;ETHIOPIC SYLLABLE DDEE;Lo;0;L;;;;;N;;;;; 12FD;ETHIOPIC SYLLABLE DDE;Lo;0;L;;;;;N;;;;; 12FE;ETHIOPIC SYLLABLE DDO;Lo;0;L;;;;;N;;;;; 12FF;ETHIOPIC SYLLABLE DDWA;Lo;0;L;;;;;N;;;;; 1300;ETHIOPIC SYLLABLE JA;Lo;0;L;;;;;N;;;;; 1301;ETHIOPIC SYLLABLE JU;Lo;0;L;;;;;N;;;;; 1302;ETHIOPIC SYLLABLE JI;Lo;0;L;;;;;N;;;;; 1303;ETHIOPIC SYLLABLE JAA;Lo;0;L;;;;;N;;;;; 1304;ETHIOPIC SYLLABLE JEE;Lo;0;L;;;;;N;;;;; 1305;ETHIOPIC SYLLABLE JE;Lo;0;L;;;;;N;;;;; 1306;ETHIOPIC SYLLABLE JO;Lo;0;L;;;;;N;;;;; 1307;ETHIOPIC SYLLABLE JWA;Lo;0;L;;;;;N;;;;; 1308;ETHIOPIC SYLLABLE GA;Lo;0;L;;;;;N;;;;; 1309;ETHIOPIC SYLLABLE GU;Lo;0;L;;;;;N;;;;; 130A;ETHIOPIC SYLLABLE GI;Lo;0;L;;;;;N;;;;; 130B;ETHIOPIC SYLLABLE GAA;Lo;0;L;;;;;N;;;;; 130C;ETHIOPIC SYLLABLE GEE;Lo;0;L;;;;;N;;;;; 130D;ETHIOPIC SYLLABLE GE;Lo;0;L;;;;;N;;;;; 130E;ETHIOPIC SYLLABLE GO;Lo;0;L;;;;;N;;;;; 130F;ETHIOPIC SYLLABLE GOA;Lo;0;L;;;;;N;;;;; 1310;ETHIOPIC SYLLABLE GWA;Lo;0;L;;;;;N;;;;; 1312;ETHIOPIC SYLLABLE GWI;Lo;0;L;;;;;N;;;;; 1313;ETHIOPIC SYLLABLE GWAA;Lo;0;L;;;;;N;;;;; 1314;ETHIOPIC SYLLABLE GWEE;Lo;0;L;;;;;N;;;;; 1315;ETHIOPIC SYLLABLE GWE;Lo;0;L;;;;;N;;;;; 1318;ETHIOPIC SYLLABLE GGA;Lo;0;L;;;;;N;;;;; 1319;ETHIOPIC SYLLABLE GGU;Lo;0;L;;;;;N;;;;; 131A;ETHIOPIC SYLLABLE GGI;Lo;0;L;;;;;N;;;;; 131B;ETHIOPIC SYLLABLE GGAA;Lo;0;L;;;;;N;;;;; 131C;ETHIOPIC SYLLABLE GGEE;Lo;0;L;;;;;N;;;;; 131D;ETHIOPIC SYLLABLE GGE;Lo;0;L;;;;;N;;;;; 131E;ETHIOPIC SYLLABLE GGO;Lo;0;L;;;;;N;;;;; 131F;ETHIOPIC SYLLABLE GGWAA;Lo;0;L;;;;;N;;;;; 1320;ETHIOPIC SYLLABLE THA;Lo;0;L;;;;;N;;;;; 1321;ETHIOPIC SYLLABLE THU;Lo;0;L;;;;;N;;;;; 1322;ETHIOPIC SYLLABLE THI;Lo;0;L;;;;;N;;;;; 1323;ETHIOPIC SYLLABLE THAA;Lo;0;L;;;;;N;;;;; 1324;ETHIOPIC SYLLABLE THEE;Lo;0;L;;;;;N;;;;; 1325;ETHIOPIC SYLLABLE THE;Lo;0;L;;;;;N;;;;; 1326;ETHIOPIC SYLLABLE THO;Lo;0;L;;;;;N;;;;; 1327;ETHIOPIC SYLLABLE THWA;Lo;0;L;;;;;N;;;;; 1328;ETHIOPIC SYLLABLE CHA;Lo;0;L;;;;;N;;;;; 1329;ETHIOPIC SYLLABLE CHU;Lo;0;L;;;;;N;;;;; 132A;ETHIOPIC SYLLABLE CHI;Lo;0;L;;;;;N;;;;; 132B;ETHIOPIC SYLLABLE CHAA;Lo;0;L;;;;;N;;;;; 132C;ETHIOPIC SYLLABLE CHEE;Lo;0;L;;;;;N;;;;; 132D;ETHIOPIC SYLLABLE CHE;Lo;0;L;;;;;N;;;;; 132E;ETHIOPIC SYLLABLE CHO;Lo;0;L;;;;;N;;;;; 132F;ETHIOPIC SYLLABLE CHWA;Lo;0;L;;;;;N;;;;; 1330;ETHIOPIC SYLLABLE PHA;Lo;0;L;;;;;N;;;;; 1331;ETHIOPIC SYLLABLE PHU;Lo;0;L;;;;;N;;;;; 1332;ETHIOPIC SYLLABLE PHI;Lo;0;L;;;;;N;;;;; 1333;ETHIOPIC SYLLABLE PHAA;Lo;0;L;;;;;N;;;;; 1334;ETHIOPIC SYLLABLE PHEE;Lo;0;L;;;;;N;;;;; 1335;ETHIOPIC SYLLABLE PHE;Lo;0;L;;;;;N;;;;; 1336;ETHIOPIC SYLLABLE PHO;Lo;0;L;;;;;N;;;;; 1337;ETHIOPIC SYLLABLE PHWA;Lo;0;L;;;;;N;;;;; 1338;ETHIOPIC SYLLABLE TSA;Lo;0;L;;;;;N;;;;; 1339;ETHIOPIC SYLLABLE TSU;Lo;0;L;;;;;N;;;;; 133A;ETHIOPIC SYLLABLE TSI;Lo;0;L;;;;;N;;;;; 133B;ETHIOPIC SYLLABLE TSAA;Lo;0;L;;;;;N;;;;; 133C;ETHIOPIC SYLLABLE TSEE;Lo;0;L;;;;;N;;;;; 133D;ETHIOPIC SYLLABLE TSE;Lo;0;L;;;;;N;;;;; 133E;ETHIOPIC SYLLABLE TSO;Lo;0;L;;;;;N;;;;; 133F;ETHIOPIC SYLLABLE TSWA;Lo;0;L;;;;;N;;;;; 1340;ETHIOPIC SYLLABLE TZA;Lo;0;L;;;;;N;;;;; 1341;ETHIOPIC SYLLABLE TZU;Lo;0;L;;;;;N;;;;; 1342;ETHIOPIC SYLLABLE TZI;Lo;0;L;;;;;N;;;;; 1343;ETHIOPIC SYLLABLE TZAA;Lo;0;L;;;;;N;;;;; 1344;ETHIOPIC SYLLABLE TZEE;Lo;0;L;;;;;N;;;;; 1345;ETHIOPIC SYLLABLE TZE;Lo;0;L;;;;;N;;;;; 1346;ETHIOPIC SYLLABLE TZO;Lo;0;L;;;;;N;;;;; 1347;ETHIOPIC SYLLABLE TZOA;Lo;0;L;;;;;N;;;;; 1348;ETHIOPIC SYLLABLE FA;Lo;0;L;;;;;N;;;;; 1349;ETHIOPIC SYLLABLE FU;Lo;0;L;;;;;N;;;;; 134A;ETHIOPIC SYLLABLE FI;Lo;0;L;;;;;N;;;;; 134B;ETHIOPIC SYLLABLE FAA;Lo;0;L;;;;;N;;;;; 134C;ETHIOPIC SYLLABLE FEE;Lo;0;L;;;;;N;;;;; 134D;ETHIOPIC SYLLABLE FE;Lo;0;L;;;;;N;;;;; 134E;ETHIOPIC SYLLABLE FO;Lo;0;L;;;;;N;;;;; 134F;ETHIOPIC SYLLABLE FWA;Lo;0;L;;;;;N;;;;; 1350;ETHIOPIC SYLLABLE PA;Lo;0;L;;;;;N;;;;; 1351;ETHIOPIC SYLLABLE PU;Lo;0;L;;;;;N;;;;; 1352;ETHIOPIC SYLLABLE PI;Lo;0;L;;;;;N;;;;; 1353;ETHIOPIC SYLLABLE PAA;Lo;0;L;;;;;N;;;;; 1354;ETHIOPIC SYLLABLE PEE;Lo;0;L;;;;;N;;;;; 1355;ETHIOPIC SYLLABLE PE;Lo;0;L;;;;;N;;;;; 1356;ETHIOPIC SYLLABLE PO;Lo;0;L;;;;;N;;;;; 1357;ETHIOPIC SYLLABLE PWA;Lo;0;L;;;;;N;;;;; 1358;ETHIOPIC SYLLABLE RYA;Lo;0;L;;;;;N;;;;; 1359;ETHIOPIC SYLLABLE MYA;Lo;0;L;;;;;N;;;;; 135A;ETHIOPIC SYLLABLE FYA;Lo;0;L;;;;;N;;;;; 135D;ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK;Mn;230;NSM;;;;;N;;;;; 135E;ETHIOPIC COMBINING VOWEL LENGTH MARK;Mn;230;NSM;;;;;N;;;;; 135F;ETHIOPIC COMBINING GEMINATION MARK;Mn;230;NSM;;;;;N;;;;; 1360;ETHIOPIC SECTION MARK;Po;0;L;;;;;N;;;;; 1361;ETHIOPIC WORDSPACE;Po;0;L;;;;;N;;;;; 1362;ETHIOPIC FULL STOP;Po;0;L;;;;;N;;;;; 1363;ETHIOPIC COMMA;Po;0;L;;;;;N;;;;; 1364;ETHIOPIC SEMICOLON;Po;0;L;;;;;N;;;;; 1365;ETHIOPIC COLON;Po;0;L;;;;;N;;;;; 1366;ETHIOPIC PREFACE COLON;Po;0;L;;;;;N;;;;; 1367;ETHIOPIC QUESTION MARK;Po;0;L;;;;;N;;;;; 1368;ETHIOPIC PARAGRAPH SEPARATOR;Po;0;L;;;;;N;;;;; 1369;ETHIOPIC DIGIT ONE;No;0;L;;;1;1;N;;;;; 136A;ETHIOPIC DIGIT TWO;No;0;L;;;2;2;N;;;;; 136B;ETHIOPIC DIGIT THREE;No;0;L;;;3;3;N;;;;; 136C;ETHIOPIC DIGIT FOUR;No;0;L;;;4;4;N;;;;; 136D;ETHIOPIC DIGIT FIVE;No;0;L;;;5;5;N;;;;; 136E;ETHIOPIC DIGIT SIX;No;0;L;;;6;6;N;;;;; 136F;ETHIOPIC DIGIT SEVEN;No;0;L;;;7;7;N;;;;; 1370;ETHIOPIC DIGIT EIGHT;No;0;L;;;8;8;N;;;;; 1371;ETHIOPIC DIGIT NINE;No;0;L;;;9;9;N;;;;; 1372;ETHIOPIC NUMBER TEN;No;0;L;;;;10;N;;;;; 1373;ETHIOPIC NUMBER TWENTY;No;0;L;;;;20;N;;;;; 1374;ETHIOPIC NUMBER THIRTY;No;0;L;;;;30;N;;;;; 1375;ETHIOPIC NUMBER FORTY;No;0;L;;;;40;N;;;;; 1376;ETHIOPIC NUMBER FIFTY;No;0;L;;;;50;N;;;;; 1377;ETHIOPIC NUMBER SIXTY;No;0;L;;;;60;N;;;;; 1378;ETHIOPIC NUMBER SEVENTY;No;0;L;;;;70;N;;;;; 1379;ETHIOPIC NUMBER EIGHTY;No;0;L;;;;80;N;;;;; 137A;ETHIOPIC NUMBER NINETY;No;0;L;;;;90;N;;;;; 137B;ETHIOPIC NUMBER HUNDRED;No;0;L;;;;100;N;;;;; 137C;ETHIOPIC NUMBER TEN THOUSAND;No;0;L;;;;10000;N;;;;; 1380;ETHIOPIC SYLLABLE SEBATBEIT MWA;Lo;0;L;;;;;N;;;;; 1381;ETHIOPIC SYLLABLE MWI;Lo;0;L;;;;;N;;;;; 1382;ETHIOPIC SYLLABLE MWEE;Lo;0;L;;;;;N;;;;; 1383;ETHIOPIC SYLLABLE MWE;Lo;0;L;;;;;N;;;;; 1384;ETHIOPIC SYLLABLE SEBATBEIT BWA;Lo;0;L;;;;;N;;;;; 1385;ETHIOPIC SYLLABLE BWI;Lo;0;L;;;;;N;;;;; 1386;ETHIOPIC SYLLABLE BWEE;Lo;0;L;;;;;N;;;;; 1387;ETHIOPIC SYLLABLE BWE;Lo;0;L;;;;;N;;;;; 1388;ETHIOPIC SYLLABLE SEBATBEIT FWA;Lo;0;L;;;;;N;;;;; 1389;ETHIOPIC SYLLABLE FWI;Lo;0;L;;;;;N;;;;; 138A;ETHIOPIC SYLLABLE FWEE;Lo;0;L;;;;;N;;;;; 138B;ETHIOPIC SYLLABLE FWE;Lo;0;L;;;;;N;;;;; 138C;ETHIOPIC SYLLABLE SEBATBEIT PWA;Lo;0;L;;;;;N;;;;; 138D;ETHIOPIC SYLLABLE PWI;Lo;0;L;;;;;N;;;;; 138E;ETHIOPIC SYLLABLE PWEE;Lo;0;L;;;;;N;;;;; 138F;ETHIOPIC SYLLABLE PWE;Lo;0;L;;;;;N;;;;; 1390;ETHIOPIC TONAL MARK YIZET;So;0;ON;;;;;N;;;;; 1391;ETHIOPIC TONAL MARK DERET;So;0;ON;;;;;N;;;;; 1392;ETHIOPIC TONAL MARK RIKRIK;So;0;ON;;;;;N;;;;; 1393;ETHIOPIC TONAL MARK SHORT RIKRIK;So;0;ON;;;;;N;;;;; 1394;ETHIOPIC TONAL MARK DIFAT;So;0;ON;;;;;N;;;;; 1395;ETHIOPIC TONAL MARK KENAT;So;0;ON;;;;;N;;;;; 1396;ETHIOPIC TONAL MARK CHIRET;So;0;ON;;;;;N;;;;; 1397;ETHIOPIC TONAL MARK HIDET;So;0;ON;;;;;N;;;;; 1398;ETHIOPIC TONAL MARK DERET-HIDET;So;0;ON;;;;;N;;;;; 1399;ETHIOPIC TONAL MARK KURT;So;0;ON;;;;;N;;;;; 13A0;CHEROKEE LETTER A;Lo;0;L;;;;;N;;;;; 13A1;CHEROKEE LETTER E;Lo;0;L;;;;;N;;;;; 13A2;CHEROKEE LETTER I;Lo;0;L;;;;;N;;;;; 13A3;CHEROKEE LETTER O;Lo;0;L;;;;;N;;;;; 13A4;CHEROKEE LETTER U;Lo;0;L;;;;;N;;;;; 13A5;CHEROKEE LETTER V;Lo;0;L;;;;;N;;;;; 13A6;CHEROKEE LETTER GA;Lo;0;L;;;;;N;;;;; 13A7;CHEROKEE LETTER KA;Lo;0;L;;;;;N;;;;; 13A8;CHEROKEE LETTER GE;Lo;0;L;;;;;N;;;;; 13A9;CHEROKEE LETTER GI;Lo;0;L;;;;;N;;;;; 13AA;CHEROKEE LETTER GO;Lo;0;L;;;;;N;;;;; 13AB;CHEROKEE LETTER GU;Lo;0;L;;;;;N;;;;; 13AC;CHEROKEE LETTER GV;Lo;0;L;;;;;N;;;;; 13AD;CHEROKEE LETTER HA;Lo;0;L;;;;;N;;;;; 13AE;CHEROKEE LETTER HE;Lo;0;L;;;;;N;;;;; 13AF;CHEROKEE LETTER HI;Lo;0;L;;;;;N;;;;; 13B0;CHEROKEE LETTER HO;Lo;0;L;;;;;N;;;;; 13B1;CHEROKEE LETTER HU;Lo;0;L;;;;;N;;;;; 13B2;CHEROKEE LETTER HV;Lo;0;L;;;;;N;;;;; 13B3;CHEROKEE LETTER LA;Lo;0;L;;;;;N;;;;; 13B4;CHEROKEE LETTER LE;Lo;0;L;;;;;N;;;;; 13B5;CHEROKEE LETTER LI;Lo;0;L;;;;;N;;;;; 13B6;CHEROKEE LETTER LO;Lo;0;L;;;;;N;;;;; 13B7;CHEROKEE LETTER LU;Lo;0;L;;;;;N;;;;; 13B8;CHEROKEE LETTER LV;Lo;0;L;;;;;N;;;;; 13B9;CHEROKEE LETTER MA;Lo;0;L;;;;;N;;;;; 13BA;CHEROKEE LETTER ME;Lo;0;L;;;;;N;;;;; 13BB;CHEROKEE LETTER MI;Lo;0;L;;;;;N;;;;; 13BC;CHEROKEE LETTER MO;Lo;0;L;;;;;N;;;;; 13BD;CHEROKEE LETTER MU;Lo;0;L;;;;;N;;;;; 13BE;CHEROKEE LETTER NA;Lo;0;L;;;;;N;;;;; 13BF;CHEROKEE LETTER HNA;Lo;0;L;;;;;N;;;;; 13C0;CHEROKEE LETTER NAH;Lo;0;L;;;;;N;;;;; 13C1;CHEROKEE LETTER NE;Lo;0;L;;;;;N;;;;; 13C2;CHEROKEE LETTER NI;Lo;0;L;;;;;N;;;;; 13C3;CHEROKEE LETTER NO;Lo;0;L;;;;;N;;;;; 13C4;CHEROKEE LETTER NU;Lo;0;L;;;;;N;;;;; 13C5;CHEROKEE LETTER NV;Lo;0;L;;;;;N;;;;; 13C6;CHEROKEE LETTER QUA;Lo;0;L;;;;;N;;;;; 13C7;CHEROKEE LETTER QUE;Lo;0;L;;;;;N;;;;; 13C8;CHEROKEE LETTER QUI;Lo;0;L;;;;;N;;;;; 13C9;CHEROKEE LETTER QUO;Lo;0;L;;;;;N;;;;; 13CA;CHEROKEE LETTER QUU;Lo;0;L;;;;;N;;;;; 13CB;CHEROKEE LETTER QUV;Lo;0;L;;;;;N;;;;; 13CC;CHEROKEE LETTER SA;Lo;0;L;;;;;N;;;;; 13CD;CHEROKEE LETTER S;Lo;0;L;;;;;N;;;;; 13CE;CHEROKEE LETTER SE;Lo;0;L;;;;;N;;;;; 13CF;CHEROKEE LETTER SI;Lo;0;L;;;;;N;;;;; 13D0;CHEROKEE LETTER SO;Lo;0;L;;;;;N;;;;; 13D1;CHEROKEE LETTER SU;Lo;0;L;;;;;N;;;;; 13D2;CHEROKEE LETTER SV;Lo;0;L;;;;;N;;;;; 13D3;CHEROKEE LETTER DA;Lo;0;L;;;;;N;;;;; 13D4;CHEROKEE LETTER TA;Lo;0;L;;;;;N;;;;; 13D5;CHEROKEE LETTER DE;Lo;0;L;;;;;N;;;;; 13D6;CHEROKEE LETTER TE;Lo;0;L;;;;;N;;;;; 13D7;CHEROKEE LETTER DI;Lo;0;L;;;;;N;;;;; 13D8;CHEROKEE LETTER TI;Lo;0;L;;;;;N;;;;; 13D9;CHEROKEE LETTER DO;Lo;0;L;;;;;N;;;;; 13DA;CHEROKEE LETTER DU;Lo;0;L;;;;;N;;;;; 13DB;CHEROKEE LETTER DV;Lo;0;L;;;;;N;;;;; 13DC;CHEROKEE LETTER DLA;Lo;0;L;;;;;N;;;;; 13DD;CHEROKEE LETTER TLA;Lo;0;L;;;;;N;;;;; 13DE;CHEROKEE LETTER TLE;Lo;0;L;;;;;N;;;;; 13DF;CHEROKEE LETTER TLI;Lo;0;L;;;;;N;;;;; 13E0;CHEROKEE LETTER TLO;Lo;0;L;;;;;N;;;;; 13E1;CHEROKEE LETTER TLU;Lo;0;L;;;;;N;;;;; 13E2;CHEROKEE LETTER TLV;Lo;0;L;;;;;N;;;;; 13E3;CHEROKEE LETTER TSA;Lo;0;L;;;;;N;;;;; 13E4;CHEROKEE LETTER TSE;Lo;0;L;;;;;N;;;;; 13E5;CHEROKEE LETTER TSI;Lo;0;L;;;;;N;;;;; 13E6;CHEROKEE LETTER TSO;Lo;0;L;;;;;N;;;;; 13E7;CHEROKEE LETTER TSU;Lo;0;L;;;;;N;;;;; 13E8;CHEROKEE LETTER TSV;Lo;0;L;;;;;N;;;;; 13E9;CHEROKEE LETTER WA;Lo;0;L;;;;;N;;;;; 13EA;CHEROKEE LETTER WE;Lo;0;L;;;;;N;;;;; 13EB;CHEROKEE LETTER WI;Lo;0;L;;;;;N;;;;; 13EC;CHEROKEE LETTER WO;Lo;0;L;;;;;N;;;;; 13ED;CHEROKEE LETTER WU;Lo;0;L;;;;;N;;;;; 13EE;CHEROKEE LETTER WV;Lo;0;L;;;;;N;;;;; 13EF;CHEROKEE LETTER YA;Lo;0;L;;;;;N;;;;; 13F0;CHEROKEE LETTER YE;Lo;0;L;;;;;N;;;;; 13F1;CHEROKEE LETTER YI;Lo;0;L;;;;;N;;;;; 13F2;CHEROKEE LETTER YO;Lo;0;L;;;;;N;;;;; 13F3;CHEROKEE LETTER YU;Lo;0;L;;;;;N;;;;; 13F4;CHEROKEE LETTER YV;Lo;0;L;;;;;N;;;;; 1400;CANADIAN SYLLABICS HYPHEN;Pd;0;ON;;;;;N;;;;; 1401;CANADIAN SYLLABICS E;Lo;0;L;;;;;N;;;;; 1402;CANADIAN SYLLABICS AAI;Lo;0;L;;;;;N;;;;; 1403;CANADIAN SYLLABICS I;Lo;0;L;;;;;N;;;;; 1404;CANADIAN SYLLABICS II;Lo;0;L;;;;;N;;;;; 1405;CANADIAN SYLLABICS O;Lo;0;L;;;;;N;;;;; 1406;CANADIAN SYLLABICS OO;Lo;0;L;;;;;N;;;;; 1407;CANADIAN SYLLABICS Y-CREE OO;Lo;0;L;;;;;N;;;;; 1408;CANADIAN SYLLABICS CARRIER EE;Lo;0;L;;;;;N;;;;; 1409;CANADIAN SYLLABICS CARRIER I;Lo;0;L;;;;;N;;;;; 140A;CANADIAN SYLLABICS A;Lo;0;L;;;;;N;;;;; 140B;CANADIAN SYLLABICS AA;Lo;0;L;;;;;N;;;;; 140C;CANADIAN SYLLABICS WE;Lo;0;L;;;;;N;;;;; 140D;CANADIAN SYLLABICS WEST-CREE WE;Lo;0;L;;;;;N;;;;; 140E;CANADIAN SYLLABICS WI;Lo;0;L;;;;;N;;;;; 140F;CANADIAN SYLLABICS WEST-CREE WI;Lo;0;L;;;;;N;;;;; 1410;CANADIAN SYLLABICS WII;Lo;0;L;;;;;N;;;;; 1411;CANADIAN SYLLABICS WEST-CREE WII;Lo;0;L;;;;;N;;;;; 1412;CANADIAN SYLLABICS WO;Lo;0;L;;;;;N;;;;; 1413;CANADIAN SYLLABICS WEST-CREE WO;Lo;0;L;;;;;N;;;;; 1414;CANADIAN SYLLABICS WOO;Lo;0;L;;;;;N;;;;; 1415;CANADIAN SYLLABICS WEST-CREE WOO;Lo;0;L;;;;;N;;;;; 1416;CANADIAN SYLLABICS NASKAPI WOO;Lo;0;L;;;;;N;;;;; 1417;CANADIAN SYLLABICS WA;Lo;0;L;;;;;N;;;;; 1418;CANADIAN SYLLABICS WEST-CREE WA;Lo;0;L;;;;;N;;;;; 1419;CANADIAN SYLLABICS WAA;Lo;0;L;;;;;N;;;;; 141A;CANADIAN SYLLABICS WEST-CREE WAA;Lo;0;L;;;;;N;;;;; 141B;CANADIAN SYLLABICS NASKAPI WAA;Lo;0;L;;;;;N;;;;; 141C;CANADIAN SYLLABICS AI;Lo;0;L;;;;;N;;;;; 141D;CANADIAN SYLLABICS Y-CREE W;Lo;0;L;;;;;N;;;;; 141E;CANADIAN SYLLABICS GLOTTAL STOP;Lo;0;L;;;;;N;;;;; 141F;CANADIAN SYLLABICS FINAL ACUTE;Lo;0;L;;;;;N;;;;; 1420;CANADIAN SYLLABICS FINAL GRAVE;Lo;0;L;;;;;N;;;;; 1421;CANADIAN SYLLABICS FINAL BOTTOM HALF RING;Lo;0;L;;;;;N;;;;; 1422;CANADIAN SYLLABICS FINAL TOP HALF RING;Lo;0;L;;;;;N;;;;; 1423;CANADIAN SYLLABICS FINAL RIGHT HALF RING;Lo;0;L;;;;;N;;;;; 1424;CANADIAN SYLLABICS FINAL RING;Lo;0;L;;;;;N;;;;; 1425;CANADIAN SYLLABICS FINAL DOUBLE ACUTE;Lo;0;L;;;;;N;;;;; 1426;CANADIAN SYLLABICS FINAL DOUBLE SHORT VERTICAL STROKES;Lo;0;L;;;;;N;;;;; 1427;CANADIAN SYLLABICS FINAL MIDDLE DOT;Lo;0;L;;;;;N;;;;; 1428;CANADIAN SYLLABICS FINAL SHORT HORIZONTAL STROKE;Lo;0;L;;;;;N;;;;; 1429;CANADIAN SYLLABICS FINAL PLUS;Lo;0;L;;;;;N;;;;; 142A;CANADIAN SYLLABICS FINAL DOWN TACK;Lo;0;L;;;;;N;;;;; 142B;CANADIAN SYLLABICS EN;Lo;0;L;;;;;N;;;;; 142C;CANADIAN SYLLABICS IN;Lo;0;L;;;;;N;;;;; 142D;CANADIAN SYLLABICS ON;Lo;0;L;;;;;N;;;;; 142E;CANADIAN SYLLABICS AN;Lo;0;L;;;;;N;;;;; 142F;CANADIAN SYLLABICS PE;Lo;0;L;;;;;N;;;;; 1430;CANADIAN SYLLABICS PAAI;Lo;0;L;;;;;N;;;;; 1431;CANADIAN SYLLABICS PI;Lo;0;L;;;;;N;;;;; 1432;CANADIAN SYLLABICS PII;Lo;0;L;;;;;N;;;;; 1433;CANADIAN SYLLABICS PO;Lo;0;L;;;;;N;;;;; 1434;CANADIAN SYLLABICS POO;Lo;0;L;;;;;N;;;;; 1435;CANADIAN SYLLABICS Y-CREE POO;Lo;0;L;;;;;N;;;;; 1436;CANADIAN SYLLABICS CARRIER HEE;Lo;0;L;;;;;N;;;;; 1437;CANADIAN SYLLABICS CARRIER HI;Lo;0;L;;;;;N;;;;; 1438;CANADIAN SYLLABICS PA;Lo;0;L;;;;;N;;;;; 1439;CANADIAN SYLLABICS PAA;Lo;0;L;;;;;N;;;;; 143A;CANADIAN SYLLABICS PWE;Lo;0;L;;;;;N;;;;; 143B;CANADIAN SYLLABICS WEST-CREE PWE;Lo;0;L;;;;;N;;;;; 143C;CANADIAN SYLLABICS PWI;Lo;0;L;;;;;N;;;;; 143D;CANADIAN SYLLABICS WEST-CREE PWI;Lo;0;L;;;;;N;;;;; 143E;CANADIAN SYLLABICS PWII;Lo;0;L;;;;;N;;;;; 143F;CANADIAN SYLLABICS WEST-CREE PWII;Lo;0;L;;;;;N;;;;; 1440;CANADIAN SYLLABICS PWO;Lo;0;L;;;;;N;;;;; 1441;CANADIAN SYLLABICS WEST-CREE PWO;Lo;0;L;;;;;N;;;;; 1442;CANADIAN SYLLABICS PWOO;Lo;0;L;;;;;N;;;;; 1443;CANADIAN SYLLABICS WEST-CREE PWOO;Lo;0;L;;;;;N;;;;; 1444;CANADIAN SYLLABICS PWA;Lo;0;L;;;;;N;;;;; 1445;CANADIAN SYLLABICS WEST-CREE PWA;Lo;0;L;;;;;N;;;;; 1446;CANADIAN SYLLABICS PWAA;Lo;0;L;;;;;N;;;;; 1447;CANADIAN SYLLABICS WEST-CREE PWAA;Lo;0;L;;;;;N;;;;; 1448;CANADIAN SYLLABICS Y-CREE PWAA;Lo;0;L;;;;;N;;;;; 1449;CANADIAN SYLLABICS P;Lo;0;L;;;;;N;;;;; 144A;CANADIAN SYLLABICS WEST-CREE P;Lo;0;L;;;;;N;;;;; 144B;CANADIAN SYLLABICS CARRIER H;Lo;0;L;;;;;N;;;;; 144C;CANADIAN SYLLABICS TE;Lo;0;L;;;;;N;;;;; 144D;CANADIAN SYLLABICS TAAI;Lo;0;L;;;;;N;;;;; 144E;CANADIAN SYLLABICS TI;Lo;0;L;;;;;N;;;;; 144F;CANADIAN SYLLABICS TII;Lo;0;L;;;;;N;;;;; 1450;CANADIAN SYLLABICS TO;Lo;0;L;;;;;N;;;;; 1451;CANADIAN SYLLABICS TOO;Lo;0;L;;;;;N;;;;; 1452;CANADIAN SYLLABICS Y-CREE TOO;Lo;0;L;;;;;N;;;;; 1453;CANADIAN SYLLABICS CARRIER DEE;Lo;0;L;;;;;N;;;;; 1454;CANADIAN SYLLABICS CARRIER DI;Lo;0;L;;;;;N;;;;; 1455;CANADIAN SYLLABICS TA;Lo;0;L;;;;;N;;;;; 1456;CANADIAN SYLLABICS TAA;Lo;0;L;;;;;N;;;;; 1457;CANADIAN SYLLABICS TWE;Lo;0;L;;;;;N;;;;; 1458;CANADIAN SYLLABICS WEST-CREE TWE;Lo;0;L;;;;;N;;;;; 1459;CANADIAN SYLLABICS TWI;Lo;0;L;;;;;N;;;;; 145A;CANADIAN SYLLABICS WEST-CREE TWI;Lo;0;L;;;;;N;;;;; 145B;CANADIAN SYLLABICS TWII;Lo;0;L;;;;;N;;;;; 145C;CANADIAN SYLLABICS WEST-CREE TWII;Lo;0;L;;;;;N;;;;; 145D;CANADIAN SYLLABICS TWO;Lo;0;L;;;;;N;;;;; 145E;CANADIAN SYLLABICS WEST-CREE TWO;Lo;0;L;;;;;N;;;;; 145F;CANADIAN SYLLABICS TWOO;Lo;0;L;;;;;N;;;;; 1460;CANADIAN SYLLABICS WEST-CREE TWOO;Lo;0;L;;;;;N;;;;; 1461;CANADIAN SYLLABICS TWA;Lo;0;L;;;;;N;;;;; 1462;CANADIAN SYLLABICS WEST-CREE TWA;Lo;0;L;;;;;N;;;;; 1463;CANADIAN SYLLABICS TWAA;Lo;0;L;;;;;N;;;;; 1464;CANADIAN SYLLABICS WEST-CREE TWAA;Lo;0;L;;;;;N;;;;; 1465;CANADIAN SYLLABICS NASKAPI TWAA;Lo;0;L;;;;;N;;;;; 1466;CANADIAN SYLLABICS T;Lo;0;L;;;;;N;;;;; 1467;CANADIAN SYLLABICS TTE;Lo;0;L;;;;;N;;;;; 1468;CANADIAN SYLLABICS TTI;Lo;0;L;;;;;N;;;;; 1469;CANADIAN SYLLABICS TTO;Lo;0;L;;;;;N;;;;; 146A;CANADIAN SYLLABICS TTA;Lo;0;L;;;;;N;;;;; 146B;CANADIAN SYLLABICS KE;Lo;0;L;;;;;N;;;;; 146C;CANADIAN SYLLABICS KAAI;Lo;0;L;;;;;N;;;;; 146D;CANADIAN SYLLABICS KI;Lo;0;L;;;;;N;;;;; 146E;CANADIAN SYLLABICS KII;Lo;0;L;;;;;N;;;;; 146F;CANADIAN SYLLABICS KO;Lo;0;L;;;;;N;;;;; 1470;CANADIAN SYLLABICS KOO;Lo;0;L;;;;;N;;;;; 1471;CANADIAN SYLLABICS Y-CREE KOO;Lo;0;L;;;;;N;;;;; 1472;CANADIAN SYLLABICS KA;Lo;0;L;;;;;N;;;;; 1473;CANADIAN SYLLABICS KAA;Lo;0;L;;;;;N;;;;; 1474;CANADIAN SYLLABICS KWE;Lo;0;L;;;;;N;;;;; 1475;CANADIAN SYLLABICS WEST-CREE KWE;Lo;0;L;;;;;N;;;;; 1476;CANADIAN SYLLABICS KWI;Lo;0;L;;;;;N;;;;; 1477;CANADIAN SYLLABICS WEST-CREE KWI;Lo;0;L;;;;;N;;;;; 1478;CANADIAN SYLLABICS KWII;Lo;0;L;;;;;N;;;;; 1479;CANADIAN SYLLABICS WEST-CREE KWII;Lo;0;L;;;;;N;;;;; 147A;CANADIAN SYLLABICS KWO;Lo;0;L;;;;;N;;;;; 147B;CANADIAN SYLLABICS WEST-CREE KWO;Lo;0;L;;;;;N;;;;; 147C;CANADIAN SYLLABICS KWOO;Lo;0;L;;;;;N;;;;; 147D;CANADIAN SYLLABICS WEST-CREE KWOO;Lo;0;L;;;;;N;;;;; 147E;CANADIAN SYLLABICS KWA;Lo;0;L;;;;;N;;;;; 147F;CANADIAN SYLLABICS WEST-CREE KWA;Lo;0;L;;;;;N;;;;; 1480;CANADIAN SYLLABICS KWAA;Lo;0;L;;;;;N;;;;; 1481;CANADIAN SYLLABICS WEST-CREE KWAA;Lo;0;L;;;;;N;;;;; 1482;CANADIAN SYLLABICS NASKAPI KWAA;Lo;0;L;;;;;N;;;;; 1483;CANADIAN SYLLABICS K;Lo;0;L;;;;;N;;;;; 1484;CANADIAN SYLLABICS KW;Lo;0;L;;;;;N;;;;; 1485;CANADIAN SYLLABICS SOUTH-SLAVEY KEH;Lo;0;L;;;;;N;;;;; 1486;CANADIAN SYLLABICS SOUTH-SLAVEY KIH;Lo;0;L;;;;;N;;;;; 1487;CANADIAN SYLLABICS SOUTH-SLAVEY KOH;Lo;0;L;;;;;N;;;;; 1488;CANADIAN SYLLABICS SOUTH-SLAVEY KAH;Lo;0;L;;;;;N;;;;; 1489;CANADIAN SYLLABICS CE;Lo;0;L;;;;;N;;;;; 148A;CANADIAN SYLLABICS CAAI;Lo;0;L;;;;;N;;;;; 148B;CANADIAN SYLLABICS CI;Lo;0;L;;;;;N;;;;; 148C;CANADIAN SYLLABICS CII;Lo;0;L;;;;;N;;;;; 148D;CANADIAN SYLLABICS CO;Lo;0;L;;;;;N;;;;; 148E;CANADIAN SYLLABICS COO;Lo;0;L;;;;;N;;;;; 148F;CANADIAN SYLLABICS Y-CREE COO;Lo;0;L;;;;;N;;;;; 1490;CANADIAN SYLLABICS CA;Lo;0;L;;;;;N;;;;; 1491;CANADIAN SYLLABICS CAA;Lo;0;L;;;;;N;;;;; 1492;CANADIAN SYLLABICS CWE;Lo;0;L;;;;;N;;;;; 1493;CANADIAN SYLLABICS WEST-CREE CWE;Lo;0;L;;;;;N;;;;; 1494;CANADIAN SYLLABICS CWI;Lo;0;L;;;;;N;;;;; 1495;CANADIAN SYLLABICS WEST-CREE CWI;Lo;0;L;;;;;N;;;;; 1496;CANADIAN SYLLABICS CWII;Lo;0;L;;;;;N;;;;; 1497;CANADIAN SYLLABICS WEST-CREE CWII;Lo;0;L;;;;;N;;;;; 1498;CANADIAN SYLLABICS CWO;Lo;0;L;;;;;N;;;;; 1499;CANADIAN SYLLABICS WEST-CREE CWO;Lo;0;L;;;;;N;;;;; 149A;CANADIAN SYLLABICS CWOO;Lo;0;L;;;;;N;;;;; 149B;CANADIAN SYLLABICS WEST-CREE CWOO;Lo;0;L;;;;;N;;;;; 149C;CANADIAN SYLLABICS CWA;Lo;0;L;;;;;N;;;;; 149D;CANADIAN SYLLABICS WEST-CREE CWA;Lo;0;L;;;;;N;;;;; 149E;CANADIAN SYLLABICS CWAA;Lo;0;L;;;;;N;;;;; 149F;CANADIAN SYLLABICS WEST-CREE CWAA;Lo;0;L;;;;;N;;;;; 14A0;CANADIAN SYLLABICS NASKAPI CWAA;Lo;0;L;;;;;N;;;;; 14A1;CANADIAN SYLLABICS C;Lo;0;L;;;;;N;;;;; 14A2;CANADIAN SYLLABICS SAYISI TH;Lo;0;L;;;;;N;;;;; 14A3;CANADIAN SYLLABICS ME;Lo;0;L;;;;;N;;;;; 14A4;CANADIAN SYLLABICS MAAI;Lo;0;L;;;;;N;;;;; 14A5;CANADIAN SYLLABICS MI;Lo;0;L;;;;;N;;;;; 14A6;CANADIAN SYLLABICS MII;Lo;0;L;;;;;N;;;;; 14A7;CANADIAN SYLLABICS MO;Lo;0;L;;;;;N;;;;; 14A8;CANADIAN SYLLABICS MOO;Lo;0;L;;;;;N;;;;; 14A9;CANADIAN SYLLABICS Y-CREE MOO;Lo;0;L;;;;;N;;;;; 14AA;CANADIAN SYLLABICS MA;Lo;0;L;;;;;N;;;;; 14AB;CANADIAN SYLLABICS MAA;Lo;0;L;;;;;N;;;;; 14AC;CANADIAN SYLLABICS MWE;Lo;0;L;;;;;N;;;;; 14AD;CANADIAN SYLLABICS WEST-CREE MWE;Lo;0;L;;;;;N;;;;; 14AE;CANADIAN SYLLABICS MWI;Lo;0;L;;;;;N;;;;; 14AF;CANADIAN SYLLABICS WEST-CREE MWI;Lo;0;L;;;;;N;;;;; 14B0;CANADIAN SYLLABICS MWII;Lo;0;L;;;;;N;;;;; 14B1;CANADIAN SYLLABICS WEST-CREE MWII;Lo;0;L;;;;;N;;;;; 14B2;CANADIAN SYLLABICS MWO;Lo;0;L;;;;;N;;;;; 14B3;CANADIAN SYLLABICS WEST-CREE MWO;Lo;0;L;;;;;N;;;;; 14B4;CANADIAN SYLLABICS MWOO;Lo;0;L;;;;;N;;;;; 14B5;CANADIAN SYLLABICS WEST-CREE MWOO;Lo;0;L;;;;;N;;;;; 14B6;CANADIAN SYLLABICS MWA;Lo;0;L;;;;;N;;;;; 14B7;CANADIAN SYLLABICS WEST-CREE MWA;Lo;0;L;;;;;N;;;;; 14B8;CANADIAN SYLLABICS MWAA;Lo;0;L;;;;;N;;;;; 14B9;CANADIAN SYLLABICS WEST-CREE MWAA;Lo;0;L;;;;;N;;;;; 14BA;CANADIAN SYLLABICS NASKAPI MWAA;Lo;0;L;;;;;N;;;;; 14BB;CANADIAN SYLLABICS M;Lo;0;L;;;;;N;;;;; 14BC;CANADIAN SYLLABICS WEST-CREE M;Lo;0;L;;;;;N;;;;; 14BD;CANADIAN SYLLABICS MH;Lo;0;L;;;;;N;;;;; 14BE;CANADIAN SYLLABICS ATHAPASCAN M;Lo;0;L;;;;;N;;;;; 14BF;CANADIAN SYLLABICS SAYISI M;Lo;0;L;;;;;N;;;;; 14C0;CANADIAN SYLLABICS NE;Lo;0;L;;;;;N;;;;; 14C1;CANADIAN SYLLABICS NAAI;Lo;0;L;;;;;N;;;;; 14C2;CANADIAN SYLLABICS NI;Lo;0;L;;;;;N;;;;; 14C3;CANADIAN SYLLABICS NII;Lo;0;L;;;;;N;;;;; 14C4;CANADIAN SYLLABICS NO;Lo;0;L;;;;;N;;;;; 14C5;CANADIAN SYLLABICS NOO;Lo;0;L;;;;;N;;;;; 14C6;CANADIAN SYLLABICS Y-CREE NOO;Lo;0;L;;;;;N;;;;; 14C7;CANADIAN SYLLABICS NA;Lo;0;L;;;;;N;;;;; 14C8;CANADIAN SYLLABICS NAA;Lo;0;L;;;;;N;;;;; 14C9;CANADIAN SYLLABICS NWE;Lo;0;L;;;;;N;;;;; 14CA;CANADIAN SYLLABICS WEST-CREE NWE;Lo;0;L;;;;;N;;;;; 14CB;CANADIAN SYLLABICS NWA;Lo;0;L;;;;;N;;;;; 14CC;CANADIAN SYLLABICS WEST-CREE NWA;Lo;0;L;;;;;N;;;;; 14CD;CANADIAN SYLLABICS NWAA;Lo;0;L;;;;;N;;;;; 14CE;CANADIAN SYLLABICS WEST-CREE NWAA;Lo;0;L;;;;;N;;;;; 14CF;CANADIAN SYLLABICS NASKAPI NWAA;Lo;0;L;;;;;N;;;;; 14D0;CANADIAN SYLLABICS N;Lo;0;L;;;;;N;;;;; 14D1;CANADIAN SYLLABICS CARRIER NG;Lo;0;L;;;;;N;;;;; 14D2;CANADIAN SYLLABICS NH;Lo;0;L;;;;;N;;;;; 14D3;CANADIAN SYLLABICS LE;Lo;0;L;;;;;N;;;;; 14D4;CANADIAN SYLLABICS LAAI;Lo;0;L;;;;;N;;;;; 14D5;CANADIAN SYLLABICS LI;Lo;0;L;;;;;N;;;;; 14D6;CANADIAN SYLLABICS LII;Lo;0;L;;;;;N;;;;; 14D7;CANADIAN SYLLABICS LO;Lo;0;L;;;;;N;;;;; 14D8;CANADIAN SYLLABICS LOO;Lo;0;L;;;;;N;;;;; 14D9;CANADIAN SYLLABICS Y-CREE LOO;Lo;0;L;;;;;N;;;;; 14DA;CANADIAN SYLLABICS LA;Lo;0;L;;;;;N;;;;; 14DB;CANADIAN SYLLABICS LAA;Lo;0;L;;;;;N;;;;; 14DC;CANADIAN SYLLABICS LWE;Lo;0;L;;;;;N;;;;; 14DD;CANADIAN SYLLABICS WEST-CREE LWE;Lo;0;L;;;;;N;;;;; 14DE;CANADIAN SYLLABICS LWI;Lo;0;L;;;;;N;;;;; 14DF;CANADIAN SYLLABICS WEST-CREE LWI;Lo;0;L;;;;;N;;;;; 14E0;CANADIAN SYLLABICS LWII;Lo;0;L;;;;;N;;;;; 14E1;CANADIAN SYLLABICS WEST-CREE LWII;Lo;0;L;;;;;N;;;;; 14E2;CANADIAN SYLLABICS LWO;Lo;0;L;;;;;N;;;;; 14E3;CANADIAN SYLLABICS WEST-CREE LWO;Lo;0;L;;;;;N;;;;; 14E4;CANADIAN SYLLABICS LWOO;Lo;0;L;;;;;N;;;;; 14E5;CANADIAN SYLLABICS WEST-CREE LWOO;Lo;0;L;;;;;N;;;;; 14E6;CANADIAN SYLLABICS LWA;Lo;0;L;;;;;N;;;;; 14E7;CANADIAN SYLLABICS WEST-CREE LWA;Lo;0;L;;;;;N;;;;; 14E8;CANADIAN SYLLABICS LWAA;Lo;0;L;;;;;N;;;;; 14E9;CANADIAN SYLLABICS WEST-CREE LWAA;Lo;0;L;;;;;N;;;;; 14EA;CANADIAN SYLLABICS L;Lo;0;L;;;;;N;;;;; 14EB;CANADIAN SYLLABICS WEST-CREE L;Lo;0;L;;;;;N;;;;; 14EC;CANADIAN SYLLABICS MEDIAL L;Lo;0;L;;;;;N;;;;; 14ED;CANADIAN SYLLABICS SE;Lo;0;L;;;;;N;;;;; 14EE;CANADIAN SYLLABICS SAAI;Lo;0;L;;;;;N;;;;; 14EF;CANADIAN SYLLABICS SI;Lo;0;L;;;;;N;;;;; 14F0;CANADIAN SYLLABICS SII;Lo;0;L;;;;;N;;;;; 14F1;CANADIAN SYLLABICS SO;Lo;0;L;;;;;N;;;;; 14F2;CANADIAN SYLLABICS SOO;Lo;0;L;;;;;N;;;;; 14F3;CANADIAN SYLLABICS Y-CREE SOO;Lo;0;L;;;;;N;;;;; 14F4;CANADIAN SYLLABICS SA;Lo;0;L;;;;;N;;;;; 14F5;CANADIAN SYLLABICS SAA;Lo;0;L;;;;;N;;;;; 14F6;CANADIAN SYLLABICS SWE;Lo;0;L;;;;;N;;;;; 14F7;CANADIAN SYLLABICS WEST-CREE SWE;Lo;0;L;;;;;N;;;;; 14F8;CANADIAN SYLLABICS SWI;Lo;0;L;;;;;N;;;;; 14F9;CANADIAN SYLLABICS WEST-CREE SWI;Lo;0;L;;;;;N;;;;; 14FA;CANADIAN SYLLABICS SWII;Lo;0;L;;;;;N;;;;; 14FB;CANADIAN SYLLABICS WEST-CREE SWII;Lo;0;L;;;;;N;;;;; 14FC;CANADIAN SYLLABICS SWO;Lo;0;L;;;;;N;;;;; 14FD;CANADIAN SYLLABICS WEST-CREE SWO;Lo;0;L;;;;;N;;;;; 14FE;CANADIAN SYLLABICS SWOO;Lo;0;L;;;;;N;;;;; 14FF;CANADIAN SYLLABICS WEST-CREE SWOO;Lo;0;L;;;;;N;;;;; 1500;CANADIAN SYLLABICS SWA;Lo;0;L;;;;;N;;;;; 1501;CANADIAN SYLLABICS WEST-CREE SWA;Lo;0;L;;;;;N;;;;; 1502;CANADIAN SYLLABICS SWAA;Lo;0;L;;;;;N;;;;; 1503;CANADIAN SYLLABICS WEST-CREE SWAA;Lo;0;L;;;;;N;;;;; 1504;CANADIAN SYLLABICS NASKAPI SWAA;Lo;0;L;;;;;N;;;;; 1505;CANADIAN SYLLABICS S;Lo;0;L;;;;;N;;;;; 1506;CANADIAN SYLLABICS ATHAPASCAN S;Lo;0;L;;;;;N;;;;; 1507;CANADIAN SYLLABICS SW;Lo;0;L;;;;;N;;;;; 1508;CANADIAN SYLLABICS BLACKFOOT S;Lo;0;L;;;;;N;;;;; 1509;CANADIAN SYLLABICS MOOSE-CREE SK;Lo;0;L;;;;;N;;;;; 150A;CANADIAN SYLLABICS NASKAPI SKW;Lo;0;L;;;;;N;;;;; 150B;CANADIAN SYLLABICS NASKAPI S-W;Lo;0;L;;;;;N;;;;; 150C;CANADIAN SYLLABICS NASKAPI SPWA;Lo;0;L;;;;;N;;;;; 150D;CANADIAN SYLLABICS NASKAPI STWA;Lo;0;L;;;;;N;;;;; 150E;CANADIAN SYLLABICS NASKAPI SKWA;Lo;0;L;;;;;N;;;;; 150F;CANADIAN SYLLABICS NASKAPI SCWA;Lo;0;L;;;;;N;;;;; 1510;CANADIAN SYLLABICS SHE;Lo;0;L;;;;;N;;;;; 1511;CANADIAN SYLLABICS SHI;Lo;0;L;;;;;N;;;;; 1512;CANADIAN SYLLABICS SHII;Lo;0;L;;;;;N;;;;; 1513;CANADIAN SYLLABICS SHO;Lo;0;L;;;;;N;;;;; 1514;CANADIAN SYLLABICS SHOO;Lo;0;L;;;;;N;;;;; 1515;CANADIAN SYLLABICS SHA;Lo;0;L;;;;;N;;;;; 1516;CANADIAN SYLLABICS SHAA;Lo;0;L;;;;;N;;;;; 1517;CANADIAN SYLLABICS SHWE;Lo;0;L;;;;;N;;;;; 1518;CANADIAN SYLLABICS WEST-CREE SHWE;Lo;0;L;;;;;N;;;;; 1519;CANADIAN SYLLABICS SHWI;Lo;0;L;;;;;N;;;;; 151A;CANADIAN SYLLABICS WEST-CREE SHWI;Lo;0;L;;;;;N;;;;; 151B;CANADIAN SYLLABICS SHWII;Lo;0;L;;;;;N;;;;; 151C;CANADIAN SYLLABICS WEST-CREE SHWII;Lo;0;L;;;;;N;;;;; 151D;CANADIAN SYLLABICS SHWO;Lo;0;L;;;;;N;;;;; 151E;CANADIAN SYLLABICS WEST-CREE SHWO;Lo;0;L;;;;;N;;;;; 151F;CANADIAN SYLLABICS SHWOO;Lo;0;L;;;;;N;;;;; 1520;CANADIAN SYLLABICS WEST-CREE SHWOO;Lo;0;L;;;;;N;;;;; 1521;CANADIAN SYLLABICS SHWA;Lo;0;L;;;;;N;;;;; 1522;CANADIAN SYLLABICS WEST-CREE SHWA;Lo;0;L;;;;;N;;;;; 1523;CANADIAN SYLLABICS SHWAA;Lo;0;L;;;;;N;;;;; 1524;CANADIAN SYLLABICS WEST-CREE SHWAA;Lo;0;L;;;;;N;;;;; 1525;CANADIAN SYLLABICS SH;Lo;0;L;;;;;N;;;;; 1526;CANADIAN SYLLABICS YE;Lo;0;L;;;;;N;;;;; 1527;CANADIAN SYLLABICS YAAI;Lo;0;L;;;;;N;;;;; 1528;CANADIAN SYLLABICS YI;Lo;0;L;;;;;N;;;;; 1529;CANADIAN SYLLABICS YII;Lo;0;L;;;;;N;;;;; 152A;CANADIAN SYLLABICS YO;Lo;0;L;;;;;N;;;;; 152B;CANADIAN SYLLABICS YOO;Lo;0;L;;;;;N;;;;; 152C;CANADIAN SYLLABICS Y-CREE YOO;Lo;0;L;;;;;N;;;;; 152D;CANADIAN SYLLABICS YA;Lo;0;L;;;;;N;;;;; 152E;CANADIAN SYLLABICS YAA;Lo;0;L;;;;;N;;;;; 152F;CANADIAN SYLLABICS YWE;Lo;0;L;;;;;N;;;;; 1530;CANADIAN SYLLABICS WEST-CREE YWE;Lo;0;L;;;;;N;;;;; 1531;CANADIAN SYLLABICS YWI;Lo;0;L;;;;;N;;;;; 1532;CANADIAN SYLLABICS WEST-CREE YWI;Lo;0;L;;;;;N;;;;; 1533;CANADIAN SYLLABICS YWII;Lo;0;L;;;;;N;;;;; 1534;CANADIAN SYLLABICS WEST-CREE YWII;Lo;0;L;;;;;N;;;;; 1535;CANADIAN SYLLABICS YWO;Lo;0;L;;;;;N;;;;; 1536;CANADIAN SYLLABICS WEST-CREE YWO;Lo;0;L;;;;;N;;;;; 1537;CANADIAN SYLLABICS YWOO;Lo;0;L;;;;;N;;;;; 1538;CANADIAN SYLLABICS WEST-CREE YWOO;Lo;0;L;;;;;N;;;;; 1539;CANADIAN SYLLABICS YWA;Lo;0;L;;;;;N;;;;; 153A;CANADIAN SYLLABICS WEST-CREE YWA;Lo;0;L;;;;;N;;;;; 153B;CANADIAN SYLLABICS YWAA;Lo;0;L;;;;;N;;;;; 153C;CANADIAN SYLLABICS WEST-CREE YWAA;Lo;0;L;;;;;N;;;;; 153D;CANADIAN SYLLABICS NASKAPI YWAA;Lo;0;L;;;;;N;;;;; 153E;CANADIAN SYLLABICS Y;Lo;0;L;;;;;N;;;;; 153F;CANADIAN SYLLABICS BIBLE-CREE Y;Lo;0;L;;;;;N;;;;; 1540;CANADIAN SYLLABICS WEST-CREE Y;Lo;0;L;;;;;N;;;;; 1541;CANADIAN SYLLABICS SAYISI YI;Lo;0;L;;;;;N;;;;; 1542;CANADIAN SYLLABICS RE;Lo;0;L;;;;;N;;;;; 1543;CANADIAN SYLLABICS R-CREE RE;Lo;0;L;;;;;N;;;;; 1544;CANADIAN SYLLABICS WEST-CREE LE;Lo;0;L;;;;;N;;;;; 1545;CANADIAN SYLLABICS RAAI;Lo;0;L;;;;;N;;;;; 1546;CANADIAN SYLLABICS RI;Lo;0;L;;;;;N;;;;; 1547;CANADIAN SYLLABICS RII;Lo;0;L;;;;;N;;;;; 1548;CANADIAN SYLLABICS RO;Lo;0;L;;;;;N;;;;; 1549;CANADIAN SYLLABICS ROO;Lo;0;L;;;;;N;;;;; 154A;CANADIAN SYLLABICS WEST-CREE LO;Lo;0;L;;;;;N;;;;; 154B;CANADIAN SYLLABICS RA;Lo;0;L;;;;;N;;;;; 154C;CANADIAN SYLLABICS RAA;Lo;0;L;;;;;N;;;;; 154D;CANADIAN SYLLABICS WEST-CREE LA;Lo;0;L;;;;;N;;;;; 154E;CANADIAN SYLLABICS RWAA;Lo;0;L;;;;;N;;;;; 154F;CANADIAN SYLLABICS WEST-CREE RWAA;Lo;0;L;;;;;N;;;;; 1550;CANADIAN SYLLABICS R;Lo;0;L;;;;;N;;;;; 1551;CANADIAN SYLLABICS WEST-CREE R;Lo;0;L;;;;;N;;;;; 1552;CANADIAN SYLLABICS MEDIAL R;Lo;0;L;;;;;N;;;;; 1553;CANADIAN SYLLABICS FE;Lo;0;L;;;;;N;;;;; 1554;CANADIAN SYLLABICS FAAI;Lo;0;L;;;;;N;;;;; 1555;CANADIAN SYLLABICS FI;Lo;0;L;;;;;N;;;;; 1556;CANADIAN SYLLABICS FII;Lo;0;L;;;;;N;;;;; 1557;CANADIAN SYLLABICS FO;Lo;0;L;;;;;N;;;;; 1558;CANADIAN SYLLABICS FOO;Lo;0;L;;;;;N;;;;; 1559;CANADIAN SYLLABICS FA;Lo;0;L;;;;;N;;;;; 155A;CANADIAN SYLLABICS FAA;Lo;0;L;;;;;N;;;;; 155B;CANADIAN SYLLABICS FWAA;Lo;0;L;;;;;N;;;;; 155C;CANADIAN SYLLABICS WEST-CREE FWAA;Lo;0;L;;;;;N;;;;; 155D;CANADIAN SYLLABICS F;Lo;0;L;;;;;N;;;;; 155E;CANADIAN SYLLABICS THE;Lo;0;L;;;;;N;;;;; 155F;CANADIAN SYLLABICS N-CREE THE;Lo;0;L;;;;;N;;;;; 1560;CANADIAN SYLLABICS THI;Lo;0;L;;;;;N;;;;; 1561;CANADIAN SYLLABICS N-CREE THI;Lo;0;L;;;;;N;;;;; 1562;CANADIAN SYLLABICS THII;Lo;0;L;;;;;N;;;;; 1563;CANADIAN SYLLABICS N-CREE THII;Lo;0;L;;;;;N;;;;; 1564;CANADIAN SYLLABICS THO;Lo;0;L;;;;;N;;;;; 1565;CANADIAN SYLLABICS THOO;Lo;0;L;;;;;N;;;;; 1566;CANADIAN SYLLABICS THA;Lo;0;L;;;;;N;;;;; 1567;CANADIAN SYLLABICS THAA;Lo;0;L;;;;;N;;;;; 1568;CANADIAN SYLLABICS THWAA;Lo;0;L;;;;;N;;;;; 1569;CANADIAN SYLLABICS WEST-CREE THWAA;Lo;0;L;;;;;N;;;;; 156A;CANADIAN SYLLABICS TH;Lo;0;L;;;;;N;;;;; 156B;CANADIAN SYLLABICS TTHE;Lo;0;L;;;;;N;;;;; 156C;CANADIAN SYLLABICS TTHI;Lo;0;L;;;;;N;;;;; 156D;CANADIAN SYLLABICS TTHO;Lo;0;L;;;;;N;;;;; 156E;CANADIAN SYLLABICS TTHA;Lo;0;L;;;;;N;;;;; 156F;CANADIAN SYLLABICS TTH;Lo;0;L;;;;;N;;;;; 1570;CANADIAN SYLLABICS TYE;Lo;0;L;;;;;N;;;;; 1571;CANADIAN SYLLABICS TYI;Lo;0;L;;;;;N;;;;; 1572;CANADIAN SYLLABICS TYO;Lo;0;L;;;;;N;;;;; 1573;CANADIAN SYLLABICS TYA;Lo;0;L;;;;;N;;;;; 1574;CANADIAN SYLLABICS NUNAVIK HE;Lo;0;L;;;;;N;;;;; 1575;CANADIAN SYLLABICS NUNAVIK HI;Lo;0;L;;;;;N;;;;; 1576;CANADIAN SYLLABICS NUNAVIK HII;Lo;0;L;;;;;N;;;;; 1577;CANADIAN SYLLABICS NUNAVIK HO;Lo;0;L;;;;;N;;;;; 1578;CANADIAN SYLLABICS NUNAVIK HOO;Lo;0;L;;;;;N;;;;; 1579;CANADIAN SYLLABICS NUNAVIK HA;Lo;0;L;;;;;N;;;;; 157A;CANADIAN SYLLABICS NUNAVIK HAA;Lo;0;L;;;;;N;;;;; 157B;CANADIAN SYLLABICS NUNAVIK H;Lo;0;L;;;;;N;;;;; 157C;CANADIAN SYLLABICS NUNAVUT H;Lo;0;L;;;;;N;;;;; 157D;CANADIAN SYLLABICS HK;Lo;0;L;;;;;N;;;;; 157E;CANADIAN SYLLABICS QAAI;Lo;0;L;;;;;N;;;;; 157F;CANADIAN SYLLABICS QI;Lo;0;L;;;;;N;;;;; 1580;CANADIAN SYLLABICS QII;Lo;0;L;;;;;N;;;;; 1581;CANADIAN SYLLABICS QO;Lo;0;L;;;;;N;;;;; 1582;CANADIAN SYLLABICS QOO;Lo;0;L;;;;;N;;;;; 1583;CANADIAN SYLLABICS QA;Lo;0;L;;;;;N;;;;; 1584;CANADIAN SYLLABICS QAA;Lo;0;L;;;;;N;;;;; 1585;CANADIAN SYLLABICS Q;Lo;0;L;;;;;N;;;;; 1586;CANADIAN SYLLABICS TLHE;Lo;0;L;;;;;N;;;;; 1587;CANADIAN SYLLABICS TLHI;Lo;0;L;;;;;N;;;;; 1588;CANADIAN SYLLABICS TLHO;Lo;0;L;;;;;N;;;;; 1589;CANADIAN SYLLABICS TLHA;Lo;0;L;;;;;N;;;;; 158A;CANADIAN SYLLABICS WEST-CREE RE;Lo;0;L;;;;;N;;;;; 158B;CANADIAN SYLLABICS WEST-CREE RI;Lo;0;L;;;;;N;;;;; 158C;CANADIAN SYLLABICS WEST-CREE RO;Lo;0;L;;;;;N;;;;; 158D;CANADIAN SYLLABICS WEST-CREE RA;Lo;0;L;;;;;N;;;;; 158E;CANADIAN SYLLABICS NGAAI;Lo;0;L;;;;;N;;;;; 158F;CANADIAN SYLLABICS NGI;Lo;0;L;;;;;N;;;;; 1590;CANADIAN SYLLABICS NGII;Lo;0;L;;;;;N;;;;; 1591;CANADIAN SYLLABICS NGO;Lo;0;L;;;;;N;;;;; 1592;CANADIAN SYLLABICS NGOO;Lo;0;L;;;;;N;;;;; 1593;CANADIAN SYLLABICS NGA;Lo;0;L;;;;;N;;;;; 1594;CANADIAN SYLLABICS NGAA;Lo;0;L;;;;;N;;;;; 1595;CANADIAN SYLLABICS NG;Lo;0;L;;;;;N;;;;; 1596;CANADIAN SYLLABICS NNG;Lo;0;L;;;;;N;;;;; 1597;CANADIAN SYLLABICS SAYISI SHE;Lo;0;L;;;;;N;;;;; 1598;CANADIAN SYLLABICS SAYISI SHI;Lo;0;L;;;;;N;;;;; 1599;CANADIAN SYLLABICS SAYISI SHO;Lo;0;L;;;;;N;;;;; 159A;CANADIAN SYLLABICS SAYISI SHA;Lo;0;L;;;;;N;;;;; 159B;CANADIAN SYLLABICS WOODS-CREE THE;Lo;0;L;;;;;N;;;;; 159C;CANADIAN SYLLABICS WOODS-CREE THI;Lo;0;L;;;;;N;;;;; 159D;CANADIAN SYLLABICS WOODS-CREE THO;Lo;0;L;;;;;N;;;;; 159E;CANADIAN SYLLABICS WOODS-CREE THA;Lo;0;L;;;;;N;;;;; 159F;CANADIAN SYLLABICS WOODS-CREE TH;Lo;0;L;;;;;N;;;;; 15A0;CANADIAN SYLLABICS LHI;Lo;0;L;;;;;N;;;;; 15A1;CANADIAN SYLLABICS LHII;Lo;0;L;;;;;N;;;;; 15A2;CANADIAN SYLLABICS LHO;Lo;0;L;;;;;N;;;;; 15A3;CANADIAN SYLLABICS LHOO;Lo;0;L;;;;;N;;;;; 15A4;CANADIAN SYLLABICS LHA;Lo;0;L;;;;;N;;;;; 15A5;CANADIAN SYLLABICS LHAA;Lo;0;L;;;;;N;;;;; 15A6;CANADIAN SYLLABICS LH;Lo;0;L;;;;;N;;;;; 15A7;CANADIAN SYLLABICS TH-CREE THE;Lo;0;L;;;;;N;;;;; 15A8;CANADIAN SYLLABICS TH-CREE THI;Lo;0;L;;;;;N;;;;; 15A9;CANADIAN SYLLABICS TH-CREE THII;Lo;0;L;;;;;N;;;;; 15AA;CANADIAN SYLLABICS TH-CREE THO;Lo;0;L;;;;;N;;;;; 15AB;CANADIAN SYLLABICS TH-CREE THOO;Lo;0;L;;;;;N;;;;; 15AC;CANADIAN SYLLABICS TH-CREE THA;Lo;0;L;;;;;N;;;;; 15AD;CANADIAN SYLLABICS TH-CREE THAA;Lo;0;L;;;;;N;;;;; 15AE;CANADIAN SYLLABICS TH-CREE TH;Lo;0;L;;;;;N;;;;; 15AF;CANADIAN SYLLABICS AIVILIK B;Lo;0;L;;;;;N;;;;; 15B0;CANADIAN SYLLABICS BLACKFOOT E;Lo;0;L;;;;;N;;;;; 15B1;CANADIAN SYLLABICS BLACKFOOT I;Lo;0;L;;;;;N;;;;; 15B2;CANADIAN SYLLABICS BLACKFOOT O;Lo;0;L;;;;;N;;;;; 15B3;CANADIAN SYLLABICS BLACKFOOT A;Lo;0;L;;;;;N;;;;; 15B4;CANADIAN SYLLABICS BLACKFOOT WE;Lo;0;L;;;;;N;;;;; 15B5;CANADIAN SYLLABICS BLACKFOOT WI;Lo;0;L;;;;;N;;;;; 15B6;CANADIAN SYLLABICS BLACKFOOT WO;Lo;0;L;;;;;N;;;;; 15B7;CANADIAN SYLLABICS BLACKFOOT WA;Lo;0;L;;;;;N;;;;; 15B8;CANADIAN SYLLABICS BLACKFOOT NE;Lo;0;L;;;;;N;;;;; 15B9;CANADIAN SYLLABICS BLACKFOOT NI;Lo;0;L;;;;;N;;;;; 15BA;CANADIAN SYLLABICS BLACKFOOT NO;Lo;0;L;;;;;N;;;;; 15BB;CANADIAN SYLLABICS BLACKFOOT NA;Lo;0;L;;;;;N;;;;; 15BC;CANADIAN SYLLABICS BLACKFOOT KE;Lo;0;L;;;;;N;;;;; 15BD;CANADIAN SYLLABICS BLACKFOOT KI;Lo;0;L;;;;;N;;;;; 15BE;CANADIAN SYLLABICS BLACKFOOT KO;Lo;0;L;;;;;N;;;;; 15BF;CANADIAN SYLLABICS BLACKFOOT KA;Lo;0;L;;;;;N;;;;; 15C0;CANADIAN SYLLABICS SAYISI HE;Lo;0;L;;;;;N;;;;; 15C1;CANADIAN SYLLABICS SAYISI HI;Lo;0;L;;;;;N;;;;; 15C2;CANADIAN SYLLABICS SAYISI HO;Lo;0;L;;;;;N;;;;; 15C3;CANADIAN SYLLABICS SAYISI HA;Lo;0;L;;;;;N;;;;; 15C4;CANADIAN SYLLABICS CARRIER GHU;Lo;0;L;;;;;N;;;;; 15C5;CANADIAN SYLLABICS CARRIER GHO;Lo;0;L;;;;;N;;;;; 15C6;CANADIAN SYLLABICS CARRIER GHE;Lo;0;L;;;;;N;;;;; 15C7;CANADIAN SYLLABICS CARRIER GHEE;Lo;0;L;;;;;N;;;;; 15C8;CANADIAN SYLLABICS CARRIER GHI;Lo;0;L;;;;;N;;;;; 15C9;CANADIAN SYLLABICS CARRIER GHA;Lo;0;L;;;;;N;;;;; 15CA;CANADIAN SYLLABICS CARRIER RU;Lo;0;L;;;;;N;;;;; 15CB;CANADIAN SYLLABICS CARRIER RO;Lo;0;L;;;;;N;;;;; 15CC;CANADIAN SYLLABICS CARRIER RE;Lo;0;L;;;;;N;;;;; 15CD;CANADIAN SYLLABICS CARRIER REE;Lo;0;L;;;;;N;;;;; 15CE;CANADIAN SYLLABICS CARRIER RI;Lo;0;L;;;;;N;;;;; 15CF;CANADIAN SYLLABICS CARRIER RA;Lo;0;L;;;;;N;;;;; 15D0;CANADIAN SYLLABICS CARRIER WU;Lo;0;L;;;;;N;;;;; 15D1;CANADIAN SYLLABICS CARRIER WO;Lo;0;L;;;;;N;;;;; 15D2;CANADIAN SYLLABICS CARRIER WE;Lo;0;L;;;;;N;;;;; 15D3;CANADIAN SYLLABICS CARRIER WEE;Lo;0;L;;;;;N;;;;; 15D4;CANADIAN SYLLABICS CARRIER WI;Lo;0;L;;;;;N;;;;; 15D5;CANADIAN SYLLABICS CARRIER WA;Lo;0;L;;;;;N;;;;; 15D6;CANADIAN SYLLABICS CARRIER HWU;Lo;0;L;;;;;N;;;;; 15D7;CANADIAN SYLLABICS CARRIER HWO;Lo;0;L;;;;;N;;;;; 15D8;CANADIAN SYLLABICS CARRIER HWE;Lo;0;L;;;;;N;;;;; 15D9;CANADIAN SYLLABICS CARRIER HWEE;Lo;0;L;;;;;N;;;;; 15DA;CANADIAN SYLLABICS CARRIER HWI;Lo;0;L;;;;;N;;;;; 15DB;CANADIAN SYLLABICS CARRIER HWA;Lo;0;L;;;;;N;;;;; 15DC;CANADIAN SYLLABICS CARRIER THU;Lo;0;L;;;;;N;;;;; 15DD;CANADIAN SYLLABICS CARRIER THO;Lo;0;L;;;;;N;;;;; 15DE;CANADIAN SYLLABICS CARRIER THE;Lo;0;L;;;;;N;;;;; 15DF;CANADIAN SYLLABICS CARRIER THEE;Lo;0;L;;;;;N;;;;; 15E0;CANADIAN SYLLABICS CARRIER THI;Lo;0;L;;;;;N;;;;; 15E1;CANADIAN SYLLABICS CARRIER THA;Lo;0;L;;;;;N;;;;; 15E2;CANADIAN SYLLABICS CARRIER TTU;Lo;0;L;;;;;N;;;;; 15E3;CANADIAN SYLLABICS CARRIER TTO;Lo;0;L;;;;;N;;;;; 15E4;CANADIAN SYLLABICS CARRIER TTE;Lo;0;L;;;;;N;;;;; 15E5;CANADIAN SYLLABICS CARRIER TTEE;Lo;0;L;;;;;N;;;;; 15E6;CANADIAN SYLLABICS CARRIER TTI;Lo;0;L;;;;;N;;;;; 15E7;CANADIAN SYLLABICS CARRIER TTA;Lo;0;L;;;;;N;;;;; 15E8;CANADIAN SYLLABICS CARRIER PU;Lo;0;L;;;;;N;;;;; 15E9;CANADIAN SYLLABICS CARRIER PO;Lo;0;L;;;;;N;;;;; 15EA;CANADIAN SYLLABICS CARRIER PE;Lo;0;L;;;;;N;;;;; 15EB;CANADIAN SYLLABICS CARRIER PEE;Lo;0;L;;;;;N;;;;; 15EC;CANADIAN SYLLABICS CARRIER PI;Lo;0;L;;;;;N;;;;; 15ED;CANADIAN SYLLABICS CARRIER PA;Lo;0;L;;;;;N;;;;; 15EE;CANADIAN SYLLABICS CARRIER P;Lo;0;L;;;;;N;;;;; 15EF;CANADIAN SYLLABICS CARRIER GU;Lo;0;L;;;;;N;;;;; 15F0;CANADIAN SYLLABICS CARRIER GO;Lo;0;L;;;;;N;;;;; 15F1;CANADIAN SYLLABICS CARRIER GE;Lo;0;L;;;;;N;;;;; 15F2;CANADIAN SYLLABICS CARRIER GEE;Lo;0;L;;;;;N;;;;; 15F3;CANADIAN SYLLABICS CARRIER GI;Lo;0;L;;;;;N;;;;; 15F4;CANADIAN SYLLABICS CARRIER GA;Lo;0;L;;;;;N;;;;; 15F5;CANADIAN SYLLABICS CARRIER KHU;Lo;0;L;;;;;N;;;;; 15F6;CANADIAN SYLLABICS CARRIER KHO;Lo;0;L;;;;;N;;;;; 15F7;CANADIAN SYLLABICS CARRIER KHE;Lo;0;L;;;;;N;;;;; 15F8;CANADIAN SYLLABICS CARRIER KHEE;Lo;0;L;;;;;N;;;;; 15F9;CANADIAN SYLLABICS CARRIER KHI;Lo;0;L;;;;;N;;;;; 15FA;CANADIAN SYLLABICS CARRIER KHA;Lo;0;L;;;;;N;;;;; 15FB;CANADIAN SYLLABICS CARRIER KKU;Lo;0;L;;;;;N;;;;; 15FC;CANADIAN SYLLABICS CARRIER KKO;Lo;0;L;;;;;N;;;;; 15FD;CANADIAN SYLLABICS CARRIER KKE;Lo;0;L;;;;;N;;;;; 15FE;CANADIAN SYLLABICS CARRIER KKEE;Lo;0;L;;;;;N;;;;; 15FF;CANADIAN SYLLABICS CARRIER KKI;Lo;0;L;;;;;N;;;;; 1600;CANADIAN SYLLABICS CARRIER KKA;Lo;0;L;;;;;N;;;;; 1601;CANADIAN SYLLABICS CARRIER KK;Lo;0;L;;;;;N;;;;; 1602;CANADIAN SYLLABICS CARRIER NU;Lo;0;L;;;;;N;;;;; 1603;CANADIAN SYLLABICS CARRIER NO;Lo;0;L;;;;;N;;;;; 1604;CANADIAN SYLLABICS CARRIER NE;Lo;0;L;;;;;N;;;;; 1605;CANADIAN SYLLABICS CARRIER NEE;Lo;0;L;;;;;N;;;;; 1606;CANADIAN SYLLABICS CARRIER NI;Lo;0;L;;;;;N;;;;; 1607;CANADIAN SYLLABICS CARRIER NA;Lo;0;L;;;;;N;;;;; 1608;CANADIAN SYLLABICS CARRIER MU;Lo;0;L;;;;;N;;;;; 1609;CANADIAN SYLLABICS CARRIER MO;Lo;0;L;;;;;N;;;;; 160A;CANADIAN SYLLABICS CARRIER ME;Lo;0;L;;;;;N;;;;; 160B;CANADIAN SYLLABICS CARRIER MEE;Lo;0;L;;;;;N;;;;; 160C;CANADIAN SYLLABICS CARRIER MI;Lo;0;L;;;;;N;;;;; 160D;CANADIAN SYLLABICS CARRIER MA;Lo;0;L;;;;;N;;;;; 160E;CANADIAN SYLLABICS CARRIER YU;Lo;0;L;;;;;N;;;;; 160F;CANADIAN SYLLABICS CARRIER YO;Lo;0;L;;;;;N;;;;; 1610;CANADIAN SYLLABICS CARRIER YE;Lo;0;L;;;;;N;;;;; 1611;CANADIAN SYLLABICS CARRIER YEE;Lo;0;L;;;;;N;;;;; 1612;CANADIAN SYLLABICS CARRIER YI;Lo;0;L;;;;;N;;;;; 1613;CANADIAN SYLLABICS CARRIER YA;Lo;0;L;;;;;N;;;;; 1614;CANADIAN SYLLABICS CARRIER JU;Lo;0;L;;;;;N;;;;; 1615;CANADIAN SYLLABICS SAYISI JU;Lo;0;L;;;;;N;;;;; 1616;CANADIAN SYLLABICS CARRIER JO;Lo;0;L;;;;;N;;;;; 1617;CANADIAN SYLLABICS CARRIER JE;Lo;0;L;;;;;N;;;;; 1618;CANADIAN SYLLABICS CARRIER JEE;Lo;0;L;;;;;N;;;;; 1619;CANADIAN SYLLABICS CARRIER JI;Lo;0;L;;;;;N;;;;; 161A;CANADIAN SYLLABICS SAYISI JI;Lo;0;L;;;;;N;;;;; 161B;CANADIAN SYLLABICS CARRIER JA;Lo;0;L;;;;;N;;;;; 161C;CANADIAN SYLLABICS CARRIER JJU;Lo;0;L;;;;;N;;;;; 161D;CANADIAN SYLLABICS CARRIER JJO;Lo;0;L;;;;;N;;;;; 161E;CANADIAN SYLLABICS CARRIER JJE;Lo;0;L;;;;;N;;;;; 161F;CANADIAN SYLLABICS CARRIER JJEE;Lo;0;L;;;;;N;;;;; 1620;CANADIAN SYLLABICS CARRIER JJI;Lo;0;L;;;;;N;;;;; 1621;CANADIAN SYLLABICS CARRIER JJA;Lo;0;L;;;;;N;;;;; 1622;CANADIAN SYLLABICS CARRIER LU;Lo;0;L;;;;;N;;;;; 1623;CANADIAN SYLLABICS CARRIER LO;Lo;0;L;;;;;N;;;;; 1624;CANADIAN SYLLABICS CARRIER LE;Lo;0;L;;;;;N;;;;; 1625;CANADIAN SYLLABICS CARRIER LEE;Lo;0;L;;;;;N;;;;; 1626;CANADIAN SYLLABICS CARRIER LI;Lo;0;L;;;;;N;;;;; 1627;CANADIAN SYLLABICS CARRIER LA;Lo;0;L;;;;;N;;;;; 1628;CANADIAN SYLLABICS CARRIER DLU;Lo;0;L;;;;;N;;;;; 1629;CANADIAN SYLLABICS CARRIER DLO;Lo;0;L;;;;;N;;;;; 162A;CANADIAN SYLLABICS CARRIER DLE;Lo;0;L;;;;;N;;;;; 162B;CANADIAN SYLLABICS CARRIER DLEE;Lo;0;L;;;;;N;;;;; 162C;CANADIAN SYLLABICS CARRIER DLI;Lo;0;L;;;;;N;;;;; 162D;CANADIAN SYLLABICS CARRIER DLA;Lo;0;L;;;;;N;;;;; 162E;CANADIAN SYLLABICS CARRIER LHU;Lo;0;L;;;;;N;;;;; 162F;CANADIAN SYLLABICS CARRIER LHO;Lo;0;L;;;;;N;;;;; 1630;CANADIAN SYLLABICS CARRIER LHE;Lo;0;L;;;;;N;;;;; 1631;CANADIAN SYLLABICS CARRIER LHEE;Lo;0;L;;;;;N;;;;; 1632;CANADIAN SYLLABICS CARRIER LHI;Lo;0;L;;;;;N;;;;; 1633;CANADIAN SYLLABICS CARRIER LHA;Lo;0;L;;;;;N;;;;; 1634;CANADIAN SYLLABICS CARRIER TLHU;Lo;0;L;;;;;N;;;;; 1635;CANADIAN SYLLABICS CARRIER TLHO;Lo;0;L;;;;;N;;;;; 1636;CANADIAN SYLLABICS CARRIER TLHE;Lo;0;L;;;;;N;;;;; 1637;CANADIAN SYLLABICS CARRIER TLHEE;Lo;0;L;;;;;N;;;;; 1638;CANADIAN SYLLABICS CARRIER TLHI;Lo;0;L;;;;;N;;;;; 1639;CANADIAN SYLLABICS CARRIER TLHA;Lo;0;L;;;;;N;;;;; 163A;CANADIAN SYLLABICS CARRIER TLU;Lo;0;L;;;;;N;;;;; 163B;CANADIAN SYLLABICS CARRIER TLO;Lo;0;L;;;;;N;;;;; 163C;CANADIAN SYLLABICS CARRIER TLE;Lo;0;L;;;;;N;;;;; 163D;CANADIAN SYLLABICS CARRIER TLEE;Lo;0;L;;;;;N;;;;; 163E;CANADIAN SYLLABICS CARRIER TLI;Lo;0;L;;;;;N;;;;; 163F;CANADIAN SYLLABICS CARRIER TLA;Lo;0;L;;;;;N;;;;; 1640;CANADIAN SYLLABICS CARRIER ZU;Lo;0;L;;;;;N;;;;; 1641;CANADIAN SYLLABICS CARRIER ZO;Lo;0;L;;;;;N;;;;; 1642;CANADIAN SYLLABICS CARRIER ZE;Lo;0;L;;;;;N;;;;; 1643;CANADIAN SYLLABICS CARRIER ZEE;Lo;0;L;;;;;N;;;;; 1644;CANADIAN SYLLABICS CARRIER ZI;Lo;0;L;;;;;N;;;;; 1645;CANADIAN SYLLABICS CARRIER ZA;Lo;0;L;;;;;N;;;;; 1646;CANADIAN SYLLABICS CARRIER Z;Lo;0;L;;;;;N;;;;; 1647;CANADIAN SYLLABICS CARRIER INITIAL Z;Lo;0;L;;;;;N;;;;; 1648;CANADIAN SYLLABICS CARRIER DZU;Lo;0;L;;;;;N;;;;; 1649;CANADIAN SYLLABICS CARRIER DZO;Lo;0;L;;;;;N;;;;; 164A;CANADIAN SYLLABICS CARRIER DZE;Lo;0;L;;;;;N;;;;; 164B;CANADIAN SYLLABICS CARRIER DZEE;Lo;0;L;;;;;N;;;;; 164C;CANADIAN SYLLABICS CARRIER DZI;Lo;0;L;;;;;N;;;;; 164D;CANADIAN SYLLABICS CARRIER DZA;Lo;0;L;;;;;N;;;;; 164E;CANADIAN SYLLABICS CARRIER SU;Lo;0;L;;;;;N;;;;; 164F;CANADIAN SYLLABICS CARRIER SO;Lo;0;L;;;;;N;;;;; 1650;CANADIAN SYLLABICS CARRIER SE;Lo;0;L;;;;;N;;;;; 1651;CANADIAN SYLLABICS CARRIER SEE;Lo;0;L;;;;;N;;;;; 1652;CANADIAN SYLLABICS CARRIER SI;Lo;0;L;;;;;N;;;;; 1653;CANADIAN SYLLABICS CARRIER SA;Lo;0;L;;;;;N;;;;; 1654;CANADIAN SYLLABICS CARRIER SHU;Lo;0;L;;;;;N;;;;; 1655;CANADIAN SYLLABICS CARRIER SHO;Lo;0;L;;;;;N;;;;; 1656;CANADIAN SYLLABICS CARRIER SHE;Lo;0;L;;;;;N;;;;; 1657;CANADIAN SYLLABICS CARRIER SHEE;Lo;0;L;;;;;N;;;;; 1658;CANADIAN SYLLABICS CARRIER SHI;Lo;0;L;;;;;N;;;;; 1659;CANADIAN SYLLABICS CARRIER SHA;Lo;0;L;;;;;N;;;;; 165A;CANADIAN SYLLABICS CARRIER SH;Lo;0;L;;;;;N;;;;; 165B;CANADIAN SYLLABICS CARRIER TSU;Lo;0;L;;;;;N;;;;; 165C;CANADIAN SYLLABICS CARRIER TSO;Lo;0;L;;;;;N;;;;; 165D;CANADIAN SYLLABICS CARRIER TSE;Lo;0;L;;;;;N;;;;; 165E;CANADIAN SYLLABICS CARRIER TSEE;Lo;0;L;;;;;N;;;;; 165F;CANADIAN SYLLABICS CARRIER TSI;Lo;0;L;;;;;N;;;;; 1660;CANADIAN SYLLABICS CARRIER TSA;Lo;0;L;;;;;N;;;;; 1661;CANADIAN SYLLABICS CARRIER CHU;Lo;0;L;;;;;N;;;;; 1662;CANADIAN SYLLABICS CARRIER CHO;Lo;0;L;;;;;N;;;;; 1663;CANADIAN SYLLABICS CARRIER CHE;Lo;0;L;;;;;N;;;;; 1664;CANADIAN SYLLABICS CARRIER CHEE;Lo;0;L;;;;;N;;;;; 1665;CANADIAN SYLLABICS CARRIER CHI;Lo;0;L;;;;;N;;;;; 1666;CANADIAN SYLLABICS CARRIER CHA;Lo;0;L;;;;;N;;;;; 1667;CANADIAN SYLLABICS CARRIER TTSU;Lo;0;L;;;;;N;;;;; 1668;CANADIAN SYLLABICS CARRIER TTSO;Lo;0;L;;;;;N;;;;; 1669;CANADIAN SYLLABICS CARRIER TTSE;Lo;0;L;;;;;N;;;;; 166A;CANADIAN SYLLABICS CARRIER TTSEE;Lo;0;L;;;;;N;;;;; 166B;CANADIAN SYLLABICS CARRIER TTSI;Lo;0;L;;;;;N;;;;; 166C;CANADIAN SYLLABICS CARRIER TTSA;Lo;0;L;;;;;N;;;;; 166D;CANADIAN SYLLABICS CHI SIGN;Po;0;L;;;;;N;;;;; 166E;CANADIAN SYLLABICS FULL STOP;Po;0;L;;;;;N;;;;; 166F;CANADIAN SYLLABICS QAI;Lo;0;L;;;;;N;;;;; 1670;CANADIAN SYLLABICS NGAI;Lo;0;L;;;;;N;;;;; 1671;CANADIAN SYLLABICS NNGI;Lo;0;L;;;;;N;;;;; 1672;CANADIAN SYLLABICS NNGII;Lo;0;L;;;;;N;;;;; 1673;CANADIAN SYLLABICS NNGO;Lo;0;L;;;;;N;;;;; 1674;CANADIAN SYLLABICS NNGOO;Lo;0;L;;;;;N;;;;; 1675;CANADIAN SYLLABICS NNGA;Lo;0;L;;;;;N;;;;; 1676;CANADIAN SYLLABICS NNGAA;Lo;0;L;;;;;N;;;;; 1677;CANADIAN SYLLABICS WOODS-CREE THWEE;Lo;0;L;;;;;N;;;;; 1678;CANADIAN SYLLABICS WOODS-CREE THWI;Lo;0;L;;;;;N;;;;; 1679;CANADIAN SYLLABICS WOODS-CREE THWII;Lo;0;L;;;;;N;;;;; 167A;CANADIAN SYLLABICS WOODS-CREE THWO;Lo;0;L;;;;;N;;;;; 167B;CANADIAN SYLLABICS WOODS-CREE THWOO;Lo;0;L;;;;;N;;;;; 167C;CANADIAN SYLLABICS WOODS-CREE THWA;Lo;0;L;;;;;N;;;;; 167D;CANADIAN SYLLABICS WOODS-CREE THWAA;Lo;0;L;;;;;N;;;;; 167E;CANADIAN SYLLABICS WOODS-CREE FINAL TH;Lo;0;L;;;;;N;;;;; 167F;CANADIAN SYLLABICS BLACKFOOT W;Lo;0;L;;;;;N;;;;; 1680;OGHAM SPACE MARK;Zs;0;WS;;;;;N;;;;; 1681;OGHAM LETTER BEITH;Lo;0;L;;;;;N;;;;; 1682;OGHAM LETTER LUIS;Lo;0;L;;;;;N;;;;; 1683;OGHAM LETTER FEARN;Lo;0;L;;;;;N;;;;; 1684;OGHAM LETTER SAIL;Lo;0;L;;;;;N;;;;; 1685;OGHAM LETTER NION;Lo;0;L;;;;;N;;;;; 1686;OGHAM LETTER UATH;Lo;0;L;;;;;N;;;;; 1687;OGHAM LETTER DAIR;Lo;0;L;;;;;N;;;;; 1688;OGHAM LETTER TINNE;Lo;0;L;;;;;N;;;;; 1689;OGHAM LETTER COLL;Lo;0;L;;;;;N;;;;; 168A;OGHAM LETTER CEIRT;Lo;0;L;;;;;N;;;;; 168B;OGHAM LETTER MUIN;Lo;0;L;;;;;N;;;;; 168C;OGHAM LETTER GORT;Lo;0;L;;;;;N;;;;; 168D;OGHAM LETTER NGEADAL;Lo;0;L;;;;;N;;;;; 168E;OGHAM LETTER STRAIF;Lo;0;L;;;;;N;;;;; 168F;OGHAM LETTER RUIS;Lo;0;L;;;;;N;;;;; 1690;OGHAM LETTER AILM;Lo;0;L;;;;;N;;;;; 1691;OGHAM LETTER ONN;Lo;0;L;;;;;N;;;;; 1692;OGHAM LETTER UR;Lo;0;L;;;;;N;;;;; 1693;OGHAM LETTER EADHADH;Lo;0;L;;;;;N;;;;; 1694;OGHAM LETTER IODHADH;Lo;0;L;;;;;N;;;;; 1695;OGHAM LETTER EABHADH;Lo;0;L;;;;;N;;;;; 1696;OGHAM LETTER OR;Lo;0;L;;;;;N;;;;; 1697;OGHAM LETTER UILLEANN;Lo;0;L;;;;;N;;;;; 1698;OGHAM LETTER IFIN;Lo;0;L;;;;;N;;;;; 1699;OGHAM LETTER EAMHANCHOLL;Lo;0;L;;;;;N;;;;; 169A;OGHAM LETTER PEITH;Lo;0;L;;;;;N;;;;; 169B;OGHAM FEATHER MARK;Ps;0;ON;;;;;Y;;;;; 169C;OGHAM REVERSED FEATHER MARK;Pe;0;ON;;;;;Y;;;;; 16A0;RUNIC LETTER FEHU FEOH FE F;Lo;0;L;;;;;N;;;;; 16A1;RUNIC LETTER V;Lo;0;L;;;;;N;;;;; 16A2;RUNIC LETTER URUZ UR U;Lo;0;L;;;;;N;;;;; 16A3;RUNIC LETTER YR;Lo;0;L;;;;;N;;;;; 16A4;RUNIC LETTER Y;Lo;0;L;;;;;N;;;;; 16A5;RUNIC LETTER W;Lo;0;L;;;;;N;;;;; 16A6;RUNIC LETTER THURISAZ THURS THORN;Lo;0;L;;;;;N;;;;; 16A7;RUNIC LETTER ETH;Lo;0;L;;;;;N;;;;; 16A8;RUNIC LETTER ANSUZ A;Lo;0;L;;;;;N;;;;; 16A9;RUNIC LETTER OS O;Lo;0;L;;;;;N;;;;; 16AA;RUNIC LETTER AC A;Lo;0;L;;;;;N;;;;; 16AB;RUNIC LETTER AESC;Lo;0;L;;;;;N;;;;; 16AC;RUNIC LETTER LONG-BRANCH-OSS O;Lo;0;L;;;;;N;;;;; 16AD;RUNIC LETTER SHORT-TWIG-OSS O;Lo;0;L;;;;;N;;;;; 16AE;RUNIC LETTER O;Lo;0;L;;;;;N;;;;; 16AF;RUNIC LETTER OE;Lo;0;L;;;;;N;;;;; 16B0;RUNIC LETTER ON;Lo;0;L;;;;;N;;;;; 16B1;RUNIC LETTER RAIDO RAD REID R;Lo;0;L;;;;;N;;;;; 16B2;RUNIC LETTER KAUNA;Lo;0;L;;;;;N;;;;; 16B3;RUNIC LETTER CEN;Lo;0;L;;;;;N;;;;; 16B4;RUNIC LETTER KAUN K;Lo;0;L;;;;;N;;;;; 16B5;RUNIC LETTER G;Lo;0;L;;;;;N;;;;; 16B6;RUNIC LETTER ENG;Lo;0;L;;;;;N;;;;; 16B7;RUNIC LETTER GEBO GYFU G;Lo;0;L;;;;;N;;;;; 16B8;RUNIC LETTER GAR;Lo;0;L;;;;;N;;;;; 16B9;RUNIC LETTER WUNJO WYNN W;Lo;0;L;;;;;N;;;;; 16BA;RUNIC LETTER HAGLAZ H;Lo;0;L;;;;;N;;;;; 16BB;RUNIC LETTER HAEGL H;Lo;0;L;;;;;N;;;;; 16BC;RUNIC LETTER LONG-BRANCH-HAGALL H;Lo;0;L;;;;;N;;;;; 16BD;RUNIC LETTER SHORT-TWIG-HAGALL H;Lo;0;L;;;;;N;;;;; 16BE;RUNIC LETTER NAUDIZ NYD NAUD N;Lo;0;L;;;;;N;;;;; 16BF;RUNIC LETTER SHORT-TWIG-NAUD N;Lo;0;L;;;;;N;;;;; 16C0;RUNIC LETTER DOTTED-N;Lo;0;L;;;;;N;;;;; 16C1;RUNIC LETTER ISAZ IS ISS I;Lo;0;L;;;;;N;;;;; 16C2;RUNIC LETTER E;Lo;0;L;;;;;N;;;;; 16C3;RUNIC LETTER JERAN J;Lo;0;L;;;;;N;;;;; 16C4;RUNIC LETTER GER;Lo;0;L;;;;;N;;;;; 16C5;RUNIC LETTER LONG-BRANCH-AR AE;Lo;0;L;;;;;N;;;;; 16C6;RUNIC LETTER SHORT-TWIG-AR A;Lo;0;L;;;;;N;;;;; 16C7;RUNIC LETTER IWAZ EOH;Lo;0;L;;;;;N;;;;; 16C8;RUNIC LETTER PERTHO PEORTH P;Lo;0;L;;;;;N;;;;; 16C9;RUNIC LETTER ALGIZ EOLHX;Lo;0;L;;;;;N;;;;; 16CA;RUNIC LETTER SOWILO S;Lo;0;L;;;;;N;;;;; 16CB;RUNIC LETTER SIGEL LONG-BRANCH-SOL S;Lo;0;L;;;;;N;;;;; 16CC;RUNIC LETTER SHORT-TWIG-SOL S;Lo;0;L;;;;;N;;;;; 16CD;RUNIC LETTER C;Lo;0;L;;;;;N;;;;; 16CE;RUNIC LETTER Z;Lo;0;L;;;;;N;;;;; 16CF;RUNIC LETTER TIWAZ TIR TYR T;Lo;0;L;;;;;N;;;;; 16D0;RUNIC LETTER SHORT-TWIG-TYR T;Lo;0;L;;;;;N;;;;; 16D1;RUNIC LETTER D;Lo;0;L;;;;;N;;;;; 16D2;RUNIC LETTER BERKANAN BEORC BJARKAN B;Lo;0;L;;;;;N;;;;; 16D3;RUNIC LETTER SHORT-TWIG-BJARKAN B;Lo;0;L;;;;;N;;;;; 16D4;RUNIC LETTER DOTTED-P;Lo;0;L;;;;;N;;;;; 16D5;RUNIC LETTER OPEN-P;Lo;0;L;;;;;N;;;;; 16D6;RUNIC LETTER EHWAZ EH E;Lo;0;L;;;;;N;;;;; 16D7;RUNIC LETTER MANNAZ MAN M;Lo;0;L;;;;;N;;;;; 16D8;RUNIC LETTER LONG-BRANCH-MADR M;Lo;0;L;;;;;N;;;;; 16D9;RUNIC LETTER SHORT-TWIG-MADR M;Lo;0;L;;;;;N;;;;; 16DA;RUNIC LETTER LAUKAZ LAGU LOGR L;Lo;0;L;;;;;N;;;;; 16DB;RUNIC LETTER DOTTED-L;Lo;0;L;;;;;N;;;;; 16DC;RUNIC LETTER INGWAZ;Lo;0;L;;;;;N;;;;; 16DD;RUNIC LETTER ING;Lo;0;L;;;;;N;;;;; 16DE;RUNIC LETTER DAGAZ DAEG D;Lo;0;L;;;;;N;;;;; 16DF;RUNIC LETTER OTHALAN ETHEL O;Lo;0;L;;;;;N;;;;; 16E0;RUNIC LETTER EAR;Lo;0;L;;;;;N;;;;; 16E1;RUNIC LETTER IOR;Lo;0;L;;;;;N;;;;; 16E2;RUNIC LETTER CWEORTH;Lo;0;L;;;;;N;;;;; 16E3;RUNIC LETTER CALC;Lo;0;L;;;;;N;;;;; 16E4;RUNIC LETTER CEALC;Lo;0;L;;;;;N;;;;; 16E5;RUNIC LETTER STAN;Lo;0;L;;;;;N;;;;; 16E6;RUNIC LETTER LONG-BRANCH-YR;Lo;0;L;;;;;N;;;;; 16E7;RUNIC LETTER SHORT-TWIG-YR;Lo;0;L;;;;;N;;;;; 16E8;RUNIC LETTER ICELANDIC-YR;Lo;0;L;;;;;N;;;;; 16E9;RUNIC LETTER Q;Lo;0;L;;;;;N;;;;; 16EA;RUNIC LETTER X;Lo;0;L;;;;;N;;;;; 16EB;RUNIC SINGLE PUNCTUATION;Po;0;L;;;;;N;;;;; 16EC;RUNIC MULTIPLE PUNCTUATION;Po;0;L;;;;;N;;;;; 16ED;RUNIC CROSS PUNCTUATION;Po;0;L;;;;;N;;;;; 16EE;RUNIC ARLAUG SYMBOL;Nl;0;L;;;;17;N;;;;; 16EF;RUNIC TVIMADUR SYMBOL;Nl;0;L;;;;18;N;;;;; 16F0;RUNIC BELGTHOR SYMBOL;Nl;0;L;;;;19;N;;;;; 1700;TAGALOG LETTER A;Lo;0;L;;;;;N;;;;; 1701;TAGALOG LETTER I;Lo;0;L;;;;;N;;;;; 1702;TAGALOG LETTER U;Lo;0;L;;;;;N;;;;; 1703;TAGALOG LETTER KA;Lo;0;L;;;;;N;;;;; 1704;TAGALOG LETTER GA;Lo;0;L;;;;;N;;;;; 1705;TAGALOG LETTER NGA;Lo;0;L;;;;;N;;;;; 1706;TAGALOG LETTER TA;Lo;0;L;;;;;N;;;;; 1707;TAGALOG LETTER DA;Lo;0;L;;;;;N;;;;; 1708;TAGALOG LETTER NA;Lo;0;L;;;;;N;;;;; 1709;TAGALOG LETTER PA;Lo;0;L;;;;;N;;;;; 170A;TAGALOG LETTER BA;Lo;0;L;;;;;N;;;;; 170B;TAGALOG LETTER MA;Lo;0;L;;;;;N;;;;; 170C;TAGALOG LETTER YA;Lo;0;L;;;;;N;;;;; 170E;TAGALOG LETTER LA;Lo;0;L;;;;;N;;;;; 170F;TAGALOG LETTER WA;Lo;0;L;;;;;N;;;;; 1710;TAGALOG LETTER SA;Lo;0;L;;;;;N;;;;; 1711;TAGALOG LETTER HA;Lo;0;L;;;;;N;;;;; 1712;TAGALOG VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 1713;TAGALOG VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 1714;TAGALOG SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 1720;HANUNOO LETTER A;Lo;0;L;;;;;N;;;;; 1721;HANUNOO LETTER I;Lo;0;L;;;;;N;;;;; 1722;HANUNOO LETTER U;Lo;0;L;;;;;N;;;;; 1723;HANUNOO LETTER KA;Lo;0;L;;;;;N;;;;; 1724;HANUNOO LETTER GA;Lo;0;L;;;;;N;;;;; 1725;HANUNOO LETTER NGA;Lo;0;L;;;;;N;;;;; 1726;HANUNOO LETTER TA;Lo;0;L;;;;;N;;;;; 1727;HANUNOO LETTER DA;Lo;0;L;;;;;N;;;;; 1728;HANUNOO LETTER NA;Lo;0;L;;;;;N;;;;; 1729;HANUNOO LETTER PA;Lo;0;L;;;;;N;;;;; 172A;HANUNOO LETTER BA;Lo;0;L;;;;;N;;;;; 172B;HANUNOO LETTER MA;Lo;0;L;;;;;N;;;;; 172C;HANUNOO LETTER YA;Lo;0;L;;;;;N;;;;; 172D;HANUNOO LETTER RA;Lo;0;L;;;;;N;;;;; 172E;HANUNOO LETTER LA;Lo;0;L;;;;;N;;;;; 172F;HANUNOO LETTER WA;Lo;0;L;;;;;N;;;;; 1730;HANUNOO LETTER SA;Lo;0;L;;;;;N;;;;; 1731;HANUNOO LETTER HA;Lo;0;L;;;;;N;;;;; 1732;HANUNOO VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 1733;HANUNOO VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 1734;HANUNOO SIGN PAMUDPOD;Mn;9;NSM;;;;;N;;;;; 1735;PHILIPPINE SINGLE PUNCTUATION;Po;0;L;;;;;N;;;;; 1736;PHILIPPINE DOUBLE PUNCTUATION;Po;0;L;;;;;N;;;;; 1740;BUHID LETTER A;Lo;0;L;;;;;N;;;;; 1741;BUHID LETTER I;Lo;0;L;;;;;N;;;;; 1742;BUHID LETTER U;Lo;0;L;;;;;N;;;;; 1743;BUHID LETTER KA;Lo;0;L;;;;;N;;;;; 1744;BUHID LETTER GA;Lo;0;L;;;;;N;;;;; 1745;BUHID LETTER NGA;Lo;0;L;;;;;N;;;;; 1746;BUHID LETTER TA;Lo;0;L;;;;;N;;;;; 1747;BUHID LETTER DA;Lo;0;L;;;;;N;;;;; 1748;BUHID LETTER NA;Lo;0;L;;;;;N;;;;; 1749;BUHID LETTER PA;Lo;0;L;;;;;N;;;;; 174A;BUHID LETTER BA;Lo;0;L;;;;;N;;;;; 174B;BUHID LETTER MA;Lo;0;L;;;;;N;;;;; 174C;BUHID LETTER YA;Lo;0;L;;;;;N;;;;; 174D;BUHID LETTER RA;Lo;0;L;;;;;N;;;;; 174E;BUHID LETTER LA;Lo;0;L;;;;;N;;;;; 174F;BUHID LETTER WA;Lo;0;L;;;;;N;;;;; 1750;BUHID LETTER SA;Lo;0;L;;;;;N;;;;; 1751;BUHID LETTER HA;Lo;0;L;;;;;N;;;;; 1752;BUHID VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 1753;BUHID VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 1760;TAGBANWA LETTER A;Lo;0;L;;;;;N;;;;; 1761;TAGBANWA LETTER I;Lo;0;L;;;;;N;;;;; 1762;TAGBANWA LETTER U;Lo;0;L;;;;;N;;;;; 1763;TAGBANWA LETTER KA;Lo;0;L;;;;;N;;;;; 1764;TAGBANWA LETTER GA;Lo;0;L;;;;;N;;;;; 1765;TAGBANWA LETTER NGA;Lo;0;L;;;;;N;;;;; 1766;TAGBANWA LETTER TA;Lo;0;L;;;;;N;;;;; 1767;TAGBANWA LETTER DA;Lo;0;L;;;;;N;;;;; 1768;TAGBANWA LETTER NA;Lo;0;L;;;;;N;;;;; 1769;TAGBANWA LETTER PA;Lo;0;L;;;;;N;;;;; 176A;TAGBANWA LETTER BA;Lo;0;L;;;;;N;;;;; 176B;TAGBANWA LETTER MA;Lo;0;L;;;;;N;;;;; 176C;TAGBANWA LETTER YA;Lo;0;L;;;;;N;;;;; 176E;TAGBANWA LETTER LA;Lo;0;L;;;;;N;;;;; 176F;TAGBANWA LETTER WA;Lo;0;L;;;;;N;;;;; 1770;TAGBANWA LETTER SA;Lo;0;L;;;;;N;;;;; 1772;TAGBANWA VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 1773;TAGBANWA VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 1780;KHMER LETTER KA;Lo;0;L;;;;;N;;;;; 1781;KHMER LETTER KHA;Lo;0;L;;;;;N;;;;; 1782;KHMER LETTER KO;Lo;0;L;;;;;N;;;;; 1783;KHMER LETTER KHO;Lo;0;L;;;;;N;;;;; 1784;KHMER LETTER NGO;Lo;0;L;;;;;N;;;;; 1785;KHMER LETTER CA;Lo;0;L;;;;;N;;;;; 1786;KHMER LETTER CHA;Lo;0;L;;;;;N;;;;; 1787;KHMER LETTER CO;Lo;0;L;;;;;N;;;;; 1788;KHMER LETTER CHO;Lo;0;L;;;;;N;;;;; 1789;KHMER LETTER NYO;Lo;0;L;;;;;N;;;;; 178A;KHMER LETTER DA;Lo;0;L;;;;;N;;;;; 178B;KHMER LETTER TTHA;Lo;0;L;;;;;N;;;;; 178C;KHMER LETTER DO;Lo;0;L;;;;;N;;;;; 178D;KHMER LETTER TTHO;Lo;0;L;;;;;N;;;;; 178E;KHMER LETTER NNO;Lo;0;L;;;;;N;;;;; 178F;KHMER LETTER TA;Lo;0;L;;;;;N;;;;; 1790;KHMER LETTER THA;Lo;0;L;;;;;N;;;;; 1791;KHMER LETTER TO;Lo;0;L;;;;;N;;;;; 1792;KHMER LETTER THO;Lo;0;L;;;;;N;;;;; 1793;KHMER LETTER NO;Lo;0;L;;;;;N;;;;; 1794;KHMER LETTER BA;Lo;0;L;;;;;N;;;;; 1795;KHMER LETTER PHA;Lo;0;L;;;;;N;;;;; 1796;KHMER LETTER PO;Lo;0;L;;;;;N;;;;; 1797;KHMER LETTER PHO;Lo;0;L;;;;;N;;;;; 1798;KHMER LETTER MO;Lo;0;L;;;;;N;;;;; 1799;KHMER LETTER YO;Lo;0;L;;;;;N;;;;; 179A;KHMER LETTER RO;Lo;0;L;;;;;N;;;;; 179B;KHMER LETTER LO;Lo;0;L;;;;;N;;;;; 179C;KHMER LETTER VO;Lo;0;L;;;;;N;;;;; 179D;KHMER LETTER SHA;Lo;0;L;;;;;N;;;;; 179E;KHMER LETTER SSO;Lo;0;L;;;;;N;;;;; 179F;KHMER LETTER SA;Lo;0;L;;;;;N;;;;; 17A0;KHMER LETTER HA;Lo;0;L;;;;;N;;;;; 17A1;KHMER LETTER LA;Lo;0;L;;;;;N;;;;; 17A2;KHMER LETTER QA;Lo;0;L;;;;;N;;;;; 17A3;KHMER INDEPENDENT VOWEL QAQ;Lo;0;L;;;;;N;;;;; 17A4;KHMER INDEPENDENT VOWEL QAA;Lo;0;L;;;;;N;;;;; 17A5;KHMER INDEPENDENT VOWEL QI;Lo;0;L;;;;;N;;;;; 17A6;KHMER INDEPENDENT VOWEL QII;Lo;0;L;;;;;N;;;;; 17A7;KHMER INDEPENDENT VOWEL QU;Lo;0;L;;;;;N;;;;; 17A8;KHMER INDEPENDENT VOWEL QUK;Lo;0;L;;;;;N;;;;; 17A9;KHMER INDEPENDENT VOWEL QUU;Lo;0;L;;;;;N;;;;; 17AA;KHMER INDEPENDENT VOWEL QUUV;Lo;0;L;;;;;N;;;;; 17AB;KHMER INDEPENDENT VOWEL RY;Lo;0;L;;;;;N;;;;; 17AC;KHMER INDEPENDENT VOWEL RYY;Lo;0;L;;;;;N;;;;; 17AD;KHMER INDEPENDENT VOWEL LY;Lo;0;L;;;;;N;;;;; 17AE;KHMER INDEPENDENT VOWEL LYY;Lo;0;L;;;;;N;;;;; 17AF;KHMER INDEPENDENT VOWEL QE;Lo;0;L;;;;;N;;;;; 17B0;KHMER INDEPENDENT VOWEL QAI;Lo;0;L;;;;;N;;;;; 17B1;KHMER INDEPENDENT VOWEL QOO TYPE ONE;Lo;0;L;;;;;N;;;;; 17B2;KHMER INDEPENDENT VOWEL QOO TYPE TWO;Lo;0;L;;;;;N;;;;; 17B3;KHMER INDEPENDENT VOWEL QAU;Lo;0;L;;;;;N;;;;; 17B4;KHMER VOWEL INHERENT AQ;Mn;0;NSM;;;;;N;;;;; 17B5;KHMER VOWEL INHERENT AA;Mn;0;NSM;;;;;N;;;;; 17B6;KHMER VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 17B7;KHMER VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 17B8;KHMER VOWEL SIGN II;Mn;0;NSM;;;;;N;;;;; 17B9;KHMER VOWEL SIGN Y;Mn;0;NSM;;;;;N;;;;; 17BA;KHMER VOWEL SIGN YY;Mn;0;NSM;;;;;N;;;;; 17BB;KHMER VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 17BC;KHMER VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 17BD;KHMER VOWEL SIGN UA;Mn;0;NSM;;;;;N;;;;; 17BE;KHMER VOWEL SIGN OE;Mc;0;L;;;;;N;;;;; 17BF;KHMER VOWEL SIGN YA;Mc;0;L;;;;;N;;;;; 17C0;KHMER VOWEL SIGN IE;Mc;0;L;;;;;N;;;;; 17C1;KHMER VOWEL SIGN E;Mc;0;L;;;;;N;;;;; 17C2;KHMER VOWEL SIGN AE;Mc;0;L;;;;;N;;;;; 17C3;KHMER VOWEL SIGN AI;Mc;0;L;;;;;N;;;;; 17C4;KHMER VOWEL SIGN OO;Mc;0;L;;;;;N;;;;; 17C5;KHMER VOWEL SIGN AU;Mc;0;L;;;;;N;;;;; 17C6;KHMER SIGN NIKAHIT;Mn;0;NSM;;;;;N;;;;; 17C7;KHMER SIGN REAHMUK;Mc;0;L;;;;;N;;;;; 17C8;KHMER SIGN YUUKALEAPINTU;Mc;0;L;;;;;N;;;;; 17C9;KHMER SIGN MUUSIKATOAN;Mn;0;NSM;;;;;N;;;;; 17CA;KHMER SIGN TRIISAP;Mn;0;NSM;;;;;N;;;;; 17CB;KHMER SIGN BANTOC;Mn;0;NSM;;;;;N;;;;; 17CC;KHMER SIGN ROBAT;Mn;0;NSM;;;;;N;;;;; 17CD;KHMER SIGN TOANDAKHIAT;Mn;0;NSM;;;;;N;;;;; 17CE;KHMER SIGN KAKABAT;Mn;0;NSM;;;;;N;;;;; 17CF;KHMER SIGN AHSDA;Mn;0;NSM;;;;;N;;;;; 17D0;KHMER SIGN SAMYOK SANNYA;Mn;0;NSM;;;;;N;;;;; 17D1;KHMER SIGN VIRIAM;Mn;0;NSM;;;;;N;;;;; 17D2;KHMER SIGN COENG;Mn;9;NSM;;;;;N;;;;; 17D3;KHMER SIGN BATHAMASAT;Mn;0;NSM;;;;;N;;;;; 17D4;KHMER SIGN KHAN;Po;0;L;;;;;N;;;;; 17D5;KHMER SIGN BARIYOOSAN;Po;0;L;;;;;N;;;;; 17D6;KHMER SIGN CAMNUC PII KUUH;Po;0;L;;;;;N;;;;; 17D7;KHMER SIGN LEK TOO;Lm;0;L;;;;;N;;;;; 17D8;KHMER SIGN BEYYAL;Po;0;L;;;;;N;;;;; 17D9;KHMER SIGN PHNAEK MUAN;Po;0;L;;;;;N;;;;; 17DA;KHMER SIGN KOOMUUT;Po;0;L;;;;;N;;;;; 17DB;KHMER CURRENCY SYMBOL RIEL;Sc;0;ET;;;;;N;;;;; 17DC;KHMER SIGN AVAKRAHASANYA;Lo;0;L;;;;;N;;;;; 17DD;KHMER SIGN ATTHACAN;Mn;230;NSM;;;;;N;;;;; 17E0;KHMER DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 17E1;KHMER DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 17E2;KHMER DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 17E3;KHMER DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 17E4;KHMER DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 17E5;KHMER DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 17E6;KHMER DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 17E7;KHMER DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 17E8;KHMER DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 17E9;KHMER DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 17F0;KHMER SYMBOL LEK ATTAK SON;No;0;ON;;;;0;N;;;;; 17F1;KHMER SYMBOL LEK ATTAK MUOY;No;0;ON;;;;1;N;;;;; 17F2;KHMER SYMBOL LEK ATTAK PII;No;0;ON;;;;2;N;;;;; 17F3;KHMER SYMBOL LEK ATTAK BEI;No;0;ON;;;;3;N;;;;; 17F4;KHMER SYMBOL LEK ATTAK BUON;No;0;ON;;;;4;N;;;;; 17F5;KHMER SYMBOL LEK ATTAK PRAM;No;0;ON;;;;5;N;;;;; 17F6;KHMER SYMBOL LEK ATTAK PRAM-MUOY;No;0;ON;;;;6;N;;;;; 17F7;KHMER SYMBOL LEK ATTAK PRAM-PII;No;0;ON;;;;7;N;;;;; 17F8;KHMER SYMBOL LEK ATTAK PRAM-BEI;No;0;ON;;;;8;N;;;;; 17F9;KHMER SYMBOL LEK ATTAK PRAM-BUON;No;0;ON;;;;9;N;;;;; 1800;MONGOLIAN BIRGA;Po;0;ON;;;;;N;;;;; 1801;MONGOLIAN ELLIPSIS;Po;0;ON;;;;;N;;;;; 1802;MONGOLIAN COMMA;Po;0;ON;;;;;N;;;;; 1803;MONGOLIAN FULL STOP;Po;0;ON;;;;;N;;;;; 1804;MONGOLIAN COLON;Po;0;ON;;;;;N;;;;; 1805;MONGOLIAN FOUR DOTS;Po;0;ON;;;;;N;;;;; 1806;MONGOLIAN TODO SOFT HYPHEN;Pd;0;ON;;;;;N;;;;; 1807;MONGOLIAN SIBE SYLLABLE BOUNDARY MARKER;Po;0;ON;;;;;N;;;;; 1808;MONGOLIAN MANCHU COMMA;Po;0;ON;;;;;N;;;;; 1809;MONGOLIAN MANCHU FULL STOP;Po;0;ON;;;;;N;;;;; 180A;MONGOLIAN NIRUGU;Po;0;ON;;;;;N;;;;; 180B;MONGOLIAN FREE VARIATION SELECTOR ONE;Mn;0;NSM;;;;;N;;;;; 180C;MONGOLIAN FREE VARIATION SELECTOR TWO;Mn;0;NSM;;;;;N;;;;; 180D;MONGOLIAN FREE VARIATION SELECTOR THREE;Mn;0;NSM;;;;;N;;;;; 180E;MONGOLIAN VOWEL SEPARATOR;Zs;0;WS;;;;;N;;;;; 1810;MONGOLIAN DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 1811;MONGOLIAN DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 1812;MONGOLIAN DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 1813;MONGOLIAN DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 1814;MONGOLIAN DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 1815;MONGOLIAN DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 1816;MONGOLIAN DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 1817;MONGOLIAN DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 1818;MONGOLIAN DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 1819;MONGOLIAN DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 1820;MONGOLIAN LETTER A;Lo;0;L;;;;;N;;;;; 1821;MONGOLIAN LETTER E;Lo;0;L;;;;;N;;;;; 1822;MONGOLIAN LETTER I;Lo;0;L;;;;;N;;;;; 1823;MONGOLIAN LETTER O;Lo;0;L;;;;;N;;;;; 1824;MONGOLIAN LETTER U;Lo;0;L;;;;;N;;;;; 1825;MONGOLIAN LETTER OE;Lo;0;L;;;;;N;;;;; 1826;MONGOLIAN LETTER UE;Lo;0;L;;;;;N;;;;; 1827;MONGOLIAN LETTER EE;Lo;0;L;;;;;N;;;;; 1828;MONGOLIAN LETTER NA;Lo;0;L;;;;;N;;;;; 1829;MONGOLIAN LETTER ANG;Lo;0;L;;;;;N;;;;; 182A;MONGOLIAN LETTER BA;Lo;0;L;;;;;N;;;;; 182B;MONGOLIAN LETTER PA;Lo;0;L;;;;;N;;;;; 182C;MONGOLIAN LETTER QA;Lo;0;L;;;;;N;;;;; 182D;MONGOLIAN LETTER GA;Lo;0;L;;;;;N;;;;; 182E;MONGOLIAN LETTER MA;Lo;0;L;;;;;N;;;;; 182F;MONGOLIAN LETTER LA;Lo;0;L;;;;;N;;;;; 1830;MONGOLIAN LETTER SA;Lo;0;L;;;;;N;;;;; 1831;MONGOLIAN LETTER SHA;Lo;0;L;;;;;N;;;;; 1832;MONGOLIAN LETTER TA;Lo;0;L;;;;;N;;;;; 1833;MONGOLIAN LETTER DA;Lo;0;L;;;;;N;;;;; 1834;MONGOLIAN LETTER CHA;Lo;0;L;;;;;N;;;;; 1835;MONGOLIAN LETTER JA;Lo;0;L;;;;;N;;;;; 1836;MONGOLIAN LETTER YA;Lo;0;L;;;;;N;;;;; 1837;MONGOLIAN LETTER RA;Lo;0;L;;;;;N;;;;; 1838;MONGOLIAN LETTER WA;Lo;0;L;;;;;N;;;;; 1839;MONGOLIAN LETTER FA;Lo;0;L;;;;;N;;;;; 183A;MONGOLIAN LETTER KA;Lo;0;L;;;;;N;;;;; 183B;MONGOLIAN LETTER KHA;Lo;0;L;;;;;N;;;;; 183C;MONGOLIAN LETTER TSA;Lo;0;L;;;;;N;;;;; 183D;MONGOLIAN LETTER ZA;Lo;0;L;;;;;N;;;;; 183E;MONGOLIAN LETTER HAA;Lo;0;L;;;;;N;;;;; 183F;MONGOLIAN LETTER ZRA;Lo;0;L;;;;;N;;;;; 1840;MONGOLIAN LETTER LHA;Lo;0;L;;;;;N;;;;; 1841;MONGOLIAN LETTER ZHI;Lo;0;L;;;;;N;;;;; 1842;MONGOLIAN LETTER CHI;Lo;0;L;;;;;N;;;;; 1843;MONGOLIAN LETTER TODO LONG VOWEL SIGN;Lm;0;L;;;;;N;;;;; 1844;MONGOLIAN LETTER TODO E;Lo;0;L;;;;;N;;;;; 1845;MONGOLIAN LETTER TODO I;Lo;0;L;;;;;N;;;;; 1846;MONGOLIAN LETTER TODO O;Lo;0;L;;;;;N;;;;; 1847;MONGOLIAN LETTER TODO U;Lo;0;L;;;;;N;;;;; 1848;MONGOLIAN LETTER TODO OE;Lo;0;L;;;;;N;;;;; 1849;MONGOLIAN LETTER TODO UE;Lo;0;L;;;;;N;;;;; 184A;MONGOLIAN LETTER TODO ANG;Lo;0;L;;;;;N;;;;; 184B;MONGOLIAN LETTER TODO BA;Lo;0;L;;;;;N;;;;; 184C;MONGOLIAN LETTER TODO PA;Lo;0;L;;;;;N;;;;; 184D;MONGOLIAN LETTER TODO QA;Lo;0;L;;;;;N;;;;; 184E;MONGOLIAN LETTER TODO GA;Lo;0;L;;;;;N;;;;; 184F;MONGOLIAN LETTER TODO MA;Lo;0;L;;;;;N;;;;; 1850;MONGOLIAN LETTER TODO TA;Lo;0;L;;;;;N;;;;; 1851;MONGOLIAN LETTER TODO DA;Lo;0;L;;;;;N;;;;; 1852;MONGOLIAN LETTER TODO CHA;Lo;0;L;;;;;N;;;;; 1853;MONGOLIAN LETTER TODO JA;Lo;0;L;;;;;N;;;;; 1854;MONGOLIAN LETTER TODO TSA;Lo;0;L;;;;;N;;;;; 1855;MONGOLIAN LETTER TODO YA;Lo;0;L;;;;;N;;;;; 1856;MONGOLIAN LETTER TODO WA;Lo;0;L;;;;;N;;;;; 1857;MONGOLIAN LETTER TODO KA;Lo;0;L;;;;;N;;;;; 1858;MONGOLIAN LETTER TODO GAA;Lo;0;L;;;;;N;;;;; 1859;MONGOLIAN LETTER TODO HAA;Lo;0;L;;;;;N;;;;; 185A;MONGOLIAN LETTER TODO JIA;Lo;0;L;;;;;N;;;;; 185B;MONGOLIAN LETTER TODO NIA;Lo;0;L;;;;;N;;;;; 185C;MONGOLIAN LETTER TODO DZA;Lo;0;L;;;;;N;;;;; 185D;MONGOLIAN LETTER SIBE E;Lo;0;L;;;;;N;;;;; 185E;MONGOLIAN LETTER SIBE I;Lo;0;L;;;;;N;;;;; 185F;MONGOLIAN LETTER SIBE IY;Lo;0;L;;;;;N;;;;; 1860;MONGOLIAN LETTER SIBE UE;Lo;0;L;;;;;N;;;;; 1861;MONGOLIAN LETTER SIBE U;Lo;0;L;;;;;N;;;;; 1862;MONGOLIAN LETTER SIBE ANG;Lo;0;L;;;;;N;;;;; 1863;MONGOLIAN LETTER SIBE KA;Lo;0;L;;;;;N;;;;; 1864;MONGOLIAN LETTER SIBE GA;Lo;0;L;;;;;N;;;;; 1865;MONGOLIAN LETTER SIBE HA;Lo;0;L;;;;;N;;;;; 1866;MONGOLIAN LETTER SIBE PA;Lo;0;L;;;;;N;;;;; 1867;MONGOLIAN LETTER SIBE SHA;Lo;0;L;;;;;N;;;;; 1868;MONGOLIAN LETTER SIBE TA;Lo;0;L;;;;;N;;;;; 1869;MONGOLIAN LETTER SIBE DA;Lo;0;L;;;;;N;;;;; 186A;MONGOLIAN LETTER SIBE JA;Lo;0;L;;;;;N;;;;; 186B;MONGOLIAN LETTER SIBE FA;Lo;0;L;;;;;N;;;;; 186C;MONGOLIAN LETTER SIBE GAA;Lo;0;L;;;;;N;;;;; 186D;MONGOLIAN LETTER SIBE HAA;Lo;0;L;;;;;N;;;;; 186E;MONGOLIAN LETTER SIBE TSA;Lo;0;L;;;;;N;;;;; 186F;MONGOLIAN LETTER SIBE ZA;Lo;0;L;;;;;N;;;;; 1870;MONGOLIAN LETTER SIBE RAA;Lo;0;L;;;;;N;;;;; 1871;MONGOLIAN LETTER SIBE CHA;Lo;0;L;;;;;N;;;;; 1872;MONGOLIAN LETTER SIBE ZHA;Lo;0;L;;;;;N;;;;; 1873;MONGOLIAN LETTER MANCHU I;Lo;0;L;;;;;N;;;;; 1874;MONGOLIAN LETTER MANCHU KA;Lo;0;L;;;;;N;;;;; 1875;MONGOLIAN LETTER MANCHU RA;Lo;0;L;;;;;N;;;;; 1876;MONGOLIAN LETTER MANCHU FA;Lo;0;L;;;;;N;;;;; 1877;MONGOLIAN LETTER MANCHU ZHA;Lo;0;L;;;;;N;;;;; 1880;MONGOLIAN LETTER ALI GALI ANUSVARA ONE;Lo;0;L;;;;;N;;;;; 1881;MONGOLIAN LETTER ALI GALI VISARGA ONE;Lo;0;L;;;;;N;;;;; 1882;MONGOLIAN LETTER ALI GALI DAMARU;Lo;0;L;;;;;N;;;;; 1883;MONGOLIAN LETTER ALI GALI UBADAMA;Lo;0;L;;;;;N;;;;; 1884;MONGOLIAN LETTER ALI GALI INVERTED UBADAMA;Lo;0;L;;;;;N;;;;; 1885;MONGOLIAN LETTER ALI GALI BALUDA;Lo;0;L;;;;;N;;;;; 1886;MONGOLIAN LETTER ALI GALI THREE BALUDA;Lo;0;L;;;;;N;;;;; 1887;MONGOLIAN LETTER ALI GALI A;Lo;0;L;;;;;N;;;;; 1888;MONGOLIAN LETTER ALI GALI I;Lo;0;L;;;;;N;;;;; 1889;MONGOLIAN LETTER ALI GALI KA;Lo;0;L;;;;;N;;;;; 188A;MONGOLIAN LETTER ALI GALI NGA;Lo;0;L;;;;;N;;;;; 188B;MONGOLIAN LETTER ALI GALI CA;Lo;0;L;;;;;N;;;;; 188C;MONGOLIAN LETTER ALI GALI TTA;Lo;0;L;;;;;N;;;;; 188D;MONGOLIAN LETTER ALI GALI TTHA;Lo;0;L;;;;;N;;;;; 188E;MONGOLIAN LETTER ALI GALI DDA;Lo;0;L;;;;;N;;;;; 188F;MONGOLIAN LETTER ALI GALI NNA;Lo;0;L;;;;;N;;;;; 1890;MONGOLIAN LETTER ALI GALI TA;Lo;0;L;;;;;N;;;;; 1891;MONGOLIAN LETTER ALI GALI DA;Lo;0;L;;;;;N;;;;; 1892;MONGOLIAN LETTER ALI GALI PA;Lo;0;L;;;;;N;;;;; 1893;MONGOLIAN LETTER ALI GALI PHA;Lo;0;L;;;;;N;;;;; 1894;MONGOLIAN LETTER ALI GALI SSA;Lo;0;L;;;;;N;;;;; 1895;MONGOLIAN LETTER ALI GALI ZHA;Lo;0;L;;;;;N;;;;; 1896;MONGOLIAN LETTER ALI GALI ZA;Lo;0;L;;;;;N;;;;; 1897;MONGOLIAN LETTER ALI GALI AH;Lo;0;L;;;;;N;;;;; 1898;MONGOLIAN LETTER TODO ALI GALI TA;Lo;0;L;;;;;N;;;;; 1899;MONGOLIAN LETTER TODO ALI GALI ZHA;Lo;0;L;;;;;N;;;;; 189A;MONGOLIAN LETTER MANCHU ALI GALI GHA;Lo;0;L;;;;;N;;;;; 189B;MONGOLIAN LETTER MANCHU ALI GALI NGA;Lo;0;L;;;;;N;;;;; 189C;MONGOLIAN LETTER MANCHU ALI GALI CA;Lo;0;L;;;;;N;;;;; 189D;MONGOLIAN LETTER MANCHU ALI GALI JHA;Lo;0;L;;;;;N;;;;; 189E;MONGOLIAN LETTER MANCHU ALI GALI TTA;Lo;0;L;;;;;N;;;;; 189F;MONGOLIAN LETTER MANCHU ALI GALI DDHA;Lo;0;L;;;;;N;;;;; 18A0;MONGOLIAN LETTER MANCHU ALI GALI TA;Lo;0;L;;;;;N;;;;; 18A1;MONGOLIAN LETTER MANCHU ALI GALI DHA;Lo;0;L;;;;;N;;;;; 18A2;MONGOLIAN LETTER MANCHU ALI GALI SSA;Lo;0;L;;;;;N;;;;; 18A3;MONGOLIAN LETTER MANCHU ALI GALI CYA;Lo;0;L;;;;;N;;;;; 18A4;MONGOLIAN LETTER MANCHU ALI GALI ZHA;Lo;0;L;;;;;N;;;;; 18A5;MONGOLIAN LETTER MANCHU ALI GALI ZA;Lo;0;L;;;;;N;;;;; 18A6;MONGOLIAN LETTER ALI GALI HALF U;Lo;0;L;;;;;N;;;;; 18A7;MONGOLIAN LETTER ALI GALI HALF YA;Lo;0;L;;;;;N;;;;; 18A8;MONGOLIAN LETTER MANCHU ALI GALI BHA;Lo;0;L;;;;;N;;;;; 18A9;MONGOLIAN LETTER ALI GALI DAGALGA;Mn;228;NSM;;;;;N;;;;; 18AA;MONGOLIAN LETTER MANCHU ALI GALI LHA;Lo;0;L;;;;;N;;;;; 18B0;CANADIAN SYLLABICS OY;Lo;0;L;;;;;N;;;;; 18B1;CANADIAN SYLLABICS AY;Lo;0;L;;;;;N;;;;; 18B2;CANADIAN SYLLABICS AAY;Lo;0;L;;;;;N;;;;; 18B3;CANADIAN SYLLABICS WAY;Lo;0;L;;;;;N;;;;; 18B4;CANADIAN SYLLABICS POY;Lo;0;L;;;;;N;;;;; 18B5;CANADIAN SYLLABICS PAY;Lo;0;L;;;;;N;;;;; 18B6;CANADIAN SYLLABICS PWOY;Lo;0;L;;;;;N;;;;; 18B7;CANADIAN SYLLABICS TAY;Lo;0;L;;;;;N;;;;; 18B8;CANADIAN SYLLABICS KAY;Lo;0;L;;;;;N;;;;; 18B9;CANADIAN SYLLABICS KWAY;Lo;0;L;;;;;N;;;;; 18BA;CANADIAN SYLLABICS MAY;Lo;0;L;;;;;N;;;;; 18BB;CANADIAN SYLLABICS NOY;Lo;0;L;;;;;N;;;;; 18BC;CANADIAN SYLLABICS NAY;Lo;0;L;;;;;N;;;;; 18BD;CANADIAN SYLLABICS LAY;Lo;0;L;;;;;N;;;;; 18BE;CANADIAN SYLLABICS SOY;Lo;0;L;;;;;N;;;;; 18BF;CANADIAN SYLLABICS SAY;Lo;0;L;;;;;N;;;;; 18C0;CANADIAN SYLLABICS SHOY;Lo;0;L;;;;;N;;;;; 18C1;CANADIAN SYLLABICS SHAY;Lo;0;L;;;;;N;;;;; 18C2;CANADIAN SYLLABICS SHWOY;Lo;0;L;;;;;N;;;;; 18C3;CANADIAN SYLLABICS YOY;Lo;0;L;;;;;N;;;;; 18C4;CANADIAN SYLLABICS YAY;Lo;0;L;;;;;N;;;;; 18C5;CANADIAN SYLLABICS RAY;Lo;0;L;;;;;N;;;;; 18C6;CANADIAN SYLLABICS NWI;Lo;0;L;;;;;N;;;;; 18C7;CANADIAN SYLLABICS OJIBWAY NWI;Lo;0;L;;;;;N;;;;; 18C8;CANADIAN SYLLABICS NWII;Lo;0;L;;;;;N;;;;; 18C9;CANADIAN SYLLABICS OJIBWAY NWII;Lo;0;L;;;;;N;;;;; 18CA;CANADIAN SYLLABICS NWO;Lo;0;L;;;;;N;;;;; 18CB;CANADIAN SYLLABICS OJIBWAY NWO;Lo;0;L;;;;;N;;;;; 18CC;CANADIAN SYLLABICS NWOO;Lo;0;L;;;;;N;;;;; 18CD;CANADIAN SYLLABICS OJIBWAY NWOO;Lo;0;L;;;;;N;;;;; 18CE;CANADIAN SYLLABICS RWEE;Lo;0;L;;;;;N;;;;; 18CF;CANADIAN SYLLABICS RWI;Lo;0;L;;;;;N;;;;; 18D0;CANADIAN SYLLABICS RWII;Lo;0;L;;;;;N;;;;; 18D1;CANADIAN SYLLABICS RWO;Lo;0;L;;;;;N;;;;; 18D2;CANADIAN SYLLABICS RWOO;Lo;0;L;;;;;N;;;;; 18D3;CANADIAN SYLLABICS RWA;Lo;0;L;;;;;N;;;;; 18D4;CANADIAN SYLLABICS OJIBWAY P;Lo;0;L;;;;;N;;;;; 18D5;CANADIAN SYLLABICS OJIBWAY T;Lo;0;L;;;;;N;;;;; 18D6;CANADIAN SYLLABICS OJIBWAY K;Lo;0;L;;;;;N;;;;; 18D7;CANADIAN SYLLABICS OJIBWAY C;Lo;0;L;;;;;N;;;;; 18D8;CANADIAN SYLLABICS OJIBWAY M;Lo;0;L;;;;;N;;;;; 18D9;CANADIAN SYLLABICS OJIBWAY N;Lo;0;L;;;;;N;;;;; 18DA;CANADIAN SYLLABICS OJIBWAY S;Lo;0;L;;;;;N;;;;; 18DB;CANADIAN SYLLABICS OJIBWAY SH;Lo;0;L;;;;;N;;;;; 18DC;CANADIAN SYLLABICS EASTERN W;Lo;0;L;;;;;N;;;;; 18DD;CANADIAN SYLLABICS WESTERN W;Lo;0;L;;;;;N;;;;; 18DE;CANADIAN SYLLABICS FINAL SMALL RING;Lo;0;L;;;;;N;;;;; 18DF;CANADIAN SYLLABICS FINAL RAISED DOT;Lo;0;L;;;;;N;;;;; 18E0;CANADIAN SYLLABICS R-CREE RWE;Lo;0;L;;;;;N;;;;; 18E1;CANADIAN SYLLABICS WEST-CREE LOO;Lo;0;L;;;;;N;;;;; 18E2;CANADIAN SYLLABICS WEST-CREE LAA;Lo;0;L;;;;;N;;;;; 18E3;CANADIAN SYLLABICS THWE;Lo;0;L;;;;;N;;;;; 18E4;CANADIAN SYLLABICS THWA;Lo;0;L;;;;;N;;;;; 18E5;CANADIAN SYLLABICS TTHWE;Lo;0;L;;;;;N;;;;; 18E6;CANADIAN SYLLABICS TTHOO;Lo;0;L;;;;;N;;;;; 18E7;CANADIAN SYLLABICS TTHAA;Lo;0;L;;;;;N;;;;; 18E8;CANADIAN SYLLABICS TLHWE;Lo;0;L;;;;;N;;;;; 18E9;CANADIAN SYLLABICS TLHOO;Lo;0;L;;;;;N;;;;; 18EA;CANADIAN SYLLABICS SAYISI SHWE;Lo;0;L;;;;;N;;;;; 18EB;CANADIAN SYLLABICS SAYISI SHOO;Lo;0;L;;;;;N;;;;; 18EC;CANADIAN SYLLABICS SAYISI HOO;Lo;0;L;;;;;N;;;;; 18ED;CANADIAN SYLLABICS CARRIER GWU;Lo;0;L;;;;;N;;;;; 18EE;CANADIAN SYLLABICS CARRIER DENE GEE;Lo;0;L;;;;;N;;;;; 18EF;CANADIAN SYLLABICS CARRIER GAA;Lo;0;L;;;;;N;;;;; 18F0;CANADIAN SYLLABICS CARRIER GWA;Lo;0;L;;;;;N;;;;; 18F1;CANADIAN SYLLABICS SAYISI JUU;Lo;0;L;;;;;N;;;;; 18F2;CANADIAN SYLLABICS CARRIER JWA;Lo;0;L;;;;;N;;;;; 18F3;CANADIAN SYLLABICS BEAVER DENE L;Lo;0;L;;;;;N;;;;; 18F4;CANADIAN SYLLABICS BEAVER DENE R;Lo;0;L;;;;;N;;;;; 18F5;CANADIAN SYLLABICS CARRIER DENTAL S;Lo;0;L;;;;;N;;;;; 1900;LIMBU VOWEL-CARRIER LETTER;Lo;0;L;;;;;N;;;;; 1901;LIMBU LETTER KA;Lo;0;L;;;;;N;;;;; 1902;LIMBU LETTER KHA;Lo;0;L;;;;;N;;;;; 1903;LIMBU LETTER GA;Lo;0;L;;;;;N;;;;; 1904;LIMBU LETTER GHA;Lo;0;L;;;;;N;;;;; 1905;LIMBU LETTER NGA;Lo;0;L;;;;;N;;;;; 1906;LIMBU LETTER CA;Lo;0;L;;;;;N;;;;; 1907;LIMBU LETTER CHA;Lo;0;L;;;;;N;;;;; 1908;LIMBU LETTER JA;Lo;0;L;;;;;N;;;;; 1909;LIMBU LETTER JHA;Lo;0;L;;;;;N;;;;; 190A;LIMBU LETTER YAN;Lo;0;L;;;;;N;;;;; 190B;LIMBU LETTER TA;Lo;0;L;;;;;N;;;;; 190C;LIMBU LETTER THA;Lo;0;L;;;;;N;;;;; 190D;LIMBU LETTER DA;Lo;0;L;;;;;N;;;;; 190E;LIMBU LETTER DHA;Lo;0;L;;;;;N;;;;; 190F;LIMBU LETTER NA;Lo;0;L;;;;;N;;;;; 1910;LIMBU LETTER PA;Lo;0;L;;;;;N;;;;; 1911;LIMBU LETTER PHA;Lo;0;L;;;;;N;;;;; 1912;LIMBU LETTER BA;Lo;0;L;;;;;N;;;;; 1913;LIMBU LETTER BHA;Lo;0;L;;;;;N;;;;; 1914;LIMBU LETTER MA;Lo;0;L;;;;;N;;;;; 1915;LIMBU LETTER YA;Lo;0;L;;;;;N;;;;; 1916;LIMBU LETTER RA;Lo;0;L;;;;;N;;;;; 1917;LIMBU LETTER LA;Lo;0;L;;;;;N;;;;; 1918;LIMBU LETTER WA;Lo;0;L;;;;;N;;;;; 1919;LIMBU LETTER SHA;Lo;0;L;;;;;N;;;;; 191A;LIMBU LETTER SSA;Lo;0;L;;;;;N;;;;; 191B;LIMBU LETTER SA;Lo;0;L;;;;;N;;;;; 191C;LIMBU LETTER HA;Lo;0;L;;;;;N;;;;; 1920;LIMBU VOWEL SIGN A;Mn;0;NSM;;;;;N;;;;; 1921;LIMBU VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 1922;LIMBU VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 1923;LIMBU VOWEL SIGN EE;Mc;0;L;;;;;N;;;;; 1924;LIMBU VOWEL SIGN AI;Mc;0;L;;;;;N;;;;; 1925;LIMBU VOWEL SIGN OO;Mc;0;L;;;;;N;;;;; 1926;LIMBU VOWEL SIGN AU;Mc;0;L;;;;;N;;;;; 1927;LIMBU VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; 1928;LIMBU VOWEL SIGN O;Mn;0;NSM;;;;;N;;;;; 1929;LIMBU SUBJOINED LETTER YA;Mc;0;L;;;;;N;;;;; 192A;LIMBU SUBJOINED LETTER RA;Mc;0;L;;;;;N;;;;; 192B;LIMBU SUBJOINED LETTER WA;Mc;0;L;;;;;N;;;;; 1930;LIMBU SMALL LETTER KA;Mc;0;L;;;;;N;;;;; 1931;LIMBU SMALL LETTER NGA;Mc;0;L;;;;;N;;;;; 1932;LIMBU SMALL LETTER ANUSVARA;Mn;0;NSM;;;;;N;;;;; 1933;LIMBU SMALL LETTER TA;Mc;0;L;;;;;N;;;;; 1934;LIMBU SMALL LETTER NA;Mc;0;L;;;;;N;;;;; 1935;LIMBU SMALL LETTER PA;Mc;0;L;;;;;N;;;;; 1936;LIMBU SMALL LETTER MA;Mc;0;L;;;;;N;;;;; 1937;LIMBU SMALL LETTER RA;Mc;0;L;;;;;N;;;;; 1938;LIMBU SMALL LETTER LA;Mc;0;L;;;;;N;;;;; 1939;LIMBU SIGN MUKPHRENG;Mn;222;NSM;;;;;N;;;;; 193A;LIMBU SIGN KEMPHRENG;Mn;230;NSM;;;;;N;;;;; 193B;LIMBU SIGN SA-I;Mn;220;NSM;;;;;N;;;;; 1940;LIMBU SIGN LOO;So;0;ON;;;;;N;;;;; 1944;LIMBU EXCLAMATION MARK;Po;0;ON;;;;;N;;;;; 1945;LIMBU QUESTION MARK;Po;0;ON;;;;;N;;;;; 1946;LIMBU DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 1947;LIMBU DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 1948;LIMBU DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 1949;LIMBU DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 194A;LIMBU DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 194B;LIMBU DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 194C;LIMBU DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 194D;LIMBU DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 194E;LIMBU DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 194F;LIMBU DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 1950;TAI LE LETTER KA;Lo;0;L;;;;;N;;;;; 1951;TAI LE LETTER XA;Lo;0;L;;;;;N;;;;; 1952;TAI LE LETTER NGA;Lo;0;L;;;;;N;;;;; 1953;TAI LE LETTER TSA;Lo;0;L;;;;;N;;;;; 1954;TAI LE LETTER SA;Lo;0;L;;;;;N;;;;; 1955;TAI LE LETTER YA;Lo;0;L;;;;;N;;;;; 1956;TAI LE LETTER TA;Lo;0;L;;;;;N;;;;; 1957;TAI LE LETTER THA;Lo;0;L;;;;;N;;;;; 1958;TAI LE LETTER LA;Lo;0;L;;;;;N;;;;; 1959;TAI LE LETTER PA;Lo;0;L;;;;;N;;;;; 195A;TAI LE LETTER PHA;Lo;0;L;;;;;N;;;;; 195B;TAI LE LETTER MA;Lo;0;L;;;;;N;;;;; 195C;TAI LE LETTER FA;Lo;0;L;;;;;N;;;;; 195D;TAI LE LETTER VA;Lo;0;L;;;;;N;;;;; 195E;TAI LE LETTER HA;Lo;0;L;;;;;N;;;;; 195F;TAI LE LETTER QA;Lo;0;L;;;;;N;;;;; 1960;TAI LE LETTER KHA;Lo;0;L;;;;;N;;;;; 1961;TAI LE LETTER TSHA;Lo;0;L;;;;;N;;;;; 1962;TAI LE LETTER NA;Lo;0;L;;;;;N;;;;; 1963;TAI LE LETTER A;Lo;0;L;;;;;N;;;;; 1964;TAI LE LETTER I;Lo;0;L;;;;;N;;;;; 1965;TAI LE LETTER EE;Lo;0;L;;;;;N;;;;; 1966;TAI LE LETTER EH;Lo;0;L;;;;;N;;;;; 1967;TAI LE LETTER U;Lo;0;L;;;;;N;;;;; 1968;TAI LE LETTER OO;Lo;0;L;;;;;N;;;;; 1969;TAI LE LETTER O;Lo;0;L;;;;;N;;;;; 196A;TAI LE LETTER UE;Lo;0;L;;;;;N;;;;; 196B;TAI LE LETTER E;Lo;0;L;;;;;N;;;;; 196C;TAI LE LETTER AUE;Lo;0;L;;;;;N;;;;; 196D;TAI LE LETTER AI;Lo;0;L;;;;;N;;;;; 1970;TAI LE LETTER TONE-2;Lo;0;L;;;;;N;;;;; 1971;TAI LE LETTER TONE-3;Lo;0;L;;;;;N;;;;; 1972;TAI LE LETTER TONE-4;Lo;0;L;;;;;N;;;;; 1973;TAI LE LETTER TONE-5;Lo;0;L;;;;;N;;;;; 1974;TAI LE LETTER TONE-6;Lo;0;L;;;;;N;;;;; 1980;NEW TAI LUE LETTER HIGH QA;Lo;0;L;;;;;N;;;;; 1981;NEW TAI LUE LETTER LOW QA;Lo;0;L;;;;;N;;;;; 1982;NEW TAI LUE LETTER HIGH KA;Lo;0;L;;;;;N;;;;; 1983;NEW TAI LUE LETTER HIGH XA;Lo;0;L;;;;;N;;;;; 1984;NEW TAI LUE LETTER HIGH NGA;Lo;0;L;;;;;N;;;;; 1985;NEW TAI LUE LETTER LOW KA;Lo;0;L;;;;;N;;;;; 1986;NEW TAI LUE LETTER LOW XA;Lo;0;L;;;;;N;;;;; 1987;NEW TAI LUE LETTER LOW NGA;Lo;0;L;;;;;N;;;;; 1988;NEW TAI LUE LETTER HIGH TSA;Lo;0;L;;;;;N;;;;; 1989;NEW TAI LUE LETTER HIGH SA;Lo;0;L;;;;;N;;;;; 198A;NEW TAI LUE LETTER HIGH YA;Lo;0;L;;;;;N;;;;; 198B;NEW TAI LUE LETTER LOW TSA;Lo;0;L;;;;;N;;;;; 198C;NEW TAI LUE LETTER LOW SA;Lo;0;L;;;;;N;;;;; 198D;NEW TAI LUE LETTER LOW YA;Lo;0;L;;;;;N;;;;; 198E;NEW TAI LUE LETTER HIGH TA;Lo;0;L;;;;;N;;;;; 198F;NEW TAI LUE LETTER HIGH THA;Lo;0;L;;;;;N;;;;; 1990;NEW TAI LUE LETTER HIGH NA;Lo;0;L;;;;;N;;;;; 1991;NEW TAI LUE LETTER LOW TA;Lo;0;L;;;;;N;;;;; 1992;NEW TAI LUE LETTER LOW THA;Lo;0;L;;;;;N;;;;; 1993;NEW TAI LUE LETTER LOW NA;Lo;0;L;;;;;N;;;;; 1994;NEW TAI LUE LETTER HIGH PA;Lo;0;L;;;;;N;;;;; 1995;NEW TAI LUE LETTER HIGH PHA;Lo;0;L;;;;;N;;;;; 1996;NEW TAI LUE LETTER HIGH MA;Lo;0;L;;;;;N;;;;; 1997;NEW TAI LUE LETTER LOW PA;Lo;0;L;;;;;N;;;;; 1998;NEW TAI LUE LETTER LOW PHA;Lo;0;L;;;;;N;;;;; 1999;NEW TAI LUE LETTER LOW MA;Lo;0;L;;;;;N;;;;; 199A;NEW TAI LUE LETTER HIGH FA;Lo;0;L;;;;;N;;;;; 199B;NEW TAI LUE LETTER HIGH VA;Lo;0;L;;;;;N;;;;; 199C;NEW TAI LUE LETTER HIGH LA;Lo;0;L;;;;;N;;;;; 199D;NEW TAI LUE LETTER LOW FA;Lo;0;L;;;;;N;;;;; 199E;NEW TAI LUE LETTER LOW VA;Lo;0;L;;;;;N;;;;; 199F;NEW TAI LUE LETTER LOW LA;Lo;0;L;;;;;N;;;;; 19A0;NEW TAI LUE LETTER HIGH HA;Lo;0;L;;;;;N;;;;; 19A1;NEW TAI LUE LETTER HIGH DA;Lo;0;L;;;;;N;;;;; 19A2;NEW TAI LUE LETTER HIGH BA;Lo;0;L;;;;;N;;;;; 19A3;NEW TAI LUE LETTER LOW HA;Lo;0;L;;;;;N;;;;; 19A4;NEW TAI LUE LETTER LOW DA;Lo;0;L;;;;;N;;;;; 19A5;NEW TAI LUE LETTER LOW BA;Lo;0;L;;;;;N;;;;; 19A6;NEW TAI LUE LETTER HIGH KVA;Lo;0;L;;;;;N;;;;; 19A7;NEW TAI LUE LETTER HIGH XVA;Lo;0;L;;;;;N;;;;; 19A8;NEW TAI LUE LETTER LOW KVA;Lo;0;L;;;;;N;;;;; 19A9;NEW TAI LUE LETTER LOW XVA;Lo;0;L;;;;;N;;;;; 19AA;NEW TAI LUE LETTER HIGH SUA;Lo;0;L;;;;;N;;;;; 19AB;NEW TAI LUE LETTER LOW SUA;Lo;0;L;;;;;N;;;;; 19B0;NEW TAI LUE VOWEL SIGN VOWEL SHORTENER;Mc;0;L;;;;;N;;;;; 19B1;NEW TAI LUE VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 19B2;NEW TAI LUE VOWEL SIGN II;Mc;0;L;;;;;N;;;;; 19B3;NEW TAI LUE VOWEL SIGN U;Mc;0;L;;;;;N;;;;; 19B4;NEW TAI LUE VOWEL SIGN UU;Mc;0;L;;;;;N;;;;; 19B5;NEW TAI LUE VOWEL SIGN E;Mc;0;L;;;;;N;;;;; 19B6;NEW TAI LUE VOWEL SIGN AE;Mc;0;L;;;;;N;;;;; 19B7;NEW TAI LUE VOWEL SIGN O;Mc;0;L;;;;;N;;;;; 19B8;NEW TAI LUE VOWEL SIGN OA;Mc;0;L;;;;;N;;;;; 19B9;NEW TAI LUE VOWEL SIGN UE;Mc;0;L;;;;;N;;;;; 19BA;NEW TAI LUE VOWEL SIGN AY;Mc;0;L;;;;;N;;;;; 19BB;NEW TAI LUE VOWEL SIGN AAY;Mc;0;L;;;;;N;;;;; 19BC;NEW TAI LUE VOWEL SIGN UY;Mc;0;L;;;;;N;;;;; 19BD;NEW TAI LUE VOWEL SIGN OY;Mc;0;L;;;;;N;;;;; 19BE;NEW TAI LUE VOWEL SIGN OAY;Mc;0;L;;;;;N;;;;; 19BF;NEW TAI LUE VOWEL SIGN UEY;Mc;0;L;;;;;N;;;;; 19C0;NEW TAI LUE VOWEL SIGN IY;Mc;0;L;;;;;N;;;;; 19C1;NEW TAI LUE LETTER FINAL V;Lo;0;L;;;;;N;;;;; 19C2;NEW TAI LUE LETTER FINAL NG;Lo;0;L;;;;;N;;;;; 19C3;NEW TAI LUE LETTER FINAL N;Lo;0;L;;;;;N;;;;; 19C4;NEW TAI LUE LETTER FINAL M;Lo;0;L;;;;;N;;;;; 19C5;NEW TAI LUE LETTER FINAL K;Lo;0;L;;;;;N;;;;; 19C6;NEW TAI LUE LETTER FINAL D;Lo;0;L;;;;;N;;;;; 19C7;NEW TAI LUE LETTER FINAL B;Lo;0;L;;;;;N;;;;; 19C8;NEW TAI LUE TONE MARK-1;Mc;0;L;;;;;N;;;;; 19C9;NEW TAI LUE TONE MARK-2;Mc;0;L;;;;;N;;;;; 19D0;NEW TAI LUE DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 19D1;NEW TAI LUE DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 19D2;NEW TAI LUE DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 19D3;NEW TAI LUE DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 19D4;NEW TAI LUE DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 19D5;NEW TAI LUE DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 19D6;NEW TAI LUE DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 19D7;NEW TAI LUE DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 19D8;NEW TAI LUE DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 19D9;NEW TAI LUE DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 19DA;NEW TAI LUE THAM DIGIT ONE;No;0;L;;;1;1;N;;;;; 19DE;NEW TAI LUE SIGN LAE;So;0;ON;;;;;N;;;;; 19DF;NEW TAI LUE SIGN LAEV;So;0;ON;;;;;N;;;;; 19E0;KHMER SYMBOL PATHAMASAT;So;0;ON;;;;;N;;;;; 19E1;KHMER SYMBOL MUOY KOET;So;0;ON;;;;;N;;;;; 19E2;KHMER SYMBOL PII KOET;So;0;ON;;;;;N;;;;; 19E3;KHMER SYMBOL BEI KOET;So;0;ON;;;;;N;;;;; 19E4;KHMER SYMBOL BUON KOET;So;0;ON;;;;;N;;;;; 19E5;KHMER SYMBOL PRAM KOET;So;0;ON;;;;;N;;;;; 19E6;KHMER SYMBOL PRAM-MUOY KOET;So;0;ON;;;;;N;;;;; 19E7;KHMER SYMBOL PRAM-PII KOET;So;0;ON;;;;;N;;;;; 19E8;KHMER SYMBOL PRAM-BEI KOET;So;0;ON;;;;;N;;;;; 19E9;KHMER SYMBOL PRAM-BUON KOET;So;0;ON;;;;;N;;;;; 19EA;KHMER SYMBOL DAP KOET;So;0;ON;;;;;N;;;;; 19EB;KHMER SYMBOL DAP-MUOY KOET;So;0;ON;;;;;N;;;;; 19EC;KHMER SYMBOL DAP-PII KOET;So;0;ON;;;;;N;;;;; 19ED;KHMER SYMBOL DAP-BEI KOET;So;0;ON;;;;;N;;;;; 19EE;KHMER SYMBOL DAP-BUON KOET;So;0;ON;;;;;N;;;;; 19EF;KHMER SYMBOL DAP-PRAM KOET;So;0;ON;;;;;N;;;;; 19F0;KHMER SYMBOL TUTEYASAT;So;0;ON;;;;;N;;;;; 19F1;KHMER SYMBOL MUOY ROC;So;0;ON;;;;;N;;;;; 19F2;KHMER SYMBOL PII ROC;So;0;ON;;;;;N;;;;; 19F3;KHMER SYMBOL BEI ROC;So;0;ON;;;;;N;;;;; 19F4;KHMER SYMBOL BUON ROC;So;0;ON;;;;;N;;;;; 19F5;KHMER SYMBOL PRAM ROC;So;0;ON;;;;;N;;;;; 19F6;KHMER SYMBOL PRAM-MUOY ROC;So;0;ON;;;;;N;;;;; 19F7;KHMER SYMBOL PRAM-PII ROC;So;0;ON;;;;;N;;;;; 19F8;KHMER SYMBOL PRAM-BEI ROC;So;0;ON;;;;;N;;;;; 19F9;KHMER SYMBOL PRAM-BUON ROC;So;0;ON;;;;;N;;;;; 19FA;KHMER SYMBOL DAP ROC;So;0;ON;;;;;N;;;;; 19FB;KHMER SYMBOL DAP-MUOY ROC;So;0;ON;;;;;N;;;;; 19FC;KHMER SYMBOL DAP-PII ROC;So;0;ON;;;;;N;;;;; 19FD;KHMER SYMBOL DAP-BEI ROC;So;0;ON;;;;;N;;;;; 19FE;KHMER SYMBOL DAP-BUON ROC;So;0;ON;;;;;N;;;;; 19FF;KHMER SYMBOL DAP-PRAM ROC;So;0;ON;;;;;N;;;;; 1A00;BUGINESE LETTER KA;Lo;0;L;;;;;N;;;;; 1A01;BUGINESE LETTER GA;Lo;0;L;;;;;N;;;;; 1A02;BUGINESE LETTER NGA;Lo;0;L;;;;;N;;;;; 1A03;BUGINESE LETTER NGKA;Lo;0;L;;;;;N;;;;; 1A04;BUGINESE LETTER PA;Lo;0;L;;;;;N;;;;; 1A05;BUGINESE LETTER BA;Lo;0;L;;;;;N;;;;; 1A06;BUGINESE LETTER MA;Lo;0;L;;;;;N;;;;; 1A07;BUGINESE LETTER MPA;Lo;0;L;;;;;N;;;;; 1A08;BUGINESE LETTER TA;Lo;0;L;;;;;N;;;;; 1A09;BUGINESE LETTER DA;Lo;0;L;;;;;N;;;;; 1A0A;BUGINESE LETTER NA;Lo;0;L;;;;;N;;;;; 1A0B;BUGINESE LETTER NRA;Lo;0;L;;;;;N;;;;; 1A0C;BUGINESE LETTER CA;Lo;0;L;;;;;N;;;;; 1A0D;BUGINESE LETTER JA;Lo;0;L;;;;;N;;;;; 1A0E;BUGINESE LETTER NYA;Lo;0;L;;;;;N;;;;; 1A0F;BUGINESE LETTER NYCA;Lo;0;L;;;;;N;;;;; 1A10;BUGINESE LETTER YA;Lo;0;L;;;;;N;;;;; 1A11;BUGINESE LETTER RA;Lo;0;L;;;;;N;;;;; 1A12;BUGINESE LETTER LA;Lo;0;L;;;;;N;;;;; 1A13;BUGINESE LETTER VA;Lo;0;L;;;;;N;;;;; 1A14;BUGINESE LETTER SA;Lo;0;L;;;;;N;;;;; 1A15;BUGINESE LETTER A;Lo;0;L;;;;;N;;;;; 1A16;BUGINESE LETTER HA;Lo;0;L;;;;;N;;;;; 1A17;BUGINESE VOWEL SIGN I;Mn;230;NSM;;;;;N;;;;; 1A18;BUGINESE VOWEL SIGN U;Mn;220;NSM;;;;;N;;;;; 1A19;BUGINESE VOWEL SIGN E;Mc;0;L;;;;;N;;;;; 1A1A;BUGINESE VOWEL SIGN O;Mc;0;L;;;;;N;;;;; 1A1B;BUGINESE VOWEL SIGN AE;Mc;0;L;;;;;N;;;;; 1A1E;BUGINESE PALLAWA;Po;0;L;;;;;N;;;;; 1A1F;BUGINESE END OF SECTION;Po;0;L;;;;;N;;;;; 1A20;TAI THAM LETTER HIGH KA;Lo;0;L;;;;;N;;;;; 1A21;TAI THAM LETTER HIGH KHA;Lo;0;L;;;;;N;;;;; 1A22;TAI THAM LETTER HIGH KXA;Lo;0;L;;;;;N;;;;; 1A23;TAI THAM LETTER LOW KA;Lo;0;L;;;;;N;;;;; 1A24;TAI THAM LETTER LOW KXA;Lo;0;L;;;;;N;;;;; 1A25;TAI THAM LETTER LOW KHA;Lo;0;L;;;;;N;;;;; 1A26;TAI THAM LETTER NGA;Lo;0;L;;;;;N;;;;; 1A27;TAI THAM LETTER HIGH CA;Lo;0;L;;;;;N;;;;; 1A28;TAI THAM LETTER HIGH CHA;Lo;0;L;;;;;N;;;;; 1A29;TAI THAM LETTER LOW CA;Lo;0;L;;;;;N;;;;; 1A2A;TAI THAM LETTER LOW SA;Lo;0;L;;;;;N;;;;; 1A2B;TAI THAM LETTER LOW CHA;Lo;0;L;;;;;N;;;;; 1A2C;TAI THAM LETTER NYA;Lo;0;L;;;;;N;;;;; 1A2D;TAI THAM LETTER RATA;Lo;0;L;;;;;N;;;;; 1A2E;TAI THAM LETTER HIGH RATHA;Lo;0;L;;;;;N;;;;; 1A2F;TAI THAM LETTER DA;Lo;0;L;;;;;N;;;;; 1A30;TAI THAM LETTER LOW RATHA;Lo;0;L;;;;;N;;;;; 1A31;TAI THAM LETTER RANA;Lo;0;L;;;;;N;;;;; 1A32;TAI THAM LETTER HIGH TA;Lo;0;L;;;;;N;;;;; 1A33;TAI THAM LETTER HIGH THA;Lo;0;L;;;;;N;;;;; 1A34;TAI THAM LETTER LOW TA;Lo;0;L;;;;;N;;;;; 1A35;TAI THAM LETTER LOW THA;Lo;0;L;;;;;N;;;;; 1A36;TAI THAM LETTER NA;Lo;0;L;;;;;N;;;;; 1A37;TAI THAM LETTER BA;Lo;0;L;;;;;N;;;;; 1A38;TAI THAM LETTER HIGH PA;Lo;0;L;;;;;N;;;;; 1A39;TAI THAM LETTER HIGH PHA;Lo;0;L;;;;;N;;;;; 1A3A;TAI THAM LETTER HIGH FA;Lo;0;L;;;;;N;;;;; 1A3B;TAI THAM LETTER LOW PA;Lo;0;L;;;;;N;;;;; 1A3C;TAI THAM LETTER LOW FA;Lo;0;L;;;;;N;;;;; 1A3D;TAI THAM LETTER LOW PHA;Lo;0;L;;;;;N;;;;; 1A3E;TAI THAM LETTER MA;Lo;0;L;;;;;N;;;;; 1A3F;TAI THAM LETTER LOW YA;Lo;0;L;;;;;N;;;;; 1A40;TAI THAM LETTER HIGH YA;Lo;0;L;;;;;N;;;;; 1A41;TAI THAM LETTER RA;Lo;0;L;;;;;N;;;;; 1A42;TAI THAM LETTER RUE;Lo;0;L;;;;;N;;;;; 1A43;TAI THAM LETTER LA;Lo;0;L;;;;;N;;;;; 1A44;TAI THAM LETTER LUE;Lo;0;L;;;;;N;;;;; 1A45;TAI THAM LETTER WA;Lo;0;L;;;;;N;;;;; 1A46;TAI THAM LETTER HIGH SHA;Lo;0;L;;;;;N;;;;; 1A47;TAI THAM LETTER HIGH SSA;Lo;0;L;;;;;N;;;;; 1A48;TAI THAM LETTER HIGH SA;Lo;0;L;;;;;N;;;;; 1A49;TAI THAM LETTER HIGH HA;Lo;0;L;;;;;N;;;;; 1A4A;TAI THAM LETTER LLA;Lo;0;L;;;;;N;;;;; 1A4B;TAI THAM LETTER A;Lo;0;L;;;;;N;;;;; 1A4C;TAI THAM LETTER LOW HA;Lo;0;L;;;;;N;;;;; 1A4D;TAI THAM LETTER I;Lo;0;L;;;;;N;;;;; 1A4E;TAI THAM LETTER II;Lo;0;L;;;;;N;;;;; 1A4F;TAI THAM LETTER U;Lo;0;L;;;;;N;;;;; 1A50;TAI THAM LETTER UU;Lo;0;L;;;;;N;;;;; 1A51;TAI THAM LETTER EE;Lo;0;L;;;;;N;;;;; 1A52;TAI THAM LETTER OO;Lo;0;L;;;;;N;;;;; 1A53;TAI THAM LETTER LAE;Lo;0;L;;;;;N;;;;; 1A54;TAI THAM LETTER GREAT SA;Lo;0;L;;;;;N;;;;; 1A55;TAI THAM CONSONANT SIGN MEDIAL RA;Mc;0;L;;;;;N;;;;; 1A56;TAI THAM CONSONANT SIGN MEDIAL LA;Mn;0;NSM;;;;;N;;;;; 1A57;TAI THAM CONSONANT SIGN LA TANG LAI;Mc;0;L;;;;;N;;;;; 1A58;TAI THAM SIGN MAI KANG LAI;Mn;0;NSM;;;;;N;;;;; 1A59;TAI THAM CONSONANT SIGN FINAL NGA;Mn;0;NSM;;;;;N;;;;; 1A5A;TAI THAM CONSONANT SIGN LOW PA;Mn;0;NSM;;;;;N;;;;; 1A5B;TAI THAM CONSONANT SIGN HIGH RATHA OR LOW PA;Mn;0;NSM;;;;;N;;;;; 1A5C;TAI THAM CONSONANT SIGN MA;Mn;0;NSM;;;;;N;;;;; 1A5D;TAI THAM CONSONANT SIGN BA;Mn;0;NSM;;;;;N;;;;; 1A5E;TAI THAM CONSONANT SIGN SA;Mn;0;NSM;;;;;N;;;;; 1A60;TAI THAM SIGN SAKOT;Mn;9;NSM;;;;;N;;;;; 1A61;TAI THAM VOWEL SIGN A;Mc;0;L;;;;;N;;;;; 1A62;TAI THAM VOWEL SIGN MAI SAT;Mn;0;NSM;;;;;N;;;;; 1A63;TAI THAM VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 1A64;TAI THAM VOWEL SIGN TALL AA;Mc;0;L;;;;;N;;;;; 1A65;TAI THAM VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 1A66;TAI THAM VOWEL SIGN II;Mn;0;NSM;;;;;N;;;;; 1A67;TAI THAM VOWEL SIGN UE;Mn;0;NSM;;;;;N;;;;; 1A68;TAI THAM VOWEL SIGN UUE;Mn;0;NSM;;;;;N;;;;; 1A69;TAI THAM VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 1A6A;TAI THAM VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 1A6B;TAI THAM VOWEL SIGN O;Mn;0;NSM;;;;;N;;;;; 1A6C;TAI THAM VOWEL SIGN OA BELOW;Mn;0;NSM;;;;;N;;;;; 1A6D;TAI THAM VOWEL SIGN OY;Mc;0;L;;;;;N;;;;; 1A6E;TAI THAM VOWEL SIGN E;Mc;0;L;;;;;N;;;;; 1A6F;TAI THAM VOWEL SIGN AE;Mc;0;L;;;;;N;;;;; 1A70;TAI THAM VOWEL SIGN OO;Mc;0;L;;;;;N;;;;; 1A71;TAI THAM VOWEL SIGN AI;Mc;0;L;;;;;N;;;;; 1A72;TAI THAM VOWEL SIGN THAM AI;Mc;0;L;;;;;N;;;;; 1A73;TAI THAM VOWEL SIGN OA ABOVE;Mn;0;NSM;;;;;N;;;;; 1A74;TAI THAM SIGN MAI KANG;Mn;0;NSM;;;;;N;;;;; 1A75;TAI THAM SIGN TONE-1;Mn;230;NSM;;;;;N;;;;; 1A76;TAI THAM SIGN TONE-2;Mn;230;NSM;;;;;N;;;;; 1A77;TAI THAM SIGN KHUEN TONE-3;Mn;230;NSM;;;;;N;;;;; 1A78;TAI THAM SIGN KHUEN TONE-4;Mn;230;NSM;;;;;N;;;;; 1A79;TAI THAM SIGN KHUEN TONE-5;Mn;230;NSM;;;;;N;;;;; 1A7A;TAI THAM SIGN RA HAAM;Mn;230;NSM;;;;;N;;;;; 1A7B;TAI THAM SIGN MAI SAM;Mn;230;NSM;;;;;N;;;;; 1A7C;TAI THAM SIGN KHUEN-LUE KARAN;Mn;230;NSM;;;;;N;;;;; 1A7F;TAI THAM COMBINING CRYPTOGRAMMIC DOT;Mn;220;NSM;;;;;N;;;;; 1A80;TAI THAM HORA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 1A81;TAI THAM HORA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 1A82;TAI THAM HORA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 1A83;TAI THAM HORA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 1A84;TAI THAM HORA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 1A85;TAI THAM HORA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 1A86;TAI THAM HORA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 1A87;TAI THAM HORA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 1A88;TAI THAM HORA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 1A89;TAI THAM HORA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 1A90;TAI THAM THAM DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 1A91;TAI THAM THAM DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 1A92;TAI THAM THAM DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 1A93;TAI THAM THAM DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 1A94;TAI THAM THAM DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 1A95;TAI THAM THAM DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 1A96;TAI THAM THAM DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 1A97;TAI THAM THAM DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 1A98;TAI THAM THAM DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 1A99;TAI THAM THAM DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 1AA0;TAI THAM SIGN WIANG;Po;0;L;;;;;N;;;;; 1AA1;TAI THAM SIGN WIANGWAAK;Po;0;L;;;;;N;;;;; 1AA2;TAI THAM SIGN SAWAN;Po;0;L;;;;;N;;;;; 1AA3;TAI THAM SIGN KEOW;Po;0;L;;;;;N;;;;; 1AA4;TAI THAM SIGN HOY;Po;0;L;;;;;N;;;;; 1AA5;TAI THAM SIGN DOKMAI;Po;0;L;;;;;N;;;;; 1AA6;TAI THAM SIGN REVERSED ROTATED RANA;Po;0;L;;;;;N;;;;; 1AA7;TAI THAM SIGN MAI YAMOK;Lm;0;L;;;;;N;;;;; 1AA8;TAI THAM SIGN KAAN;Po;0;L;;;;;N;;;;; 1AA9;TAI THAM SIGN KAANKUU;Po;0;L;;;;;N;;;;; 1AAA;TAI THAM SIGN SATKAAN;Po;0;L;;;;;N;;;;; 1AAB;TAI THAM SIGN SATKAANKUU;Po;0;L;;;;;N;;;;; 1AAC;TAI THAM SIGN HANG;Po;0;L;;;;;N;;;;; 1AAD;TAI THAM SIGN CAANG;Po;0;L;;;;;N;;;;; 1B00;BALINESE SIGN ULU RICEM;Mn;0;NSM;;;;;N;;;;; 1B01;BALINESE SIGN ULU CANDRA;Mn;0;NSM;;;;;N;;;;; 1B02;BALINESE SIGN CECEK;Mn;0;NSM;;;;;N;;;;; 1B03;BALINESE SIGN SURANG;Mn;0;NSM;;;;;N;;;;; 1B04;BALINESE SIGN BISAH;Mc;0;L;;;;;N;;;;; 1B05;BALINESE LETTER AKARA;Lo;0;L;;;;;N;;;;; 1B06;BALINESE LETTER AKARA TEDUNG;Lo;0;L;1B05 1B35;;;;N;;;;; 1B07;BALINESE LETTER IKARA;Lo;0;L;;;;;N;;;;; 1B08;BALINESE LETTER IKARA TEDUNG;Lo;0;L;1B07 1B35;;;;N;;;;; 1B09;BALINESE LETTER UKARA;Lo;0;L;;;;;N;;;;; 1B0A;BALINESE LETTER UKARA TEDUNG;Lo;0;L;1B09 1B35;;;;N;;;;; 1B0B;BALINESE LETTER RA REPA;Lo;0;L;;;;;N;;;;; 1B0C;BALINESE LETTER RA REPA TEDUNG;Lo;0;L;1B0B 1B35;;;;N;;;;; 1B0D;BALINESE LETTER LA LENGA;Lo;0;L;;;;;N;;;;; 1B0E;BALINESE LETTER LA LENGA TEDUNG;Lo;0;L;1B0D 1B35;;;;N;;;;; 1B0F;BALINESE LETTER EKARA;Lo;0;L;;;;;N;;;;; 1B10;BALINESE LETTER AIKARA;Lo;0;L;;;;;N;;;;; 1B11;BALINESE LETTER OKARA;Lo;0;L;;;;;N;;;;; 1B12;BALINESE LETTER OKARA TEDUNG;Lo;0;L;1B11 1B35;;;;N;;;;; 1B13;BALINESE LETTER KA;Lo;0;L;;;;;N;;;;; 1B14;BALINESE LETTER KA MAHAPRANA;Lo;0;L;;;;;N;;;;; 1B15;BALINESE LETTER GA;Lo;0;L;;;;;N;;;;; 1B16;BALINESE LETTER GA GORA;Lo;0;L;;;;;N;;;;; 1B17;BALINESE LETTER NGA;Lo;0;L;;;;;N;;;;; 1B18;BALINESE LETTER CA;Lo;0;L;;;;;N;;;;; 1B19;BALINESE LETTER CA LACA;Lo;0;L;;;;;N;;;;; 1B1A;BALINESE LETTER JA;Lo;0;L;;;;;N;;;;; 1B1B;BALINESE LETTER JA JERA;Lo;0;L;;;;;N;;;;; 1B1C;BALINESE LETTER NYA;Lo;0;L;;;;;N;;;;; 1B1D;BALINESE LETTER TA LATIK;Lo;0;L;;;;;N;;;;; 1B1E;BALINESE LETTER TA MURDA MAHAPRANA;Lo;0;L;;;;;N;;;;; 1B1F;BALINESE LETTER DA MURDA ALPAPRANA;Lo;0;L;;;;;N;;;;; 1B20;BALINESE LETTER DA MURDA MAHAPRANA;Lo;0;L;;;;;N;;;;; 1B21;BALINESE LETTER NA RAMBAT;Lo;0;L;;;;;N;;;;; 1B22;BALINESE LETTER TA;Lo;0;L;;;;;N;;;;; 1B23;BALINESE LETTER TA TAWA;Lo;0;L;;;;;N;;;;; 1B24;BALINESE LETTER DA;Lo;0;L;;;;;N;;;;; 1B25;BALINESE LETTER DA MADU;Lo;0;L;;;;;N;;;;; 1B26;BALINESE LETTER NA;Lo;0;L;;;;;N;;;;; 1B27;BALINESE LETTER PA;Lo;0;L;;;;;N;;;;; 1B28;BALINESE LETTER PA KAPAL;Lo;0;L;;;;;N;;;;; 1B29;BALINESE LETTER BA;Lo;0;L;;;;;N;;;;; 1B2A;BALINESE LETTER BA KEMBANG;Lo;0;L;;;;;N;;;;; 1B2B;BALINESE LETTER MA;Lo;0;L;;;;;N;;;;; 1B2C;BALINESE LETTER YA;Lo;0;L;;;;;N;;;;; 1B2D;BALINESE LETTER RA;Lo;0;L;;;;;N;;;;; 1B2E;BALINESE LETTER LA;Lo;0;L;;;;;N;;;;; 1B2F;BALINESE LETTER WA;Lo;0;L;;;;;N;;;;; 1B30;BALINESE LETTER SA SAGA;Lo;0;L;;;;;N;;;;; 1B31;BALINESE LETTER SA SAPA;Lo;0;L;;;;;N;;;;; 1B32;BALINESE LETTER SA;Lo;0;L;;;;;N;;;;; 1B33;BALINESE LETTER HA;Lo;0;L;;;;;N;;;;; 1B34;BALINESE SIGN REREKAN;Mn;7;NSM;;;;;N;;;;; 1B35;BALINESE VOWEL SIGN TEDUNG;Mc;0;L;;;;;N;;;;; 1B36;BALINESE VOWEL SIGN ULU;Mn;0;NSM;;;;;N;;;;; 1B37;BALINESE VOWEL SIGN ULU SARI;Mn;0;NSM;;;;;N;;;;; 1B38;BALINESE VOWEL SIGN SUKU;Mn;0;NSM;;;;;N;;;;; 1B39;BALINESE VOWEL SIGN SUKU ILUT;Mn;0;NSM;;;;;N;;;;; 1B3A;BALINESE VOWEL SIGN RA REPA;Mn;0;NSM;;;;;N;;;;; 1B3B;BALINESE VOWEL SIGN RA REPA TEDUNG;Mc;0;L;1B3A 1B35;;;;N;;;;; 1B3C;BALINESE VOWEL SIGN LA LENGA;Mn;0;NSM;;;;;N;;;;; 1B3D;BALINESE VOWEL SIGN LA LENGA TEDUNG;Mc;0;L;1B3C 1B35;;;;N;;;;; 1B3E;BALINESE VOWEL SIGN TALING;Mc;0;L;;;;;N;;;;; 1B3F;BALINESE VOWEL SIGN TALING REPA;Mc;0;L;;;;;N;;;;; 1B40;BALINESE VOWEL SIGN TALING TEDUNG;Mc;0;L;1B3E 1B35;;;;N;;;;; 1B41;BALINESE VOWEL SIGN TALING REPA TEDUNG;Mc;0;L;1B3F 1B35;;;;N;;;;; 1B42;BALINESE VOWEL SIGN PEPET;Mn;0;NSM;;;;;N;;;;; 1B43;BALINESE VOWEL SIGN PEPET TEDUNG;Mc;0;L;1B42 1B35;;;;N;;;;; 1B44;BALINESE ADEG ADEG;Mc;9;L;;;;;N;;;;; 1B45;BALINESE LETTER KAF SASAK;Lo;0;L;;;;;N;;;;; 1B46;BALINESE LETTER KHOT SASAK;Lo;0;L;;;;;N;;;;; 1B47;BALINESE LETTER TZIR SASAK;Lo;0;L;;;;;N;;;;; 1B48;BALINESE LETTER EF SASAK;Lo;0;L;;;;;N;;;;; 1B49;BALINESE LETTER VE SASAK;Lo;0;L;;;;;N;;;;; 1B4A;BALINESE LETTER ZAL SASAK;Lo;0;L;;;;;N;;;;; 1B4B;BALINESE LETTER ASYURA SASAK;Lo;0;L;;;;;N;;;;; 1B50;BALINESE DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 1B51;BALINESE DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 1B52;BALINESE DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 1B53;BALINESE DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 1B54;BALINESE DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 1B55;BALINESE DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 1B56;BALINESE DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 1B57;BALINESE DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 1B58;BALINESE DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 1B59;BALINESE DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 1B5A;BALINESE PANTI;Po;0;L;;;;;N;;;;; 1B5B;BALINESE PAMADA;Po;0;L;;;;;N;;;;; 1B5C;BALINESE WINDU;Po;0;L;;;;;N;;;;; 1B5D;BALINESE CARIK PAMUNGKAH;Po;0;L;;;;;N;;;;; 1B5E;BALINESE CARIK SIKI;Po;0;L;;;;;N;;;;; 1B5F;BALINESE CARIK PAREREN;Po;0;L;;;;;N;;;;; 1B60;BALINESE PAMENENG;Po;0;L;;;;;N;;;;; 1B61;BALINESE MUSICAL SYMBOL DONG;So;0;L;;;;;N;;;;; 1B62;BALINESE MUSICAL SYMBOL DENG;So;0;L;;;;;N;;;;; 1B63;BALINESE MUSICAL SYMBOL DUNG;So;0;L;;;;;N;;;;; 1B64;BALINESE MUSICAL SYMBOL DANG;So;0;L;;;;;N;;;;; 1B65;BALINESE MUSICAL SYMBOL DANG SURANG;So;0;L;;;;;N;;;;; 1B66;BALINESE MUSICAL SYMBOL DING;So;0;L;;;;;N;;;;; 1B67;BALINESE MUSICAL SYMBOL DAENG;So;0;L;;;;;N;;;;; 1B68;BALINESE MUSICAL SYMBOL DEUNG;So;0;L;;;;;N;;;;; 1B69;BALINESE MUSICAL SYMBOL DAING;So;0;L;;;;;N;;;;; 1B6A;BALINESE MUSICAL SYMBOL DANG GEDE;So;0;L;;;;;N;;;;; 1B6B;BALINESE MUSICAL SYMBOL COMBINING TEGEH;Mn;230;NSM;;;;;N;;;;; 1B6C;BALINESE MUSICAL SYMBOL COMBINING ENDEP;Mn;220;NSM;;;;;N;;;;; 1B6D;BALINESE MUSICAL SYMBOL COMBINING KEMPUL;Mn;230;NSM;;;;;N;;;;; 1B6E;BALINESE MUSICAL SYMBOL COMBINING KEMPLI;Mn;230;NSM;;;;;N;;;;; 1B6F;BALINESE MUSICAL SYMBOL COMBINING JEGOGAN;Mn;230;NSM;;;;;N;;;;; 1B70;BALINESE MUSICAL SYMBOL COMBINING KEMPUL WITH JEGOGAN;Mn;230;NSM;;;;;N;;;;; 1B71;BALINESE MUSICAL SYMBOL COMBINING KEMPLI WITH JEGOGAN;Mn;230;NSM;;;;;N;;;;; 1B72;BALINESE MUSICAL SYMBOL COMBINING BENDE;Mn;230;NSM;;;;;N;;;;; 1B73;BALINESE MUSICAL SYMBOL COMBINING GONG;Mn;230;NSM;;;;;N;;;;; 1B74;BALINESE MUSICAL SYMBOL RIGHT-HAND OPEN DUG;So;0;L;;;;;N;;;;; 1B75;BALINESE MUSICAL SYMBOL RIGHT-HAND OPEN DAG;So;0;L;;;;;N;;;;; 1B76;BALINESE MUSICAL SYMBOL RIGHT-HAND CLOSED TUK;So;0;L;;;;;N;;;;; 1B77;BALINESE MUSICAL SYMBOL RIGHT-HAND CLOSED TAK;So;0;L;;;;;N;;;;; 1B78;BALINESE MUSICAL SYMBOL LEFT-HAND OPEN PANG;So;0;L;;;;;N;;;;; 1B79;BALINESE MUSICAL SYMBOL LEFT-HAND OPEN PUNG;So;0;L;;;;;N;;;;; 1B7A;BALINESE MUSICAL SYMBOL LEFT-HAND CLOSED PLAK;So;0;L;;;;;N;;;;; 1B7B;BALINESE MUSICAL SYMBOL LEFT-HAND CLOSED PLUK;So;0;L;;;;;N;;;;; 1B7C;BALINESE MUSICAL SYMBOL LEFT-HAND OPEN PING;So;0;L;;;;;N;;;;; 1B80;SUNDANESE SIGN PANYECEK;Mn;0;NSM;;;;;N;;;;; 1B81;SUNDANESE SIGN PANGLAYAR;Mn;0;NSM;;;;;N;;;;; 1B82;SUNDANESE SIGN PANGWISAD;Mc;0;L;;;;;N;;;;; 1B83;SUNDANESE LETTER A;Lo;0;L;;;;;N;;;;; 1B84;SUNDANESE LETTER I;Lo;0;L;;;;;N;;;;; 1B85;SUNDANESE LETTER U;Lo;0;L;;;;;N;;;;; 1B86;SUNDANESE LETTER AE;Lo;0;L;;;;;N;;;;; 1B87;SUNDANESE LETTER O;Lo;0;L;;;;;N;;;;; 1B88;SUNDANESE LETTER E;Lo;0;L;;;;;N;;;;; 1B89;SUNDANESE LETTER EU;Lo;0;L;;;;;N;;;;; 1B8A;SUNDANESE LETTER KA;Lo;0;L;;;;;N;;;;; 1B8B;SUNDANESE LETTER QA;Lo;0;L;;;;;N;;;;; 1B8C;SUNDANESE LETTER GA;Lo;0;L;;;;;N;;;;; 1B8D;SUNDANESE LETTER NGA;Lo;0;L;;;;;N;;;;; 1B8E;SUNDANESE LETTER CA;Lo;0;L;;;;;N;;;;; 1B8F;SUNDANESE LETTER JA;Lo;0;L;;;;;N;;;;; 1B90;SUNDANESE LETTER ZA;Lo;0;L;;;;;N;;;;; 1B91;SUNDANESE LETTER NYA;Lo;0;L;;;;;N;;;;; 1B92;SUNDANESE LETTER TA;Lo;0;L;;;;;N;;;;; 1B93;SUNDANESE LETTER DA;Lo;0;L;;;;;N;;;;; 1B94;SUNDANESE LETTER NA;Lo;0;L;;;;;N;;;;; 1B95;SUNDANESE LETTER PA;Lo;0;L;;;;;N;;;;; 1B96;SUNDANESE LETTER FA;Lo;0;L;;;;;N;;;;; 1B97;SUNDANESE LETTER VA;Lo;0;L;;;;;N;;;;; 1B98;SUNDANESE LETTER BA;Lo;0;L;;;;;N;;;;; 1B99;SUNDANESE LETTER MA;Lo;0;L;;;;;N;;;;; 1B9A;SUNDANESE LETTER YA;Lo;0;L;;;;;N;;;;; 1B9B;SUNDANESE LETTER RA;Lo;0;L;;;;;N;;;;; 1B9C;SUNDANESE LETTER LA;Lo;0;L;;;;;N;;;;; 1B9D;SUNDANESE LETTER WA;Lo;0;L;;;;;N;;;;; 1B9E;SUNDANESE LETTER SA;Lo;0;L;;;;;N;;;;; 1B9F;SUNDANESE LETTER XA;Lo;0;L;;;;;N;;;;; 1BA0;SUNDANESE LETTER HA;Lo;0;L;;;;;N;;;;; 1BA1;SUNDANESE CONSONANT SIGN PAMINGKAL;Mc;0;L;;;;;N;;;;; 1BA2;SUNDANESE CONSONANT SIGN PANYAKRA;Mn;0;NSM;;;;;N;;;;; 1BA3;SUNDANESE CONSONANT SIGN PANYIKU;Mn;0;NSM;;;;;N;;;;; 1BA4;SUNDANESE VOWEL SIGN PANGHULU;Mn;0;NSM;;;;;N;;;;; 1BA5;SUNDANESE VOWEL SIGN PANYUKU;Mn;0;NSM;;;;;N;;;;; 1BA6;SUNDANESE VOWEL SIGN PANAELAENG;Mc;0;L;;;;;N;;;;; 1BA7;SUNDANESE VOWEL SIGN PANOLONG;Mc;0;L;;;;;N;;;;; 1BA8;SUNDANESE VOWEL SIGN PAMEPET;Mn;0;NSM;;;;;N;;;;; 1BA9;SUNDANESE VOWEL SIGN PANEULEUNG;Mn;0;NSM;;;;;N;;;;; 1BAA;SUNDANESE SIGN PAMAAEH;Mc;9;L;;;;;N;;;;; 1BAB;SUNDANESE SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 1BAC;SUNDANESE CONSONANT SIGN PASANGAN MA;Mc;0;L;;;;;N;;;;; 1BAD;SUNDANESE CONSONANT SIGN PASANGAN WA;Mc;0;L;;;;;N;;;;; 1BAE;SUNDANESE LETTER KHA;Lo;0;L;;;;;N;;;;; 1BAF;SUNDANESE LETTER SYA;Lo;0;L;;;;;N;;;;; 1BB0;SUNDANESE DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 1BB1;SUNDANESE DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 1BB2;SUNDANESE DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 1BB3;SUNDANESE DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 1BB4;SUNDANESE DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 1BB5;SUNDANESE DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 1BB6;SUNDANESE DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 1BB7;SUNDANESE DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 1BB8;SUNDANESE DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 1BB9;SUNDANESE DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 1BBA;SUNDANESE AVAGRAHA;Lo;0;L;;;;;N;;;;; 1BBB;SUNDANESE LETTER REU;Lo;0;L;;;;;N;;;;; 1BBC;SUNDANESE LETTER LEU;Lo;0;L;;;;;N;;;;; 1BBD;SUNDANESE LETTER BHA;Lo;0;L;;;;;N;;;;; 1BBE;SUNDANESE LETTER FINAL K;Lo;0;L;;;;;N;;;;; 1BBF;SUNDANESE LETTER FINAL M;Lo;0;L;;;;;N;;;;; 1BC0;BATAK LETTER A;Lo;0;L;;;;;N;;;;; 1BC1;BATAK LETTER SIMALUNGUN A;Lo;0;L;;;;;N;;;;; 1BC2;BATAK LETTER HA;Lo;0;L;;;;;N;;;;; 1BC3;BATAK LETTER SIMALUNGUN HA;Lo;0;L;;;;;N;;;;; 1BC4;BATAK LETTER MANDAILING HA;Lo;0;L;;;;;N;;;;; 1BC5;BATAK LETTER BA;Lo;0;L;;;;;N;;;;; 1BC6;BATAK LETTER KARO BA;Lo;0;L;;;;;N;;;;; 1BC7;BATAK LETTER PA;Lo;0;L;;;;;N;;;;; 1BC8;BATAK LETTER SIMALUNGUN PA;Lo;0;L;;;;;N;;;;; 1BC9;BATAK LETTER NA;Lo;0;L;;;;;N;;;;; 1BCA;BATAK LETTER MANDAILING NA;Lo;0;L;;;;;N;;;;; 1BCB;BATAK LETTER WA;Lo;0;L;;;;;N;;;;; 1BCC;BATAK LETTER SIMALUNGUN WA;Lo;0;L;;;;;N;;;;; 1BCD;BATAK LETTER PAKPAK WA;Lo;0;L;;;;;N;;;;; 1BCE;BATAK LETTER GA;Lo;0;L;;;;;N;;;;; 1BCF;BATAK LETTER SIMALUNGUN GA;Lo;0;L;;;;;N;;;;; 1BD0;BATAK LETTER JA;Lo;0;L;;;;;N;;;;; 1BD1;BATAK LETTER DA;Lo;0;L;;;;;N;;;;; 1BD2;BATAK LETTER RA;Lo;0;L;;;;;N;;;;; 1BD3;BATAK LETTER SIMALUNGUN RA;Lo;0;L;;;;;N;;;;; 1BD4;BATAK LETTER MA;Lo;0;L;;;;;N;;;;; 1BD5;BATAK LETTER SIMALUNGUN MA;Lo;0;L;;;;;N;;;;; 1BD6;BATAK LETTER SOUTHERN TA;Lo;0;L;;;;;N;;;;; 1BD7;BATAK LETTER NORTHERN TA;Lo;0;L;;;;;N;;;;; 1BD8;BATAK LETTER SA;Lo;0;L;;;;;N;;;;; 1BD9;BATAK LETTER SIMALUNGUN SA;Lo;0;L;;;;;N;;;;; 1BDA;BATAK LETTER MANDAILING SA;Lo;0;L;;;;;N;;;;; 1BDB;BATAK LETTER YA;Lo;0;L;;;;;N;;;;; 1BDC;BATAK LETTER SIMALUNGUN YA;Lo;0;L;;;;;N;;;;; 1BDD;BATAK LETTER NGA;Lo;0;L;;;;;N;;;;; 1BDE;BATAK LETTER LA;Lo;0;L;;;;;N;;;;; 1BDF;BATAK LETTER SIMALUNGUN LA;Lo;0;L;;;;;N;;;;; 1BE0;BATAK LETTER NYA;Lo;0;L;;;;;N;;;;; 1BE1;BATAK LETTER CA;Lo;0;L;;;;;N;;;;; 1BE2;BATAK LETTER NDA;Lo;0;L;;;;;N;;;;; 1BE3;BATAK LETTER MBA;Lo;0;L;;;;;N;;;;; 1BE4;BATAK LETTER I;Lo;0;L;;;;;N;;;;; 1BE5;BATAK LETTER U;Lo;0;L;;;;;N;;;;; 1BE6;BATAK SIGN TOMPI;Mn;7;NSM;;;;;N;;;;; 1BE7;BATAK VOWEL SIGN E;Mc;0;L;;;;;N;;;;; 1BE8;BATAK VOWEL SIGN PAKPAK E;Mn;0;NSM;;;;;N;;;;; 1BE9;BATAK VOWEL SIGN EE;Mn;0;NSM;;;;;N;;;;; 1BEA;BATAK VOWEL SIGN I;Mc;0;L;;;;;N;;;;; 1BEB;BATAK VOWEL SIGN KARO I;Mc;0;L;;;;;N;;;;; 1BEC;BATAK VOWEL SIGN O;Mc;0;L;;;;;N;;;;; 1BED;BATAK VOWEL SIGN KARO O;Mn;0;NSM;;;;;N;;;;; 1BEE;BATAK VOWEL SIGN U;Mc;0;L;;;;;N;;;;; 1BEF;BATAK VOWEL SIGN U FOR SIMALUNGUN SA;Mn;0;NSM;;;;;N;;;;; 1BF0;BATAK CONSONANT SIGN NG;Mn;0;NSM;;;;;N;;;;; 1BF1;BATAK CONSONANT SIGN H;Mn;0;NSM;;;;;N;;;;; 1BF2;BATAK PANGOLAT;Mc;9;L;;;;;N;;;;; 1BF3;BATAK PANONGONAN;Mc;9;L;;;;;N;;;;; 1BFC;BATAK SYMBOL BINDU NA METEK;Po;0;L;;;;;N;;;;; 1BFD;BATAK SYMBOL BINDU PINARBORAS;Po;0;L;;;;;N;;;;; 1BFE;BATAK SYMBOL BINDU JUDUL;Po;0;L;;;;;N;;;;; 1BFF;BATAK SYMBOL BINDU PANGOLAT;Po;0;L;;;;;N;;;;; 1C00;LEPCHA LETTER KA;Lo;0;L;;;;;N;;;;; 1C01;LEPCHA LETTER KLA;Lo;0;L;;;;;N;;;;; 1C02;LEPCHA LETTER KHA;Lo;0;L;;;;;N;;;;; 1C03;LEPCHA LETTER GA;Lo;0;L;;;;;N;;;;; 1C04;LEPCHA LETTER GLA;Lo;0;L;;;;;N;;;;; 1C05;LEPCHA LETTER NGA;Lo;0;L;;;;;N;;;;; 1C06;LEPCHA LETTER CA;Lo;0;L;;;;;N;;;;; 1C07;LEPCHA LETTER CHA;Lo;0;L;;;;;N;;;;; 1C08;LEPCHA LETTER JA;Lo;0;L;;;;;N;;;;; 1C09;LEPCHA LETTER NYA;Lo;0;L;;;;;N;;;;; 1C0A;LEPCHA LETTER TA;Lo;0;L;;;;;N;;;;; 1C0B;LEPCHA LETTER THA;Lo;0;L;;;;;N;;;;; 1C0C;LEPCHA LETTER DA;Lo;0;L;;;;;N;;;;; 1C0D;LEPCHA LETTER NA;Lo;0;L;;;;;N;;;;; 1C0E;LEPCHA LETTER PA;Lo;0;L;;;;;N;;;;; 1C0F;LEPCHA LETTER PLA;Lo;0;L;;;;;N;;;;; 1C10;LEPCHA LETTER PHA;Lo;0;L;;;;;N;;;;; 1C11;LEPCHA LETTER FA;Lo;0;L;;;;;N;;;;; 1C12;LEPCHA LETTER FLA;Lo;0;L;;;;;N;;;;; 1C13;LEPCHA LETTER BA;Lo;0;L;;;;;N;;;;; 1C14;LEPCHA LETTER BLA;Lo;0;L;;;;;N;;;;; 1C15;LEPCHA LETTER MA;Lo;0;L;;;;;N;;;;; 1C16;LEPCHA LETTER MLA;Lo;0;L;;;;;N;;;;; 1C17;LEPCHA LETTER TSA;Lo;0;L;;;;;N;;;;; 1C18;LEPCHA LETTER TSHA;Lo;0;L;;;;;N;;;;; 1C19;LEPCHA LETTER DZA;Lo;0;L;;;;;N;;;;; 1C1A;LEPCHA LETTER YA;Lo;0;L;;;;;N;;;;; 1C1B;LEPCHA LETTER RA;Lo;0;L;;;;;N;;;;; 1C1C;LEPCHA LETTER LA;Lo;0;L;;;;;N;;;;; 1C1D;LEPCHA LETTER HA;Lo;0;L;;;;;N;;;;; 1C1E;LEPCHA LETTER HLA;Lo;0;L;;;;;N;;;;; 1C1F;LEPCHA LETTER VA;Lo;0;L;;;;;N;;;;; 1C20;LEPCHA LETTER SA;Lo;0;L;;;;;N;;;;; 1C21;LEPCHA LETTER SHA;Lo;0;L;;;;;N;;;;; 1C22;LEPCHA LETTER WA;Lo;0;L;;;;;N;;;;; 1C23;LEPCHA LETTER A;Lo;0;L;;;;;N;;;;; 1C24;LEPCHA SUBJOINED LETTER YA;Mc;0;L;;;;;N;;;;; 1C25;LEPCHA SUBJOINED LETTER RA;Mc;0;L;;;;;N;;;;; 1C26;LEPCHA VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 1C27;LEPCHA VOWEL SIGN I;Mc;0;L;;;;;N;;;;; 1C28;LEPCHA VOWEL SIGN O;Mc;0;L;;;;;N;;;;; 1C29;LEPCHA VOWEL SIGN OO;Mc;0;L;;;;;N;;;;; 1C2A;LEPCHA VOWEL SIGN U;Mc;0;L;;;;;N;;;;; 1C2B;LEPCHA VOWEL SIGN UU;Mc;0;L;;;;;N;;;;; 1C2C;LEPCHA VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; 1C2D;LEPCHA CONSONANT SIGN K;Mn;0;NSM;;;;;N;;;;; 1C2E;LEPCHA CONSONANT SIGN M;Mn;0;NSM;;;;;N;;;;; 1C2F;LEPCHA CONSONANT SIGN L;Mn;0;NSM;;;;;N;;;;; 1C30;LEPCHA CONSONANT SIGN N;Mn;0;NSM;;;;;N;;;;; 1C31;LEPCHA CONSONANT SIGN P;Mn;0;NSM;;;;;N;;;;; 1C32;LEPCHA CONSONANT SIGN R;Mn;0;NSM;;;;;N;;;;; 1C33;LEPCHA CONSONANT SIGN T;Mn;0;NSM;;;;;N;;;;; 1C34;LEPCHA CONSONANT SIGN NYIN-DO;Mc;0;L;;;;;N;;;;; 1C35;LEPCHA CONSONANT SIGN KANG;Mc;0;L;;;;;N;;;;; 1C36;LEPCHA SIGN RAN;Mn;0;NSM;;;;;N;;;;; 1C37;LEPCHA SIGN NUKTA;Mn;7;NSM;;;;;N;;;;; 1C3B;LEPCHA PUNCTUATION TA-ROL;Po;0;L;;;;;N;;;;; 1C3C;LEPCHA PUNCTUATION NYET THYOOM TA-ROL;Po;0;L;;;;;N;;;;; 1C3D;LEPCHA PUNCTUATION CER-WA;Po;0;L;;;;;N;;;;; 1C3E;LEPCHA PUNCTUATION TSHOOK CER-WA;Po;0;L;;;;;N;;;;; 1C3F;LEPCHA PUNCTUATION TSHOOK;Po;0;L;;;;;N;;;;; 1C40;LEPCHA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 1C41;LEPCHA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 1C42;LEPCHA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 1C43;LEPCHA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 1C44;LEPCHA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 1C45;LEPCHA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 1C46;LEPCHA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 1C47;LEPCHA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 1C48;LEPCHA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 1C49;LEPCHA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 1C4D;LEPCHA LETTER TTA;Lo;0;L;;;;;N;;;;; 1C4E;LEPCHA LETTER TTHA;Lo;0;L;;;;;N;;;;; 1C4F;LEPCHA LETTER DDA;Lo;0;L;;;;;N;;;;; 1C50;OL CHIKI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 1C51;OL CHIKI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 1C52;OL CHIKI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 1C53;OL CHIKI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 1C54;OL CHIKI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 1C55;OL CHIKI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 1C56;OL CHIKI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 1C57;OL CHIKI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 1C58;OL CHIKI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 1C59;OL CHIKI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 1C5A;OL CHIKI LETTER LA;Lo;0;L;;;;;N;;;;; 1C5B;OL CHIKI LETTER AT;Lo;0;L;;;;;N;;;;; 1C5C;OL CHIKI LETTER AG;Lo;0;L;;;;;N;;;;; 1C5D;OL CHIKI LETTER ANG;Lo;0;L;;;;;N;;;;; 1C5E;OL CHIKI LETTER AL;Lo;0;L;;;;;N;;;;; 1C5F;OL CHIKI LETTER LAA;Lo;0;L;;;;;N;;;;; 1C60;OL CHIKI LETTER AAK;Lo;0;L;;;;;N;;;;; 1C61;OL CHIKI LETTER AAJ;Lo;0;L;;;;;N;;;;; 1C62;OL CHIKI LETTER AAM;Lo;0;L;;;;;N;;;;; 1C63;OL CHIKI LETTER AAW;Lo;0;L;;;;;N;;;;; 1C64;OL CHIKI LETTER LI;Lo;0;L;;;;;N;;;;; 1C65;OL CHIKI LETTER IS;Lo;0;L;;;;;N;;;;; 1C66;OL CHIKI LETTER IH;Lo;0;L;;;;;N;;;;; 1C67;OL CHIKI LETTER INY;Lo;0;L;;;;;N;;;;; 1C68;OL CHIKI LETTER IR;Lo;0;L;;;;;N;;;;; 1C69;OL CHIKI LETTER LU;Lo;0;L;;;;;N;;;;; 1C6A;OL CHIKI LETTER UC;Lo;0;L;;;;;N;;;;; 1C6B;OL CHIKI LETTER UD;Lo;0;L;;;;;N;;;;; 1C6C;OL CHIKI LETTER UNN;Lo;0;L;;;;;N;;;;; 1C6D;OL CHIKI LETTER UY;Lo;0;L;;;;;N;;;;; 1C6E;OL CHIKI LETTER LE;Lo;0;L;;;;;N;;;;; 1C6F;OL CHIKI LETTER EP;Lo;0;L;;;;;N;;;;; 1C70;OL CHIKI LETTER EDD;Lo;0;L;;;;;N;;;;; 1C71;OL CHIKI LETTER EN;Lo;0;L;;;;;N;;;;; 1C72;OL CHIKI LETTER ERR;Lo;0;L;;;;;N;;;;; 1C73;OL CHIKI LETTER LO;Lo;0;L;;;;;N;;;;; 1C74;OL CHIKI LETTER OTT;Lo;0;L;;;;;N;;;;; 1C75;OL CHIKI LETTER OB;Lo;0;L;;;;;N;;;;; 1C76;OL CHIKI LETTER OV;Lo;0;L;;;;;N;;;;; 1C77;OL CHIKI LETTER OH;Lo;0;L;;;;;N;;;;; 1C78;OL CHIKI MU TTUDDAG;Lm;0;L;;;;;N;;;;; 1C79;OL CHIKI GAAHLAA TTUDDAAG;Lm;0;L;;;;;N;;;;; 1C7A;OL CHIKI MU-GAAHLAA TTUDDAAG;Lm;0;L;;;;;N;;;;; 1C7B;OL CHIKI RELAA;Lm;0;L;;;;;N;;;;; 1C7C;OL CHIKI PHAARKAA;Lm;0;L;;;;;N;;;;; 1C7D;OL CHIKI AHAD;Lm;0;L;;;;;N;;;;; 1C7E;OL CHIKI PUNCTUATION MUCAAD;Po;0;L;;;;;N;;;;; 1C7F;OL CHIKI PUNCTUATION DOUBLE MUCAAD;Po;0;L;;;;;N;;;;; 1CC0;SUNDANESE PUNCTUATION BINDU SURYA;Po;0;L;;;;;N;;;;; 1CC1;SUNDANESE PUNCTUATION BINDU PANGLONG;Po;0;L;;;;;N;;;;; 1CC2;SUNDANESE PUNCTUATION BINDU PURNAMA;Po;0;L;;;;;N;;;;; 1CC3;SUNDANESE PUNCTUATION BINDU CAKRA;Po;0;L;;;;;N;;;;; 1CC4;SUNDANESE PUNCTUATION BINDU LEU SATANGA;Po;0;L;;;;;N;;;;; 1CC5;SUNDANESE PUNCTUATION BINDU KA SATANGA;Po;0;L;;;;;N;;;;; 1CC6;SUNDANESE PUNCTUATION BINDU DA SATANGA;Po;0;L;;;;;N;;;;; 1CC7;SUNDANESE PUNCTUATION BINDU BA SATANGA;Po;0;L;;;;;N;;;;; 1CD0;VEDIC TONE KARSHANA;Mn;230;NSM;;;;;N;;;;; 1CD1;VEDIC TONE SHARA;Mn;230;NSM;;;;;N;;;;; 1CD2;VEDIC TONE PRENKHA;Mn;230;NSM;;;;;N;;;;; 1CD3;VEDIC SIGN NIHSHVASA;Po;0;L;;;;;N;;;;; 1CD4;VEDIC SIGN YAJURVEDIC MIDLINE SVARITA;Mn;1;NSM;;;;;N;;;;; 1CD5;VEDIC TONE YAJURVEDIC AGGRAVATED INDEPENDENT SVARITA;Mn;220;NSM;;;;;N;;;;; 1CD6;VEDIC TONE YAJURVEDIC INDEPENDENT SVARITA;Mn;220;NSM;;;;;N;;;;; 1CD7;VEDIC TONE YAJURVEDIC KATHAKA INDEPENDENT SVARITA;Mn;220;NSM;;;;;N;;;;; 1CD8;VEDIC TONE CANDRA BELOW;Mn;220;NSM;;;;;N;;;;; 1CD9;VEDIC TONE YAJURVEDIC KATHAKA INDEPENDENT SVARITA SCHROEDER;Mn;220;NSM;;;;;N;;;;; 1CDA;VEDIC TONE DOUBLE SVARITA;Mn;230;NSM;;;;;N;;;;; 1CDB;VEDIC TONE TRIPLE SVARITA;Mn;230;NSM;;;;;N;;;;; 1CDC;VEDIC TONE KATHAKA ANUDATTA;Mn;220;NSM;;;;;N;;;;; 1CDD;VEDIC TONE DOT BELOW;Mn;220;NSM;;;;;N;;;;; 1CDE;VEDIC TONE TWO DOTS BELOW;Mn;220;NSM;;;;;N;;;;; 1CDF;VEDIC TONE THREE DOTS BELOW;Mn;220;NSM;;;;;N;;;;; 1CE0;VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA;Mn;230;NSM;;;;;N;;;;; 1CE1;VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA;Mc;0;L;;;;;N;;;;; 1CE2;VEDIC SIGN VISARGA SVARITA;Mn;1;NSM;;;;;N;;;;; 1CE3;VEDIC SIGN VISARGA UDATTA;Mn;1;NSM;;;;;N;;;;; 1CE4;VEDIC SIGN REVERSED VISARGA UDATTA;Mn;1;NSM;;;;;N;;;;; 1CE5;VEDIC SIGN VISARGA ANUDATTA;Mn;1;NSM;;;;;N;;;;; 1CE6;VEDIC SIGN REVERSED VISARGA ANUDATTA;Mn;1;NSM;;;;;N;;;;; 1CE7;VEDIC SIGN VISARGA UDATTA WITH TAIL;Mn;1;NSM;;;;;N;;;;; 1CE8;VEDIC SIGN VISARGA ANUDATTA WITH TAIL;Mn;1;NSM;;;;;N;;;;; 1CE9;VEDIC SIGN ANUSVARA ANTARGOMUKHA;Lo;0;L;;;;;N;;;;; 1CEA;VEDIC SIGN ANUSVARA BAHIRGOMUKHA;Lo;0;L;;;;;N;;;;; 1CEB;VEDIC SIGN ANUSVARA VAMAGOMUKHA;Lo;0;L;;;;;N;;;;; 1CEC;VEDIC SIGN ANUSVARA VAMAGOMUKHA WITH TAIL;Lo;0;L;;;;;N;;;;; 1CED;VEDIC SIGN TIRYAK;Mn;220;NSM;;;;;N;;;;; 1CEE;VEDIC SIGN HEXIFORM LONG ANUSVARA;Lo;0;L;;;;;N;;;;; 1CEF;VEDIC SIGN LONG ANUSVARA;Lo;0;L;;;;;N;;;;; 1CF0;VEDIC SIGN RTHANG LONG ANUSVARA;Lo;0;L;;;;;N;;;;; 1CF1;VEDIC SIGN ANUSVARA UBHAYATO MUKHA;Lo;0;L;;;;;N;;;;; 1CF2;VEDIC SIGN ARDHAVISARGA;Mc;0;L;;;;;N;;;;; 1CF3;VEDIC SIGN ROTATED ARDHAVISARGA;Mc;0;L;;;;;N;;;;; 1CF4;VEDIC TONE CANDRA ABOVE;Mn;230;NSM;;;;;N;;;;; 1CF5;VEDIC SIGN JIHVAMULIYA;Lo;0;L;;;;;N;;;;; 1CF6;VEDIC SIGN UPADHMANIYA;Lo;0;L;;;;;N;;;;; 1D00;LATIN LETTER SMALL CAPITAL A;Ll;0;L;;;;;N;;;;; 1D01;LATIN LETTER SMALL CAPITAL AE;Ll;0;L;;;;;N;;;;; 1D02;LATIN SMALL LETTER TURNED AE;Ll;0;L;;;;;N;;;;; 1D03;LATIN LETTER SMALL CAPITAL BARRED B;Ll;0;L;;;;;N;;;;; 1D04;LATIN LETTER SMALL CAPITAL C;Ll;0;L;;;;;N;;;;; 1D05;LATIN LETTER SMALL CAPITAL D;Ll;0;L;;;;;N;;;;; 1D06;LATIN LETTER SMALL CAPITAL ETH;Ll;0;L;;;;;N;;;;; 1D07;LATIN LETTER SMALL CAPITAL E;Ll;0;L;;;;;N;;;;; 1D08;LATIN SMALL LETTER TURNED OPEN E;Ll;0;L;;;;;N;;;;; 1D09;LATIN SMALL LETTER TURNED I;Ll;0;L;;;;;N;;;;; 1D0A;LATIN LETTER SMALL CAPITAL J;Ll;0;L;;;;;N;;;;; 1D0B;LATIN LETTER SMALL CAPITAL K;Ll;0;L;;;;;N;;;;; 1D0C;LATIN LETTER SMALL CAPITAL L WITH STROKE;Ll;0;L;;;;;N;;;;; 1D0D;LATIN LETTER SMALL CAPITAL M;Ll;0;L;;;;;N;;;;; 1D0E;LATIN LETTER SMALL CAPITAL REVERSED N;Ll;0;L;;;;;N;;;;; 1D0F;LATIN LETTER SMALL CAPITAL O;Ll;0;L;;;;;N;;;;; 1D10;LATIN LETTER SMALL CAPITAL OPEN O;Ll;0;L;;;;;N;;;;; 1D11;LATIN SMALL LETTER SIDEWAYS O;Ll;0;L;;;;;N;;;;; 1D12;LATIN SMALL LETTER SIDEWAYS OPEN O;Ll;0;L;;;;;N;;;;; 1D13;LATIN SMALL LETTER SIDEWAYS O WITH STROKE;Ll;0;L;;;;;N;;;;; 1D14;LATIN SMALL LETTER TURNED OE;Ll;0;L;;;;;N;;;;; 1D15;LATIN LETTER SMALL CAPITAL OU;Ll;0;L;;;;;N;;;;; 1D16;LATIN SMALL LETTER TOP HALF O;Ll;0;L;;;;;N;;;;; 1D17;LATIN SMALL LETTER BOTTOM HALF O;Ll;0;L;;;;;N;;;;; 1D18;LATIN LETTER SMALL CAPITAL P;Ll;0;L;;;;;N;;;;; 1D19;LATIN LETTER SMALL CAPITAL REVERSED R;Ll;0;L;;;;;N;;;;; 1D1A;LATIN LETTER SMALL CAPITAL TURNED R;Ll;0;L;;;;;N;;;;; 1D1B;LATIN LETTER SMALL CAPITAL T;Ll;0;L;;;;;N;;;;; 1D1C;LATIN LETTER SMALL CAPITAL U;Ll;0;L;;;;;N;;;;; 1D1D;LATIN SMALL LETTER SIDEWAYS U;Ll;0;L;;;;;N;;;;; 1D1E;LATIN SMALL LETTER SIDEWAYS DIAERESIZED U;Ll;0;L;;;;;N;;;;; 1D1F;LATIN SMALL LETTER SIDEWAYS TURNED M;Ll;0;L;;;;;N;;;;; 1D20;LATIN LETTER SMALL CAPITAL V;Ll;0;L;;;;;N;;;;; 1D21;LATIN LETTER SMALL CAPITAL W;Ll;0;L;;;;;N;;;;; 1D22;LATIN LETTER SMALL CAPITAL Z;Ll;0;L;;;;;N;;;;; 1D23;LATIN LETTER SMALL CAPITAL EZH;Ll;0;L;;;;;N;;;;; 1D24;LATIN LETTER VOICED LARYNGEAL SPIRANT;Ll;0;L;;;;;N;;;;; 1D25;LATIN LETTER AIN;Ll;0;L;;;;;N;;;;; 1D26;GREEK LETTER SMALL CAPITAL GAMMA;Ll;0;L;;;;;N;;;;; 1D27;GREEK LETTER SMALL CAPITAL LAMDA;Ll;0;L;;;;;N;;;;; 1D28;GREEK LETTER SMALL CAPITAL PI;Ll;0;L;;;;;N;;;;; 1D29;GREEK LETTER SMALL CAPITAL RHO;Ll;0;L;;;;;N;;;;; 1D2A;GREEK LETTER SMALL CAPITAL PSI;Ll;0;L;;;;;N;;;;; 1D2B;CYRILLIC LETTER SMALL CAPITAL EL;Ll;0;L;;;;;N;;;;; 1D2C;MODIFIER LETTER CAPITAL A;Lm;0;L; 0041;;;;N;;;;; 1D2D;MODIFIER LETTER CAPITAL AE;Lm;0;L; 00C6;;;;N;;;;; 1D2E;MODIFIER LETTER CAPITAL B;Lm;0;L; 0042;;;;N;;;;; 1D2F;MODIFIER LETTER CAPITAL BARRED B;Lm;0;L;;;;;N;;;;; 1D30;MODIFIER LETTER CAPITAL D;Lm;0;L; 0044;;;;N;;;;; 1D31;MODIFIER LETTER CAPITAL E;Lm;0;L; 0045;;;;N;;;;; 1D32;MODIFIER LETTER CAPITAL REVERSED E;Lm;0;L; 018E;;;;N;;;;; 1D33;MODIFIER LETTER CAPITAL G;Lm;0;L; 0047;;;;N;;;;; 1D34;MODIFIER LETTER CAPITAL H;Lm;0;L; 0048;;;;N;;;;; 1D35;MODIFIER LETTER CAPITAL I;Lm;0;L; 0049;;;;N;;;;; 1D36;MODIFIER LETTER CAPITAL J;Lm;0;L; 004A;;;;N;;;;; 1D37;MODIFIER LETTER CAPITAL K;Lm;0;L; 004B;;;;N;;;;; 1D38;MODIFIER LETTER CAPITAL L;Lm;0;L; 004C;;;;N;;;;; 1D39;MODIFIER LETTER CAPITAL M;Lm;0;L; 004D;;;;N;;;;; 1D3A;MODIFIER LETTER CAPITAL N;Lm;0;L; 004E;;;;N;;;;; 1D3B;MODIFIER LETTER CAPITAL REVERSED N;Lm;0;L;;;;;N;;;;; 1D3C;MODIFIER LETTER CAPITAL O;Lm;0;L; 004F;;;;N;;;;; 1D3D;MODIFIER LETTER CAPITAL OU;Lm;0;L; 0222;;;;N;;;;; 1D3E;MODIFIER LETTER CAPITAL P;Lm;0;L; 0050;;;;N;;;;; 1D3F;MODIFIER LETTER CAPITAL R;Lm;0;L; 0052;;;;N;;;;; 1D40;MODIFIER LETTER CAPITAL T;Lm;0;L; 0054;;;;N;;;;; 1D41;MODIFIER LETTER CAPITAL U;Lm;0;L; 0055;;;;N;;;;; 1D42;MODIFIER LETTER CAPITAL W;Lm;0;L; 0057;;;;N;;;;; 1D43;MODIFIER LETTER SMALL A;Lm;0;L; 0061;;;;N;;;;; 1D44;MODIFIER LETTER SMALL TURNED A;Lm;0;L; 0250;;;;N;;;;; 1D45;MODIFIER LETTER SMALL ALPHA;Lm;0;L; 0251;;;;N;;;;; 1D46;MODIFIER LETTER SMALL TURNED AE;Lm;0;L; 1D02;;;;N;;;;; 1D47;MODIFIER LETTER SMALL B;Lm;0;L; 0062;;;;N;;;;; 1D48;MODIFIER LETTER SMALL D;Lm;0;L; 0064;;;;N;;;;; 1D49;MODIFIER LETTER SMALL E;Lm;0;L; 0065;;;;N;;;;; 1D4A;MODIFIER LETTER SMALL SCHWA;Lm;0;L; 0259;;;;N;;;;; 1D4B;MODIFIER LETTER SMALL OPEN E;Lm;0;L; 025B;;;;N;;;;; 1D4C;MODIFIER LETTER SMALL TURNED OPEN E;Lm;0;L; 025C;;;;N;;;;; 1D4D;MODIFIER LETTER SMALL G;Lm;0;L; 0067;;;;N;;;;; 1D4E;MODIFIER LETTER SMALL TURNED I;Lm;0;L;;;;;N;;;;; 1D4F;MODIFIER LETTER SMALL K;Lm;0;L; 006B;;;;N;;;;; 1D50;MODIFIER LETTER SMALL M;Lm;0;L; 006D;;;;N;;;;; 1D51;MODIFIER LETTER SMALL ENG;Lm;0;L; 014B;;;;N;;;;; 1D52;MODIFIER LETTER SMALL O;Lm;0;L; 006F;;;;N;;;;; 1D53;MODIFIER LETTER SMALL OPEN O;Lm;0;L; 0254;;;;N;;;;; 1D54;MODIFIER LETTER SMALL TOP HALF O;Lm;0;L; 1D16;;;;N;;;;; 1D55;MODIFIER LETTER SMALL BOTTOM HALF O;Lm;0;L; 1D17;;;;N;;;;; 1D56;MODIFIER LETTER SMALL P;Lm;0;L; 0070;;;;N;;;;; 1D57;MODIFIER LETTER SMALL T;Lm;0;L; 0074;;;;N;;;;; 1D58;MODIFIER LETTER SMALL U;Lm;0;L; 0075;;;;N;;;;; 1D59;MODIFIER LETTER SMALL SIDEWAYS U;Lm;0;L; 1D1D;;;;N;;;;; 1D5A;MODIFIER LETTER SMALL TURNED M;Lm;0;L; 026F;;;;N;;;;; 1D5B;MODIFIER LETTER SMALL V;Lm;0;L; 0076;;;;N;;;;; 1D5C;MODIFIER LETTER SMALL AIN;Lm;0;L; 1D25;;;;N;;;;; 1D5D;MODIFIER LETTER SMALL BETA;Lm;0;L; 03B2;;;;N;;;;; 1D5E;MODIFIER LETTER SMALL GREEK GAMMA;Lm;0;L; 03B3;;;;N;;;;; 1D5F;MODIFIER LETTER SMALL DELTA;Lm;0;L; 03B4;;;;N;;;;; 1D60;MODIFIER LETTER SMALL GREEK PHI;Lm;0;L; 03C6;;;;N;;;;; 1D61;MODIFIER LETTER SMALL CHI;Lm;0;L; 03C7;;;;N;;;;; 1D62;LATIN SUBSCRIPT SMALL LETTER I;Lm;0;L; 0069;;;;N;;;;; 1D63;LATIN SUBSCRIPT SMALL LETTER R;Lm;0;L; 0072;;;;N;;;;; 1D64;LATIN SUBSCRIPT SMALL LETTER U;Lm;0;L; 0075;;;;N;;;;; 1D65;LATIN SUBSCRIPT SMALL LETTER V;Lm;0;L; 0076;;;;N;;;;; 1D66;GREEK SUBSCRIPT SMALL LETTER BETA;Lm;0;L; 03B2;;;;N;;;;; 1D67;GREEK SUBSCRIPT SMALL LETTER GAMMA;Lm;0;L; 03B3;;;;N;;;;; 1D68;GREEK SUBSCRIPT SMALL LETTER RHO;Lm;0;L; 03C1;;;;N;;;;; 1D69;GREEK SUBSCRIPT SMALL LETTER PHI;Lm;0;L; 03C6;;;;N;;;;; 1D6A;GREEK SUBSCRIPT SMALL LETTER CHI;Lm;0;L; 03C7;;;;N;;;;; 1D6B;LATIN SMALL LETTER UE;Ll;0;L;;;;;N;;;;; 1D6C;LATIN SMALL LETTER B WITH MIDDLE TILDE;Ll;0;L;;;;;N;;;;; 1D6D;LATIN SMALL LETTER D WITH MIDDLE TILDE;Ll;0;L;;;;;N;;;;; 1D6E;LATIN SMALL LETTER F WITH MIDDLE TILDE;Ll;0;L;;;;;N;;;;; 1D6F;LATIN SMALL LETTER M WITH MIDDLE TILDE;Ll;0;L;;;;;N;;;;; 1D70;LATIN SMALL LETTER N WITH MIDDLE TILDE;Ll;0;L;;;;;N;;;;; 1D71;LATIN SMALL LETTER P WITH MIDDLE TILDE;Ll;0;L;;;;;N;;;;; 1D72;LATIN SMALL LETTER R WITH MIDDLE TILDE;Ll;0;L;;;;;N;;;;; 1D73;LATIN SMALL LETTER R WITH FISHHOOK AND MIDDLE TILDE;Ll;0;L;;;;;N;;;;; 1D74;LATIN SMALL LETTER S WITH MIDDLE TILDE;Ll;0;L;;;;;N;;;;; 1D75;LATIN SMALL LETTER T WITH MIDDLE TILDE;Ll;0;L;;;;;N;;;;; 1D76;LATIN SMALL LETTER Z WITH MIDDLE TILDE;Ll;0;L;;;;;N;;;;; 1D77;LATIN SMALL LETTER TURNED G;Ll;0;L;;;;;N;;;;; 1D78;MODIFIER LETTER CYRILLIC EN;Lm;0;L; 043D;;;;N;;;;; 1D79;LATIN SMALL LETTER INSULAR G;Ll;0;L;;;;;N;;;A77D;;A77D 1D7A;LATIN SMALL LETTER TH WITH STRIKETHROUGH;Ll;0;L;;;;;N;;;;; 1D7B;LATIN SMALL CAPITAL LETTER I WITH STROKE;Ll;0;L;;;;;N;;;;; 1D7C;LATIN SMALL LETTER IOTA WITH STROKE;Ll;0;L;;;;;N;;;;; 1D7D;LATIN SMALL LETTER P WITH STROKE;Ll;0;L;;;;;N;;;2C63;;2C63 1D7E;LATIN SMALL CAPITAL LETTER U WITH STROKE;Ll;0;L;;;;;N;;;;; 1D7F;LATIN SMALL LETTER UPSILON WITH STROKE;Ll;0;L;;;;;N;;;;; 1D80;LATIN SMALL LETTER B WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D81;LATIN SMALL LETTER D WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D82;LATIN SMALL LETTER F WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D83;LATIN SMALL LETTER G WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D84;LATIN SMALL LETTER K WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D85;LATIN SMALL LETTER L WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D86;LATIN SMALL LETTER M WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D87;LATIN SMALL LETTER N WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D88;LATIN SMALL LETTER P WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D89;LATIN SMALL LETTER R WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D8A;LATIN SMALL LETTER S WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D8B;LATIN SMALL LETTER ESH WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D8C;LATIN SMALL LETTER V WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D8D;LATIN SMALL LETTER X WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D8E;LATIN SMALL LETTER Z WITH PALATAL HOOK;Ll;0;L;;;;;N;;;;; 1D8F;LATIN SMALL LETTER A WITH RETROFLEX HOOK;Ll;0;L;;;;;N;;;;; 1D90;LATIN SMALL LETTER ALPHA WITH RETROFLEX HOOK;Ll;0;L;;;;;N;;;;; 1D91;LATIN SMALL LETTER D WITH HOOK AND TAIL;Ll;0;L;;;;;N;;;;; 1D92;LATIN SMALL LETTER E WITH RETROFLEX HOOK;Ll;0;L;;;;;N;;;;; 1D93;LATIN SMALL LETTER OPEN E WITH RETROFLEX HOOK;Ll;0;L;;;;;N;;;;; 1D94;LATIN SMALL LETTER REVERSED OPEN E WITH RETROFLEX HOOK;Ll;0;L;;;;;N;;;;; 1D95;LATIN SMALL LETTER SCHWA WITH RETROFLEX HOOK;Ll;0;L;;;;;N;;;;; 1D96;LATIN SMALL LETTER I WITH RETROFLEX HOOK;Ll;0;L;;;;;N;;;;; 1D97;LATIN SMALL LETTER OPEN O WITH RETROFLEX HOOK;Ll;0;L;;;;;N;;;;; 1D98;LATIN SMALL LETTER ESH WITH RETROFLEX HOOK;Ll;0;L;;;;;N;;;;; 1D99;LATIN SMALL LETTER U WITH RETROFLEX HOOK;Ll;0;L;;;;;N;;;;; 1D9A;LATIN SMALL LETTER EZH WITH RETROFLEX HOOK;Ll;0;L;;;;;N;;;;; 1D9B;MODIFIER LETTER SMALL TURNED ALPHA;Lm;0;L; 0252;;;;N;;;;; 1D9C;MODIFIER LETTER SMALL C;Lm;0;L; 0063;;;;N;;;;; 1D9D;MODIFIER LETTER SMALL C WITH CURL;Lm;0;L; 0255;;;;N;;;;; 1D9E;MODIFIER LETTER SMALL ETH;Lm;0;L; 00F0;;;;N;;;;; 1D9F;MODIFIER LETTER SMALL REVERSED OPEN E;Lm;0;L; 025C;;;;N;;;;; 1DA0;MODIFIER LETTER SMALL F;Lm;0;L; 0066;;;;N;;;;; 1DA1;MODIFIER LETTER SMALL DOTLESS J WITH STROKE;Lm;0;L; 025F;;;;N;;;;; 1DA2;MODIFIER LETTER SMALL SCRIPT G;Lm;0;L; 0261;;;;N;;;;; 1DA3;MODIFIER LETTER SMALL TURNED H;Lm;0;L; 0265;;;;N;;;;; 1DA4;MODIFIER LETTER SMALL I WITH STROKE;Lm;0;L; 0268;;;;N;;;;; 1DA5;MODIFIER LETTER SMALL IOTA;Lm;0;L; 0269;;;;N;;;;; 1DA6;MODIFIER LETTER SMALL CAPITAL I;Lm;0;L; 026A;;;;N;;;;; 1DA7;MODIFIER LETTER SMALL CAPITAL I WITH STROKE;Lm;0;L; 1D7B;;;;N;;;;; 1DA8;MODIFIER LETTER SMALL J WITH CROSSED-TAIL;Lm;0;L; 029D;;;;N;;;;; 1DA9;MODIFIER LETTER SMALL L WITH RETROFLEX HOOK;Lm;0;L; 026D;;;;N;;;;; 1DAA;MODIFIER LETTER SMALL L WITH PALATAL HOOK;Lm;0;L; 1D85;;;;N;;;;; 1DAB;MODIFIER LETTER SMALL CAPITAL L;Lm;0;L; 029F;;;;N;;;;; 1DAC;MODIFIER LETTER SMALL M WITH HOOK;Lm;0;L; 0271;;;;N;;;;; 1DAD;MODIFIER LETTER SMALL TURNED M WITH LONG LEG;Lm;0;L; 0270;;;;N;;;;; 1DAE;MODIFIER LETTER SMALL N WITH LEFT HOOK;Lm;0;L; 0272;;;;N;;;;; 1DAF;MODIFIER LETTER SMALL N WITH RETROFLEX HOOK;Lm;0;L; 0273;;;;N;;;;; 1DB0;MODIFIER LETTER SMALL CAPITAL N;Lm;0;L; 0274;;;;N;;;;; 1DB1;MODIFIER LETTER SMALL BARRED O;Lm;0;L; 0275;;;;N;;;;; 1DB2;MODIFIER LETTER SMALL PHI;Lm;0;L; 0278;;;;N;;;;; 1DB3;MODIFIER LETTER SMALL S WITH HOOK;Lm;0;L; 0282;;;;N;;;;; 1DB4;MODIFIER LETTER SMALL ESH;Lm;0;L; 0283;;;;N;;;;; 1DB5;MODIFIER LETTER SMALL T WITH PALATAL HOOK;Lm;0;L; 01AB;;;;N;;;;; 1DB6;MODIFIER LETTER SMALL U BAR;Lm;0;L; 0289;;;;N;;;;; 1DB7;MODIFIER LETTER SMALL UPSILON;Lm;0;L; 028A;;;;N;;;;; 1DB8;MODIFIER LETTER SMALL CAPITAL U;Lm;0;L; 1D1C;;;;N;;;;; 1DB9;MODIFIER LETTER SMALL V WITH HOOK;Lm;0;L; 028B;;;;N;;;;; 1DBA;MODIFIER LETTER SMALL TURNED V;Lm;0;L; 028C;;;;N;;;;; 1DBB;MODIFIER LETTER SMALL Z;Lm;0;L; 007A;;;;N;;;;; 1DBC;MODIFIER LETTER SMALL Z WITH RETROFLEX HOOK;Lm;0;L; 0290;;;;N;;;;; 1DBD;MODIFIER LETTER SMALL Z WITH CURL;Lm;0;L; 0291;;;;N;;;;; 1DBE;MODIFIER LETTER SMALL EZH;Lm;0;L; 0292;;;;N;;;;; 1DBF;MODIFIER LETTER SMALL THETA;Lm;0;L; 03B8;;;;N;;;;; 1DC0;COMBINING DOTTED GRAVE ACCENT;Mn;230;NSM;;;;;N;;;;; 1DC1;COMBINING DOTTED ACUTE ACCENT;Mn;230;NSM;;;;;N;;;;; 1DC2;COMBINING SNAKE BELOW;Mn;220;NSM;;;;;N;;;;; 1DC3;COMBINING SUSPENSION MARK;Mn;230;NSM;;;;;N;;;;; 1DC4;COMBINING MACRON-ACUTE;Mn;230;NSM;;;;;N;;;;; 1DC5;COMBINING GRAVE-MACRON;Mn;230;NSM;;;;;N;;;;; 1DC6;COMBINING MACRON-GRAVE;Mn;230;NSM;;;;;N;;;;; 1DC7;COMBINING ACUTE-MACRON;Mn;230;NSM;;;;;N;;;;; 1DC8;COMBINING GRAVE-ACUTE-GRAVE;Mn;230;NSM;;;;;N;;;;; 1DC9;COMBINING ACUTE-GRAVE-ACUTE;Mn;230;NSM;;;;;N;;;;; 1DCA;COMBINING LATIN SMALL LETTER R BELOW;Mn;220;NSM;;;;;N;;;;; 1DCB;COMBINING BREVE-MACRON;Mn;230;NSM;;;;;N;;;;; 1DCC;COMBINING MACRON-BREVE;Mn;230;NSM;;;;;N;;;;; 1DCD;COMBINING DOUBLE CIRCUMFLEX ABOVE;Mn;234;NSM;;;;;N;;;;; 1DCE;COMBINING OGONEK ABOVE;Mn;214;NSM;;;;;N;;;;; 1DCF;COMBINING ZIGZAG BELOW;Mn;220;NSM;;;;;N;;;;; 1DD0;COMBINING IS BELOW;Mn;202;NSM;;;;;N;;;;; 1DD1;COMBINING UR ABOVE;Mn;230;NSM;;;;;N;;;;; 1DD2;COMBINING US ABOVE;Mn;230;NSM;;;;;N;;;;; 1DD3;COMBINING LATIN SMALL LETTER FLATTENED OPEN A ABOVE;Mn;230;NSM;;;;;N;;;;; 1DD4;COMBINING LATIN SMALL LETTER AE;Mn;230;NSM;;;;;N;;;;; 1DD5;COMBINING LATIN SMALL LETTER AO;Mn;230;NSM;;;;;N;;;;; 1DD6;COMBINING LATIN SMALL LETTER AV;Mn;230;NSM;;;;;N;;;;; 1DD7;COMBINING LATIN SMALL LETTER C CEDILLA;Mn;230;NSM;;;;;N;;;;; 1DD8;COMBINING LATIN SMALL LETTER INSULAR D;Mn;230;NSM;;;;;N;;;;; 1DD9;COMBINING LATIN SMALL LETTER ETH;Mn;230;NSM;;;;;N;;;;; 1DDA;COMBINING LATIN SMALL LETTER G;Mn;230;NSM;;;;;N;;;;; 1DDB;COMBINING LATIN LETTER SMALL CAPITAL G;Mn;230;NSM;;;;;N;;;;; 1DDC;COMBINING LATIN SMALL LETTER K;Mn;230;NSM;;;;;N;;;;; 1DDD;COMBINING LATIN SMALL LETTER L;Mn;230;NSM;;;;;N;;;;; 1DDE;COMBINING LATIN LETTER SMALL CAPITAL L;Mn;230;NSM;;;;;N;;;;; 1DDF;COMBINING LATIN LETTER SMALL CAPITAL M;Mn;230;NSM;;;;;N;;;;; 1DE0;COMBINING LATIN SMALL LETTER N;Mn;230;NSM;;;;;N;;;;; 1DE1;COMBINING LATIN LETTER SMALL CAPITAL N;Mn;230;NSM;;;;;N;;;;; 1DE2;COMBINING LATIN LETTER SMALL CAPITAL R;Mn;230;NSM;;;;;N;;;;; 1DE3;COMBINING LATIN SMALL LETTER R ROTUNDA;Mn;230;NSM;;;;;N;;;;; 1DE4;COMBINING LATIN SMALL LETTER S;Mn;230;NSM;;;;;N;;;;; 1DE5;COMBINING LATIN SMALL LETTER LONG S;Mn;230;NSM;;;;;N;;;;; 1DE6;COMBINING LATIN SMALL LETTER Z;Mn;230;NSM;;;;;N;;;;; 1DFC;COMBINING DOUBLE INVERTED BREVE BELOW;Mn;233;NSM;;;;;N;;;;; 1DFD;COMBINING ALMOST EQUAL TO BELOW;Mn;220;NSM;;;;;N;;;;; 1DFE;COMBINING LEFT ARROWHEAD ABOVE;Mn;230;NSM;;;;;N;;;;; 1DFF;COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW;Mn;220;NSM;;;;;N;;;;; 1E00;LATIN CAPITAL LETTER A WITH RING BELOW;Lu;0;L;0041 0325;;;;N;;;;1E01; 1E01;LATIN SMALL LETTER A WITH RING BELOW;Ll;0;L;0061 0325;;;;N;;;1E00;;1E00 1E02;LATIN CAPITAL LETTER B WITH DOT ABOVE;Lu;0;L;0042 0307;;;;N;;;;1E03; 1E03;LATIN SMALL LETTER B WITH DOT ABOVE;Ll;0;L;0062 0307;;;;N;;;1E02;;1E02 1E04;LATIN CAPITAL LETTER B WITH DOT BELOW;Lu;0;L;0042 0323;;;;N;;;;1E05; 1E05;LATIN SMALL LETTER B WITH DOT BELOW;Ll;0;L;0062 0323;;;;N;;;1E04;;1E04 1E06;LATIN CAPITAL LETTER B WITH LINE BELOW;Lu;0;L;0042 0331;;;;N;;;;1E07; 1E07;LATIN SMALL LETTER B WITH LINE BELOW;Ll;0;L;0062 0331;;;;N;;;1E06;;1E06 1E08;LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE;Lu;0;L;00C7 0301;;;;N;;;;1E09; 1E09;LATIN SMALL LETTER C WITH CEDILLA AND ACUTE;Ll;0;L;00E7 0301;;;;N;;;1E08;;1E08 1E0A;LATIN CAPITAL LETTER D WITH DOT ABOVE;Lu;0;L;0044 0307;;;;N;;;;1E0B; 1E0B;LATIN SMALL LETTER D WITH DOT ABOVE;Ll;0;L;0064 0307;;;;N;;;1E0A;;1E0A 1E0C;LATIN CAPITAL LETTER D WITH DOT BELOW;Lu;0;L;0044 0323;;;;N;;;;1E0D; 1E0D;LATIN SMALL LETTER D WITH DOT BELOW;Ll;0;L;0064 0323;;;;N;;;1E0C;;1E0C 1E0E;LATIN CAPITAL LETTER D WITH LINE BELOW;Lu;0;L;0044 0331;;;;N;;;;1E0F; 1E0F;LATIN SMALL LETTER D WITH LINE BELOW;Ll;0;L;0064 0331;;;;N;;;1E0E;;1E0E 1E10;LATIN CAPITAL LETTER D WITH CEDILLA;Lu;0;L;0044 0327;;;;N;;;;1E11; 1E11;LATIN SMALL LETTER D WITH CEDILLA;Ll;0;L;0064 0327;;;;N;;;1E10;;1E10 1E12;LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW;Lu;0;L;0044 032D;;;;N;;;;1E13; 1E13;LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW;Ll;0;L;0064 032D;;;;N;;;1E12;;1E12 1E14;LATIN CAPITAL LETTER E WITH MACRON AND GRAVE;Lu;0;L;0112 0300;;;;N;;;;1E15; 1E15;LATIN SMALL LETTER E WITH MACRON AND GRAVE;Ll;0;L;0113 0300;;;;N;;;1E14;;1E14 1E16;LATIN CAPITAL LETTER E WITH MACRON AND ACUTE;Lu;0;L;0112 0301;;;;N;;;;1E17; 1E17;LATIN SMALL LETTER E WITH MACRON AND ACUTE;Ll;0;L;0113 0301;;;;N;;;1E16;;1E16 1E18;LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW;Lu;0;L;0045 032D;;;;N;;;;1E19; 1E19;LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW;Ll;0;L;0065 032D;;;;N;;;1E18;;1E18 1E1A;LATIN CAPITAL LETTER E WITH TILDE BELOW;Lu;0;L;0045 0330;;;;N;;;;1E1B; 1E1B;LATIN SMALL LETTER E WITH TILDE BELOW;Ll;0;L;0065 0330;;;;N;;;1E1A;;1E1A 1E1C;LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE;Lu;0;L;0228 0306;;;;N;;;;1E1D; 1E1D;LATIN SMALL LETTER E WITH CEDILLA AND BREVE;Ll;0;L;0229 0306;;;;N;;;1E1C;;1E1C 1E1E;LATIN CAPITAL LETTER F WITH DOT ABOVE;Lu;0;L;0046 0307;;;;N;;;;1E1F; 1E1F;LATIN SMALL LETTER F WITH DOT ABOVE;Ll;0;L;0066 0307;;;;N;;;1E1E;;1E1E 1E20;LATIN CAPITAL LETTER G WITH MACRON;Lu;0;L;0047 0304;;;;N;;;;1E21; 1E21;LATIN SMALL LETTER G WITH MACRON;Ll;0;L;0067 0304;;;;N;;;1E20;;1E20 1E22;LATIN CAPITAL LETTER H WITH DOT ABOVE;Lu;0;L;0048 0307;;;;N;;;;1E23; 1E23;LATIN SMALL LETTER H WITH DOT ABOVE;Ll;0;L;0068 0307;;;;N;;;1E22;;1E22 1E24;LATIN CAPITAL LETTER H WITH DOT BELOW;Lu;0;L;0048 0323;;;;N;;;;1E25; 1E25;LATIN SMALL LETTER H WITH DOT BELOW;Ll;0;L;0068 0323;;;;N;;;1E24;;1E24 1E26;LATIN CAPITAL LETTER H WITH DIAERESIS;Lu;0;L;0048 0308;;;;N;;;;1E27; 1E27;LATIN SMALL LETTER H WITH DIAERESIS;Ll;0;L;0068 0308;;;;N;;;1E26;;1E26 1E28;LATIN CAPITAL LETTER H WITH CEDILLA;Lu;0;L;0048 0327;;;;N;;;;1E29; 1E29;LATIN SMALL LETTER H WITH CEDILLA;Ll;0;L;0068 0327;;;;N;;;1E28;;1E28 1E2A;LATIN CAPITAL LETTER H WITH BREVE BELOW;Lu;0;L;0048 032E;;;;N;;;;1E2B; 1E2B;LATIN SMALL LETTER H WITH BREVE BELOW;Ll;0;L;0068 032E;;;;N;;;1E2A;;1E2A 1E2C;LATIN CAPITAL LETTER I WITH TILDE BELOW;Lu;0;L;0049 0330;;;;N;;;;1E2D; 1E2D;LATIN SMALL LETTER I WITH TILDE BELOW;Ll;0;L;0069 0330;;;;N;;;1E2C;;1E2C 1E2E;LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE;Lu;0;L;00CF 0301;;;;N;;;;1E2F; 1E2F;LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE;Ll;0;L;00EF 0301;;;;N;;;1E2E;;1E2E 1E30;LATIN CAPITAL LETTER K WITH ACUTE;Lu;0;L;004B 0301;;;;N;;;;1E31; 1E31;LATIN SMALL LETTER K WITH ACUTE;Ll;0;L;006B 0301;;;;N;;;1E30;;1E30 1E32;LATIN CAPITAL LETTER K WITH DOT BELOW;Lu;0;L;004B 0323;;;;N;;;;1E33; 1E33;LATIN SMALL LETTER K WITH DOT BELOW;Ll;0;L;006B 0323;;;;N;;;1E32;;1E32 1E34;LATIN CAPITAL LETTER K WITH LINE BELOW;Lu;0;L;004B 0331;;;;N;;;;1E35; 1E35;LATIN SMALL LETTER K WITH LINE BELOW;Ll;0;L;006B 0331;;;;N;;;1E34;;1E34 1E36;LATIN CAPITAL LETTER L WITH DOT BELOW;Lu;0;L;004C 0323;;;;N;;;;1E37; 1E37;LATIN SMALL LETTER L WITH DOT BELOW;Ll;0;L;006C 0323;;;;N;;;1E36;;1E36 1E38;LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON;Lu;0;L;1E36 0304;;;;N;;;;1E39; 1E39;LATIN SMALL LETTER L WITH DOT BELOW AND MACRON;Ll;0;L;1E37 0304;;;;N;;;1E38;;1E38 1E3A;LATIN CAPITAL LETTER L WITH LINE BELOW;Lu;0;L;004C 0331;;;;N;;;;1E3B; 1E3B;LATIN SMALL LETTER L WITH LINE BELOW;Ll;0;L;006C 0331;;;;N;;;1E3A;;1E3A 1E3C;LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW;Lu;0;L;004C 032D;;;;N;;;;1E3D; 1E3D;LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW;Ll;0;L;006C 032D;;;;N;;;1E3C;;1E3C 1E3E;LATIN CAPITAL LETTER M WITH ACUTE;Lu;0;L;004D 0301;;;;N;;;;1E3F; 1E3F;LATIN SMALL LETTER M WITH ACUTE;Ll;0;L;006D 0301;;;;N;;;1E3E;;1E3E 1E40;LATIN CAPITAL LETTER M WITH DOT ABOVE;Lu;0;L;004D 0307;;;;N;;;;1E41; 1E41;LATIN SMALL LETTER M WITH DOT ABOVE;Ll;0;L;006D 0307;;;;N;;;1E40;;1E40 1E42;LATIN CAPITAL LETTER M WITH DOT BELOW;Lu;0;L;004D 0323;;;;N;;;;1E43; 1E43;LATIN SMALL LETTER M WITH DOT BELOW;Ll;0;L;006D 0323;;;;N;;;1E42;;1E42 1E44;LATIN CAPITAL LETTER N WITH DOT ABOVE;Lu;0;L;004E 0307;;;;N;;;;1E45; 1E45;LATIN SMALL LETTER N WITH DOT ABOVE;Ll;0;L;006E 0307;;;;N;;;1E44;;1E44 1E46;LATIN CAPITAL LETTER N WITH DOT BELOW;Lu;0;L;004E 0323;;;;N;;;;1E47; 1E47;LATIN SMALL LETTER N WITH DOT BELOW;Ll;0;L;006E 0323;;;;N;;;1E46;;1E46 1E48;LATIN CAPITAL LETTER N WITH LINE BELOW;Lu;0;L;004E 0331;;;;N;;;;1E49; 1E49;LATIN SMALL LETTER N WITH LINE BELOW;Ll;0;L;006E 0331;;;;N;;;1E48;;1E48 1E4A;LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW;Lu;0;L;004E 032D;;;;N;;;;1E4B; 1E4B;LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW;Ll;0;L;006E 032D;;;;N;;;1E4A;;1E4A 1E4C;LATIN CAPITAL LETTER O WITH TILDE AND ACUTE;Lu;0;L;00D5 0301;;;;N;;;;1E4D; 1E4D;LATIN SMALL LETTER O WITH TILDE AND ACUTE;Ll;0;L;00F5 0301;;;;N;;;1E4C;;1E4C 1E4E;LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS;Lu;0;L;00D5 0308;;;;N;;;;1E4F; 1E4F;LATIN SMALL LETTER O WITH TILDE AND DIAERESIS;Ll;0;L;00F5 0308;;;;N;;;1E4E;;1E4E 1E50;LATIN CAPITAL LETTER O WITH MACRON AND GRAVE;Lu;0;L;014C 0300;;;;N;;;;1E51; 1E51;LATIN SMALL LETTER O WITH MACRON AND GRAVE;Ll;0;L;014D 0300;;;;N;;;1E50;;1E50 1E52;LATIN CAPITAL LETTER O WITH MACRON AND ACUTE;Lu;0;L;014C 0301;;;;N;;;;1E53; 1E53;LATIN SMALL LETTER O WITH MACRON AND ACUTE;Ll;0;L;014D 0301;;;;N;;;1E52;;1E52 1E54;LATIN CAPITAL LETTER P WITH ACUTE;Lu;0;L;0050 0301;;;;N;;;;1E55; 1E55;LATIN SMALL LETTER P WITH ACUTE;Ll;0;L;0070 0301;;;;N;;;1E54;;1E54 1E56;LATIN CAPITAL LETTER P WITH DOT ABOVE;Lu;0;L;0050 0307;;;;N;;;;1E57; 1E57;LATIN SMALL LETTER P WITH DOT ABOVE;Ll;0;L;0070 0307;;;;N;;;1E56;;1E56 1E58;LATIN CAPITAL LETTER R WITH DOT ABOVE;Lu;0;L;0052 0307;;;;N;;;;1E59; 1E59;LATIN SMALL LETTER R WITH DOT ABOVE;Ll;0;L;0072 0307;;;;N;;;1E58;;1E58 1E5A;LATIN CAPITAL LETTER R WITH DOT BELOW;Lu;0;L;0052 0323;;;;N;;;;1E5B; 1E5B;LATIN SMALL LETTER R WITH DOT BELOW;Ll;0;L;0072 0323;;;;N;;;1E5A;;1E5A 1E5C;LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON;Lu;0;L;1E5A 0304;;;;N;;;;1E5D; 1E5D;LATIN SMALL LETTER R WITH DOT BELOW AND MACRON;Ll;0;L;1E5B 0304;;;;N;;;1E5C;;1E5C 1E5E;LATIN CAPITAL LETTER R WITH LINE BELOW;Lu;0;L;0052 0331;;;;N;;;;1E5F; 1E5F;LATIN SMALL LETTER R WITH LINE BELOW;Ll;0;L;0072 0331;;;;N;;;1E5E;;1E5E 1E60;LATIN CAPITAL LETTER S WITH DOT ABOVE;Lu;0;L;0053 0307;;;;N;;;;1E61; 1E61;LATIN SMALL LETTER S WITH DOT ABOVE;Ll;0;L;0073 0307;;;;N;;;1E60;;1E60 1E62;LATIN CAPITAL LETTER S WITH DOT BELOW;Lu;0;L;0053 0323;;;;N;;;;1E63; 1E63;LATIN SMALL LETTER S WITH DOT BELOW;Ll;0;L;0073 0323;;;;N;;;1E62;;1E62 1E64;LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE;Lu;0;L;015A 0307;;;;N;;;;1E65; 1E65;LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE;Ll;0;L;015B 0307;;;;N;;;1E64;;1E64 1E66;LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE;Lu;0;L;0160 0307;;;;N;;;;1E67; 1E67;LATIN SMALL LETTER S WITH CARON AND DOT ABOVE;Ll;0;L;0161 0307;;;;N;;;1E66;;1E66 1E68;LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE;Lu;0;L;1E62 0307;;;;N;;;;1E69; 1E69;LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE;Ll;0;L;1E63 0307;;;;N;;;1E68;;1E68 1E6A;LATIN CAPITAL LETTER T WITH DOT ABOVE;Lu;0;L;0054 0307;;;;N;;;;1E6B; 1E6B;LATIN SMALL LETTER T WITH DOT ABOVE;Ll;0;L;0074 0307;;;;N;;;1E6A;;1E6A 1E6C;LATIN CAPITAL LETTER T WITH DOT BELOW;Lu;0;L;0054 0323;;;;N;;;;1E6D; 1E6D;LATIN SMALL LETTER T WITH DOT BELOW;Ll;0;L;0074 0323;;;;N;;;1E6C;;1E6C 1E6E;LATIN CAPITAL LETTER T WITH LINE BELOW;Lu;0;L;0054 0331;;;;N;;;;1E6F; 1E6F;LATIN SMALL LETTER T WITH LINE BELOW;Ll;0;L;0074 0331;;;;N;;;1E6E;;1E6E 1E70;LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW;Lu;0;L;0054 032D;;;;N;;;;1E71; 1E71;LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW;Ll;0;L;0074 032D;;;;N;;;1E70;;1E70 1E72;LATIN CAPITAL LETTER U WITH DIAERESIS BELOW;Lu;0;L;0055 0324;;;;N;;;;1E73; 1E73;LATIN SMALL LETTER U WITH DIAERESIS BELOW;Ll;0;L;0075 0324;;;;N;;;1E72;;1E72 1E74;LATIN CAPITAL LETTER U WITH TILDE BELOW;Lu;0;L;0055 0330;;;;N;;;;1E75; 1E75;LATIN SMALL LETTER U WITH TILDE BELOW;Ll;0;L;0075 0330;;;;N;;;1E74;;1E74 1E76;LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW;Lu;0;L;0055 032D;;;;N;;;;1E77; 1E77;LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW;Ll;0;L;0075 032D;;;;N;;;1E76;;1E76 1E78;LATIN CAPITAL LETTER U WITH TILDE AND ACUTE;Lu;0;L;0168 0301;;;;N;;;;1E79; 1E79;LATIN SMALL LETTER U WITH TILDE AND ACUTE;Ll;0;L;0169 0301;;;;N;;;1E78;;1E78 1E7A;LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS;Lu;0;L;016A 0308;;;;N;;;;1E7B; 1E7B;LATIN SMALL LETTER U WITH MACRON AND DIAERESIS;Ll;0;L;016B 0308;;;;N;;;1E7A;;1E7A 1E7C;LATIN CAPITAL LETTER V WITH TILDE;Lu;0;L;0056 0303;;;;N;;;;1E7D; 1E7D;LATIN SMALL LETTER V WITH TILDE;Ll;0;L;0076 0303;;;;N;;;1E7C;;1E7C 1E7E;LATIN CAPITAL LETTER V WITH DOT BELOW;Lu;0;L;0056 0323;;;;N;;;;1E7F; 1E7F;LATIN SMALL LETTER V WITH DOT BELOW;Ll;0;L;0076 0323;;;;N;;;1E7E;;1E7E 1E80;LATIN CAPITAL LETTER W WITH GRAVE;Lu;0;L;0057 0300;;;;N;;;;1E81; 1E81;LATIN SMALL LETTER W WITH GRAVE;Ll;0;L;0077 0300;;;;N;;;1E80;;1E80 1E82;LATIN CAPITAL LETTER W WITH ACUTE;Lu;0;L;0057 0301;;;;N;;;;1E83; 1E83;LATIN SMALL LETTER W WITH ACUTE;Ll;0;L;0077 0301;;;;N;;;1E82;;1E82 1E84;LATIN CAPITAL LETTER W WITH DIAERESIS;Lu;0;L;0057 0308;;;;N;;;;1E85; 1E85;LATIN SMALL LETTER W WITH DIAERESIS;Ll;0;L;0077 0308;;;;N;;;1E84;;1E84 1E86;LATIN CAPITAL LETTER W WITH DOT ABOVE;Lu;0;L;0057 0307;;;;N;;;;1E87; 1E87;LATIN SMALL LETTER W WITH DOT ABOVE;Ll;0;L;0077 0307;;;;N;;;1E86;;1E86 1E88;LATIN CAPITAL LETTER W WITH DOT BELOW;Lu;0;L;0057 0323;;;;N;;;;1E89; 1E89;LATIN SMALL LETTER W WITH DOT BELOW;Ll;0;L;0077 0323;;;;N;;;1E88;;1E88 1E8A;LATIN CAPITAL LETTER X WITH DOT ABOVE;Lu;0;L;0058 0307;;;;N;;;;1E8B; 1E8B;LATIN SMALL LETTER X WITH DOT ABOVE;Ll;0;L;0078 0307;;;;N;;;1E8A;;1E8A 1E8C;LATIN CAPITAL LETTER X WITH DIAERESIS;Lu;0;L;0058 0308;;;;N;;;;1E8D; 1E8D;LATIN SMALL LETTER X WITH DIAERESIS;Ll;0;L;0078 0308;;;;N;;;1E8C;;1E8C 1E8E;LATIN CAPITAL LETTER Y WITH DOT ABOVE;Lu;0;L;0059 0307;;;;N;;;;1E8F; 1E8F;LATIN SMALL LETTER Y WITH DOT ABOVE;Ll;0;L;0079 0307;;;;N;;;1E8E;;1E8E 1E90;LATIN CAPITAL LETTER Z WITH CIRCUMFLEX;Lu;0;L;005A 0302;;;;N;;;;1E91; 1E91;LATIN SMALL LETTER Z WITH CIRCUMFLEX;Ll;0;L;007A 0302;;;;N;;;1E90;;1E90 1E92;LATIN CAPITAL LETTER Z WITH DOT BELOW;Lu;0;L;005A 0323;;;;N;;;;1E93; 1E93;LATIN SMALL LETTER Z WITH DOT BELOW;Ll;0;L;007A 0323;;;;N;;;1E92;;1E92 1E94;LATIN CAPITAL LETTER Z WITH LINE BELOW;Lu;0;L;005A 0331;;;;N;;;;1E95; 1E95;LATIN SMALL LETTER Z WITH LINE BELOW;Ll;0;L;007A 0331;;;;N;;;1E94;;1E94 1E96;LATIN SMALL LETTER H WITH LINE BELOW;Ll;0;L;0068 0331;;;;N;;;;; 1E97;LATIN SMALL LETTER T WITH DIAERESIS;Ll;0;L;0074 0308;;;;N;;;;; 1E98;LATIN SMALL LETTER W WITH RING ABOVE;Ll;0;L;0077 030A;;;;N;;;;; 1E99;LATIN SMALL LETTER Y WITH RING ABOVE;Ll;0;L;0079 030A;;;;N;;;;; 1E9A;LATIN SMALL LETTER A WITH RIGHT HALF RING;Ll;0;L; 0061 02BE;;;;N;;;;; 1E9B;LATIN SMALL LETTER LONG S WITH DOT ABOVE;Ll;0;L;017F 0307;;;;N;;;1E60;;1E60 1E9C;LATIN SMALL LETTER LONG S WITH DIAGONAL STROKE;Ll;0;L;;;;;N;;;;; 1E9D;LATIN SMALL LETTER LONG S WITH HIGH STROKE;Ll;0;L;;;;;N;;;;; 1E9E;LATIN CAPITAL LETTER SHARP S;Lu;0;L;;;;;N;;;;00DF; 1E9F;LATIN SMALL LETTER DELTA;Ll;0;L;;;;;N;;;;; 1EA0;LATIN CAPITAL LETTER A WITH DOT BELOW;Lu;0;L;0041 0323;;;;N;;;;1EA1; 1EA1;LATIN SMALL LETTER A WITH DOT BELOW;Ll;0;L;0061 0323;;;;N;;;1EA0;;1EA0 1EA2;LATIN CAPITAL LETTER A WITH HOOK ABOVE;Lu;0;L;0041 0309;;;;N;;;;1EA3; 1EA3;LATIN SMALL LETTER A WITH HOOK ABOVE;Ll;0;L;0061 0309;;;;N;;;1EA2;;1EA2 1EA4;LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE;Lu;0;L;00C2 0301;;;;N;;;;1EA5; 1EA5;LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE;Ll;0;L;00E2 0301;;;;N;;;1EA4;;1EA4 1EA6;LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE;Lu;0;L;00C2 0300;;;;N;;;;1EA7; 1EA7;LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE;Ll;0;L;00E2 0300;;;;N;;;1EA6;;1EA6 1EA8;LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE;Lu;0;L;00C2 0309;;;;N;;;;1EA9; 1EA9;LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE;Ll;0;L;00E2 0309;;;;N;;;1EA8;;1EA8 1EAA;LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE;Lu;0;L;00C2 0303;;;;N;;;;1EAB; 1EAB;LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE;Ll;0;L;00E2 0303;;;;N;;;1EAA;;1EAA 1EAC;LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW;Lu;0;L;1EA0 0302;;;;N;;;;1EAD; 1EAD;LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW;Ll;0;L;1EA1 0302;;;;N;;;1EAC;;1EAC 1EAE;LATIN CAPITAL LETTER A WITH BREVE AND ACUTE;Lu;0;L;0102 0301;;;;N;;;;1EAF; 1EAF;LATIN SMALL LETTER A WITH BREVE AND ACUTE;Ll;0;L;0103 0301;;;;N;;;1EAE;;1EAE 1EB0;LATIN CAPITAL LETTER A WITH BREVE AND GRAVE;Lu;0;L;0102 0300;;;;N;;;;1EB1; 1EB1;LATIN SMALL LETTER A WITH BREVE AND GRAVE;Ll;0;L;0103 0300;;;;N;;;1EB0;;1EB0 1EB2;LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE;Lu;0;L;0102 0309;;;;N;;;;1EB3; 1EB3;LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE;Ll;0;L;0103 0309;;;;N;;;1EB2;;1EB2 1EB4;LATIN CAPITAL LETTER A WITH BREVE AND TILDE;Lu;0;L;0102 0303;;;;N;;;;1EB5; 1EB5;LATIN SMALL LETTER A WITH BREVE AND TILDE;Ll;0;L;0103 0303;;;;N;;;1EB4;;1EB4 1EB6;LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW;Lu;0;L;1EA0 0306;;;;N;;;;1EB7; 1EB7;LATIN SMALL LETTER A WITH BREVE AND DOT BELOW;Ll;0;L;1EA1 0306;;;;N;;;1EB6;;1EB6 1EB8;LATIN CAPITAL LETTER E WITH DOT BELOW;Lu;0;L;0045 0323;;;;N;;;;1EB9; 1EB9;LATIN SMALL LETTER E WITH DOT BELOW;Ll;0;L;0065 0323;;;;N;;;1EB8;;1EB8 1EBA;LATIN CAPITAL LETTER E WITH HOOK ABOVE;Lu;0;L;0045 0309;;;;N;;;;1EBB; 1EBB;LATIN SMALL LETTER E WITH HOOK ABOVE;Ll;0;L;0065 0309;;;;N;;;1EBA;;1EBA 1EBC;LATIN CAPITAL LETTER E WITH TILDE;Lu;0;L;0045 0303;;;;N;;;;1EBD; 1EBD;LATIN SMALL LETTER E WITH TILDE;Ll;0;L;0065 0303;;;;N;;;1EBC;;1EBC 1EBE;LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE;Lu;0;L;00CA 0301;;;;N;;;;1EBF; 1EBF;LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE;Ll;0;L;00EA 0301;;;;N;;;1EBE;;1EBE 1EC0;LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE;Lu;0;L;00CA 0300;;;;N;;;;1EC1; 1EC1;LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE;Ll;0;L;00EA 0300;;;;N;;;1EC0;;1EC0 1EC2;LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE;Lu;0;L;00CA 0309;;;;N;;;;1EC3; 1EC3;LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE;Ll;0;L;00EA 0309;;;;N;;;1EC2;;1EC2 1EC4;LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE;Lu;0;L;00CA 0303;;;;N;;;;1EC5; 1EC5;LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE;Ll;0;L;00EA 0303;;;;N;;;1EC4;;1EC4 1EC6;LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW;Lu;0;L;1EB8 0302;;;;N;;;;1EC7; 1EC7;LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW;Ll;0;L;1EB9 0302;;;;N;;;1EC6;;1EC6 1EC8;LATIN CAPITAL LETTER I WITH HOOK ABOVE;Lu;0;L;0049 0309;;;;N;;;;1EC9; 1EC9;LATIN SMALL LETTER I WITH HOOK ABOVE;Ll;0;L;0069 0309;;;;N;;;1EC8;;1EC8 1ECA;LATIN CAPITAL LETTER I WITH DOT BELOW;Lu;0;L;0049 0323;;;;N;;;;1ECB; 1ECB;LATIN SMALL LETTER I WITH DOT BELOW;Ll;0;L;0069 0323;;;;N;;;1ECA;;1ECA 1ECC;LATIN CAPITAL LETTER O WITH DOT BELOW;Lu;0;L;004F 0323;;;;N;;;;1ECD; 1ECD;LATIN SMALL LETTER O WITH DOT BELOW;Ll;0;L;006F 0323;;;;N;;;1ECC;;1ECC 1ECE;LATIN CAPITAL LETTER O WITH HOOK ABOVE;Lu;0;L;004F 0309;;;;N;;;;1ECF; 1ECF;LATIN SMALL LETTER O WITH HOOK ABOVE;Ll;0;L;006F 0309;;;;N;;;1ECE;;1ECE 1ED0;LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE;Lu;0;L;00D4 0301;;;;N;;;;1ED1; 1ED1;LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE;Ll;0;L;00F4 0301;;;;N;;;1ED0;;1ED0 1ED2;LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE;Lu;0;L;00D4 0300;;;;N;;;;1ED3; 1ED3;LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE;Ll;0;L;00F4 0300;;;;N;;;1ED2;;1ED2 1ED4;LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE;Lu;0;L;00D4 0309;;;;N;;;;1ED5; 1ED5;LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE;Ll;0;L;00F4 0309;;;;N;;;1ED4;;1ED4 1ED6;LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE;Lu;0;L;00D4 0303;;;;N;;;;1ED7; 1ED7;LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE;Ll;0;L;00F4 0303;;;;N;;;1ED6;;1ED6 1ED8;LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW;Lu;0;L;1ECC 0302;;;;N;;;;1ED9; 1ED9;LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW;Ll;0;L;1ECD 0302;;;;N;;;1ED8;;1ED8 1EDA;LATIN CAPITAL LETTER O WITH HORN AND ACUTE;Lu;0;L;01A0 0301;;;;N;;;;1EDB; 1EDB;LATIN SMALL LETTER O WITH HORN AND ACUTE;Ll;0;L;01A1 0301;;;;N;;;1EDA;;1EDA 1EDC;LATIN CAPITAL LETTER O WITH HORN AND GRAVE;Lu;0;L;01A0 0300;;;;N;;;;1EDD; 1EDD;LATIN SMALL LETTER O WITH HORN AND GRAVE;Ll;0;L;01A1 0300;;;;N;;;1EDC;;1EDC 1EDE;LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE;Lu;0;L;01A0 0309;;;;N;;;;1EDF; 1EDF;LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE;Ll;0;L;01A1 0309;;;;N;;;1EDE;;1EDE 1EE0;LATIN CAPITAL LETTER O WITH HORN AND TILDE;Lu;0;L;01A0 0303;;;;N;;;;1EE1; 1EE1;LATIN SMALL LETTER O WITH HORN AND TILDE;Ll;0;L;01A1 0303;;;;N;;;1EE0;;1EE0 1EE2;LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW;Lu;0;L;01A0 0323;;;;N;;;;1EE3; 1EE3;LATIN SMALL LETTER O WITH HORN AND DOT BELOW;Ll;0;L;01A1 0323;;;;N;;;1EE2;;1EE2 1EE4;LATIN CAPITAL LETTER U WITH DOT BELOW;Lu;0;L;0055 0323;;;;N;;;;1EE5; 1EE5;LATIN SMALL LETTER U WITH DOT BELOW;Ll;0;L;0075 0323;;;;N;;;1EE4;;1EE4 1EE6;LATIN CAPITAL LETTER U WITH HOOK ABOVE;Lu;0;L;0055 0309;;;;N;;;;1EE7; 1EE7;LATIN SMALL LETTER U WITH HOOK ABOVE;Ll;0;L;0075 0309;;;;N;;;1EE6;;1EE6 1EE8;LATIN CAPITAL LETTER U WITH HORN AND ACUTE;Lu;0;L;01AF 0301;;;;N;;;;1EE9; 1EE9;LATIN SMALL LETTER U WITH HORN AND ACUTE;Ll;0;L;01B0 0301;;;;N;;;1EE8;;1EE8 1EEA;LATIN CAPITAL LETTER U WITH HORN AND GRAVE;Lu;0;L;01AF 0300;;;;N;;;;1EEB; 1EEB;LATIN SMALL LETTER U WITH HORN AND GRAVE;Ll;0;L;01B0 0300;;;;N;;;1EEA;;1EEA 1EEC;LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE;Lu;0;L;01AF 0309;;;;N;;;;1EED; 1EED;LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE;Ll;0;L;01B0 0309;;;;N;;;1EEC;;1EEC 1EEE;LATIN CAPITAL LETTER U WITH HORN AND TILDE;Lu;0;L;01AF 0303;;;;N;;;;1EEF; 1EEF;LATIN SMALL LETTER U WITH HORN AND TILDE;Ll;0;L;01B0 0303;;;;N;;;1EEE;;1EEE 1EF0;LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW;Lu;0;L;01AF 0323;;;;N;;;;1EF1; 1EF1;LATIN SMALL LETTER U WITH HORN AND DOT BELOW;Ll;0;L;01B0 0323;;;;N;;;1EF0;;1EF0 1EF2;LATIN CAPITAL LETTER Y WITH GRAVE;Lu;0;L;0059 0300;;;;N;;;;1EF3; 1EF3;LATIN SMALL LETTER Y WITH GRAVE;Ll;0;L;0079 0300;;;;N;;;1EF2;;1EF2 1EF4;LATIN CAPITAL LETTER Y WITH DOT BELOW;Lu;0;L;0059 0323;;;;N;;;;1EF5; 1EF5;LATIN SMALL LETTER Y WITH DOT BELOW;Ll;0;L;0079 0323;;;;N;;;1EF4;;1EF4 1EF6;LATIN CAPITAL LETTER Y WITH HOOK ABOVE;Lu;0;L;0059 0309;;;;N;;;;1EF7; 1EF7;LATIN SMALL LETTER Y WITH HOOK ABOVE;Ll;0;L;0079 0309;;;;N;;;1EF6;;1EF6 1EF8;LATIN CAPITAL LETTER Y WITH TILDE;Lu;0;L;0059 0303;;;;N;;;;1EF9; 1EF9;LATIN SMALL LETTER Y WITH TILDE;Ll;0;L;0079 0303;;;;N;;;1EF8;;1EF8 1EFA;LATIN CAPITAL LETTER MIDDLE-WELSH LL;Lu;0;L;;;;;N;;;;1EFB; 1EFB;LATIN SMALL LETTER MIDDLE-WELSH LL;Ll;0;L;;;;;N;;;1EFA;;1EFA 1EFC;LATIN CAPITAL LETTER MIDDLE-WELSH V;Lu;0;L;;;;;N;;;;1EFD; 1EFD;LATIN SMALL LETTER MIDDLE-WELSH V;Ll;0;L;;;;;N;;;1EFC;;1EFC 1EFE;LATIN CAPITAL LETTER Y WITH LOOP;Lu;0;L;;;;;N;;;;1EFF; 1EFF;LATIN SMALL LETTER Y WITH LOOP;Ll;0;L;;;;;N;;;1EFE;;1EFE 1F00;GREEK SMALL LETTER ALPHA WITH PSILI;Ll;0;L;03B1 0313;;;;N;;;1F08;;1F08 1F01;GREEK SMALL LETTER ALPHA WITH DASIA;Ll;0;L;03B1 0314;;;;N;;;1F09;;1F09 1F02;GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA;Ll;0;L;1F00 0300;;;;N;;;1F0A;;1F0A 1F03;GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA;Ll;0;L;1F01 0300;;;;N;;;1F0B;;1F0B 1F04;GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA;Ll;0;L;1F00 0301;;;;N;;;1F0C;;1F0C 1F05;GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA;Ll;0;L;1F01 0301;;;;N;;;1F0D;;1F0D 1F06;GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI;Ll;0;L;1F00 0342;;;;N;;;1F0E;;1F0E 1F07;GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI;Ll;0;L;1F01 0342;;;;N;;;1F0F;;1F0F 1F08;GREEK CAPITAL LETTER ALPHA WITH PSILI;Lu;0;L;0391 0313;;;;N;;;;1F00; 1F09;GREEK CAPITAL LETTER ALPHA WITH DASIA;Lu;0;L;0391 0314;;;;N;;;;1F01; 1F0A;GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA;Lu;0;L;1F08 0300;;;;N;;;;1F02; 1F0B;GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA;Lu;0;L;1F09 0300;;;;N;;;;1F03; 1F0C;GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA;Lu;0;L;1F08 0301;;;;N;;;;1F04; 1F0D;GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA;Lu;0;L;1F09 0301;;;;N;;;;1F05; 1F0E;GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI;Lu;0;L;1F08 0342;;;;N;;;;1F06; 1F0F;GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI;Lu;0;L;1F09 0342;;;;N;;;;1F07; 1F10;GREEK SMALL LETTER EPSILON WITH PSILI;Ll;0;L;03B5 0313;;;;N;;;1F18;;1F18 1F11;GREEK SMALL LETTER EPSILON WITH DASIA;Ll;0;L;03B5 0314;;;;N;;;1F19;;1F19 1F12;GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA;Ll;0;L;1F10 0300;;;;N;;;1F1A;;1F1A 1F13;GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA;Ll;0;L;1F11 0300;;;;N;;;1F1B;;1F1B 1F14;GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA;Ll;0;L;1F10 0301;;;;N;;;1F1C;;1F1C 1F15;GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA;Ll;0;L;1F11 0301;;;;N;;;1F1D;;1F1D 1F18;GREEK CAPITAL LETTER EPSILON WITH PSILI;Lu;0;L;0395 0313;;;;N;;;;1F10; 1F19;GREEK CAPITAL LETTER EPSILON WITH DASIA;Lu;0;L;0395 0314;;;;N;;;;1F11; 1F1A;GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA;Lu;0;L;1F18 0300;;;;N;;;;1F12; 1F1B;GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA;Lu;0;L;1F19 0300;;;;N;;;;1F13; 1F1C;GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA;Lu;0;L;1F18 0301;;;;N;;;;1F14; 1F1D;GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA;Lu;0;L;1F19 0301;;;;N;;;;1F15; 1F20;GREEK SMALL LETTER ETA WITH PSILI;Ll;0;L;03B7 0313;;;;N;;;1F28;;1F28 1F21;GREEK SMALL LETTER ETA WITH DASIA;Ll;0;L;03B7 0314;;;;N;;;1F29;;1F29 1F22;GREEK SMALL LETTER ETA WITH PSILI AND VARIA;Ll;0;L;1F20 0300;;;;N;;;1F2A;;1F2A 1F23;GREEK SMALL LETTER ETA WITH DASIA AND VARIA;Ll;0;L;1F21 0300;;;;N;;;1F2B;;1F2B 1F24;GREEK SMALL LETTER ETA WITH PSILI AND OXIA;Ll;0;L;1F20 0301;;;;N;;;1F2C;;1F2C 1F25;GREEK SMALL LETTER ETA WITH DASIA AND OXIA;Ll;0;L;1F21 0301;;;;N;;;1F2D;;1F2D 1F26;GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI;Ll;0;L;1F20 0342;;;;N;;;1F2E;;1F2E 1F27;GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI;Ll;0;L;1F21 0342;;;;N;;;1F2F;;1F2F 1F28;GREEK CAPITAL LETTER ETA WITH PSILI;Lu;0;L;0397 0313;;;;N;;;;1F20; 1F29;GREEK CAPITAL LETTER ETA WITH DASIA;Lu;0;L;0397 0314;;;;N;;;;1F21; 1F2A;GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA;Lu;0;L;1F28 0300;;;;N;;;;1F22; 1F2B;GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA;Lu;0;L;1F29 0300;;;;N;;;;1F23; 1F2C;GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA;Lu;0;L;1F28 0301;;;;N;;;;1F24; 1F2D;GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA;Lu;0;L;1F29 0301;;;;N;;;;1F25; 1F2E;GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI;Lu;0;L;1F28 0342;;;;N;;;;1F26; 1F2F;GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI;Lu;0;L;1F29 0342;;;;N;;;;1F27; 1F30;GREEK SMALL LETTER IOTA WITH PSILI;Ll;0;L;03B9 0313;;;;N;;;1F38;;1F38 1F31;GREEK SMALL LETTER IOTA WITH DASIA;Ll;0;L;03B9 0314;;;;N;;;1F39;;1F39 1F32;GREEK SMALL LETTER IOTA WITH PSILI AND VARIA;Ll;0;L;1F30 0300;;;;N;;;1F3A;;1F3A 1F33;GREEK SMALL LETTER IOTA WITH DASIA AND VARIA;Ll;0;L;1F31 0300;;;;N;;;1F3B;;1F3B 1F34;GREEK SMALL LETTER IOTA WITH PSILI AND OXIA;Ll;0;L;1F30 0301;;;;N;;;1F3C;;1F3C 1F35;GREEK SMALL LETTER IOTA WITH DASIA AND OXIA;Ll;0;L;1F31 0301;;;;N;;;1F3D;;1F3D 1F36;GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI;Ll;0;L;1F30 0342;;;;N;;;1F3E;;1F3E 1F37;GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI;Ll;0;L;1F31 0342;;;;N;;;1F3F;;1F3F 1F38;GREEK CAPITAL LETTER IOTA WITH PSILI;Lu;0;L;0399 0313;;;;N;;;;1F30; 1F39;GREEK CAPITAL LETTER IOTA WITH DASIA;Lu;0;L;0399 0314;;;;N;;;;1F31; 1F3A;GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA;Lu;0;L;1F38 0300;;;;N;;;;1F32; 1F3B;GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA;Lu;0;L;1F39 0300;;;;N;;;;1F33; 1F3C;GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA;Lu;0;L;1F38 0301;;;;N;;;;1F34; 1F3D;GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA;Lu;0;L;1F39 0301;;;;N;;;;1F35; 1F3E;GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI;Lu;0;L;1F38 0342;;;;N;;;;1F36; 1F3F;GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI;Lu;0;L;1F39 0342;;;;N;;;;1F37; 1F40;GREEK SMALL LETTER OMICRON WITH PSILI;Ll;0;L;03BF 0313;;;;N;;;1F48;;1F48 1F41;GREEK SMALL LETTER OMICRON WITH DASIA;Ll;0;L;03BF 0314;;;;N;;;1F49;;1F49 1F42;GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA;Ll;0;L;1F40 0300;;;;N;;;1F4A;;1F4A 1F43;GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA;Ll;0;L;1F41 0300;;;;N;;;1F4B;;1F4B 1F44;GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA;Ll;0;L;1F40 0301;;;;N;;;1F4C;;1F4C 1F45;GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA;Ll;0;L;1F41 0301;;;;N;;;1F4D;;1F4D 1F48;GREEK CAPITAL LETTER OMICRON WITH PSILI;Lu;0;L;039F 0313;;;;N;;;;1F40; 1F49;GREEK CAPITAL LETTER OMICRON WITH DASIA;Lu;0;L;039F 0314;;;;N;;;;1F41; 1F4A;GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA;Lu;0;L;1F48 0300;;;;N;;;;1F42; 1F4B;GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA;Lu;0;L;1F49 0300;;;;N;;;;1F43; 1F4C;GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA;Lu;0;L;1F48 0301;;;;N;;;;1F44; 1F4D;GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA;Lu;0;L;1F49 0301;;;;N;;;;1F45; 1F50;GREEK SMALL LETTER UPSILON WITH PSILI;Ll;0;L;03C5 0313;;;;N;;;;; 1F51;GREEK SMALL LETTER UPSILON WITH DASIA;Ll;0;L;03C5 0314;;;;N;;;1F59;;1F59 1F52;GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA;Ll;0;L;1F50 0300;;;;N;;;;; 1F53;GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA;Ll;0;L;1F51 0300;;;;N;;;1F5B;;1F5B 1F54;GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA;Ll;0;L;1F50 0301;;;;N;;;;; 1F55;GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA;Ll;0;L;1F51 0301;;;;N;;;1F5D;;1F5D 1F56;GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI;Ll;0;L;1F50 0342;;;;N;;;;; 1F57;GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI;Ll;0;L;1F51 0342;;;;N;;;1F5F;;1F5F 1F59;GREEK CAPITAL LETTER UPSILON WITH DASIA;Lu;0;L;03A5 0314;;;;N;;;;1F51; 1F5B;GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA;Lu;0;L;1F59 0300;;;;N;;;;1F53; 1F5D;GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA;Lu;0;L;1F59 0301;;;;N;;;;1F55; 1F5F;GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI;Lu;0;L;1F59 0342;;;;N;;;;1F57; 1F60;GREEK SMALL LETTER OMEGA WITH PSILI;Ll;0;L;03C9 0313;;;;N;;;1F68;;1F68 1F61;GREEK SMALL LETTER OMEGA WITH DASIA;Ll;0;L;03C9 0314;;;;N;;;1F69;;1F69 1F62;GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA;Ll;0;L;1F60 0300;;;;N;;;1F6A;;1F6A 1F63;GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA;Ll;0;L;1F61 0300;;;;N;;;1F6B;;1F6B 1F64;GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA;Ll;0;L;1F60 0301;;;;N;;;1F6C;;1F6C 1F65;GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA;Ll;0;L;1F61 0301;;;;N;;;1F6D;;1F6D 1F66;GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI;Ll;0;L;1F60 0342;;;;N;;;1F6E;;1F6E 1F67;GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI;Ll;0;L;1F61 0342;;;;N;;;1F6F;;1F6F 1F68;GREEK CAPITAL LETTER OMEGA WITH PSILI;Lu;0;L;03A9 0313;;;;N;;;;1F60; 1F69;GREEK CAPITAL LETTER OMEGA WITH DASIA;Lu;0;L;03A9 0314;;;;N;;;;1F61; 1F6A;GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA;Lu;0;L;1F68 0300;;;;N;;;;1F62; 1F6B;GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA;Lu;0;L;1F69 0300;;;;N;;;;1F63; 1F6C;GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA;Lu;0;L;1F68 0301;;;;N;;;;1F64; 1F6D;GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA;Lu;0;L;1F69 0301;;;;N;;;;1F65; 1F6E;GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI;Lu;0;L;1F68 0342;;;;N;;;;1F66; 1F6F;GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI;Lu;0;L;1F69 0342;;;;N;;;;1F67; 1F70;GREEK SMALL LETTER ALPHA WITH VARIA;Ll;0;L;03B1 0300;;;;N;;;1FBA;;1FBA 1F71;GREEK SMALL LETTER ALPHA WITH OXIA;Ll;0;L;03AC;;;;N;;;1FBB;;1FBB 1F72;GREEK SMALL LETTER EPSILON WITH VARIA;Ll;0;L;03B5 0300;;;;N;;;1FC8;;1FC8 1F73;GREEK SMALL LETTER EPSILON WITH OXIA;Ll;0;L;03AD;;;;N;;;1FC9;;1FC9 1F74;GREEK SMALL LETTER ETA WITH VARIA;Ll;0;L;03B7 0300;;;;N;;;1FCA;;1FCA 1F75;GREEK SMALL LETTER ETA WITH OXIA;Ll;0;L;03AE;;;;N;;;1FCB;;1FCB 1F76;GREEK SMALL LETTER IOTA WITH VARIA;Ll;0;L;03B9 0300;;;;N;;;1FDA;;1FDA 1F77;GREEK SMALL LETTER IOTA WITH OXIA;Ll;0;L;03AF;;;;N;;;1FDB;;1FDB 1F78;GREEK SMALL LETTER OMICRON WITH VARIA;Ll;0;L;03BF 0300;;;;N;;;1FF8;;1FF8 1F79;GREEK SMALL LETTER OMICRON WITH OXIA;Ll;0;L;03CC;;;;N;;;1FF9;;1FF9 1F7A;GREEK SMALL LETTER UPSILON WITH VARIA;Ll;0;L;03C5 0300;;;;N;;;1FEA;;1FEA 1F7B;GREEK SMALL LETTER UPSILON WITH OXIA;Ll;0;L;03CD;;;;N;;;1FEB;;1FEB 1F7C;GREEK SMALL LETTER OMEGA WITH VARIA;Ll;0;L;03C9 0300;;;;N;;;1FFA;;1FFA 1F7D;GREEK SMALL LETTER OMEGA WITH OXIA;Ll;0;L;03CE;;;;N;;;1FFB;;1FFB 1F80;GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI;Ll;0;L;1F00 0345;;;;N;;;1F88;;1F88 1F81;GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI;Ll;0;L;1F01 0345;;;;N;;;1F89;;1F89 1F82;GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI;Ll;0;L;1F02 0345;;;;N;;;1F8A;;1F8A 1F83;GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI;Ll;0;L;1F03 0345;;;;N;;;1F8B;;1F8B 1F84;GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI;Ll;0;L;1F04 0345;;;;N;;;1F8C;;1F8C 1F85;GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI;Ll;0;L;1F05 0345;;;;N;;;1F8D;;1F8D 1F86;GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI;Ll;0;L;1F06 0345;;;;N;;;1F8E;;1F8E 1F87;GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI;Ll;0;L;1F07 0345;;;;N;;;1F8F;;1F8F 1F88;GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI;Lt;0;L;1F08 0345;;;;N;;;;1F80; 1F89;GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI;Lt;0;L;1F09 0345;;;;N;;;;1F81; 1F8A;GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI;Lt;0;L;1F0A 0345;;;;N;;;;1F82; 1F8B;GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI;Lt;0;L;1F0B 0345;;;;N;;;;1F83; 1F8C;GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI;Lt;0;L;1F0C 0345;;;;N;;;;1F84; 1F8D;GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI;Lt;0;L;1F0D 0345;;;;N;;;;1F85; 1F8E;GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI;Lt;0;L;1F0E 0345;;;;N;;;;1F86; 1F8F;GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI;Lt;0;L;1F0F 0345;;;;N;;;;1F87; 1F90;GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI;Ll;0;L;1F20 0345;;;;N;;;1F98;;1F98 1F91;GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI;Ll;0;L;1F21 0345;;;;N;;;1F99;;1F99 1F92;GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI;Ll;0;L;1F22 0345;;;;N;;;1F9A;;1F9A 1F93;GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI;Ll;0;L;1F23 0345;;;;N;;;1F9B;;1F9B 1F94;GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI;Ll;0;L;1F24 0345;;;;N;;;1F9C;;1F9C 1F95;GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI;Ll;0;L;1F25 0345;;;;N;;;1F9D;;1F9D 1F96;GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI;Ll;0;L;1F26 0345;;;;N;;;1F9E;;1F9E 1F97;GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI;Ll;0;L;1F27 0345;;;;N;;;1F9F;;1F9F 1F98;GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI;Lt;0;L;1F28 0345;;;;N;;;;1F90; 1F99;GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI;Lt;0;L;1F29 0345;;;;N;;;;1F91; 1F9A;GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI;Lt;0;L;1F2A 0345;;;;N;;;;1F92; 1F9B;GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI;Lt;0;L;1F2B 0345;;;;N;;;;1F93; 1F9C;GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI;Lt;0;L;1F2C 0345;;;;N;;;;1F94; 1F9D;GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI;Lt;0;L;1F2D 0345;;;;N;;;;1F95; 1F9E;GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI;Lt;0;L;1F2E 0345;;;;N;;;;1F96; 1F9F;GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI;Lt;0;L;1F2F 0345;;;;N;;;;1F97; 1FA0;GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI;Ll;0;L;1F60 0345;;;;N;;;1FA8;;1FA8 1FA1;GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI;Ll;0;L;1F61 0345;;;;N;;;1FA9;;1FA9 1FA2;GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI;Ll;0;L;1F62 0345;;;;N;;;1FAA;;1FAA 1FA3;GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI;Ll;0;L;1F63 0345;;;;N;;;1FAB;;1FAB 1FA4;GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI;Ll;0;L;1F64 0345;;;;N;;;1FAC;;1FAC 1FA5;GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI;Ll;0;L;1F65 0345;;;;N;;;1FAD;;1FAD 1FA6;GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI;Ll;0;L;1F66 0345;;;;N;;;1FAE;;1FAE 1FA7;GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI;Ll;0;L;1F67 0345;;;;N;;;1FAF;;1FAF 1FA8;GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI;Lt;0;L;1F68 0345;;;;N;;;;1FA0; 1FA9;GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI;Lt;0;L;1F69 0345;;;;N;;;;1FA1; 1FAA;GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI;Lt;0;L;1F6A 0345;;;;N;;;;1FA2; 1FAB;GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI;Lt;0;L;1F6B 0345;;;;N;;;;1FA3; 1FAC;GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI;Lt;0;L;1F6C 0345;;;;N;;;;1FA4; 1FAD;GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI;Lt;0;L;1F6D 0345;;;;N;;;;1FA5; 1FAE;GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI;Lt;0;L;1F6E 0345;;;;N;;;;1FA6; 1FAF;GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI;Lt;0;L;1F6F 0345;;;;N;;;;1FA7; 1FB0;GREEK SMALL LETTER ALPHA WITH VRACHY;Ll;0;L;03B1 0306;;;;N;;;1FB8;;1FB8 1FB1;GREEK SMALL LETTER ALPHA WITH MACRON;Ll;0;L;03B1 0304;;;;N;;;1FB9;;1FB9 1FB2;GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI;Ll;0;L;1F70 0345;;;;N;;;;; 1FB3;GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI;Ll;0;L;03B1 0345;;;;N;;;1FBC;;1FBC 1FB4;GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI;Ll;0;L;03AC 0345;;;;N;;;;; 1FB6;GREEK SMALL LETTER ALPHA WITH PERISPOMENI;Ll;0;L;03B1 0342;;;;N;;;;; 1FB7;GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI;Ll;0;L;1FB6 0345;;;;N;;;;; 1FB8;GREEK CAPITAL LETTER ALPHA WITH VRACHY;Lu;0;L;0391 0306;;;;N;;;;1FB0; 1FB9;GREEK CAPITAL LETTER ALPHA WITH MACRON;Lu;0;L;0391 0304;;;;N;;;;1FB1; 1FBA;GREEK CAPITAL LETTER ALPHA WITH VARIA;Lu;0;L;0391 0300;;;;N;;;;1F70; 1FBB;GREEK CAPITAL LETTER ALPHA WITH OXIA;Lu;0;L;0386;;;;N;;;;1F71; 1FBC;GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI;Lt;0;L;0391 0345;;;;N;;;;1FB3; 1FBD;GREEK KORONIS;Sk;0;ON; 0020 0313;;;;N;;;;; 1FBE;GREEK PROSGEGRAMMENI;Ll;0;L;03B9;;;;N;;;0399;;0399 1FBF;GREEK PSILI;Sk;0;ON; 0020 0313;;;;N;;;;; 1FC0;GREEK PERISPOMENI;Sk;0;ON; 0020 0342;;;;N;;;;; 1FC1;GREEK DIALYTIKA AND PERISPOMENI;Sk;0;ON;00A8 0342;;;;N;;;;; 1FC2;GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI;Ll;0;L;1F74 0345;;;;N;;;;; 1FC3;GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI;Ll;0;L;03B7 0345;;;;N;;;1FCC;;1FCC 1FC4;GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI;Ll;0;L;03AE 0345;;;;N;;;;; 1FC6;GREEK SMALL LETTER ETA WITH PERISPOMENI;Ll;0;L;03B7 0342;;;;N;;;;; 1FC7;GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI;Ll;0;L;1FC6 0345;;;;N;;;;; 1FC8;GREEK CAPITAL LETTER EPSILON WITH VARIA;Lu;0;L;0395 0300;;;;N;;;;1F72; 1FC9;GREEK CAPITAL LETTER EPSILON WITH OXIA;Lu;0;L;0388;;;;N;;;;1F73; 1FCA;GREEK CAPITAL LETTER ETA WITH VARIA;Lu;0;L;0397 0300;;;;N;;;;1F74; 1FCB;GREEK CAPITAL LETTER ETA WITH OXIA;Lu;0;L;0389;;;;N;;;;1F75; 1FCC;GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI;Lt;0;L;0397 0345;;;;N;;;;1FC3; 1FCD;GREEK PSILI AND VARIA;Sk;0;ON;1FBF 0300;;;;N;;;;; 1FCE;GREEK PSILI AND OXIA;Sk;0;ON;1FBF 0301;;;;N;;;;; 1FCF;GREEK PSILI AND PERISPOMENI;Sk;0;ON;1FBF 0342;;;;N;;;;; 1FD0;GREEK SMALL LETTER IOTA WITH VRACHY;Ll;0;L;03B9 0306;;;;N;;;1FD8;;1FD8 1FD1;GREEK SMALL LETTER IOTA WITH MACRON;Ll;0;L;03B9 0304;;;;N;;;1FD9;;1FD9 1FD2;GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA;Ll;0;L;03CA 0300;;;;N;;;;; 1FD3;GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA;Ll;0;L;0390;;;;N;;;;; 1FD6;GREEK SMALL LETTER IOTA WITH PERISPOMENI;Ll;0;L;03B9 0342;;;;N;;;;; 1FD7;GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI;Ll;0;L;03CA 0342;;;;N;;;;; 1FD8;GREEK CAPITAL LETTER IOTA WITH VRACHY;Lu;0;L;0399 0306;;;;N;;;;1FD0; 1FD9;GREEK CAPITAL LETTER IOTA WITH MACRON;Lu;0;L;0399 0304;;;;N;;;;1FD1; 1FDA;GREEK CAPITAL LETTER IOTA WITH VARIA;Lu;0;L;0399 0300;;;;N;;;;1F76; 1FDB;GREEK CAPITAL LETTER IOTA WITH OXIA;Lu;0;L;038A;;;;N;;;;1F77; 1FDD;GREEK DASIA AND VARIA;Sk;0;ON;1FFE 0300;;;;N;;;;; 1FDE;GREEK DASIA AND OXIA;Sk;0;ON;1FFE 0301;;;;N;;;;; 1FDF;GREEK DASIA AND PERISPOMENI;Sk;0;ON;1FFE 0342;;;;N;;;;; 1FE0;GREEK SMALL LETTER UPSILON WITH VRACHY;Ll;0;L;03C5 0306;;;;N;;;1FE8;;1FE8 1FE1;GREEK SMALL LETTER UPSILON WITH MACRON;Ll;0;L;03C5 0304;;;;N;;;1FE9;;1FE9 1FE2;GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA;Ll;0;L;03CB 0300;;;;N;;;;; 1FE3;GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA;Ll;0;L;03B0;;;;N;;;;; 1FE4;GREEK SMALL LETTER RHO WITH PSILI;Ll;0;L;03C1 0313;;;;N;;;;; 1FE5;GREEK SMALL LETTER RHO WITH DASIA;Ll;0;L;03C1 0314;;;;N;;;1FEC;;1FEC 1FE6;GREEK SMALL LETTER UPSILON WITH PERISPOMENI;Ll;0;L;03C5 0342;;;;N;;;;; 1FE7;GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI;Ll;0;L;03CB 0342;;;;N;;;;; 1FE8;GREEK CAPITAL LETTER UPSILON WITH VRACHY;Lu;0;L;03A5 0306;;;;N;;;;1FE0; 1FE9;GREEK CAPITAL LETTER UPSILON WITH MACRON;Lu;0;L;03A5 0304;;;;N;;;;1FE1; 1FEA;GREEK CAPITAL LETTER UPSILON WITH VARIA;Lu;0;L;03A5 0300;;;;N;;;;1F7A; 1FEB;GREEK CAPITAL LETTER UPSILON WITH OXIA;Lu;0;L;038E;;;;N;;;;1F7B; 1FEC;GREEK CAPITAL LETTER RHO WITH DASIA;Lu;0;L;03A1 0314;;;;N;;;;1FE5; 1FED;GREEK DIALYTIKA AND VARIA;Sk;0;ON;00A8 0300;;;;N;;;;; 1FEE;GREEK DIALYTIKA AND OXIA;Sk;0;ON;0385;;;;N;;;;; 1FEF;GREEK VARIA;Sk;0;ON;0060;;;;N;;;;; 1FF2;GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI;Ll;0;L;1F7C 0345;;;;N;;;;; 1FF3;GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI;Ll;0;L;03C9 0345;;;;N;;;1FFC;;1FFC 1FF4;GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI;Ll;0;L;03CE 0345;;;;N;;;;; 1FF6;GREEK SMALL LETTER OMEGA WITH PERISPOMENI;Ll;0;L;03C9 0342;;;;N;;;;; 1FF7;GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI;Ll;0;L;1FF6 0345;;;;N;;;;; 1FF8;GREEK CAPITAL LETTER OMICRON WITH VARIA;Lu;0;L;039F 0300;;;;N;;;;1F78; 1FF9;GREEK CAPITAL LETTER OMICRON WITH OXIA;Lu;0;L;038C;;;;N;;;;1F79; 1FFA;GREEK CAPITAL LETTER OMEGA WITH VARIA;Lu;0;L;03A9 0300;;;;N;;;;1F7C; 1FFB;GREEK CAPITAL LETTER OMEGA WITH OXIA;Lu;0;L;038F;;;;N;;;;1F7D; 1FFC;GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI;Lt;0;L;03A9 0345;;;;N;;;;1FF3; 1FFD;GREEK OXIA;Sk;0;ON;00B4;;;;N;;;;; 1FFE;GREEK DASIA;Sk;0;ON; 0020 0314;;;;N;;;;; 2000;EN QUAD;Zs;0;WS;2002;;;;N;;;;; 2001;EM QUAD;Zs;0;WS;2003;;;;N;;;;; 2002;EN SPACE;Zs;0;WS; 0020;;;;N;;;;; 2003;EM SPACE;Zs;0;WS; 0020;;;;N;;;;; 2004;THREE-PER-EM SPACE;Zs;0;WS; 0020;;;;N;;;;; 2005;FOUR-PER-EM SPACE;Zs;0;WS; 0020;;;;N;;;;; 2006;SIX-PER-EM SPACE;Zs;0;WS; 0020;;;;N;;;;; 2007;FIGURE SPACE;Zs;0;WS; 0020;;;;N;;;;; 2008;PUNCTUATION SPACE;Zs;0;WS; 0020;;;;N;;;;; 2009;THIN SPACE;Zs;0;WS; 0020;;;;N;;;;; 200A;HAIR SPACE;Zs;0;WS; 0020;;;;N;;;;; 200B;ZERO WIDTH SPACE;Cf;0;BN;;;;;N;;;;; 200C;ZERO WIDTH NON-JOINER;Cf;0;BN;;;;;N;;;;; 200D;ZERO WIDTH JOINER;Cf;0;BN;;;;;N;;;;; 200E;LEFT-TO-RIGHT MARK;Cf;0;L;;;;;N;;;;; 200F;RIGHT-TO-LEFT MARK;Cf;0;R;;;;;N;;;;; 2010;HYPHEN;Pd;0;ON;;;;;N;;;;; 2011;NON-BREAKING HYPHEN;Pd;0;ON; 2010;;;;N;;;;; 2012;FIGURE DASH;Pd;0;ON;;;;;N;;;;; 2013;EN DASH;Pd;0;ON;;;;;N;;;;; 2014;EM DASH;Pd;0;ON;;;;;N;;;;; 2015;HORIZONTAL BAR;Pd;0;ON;;;;;N;QUOTATION DASH;;;; 2016;DOUBLE VERTICAL LINE;Po;0;ON;;;;;N;DOUBLE VERTICAL BAR;;;; 2017;DOUBLE LOW LINE;Po;0;ON; 0020 0333;;;;N;SPACING DOUBLE UNDERSCORE;;;; 2018;LEFT SINGLE QUOTATION MARK;Pi;0;ON;;;;;N;SINGLE TURNED COMMA QUOTATION MARK;;;; 2019;RIGHT SINGLE QUOTATION MARK;Pf;0;ON;;;;;N;SINGLE COMMA QUOTATION MARK;;;; 201A;SINGLE LOW-9 QUOTATION MARK;Ps;0;ON;;;;;N;LOW SINGLE COMMA QUOTATION MARK;;;; 201B;SINGLE HIGH-REVERSED-9 QUOTATION MARK;Pi;0;ON;;;;;N;SINGLE REVERSED COMMA QUOTATION MARK;;;; 201C;LEFT DOUBLE QUOTATION MARK;Pi;0;ON;;;;;N;DOUBLE TURNED COMMA QUOTATION MARK;;;; 201D;RIGHT DOUBLE QUOTATION MARK;Pf;0;ON;;;;;N;DOUBLE COMMA QUOTATION MARK;;;; 201E;DOUBLE LOW-9 QUOTATION MARK;Ps;0;ON;;;;;N;LOW DOUBLE COMMA QUOTATION MARK;;;; 201F;DOUBLE HIGH-REVERSED-9 QUOTATION MARK;Pi;0;ON;;;;;N;DOUBLE REVERSED COMMA QUOTATION MARK;;;; 2020;DAGGER;Po;0;ON;;;;;N;;;;; 2021;DOUBLE DAGGER;Po;0;ON;;;;;N;;;;; 2022;BULLET;Po;0;ON;;;;;N;;;;; 2023;TRIANGULAR BULLET;Po;0;ON;;;;;N;;;;; 2024;ONE DOT LEADER;Po;0;ON; 002E;;;;N;;;;; 2025;TWO DOT LEADER;Po;0;ON; 002E 002E;;;;N;;;;; 2026;HORIZONTAL ELLIPSIS;Po;0;ON; 002E 002E 002E;;;;N;;;;; 2027;HYPHENATION POINT;Po;0;ON;;;;;N;;;;; 2028;LINE SEPARATOR;Zl;0;WS;;;;;N;;;;; 2029;PARAGRAPH SEPARATOR;Zp;0;B;;;;;N;;;;; 202A;LEFT-TO-RIGHT EMBEDDING;Cf;0;LRE;;;;;N;;;;; 202B;RIGHT-TO-LEFT EMBEDDING;Cf;0;RLE;;;;;N;;;;; 202C;POP DIRECTIONAL FORMATTING;Cf;0;PDF;;;;;N;;;;; 202D;LEFT-TO-RIGHT OVERRIDE;Cf;0;LRO;;;;;N;;;;; 202E;RIGHT-TO-LEFT OVERRIDE;Cf;0;RLO;;;;;N;;;;; 202F;NARROW NO-BREAK SPACE;Zs;0;CS; 0020;;;;N;;;;; 2030;PER MILLE SIGN;Po;0;ET;;;;;N;;;;; 2031;PER TEN THOUSAND SIGN;Po;0;ET;;;;;N;;;;; 2032;PRIME;Po;0;ET;;;;;N;;;;; 2033;DOUBLE PRIME;Po;0;ET; 2032 2032;;;;N;;;;; 2034;TRIPLE PRIME;Po;0;ET; 2032 2032 2032;;;;N;;;;; 2035;REVERSED PRIME;Po;0;ON;;;;;N;;;;; 2036;REVERSED DOUBLE PRIME;Po;0;ON; 2035 2035;;;;N;;;;; 2037;REVERSED TRIPLE PRIME;Po;0;ON; 2035 2035 2035;;;;N;;;;; 2038;CARET;Po;0;ON;;;;;N;;;;; 2039;SINGLE LEFT-POINTING ANGLE QUOTATION MARK;Pi;0;ON;;;;;Y;LEFT POINTING SINGLE GUILLEMET;;;; 203A;SINGLE RIGHT-POINTING ANGLE QUOTATION MARK;Pf;0;ON;;;;;Y;RIGHT POINTING SINGLE GUILLEMET;;;; 203B;REFERENCE MARK;Po;0;ON;;;;;N;;;;; 203C;DOUBLE EXCLAMATION MARK;Po;0;ON; 0021 0021;;;;N;;;;; 203D;INTERROBANG;Po;0;ON;;;;;N;;;;; 203E;OVERLINE;Po;0;ON; 0020 0305;;;;N;SPACING OVERSCORE;;;; 203F;UNDERTIE;Pc;0;ON;;;;;N;;;;; 2040;CHARACTER TIE;Pc;0;ON;;;;;N;;;;; 2041;CARET INSERTION POINT;Po;0;ON;;;;;N;;;;; 2042;ASTERISM;Po;0;ON;;;;;N;;;;; 2043;HYPHEN BULLET;Po;0;ON;;;;;N;;;;; 2044;FRACTION SLASH;Sm;0;CS;;;;;N;;;;; 2045;LEFT SQUARE BRACKET WITH QUILL;Ps;0;ON;;;;;Y;;;;; 2046;RIGHT SQUARE BRACKET WITH QUILL;Pe;0;ON;;;;;Y;;;;; 2047;DOUBLE QUESTION MARK;Po;0;ON; 003F 003F;;;;N;;;;; 2048;QUESTION EXCLAMATION MARK;Po;0;ON; 003F 0021;;;;N;;;;; 2049;EXCLAMATION QUESTION MARK;Po;0;ON; 0021 003F;;;;N;;;;; 204A;TIRONIAN SIGN ET;Po;0;ON;;;;;N;;;;; 204B;REVERSED PILCROW SIGN;Po;0;ON;;;;;N;;;;; 204C;BLACK LEFTWARDS BULLET;Po;0;ON;;;;;N;;;;; 204D;BLACK RIGHTWARDS BULLET;Po;0;ON;;;;;N;;;;; 204E;LOW ASTERISK;Po;0;ON;;;;;N;;;;; 204F;REVERSED SEMICOLON;Po;0;ON;;;;;N;;;;; 2050;CLOSE UP;Po;0;ON;;;;;N;;;;; 2051;TWO ASTERISKS ALIGNED VERTICALLY;Po;0;ON;;;;;N;;;;; 2052;COMMERCIAL MINUS SIGN;Sm;0;ON;;;;;N;;;;; 2053;SWUNG DASH;Po;0;ON;;;;;N;;;;; 2054;INVERTED UNDERTIE;Pc;0;ON;;;;;N;;;;; 2055;FLOWER PUNCTUATION MARK;Po;0;ON;;;;;N;;;;; 2056;THREE DOT PUNCTUATION;Po;0;ON;;;;;N;;;;; 2057;QUADRUPLE PRIME;Po;0;ON; 2032 2032 2032 2032;;;;N;;;;; 2058;FOUR DOT PUNCTUATION;Po;0;ON;;;;;N;;;;; 2059;FIVE DOT PUNCTUATION;Po;0;ON;;;;;N;;;;; 205A;TWO DOT PUNCTUATION;Po;0;ON;;;;;N;;;;; 205B;FOUR DOT MARK;Po;0;ON;;;;;N;;;;; 205C;DOTTED CROSS;Po;0;ON;;;;;N;;;;; 205D;TRICOLON;Po;0;ON;;;;;N;;;;; 205E;VERTICAL FOUR DOTS;Po;0;ON;;;;;N;;;;; 205F;MEDIUM MATHEMATICAL SPACE;Zs;0;WS; 0020;;;;N;;;;; 2060;WORD JOINER;Cf;0;BN;;;;;N;;;;; 2061;FUNCTION APPLICATION;Cf;0;BN;;;;;N;;;;; 2062;INVISIBLE TIMES;Cf;0;BN;;;;;N;;;;; 2063;INVISIBLE SEPARATOR;Cf;0;BN;;;;;N;;;;; 2064;INVISIBLE PLUS;Cf;0;BN;;;;;N;;;;; 206A;INHIBIT SYMMETRIC SWAPPING;Cf;0;BN;;;;;N;;;;; 206B;ACTIVATE SYMMETRIC SWAPPING;Cf;0;BN;;;;;N;;;;; 206C;INHIBIT ARABIC FORM SHAPING;Cf;0;BN;;;;;N;;;;; 206D;ACTIVATE ARABIC FORM SHAPING;Cf;0;BN;;;;;N;;;;; 206E;NATIONAL DIGIT SHAPES;Cf;0;BN;;;;;N;;;;; 206F;NOMINAL DIGIT SHAPES;Cf;0;BN;;;;;N;;;;; 2070;SUPERSCRIPT ZERO;No;0;EN; 0030;;0;0;N;SUPERSCRIPT DIGIT ZERO;;;; 2071;SUPERSCRIPT LATIN SMALL LETTER I;Lm;0;L; 0069;;;;N;;;;; 2074;SUPERSCRIPT FOUR;No;0;EN; 0034;;4;4;N;SUPERSCRIPT DIGIT FOUR;;;; 2075;SUPERSCRIPT FIVE;No;0;EN; 0035;;5;5;N;SUPERSCRIPT DIGIT FIVE;;;; 2076;SUPERSCRIPT SIX;No;0;EN; 0036;;6;6;N;SUPERSCRIPT DIGIT SIX;;;; 2077;SUPERSCRIPT SEVEN;No;0;EN; 0037;;7;7;N;SUPERSCRIPT DIGIT SEVEN;;;; 2078;SUPERSCRIPT EIGHT;No;0;EN; 0038;;8;8;N;SUPERSCRIPT DIGIT EIGHT;;;; 2079;SUPERSCRIPT NINE;No;0;EN; 0039;;9;9;N;SUPERSCRIPT DIGIT NINE;;;; 207A;SUPERSCRIPT PLUS SIGN;Sm;0;ES; 002B;;;;N;;;;; 207B;SUPERSCRIPT MINUS;Sm;0;ES; 2212;;;;N;SUPERSCRIPT HYPHEN-MINUS;;;; 207C;SUPERSCRIPT EQUALS SIGN;Sm;0;ON; 003D;;;;N;;;;; 207D;SUPERSCRIPT LEFT PARENTHESIS;Ps;0;ON; 0028;;;;Y;SUPERSCRIPT OPENING PARENTHESIS;;;; 207E;SUPERSCRIPT RIGHT PARENTHESIS;Pe;0;ON; 0029;;;;Y;SUPERSCRIPT CLOSING PARENTHESIS;;;; 207F;SUPERSCRIPT LATIN SMALL LETTER N;Lm;0;L; 006E;;;;N;;;;; 2080;SUBSCRIPT ZERO;No;0;EN; 0030;;0;0;N;SUBSCRIPT DIGIT ZERO;;;; 2081;SUBSCRIPT ONE;No;0;EN; 0031;;1;1;N;SUBSCRIPT DIGIT ONE;;;; 2082;SUBSCRIPT TWO;No;0;EN; 0032;;2;2;N;SUBSCRIPT DIGIT TWO;;;; 2083;SUBSCRIPT THREE;No;0;EN; 0033;;3;3;N;SUBSCRIPT DIGIT THREE;;;; 2084;SUBSCRIPT FOUR;No;0;EN; 0034;;4;4;N;SUBSCRIPT DIGIT FOUR;;;; 2085;SUBSCRIPT FIVE;No;0;EN; 0035;;5;5;N;SUBSCRIPT DIGIT FIVE;;;; 2086;SUBSCRIPT SIX;No;0;EN; 0036;;6;6;N;SUBSCRIPT DIGIT SIX;;;; 2087;SUBSCRIPT SEVEN;No;0;EN; 0037;;7;7;N;SUBSCRIPT DIGIT SEVEN;;;; 2088;SUBSCRIPT EIGHT;No;0;EN; 0038;;8;8;N;SUBSCRIPT DIGIT EIGHT;;;; 2089;SUBSCRIPT NINE;No;0;EN; 0039;;9;9;N;SUBSCRIPT DIGIT NINE;;;; 208A;SUBSCRIPT PLUS SIGN;Sm;0;ES; 002B;;;;N;;;;; 208B;SUBSCRIPT MINUS;Sm;0;ES; 2212;;;;N;SUBSCRIPT HYPHEN-MINUS;;;; 208C;SUBSCRIPT EQUALS SIGN;Sm;0;ON; 003D;;;;N;;;;; 208D;SUBSCRIPT LEFT PARENTHESIS;Ps;0;ON; 0028;;;;Y;SUBSCRIPT OPENING PARENTHESIS;;;; 208E;SUBSCRIPT RIGHT PARENTHESIS;Pe;0;ON; 0029;;;;Y;SUBSCRIPT CLOSING PARENTHESIS;;;; 2090;LATIN SUBSCRIPT SMALL LETTER A;Lm;0;L; 0061;;;;N;;;;; 2091;LATIN SUBSCRIPT SMALL LETTER E;Lm;0;L; 0065;;;;N;;;;; 2092;LATIN SUBSCRIPT SMALL LETTER O;Lm;0;L; 006F;;;;N;;;;; 2093;LATIN SUBSCRIPT SMALL LETTER X;Lm;0;L; 0078;;;;N;;;;; 2094;LATIN SUBSCRIPT SMALL LETTER SCHWA;Lm;0;L; 0259;;;;N;;;;; 2095;LATIN SUBSCRIPT SMALL LETTER H;Lm;0;L; 0068;;;;N;;;;; 2096;LATIN SUBSCRIPT SMALL LETTER K;Lm;0;L; 006B;;;;N;;;;; 2097;LATIN SUBSCRIPT SMALL LETTER L;Lm;0;L; 006C;;;;N;;;;; 2098;LATIN SUBSCRIPT SMALL LETTER M;Lm;0;L; 006D;;;;N;;;;; 2099;LATIN SUBSCRIPT SMALL LETTER N;Lm;0;L; 006E;;;;N;;;;; 209A;LATIN SUBSCRIPT SMALL LETTER P;Lm;0;L; 0070;;;;N;;;;; 209B;LATIN SUBSCRIPT SMALL LETTER S;Lm;0;L; 0073;;;;N;;;;; 209C;LATIN SUBSCRIPT SMALL LETTER T;Lm;0;L; 0074;;;;N;;;;; 20A0;EURO-CURRENCY SIGN;Sc;0;ET;;;;;N;;;;; 20A1;COLON SIGN;Sc;0;ET;;;;;N;;;;; 20A2;CRUZEIRO SIGN;Sc;0;ET;;;;;N;;;;; 20A3;FRENCH FRANC SIGN;Sc;0;ET;;;;;N;;;;; 20A4;LIRA SIGN;Sc;0;ET;;;;;N;;;;; 20A5;MILL SIGN;Sc;0;ET;;;;;N;;;;; 20A6;NAIRA SIGN;Sc;0;ET;;;;;N;;;;; 20A7;PESETA SIGN;Sc;0;ET;;;;;N;;;;; 20A8;RUPEE SIGN;Sc;0;ET; 0052 0073;;;;N;;;;; 20A9;WON SIGN;Sc;0;ET;;;;;N;;;;; 20AA;NEW SHEQEL SIGN;Sc;0;ET;;;;;N;;;;; 20AB;DONG SIGN;Sc;0;ET;;;;;N;;;;; 20AC;EURO SIGN;Sc;0;ET;;;;;N;;;;; 20AD;KIP SIGN;Sc;0;ET;;;;;N;;;;; 20AE;TUGRIK SIGN;Sc;0;ET;;;;;N;;;;; 20AF;DRACHMA SIGN;Sc;0;ET;;;;;N;;;;; 20B0;GERMAN PENNY SIGN;Sc;0;ET;;;;;N;;;;; 20B1;PESO SIGN;Sc;0;ET;;;;;N;;;;; 20B2;GUARANI SIGN;Sc;0;ET;;;;;N;;;;; 20B3;AUSTRAL SIGN;Sc;0;ET;;;;;N;;;;; 20B4;HRYVNIA SIGN;Sc;0;ET;;;;;N;;;;; 20B5;CEDI SIGN;Sc;0;ET;;;;;N;;;;; 20B6;LIVRE TOURNOIS SIGN;Sc;0;ET;;;;;N;;;;; 20B7;SPESMILO SIGN;Sc;0;ET;;;;;N;;;;; 20B8;TENGE SIGN;Sc;0;ET;;;;;N;;;;; 20B9;INDIAN RUPEE SIGN;Sc;0;ET;;;;;N;;;;; 20D0;COMBINING LEFT HARPOON ABOVE;Mn;230;NSM;;;;;N;NON-SPACING LEFT HARPOON ABOVE;;;; 20D1;COMBINING RIGHT HARPOON ABOVE;Mn;230;NSM;;;;;N;NON-SPACING RIGHT HARPOON ABOVE;;;; 20D2;COMBINING LONG VERTICAL LINE OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING LONG VERTICAL BAR OVERLAY;;;; 20D3;COMBINING SHORT VERTICAL LINE OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING SHORT VERTICAL BAR OVERLAY;;;; 20D4;COMBINING ANTICLOCKWISE ARROW ABOVE;Mn;230;NSM;;;;;N;NON-SPACING ANTICLOCKWISE ARROW ABOVE;;;; 20D5;COMBINING CLOCKWISE ARROW ABOVE;Mn;230;NSM;;;;;N;NON-SPACING CLOCKWISE ARROW ABOVE;;;; 20D6;COMBINING LEFT ARROW ABOVE;Mn;230;NSM;;;;;N;NON-SPACING LEFT ARROW ABOVE;;;; 20D7;COMBINING RIGHT ARROW ABOVE;Mn;230;NSM;;;;;N;NON-SPACING RIGHT ARROW ABOVE;;;; 20D8;COMBINING RING OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING RING OVERLAY;;;; 20D9;COMBINING CLOCKWISE RING OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING CLOCKWISE RING OVERLAY;;;; 20DA;COMBINING ANTICLOCKWISE RING OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING ANTICLOCKWISE RING OVERLAY;;;; 20DB;COMBINING THREE DOTS ABOVE;Mn;230;NSM;;;;;N;NON-SPACING THREE DOTS ABOVE;;;; 20DC;COMBINING FOUR DOTS ABOVE;Mn;230;NSM;;;;;N;NON-SPACING FOUR DOTS ABOVE;;;; 20DD;COMBINING ENCLOSING CIRCLE;Me;0;NSM;;;;;N;ENCLOSING CIRCLE;;;; 20DE;COMBINING ENCLOSING SQUARE;Me;0;NSM;;;;;N;ENCLOSING SQUARE;;;; 20DF;COMBINING ENCLOSING DIAMOND;Me;0;NSM;;;;;N;ENCLOSING DIAMOND;;;; 20E0;COMBINING ENCLOSING CIRCLE BACKSLASH;Me;0;NSM;;;;;N;ENCLOSING CIRCLE SLASH;;;; 20E1;COMBINING LEFT RIGHT ARROW ABOVE;Mn;230;NSM;;;;;N;NON-SPACING LEFT RIGHT ARROW ABOVE;;;; 20E2;COMBINING ENCLOSING SCREEN;Me;0;NSM;;;;;N;;;;; 20E3;COMBINING ENCLOSING KEYCAP;Me;0;NSM;;;;;N;;;;; 20E4;COMBINING ENCLOSING UPWARD POINTING TRIANGLE;Me;0;NSM;;;;;N;;;;; 20E5;COMBINING REVERSE SOLIDUS OVERLAY;Mn;1;NSM;;;;;N;;;;; 20E6;COMBINING DOUBLE VERTICAL STROKE OVERLAY;Mn;1;NSM;;;;;N;;;;; 20E7;COMBINING ANNUITY SYMBOL;Mn;230;NSM;;;;;N;;;;; 20E8;COMBINING TRIPLE UNDERDOT;Mn;220;NSM;;;;;N;;;;; 20E9;COMBINING WIDE BRIDGE ABOVE;Mn;230;NSM;;;;;N;;;;; 20EA;COMBINING LEFTWARDS ARROW OVERLAY;Mn;1;NSM;;;;;N;;;;; 20EB;COMBINING LONG DOUBLE SOLIDUS OVERLAY;Mn;1;NSM;;;;;N;;;;; 20EC;COMBINING RIGHTWARDS HARPOON WITH BARB DOWNWARDS;Mn;220;NSM;;;;;N;;;;; 20ED;COMBINING LEFTWARDS HARPOON WITH BARB DOWNWARDS;Mn;220;NSM;;;;;N;;;;; 20EE;COMBINING LEFT ARROW BELOW;Mn;220;NSM;;;;;N;;;;; 20EF;COMBINING RIGHT ARROW BELOW;Mn;220;NSM;;;;;N;;;;; 20F0;COMBINING ASTERISK ABOVE;Mn;230;NSM;;;;;N;;;;; 2100;ACCOUNT OF;So;0;ON; 0061 002F 0063;;;;N;;;;; 2101;ADDRESSED TO THE SUBJECT;So;0;ON; 0061 002F 0073;;;;N;;;;; 2102;DOUBLE-STRUCK CAPITAL C;Lu;0;L; 0043;;;;N;DOUBLE-STRUCK C;;;; 2103;DEGREE CELSIUS;So;0;ON; 00B0 0043;;;;N;DEGREES CENTIGRADE;;;; 2104;CENTRE LINE SYMBOL;So;0;ON;;;;;N;C L SYMBOL;;;; 2105;CARE OF;So;0;ON; 0063 002F 006F;;;;N;;;;; 2106;CADA UNA;So;0;ON; 0063 002F 0075;;;;N;;;;; 2107;EULER CONSTANT;Lu;0;L; 0190;;;;N;EULERS;;;; 2108;SCRUPLE;So;0;ON;;;;;N;;;;; 2109;DEGREE FAHRENHEIT;So;0;ON; 00B0 0046;;;;N;DEGREES FAHRENHEIT;;;; 210A;SCRIPT SMALL G;Ll;0;L; 0067;;;;N;;;;; 210B;SCRIPT CAPITAL H;Lu;0;L; 0048;;;;N;SCRIPT H;;;; 210C;BLACK-LETTER CAPITAL H;Lu;0;L; 0048;;;;N;BLACK-LETTER H;;;; 210D;DOUBLE-STRUCK CAPITAL H;Lu;0;L; 0048;;;;N;DOUBLE-STRUCK H;;;; 210E;PLANCK CONSTANT;Ll;0;L; 0068;;;;N;;;;; 210F;PLANCK CONSTANT OVER TWO PI;Ll;0;L; 0127;;;;N;PLANCK CONSTANT OVER 2 PI;;;; 2110;SCRIPT CAPITAL I;Lu;0;L; 0049;;;;N;SCRIPT I;;;; 2111;BLACK-LETTER CAPITAL I;Lu;0;L; 0049;;;;N;BLACK-LETTER I;;;; 2112;SCRIPT CAPITAL L;Lu;0;L; 004C;;;;N;SCRIPT L;;;; 2113;SCRIPT SMALL L;Ll;0;L; 006C;;;;N;;;;; 2114;L B BAR SYMBOL;So;0;ON;;;;;N;;;;; 2115;DOUBLE-STRUCK CAPITAL N;Lu;0;L; 004E;;;;N;DOUBLE-STRUCK N;;;; 2116;NUMERO SIGN;So;0;ON; 004E 006F;;;;N;NUMERO;;;; 2117;SOUND RECORDING COPYRIGHT;So;0;ON;;;;;N;;;;; 2118;SCRIPT CAPITAL P;Sm;0;ON;;;;;N;SCRIPT P;;;; 2119;DOUBLE-STRUCK CAPITAL P;Lu;0;L; 0050;;;;N;DOUBLE-STRUCK P;;;; 211A;DOUBLE-STRUCK CAPITAL Q;Lu;0;L; 0051;;;;N;DOUBLE-STRUCK Q;;;; 211B;SCRIPT CAPITAL R;Lu;0;L; 0052;;;;N;SCRIPT R;;;; 211C;BLACK-LETTER CAPITAL R;Lu;0;L; 0052;;;;N;BLACK-LETTER R;;;; 211D;DOUBLE-STRUCK CAPITAL R;Lu;0;L; 0052;;;;N;DOUBLE-STRUCK R;;;; 211E;PRESCRIPTION TAKE;So;0;ON;;;;;N;;;;; 211F;RESPONSE;So;0;ON;;;;;N;;;;; 2120;SERVICE MARK;So;0;ON; 0053 004D;;;;N;;;;; 2121;TELEPHONE SIGN;So;0;ON; 0054 0045 004C;;;;N;T E L SYMBOL;;;; 2122;TRADE MARK SIGN;So;0;ON; 0054 004D;;;;N;TRADEMARK;;;; 2123;VERSICLE;So;0;ON;;;;;N;;;;; 2124;DOUBLE-STRUCK CAPITAL Z;Lu;0;L; 005A;;;;N;DOUBLE-STRUCK Z;;;; 2125;OUNCE SIGN;So;0;ON;;;;;N;OUNCE;;;; 2126;OHM SIGN;Lu;0;L;03A9;;;;N;OHM;;;03C9; 2127;INVERTED OHM SIGN;So;0;ON;;;;;N;MHO;;;; 2128;BLACK-LETTER CAPITAL Z;Lu;0;L; 005A;;;;N;BLACK-LETTER Z;;;; 2129;TURNED GREEK SMALL LETTER IOTA;So;0;ON;;;;;N;;;;; 212A;KELVIN SIGN;Lu;0;L;004B;;;;N;DEGREES KELVIN;;;006B; 212B;ANGSTROM SIGN;Lu;0;L;00C5;;;;N;ANGSTROM UNIT;;;00E5; 212C;SCRIPT CAPITAL B;Lu;0;L; 0042;;;;N;SCRIPT B;;;; 212D;BLACK-LETTER CAPITAL C;Lu;0;L; 0043;;;;N;BLACK-LETTER C;;;; 212E;ESTIMATED SYMBOL;So;0;ET;;;;;N;;;;; 212F;SCRIPT SMALL E;Ll;0;L; 0065;;;;N;;;;; 2130;SCRIPT CAPITAL E;Lu;0;L; 0045;;;;N;SCRIPT E;;;; 2131;SCRIPT CAPITAL F;Lu;0;L; 0046;;;;N;SCRIPT F;;;; 2132;TURNED CAPITAL F;Lu;0;L;;;;;N;TURNED F;;;214E; 2133;SCRIPT CAPITAL M;Lu;0;L; 004D;;;;N;SCRIPT M;;;; 2134;SCRIPT SMALL O;Ll;0;L; 006F;;;;N;;;;; 2135;ALEF SYMBOL;Lo;0;L; 05D0;;;;N;FIRST TRANSFINITE CARDINAL;;;; 2136;BET SYMBOL;Lo;0;L; 05D1;;;;N;SECOND TRANSFINITE CARDINAL;;;; 2137;GIMEL SYMBOL;Lo;0;L; 05D2;;;;N;THIRD TRANSFINITE CARDINAL;;;; 2138;DALET SYMBOL;Lo;0;L; 05D3;;;;N;FOURTH TRANSFINITE CARDINAL;;;; 2139;INFORMATION SOURCE;Ll;0;L; 0069;;;;N;;;;; 213A;ROTATED CAPITAL Q;So;0;ON;;;;;N;;;;; 213B;FACSIMILE SIGN;So;0;ON; 0046 0041 0058;;;;N;;;;; 213C;DOUBLE-STRUCK SMALL PI;Ll;0;L; 03C0;;;;N;;;;; 213D;DOUBLE-STRUCK SMALL GAMMA;Ll;0;L; 03B3;;;;N;;;;; 213E;DOUBLE-STRUCK CAPITAL GAMMA;Lu;0;L; 0393;;;;N;;;;; 213F;DOUBLE-STRUCK CAPITAL PI;Lu;0;L; 03A0;;;;N;;;;; 2140;DOUBLE-STRUCK N-ARY SUMMATION;Sm;0;ON; 2211;;;;Y;;;;; 2141;TURNED SANS-SERIF CAPITAL G;Sm;0;ON;;;;;N;;;;; 2142;TURNED SANS-SERIF CAPITAL L;Sm;0;ON;;;;;N;;;;; 2143;REVERSED SANS-SERIF CAPITAL L;Sm;0;ON;;;;;N;;;;; 2144;TURNED SANS-SERIF CAPITAL Y;Sm;0;ON;;;;;N;;;;; 2145;DOUBLE-STRUCK ITALIC CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 2146;DOUBLE-STRUCK ITALIC SMALL D;Ll;0;L; 0064;;;;N;;;;; 2147;DOUBLE-STRUCK ITALIC SMALL E;Ll;0;L; 0065;;;;N;;;;; 2148;DOUBLE-STRUCK ITALIC SMALL I;Ll;0;L; 0069;;;;N;;;;; 2149;DOUBLE-STRUCK ITALIC SMALL J;Ll;0;L; 006A;;;;N;;;;; 214A;PROPERTY LINE;So;0;ON;;;;;N;;;;; 214B;TURNED AMPERSAND;Sm;0;ON;;;;;N;;;;; 214C;PER SIGN;So;0;ON;;;;;N;;;;; 214D;AKTIESELSKAB;So;0;ON;;;;;N;;;;; 214E;TURNED SMALL F;Ll;0;L;;;;;N;;;2132;;2132 214F;SYMBOL FOR SAMARITAN SOURCE;So;0;L;;;;;N;;;;; 2150;VULGAR FRACTION ONE SEVENTH;No;0;ON; 0031 2044 0037;;;1/7;N;;;;; 2151;VULGAR FRACTION ONE NINTH;No;0;ON; 0031 2044 0039;;;1/9;N;;;;; 2152;VULGAR FRACTION ONE TENTH;No;0;ON; 0031 2044 0031 0030;;;1/10;N;;;;; 2153;VULGAR FRACTION ONE THIRD;No;0;ON; 0031 2044 0033;;;1/3;N;FRACTION ONE THIRD;;;; 2154;VULGAR FRACTION TWO THIRDS;No;0;ON; 0032 2044 0033;;;2/3;N;FRACTION TWO THIRDS;;;; 2155;VULGAR FRACTION ONE FIFTH;No;0;ON; 0031 2044 0035;;;1/5;N;FRACTION ONE FIFTH;;;; 2156;VULGAR FRACTION TWO FIFTHS;No;0;ON; 0032 2044 0035;;;2/5;N;FRACTION TWO FIFTHS;;;; 2157;VULGAR FRACTION THREE FIFTHS;No;0;ON; 0033 2044 0035;;;3/5;N;FRACTION THREE FIFTHS;;;; 2158;VULGAR FRACTION FOUR FIFTHS;No;0;ON; 0034 2044 0035;;;4/5;N;FRACTION FOUR FIFTHS;;;; 2159;VULGAR FRACTION ONE SIXTH;No;0;ON; 0031 2044 0036;;;1/6;N;FRACTION ONE SIXTH;;;; 215A;VULGAR FRACTION FIVE SIXTHS;No;0;ON; 0035 2044 0036;;;5/6;N;FRACTION FIVE SIXTHS;;;; 215B;VULGAR FRACTION ONE EIGHTH;No;0;ON; 0031 2044 0038;;;1/8;N;FRACTION ONE EIGHTH;;;; 215C;VULGAR FRACTION THREE EIGHTHS;No;0;ON; 0033 2044 0038;;;3/8;N;FRACTION THREE EIGHTHS;;;; 215D;VULGAR FRACTION FIVE EIGHTHS;No;0;ON; 0035 2044 0038;;;5/8;N;FRACTION FIVE EIGHTHS;;;; 215E;VULGAR FRACTION SEVEN EIGHTHS;No;0;ON; 0037 2044 0038;;;7/8;N;FRACTION SEVEN EIGHTHS;;;; 215F;FRACTION NUMERATOR ONE;No;0;ON; 0031 2044;;;1;N;;;;; 2160;ROMAN NUMERAL ONE;Nl;0;L; 0049;;;1;N;;;;2170; 2161;ROMAN NUMERAL TWO;Nl;0;L; 0049 0049;;;2;N;;;;2171; 2162;ROMAN NUMERAL THREE;Nl;0;L; 0049 0049 0049;;;3;N;;;;2172; 2163;ROMAN NUMERAL FOUR;Nl;0;L; 0049 0056;;;4;N;;;;2173; 2164;ROMAN NUMERAL FIVE;Nl;0;L; 0056;;;5;N;;;;2174; 2165;ROMAN NUMERAL SIX;Nl;0;L; 0056 0049;;;6;N;;;;2175; 2166;ROMAN NUMERAL SEVEN;Nl;0;L; 0056 0049 0049;;;7;N;;;;2176; 2167;ROMAN NUMERAL EIGHT;Nl;0;L; 0056 0049 0049 0049;;;8;N;;;;2177; 2168;ROMAN NUMERAL NINE;Nl;0;L; 0049 0058;;;9;N;;;;2178; 2169;ROMAN NUMERAL TEN;Nl;0;L; 0058;;;10;N;;;;2179; 216A;ROMAN NUMERAL ELEVEN;Nl;0;L; 0058 0049;;;11;N;;;;217A; 216B;ROMAN NUMERAL TWELVE;Nl;0;L; 0058 0049 0049;;;12;N;;;;217B; 216C;ROMAN NUMERAL FIFTY;Nl;0;L; 004C;;;50;N;;;;217C; 216D;ROMAN NUMERAL ONE HUNDRED;Nl;0;L; 0043;;;100;N;;;;217D; 216E;ROMAN NUMERAL FIVE HUNDRED;Nl;0;L; 0044;;;500;N;;;;217E; 216F;ROMAN NUMERAL ONE THOUSAND;Nl;0;L; 004D;;;1000;N;;;;217F; 2170;SMALL ROMAN NUMERAL ONE;Nl;0;L; 0069;;;1;N;;;2160;;2160 2171;SMALL ROMAN NUMERAL TWO;Nl;0;L; 0069 0069;;;2;N;;;2161;;2161 2172;SMALL ROMAN NUMERAL THREE;Nl;0;L; 0069 0069 0069;;;3;N;;;2162;;2162 2173;SMALL ROMAN NUMERAL FOUR;Nl;0;L; 0069 0076;;;4;N;;;2163;;2163 2174;SMALL ROMAN NUMERAL FIVE;Nl;0;L; 0076;;;5;N;;;2164;;2164 2175;SMALL ROMAN NUMERAL SIX;Nl;0;L; 0076 0069;;;6;N;;;2165;;2165 2176;SMALL ROMAN NUMERAL SEVEN;Nl;0;L; 0076 0069 0069;;;7;N;;;2166;;2166 2177;SMALL ROMAN NUMERAL EIGHT;Nl;0;L; 0076 0069 0069 0069;;;8;N;;;2167;;2167 2178;SMALL ROMAN NUMERAL NINE;Nl;0;L; 0069 0078;;;9;N;;;2168;;2168 2179;SMALL ROMAN NUMERAL TEN;Nl;0;L; 0078;;;10;N;;;2169;;2169 217A;SMALL ROMAN NUMERAL ELEVEN;Nl;0;L; 0078 0069;;;11;N;;;216A;;216A 217B;SMALL ROMAN NUMERAL TWELVE;Nl;0;L; 0078 0069 0069;;;12;N;;;216B;;216B 217C;SMALL ROMAN NUMERAL FIFTY;Nl;0;L; 006C;;;50;N;;;216C;;216C 217D;SMALL ROMAN NUMERAL ONE HUNDRED;Nl;0;L; 0063;;;100;N;;;216D;;216D 217E;SMALL ROMAN NUMERAL FIVE HUNDRED;Nl;0;L; 0064;;;500;N;;;216E;;216E 217F;SMALL ROMAN NUMERAL ONE THOUSAND;Nl;0;L; 006D;;;1000;N;;;216F;;216F 2180;ROMAN NUMERAL ONE THOUSAND C D;Nl;0;L;;;;1000;N;;;;; 2181;ROMAN NUMERAL FIVE THOUSAND;Nl;0;L;;;;5000;N;;;;; 2182;ROMAN NUMERAL TEN THOUSAND;Nl;0;L;;;;10000;N;;;;; 2183;ROMAN NUMERAL REVERSED ONE HUNDRED;Lu;0;L;;;;;N;;;;2184; 2184;LATIN SMALL LETTER REVERSED C;Ll;0;L;;;;;N;;;2183;;2183 2185;ROMAN NUMERAL SIX LATE FORM;Nl;0;L;;;;6;N;;;;; 2186;ROMAN NUMERAL FIFTY EARLY FORM;Nl;0;L;;;;50;N;;;;; 2187;ROMAN NUMERAL FIFTY THOUSAND;Nl;0;L;;;;50000;N;;;;; 2188;ROMAN NUMERAL ONE HUNDRED THOUSAND;Nl;0;L;;;;100000;N;;;;; 2189;VULGAR FRACTION ZERO THIRDS;No;0;ON; 0030 2044 0033;;;0;N;;;;; 2190;LEFTWARDS ARROW;Sm;0;ON;;;;;N;LEFT ARROW;;;; 2191;UPWARDS ARROW;Sm;0;ON;;;;;N;UP ARROW;;;; 2192;RIGHTWARDS ARROW;Sm;0;ON;;;;;N;RIGHT ARROW;;;; 2193;DOWNWARDS ARROW;Sm;0;ON;;;;;N;DOWN ARROW;;;; 2194;LEFT RIGHT ARROW;Sm;0;ON;;;;;N;;;;; 2195;UP DOWN ARROW;So;0;ON;;;;;N;;;;; 2196;NORTH WEST ARROW;So;0;ON;;;;;N;UPPER LEFT ARROW;;;; 2197;NORTH EAST ARROW;So;0;ON;;;;;N;UPPER RIGHT ARROW;;;; 2198;SOUTH EAST ARROW;So;0;ON;;;;;N;LOWER RIGHT ARROW;;;; 2199;SOUTH WEST ARROW;So;0;ON;;;;;N;LOWER LEFT ARROW;;;; 219A;LEFTWARDS ARROW WITH STROKE;Sm;0;ON;2190 0338;;;;N;LEFT ARROW WITH STROKE;;;; 219B;RIGHTWARDS ARROW WITH STROKE;Sm;0;ON;2192 0338;;;;N;RIGHT ARROW WITH STROKE;;;; 219C;LEFTWARDS WAVE ARROW;So;0;ON;;;;;N;LEFT WAVE ARROW;;;; 219D;RIGHTWARDS WAVE ARROW;So;0;ON;;;;;N;RIGHT WAVE ARROW;;;; 219E;LEFTWARDS TWO HEADED ARROW;So;0;ON;;;;;N;LEFT TWO HEADED ARROW;;;; 219F;UPWARDS TWO HEADED ARROW;So;0;ON;;;;;N;UP TWO HEADED ARROW;;;; 21A0;RIGHTWARDS TWO HEADED ARROW;Sm;0;ON;;;;;N;RIGHT TWO HEADED ARROW;;;; 21A1;DOWNWARDS TWO HEADED ARROW;So;0;ON;;;;;N;DOWN TWO HEADED ARROW;;;; 21A2;LEFTWARDS ARROW WITH TAIL;So;0;ON;;;;;N;LEFT ARROW WITH TAIL;;;; 21A3;RIGHTWARDS ARROW WITH TAIL;Sm;0;ON;;;;;N;RIGHT ARROW WITH TAIL;;;; 21A4;LEFTWARDS ARROW FROM BAR;So;0;ON;;;;;N;LEFT ARROW FROM BAR;;;; 21A5;UPWARDS ARROW FROM BAR;So;0;ON;;;;;N;UP ARROW FROM BAR;;;; 21A6;RIGHTWARDS ARROW FROM BAR;Sm;0;ON;;;;;N;RIGHT ARROW FROM BAR;;;; 21A7;DOWNWARDS ARROW FROM BAR;So;0;ON;;;;;N;DOWN ARROW FROM BAR;;;; 21A8;UP DOWN ARROW WITH BASE;So;0;ON;;;;;N;;;;; 21A9;LEFTWARDS ARROW WITH HOOK;So;0;ON;;;;;N;LEFT ARROW WITH HOOK;;;; 21AA;RIGHTWARDS ARROW WITH HOOK;So;0;ON;;;;;N;RIGHT ARROW WITH HOOK;;;; 21AB;LEFTWARDS ARROW WITH LOOP;So;0;ON;;;;;N;LEFT ARROW WITH LOOP;;;; 21AC;RIGHTWARDS ARROW WITH LOOP;So;0;ON;;;;;N;RIGHT ARROW WITH LOOP;;;; 21AD;LEFT RIGHT WAVE ARROW;So;0;ON;;;;;N;;;;; 21AE;LEFT RIGHT ARROW WITH STROKE;Sm;0;ON;2194 0338;;;;N;;;;; 21AF;DOWNWARDS ZIGZAG ARROW;So;0;ON;;;;;N;DOWN ZIGZAG ARROW;;;; 21B0;UPWARDS ARROW WITH TIP LEFTWARDS;So;0;ON;;;;;N;UP ARROW WITH TIP LEFT;;;; 21B1;UPWARDS ARROW WITH TIP RIGHTWARDS;So;0;ON;;;;;N;UP ARROW WITH TIP RIGHT;;;; 21B2;DOWNWARDS ARROW WITH TIP LEFTWARDS;So;0;ON;;;;;N;DOWN ARROW WITH TIP LEFT;;;; 21B3;DOWNWARDS ARROW WITH TIP RIGHTWARDS;So;0;ON;;;;;N;DOWN ARROW WITH TIP RIGHT;;;; 21B4;RIGHTWARDS ARROW WITH CORNER DOWNWARDS;So;0;ON;;;;;N;RIGHT ARROW WITH CORNER DOWN;;;; 21B5;DOWNWARDS ARROW WITH CORNER LEFTWARDS;So;0;ON;;;;;N;DOWN ARROW WITH CORNER LEFT;;;; 21B6;ANTICLOCKWISE TOP SEMICIRCLE ARROW;So;0;ON;;;;;N;;;;; 21B7;CLOCKWISE TOP SEMICIRCLE ARROW;So;0;ON;;;;;N;;;;; 21B8;NORTH WEST ARROW TO LONG BAR;So;0;ON;;;;;N;UPPER LEFT ARROW TO LONG BAR;;;; 21B9;LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR;So;0;ON;;;;;N;LEFT ARROW TO BAR OVER RIGHT ARROW TO BAR;;;; 21BA;ANTICLOCKWISE OPEN CIRCLE ARROW;So;0;ON;;;;;N;;;;; 21BB;CLOCKWISE OPEN CIRCLE ARROW;So;0;ON;;;;;N;;;;; 21BC;LEFTWARDS HARPOON WITH BARB UPWARDS;So;0;ON;;;;;N;LEFT HARPOON WITH BARB UP;;;; 21BD;LEFTWARDS HARPOON WITH BARB DOWNWARDS;So;0;ON;;;;;N;LEFT HARPOON WITH BARB DOWN;;;; 21BE;UPWARDS HARPOON WITH BARB RIGHTWARDS;So;0;ON;;;;;N;UP HARPOON WITH BARB RIGHT;;;; 21BF;UPWARDS HARPOON WITH BARB LEFTWARDS;So;0;ON;;;;;N;UP HARPOON WITH BARB LEFT;;;; 21C0;RIGHTWARDS HARPOON WITH BARB UPWARDS;So;0;ON;;;;;N;RIGHT HARPOON WITH BARB UP;;;; 21C1;RIGHTWARDS HARPOON WITH BARB DOWNWARDS;So;0;ON;;;;;N;RIGHT HARPOON WITH BARB DOWN;;;; 21C2;DOWNWARDS HARPOON WITH BARB RIGHTWARDS;So;0;ON;;;;;N;DOWN HARPOON WITH BARB RIGHT;;;; 21C3;DOWNWARDS HARPOON WITH BARB LEFTWARDS;So;0;ON;;;;;N;DOWN HARPOON WITH BARB LEFT;;;; 21C4;RIGHTWARDS ARROW OVER LEFTWARDS ARROW;So;0;ON;;;;;N;RIGHT ARROW OVER LEFT ARROW;;;; 21C5;UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW;So;0;ON;;;;;N;UP ARROW LEFT OF DOWN ARROW;;;; 21C6;LEFTWARDS ARROW OVER RIGHTWARDS ARROW;So;0;ON;;;;;N;LEFT ARROW OVER RIGHT ARROW;;;; 21C7;LEFTWARDS PAIRED ARROWS;So;0;ON;;;;;N;LEFT PAIRED ARROWS;;;; 21C8;UPWARDS PAIRED ARROWS;So;0;ON;;;;;N;UP PAIRED ARROWS;;;; 21C9;RIGHTWARDS PAIRED ARROWS;So;0;ON;;;;;N;RIGHT PAIRED ARROWS;;;; 21CA;DOWNWARDS PAIRED ARROWS;So;0;ON;;;;;N;DOWN PAIRED ARROWS;;;; 21CB;LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON;So;0;ON;;;;;N;LEFT HARPOON OVER RIGHT HARPOON;;;; 21CC;RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON;So;0;ON;;;;;N;RIGHT HARPOON OVER LEFT HARPOON;;;; 21CD;LEFTWARDS DOUBLE ARROW WITH STROKE;So;0;ON;21D0 0338;;;;N;LEFT DOUBLE ARROW WITH STROKE;;;; 21CE;LEFT RIGHT DOUBLE ARROW WITH STROKE;Sm;0;ON;21D4 0338;;;;N;;;;; 21CF;RIGHTWARDS DOUBLE ARROW WITH STROKE;Sm;0;ON;21D2 0338;;;;N;RIGHT DOUBLE ARROW WITH STROKE;;;; 21D0;LEFTWARDS DOUBLE ARROW;So;0;ON;;;;;N;LEFT DOUBLE ARROW;;;; 21D1;UPWARDS DOUBLE ARROW;So;0;ON;;;;;N;UP DOUBLE ARROW;;;; 21D2;RIGHTWARDS DOUBLE ARROW;Sm;0;ON;;;;;N;RIGHT DOUBLE ARROW;;;; 21D3;DOWNWARDS DOUBLE ARROW;So;0;ON;;;;;N;DOWN DOUBLE ARROW;;;; 21D4;LEFT RIGHT DOUBLE ARROW;Sm;0;ON;;;;;N;;;;; 21D5;UP DOWN DOUBLE ARROW;So;0;ON;;;;;N;;;;; 21D6;NORTH WEST DOUBLE ARROW;So;0;ON;;;;;N;UPPER LEFT DOUBLE ARROW;;;; 21D7;NORTH EAST DOUBLE ARROW;So;0;ON;;;;;N;UPPER RIGHT DOUBLE ARROW;;;; 21D8;SOUTH EAST DOUBLE ARROW;So;0;ON;;;;;N;LOWER RIGHT DOUBLE ARROW;;;; 21D9;SOUTH WEST DOUBLE ARROW;So;0;ON;;;;;N;LOWER LEFT DOUBLE ARROW;;;; 21DA;LEFTWARDS TRIPLE ARROW;So;0;ON;;;;;N;LEFT TRIPLE ARROW;;;; 21DB;RIGHTWARDS TRIPLE ARROW;So;0;ON;;;;;N;RIGHT TRIPLE ARROW;;;; 21DC;LEFTWARDS SQUIGGLE ARROW;So;0;ON;;;;;N;LEFT SQUIGGLE ARROW;;;; 21DD;RIGHTWARDS SQUIGGLE ARROW;So;0;ON;;;;;N;RIGHT SQUIGGLE ARROW;;;; 21DE;UPWARDS ARROW WITH DOUBLE STROKE;So;0;ON;;;;;N;UP ARROW WITH DOUBLE STROKE;;;; 21DF;DOWNWARDS ARROW WITH DOUBLE STROKE;So;0;ON;;;;;N;DOWN ARROW WITH DOUBLE STROKE;;;; 21E0;LEFTWARDS DASHED ARROW;So;0;ON;;;;;N;LEFT DASHED ARROW;;;; 21E1;UPWARDS DASHED ARROW;So;0;ON;;;;;N;UP DASHED ARROW;;;; 21E2;RIGHTWARDS DASHED ARROW;So;0;ON;;;;;N;RIGHT DASHED ARROW;;;; 21E3;DOWNWARDS DASHED ARROW;So;0;ON;;;;;N;DOWN DASHED ARROW;;;; 21E4;LEFTWARDS ARROW TO BAR;So;0;ON;;;;;N;LEFT ARROW TO BAR;;;; 21E5;RIGHTWARDS ARROW TO BAR;So;0;ON;;;;;N;RIGHT ARROW TO BAR;;;; 21E6;LEFTWARDS WHITE ARROW;So;0;ON;;;;;N;WHITE LEFT ARROW;;;; 21E7;UPWARDS WHITE ARROW;So;0;ON;;;;;N;WHITE UP ARROW;;;; 21E8;RIGHTWARDS WHITE ARROW;So;0;ON;;;;;N;WHITE RIGHT ARROW;;;; 21E9;DOWNWARDS WHITE ARROW;So;0;ON;;;;;N;WHITE DOWN ARROW;;;; 21EA;UPWARDS WHITE ARROW FROM BAR;So;0;ON;;;;;N;WHITE UP ARROW FROM BAR;;;; 21EB;UPWARDS WHITE ARROW ON PEDESTAL;So;0;ON;;;;;N;;;;; 21EC;UPWARDS WHITE ARROW ON PEDESTAL WITH HORIZONTAL BAR;So;0;ON;;;;;N;;;;; 21ED;UPWARDS WHITE ARROW ON PEDESTAL WITH VERTICAL BAR;So;0;ON;;;;;N;;;;; 21EE;UPWARDS WHITE DOUBLE ARROW;So;0;ON;;;;;N;;;;; 21EF;UPWARDS WHITE DOUBLE ARROW ON PEDESTAL;So;0;ON;;;;;N;;;;; 21F0;RIGHTWARDS WHITE ARROW FROM WALL;So;0;ON;;;;;N;;;;; 21F1;NORTH WEST ARROW TO CORNER;So;0;ON;;;;;N;;;;; 21F2;SOUTH EAST ARROW TO CORNER;So;0;ON;;;;;N;;;;; 21F3;UP DOWN WHITE ARROW;So;0;ON;;;;;N;;;;; 21F4;RIGHT ARROW WITH SMALL CIRCLE;Sm;0;ON;;;;;N;;;;; 21F5;DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW;Sm;0;ON;;;;;N;;;;; 21F6;THREE RIGHTWARDS ARROWS;Sm;0;ON;;;;;N;;;;; 21F7;LEFTWARDS ARROW WITH VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 21F8;RIGHTWARDS ARROW WITH VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 21F9;LEFT RIGHT ARROW WITH VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 21FA;LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 21FB;RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 21FC;LEFT RIGHT ARROW WITH DOUBLE VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 21FD;LEFTWARDS OPEN-HEADED ARROW;Sm;0;ON;;;;;N;;;;; 21FE;RIGHTWARDS OPEN-HEADED ARROW;Sm;0;ON;;;;;N;;;;; 21FF;LEFT RIGHT OPEN-HEADED ARROW;Sm;0;ON;;;;;N;;;;; 2200;FOR ALL;Sm;0;ON;;;;;N;;;;; 2201;COMPLEMENT;Sm;0;ON;;;;;Y;;;;; 2202;PARTIAL DIFFERENTIAL;Sm;0;ON;;;;;Y;;;;; 2203;THERE EXISTS;Sm;0;ON;;;;;Y;;;;; 2204;THERE DOES NOT EXIST;Sm;0;ON;2203 0338;;;;Y;;;;; 2205;EMPTY SET;Sm;0;ON;;;;;N;;;;; 2206;INCREMENT;Sm;0;ON;;;;;N;;;;; 2207;NABLA;Sm;0;ON;;;;;N;;;;; 2208;ELEMENT OF;Sm;0;ON;;;;;Y;;;;; 2209;NOT AN ELEMENT OF;Sm;0;ON;2208 0338;;;;Y;;;;; 220A;SMALL ELEMENT OF;Sm;0;ON;;;;;Y;;;;; 220B;CONTAINS AS MEMBER;Sm;0;ON;;;;;Y;;;;; 220C;DOES NOT CONTAIN AS MEMBER;Sm;0;ON;220B 0338;;;;Y;;;;; 220D;SMALL CONTAINS AS MEMBER;Sm;0;ON;;;;;Y;;;;; 220E;END OF PROOF;Sm;0;ON;;;;;N;;;;; 220F;N-ARY PRODUCT;Sm;0;ON;;;;;N;;;;; 2210;N-ARY COPRODUCT;Sm;0;ON;;;;;N;;;;; 2211;N-ARY SUMMATION;Sm;0;ON;;;;;Y;;;;; 2212;MINUS SIGN;Sm;0;ES;;;;;N;;;;; 2213;MINUS-OR-PLUS SIGN;Sm;0;ET;;;;;N;;;;; 2214;DOT PLUS;Sm;0;ON;;;;;N;;;;; 2215;DIVISION SLASH;Sm;0;ON;;;;;Y;;;;; 2216;SET MINUS;Sm;0;ON;;;;;Y;;;;; 2217;ASTERISK OPERATOR;Sm;0;ON;;;;;N;;;;; 2218;RING OPERATOR;Sm;0;ON;;;;;N;;;;; 2219;BULLET OPERATOR;Sm;0;ON;;;;;N;;;;; 221A;SQUARE ROOT;Sm;0;ON;;;;;Y;;;;; 221B;CUBE ROOT;Sm;0;ON;;;;;Y;;;;; 221C;FOURTH ROOT;Sm;0;ON;;;;;Y;;;;; 221D;PROPORTIONAL TO;Sm;0;ON;;;;;Y;;;;; 221E;INFINITY;Sm;0;ON;;;;;N;;;;; 221F;RIGHT ANGLE;Sm;0;ON;;;;;Y;;;;; 2220;ANGLE;Sm;0;ON;;;;;Y;;;;; 2221;MEASURED ANGLE;Sm;0;ON;;;;;Y;;;;; 2222;SPHERICAL ANGLE;Sm;0;ON;;;;;Y;;;;; 2223;DIVIDES;Sm;0;ON;;;;;N;;;;; 2224;DOES NOT DIVIDE;Sm;0;ON;2223 0338;;;;Y;;;;; 2225;PARALLEL TO;Sm;0;ON;;;;;N;;;;; 2226;NOT PARALLEL TO;Sm;0;ON;2225 0338;;;;Y;;;;; 2227;LOGICAL AND;Sm;0;ON;;;;;N;;;;; 2228;LOGICAL OR;Sm;0;ON;;;;;N;;;;; 2229;INTERSECTION;Sm;0;ON;;;;;N;;;;; 222A;UNION;Sm;0;ON;;;;;N;;;;; 222B;INTEGRAL;Sm;0;ON;;;;;Y;;;;; 222C;DOUBLE INTEGRAL;Sm;0;ON; 222B 222B;;;;Y;;;;; 222D;TRIPLE INTEGRAL;Sm;0;ON; 222B 222B 222B;;;;Y;;;;; 222E;CONTOUR INTEGRAL;Sm;0;ON;;;;;Y;;;;; 222F;SURFACE INTEGRAL;Sm;0;ON; 222E 222E;;;;Y;;;;; 2230;VOLUME INTEGRAL;Sm;0;ON; 222E 222E 222E;;;;Y;;;;; 2231;CLOCKWISE INTEGRAL;Sm;0;ON;;;;;Y;;;;; 2232;CLOCKWISE CONTOUR INTEGRAL;Sm;0;ON;;;;;Y;;;;; 2233;ANTICLOCKWISE CONTOUR INTEGRAL;Sm;0;ON;;;;;Y;;;;; 2234;THEREFORE;Sm;0;ON;;;;;N;;;;; 2235;BECAUSE;Sm;0;ON;;;;;N;;;;; 2236;RATIO;Sm;0;ON;;;;;N;;;;; 2237;PROPORTION;Sm;0;ON;;;;;N;;;;; 2238;DOT MINUS;Sm;0;ON;;;;;N;;;;; 2239;EXCESS;Sm;0;ON;;;;;Y;;;;; 223A;GEOMETRIC PROPORTION;Sm;0;ON;;;;;N;;;;; 223B;HOMOTHETIC;Sm;0;ON;;;;;Y;;;;; 223C;TILDE OPERATOR;Sm;0;ON;;;;;Y;;;;; 223D;REVERSED TILDE;Sm;0;ON;;;;;Y;;;;; 223E;INVERTED LAZY S;Sm;0;ON;;;;;Y;;;;; 223F;SINE WAVE;Sm;0;ON;;;;;Y;;;;; 2240;WREATH PRODUCT;Sm;0;ON;;;;;Y;;;;; 2241;NOT TILDE;Sm;0;ON;223C 0338;;;;Y;;;;; 2242;MINUS TILDE;Sm;0;ON;;;;;Y;;;;; 2243;ASYMPTOTICALLY EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2244;NOT ASYMPTOTICALLY EQUAL TO;Sm;0;ON;2243 0338;;;;Y;;;;; 2245;APPROXIMATELY EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2246;APPROXIMATELY BUT NOT ACTUALLY EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2247;NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO;Sm;0;ON;2245 0338;;;;Y;;;;; 2248;ALMOST EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2249;NOT ALMOST EQUAL TO;Sm;0;ON;2248 0338;;;;Y;;;;; 224A;ALMOST EQUAL OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 224B;TRIPLE TILDE;Sm;0;ON;;;;;Y;;;;; 224C;ALL EQUAL TO;Sm;0;ON;;;;;Y;;;;; 224D;EQUIVALENT TO;Sm;0;ON;;;;;N;;;;; 224E;GEOMETRICALLY EQUIVALENT TO;Sm;0;ON;;;;;N;;;;; 224F;DIFFERENCE BETWEEN;Sm;0;ON;;;;;N;;;;; 2250;APPROACHES THE LIMIT;Sm;0;ON;;;;;N;;;;; 2251;GEOMETRICALLY EQUAL TO;Sm;0;ON;;;;;N;;;;; 2252;APPROXIMATELY EQUAL TO OR THE IMAGE OF;Sm;0;ON;;;;;Y;;;;; 2253;IMAGE OF OR APPROXIMATELY EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2254;COLON EQUALS;Sm;0;ON;;;;;Y;COLON EQUAL;;;; 2255;EQUALS COLON;Sm;0;ON;;;;;Y;EQUAL COLON;;;; 2256;RING IN EQUAL TO;Sm;0;ON;;;;;N;;;;; 2257;RING EQUAL TO;Sm;0;ON;;;;;N;;;;; 2258;CORRESPONDS TO;Sm;0;ON;;;;;N;;;;; 2259;ESTIMATES;Sm;0;ON;;;;;N;;;;; 225A;EQUIANGULAR TO;Sm;0;ON;;;;;N;;;;; 225B;STAR EQUALS;Sm;0;ON;;;;;N;;;;; 225C;DELTA EQUAL TO;Sm;0;ON;;;;;N;;;;; 225D;EQUAL TO BY DEFINITION;Sm;0;ON;;;;;N;;;;; 225E;MEASURED BY;Sm;0;ON;;;;;N;;;;; 225F;QUESTIONED EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2260;NOT EQUAL TO;Sm;0;ON;003D 0338;;;;Y;;;;; 2261;IDENTICAL TO;Sm;0;ON;;;;;N;;;;; 2262;NOT IDENTICAL TO;Sm;0;ON;2261 0338;;;;Y;;;;; 2263;STRICTLY EQUIVALENT TO;Sm;0;ON;;;;;N;;;;; 2264;LESS-THAN OR EQUAL TO;Sm;0;ON;;;;;Y;LESS THAN OR EQUAL TO;;;; 2265;GREATER-THAN OR EQUAL TO;Sm;0;ON;;;;;Y;GREATER THAN OR EQUAL TO;;;; 2266;LESS-THAN OVER EQUAL TO;Sm;0;ON;;;;;Y;LESS THAN OVER EQUAL TO;;;; 2267;GREATER-THAN OVER EQUAL TO;Sm;0;ON;;;;;Y;GREATER THAN OVER EQUAL TO;;;; 2268;LESS-THAN BUT NOT EQUAL TO;Sm;0;ON;;;;;Y;LESS THAN BUT NOT EQUAL TO;;;; 2269;GREATER-THAN BUT NOT EQUAL TO;Sm;0;ON;;;;;Y;GREATER THAN BUT NOT EQUAL TO;;;; 226A;MUCH LESS-THAN;Sm;0;ON;;;;;Y;MUCH LESS THAN;;;; 226B;MUCH GREATER-THAN;Sm;0;ON;;;;;Y;MUCH GREATER THAN;;;; 226C;BETWEEN;Sm;0;ON;;;;;N;;;;; 226D;NOT EQUIVALENT TO;Sm;0;ON;224D 0338;;;;N;;;;; 226E;NOT LESS-THAN;Sm;0;ON;003C 0338;;;;Y;NOT LESS THAN;;;; 226F;NOT GREATER-THAN;Sm;0;ON;003E 0338;;;;Y;NOT GREATER THAN;;;; 2270;NEITHER LESS-THAN NOR EQUAL TO;Sm;0;ON;2264 0338;;;;Y;NEITHER LESS THAN NOR EQUAL TO;;;; 2271;NEITHER GREATER-THAN NOR EQUAL TO;Sm;0;ON;2265 0338;;;;Y;NEITHER GREATER THAN NOR EQUAL TO;;;; 2272;LESS-THAN OR EQUIVALENT TO;Sm;0;ON;;;;;Y;LESS THAN OR EQUIVALENT TO;;;; 2273;GREATER-THAN OR EQUIVALENT TO;Sm;0;ON;;;;;Y;GREATER THAN OR EQUIVALENT TO;;;; 2274;NEITHER LESS-THAN NOR EQUIVALENT TO;Sm;0;ON;2272 0338;;;;Y;NEITHER LESS THAN NOR EQUIVALENT TO;;;; 2275;NEITHER GREATER-THAN NOR EQUIVALENT TO;Sm;0;ON;2273 0338;;;;Y;NEITHER GREATER THAN NOR EQUIVALENT TO;;;; 2276;LESS-THAN OR GREATER-THAN;Sm;0;ON;;;;;Y;LESS THAN OR GREATER THAN;;;; 2277;GREATER-THAN OR LESS-THAN;Sm;0;ON;;;;;Y;GREATER THAN OR LESS THAN;;;; 2278;NEITHER LESS-THAN NOR GREATER-THAN;Sm;0;ON;2276 0338;;;;Y;NEITHER LESS THAN NOR GREATER THAN;;;; 2279;NEITHER GREATER-THAN NOR LESS-THAN;Sm;0;ON;2277 0338;;;;Y;NEITHER GREATER THAN NOR LESS THAN;;;; 227A;PRECEDES;Sm;0;ON;;;;;Y;;;;; 227B;SUCCEEDS;Sm;0;ON;;;;;Y;;;;; 227C;PRECEDES OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 227D;SUCCEEDS OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 227E;PRECEDES OR EQUIVALENT TO;Sm;0;ON;;;;;Y;;;;; 227F;SUCCEEDS OR EQUIVALENT TO;Sm;0;ON;;;;;Y;;;;; 2280;DOES NOT PRECEDE;Sm;0;ON;227A 0338;;;;Y;;;;; 2281;DOES NOT SUCCEED;Sm;0;ON;227B 0338;;;;Y;;;;; 2282;SUBSET OF;Sm;0;ON;;;;;Y;;;;; 2283;SUPERSET OF;Sm;0;ON;;;;;Y;;;;; 2284;NOT A SUBSET OF;Sm;0;ON;2282 0338;;;;Y;;;;; 2285;NOT A SUPERSET OF;Sm;0;ON;2283 0338;;;;Y;;;;; 2286;SUBSET OF OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2287;SUPERSET OF OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2288;NEITHER A SUBSET OF NOR EQUAL TO;Sm;0;ON;2286 0338;;;;Y;;;;; 2289;NEITHER A SUPERSET OF NOR EQUAL TO;Sm;0;ON;2287 0338;;;;Y;;;;; 228A;SUBSET OF WITH NOT EQUAL TO;Sm;0;ON;;;;;Y;SUBSET OF OR NOT EQUAL TO;;;; 228B;SUPERSET OF WITH NOT EQUAL TO;Sm;0;ON;;;;;Y;SUPERSET OF OR NOT EQUAL TO;;;; 228C;MULTISET;Sm;0;ON;;;;;Y;;;;; 228D;MULTISET MULTIPLICATION;Sm;0;ON;;;;;N;;;;; 228E;MULTISET UNION;Sm;0;ON;;;;;N;;;;; 228F;SQUARE IMAGE OF;Sm;0;ON;;;;;Y;;;;; 2290;SQUARE ORIGINAL OF;Sm;0;ON;;;;;Y;;;;; 2291;SQUARE IMAGE OF OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2292;SQUARE ORIGINAL OF OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2293;SQUARE CAP;Sm;0;ON;;;;;N;;;;; 2294;SQUARE CUP;Sm;0;ON;;;;;N;;;;; 2295;CIRCLED PLUS;Sm;0;ON;;;;;N;;;;; 2296;CIRCLED MINUS;Sm;0;ON;;;;;N;;;;; 2297;CIRCLED TIMES;Sm;0;ON;;;;;N;;;;; 2298;CIRCLED DIVISION SLASH;Sm;0;ON;;;;;Y;;;;; 2299;CIRCLED DOT OPERATOR;Sm;0;ON;;;;;N;;;;; 229A;CIRCLED RING OPERATOR;Sm;0;ON;;;;;N;;;;; 229B;CIRCLED ASTERISK OPERATOR;Sm;0;ON;;;;;N;;;;; 229C;CIRCLED EQUALS;Sm;0;ON;;;;;N;;;;; 229D;CIRCLED DASH;Sm;0;ON;;;;;N;;;;; 229E;SQUARED PLUS;Sm;0;ON;;;;;N;;;;; 229F;SQUARED MINUS;Sm;0;ON;;;;;N;;;;; 22A0;SQUARED TIMES;Sm;0;ON;;;;;N;;;;; 22A1;SQUARED DOT OPERATOR;Sm;0;ON;;;;;N;;;;; 22A2;RIGHT TACK;Sm;0;ON;;;;;Y;;;;; 22A3;LEFT TACK;Sm;0;ON;;;;;Y;;;;; 22A4;DOWN TACK;Sm;0;ON;;;;;N;;;;; 22A5;UP TACK;Sm;0;ON;;;;;N;;;;; 22A6;ASSERTION;Sm;0;ON;;;;;Y;;;;; 22A7;MODELS;Sm;0;ON;;;;;Y;;;;; 22A8;TRUE;Sm;0;ON;;;;;Y;;;;; 22A9;FORCES;Sm;0;ON;;;;;Y;;;;; 22AA;TRIPLE VERTICAL BAR RIGHT TURNSTILE;Sm;0;ON;;;;;Y;;;;; 22AB;DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE;Sm;0;ON;;;;;Y;;;;; 22AC;DOES NOT PROVE;Sm;0;ON;22A2 0338;;;;Y;;;;; 22AD;NOT TRUE;Sm;0;ON;22A8 0338;;;;Y;;;;; 22AE;DOES NOT FORCE;Sm;0;ON;22A9 0338;;;;Y;;;;; 22AF;NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE;Sm;0;ON;22AB 0338;;;;Y;;;;; 22B0;PRECEDES UNDER RELATION;Sm;0;ON;;;;;Y;;;;; 22B1;SUCCEEDS UNDER RELATION;Sm;0;ON;;;;;Y;;;;; 22B2;NORMAL SUBGROUP OF;Sm;0;ON;;;;;Y;;;;; 22B3;CONTAINS AS NORMAL SUBGROUP;Sm;0;ON;;;;;Y;;;;; 22B4;NORMAL SUBGROUP OF OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 22B5;CONTAINS AS NORMAL SUBGROUP OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 22B6;ORIGINAL OF;Sm;0;ON;;;;;Y;;;;; 22B7;IMAGE OF;Sm;0;ON;;;;;Y;;;;; 22B8;MULTIMAP;Sm;0;ON;;;;;Y;;;;; 22B9;HERMITIAN CONJUGATE MATRIX;Sm;0;ON;;;;;N;;;;; 22BA;INTERCALATE;Sm;0;ON;;;;;N;;;;; 22BB;XOR;Sm;0;ON;;;;;N;;;;; 22BC;NAND;Sm;0;ON;;;;;N;;;;; 22BD;NOR;Sm;0;ON;;;;;N;;;;; 22BE;RIGHT ANGLE WITH ARC;Sm;0;ON;;;;;Y;;;;; 22BF;RIGHT TRIANGLE;Sm;0;ON;;;;;Y;;;;; 22C0;N-ARY LOGICAL AND;Sm;0;ON;;;;;N;;;;; 22C1;N-ARY LOGICAL OR;Sm;0;ON;;;;;N;;;;; 22C2;N-ARY INTERSECTION;Sm;0;ON;;;;;N;;;;; 22C3;N-ARY UNION;Sm;0;ON;;;;;N;;;;; 22C4;DIAMOND OPERATOR;Sm;0;ON;;;;;N;;;;; 22C5;DOT OPERATOR;Sm;0;ON;;;;;N;;;;; 22C6;STAR OPERATOR;Sm;0;ON;;;;;N;;;;; 22C7;DIVISION TIMES;Sm;0;ON;;;;;N;;;;; 22C8;BOWTIE;Sm;0;ON;;;;;N;;;;; 22C9;LEFT NORMAL FACTOR SEMIDIRECT PRODUCT;Sm;0;ON;;;;;Y;;;;; 22CA;RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT;Sm;0;ON;;;;;Y;;;;; 22CB;LEFT SEMIDIRECT PRODUCT;Sm;0;ON;;;;;Y;;;;; 22CC;RIGHT SEMIDIRECT PRODUCT;Sm;0;ON;;;;;Y;;;;; 22CD;REVERSED TILDE EQUALS;Sm;0;ON;;;;;Y;;;;; 22CE;CURLY LOGICAL OR;Sm;0;ON;;;;;N;;;;; 22CF;CURLY LOGICAL AND;Sm;0;ON;;;;;N;;;;; 22D0;DOUBLE SUBSET;Sm;0;ON;;;;;Y;;;;; 22D1;DOUBLE SUPERSET;Sm;0;ON;;;;;Y;;;;; 22D2;DOUBLE INTERSECTION;Sm;0;ON;;;;;N;;;;; 22D3;DOUBLE UNION;Sm;0;ON;;;;;N;;;;; 22D4;PITCHFORK;Sm;0;ON;;;;;N;;;;; 22D5;EQUAL AND PARALLEL TO;Sm;0;ON;;;;;N;;;;; 22D6;LESS-THAN WITH DOT;Sm;0;ON;;;;;Y;LESS THAN WITH DOT;;;; 22D7;GREATER-THAN WITH DOT;Sm;0;ON;;;;;Y;GREATER THAN WITH DOT;;;; 22D8;VERY MUCH LESS-THAN;Sm;0;ON;;;;;Y;VERY MUCH LESS THAN;;;; 22D9;VERY MUCH GREATER-THAN;Sm;0;ON;;;;;Y;VERY MUCH GREATER THAN;;;; 22DA;LESS-THAN EQUAL TO OR GREATER-THAN;Sm;0;ON;;;;;Y;LESS THAN EQUAL TO OR GREATER THAN;;;; 22DB;GREATER-THAN EQUAL TO OR LESS-THAN;Sm;0;ON;;;;;Y;GREATER THAN EQUAL TO OR LESS THAN;;;; 22DC;EQUAL TO OR LESS-THAN;Sm;0;ON;;;;;Y;EQUAL TO OR LESS THAN;;;; 22DD;EQUAL TO OR GREATER-THAN;Sm;0;ON;;;;;Y;EQUAL TO OR GREATER THAN;;;; 22DE;EQUAL TO OR PRECEDES;Sm;0;ON;;;;;Y;;;;; 22DF;EQUAL TO OR SUCCEEDS;Sm;0;ON;;;;;Y;;;;; 22E0;DOES NOT PRECEDE OR EQUAL;Sm;0;ON;227C 0338;;;;Y;;;;; 22E1;DOES NOT SUCCEED OR EQUAL;Sm;0;ON;227D 0338;;;;Y;;;;; 22E2;NOT SQUARE IMAGE OF OR EQUAL TO;Sm;0;ON;2291 0338;;;;Y;;;;; 22E3;NOT SQUARE ORIGINAL OF OR EQUAL TO;Sm;0;ON;2292 0338;;;;Y;;;;; 22E4;SQUARE IMAGE OF OR NOT EQUAL TO;Sm;0;ON;;;;;Y;;;;; 22E5;SQUARE ORIGINAL OF OR NOT EQUAL TO;Sm;0;ON;;;;;Y;;;;; 22E6;LESS-THAN BUT NOT EQUIVALENT TO;Sm;0;ON;;;;;Y;LESS THAN BUT NOT EQUIVALENT TO;;;; 22E7;GREATER-THAN BUT NOT EQUIVALENT TO;Sm;0;ON;;;;;Y;GREATER THAN BUT NOT EQUIVALENT TO;;;; 22E8;PRECEDES BUT NOT EQUIVALENT TO;Sm;0;ON;;;;;Y;;;;; 22E9;SUCCEEDS BUT NOT EQUIVALENT TO;Sm;0;ON;;;;;Y;;;;; 22EA;NOT NORMAL SUBGROUP OF;Sm;0;ON;22B2 0338;;;;Y;;;;; 22EB;DOES NOT CONTAIN AS NORMAL SUBGROUP;Sm;0;ON;22B3 0338;;;;Y;;;;; 22EC;NOT NORMAL SUBGROUP OF OR EQUAL TO;Sm;0;ON;22B4 0338;;;;Y;;;;; 22ED;DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL;Sm;0;ON;22B5 0338;;;;Y;;;;; 22EE;VERTICAL ELLIPSIS;Sm;0;ON;;;;;N;;;;; 22EF;MIDLINE HORIZONTAL ELLIPSIS;Sm;0;ON;;;;;N;;;;; 22F0;UP RIGHT DIAGONAL ELLIPSIS;Sm;0;ON;;;;;Y;;;;; 22F1;DOWN RIGHT DIAGONAL ELLIPSIS;Sm;0;ON;;;;;Y;;;;; 22F2;ELEMENT OF WITH LONG HORIZONTAL STROKE;Sm;0;ON;;;;;Y;;;;; 22F3;ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE;Sm;0;ON;;;;;Y;;;;; 22F4;SMALL ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE;Sm;0;ON;;;;;Y;;;;; 22F5;ELEMENT OF WITH DOT ABOVE;Sm;0;ON;;;;;Y;;;;; 22F6;ELEMENT OF WITH OVERBAR;Sm;0;ON;;;;;Y;;;;; 22F7;SMALL ELEMENT OF WITH OVERBAR;Sm;0;ON;;;;;Y;;;;; 22F8;ELEMENT OF WITH UNDERBAR;Sm;0;ON;;;;;Y;;;;; 22F9;ELEMENT OF WITH TWO HORIZONTAL STROKES;Sm;0;ON;;;;;Y;;;;; 22FA;CONTAINS WITH LONG HORIZONTAL STROKE;Sm;0;ON;;;;;Y;;;;; 22FB;CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE;Sm;0;ON;;;;;Y;;;;; 22FC;SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE;Sm;0;ON;;;;;Y;;;;; 22FD;CONTAINS WITH OVERBAR;Sm;0;ON;;;;;Y;;;;; 22FE;SMALL CONTAINS WITH OVERBAR;Sm;0;ON;;;;;Y;;;;; 22FF;Z NOTATION BAG MEMBERSHIP;Sm;0;ON;;;;;Y;;;;; 2300;DIAMETER SIGN;So;0;ON;;;;;N;;;;; 2301;ELECTRIC ARROW;So;0;ON;;;;;N;;;;; 2302;HOUSE;So;0;ON;;;;;N;;;;; 2303;UP ARROWHEAD;So;0;ON;;;;;N;;;;; 2304;DOWN ARROWHEAD;So;0;ON;;;;;N;;;;; 2305;PROJECTIVE;So;0;ON;;;;;N;;;;; 2306;PERSPECTIVE;So;0;ON;;;;;N;;;;; 2307;WAVY LINE;So;0;ON;;;;;N;;;;; 2308;LEFT CEILING;Sm;0;ON;;;;;Y;;;;; 2309;RIGHT CEILING;Sm;0;ON;;;;;Y;;;;; 230A;LEFT FLOOR;Sm;0;ON;;;;;Y;;;;; 230B;RIGHT FLOOR;Sm;0;ON;;;;;Y;;;;; 230C;BOTTOM RIGHT CROP;So;0;ON;;;;;N;;;;; 230D;BOTTOM LEFT CROP;So;0;ON;;;;;N;;;;; 230E;TOP RIGHT CROP;So;0;ON;;;;;N;;;;; 230F;TOP LEFT CROP;So;0;ON;;;;;N;;;;; 2310;REVERSED NOT SIGN;So;0;ON;;;;;N;;;;; 2311;SQUARE LOZENGE;So;0;ON;;;;;N;;;;; 2312;ARC;So;0;ON;;;;;N;;;;; 2313;SEGMENT;So;0;ON;;;;;N;;;;; 2314;SECTOR;So;0;ON;;;;;N;;;;; 2315;TELEPHONE RECORDER;So;0;ON;;;;;N;;;;; 2316;POSITION INDICATOR;So;0;ON;;;;;N;;;;; 2317;VIEWDATA SQUARE;So;0;ON;;;;;N;;;;; 2318;PLACE OF INTEREST SIGN;So;0;ON;;;;;N;COMMAND KEY;;;; 2319;TURNED NOT SIGN;So;0;ON;;;;;N;;;;; 231A;WATCH;So;0;ON;;;;;N;;;;; 231B;HOURGLASS;So;0;ON;;;;;N;;;;; 231C;TOP LEFT CORNER;So;0;ON;;;;;N;;;;; 231D;TOP RIGHT CORNER;So;0;ON;;;;;N;;;;; 231E;BOTTOM LEFT CORNER;So;0;ON;;;;;N;;;;; 231F;BOTTOM RIGHT CORNER;So;0;ON;;;;;N;;;;; 2320;TOP HALF INTEGRAL;Sm;0;ON;;;;;Y;;;;; 2321;BOTTOM HALF INTEGRAL;Sm;0;ON;;;;;Y;;;;; 2322;FROWN;So;0;ON;;;;;N;;;;; 2323;SMILE;So;0;ON;;;;;N;;;;; 2324;UP ARROWHEAD BETWEEN TWO HORIZONTAL BARS;So;0;ON;;;;;N;ENTER KEY;;;; 2325;OPTION KEY;So;0;ON;;;;;N;;;;; 2326;ERASE TO THE RIGHT;So;0;ON;;;;;N;DELETE TO THE RIGHT KEY;;;; 2327;X IN A RECTANGLE BOX;So;0;ON;;;;;N;CLEAR KEY;;;; 2328;KEYBOARD;So;0;ON;;;;;N;;;;; 2329;LEFT-POINTING ANGLE BRACKET;Ps;0;ON;3008;;;;Y;BRA;;;; 232A;RIGHT-POINTING ANGLE BRACKET;Pe;0;ON;3009;;;;Y;KET;;;; 232B;ERASE TO THE LEFT;So;0;ON;;;;;N;DELETE TO THE LEFT KEY;;;; 232C;BENZENE RING;So;0;ON;;;;;N;;;;; 232D;CYLINDRICITY;So;0;ON;;;;;N;;;;; 232E;ALL AROUND-PROFILE;So;0;ON;;;;;N;;;;; 232F;SYMMETRY;So;0;ON;;;;;N;;;;; 2330;TOTAL RUNOUT;So;0;ON;;;;;N;;;;; 2331;DIMENSION ORIGIN;So;0;ON;;;;;N;;;;; 2332;CONICAL TAPER;So;0;ON;;;;;N;;;;; 2333;SLOPE;So;0;ON;;;;;N;;;;; 2334;COUNTERBORE;So;0;ON;;;;;N;;;;; 2335;COUNTERSINK;So;0;ON;;;;;N;;;;; 2336;APL FUNCTIONAL SYMBOL I-BEAM;So;0;L;;;;;N;;;;; 2337;APL FUNCTIONAL SYMBOL SQUISH QUAD;So;0;L;;;;;N;;;;; 2338;APL FUNCTIONAL SYMBOL QUAD EQUAL;So;0;L;;;;;N;;;;; 2339;APL FUNCTIONAL SYMBOL QUAD DIVIDE;So;0;L;;;;;N;;;;; 233A;APL FUNCTIONAL SYMBOL QUAD DIAMOND;So;0;L;;;;;N;;;;; 233B;APL FUNCTIONAL SYMBOL QUAD JOT;So;0;L;;;;;N;;;;; 233C;APL FUNCTIONAL SYMBOL QUAD CIRCLE;So;0;L;;;;;N;;;;; 233D;APL FUNCTIONAL SYMBOL CIRCLE STILE;So;0;L;;;;;N;;;;; 233E;APL FUNCTIONAL SYMBOL CIRCLE JOT;So;0;L;;;;;N;;;;; 233F;APL FUNCTIONAL SYMBOL SLASH BAR;So;0;L;;;;;N;;;;; 2340;APL FUNCTIONAL SYMBOL BACKSLASH BAR;So;0;L;;;;;N;;;;; 2341;APL FUNCTIONAL SYMBOL QUAD SLASH;So;0;L;;;;;N;;;;; 2342;APL FUNCTIONAL SYMBOL QUAD BACKSLASH;So;0;L;;;;;N;;;;; 2343;APL FUNCTIONAL SYMBOL QUAD LESS-THAN;So;0;L;;;;;N;;;;; 2344;APL FUNCTIONAL SYMBOL QUAD GREATER-THAN;So;0;L;;;;;N;;;;; 2345;APL FUNCTIONAL SYMBOL LEFTWARDS VANE;So;0;L;;;;;N;;;;; 2346;APL FUNCTIONAL SYMBOL RIGHTWARDS VANE;So;0;L;;;;;N;;;;; 2347;APL FUNCTIONAL SYMBOL QUAD LEFTWARDS ARROW;So;0;L;;;;;N;;;;; 2348;APL FUNCTIONAL SYMBOL QUAD RIGHTWARDS ARROW;So;0;L;;;;;N;;;;; 2349;APL FUNCTIONAL SYMBOL CIRCLE BACKSLASH;So;0;L;;;;;N;;;;; 234A;APL FUNCTIONAL SYMBOL DOWN TACK UNDERBAR;So;0;L;;;;;N;;;;; 234B;APL FUNCTIONAL SYMBOL DELTA STILE;So;0;L;;;;;N;;;;; 234C;APL FUNCTIONAL SYMBOL QUAD DOWN CARET;So;0;L;;;;;N;;;;; 234D;APL FUNCTIONAL SYMBOL QUAD DELTA;So;0;L;;;;;N;;;;; 234E;APL FUNCTIONAL SYMBOL DOWN TACK JOT;So;0;L;;;;;N;;;;; 234F;APL FUNCTIONAL SYMBOL UPWARDS VANE;So;0;L;;;;;N;;;;; 2350;APL FUNCTIONAL SYMBOL QUAD UPWARDS ARROW;So;0;L;;;;;N;;;;; 2351;APL FUNCTIONAL SYMBOL UP TACK OVERBAR;So;0;L;;;;;N;;;;; 2352;APL FUNCTIONAL SYMBOL DEL STILE;So;0;L;;;;;N;;;;; 2353;APL FUNCTIONAL SYMBOL QUAD UP CARET;So;0;L;;;;;N;;;;; 2354;APL FUNCTIONAL SYMBOL QUAD DEL;So;0;L;;;;;N;;;;; 2355;APL FUNCTIONAL SYMBOL UP TACK JOT;So;0;L;;;;;N;;;;; 2356;APL FUNCTIONAL SYMBOL DOWNWARDS VANE;So;0;L;;;;;N;;;;; 2357;APL FUNCTIONAL SYMBOL QUAD DOWNWARDS ARROW;So;0;L;;;;;N;;;;; 2358;APL FUNCTIONAL SYMBOL QUOTE UNDERBAR;So;0;L;;;;;N;;;;; 2359;APL FUNCTIONAL SYMBOL DELTA UNDERBAR;So;0;L;;;;;N;;;;; 235A;APL FUNCTIONAL SYMBOL DIAMOND UNDERBAR;So;0;L;;;;;N;;;;; 235B;APL FUNCTIONAL SYMBOL JOT UNDERBAR;So;0;L;;;;;N;;;;; 235C;APL FUNCTIONAL SYMBOL CIRCLE UNDERBAR;So;0;L;;;;;N;;;;; 235D;APL FUNCTIONAL SYMBOL UP SHOE JOT;So;0;L;;;;;N;;;;; 235E;APL FUNCTIONAL SYMBOL QUOTE QUAD;So;0;L;;;;;N;;;;; 235F;APL FUNCTIONAL SYMBOL CIRCLE STAR;So;0;L;;;;;N;;;;; 2360;APL FUNCTIONAL SYMBOL QUAD COLON;So;0;L;;;;;N;;;;; 2361;APL FUNCTIONAL SYMBOL UP TACK DIAERESIS;So;0;L;;;;;N;;;;; 2362;APL FUNCTIONAL SYMBOL DEL DIAERESIS;So;0;L;;;;;N;;;;; 2363;APL FUNCTIONAL SYMBOL STAR DIAERESIS;So;0;L;;;;;N;;;;; 2364;APL FUNCTIONAL SYMBOL JOT DIAERESIS;So;0;L;;;;;N;;;;; 2365;APL FUNCTIONAL SYMBOL CIRCLE DIAERESIS;So;0;L;;;;;N;;;;; 2366;APL FUNCTIONAL SYMBOL DOWN SHOE STILE;So;0;L;;;;;N;;;;; 2367;APL FUNCTIONAL SYMBOL LEFT SHOE STILE;So;0;L;;;;;N;;;;; 2368;APL FUNCTIONAL SYMBOL TILDE DIAERESIS;So;0;L;;;;;N;;;;; 2369;APL FUNCTIONAL SYMBOL GREATER-THAN DIAERESIS;So;0;L;;;;;N;;;;; 236A;APL FUNCTIONAL SYMBOL COMMA BAR;So;0;L;;;;;N;;;;; 236B;APL FUNCTIONAL SYMBOL DEL TILDE;So;0;L;;;;;N;;;;; 236C;APL FUNCTIONAL SYMBOL ZILDE;So;0;L;;;;;N;;;;; 236D;APL FUNCTIONAL SYMBOL STILE TILDE;So;0;L;;;;;N;;;;; 236E;APL FUNCTIONAL SYMBOL SEMICOLON UNDERBAR;So;0;L;;;;;N;;;;; 236F;APL FUNCTIONAL SYMBOL QUAD NOT EQUAL;So;0;L;;;;;N;;;;; 2370;APL FUNCTIONAL SYMBOL QUAD QUESTION;So;0;L;;;;;N;;;;; 2371;APL FUNCTIONAL SYMBOL DOWN CARET TILDE;So;0;L;;;;;N;;;;; 2372;APL FUNCTIONAL SYMBOL UP CARET TILDE;So;0;L;;;;;N;;;;; 2373;APL FUNCTIONAL SYMBOL IOTA;So;0;L;;;;;N;;;;; 2374;APL FUNCTIONAL SYMBOL RHO;So;0;L;;;;;N;;;;; 2375;APL FUNCTIONAL SYMBOL OMEGA;So;0;L;;;;;N;;;;; 2376;APL FUNCTIONAL SYMBOL ALPHA UNDERBAR;So;0;L;;;;;N;;;;; 2377;APL FUNCTIONAL SYMBOL EPSILON UNDERBAR;So;0;L;;;;;N;;;;; 2378;APL FUNCTIONAL SYMBOL IOTA UNDERBAR;So;0;L;;;;;N;;;;; 2379;APL FUNCTIONAL SYMBOL OMEGA UNDERBAR;So;0;L;;;;;N;;;;; 237A;APL FUNCTIONAL SYMBOL ALPHA;So;0;L;;;;;N;;;;; 237B;NOT CHECK MARK;So;0;ON;;;;;N;;;;; 237C;RIGHT ANGLE WITH DOWNWARDS ZIGZAG ARROW;Sm;0;ON;;;;;N;;;;; 237D;SHOULDERED OPEN BOX;So;0;ON;;;;;N;;;;; 237E;BELL SYMBOL;So;0;ON;;;;;N;;;;; 237F;VERTICAL LINE WITH MIDDLE DOT;So;0;ON;;;;;N;;;;; 2380;INSERTION SYMBOL;So;0;ON;;;;;N;;;;; 2381;CONTINUOUS UNDERLINE SYMBOL;So;0;ON;;;;;N;;;;; 2382;DISCONTINUOUS UNDERLINE SYMBOL;So;0;ON;;;;;N;;;;; 2383;EMPHASIS SYMBOL;So;0;ON;;;;;N;;;;; 2384;COMPOSITION SYMBOL;So;0;ON;;;;;N;;;;; 2385;WHITE SQUARE WITH CENTRE VERTICAL LINE;So;0;ON;;;;;N;;;;; 2386;ENTER SYMBOL;So;0;ON;;;;;N;;;;; 2387;ALTERNATIVE KEY SYMBOL;So;0;ON;;;;;N;;;;; 2388;HELM SYMBOL;So;0;ON;;;;;N;;;;; 2389;CIRCLED HORIZONTAL BAR WITH NOTCH;So;0;ON;;;;;N;;;;; 238A;CIRCLED TRIANGLE DOWN;So;0;ON;;;;;N;;;;; 238B;BROKEN CIRCLE WITH NORTHWEST ARROW;So;0;ON;;;;;N;;;;; 238C;UNDO SYMBOL;So;0;ON;;;;;N;;;;; 238D;MONOSTABLE SYMBOL;So;0;ON;;;;;N;;;;; 238E;HYSTERESIS SYMBOL;So;0;ON;;;;;N;;;;; 238F;OPEN-CIRCUIT-OUTPUT H-TYPE SYMBOL;So;0;ON;;;;;N;;;;; 2390;OPEN-CIRCUIT-OUTPUT L-TYPE SYMBOL;So;0;ON;;;;;N;;;;; 2391;PASSIVE-PULL-DOWN-OUTPUT SYMBOL;So;0;ON;;;;;N;;;;; 2392;PASSIVE-PULL-UP-OUTPUT SYMBOL;So;0;ON;;;;;N;;;;; 2393;DIRECT CURRENT SYMBOL FORM TWO;So;0;ON;;;;;N;;;;; 2394;SOFTWARE-FUNCTION SYMBOL;So;0;ON;;;;;N;;;;; 2395;APL FUNCTIONAL SYMBOL QUAD;So;0;L;;;;;N;;;;; 2396;DECIMAL SEPARATOR KEY SYMBOL;So;0;ON;;;;;N;;;;; 2397;PREVIOUS PAGE;So;0;ON;;;;;N;;;;; 2398;NEXT PAGE;So;0;ON;;;;;N;;;;; 2399;PRINT SCREEN SYMBOL;So;0;ON;;;;;N;;;;; 239A;CLEAR SCREEN SYMBOL;So;0;ON;;;;;N;;;;; 239B;LEFT PARENTHESIS UPPER HOOK;Sm;0;ON;;;;;N;;;;; 239C;LEFT PARENTHESIS EXTENSION;Sm;0;ON;;;;;N;;;;; 239D;LEFT PARENTHESIS LOWER HOOK;Sm;0;ON;;;;;N;;;;; 239E;RIGHT PARENTHESIS UPPER HOOK;Sm;0;ON;;;;;N;;;;; 239F;RIGHT PARENTHESIS EXTENSION;Sm;0;ON;;;;;N;;;;; 23A0;RIGHT PARENTHESIS LOWER HOOK;Sm;0;ON;;;;;N;;;;; 23A1;LEFT SQUARE BRACKET UPPER CORNER;Sm;0;ON;;;;;N;;;;; 23A2;LEFT SQUARE BRACKET EXTENSION;Sm;0;ON;;;;;N;;;;; 23A3;LEFT SQUARE BRACKET LOWER CORNER;Sm;0;ON;;;;;N;;;;; 23A4;RIGHT SQUARE BRACKET UPPER CORNER;Sm;0;ON;;;;;N;;;;; 23A5;RIGHT SQUARE BRACKET EXTENSION;Sm;0;ON;;;;;N;;;;; 23A6;RIGHT SQUARE BRACKET LOWER CORNER;Sm;0;ON;;;;;N;;;;; 23A7;LEFT CURLY BRACKET UPPER HOOK;Sm;0;ON;;;;;N;;;;; 23A8;LEFT CURLY BRACKET MIDDLE PIECE;Sm;0;ON;;;;;N;;;;; 23A9;LEFT CURLY BRACKET LOWER HOOK;Sm;0;ON;;;;;N;;;;; 23AA;CURLY BRACKET EXTENSION;Sm;0;ON;;;;;N;;;;; 23AB;RIGHT CURLY BRACKET UPPER HOOK;Sm;0;ON;;;;;N;;;;; 23AC;RIGHT CURLY BRACKET MIDDLE PIECE;Sm;0;ON;;;;;N;;;;; 23AD;RIGHT CURLY BRACKET LOWER HOOK;Sm;0;ON;;;;;N;;;;; 23AE;INTEGRAL EXTENSION;Sm;0;ON;;;;;N;;;;; 23AF;HORIZONTAL LINE EXTENSION;Sm;0;ON;;;;;N;;;;; 23B0;UPPER LEFT OR LOWER RIGHT CURLY BRACKET SECTION;Sm;0;ON;;;;;N;;;;; 23B1;UPPER RIGHT OR LOWER LEFT CURLY BRACKET SECTION;Sm;0;ON;;;;;N;;;;; 23B2;SUMMATION TOP;Sm;0;ON;;;;;N;;;;; 23B3;SUMMATION BOTTOM;Sm;0;ON;;;;;N;;;;; 23B4;TOP SQUARE BRACKET;So;0;ON;;;;;N;;;;; 23B5;BOTTOM SQUARE BRACKET;So;0;ON;;;;;N;;;;; 23B6;BOTTOM SQUARE BRACKET OVER TOP SQUARE BRACKET;So;0;ON;;;;;N;;;;; 23B7;RADICAL SYMBOL BOTTOM;So;0;ON;;;;;N;;;;; 23B8;LEFT VERTICAL BOX LINE;So;0;ON;;;;;N;;;;; 23B9;RIGHT VERTICAL BOX LINE;So;0;ON;;;;;N;;;;; 23BA;HORIZONTAL SCAN LINE-1;So;0;ON;;;;;N;;;;; 23BB;HORIZONTAL SCAN LINE-3;So;0;ON;;;;;N;;;;; 23BC;HORIZONTAL SCAN LINE-7;So;0;ON;;;;;N;;;;; 23BD;HORIZONTAL SCAN LINE-9;So;0;ON;;;;;N;;;;; 23BE;DENTISTRY SYMBOL LIGHT VERTICAL AND TOP RIGHT;So;0;ON;;;;;N;;;;; 23BF;DENTISTRY SYMBOL LIGHT VERTICAL AND BOTTOM RIGHT;So;0;ON;;;;;N;;;;; 23C0;DENTISTRY SYMBOL LIGHT VERTICAL WITH CIRCLE;So;0;ON;;;;;N;;;;; 23C1;DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL WITH CIRCLE;So;0;ON;;;;;N;;;;; 23C2;DENTISTRY SYMBOL LIGHT UP AND HORIZONTAL WITH CIRCLE;So;0;ON;;;;;N;;;;; 23C3;DENTISTRY SYMBOL LIGHT VERTICAL WITH TRIANGLE;So;0;ON;;;;;N;;;;; 23C4;DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL WITH TRIANGLE;So;0;ON;;;;;N;;;;; 23C5;DENTISTRY SYMBOL LIGHT UP AND HORIZONTAL WITH TRIANGLE;So;0;ON;;;;;N;;;;; 23C6;DENTISTRY SYMBOL LIGHT VERTICAL AND WAVE;So;0;ON;;;;;N;;;;; 23C7;DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL WITH WAVE;So;0;ON;;;;;N;;;;; 23C8;DENTISTRY SYMBOL LIGHT UP AND HORIZONTAL WITH WAVE;So;0;ON;;;;;N;;;;; 23C9;DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL;So;0;ON;;;;;N;;;;; 23CA;DENTISTRY SYMBOL LIGHT UP AND HORIZONTAL;So;0;ON;;;;;N;;;;; 23CB;DENTISTRY SYMBOL LIGHT VERTICAL AND TOP LEFT;So;0;ON;;;;;N;;;;; 23CC;DENTISTRY SYMBOL LIGHT VERTICAL AND BOTTOM LEFT;So;0;ON;;;;;N;;;;; 23CD;SQUARE FOOT;So;0;ON;;;;;N;;;;; 23CE;RETURN SYMBOL;So;0;ON;;;;;N;;;;; 23CF;EJECT SYMBOL;So;0;ON;;;;;N;;;;; 23D0;VERTICAL LINE EXTENSION;So;0;ON;;;;;N;;;;; 23D1;METRICAL BREVE;So;0;ON;;;;;N;;;;; 23D2;METRICAL LONG OVER SHORT;So;0;ON;;;;;N;;;;; 23D3;METRICAL SHORT OVER LONG;So;0;ON;;;;;N;;;;; 23D4;METRICAL LONG OVER TWO SHORTS;So;0;ON;;;;;N;;;;; 23D5;METRICAL TWO SHORTS OVER LONG;So;0;ON;;;;;N;;;;; 23D6;METRICAL TWO SHORTS JOINED;So;0;ON;;;;;N;;;;; 23D7;METRICAL TRISEME;So;0;ON;;;;;N;;;;; 23D8;METRICAL TETRASEME;So;0;ON;;;;;N;;;;; 23D9;METRICAL PENTASEME;So;0;ON;;;;;N;;;;; 23DA;EARTH GROUND;So;0;ON;;;;;N;;;;; 23DB;FUSE;So;0;ON;;;;;N;;;;; 23DC;TOP PARENTHESIS;Sm;0;ON;;;;;N;;;;; 23DD;BOTTOM PARENTHESIS;Sm;0;ON;;;;;N;;;;; 23DE;TOP CURLY BRACKET;Sm;0;ON;;;;;N;;;;; 23DF;BOTTOM CURLY BRACKET;Sm;0;ON;;;;;N;;;;; 23E0;TOP TORTOISE SHELL BRACKET;Sm;0;ON;;;;;N;;;;; 23E1;BOTTOM TORTOISE SHELL BRACKET;Sm;0;ON;;;;;N;;;;; 23E2;WHITE TRAPEZIUM;So;0;ON;;;;;N;;;;; 23E3;BENZENE RING WITH CIRCLE;So;0;ON;;;;;N;;;;; 23E4;STRAIGHTNESS;So;0;ON;;;;;N;;;;; 23E5;FLATNESS;So;0;ON;;;;;N;;;;; 23E6;AC CURRENT;So;0;ON;;;;;N;;;;; 23E7;ELECTRICAL INTERSECTION;So;0;ON;;;;;N;;;;; 23E8;DECIMAL EXPONENT SYMBOL;So;0;ON;;;;;N;;;;; 23E9;BLACK RIGHT-POINTING DOUBLE TRIANGLE;So;0;ON;;;;;N;;;;; 23EA;BLACK LEFT-POINTING DOUBLE TRIANGLE;So;0;ON;;;;;N;;;;; 23EB;BLACK UP-POINTING DOUBLE TRIANGLE;So;0;ON;;;;;N;;;;; 23EC;BLACK DOWN-POINTING DOUBLE TRIANGLE;So;0;ON;;;;;N;;;;; 23ED;BLACK RIGHT-POINTING DOUBLE TRIANGLE WITH VERTICAL BAR;So;0;ON;;;;;N;;;;; 23EE;BLACK LEFT-POINTING DOUBLE TRIANGLE WITH VERTICAL BAR;So;0;ON;;;;;N;;;;; 23EF;BLACK RIGHT-POINTING TRIANGLE WITH DOUBLE VERTICAL BAR;So;0;ON;;;;;N;;;;; 23F0;ALARM CLOCK;So;0;ON;;;;;N;;;;; 23F1;STOPWATCH;So;0;ON;;;;;N;;;;; 23F2;TIMER CLOCK;So;0;ON;;;;;N;;;;; 23F3;HOURGLASS WITH FLOWING SAND;So;0;ON;;;;;N;;;;; 2400;SYMBOL FOR NULL;So;0;ON;;;;;N;GRAPHIC FOR NULL;;;; 2401;SYMBOL FOR START OF HEADING;So;0;ON;;;;;N;GRAPHIC FOR START OF HEADING;;;; 2402;SYMBOL FOR START OF TEXT;So;0;ON;;;;;N;GRAPHIC FOR START OF TEXT;;;; 2403;SYMBOL FOR END OF TEXT;So;0;ON;;;;;N;GRAPHIC FOR END OF TEXT;;;; 2404;SYMBOL FOR END OF TRANSMISSION;So;0;ON;;;;;N;GRAPHIC FOR END OF TRANSMISSION;;;; 2405;SYMBOL FOR ENQUIRY;So;0;ON;;;;;N;GRAPHIC FOR ENQUIRY;;;; 2406;SYMBOL FOR ACKNOWLEDGE;So;0;ON;;;;;N;GRAPHIC FOR ACKNOWLEDGE;;;; 2407;SYMBOL FOR BELL;So;0;ON;;;;;N;GRAPHIC FOR BELL;;;; 2408;SYMBOL FOR BACKSPACE;So;0;ON;;;;;N;GRAPHIC FOR BACKSPACE;;;; 2409;SYMBOL FOR HORIZONTAL TABULATION;So;0;ON;;;;;N;GRAPHIC FOR HORIZONTAL TABULATION;;;; 240A;SYMBOL FOR LINE FEED;So;0;ON;;;;;N;GRAPHIC FOR LINE FEED;;;; 240B;SYMBOL FOR VERTICAL TABULATION;So;0;ON;;;;;N;GRAPHIC FOR VERTICAL TABULATION;;;; 240C;SYMBOL FOR FORM FEED;So;0;ON;;;;;N;GRAPHIC FOR FORM FEED;;;; 240D;SYMBOL FOR CARRIAGE RETURN;So;0;ON;;;;;N;GRAPHIC FOR CARRIAGE RETURN;;;; 240E;SYMBOL FOR SHIFT OUT;So;0;ON;;;;;N;GRAPHIC FOR SHIFT OUT;;;; 240F;SYMBOL FOR SHIFT IN;So;0;ON;;;;;N;GRAPHIC FOR SHIFT IN;;;; 2410;SYMBOL FOR DATA LINK ESCAPE;So;0;ON;;;;;N;GRAPHIC FOR DATA LINK ESCAPE;;;; 2411;SYMBOL FOR DEVICE CONTROL ONE;So;0;ON;;;;;N;GRAPHIC FOR DEVICE CONTROL ONE;;;; 2412;SYMBOL FOR DEVICE CONTROL TWO;So;0;ON;;;;;N;GRAPHIC FOR DEVICE CONTROL TWO;;;; 2413;SYMBOL FOR DEVICE CONTROL THREE;So;0;ON;;;;;N;GRAPHIC FOR DEVICE CONTROL THREE;;;; 2414;SYMBOL FOR DEVICE CONTROL FOUR;So;0;ON;;;;;N;GRAPHIC FOR DEVICE CONTROL FOUR;;;; 2415;SYMBOL FOR NEGATIVE ACKNOWLEDGE;So;0;ON;;;;;N;GRAPHIC FOR NEGATIVE ACKNOWLEDGE;;;; 2416;SYMBOL FOR SYNCHRONOUS IDLE;So;0;ON;;;;;N;GRAPHIC FOR SYNCHRONOUS IDLE;;;; 2417;SYMBOL FOR END OF TRANSMISSION BLOCK;So;0;ON;;;;;N;GRAPHIC FOR END OF TRANSMISSION BLOCK;;;; 2418;SYMBOL FOR CANCEL;So;0;ON;;;;;N;GRAPHIC FOR CANCEL;;;; 2419;SYMBOL FOR END OF MEDIUM;So;0;ON;;;;;N;GRAPHIC FOR END OF MEDIUM;;;; 241A;SYMBOL FOR SUBSTITUTE;So;0;ON;;;;;N;GRAPHIC FOR SUBSTITUTE;;;; 241B;SYMBOL FOR ESCAPE;So;0;ON;;;;;N;GRAPHIC FOR ESCAPE;;;; 241C;SYMBOL FOR FILE SEPARATOR;So;0;ON;;;;;N;GRAPHIC FOR FILE SEPARATOR;;;; 241D;SYMBOL FOR GROUP SEPARATOR;So;0;ON;;;;;N;GRAPHIC FOR GROUP SEPARATOR;;;; 241E;SYMBOL FOR RECORD SEPARATOR;So;0;ON;;;;;N;GRAPHIC FOR RECORD SEPARATOR;;;; 241F;SYMBOL FOR UNIT SEPARATOR;So;0;ON;;;;;N;GRAPHIC FOR UNIT SEPARATOR;;;; 2420;SYMBOL FOR SPACE;So;0;ON;;;;;N;GRAPHIC FOR SPACE;;;; 2421;SYMBOL FOR DELETE;So;0;ON;;;;;N;GRAPHIC FOR DELETE;;;; 2422;BLANK SYMBOL;So;0;ON;;;;;N;BLANK;;;; 2423;OPEN BOX;So;0;ON;;;;;N;;;;; 2424;SYMBOL FOR NEWLINE;So;0;ON;;;;;N;GRAPHIC FOR NEWLINE;;;; 2425;SYMBOL FOR DELETE FORM TWO;So;0;ON;;;;;N;;;;; 2426;SYMBOL FOR SUBSTITUTE FORM TWO;So;0;ON;;;;;N;;;;; 2440;OCR HOOK;So;0;ON;;;;;N;;;;; 2441;OCR CHAIR;So;0;ON;;;;;N;;;;; 2442;OCR FORK;So;0;ON;;;;;N;;;;; 2443;OCR INVERTED FORK;So;0;ON;;;;;N;;;;; 2444;OCR BELT BUCKLE;So;0;ON;;;;;N;;;;; 2445;OCR BOW TIE;So;0;ON;;;;;N;;;;; 2446;OCR BRANCH BANK IDENTIFICATION;So;0;ON;;;;;N;;;;; 2447;OCR AMOUNT OF CHECK;So;0;ON;;;;;N;;;;; 2448;OCR DASH;So;0;ON;;;;;N;;;;; 2449;OCR CUSTOMER ACCOUNT NUMBER;So;0;ON;;;;;N;;;;; 244A;OCR DOUBLE BACKSLASH;So;0;ON;;;;;N;;;;; 2460;CIRCLED DIGIT ONE;No;0;ON; 0031;;1;1;N;;;;; 2461;CIRCLED DIGIT TWO;No;0;ON; 0032;;2;2;N;;;;; 2462;CIRCLED DIGIT THREE;No;0;ON; 0033;;3;3;N;;;;; 2463;CIRCLED DIGIT FOUR;No;0;ON; 0034;;4;4;N;;;;; 2464;CIRCLED DIGIT FIVE;No;0;ON; 0035;;5;5;N;;;;; 2465;CIRCLED DIGIT SIX;No;0;ON; 0036;;6;6;N;;;;; 2466;CIRCLED DIGIT SEVEN;No;0;ON; 0037;;7;7;N;;;;; 2467;CIRCLED DIGIT EIGHT;No;0;ON; 0038;;8;8;N;;;;; 2468;CIRCLED DIGIT NINE;No;0;ON; 0039;;9;9;N;;;;; 2469;CIRCLED NUMBER TEN;No;0;ON; 0031 0030;;;10;N;;;;; 246A;CIRCLED NUMBER ELEVEN;No;0;ON; 0031 0031;;;11;N;;;;; 246B;CIRCLED NUMBER TWELVE;No;0;ON; 0031 0032;;;12;N;;;;; 246C;CIRCLED NUMBER THIRTEEN;No;0;ON; 0031 0033;;;13;N;;;;; 246D;CIRCLED NUMBER FOURTEEN;No;0;ON; 0031 0034;;;14;N;;;;; 246E;CIRCLED NUMBER FIFTEEN;No;0;ON; 0031 0035;;;15;N;;;;; 246F;CIRCLED NUMBER SIXTEEN;No;0;ON; 0031 0036;;;16;N;;;;; 2470;CIRCLED NUMBER SEVENTEEN;No;0;ON; 0031 0037;;;17;N;;;;; 2471;CIRCLED NUMBER EIGHTEEN;No;0;ON; 0031 0038;;;18;N;;;;; 2472;CIRCLED NUMBER NINETEEN;No;0;ON; 0031 0039;;;19;N;;;;; 2473;CIRCLED NUMBER TWENTY;No;0;ON; 0032 0030;;;20;N;;;;; 2474;PARENTHESIZED DIGIT ONE;No;0;ON; 0028 0031 0029;;1;1;N;;;;; 2475;PARENTHESIZED DIGIT TWO;No;0;ON; 0028 0032 0029;;2;2;N;;;;; 2476;PARENTHESIZED DIGIT THREE;No;0;ON; 0028 0033 0029;;3;3;N;;;;; 2477;PARENTHESIZED DIGIT FOUR;No;0;ON; 0028 0034 0029;;4;4;N;;;;; 2478;PARENTHESIZED DIGIT FIVE;No;0;ON; 0028 0035 0029;;5;5;N;;;;; 2479;PARENTHESIZED DIGIT SIX;No;0;ON; 0028 0036 0029;;6;6;N;;;;; 247A;PARENTHESIZED DIGIT SEVEN;No;0;ON; 0028 0037 0029;;7;7;N;;;;; 247B;PARENTHESIZED DIGIT EIGHT;No;0;ON; 0028 0038 0029;;8;8;N;;;;; 247C;PARENTHESIZED DIGIT NINE;No;0;ON; 0028 0039 0029;;9;9;N;;;;; 247D;PARENTHESIZED NUMBER TEN;No;0;ON; 0028 0031 0030 0029;;;10;N;;;;; 247E;PARENTHESIZED NUMBER ELEVEN;No;0;ON; 0028 0031 0031 0029;;;11;N;;;;; 247F;PARENTHESIZED NUMBER TWELVE;No;0;ON; 0028 0031 0032 0029;;;12;N;;;;; 2480;PARENTHESIZED NUMBER THIRTEEN;No;0;ON; 0028 0031 0033 0029;;;13;N;;;;; 2481;PARENTHESIZED NUMBER FOURTEEN;No;0;ON; 0028 0031 0034 0029;;;14;N;;;;; 2482;PARENTHESIZED NUMBER FIFTEEN;No;0;ON; 0028 0031 0035 0029;;;15;N;;;;; 2483;PARENTHESIZED NUMBER SIXTEEN;No;0;ON; 0028 0031 0036 0029;;;16;N;;;;; 2484;PARENTHESIZED NUMBER SEVENTEEN;No;0;ON; 0028 0031 0037 0029;;;17;N;;;;; 2485;PARENTHESIZED NUMBER EIGHTEEN;No;0;ON; 0028 0031 0038 0029;;;18;N;;;;; 2486;PARENTHESIZED NUMBER NINETEEN;No;0;ON; 0028 0031 0039 0029;;;19;N;;;;; 2487;PARENTHESIZED NUMBER TWENTY;No;0;ON; 0028 0032 0030 0029;;;20;N;;;;; 2488;DIGIT ONE FULL STOP;No;0;EN; 0031 002E;;1;1;N;DIGIT ONE PERIOD;;;; 2489;DIGIT TWO FULL STOP;No;0;EN; 0032 002E;;2;2;N;DIGIT TWO PERIOD;;;; 248A;DIGIT THREE FULL STOP;No;0;EN; 0033 002E;;3;3;N;DIGIT THREE PERIOD;;;; 248B;DIGIT FOUR FULL STOP;No;0;EN; 0034 002E;;4;4;N;DIGIT FOUR PERIOD;;;; 248C;DIGIT FIVE FULL STOP;No;0;EN; 0035 002E;;5;5;N;DIGIT FIVE PERIOD;;;; 248D;DIGIT SIX FULL STOP;No;0;EN; 0036 002E;;6;6;N;DIGIT SIX PERIOD;;;; 248E;DIGIT SEVEN FULL STOP;No;0;EN; 0037 002E;;7;7;N;DIGIT SEVEN PERIOD;;;; 248F;DIGIT EIGHT FULL STOP;No;0;EN; 0038 002E;;8;8;N;DIGIT EIGHT PERIOD;;;; 2490;DIGIT NINE FULL STOP;No;0;EN; 0039 002E;;9;9;N;DIGIT NINE PERIOD;;;; 2491;NUMBER TEN FULL STOP;No;0;EN; 0031 0030 002E;;;10;N;NUMBER TEN PERIOD;;;; 2492;NUMBER ELEVEN FULL STOP;No;0;EN; 0031 0031 002E;;;11;N;NUMBER ELEVEN PERIOD;;;; 2493;NUMBER TWELVE FULL STOP;No;0;EN; 0031 0032 002E;;;12;N;NUMBER TWELVE PERIOD;;;; 2494;NUMBER THIRTEEN FULL STOP;No;0;EN; 0031 0033 002E;;;13;N;NUMBER THIRTEEN PERIOD;;;; 2495;NUMBER FOURTEEN FULL STOP;No;0;EN; 0031 0034 002E;;;14;N;NUMBER FOURTEEN PERIOD;;;; 2496;NUMBER FIFTEEN FULL STOP;No;0;EN; 0031 0035 002E;;;15;N;NUMBER FIFTEEN PERIOD;;;; 2497;NUMBER SIXTEEN FULL STOP;No;0;EN; 0031 0036 002E;;;16;N;NUMBER SIXTEEN PERIOD;;;; 2498;NUMBER SEVENTEEN FULL STOP;No;0;EN; 0031 0037 002E;;;17;N;NUMBER SEVENTEEN PERIOD;;;; 2499;NUMBER EIGHTEEN FULL STOP;No;0;EN; 0031 0038 002E;;;18;N;NUMBER EIGHTEEN PERIOD;;;; 249A;NUMBER NINETEEN FULL STOP;No;0;EN; 0031 0039 002E;;;19;N;NUMBER NINETEEN PERIOD;;;; 249B;NUMBER TWENTY FULL STOP;No;0;EN; 0032 0030 002E;;;20;N;NUMBER TWENTY PERIOD;;;; 249C;PARENTHESIZED LATIN SMALL LETTER A;So;0;L; 0028 0061 0029;;;;N;;;;; 249D;PARENTHESIZED LATIN SMALL LETTER B;So;0;L; 0028 0062 0029;;;;N;;;;; 249E;PARENTHESIZED LATIN SMALL LETTER C;So;0;L; 0028 0063 0029;;;;N;;;;; 249F;PARENTHESIZED LATIN SMALL LETTER D;So;0;L; 0028 0064 0029;;;;N;;;;; 24A0;PARENTHESIZED LATIN SMALL LETTER E;So;0;L; 0028 0065 0029;;;;N;;;;; 24A1;PARENTHESIZED LATIN SMALL LETTER F;So;0;L; 0028 0066 0029;;;;N;;;;; 24A2;PARENTHESIZED LATIN SMALL LETTER G;So;0;L; 0028 0067 0029;;;;N;;;;; 24A3;PARENTHESIZED LATIN SMALL LETTER H;So;0;L; 0028 0068 0029;;;;N;;;;; 24A4;PARENTHESIZED LATIN SMALL LETTER I;So;0;L; 0028 0069 0029;;;;N;;;;; 24A5;PARENTHESIZED LATIN SMALL LETTER J;So;0;L; 0028 006A 0029;;;;N;;;;; 24A6;PARENTHESIZED LATIN SMALL LETTER K;So;0;L; 0028 006B 0029;;;;N;;;;; 24A7;PARENTHESIZED LATIN SMALL LETTER L;So;0;L; 0028 006C 0029;;;;N;;;;; 24A8;PARENTHESIZED LATIN SMALL LETTER M;So;0;L; 0028 006D 0029;;;;N;;;;; 24A9;PARENTHESIZED LATIN SMALL LETTER N;So;0;L; 0028 006E 0029;;;;N;;;;; 24AA;PARENTHESIZED LATIN SMALL LETTER O;So;0;L; 0028 006F 0029;;;;N;;;;; 24AB;PARENTHESIZED LATIN SMALL LETTER P;So;0;L; 0028 0070 0029;;;;N;;;;; 24AC;PARENTHESIZED LATIN SMALL LETTER Q;So;0;L; 0028 0071 0029;;;;N;;;;; 24AD;PARENTHESIZED LATIN SMALL LETTER R;So;0;L; 0028 0072 0029;;;;N;;;;; 24AE;PARENTHESIZED LATIN SMALL LETTER S;So;0;L; 0028 0073 0029;;;;N;;;;; 24AF;PARENTHESIZED LATIN SMALL LETTER T;So;0;L; 0028 0074 0029;;;;N;;;;; 24B0;PARENTHESIZED LATIN SMALL LETTER U;So;0;L; 0028 0075 0029;;;;N;;;;; 24B1;PARENTHESIZED LATIN SMALL LETTER V;So;0;L; 0028 0076 0029;;;;N;;;;; 24B2;PARENTHESIZED LATIN SMALL LETTER W;So;0;L; 0028 0077 0029;;;;N;;;;; 24B3;PARENTHESIZED LATIN SMALL LETTER X;So;0;L; 0028 0078 0029;;;;N;;;;; 24B4;PARENTHESIZED LATIN SMALL LETTER Y;So;0;L; 0028 0079 0029;;;;N;;;;; 24B5;PARENTHESIZED LATIN SMALL LETTER Z;So;0;L; 0028 007A 0029;;;;N;;;;; 24B6;CIRCLED LATIN CAPITAL LETTER A;So;0;L; 0041;;;;N;;;;24D0; 24B7;CIRCLED LATIN CAPITAL LETTER B;So;0;L; 0042;;;;N;;;;24D1; 24B8;CIRCLED LATIN CAPITAL LETTER C;So;0;L; 0043;;;;N;;;;24D2; 24B9;CIRCLED LATIN CAPITAL LETTER D;So;0;L; 0044;;;;N;;;;24D3; 24BA;CIRCLED LATIN CAPITAL LETTER E;So;0;L; 0045;;;;N;;;;24D4; 24BB;CIRCLED LATIN CAPITAL LETTER F;So;0;L; 0046;;;;N;;;;24D5; 24BC;CIRCLED LATIN CAPITAL LETTER G;So;0;L; 0047;;;;N;;;;24D6; 24BD;CIRCLED LATIN CAPITAL LETTER H;So;0;L; 0048;;;;N;;;;24D7; 24BE;CIRCLED LATIN CAPITAL LETTER I;So;0;L; 0049;;;;N;;;;24D8; 24BF;CIRCLED LATIN CAPITAL LETTER J;So;0;L; 004A;;;;N;;;;24D9; 24C0;CIRCLED LATIN CAPITAL LETTER K;So;0;L; 004B;;;;N;;;;24DA; 24C1;CIRCLED LATIN CAPITAL LETTER L;So;0;L; 004C;;;;N;;;;24DB; 24C2;CIRCLED LATIN CAPITAL LETTER M;So;0;L; 004D;;;;N;;;;24DC; 24C3;CIRCLED LATIN CAPITAL LETTER N;So;0;L; 004E;;;;N;;;;24DD; 24C4;CIRCLED LATIN CAPITAL LETTER O;So;0;L; 004F;;;;N;;;;24DE; 24C5;CIRCLED LATIN CAPITAL LETTER P;So;0;L; 0050;;;;N;;;;24DF; 24C6;CIRCLED LATIN CAPITAL LETTER Q;So;0;L; 0051;;;;N;;;;24E0; 24C7;CIRCLED LATIN CAPITAL LETTER R;So;0;L; 0052;;;;N;;;;24E1; 24C8;CIRCLED LATIN CAPITAL LETTER S;So;0;L; 0053;;;;N;;;;24E2; 24C9;CIRCLED LATIN CAPITAL LETTER T;So;0;L; 0054;;;;N;;;;24E3; 24CA;CIRCLED LATIN CAPITAL LETTER U;So;0;L; 0055;;;;N;;;;24E4; 24CB;CIRCLED LATIN CAPITAL LETTER V;So;0;L; 0056;;;;N;;;;24E5; 24CC;CIRCLED LATIN CAPITAL LETTER W;So;0;L; 0057;;;;N;;;;24E6; 24CD;CIRCLED LATIN CAPITAL LETTER X;So;0;L; 0058;;;;N;;;;24E7; 24CE;CIRCLED LATIN CAPITAL LETTER Y;So;0;L; 0059;;;;N;;;;24E8; 24CF;CIRCLED LATIN CAPITAL LETTER Z;So;0;L; 005A;;;;N;;;;24E9; 24D0;CIRCLED LATIN SMALL LETTER A;So;0;L; 0061;;;;N;;;24B6;;24B6 24D1;CIRCLED LATIN SMALL LETTER B;So;0;L; 0062;;;;N;;;24B7;;24B7 24D2;CIRCLED LATIN SMALL LETTER C;So;0;L; 0063;;;;N;;;24B8;;24B8 24D3;CIRCLED LATIN SMALL LETTER D;So;0;L; 0064;;;;N;;;24B9;;24B9 24D4;CIRCLED LATIN SMALL LETTER E;So;0;L; 0065;;;;N;;;24BA;;24BA 24D5;CIRCLED LATIN SMALL LETTER F;So;0;L; 0066;;;;N;;;24BB;;24BB 24D6;CIRCLED LATIN SMALL LETTER G;So;0;L; 0067;;;;N;;;24BC;;24BC 24D7;CIRCLED LATIN SMALL LETTER H;So;0;L; 0068;;;;N;;;24BD;;24BD 24D8;CIRCLED LATIN SMALL LETTER I;So;0;L; 0069;;;;N;;;24BE;;24BE 24D9;CIRCLED LATIN SMALL LETTER J;So;0;L; 006A;;;;N;;;24BF;;24BF 24DA;CIRCLED LATIN SMALL LETTER K;So;0;L; 006B;;;;N;;;24C0;;24C0 24DB;CIRCLED LATIN SMALL LETTER L;So;0;L; 006C;;;;N;;;24C1;;24C1 24DC;CIRCLED LATIN SMALL LETTER M;So;0;L; 006D;;;;N;;;24C2;;24C2 24DD;CIRCLED LATIN SMALL LETTER N;So;0;L; 006E;;;;N;;;24C3;;24C3 24DE;CIRCLED LATIN SMALL LETTER O;So;0;L; 006F;;;;N;;;24C4;;24C4 24DF;CIRCLED LATIN SMALL LETTER P;So;0;L; 0070;;;;N;;;24C5;;24C5 24E0;CIRCLED LATIN SMALL LETTER Q;So;0;L; 0071;;;;N;;;24C6;;24C6 24E1;CIRCLED LATIN SMALL LETTER R;So;0;L; 0072;;;;N;;;24C7;;24C7 24E2;CIRCLED LATIN SMALL LETTER S;So;0;L; 0073;;;;N;;;24C8;;24C8 24E3;CIRCLED LATIN SMALL LETTER T;So;0;L; 0074;;;;N;;;24C9;;24C9 24E4;CIRCLED LATIN SMALL LETTER U;So;0;L; 0075;;;;N;;;24CA;;24CA 24E5;CIRCLED LATIN SMALL LETTER V;So;0;L; 0076;;;;N;;;24CB;;24CB 24E6;CIRCLED LATIN SMALL LETTER W;So;0;L; 0077;;;;N;;;24CC;;24CC 24E7;CIRCLED LATIN SMALL LETTER X;So;0;L; 0078;;;;N;;;24CD;;24CD 24E8;CIRCLED LATIN SMALL LETTER Y;So;0;L; 0079;;;;N;;;24CE;;24CE 24E9;CIRCLED LATIN SMALL LETTER Z;So;0;L; 007A;;;;N;;;24CF;;24CF 24EA;CIRCLED DIGIT ZERO;No;0;ON; 0030;;0;0;N;;;;; 24EB;NEGATIVE CIRCLED NUMBER ELEVEN;No;0;ON;;;;11;N;;;;; 24EC;NEGATIVE CIRCLED NUMBER TWELVE;No;0;ON;;;;12;N;;;;; 24ED;NEGATIVE CIRCLED NUMBER THIRTEEN;No;0;ON;;;;13;N;;;;; 24EE;NEGATIVE CIRCLED NUMBER FOURTEEN;No;0;ON;;;;14;N;;;;; 24EF;NEGATIVE CIRCLED NUMBER FIFTEEN;No;0;ON;;;;15;N;;;;; 24F0;NEGATIVE CIRCLED NUMBER SIXTEEN;No;0;ON;;;;16;N;;;;; 24F1;NEGATIVE CIRCLED NUMBER SEVENTEEN;No;0;ON;;;;17;N;;;;; 24F2;NEGATIVE CIRCLED NUMBER EIGHTEEN;No;0;ON;;;;18;N;;;;; 24F3;NEGATIVE CIRCLED NUMBER NINETEEN;No;0;ON;;;;19;N;;;;; 24F4;NEGATIVE CIRCLED NUMBER TWENTY;No;0;ON;;;;20;N;;;;; 24F5;DOUBLE CIRCLED DIGIT ONE;No;0;ON;;;1;1;N;;;;; 24F6;DOUBLE CIRCLED DIGIT TWO;No;0;ON;;;2;2;N;;;;; 24F7;DOUBLE CIRCLED DIGIT THREE;No;0;ON;;;3;3;N;;;;; 24F8;DOUBLE CIRCLED DIGIT FOUR;No;0;ON;;;4;4;N;;;;; 24F9;DOUBLE CIRCLED DIGIT FIVE;No;0;ON;;;5;5;N;;;;; 24FA;DOUBLE CIRCLED DIGIT SIX;No;0;ON;;;6;6;N;;;;; 24FB;DOUBLE CIRCLED DIGIT SEVEN;No;0;ON;;;7;7;N;;;;; 24FC;DOUBLE CIRCLED DIGIT EIGHT;No;0;ON;;;8;8;N;;;;; 24FD;DOUBLE CIRCLED DIGIT NINE;No;0;ON;;;9;9;N;;;;; 24FE;DOUBLE CIRCLED NUMBER TEN;No;0;ON;;;;10;N;;;;; 24FF;NEGATIVE CIRCLED DIGIT ZERO;No;0;ON;;;0;0;N;;;;; 2500;BOX DRAWINGS LIGHT HORIZONTAL;So;0;ON;;;;;N;FORMS LIGHT HORIZONTAL;;;; 2501;BOX DRAWINGS HEAVY HORIZONTAL;So;0;ON;;;;;N;FORMS HEAVY HORIZONTAL;;;; 2502;BOX DRAWINGS LIGHT VERTICAL;So;0;ON;;;;;N;FORMS LIGHT VERTICAL;;;; 2503;BOX DRAWINGS HEAVY VERTICAL;So;0;ON;;;;;N;FORMS HEAVY VERTICAL;;;; 2504;BOX DRAWINGS LIGHT TRIPLE DASH HORIZONTAL;So;0;ON;;;;;N;FORMS LIGHT TRIPLE DASH HORIZONTAL;;;; 2505;BOX DRAWINGS HEAVY TRIPLE DASH HORIZONTAL;So;0;ON;;;;;N;FORMS HEAVY TRIPLE DASH HORIZONTAL;;;; 2506;BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL;So;0;ON;;;;;N;FORMS LIGHT TRIPLE DASH VERTICAL;;;; 2507;BOX DRAWINGS HEAVY TRIPLE DASH VERTICAL;So;0;ON;;;;;N;FORMS HEAVY TRIPLE DASH VERTICAL;;;; 2508;BOX DRAWINGS LIGHT QUADRUPLE DASH HORIZONTAL;So;0;ON;;;;;N;FORMS LIGHT QUADRUPLE DASH HORIZONTAL;;;; 2509;BOX DRAWINGS HEAVY QUADRUPLE DASH HORIZONTAL;So;0;ON;;;;;N;FORMS HEAVY QUADRUPLE DASH HORIZONTAL;;;; 250A;BOX DRAWINGS LIGHT QUADRUPLE DASH VERTICAL;So;0;ON;;;;;N;FORMS LIGHT QUADRUPLE DASH VERTICAL;;;; 250B;BOX DRAWINGS HEAVY QUADRUPLE DASH VERTICAL;So;0;ON;;;;;N;FORMS HEAVY QUADRUPLE DASH VERTICAL;;;; 250C;BOX DRAWINGS LIGHT DOWN AND RIGHT;So;0;ON;;;;;N;FORMS LIGHT DOWN AND RIGHT;;;; 250D;BOX DRAWINGS DOWN LIGHT AND RIGHT HEAVY;So;0;ON;;;;;N;FORMS DOWN LIGHT AND RIGHT HEAVY;;;; 250E;BOX DRAWINGS DOWN HEAVY AND RIGHT LIGHT;So;0;ON;;;;;N;FORMS DOWN HEAVY AND RIGHT LIGHT;;;; 250F;BOX DRAWINGS HEAVY DOWN AND RIGHT;So;0;ON;;;;;N;FORMS HEAVY DOWN AND RIGHT;;;; 2510;BOX DRAWINGS LIGHT DOWN AND LEFT;So;0;ON;;;;;N;FORMS LIGHT DOWN AND LEFT;;;; 2511;BOX DRAWINGS DOWN LIGHT AND LEFT HEAVY;So;0;ON;;;;;N;FORMS DOWN LIGHT AND LEFT HEAVY;;;; 2512;BOX DRAWINGS DOWN HEAVY AND LEFT LIGHT;So;0;ON;;;;;N;FORMS DOWN HEAVY AND LEFT LIGHT;;;; 2513;BOX DRAWINGS HEAVY DOWN AND LEFT;So;0;ON;;;;;N;FORMS HEAVY DOWN AND LEFT;;;; 2514;BOX DRAWINGS LIGHT UP AND RIGHT;So;0;ON;;;;;N;FORMS LIGHT UP AND RIGHT;;;; 2515;BOX DRAWINGS UP LIGHT AND RIGHT HEAVY;So;0;ON;;;;;N;FORMS UP LIGHT AND RIGHT HEAVY;;;; 2516;BOX DRAWINGS UP HEAVY AND RIGHT LIGHT;So;0;ON;;;;;N;FORMS UP HEAVY AND RIGHT LIGHT;;;; 2517;BOX DRAWINGS HEAVY UP AND RIGHT;So;0;ON;;;;;N;FORMS HEAVY UP AND RIGHT;;;; 2518;BOX DRAWINGS LIGHT UP AND LEFT;So;0;ON;;;;;N;FORMS LIGHT UP AND LEFT;;;; 2519;BOX DRAWINGS UP LIGHT AND LEFT HEAVY;So;0;ON;;;;;N;FORMS UP LIGHT AND LEFT HEAVY;;;; 251A;BOX DRAWINGS UP HEAVY AND LEFT LIGHT;So;0;ON;;;;;N;FORMS UP HEAVY AND LEFT LIGHT;;;; 251B;BOX DRAWINGS HEAVY UP AND LEFT;So;0;ON;;;;;N;FORMS HEAVY UP AND LEFT;;;; 251C;BOX DRAWINGS LIGHT VERTICAL AND RIGHT;So;0;ON;;;;;N;FORMS LIGHT VERTICAL AND RIGHT;;;; 251D;BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY;So;0;ON;;;;;N;FORMS VERTICAL LIGHT AND RIGHT HEAVY;;;; 251E;BOX DRAWINGS UP HEAVY AND RIGHT DOWN LIGHT;So;0;ON;;;;;N;FORMS UP HEAVY AND RIGHT DOWN LIGHT;;;; 251F;BOX DRAWINGS DOWN HEAVY AND RIGHT UP LIGHT;So;0;ON;;;;;N;FORMS DOWN HEAVY AND RIGHT UP LIGHT;;;; 2520;BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT;So;0;ON;;;;;N;FORMS VERTICAL HEAVY AND RIGHT LIGHT;;;; 2521;BOX DRAWINGS DOWN LIGHT AND RIGHT UP HEAVY;So;0;ON;;;;;N;FORMS DOWN LIGHT AND RIGHT UP HEAVY;;;; 2522;BOX DRAWINGS UP LIGHT AND RIGHT DOWN HEAVY;So;0;ON;;;;;N;FORMS UP LIGHT AND RIGHT DOWN HEAVY;;;; 2523;BOX DRAWINGS HEAVY VERTICAL AND RIGHT;So;0;ON;;;;;N;FORMS HEAVY VERTICAL AND RIGHT;;;; 2524;BOX DRAWINGS LIGHT VERTICAL AND LEFT;So;0;ON;;;;;N;FORMS LIGHT VERTICAL AND LEFT;;;; 2525;BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY;So;0;ON;;;;;N;FORMS VERTICAL LIGHT AND LEFT HEAVY;;;; 2526;BOX DRAWINGS UP HEAVY AND LEFT DOWN LIGHT;So;0;ON;;;;;N;FORMS UP HEAVY AND LEFT DOWN LIGHT;;;; 2527;BOX DRAWINGS DOWN HEAVY AND LEFT UP LIGHT;So;0;ON;;;;;N;FORMS DOWN HEAVY AND LEFT UP LIGHT;;;; 2528;BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT;So;0;ON;;;;;N;FORMS VERTICAL HEAVY AND LEFT LIGHT;;;; 2529;BOX DRAWINGS DOWN LIGHT AND LEFT UP HEAVY;So;0;ON;;;;;N;FORMS DOWN LIGHT AND LEFT UP HEAVY;;;; 252A;BOX DRAWINGS UP LIGHT AND LEFT DOWN HEAVY;So;0;ON;;;;;N;FORMS UP LIGHT AND LEFT DOWN HEAVY;;;; 252B;BOX DRAWINGS HEAVY VERTICAL AND LEFT;So;0;ON;;;;;N;FORMS HEAVY VERTICAL AND LEFT;;;; 252C;BOX DRAWINGS LIGHT DOWN AND HORIZONTAL;So;0;ON;;;;;N;FORMS LIGHT DOWN AND HORIZONTAL;;;; 252D;BOX DRAWINGS LEFT HEAVY AND RIGHT DOWN LIGHT;So;0;ON;;;;;N;FORMS LEFT HEAVY AND RIGHT DOWN LIGHT;;;; 252E;BOX DRAWINGS RIGHT HEAVY AND LEFT DOWN LIGHT;So;0;ON;;;;;N;FORMS RIGHT HEAVY AND LEFT DOWN LIGHT;;;; 252F;BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY;So;0;ON;;;;;N;FORMS DOWN LIGHT AND HORIZONTAL HEAVY;;;; 2530;BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT;So;0;ON;;;;;N;FORMS DOWN HEAVY AND HORIZONTAL LIGHT;;;; 2531;BOX DRAWINGS RIGHT LIGHT AND LEFT DOWN HEAVY;So;0;ON;;;;;N;FORMS RIGHT LIGHT AND LEFT DOWN HEAVY;;;; 2532;BOX DRAWINGS LEFT LIGHT AND RIGHT DOWN HEAVY;So;0;ON;;;;;N;FORMS LEFT LIGHT AND RIGHT DOWN HEAVY;;;; 2533;BOX DRAWINGS HEAVY DOWN AND HORIZONTAL;So;0;ON;;;;;N;FORMS HEAVY DOWN AND HORIZONTAL;;;; 2534;BOX DRAWINGS LIGHT UP AND HORIZONTAL;So;0;ON;;;;;N;FORMS LIGHT UP AND HORIZONTAL;;;; 2535;BOX DRAWINGS LEFT HEAVY AND RIGHT UP LIGHT;So;0;ON;;;;;N;FORMS LEFT HEAVY AND RIGHT UP LIGHT;;;; 2536;BOX DRAWINGS RIGHT HEAVY AND LEFT UP LIGHT;So;0;ON;;;;;N;FORMS RIGHT HEAVY AND LEFT UP LIGHT;;;; 2537;BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY;So;0;ON;;;;;N;FORMS UP LIGHT AND HORIZONTAL HEAVY;;;; 2538;BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT;So;0;ON;;;;;N;FORMS UP HEAVY AND HORIZONTAL LIGHT;;;; 2539;BOX DRAWINGS RIGHT LIGHT AND LEFT UP HEAVY;So;0;ON;;;;;N;FORMS RIGHT LIGHT AND LEFT UP HEAVY;;;; 253A;BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY;So;0;ON;;;;;N;FORMS LEFT LIGHT AND RIGHT UP HEAVY;;;; 253B;BOX DRAWINGS HEAVY UP AND HORIZONTAL;So;0;ON;;;;;N;FORMS HEAVY UP AND HORIZONTAL;;;; 253C;BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL;So;0;ON;;;;;N;FORMS LIGHT VERTICAL AND HORIZONTAL;;;; 253D;BOX DRAWINGS LEFT HEAVY AND RIGHT VERTICAL LIGHT;So;0;ON;;;;;N;FORMS LEFT HEAVY AND RIGHT VERTICAL LIGHT;;;; 253E;BOX DRAWINGS RIGHT HEAVY AND LEFT VERTICAL LIGHT;So;0;ON;;;;;N;FORMS RIGHT HEAVY AND LEFT VERTICAL LIGHT;;;; 253F;BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY;So;0;ON;;;;;N;FORMS VERTICAL LIGHT AND HORIZONTAL HEAVY;;;; 2540;BOX DRAWINGS UP HEAVY AND DOWN HORIZONTAL LIGHT;So;0;ON;;;;;N;FORMS UP HEAVY AND DOWN HORIZONTAL LIGHT;;;; 2541;BOX DRAWINGS DOWN HEAVY AND UP HORIZONTAL LIGHT;So;0;ON;;;;;N;FORMS DOWN HEAVY AND UP HORIZONTAL LIGHT;;;; 2542;BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT;So;0;ON;;;;;N;FORMS VERTICAL HEAVY AND HORIZONTAL LIGHT;;;; 2543;BOX DRAWINGS LEFT UP HEAVY AND RIGHT DOWN LIGHT;So;0;ON;;;;;N;FORMS LEFT UP HEAVY AND RIGHT DOWN LIGHT;;;; 2544;BOX DRAWINGS RIGHT UP HEAVY AND LEFT DOWN LIGHT;So;0;ON;;;;;N;FORMS RIGHT UP HEAVY AND LEFT DOWN LIGHT;;;; 2545;BOX DRAWINGS LEFT DOWN HEAVY AND RIGHT UP LIGHT;So;0;ON;;;;;N;FORMS LEFT DOWN HEAVY AND RIGHT UP LIGHT;;;; 2546;BOX DRAWINGS RIGHT DOWN HEAVY AND LEFT UP LIGHT;So;0;ON;;;;;N;FORMS RIGHT DOWN HEAVY AND LEFT UP LIGHT;;;; 2547;BOX DRAWINGS DOWN LIGHT AND UP HORIZONTAL HEAVY;So;0;ON;;;;;N;FORMS DOWN LIGHT AND UP HORIZONTAL HEAVY;;;; 2548;BOX DRAWINGS UP LIGHT AND DOWN HORIZONTAL HEAVY;So;0;ON;;;;;N;FORMS UP LIGHT AND DOWN HORIZONTAL HEAVY;;;; 2549;BOX DRAWINGS RIGHT LIGHT AND LEFT VERTICAL HEAVY;So;0;ON;;;;;N;FORMS RIGHT LIGHT AND LEFT VERTICAL HEAVY;;;; 254A;BOX DRAWINGS LEFT LIGHT AND RIGHT VERTICAL HEAVY;So;0;ON;;;;;N;FORMS LEFT LIGHT AND RIGHT VERTICAL HEAVY;;;; 254B;BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL;So;0;ON;;;;;N;FORMS HEAVY VERTICAL AND HORIZONTAL;;;; 254C;BOX DRAWINGS LIGHT DOUBLE DASH HORIZONTAL;So;0;ON;;;;;N;FORMS LIGHT DOUBLE DASH HORIZONTAL;;;; 254D;BOX DRAWINGS HEAVY DOUBLE DASH HORIZONTAL;So;0;ON;;;;;N;FORMS HEAVY DOUBLE DASH HORIZONTAL;;;; 254E;BOX DRAWINGS LIGHT DOUBLE DASH VERTICAL;So;0;ON;;;;;N;FORMS LIGHT DOUBLE DASH VERTICAL;;;; 254F;BOX DRAWINGS HEAVY DOUBLE DASH VERTICAL;So;0;ON;;;;;N;FORMS HEAVY DOUBLE DASH VERTICAL;;;; 2550;BOX DRAWINGS DOUBLE HORIZONTAL;So;0;ON;;;;;N;FORMS DOUBLE HORIZONTAL;;;; 2551;BOX DRAWINGS DOUBLE VERTICAL;So;0;ON;;;;;N;FORMS DOUBLE VERTICAL;;;; 2552;BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE;So;0;ON;;;;;N;FORMS DOWN SINGLE AND RIGHT DOUBLE;;;; 2553;BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE;So;0;ON;;;;;N;FORMS DOWN DOUBLE AND RIGHT SINGLE;;;; 2554;BOX DRAWINGS DOUBLE DOWN AND RIGHT;So;0;ON;;;;;N;FORMS DOUBLE DOWN AND RIGHT;;;; 2555;BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE;So;0;ON;;;;;N;FORMS DOWN SINGLE AND LEFT DOUBLE;;;; 2556;BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE;So;0;ON;;;;;N;FORMS DOWN DOUBLE AND LEFT SINGLE;;;; 2557;BOX DRAWINGS DOUBLE DOWN AND LEFT;So;0;ON;;;;;N;FORMS DOUBLE DOWN AND LEFT;;;; 2558;BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE;So;0;ON;;;;;N;FORMS UP SINGLE AND RIGHT DOUBLE;;;; 2559;BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE;So;0;ON;;;;;N;FORMS UP DOUBLE AND RIGHT SINGLE;;;; 255A;BOX DRAWINGS DOUBLE UP AND RIGHT;So;0;ON;;;;;N;FORMS DOUBLE UP AND RIGHT;;;; 255B;BOX DRAWINGS UP SINGLE AND LEFT DOUBLE;So;0;ON;;;;;N;FORMS UP SINGLE AND LEFT DOUBLE;;;; 255C;BOX DRAWINGS UP DOUBLE AND LEFT SINGLE;So;0;ON;;;;;N;FORMS UP DOUBLE AND LEFT SINGLE;;;; 255D;BOX DRAWINGS DOUBLE UP AND LEFT;So;0;ON;;;;;N;FORMS DOUBLE UP AND LEFT;;;; 255E;BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE;So;0;ON;;;;;N;FORMS VERTICAL SINGLE AND RIGHT DOUBLE;;;; 255F;BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE;So;0;ON;;;;;N;FORMS VERTICAL DOUBLE AND RIGHT SINGLE;;;; 2560;BOX DRAWINGS DOUBLE VERTICAL AND RIGHT;So;0;ON;;;;;N;FORMS DOUBLE VERTICAL AND RIGHT;;;; 2561;BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE;So;0;ON;;;;;N;FORMS VERTICAL SINGLE AND LEFT DOUBLE;;;; 2562;BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE;So;0;ON;;;;;N;FORMS VERTICAL DOUBLE AND LEFT SINGLE;;;; 2563;BOX DRAWINGS DOUBLE VERTICAL AND LEFT;So;0;ON;;;;;N;FORMS DOUBLE VERTICAL AND LEFT;;;; 2564;BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE;So;0;ON;;;;;N;FORMS DOWN SINGLE AND HORIZONTAL DOUBLE;;;; 2565;BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE;So;0;ON;;;;;N;FORMS DOWN DOUBLE AND HORIZONTAL SINGLE;;;; 2566;BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL;So;0;ON;;;;;N;FORMS DOUBLE DOWN AND HORIZONTAL;;;; 2567;BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE;So;0;ON;;;;;N;FORMS UP SINGLE AND HORIZONTAL DOUBLE;;;; 2568;BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE;So;0;ON;;;;;N;FORMS UP DOUBLE AND HORIZONTAL SINGLE;;;; 2569;BOX DRAWINGS DOUBLE UP AND HORIZONTAL;So;0;ON;;;;;N;FORMS DOUBLE UP AND HORIZONTAL;;;; 256A;BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE;So;0;ON;;;;;N;FORMS VERTICAL SINGLE AND HORIZONTAL DOUBLE;;;; 256B;BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE;So;0;ON;;;;;N;FORMS VERTICAL DOUBLE AND HORIZONTAL SINGLE;;;; 256C;BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL;So;0;ON;;;;;N;FORMS DOUBLE VERTICAL AND HORIZONTAL;;;; 256D;BOX DRAWINGS LIGHT ARC DOWN AND RIGHT;So;0;ON;;;;;N;FORMS LIGHT ARC DOWN AND RIGHT;;;; 256E;BOX DRAWINGS LIGHT ARC DOWN AND LEFT;So;0;ON;;;;;N;FORMS LIGHT ARC DOWN AND LEFT;;;; 256F;BOX DRAWINGS LIGHT ARC UP AND LEFT;So;0;ON;;;;;N;FORMS LIGHT ARC UP AND LEFT;;;; 2570;BOX DRAWINGS LIGHT ARC UP AND RIGHT;So;0;ON;;;;;N;FORMS LIGHT ARC UP AND RIGHT;;;; 2571;BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT;So;0;ON;;;;;N;FORMS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT;;;; 2572;BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT;So;0;ON;;;;;N;FORMS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT;;;; 2573;BOX DRAWINGS LIGHT DIAGONAL CROSS;So;0;ON;;;;;N;FORMS LIGHT DIAGONAL CROSS;;;; 2574;BOX DRAWINGS LIGHT LEFT;So;0;ON;;;;;N;FORMS LIGHT LEFT;;;; 2575;BOX DRAWINGS LIGHT UP;So;0;ON;;;;;N;FORMS LIGHT UP;;;; 2576;BOX DRAWINGS LIGHT RIGHT;So;0;ON;;;;;N;FORMS LIGHT RIGHT;;;; 2577;BOX DRAWINGS LIGHT DOWN;So;0;ON;;;;;N;FORMS LIGHT DOWN;;;; 2578;BOX DRAWINGS HEAVY LEFT;So;0;ON;;;;;N;FORMS HEAVY LEFT;;;; 2579;BOX DRAWINGS HEAVY UP;So;0;ON;;;;;N;FORMS HEAVY UP;;;; 257A;BOX DRAWINGS HEAVY RIGHT;So;0;ON;;;;;N;FORMS HEAVY RIGHT;;;; 257B;BOX DRAWINGS HEAVY DOWN;So;0;ON;;;;;N;FORMS HEAVY DOWN;;;; 257C;BOX DRAWINGS LIGHT LEFT AND HEAVY RIGHT;So;0;ON;;;;;N;FORMS LIGHT LEFT AND HEAVY RIGHT;;;; 257D;BOX DRAWINGS LIGHT UP AND HEAVY DOWN;So;0;ON;;;;;N;FORMS LIGHT UP AND HEAVY DOWN;;;; 257E;BOX DRAWINGS HEAVY LEFT AND LIGHT RIGHT;So;0;ON;;;;;N;FORMS HEAVY LEFT AND LIGHT RIGHT;;;; 257F;BOX DRAWINGS HEAVY UP AND LIGHT DOWN;So;0;ON;;;;;N;FORMS HEAVY UP AND LIGHT DOWN;;;; 2580;UPPER HALF BLOCK;So;0;ON;;;;;N;;;;; 2581;LOWER ONE EIGHTH BLOCK;So;0;ON;;;;;N;;;;; 2582;LOWER ONE QUARTER BLOCK;So;0;ON;;;;;N;;;;; 2583;LOWER THREE EIGHTHS BLOCK;So;0;ON;;;;;N;;;;; 2584;LOWER HALF BLOCK;So;0;ON;;;;;N;;;;; 2585;LOWER FIVE EIGHTHS BLOCK;So;0;ON;;;;;N;;;;; 2586;LOWER THREE QUARTERS BLOCK;So;0;ON;;;;;N;LOWER THREE QUARTER BLOCK;;;; 2587;LOWER SEVEN EIGHTHS BLOCK;So;0;ON;;;;;N;;;;; 2588;FULL BLOCK;So;0;ON;;;;;N;;;;; 2589;LEFT SEVEN EIGHTHS BLOCK;So;0;ON;;;;;N;;;;; 258A;LEFT THREE QUARTERS BLOCK;So;0;ON;;;;;N;LEFT THREE QUARTER BLOCK;;;; 258B;LEFT FIVE EIGHTHS BLOCK;So;0;ON;;;;;N;;;;; 258C;LEFT HALF BLOCK;So;0;ON;;;;;N;;;;; 258D;LEFT THREE EIGHTHS BLOCK;So;0;ON;;;;;N;;;;; 258E;LEFT ONE QUARTER BLOCK;So;0;ON;;;;;N;;;;; 258F;LEFT ONE EIGHTH BLOCK;So;0;ON;;;;;N;;;;; 2590;RIGHT HALF BLOCK;So;0;ON;;;;;N;;;;; 2591;LIGHT SHADE;So;0;ON;;;;;N;;;;; 2592;MEDIUM SHADE;So;0;ON;;;;;N;;;;; 2593;DARK SHADE;So;0;ON;;;;;N;;;;; 2594;UPPER ONE EIGHTH BLOCK;So;0;ON;;;;;N;;;;; 2595;RIGHT ONE EIGHTH BLOCK;So;0;ON;;;;;N;;;;; 2596;QUADRANT LOWER LEFT;So;0;ON;;;;;N;;;;; 2597;QUADRANT LOWER RIGHT;So;0;ON;;;;;N;;;;; 2598;QUADRANT UPPER LEFT;So;0;ON;;;;;N;;;;; 2599;QUADRANT UPPER LEFT AND LOWER LEFT AND LOWER RIGHT;So;0;ON;;;;;N;;;;; 259A;QUADRANT UPPER LEFT AND LOWER RIGHT;So;0;ON;;;;;N;;;;; 259B;QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER LEFT;So;0;ON;;;;;N;;;;; 259C;QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER RIGHT;So;0;ON;;;;;N;;;;; 259D;QUADRANT UPPER RIGHT;So;0;ON;;;;;N;;;;; 259E;QUADRANT UPPER RIGHT AND LOWER LEFT;So;0;ON;;;;;N;;;;; 259F;QUADRANT UPPER RIGHT AND LOWER LEFT AND LOWER RIGHT;So;0;ON;;;;;N;;;;; 25A0;BLACK SQUARE;So;0;ON;;;;;N;;;;; 25A1;WHITE SQUARE;So;0;ON;;;;;N;;;;; 25A2;WHITE SQUARE WITH ROUNDED CORNERS;So;0;ON;;;;;N;;;;; 25A3;WHITE SQUARE CONTAINING BLACK SMALL SQUARE;So;0;ON;;;;;N;;;;; 25A4;SQUARE WITH HORIZONTAL FILL;So;0;ON;;;;;N;;;;; 25A5;SQUARE WITH VERTICAL FILL;So;0;ON;;;;;N;;;;; 25A6;SQUARE WITH ORTHOGONAL CROSSHATCH FILL;So;0;ON;;;;;N;;;;; 25A7;SQUARE WITH UPPER LEFT TO LOWER RIGHT FILL;So;0;ON;;;;;N;;;;; 25A8;SQUARE WITH UPPER RIGHT TO LOWER LEFT FILL;So;0;ON;;;;;N;;;;; 25A9;SQUARE WITH DIAGONAL CROSSHATCH FILL;So;0;ON;;;;;N;;;;; 25AA;BLACK SMALL SQUARE;So;0;ON;;;;;N;;;;; 25AB;WHITE SMALL SQUARE;So;0;ON;;;;;N;;;;; 25AC;BLACK RECTANGLE;So;0;ON;;;;;N;;;;; 25AD;WHITE RECTANGLE;So;0;ON;;;;;N;;;;; 25AE;BLACK VERTICAL RECTANGLE;So;0;ON;;;;;N;;;;; 25AF;WHITE VERTICAL RECTANGLE;So;0;ON;;;;;N;;;;; 25B0;BLACK PARALLELOGRAM;So;0;ON;;;;;N;;;;; 25B1;WHITE PARALLELOGRAM;So;0;ON;;;;;N;;;;; 25B2;BLACK UP-POINTING TRIANGLE;So;0;ON;;;;;N;BLACK UP POINTING TRIANGLE;;;; 25B3;WHITE UP-POINTING TRIANGLE;So;0;ON;;;;;N;WHITE UP POINTING TRIANGLE;;;; 25B4;BLACK UP-POINTING SMALL TRIANGLE;So;0;ON;;;;;N;BLACK UP POINTING SMALL TRIANGLE;;;; 25B5;WHITE UP-POINTING SMALL TRIANGLE;So;0;ON;;;;;N;WHITE UP POINTING SMALL TRIANGLE;;;; 25B6;BLACK RIGHT-POINTING TRIANGLE;So;0;ON;;;;;N;BLACK RIGHT POINTING TRIANGLE;;;; 25B7;WHITE RIGHT-POINTING TRIANGLE;Sm;0;ON;;;;;N;WHITE RIGHT POINTING TRIANGLE;;;; 25B8;BLACK RIGHT-POINTING SMALL TRIANGLE;So;0;ON;;;;;N;BLACK RIGHT POINTING SMALL TRIANGLE;;;; 25B9;WHITE RIGHT-POINTING SMALL TRIANGLE;So;0;ON;;;;;N;WHITE RIGHT POINTING SMALL TRIANGLE;;;; 25BA;BLACK RIGHT-POINTING POINTER;So;0;ON;;;;;N;BLACK RIGHT POINTING POINTER;;;; 25BB;WHITE RIGHT-POINTING POINTER;So;0;ON;;;;;N;WHITE RIGHT POINTING POINTER;;;; 25BC;BLACK DOWN-POINTING TRIANGLE;So;0;ON;;;;;N;BLACK DOWN POINTING TRIANGLE;;;; 25BD;WHITE DOWN-POINTING TRIANGLE;So;0;ON;;;;;N;WHITE DOWN POINTING TRIANGLE;;;; 25BE;BLACK DOWN-POINTING SMALL TRIANGLE;So;0;ON;;;;;N;BLACK DOWN POINTING SMALL TRIANGLE;;;; 25BF;WHITE DOWN-POINTING SMALL TRIANGLE;So;0;ON;;;;;N;WHITE DOWN POINTING SMALL TRIANGLE;;;; 25C0;BLACK LEFT-POINTING TRIANGLE;So;0;ON;;;;;N;BLACK LEFT POINTING TRIANGLE;;;; 25C1;WHITE LEFT-POINTING TRIANGLE;Sm;0;ON;;;;;N;WHITE LEFT POINTING TRIANGLE;;;; 25C2;BLACK LEFT-POINTING SMALL TRIANGLE;So;0;ON;;;;;N;BLACK LEFT POINTING SMALL TRIANGLE;;;; 25C3;WHITE LEFT-POINTING SMALL TRIANGLE;So;0;ON;;;;;N;WHITE LEFT POINTING SMALL TRIANGLE;;;; 25C4;BLACK LEFT-POINTING POINTER;So;0;ON;;;;;N;BLACK LEFT POINTING POINTER;;;; 25C5;WHITE LEFT-POINTING POINTER;So;0;ON;;;;;N;WHITE LEFT POINTING POINTER;;;; 25C6;BLACK DIAMOND;So;0;ON;;;;;N;;;;; 25C7;WHITE DIAMOND;So;0;ON;;;;;N;;;;; 25C8;WHITE DIAMOND CONTAINING BLACK SMALL DIAMOND;So;0;ON;;;;;N;;;;; 25C9;FISHEYE;So;0;ON;;;;;N;;;;; 25CA;LOZENGE;So;0;ON;;;;;N;;;;; 25CB;WHITE CIRCLE;So;0;ON;;;;;N;;;;; 25CC;DOTTED CIRCLE;So;0;ON;;;;;N;;;;; 25CD;CIRCLE WITH VERTICAL FILL;So;0;ON;;;;;N;;;;; 25CE;BULLSEYE;So;0;ON;;;;;N;;;;; 25CF;BLACK CIRCLE;So;0;ON;;;;;N;;;;; 25D0;CIRCLE WITH LEFT HALF BLACK;So;0;ON;;;;;N;;;;; 25D1;CIRCLE WITH RIGHT HALF BLACK;So;0;ON;;;;;N;;;;; 25D2;CIRCLE WITH LOWER HALF BLACK;So;0;ON;;;;;N;;;;; 25D3;CIRCLE WITH UPPER HALF BLACK;So;0;ON;;;;;N;;;;; 25D4;CIRCLE WITH UPPER RIGHT QUADRANT BLACK;So;0;ON;;;;;N;;;;; 25D5;CIRCLE WITH ALL BUT UPPER LEFT QUADRANT BLACK;So;0;ON;;;;;N;;;;; 25D6;LEFT HALF BLACK CIRCLE;So;0;ON;;;;;N;;;;; 25D7;RIGHT HALF BLACK CIRCLE;So;0;ON;;;;;N;;;;; 25D8;INVERSE BULLET;So;0;ON;;;;;N;;;;; 25D9;INVERSE WHITE CIRCLE;So;0;ON;;;;;N;;;;; 25DA;UPPER HALF INVERSE WHITE CIRCLE;So;0;ON;;;;;N;;;;; 25DB;LOWER HALF INVERSE WHITE CIRCLE;So;0;ON;;;;;N;;;;; 25DC;UPPER LEFT QUADRANT CIRCULAR ARC;So;0;ON;;;;;N;;;;; 25DD;UPPER RIGHT QUADRANT CIRCULAR ARC;So;0;ON;;;;;N;;;;; 25DE;LOWER RIGHT QUADRANT CIRCULAR ARC;So;0;ON;;;;;N;;;;; 25DF;LOWER LEFT QUADRANT CIRCULAR ARC;So;0;ON;;;;;N;;;;; 25E0;UPPER HALF CIRCLE;So;0;ON;;;;;N;;;;; 25E1;LOWER HALF CIRCLE;So;0;ON;;;;;N;;;;; 25E2;BLACK LOWER RIGHT TRIANGLE;So;0;ON;;;;;N;;;;; 25E3;BLACK LOWER LEFT TRIANGLE;So;0;ON;;;;;N;;;;; 25E4;BLACK UPPER LEFT TRIANGLE;So;0;ON;;;;;N;;;;; 25E5;BLACK UPPER RIGHT TRIANGLE;So;0;ON;;;;;N;;;;; 25E6;WHITE BULLET;So;0;ON;;;;;N;;;;; 25E7;SQUARE WITH LEFT HALF BLACK;So;0;ON;;;;;N;;;;; 25E8;SQUARE WITH RIGHT HALF BLACK;So;0;ON;;;;;N;;;;; 25E9;SQUARE WITH UPPER LEFT DIAGONAL HALF BLACK;So;0;ON;;;;;N;;;;; 25EA;SQUARE WITH LOWER RIGHT DIAGONAL HALF BLACK;So;0;ON;;;;;N;;;;; 25EB;WHITE SQUARE WITH VERTICAL BISECTING LINE;So;0;ON;;;;;N;;;;; 25EC;WHITE UP-POINTING TRIANGLE WITH DOT;So;0;ON;;;;;N;WHITE UP POINTING TRIANGLE WITH DOT;;;; 25ED;UP-POINTING TRIANGLE WITH LEFT HALF BLACK;So;0;ON;;;;;N;UP POINTING TRIANGLE WITH LEFT HALF BLACK;;;; 25EE;UP-POINTING TRIANGLE WITH RIGHT HALF BLACK;So;0;ON;;;;;N;UP POINTING TRIANGLE WITH RIGHT HALF BLACK;;;; 25EF;LARGE CIRCLE;So;0;ON;;;;;N;;;;; 25F0;WHITE SQUARE WITH UPPER LEFT QUADRANT;So;0;ON;;;;;N;;;;; 25F1;WHITE SQUARE WITH LOWER LEFT QUADRANT;So;0;ON;;;;;N;;;;; 25F2;WHITE SQUARE WITH LOWER RIGHT QUADRANT;So;0;ON;;;;;N;;;;; 25F3;WHITE SQUARE WITH UPPER RIGHT QUADRANT;So;0;ON;;;;;N;;;;; 25F4;WHITE CIRCLE WITH UPPER LEFT QUADRANT;So;0;ON;;;;;N;;;;; 25F5;WHITE CIRCLE WITH LOWER LEFT QUADRANT;So;0;ON;;;;;N;;;;; 25F6;WHITE CIRCLE WITH LOWER RIGHT QUADRANT;So;0;ON;;;;;N;;;;; 25F7;WHITE CIRCLE WITH UPPER RIGHT QUADRANT;So;0;ON;;;;;N;;;;; 25F8;UPPER LEFT TRIANGLE;Sm;0;ON;;;;;N;;;;; 25F9;UPPER RIGHT TRIANGLE;Sm;0;ON;;;;;N;;;;; 25FA;LOWER LEFT TRIANGLE;Sm;0;ON;;;;;N;;;;; 25FB;WHITE MEDIUM SQUARE;Sm;0;ON;;;;;N;;;;; 25FC;BLACK MEDIUM SQUARE;Sm;0;ON;;;;;N;;;;; 25FD;WHITE MEDIUM SMALL SQUARE;Sm;0;ON;;;;;N;;;;; 25FE;BLACK MEDIUM SMALL SQUARE;Sm;0;ON;;;;;N;;;;; 25FF;LOWER RIGHT TRIANGLE;Sm;0;ON;;;;;N;;;;; 2600;BLACK SUN WITH RAYS;So;0;ON;;;;;N;;;;; 2601;CLOUD;So;0;ON;;;;;N;;;;; 2602;UMBRELLA;So;0;ON;;;;;N;;;;; 2603;SNOWMAN;So;0;ON;;;;;N;;;;; 2604;COMET;So;0;ON;;;;;N;;;;; 2605;BLACK STAR;So;0;ON;;;;;N;;;;; 2606;WHITE STAR;So;0;ON;;;;;N;;;;; 2607;LIGHTNING;So;0;ON;;;;;N;;;;; 2608;THUNDERSTORM;So;0;ON;;;;;N;;;;; 2609;SUN;So;0;ON;;;;;N;;;;; 260A;ASCENDING NODE;So;0;ON;;;;;N;;;;; 260B;DESCENDING NODE;So;0;ON;;;;;N;;;;; 260C;CONJUNCTION;So;0;ON;;;;;N;;;;; 260D;OPPOSITION;So;0;ON;;;;;N;;;;; 260E;BLACK TELEPHONE;So;0;ON;;;;;N;;;;; 260F;WHITE TELEPHONE;So;0;ON;;;;;N;;;;; 2610;BALLOT BOX;So;0;ON;;;;;N;;;;; 2611;BALLOT BOX WITH CHECK;So;0;ON;;;;;N;;;;; 2612;BALLOT BOX WITH X;So;0;ON;;;;;N;;;;; 2613;SALTIRE;So;0;ON;;;;;N;;;;; 2614;UMBRELLA WITH RAIN DROPS;So;0;ON;;;;;N;;;;; 2615;HOT BEVERAGE;So;0;ON;;;;;N;;;;; 2616;WHITE SHOGI PIECE;So;0;ON;;;;;N;;;;; 2617;BLACK SHOGI PIECE;So;0;ON;;;;;N;;;;; 2618;SHAMROCK;So;0;ON;;;;;N;;;;; 2619;REVERSED ROTATED FLORAL HEART BULLET;So;0;ON;;;;;N;;;;; 261A;BLACK LEFT POINTING INDEX;So;0;ON;;;;;N;;;;; 261B;BLACK RIGHT POINTING INDEX;So;0;ON;;;;;N;;;;; 261C;WHITE LEFT POINTING INDEX;So;0;ON;;;;;N;;;;; 261D;WHITE UP POINTING INDEX;So;0;ON;;;;;N;;;;; 261E;WHITE RIGHT POINTING INDEX;So;0;ON;;;;;N;;;;; 261F;WHITE DOWN POINTING INDEX;So;0;ON;;;;;N;;;;; 2620;SKULL AND CROSSBONES;So;0;ON;;;;;N;;;;; 2621;CAUTION SIGN;So;0;ON;;;;;N;;;;; 2622;RADIOACTIVE SIGN;So;0;ON;;;;;N;;;;; 2623;BIOHAZARD SIGN;So;0;ON;;;;;N;;;;; 2624;CADUCEUS;So;0;ON;;;;;N;;;;; 2625;ANKH;So;0;ON;;;;;N;;;;; 2626;ORTHODOX CROSS;So;0;ON;;;;;N;;;;; 2627;CHI RHO;So;0;ON;;;;;N;;;;; 2628;CROSS OF LORRAINE;So;0;ON;;;;;N;;;;; 2629;CROSS OF JERUSALEM;So;0;ON;;;;;N;;;;; 262A;STAR AND CRESCENT;So;0;ON;;;;;N;;;;; 262B;FARSI SYMBOL;So;0;ON;;;;;N;SYMBOL OF IRAN;;;; 262C;ADI SHAKTI;So;0;ON;;;;;N;;;;; 262D;HAMMER AND SICKLE;So;0;ON;;;;;N;;;;; 262E;PEACE SYMBOL;So;0;ON;;;;;N;;;;; 262F;YIN YANG;So;0;ON;;;;;N;;;;; 2630;TRIGRAM FOR HEAVEN;So;0;ON;;;;;N;;;;; 2631;TRIGRAM FOR LAKE;So;0;ON;;;;;N;;;;; 2632;TRIGRAM FOR FIRE;So;0;ON;;;;;N;;;;; 2633;TRIGRAM FOR THUNDER;So;0;ON;;;;;N;;;;; 2634;TRIGRAM FOR WIND;So;0;ON;;;;;N;;;;; 2635;TRIGRAM FOR WATER;So;0;ON;;;;;N;;;;; 2636;TRIGRAM FOR MOUNTAIN;So;0;ON;;;;;N;;;;; 2637;TRIGRAM FOR EARTH;So;0;ON;;;;;N;;;;; 2638;WHEEL OF DHARMA;So;0;ON;;;;;N;;;;; 2639;WHITE FROWNING FACE;So;0;ON;;;;;N;;;;; 263A;WHITE SMILING FACE;So;0;ON;;;;;N;;;;; 263B;BLACK SMILING FACE;So;0;ON;;;;;N;;;;; 263C;WHITE SUN WITH RAYS;So;0;ON;;;;;N;;;;; 263D;FIRST QUARTER MOON;So;0;ON;;;;;N;;;;; 263E;LAST QUARTER MOON;So;0;ON;;;;;N;;;;; 263F;MERCURY;So;0;ON;;;;;N;;;;; 2640;FEMALE SIGN;So;0;ON;;;;;N;;;;; 2641;EARTH;So;0;ON;;;;;N;;;;; 2642;MALE SIGN;So;0;ON;;;;;N;;;;; 2643;JUPITER;So;0;ON;;;;;N;;;;; 2644;SATURN;So;0;ON;;;;;N;;;;; 2645;URANUS;So;0;ON;;;;;N;;;;; 2646;NEPTUNE;So;0;ON;;;;;N;;;;; 2647;PLUTO;So;0;ON;;;;;N;;;;; 2648;ARIES;So;0;ON;;;;;N;;;;; 2649;TAURUS;So;0;ON;;;;;N;;;;; 264A;GEMINI;So;0;ON;;;;;N;;;;; 264B;CANCER;So;0;ON;;;;;N;;;;; 264C;LEO;So;0;ON;;;;;N;;;;; 264D;VIRGO;So;0;ON;;;;;N;;;;; 264E;LIBRA;So;0;ON;;;;;N;;;;; 264F;SCORPIUS;So;0;ON;;;;;N;;;;; 2650;SAGITTARIUS;So;0;ON;;;;;N;;;;; 2651;CAPRICORN;So;0;ON;;;;;N;;;;; 2652;AQUARIUS;So;0;ON;;;;;N;;;;; 2653;PISCES;So;0;ON;;;;;N;;;;; 2654;WHITE CHESS KING;So;0;ON;;;;;N;;;;; 2655;WHITE CHESS QUEEN;So;0;ON;;;;;N;;;;; 2656;WHITE CHESS ROOK;So;0;ON;;;;;N;;;;; 2657;WHITE CHESS BISHOP;So;0;ON;;;;;N;;;;; 2658;WHITE CHESS KNIGHT;So;0;ON;;;;;N;;;;; 2659;WHITE CHESS PAWN;So;0;ON;;;;;N;;;;; 265A;BLACK CHESS KING;So;0;ON;;;;;N;;;;; 265B;BLACK CHESS QUEEN;So;0;ON;;;;;N;;;;; 265C;BLACK CHESS ROOK;So;0;ON;;;;;N;;;;; 265D;BLACK CHESS BISHOP;So;0;ON;;;;;N;;;;; 265E;BLACK CHESS KNIGHT;So;0;ON;;;;;N;;;;; 265F;BLACK CHESS PAWN;So;0;ON;;;;;N;;;;; 2660;BLACK SPADE SUIT;So;0;ON;;;;;N;;;;; 2661;WHITE HEART SUIT;So;0;ON;;;;;N;;;;; 2662;WHITE DIAMOND SUIT;So;0;ON;;;;;N;;;;; 2663;BLACK CLUB SUIT;So;0;ON;;;;;N;;;;; 2664;WHITE SPADE SUIT;So;0;ON;;;;;N;;;;; 2665;BLACK HEART SUIT;So;0;ON;;;;;N;;;;; 2666;BLACK DIAMOND SUIT;So;0;ON;;;;;N;;;;; 2667;WHITE CLUB SUIT;So;0;ON;;;;;N;;;;; 2668;HOT SPRINGS;So;0;ON;;;;;N;;;;; 2669;QUARTER NOTE;So;0;ON;;;;;N;;;;; 266A;EIGHTH NOTE;So;0;ON;;;;;N;;;;; 266B;BEAMED EIGHTH NOTES;So;0;ON;;;;;N;BARRED EIGHTH NOTES;;;; 266C;BEAMED SIXTEENTH NOTES;So;0;ON;;;;;N;BARRED SIXTEENTH NOTES;;;; 266D;MUSIC FLAT SIGN;So;0;ON;;;;;N;FLAT;;;; 266E;MUSIC NATURAL SIGN;So;0;ON;;;;;N;NATURAL;;;; 266F;MUSIC SHARP SIGN;Sm;0;ON;;;;;N;SHARP;;;; 2670;WEST SYRIAC CROSS;So;0;ON;;;;;N;;;;; 2671;EAST SYRIAC CROSS;So;0;ON;;;;;N;;;;; 2672;UNIVERSAL RECYCLING SYMBOL;So;0;ON;;;;;N;;;;; 2673;RECYCLING SYMBOL FOR TYPE-1 PLASTICS;So;0;ON;;;;;N;;;;; 2674;RECYCLING SYMBOL FOR TYPE-2 PLASTICS;So;0;ON;;;;;N;;;;; 2675;RECYCLING SYMBOL FOR TYPE-3 PLASTICS;So;0;ON;;;;;N;;;;; 2676;RECYCLING SYMBOL FOR TYPE-4 PLASTICS;So;0;ON;;;;;N;;;;; 2677;RECYCLING SYMBOL FOR TYPE-5 PLASTICS;So;0;ON;;;;;N;;;;; 2678;RECYCLING SYMBOL FOR TYPE-6 PLASTICS;So;0;ON;;;;;N;;;;; 2679;RECYCLING SYMBOL FOR TYPE-7 PLASTICS;So;0;ON;;;;;N;;;;; 267A;RECYCLING SYMBOL FOR GENERIC MATERIALS;So;0;ON;;;;;N;;;;; 267B;BLACK UNIVERSAL RECYCLING SYMBOL;So;0;ON;;;;;N;;;;; 267C;RECYCLED PAPER SYMBOL;So;0;ON;;;;;N;;;;; 267D;PARTIALLY-RECYCLED PAPER SYMBOL;So;0;ON;;;;;N;;;;; 267E;PERMANENT PAPER SIGN;So;0;ON;;;;;N;;;;; 267F;WHEELCHAIR SYMBOL;So;0;ON;;;;;N;;;;; 2680;DIE FACE-1;So;0;ON;;;;;N;;;;; 2681;DIE FACE-2;So;0;ON;;;;;N;;;;; 2682;DIE FACE-3;So;0;ON;;;;;N;;;;; 2683;DIE FACE-4;So;0;ON;;;;;N;;;;; 2684;DIE FACE-5;So;0;ON;;;;;N;;;;; 2685;DIE FACE-6;So;0;ON;;;;;N;;;;; 2686;WHITE CIRCLE WITH DOT RIGHT;So;0;ON;;;;;N;;;;; 2687;WHITE CIRCLE WITH TWO DOTS;So;0;ON;;;;;N;;;;; 2688;BLACK CIRCLE WITH WHITE DOT RIGHT;So;0;ON;;;;;N;;;;; 2689;BLACK CIRCLE WITH TWO WHITE DOTS;So;0;ON;;;;;N;;;;; 268A;MONOGRAM FOR YANG;So;0;ON;;;;;N;;;;; 268B;MONOGRAM FOR YIN;So;0;ON;;;;;N;;;;; 268C;DIGRAM FOR GREATER YANG;So;0;ON;;;;;N;;;;; 268D;DIGRAM FOR LESSER YIN;So;0;ON;;;;;N;;;;; 268E;DIGRAM FOR LESSER YANG;So;0;ON;;;;;N;;;;; 268F;DIGRAM FOR GREATER YIN;So;0;ON;;;;;N;;;;; 2690;WHITE FLAG;So;0;ON;;;;;N;;;;; 2691;BLACK FLAG;So;0;ON;;;;;N;;;;; 2692;HAMMER AND PICK;So;0;ON;;;;;N;;;;; 2693;ANCHOR;So;0;ON;;;;;N;;;;; 2694;CROSSED SWORDS;So;0;ON;;;;;N;;;;; 2695;STAFF OF AESCULAPIUS;So;0;ON;;;;;N;;;;; 2696;SCALES;So;0;ON;;;;;N;;;;; 2697;ALEMBIC;So;0;ON;;;;;N;;;;; 2698;FLOWER;So;0;ON;;;;;N;;;;; 2699;GEAR;So;0;ON;;;;;N;;;;; 269A;STAFF OF HERMES;So;0;ON;;;;;N;;;;; 269B;ATOM SYMBOL;So;0;ON;;;;;N;;;;; 269C;FLEUR-DE-LIS;So;0;ON;;;;;N;;;;; 269D;OUTLINED WHITE STAR;So;0;ON;;;;;N;;;;; 269E;THREE LINES CONVERGING RIGHT;So;0;ON;;;;;N;;;;; 269F;THREE LINES CONVERGING LEFT;So;0;ON;;;;;N;;;;; 26A0;WARNING SIGN;So;0;ON;;;;;N;;;;; 26A1;HIGH VOLTAGE SIGN;So;0;ON;;;;;N;;;;; 26A2;DOUBLED FEMALE SIGN;So;0;ON;;;;;N;;;;; 26A3;DOUBLED MALE SIGN;So;0;ON;;;;;N;;;;; 26A4;INTERLOCKED FEMALE AND MALE SIGN;So;0;ON;;;;;N;;;;; 26A5;MALE AND FEMALE SIGN;So;0;ON;;;;;N;;;;; 26A6;MALE WITH STROKE SIGN;So;0;ON;;;;;N;;;;; 26A7;MALE WITH STROKE AND MALE AND FEMALE SIGN;So;0;ON;;;;;N;;;;; 26A8;VERTICAL MALE WITH STROKE SIGN;So;0;ON;;;;;N;;;;; 26A9;HORIZONTAL MALE WITH STROKE SIGN;So;0;ON;;;;;N;;;;; 26AA;MEDIUM WHITE CIRCLE;So;0;ON;;;;;N;;;;; 26AB;MEDIUM BLACK CIRCLE;So;0;ON;;;;;N;;;;; 26AC;MEDIUM SMALL WHITE CIRCLE;So;0;L;;;;;N;;;;; 26AD;MARRIAGE SYMBOL;So;0;ON;;;;;N;;;;; 26AE;DIVORCE SYMBOL;So;0;ON;;;;;N;;;;; 26AF;UNMARRIED PARTNERSHIP SYMBOL;So;0;ON;;;;;N;;;;; 26B0;COFFIN;So;0;ON;;;;;N;;;;; 26B1;FUNERAL URN;So;0;ON;;;;;N;;;;; 26B2;NEUTER;So;0;ON;;;;;N;;;;; 26B3;CERES;So;0;ON;;;;;N;;;;; 26B4;PALLAS;So;0;ON;;;;;N;;;;; 26B5;JUNO;So;0;ON;;;;;N;;;;; 26B6;VESTA;So;0;ON;;;;;N;;;;; 26B7;CHIRON;So;0;ON;;;;;N;;;;; 26B8;BLACK MOON LILITH;So;0;ON;;;;;N;;;;; 26B9;SEXTILE;So;0;ON;;;;;N;;;;; 26BA;SEMISEXTILE;So;0;ON;;;;;N;;;;; 26BB;QUINCUNX;So;0;ON;;;;;N;;;;; 26BC;SESQUIQUADRATE;So;0;ON;;;;;N;;;;; 26BD;SOCCER BALL;So;0;ON;;;;;N;;;;; 26BE;BASEBALL;So;0;ON;;;;;N;;;;; 26BF;SQUARED KEY;So;0;ON;;;;;N;;;;; 26C0;WHITE DRAUGHTS MAN;So;0;ON;;;;;N;;;;; 26C1;WHITE DRAUGHTS KING;So;0;ON;;;;;N;;;;; 26C2;BLACK DRAUGHTS MAN;So;0;ON;;;;;N;;;;; 26C3;BLACK DRAUGHTS KING;So;0;ON;;;;;N;;;;; 26C4;SNOWMAN WITHOUT SNOW;So;0;ON;;;;;N;;;;; 26C5;SUN BEHIND CLOUD;So;0;ON;;;;;N;;;;; 26C6;RAIN;So;0;ON;;;;;N;;;;; 26C7;BLACK SNOWMAN;So;0;ON;;;;;N;;;;; 26C8;THUNDER CLOUD AND RAIN;So;0;ON;;;;;N;;;;; 26C9;TURNED WHITE SHOGI PIECE;So;0;ON;;;;;N;;;;; 26CA;TURNED BLACK SHOGI PIECE;So;0;ON;;;;;N;;;;; 26CB;WHITE DIAMOND IN SQUARE;So;0;ON;;;;;N;;;;; 26CC;CROSSING LANES;So;0;ON;;;;;N;;;;; 26CD;DISABLED CAR;So;0;ON;;;;;N;;;;; 26CE;OPHIUCHUS;So;0;ON;;;;;N;;;;; 26CF;PICK;So;0;ON;;;;;N;;;;; 26D0;CAR SLIDING;So;0;ON;;;;;N;;;;; 26D1;HELMET WITH WHITE CROSS;So;0;ON;;;;;N;;;;; 26D2;CIRCLED CROSSING LANES;So;0;ON;;;;;N;;;;; 26D3;CHAINS;So;0;ON;;;;;N;;;;; 26D4;NO ENTRY;So;0;ON;;;;;N;;;;; 26D5;ALTERNATE ONE-WAY LEFT WAY TRAFFIC;So;0;ON;;;;;N;;;;; 26D6;BLACK TWO-WAY LEFT WAY TRAFFIC;So;0;ON;;;;;N;;;;; 26D7;WHITE TWO-WAY LEFT WAY TRAFFIC;So;0;ON;;;;;N;;;;; 26D8;BLACK LEFT LANE MERGE;So;0;ON;;;;;N;;;;; 26D9;WHITE LEFT LANE MERGE;So;0;ON;;;;;N;;;;; 26DA;DRIVE SLOW SIGN;So;0;ON;;;;;N;;;;; 26DB;HEAVY WHITE DOWN-POINTING TRIANGLE;So;0;ON;;;;;N;;;;; 26DC;LEFT CLOSED ENTRY;So;0;ON;;;;;N;;;;; 26DD;SQUARED SALTIRE;So;0;ON;;;;;N;;;;; 26DE;FALLING DIAGONAL IN WHITE CIRCLE IN BLACK SQUARE;So;0;ON;;;;;N;;;;; 26DF;BLACK TRUCK;So;0;ON;;;;;N;;;;; 26E0;RESTRICTED LEFT ENTRY-1;So;0;ON;;;;;N;;;;; 26E1;RESTRICTED LEFT ENTRY-2;So;0;ON;;;;;N;;;;; 26E2;ASTRONOMICAL SYMBOL FOR URANUS;So;0;ON;;;;;N;;;;; 26E3;HEAVY CIRCLE WITH STROKE AND TWO DOTS ABOVE;So;0;ON;;;;;N;;;;; 26E4;PENTAGRAM;So;0;ON;;;;;N;;;;; 26E5;RIGHT-HANDED INTERLACED PENTAGRAM;So;0;ON;;;;;N;;;;; 26E6;LEFT-HANDED INTERLACED PENTAGRAM;So;0;ON;;;;;N;;;;; 26E7;INVERTED PENTAGRAM;So;0;ON;;;;;N;;;;; 26E8;BLACK CROSS ON SHIELD;So;0;ON;;;;;N;;;;; 26E9;SHINTO SHRINE;So;0;ON;;;;;N;;;;; 26EA;CHURCH;So;0;ON;;;;;N;;;;; 26EB;CASTLE;So;0;ON;;;;;N;;;;; 26EC;HISTORIC SITE;So;0;ON;;;;;N;;;;; 26ED;GEAR WITHOUT HUB;So;0;ON;;;;;N;;;;; 26EE;GEAR WITH HANDLES;So;0;ON;;;;;N;;;;; 26EF;MAP SYMBOL FOR LIGHTHOUSE;So;0;ON;;;;;N;;;;; 26F0;MOUNTAIN;So;0;ON;;;;;N;;;;; 26F1;UMBRELLA ON GROUND;So;0;ON;;;;;N;;;;; 26F2;FOUNTAIN;So;0;ON;;;;;N;;;;; 26F3;FLAG IN HOLE;So;0;ON;;;;;N;;;;; 26F4;FERRY;So;0;ON;;;;;N;;;;; 26F5;SAILBOAT;So;0;ON;;;;;N;;;;; 26F6;SQUARE FOUR CORNERS;So;0;ON;;;;;N;;;;; 26F7;SKIER;So;0;ON;;;;;N;;;;; 26F8;ICE SKATE;So;0;ON;;;;;N;;;;; 26F9;PERSON WITH BALL;So;0;ON;;;;;N;;;;; 26FA;TENT;So;0;ON;;;;;N;;;;; 26FB;JAPANESE BANK SYMBOL;So;0;ON;;;;;N;;;;; 26FC;HEADSTONE GRAVEYARD SYMBOL;So;0;ON;;;;;N;;;;; 26FD;FUEL PUMP;So;0;ON;;;;;N;;;;; 26FE;CUP ON BLACK SQUARE;So;0;ON;;;;;N;;;;; 26FF;WHITE FLAG WITH HORIZONTAL MIDDLE BLACK STRIPE;So;0;ON;;;;;N;;;;; 2701;UPPER BLADE SCISSORS;So;0;ON;;;;;N;;;;; 2702;BLACK SCISSORS;So;0;ON;;;;;N;;;;; 2703;LOWER BLADE SCISSORS;So;0;ON;;;;;N;;;;; 2704;WHITE SCISSORS;So;0;ON;;;;;N;;;;; 2705;WHITE HEAVY CHECK MARK;So;0;ON;;;;;N;;;;; 2706;TELEPHONE LOCATION SIGN;So;0;ON;;;;;N;;;;; 2707;TAPE DRIVE;So;0;ON;;;;;N;;;;; 2708;AIRPLANE;So;0;ON;;;;;N;;;;; 2709;ENVELOPE;So;0;ON;;;;;N;;;;; 270A;RAISED FIST;So;0;ON;;;;;N;;;;; 270B;RAISED HAND;So;0;ON;;;;;N;;;;; 270C;VICTORY HAND;So;0;ON;;;;;N;;;;; 270D;WRITING HAND;So;0;ON;;;;;N;;;;; 270E;LOWER RIGHT PENCIL;So;0;ON;;;;;N;;;;; 270F;PENCIL;So;0;ON;;;;;N;;;;; 2710;UPPER RIGHT PENCIL;So;0;ON;;;;;N;;;;; 2711;WHITE NIB;So;0;ON;;;;;N;;;;; 2712;BLACK NIB;So;0;ON;;;;;N;;;;; 2713;CHECK MARK;So;0;ON;;;;;N;;;;; 2714;HEAVY CHECK MARK;So;0;ON;;;;;N;;;;; 2715;MULTIPLICATION X;So;0;ON;;;;;N;;;;; 2716;HEAVY MULTIPLICATION X;So;0;ON;;;;;N;;;;; 2717;BALLOT X;So;0;ON;;;;;N;;;;; 2718;HEAVY BALLOT X;So;0;ON;;;;;N;;;;; 2719;OUTLINED GREEK CROSS;So;0;ON;;;;;N;;;;; 271A;HEAVY GREEK CROSS;So;0;ON;;;;;N;;;;; 271B;OPEN CENTRE CROSS;So;0;ON;;;;;N;OPEN CENTER CROSS;;;; 271C;HEAVY OPEN CENTRE CROSS;So;0;ON;;;;;N;HEAVY OPEN CENTER CROSS;;;; 271D;LATIN CROSS;So;0;ON;;;;;N;;;;; 271E;SHADOWED WHITE LATIN CROSS;So;0;ON;;;;;N;;;;; 271F;OUTLINED LATIN CROSS;So;0;ON;;;;;N;;;;; 2720;MALTESE CROSS;So;0;ON;;;;;N;;;;; 2721;STAR OF DAVID;So;0;ON;;;;;N;;;;; 2722;FOUR TEARDROP-SPOKED ASTERISK;So;0;ON;;;;;N;;;;; 2723;FOUR BALLOON-SPOKED ASTERISK;So;0;ON;;;;;N;;;;; 2724;HEAVY FOUR BALLOON-SPOKED ASTERISK;So;0;ON;;;;;N;;;;; 2725;FOUR CLUB-SPOKED ASTERISK;So;0;ON;;;;;N;;;;; 2726;BLACK FOUR POINTED STAR;So;0;ON;;;;;N;;;;; 2727;WHITE FOUR POINTED STAR;So;0;ON;;;;;N;;;;; 2728;SPARKLES;So;0;ON;;;;;N;;;;; 2729;STRESS OUTLINED WHITE STAR;So;0;ON;;;;;N;;;;; 272A;CIRCLED WHITE STAR;So;0;ON;;;;;N;;;;; 272B;OPEN CENTRE BLACK STAR;So;0;ON;;;;;N;OPEN CENTER BLACK STAR;;;; 272C;BLACK CENTRE WHITE STAR;So;0;ON;;;;;N;BLACK CENTER WHITE STAR;;;; 272D;OUTLINED BLACK STAR;So;0;ON;;;;;N;;;;; 272E;HEAVY OUTLINED BLACK STAR;So;0;ON;;;;;N;;;;; 272F;PINWHEEL STAR;So;0;ON;;;;;N;;;;; 2730;SHADOWED WHITE STAR;So;0;ON;;;;;N;;;;; 2731;HEAVY ASTERISK;So;0;ON;;;;;N;;;;; 2732;OPEN CENTRE ASTERISK;So;0;ON;;;;;N;OPEN CENTER ASTERISK;;;; 2733;EIGHT SPOKED ASTERISK;So;0;ON;;;;;N;;;;; 2734;EIGHT POINTED BLACK STAR;So;0;ON;;;;;N;;;;; 2735;EIGHT POINTED PINWHEEL STAR;So;0;ON;;;;;N;;;;; 2736;SIX POINTED BLACK STAR;So;0;ON;;;;;N;;;;; 2737;EIGHT POINTED RECTILINEAR BLACK STAR;So;0;ON;;;;;N;;;;; 2738;HEAVY EIGHT POINTED RECTILINEAR BLACK STAR;So;0;ON;;;;;N;;;;; 2739;TWELVE POINTED BLACK STAR;So;0;ON;;;;;N;;;;; 273A;SIXTEEN POINTED ASTERISK;So;0;ON;;;;;N;;;;; 273B;TEARDROP-SPOKED ASTERISK;So;0;ON;;;;;N;;;;; 273C;OPEN CENTRE TEARDROP-SPOKED ASTERISK;So;0;ON;;;;;N;OPEN CENTER TEARDROP-SPOKED ASTERISK;;;; 273D;HEAVY TEARDROP-SPOKED ASTERISK;So;0;ON;;;;;N;;;;; 273E;SIX PETALLED BLACK AND WHITE FLORETTE;So;0;ON;;;;;N;;;;; 273F;BLACK FLORETTE;So;0;ON;;;;;N;;;;; 2740;WHITE FLORETTE;So;0;ON;;;;;N;;;;; 2741;EIGHT PETALLED OUTLINED BLACK FLORETTE;So;0;ON;;;;;N;;;;; 2742;CIRCLED OPEN CENTRE EIGHT POINTED STAR;So;0;ON;;;;;N;CIRCLED OPEN CENTER EIGHT POINTED STAR;;;; 2743;HEAVY TEARDROP-SPOKED PINWHEEL ASTERISK;So;0;ON;;;;;N;;;;; 2744;SNOWFLAKE;So;0;ON;;;;;N;;;;; 2745;TIGHT TRIFOLIATE SNOWFLAKE;So;0;ON;;;;;N;;;;; 2746;HEAVY CHEVRON SNOWFLAKE;So;0;ON;;;;;N;;;;; 2747;SPARKLE;So;0;ON;;;;;N;;;;; 2748;HEAVY SPARKLE;So;0;ON;;;;;N;;;;; 2749;BALLOON-SPOKED ASTERISK;So;0;ON;;;;;N;;;;; 274A;EIGHT TEARDROP-SPOKED PROPELLER ASTERISK;So;0;ON;;;;;N;;;;; 274B;HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK;So;0;ON;;;;;N;;;;; 274C;CROSS MARK;So;0;ON;;;;;N;;;;; 274D;SHADOWED WHITE CIRCLE;So;0;ON;;;;;N;;;;; 274E;NEGATIVE SQUARED CROSS MARK;So;0;ON;;;;;N;;;;; 274F;LOWER RIGHT DROP-SHADOWED WHITE SQUARE;So;0;ON;;;;;N;;;;; 2750;UPPER RIGHT DROP-SHADOWED WHITE SQUARE;So;0;ON;;;;;N;;;;; 2751;LOWER RIGHT SHADOWED WHITE SQUARE;So;0;ON;;;;;N;;;;; 2752;UPPER RIGHT SHADOWED WHITE SQUARE;So;0;ON;;;;;N;;;;; 2753;BLACK QUESTION MARK ORNAMENT;So;0;ON;;;;;N;;;;; 2754;WHITE QUESTION MARK ORNAMENT;So;0;ON;;;;;N;;;;; 2755;WHITE EXCLAMATION MARK ORNAMENT;So;0;ON;;;;;N;;;;; 2756;BLACK DIAMOND MINUS WHITE X;So;0;ON;;;;;N;;;;; 2757;HEAVY EXCLAMATION MARK SYMBOL;So;0;ON;;;;;N;;;;; 2758;LIGHT VERTICAL BAR;So;0;ON;;;;;N;;;;; 2759;MEDIUM VERTICAL BAR;So;0;ON;;;;;N;;;;; 275A;HEAVY VERTICAL BAR;So;0;ON;;;;;N;;;;; 275B;HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT;So;0;ON;;;;;N;;;;; 275C;HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT;So;0;ON;;;;;N;;;;; 275D;HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT;So;0;ON;;;;;N;;;;; 275E;HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT;So;0;ON;;;;;N;;;;; 275F;HEAVY LOW SINGLE COMMA QUOTATION MARK ORNAMENT;So;0;ON;;;;;N;;;;; 2760;HEAVY LOW DOUBLE COMMA QUOTATION MARK ORNAMENT;So;0;ON;;;;;N;;;;; 2761;CURVED STEM PARAGRAPH SIGN ORNAMENT;So;0;ON;;;;;N;;;;; 2762;HEAVY EXCLAMATION MARK ORNAMENT;So;0;ON;;;;;N;;;;; 2763;HEAVY HEART EXCLAMATION MARK ORNAMENT;So;0;ON;;;;;N;;;;; 2764;HEAVY BLACK HEART;So;0;ON;;;;;N;;;;; 2765;ROTATED HEAVY BLACK HEART BULLET;So;0;ON;;;;;N;;;;; 2766;FLORAL HEART;So;0;ON;;;;;N;;;;; 2767;ROTATED FLORAL HEART BULLET;So;0;ON;;;;;N;;;;; 2768;MEDIUM LEFT PARENTHESIS ORNAMENT;Ps;0;ON;;;;;Y;;;;; 2769;MEDIUM RIGHT PARENTHESIS ORNAMENT;Pe;0;ON;;;;;Y;;;;; 276A;MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT;Ps;0;ON;;;;;Y;;;;; 276B;MEDIUM FLATTENED RIGHT PARENTHESIS ORNAMENT;Pe;0;ON;;;;;Y;;;;; 276C;MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT;Ps;0;ON;;;;;Y;;;;; 276D;MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT;Pe;0;ON;;;;;Y;;;;; 276E;HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT;Ps;0;ON;;;;;Y;;;;; 276F;HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT;Pe;0;ON;;;;;Y;;;;; 2770;HEAVY LEFT-POINTING ANGLE BRACKET ORNAMENT;Ps;0;ON;;;;;Y;;;;; 2771;HEAVY RIGHT-POINTING ANGLE BRACKET ORNAMENT;Pe;0;ON;;;;;Y;;;;; 2772;LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT;Ps;0;ON;;;;;Y;;;;; 2773;LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT;Pe;0;ON;;;;;Y;;;;; 2774;MEDIUM LEFT CURLY BRACKET ORNAMENT;Ps;0;ON;;;;;Y;;;;; 2775;MEDIUM RIGHT CURLY BRACKET ORNAMENT;Pe;0;ON;;;;;Y;;;;; 2776;DINGBAT NEGATIVE CIRCLED DIGIT ONE;No;0;ON;;;1;1;N;INVERSE CIRCLED DIGIT ONE;;;; 2777;DINGBAT NEGATIVE CIRCLED DIGIT TWO;No;0;ON;;;2;2;N;INVERSE CIRCLED DIGIT TWO;;;; 2778;DINGBAT NEGATIVE CIRCLED DIGIT THREE;No;0;ON;;;3;3;N;INVERSE CIRCLED DIGIT THREE;;;; 2779;DINGBAT NEGATIVE CIRCLED DIGIT FOUR;No;0;ON;;;4;4;N;INVERSE CIRCLED DIGIT FOUR;;;; 277A;DINGBAT NEGATIVE CIRCLED DIGIT FIVE;No;0;ON;;;5;5;N;INVERSE CIRCLED DIGIT FIVE;;;; 277B;DINGBAT NEGATIVE CIRCLED DIGIT SIX;No;0;ON;;;6;6;N;INVERSE CIRCLED DIGIT SIX;;;; 277C;DINGBAT NEGATIVE CIRCLED DIGIT SEVEN;No;0;ON;;;7;7;N;INVERSE CIRCLED DIGIT SEVEN;;;; 277D;DINGBAT NEGATIVE CIRCLED DIGIT EIGHT;No;0;ON;;;8;8;N;INVERSE CIRCLED DIGIT EIGHT;;;; 277E;DINGBAT NEGATIVE CIRCLED DIGIT NINE;No;0;ON;;;9;9;N;INVERSE CIRCLED DIGIT NINE;;;; 277F;DINGBAT NEGATIVE CIRCLED NUMBER TEN;No;0;ON;;;;10;N;INVERSE CIRCLED NUMBER TEN;;;; 2780;DINGBAT CIRCLED SANS-SERIF DIGIT ONE;No;0;ON;;;1;1;N;CIRCLED SANS-SERIF DIGIT ONE;;;; 2781;DINGBAT CIRCLED SANS-SERIF DIGIT TWO;No;0;ON;;;2;2;N;CIRCLED SANS-SERIF DIGIT TWO;;;; 2782;DINGBAT CIRCLED SANS-SERIF DIGIT THREE;No;0;ON;;;3;3;N;CIRCLED SANS-SERIF DIGIT THREE;;;; 2783;DINGBAT CIRCLED SANS-SERIF DIGIT FOUR;No;0;ON;;;4;4;N;CIRCLED SANS-SERIF DIGIT FOUR;;;; 2784;DINGBAT CIRCLED SANS-SERIF DIGIT FIVE;No;0;ON;;;5;5;N;CIRCLED SANS-SERIF DIGIT FIVE;;;; 2785;DINGBAT CIRCLED SANS-SERIF DIGIT SIX;No;0;ON;;;6;6;N;CIRCLED SANS-SERIF DIGIT SIX;;;; 2786;DINGBAT CIRCLED SANS-SERIF DIGIT SEVEN;No;0;ON;;;7;7;N;CIRCLED SANS-SERIF DIGIT SEVEN;;;; 2787;DINGBAT CIRCLED SANS-SERIF DIGIT EIGHT;No;0;ON;;;8;8;N;CIRCLED SANS-SERIF DIGIT EIGHT;;;; 2788;DINGBAT CIRCLED SANS-SERIF DIGIT NINE;No;0;ON;;;9;9;N;CIRCLED SANS-SERIF DIGIT NINE;;;; 2789;DINGBAT CIRCLED SANS-SERIF NUMBER TEN;No;0;ON;;;;10;N;CIRCLED SANS-SERIF NUMBER TEN;;;; 278A;DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE;No;0;ON;;;1;1;N;INVERSE CIRCLED SANS-SERIF DIGIT ONE;;;; 278B;DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT TWO;No;0;ON;;;2;2;N;INVERSE CIRCLED SANS-SERIF DIGIT TWO;;;; 278C;DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT THREE;No;0;ON;;;3;3;N;INVERSE CIRCLED SANS-SERIF DIGIT THREE;;;; 278D;DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FOUR;No;0;ON;;;4;4;N;INVERSE CIRCLED SANS-SERIF DIGIT FOUR;;;; 278E;DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FIVE;No;0;ON;;;5;5;N;INVERSE CIRCLED SANS-SERIF DIGIT FIVE;;;; 278F;DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SIX;No;0;ON;;;6;6;N;INVERSE CIRCLED SANS-SERIF DIGIT SIX;;;; 2790;DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SEVEN;No;0;ON;;;7;7;N;INVERSE CIRCLED SANS-SERIF DIGIT SEVEN;;;; 2791;DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT EIGHT;No;0;ON;;;8;8;N;INVERSE CIRCLED SANS-SERIF DIGIT EIGHT;;;; 2792;DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT NINE;No;0;ON;;;9;9;N;INVERSE CIRCLED SANS-SERIF DIGIT NINE;;;; 2793;DINGBAT NEGATIVE CIRCLED SANS-SERIF NUMBER TEN;No;0;ON;;;;10;N;INVERSE CIRCLED SANS-SERIF NUMBER TEN;;;; 2794;HEAVY WIDE-HEADED RIGHTWARDS ARROW;So;0;ON;;;;;N;HEAVY WIDE-HEADED RIGHT ARROW;;;; 2795;HEAVY PLUS SIGN;So;0;ON;;;;;N;;;;; 2796;HEAVY MINUS SIGN;So;0;ON;;;;;N;;;;; 2797;HEAVY DIVISION SIGN;So;0;ON;;;;;N;;;;; 2798;HEAVY SOUTH EAST ARROW;So;0;ON;;;;;N;HEAVY LOWER RIGHT ARROW;;;; 2799;HEAVY RIGHTWARDS ARROW;So;0;ON;;;;;N;HEAVY RIGHT ARROW;;;; 279A;HEAVY NORTH EAST ARROW;So;0;ON;;;;;N;HEAVY UPPER RIGHT ARROW;;;; 279B;DRAFTING POINT RIGHTWARDS ARROW;So;0;ON;;;;;N;DRAFTING POINT RIGHT ARROW;;;; 279C;HEAVY ROUND-TIPPED RIGHTWARDS ARROW;So;0;ON;;;;;N;HEAVY ROUND-TIPPED RIGHT ARROW;;;; 279D;TRIANGLE-HEADED RIGHTWARDS ARROW;So;0;ON;;;;;N;TRIANGLE-HEADED RIGHT ARROW;;;; 279E;HEAVY TRIANGLE-HEADED RIGHTWARDS ARROW;So;0;ON;;;;;N;HEAVY TRIANGLE-HEADED RIGHT ARROW;;;; 279F;DASHED TRIANGLE-HEADED RIGHTWARDS ARROW;So;0;ON;;;;;N;DASHED TRIANGLE-HEADED RIGHT ARROW;;;; 27A0;HEAVY DASHED TRIANGLE-HEADED RIGHTWARDS ARROW;So;0;ON;;;;;N;HEAVY DASHED TRIANGLE-HEADED RIGHT ARROW;;;; 27A1;BLACK RIGHTWARDS ARROW;So;0;ON;;;;;N;BLACK RIGHT ARROW;;;; 27A2;THREE-D TOP-LIGHTED RIGHTWARDS ARROWHEAD;So;0;ON;;;;;N;THREE-D TOP-LIGHTED RIGHT ARROWHEAD;;;; 27A3;THREE-D BOTTOM-LIGHTED RIGHTWARDS ARROWHEAD;So;0;ON;;;;;N;THREE-D BOTTOM-LIGHTED RIGHT ARROWHEAD;;;; 27A4;BLACK RIGHTWARDS ARROWHEAD;So;0;ON;;;;;N;BLACK RIGHT ARROWHEAD;;;; 27A5;HEAVY BLACK CURVED DOWNWARDS AND RIGHTWARDS ARROW;So;0;ON;;;;;N;HEAVY BLACK CURVED DOWN AND RIGHT ARROW;;;; 27A6;HEAVY BLACK CURVED UPWARDS AND RIGHTWARDS ARROW;So;0;ON;;;;;N;HEAVY BLACK CURVED UP AND RIGHT ARROW;;;; 27A7;SQUAT BLACK RIGHTWARDS ARROW;So;0;ON;;;;;N;SQUAT BLACK RIGHT ARROW;;;; 27A8;HEAVY CONCAVE-POINTED BLACK RIGHTWARDS ARROW;So;0;ON;;;;;N;HEAVY CONCAVE-POINTED BLACK RIGHT ARROW;;;; 27A9;RIGHT-SHADED WHITE RIGHTWARDS ARROW;So;0;ON;;;;;N;RIGHT-SHADED WHITE RIGHT ARROW;;;; 27AA;LEFT-SHADED WHITE RIGHTWARDS ARROW;So;0;ON;;;;;N;LEFT-SHADED WHITE RIGHT ARROW;;;; 27AB;BACK-TILTED SHADOWED WHITE RIGHTWARDS ARROW;So;0;ON;;;;;N;BACK-TILTED SHADOWED WHITE RIGHT ARROW;;;; 27AC;FRONT-TILTED SHADOWED WHITE RIGHTWARDS ARROW;So;0;ON;;;;;N;FRONT-TILTED SHADOWED WHITE RIGHT ARROW;;;; 27AD;HEAVY LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW;So;0;ON;;;;;N;HEAVY LOWER RIGHT-SHADOWED WHITE RIGHT ARROW;;;; 27AE;HEAVY UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW;So;0;ON;;;;;N;HEAVY UPPER RIGHT-SHADOWED WHITE RIGHT ARROW;;;; 27AF;NOTCHED LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW;So;0;ON;;;;;N;NOTCHED LOWER RIGHT-SHADOWED WHITE RIGHT ARROW;;;; 27B0;CURLY LOOP;So;0;ON;;;;;N;;;;; 27B1;NOTCHED UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW;So;0;ON;;;;;N;NOTCHED UPPER RIGHT-SHADOWED WHITE RIGHT ARROW;;;; 27B2;CIRCLED HEAVY WHITE RIGHTWARDS ARROW;So;0;ON;;;;;N;CIRCLED HEAVY WHITE RIGHT ARROW;;;; 27B3;WHITE-FEATHERED RIGHTWARDS ARROW;So;0;ON;;;;;N;WHITE-FEATHERED RIGHT ARROW;;;; 27B4;BLACK-FEATHERED SOUTH EAST ARROW;So;0;ON;;;;;N;BLACK-FEATHERED LOWER RIGHT ARROW;;;; 27B5;BLACK-FEATHERED RIGHTWARDS ARROW;So;0;ON;;;;;N;BLACK-FEATHERED RIGHT ARROW;;;; 27B6;BLACK-FEATHERED NORTH EAST ARROW;So;0;ON;;;;;N;BLACK-FEATHERED UPPER RIGHT ARROW;;;; 27B7;HEAVY BLACK-FEATHERED SOUTH EAST ARROW;So;0;ON;;;;;N;HEAVY BLACK-FEATHERED LOWER RIGHT ARROW;;;; 27B8;HEAVY BLACK-FEATHERED RIGHTWARDS ARROW;So;0;ON;;;;;N;HEAVY BLACK-FEATHERED RIGHT ARROW;;;; 27B9;HEAVY BLACK-FEATHERED NORTH EAST ARROW;So;0;ON;;;;;N;HEAVY BLACK-FEATHERED UPPER RIGHT ARROW;;;; 27BA;TEARDROP-BARBED RIGHTWARDS ARROW;So;0;ON;;;;;N;TEARDROP-BARBED RIGHT ARROW;;;; 27BB;HEAVY TEARDROP-SHANKED RIGHTWARDS ARROW;So;0;ON;;;;;N;HEAVY TEARDROP-SHANKED RIGHT ARROW;;;; 27BC;WEDGE-TAILED RIGHTWARDS ARROW;So;0;ON;;;;;N;WEDGE-TAILED RIGHT ARROW;;;; 27BD;HEAVY WEDGE-TAILED RIGHTWARDS ARROW;So;0;ON;;;;;N;HEAVY WEDGE-TAILED RIGHT ARROW;;;; 27BE;OPEN-OUTLINED RIGHTWARDS ARROW;So;0;ON;;;;;N;OPEN-OUTLINED RIGHT ARROW;;;; 27BF;DOUBLE CURLY LOOP;So;0;ON;;;;;N;;;;; 27C0;THREE DIMENSIONAL ANGLE;Sm;0;ON;;;;;Y;;;;; 27C1;WHITE TRIANGLE CONTAINING SMALL WHITE TRIANGLE;Sm;0;ON;;;;;N;;;;; 27C2;PERPENDICULAR;Sm;0;ON;;;;;N;;;;; 27C3;OPEN SUBSET;Sm;0;ON;;;;;Y;;;;; 27C4;OPEN SUPERSET;Sm;0;ON;;;;;Y;;;;; 27C5;LEFT S-SHAPED BAG DELIMITER;Ps;0;ON;;;;;Y;;;;; 27C6;RIGHT S-SHAPED BAG DELIMITER;Pe;0;ON;;;;;Y;;;;; 27C7;OR WITH DOT INSIDE;Sm;0;ON;;;;;N;;;;; 27C8;REVERSE SOLIDUS PRECEDING SUBSET;Sm;0;ON;;;;;Y;;;;; 27C9;SUPERSET PRECEDING SOLIDUS;Sm;0;ON;;;;;Y;;;;; 27CA;VERTICAL BAR WITH HORIZONTAL STROKE;Sm;0;ON;;;;;N;;;;; 27CB;MATHEMATICAL RISING DIAGONAL;Sm;0;ON;;;;;Y;;;;; 27CC;LONG DIVISION;Sm;0;ON;;;;;Y;;;;; 27CD;MATHEMATICAL FALLING DIAGONAL;Sm;0;ON;;;;;Y;;;;; 27CE;SQUARED LOGICAL AND;Sm;0;ON;;;;;N;;;;; 27CF;SQUARED LOGICAL OR;Sm;0;ON;;;;;N;;;;; 27D0;WHITE DIAMOND WITH CENTRED DOT;Sm;0;ON;;;;;N;;;;; 27D1;AND WITH DOT;Sm;0;ON;;;;;N;;;;; 27D2;ELEMENT OF OPENING UPWARDS;Sm;0;ON;;;;;N;;;;; 27D3;LOWER RIGHT CORNER WITH DOT;Sm;0;ON;;;;;Y;;;;; 27D4;UPPER LEFT CORNER WITH DOT;Sm;0;ON;;;;;Y;;;;; 27D5;LEFT OUTER JOIN;Sm;0;ON;;;;;Y;;;;; 27D6;RIGHT OUTER JOIN;Sm;0;ON;;;;;Y;;;;; 27D7;FULL OUTER JOIN;Sm;0;ON;;;;;N;;;;; 27D8;LARGE UP TACK;Sm;0;ON;;;;;N;;;;; 27D9;LARGE DOWN TACK;Sm;0;ON;;;;;N;;;;; 27DA;LEFT AND RIGHT DOUBLE TURNSTILE;Sm;0;ON;;;;;N;;;;; 27DB;LEFT AND RIGHT TACK;Sm;0;ON;;;;;N;;;;; 27DC;LEFT MULTIMAP;Sm;0;ON;;;;;Y;;;;; 27DD;LONG RIGHT TACK;Sm;0;ON;;;;;Y;;;;; 27DE;LONG LEFT TACK;Sm;0;ON;;;;;Y;;;;; 27DF;UP TACK WITH CIRCLE ABOVE;Sm;0;ON;;;;;N;;;;; 27E0;LOZENGE DIVIDED BY HORIZONTAL RULE;Sm;0;ON;;;;;N;;;;; 27E1;WHITE CONCAVE-SIDED DIAMOND;Sm;0;ON;;;;;N;;;;; 27E2;WHITE CONCAVE-SIDED DIAMOND WITH LEFTWARDS TICK;Sm;0;ON;;;;;Y;;;;; 27E3;WHITE CONCAVE-SIDED DIAMOND WITH RIGHTWARDS TICK;Sm;0;ON;;;;;Y;;;;; 27E4;WHITE SQUARE WITH LEFTWARDS TICK;Sm;0;ON;;;;;Y;;;;; 27E5;WHITE SQUARE WITH RIGHTWARDS TICK;Sm;0;ON;;;;;Y;;;;; 27E6;MATHEMATICAL LEFT WHITE SQUARE BRACKET;Ps;0;ON;;;;;Y;;;;; 27E7;MATHEMATICAL RIGHT WHITE SQUARE BRACKET;Pe;0;ON;;;;;Y;;;;; 27E8;MATHEMATICAL LEFT ANGLE BRACKET;Ps;0;ON;;;;;Y;;;;; 27E9;MATHEMATICAL RIGHT ANGLE BRACKET;Pe;0;ON;;;;;Y;;;;; 27EA;MATHEMATICAL LEFT DOUBLE ANGLE BRACKET;Ps;0;ON;;;;;Y;;;;; 27EB;MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET;Pe;0;ON;;;;;Y;;;;; 27EC;MATHEMATICAL LEFT WHITE TORTOISE SHELL BRACKET;Ps;0;ON;;;;;Y;;;;; 27ED;MATHEMATICAL RIGHT WHITE TORTOISE SHELL BRACKET;Pe;0;ON;;;;;Y;;;;; 27EE;MATHEMATICAL LEFT FLATTENED PARENTHESIS;Ps;0;ON;;;;;Y;;;;; 27EF;MATHEMATICAL RIGHT FLATTENED PARENTHESIS;Pe;0;ON;;;;;Y;;;;; 27F0;UPWARDS QUADRUPLE ARROW;Sm;0;ON;;;;;N;;;;; 27F1;DOWNWARDS QUADRUPLE ARROW;Sm;0;ON;;;;;N;;;;; 27F2;ANTICLOCKWISE GAPPED CIRCLE ARROW;Sm;0;ON;;;;;N;;;;; 27F3;CLOCKWISE GAPPED CIRCLE ARROW;Sm;0;ON;;;;;N;;;;; 27F4;RIGHT ARROW WITH CIRCLED PLUS;Sm;0;ON;;;;;N;;;;; 27F5;LONG LEFTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 27F6;LONG RIGHTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 27F7;LONG LEFT RIGHT ARROW;Sm;0;ON;;;;;N;;;;; 27F8;LONG LEFTWARDS DOUBLE ARROW;Sm;0;ON;;;;;N;;;;; 27F9;LONG RIGHTWARDS DOUBLE ARROW;Sm;0;ON;;;;;N;;;;; 27FA;LONG LEFT RIGHT DOUBLE ARROW;Sm;0;ON;;;;;N;;;;; 27FB;LONG LEFTWARDS ARROW FROM BAR;Sm;0;ON;;;;;N;;;;; 27FC;LONG RIGHTWARDS ARROW FROM BAR;Sm;0;ON;;;;;N;;;;; 27FD;LONG LEFTWARDS DOUBLE ARROW FROM BAR;Sm;0;ON;;;;;N;;;;; 27FE;LONG RIGHTWARDS DOUBLE ARROW FROM BAR;Sm;0;ON;;;;;N;;;;; 27FF;LONG RIGHTWARDS SQUIGGLE ARROW;Sm;0;ON;;;;;N;;;;; 2800;BRAILLE PATTERN BLANK;So;0;L;;;;;N;;;;; 2801;BRAILLE PATTERN DOTS-1;So;0;L;;;;;N;;;;; 2802;BRAILLE PATTERN DOTS-2;So;0;L;;;;;N;;;;; 2803;BRAILLE PATTERN DOTS-12;So;0;L;;;;;N;;;;; 2804;BRAILLE PATTERN DOTS-3;So;0;L;;;;;N;;;;; 2805;BRAILLE PATTERN DOTS-13;So;0;L;;;;;N;;;;; 2806;BRAILLE PATTERN DOTS-23;So;0;L;;;;;N;;;;; 2807;BRAILLE PATTERN DOTS-123;So;0;L;;;;;N;;;;; 2808;BRAILLE PATTERN DOTS-4;So;0;L;;;;;N;;;;; 2809;BRAILLE PATTERN DOTS-14;So;0;L;;;;;N;;;;; 280A;BRAILLE PATTERN DOTS-24;So;0;L;;;;;N;;;;; 280B;BRAILLE PATTERN DOTS-124;So;0;L;;;;;N;;;;; 280C;BRAILLE PATTERN DOTS-34;So;0;L;;;;;N;;;;; 280D;BRAILLE PATTERN DOTS-134;So;0;L;;;;;N;;;;; 280E;BRAILLE PATTERN DOTS-234;So;0;L;;;;;N;;;;; 280F;BRAILLE PATTERN DOTS-1234;So;0;L;;;;;N;;;;; 2810;BRAILLE PATTERN DOTS-5;So;0;L;;;;;N;;;;; 2811;BRAILLE PATTERN DOTS-15;So;0;L;;;;;N;;;;; 2812;BRAILLE PATTERN DOTS-25;So;0;L;;;;;N;;;;; 2813;BRAILLE PATTERN DOTS-125;So;0;L;;;;;N;;;;; 2814;BRAILLE PATTERN DOTS-35;So;0;L;;;;;N;;;;; 2815;BRAILLE PATTERN DOTS-135;So;0;L;;;;;N;;;;; 2816;BRAILLE PATTERN DOTS-235;So;0;L;;;;;N;;;;; 2817;BRAILLE PATTERN DOTS-1235;So;0;L;;;;;N;;;;; 2818;BRAILLE PATTERN DOTS-45;So;0;L;;;;;N;;;;; 2819;BRAILLE PATTERN DOTS-145;So;0;L;;;;;N;;;;; 281A;BRAILLE PATTERN DOTS-245;So;0;L;;;;;N;;;;; 281B;BRAILLE PATTERN DOTS-1245;So;0;L;;;;;N;;;;; 281C;BRAILLE PATTERN DOTS-345;So;0;L;;;;;N;;;;; 281D;BRAILLE PATTERN DOTS-1345;So;0;L;;;;;N;;;;; 281E;BRAILLE PATTERN DOTS-2345;So;0;L;;;;;N;;;;; 281F;BRAILLE PATTERN DOTS-12345;So;0;L;;;;;N;;;;; 2820;BRAILLE PATTERN DOTS-6;So;0;L;;;;;N;;;;; 2821;BRAILLE PATTERN DOTS-16;So;0;L;;;;;N;;;;; 2822;BRAILLE PATTERN DOTS-26;So;0;L;;;;;N;;;;; 2823;BRAILLE PATTERN DOTS-126;So;0;L;;;;;N;;;;; 2824;BRAILLE PATTERN DOTS-36;So;0;L;;;;;N;;;;; 2825;BRAILLE PATTERN DOTS-136;So;0;L;;;;;N;;;;; 2826;BRAILLE PATTERN DOTS-236;So;0;L;;;;;N;;;;; 2827;BRAILLE PATTERN DOTS-1236;So;0;L;;;;;N;;;;; 2828;BRAILLE PATTERN DOTS-46;So;0;L;;;;;N;;;;; 2829;BRAILLE PATTERN DOTS-146;So;0;L;;;;;N;;;;; 282A;BRAILLE PATTERN DOTS-246;So;0;L;;;;;N;;;;; 282B;BRAILLE PATTERN DOTS-1246;So;0;L;;;;;N;;;;; 282C;BRAILLE PATTERN DOTS-346;So;0;L;;;;;N;;;;; 282D;BRAILLE PATTERN DOTS-1346;So;0;L;;;;;N;;;;; 282E;BRAILLE PATTERN DOTS-2346;So;0;L;;;;;N;;;;; 282F;BRAILLE PATTERN DOTS-12346;So;0;L;;;;;N;;;;; 2830;BRAILLE PATTERN DOTS-56;So;0;L;;;;;N;;;;; 2831;BRAILLE PATTERN DOTS-156;So;0;L;;;;;N;;;;; 2832;BRAILLE PATTERN DOTS-256;So;0;L;;;;;N;;;;; 2833;BRAILLE PATTERN DOTS-1256;So;0;L;;;;;N;;;;; 2834;BRAILLE PATTERN DOTS-356;So;0;L;;;;;N;;;;; 2835;BRAILLE PATTERN DOTS-1356;So;0;L;;;;;N;;;;; 2836;BRAILLE PATTERN DOTS-2356;So;0;L;;;;;N;;;;; 2837;BRAILLE PATTERN DOTS-12356;So;0;L;;;;;N;;;;; 2838;BRAILLE PATTERN DOTS-456;So;0;L;;;;;N;;;;; 2839;BRAILLE PATTERN DOTS-1456;So;0;L;;;;;N;;;;; 283A;BRAILLE PATTERN DOTS-2456;So;0;L;;;;;N;;;;; 283B;BRAILLE PATTERN DOTS-12456;So;0;L;;;;;N;;;;; 283C;BRAILLE PATTERN DOTS-3456;So;0;L;;;;;N;;;;; 283D;BRAILLE PATTERN DOTS-13456;So;0;L;;;;;N;;;;; 283E;BRAILLE PATTERN DOTS-23456;So;0;L;;;;;N;;;;; 283F;BRAILLE PATTERN DOTS-123456;So;0;L;;;;;N;;;;; 2840;BRAILLE PATTERN DOTS-7;So;0;L;;;;;N;;;;; 2841;BRAILLE PATTERN DOTS-17;So;0;L;;;;;N;;;;; 2842;BRAILLE PATTERN DOTS-27;So;0;L;;;;;N;;;;; 2843;BRAILLE PATTERN DOTS-127;So;0;L;;;;;N;;;;; 2844;BRAILLE PATTERN DOTS-37;So;0;L;;;;;N;;;;; 2845;BRAILLE PATTERN DOTS-137;So;0;L;;;;;N;;;;; 2846;BRAILLE PATTERN DOTS-237;So;0;L;;;;;N;;;;; 2847;BRAILLE PATTERN DOTS-1237;So;0;L;;;;;N;;;;; 2848;BRAILLE PATTERN DOTS-47;So;0;L;;;;;N;;;;; 2849;BRAILLE PATTERN DOTS-147;So;0;L;;;;;N;;;;; 284A;BRAILLE PATTERN DOTS-247;So;0;L;;;;;N;;;;; 284B;BRAILLE PATTERN DOTS-1247;So;0;L;;;;;N;;;;; 284C;BRAILLE PATTERN DOTS-347;So;0;L;;;;;N;;;;; 284D;BRAILLE PATTERN DOTS-1347;So;0;L;;;;;N;;;;; 284E;BRAILLE PATTERN DOTS-2347;So;0;L;;;;;N;;;;; 284F;BRAILLE PATTERN DOTS-12347;So;0;L;;;;;N;;;;; 2850;BRAILLE PATTERN DOTS-57;So;0;L;;;;;N;;;;; 2851;BRAILLE PATTERN DOTS-157;So;0;L;;;;;N;;;;; 2852;BRAILLE PATTERN DOTS-257;So;0;L;;;;;N;;;;; 2853;BRAILLE PATTERN DOTS-1257;So;0;L;;;;;N;;;;; 2854;BRAILLE PATTERN DOTS-357;So;0;L;;;;;N;;;;; 2855;BRAILLE PATTERN DOTS-1357;So;0;L;;;;;N;;;;; 2856;BRAILLE PATTERN DOTS-2357;So;0;L;;;;;N;;;;; 2857;BRAILLE PATTERN DOTS-12357;So;0;L;;;;;N;;;;; 2858;BRAILLE PATTERN DOTS-457;So;0;L;;;;;N;;;;; 2859;BRAILLE PATTERN DOTS-1457;So;0;L;;;;;N;;;;; 285A;BRAILLE PATTERN DOTS-2457;So;0;L;;;;;N;;;;; 285B;BRAILLE PATTERN DOTS-12457;So;0;L;;;;;N;;;;; 285C;BRAILLE PATTERN DOTS-3457;So;0;L;;;;;N;;;;; 285D;BRAILLE PATTERN DOTS-13457;So;0;L;;;;;N;;;;; 285E;BRAILLE PATTERN DOTS-23457;So;0;L;;;;;N;;;;; 285F;BRAILLE PATTERN DOTS-123457;So;0;L;;;;;N;;;;; 2860;BRAILLE PATTERN DOTS-67;So;0;L;;;;;N;;;;; 2861;BRAILLE PATTERN DOTS-167;So;0;L;;;;;N;;;;; 2862;BRAILLE PATTERN DOTS-267;So;0;L;;;;;N;;;;; 2863;BRAILLE PATTERN DOTS-1267;So;0;L;;;;;N;;;;; 2864;BRAILLE PATTERN DOTS-367;So;0;L;;;;;N;;;;; 2865;BRAILLE PATTERN DOTS-1367;So;0;L;;;;;N;;;;; 2866;BRAILLE PATTERN DOTS-2367;So;0;L;;;;;N;;;;; 2867;BRAILLE PATTERN DOTS-12367;So;0;L;;;;;N;;;;; 2868;BRAILLE PATTERN DOTS-467;So;0;L;;;;;N;;;;; 2869;BRAILLE PATTERN DOTS-1467;So;0;L;;;;;N;;;;; 286A;BRAILLE PATTERN DOTS-2467;So;0;L;;;;;N;;;;; 286B;BRAILLE PATTERN DOTS-12467;So;0;L;;;;;N;;;;; 286C;BRAILLE PATTERN DOTS-3467;So;0;L;;;;;N;;;;; 286D;BRAILLE PATTERN DOTS-13467;So;0;L;;;;;N;;;;; 286E;BRAILLE PATTERN DOTS-23467;So;0;L;;;;;N;;;;; 286F;BRAILLE PATTERN DOTS-123467;So;0;L;;;;;N;;;;; 2870;BRAILLE PATTERN DOTS-567;So;0;L;;;;;N;;;;; 2871;BRAILLE PATTERN DOTS-1567;So;0;L;;;;;N;;;;; 2872;BRAILLE PATTERN DOTS-2567;So;0;L;;;;;N;;;;; 2873;BRAILLE PATTERN DOTS-12567;So;0;L;;;;;N;;;;; 2874;BRAILLE PATTERN DOTS-3567;So;0;L;;;;;N;;;;; 2875;BRAILLE PATTERN DOTS-13567;So;0;L;;;;;N;;;;; 2876;BRAILLE PATTERN DOTS-23567;So;0;L;;;;;N;;;;; 2877;BRAILLE PATTERN DOTS-123567;So;0;L;;;;;N;;;;; 2878;BRAILLE PATTERN DOTS-4567;So;0;L;;;;;N;;;;; 2879;BRAILLE PATTERN DOTS-14567;So;0;L;;;;;N;;;;; 287A;BRAILLE PATTERN DOTS-24567;So;0;L;;;;;N;;;;; 287B;BRAILLE PATTERN DOTS-124567;So;0;L;;;;;N;;;;; 287C;BRAILLE PATTERN DOTS-34567;So;0;L;;;;;N;;;;; 287D;BRAILLE PATTERN DOTS-134567;So;0;L;;;;;N;;;;; 287E;BRAILLE PATTERN DOTS-234567;So;0;L;;;;;N;;;;; 287F;BRAILLE PATTERN DOTS-1234567;So;0;L;;;;;N;;;;; 2880;BRAILLE PATTERN DOTS-8;So;0;L;;;;;N;;;;; 2881;BRAILLE PATTERN DOTS-18;So;0;L;;;;;N;;;;; 2882;BRAILLE PATTERN DOTS-28;So;0;L;;;;;N;;;;; 2883;BRAILLE PATTERN DOTS-128;So;0;L;;;;;N;;;;; 2884;BRAILLE PATTERN DOTS-38;So;0;L;;;;;N;;;;; 2885;BRAILLE PATTERN DOTS-138;So;0;L;;;;;N;;;;; 2886;BRAILLE PATTERN DOTS-238;So;0;L;;;;;N;;;;; 2887;BRAILLE PATTERN DOTS-1238;So;0;L;;;;;N;;;;; 2888;BRAILLE PATTERN DOTS-48;So;0;L;;;;;N;;;;; 2889;BRAILLE PATTERN DOTS-148;So;0;L;;;;;N;;;;; 288A;BRAILLE PATTERN DOTS-248;So;0;L;;;;;N;;;;; 288B;BRAILLE PATTERN DOTS-1248;So;0;L;;;;;N;;;;; 288C;BRAILLE PATTERN DOTS-348;So;0;L;;;;;N;;;;; 288D;BRAILLE PATTERN DOTS-1348;So;0;L;;;;;N;;;;; 288E;BRAILLE PATTERN DOTS-2348;So;0;L;;;;;N;;;;; 288F;BRAILLE PATTERN DOTS-12348;So;0;L;;;;;N;;;;; 2890;BRAILLE PATTERN DOTS-58;So;0;L;;;;;N;;;;; 2891;BRAILLE PATTERN DOTS-158;So;0;L;;;;;N;;;;; 2892;BRAILLE PATTERN DOTS-258;So;0;L;;;;;N;;;;; 2893;BRAILLE PATTERN DOTS-1258;So;0;L;;;;;N;;;;; 2894;BRAILLE PATTERN DOTS-358;So;0;L;;;;;N;;;;; 2895;BRAILLE PATTERN DOTS-1358;So;0;L;;;;;N;;;;; 2896;BRAILLE PATTERN DOTS-2358;So;0;L;;;;;N;;;;; 2897;BRAILLE PATTERN DOTS-12358;So;0;L;;;;;N;;;;; 2898;BRAILLE PATTERN DOTS-458;So;0;L;;;;;N;;;;; 2899;BRAILLE PATTERN DOTS-1458;So;0;L;;;;;N;;;;; 289A;BRAILLE PATTERN DOTS-2458;So;0;L;;;;;N;;;;; 289B;BRAILLE PATTERN DOTS-12458;So;0;L;;;;;N;;;;; 289C;BRAILLE PATTERN DOTS-3458;So;0;L;;;;;N;;;;; 289D;BRAILLE PATTERN DOTS-13458;So;0;L;;;;;N;;;;; 289E;BRAILLE PATTERN DOTS-23458;So;0;L;;;;;N;;;;; 289F;BRAILLE PATTERN DOTS-123458;So;0;L;;;;;N;;;;; 28A0;BRAILLE PATTERN DOTS-68;So;0;L;;;;;N;;;;; 28A1;BRAILLE PATTERN DOTS-168;So;0;L;;;;;N;;;;; 28A2;BRAILLE PATTERN DOTS-268;So;0;L;;;;;N;;;;; 28A3;BRAILLE PATTERN DOTS-1268;So;0;L;;;;;N;;;;; 28A4;BRAILLE PATTERN DOTS-368;So;0;L;;;;;N;;;;; 28A5;BRAILLE PATTERN DOTS-1368;So;0;L;;;;;N;;;;; 28A6;BRAILLE PATTERN DOTS-2368;So;0;L;;;;;N;;;;; 28A7;BRAILLE PATTERN DOTS-12368;So;0;L;;;;;N;;;;; 28A8;BRAILLE PATTERN DOTS-468;So;0;L;;;;;N;;;;; 28A9;BRAILLE PATTERN DOTS-1468;So;0;L;;;;;N;;;;; 28AA;BRAILLE PATTERN DOTS-2468;So;0;L;;;;;N;;;;; 28AB;BRAILLE PATTERN DOTS-12468;So;0;L;;;;;N;;;;; 28AC;BRAILLE PATTERN DOTS-3468;So;0;L;;;;;N;;;;; 28AD;BRAILLE PATTERN DOTS-13468;So;0;L;;;;;N;;;;; 28AE;BRAILLE PATTERN DOTS-23468;So;0;L;;;;;N;;;;; 28AF;BRAILLE PATTERN DOTS-123468;So;0;L;;;;;N;;;;; 28B0;BRAILLE PATTERN DOTS-568;So;0;L;;;;;N;;;;; 28B1;BRAILLE PATTERN DOTS-1568;So;0;L;;;;;N;;;;; 28B2;BRAILLE PATTERN DOTS-2568;So;0;L;;;;;N;;;;; 28B3;BRAILLE PATTERN DOTS-12568;So;0;L;;;;;N;;;;; 28B4;BRAILLE PATTERN DOTS-3568;So;0;L;;;;;N;;;;; 28B5;BRAILLE PATTERN DOTS-13568;So;0;L;;;;;N;;;;; 28B6;BRAILLE PATTERN DOTS-23568;So;0;L;;;;;N;;;;; 28B7;BRAILLE PATTERN DOTS-123568;So;0;L;;;;;N;;;;; 28B8;BRAILLE PATTERN DOTS-4568;So;0;L;;;;;N;;;;; 28B9;BRAILLE PATTERN DOTS-14568;So;0;L;;;;;N;;;;; 28BA;BRAILLE PATTERN DOTS-24568;So;0;L;;;;;N;;;;; 28BB;BRAILLE PATTERN DOTS-124568;So;0;L;;;;;N;;;;; 28BC;BRAILLE PATTERN DOTS-34568;So;0;L;;;;;N;;;;; 28BD;BRAILLE PATTERN DOTS-134568;So;0;L;;;;;N;;;;; 28BE;BRAILLE PATTERN DOTS-234568;So;0;L;;;;;N;;;;; 28BF;BRAILLE PATTERN DOTS-1234568;So;0;L;;;;;N;;;;; 28C0;BRAILLE PATTERN DOTS-78;So;0;L;;;;;N;;;;; 28C1;BRAILLE PATTERN DOTS-178;So;0;L;;;;;N;;;;; 28C2;BRAILLE PATTERN DOTS-278;So;0;L;;;;;N;;;;; 28C3;BRAILLE PATTERN DOTS-1278;So;0;L;;;;;N;;;;; 28C4;BRAILLE PATTERN DOTS-378;So;0;L;;;;;N;;;;; 28C5;BRAILLE PATTERN DOTS-1378;So;0;L;;;;;N;;;;; 28C6;BRAILLE PATTERN DOTS-2378;So;0;L;;;;;N;;;;; 28C7;BRAILLE PATTERN DOTS-12378;So;0;L;;;;;N;;;;; 28C8;BRAILLE PATTERN DOTS-478;So;0;L;;;;;N;;;;; 28C9;BRAILLE PATTERN DOTS-1478;So;0;L;;;;;N;;;;; 28CA;BRAILLE PATTERN DOTS-2478;So;0;L;;;;;N;;;;; 28CB;BRAILLE PATTERN DOTS-12478;So;0;L;;;;;N;;;;; 28CC;BRAILLE PATTERN DOTS-3478;So;0;L;;;;;N;;;;; 28CD;BRAILLE PATTERN DOTS-13478;So;0;L;;;;;N;;;;; 28CE;BRAILLE PATTERN DOTS-23478;So;0;L;;;;;N;;;;; 28CF;BRAILLE PATTERN DOTS-123478;So;0;L;;;;;N;;;;; 28D0;BRAILLE PATTERN DOTS-578;So;0;L;;;;;N;;;;; 28D1;BRAILLE PATTERN DOTS-1578;So;0;L;;;;;N;;;;; 28D2;BRAILLE PATTERN DOTS-2578;So;0;L;;;;;N;;;;; 28D3;BRAILLE PATTERN DOTS-12578;So;0;L;;;;;N;;;;; 28D4;BRAILLE PATTERN DOTS-3578;So;0;L;;;;;N;;;;; 28D5;BRAILLE PATTERN DOTS-13578;So;0;L;;;;;N;;;;; 28D6;BRAILLE PATTERN DOTS-23578;So;0;L;;;;;N;;;;; 28D7;BRAILLE PATTERN DOTS-123578;So;0;L;;;;;N;;;;; 28D8;BRAILLE PATTERN DOTS-4578;So;0;L;;;;;N;;;;; 28D9;BRAILLE PATTERN DOTS-14578;So;0;L;;;;;N;;;;; 28DA;BRAILLE PATTERN DOTS-24578;So;0;L;;;;;N;;;;; 28DB;BRAILLE PATTERN DOTS-124578;So;0;L;;;;;N;;;;; 28DC;BRAILLE PATTERN DOTS-34578;So;0;L;;;;;N;;;;; 28DD;BRAILLE PATTERN DOTS-134578;So;0;L;;;;;N;;;;; 28DE;BRAILLE PATTERN DOTS-234578;So;0;L;;;;;N;;;;; 28DF;BRAILLE PATTERN DOTS-1234578;So;0;L;;;;;N;;;;; 28E0;BRAILLE PATTERN DOTS-678;So;0;L;;;;;N;;;;; 28E1;BRAILLE PATTERN DOTS-1678;So;0;L;;;;;N;;;;; 28E2;BRAILLE PATTERN DOTS-2678;So;0;L;;;;;N;;;;; 28E3;BRAILLE PATTERN DOTS-12678;So;0;L;;;;;N;;;;; 28E4;BRAILLE PATTERN DOTS-3678;So;0;L;;;;;N;;;;; 28E5;BRAILLE PATTERN DOTS-13678;So;0;L;;;;;N;;;;; 28E6;BRAILLE PATTERN DOTS-23678;So;0;L;;;;;N;;;;; 28E7;BRAILLE PATTERN DOTS-123678;So;0;L;;;;;N;;;;; 28E8;BRAILLE PATTERN DOTS-4678;So;0;L;;;;;N;;;;; 28E9;BRAILLE PATTERN DOTS-14678;So;0;L;;;;;N;;;;; 28EA;BRAILLE PATTERN DOTS-24678;So;0;L;;;;;N;;;;; 28EB;BRAILLE PATTERN DOTS-124678;So;0;L;;;;;N;;;;; 28EC;BRAILLE PATTERN DOTS-34678;So;0;L;;;;;N;;;;; 28ED;BRAILLE PATTERN DOTS-134678;So;0;L;;;;;N;;;;; 28EE;BRAILLE PATTERN DOTS-234678;So;0;L;;;;;N;;;;; 28EF;BRAILLE PATTERN DOTS-1234678;So;0;L;;;;;N;;;;; 28F0;BRAILLE PATTERN DOTS-5678;So;0;L;;;;;N;;;;; 28F1;BRAILLE PATTERN DOTS-15678;So;0;L;;;;;N;;;;; 28F2;BRAILLE PATTERN DOTS-25678;So;0;L;;;;;N;;;;; 28F3;BRAILLE PATTERN DOTS-125678;So;0;L;;;;;N;;;;; 28F4;BRAILLE PATTERN DOTS-35678;So;0;L;;;;;N;;;;; 28F5;BRAILLE PATTERN DOTS-135678;So;0;L;;;;;N;;;;; 28F6;BRAILLE PATTERN DOTS-235678;So;0;L;;;;;N;;;;; 28F7;BRAILLE PATTERN DOTS-1235678;So;0;L;;;;;N;;;;; 28F8;BRAILLE PATTERN DOTS-45678;So;0;L;;;;;N;;;;; 28F9;BRAILLE PATTERN DOTS-145678;So;0;L;;;;;N;;;;; 28FA;BRAILLE PATTERN DOTS-245678;So;0;L;;;;;N;;;;; 28FB;BRAILLE PATTERN DOTS-1245678;So;0;L;;;;;N;;;;; 28FC;BRAILLE PATTERN DOTS-345678;So;0;L;;;;;N;;;;; 28FD;BRAILLE PATTERN DOTS-1345678;So;0;L;;;;;N;;;;; 28FE;BRAILLE PATTERN DOTS-2345678;So;0;L;;;;;N;;;;; 28FF;BRAILLE PATTERN DOTS-12345678;So;0;L;;;;;N;;;;; 2900;RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2901;RIGHTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2902;LEFTWARDS DOUBLE ARROW WITH VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2903;RIGHTWARDS DOUBLE ARROW WITH VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2904;LEFT RIGHT DOUBLE ARROW WITH VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2905;RIGHTWARDS TWO-HEADED ARROW FROM BAR;Sm;0;ON;;;;;N;;;;; 2906;LEFTWARDS DOUBLE ARROW FROM BAR;Sm;0;ON;;;;;N;;;;; 2907;RIGHTWARDS DOUBLE ARROW FROM BAR;Sm;0;ON;;;;;N;;;;; 2908;DOWNWARDS ARROW WITH HORIZONTAL STROKE;Sm;0;ON;;;;;N;;;;; 2909;UPWARDS ARROW WITH HORIZONTAL STROKE;Sm;0;ON;;;;;N;;;;; 290A;UPWARDS TRIPLE ARROW;Sm;0;ON;;;;;N;;;;; 290B;DOWNWARDS TRIPLE ARROW;Sm;0;ON;;;;;N;;;;; 290C;LEFTWARDS DOUBLE DASH ARROW;Sm;0;ON;;;;;N;;;;; 290D;RIGHTWARDS DOUBLE DASH ARROW;Sm;0;ON;;;;;N;;;;; 290E;LEFTWARDS TRIPLE DASH ARROW;Sm;0;ON;;;;;N;;;;; 290F;RIGHTWARDS TRIPLE DASH ARROW;Sm;0;ON;;;;;N;;;;; 2910;RIGHTWARDS TWO-HEADED TRIPLE DASH ARROW;Sm;0;ON;;;;;N;;;;; 2911;RIGHTWARDS ARROW WITH DOTTED STEM;Sm;0;ON;;;;;N;;;;; 2912;UPWARDS ARROW TO BAR;Sm;0;ON;;;;;N;;;;; 2913;DOWNWARDS ARROW TO BAR;Sm;0;ON;;;;;N;;;;; 2914;RIGHTWARDS ARROW WITH TAIL WITH VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2915;RIGHTWARDS ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2916;RIGHTWARDS TWO-HEADED ARROW WITH TAIL;Sm;0;ON;;;;;N;;;;; 2917;RIGHTWARDS TWO-HEADED ARROW WITH TAIL WITH VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2918;RIGHTWARDS TWO-HEADED ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2919;LEFTWARDS ARROW-TAIL;Sm;0;ON;;;;;N;;;;; 291A;RIGHTWARDS ARROW-TAIL;Sm;0;ON;;;;;N;;;;; 291B;LEFTWARDS DOUBLE ARROW-TAIL;Sm;0;ON;;;;;N;;;;; 291C;RIGHTWARDS DOUBLE ARROW-TAIL;Sm;0;ON;;;;;N;;;;; 291D;LEFTWARDS ARROW TO BLACK DIAMOND;Sm;0;ON;;;;;N;;;;; 291E;RIGHTWARDS ARROW TO BLACK DIAMOND;Sm;0;ON;;;;;N;;;;; 291F;LEFTWARDS ARROW FROM BAR TO BLACK DIAMOND;Sm;0;ON;;;;;N;;;;; 2920;RIGHTWARDS ARROW FROM BAR TO BLACK DIAMOND;Sm;0;ON;;;;;N;;;;; 2921;NORTH WEST AND SOUTH EAST ARROW;Sm;0;ON;;;;;N;;;;; 2922;NORTH EAST AND SOUTH WEST ARROW;Sm;0;ON;;;;;N;;;;; 2923;NORTH WEST ARROW WITH HOOK;Sm;0;ON;;;;;N;;;;; 2924;NORTH EAST ARROW WITH HOOK;Sm;0;ON;;;;;N;;;;; 2925;SOUTH EAST ARROW WITH HOOK;Sm;0;ON;;;;;N;;;;; 2926;SOUTH WEST ARROW WITH HOOK;Sm;0;ON;;;;;N;;;;; 2927;NORTH WEST ARROW AND NORTH EAST ARROW;Sm;0;ON;;;;;N;;;;; 2928;NORTH EAST ARROW AND SOUTH EAST ARROW;Sm;0;ON;;;;;N;;;;; 2929;SOUTH EAST ARROW AND SOUTH WEST ARROW;Sm;0;ON;;;;;N;;;;; 292A;SOUTH WEST ARROW AND NORTH WEST ARROW;Sm;0;ON;;;;;N;;;;; 292B;RISING DIAGONAL CROSSING FALLING DIAGONAL;Sm;0;ON;;;;;N;;;;; 292C;FALLING DIAGONAL CROSSING RISING DIAGONAL;Sm;0;ON;;;;;N;;;;; 292D;SOUTH EAST ARROW CROSSING NORTH EAST ARROW;Sm;0;ON;;;;;N;;;;; 292E;NORTH EAST ARROW CROSSING SOUTH EAST ARROW;Sm;0;ON;;;;;N;;;;; 292F;FALLING DIAGONAL CROSSING NORTH EAST ARROW;Sm;0;ON;;;;;N;;;;; 2930;RISING DIAGONAL CROSSING SOUTH EAST ARROW;Sm;0;ON;;;;;N;;;;; 2931;NORTH EAST ARROW CROSSING NORTH WEST ARROW;Sm;0;ON;;;;;N;;;;; 2932;NORTH WEST ARROW CROSSING NORTH EAST ARROW;Sm;0;ON;;;;;N;;;;; 2933;WAVE ARROW POINTING DIRECTLY RIGHT;Sm;0;ON;;;;;N;;;;; 2934;ARROW POINTING RIGHTWARDS THEN CURVING UPWARDS;Sm;0;ON;;;;;N;;;;; 2935;ARROW POINTING RIGHTWARDS THEN CURVING DOWNWARDS;Sm;0;ON;;;;;N;;;;; 2936;ARROW POINTING DOWNWARDS THEN CURVING LEFTWARDS;Sm;0;ON;;;;;N;;;;; 2937;ARROW POINTING DOWNWARDS THEN CURVING RIGHTWARDS;Sm;0;ON;;;;;N;;;;; 2938;RIGHT-SIDE ARC CLOCKWISE ARROW;Sm;0;ON;;;;;N;;;;; 2939;LEFT-SIDE ARC ANTICLOCKWISE ARROW;Sm;0;ON;;;;;N;;;;; 293A;TOP ARC ANTICLOCKWISE ARROW;Sm;0;ON;;;;;N;;;;; 293B;BOTTOM ARC ANTICLOCKWISE ARROW;Sm;0;ON;;;;;N;;;;; 293C;TOP ARC CLOCKWISE ARROW WITH MINUS;Sm;0;ON;;;;;N;;;;; 293D;TOP ARC ANTICLOCKWISE ARROW WITH PLUS;Sm;0;ON;;;;;N;;;;; 293E;LOWER RIGHT SEMICIRCULAR CLOCKWISE ARROW;Sm;0;ON;;;;;N;;;;; 293F;LOWER LEFT SEMICIRCULAR ANTICLOCKWISE ARROW;Sm;0;ON;;;;;N;;;;; 2940;ANTICLOCKWISE CLOSED CIRCLE ARROW;Sm;0;ON;;;;;N;;;;; 2941;CLOCKWISE CLOSED CIRCLE ARROW;Sm;0;ON;;;;;N;;;;; 2942;RIGHTWARDS ARROW ABOVE SHORT LEFTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 2943;LEFTWARDS ARROW ABOVE SHORT RIGHTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 2944;SHORT RIGHTWARDS ARROW ABOVE LEFTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 2945;RIGHTWARDS ARROW WITH PLUS BELOW;Sm;0;ON;;;;;N;;;;; 2946;LEFTWARDS ARROW WITH PLUS BELOW;Sm;0;ON;;;;;N;;;;; 2947;RIGHTWARDS ARROW THROUGH X;Sm;0;ON;;;;;N;;;;; 2948;LEFT RIGHT ARROW THROUGH SMALL CIRCLE;Sm;0;ON;;;;;N;;;;; 2949;UPWARDS TWO-HEADED ARROW FROM SMALL CIRCLE;Sm;0;ON;;;;;N;;;;; 294A;LEFT BARB UP RIGHT BARB DOWN HARPOON;Sm;0;ON;;;;;N;;;;; 294B;LEFT BARB DOWN RIGHT BARB UP HARPOON;Sm;0;ON;;;;;N;;;;; 294C;UP BARB RIGHT DOWN BARB LEFT HARPOON;Sm;0;ON;;;;;N;;;;; 294D;UP BARB LEFT DOWN BARB RIGHT HARPOON;Sm;0;ON;;;;;N;;;;; 294E;LEFT BARB UP RIGHT BARB UP HARPOON;Sm;0;ON;;;;;N;;;;; 294F;UP BARB RIGHT DOWN BARB RIGHT HARPOON;Sm;0;ON;;;;;N;;;;; 2950;LEFT BARB DOWN RIGHT BARB DOWN HARPOON;Sm;0;ON;;;;;N;;;;; 2951;UP BARB LEFT DOWN BARB LEFT HARPOON;Sm;0;ON;;;;;N;;;;; 2952;LEFTWARDS HARPOON WITH BARB UP TO BAR;Sm;0;ON;;;;;N;;;;; 2953;RIGHTWARDS HARPOON WITH BARB UP TO BAR;Sm;0;ON;;;;;N;;;;; 2954;UPWARDS HARPOON WITH BARB RIGHT TO BAR;Sm;0;ON;;;;;N;;;;; 2955;DOWNWARDS HARPOON WITH BARB RIGHT TO BAR;Sm;0;ON;;;;;N;;;;; 2956;LEFTWARDS HARPOON WITH BARB DOWN TO BAR;Sm;0;ON;;;;;N;;;;; 2957;RIGHTWARDS HARPOON WITH BARB DOWN TO BAR;Sm;0;ON;;;;;N;;;;; 2958;UPWARDS HARPOON WITH BARB LEFT TO BAR;Sm;0;ON;;;;;N;;;;; 2959;DOWNWARDS HARPOON WITH BARB LEFT TO BAR;Sm;0;ON;;;;;N;;;;; 295A;LEFTWARDS HARPOON WITH BARB UP FROM BAR;Sm;0;ON;;;;;N;;;;; 295B;RIGHTWARDS HARPOON WITH BARB UP FROM BAR;Sm;0;ON;;;;;N;;;;; 295C;UPWARDS HARPOON WITH BARB RIGHT FROM BAR;Sm;0;ON;;;;;N;;;;; 295D;DOWNWARDS HARPOON WITH BARB RIGHT FROM BAR;Sm;0;ON;;;;;N;;;;; 295E;LEFTWARDS HARPOON WITH BARB DOWN FROM BAR;Sm;0;ON;;;;;N;;;;; 295F;RIGHTWARDS HARPOON WITH BARB DOWN FROM BAR;Sm;0;ON;;;;;N;;;;; 2960;UPWARDS HARPOON WITH BARB LEFT FROM BAR;Sm;0;ON;;;;;N;;;;; 2961;DOWNWARDS HARPOON WITH BARB LEFT FROM BAR;Sm;0;ON;;;;;N;;;;; 2962;LEFTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB DOWN;Sm;0;ON;;;;;N;;;;; 2963;UPWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT;Sm;0;ON;;;;;N;;;;; 2964;RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN;Sm;0;ON;;;;;N;;;;; 2965;DOWNWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT;Sm;0;ON;;;;;N;;;;; 2966;LEFTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB UP;Sm;0;ON;;;;;N;;;;; 2967;LEFTWARDS HARPOON WITH BARB DOWN ABOVE RIGHTWARDS HARPOON WITH BARB DOWN;Sm;0;ON;;;;;N;;;;; 2968;RIGHTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB UP;Sm;0;ON;;;;;N;;;;; 2969;RIGHTWARDS HARPOON WITH BARB DOWN ABOVE LEFTWARDS HARPOON WITH BARB DOWN;Sm;0;ON;;;;;N;;;;; 296A;LEFTWARDS HARPOON WITH BARB UP ABOVE LONG DASH;Sm;0;ON;;;;;N;;;;; 296B;LEFTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH;Sm;0;ON;;;;;N;;;;; 296C;RIGHTWARDS HARPOON WITH BARB UP ABOVE LONG DASH;Sm;0;ON;;;;;N;;;;; 296D;RIGHTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH;Sm;0;ON;;;;;N;;;;; 296E;UPWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT;Sm;0;ON;;;;;N;;;;; 296F;DOWNWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT;Sm;0;ON;;;;;N;;;;; 2970;RIGHT DOUBLE ARROW WITH ROUNDED HEAD;Sm;0;ON;;;;;N;;;;; 2971;EQUALS SIGN ABOVE RIGHTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 2972;TILDE OPERATOR ABOVE RIGHTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 2973;LEFTWARDS ARROW ABOVE TILDE OPERATOR;Sm;0;ON;;;;;N;;;;; 2974;RIGHTWARDS ARROW ABOVE TILDE OPERATOR;Sm;0;ON;;;;;N;;;;; 2975;RIGHTWARDS ARROW ABOVE ALMOST EQUAL TO;Sm;0;ON;;;;;N;;;;; 2976;LESS-THAN ABOVE LEFTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 2977;LEFTWARDS ARROW THROUGH LESS-THAN;Sm;0;ON;;;;;N;;;;; 2978;GREATER-THAN ABOVE RIGHTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 2979;SUBSET ABOVE RIGHTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 297A;LEFTWARDS ARROW THROUGH SUBSET;Sm;0;ON;;;;;N;;;;; 297B;SUPERSET ABOVE LEFTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 297C;LEFT FISH TAIL;Sm;0;ON;;;;;N;;;;; 297D;RIGHT FISH TAIL;Sm;0;ON;;;;;N;;;;; 297E;UP FISH TAIL;Sm;0;ON;;;;;N;;;;; 297F;DOWN FISH TAIL;Sm;0;ON;;;;;N;;;;; 2980;TRIPLE VERTICAL BAR DELIMITER;Sm;0;ON;;;;;N;;;;; 2981;Z NOTATION SPOT;Sm;0;ON;;;;;N;;;;; 2982;Z NOTATION TYPE COLON;Sm;0;ON;;;;;N;;;;; 2983;LEFT WHITE CURLY BRACKET;Ps;0;ON;;;;;Y;;;;; 2984;RIGHT WHITE CURLY BRACKET;Pe;0;ON;;;;;Y;;;;; 2985;LEFT WHITE PARENTHESIS;Ps;0;ON;;;;;Y;;;;; 2986;RIGHT WHITE PARENTHESIS;Pe;0;ON;;;;;Y;;;;; 2987;Z NOTATION LEFT IMAGE BRACKET;Ps;0;ON;;;;;Y;;;;; 2988;Z NOTATION RIGHT IMAGE BRACKET;Pe;0;ON;;;;;Y;;;;; 2989;Z NOTATION LEFT BINDING BRACKET;Ps;0;ON;;;;;Y;;;;; 298A;Z NOTATION RIGHT BINDING BRACKET;Pe;0;ON;;;;;Y;;;;; 298B;LEFT SQUARE BRACKET WITH UNDERBAR;Ps;0;ON;;;;;Y;;;;; 298C;RIGHT SQUARE BRACKET WITH UNDERBAR;Pe;0;ON;;;;;Y;;;;; 298D;LEFT SQUARE BRACKET WITH TICK IN TOP CORNER;Ps;0;ON;;;;;Y;;;;; 298E;RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER;Pe;0;ON;;;;;Y;;;;; 298F;LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER;Ps;0;ON;;;;;Y;;;;; 2990;RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER;Pe;0;ON;;;;;Y;;;;; 2991;LEFT ANGLE BRACKET WITH DOT;Ps;0;ON;;;;;Y;;;;; 2992;RIGHT ANGLE BRACKET WITH DOT;Pe;0;ON;;;;;Y;;;;; 2993;LEFT ARC LESS-THAN BRACKET;Ps;0;ON;;;;;Y;;;;; 2994;RIGHT ARC GREATER-THAN BRACKET;Pe;0;ON;;;;;Y;;;;; 2995;DOUBLE LEFT ARC GREATER-THAN BRACKET;Ps;0;ON;;;;;Y;;;;; 2996;DOUBLE RIGHT ARC LESS-THAN BRACKET;Pe;0;ON;;;;;Y;;;;; 2997;LEFT BLACK TORTOISE SHELL BRACKET;Ps;0;ON;;;;;Y;;;;; 2998;RIGHT BLACK TORTOISE SHELL BRACKET;Pe;0;ON;;;;;Y;;;;; 2999;DOTTED FENCE;Sm;0;ON;;;;;N;;;;; 299A;VERTICAL ZIGZAG LINE;Sm;0;ON;;;;;N;;;;; 299B;MEASURED ANGLE OPENING LEFT;Sm;0;ON;;;;;Y;;;;; 299C;RIGHT ANGLE VARIANT WITH SQUARE;Sm;0;ON;;;;;Y;;;;; 299D;MEASURED RIGHT ANGLE WITH DOT;Sm;0;ON;;;;;Y;;;;; 299E;ANGLE WITH S INSIDE;Sm;0;ON;;;;;Y;;;;; 299F;ACUTE ANGLE;Sm;0;ON;;;;;Y;;;;; 29A0;SPHERICAL ANGLE OPENING LEFT;Sm;0;ON;;;;;Y;;;;; 29A1;SPHERICAL ANGLE OPENING UP;Sm;0;ON;;;;;Y;;;;; 29A2;TURNED ANGLE;Sm;0;ON;;;;;Y;;;;; 29A3;REVERSED ANGLE;Sm;0;ON;;;;;Y;;;;; 29A4;ANGLE WITH UNDERBAR;Sm;0;ON;;;;;Y;;;;; 29A5;REVERSED ANGLE WITH UNDERBAR;Sm;0;ON;;;;;Y;;;;; 29A6;OBLIQUE ANGLE OPENING UP;Sm;0;ON;;;;;Y;;;;; 29A7;OBLIQUE ANGLE OPENING DOWN;Sm;0;ON;;;;;Y;;;;; 29A8;MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND RIGHT;Sm;0;ON;;;;;Y;;;;; 29A9;MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND LEFT;Sm;0;ON;;;;;Y;;;;; 29AA;MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND RIGHT;Sm;0;ON;;;;;Y;;;;; 29AB;MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND LEFT;Sm;0;ON;;;;;Y;;;;; 29AC;MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND UP;Sm;0;ON;;;;;Y;;;;; 29AD;MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND UP;Sm;0;ON;;;;;Y;;;;; 29AE;MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND DOWN;Sm;0;ON;;;;;Y;;;;; 29AF;MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND DOWN;Sm;0;ON;;;;;Y;;;;; 29B0;REVERSED EMPTY SET;Sm;0;ON;;;;;N;;;;; 29B1;EMPTY SET WITH OVERBAR;Sm;0;ON;;;;;N;;;;; 29B2;EMPTY SET WITH SMALL CIRCLE ABOVE;Sm;0;ON;;;;;N;;;;; 29B3;EMPTY SET WITH RIGHT ARROW ABOVE;Sm;0;ON;;;;;N;;;;; 29B4;EMPTY SET WITH LEFT ARROW ABOVE;Sm;0;ON;;;;;N;;;;; 29B5;CIRCLE WITH HORIZONTAL BAR;Sm;0;ON;;;;;N;;;;; 29B6;CIRCLED VERTICAL BAR;Sm;0;ON;;;;;N;;;;; 29B7;CIRCLED PARALLEL;Sm;0;ON;;;;;N;;;;; 29B8;CIRCLED REVERSE SOLIDUS;Sm;0;ON;;;;;Y;;;;; 29B9;CIRCLED PERPENDICULAR;Sm;0;ON;;;;;N;;;;; 29BA;CIRCLE DIVIDED BY HORIZONTAL BAR AND TOP HALF DIVIDED BY VERTICAL BAR;Sm;0;ON;;;;;N;;;;; 29BB;CIRCLE WITH SUPERIMPOSED X;Sm;0;ON;;;;;N;;;;; 29BC;CIRCLED ANTICLOCKWISE-ROTATED DIVISION SIGN;Sm;0;ON;;;;;N;;;;; 29BD;UP ARROW THROUGH CIRCLE;Sm;0;ON;;;;;N;;;;; 29BE;CIRCLED WHITE BULLET;Sm;0;ON;;;;;N;;;;; 29BF;CIRCLED BULLET;Sm;0;ON;;;;;N;;;;; 29C0;CIRCLED LESS-THAN;Sm;0;ON;;;;;Y;;;;; 29C1;CIRCLED GREATER-THAN;Sm;0;ON;;;;;Y;;;;; 29C2;CIRCLE WITH SMALL CIRCLE TO THE RIGHT;Sm;0;ON;;;;;Y;;;;; 29C3;CIRCLE WITH TWO HORIZONTAL STROKES TO THE RIGHT;Sm;0;ON;;;;;Y;;;;; 29C4;SQUARED RISING DIAGONAL SLASH;Sm;0;ON;;;;;Y;;;;; 29C5;SQUARED FALLING DIAGONAL SLASH;Sm;0;ON;;;;;Y;;;;; 29C6;SQUARED ASTERISK;Sm;0;ON;;;;;N;;;;; 29C7;SQUARED SMALL CIRCLE;Sm;0;ON;;;;;N;;;;; 29C8;SQUARED SQUARE;Sm;0;ON;;;;;N;;;;; 29C9;TWO JOINED SQUARES;Sm;0;ON;;;;;Y;;;;; 29CA;TRIANGLE WITH DOT ABOVE;Sm;0;ON;;;;;N;;;;; 29CB;TRIANGLE WITH UNDERBAR;Sm;0;ON;;;;;N;;;;; 29CC;S IN TRIANGLE;Sm;0;ON;;;;;N;;;;; 29CD;TRIANGLE WITH SERIFS AT BOTTOM;Sm;0;ON;;;;;N;;;;; 29CE;RIGHT TRIANGLE ABOVE LEFT TRIANGLE;Sm;0;ON;;;;;Y;;;;; 29CF;LEFT TRIANGLE BESIDE VERTICAL BAR;Sm;0;ON;;;;;Y;;;;; 29D0;VERTICAL BAR BESIDE RIGHT TRIANGLE;Sm;0;ON;;;;;Y;;;;; 29D1;BOWTIE WITH LEFT HALF BLACK;Sm;0;ON;;;;;Y;;;;; 29D2;BOWTIE WITH RIGHT HALF BLACK;Sm;0;ON;;;;;Y;;;;; 29D3;BLACK BOWTIE;Sm;0;ON;;;;;N;;;;; 29D4;TIMES WITH LEFT HALF BLACK;Sm;0;ON;;;;;Y;;;;; 29D5;TIMES WITH RIGHT HALF BLACK;Sm;0;ON;;;;;Y;;;;; 29D6;WHITE HOURGLASS;Sm;0;ON;;;;;N;;;;; 29D7;BLACK HOURGLASS;Sm;0;ON;;;;;N;;;;; 29D8;LEFT WIGGLY FENCE;Ps;0;ON;;;;;Y;;;;; 29D9;RIGHT WIGGLY FENCE;Pe;0;ON;;;;;Y;;;;; 29DA;LEFT DOUBLE WIGGLY FENCE;Ps;0;ON;;;;;Y;;;;; 29DB;RIGHT DOUBLE WIGGLY FENCE;Pe;0;ON;;;;;Y;;;;; 29DC;INCOMPLETE INFINITY;Sm;0;ON;;;;;Y;;;;; 29DD;TIE OVER INFINITY;Sm;0;ON;;;;;N;;;;; 29DE;INFINITY NEGATED WITH VERTICAL BAR;Sm;0;ON;;;;;N;;;;; 29DF;DOUBLE-ENDED MULTIMAP;Sm;0;ON;;;;;N;;;;; 29E0;SQUARE WITH CONTOURED OUTLINE;Sm;0;ON;;;;;N;;;;; 29E1;INCREASES AS;Sm;0;ON;;;;;Y;;;;; 29E2;SHUFFLE PRODUCT;Sm;0;ON;;;;;N;;;;; 29E3;EQUALS SIGN AND SLANTED PARALLEL;Sm;0;ON;;;;;Y;;;;; 29E4;EQUALS SIGN AND SLANTED PARALLEL WITH TILDE ABOVE;Sm;0;ON;;;;;Y;;;;; 29E5;IDENTICAL TO AND SLANTED PARALLEL;Sm;0;ON;;;;;Y;;;;; 29E6;GLEICH STARK;Sm;0;ON;;;;;N;;;;; 29E7;THERMODYNAMIC;Sm;0;ON;;;;;N;;;;; 29E8;DOWN-POINTING TRIANGLE WITH LEFT HALF BLACK;Sm;0;ON;;;;;Y;;;;; 29E9;DOWN-POINTING TRIANGLE WITH RIGHT HALF BLACK;Sm;0;ON;;;;;Y;;;;; 29EA;BLACK DIAMOND WITH DOWN ARROW;Sm;0;ON;;;;;N;;;;; 29EB;BLACK LOZENGE;Sm;0;ON;;;;;N;;;;; 29EC;WHITE CIRCLE WITH DOWN ARROW;Sm;0;ON;;;;;N;;;;; 29ED;BLACK CIRCLE WITH DOWN ARROW;Sm;0;ON;;;;;N;;;;; 29EE;ERROR-BARRED WHITE SQUARE;Sm;0;ON;;;;;N;;;;; 29EF;ERROR-BARRED BLACK SQUARE;Sm;0;ON;;;;;N;;;;; 29F0;ERROR-BARRED WHITE DIAMOND;Sm;0;ON;;;;;N;;;;; 29F1;ERROR-BARRED BLACK DIAMOND;Sm;0;ON;;;;;N;;;;; 29F2;ERROR-BARRED WHITE CIRCLE;Sm;0;ON;;;;;N;;;;; 29F3;ERROR-BARRED BLACK CIRCLE;Sm;0;ON;;;;;N;;;;; 29F4;RULE-DELAYED;Sm;0;ON;;;;;Y;;;;; 29F5;REVERSE SOLIDUS OPERATOR;Sm;0;ON;;;;;Y;;;;; 29F6;SOLIDUS WITH OVERBAR;Sm;0;ON;;;;;Y;;;;; 29F7;REVERSE SOLIDUS WITH HORIZONTAL STROKE;Sm;0;ON;;;;;Y;;;;; 29F8;BIG SOLIDUS;Sm;0;ON;;;;;Y;;;;; 29F9;BIG REVERSE SOLIDUS;Sm;0;ON;;;;;Y;;;;; 29FA;DOUBLE PLUS;Sm;0;ON;;;;;N;;;;; 29FB;TRIPLE PLUS;Sm;0;ON;;;;;N;;;;; 29FC;LEFT-POINTING CURVED ANGLE BRACKET;Ps;0;ON;;;;;Y;;;;; 29FD;RIGHT-POINTING CURVED ANGLE BRACKET;Pe;0;ON;;;;;Y;;;;; 29FE;TINY;Sm;0;ON;;;;;N;;;;; 29FF;MINY;Sm;0;ON;;;;;N;;;;; 2A00;N-ARY CIRCLED DOT OPERATOR;Sm;0;ON;;;;;N;;;;; 2A01;N-ARY CIRCLED PLUS OPERATOR;Sm;0;ON;;;;;N;;;;; 2A02;N-ARY CIRCLED TIMES OPERATOR;Sm;0;ON;;;;;N;;;;; 2A03;N-ARY UNION OPERATOR WITH DOT;Sm;0;ON;;;;;N;;;;; 2A04;N-ARY UNION OPERATOR WITH PLUS;Sm;0;ON;;;;;N;;;;; 2A05;N-ARY SQUARE INTERSECTION OPERATOR;Sm;0;ON;;;;;N;;;;; 2A06;N-ARY SQUARE UNION OPERATOR;Sm;0;ON;;;;;N;;;;; 2A07;TWO LOGICAL AND OPERATOR;Sm;0;ON;;;;;N;;;;; 2A08;TWO LOGICAL OR OPERATOR;Sm;0;ON;;;;;N;;;;; 2A09;N-ARY TIMES OPERATOR;Sm;0;ON;;;;;N;;;;; 2A0A;MODULO TWO SUM;Sm;0;ON;;;;;Y;;;;; 2A0B;SUMMATION WITH INTEGRAL;Sm;0;ON;;;;;Y;;;;; 2A0C;QUADRUPLE INTEGRAL OPERATOR;Sm;0;ON; 222B 222B 222B 222B;;;;Y;;;;; 2A0D;FINITE PART INTEGRAL;Sm;0;ON;;;;;Y;;;;; 2A0E;INTEGRAL WITH DOUBLE STROKE;Sm;0;ON;;;;;Y;;;;; 2A0F;INTEGRAL AVERAGE WITH SLASH;Sm;0;ON;;;;;Y;;;;; 2A10;CIRCULATION FUNCTION;Sm;0;ON;;;;;Y;;;;; 2A11;ANTICLOCKWISE INTEGRATION;Sm;0;ON;;;;;Y;;;;; 2A12;LINE INTEGRATION WITH RECTANGULAR PATH AROUND POLE;Sm;0;ON;;;;;Y;;;;; 2A13;LINE INTEGRATION WITH SEMICIRCULAR PATH AROUND POLE;Sm;0;ON;;;;;Y;;;;; 2A14;LINE INTEGRATION NOT INCLUDING THE POLE;Sm;0;ON;;;;;Y;;;;; 2A15;INTEGRAL AROUND A POINT OPERATOR;Sm;0;ON;;;;;Y;;;;; 2A16;QUATERNION INTEGRAL OPERATOR;Sm;0;ON;;;;;Y;;;;; 2A17;INTEGRAL WITH LEFTWARDS ARROW WITH HOOK;Sm;0;ON;;;;;Y;;;;; 2A18;INTEGRAL WITH TIMES SIGN;Sm;0;ON;;;;;Y;;;;; 2A19;INTEGRAL WITH INTERSECTION;Sm;0;ON;;;;;Y;;;;; 2A1A;INTEGRAL WITH UNION;Sm;0;ON;;;;;Y;;;;; 2A1B;INTEGRAL WITH OVERBAR;Sm;0;ON;;;;;Y;;;;; 2A1C;INTEGRAL WITH UNDERBAR;Sm;0;ON;;;;;Y;;;;; 2A1D;JOIN;Sm;0;ON;;;;;N;;;;; 2A1E;LARGE LEFT TRIANGLE OPERATOR;Sm;0;ON;;;;;Y;;;;; 2A1F;Z NOTATION SCHEMA COMPOSITION;Sm;0;ON;;;;;Y;;;;; 2A20;Z NOTATION SCHEMA PIPING;Sm;0;ON;;;;;Y;;;;; 2A21;Z NOTATION SCHEMA PROJECTION;Sm;0;ON;;;;;Y;;;;; 2A22;PLUS SIGN WITH SMALL CIRCLE ABOVE;Sm;0;ON;;;;;N;;;;; 2A23;PLUS SIGN WITH CIRCUMFLEX ACCENT ABOVE;Sm;0;ON;;;;;N;;;;; 2A24;PLUS SIGN WITH TILDE ABOVE;Sm;0;ON;;;;;Y;;;;; 2A25;PLUS SIGN WITH DOT BELOW;Sm;0;ON;;;;;N;;;;; 2A26;PLUS SIGN WITH TILDE BELOW;Sm;0;ON;;;;;Y;;;;; 2A27;PLUS SIGN WITH SUBSCRIPT TWO;Sm;0;ON;;;;;N;;;;; 2A28;PLUS SIGN WITH BLACK TRIANGLE;Sm;0;ON;;;;;N;;;;; 2A29;MINUS SIGN WITH COMMA ABOVE;Sm;0;ON;;;;;Y;;;;; 2A2A;MINUS SIGN WITH DOT BELOW;Sm;0;ON;;;;;N;;;;; 2A2B;MINUS SIGN WITH FALLING DOTS;Sm;0;ON;;;;;Y;;;;; 2A2C;MINUS SIGN WITH RISING DOTS;Sm;0;ON;;;;;Y;;;;; 2A2D;PLUS SIGN IN LEFT HALF CIRCLE;Sm;0;ON;;;;;Y;;;;; 2A2E;PLUS SIGN IN RIGHT HALF CIRCLE;Sm;0;ON;;;;;Y;;;;; 2A2F;VECTOR OR CROSS PRODUCT;Sm;0;ON;;;;;N;;;;; 2A30;MULTIPLICATION SIGN WITH DOT ABOVE;Sm;0;ON;;;;;N;;;;; 2A31;MULTIPLICATION SIGN WITH UNDERBAR;Sm;0;ON;;;;;N;;;;; 2A32;SEMIDIRECT PRODUCT WITH BOTTOM CLOSED;Sm;0;ON;;;;;N;;;;; 2A33;SMASH PRODUCT;Sm;0;ON;;;;;N;;;;; 2A34;MULTIPLICATION SIGN IN LEFT HALF CIRCLE;Sm;0;ON;;;;;Y;;;;; 2A35;MULTIPLICATION SIGN IN RIGHT HALF CIRCLE;Sm;0;ON;;;;;Y;;;;; 2A36;CIRCLED MULTIPLICATION SIGN WITH CIRCUMFLEX ACCENT;Sm;0;ON;;;;;N;;;;; 2A37;MULTIPLICATION SIGN IN DOUBLE CIRCLE;Sm;0;ON;;;;;N;;;;; 2A38;CIRCLED DIVISION SIGN;Sm;0;ON;;;;;N;;;;; 2A39;PLUS SIGN IN TRIANGLE;Sm;0;ON;;;;;N;;;;; 2A3A;MINUS SIGN IN TRIANGLE;Sm;0;ON;;;;;N;;;;; 2A3B;MULTIPLICATION SIGN IN TRIANGLE;Sm;0;ON;;;;;N;;;;; 2A3C;INTERIOR PRODUCT;Sm;0;ON;;;;;Y;;;;; 2A3D;RIGHTHAND INTERIOR PRODUCT;Sm;0;ON;;;;;Y;;;;; 2A3E;Z NOTATION RELATIONAL COMPOSITION;Sm;0;ON;;;;;Y;;;;; 2A3F;AMALGAMATION OR COPRODUCT;Sm;0;ON;;;;;N;;;;; 2A40;INTERSECTION WITH DOT;Sm;0;ON;;;;;N;;;;; 2A41;UNION WITH MINUS SIGN;Sm;0;ON;;;;;N;;;;; 2A42;UNION WITH OVERBAR;Sm;0;ON;;;;;N;;;;; 2A43;INTERSECTION WITH OVERBAR;Sm;0;ON;;;;;N;;;;; 2A44;INTERSECTION WITH LOGICAL AND;Sm;0;ON;;;;;N;;;;; 2A45;UNION WITH LOGICAL OR;Sm;0;ON;;;;;N;;;;; 2A46;UNION ABOVE INTERSECTION;Sm;0;ON;;;;;N;;;;; 2A47;INTERSECTION ABOVE UNION;Sm;0;ON;;;;;N;;;;; 2A48;UNION ABOVE BAR ABOVE INTERSECTION;Sm;0;ON;;;;;N;;;;; 2A49;INTERSECTION ABOVE BAR ABOVE UNION;Sm;0;ON;;;;;N;;;;; 2A4A;UNION BESIDE AND JOINED WITH UNION;Sm;0;ON;;;;;N;;;;; 2A4B;INTERSECTION BESIDE AND JOINED WITH INTERSECTION;Sm;0;ON;;;;;N;;;;; 2A4C;CLOSED UNION WITH SERIFS;Sm;0;ON;;;;;N;;;;; 2A4D;CLOSED INTERSECTION WITH SERIFS;Sm;0;ON;;;;;N;;;;; 2A4E;DOUBLE SQUARE INTERSECTION;Sm;0;ON;;;;;N;;;;; 2A4F;DOUBLE SQUARE UNION;Sm;0;ON;;;;;N;;;;; 2A50;CLOSED UNION WITH SERIFS AND SMASH PRODUCT;Sm;0;ON;;;;;N;;;;; 2A51;LOGICAL AND WITH DOT ABOVE;Sm;0;ON;;;;;N;;;;; 2A52;LOGICAL OR WITH DOT ABOVE;Sm;0;ON;;;;;N;;;;; 2A53;DOUBLE LOGICAL AND;Sm;0;ON;;;;;N;;;;; 2A54;DOUBLE LOGICAL OR;Sm;0;ON;;;;;N;;;;; 2A55;TWO INTERSECTING LOGICAL AND;Sm;0;ON;;;;;N;;;;; 2A56;TWO INTERSECTING LOGICAL OR;Sm;0;ON;;;;;N;;;;; 2A57;SLOPING LARGE OR;Sm;0;ON;;;;;Y;;;;; 2A58;SLOPING LARGE AND;Sm;0;ON;;;;;Y;;;;; 2A59;LOGICAL OR OVERLAPPING LOGICAL AND;Sm;0;ON;;;;;N;;;;; 2A5A;LOGICAL AND WITH MIDDLE STEM;Sm;0;ON;;;;;N;;;;; 2A5B;LOGICAL OR WITH MIDDLE STEM;Sm;0;ON;;;;;N;;;;; 2A5C;LOGICAL AND WITH HORIZONTAL DASH;Sm;0;ON;;;;;N;;;;; 2A5D;LOGICAL OR WITH HORIZONTAL DASH;Sm;0;ON;;;;;N;;;;; 2A5E;LOGICAL AND WITH DOUBLE OVERBAR;Sm;0;ON;;;;;N;;;;; 2A5F;LOGICAL AND WITH UNDERBAR;Sm;0;ON;;;;;N;;;;; 2A60;LOGICAL AND WITH DOUBLE UNDERBAR;Sm;0;ON;;;;;N;;;;; 2A61;SMALL VEE WITH UNDERBAR;Sm;0;ON;;;;;N;;;;; 2A62;LOGICAL OR WITH DOUBLE OVERBAR;Sm;0;ON;;;;;N;;;;; 2A63;LOGICAL OR WITH DOUBLE UNDERBAR;Sm;0;ON;;;;;N;;;;; 2A64;Z NOTATION DOMAIN ANTIRESTRICTION;Sm;0;ON;;;;;Y;;;;; 2A65;Z NOTATION RANGE ANTIRESTRICTION;Sm;0;ON;;;;;Y;;;;; 2A66;EQUALS SIGN WITH DOT BELOW;Sm;0;ON;;;;;N;;;;; 2A67;IDENTICAL WITH DOT ABOVE;Sm;0;ON;;;;;N;;;;; 2A68;TRIPLE HORIZONTAL BAR WITH DOUBLE VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2A69;TRIPLE HORIZONTAL BAR WITH TRIPLE VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2A6A;TILDE OPERATOR WITH DOT ABOVE;Sm;0;ON;;;;;Y;;;;; 2A6B;TILDE OPERATOR WITH RISING DOTS;Sm;0;ON;;;;;Y;;;;; 2A6C;SIMILAR MINUS SIMILAR;Sm;0;ON;;;;;Y;;;;; 2A6D;CONGRUENT WITH DOT ABOVE;Sm;0;ON;;;;;Y;;;;; 2A6E;EQUALS WITH ASTERISK;Sm;0;ON;;;;;N;;;;; 2A6F;ALMOST EQUAL TO WITH CIRCUMFLEX ACCENT;Sm;0;ON;;;;;Y;;;;; 2A70;APPROXIMATELY EQUAL OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2A71;EQUALS SIGN ABOVE PLUS SIGN;Sm;0;ON;;;;;N;;;;; 2A72;PLUS SIGN ABOVE EQUALS SIGN;Sm;0;ON;;;;;N;;;;; 2A73;EQUALS SIGN ABOVE TILDE OPERATOR;Sm;0;ON;;;;;Y;;;;; 2A74;DOUBLE COLON EQUAL;Sm;0;ON; 003A 003A 003D;;;;Y;;;;; 2A75;TWO CONSECUTIVE EQUALS SIGNS;Sm;0;ON; 003D 003D;;;;N;;;;; 2A76;THREE CONSECUTIVE EQUALS SIGNS;Sm;0;ON; 003D 003D 003D;;;;N;;;;; 2A77;EQUALS SIGN WITH TWO DOTS ABOVE AND TWO DOTS BELOW;Sm;0;ON;;;;;N;;;;; 2A78;EQUIVALENT WITH FOUR DOTS ABOVE;Sm;0;ON;;;;;N;;;;; 2A79;LESS-THAN WITH CIRCLE INSIDE;Sm;0;ON;;;;;Y;;;;; 2A7A;GREATER-THAN WITH CIRCLE INSIDE;Sm;0;ON;;;;;Y;;;;; 2A7B;LESS-THAN WITH QUESTION MARK ABOVE;Sm;0;ON;;;;;Y;;;;; 2A7C;GREATER-THAN WITH QUESTION MARK ABOVE;Sm;0;ON;;;;;Y;;;;; 2A7D;LESS-THAN OR SLANTED EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2A7E;GREATER-THAN OR SLANTED EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2A7F;LESS-THAN OR SLANTED EQUAL TO WITH DOT INSIDE;Sm;0;ON;;;;;Y;;;;; 2A80;GREATER-THAN OR SLANTED EQUAL TO WITH DOT INSIDE;Sm;0;ON;;;;;Y;;;;; 2A81;LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE;Sm;0;ON;;;;;Y;;;;; 2A82;GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE;Sm;0;ON;;;;;Y;;;;; 2A83;LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE RIGHT;Sm;0;ON;;;;;Y;;;;; 2A84;GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE LEFT;Sm;0;ON;;;;;Y;;;;; 2A85;LESS-THAN OR APPROXIMATE;Sm;0;ON;;;;;Y;;;;; 2A86;GREATER-THAN OR APPROXIMATE;Sm;0;ON;;;;;Y;;;;; 2A87;LESS-THAN AND SINGLE-LINE NOT EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2A88;GREATER-THAN AND SINGLE-LINE NOT EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2A89;LESS-THAN AND NOT APPROXIMATE;Sm;0;ON;;;;;Y;;;;; 2A8A;GREATER-THAN AND NOT APPROXIMATE;Sm;0;ON;;;;;Y;;;;; 2A8B;LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN;Sm;0;ON;;;;;Y;;;;; 2A8C;GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN;Sm;0;ON;;;;;Y;;;;; 2A8D;LESS-THAN ABOVE SIMILAR OR EQUAL;Sm;0;ON;;;;;Y;;;;; 2A8E;GREATER-THAN ABOVE SIMILAR OR EQUAL;Sm;0;ON;;;;;Y;;;;; 2A8F;LESS-THAN ABOVE SIMILAR ABOVE GREATER-THAN;Sm;0;ON;;;;;Y;;;;; 2A90;GREATER-THAN ABOVE SIMILAR ABOVE LESS-THAN;Sm;0;ON;;;;;Y;;;;; 2A91;LESS-THAN ABOVE GREATER-THAN ABOVE DOUBLE-LINE EQUAL;Sm;0;ON;;;;;Y;;;;; 2A92;GREATER-THAN ABOVE LESS-THAN ABOVE DOUBLE-LINE EQUAL;Sm;0;ON;;;;;Y;;;;; 2A93;LESS-THAN ABOVE SLANTED EQUAL ABOVE GREATER-THAN ABOVE SLANTED EQUAL;Sm;0;ON;;;;;Y;;;;; 2A94;GREATER-THAN ABOVE SLANTED EQUAL ABOVE LESS-THAN ABOVE SLANTED EQUAL;Sm;0;ON;;;;;Y;;;;; 2A95;SLANTED EQUAL TO OR LESS-THAN;Sm;0;ON;;;;;Y;;;;; 2A96;SLANTED EQUAL TO OR GREATER-THAN;Sm;0;ON;;;;;Y;;;;; 2A97;SLANTED EQUAL TO OR LESS-THAN WITH DOT INSIDE;Sm;0;ON;;;;;Y;;;;; 2A98;SLANTED EQUAL TO OR GREATER-THAN WITH DOT INSIDE;Sm;0;ON;;;;;Y;;;;; 2A99;DOUBLE-LINE EQUAL TO OR LESS-THAN;Sm;0;ON;;;;;Y;;;;; 2A9A;DOUBLE-LINE EQUAL TO OR GREATER-THAN;Sm;0;ON;;;;;Y;;;;; 2A9B;DOUBLE-LINE SLANTED EQUAL TO OR LESS-THAN;Sm;0;ON;;;;;Y;;;;; 2A9C;DOUBLE-LINE SLANTED EQUAL TO OR GREATER-THAN;Sm;0;ON;;;;;Y;;;;; 2A9D;SIMILAR OR LESS-THAN;Sm;0;ON;;;;;Y;;;;; 2A9E;SIMILAR OR GREATER-THAN;Sm;0;ON;;;;;Y;;;;; 2A9F;SIMILAR ABOVE LESS-THAN ABOVE EQUALS SIGN;Sm;0;ON;;;;;Y;;;;; 2AA0;SIMILAR ABOVE GREATER-THAN ABOVE EQUALS SIGN;Sm;0;ON;;;;;Y;;;;; 2AA1;DOUBLE NESTED LESS-THAN;Sm;0;ON;;;;;Y;;;;; 2AA2;DOUBLE NESTED GREATER-THAN;Sm;0;ON;;;;;Y;;;;; 2AA3;DOUBLE NESTED LESS-THAN WITH UNDERBAR;Sm;0;ON;;;;;Y;;;;; 2AA4;GREATER-THAN OVERLAPPING LESS-THAN;Sm;0;ON;;;;;N;;;;; 2AA5;GREATER-THAN BESIDE LESS-THAN;Sm;0;ON;;;;;N;;;;; 2AA6;LESS-THAN CLOSED BY CURVE;Sm;0;ON;;;;;Y;;;;; 2AA7;GREATER-THAN CLOSED BY CURVE;Sm;0;ON;;;;;Y;;;;; 2AA8;LESS-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL;Sm;0;ON;;;;;Y;;;;; 2AA9;GREATER-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL;Sm;0;ON;;;;;Y;;;;; 2AAA;SMALLER THAN;Sm;0;ON;;;;;Y;;;;; 2AAB;LARGER THAN;Sm;0;ON;;;;;Y;;;;; 2AAC;SMALLER THAN OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2AAD;LARGER THAN OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2AAE;EQUALS SIGN WITH BUMPY ABOVE;Sm;0;ON;;;;;N;;;;; 2AAF;PRECEDES ABOVE SINGLE-LINE EQUALS SIGN;Sm;0;ON;;;;;Y;;;;; 2AB0;SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN;Sm;0;ON;;;;;Y;;;;; 2AB1;PRECEDES ABOVE SINGLE-LINE NOT EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2AB2;SUCCEEDS ABOVE SINGLE-LINE NOT EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2AB3;PRECEDES ABOVE EQUALS SIGN;Sm;0;ON;;;;;Y;;;;; 2AB4;SUCCEEDS ABOVE EQUALS SIGN;Sm;0;ON;;;;;Y;;;;; 2AB5;PRECEDES ABOVE NOT EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2AB6;SUCCEEDS ABOVE NOT EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2AB7;PRECEDES ABOVE ALMOST EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2AB8;SUCCEEDS ABOVE ALMOST EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2AB9;PRECEDES ABOVE NOT ALMOST EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2ABA;SUCCEEDS ABOVE NOT ALMOST EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2ABB;DOUBLE PRECEDES;Sm;0;ON;;;;;Y;;;;; 2ABC;DOUBLE SUCCEEDS;Sm;0;ON;;;;;Y;;;;; 2ABD;SUBSET WITH DOT;Sm;0;ON;;;;;Y;;;;; 2ABE;SUPERSET WITH DOT;Sm;0;ON;;;;;Y;;;;; 2ABF;SUBSET WITH PLUS SIGN BELOW;Sm;0;ON;;;;;Y;;;;; 2AC0;SUPERSET WITH PLUS SIGN BELOW;Sm;0;ON;;;;;Y;;;;; 2AC1;SUBSET WITH MULTIPLICATION SIGN BELOW;Sm;0;ON;;;;;Y;;;;; 2AC2;SUPERSET WITH MULTIPLICATION SIGN BELOW;Sm;0;ON;;;;;Y;;;;; 2AC3;SUBSET OF OR EQUAL TO WITH DOT ABOVE;Sm;0;ON;;;;;Y;;;;; 2AC4;SUPERSET OF OR EQUAL TO WITH DOT ABOVE;Sm;0;ON;;;;;Y;;;;; 2AC5;SUBSET OF ABOVE EQUALS SIGN;Sm;0;ON;;;;;Y;;;;; 2AC6;SUPERSET OF ABOVE EQUALS SIGN;Sm;0;ON;;;;;Y;;;;; 2AC7;SUBSET OF ABOVE TILDE OPERATOR;Sm;0;ON;;;;;Y;;;;; 2AC8;SUPERSET OF ABOVE TILDE OPERATOR;Sm;0;ON;;;;;Y;;;;; 2AC9;SUBSET OF ABOVE ALMOST EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2ACA;SUPERSET OF ABOVE ALMOST EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2ACB;SUBSET OF ABOVE NOT EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2ACC;SUPERSET OF ABOVE NOT EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2ACD;SQUARE LEFT OPEN BOX OPERATOR;Sm;0;ON;;;;;Y;;;;; 2ACE;SQUARE RIGHT OPEN BOX OPERATOR;Sm;0;ON;;;;;Y;;;;; 2ACF;CLOSED SUBSET;Sm;0;ON;;;;;Y;;;;; 2AD0;CLOSED SUPERSET;Sm;0;ON;;;;;Y;;;;; 2AD1;CLOSED SUBSET OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2AD2;CLOSED SUPERSET OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2AD3;SUBSET ABOVE SUPERSET;Sm;0;ON;;;;;Y;;;;; 2AD4;SUPERSET ABOVE SUBSET;Sm;0;ON;;;;;Y;;;;; 2AD5;SUBSET ABOVE SUBSET;Sm;0;ON;;;;;Y;;;;; 2AD6;SUPERSET ABOVE SUPERSET;Sm;0;ON;;;;;Y;;;;; 2AD7;SUPERSET BESIDE SUBSET;Sm;0;ON;;;;;N;;;;; 2AD8;SUPERSET BESIDE AND JOINED BY DASH WITH SUBSET;Sm;0;ON;;;;;N;;;;; 2AD9;ELEMENT OF OPENING DOWNWARDS;Sm;0;ON;;;;;N;;;;; 2ADA;PITCHFORK WITH TEE TOP;Sm;0;ON;;;;;N;;;;; 2ADB;TRANSVERSAL INTERSECTION;Sm;0;ON;;;;;N;;;;; 2ADC;FORKING;Sm;0;ON;2ADD 0338;;;;Y;;;;; 2ADD;NONFORKING;Sm;0;ON;;;;;N;;;;; 2ADE;SHORT LEFT TACK;Sm;0;ON;;;;;Y;;;;; 2ADF;SHORT DOWN TACK;Sm;0;ON;;;;;N;;;;; 2AE0;SHORT UP TACK;Sm;0;ON;;;;;N;;;;; 2AE1;PERPENDICULAR WITH S;Sm;0;ON;;;;;N;;;;; 2AE2;VERTICAL BAR TRIPLE RIGHT TURNSTILE;Sm;0;ON;;;;;Y;;;;; 2AE3;DOUBLE VERTICAL BAR LEFT TURNSTILE;Sm;0;ON;;;;;Y;;;;; 2AE4;VERTICAL BAR DOUBLE LEFT TURNSTILE;Sm;0;ON;;;;;Y;;;;; 2AE5;DOUBLE VERTICAL BAR DOUBLE LEFT TURNSTILE;Sm;0;ON;;;;;Y;;;;; 2AE6;LONG DASH FROM LEFT MEMBER OF DOUBLE VERTICAL;Sm;0;ON;;;;;Y;;;;; 2AE7;SHORT DOWN TACK WITH OVERBAR;Sm;0;ON;;;;;N;;;;; 2AE8;SHORT UP TACK WITH UNDERBAR;Sm;0;ON;;;;;N;;;;; 2AE9;SHORT UP TACK ABOVE SHORT DOWN TACK;Sm;0;ON;;;;;N;;;;; 2AEA;DOUBLE DOWN TACK;Sm;0;ON;;;;;N;;;;; 2AEB;DOUBLE UP TACK;Sm;0;ON;;;;;N;;;;; 2AEC;DOUBLE STROKE NOT SIGN;Sm;0;ON;;;;;Y;;;;; 2AED;REVERSED DOUBLE STROKE NOT SIGN;Sm;0;ON;;;;;Y;;;;; 2AEE;DOES NOT DIVIDE WITH REVERSED NEGATION SLASH;Sm;0;ON;;;;;Y;;;;; 2AEF;VERTICAL LINE WITH CIRCLE ABOVE;Sm;0;ON;;;;;N;;;;; 2AF0;VERTICAL LINE WITH CIRCLE BELOW;Sm;0;ON;;;;;N;;;;; 2AF1;DOWN TACK WITH CIRCLE BELOW;Sm;0;ON;;;;;N;;;;; 2AF2;PARALLEL WITH HORIZONTAL STROKE;Sm;0;ON;;;;;N;;;;; 2AF3;PARALLEL WITH TILDE OPERATOR;Sm;0;ON;;;;;Y;;;;; 2AF4;TRIPLE VERTICAL BAR BINARY RELATION;Sm;0;ON;;;;;N;;;;; 2AF5;TRIPLE VERTICAL BAR WITH HORIZONTAL STROKE;Sm;0;ON;;;;;N;;;;; 2AF6;TRIPLE COLON OPERATOR;Sm;0;ON;;;;;N;;;;; 2AF7;TRIPLE NESTED LESS-THAN;Sm;0;ON;;;;;Y;;;;; 2AF8;TRIPLE NESTED GREATER-THAN;Sm;0;ON;;;;;Y;;;;; 2AF9;DOUBLE-LINE SLANTED LESS-THAN OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2AFA;DOUBLE-LINE SLANTED GREATER-THAN OR EQUAL TO;Sm;0;ON;;;;;Y;;;;; 2AFB;TRIPLE SOLIDUS BINARY RELATION;Sm;0;ON;;;;;Y;;;;; 2AFC;LARGE TRIPLE VERTICAL BAR OPERATOR;Sm;0;ON;;;;;N;;;;; 2AFD;DOUBLE SOLIDUS OPERATOR;Sm;0;ON;;;;;Y;;;;; 2AFE;WHITE VERTICAL BAR;Sm;0;ON;;;;;N;;;;; 2AFF;N-ARY WHITE VERTICAL BAR;Sm;0;ON;;;;;N;;;;; 2B00;NORTH EAST WHITE ARROW;So;0;ON;;;;;N;;;;; 2B01;NORTH WEST WHITE ARROW;So;0;ON;;;;;N;;;;; 2B02;SOUTH EAST WHITE ARROW;So;0;ON;;;;;N;;;;; 2B03;SOUTH WEST WHITE ARROW;So;0;ON;;;;;N;;;;; 2B04;LEFT RIGHT WHITE ARROW;So;0;ON;;;;;N;;;;; 2B05;LEFTWARDS BLACK ARROW;So;0;ON;;;;;N;;;;; 2B06;UPWARDS BLACK ARROW;So;0;ON;;;;;N;;;;; 2B07;DOWNWARDS BLACK ARROW;So;0;ON;;;;;N;;;;; 2B08;NORTH EAST BLACK ARROW;So;0;ON;;;;;N;;;;; 2B09;NORTH WEST BLACK ARROW;So;0;ON;;;;;N;;;;; 2B0A;SOUTH EAST BLACK ARROW;So;0;ON;;;;;N;;;;; 2B0B;SOUTH WEST BLACK ARROW;So;0;ON;;;;;N;;;;; 2B0C;LEFT RIGHT BLACK ARROW;So;0;ON;;;;;N;;;;; 2B0D;UP DOWN BLACK ARROW;So;0;ON;;;;;N;;;;; 2B0E;RIGHTWARDS ARROW WITH TIP DOWNWARDS;So;0;ON;;;;;N;;;;; 2B0F;RIGHTWARDS ARROW WITH TIP UPWARDS;So;0;ON;;;;;N;;;;; 2B10;LEFTWARDS ARROW WITH TIP DOWNWARDS;So;0;ON;;;;;N;;;;; 2B11;LEFTWARDS ARROW WITH TIP UPWARDS;So;0;ON;;;;;N;;;;; 2B12;SQUARE WITH TOP HALF BLACK;So;0;ON;;;;;N;;;;; 2B13;SQUARE WITH BOTTOM HALF BLACK;So;0;ON;;;;;N;;;;; 2B14;SQUARE WITH UPPER RIGHT DIAGONAL HALF BLACK;So;0;ON;;;;;N;;;;; 2B15;SQUARE WITH LOWER LEFT DIAGONAL HALF BLACK;So;0;ON;;;;;N;;;;; 2B16;DIAMOND WITH LEFT HALF BLACK;So;0;ON;;;;;N;;;;; 2B17;DIAMOND WITH RIGHT HALF BLACK;So;0;ON;;;;;N;;;;; 2B18;DIAMOND WITH TOP HALF BLACK;So;0;ON;;;;;N;;;;; 2B19;DIAMOND WITH BOTTOM HALF BLACK;So;0;ON;;;;;N;;;;; 2B1A;DOTTED SQUARE;So;0;ON;;;;;N;;;;; 2B1B;BLACK LARGE SQUARE;So;0;ON;;;;;N;;;;; 2B1C;WHITE LARGE SQUARE;So;0;ON;;;;;N;;;;; 2B1D;BLACK VERY SMALL SQUARE;So;0;ON;;;;;N;;;;; 2B1E;WHITE VERY SMALL SQUARE;So;0;ON;;;;;N;;;;; 2B1F;BLACK PENTAGON;So;0;ON;;;;;N;;;;; 2B20;WHITE PENTAGON;So;0;ON;;;;;N;;;;; 2B21;WHITE HEXAGON;So;0;ON;;;;;N;;;;; 2B22;BLACK HEXAGON;So;0;ON;;;;;N;;;;; 2B23;HORIZONTAL BLACK HEXAGON;So;0;ON;;;;;N;;;;; 2B24;BLACK LARGE CIRCLE;So;0;ON;;;;;N;;;;; 2B25;BLACK MEDIUM DIAMOND;So;0;ON;;;;;N;;;;; 2B26;WHITE MEDIUM DIAMOND;So;0;ON;;;;;N;;;;; 2B27;BLACK MEDIUM LOZENGE;So;0;ON;;;;;N;;;;; 2B28;WHITE MEDIUM LOZENGE;So;0;ON;;;;;N;;;;; 2B29;BLACK SMALL DIAMOND;So;0;ON;;;;;N;;;;; 2B2A;BLACK SMALL LOZENGE;So;0;ON;;;;;N;;;;; 2B2B;WHITE SMALL LOZENGE;So;0;ON;;;;;N;;;;; 2B2C;BLACK HORIZONTAL ELLIPSE;So;0;ON;;;;;N;;;;; 2B2D;WHITE HORIZONTAL ELLIPSE;So;0;ON;;;;;N;;;;; 2B2E;BLACK VERTICAL ELLIPSE;So;0;ON;;;;;N;;;;; 2B2F;WHITE VERTICAL ELLIPSE;So;0;ON;;;;;N;;;;; 2B30;LEFT ARROW WITH SMALL CIRCLE;Sm;0;ON;;;;;N;;;;; 2B31;THREE LEFTWARDS ARROWS;Sm;0;ON;;;;;N;;;;; 2B32;LEFT ARROW WITH CIRCLED PLUS;Sm;0;ON;;;;;N;;;;; 2B33;LONG LEFTWARDS SQUIGGLE ARROW;Sm;0;ON;;;;;N;;;;; 2B34;LEFTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2B35;LEFTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2B36;LEFTWARDS TWO-HEADED ARROW FROM BAR;Sm;0;ON;;;;;N;;;;; 2B37;LEFTWARDS TWO-HEADED TRIPLE DASH ARROW;Sm;0;ON;;;;;N;;;;; 2B38;LEFTWARDS ARROW WITH DOTTED STEM;Sm;0;ON;;;;;N;;;;; 2B39;LEFTWARDS ARROW WITH TAIL WITH VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2B3A;LEFTWARDS ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2B3B;LEFTWARDS TWO-HEADED ARROW WITH TAIL;Sm;0;ON;;;;;N;;;;; 2B3C;LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2B3D;LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE;Sm;0;ON;;;;;N;;;;; 2B3E;LEFTWARDS ARROW THROUGH X;Sm;0;ON;;;;;N;;;;; 2B3F;WAVE ARROW POINTING DIRECTLY LEFT;Sm;0;ON;;;;;N;;;;; 2B40;EQUALS SIGN ABOVE LEFTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 2B41;REVERSE TILDE OPERATOR ABOVE LEFTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 2B42;LEFTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO;Sm;0;ON;;;;;N;;;;; 2B43;RIGHTWARDS ARROW THROUGH GREATER-THAN;Sm;0;ON;;;;;N;;;;; 2B44;RIGHTWARDS ARROW THROUGH SUPERSET;Sm;0;ON;;;;;N;;;;; 2B45;LEFTWARDS QUADRUPLE ARROW;So;0;ON;;;;;N;;;;; 2B46;RIGHTWARDS QUADRUPLE ARROW;So;0;ON;;;;;N;;;;; 2B47;REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 2B48;RIGHTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO;Sm;0;ON;;;;;N;;;;; 2B49;TILDE OPERATOR ABOVE LEFTWARDS ARROW;Sm;0;ON;;;;;N;;;;; 2B4A;LEFTWARDS ARROW ABOVE ALMOST EQUAL TO;Sm;0;ON;;;;;N;;;;; 2B4B;LEFTWARDS ARROW ABOVE REVERSE TILDE OPERATOR;Sm;0;ON;;;;;N;;;;; 2B4C;RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR;Sm;0;ON;;;;;N;;;;; 2B50;WHITE MEDIUM STAR;So;0;ON;;;;;N;;;;; 2B51;BLACK SMALL STAR;So;0;ON;;;;;N;;;;; 2B52;WHITE SMALL STAR;So;0;ON;;;;;N;;;;; 2B53;BLACK RIGHT-POINTING PENTAGON;So;0;ON;;;;;N;;;;; 2B54;WHITE RIGHT-POINTING PENTAGON;So;0;ON;;;;;N;;;;; 2B55;HEAVY LARGE CIRCLE;So;0;ON;;;;;N;;;;; 2B56;HEAVY OVAL WITH OVAL INSIDE;So;0;ON;;;;;N;;;;; 2B57;HEAVY CIRCLE WITH CIRCLE INSIDE;So;0;ON;;;;;N;;;;; 2B58;HEAVY CIRCLE;So;0;ON;;;;;N;;;;; 2B59;HEAVY CIRCLED SALTIRE;So;0;ON;;;;;N;;;;; 2C00;GLAGOLITIC CAPITAL LETTER AZU;Lu;0;L;;;;;N;;;;2C30; 2C01;GLAGOLITIC CAPITAL LETTER BUKY;Lu;0;L;;;;;N;;;;2C31; 2C02;GLAGOLITIC CAPITAL LETTER VEDE;Lu;0;L;;;;;N;;;;2C32; 2C03;GLAGOLITIC CAPITAL LETTER GLAGOLI;Lu;0;L;;;;;N;;;;2C33; 2C04;GLAGOLITIC CAPITAL LETTER DOBRO;Lu;0;L;;;;;N;;;;2C34; 2C05;GLAGOLITIC CAPITAL LETTER YESTU;Lu;0;L;;;;;N;;;;2C35; 2C06;GLAGOLITIC CAPITAL LETTER ZHIVETE;Lu;0;L;;;;;N;;;;2C36; 2C07;GLAGOLITIC CAPITAL LETTER DZELO;Lu;0;L;;;;;N;;;;2C37; 2C08;GLAGOLITIC CAPITAL LETTER ZEMLJA;Lu;0;L;;;;;N;;;;2C38; 2C09;GLAGOLITIC CAPITAL LETTER IZHE;Lu;0;L;;;;;N;;;;2C39; 2C0A;GLAGOLITIC CAPITAL LETTER INITIAL IZHE;Lu;0;L;;;;;N;;;;2C3A; 2C0B;GLAGOLITIC CAPITAL LETTER I;Lu;0;L;;;;;N;;;;2C3B; 2C0C;GLAGOLITIC CAPITAL LETTER DJERVI;Lu;0;L;;;;;N;;;;2C3C; 2C0D;GLAGOLITIC CAPITAL LETTER KAKO;Lu;0;L;;;;;N;;;;2C3D; 2C0E;GLAGOLITIC CAPITAL LETTER LJUDIJE;Lu;0;L;;;;;N;;;;2C3E; 2C0F;GLAGOLITIC CAPITAL LETTER MYSLITE;Lu;0;L;;;;;N;;;;2C3F; 2C10;GLAGOLITIC CAPITAL LETTER NASHI;Lu;0;L;;;;;N;;;;2C40; 2C11;GLAGOLITIC CAPITAL LETTER ONU;Lu;0;L;;;;;N;;;;2C41; 2C12;GLAGOLITIC CAPITAL LETTER POKOJI;Lu;0;L;;;;;N;;;;2C42; 2C13;GLAGOLITIC CAPITAL LETTER RITSI;Lu;0;L;;;;;N;;;;2C43; 2C14;GLAGOLITIC CAPITAL LETTER SLOVO;Lu;0;L;;;;;N;;;;2C44; 2C15;GLAGOLITIC CAPITAL LETTER TVRIDO;Lu;0;L;;;;;N;;;;2C45; 2C16;GLAGOLITIC CAPITAL LETTER UKU;Lu;0;L;;;;;N;;;;2C46; 2C17;GLAGOLITIC CAPITAL LETTER FRITU;Lu;0;L;;;;;N;;;;2C47; 2C18;GLAGOLITIC CAPITAL LETTER HERU;Lu;0;L;;;;;N;;;;2C48; 2C19;GLAGOLITIC CAPITAL LETTER OTU;Lu;0;L;;;;;N;;;;2C49; 2C1A;GLAGOLITIC CAPITAL LETTER PE;Lu;0;L;;;;;N;;;;2C4A; 2C1B;GLAGOLITIC CAPITAL LETTER SHTA;Lu;0;L;;;;;N;;;;2C4B; 2C1C;GLAGOLITIC CAPITAL LETTER TSI;Lu;0;L;;;;;N;;;;2C4C; 2C1D;GLAGOLITIC CAPITAL LETTER CHRIVI;Lu;0;L;;;;;N;;;;2C4D; 2C1E;GLAGOLITIC CAPITAL LETTER SHA;Lu;0;L;;;;;N;;;;2C4E; 2C1F;GLAGOLITIC CAPITAL LETTER YERU;Lu;0;L;;;;;N;;;;2C4F; 2C20;GLAGOLITIC CAPITAL LETTER YERI;Lu;0;L;;;;;N;;;;2C50; 2C21;GLAGOLITIC CAPITAL LETTER YATI;Lu;0;L;;;;;N;;;;2C51; 2C22;GLAGOLITIC CAPITAL LETTER SPIDERY HA;Lu;0;L;;;;;N;;;;2C52; 2C23;GLAGOLITIC CAPITAL LETTER YU;Lu;0;L;;;;;N;;;;2C53; 2C24;GLAGOLITIC CAPITAL LETTER SMALL YUS;Lu;0;L;;;;;N;;;;2C54; 2C25;GLAGOLITIC CAPITAL LETTER SMALL YUS WITH TAIL;Lu;0;L;;;;;N;;;;2C55; 2C26;GLAGOLITIC CAPITAL LETTER YO;Lu;0;L;;;;;N;;;;2C56; 2C27;GLAGOLITIC CAPITAL LETTER IOTATED SMALL YUS;Lu;0;L;;;;;N;;;;2C57; 2C28;GLAGOLITIC CAPITAL LETTER BIG YUS;Lu;0;L;;;;;N;;;;2C58; 2C29;GLAGOLITIC CAPITAL LETTER IOTATED BIG YUS;Lu;0;L;;;;;N;;;;2C59; 2C2A;GLAGOLITIC CAPITAL LETTER FITA;Lu;0;L;;;;;N;;;;2C5A; 2C2B;GLAGOLITIC CAPITAL LETTER IZHITSA;Lu;0;L;;;;;N;;;;2C5B; 2C2C;GLAGOLITIC CAPITAL LETTER SHTAPIC;Lu;0;L;;;;;N;;;;2C5C; 2C2D;GLAGOLITIC CAPITAL LETTER TROKUTASTI A;Lu;0;L;;;;;N;;;;2C5D; 2C2E;GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE;Lu;0;L;;;;;N;;;;2C5E; 2C30;GLAGOLITIC SMALL LETTER AZU;Ll;0;L;;;;;N;;;2C00;;2C00 2C31;GLAGOLITIC SMALL LETTER BUKY;Ll;0;L;;;;;N;;;2C01;;2C01 2C32;GLAGOLITIC SMALL LETTER VEDE;Ll;0;L;;;;;N;;;2C02;;2C02 2C33;GLAGOLITIC SMALL LETTER GLAGOLI;Ll;0;L;;;;;N;;;2C03;;2C03 2C34;GLAGOLITIC SMALL LETTER DOBRO;Ll;0;L;;;;;N;;;2C04;;2C04 2C35;GLAGOLITIC SMALL LETTER YESTU;Ll;0;L;;;;;N;;;2C05;;2C05 2C36;GLAGOLITIC SMALL LETTER ZHIVETE;Ll;0;L;;;;;N;;;2C06;;2C06 2C37;GLAGOLITIC SMALL LETTER DZELO;Ll;0;L;;;;;N;;;2C07;;2C07 2C38;GLAGOLITIC SMALL LETTER ZEMLJA;Ll;0;L;;;;;N;;;2C08;;2C08 2C39;GLAGOLITIC SMALL LETTER IZHE;Ll;0;L;;;;;N;;;2C09;;2C09 2C3A;GLAGOLITIC SMALL LETTER INITIAL IZHE;Ll;0;L;;;;;N;;;2C0A;;2C0A 2C3B;GLAGOLITIC SMALL LETTER I;Ll;0;L;;;;;N;;;2C0B;;2C0B 2C3C;GLAGOLITIC SMALL LETTER DJERVI;Ll;0;L;;;;;N;;;2C0C;;2C0C 2C3D;GLAGOLITIC SMALL LETTER KAKO;Ll;0;L;;;;;N;;;2C0D;;2C0D 2C3E;GLAGOLITIC SMALL LETTER LJUDIJE;Ll;0;L;;;;;N;;;2C0E;;2C0E 2C3F;GLAGOLITIC SMALL LETTER MYSLITE;Ll;0;L;;;;;N;;;2C0F;;2C0F 2C40;GLAGOLITIC SMALL LETTER NASHI;Ll;0;L;;;;;N;;;2C10;;2C10 2C41;GLAGOLITIC SMALL LETTER ONU;Ll;0;L;;;;;N;;;2C11;;2C11 2C42;GLAGOLITIC SMALL LETTER POKOJI;Ll;0;L;;;;;N;;;2C12;;2C12 2C43;GLAGOLITIC SMALL LETTER RITSI;Ll;0;L;;;;;N;;;2C13;;2C13 2C44;GLAGOLITIC SMALL LETTER SLOVO;Ll;0;L;;;;;N;;;2C14;;2C14 2C45;GLAGOLITIC SMALL LETTER TVRIDO;Ll;0;L;;;;;N;;;2C15;;2C15 2C46;GLAGOLITIC SMALL LETTER UKU;Ll;0;L;;;;;N;;;2C16;;2C16 2C47;GLAGOLITIC SMALL LETTER FRITU;Ll;0;L;;;;;N;;;2C17;;2C17 2C48;GLAGOLITIC SMALL LETTER HERU;Ll;0;L;;;;;N;;;2C18;;2C18 2C49;GLAGOLITIC SMALL LETTER OTU;Ll;0;L;;;;;N;;;2C19;;2C19 2C4A;GLAGOLITIC SMALL LETTER PE;Ll;0;L;;;;;N;;;2C1A;;2C1A 2C4B;GLAGOLITIC SMALL LETTER SHTA;Ll;0;L;;;;;N;;;2C1B;;2C1B 2C4C;GLAGOLITIC SMALL LETTER TSI;Ll;0;L;;;;;N;;;2C1C;;2C1C 2C4D;GLAGOLITIC SMALL LETTER CHRIVI;Ll;0;L;;;;;N;;;2C1D;;2C1D 2C4E;GLAGOLITIC SMALL LETTER SHA;Ll;0;L;;;;;N;;;2C1E;;2C1E 2C4F;GLAGOLITIC SMALL LETTER YERU;Ll;0;L;;;;;N;;;2C1F;;2C1F 2C50;GLAGOLITIC SMALL LETTER YERI;Ll;0;L;;;;;N;;;2C20;;2C20 2C51;GLAGOLITIC SMALL LETTER YATI;Ll;0;L;;;;;N;;;2C21;;2C21 2C52;GLAGOLITIC SMALL LETTER SPIDERY HA;Ll;0;L;;;;;N;;;2C22;;2C22 2C53;GLAGOLITIC SMALL LETTER YU;Ll;0;L;;;;;N;;;2C23;;2C23 2C54;GLAGOLITIC SMALL LETTER SMALL YUS;Ll;0;L;;;;;N;;;2C24;;2C24 2C55;GLAGOLITIC SMALL LETTER SMALL YUS WITH TAIL;Ll;0;L;;;;;N;;;2C25;;2C25 2C56;GLAGOLITIC SMALL LETTER YO;Ll;0;L;;;;;N;;;2C26;;2C26 2C57;GLAGOLITIC SMALL LETTER IOTATED SMALL YUS;Ll;0;L;;;;;N;;;2C27;;2C27 2C58;GLAGOLITIC SMALL LETTER BIG YUS;Ll;0;L;;;;;N;;;2C28;;2C28 2C59;GLAGOLITIC SMALL LETTER IOTATED BIG YUS;Ll;0;L;;;;;N;;;2C29;;2C29 2C5A;GLAGOLITIC SMALL LETTER FITA;Ll;0;L;;;;;N;;;2C2A;;2C2A 2C5B;GLAGOLITIC SMALL LETTER IZHITSA;Ll;0;L;;;;;N;;;2C2B;;2C2B 2C5C;GLAGOLITIC SMALL LETTER SHTAPIC;Ll;0;L;;;;;N;;;2C2C;;2C2C 2C5D;GLAGOLITIC SMALL LETTER TROKUTASTI A;Ll;0;L;;;;;N;;;2C2D;;2C2D 2C5E;GLAGOLITIC SMALL LETTER LATINATE MYSLITE;Ll;0;L;;;;;N;;;2C2E;;2C2E 2C60;LATIN CAPITAL LETTER L WITH DOUBLE BAR;Lu;0;L;;;;;N;;;;2C61; 2C61;LATIN SMALL LETTER L WITH DOUBLE BAR;Ll;0;L;;;;;N;;;2C60;;2C60 2C62;LATIN CAPITAL LETTER L WITH MIDDLE TILDE;Lu;0;L;;;;;N;;;;026B; 2C63;LATIN CAPITAL LETTER P WITH STROKE;Lu;0;L;;;;;N;;;;1D7D; 2C64;LATIN CAPITAL LETTER R WITH TAIL;Lu;0;L;;;;;N;;;;027D; 2C65;LATIN SMALL LETTER A WITH STROKE;Ll;0;L;;;;;N;;;023A;;023A 2C66;LATIN SMALL LETTER T WITH DIAGONAL STROKE;Ll;0;L;;;;;N;;;023E;;023E 2C67;LATIN CAPITAL LETTER H WITH DESCENDER;Lu;0;L;;;;;N;;;;2C68; 2C68;LATIN SMALL LETTER H WITH DESCENDER;Ll;0;L;;;;;N;;;2C67;;2C67 2C69;LATIN CAPITAL LETTER K WITH DESCENDER;Lu;0;L;;;;;N;;;;2C6A; 2C6A;LATIN SMALL LETTER K WITH DESCENDER;Ll;0;L;;;;;N;;;2C69;;2C69 2C6B;LATIN CAPITAL LETTER Z WITH DESCENDER;Lu;0;L;;;;;N;;;;2C6C; 2C6C;LATIN SMALL LETTER Z WITH DESCENDER;Ll;0;L;;;;;N;;;2C6B;;2C6B 2C6D;LATIN CAPITAL LETTER ALPHA;Lu;0;L;;;;;N;;;;0251; 2C6E;LATIN CAPITAL LETTER M WITH HOOK;Lu;0;L;;;;;N;;;;0271; 2C6F;LATIN CAPITAL LETTER TURNED A;Lu;0;L;;;;;N;;;;0250; 2C70;LATIN CAPITAL LETTER TURNED ALPHA;Lu;0;L;;;;;N;;;;0252; 2C71;LATIN SMALL LETTER V WITH RIGHT HOOK;Ll;0;L;;;;;N;;;;; 2C72;LATIN CAPITAL LETTER W WITH HOOK;Lu;0;L;;;;;N;;;;2C73; 2C73;LATIN SMALL LETTER W WITH HOOK;Ll;0;L;;;;;N;;;2C72;;2C72 2C74;LATIN SMALL LETTER V WITH CURL;Ll;0;L;;;;;N;;;;; 2C75;LATIN CAPITAL LETTER HALF H;Lu;0;L;;;;;N;;;;2C76; 2C76;LATIN SMALL LETTER HALF H;Ll;0;L;;;;;N;;;2C75;;2C75 2C77;LATIN SMALL LETTER TAILLESS PHI;Ll;0;L;;;;;N;;;;; 2C78;LATIN SMALL LETTER E WITH NOTCH;Ll;0;L;;;;;N;;;;; 2C79;LATIN SMALL LETTER TURNED R WITH TAIL;Ll;0;L;;;;;N;;;;; 2C7A;LATIN SMALL LETTER O WITH LOW RING INSIDE;Ll;0;L;;;;;N;;;;; 2C7B;LATIN LETTER SMALL CAPITAL TURNED E;Ll;0;L;;;;;N;;;;; 2C7C;LATIN SUBSCRIPT SMALL LETTER J;Lm;0;L; 006A;;;;N;;;;; 2C7D;MODIFIER LETTER CAPITAL V;Lm;0;L; 0056;;;;N;;;;; 2C7E;LATIN CAPITAL LETTER S WITH SWASH TAIL;Lu;0;L;;;;;N;;;;023F; 2C7F;LATIN CAPITAL LETTER Z WITH SWASH TAIL;Lu;0;L;;;;;N;;;;0240; 2C80;COPTIC CAPITAL LETTER ALFA;Lu;0;L;;;;;N;;;;2C81; 2C81;COPTIC SMALL LETTER ALFA;Ll;0;L;;;;;N;;;2C80;;2C80 2C82;COPTIC CAPITAL LETTER VIDA;Lu;0;L;;;;;N;;;;2C83; 2C83;COPTIC SMALL LETTER VIDA;Ll;0;L;;;;;N;;;2C82;;2C82 2C84;COPTIC CAPITAL LETTER GAMMA;Lu;0;L;;;;;N;;;;2C85; 2C85;COPTIC SMALL LETTER GAMMA;Ll;0;L;;;;;N;;;2C84;;2C84 2C86;COPTIC CAPITAL LETTER DALDA;Lu;0;L;;;;;N;;;;2C87; 2C87;COPTIC SMALL LETTER DALDA;Ll;0;L;;;;;N;;;2C86;;2C86 2C88;COPTIC CAPITAL LETTER EIE;Lu;0;L;;;;;N;;;;2C89; 2C89;COPTIC SMALL LETTER EIE;Ll;0;L;;;;;N;;;2C88;;2C88 2C8A;COPTIC CAPITAL LETTER SOU;Lu;0;L;;;;;N;;;;2C8B; 2C8B;COPTIC SMALL LETTER SOU;Ll;0;L;;;;;N;;;2C8A;;2C8A 2C8C;COPTIC CAPITAL LETTER ZATA;Lu;0;L;;;;;N;;;;2C8D; 2C8D;COPTIC SMALL LETTER ZATA;Ll;0;L;;;;;N;;;2C8C;;2C8C 2C8E;COPTIC CAPITAL LETTER HATE;Lu;0;L;;;;;N;;;;2C8F; 2C8F;COPTIC SMALL LETTER HATE;Ll;0;L;;;;;N;;;2C8E;;2C8E 2C90;COPTIC CAPITAL LETTER THETHE;Lu;0;L;;;;;N;;;;2C91; 2C91;COPTIC SMALL LETTER THETHE;Ll;0;L;;;;;N;;;2C90;;2C90 2C92;COPTIC CAPITAL LETTER IAUDA;Lu;0;L;;;;;N;;;;2C93; 2C93;COPTIC SMALL LETTER IAUDA;Ll;0;L;;;;;N;;;2C92;;2C92 2C94;COPTIC CAPITAL LETTER KAPA;Lu;0;L;;;;;N;;;;2C95; 2C95;COPTIC SMALL LETTER KAPA;Ll;0;L;;;;;N;;;2C94;;2C94 2C96;COPTIC CAPITAL LETTER LAULA;Lu;0;L;;;;;N;;;;2C97; 2C97;COPTIC SMALL LETTER LAULA;Ll;0;L;;;;;N;;;2C96;;2C96 2C98;COPTIC CAPITAL LETTER MI;Lu;0;L;;;;;N;;;;2C99; 2C99;COPTIC SMALL LETTER MI;Ll;0;L;;;;;N;;;2C98;;2C98 2C9A;COPTIC CAPITAL LETTER NI;Lu;0;L;;;;;N;;;;2C9B; 2C9B;COPTIC SMALL LETTER NI;Ll;0;L;;;;;N;;;2C9A;;2C9A 2C9C;COPTIC CAPITAL LETTER KSI;Lu;0;L;;;;;N;;;;2C9D; 2C9D;COPTIC SMALL LETTER KSI;Ll;0;L;;;;;N;;;2C9C;;2C9C 2C9E;COPTIC CAPITAL LETTER O;Lu;0;L;;;;;N;;;;2C9F; 2C9F;COPTIC SMALL LETTER O;Ll;0;L;;;;;N;;;2C9E;;2C9E 2CA0;COPTIC CAPITAL LETTER PI;Lu;0;L;;;;;N;;;;2CA1; 2CA1;COPTIC SMALL LETTER PI;Ll;0;L;;;;;N;;;2CA0;;2CA0 2CA2;COPTIC CAPITAL LETTER RO;Lu;0;L;;;;;N;;;;2CA3; 2CA3;COPTIC SMALL LETTER RO;Ll;0;L;;;;;N;;;2CA2;;2CA2 2CA4;COPTIC CAPITAL LETTER SIMA;Lu;0;L;;;;;N;;;;2CA5; 2CA5;COPTIC SMALL LETTER SIMA;Ll;0;L;;;;;N;;;2CA4;;2CA4 2CA6;COPTIC CAPITAL LETTER TAU;Lu;0;L;;;;;N;;;;2CA7; 2CA7;COPTIC SMALL LETTER TAU;Ll;0;L;;;;;N;;;2CA6;;2CA6 2CA8;COPTIC CAPITAL LETTER UA;Lu;0;L;;;;;N;;;;2CA9; 2CA9;COPTIC SMALL LETTER UA;Ll;0;L;;;;;N;;;2CA8;;2CA8 2CAA;COPTIC CAPITAL LETTER FI;Lu;0;L;;;;;N;;;;2CAB; 2CAB;COPTIC SMALL LETTER FI;Ll;0;L;;;;;N;;;2CAA;;2CAA 2CAC;COPTIC CAPITAL LETTER KHI;Lu;0;L;;;;;N;;;;2CAD; 2CAD;COPTIC SMALL LETTER KHI;Ll;0;L;;;;;N;;;2CAC;;2CAC 2CAE;COPTIC CAPITAL LETTER PSI;Lu;0;L;;;;;N;;;;2CAF; 2CAF;COPTIC SMALL LETTER PSI;Ll;0;L;;;;;N;;;2CAE;;2CAE 2CB0;COPTIC CAPITAL LETTER OOU;Lu;0;L;;;;;N;;;;2CB1; 2CB1;COPTIC SMALL LETTER OOU;Ll;0;L;;;;;N;;;2CB0;;2CB0 2CB2;COPTIC CAPITAL LETTER DIALECT-P ALEF;Lu;0;L;;;;;N;;;;2CB3; 2CB3;COPTIC SMALL LETTER DIALECT-P ALEF;Ll;0;L;;;;;N;;;2CB2;;2CB2 2CB4;COPTIC CAPITAL LETTER OLD COPTIC AIN;Lu;0;L;;;;;N;;;;2CB5; 2CB5;COPTIC SMALL LETTER OLD COPTIC AIN;Ll;0;L;;;;;N;;;2CB4;;2CB4 2CB6;COPTIC CAPITAL LETTER CRYPTOGRAMMIC EIE;Lu;0;L;;;;;N;;;;2CB7; 2CB7;COPTIC SMALL LETTER CRYPTOGRAMMIC EIE;Ll;0;L;;;;;N;;;2CB6;;2CB6 2CB8;COPTIC CAPITAL LETTER DIALECT-P KAPA;Lu;0;L;;;;;N;;;;2CB9; 2CB9;COPTIC SMALL LETTER DIALECT-P KAPA;Ll;0;L;;;;;N;;;2CB8;;2CB8 2CBA;COPTIC CAPITAL LETTER DIALECT-P NI;Lu;0;L;;;;;N;;;;2CBB; 2CBB;COPTIC SMALL LETTER DIALECT-P NI;Ll;0;L;;;;;N;;;2CBA;;2CBA 2CBC;COPTIC CAPITAL LETTER CRYPTOGRAMMIC NI;Lu;0;L;;;;;N;;;;2CBD; 2CBD;COPTIC SMALL LETTER CRYPTOGRAMMIC NI;Ll;0;L;;;;;N;;;2CBC;;2CBC 2CBE;COPTIC CAPITAL LETTER OLD COPTIC OOU;Lu;0;L;;;;;N;;;;2CBF; 2CBF;COPTIC SMALL LETTER OLD COPTIC OOU;Ll;0;L;;;;;N;;;2CBE;;2CBE 2CC0;COPTIC CAPITAL LETTER SAMPI;Lu;0;L;;;;;N;;;;2CC1; 2CC1;COPTIC SMALL LETTER SAMPI;Ll;0;L;;;;;N;;;2CC0;;2CC0 2CC2;COPTIC CAPITAL LETTER CROSSED SHEI;Lu;0;L;;;;;N;;;;2CC3; 2CC3;COPTIC SMALL LETTER CROSSED SHEI;Ll;0;L;;;;;N;;;2CC2;;2CC2 2CC4;COPTIC CAPITAL LETTER OLD COPTIC SHEI;Lu;0;L;;;;;N;;;;2CC5; 2CC5;COPTIC SMALL LETTER OLD COPTIC SHEI;Ll;0;L;;;;;N;;;2CC4;;2CC4 2CC6;COPTIC CAPITAL LETTER OLD COPTIC ESH;Lu;0;L;;;;;N;;;;2CC7; 2CC7;COPTIC SMALL LETTER OLD COPTIC ESH;Ll;0;L;;;;;N;;;2CC6;;2CC6 2CC8;COPTIC CAPITAL LETTER AKHMIMIC KHEI;Lu;0;L;;;;;N;;;;2CC9; 2CC9;COPTIC SMALL LETTER AKHMIMIC KHEI;Ll;0;L;;;;;N;;;2CC8;;2CC8 2CCA;COPTIC CAPITAL LETTER DIALECT-P HORI;Lu;0;L;;;;;N;;;;2CCB; 2CCB;COPTIC SMALL LETTER DIALECT-P HORI;Ll;0;L;;;;;N;;;2CCA;;2CCA 2CCC;COPTIC CAPITAL LETTER OLD COPTIC HORI;Lu;0;L;;;;;N;;;;2CCD; 2CCD;COPTIC SMALL LETTER OLD COPTIC HORI;Ll;0;L;;;;;N;;;2CCC;;2CCC 2CCE;COPTIC CAPITAL LETTER OLD COPTIC HA;Lu;0;L;;;;;N;;;;2CCF; 2CCF;COPTIC SMALL LETTER OLD COPTIC HA;Ll;0;L;;;;;N;;;2CCE;;2CCE 2CD0;COPTIC CAPITAL LETTER L-SHAPED HA;Lu;0;L;;;;;N;;;;2CD1; 2CD1;COPTIC SMALL LETTER L-SHAPED HA;Ll;0;L;;;;;N;;;2CD0;;2CD0 2CD2;COPTIC CAPITAL LETTER OLD COPTIC HEI;Lu;0;L;;;;;N;;;;2CD3; 2CD3;COPTIC SMALL LETTER OLD COPTIC HEI;Ll;0;L;;;;;N;;;2CD2;;2CD2 2CD4;COPTIC CAPITAL LETTER OLD COPTIC HAT;Lu;0;L;;;;;N;;;;2CD5; 2CD5;COPTIC SMALL LETTER OLD COPTIC HAT;Ll;0;L;;;;;N;;;2CD4;;2CD4 2CD6;COPTIC CAPITAL LETTER OLD COPTIC GANGIA;Lu;0;L;;;;;N;;;;2CD7; 2CD7;COPTIC SMALL LETTER OLD COPTIC GANGIA;Ll;0;L;;;;;N;;;2CD6;;2CD6 2CD8;COPTIC CAPITAL LETTER OLD COPTIC DJA;Lu;0;L;;;;;N;;;;2CD9; 2CD9;COPTIC SMALL LETTER OLD COPTIC DJA;Ll;0;L;;;;;N;;;2CD8;;2CD8 2CDA;COPTIC CAPITAL LETTER OLD COPTIC SHIMA;Lu;0;L;;;;;N;;;;2CDB; 2CDB;COPTIC SMALL LETTER OLD COPTIC SHIMA;Ll;0;L;;;;;N;;;2CDA;;2CDA 2CDC;COPTIC CAPITAL LETTER OLD NUBIAN SHIMA;Lu;0;L;;;;;N;;;;2CDD; 2CDD;COPTIC SMALL LETTER OLD NUBIAN SHIMA;Ll;0;L;;;;;N;;;2CDC;;2CDC 2CDE;COPTIC CAPITAL LETTER OLD NUBIAN NGI;Lu;0;L;;;;;N;;;;2CDF; 2CDF;COPTIC SMALL LETTER OLD NUBIAN NGI;Ll;0;L;;;;;N;;;2CDE;;2CDE 2CE0;COPTIC CAPITAL LETTER OLD NUBIAN NYI;Lu;0;L;;;;;N;;;;2CE1; 2CE1;COPTIC SMALL LETTER OLD NUBIAN NYI;Ll;0;L;;;;;N;;;2CE0;;2CE0 2CE2;COPTIC CAPITAL LETTER OLD NUBIAN WAU;Lu;0;L;;;;;N;;;;2CE3; 2CE3;COPTIC SMALL LETTER OLD NUBIAN WAU;Ll;0;L;;;;;N;;;2CE2;;2CE2 2CE4;COPTIC SYMBOL KAI;Ll;0;L;;;;;N;;;;; 2CE5;COPTIC SYMBOL MI RO;So;0;ON;;;;;N;;;;; 2CE6;COPTIC SYMBOL PI RO;So;0;ON;;;;;N;;;;; 2CE7;COPTIC SYMBOL STAUROS;So;0;ON;;;;;N;;;;; 2CE8;COPTIC SYMBOL TAU RO;So;0;ON;;;;;N;;;;; 2CE9;COPTIC SYMBOL KHI RO;So;0;ON;;;;;N;;;;; 2CEA;COPTIC SYMBOL SHIMA SIMA;So;0;ON;;;;;N;;;;; 2CEB;COPTIC CAPITAL LETTER CRYPTOGRAMMIC SHEI;Lu;0;L;;;;;N;;;;2CEC; 2CEC;COPTIC SMALL LETTER CRYPTOGRAMMIC SHEI;Ll;0;L;;;;;N;;;2CEB;;2CEB 2CED;COPTIC CAPITAL LETTER CRYPTOGRAMMIC GANGIA;Lu;0;L;;;;;N;;;;2CEE; 2CEE;COPTIC SMALL LETTER CRYPTOGRAMMIC GANGIA;Ll;0;L;;;;;N;;;2CED;;2CED 2CEF;COPTIC COMBINING NI ABOVE;Mn;230;NSM;;;;;N;;;;; 2CF0;COPTIC COMBINING SPIRITUS ASPER;Mn;230;NSM;;;;;N;;;;; 2CF1;COPTIC COMBINING SPIRITUS LENIS;Mn;230;NSM;;;;;N;;;;; 2CF2;COPTIC CAPITAL LETTER BOHAIRIC KHEI;Lu;0;L;;;;;N;;;;2CF3; 2CF3;COPTIC SMALL LETTER BOHAIRIC KHEI;Ll;0;L;;;;;N;;;2CF2;;2CF2 2CF9;COPTIC OLD NUBIAN FULL STOP;Po;0;ON;;;;;N;;;;; 2CFA;COPTIC OLD NUBIAN DIRECT QUESTION MARK;Po;0;ON;;;;;N;;;;; 2CFB;COPTIC OLD NUBIAN INDIRECT QUESTION MARK;Po;0;ON;;;;;N;;;;; 2CFC;COPTIC OLD NUBIAN VERSE DIVIDER;Po;0;ON;;;;;N;;;;; 2CFD;COPTIC FRACTION ONE HALF;No;0;ON;;;;1/2;N;;;;; 2CFE;COPTIC FULL STOP;Po;0;ON;;;;;N;;;;; 2CFF;COPTIC MORPHOLOGICAL DIVIDER;Po;0;ON;;;;;N;;;;; 2D00;GEORGIAN SMALL LETTER AN;Ll;0;L;;;;;N;;;10A0;;10A0 2D01;GEORGIAN SMALL LETTER BAN;Ll;0;L;;;;;N;;;10A1;;10A1 2D02;GEORGIAN SMALL LETTER GAN;Ll;0;L;;;;;N;;;10A2;;10A2 2D03;GEORGIAN SMALL LETTER DON;Ll;0;L;;;;;N;;;10A3;;10A3 2D04;GEORGIAN SMALL LETTER EN;Ll;0;L;;;;;N;;;10A4;;10A4 2D05;GEORGIAN SMALL LETTER VIN;Ll;0;L;;;;;N;;;10A5;;10A5 2D06;GEORGIAN SMALL LETTER ZEN;Ll;0;L;;;;;N;;;10A6;;10A6 2D07;GEORGIAN SMALL LETTER TAN;Ll;0;L;;;;;N;;;10A7;;10A7 2D08;GEORGIAN SMALL LETTER IN;Ll;0;L;;;;;N;;;10A8;;10A8 2D09;GEORGIAN SMALL LETTER KAN;Ll;0;L;;;;;N;;;10A9;;10A9 2D0A;GEORGIAN SMALL LETTER LAS;Ll;0;L;;;;;N;;;10AA;;10AA 2D0B;GEORGIAN SMALL LETTER MAN;Ll;0;L;;;;;N;;;10AB;;10AB 2D0C;GEORGIAN SMALL LETTER NAR;Ll;0;L;;;;;N;;;10AC;;10AC 2D0D;GEORGIAN SMALL LETTER ON;Ll;0;L;;;;;N;;;10AD;;10AD 2D0E;GEORGIAN SMALL LETTER PAR;Ll;0;L;;;;;N;;;10AE;;10AE 2D0F;GEORGIAN SMALL LETTER ZHAR;Ll;0;L;;;;;N;;;10AF;;10AF 2D10;GEORGIAN SMALL LETTER RAE;Ll;0;L;;;;;N;;;10B0;;10B0 2D11;GEORGIAN SMALL LETTER SAN;Ll;0;L;;;;;N;;;10B1;;10B1 2D12;GEORGIAN SMALL LETTER TAR;Ll;0;L;;;;;N;;;10B2;;10B2 2D13;GEORGIAN SMALL LETTER UN;Ll;0;L;;;;;N;;;10B3;;10B3 2D14;GEORGIAN SMALL LETTER PHAR;Ll;0;L;;;;;N;;;10B4;;10B4 2D15;GEORGIAN SMALL LETTER KHAR;Ll;0;L;;;;;N;;;10B5;;10B5 2D16;GEORGIAN SMALL LETTER GHAN;Ll;0;L;;;;;N;;;10B6;;10B6 2D17;GEORGIAN SMALL LETTER QAR;Ll;0;L;;;;;N;;;10B7;;10B7 2D18;GEORGIAN SMALL LETTER SHIN;Ll;0;L;;;;;N;;;10B8;;10B8 2D19;GEORGIAN SMALL LETTER CHIN;Ll;0;L;;;;;N;;;10B9;;10B9 2D1A;GEORGIAN SMALL LETTER CAN;Ll;0;L;;;;;N;;;10BA;;10BA 2D1B;GEORGIAN SMALL LETTER JIL;Ll;0;L;;;;;N;;;10BB;;10BB 2D1C;GEORGIAN SMALL LETTER CIL;Ll;0;L;;;;;N;;;10BC;;10BC 2D1D;GEORGIAN SMALL LETTER CHAR;Ll;0;L;;;;;N;;;10BD;;10BD 2D1E;GEORGIAN SMALL LETTER XAN;Ll;0;L;;;;;N;;;10BE;;10BE 2D1F;GEORGIAN SMALL LETTER JHAN;Ll;0;L;;;;;N;;;10BF;;10BF 2D20;GEORGIAN SMALL LETTER HAE;Ll;0;L;;;;;N;;;10C0;;10C0 2D21;GEORGIAN SMALL LETTER HE;Ll;0;L;;;;;N;;;10C1;;10C1 2D22;GEORGIAN SMALL LETTER HIE;Ll;0;L;;;;;N;;;10C2;;10C2 2D23;GEORGIAN SMALL LETTER WE;Ll;0;L;;;;;N;;;10C3;;10C3 2D24;GEORGIAN SMALL LETTER HAR;Ll;0;L;;;;;N;;;10C4;;10C4 2D25;GEORGIAN SMALL LETTER HOE;Ll;0;L;;;;;N;;;10C5;;10C5 2D27;GEORGIAN SMALL LETTER YN;Ll;0;L;;;;;N;;;10C7;;10C7 2D2D;GEORGIAN SMALL LETTER AEN;Ll;0;L;;;;;N;;;10CD;;10CD 2D30;TIFINAGH LETTER YA;Lo;0;L;;;;;N;;;;; 2D31;TIFINAGH LETTER YAB;Lo;0;L;;;;;N;;;;; 2D32;TIFINAGH LETTER YABH;Lo;0;L;;;;;N;;;;; 2D33;TIFINAGH LETTER YAG;Lo;0;L;;;;;N;;;;; 2D34;TIFINAGH LETTER YAGHH;Lo;0;L;;;;;N;;;;; 2D35;TIFINAGH LETTER BERBER ACADEMY YAJ;Lo;0;L;;;;;N;;;;; 2D36;TIFINAGH LETTER YAJ;Lo;0;L;;;;;N;;;;; 2D37;TIFINAGH LETTER YAD;Lo;0;L;;;;;N;;;;; 2D38;TIFINAGH LETTER YADH;Lo;0;L;;;;;N;;;;; 2D39;TIFINAGH LETTER YADD;Lo;0;L;;;;;N;;;;; 2D3A;TIFINAGH LETTER YADDH;Lo;0;L;;;;;N;;;;; 2D3B;TIFINAGH LETTER YEY;Lo;0;L;;;;;N;;;;; 2D3C;TIFINAGH LETTER YAF;Lo;0;L;;;;;N;;;;; 2D3D;TIFINAGH LETTER YAK;Lo;0;L;;;;;N;;;;; 2D3E;TIFINAGH LETTER TUAREG YAK;Lo;0;L;;;;;N;;;;; 2D3F;TIFINAGH LETTER YAKHH;Lo;0;L;;;;;N;;;;; 2D40;TIFINAGH LETTER YAH;Lo;0;L;;;;;N;;;;; 2D41;TIFINAGH LETTER BERBER ACADEMY YAH;Lo;0;L;;;;;N;;;;; 2D42;TIFINAGH LETTER TUAREG YAH;Lo;0;L;;;;;N;;;;; 2D43;TIFINAGH LETTER YAHH;Lo;0;L;;;;;N;;;;; 2D44;TIFINAGH LETTER YAA;Lo;0;L;;;;;N;;;;; 2D45;TIFINAGH LETTER YAKH;Lo;0;L;;;;;N;;;;; 2D46;TIFINAGH LETTER TUAREG YAKH;Lo;0;L;;;;;N;;;;; 2D47;TIFINAGH LETTER YAQ;Lo;0;L;;;;;N;;;;; 2D48;TIFINAGH LETTER TUAREG YAQ;Lo;0;L;;;;;N;;;;; 2D49;TIFINAGH LETTER YI;Lo;0;L;;;;;N;;;;; 2D4A;TIFINAGH LETTER YAZH;Lo;0;L;;;;;N;;;;; 2D4B;TIFINAGH LETTER AHAGGAR YAZH;Lo;0;L;;;;;N;;;;; 2D4C;TIFINAGH LETTER TUAREG YAZH;Lo;0;L;;;;;N;;;;; 2D4D;TIFINAGH LETTER YAL;Lo;0;L;;;;;N;;;;; 2D4E;TIFINAGH LETTER YAM;Lo;0;L;;;;;N;;;;; 2D4F;TIFINAGH LETTER YAN;Lo;0;L;;;;;N;;;;; 2D50;TIFINAGH LETTER TUAREG YAGN;Lo;0;L;;;;;N;;;;; 2D51;TIFINAGH LETTER TUAREG YANG;Lo;0;L;;;;;N;;;;; 2D52;TIFINAGH LETTER YAP;Lo;0;L;;;;;N;;;;; 2D53;TIFINAGH LETTER YU;Lo;0;L;;;;;N;;;;; 2D54;TIFINAGH LETTER YAR;Lo;0;L;;;;;N;;;;; 2D55;TIFINAGH LETTER YARR;Lo;0;L;;;;;N;;;;; 2D56;TIFINAGH LETTER YAGH;Lo;0;L;;;;;N;;;;; 2D57;TIFINAGH LETTER TUAREG YAGH;Lo;0;L;;;;;N;;;;; 2D58;TIFINAGH LETTER AYER YAGH;Lo;0;L;;;;;N;;;;; 2D59;TIFINAGH LETTER YAS;Lo;0;L;;;;;N;;;;; 2D5A;TIFINAGH LETTER YASS;Lo;0;L;;;;;N;;;;; 2D5B;TIFINAGH LETTER YASH;Lo;0;L;;;;;N;;;;; 2D5C;TIFINAGH LETTER YAT;Lo;0;L;;;;;N;;;;; 2D5D;TIFINAGH LETTER YATH;Lo;0;L;;;;;N;;;;; 2D5E;TIFINAGH LETTER YACH;Lo;0;L;;;;;N;;;;; 2D5F;TIFINAGH LETTER YATT;Lo;0;L;;;;;N;;;;; 2D60;TIFINAGH LETTER YAV;Lo;0;L;;;;;N;;;;; 2D61;TIFINAGH LETTER YAW;Lo;0;L;;;;;N;;;;; 2D62;TIFINAGH LETTER YAY;Lo;0;L;;;;;N;;;;; 2D63;TIFINAGH LETTER YAZ;Lo;0;L;;;;;N;;;;; 2D64;TIFINAGH LETTER TAWELLEMET YAZ;Lo;0;L;;;;;N;;;;; 2D65;TIFINAGH LETTER YAZZ;Lo;0;L;;;;;N;;;;; 2D66;TIFINAGH LETTER YE;Lo;0;L;;;;;N;;;;; 2D67;TIFINAGH LETTER YO;Lo;0;L;;;;;N;;;;; 2D6F;TIFINAGH MODIFIER LETTER LABIALIZATION MARK;Lm;0;L; 2D61;;;;N;;;;; 2D70;TIFINAGH SEPARATOR MARK;Po;0;L;;;;;N;;;;; 2D7F;TIFINAGH CONSONANT JOINER;Mn;9;NSM;;;;;N;;;;; 2D80;ETHIOPIC SYLLABLE LOA;Lo;0;L;;;;;N;;;;; 2D81;ETHIOPIC SYLLABLE MOA;Lo;0;L;;;;;N;;;;; 2D82;ETHIOPIC SYLLABLE ROA;Lo;0;L;;;;;N;;;;; 2D83;ETHIOPIC SYLLABLE SOA;Lo;0;L;;;;;N;;;;; 2D84;ETHIOPIC SYLLABLE SHOA;Lo;0;L;;;;;N;;;;; 2D85;ETHIOPIC SYLLABLE BOA;Lo;0;L;;;;;N;;;;; 2D86;ETHIOPIC SYLLABLE TOA;Lo;0;L;;;;;N;;;;; 2D87;ETHIOPIC SYLLABLE COA;Lo;0;L;;;;;N;;;;; 2D88;ETHIOPIC SYLLABLE NOA;Lo;0;L;;;;;N;;;;; 2D89;ETHIOPIC SYLLABLE NYOA;Lo;0;L;;;;;N;;;;; 2D8A;ETHIOPIC SYLLABLE GLOTTAL OA;Lo;0;L;;;;;N;;;;; 2D8B;ETHIOPIC SYLLABLE ZOA;Lo;0;L;;;;;N;;;;; 2D8C;ETHIOPIC SYLLABLE DOA;Lo;0;L;;;;;N;;;;; 2D8D;ETHIOPIC SYLLABLE DDOA;Lo;0;L;;;;;N;;;;; 2D8E;ETHIOPIC SYLLABLE JOA;Lo;0;L;;;;;N;;;;; 2D8F;ETHIOPIC SYLLABLE THOA;Lo;0;L;;;;;N;;;;; 2D90;ETHIOPIC SYLLABLE CHOA;Lo;0;L;;;;;N;;;;; 2D91;ETHIOPIC SYLLABLE PHOA;Lo;0;L;;;;;N;;;;; 2D92;ETHIOPIC SYLLABLE POA;Lo;0;L;;;;;N;;;;; 2D93;ETHIOPIC SYLLABLE GGWA;Lo;0;L;;;;;N;;;;; 2D94;ETHIOPIC SYLLABLE GGWI;Lo;0;L;;;;;N;;;;; 2D95;ETHIOPIC SYLLABLE GGWEE;Lo;0;L;;;;;N;;;;; 2D96;ETHIOPIC SYLLABLE GGWE;Lo;0;L;;;;;N;;;;; 2DA0;ETHIOPIC SYLLABLE SSA;Lo;0;L;;;;;N;;;;; 2DA1;ETHIOPIC SYLLABLE SSU;Lo;0;L;;;;;N;;;;; 2DA2;ETHIOPIC SYLLABLE SSI;Lo;0;L;;;;;N;;;;; 2DA3;ETHIOPIC SYLLABLE SSAA;Lo;0;L;;;;;N;;;;; 2DA4;ETHIOPIC SYLLABLE SSEE;Lo;0;L;;;;;N;;;;; 2DA5;ETHIOPIC SYLLABLE SSE;Lo;0;L;;;;;N;;;;; 2DA6;ETHIOPIC SYLLABLE SSO;Lo;0;L;;;;;N;;;;; 2DA8;ETHIOPIC SYLLABLE CCA;Lo;0;L;;;;;N;;;;; 2DA9;ETHIOPIC SYLLABLE CCU;Lo;0;L;;;;;N;;;;; 2DAA;ETHIOPIC SYLLABLE CCI;Lo;0;L;;;;;N;;;;; 2DAB;ETHIOPIC SYLLABLE CCAA;Lo;0;L;;;;;N;;;;; 2DAC;ETHIOPIC SYLLABLE CCEE;Lo;0;L;;;;;N;;;;; 2DAD;ETHIOPIC SYLLABLE CCE;Lo;0;L;;;;;N;;;;; 2DAE;ETHIOPIC SYLLABLE CCO;Lo;0;L;;;;;N;;;;; 2DB0;ETHIOPIC SYLLABLE ZZA;Lo;0;L;;;;;N;;;;; 2DB1;ETHIOPIC SYLLABLE ZZU;Lo;0;L;;;;;N;;;;; 2DB2;ETHIOPIC SYLLABLE ZZI;Lo;0;L;;;;;N;;;;; 2DB3;ETHIOPIC SYLLABLE ZZAA;Lo;0;L;;;;;N;;;;; 2DB4;ETHIOPIC SYLLABLE ZZEE;Lo;0;L;;;;;N;;;;; 2DB5;ETHIOPIC SYLLABLE ZZE;Lo;0;L;;;;;N;;;;; 2DB6;ETHIOPIC SYLLABLE ZZO;Lo;0;L;;;;;N;;;;; 2DB8;ETHIOPIC SYLLABLE CCHA;Lo;0;L;;;;;N;;;;; 2DB9;ETHIOPIC SYLLABLE CCHU;Lo;0;L;;;;;N;;;;; 2DBA;ETHIOPIC SYLLABLE CCHI;Lo;0;L;;;;;N;;;;; 2DBB;ETHIOPIC SYLLABLE CCHAA;Lo;0;L;;;;;N;;;;; 2DBC;ETHIOPIC SYLLABLE CCHEE;Lo;0;L;;;;;N;;;;; 2DBD;ETHIOPIC SYLLABLE CCHE;Lo;0;L;;;;;N;;;;; 2DBE;ETHIOPIC SYLLABLE CCHO;Lo;0;L;;;;;N;;;;; 2DC0;ETHIOPIC SYLLABLE QYA;Lo;0;L;;;;;N;;;;; 2DC1;ETHIOPIC SYLLABLE QYU;Lo;0;L;;;;;N;;;;; 2DC2;ETHIOPIC SYLLABLE QYI;Lo;0;L;;;;;N;;;;; 2DC3;ETHIOPIC SYLLABLE QYAA;Lo;0;L;;;;;N;;;;; 2DC4;ETHIOPIC SYLLABLE QYEE;Lo;0;L;;;;;N;;;;; 2DC5;ETHIOPIC SYLLABLE QYE;Lo;0;L;;;;;N;;;;; 2DC6;ETHIOPIC SYLLABLE QYO;Lo;0;L;;;;;N;;;;; 2DC8;ETHIOPIC SYLLABLE KYA;Lo;0;L;;;;;N;;;;; 2DC9;ETHIOPIC SYLLABLE KYU;Lo;0;L;;;;;N;;;;; 2DCA;ETHIOPIC SYLLABLE KYI;Lo;0;L;;;;;N;;;;; 2DCB;ETHIOPIC SYLLABLE KYAA;Lo;0;L;;;;;N;;;;; 2DCC;ETHIOPIC SYLLABLE KYEE;Lo;0;L;;;;;N;;;;; 2DCD;ETHIOPIC SYLLABLE KYE;Lo;0;L;;;;;N;;;;; 2DCE;ETHIOPIC SYLLABLE KYO;Lo;0;L;;;;;N;;;;; 2DD0;ETHIOPIC SYLLABLE XYA;Lo;0;L;;;;;N;;;;; 2DD1;ETHIOPIC SYLLABLE XYU;Lo;0;L;;;;;N;;;;; 2DD2;ETHIOPIC SYLLABLE XYI;Lo;0;L;;;;;N;;;;; 2DD3;ETHIOPIC SYLLABLE XYAA;Lo;0;L;;;;;N;;;;; 2DD4;ETHIOPIC SYLLABLE XYEE;Lo;0;L;;;;;N;;;;; 2DD5;ETHIOPIC SYLLABLE XYE;Lo;0;L;;;;;N;;;;; 2DD6;ETHIOPIC SYLLABLE XYO;Lo;0;L;;;;;N;;;;; 2DD8;ETHIOPIC SYLLABLE GYA;Lo;0;L;;;;;N;;;;; 2DD9;ETHIOPIC SYLLABLE GYU;Lo;0;L;;;;;N;;;;; 2DDA;ETHIOPIC SYLLABLE GYI;Lo;0;L;;;;;N;;;;; 2DDB;ETHIOPIC SYLLABLE GYAA;Lo;0;L;;;;;N;;;;; 2DDC;ETHIOPIC SYLLABLE GYEE;Lo;0;L;;;;;N;;;;; 2DDD;ETHIOPIC SYLLABLE GYE;Lo;0;L;;;;;N;;;;; 2DDE;ETHIOPIC SYLLABLE GYO;Lo;0;L;;;;;N;;;;; 2DE0;COMBINING CYRILLIC LETTER BE;Mn;230;NSM;;;;;N;;;;; 2DE1;COMBINING CYRILLIC LETTER VE;Mn;230;NSM;;;;;N;;;;; 2DE2;COMBINING CYRILLIC LETTER GHE;Mn;230;NSM;;;;;N;;;;; 2DE3;COMBINING CYRILLIC LETTER DE;Mn;230;NSM;;;;;N;;;;; 2DE4;COMBINING CYRILLIC LETTER ZHE;Mn;230;NSM;;;;;N;;;;; 2DE5;COMBINING CYRILLIC LETTER ZE;Mn;230;NSM;;;;;N;;;;; 2DE6;COMBINING CYRILLIC LETTER KA;Mn;230;NSM;;;;;N;;;;; 2DE7;COMBINING CYRILLIC LETTER EL;Mn;230;NSM;;;;;N;;;;; 2DE8;COMBINING CYRILLIC LETTER EM;Mn;230;NSM;;;;;N;;;;; 2DE9;COMBINING CYRILLIC LETTER EN;Mn;230;NSM;;;;;N;;;;; 2DEA;COMBINING CYRILLIC LETTER O;Mn;230;NSM;;;;;N;;;;; 2DEB;COMBINING CYRILLIC LETTER PE;Mn;230;NSM;;;;;N;;;;; 2DEC;COMBINING CYRILLIC LETTER ER;Mn;230;NSM;;;;;N;;;;; 2DED;COMBINING CYRILLIC LETTER ES;Mn;230;NSM;;;;;N;;;;; 2DEE;COMBINING CYRILLIC LETTER TE;Mn;230;NSM;;;;;N;;;;; 2DEF;COMBINING CYRILLIC LETTER HA;Mn;230;NSM;;;;;N;;;;; 2DF0;COMBINING CYRILLIC LETTER TSE;Mn;230;NSM;;;;;N;;;;; 2DF1;COMBINING CYRILLIC LETTER CHE;Mn;230;NSM;;;;;N;;;;; 2DF2;COMBINING CYRILLIC LETTER SHA;Mn;230;NSM;;;;;N;;;;; 2DF3;COMBINING CYRILLIC LETTER SHCHA;Mn;230;NSM;;;;;N;;;;; 2DF4;COMBINING CYRILLIC LETTER FITA;Mn;230;NSM;;;;;N;;;;; 2DF5;COMBINING CYRILLIC LETTER ES-TE;Mn;230;NSM;;;;;N;;;;; 2DF6;COMBINING CYRILLIC LETTER A;Mn;230;NSM;;;;;N;;;;; 2DF7;COMBINING CYRILLIC LETTER IE;Mn;230;NSM;;;;;N;;;;; 2DF8;COMBINING CYRILLIC LETTER DJERV;Mn;230;NSM;;;;;N;;;;; 2DF9;COMBINING CYRILLIC LETTER MONOGRAPH UK;Mn;230;NSM;;;;;N;;;;; 2DFA;COMBINING CYRILLIC LETTER YAT;Mn;230;NSM;;;;;N;;;;; 2DFB;COMBINING CYRILLIC LETTER YU;Mn;230;NSM;;;;;N;;;;; 2DFC;COMBINING CYRILLIC LETTER IOTIFIED A;Mn;230;NSM;;;;;N;;;;; 2DFD;COMBINING CYRILLIC LETTER LITTLE YUS;Mn;230;NSM;;;;;N;;;;; 2DFE;COMBINING CYRILLIC LETTER BIG YUS;Mn;230;NSM;;;;;N;;;;; 2DFF;COMBINING CYRILLIC LETTER IOTIFIED BIG YUS;Mn;230;NSM;;;;;N;;;;; 2E00;RIGHT ANGLE SUBSTITUTION MARKER;Po;0;ON;;;;;N;;;;; 2E01;RIGHT ANGLE DOTTED SUBSTITUTION MARKER;Po;0;ON;;;;;N;;;;; 2E02;LEFT SUBSTITUTION BRACKET;Pi;0;ON;;;;;Y;;;;; 2E03;RIGHT SUBSTITUTION BRACKET;Pf;0;ON;;;;;Y;;;;; 2E04;LEFT DOTTED SUBSTITUTION BRACKET;Pi;0;ON;;;;;Y;;;;; 2E05;RIGHT DOTTED SUBSTITUTION BRACKET;Pf;0;ON;;;;;Y;;;;; 2E06;RAISED INTERPOLATION MARKER;Po;0;ON;;;;;N;;;;; 2E07;RAISED DOTTED INTERPOLATION MARKER;Po;0;ON;;;;;N;;;;; 2E08;DOTTED TRANSPOSITION MARKER;Po;0;ON;;;;;N;;;;; 2E09;LEFT TRANSPOSITION BRACKET;Pi;0;ON;;;;;Y;;;;; 2E0A;RIGHT TRANSPOSITION BRACKET;Pf;0;ON;;;;;Y;;;;; 2E0B;RAISED SQUARE;Po;0;ON;;;;;N;;;;; 2E0C;LEFT RAISED OMISSION BRACKET;Pi;0;ON;;;;;Y;;;;; 2E0D;RIGHT RAISED OMISSION BRACKET;Pf;0;ON;;;;;Y;;;;; 2E0E;EDITORIAL CORONIS;Po;0;ON;;;;;N;;;;; 2E0F;PARAGRAPHOS;Po;0;ON;;;;;N;;;;; 2E10;FORKED PARAGRAPHOS;Po;0;ON;;;;;N;;;;; 2E11;REVERSED FORKED PARAGRAPHOS;Po;0;ON;;;;;N;;;;; 2E12;HYPODIASTOLE;Po;0;ON;;;;;N;;;;; 2E13;DOTTED OBELOS;Po;0;ON;;;;;N;;;;; 2E14;DOWNWARDS ANCORA;Po;0;ON;;;;;N;;;;; 2E15;UPWARDS ANCORA;Po;0;ON;;;;;N;;;;; 2E16;DOTTED RIGHT-POINTING ANGLE;Po;0;ON;;;;;N;;;;; 2E17;DOUBLE OBLIQUE HYPHEN;Pd;0;ON;;;;;N;;;;; 2E18;INVERTED INTERROBANG;Po;0;ON;;;;;N;;;;; 2E19;PALM BRANCH;Po;0;ON;;;;;N;;;;; 2E1A;HYPHEN WITH DIAERESIS;Pd;0;ON;;;;;N;;;;; 2E1B;TILDE WITH RING ABOVE;Po;0;ON;;;;;N;;;;; 2E1C;LEFT LOW PARAPHRASE BRACKET;Pi;0;ON;;;;;Y;;;;; 2E1D;RIGHT LOW PARAPHRASE BRACKET;Pf;0;ON;;;;;Y;;;;; 2E1E;TILDE WITH DOT ABOVE;Po;0;ON;;;;;N;;;;; 2E1F;TILDE WITH DOT BELOW;Po;0;ON;;;;;N;;;;; 2E20;LEFT VERTICAL BAR WITH QUILL;Pi;0;ON;;;;;Y;;;;; 2E21;RIGHT VERTICAL BAR WITH QUILL;Pf;0;ON;;;;;Y;;;;; 2E22;TOP LEFT HALF BRACKET;Ps;0;ON;;;;;Y;;;;; 2E23;TOP RIGHT HALF BRACKET;Pe;0;ON;;;;;Y;;;;; 2E24;BOTTOM LEFT HALF BRACKET;Ps;0;ON;;;;;Y;;;;; 2E25;BOTTOM RIGHT HALF BRACKET;Pe;0;ON;;;;;Y;;;;; 2E26;LEFT SIDEWAYS U BRACKET;Ps;0;ON;;;;;Y;;;;; 2E27;RIGHT SIDEWAYS U BRACKET;Pe;0;ON;;;;;Y;;;;; 2E28;LEFT DOUBLE PARENTHESIS;Ps;0;ON;;;;;Y;;;;; 2E29;RIGHT DOUBLE PARENTHESIS;Pe;0;ON;;;;;Y;;;;; 2E2A;TWO DOTS OVER ONE DOT PUNCTUATION;Po;0;ON;;;;;N;;;;; 2E2B;ONE DOT OVER TWO DOTS PUNCTUATION;Po;0;ON;;;;;N;;;;; 2E2C;SQUARED FOUR DOT PUNCTUATION;Po;0;ON;;;;;N;;;;; 2E2D;FIVE DOT MARK;Po;0;ON;;;;;N;;;;; 2E2E;REVERSED QUESTION MARK;Po;0;ON;;;;;N;;;;; 2E2F;VERTICAL TILDE;Lm;0;ON;;;;;N;;;;; 2E30;RING POINT;Po;0;ON;;;;;N;;;;; 2E31;WORD SEPARATOR MIDDLE DOT;Po;0;ON;;;;;N;;;;; 2E32;TURNED COMMA;Po;0;ON;;;;;N;;;;; 2E33;RAISED DOT;Po;0;ON;;;;;N;;;;; 2E34;RAISED COMMA;Po;0;ON;;;;;N;;;;; 2E35;TURNED SEMICOLON;Po;0;ON;;;;;N;;;;; 2E36;DAGGER WITH LEFT GUARD;Po;0;ON;;;;;N;;;;; 2E37;DAGGER WITH RIGHT GUARD;Po;0;ON;;;;;N;;;;; 2E38;TURNED DAGGER;Po;0;ON;;;;;N;;;;; 2E39;TOP HALF SECTION SIGN;Po;0;ON;;;;;N;;;;; 2E3A;TWO-EM DASH;Pd;0;ON;;;;;N;;;;; 2E3B;THREE-EM DASH;Pd;0;ON;;;;;N;;;;; 2E80;CJK RADICAL REPEAT;So;0;ON;;;;;N;;;;; 2E81;CJK RADICAL CLIFF;So;0;ON;;;;;N;;;;; 2E82;CJK RADICAL SECOND ONE;So;0;ON;;;;;N;;;;; 2E83;CJK RADICAL SECOND TWO;So;0;ON;;;;;N;;;;; 2E84;CJK RADICAL SECOND THREE;So;0;ON;;;;;N;;;;; 2E85;CJK RADICAL PERSON;So;0;ON;;;;;N;;;;; 2E86;CJK RADICAL BOX;So;0;ON;;;;;N;;;;; 2E87;CJK RADICAL TABLE;So;0;ON;;;;;N;;;;; 2E88;CJK RADICAL KNIFE ONE;So;0;ON;;;;;N;;;;; 2E89;CJK RADICAL KNIFE TWO;So;0;ON;;;;;N;;;;; 2E8A;CJK RADICAL DIVINATION;So;0;ON;;;;;N;;;;; 2E8B;CJK RADICAL SEAL;So;0;ON;;;;;N;;;;; 2E8C;CJK RADICAL SMALL ONE;So;0;ON;;;;;N;;;;; 2E8D;CJK RADICAL SMALL TWO;So;0;ON;;;;;N;;;;; 2E8E;CJK RADICAL LAME ONE;So;0;ON;;;;;N;;;;; 2E8F;CJK RADICAL LAME TWO;So;0;ON;;;;;N;;;;; 2E90;CJK RADICAL LAME THREE;So;0;ON;;;;;N;;;;; 2E91;CJK RADICAL LAME FOUR;So;0;ON;;;;;N;;;;; 2E92;CJK RADICAL SNAKE;So;0;ON;;;;;N;;;;; 2E93;CJK RADICAL THREAD;So;0;ON;;;;;N;;;;; 2E94;CJK RADICAL SNOUT ONE;So;0;ON;;;;;N;;;;; 2E95;CJK RADICAL SNOUT TWO;So;0;ON;;;;;N;;;;; 2E96;CJK RADICAL HEART ONE;So;0;ON;;;;;N;;;;; 2E97;CJK RADICAL HEART TWO;So;0;ON;;;;;N;;;;; 2E98;CJK RADICAL HAND;So;0;ON;;;;;N;;;;; 2E99;CJK RADICAL RAP;So;0;ON;;;;;N;;;;; 2E9B;CJK RADICAL CHOKE;So;0;ON;;;;;N;;;;; 2E9C;CJK RADICAL SUN;So;0;ON;;;;;N;;;;; 2E9D;CJK RADICAL MOON;So;0;ON;;;;;N;;;;; 2E9E;CJK RADICAL DEATH;So;0;ON;;;;;N;;;;; 2E9F;CJK RADICAL MOTHER;So;0;ON; 6BCD;;;;N;;;;; 2EA0;CJK RADICAL CIVILIAN;So;0;ON;;;;;N;;;;; 2EA1;CJK RADICAL WATER ONE;So;0;ON;;;;;N;;;;; 2EA2;CJK RADICAL WATER TWO;So;0;ON;;;;;N;;;;; 2EA3;CJK RADICAL FIRE;So;0;ON;;;;;N;;;;; 2EA4;CJK RADICAL PAW ONE;So;0;ON;;;;;N;;;;; 2EA5;CJK RADICAL PAW TWO;So;0;ON;;;;;N;;;;; 2EA6;CJK RADICAL SIMPLIFIED HALF TREE TRUNK;So;0;ON;;;;;N;;;;; 2EA7;CJK RADICAL COW;So;0;ON;;;;;N;;;;; 2EA8;CJK RADICAL DOG;So;0;ON;;;;;N;;;;; 2EA9;CJK RADICAL JADE;So;0;ON;;;;;N;;;;; 2EAA;CJK RADICAL BOLT OF CLOTH;So;0;ON;;;;;N;;;;; 2EAB;CJK RADICAL EYE;So;0;ON;;;;;N;;;;; 2EAC;CJK RADICAL SPIRIT ONE;So;0;ON;;;;;N;;;;; 2EAD;CJK RADICAL SPIRIT TWO;So;0;ON;;;;;N;;;;; 2EAE;CJK RADICAL BAMBOO;So;0;ON;;;;;N;;;;; 2EAF;CJK RADICAL SILK;So;0;ON;;;;;N;;;;; 2EB0;CJK RADICAL C-SIMPLIFIED SILK;So;0;ON;;;;;N;;;;; 2EB1;CJK RADICAL NET ONE;So;0;ON;;;;;N;;;;; 2EB2;CJK RADICAL NET TWO;So;0;ON;;;;;N;;;;; 2EB3;CJK RADICAL NET THREE;So;0;ON;;;;;N;;;;; 2EB4;CJK RADICAL NET FOUR;So;0;ON;;;;;N;;;;; 2EB5;CJK RADICAL MESH;So;0;ON;;;;;N;;;;; 2EB6;CJK RADICAL SHEEP;So;0;ON;;;;;N;;;;; 2EB7;CJK RADICAL RAM;So;0;ON;;;;;N;;;;; 2EB8;CJK RADICAL EWE;So;0;ON;;;;;N;;;;; 2EB9;CJK RADICAL OLD;So;0;ON;;;;;N;;;;; 2EBA;CJK RADICAL BRUSH ONE;So;0;ON;;;;;N;;;;; 2EBB;CJK RADICAL BRUSH TWO;So;0;ON;;;;;N;;;;; 2EBC;CJK RADICAL MEAT;So;0;ON;;;;;N;;;;; 2EBD;CJK RADICAL MORTAR;So;0;ON;;;;;N;;;;; 2EBE;CJK RADICAL GRASS ONE;So;0;ON;;;;;N;;;;; 2EBF;CJK RADICAL GRASS TWO;So;0;ON;;;;;N;;;;; 2EC0;CJK RADICAL GRASS THREE;So;0;ON;;;;;N;;;;; 2EC1;CJK RADICAL TIGER;So;0;ON;;;;;N;;;;; 2EC2;CJK RADICAL CLOTHES;So;0;ON;;;;;N;;;;; 2EC3;CJK RADICAL WEST ONE;So;0;ON;;;;;N;;;;; 2EC4;CJK RADICAL WEST TWO;So;0;ON;;;;;N;;;;; 2EC5;CJK RADICAL C-SIMPLIFIED SEE;So;0;ON;;;;;N;;;;; 2EC6;CJK RADICAL SIMPLIFIED HORN;So;0;ON;;;;;N;;;;; 2EC7;CJK RADICAL HORN;So;0;ON;;;;;N;;;;; 2EC8;CJK RADICAL C-SIMPLIFIED SPEECH;So;0;ON;;;;;N;;;;; 2EC9;CJK RADICAL C-SIMPLIFIED SHELL;So;0;ON;;;;;N;;;;; 2ECA;CJK RADICAL FOOT;So;0;ON;;;;;N;;;;; 2ECB;CJK RADICAL C-SIMPLIFIED CART;So;0;ON;;;;;N;;;;; 2ECC;CJK RADICAL SIMPLIFIED WALK;So;0;ON;;;;;N;;;;; 2ECD;CJK RADICAL WALK ONE;So;0;ON;;;;;N;;;;; 2ECE;CJK RADICAL WALK TWO;So;0;ON;;;;;N;;;;; 2ECF;CJK RADICAL CITY;So;0;ON;;;;;N;;;;; 2ED0;CJK RADICAL C-SIMPLIFIED GOLD;So;0;ON;;;;;N;;;;; 2ED1;CJK RADICAL LONG ONE;So;0;ON;;;;;N;;;;; 2ED2;CJK RADICAL LONG TWO;So;0;ON;;;;;N;;;;; 2ED3;CJK RADICAL C-SIMPLIFIED LONG;So;0;ON;;;;;N;;;;; 2ED4;CJK RADICAL C-SIMPLIFIED GATE;So;0;ON;;;;;N;;;;; 2ED5;CJK RADICAL MOUND ONE;So;0;ON;;;;;N;;;;; 2ED6;CJK RADICAL MOUND TWO;So;0;ON;;;;;N;;;;; 2ED7;CJK RADICAL RAIN;So;0;ON;;;;;N;;;;; 2ED8;CJK RADICAL BLUE;So;0;ON;;;;;N;;;;; 2ED9;CJK RADICAL C-SIMPLIFIED TANNED LEATHER;So;0;ON;;;;;N;;;;; 2EDA;CJK RADICAL C-SIMPLIFIED LEAF;So;0;ON;;;;;N;;;;; 2EDB;CJK RADICAL C-SIMPLIFIED WIND;So;0;ON;;;;;N;;;;; 2EDC;CJK RADICAL C-SIMPLIFIED FLY;So;0;ON;;;;;N;;;;; 2EDD;CJK RADICAL EAT ONE;So;0;ON;;;;;N;;;;; 2EDE;CJK RADICAL EAT TWO;So;0;ON;;;;;N;;;;; 2EDF;CJK RADICAL EAT THREE;So;0;ON;;;;;N;;;;; 2EE0;CJK RADICAL C-SIMPLIFIED EAT;So;0;ON;;;;;N;;;;; 2EE1;CJK RADICAL HEAD;So;0;ON;;;;;N;;;;; 2EE2;CJK RADICAL C-SIMPLIFIED HORSE;So;0;ON;;;;;N;;;;; 2EE3;CJK RADICAL BONE;So;0;ON;;;;;N;;;;; 2EE4;CJK RADICAL GHOST;So;0;ON;;;;;N;;;;; 2EE5;CJK RADICAL C-SIMPLIFIED FISH;So;0;ON;;;;;N;;;;; 2EE6;CJK RADICAL C-SIMPLIFIED BIRD;So;0;ON;;;;;N;;;;; 2EE7;CJK RADICAL C-SIMPLIFIED SALT;So;0;ON;;;;;N;;;;; 2EE8;CJK RADICAL SIMPLIFIED WHEAT;So;0;ON;;;;;N;;;;; 2EE9;CJK RADICAL SIMPLIFIED YELLOW;So;0;ON;;;;;N;;;;; 2EEA;CJK RADICAL C-SIMPLIFIED FROG;So;0;ON;;;;;N;;;;; 2EEB;CJK RADICAL J-SIMPLIFIED EVEN;So;0;ON;;;;;N;;;;; 2EEC;CJK RADICAL C-SIMPLIFIED EVEN;So;0;ON;;;;;N;;;;; 2EED;CJK RADICAL J-SIMPLIFIED TOOTH;So;0;ON;;;;;N;;;;; 2EEE;CJK RADICAL C-SIMPLIFIED TOOTH;So;0;ON;;;;;N;;;;; 2EEF;CJK RADICAL J-SIMPLIFIED DRAGON;So;0;ON;;;;;N;;;;; 2EF0;CJK RADICAL C-SIMPLIFIED DRAGON;So;0;ON;;;;;N;;;;; 2EF1;CJK RADICAL TURTLE;So;0;ON;;;;;N;;;;; 2EF2;CJK RADICAL J-SIMPLIFIED TURTLE;So;0;ON;;;;;N;;;;; 2EF3;CJK RADICAL C-SIMPLIFIED TURTLE;So;0;ON; 9F9F;;;;N;;;;; 2F00;KANGXI RADICAL ONE;So;0;ON; 4E00;;;;N;;;;; 2F01;KANGXI RADICAL LINE;So;0;ON; 4E28;;;;N;;;;; 2F02;KANGXI RADICAL DOT;So;0;ON; 4E36;;;;N;;;;; 2F03;KANGXI RADICAL SLASH;So;0;ON; 4E3F;;;;N;;;;; 2F04;KANGXI RADICAL SECOND;So;0;ON; 4E59;;;;N;;;;; 2F05;KANGXI RADICAL HOOK;So;0;ON; 4E85;;;;N;;;;; 2F06;KANGXI RADICAL TWO;So;0;ON; 4E8C;;;;N;;;;; 2F07;KANGXI RADICAL LID;So;0;ON; 4EA0;;;;N;;;;; 2F08;KANGXI RADICAL MAN;So;0;ON; 4EBA;;;;N;;;;; 2F09;KANGXI RADICAL LEGS;So;0;ON; 513F;;;;N;;;;; 2F0A;KANGXI RADICAL ENTER;So;0;ON; 5165;;;;N;;;;; 2F0B;KANGXI RADICAL EIGHT;So;0;ON; 516B;;;;N;;;;; 2F0C;KANGXI RADICAL DOWN BOX;So;0;ON; 5182;;;;N;;;;; 2F0D;KANGXI RADICAL COVER;So;0;ON; 5196;;;;N;;;;; 2F0E;KANGXI RADICAL ICE;So;0;ON; 51AB;;;;N;;;;; 2F0F;KANGXI RADICAL TABLE;So;0;ON; 51E0;;;;N;;;;; 2F10;KANGXI RADICAL OPEN BOX;So;0;ON; 51F5;;;;N;;;;; 2F11;KANGXI RADICAL KNIFE;So;0;ON; 5200;;;;N;;;;; 2F12;KANGXI RADICAL POWER;So;0;ON; 529B;;;;N;;;;; 2F13;KANGXI RADICAL WRAP;So;0;ON; 52F9;;;;N;;;;; 2F14;KANGXI RADICAL SPOON;So;0;ON; 5315;;;;N;;;;; 2F15;KANGXI RADICAL RIGHT OPEN BOX;So;0;ON; 531A;;;;N;;;;; 2F16;KANGXI RADICAL HIDING ENCLOSURE;So;0;ON; 5338;;;;N;;;;; 2F17;KANGXI RADICAL TEN;So;0;ON; 5341;;;;N;;;;; 2F18;KANGXI RADICAL DIVINATION;So;0;ON; 535C;;;;N;;;;; 2F19;KANGXI RADICAL SEAL;So;0;ON; 5369;;;;N;;;;; 2F1A;KANGXI RADICAL CLIFF;So;0;ON; 5382;;;;N;;;;; 2F1B;KANGXI RADICAL PRIVATE;So;0;ON; 53B6;;;;N;;;;; 2F1C;KANGXI RADICAL AGAIN;So;0;ON; 53C8;;;;N;;;;; 2F1D;KANGXI RADICAL MOUTH;So;0;ON; 53E3;;;;N;;;;; 2F1E;KANGXI RADICAL ENCLOSURE;So;0;ON; 56D7;;;;N;;;;; 2F1F;KANGXI RADICAL EARTH;So;0;ON; 571F;;;;N;;;;; 2F20;KANGXI RADICAL SCHOLAR;So;0;ON; 58EB;;;;N;;;;; 2F21;KANGXI RADICAL GO;So;0;ON; 5902;;;;N;;;;; 2F22;KANGXI RADICAL GO SLOWLY;So;0;ON; 590A;;;;N;;;;; 2F23;KANGXI RADICAL EVENING;So;0;ON; 5915;;;;N;;;;; 2F24;KANGXI RADICAL BIG;So;0;ON; 5927;;;;N;;;;; 2F25;KANGXI RADICAL WOMAN;So;0;ON; 5973;;;;N;;;;; 2F26;KANGXI RADICAL CHILD;So;0;ON; 5B50;;;;N;;;;; 2F27;KANGXI RADICAL ROOF;So;0;ON; 5B80;;;;N;;;;; 2F28;KANGXI RADICAL INCH;So;0;ON; 5BF8;;;;N;;;;; 2F29;KANGXI RADICAL SMALL;So;0;ON; 5C0F;;;;N;;;;; 2F2A;KANGXI RADICAL LAME;So;0;ON; 5C22;;;;N;;;;; 2F2B;KANGXI RADICAL CORPSE;So;0;ON; 5C38;;;;N;;;;; 2F2C;KANGXI RADICAL SPROUT;So;0;ON; 5C6E;;;;N;;;;; 2F2D;KANGXI RADICAL MOUNTAIN;So;0;ON; 5C71;;;;N;;;;; 2F2E;KANGXI RADICAL RIVER;So;0;ON; 5DDB;;;;N;;;;; 2F2F;KANGXI RADICAL WORK;So;0;ON; 5DE5;;;;N;;;;; 2F30;KANGXI RADICAL ONESELF;So;0;ON; 5DF1;;;;N;;;;; 2F31;KANGXI RADICAL TURBAN;So;0;ON; 5DFE;;;;N;;;;; 2F32;KANGXI RADICAL DRY;So;0;ON; 5E72;;;;N;;;;; 2F33;KANGXI RADICAL SHORT THREAD;So;0;ON; 5E7A;;;;N;;;;; 2F34;KANGXI RADICAL DOTTED CLIFF;So;0;ON; 5E7F;;;;N;;;;; 2F35;KANGXI RADICAL LONG STRIDE;So;0;ON; 5EF4;;;;N;;;;; 2F36;KANGXI RADICAL TWO HANDS;So;0;ON; 5EFE;;;;N;;;;; 2F37;KANGXI RADICAL SHOOT;So;0;ON; 5F0B;;;;N;;;;; 2F38;KANGXI RADICAL BOW;So;0;ON; 5F13;;;;N;;;;; 2F39;KANGXI RADICAL SNOUT;So;0;ON; 5F50;;;;N;;;;; 2F3A;KANGXI RADICAL BRISTLE;So;0;ON; 5F61;;;;N;;;;; 2F3B;KANGXI RADICAL STEP;So;0;ON; 5F73;;;;N;;;;; 2F3C;KANGXI RADICAL HEART;So;0;ON; 5FC3;;;;N;;;;; 2F3D;KANGXI RADICAL HALBERD;So;0;ON; 6208;;;;N;;;;; 2F3E;KANGXI RADICAL DOOR;So;0;ON; 6236;;;;N;;;;; 2F3F;KANGXI RADICAL HAND;So;0;ON; 624B;;;;N;;;;; 2F40;KANGXI RADICAL BRANCH;So;0;ON; 652F;;;;N;;;;; 2F41;KANGXI RADICAL RAP;So;0;ON; 6534;;;;N;;;;; 2F42;KANGXI RADICAL SCRIPT;So;0;ON; 6587;;;;N;;;;; 2F43;KANGXI RADICAL DIPPER;So;0;ON; 6597;;;;N;;;;; 2F44;KANGXI RADICAL AXE;So;0;ON; 65A4;;;;N;;;;; 2F45;KANGXI RADICAL SQUARE;So;0;ON; 65B9;;;;N;;;;; 2F46;KANGXI RADICAL NOT;So;0;ON; 65E0;;;;N;;;;; 2F47;KANGXI RADICAL SUN;So;0;ON; 65E5;;;;N;;;;; 2F48;KANGXI RADICAL SAY;So;0;ON; 66F0;;;;N;;;;; 2F49;KANGXI RADICAL MOON;So;0;ON; 6708;;;;N;;;;; 2F4A;KANGXI RADICAL TREE;So;0;ON; 6728;;;;N;;;;; 2F4B;KANGXI RADICAL LACK;So;0;ON; 6B20;;;;N;;;;; 2F4C;KANGXI RADICAL STOP;So;0;ON; 6B62;;;;N;;;;; 2F4D;KANGXI RADICAL DEATH;So;0;ON; 6B79;;;;N;;;;; 2F4E;KANGXI RADICAL WEAPON;So;0;ON; 6BB3;;;;N;;;;; 2F4F;KANGXI RADICAL DO NOT;So;0;ON; 6BCB;;;;N;;;;; 2F50;KANGXI RADICAL COMPARE;So;0;ON; 6BD4;;;;N;;;;; 2F51;KANGXI RADICAL FUR;So;0;ON; 6BDB;;;;N;;;;; 2F52;KANGXI RADICAL CLAN;So;0;ON; 6C0F;;;;N;;;;; 2F53;KANGXI RADICAL STEAM;So;0;ON; 6C14;;;;N;;;;; 2F54;KANGXI RADICAL WATER;So;0;ON; 6C34;;;;N;;;;; 2F55;KANGXI RADICAL FIRE;So;0;ON; 706B;;;;N;;;;; 2F56;KANGXI RADICAL CLAW;So;0;ON; 722A;;;;N;;;;; 2F57;KANGXI RADICAL FATHER;So;0;ON; 7236;;;;N;;;;; 2F58;KANGXI RADICAL DOUBLE X;So;0;ON; 723B;;;;N;;;;; 2F59;KANGXI RADICAL HALF TREE TRUNK;So;0;ON; 723F;;;;N;;;;; 2F5A;KANGXI RADICAL SLICE;So;0;ON; 7247;;;;N;;;;; 2F5B;KANGXI RADICAL FANG;So;0;ON; 7259;;;;N;;;;; 2F5C;KANGXI RADICAL COW;So;0;ON; 725B;;;;N;;;;; 2F5D;KANGXI RADICAL DOG;So;0;ON; 72AC;;;;N;;;;; 2F5E;KANGXI RADICAL PROFOUND;So;0;ON; 7384;;;;N;;;;; 2F5F;KANGXI RADICAL JADE;So;0;ON; 7389;;;;N;;;;; 2F60;KANGXI RADICAL MELON;So;0;ON; 74DC;;;;N;;;;; 2F61;KANGXI RADICAL TILE;So;0;ON; 74E6;;;;N;;;;; 2F62;KANGXI RADICAL SWEET;So;0;ON; 7518;;;;N;;;;; 2F63;KANGXI RADICAL LIFE;So;0;ON; 751F;;;;N;;;;; 2F64;KANGXI RADICAL USE;So;0;ON; 7528;;;;N;;;;; 2F65;KANGXI RADICAL FIELD;So;0;ON; 7530;;;;N;;;;; 2F66;KANGXI RADICAL BOLT OF CLOTH;So;0;ON; 758B;;;;N;;;;; 2F67;KANGXI RADICAL SICKNESS;So;0;ON; 7592;;;;N;;;;; 2F68;KANGXI RADICAL DOTTED TENT;So;0;ON; 7676;;;;N;;;;; 2F69;KANGXI RADICAL WHITE;So;0;ON; 767D;;;;N;;;;; 2F6A;KANGXI RADICAL SKIN;So;0;ON; 76AE;;;;N;;;;; 2F6B;KANGXI RADICAL DISH;So;0;ON; 76BF;;;;N;;;;; 2F6C;KANGXI RADICAL EYE;So;0;ON; 76EE;;;;N;;;;; 2F6D;KANGXI RADICAL SPEAR;So;0;ON; 77DB;;;;N;;;;; 2F6E;KANGXI RADICAL ARROW;So;0;ON; 77E2;;;;N;;;;; 2F6F;KANGXI RADICAL STONE;So;0;ON; 77F3;;;;N;;;;; 2F70;KANGXI RADICAL SPIRIT;So;0;ON; 793A;;;;N;;;;; 2F71;KANGXI RADICAL TRACK;So;0;ON; 79B8;;;;N;;;;; 2F72;KANGXI RADICAL GRAIN;So;0;ON; 79BE;;;;N;;;;; 2F73;KANGXI RADICAL CAVE;So;0;ON; 7A74;;;;N;;;;; 2F74;KANGXI RADICAL STAND;So;0;ON; 7ACB;;;;N;;;;; 2F75;KANGXI RADICAL BAMBOO;So;0;ON; 7AF9;;;;N;;;;; 2F76;KANGXI RADICAL RICE;So;0;ON; 7C73;;;;N;;;;; 2F77;KANGXI RADICAL SILK;So;0;ON; 7CF8;;;;N;;;;; 2F78;KANGXI RADICAL JAR;So;0;ON; 7F36;;;;N;;;;; 2F79;KANGXI RADICAL NET;So;0;ON; 7F51;;;;N;;;;; 2F7A;KANGXI RADICAL SHEEP;So;0;ON; 7F8A;;;;N;;;;; 2F7B;KANGXI RADICAL FEATHER;So;0;ON; 7FBD;;;;N;;;;; 2F7C;KANGXI RADICAL OLD;So;0;ON; 8001;;;;N;;;;; 2F7D;KANGXI RADICAL AND;So;0;ON; 800C;;;;N;;;;; 2F7E;KANGXI RADICAL PLOW;So;0;ON; 8012;;;;N;;;;; 2F7F;KANGXI RADICAL EAR;So;0;ON; 8033;;;;N;;;;; 2F80;KANGXI RADICAL BRUSH;So;0;ON; 807F;;;;N;;;;; 2F81;KANGXI RADICAL MEAT;So;0;ON; 8089;;;;N;;;;; 2F82;KANGXI RADICAL MINISTER;So;0;ON; 81E3;;;;N;;;;; 2F83;KANGXI RADICAL SELF;So;0;ON; 81EA;;;;N;;;;; 2F84;KANGXI RADICAL ARRIVE;So;0;ON; 81F3;;;;N;;;;; 2F85;KANGXI RADICAL MORTAR;So;0;ON; 81FC;;;;N;;;;; 2F86;KANGXI RADICAL TONGUE;So;0;ON; 820C;;;;N;;;;; 2F87;KANGXI RADICAL OPPOSE;So;0;ON; 821B;;;;N;;;;; 2F88;KANGXI RADICAL BOAT;So;0;ON; 821F;;;;N;;;;; 2F89;KANGXI RADICAL STOPPING;So;0;ON; 826E;;;;N;;;;; 2F8A;KANGXI RADICAL COLOR;So;0;ON; 8272;;;;N;;;;; 2F8B;KANGXI RADICAL GRASS;So;0;ON; 8278;;;;N;;;;; 2F8C;KANGXI RADICAL TIGER;So;0;ON; 864D;;;;N;;;;; 2F8D;KANGXI RADICAL INSECT;So;0;ON; 866B;;;;N;;;;; 2F8E;KANGXI RADICAL BLOOD;So;0;ON; 8840;;;;N;;;;; 2F8F;KANGXI RADICAL WALK ENCLOSURE;So;0;ON; 884C;;;;N;;;;; 2F90;KANGXI RADICAL CLOTHES;So;0;ON; 8863;;;;N;;;;; 2F91;KANGXI RADICAL WEST;So;0;ON; 897E;;;;N;;;;; 2F92;KANGXI RADICAL SEE;So;0;ON; 898B;;;;N;;;;; 2F93;KANGXI RADICAL HORN;So;0;ON; 89D2;;;;N;;;;; 2F94;KANGXI RADICAL SPEECH;So;0;ON; 8A00;;;;N;;;;; 2F95;KANGXI RADICAL VALLEY;So;0;ON; 8C37;;;;N;;;;; 2F96;KANGXI RADICAL BEAN;So;0;ON; 8C46;;;;N;;;;; 2F97;KANGXI RADICAL PIG;So;0;ON; 8C55;;;;N;;;;; 2F98;KANGXI RADICAL BADGER;So;0;ON; 8C78;;;;N;;;;; 2F99;KANGXI RADICAL SHELL;So;0;ON; 8C9D;;;;N;;;;; 2F9A;KANGXI RADICAL RED;So;0;ON; 8D64;;;;N;;;;; 2F9B;KANGXI RADICAL RUN;So;0;ON; 8D70;;;;N;;;;; 2F9C;KANGXI RADICAL FOOT;So;0;ON; 8DB3;;;;N;;;;; 2F9D;KANGXI RADICAL BODY;So;0;ON; 8EAB;;;;N;;;;; 2F9E;KANGXI RADICAL CART;So;0;ON; 8ECA;;;;N;;;;; 2F9F;KANGXI RADICAL BITTER;So;0;ON; 8F9B;;;;N;;;;; 2FA0;KANGXI RADICAL MORNING;So;0;ON; 8FB0;;;;N;;;;; 2FA1;KANGXI RADICAL WALK;So;0;ON; 8FB5;;;;N;;;;; 2FA2;KANGXI RADICAL CITY;So;0;ON; 9091;;;;N;;;;; 2FA3;KANGXI RADICAL WINE;So;0;ON; 9149;;;;N;;;;; 2FA4;KANGXI RADICAL DISTINGUISH;So;0;ON; 91C6;;;;N;;;;; 2FA5;KANGXI RADICAL VILLAGE;So;0;ON; 91CC;;;;N;;;;; 2FA6;KANGXI RADICAL GOLD;So;0;ON; 91D1;;;;N;;;;; 2FA7;KANGXI RADICAL LONG;So;0;ON; 9577;;;;N;;;;; 2FA8;KANGXI RADICAL GATE;So;0;ON; 9580;;;;N;;;;; 2FA9;KANGXI RADICAL MOUND;So;0;ON; 961C;;;;N;;;;; 2FAA;KANGXI RADICAL SLAVE;So;0;ON; 96B6;;;;N;;;;; 2FAB;KANGXI RADICAL SHORT TAILED BIRD;So;0;ON; 96B9;;;;N;;;;; 2FAC;KANGXI RADICAL RAIN;So;0;ON; 96E8;;;;N;;;;; 2FAD;KANGXI RADICAL BLUE;So;0;ON; 9751;;;;N;;;;; 2FAE;KANGXI RADICAL WRONG;So;0;ON; 975E;;;;N;;;;; 2FAF;KANGXI RADICAL FACE;So;0;ON; 9762;;;;N;;;;; 2FB0;KANGXI RADICAL LEATHER;So;0;ON; 9769;;;;N;;;;; 2FB1;KANGXI RADICAL TANNED LEATHER;So;0;ON; 97CB;;;;N;;;;; 2FB2;KANGXI RADICAL LEEK;So;0;ON; 97ED;;;;N;;;;; 2FB3;KANGXI RADICAL SOUND;So;0;ON; 97F3;;;;N;;;;; 2FB4;KANGXI RADICAL LEAF;So;0;ON; 9801;;;;N;;;;; 2FB5;KANGXI RADICAL WIND;So;0;ON; 98A8;;;;N;;;;; 2FB6;KANGXI RADICAL FLY;So;0;ON; 98DB;;;;N;;;;; 2FB7;KANGXI RADICAL EAT;So;0;ON; 98DF;;;;N;;;;; 2FB8;KANGXI RADICAL HEAD;So;0;ON; 9996;;;;N;;;;; 2FB9;KANGXI RADICAL FRAGRANT;So;0;ON; 9999;;;;N;;;;; 2FBA;KANGXI RADICAL HORSE;So;0;ON; 99AC;;;;N;;;;; 2FBB;KANGXI RADICAL BONE;So;0;ON; 9AA8;;;;N;;;;; 2FBC;KANGXI RADICAL TALL;So;0;ON; 9AD8;;;;N;;;;; 2FBD;KANGXI RADICAL HAIR;So;0;ON; 9ADF;;;;N;;;;; 2FBE;KANGXI RADICAL FIGHT;So;0;ON; 9B25;;;;N;;;;; 2FBF;KANGXI RADICAL SACRIFICIAL WINE;So;0;ON; 9B2F;;;;N;;;;; 2FC0;KANGXI RADICAL CAULDRON;So;0;ON; 9B32;;;;N;;;;; 2FC1;KANGXI RADICAL GHOST;So;0;ON; 9B3C;;;;N;;;;; 2FC2;KANGXI RADICAL FISH;So;0;ON; 9B5A;;;;N;;;;; 2FC3;KANGXI RADICAL BIRD;So;0;ON; 9CE5;;;;N;;;;; 2FC4;KANGXI RADICAL SALT;So;0;ON; 9E75;;;;N;;;;; 2FC5;KANGXI RADICAL DEER;So;0;ON; 9E7F;;;;N;;;;; 2FC6;KANGXI RADICAL WHEAT;So;0;ON; 9EA5;;;;N;;;;; 2FC7;KANGXI RADICAL HEMP;So;0;ON; 9EBB;;;;N;;;;; 2FC8;KANGXI RADICAL YELLOW;So;0;ON; 9EC3;;;;N;;;;; 2FC9;KANGXI RADICAL MILLET;So;0;ON; 9ECD;;;;N;;;;; 2FCA;KANGXI RADICAL BLACK;So;0;ON; 9ED1;;;;N;;;;; 2FCB;KANGXI RADICAL EMBROIDERY;So;0;ON; 9EF9;;;;N;;;;; 2FCC;KANGXI RADICAL FROG;So;0;ON; 9EFD;;;;N;;;;; 2FCD;KANGXI RADICAL TRIPOD;So;0;ON; 9F0E;;;;N;;;;; 2FCE;KANGXI RADICAL DRUM;So;0;ON; 9F13;;;;N;;;;; 2FCF;KANGXI RADICAL RAT;So;0;ON; 9F20;;;;N;;;;; 2FD0;KANGXI RADICAL NOSE;So;0;ON; 9F3B;;;;N;;;;; 2FD1;KANGXI RADICAL EVEN;So;0;ON; 9F4A;;;;N;;;;; 2FD2;KANGXI RADICAL TOOTH;So;0;ON; 9F52;;;;N;;;;; 2FD3;KANGXI RADICAL DRAGON;So;0;ON; 9F8D;;;;N;;;;; 2FD4;KANGXI RADICAL TURTLE;So;0;ON; 9F9C;;;;N;;;;; 2FD5;KANGXI RADICAL FLUTE;So;0;ON; 9FA0;;;;N;;;;; 2FF0;IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT;So;0;ON;;;;;N;;;;; 2FF1;IDEOGRAPHIC DESCRIPTION CHARACTER ABOVE TO BELOW;So;0;ON;;;;;N;;;;; 2FF2;IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO MIDDLE AND RIGHT;So;0;ON;;;;;N;;;;; 2FF3;IDEOGRAPHIC DESCRIPTION CHARACTER ABOVE TO MIDDLE AND BELOW;So;0;ON;;;;;N;;;;; 2FF4;IDEOGRAPHIC DESCRIPTION CHARACTER FULL SURROUND;So;0;ON;;;;;N;;;;; 2FF5;IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM ABOVE;So;0;ON;;;;;N;;;;; 2FF6;IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM BELOW;So;0;ON;;;;;N;;;;; 2FF7;IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM LEFT;So;0;ON;;;;;N;;;;; 2FF8;IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM UPPER LEFT;So;0;ON;;;;;N;;;;; 2FF9;IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM UPPER RIGHT;So;0;ON;;;;;N;;;;; 2FFA;IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM LOWER LEFT;So;0;ON;;;;;N;;;;; 2FFB;IDEOGRAPHIC DESCRIPTION CHARACTER OVERLAID;So;0;ON;;;;;N;;;;; 3000;IDEOGRAPHIC SPACE;Zs;0;WS; 0020;;;;N;;;;; 3001;IDEOGRAPHIC COMMA;Po;0;ON;;;;;N;;;;; 3002;IDEOGRAPHIC FULL STOP;Po;0;ON;;;;;N;IDEOGRAPHIC PERIOD;;;; 3003;DITTO MARK;Po;0;ON;;;;;N;;;;; 3004;JAPANESE INDUSTRIAL STANDARD SYMBOL;So;0;ON;;;;;N;;;;; 3005;IDEOGRAPHIC ITERATION MARK;Lm;0;L;;;;;N;;;;; 3006;IDEOGRAPHIC CLOSING MARK;Lo;0;L;;;;;N;;;;; 3007;IDEOGRAPHIC NUMBER ZERO;Nl;0;L;;;;0;N;;;;; 3008;LEFT ANGLE BRACKET;Ps;0;ON;;;;;Y;OPENING ANGLE BRACKET;;;; 3009;RIGHT ANGLE BRACKET;Pe;0;ON;;;;;Y;CLOSING ANGLE BRACKET;;;; 300A;LEFT DOUBLE ANGLE BRACKET;Ps;0;ON;;;;;Y;OPENING DOUBLE ANGLE BRACKET;;;; 300B;RIGHT DOUBLE ANGLE BRACKET;Pe;0;ON;;;;;Y;CLOSING DOUBLE ANGLE BRACKET;;;; 300C;LEFT CORNER BRACKET;Ps;0;ON;;;;;Y;OPENING CORNER BRACKET;;;; 300D;RIGHT CORNER BRACKET;Pe;0;ON;;;;;Y;CLOSING CORNER BRACKET;;;; 300E;LEFT WHITE CORNER BRACKET;Ps;0;ON;;;;;Y;OPENING WHITE CORNER BRACKET;;;; 300F;RIGHT WHITE CORNER BRACKET;Pe;0;ON;;;;;Y;CLOSING WHITE CORNER BRACKET;;;; 3010;LEFT BLACK LENTICULAR BRACKET;Ps;0;ON;;;;;Y;OPENING BLACK LENTICULAR BRACKET;;;; 3011;RIGHT BLACK LENTICULAR BRACKET;Pe;0;ON;;;;;Y;CLOSING BLACK LENTICULAR BRACKET;;;; 3012;POSTAL MARK;So;0;ON;;;;;N;;;;; 3013;GETA MARK;So;0;ON;;;;;N;;;;; 3014;LEFT TORTOISE SHELL BRACKET;Ps;0;ON;;;;;Y;OPENING TORTOISE SHELL BRACKET;;;; 3015;RIGHT TORTOISE SHELL BRACKET;Pe;0;ON;;;;;Y;CLOSING TORTOISE SHELL BRACKET;;;; 3016;LEFT WHITE LENTICULAR BRACKET;Ps;0;ON;;;;;Y;OPENING WHITE LENTICULAR BRACKET;;;; 3017;RIGHT WHITE LENTICULAR BRACKET;Pe;0;ON;;;;;Y;CLOSING WHITE LENTICULAR BRACKET;;;; 3018;LEFT WHITE TORTOISE SHELL BRACKET;Ps;0;ON;;;;;Y;OPENING WHITE TORTOISE SHELL BRACKET;;;; 3019;RIGHT WHITE TORTOISE SHELL BRACKET;Pe;0;ON;;;;;Y;CLOSING WHITE TORTOISE SHELL BRACKET;;;; 301A;LEFT WHITE SQUARE BRACKET;Ps;0;ON;;;;;Y;OPENING WHITE SQUARE BRACKET;;;; 301B;RIGHT WHITE SQUARE BRACKET;Pe;0;ON;;;;;Y;CLOSING WHITE SQUARE BRACKET;;;; 301C;WAVE DASH;Pd;0;ON;;;;;N;;;;; 301D;REVERSED DOUBLE PRIME QUOTATION MARK;Ps;0;ON;;;;;N;;;;; 301E;DOUBLE PRIME QUOTATION MARK;Pe;0;ON;;;;;N;;;;; 301F;LOW DOUBLE PRIME QUOTATION MARK;Pe;0;ON;;;;;N;;;;; 3020;POSTAL MARK FACE;So;0;ON;;;;;N;;;;; 3021;HANGZHOU NUMERAL ONE;Nl;0;L;;;;1;N;;;;; 3022;HANGZHOU NUMERAL TWO;Nl;0;L;;;;2;N;;;;; 3023;HANGZHOU NUMERAL THREE;Nl;0;L;;;;3;N;;;;; 3024;HANGZHOU NUMERAL FOUR;Nl;0;L;;;;4;N;;;;; 3025;HANGZHOU NUMERAL FIVE;Nl;0;L;;;;5;N;;;;; 3026;HANGZHOU NUMERAL SIX;Nl;0;L;;;;6;N;;;;; 3027;HANGZHOU NUMERAL SEVEN;Nl;0;L;;;;7;N;;;;; 3028;HANGZHOU NUMERAL EIGHT;Nl;0;L;;;;8;N;;;;; 3029;HANGZHOU NUMERAL NINE;Nl;0;L;;;;9;N;;;;; 302A;IDEOGRAPHIC LEVEL TONE MARK;Mn;218;NSM;;;;;N;;;;; 302B;IDEOGRAPHIC RISING TONE MARK;Mn;228;NSM;;;;;N;;;;; 302C;IDEOGRAPHIC DEPARTING TONE MARK;Mn;232;NSM;;;;;N;;;;; 302D;IDEOGRAPHIC ENTERING TONE MARK;Mn;222;NSM;;;;;N;;;;; 302E;HANGUL SINGLE DOT TONE MARK;Mc;224;L;;;;;N;;;;; 302F;HANGUL DOUBLE DOT TONE MARK;Mc;224;L;;;;;N;;;;; 3030;WAVY DASH;Pd;0;ON;;;;;N;;;;; 3031;VERTICAL KANA REPEAT MARK;Lm;0;L;;;;;N;;;;; 3032;VERTICAL KANA REPEAT WITH VOICED SOUND MARK;Lm;0;L;;;;;N;;;;; 3033;VERTICAL KANA REPEAT MARK UPPER HALF;Lm;0;L;;;;;N;;;;; 3034;VERTICAL KANA REPEAT WITH VOICED SOUND MARK UPPER HALF;Lm;0;L;;;;;N;;;;; 3035;VERTICAL KANA REPEAT MARK LOWER HALF;Lm;0;L;;;;;N;;;;; 3036;CIRCLED POSTAL MARK;So;0;ON; 3012;;;;N;;;;; 3037;IDEOGRAPHIC TELEGRAPH LINE FEED SEPARATOR SYMBOL;So;0;ON;;;;;N;;;;; 3038;HANGZHOU NUMERAL TEN;Nl;0;L; 5341;;;10;N;;;;; 3039;HANGZHOU NUMERAL TWENTY;Nl;0;L; 5344;;;20;N;;;;; 303A;HANGZHOU NUMERAL THIRTY;Nl;0;L; 5345;;;30;N;;;;; 303B;VERTICAL IDEOGRAPHIC ITERATION MARK;Lm;0;L;;;;;N;;;;; 303C;MASU MARK;Lo;0;L;;;;;N;;;;; 303D;PART ALTERNATION MARK;Po;0;ON;;;;;N;;;;; 303E;IDEOGRAPHIC VARIATION INDICATOR;So;0;ON;;;;;N;;;;; 303F;IDEOGRAPHIC HALF FILL SPACE;So;0;ON;;;;;N;;;;; 3041;HIRAGANA LETTER SMALL A;Lo;0;L;;;;;N;;;;; 3042;HIRAGANA LETTER A;Lo;0;L;;;;;N;;;;; 3043;HIRAGANA LETTER SMALL I;Lo;0;L;;;;;N;;;;; 3044;HIRAGANA LETTER I;Lo;0;L;;;;;N;;;;; 3045;HIRAGANA LETTER SMALL U;Lo;0;L;;;;;N;;;;; 3046;HIRAGANA LETTER U;Lo;0;L;;;;;N;;;;; 3047;HIRAGANA LETTER SMALL E;Lo;0;L;;;;;N;;;;; 3048;HIRAGANA LETTER E;Lo;0;L;;;;;N;;;;; 3049;HIRAGANA LETTER SMALL O;Lo;0;L;;;;;N;;;;; 304A;HIRAGANA LETTER O;Lo;0;L;;;;;N;;;;; 304B;HIRAGANA LETTER KA;Lo;0;L;;;;;N;;;;; 304C;HIRAGANA LETTER GA;Lo;0;L;304B 3099;;;;N;;;;; 304D;HIRAGANA LETTER KI;Lo;0;L;;;;;N;;;;; 304E;HIRAGANA LETTER GI;Lo;0;L;304D 3099;;;;N;;;;; 304F;HIRAGANA LETTER KU;Lo;0;L;;;;;N;;;;; 3050;HIRAGANA LETTER GU;Lo;0;L;304F 3099;;;;N;;;;; 3051;HIRAGANA LETTER KE;Lo;0;L;;;;;N;;;;; 3052;HIRAGANA LETTER GE;Lo;0;L;3051 3099;;;;N;;;;; 3053;HIRAGANA LETTER KO;Lo;0;L;;;;;N;;;;; 3054;HIRAGANA LETTER GO;Lo;0;L;3053 3099;;;;N;;;;; 3055;HIRAGANA LETTER SA;Lo;0;L;;;;;N;;;;; 3056;HIRAGANA LETTER ZA;Lo;0;L;3055 3099;;;;N;;;;; 3057;HIRAGANA LETTER SI;Lo;0;L;;;;;N;;;;; 3058;HIRAGANA LETTER ZI;Lo;0;L;3057 3099;;;;N;;;;; 3059;HIRAGANA LETTER SU;Lo;0;L;;;;;N;;;;; 305A;HIRAGANA LETTER ZU;Lo;0;L;3059 3099;;;;N;;;;; 305B;HIRAGANA LETTER SE;Lo;0;L;;;;;N;;;;; 305C;HIRAGANA LETTER ZE;Lo;0;L;305B 3099;;;;N;;;;; 305D;HIRAGANA LETTER SO;Lo;0;L;;;;;N;;;;; 305E;HIRAGANA LETTER ZO;Lo;0;L;305D 3099;;;;N;;;;; 305F;HIRAGANA LETTER TA;Lo;0;L;;;;;N;;;;; 3060;HIRAGANA LETTER DA;Lo;0;L;305F 3099;;;;N;;;;; 3061;HIRAGANA LETTER TI;Lo;0;L;;;;;N;;;;; 3062;HIRAGANA LETTER DI;Lo;0;L;3061 3099;;;;N;;;;; 3063;HIRAGANA LETTER SMALL TU;Lo;0;L;;;;;N;;;;; 3064;HIRAGANA LETTER TU;Lo;0;L;;;;;N;;;;; 3065;HIRAGANA LETTER DU;Lo;0;L;3064 3099;;;;N;;;;; 3066;HIRAGANA LETTER TE;Lo;0;L;;;;;N;;;;; 3067;HIRAGANA LETTER DE;Lo;0;L;3066 3099;;;;N;;;;; 3068;HIRAGANA LETTER TO;Lo;0;L;;;;;N;;;;; 3069;HIRAGANA LETTER DO;Lo;0;L;3068 3099;;;;N;;;;; 306A;HIRAGANA LETTER NA;Lo;0;L;;;;;N;;;;; 306B;HIRAGANA LETTER NI;Lo;0;L;;;;;N;;;;; 306C;HIRAGANA LETTER NU;Lo;0;L;;;;;N;;;;; 306D;HIRAGANA LETTER NE;Lo;0;L;;;;;N;;;;; 306E;HIRAGANA LETTER NO;Lo;0;L;;;;;N;;;;; 306F;HIRAGANA LETTER HA;Lo;0;L;;;;;N;;;;; 3070;HIRAGANA LETTER BA;Lo;0;L;306F 3099;;;;N;;;;; 3071;HIRAGANA LETTER PA;Lo;0;L;306F 309A;;;;N;;;;; 3072;HIRAGANA LETTER HI;Lo;0;L;;;;;N;;;;; 3073;HIRAGANA LETTER BI;Lo;0;L;3072 3099;;;;N;;;;; 3074;HIRAGANA LETTER PI;Lo;0;L;3072 309A;;;;N;;;;; 3075;HIRAGANA LETTER HU;Lo;0;L;;;;;N;;;;; 3076;HIRAGANA LETTER BU;Lo;0;L;3075 3099;;;;N;;;;; 3077;HIRAGANA LETTER PU;Lo;0;L;3075 309A;;;;N;;;;; 3078;HIRAGANA LETTER HE;Lo;0;L;;;;;N;;;;; 3079;HIRAGANA LETTER BE;Lo;0;L;3078 3099;;;;N;;;;; 307A;HIRAGANA LETTER PE;Lo;0;L;3078 309A;;;;N;;;;; 307B;HIRAGANA LETTER HO;Lo;0;L;;;;;N;;;;; 307C;HIRAGANA LETTER BO;Lo;0;L;307B 3099;;;;N;;;;; 307D;HIRAGANA LETTER PO;Lo;0;L;307B 309A;;;;N;;;;; 307E;HIRAGANA LETTER MA;Lo;0;L;;;;;N;;;;; 307F;HIRAGANA LETTER MI;Lo;0;L;;;;;N;;;;; 3080;HIRAGANA LETTER MU;Lo;0;L;;;;;N;;;;; 3081;HIRAGANA LETTER ME;Lo;0;L;;;;;N;;;;; 3082;HIRAGANA LETTER MO;Lo;0;L;;;;;N;;;;; 3083;HIRAGANA LETTER SMALL YA;Lo;0;L;;;;;N;;;;; 3084;HIRAGANA LETTER YA;Lo;0;L;;;;;N;;;;; 3085;HIRAGANA LETTER SMALL YU;Lo;0;L;;;;;N;;;;; 3086;HIRAGANA LETTER YU;Lo;0;L;;;;;N;;;;; 3087;HIRAGANA LETTER SMALL YO;Lo;0;L;;;;;N;;;;; 3088;HIRAGANA LETTER YO;Lo;0;L;;;;;N;;;;; 3089;HIRAGANA LETTER RA;Lo;0;L;;;;;N;;;;; 308A;HIRAGANA LETTER RI;Lo;0;L;;;;;N;;;;; 308B;HIRAGANA LETTER RU;Lo;0;L;;;;;N;;;;; 308C;HIRAGANA LETTER RE;Lo;0;L;;;;;N;;;;; 308D;HIRAGANA LETTER RO;Lo;0;L;;;;;N;;;;; 308E;HIRAGANA LETTER SMALL WA;Lo;0;L;;;;;N;;;;; 308F;HIRAGANA LETTER WA;Lo;0;L;;;;;N;;;;; 3090;HIRAGANA LETTER WI;Lo;0;L;;;;;N;;;;; 3091;HIRAGANA LETTER WE;Lo;0;L;;;;;N;;;;; 3092;HIRAGANA LETTER WO;Lo;0;L;;;;;N;;;;; 3093;HIRAGANA LETTER N;Lo;0;L;;;;;N;;;;; 3094;HIRAGANA LETTER VU;Lo;0;L;3046 3099;;;;N;;;;; 3095;HIRAGANA LETTER SMALL KA;Lo;0;L;;;;;N;;;;; 3096;HIRAGANA LETTER SMALL KE;Lo;0;L;;;;;N;;;;; 3099;COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK;Mn;8;NSM;;;;;N;NON-SPACING KATAKANA-HIRAGANA VOICED SOUND MARK;;;; 309A;COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK;Mn;8;NSM;;;;;N;NON-SPACING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK;;;; 309B;KATAKANA-HIRAGANA VOICED SOUND MARK;Sk;0;ON; 0020 3099;;;;N;;;;; 309C;KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK;Sk;0;ON; 0020 309A;;;;N;;;;; 309D;HIRAGANA ITERATION MARK;Lm;0;L;;;;;N;;;;; 309E;HIRAGANA VOICED ITERATION MARK;Lm;0;L;309D 3099;;;;N;;;;; 309F;HIRAGANA DIGRAPH YORI;Lo;0;L; 3088 308A;;;;N;;;;; 30A0;KATAKANA-HIRAGANA DOUBLE HYPHEN;Pd;0;ON;;;;;N;;;;; 30A1;KATAKANA LETTER SMALL A;Lo;0;L;;;;;N;;;;; 30A2;KATAKANA LETTER A;Lo;0;L;;;;;N;;;;; 30A3;KATAKANA LETTER SMALL I;Lo;0;L;;;;;N;;;;; 30A4;KATAKANA LETTER I;Lo;0;L;;;;;N;;;;; 30A5;KATAKANA LETTER SMALL U;Lo;0;L;;;;;N;;;;; 30A6;KATAKANA LETTER U;Lo;0;L;;;;;N;;;;; 30A7;KATAKANA LETTER SMALL E;Lo;0;L;;;;;N;;;;; 30A8;KATAKANA LETTER E;Lo;0;L;;;;;N;;;;; 30A9;KATAKANA LETTER SMALL O;Lo;0;L;;;;;N;;;;; 30AA;KATAKANA LETTER O;Lo;0;L;;;;;N;;;;; 30AB;KATAKANA LETTER KA;Lo;0;L;;;;;N;;;;; 30AC;KATAKANA LETTER GA;Lo;0;L;30AB 3099;;;;N;;;;; 30AD;KATAKANA LETTER KI;Lo;0;L;;;;;N;;;;; 30AE;KATAKANA LETTER GI;Lo;0;L;30AD 3099;;;;N;;;;; 30AF;KATAKANA LETTER KU;Lo;0;L;;;;;N;;;;; 30B0;KATAKANA LETTER GU;Lo;0;L;30AF 3099;;;;N;;;;; 30B1;KATAKANA LETTER KE;Lo;0;L;;;;;N;;;;; 30B2;KATAKANA LETTER GE;Lo;0;L;30B1 3099;;;;N;;;;; 30B3;KATAKANA LETTER KO;Lo;0;L;;;;;N;;;;; 30B4;KATAKANA LETTER GO;Lo;0;L;30B3 3099;;;;N;;;;; 30B5;KATAKANA LETTER SA;Lo;0;L;;;;;N;;;;; 30B6;KATAKANA LETTER ZA;Lo;0;L;30B5 3099;;;;N;;;;; 30B7;KATAKANA LETTER SI;Lo;0;L;;;;;N;;;;; 30B8;KATAKANA LETTER ZI;Lo;0;L;30B7 3099;;;;N;;;;; 30B9;KATAKANA LETTER SU;Lo;0;L;;;;;N;;;;; 30BA;KATAKANA LETTER ZU;Lo;0;L;30B9 3099;;;;N;;;;; 30BB;KATAKANA LETTER SE;Lo;0;L;;;;;N;;;;; 30BC;KATAKANA LETTER ZE;Lo;0;L;30BB 3099;;;;N;;;;; 30BD;KATAKANA LETTER SO;Lo;0;L;;;;;N;;;;; 30BE;KATAKANA LETTER ZO;Lo;0;L;30BD 3099;;;;N;;;;; 30BF;KATAKANA LETTER TA;Lo;0;L;;;;;N;;;;; 30C0;KATAKANA LETTER DA;Lo;0;L;30BF 3099;;;;N;;;;; 30C1;KATAKANA LETTER TI;Lo;0;L;;;;;N;;;;; 30C2;KATAKANA LETTER DI;Lo;0;L;30C1 3099;;;;N;;;;; 30C3;KATAKANA LETTER SMALL TU;Lo;0;L;;;;;N;;;;; 30C4;KATAKANA LETTER TU;Lo;0;L;;;;;N;;;;; 30C5;KATAKANA LETTER DU;Lo;0;L;30C4 3099;;;;N;;;;; 30C6;KATAKANA LETTER TE;Lo;0;L;;;;;N;;;;; 30C7;KATAKANA LETTER DE;Lo;0;L;30C6 3099;;;;N;;;;; 30C8;KATAKANA LETTER TO;Lo;0;L;;;;;N;;;;; 30C9;KATAKANA LETTER DO;Lo;0;L;30C8 3099;;;;N;;;;; 30CA;KATAKANA LETTER NA;Lo;0;L;;;;;N;;;;; 30CB;KATAKANA LETTER NI;Lo;0;L;;;;;N;;;;; 30CC;KATAKANA LETTER NU;Lo;0;L;;;;;N;;;;; 30CD;KATAKANA LETTER NE;Lo;0;L;;;;;N;;;;; 30CE;KATAKANA LETTER NO;Lo;0;L;;;;;N;;;;; 30CF;KATAKANA LETTER HA;Lo;0;L;;;;;N;;;;; 30D0;KATAKANA LETTER BA;Lo;0;L;30CF 3099;;;;N;;;;; 30D1;KATAKANA LETTER PA;Lo;0;L;30CF 309A;;;;N;;;;; 30D2;KATAKANA LETTER HI;Lo;0;L;;;;;N;;;;; 30D3;KATAKANA LETTER BI;Lo;0;L;30D2 3099;;;;N;;;;; 30D4;KATAKANA LETTER PI;Lo;0;L;30D2 309A;;;;N;;;;; 30D5;KATAKANA LETTER HU;Lo;0;L;;;;;N;;;;; 30D6;KATAKANA LETTER BU;Lo;0;L;30D5 3099;;;;N;;;;; 30D7;KATAKANA LETTER PU;Lo;0;L;30D5 309A;;;;N;;;;; 30D8;KATAKANA LETTER HE;Lo;0;L;;;;;N;;;;; 30D9;KATAKANA LETTER BE;Lo;0;L;30D8 3099;;;;N;;;;; 30DA;KATAKANA LETTER PE;Lo;0;L;30D8 309A;;;;N;;;;; 30DB;KATAKANA LETTER HO;Lo;0;L;;;;;N;;;;; 30DC;KATAKANA LETTER BO;Lo;0;L;30DB 3099;;;;N;;;;; 30DD;KATAKANA LETTER PO;Lo;0;L;30DB 309A;;;;N;;;;; 30DE;KATAKANA LETTER MA;Lo;0;L;;;;;N;;;;; 30DF;KATAKANA LETTER MI;Lo;0;L;;;;;N;;;;; 30E0;KATAKANA LETTER MU;Lo;0;L;;;;;N;;;;; 30E1;KATAKANA LETTER ME;Lo;0;L;;;;;N;;;;; 30E2;KATAKANA LETTER MO;Lo;0;L;;;;;N;;;;; 30E3;KATAKANA LETTER SMALL YA;Lo;0;L;;;;;N;;;;; 30E4;KATAKANA LETTER YA;Lo;0;L;;;;;N;;;;; 30E5;KATAKANA LETTER SMALL YU;Lo;0;L;;;;;N;;;;; 30E6;KATAKANA LETTER YU;Lo;0;L;;;;;N;;;;; 30E7;KATAKANA LETTER SMALL YO;Lo;0;L;;;;;N;;;;; 30E8;KATAKANA LETTER YO;Lo;0;L;;;;;N;;;;; 30E9;KATAKANA LETTER RA;Lo;0;L;;;;;N;;;;; 30EA;KATAKANA LETTER RI;Lo;0;L;;;;;N;;;;; 30EB;KATAKANA LETTER RU;Lo;0;L;;;;;N;;;;; 30EC;KATAKANA LETTER RE;Lo;0;L;;;;;N;;;;; 30ED;KATAKANA LETTER RO;Lo;0;L;;;;;N;;;;; 30EE;KATAKANA LETTER SMALL WA;Lo;0;L;;;;;N;;;;; 30EF;KATAKANA LETTER WA;Lo;0;L;;;;;N;;;;; 30F0;KATAKANA LETTER WI;Lo;0;L;;;;;N;;;;; 30F1;KATAKANA LETTER WE;Lo;0;L;;;;;N;;;;; 30F2;KATAKANA LETTER WO;Lo;0;L;;;;;N;;;;; 30F3;KATAKANA LETTER N;Lo;0;L;;;;;N;;;;; 30F4;KATAKANA LETTER VU;Lo;0;L;30A6 3099;;;;N;;;;; 30F5;KATAKANA LETTER SMALL KA;Lo;0;L;;;;;N;;;;; 30F6;KATAKANA LETTER SMALL KE;Lo;0;L;;;;;N;;;;; 30F7;KATAKANA LETTER VA;Lo;0;L;30EF 3099;;;;N;;;;; 30F8;KATAKANA LETTER VI;Lo;0;L;30F0 3099;;;;N;;;;; 30F9;KATAKANA LETTER VE;Lo;0;L;30F1 3099;;;;N;;;;; 30FA;KATAKANA LETTER VO;Lo;0;L;30F2 3099;;;;N;;;;; 30FB;KATAKANA MIDDLE DOT;Po;0;ON;;;;;N;;;;; 30FC;KATAKANA-HIRAGANA PROLONGED SOUND MARK;Lm;0;L;;;;;N;;;;; 30FD;KATAKANA ITERATION MARK;Lm;0;L;;;;;N;;;;; 30FE;KATAKANA VOICED ITERATION MARK;Lm;0;L;30FD 3099;;;;N;;;;; 30FF;KATAKANA DIGRAPH KOTO;Lo;0;L; 30B3 30C8;;;;N;;;;; 3105;BOPOMOFO LETTER B;Lo;0;L;;;;;N;;;;; 3106;BOPOMOFO LETTER P;Lo;0;L;;;;;N;;;;; 3107;BOPOMOFO LETTER M;Lo;0;L;;;;;N;;;;; 3108;BOPOMOFO LETTER F;Lo;0;L;;;;;N;;;;; 3109;BOPOMOFO LETTER D;Lo;0;L;;;;;N;;;;; 310A;BOPOMOFO LETTER T;Lo;0;L;;;;;N;;;;; 310B;BOPOMOFO LETTER N;Lo;0;L;;;;;N;;;;; 310C;BOPOMOFO LETTER L;Lo;0;L;;;;;N;;;;; 310D;BOPOMOFO LETTER G;Lo;0;L;;;;;N;;;;; 310E;BOPOMOFO LETTER K;Lo;0;L;;;;;N;;;;; 310F;BOPOMOFO LETTER H;Lo;0;L;;;;;N;;;;; 3110;BOPOMOFO LETTER J;Lo;0;L;;;;;N;;;;; 3111;BOPOMOFO LETTER Q;Lo;0;L;;;;;N;;;;; 3112;BOPOMOFO LETTER X;Lo;0;L;;;;;N;;;;; 3113;BOPOMOFO LETTER ZH;Lo;0;L;;;;;N;;;;; 3114;BOPOMOFO LETTER CH;Lo;0;L;;;;;N;;;;; 3115;BOPOMOFO LETTER SH;Lo;0;L;;;;;N;;;;; 3116;BOPOMOFO LETTER R;Lo;0;L;;;;;N;;;;; 3117;BOPOMOFO LETTER Z;Lo;0;L;;;;;N;;;;; 3118;BOPOMOFO LETTER C;Lo;0;L;;;;;N;;;;; 3119;BOPOMOFO LETTER S;Lo;0;L;;;;;N;;;;; 311A;BOPOMOFO LETTER A;Lo;0;L;;;;;N;;;;; 311B;BOPOMOFO LETTER O;Lo;0;L;;;;;N;;;;; 311C;BOPOMOFO LETTER E;Lo;0;L;;;;;N;;;;; 311D;BOPOMOFO LETTER EH;Lo;0;L;;;;;N;;;;; 311E;BOPOMOFO LETTER AI;Lo;0;L;;;;;N;;;;; 311F;BOPOMOFO LETTER EI;Lo;0;L;;;;;N;;;;; 3120;BOPOMOFO LETTER AU;Lo;0;L;;;;;N;;;;; 3121;BOPOMOFO LETTER OU;Lo;0;L;;;;;N;;;;; 3122;BOPOMOFO LETTER AN;Lo;0;L;;;;;N;;;;; 3123;BOPOMOFO LETTER EN;Lo;0;L;;;;;N;;;;; 3124;BOPOMOFO LETTER ANG;Lo;0;L;;;;;N;;;;; 3125;BOPOMOFO LETTER ENG;Lo;0;L;;;;;N;;;;; 3126;BOPOMOFO LETTER ER;Lo;0;L;;;;;N;;;;; 3127;BOPOMOFO LETTER I;Lo;0;L;;;;;N;;;;; 3128;BOPOMOFO LETTER U;Lo;0;L;;;;;N;;;;; 3129;BOPOMOFO LETTER IU;Lo;0;L;;;;;N;;;;; 312A;BOPOMOFO LETTER V;Lo;0;L;;;;;N;;;;; 312B;BOPOMOFO LETTER NG;Lo;0;L;;;;;N;;;;; 312C;BOPOMOFO LETTER GN;Lo;0;L;;;;;N;;;;; 312D;BOPOMOFO LETTER IH;Lo;0;L;;;;;N;;;;; 3131;HANGUL LETTER KIYEOK;Lo;0;L; 1100;;;;N;HANGUL LETTER GIYEOG;;;; 3132;HANGUL LETTER SSANGKIYEOK;Lo;0;L; 1101;;;;N;HANGUL LETTER SSANG GIYEOG;;;; 3133;HANGUL LETTER KIYEOK-SIOS;Lo;0;L; 11AA;;;;N;HANGUL LETTER GIYEOG SIOS;;;; 3134;HANGUL LETTER NIEUN;Lo;0;L; 1102;;;;N;;;;; 3135;HANGUL LETTER NIEUN-CIEUC;Lo;0;L; 11AC;;;;N;HANGUL LETTER NIEUN JIEUJ;;;; 3136;HANGUL LETTER NIEUN-HIEUH;Lo;0;L; 11AD;;;;N;HANGUL LETTER NIEUN HIEUH;;;; 3137;HANGUL LETTER TIKEUT;Lo;0;L; 1103;;;;N;HANGUL LETTER DIGEUD;;;; 3138;HANGUL LETTER SSANGTIKEUT;Lo;0;L; 1104;;;;N;HANGUL LETTER SSANG DIGEUD;;;; 3139;HANGUL LETTER RIEUL;Lo;0;L; 1105;;;;N;HANGUL LETTER LIEUL;;;; 313A;HANGUL LETTER RIEUL-KIYEOK;Lo;0;L; 11B0;;;;N;HANGUL LETTER LIEUL GIYEOG;;;; 313B;HANGUL LETTER RIEUL-MIEUM;Lo;0;L; 11B1;;;;N;HANGUL LETTER LIEUL MIEUM;;;; 313C;HANGUL LETTER RIEUL-PIEUP;Lo;0;L; 11B2;;;;N;HANGUL LETTER LIEUL BIEUB;;;; 313D;HANGUL LETTER RIEUL-SIOS;Lo;0;L; 11B3;;;;N;HANGUL LETTER LIEUL SIOS;;;; 313E;HANGUL LETTER RIEUL-THIEUTH;Lo;0;L; 11B4;;;;N;HANGUL LETTER LIEUL TIEUT;;;; 313F;HANGUL LETTER RIEUL-PHIEUPH;Lo;0;L; 11B5;;;;N;HANGUL LETTER LIEUL PIEUP;;;; 3140;HANGUL LETTER RIEUL-HIEUH;Lo;0;L; 111A;;;;N;HANGUL LETTER LIEUL HIEUH;;;; 3141;HANGUL LETTER MIEUM;Lo;0;L; 1106;;;;N;;;;; 3142;HANGUL LETTER PIEUP;Lo;0;L; 1107;;;;N;HANGUL LETTER BIEUB;;;; 3143;HANGUL LETTER SSANGPIEUP;Lo;0;L; 1108;;;;N;HANGUL LETTER SSANG BIEUB;;;; 3144;HANGUL LETTER PIEUP-SIOS;Lo;0;L; 1121;;;;N;HANGUL LETTER BIEUB SIOS;;;; 3145;HANGUL LETTER SIOS;Lo;0;L; 1109;;;;N;;;;; 3146;HANGUL LETTER SSANGSIOS;Lo;0;L; 110A;;;;N;HANGUL LETTER SSANG SIOS;;;; 3147;HANGUL LETTER IEUNG;Lo;0;L; 110B;;;;N;;;;; 3148;HANGUL LETTER CIEUC;Lo;0;L; 110C;;;;N;HANGUL LETTER JIEUJ;;;; 3149;HANGUL LETTER SSANGCIEUC;Lo;0;L; 110D;;;;N;HANGUL LETTER SSANG JIEUJ;;;; 314A;HANGUL LETTER CHIEUCH;Lo;0;L; 110E;;;;N;HANGUL LETTER CIEUC;;;; 314B;HANGUL LETTER KHIEUKH;Lo;0;L; 110F;;;;N;HANGUL LETTER KIYEOK;;;; 314C;HANGUL LETTER THIEUTH;Lo;0;L; 1110;;;;N;HANGUL LETTER TIEUT;;;; 314D;HANGUL LETTER PHIEUPH;Lo;0;L; 1111;;;;N;HANGUL LETTER PIEUP;;;; 314E;HANGUL LETTER HIEUH;Lo;0;L; 1112;;;;N;;;;; 314F;HANGUL LETTER A;Lo;0;L; 1161;;;;N;;;;; 3150;HANGUL LETTER AE;Lo;0;L; 1162;;;;N;;;;; 3151;HANGUL LETTER YA;Lo;0;L; 1163;;;;N;;;;; 3152;HANGUL LETTER YAE;Lo;0;L; 1164;;;;N;;;;; 3153;HANGUL LETTER EO;Lo;0;L; 1165;;;;N;;;;; 3154;HANGUL LETTER E;Lo;0;L; 1166;;;;N;;;;; 3155;HANGUL LETTER YEO;Lo;0;L; 1167;;;;N;;;;; 3156;HANGUL LETTER YE;Lo;0;L; 1168;;;;N;;;;; 3157;HANGUL LETTER O;Lo;0;L; 1169;;;;N;;;;; 3158;HANGUL LETTER WA;Lo;0;L; 116A;;;;N;;;;; 3159;HANGUL LETTER WAE;Lo;0;L; 116B;;;;N;;;;; 315A;HANGUL LETTER OE;Lo;0;L; 116C;;;;N;;;;; 315B;HANGUL LETTER YO;Lo;0;L; 116D;;;;N;;;;; 315C;HANGUL LETTER U;Lo;0;L; 116E;;;;N;;;;; 315D;HANGUL LETTER WEO;Lo;0;L; 116F;;;;N;;;;; 315E;HANGUL LETTER WE;Lo;0;L; 1170;;;;N;;;;; 315F;HANGUL LETTER WI;Lo;0;L; 1171;;;;N;;;;; 3160;HANGUL LETTER YU;Lo;0;L; 1172;;;;N;;;;; 3161;HANGUL LETTER EU;Lo;0;L; 1173;;;;N;;;;; 3162;HANGUL LETTER YI;Lo;0;L; 1174;;;;N;;;;; 3163;HANGUL LETTER I;Lo;0;L; 1175;;;;N;;;;; 3164;HANGUL FILLER;Lo;0;L; 1160;;;;N;HANGUL CAE OM;;;; 3165;HANGUL LETTER SSANGNIEUN;Lo;0;L; 1114;;;;N;HANGUL LETTER SSANG NIEUN;;;; 3166;HANGUL LETTER NIEUN-TIKEUT;Lo;0;L; 1115;;;;N;HANGUL LETTER NIEUN DIGEUD;;;; 3167;HANGUL LETTER NIEUN-SIOS;Lo;0;L; 11C7;;;;N;HANGUL LETTER NIEUN SIOS;;;; 3168;HANGUL LETTER NIEUN-PANSIOS;Lo;0;L; 11C8;;;;N;HANGUL LETTER NIEUN BAN CHI EUM;;;; 3169;HANGUL LETTER RIEUL-KIYEOK-SIOS;Lo;0;L; 11CC;;;;N;HANGUL LETTER LIEUL GIYEOG SIOS;;;; 316A;HANGUL LETTER RIEUL-TIKEUT;Lo;0;L; 11CE;;;;N;HANGUL LETTER LIEUL DIGEUD;;;; 316B;HANGUL LETTER RIEUL-PIEUP-SIOS;Lo;0;L; 11D3;;;;N;HANGUL LETTER LIEUL BIEUB SIOS;;;; 316C;HANGUL LETTER RIEUL-PANSIOS;Lo;0;L; 11D7;;;;N;HANGUL LETTER LIEUL BAN CHI EUM;;;; 316D;HANGUL LETTER RIEUL-YEORINHIEUH;Lo;0;L; 11D9;;;;N;HANGUL LETTER LIEUL YEOLIN HIEUH;;;; 316E;HANGUL LETTER MIEUM-PIEUP;Lo;0;L; 111C;;;;N;HANGUL LETTER MIEUM BIEUB;;;; 316F;HANGUL LETTER MIEUM-SIOS;Lo;0;L; 11DD;;;;N;HANGUL LETTER MIEUM SIOS;;;; 3170;HANGUL LETTER MIEUM-PANSIOS;Lo;0;L; 11DF;;;;N;HANGUL LETTER BIEUB BAN CHI EUM;;;; 3171;HANGUL LETTER KAPYEOUNMIEUM;Lo;0;L; 111D;;;;N;HANGUL LETTER MIEUM SUN GYEONG EUM;;;; 3172;HANGUL LETTER PIEUP-KIYEOK;Lo;0;L; 111E;;;;N;HANGUL LETTER BIEUB GIYEOG;;;; 3173;HANGUL LETTER PIEUP-TIKEUT;Lo;0;L; 1120;;;;N;HANGUL LETTER BIEUB DIGEUD;;;; 3174;HANGUL LETTER PIEUP-SIOS-KIYEOK;Lo;0;L; 1122;;;;N;HANGUL LETTER BIEUB SIOS GIYEOG;;;; 3175;HANGUL LETTER PIEUP-SIOS-TIKEUT;Lo;0;L; 1123;;;;N;HANGUL LETTER BIEUB SIOS DIGEUD;;;; 3176;HANGUL LETTER PIEUP-CIEUC;Lo;0;L; 1127;;;;N;HANGUL LETTER BIEUB JIEUJ;;;; 3177;HANGUL LETTER PIEUP-THIEUTH;Lo;0;L; 1129;;;;N;HANGUL LETTER BIEUB TIEUT;;;; 3178;HANGUL LETTER KAPYEOUNPIEUP;Lo;0;L; 112B;;;;N;HANGUL LETTER BIEUB SUN GYEONG EUM;;;; 3179;HANGUL LETTER KAPYEOUNSSANGPIEUP;Lo;0;L; 112C;;;;N;HANGUL LETTER SSANG BIEUB SUN GYEONG EUM;;;; 317A;HANGUL LETTER SIOS-KIYEOK;Lo;0;L; 112D;;;;N;HANGUL LETTER SIOS GIYEOG;;;; 317B;HANGUL LETTER SIOS-NIEUN;Lo;0;L; 112E;;;;N;HANGUL LETTER SIOS NIEUN;;;; 317C;HANGUL LETTER SIOS-TIKEUT;Lo;0;L; 112F;;;;N;HANGUL LETTER SIOS DIGEUD;;;; 317D;HANGUL LETTER SIOS-PIEUP;Lo;0;L; 1132;;;;N;HANGUL LETTER SIOS BIEUB;;;; 317E;HANGUL LETTER SIOS-CIEUC;Lo;0;L; 1136;;;;N;HANGUL LETTER SIOS JIEUJ;;;; 317F;HANGUL LETTER PANSIOS;Lo;0;L; 1140;;;;N;HANGUL LETTER BAN CHI EUM;;;; 3180;HANGUL LETTER SSANGIEUNG;Lo;0;L; 1147;;;;N;HANGUL LETTER SSANG IEUNG;;;; 3181;HANGUL LETTER YESIEUNG;Lo;0;L; 114C;;;;N;HANGUL LETTER NGIEUNG;;;; 3182;HANGUL LETTER YESIEUNG-SIOS;Lo;0;L; 11F1;;;;N;HANGUL LETTER NGIEUNG SIOS;;;; 3183;HANGUL LETTER YESIEUNG-PANSIOS;Lo;0;L; 11F2;;;;N;HANGUL LETTER NGIEUNG BAN CHI EUM;;;; 3184;HANGUL LETTER KAPYEOUNPHIEUPH;Lo;0;L; 1157;;;;N;HANGUL LETTER PIEUP SUN GYEONG EUM;;;; 3185;HANGUL LETTER SSANGHIEUH;Lo;0;L; 1158;;;;N;HANGUL LETTER SSANG HIEUH;;;; 3186;HANGUL LETTER YEORINHIEUH;Lo;0;L; 1159;;;;N;HANGUL LETTER YEOLIN HIEUH;;;; 3187;HANGUL LETTER YO-YA;Lo;0;L; 1184;;;;N;HANGUL LETTER YOYA;;;; 3188;HANGUL LETTER YO-YAE;Lo;0;L; 1185;;;;N;HANGUL LETTER YOYAE;;;; 3189;HANGUL LETTER YO-I;Lo;0;L; 1188;;;;N;HANGUL LETTER YOI;;;; 318A;HANGUL LETTER YU-YEO;Lo;0;L; 1191;;;;N;HANGUL LETTER YUYEO;;;; 318B;HANGUL LETTER YU-YE;Lo;0;L; 1192;;;;N;HANGUL LETTER YUYE;;;; 318C;HANGUL LETTER YU-I;Lo;0;L; 1194;;;;N;HANGUL LETTER YUI;;;; 318D;HANGUL LETTER ARAEA;Lo;0;L; 119E;;;;N;HANGUL LETTER ALAE A;;;; 318E;HANGUL LETTER ARAEAE;Lo;0;L; 11A1;;;;N;HANGUL LETTER ALAE AE;;;; 3190;IDEOGRAPHIC ANNOTATION LINKING MARK;So;0;L;;;;;N;KANBUN TATETEN;;;; 3191;IDEOGRAPHIC ANNOTATION REVERSE MARK;So;0;L;;;;;N;KAERITEN RE;;;; 3192;IDEOGRAPHIC ANNOTATION ONE MARK;No;0;L; 4E00;;;1;N;KAERITEN ITI;;;; 3193;IDEOGRAPHIC ANNOTATION TWO MARK;No;0;L; 4E8C;;;2;N;KAERITEN NI;;;; 3194;IDEOGRAPHIC ANNOTATION THREE MARK;No;0;L; 4E09;;;3;N;KAERITEN SAN;;;; 3195;IDEOGRAPHIC ANNOTATION FOUR MARK;No;0;L; 56DB;;;4;N;KAERITEN SI;;;; 3196;IDEOGRAPHIC ANNOTATION TOP MARK;So;0;L; 4E0A;;;;N;KAERITEN ZYOU;;;; 3197;IDEOGRAPHIC ANNOTATION MIDDLE MARK;So;0;L; 4E2D;;;;N;KAERITEN TYUU;;;; 3198;IDEOGRAPHIC ANNOTATION BOTTOM MARK;So;0;L; 4E0B;;;;N;KAERITEN GE;;;; 3199;IDEOGRAPHIC ANNOTATION FIRST MARK;So;0;L; 7532;;;;N;KAERITEN KOU;;;; 319A;IDEOGRAPHIC ANNOTATION SECOND MARK;So;0;L; 4E59;;;;N;KAERITEN OTU;;;; 319B;IDEOGRAPHIC ANNOTATION THIRD MARK;So;0;L; 4E19;;;;N;KAERITEN HEI;;;; 319C;IDEOGRAPHIC ANNOTATION FOURTH MARK;So;0;L; 4E01;;;;N;KAERITEN TEI;;;; 319D;IDEOGRAPHIC ANNOTATION HEAVEN MARK;So;0;L; 5929;;;;N;KAERITEN TEN;;;; 319E;IDEOGRAPHIC ANNOTATION EARTH MARK;So;0;L; 5730;;;;N;KAERITEN TI;;;; 319F;IDEOGRAPHIC ANNOTATION MAN MARK;So;0;L; 4EBA;;;;N;KAERITEN ZIN;;;; 31A0;BOPOMOFO LETTER BU;Lo;0;L;;;;;N;;;;; 31A1;BOPOMOFO LETTER ZI;Lo;0;L;;;;;N;;;;; 31A2;BOPOMOFO LETTER JI;Lo;0;L;;;;;N;;;;; 31A3;BOPOMOFO LETTER GU;Lo;0;L;;;;;N;;;;; 31A4;BOPOMOFO LETTER EE;Lo;0;L;;;;;N;;;;; 31A5;BOPOMOFO LETTER ENN;Lo;0;L;;;;;N;;;;; 31A6;BOPOMOFO LETTER OO;Lo;0;L;;;;;N;;;;; 31A7;BOPOMOFO LETTER ONN;Lo;0;L;;;;;N;;;;; 31A8;BOPOMOFO LETTER IR;Lo;0;L;;;;;N;;;;; 31A9;BOPOMOFO LETTER ANN;Lo;0;L;;;;;N;;;;; 31AA;BOPOMOFO LETTER INN;Lo;0;L;;;;;N;;;;; 31AB;BOPOMOFO LETTER UNN;Lo;0;L;;;;;N;;;;; 31AC;BOPOMOFO LETTER IM;Lo;0;L;;;;;N;;;;; 31AD;BOPOMOFO LETTER NGG;Lo;0;L;;;;;N;;;;; 31AE;BOPOMOFO LETTER AINN;Lo;0;L;;;;;N;;;;; 31AF;BOPOMOFO LETTER AUNN;Lo;0;L;;;;;N;;;;; 31B0;BOPOMOFO LETTER AM;Lo;0;L;;;;;N;;;;; 31B1;BOPOMOFO LETTER OM;Lo;0;L;;;;;N;;;;; 31B2;BOPOMOFO LETTER ONG;Lo;0;L;;;;;N;;;;; 31B3;BOPOMOFO LETTER INNN;Lo;0;L;;;;;N;;;;; 31B4;BOPOMOFO FINAL LETTER P;Lo;0;L;;;;;N;;;;; 31B5;BOPOMOFO FINAL LETTER T;Lo;0;L;;;;;N;;;;; 31B6;BOPOMOFO FINAL LETTER K;Lo;0;L;;;;;N;;;;; 31B7;BOPOMOFO FINAL LETTER H;Lo;0;L;;;;;N;;;;; 31B8;BOPOMOFO LETTER GH;Lo;0;L;;;;;N;;;;; 31B9;BOPOMOFO LETTER LH;Lo;0;L;;;;;N;;;;; 31BA;BOPOMOFO LETTER ZY;Lo;0;L;;;;;N;;;;; 31C0;CJK STROKE T;So;0;ON;;;;;N;;;;; 31C1;CJK STROKE WG;So;0;ON;;;;;N;;;;; 31C2;CJK STROKE XG;So;0;ON;;;;;N;;;;; 31C3;CJK STROKE BXG;So;0;ON;;;;;N;;;;; 31C4;CJK STROKE SW;So;0;ON;;;;;N;;;;; 31C5;CJK STROKE HZZ;So;0;ON;;;;;N;;;;; 31C6;CJK STROKE HZG;So;0;ON;;;;;N;;;;; 31C7;CJK STROKE HP;So;0;ON;;;;;N;;;;; 31C8;CJK STROKE HZWG;So;0;ON;;;;;N;;;;; 31C9;CJK STROKE SZWG;So;0;ON;;;;;N;;;;; 31CA;CJK STROKE HZT;So;0;ON;;;;;N;;;;; 31CB;CJK STROKE HZZP;So;0;ON;;;;;N;;;;; 31CC;CJK STROKE HPWG;So;0;ON;;;;;N;;;;; 31CD;CJK STROKE HZW;So;0;ON;;;;;N;;;;; 31CE;CJK STROKE HZZZ;So;0;ON;;;;;N;;;;; 31CF;CJK STROKE N;So;0;ON;;;;;N;;;;; 31D0;CJK STROKE H;So;0;ON;;;;;N;;;;; 31D1;CJK STROKE S;So;0;ON;;;;;N;;;;; 31D2;CJK STROKE P;So;0;ON;;;;;N;;;;; 31D3;CJK STROKE SP;So;0;ON;;;;;N;;;;; 31D4;CJK STROKE D;So;0;ON;;;;;N;;;;; 31D5;CJK STROKE HZ;So;0;ON;;;;;N;;;;; 31D6;CJK STROKE HG;So;0;ON;;;;;N;;;;; 31D7;CJK STROKE SZ;So;0;ON;;;;;N;;;;; 31D8;CJK STROKE SWZ;So;0;ON;;;;;N;;;;; 31D9;CJK STROKE ST;So;0;ON;;;;;N;;;;; 31DA;CJK STROKE SG;So;0;ON;;;;;N;;;;; 31DB;CJK STROKE PD;So;0;ON;;;;;N;;;;; 31DC;CJK STROKE PZ;So;0;ON;;;;;N;;;;; 31DD;CJK STROKE TN;So;0;ON;;;;;N;;;;; 31DE;CJK STROKE SZZ;So;0;ON;;;;;N;;;;; 31DF;CJK STROKE SWG;So;0;ON;;;;;N;;;;; 31E0;CJK STROKE HXWG;So;0;ON;;;;;N;;;;; 31E1;CJK STROKE HZZZG;So;0;ON;;;;;N;;;;; 31E2;CJK STROKE PG;So;0;ON;;;;;N;;;;; 31E3;CJK STROKE Q;So;0;ON;;;;;N;;;;; 31F0;KATAKANA LETTER SMALL KU;Lo;0;L;;;;;N;;;;; 31F1;KATAKANA LETTER SMALL SI;Lo;0;L;;;;;N;;;;; 31F2;KATAKANA LETTER SMALL SU;Lo;0;L;;;;;N;;;;; 31F3;KATAKANA LETTER SMALL TO;Lo;0;L;;;;;N;;;;; 31F4;KATAKANA LETTER SMALL NU;Lo;0;L;;;;;N;;;;; 31F5;KATAKANA LETTER SMALL HA;Lo;0;L;;;;;N;;;;; 31F6;KATAKANA LETTER SMALL HI;Lo;0;L;;;;;N;;;;; 31F7;KATAKANA LETTER SMALL HU;Lo;0;L;;;;;N;;;;; 31F8;KATAKANA LETTER SMALL HE;Lo;0;L;;;;;N;;;;; 31F9;KATAKANA LETTER SMALL HO;Lo;0;L;;;;;N;;;;; 31FA;KATAKANA LETTER SMALL MU;Lo;0;L;;;;;N;;;;; 31FB;KATAKANA LETTER SMALL RA;Lo;0;L;;;;;N;;;;; 31FC;KATAKANA LETTER SMALL RI;Lo;0;L;;;;;N;;;;; 31FD;KATAKANA LETTER SMALL RU;Lo;0;L;;;;;N;;;;; 31FE;KATAKANA LETTER SMALL RE;Lo;0;L;;;;;N;;;;; 31FF;KATAKANA LETTER SMALL RO;Lo;0;L;;;;;N;;;;; 3200;PARENTHESIZED HANGUL KIYEOK;So;0;L; 0028 1100 0029;;;;N;PARENTHESIZED HANGUL GIYEOG;;;; 3201;PARENTHESIZED HANGUL NIEUN;So;0;L; 0028 1102 0029;;;;N;;;;; 3202;PARENTHESIZED HANGUL TIKEUT;So;0;L; 0028 1103 0029;;;;N;PARENTHESIZED HANGUL DIGEUD;;;; 3203;PARENTHESIZED HANGUL RIEUL;So;0;L; 0028 1105 0029;;;;N;PARENTHESIZED HANGUL LIEUL;;;; 3204;PARENTHESIZED HANGUL MIEUM;So;0;L; 0028 1106 0029;;;;N;;;;; 3205;PARENTHESIZED HANGUL PIEUP;So;0;L; 0028 1107 0029;;;;N;PARENTHESIZED HANGUL BIEUB;;;; 3206;PARENTHESIZED HANGUL SIOS;So;0;L; 0028 1109 0029;;;;N;;;;; 3207;PARENTHESIZED HANGUL IEUNG;So;0;L; 0028 110B 0029;;;;N;;;;; 3208;PARENTHESIZED HANGUL CIEUC;So;0;L; 0028 110C 0029;;;;N;PARENTHESIZED HANGUL JIEUJ;;;; 3209;PARENTHESIZED HANGUL CHIEUCH;So;0;L; 0028 110E 0029;;;;N;PARENTHESIZED HANGUL CIEUC;;;; 320A;PARENTHESIZED HANGUL KHIEUKH;So;0;L; 0028 110F 0029;;;;N;PARENTHESIZED HANGUL KIYEOK;;;; 320B;PARENTHESIZED HANGUL THIEUTH;So;0;L; 0028 1110 0029;;;;N;PARENTHESIZED HANGUL TIEUT;;;; 320C;PARENTHESIZED HANGUL PHIEUPH;So;0;L; 0028 1111 0029;;;;N;PARENTHESIZED HANGUL PIEUP;;;; 320D;PARENTHESIZED HANGUL HIEUH;So;0;L; 0028 1112 0029;;;;N;;;;; 320E;PARENTHESIZED HANGUL KIYEOK A;So;0;L; 0028 1100 1161 0029;;;;N;PARENTHESIZED HANGUL GA;;;; 320F;PARENTHESIZED HANGUL NIEUN A;So;0;L; 0028 1102 1161 0029;;;;N;PARENTHESIZED HANGUL NA;;;; 3210;PARENTHESIZED HANGUL TIKEUT A;So;0;L; 0028 1103 1161 0029;;;;N;PARENTHESIZED HANGUL DA;;;; 3211;PARENTHESIZED HANGUL RIEUL A;So;0;L; 0028 1105 1161 0029;;;;N;PARENTHESIZED HANGUL LA;;;; 3212;PARENTHESIZED HANGUL MIEUM A;So;0;L; 0028 1106 1161 0029;;;;N;PARENTHESIZED HANGUL MA;;;; 3213;PARENTHESIZED HANGUL PIEUP A;So;0;L; 0028 1107 1161 0029;;;;N;PARENTHESIZED HANGUL BA;;;; 3214;PARENTHESIZED HANGUL SIOS A;So;0;L; 0028 1109 1161 0029;;;;N;PARENTHESIZED HANGUL SA;;;; 3215;PARENTHESIZED HANGUL IEUNG A;So;0;L; 0028 110B 1161 0029;;;;N;PARENTHESIZED HANGUL A;;;; 3216;PARENTHESIZED HANGUL CIEUC A;So;0;L; 0028 110C 1161 0029;;;;N;PARENTHESIZED HANGUL JA;;;; 3217;PARENTHESIZED HANGUL CHIEUCH A;So;0;L; 0028 110E 1161 0029;;;;N;PARENTHESIZED HANGUL CA;;;; 3218;PARENTHESIZED HANGUL KHIEUKH A;So;0;L; 0028 110F 1161 0029;;;;N;PARENTHESIZED HANGUL KA;;;; 3219;PARENTHESIZED HANGUL THIEUTH A;So;0;L; 0028 1110 1161 0029;;;;N;PARENTHESIZED HANGUL TA;;;; 321A;PARENTHESIZED HANGUL PHIEUPH A;So;0;L; 0028 1111 1161 0029;;;;N;PARENTHESIZED HANGUL PA;;;; 321B;PARENTHESIZED HANGUL HIEUH A;So;0;L; 0028 1112 1161 0029;;;;N;PARENTHESIZED HANGUL HA;;;; 321C;PARENTHESIZED HANGUL CIEUC U;So;0;L; 0028 110C 116E 0029;;;;N;PARENTHESIZED HANGUL JU;;;; 321D;PARENTHESIZED KOREAN CHARACTER OJEON;So;0;ON; 0028 110B 1169 110C 1165 11AB 0029;;;;N;;;;; 321E;PARENTHESIZED KOREAN CHARACTER O HU;So;0;ON; 0028 110B 1169 1112 116E 0029;;;;N;;;;; 3220;PARENTHESIZED IDEOGRAPH ONE;No;0;L; 0028 4E00 0029;;;1;N;;;;; 3221;PARENTHESIZED IDEOGRAPH TWO;No;0;L; 0028 4E8C 0029;;;2;N;;;;; 3222;PARENTHESIZED IDEOGRAPH THREE;No;0;L; 0028 4E09 0029;;;3;N;;;;; 3223;PARENTHESIZED IDEOGRAPH FOUR;No;0;L; 0028 56DB 0029;;;4;N;;;;; 3224;PARENTHESIZED IDEOGRAPH FIVE;No;0;L; 0028 4E94 0029;;;5;N;;;;; 3225;PARENTHESIZED IDEOGRAPH SIX;No;0;L; 0028 516D 0029;;;6;N;;;;; 3226;PARENTHESIZED IDEOGRAPH SEVEN;No;0;L; 0028 4E03 0029;;;7;N;;;;; 3227;PARENTHESIZED IDEOGRAPH EIGHT;No;0;L; 0028 516B 0029;;;8;N;;;;; 3228;PARENTHESIZED IDEOGRAPH NINE;No;0;L; 0028 4E5D 0029;;;9;N;;;;; 3229;PARENTHESIZED IDEOGRAPH TEN;No;0;L; 0028 5341 0029;;;10;N;;;;; 322A;PARENTHESIZED IDEOGRAPH MOON;So;0;L; 0028 6708 0029;;;;N;;;;; 322B;PARENTHESIZED IDEOGRAPH FIRE;So;0;L; 0028 706B 0029;;;;N;;;;; 322C;PARENTHESIZED IDEOGRAPH WATER;So;0;L; 0028 6C34 0029;;;;N;;;;; 322D;PARENTHESIZED IDEOGRAPH WOOD;So;0;L; 0028 6728 0029;;;;N;;;;; 322E;PARENTHESIZED IDEOGRAPH METAL;So;0;L; 0028 91D1 0029;;;;N;;;;; 322F;PARENTHESIZED IDEOGRAPH EARTH;So;0;L; 0028 571F 0029;;;;N;;;;; 3230;PARENTHESIZED IDEOGRAPH SUN;So;0;L; 0028 65E5 0029;;;;N;;;;; 3231;PARENTHESIZED IDEOGRAPH STOCK;So;0;L; 0028 682A 0029;;;;N;;;;; 3232;PARENTHESIZED IDEOGRAPH HAVE;So;0;L; 0028 6709 0029;;;;N;;;;; 3233;PARENTHESIZED IDEOGRAPH SOCIETY;So;0;L; 0028 793E 0029;;;;N;;;;; 3234;PARENTHESIZED IDEOGRAPH NAME;So;0;L; 0028 540D 0029;;;;N;;;;; 3235;PARENTHESIZED IDEOGRAPH SPECIAL;So;0;L; 0028 7279 0029;;;;N;;;;; 3236;PARENTHESIZED IDEOGRAPH FINANCIAL;So;0;L; 0028 8CA1 0029;;;;N;;;;; 3237;PARENTHESIZED IDEOGRAPH CONGRATULATION;So;0;L; 0028 795D 0029;;;;N;;;;; 3238;PARENTHESIZED IDEOGRAPH LABOR;So;0;L; 0028 52B4 0029;;;;N;;;;; 3239;PARENTHESIZED IDEOGRAPH REPRESENT;So;0;L; 0028 4EE3 0029;;;;N;;;;; 323A;PARENTHESIZED IDEOGRAPH CALL;So;0;L; 0028 547C 0029;;;;N;;;;; 323B;PARENTHESIZED IDEOGRAPH STUDY;So;0;L; 0028 5B66 0029;;;;N;;;;; 323C;PARENTHESIZED IDEOGRAPH SUPERVISE;So;0;L; 0028 76E3 0029;;;;N;;;;; 323D;PARENTHESIZED IDEOGRAPH ENTERPRISE;So;0;L; 0028 4F01 0029;;;;N;;;;; 323E;PARENTHESIZED IDEOGRAPH RESOURCE;So;0;L; 0028 8CC7 0029;;;;N;;;;; 323F;PARENTHESIZED IDEOGRAPH ALLIANCE;So;0;L; 0028 5354 0029;;;;N;;;;; 3240;PARENTHESIZED IDEOGRAPH FESTIVAL;So;0;L; 0028 796D 0029;;;;N;;;;; 3241;PARENTHESIZED IDEOGRAPH REST;So;0;L; 0028 4F11 0029;;;;N;;;;; 3242;PARENTHESIZED IDEOGRAPH SELF;So;0;L; 0028 81EA 0029;;;;N;;;;; 3243;PARENTHESIZED IDEOGRAPH REACH;So;0;L; 0028 81F3 0029;;;;N;;;;; 3244;CIRCLED IDEOGRAPH QUESTION;So;0;L; 554F;;;;N;;;;; 3245;CIRCLED IDEOGRAPH KINDERGARTEN;So;0;L; 5E7C;;;;N;;;;; 3246;CIRCLED IDEOGRAPH SCHOOL;So;0;L; 6587;;;;N;;;;; 3247;CIRCLED IDEOGRAPH KOTO;So;0;L; 7B8F;;;;N;;;;; 3248;CIRCLED NUMBER TEN ON BLACK SQUARE;No;0;L;;;;10;N;;;;; 3249;CIRCLED NUMBER TWENTY ON BLACK SQUARE;No;0;L;;;;20;N;;;;; 324A;CIRCLED NUMBER THIRTY ON BLACK SQUARE;No;0;L;;;;30;N;;;;; 324B;CIRCLED NUMBER FORTY ON BLACK SQUARE;No;0;L;;;;40;N;;;;; 324C;CIRCLED NUMBER FIFTY ON BLACK SQUARE;No;0;L;;;;50;N;;;;; 324D;CIRCLED NUMBER SIXTY ON BLACK SQUARE;No;0;L;;;;60;N;;;;; 324E;CIRCLED NUMBER SEVENTY ON BLACK SQUARE;No;0;L;;;;70;N;;;;; 324F;CIRCLED NUMBER EIGHTY ON BLACK SQUARE;No;0;L;;;;80;N;;;;; 3250;PARTNERSHIP SIGN;So;0;ON; 0050 0054 0045;;;;N;;;;; 3251;CIRCLED NUMBER TWENTY ONE;No;0;ON; 0032 0031;;;21;N;;;;; 3252;CIRCLED NUMBER TWENTY TWO;No;0;ON; 0032 0032;;;22;N;;;;; 3253;CIRCLED NUMBER TWENTY THREE;No;0;ON; 0032 0033;;;23;N;;;;; 3254;CIRCLED NUMBER TWENTY FOUR;No;0;ON; 0032 0034;;;24;N;;;;; 3255;CIRCLED NUMBER TWENTY FIVE;No;0;ON; 0032 0035;;;25;N;;;;; 3256;CIRCLED NUMBER TWENTY SIX;No;0;ON; 0032 0036;;;26;N;;;;; 3257;CIRCLED NUMBER TWENTY SEVEN;No;0;ON; 0032 0037;;;27;N;;;;; 3258;CIRCLED NUMBER TWENTY EIGHT;No;0;ON; 0032 0038;;;28;N;;;;; 3259;CIRCLED NUMBER TWENTY NINE;No;0;ON; 0032 0039;;;29;N;;;;; 325A;CIRCLED NUMBER THIRTY;No;0;ON; 0033 0030;;;30;N;;;;; 325B;CIRCLED NUMBER THIRTY ONE;No;0;ON; 0033 0031;;;31;N;;;;; 325C;CIRCLED NUMBER THIRTY TWO;No;0;ON; 0033 0032;;;32;N;;;;; 325D;CIRCLED NUMBER THIRTY THREE;No;0;ON; 0033 0033;;;33;N;;;;; 325E;CIRCLED NUMBER THIRTY FOUR;No;0;ON; 0033 0034;;;34;N;;;;; 325F;CIRCLED NUMBER THIRTY FIVE;No;0;ON; 0033 0035;;;35;N;;;;; 3260;CIRCLED HANGUL KIYEOK;So;0;L; 1100;;;;N;CIRCLED HANGUL GIYEOG;;;; 3261;CIRCLED HANGUL NIEUN;So;0;L; 1102;;;;N;;;;; 3262;CIRCLED HANGUL TIKEUT;So;0;L; 1103;;;;N;CIRCLED HANGUL DIGEUD;;;; 3263;CIRCLED HANGUL RIEUL;So;0;L; 1105;;;;N;CIRCLED HANGUL LIEUL;;;; 3264;CIRCLED HANGUL MIEUM;So;0;L; 1106;;;;N;;;;; 3265;CIRCLED HANGUL PIEUP;So;0;L; 1107;;;;N;CIRCLED HANGUL BIEUB;;;; 3266;CIRCLED HANGUL SIOS;So;0;L; 1109;;;;N;;;;; 3267;CIRCLED HANGUL IEUNG;So;0;L; 110B;;;;N;;;;; 3268;CIRCLED HANGUL CIEUC;So;0;L; 110C;;;;N;CIRCLED HANGUL JIEUJ;;;; 3269;CIRCLED HANGUL CHIEUCH;So;0;L; 110E;;;;N;CIRCLED HANGUL CIEUC;;;; 326A;CIRCLED HANGUL KHIEUKH;So;0;L; 110F;;;;N;CIRCLED HANGUL KIYEOK;;;; 326B;CIRCLED HANGUL THIEUTH;So;0;L; 1110;;;;N;CIRCLED HANGUL TIEUT;;;; 326C;CIRCLED HANGUL PHIEUPH;So;0;L; 1111;;;;N;CIRCLED HANGUL PIEUP;;;; 326D;CIRCLED HANGUL HIEUH;So;0;L; 1112;;;;N;;;;; 326E;CIRCLED HANGUL KIYEOK A;So;0;L; 1100 1161;;;;N;CIRCLED HANGUL GA;;;; 326F;CIRCLED HANGUL NIEUN A;So;0;L; 1102 1161;;;;N;CIRCLED HANGUL NA;;;; 3270;CIRCLED HANGUL TIKEUT A;So;0;L; 1103 1161;;;;N;CIRCLED HANGUL DA;;;; 3271;CIRCLED HANGUL RIEUL A;So;0;L; 1105 1161;;;;N;CIRCLED HANGUL LA;;;; 3272;CIRCLED HANGUL MIEUM A;So;0;L; 1106 1161;;;;N;CIRCLED HANGUL MA;;;; 3273;CIRCLED HANGUL PIEUP A;So;0;L; 1107 1161;;;;N;CIRCLED HANGUL BA;;;; 3274;CIRCLED HANGUL SIOS A;So;0;L; 1109 1161;;;;N;CIRCLED HANGUL SA;;;; 3275;CIRCLED HANGUL IEUNG A;So;0;L; 110B 1161;;;;N;CIRCLED HANGUL A;;;; 3276;CIRCLED HANGUL CIEUC A;So;0;L; 110C 1161;;;;N;CIRCLED HANGUL JA;;;; 3277;CIRCLED HANGUL CHIEUCH A;So;0;L; 110E 1161;;;;N;CIRCLED HANGUL CA;;;; 3278;CIRCLED HANGUL KHIEUKH A;So;0;L; 110F 1161;;;;N;CIRCLED HANGUL KA;;;; 3279;CIRCLED HANGUL THIEUTH A;So;0;L; 1110 1161;;;;N;CIRCLED HANGUL TA;;;; 327A;CIRCLED HANGUL PHIEUPH A;So;0;L; 1111 1161;;;;N;CIRCLED HANGUL PA;;;; 327B;CIRCLED HANGUL HIEUH A;So;0;L; 1112 1161;;;;N;CIRCLED HANGUL HA;;;; 327C;CIRCLED KOREAN CHARACTER CHAMKO;So;0;ON; 110E 1161 11B7 1100 1169;;;;N;;;;; 327D;CIRCLED KOREAN CHARACTER JUEUI;So;0;ON; 110C 116E 110B 1174;;;;N;;;;; 327E;CIRCLED HANGUL IEUNG U;So;0;ON; 110B 116E;;;;N;;;;; 327F;KOREAN STANDARD SYMBOL;So;0;L;;;;;N;;;;; 3280;CIRCLED IDEOGRAPH ONE;No;0;L; 4E00;;;1;N;;;;; 3281;CIRCLED IDEOGRAPH TWO;No;0;L; 4E8C;;;2;N;;;;; 3282;CIRCLED IDEOGRAPH THREE;No;0;L; 4E09;;;3;N;;;;; 3283;CIRCLED IDEOGRAPH FOUR;No;0;L; 56DB;;;4;N;;;;; 3284;CIRCLED IDEOGRAPH FIVE;No;0;L; 4E94;;;5;N;;;;; 3285;CIRCLED IDEOGRAPH SIX;No;0;L; 516D;;;6;N;;;;; 3286;CIRCLED IDEOGRAPH SEVEN;No;0;L; 4E03;;;7;N;;;;; 3287;CIRCLED IDEOGRAPH EIGHT;No;0;L; 516B;;;8;N;;;;; 3288;CIRCLED IDEOGRAPH NINE;No;0;L; 4E5D;;;9;N;;;;; 3289;CIRCLED IDEOGRAPH TEN;No;0;L; 5341;;;10;N;;;;; 328A;CIRCLED IDEOGRAPH MOON;So;0;L; 6708;;;;N;;;;; 328B;CIRCLED IDEOGRAPH FIRE;So;0;L; 706B;;;;N;;;;; 328C;CIRCLED IDEOGRAPH WATER;So;0;L; 6C34;;;;N;;;;; 328D;CIRCLED IDEOGRAPH WOOD;So;0;L; 6728;;;;N;;;;; 328E;CIRCLED IDEOGRAPH METAL;So;0;L; 91D1;;;;N;;;;; 328F;CIRCLED IDEOGRAPH EARTH;So;0;L; 571F;;;;N;;;;; 3290;CIRCLED IDEOGRAPH SUN;So;0;L; 65E5;;;;N;;;;; 3291;CIRCLED IDEOGRAPH STOCK;So;0;L; 682A;;;;N;;;;; 3292;CIRCLED IDEOGRAPH HAVE;So;0;L; 6709;;;;N;;;;; 3293;CIRCLED IDEOGRAPH SOCIETY;So;0;L; 793E;;;;N;;;;; 3294;CIRCLED IDEOGRAPH NAME;So;0;L; 540D;;;;N;;;;; 3295;CIRCLED IDEOGRAPH SPECIAL;So;0;L; 7279;;;;N;;;;; 3296;CIRCLED IDEOGRAPH FINANCIAL;So;0;L; 8CA1;;;;N;;;;; 3297;CIRCLED IDEOGRAPH CONGRATULATION;So;0;L; 795D;;;;N;;;;; 3298;CIRCLED IDEOGRAPH LABOR;So;0;L; 52B4;;;;N;;;;; 3299;CIRCLED IDEOGRAPH SECRET;So;0;L; 79D8;;;;N;;;;; 329A;CIRCLED IDEOGRAPH MALE;So;0;L; 7537;;;;N;;;;; 329B;CIRCLED IDEOGRAPH FEMALE;So;0;L; 5973;;;;N;;;;; 329C;CIRCLED IDEOGRAPH SUITABLE;So;0;L; 9069;;;;N;;;;; 329D;CIRCLED IDEOGRAPH EXCELLENT;So;0;L; 512A;;;;N;;;;; 329E;CIRCLED IDEOGRAPH PRINT;So;0;L; 5370;;;;N;;;;; 329F;CIRCLED IDEOGRAPH ATTENTION;So;0;L; 6CE8;;;;N;;;;; 32A0;CIRCLED IDEOGRAPH ITEM;So;0;L; 9805;;;;N;;;;; 32A1;CIRCLED IDEOGRAPH REST;So;0;L; 4F11;;;;N;;;;; 32A2;CIRCLED IDEOGRAPH COPY;So;0;L; 5199;;;;N;;;;; 32A3;CIRCLED IDEOGRAPH CORRECT;So;0;L; 6B63;;;;N;;;;; 32A4;CIRCLED IDEOGRAPH HIGH;So;0;L; 4E0A;;;;N;;;;; 32A5;CIRCLED IDEOGRAPH CENTRE;So;0;L; 4E2D;;;;N;CIRCLED IDEOGRAPH CENTER;;;; 32A6;CIRCLED IDEOGRAPH LOW;So;0;L; 4E0B;;;;N;;;;; 32A7;CIRCLED IDEOGRAPH LEFT;So;0;L; 5DE6;;;;N;;;;; 32A8;CIRCLED IDEOGRAPH RIGHT;So;0;L; 53F3;;;;N;;;;; 32A9;CIRCLED IDEOGRAPH MEDICINE;So;0;L; 533B;;;;N;;;;; 32AA;CIRCLED IDEOGRAPH RELIGION;So;0;L; 5B97;;;;N;;;;; 32AB;CIRCLED IDEOGRAPH STUDY;So;0;L; 5B66;;;;N;;;;; 32AC;CIRCLED IDEOGRAPH SUPERVISE;So;0;L; 76E3;;;;N;;;;; 32AD;CIRCLED IDEOGRAPH ENTERPRISE;So;0;L; 4F01;;;;N;;;;; 32AE;CIRCLED IDEOGRAPH RESOURCE;So;0;L; 8CC7;;;;N;;;;; 32AF;CIRCLED IDEOGRAPH ALLIANCE;So;0;L; 5354;;;;N;;;;; 32B0;CIRCLED IDEOGRAPH NIGHT;So;0;L; 591C;;;;N;;;;; 32B1;CIRCLED NUMBER THIRTY SIX;No;0;ON; 0033 0036;;;36;N;;;;; 32B2;CIRCLED NUMBER THIRTY SEVEN;No;0;ON; 0033 0037;;;37;N;;;;; 32B3;CIRCLED NUMBER THIRTY EIGHT;No;0;ON; 0033 0038;;;38;N;;;;; 32B4;CIRCLED NUMBER THIRTY NINE;No;0;ON; 0033 0039;;;39;N;;;;; 32B5;CIRCLED NUMBER FORTY;No;0;ON; 0034 0030;;;40;N;;;;; 32B6;CIRCLED NUMBER FORTY ONE;No;0;ON; 0034 0031;;;41;N;;;;; 32B7;CIRCLED NUMBER FORTY TWO;No;0;ON; 0034 0032;;;42;N;;;;; 32B8;CIRCLED NUMBER FORTY THREE;No;0;ON; 0034 0033;;;43;N;;;;; 32B9;CIRCLED NUMBER FORTY FOUR;No;0;ON; 0034 0034;;;44;N;;;;; 32BA;CIRCLED NUMBER FORTY FIVE;No;0;ON; 0034 0035;;;45;N;;;;; 32BB;CIRCLED NUMBER FORTY SIX;No;0;ON; 0034 0036;;;46;N;;;;; 32BC;CIRCLED NUMBER FORTY SEVEN;No;0;ON; 0034 0037;;;47;N;;;;; 32BD;CIRCLED NUMBER FORTY EIGHT;No;0;ON; 0034 0038;;;48;N;;;;; 32BE;CIRCLED NUMBER FORTY NINE;No;0;ON; 0034 0039;;;49;N;;;;; 32BF;CIRCLED NUMBER FIFTY;No;0;ON; 0035 0030;;;50;N;;;;; 32C0;IDEOGRAPHIC TELEGRAPH SYMBOL FOR JANUARY;So;0;L; 0031 6708;;;;N;;;;; 32C1;IDEOGRAPHIC TELEGRAPH SYMBOL FOR FEBRUARY;So;0;L; 0032 6708;;;;N;;;;; 32C2;IDEOGRAPHIC TELEGRAPH SYMBOL FOR MARCH;So;0;L; 0033 6708;;;;N;;;;; 32C3;IDEOGRAPHIC TELEGRAPH SYMBOL FOR APRIL;So;0;L; 0034 6708;;;;N;;;;; 32C4;IDEOGRAPHIC TELEGRAPH SYMBOL FOR MAY;So;0;L; 0035 6708;;;;N;;;;; 32C5;IDEOGRAPHIC TELEGRAPH SYMBOL FOR JUNE;So;0;L; 0036 6708;;;;N;;;;; 32C6;IDEOGRAPHIC TELEGRAPH SYMBOL FOR JULY;So;0;L; 0037 6708;;;;N;;;;; 32C7;IDEOGRAPHIC TELEGRAPH SYMBOL FOR AUGUST;So;0;L; 0038 6708;;;;N;;;;; 32C8;IDEOGRAPHIC TELEGRAPH SYMBOL FOR SEPTEMBER;So;0;L; 0039 6708;;;;N;;;;; 32C9;IDEOGRAPHIC TELEGRAPH SYMBOL FOR OCTOBER;So;0;L; 0031 0030 6708;;;;N;;;;; 32CA;IDEOGRAPHIC TELEGRAPH SYMBOL FOR NOVEMBER;So;0;L; 0031 0031 6708;;;;N;;;;; 32CB;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DECEMBER;So;0;L; 0031 0032 6708;;;;N;;;;; 32CC;SQUARE HG;So;0;ON; 0048 0067;;;;N;;;;; 32CD;SQUARE ERG;So;0;ON; 0065 0072 0067;;;;N;;;;; 32CE;SQUARE EV;So;0;ON; 0065 0056;;;;N;;;;; 32CF;LIMITED LIABILITY SIGN;So;0;ON; 004C 0054 0044;;;;N;;;;; 32D0;CIRCLED KATAKANA A;So;0;L; 30A2;;;;N;;;;; 32D1;CIRCLED KATAKANA I;So;0;L; 30A4;;;;N;;;;; 32D2;CIRCLED KATAKANA U;So;0;L; 30A6;;;;N;;;;; 32D3;CIRCLED KATAKANA E;So;0;L; 30A8;;;;N;;;;; 32D4;CIRCLED KATAKANA O;So;0;L; 30AA;;;;N;;;;; 32D5;CIRCLED KATAKANA KA;So;0;L; 30AB;;;;N;;;;; 32D6;CIRCLED KATAKANA KI;So;0;L; 30AD;;;;N;;;;; 32D7;CIRCLED KATAKANA KU;So;0;L; 30AF;;;;N;;;;; 32D8;CIRCLED KATAKANA KE;So;0;L; 30B1;;;;N;;;;; 32D9;CIRCLED KATAKANA KO;So;0;L; 30B3;;;;N;;;;; 32DA;CIRCLED KATAKANA SA;So;0;L; 30B5;;;;N;;;;; 32DB;CIRCLED KATAKANA SI;So;0;L; 30B7;;;;N;;;;; 32DC;CIRCLED KATAKANA SU;So;0;L; 30B9;;;;N;;;;; 32DD;CIRCLED KATAKANA SE;So;0;L; 30BB;;;;N;;;;; 32DE;CIRCLED KATAKANA SO;So;0;L; 30BD;;;;N;;;;; 32DF;CIRCLED KATAKANA TA;So;0;L; 30BF;;;;N;;;;; 32E0;CIRCLED KATAKANA TI;So;0;L; 30C1;;;;N;;;;; 32E1;CIRCLED KATAKANA TU;So;0;L; 30C4;;;;N;;;;; 32E2;CIRCLED KATAKANA TE;So;0;L; 30C6;;;;N;;;;; 32E3;CIRCLED KATAKANA TO;So;0;L; 30C8;;;;N;;;;; 32E4;CIRCLED KATAKANA NA;So;0;L; 30CA;;;;N;;;;; 32E5;CIRCLED KATAKANA NI;So;0;L; 30CB;;;;N;;;;; 32E6;CIRCLED KATAKANA NU;So;0;L; 30CC;;;;N;;;;; 32E7;CIRCLED KATAKANA NE;So;0;L; 30CD;;;;N;;;;; 32E8;CIRCLED KATAKANA NO;So;0;L; 30CE;;;;N;;;;; 32E9;CIRCLED KATAKANA HA;So;0;L; 30CF;;;;N;;;;; 32EA;CIRCLED KATAKANA HI;So;0;L; 30D2;;;;N;;;;; 32EB;CIRCLED KATAKANA HU;So;0;L; 30D5;;;;N;;;;; 32EC;CIRCLED KATAKANA HE;So;0;L; 30D8;;;;N;;;;; 32ED;CIRCLED KATAKANA HO;So;0;L; 30DB;;;;N;;;;; 32EE;CIRCLED KATAKANA MA;So;0;L; 30DE;;;;N;;;;; 32EF;CIRCLED KATAKANA MI;So;0;L; 30DF;;;;N;;;;; 32F0;CIRCLED KATAKANA MU;So;0;L; 30E0;;;;N;;;;; 32F1;CIRCLED KATAKANA ME;So;0;L; 30E1;;;;N;;;;; 32F2;CIRCLED KATAKANA MO;So;0;L; 30E2;;;;N;;;;; 32F3;CIRCLED KATAKANA YA;So;0;L; 30E4;;;;N;;;;; 32F4;CIRCLED KATAKANA YU;So;0;L; 30E6;;;;N;;;;; 32F5;CIRCLED KATAKANA YO;So;0;L; 30E8;;;;N;;;;; 32F6;CIRCLED KATAKANA RA;So;0;L; 30E9;;;;N;;;;; 32F7;CIRCLED KATAKANA RI;So;0;L; 30EA;;;;N;;;;; 32F8;CIRCLED KATAKANA RU;So;0;L; 30EB;;;;N;;;;; 32F9;CIRCLED KATAKANA RE;So;0;L; 30EC;;;;N;;;;; 32FA;CIRCLED KATAKANA RO;So;0;L; 30ED;;;;N;;;;; 32FB;CIRCLED KATAKANA WA;So;0;L; 30EF;;;;N;;;;; 32FC;CIRCLED KATAKANA WI;So;0;L; 30F0;;;;N;;;;; 32FD;CIRCLED KATAKANA WE;So;0;L; 30F1;;;;N;;;;; 32FE;CIRCLED KATAKANA WO;So;0;L; 30F2;;;;N;;;;; 3300;SQUARE APAATO;So;0;L; 30A2 30D1 30FC 30C8;;;;N;SQUARED APAATO;;;; 3301;SQUARE ARUHUA;So;0;L; 30A2 30EB 30D5 30A1;;;;N;SQUARED ARUHUA;;;; 3302;SQUARE ANPEA;So;0;L; 30A2 30F3 30DA 30A2;;;;N;SQUARED ANPEA;;;; 3303;SQUARE AARU;So;0;L; 30A2 30FC 30EB;;;;N;SQUARED AARU;;;; 3304;SQUARE ININGU;So;0;L; 30A4 30CB 30F3 30B0;;;;N;SQUARED ININGU;;;; 3305;SQUARE INTI;So;0;L; 30A4 30F3 30C1;;;;N;SQUARED INTI;;;; 3306;SQUARE UON;So;0;L; 30A6 30A9 30F3;;;;N;SQUARED UON;;;; 3307;SQUARE ESUKUUDO;So;0;L; 30A8 30B9 30AF 30FC 30C9;;;;N;SQUARED ESUKUUDO;;;; 3308;SQUARE EEKAA;So;0;L; 30A8 30FC 30AB 30FC;;;;N;SQUARED EEKAA;;;; 3309;SQUARE ONSU;So;0;L; 30AA 30F3 30B9;;;;N;SQUARED ONSU;;;; 330A;SQUARE OOMU;So;0;L; 30AA 30FC 30E0;;;;N;SQUARED OOMU;;;; 330B;SQUARE KAIRI;So;0;L; 30AB 30A4 30EA;;;;N;SQUARED KAIRI;;;; 330C;SQUARE KARATTO;So;0;L; 30AB 30E9 30C3 30C8;;;;N;SQUARED KARATTO;;;; 330D;SQUARE KARORII;So;0;L; 30AB 30ED 30EA 30FC;;;;N;SQUARED KARORII;;;; 330E;SQUARE GARON;So;0;L; 30AC 30ED 30F3;;;;N;SQUARED GARON;;;; 330F;SQUARE GANMA;So;0;L; 30AC 30F3 30DE;;;;N;SQUARED GANMA;;;; 3310;SQUARE GIGA;So;0;L; 30AE 30AC;;;;N;SQUARED GIGA;;;; 3311;SQUARE GINII;So;0;L; 30AE 30CB 30FC;;;;N;SQUARED GINII;;;; 3312;SQUARE KYURII;So;0;L; 30AD 30E5 30EA 30FC;;;;N;SQUARED KYURII;;;; 3313;SQUARE GIRUDAA;So;0;L; 30AE 30EB 30C0 30FC;;;;N;SQUARED GIRUDAA;;;; 3314;SQUARE KIRO;So;0;L; 30AD 30ED;;;;N;SQUARED KIRO;;;; 3315;SQUARE KIROGURAMU;So;0;L; 30AD 30ED 30B0 30E9 30E0;;;;N;SQUARED KIROGURAMU;;;; 3316;SQUARE KIROMEETORU;So;0;L; 30AD 30ED 30E1 30FC 30C8 30EB;;;;N;SQUARED KIROMEETORU;;;; 3317;SQUARE KIROWATTO;So;0;L; 30AD 30ED 30EF 30C3 30C8;;;;N;SQUARED KIROWATTO;;;; 3318;SQUARE GURAMU;So;0;L; 30B0 30E9 30E0;;;;N;SQUARED GURAMU;;;; 3319;SQUARE GURAMUTON;So;0;L; 30B0 30E9 30E0 30C8 30F3;;;;N;SQUARED GURAMUTON;;;; 331A;SQUARE KURUZEIRO;So;0;L; 30AF 30EB 30BC 30A4 30ED;;;;N;SQUARED KURUZEIRO;;;; 331B;SQUARE KUROONE;So;0;L; 30AF 30ED 30FC 30CD;;;;N;SQUARED KUROONE;;;; 331C;SQUARE KEESU;So;0;L; 30B1 30FC 30B9;;;;N;SQUARED KEESU;;;; 331D;SQUARE KORUNA;So;0;L; 30B3 30EB 30CA;;;;N;SQUARED KORUNA;;;; 331E;SQUARE KOOPO;So;0;L; 30B3 30FC 30DD;;;;N;SQUARED KOOPO;;;; 331F;SQUARE SAIKURU;So;0;L; 30B5 30A4 30AF 30EB;;;;N;SQUARED SAIKURU;;;; 3320;SQUARE SANTIIMU;So;0;L; 30B5 30F3 30C1 30FC 30E0;;;;N;SQUARED SANTIIMU;;;; 3321;SQUARE SIRINGU;So;0;L; 30B7 30EA 30F3 30B0;;;;N;SQUARED SIRINGU;;;; 3322;SQUARE SENTI;So;0;L; 30BB 30F3 30C1;;;;N;SQUARED SENTI;;;; 3323;SQUARE SENTO;So;0;L; 30BB 30F3 30C8;;;;N;SQUARED SENTO;;;; 3324;SQUARE DAASU;So;0;L; 30C0 30FC 30B9;;;;N;SQUARED DAASU;;;; 3325;SQUARE DESI;So;0;L; 30C7 30B7;;;;N;SQUARED DESI;;;; 3326;SQUARE DORU;So;0;L; 30C9 30EB;;;;N;SQUARED DORU;;;; 3327;SQUARE TON;So;0;L; 30C8 30F3;;;;N;SQUARED TON;;;; 3328;SQUARE NANO;So;0;L; 30CA 30CE;;;;N;SQUARED NANO;;;; 3329;SQUARE NOTTO;So;0;L; 30CE 30C3 30C8;;;;N;SQUARED NOTTO;;;; 332A;SQUARE HAITU;So;0;L; 30CF 30A4 30C4;;;;N;SQUARED HAITU;;;; 332B;SQUARE PAASENTO;So;0;L; 30D1 30FC 30BB 30F3 30C8;;;;N;SQUARED PAASENTO;;;; 332C;SQUARE PAATU;So;0;L; 30D1 30FC 30C4;;;;N;SQUARED PAATU;;;; 332D;SQUARE BAARERU;So;0;L; 30D0 30FC 30EC 30EB;;;;N;SQUARED BAARERU;;;; 332E;SQUARE PIASUTORU;So;0;L; 30D4 30A2 30B9 30C8 30EB;;;;N;SQUARED PIASUTORU;;;; 332F;SQUARE PIKURU;So;0;L; 30D4 30AF 30EB;;;;N;SQUARED PIKURU;;;; 3330;SQUARE PIKO;So;0;L; 30D4 30B3;;;;N;SQUARED PIKO;;;; 3331;SQUARE BIRU;So;0;L; 30D3 30EB;;;;N;SQUARED BIRU;;;; 3332;SQUARE HUARADDO;So;0;L; 30D5 30A1 30E9 30C3 30C9;;;;N;SQUARED HUARADDO;;;; 3333;SQUARE HUIITO;So;0;L; 30D5 30A3 30FC 30C8;;;;N;SQUARED HUIITO;;;; 3334;SQUARE BUSSYERU;So;0;L; 30D6 30C3 30B7 30A7 30EB;;;;N;SQUARED BUSSYERU;;;; 3335;SQUARE HURAN;So;0;L; 30D5 30E9 30F3;;;;N;SQUARED HURAN;;;; 3336;SQUARE HEKUTAARU;So;0;L; 30D8 30AF 30BF 30FC 30EB;;;;N;SQUARED HEKUTAARU;;;; 3337;SQUARE PESO;So;0;L; 30DA 30BD;;;;N;SQUARED PESO;;;; 3338;SQUARE PENIHI;So;0;L; 30DA 30CB 30D2;;;;N;SQUARED PENIHI;;;; 3339;SQUARE HERUTU;So;0;L; 30D8 30EB 30C4;;;;N;SQUARED HERUTU;;;; 333A;SQUARE PENSU;So;0;L; 30DA 30F3 30B9;;;;N;SQUARED PENSU;;;; 333B;SQUARE PEEZI;So;0;L; 30DA 30FC 30B8;;;;N;SQUARED PEEZI;;;; 333C;SQUARE BEETA;So;0;L; 30D9 30FC 30BF;;;;N;SQUARED BEETA;;;; 333D;SQUARE POINTO;So;0;L; 30DD 30A4 30F3 30C8;;;;N;SQUARED POINTO;;;; 333E;SQUARE BORUTO;So;0;L; 30DC 30EB 30C8;;;;N;SQUARED BORUTO;;;; 333F;SQUARE HON;So;0;L; 30DB 30F3;;;;N;SQUARED HON;;;; 3340;SQUARE PONDO;So;0;L; 30DD 30F3 30C9;;;;N;SQUARED PONDO;;;; 3341;SQUARE HOORU;So;0;L; 30DB 30FC 30EB;;;;N;SQUARED HOORU;;;; 3342;SQUARE HOON;So;0;L; 30DB 30FC 30F3;;;;N;SQUARED HOON;;;; 3343;SQUARE MAIKURO;So;0;L; 30DE 30A4 30AF 30ED;;;;N;SQUARED MAIKURO;;;; 3344;SQUARE MAIRU;So;0;L; 30DE 30A4 30EB;;;;N;SQUARED MAIRU;;;; 3345;SQUARE MAHHA;So;0;L; 30DE 30C3 30CF;;;;N;SQUARED MAHHA;;;; 3346;SQUARE MARUKU;So;0;L; 30DE 30EB 30AF;;;;N;SQUARED MARUKU;;;; 3347;SQUARE MANSYON;So;0;L; 30DE 30F3 30B7 30E7 30F3;;;;N;SQUARED MANSYON;;;; 3348;SQUARE MIKURON;So;0;L; 30DF 30AF 30ED 30F3;;;;N;SQUARED MIKURON;;;; 3349;SQUARE MIRI;So;0;L; 30DF 30EA;;;;N;SQUARED MIRI;;;; 334A;SQUARE MIRIBAARU;So;0;L; 30DF 30EA 30D0 30FC 30EB;;;;N;SQUARED MIRIBAARU;;;; 334B;SQUARE MEGA;So;0;L; 30E1 30AC;;;;N;SQUARED MEGA;;;; 334C;SQUARE MEGATON;So;0;L; 30E1 30AC 30C8 30F3;;;;N;SQUARED MEGATON;;;; 334D;SQUARE MEETORU;So;0;L; 30E1 30FC 30C8 30EB;;;;N;SQUARED MEETORU;;;; 334E;SQUARE YAADO;So;0;L; 30E4 30FC 30C9;;;;N;SQUARED YAADO;;;; 334F;SQUARE YAARU;So;0;L; 30E4 30FC 30EB;;;;N;SQUARED YAARU;;;; 3350;SQUARE YUAN;So;0;L; 30E6 30A2 30F3;;;;N;SQUARED YUAN;;;; 3351;SQUARE RITTORU;So;0;L; 30EA 30C3 30C8 30EB;;;;N;SQUARED RITTORU;;;; 3352;SQUARE RIRA;So;0;L; 30EA 30E9;;;;N;SQUARED RIRA;;;; 3353;SQUARE RUPII;So;0;L; 30EB 30D4 30FC;;;;N;SQUARED RUPII;;;; 3354;SQUARE RUUBURU;So;0;L; 30EB 30FC 30D6 30EB;;;;N;SQUARED RUUBURU;;;; 3355;SQUARE REMU;So;0;L; 30EC 30E0;;;;N;SQUARED REMU;;;; 3356;SQUARE RENTOGEN;So;0;L; 30EC 30F3 30C8 30B2 30F3;;;;N;SQUARED RENTOGEN;;;; 3357;SQUARE WATTO;So;0;L; 30EF 30C3 30C8;;;;N;SQUARED WATTO;;;; 3358;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR ZERO;So;0;L; 0030 70B9;;;;N;;;;; 3359;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR ONE;So;0;L; 0031 70B9;;;;N;;;;; 335A;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWO;So;0;L; 0032 70B9;;;;N;;;;; 335B;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR THREE;So;0;L; 0033 70B9;;;;N;;;;; 335C;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR FOUR;So;0;L; 0034 70B9;;;;N;;;;; 335D;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR FIVE;So;0;L; 0035 70B9;;;;N;;;;; 335E;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR SIX;So;0;L; 0036 70B9;;;;N;;;;; 335F;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR SEVEN;So;0;L; 0037 70B9;;;;N;;;;; 3360;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR EIGHT;So;0;L; 0038 70B9;;;;N;;;;; 3361;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR NINE;So;0;L; 0039 70B9;;;;N;;;;; 3362;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TEN;So;0;L; 0031 0030 70B9;;;;N;;;;; 3363;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR ELEVEN;So;0;L; 0031 0031 70B9;;;;N;;;;; 3364;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWELVE;So;0;L; 0031 0032 70B9;;;;N;;;;; 3365;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR THIRTEEN;So;0;L; 0031 0033 70B9;;;;N;;;;; 3366;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR FOURTEEN;So;0;L; 0031 0034 70B9;;;;N;;;;; 3367;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR FIFTEEN;So;0;L; 0031 0035 70B9;;;;N;;;;; 3368;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR SIXTEEN;So;0;L; 0031 0036 70B9;;;;N;;;;; 3369;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR SEVENTEEN;So;0;L; 0031 0037 70B9;;;;N;;;;; 336A;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR EIGHTEEN;So;0;L; 0031 0038 70B9;;;;N;;;;; 336B;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR NINETEEN;So;0;L; 0031 0039 70B9;;;;N;;;;; 336C;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWENTY;So;0;L; 0032 0030 70B9;;;;N;;;;; 336D;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWENTY-ONE;So;0;L; 0032 0031 70B9;;;;N;;;;; 336E;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWENTY-TWO;So;0;L; 0032 0032 70B9;;;;N;;;;; 336F;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWENTY-THREE;So;0;L; 0032 0033 70B9;;;;N;;;;; 3370;IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWENTY-FOUR;So;0;L; 0032 0034 70B9;;;;N;;;;; 3371;SQUARE HPA;So;0;L; 0068 0050 0061;;;;N;;;;; 3372;SQUARE DA;So;0;L; 0064 0061;;;;N;;;;; 3373;SQUARE AU;So;0;L; 0041 0055;;;;N;;;;; 3374;SQUARE BAR;So;0;L; 0062 0061 0072;;;;N;;;;; 3375;SQUARE OV;So;0;L; 006F 0056;;;;N;;;;; 3376;SQUARE PC;So;0;L; 0070 0063;;;;N;;;;; 3377;SQUARE DM;So;0;ON; 0064 006D;;;;N;;;;; 3378;SQUARE DM SQUARED;So;0;ON; 0064 006D 00B2;;;;N;;;;; 3379;SQUARE DM CUBED;So;0;ON; 0064 006D 00B3;;;;N;;;;; 337A;SQUARE IU;So;0;ON; 0049 0055;;;;N;;;;; 337B;SQUARE ERA NAME HEISEI;So;0;L; 5E73 6210;;;;N;SQUARED TWO IDEOGRAPHS ERA NAME HEISEI;;;; 337C;SQUARE ERA NAME SYOUWA;So;0;L; 662D 548C;;;;N;SQUARED TWO IDEOGRAPHS ERA NAME SYOUWA;;;; 337D;SQUARE ERA NAME TAISYOU;So;0;L; 5927 6B63;;;;N;SQUARED TWO IDEOGRAPHS ERA NAME TAISYOU;;;; 337E;SQUARE ERA NAME MEIZI;So;0;L; 660E 6CBB;;;;N;SQUARED TWO IDEOGRAPHS ERA NAME MEIZI;;;; 337F;SQUARE CORPORATION;So;0;L; 682A 5F0F 4F1A 793E;;;;N;SQUARED FOUR IDEOGRAPHS CORPORATION;;;; 3380;SQUARE PA AMPS;So;0;L; 0070 0041;;;;N;SQUARED PA AMPS;;;; 3381;SQUARE NA;So;0;L; 006E 0041;;;;N;SQUARED NA;;;; 3382;SQUARE MU A;So;0;L; 03BC 0041;;;;N;SQUARED MU A;;;; 3383;SQUARE MA;So;0;L; 006D 0041;;;;N;SQUARED MA;;;; 3384;SQUARE KA;So;0;L; 006B 0041;;;;N;SQUARED KA;;;; 3385;SQUARE KB;So;0;L; 004B 0042;;;;N;SQUARED KB;;;; 3386;SQUARE MB;So;0;L; 004D 0042;;;;N;SQUARED MB;;;; 3387;SQUARE GB;So;0;L; 0047 0042;;;;N;SQUARED GB;;;; 3388;SQUARE CAL;So;0;L; 0063 0061 006C;;;;N;SQUARED CAL;;;; 3389;SQUARE KCAL;So;0;L; 006B 0063 0061 006C;;;;N;SQUARED KCAL;;;; 338A;SQUARE PF;So;0;L; 0070 0046;;;;N;SQUARED PF;;;; 338B;SQUARE NF;So;0;L; 006E 0046;;;;N;SQUARED NF;;;; 338C;SQUARE MU F;So;0;L; 03BC 0046;;;;N;SQUARED MU F;;;; 338D;SQUARE MU G;So;0;L; 03BC 0067;;;;N;SQUARED MU G;;;; 338E;SQUARE MG;So;0;L; 006D 0067;;;;N;SQUARED MG;;;; 338F;SQUARE KG;So;0;L; 006B 0067;;;;N;SQUARED KG;;;; 3390;SQUARE HZ;So;0;L; 0048 007A;;;;N;SQUARED HZ;;;; 3391;SQUARE KHZ;So;0;L; 006B 0048 007A;;;;N;SQUARED KHZ;;;; 3392;SQUARE MHZ;So;0;L; 004D 0048 007A;;;;N;SQUARED MHZ;;;; 3393;SQUARE GHZ;So;0;L; 0047 0048 007A;;;;N;SQUARED GHZ;;;; 3394;SQUARE THZ;So;0;L; 0054 0048 007A;;;;N;SQUARED THZ;;;; 3395;SQUARE MU L;So;0;L; 03BC 2113;;;;N;SQUARED MU L;;;; 3396;SQUARE ML;So;0;L; 006D 2113;;;;N;SQUARED ML;;;; 3397;SQUARE DL;So;0;L; 0064 2113;;;;N;SQUARED DL;;;; 3398;SQUARE KL;So;0;L; 006B 2113;;;;N;SQUARED KL;;;; 3399;SQUARE FM;So;0;L; 0066 006D;;;;N;SQUARED FM;;;; 339A;SQUARE NM;So;0;L; 006E 006D;;;;N;SQUARED NM;;;; 339B;SQUARE MU M;So;0;L; 03BC 006D;;;;N;SQUARED MU M;;;; 339C;SQUARE MM;So;0;L; 006D 006D;;;;N;SQUARED MM;;;; 339D;SQUARE CM;So;0;L; 0063 006D;;;;N;SQUARED CM;;;; 339E;SQUARE KM;So;0;L; 006B 006D;;;;N;SQUARED KM;;;; 339F;SQUARE MM SQUARED;So;0;L; 006D 006D 00B2;;;;N;SQUARED MM SQUARED;;;; 33A0;SQUARE CM SQUARED;So;0;L; 0063 006D 00B2;;;;N;SQUARED CM SQUARED;;;; 33A1;SQUARE M SQUARED;So;0;L; 006D 00B2;;;;N;SQUARED M SQUARED;;;; 33A2;SQUARE KM SQUARED;So;0;L; 006B 006D 00B2;;;;N;SQUARED KM SQUARED;;;; 33A3;SQUARE MM CUBED;So;0;L; 006D 006D 00B3;;;;N;SQUARED MM CUBED;;;; 33A4;SQUARE CM CUBED;So;0;L; 0063 006D 00B3;;;;N;SQUARED CM CUBED;;;; 33A5;SQUARE M CUBED;So;0;L; 006D 00B3;;;;N;SQUARED M CUBED;;;; 33A6;SQUARE KM CUBED;So;0;L; 006B 006D 00B3;;;;N;SQUARED KM CUBED;;;; 33A7;SQUARE M OVER S;So;0;L; 006D 2215 0073;;;;N;SQUARED M OVER S;;;; 33A8;SQUARE M OVER S SQUARED;So;0;L; 006D 2215 0073 00B2;;;;N;SQUARED M OVER S SQUARED;;;; 33A9;SQUARE PA;So;0;L; 0050 0061;;;;N;SQUARED PA;;;; 33AA;SQUARE KPA;So;0;L; 006B 0050 0061;;;;N;SQUARED KPA;;;; 33AB;SQUARE MPA;So;0;L; 004D 0050 0061;;;;N;SQUARED MPA;;;; 33AC;SQUARE GPA;So;0;L; 0047 0050 0061;;;;N;SQUARED GPA;;;; 33AD;SQUARE RAD;So;0;L; 0072 0061 0064;;;;N;SQUARED RAD;;;; 33AE;SQUARE RAD OVER S;So;0;L; 0072 0061 0064 2215 0073;;;;N;SQUARED RAD OVER S;;;; 33AF;SQUARE RAD OVER S SQUARED;So;0;L; 0072 0061 0064 2215 0073 00B2;;;;N;SQUARED RAD OVER S SQUARED;;;; 33B0;SQUARE PS;So;0;L; 0070 0073;;;;N;SQUARED PS;;;; 33B1;SQUARE NS;So;0;L; 006E 0073;;;;N;SQUARED NS;;;; 33B2;SQUARE MU S;So;0;L; 03BC 0073;;;;N;SQUARED MU S;;;; 33B3;SQUARE MS;So;0;L; 006D 0073;;;;N;SQUARED MS;;;; 33B4;SQUARE PV;So;0;L; 0070 0056;;;;N;SQUARED PV;;;; 33B5;SQUARE NV;So;0;L; 006E 0056;;;;N;SQUARED NV;;;; 33B6;SQUARE MU V;So;0;L; 03BC 0056;;;;N;SQUARED MU V;;;; 33B7;SQUARE MV;So;0;L; 006D 0056;;;;N;SQUARED MV;;;; 33B8;SQUARE KV;So;0;L; 006B 0056;;;;N;SQUARED KV;;;; 33B9;SQUARE MV MEGA;So;0;L; 004D 0056;;;;N;SQUARED MV MEGA;;;; 33BA;SQUARE PW;So;0;L; 0070 0057;;;;N;SQUARED PW;;;; 33BB;SQUARE NW;So;0;L; 006E 0057;;;;N;SQUARED NW;;;; 33BC;SQUARE MU W;So;0;L; 03BC 0057;;;;N;SQUARED MU W;;;; 33BD;SQUARE MW;So;0;L; 006D 0057;;;;N;SQUARED MW;;;; 33BE;SQUARE KW;So;0;L; 006B 0057;;;;N;SQUARED KW;;;; 33BF;SQUARE MW MEGA;So;0;L; 004D 0057;;;;N;SQUARED MW MEGA;;;; 33C0;SQUARE K OHM;So;0;L; 006B 03A9;;;;N;SQUARED K OHM;;;; 33C1;SQUARE M OHM;So;0;L; 004D 03A9;;;;N;SQUARED M OHM;;;; 33C2;SQUARE AM;So;0;L; 0061 002E 006D 002E;;;;N;SQUARED AM;;;; 33C3;SQUARE BQ;So;0;L; 0042 0071;;;;N;SQUARED BQ;;;; 33C4;SQUARE CC;So;0;L; 0063 0063;;;;N;SQUARED CC;;;; 33C5;SQUARE CD;So;0;L; 0063 0064;;;;N;SQUARED CD;;;; 33C6;SQUARE C OVER KG;So;0;L; 0043 2215 006B 0067;;;;N;SQUARED C OVER KG;;;; 33C7;SQUARE CO;So;0;L; 0043 006F 002E;;;;N;SQUARED CO;;;; 33C8;SQUARE DB;So;0;L; 0064 0042;;;;N;SQUARED DB;;;; 33C9;SQUARE GY;So;0;L; 0047 0079;;;;N;SQUARED GY;;;; 33CA;SQUARE HA;So;0;L; 0068 0061;;;;N;SQUARED HA;;;; 33CB;SQUARE HP;So;0;L; 0048 0050;;;;N;SQUARED HP;;;; 33CC;SQUARE IN;So;0;L; 0069 006E;;;;N;SQUARED IN;;;; 33CD;SQUARE KK;So;0;L; 004B 004B;;;;N;SQUARED KK;;;; 33CE;SQUARE KM CAPITAL;So;0;L; 004B 004D;;;;N;SQUARED KM CAPITAL;;;; 33CF;SQUARE KT;So;0;L; 006B 0074;;;;N;SQUARED KT;;;; 33D0;SQUARE LM;So;0;L; 006C 006D;;;;N;SQUARED LM;;;; 33D1;SQUARE LN;So;0;L; 006C 006E;;;;N;SQUARED LN;;;; 33D2;SQUARE LOG;So;0;L; 006C 006F 0067;;;;N;SQUARED LOG;;;; 33D3;SQUARE LX;So;0;L; 006C 0078;;;;N;SQUARED LX;;;; 33D4;SQUARE MB SMALL;So;0;L; 006D 0062;;;;N;SQUARED MB SMALL;;;; 33D5;SQUARE MIL;So;0;L; 006D 0069 006C;;;;N;SQUARED MIL;;;; 33D6;SQUARE MOL;So;0;L; 006D 006F 006C;;;;N;SQUARED MOL;;;; 33D7;SQUARE PH;So;0;L; 0050 0048;;;;N;SQUARED PH;;;; 33D8;SQUARE PM;So;0;L; 0070 002E 006D 002E;;;;N;SQUARED PM;;;; 33D9;SQUARE PPM;So;0;L; 0050 0050 004D;;;;N;SQUARED PPM;;;; 33DA;SQUARE PR;So;0;L; 0050 0052;;;;N;SQUARED PR;;;; 33DB;SQUARE SR;So;0;L; 0073 0072;;;;N;SQUARED SR;;;; 33DC;SQUARE SV;So;0;L; 0053 0076;;;;N;SQUARED SV;;;; 33DD;SQUARE WB;So;0;L; 0057 0062;;;;N;SQUARED WB;;;; 33DE;SQUARE V OVER M;So;0;ON; 0056 2215 006D;;;;N;;;;; 33DF;SQUARE A OVER M;So;0;ON; 0041 2215 006D;;;;N;;;;; 33E0;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY ONE;So;0;L; 0031 65E5;;;;N;;;;; 33E1;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWO;So;0;L; 0032 65E5;;;;N;;;;; 33E2;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY THREE;So;0;L; 0033 65E5;;;;N;;;;; 33E3;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY FOUR;So;0;L; 0034 65E5;;;;N;;;;; 33E4;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY FIVE;So;0;L; 0035 65E5;;;;N;;;;; 33E5;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY SIX;So;0;L; 0036 65E5;;;;N;;;;; 33E6;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY SEVEN;So;0;L; 0037 65E5;;;;N;;;;; 33E7;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY EIGHT;So;0;L; 0038 65E5;;;;N;;;;; 33E8;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY NINE;So;0;L; 0039 65E5;;;;N;;;;; 33E9;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TEN;So;0;L; 0031 0030 65E5;;;;N;;;;; 33EA;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY ELEVEN;So;0;L; 0031 0031 65E5;;;;N;;;;; 33EB;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWELVE;So;0;L; 0031 0032 65E5;;;;N;;;;; 33EC;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY THIRTEEN;So;0;L; 0031 0033 65E5;;;;N;;;;; 33ED;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY FOURTEEN;So;0;L; 0031 0034 65E5;;;;N;;;;; 33EE;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY FIFTEEN;So;0;L; 0031 0035 65E5;;;;N;;;;; 33EF;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY SIXTEEN;So;0;L; 0031 0036 65E5;;;;N;;;;; 33F0;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY SEVENTEEN;So;0;L; 0031 0037 65E5;;;;N;;;;; 33F1;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY EIGHTEEN;So;0;L; 0031 0038 65E5;;;;N;;;;; 33F2;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY NINETEEN;So;0;L; 0031 0039 65E5;;;;N;;;;; 33F3;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY;So;0;L; 0032 0030 65E5;;;;N;;;;; 33F4;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-ONE;So;0;L; 0032 0031 65E5;;;;N;;;;; 33F5;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-TWO;So;0;L; 0032 0032 65E5;;;;N;;;;; 33F6;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-THREE;So;0;L; 0032 0033 65E5;;;;N;;;;; 33F7;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-FOUR;So;0;L; 0032 0034 65E5;;;;N;;;;; 33F8;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-FIVE;So;0;L; 0032 0035 65E5;;;;N;;;;; 33F9;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-SIX;So;0;L; 0032 0036 65E5;;;;N;;;;; 33FA;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-SEVEN;So;0;L; 0032 0037 65E5;;;;N;;;;; 33FB;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-EIGHT;So;0;L; 0032 0038 65E5;;;;N;;;;; 33FC;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-NINE;So;0;L; 0032 0039 65E5;;;;N;;;;; 33FD;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY THIRTY;So;0;L; 0033 0030 65E5;;;;N;;;;; 33FE;IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY THIRTY-ONE;So;0;L; 0033 0031 65E5;;;;N;;;;; 33FF;SQUARE GAL;So;0;ON; 0067 0061 006C;;;;N;;;;; 3400;;Lo;0;L;;;;;N;;;;; 4DB5;;Lo;0;L;;;;;N;;;;; 4DC0;HEXAGRAM FOR THE CREATIVE HEAVEN;So;0;ON;;;;;N;;;;; 4DC1;HEXAGRAM FOR THE RECEPTIVE EARTH;So;0;ON;;;;;N;;;;; 4DC2;HEXAGRAM FOR DIFFICULTY AT THE BEGINNING;So;0;ON;;;;;N;;;;; 4DC3;HEXAGRAM FOR YOUTHFUL FOLLY;So;0;ON;;;;;N;;;;; 4DC4;HEXAGRAM FOR WAITING;So;0;ON;;;;;N;;;;; 4DC5;HEXAGRAM FOR CONFLICT;So;0;ON;;;;;N;;;;; 4DC6;HEXAGRAM FOR THE ARMY;So;0;ON;;;;;N;;;;; 4DC7;HEXAGRAM FOR HOLDING TOGETHER;So;0;ON;;;;;N;;;;; 4DC8;HEXAGRAM FOR SMALL TAMING;So;0;ON;;;;;N;;;;; 4DC9;HEXAGRAM FOR TREADING;So;0;ON;;;;;N;;;;; 4DCA;HEXAGRAM FOR PEACE;So;0;ON;;;;;N;;;;; 4DCB;HEXAGRAM FOR STANDSTILL;So;0;ON;;;;;N;;;;; 4DCC;HEXAGRAM FOR FELLOWSHIP;So;0;ON;;;;;N;;;;; 4DCD;HEXAGRAM FOR GREAT POSSESSION;So;0;ON;;;;;N;;;;; 4DCE;HEXAGRAM FOR MODESTY;So;0;ON;;;;;N;;;;; 4DCF;HEXAGRAM FOR ENTHUSIASM;So;0;ON;;;;;N;;;;; 4DD0;HEXAGRAM FOR FOLLOWING;So;0;ON;;;;;N;;;;; 4DD1;HEXAGRAM FOR WORK ON THE DECAYED;So;0;ON;;;;;N;;;;; 4DD2;HEXAGRAM FOR APPROACH;So;0;ON;;;;;N;;;;; 4DD3;HEXAGRAM FOR CONTEMPLATION;So;0;ON;;;;;N;;;;; 4DD4;HEXAGRAM FOR BITING THROUGH;So;0;ON;;;;;N;;;;; 4DD5;HEXAGRAM FOR GRACE;So;0;ON;;;;;N;;;;; 4DD6;HEXAGRAM FOR SPLITTING APART;So;0;ON;;;;;N;;;;; 4DD7;HEXAGRAM FOR RETURN;So;0;ON;;;;;N;;;;; 4DD8;HEXAGRAM FOR INNOCENCE;So;0;ON;;;;;N;;;;; 4DD9;HEXAGRAM FOR GREAT TAMING;So;0;ON;;;;;N;;;;; 4DDA;HEXAGRAM FOR MOUTH CORNERS;So;0;ON;;;;;N;;;;; 4DDB;HEXAGRAM FOR GREAT PREPONDERANCE;So;0;ON;;;;;N;;;;; 4DDC;HEXAGRAM FOR THE ABYSMAL WATER;So;0;ON;;;;;N;;;;; 4DDD;HEXAGRAM FOR THE CLINGING FIRE;So;0;ON;;;;;N;;;;; 4DDE;HEXAGRAM FOR INFLUENCE;So;0;ON;;;;;N;;;;; 4DDF;HEXAGRAM FOR DURATION;So;0;ON;;;;;N;;;;; 4DE0;HEXAGRAM FOR RETREAT;So;0;ON;;;;;N;;;;; 4DE1;HEXAGRAM FOR GREAT POWER;So;0;ON;;;;;N;;;;; 4DE2;HEXAGRAM FOR PROGRESS;So;0;ON;;;;;N;;;;; 4DE3;HEXAGRAM FOR DARKENING OF THE LIGHT;So;0;ON;;;;;N;;;;; 4DE4;HEXAGRAM FOR THE FAMILY;So;0;ON;;;;;N;;;;; 4DE5;HEXAGRAM FOR OPPOSITION;So;0;ON;;;;;N;;;;; 4DE6;HEXAGRAM FOR OBSTRUCTION;So;0;ON;;;;;N;;;;; 4DE7;HEXAGRAM FOR DELIVERANCE;So;0;ON;;;;;N;;;;; 4DE8;HEXAGRAM FOR DECREASE;So;0;ON;;;;;N;;;;; 4DE9;HEXAGRAM FOR INCREASE;So;0;ON;;;;;N;;;;; 4DEA;HEXAGRAM FOR BREAKTHROUGH;So;0;ON;;;;;N;;;;; 4DEB;HEXAGRAM FOR COMING TO MEET;So;0;ON;;;;;N;;;;; 4DEC;HEXAGRAM FOR GATHERING TOGETHER;So;0;ON;;;;;N;;;;; 4DED;HEXAGRAM FOR PUSHING UPWARD;So;0;ON;;;;;N;;;;; 4DEE;HEXAGRAM FOR OPPRESSION;So;0;ON;;;;;N;;;;; 4DEF;HEXAGRAM FOR THE WELL;So;0;ON;;;;;N;;;;; 4DF0;HEXAGRAM FOR REVOLUTION;So;0;ON;;;;;N;;;;; 4DF1;HEXAGRAM FOR THE CAULDRON;So;0;ON;;;;;N;;;;; 4DF2;HEXAGRAM FOR THE AROUSING THUNDER;So;0;ON;;;;;N;;;;; 4DF3;HEXAGRAM FOR THE KEEPING STILL MOUNTAIN;So;0;ON;;;;;N;;;;; 4DF4;HEXAGRAM FOR DEVELOPMENT;So;0;ON;;;;;N;;;;; 4DF5;HEXAGRAM FOR THE MARRYING MAIDEN;So;0;ON;;;;;N;;;;; 4DF6;HEXAGRAM FOR ABUNDANCE;So;0;ON;;;;;N;;;;; 4DF7;HEXAGRAM FOR THE WANDERER;So;0;ON;;;;;N;;;;; 4DF8;HEXAGRAM FOR THE GENTLE WIND;So;0;ON;;;;;N;;;;; 4DF9;HEXAGRAM FOR THE JOYOUS LAKE;So;0;ON;;;;;N;;;;; 4DFA;HEXAGRAM FOR DISPERSION;So;0;ON;;;;;N;;;;; 4DFB;HEXAGRAM FOR LIMITATION;So;0;ON;;;;;N;;;;; 4DFC;HEXAGRAM FOR INNER TRUTH;So;0;ON;;;;;N;;;;; 4DFD;HEXAGRAM FOR SMALL PREPONDERANCE;So;0;ON;;;;;N;;;;; 4DFE;HEXAGRAM FOR AFTER COMPLETION;So;0;ON;;;;;N;;;;; 4DFF;HEXAGRAM FOR BEFORE COMPLETION;So;0;ON;;;;;N;;;;; 4E00;;Lo;0;L;;;;;N;;;;; 9FCC;;Lo;0;L;;;;;N;;;;; A000;YI SYLLABLE IT;Lo;0;L;;;;;N;;;;; A001;YI SYLLABLE IX;Lo;0;L;;;;;N;;;;; A002;YI SYLLABLE I;Lo;0;L;;;;;N;;;;; A003;YI SYLLABLE IP;Lo;0;L;;;;;N;;;;; A004;YI SYLLABLE IET;Lo;0;L;;;;;N;;;;; A005;YI SYLLABLE IEX;Lo;0;L;;;;;N;;;;; A006;YI SYLLABLE IE;Lo;0;L;;;;;N;;;;; A007;YI SYLLABLE IEP;Lo;0;L;;;;;N;;;;; A008;YI SYLLABLE AT;Lo;0;L;;;;;N;;;;; A009;YI SYLLABLE AX;Lo;0;L;;;;;N;;;;; A00A;YI SYLLABLE A;Lo;0;L;;;;;N;;;;; A00B;YI SYLLABLE AP;Lo;0;L;;;;;N;;;;; A00C;YI SYLLABLE UOX;Lo;0;L;;;;;N;;;;; A00D;YI SYLLABLE UO;Lo;0;L;;;;;N;;;;; A00E;YI SYLLABLE UOP;Lo;0;L;;;;;N;;;;; A00F;YI SYLLABLE OT;Lo;0;L;;;;;N;;;;; A010;YI SYLLABLE OX;Lo;0;L;;;;;N;;;;; A011;YI SYLLABLE O;Lo;0;L;;;;;N;;;;; A012;YI SYLLABLE OP;Lo;0;L;;;;;N;;;;; A013;YI SYLLABLE EX;Lo;0;L;;;;;N;;;;; A014;YI SYLLABLE E;Lo;0;L;;;;;N;;;;; A015;YI SYLLABLE WU;Lm;0;L;;;;;N;;;;; A016;YI SYLLABLE BIT;Lo;0;L;;;;;N;;;;; A017;YI SYLLABLE BIX;Lo;0;L;;;;;N;;;;; A018;YI SYLLABLE BI;Lo;0;L;;;;;N;;;;; A019;YI SYLLABLE BIP;Lo;0;L;;;;;N;;;;; A01A;YI SYLLABLE BIET;Lo;0;L;;;;;N;;;;; A01B;YI SYLLABLE BIEX;Lo;0;L;;;;;N;;;;; A01C;YI SYLLABLE BIE;Lo;0;L;;;;;N;;;;; A01D;YI SYLLABLE BIEP;Lo;0;L;;;;;N;;;;; A01E;YI SYLLABLE BAT;Lo;0;L;;;;;N;;;;; A01F;YI SYLLABLE BAX;Lo;0;L;;;;;N;;;;; A020;YI SYLLABLE BA;Lo;0;L;;;;;N;;;;; A021;YI SYLLABLE BAP;Lo;0;L;;;;;N;;;;; A022;YI SYLLABLE BUOX;Lo;0;L;;;;;N;;;;; A023;YI SYLLABLE BUO;Lo;0;L;;;;;N;;;;; A024;YI SYLLABLE BUOP;Lo;0;L;;;;;N;;;;; A025;YI SYLLABLE BOT;Lo;0;L;;;;;N;;;;; A026;YI SYLLABLE BOX;Lo;0;L;;;;;N;;;;; A027;YI SYLLABLE BO;Lo;0;L;;;;;N;;;;; A028;YI SYLLABLE BOP;Lo;0;L;;;;;N;;;;; A029;YI SYLLABLE BEX;Lo;0;L;;;;;N;;;;; A02A;YI SYLLABLE BE;Lo;0;L;;;;;N;;;;; A02B;YI SYLLABLE BEP;Lo;0;L;;;;;N;;;;; A02C;YI SYLLABLE BUT;Lo;0;L;;;;;N;;;;; A02D;YI SYLLABLE BUX;Lo;0;L;;;;;N;;;;; A02E;YI SYLLABLE BU;Lo;0;L;;;;;N;;;;; A02F;YI SYLLABLE BUP;Lo;0;L;;;;;N;;;;; A030;YI SYLLABLE BURX;Lo;0;L;;;;;N;;;;; A031;YI SYLLABLE BUR;Lo;0;L;;;;;N;;;;; A032;YI SYLLABLE BYT;Lo;0;L;;;;;N;;;;; A033;YI SYLLABLE BYX;Lo;0;L;;;;;N;;;;; A034;YI SYLLABLE BY;Lo;0;L;;;;;N;;;;; A035;YI SYLLABLE BYP;Lo;0;L;;;;;N;;;;; A036;YI SYLLABLE BYRX;Lo;0;L;;;;;N;;;;; A037;YI SYLLABLE BYR;Lo;0;L;;;;;N;;;;; A038;YI SYLLABLE PIT;Lo;0;L;;;;;N;;;;; A039;YI SYLLABLE PIX;Lo;0;L;;;;;N;;;;; A03A;YI SYLLABLE PI;Lo;0;L;;;;;N;;;;; A03B;YI SYLLABLE PIP;Lo;0;L;;;;;N;;;;; A03C;YI SYLLABLE PIEX;Lo;0;L;;;;;N;;;;; A03D;YI SYLLABLE PIE;Lo;0;L;;;;;N;;;;; A03E;YI SYLLABLE PIEP;Lo;0;L;;;;;N;;;;; A03F;YI SYLLABLE PAT;Lo;0;L;;;;;N;;;;; A040;YI SYLLABLE PAX;Lo;0;L;;;;;N;;;;; A041;YI SYLLABLE PA;Lo;0;L;;;;;N;;;;; A042;YI SYLLABLE PAP;Lo;0;L;;;;;N;;;;; A043;YI SYLLABLE PUOX;Lo;0;L;;;;;N;;;;; A044;YI SYLLABLE PUO;Lo;0;L;;;;;N;;;;; A045;YI SYLLABLE PUOP;Lo;0;L;;;;;N;;;;; A046;YI SYLLABLE POT;Lo;0;L;;;;;N;;;;; A047;YI SYLLABLE POX;Lo;0;L;;;;;N;;;;; A048;YI SYLLABLE PO;Lo;0;L;;;;;N;;;;; A049;YI SYLLABLE POP;Lo;0;L;;;;;N;;;;; A04A;YI SYLLABLE PUT;Lo;0;L;;;;;N;;;;; A04B;YI SYLLABLE PUX;Lo;0;L;;;;;N;;;;; A04C;YI SYLLABLE PU;Lo;0;L;;;;;N;;;;; A04D;YI SYLLABLE PUP;Lo;0;L;;;;;N;;;;; A04E;YI SYLLABLE PURX;Lo;0;L;;;;;N;;;;; A04F;YI SYLLABLE PUR;Lo;0;L;;;;;N;;;;; A050;YI SYLLABLE PYT;Lo;0;L;;;;;N;;;;; A051;YI SYLLABLE PYX;Lo;0;L;;;;;N;;;;; A052;YI SYLLABLE PY;Lo;0;L;;;;;N;;;;; A053;YI SYLLABLE PYP;Lo;0;L;;;;;N;;;;; A054;YI SYLLABLE PYRX;Lo;0;L;;;;;N;;;;; A055;YI SYLLABLE PYR;Lo;0;L;;;;;N;;;;; A056;YI SYLLABLE BBIT;Lo;0;L;;;;;N;;;;; A057;YI SYLLABLE BBIX;Lo;0;L;;;;;N;;;;; A058;YI SYLLABLE BBI;Lo;0;L;;;;;N;;;;; A059;YI SYLLABLE BBIP;Lo;0;L;;;;;N;;;;; A05A;YI SYLLABLE BBIET;Lo;0;L;;;;;N;;;;; A05B;YI SYLLABLE BBIEX;Lo;0;L;;;;;N;;;;; A05C;YI SYLLABLE BBIE;Lo;0;L;;;;;N;;;;; A05D;YI SYLLABLE BBIEP;Lo;0;L;;;;;N;;;;; A05E;YI SYLLABLE BBAT;Lo;0;L;;;;;N;;;;; A05F;YI SYLLABLE BBAX;Lo;0;L;;;;;N;;;;; A060;YI SYLLABLE BBA;Lo;0;L;;;;;N;;;;; A061;YI SYLLABLE BBAP;Lo;0;L;;;;;N;;;;; A062;YI SYLLABLE BBUOX;Lo;0;L;;;;;N;;;;; A063;YI SYLLABLE BBUO;Lo;0;L;;;;;N;;;;; A064;YI SYLLABLE BBUOP;Lo;0;L;;;;;N;;;;; A065;YI SYLLABLE BBOT;Lo;0;L;;;;;N;;;;; A066;YI SYLLABLE BBOX;Lo;0;L;;;;;N;;;;; A067;YI SYLLABLE BBO;Lo;0;L;;;;;N;;;;; A068;YI SYLLABLE BBOP;Lo;0;L;;;;;N;;;;; A069;YI SYLLABLE BBEX;Lo;0;L;;;;;N;;;;; A06A;YI SYLLABLE BBE;Lo;0;L;;;;;N;;;;; A06B;YI SYLLABLE BBEP;Lo;0;L;;;;;N;;;;; A06C;YI SYLLABLE BBUT;Lo;0;L;;;;;N;;;;; A06D;YI SYLLABLE BBUX;Lo;0;L;;;;;N;;;;; A06E;YI SYLLABLE BBU;Lo;0;L;;;;;N;;;;; A06F;YI SYLLABLE BBUP;Lo;0;L;;;;;N;;;;; A070;YI SYLLABLE BBURX;Lo;0;L;;;;;N;;;;; A071;YI SYLLABLE BBUR;Lo;0;L;;;;;N;;;;; A072;YI SYLLABLE BBYT;Lo;0;L;;;;;N;;;;; A073;YI SYLLABLE BBYX;Lo;0;L;;;;;N;;;;; A074;YI SYLLABLE BBY;Lo;0;L;;;;;N;;;;; A075;YI SYLLABLE BBYP;Lo;0;L;;;;;N;;;;; A076;YI SYLLABLE NBIT;Lo;0;L;;;;;N;;;;; A077;YI SYLLABLE NBIX;Lo;0;L;;;;;N;;;;; A078;YI SYLLABLE NBI;Lo;0;L;;;;;N;;;;; A079;YI SYLLABLE NBIP;Lo;0;L;;;;;N;;;;; A07A;YI SYLLABLE NBIEX;Lo;0;L;;;;;N;;;;; A07B;YI SYLLABLE NBIE;Lo;0;L;;;;;N;;;;; A07C;YI SYLLABLE NBIEP;Lo;0;L;;;;;N;;;;; A07D;YI SYLLABLE NBAT;Lo;0;L;;;;;N;;;;; A07E;YI SYLLABLE NBAX;Lo;0;L;;;;;N;;;;; A07F;YI SYLLABLE NBA;Lo;0;L;;;;;N;;;;; A080;YI SYLLABLE NBAP;Lo;0;L;;;;;N;;;;; A081;YI SYLLABLE NBOT;Lo;0;L;;;;;N;;;;; A082;YI SYLLABLE NBOX;Lo;0;L;;;;;N;;;;; A083;YI SYLLABLE NBO;Lo;0;L;;;;;N;;;;; A084;YI SYLLABLE NBOP;Lo;0;L;;;;;N;;;;; A085;YI SYLLABLE NBUT;Lo;0;L;;;;;N;;;;; A086;YI SYLLABLE NBUX;Lo;0;L;;;;;N;;;;; A087;YI SYLLABLE NBU;Lo;0;L;;;;;N;;;;; A088;YI SYLLABLE NBUP;Lo;0;L;;;;;N;;;;; A089;YI SYLLABLE NBURX;Lo;0;L;;;;;N;;;;; A08A;YI SYLLABLE NBUR;Lo;0;L;;;;;N;;;;; A08B;YI SYLLABLE NBYT;Lo;0;L;;;;;N;;;;; A08C;YI SYLLABLE NBYX;Lo;0;L;;;;;N;;;;; A08D;YI SYLLABLE NBY;Lo;0;L;;;;;N;;;;; A08E;YI SYLLABLE NBYP;Lo;0;L;;;;;N;;;;; A08F;YI SYLLABLE NBYRX;Lo;0;L;;;;;N;;;;; A090;YI SYLLABLE NBYR;Lo;0;L;;;;;N;;;;; A091;YI SYLLABLE HMIT;Lo;0;L;;;;;N;;;;; A092;YI SYLLABLE HMIX;Lo;0;L;;;;;N;;;;; A093;YI SYLLABLE HMI;Lo;0;L;;;;;N;;;;; A094;YI SYLLABLE HMIP;Lo;0;L;;;;;N;;;;; A095;YI SYLLABLE HMIEX;Lo;0;L;;;;;N;;;;; A096;YI SYLLABLE HMIE;Lo;0;L;;;;;N;;;;; A097;YI SYLLABLE HMIEP;Lo;0;L;;;;;N;;;;; A098;YI SYLLABLE HMAT;Lo;0;L;;;;;N;;;;; A099;YI SYLLABLE HMAX;Lo;0;L;;;;;N;;;;; A09A;YI SYLLABLE HMA;Lo;0;L;;;;;N;;;;; A09B;YI SYLLABLE HMAP;Lo;0;L;;;;;N;;;;; A09C;YI SYLLABLE HMUOX;Lo;0;L;;;;;N;;;;; A09D;YI SYLLABLE HMUO;Lo;0;L;;;;;N;;;;; A09E;YI SYLLABLE HMUOP;Lo;0;L;;;;;N;;;;; A09F;YI SYLLABLE HMOT;Lo;0;L;;;;;N;;;;; A0A0;YI SYLLABLE HMOX;Lo;0;L;;;;;N;;;;; A0A1;YI SYLLABLE HMO;Lo;0;L;;;;;N;;;;; A0A2;YI SYLLABLE HMOP;Lo;0;L;;;;;N;;;;; A0A3;YI SYLLABLE HMUT;Lo;0;L;;;;;N;;;;; A0A4;YI SYLLABLE HMUX;Lo;0;L;;;;;N;;;;; A0A5;YI SYLLABLE HMU;Lo;0;L;;;;;N;;;;; A0A6;YI SYLLABLE HMUP;Lo;0;L;;;;;N;;;;; A0A7;YI SYLLABLE HMURX;Lo;0;L;;;;;N;;;;; A0A8;YI SYLLABLE HMUR;Lo;0;L;;;;;N;;;;; A0A9;YI SYLLABLE HMYX;Lo;0;L;;;;;N;;;;; A0AA;YI SYLLABLE HMY;Lo;0;L;;;;;N;;;;; A0AB;YI SYLLABLE HMYP;Lo;0;L;;;;;N;;;;; A0AC;YI SYLLABLE HMYRX;Lo;0;L;;;;;N;;;;; A0AD;YI SYLLABLE HMYR;Lo;0;L;;;;;N;;;;; A0AE;YI SYLLABLE MIT;Lo;0;L;;;;;N;;;;; A0AF;YI SYLLABLE MIX;Lo;0;L;;;;;N;;;;; A0B0;YI SYLLABLE MI;Lo;0;L;;;;;N;;;;; A0B1;YI SYLLABLE MIP;Lo;0;L;;;;;N;;;;; A0B2;YI SYLLABLE MIEX;Lo;0;L;;;;;N;;;;; A0B3;YI SYLLABLE MIE;Lo;0;L;;;;;N;;;;; A0B4;YI SYLLABLE MIEP;Lo;0;L;;;;;N;;;;; A0B5;YI SYLLABLE MAT;Lo;0;L;;;;;N;;;;; A0B6;YI SYLLABLE MAX;Lo;0;L;;;;;N;;;;; A0B7;YI SYLLABLE MA;Lo;0;L;;;;;N;;;;; A0B8;YI SYLLABLE MAP;Lo;0;L;;;;;N;;;;; A0B9;YI SYLLABLE MUOT;Lo;0;L;;;;;N;;;;; A0BA;YI SYLLABLE MUOX;Lo;0;L;;;;;N;;;;; A0BB;YI SYLLABLE MUO;Lo;0;L;;;;;N;;;;; A0BC;YI SYLLABLE MUOP;Lo;0;L;;;;;N;;;;; A0BD;YI SYLLABLE MOT;Lo;0;L;;;;;N;;;;; A0BE;YI SYLLABLE MOX;Lo;0;L;;;;;N;;;;; A0BF;YI SYLLABLE MO;Lo;0;L;;;;;N;;;;; A0C0;YI SYLLABLE MOP;Lo;0;L;;;;;N;;;;; A0C1;YI SYLLABLE MEX;Lo;0;L;;;;;N;;;;; A0C2;YI SYLLABLE ME;Lo;0;L;;;;;N;;;;; A0C3;YI SYLLABLE MUT;Lo;0;L;;;;;N;;;;; A0C4;YI SYLLABLE MUX;Lo;0;L;;;;;N;;;;; A0C5;YI SYLLABLE MU;Lo;0;L;;;;;N;;;;; A0C6;YI SYLLABLE MUP;Lo;0;L;;;;;N;;;;; A0C7;YI SYLLABLE MURX;Lo;0;L;;;;;N;;;;; A0C8;YI SYLLABLE MUR;Lo;0;L;;;;;N;;;;; A0C9;YI SYLLABLE MYT;Lo;0;L;;;;;N;;;;; A0CA;YI SYLLABLE MYX;Lo;0;L;;;;;N;;;;; A0CB;YI SYLLABLE MY;Lo;0;L;;;;;N;;;;; A0CC;YI SYLLABLE MYP;Lo;0;L;;;;;N;;;;; A0CD;YI SYLLABLE FIT;Lo;0;L;;;;;N;;;;; A0CE;YI SYLLABLE FIX;Lo;0;L;;;;;N;;;;; A0CF;YI SYLLABLE FI;Lo;0;L;;;;;N;;;;; A0D0;YI SYLLABLE FIP;Lo;0;L;;;;;N;;;;; A0D1;YI SYLLABLE FAT;Lo;0;L;;;;;N;;;;; A0D2;YI SYLLABLE FAX;Lo;0;L;;;;;N;;;;; A0D3;YI SYLLABLE FA;Lo;0;L;;;;;N;;;;; A0D4;YI SYLLABLE FAP;Lo;0;L;;;;;N;;;;; A0D5;YI SYLLABLE FOX;Lo;0;L;;;;;N;;;;; A0D6;YI SYLLABLE FO;Lo;0;L;;;;;N;;;;; A0D7;YI SYLLABLE FOP;Lo;0;L;;;;;N;;;;; A0D8;YI SYLLABLE FUT;Lo;0;L;;;;;N;;;;; A0D9;YI SYLLABLE FUX;Lo;0;L;;;;;N;;;;; A0DA;YI SYLLABLE FU;Lo;0;L;;;;;N;;;;; A0DB;YI SYLLABLE FUP;Lo;0;L;;;;;N;;;;; A0DC;YI SYLLABLE FURX;Lo;0;L;;;;;N;;;;; A0DD;YI SYLLABLE FUR;Lo;0;L;;;;;N;;;;; A0DE;YI SYLLABLE FYT;Lo;0;L;;;;;N;;;;; A0DF;YI SYLLABLE FYX;Lo;0;L;;;;;N;;;;; A0E0;YI SYLLABLE FY;Lo;0;L;;;;;N;;;;; A0E1;YI SYLLABLE FYP;Lo;0;L;;;;;N;;;;; A0E2;YI SYLLABLE VIT;Lo;0;L;;;;;N;;;;; A0E3;YI SYLLABLE VIX;Lo;0;L;;;;;N;;;;; A0E4;YI SYLLABLE VI;Lo;0;L;;;;;N;;;;; A0E5;YI SYLLABLE VIP;Lo;0;L;;;;;N;;;;; A0E6;YI SYLLABLE VIET;Lo;0;L;;;;;N;;;;; A0E7;YI SYLLABLE VIEX;Lo;0;L;;;;;N;;;;; A0E8;YI SYLLABLE VIE;Lo;0;L;;;;;N;;;;; A0E9;YI SYLLABLE VIEP;Lo;0;L;;;;;N;;;;; A0EA;YI SYLLABLE VAT;Lo;0;L;;;;;N;;;;; A0EB;YI SYLLABLE VAX;Lo;0;L;;;;;N;;;;; A0EC;YI SYLLABLE VA;Lo;0;L;;;;;N;;;;; A0ED;YI SYLLABLE VAP;Lo;0;L;;;;;N;;;;; A0EE;YI SYLLABLE VOT;Lo;0;L;;;;;N;;;;; A0EF;YI SYLLABLE VOX;Lo;0;L;;;;;N;;;;; A0F0;YI SYLLABLE VO;Lo;0;L;;;;;N;;;;; A0F1;YI SYLLABLE VOP;Lo;0;L;;;;;N;;;;; A0F2;YI SYLLABLE VEX;Lo;0;L;;;;;N;;;;; A0F3;YI SYLLABLE VEP;Lo;0;L;;;;;N;;;;; A0F4;YI SYLLABLE VUT;Lo;0;L;;;;;N;;;;; A0F5;YI SYLLABLE VUX;Lo;0;L;;;;;N;;;;; A0F6;YI SYLLABLE VU;Lo;0;L;;;;;N;;;;; A0F7;YI SYLLABLE VUP;Lo;0;L;;;;;N;;;;; A0F8;YI SYLLABLE VURX;Lo;0;L;;;;;N;;;;; A0F9;YI SYLLABLE VUR;Lo;0;L;;;;;N;;;;; A0FA;YI SYLLABLE VYT;Lo;0;L;;;;;N;;;;; A0FB;YI SYLLABLE VYX;Lo;0;L;;;;;N;;;;; A0FC;YI SYLLABLE VY;Lo;0;L;;;;;N;;;;; A0FD;YI SYLLABLE VYP;Lo;0;L;;;;;N;;;;; A0FE;YI SYLLABLE VYRX;Lo;0;L;;;;;N;;;;; A0FF;YI SYLLABLE VYR;Lo;0;L;;;;;N;;;;; A100;YI SYLLABLE DIT;Lo;0;L;;;;;N;;;;; A101;YI SYLLABLE DIX;Lo;0;L;;;;;N;;;;; A102;YI SYLLABLE DI;Lo;0;L;;;;;N;;;;; A103;YI SYLLABLE DIP;Lo;0;L;;;;;N;;;;; A104;YI SYLLABLE DIEX;Lo;0;L;;;;;N;;;;; A105;YI SYLLABLE DIE;Lo;0;L;;;;;N;;;;; A106;YI SYLLABLE DIEP;Lo;0;L;;;;;N;;;;; A107;YI SYLLABLE DAT;Lo;0;L;;;;;N;;;;; A108;YI SYLLABLE DAX;Lo;0;L;;;;;N;;;;; A109;YI SYLLABLE DA;Lo;0;L;;;;;N;;;;; A10A;YI SYLLABLE DAP;Lo;0;L;;;;;N;;;;; A10B;YI SYLLABLE DUOX;Lo;0;L;;;;;N;;;;; A10C;YI SYLLABLE DUO;Lo;0;L;;;;;N;;;;; A10D;YI SYLLABLE DOT;Lo;0;L;;;;;N;;;;; A10E;YI SYLLABLE DOX;Lo;0;L;;;;;N;;;;; A10F;YI SYLLABLE DO;Lo;0;L;;;;;N;;;;; A110;YI SYLLABLE DOP;Lo;0;L;;;;;N;;;;; A111;YI SYLLABLE DEX;Lo;0;L;;;;;N;;;;; A112;YI SYLLABLE DE;Lo;0;L;;;;;N;;;;; A113;YI SYLLABLE DEP;Lo;0;L;;;;;N;;;;; A114;YI SYLLABLE DUT;Lo;0;L;;;;;N;;;;; A115;YI SYLLABLE DUX;Lo;0;L;;;;;N;;;;; A116;YI SYLLABLE DU;Lo;0;L;;;;;N;;;;; A117;YI SYLLABLE DUP;Lo;0;L;;;;;N;;;;; A118;YI SYLLABLE DURX;Lo;0;L;;;;;N;;;;; A119;YI SYLLABLE DUR;Lo;0;L;;;;;N;;;;; A11A;YI SYLLABLE TIT;Lo;0;L;;;;;N;;;;; A11B;YI SYLLABLE TIX;Lo;0;L;;;;;N;;;;; A11C;YI SYLLABLE TI;Lo;0;L;;;;;N;;;;; A11D;YI SYLLABLE TIP;Lo;0;L;;;;;N;;;;; A11E;YI SYLLABLE TIEX;Lo;0;L;;;;;N;;;;; A11F;YI SYLLABLE TIE;Lo;0;L;;;;;N;;;;; A120;YI SYLLABLE TIEP;Lo;0;L;;;;;N;;;;; A121;YI SYLLABLE TAT;Lo;0;L;;;;;N;;;;; A122;YI SYLLABLE TAX;Lo;0;L;;;;;N;;;;; A123;YI SYLLABLE TA;Lo;0;L;;;;;N;;;;; A124;YI SYLLABLE TAP;Lo;0;L;;;;;N;;;;; A125;YI SYLLABLE TUOT;Lo;0;L;;;;;N;;;;; A126;YI SYLLABLE TUOX;Lo;0;L;;;;;N;;;;; A127;YI SYLLABLE TUO;Lo;0;L;;;;;N;;;;; A128;YI SYLLABLE TUOP;Lo;0;L;;;;;N;;;;; A129;YI SYLLABLE TOT;Lo;0;L;;;;;N;;;;; A12A;YI SYLLABLE TOX;Lo;0;L;;;;;N;;;;; A12B;YI SYLLABLE TO;Lo;0;L;;;;;N;;;;; A12C;YI SYLLABLE TOP;Lo;0;L;;;;;N;;;;; A12D;YI SYLLABLE TEX;Lo;0;L;;;;;N;;;;; A12E;YI SYLLABLE TE;Lo;0;L;;;;;N;;;;; A12F;YI SYLLABLE TEP;Lo;0;L;;;;;N;;;;; A130;YI SYLLABLE TUT;Lo;0;L;;;;;N;;;;; A131;YI SYLLABLE TUX;Lo;0;L;;;;;N;;;;; A132;YI SYLLABLE TU;Lo;0;L;;;;;N;;;;; A133;YI SYLLABLE TUP;Lo;0;L;;;;;N;;;;; A134;YI SYLLABLE TURX;Lo;0;L;;;;;N;;;;; A135;YI SYLLABLE TUR;Lo;0;L;;;;;N;;;;; A136;YI SYLLABLE DDIT;Lo;0;L;;;;;N;;;;; A137;YI SYLLABLE DDIX;Lo;0;L;;;;;N;;;;; A138;YI SYLLABLE DDI;Lo;0;L;;;;;N;;;;; A139;YI SYLLABLE DDIP;Lo;0;L;;;;;N;;;;; A13A;YI SYLLABLE DDIEX;Lo;0;L;;;;;N;;;;; A13B;YI SYLLABLE DDIE;Lo;0;L;;;;;N;;;;; A13C;YI SYLLABLE DDIEP;Lo;0;L;;;;;N;;;;; A13D;YI SYLLABLE DDAT;Lo;0;L;;;;;N;;;;; A13E;YI SYLLABLE DDAX;Lo;0;L;;;;;N;;;;; A13F;YI SYLLABLE DDA;Lo;0;L;;;;;N;;;;; A140;YI SYLLABLE DDAP;Lo;0;L;;;;;N;;;;; A141;YI SYLLABLE DDUOX;Lo;0;L;;;;;N;;;;; A142;YI SYLLABLE DDUO;Lo;0;L;;;;;N;;;;; A143;YI SYLLABLE DDUOP;Lo;0;L;;;;;N;;;;; A144;YI SYLLABLE DDOT;Lo;0;L;;;;;N;;;;; A145;YI SYLLABLE DDOX;Lo;0;L;;;;;N;;;;; A146;YI SYLLABLE DDO;Lo;0;L;;;;;N;;;;; A147;YI SYLLABLE DDOP;Lo;0;L;;;;;N;;;;; A148;YI SYLLABLE DDEX;Lo;0;L;;;;;N;;;;; A149;YI SYLLABLE DDE;Lo;0;L;;;;;N;;;;; A14A;YI SYLLABLE DDEP;Lo;0;L;;;;;N;;;;; A14B;YI SYLLABLE DDUT;Lo;0;L;;;;;N;;;;; A14C;YI SYLLABLE DDUX;Lo;0;L;;;;;N;;;;; A14D;YI SYLLABLE DDU;Lo;0;L;;;;;N;;;;; A14E;YI SYLLABLE DDUP;Lo;0;L;;;;;N;;;;; A14F;YI SYLLABLE DDURX;Lo;0;L;;;;;N;;;;; A150;YI SYLLABLE DDUR;Lo;0;L;;;;;N;;;;; A151;YI SYLLABLE NDIT;Lo;0;L;;;;;N;;;;; A152;YI SYLLABLE NDIX;Lo;0;L;;;;;N;;;;; A153;YI SYLLABLE NDI;Lo;0;L;;;;;N;;;;; A154;YI SYLLABLE NDIP;Lo;0;L;;;;;N;;;;; A155;YI SYLLABLE NDIEX;Lo;0;L;;;;;N;;;;; A156;YI SYLLABLE NDIE;Lo;0;L;;;;;N;;;;; A157;YI SYLLABLE NDAT;Lo;0;L;;;;;N;;;;; A158;YI SYLLABLE NDAX;Lo;0;L;;;;;N;;;;; A159;YI SYLLABLE NDA;Lo;0;L;;;;;N;;;;; A15A;YI SYLLABLE NDAP;Lo;0;L;;;;;N;;;;; A15B;YI SYLLABLE NDOT;Lo;0;L;;;;;N;;;;; A15C;YI SYLLABLE NDOX;Lo;0;L;;;;;N;;;;; A15D;YI SYLLABLE NDO;Lo;0;L;;;;;N;;;;; A15E;YI SYLLABLE NDOP;Lo;0;L;;;;;N;;;;; A15F;YI SYLLABLE NDEX;Lo;0;L;;;;;N;;;;; A160;YI SYLLABLE NDE;Lo;0;L;;;;;N;;;;; A161;YI SYLLABLE NDEP;Lo;0;L;;;;;N;;;;; A162;YI SYLLABLE NDUT;Lo;0;L;;;;;N;;;;; A163;YI SYLLABLE NDUX;Lo;0;L;;;;;N;;;;; A164;YI SYLLABLE NDU;Lo;0;L;;;;;N;;;;; A165;YI SYLLABLE NDUP;Lo;0;L;;;;;N;;;;; A166;YI SYLLABLE NDURX;Lo;0;L;;;;;N;;;;; A167;YI SYLLABLE NDUR;Lo;0;L;;;;;N;;;;; A168;YI SYLLABLE HNIT;Lo;0;L;;;;;N;;;;; A169;YI SYLLABLE HNIX;Lo;0;L;;;;;N;;;;; A16A;YI SYLLABLE HNI;Lo;0;L;;;;;N;;;;; A16B;YI SYLLABLE HNIP;Lo;0;L;;;;;N;;;;; A16C;YI SYLLABLE HNIET;Lo;0;L;;;;;N;;;;; A16D;YI SYLLABLE HNIEX;Lo;0;L;;;;;N;;;;; A16E;YI SYLLABLE HNIE;Lo;0;L;;;;;N;;;;; A16F;YI SYLLABLE HNIEP;Lo;0;L;;;;;N;;;;; A170;YI SYLLABLE HNAT;Lo;0;L;;;;;N;;;;; A171;YI SYLLABLE HNAX;Lo;0;L;;;;;N;;;;; A172;YI SYLLABLE HNA;Lo;0;L;;;;;N;;;;; A173;YI SYLLABLE HNAP;Lo;0;L;;;;;N;;;;; A174;YI SYLLABLE HNUOX;Lo;0;L;;;;;N;;;;; A175;YI SYLLABLE HNUO;Lo;0;L;;;;;N;;;;; A176;YI SYLLABLE HNOT;Lo;0;L;;;;;N;;;;; A177;YI SYLLABLE HNOX;Lo;0;L;;;;;N;;;;; A178;YI SYLLABLE HNOP;Lo;0;L;;;;;N;;;;; A179;YI SYLLABLE HNEX;Lo;0;L;;;;;N;;;;; A17A;YI SYLLABLE HNE;Lo;0;L;;;;;N;;;;; A17B;YI SYLLABLE HNEP;Lo;0;L;;;;;N;;;;; A17C;YI SYLLABLE HNUT;Lo;0;L;;;;;N;;;;; A17D;YI SYLLABLE NIT;Lo;0;L;;;;;N;;;;; A17E;YI SYLLABLE NIX;Lo;0;L;;;;;N;;;;; A17F;YI SYLLABLE NI;Lo;0;L;;;;;N;;;;; A180;YI SYLLABLE NIP;Lo;0;L;;;;;N;;;;; A181;YI SYLLABLE NIEX;Lo;0;L;;;;;N;;;;; A182;YI SYLLABLE NIE;Lo;0;L;;;;;N;;;;; A183;YI SYLLABLE NIEP;Lo;0;L;;;;;N;;;;; A184;YI SYLLABLE NAX;Lo;0;L;;;;;N;;;;; A185;YI SYLLABLE NA;Lo;0;L;;;;;N;;;;; A186;YI SYLLABLE NAP;Lo;0;L;;;;;N;;;;; A187;YI SYLLABLE NUOX;Lo;0;L;;;;;N;;;;; A188;YI SYLLABLE NUO;Lo;0;L;;;;;N;;;;; A189;YI SYLLABLE NUOP;Lo;0;L;;;;;N;;;;; A18A;YI SYLLABLE NOT;Lo;0;L;;;;;N;;;;; A18B;YI SYLLABLE NOX;Lo;0;L;;;;;N;;;;; A18C;YI SYLLABLE NO;Lo;0;L;;;;;N;;;;; A18D;YI SYLLABLE NOP;Lo;0;L;;;;;N;;;;; A18E;YI SYLLABLE NEX;Lo;0;L;;;;;N;;;;; A18F;YI SYLLABLE NE;Lo;0;L;;;;;N;;;;; A190;YI SYLLABLE NEP;Lo;0;L;;;;;N;;;;; A191;YI SYLLABLE NUT;Lo;0;L;;;;;N;;;;; A192;YI SYLLABLE NUX;Lo;0;L;;;;;N;;;;; A193;YI SYLLABLE NU;Lo;0;L;;;;;N;;;;; A194;YI SYLLABLE NUP;Lo;0;L;;;;;N;;;;; A195;YI SYLLABLE NURX;Lo;0;L;;;;;N;;;;; A196;YI SYLLABLE NUR;Lo;0;L;;;;;N;;;;; A197;YI SYLLABLE HLIT;Lo;0;L;;;;;N;;;;; A198;YI SYLLABLE HLIX;Lo;0;L;;;;;N;;;;; A199;YI SYLLABLE HLI;Lo;0;L;;;;;N;;;;; A19A;YI SYLLABLE HLIP;Lo;0;L;;;;;N;;;;; A19B;YI SYLLABLE HLIEX;Lo;0;L;;;;;N;;;;; A19C;YI SYLLABLE HLIE;Lo;0;L;;;;;N;;;;; A19D;YI SYLLABLE HLIEP;Lo;0;L;;;;;N;;;;; A19E;YI SYLLABLE HLAT;Lo;0;L;;;;;N;;;;; A19F;YI SYLLABLE HLAX;Lo;0;L;;;;;N;;;;; A1A0;YI SYLLABLE HLA;Lo;0;L;;;;;N;;;;; A1A1;YI SYLLABLE HLAP;Lo;0;L;;;;;N;;;;; A1A2;YI SYLLABLE HLUOX;Lo;0;L;;;;;N;;;;; A1A3;YI SYLLABLE HLUO;Lo;0;L;;;;;N;;;;; A1A4;YI SYLLABLE HLUOP;Lo;0;L;;;;;N;;;;; A1A5;YI SYLLABLE HLOX;Lo;0;L;;;;;N;;;;; A1A6;YI SYLLABLE HLO;Lo;0;L;;;;;N;;;;; A1A7;YI SYLLABLE HLOP;Lo;0;L;;;;;N;;;;; A1A8;YI SYLLABLE HLEX;Lo;0;L;;;;;N;;;;; A1A9;YI SYLLABLE HLE;Lo;0;L;;;;;N;;;;; A1AA;YI SYLLABLE HLEP;Lo;0;L;;;;;N;;;;; A1AB;YI SYLLABLE HLUT;Lo;0;L;;;;;N;;;;; A1AC;YI SYLLABLE HLUX;Lo;0;L;;;;;N;;;;; A1AD;YI SYLLABLE HLU;Lo;0;L;;;;;N;;;;; A1AE;YI SYLLABLE HLUP;Lo;0;L;;;;;N;;;;; A1AF;YI SYLLABLE HLURX;Lo;0;L;;;;;N;;;;; A1B0;YI SYLLABLE HLUR;Lo;0;L;;;;;N;;;;; A1B1;YI SYLLABLE HLYT;Lo;0;L;;;;;N;;;;; A1B2;YI SYLLABLE HLYX;Lo;0;L;;;;;N;;;;; A1B3;YI SYLLABLE HLY;Lo;0;L;;;;;N;;;;; A1B4;YI SYLLABLE HLYP;Lo;0;L;;;;;N;;;;; A1B5;YI SYLLABLE HLYRX;Lo;0;L;;;;;N;;;;; A1B6;YI SYLLABLE HLYR;Lo;0;L;;;;;N;;;;; A1B7;YI SYLLABLE LIT;Lo;0;L;;;;;N;;;;; A1B8;YI SYLLABLE LIX;Lo;0;L;;;;;N;;;;; A1B9;YI SYLLABLE LI;Lo;0;L;;;;;N;;;;; A1BA;YI SYLLABLE LIP;Lo;0;L;;;;;N;;;;; A1BB;YI SYLLABLE LIET;Lo;0;L;;;;;N;;;;; A1BC;YI SYLLABLE LIEX;Lo;0;L;;;;;N;;;;; A1BD;YI SYLLABLE LIE;Lo;0;L;;;;;N;;;;; A1BE;YI SYLLABLE LIEP;Lo;0;L;;;;;N;;;;; A1BF;YI SYLLABLE LAT;Lo;0;L;;;;;N;;;;; A1C0;YI SYLLABLE LAX;Lo;0;L;;;;;N;;;;; A1C1;YI SYLLABLE LA;Lo;0;L;;;;;N;;;;; A1C2;YI SYLLABLE LAP;Lo;0;L;;;;;N;;;;; A1C3;YI SYLLABLE LUOT;Lo;0;L;;;;;N;;;;; A1C4;YI SYLLABLE LUOX;Lo;0;L;;;;;N;;;;; A1C5;YI SYLLABLE LUO;Lo;0;L;;;;;N;;;;; A1C6;YI SYLLABLE LUOP;Lo;0;L;;;;;N;;;;; A1C7;YI SYLLABLE LOT;Lo;0;L;;;;;N;;;;; A1C8;YI SYLLABLE LOX;Lo;0;L;;;;;N;;;;; A1C9;YI SYLLABLE LO;Lo;0;L;;;;;N;;;;; A1CA;YI SYLLABLE LOP;Lo;0;L;;;;;N;;;;; A1CB;YI SYLLABLE LEX;Lo;0;L;;;;;N;;;;; A1CC;YI SYLLABLE LE;Lo;0;L;;;;;N;;;;; A1CD;YI SYLLABLE LEP;Lo;0;L;;;;;N;;;;; A1CE;YI SYLLABLE LUT;Lo;0;L;;;;;N;;;;; A1CF;YI SYLLABLE LUX;Lo;0;L;;;;;N;;;;; A1D0;YI SYLLABLE LU;Lo;0;L;;;;;N;;;;; A1D1;YI SYLLABLE LUP;Lo;0;L;;;;;N;;;;; A1D2;YI SYLLABLE LURX;Lo;0;L;;;;;N;;;;; A1D3;YI SYLLABLE LUR;Lo;0;L;;;;;N;;;;; A1D4;YI SYLLABLE LYT;Lo;0;L;;;;;N;;;;; A1D5;YI SYLLABLE LYX;Lo;0;L;;;;;N;;;;; A1D6;YI SYLLABLE LY;Lo;0;L;;;;;N;;;;; A1D7;YI SYLLABLE LYP;Lo;0;L;;;;;N;;;;; A1D8;YI SYLLABLE LYRX;Lo;0;L;;;;;N;;;;; A1D9;YI SYLLABLE LYR;Lo;0;L;;;;;N;;;;; A1DA;YI SYLLABLE GIT;Lo;0;L;;;;;N;;;;; A1DB;YI SYLLABLE GIX;Lo;0;L;;;;;N;;;;; A1DC;YI SYLLABLE GI;Lo;0;L;;;;;N;;;;; A1DD;YI SYLLABLE GIP;Lo;0;L;;;;;N;;;;; A1DE;YI SYLLABLE GIET;Lo;0;L;;;;;N;;;;; A1DF;YI SYLLABLE GIEX;Lo;0;L;;;;;N;;;;; A1E0;YI SYLLABLE GIE;Lo;0;L;;;;;N;;;;; A1E1;YI SYLLABLE GIEP;Lo;0;L;;;;;N;;;;; A1E2;YI SYLLABLE GAT;Lo;0;L;;;;;N;;;;; A1E3;YI SYLLABLE GAX;Lo;0;L;;;;;N;;;;; A1E4;YI SYLLABLE GA;Lo;0;L;;;;;N;;;;; A1E5;YI SYLLABLE GAP;Lo;0;L;;;;;N;;;;; A1E6;YI SYLLABLE GUOT;Lo;0;L;;;;;N;;;;; A1E7;YI SYLLABLE GUOX;Lo;0;L;;;;;N;;;;; A1E8;YI SYLLABLE GUO;Lo;0;L;;;;;N;;;;; A1E9;YI SYLLABLE GUOP;Lo;0;L;;;;;N;;;;; A1EA;YI SYLLABLE GOT;Lo;0;L;;;;;N;;;;; A1EB;YI SYLLABLE GOX;Lo;0;L;;;;;N;;;;; A1EC;YI SYLLABLE GO;Lo;0;L;;;;;N;;;;; A1ED;YI SYLLABLE GOP;Lo;0;L;;;;;N;;;;; A1EE;YI SYLLABLE GET;Lo;0;L;;;;;N;;;;; A1EF;YI SYLLABLE GEX;Lo;0;L;;;;;N;;;;; A1F0;YI SYLLABLE GE;Lo;0;L;;;;;N;;;;; A1F1;YI SYLLABLE GEP;Lo;0;L;;;;;N;;;;; A1F2;YI SYLLABLE GUT;Lo;0;L;;;;;N;;;;; A1F3;YI SYLLABLE GUX;Lo;0;L;;;;;N;;;;; A1F4;YI SYLLABLE GU;Lo;0;L;;;;;N;;;;; A1F5;YI SYLLABLE GUP;Lo;0;L;;;;;N;;;;; A1F6;YI SYLLABLE GURX;Lo;0;L;;;;;N;;;;; A1F7;YI SYLLABLE GUR;Lo;0;L;;;;;N;;;;; A1F8;YI SYLLABLE KIT;Lo;0;L;;;;;N;;;;; A1F9;YI SYLLABLE KIX;Lo;0;L;;;;;N;;;;; A1FA;YI SYLLABLE KI;Lo;0;L;;;;;N;;;;; A1FB;YI SYLLABLE KIP;Lo;0;L;;;;;N;;;;; A1FC;YI SYLLABLE KIEX;Lo;0;L;;;;;N;;;;; A1FD;YI SYLLABLE KIE;Lo;0;L;;;;;N;;;;; A1FE;YI SYLLABLE KIEP;Lo;0;L;;;;;N;;;;; A1FF;YI SYLLABLE KAT;Lo;0;L;;;;;N;;;;; A200;YI SYLLABLE KAX;Lo;0;L;;;;;N;;;;; A201;YI SYLLABLE KA;Lo;0;L;;;;;N;;;;; A202;YI SYLLABLE KAP;Lo;0;L;;;;;N;;;;; A203;YI SYLLABLE KUOX;Lo;0;L;;;;;N;;;;; A204;YI SYLLABLE KUO;Lo;0;L;;;;;N;;;;; A205;YI SYLLABLE KUOP;Lo;0;L;;;;;N;;;;; A206;YI SYLLABLE KOT;Lo;0;L;;;;;N;;;;; A207;YI SYLLABLE KOX;Lo;0;L;;;;;N;;;;; A208;YI SYLLABLE KO;Lo;0;L;;;;;N;;;;; A209;YI SYLLABLE KOP;Lo;0;L;;;;;N;;;;; A20A;YI SYLLABLE KET;Lo;0;L;;;;;N;;;;; A20B;YI SYLLABLE KEX;Lo;0;L;;;;;N;;;;; A20C;YI SYLLABLE KE;Lo;0;L;;;;;N;;;;; A20D;YI SYLLABLE KEP;Lo;0;L;;;;;N;;;;; A20E;YI SYLLABLE KUT;Lo;0;L;;;;;N;;;;; A20F;YI SYLLABLE KUX;Lo;0;L;;;;;N;;;;; A210;YI SYLLABLE KU;Lo;0;L;;;;;N;;;;; A211;YI SYLLABLE KUP;Lo;0;L;;;;;N;;;;; A212;YI SYLLABLE KURX;Lo;0;L;;;;;N;;;;; A213;YI SYLLABLE KUR;Lo;0;L;;;;;N;;;;; A214;YI SYLLABLE GGIT;Lo;0;L;;;;;N;;;;; A215;YI SYLLABLE GGIX;Lo;0;L;;;;;N;;;;; A216;YI SYLLABLE GGI;Lo;0;L;;;;;N;;;;; A217;YI SYLLABLE GGIEX;Lo;0;L;;;;;N;;;;; A218;YI SYLLABLE GGIE;Lo;0;L;;;;;N;;;;; A219;YI SYLLABLE GGIEP;Lo;0;L;;;;;N;;;;; A21A;YI SYLLABLE GGAT;Lo;0;L;;;;;N;;;;; A21B;YI SYLLABLE GGAX;Lo;0;L;;;;;N;;;;; A21C;YI SYLLABLE GGA;Lo;0;L;;;;;N;;;;; A21D;YI SYLLABLE GGAP;Lo;0;L;;;;;N;;;;; A21E;YI SYLLABLE GGUOT;Lo;0;L;;;;;N;;;;; A21F;YI SYLLABLE GGUOX;Lo;0;L;;;;;N;;;;; A220;YI SYLLABLE GGUO;Lo;0;L;;;;;N;;;;; A221;YI SYLLABLE GGUOP;Lo;0;L;;;;;N;;;;; A222;YI SYLLABLE GGOT;Lo;0;L;;;;;N;;;;; A223;YI SYLLABLE GGOX;Lo;0;L;;;;;N;;;;; A224;YI SYLLABLE GGO;Lo;0;L;;;;;N;;;;; A225;YI SYLLABLE GGOP;Lo;0;L;;;;;N;;;;; A226;YI SYLLABLE GGET;Lo;0;L;;;;;N;;;;; A227;YI SYLLABLE GGEX;Lo;0;L;;;;;N;;;;; A228;YI SYLLABLE GGE;Lo;0;L;;;;;N;;;;; A229;YI SYLLABLE GGEP;Lo;0;L;;;;;N;;;;; A22A;YI SYLLABLE GGUT;Lo;0;L;;;;;N;;;;; A22B;YI SYLLABLE GGUX;Lo;0;L;;;;;N;;;;; A22C;YI SYLLABLE GGU;Lo;0;L;;;;;N;;;;; A22D;YI SYLLABLE GGUP;Lo;0;L;;;;;N;;;;; A22E;YI SYLLABLE GGURX;Lo;0;L;;;;;N;;;;; A22F;YI SYLLABLE GGUR;Lo;0;L;;;;;N;;;;; A230;YI SYLLABLE MGIEX;Lo;0;L;;;;;N;;;;; A231;YI SYLLABLE MGIE;Lo;0;L;;;;;N;;;;; A232;YI SYLLABLE MGAT;Lo;0;L;;;;;N;;;;; A233;YI SYLLABLE MGAX;Lo;0;L;;;;;N;;;;; A234;YI SYLLABLE MGA;Lo;0;L;;;;;N;;;;; A235;YI SYLLABLE MGAP;Lo;0;L;;;;;N;;;;; A236;YI SYLLABLE MGUOX;Lo;0;L;;;;;N;;;;; A237;YI SYLLABLE MGUO;Lo;0;L;;;;;N;;;;; A238;YI SYLLABLE MGUOP;Lo;0;L;;;;;N;;;;; A239;YI SYLLABLE MGOT;Lo;0;L;;;;;N;;;;; A23A;YI SYLLABLE MGOX;Lo;0;L;;;;;N;;;;; A23B;YI SYLLABLE MGO;Lo;0;L;;;;;N;;;;; A23C;YI SYLLABLE MGOP;Lo;0;L;;;;;N;;;;; A23D;YI SYLLABLE MGEX;Lo;0;L;;;;;N;;;;; A23E;YI SYLLABLE MGE;Lo;0;L;;;;;N;;;;; A23F;YI SYLLABLE MGEP;Lo;0;L;;;;;N;;;;; A240;YI SYLLABLE MGUT;Lo;0;L;;;;;N;;;;; A241;YI SYLLABLE MGUX;Lo;0;L;;;;;N;;;;; A242;YI SYLLABLE MGU;Lo;0;L;;;;;N;;;;; A243;YI SYLLABLE MGUP;Lo;0;L;;;;;N;;;;; A244;YI SYLLABLE MGURX;Lo;0;L;;;;;N;;;;; A245;YI SYLLABLE MGUR;Lo;0;L;;;;;N;;;;; A246;YI SYLLABLE HXIT;Lo;0;L;;;;;N;;;;; A247;YI SYLLABLE HXIX;Lo;0;L;;;;;N;;;;; A248;YI SYLLABLE HXI;Lo;0;L;;;;;N;;;;; A249;YI SYLLABLE HXIP;Lo;0;L;;;;;N;;;;; A24A;YI SYLLABLE HXIET;Lo;0;L;;;;;N;;;;; A24B;YI SYLLABLE HXIEX;Lo;0;L;;;;;N;;;;; A24C;YI SYLLABLE HXIE;Lo;0;L;;;;;N;;;;; A24D;YI SYLLABLE HXIEP;Lo;0;L;;;;;N;;;;; A24E;YI SYLLABLE HXAT;Lo;0;L;;;;;N;;;;; A24F;YI SYLLABLE HXAX;Lo;0;L;;;;;N;;;;; A250;YI SYLLABLE HXA;Lo;0;L;;;;;N;;;;; A251;YI SYLLABLE HXAP;Lo;0;L;;;;;N;;;;; A252;YI SYLLABLE HXUOT;Lo;0;L;;;;;N;;;;; A253;YI SYLLABLE HXUOX;Lo;0;L;;;;;N;;;;; A254;YI SYLLABLE HXUO;Lo;0;L;;;;;N;;;;; A255;YI SYLLABLE HXUOP;Lo;0;L;;;;;N;;;;; A256;YI SYLLABLE HXOT;Lo;0;L;;;;;N;;;;; A257;YI SYLLABLE HXOX;Lo;0;L;;;;;N;;;;; A258;YI SYLLABLE HXO;Lo;0;L;;;;;N;;;;; A259;YI SYLLABLE HXOP;Lo;0;L;;;;;N;;;;; A25A;YI SYLLABLE HXEX;Lo;0;L;;;;;N;;;;; A25B;YI SYLLABLE HXE;Lo;0;L;;;;;N;;;;; A25C;YI SYLLABLE HXEP;Lo;0;L;;;;;N;;;;; A25D;YI SYLLABLE NGIEX;Lo;0;L;;;;;N;;;;; A25E;YI SYLLABLE NGIE;Lo;0;L;;;;;N;;;;; A25F;YI SYLLABLE NGIEP;Lo;0;L;;;;;N;;;;; A260;YI SYLLABLE NGAT;Lo;0;L;;;;;N;;;;; A261;YI SYLLABLE NGAX;Lo;0;L;;;;;N;;;;; A262;YI SYLLABLE NGA;Lo;0;L;;;;;N;;;;; A263;YI SYLLABLE NGAP;Lo;0;L;;;;;N;;;;; A264;YI SYLLABLE NGUOT;Lo;0;L;;;;;N;;;;; A265;YI SYLLABLE NGUOX;Lo;0;L;;;;;N;;;;; A266;YI SYLLABLE NGUO;Lo;0;L;;;;;N;;;;; A267;YI SYLLABLE NGOT;Lo;0;L;;;;;N;;;;; A268;YI SYLLABLE NGOX;Lo;0;L;;;;;N;;;;; A269;YI SYLLABLE NGO;Lo;0;L;;;;;N;;;;; A26A;YI SYLLABLE NGOP;Lo;0;L;;;;;N;;;;; A26B;YI SYLLABLE NGEX;Lo;0;L;;;;;N;;;;; A26C;YI SYLLABLE NGE;Lo;0;L;;;;;N;;;;; A26D;YI SYLLABLE NGEP;Lo;0;L;;;;;N;;;;; A26E;YI SYLLABLE HIT;Lo;0;L;;;;;N;;;;; A26F;YI SYLLABLE HIEX;Lo;0;L;;;;;N;;;;; A270;YI SYLLABLE HIE;Lo;0;L;;;;;N;;;;; A271;YI SYLLABLE HAT;Lo;0;L;;;;;N;;;;; A272;YI SYLLABLE HAX;Lo;0;L;;;;;N;;;;; A273;YI SYLLABLE HA;Lo;0;L;;;;;N;;;;; A274;YI SYLLABLE HAP;Lo;0;L;;;;;N;;;;; A275;YI SYLLABLE HUOT;Lo;0;L;;;;;N;;;;; A276;YI SYLLABLE HUOX;Lo;0;L;;;;;N;;;;; A277;YI SYLLABLE HUO;Lo;0;L;;;;;N;;;;; A278;YI SYLLABLE HUOP;Lo;0;L;;;;;N;;;;; A279;YI SYLLABLE HOT;Lo;0;L;;;;;N;;;;; A27A;YI SYLLABLE HOX;Lo;0;L;;;;;N;;;;; A27B;YI SYLLABLE HO;Lo;0;L;;;;;N;;;;; A27C;YI SYLLABLE HOP;Lo;0;L;;;;;N;;;;; A27D;YI SYLLABLE HEX;Lo;0;L;;;;;N;;;;; A27E;YI SYLLABLE HE;Lo;0;L;;;;;N;;;;; A27F;YI SYLLABLE HEP;Lo;0;L;;;;;N;;;;; A280;YI SYLLABLE WAT;Lo;0;L;;;;;N;;;;; A281;YI SYLLABLE WAX;Lo;0;L;;;;;N;;;;; A282;YI SYLLABLE WA;Lo;0;L;;;;;N;;;;; A283;YI SYLLABLE WAP;Lo;0;L;;;;;N;;;;; A284;YI SYLLABLE WUOX;Lo;0;L;;;;;N;;;;; A285;YI SYLLABLE WUO;Lo;0;L;;;;;N;;;;; A286;YI SYLLABLE WUOP;Lo;0;L;;;;;N;;;;; A287;YI SYLLABLE WOX;Lo;0;L;;;;;N;;;;; A288;YI SYLLABLE WO;Lo;0;L;;;;;N;;;;; A289;YI SYLLABLE WOP;Lo;0;L;;;;;N;;;;; A28A;YI SYLLABLE WEX;Lo;0;L;;;;;N;;;;; A28B;YI SYLLABLE WE;Lo;0;L;;;;;N;;;;; A28C;YI SYLLABLE WEP;Lo;0;L;;;;;N;;;;; A28D;YI SYLLABLE ZIT;Lo;0;L;;;;;N;;;;; A28E;YI SYLLABLE ZIX;Lo;0;L;;;;;N;;;;; A28F;YI SYLLABLE ZI;Lo;0;L;;;;;N;;;;; A290;YI SYLLABLE ZIP;Lo;0;L;;;;;N;;;;; A291;YI SYLLABLE ZIEX;Lo;0;L;;;;;N;;;;; A292;YI SYLLABLE ZIE;Lo;0;L;;;;;N;;;;; A293;YI SYLLABLE ZIEP;Lo;0;L;;;;;N;;;;; A294;YI SYLLABLE ZAT;Lo;0;L;;;;;N;;;;; A295;YI SYLLABLE ZAX;Lo;0;L;;;;;N;;;;; A296;YI SYLLABLE ZA;Lo;0;L;;;;;N;;;;; A297;YI SYLLABLE ZAP;Lo;0;L;;;;;N;;;;; A298;YI SYLLABLE ZUOX;Lo;0;L;;;;;N;;;;; A299;YI SYLLABLE ZUO;Lo;0;L;;;;;N;;;;; A29A;YI SYLLABLE ZUOP;Lo;0;L;;;;;N;;;;; A29B;YI SYLLABLE ZOT;Lo;0;L;;;;;N;;;;; A29C;YI SYLLABLE ZOX;Lo;0;L;;;;;N;;;;; A29D;YI SYLLABLE ZO;Lo;0;L;;;;;N;;;;; A29E;YI SYLLABLE ZOP;Lo;0;L;;;;;N;;;;; A29F;YI SYLLABLE ZEX;Lo;0;L;;;;;N;;;;; A2A0;YI SYLLABLE ZE;Lo;0;L;;;;;N;;;;; A2A1;YI SYLLABLE ZEP;Lo;0;L;;;;;N;;;;; A2A2;YI SYLLABLE ZUT;Lo;0;L;;;;;N;;;;; A2A3;YI SYLLABLE ZUX;Lo;0;L;;;;;N;;;;; A2A4;YI SYLLABLE ZU;Lo;0;L;;;;;N;;;;; A2A5;YI SYLLABLE ZUP;Lo;0;L;;;;;N;;;;; A2A6;YI SYLLABLE ZURX;Lo;0;L;;;;;N;;;;; A2A7;YI SYLLABLE ZUR;Lo;0;L;;;;;N;;;;; A2A8;YI SYLLABLE ZYT;Lo;0;L;;;;;N;;;;; A2A9;YI SYLLABLE ZYX;Lo;0;L;;;;;N;;;;; A2AA;YI SYLLABLE ZY;Lo;0;L;;;;;N;;;;; A2AB;YI SYLLABLE ZYP;Lo;0;L;;;;;N;;;;; A2AC;YI SYLLABLE ZYRX;Lo;0;L;;;;;N;;;;; A2AD;YI SYLLABLE ZYR;Lo;0;L;;;;;N;;;;; A2AE;YI SYLLABLE CIT;Lo;0;L;;;;;N;;;;; A2AF;YI SYLLABLE CIX;Lo;0;L;;;;;N;;;;; A2B0;YI SYLLABLE CI;Lo;0;L;;;;;N;;;;; A2B1;YI SYLLABLE CIP;Lo;0;L;;;;;N;;;;; A2B2;YI SYLLABLE CIET;Lo;0;L;;;;;N;;;;; A2B3;YI SYLLABLE CIEX;Lo;0;L;;;;;N;;;;; A2B4;YI SYLLABLE CIE;Lo;0;L;;;;;N;;;;; A2B5;YI SYLLABLE CIEP;Lo;0;L;;;;;N;;;;; A2B6;YI SYLLABLE CAT;Lo;0;L;;;;;N;;;;; A2B7;YI SYLLABLE CAX;Lo;0;L;;;;;N;;;;; A2B8;YI SYLLABLE CA;Lo;0;L;;;;;N;;;;; A2B9;YI SYLLABLE CAP;Lo;0;L;;;;;N;;;;; A2BA;YI SYLLABLE CUOX;Lo;0;L;;;;;N;;;;; A2BB;YI SYLLABLE CUO;Lo;0;L;;;;;N;;;;; A2BC;YI SYLLABLE CUOP;Lo;0;L;;;;;N;;;;; A2BD;YI SYLLABLE COT;Lo;0;L;;;;;N;;;;; A2BE;YI SYLLABLE COX;Lo;0;L;;;;;N;;;;; A2BF;YI SYLLABLE CO;Lo;0;L;;;;;N;;;;; A2C0;YI SYLLABLE COP;Lo;0;L;;;;;N;;;;; A2C1;YI SYLLABLE CEX;Lo;0;L;;;;;N;;;;; A2C2;YI SYLLABLE CE;Lo;0;L;;;;;N;;;;; A2C3;YI SYLLABLE CEP;Lo;0;L;;;;;N;;;;; A2C4;YI SYLLABLE CUT;Lo;0;L;;;;;N;;;;; A2C5;YI SYLLABLE CUX;Lo;0;L;;;;;N;;;;; A2C6;YI SYLLABLE CU;Lo;0;L;;;;;N;;;;; A2C7;YI SYLLABLE CUP;Lo;0;L;;;;;N;;;;; A2C8;YI SYLLABLE CURX;Lo;0;L;;;;;N;;;;; A2C9;YI SYLLABLE CUR;Lo;0;L;;;;;N;;;;; A2CA;YI SYLLABLE CYT;Lo;0;L;;;;;N;;;;; A2CB;YI SYLLABLE CYX;Lo;0;L;;;;;N;;;;; A2CC;YI SYLLABLE CY;Lo;0;L;;;;;N;;;;; A2CD;YI SYLLABLE CYP;Lo;0;L;;;;;N;;;;; A2CE;YI SYLLABLE CYRX;Lo;0;L;;;;;N;;;;; A2CF;YI SYLLABLE CYR;Lo;0;L;;;;;N;;;;; A2D0;YI SYLLABLE ZZIT;Lo;0;L;;;;;N;;;;; A2D1;YI SYLLABLE ZZIX;Lo;0;L;;;;;N;;;;; A2D2;YI SYLLABLE ZZI;Lo;0;L;;;;;N;;;;; A2D3;YI SYLLABLE ZZIP;Lo;0;L;;;;;N;;;;; A2D4;YI SYLLABLE ZZIET;Lo;0;L;;;;;N;;;;; A2D5;YI SYLLABLE ZZIEX;Lo;0;L;;;;;N;;;;; A2D6;YI SYLLABLE ZZIE;Lo;0;L;;;;;N;;;;; A2D7;YI SYLLABLE ZZIEP;Lo;0;L;;;;;N;;;;; A2D8;YI SYLLABLE ZZAT;Lo;0;L;;;;;N;;;;; A2D9;YI SYLLABLE ZZAX;Lo;0;L;;;;;N;;;;; A2DA;YI SYLLABLE ZZA;Lo;0;L;;;;;N;;;;; A2DB;YI SYLLABLE ZZAP;Lo;0;L;;;;;N;;;;; A2DC;YI SYLLABLE ZZOX;Lo;0;L;;;;;N;;;;; A2DD;YI SYLLABLE ZZO;Lo;0;L;;;;;N;;;;; A2DE;YI SYLLABLE ZZOP;Lo;0;L;;;;;N;;;;; A2DF;YI SYLLABLE ZZEX;Lo;0;L;;;;;N;;;;; A2E0;YI SYLLABLE ZZE;Lo;0;L;;;;;N;;;;; A2E1;YI SYLLABLE ZZEP;Lo;0;L;;;;;N;;;;; A2E2;YI SYLLABLE ZZUX;Lo;0;L;;;;;N;;;;; A2E3;YI SYLLABLE ZZU;Lo;0;L;;;;;N;;;;; A2E4;YI SYLLABLE ZZUP;Lo;0;L;;;;;N;;;;; A2E5;YI SYLLABLE ZZURX;Lo;0;L;;;;;N;;;;; A2E6;YI SYLLABLE ZZUR;Lo;0;L;;;;;N;;;;; A2E7;YI SYLLABLE ZZYT;Lo;0;L;;;;;N;;;;; A2E8;YI SYLLABLE ZZYX;Lo;0;L;;;;;N;;;;; A2E9;YI SYLLABLE ZZY;Lo;0;L;;;;;N;;;;; A2EA;YI SYLLABLE ZZYP;Lo;0;L;;;;;N;;;;; A2EB;YI SYLLABLE ZZYRX;Lo;0;L;;;;;N;;;;; A2EC;YI SYLLABLE ZZYR;Lo;0;L;;;;;N;;;;; A2ED;YI SYLLABLE NZIT;Lo;0;L;;;;;N;;;;; A2EE;YI SYLLABLE NZIX;Lo;0;L;;;;;N;;;;; A2EF;YI SYLLABLE NZI;Lo;0;L;;;;;N;;;;; A2F0;YI SYLLABLE NZIP;Lo;0;L;;;;;N;;;;; A2F1;YI SYLLABLE NZIEX;Lo;0;L;;;;;N;;;;; A2F2;YI SYLLABLE NZIE;Lo;0;L;;;;;N;;;;; A2F3;YI SYLLABLE NZIEP;Lo;0;L;;;;;N;;;;; A2F4;YI SYLLABLE NZAT;Lo;0;L;;;;;N;;;;; A2F5;YI SYLLABLE NZAX;Lo;0;L;;;;;N;;;;; A2F6;YI SYLLABLE NZA;Lo;0;L;;;;;N;;;;; A2F7;YI SYLLABLE NZAP;Lo;0;L;;;;;N;;;;; A2F8;YI SYLLABLE NZUOX;Lo;0;L;;;;;N;;;;; A2F9;YI SYLLABLE NZUO;Lo;0;L;;;;;N;;;;; A2FA;YI SYLLABLE NZOX;Lo;0;L;;;;;N;;;;; A2FB;YI SYLLABLE NZOP;Lo;0;L;;;;;N;;;;; A2FC;YI SYLLABLE NZEX;Lo;0;L;;;;;N;;;;; A2FD;YI SYLLABLE NZE;Lo;0;L;;;;;N;;;;; A2FE;YI SYLLABLE NZUX;Lo;0;L;;;;;N;;;;; A2FF;YI SYLLABLE NZU;Lo;0;L;;;;;N;;;;; A300;YI SYLLABLE NZUP;Lo;0;L;;;;;N;;;;; A301;YI SYLLABLE NZURX;Lo;0;L;;;;;N;;;;; A302;YI SYLLABLE NZUR;Lo;0;L;;;;;N;;;;; A303;YI SYLLABLE NZYT;Lo;0;L;;;;;N;;;;; A304;YI SYLLABLE NZYX;Lo;0;L;;;;;N;;;;; A305;YI SYLLABLE NZY;Lo;0;L;;;;;N;;;;; A306;YI SYLLABLE NZYP;Lo;0;L;;;;;N;;;;; A307;YI SYLLABLE NZYRX;Lo;0;L;;;;;N;;;;; A308;YI SYLLABLE NZYR;Lo;0;L;;;;;N;;;;; A309;YI SYLLABLE SIT;Lo;0;L;;;;;N;;;;; A30A;YI SYLLABLE SIX;Lo;0;L;;;;;N;;;;; A30B;YI SYLLABLE SI;Lo;0;L;;;;;N;;;;; A30C;YI SYLLABLE SIP;Lo;0;L;;;;;N;;;;; A30D;YI SYLLABLE SIEX;Lo;0;L;;;;;N;;;;; A30E;YI SYLLABLE SIE;Lo;0;L;;;;;N;;;;; A30F;YI SYLLABLE SIEP;Lo;0;L;;;;;N;;;;; A310;YI SYLLABLE SAT;Lo;0;L;;;;;N;;;;; A311;YI SYLLABLE SAX;Lo;0;L;;;;;N;;;;; A312;YI SYLLABLE SA;Lo;0;L;;;;;N;;;;; A313;YI SYLLABLE SAP;Lo;0;L;;;;;N;;;;; A314;YI SYLLABLE SUOX;Lo;0;L;;;;;N;;;;; A315;YI SYLLABLE SUO;Lo;0;L;;;;;N;;;;; A316;YI SYLLABLE SUOP;Lo;0;L;;;;;N;;;;; A317;YI SYLLABLE SOT;Lo;0;L;;;;;N;;;;; A318;YI SYLLABLE SOX;Lo;0;L;;;;;N;;;;; A319;YI SYLLABLE SO;Lo;0;L;;;;;N;;;;; A31A;YI SYLLABLE SOP;Lo;0;L;;;;;N;;;;; A31B;YI SYLLABLE SEX;Lo;0;L;;;;;N;;;;; A31C;YI SYLLABLE SE;Lo;0;L;;;;;N;;;;; A31D;YI SYLLABLE SEP;Lo;0;L;;;;;N;;;;; A31E;YI SYLLABLE SUT;Lo;0;L;;;;;N;;;;; A31F;YI SYLLABLE SUX;Lo;0;L;;;;;N;;;;; A320;YI SYLLABLE SU;Lo;0;L;;;;;N;;;;; A321;YI SYLLABLE SUP;Lo;0;L;;;;;N;;;;; A322;YI SYLLABLE SURX;Lo;0;L;;;;;N;;;;; A323;YI SYLLABLE SUR;Lo;0;L;;;;;N;;;;; A324;YI SYLLABLE SYT;Lo;0;L;;;;;N;;;;; A325;YI SYLLABLE SYX;Lo;0;L;;;;;N;;;;; A326;YI SYLLABLE SY;Lo;0;L;;;;;N;;;;; A327;YI SYLLABLE SYP;Lo;0;L;;;;;N;;;;; A328;YI SYLLABLE SYRX;Lo;0;L;;;;;N;;;;; A329;YI SYLLABLE SYR;Lo;0;L;;;;;N;;;;; A32A;YI SYLLABLE SSIT;Lo;0;L;;;;;N;;;;; A32B;YI SYLLABLE SSIX;Lo;0;L;;;;;N;;;;; A32C;YI SYLLABLE SSI;Lo;0;L;;;;;N;;;;; A32D;YI SYLLABLE SSIP;Lo;0;L;;;;;N;;;;; A32E;YI SYLLABLE SSIEX;Lo;0;L;;;;;N;;;;; A32F;YI SYLLABLE SSIE;Lo;0;L;;;;;N;;;;; A330;YI SYLLABLE SSIEP;Lo;0;L;;;;;N;;;;; A331;YI SYLLABLE SSAT;Lo;0;L;;;;;N;;;;; A332;YI SYLLABLE SSAX;Lo;0;L;;;;;N;;;;; A333;YI SYLLABLE SSA;Lo;0;L;;;;;N;;;;; A334;YI SYLLABLE SSAP;Lo;0;L;;;;;N;;;;; A335;YI SYLLABLE SSOT;Lo;0;L;;;;;N;;;;; A336;YI SYLLABLE SSOX;Lo;0;L;;;;;N;;;;; A337;YI SYLLABLE SSO;Lo;0;L;;;;;N;;;;; A338;YI SYLLABLE SSOP;Lo;0;L;;;;;N;;;;; A339;YI SYLLABLE SSEX;Lo;0;L;;;;;N;;;;; A33A;YI SYLLABLE SSE;Lo;0;L;;;;;N;;;;; A33B;YI SYLLABLE SSEP;Lo;0;L;;;;;N;;;;; A33C;YI SYLLABLE SSUT;Lo;0;L;;;;;N;;;;; A33D;YI SYLLABLE SSUX;Lo;0;L;;;;;N;;;;; A33E;YI SYLLABLE SSU;Lo;0;L;;;;;N;;;;; A33F;YI SYLLABLE SSUP;Lo;0;L;;;;;N;;;;; A340;YI SYLLABLE SSYT;Lo;0;L;;;;;N;;;;; A341;YI SYLLABLE SSYX;Lo;0;L;;;;;N;;;;; A342;YI SYLLABLE SSY;Lo;0;L;;;;;N;;;;; A343;YI SYLLABLE SSYP;Lo;0;L;;;;;N;;;;; A344;YI SYLLABLE SSYRX;Lo;0;L;;;;;N;;;;; A345;YI SYLLABLE SSYR;Lo;0;L;;;;;N;;;;; A346;YI SYLLABLE ZHAT;Lo;0;L;;;;;N;;;;; A347;YI SYLLABLE ZHAX;Lo;0;L;;;;;N;;;;; A348;YI SYLLABLE ZHA;Lo;0;L;;;;;N;;;;; A349;YI SYLLABLE ZHAP;Lo;0;L;;;;;N;;;;; A34A;YI SYLLABLE ZHUOX;Lo;0;L;;;;;N;;;;; A34B;YI SYLLABLE ZHUO;Lo;0;L;;;;;N;;;;; A34C;YI SYLLABLE ZHUOP;Lo;0;L;;;;;N;;;;; A34D;YI SYLLABLE ZHOT;Lo;0;L;;;;;N;;;;; A34E;YI SYLLABLE ZHOX;Lo;0;L;;;;;N;;;;; A34F;YI SYLLABLE ZHO;Lo;0;L;;;;;N;;;;; A350;YI SYLLABLE ZHOP;Lo;0;L;;;;;N;;;;; A351;YI SYLLABLE ZHET;Lo;0;L;;;;;N;;;;; A352;YI SYLLABLE ZHEX;Lo;0;L;;;;;N;;;;; A353;YI SYLLABLE ZHE;Lo;0;L;;;;;N;;;;; A354;YI SYLLABLE ZHEP;Lo;0;L;;;;;N;;;;; A355;YI SYLLABLE ZHUT;Lo;0;L;;;;;N;;;;; A356;YI SYLLABLE ZHUX;Lo;0;L;;;;;N;;;;; A357;YI SYLLABLE ZHU;Lo;0;L;;;;;N;;;;; A358;YI SYLLABLE ZHUP;Lo;0;L;;;;;N;;;;; A359;YI SYLLABLE ZHURX;Lo;0;L;;;;;N;;;;; A35A;YI SYLLABLE ZHUR;Lo;0;L;;;;;N;;;;; A35B;YI SYLLABLE ZHYT;Lo;0;L;;;;;N;;;;; A35C;YI SYLLABLE ZHYX;Lo;0;L;;;;;N;;;;; A35D;YI SYLLABLE ZHY;Lo;0;L;;;;;N;;;;; A35E;YI SYLLABLE ZHYP;Lo;0;L;;;;;N;;;;; A35F;YI SYLLABLE ZHYRX;Lo;0;L;;;;;N;;;;; A360;YI SYLLABLE ZHYR;Lo;0;L;;;;;N;;;;; A361;YI SYLLABLE CHAT;Lo;0;L;;;;;N;;;;; A362;YI SYLLABLE CHAX;Lo;0;L;;;;;N;;;;; A363;YI SYLLABLE CHA;Lo;0;L;;;;;N;;;;; A364;YI SYLLABLE CHAP;Lo;0;L;;;;;N;;;;; A365;YI SYLLABLE CHUOT;Lo;0;L;;;;;N;;;;; A366;YI SYLLABLE CHUOX;Lo;0;L;;;;;N;;;;; A367;YI SYLLABLE CHUO;Lo;0;L;;;;;N;;;;; A368;YI SYLLABLE CHUOP;Lo;0;L;;;;;N;;;;; A369;YI SYLLABLE CHOT;Lo;0;L;;;;;N;;;;; A36A;YI SYLLABLE CHOX;Lo;0;L;;;;;N;;;;; A36B;YI SYLLABLE CHO;Lo;0;L;;;;;N;;;;; A36C;YI SYLLABLE CHOP;Lo;0;L;;;;;N;;;;; A36D;YI SYLLABLE CHET;Lo;0;L;;;;;N;;;;; A36E;YI SYLLABLE CHEX;Lo;0;L;;;;;N;;;;; A36F;YI SYLLABLE CHE;Lo;0;L;;;;;N;;;;; A370;YI SYLLABLE CHEP;Lo;0;L;;;;;N;;;;; A371;YI SYLLABLE CHUX;Lo;0;L;;;;;N;;;;; A372;YI SYLLABLE CHU;Lo;0;L;;;;;N;;;;; A373;YI SYLLABLE CHUP;Lo;0;L;;;;;N;;;;; A374;YI SYLLABLE CHURX;Lo;0;L;;;;;N;;;;; A375;YI SYLLABLE CHUR;Lo;0;L;;;;;N;;;;; A376;YI SYLLABLE CHYT;Lo;0;L;;;;;N;;;;; A377;YI SYLLABLE CHYX;Lo;0;L;;;;;N;;;;; A378;YI SYLLABLE CHY;Lo;0;L;;;;;N;;;;; A379;YI SYLLABLE CHYP;Lo;0;L;;;;;N;;;;; A37A;YI SYLLABLE CHYRX;Lo;0;L;;;;;N;;;;; A37B;YI SYLLABLE CHYR;Lo;0;L;;;;;N;;;;; A37C;YI SYLLABLE RRAX;Lo;0;L;;;;;N;;;;; A37D;YI SYLLABLE RRA;Lo;0;L;;;;;N;;;;; A37E;YI SYLLABLE RRUOX;Lo;0;L;;;;;N;;;;; A37F;YI SYLLABLE RRUO;Lo;0;L;;;;;N;;;;; A380;YI SYLLABLE RROT;Lo;0;L;;;;;N;;;;; A381;YI SYLLABLE RROX;Lo;0;L;;;;;N;;;;; A382;YI SYLLABLE RRO;Lo;0;L;;;;;N;;;;; A383;YI SYLLABLE RROP;Lo;0;L;;;;;N;;;;; A384;YI SYLLABLE RRET;Lo;0;L;;;;;N;;;;; A385;YI SYLLABLE RREX;Lo;0;L;;;;;N;;;;; A386;YI SYLLABLE RRE;Lo;0;L;;;;;N;;;;; A387;YI SYLLABLE RREP;Lo;0;L;;;;;N;;;;; A388;YI SYLLABLE RRUT;Lo;0;L;;;;;N;;;;; A389;YI SYLLABLE RRUX;Lo;0;L;;;;;N;;;;; A38A;YI SYLLABLE RRU;Lo;0;L;;;;;N;;;;; A38B;YI SYLLABLE RRUP;Lo;0;L;;;;;N;;;;; A38C;YI SYLLABLE RRURX;Lo;0;L;;;;;N;;;;; A38D;YI SYLLABLE RRUR;Lo;0;L;;;;;N;;;;; A38E;YI SYLLABLE RRYT;Lo;0;L;;;;;N;;;;; A38F;YI SYLLABLE RRYX;Lo;0;L;;;;;N;;;;; A390;YI SYLLABLE RRY;Lo;0;L;;;;;N;;;;; A391;YI SYLLABLE RRYP;Lo;0;L;;;;;N;;;;; A392;YI SYLLABLE RRYRX;Lo;0;L;;;;;N;;;;; A393;YI SYLLABLE RRYR;Lo;0;L;;;;;N;;;;; A394;YI SYLLABLE NRAT;Lo;0;L;;;;;N;;;;; A395;YI SYLLABLE NRAX;Lo;0;L;;;;;N;;;;; A396;YI SYLLABLE NRA;Lo;0;L;;;;;N;;;;; A397;YI SYLLABLE NRAP;Lo;0;L;;;;;N;;;;; A398;YI SYLLABLE NROX;Lo;0;L;;;;;N;;;;; A399;YI SYLLABLE NRO;Lo;0;L;;;;;N;;;;; A39A;YI SYLLABLE NROP;Lo;0;L;;;;;N;;;;; A39B;YI SYLLABLE NRET;Lo;0;L;;;;;N;;;;; A39C;YI SYLLABLE NREX;Lo;0;L;;;;;N;;;;; A39D;YI SYLLABLE NRE;Lo;0;L;;;;;N;;;;; A39E;YI SYLLABLE NREP;Lo;0;L;;;;;N;;;;; A39F;YI SYLLABLE NRUT;Lo;0;L;;;;;N;;;;; A3A0;YI SYLLABLE NRUX;Lo;0;L;;;;;N;;;;; A3A1;YI SYLLABLE NRU;Lo;0;L;;;;;N;;;;; A3A2;YI SYLLABLE NRUP;Lo;0;L;;;;;N;;;;; A3A3;YI SYLLABLE NRURX;Lo;0;L;;;;;N;;;;; A3A4;YI SYLLABLE NRUR;Lo;0;L;;;;;N;;;;; A3A5;YI SYLLABLE NRYT;Lo;0;L;;;;;N;;;;; A3A6;YI SYLLABLE NRYX;Lo;0;L;;;;;N;;;;; A3A7;YI SYLLABLE NRY;Lo;0;L;;;;;N;;;;; A3A8;YI SYLLABLE NRYP;Lo;0;L;;;;;N;;;;; A3A9;YI SYLLABLE NRYRX;Lo;0;L;;;;;N;;;;; A3AA;YI SYLLABLE NRYR;Lo;0;L;;;;;N;;;;; A3AB;YI SYLLABLE SHAT;Lo;0;L;;;;;N;;;;; A3AC;YI SYLLABLE SHAX;Lo;0;L;;;;;N;;;;; A3AD;YI SYLLABLE SHA;Lo;0;L;;;;;N;;;;; A3AE;YI SYLLABLE SHAP;Lo;0;L;;;;;N;;;;; A3AF;YI SYLLABLE SHUOX;Lo;0;L;;;;;N;;;;; A3B0;YI SYLLABLE SHUO;Lo;0;L;;;;;N;;;;; A3B1;YI SYLLABLE SHUOP;Lo;0;L;;;;;N;;;;; A3B2;YI SYLLABLE SHOT;Lo;0;L;;;;;N;;;;; A3B3;YI SYLLABLE SHOX;Lo;0;L;;;;;N;;;;; A3B4;YI SYLLABLE SHO;Lo;0;L;;;;;N;;;;; A3B5;YI SYLLABLE SHOP;Lo;0;L;;;;;N;;;;; A3B6;YI SYLLABLE SHET;Lo;0;L;;;;;N;;;;; A3B7;YI SYLLABLE SHEX;Lo;0;L;;;;;N;;;;; A3B8;YI SYLLABLE SHE;Lo;0;L;;;;;N;;;;; A3B9;YI SYLLABLE SHEP;Lo;0;L;;;;;N;;;;; A3BA;YI SYLLABLE SHUT;Lo;0;L;;;;;N;;;;; A3BB;YI SYLLABLE SHUX;Lo;0;L;;;;;N;;;;; A3BC;YI SYLLABLE SHU;Lo;0;L;;;;;N;;;;; A3BD;YI SYLLABLE SHUP;Lo;0;L;;;;;N;;;;; A3BE;YI SYLLABLE SHURX;Lo;0;L;;;;;N;;;;; A3BF;YI SYLLABLE SHUR;Lo;0;L;;;;;N;;;;; A3C0;YI SYLLABLE SHYT;Lo;0;L;;;;;N;;;;; A3C1;YI SYLLABLE SHYX;Lo;0;L;;;;;N;;;;; A3C2;YI SYLLABLE SHY;Lo;0;L;;;;;N;;;;; A3C3;YI SYLLABLE SHYP;Lo;0;L;;;;;N;;;;; A3C4;YI SYLLABLE SHYRX;Lo;0;L;;;;;N;;;;; A3C5;YI SYLLABLE SHYR;Lo;0;L;;;;;N;;;;; A3C6;YI SYLLABLE RAT;Lo;0;L;;;;;N;;;;; A3C7;YI SYLLABLE RAX;Lo;0;L;;;;;N;;;;; A3C8;YI SYLLABLE RA;Lo;0;L;;;;;N;;;;; A3C9;YI SYLLABLE RAP;Lo;0;L;;;;;N;;;;; A3CA;YI SYLLABLE RUOX;Lo;0;L;;;;;N;;;;; A3CB;YI SYLLABLE RUO;Lo;0;L;;;;;N;;;;; A3CC;YI SYLLABLE RUOP;Lo;0;L;;;;;N;;;;; A3CD;YI SYLLABLE ROT;Lo;0;L;;;;;N;;;;; A3CE;YI SYLLABLE ROX;Lo;0;L;;;;;N;;;;; A3CF;YI SYLLABLE RO;Lo;0;L;;;;;N;;;;; A3D0;YI SYLLABLE ROP;Lo;0;L;;;;;N;;;;; A3D1;YI SYLLABLE REX;Lo;0;L;;;;;N;;;;; A3D2;YI SYLLABLE RE;Lo;0;L;;;;;N;;;;; A3D3;YI SYLLABLE REP;Lo;0;L;;;;;N;;;;; A3D4;YI SYLLABLE RUT;Lo;0;L;;;;;N;;;;; A3D5;YI SYLLABLE RUX;Lo;0;L;;;;;N;;;;; A3D6;YI SYLLABLE RU;Lo;0;L;;;;;N;;;;; A3D7;YI SYLLABLE RUP;Lo;0;L;;;;;N;;;;; A3D8;YI SYLLABLE RURX;Lo;0;L;;;;;N;;;;; A3D9;YI SYLLABLE RUR;Lo;0;L;;;;;N;;;;; A3DA;YI SYLLABLE RYT;Lo;0;L;;;;;N;;;;; A3DB;YI SYLLABLE RYX;Lo;0;L;;;;;N;;;;; A3DC;YI SYLLABLE RY;Lo;0;L;;;;;N;;;;; A3DD;YI SYLLABLE RYP;Lo;0;L;;;;;N;;;;; A3DE;YI SYLLABLE RYRX;Lo;0;L;;;;;N;;;;; A3DF;YI SYLLABLE RYR;Lo;0;L;;;;;N;;;;; A3E0;YI SYLLABLE JIT;Lo;0;L;;;;;N;;;;; A3E1;YI SYLLABLE JIX;Lo;0;L;;;;;N;;;;; A3E2;YI SYLLABLE JI;Lo;0;L;;;;;N;;;;; A3E3;YI SYLLABLE JIP;Lo;0;L;;;;;N;;;;; A3E4;YI SYLLABLE JIET;Lo;0;L;;;;;N;;;;; A3E5;YI SYLLABLE JIEX;Lo;0;L;;;;;N;;;;; A3E6;YI SYLLABLE JIE;Lo;0;L;;;;;N;;;;; A3E7;YI SYLLABLE JIEP;Lo;0;L;;;;;N;;;;; A3E8;YI SYLLABLE JUOT;Lo;0;L;;;;;N;;;;; A3E9;YI SYLLABLE JUOX;Lo;0;L;;;;;N;;;;; A3EA;YI SYLLABLE JUO;Lo;0;L;;;;;N;;;;; A3EB;YI SYLLABLE JUOP;Lo;0;L;;;;;N;;;;; A3EC;YI SYLLABLE JOT;Lo;0;L;;;;;N;;;;; A3ED;YI SYLLABLE JOX;Lo;0;L;;;;;N;;;;; A3EE;YI SYLLABLE JO;Lo;0;L;;;;;N;;;;; A3EF;YI SYLLABLE JOP;Lo;0;L;;;;;N;;;;; A3F0;YI SYLLABLE JUT;Lo;0;L;;;;;N;;;;; A3F1;YI SYLLABLE JUX;Lo;0;L;;;;;N;;;;; A3F2;YI SYLLABLE JU;Lo;0;L;;;;;N;;;;; A3F3;YI SYLLABLE JUP;Lo;0;L;;;;;N;;;;; A3F4;YI SYLLABLE JURX;Lo;0;L;;;;;N;;;;; A3F5;YI SYLLABLE JUR;Lo;0;L;;;;;N;;;;; A3F6;YI SYLLABLE JYT;Lo;0;L;;;;;N;;;;; A3F7;YI SYLLABLE JYX;Lo;0;L;;;;;N;;;;; A3F8;YI SYLLABLE JY;Lo;0;L;;;;;N;;;;; A3F9;YI SYLLABLE JYP;Lo;0;L;;;;;N;;;;; A3FA;YI SYLLABLE JYRX;Lo;0;L;;;;;N;;;;; A3FB;YI SYLLABLE JYR;Lo;0;L;;;;;N;;;;; A3FC;YI SYLLABLE QIT;Lo;0;L;;;;;N;;;;; A3FD;YI SYLLABLE QIX;Lo;0;L;;;;;N;;;;; A3FE;YI SYLLABLE QI;Lo;0;L;;;;;N;;;;; A3FF;YI SYLLABLE QIP;Lo;0;L;;;;;N;;;;; A400;YI SYLLABLE QIET;Lo;0;L;;;;;N;;;;; A401;YI SYLLABLE QIEX;Lo;0;L;;;;;N;;;;; A402;YI SYLLABLE QIE;Lo;0;L;;;;;N;;;;; A403;YI SYLLABLE QIEP;Lo;0;L;;;;;N;;;;; A404;YI SYLLABLE QUOT;Lo;0;L;;;;;N;;;;; A405;YI SYLLABLE QUOX;Lo;0;L;;;;;N;;;;; A406;YI SYLLABLE QUO;Lo;0;L;;;;;N;;;;; A407;YI SYLLABLE QUOP;Lo;0;L;;;;;N;;;;; A408;YI SYLLABLE QOT;Lo;0;L;;;;;N;;;;; A409;YI SYLLABLE QOX;Lo;0;L;;;;;N;;;;; A40A;YI SYLLABLE QO;Lo;0;L;;;;;N;;;;; A40B;YI SYLLABLE QOP;Lo;0;L;;;;;N;;;;; A40C;YI SYLLABLE QUT;Lo;0;L;;;;;N;;;;; A40D;YI SYLLABLE QUX;Lo;0;L;;;;;N;;;;; A40E;YI SYLLABLE QU;Lo;0;L;;;;;N;;;;; A40F;YI SYLLABLE QUP;Lo;0;L;;;;;N;;;;; A410;YI SYLLABLE QURX;Lo;0;L;;;;;N;;;;; A411;YI SYLLABLE QUR;Lo;0;L;;;;;N;;;;; A412;YI SYLLABLE QYT;Lo;0;L;;;;;N;;;;; A413;YI SYLLABLE QYX;Lo;0;L;;;;;N;;;;; A414;YI SYLLABLE QY;Lo;0;L;;;;;N;;;;; A415;YI SYLLABLE QYP;Lo;0;L;;;;;N;;;;; A416;YI SYLLABLE QYRX;Lo;0;L;;;;;N;;;;; A417;YI SYLLABLE QYR;Lo;0;L;;;;;N;;;;; A418;YI SYLLABLE JJIT;Lo;0;L;;;;;N;;;;; A419;YI SYLLABLE JJIX;Lo;0;L;;;;;N;;;;; A41A;YI SYLLABLE JJI;Lo;0;L;;;;;N;;;;; A41B;YI SYLLABLE JJIP;Lo;0;L;;;;;N;;;;; A41C;YI SYLLABLE JJIET;Lo;0;L;;;;;N;;;;; A41D;YI SYLLABLE JJIEX;Lo;0;L;;;;;N;;;;; A41E;YI SYLLABLE JJIE;Lo;0;L;;;;;N;;;;; A41F;YI SYLLABLE JJIEP;Lo;0;L;;;;;N;;;;; A420;YI SYLLABLE JJUOX;Lo;0;L;;;;;N;;;;; A421;YI SYLLABLE JJUO;Lo;0;L;;;;;N;;;;; A422;YI SYLLABLE JJUOP;Lo;0;L;;;;;N;;;;; A423;YI SYLLABLE JJOT;Lo;0;L;;;;;N;;;;; A424;YI SYLLABLE JJOX;Lo;0;L;;;;;N;;;;; A425;YI SYLLABLE JJO;Lo;0;L;;;;;N;;;;; A426;YI SYLLABLE JJOP;Lo;0;L;;;;;N;;;;; A427;YI SYLLABLE JJUT;Lo;0;L;;;;;N;;;;; A428;YI SYLLABLE JJUX;Lo;0;L;;;;;N;;;;; A429;YI SYLLABLE JJU;Lo;0;L;;;;;N;;;;; A42A;YI SYLLABLE JJUP;Lo;0;L;;;;;N;;;;; A42B;YI SYLLABLE JJURX;Lo;0;L;;;;;N;;;;; A42C;YI SYLLABLE JJUR;Lo;0;L;;;;;N;;;;; A42D;YI SYLLABLE JJYT;Lo;0;L;;;;;N;;;;; A42E;YI SYLLABLE JJYX;Lo;0;L;;;;;N;;;;; A42F;YI SYLLABLE JJY;Lo;0;L;;;;;N;;;;; A430;YI SYLLABLE JJYP;Lo;0;L;;;;;N;;;;; A431;YI SYLLABLE NJIT;Lo;0;L;;;;;N;;;;; A432;YI SYLLABLE NJIX;Lo;0;L;;;;;N;;;;; A433;YI SYLLABLE NJI;Lo;0;L;;;;;N;;;;; A434;YI SYLLABLE NJIP;Lo;0;L;;;;;N;;;;; A435;YI SYLLABLE NJIET;Lo;0;L;;;;;N;;;;; A436;YI SYLLABLE NJIEX;Lo;0;L;;;;;N;;;;; A437;YI SYLLABLE NJIE;Lo;0;L;;;;;N;;;;; A438;YI SYLLABLE NJIEP;Lo;0;L;;;;;N;;;;; A439;YI SYLLABLE NJUOX;Lo;0;L;;;;;N;;;;; A43A;YI SYLLABLE NJUO;Lo;0;L;;;;;N;;;;; A43B;YI SYLLABLE NJOT;Lo;0;L;;;;;N;;;;; A43C;YI SYLLABLE NJOX;Lo;0;L;;;;;N;;;;; A43D;YI SYLLABLE NJO;Lo;0;L;;;;;N;;;;; A43E;YI SYLLABLE NJOP;Lo;0;L;;;;;N;;;;; A43F;YI SYLLABLE NJUX;Lo;0;L;;;;;N;;;;; A440;YI SYLLABLE NJU;Lo;0;L;;;;;N;;;;; A441;YI SYLLABLE NJUP;Lo;0;L;;;;;N;;;;; A442;YI SYLLABLE NJURX;Lo;0;L;;;;;N;;;;; A443;YI SYLLABLE NJUR;Lo;0;L;;;;;N;;;;; A444;YI SYLLABLE NJYT;Lo;0;L;;;;;N;;;;; A445;YI SYLLABLE NJYX;Lo;0;L;;;;;N;;;;; A446;YI SYLLABLE NJY;Lo;0;L;;;;;N;;;;; A447;YI SYLLABLE NJYP;Lo;0;L;;;;;N;;;;; A448;YI SYLLABLE NJYRX;Lo;0;L;;;;;N;;;;; A449;YI SYLLABLE NJYR;Lo;0;L;;;;;N;;;;; A44A;YI SYLLABLE NYIT;Lo;0;L;;;;;N;;;;; A44B;YI SYLLABLE NYIX;Lo;0;L;;;;;N;;;;; A44C;YI SYLLABLE NYI;Lo;0;L;;;;;N;;;;; A44D;YI SYLLABLE NYIP;Lo;0;L;;;;;N;;;;; A44E;YI SYLLABLE NYIET;Lo;0;L;;;;;N;;;;; A44F;YI SYLLABLE NYIEX;Lo;0;L;;;;;N;;;;; A450;YI SYLLABLE NYIE;Lo;0;L;;;;;N;;;;; A451;YI SYLLABLE NYIEP;Lo;0;L;;;;;N;;;;; A452;YI SYLLABLE NYUOX;Lo;0;L;;;;;N;;;;; A453;YI SYLLABLE NYUO;Lo;0;L;;;;;N;;;;; A454;YI SYLLABLE NYUOP;Lo;0;L;;;;;N;;;;; A455;YI SYLLABLE NYOT;Lo;0;L;;;;;N;;;;; A456;YI SYLLABLE NYOX;Lo;0;L;;;;;N;;;;; A457;YI SYLLABLE NYO;Lo;0;L;;;;;N;;;;; A458;YI SYLLABLE NYOP;Lo;0;L;;;;;N;;;;; A459;YI SYLLABLE NYUT;Lo;0;L;;;;;N;;;;; A45A;YI SYLLABLE NYUX;Lo;0;L;;;;;N;;;;; A45B;YI SYLLABLE NYU;Lo;0;L;;;;;N;;;;; A45C;YI SYLLABLE NYUP;Lo;0;L;;;;;N;;;;; A45D;YI SYLLABLE XIT;Lo;0;L;;;;;N;;;;; A45E;YI SYLLABLE XIX;Lo;0;L;;;;;N;;;;; A45F;YI SYLLABLE XI;Lo;0;L;;;;;N;;;;; A460;YI SYLLABLE XIP;Lo;0;L;;;;;N;;;;; A461;YI SYLLABLE XIET;Lo;0;L;;;;;N;;;;; A462;YI SYLLABLE XIEX;Lo;0;L;;;;;N;;;;; A463;YI SYLLABLE XIE;Lo;0;L;;;;;N;;;;; A464;YI SYLLABLE XIEP;Lo;0;L;;;;;N;;;;; A465;YI SYLLABLE XUOX;Lo;0;L;;;;;N;;;;; A466;YI SYLLABLE XUO;Lo;0;L;;;;;N;;;;; A467;YI SYLLABLE XOT;Lo;0;L;;;;;N;;;;; A468;YI SYLLABLE XOX;Lo;0;L;;;;;N;;;;; A469;YI SYLLABLE XO;Lo;0;L;;;;;N;;;;; A46A;YI SYLLABLE XOP;Lo;0;L;;;;;N;;;;; A46B;YI SYLLABLE XYT;Lo;0;L;;;;;N;;;;; A46C;YI SYLLABLE XYX;Lo;0;L;;;;;N;;;;; A46D;YI SYLLABLE XY;Lo;0;L;;;;;N;;;;; A46E;YI SYLLABLE XYP;Lo;0;L;;;;;N;;;;; A46F;YI SYLLABLE XYRX;Lo;0;L;;;;;N;;;;; A470;YI SYLLABLE XYR;Lo;0;L;;;;;N;;;;; A471;YI SYLLABLE YIT;Lo;0;L;;;;;N;;;;; A472;YI SYLLABLE YIX;Lo;0;L;;;;;N;;;;; A473;YI SYLLABLE YI;Lo;0;L;;;;;N;;;;; A474;YI SYLLABLE YIP;Lo;0;L;;;;;N;;;;; A475;YI SYLLABLE YIET;Lo;0;L;;;;;N;;;;; A476;YI SYLLABLE YIEX;Lo;0;L;;;;;N;;;;; A477;YI SYLLABLE YIE;Lo;0;L;;;;;N;;;;; A478;YI SYLLABLE YIEP;Lo;0;L;;;;;N;;;;; A479;YI SYLLABLE YUOT;Lo;0;L;;;;;N;;;;; A47A;YI SYLLABLE YUOX;Lo;0;L;;;;;N;;;;; A47B;YI SYLLABLE YUO;Lo;0;L;;;;;N;;;;; A47C;YI SYLLABLE YUOP;Lo;0;L;;;;;N;;;;; A47D;YI SYLLABLE YOT;Lo;0;L;;;;;N;;;;; A47E;YI SYLLABLE YOX;Lo;0;L;;;;;N;;;;; A47F;YI SYLLABLE YO;Lo;0;L;;;;;N;;;;; A480;YI SYLLABLE YOP;Lo;0;L;;;;;N;;;;; A481;YI SYLLABLE YUT;Lo;0;L;;;;;N;;;;; A482;YI SYLLABLE YUX;Lo;0;L;;;;;N;;;;; A483;YI SYLLABLE YU;Lo;0;L;;;;;N;;;;; A484;YI SYLLABLE YUP;Lo;0;L;;;;;N;;;;; A485;YI SYLLABLE YURX;Lo;0;L;;;;;N;;;;; A486;YI SYLLABLE YUR;Lo;0;L;;;;;N;;;;; A487;YI SYLLABLE YYT;Lo;0;L;;;;;N;;;;; A488;YI SYLLABLE YYX;Lo;0;L;;;;;N;;;;; A489;YI SYLLABLE YY;Lo;0;L;;;;;N;;;;; A48A;YI SYLLABLE YYP;Lo;0;L;;;;;N;;;;; A48B;YI SYLLABLE YYRX;Lo;0;L;;;;;N;;;;; A48C;YI SYLLABLE YYR;Lo;0;L;;;;;N;;;;; A490;YI RADICAL QOT;So;0;ON;;;;;N;;;;; A491;YI RADICAL LI;So;0;ON;;;;;N;;;;; A492;YI RADICAL KIT;So;0;ON;;;;;N;;;;; A493;YI RADICAL NYIP;So;0;ON;;;;;N;;;;; A494;YI RADICAL CYP;So;0;ON;;;;;N;;;;; A495;YI RADICAL SSI;So;0;ON;;;;;N;;;;; A496;YI RADICAL GGOP;So;0;ON;;;;;N;;;;; A497;YI RADICAL GEP;So;0;ON;;;;;N;;;;; A498;YI RADICAL MI;So;0;ON;;;;;N;;;;; A499;YI RADICAL HXIT;So;0;ON;;;;;N;;;;; A49A;YI RADICAL LYR;So;0;ON;;;;;N;;;;; A49B;YI RADICAL BBUT;So;0;ON;;;;;N;;;;; A49C;YI RADICAL MOP;So;0;ON;;;;;N;;;;; A49D;YI RADICAL YO;So;0;ON;;;;;N;;;;; A49E;YI RADICAL PUT;So;0;ON;;;;;N;;;;; A49F;YI RADICAL HXUO;So;0;ON;;;;;N;;;;; A4A0;YI RADICAL TAT;So;0;ON;;;;;N;;;;; A4A1;YI RADICAL GA;So;0;ON;;;;;N;;;;; A4A2;YI RADICAL ZUP;So;0;ON;;;;;N;;;;; A4A3;YI RADICAL CYT;So;0;ON;;;;;N;;;;; A4A4;YI RADICAL DDUR;So;0;ON;;;;;N;;;;; A4A5;YI RADICAL BUR;So;0;ON;;;;;N;;;;; A4A6;YI RADICAL GGUO;So;0;ON;;;;;N;;;;; A4A7;YI RADICAL NYOP;So;0;ON;;;;;N;;;;; A4A8;YI RADICAL TU;So;0;ON;;;;;N;;;;; A4A9;YI RADICAL OP;So;0;ON;;;;;N;;;;; A4AA;YI RADICAL JJUT;So;0;ON;;;;;N;;;;; A4AB;YI RADICAL ZOT;So;0;ON;;;;;N;;;;; A4AC;YI RADICAL PYT;So;0;ON;;;;;N;;;;; A4AD;YI RADICAL HMO;So;0;ON;;;;;N;;;;; A4AE;YI RADICAL YIT;So;0;ON;;;;;N;;;;; A4AF;YI RADICAL VUR;So;0;ON;;;;;N;;;;; A4B0;YI RADICAL SHY;So;0;ON;;;;;N;;;;; A4B1;YI RADICAL VEP;So;0;ON;;;;;N;;;;; A4B2;YI RADICAL ZA;So;0;ON;;;;;N;;;;; A4B3;YI RADICAL JO;So;0;ON;;;;;N;;;;; A4B4;YI RADICAL NZUP;So;0;ON;;;;;N;;;;; A4B5;YI RADICAL JJY;So;0;ON;;;;;N;;;;; A4B6;YI RADICAL GOT;So;0;ON;;;;;N;;;;; A4B7;YI RADICAL JJIE;So;0;ON;;;;;N;;;;; A4B8;YI RADICAL WO;So;0;ON;;;;;N;;;;; A4B9;YI RADICAL DU;So;0;ON;;;;;N;;;;; A4BA;YI RADICAL SHUR;So;0;ON;;;;;N;;;;; A4BB;YI RADICAL LIE;So;0;ON;;;;;N;;;;; A4BC;YI RADICAL CY;So;0;ON;;;;;N;;;;; A4BD;YI RADICAL CUOP;So;0;ON;;;;;N;;;;; A4BE;YI RADICAL CIP;So;0;ON;;;;;N;;;;; A4BF;YI RADICAL HXOP;So;0;ON;;;;;N;;;;; A4C0;YI RADICAL SHAT;So;0;ON;;;;;N;;;;; A4C1;YI RADICAL ZUR;So;0;ON;;;;;N;;;;; A4C2;YI RADICAL SHOP;So;0;ON;;;;;N;;;;; A4C3;YI RADICAL CHE;So;0;ON;;;;;N;;;;; A4C4;YI RADICAL ZZIET;So;0;ON;;;;;N;;;;; A4C5;YI RADICAL NBIE;So;0;ON;;;;;N;;;;; A4C6;YI RADICAL KE;So;0;ON;;;;;N;;;;; A4D0;LISU LETTER BA;Lo;0;L;;;;;N;;;;; A4D1;LISU LETTER PA;Lo;0;L;;;;;N;;;;; A4D2;LISU LETTER PHA;Lo;0;L;;;;;N;;;;; A4D3;LISU LETTER DA;Lo;0;L;;;;;N;;;;; A4D4;LISU LETTER TA;Lo;0;L;;;;;N;;;;; A4D5;LISU LETTER THA;Lo;0;L;;;;;N;;;;; A4D6;LISU LETTER GA;Lo;0;L;;;;;N;;;;; A4D7;LISU LETTER KA;Lo;0;L;;;;;N;;;;; A4D8;LISU LETTER KHA;Lo;0;L;;;;;N;;;;; A4D9;LISU LETTER JA;Lo;0;L;;;;;N;;;;; A4DA;LISU LETTER CA;Lo;0;L;;;;;N;;;;; A4DB;LISU LETTER CHA;Lo;0;L;;;;;N;;;;; A4DC;LISU LETTER DZA;Lo;0;L;;;;;N;;;;; A4DD;LISU LETTER TSA;Lo;0;L;;;;;N;;;;; A4DE;LISU LETTER TSHA;Lo;0;L;;;;;N;;;;; A4DF;LISU LETTER MA;Lo;0;L;;;;;N;;;;; A4E0;LISU LETTER NA;Lo;0;L;;;;;N;;;;; A4E1;LISU LETTER LA;Lo;0;L;;;;;N;;;;; A4E2;LISU LETTER SA;Lo;0;L;;;;;N;;;;; A4E3;LISU LETTER ZHA;Lo;0;L;;;;;N;;;;; A4E4;LISU LETTER ZA;Lo;0;L;;;;;N;;;;; A4E5;LISU LETTER NGA;Lo;0;L;;;;;N;;;;; A4E6;LISU LETTER HA;Lo;0;L;;;;;N;;;;; A4E7;LISU LETTER XA;Lo;0;L;;;;;N;;;;; A4E8;LISU LETTER HHA;Lo;0;L;;;;;N;;;;; A4E9;LISU LETTER FA;Lo;0;L;;;;;N;;;;; A4EA;LISU LETTER WA;Lo;0;L;;;;;N;;;;; A4EB;LISU LETTER SHA;Lo;0;L;;;;;N;;;;; A4EC;LISU LETTER YA;Lo;0;L;;;;;N;;;;; A4ED;LISU LETTER GHA;Lo;0;L;;;;;N;;;;; A4EE;LISU LETTER A;Lo;0;L;;;;;N;;;;; A4EF;LISU LETTER AE;Lo;0;L;;;;;N;;;;; A4F0;LISU LETTER E;Lo;0;L;;;;;N;;;;; A4F1;LISU LETTER EU;Lo;0;L;;;;;N;;;;; A4F2;LISU LETTER I;Lo;0;L;;;;;N;;;;; A4F3;LISU LETTER O;Lo;0;L;;;;;N;;;;; A4F4;LISU LETTER U;Lo;0;L;;;;;N;;;;; A4F5;LISU LETTER UE;Lo;0;L;;;;;N;;;;; A4F6;LISU LETTER UH;Lo;0;L;;;;;N;;;;; A4F7;LISU LETTER OE;Lo;0;L;;;;;N;;;;; A4F8;LISU LETTER TONE MYA TI;Lm;0;L;;;;;N;;;;; A4F9;LISU LETTER TONE NA PO;Lm;0;L;;;;;N;;;;; A4FA;LISU LETTER TONE MYA CYA;Lm;0;L;;;;;N;;;;; A4FB;LISU LETTER TONE MYA BO;Lm;0;L;;;;;N;;;;; A4FC;LISU LETTER TONE MYA NA;Lm;0;L;;;;;N;;;;; A4FD;LISU LETTER TONE MYA JEU;Lm;0;L;;;;;N;;;;; A4FE;LISU PUNCTUATION COMMA;Po;0;L;;;;;N;;;;; A4FF;LISU PUNCTUATION FULL STOP;Po;0;L;;;;;N;;;;; A500;VAI SYLLABLE EE;Lo;0;L;;;;;N;;;;; A501;VAI SYLLABLE EEN;Lo;0;L;;;;;N;;;;; A502;VAI SYLLABLE HEE;Lo;0;L;;;;;N;;;;; A503;VAI SYLLABLE WEE;Lo;0;L;;;;;N;;;;; A504;VAI SYLLABLE WEEN;Lo;0;L;;;;;N;;;;; A505;VAI SYLLABLE PEE;Lo;0;L;;;;;N;;;;; A506;VAI SYLLABLE BHEE;Lo;0;L;;;;;N;;;;; A507;VAI SYLLABLE BEE;Lo;0;L;;;;;N;;;;; A508;VAI SYLLABLE MBEE;Lo;0;L;;;;;N;;;;; A509;VAI SYLLABLE KPEE;Lo;0;L;;;;;N;;;;; A50A;VAI SYLLABLE MGBEE;Lo;0;L;;;;;N;;;;; A50B;VAI SYLLABLE GBEE;Lo;0;L;;;;;N;;;;; A50C;VAI SYLLABLE FEE;Lo;0;L;;;;;N;;;;; A50D;VAI SYLLABLE VEE;Lo;0;L;;;;;N;;;;; A50E;VAI SYLLABLE TEE;Lo;0;L;;;;;N;;;;; A50F;VAI SYLLABLE THEE;Lo;0;L;;;;;N;;;;; A510;VAI SYLLABLE DHEE;Lo;0;L;;;;;N;;;;; A511;VAI SYLLABLE DHHEE;Lo;0;L;;;;;N;;;;; A512;VAI SYLLABLE LEE;Lo;0;L;;;;;N;;;;; A513;VAI SYLLABLE REE;Lo;0;L;;;;;N;;;;; A514;VAI SYLLABLE DEE;Lo;0;L;;;;;N;;;;; A515;VAI SYLLABLE NDEE;Lo;0;L;;;;;N;;;;; A516;VAI SYLLABLE SEE;Lo;0;L;;;;;N;;;;; A517;VAI SYLLABLE SHEE;Lo;0;L;;;;;N;;;;; A518;VAI SYLLABLE ZEE;Lo;0;L;;;;;N;;;;; A519;VAI SYLLABLE ZHEE;Lo;0;L;;;;;N;;;;; A51A;VAI SYLLABLE CEE;Lo;0;L;;;;;N;;;;; A51B;VAI SYLLABLE JEE;Lo;0;L;;;;;N;;;;; A51C;VAI SYLLABLE NJEE;Lo;0;L;;;;;N;;;;; A51D;VAI SYLLABLE YEE;Lo;0;L;;;;;N;;;;; A51E;VAI SYLLABLE KEE;Lo;0;L;;;;;N;;;;; A51F;VAI SYLLABLE NGGEE;Lo;0;L;;;;;N;;;;; A520;VAI SYLLABLE GEE;Lo;0;L;;;;;N;;;;; A521;VAI SYLLABLE MEE;Lo;0;L;;;;;N;;;;; A522;VAI SYLLABLE NEE;Lo;0;L;;;;;N;;;;; A523;VAI SYLLABLE NYEE;Lo;0;L;;;;;N;;;;; A524;VAI SYLLABLE I;Lo;0;L;;;;;N;;;;; A525;VAI SYLLABLE IN;Lo;0;L;;;;;N;;;;; A526;VAI SYLLABLE HI;Lo;0;L;;;;;N;;;;; A527;VAI SYLLABLE HIN;Lo;0;L;;;;;N;;;;; A528;VAI SYLLABLE WI;Lo;0;L;;;;;N;;;;; A529;VAI SYLLABLE WIN;Lo;0;L;;;;;N;;;;; A52A;VAI SYLLABLE PI;Lo;0;L;;;;;N;;;;; A52B;VAI SYLLABLE BHI;Lo;0;L;;;;;N;;;;; A52C;VAI SYLLABLE BI;Lo;0;L;;;;;N;;;;; A52D;VAI SYLLABLE MBI;Lo;0;L;;;;;N;;;;; A52E;VAI SYLLABLE KPI;Lo;0;L;;;;;N;;;;; A52F;VAI SYLLABLE MGBI;Lo;0;L;;;;;N;;;;; A530;VAI SYLLABLE GBI;Lo;0;L;;;;;N;;;;; A531;VAI SYLLABLE FI;Lo;0;L;;;;;N;;;;; A532;VAI SYLLABLE VI;Lo;0;L;;;;;N;;;;; A533;VAI SYLLABLE TI;Lo;0;L;;;;;N;;;;; A534;VAI SYLLABLE THI;Lo;0;L;;;;;N;;;;; A535;VAI SYLLABLE DHI;Lo;0;L;;;;;N;;;;; A536;VAI SYLLABLE DHHI;Lo;0;L;;;;;N;;;;; A537;VAI SYLLABLE LI;Lo;0;L;;;;;N;;;;; A538;VAI SYLLABLE RI;Lo;0;L;;;;;N;;;;; A539;VAI SYLLABLE DI;Lo;0;L;;;;;N;;;;; A53A;VAI SYLLABLE NDI;Lo;0;L;;;;;N;;;;; A53B;VAI SYLLABLE SI;Lo;0;L;;;;;N;;;;; A53C;VAI SYLLABLE SHI;Lo;0;L;;;;;N;;;;; A53D;VAI SYLLABLE ZI;Lo;0;L;;;;;N;;;;; A53E;VAI SYLLABLE ZHI;Lo;0;L;;;;;N;;;;; A53F;VAI SYLLABLE CI;Lo;0;L;;;;;N;;;;; A540;VAI SYLLABLE JI;Lo;0;L;;;;;N;;;;; A541;VAI SYLLABLE NJI;Lo;0;L;;;;;N;;;;; A542;VAI SYLLABLE YI;Lo;0;L;;;;;N;;;;; A543;VAI SYLLABLE KI;Lo;0;L;;;;;N;;;;; A544;VAI SYLLABLE NGGI;Lo;0;L;;;;;N;;;;; A545;VAI SYLLABLE GI;Lo;0;L;;;;;N;;;;; A546;VAI SYLLABLE MI;Lo;0;L;;;;;N;;;;; A547;VAI SYLLABLE NI;Lo;0;L;;;;;N;;;;; A548;VAI SYLLABLE NYI;Lo;0;L;;;;;N;;;;; A549;VAI SYLLABLE A;Lo;0;L;;;;;N;;;;; A54A;VAI SYLLABLE AN;Lo;0;L;;;;;N;;;;; A54B;VAI SYLLABLE NGAN;Lo;0;L;;;;;N;;;;; A54C;VAI SYLLABLE HA;Lo;0;L;;;;;N;;;;; A54D;VAI SYLLABLE HAN;Lo;0;L;;;;;N;;;;; A54E;VAI SYLLABLE WA;Lo;0;L;;;;;N;;;;; A54F;VAI SYLLABLE WAN;Lo;0;L;;;;;N;;;;; A550;VAI SYLLABLE PA;Lo;0;L;;;;;N;;;;; A551;VAI SYLLABLE BHA;Lo;0;L;;;;;N;;;;; A552;VAI SYLLABLE BA;Lo;0;L;;;;;N;;;;; A553;VAI SYLLABLE MBA;Lo;0;L;;;;;N;;;;; A554;VAI SYLLABLE KPA;Lo;0;L;;;;;N;;;;; A555;VAI SYLLABLE KPAN;Lo;0;L;;;;;N;;;;; A556;VAI SYLLABLE MGBA;Lo;0;L;;;;;N;;;;; A557;VAI SYLLABLE GBA;Lo;0;L;;;;;N;;;;; A558;VAI SYLLABLE FA;Lo;0;L;;;;;N;;;;; A559;VAI SYLLABLE VA;Lo;0;L;;;;;N;;;;; A55A;VAI SYLLABLE TA;Lo;0;L;;;;;N;;;;; A55B;VAI SYLLABLE THA;Lo;0;L;;;;;N;;;;; A55C;VAI SYLLABLE DHA;Lo;0;L;;;;;N;;;;; A55D;VAI SYLLABLE DHHA;Lo;0;L;;;;;N;;;;; A55E;VAI SYLLABLE LA;Lo;0;L;;;;;N;;;;; A55F;VAI SYLLABLE RA;Lo;0;L;;;;;N;;;;; A560;VAI SYLLABLE DA;Lo;0;L;;;;;N;;;;; A561;VAI SYLLABLE NDA;Lo;0;L;;;;;N;;;;; A562;VAI SYLLABLE SA;Lo;0;L;;;;;N;;;;; A563;VAI SYLLABLE SHA;Lo;0;L;;;;;N;;;;; A564;VAI SYLLABLE ZA;Lo;0;L;;;;;N;;;;; A565;VAI SYLLABLE ZHA;Lo;0;L;;;;;N;;;;; A566;VAI SYLLABLE CA;Lo;0;L;;;;;N;;;;; A567;VAI SYLLABLE JA;Lo;0;L;;;;;N;;;;; A568;VAI SYLLABLE NJA;Lo;0;L;;;;;N;;;;; A569;VAI SYLLABLE YA;Lo;0;L;;;;;N;;;;; A56A;VAI SYLLABLE KA;Lo;0;L;;;;;N;;;;; A56B;VAI SYLLABLE KAN;Lo;0;L;;;;;N;;;;; A56C;VAI SYLLABLE NGGA;Lo;0;L;;;;;N;;;;; A56D;VAI SYLLABLE GA;Lo;0;L;;;;;N;;;;; A56E;VAI SYLLABLE MA;Lo;0;L;;;;;N;;;;; A56F;VAI SYLLABLE NA;Lo;0;L;;;;;N;;;;; A570;VAI SYLLABLE NYA;Lo;0;L;;;;;N;;;;; A571;VAI SYLLABLE OO;Lo;0;L;;;;;N;;;;; A572;VAI SYLLABLE OON;Lo;0;L;;;;;N;;;;; A573;VAI SYLLABLE HOO;Lo;0;L;;;;;N;;;;; A574;VAI SYLLABLE WOO;Lo;0;L;;;;;N;;;;; A575;VAI SYLLABLE WOON;Lo;0;L;;;;;N;;;;; A576;VAI SYLLABLE POO;Lo;0;L;;;;;N;;;;; A577;VAI SYLLABLE BHOO;Lo;0;L;;;;;N;;;;; A578;VAI SYLLABLE BOO;Lo;0;L;;;;;N;;;;; A579;VAI SYLLABLE MBOO;Lo;0;L;;;;;N;;;;; A57A;VAI SYLLABLE KPOO;Lo;0;L;;;;;N;;;;; A57B;VAI SYLLABLE MGBOO;Lo;0;L;;;;;N;;;;; A57C;VAI SYLLABLE GBOO;Lo;0;L;;;;;N;;;;; A57D;VAI SYLLABLE FOO;Lo;0;L;;;;;N;;;;; A57E;VAI SYLLABLE VOO;Lo;0;L;;;;;N;;;;; A57F;VAI SYLLABLE TOO;Lo;0;L;;;;;N;;;;; A580;VAI SYLLABLE THOO;Lo;0;L;;;;;N;;;;; A581;VAI SYLLABLE DHOO;Lo;0;L;;;;;N;;;;; A582;VAI SYLLABLE DHHOO;Lo;0;L;;;;;N;;;;; A583;VAI SYLLABLE LOO;Lo;0;L;;;;;N;;;;; A584;VAI SYLLABLE ROO;Lo;0;L;;;;;N;;;;; A585;VAI SYLLABLE DOO;Lo;0;L;;;;;N;;;;; A586;VAI SYLLABLE NDOO;Lo;0;L;;;;;N;;;;; A587;VAI SYLLABLE SOO;Lo;0;L;;;;;N;;;;; A588;VAI SYLLABLE SHOO;Lo;0;L;;;;;N;;;;; A589;VAI SYLLABLE ZOO;Lo;0;L;;;;;N;;;;; A58A;VAI SYLLABLE ZHOO;Lo;0;L;;;;;N;;;;; A58B;VAI SYLLABLE COO;Lo;0;L;;;;;N;;;;; A58C;VAI SYLLABLE JOO;Lo;0;L;;;;;N;;;;; A58D;VAI SYLLABLE NJOO;Lo;0;L;;;;;N;;;;; A58E;VAI SYLLABLE YOO;Lo;0;L;;;;;N;;;;; A58F;VAI SYLLABLE KOO;Lo;0;L;;;;;N;;;;; A590;VAI SYLLABLE NGGOO;Lo;0;L;;;;;N;;;;; A591;VAI SYLLABLE GOO;Lo;0;L;;;;;N;;;;; A592;VAI SYLLABLE MOO;Lo;0;L;;;;;N;;;;; A593;VAI SYLLABLE NOO;Lo;0;L;;;;;N;;;;; A594;VAI SYLLABLE NYOO;Lo;0;L;;;;;N;;;;; A595;VAI SYLLABLE U;Lo;0;L;;;;;N;;;;; A596;VAI SYLLABLE UN;Lo;0;L;;;;;N;;;;; A597;VAI SYLLABLE HU;Lo;0;L;;;;;N;;;;; A598;VAI SYLLABLE HUN;Lo;0;L;;;;;N;;;;; A599;VAI SYLLABLE WU;Lo;0;L;;;;;N;;;;; A59A;VAI SYLLABLE WUN;Lo;0;L;;;;;N;;;;; A59B;VAI SYLLABLE PU;Lo;0;L;;;;;N;;;;; A59C;VAI SYLLABLE BHU;Lo;0;L;;;;;N;;;;; A59D;VAI SYLLABLE BU;Lo;0;L;;;;;N;;;;; A59E;VAI SYLLABLE MBU;Lo;0;L;;;;;N;;;;; A59F;VAI SYLLABLE KPU;Lo;0;L;;;;;N;;;;; A5A0;VAI SYLLABLE MGBU;Lo;0;L;;;;;N;;;;; A5A1;VAI SYLLABLE GBU;Lo;0;L;;;;;N;;;;; A5A2;VAI SYLLABLE FU;Lo;0;L;;;;;N;;;;; A5A3;VAI SYLLABLE VU;Lo;0;L;;;;;N;;;;; A5A4;VAI SYLLABLE TU;Lo;0;L;;;;;N;;;;; A5A5;VAI SYLLABLE THU;Lo;0;L;;;;;N;;;;; A5A6;VAI SYLLABLE DHU;Lo;0;L;;;;;N;;;;; A5A7;VAI SYLLABLE DHHU;Lo;0;L;;;;;N;;;;; A5A8;VAI SYLLABLE LU;Lo;0;L;;;;;N;;;;; A5A9;VAI SYLLABLE RU;Lo;0;L;;;;;N;;;;; A5AA;VAI SYLLABLE DU;Lo;0;L;;;;;N;;;;; A5AB;VAI SYLLABLE NDU;Lo;0;L;;;;;N;;;;; A5AC;VAI SYLLABLE SU;Lo;0;L;;;;;N;;;;; A5AD;VAI SYLLABLE SHU;Lo;0;L;;;;;N;;;;; A5AE;VAI SYLLABLE ZU;Lo;0;L;;;;;N;;;;; A5AF;VAI SYLLABLE ZHU;Lo;0;L;;;;;N;;;;; A5B0;VAI SYLLABLE CU;Lo;0;L;;;;;N;;;;; A5B1;VAI SYLLABLE JU;Lo;0;L;;;;;N;;;;; A5B2;VAI SYLLABLE NJU;Lo;0;L;;;;;N;;;;; A5B3;VAI SYLLABLE YU;Lo;0;L;;;;;N;;;;; A5B4;VAI SYLLABLE KU;Lo;0;L;;;;;N;;;;; A5B5;VAI SYLLABLE NGGU;Lo;0;L;;;;;N;;;;; A5B6;VAI SYLLABLE GU;Lo;0;L;;;;;N;;;;; A5B7;VAI SYLLABLE MU;Lo;0;L;;;;;N;;;;; A5B8;VAI SYLLABLE NU;Lo;0;L;;;;;N;;;;; A5B9;VAI SYLLABLE NYU;Lo;0;L;;;;;N;;;;; A5BA;VAI SYLLABLE O;Lo;0;L;;;;;N;;;;; A5BB;VAI SYLLABLE ON;Lo;0;L;;;;;N;;;;; A5BC;VAI SYLLABLE NGON;Lo;0;L;;;;;N;;;;; A5BD;VAI SYLLABLE HO;Lo;0;L;;;;;N;;;;; A5BE;VAI SYLLABLE HON;Lo;0;L;;;;;N;;;;; A5BF;VAI SYLLABLE WO;Lo;0;L;;;;;N;;;;; A5C0;VAI SYLLABLE WON;Lo;0;L;;;;;N;;;;; A5C1;VAI SYLLABLE PO;Lo;0;L;;;;;N;;;;; A5C2;VAI SYLLABLE BHO;Lo;0;L;;;;;N;;;;; A5C3;VAI SYLLABLE BO;Lo;0;L;;;;;N;;;;; A5C4;VAI SYLLABLE MBO;Lo;0;L;;;;;N;;;;; A5C5;VAI SYLLABLE KPO;Lo;0;L;;;;;N;;;;; A5C6;VAI SYLLABLE MGBO;Lo;0;L;;;;;N;;;;; A5C7;VAI SYLLABLE GBO;Lo;0;L;;;;;N;;;;; A5C8;VAI SYLLABLE GBON;Lo;0;L;;;;;N;;;;; A5C9;VAI SYLLABLE FO;Lo;0;L;;;;;N;;;;; A5CA;VAI SYLLABLE VO;Lo;0;L;;;;;N;;;;; A5CB;VAI SYLLABLE TO;Lo;0;L;;;;;N;;;;; A5CC;VAI SYLLABLE THO;Lo;0;L;;;;;N;;;;; A5CD;VAI SYLLABLE DHO;Lo;0;L;;;;;N;;;;; A5CE;VAI SYLLABLE DHHO;Lo;0;L;;;;;N;;;;; A5CF;VAI SYLLABLE LO;Lo;0;L;;;;;N;;;;; A5D0;VAI SYLLABLE RO;Lo;0;L;;;;;N;;;;; A5D1;VAI SYLLABLE DO;Lo;0;L;;;;;N;;;;; A5D2;VAI SYLLABLE NDO;Lo;0;L;;;;;N;;;;; A5D3;VAI SYLLABLE SO;Lo;0;L;;;;;N;;;;; A5D4;VAI SYLLABLE SHO;Lo;0;L;;;;;N;;;;; A5D5;VAI SYLLABLE ZO;Lo;0;L;;;;;N;;;;; A5D6;VAI SYLLABLE ZHO;Lo;0;L;;;;;N;;;;; A5D7;VAI SYLLABLE CO;Lo;0;L;;;;;N;;;;; A5D8;VAI SYLLABLE JO;Lo;0;L;;;;;N;;;;; A5D9;VAI SYLLABLE NJO;Lo;0;L;;;;;N;;;;; A5DA;VAI SYLLABLE YO;Lo;0;L;;;;;N;;;;; A5DB;VAI SYLLABLE KO;Lo;0;L;;;;;N;;;;; A5DC;VAI SYLLABLE NGGO;Lo;0;L;;;;;N;;;;; A5DD;VAI SYLLABLE GO;Lo;0;L;;;;;N;;;;; A5DE;VAI SYLLABLE MO;Lo;0;L;;;;;N;;;;; A5DF;VAI SYLLABLE NO;Lo;0;L;;;;;N;;;;; A5E0;VAI SYLLABLE NYO;Lo;0;L;;;;;N;;;;; A5E1;VAI SYLLABLE E;Lo;0;L;;;;;N;;;;; A5E2;VAI SYLLABLE EN;Lo;0;L;;;;;N;;;;; A5E3;VAI SYLLABLE NGEN;Lo;0;L;;;;;N;;;;; A5E4;VAI SYLLABLE HE;Lo;0;L;;;;;N;;;;; A5E5;VAI SYLLABLE HEN;Lo;0;L;;;;;N;;;;; A5E6;VAI SYLLABLE WE;Lo;0;L;;;;;N;;;;; A5E7;VAI SYLLABLE WEN;Lo;0;L;;;;;N;;;;; A5E8;VAI SYLLABLE PE;Lo;0;L;;;;;N;;;;; A5E9;VAI SYLLABLE BHE;Lo;0;L;;;;;N;;;;; A5EA;VAI SYLLABLE BE;Lo;0;L;;;;;N;;;;; A5EB;VAI SYLLABLE MBE;Lo;0;L;;;;;N;;;;; A5EC;VAI SYLLABLE KPE;Lo;0;L;;;;;N;;;;; A5ED;VAI SYLLABLE KPEN;Lo;0;L;;;;;N;;;;; A5EE;VAI SYLLABLE MGBE;Lo;0;L;;;;;N;;;;; A5EF;VAI SYLLABLE GBE;Lo;0;L;;;;;N;;;;; A5F0;VAI SYLLABLE GBEN;Lo;0;L;;;;;N;;;;; A5F1;VAI SYLLABLE FE;Lo;0;L;;;;;N;;;;; A5F2;VAI SYLLABLE VE;Lo;0;L;;;;;N;;;;; A5F3;VAI SYLLABLE TE;Lo;0;L;;;;;N;;;;; A5F4;VAI SYLLABLE THE;Lo;0;L;;;;;N;;;;; A5F5;VAI SYLLABLE DHE;Lo;0;L;;;;;N;;;;; A5F6;VAI SYLLABLE DHHE;Lo;0;L;;;;;N;;;;; A5F7;VAI SYLLABLE LE;Lo;0;L;;;;;N;;;;; A5F8;VAI SYLLABLE RE;Lo;0;L;;;;;N;;;;; A5F9;VAI SYLLABLE DE;Lo;0;L;;;;;N;;;;; A5FA;VAI SYLLABLE NDE;Lo;0;L;;;;;N;;;;; A5FB;VAI SYLLABLE SE;Lo;0;L;;;;;N;;;;; A5FC;VAI SYLLABLE SHE;Lo;0;L;;;;;N;;;;; A5FD;VAI SYLLABLE ZE;Lo;0;L;;;;;N;;;;; A5FE;VAI SYLLABLE ZHE;Lo;0;L;;;;;N;;;;; A5FF;VAI SYLLABLE CE;Lo;0;L;;;;;N;;;;; A600;VAI SYLLABLE JE;Lo;0;L;;;;;N;;;;; A601;VAI SYLLABLE NJE;Lo;0;L;;;;;N;;;;; A602;VAI SYLLABLE YE;Lo;0;L;;;;;N;;;;; A603;VAI SYLLABLE KE;Lo;0;L;;;;;N;;;;; A604;VAI SYLLABLE NGGE;Lo;0;L;;;;;N;;;;; A605;VAI SYLLABLE NGGEN;Lo;0;L;;;;;N;;;;; A606;VAI SYLLABLE GE;Lo;0;L;;;;;N;;;;; A607;VAI SYLLABLE GEN;Lo;0;L;;;;;N;;;;; A608;VAI SYLLABLE ME;Lo;0;L;;;;;N;;;;; A609;VAI SYLLABLE NE;Lo;0;L;;;;;N;;;;; A60A;VAI SYLLABLE NYE;Lo;0;L;;;;;N;;;;; A60B;VAI SYLLABLE NG;Lo;0;L;;;;;N;;;;; A60C;VAI SYLLABLE LENGTHENER;Lm;0;L;;;;;N;;;;; A60D;VAI COMMA;Po;0;ON;;;;;N;;;;; A60E;VAI FULL STOP;Po;0;ON;;;;;N;;;;; A60F;VAI QUESTION MARK;Po;0;ON;;;;;N;;;;; A610;VAI SYLLABLE NDOLE FA;Lo;0;L;;;;;N;;;;; A611;VAI SYLLABLE NDOLE KA;Lo;0;L;;;;;N;;;;; A612;VAI SYLLABLE NDOLE SOO;Lo;0;L;;;;;N;;;;; A613;VAI SYMBOL FEENG;Lo;0;L;;;;;N;;;;; A614;VAI SYMBOL KEENG;Lo;0;L;;;;;N;;;;; A615;VAI SYMBOL TING;Lo;0;L;;;;;N;;;;; A616;VAI SYMBOL NII;Lo;0;L;;;;;N;;;;; A617;VAI SYMBOL BANG;Lo;0;L;;;;;N;;;;; A618;VAI SYMBOL FAA;Lo;0;L;;;;;N;;;;; A619;VAI SYMBOL TAA;Lo;0;L;;;;;N;;;;; A61A;VAI SYMBOL DANG;Lo;0;L;;;;;N;;;;; A61B;VAI SYMBOL DOONG;Lo;0;L;;;;;N;;;;; A61C;VAI SYMBOL KUNG;Lo;0;L;;;;;N;;;;; A61D;VAI SYMBOL TONG;Lo;0;L;;;;;N;;;;; A61E;VAI SYMBOL DO-O;Lo;0;L;;;;;N;;;;; A61F;VAI SYMBOL JONG;Lo;0;L;;;;;N;;;;; A620;VAI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; A621;VAI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; A622;VAI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; A623;VAI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; A624;VAI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; A625;VAI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; A626;VAI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; A627;VAI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; A628;VAI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; A629;VAI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; A62A;VAI SYLLABLE NDOLE MA;Lo;0;L;;;;;N;;;;; A62B;VAI SYLLABLE NDOLE DO;Lo;0;L;;;;;N;;;;; A640;CYRILLIC CAPITAL LETTER ZEMLYA;Lu;0;L;;;;;N;;;;A641; A641;CYRILLIC SMALL LETTER ZEMLYA;Ll;0;L;;;;;N;;;A640;;A640 A642;CYRILLIC CAPITAL LETTER DZELO;Lu;0;L;;;;;N;;;;A643; A643;CYRILLIC SMALL LETTER DZELO;Ll;0;L;;;;;N;;;A642;;A642 A644;CYRILLIC CAPITAL LETTER REVERSED DZE;Lu;0;L;;;;;N;;;;A645; A645;CYRILLIC SMALL LETTER REVERSED DZE;Ll;0;L;;;;;N;;;A644;;A644 A646;CYRILLIC CAPITAL LETTER IOTA;Lu;0;L;;;;;N;;;;A647; A647;CYRILLIC SMALL LETTER IOTA;Ll;0;L;;;;;N;;;A646;;A646 A648;CYRILLIC CAPITAL LETTER DJERV;Lu;0;L;;;;;N;;;;A649; A649;CYRILLIC SMALL LETTER DJERV;Ll;0;L;;;;;N;;;A648;;A648 A64A;CYRILLIC CAPITAL LETTER MONOGRAPH UK;Lu;0;L;;;;;N;;;;A64B; A64B;CYRILLIC SMALL LETTER MONOGRAPH UK;Ll;0;L;;;;;N;;;A64A;;A64A A64C;CYRILLIC CAPITAL LETTER BROAD OMEGA;Lu;0;L;;;;;N;;;;A64D; A64D;CYRILLIC SMALL LETTER BROAD OMEGA;Ll;0;L;;;;;N;;;A64C;;A64C A64E;CYRILLIC CAPITAL LETTER NEUTRAL YER;Lu;0;L;;;;;N;;;;A64F; A64F;CYRILLIC SMALL LETTER NEUTRAL YER;Ll;0;L;;;;;N;;;A64E;;A64E A650;CYRILLIC CAPITAL LETTER YERU WITH BACK YER;Lu;0;L;;;;;N;;;;A651; A651;CYRILLIC SMALL LETTER YERU WITH BACK YER;Ll;0;L;;;;;N;;;A650;;A650 A652;CYRILLIC CAPITAL LETTER IOTIFIED YAT;Lu;0;L;;;;;N;;;;A653; A653;CYRILLIC SMALL LETTER IOTIFIED YAT;Ll;0;L;;;;;N;;;A652;;A652 A654;CYRILLIC CAPITAL LETTER REVERSED YU;Lu;0;L;;;;;N;;;;A655; A655;CYRILLIC SMALL LETTER REVERSED YU;Ll;0;L;;;;;N;;;A654;;A654 A656;CYRILLIC CAPITAL LETTER IOTIFIED A;Lu;0;L;;;;;N;;;;A657; A657;CYRILLIC SMALL LETTER IOTIFIED A;Ll;0;L;;;;;N;;;A656;;A656 A658;CYRILLIC CAPITAL LETTER CLOSED LITTLE YUS;Lu;0;L;;;;;N;;;;A659; A659;CYRILLIC SMALL LETTER CLOSED LITTLE YUS;Ll;0;L;;;;;N;;;A658;;A658 A65A;CYRILLIC CAPITAL LETTER BLENDED YUS;Lu;0;L;;;;;N;;;;A65B; A65B;CYRILLIC SMALL LETTER BLENDED YUS;Ll;0;L;;;;;N;;;A65A;;A65A A65C;CYRILLIC CAPITAL LETTER IOTIFIED CLOSED LITTLE YUS;Lu;0;L;;;;;N;;;;A65D; A65D;CYRILLIC SMALL LETTER IOTIFIED CLOSED LITTLE YUS;Ll;0;L;;;;;N;;;A65C;;A65C A65E;CYRILLIC CAPITAL LETTER YN;Lu;0;L;;;;;N;;;;A65F; A65F;CYRILLIC SMALL LETTER YN;Ll;0;L;;;;;N;;;A65E;;A65E A660;CYRILLIC CAPITAL LETTER REVERSED TSE;Lu;0;L;;;;;N;;;;A661; A661;CYRILLIC SMALL LETTER REVERSED TSE;Ll;0;L;;;;;N;;;A660;;A660 A662;CYRILLIC CAPITAL LETTER SOFT DE;Lu;0;L;;;;;N;;;;A663; A663;CYRILLIC SMALL LETTER SOFT DE;Ll;0;L;;;;;N;;;A662;;A662 A664;CYRILLIC CAPITAL LETTER SOFT EL;Lu;0;L;;;;;N;;;;A665; A665;CYRILLIC SMALL LETTER SOFT EL;Ll;0;L;;;;;N;;;A664;;A664 A666;CYRILLIC CAPITAL LETTER SOFT EM;Lu;0;L;;;;;N;;;;A667; A667;CYRILLIC SMALL LETTER SOFT EM;Ll;0;L;;;;;N;;;A666;;A666 A668;CYRILLIC CAPITAL LETTER MONOCULAR O;Lu;0;L;;;;;N;;;;A669; A669;CYRILLIC SMALL LETTER MONOCULAR O;Ll;0;L;;;;;N;;;A668;;A668 A66A;CYRILLIC CAPITAL LETTER BINOCULAR O;Lu;0;L;;;;;N;;;;A66B; A66B;CYRILLIC SMALL LETTER BINOCULAR O;Ll;0;L;;;;;N;;;A66A;;A66A A66C;CYRILLIC CAPITAL LETTER DOUBLE MONOCULAR O;Lu;0;L;;;;;N;;;;A66D; A66D;CYRILLIC SMALL LETTER DOUBLE MONOCULAR O;Ll;0;L;;;;;N;;;A66C;;A66C A66E;CYRILLIC LETTER MULTIOCULAR O;Lo;0;L;;;;;N;;;;; A66F;COMBINING CYRILLIC VZMET;Mn;230;NSM;;;;;N;;;;; A670;COMBINING CYRILLIC TEN MILLIONS SIGN;Me;0;NSM;;;;;N;;;;; A671;COMBINING CYRILLIC HUNDRED MILLIONS SIGN;Me;0;NSM;;;;;N;;;;; A672;COMBINING CYRILLIC THOUSAND MILLIONS SIGN;Me;0;NSM;;;;;N;;;;; A673;SLAVONIC ASTERISK;Po;0;ON;;;;;N;;;;; A674;COMBINING CYRILLIC LETTER UKRAINIAN IE;Mn;230;NSM;;;;;N;;;;; A675;COMBINING CYRILLIC LETTER I;Mn;230;NSM;;;;;N;;;;; A676;COMBINING CYRILLIC LETTER YI;Mn;230;NSM;;;;;N;;;;; A677;COMBINING CYRILLIC LETTER U;Mn;230;NSM;;;;;N;;;;; A678;COMBINING CYRILLIC LETTER HARD SIGN;Mn;230;NSM;;;;;N;;;;; A679;COMBINING CYRILLIC LETTER YERU;Mn;230;NSM;;;;;N;;;;; A67A;COMBINING CYRILLIC LETTER SOFT SIGN;Mn;230;NSM;;;;;N;;;;; A67B;COMBINING CYRILLIC LETTER OMEGA;Mn;230;NSM;;;;;N;;;;; A67C;COMBINING CYRILLIC KAVYKA;Mn;230;NSM;;;;;N;;;;; A67D;COMBINING CYRILLIC PAYEROK;Mn;230;NSM;;;;;N;;;;; A67E;CYRILLIC KAVYKA;Po;0;ON;;;;;N;;;;; A67F;CYRILLIC PAYEROK;Lm;0;ON;;;;;N;;;;; A680;CYRILLIC CAPITAL LETTER DWE;Lu;0;L;;;;;N;;;;A681; A681;CYRILLIC SMALL LETTER DWE;Ll;0;L;;;;;N;;;A680;;A680 A682;CYRILLIC CAPITAL LETTER DZWE;Lu;0;L;;;;;N;;;;A683; A683;CYRILLIC SMALL LETTER DZWE;Ll;0;L;;;;;N;;;A682;;A682 A684;CYRILLIC CAPITAL LETTER ZHWE;Lu;0;L;;;;;N;;;;A685; A685;CYRILLIC SMALL LETTER ZHWE;Ll;0;L;;;;;N;;;A684;;A684 A686;CYRILLIC CAPITAL LETTER CCHE;Lu;0;L;;;;;N;;;;A687; A687;CYRILLIC SMALL LETTER CCHE;Ll;0;L;;;;;N;;;A686;;A686 A688;CYRILLIC CAPITAL LETTER DZZE;Lu;0;L;;;;;N;;;;A689; A689;CYRILLIC SMALL LETTER DZZE;Ll;0;L;;;;;N;;;A688;;A688 A68A;CYRILLIC CAPITAL LETTER TE WITH MIDDLE HOOK;Lu;0;L;;;;;N;;;;A68B; A68B;CYRILLIC SMALL LETTER TE WITH MIDDLE HOOK;Ll;0;L;;;;;N;;;A68A;;A68A A68C;CYRILLIC CAPITAL LETTER TWE;Lu;0;L;;;;;N;;;;A68D; A68D;CYRILLIC SMALL LETTER TWE;Ll;0;L;;;;;N;;;A68C;;A68C A68E;CYRILLIC CAPITAL LETTER TSWE;Lu;0;L;;;;;N;;;;A68F; A68F;CYRILLIC SMALL LETTER TSWE;Ll;0;L;;;;;N;;;A68E;;A68E A690;CYRILLIC CAPITAL LETTER TSSE;Lu;0;L;;;;;N;;;;A691; A691;CYRILLIC SMALL LETTER TSSE;Ll;0;L;;;;;N;;;A690;;A690 A692;CYRILLIC CAPITAL LETTER TCHE;Lu;0;L;;;;;N;;;;A693; A693;CYRILLIC SMALL LETTER TCHE;Ll;0;L;;;;;N;;;A692;;A692 A694;CYRILLIC CAPITAL LETTER HWE;Lu;0;L;;;;;N;;;;A695; A695;CYRILLIC SMALL LETTER HWE;Ll;0;L;;;;;N;;;A694;;A694 A696;CYRILLIC CAPITAL LETTER SHWE;Lu;0;L;;;;;N;;;;A697; A697;CYRILLIC SMALL LETTER SHWE;Ll;0;L;;;;;N;;;A696;;A696 A69F;COMBINING CYRILLIC LETTER IOTIFIED E;Mn;230;NSM;;;;;N;;;;; A6A0;BAMUM LETTER A;Lo;0;L;;;;;N;;;;; A6A1;BAMUM LETTER KA;Lo;0;L;;;;;N;;;;; A6A2;BAMUM LETTER U;Lo;0;L;;;;;N;;;;; A6A3;BAMUM LETTER KU;Lo;0;L;;;;;N;;;;; A6A4;BAMUM LETTER EE;Lo;0;L;;;;;N;;;;; A6A5;BAMUM LETTER REE;Lo;0;L;;;;;N;;;;; A6A6;BAMUM LETTER TAE;Lo;0;L;;;;;N;;;;; A6A7;BAMUM LETTER O;Lo;0;L;;;;;N;;;;; A6A8;BAMUM LETTER NYI;Lo;0;L;;;;;N;;;;; A6A9;BAMUM LETTER I;Lo;0;L;;;;;N;;;;; A6AA;BAMUM LETTER LA;Lo;0;L;;;;;N;;;;; A6AB;BAMUM LETTER PA;Lo;0;L;;;;;N;;;;; A6AC;BAMUM LETTER RII;Lo;0;L;;;;;N;;;;; A6AD;BAMUM LETTER RIEE;Lo;0;L;;;;;N;;;;; A6AE;BAMUM LETTER LEEEE;Lo;0;L;;;;;N;;;;; A6AF;BAMUM LETTER MEEEE;Lo;0;L;;;;;N;;;;; A6B0;BAMUM LETTER TAA;Lo;0;L;;;;;N;;;;; A6B1;BAMUM LETTER NDAA;Lo;0;L;;;;;N;;;;; A6B2;BAMUM LETTER NJAEM;Lo;0;L;;;;;N;;;;; A6B3;BAMUM LETTER M;Lo;0;L;;;;;N;;;;; A6B4;BAMUM LETTER SUU;Lo;0;L;;;;;N;;;;; A6B5;BAMUM LETTER MU;Lo;0;L;;;;;N;;;;; A6B6;BAMUM LETTER SHII;Lo;0;L;;;;;N;;;;; A6B7;BAMUM LETTER SI;Lo;0;L;;;;;N;;;;; A6B8;BAMUM LETTER SHEUX;Lo;0;L;;;;;N;;;;; A6B9;BAMUM LETTER SEUX;Lo;0;L;;;;;N;;;;; A6BA;BAMUM LETTER KYEE;Lo;0;L;;;;;N;;;;; A6BB;BAMUM LETTER KET;Lo;0;L;;;;;N;;;;; A6BC;BAMUM LETTER NUAE;Lo;0;L;;;;;N;;;;; A6BD;BAMUM LETTER NU;Lo;0;L;;;;;N;;;;; A6BE;BAMUM LETTER NJUAE;Lo;0;L;;;;;N;;;;; A6BF;BAMUM LETTER YOQ;Lo;0;L;;;;;N;;;;; A6C0;BAMUM LETTER SHU;Lo;0;L;;;;;N;;;;; A6C1;BAMUM LETTER YUQ;Lo;0;L;;;;;N;;;;; A6C2;BAMUM LETTER YA;Lo;0;L;;;;;N;;;;; A6C3;BAMUM LETTER NSHA;Lo;0;L;;;;;N;;;;; A6C4;BAMUM LETTER KEUX;Lo;0;L;;;;;N;;;;; A6C5;BAMUM LETTER PEUX;Lo;0;L;;;;;N;;;;; A6C6;BAMUM LETTER NJEE;Lo;0;L;;;;;N;;;;; A6C7;BAMUM LETTER NTEE;Lo;0;L;;;;;N;;;;; A6C8;BAMUM LETTER PUE;Lo;0;L;;;;;N;;;;; A6C9;BAMUM LETTER WUE;Lo;0;L;;;;;N;;;;; A6CA;BAMUM LETTER PEE;Lo;0;L;;;;;N;;;;; A6CB;BAMUM LETTER FEE;Lo;0;L;;;;;N;;;;; A6CC;BAMUM LETTER RU;Lo;0;L;;;;;N;;;;; A6CD;BAMUM LETTER LU;Lo;0;L;;;;;N;;;;; A6CE;BAMUM LETTER MI;Lo;0;L;;;;;N;;;;; A6CF;BAMUM LETTER NI;Lo;0;L;;;;;N;;;;; A6D0;BAMUM LETTER REUX;Lo;0;L;;;;;N;;;;; A6D1;BAMUM LETTER RAE;Lo;0;L;;;;;N;;;;; A6D2;BAMUM LETTER KEN;Lo;0;L;;;;;N;;;;; A6D3;BAMUM LETTER NGKWAEN;Lo;0;L;;;;;N;;;;; A6D4;BAMUM LETTER NGGA;Lo;0;L;;;;;N;;;;; A6D5;BAMUM LETTER NGA;Lo;0;L;;;;;N;;;;; A6D6;BAMUM LETTER SHO;Lo;0;L;;;;;N;;;;; A6D7;BAMUM LETTER PUAE;Lo;0;L;;;;;N;;;;; A6D8;BAMUM LETTER FU;Lo;0;L;;;;;N;;;;; A6D9;BAMUM LETTER FOM;Lo;0;L;;;;;N;;;;; A6DA;BAMUM LETTER WA;Lo;0;L;;;;;N;;;;; A6DB;BAMUM LETTER NA;Lo;0;L;;;;;N;;;;; A6DC;BAMUM LETTER LI;Lo;0;L;;;;;N;;;;; A6DD;BAMUM LETTER PI;Lo;0;L;;;;;N;;;;; A6DE;BAMUM LETTER LOQ;Lo;0;L;;;;;N;;;;; A6DF;BAMUM LETTER KO;Lo;0;L;;;;;N;;;;; A6E0;BAMUM LETTER MBEN;Lo;0;L;;;;;N;;;;; A6E1;BAMUM LETTER REN;Lo;0;L;;;;;N;;;;; A6E2;BAMUM LETTER MEN;Lo;0;L;;;;;N;;;;; A6E3;BAMUM LETTER MA;Lo;0;L;;;;;N;;;;; A6E4;BAMUM LETTER TI;Lo;0;L;;;;;N;;;;; A6E5;BAMUM LETTER KI;Lo;0;L;;;;;N;;;;; A6E6;BAMUM LETTER MO;Nl;0;L;;;;1;N;;;;; A6E7;BAMUM LETTER MBAA;Nl;0;L;;;;2;N;;;;; A6E8;BAMUM LETTER TET;Nl;0;L;;;;3;N;;;;; A6E9;BAMUM LETTER KPA;Nl;0;L;;;;4;N;;;;; A6EA;BAMUM LETTER TEN;Nl;0;L;;;;5;N;;;;; A6EB;BAMUM LETTER NTUU;Nl;0;L;;;;6;N;;;;; A6EC;BAMUM LETTER SAMBA;Nl;0;L;;;;7;N;;;;; A6ED;BAMUM LETTER FAAMAE;Nl;0;L;;;;8;N;;;;; A6EE;BAMUM LETTER KOVUU;Nl;0;L;;;;9;N;;;;; A6EF;BAMUM LETTER KOGHOM;Nl;0;L;;;;0;N;;;;; A6F0;BAMUM COMBINING MARK KOQNDON;Mn;230;NSM;;;;;N;;;;; A6F1;BAMUM COMBINING MARK TUKWENTIS;Mn;230;NSM;;;;;N;;;;; A6F2;BAMUM NJAEMLI;Po;0;L;;;;;N;;;;; A6F3;BAMUM FULL STOP;Po;0;L;;;;;N;;;;; A6F4;BAMUM COLON;Po;0;L;;;;;N;;;;; A6F5;BAMUM COMMA;Po;0;L;;;;;N;;;;; A6F6;BAMUM SEMICOLON;Po;0;L;;;;;N;;;;; A6F7;BAMUM QUESTION MARK;Po;0;L;;;;;N;;;;; A700;MODIFIER LETTER CHINESE TONE YIN PING;Sk;0;ON;;;;;N;;;;; A701;MODIFIER LETTER CHINESE TONE YANG PING;Sk;0;ON;;;;;N;;;;; A702;MODIFIER LETTER CHINESE TONE YIN SHANG;Sk;0;ON;;;;;N;;;;; A703;MODIFIER LETTER CHINESE TONE YANG SHANG;Sk;0;ON;;;;;N;;;;; A704;MODIFIER LETTER CHINESE TONE YIN QU;Sk;0;ON;;;;;N;;;;; A705;MODIFIER LETTER CHINESE TONE YANG QU;Sk;0;ON;;;;;N;;;;; A706;MODIFIER LETTER CHINESE TONE YIN RU;Sk;0;ON;;;;;N;;;;; A707;MODIFIER LETTER CHINESE TONE YANG RU;Sk;0;ON;;;;;N;;;;; A708;MODIFIER LETTER EXTRA-HIGH DOTTED TONE BAR;Sk;0;ON;;;;;N;;;;; A709;MODIFIER LETTER HIGH DOTTED TONE BAR;Sk;0;ON;;;;;N;;;;; A70A;MODIFIER LETTER MID DOTTED TONE BAR;Sk;0;ON;;;;;N;;;;; A70B;MODIFIER LETTER LOW DOTTED TONE BAR;Sk;0;ON;;;;;N;;;;; A70C;MODIFIER LETTER EXTRA-LOW DOTTED TONE BAR;Sk;0;ON;;;;;N;;;;; A70D;MODIFIER LETTER EXTRA-HIGH DOTTED LEFT-STEM TONE BAR;Sk;0;ON;;;;;N;;;;; A70E;MODIFIER LETTER HIGH DOTTED LEFT-STEM TONE BAR;Sk;0;ON;;;;;N;;;;; A70F;MODIFIER LETTER MID DOTTED LEFT-STEM TONE BAR;Sk;0;ON;;;;;N;;;;; A710;MODIFIER LETTER LOW DOTTED LEFT-STEM TONE BAR;Sk;0;ON;;;;;N;;;;; A711;MODIFIER LETTER EXTRA-LOW DOTTED LEFT-STEM TONE BAR;Sk;0;ON;;;;;N;;;;; A712;MODIFIER LETTER EXTRA-HIGH LEFT-STEM TONE BAR;Sk;0;ON;;;;;N;;;;; A713;MODIFIER LETTER HIGH LEFT-STEM TONE BAR;Sk;0;ON;;;;;N;;;;; A714;MODIFIER LETTER MID LEFT-STEM TONE BAR;Sk;0;ON;;;;;N;;;;; A715;MODIFIER LETTER LOW LEFT-STEM TONE BAR;Sk;0;ON;;;;;N;;;;; A716;MODIFIER LETTER EXTRA-LOW LEFT-STEM TONE BAR;Sk;0;ON;;;;;N;;;;; A717;MODIFIER LETTER DOT VERTICAL BAR;Lm;0;ON;;;;;N;;;;; A718;MODIFIER LETTER DOT SLASH;Lm;0;ON;;;;;N;;;;; A719;MODIFIER LETTER DOT HORIZONTAL BAR;Lm;0;ON;;;;;N;;;;; A71A;MODIFIER LETTER LOWER RIGHT CORNER ANGLE;Lm;0;ON;;;;;N;;;;; A71B;MODIFIER LETTER RAISED UP ARROW;Lm;0;ON;;;;;N;;;;; A71C;MODIFIER LETTER RAISED DOWN ARROW;Lm;0;ON;;;;;N;;;;; A71D;MODIFIER LETTER RAISED EXCLAMATION MARK;Lm;0;ON;;;;;N;;;;; A71E;MODIFIER LETTER RAISED INVERTED EXCLAMATION MARK;Lm;0;ON;;;;;N;;;;; A71F;MODIFIER LETTER LOW INVERTED EXCLAMATION MARK;Lm;0;ON;;;;;N;;;;; A720;MODIFIER LETTER STRESS AND HIGH TONE;Sk;0;ON;;;;;N;;;;; A721;MODIFIER LETTER STRESS AND LOW TONE;Sk;0;ON;;;;;N;;;;; A722;LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF;Lu;0;L;;;;;N;;;;A723; A723;LATIN SMALL LETTER EGYPTOLOGICAL ALEF;Ll;0;L;;;;;N;;;A722;;A722 A724;LATIN CAPITAL LETTER EGYPTOLOGICAL AIN;Lu;0;L;;;;;N;;;;A725; A725;LATIN SMALL LETTER EGYPTOLOGICAL AIN;Ll;0;L;;;;;N;;;A724;;A724 A726;LATIN CAPITAL LETTER HENG;Lu;0;L;;;;;N;;;;A727; A727;LATIN SMALL LETTER HENG;Ll;0;L;;;;;N;;;A726;;A726 A728;LATIN CAPITAL LETTER TZ;Lu;0;L;;;;;N;;;;A729; A729;LATIN SMALL LETTER TZ;Ll;0;L;;;;;N;;;A728;;A728 A72A;LATIN CAPITAL LETTER TRESILLO;Lu;0;L;;;;;N;;;;A72B; A72B;LATIN SMALL LETTER TRESILLO;Ll;0;L;;;;;N;;;A72A;;A72A A72C;LATIN CAPITAL LETTER CUATRILLO;Lu;0;L;;;;;N;;;;A72D; A72D;LATIN SMALL LETTER CUATRILLO;Ll;0;L;;;;;N;;;A72C;;A72C A72E;LATIN CAPITAL LETTER CUATRILLO WITH COMMA;Lu;0;L;;;;;N;;;;A72F; A72F;LATIN SMALL LETTER CUATRILLO WITH COMMA;Ll;0;L;;;;;N;;;A72E;;A72E A730;LATIN LETTER SMALL CAPITAL F;Ll;0;L;;;;;N;;;;; A731;LATIN LETTER SMALL CAPITAL S;Ll;0;L;;;;;N;;;;; A732;LATIN CAPITAL LETTER AA;Lu;0;L;;;;;N;;;;A733; A733;LATIN SMALL LETTER AA;Ll;0;L;;;;;N;;;A732;;A732 A734;LATIN CAPITAL LETTER AO;Lu;0;L;;;;;N;;;;A735; A735;LATIN SMALL LETTER AO;Ll;0;L;;;;;N;;;A734;;A734 A736;LATIN CAPITAL LETTER AU;Lu;0;L;;;;;N;;;;A737; A737;LATIN SMALL LETTER AU;Ll;0;L;;;;;N;;;A736;;A736 A738;LATIN CAPITAL LETTER AV;Lu;0;L;;;;;N;;;;A739; A739;LATIN SMALL LETTER AV;Ll;0;L;;;;;N;;;A738;;A738 A73A;LATIN CAPITAL LETTER AV WITH HORIZONTAL BAR;Lu;0;L;;;;;N;;;;A73B; A73B;LATIN SMALL LETTER AV WITH HORIZONTAL BAR;Ll;0;L;;;;;N;;;A73A;;A73A A73C;LATIN CAPITAL LETTER AY;Lu;0;L;;;;;N;;;;A73D; A73D;LATIN SMALL LETTER AY;Ll;0;L;;;;;N;;;A73C;;A73C A73E;LATIN CAPITAL LETTER REVERSED C WITH DOT;Lu;0;L;;;;;N;;;;A73F; A73F;LATIN SMALL LETTER REVERSED C WITH DOT;Ll;0;L;;;;;N;;;A73E;;A73E A740;LATIN CAPITAL LETTER K WITH STROKE;Lu;0;L;;;;;N;;;;A741; A741;LATIN SMALL LETTER K WITH STROKE;Ll;0;L;;;;;N;;;A740;;A740 A742;LATIN CAPITAL LETTER K WITH DIAGONAL STROKE;Lu;0;L;;;;;N;;;;A743; A743;LATIN SMALL LETTER K WITH DIAGONAL STROKE;Ll;0;L;;;;;N;;;A742;;A742 A744;LATIN CAPITAL LETTER K WITH STROKE AND DIAGONAL STROKE;Lu;0;L;;;;;N;;;;A745; A745;LATIN SMALL LETTER K WITH STROKE AND DIAGONAL STROKE;Ll;0;L;;;;;N;;;A744;;A744 A746;LATIN CAPITAL LETTER BROKEN L;Lu;0;L;;;;;N;;;;A747; A747;LATIN SMALL LETTER BROKEN L;Ll;0;L;;;;;N;;;A746;;A746 A748;LATIN CAPITAL LETTER L WITH HIGH STROKE;Lu;0;L;;;;;N;;;;A749; A749;LATIN SMALL LETTER L WITH HIGH STROKE;Ll;0;L;;;;;N;;;A748;;A748 A74A;LATIN CAPITAL LETTER O WITH LONG STROKE OVERLAY;Lu;0;L;;;;;N;;;;A74B; A74B;LATIN SMALL LETTER O WITH LONG STROKE OVERLAY;Ll;0;L;;;;;N;;;A74A;;A74A A74C;LATIN CAPITAL LETTER O WITH LOOP;Lu;0;L;;;;;N;;;;A74D; A74D;LATIN SMALL LETTER O WITH LOOP;Ll;0;L;;;;;N;;;A74C;;A74C A74E;LATIN CAPITAL LETTER OO;Lu;0;L;;;;;N;;;;A74F; A74F;LATIN SMALL LETTER OO;Ll;0;L;;;;;N;;;A74E;;A74E A750;LATIN CAPITAL LETTER P WITH STROKE THROUGH DESCENDER;Lu;0;L;;;;;N;;;;A751; A751;LATIN SMALL LETTER P WITH STROKE THROUGH DESCENDER;Ll;0;L;;;;;N;;;A750;;A750 A752;LATIN CAPITAL LETTER P WITH FLOURISH;Lu;0;L;;;;;N;;;;A753; A753;LATIN SMALL LETTER P WITH FLOURISH;Ll;0;L;;;;;N;;;A752;;A752 A754;LATIN CAPITAL LETTER P WITH SQUIRREL TAIL;Lu;0;L;;;;;N;;;;A755; A755;LATIN SMALL LETTER P WITH SQUIRREL TAIL;Ll;0;L;;;;;N;;;A754;;A754 A756;LATIN CAPITAL LETTER Q WITH STROKE THROUGH DESCENDER;Lu;0;L;;;;;N;;;;A757; A757;LATIN SMALL LETTER Q WITH STROKE THROUGH DESCENDER;Ll;0;L;;;;;N;;;A756;;A756 A758;LATIN CAPITAL LETTER Q WITH DIAGONAL STROKE;Lu;0;L;;;;;N;;;;A759; A759;LATIN SMALL LETTER Q WITH DIAGONAL STROKE;Ll;0;L;;;;;N;;;A758;;A758 A75A;LATIN CAPITAL LETTER R ROTUNDA;Lu;0;L;;;;;N;;;;A75B; A75B;LATIN SMALL LETTER R ROTUNDA;Ll;0;L;;;;;N;;;A75A;;A75A A75C;LATIN CAPITAL LETTER RUM ROTUNDA;Lu;0;L;;;;;N;;;;A75D; A75D;LATIN SMALL LETTER RUM ROTUNDA;Ll;0;L;;;;;N;;;A75C;;A75C A75E;LATIN CAPITAL LETTER V WITH DIAGONAL STROKE;Lu;0;L;;;;;N;;;;A75F; A75F;LATIN SMALL LETTER V WITH DIAGONAL STROKE;Ll;0;L;;;;;N;;;A75E;;A75E A760;LATIN CAPITAL LETTER VY;Lu;0;L;;;;;N;;;;A761; A761;LATIN SMALL LETTER VY;Ll;0;L;;;;;N;;;A760;;A760 A762;LATIN CAPITAL LETTER VISIGOTHIC Z;Lu;0;L;;;;;N;;;;A763; A763;LATIN SMALL LETTER VISIGOTHIC Z;Ll;0;L;;;;;N;;;A762;;A762 A764;LATIN CAPITAL LETTER THORN WITH STROKE;Lu;0;L;;;;;N;;;;A765; A765;LATIN SMALL LETTER THORN WITH STROKE;Ll;0;L;;;;;N;;;A764;;A764 A766;LATIN CAPITAL LETTER THORN WITH STROKE THROUGH DESCENDER;Lu;0;L;;;;;N;;;;A767; A767;LATIN SMALL LETTER THORN WITH STROKE THROUGH DESCENDER;Ll;0;L;;;;;N;;;A766;;A766 A768;LATIN CAPITAL LETTER VEND;Lu;0;L;;;;;N;;;;A769; A769;LATIN SMALL LETTER VEND;Ll;0;L;;;;;N;;;A768;;A768 A76A;LATIN CAPITAL LETTER ET;Lu;0;L;;;;;N;;;;A76B; A76B;LATIN SMALL LETTER ET;Ll;0;L;;;;;N;;;A76A;;A76A A76C;LATIN CAPITAL LETTER IS;Lu;0;L;;;;;N;;;;A76D; A76D;LATIN SMALL LETTER IS;Ll;0;L;;;;;N;;;A76C;;A76C A76E;LATIN CAPITAL LETTER CON;Lu;0;L;;;;;N;;;;A76F; A76F;LATIN SMALL LETTER CON;Ll;0;L;;;;;N;;;A76E;;A76E A770;MODIFIER LETTER US;Lm;0;L; A76F;;;;N;;;;; A771;LATIN SMALL LETTER DUM;Ll;0;L;;;;;N;;;;; A772;LATIN SMALL LETTER LUM;Ll;0;L;;;;;N;;;;; A773;LATIN SMALL LETTER MUM;Ll;0;L;;;;;N;;;;; A774;LATIN SMALL LETTER NUM;Ll;0;L;;;;;N;;;;; A775;LATIN SMALL LETTER RUM;Ll;0;L;;;;;N;;;;; A776;LATIN LETTER SMALL CAPITAL RUM;Ll;0;L;;;;;N;;;;; A777;LATIN SMALL LETTER TUM;Ll;0;L;;;;;N;;;;; A778;LATIN SMALL LETTER UM;Ll;0;L;;;;;N;;;;; A779;LATIN CAPITAL LETTER INSULAR D;Lu;0;L;;;;;N;;;;A77A; A77A;LATIN SMALL LETTER INSULAR D;Ll;0;L;;;;;N;;;A779;;A779 A77B;LATIN CAPITAL LETTER INSULAR F;Lu;0;L;;;;;N;;;;A77C; A77C;LATIN SMALL LETTER INSULAR F;Ll;0;L;;;;;N;;;A77B;;A77B A77D;LATIN CAPITAL LETTER INSULAR G;Lu;0;L;;;;;N;;;;1D79; A77E;LATIN CAPITAL LETTER TURNED INSULAR G;Lu;0;L;;;;;N;;;;A77F; A77F;LATIN SMALL LETTER TURNED INSULAR G;Ll;0;L;;;;;N;;;A77E;;A77E A780;LATIN CAPITAL LETTER TURNED L;Lu;0;L;;;;;N;;;;A781; A781;LATIN SMALL LETTER TURNED L;Ll;0;L;;;;;N;;;A780;;A780 A782;LATIN CAPITAL LETTER INSULAR R;Lu;0;L;;;;;N;;;;A783; A783;LATIN SMALL LETTER INSULAR R;Ll;0;L;;;;;N;;;A782;;A782 A784;LATIN CAPITAL LETTER INSULAR S;Lu;0;L;;;;;N;;;;A785; A785;LATIN SMALL LETTER INSULAR S;Ll;0;L;;;;;N;;;A784;;A784 A786;LATIN CAPITAL LETTER INSULAR T;Lu;0;L;;;;;N;;;;A787; A787;LATIN SMALL LETTER INSULAR T;Ll;0;L;;;;;N;;;A786;;A786 A788;MODIFIER LETTER LOW CIRCUMFLEX ACCENT;Lm;0;ON;;;;;N;;;;; A789;MODIFIER LETTER COLON;Sk;0;L;;;;;N;;;;; A78A;MODIFIER LETTER SHORT EQUALS SIGN;Sk;0;L;;;;;N;;;;; A78B;LATIN CAPITAL LETTER SALTILLO;Lu;0;L;;;;;N;;;;A78C; A78C;LATIN SMALL LETTER SALTILLO;Ll;0;L;;;;;N;;;A78B;;A78B A78D;LATIN CAPITAL LETTER TURNED H;Lu;0;L;;;;;N;;;;0265; A78E;LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT;Ll;0;L;;;;;N;;;;; A790;LATIN CAPITAL LETTER N WITH DESCENDER;Lu;0;L;;;;;N;;;;A791; A791;LATIN SMALL LETTER N WITH DESCENDER;Ll;0;L;;;;;N;;;A790;;A790 A792;LATIN CAPITAL LETTER C WITH BAR;Lu;0;L;;;;;N;;;;A793; A793;LATIN SMALL LETTER C WITH BAR;Ll;0;L;;;;;N;;;A792;;A792 A7A0;LATIN CAPITAL LETTER G WITH OBLIQUE STROKE;Lu;0;L;;;;;N;;;;A7A1; A7A1;LATIN SMALL LETTER G WITH OBLIQUE STROKE;Ll;0;L;;;;;N;;;A7A0;;A7A0 A7A2;LATIN CAPITAL LETTER K WITH OBLIQUE STROKE;Lu;0;L;;;;;N;;;;A7A3; A7A3;LATIN SMALL LETTER K WITH OBLIQUE STROKE;Ll;0;L;;;;;N;;;A7A2;;A7A2 A7A4;LATIN CAPITAL LETTER N WITH OBLIQUE STROKE;Lu;0;L;;;;;N;;;;A7A5; A7A5;LATIN SMALL LETTER N WITH OBLIQUE STROKE;Ll;0;L;;;;;N;;;A7A4;;A7A4 A7A6;LATIN CAPITAL LETTER R WITH OBLIQUE STROKE;Lu;0;L;;;;;N;;;;A7A7; A7A7;LATIN SMALL LETTER R WITH OBLIQUE STROKE;Ll;0;L;;;;;N;;;A7A6;;A7A6 A7A8;LATIN CAPITAL LETTER S WITH OBLIQUE STROKE;Lu;0;L;;;;;N;;;;A7A9; A7A9;LATIN SMALL LETTER S WITH OBLIQUE STROKE;Ll;0;L;;;;;N;;;A7A8;;A7A8 A7AA;LATIN CAPITAL LETTER H WITH HOOK;Lu;0;L;;;;;N;;;;0266; A7F8;MODIFIER LETTER CAPITAL H WITH STROKE;Lm;0;L; 0126;;;;N;;;;; A7F9;MODIFIER LETTER SMALL LIGATURE OE;Lm;0;L; 0153;;;;N;;;;; A7FA;LATIN LETTER SMALL CAPITAL TURNED M;Ll;0;L;;;;;N;;;;; A7FB;LATIN EPIGRAPHIC LETTER REVERSED F;Lo;0;L;;;;;N;;;;; A7FC;LATIN EPIGRAPHIC LETTER REVERSED P;Lo;0;L;;;;;N;;;;; A7FD;LATIN EPIGRAPHIC LETTER INVERTED M;Lo;0;L;;;;;N;;;;; A7FE;LATIN EPIGRAPHIC LETTER I LONGA;Lo;0;L;;;;;N;;;;; A7FF;LATIN EPIGRAPHIC LETTER ARCHAIC M;Lo;0;L;;;;;N;;;;; A800;SYLOTI NAGRI LETTER A;Lo;0;L;;;;;N;;;;; A801;SYLOTI NAGRI LETTER I;Lo;0;L;;;;;N;;;;; A802;SYLOTI NAGRI SIGN DVISVARA;Mn;0;NSM;;;;;N;;;;; A803;SYLOTI NAGRI LETTER U;Lo;0;L;;;;;N;;;;; A804;SYLOTI NAGRI LETTER E;Lo;0;L;;;;;N;;;;; A805;SYLOTI NAGRI LETTER O;Lo;0;L;;;;;N;;;;; A806;SYLOTI NAGRI SIGN HASANTA;Mn;9;NSM;;;;;N;;;;; A807;SYLOTI NAGRI LETTER KO;Lo;0;L;;;;;N;;;;; A808;SYLOTI NAGRI LETTER KHO;Lo;0;L;;;;;N;;;;; A809;SYLOTI NAGRI LETTER GO;Lo;0;L;;;;;N;;;;; A80A;SYLOTI NAGRI LETTER GHO;Lo;0;L;;;;;N;;;;; A80B;SYLOTI NAGRI SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; A80C;SYLOTI NAGRI LETTER CO;Lo;0;L;;;;;N;;;;; A80D;SYLOTI NAGRI LETTER CHO;Lo;0;L;;;;;N;;;;; A80E;SYLOTI NAGRI LETTER JO;Lo;0;L;;;;;N;;;;; A80F;SYLOTI NAGRI LETTER JHO;Lo;0;L;;;;;N;;;;; A810;SYLOTI NAGRI LETTER TTO;Lo;0;L;;;;;N;;;;; A811;SYLOTI NAGRI LETTER TTHO;Lo;0;L;;;;;N;;;;; A812;SYLOTI NAGRI LETTER DDO;Lo;0;L;;;;;N;;;;; A813;SYLOTI NAGRI LETTER DDHO;Lo;0;L;;;;;N;;;;; A814;SYLOTI NAGRI LETTER TO;Lo;0;L;;;;;N;;;;; A815;SYLOTI NAGRI LETTER THO;Lo;0;L;;;;;N;;;;; A816;SYLOTI NAGRI LETTER DO;Lo;0;L;;;;;N;;;;; A817;SYLOTI NAGRI LETTER DHO;Lo;0;L;;;;;N;;;;; A818;SYLOTI NAGRI LETTER NO;Lo;0;L;;;;;N;;;;; A819;SYLOTI NAGRI LETTER PO;Lo;0;L;;;;;N;;;;; A81A;SYLOTI NAGRI LETTER PHO;Lo;0;L;;;;;N;;;;; A81B;SYLOTI NAGRI LETTER BO;Lo;0;L;;;;;N;;;;; A81C;SYLOTI NAGRI LETTER BHO;Lo;0;L;;;;;N;;;;; A81D;SYLOTI NAGRI LETTER MO;Lo;0;L;;;;;N;;;;; A81E;SYLOTI NAGRI LETTER RO;Lo;0;L;;;;;N;;;;; A81F;SYLOTI NAGRI LETTER LO;Lo;0;L;;;;;N;;;;; A820;SYLOTI NAGRI LETTER RRO;Lo;0;L;;;;;N;;;;; A821;SYLOTI NAGRI LETTER SO;Lo;0;L;;;;;N;;;;; A822;SYLOTI NAGRI LETTER HO;Lo;0;L;;;;;N;;;;; A823;SYLOTI NAGRI VOWEL SIGN A;Mc;0;L;;;;;N;;;;; A824;SYLOTI NAGRI VOWEL SIGN I;Mc;0;L;;;;;N;;;;; A825;SYLOTI NAGRI VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; A826;SYLOTI NAGRI VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; A827;SYLOTI NAGRI VOWEL SIGN OO;Mc;0;L;;;;;N;;;;; A828;SYLOTI NAGRI POETRY MARK-1;So;0;ON;;;;;N;;;;; A829;SYLOTI NAGRI POETRY MARK-2;So;0;ON;;;;;N;;;;; A82A;SYLOTI NAGRI POETRY MARK-3;So;0;ON;;;;;N;;;;; A82B;SYLOTI NAGRI POETRY MARK-4;So;0;ON;;;;;N;;;;; A830;NORTH INDIC FRACTION ONE QUARTER;No;0;L;;;;1/4;N;;;;; A831;NORTH INDIC FRACTION ONE HALF;No;0;L;;;;1/2;N;;;;; A832;NORTH INDIC FRACTION THREE QUARTERS;No;0;L;;;;3/4;N;;;;; A833;NORTH INDIC FRACTION ONE SIXTEENTH;No;0;L;;;;1/16;N;;;;; A834;NORTH INDIC FRACTION ONE EIGHTH;No;0;L;;;;1/8;N;;;;; A835;NORTH INDIC FRACTION THREE SIXTEENTHS;No;0;L;;;;3/16;N;;;;; A836;NORTH INDIC QUARTER MARK;So;0;L;;;;;N;;;;; A837;NORTH INDIC PLACEHOLDER MARK;So;0;L;;;;;N;;;;; A838;NORTH INDIC RUPEE MARK;Sc;0;ET;;;;;N;;;;; A839;NORTH INDIC QUANTITY MARK;So;0;ET;;;;;N;;;;; A840;PHAGS-PA LETTER KA;Lo;0;L;;;;;N;;;;; A841;PHAGS-PA LETTER KHA;Lo;0;L;;;;;N;;;;; A842;PHAGS-PA LETTER GA;Lo;0;L;;;;;N;;;;; A843;PHAGS-PA LETTER NGA;Lo;0;L;;;;;N;;;;; A844;PHAGS-PA LETTER CA;Lo;0;L;;;;;N;;;;; A845;PHAGS-PA LETTER CHA;Lo;0;L;;;;;N;;;;; A846;PHAGS-PA LETTER JA;Lo;0;L;;;;;N;;;;; A847;PHAGS-PA LETTER NYA;Lo;0;L;;;;;N;;;;; A848;PHAGS-PA LETTER TA;Lo;0;L;;;;;N;;;;; A849;PHAGS-PA LETTER THA;Lo;0;L;;;;;N;;;;; A84A;PHAGS-PA LETTER DA;Lo;0;L;;;;;N;;;;; A84B;PHAGS-PA LETTER NA;Lo;0;L;;;;;N;;;;; A84C;PHAGS-PA LETTER PA;Lo;0;L;;;;;N;;;;; A84D;PHAGS-PA LETTER PHA;Lo;0;L;;;;;N;;;;; A84E;PHAGS-PA LETTER BA;Lo;0;L;;;;;N;;;;; A84F;PHAGS-PA LETTER MA;Lo;0;L;;;;;N;;;;; A850;PHAGS-PA LETTER TSA;Lo;0;L;;;;;N;;;;; A851;PHAGS-PA LETTER TSHA;Lo;0;L;;;;;N;;;;; A852;PHAGS-PA LETTER DZA;Lo;0;L;;;;;N;;;;; A853;PHAGS-PA LETTER WA;Lo;0;L;;;;;N;;;;; A854;PHAGS-PA LETTER ZHA;Lo;0;L;;;;;N;;;;; A855;PHAGS-PA LETTER ZA;Lo;0;L;;;;;N;;;;; A856;PHAGS-PA LETTER SMALL A;Lo;0;L;;;;;N;;;;; A857;PHAGS-PA LETTER YA;Lo;0;L;;;;;N;;;;; A858;PHAGS-PA LETTER RA;Lo;0;L;;;;;N;;;;; A859;PHAGS-PA LETTER LA;Lo;0;L;;;;;N;;;;; A85A;PHAGS-PA LETTER SHA;Lo;0;L;;;;;N;;;;; A85B;PHAGS-PA LETTER SA;Lo;0;L;;;;;N;;;;; A85C;PHAGS-PA LETTER HA;Lo;0;L;;;;;N;;;;; A85D;PHAGS-PA LETTER A;Lo;0;L;;;;;N;;;;; A85E;PHAGS-PA LETTER I;Lo;0;L;;;;;N;;;;; A85F;PHAGS-PA LETTER U;Lo;0;L;;;;;N;;;;; A860;PHAGS-PA LETTER E;Lo;0;L;;;;;N;;;;; A861;PHAGS-PA LETTER O;Lo;0;L;;;;;N;;;;; A862;PHAGS-PA LETTER QA;Lo;0;L;;;;;N;;;;; A863;PHAGS-PA LETTER XA;Lo;0;L;;;;;N;;;;; A864;PHAGS-PA LETTER FA;Lo;0;L;;;;;N;;;;; A865;PHAGS-PA LETTER GGA;Lo;0;L;;;;;N;;;;; A866;PHAGS-PA LETTER EE;Lo;0;L;;;;;N;;;;; A867;PHAGS-PA SUBJOINED LETTER WA;Lo;0;L;;;;;N;;;;; A868;PHAGS-PA SUBJOINED LETTER YA;Lo;0;L;;;;;N;;;;; A869;PHAGS-PA LETTER TTA;Lo;0;L;;;;;N;;;;; A86A;PHAGS-PA LETTER TTHA;Lo;0;L;;;;;N;;;;; A86B;PHAGS-PA LETTER DDA;Lo;0;L;;;;;N;;;;; A86C;PHAGS-PA LETTER NNA;Lo;0;L;;;;;N;;;;; A86D;PHAGS-PA LETTER ALTERNATE YA;Lo;0;L;;;;;N;;;;; A86E;PHAGS-PA LETTER VOICELESS SHA;Lo;0;L;;;;;N;;;;; A86F;PHAGS-PA LETTER VOICED HA;Lo;0;L;;;;;N;;;;; A870;PHAGS-PA LETTER ASPIRATED FA;Lo;0;L;;;;;N;;;;; A871;PHAGS-PA SUBJOINED LETTER RA;Lo;0;L;;;;;N;;;;; A872;PHAGS-PA SUPERFIXED LETTER RA;Lo;0;L;;;;;N;;;;; A873;PHAGS-PA LETTER CANDRABINDU;Lo;0;L;;;;;N;;;;; A874;PHAGS-PA SINGLE HEAD MARK;Po;0;ON;;;;;N;;;;; A875;PHAGS-PA DOUBLE HEAD MARK;Po;0;ON;;;;;N;;;;; A876;PHAGS-PA MARK SHAD;Po;0;ON;;;;;N;;;;; A877;PHAGS-PA MARK DOUBLE SHAD;Po;0;ON;;;;;N;;;;; A880;SAURASHTRA SIGN ANUSVARA;Mc;0;L;;;;;N;;;;; A881;SAURASHTRA SIGN VISARGA;Mc;0;L;;;;;N;;;;; A882;SAURASHTRA LETTER A;Lo;0;L;;;;;N;;;;; A883;SAURASHTRA LETTER AA;Lo;0;L;;;;;N;;;;; A884;SAURASHTRA LETTER I;Lo;0;L;;;;;N;;;;; A885;SAURASHTRA LETTER II;Lo;0;L;;;;;N;;;;; A886;SAURASHTRA LETTER U;Lo;0;L;;;;;N;;;;; A887;SAURASHTRA LETTER UU;Lo;0;L;;;;;N;;;;; A888;SAURASHTRA LETTER VOCALIC R;Lo;0;L;;;;;N;;;;; A889;SAURASHTRA LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; A88A;SAURASHTRA LETTER VOCALIC L;Lo;0;L;;;;;N;;;;; A88B;SAURASHTRA LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;; A88C;SAURASHTRA LETTER E;Lo;0;L;;;;;N;;;;; A88D;SAURASHTRA LETTER EE;Lo;0;L;;;;;N;;;;; A88E;SAURASHTRA LETTER AI;Lo;0;L;;;;;N;;;;; A88F;SAURASHTRA LETTER O;Lo;0;L;;;;;N;;;;; A890;SAURASHTRA LETTER OO;Lo;0;L;;;;;N;;;;; A891;SAURASHTRA LETTER AU;Lo;0;L;;;;;N;;;;; A892;SAURASHTRA LETTER KA;Lo;0;L;;;;;N;;;;; A893;SAURASHTRA LETTER KHA;Lo;0;L;;;;;N;;;;; A894;SAURASHTRA LETTER GA;Lo;0;L;;;;;N;;;;; A895;SAURASHTRA LETTER GHA;Lo;0;L;;;;;N;;;;; A896;SAURASHTRA LETTER NGA;Lo;0;L;;;;;N;;;;; A897;SAURASHTRA LETTER CA;Lo;0;L;;;;;N;;;;; A898;SAURASHTRA LETTER CHA;Lo;0;L;;;;;N;;;;; A899;SAURASHTRA LETTER JA;Lo;0;L;;;;;N;;;;; A89A;SAURASHTRA LETTER JHA;Lo;0;L;;;;;N;;;;; A89B;SAURASHTRA LETTER NYA;Lo;0;L;;;;;N;;;;; A89C;SAURASHTRA LETTER TTA;Lo;0;L;;;;;N;;;;; A89D;SAURASHTRA LETTER TTHA;Lo;0;L;;;;;N;;;;; A89E;SAURASHTRA LETTER DDA;Lo;0;L;;;;;N;;;;; A89F;SAURASHTRA LETTER DDHA;Lo;0;L;;;;;N;;;;; A8A0;SAURASHTRA LETTER NNA;Lo;0;L;;;;;N;;;;; A8A1;SAURASHTRA LETTER TA;Lo;0;L;;;;;N;;;;; A8A2;SAURASHTRA LETTER THA;Lo;0;L;;;;;N;;;;; A8A3;SAURASHTRA LETTER DA;Lo;0;L;;;;;N;;;;; A8A4;SAURASHTRA LETTER DHA;Lo;0;L;;;;;N;;;;; A8A5;SAURASHTRA LETTER NA;Lo;0;L;;;;;N;;;;; A8A6;SAURASHTRA LETTER PA;Lo;0;L;;;;;N;;;;; A8A7;SAURASHTRA LETTER PHA;Lo;0;L;;;;;N;;;;; A8A8;SAURASHTRA LETTER BA;Lo;0;L;;;;;N;;;;; A8A9;SAURASHTRA LETTER BHA;Lo;0;L;;;;;N;;;;; A8AA;SAURASHTRA LETTER MA;Lo;0;L;;;;;N;;;;; A8AB;SAURASHTRA LETTER YA;Lo;0;L;;;;;N;;;;; A8AC;SAURASHTRA LETTER RA;Lo;0;L;;;;;N;;;;; A8AD;SAURASHTRA LETTER LA;Lo;0;L;;;;;N;;;;; A8AE;SAURASHTRA LETTER VA;Lo;0;L;;;;;N;;;;; A8AF;SAURASHTRA LETTER SHA;Lo;0;L;;;;;N;;;;; A8B0;SAURASHTRA LETTER SSA;Lo;0;L;;;;;N;;;;; A8B1;SAURASHTRA LETTER SA;Lo;0;L;;;;;N;;;;; A8B2;SAURASHTRA LETTER HA;Lo;0;L;;;;;N;;;;; A8B3;SAURASHTRA LETTER LLA;Lo;0;L;;;;;N;;;;; A8B4;SAURASHTRA CONSONANT SIGN HAARU;Mc;0;L;;;;;N;;;;; A8B5;SAURASHTRA VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; A8B6;SAURASHTRA VOWEL SIGN I;Mc;0;L;;;;;N;;;;; A8B7;SAURASHTRA VOWEL SIGN II;Mc;0;L;;;;;N;;;;; A8B8;SAURASHTRA VOWEL SIGN U;Mc;0;L;;;;;N;;;;; A8B9;SAURASHTRA VOWEL SIGN UU;Mc;0;L;;;;;N;;;;; A8BA;SAURASHTRA VOWEL SIGN VOCALIC R;Mc;0;L;;;;;N;;;;; A8BB;SAURASHTRA VOWEL SIGN VOCALIC RR;Mc;0;L;;;;;N;;;;; A8BC;SAURASHTRA VOWEL SIGN VOCALIC L;Mc;0;L;;;;;N;;;;; A8BD;SAURASHTRA VOWEL SIGN VOCALIC LL;Mc;0;L;;;;;N;;;;; A8BE;SAURASHTRA VOWEL SIGN E;Mc;0;L;;;;;N;;;;; A8BF;SAURASHTRA VOWEL SIGN EE;Mc;0;L;;;;;N;;;;; A8C0;SAURASHTRA VOWEL SIGN AI;Mc;0;L;;;;;N;;;;; A8C1;SAURASHTRA VOWEL SIGN O;Mc;0;L;;;;;N;;;;; A8C2;SAURASHTRA VOWEL SIGN OO;Mc;0;L;;;;;N;;;;; A8C3;SAURASHTRA VOWEL SIGN AU;Mc;0;L;;;;;N;;;;; A8C4;SAURASHTRA SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; A8CE;SAURASHTRA DANDA;Po;0;L;;;;;N;;;;; A8CF;SAURASHTRA DOUBLE DANDA;Po;0;L;;;;;N;;;;; A8D0;SAURASHTRA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; A8D1;SAURASHTRA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; A8D2;SAURASHTRA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; A8D3;SAURASHTRA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; A8D4;SAURASHTRA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; A8D5;SAURASHTRA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; A8D6;SAURASHTRA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; A8D7;SAURASHTRA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; A8D8;SAURASHTRA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; A8D9;SAURASHTRA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; A8E0;COMBINING DEVANAGARI DIGIT ZERO;Mn;230;NSM;;;;;N;;;;; A8E1;COMBINING DEVANAGARI DIGIT ONE;Mn;230;NSM;;;;;N;;;;; A8E2;COMBINING DEVANAGARI DIGIT TWO;Mn;230;NSM;;;;;N;;;;; A8E3;COMBINING DEVANAGARI DIGIT THREE;Mn;230;NSM;;;;;N;;;;; A8E4;COMBINING DEVANAGARI DIGIT FOUR;Mn;230;NSM;;;;;N;;;;; A8E5;COMBINING DEVANAGARI DIGIT FIVE;Mn;230;NSM;;;;;N;;;;; A8E6;COMBINING DEVANAGARI DIGIT SIX;Mn;230;NSM;;;;;N;;;;; A8E7;COMBINING DEVANAGARI DIGIT SEVEN;Mn;230;NSM;;;;;N;;;;; A8E8;COMBINING DEVANAGARI DIGIT EIGHT;Mn;230;NSM;;;;;N;;;;; A8E9;COMBINING DEVANAGARI DIGIT NINE;Mn;230;NSM;;;;;N;;;;; A8EA;COMBINING DEVANAGARI LETTER A;Mn;230;NSM;;;;;N;;;;; A8EB;COMBINING DEVANAGARI LETTER U;Mn;230;NSM;;;;;N;;;;; A8EC;COMBINING DEVANAGARI LETTER KA;Mn;230;NSM;;;;;N;;;;; A8ED;COMBINING DEVANAGARI LETTER NA;Mn;230;NSM;;;;;N;;;;; A8EE;COMBINING DEVANAGARI LETTER PA;Mn;230;NSM;;;;;N;;;;; A8EF;COMBINING DEVANAGARI LETTER RA;Mn;230;NSM;;;;;N;;;;; A8F0;COMBINING DEVANAGARI LETTER VI;Mn;230;NSM;;;;;N;;;;; A8F1;COMBINING DEVANAGARI SIGN AVAGRAHA;Mn;230;NSM;;;;;N;;;;; A8F2;DEVANAGARI SIGN SPACING CANDRABINDU;Lo;0;L;;;;;N;;;;; A8F3;DEVANAGARI SIGN CANDRABINDU VIRAMA;Lo;0;L;;;;;N;;;;; A8F4;DEVANAGARI SIGN DOUBLE CANDRABINDU VIRAMA;Lo;0;L;;;;;N;;;;; A8F5;DEVANAGARI SIGN CANDRABINDU TWO;Lo;0;L;;;;;N;;;;; A8F6;DEVANAGARI SIGN CANDRABINDU THREE;Lo;0;L;;;;;N;;;;; A8F7;DEVANAGARI SIGN CANDRABINDU AVAGRAHA;Lo;0;L;;;;;N;;;;; A8F8;DEVANAGARI SIGN PUSHPIKA;Po;0;L;;;;;N;;;;; A8F9;DEVANAGARI GAP FILLER;Po;0;L;;;;;N;;;;; A8FA;DEVANAGARI CARET;Po;0;L;;;;;N;;;;; A8FB;DEVANAGARI HEADSTROKE;Lo;0;L;;;;;N;;;;; A900;KAYAH LI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; A901;KAYAH LI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; A902;KAYAH LI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; A903;KAYAH LI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; A904;KAYAH LI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; A905;KAYAH LI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; A906;KAYAH LI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; A907;KAYAH LI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; A908;KAYAH LI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; A909;KAYAH LI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; A90A;KAYAH LI LETTER KA;Lo;0;L;;;;;N;;;;; A90B;KAYAH LI LETTER KHA;Lo;0;L;;;;;N;;;;; A90C;KAYAH LI LETTER GA;Lo;0;L;;;;;N;;;;; A90D;KAYAH LI LETTER NGA;Lo;0;L;;;;;N;;;;; A90E;KAYAH LI LETTER SA;Lo;0;L;;;;;N;;;;; A90F;KAYAH LI LETTER SHA;Lo;0;L;;;;;N;;;;; A910;KAYAH LI LETTER ZA;Lo;0;L;;;;;N;;;;; A911;KAYAH LI LETTER NYA;Lo;0;L;;;;;N;;;;; A912;KAYAH LI LETTER TA;Lo;0;L;;;;;N;;;;; A913;KAYAH LI LETTER HTA;Lo;0;L;;;;;N;;;;; A914;KAYAH LI LETTER NA;Lo;0;L;;;;;N;;;;; A915;KAYAH LI LETTER PA;Lo;0;L;;;;;N;;;;; A916;KAYAH LI LETTER PHA;Lo;0;L;;;;;N;;;;; A917;KAYAH LI LETTER MA;Lo;0;L;;;;;N;;;;; A918;KAYAH LI LETTER DA;Lo;0;L;;;;;N;;;;; A919;KAYAH LI LETTER BA;Lo;0;L;;;;;N;;;;; A91A;KAYAH LI LETTER RA;Lo;0;L;;;;;N;;;;; A91B;KAYAH LI LETTER YA;Lo;0;L;;;;;N;;;;; A91C;KAYAH LI LETTER LA;Lo;0;L;;;;;N;;;;; A91D;KAYAH LI LETTER WA;Lo;0;L;;;;;N;;;;; A91E;KAYAH LI LETTER THA;Lo;0;L;;;;;N;;;;; A91F;KAYAH LI LETTER HA;Lo;0;L;;;;;N;;;;; A920;KAYAH LI LETTER VA;Lo;0;L;;;;;N;;;;; A921;KAYAH LI LETTER CA;Lo;0;L;;;;;N;;;;; A922;KAYAH LI LETTER A;Lo;0;L;;;;;N;;;;; A923;KAYAH LI LETTER OE;Lo;0;L;;;;;N;;;;; A924;KAYAH LI LETTER I;Lo;0;L;;;;;N;;;;; A925;KAYAH LI LETTER OO;Lo;0;L;;;;;N;;;;; A926;KAYAH LI VOWEL UE;Mn;0;NSM;;;;;N;;;;; A927;KAYAH LI VOWEL E;Mn;0;NSM;;;;;N;;;;; A928;KAYAH LI VOWEL U;Mn;0;NSM;;;;;N;;;;; A929;KAYAH LI VOWEL EE;Mn;0;NSM;;;;;N;;;;; A92A;KAYAH LI VOWEL O;Mn;0;NSM;;;;;N;;;;; A92B;KAYAH LI TONE PLOPHU;Mn;220;NSM;;;;;N;;;;; A92C;KAYAH LI TONE CALYA;Mn;220;NSM;;;;;N;;;;; A92D;KAYAH LI TONE CALYA PLOPHU;Mn;220;NSM;;;;;N;;;;; A92E;KAYAH LI SIGN CWI;Po;0;L;;;;;N;;;;; A92F;KAYAH LI SIGN SHYA;Po;0;L;;;;;N;;;;; A930;REJANG LETTER KA;Lo;0;L;;;;;N;;;;; A931;REJANG LETTER GA;Lo;0;L;;;;;N;;;;; A932;REJANG LETTER NGA;Lo;0;L;;;;;N;;;;; A933;REJANG LETTER TA;Lo;0;L;;;;;N;;;;; A934;REJANG LETTER DA;Lo;0;L;;;;;N;;;;; A935;REJANG LETTER NA;Lo;0;L;;;;;N;;;;; A936;REJANG LETTER PA;Lo;0;L;;;;;N;;;;; A937;REJANG LETTER BA;Lo;0;L;;;;;N;;;;; A938;REJANG LETTER MA;Lo;0;L;;;;;N;;;;; A939;REJANG LETTER CA;Lo;0;L;;;;;N;;;;; A93A;REJANG LETTER JA;Lo;0;L;;;;;N;;;;; A93B;REJANG LETTER NYA;Lo;0;L;;;;;N;;;;; A93C;REJANG LETTER SA;Lo;0;L;;;;;N;;;;; A93D;REJANG LETTER RA;Lo;0;L;;;;;N;;;;; A93E;REJANG LETTER LA;Lo;0;L;;;;;N;;;;; A93F;REJANG LETTER YA;Lo;0;L;;;;;N;;;;; A940;REJANG LETTER WA;Lo;0;L;;;;;N;;;;; A941;REJANG LETTER HA;Lo;0;L;;;;;N;;;;; A942;REJANG LETTER MBA;Lo;0;L;;;;;N;;;;; A943;REJANG LETTER NGGA;Lo;0;L;;;;;N;;;;; A944;REJANG LETTER NDA;Lo;0;L;;;;;N;;;;; A945;REJANG LETTER NYJA;Lo;0;L;;;;;N;;;;; A946;REJANG LETTER A;Lo;0;L;;;;;N;;;;; A947;REJANG VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; A948;REJANG VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; A949;REJANG VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; A94A;REJANG VOWEL SIGN AI;Mn;0;NSM;;;;;N;;;;; A94B;REJANG VOWEL SIGN O;Mn;0;NSM;;;;;N;;;;; A94C;REJANG VOWEL SIGN AU;Mn;0;NSM;;;;;N;;;;; A94D;REJANG VOWEL SIGN EU;Mn;0;NSM;;;;;N;;;;; A94E;REJANG VOWEL SIGN EA;Mn;0;NSM;;;;;N;;;;; A94F;REJANG CONSONANT SIGN NG;Mn;0;NSM;;;;;N;;;;; A950;REJANG CONSONANT SIGN N;Mn;0;NSM;;;;;N;;;;; A951;REJANG CONSONANT SIGN R;Mn;0;NSM;;;;;N;;;;; A952;REJANG CONSONANT SIGN H;Mc;0;L;;;;;N;;;;; A953;REJANG VIRAMA;Mc;9;L;;;;;N;;;;; A95F;REJANG SECTION MARK;Po;0;L;;;;;N;;;;; A960;HANGUL CHOSEONG TIKEUT-MIEUM;Lo;0;L;;;;;N;;;;; A961;HANGUL CHOSEONG TIKEUT-PIEUP;Lo;0;L;;;;;N;;;;; A962;HANGUL CHOSEONG TIKEUT-SIOS;Lo;0;L;;;;;N;;;;; A963;HANGUL CHOSEONG TIKEUT-CIEUC;Lo;0;L;;;;;N;;;;; A964;HANGUL CHOSEONG RIEUL-KIYEOK;Lo;0;L;;;;;N;;;;; A965;HANGUL CHOSEONG RIEUL-SSANGKIYEOK;Lo;0;L;;;;;N;;;;; A966;HANGUL CHOSEONG RIEUL-TIKEUT;Lo;0;L;;;;;N;;;;; A967;HANGUL CHOSEONG RIEUL-SSANGTIKEUT;Lo;0;L;;;;;N;;;;; A968;HANGUL CHOSEONG RIEUL-MIEUM;Lo;0;L;;;;;N;;;;; A969;HANGUL CHOSEONG RIEUL-PIEUP;Lo;0;L;;;;;N;;;;; A96A;HANGUL CHOSEONG RIEUL-SSANGPIEUP;Lo;0;L;;;;;N;;;;; A96B;HANGUL CHOSEONG RIEUL-KAPYEOUNPIEUP;Lo;0;L;;;;;N;;;;; A96C;HANGUL CHOSEONG RIEUL-SIOS;Lo;0;L;;;;;N;;;;; A96D;HANGUL CHOSEONG RIEUL-CIEUC;Lo;0;L;;;;;N;;;;; A96E;HANGUL CHOSEONG RIEUL-KHIEUKH;Lo;0;L;;;;;N;;;;; A96F;HANGUL CHOSEONG MIEUM-KIYEOK;Lo;0;L;;;;;N;;;;; A970;HANGUL CHOSEONG MIEUM-TIKEUT;Lo;0;L;;;;;N;;;;; A971;HANGUL CHOSEONG MIEUM-SIOS;Lo;0;L;;;;;N;;;;; A972;HANGUL CHOSEONG PIEUP-SIOS-THIEUTH;Lo;0;L;;;;;N;;;;; A973;HANGUL CHOSEONG PIEUP-KHIEUKH;Lo;0;L;;;;;N;;;;; A974;HANGUL CHOSEONG PIEUP-HIEUH;Lo;0;L;;;;;N;;;;; A975;HANGUL CHOSEONG SSANGSIOS-PIEUP;Lo;0;L;;;;;N;;;;; A976;HANGUL CHOSEONG IEUNG-RIEUL;Lo;0;L;;;;;N;;;;; A977;HANGUL CHOSEONG IEUNG-HIEUH;Lo;0;L;;;;;N;;;;; A978;HANGUL CHOSEONG SSANGCIEUC-HIEUH;Lo;0;L;;;;;N;;;;; A979;HANGUL CHOSEONG SSANGTHIEUTH;Lo;0;L;;;;;N;;;;; A97A;HANGUL CHOSEONG PHIEUPH-HIEUH;Lo;0;L;;;;;N;;;;; A97B;HANGUL CHOSEONG HIEUH-SIOS;Lo;0;L;;;;;N;;;;; A97C;HANGUL CHOSEONG SSANGYEORINHIEUH;Lo;0;L;;;;;N;;;;; A980;JAVANESE SIGN PANYANGGA;Mn;0;NSM;;;;;N;;;;; A981;JAVANESE SIGN CECAK;Mn;0;NSM;;;;;N;;;;; A982;JAVANESE SIGN LAYAR;Mn;0;NSM;;;;;N;;;;; A983;JAVANESE SIGN WIGNYAN;Mc;0;L;;;;;N;;;;; A984;JAVANESE LETTER A;Lo;0;L;;;;;N;;;;; A985;JAVANESE LETTER I KAWI;Lo;0;L;;;;;N;;;;; A986;JAVANESE LETTER I;Lo;0;L;;;;;N;;;;; A987;JAVANESE LETTER II;Lo;0;L;;;;;N;;;;; A988;JAVANESE LETTER U;Lo;0;L;;;;;N;;;;; A989;JAVANESE LETTER PA CEREK;Lo;0;L;;;;;N;;;;; A98A;JAVANESE LETTER NGA LELET;Lo;0;L;;;;;N;;;;; A98B;JAVANESE LETTER NGA LELET RASWADI;Lo;0;L;;;;;N;;;;; A98C;JAVANESE LETTER E;Lo;0;L;;;;;N;;;;; A98D;JAVANESE LETTER AI;Lo;0;L;;;;;N;;;;; A98E;JAVANESE LETTER O;Lo;0;L;;;;;N;;;;; A98F;JAVANESE LETTER KA;Lo;0;L;;;;;N;;;;; A990;JAVANESE LETTER KA SASAK;Lo;0;L;;;;;N;;;;; A991;JAVANESE LETTER KA MURDA;Lo;0;L;;;;;N;;;;; A992;JAVANESE LETTER GA;Lo;0;L;;;;;N;;;;; A993;JAVANESE LETTER GA MURDA;Lo;0;L;;;;;N;;;;; A994;JAVANESE LETTER NGA;Lo;0;L;;;;;N;;;;; A995;JAVANESE LETTER CA;Lo;0;L;;;;;N;;;;; A996;JAVANESE LETTER CA MURDA;Lo;0;L;;;;;N;;;;; A997;JAVANESE LETTER JA;Lo;0;L;;;;;N;;;;; A998;JAVANESE LETTER NYA MURDA;Lo;0;L;;;;;N;;;;; A999;JAVANESE LETTER JA MAHAPRANA;Lo;0;L;;;;;N;;;;; A99A;JAVANESE LETTER NYA;Lo;0;L;;;;;N;;;;; A99B;JAVANESE LETTER TTA;Lo;0;L;;;;;N;;;;; A99C;JAVANESE LETTER TTA MAHAPRANA;Lo;0;L;;;;;N;;;;; A99D;JAVANESE LETTER DDA;Lo;0;L;;;;;N;;;;; A99E;JAVANESE LETTER DDA MAHAPRANA;Lo;0;L;;;;;N;;;;; A99F;JAVANESE LETTER NA MURDA;Lo;0;L;;;;;N;;;;; A9A0;JAVANESE LETTER TA;Lo;0;L;;;;;N;;;;; A9A1;JAVANESE LETTER TA MURDA;Lo;0;L;;;;;N;;;;; A9A2;JAVANESE LETTER DA;Lo;0;L;;;;;N;;;;; A9A3;JAVANESE LETTER DA MAHAPRANA;Lo;0;L;;;;;N;;;;; A9A4;JAVANESE LETTER NA;Lo;0;L;;;;;N;;;;; A9A5;JAVANESE LETTER PA;Lo;0;L;;;;;N;;;;; A9A6;JAVANESE LETTER PA MURDA;Lo;0;L;;;;;N;;;;; A9A7;JAVANESE LETTER BA;Lo;0;L;;;;;N;;;;; A9A8;JAVANESE LETTER BA MURDA;Lo;0;L;;;;;N;;;;; A9A9;JAVANESE LETTER MA;Lo;0;L;;;;;N;;;;; A9AA;JAVANESE LETTER YA;Lo;0;L;;;;;N;;;;; A9AB;JAVANESE LETTER RA;Lo;0;L;;;;;N;;;;; A9AC;JAVANESE LETTER RA AGUNG;Lo;0;L;;;;;N;;;;; A9AD;JAVANESE LETTER LA;Lo;0;L;;;;;N;;;;; A9AE;JAVANESE LETTER WA;Lo;0;L;;;;;N;;;;; A9AF;JAVANESE LETTER SA MURDA;Lo;0;L;;;;;N;;;;; A9B0;JAVANESE LETTER SA MAHAPRANA;Lo;0;L;;;;;N;;;;; A9B1;JAVANESE LETTER SA;Lo;0;L;;;;;N;;;;; A9B2;JAVANESE LETTER HA;Lo;0;L;;;;;N;;;;; A9B3;JAVANESE SIGN CECAK TELU;Mn;7;NSM;;;;;N;;;;; A9B4;JAVANESE VOWEL SIGN TARUNG;Mc;0;L;;;;;N;;;;; A9B5;JAVANESE VOWEL SIGN TOLONG;Mc;0;L;;;;;N;;;;; A9B6;JAVANESE VOWEL SIGN WULU;Mn;0;NSM;;;;;N;;;;; A9B7;JAVANESE VOWEL SIGN WULU MELIK;Mn;0;NSM;;;;;N;;;;; A9B8;JAVANESE VOWEL SIGN SUKU;Mn;0;NSM;;;;;N;;;;; A9B9;JAVANESE VOWEL SIGN SUKU MENDUT;Mn;0;NSM;;;;;N;;;;; A9BA;JAVANESE VOWEL SIGN TALING;Mc;0;L;;;;;N;;;;; A9BB;JAVANESE VOWEL SIGN DIRGA MURE;Mc;0;L;;;;;N;;;;; A9BC;JAVANESE VOWEL SIGN PEPET;Mn;0;NSM;;;;;N;;;;; A9BD;JAVANESE CONSONANT SIGN KERET;Mc;0;L;;;;;N;;;;; A9BE;JAVANESE CONSONANT SIGN PENGKAL;Mc;0;L;;;;;N;;;;; A9BF;JAVANESE CONSONANT SIGN CAKRA;Mc;0;L;;;;;N;;;;; A9C0;JAVANESE PANGKON;Mc;9;L;;;;;N;;;;; A9C1;JAVANESE LEFT RERENGGAN;Po;0;L;;;;;N;;;;; A9C2;JAVANESE RIGHT RERENGGAN;Po;0;L;;;;;N;;;;; A9C3;JAVANESE PADA ANDAP;Po;0;L;;;;;N;;;;; A9C4;JAVANESE PADA MADYA;Po;0;L;;;;;N;;;;; A9C5;JAVANESE PADA LUHUR;Po;0;L;;;;;N;;;;; A9C6;JAVANESE PADA WINDU;Po;0;L;;;;;N;;;;; A9C7;JAVANESE PADA PANGKAT;Po;0;L;;;;;N;;;;; A9C8;JAVANESE PADA LINGSA;Po;0;L;;;;;N;;;;; A9C9;JAVANESE PADA LUNGSI;Po;0;L;;;;;N;;;;; A9CA;JAVANESE PADA ADEG;Po;0;L;;;;;N;;;;; A9CB;JAVANESE PADA ADEG ADEG;Po;0;L;;;;;N;;;;; A9CC;JAVANESE PADA PISELEH;Po;0;L;;;;;N;;;;; A9CD;JAVANESE TURNED PADA PISELEH;Po;0;L;;;;;N;;;;; A9CF;JAVANESE PANGRANGKEP;Lm;0;L;;;;;N;;;;; A9D0;JAVANESE DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; A9D1;JAVANESE DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; A9D2;JAVANESE DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; A9D3;JAVANESE DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; A9D4;JAVANESE DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; A9D5;JAVANESE DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; A9D6;JAVANESE DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; A9D7;JAVANESE DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; A9D8;JAVANESE DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; A9D9;JAVANESE DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; A9DE;JAVANESE PADA TIRTA TUMETES;Po;0;L;;;;;N;;;;; A9DF;JAVANESE PADA ISEN-ISEN;Po;0;L;;;;;N;;;;; AA00;CHAM LETTER A;Lo;0;L;;;;;N;;;;; AA01;CHAM LETTER I;Lo;0;L;;;;;N;;;;; AA02;CHAM LETTER U;Lo;0;L;;;;;N;;;;; AA03;CHAM LETTER E;Lo;0;L;;;;;N;;;;; AA04;CHAM LETTER AI;Lo;0;L;;;;;N;;;;; AA05;CHAM LETTER O;Lo;0;L;;;;;N;;;;; AA06;CHAM LETTER KA;Lo;0;L;;;;;N;;;;; AA07;CHAM LETTER KHA;Lo;0;L;;;;;N;;;;; AA08;CHAM LETTER GA;Lo;0;L;;;;;N;;;;; AA09;CHAM LETTER GHA;Lo;0;L;;;;;N;;;;; AA0A;CHAM LETTER NGUE;Lo;0;L;;;;;N;;;;; AA0B;CHAM LETTER NGA;Lo;0;L;;;;;N;;;;; AA0C;CHAM LETTER CHA;Lo;0;L;;;;;N;;;;; AA0D;CHAM LETTER CHHA;Lo;0;L;;;;;N;;;;; AA0E;CHAM LETTER JA;Lo;0;L;;;;;N;;;;; AA0F;CHAM LETTER JHA;Lo;0;L;;;;;N;;;;; AA10;CHAM LETTER NHUE;Lo;0;L;;;;;N;;;;; AA11;CHAM LETTER NHA;Lo;0;L;;;;;N;;;;; AA12;CHAM LETTER NHJA;Lo;0;L;;;;;N;;;;; AA13;CHAM LETTER TA;Lo;0;L;;;;;N;;;;; AA14;CHAM LETTER THA;Lo;0;L;;;;;N;;;;; AA15;CHAM LETTER DA;Lo;0;L;;;;;N;;;;; AA16;CHAM LETTER DHA;Lo;0;L;;;;;N;;;;; AA17;CHAM LETTER NUE;Lo;0;L;;;;;N;;;;; AA18;CHAM LETTER NA;Lo;0;L;;;;;N;;;;; AA19;CHAM LETTER DDA;Lo;0;L;;;;;N;;;;; AA1A;CHAM LETTER PA;Lo;0;L;;;;;N;;;;; AA1B;CHAM LETTER PPA;Lo;0;L;;;;;N;;;;; AA1C;CHAM LETTER PHA;Lo;0;L;;;;;N;;;;; AA1D;CHAM LETTER BA;Lo;0;L;;;;;N;;;;; AA1E;CHAM LETTER BHA;Lo;0;L;;;;;N;;;;; AA1F;CHAM LETTER MUE;Lo;0;L;;;;;N;;;;; AA20;CHAM LETTER MA;Lo;0;L;;;;;N;;;;; AA21;CHAM LETTER BBA;Lo;0;L;;;;;N;;;;; AA22;CHAM LETTER YA;Lo;0;L;;;;;N;;;;; AA23;CHAM LETTER RA;Lo;0;L;;;;;N;;;;; AA24;CHAM LETTER LA;Lo;0;L;;;;;N;;;;; AA25;CHAM LETTER VA;Lo;0;L;;;;;N;;;;; AA26;CHAM LETTER SSA;Lo;0;L;;;;;N;;;;; AA27;CHAM LETTER SA;Lo;0;L;;;;;N;;;;; AA28;CHAM LETTER HA;Lo;0;L;;;;;N;;;;; AA29;CHAM VOWEL SIGN AA;Mn;0;NSM;;;;;N;;;;; AA2A;CHAM VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; AA2B;CHAM VOWEL SIGN II;Mn;0;NSM;;;;;N;;;;; AA2C;CHAM VOWEL SIGN EI;Mn;0;NSM;;;;;N;;;;; AA2D;CHAM VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; AA2E;CHAM VOWEL SIGN OE;Mn;0;NSM;;;;;N;;;;; AA2F;CHAM VOWEL SIGN O;Mc;0;L;;;;;N;;;;; AA30;CHAM VOWEL SIGN AI;Mc;0;L;;;;;N;;;;; AA31;CHAM VOWEL SIGN AU;Mn;0;NSM;;;;;N;;;;; AA32;CHAM VOWEL SIGN UE;Mn;0;NSM;;;;;N;;;;; AA33;CHAM CONSONANT SIGN YA;Mc;0;L;;;;;N;;;;; AA34;CHAM CONSONANT SIGN RA;Mc;0;L;;;;;N;;;;; AA35;CHAM CONSONANT SIGN LA;Mn;0;NSM;;;;;N;;;;; AA36;CHAM CONSONANT SIGN WA;Mn;0;NSM;;;;;N;;;;; AA40;CHAM LETTER FINAL K;Lo;0;L;;;;;N;;;;; AA41;CHAM LETTER FINAL G;Lo;0;L;;;;;N;;;;; AA42;CHAM LETTER FINAL NG;Lo;0;L;;;;;N;;;;; AA43;CHAM CONSONANT SIGN FINAL NG;Mn;0;NSM;;;;;N;;;;; AA44;CHAM LETTER FINAL CH;Lo;0;L;;;;;N;;;;; AA45;CHAM LETTER FINAL T;Lo;0;L;;;;;N;;;;; AA46;CHAM LETTER FINAL N;Lo;0;L;;;;;N;;;;; AA47;CHAM LETTER FINAL P;Lo;0;L;;;;;N;;;;; AA48;CHAM LETTER FINAL Y;Lo;0;L;;;;;N;;;;; AA49;CHAM LETTER FINAL R;Lo;0;L;;;;;N;;;;; AA4A;CHAM LETTER FINAL L;Lo;0;L;;;;;N;;;;; AA4B;CHAM LETTER FINAL SS;Lo;0;L;;;;;N;;;;; AA4C;CHAM CONSONANT SIGN FINAL M;Mn;0;NSM;;;;;N;;;;; AA4D;CHAM CONSONANT SIGN FINAL H;Mc;0;L;;;;;N;;;;; AA50;CHAM DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; AA51;CHAM DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; AA52;CHAM DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; AA53;CHAM DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; AA54;CHAM DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; AA55;CHAM DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; AA56;CHAM DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; AA57;CHAM DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; AA58;CHAM DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; AA59;CHAM DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; AA5C;CHAM PUNCTUATION SPIRAL;Po;0;L;;;;;N;;;;; AA5D;CHAM PUNCTUATION DANDA;Po;0;L;;;;;N;;;;; AA5E;CHAM PUNCTUATION DOUBLE DANDA;Po;0;L;;;;;N;;;;; AA5F;CHAM PUNCTUATION TRIPLE DANDA;Po;0;L;;;;;N;;;;; AA60;MYANMAR LETTER KHAMTI GA;Lo;0;L;;;;;N;;;;; AA61;MYANMAR LETTER KHAMTI CA;Lo;0;L;;;;;N;;;;; AA62;MYANMAR LETTER KHAMTI CHA;Lo;0;L;;;;;N;;;;; AA63;MYANMAR LETTER KHAMTI JA;Lo;0;L;;;;;N;;;;; AA64;MYANMAR LETTER KHAMTI JHA;Lo;0;L;;;;;N;;;;; AA65;MYANMAR LETTER KHAMTI NYA;Lo;0;L;;;;;N;;;;; AA66;MYANMAR LETTER KHAMTI TTA;Lo;0;L;;;;;N;;;;; AA67;MYANMAR LETTER KHAMTI TTHA;Lo;0;L;;;;;N;;;;; AA68;MYANMAR LETTER KHAMTI DDA;Lo;0;L;;;;;N;;;;; AA69;MYANMAR LETTER KHAMTI DDHA;Lo;0;L;;;;;N;;;;; AA6A;MYANMAR LETTER KHAMTI DHA;Lo;0;L;;;;;N;;;;; AA6B;MYANMAR LETTER KHAMTI NA;Lo;0;L;;;;;N;;;;; AA6C;MYANMAR LETTER KHAMTI SA;Lo;0;L;;;;;N;;;;; AA6D;MYANMAR LETTER KHAMTI HA;Lo;0;L;;;;;N;;;;; AA6E;MYANMAR LETTER KHAMTI HHA;Lo;0;L;;;;;N;;;;; AA6F;MYANMAR LETTER KHAMTI FA;Lo;0;L;;;;;N;;;;; AA70;MYANMAR MODIFIER LETTER KHAMTI REDUPLICATION;Lm;0;L;;;;;N;;;;; AA71;MYANMAR LETTER KHAMTI XA;Lo;0;L;;;;;N;;;;; AA72;MYANMAR LETTER KHAMTI ZA;Lo;0;L;;;;;N;;;;; AA73;MYANMAR LETTER KHAMTI RA;Lo;0;L;;;;;N;;;;; AA74;MYANMAR LOGOGRAM KHAMTI OAY;Lo;0;L;;;;;N;;;;; AA75;MYANMAR LOGOGRAM KHAMTI QN;Lo;0;L;;;;;N;;;;; AA76;MYANMAR LOGOGRAM KHAMTI HM;Lo;0;L;;;;;N;;;;; AA77;MYANMAR SYMBOL AITON EXCLAMATION;So;0;L;;;;;N;;;;; AA78;MYANMAR SYMBOL AITON ONE;So;0;L;;;;;N;;;;; AA79;MYANMAR SYMBOL AITON TWO;So;0;L;;;;;N;;;;; AA7A;MYANMAR LETTER AITON RA;Lo;0;L;;;;;N;;;;; AA7B;MYANMAR SIGN PAO KAREN TONE;Mc;0;L;;;;;N;;;;; AA80;TAI VIET LETTER LOW KO;Lo;0;L;;;;;N;;;;; AA81;TAI VIET LETTER HIGH KO;Lo;0;L;;;;;N;;;;; AA82;TAI VIET LETTER LOW KHO;Lo;0;L;;;;;N;;;;; AA83;TAI VIET LETTER HIGH KHO;Lo;0;L;;;;;N;;;;; AA84;TAI VIET LETTER LOW KHHO;Lo;0;L;;;;;N;;;;; AA85;TAI VIET LETTER HIGH KHHO;Lo;0;L;;;;;N;;;;; AA86;TAI VIET LETTER LOW GO;Lo;0;L;;;;;N;;;;; AA87;TAI VIET LETTER HIGH GO;Lo;0;L;;;;;N;;;;; AA88;TAI VIET LETTER LOW NGO;Lo;0;L;;;;;N;;;;; AA89;TAI VIET LETTER HIGH NGO;Lo;0;L;;;;;N;;;;; AA8A;TAI VIET LETTER LOW CO;Lo;0;L;;;;;N;;;;; AA8B;TAI VIET LETTER HIGH CO;Lo;0;L;;;;;N;;;;; AA8C;TAI VIET LETTER LOW CHO;Lo;0;L;;;;;N;;;;; AA8D;TAI VIET LETTER HIGH CHO;Lo;0;L;;;;;N;;;;; AA8E;TAI VIET LETTER LOW SO;Lo;0;L;;;;;N;;;;; AA8F;TAI VIET LETTER HIGH SO;Lo;0;L;;;;;N;;;;; AA90;TAI VIET LETTER LOW NYO;Lo;0;L;;;;;N;;;;; AA91;TAI VIET LETTER HIGH NYO;Lo;0;L;;;;;N;;;;; AA92;TAI VIET LETTER LOW DO;Lo;0;L;;;;;N;;;;; AA93;TAI VIET LETTER HIGH DO;Lo;0;L;;;;;N;;;;; AA94;TAI VIET LETTER LOW TO;Lo;0;L;;;;;N;;;;; AA95;TAI VIET LETTER HIGH TO;Lo;0;L;;;;;N;;;;; AA96;TAI VIET LETTER LOW THO;Lo;0;L;;;;;N;;;;; AA97;TAI VIET LETTER HIGH THO;Lo;0;L;;;;;N;;;;; AA98;TAI VIET LETTER LOW NO;Lo;0;L;;;;;N;;;;; AA99;TAI VIET LETTER HIGH NO;Lo;0;L;;;;;N;;;;; AA9A;TAI VIET LETTER LOW BO;Lo;0;L;;;;;N;;;;; AA9B;TAI VIET LETTER HIGH BO;Lo;0;L;;;;;N;;;;; AA9C;TAI VIET LETTER LOW PO;Lo;0;L;;;;;N;;;;; AA9D;TAI VIET LETTER HIGH PO;Lo;0;L;;;;;N;;;;; AA9E;TAI VIET LETTER LOW PHO;Lo;0;L;;;;;N;;;;; AA9F;TAI VIET LETTER HIGH PHO;Lo;0;L;;;;;N;;;;; AAA0;TAI VIET LETTER LOW FO;Lo;0;L;;;;;N;;;;; AAA1;TAI VIET LETTER HIGH FO;Lo;0;L;;;;;N;;;;; AAA2;TAI VIET LETTER LOW MO;Lo;0;L;;;;;N;;;;; AAA3;TAI VIET LETTER HIGH MO;Lo;0;L;;;;;N;;;;; AAA4;TAI VIET LETTER LOW YO;Lo;0;L;;;;;N;;;;; AAA5;TAI VIET LETTER HIGH YO;Lo;0;L;;;;;N;;;;; AAA6;TAI VIET LETTER LOW RO;Lo;0;L;;;;;N;;;;; AAA7;TAI VIET LETTER HIGH RO;Lo;0;L;;;;;N;;;;; AAA8;TAI VIET LETTER LOW LO;Lo;0;L;;;;;N;;;;; AAA9;TAI VIET LETTER HIGH LO;Lo;0;L;;;;;N;;;;; AAAA;TAI VIET LETTER LOW VO;Lo;0;L;;;;;N;;;;; AAAB;TAI VIET LETTER HIGH VO;Lo;0;L;;;;;N;;;;; AAAC;TAI VIET LETTER LOW HO;Lo;0;L;;;;;N;;;;; AAAD;TAI VIET LETTER HIGH HO;Lo;0;L;;;;;N;;;;; AAAE;TAI VIET LETTER LOW O;Lo;0;L;;;;;N;;;;; AAAF;TAI VIET LETTER HIGH O;Lo;0;L;;;;;N;;;;; AAB0;TAI VIET MAI KANG;Mn;230;NSM;;;;;N;;;;; AAB1;TAI VIET VOWEL AA;Lo;0;L;;;;;N;;;;; AAB2;TAI VIET VOWEL I;Mn;230;NSM;;;;;N;;;;; AAB3;TAI VIET VOWEL UE;Mn;230;NSM;;;;;N;;;;; AAB4;TAI VIET VOWEL U;Mn;220;NSM;;;;;N;;;;; AAB5;TAI VIET VOWEL E;Lo;0;L;;;;;N;;;;; AAB6;TAI VIET VOWEL O;Lo;0;L;;;;;N;;;;; AAB7;TAI VIET MAI KHIT;Mn;230;NSM;;;;;N;;;;; AAB8;TAI VIET VOWEL IA;Mn;230;NSM;;;;;N;;;;; AAB9;TAI VIET VOWEL UEA;Lo;0;L;;;;;N;;;;; AABA;TAI VIET VOWEL UA;Lo;0;L;;;;;N;;;;; AABB;TAI VIET VOWEL AUE;Lo;0;L;;;;;N;;;;; AABC;TAI VIET VOWEL AY;Lo;0;L;;;;;N;;;;; AABD;TAI VIET VOWEL AN;Lo;0;L;;;;;N;;;;; AABE;TAI VIET VOWEL AM;Mn;230;NSM;;;;;N;;;;; AABF;TAI VIET TONE MAI EK;Mn;230;NSM;;;;;N;;;;; AAC0;TAI VIET TONE MAI NUENG;Lo;0;L;;;;;N;;;;; AAC1;TAI VIET TONE MAI THO;Mn;230;NSM;;;;;N;;;;; AAC2;TAI VIET TONE MAI SONG;Lo;0;L;;;;;N;;;;; AADB;TAI VIET SYMBOL KON;Lo;0;L;;;;;N;;;;; AADC;TAI VIET SYMBOL NUENG;Lo;0;L;;;;;N;;;;; AADD;TAI VIET SYMBOL SAM;Lm;0;L;;;;;N;;;;; AADE;TAI VIET SYMBOL HO HOI;Po;0;L;;;;;N;;;;; AADF;TAI VIET SYMBOL KOI KOI;Po;0;L;;;;;N;;;;; AAE0;MEETEI MAYEK LETTER E;Lo;0;L;;;;;N;;;;; AAE1;MEETEI MAYEK LETTER O;Lo;0;L;;;;;N;;;;; AAE2;MEETEI MAYEK LETTER CHA;Lo;0;L;;;;;N;;;;; AAE3;MEETEI MAYEK LETTER NYA;Lo;0;L;;;;;N;;;;; AAE4;MEETEI MAYEK LETTER TTA;Lo;0;L;;;;;N;;;;; AAE5;MEETEI MAYEK LETTER TTHA;Lo;0;L;;;;;N;;;;; AAE6;MEETEI MAYEK LETTER DDA;Lo;0;L;;;;;N;;;;; AAE7;MEETEI MAYEK LETTER DDHA;Lo;0;L;;;;;N;;;;; AAE8;MEETEI MAYEK LETTER NNA;Lo;0;L;;;;;N;;;;; AAE9;MEETEI MAYEK LETTER SHA;Lo;0;L;;;;;N;;;;; AAEA;MEETEI MAYEK LETTER SSA;Lo;0;L;;;;;N;;;;; AAEB;MEETEI MAYEK VOWEL SIGN II;Mc;0;L;;;;;N;;;;; AAEC;MEETEI MAYEK VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; AAED;MEETEI MAYEK VOWEL SIGN AAI;Mn;0;NSM;;;;;N;;;;; AAEE;MEETEI MAYEK VOWEL SIGN AU;Mc;0;L;;;;;N;;;;; AAEF;MEETEI MAYEK VOWEL SIGN AAU;Mc;0;L;;;;;N;;;;; AAF0;MEETEI MAYEK CHEIKHAN;Po;0;L;;;;;N;;;;; AAF1;MEETEI MAYEK AHANG KHUDAM;Po;0;L;;;;;N;;;;; AAF2;MEETEI MAYEK ANJI;Lo;0;L;;;;;N;;;;; AAF3;MEETEI MAYEK SYLLABLE REPETITION MARK;Lm;0;L;;;;;N;;;;; AAF4;MEETEI MAYEK WORD REPETITION MARK;Lm;0;L;;;;;N;;;;; AAF5;MEETEI MAYEK VOWEL SIGN VISARGA;Mc;0;L;;;;;N;;;;; AAF6;MEETEI MAYEK VIRAMA;Mn;9;NSM;;;;;N;;;;; AB01;ETHIOPIC SYLLABLE TTHU;Lo;0;L;;;;;N;;;;; AB02;ETHIOPIC SYLLABLE TTHI;Lo;0;L;;;;;N;;;;; AB03;ETHIOPIC SYLLABLE TTHAA;Lo;0;L;;;;;N;;;;; AB04;ETHIOPIC SYLLABLE TTHEE;Lo;0;L;;;;;N;;;;; AB05;ETHIOPIC SYLLABLE TTHE;Lo;0;L;;;;;N;;;;; AB06;ETHIOPIC SYLLABLE TTHO;Lo;0;L;;;;;N;;;;; AB09;ETHIOPIC SYLLABLE DDHU;Lo;0;L;;;;;N;;;;; AB0A;ETHIOPIC SYLLABLE DDHI;Lo;0;L;;;;;N;;;;; AB0B;ETHIOPIC SYLLABLE DDHAA;Lo;0;L;;;;;N;;;;; AB0C;ETHIOPIC SYLLABLE DDHEE;Lo;0;L;;;;;N;;;;; AB0D;ETHIOPIC SYLLABLE DDHE;Lo;0;L;;;;;N;;;;; AB0E;ETHIOPIC SYLLABLE DDHO;Lo;0;L;;;;;N;;;;; AB11;ETHIOPIC SYLLABLE DZU;Lo;0;L;;;;;N;;;;; AB12;ETHIOPIC SYLLABLE DZI;Lo;0;L;;;;;N;;;;; AB13;ETHIOPIC SYLLABLE DZAA;Lo;0;L;;;;;N;;;;; AB14;ETHIOPIC SYLLABLE DZEE;Lo;0;L;;;;;N;;;;; AB15;ETHIOPIC SYLLABLE DZE;Lo;0;L;;;;;N;;;;; AB16;ETHIOPIC SYLLABLE DZO;Lo;0;L;;;;;N;;;;; AB20;ETHIOPIC SYLLABLE CCHHA;Lo;0;L;;;;;N;;;;; AB21;ETHIOPIC SYLLABLE CCHHU;Lo;0;L;;;;;N;;;;; AB22;ETHIOPIC SYLLABLE CCHHI;Lo;0;L;;;;;N;;;;; AB23;ETHIOPIC SYLLABLE CCHHAA;Lo;0;L;;;;;N;;;;; AB24;ETHIOPIC SYLLABLE CCHHEE;Lo;0;L;;;;;N;;;;; AB25;ETHIOPIC SYLLABLE CCHHE;Lo;0;L;;;;;N;;;;; AB26;ETHIOPIC SYLLABLE CCHHO;Lo;0;L;;;;;N;;;;; AB28;ETHIOPIC SYLLABLE BBA;Lo;0;L;;;;;N;;;;; AB29;ETHIOPIC SYLLABLE BBU;Lo;0;L;;;;;N;;;;; AB2A;ETHIOPIC SYLLABLE BBI;Lo;0;L;;;;;N;;;;; AB2B;ETHIOPIC SYLLABLE BBAA;Lo;0;L;;;;;N;;;;; AB2C;ETHIOPIC SYLLABLE BBEE;Lo;0;L;;;;;N;;;;; AB2D;ETHIOPIC SYLLABLE BBE;Lo;0;L;;;;;N;;;;; AB2E;ETHIOPIC SYLLABLE BBO;Lo;0;L;;;;;N;;;;; ABC0;MEETEI MAYEK LETTER KOK;Lo;0;L;;;;;N;;;;; ABC1;MEETEI MAYEK LETTER SAM;Lo;0;L;;;;;N;;;;; ABC2;MEETEI MAYEK LETTER LAI;Lo;0;L;;;;;N;;;;; ABC3;MEETEI MAYEK LETTER MIT;Lo;0;L;;;;;N;;;;; ABC4;MEETEI MAYEK LETTER PA;Lo;0;L;;;;;N;;;;; ABC5;MEETEI MAYEK LETTER NA;Lo;0;L;;;;;N;;;;; ABC6;MEETEI MAYEK LETTER CHIL;Lo;0;L;;;;;N;;;;; ABC7;MEETEI MAYEK LETTER TIL;Lo;0;L;;;;;N;;;;; ABC8;MEETEI MAYEK LETTER KHOU;Lo;0;L;;;;;N;;;;; ABC9;MEETEI MAYEK LETTER NGOU;Lo;0;L;;;;;N;;;;; ABCA;MEETEI MAYEK LETTER THOU;Lo;0;L;;;;;N;;;;; ABCB;MEETEI MAYEK LETTER WAI;Lo;0;L;;;;;N;;;;; ABCC;MEETEI MAYEK LETTER YANG;Lo;0;L;;;;;N;;;;; ABCD;MEETEI MAYEK LETTER HUK;Lo;0;L;;;;;N;;;;; ABCE;MEETEI MAYEK LETTER UN;Lo;0;L;;;;;N;;;;; ABCF;MEETEI MAYEK LETTER I;Lo;0;L;;;;;N;;;;; ABD0;MEETEI MAYEK LETTER PHAM;Lo;0;L;;;;;N;;;;; ABD1;MEETEI MAYEK LETTER ATIYA;Lo;0;L;;;;;N;;;;; ABD2;MEETEI MAYEK LETTER GOK;Lo;0;L;;;;;N;;;;; ABD3;MEETEI MAYEK LETTER JHAM;Lo;0;L;;;;;N;;;;; ABD4;MEETEI MAYEK LETTER RAI;Lo;0;L;;;;;N;;;;; ABD5;MEETEI MAYEK LETTER BA;Lo;0;L;;;;;N;;;;; ABD6;MEETEI MAYEK LETTER JIL;Lo;0;L;;;;;N;;;;; ABD7;MEETEI MAYEK LETTER DIL;Lo;0;L;;;;;N;;;;; ABD8;MEETEI MAYEK LETTER GHOU;Lo;0;L;;;;;N;;;;; ABD9;MEETEI MAYEK LETTER DHOU;Lo;0;L;;;;;N;;;;; ABDA;MEETEI MAYEK LETTER BHAM;Lo;0;L;;;;;N;;;;; ABDB;MEETEI MAYEK LETTER KOK LONSUM;Lo;0;L;;;;;N;;;;; ABDC;MEETEI MAYEK LETTER LAI LONSUM;Lo;0;L;;;;;N;;;;; ABDD;MEETEI MAYEK LETTER MIT LONSUM;Lo;0;L;;;;;N;;;;; ABDE;MEETEI MAYEK LETTER PA LONSUM;Lo;0;L;;;;;N;;;;; ABDF;MEETEI MAYEK LETTER NA LONSUM;Lo;0;L;;;;;N;;;;; ABE0;MEETEI MAYEK LETTER TIL LONSUM;Lo;0;L;;;;;N;;;;; ABE1;MEETEI MAYEK LETTER NGOU LONSUM;Lo;0;L;;;;;N;;;;; ABE2;MEETEI MAYEK LETTER I LONSUM;Lo;0;L;;;;;N;;;;; ABE3;MEETEI MAYEK VOWEL SIGN ONAP;Mc;0;L;;;;;N;;;;; ABE4;MEETEI MAYEK VOWEL SIGN INAP;Mc;0;L;;;;;N;;;;; ABE5;MEETEI MAYEK VOWEL SIGN ANAP;Mn;0;NSM;;;;;N;;;;; ABE6;MEETEI MAYEK VOWEL SIGN YENAP;Mc;0;L;;;;;N;;;;; ABE7;MEETEI MAYEK VOWEL SIGN SOUNAP;Mc;0;L;;;;;N;;;;; ABE8;MEETEI MAYEK VOWEL SIGN UNAP;Mn;0;NSM;;;;;N;;;;; ABE9;MEETEI MAYEK VOWEL SIGN CHEINAP;Mc;0;L;;;;;N;;;;; ABEA;MEETEI MAYEK VOWEL SIGN NUNG;Mc;0;L;;;;;N;;;;; ABEB;MEETEI MAYEK CHEIKHEI;Po;0;L;;;;;N;;;;; ABEC;MEETEI MAYEK LUM IYEK;Mc;0;L;;;;;N;;;;; ABED;MEETEI MAYEK APUN IYEK;Mn;9;NSM;;;;;N;;;;; ABF0;MEETEI MAYEK DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; ABF1;MEETEI MAYEK DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; ABF2;MEETEI MAYEK DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; ABF3;MEETEI MAYEK DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; ABF4;MEETEI MAYEK DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; ABF5;MEETEI MAYEK DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; ABF6;MEETEI MAYEK DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; ABF7;MEETEI MAYEK DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; ABF8;MEETEI MAYEK DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; ABF9;MEETEI MAYEK DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; AC00;;Lo;0;L;;;;;N;;;;; D7A3;;Lo;0;L;;;;;N;;;;; D7B0;HANGUL JUNGSEONG O-YEO;Lo;0;L;;;;;N;;;;; D7B1;HANGUL JUNGSEONG O-O-I;Lo;0;L;;;;;N;;;;; D7B2;HANGUL JUNGSEONG YO-A;Lo;0;L;;;;;N;;;;; D7B3;HANGUL JUNGSEONG YO-AE;Lo;0;L;;;;;N;;;;; D7B4;HANGUL JUNGSEONG YO-EO;Lo;0;L;;;;;N;;;;; D7B5;HANGUL JUNGSEONG U-YEO;Lo;0;L;;;;;N;;;;; D7B6;HANGUL JUNGSEONG U-I-I;Lo;0;L;;;;;N;;;;; D7B7;HANGUL JUNGSEONG YU-AE;Lo;0;L;;;;;N;;;;; D7B8;HANGUL JUNGSEONG YU-O;Lo;0;L;;;;;N;;;;; D7B9;HANGUL JUNGSEONG EU-A;Lo;0;L;;;;;N;;;;; D7BA;HANGUL JUNGSEONG EU-EO;Lo;0;L;;;;;N;;;;; D7BB;HANGUL JUNGSEONG EU-E;Lo;0;L;;;;;N;;;;; D7BC;HANGUL JUNGSEONG EU-O;Lo;0;L;;;;;N;;;;; D7BD;HANGUL JUNGSEONG I-YA-O;Lo;0;L;;;;;N;;;;; D7BE;HANGUL JUNGSEONG I-YAE;Lo;0;L;;;;;N;;;;; D7BF;HANGUL JUNGSEONG I-YEO;Lo;0;L;;;;;N;;;;; D7C0;HANGUL JUNGSEONG I-YE;Lo;0;L;;;;;N;;;;; D7C1;HANGUL JUNGSEONG I-O-I;Lo;0;L;;;;;N;;;;; D7C2;HANGUL JUNGSEONG I-YO;Lo;0;L;;;;;N;;;;; D7C3;HANGUL JUNGSEONG I-YU;Lo;0;L;;;;;N;;;;; D7C4;HANGUL JUNGSEONG I-I;Lo;0;L;;;;;N;;;;; D7C5;HANGUL JUNGSEONG ARAEA-A;Lo;0;L;;;;;N;;;;; D7C6;HANGUL JUNGSEONG ARAEA-E;Lo;0;L;;;;;N;;;;; D7CB;HANGUL JONGSEONG NIEUN-RIEUL;Lo;0;L;;;;;N;;;;; D7CC;HANGUL JONGSEONG NIEUN-CHIEUCH;Lo;0;L;;;;;N;;;;; D7CD;HANGUL JONGSEONG SSANGTIKEUT;Lo;0;L;;;;;N;;;;; D7CE;HANGUL JONGSEONG SSANGTIKEUT-PIEUP;Lo;0;L;;;;;N;;;;; D7CF;HANGUL JONGSEONG TIKEUT-PIEUP;Lo;0;L;;;;;N;;;;; D7D0;HANGUL JONGSEONG TIKEUT-SIOS;Lo;0;L;;;;;N;;;;; D7D1;HANGUL JONGSEONG TIKEUT-SIOS-KIYEOK;Lo;0;L;;;;;N;;;;; D7D2;HANGUL JONGSEONG TIKEUT-CIEUC;Lo;0;L;;;;;N;;;;; D7D3;HANGUL JONGSEONG TIKEUT-CHIEUCH;Lo;0;L;;;;;N;;;;; D7D4;HANGUL JONGSEONG TIKEUT-THIEUTH;Lo;0;L;;;;;N;;;;; D7D5;HANGUL JONGSEONG RIEUL-SSANGKIYEOK;Lo;0;L;;;;;N;;;;; D7D6;HANGUL JONGSEONG RIEUL-KIYEOK-HIEUH;Lo;0;L;;;;;N;;;;; D7D7;HANGUL JONGSEONG SSANGRIEUL-KHIEUKH;Lo;0;L;;;;;N;;;;; D7D8;HANGUL JONGSEONG RIEUL-MIEUM-HIEUH;Lo;0;L;;;;;N;;;;; D7D9;HANGUL JONGSEONG RIEUL-PIEUP-TIKEUT;Lo;0;L;;;;;N;;;;; D7DA;HANGUL JONGSEONG RIEUL-PIEUP-PHIEUPH;Lo;0;L;;;;;N;;;;; D7DB;HANGUL JONGSEONG RIEUL-YESIEUNG;Lo;0;L;;;;;N;;;;; D7DC;HANGUL JONGSEONG RIEUL-YEORINHIEUH-HIEUH;Lo;0;L;;;;;N;;;;; D7DD;HANGUL JONGSEONG KAPYEOUNRIEUL;Lo;0;L;;;;;N;;;;; D7DE;HANGUL JONGSEONG MIEUM-NIEUN;Lo;0;L;;;;;N;;;;; D7DF;HANGUL JONGSEONG MIEUM-SSANGNIEUN;Lo;0;L;;;;;N;;;;; D7E0;HANGUL JONGSEONG SSANGMIEUM;Lo;0;L;;;;;N;;;;; D7E1;HANGUL JONGSEONG MIEUM-PIEUP-SIOS;Lo;0;L;;;;;N;;;;; D7E2;HANGUL JONGSEONG MIEUM-CIEUC;Lo;0;L;;;;;N;;;;; D7E3;HANGUL JONGSEONG PIEUP-TIKEUT;Lo;0;L;;;;;N;;;;; D7E4;HANGUL JONGSEONG PIEUP-RIEUL-PHIEUPH;Lo;0;L;;;;;N;;;;; D7E5;HANGUL JONGSEONG PIEUP-MIEUM;Lo;0;L;;;;;N;;;;; D7E6;HANGUL JONGSEONG SSANGPIEUP;Lo;0;L;;;;;N;;;;; D7E7;HANGUL JONGSEONG PIEUP-SIOS-TIKEUT;Lo;0;L;;;;;N;;;;; D7E8;HANGUL JONGSEONG PIEUP-CIEUC;Lo;0;L;;;;;N;;;;; D7E9;HANGUL JONGSEONG PIEUP-CHIEUCH;Lo;0;L;;;;;N;;;;; D7EA;HANGUL JONGSEONG SIOS-MIEUM;Lo;0;L;;;;;N;;;;; D7EB;HANGUL JONGSEONG SIOS-KAPYEOUNPIEUP;Lo;0;L;;;;;N;;;;; D7EC;HANGUL JONGSEONG SSANGSIOS-KIYEOK;Lo;0;L;;;;;N;;;;; D7ED;HANGUL JONGSEONG SSANGSIOS-TIKEUT;Lo;0;L;;;;;N;;;;; D7EE;HANGUL JONGSEONG SIOS-PANSIOS;Lo;0;L;;;;;N;;;;; D7EF;HANGUL JONGSEONG SIOS-CIEUC;Lo;0;L;;;;;N;;;;; D7F0;HANGUL JONGSEONG SIOS-CHIEUCH;Lo;0;L;;;;;N;;;;; D7F1;HANGUL JONGSEONG SIOS-THIEUTH;Lo;0;L;;;;;N;;;;; D7F2;HANGUL JONGSEONG SIOS-HIEUH;Lo;0;L;;;;;N;;;;; D7F3;HANGUL JONGSEONG PANSIOS-PIEUP;Lo;0;L;;;;;N;;;;; D7F4;HANGUL JONGSEONG PANSIOS-KAPYEOUNPIEUP;Lo;0;L;;;;;N;;;;; D7F5;HANGUL JONGSEONG YESIEUNG-MIEUM;Lo;0;L;;;;;N;;;;; D7F6;HANGUL JONGSEONG YESIEUNG-HIEUH;Lo;0;L;;;;;N;;;;; D7F7;HANGUL JONGSEONG CIEUC-PIEUP;Lo;0;L;;;;;N;;;;; D7F8;HANGUL JONGSEONG CIEUC-SSANGPIEUP;Lo;0;L;;;;;N;;;;; D7F9;HANGUL JONGSEONG SSANGCIEUC;Lo;0;L;;;;;N;;;;; D7FA;HANGUL JONGSEONG PHIEUPH-SIOS;Lo;0;L;;;;;N;;;;; D7FB;HANGUL JONGSEONG PHIEUPH-THIEUTH;Lo;0;L;;;;;N;;;;; D800;;Cs;0;L;;;;;N;;;;; DB7F;;Cs;0;L;;;;;N;;;;; DB80;;Cs;0;L;;;;;N;;;;; DBFF;;Cs;0;L;;;;;N;;;;; DC00;;Cs;0;L;;;;;N;;;;; DFFF;;Cs;0;L;;;;;N;;;;; E000;;Co;0;L;;;;;N;;;;; F8FF;;Co;0;L;;;;;N;;;;; F900;CJK COMPATIBILITY IDEOGRAPH-F900;Lo;0;L;8C48;;;;N;;;;; F901;CJK COMPATIBILITY IDEOGRAPH-F901;Lo;0;L;66F4;;;;N;;;;; F902;CJK COMPATIBILITY IDEOGRAPH-F902;Lo;0;L;8ECA;;;;N;;;;; F903;CJK COMPATIBILITY IDEOGRAPH-F903;Lo;0;L;8CC8;;;;N;;;;; F904;CJK COMPATIBILITY IDEOGRAPH-F904;Lo;0;L;6ED1;;;;N;;;;; F905;CJK COMPATIBILITY IDEOGRAPH-F905;Lo;0;L;4E32;;;;N;;;;; F906;CJK COMPATIBILITY IDEOGRAPH-F906;Lo;0;L;53E5;;;;N;;;;; F907;CJK COMPATIBILITY IDEOGRAPH-F907;Lo;0;L;9F9C;;;;N;;;;; F908;CJK COMPATIBILITY IDEOGRAPH-F908;Lo;0;L;9F9C;;;;N;;;;; F909;CJK COMPATIBILITY IDEOGRAPH-F909;Lo;0;L;5951;;;;N;;;;; F90A;CJK COMPATIBILITY IDEOGRAPH-F90A;Lo;0;L;91D1;;;;N;;;;; F90B;CJK COMPATIBILITY IDEOGRAPH-F90B;Lo;0;L;5587;;;;N;;;;; F90C;CJK COMPATIBILITY IDEOGRAPH-F90C;Lo;0;L;5948;;;;N;;;;; F90D;CJK COMPATIBILITY IDEOGRAPH-F90D;Lo;0;L;61F6;;;;N;;;;; F90E;CJK COMPATIBILITY IDEOGRAPH-F90E;Lo;0;L;7669;;;;N;;;;; F90F;CJK COMPATIBILITY IDEOGRAPH-F90F;Lo;0;L;7F85;;;;N;;;;; F910;CJK COMPATIBILITY IDEOGRAPH-F910;Lo;0;L;863F;;;;N;;;;; F911;CJK COMPATIBILITY IDEOGRAPH-F911;Lo;0;L;87BA;;;;N;;;;; F912;CJK COMPATIBILITY IDEOGRAPH-F912;Lo;0;L;88F8;;;;N;;;;; F913;CJK COMPATIBILITY IDEOGRAPH-F913;Lo;0;L;908F;;;;N;;;;; F914;CJK COMPATIBILITY IDEOGRAPH-F914;Lo;0;L;6A02;;;;N;;;;; F915;CJK COMPATIBILITY IDEOGRAPH-F915;Lo;0;L;6D1B;;;;N;;;;; F916;CJK COMPATIBILITY IDEOGRAPH-F916;Lo;0;L;70D9;;;;N;;;;; F917;CJK COMPATIBILITY IDEOGRAPH-F917;Lo;0;L;73DE;;;;N;;;;; F918;CJK COMPATIBILITY IDEOGRAPH-F918;Lo;0;L;843D;;;;N;;;;; F919;CJK COMPATIBILITY IDEOGRAPH-F919;Lo;0;L;916A;;;;N;;;;; F91A;CJK COMPATIBILITY IDEOGRAPH-F91A;Lo;0;L;99F1;;;;N;;;;; F91B;CJK COMPATIBILITY IDEOGRAPH-F91B;Lo;0;L;4E82;;;;N;;;;; F91C;CJK COMPATIBILITY IDEOGRAPH-F91C;Lo;0;L;5375;;;;N;;;;; F91D;CJK COMPATIBILITY IDEOGRAPH-F91D;Lo;0;L;6B04;;;;N;;;;; F91E;CJK COMPATIBILITY IDEOGRAPH-F91E;Lo;0;L;721B;;;;N;;;;; F91F;CJK COMPATIBILITY IDEOGRAPH-F91F;Lo;0;L;862D;;;;N;;;;; F920;CJK COMPATIBILITY IDEOGRAPH-F920;Lo;0;L;9E1E;;;;N;;;;; F921;CJK COMPATIBILITY IDEOGRAPH-F921;Lo;0;L;5D50;;;;N;;;;; F922;CJK COMPATIBILITY IDEOGRAPH-F922;Lo;0;L;6FEB;;;;N;;;;; F923;CJK COMPATIBILITY IDEOGRAPH-F923;Lo;0;L;85CD;;;;N;;;;; F924;CJK COMPATIBILITY IDEOGRAPH-F924;Lo;0;L;8964;;;;N;;;;; F925;CJK COMPATIBILITY IDEOGRAPH-F925;Lo;0;L;62C9;;;;N;;;;; F926;CJK COMPATIBILITY IDEOGRAPH-F926;Lo;0;L;81D8;;;;N;;;;; F927;CJK COMPATIBILITY IDEOGRAPH-F927;Lo;0;L;881F;;;;N;;;;; F928;CJK COMPATIBILITY IDEOGRAPH-F928;Lo;0;L;5ECA;;;;N;;;;; F929;CJK COMPATIBILITY IDEOGRAPH-F929;Lo;0;L;6717;;;;N;;;;; F92A;CJK COMPATIBILITY IDEOGRAPH-F92A;Lo;0;L;6D6A;;;;N;;;;; F92B;CJK COMPATIBILITY IDEOGRAPH-F92B;Lo;0;L;72FC;;;;N;;;;; F92C;CJK COMPATIBILITY IDEOGRAPH-F92C;Lo;0;L;90CE;;;;N;;;;; F92D;CJK COMPATIBILITY IDEOGRAPH-F92D;Lo;0;L;4F86;;;;N;;;;; F92E;CJK COMPATIBILITY IDEOGRAPH-F92E;Lo;0;L;51B7;;;;N;;;;; F92F;CJK COMPATIBILITY IDEOGRAPH-F92F;Lo;0;L;52DE;;;;N;;;;; F930;CJK COMPATIBILITY IDEOGRAPH-F930;Lo;0;L;64C4;;;;N;;;;; F931;CJK COMPATIBILITY IDEOGRAPH-F931;Lo;0;L;6AD3;;;;N;;;;; F932;CJK COMPATIBILITY IDEOGRAPH-F932;Lo;0;L;7210;;;;N;;;;; F933;CJK COMPATIBILITY IDEOGRAPH-F933;Lo;0;L;76E7;;;;N;;;;; F934;CJK COMPATIBILITY IDEOGRAPH-F934;Lo;0;L;8001;;;;N;;;;; F935;CJK COMPATIBILITY IDEOGRAPH-F935;Lo;0;L;8606;;;;N;;;;; F936;CJK COMPATIBILITY IDEOGRAPH-F936;Lo;0;L;865C;;;;N;;;;; F937;CJK COMPATIBILITY IDEOGRAPH-F937;Lo;0;L;8DEF;;;;N;;;;; F938;CJK COMPATIBILITY IDEOGRAPH-F938;Lo;0;L;9732;;;;N;;;;; F939;CJK COMPATIBILITY IDEOGRAPH-F939;Lo;0;L;9B6F;;;;N;;;;; F93A;CJK COMPATIBILITY IDEOGRAPH-F93A;Lo;0;L;9DFA;;;;N;;;;; F93B;CJK COMPATIBILITY IDEOGRAPH-F93B;Lo;0;L;788C;;;;N;;;;; F93C;CJK COMPATIBILITY IDEOGRAPH-F93C;Lo;0;L;797F;;;;N;;;;; F93D;CJK COMPATIBILITY IDEOGRAPH-F93D;Lo;0;L;7DA0;;;;N;;;;; F93E;CJK COMPATIBILITY IDEOGRAPH-F93E;Lo;0;L;83C9;;;;N;;;;; F93F;CJK COMPATIBILITY IDEOGRAPH-F93F;Lo;0;L;9304;;;;N;;;;; F940;CJK COMPATIBILITY IDEOGRAPH-F940;Lo;0;L;9E7F;;;;N;;;;; F941;CJK COMPATIBILITY IDEOGRAPH-F941;Lo;0;L;8AD6;;;;N;;;;; F942;CJK COMPATIBILITY IDEOGRAPH-F942;Lo;0;L;58DF;;;;N;;;;; F943;CJK COMPATIBILITY IDEOGRAPH-F943;Lo;0;L;5F04;;;;N;;;;; F944;CJK COMPATIBILITY IDEOGRAPH-F944;Lo;0;L;7C60;;;;N;;;;; F945;CJK COMPATIBILITY IDEOGRAPH-F945;Lo;0;L;807E;;;;N;;;;; F946;CJK COMPATIBILITY IDEOGRAPH-F946;Lo;0;L;7262;;;;N;;;;; F947;CJK COMPATIBILITY IDEOGRAPH-F947;Lo;0;L;78CA;;;;N;;;;; F948;CJK COMPATIBILITY IDEOGRAPH-F948;Lo;0;L;8CC2;;;;N;;;;; F949;CJK COMPATIBILITY IDEOGRAPH-F949;Lo;0;L;96F7;;;;N;;;;; F94A;CJK COMPATIBILITY IDEOGRAPH-F94A;Lo;0;L;58D8;;;;N;;;;; F94B;CJK COMPATIBILITY IDEOGRAPH-F94B;Lo;0;L;5C62;;;;N;;;;; F94C;CJK COMPATIBILITY IDEOGRAPH-F94C;Lo;0;L;6A13;;;;N;;;;; F94D;CJK COMPATIBILITY IDEOGRAPH-F94D;Lo;0;L;6DDA;;;;N;;;;; F94E;CJK COMPATIBILITY IDEOGRAPH-F94E;Lo;0;L;6F0F;;;;N;;;;; F94F;CJK COMPATIBILITY IDEOGRAPH-F94F;Lo;0;L;7D2F;;;;N;;;;; F950;CJK COMPATIBILITY IDEOGRAPH-F950;Lo;0;L;7E37;;;;N;;;;; F951;CJK COMPATIBILITY IDEOGRAPH-F951;Lo;0;L;964B;;;;N;;;;; F952;CJK COMPATIBILITY IDEOGRAPH-F952;Lo;0;L;52D2;;;;N;;;;; F953;CJK COMPATIBILITY IDEOGRAPH-F953;Lo;0;L;808B;;;;N;;;;; F954;CJK COMPATIBILITY IDEOGRAPH-F954;Lo;0;L;51DC;;;;N;;;;; F955;CJK COMPATIBILITY IDEOGRAPH-F955;Lo;0;L;51CC;;;;N;;;;; F956;CJK COMPATIBILITY IDEOGRAPH-F956;Lo;0;L;7A1C;;;;N;;;;; F957;CJK COMPATIBILITY IDEOGRAPH-F957;Lo;0;L;7DBE;;;;N;;;;; F958;CJK COMPATIBILITY IDEOGRAPH-F958;Lo;0;L;83F1;;;;N;;;;; F959;CJK COMPATIBILITY IDEOGRAPH-F959;Lo;0;L;9675;;;;N;;;;; F95A;CJK COMPATIBILITY IDEOGRAPH-F95A;Lo;0;L;8B80;;;;N;;;;; F95B;CJK COMPATIBILITY IDEOGRAPH-F95B;Lo;0;L;62CF;;;;N;;;;; F95C;CJK COMPATIBILITY IDEOGRAPH-F95C;Lo;0;L;6A02;;;;N;;;;; F95D;CJK COMPATIBILITY IDEOGRAPH-F95D;Lo;0;L;8AFE;;;;N;;;;; F95E;CJK COMPATIBILITY IDEOGRAPH-F95E;Lo;0;L;4E39;;;;N;;;;; F95F;CJK COMPATIBILITY IDEOGRAPH-F95F;Lo;0;L;5BE7;;;;N;;;;; F960;CJK COMPATIBILITY IDEOGRAPH-F960;Lo;0;L;6012;;;;N;;;;; F961;CJK COMPATIBILITY IDEOGRAPH-F961;Lo;0;L;7387;;;;N;;;;; F962;CJK COMPATIBILITY IDEOGRAPH-F962;Lo;0;L;7570;;;;N;;;;; F963;CJK COMPATIBILITY IDEOGRAPH-F963;Lo;0;L;5317;;;;N;;;;; F964;CJK COMPATIBILITY IDEOGRAPH-F964;Lo;0;L;78FB;;;;N;;;;; F965;CJK COMPATIBILITY IDEOGRAPH-F965;Lo;0;L;4FBF;;;;N;;;;; F966;CJK COMPATIBILITY IDEOGRAPH-F966;Lo;0;L;5FA9;;;;N;;;;; F967;CJK COMPATIBILITY IDEOGRAPH-F967;Lo;0;L;4E0D;;;;N;;;;; F968;CJK COMPATIBILITY IDEOGRAPH-F968;Lo;0;L;6CCC;;;;N;;;;; F969;CJK COMPATIBILITY IDEOGRAPH-F969;Lo;0;L;6578;;;;N;;;;; F96A;CJK COMPATIBILITY IDEOGRAPH-F96A;Lo;0;L;7D22;;;;N;;;;; F96B;CJK COMPATIBILITY IDEOGRAPH-F96B;Lo;0;L;53C3;;;3;N;;;;; F96C;CJK COMPATIBILITY IDEOGRAPH-F96C;Lo;0;L;585E;;;;N;;;;; F96D;CJK COMPATIBILITY IDEOGRAPH-F96D;Lo;0;L;7701;;;;N;;;;; F96E;CJK COMPATIBILITY IDEOGRAPH-F96E;Lo;0;L;8449;;;;N;;;;; F96F;CJK COMPATIBILITY IDEOGRAPH-F96F;Lo;0;L;8AAA;;;;N;;;;; F970;CJK COMPATIBILITY IDEOGRAPH-F970;Lo;0;L;6BBA;;;;N;;;;; F971;CJK COMPATIBILITY IDEOGRAPH-F971;Lo;0;L;8FB0;;;;N;;;;; F972;CJK COMPATIBILITY IDEOGRAPH-F972;Lo;0;L;6C88;;;;N;;;;; F973;CJK COMPATIBILITY IDEOGRAPH-F973;Lo;0;L;62FE;;;10;N;;;;; F974;CJK COMPATIBILITY IDEOGRAPH-F974;Lo;0;L;82E5;;;;N;;;;; F975;CJK COMPATIBILITY IDEOGRAPH-F975;Lo;0;L;63A0;;;;N;;;;; F976;CJK COMPATIBILITY IDEOGRAPH-F976;Lo;0;L;7565;;;;N;;;;; F977;CJK COMPATIBILITY IDEOGRAPH-F977;Lo;0;L;4EAE;;;;N;;;;; F978;CJK COMPATIBILITY IDEOGRAPH-F978;Lo;0;L;5169;;;2;N;;;;; F979;CJK COMPATIBILITY IDEOGRAPH-F979;Lo;0;L;51C9;;;;N;;;;; F97A;CJK COMPATIBILITY IDEOGRAPH-F97A;Lo;0;L;6881;;;;N;;;;; F97B;CJK COMPATIBILITY IDEOGRAPH-F97B;Lo;0;L;7CE7;;;;N;;;;; F97C;CJK COMPATIBILITY IDEOGRAPH-F97C;Lo;0;L;826F;;;;N;;;;; F97D;CJK COMPATIBILITY IDEOGRAPH-F97D;Lo;0;L;8AD2;;;;N;;;;; F97E;CJK COMPATIBILITY IDEOGRAPH-F97E;Lo;0;L;91CF;;;;N;;;;; F97F;CJK COMPATIBILITY IDEOGRAPH-F97F;Lo;0;L;52F5;;;;N;;;;; F980;CJK COMPATIBILITY IDEOGRAPH-F980;Lo;0;L;5442;;;;N;;;;; F981;CJK COMPATIBILITY IDEOGRAPH-F981;Lo;0;L;5973;;;;N;;;;; F982;CJK COMPATIBILITY IDEOGRAPH-F982;Lo;0;L;5EEC;;;;N;;;;; F983;CJK COMPATIBILITY IDEOGRAPH-F983;Lo;0;L;65C5;;;;N;;;;; F984;CJK COMPATIBILITY IDEOGRAPH-F984;Lo;0;L;6FFE;;;;N;;;;; F985;CJK COMPATIBILITY IDEOGRAPH-F985;Lo;0;L;792A;;;;N;;;;; F986;CJK COMPATIBILITY IDEOGRAPH-F986;Lo;0;L;95AD;;;;N;;;;; F987;CJK COMPATIBILITY IDEOGRAPH-F987;Lo;0;L;9A6A;;;;N;;;;; F988;CJK COMPATIBILITY IDEOGRAPH-F988;Lo;0;L;9E97;;;;N;;;;; F989;CJK COMPATIBILITY IDEOGRAPH-F989;Lo;0;L;9ECE;;;;N;;;;; F98A;CJK COMPATIBILITY IDEOGRAPH-F98A;Lo;0;L;529B;;;;N;;;;; F98B;CJK COMPATIBILITY IDEOGRAPH-F98B;Lo;0;L;66C6;;;;N;;;;; F98C;CJK COMPATIBILITY IDEOGRAPH-F98C;Lo;0;L;6B77;;;;N;;;;; F98D;CJK COMPATIBILITY IDEOGRAPH-F98D;Lo;0;L;8F62;;;;N;;;;; F98E;CJK COMPATIBILITY IDEOGRAPH-F98E;Lo;0;L;5E74;;;;N;;;;; F98F;CJK COMPATIBILITY IDEOGRAPH-F98F;Lo;0;L;6190;;;;N;;;;; F990;CJK COMPATIBILITY IDEOGRAPH-F990;Lo;0;L;6200;;;;N;;;;; F991;CJK COMPATIBILITY IDEOGRAPH-F991;Lo;0;L;649A;;;;N;;;;; F992;CJK COMPATIBILITY IDEOGRAPH-F992;Lo;0;L;6F23;;;;N;;;;; F993;CJK COMPATIBILITY IDEOGRAPH-F993;Lo;0;L;7149;;;;N;;;;; F994;CJK COMPATIBILITY IDEOGRAPH-F994;Lo;0;L;7489;;;;N;;;;; F995;CJK COMPATIBILITY IDEOGRAPH-F995;Lo;0;L;79CA;;;;N;;;;; F996;CJK COMPATIBILITY IDEOGRAPH-F996;Lo;0;L;7DF4;;;;N;;;;; F997;CJK COMPATIBILITY IDEOGRAPH-F997;Lo;0;L;806F;;;;N;;;;; F998;CJK COMPATIBILITY IDEOGRAPH-F998;Lo;0;L;8F26;;;;N;;;;; F999;CJK COMPATIBILITY IDEOGRAPH-F999;Lo;0;L;84EE;;;;N;;;;; F99A;CJK COMPATIBILITY IDEOGRAPH-F99A;Lo;0;L;9023;;;;N;;;;; F99B;CJK COMPATIBILITY IDEOGRAPH-F99B;Lo;0;L;934A;;;;N;;;;; F99C;CJK COMPATIBILITY IDEOGRAPH-F99C;Lo;0;L;5217;;;;N;;;;; F99D;CJK COMPATIBILITY IDEOGRAPH-F99D;Lo;0;L;52A3;;;;N;;;;; F99E;CJK COMPATIBILITY IDEOGRAPH-F99E;Lo;0;L;54BD;;;;N;;;;; F99F;CJK COMPATIBILITY IDEOGRAPH-F99F;Lo;0;L;70C8;;;;N;;;;; F9A0;CJK COMPATIBILITY IDEOGRAPH-F9A0;Lo;0;L;88C2;;;;N;;;;; F9A1;CJK COMPATIBILITY IDEOGRAPH-F9A1;Lo;0;L;8AAA;;;;N;;;;; F9A2;CJK COMPATIBILITY IDEOGRAPH-F9A2;Lo;0;L;5EC9;;;;N;;;;; F9A3;CJK COMPATIBILITY IDEOGRAPH-F9A3;Lo;0;L;5FF5;;;;N;;;;; F9A4;CJK COMPATIBILITY IDEOGRAPH-F9A4;Lo;0;L;637B;;;;N;;;;; F9A5;CJK COMPATIBILITY IDEOGRAPH-F9A5;Lo;0;L;6BAE;;;;N;;;;; F9A6;CJK COMPATIBILITY IDEOGRAPH-F9A6;Lo;0;L;7C3E;;;;N;;;;; F9A7;CJK COMPATIBILITY IDEOGRAPH-F9A7;Lo;0;L;7375;;;;N;;;;; F9A8;CJK COMPATIBILITY IDEOGRAPH-F9A8;Lo;0;L;4EE4;;;;N;;;;; F9A9;CJK COMPATIBILITY IDEOGRAPH-F9A9;Lo;0;L;56F9;;;;N;;;;; F9AA;CJK COMPATIBILITY IDEOGRAPH-F9AA;Lo;0;L;5BE7;;;;N;;;;; F9AB;CJK COMPATIBILITY IDEOGRAPH-F9AB;Lo;0;L;5DBA;;;;N;;;;; F9AC;CJK COMPATIBILITY IDEOGRAPH-F9AC;Lo;0;L;601C;;;;N;;;;; F9AD;CJK COMPATIBILITY IDEOGRAPH-F9AD;Lo;0;L;73B2;;;;N;;;;; F9AE;CJK COMPATIBILITY IDEOGRAPH-F9AE;Lo;0;L;7469;;;;N;;;;; F9AF;CJK COMPATIBILITY IDEOGRAPH-F9AF;Lo;0;L;7F9A;;;;N;;;;; F9B0;CJK COMPATIBILITY IDEOGRAPH-F9B0;Lo;0;L;8046;;;;N;;;;; F9B1;CJK COMPATIBILITY IDEOGRAPH-F9B1;Lo;0;L;9234;;;;N;;;;; F9B2;CJK COMPATIBILITY IDEOGRAPH-F9B2;Lo;0;L;96F6;;;0;N;;;;; F9B3;CJK COMPATIBILITY IDEOGRAPH-F9B3;Lo;0;L;9748;;;;N;;;;; F9B4;CJK COMPATIBILITY IDEOGRAPH-F9B4;Lo;0;L;9818;;;;N;;;;; F9B5;CJK COMPATIBILITY IDEOGRAPH-F9B5;Lo;0;L;4F8B;;;;N;;;;; F9B6;CJK COMPATIBILITY IDEOGRAPH-F9B6;Lo;0;L;79AE;;;;N;;;;; F9B7;CJK COMPATIBILITY IDEOGRAPH-F9B7;Lo;0;L;91B4;;;;N;;;;; F9B8;CJK COMPATIBILITY IDEOGRAPH-F9B8;Lo;0;L;96B8;;;;N;;;;; F9B9;CJK COMPATIBILITY IDEOGRAPH-F9B9;Lo;0;L;60E1;;;;N;;;;; F9BA;CJK COMPATIBILITY IDEOGRAPH-F9BA;Lo;0;L;4E86;;;;N;;;;; F9BB;CJK COMPATIBILITY IDEOGRAPH-F9BB;Lo;0;L;50DA;;;;N;;;;; F9BC;CJK COMPATIBILITY IDEOGRAPH-F9BC;Lo;0;L;5BEE;;;;N;;;;; F9BD;CJK COMPATIBILITY IDEOGRAPH-F9BD;Lo;0;L;5C3F;;;;N;;;;; F9BE;CJK COMPATIBILITY IDEOGRAPH-F9BE;Lo;0;L;6599;;;;N;;;;; F9BF;CJK COMPATIBILITY IDEOGRAPH-F9BF;Lo;0;L;6A02;;;;N;;;;; F9C0;CJK COMPATIBILITY IDEOGRAPH-F9C0;Lo;0;L;71CE;;;;N;;;;; F9C1;CJK COMPATIBILITY IDEOGRAPH-F9C1;Lo;0;L;7642;;;;N;;;;; F9C2;CJK COMPATIBILITY IDEOGRAPH-F9C2;Lo;0;L;84FC;;;;N;;;;; F9C3;CJK COMPATIBILITY IDEOGRAPH-F9C3;Lo;0;L;907C;;;;N;;;;; F9C4;CJK COMPATIBILITY IDEOGRAPH-F9C4;Lo;0;L;9F8D;;;;N;;;;; F9C5;CJK COMPATIBILITY IDEOGRAPH-F9C5;Lo;0;L;6688;;;;N;;;;; F9C6;CJK COMPATIBILITY IDEOGRAPH-F9C6;Lo;0;L;962E;;;;N;;;;; F9C7;CJK COMPATIBILITY IDEOGRAPH-F9C7;Lo;0;L;5289;;;;N;;;;; F9C8;CJK COMPATIBILITY IDEOGRAPH-F9C8;Lo;0;L;677B;;;;N;;;;; F9C9;CJK COMPATIBILITY IDEOGRAPH-F9C9;Lo;0;L;67F3;;;;N;;;;; F9CA;CJK COMPATIBILITY IDEOGRAPH-F9CA;Lo;0;L;6D41;;;;N;;;;; F9CB;CJK COMPATIBILITY IDEOGRAPH-F9CB;Lo;0;L;6E9C;;;;N;;;;; F9CC;CJK COMPATIBILITY IDEOGRAPH-F9CC;Lo;0;L;7409;;;;N;;;;; F9CD;CJK COMPATIBILITY IDEOGRAPH-F9CD;Lo;0;L;7559;;;;N;;;;; F9CE;CJK COMPATIBILITY IDEOGRAPH-F9CE;Lo;0;L;786B;;;;N;;;;; F9CF;CJK COMPATIBILITY IDEOGRAPH-F9CF;Lo;0;L;7D10;;;;N;;;;; F9D0;CJK COMPATIBILITY IDEOGRAPH-F9D0;Lo;0;L;985E;;;;N;;;;; F9D1;CJK COMPATIBILITY IDEOGRAPH-F9D1;Lo;0;L;516D;;;6;N;;;;; F9D2;CJK COMPATIBILITY IDEOGRAPH-F9D2;Lo;0;L;622E;;;;N;;;;; F9D3;CJK COMPATIBILITY IDEOGRAPH-F9D3;Lo;0;L;9678;;;6;N;;;;; F9D4;CJK COMPATIBILITY IDEOGRAPH-F9D4;Lo;0;L;502B;;;;N;;;;; F9D5;CJK COMPATIBILITY IDEOGRAPH-F9D5;Lo;0;L;5D19;;;;N;;;;; F9D6;CJK COMPATIBILITY IDEOGRAPH-F9D6;Lo;0;L;6DEA;;;;N;;;;; F9D7;CJK COMPATIBILITY IDEOGRAPH-F9D7;Lo;0;L;8F2A;;;;N;;;;; F9D8;CJK COMPATIBILITY IDEOGRAPH-F9D8;Lo;0;L;5F8B;;;;N;;;;; F9D9;CJK COMPATIBILITY IDEOGRAPH-F9D9;Lo;0;L;6144;;;;N;;;;; F9DA;CJK COMPATIBILITY IDEOGRAPH-F9DA;Lo;0;L;6817;;;;N;;;;; F9DB;CJK COMPATIBILITY IDEOGRAPH-F9DB;Lo;0;L;7387;;;;N;;;;; F9DC;CJK COMPATIBILITY IDEOGRAPH-F9DC;Lo;0;L;9686;;;;N;;;;; F9DD;CJK COMPATIBILITY IDEOGRAPH-F9DD;Lo;0;L;5229;;;;N;;;;; F9DE;CJK COMPATIBILITY IDEOGRAPH-F9DE;Lo;0;L;540F;;;;N;;;;; F9DF;CJK COMPATIBILITY IDEOGRAPH-F9DF;Lo;0;L;5C65;;;;N;;;;; F9E0;CJK COMPATIBILITY IDEOGRAPH-F9E0;Lo;0;L;6613;;;;N;;;;; F9E1;CJK COMPATIBILITY IDEOGRAPH-F9E1;Lo;0;L;674E;;;;N;;;;; F9E2;CJK COMPATIBILITY IDEOGRAPH-F9E2;Lo;0;L;68A8;;;;N;;;;; F9E3;CJK COMPATIBILITY IDEOGRAPH-F9E3;Lo;0;L;6CE5;;;;N;;;;; F9E4;CJK COMPATIBILITY IDEOGRAPH-F9E4;Lo;0;L;7406;;;;N;;;;; F9E5;CJK COMPATIBILITY IDEOGRAPH-F9E5;Lo;0;L;75E2;;;;N;;;;; F9E6;CJK COMPATIBILITY IDEOGRAPH-F9E6;Lo;0;L;7F79;;;;N;;;;; F9E7;CJK COMPATIBILITY IDEOGRAPH-F9E7;Lo;0;L;88CF;;;;N;;;;; F9E8;CJK COMPATIBILITY IDEOGRAPH-F9E8;Lo;0;L;88E1;;;;N;;;;; F9E9;CJK COMPATIBILITY IDEOGRAPH-F9E9;Lo;0;L;91CC;;;;N;;;;; F9EA;CJK COMPATIBILITY IDEOGRAPH-F9EA;Lo;0;L;96E2;;;;N;;;;; F9EB;CJK COMPATIBILITY IDEOGRAPH-F9EB;Lo;0;L;533F;;;;N;;;;; F9EC;CJK COMPATIBILITY IDEOGRAPH-F9EC;Lo;0;L;6EBA;;;;N;;;;; F9ED;CJK COMPATIBILITY IDEOGRAPH-F9ED;Lo;0;L;541D;;;;N;;;;; F9EE;CJK COMPATIBILITY IDEOGRAPH-F9EE;Lo;0;L;71D0;;;;N;;;;; F9EF;CJK COMPATIBILITY IDEOGRAPH-F9EF;Lo;0;L;7498;;;;N;;;;; F9F0;CJK COMPATIBILITY IDEOGRAPH-F9F0;Lo;0;L;85FA;;;;N;;;;; F9F1;CJK COMPATIBILITY IDEOGRAPH-F9F1;Lo;0;L;96A3;;;;N;;;;; F9F2;CJK COMPATIBILITY IDEOGRAPH-F9F2;Lo;0;L;9C57;;;;N;;;;; F9F3;CJK COMPATIBILITY IDEOGRAPH-F9F3;Lo;0;L;9E9F;;;;N;;;;; F9F4;CJK COMPATIBILITY IDEOGRAPH-F9F4;Lo;0;L;6797;;;;N;;;;; F9F5;CJK COMPATIBILITY IDEOGRAPH-F9F5;Lo;0;L;6DCB;;;;N;;;;; F9F6;CJK COMPATIBILITY IDEOGRAPH-F9F6;Lo;0;L;81E8;;;;N;;;;; F9F7;CJK COMPATIBILITY IDEOGRAPH-F9F7;Lo;0;L;7ACB;;;;N;;;;; F9F8;CJK COMPATIBILITY IDEOGRAPH-F9F8;Lo;0;L;7B20;;;;N;;;;; F9F9;CJK COMPATIBILITY IDEOGRAPH-F9F9;Lo;0;L;7C92;;;;N;;;;; F9FA;CJK COMPATIBILITY IDEOGRAPH-F9FA;Lo;0;L;72C0;;;;N;;;;; F9FB;CJK COMPATIBILITY IDEOGRAPH-F9FB;Lo;0;L;7099;;;;N;;;;; F9FC;CJK COMPATIBILITY IDEOGRAPH-F9FC;Lo;0;L;8B58;;;;N;;;;; F9FD;CJK COMPATIBILITY IDEOGRAPH-F9FD;Lo;0;L;4EC0;;;10;N;;;;; F9FE;CJK COMPATIBILITY IDEOGRAPH-F9FE;Lo;0;L;8336;;;;N;;;;; F9FF;CJK COMPATIBILITY IDEOGRAPH-F9FF;Lo;0;L;523A;;;;N;;;;; FA00;CJK COMPATIBILITY IDEOGRAPH-FA00;Lo;0;L;5207;;;;N;;;;; FA01;CJK COMPATIBILITY IDEOGRAPH-FA01;Lo;0;L;5EA6;;;;N;;;;; FA02;CJK COMPATIBILITY IDEOGRAPH-FA02;Lo;0;L;62D3;;;;N;;;;; FA03;CJK COMPATIBILITY IDEOGRAPH-FA03;Lo;0;L;7CD6;;;;N;;;;; FA04;CJK COMPATIBILITY IDEOGRAPH-FA04;Lo;0;L;5B85;;;;N;;;;; FA05;CJK COMPATIBILITY IDEOGRAPH-FA05;Lo;0;L;6D1E;;;;N;;;;; FA06;CJK COMPATIBILITY IDEOGRAPH-FA06;Lo;0;L;66B4;;;;N;;;;; FA07;CJK COMPATIBILITY IDEOGRAPH-FA07;Lo;0;L;8F3B;;;;N;;;;; FA08;CJK COMPATIBILITY IDEOGRAPH-FA08;Lo;0;L;884C;;;;N;;;;; FA09;CJK COMPATIBILITY IDEOGRAPH-FA09;Lo;0;L;964D;;;;N;;;;; FA0A;CJK COMPATIBILITY IDEOGRAPH-FA0A;Lo;0;L;898B;;;;N;;;;; FA0B;CJK COMPATIBILITY IDEOGRAPH-FA0B;Lo;0;L;5ED3;;;;N;;;;; FA0C;CJK COMPATIBILITY IDEOGRAPH-FA0C;Lo;0;L;5140;;;;N;;;;; FA0D;CJK COMPATIBILITY IDEOGRAPH-FA0D;Lo;0;L;55C0;;;;N;;;;; FA0E;CJK COMPATIBILITY IDEOGRAPH-FA0E;Lo;0;L;;;;;N;;;;; FA0F;CJK COMPATIBILITY IDEOGRAPH-FA0F;Lo;0;L;;;;;N;;;;; FA10;CJK COMPATIBILITY IDEOGRAPH-FA10;Lo;0;L;585A;;;;N;;;;; FA11;CJK COMPATIBILITY IDEOGRAPH-FA11;Lo;0;L;;;;;N;;;;; FA12;CJK COMPATIBILITY IDEOGRAPH-FA12;Lo;0;L;6674;;;;N;;;;; FA13;CJK COMPATIBILITY IDEOGRAPH-FA13;Lo;0;L;;;;;N;;;;; FA14;CJK COMPATIBILITY IDEOGRAPH-FA14;Lo;0;L;;;;;N;;;;; FA15;CJK COMPATIBILITY IDEOGRAPH-FA15;Lo;0;L;51DE;;;;N;;;;; FA16;CJK COMPATIBILITY IDEOGRAPH-FA16;Lo;0;L;732A;;;;N;;;;; FA17;CJK COMPATIBILITY IDEOGRAPH-FA17;Lo;0;L;76CA;;;;N;;;;; FA18;CJK COMPATIBILITY IDEOGRAPH-FA18;Lo;0;L;793C;;;;N;;;;; FA19;CJK COMPATIBILITY IDEOGRAPH-FA19;Lo;0;L;795E;;;;N;;;;; FA1A;CJK COMPATIBILITY IDEOGRAPH-FA1A;Lo;0;L;7965;;;;N;;;;; FA1B;CJK COMPATIBILITY IDEOGRAPH-FA1B;Lo;0;L;798F;;;;N;;;;; FA1C;CJK COMPATIBILITY IDEOGRAPH-FA1C;Lo;0;L;9756;;;;N;;;;; FA1D;CJK COMPATIBILITY IDEOGRAPH-FA1D;Lo;0;L;7CBE;;;;N;;;;; FA1E;CJK COMPATIBILITY IDEOGRAPH-FA1E;Lo;0;L;7FBD;;;;N;;;;; FA1F;CJK COMPATIBILITY IDEOGRAPH-FA1F;Lo;0;L;;;;;N;;;;; FA20;CJK COMPATIBILITY IDEOGRAPH-FA20;Lo;0;L;8612;;;;N;;;;; FA21;CJK COMPATIBILITY IDEOGRAPH-FA21;Lo;0;L;;;;;N;;;;; FA22;CJK COMPATIBILITY IDEOGRAPH-FA22;Lo;0;L;8AF8;;;;N;;;;; FA23;CJK COMPATIBILITY IDEOGRAPH-FA23;Lo;0;L;;;;;N;;;;; FA24;CJK COMPATIBILITY IDEOGRAPH-FA24;Lo;0;L;;;;;N;;;;; FA25;CJK COMPATIBILITY IDEOGRAPH-FA25;Lo;0;L;9038;;;;N;;;;; FA26;CJK COMPATIBILITY IDEOGRAPH-FA26;Lo;0;L;90FD;;;;N;;;;; FA27;CJK COMPATIBILITY IDEOGRAPH-FA27;Lo;0;L;;;;;N;;;;; FA28;CJK COMPATIBILITY IDEOGRAPH-FA28;Lo;0;L;;;;;N;;;;; FA29;CJK COMPATIBILITY IDEOGRAPH-FA29;Lo;0;L;;;;;N;;;;; FA2A;CJK COMPATIBILITY IDEOGRAPH-FA2A;Lo;0;L;98EF;;;;N;;;;; FA2B;CJK COMPATIBILITY IDEOGRAPH-FA2B;Lo;0;L;98FC;;;;N;;;;; FA2C;CJK COMPATIBILITY IDEOGRAPH-FA2C;Lo;0;L;9928;;;;N;;;;; FA2D;CJK COMPATIBILITY IDEOGRAPH-FA2D;Lo;0;L;9DB4;;;;N;;;;; FA2E;CJK COMPATIBILITY IDEOGRAPH-FA2E;Lo;0;L;90DE;;;;N;;;;; FA2F;CJK COMPATIBILITY IDEOGRAPH-FA2F;Lo;0;L;96B7;;;;N;;;;; FA30;CJK COMPATIBILITY IDEOGRAPH-FA30;Lo;0;L;4FAE;;;;N;;;;; FA31;CJK COMPATIBILITY IDEOGRAPH-FA31;Lo;0;L;50E7;;;;N;;;;; FA32;CJK COMPATIBILITY IDEOGRAPH-FA32;Lo;0;L;514D;;;;N;;;;; FA33;CJK COMPATIBILITY IDEOGRAPH-FA33;Lo;0;L;52C9;;;;N;;;;; FA34;CJK COMPATIBILITY IDEOGRAPH-FA34;Lo;0;L;52E4;;;;N;;;;; FA35;CJK COMPATIBILITY IDEOGRAPH-FA35;Lo;0;L;5351;;;;N;;;;; FA36;CJK COMPATIBILITY IDEOGRAPH-FA36;Lo;0;L;559D;;;;N;;;;; FA37;CJK COMPATIBILITY IDEOGRAPH-FA37;Lo;0;L;5606;;;;N;;;;; FA38;CJK COMPATIBILITY IDEOGRAPH-FA38;Lo;0;L;5668;;;;N;;;;; FA39;CJK COMPATIBILITY IDEOGRAPH-FA39;Lo;0;L;5840;;;;N;;;;; FA3A;CJK COMPATIBILITY IDEOGRAPH-FA3A;Lo;0;L;58A8;;;;N;;;;; FA3B;CJK COMPATIBILITY IDEOGRAPH-FA3B;Lo;0;L;5C64;;;;N;;;;; FA3C;CJK COMPATIBILITY IDEOGRAPH-FA3C;Lo;0;L;5C6E;;;;N;;;;; FA3D;CJK COMPATIBILITY IDEOGRAPH-FA3D;Lo;0;L;6094;;;;N;;;;; FA3E;CJK COMPATIBILITY IDEOGRAPH-FA3E;Lo;0;L;6168;;;;N;;;;; FA3F;CJK COMPATIBILITY IDEOGRAPH-FA3F;Lo;0;L;618E;;;;N;;;;; FA40;CJK COMPATIBILITY IDEOGRAPH-FA40;Lo;0;L;61F2;;;;N;;;;; FA41;CJK COMPATIBILITY IDEOGRAPH-FA41;Lo;0;L;654F;;;;N;;;;; FA42;CJK COMPATIBILITY IDEOGRAPH-FA42;Lo;0;L;65E2;;;;N;;;;; FA43;CJK COMPATIBILITY IDEOGRAPH-FA43;Lo;0;L;6691;;;;N;;;;; FA44;CJK COMPATIBILITY IDEOGRAPH-FA44;Lo;0;L;6885;;;;N;;;;; FA45;CJK COMPATIBILITY IDEOGRAPH-FA45;Lo;0;L;6D77;;;;N;;;;; FA46;CJK COMPATIBILITY IDEOGRAPH-FA46;Lo;0;L;6E1A;;;;N;;;;; FA47;CJK COMPATIBILITY IDEOGRAPH-FA47;Lo;0;L;6F22;;;;N;;;;; FA48;CJK COMPATIBILITY IDEOGRAPH-FA48;Lo;0;L;716E;;;;N;;;;; FA49;CJK COMPATIBILITY IDEOGRAPH-FA49;Lo;0;L;722B;;;;N;;;;; FA4A;CJK COMPATIBILITY IDEOGRAPH-FA4A;Lo;0;L;7422;;;;N;;;;; FA4B;CJK COMPATIBILITY IDEOGRAPH-FA4B;Lo;0;L;7891;;;;N;;;;; FA4C;CJK COMPATIBILITY IDEOGRAPH-FA4C;Lo;0;L;793E;;;;N;;;;; FA4D;CJK COMPATIBILITY IDEOGRAPH-FA4D;Lo;0;L;7949;;;;N;;;;; FA4E;CJK COMPATIBILITY IDEOGRAPH-FA4E;Lo;0;L;7948;;;;N;;;;; FA4F;CJK COMPATIBILITY IDEOGRAPH-FA4F;Lo;0;L;7950;;;;N;;;;; FA50;CJK COMPATIBILITY IDEOGRAPH-FA50;Lo;0;L;7956;;;;N;;;;; FA51;CJK COMPATIBILITY IDEOGRAPH-FA51;Lo;0;L;795D;;;;N;;;;; FA52;CJK COMPATIBILITY IDEOGRAPH-FA52;Lo;0;L;798D;;;;N;;;;; FA53;CJK COMPATIBILITY IDEOGRAPH-FA53;Lo;0;L;798E;;;;N;;;;; FA54;CJK COMPATIBILITY IDEOGRAPH-FA54;Lo;0;L;7A40;;;;N;;;;; FA55;CJK COMPATIBILITY IDEOGRAPH-FA55;Lo;0;L;7A81;;;;N;;;;; FA56;CJK COMPATIBILITY IDEOGRAPH-FA56;Lo;0;L;7BC0;;;;N;;;;; FA57;CJK COMPATIBILITY IDEOGRAPH-FA57;Lo;0;L;7DF4;;;;N;;;;; FA58;CJK COMPATIBILITY IDEOGRAPH-FA58;Lo;0;L;7E09;;;;N;;;;; FA59;CJK COMPATIBILITY IDEOGRAPH-FA59;Lo;0;L;7E41;;;;N;;;;; FA5A;CJK COMPATIBILITY IDEOGRAPH-FA5A;Lo;0;L;7F72;;;;N;;;;; FA5B;CJK COMPATIBILITY IDEOGRAPH-FA5B;Lo;0;L;8005;;;;N;;;;; FA5C;CJK COMPATIBILITY IDEOGRAPH-FA5C;Lo;0;L;81ED;;;;N;;;;; FA5D;CJK COMPATIBILITY IDEOGRAPH-FA5D;Lo;0;L;8279;;;;N;;;;; FA5E;CJK COMPATIBILITY IDEOGRAPH-FA5E;Lo;0;L;8279;;;;N;;;;; FA5F;CJK COMPATIBILITY IDEOGRAPH-FA5F;Lo;0;L;8457;;;;N;;;;; FA60;CJK COMPATIBILITY IDEOGRAPH-FA60;Lo;0;L;8910;;;;N;;;;; FA61;CJK COMPATIBILITY IDEOGRAPH-FA61;Lo;0;L;8996;;;;N;;;;; FA62;CJK COMPATIBILITY IDEOGRAPH-FA62;Lo;0;L;8B01;;;;N;;;;; FA63;CJK COMPATIBILITY IDEOGRAPH-FA63;Lo;0;L;8B39;;;;N;;;;; FA64;CJK COMPATIBILITY IDEOGRAPH-FA64;Lo;0;L;8CD3;;;;N;;;;; FA65;CJK COMPATIBILITY IDEOGRAPH-FA65;Lo;0;L;8D08;;;;N;;;;; FA66;CJK COMPATIBILITY IDEOGRAPH-FA66;Lo;0;L;8FB6;;;;N;;;;; FA67;CJK COMPATIBILITY IDEOGRAPH-FA67;Lo;0;L;9038;;;;N;;;;; FA68;CJK COMPATIBILITY IDEOGRAPH-FA68;Lo;0;L;96E3;;;;N;;;;; FA69;CJK COMPATIBILITY IDEOGRAPH-FA69;Lo;0;L;97FF;;;;N;;;;; FA6A;CJK COMPATIBILITY IDEOGRAPH-FA6A;Lo;0;L;983B;;;;N;;;;; FA6B;CJK COMPATIBILITY IDEOGRAPH-FA6B;Lo;0;L;6075;;;;N;;;;; FA6C;CJK COMPATIBILITY IDEOGRAPH-FA6C;Lo;0;L;242EE;;;;N;;;;; FA6D;CJK COMPATIBILITY IDEOGRAPH-FA6D;Lo;0;L;8218;;;;N;;;;; FA70;CJK COMPATIBILITY IDEOGRAPH-FA70;Lo;0;L;4E26;;;;N;;;;; FA71;CJK COMPATIBILITY IDEOGRAPH-FA71;Lo;0;L;51B5;;;;N;;;;; FA72;CJK COMPATIBILITY IDEOGRAPH-FA72;Lo;0;L;5168;;;;N;;;;; FA73;CJK COMPATIBILITY IDEOGRAPH-FA73;Lo;0;L;4F80;;;;N;;;;; FA74;CJK COMPATIBILITY IDEOGRAPH-FA74;Lo;0;L;5145;;;;N;;;;; FA75;CJK COMPATIBILITY IDEOGRAPH-FA75;Lo;0;L;5180;;;;N;;;;; FA76;CJK COMPATIBILITY IDEOGRAPH-FA76;Lo;0;L;52C7;;;;N;;;;; FA77;CJK COMPATIBILITY IDEOGRAPH-FA77;Lo;0;L;52FA;;;;N;;;;; FA78;CJK COMPATIBILITY IDEOGRAPH-FA78;Lo;0;L;559D;;;;N;;;;; FA79;CJK COMPATIBILITY IDEOGRAPH-FA79;Lo;0;L;5555;;;;N;;;;; FA7A;CJK COMPATIBILITY IDEOGRAPH-FA7A;Lo;0;L;5599;;;;N;;;;; FA7B;CJK COMPATIBILITY IDEOGRAPH-FA7B;Lo;0;L;55E2;;;;N;;;;; FA7C;CJK COMPATIBILITY IDEOGRAPH-FA7C;Lo;0;L;585A;;;;N;;;;; FA7D;CJK COMPATIBILITY IDEOGRAPH-FA7D;Lo;0;L;58B3;;;;N;;;;; FA7E;CJK COMPATIBILITY IDEOGRAPH-FA7E;Lo;0;L;5944;;;;N;;;;; FA7F;CJK COMPATIBILITY IDEOGRAPH-FA7F;Lo;0;L;5954;;;;N;;;;; FA80;CJK COMPATIBILITY IDEOGRAPH-FA80;Lo;0;L;5A62;;;;N;;;;; FA81;CJK COMPATIBILITY IDEOGRAPH-FA81;Lo;0;L;5B28;;;;N;;;;; FA82;CJK COMPATIBILITY IDEOGRAPH-FA82;Lo;0;L;5ED2;;;;N;;;;; FA83;CJK COMPATIBILITY IDEOGRAPH-FA83;Lo;0;L;5ED9;;;;N;;;;; FA84;CJK COMPATIBILITY IDEOGRAPH-FA84;Lo;0;L;5F69;;;;N;;;;; FA85;CJK COMPATIBILITY IDEOGRAPH-FA85;Lo;0;L;5FAD;;;;N;;;;; FA86;CJK COMPATIBILITY IDEOGRAPH-FA86;Lo;0;L;60D8;;;;N;;;;; FA87;CJK COMPATIBILITY IDEOGRAPH-FA87;Lo;0;L;614E;;;;N;;;;; FA88;CJK COMPATIBILITY IDEOGRAPH-FA88;Lo;0;L;6108;;;;N;;;;; FA89;CJK COMPATIBILITY IDEOGRAPH-FA89;Lo;0;L;618E;;;;N;;;;; FA8A;CJK COMPATIBILITY IDEOGRAPH-FA8A;Lo;0;L;6160;;;;N;;;;; FA8B;CJK COMPATIBILITY IDEOGRAPH-FA8B;Lo;0;L;61F2;;;;N;;;;; FA8C;CJK COMPATIBILITY IDEOGRAPH-FA8C;Lo;0;L;6234;;;;N;;;;; FA8D;CJK COMPATIBILITY IDEOGRAPH-FA8D;Lo;0;L;63C4;;;;N;;;;; FA8E;CJK COMPATIBILITY IDEOGRAPH-FA8E;Lo;0;L;641C;;;;N;;;;; FA8F;CJK COMPATIBILITY IDEOGRAPH-FA8F;Lo;0;L;6452;;;;N;;;;; FA90;CJK COMPATIBILITY IDEOGRAPH-FA90;Lo;0;L;6556;;;;N;;;;; FA91;CJK COMPATIBILITY IDEOGRAPH-FA91;Lo;0;L;6674;;;;N;;;;; FA92;CJK COMPATIBILITY IDEOGRAPH-FA92;Lo;0;L;6717;;;;N;;;;; FA93;CJK COMPATIBILITY IDEOGRAPH-FA93;Lo;0;L;671B;;;;N;;;;; FA94;CJK COMPATIBILITY IDEOGRAPH-FA94;Lo;0;L;6756;;;;N;;;;; FA95;CJK COMPATIBILITY IDEOGRAPH-FA95;Lo;0;L;6B79;;;;N;;;;; FA96;CJK COMPATIBILITY IDEOGRAPH-FA96;Lo;0;L;6BBA;;;;N;;;;; FA97;CJK COMPATIBILITY IDEOGRAPH-FA97;Lo;0;L;6D41;;;;N;;;;; FA98;CJK COMPATIBILITY IDEOGRAPH-FA98;Lo;0;L;6EDB;;;;N;;;;; FA99;CJK COMPATIBILITY IDEOGRAPH-FA99;Lo;0;L;6ECB;;;;N;;;;; FA9A;CJK COMPATIBILITY IDEOGRAPH-FA9A;Lo;0;L;6F22;;;;N;;;;; FA9B;CJK COMPATIBILITY IDEOGRAPH-FA9B;Lo;0;L;701E;;;;N;;;;; FA9C;CJK COMPATIBILITY IDEOGRAPH-FA9C;Lo;0;L;716E;;;;N;;;;; FA9D;CJK COMPATIBILITY IDEOGRAPH-FA9D;Lo;0;L;77A7;;;;N;;;;; FA9E;CJK COMPATIBILITY IDEOGRAPH-FA9E;Lo;0;L;7235;;;;N;;;;; FA9F;CJK COMPATIBILITY IDEOGRAPH-FA9F;Lo;0;L;72AF;;;;N;;;;; FAA0;CJK COMPATIBILITY IDEOGRAPH-FAA0;Lo;0;L;732A;;;;N;;;;; FAA1;CJK COMPATIBILITY IDEOGRAPH-FAA1;Lo;0;L;7471;;;;N;;;;; FAA2;CJK COMPATIBILITY IDEOGRAPH-FAA2;Lo;0;L;7506;;;;N;;;;; FAA3;CJK COMPATIBILITY IDEOGRAPH-FAA3;Lo;0;L;753B;;;;N;;;;; FAA4;CJK COMPATIBILITY IDEOGRAPH-FAA4;Lo;0;L;761D;;;;N;;;;; FAA5;CJK COMPATIBILITY IDEOGRAPH-FAA5;Lo;0;L;761F;;;;N;;;;; FAA6;CJK COMPATIBILITY IDEOGRAPH-FAA6;Lo;0;L;76CA;;;;N;;;;; FAA7;CJK COMPATIBILITY IDEOGRAPH-FAA7;Lo;0;L;76DB;;;;N;;;;; FAA8;CJK COMPATIBILITY IDEOGRAPH-FAA8;Lo;0;L;76F4;;;;N;;;;; FAA9;CJK COMPATIBILITY IDEOGRAPH-FAA9;Lo;0;L;774A;;;;N;;;;; FAAA;CJK COMPATIBILITY IDEOGRAPH-FAAA;Lo;0;L;7740;;;;N;;;;; FAAB;CJK COMPATIBILITY IDEOGRAPH-FAAB;Lo;0;L;78CC;;;;N;;;;; FAAC;CJK COMPATIBILITY IDEOGRAPH-FAAC;Lo;0;L;7AB1;;;;N;;;;; FAAD;CJK COMPATIBILITY IDEOGRAPH-FAAD;Lo;0;L;7BC0;;;;N;;;;; FAAE;CJK COMPATIBILITY IDEOGRAPH-FAAE;Lo;0;L;7C7B;;;;N;;;;; FAAF;CJK COMPATIBILITY IDEOGRAPH-FAAF;Lo;0;L;7D5B;;;;N;;;;; FAB0;CJK COMPATIBILITY IDEOGRAPH-FAB0;Lo;0;L;7DF4;;;;N;;;;; FAB1;CJK COMPATIBILITY IDEOGRAPH-FAB1;Lo;0;L;7F3E;;;;N;;;;; FAB2;CJK COMPATIBILITY IDEOGRAPH-FAB2;Lo;0;L;8005;;;;N;;;;; FAB3;CJK COMPATIBILITY IDEOGRAPH-FAB3;Lo;0;L;8352;;;;N;;;;; FAB4;CJK COMPATIBILITY IDEOGRAPH-FAB4;Lo;0;L;83EF;;;;N;;;;; FAB5;CJK COMPATIBILITY IDEOGRAPH-FAB5;Lo;0;L;8779;;;;N;;;;; FAB6;CJK COMPATIBILITY IDEOGRAPH-FAB6;Lo;0;L;8941;;;;N;;;;; FAB7;CJK COMPATIBILITY IDEOGRAPH-FAB7;Lo;0;L;8986;;;;N;;;;; FAB8;CJK COMPATIBILITY IDEOGRAPH-FAB8;Lo;0;L;8996;;;;N;;;;; FAB9;CJK COMPATIBILITY IDEOGRAPH-FAB9;Lo;0;L;8ABF;;;;N;;;;; FABA;CJK COMPATIBILITY IDEOGRAPH-FABA;Lo;0;L;8AF8;;;;N;;;;; FABB;CJK COMPATIBILITY IDEOGRAPH-FABB;Lo;0;L;8ACB;;;;N;;;;; FABC;CJK COMPATIBILITY IDEOGRAPH-FABC;Lo;0;L;8B01;;;;N;;;;; FABD;CJK COMPATIBILITY IDEOGRAPH-FABD;Lo;0;L;8AFE;;;;N;;;;; FABE;CJK COMPATIBILITY IDEOGRAPH-FABE;Lo;0;L;8AED;;;;N;;;;; FABF;CJK COMPATIBILITY IDEOGRAPH-FABF;Lo;0;L;8B39;;;;N;;;;; FAC0;CJK COMPATIBILITY IDEOGRAPH-FAC0;Lo;0;L;8B8A;;;;N;;;;; FAC1;CJK COMPATIBILITY IDEOGRAPH-FAC1;Lo;0;L;8D08;;;;N;;;;; FAC2;CJK COMPATIBILITY IDEOGRAPH-FAC2;Lo;0;L;8F38;;;;N;;;;; FAC3;CJK COMPATIBILITY IDEOGRAPH-FAC3;Lo;0;L;9072;;;;N;;;;; FAC4;CJK COMPATIBILITY IDEOGRAPH-FAC4;Lo;0;L;9199;;;;N;;;;; FAC5;CJK COMPATIBILITY IDEOGRAPH-FAC5;Lo;0;L;9276;;;;N;;;;; FAC6;CJK COMPATIBILITY IDEOGRAPH-FAC6;Lo;0;L;967C;;;;N;;;;; FAC7;CJK COMPATIBILITY IDEOGRAPH-FAC7;Lo;0;L;96E3;;;;N;;;;; FAC8;CJK COMPATIBILITY IDEOGRAPH-FAC8;Lo;0;L;9756;;;;N;;;;; FAC9;CJK COMPATIBILITY IDEOGRAPH-FAC9;Lo;0;L;97DB;;;;N;;;;; FACA;CJK COMPATIBILITY IDEOGRAPH-FACA;Lo;0;L;97FF;;;;N;;;;; FACB;CJK COMPATIBILITY IDEOGRAPH-FACB;Lo;0;L;980B;;;;N;;;;; FACC;CJK COMPATIBILITY IDEOGRAPH-FACC;Lo;0;L;983B;;;;N;;;;; FACD;CJK COMPATIBILITY IDEOGRAPH-FACD;Lo;0;L;9B12;;;;N;;;;; FACE;CJK COMPATIBILITY IDEOGRAPH-FACE;Lo;0;L;9F9C;;;;N;;;;; FACF;CJK COMPATIBILITY IDEOGRAPH-FACF;Lo;0;L;2284A;;;;N;;;;; FAD0;CJK COMPATIBILITY IDEOGRAPH-FAD0;Lo;0;L;22844;;;;N;;;;; FAD1;CJK COMPATIBILITY IDEOGRAPH-FAD1;Lo;0;L;233D5;;;;N;;;;; FAD2;CJK COMPATIBILITY IDEOGRAPH-FAD2;Lo;0;L;3B9D;;;;N;;;;; FAD3;CJK COMPATIBILITY IDEOGRAPH-FAD3;Lo;0;L;4018;;;;N;;;;; FAD4;CJK COMPATIBILITY IDEOGRAPH-FAD4;Lo;0;L;4039;;;;N;;;;; FAD5;CJK COMPATIBILITY IDEOGRAPH-FAD5;Lo;0;L;25249;;;;N;;;;; FAD6;CJK COMPATIBILITY IDEOGRAPH-FAD6;Lo;0;L;25CD0;;;;N;;;;; FAD7;CJK COMPATIBILITY IDEOGRAPH-FAD7;Lo;0;L;27ED3;;;;N;;;;; FAD8;CJK COMPATIBILITY IDEOGRAPH-FAD8;Lo;0;L;9F43;;;;N;;;;; FAD9;CJK COMPATIBILITY IDEOGRAPH-FAD9;Lo;0;L;9F8E;;;;N;;;;; FB00;LATIN SMALL LIGATURE FF;Ll;0;L; 0066 0066;;;;N;;;;; FB01;LATIN SMALL LIGATURE FI;Ll;0;L; 0066 0069;;;;N;;;;; FB02;LATIN SMALL LIGATURE FL;Ll;0;L; 0066 006C;;;;N;;;;; FB03;LATIN SMALL LIGATURE FFI;Ll;0;L; 0066 0066 0069;;;;N;;;;; FB04;LATIN SMALL LIGATURE FFL;Ll;0;L; 0066 0066 006C;;;;N;;;;; FB05;LATIN SMALL LIGATURE LONG S T;Ll;0;L; 017F 0074;;;;N;;;;; FB06;LATIN SMALL LIGATURE ST;Ll;0;L; 0073 0074;;;;N;;;;; FB13;ARMENIAN SMALL LIGATURE MEN NOW;Ll;0;L; 0574 0576;;;;N;;;;; FB14;ARMENIAN SMALL LIGATURE MEN ECH;Ll;0;L; 0574 0565;;;;N;;;;; FB15;ARMENIAN SMALL LIGATURE MEN INI;Ll;0;L; 0574 056B;;;;N;;;;; FB16;ARMENIAN SMALL LIGATURE VEW NOW;Ll;0;L; 057E 0576;;;;N;;;;; FB17;ARMENIAN SMALL LIGATURE MEN XEH;Ll;0;L; 0574 056D;;;;N;;;;; FB1D;HEBREW LETTER YOD WITH HIRIQ;Lo;0;R;05D9 05B4;;;;N;;;;; FB1E;HEBREW POINT JUDEO-SPANISH VARIKA;Mn;26;NSM;;;;;N;HEBREW POINT VARIKA;;;; FB1F;HEBREW LIGATURE YIDDISH YOD YOD PATAH;Lo;0;R;05F2 05B7;;;;N;;;;; FB20;HEBREW LETTER ALTERNATIVE AYIN;Lo;0;R; 05E2;;;;N;;;;; FB21;HEBREW LETTER WIDE ALEF;Lo;0;R; 05D0;;;;N;;;;; FB22;HEBREW LETTER WIDE DALET;Lo;0;R; 05D3;;;;N;;;;; FB23;HEBREW LETTER WIDE HE;Lo;0;R; 05D4;;;;N;;;;; FB24;HEBREW LETTER WIDE KAF;Lo;0;R; 05DB;;;;N;;;;; FB25;HEBREW LETTER WIDE LAMED;Lo;0;R; 05DC;;;;N;;;;; FB26;HEBREW LETTER WIDE FINAL MEM;Lo;0;R; 05DD;;;;N;;;;; FB27;HEBREW LETTER WIDE RESH;Lo;0;R; 05E8;;;;N;;;;; FB28;HEBREW LETTER WIDE TAV;Lo;0;R; 05EA;;;;N;;;;; FB29;HEBREW LETTER ALTERNATIVE PLUS SIGN;Sm;0;ES; 002B;;;;N;;;;; FB2A;HEBREW LETTER SHIN WITH SHIN DOT;Lo;0;R;05E9 05C1;;;;N;;;;; FB2B;HEBREW LETTER SHIN WITH SIN DOT;Lo;0;R;05E9 05C2;;;;N;;;;; FB2C;HEBREW LETTER SHIN WITH DAGESH AND SHIN DOT;Lo;0;R;FB49 05C1;;;;N;;;;; FB2D;HEBREW LETTER SHIN WITH DAGESH AND SIN DOT;Lo;0;R;FB49 05C2;;;;N;;;;; FB2E;HEBREW LETTER ALEF WITH PATAH;Lo;0;R;05D0 05B7;;;;N;;;;; FB2F;HEBREW LETTER ALEF WITH QAMATS;Lo;0;R;05D0 05B8;;;;N;;;;; FB30;HEBREW LETTER ALEF WITH MAPIQ;Lo;0;R;05D0 05BC;;;;N;;;;; FB31;HEBREW LETTER BET WITH DAGESH;Lo;0;R;05D1 05BC;;;;N;;;;; FB32;HEBREW LETTER GIMEL WITH DAGESH;Lo;0;R;05D2 05BC;;;;N;;;;; FB33;HEBREW LETTER DALET WITH DAGESH;Lo;0;R;05D3 05BC;;;;N;;;;; FB34;HEBREW LETTER HE WITH MAPIQ;Lo;0;R;05D4 05BC;;;;N;;;;; FB35;HEBREW LETTER VAV WITH DAGESH;Lo;0;R;05D5 05BC;;;;N;;;;; FB36;HEBREW LETTER ZAYIN WITH DAGESH;Lo;0;R;05D6 05BC;;;;N;;;;; FB38;HEBREW LETTER TET WITH DAGESH;Lo;0;R;05D8 05BC;;;;N;;;;; FB39;HEBREW LETTER YOD WITH DAGESH;Lo;0;R;05D9 05BC;;;;N;;;;; FB3A;HEBREW LETTER FINAL KAF WITH DAGESH;Lo;0;R;05DA 05BC;;;;N;;;;; FB3B;HEBREW LETTER KAF WITH DAGESH;Lo;0;R;05DB 05BC;;;;N;;;;; FB3C;HEBREW LETTER LAMED WITH DAGESH;Lo;0;R;05DC 05BC;;;;N;;;;; FB3E;HEBREW LETTER MEM WITH DAGESH;Lo;0;R;05DE 05BC;;;;N;;;;; FB40;HEBREW LETTER NUN WITH DAGESH;Lo;0;R;05E0 05BC;;;;N;;;;; FB41;HEBREW LETTER SAMEKH WITH DAGESH;Lo;0;R;05E1 05BC;;;;N;;;;; FB43;HEBREW LETTER FINAL PE WITH DAGESH;Lo;0;R;05E3 05BC;;;;N;;;;; FB44;HEBREW LETTER PE WITH DAGESH;Lo;0;R;05E4 05BC;;;;N;;;;; FB46;HEBREW LETTER TSADI WITH DAGESH;Lo;0;R;05E6 05BC;;;;N;;;;; FB47;HEBREW LETTER QOF WITH DAGESH;Lo;0;R;05E7 05BC;;;;N;;;;; FB48;HEBREW LETTER RESH WITH DAGESH;Lo;0;R;05E8 05BC;;;;N;;;;; FB49;HEBREW LETTER SHIN WITH DAGESH;Lo;0;R;05E9 05BC;;;;N;;;;; FB4A;HEBREW LETTER TAV WITH DAGESH;Lo;0;R;05EA 05BC;;;;N;;;;; FB4B;HEBREW LETTER VAV WITH HOLAM;Lo;0;R;05D5 05B9;;;;N;;;;; FB4C;HEBREW LETTER BET WITH RAFE;Lo;0;R;05D1 05BF;;;;N;;;;; FB4D;HEBREW LETTER KAF WITH RAFE;Lo;0;R;05DB 05BF;;;;N;;;;; FB4E;HEBREW LETTER PE WITH RAFE;Lo;0;R;05E4 05BF;;;;N;;;;; FB4F;HEBREW LIGATURE ALEF LAMED;Lo;0;R; 05D0 05DC;;;;N;;;;; FB50;ARABIC LETTER ALEF WASLA ISOLATED FORM;Lo;0;AL; 0671;;;;N;;;;; FB51;ARABIC LETTER ALEF WASLA FINAL FORM;Lo;0;AL; 0671;;;;N;;;;; FB52;ARABIC LETTER BEEH ISOLATED FORM;Lo;0;AL; 067B;;;;N;;;;; FB53;ARABIC LETTER BEEH FINAL FORM;Lo;0;AL; 067B;;;;N;;;;; FB54;ARABIC LETTER BEEH INITIAL FORM;Lo;0;AL; 067B;;;;N;;;;; FB55;ARABIC LETTER BEEH MEDIAL FORM;Lo;0;AL; 067B;;;;N;;;;; FB56;ARABIC LETTER PEH ISOLATED FORM;Lo;0;AL; 067E;;;;N;;;;; FB57;ARABIC LETTER PEH FINAL FORM;Lo;0;AL; 067E;;;;N;;;;; FB58;ARABIC LETTER PEH INITIAL FORM;Lo;0;AL; 067E;;;;N;;;;; FB59;ARABIC LETTER PEH MEDIAL FORM;Lo;0;AL; 067E;;;;N;;;;; FB5A;ARABIC LETTER BEHEH ISOLATED FORM;Lo;0;AL; 0680;;;;N;;;;; FB5B;ARABIC LETTER BEHEH FINAL FORM;Lo;0;AL; 0680;;;;N;;;;; FB5C;ARABIC LETTER BEHEH INITIAL FORM;Lo;0;AL; 0680;;;;N;;;;; FB5D;ARABIC LETTER BEHEH MEDIAL FORM;Lo;0;AL; 0680;;;;N;;;;; FB5E;ARABIC LETTER TTEHEH ISOLATED FORM;Lo;0;AL; 067A;;;;N;;;;; FB5F;ARABIC LETTER TTEHEH FINAL FORM;Lo;0;AL; 067A;;;;N;;;;; FB60;ARABIC LETTER TTEHEH INITIAL FORM;Lo;0;AL; 067A;;;;N;;;;; FB61;ARABIC LETTER TTEHEH MEDIAL FORM;Lo;0;AL; 067A;;;;N;;;;; FB62;ARABIC LETTER TEHEH ISOLATED FORM;Lo;0;AL; 067F;;;;N;;;;; FB63;ARABIC LETTER TEHEH FINAL FORM;Lo;0;AL; 067F;;;;N;;;;; FB64;ARABIC LETTER TEHEH INITIAL FORM;Lo;0;AL; 067F;;;;N;;;;; FB65;ARABIC LETTER TEHEH MEDIAL FORM;Lo;0;AL; 067F;;;;N;;;;; FB66;ARABIC LETTER TTEH ISOLATED FORM;Lo;0;AL; 0679;;;;N;;;;; FB67;ARABIC LETTER TTEH FINAL FORM;Lo;0;AL; 0679;;;;N;;;;; FB68;ARABIC LETTER TTEH INITIAL FORM;Lo;0;AL; 0679;;;;N;;;;; FB69;ARABIC LETTER TTEH MEDIAL FORM;Lo;0;AL; 0679;;;;N;;;;; FB6A;ARABIC LETTER VEH ISOLATED FORM;Lo;0;AL; 06A4;;;;N;;;;; FB6B;ARABIC LETTER VEH FINAL FORM;Lo;0;AL; 06A4;;;;N;;;;; FB6C;ARABIC LETTER VEH INITIAL FORM;Lo;0;AL; 06A4;;;;N;;;;; FB6D;ARABIC LETTER VEH MEDIAL FORM;Lo;0;AL; 06A4;;;;N;;;;; FB6E;ARABIC LETTER PEHEH ISOLATED FORM;Lo;0;AL; 06A6;;;;N;;;;; FB6F;ARABIC LETTER PEHEH FINAL FORM;Lo;0;AL; 06A6;;;;N;;;;; FB70;ARABIC LETTER PEHEH INITIAL FORM;Lo;0;AL; 06A6;;;;N;;;;; FB71;ARABIC LETTER PEHEH MEDIAL FORM;Lo;0;AL; 06A6;;;;N;;;;; FB72;ARABIC LETTER DYEH ISOLATED FORM;Lo;0;AL; 0684;;;;N;;;;; FB73;ARABIC LETTER DYEH FINAL FORM;Lo;0;AL; 0684;;;;N;;;;; FB74;ARABIC LETTER DYEH INITIAL FORM;Lo;0;AL; 0684;;;;N;;;;; FB75;ARABIC LETTER DYEH MEDIAL FORM;Lo;0;AL; 0684;;;;N;;;;; FB76;ARABIC LETTER NYEH ISOLATED FORM;Lo;0;AL; 0683;;;;N;;;;; FB77;ARABIC LETTER NYEH FINAL FORM;Lo;0;AL; 0683;;;;N;;;;; FB78;ARABIC LETTER NYEH INITIAL FORM;Lo;0;AL; 0683;;;;N;;;;; FB79;ARABIC LETTER NYEH MEDIAL FORM;Lo;0;AL; 0683;;;;N;;;;; FB7A;ARABIC LETTER TCHEH ISOLATED FORM;Lo;0;AL; 0686;;;;N;;;;; FB7B;ARABIC LETTER TCHEH FINAL FORM;Lo;0;AL; 0686;;;;N;;;;; FB7C;ARABIC LETTER TCHEH INITIAL FORM;Lo;0;AL; 0686;;;;N;;;;; FB7D;ARABIC LETTER TCHEH MEDIAL FORM;Lo;0;AL; 0686;;;;N;;;;; FB7E;ARABIC LETTER TCHEHEH ISOLATED FORM;Lo;0;AL; 0687;;;;N;;;;; FB7F;ARABIC LETTER TCHEHEH FINAL FORM;Lo;0;AL; 0687;;;;N;;;;; FB80;ARABIC LETTER TCHEHEH INITIAL FORM;Lo;0;AL; 0687;;;;N;;;;; FB81;ARABIC LETTER TCHEHEH MEDIAL FORM;Lo;0;AL; 0687;;;;N;;;;; FB82;ARABIC LETTER DDAHAL ISOLATED FORM;Lo;0;AL; 068D;;;;N;;;;; FB83;ARABIC LETTER DDAHAL FINAL FORM;Lo;0;AL; 068D;;;;N;;;;; FB84;ARABIC LETTER DAHAL ISOLATED FORM;Lo;0;AL; 068C;;;;N;;;;; FB85;ARABIC LETTER DAHAL FINAL FORM;Lo;0;AL; 068C;;;;N;;;;; FB86;ARABIC LETTER DUL ISOLATED FORM;Lo;0;AL; 068E;;;;N;;;;; FB87;ARABIC LETTER DUL FINAL FORM;Lo;0;AL; 068E;;;;N;;;;; FB88;ARABIC LETTER DDAL ISOLATED FORM;Lo;0;AL; 0688;;;;N;;;;; FB89;ARABIC LETTER DDAL FINAL FORM;Lo;0;AL; 0688;;;;N;;;;; FB8A;ARABIC LETTER JEH ISOLATED FORM;Lo;0;AL; 0698;;;;N;;;;; FB8B;ARABIC LETTER JEH FINAL FORM;Lo;0;AL; 0698;;;;N;;;;; FB8C;ARABIC LETTER RREH ISOLATED FORM;Lo;0;AL; 0691;;;;N;;;;; FB8D;ARABIC LETTER RREH FINAL FORM;Lo;0;AL; 0691;;;;N;;;;; FB8E;ARABIC LETTER KEHEH ISOLATED FORM;Lo;0;AL; 06A9;;;;N;;;;; FB8F;ARABIC LETTER KEHEH FINAL FORM;Lo;0;AL; 06A9;;;;N;;;;; FB90;ARABIC LETTER KEHEH INITIAL FORM;Lo;0;AL; 06A9;;;;N;;;;; FB91;ARABIC LETTER KEHEH MEDIAL FORM;Lo;0;AL; 06A9;;;;N;;;;; FB92;ARABIC LETTER GAF ISOLATED FORM;Lo;0;AL; 06AF;;;;N;;;;; FB93;ARABIC LETTER GAF FINAL FORM;Lo;0;AL; 06AF;;;;N;;;;; FB94;ARABIC LETTER GAF INITIAL FORM;Lo;0;AL; 06AF;;;;N;;;;; FB95;ARABIC LETTER GAF MEDIAL FORM;Lo;0;AL; 06AF;;;;N;;;;; FB96;ARABIC LETTER GUEH ISOLATED FORM;Lo;0;AL; 06B3;;;;N;;;;; FB97;ARABIC LETTER GUEH FINAL FORM;Lo;0;AL; 06B3;;;;N;;;;; FB98;ARABIC LETTER GUEH INITIAL FORM;Lo;0;AL; 06B3;;;;N;;;;; FB99;ARABIC LETTER GUEH MEDIAL FORM;Lo;0;AL; 06B3;;;;N;;;;; FB9A;ARABIC LETTER NGOEH ISOLATED FORM;Lo;0;AL; 06B1;;;;N;;;;; FB9B;ARABIC LETTER NGOEH FINAL FORM;Lo;0;AL; 06B1;;;;N;;;;; FB9C;ARABIC LETTER NGOEH INITIAL FORM;Lo;0;AL; 06B1;;;;N;;;;; FB9D;ARABIC LETTER NGOEH MEDIAL FORM;Lo;0;AL; 06B1;;;;N;;;;; FB9E;ARABIC LETTER NOON GHUNNA ISOLATED FORM;Lo;0;AL; 06BA;;;;N;;;;; FB9F;ARABIC LETTER NOON GHUNNA FINAL FORM;Lo;0;AL; 06BA;;;;N;;;;; FBA0;ARABIC LETTER RNOON ISOLATED FORM;Lo;0;AL; 06BB;;;;N;;;;; FBA1;ARABIC LETTER RNOON FINAL FORM;Lo;0;AL; 06BB;;;;N;;;;; FBA2;ARABIC LETTER RNOON INITIAL FORM;Lo;0;AL; 06BB;;;;N;;;;; FBA3;ARABIC LETTER RNOON MEDIAL FORM;Lo;0;AL; 06BB;;;;N;;;;; FBA4;ARABIC LETTER HEH WITH YEH ABOVE ISOLATED FORM;Lo;0;AL; 06C0;;;;N;;;;; FBA5;ARABIC LETTER HEH WITH YEH ABOVE FINAL FORM;Lo;0;AL; 06C0;;;;N;;;;; FBA6;ARABIC LETTER HEH GOAL ISOLATED FORM;Lo;0;AL; 06C1;;;;N;;;;; FBA7;ARABIC LETTER HEH GOAL FINAL FORM;Lo;0;AL; 06C1;;;;N;;;;; FBA8;ARABIC LETTER HEH GOAL INITIAL FORM;Lo;0;AL; 06C1;;;;N;;;;; FBA9;ARABIC LETTER HEH GOAL MEDIAL FORM;Lo;0;AL; 06C1;;;;N;;;;; FBAA;ARABIC LETTER HEH DOACHASHMEE ISOLATED FORM;Lo;0;AL; 06BE;;;;N;;;;; FBAB;ARABIC LETTER HEH DOACHASHMEE FINAL FORM;Lo;0;AL; 06BE;;;;N;;;;; FBAC;ARABIC LETTER HEH DOACHASHMEE INITIAL FORM;Lo;0;AL; 06BE;;;;N;;;;; FBAD;ARABIC LETTER HEH DOACHASHMEE MEDIAL FORM;Lo;0;AL; 06BE;;;;N;;;;; FBAE;ARABIC LETTER YEH BARREE ISOLATED FORM;Lo;0;AL; 06D2;;;;N;;;;; FBAF;ARABIC LETTER YEH BARREE FINAL FORM;Lo;0;AL; 06D2;;;;N;;;;; FBB0;ARABIC LETTER YEH BARREE WITH HAMZA ABOVE ISOLATED FORM;Lo;0;AL; 06D3;;;;N;;;;; FBB1;ARABIC LETTER YEH BARREE WITH HAMZA ABOVE FINAL FORM;Lo;0;AL; 06D3;;;;N;;;;; FBB2;ARABIC SYMBOL DOT ABOVE;Sk;0;AL;;;;;N;;;;; FBB3;ARABIC SYMBOL DOT BELOW;Sk;0;AL;;;;;N;;;;; FBB4;ARABIC SYMBOL TWO DOTS ABOVE;Sk;0;AL;;;;;N;;;;; FBB5;ARABIC SYMBOL TWO DOTS BELOW;Sk;0;AL;;;;;N;;;;; FBB6;ARABIC SYMBOL THREE DOTS ABOVE;Sk;0;AL;;;;;N;;;;; FBB7;ARABIC SYMBOL THREE DOTS BELOW;Sk;0;AL;;;;;N;;;;; FBB8;ARABIC SYMBOL THREE DOTS POINTING DOWNWARDS ABOVE;Sk;0;AL;;;;;N;;;;; FBB9;ARABIC SYMBOL THREE DOTS POINTING DOWNWARDS BELOW;Sk;0;AL;;;;;N;;;;; FBBA;ARABIC SYMBOL FOUR DOTS ABOVE;Sk;0;AL;;;;;N;;;;; FBBB;ARABIC SYMBOL FOUR DOTS BELOW;Sk;0;AL;;;;;N;;;;; FBBC;ARABIC SYMBOL DOUBLE VERTICAL BAR BELOW;Sk;0;AL;;;;;N;;;;; FBBD;ARABIC SYMBOL TWO DOTS VERTICALLY ABOVE;Sk;0;AL;;;;;N;;;;; FBBE;ARABIC SYMBOL TWO DOTS VERTICALLY BELOW;Sk;0;AL;;;;;N;;;;; FBBF;ARABIC SYMBOL RING;Sk;0;AL;;;;;N;;;;; FBC0;ARABIC SYMBOL SMALL TAH ABOVE;Sk;0;AL;;;;;N;;;;; FBC1;ARABIC SYMBOL SMALL TAH BELOW;Sk;0;AL;;;;;N;;;;; FBD3;ARABIC LETTER NG ISOLATED FORM;Lo;0;AL; 06AD;;;;N;;;;; FBD4;ARABIC LETTER NG FINAL FORM;Lo;0;AL; 06AD;;;;N;;;;; FBD5;ARABIC LETTER NG INITIAL FORM;Lo;0;AL; 06AD;;;;N;;;;; FBD6;ARABIC LETTER NG MEDIAL FORM;Lo;0;AL; 06AD;;;;N;;;;; FBD7;ARABIC LETTER U ISOLATED FORM;Lo;0;AL; 06C7;;;;N;;;;; FBD8;ARABIC LETTER U FINAL FORM;Lo;0;AL; 06C7;;;;N;;;;; FBD9;ARABIC LETTER OE ISOLATED FORM;Lo;0;AL; 06C6;;;;N;;;;; FBDA;ARABIC LETTER OE FINAL FORM;Lo;0;AL; 06C6;;;;N;;;;; FBDB;ARABIC LETTER YU ISOLATED FORM;Lo;0;AL; 06C8;;;;N;;;;; FBDC;ARABIC LETTER YU FINAL FORM;Lo;0;AL; 06C8;;;;N;;;;; FBDD;ARABIC LETTER U WITH HAMZA ABOVE ISOLATED FORM;Lo;0;AL; 0677;;;;N;;;;; FBDE;ARABIC LETTER VE ISOLATED FORM;Lo;0;AL; 06CB;;;;N;;;;; FBDF;ARABIC LETTER VE FINAL FORM;Lo;0;AL; 06CB;;;;N;;;;; FBE0;ARABIC LETTER KIRGHIZ OE ISOLATED FORM;Lo;0;AL; 06C5;;;;N;;;;; FBE1;ARABIC LETTER KIRGHIZ OE FINAL FORM;Lo;0;AL; 06C5;;;;N;;;;; FBE2;ARABIC LETTER KIRGHIZ YU ISOLATED FORM;Lo;0;AL; 06C9;;;;N;;;;; FBE3;ARABIC LETTER KIRGHIZ YU FINAL FORM;Lo;0;AL; 06C9;;;;N;;;;; FBE4;ARABIC LETTER E ISOLATED FORM;Lo;0;AL; 06D0;;;;N;;;;; FBE5;ARABIC LETTER E FINAL FORM;Lo;0;AL; 06D0;;;;N;;;;; FBE6;ARABIC LETTER E INITIAL FORM;Lo;0;AL; 06D0;;;;N;;;;; FBE7;ARABIC LETTER E MEDIAL FORM;Lo;0;AL; 06D0;;;;N;;;;; FBE8;ARABIC LETTER UIGHUR KAZAKH KIRGHIZ ALEF MAKSURA INITIAL FORM;Lo;0;AL; 0649;;;;N;;;;; FBE9;ARABIC LETTER UIGHUR KAZAKH KIRGHIZ ALEF MAKSURA MEDIAL FORM;Lo;0;AL; 0649;;;;N;;;;; FBEA;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF ISOLATED FORM;Lo;0;AL; 0626 0627;;;;N;;;;; FBEB;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF FINAL FORM;Lo;0;AL; 0626 0627;;;;N;;;;; FBEC;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH AE ISOLATED FORM;Lo;0;AL; 0626 06D5;;;;N;;;;; FBED;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH AE FINAL FORM;Lo;0;AL; 0626 06D5;;;;N;;;;; FBEE;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH WAW ISOLATED FORM;Lo;0;AL; 0626 0648;;;;N;;;;; FBEF;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH WAW FINAL FORM;Lo;0;AL; 0626 0648;;;;N;;;;; FBF0;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH U ISOLATED FORM;Lo;0;AL; 0626 06C7;;;;N;;;;; FBF1;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH U FINAL FORM;Lo;0;AL; 0626 06C7;;;;N;;;;; FBF2;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH OE ISOLATED FORM;Lo;0;AL; 0626 06C6;;;;N;;;;; FBF3;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH OE FINAL FORM;Lo;0;AL; 0626 06C6;;;;N;;;;; FBF4;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH YU ISOLATED FORM;Lo;0;AL; 0626 06C8;;;;N;;;;; FBF5;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH YU FINAL FORM;Lo;0;AL; 0626 06C8;;;;N;;;;; FBF6;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH E ISOLATED FORM;Lo;0;AL; 0626 06D0;;;;N;;;;; FBF7;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH E FINAL FORM;Lo;0;AL; 0626 06D0;;;;N;;;;; FBF8;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH E INITIAL FORM;Lo;0;AL; 0626 06D0;;;;N;;;;; FBF9;ARABIC LIGATURE UIGHUR KIRGHIZ YEH WITH HAMZA ABOVE WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0626 0649;;;;N;;;;; FBFA;ARABIC LIGATURE UIGHUR KIRGHIZ YEH WITH HAMZA ABOVE WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0626 0649;;;;N;;;;; FBFB;ARABIC LIGATURE UIGHUR KIRGHIZ YEH WITH HAMZA ABOVE WITH ALEF MAKSURA INITIAL FORM;Lo;0;AL; 0626 0649;;;;N;;;;; FBFC;ARABIC LETTER FARSI YEH ISOLATED FORM;Lo;0;AL; 06CC;;;;N;;;;; FBFD;ARABIC LETTER FARSI YEH FINAL FORM;Lo;0;AL; 06CC;;;;N;;;;; FBFE;ARABIC LETTER FARSI YEH INITIAL FORM;Lo;0;AL; 06CC;;;;N;;;;; FBFF;ARABIC LETTER FARSI YEH MEDIAL FORM;Lo;0;AL; 06CC;;;;N;;;;; FC00;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH JEEM ISOLATED FORM;Lo;0;AL; 0626 062C;;;;N;;;;; FC01;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH HAH ISOLATED FORM;Lo;0;AL; 0626 062D;;;;N;;;;; FC02;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH MEEM ISOLATED FORM;Lo;0;AL; 0626 0645;;;;N;;;;; FC03;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0626 0649;;;;N;;;;; FC04;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH YEH ISOLATED FORM;Lo;0;AL; 0626 064A;;;;N;;;;; FC05;ARABIC LIGATURE BEH WITH JEEM ISOLATED FORM;Lo;0;AL; 0628 062C;;;;N;;;;; FC06;ARABIC LIGATURE BEH WITH HAH ISOLATED FORM;Lo;0;AL; 0628 062D;;;;N;;;;; FC07;ARABIC LIGATURE BEH WITH KHAH ISOLATED FORM;Lo;0;AL; 0628 062E;;;;N;;;;; FC08;ARABIC LIGATURE BEH WITH MEEM ISOLATED FORM;Lo;0;AL; 0628 0645;;;;N;;;;; FC09;ARABIC LIGATURE BEH WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0628 0649;;;;N;;;;; FC0A;ARABIC LIGATURE BEH WITH YEH ISOLATED FORM;Lo;0;AL; 0628 064A;;;;N;;;;; FC0B;ARABIC LIGATURE TEH WITH JEEM ISOLATED FORM;Lo;0;AL; 062A 062C;;;;N;;;;; FC0C;ARABIC LIGATURE TEH WITH HAH ISOLATED FORM;Lo;0;AL; 062A 062D;;;;N;;;;; FC0D;ARABIC LIGATURE TEH WITH KHAH ISOLATED FORM;Lo;0;AL; 062A 062E;;;;N;;;;; FC0E;ARABIC LIGATURE TEH WITH MEEM ISOLATED FORM;Lo;0;AL; 062A 0645;;;;N;;;;; FC0F;ARABIC LIGATURE TEH WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 062A 0649;;;;N;;;;; FC10;ARABIC LIGATURE TEH WITH YEH ISOLATED FORM;Lo;0;AL; 062A 064A;;;;N;;;;; FC11;ARABIC LIGATURE THEH WITH JEEM ISOLATED FORM;Lo;0;AL; 062B 062C;;;;N;;;;; FC12;ARABIC LIGATURE THEH WITH MEEM ISOLATED FORM;Lo;0;AL; 062B 0645;;;;N;;;;; FC13;ARABIC LIGATURE THEH WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 062B 0649;;;;N;;;;; FC14;ARABIC LIGATURE THEH WITH YEH ISOLATED FORM;Lo;0;AL; 062B 064A;;;;N;;;;; FC15;ARABIC LIGATURE JEEM WITH HAH ISOLATED FORM;Lo;0;AL; 062C 062D;;;;N;;;;; FC16;ARABIC LIGATURE JEEM WITH MEEM ISOLATED FORM;Lo;0;AL; 062C 0645;;;;N;;;;; FC17;ARABIC LIGATURE HAH WITH JEEM ISOLATED FORM;Lo;0;AL; 062D 062C;;;;N;;;;; FC18;ARABIC LIGATURE HAH WITH MEEM ISOLATED FORM;Lo;0;AL; 062D 0645;;;;N;;;;; FC19;ARABIC LIGATURE KHAH WITH JEEM ISOLATED FORM;Lo;0;AL; 062E 062C;;;;N;;;;; FC1A;ARABIC LIGATURE KHAH WITH HAH ISOLATED FORM;Lo;0;AL; 062E 062D;;;;N;;;;; FC1B;ARABIC LIGATURE KHAH WITH MEEM ISOLATED FORM;Lo;0;AL; 062E 0645;;;;N;;;;; FC1C;ARABIC LIGATURE SEEN WITH JEEM ISOLATED FORM;Lo;0;AL; 0633 062C;;;;N;;;;; FC1D;ARABIC LIGATURE SEEN WITH HAH ISOLATED FORM;Lo;0;AL; 0633 062D;;;;N;;;;; FC1E;ARABIC LIGATURE SEEN WITH KHAH ISOLATED FORM;Lo;0;AL; 0633 062E;;;;N;;;;; FC1F;ARABIC LIGATURE SEEN WITH MEEM ISOLATED FORM;Lo;0;AL; 0633 0645;;;;N;;;;; FC20;ARABIC LIGATURE SAD WITH HAH ISOLATED FORM;Lo;0;AL; 0635 062D;;;;N;;;;; FC21;ARABIC LIGATURE SAD WITH MEEM ISOLATED FORM;Lo;0;AL; 0635 0645;;;;N;;;;; FC22;ARABIC LIGATURE DAD WITH JEEM ISOLATED FORM;Lo;0;AL; 0636 062C;;;;N;;;;; FC23;ARABIC LIGATURE DAD WITH HAH ISOLATED FORM;Lo;0;AL; 0636 062D;;;;N;;;;; FC24;ARABIC LIGATURE DAD WITH KHAH ISOLATED FORM;Lo;0;AL; 0636 062E;;;;N;;;;; FC25;ARABIC LIGATURE DAD WITH MEEM ISOLATED FORM;Lo;0;AL; 0636 0645;;;;N;;;;; FC26;ARABIC LIGATURE TAH WITH HAH ISOLATED FORM;Lo;0;AL; 0637 062D;;;;N;;;;; FC27;ARABIC LIGATURE TAH WITH MEEM ISOLATED FORM;Lo;0;AL; 0637 0645;;;;N;;;;; FC28;ARABIC LIGATURE ZAH WITH MEEM ISOLATED FORM;Lo;0;AL; 0638 0645;;;;N;;;;; FC29;ARABIC LIGATURE AIN WITH JEEM ISOLATED FORM;Lo;0;AL; 0639 062C;;;;N;;;;; FC2A;ARABIC LIGATURE AIN WITH MEEM ISOLATED FORM;Lo;0;AL; 0639 0645;;;;N;;;;; FC2B;ARABIC LIGATURE GHAIN WITH JEEM ISOLATED FORM;Lo;0;AL; 063A 062C;;;;N;;;;; FC2C;ARABIC LIGATURE GHAIN WITH MEEM ISOLATED FORM;Lo;0;AL; 063A 0645;;;;N;;;;; FC2D;ARABIC LIGATURE FEH WITH JEEM ISOLATED FORM;Lo;0;AL; 0641 062C;;;;N;;;;; FC2E;ARABIC LIGATURE FEH WITH HAH ISOLATED FORM;Lo;0;AL; 0641 062D;;;;N;;;;; FC2F;ARABIC LIGATURE FEH WITH KHAH ISOLATED FORM;Lo;0;AL; 0641 062E;;;;N;;;;; FC30;ARABIC LIGATURE FEH WITH MEEM ISOLATED FORM;Lo;0;AL; 0641 0645;;;;N;;;;; FC31;ARABIC LIGATURE FEH WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0641 0649;;;;N;;;;; FC32;ARABIC LIGATURE FEH WITH YEH ISOLATED FORM;Lo;0;AL; 0641 064A;;;;N;;;;; FC33;ARABIC LIGATURE QAF WITH HAH ISOLATED FORM;Lo;0;AL; 0642 062D;;;;N;;;;; FC34;ARABIC LIGATURE QAF WITH MEEM ISOLATED FORM;Lo;0;AL; 0642 0645;;;;N;;;;; FC35;ARABIC LIGATURE QAF WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0642 0649;;;;N;;;;; FC36;ARABIC LIGATURE QAF WITH YEH ISOLATED FORM;Lo;0;AL; 0642 064A;;;;N;;;;; FC37;ARABIC LIGATURE KAF WITH ALEF ISOLATED FORM;Lo;0;AL; 0643 0627;;;;N;;;;; FC38;ARABIC LIGATURE KAF WITH JEEM ISOLATED FORM;Lo;0;AL; 0643 062C;;;;N;;;;; FC39;ARABIC LIGATURE KAF WITH HAH ISOLATED FORM;Lo;0;AL; 0643 062D;;;;N;;;;; FC3A;ARABIC LIGATURE KAF WITH KHAH ISOLATED FORM;Lo;0;AL; 0643 062E;;;;N;;;;; FC3B;ARABIC LIGATURE KAF WITH LAM ISOLATED FORM;Lo;0;AL; 0643 0644;;;;N;;;;; FC3C;ARABIC LIGATURE KAF WITH MEEM ISOLATED FORM;Lo;0;AL; 0643 0645;;;;N;;;;; FC3D;ARABIC LIGATURE KAF WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0643 0649;;;;N;;;;; FC3E;ARABIC LIGATURE KAF WITH YEH ISOLATED FORM;Lo;0;AL; 0643 064A;;;;N;;;;; FC3F;ARABIC LIGATURE LAM WITH JEEM ISOLATED FORM;Lo;0;AL; 0644 062C;;;;N;;;;; FC40;ARABIC LIGATURE LAM WITH HAH ISOLATED FORM;Lo;0;AL; 0644 062D;;;;N;;;;; FC41;ARABIC LIGATURE LAM WITH KHAH ISOLATED FORM;Lo;0;AL; 0644 062E;;;;N;;;;; FC42;ARABIC LIGATURE LAM WITH MEEM ISOLATED FORM;Lo;0;AL; 0644 0645;;;;N;;;;; FC43;ARABIC LIGATURE LAM WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0644 0649;;;;N;;;;; FC44;ARABIC LIGATURE LAM WITH YEH ISOLATED FORM;Lo;0;AL; 0644 064A;;;;N;;;;; FC45;ARABIC LIGATURE MEEM WITH JEEM ISOLATED FORM;Lo;0;AL; 0645 062C;;;;N;;;;; FC46;ARABIC LIGATURE MEEM WITH HAH ISOLATED FORM;Lo;0;AL; 0645 062D;;;;N;;;;; FC47;ARABIC LIGATURE MEEM WITH KHAH ISOLATED FORM;Lo;0;AL; 0645 062E;;;;N;;;;; FC48;ARABIC LIGATURE MEEM WITH MEEM ISOLATED FORM;Lo;0;AL; 0645 0645;;;;N;;;;; FC49;ARABIC LIGATURE MEEM WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0645 0649;;;;N;;;;; FC4A;ARABIC LIGATURE MEEM WITH YEH ISOLATED FORM;Lo;0;AL; 0645 064A;;;;N;;;;; FC4B;ARABIC LIGATURE NOON WITH JEEM ISOLATED FORM;Lo;0;AL; 0646 062C;;;;N;;;;; FC4C;ARABIC LIGATURE NOON WITH HAH ISOLATED FORM;Lo;0;AL; 0646 062D;;;;N;;;;; FC4D;ARABIC LIGATURE NOON WITH KHAH ISOLATED FORM;Lo;0;AL; 0646 062E;;;;N;;;;; FC4E;ARABIC LIGATURE NOON WITH MEEM ISOLATED FORM;Lo;0;AL; 0646 0645;;;;N;;;;; FC4F;ARABIC LIGATURE NOON WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0646 0649;;;;N;;;;; FC50;ARABIC LIGATURE NOON WITH YEH ISOLATED FORM;Lo;0;AL; 0646 064A;;;;N;;;;; FC51;ARABIC LIGATURE HEH WITH JEEM ISOLATED FORM;Lo;0;AL; 0647 062C;;;;N;;;;; FC52;ARABIC LIGATURE HEH WITH MEEM ISOLATED FORM;Lo;0;AL; 0647 0645;;;;N;;;;; FC53;ARABIC LIGATURE HEH WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0647 0649;;;;N;;;;; FC54;ARABIC LIGATURE HEH WITH YEH ISOLATED FORM;Lo;0;AL; 0647 064A;;;;N;;;;; FC55;ARABIC LIGATURE YEH WITH JEEM ISOLATED FORM;Lo;0;AL; 064A 062C;;;;N;;;;; FC56;ARABIC LIGATURE YEH WITH HAH ISOLATED FORM;Lo;0;AL; 064A 062D;;;;N;;;;; FC57;ARABIC LIGATURE YEH WITH KHAH ISOLATED FORM;Lo;0;AL; 064A 062E;;;;N;;;;; FC58;ARABIC LIGATURE YEH WITH MEEM ISOLATED FORM;Lo;0;AL; 064A 0645;;;;N;;;;; FC59;ARABIC LIGATURE YEH WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 064A 0649;;;;N;;;;; FC5A;ARABIC LIGATURE YEH WITH YEH ISOLATED FORM;Lo;0;AL; 064A 064A;;;;N;;;;; FC5B;ARABIC LIGATURE THAL WITH SUPERSCRIPT ALEF ISOLATED FORM;Lo;0;AL; 0630 0670;;;;N;;;;; FC5C;ARABIC LIGATURE REH WITH SUPERSCRIPT ALEF ISOLATED FORM;Lo;0;AL; 0631 0670;;;;N;;;;; FC5D;ARABIC LIGATURE ALEF MAKSURA WITH SUPERSCRIPT ALEF ISOLATED FORM;Lo;0;AL; 0649 0670;;;;N;;;;; FC5E;ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM;Lo;0;AL; 0020 064C 0651;;;;N;;;;; FC5F;ARABIC LIGATURE SHADDA WITH KASRATAN ISOLATED FORM;Lo;0;AL; 0020 064D 0651;;;;N;;;;; FC60;ARABIC LIGATURE SHADDA WITH FATHA ISOLATED FORM;Lo;0;AL; 0020 064E 0651;;;;N;;;;; FC61;ARABIC LIGATURE SHADDA WITH DAMMA ISOLATED FORM;Lo;0;AL; 0020 064F 0651;;;;N;;;;; FC62;ARABIC LIGATURE SHADDA WITH KASRA ISOLATED FORM;Lo;0;AL; 0020 0650 0651;;;;N;;;;; FC63;ARABIC LIGATURE SHADDA WITH SUPERSCRIPT ALEF ISOLATED FORM;Lo;0;AL; 0020 0651 0670;;;;N;;;;; FC64;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH REH FINAL FORM;Lo;0;AL; 0626 0631;;;;N;;;;; FC65;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ZAIN FINAL FORM;Lo;0;AL; 0626 0632;;;;N;;;;; FC66;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH MEEM FINAL FORM;Lo;0;AL; 0626 0645;;;;N;;;;; FC67;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH NOON FINAL FORM;Lo;0;AL; 0626 0646;;;;N;;;;; FC68;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0626 0649;;;;N;;;;; FC69;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH YEH FINAL FORM;Lo;0;AL; 0626 064A;;;;N;;;;; FC6A;ARABIC LIGATURE BEH WITH REH FINAL FORM;Lo;0;AL; 0628 0631;;;;N;;;;; FC6B;ARABIC LIGATURE BEH WITH ZAIN FINAL FORM;Lo;0;AL; 0628 0632;;;;N;;;;; FC6C;ARABIC LIGATURE BEH WITH MEEM FINAL FORM;Lo;0;AL; 0628 0645;;;;N;;;;; FC6D;ARABIC LIGATURE BEH WITH NOON FINAL FORM;Lo;0;AL; 0628 0646;;;;N;;;;; FC6E;ARABIC LIGATURE BEH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0628 0649;;;;N;;;;; FC6F;ARABIC LIGATURE BEH WITH YEH FINAL FORM;Lo;0;AL; 0628 064A;;;;N;;;;; FC70;ARABIC LIGATURE TEH WITH REH FINAL FORM;Lo;0;AL; 062A 0631;;;;N;;;;; FC71;ARABIC LIGATURE TEH WITH ZAIN FINAL FORM;Lo;0;AL; 062A 0632;;;;N;;;;; FC72;ARABIC LIGATURE TEH WITH MEEM FINAL FORM;Lo;0;AL; 062A 0645;;;;N;;;;; FC73;ARABIC LIGATURE TEH WITH NOON FINAL FORM;Lo;0;AL; 062A 0646;;;;N;;;;; FC74;ARABIC LIGATURE TEH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 062A 0649;;;;N;;;;; FC75;ARABIC LIGATURE TEH WITH YEH FINAL FORM;Lo;0;AL; 062A 064A;;;;N;;;;; FC76;ARABIC LIGATURE THEH WITH REH FINAL FORM;Lo;0;AL; 062B 0631;;;;N;;;;; FC77;ARABIC LIGATURE THEH WITH ZAIN FINAL FORM;Lo;0;AL; 062B 0632;;;;N;;;;; FC78;ARABIC LIGATURE THEH WITH MEEM FINAL FORM;Lo;0;AL; 062B 0645;;;;N;;;;; FC79;ARABIC LIGATURE THEH WITH NOON FINAL FORM;Lo;0;AL; 062B 0646;;;;N;;;;; FC7A;ARABIC LIGATURE THEH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 062B 0649;;;;N;;;;; FC7B;ARABIC LIGATURE THEH WITH YEH FINAL FORM;Lo;0;AL; 062B 064A;;;;N;;;;; FC7C;ARABIC LIGATURE FEH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0641 0649;;;;N;;;;; FC7D;ARABIC LIGATURE FEH WITH YEH FINAL FORM;Lo;0;AL; 0641 064A;;;;N;;;;; FC7E;ARABIC LIGATURE QAF WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0642 0649;;;;N;;;;; FC7F;ARABIC LIGATURE QAF WITH YEH FINAL FORM;Lo;0;AL; 0642 064A;;;;N;;;;; FC80;ARABIC LIGATURE KAF WITH ALEF FINAL FORM;Lo;0;AL; 0643 0627;;;;N;;;;; FC81;ARABIC LIGATURE KAF WITH LAM FINAL FORM;Lo;0;AL; 0643 0644;;;;N;;;;; FC82;ARABIC LIGATURE KAF WITH MEEM FINAL FORM;Lo;0;AL; 0643 0645;;;;N;;;;; FC83;ARABIC LIGATURE KAF WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0643 0649;;;;N;;;;; FC84;ARABIC LIGATURE KAF WITH YEH FINAL FORM;Lo;0;AL; 0643 064A;;;;N;;;;; FC85;ARABIC LIGATURE LAM WITH MEEM FINAL FORM;Lo;0;AL; 0644 0645;;;;N;;;;; FC86;ARABIC LIGATURE LAM WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0644 0649;;;;N;;;;; FC87;ARABIC LIGATURE LAM WITH YEH FINAL FORM;Lo;0;AL; 0644 064A;;;;N;;;;; FC88;ARABIC LIGATURE MEEM WITH ALEF FINAL FORM;Lo;0;AL; 0645 0627;;;;N;;;;; FC89;ARABIC LIGATURE MEEM WITH MEEM FINAL FORM;Lo;0;AL; 0645 0645;;;;N;;;;; FC8A;ARABIC LIGATURE NOON WITH REH FINAL FORM;Lo;0;AL; 0646 0631;;;;N;;;;; FC8B;ARABIC LIGATURE NOON WITH ZAIN FINAL FORM;Lo;0;AL; 0646 0632;;;;N;;;;; FC8C;ARABIC LIGATURE NOON WITH MEEM FINAL FORM;Lo;0;AL; 0646 0645;;;;N;;;;; FC8D;ARABIC LIGATURE NOON WITH NOON FINAL FORM;Lo;0;AL; 0646 0646;;;;N;;;;; FC8E;ARABIC LIGATURE NOON WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0646 0649;;;;N;;;;; FC8F;ARABIC LIGATURE NOON WITH YEH FINAL FORM;Lo;0;AL; 0646 064A;;;;N;;;;; FC90;ARABIC LIGATURE ALEF MAKSURA WITH SUPERSCRIPT ALEF FINAL FORM;Lo;0;AL; 0649 0670;;;;N;;;;; FC91;ARABIC LIGATURE YEH WITH REH FINAL FORM;Lo;0;AL; 064A 0631;;;;N;;;;; FC92;ARABIC LIGATURE YEH WITH ZAIN FINAL FORM;Lo;0;AL; 064A 0632;;;;N;;;;; FC93;ARABIC LIGATURE YEH WITH MEEM FINAL FORM;Lo;0;AL; 064A 0645;;;;N;;;;; FC94;ARABIC LIGATURE YEH WITH NOON FINAL FORM;Lo;0;AL; 064A 0646;;;;N;;;;; FC95;ARABIC LIGATURE YEH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 064A 0649;;;;N;;;;; FC96;ARABIC LIGATURE YEH WITH YEH FINAL FORM;Lo;0;AL; 064A 064A;;;;N;;;;; FC97;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH JEEM INITIAL FORM;Lo;0;AL; 0626 062C;;;;N;;;;; FC98;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH HAH INITIAL FORM;Lo;0;AL; 0626 062D;;;;N;;;;; FC99;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH KHAH INITIAL FORM;Lo;0;AL; 0626 062E;;;;N;;;;; FC9A;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH MEEM INITIAL FORM;Lo;0;AL; 0626 0645;;;;N;;;;; FC9B;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH HEH INITIAL FORM;Lo;0;AL; 0626 0647;;;;N;;;;; FC9C;ARABIC LIGATURE BEH WITH JEEM INITIAL FORM;Lo;0;AL; 0628 062C;;;;N;;;;; FC9D;ARABIC LIGATURE BEH WITH HAH INITIAL FORM;Lo;0;AL; 0628 062D;;;;N;;;;; FC9E;ARABIC LIGATURE BEH WITH KHAH INITIAL FORM;Lo;0;AL; 0628 062E;;;;N;;;;; FC9F;ARABIC LIGATURE BEH WITH MEEM INITIAL FORM;Lo;0;AL; 0628 0645;;;;N;;;;; FCA0;ARABIC LIGATURE BEH WITH HEH INITIAL FORM;Lo;0;AL; 0628 0647;;;;N;;;;; FCA1;ARABIC LIGATURE TEH WITH JEEM INITIAL FORM;Lo;0;AL; 062A 062C;;;;N;;;;; FCA2;ARABIC LIGATURE TEH WITH HAH INITIAL FORM;Lo;0;AL; 062A 062D;;;;N;;;;; FCA3;ARABIC LIGATURE TEH WITH KHAH INITIAL FORM;Lo;0;AL; 062A 062E;;;;N;;;;; FCA4;ARABIC LIGATURE TEH WITH MEEM INITIAL FORM;Lo;0;AL; 062A 0645;;;;N;;;;; FCA5;ARABIC LIGATURE TEH WITH HEH INITIAL FORM;Lo;0;AL; 062A 0647;;;;N;;;;; FCA6;ARABIC LIGATURE THEH WITH MEEM INITIAL FORM;Lo;0;AL; 062B 0645;;;;N;;;;; FCA7;ARABIC LIGATURE JEEM WITH HAH INITIAL FORM;Lo;0;AL; 062C 062D;;;;N;;;;; FCA8;ARABIC LIGATURE JEEM WITH MEEM INITIAL FORM;Lo;0;AL; 062C 0645;;;;N;;;;; FCA9;ARABIC LIGATURE HAH WITH JEEM INITIAL FORM;Lo;0;AL; 062D 062C;;;;N;;;;; FCAA;ARABIC LIGATURE HAH WITH MEEM INITIAL FORM;Lo;0;AL; 062D 0645;;;;N;;;;; FCAB;ARABIC LIGATURE KHAH WITH JEEM INITIAL FORM;Lo;0;AL; 062E 062C;;;;N;;;;; FCAC;ARABIC LIGATURE KHAH WITH MEEM INITIAL FORM;Lo;0;AL; 062E 0645;;;;N;;;;; FCAD;ARABIC LIGATURE SEEN WITH JEEM INITIAL FORM;Lo;0;AL; 0633 062C;;;;N;;;;; FCAE;ARABIC LIGATURE SEEN WITH HAH INITIAL FORM;Lo;0;AL; 0633 062D;;;;N;;;;; FCAF;ARABIC LIGATURE SEEN WITH KHAH INITIAL FORM;Lo;0;AL; 0633 062E;;;;N;;;;; FCB0;ARABIC LIGATURE SEEN WITH MEEM INITIAL FORM;Lo;0;AL; 0633 0645;;;;N;;;;; FCB1;ARABIC LIGATURE SAD WITH HAH INITIAL FORM;Lo;0;AL; 0635 062D;;;;N;;;;; FCB2;ARABIC LIGATURE SAD WITH KHAH INITIAL FORM;Lo;0;AL; 0635 062E;;;;N;;;;; FCB3;ARABIC LIGATURE SAD WITH MEEM INITIAL FORM;Lo;0;AL; 0635 0645;;;;N;;;;; FCB4;ARABIC LIGATURE DAD WITH JEEM INITIAL FORM;Lo;0;AL; 0636 062C;;;;N;;;;; FCB5;ARABIC LIGATURE DAD WITH HAH INITIAL FORM;Lo;0;AL; 0636 062D;;;;N;;;;; FCB6;ARABIC LIGATURE DAD WITH KHAH INITIAL FORM;Lo;0;AL; 0636 062E;;;;N;;;;; FCB7;ARABIC LIGATURE DAD WITH MEEM INITIAL FORM;Lo;0;AL; 0636 0645;;;;N;;;;; FCB8;ARABIC LIGATURE TAH WITH HAH INITIAL FORM;Lo;0;AL; 0637 062D;;;;N;;;;; FCB9;ARABIC LIGATURE ZAH WITH MEEM INITIAL FORM;Lo;0;AL; 0638 0645;;;;N;;;;; FCBA;ARABIC LIGATURE AIN WITH JEEM INITIAL FORM;Lo;0;AL; 0639 062C;;;;N;;;;; FCBB;ARABIC LIGATURE AIN WITH MEEM INITIAL FORM;Lo;0;AL; 0639 0645;;;;N;;;;; FCBC;ARABIC LIGATURE GHAIN WITH JEEM INITIAL FORM;Lo;0;AL; 063A 062C;;;;N;;;;; FCBD;ARABIC LIGATURE GHAIN WITH MEEM INITIAL FORM;Lo;0;AL; 063A 0645;;;;N;;;;; FCBE;ARABIC LIGATURE FEH WITH JEEM INITIAL FORM;Lo;0;AL; 0641 062C;;;;N;;;;; FCBF;ARABIC LIGATURE FEH WITH HAH INITIAL FORM;Lo;0;AL; 0641 062D;;;;N;;;;; FCC0;ARABIC LIGATURE FEH WITH KHAH INITIAL FORM;Lo;0;AL; 0641 062E;;;;N;;;;; FCC1;ARABIC LIGATURE FEH WITH MEEM INITIAL FORM;Lo;0;AL; 0641 0645;;;;N;;;;; FCC2;ARABIC LIGATURE QAF WITH HAH INITIAL FORM;Lo;0;AL; 0642 062D;;;;N;;;;; FCC3;ARABIC LIGATURE QAF WITH MEEM INITIAL FORM;Lo;0;AL; 0642 0645;;;;N;;;;; FCC4;ARABIC LIGATURE KAF WITH JEEM INITIAL FORM;Lo;0;AL; 0643 062C;;;;N;;;;; FCC5;ARABIC LIGATURE KAF WITH HAH INITIAL FORM;Lo;0;AL; 0643 062D;;;;N;;;;; FCC6;ARABIC LIGATURE KAF WITH KHAH INITIAL FORM;Lo;0;AL; 0643 062E;;;;N;;;;; FCC7;ARABIC LIGATURE KAF WITH LAM INITIAL FORM;Lo;0;AL; 0643 0644;;;;N;;;;; FCC8;ARABIC LIGATURE KAF WITH MEEM INITIAL FORM;Lo;0;AL; 0643 0645;;;;N;;;;; FCC9;ARABIC LIGATURE LAM WITH JEEM INITIAL FORM;Lo;0;AL; 0644 062C;;;;N;;;;; FCCA;ARABIC LIGATURE LAM WITH HAH INITIAL FORM;Lo;0;AL; 0644 062D;;;;N;;;;; FCCB;ARABIC LIGATURE LAM WITH KHAH INITIAL FORM;Lo;0;AL; 0644 062E;;;;N;;;;; FCCC;ARABIC LIGATURE LAM WITH MEEM INITIAL FORM;Lo;0;AL; 0644 0645;;;;N;;;;; FCCD;ARABIC LIGATURE LAM WITH HEH INITIAL FORM;Lo;0;AL; 0644 0647;;;;N;;;;; FCCE;ARABIC LIGATURE MEEM WITH JEEM INITIAL FORM;Lo;0;AL; 0645 062C;;;;N;;;;; FCCF;ARABIC LIGATURE MEEM WITH HAH INITIAL FORM;Lo;0;AL; 0645 062D;;;;N;;;;; FCD0;ARABIC LIGATURE MEEM WITH KHAH INITIAL FORM;Lo;0;AL; 0645 062E;;;;N;;;;; FCD1;ARABIC LIGATURE MEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0645 0645;;;;N;;;;; FCD2;ARABIC LIGATURE NOON WITH JEEM INITIAL FORM;Lo;0;AL; 0646 062C;;;;N;;;;; FCD3;ARABIC LIGATURE NOON WITH HAH INITIAL FORM;Lo;0;AL; 0646 062D;;;;N;;;;; FCD4;ARABIC LIGATURE NOON WITH KHAH INITIAL FORM;Lo;0;AL; 0646 062E;;;;N;;;;; FCD5;ARABIC LIGATURE NOON WITH MEEM INITIAL FORM;Lo;0;AL; 0646 0645;;;;N;;;;; FCD6;ARABIC LIGATURE NOON WITH HEH INITIAL FORM;Lo;0;AL; 0646 0647;;;;N;;;;; FCD7;ARABIC LIGATURE HEH WITH JEEM INITIAL FORM;Lo;0;AL; 0647 062C;;;;N;;;;; FCD8;ARABIC LIGATURE HEH WITH MEEM INITIAL FORM;Lo;0;AL; 0647 0645;;;;N;;;;; FCD9;ARABIC LIGATURE HEH WITH SUPERSCRIPT ALEF INITIAL FORM;Lo;0;AL; 0647 0670;;;;N;;;;; FCDA;ARABIC LIGATURE YEH WITH JEEM INITIAL FORM;Lo;0;AL; 064A 062C;;;;N;;;;; FCDB;ARABIC LIGATURE YEH WITH HAH INITIAL FORM;Lo;0;AL; 064A 062D;;;;N;;;;; FCDC;ARABIC LIGATURE YEH WITH KHAH INITIAL FORM;Lo;0;AL; 064A 062E;;;;N;;;;; FCDD;ARABIC LIGATURE YEH WITH MEEM INITIAL FORM;Lo;0;AL; 064A 0645;;;;N;;;;; FCDE;ARABIC LIGATURE YEH WITH HEH INITIAL FORM;Lo;0;AL; 064A 0647;;;;N;;;;; FCDF;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH MEEM MEDIAL FORM;Lo;0;AL; 0626 0645;;;;N;;;;; FCE0;ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH HEH MEDIAL FORM;Lo;0;AL; 0626 0647;;;;N;;;;; FCE1;ARABIC LIGATURE BEH WITH MEEM MEDIAL FORM;Lo;0;AL; 0628 0645;;;;N;;;;; FCE2;ARABIC LIGATURE BEH WITH HEH MEDIAL FORM;Lo;0;AL; 0628 0647;;;;N;;;;; FCE3;ARABIC LIGATURE TEH WITH MEEM MEDIAL FORM;Lo;0;AL; 062A 0645;;;;N;;;;; FCE4;ARABIC LIGATURE TEH WITH HEH MEDIAL FORM;Lo;0;AL; 062A 0647;;;;N;;;;; FCE5;ARABIC LIGATURE THEH WITH MEEM MEDIAL FORM;Lo;0;AL; 062B 0645;;;;N;;;;; FCE6;ARABIC LIGATURE THEH WITH HEH MEDIAL FORM;Lo;0;AL; 062B 0647;;;;N;;;;; FCE7;ARABIC LIGATURE SEEN WITH MEEM MEDIAL FORM;Lo;0;AL; 0633 0645;;;;N;;;;; FCE8;ARABIC LIGATURE SEEN WITH HEH MEDIAL FORM;Lo;0;AL; 0633 0647;;;;N;;;;; FCE9;ARABIC LIGATURE SHEEN WITH MEEM MEDIAL FORM;Lo;0;AL; 0634 0645;;;;N;;;;; FCEA;ARABIC LIGATURE SHEEN WITH HEH MEDIAL FORM;Lo;0;AL; 0634 0647;;;;N;;;;; FCEB;ARABIC LIGATURE KAF WITH LAM MEDIAL FORM;Lo;0;AL; 0643 0644;;;;N;;;;; FCEC;ARABIC LIGATURE KAF WITH MEEM MEDIAL FORM;Lo;0;AL; 0643 0645;;;;N;;;;; FCED;ARABIC LIGATURE LAM WITH MEEM MEDIAL FORM;Lo;0;AL; 0644 0645;;;;N;;;;; FCEE;ARABIC LIGATURE NOON WITH MEEM MEDIAL FORM;Lo;0;AL; 0646 0645;;;;N;;;;; FCEF;ARABIC LIGATURE NOON WITH HEH MEDIAL FORM;Lo;0;AL; 0646 0647;;;;N;;;;; FCF0;ARABIC LIGATURE YEH WITH MEEM MEDIAL FORM;Lo;0;AL; 064A 0645;;;;N;;;;; FCF1;ARABIC LIGATURE YEH WITH HEH MEDIAL FORM;Lo;0;AL; 064A 0647;;;;N;;;;; FCF2;ARABIC LIGATURE SHADDA WITH FATHA MEDIAL FORM;Lo;0;AL; 0640 064E 0651;;;;N;;;;; FCF3;ARABIC LIGATURE SHADDA WITH DAMMA MEDIAL FORM;Lo;0;AL; 0640 064F 0651;;;;N;;;;; FCF4;ARABIC LIGATURE SHADDA WITH KASRA MEDIAL FORM;Lo;0;AL; 0640 0650 0651;;;;N;;;;; FCF5;ARABIC LIGATURE TAH WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0637 0649;;;;N;;;;; FCF6;ARABIC LIGATURE TAH WITH YEH ISOLATED FORM;Lo;0;AL; 0637 064A;;;;N;;;;; FCF7;ARABIC LIGATURE AIN WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0639 0649;;;;N;;;;; FCF8;ARABIC LIGATURE AIN WITH YEH ISOLATED FORM;Lo;0;AL; 0639 064A;;;;N;;;;; FCF9;ARABIC LIGATURE GHAIN WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 063A 0649;;;;N;;;;; FCFA;ARABIC LIGATURE GHAIN WITH YEH ISOLATED FORM;Lo;0;AL; 063A 064A;;;;N;;;;; FCFB;ARABIC LIGATURE SEEN WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0633 0649;;;;N;;;;; FCFC;ARABIC LIGATURE SEEN WITH YEH ISOLATED FORM;Lo;0;AL; 0633 064A;;;;N;;;;; FCFD;ARABIC LIGATURE SHEEN WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0634 0649;;;;N;;;;; FCFE;ARABIC LIGATURE SHEEN WITH YEH ISOLATED FORM;Lo;0;AL; 0634 064A;;;;N;;;;; FCFF;ARABIC LIGATURE HAH WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 062D 0649;;;;N;;;;; FD00;ARABIC LIGATURE HAH WITH YEH ISOLATED FORM;Lo;0;AL; 062D 064A;;;;N;;;;; FD01;ARABIC LIGATURE JEEM WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 062C 0649;;;;N;;;;; FD02;ARABIC LIGATURE JEEM WITH YEH ISOLATED FORM;Lo;0;AL; 062C 064A;;;;N;;;;; FD03;ARABIC LIGATURE KHAH WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 062E 0649;;;;N;;;;; FD04;ARABIC LIGATURE KHAH WITH YEH ISOLATED FORM;Lo;0;AL; 062E 064A;;;;N;;;;; FD05;ARABIC LIGATURE SAD WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0635 0649;;;;N;;;;; FD06;ARABIC LIGATURE SAD WITH YEH ISOLATED FORM;Lo;0;AL; 0635 064A;;;;N;;;;; FD07;ARABIC LIGATURE DAD WITH ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0636 0649;;;;N;;;;; FD08;ARABIC LIGATURE DAD WITH YEH ISOLATED FORM;Lo;0;AL; 0636 064A;;;;N;;;;; FD09;ARABIC LIGATURE SHEEN WITH JEEM ISOLATED FORM;Lo;0;AL; 0634 062C;;;;N;;;;; FD0A;ARABIC LIGATURE SHEEN WITH HAH ISOLATED FORM;Lo;0;AL; 0634 062D;;;;N;;;;; FD0B;ARABIC LIGATURE SHEEN WITH KHAH ISOLATED FORM;Lo;0;AL; 0634 062E;;;;N;;;;; FD0C;ARABIC LIGATURE SHEEN WITH MEEM ISOLATED FORM;Lo;0;AL; 0634 0645;;;;N;;;;; FD0D;ARABIC LIGATURE SHEEN WITH REH ISOLATED FORM;Lo;0;AL; 0634 0631;;;;N;;;;; FD0E;ARABIC LIGATURE SEEN WITH REH ISOLATED FORM;Lo;0;AL; 0633 0631;;;;N;;;;; FD0F;ARABIC LIGATURE SAD WITH REH ISOLATED FORM;Lo;0;AL; 0635 0631;;;;N;;;;; FD10;ARABIC LIGATURE DAD WITH REH ISOLATED FORM;Lo;0;AL; 0636 0631;;;;N;;;;; FD11;ARABIC LIGATURE TAH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0637 0649;;;;N;;;;; FD12;ARABIC LIGATURE TAH WITH YEH FINAL FORM;Lo;0;AL; 0637 064A;;;;N;;;;; FD13;ARABIC LIGATURE AIN WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0639 0649;;;;N;;;;; FD14;ARABIC LIGATURE AIN WITH YEH FINAL FORM;Lo;0;AL; 0639 064A;;;;N;;;;; FD15;ARABIC LIGATURE GHAIN WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 063A 0649;;;;N;;;;; FD16;ARABIC LIGATURE GHAIN WITH YEH FINAL FORM;Lo;0;AL; 063A 064A;;;;N;;;;; FD17;ARABIC LIGATURE SEEN WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0633 0649;;;;N;;;;; FD18;ARABIC LIGATURE SEEN WITH YEH FINAL FORM;Lo;0;AL; 0633 064A;;;;N;;;;; FD19;ARABIC LIGATURE SHEEN WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0634 0649;;;;N;;;;; FD1A;ARABIC LIGATURE SHEEN WITH YEH FINAL FORM;Lo;0;AL; 0634 064A;;;;N;;;;; FD1B;ARABIC LIGATURE HAH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 062D 0649;;;;N;;;;; FD1C;ARABIC LIGATURE HAH WITH YEH FINAL FORM;Lo;0;AL; 062D 064A;;;;N;;;;; FD1D;ARABIC LIGATURE JEEM WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 062C 0649;;;;N;;;;; FD1E;ARABIC LIGATURE JEEM WITH YEH FINAL FORM;Lo;0;AL; 062C 064A;;;;N;;;;; FD1F;ARABIC LIGATURE KHAH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 062E 0649;;;;N;;;;; FD20;ARABIC LIGATURE KHAH WITH YEH FINAL FORM;Lo;0;AL; 062E 064A;;;;N;;;;; FD21;ARABIC LIGATURE SAD WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0635 0649;;;;N;;;;; FD22;ARABIC LIGATURE SAD WITH YEH FINAL FORM;Lo;0;AL; 0635 064A;;;;N;;;;; FD23;ARABIC LIGATURE DAD WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0636 0649;;;;N;;;;; FD24;ARABIC LIGATURE DAD WITH YEH FINAL FORM;Lo;0;AL; 0636 064A;;;;N;;;;; FD25;ARABIC LIGATURE SHEEN WITH JEEM FINAL FORM;Lo;0;AL; 0634 062C;;;;N;;;;; FD26;ARABIC LIGATURE SHEEN WITH HAH FINAL FORM;Lo;0;AL; 0634 062D;;;;N;;;;; FD27;ARABIC LIGATURE SHEEN WITH KHAH FINAL FORM;Lo;0;AL; 0634 062E;;;;N;;;;; FD28;ARABIC LIGATURE SHEEN WITH MEEM FINAL FORM;Lo;0;AL; 0634 0645;;;;N;;;;; FD29;ARABIC LIGATURE SHEEN WITH REH FINAL FORM;Lo;0;AL; 0634 0631;;;;N;;;;; FD2A;ARABIC LIGATURE SEEN WITH REH FINAL FORM;Lo;0;AL; 0633 0631;;;;N;;;;; FD2B;ARABIC LIGATURE SAD WITH REH FINAL FORM;Lo;0;AL; 0635 0631;;;;N;;;;; FD2C;ARABIC LIGATURE DAD WITH REH FINAL FORM;Lo;0;AL; 0636 0631;;;;N;;;;; FD2D;ARABIC LIGATURE SHEEN WITH JEEM INITIAL FORM;Lo;0;AL; 0634 062C;;;;N;;;;; FD2E;ARABIC LIGATURE SHEEN WITH HAH INITIAL FORM;Lo;0;AL; 0634 062D;;;;N;;;;; FD2F;ARABIC LIGATURE SHEEN WITH KHAH INITIAL FORM;Lo;0;AL; 0634 062E;;;;N;;;;; FD30;ARABIC LIGATURE SHEEN WITH MEEM INITIAL FORM;Lo;0;AL; 0634 0645;;;;N;;;;; FD31;ARABIC LIGATURE SEEN WITH HEH INITIAL FORM;Lo;0;AL; 0633 0647;;;;N;;;;; FD32;ARABIC LIGATURE SHEEN WITH HEH INITIAL FORM;Lo;0;AL; 0634 0647;;;;N;;;;; FD33;ARABIC LIGATURE TAH WITH MEEM INITIAL FORM;Lo;0;AL; 0637 0645;;;;N;;;;; FD34;ARABIC LIGATURE SEEN WITH JEEM MEDIAL FORM;Lo;0;AL; 0633 062C;;;;N;;;;; FD35;ARABIC LIGATURE SEEN WITH HAH MEDIAL FORM;Lo;0;AL; 0633 062D;;;;N;;;;; FD36;ARABIC LIGATURE SEEN WITH KHAH MEDIAL FORM;Lo;0;AL; 0633 062E;;;;N;;;;; FD37;ARABIC LIGATURE SHEEN WITH JEEM MEDIAL FORM;Lo;0;AL; 0634 062C;;;;N;;;;; FD38;ARABIC LIGATURE SHEEN WITH HAH MEDIAL FORM;Lo;0;AL; 0634 062D;;;;N;;;;; FD39;ARABIC LIGATURE SHEEN WITH KHAH MEDIAL FORM;Lo;0;AL; 0634 062E;;;;N;;;;; FD3A;ARABIC LIGATURE TAH WITH MEEM MEDIAL FORM;Lo;0;AL; 0637 0645;;;;N;;;;; FD3B;ARABIC LIGATURE ZAH WITH MEEM MEDIAL FORM;Lo;0;AL; 0638 0645;;;;N;;;;; FD3C;ARABIC LIGATURE ALEF WITH FATHATAN FINAL FORM;Lo;0;AL; 0627 064B;;;;N;;;;; FD3D;ARABIC LIGATURE ALEF WITH FATHATAN ISOLATED FORM;Lo;0;AL; 0627 064B;;;;N;;;;; FD3E;ORNATE LEFT PARENTHESIS;Ps;0;ON;;;;;N;;;;; FD3F;ORNATE RIGHT PARENTHESIS;Pe;0;ON;;;;;N;;;;; FD50;ARABIC LIGATURE TEH WITH JEEM WITH MEEM INITIAL FORM;Lo;0;AL; 062A 062C 0645;;;;N;;;;; FD51;ARABIC LIGATURE TEH WITH HAH WITH JEEM FINAL FORM;Lo;0;AL; 062A 062D 062C;;;;N;;;;; FD52;ARABIC LIGATURE TEH WITH HAH WITH JEEM INITIAL FORM;Lo;0;AL; 062A 062D 062C;;;;N;;;;; FD53;ARABIC LIGATURE TEH WITH HAH WITH MEEM INITIAL FORM;Lo;0;AL; 062A 062D 0645;;;;N;;;;; FD54;ARABIC LIGATURE TEH WITH KHAH WITH MEEM INITIAL FORM;Lo;0;AL; 062A 062E 0645;;;;N;;;;; FD55;ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM;Lo;0;AL; 062A 0645 062C;;;;N;;;;; FD56;ARABIC LIGATURE TEH WITH MEEM WITH HAH INITIAL FORM;Lo;0;AL; 062A 0645 062D;;;;N;;;;; FD57;ARABIC LIGATURE TEH WITH MEEM WITH KHAH INITIAL FORM;Lo;0;AL; 062A 0645 062E;;;;N;;;;; FD58;ARABIC LIGATURE JEEM WITH MEEM WITH HAH FINAL FORM;Lo;0;AL; 062C 0645 062D;;;;N;;;;; FD59;ARABIC LIGATURE JEEM WITH MEEM WITH HAH INITIAL FORM;Lo;0;AL; 062C 0645 062D;;;;N;;;;; FD5A;ARABIC LIGATURE HAH WITH MEEM WITH YEH FINAL FORM;Lo;0;AL; 062D 0645 064A;;;;N;;;;; FD5B;ARABIC LIGATURE HAH WITH MEEM WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 062D 0645 0649;;;;N;;;;; FD5C;ARABIC LIGATURE SEEN WITH HAH WITH JEEM INITIAL FORM;Lo;0;AL; 0633 062D 062C;;;;N;;;;; FD5D;ARABIC LIGATURE SEEN WITH JEEM WITH HAH INITIAL FORM;Lo;0;AL; 0633 062C 062D;;;;N;;;;; FD5E;ARABIC LIGATURE SEEN WITH JEEM WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0633 062C 0649;;;;N;;;;; FD5F;ARABIC LIGATURE SEEN WITH MEEM WITH HAH FINAL FORM;Lo;0;AL; 0633 0645 062D;;;;N;;;;; FD60;ARABIC LIGATURE SEEN WITH MEEM WITH HAH INITIAL FORM;Lo;0;AL; 0633 0645 062D;;;;N;;;;; FD61;ARABIC LIGATURE SEEN WITH MEEM WITH JEEM INITIAL FORM;Lo;0;AL; 0633 0645 062C;;;;N;;;;; FD62;ARABIC LIGATURE SEEN WITH MEEM WITH MEEM FINAL FORM;Lo;0;AL; 0633 0645 0645;;;;N;;;;; FD63;ARABIC LIGATURE SEEN WITH MEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0633 0645 0645;;;;N;;;;; FD64;ARABIC LIGATURE SAD WITH HAH WITH HAH FINAL FORM;Lo;0;AL; 0635 062D 062D;;;;N;;;;; FD65;ARABIC LIGATURE SAD WITH HAH WITH HAH INITIAL FORM;Lo;0;AL; 0635 062D 062D;;;;N;;;;; FD66;ARABIC LIGATURE SAD WITH MEEM WITH MEEM FINAL FORM;Lo;0;AL; 0635 0645 0645;;;;N;;;;; FD67;ARABIC LIGATURE SHEEN WITH HAH WITH MEEM FINAL FORM;Lo;0;AL; 0634 062D 0645;;;;N;;;;; FD68;ARABIC LIGATURE SHEEN WITH HAH WITH MEEM INITIAL FORM;Lo;0;AL; 0634 062D 0645;;;;N;;;;; FD69;ARABIC LIGATURE SHEEN WITH JEEM WITH YEH FINAL FORM;Lo;0;AL; 0634 062C 064A;;;;N;;;;; FD6A;ARABIC LIGATURE SHEEN WITH MEEM WITH KHAH FINAL FORM;Lo;0;AL; 0634 0645 062E;;;;N;;;;; FD6B;ARABIC LIGATURE SHEEN WITH MEEM WITH KHAH INITIAL FORM;Lo;0;AL; 0634 0645 062E;;;;N;;;;; FD6C;ARABIC LIGATURE SHEEN WITH MEEM WITH MEEM FINAL FORM;Lo;0;AL; 0634 0645 0645;;;;N;;;;; FD6D;ARABIC LIGATURE SHEEN WITH MEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0634 0645 0645;;;;N;;;;; FD6E;ARABIC LIGATURE DAD WITH HAH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0636 062D 0649;;;;N;;;;; FD6F;ARABIC LIGATURE DAD WITH KHAH WITH MEEM FINAL FORM;Lo;0;AL; 0636 062E 0645;;;;N;;;;; FD70;ARABIC LIGATURE DAD WITH KHAH WITH MEEM INITIAL FORM;Lo;0;AL; 0636 062E 0645;;;;N;;;;; FD71;ARABIC LIGATURE TAH WITH MEEM WITH HAH FINAL FORM;Lo;0;AL; 0637 0645 062D;;;;N;;;;; FD72;ARABIC LIGATURE TAH WITH MEEM WITH HAH INITIAL FORM;Lo;0;AL; 0637 0645 062D;;;;N;;;;; FD73;ARABIC LIGATURE TAH WITH MEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0637 0645 0645;;;;N;;;;; FD74;ARABIC LIGATURE TAH WITH MEEM WITH YEH FINAL FORM;Lo;0;AL; 0637 0645 064A;;;;N;;;;; FD75;ARABIC LIGATURE AIN WITH JEEM WITH MEEM FINAL FORM;Lo;0;AL; 0639 062C 0645;;;;N;;;;; FD76;ARABIC LIGATURE AIN WITH MEEM WITH MEEM FINAL FORM;Lo;0;AL; 0639 0645 0645;;;;N;;;;; FD77;ARABIC LIGATURE AIN WITH MEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0639 0645 0645;;;;N;;;;; FD78;ARABIC LIGATURE AIN WITH MEEM WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0639 0645 0649;;;;N;;;;; FD79;ARABIC LIGATURE GHAIN WITH MEEM WITH MEEM FINAL FORM;Lo;0;AL; 063A 0645 0645;;;;N;;;;; FD7A;ARABIC LIGATURE GHAIN WITH MEEM WITH YEH FINAL FORM;Lo;0;AL; 063A 0645 064A;;;;N;;;;; FD7B;ARABIC LIGATURE GHAIN WITH MEEM WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 063A 0645 0649;;;;N;;;;; FD7C;ARABIC LIGATURE FEH WITH KHAH WITH MEEM FINAL FORM;Lo;0;AL; 0641 062E 0645;;;;N;;;;; FD7D;ARABIC LIGATURE FEH WITH KHAH WITH MEEM INITIAL FORM;Lo;0;AL; 0641 062E 0645;;;;N;;;;; FD7E;ARABIC LIGATURE QAF WITH MEEM WITH HAH FINAL FORM;Lo;0;AL; 0642 0645 062D;;;;N;;;;; FD7F;ARABIC LIGATURE QAF WITH MEEM WITH MEEM FINAL FORM;Lo;0;AL; 0642 0645 0645;;;;N;;;;; FD80;ARABIC LIGATURE LAM WITH HAH WITH MEEM FINAL FORM;Lo;0;AL; 0644 062D 0645;;;;N;;;;; FD81;ARABIC LIGATURE LAM WITH HAH WITH YEH FINAL FORM;Lo;0;AL; 0644 062D 064A;;;;N;;;;; FD82;ARABIC LIGATURE LAM WITH HAH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0644 062D 0649;;;;N;;;;; FD83;ARABIC LIGATURE LAM WITH JEEM WITH JEEM INITIAL FORM;Lo;0;AL; 0644 062C 062C;;;;N;;;;; FD84;ARABIC LIGATURE LAM WITH JEEM WITH JEEM FINAL FORM;Lo;0;AL; 0644 062C 062C;;;;N;;;;; FD85;ARABIC LIGATURE LAM WITH KHAH WITH MEEM FINAL FORM;Lo;0;AL; 0644 062E 0645;;;;N;;;;; FD86;ARABIC LIGATURE LAM WITH KHAH WITH MEEM INITIAL FORM;Lo;0;AL; 0644 062E 0645;;;;N;;;;; FD87;ARABIC LIGATURE LAM WITH MEEM WITH HAH FINAL FORM;Lo;0;AL; 0644 0645 062D;;;;N;;;;; FD88;ARABIC LIGATURE LAM WITH MEEM WITH HAH INITIAL FORM;Lo;0;AL; 0644 0645 062D;;;;N;;;;; FD89;ARABIC LIGATURE MEEM WITH HAH WITH JEEM INITIAL FORM;Lo;0;AL; 0645 062D 062C;;;;N;;;;; FD8A;ARABIC LIGATURE MEEM WITH HAH WITH MEEM INITIAL FORM;Lo;0;AL; 0645 062D 0645;;;;N;;;;; FD8B;ARABIC LIGATURE MEEM WITH HAH WITH YEH FINAL FORM;Lo;0;AL; 0645 062D 064A;;;;N;;;;; FD8C;ARABIC LIGATURE MEEM WITH JEEM WITH HAH INITIAL FORM;Lo;0;AL; 0645 062C 062D;;;;N;;;;; FD8D;ARABIC LIGATURE MEEM WITH JEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0645 062C 0645;;;;N;;;;; FD8E;ARABIC LIGATURE MEEM WITH KHAH WITH JEEM INITIAL FORM;Lo;0;AL; 0645 062E 062C;;;;N;;;;; FD8F;ARABIC LIGATURE MEEM WITH KHAH WITH MEEM INITIAL FORM;Lo;0;AL; 0645 062E 0645;;;;N;;;;; FD92;ARABIC LIGATURE MEEM WITH JEEM WITH KHAH INITIAL FORM;Lo;0;AL; 0645 062C 062E;;;;N;;;;; FD93;ARABIC LIGATURE HEH WITH MEEM WITH JEEM INITIAL FORM;Lo;0;AL; 0647 0645 062C;;;;N;;;;; FD94;ARABIC LIGATURE HEH WITH MEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0647 0645 0645;;;;N;;;;; FD95;ARABIC LIGATURE NOON WITH HAH WITH MEEM INITIAL FORM;Lo;0;AL; 0646 062D 0645;;;;N;;;;; FD96;ARABIC LIGATURE NOON WITH HAH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0646 062D 0649;;;;N;;;;; FD97;ARABIC LIGATURE NOON WITH JEEM WITH MEEM FINAL FORM;Lo;0;AL; 0646 062C 0645;;;;N;;;;; FD98;ARABIC LIGATURE NOON WITH JEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0646 062C 0645;;;;N;;;;; FD99;ARABIC LIGATURE NOON WITH JEEM WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0646 062C 0649;;;;N;;;;; FD9A;ARABIC LIGATURE NOON WITH MEEM WITH YEH FINAL FORM;Lo;0;AL; 0646 0645 064A;;;;N;;;;; FD9B;ARABIC LIGATURE NOON WITH MEEM WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0646 0645 0649;;;;N;;;;; FD9C;ARABIC LIGATURE YEH WITH MEEM WITH MEEM FINAL FORM;Lo;0;AL; 064A 0645 0645;;;;N;;;;; FD9D;ARABIC LIGATURE YEH WITH MEEM WITH MEEM INITIAL FORM;Lo;0;AL; 064A 0645 0645;;;;N;;;;; FD9E;ARABIC LIGATURE BEH WITH KHAH WITH YEH FINAL FORM;Lo;0;AL; 0628 062E 064A;;;;N;;;;; FD9F;ARABIC LIGATURE TEH WITH JEEM WITH YEH FINAL FORM;Lo;0;AL; 062A 062C 064A;;;;N;;;;; FDA0;ARABIC LIGATURE TEH WITH JEEM WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 062A 062C 0649;;;;N;;;;; FDA1;ARABIC LIGATURE TEH WITH KHAH WITH YEH FINAL FORM;Lo;0;AL; 062A 062E 064A;;;;N;;;;; FDA2;ARABIC LIGATURE TEH WITH KHAH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 062A 062E 0649;;;;N;;;;; FDA3;ARABIC LIGATURE TEH WITH MEEM WITH YEH FINAL FORM;Lo;0;AL; 062A 0645 064A;;;;N;;;;; FDA4;ARABIC LIGATURE TEH WITH MEEM WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 062A 0645 0649;;;;N;;;;; FDA5;ARABIC LIGATURE JEEM WITH MEEM WITH YEH FINAL FORM;Lo;0;AL; 062C 0645 064A;;;;N;;;;; FDA6;ARABIC LIGATURE JEEM WITH HAH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 062C 062D 0649;;;;N;;;;; FDA7;ARABIC LIGATURE JEEM WITH MEEM WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 062C 0645 0649;;;;N;;;;; FDA8;ARABIC LIGATURE SEEN WITH KHAH WITH ALEF MAKSURA FINAL FORM;Lo;0;AL; 0633 062E 0649;;;;N;;;;; FDA9;ARABIC LIGATURE SAD WITH HAH WITH YEH FINAL FORM;Lo;0;AL; 0635 062D 064A;;;;N;;;;; FDAA;ARABIC LIGATURE SHEEN WITH HAH WITH YEH FINAL FORM;Lo;0;AL; 0634 062D 064A;;;;N;;;;; FDAB;ARABIC LIGATURE DAD WITH HAH WITH YEH FINAL FORM;Lo;0;AL; 0636 062D 064A;;;;N;;;;; FDAC;ARABIC LIGATURE LAM WITH JEEM WITH YEH FINAL FORM;Lo;0;AL; 0644 062C 064A;;;;N;;;;; FDAD;ARABIC LIGATURE LAM WITH MEEM WITH YEH FINAL FORM;Lo;0;AL; 0644 0645 064A;;;;N;;;;; FDAE;ARABIC LIGATURE YEH WITH HAH WITH YEH FINAL FORM;Lo;0;AL; 064A 062D 064A;;;;N;;;;; FDAF;ARABIC LIGATURE YEH WITH JEEM WITH YEH FINAL FORM;Lo;0;AL; 064A 062C 064A;;;;N;;;;; FDB0;ARABIC LIGATURE YEH WITH MEEM WITH YEH FINAL FORM;Lo;0;AL; 064A 0645 064A;;;;N;;;;; FDB1;ARABIC LIGATURE MEEM WITH MEEM WITH YEH FINAL FORM;Lo;0;AL; 0645 0645 064A;;;;N;;;;; FDB2;ARABIC LIGATURE QAF WITH MEEM WITH YEH FINAL FORM;Lo;0;AL; 0642 0645 064A;;;;N;;;;; FDB3;ARABIC LIGATURE NOON WITH HAH WITH YEH FINAL FORM;Lo;0;AL; 0646 062D 064A;;;;N;;;;; FDB4;ARABIC LIGATURE QAF WITH MEEM WITH HAH INITIAL FORM;Lo;0;AL; 0642 0645 062D;;;;N;;;;; FDB5;ARABIC LIGATURE LAM WITH HAH WITH MEEM INITIAL FORM;Lo;0;AL; 0644 062D 0645;;;;N;;;;; FDB6;ARABIC LIGATURE AIN WITH MEEM WITH YEH FINAL FORM;Lo;0;AL; 0639 0645 064A;;;;N;;;;; FDB7;ARABIC LIGATURE KAF WITH MEEM WITH YEH FINAL FORM;Lo;0;AL; 0643 0645 064A;;;;N;;;;; FDB8;ARABIC LIGATURE NOON WITH JEEM WITH HAH INITIAL FORM;Lo;0;AL; 0646 062C 062D;;;;N;;;;; FDB9;ARABIC LIGATURE MEEM WITH KHAH WITH YEH FINAL FORM;Lo;0;AL; 0645 062E 064A;;;;N;;;;; FDBA;ARABIC LIGATURE LAM WITH JEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0644 062C 0645;;;;N;;;;; FDBB;ARABIC LIGATURE KAF WITH MEEM WITH MEEM FINAL FORM;Lo;0;AL; 0643 0645 0645;;;;N;;;;; FDBC;ARABIC LIGATURE LAM WITH JEEM WITH MEEM FINAL FORM;Lo;0;AL; 0644 062C 0645;;;;N;;;;; FDBD;ARABIC LIGATURE NOON WITH JEEM WITH HAH FINAL FORM;Lo;0;AL; 0646 062C 062D;;;;N;;;;; FDBE;ARABIC LIGATURE JEEM WITH HAH WITH YEH FINAL FORM;Lo;0;AL; 062C 062D 064A;;;;N;;;;; FDBF;ARABIC LIGATURE HAH WITH JEEM WITH YEH FINAL FORM;Lo;0;AL; 062D 062C 064A;;;;N;;;;; FDC0;ARABIC LIGATURE MEEM WITH JEEM WITH YEH FINAL FORM;Lo;0;AL; 0645 062C 064A;;;;N;;;;; FDC1;ARABIC LIGATURE FEH WITH MEEM WITH YEH FINAL FORM;Lo;0;AL; 0641 0645 064A;;;;N;;;;; FDC2;ARABIC LIGATURE BEH WITH HAH WITH YEH FINAL FORM;Lo;0;AL; 0628 062D 064A;;;;N;;;;; FDC3;ARABIC LIGATURE KAF WITH MEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0643 0645 0645;;;;N;;;;; FDC4;ARABIC LIGATURE AIN WITH JEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0639 062C 0645;;;;N;;;;; FDC5;ARABIC LIGATURE SAD WITH MEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0635 0645 0645;;;;N;;;;; FDC6;ARABIC LIGATURE SEEN WITH KHAH WITH YEH FINAL FORM;Lo;0;AL; 0633 062E 064A;;;;N;;;;; FDC7;ARABIC LIGATURE NOON WITH JEEM WITH YEH FINAL FORM;Lo;0;AL; 0646 062C 064A;;;;N;;;;; FDF0;ARABIC LIGATURE SALLA USED AS KORANIC STOP SIGN ISOLATED FORM;Lo;0;AL; 0635 0644 06D2;;;;N;;;;; FDF1;ARABIC LIGATURE QALA USED AS KORANIC STOP SIGN ISOLATED FORM;Lo;0;AL; 0642 0644 06D2;;;;N;;;;; FDF2;ARABIC LIGATURE ALLAH ISOLATED FORM;Lo;0;AL; 0627 0644 0644 0647;;;;N;;;;; FDF3;ARABIC LIGATURE AKBAR ISOLATED FORM;Lo;0;AL; 0627 0643 0628 0631;;;;N;;;;; FDF4;ARABIC LIGATURE MOHAMMAD ISOLATED FORM;Lo;0;AL; 0645 062D 0645 062F;;;;N;;;;; FDF5;ARABIC LIGATURE SALAM ISOLATED FORM;Lo;0;AL; 0635 0644 0639 0645;;;;N;;;;; FDF6;ARABIC LIGATURE RASOUL ISOLATED FORM;Lo;0;AL; 0631 0633 0648 0644;;;;N;;;;; FDF7;ARABIC LIGATURE ALAYHE ISOLATED FORM;Lo;0;AL; 0639 0644 064A 0647;;;;N;;;;; FDF8;ARABIC LIGATURE WASALLAM ISOLATED FORM;Lo;0;AL; 0648 0633 0644 0645;;;;N;;;;; FDF9;ARABIC LIGATURE SALLA ISOLATED FORM;Lo;0;AL; 0635 0644 0649;;;;N;;;;; FDFA;ARABIC LIGATURE SALLALLAHOU ALAYHE WASALLAM;Lo;0;AL; 0635 0644 0649 0020 0627 0644 0644 0647 0020 0639 0644 064A 0647 0020 0648 0633 0644 0645;;;;N;ARABIC LETTER SALLALLAHOU ALAYHE WASALLAM;;;; FDFB;ARABIC LIGATURE JALLAJALALOUHOU;Lo;0;AL; 062C 0644 0020 062C 0644 0627 0644 0647;;;;N;ARABIC LETTER JALLAJALALOUHOU;;;; FDFC;RIAL SIGN;Sc;0;AL; 0631 06CC 0627 0644;;;;N;;;;; FDFD;ARABIC LIGATURE BISMILLAH AR-RAHMAN AR-RAHEEM;So;0;ON;;;;;N;;;;; FE00;VARIATION SELECTOR-1;Mn;0;NSM;;;;;N;;;;; FE01;VARIATION SELECTOR-2;Mn;0;NSM;;;;;N;;;;; FE02;VARIATION SELECTOR-3;Mn;0;NSM;;;;;N;;;;; FE03;VARIATION SELECTOR-4;Mn;0;NSM;;;;;N;;;;; FE04;VARIATION SELECTOR-5;Mn;0;NSM;;;;;N;;;;; FE05;VARIATION SELECTOR-6;Mn;0;NSM;;;;;N;;;;; FE06;VARIATION SELECTOR-7;Mn;0;NSM;;;;;N;;;;; FE07;VARIATION SELECTOR-8;Mn;0;NSM;;;;;N;;;;; FE08;VARIATION SELECTOR-9;Mn;0;NSM;;;;;N;;;;; FE09;VARIATION SELECTOR-10;Mn;0;NSM;;;;;N;;;;; FE0A;VARIATION SELECTOR-11;Mn;0;NSM;;;;;N;;;;; FE0B;VARIATION SELECTOR-12;Mn;0;NSM;;;;;N;;;;; FE0C;VARIATION SELECTOR-13;Mn;0;NSM;;;;;N;;;;; FE0D;VARIATION SELECTOR-14;Mn;0;NSM;;;;;N;;;;; FE0E;VARIATION SELECTOR-15;Mn;0;NSM;;;;;N;;;;; FE0F;VARIATION SELECTOR-16;Mn;0;NSM;;;;;N;;;;; FE10;PRESENTATION FORM FOR VERTICAL COMMA;Po;0;ON; 002C;;;;N;;;;; FE11;PRESENTATION FORM FOR VERTICAL IDEOGRAPHIC COMMA;Po;0;ON; 3001;;;;N;;;;; FE12;PRESENTATION FORM FOR VERTICAL IDEOGRAPHIC FULL STOP;Po;0;ON; 3002;;;;N;;;;; FE13;PRESENTATION FORM FOR VERTICAL COLON;Po;0;ON; 003A;;;;N;;;;; FE14;PRESENTATION FORM FOR VERTICAL SEMICOLON;Po;0;ON; 003B;;;;N;;;;; FE15;PRESENTATION FORM FOR VERTICAL EXCLAMATION MARK;Po;0;ON; 0021;;;;N;;;;; FE16;PRESENTATION FORM FOR VERTICAL QUESTION MARK;Po;0;ON; 003F;;;;N;;;;; FE17;PRESENTATION FORM FOR VERTICAL LEFT WHITE LENTICULAR BRACKET;Ps;0;ON; 3016;;;;N;;;;; FE18;PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET;Pe;0;ON; 3017;;;;N;;;;; FE19;PRESENTATION FORM FOR VERTICAL HORIZONTAL ELLIPSIS;Po;0;ON; 2026;;;;N;;;;; FE20;COMBINING LIGATURE LEFT HALF;Mn;230;NSM;;;;;N;;;;; FE21;COMBINING LIGATURE RIGHT HALF;Mn;230;NSM;;;;;N;;;;; FE22;COMBINING DOUBLE TILDE LEFT HALF;Mn;230;NSM;;;;;N;;;;; FE23;COMBINING DOUBLE TILDE RIGHT HALF;Mn;230;NSM;;;;;N;;;;; FE24;COMBINING MACRON LEFT HALF;Mn;230;NSM;;;;;N;;;;; FE25;COMBINING MACRON RIGHT HALF;Mn;230;NSM;;;;;N;;;;; FE26;COMBINING CONJOINING MACRON;Mn;230;NSM;;;;;N;;;;; FE30;PRESENTATION FORM FOR VERTICAL TWO DOT LEADER;Po;0;ON; 2025;;;;N;GLYPH FOR VERTICAL TWO DOT LEADER;;;; FE31;PRESENTATION FORM FOR VERTICAL EM DASH;Pd;0;ON; 2014;;;;N;GLYPH FOR VERTICAL EM DASH;;;; FE32;PRESENTATION FORM FOR VERTICAL EN DASH;Pd;0;ON; 2013;;;;N;GLYPH FOR VERTICAL EN DASH;;;; FE33;PRESENTATION FORM FOR VERTICAL LOW LINE;Pc;0;ON; 005F;;;;N;GLYPH FOR VERTICAL SPACING UNDERSCORE;;;; FE34;PRESENTATION FORM FOR VERTICAL WAVY LOW LINE;Pc;0;ON; 005F;;;;N;GLYPH FOR VERTICAL SPACING WAVY UNDERSCORE;;;; FE35;PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS;Ps;0;ON; 0028;;;;N;GLYPH FOR VERTICAL OPENING PARENTHESIS;;;; FE36;PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS;Pe;0;ON; 0029;;;;N;GLYPH FOR VERTICAL CLOSING PARENTHESIS;;;; FE37;PRESENTATION FORM FOR VERTICAL LEFT CURLY BRACKET;Ps;0;ON; 007B;;;;N;GLYPH FOR VERTICAL OPENING CURLY BRACKET;;;; FE38;PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET;Pe;0;ON; 007D;;;;N;GLYPH FOR VERTICAL CLOSING CURLY BRACKET;;;; FE39;PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET;Ps;0;ON; 3014;;;;N;GLYPH FOR VERTICAL OPENING TORTOISE SHELL BRACKET;;;; FE3A;PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET;Pe;0;ON; 3015;;;;N;GLYPH FOR VERTICAL CLOSING TORTOISE SHELL BRACKET;;;; FE3B;PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET;Ps;0;ON; 3010;;;;N;GLYPH FOR VERTICAL OPENING BLACK LENTICULAR BRACKET;;;; FE3C;PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET;Pe;0;ON; 3011;;;;N;GLYPH FOR VERTICAL CLOSING BLACK LENTICULAR BRACKET;;;; FE3D;PRESENTATION FORM FOR VERTICAL LEFT DOUBLE ANGLE BRACKET;Ps;0;ON; 300A;;;;N;GLYPH FOR VERTICAL OPENING DOUBLE ANGLE BRACKET;;;; FE3E;PRESENTATION FORM FOR VERTICAL RIGHT DOUBLE ANGLE BRACKET;Pe;0;ON; 300B;;;;N;GLYPH FOR VERTICAL CLOSING DOUBLE ANGLE BRACKET;;;; FE3F;PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET;Ps;0;ON; 3008;;;;N;GLYPH FOR VERTICAL OPENING ANGLE BRACKET;;;; FE40;PRESENTATION FORM FOR VERTICAL RIGHT ANGLE BRACKET;Pe;0;ON; 3009;;;;N;GLYPH FOR VERTICAL CLOSING ANGLE BRACKET;;;; FE41;PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET;Ps;0;ON; 300C;;;;N;GLYPH FOR VERTICAL OPENING CORNER BRACKET;;;; FE42;PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET;Pe;0;ON; 300D;;;;N;GLYPH FOR VERTICAL CLOSING CORNER BRACKET;;;; FE43;PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET;Ps;0;ON; 300E;;;;N;GLYPH FOR VERTICAL OPENING WHITE CORNER BRACKET;;;; FE44;PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET;Pe;0;ON; 300F;;;;N;GLYPH FOR VERTICAL CLOSING WHITE CORNER BRACKET;;;; FE45;SESAME DOT;Po;0;ON;;;;;N;;;;; FE46;WHITE SESAME DOT;Po;0;ON;;;;;N;;;;; FE47;PRESENTATION FORM FOR VERTICAL LEFT SQUARE BRACKET;Ps;0;ON; 005B;;;;N;;;;; FE48;PRESENTATION FORM FOR VERTICAL RIGHT SQUARE BRACKET;Pe;0;ON; 005D;;;;N;;;;; FE49;DASHED OVERLINE;Po;0;ON; 203E;;;;N;SPACING DASHED OVERSCORE;;;; FE4A;CENTRELINE OVERLINE;Po;0;ON; 203E;;;;N;SPACING CENTERLINE OVERSCORE;;;; FE4B;WAVY OVERLINE;Po;0;ON; 203E;;;;N;SPACING WAVY OVERSCORE;;;; FE4C;DOUBLE WAVY OVERLINE;Po;0;ON; 203E;;;;N;SPACING DOUBLE WAVY OVERSCORE;;;; FE4D;DASHED LOW LINE;Pc;0;ON; 005F;;;;N;SPACING DASHED UNDERSCORE;;;; FE4E;CENTRELINE LOW LINE;Pc;0;ON; 005F;;;;N;SPACING CENTERLINE UNDERSCORE;;;; FE4F;WAVY LOW LINE;Pc;0;ON; 005F;;;;N;SPACING WAVY UNDERSCORE;;;; FE50;SMALL COMMA;Po;0;CS; 002C;;;;N;;;;; FE51;SMALL IDEOGRAPHIC COMMA;Po;0;ON; 3001;;;;N;;;;; FE52;SMALL FULL STOP;Po;0;CS; 002E;;;;N;SMALL PERIOD;;;; FE54;SMALL SEMICOLON;Po;0;ON; 003B;;;;N;;;;; FE55;SMALL COLON;Po;0;CS; 003A;;;;N;;;;; FE56;SMALL QUESTION MARK;Po;0;ON; 003F;;;;N;;;;; FE57;SMALL EXCLAMATION MARK;Po;0;ON; 0021;;;;N;;;;; FE58;SMALL EM DASH;Pd;0;ON; 2014;;;;N;;;;; FE59;SMALL LEFT PARENTHESIS;Ps;0;ON; 0028;;;;Y;SMALL OPENING PARENTHESIS;;;; FE5A;SMALL RIGHT PARENTHESIS;Pe;0;ON; 0029;;;;Y;SMALL CLOSING PARENTHESIS;;;; FE5B;SMALL LEFT CURLY BRACKET;Ps;0;ON; 007B;;;;Y;SMALL OPENING CURLY BRACKET;;;; FE5C;SMALL RIGHT CURLY BRACKET;Pe;0;ON; 007D;;;;Y;SMALL CLOSING CURLY BRACKET;;;; FE5D;SMALL LEFT TORTOISE SHELL BRACKET;Ps;0;ON; 3014;;;;Y;SMALL OPENING TORTOISE SHELL BRACKET;;;; FE5E;SMALL RIGHT TORTOISE SHELL BRACKET;Pe;0;ON; 3015;;;;Y;SMALL CLOSING TORTOISE SHELL BRACKET;;;; FE5F;SMALL NUMBER SIGN;Po;0;ET; 0023;;;;N;;;;; FE60;SMALL AMPERSAND;Po;0;ON; 0026;;;;N;;;;; FE61;SMALL ASTERISK;Po;0;ON; 002A;;;;N;;;;; FE62;SMALL PLUS SIGN;Sm;0;ES; 002B;;;;N;;;;; FE63;SMALL HYPHEN-MINUS;Pd;0;ES; 002D;;;;N;;;;; FE64;SMALL LESS-THAN SIGN;Sm;0;ON; 003C;;;;Y;;;;; FE65;SMALL GREATER-THAN SIGN;Sm;0;ON; 003E;;;;Y;;;;; FE66;SMALL EQUALS SIGN;Sm;0;ON; 003D;;;;N;;;;; FE68;SMALL REVERSE SOLIDUS;Po;0;ON; 005C;;;;N;SMALL BACKSLASH;;;; FE69;SMALL DOLLAR SIGN;Sc;0;ET; 0024;;;;N;;;;; FE6A;SMALL PERCENT SIGN;Po;0;ET; 0025;;;;N;;;;; FE6B;SMALL COMMERCIAL AT;Po;0;ON; 0040;;;;N;;;;; FE70;ARABIC FATHATAN ISOLATED FORM;Lo;0;AL; 0020 064B;;;;N;ARABIC SPACING FATHATAN;;;; FE71;ARABIC TATWEEL WITH FATHATAN ABOVE;Lo;0;AL; 0640 064B;;;;N;ARABIC FATHATAN ON TATWEEL;;;; FE72;ARABIC DAMMATAN ISOLATED FORM;Lo;0;AL; 0020 064C;;;;N;ARABIC SPACING DAMMATAN;;;; FE73;ARABIC TAIL FRAGMENT;Lo;0;AL;;;;;N;;;;; FE74;ARABIC KASRATAN ISOLATED FORM;Lo;0;AL; 0020 064D;;;;N;ARABIC SPACING KASRATAN;;;; FE76;ARABIC FATHA ISOLATED FORM;Lo;0;AL; 0020 064E;;;;N;ARABIC SPACING FATHAH;;;; FE77;ARABIC FATHA MEDIAL FORM;Lo;0;AL; 0640 064E;;;;N;ARABIC FATHAH ON TATWEEL;;;; FE78;ARABIC DAMMA ISOLATED FORM;Lo;0;AL; 0020 064F;;;;N;ARABIC SPACING DAMMAH;;;; FE79;ARABIC DAMMA MEDIAL FORM;Lo;0;AL; 0640 064F;;;;N;ARABIC DAMMAH ON TATWEEL;;;; FE7A;ARABIC KASRA ISOLATED FORM;Lo;0;AL; 0020 0650;;;;N;ARABIC SPACING KASRAH;;;; FE7B;ARABIC KASRA MEDIAL FORM;Lo;0;AL; 0640 0650;;;;N;ARABIC KASRAH ON TATWEEL;;;; FE7C;ARABIC SHADDA ISOLATED FORM;Lo;0;AL; 0020 0651;;;;N;ARABIC SPACING SHADDAH;;;; FE7D;ARABIC SHADDA MEDIAL FORM;Lo;0;AL; 0640 0651;;;;N;ARABIC SHADDAH ON TATWEEL;;;; FE7E;ARABIC SUKUN ISOLATED FORM;Lo;0;AL; 0020 0652;;;;N;ARABIC SPACING SUKUN;;;; FE7F;ARABIC SUKUN MEDIAL FORM;Lo;0;AL; 0640 0652;;;;N;ARABIC SUKUN ON TATWEEL;;;; FE80;ARABIC LETTER HAMZA ISOLATED FORM;Lo;0;AL; 0621;;;;N;GLYPH FOR ISOLATE ARABIC HAMZAH;;;; FE81;ARABIC LETTER ALEF WITH MADDA ABOVE ISOLATED FORM;Lo;0;AL; 0622;;;;N;GLYPH FOR ISOLATE ARABIC MADDAH ON ALEF;;;; FE82;ARABIC LETTER ALEF WITH MADDA ABOVE FINAL FORM;Lo;0;AL; 0622;;;;N;GLYPH FOR FINAL ARABIC MADDAH ON ALEF;;;; FE83;ARABIC LETTER ALEF WITH HAMZA ABOVE ISOLATED FORM;Lo;0;AL; 0623;;;;N;GLYPH FOR ISOLATE ARABIC HAMZAH ON ALEF;;;; FE84;ARABIC LETTER ALEF WITH HAMZA ABOVE FINAL FORM;Lo;0;AL; 0623;;;;N;GLYPH FOR FINAL ARABIC HAMZAH ON ALEF;;;; FE85;ARABIC LETTER WAW WITH HAMZA ABOVE ISOLATED FORM;Lo;0;AL; 0624;;;;N;GLYPH FOR ISOLATE ARABIC HAMZAH ON WAW;;;; FE86;ARABIC LETTER WAW WITH HAMZA ABOVE FINAL FORM;Lo;0;AL; 0624;;;;N;GLYPH FOR FINAL ARABIC HAMZAH ON WAW;;;; FE87;ARABIC LETTER ALEF WITH HAMZA BELOW ISOLATED FORM;Lo;0;AL; 0625;;;;N;GLYPH FOR ISOLATE ARABIC HAMZAH UNDER ALEF;;;; FE88;ARABIC LETTER ALEF WITH HAMZA BELOW FINAL FORM;Lo;0;AL; 0625;;;;N;GLYPH FOR FINAL ARABIC HAMZAH UNDER ALEF;;;; FE89;ARABIC LETTER YEH WITH HAMZA ABOVE ISOLATED FORM;Lo;0;AL; 0626;;;;N;GLYPH FOR ISOLATE ARABIC HAMZAH ON YA;;;; FE8A;ARABIC LETTER YEH WITH HAMZA ABOVE FINAL FORM;Lo;0;AL; 0626;;;;N;GLYPH FOR FINAL ARABIC HAMZAH ON YA;;;; FE8B;ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM;Lo;0;AL; 0626;;;;N;GLYPH FOR INITIAL ARABIC HAMZAH ON YA;;;; FE8C;ARABIC LETTER YEH WITH HAMZA ABOVE MEDIAL FORM;Lo;0;AL; 0626;;;;N;GLYPH FOR MEDIAL ARABIC HAMZAH ON YA;;;; FE8D;ARABIC LETTER ALEF ISOLATED FORM;Lo;0;AL; 0627;;;;N;GLYPH FOR ISOLATE ARABIC ALEF;;;; FE8E;ARABIC LETTER ALEF FINAL FORM;Lo;0;AL; 0627;;;;N;GLYPH FOR FINAL ARABIC ALEF;;;; FE8F;ARABIC LETTER BEH ISOLATED FORM;Lo;0;AL; 0628;;;;N;GLYPH FOR ISOLATE ARABIC BAA;;;; FE90;ARABIC LETTER BEH FINAL FORM;Lo;0;AL; 0628;;;;N;GLYPH FOR FINAL ARABIC BAA;;;; FE91;ARABIC LETTER BEH INITIAL FORM;Lo;0;AL; 0628;;;;N;GLYPH FOR INITIAL ARABIC BAA;;;; FE92;ARABIC LETTER BEH MEDIAL FORM;Lo;0;AL; 0628;;;;N;GLYPH FOR MEDIAL ARABIC BAA;;;; FE93;ARABIC LETTER TEH MARBUTA ISOLATED FORM;Lo;0;AL; 0629;;;;N;GLYPH FOR ISOLATE ARABIC TAA MARBUTAH;;;; FE94;ARABIC LETTER TEH MARBUTA FINAL FORM;Lo;0;AL; 0629;;;;N;GLYPH FOR FINAL ARABIC TAA MARBUTAH;;;; FE95;ARABIC LETTER TEH ISOLATED FORM;Lo;0;AL; 062A;;;;N;GLYPH FOR ISOLATE ARABIC TAA;;;; FE96;ARABIC LETTER TEH FINAL FORM;Lo;0;AL; 062A;;;;N;GLYPH FOR FINAL ARABIC TAA;;;; FE97;ARABIC LETTER TEH INITIAL FORM;Lo;0;AL; 062A;;;;N;GLYPH FOR INITIAL ARABIC TAA;;;; FE98;ARABIC LETTER TEH MEDIAL FORM;Lo;0;AL; 062A;;;;N;GLYPH FOR MEDIAL ARABIC TAA;;;; FE99;ARABIC LETTER THEH ISOLATED FORM;Lo;0;AL; 062B;;;;N;GLYPH FOR ISOLATE ARABIC THAA;;;; FE9A;ARABIC LETTER THEH FINAL FORM;Lo;0;AL; 062B;;;;N;GLYPH FOR FINAL ARABIC THAA;;;; FE9B;ARABIC LETTER THEH INITIAL FORM;Lo;0;AL; 062B;;;;N;GLYPH FOR INITIAL ARABIC THAA;;;; FE9C;ARABIC LETTER THEH MEDIAL FORM;Lo;0;AL; 062B;;;;N;GLYPH FOR MEDIAL ARABIC THAA;;;; FE9D;ARABIC LETTER JEEM ISOLATED FORM;Lo;0;AL; 062C;;;;N;GLYPH FOR ISOLATE ARABIC JEEM;;;; FE9E;ARABIC LETTER JEEM FINAL FORM;Lo;0;AL; 062C;;;;N;GLYPH FOR FINAL ARABIC JEEM;;;; FE9F;ARABIC LETTER JEEM INITIAL FORM;Lo;0;AL; 062C;;;;N;GLYPH FOR INITIAL ARABIC JEEM;;;; FEA0;ARABIC LETTER JEEM MEDIAL FORM;Lo;0;AL; 062C;;;;N;GLYPH FOR MEDIAL ARABIC JEEM;;;; FEA1;ARABIC LETTER HAH ISOLATED FORM;Lo;0;AL; 062D;;;;N;GLYPH FOR ISOLATE ARABIC HAA;;;; FEA2;ARABIC LETTER HAH FINAL FORM;Lo;0;AL; 062D;;;;N;GLYPH FOR FINAL ARABIC HAA;;;; FEA3;ARABIC LETTER HAH INITIAL FORM;Lo;0;AL; 062D;;;;N;GLYPH FOR INITIAL ARABIC HAA;;;; FEA4;ARABIC LETTER HAH MEDIAL FORM;Lo;0;AL; 062D;;;;N;GLYPH FOR MEDIAL ARABIC HAA;;;; FEA5;ARABIC LETTER KHAH ISOLATED FORM;Lo;0;AL; 062E;;;;N;GLYPH FOR ISOLATE ARABIC KHAA;;;; FEA6;ARABIC LETTER KHAH FINAL FORM;Lo;0;AL; 062E;;;;N;GLYPH FOR FINAL ARABIC KHAA;;;; FEA7;ARABIC LETTER KHAH INITIAL FORM;Lo;0;AL; 062E;;;;N;GLYPH FOR INITIAL ARABIC KHAA;;;; FEA8;ARABIC LETTER KHAH MEDIAL FORM;Lo;0;AL; 062E;;;;N;GLYPH FOR MEDIAL ARABIC KHAA;;;; FEA9;ARABIC LETTER DAL ISOLATED FORM;Lo;0;AL; 062F;;;;N;GLYPH FOR ISOLATE ARABIC DAL;;;; FEAA;ARABIC LETTER DAL FINAL FORM;Lo;0;AL; 062F;;;;N;GLYPH FOR FINAL ARABIC DAL;;;; FEAB;ARABIC LETTER THAL ISOLATED FORM;Lo;0;AL; 0630;;;;N;GLYPH FOR ISOLATE ARABIC THAL;;;; FEAC;ARABIC LETTER THAL FINAL FORM;Lo;0;AL; 0630;;;;N;GLYPH FOR FINAL ARABIC THAL;;;; FEAD;ARABIC LETTER REH ISOLATED FORM;Lo;0;AL; 0631;;;;N;GLYPH FOR ISOLATE ARABIC RA;;;; FEAE;ARABIC LETTER REH FINAL FORM;Lo;0;AL; 0631;;;;N;GLYPH FOR FINAL ARABIC RA;;;; FEAF;ARABIC LETTER ZAIN ISOLATED FORM;Lo;0;AL; 0632;;;;N;GLYPH FOR ISOLATE ARABIC ZAIN;;;; FEB0;ARABIC LETTER ZAIN FINAL FORM;Lo;0;AL; 0632;;;;N;GLYPH FOR FINAL ARABIC ZAIN;;;; FEB1;ARABIC LETTER SEEN ISOLATED FORM;Lo;0;AL; 0633;;;;N;GLYPH FOR ISOLATE ARABIC SEEN;;;; FEB2;ARABIC LETTER SEEN FINAL FORM;Lo;0;AL; 0633;;;;N;GLYPH FOR FINAL ARABIC SEEN;;;; FEB3;ARABIC LETTER SEEN INITIAL FORM;Lo;0;AL; 0633;;;;N;GLYPH FOR INITIAL ARABIC SEEN;;;; FEB4;ARABIC LETTER SEEN MEDIAL FORM;Lo;0;AL; 0633;;;;N;GLYPH FOR MEDIAL ARABIC SEEN;;;; FEB5;ARABIC LETTER SHEEN ISOLATED FORM;Lo;0;AL; 0634;;;;N;GLYPH FOR ISOLATE ARABIC SHEEN;;;; FEB6;ARABIC LETTER SHEEN FINAL FORM;Lo;0;AL; 0634;;;;N;GLYPH FOR FINAL ARABIC SHEEN;;;; FEB7;ARABIC LETTER SHEEN INITIAL FORM;Lo;0;AL; 0634;;;;N;GLYPH FOR INITIAL ARABIC SHEEN;;;; FEB8;ARABIC LETTER SHEEN MEDIAL FORM;Lo;0;AL; 0634;;;;N;GLYPH FOR MEDIAL ARABIC SHEEN;;;; FEB9;ARABIC LETTER SAD ISOLATED FORM;Lo;0;AL; 0635;;;;N;GLYPH FOR ISOLATE ARABIC SAD;;;; FEBA;ARABIC LETTER SAD FINAL FORM;Lo;0;AL; 0635;;;;N;GLYPH FOR FINAL ARABIC SAD;;;; FEBB;ARABIC LETTER SAD INITIAL FORM;Lo;0;AL; 0635;;;;N;GLYPH FOR INITIAL ARABIC SAD;;;; FEBC;ARABIC LETTER SAD MEDIAL FORM;Lo;0;AL; 0635;;;;N;GLYPH FOR MEDIAL ARABIC SAD;;;; FEBD;ARABIC LETTER DAD ISOLATED FORM;Lo;0;AL; 0636;;;;N;GLYPH FOR ISOLATE ARABIC DAD;;;; FEBE;ARABIC LETTER DAD FINAL FORM;Lo;0;AL; 0636;;;;N;GLYPH FOR FINAL ARABIC DAD;;;; FEBF;ARABIC LETTER DAD INITIAL FORM;Lo;0;AL; 0636;;;;N;GLYPH FOR INITIAL ARABIC DAD;;;; FEC0;ARABIC LETTER DAD MEDIAL FORM;Lo;0;AL; 0636;;;;N;GLYPH FOR MEDIAL ARABIC DAD;;;; FEC1;ARABIC LETTER TAH ISOLATED FORM;Lo;0;AL; 0637;;;;N;GLYPH FOR ISOLATE ARABIC TAH;;;; FEC2;ARABIC LETTER TAH FINAL FORM;Lo;0;AL; 0637;;;;N;GLYPH FOR FINAL ARABIC TAH;;;; FEC3;ARABIC LETTER TAH INITIAL FORM;Lo;0;AL; 0637;;;;N;GLYPH FOR INITIAL ARABIC TAH;;;; FEC4;ARABIC LETTER TAH MEDIAL FORM;Lo;0;AL; 0637;;;;N;GLYPH FOR MEDIAL ARABIC TAH;;;; FEC5;ARABIC LETTER ZAH ISOLATED FORM;Lo;0;AL; 0638;;;;N;GLYPH FOR ISOLATE ARABIC DHAH;;;; FEC6;ARABIC LETTER ZAH FINAL FORM;Lo;0;AL; 0638;;;;N;GLYPH FOR FINAL ARABIC DHAH;;;; FEC7;ARABIC LETTER ZAH INITIAL FORM;Lo;0;AL; 0638;;;;N;GLYPH FOR INITIAL ARABIC DHAH;;;; FEC8;ARABIC LETTER ZAH MEDIAL FORM;Lo;0;AL; 0638;;;;N;GLYPH FOR MEDIAL ARABIC DHAH;;;; FEC9;ARABIC LETTER AIN ISOLATED FORM;Lo;0;AL; 0639;;;;N;GLYPH FOR ISOLATE ARABIC AIN;;;; FECA;ARABIC LETTER AIN FINAL FORM;Lo;0;AL; 0639;;;;N;GLYPH FOR FINAL ARABIC AIN;;;; FECB;ARABIC LETTER AIN INITIAL FORM;Lo;0;AL; 0639;;;;N;GLYPH FOR INITIAL ARABIC AIN;;;; FECC;ARABIC LETTER AIN MEDIAL FORM;Lo;0;AL; 0639;;;;N;GLYPH FOR MEDIAL ARABIC AIN;;;; FECD;ARABIC LETTER GHAIN ISOLATED FORM;Lo;0;AL; 063A;;;;N;GLYPH FOR ISOLATE ARABIC GHAIN;;;; FECE;ARABIC LETTER GHAIN FINAL FORM;Lo;0;AL; 063A;;;;N;GLYPH FOR FINAL ARABIC GHAIN;;;; FECF;ARABIC LETTER GHAIN INITIAL FORM;Lo;0;AL; 063A;;;;N;GLYPH FOR INITIAL ARABIC GHAIN;;;; FED0;ARABIC LETTER GHAIN MEDIAL FORM;Lo;0;AL; 063A;;;;N;GLYPH FOR MEDIAL ARABIC GHAIN;;;; FED1;ARABIC LETTER FEH ISOLATED FORM;Lo;0;AL; 0641;;;;N;GLYPH FOR ISOLATE ARABIC FA;;;; FED2;ARABIC LETTER FEH FINAL FORM;Lo;0;AL; 0641;;;;N;GLYPH FOR FINAL ARABIC FA;;;; FED3;ARABIC LETTER FEH INITIAL FORM;Lo;0;AL; 0641;;;;N;GLYPH FOR INITIAL ARABIC FA;;;; FED4;ARABIC LETTER FEH MEDIAL FORM;Lo;0;AL; 0641;;;;N;GLYPH FOR MEDIAL ARABIC FA;;;; FED5;ARABIC LETTER QAF ISOLATED FORM;Lo;0;AL; 0642;;;;N;GLYPH FOR ISOLATE ARABIC QAF;;;; FED6;ARABIC LETTER QAF FINAL FORM;Lo;0;AL; 0642;;;;N;GLYPH FOR FINAL ARABIC QAF;;;; FED7;ARABIC LETTER QAF INITIAL FORM;Lo;0;AL; 0642;;;;N;GLYPH FOR INITIAL ARABIC QAF;;;; FED8;ARABIC LETTER QAF MEDIAL FORM;Lo;0;AL; 0642;;;;N;GLYPH FOR MEDIAL ARABIC QAF;;;; FED9;ARABIC LETTER KAF ISOLATED FORM;Lo;0;AL; 0643;;;;N;GLYPH FOR ISOLATE ARABIC CAF;;;; FEDA;ARABIC LETTER KAF FINAL FORM;Lo;0;AL; 0643;;;;N;GLYPH FOR FINAL ARABIC CAF;;;; FEDB;ARABIC LETTER KAF INITIAL FORM;Lo;0;AL; 0643;;;;N;GLYPH FOR INITIAL ARABIC CAF;;;; FEDC;ARABIC LETTER KAF MEDIAL FORM;Lo;0;AL; 0643;;;;N;GLYPH FOR MEDIAL ARABIC CAF;;;; FEDD;ARABIC LETTER LAM ISOLATED FORM;Lo;0;AL; 0644;;;;N;GLYPH FOR ISOLATE ARABIC LAM;;;; FEDE;ARABIC LETTER LAM FINAL FORM;Lo;0;AL; 0644;;;;N;GLYPH FOR FINAL ARABIC LAM;;;; FEDF;ARABIC LETTER LAM INITIAL FORM;Lo;0;AL; 0644;;;;N;GLYPH FOR INITIAL ARABIC LAM;;;; FEE0;ARABIC LETTER LAM MEDIAL FORM;Lo;0;AL; 0644;;;;N;GLYPH FOR MEDIAL ARABIC LAM;;;; FEE1;ARABIC LETTER MEEM ISOLATED FORM;Lo;0;AL; 0645;;;;N;GLYPH FOR ISOLATE ARABIC MEEM;;;; FEE2;ARABIC LETTER MEEM FINAL FORM;Lo;0;AL; 0645;;;;N;GLYPH FOR FINAL ARABIC MEEM;;;; FEE3;ARABIC LETTER MEEM INITIAL FORM;Lo;0;AL; 0645;;;;N;GLYPH FOR INITIAL ARABIC MEEM;;;; FEE4;ARABIC LETTER MEEM MEDIAL FORM;Lo;0;AL; 0645;;;;N;GLYPH FOR MEDIAL ARABIC MEEM;;;; FEE5;ARABIC LETTER NOON ISOLATED FORM;Lo;0;AL; 0646;;;;N;GLYPH FOR ISOLATE ARABIC NOON;;;; FEE6;ARABIC LETTER NOON FINAL FORM;Lo;0;AL; 0646;;;;N;GLYPH FOR FINAL ARABIC NOON;;;; FEE7;ARABIC LETTER NOON INITIAL FORM;Lo;0;AL; 0646;;;;N;GLYPH FOR INITIAL ARABIC NOON;;;; FEE8;ARABIC LETTER NOON MEDIAL FORM;Lo;0;AL; 0646;;;;N;GLYPH FOR MEDIAL ARABIC NOON;;;; FEE9;ARABIC LETTER HEH ISOLATED FORM;Lo;0;AL; 0647;;;;N;GLYPH FOR ISOLATE ARABIC HA;;;; FEEA;ARABIC LETTER HEH FINAL FORM;Lo;0;AL; 0647;;;;N;GLYPH FOR FINAL ARABIC HA;;;; FEEB;ARABIC LETTER HEH INITIAL FORM;Lo;0;AL; 0647;;;;N;GLYPH FOR INITIAL ARABIC HA;;;; FEEC;ARABIC LETTER HEH MEDIAL FORM;Lo;0;AL; 0647;;;;N;GLYPH FOR MEDIAL ARABIC HA;;;; FEED;ARABIC LETTER WAW ISOLATED FORM;Lo;0;AL; 0648;;;;N;GLYPH FOR ISOLATE ARABIC WAW;;;; FEEE;ARABIC LETTER WAW FINAL FORM;Lo;0;AL; 0648;;;;N;GLYPH FOR FINAL ARABIC WAW;;;; FEEF;ARABIC LETTER ALEF MAKSURA ISOLATED FORM;Lo;0;AL; 0649;;;;N;GLYPH FOR ISOLATE ARABIC ALEF MAQSURAH;;;; FEF0;ARABIC LETTER ALEF MAKSURA FINAL FORM;Lo;0;AL; 0649;;;;N;GLYPH FOR FINAL ARABIC ALEF MAQSURAH;;;; FEF1;ARABIC LETTER YEH ISOLATED FORM;Lo;0;AL; 064A;;;;N;GLYPH FOR ISOLATE ARABIC YA;;;; FEF2;ARABIC LETTER YEH FINAL FORM;Lo;0;AL; 064A;;;;N;GLYPH FOR FINAL ARABIC YA;;;; FEF3;ARABIC LETTER YEH INITIAL FORM;Lo;0;AL; 064A;;;;N;GLYPH FOR INITIAL ARABIC YA;;;; FEF4;ARABIC LETTER YEH MEDIAL FORM;Lo;0;AL; 064A;;;;N;GLYPH FOR MEDIAL ARABIC YA;;;; FEF5;ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM;Lo;0;AL; 0644 0622;;;;N;GLYPH FOR ISOLATE ARABIC MADDAH ON LIGATURE LAM ALEF;;;; FEF6;ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM;Lo;0;AL; 0644 0622;;;;N;GLYPH FOR FINAL ARABIC MADDAH ON LIGATURE LAM ALEF;;;; FEF7;ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM;Lo;0;AL; 0644 0623;;;;N;GLYPH FOR ISOLATE ARABIC HAMZAH ON LIGATURE LAM ALEF;;;; FEF8;ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM;Lo;0;AL; 0644 0623;;;;N;GLYPH FOR FINAL ARABIC HAMZAH ON LIGATURE LAM ALEF;;;; FEF9;ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM;Lo;0;AL; 0644 0625;;;;N;GLYPH FOR ISOLATE ARABIC HAMZAH UNDER LIGATURE LAM ALEF;;;; FEFA;ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM;Lo;0;AL; 0644 0625;;;;N;GLYPH FOR FINAL ARABIC HAMZAH UNDER LIGATURE LAM ALEF;;;; FEFB;ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM;Lo;0;AL; 0644 0627;;;;N;GLYPH FOR ISOLATE ARABIC LIGATURE LAM ALEF;;;; FEFC;ARABIC LIGATURE LAM WITH ALEF FINAL FORM;Lo;0;AL; 0644 0627;;;;N;GLYPH FOR FINAL ARABIC LIGATURE LAM ALEF;;;; FEFF;ZERO WIDTH NO-BREAK SPACE;Cf;0;BN;;;;;N;BYTE ORDER MARK;;;; FF01;FULLWIDTH EXCLAMATION MARK;Po;0;ON; 0021;;;;N;;;;; FF02;FULLWIDTH QUOTATION MARK;Po;0;ON; 0022;;;;N;;;;; FF03;FULLWIDTH NUMBER SIGN;Po;0;ET; 0023;;;;N;;;;; FF04;FULLWIDTH DOLLAR SIGN;Sc;0;ET; 0024;;;;N;;;;; FF05;FULLWIDTH PERCENT SIGN;Po;0;ET; 0025;;;;N;;;;; FF06;FULLWIDTH AMPERSAND;Po;0;ON; 0026;;;;N;;;;; FF07;FULLWIDTH APOSTROPHE;Po;0;ON; 0027;;;;N;;;;; FF08;FULLWIDTH LEFT PARENTHESIS;Ps;0;ON; 0028;;;;Y;FULLWIDTH OPENING PARENTHESIS;;;; FF09;FULLWIDTH RIGHT PARENTHESIS;Pe;0;ON; 0029;;;;Y;FULLWIDTH CLOSING PARENTHESIS;;;; FF0A;FULLWIDTH ASTERISK;Po;0;ON; 002A;;;;N;;;;; FF0B;FULLWIDTH PLUS SIGN;Sm;0;ES; 002B;;;;N;;;;; FF0C;FULLWIDTH COMMA;Po;0;CS; 002C;;;;N;;;;; FF0D;FULLWIDTH HYPHEN-MINUS;Pd;0;ES; 002D;;;;N;;;;; FF0E;FULLWIDTH FULL STOP;Po;0;CS; 002E;;;;N;FULLWIDTH PERIOD;;;; FF0F;FULLWIDTH SOLIDUS;Po;0;CS; 002F;;;;N;FULLWIDTH SLASH;;;; FF10;FULLWIDTH DIGIT ZERO;Nd;0;EN; 0030;0;0;0;N;;;;; FF11;FULLWIDTH DIGIT ONE;Nd;0;EN; 0031;1;1;1;N;;;;; FF12;FULLWIDTH DIGIT TWO;Nd;0;EN; 0032;2;2;2;N;;;;; FF13;FULLWIDTH DIGIT THREE;Nd;0;EN; 0033;3;3;3;N;;;;; FF14;FULLWIDTH DIGIT FOUR;Nd;0;EN; 0034;4;4;4;N;;;;; FF15;FULLWIDTH DIGIT FIVE;Nd;0;EN; 0035;5;5;5;N;;;;; FF16;FULLWIDTH DIGIT SIX;Nd;0;EN; 0036;6;6;6;N;;;;; FF17;FULLWIDTH DIGIT SEVEN;Nd;0;EN; 0037;7;7;7;N;;;;; FF18;FULLWIDTH DIGIT EIGHT;Nd;0;EN; 0038;8;8;8;N;;;;; FF19;FULLWIDTH DIGIT NINE;Nd;0;EN; 0039;9;9;9;N;;;;; FF1A;FULLWIDTH COLON;Po;0;CS; 003A;;;;N;;;;; FF1B;FULLWIDTH SEMICOLON;Po;0;ON; 003B;;;;N;;;;; FF1C;FULLWIDTH LESS-THAN SIGN;Sm;0;ON; 003C;;;;Y;;;;; FF1D;FULLWIDTH EQUALS SIGN;Sm;0;ON; 003D;;;;N;;;;; FF1E;FULLWIDTH GREATER-THAN SIGN;Sm;0;ON; 003E;;;;Y;;;;; FF1F;FULLWIDTH QUESTION MARK;Po;0;ON; 003F;;;;N;;;;; FF20;FULLWIDTH COMMERCIAL AT;Po;0;ON; 0040;;;;N;;;;; FF21;FULLWIDTH LATIN CAPITAL LETTER A;Lu;0;L; 0041;;;;N;;;;FF41; FF22;FULLWIDTH LATIN CAPITAL LETTER B;Lu;0;L; 0042;;;;N;;;;FF42; FF23;FULLWIDTH LATIN CAPITAL LETTER C;Lu;0;L; 0043;;;;N;;;;FF43; FF24;FULLWIDTH LATIN CAPITAL LETTER D;Lu;0;L; 0044;;;;N;;;;FF44; FF25;FULLWIDTH LATIN CAPITAL LETTER E;Lu;0;L; 0045;;;;N;;;;FF45; FF26;FULLWIDTH LATIN CAPITAL LETTER F;Lu;0;L; 0046;;;;N;;;;FF46; FF27;FULLWIDTH LATIN CAPITAL LETTER G;Lu;0;L; 0047;;;;N;;;;FF47; FF28;FULLWIDTH LATIN CAPITAL LETTER H;Lu;0;L; 0048;;;;N;;;;FF48; FF29;FULLWIDTH LATIN CAPITAL LETTER I;Lu;0;L; 0049;;;;N;;;;FF49; FF2A;FULLWIDTH LATIN CAPITAL LETTER J;Lu;0;L; 004A;;;;N;;;;FF4A; FF2B;FULLWIDTH LATIN CAPITAL LETTER K;Lu;0;L; 004B;;;;N;;;;FF4B; FF2C;FULLWIDTH LATIN CAPITAL LETTER L;Lu;0;L; 004C;;;;N;;;;FF4C; FF2D;FULLWIDTH LATIN CAPITAL LETTER M;Lu;0;L; 004D;;;;N;;;;FF4D; FF2E;FULLWIDTH LATIN CAPITAL LETTER N;Lu;0;L; 004E;;;;N;;;;FF4E; FF2F;FULLWIDTH LATIN CAPITAL LETTER O;Lu;0;L; 004F;;;;N;;;;FF4F; FF30;FULLWIDTH LATIN CAPITAL LETTER P;Lu;0;L; 0050;;;;N;;;;FF50; FF31;FULLWIDTH LATIN CAPITAL LETTER Q;Lu;0;L; 0051;;;;N;;;;FF51; FF32;FULLWIDTH LATIN CAPITAL LETTER R;Lu;0;L; 0052;;;;N;;;;FF52; FF33;FULLWIDTH LATIN CAPITAL LETTER S;Lu;0;L; 0053;;;;N;;;;FF53; FF34;FULLWIDTH LATIN CAPITAL LETTER T;Lu;0;L; 0054;;;;N;;;;FF54; FF35;FULLWIDTH LATIN CAPITAL LETTER U;Lu;0;L; 0055;;;;N;;;;FF55; FF36;FULLWIDTH LATIN CAPITAL LETTER V;Lu;0;L; 0056;;;;N;;;;FF56; FF37;FULLWIDTH LATIN CAPITAL LETTER W;Lu;0;L; 0057;;;;N;;;;FF57; FF38;FULLWIDTH LATIN CAPITAL LETTER X;Lu;0;L; 0058;;;;N;;;;FF58; FF39;FULLWIDTH LATIN CAPITAL LETTER Y;Lu;0;L; 0059;;;;N;;;;FF59; FF3A;FULLWIDTH LATIN CAPITAL LETTER Z;Lu;0;L; 005A;;;;N;;;;FF5A; FF3B;FULLWIDTH LEFT SQUARE BRACKET;Ps;0;ON; 005B;;;;Y;FULLWIDTH OPENING SQUARE BRACKET;;;; FF3C;FULLWIDTH REVERSE SOLIDUS;Po;0;ON; 005C;;;;N;FULLWIDTH BACKSLASH;;;; FF3D;FULLWIDTH RIGHT SQUARE BRACKET;Pe;0;ON; 005D;;;;Y;FULLWIDTH CLOSING SQUARE BRACKET;;;; FF3E;FULLWIDTH CIRCUMFLEX ACCENT;Sk;0;ON; 005E;;;;N;FULLWIDTH SPACING CIRCUMFLEX;;;; FF3F;FULLWIDTH LOW LINE;Pc;0;ON; 005F;;;;N;FULLWIDTH SPACING UNDERSCORE;;;; FF40;FULLWIDTH GRAVE ACCENT;Sk;0;ON; 0060;;;;N;FULLWIDTH SPACING GRAVE;;;; FF41;FULLWIDTH LATIN SMALL LETTER A;Ll;0;L; 0061;;;;N;;;FF21;;FF21 FF42;FULLWIDTH LATIN SMALL LETTER B;Ll;0;L; 0062;;;;N;;;FF22;;FF22 FF43;FULLWIDTH LATIN SMALL LETTER C;Ll;0;L; 0063;;;;N;;;FF23;;FF23 FF44;FULLWIDTH LATIN SMALL LETTER D;Ll;0;L; 0064;;;;N;;;FF24;;FF24 FF45;FULLWIDTH LATIN SMALL LETTER E;Ll;0;L; 0065;;;;N;;;FF25;;FF25 FF46;FULLWIDTH LATIN SMALL LETTER F;Ll;0;L; 0066;;;;N;;;FF26;;FF26 FF47;FULLWIDTH LATIN SMALL LETTER G;Ll;0;L; 0067;;;;N;;;FF27;;FF27 FF48;FULLWIDTH LATIN SMALL LETTER H;Ll;0;L; 0068;;;;N;;;FF28;;FF28 FF49;FULLWIDTH LATIN SMALL LETTER I;Ll;0;L; 0069;;;;N;;;FF29;;FF29 FF4A;FULLWIDTH LATIN SMALL LETTER J;Ll;0;L; 006A;;;;N;;;FF2A;;FF2A FF4B;FULLWIDTH LATIN SMALL LETTER K;Ll;0;L; 006B;;;;N;;;FF2B;;FF2B FF4C;FULLWIDTH LATIN SMALL LETTER L;Ll;0;L; 006C;;;;N;;;FF2C;;FF2C FF4D;FULLWIDTH LATIN SMALL LETTER M;Ll;0;L; 006D;;;;N;;;FF2D;;FF2D FF4E;FULLWIDTH LATIN SMALL LETTER N;Ll;0;L; 006E;;;;N;;;FF2E;;FF2E FF4F;FULLWIDTH LATIN SMALL LETTER O;Ll;0;L; 006F;;;;N;;;FF2F;;FF2F FF50;FULLWIDTH LATIN SMALL LETTER P;Ll;0;L; 0070;;;;N;;;FF30;;FF30 FF51;FULLWIDTH LATIN SMALL LETTER Q;Ll;0;L; 0071;;;;N;;;FF31;;FF31 FF52;FULLWIDTH LATIN SMALL LETTER R;Ll;0;L; 0072;;;;N;;;FF32;;FF32 FF53;FULLWIDTH LATIN SMALL LETTER S;Ll;0;L; 0073;;;;N;;;FF33;;FF33 FF54;FULLWIDTH LATIN SMALL LETTER T;Ll;0;L; 0074;;;;N;;;FF34;;FF34 FF55;FULLWIDTH LATIN SMALL LETTER U;Ll;0;L; 0075;;;;N;;;FF35;;FF35 FF56;FULLWIDTH LATIN SMALL LETTER V;Ll;0;L; 0076;;;;N;;;FF36;;FF36 FF57;FULLWIDTH LATIN SMALL LETTER W;Ll;0;L; 0077;;;;N;;;FF37;;FF37 FF58;FULLWIDTH LATIN SMALL LETTER X;Ll;0;L; 0078;;;;N;;;FF38;;FF38 FF59;FULLWIDTH LATIN SMALL LETTER Y;Ll;0;L; 0079;;;;N;;;FF39;;FF39 FF5A;FULLWIDTH LATIN SMALL LETTER Z;Ll;0;L; 007A;;;;N;;;FF3A;;FF3A FF5B;FULLWIDTH LEFT CURLY BRACKET;Ps;0;ON; 007B;;;;Y;FULLWIDTH OPENING CURLY BRACKET;;;; FF5C;FULLWIDTH VERTICAL LINE;Sm;0;ON; 007C;;;;N;FULLWIDTH VERTICAL BAR;;;; FF5D;FULLWIDTH RIGHT CURLY BRACKET;Pe;0;ON; 007D;;;;Y;FULLWIDTH CLOSING CURLY BRACKET;;;; FF5E;FULLWIDTH TILDE;Sm;0;ON; 007E;;;;N;FULLWIDTH SPACING TILDE;;;; FF5F;FULLWIDTH LEFT WHITE PARENTHESIS;Ps;0;ON; 2985;;;;Y;;;;; FF60;FULLWIDTH RIGHT WHITE PARENTHESIS;Pe;0;ON; 2986;;;;Y;;;;; FF61;HALFWIDTH IDEOGRAPHIC FULL STOP;Po;0;ON; 3002;;;;N;HALFWIDTH IDEOGRAPHIC PERIOD;;;; FF62;HALFWIDTH LEFT CORNER BRACKET;Ps;0;ON; 300C;;;;Y;HALFWIDTH OPENING CORNER BRACKET;;;; FF63;HALFWIDTH RIGHT CORNER BRACKET;Pe;0;ON; 300D;;;;Y;HALFWIDTH CLOSING CORNER BRACKET;;;; FF64;HALFWIDTH IDEOGRAPHIC COMMA;Po;0;ON; 3001;;;;N;;;;; FF65;HALFWIDTH KATAKANA MIDDLE DOT;Po;0;ON; 30FB;;;;N;;;;; FF66;HALFWIDTH KATAKANA LETTER WO;Lo;0;L; 30F2;;;;N;;;;; FF67;HALFWIDTH KATAKANA LETTER SMALL A;Lo;0;L; 30A1;;;;N;;;;; FF68;HALFWIDTH KATAKANA LETTER SMALL I;Lo;0;L; 30A3;;;;N;;;;; FF69;HALFWIDTH KATAKANA LETTER SMALL U;Lo;0;L; 30A5;;;;N;;;;; FF6A;HALFWIDTH KATAKANA LETTER SMALL E;Lo;0;L; 30A7;;;;N;;;;; FF6B;HALFWIDTH KATAKANA LETTER SMALL O;Lo;0;L; 30A9;;;;N;;;;; FF6C;HALFWIDTH KATAKANA LETTER SMALL YA;Lo;0;L; 30E3;;;;N;;;;; FF6D;HALFWIDTH KATAKANA LETTER SMALL YU;Lo;0;L; 30E5;;;;N;;;;; FF6E;HALFWIDTH KATAKANA LETTER SMALL YO;Lo;0;L; 30E7;;;;N;;;;; FF6F;HALFWIDTH KATAKANA LETTER SMALL TU;Lo;0;L; 30C3;;;;N;;;;; FF70;HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK;Lm;0;L; 30FC;;;;N;;;;; FF71;HALFWIDTH KATAKANA LETTER A;Lo;0;L; 30A2;;;;N;;;;; FF72;HALFWIDTH KATAKANA LETTER I;Lo;0;L; 30A4;;;;N;;;;; FF73;HALFWIDTH KATAKANA LETTER U;Lo;0;L; 30A6;;;;N;;;;; FF74;HALFWIDTH KATAKANA LETTER E;Lo;0;L; 30A8;;;;N;;;;; FF75;HALFWIDTH KATAKANA LETTER O;Lo;0;L; 30AA;;;;N;;;;; FF76;HALFWIDTH KATAKANA LETTER KA;Lo;0;L; 30AB;;;;N;;;;; FF77;HALFWIDTH KATAKANA LETTER KI;Lo;0;L; 30AD;;;;N;;;;; FF78;HALFWIDTH KATAKANA LETTER KU;Lo;0;L; 30AF;;;;N;;;;; FF79;HALFWIDTH KATAKANA LETTER KE;Lo;0;L; 30B1;;;;N;;;;; FF7A;HALFWIDTH KATAKANA LETTER KO;Lo;0;L; 30B3;;;;N;;;;; FF7B;HALFWIDTH KATAKANA LETTER SA;Lo;0;L; 30B5;;;;N;;;;; FF7C;HALFWIDTH KATAKANA LETTER SI;Lo;0;L; 30B7;;;;N;;;;; FF7D;HALFWIDTH KATAKANA LETTER SU;Lo;0;L; 30B9;;;;N;;;;; FF7E;HALFWIDTH KATAKANA LETTER SE;Lo;0;L; 30BB;;;;N;;;;; FF7F;HALFWIDTH KATAKANA LETTER SO;Lo;0;L; 30BD;;;;N;;;;; FF80;HALFWIDTH KATAKANA LETTER TA;Lo;0;L; 30BF;;;;N;;;;; FF81;HALFWIDTH KATAKANA LETTER TI;Lo;0;L; 30C1;;;;N;;;;; FF82;HALFWIDTH KATAKANA LETTER TU;Lo;0;L; 30C4;;;;N;;;;; FF83;HALFWIDTH KATAKANA LETTER TE;Lo;0;L; 30C6;;;;N;;;;; FF84;HALFWIDTH KATAKANA LETTER TO;Lo;0;L; 30C8;;;;N;;;;; FF85;HALFWIDTH KATAKANA LETTER NA;Lo;0;L; 30CA;;;;N;;;;; FF86;HALFWIDTH KATAKANA LETTER NI;Lo;0;L; 30CB;;;;N;;;;; FF87;HALFWIDTH KATAKANA LETTER NU;Lo;0;L; 30CC;;;;N;;;;; FF88;HALFWIDTH KATAKANA LETTER NE;Lo;0;L; 30CD;;;;N;;;;; FF89;HALFWIDTH KATAKANA LETTER NO;Lo;0;L; 30CE;;;;N;;;;; FF8A;HALFWIDTH KATAKANA LETTER HA;Lo;0;L; 30CF;;;;N;;;;; FF8B;HALFWIDTH KATAKANA LETTER HI;Lo;0;L; 30D2;;;;N;;;;; FF8C;HALFWIDTH KATAKANA LETTER HU;Lo;0;L; 30D5;;;;N;;;;; FF8D;HALFWIDTH KATAKANA LETTER HE;Lo;0;L; 30D8;;;;N;;;;; FF8E;HALFWIDTH KATAKANA LETTER HO;Lo;0;L; 30DB;;;;N;;;;; FF8F;HALFWIDTH KATAKANA LETTER MA;Lo;0;L; 30DE;;;;N;;;;; FF90;HALFWIDTH KATAKANA LETTER MI;Lo;0;L; 30DF;;;;N;;;;; FF91;HALFWIDTH KATAKANA LETTER MU;Lo;0;L; 30E0;;;;N;;;;; FF92;HALFWIDTH KATAKANA LETTER ME;Lo;0;L; 30E1;;;;N;;;;; FF93;HALFWIDTH KATAKANA LETTER MO;Lo;0;L; 30E2;;;;N;;;;; FF94;HALFWIDTH KATAKANA LETTER YA;Lo;0;L; 30E4;;;;N;;;;; FF95;HALFWIDTH KATAKANA LETTER YU;Lo;0;L; 30E6;;;;N;;;;; FF96;HALFWIDTH KATAKANA LETTER YO;Lo;0;L; 30E8;;;;N;;;;; FF97;HALFWIDTH KATAKANA LETTER RA;Lo;0;L; 30E9;;;;N;;;;; FF98;HALFWIDTH KATAKANA LETTER RI;Lo;0;L; 30EA;;;;N;;;;; FF99;HALFWIDTH KATAKANA LETTER RU;Lo;0;L; 30EB;;;;N;;;;; FF9A;HALFWIDTH KATAKANA LETTER RE;Lo;0;L; 30EC;;;;N;;;;; FF9B;HALFWIDTH KATAKANA LETTER RO;Lo;0;L; 30ED;;;;N;;;;; FF9C;HALFWIDTH KATAKANA LETTER WA;Lo;0;L; 30EF;;;;N;;;;; FF9D;HALFWIDTH KATAKANA LETTER N;Lo;0;L; 30F3;;;;N;;;;; FF9E;HALFWIDTH KATAKANA VOICED SOUND MARK;Lm;0;L; 3099;;;;N;;;;; FF9F;HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK;Lm;0;L; 309A;;;;N;;;;; FFA0;HALFWIDTH HANGUL FILLER;Lo;0;L; 3164;;;;N;HALFWIDTH HANGUL CAE OM;;;; FFA1;HALFWIDTH HANGUL LETTER KIYEOK;Lo;0;L; 3131;;;;N;HALFWIDTH HANGUL LETTER GIYEOG;;;; FFA2;HALFWIDTH HANGUL LETTER SSANGKIYEOK;Lo;0;L; 3132;;;;N;HALFWIDTH HANGUL LETTER SSANG GIYEOG;;;; FFA3;HALFWIDTH HANGUL LETTER KIYEOK-SIOS;Lo;0;L; 3133;;;;N;HALFWIDTH HANGUL LETTER GIYEOG SIOS;;;; FFA4;HALFWIDTH HANGUL LETTER NIEUN;Lo;0;L; 3134;;;;N;;;;; FFA5;HALFWIDTH HANGUL LETTER NIEUN-CIEUC;Lo;0;L; 3135;;;;N;HALFWIDTH HANGUL LETTER NIEUN JIEUJ;;;; FFA6;HALFWIDTH HANGUL LETTER NIEUN-HIEUH;Lo;0;L; 3136;;;;N;HALFWIDTH HANGUL LETTER NIEUN HIEUH;;;; FFA7;HALFWIDTH HANGUL LETTER TIKEUT;Lo;0;L; 3137;;;;N;HALFWIDTH HANGUL LETTER DIGEUD;;;; FFA8;HALFWIDTH HANGUL LETTER SSANGTIKEUT;Lo;0;L; 3138;;;;N;HALFWIDTH HANGUL LETTER SSANG DIGEUD;;;; FFA9;HALFWIDTH HANGUL LETTER RIEUL;Lo;0;L; 3139;;;;N;HALFWIDTH HANGUL LETTER LIEUL;;;; FFAA;HALFWIDTH HANGUL LETTER RIEUL-KIYEOK;Lo;0;L; 313A;;;;N;HALFWIDTH HANGUL LETTER LIEUL GIYEOG;;;; FFAB;HALFWIDTH HANGUL LETTER RIEUL-MIEUM;Lo;0;L; 313B;;;;N;HALFWIDTH HANGUL LETTER LIEUL MIEUM;;;; FFAC;HALFWIDTH HANGUL LETTER RIEUL-PIEUP;Lo;0;L; 313C;;;;N;HALFWIDTH HANGUL LETTER LIEUL BIEUB;;;; FFAD;HALFWIDTH HANGUL LETTER RIEUL-SIOS;Lo;0;L; 313D;;;;N;HALFWIDTH HANGUL LETTER LIEUL SIOS;;;; FFAE;HALFWIDTH HANGUL LETTER RIEUL-THIEUTH;Lo;0;L; 313E;;;;N;HALFWIDTH HANGUL LETTER LIEUL TIEUT;;;; FFAF;HALFWIDTH HANGUL LETTER RIEUL-PHIEUPH;Lo;0;L; 313F;;;;N;HALFWIDTH HANGUL LETTER LIEUL PIEUP;;;; FFB0;HALFWIDTH HANGUL LETTER RIEUL-HIEUH;Lo;0;L; 3140;;;;N;HALFWIDTH HANGUL LETTER LIEUL HIEUH;;;; FFB1;HALFWIDTH HANGUL LETTER MIEUM;Lo;0;L; 3141;;;;N;;;;; FFB2;HALFWIDTH HANGUL LETTER PIEUP;Lo;0;L; 3142;;;;N;HALFWIDTH HANGUL LETTER BIEUB;;;; FFB3;HALFWIDTH HANGUL LETTER SSANGPIEUP;Lo;0;L; 3143;;;;N;HALFWIDTH HANGUL LETTER SSANG BIEUB;;;; FFB4;HALFWIDTH HANGUL LETTER PIEUP-SIOS;Lo;0;L; 3144;;;;N;HALFWIDTH HANGUL LETTER BIEUB SIOS;;;; FFB5;HALFWIDTH HANGUL LETTER SIOS;Lo;0;L; 3145;;;;N;;;;; FFB6;HALFWIDTH HANGUL LETTER SSANGSIOS;Lo;0;L; 3146;;;;N;HALFWIDTH HANGUL LETTER SSANG SIOS;;;; FFB7;HALFWIDTH HANGUL LETTER IEUNG;Lo;0;L; 3147;;;;N;;;;; FFB8;HALFWIDTH HANGUL LETTER CIEUC;Lo;0;L; 3148;;;;N;HALFWIDTH HANGUL LETTER JIEUJ;;;; FFB9;HALFWIDTH HANGUL LETTER SSANGCIEUC;Lo;0;L; 3149;;;;N;HALFWIDTH HANGUL LETTER SSANG JIEUJ;;;; FFBA;HALFWIDTH HANGUL LETTER CHIEUCH;Lo;0;L; 314A;;;;N;HALFWIDTH HANGUL LETTER CIEUC;;;; FFBB;HALFWIDTH HANGUL LETTER KHIEUKH;Lo;0;L; 314B;;;;N;HALFWIDTH HANGUL LETTER KIYEOK;;;; FFBC;HALFWIDTH HANGUL LETTER THIEUTH;Lo;0;L; 314C;;;;N;HALFWIDTH HANGUL LETTER TIEUT;;;; FFBD;HALFWIDTH HANGUL LETTER PHIEUPH;Lo;0;L; 314D;;;;N;HALFWIDTH HANGUL LETTER PIEUP;;;; FFBE;HALFWIDTH HANGUL LETTER HIEUH;Lo;0;L; 314E;;;;N;;;;; FFC2;HALFWIDTH HANGUL LETTER A;Lo;0;L; 314F;;;;N;;;;; FFC3;HALFWIDTH HANGUL LETTER AE;Lo;0;L; 3150;;;;N;;;;; FFC4;HALFWIDTH HANGUL LETTER YA;Lo;0;L; 3151;;;;N;;;;; FFC5;HALFWIDTH HANGUL LETTER YAE;Lo;0;L; 3152;;;;N;;;;; FFC6;HALFWIDTH HANGUL LETTER EO;Lo;0;L; 3153;;;;N;;;;; FFC7;HALFWIDTH HANGUL LETTER E;Lo;0;L; 3154;;;;N;;;;; FFCA;HALFWIDTH HANGUL LETTER YEO;Lo;0;L; 3155;;;;N;;;;; FFCB;HALFWIDTH HANGUL LETTER YE;Lo;0;L; 3156;;;;N;;;;; FFCC;HALFWIDTH HANGUL LETTER O;Lo;0;L; 3157;;;;N;;;;; FFCD;HALFWIDTH HANGUL LETTER WA;Lo;0;L; 3158;;;;N;;;;; FFCE;HALFWIDTH HANGUL LETTER WAE;Lo;0;L; 3159;;;;N;;;;; FFCF;HALFWIDTH HANGUL LETTER OE;Lo;0;L; 315A;;;;N;;;;; FFD2;HALFWIDTH HANGUL LETTER YO;Lo;0;L; 315B;;;;N;;;;; FFD3;HALFWIDTH HANGUL LETTER U;Lo;0;L; 315C;;;;N;;;;; FFD4;HALFWIDTH HANGUL LETTER WEO;Lo;0;L; 315D;;;;N;;;;; FFD5;HALFWIDTH HANGUL LETTER WE;Lo;0;L; 315E;;;;N;;;;; FFD6;HALFWIDTH HANGUL LETTER WI;Lo;0;L; 315F;;;;N;;;;; FFD7;HALFWIDTH HANGUL LETTER YU;Lo;0;L; 3160;;;;N;;;;; FFDA;HALFWIDTH HANGUL LETTER EU;Lo;0;L; 3161;;;;N;;;;; FFDB;HALFWIDTH HANGUL LETTER YI;Lo;0;L; 3162;;;;N;;;;; FFDC;HALFWIDTH HANGUL LETTER I;Lo;0;L; 3163;;;;N;;;;; FFE0;FULLWIDTH CENT SIGN;Sc;0;ET; 00A2;;;;N;;;;; FFE1;FULLWIDTH POUND SIGN;Sc;0;ET; 00A3;;;;N;;;;; FFE2;FULLWIDTH NOT SIGN;Sm;0;ON; 00AC;;;;N;;;;; FFE3;FULLWIDTH MACRON;Sk;0;ON; 00AF;;;;N;FULLWIDTH SPACING MACRON;;;; FFE4;FULLWIDTH BROKEN BAR;So;0;ON; 00A6;;;;N;FULLWIDTH BROKEN VERTICAL BAR;;;; FFE5;FULLWIDTH YEN SIGN;Sc;0;ET; 00A5;;;;N;;;;; FFE6;FULLWIDTH WON SIGN;Sc;0;ET; 20A9;;;;N;;;;; FFE8;HALFWIDTH FORMS LIGHT VERTICAL;So;0;ON; 2502;;;;N;;;;; FFE9;HALFWIDTH LEFTWARDS ARROW;Sm;0;ON; 2190;;;;N;;;;; FFEA;HALFWIDTH UPWARDS ARROW;Sm;0;ON; 2191;;;;N;;;;; FFEB;HALFWIDTH RIGHTWARDS ARROW;Sm;0;ON; 2192;;;;N;;;;; FFEC;HALFWIDTH DOWNWARDS ARROW;Sm;0;ON; 2193;;;;N;;;;; FFED;HALFWIDTH BLACK SQUARE;So;0;ON; 25A0;;;;N;;;;; FFEE;HALFWIDTH WHITE CIRCLE;So;0;ON; 25CB;;;;N;;;;; FFF9;INTERLINEAR ANNOTATION ANCHOR;Cf;0;ON;;;;;N;;;;; FFFA;INTERLINEAR ANNOTATION SEPARATOR;Cf;0;ON;;;;;N;;;;; FFFB;INTERLINEAR ANNOTATION TERMINATOR;Cf;0;ON;;;;;N;;;;; FFFC;OBJECT REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 10000;LINEAR B SYLLABLE B008 A;Lo;0;L;;;;;N;;;;; 10001;LINEAR B SYLLABLE B038 E;Lo;0;L;;;;;N;;;;; 10002;LINEAR B SYLLABLE B028 I;Lo;0;L;;;;;N;;;;; 10003;LINEAR B SYLLABLE B061 O;Lo;0;L;;;;;N;;;;; 10004;LINEAR B SYLLABLE B010 U;Lo;0;L;;;;;N;;;;; 10005;LINEAR B SYLLABLE B001 DA;Lo;0;L;;;;;N;;;;; 10006;LINEAR B SYLLABLE B045 DE;Lo;0;L;;;;;N;;;;; 10007;LINEAR B SYLLABLE B007 DI;Lo;0;L;;;;;N;;;;; 10008;LINEAR B SYLLABLE B014 DO;Lo;0;L;;;;;N;;;;; 10009;LINEAR B SYLLABLE B051 DU;Lo;0;L;;;;;N;;;;; 1000A;LINEAR B SYLLABLE B057 JA;Lo;0;L;;;;;N;;;;; 1000B;LINEAR B SYLLABLE B046 JE;Lo;0;L;;;;;N;;;;; 1000D;LINEAR B SYLLABLE B036 JO;Lo;0;L;;;;;N;;;;; 1000E;LINEAR B SYLLABLE B065 JU;Lo;0;L;;;;;N;;;;; 1000F;LINEAR B SYLLABLE B077 KA;Lo;0;L;;;;;N;;;;; 10010;LINEAR B SYLLABLE B044 KE;Lo;0;L;;;;;N;;;;; 10011;LINEAR B SYLLABLE B067 KI;Lo;0;L;;;;;N;;;;; 10012;LINEAR B SYLLABLE B070 KO;Lo;0;L;;;;;N;;;;; 10013;LINEAR B SYLLABLE B081 KU;Lo;0;L;;;;;N;;;;; 10014;LINEAR B SYLLABLE B080 MA;Lo;0;L;;;;;N;;;;; 10015;LINEAR B SYLLABLE B013 ME;Lo;0;L;;;;;N;;;;; 10016;LINEAR B SYLLABLE B073 MI;Lo;0;L;;;;;N;;;;; 10017;LINEAR B SYLLABLE B015 MO;Lo;0;L;;;;;N;;;;; 10018;LINEAR B SYLLABLE B023 MU;Lo;0;L;;;;;N;;;;; 10019;LINEAR B SYLLABLE B006 NA;Lo;0;L;;;;;N;;;;; 1001A;LINEAR B SYLLABLE B024 NE;Lo;0;L;;;;;N;;;;; 1001B;LINEAR B SYLLABLE B030 NI;Lo;0;L;;;;;N;;;;; 1001C;LINEAR B SYLLABLE B052 NO;Lo;0;L;;;;;N;;;;; 1001D;LINEAR B SYLLABLE B055 NU;Lo;0;L;;;;;N;;;;; 1001E;LINEAR B SYLLABLE B003 PA;Lo;0;L;;;;;N;;;;; 1001F;LINEAR B SYLLABLE B072 PE;Lo;0;L;;;;;N;;;;; 10020;LINEAR B SYLLABLE B039 PI;Lo;0;L;;;;;N;;;;; 10021;LINEAR B SYLLABLE B011 PO;Lo;0;L;;;;;N;;;;; 10022;LINEAR B SYLLABLE B050 PU;Lo;0;L;;;;;N;;;;; 10023;LINEAR B SYLLABLE B016 QA;Lo;0;L;;;;;N;;;;; 10024;LINEAR B SYLLABLE B078 QE;Lo;0;L;;;;;N;;;;; 10025;LINEAR B SYLLABLE B021 QI;Lo;0;L;;;;;N;;;;; 10026;LINEAR B SYLLABLE B032 QO;Lo;0;L;;;;;N;;;;; 10028;LINEAR B SYLLABLE B060 RA;Lo;0;L;;;;;N;;;;; 10029;LINEAR B SYLLABLE B027 RE;Lo;0;L;;;;;N;;;;; 1002A;LINEAR B SYLLABLE B053 RI;Lo;0;L;;;;;N;;;;; 1002B;LINEAR B SYLLABLE B002 RO;Lo;0;L;;;;;N;;;;; 1002C;LINEAR B SYLLABLE B026 RU;Lo;0;L;;;;;N;;;;; 1002D;LINEAR B SYLLABLE B031 SA;Lo;0;L;;;;;N;;;;; 1002E;LINEAR B SYLLABLE B009 SE;Lo;0;L;;;;;N;;;;; 1002F;LINEAR B SYLLABLE B041 SI;Lo;0;L;;;;;N;;;;; 10030;LINEAR B SYLLABLE B012 SO;Lo;0;L;;;;;N;;;;; 10031;LINEAR B SYLLABLE B058 SU;Lo;0;L;;;;;N;;;;; 10032;LINEAR B SYLLABLE B059 TA;Lo;0;L;;;;;N;;;;; 10033;LINEAR B SYLLABLE B004 TE;Lo;0;L;;;;;N;;;;; 10034;LINEAR B SYLLABLE B037 TI;Lo;0;L;;;;;N;;;;; 10035;LINEAR B SYLLABLE B005 TO;Lo;0;L;;;;;N;;;;; 10036;LINEAR B SYLLABLE B069 TU;Lo;0;L;;;;;N;;;;; 10037;LINEAR B SYLLABLE B054 WA;Lo;0;L;;;;;N;;;;; 10038;LINEAR B SYLLABLE B075 WE;Lo;0;L;;;;;N;;;;; 10039;LINEAR B SYLLABLE B040 WI;Lo;0;L;;;;;N;;;;; 1003A;LINEAR B SYLLABLE B042 WO;Lo;0;L;;;;;N;;;;; 1003C;LINEAR B SYLLABLE B017 ZA;Lo;0;L;;;;;N;;;;; 1003D;LINEAR B SYLLABLE B074 ZE;Lo;0;L;;;;;N;;;;; 1003F;LINEAR B SYLLABLE B020 ZO;Lo;0;L;;;;;N;;;;; 10040;LINEAR B SYLLABLE B025 A2;Lo;0;L;;;;;N;;;;; 10041;LINEAR B SYLLABLE B043 A3;Lo;0;L;;;;;N;;;;; 10042;LINEAR B SYLLABLE B085 AU;Lo;0;L;;;;;N;;;;; 10043;LINEAR B SYLLABLE B071 DWE;Lo;0;L;;;;;N;;;;; 10044;LINEAR B SYLLABLE B090 DWO;Lo;0;L;;;;;N;;;;; 10045;LINEAR B SYLLABLE B048 NWA;Lo;0;L;;;;;N;;;;; 10046;LINEAR B SYLLABLE B029 PU2;Lo;0;L;;;;;N;;;;; 10047;LINEAR B SYLLABLE B062 PTE;Lo;0;L;;;;;N;;;;; 10048;LINEAR B SYLLABLE B076 RA2;Lo;0;L;;;;;N;;;;; 10049;LINEAR B SYLLABLE B033 RA3;Lo;0;L;;;;;N;;;;; 1004A;LINEAR B SYLLABLE B068 RO2;Lo;0;L;;;;;N;;;;; 1004B;LINEAR B SYLLABLE B066 TA2;Lo;0;L;;;;;N;;;;; 1004C;LINEAR B SYLLABLE B087 TWE;Lo;0;L;;;;;N;;;;; 1004D;LINEAR B SYLLABLE B091 TWO;Lo;0;L;;;;;N;;;;; 10050;LINEAR B SYMBOL B018;Lo;0;L;;;;;N;;;;; 10051;LINEAR B SYMBOL B019;Lo;0;L;;;;;N;;;;; 10052;LINEAR B SYMBOL B022;Lo;0;L;;;;;N;;;;; 10053;LINEAR B SYMBOL B034;Lo;0;L;;;;;N;;;;; 10054;LINEAR B SYMBOL B047;Lo;0;L;;;;;N;;;;; 10055;LINEAR B SYMBOL B049;Lo;0;L;;;;;N;;;;; 10056;LINEAR B SYMBOL B056;Lo;0;L;;;;;N;;;;; 10057;LINEAR B SYMBOL B063;Lo;0;L;;;;;N;;;;; 10058;LINEAR B SYMBOL B064;Lo;0;L;;;;;N;;;;; 10059;LINEAR B SYMBOL B079;Lo;0;L;;;;;N;;;;; 1005A;LINEAR B SYMBOL B082;Lo;0;L;;;;;N;;;;; 1005B;LINEAR B SYMBOL B083;Lo;0;L;;;;;N;;;;; 1005C;LINEAR B SYMBOL B086;Lo;0;L;;;;;N;;;;; 1005D;LINEAR B SYMBOL B089;Lo;0;L;;;;;N;;;;; 10080;LINEAR B IDEOGRAM B100 MAN;Lo;0;L;;;;;N;;;;; 10081;LINEAR B IDEOGRAM B102 WOMAN;Lo;0;L;;;;;N;;;;; 10082;LINEAR B IDEOGRAM B104 DEER;Lo;0;L;;;;;N;;;;; 10083;LINEAR B IDEOGRAM B105 EQUID;Lo;0;L;;;;;N;;;;; 10084;LINEAR B IDEOGRAM B105F MARE;Lo;0;L;;;;;N;;;;; 10085;LINEAR B IDEOGRAM B105M STALLION;Lo;0;L;;;;;N;;;;; 10086;LINEAR B IDEOGRAM B106F EWE;Lo;0;L;;;;;N;;;;; 10087;LINEAR B IDEOGRAM B106M RAM;Lo;0;L;;;;;N;;;;; 10088;LINEAR B IDEOGRAM B107F SHE-GOAT;Lo;0;L;;;;;N;;;;; 10089;LINEAR B IDEOGRAM B107M HE-GOAT;Lo;0;L;;;;;N;;;;; 1008A;LINEAR B IDEOGRAM B108F SOW;Lo;0;L;;;;;N;;;;; 1008B;LINEAR B IDEOGRAM B108M BOAR;Lo;0;L;;;;;N;;;;; 1008C;LINEAR B IDEOGRAM B109F COW;Lo;0;L;;;;;N;;;;; 1008D;LINEAR B IDEOGRAM B109M BULL;Lo;0;L;;;;;N;;;;; 1008E;LINEAR B IDEOGRAM B120 WHEAT;Lo;0;L;;;;;N;;;;; 1008F;LINEAR B IDEOGRAM B121 BARLEY;Lo;0;L;;;;;N;;;;; 10090;LINEAR B IDEOGRAM B122 OLIVE;Lo;0;L;;;;;N;;;;; 10091;LINEAR B IDEOGRAM B123 SPICE;Lo;0;L;;;;;N;;;;; 10092;LINEAR B IDEOGRAM B125 CYPERUS;Lo;0;L;;;;;N;;;;; 10093;LINEAR B MONOGRAM B127 KAPO;Lo;0;L;;;;;N;;;;; 10094;LINEAR B MONOGRAM B128 KANAKO;Lo;0;L;;;;;N;;;;; 10095;LINEAR B IDEOGRAM B130 OIL;Lo;0;L;;;;;N;;;;; 10096;LINEAR B IDEOGRAM B131 WINE;Lo;0;L;;;;;N;;;;; 10097;LINEAR B IDEOGRAM B132;Lo;0;L;;;;;N;;;;; 10098;LINEAR B MONOGRAM B133 AREPA;Lo;0;L;;;;;N;;;;; 10099;LINEAR B MONOGRAM B135 MERI;Lo;0;L;;;;;N;;;;; 1009A;LINEAR B IDEOGRAM B140 BRONZE;Lo;0;L;;;;;N;;;;; 1009B;LINEAR B IDEOGRAM B141 GOLD;Lo;0;L;;;;;N;;;;; 1009C;LINEAR B IDEOGRAM B142;Lo;0;L;;;;;N;;;;; 1009D;LINEAR B IDEOGRAM B145 WOOL;Lo;0;L;;;;;N;;;;; 1009E;LINEAR B IDEOGRAM B146;Lo;0;L;;;;;N;;;;; 1009F;LINEAR B IDEOGRAM B150;Lo;0;L;;;;;N;;;;; 100A0;LINEAR B IDEOGRAM B151 HORN;Lo;0;L;;;;;N;;;;; 100A1;LINEAR B IDEOGRAM B152;Lo;0;L;;;;;N;;;;; 100A2;LINEAR B IDEOGRAM B153;Lo;0;L;;;;;N;;;;; 100A3;LINEAR B IDEOGRAM B154;Lo;0;L;;;;;N;;;;; 100A4;LINEAR B MONOGRAM B156 TURO2;Lo;0;L;;;;;N;;;;; 100A5;LINEAR B IDEOGRAM B157;Lo;0;L;;;;;N;;;;; 100A6;LINEAR B IDEOGRAM B158;Lo;0;L;;;;;N;;;;; 100A7;LINEAR B IDEOGRAM B159 CLOTH;Lo;0;L;;;;;N;;;;; 100A8;LINEAR B IDEOGRAM B160;Lo;0;L;;;;;N;;;;; 100A9;LINEAR B IDEOGRAM B161;Lo;0;L;;;;;N;;;;; 100AA;LINEAR B IDEOGRAM B162 GARMENT;Lo;0;L;;;;;N;;;;; 100AB;LINEAR B IDEOGRAM B163 ARMOUR;Lo;0;L;;;;;N;;;;; 100AC;LINEAR B IDEOGRAM B164;Lo;0;L;;;;;N;;;;; 100AD;LINEAR B IDEOGRAM B165;Lo;0;L;;;;;N;;;;; 100AE;LINEAR B IDEOGRAM B166;Lo;0;L;;;;;N;;;;; 100AF;LINEAR B IDEOGRAM B167;Lo;0;L;;;;;N;;;;; 100B0;LINEAR B IDEOGRAM B168;Lo;0;L;;;;;N;;;;; 100B1;LINEAR B IDEOGRAM B169;Lo;0;L;;;;;N;;;;; 100B2;LINEAR B IDEOGRAM B170;Lo;0;L;;;;;N;;;;; 100B3;LINEAR B IDEOGRAM B171;Lo;0;L;;;;;N;;;;; 100B4;LINEAR B IDEOGRAM B172;Lo;0;L;;;;;N;;;;; 100B5;LINEAR B IDEOGRAM B173 MONTH;Lo;0;L;;;;;N;;;;; 100B6;LINEAR B IDEOGRAM B174;Lo;0;L;;;;;N;;;;; 100B7;LINEAR B IDEOGRAM B176 TREE;Lo;0;L;;;;;N;;;;; 100B8;LINEAR B IDEOGRAM B177;Lo;0;L;;;;;N;;;;; 100B9;LINEAR B IDEOGRAM B178;Lo;0;L;;;;;N;;;;; 100BA;LINEAR B IDEOGRAM B179;Lo;0;L;;;;;N;;;;; 100BB;LINEAR B IDEOGRAM B180;Lo;0;L;;;;;N;;;;; 100BC;LINEAR B IDEOGRAM B181;Lo;0;L;;;;;N;;;;; 100BD;LINEAR B IDEOGRAM B182;Lo;0;L;;;;;N;;;;; 100BE;LINEAR B IDEOGRAM B183;Lo;0;L;;;;;N;;;;; 100BF;LINEAR B IDEOGRAM B184;Lo;0;L;;;;;N;;;;; 100C0;LINEAR B IDEOGRAM B185;Lo;0;L;;;;;N;;;;; 100C1;LINEAR B IDEOGRAM B189;Lo;0;L;;;;;N;;;;; 100C2;LINEAR B IDEOGRAM B190;Lo;0;L;;;;;N;;;;; 100C3;LINEAR B IDEOGRAM B191 HELMET;Lo;0;L;;;;;N;;;;; 100C4;LINEAR B IDEOGRAM B220 FOOTSTOOL;Lo;0;L;;;;;N;;;;; 100C5;LINEAR B IDEOGRAM B225 BATHTUB;Lo;0;L;;;;;N;;;;; 100C6;LINEAR B IDEOGRAM B230 SPEAR;Lo;0;L;;;;;N;;;;; 100C7;LINEAR B IDEOGRAM B231 ARROW;Lo;0;L;;;;;N;;;;; 100C8;LINEAR B IDEOGRAM B232;Lo;0;L;;;;;N;;;;; 100C9;LINEAR B IDEOGRAM B233 SWORD;Lo;0;L;;;;;N;;;;; 100CA;LINEAR B IDEOGRAM B234;Lo;0;L;;;;;N;;;;; 100CB;LINEAR B IDEOGRAM B236;Lo;0;L;;;;;N;;;;; 100CC;LINEAR B IDEOGRAM B240 WHEELED CHARIOT;Lo;0;L;;;;;N;;;;; 100CD;LINEAR B IDEOGRAM B241 CHARIOT;Lo;0;L;;;;;N;;;;; 100CE;LINEAR B IDEOGRAM B242 CHARIOT FRAME;Lo;0;L;;;;;N;;;;; 100CF;LINEAR B IDEOGRAM B243 WHEEL;Lo;0;L;;;;;N;;;;; 100D0;LINEAR B IDEOGRAM B245;Lo;0;L;;;;;N;;;;; 100D1;LINEAR B IDEOGRAM B246;Lo;0;L;;;;;N;;;;; 100D2;LINEAR B MONOGRAM B247 DIPTE;Lo;0;L;;;;;N;;;;; 100D3;LINEAR B IDEOGRAM B248;Lo;0;L;;;;;N;;;;; 100D4;LINEAR B IDEOGRAM B249;Lo;0;L;;;;;N;;;;; 100D5;LINEAR B IDEOGRAM B251;Lo;0;L;;;;;N;;;;; 100D6;LINEAR B IDEOGRAM B252;Lo;0;L;;;;;N;;;;; 100D7;LINEAR B IDEOGRAM B253;Lo;0;L;;;;;N;;;;; 100D8;LINEAR B IDEOGRAM B254 DART;Lo;0;L;;;;;N;;;;; 100D9;LINEAR B IDEOGRAM B255;Lo;0;L;;;;;N;;;;; 100DA;LINEAR B IDEOGRAM B256;Lo;0;L;;;;;N;;;;; 100DB;LINEAR B IDEOGRAM B257;Lo;0;L;;;;;N;;;;; 100DC;LINEAR B IDEOGRAM B258;Lo;0;L;;;;;N;;;;; 100DD;LINEAR B IDEOGRAM B259;Lo;0;L;;;;;N;;;;; 100DE;LINEAR B IDEOGRAM VESSEL B155;Lo;0;L;;;;;N;;;;; 100DF;LINEAR B IDEOGRAM VESSEL B200;Lo;0;L;;;;;N;;;;; 100E0;LINEAR B IDEOGRAM VESSEL B201;Lo;0;L;;;;;N;;;;; 100E1;LINEAR B IDEOGRAM VESSEL B202;Lo;0;L;;;;;N;;;;; 100E2;LINEAR B IDEOGRAM VESSEL B203;Lo;0;L;;;;;N;;;;; 100E3;LINEAR B IDEOGRAM VESSEL B204;Lo;0;L;;;;;N;;;;; 100E4;LINEAR B IDEOGRAM VESSEL B205;Lo;0;L;;;;;N;;;;; 100E5;LINEAR B IDEOGRAM VESSEL B206;Lo;0;L;;;;;N;;;;; 100E6;LINEAR B IDEOGRAM VESSEL B207;Lo;0;L;;;;;N;;;;; 100E7;LINEAR B IDEOGRAM VESSEL B208;Lo;0;L;;;;;N;;;;; 100E8;LINEAR B IDEOGRAM VESSEL B209;Lo;0;L;;;;;N;;;;; 100E9;LINEAR B IDEOGRAM VESSEL B210;Lo;0;L;;;;;N;;;;; 100EA;LINEAR B IDEOGRAM VESSEL B211;Lo;0;L;;;;;N;;;;; 100EB;LINEAR B IDEOGRAM VESSEL B212;Lo;0;L;;;;;N;;;;; 100EC;LINEAR B IDEOGRAM VESSEL B213;Lo;0;L;;;;;N;;;;; 100ED;LINEAR B IDEOGRAM VESSEL B214;Lo;0;L;;;;;N;;;;; 100EE;LINEAR B IDEOGRAM VESSEL B215;Lo;0;L;;;;;N;;;;; 100EF;LINEAR B IDEOGRAM VESSEL B216;Lo;0;L;;;;;N;;;;; 100F0;LINEAR B IDEOGRAM VESSEL B217;Lo;0;L;;;;;N;;;;; 100F1;LINEAR B IDEOGRAM VESSEL B218;Lo;0;L;;;;;N;;;;; 100F2;LINEAR B IDEOGRAM VESSEL B219;Lo;0;L;;;;;N;;;;; 100F3;LINEAR B IDEOGRAM VESSEL B221;Lo;0;L;;;;;N;;;;; 100F4;LINEAR B IDEOGRAM VESSEL B222;Lo;0;L;;;;;N;;;;; 100F5;LINEAR B IDEOGRAM VESSEL B226;Lo;0;L;;;;;N;;;;; 100F6;LINEAR B IDEOGRAM VESSEL B227;Lo;0;L;;;;;N;;;;; 100F7;LINEAR B IDEOGRAM VESSEL B228;Lo;0;L;;;;;N;;;;; 100F8;LINEAR B IDEOGRAM VESSEL B229;Lo;0;L;;;;;N;;;;; 100F9;LINEAR B IDEOGRAM VESSEL B250;Lo;0;L;;;;;N;;;;; 100FA;LINEAR B IDEOGRAM VESSEL B305;Lo;0;L;;;;;N;;;;; 10100;AEGEAN WORD SEPARATOR LINE;Po;0;L;;;;;N;;;;; 10101;AEGEAN WORD SEPARATOR DOT;Po;0;ON;;;;;N;;;;; 10102;AEGEAN CHECK MARK;Po;0;L;;;;;N;;;;; 10107;AEGEAN NUMBER ONE;No;0;L;;;;1;N;;;;; 10108;AEGEAN NUMBER TWO;No;0;L;;;;2;N;;;;; 10109;AEGEAN NUMBER THREE;No;0;L;;;;3;N;;;;; 1010A;AEGEAN NUMBER FOUR;No;0;L;;;;4;N;;;;; 1010B;AEGEAN NUMBER FIVE;No;0;L;;;;5;N;;;;; 1010C;AEGEAN NUMBER SIX;No;0;L;;;;6;N;;;;; 1010D;AEGEAN NUMBER SEVEN;No;0;L;;;;7;N;;;;; 1010E;AEGEAN NUMBER EIGHT;No;0;L;;;;8;N;;;;; 1010F;AEGEAN NUMBER NINE;No;0;L;;;;9;N;;;;; 10110;AEGEAN NUMBER TEN;No;0;L;;;;10;N;;;;; 10111;AEGEAN NUMBER TWENTY;No;0;L;;;;20;N;;;;; 10112;AEGEAN NUMBER THIRTY;No;0;L;;;;30;N;;;;; 10113;AEGEAN NUMBER FORTY;No;0;L;;;;40;N;;;;; 10114;AEGEAN NUMBER FIFTY;No;0;L;;;;50;N;;;;; 10115;AEGEAN NUMBER SIXTY;No;0;L;;;;60;N;;;;; 10116;AEGEAN NUMBER SEVENTY;No;0;L;;;;70;N;;;;; 10117;AEGEAN NUMBER EIGHTY;No;0;L;;;;80;N;;;;; 10118;AEGEAN NUMBER NINETY;No;0;L;;;;90;N;;;;; 10119;AEGEAN NUMBER ONE HUNDRED;No;0;L;;;;100;N;;;;; 1011A;AEGEAN NUMBER TWO HUNDRED;No;0;L;;;;200;N;;;;; 1011B;AEGEAN NUMBER THREE HUNDRED;No;0;L;;;;300;N;;;;; 1011C;AEGEAN NUMBER FOUR HUNDRED;No;0;L;;;;400;N;;;;; 1011D;AEGEAN NUMBER FIVE HUNDRED;No;0;L;;;;500;N;;;;; 1011E;AEGEAN NUMBER SIX HUNDRED;No;0;L;;;;600;N;;;;; 1011F;AEGEAN NUMBER SEVEN HUNDRED;No;0;L;;;;700;N;;;;; 10120;AEGEAN NUMBER EIGHT HUNDRED;No;0;L;;;;800;N;;;;; 10121;AEGEAN NUMBER NINE HUNDRED;No;0;L;;;;900;N;;;;; 10122;AEGEAN NUMBER ONE THOUSAND;No;0;L;;;;1000;N;;;;; 10123;AEGEAN NUMBER TWO THOUSAND;No;0;L;;;;2000;N;;;;; 10124;AEGEAN NUMBER THREE THOUSAND;No;0;L;;;;3000;N;;;;; 10125;AEGEAN NUMBER FOUR THOUSAND;No;0;L;;;;4000;N;;;;; 10126;AEGEAN NUMBER FIVE THOUSAND;No;0;L;;;;5000;N;;;;; 10127;AEGEAN NUMBER SIX THOUSAND;No;0;L;;;;6000;N;;;;; 10128;AEGEAN NUMBER SEVEN THOUSAND;No;0;L;;;;7000;N;;;;; 10129;AEGEAN NUMBER EIGHT THOUSAND;No;0;L;;;;8000;N;;;;; 1012A;AEGEAN NUMBER NINE THOUSAND;No;0;L;;;;9000;N;;;;; 1012B;AEGEAN NUMBER TEN THOUSAND;No;0;L;;;;10000;N;;;;; 1012C;AEGEAN NUMBER TWENTY THOUSAND;No;0;L;;;;20000;N;;;;; 1012D;AEGEAN NUMBER THIRTY THOUSAND;No;0;L;;;;30000;N;;;;; 1012E;AEGEAN NUMBER FORTY THOUSAND;No;0;L;;;;40000;N;;;;; 1012F;AEGEAN NUMBER FIFTY THOUSAND;No;0;L;;;;50000;N;;;;; 10130;AEGEAN NUMBER SIXTY THOUSAND;No;0;L;;;;60000;N;;;;; 10131;AEGEAN NUMBER SEVENTY THOUSAND;No;0;L;;;;70000;N;;;;; 10132;AEGEAN NUMBER EIGHTY THOUSAND;No;0;L;;;;80000;N;;;;; 10133;AEGEAN NUMBER NINETY THOUSAND;No;0;L;;;;90000;N;;;;; 10137;AEGEAN WEIGHT BASE UNIT;So;0;L;;;;;N;;;;; 10138;AEGEAN WEIGHT FIRST SUBUNIT;So;0;L;;;;;N;;;;; 10139;AEGEAN WEIGHT SECOND SUBUNIT;So;0;L;;;;;N;;;;; 1013A;AEGEAN WEIGHT THIRD SUBUNIT;So;0;L;;;;;N;;;;; 1013B;AEGEAN WEIGHT FOURTH SUBUNIT;So;0;L;;;;;N;;;;; 1013C;AEGEAN DRY MEASURE FIRST SUBUNIT;So;0;L;;;;;N;;;;; 1013D;AEGEAN LIQUID MEASURE FIRST SUBUNIT;So;0;L;;;;;N;;;;; 1013E;AEGEAN MEASURE SECOND SUBUNIT;So;0;L;;;;;N;;;;; 1013F;AEGEAN MEASURE THIRD SUBUNIT;So;0;L;;;;;N;;;;; 10140;GREEK ACROPHONIC ATTIC ONE QUARTER;Nl;0;ON;;;;1/4;N;;;;; 10141;GREEK ACROPHONIC ATTIC ONE HALF;Nl;0;ON;;;;1/2;N;;;;; 10142;GREEK ACROPHONIC ATTIC ONE DRACHMA;Nl;0;ON;;;;1;N;;;;; 10143;GREEK ACROPHONIC ATTIC FIVE;Nl;0;ON;;;;5;N;;;;; 10144;GREEK ACROPHONIC ATTIC FIFTY;Nl;0;ON;;;;50;N;;;;; 10145;GREEK ACROPHONIC ATTIC FIVE HUNDRED;Nl;0;ON;;;;500;N;;;;; 10146;GREEK ACROPHONIC ATTIC FIVE THOUSAND;Nl;0;ON;;;;5000;N;;;;; 10147;GREEK ACROPHONIC ATTIC FIFTY THOUSAND;Nl;0;ON;;;;50000;N;;;;; 10148;GREEK ACROPHONIC ATTIC FIVE TALENTS;Nl;0;ON;;;;5;N;;;;; 10149;GREEK ACROPHONIC ATTIC TEN TALENTS;Nl;0;ON;;;;10;N;;;;; 1014A;GREEK ACROPHONIC ATTIC FIFTY TALENTS;Nl;0;ON;;;;50;N;;;;; 1014B;GREEK ACROPHONIC ATTIC ONE HUNDRED TALENTS;Nl;0;ON;;;;100;N;;;;; 1014C;GREEK ACROPHONIC ATTIC FIVE HUNDRED TALENTS;Nl;0;ON;;;;500;N;;;;; 1014D;GREEK ACROPHONIC ATTIC ONE THOUSAND TALENTS;Nl;0;ON;;;;1000;N;;;;; 1014E;GREEK ACROPHONIC ATTIC FIVE THOUSAND TALENTS;Nl;0;ON;;;;5000;N;;;;; 1014F;GREEK ACROPHONIC ATTIC FIVE STATERS;Nl;0;ON;;;;5;N;;;;; 10150;GREEK ACROPHONIC ATTIC TEN STATERS;Nl;0;ON;;;;10;N;;;;; 10151;GREEK ACROPHONIC ATTIC FIFTY STATERS;Nl;0;ON;;;;50;N;;;;; 10152;GREEK ACROPHONIC ATTIC ONE HUNDRED STATERS;Nl;0;ON;;;;100;N;;;;; 10153;GREEK ACROPHONIC ATTIC FIVE HUNDRED STATERS;Nl;0;ON;;;;500;N;;;;; 10154;GREEK ACROPHONIC ATTIC ONE THOUSAND STATERS;Nl;0;ON;;;;1000;N;;;;; 10155;GREEK ACROPHONIC ATTIC TEN THOUSAND STATERS;Nl;0;ON;;;;10000;N;;;;; 10156;GREEK ACROPHONIC ATTIC FIFTY THOUSAND STATERS;Nl;0;ON;;;;50000;N;;;;; 10157;GREEK ACROPHONIC ATTIC TEN MNAS;Nl;0;ON;;;;10;N;;;;; 10158;GREEK ACROPHONIC HERAEUM ONE PLETHRON;Nl;0;ON;;;;1;N;;;;; 10159;GREEK ACROPHONIC THESPIAN ONE;Nl;0;ON;;;;1;N;;;;; 1015A;GREEK ACROPHONIC HERMIONIAN ONE;Nl;0;ON;;;;1;N;;;;; 1015B;GREEK ACROPHONIC EPIDAUREAN TWO;Nl;0;ON;;;;2;N;;;;; 1015C;GREEK ACROPHONIC THESPIAN TWO;Nl;0;ON;;;;2;N;;;;; 1015D;GREEK ACROPHONIC CYRENAIC TWO DRACHMAS;Nl;0;ON;;;;2;N;;;;; 1015E;GREEK ACROPHONIC EPIDAUREAN TWO DRACHMAS;Nl;0;ON;;;;2;N;;;;; 1015F;GREEK ACROPHONIC TROEZENIAN FIVE;Nl;0;ON;;;;5;N;;;;; 10160;GREEK ACROPHONIC TROEZENIAN TEN;Nl;0;ON;;;;10;N;;;;; 10161;GREEK ACROPHONIC TROEZENIAN TEN ALTERNATE FORM;Nl;0;ON;;;;10;N;;;;; 10162;GREEK ACROPHONIC HERMIONIAN TEN;Nl;0;ON;;;;10;N;;;;; 10163;GREEK ACROPHONIC MESSENIAN TEN;Nl;0;ON;;;;10;N;;;;; 10164;GREEK ACROPHONIC THESPIAN TEN;Nl;0;ON;;;;10;N;;;;; 10165;GREEK ACROPHONIC THESPIAN THIRTY;Nl;0;ON;;;;30;N;;;;; 10166;GREEK ACROPHONIC TROEZENIAN FIFTY;Nl;0;ON;;;;50;N;;;;; 10167;GREEK ACROPHONIC TROEZENIAN FIFTY ALTERNATE FORM;Nl;0;ON;;;;50;N;;;;; 10168;GREEK ACROPHONIC HERMIONIAN FIFTY;Nl;0;ON;;;;50;N;;;;; 10169;GREEK ACROPHONIC THESPIAN FIFTY;Nl;0;ON;;;;50;N;;;;; 1016A;GREEK ACROPHONIC THESPIAN ONE HUNDRED;Nl;0;ON;;;;100;N;;;;; 1016B;GREEK ACROPHONIC THESPIAN THREE HUNDRED;Nl;0;ON;;;;300;N;;;;; 1016C;GREEK ACROPHONIC EPIDAUREAN FIVE HUNDRED;Nl;0;ON;;;;500;N;;;;; 1016D;GREEK ACROPHONIC TROEZENIAN FIVE HUNDRED;Nl;0;ON;;;;500;N;;;;; 1016E;GREEK ACROPHONIC THESPIAN FIVE HUNDRED;Nl;0;ON;;;;500;N;;;;; 1016F;GREEK ACROPHONIC CARYSTIAN FIVE HUNDRED;Nl;0;ON;;;;500;N;;;;; 10170;GREEK ACROPHONIC NAXIAN FIVE HUNDRED;Nl;0;ON;;;;500;N;;;;; 10171;GREEK ACROPHONIC THESPIAN ONE THOUSAND;Nl;0;ON;;;;1000;N;;;;; 10172;GREEK ACROPHONIC THESPIAN FIVE THOUSAND;Nl;0;ON;;;;5000;N;;;;; 10173;GREEK ACROPHONIC DELPHIC FIVE MNAS;Nl;0;ON;;;;5;N;;;;; 10174;GREEK ACROPHONIC STRATIAN FIFTY MNAS;Nl;0;ON;;;;50;N;;;;; 10175;GREEK ONE HALF SIGN;No;0;ON;;;;1/2;N;;;;; 10176;GREEK ONE HALF SIGN ALTERNATE FORM;No;0;ON;;;;1/2;N;;;;; 10177;GREEK TWO THIRDS SIGN;No;0;ON;;;;2/3;N;;;;; 10178;GREEK THREE QUARTERS SIGN;No;0;ON;;;;3/4;N;;;;; 10179;GREEK YEAR SIGN;So;0;ON;;;;;N;;;;; 1017A;GREEK TALENT SIGN;So;0;ON;;;;;N;;;;; 1017B;GREEK DRACHMA SIGN;So;0;ON;;;;;N;;;;; 1017C;GREEK OBOL SIGN;So;0;ON;;;;;N;;;;; 1017D;GREEK TWO OBOLS SIGN;So;0;ON;;;;;N;;;;; 1017E;GREEK THREE OBOLS SIGN;So;0;ON;;;;;N;;;;; 1017F;GREEK FOUR OBOLS SIGN;So;0;ON;;;;;N;;;;; 10180;GREEK FIVE OBOLS SIGN;So;0;ON;;;;;N;;;;; 10181;GREEK METRETES SIGN;So;0;ON;;;;;N;;;;; 10182;GREEK KYATHOS BASE SIGN;So;0;ON;;;;;N;;;;; 10183;GREEK LITRA SIGN;So;0;ON;;;;;N;;;;; 10184;GREEK OUNKIA SIGN;So;0;ON;;;;;N;;;;; 10185;GREEK XESTES SIGN;So;0;ON;;;;;N;;;;; 10186;GREEK ARTABE SIGN;So;0;ON;;;;;N;;;;; 10187;GREEK AROURA SIGN;So;0;ON;;;;;N;;;;; 10188;GREEK GRAMMA SIGN;So;0;ON;;;;;N;;;;; 10189;GREEK TRYBLION BASE SIGN;So;0;ON;;;;;N;;;;; 1018A;GREEK ZERO SIGN;No;0;ON;;;;0;N;;;;; 10190;ROMAN SEXTANS SIGN;So;0;ON;;;;;N;;;;; 10191;ROMAN UNCIA SIGN;So;0;ON;;;;;N;;;;; 10192;ROMAN SEMUNCIA SIGN;So;0;ON;;;;;N;;;;; 10193;ROMAN SEXTULA SIGN;So;0;ON;;;;;N;;;;; 10194;ROMAN DIMIDIA SEXTULA SIGN;So;0;ON;;;;;N;;;;; 10195;ROMAN SILIQUA SIGN;So;0;ON;;;;;N;;;;; 10196;ROMAN DENARIUS SIGN;So;0;ON;;;;;N;;;;; 10197;ROMAN QUINARIUS SIGN;So;0;ON;;;;;N;;;;; 10198;ROMAN SESTERTIUS SIGN;So;0;ON;;;;;N;;;;; 10199;ROMAN DUPONDIUS SIGN;So;0;ON;;;;;N;;;;; 1019A;ROMAN AS SIGN;So;0;ON;;;;;N;;;;; 1019B;ROMAN CENTURIAL SIGN;So;0;ON;;;;;N;;;;; 101D0;PHAISTOS DISC SIGN PEDESTRIAN;So;0;L;;;;;N;;;;; 101D1;PHAISTOS DISC SIGN PLUMED HEAD;So;0;L;;;;;N;;;;; 101D2;PHAISTOS DISC SIGN TATTOOED HEAD;So;0;L;;;;;N;;;;; 101D3;PHAISTOS DISC SIGN CAPTIVE;So;0;L;;;;;N;;;;; 101D4;PHAISTOS DISC SIGN CHILD;So;0;L;;;;;N;;;;; 101D5;PHAISTOS DISC SIGN WOMAN;So;0;L;;;;;N;;;;; 101D6;PHAISTOS DISC SIGN HELMET;So;0;L;;;;;N;;;;; 101D7;PHAISTOS DISC SIGN GAUNTLET;So;0;L;;;;;N;;;;; 101D8;PHAISTOS DISC SIGN TIARA;So;0;L;;;;;N;;;;; 101D9;PHAISTOS DISC SIGN ARROW;So;0;L;;;;;N;;;;; 101DA;PHAISTOS DISC SIGN BOW;So;0;L;;;;;N;;;;; 101DB;PHAISTOS DISC SIGN SHIELD;So;0;L;;;;;N;;;;; 101DC;PHAISTOS DISC SIGN CLUB;So;0;L;;;;;N;;;;; 101DD;PHAISTOS DISC SIGN MANACLES;So;0;L;;;;;N;;;;; 101DE;PHAISTOS DISC SIGN MATTOCK;So;0;L;;;;;N;;;;; 101DF;PHAISTOS DISC SIGN SAW;So;0;L;;;;;N;;;;; 101E0;PHAISTOS DISC SIGN LID;So;0;L;;;;;N;;;;; 101E1;PHAISTOS DISC SIGN BOOMERANG;So;0;L;;;;;N;;;;; 101E2;PHAISTOS DISC SIGN CARPENTRY PLANE;So;0;L;;;;;N;;;;; 101E3;PHAISTOS DISC SIGN DOLIUM;So;0;L;;;;;N;;;;; 101E4;PHAISTOS DISC SIGN COMB;So;0;L;;;;;N;;;;; 101E5;PHAISTOS DISC SIGN SLING;So;0;L;;;;;N;;;;; 101E6;PHAISTOS DISC SIGN COLUMN;So;0;L;;;;;N;;;;; 101E7;PHAISTOS DISC SIGN BEEHIVE;So;0;L;;;;;N;;;;; 101E8;PHAISTOS DISC SIGN SHIP;So;0;L;;;;;N;;;;; 101E9;PHAISTOS DISC SIGN HORN;So;0;L;;;;;N;;;;; 101EA;PHAISTOS DISC SIGN HIDE;So;0;L;;;;;N;;;;; 101EB;PHAISTOS DISC SIGN BULLS LEG;So;0;L;;;;;N;;;;; 101EC;PHAISTOS DISC SIGN CAT;So;0;L;;;;;N;;;;; 101ED;PHAISTOS DISC SIGN RAM;So;0;L;;;;;N;;;;; 101EE;PHAISTOS DISC SIGN EAGLE;So;0;L;;;;;N;;;;; 101EF;PHAISTOS DISC SIGN DOVE;So;0;L;;;;;N;;;;; 101F0;PHAISTOS DISC SIGN TUNNY;So;0;L;;;;;N;;;;; 101F1;PHAISTOS DISC SIGN BEE;So;0;L;;;;;N;;;;; 101F2;PHAISTOS DISC SIGN PLANE TREE;So;0;L;;;;;N;;;;; 101F3;PHAISTOS DISC SIGN VINE;So;0;L;;;;;N;;;;; 101F4;PHAISTOS DISC SIGN PAPYRUS;So;0;L;;;;;N;;;;; 101F5;PHAISTOS DISC SIGN ROSETTE;So;0;L;;;;;N;;;;; 101F6;PHAISTOS DISC SIGN LILY;So;0;L;;;;;N;;;;; 101F7;PHAISTOS DISC SIGN OX BACK;So;0;L;;;;;N;;;;; 101F8;PHAISTOS DISC SIGN FLUTE;So;0;L;;;;;N;;;;; 101F9;PHAISTOS DISC SIGN GRATER;So;0;L;;;;;N;;;;; 101FA;PHAISTOS DISC SIGN STRAINER;So;0;L;;;;;N;;;;; 101FB;PHAISTOS DISC SIGN SMALL AXE;So;0;L;;;;;N;;;;; 101FC;PHAISTOS DISC SIGN WAVY BAND;So;0;L;;;;;N;;;;; 101FD;PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE;Mn;220;NSM;;;;;N;;;;; 10280;LYCIAN LETTER A;Lo;0;L;;;;;N;;;;; 10281;LYCIAN LETTER E;Lo;0;L;;;;;N;;;;; 10282;LYCIAN LETTER B;Lo;0;L;;;;;N;;;;; 10283;LYCIAN LETTER BH;Lo;0;L;;;;;N;;;;; 10284;LYCIAN LETTER G;Lo;0;L;;;;;N;;;;; 10285;LYCIAN LETTER D;Lo;0;L;;;;;N;;;;; 10286;LYCIAN LETTER I;Lo;0;L;;;;;N;;;;; 10287;LYCIAN LETTER W;Lo;0;L;;;;;N;;;;; 10288;LYCIAN LETTER Z;Lo;0;L;;;;;N;;;;; 10289;LYCIAN LETTER TH;Lo;0;L;;;;;N;;;;; 1028A;LYCIAN LETTER J;Lo;0;L;;;;;N;;;;; 1028B;LYCIAN LETTER K;Lo;0;L;;;;;N;;;;; 1028C;LYCIAN LETTER Q;Lo;0;L;;;;;N;;;;; 1028D;LYCIAN LETTER L;Lo;0;L;;;;;N;;;;; 1028E;LYCIAN LETTER M;Lo;0;L;;;;;N;;;;; 1028F;LYCIAN LETTER N;Lo;0;L;;;;;N;;;;; 10290;LYCIAN LETTER MM;Lo;0;L;;;;;N;;;;; 10291;LYCIAN LETTER NN;Lo;0;L;;;;;N;;;;; 10292;LYCIAN LETTER U;Lo;0;L;;;;;N;;;;; 10293;LYCIAN LETTER P;Lo;0;L;;;;;N;;;;; 10294;LYCIAN LETTER KK;Lo;0;L;;;;;N;;;;; 10295;LYCIAN LETTER R;Lo;0;L;;;;;N;;;;; 10296;LYCIAN LETTER S;Lo;0;L;;;;;N;;;;; 10297;LYCIAN LETTER T;Lo;0;L;;;;;N;;;;; 10298;LYCIAN LETTER TT;Lo;0;L;;;;;N;;;;; 10299;LYCIAN LETTER AN;Lo;0;L;;;;;N;;;;; 1029A;LYCIAN LETTER EN;Lo;0;L;;;;;N;;;;; 1029B;LYCIAN LETTER H;Lo;0;L;;;;;N;;;;; 1029C;LYCIAN LETTER X;Lo;0;L;;;;;N;;;;; 102A0;CARIAN LETTER A;Lo;0;L;;;;;N;;;;; 102A1;CARIAN LETTER P2;Lo;0;L;;;;;N;;;;; 102A2;CARIAN LETTER D;Lo;0;L;;;;;N;;;;; 102A3;CARIAN LETTER L;Lo;0;L;;;;;N;;;;; 102A4;CARIAN LETTER UUU;Lo;0;L;;;;;N;;;;; 102A5;CARIAN LETTER R;Lo;0;L;;;;;N;;;;; 102A6;CARIAN LETTER LD;Lo;0;L;;;;;N;;;;; 102A7;CARIAN LETTER A2;Lo;0;L;;;;;N;;;;; 102A8;CARIAN LETTER Q;Lo;0;L;;;;;N;;;;; 102A9;CARIAN LETTER B;Lo;0;L;;;;;N;;;;; 102AA;CARIAN LETTER M;Lo;0;L;;;;;N;;;;; 102AB;CARIAN LETTER O;Lo;0;L;;;;;N;;;;; 102AC;CARIAN LETTER D2;Lo;0;L;;;;;N;;;;; 102AD;CARIAN LETTER T;Lo;0;L;;;;;N;;;;; 102AE;CARIAN LETTER SH;Lo;0;L;;;;;N;;;;; 102AF;CARIAN LETTER SH2;Lo;0;L;;;;;N;;;;; 102B0;CARIAN LETTER S;Lo;0;L;;;;;N;;;;; 102B1;CARIAN LETTER C-18;Lo;0;L;;;;;N;;;;; 102B2;CARIAN LETTER U;Lo;0;L;;;;;N;;;;; 102B3;CARIAN LETTER NN;Lo;0;L;;;;;N;;;;; 102B4;CARIAN LETTER X;Lo;0;L;;;;;N;;;;; 102B5;CARIAN LETTER N;Lo;0;L;;;;;N;;;;; 102B6;CARIAN LETTER TT2;Lo;0;L;;;;;N;;;;; 102B7;CARIAN LETTER P;Lo;0;L;;;;;N;;;;; 102B8;CARIAN LETTER SS;Lo;0;L;;;;;N;;;;; 102B9;CARIAN LETTER I;Lo;0;L;;;;;N;;;;; 102BA;CARIAN LETTER E;Lo;0;L;;;;;N;;;;; 102BB;CARIAN LETTER UUUU;Lo;0;L;;;;;N;;;;; 102BC;CARIAN LETTER K;Lo;0;L;;;;;N;;;;; 102BD;CARIAN LETTER K2;Lo;0;L;;;;;N;;;;; 102BE;CARIAN LETTER ND;Lo;0;L;;;;;N;;;;; 102BF;CARIAN LETTER UU;Lo;0;L;;;;;N;;;;; 102C0;CARIAN LETTER G;Lo;0;L;;;;;N;;;;; 102C1;CARIAN LETTER G2;Lo;0;L;;;;;N;;;;; 102C2;CARIAN LETTER ST;Lo;0;L;;;;;N;;;;; 102C3;CARIAN LETTER ST2;Lo;0;L;;;;;N;;;;; 102C4;CARIAN LETTER NG;Lo;0;L;;;;;N;;;;; 102C5;CARIAN LETTER II;Lo;0;L;;;;;N;;;;; 102C6;CARIAN LETTER C-39;Lo;0;L;;;;;N;;;;; 102C7;CARIAN LETTER TT;Lo;0;L;;;;;N;;;;; 102C8;CARIAN LETTER UUU2;Lo;0;L;;;;;N;;;;; 102C9;CARIAN LETTER RR;Lo;0;L;;;;;N;;;;; 102CA;CARIAN LETTER MB;Lo;0;L;;;;;N;;;;; 102CB;CARIAN LETTER MB2;Lo;0;L;;;;;N;;;;; 102CC;CARIAN LETTER MB3;Lo;0;L;;;;;N;;;;; 102CD;CARIAN LETTER MB4;Lo;0;L;;;;;N;;;;; 102CE;CARIAN LETTER LD2;Lo;0;L;;;;;N;;;;; 102CF;CARIAN LETTER E2;Lo;0;L;;;;;N;;;;; 102D0;CARIAN LETTER UUU3;Lo;0;L;;;;;N;;;;; 10300;OLD ITALIC LETTER A;Lo;0;L;;;;;N;;;;; 10301;OLD ITALIC LETTER BE;Lo;0;L;;;;;N;;;;; 10302;OLD ITALIC LETTER KE;Lo;0;L;;;;;N;;;;; 10303;OLD ITALIC LETTER DE;Lo;0;L;;;;;N;;;;; 10304;OLD ITALIC LETTER E;Lo;0;L;;;;;N;;;;; 10305;OLD ITALIC LETTER VE;Lo;0;L;;;;;N;;;;; 10306;OLD ITALIC LETTER ZE;Lo;0;L;;;;;N;;;;; 10307;OLD ITALIC LETTER HE;Lo;0;L;;;;;N;;;;; 10308;OLD ITALIC LETTER THE;Lo;0;L;;;;;N;;;;; 10309;OLD ITALIC LETTER I;Lo;0;L;;;;;N;;;;; 1030A;OLD ITALIC LETTER KA;Lo;0;L;;;;;N;;;;; 1030B;OLD ITALIC LETTER EL;Lo;0;L;;;;;N;;;;; 1030C;OLD ITALIC LETTER EM;Lo;0;L;;;;;N;;;;; 1030D;OLD ITALIC LETTER EN;Lo;0;L;;;;;N;;;;; 1030E;OLD ITALIC LETTER ESH;Lo;0;L;;;;;N;;;;; 1030F;OLD ITALIC LETTER O;Lo;0;L;;;;;N;;;;; 10310;OLD ITALIC LETTER PE;Lo;0;L;;;;;N;;;;; 10311;OLD ITALIC LETTER SHE;Lo;0;L;;;;;N;;;;; 10312;OLD ITALIC LETTER KU;Lo;0;L;;;;;N;;;;; 10313;OLD ITALIC LETTER ER;Lo;0;L;;;;;N;;;;; 10314;OLD ITALIC LETTER ES;Lo;0;L;;;;;N;;;;; 10315;OLD ITALIC LETTER TE;Lo;0;L;;;;;N;;;;; 10316;OLD ITALIC LETTER U;Lo;0;L;;;;;N;;;;; 10317;OLD ITALIC LETTER EKS;Lo;0;L;;;;;N;;;;; 10318;OLD ITALIC LETTER PHE;Lo;0;L;;;;;N;;;;; 10319;OLD ITALIC LETTER KHE;Lo;0;L;;;;;N;;;;; 1031A;OLD ITALIC LETTER EF;Lo;0;L;;;;;N;;;;; 1031B;OLD ITALIC LETTER ERS;Lo;0;L;;;;;N;;;;; 1031C;OLD ITALIC LETTER CHE;Lo;0;L;;;;;N;;;;; 1031D;OLD ITALIC LETTER II;Lo;0;L;;;;;N;;;;; 1031E;OLD ITALIC LETTER UU;Lo;0;L;;;;;N;;;;; 10320;OLD ITALIC NUMERAL ONE;No;0;L;;;;1;N;;;;; 10321;OLD ITALIC NUMERAL FIVE;No;0;L;;;;5;N;;;;; 10322;OLD ITALIC NUMERAL TEN;No;0;L;;;;10;N;;;;; 10323;OLD ITALIC NUMERAL FIFTY;No;0;L;;;;50;N;;;;; 10330;GOTHIC LETTER AHSA;Lo;0;L;;;;;N;;;;; 10331;GOTHIC LETTER BAIRKAN;Lo;0;L;;;;;N;;;;; 10332;GOTHIC LETTER GIBA;Lo;0;L;;;;;N;;;;; 10333;GOTHIC LETTER DAGS;Lo;0;L;;;;;N;;;;; 10334;GOTHIC LETTER AIHVUS;Lo;0;L;;;;;N;;;;; 10335;GOTHIC LETTER QAIRTHRA;Lo;0;L;;;;;N;;;;; 10336;GOTHIC LETTER IUJA;Lo;0;L;;;;;N;;;;; 10337;GOTHIC LETTER HAGL;Lo;0;L;;;;;N;;;;; 10338;GOTHIC LETTER THIUTH;Lo;0;L;;;;;N;;;;; 10339;GOTHIC LETTER EIS;Lo;0;L;;;;;N;;;;; 1033A;GOTHIC LETTER KUSMA;Lo;0;L;;;;;N;;;;; 1033B;GOTHIC LETTER LAGUS;Lo;0;L;;;;;N;;;;; 1033C;GOTHIC LETTER MANNA;Lo;0;L;;;;;N;;;;; 1033D;GOTHIC LETTER NAUTHS;Lo;0;L;;;;;N;;;;; 1033E;GOTHIC LETTER JER;Lo;0;L;;;;;N;;;;; 1033F;GOTHIC LETTER URUS;Lo;0;L;;;;;N;;;;; 10340;GOTHIC LETTER PAIRTHRA;Lo;0;L;;;;;N;;;;; 10341;GOTHIC LETTER NINETY;Nl;0;L;;;;90;N;;;;; 10342;GOTHIC LETTER RAIDA;Lo;0;L;;;;;N;;;;; 10343;GOTHIC LETTER SAUIL;Lo;0;L;;;;;N;;;;; 10344;GOTHIC LETTER TEIWS;Lo;0;L;;;;;N;;;;; 10345;GOTHIC LETTER WINJA;Lo;0;L;;;;;N;;;;; 10346;GOTHIC LETTER FAIHU;Lo;0;L;;;;;N;;;;; 10347;GOTHIC LETTER IGGWS;Lo;0;L;;;;;N;;;;; 10348;GOTHIC LETTER HWAIR;Lo;0;L;;;;;N;;;;; 10349;GOTHIC LETTER OTHAL;Lo;0;L;;;;;N;;;;; 1034A;GOTHIC LETTER NINE HUNDRED;Nl;0;L;;;;900;N;;;;; 10380;UGARITIC LETTER ALPA;Lo;0;L;;;;;N;;;;; 10381;UGARITIC LETTER BETA;Lo;0;L;;;;;N;;;;; 10382;UGARITIC LETTER GAMLA;Lo;0;L;;;;;N;;;;; 10383;UGARITIC LETTER KHA;Lo;0;L;;;;;N;;;;; 10384;UGARITIC LETTER DELTA;Lo;0;L;;;;;N;;;;; 10385;UGARITIC LETTER HO;Lo;0;L;;;;;N;;;;; 10386;UGARITIC LETTER WO;Lo;0;L;;;;;N;;;;; 10387;UGARITIC LETTER ZETA;Lo;0;L;;;;;N;;;;; 10388;UGARITIC LETTER HOTA;Lo;0;L;;;;;N;;;;; 10389;UGARITIC LETTER TET;Lo;0;L;;;;;N;;;;; 1038A;UGARITIC LETTER YOD;Lo;0;L;;;;;N;;;;; 1038B;UGARITIC LETTER KAF;Lo;0;L;;;;;N;;;;; 1038C;UGARITIC LETTER SHIN;Lo;0;L;;;;;N;;;;; 1038D;UGARITIC LETTER LAMDA;Lo;0;L;;;;;N;;;;; 1038E;UGARITIC LETTER MEM;Lo;0;L;;;;;N;;;;; 1038F;UGARITIC LETTER DHAL;Lo;0;L;;;;;N;;;;; 10390;UGARITIC LETTER NUN;Lo;0;L;;;;;N;;;;; 10391;UGARITIC LETTER ZU;Lo;0;L;;;;;N;;;;; 10392;UGARITIC LETTER SAMKA;Lo;0;L;;;;;N;;;;; 10393;UGARITIC LETTER AIN;Lo;0;L;;;;;N;;;;; 10394;UGARITIC LETTER PU;Lo;0;L;;;;;N;;;;; 10395;UGARITIC LETTER SADE;Lo;0;L;;;;;N;;;;; 10396;UGARITIC LETTER QOPA;Lo;0;L;;;;;N;;;;; 10397;UGARITIC LETTER RASHA;Lo;0;L;;;;;N;;;;; 10398;UGARITIC LETTER THANNA;Lo;0;L;;;;;N;;;;; 10399;UGARITIC LETTER GHAIN;Lo;0;L;;;;;N;;;;; 1039A;UGARITIC LETTER TO;Lo;0;L;;;;;N;;;;; 1039B;UGARITIC LETTER I;Lo;0;L;;;;;N;;;;; 1039C;UGARITIC LETTER U;Lo;0;L;;;;;N;;;;; 1039D;UGARITIC LETTER SSU;Lo;0;L;;;;;N;;;;; 1039F;UGARITIC WORD DIVIDER;Po;0;L;;;;;N;;;;; 103A0;OLD PERSIAN SIGN A;Lo;0;L;;;;;N;;;;; 103A1;OLD PERSIAN SIGN I;Lo;0;L;;;;;N;;;;; 103A2;OLD PERSIAN SIGN U;Lo;0;L;;;;;N;;;;; 103A3;OLD PERSIAN SIGN KA;Lo;0;L;;;;;N;;;;; 103A4;OLD PERSIAN SIGN KU;Lo;0;L;;;;;N;;;;; 103A5;OLD PERSIAN SIGN GA;Lo;0;L;;;;;N;;;;; 103A6;OLD PERSIAN SIGN GU;Lo;0;L;;;;;N;;;;; 103A7;OLD PERSIAN SIGN XA;Lo;0;L;;;;;N;;;;; 103A8;OLD PERSIAN SIGN CA;Lo;0;L;;;;;N;;;;; 103A9;OLD PERSIAN SIGN JA;Lo;0;L;;;;;N;;;;; 103AA;OLD PERSIAN SIGN JI;Lo;0;L;;;;;N;;;;; 103AB;OLD PERSIAN SIGN TA;Lo;0;L;;;;;N;;;;; 103AC;OLD PERSIAN SIGN TU;Lo;0;L;;;;;N;;;;; 103AD;OLD PERSIAN SIGN DA;Lo;0;L;;;;;N;;;;; 103AE;OLD PERSIAN SIGN DI;Lo;0;L;;;;;N;;;;; 103AF;OLD PERSIAN SIGN DU;Lo;0;L;;;;;N;;;;; 103B0;OLD PERSIAN SIGN THA;Lo;0;L;;;;;N;;;;; 103B1;OLD PERSIAN SIGN PA;Lo;0;L;;;;;N;;;;; 103B2;OLD PERSIAN SIGN BA;Lo;0;L;;;;;N;;;;; 103B3;OLD PERSIAN SIGN FA;Lo;0;L;;;;;N;;;;; 103B4;OLD PERSIAN SIGN NA;Lo;0;L;;;;;N;;;;; 103B5;OLD PERSIAN SIGN NU;Lo;0;L;;;;;N;;;;; 103B6;OLD PERSIAN SIGN MA;Lo;0;L;;;;;N;;;;; 103B7;OLD PERSIAN SIGN MI;Lo;0;L;;;;;N;;;;; 103B8;OLD PERSIAN SIGN MU;Lo;0;L;;;;;N;;;;; 103B9;OLD PERSIAN SIGN YA;Lo;0;L;;;;;N;;;;; 103BA;OLD PERSIAN SIGN VA;Lo;0;L;;;;;N;;;;; 103BB;OLD PERSIAN SIGN VI;Lo;0;L;;;;;N;;;;; 103BC;OLD PERSIAN SIGN RA;Lo;0;L;;;;;N;;;;; 103BD;OLD PERSIAN SIGN RU;Lo;0;L;;;;;N;;;;; 103BE;OLD PERSIAN SIGN LA;Lo;0;L;;;;;N;;;;; 103BF;OLD PERSIAN SIGN SA;Lo;0;L;;;;;N;;;;; 103C0;OLD PERSIAN SIGN ZA;Lo;0;L;;;;;N;;;;; 103C1;OLD PERSIAN SIGN SHA;Lo;0;L;;;;;N;;;;; 103C2;OLD PERSIAN SIGN SSA;Lo;0;L;;;;;N;;;;; 103C3;OLD PERSIAN SIGN HA;Lo;0;L;;;;;N;;;;; 103C8;OLD PERSIAN SIGN AURAMAZDAA;Lo;0;L;;;;;N;;;;; 103C9;OLD PERSIAN SIGN AURAMAZDAA-2;Lo;0;L;;;;;N;;;;; 103CA;OLD PERSIAN SIGN AURAMAZDAAHA;Lo;0;L;;;;;N;;;;; 103CB;OLD PERSIAN SIGN XSHAAYATHIYA;Lo;0;L;;;;;N;;;;; 103CC;OLD PERSIAN SIGN DAHYAAUSH;Lo;0;L;;;;;N;;;;; 103CD;OLD PERSIAN SIGN DAHYAAUSH-2;Lo;0;L;;;;;N;;;;; 103CE;OLD PERSIAN SIGN BAGA;Lo;0;L;;;;;N;;;;; 103CF;OLD PERSIAN SIGN BUUMISH;Lo;0;L;;;;;N;;;;; 103D0;OLD PERSIAN WORD DIVIDER;Po;0;L;;;;;N;;;;; 103D1;OLD PERSIAN NUMBER ONE;Nl;0;L;;;;1;N;;;;; 103D2;OLD PERSIAN NUMBER TWO;Nl;0;L;;;;2;N;;;;; 103D3;OLD PERSIAN NUMBER TEN;Nl;0;L;;;;10;N;;;;; 103D4;OLD PERSIAN NUMBER TWENTY;Nl;0;L;;;;20;N;;;;; 103D5;OLD PERSIAN NUMBER HUNDRED;Nl;0;L;;;;100;N;;;;; 10400;DESERET CAPITAL LETTER LONG I;Lu;0;L;;;;;N;;;;10428; 10401;DESERET CAPITAL LETTER LONG E;Lu;0;L;;;;;N;;;;10429; 10402;DESERET CAPITAL LETTER LONG A;Lu;0;L;;;;;N;;;;1042A; 10403;DESERET CAPITAL LETTER LONG AH;Lu;0;L;;;;;N;;;;1042B; 10404;DESERET CAPITAL LETTER LONG O;Lu;0;L;;;;;N;;;;1042C; 10405;DESERET CAPITAL LETTER LONG OO;Lu;0;L;;;;;N;;;;1042D; 10406;DESERET CAPITAL LETTER SHORT I;Lu;0;L;;;;;N;;;;1042E; 10407;DESERET CAPITAL LETTER SHORT E;Lu;0;L;;;;;N;;;;1042F; 10408;DESERET CAPITAL LETTER SHORT A;Lu;0;L;;;;;N;;;;10430; 10409;DESERET CAPITAL LETTER SHORT AH;Lu;0;L;;;;;N;;;;10431; 1040A;DESERET CAPITAL LETTER SHORT O;Lu;0;L;;;;;N;;;;10432; 1040B;DESERET CAPITAL LETTER SHORT OO;Lu;0;L;;;;;N;;;;10433; 1040C;DESERET CAPITAL LETTER AY;Lu;0;L;;;;;N;;;;10434; 1040D;DESERET CAPITAL LETTER OW;Lu;0;L;;;;;N;;;;10435; 1040E;DESERET CAPITAL LETTER WU;Lu;0;L;;;;;N;;;;10436; 1040F;DESERET CAPITAL LETTER YEE;Lu;0;L;;;;;N;;;;10437; 10410;DESERET CAPITAL LETTER H;Lu;0;L;;;;;N;;;;10438; 10411;DESERET CAPITAL LETTER PEE;Lu;0;L;;;;;N;;;;10439; 10412;DESERET CAPITAL LETTER BEE;Lu;0;L;;;;;N;;;;1043A; 10413;DESERET CAPITAL LETTER TEE;Lu;0;L;;;;;N;;;;1043B; 10414;DESERET CAPITAL LETTER DEE;Lu;0;L;;;;;N;;;;1043C; 10415;DESERET CAPITAL LETTER CHEE;Lu;0;L;;;;;N;;;;1043D; 10416;DESERET CAPITAL LETTER JEE;Lu;0;L;;;;;N;;;;1043E; 10417;DESERET CAPITAL LETTER KAY;Lu;0;L;;;;;N;;;;1043F; 10418;DESERET CAPITAL LETTER GAY;Lu;0;L;;;;;N;;;;10440; 10419;DESERET CAPITAL LETTER EF;Lu;0;L;;;;;N;;;;10441; 1041A;DESERET CAPITAL LETTER VEE;Lu;0;L;;;;;N;;;;10442; 1041B;DESERET CAPITAL LETTER ETH;Lu;0;L;;;;;N;;;;10443; 1041C;DESERET CAPITAL LETTER THEE;Lu;0;L;;;;;N;;;;10444; 1041D;DESERET CAPITAL LETTER ES;Lu;0;L;;;;;N;;;;10445; 1041E;DESERET CAPITAL LETTER ZEE;Lu;0;L;;;;;N;;;;10446; 1041F;DESERET CAPITAL LETTER ESH;Lu;0;L;;;;;N;;;;10447; 10420;DESERET CAPITAL LETTER ZHEE;Lu;0;L;;;;;N;;;;10448; 10421;DESERET CAPITAL LETTER ER;Lu;0;L;;;;;N;;;;10449; 10422;DESERET CAPITAL LETTER EL;Lu;0;L;;;;;N;;;;1044A; 10423;DESERET CAPITAL LETTER EM;Lu;0;L;;;;;N;;;;1044B; 10424;DESERET CAPITAL LETTER EN;Lu;0;L;;;;;N;;;;1044C; 10425;DESERET CAPITAL LETTER ENG;Lu;0;L;;;;;N;;;;1044D; 10426;DESERET CAPITAL LETTER OI;Lu;0;L;;;;;N;;;;1044E; 10427;DESERET CAPITAL LETTER EW;Lu;0;L;;;;;N;;;;1044F; 10428;DESERET SMALL LETTER LONG I;Ll;0;L;;;;;N;;;10400;;10400 10429;DESERET SMALL LETTER LONG E;Ll;0;L;;;;;N;;;10401;;10401 1042A;DESERET SMALL LETTER LONG A;Ll;0;L;;;;;N;;;10402;;10402 1042B;DESERET SMALL LETTER LONG AH;Ll;0;L;;;;;N;;;10403;;10403 1042C;DESERET SMALL LETTER LONG O;Ll;0;L;;;;;N;;;10404;;10404 1042D;DESERET SMALL LETTER LONG OO;Ll;0;L;;;;;N;;;10405;;10405 1042E;DESERET SMALL LETTER SHORT I;Ll;0;L;;;;;N;;;10406;;10406 1042F;DESERET SMALL LETTER SHORT E;Ll;0;L;;;;;N;;;10407;;10407 10430;DESERET SMALL LETTER SHORT A;Ll;0;L;;;;;N;;;10408;;10408 10431;DESERET SMALL LETTER SHORT AH;Ll;0;L;;;;;N;;;10409;;10409 10432;DESERET SMALL LETTER SHORT O;Ll;0;L;;;;;N;;;1040A;;1040A 10433;DESERET SMALL LETTER SHORT OO;Ll;0;L;;;;;N;;;1040B;;1040B 10434;DESERET SMALL LETTER AY;Ll;0;L;;;;;N;;;1040C;;1040C 10435;DESERET SMALL LETTER OW;Ll;0;L;;;;;N;;;1040D;;1040D 10436;DESERET SMALL LETTER WU;Ll;0;L;;;;;N;;;1040E;;1040E 10437;DESERET SMALL LETTER YEE;Ll;0;L;;;;;N;;;1040F;;1040F 10438;DESERET SMALL LETTER H;Ll;0;L;;;;;N;;;10410;;10410 10439;DESERET SMALL LETTER PEE;Ll;0;L;;;;;N;;;10411;;10411 1043A;DESERET SMALL LETTER BEE;Ll;0;L;;;;;N;;;10412;;10412 1043B;DESERET SMALL LETTER TEE;Ll;0;L;;;;;N;;;10413;;10413 1043C;DESERET SMALL LETTER DEE;Ll;0;L;;;;;N;;;10414;;10414 1043D;DESERET SMALL LETTER CHEE;Ll;0;L;;;;;N;;;10415;;10415 1043E;DESERET SMALL LETTER JEE;Ll;0;L;;;;;N;;;10416;;10416 1043F;DESERET SMALL LETTER KAY;Ll;0;L;;;;;N;;;10417;;10417 10440;DESERET SMALL LETTER GAY;Ll;0;L;;;;;N;;;10418;;10418 10441;DESERET SMALL LETTER EF;Ll;0;L;;;;;N;;;10419;;10419 10442;DESERET SMALL LETTER VEE;Ll;0;L;;;;;N;;;1041A;;1041A 10443;DESERET SMALL LETTER ETH;Ll;0;L;;;;;N;;;1041B;;1041B 10444;DESERET SMALL LETTER THEE;Ll;0;L;;;;;N;;;1041C;;1041C 10445;DESERET SMALL LETTER ES;Ll;0;L;;;;;N;;;1041D;;1041D 10446;DESERET SMALL LETTER ZEE;Ll;0;L;;;;;N;;;1041E;;1041E 10447;DESERET SMALL LETTER ESH;Ll;0;L;;;;;N;;;1041F;;1041F 10448;DESERET SMALL LETTER ZHEE;Ll;0;L;;;;;N;;;10420;;10420 10449;DESERET SMALL LETTER ER;Ll;0;L;;;;;N;;;10421;;10421 1044A;DESERET SMALL LETTER EL;Ll;0;L;;;;;N;;;10422;;10422 1044B;DESERET SMALL LETTER EM;Ll;0;L;;;;;N;;;10423;;10423 1044C;DESERET SMALL LETTER EN;Ll;0;L;;;;;N;;;10424;;10424 1044D;DESERET SMALL LETTER ENG;Ll;0;L;;;;;N;;;10425;;10425 1044E;DESERET SMALL LETTER OI;Ll;0;L;;;;;N;;;10426;;10426 1044F;DESERET SMALL LETTER EW;Ll;0;L;;;;;N;;;10427;;10427 10450;SHAVIAN LETTER PEEP;Lo;0;L;;;;;N;;;;; 10451;SHAVIAN LETTER TOT;Lo;0;L;;;;;N;;;;; 10452;SHAVIAN LETTER KICK;Lo;0;L;;;;;N;;;;; 10453;SHAVIAN LETTER FEE;Lo;0;L;;;;;N;;;;; 10454;SHAVIAN LETTER THIGH;Lo;0;L;;;;;N;;;;; 10455;SHAVIAN LETTER SO;Lo;0;L;;;;;N;;;;; 10456;SHAVIAN LETTER SURE;Lo;0;L;;;;;N;;;;; 10457;SHAVIAN LETTER CHURCH;Lo;0;L;;;;;N;;;;; 10458;SHAVIAN LETTER YEA;Lo;0;L;;;;;N;;;;; 10459;SHAVIAN LETTER HUNG;Lo;0;L;;;;;N;;;;; 1045A;SHAVIAN LETTER BIB;Lo;0;L;;;;;N;;;;; 1045B;SHAVIAN LETTER DEAD;Lo;0;L;;;;;N;;;;; 1045C;SHAVIAN LETTER GAG;Lo;0;L;;;;;N;;;;; 1045D;SHAVIAN LETTER VOW;Lo;0;L;;;;;N;;;;; 1045E;SHAVIAN LETTER THEY;Lo;0;L;;;;;N;;;;; 1045F;SHAVIAN LETTER ZOO;Lo;0;L;;;;;N;;;;; 10460;SHAVIAN LETTER MEASURE;Lo;0;L;;;;;N;;;;; 10461;SHAVIAN LETTER JUDGE;Lo;0;L;;;;;N;;;;; 10462;SHAVIAN LETTER WOE;Lo;0;L;;;;;N;;;;; 10463;SHAVIAN LETTER HA-HA;Lo;0;L;;;;;N;;;;; 10464;SHAVIAN LETTER LOLL;Lo;0;L;;;;;N;;;;; 10465;SHAVIAN LETTER MIME;Lo;0;L;;;;;N;;;;; 10466;SHAVIAN LETTER IF;Lo;0;L;;;;;N;;;;; 10467;SHAVIAN LETTER EGG;Lo;0;L;;;;;N;;;;; 10468;SHAVIAN LETTER ASH;Lo;0;L;;;;;N;;;;; 10469;SHAVIAN LETTER ADO;Lo;0;L;;;;;N;;;;; 1046A;SHAVIAN LETTER ON;Lo;0;L;;;;;N;;;;; 1046B;SHAVIAN LETTER WOOL;Lo;0;L;;;;;N;;;;; 1046C;SHAVIAN LETTER OUT;Lo;0;L;;;;;N;;;;; 1046D;SHAVIAN LETTER AH;Lo;0;L;;;;;N;;;;; 1046E;SHAVIAN LETTER ROAR;Lo;0;L;;;;;N;;;;; 1046F;SHAVIAN LETTER NUN;Lo;0;L;;;;;N;;;;; 10470;SHAVIAN LETTER EAT;Lo;0;L;;;;;N;;;;; 10471;SHAVIAN LETTER AGE;Lo;0;L;;;;;N;;;;; 10472;SHAVIAN LETTER ICE;Lo;0;L;;;;;N;;;;; 10473;SHAVIAN LETTER UP;Lo;0;L;;;;;N;;;;; 10474;SHAVIAN LETTER OAK;Lo;0;L;;;;;N;;;;; 10475;SHAVIAN LETTER OOZE;Lo;0;L;;;;;N;;;;; 10476;SHAVIAN LETTER OIL;Lo;0;L;;;;;N;;;;; 10477;SHAVIAN LETTER AWE;Lo;0;L;;;;;N;;;;; 10478;SHAVIAN LETTER ARE;Lo;0;L;;;;;N;;;;; 10479;SHAVIAN LETTER OR;Lo;0;L;;;;;N;;;;; 1047A;SHAVIAN LETTER AIR;Lo;0;L;;;;;N;;;;; 1047B;SHAVIAN LETTER ERR;Lo;0;L;;;;;N;;;;; 1047C;SHAVIAN LETTER ARRAY;Lo;0;L;;;;;N;;;;; 1047D;SHAVIAN LETTER EAR;Lo;0;L;;;;;N;;;;; 1047E;SHAVIAN LETTER IAN;Lo;0;L;;;;;N;;;;; 1047F;SHAVIAN LETTER YEW;Lo;0;L;;;;;N;;;;; 10480;OSMANYA LETTER ALEF;Lo;0;L;;;;;N;;;;; 10481;OSMANYA LETTER BA;Lo;0;L;;;;;N;;;;; 10482;OSMANYA LETTER TA;Lo;0;L;;;;;N;;;;; 10483;OSMANYA LETTER JA;Lo;0;L;;;;;N;;;;; 10484;OSMANYA LETTER XA;Lo;0;L;;;;;N;;;;; 10485;OSMANYA LETTER KHA;Lo;0;L;;;;;N;;;;; 10486;OSMANYA LETTER DEEL;Lo;0;L;;;;;N;;;;; 10487;OSMANYA LETTER RA;Lo;0;L;;;;;N;;;;; 10488;OSMANYA LETTER SA;Lo;0;L;;;;;N;;;;; 10489;OSMANYA LETTER SHIIN;Lo;0;L;;;;;N;;;;; 1048A;OSMANYA LETTER DHA;Lo;0;L;;;;;N;;;;; 1048B;OSMANYA LETTER CAYN;Lo;0;L;;;;;N;;;;; 1048C;OSMANYA LETTER GA;Lo;0;L;;;;;N;;;;; 1048D;OSMANYA LETTER FA;Lo;0;L;;;;;N;;;;; 1048E;OSMANYA LETTER QAAF;Lo;0;L;;;;;N;;;;; 1048F;OSMANYA LETTER KAAF;Lo;0;L;;;;;N;;;;; 10490;OSMANYA LETTER LAAN;Lo;0;L;;;;;N;;;;; 10491;OSMANYA LETTER MIIN;Lo;0;L;;;;;N;;;;; 10492;OSMANYA LETTER NUUN;Lo;0;L;;;;;N;;;;; 10493;OSMANYA LETTER WAW;Lo;0;L;;;;;N;;;;; 10494;OSMANYA LETTER HA;Lo;0;L;;;;;N;;;;; 10495;OSMANYA LETTER YA;Lo;0;L;;;;;N;;;;; 10496;OSMANYA LETTER A;Lo;0;L;;;;;N;;;;; 10497;OSMANYA LETTER E;Lo;0;L;;;;;N;;;;; 10498;OSMANYA LETTER I;Lo;0;L;;;;;N;;;;; 10499;OSMANYA LETTER O;Lo;0;L;;;;;N;;;;; 1049A;OSMANYA LETTER U;Lo;0;L;;;;;N;;;;; 1049B;OSMANYA LETTER AA;Lo;0;L;;;;;N;;;;; 1049C;OSMANYA LETTER EE;Lo;0;L;;;;;N;;;;; 1049D;OSMANYA LETTER OO;Lo;0;L;;;;;N;;;;; 104A0;OSMANYA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 104A1;OSMANYA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 104A2;OSMANYA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 104A3;OSMANYA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 104A4;OSMANYA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 104A5;OSMANYA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 104A6;OSMANYA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 104A7;OSMANYA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 104A8;OSMANYA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 104A9;OSMANYA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 10800;CYPRIOT SYLLABLE A;Lo;0;R;;;;;N;;;;; 10801;CYPRIOT SYLLABLE E;Lo;0;R;;;;;N;;;;; 10802;CYPRIOT SYLLABLE I;Lo;0;R;;;;;N;;;;; 10803;CYPRIOT SYLLABLE O;Lo;0;R;;;;;N;;;;; 10804;CYPRIOT SYLLABLE U;Lo;0;R;;;;;N;;;;; 10805;CYPRIOT SYLLABLE JA;Lo;0;R;;;;;N;;;;; 10808;CYPRIOT SYLLABLE JO;Lo;0;R;;;;;N;;;;; 1080A;CYPRIOT SYLLABLE KA;Lo;0;R;;;;;N;;;;; 1080B;CYPRIOT SYLLABLE KE;Lo;0;R;;;;;N;;;;; 1080C;CYPRIOT SYLLABLE KI;Lo;0;R;;;;;N;;;;; 1080D;CYPRIOT SYLLABLE KO;Lo;0;R;;;;;N;;;;; 1080E;CYPRIOT SYLLABLE KU;Lo;0;R;;;;;N;;;;; 1080F;CYPRIOT SYLLABLE LA;Lo;0;R;;;;;N;;;;; 10810;CYPRIOT SYLLABLE LE;Lo;0;R;;;;;N;;;;; 10811;CYPRIOT SYLLABLE LI;Lo;0;R;;;;;N;;;;; 10812;CYPRIOT SYLLABLE LO;Lo;0;R;;;;;N;;;;; 10813;CYPRIOT SYLLABLE LU;Lo;0;R;;;;;N;;;;; 10814;CYPRIOT SYLLABLE MA;Lo;0;R;;;;;N;;;;; 10815;CYPRIOT SYLLABLE ME;Lo;0;R;;;;;N;;;;; 10816;CYPRIOT SYLLABLE MI;Lo;0;R;;;;;N;;;;; 10817;CYPRIOT SYLLABLE MO;Lo;0;R;;;;;N;;;;; 10818;CYPRIOT SYLLABLE MU;Lo;0;R;;;;;N;;;;; 10819;CYPRIOT SYLLABLE NA;Lo;0;R;;;;;N;;;;; 1081A;CYPRIOT SYLLABLE NE;Lo;0;R;;;;;N;;;;; 1081B;CYPRIOT SYLLABLE NI;Lo;0;R;;;;;N;;;;; 1081C;CYPRIOT SYLLABLE NO;Lo;0;R;;;;;N;;;;; 1081D;CYPRIOT SYLLABLE NU;Lo;0;R;;;;;N;;;;; 1081E;CYPRIOT SYLLABLE PA;Lo;0;R;;;;;N;;;;; 1081F;CYPRIOT SYLLABLE PE;Lo;0;R;;;;;N;;;;; 10820;CYPRIOT SYLLABLE PI;Lo;0;R;;;;;N;;;;; 10821;CYPRIOT SYLLABLE PO;Lo;0;R;;;;;N;;;;; 10822;CYPRIOT SYLLABLE PU;Lo;0;R;;;;;N;;;;; 10823;CYPRIOT SYLLABLE RA;Lo;0;R;;;;;N;;;;; 10824;CYPRIOT SYLLABLE RE;Lo;0;R;;;;;N;;;;; 10825;CYPRIOT SYLLABLE RI;Lo;0;R;;;;;N;;;;; 10826;CYPRIOT SYLLABLE RO;Lo;0;R;;;;;N;;;;; 10827;CYPRIOT SYLLABLE RU;Lo;0;R;;;;;N;;;;; 10828;CYPRIOT SYLLABLE SA;Lo;0;R;;;;;N;;;;; 10829;CYPRIOT SYLLABLE SE;Lo;0;R;;;;;N;;;;; 1082A;CYPRIOT SYLLABLE SI;Lo;0;R;;;;;N;;;;; 1082B;CYPRIOT SYLLABLE SO;Lo;0;R;;;;;N;;;;; 1082C;CYPRIOT SYLLABLE SU;Lo;0;R;;;;;N;;;;; 1082D;CYPRIOT SYLLABLE TA;Lo;0;R;;;;;N;;;;; 1082E;CYPRIOT SYLLABLE TE;Lo;0;R;;;;;N;;;;; 1082F;CYPRIOT SYLLABLE TI;Lo;0;R;;;;;N;;;;; 10830;CYPRIOT SYLLABLE TO;Lo;0;R;;;;;N;;;;; 10831;CYPRIOT SYLLABLE TU;Lo;0;R;;;;;N;;;;; 10832;CYPRIOT SYLLABLE WA;Lo;0;R;;;;;N;;;;; 10833;CYPRIOT SYLLABLE WE;Lo;0;R;;;;;N;;;;; 10834;CYPRIOT SYLLABLE WI;Lo;0;R;;;;;N;;;;; 10835;CYPRIOT SYLLABLE WO;Lo;0;R;;;;;N;;;;; 10837;CYPRIOT SYLLABLE XA;Lo;0;R;;;;;N;;;;; 10838;CYPRIOT SYLLABLE XE;Lo;0;R;;;;;N;;;;; 1083C;CYPRIOT SYLLABLE ZA;Lo;0;R;;;;;N;;;;; 1083F;CYPRIOT SYLLABLE ZO;Lo;0;R;;;;;N;;;;; 10840;IMPERIAL ARAMAIC LETTER ALEPH;Lo;0;R;;;;;N;;;;; 10841;IMPERIAL ARAMAIC LETTER BETH;Lo;0;R;;;;;N;;;;; 10842;IMPERIAL ARAMAIC LETTER GIMEL;Lo;0;R;;;;;N;;;;; 10843;IMPERIAL ARAMAIC LETTER DALETH;Lo;0;R;;;;;N;;;;; 10844;IMPERIAL ARAMAIC LETTER HE;Lo;0;R;;;;;N;;;;; 10845;IMPERIAL ARAMAIC LETTER WAW;Lo;0;R;;;;;N;;;;; 10846;IMPERIAL ARAMAIC LETTER ZAYIN;Lo;0;R;;;;;N;;;;; 10847;IMPERIAL ARAMAIC LETTER HETH;Lo;0;R;;;;;N;;;;; 10848;IMPERIAL ARAMAIC LETTER TETH;Lo;0;R;;;;;N;;;;; 10849;IMPERIAL ARAMAIC LETTER YODH;Lo;0;R;;;;;N;;;;; 1084A;IMPERIAL ARAMAIC LETTER KAPH;Lo;0;R;;;;;N;;;;; 1084B;IMPERIAL ARAMAIC LETTER LAMEDH;Lo;0;R;;;;;N;;;;; 1084C;IMPERIAL ARAMAIC LETTER MEM;Lo;0;R;;;;;N;;;;; 1084D;IMPERIAL ARAMAIC LETTER NUN;Lo;0;R;;;;;N;;;;; 1084E;IMPERIAL ARAMAIC LETTER SAMEKH;Lo;0;R;;;;;N;;;;; 1084F;IMPERIAL ARAMAIC LETTER AYIN;Lo;0;R;;;;;N;;;;; 10850;IMPERIAL ARAMAIC LETTER PE;Lo;0;R;;;;;N;;;;; 10851;IMPERIAL ARAMAIC LETTER SADHE;Lo;0;R;;;;;N;;;;; 10852;IMPERIAL ARAMAIC LETTER QOPH;Lo;0;R;;;;;N;;;;; 10853;IMPERIAL ARAMAIC LETTER RESH;Lo;0;R;;;;;N;;;;; 10854;IMPERIAL ARAMAIC LETTER SHIN;Lo;0;R;;;;;N;;;;; 10855;IMPERIAL ARAMAIC LETTER TAW;Lo;0;R;;;;;N;;;;; 10857;IMPERIAL ARAMAIC SECTION SIGN;Po;0;R;;;;;N;;;;; 10858;IMPERIAL ARAMAIC NUMBER ONE;No;0;R;;;;1;N;;;;; 10859;IMPERIAL ARAMAIC NUMBER TWO;No;0;R;;;;2;N;;;;; 1085A;IMPERIAL ARAMAIC NUMBER THREE;No;0;R;;;;3;N;;;;; 1085B;IMPERIAL ARAMAIC NUMBER TEN;No;0;R;;;;10;N;;;;; 1085C;IMPERIAL ARAMAIC NUMBER TWENTY;No;0;R;;;;20;N;;;;; 1085D;IMPERIAL ARAMAIC NUMBER ONE HUNDRED;No;0;R;;;;100;N;;;;; 1085E;IMPERIAL ARAMAIC NUMBER ONE THOUSAND;No;0;R;;;;1000;N;;;;; 1085F;IMPERIAL ARAMAIC NUMBER TEN THOUSAND;No;0;R;;;;10000;N;;;;; 10900;PHOENICIAN LETTER ALF;Lo;0;R;;;;;N;;;;; 10901;PHOENICIAN LETTER BET;Lo;0;R;;;;;N;;;;; 10902;PHOENICIAN LETTER GAML;Lo;0;R;;;;;N;;;;; 10903;PHOENICIAN LETTER DELT;Lo;0;R;;;;;N;;;;; 10904;PHOENICIAN LETTER HE;Lo;0;R;;;;;N;;;;; 10905;PHOENICIAN LETTER WAU;Lo;0;R;;;;;N;;;;; 10906;PHOENICIAN LETTER ZAI;Lo;0;R;;;;;N;;;;; 10907;PHOENICIAN LETTER HET;Lo;0;R;;;;;N;;;;; 10908;PHOENICIAN LETTER TET;Lo;0;R;;;;;N;;;;; 10909;PHOENICIAN LETTER YOD;Lo;0;R;;;;;N;;;;; 1090A;PHOENICIAN LETTER KAF;Lo;0;R;;;;;N;;;;; 1090B;PHOENICIAN LETTER LAMD;Lo;0;R;;;;;N;;;;; 1090C;PHOENICIAN LETTER MEM;Lo;0;R;;;;;N;;;;; 1090D;PHOENICIAN LETTER NUN;Lo;0;R;;;;;N;;;;; 1090E;PHOENICIAN LETTER SEMK;Lo;0;R;;;;;N;;;;; 1090F;PHOENICIAN LETTER AIN;Lo;0;R;;;;;N;;;;; 10910;PHOENICIAN LETTER PE;Lo;0;R;;;;;N;;;;; 10911;PHOENICIAN LETTER SADE;Lo;0;R;;;;;N;;;;; 10912;PHOENICIAN LETTER QOF;Lo;0;R;;;;;N;;;;; 10913;PHOENICIAN LETTER ROSH;Lo;0;R;;;;;N;;;;; 10914;PHOENICIAN LETTER SHIN;Lo;0;R;;;;;N;;;;; 10915;PHOENICIAN LETTER TAU;Lo;0;R;;;;;N;;;;; 10916;PHOENICIAN NUMBER ONE;No;0;R;;;;1;N;;;;; 10917;PHOENICIAN NUMBER TEN;No;0;R;;;;10;N;;;;; 10918;PHOENICIAN NUMBER TWENTY;No;0;R;;;;20;N;;;;; 10919;PHOENICIAN NUMBER ONE HUNDRED;No;0;R;;;;100;N;;;;; 1091A;PHOENICIAN NUMBER TWO;No;0;R;;;;2;N;;;;; 1091B;PHOENICIAN NUMBER THREE;No;0;R;;;;3;N;;;;; 1091F;PHOENICIAN WORD SEPARATOR;Po;0;ON;;;;;N;;;;; 10920;LYDIAN LETTER A;Lo;0;R;;;;;N;;;;; 10921;LYDIAN LETTER B;Lo;0;R;;;;;N;;;;; 10922;LYDIAN LETTER G;Lo;0;R;;;;;N;;;;; 10923;LYDIAN LETTER D;Lo;0;R;;;;;N;;;;; 10924;LYDIAN LETTER E;Lo;0;R;;;;;N;;;;; 10925;LYDIAN LETTER V;Lo;0;R;;;;;N;;;;; 10926;LYDIAN LETTER I;Lo;0;R;;;;;N;;;;; 10927;LYDIAN LETTER Y;Lo;0;R;;;;;N;;;;; 10928;LYDIAN LETTER K;Lo;0;R;;;;;N;;;;; 10929;LYDIAN LETTER L;Lo;0;R;;;;;N;;;;; 1092A;LYDIAN LETTER M;Lo;0;R;;;;;N;;;;; 1092B;LYDIAN LETTER N;Lo;0;R;;;;;N;;;;; 1092C;LYDIAN LETTER O;Lo;0;R;;;;;N;;;;; 1092D;LYDIAN LETTER R;Lo;0;R;;;;;N;;;;; 1092E;LYDIAN LETTER SS;Lo;0;R;;;;;N;;;;; 1092F;LYDIAN LETTER T;Lo;0;R;;;;;N;;;;; 10930;LYDIAN LETTER U;Lo;0;R;;;;;N;;;;; 10931;LYDIAN LETTER F;Lo;0;R;;;;;N;;;;; 10932;LYDIAN LETTER Q;Lo;0;R;;;;;N;;;;; 10933;LYDIAN LETTER S;Lo;0;R;;;;;N;;;;; 10934;LYDIAN LETTER TT;Lo;0;R;;;;;N;;;;; 10935;LYDIAN LETTER AN;Lo;0;R;;;;;N;;;;; 10936;LYDIAN LETTER EN;Lo;0;R;;;;;N;;;;; 10937;LYDIAN LETTER LY;Lo;0;R;;;;;N;;;;; 10938;LYDIAN LETTER NN;Lo;0;R;;;;;N;;;;; 10939;LYDIAN LETTER C;Lo;0;R;;;;;N;;;;; 1093F;LYDIAN TRIANGULAR MARK;Po;0;R;;;;;N;;;;; 10980;MEROITIC HIEROGLYPHIC LETTER A;Lo;0;R;;;;;N;;;;; 10981;MEROITIC HIEROGLYPHIC LETTER E;Lo;0;R;;;;;N;;;;; 10982;MEROITIC HIEROGLYPHIC LETTER I;Lo;0;R;;;;;N;;;;; 10983;MEROITIC HIEROGLYPHIC LETTER O;Lo;0;R;;;;;N;;;;; 10984;MEROITIC HIEROGLYPHIC LETTER YA;Lo;0;R;;;;;N;;;;; 10985;MEROITIC HIEROGLYPHIC LETTER WA;Lo;0;R;;;;;N;;;;; 10986;MEROITIC HIEROGLYPHIC LETTER BA;Lo;0;R;;;;;N;;;;; 10987;MEROITIC HIEROGLYPHIC LETTER BA-2;Lo;0;R;;;;;N;;;;; 10988;MEROITIC HIEROGLYPHIC LETTER PA;Lo;0;R;;;;;N;;;;; 10989;MEROITIC HIEROGLYPHIC LETTER MA;Lo;0;R;;;;;N;;;;; 1098A;MEROITIC HIEROGLYPHIC LETTER NA;Lo;0;R;;;;;N;;;;; 1098B;MEROITIC HIEROGLYPHIC LETTER NA-2;Lo;0;R;;;;;N;;;;; 1098C;MEROITIC HIEROGLYPHIC LETTER NE;Lo;0;R;;;;;N;;;;; 1098D;MEROITIC HIEROGLYPHIC LETTER NE-2;Lo;0;R;;;;;N;;;;; 1098E;MEROITIC HIEROGLYPHIC LETTER RA;Lo;0;R;;;;;N;;;;; 1098F;MEROITIC HIEROGLYPHIC LETTER RA-2;Lo;0;R;;;;;N;;;;; 10990;MEROITIC HIEROGLYPHIC LETTER LA;Lo;0;R;;;;;N;;;;; 10991;MEROITIC HIEROGLYPHIC LETTER KHA;Lo;0;R;;;;;N;;;;; 10992;MEROITIC HIEROGLYPHIC LETTER HHA;Lo;0;R;;;;;N;;;;; 10993;MEROITIC HIEROGLYPHIC LETTER SA;Lo;0;R;;;;;N;;;;; 10994;MEROITIC HIEROGLYPHIC LETTER SA-2;Lo;0;R;;;;;N;;;;; 10995;MEROITIC HIEROGLYPHIC LETTER SE;Lo;0;R;;;;;N;;;;; 10996;MEROITIC HIEROGLYPHIC LETTER KA;Lo;0;R;;;;;N;;;;; 10997;MEROITIC HIEROGLYPHIC LETTER QA;Lo;0;R;;;;;N;;;;; 10998;MEROITIC HIEROGLYPHIC LETTER TA;Lo;0;R;;;;;N;;;;; 10999;MEROITIC HIEROGLYPHIC LETTER TA-2;Lo;0;R;;;;;N;;;;; 1099A;MEROITIC HIEROGLYPHIC LETTER TE;Lo;0;R;;;;;N;;;;; 1099B;MEROITIC HIEROGLYPHIC LETTER TE-2;Lo;0;R;;;;;N;;;;; 1099C;MEROITIC HIEROGLYPHIC LETTER TO;Lo;0;R;;;;;N;;;;; 1099D;MEROITIC HIEROGLYPHIC LETTER DA;Lo;0;R;;;;;N;;;;; 1099E;MEROITIC HIEROGLYPHIC SYMBOL VIDJ;Lo;0;R;;;;;N;;;;; 1099F;MEROITIC HIEROGLYPHIC SYMBOL VIDJ-2;Lo;0;R;;;;;N;;;;; 109A0;MEROITIC CURSIVE LETTER A;Lo;0;R;;;;;N;;;;; 109A1;MEROITIC CURSIVE LETTER E;Lo;0;R;;;;;N;;;;; 109A2;MEROITIC CURSIVE LETTER I;Lo;0;R;;;;;N;;;;; 109A3;MEROITIC CURSIVE LETTER O;Lo;0;R;;;;;N;;;;; 109A4;MEROITIC CURSIVE LETTER YA;Lo;0;R;;;;;N;;;;; 109A5;MEROITIC CURSIVE LETTER WA;Lo;0;R;;;;;N;;;;; 109A6;MEROITIC CURSIVE LETTER BA;Lo;0;R;;;;;N;;;;; 109A7;MEROITIC CURSIVE LETTER PA;Lo;0;R;;;;;N;;;;; 109A8;MEROITIC CURSIVE LETTER MA;Lo;0;R;;;;;N;;;;; 109A9;MEROITIC CURSIVE LETTER NA;Lo;0;R;;;;;N;;;;; 109AA;MEROITIC CURSIVE LETTER NE;Lo;0;R;;;;;N;;;;; 109AB;MEROITIC CURSIVE LETTER RA;Lo;0;R;;;;;N;;;;; 109AC;MEROITIC CURSIVE LETTER LA;Lo;0;R;;;;;N;;;;; 109AD;MEROITIC CURSIVE LETTER KHA;Lo;0;R;;;;;N;;;;; 109AE;MEROITIC CURSIVE LETTER HHA;Lo;0;R;;;;;N;;;;; 109AF;MEROITIC CURSIVE LETTER SA;Lo;0;R;;;;;N;;;;; 109B0;MEROITIC CURSIVE LETTER ARCHAIC SA;Lo;0;R;;;;;N;;;;; 109B1;MEROITIC CURSIVE LETTER SE;Lo;0;R;;;;;N;;;;; 109B2;MEROITIC CURSIVE LETTER KA;Lo;0;R;;;;;N;;;;; 109B3;MEROITIC CURSIVE LETTER QA;Lo;0;R;;;;;N;;;;; 109B4;MEROITIC CURSIVE LETTER TA;Lo;0;R;;;;;N;;;;; 109B5;MEROITIC CURSIVE LETTER TE;Lo;0;R;;;;;N;;;;; 109B6;MEROITIC CURSIVE LETTER TO;Lo;0;R;;;;;N;;;;; 109B7;MEROITIC CURSIVE LETTER DA;Lo;0;R;;;;;N;;;;; 109BE;MEROITIC CURSIVE LOGOGRAM RMT;Lo;0;R;;;;;N;;;;; 109BF;MEROITIC CURSIVE LOGOGRAM IMN;Lo;0;R;;;;;N;;;;; 10A00;KHAROSHTHI LETTER A;Lo;0;R;;;;;N;;;;; 10A01;KHAROSHTHI VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 10A02;KHAROSHTHI VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 10A03;KHAROSHTHI VOWEL SIGN VOCALIC R;Mn;0;NSM;;;;;N;;;;; 10A05;KHAROSHTHI VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; 10A06;KHAROSHTHI VOWEL SIGN O;Mn;0;NSM;;;;;N;;;;; 10A0C;KHAROSHTHI VOWEL LENGTH MARK;Mn;0;NSM;;;;;N;;;;; 10A0D;KHAROSHTHI SIGN DOUBLE RING BELOW;Mn;220;NSM;;;;;N;;;;; 10A0E;KHAROSHTHI SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; 10A0F;KHAROSHTHI SIGN VISARGA;Mn;230;NSM;;;;;N;;;;; 10A10;KHAROSHTHI LETTER KA;Lo;0;R;;;;;N;;;;; 10A11;KHAROSHTHI LETTER KHA;Lo;0;R;;;;;N;;;;; 10A12;KHAROSHTHI LETTER GA;Lo;0;R;;;;;N;;;;; 10A13;KHAROSHTHI LETTER GHA;Lo;0;R;;;;;N;;;;; 10A15;KHAROSHTHI LETTER CA;Lo;0;R;;;;;N;;;;; 10A16;KHAROSHTHI LETTER CHA;Lo;0;R;;;;;N;;;;; 10A17;KHAROSHTHI LETTER JA;Lo;0;R;;;;;N;;;;; 10A19;KHAROSHTHI LETTER NYA;Lo;0;R;;;;;N;;;;; 10A1A;KHAROSHTHI LETTER TTA;Lo;0;R;;;;;N;;;;; 10A1B;KHAROSHTHI LETTER TTHA;Lo;0;R;;;;;N;;;;; 10A1C;KHAROSHTHI LETTER DDA;Lo;0;R;;;;;N;;;;; 10A1D;KHAROSHTHI LETTER DDHA;Lo;0;R;;;;;N;;;;; 10A1E;KHAROSHTHI LETTER NNA;Lo;0;R;;;;;N;;;;; 10A1F;KHAROSHTHI LETTER TA;Lo;0;R;;;;;N;;;;; 10A20;KHAROSHTHI LETTER THA;Lo;0;R;;;;;N;;;;; 10A21;KHAROSHTHI LETTER DA;Lo;0;R;;;;;N;;;;; 10A22;KHAROSHTHI LETTER DHA;Lo;0;R;;;;;N;;;;; 10A23;KHAROSHTHI LETTER NA;Lo;0;R;;;;;N;;;;; 10A24;KHAROSHTHI LETTER PA;Lo;0;R;;;;;N;;;;; 10A25;KHAROSHTHI LETTER PHA;Lo;0;R;;;;;N;;;;; 10A26;KHAROSHTHI LETTER BA;Lo;0;R;;;;;N;;;;; 10A27;KHAROSHTHI LETTER BHA;Lo;0;R;;;;;N;;;;; 10A28;KHAROSHTHI LETTER MA;Lo;0;R;;;;;N;;;;; 10A29;KHAROSHTHI LETTER YA;Lo;0;R;;;;;N;;;;; 10A2A;KHAROSHTHI LETTER RA;Lo;0;R;;;;;N;;;;; 10A2B;KHAROSHTHI LETTER LA;Lo;0;R;;;;;N;;;;; 10A2C;KHAROSHTHI LETTER VA;Lo;0;R;;;;;N;;;;; 10A2D;KHAROSHTHI LETTER SHA;Lo;0;R;;;;;N;;;;; 10A2E;KHAROSHTHI LETTER SSA;Lo;0;R;;;;;N;;;;; 10A2F;KHAROSHTHI LETTER SA;Lo;0;R;;;;;N;;;;; 10A30;KHAROSHTHI LETTER ZA;Lo;0;R;;;;;N;;;;; 10A31;KHAROSHTHI LETTER HA;Lo;0;R;;;;;N;;;;; 10A32;KHAROSHTHI LETTER KKA;Lo;0;R;;;;;N;;;;; 10A33;KHAROSHTHI LETTER TTTHA;Lo;0;R;;;;;N;;;;; 10A38;KHAROSHTHI SIGN BAR ABOVE;Mn;230;NSM;;;;;N;;;;; 10A39;KHAROSHTHI SIGN CAUDA;Mn;1;NSM;;;;;N;;;;; 10A3A;KHAROSHTHI SIGN DOT BELOW;Mn;220;NSM;;;;;N;;;;; 10A3F;KHAROSHTHI VIRAMA;Mn;9;NSM;;;;;N;;;;; 10A40;KHAROSHTHI DIGIT ONE;No;0;R;;;1;1;N;;;;; 10A41;KHAROSHTHI DIGIT TWO;No;0;R;;;2;2;N;;;;; 10A42;KHAROSHTHI DIGIT THREE;No;0;R;;;3;3;N;;;;; 10A43;KHAROSHTHI DIGIT FOUR;No;0;R;;;4;4;N;;;;; 10A44;KHAROSHTHI NUMBER TEN;No;0;R;;;;10;N;;;;; 10A45;KHAROSHTHI NUMBER TWENTY;No;0;R;;;;20;N;;;;; 10A46;KHAROSHTHI NUMBER ONE HUNDRED;No;0;R;;;;100;N;;;;; 10A47;KHAROSHTHI NUMBER ONE THOUSAND;No;0;R;;;;1000;N;;;;; 10A50;KHAROSHTHI PUNCTUATION DOT;Po;0;R;;;;;N;;;;; 10A51;KHAROSHTHI PUNCTUATION SMALL CIRCLE;Po;0;R;;;;;N;;;;; 10A52;KHAROSHTHI PUNCTUATION CIRCLE;Po;0;R;;;;;N;;;;; 10A53;KHAROSHTHI PUNCTUATION CRESCENT BAR;Po;0;R;;;;;N;;;;; 10A54;KHAROSHTHI PUNCTUATION MANGALAM;Po;0;R;;;;;N;;;;; 10A55;KHAROSHTHI PUNCTUATION LOTUS;Po;0;R;;;;;N;;;;; 10A56;KHAROSHTHI PUNCTUATION DANDA;Po;0;R;;;;;N;;;;; 10A57;KHAROSHTHI PUNCTUATION DOUBLE DANDA;Po;0;R;;;;;N;;;;; 10A58;KHAROSHTHI PUNCTUATION LINES;Po;0;R;;;;;N;;;;; 10A60;OLD SOUTH ARABIAN LETTER HE;Lo;0;R;;;;;N;;;;; 10A61;OLD SOUTH ARABIAN LETTER LAMEDH;Lo;0;R;;;;;N;;;;; 10A62;OLD SOUTH ARABIAN LETTER HETH;Lo;0;R;;;;;N;;;;; 10A63;OLD SOUTH ARABIAN LETTER MEM;Lo;0;R;;;;;N;;;;; 10A64;OLD SOUTH ARABIAN LETTER QOPH;Lo;0;R;;;;;N;;;;; 10A65;OLD SOUTH ARABIAN LETTER WAW;Lo;0;R;;;;;N;;;;; 10A66;OLD SOUTH ARABIAN LETTER SHIN;Lo;0;R;;;;;N;;;;; 10A67;OLD SOUTH ARABIAN LETTER RESH;Lo;0;R;;;;;N;;;;; 10A68;OLD SOUTH ARABIAN LETTER BETH;Lo;0;R;;;;;N;;;;; 10A69;OLD SOUTH ARABIAN LETTER TAW;Lo;0;R;;;;;N;;;;; 10A6A;OLD SOUTH ARABIAN LETTER SAT;Lo;0;R;;;;;N;;;;; 10A6B;OLD SOUTH ARABIAN LETTER KAPH;Lo;0;R;;;;;N;;;;; 10A6C;OLD SOUTH ARABIAN LETTER NUN;Lo;0;R;;;;;N;;;;; 10A6D;OLD SOUTH ARABIAN LETTER KHETH;Lo;0;R;;;;;N;;;;; 10A6E;OLD SOUTH ARABIAN LETTER SADHE;Lo;0;R;;;;;N;;;;; 10A6F;OLD SOUTH ARABIAN LETTER SAMEKH;Lo;0;R;;;;;N;;;;; 10A70;OLD SOUTH ARABIAN LETTER FE;Lo;0;R;;;;;N;;;;; 10A71;OLD SOUTH ARABIAN LETTER ALEF;Lo;0;R;;;;;N;;;;; 10A72;OLD SOUTH ARABIAN LETTER AYN;Lo;0;R;;;;;N;;;;; 10A73;OLD SOUTH ARABIAN LETTER DHADHE;Lo;0;R;;;;;N;;;;; 10A74;OLD SOUTH ARABIAN LETTER GIMEL;Lo;0;R;;;;;N;;;;; 10A75;OLD SOUTH ARABIAN LETTER DALETH;Lo;0;R;;;;;N;;;;; 10A76;OLD SOUTH ARABIAN LETTER GHAYN;Lo;0;R;;;;;N;;;;; 10A77;OLD SOUTH ARABIAN LETTER TETH;Lo;0;R;;;;;N;;;;; 10A78;OLD SOUTH ARABIAN LETTER ZAYN;Lo;0;R;;;;;N;;;;; 10A79;OLD SOUTH ARABIAN LETTER DHALETH;Lo;0;R;;;;;N;;;;; 10A7A;OLD SOUTH ARABIAN LETTER YODH;Lo;0;R;;;;;N;;;;; 10A7B;OLD SOUTH ARABIAN LETTER THAW;Lo;0;R;;;;;N;;;;; 10A7C;OLD SOUTH ARABIAN LETTER THETH;Lo;0;R;;;;;N;;;;; 10A7D;OLD SOUTH ARABIAN NUMBER ONE;No;0;R;;;;1;N;;;;; 10A7E;OLD SOUTH ARABIAN NUMBER FIFTY;No;0;R;;;;50;N;;;;; 10A7F;OLD SOUTH ARABIAN NUMERIC INDICATOR;Po;0;R;;;;;N;;;;; 10B00;AVESTAN LETTER A;Lo;0;R;;;;;N;;;;; 10B01;AVESTAN LETTER AA;Lo;0;R;;;;;N;;;;; 10B02;AVESTAN LETTER AO;Lo;0;R;;;;;N;;;;; 10B03;AVESTAN LETTER AAO;Lo;0;R;;;;;N;;;;; 10B04;AVESTAN LETTER AN;Lo;0;R;;;;;N;;;;; 10B05;AVESTAN LETTER AAN;Lo;0;R;;;;;N;;;;; 10B06;AVESTAN LETTER AE;Lo;0;R;;;;;N;;;;; 10B07;AVESTAN LETTER AEE;Lo;0;R;;;;;N;;;;; 10B08;AVESTAN LETTER E;Lo;0;R;;;;;N;;;;; 10B09;AVESTAN LETTER EE;Lo;0;R;;;;;N;;;;; 10B0A;AVESTAN LETTER O;Lo;0;R;;;;;N;;;;; 10B0B;AVESTAN LETTER OO;Lo;0;R;;;;;N;;;;; 10B0C;AVESTAN LETTER I;Lo;0;R;;;;;N;;;;; 10B0D;AVESTAN LETTER II;Lo;0;R;;;;;N;;;;; 10B0E;AVESTAN LETTER U;Lo;0;R;;;;;N;;;;; 10B0F;AVESTAN LETTER UU;Lo;0;R;;;;;N;;;;; 10B10;AVESTAN LETTER KE;Lo;0;R;;;;;N;;;;; 10B11;AVESTAN LETTER XE;Lo;0;R;;;;;N;;;;; 10B12;AVESTAN LETTER XYE;Lo;0;R;;;;;N;;;;; 10B13;AVESTAN LETTER XVE;Lo;0;R;;;;;N;;;;; 10B14;AVESTAN LETTER GE;Lo;0;R;;;;;N;;;;; 10B15;AVESTAN LETTER GGE;Lo;0;R;;;;;N;;;;; 10B16;AVESTAN LETTER GHE;Lo;0;R;;;;;N;;;;; 10B17;AVESTAN LETTER CE;Lo;0;R;;;;;N;;;;; 10B18;AVESTAN LETTER JE;Lo;0;R;;;;;N;;;;; 10B19;AVESTAN LETTER TE;Lo;0;R;;;;;N;;;;; 10B1A;AVESTAN LETTER THE;Lo;0;R;;;;;N;;;;; 10B1B;AVESTAN LETTER DE;Lo;0;R;;;;;N;;;;; 10B1C;AVESTAN LETTER DHE;Lo;0;R;;;;;N;;;;; 10B1D;AVESTAN LETTER TTE;Lo;0;R;;;;;N;;;;; 10B1E;AVESTAN LETTER PE;Lo;0;R;;;;;N;;;;; 10B1F;AVESTAN LETTER FE;Lo;0;R;;;;;N;;;;; 10B20;AVESTAN LETTER BE;Lo;0;R;;;;;N;;;;; 10B21;AVESTAN LETTER BHE;Lo;0;R;;;;;N;;;;; 10B22;AVESTAN LETTER NGE;Lo;0;R;;;;;N;;;;; 10B23;AVESTAN LETTER NGYE;Lo;0;R;;;;;N;;;;; 10B24;AVESTAN LETTER NGVE;Lo;0;R;;;;;N;;;;; 10B25;AVESTAN LETTER NE;Lo;0;R;;;;;N;;;;; 10B26;AVESTAN LETTER NYE;Lo;0;R;;;;;N;;;;; 10B27;AVESTAN LETTER NNE;Lo;0;R;;;;;N;;;;; 10B28;AVESTAN LETTER ME;Lo;0;R;;;;;N;;;;; 10B29;AVESTAN LETTER HME;Lo;0;R;;;;;N;;;;; 10B2A;AVESTAN LETTER YYE;Lo;0;R;;;;;N;;;;; 10B2B;AVESTAN LETTER YE;Lo;0;R;;;;;N;;;;; 10B2C;AVESTAN LETTER VE;Lo;0;R;;;;;N;;;;; 10B2D;AVESTAN LETTER RE;Lo;0;R;;;;;N;;;;; 10B2E;AVESTAN LETTER LE;Lo;0;R;;;;;N;;;;; 10B2F;AVESTAN LETTER SE;Lo;0;R;;;;;N;;;;; 10B30;AVESTAN LETTER ZE;Lo;0;R;;;;;N;;;;; 10B31;AVESTAN LETTER SHE;Lo;0;R;;;;;N;;;;; 10B32;AVESTAN LETTER ZHE;Lo;0;R;;;;;N;;;;; 10B33;AVESTAN LETTER SHYE;Lo;0;R;;;;;N;;;;; 10B34;AVESTAN LETTER SSHE;Lo;0;R;;;;;N;;;;; 10B35;AVESTAN LETTER HE;Lo;0;R;;;;;N;;;;; 10B39;AVESTAN ABBREVIATION MARK;Po;0;ON;;;;;N;;;;; 10B3A;TINY TWO DOTS OVER ONE DOT PUNCTUATION;Po;0;ON;;;;;N;;;;; 10B3B;SMALL TWO DOTS OVER ONE DOT PUNCTUATION;Po;0;ON;;;;;N;;;;; 10B3C;LARGE TWO DOTS OVER ONE DOT PUNCTUATION;Po;0;ON;;;;;N;;;;; 10B3D;LARGE ONE DOT OVER TWO DOTS PUNCTUATION;Po;0;ON;;;;;N;;;;; 10B3E;LARGE TWO RINGS OVER ONE RING PUNCTUATION;Po;0;ON;;;;;N;;;;; 10B3F;LARGE ONE RING OVER TWO RINGS PUNCTUATION;Po;0;ON;;;;;N;;;;; 10B40;INSCRIPTIONAL PARTHIAN LETTER ALEPH;Lo;0;R;;;;;N;;;;; 10B41;INSCRIPTIONAL PARTHIAN LETTER BETH;Lo;0;R;;;;;N;;;;; 10B42;INSCRIPTIONAL PARTHIAN LETTER GIMEL;Lo;0;R;;;;;N;;;;; 10B43;INSCRIPTIONAL PARTHIAN LETTER DALETH;Lo;0;R;;;;;N;;;;; 10B44;INSCRIPTIONAL PARTHIAN LETTER HE;Lo;0;R;;;;;N;;;;; 10B45;INSCRIPTIONAL PARTHIAN LETTER WAW;Lo;0;R;;;;;N;;;;; 10B46;INSCRIPTIONAL PARTHIAN LETTER ZAYIN;Lo;0;R;;;;;N;;;;; 10B47;INSCRIPTIONAL PARTHIAN LETTER HETH;Lo;0;R;;;;;N;;;;; 10B48;INSCRIPTIONAL PARTHIAN LETTER TETH;Lo;0;R;;;;;N;;;;; 10B49;INSCRIPTIONAL PARTHIAN LETTER YODH;Lo;0;R;;;;;N;;;;; 10B4A;INSCRIPTIONAL PARTHIAN LETTER KAPH;Lo;0;R;;;;;N;;;;; 10B4B;INSCRIPTIONAL PARTHIAN LETTER LAMEDH;Lo;0;R;;;;;N;;;;; 10B4C;INSCRIPTIONAL PARTHIAN LETTER MEM;Lo;0;R;;;;;N;;;;; 10B4D;INSCRIPTIONAL PARTHIAN LETTER NUN;Lo;0;R;;;;;N;;;;; 10B4E;INSCRIPTIONAL PARTHIAN LETTER SAMEKH;Lo;0;R;;;;;N;;;;; 10B4F;INSCRIPTIONAL PARTHIAN LETTER AYIN;Lo;0;R;;;;;N;;;;; 10B50;INSCRIPTIONAL PARTHIAN LETTER PE;Lo;0;R;;;;;N;;;;; 10B51;INSCRIPTIONAL PARTHIAN LETTER SADHE;Lo;0;R;;;;;N;;;;; 10B52;INSCRIPTIONAL PARTHIAN LETTER QOPH;Lo;0;R;;;;;N;;;;; 10B53;INSCRIPTIONAL PARTHIAN LETTER RESH;Lo;0;R;;;;;N;;;;; 10B54;INSCRIPTIONAL PARTHIAN LETTER SHIN;Lo;0;R;;;;;N;;;;; 10B55;INSCRIPTIONAL PARTHIAN LETTER TAW;Lo;0;R;;;;;N;;;;; 10B58;INSCRIPTIONAL PARTHIAN NUMBER ONE;No;0;R;;;;1;N;;;;; 10B59;INSCRIPTIONAL PARTHIAN NUMBER TWO;No;0;R;;;;2;N;;;;; 10B5A;INSCRIPTIONAL PARTHIAN NUMBER THREE;No;0;R;;;;3;N;;;;; 10B5B;INSCRIPTIONAL PARTHIAN NUMBER FOUR;No;0;R;;;;4;N;;;;; 10B5C;INSCRIPTIONAL PARTHIAN NUMBER TEN;No;0;R;;;;10;N;;;;; 10B5D;INSCRIPTIONAL PARTHIAN NUMBER TWENTY;No;0;R;;;;20;N;;;;; 10B5E;INSCRIPTIONAL PARTHIAN NUMBER ONE HUNDRED;No;0;R;;;;100;N;;;;; 10B5F;INSCRIPTIONAL PARTHIAN NUMBER ONE THOUSAND;No;0;R;;;;1000;N;;;;; 10B60;INSCRIPTIONAL PAHLAVI LETTER ALEPH;Lo;0;R;;;;;N;;;;; 10B61;INSCRIPTIONAL PAHLAVI LETTER BETH;Lo;0;R;;;;;N;;;;; 10B62;INSCRIPTIONAL PAHLAVI LETTER GIMEL;Lo;0;R;;;;;N;;;;; 10B63;INSCRIPTIONAL PAHLAVI LETTER DALETH;Lo;0;R;;;;;N;;;;; 10B64;INSCRIPTIONAL PAHLAVI LETTER HE;Lo;0;R;;;;;N;;;;; 10B65;INSCRIPTIONAL PAHLAVI LETTER WAW-AYIN-RESH;Lo;0;R;;;;;N;;;;; 10B66;INSCRIPTIONAL PAHLAVI LETTER ZAYIN;Lo;0;R;;;;;N;;;;; 10B67;INSCRIPTIONAL PAHLAVI LETTER HETH;Lo;0;R;;;;;N;;;;; 10B68;INSCRIPTIONAL PAHLAVI LETTER TETH;Lo;0;R;;;;;N;;;;; 10B69;INSCRIPTIONAL PAHLAVI LETTER YODH;Lo;0;R;;;;;N;;;;; 10B6A;INSCRIPTIONAL PAHLAVI LETTER KAPH;Lo;0;R;;;;;N;;;;; 10B6B;INSCRIPTIONAL PAHLAVI LETTER LAMEDH;Lo;0;R;;;;;N;;;;; 10B6C;INSCRIPTIONAL PAHLAVI LETTER MEM-QOPH;Lo;0;R;;;;;N;;;;; 10B6D;INSCRIPTIONAL PAHLAVI LETTER NUN;Lo;0;R;;;;;N;;;;; 10B6E;INSCRIPTIONAL PAHLAVI LETTER SAMEKH;Lo;0;R;;;;;N;;;;; 10B6F;INSCRIPTIONAL PAHLAVI LETTER PE;Lo;0;R;;;;;N;;;;; 10B70;INSCRIPTIONAL PAHLAVI LETTER SADHE;Lo;0;R;;;;;N;;;;; 10B71;INSCRIPTIONAL PAHLAVI LETTER SHIN;Lo;0;R;;;;;N;;;;; 10B72;INSCRIPTIONAL PAHLAVI LETTER TAW;Lo;0;R;;;;;N;;;;; 10B78;INSCRIPTIONAL PAHLAVI NUMBER ONE;No;0;R;;;;1;N;;;;; 10B79;INSCRIPTIONAL PAHLAVI NUMBER TWO;No;0;R;;;;2;N;;;;; 10B7A;INSCRIPTIONAL PAHLAVI NUMBER THREE;No;0;R;;;;3;N;;;;; 10B7B;INSCRIPTIONAL PAHLAVI NUMBER FOUR;No;0;R;;;;4;N;;;;; 10B7C;INSCRIPTIONAL PAHLAVI NUMBER TEN;No;0;R;;;;10;N;;;;; 10B7D;INSCRIPTIONAL PAHLAVI NUMBER TWENTY;No;0;R;;;;20;N;;;;; 10B7E;INSCRIPTIONAL PAHLAVI NUMBER ONE HUNDRED;No;0;R;;;;100;N;;;;; 10B7F;INSCRIPTIONAL PAHLAVI NUMBER ONE THOUSAND;No;0;R;;;;1000;N;;;;; 10C00;OLD TURKIC LETTER ORKHON A;Lo;0;R;;;;;N;;;;; 10C01;OLD TURKIC LETTER YENISEI A;Lo;0;R;;;;;N;;;;; 10C02;OLD TURKIC LETTER YENISEI AE;Lo;0;R;;;;;N;;;;; 10C03;OLD TURKIC LETTER ORKHON I;Lo;0;R;;;;;N;;;;; 10C04;OLD TURKIC LETTER YENISEI I;Lo;0;R;;;;;N;;;;; 10C05;OLD TURKIC LETTER YENISEI E;Lo;0;R;;;;;N;;;;; 10C06;OLD TURKIC LETTER ORKHON O;Lo;0;R;;;;;N;;;;; 10C07;OLD TURKIC LETTER ORKHON OE;Lo;0;R;;;;;N;;;;; 10C08;OLD TURKIC LETTER YENISEI OE;Lo;0;R;;;;;N;;;;; 10C09;OLD TURKIC LETTER ORKHON AB;Lo;0;R;;;;;N;;;;; 10C0A;OLD TURKIC LETTER YENISEI AB;Lo;0;R;;;;;N;;;;; 10C0B;OLD TURKIC LETTER ORKHON AEB;Lo;0;R;;;;;N;;;;; 10C0C;OLD TURKIC LETTER YENISEI AEB;Lo;0;R;;;;;N;;;;; 10C0D;OLD TURKIC LETTER ORKHON AG;Lo;0;R;;;;;N;;;;; 10C0E;OLD TURKIC LETTER YENISEI AG;Lo;0;R;;;;;N;;;;; 10C0F;OLD TURKIC LETTER ORKHON AEG;Lo;0;R;;;;;N;;;;; 10C10;OLD TURKIC LETTER YENISEI AEG;Lo;0;R;;;;;N;;;;; 10C11;OLD TURKIC LETTER ORKHON AD;Lo;0;R;;;;;N;;;;; 10C12;OLD TURKIC LETTER YENISEI AD;Lo;0;R;;;;;N;;;;; 10C13;OLD TURKIC LETTER ORKHON AED;Lo;0;R;;;;;N;;;;; 10C14;OLD TURKIC LETTER ORKHON EZ;Lo;0;R;;;;;N;;;;; 10C15;OLD TURKIC LETTER YENISEI EZ;Lo;0;R;;;;;N;;;;; 10C16;OLD TURKIC LETTER ORKHON AY;Lo;0;R;;;;;N;;;;; 10C17;OLD TURKIC LETTER YENISEI AY;Lo;0;R;;;;;N;;;;; 10C18;OLD TURKIC LETTER ORKHON AEY;Lo;0;R;;;;;N;;;;; 10C19;OLD TURKIC LETTER YENISEI AEY;Lo;0;R;;;;;N;;;;; 10C1A;OLD TURKIC LETTER ORKHON AEK;Lo;0;R;;;;;N;;;;; 10C1B;OLD TURKIC LETTER YENISEI AEK;Lo;0;R;;;;;N;;;;; 10C1C;OLD TURKIC LETTER ORKHON OEK;Lo;0;R;;;;;N;;;;; 10C1D;OLD TURKIC LETTER YENISEI OEK;Lo;0;R;;;;;N;;;;; 10C1E;OLD TURKIC LETTER ORKHON AL;Lo;0;R;;;;;N;;;;; 10C1F;OLD TURKIC LETTER YENISEI AL;Lo;0;R;;;;;N;;;;; 10C20;OLD TURKIC LETTER ORKHON AEL;Lo;0;R;;;;;N;;;;; 10C21;OLD TURKIC LETTER ORKHON ELT;Lo;0;R;;;;;N;;;;; 10C22;OLD TURKIC LETTER ORKHON EM;Lo;0;R;;;;;N;;;;; 10C23;OLD TURKIC LETTER ORKHON AN;Lo;0;R;;;;;N;;;;; 10C24;OLD TURKIC LETTER ORKHON AEN;Lo;0;R;;;;;N;;;;; 10C25;OLD TURKIC LETTER YENISEI AEN;Lo;0;R;;;;;N;;;;; 10C26;OLD TURKIC LETTER ORKHON ENT;Lo;0;R;;;;;N;;;;; 10C27;OLD TURKIC LETTER YENISEI ENT;Lo;0;R;;;;;N;;;;; 10C28;OLD TURKIC LETTER ORKHON ENC;Lo;0;R;;;;;N;;;;; 10C29;OLD TURKIC LETTER YENISEI ENC;Lo;0;R;;;;;N;;;;; 10C2A;OLD TURKIC LETTER ORKHON ENY;Lo;0;R;;;;;N;;;;; 10C2B;OLD TURKIC LETTER YENISEI ENY;Lo;0;R;;;;;N;;;;; 10C2C;OLD TURKIC LETTER YENISEI ANG;Lo;0;R;;;;;N;;;;; 10C2D;OLD TURKIC LETTER ORKHON ENG;Lo;0;R;;;;;N;;;;; 10C2E;OLD TURKIC LETTER YENISEI AENG;Lo;0;R;;;;;N;;;;; 10C2F;OLD TURKIC LETTER ORKHON EP;Lo;0;R;;;;;N;;;;; 10C30;OLD TURKIC LETTER ORKHON OP;Lo;0;R;;;;;N;;;;; 10C31;OLD TURKIC LETTER ORKHON IC;Lo;0;R;;;;;N;;;;; 10C32;OLD TURKIC LETTER ORKHON EC;Lo;0;R;;;;;N;;;;; 10C33;OLD TURKIC LETTER YENISEI EC;Lo;0;R;;;;;N;;;;; 10C34;OLD TURKIC LETTER ORKHON AQ;Lo;0;R;;;;;N;;;;; 10C35;OLD TURKIC LETTER YENISEI AQ;Lo;0;R;;;;;N;;;;; 10C36;OLD TURKIC LETTER ORKHON IQ;Lo;0;R;;;;;N;;;;; 10C37;OLD TURKIC LETTER YENISEI IQ;Lo;0;R;;;;;N;;;;; 10C38;OLD TURKIC LETTER ORKHON OQ;Lo;0;R;;;;;N;;;;; 10C39;OLD TURKIC LETTER YENISEI OQ;Lo;0;R;;;;;N;;;;; 10C3A;OLD TURKIC LETTER ORKHON AR;Lo;0;R;;;;;N;;;;; 10C3B;OLD TURKIC LETTER YENISEI AR;Lo;0;R;;;;;N;;;;; 10C3C;OLD TURKIC LETTER ORKHON AER;Lo;0;R;;;;;N;;;;; 10C3D;OLD TURKIC LETTER ORKHON AS;Lo;0;R;;;;;N;;;;; 10C3E;OLD TURKIC LETTER ORKHON AES;Lo;0;R;;;;;N;;;;; 10C3F;OLD TURKIC LETTER ORKHON ASH;Lo;0;R;;;;;N;;;;; 10C40;OLD TURKIC LETTER YENISEI ASH;Lo;0;R;;;;;N;;;;; 10C41;OLD TURKIC LETTER ORKHON ESH;Lo;0;R;;;;;N;;;;; 10C42;OLD TURKIC LETTER YENISEI ESH;Lo;0;R;;;;;N;;;;; 10C43;OLD TURKIC LETTER ORKHON AT;Lo;0;R;;;;;N;;;;; 10C44;OLD TURKIC LETTER YENISEI AT;Lo;0;R;;;;;N;;;;; 10C45;OLD TURKIC LETTER ORKHON AET;Lo;0;R;;;;;N;;;;; 10C46;OLD TURKIC LETTER YENISEI AET;Lo;0;R;;;;;N;;;;; 10C47;OLD TURKIC LETTER ORKHON OT;Lo;0;R;;;;;N;;;;; 10C48;OLD TURKIC LETTER ORKHON BASH;Lo;0;R;;;;;N;;;;; 10E60;RUMI DIGIT ONE;No;0;AN;;;1;1;N;;;;; 10E61;RUMI DIGIT TWO;No;0;AN;;;2;2;N;;;;; 10E62;RUMI DIGIT THREE;No;0;AN;;;3;3;N;;;;; 10E63;RUMI DIGIT FOUR;No;0;AN;;;4;4;N;;;;; 10E64;RUMI DIGIT FIVE;No;0;AN;;;5;5;N;;;;; 10E65;RUMI DIGIT SIX;No;0;AN;;;6;6;N;;;;; 10E66;RUMI DIGIT SEVEN;No;0;AN;;;7;7;N;;;;; 10E67;RUMI DIGIT EIGHT;No;0;AN;;;8;8;N;;;;; 10E68;RUMI DIGIT NINE;No;0;AN;;;9;9;N;;;;; 10E69;RUMI NUMBER TEN;No;0;AN;;;;10;N;;;;; 10E6A;RUMI NUMBER TWENTY;No;0;AN;;;;20;N;;;;; 10E6B;RUMI NUMBER THIRTY;No;0;AN;;;;30;N;;;;; 10E6C;RUMI NUMBER FORTY;No;0;AN;;;;40;N;;;;; 10E6D;RUMI NUMBER FIFTY;No;0;AN;;;;50;N;;;;; 10E6E;RUMI NUMBER SIXTY;No;0;AN;;;;60;N;;;;; 10E6F;RUMI NUMBER SEVENTY;No;0;AN;;;;70;N;;;;; 10E70;RUMI NUMBER EIGHTY;No;0;AN;;;;80;N;;;;; 10E71;RUMI NUMBER NINETY;No;0;AN;;;;90;N;;;;; 10E72;RUMI NUMBER ONE HUNDRED;No;0;AN;;;;100;N;;;;; 10E73;RUMI NUMBER TWO HUNDRED;No;0;AN;;;;200;N;;;;; 10E74;RUMI NUMBER THREE HUNDRED;No;0;AN;;;;300;N;;;;; 10E75;RUMI NUMBER FOUR HUNDRED;No;0;AN;;;;400;N;;;;; 10E76;RUMI NUMBER FIVE HUNDRED;No;0;AN;;;;500;N;;;;; 10E77;RUMI NUMBER SIX HUNDRED;No;0;AN;;;;600;N;;;;; 10E78;RUMI NUMBER SEVEN HUNDRED;No;0;AN;;;;700;N;;;;; 10E79;RUMI NUMBER EIGHT HUNDRED;No;0;AN;;;;800;N;;;;; 10E7A;RUMI NUMBER NINE HUNDRED;No;0;AN;;;;900;N;;;;; 10E7B;RUMI FRACTION ONE HALF;No;0;AN;;;;1/2;N;;;;; 10E7C;RUMI FRACTION ONE QUARTER;No;0;AN;;;;1/4;N;;;;; 10E7D;RUMI FRACTION ONE THIRD;No;0;AN;;;;1/3;N;;;;; 10E7E;RUMI FRACTION TWO THIRDS;No;0;AN;;;;2/3;N;;;;; 11000;BRAHMI SIGN CANDRABINDU;Mc;0;L;;;;;N;;;;; 11001;BRAHMI SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; 11002;BRAHMI SIGN VISARGA;Mc;0;L;;;;;N;;;;; 11003;BRAHMI SIGN JIHVAMULIYA;Lo;0;L;;;;;N;;;;; 11004;BRAHMI SIGN UPADHMANIYA;Lo;0;L;;;;;N;;;;; 11005;BRAHMI LETTER A;Lo;0;L;;;;;N;;;;; 11006;BRAHMI LETTER AA;Lo;0;L;;;;;N;;;;; 11007;BRAHMI LETTER I;Lo;0;L;;;;;N;;;;; 11008;BRAHMI LETTER II;Lo;0;L;;;;;N;;;;; 11009;BRAHMI LETTER U;Lo;0;L;;;;;N;;;;; 1100A;BRAHMI LETTER UU;Lo;0;L;;;;;N;;;;; 1100B;BRAHMI LETTER VOCALIC R;Lo;0;L;;;;;N;;;;; 1100C;BRAHMI LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; 1100D;BRAHMI LETTER VOCALIC L;Lo;0;L;;;;;N;;;;; 1100E;BRAHMI LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;; 1100F;BRAHMI LETTER E;Lo;0;L;;;;;N;;;;; 11010;BRAHMI LETTER AI;Lo;0;L;;;;;N;;;;; 11011;BRAHMI LETTER O;Lo;0;L;;;;;N;;;;; 11012;BRAHMI LETTER AU;Lo;0;L;;;;;N;;;;; 11013;BRAHMI LETTER KA;Lo;0;L;;;;;N;;;;; 11014;BRAHMI LETTER KHA;Lo;0;L;;;;;N;;;;; 11015;BRAHMI LETTER GA;Lo;0;L;;;;;N;;;;; 11016;BRAHMI LETTER GHA;Lo;0;L;;;;;N;;;;; 11017;BRAHMI LETTER NGA;Lo;0;L;;;;;N;;;;; 11018;BRAHMI LETTER CA;Lo;0;L;;;;;N;;;;; 11019;BRAHMI LETTER CHA;Lo;0;L;;;;;N;;;;; 1101A;BRAHMI LETTER JA;Lo;0;L;;;;;N;;;;; 1101B;BRAHMI LETTER JHA;Lo;0;L;;;;;N;;;;; 1101C;BRAHMI LETTER NYA;Lo;0;L;;;;;N;;;;; 1101D;BRAHMI LETTER TTA;Lo;0;L;;;;;N;;;;; 1101E;BRAHMI LETTER TTHA;Lo;0;L;;;;;N;;;;; 1101F;BRAHMI LETTER DDA;Lo;0;L;;;;;N;;;;; 11020;BRAHMI LETTER DDHA;Lo;0;L;;;;;N;;;;; 11021;BRAHMI LETTER NNA;Lo;0;L;;;;;N;;;;; 11022;BRAHMI LETTER TA;Lo;0;L;;;;;N;;;;; 11023;BRAHMI LETTER THA;Lo;0;L;;;;;N;;;;; 11024;BRAHMI LETTER DA;Lo;0;L;;;;;N;;;;; 11025;BRAHMI LETTER DHA;Lo;0;L;;;;;N;;;;; 11026;BRAHMI LETTER NA;Lo;0;L;;;;;N;;;;; 11027;BRAHMI LETTER PA;Lo;0;L;;;;;N;;;;; 11028;BRAHMI LETTER PHA;Lo;0;L;;;;;N;;;;; 11029;BRAHMI LETTER BA;Lo;0;L;;;;;N;;;;; 1102A;BRAHMI LETTER BHA;Lo;0;L;;;;;N;;;;; 1102B;BRAHMI LETTER MA;Lo;0;L;;;;;N;;;;; 1102C;BRAHMI LETTER YA;Lo;0;L;;;;;N;;;;; 1102D;BRAHMI LETTER RA;Lo;0;L;;;;;N;;;;; 1102E;BRAHMI LETTER LA;Lo;0;L;;;;;N;;;;; 1102F;BRAHMI LETTER VA;Lo;0;L;;;;;N;;;;; 11030;BRAHMI LETTER SHA;Lo;0;L;;;;;N;;;;; 11031;BRAHMI LETTER SSA;Lo;0;L;;;;;N;;;;; 11032;BRAHMI LETTER SA;Lo;0;L;;;;;N;;;;; 11033;BRAHMI LETTER HA;Lo;0;L;;;;;N;;;;; 11034;BRAHMI LETTER LLA;Lo;0;L;;;;;N;;;;; 11035;BRAHMI LETTER OLD TAMIL LLLA;Lo;0;L;;;;;N;;;;; 11036;BRAHMI LETTER OLD TAMIL RRA;Lo;0;L;;;;;N;;;;; 11037;BRAHMI LETTER OLD TAMIL NNNA;Lo;0;L;;;;;N;;;;; 11038;BRAHMI VOWEL SIGN AA;Mn;0;NSM;;;;;N;;;;; 11039;BRAHMI VOWEL SIGN BHATTIPROLU AA;Mn;0;NSM;;;;;N;;;;; 1103A;BRAHMI VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 1103B;BRAHMI VOWEL SIGN II;Mn;0;NSM;;;;;N;;;;; 1103C;BRAHMI VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 1103D;BRAHMI VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 1103E;BRAHMI VOWEL SIGN VOCALIC R;Mn;0;NSM;;;;;N;;;;; 1103F;BRAHMI VOWEL SIGN VOCALIC RR;Mn;0;NSM;;;;;N;;;;; 11040;BRAHMI VOWEL SIGN VOCALIC L;Mn;0;NSM;;;;;N;;;;; 11041;BRAHMI VOWEL SIGN VOCALIC LL;Mn;0;NSM;;;;;N;;;;; 11042;BRAHMI VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; 11043;BRAHMI VOWEL SIGN AI;Mn;0;NSM;;;;;N;;;;; 11044;BRAHMI VOWEL SIGN O;Mn;0;NSM;;;;;N;;;;; 11045;BRAHMI VOWEL SIGN AU;Mn;0;NSM;;;;;N;;;;; 11046;BRAHMI VIRAMA;Mn;9;NSM;;;;;N;;;;; 11047;BRAHMI DANDA;Po;0;L;;;;;N;;;;; 11048;BRAHMI DOUBLE DANDA;Po;0;L;;;;;N;;;;; 11049;BRAHMI PUNCTUATION DOT;Po;0;L;;;;;N;;;;; 1104A;BRAHMI PUNCTUATION DOUBLE DOT;Po;0;L;;;;;N;;;;; 1104B;BRAHMI PUNCTUATION LINE;Po;0;L;;;;;N;;;;; 1104C;BRAHMI PUNCTUATION CRESCENT BAR;Po;0;L;;;;;N;;;;; 1104D;BRAHMI PUNCTUATION LOTUS;Po;0;L;;;;;N;;;;; 11052;BRAHMI NUMBER ONE;No;0;ON;;;1;1;N;;;;; 11053;BRAHMI NUMBER TWO;No;0;ON;;;2;2;N;;;;; 11054;BRAHMI NUMBER THREE;No;0;ON;;;3;3;N;;;;; 11055;BRAHMI NUMBER FOUR;No;0;ON;;;4;4;N;;;;; 11056;BRAHMI NUMBER FIVE;No;0;ON;;;5;5;N;;;;; 11057;BRAHMI NUMBER SIX;No;0;ON;;;6;6;N;;;;; 11058;BRAHMI NUMBER SEVEN;No;0;ON;;;7;7;N;;;;; 11059;BRAHMI NUMBER EIGHT;No;0;ON;;;8;8;N;;;;; 1105A;BRAHMI NUMBER NINE;No;0;ON;;;9;9;N;;;;; 1105B;BRAHMI NUMBER TEN;No;0;ON;;;;10;N;;;;; 1105C;BRAHMI NUMBER TWENTY;No;0;ON;;;;20;N;;;;; 1105D;BRAHMI NUMBER THIRTY;No;0;ON;;;;30;N;;;;; 1105E;BRAHMI NUMBER FORTY;No;0;ON;;;;40;N;;;;; 1105F;BRAHMI NUMBER FIFTY;No;0;ON;;;;50;N;;;;; 11060;BRAHMI NUMBER SIXTY;No;0;ON;;;;60;N;;;;; 11061;BRAHMI NUMBER SEVENTY;No;0;ON;;;;70;N;;;;; 11062;BRAHMI NUMBER EIGHTY;No;0;ON;;;;80;N;;;;; 11063;BRAHMI NUMBER NINETY;No;0;ON;;;;90;N;;;;; 11064;BRAHMI NUMBER ONE HUNDRED;No;0;ON;;;;100;N;;;;; 11065;BRAHMI NUMBER ONE THOUSAND;No;0;ON;;;;1000;N;;;;; 11066;BRAHMI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 11067;BRAHMI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 11068;BRAHMI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 11069;BRAHMI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 1106A;BRAHMI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 1106B;BRAHMI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 1106C;BRAHMI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 1106D;BRAHMI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 1106E;BRAHMI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 1106F;BRAHMI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 11080;KAITHI SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;; 11081;KAITHI SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; 11082;KAITHI SIGN VISARGA;Mc;0;L;;;;;N;;;;; 11083;KAITHI LETTER A;Lo;0;L;;;;;N;;;;; 11084;KAITHI LETTER AA;Lo;0;L;;;;;N;;;;; 11085;KAITHI LETTER I;Lo;0;L;;;;;N;;;;; 11086;KAITHI LETTER II;Lo;0;L;;;;;N;;;;; 11087;KAITHI LETTER U;Lo;0;L;;;;;N;;;;; 11088;KAITHI LETTER UU;Lo;0;L;;;;;N;;;;; 11089;KAITHI LETTER E;Lo;0;L;;;;;N;;;;; 1108A;KAITHI LETTER AI;Lo;0;L;;;;;N;;;;; 1108B;KAITHI LETTER O;Lo;0;L;;;;;N;;;;; 1108C;KAITHI LETTER AU;Lo;0;L;;;;;N;;;;; 1108D;KAITHI LETTER KA;Lo;0;L;;;;;N;;;;; 1108E;KAITHI LETTER KHA;Lo;0;L;;;;;N;;;;; 1108F;KAITHI LETTER GA;Lo;0;L;;;;;N;;;;; 11090;KAITHI LETTER GHA;Lo;0;L;;;;;N;;;;; 11091;KAITHI LETTER NGA;Lo;0;L;;;;;N;;;;; 11092;KAITHI LETTER CA;Lo;0;L;;;;;N;;;;; 11093;KAITHI LETTER CHA;Lo;0;L;;;;;N;;;;; 11094;KAITHI LETTER JA;Lo;0;L;;;;;N;;;;; 11095;KAITHI LETTER JHA;Lo;0;L;;;;;N;;;;; 11096;KAITHI LETTER NYA;Lo;0;L;;;;;N;;;;; 11097;KAITHI LETTER TTA;Lo;0;L;;;;;N;;;;; 11098;KAITHI LETTER TTHA;Lo;0;L;;;;;N;;;;; 11099;KAITHI LETTER DDA;Lo;0;L;;;;;N;;;;; 1109A;KAITHI LETTER DDDHA;Lo;0;L;11099 110BA;;;;N;;;;; 1109B;KAITHI LETTER DDHA;Lo;0;L;;;;;N;;;;; 1109C;KAITHI LETTER RHA;Lo;0;L;1109B 110BA;;;;N;;;;; 1109D;KAITHI LETTER NNA;Lo;0;L;;;;;N;;;;; 1109E;KAITHI LETTER TA;Lo;0;L;;;;;N;;;;; 1109F;KAITHI LETTER THA;Lo;0;L;;;;;N;;;;; 110A0;KAITHI LETTER DA;Lo;0;L;;;;;N;;;;; 110A1;KAITHI LETTER DHA;Lo;0;L;;;;;N;;;;; 110A2;KAITHI LETTER NA;Lo;0;L;;;;;N;;;;; 110A3;KAITHI LETTER PA;Lo;0;L;;;;;N;;;;; 110A4;KAITHI LETTER PHA;Lo;0;L;;;;;N;;;;; 110A5;KAITHI LETTER BA;Lo;0;L;;;;;N;;;;; 110A6;KAITHI LETTER BHA;Lo;0;L;;;;;N;;;;; 110A7;KAITHI LETTER MA;Lo;0;L;;;;;N;;;;; 110A8;KAITHI LETTER YA;Lo;0;L;;;;;N;;;;; 110A9;KAITHI LETTER RA;Lo;0;L;;;;;N;;;;; 110AA;KAITHI LETTER LA;Lo;0;L;;;;;N;;;;; 110AB;KAITHI LETTER VA;Lo;0;L;110A5 110BA;;;;N;;;;; 110AC;KAITHI LETTER SHA;Lo;0;L;;;;;N;;;;; 110AD;KAITHI LETTER SSA;Lo;0;L;;;;;N;;;;; 110AE;KAITHI LETTER SA;Lo;0;L;;;;;N;;;;; 110AF;KAITHI LETTER HA;Lo;0;L;;;;;N;;;;; 110B0;KAITHI VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 110B1;KAITHI VOWEL SIGN I;Mc;0;L;;;;;N;;;;; 110B2;KAITHI VOWEL SIGN II;Mc;0;L;;;;;N;;;;; 110B3;KAITHI VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 110B4;KAITHI VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 110B5;KAITHI VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; 110B6;KAITHI VOWEL SIGN AI;Mn;0;NSM;;;;;N;;;;; 110B7;KAITHI VOWEL SIGN O;Mc;0;L;;;;;N;;;;; 110B8;KAITHI VOWEL SIGN AU;Mc;0;L;;;;;N;;;;; 110B9;KAITHI SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 110BA;KAITHI SIGN NUKTA;Mn;7;NSM;;;;;N;;;;; 110BB;KAITHI ABBREVIATION SIGN;Po;0;L;;;;;N;;;;; 110BC;KAITHI ENUMERATION SIGN;Po;0;L;;;;;N;;;;; 110BD;KAITHI NUMBER SIGN;Cf;0;L;;;;;N;;;;; 110BE;KAITHI SECTION MARK;Po;0;L;;;;;N;;;;; 110BF;KAITHI DOUBLE SECTION MARK;Po;0;L;;;;;N;;;;; 110C0;KAITHI DANDA;Po;0;L;;;;;N;;;;; 110C1;KAITHI DOUBLE DANDA;Po;0;L;;;;;N;;;;; 110D0;SORA SOMPENG LETTER SAH;Lo;0;L;;;;;N;;;;; 110D1;SORA SOMPENG LETTER TAH;Lo;0;L;;;;;N;;;;; 110D2;SORA SOMPENG LETTER BAH;Lo;0;L;;;;;N;;;;; 110D3;SORA SOMPENG LETTER CAH;Lo;0;L;;;;;N;;;;; 110D4;SORA SOMPENG LETTER DAH;Lo;0;L;;;;;N;;;;; 110D5;SORA SOMPENG LETTER GAH;Lo;0;L;;;;;N;;;;; 110D6;SORA SOMPENG LETTER MAH;Lo;0;L;;;;;N;;;;; 110D7;SORA SOMPENG LETTER NGAH;Lo;0;L;;;;;N;;;;; 110D8;SORA SOMPENG LETTER LAH;Lo;0;L;;;;;N;;;;; 110D9;SORA SOMPENG LETTER NAH;Lo;0;L;;;;;N;;;;; 110DA;SORA SOMPENG LETTER VAH;Lo;0;L;;;;;N;;;;; 110DB;SORA SOMPENG LETTER PAH;Lo;0;L;;;;;N;;;;; 110DC;SORA SOMPENG LETTER YAH;Lo;0;L;;;;;N;;;;; 110DD;SORA SOMPENG LETTER RAH;Lo;0;L;;;;;N;;;;; 110DE;SORA SOMPENG LETTER HAH;Lo;0;L;;;;;N;;;;; 110DF;SORA SOMPENG LETTER KAH;Lo;0;L;;;;;N;;;;; 110E0;SORA SOMPENG LETTER JAH;Lo;0;L;;;;;N;;;;; 110E1;SORA SOMPENG LETTER NYAH;Lo;0;L;;;;;N;;;;; 110E2;SORA SOMPENG LETTER AH;Lo;0;L;;;;;N;;;;; 110E3;SORA SOMPENG LETTER EEH;Lo;0;L;;;;;N;;;;; 110E4;SORA SOMPENG LETTER IH;Lo;0;L;;;;;N;;;;; 110E5;SORA SOMPENG LETTER UH;Lo;0;L;;;;;N;;;;; 110E6;SORA SOMPENG LETTER OH;Lo;0;L;;;;;N;;;;; 110E7;SORA SOMPENG LETTER EH;Lo;0;L;;;;;N;;;;; 110E8;SORA SOMPENG LETTER MAE;Lo;0;L;;;;;N;;;;; 110F0;SORA SOMPENG DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 110F1;SORA SOMPENG DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 110F2;SORA SOMPENG DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 110F3;SORA SOMPENG DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 110F4;SORA SOMPENG DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 110F5;SORA SOMPENG DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 110F6;SORA SOMPENG DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 110F7;SORA SOMPENG DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 110F8;SORA SOMPENG DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 110F9;SORA SOMPENG DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 11100;CHAKMA SIGN CANDRABINDU;Mn;230;NSM;;;;;N;;;;; 11101;CHAKMA SIGN ANUSVARA;Mn;230;NSM;;;;;N;;;;; 11102;CHAKMA SIGN VISARGA;Mn;230;NSM;;;;;N;;;;; 11103;CHAKMA LETTER AA;Lo;0;L;;;;;N;;;;; 11104;CHAKMA LETTER I;Lo;0;L;;;;;N;;;;; 11105;CHAKMA LETTER U;Lo;0;L;;;;;N;;;;; 11106;CHAKMA LETTER E;Lo;0;L;;;;;N;;;;; 11107;CHAKMA LETTER KAA;Lo;0;L;;;;;N;;;;; 11108;CHAKMA LETTER KHAA;Lo;0;L;;;;;N;;;;; 11109;CHAKMA LETTER GAA;Lo;0;L;;;;;N;;;;; 1110A;CHAKMA LETTER GHAA;Lo;0;L;;;;;N;;;;; 1110B;CHAKMA LETTER NGAA;Lo;0;L;;;;;N;;;;; 1110C;CHAKMA LETTER CAA;Lo;0;L;;;;;N;;;;; 1110D;CHAKMA LETTER CHAA;Lo;0;L;;;;;N;;;;; 1110E;CHAKMA LETTER JAA;Lo;0;L;;;;;N;;;;; 1110F;CHAKMA LETTER JHAA;Lo;0;L;;;;;N;;;;; 11110;CHAKMA LETTER NYAA;Lo;0;L;;;;;N;;;;; 11111;CHAKMA LETTER TTAA;Lo;0;L;;;;;N;;;;; 11112;CHAKMA LETTER TTHAA;Lo;0;L;;;;;N;;;;; 11113;CHAKMA LETTER DDAA;Lo;0;L;;;;;N;;;;; 11114;CHAKMA LETTER DDHAA;Lo;0;L;;;;;N;;;;; 11115;CHAKMA LETTER NNAA;Lo;0;L;;;;;N;;;;; 11116;CHAKMA LETTER TAA;Lo;0;L;;;;;N;;;;; 11117;CHAKMA LETTER THAA;Lo;0;L;;;;;N;;;;; 11118;CHAKMA LETTER DAA;Lo;0;L;;;;;N;;;;; 11119;CHAKMA LETTER DHAA;Lo;0;L;;;;;N;;;;; 1111A;CHAKMA LETTER NAA;Lo;0;L;;;;;N;;;;; 1111B;CHAKMA LETTER PAA;Lo;0;L;;;;;N;;;;; 1111C;CHAKMA LETTER PHAA;Lo;0;L;;;;;N;;;;; 1111D;CHAKMA LETTER BAA;Lo;0;L;;;;;N;;;;; 1111E;CHAKMA LETTER BHAA;Lo;0;L;;;;;N;;;;; 1111F;CHAKMA LETTER MAA;Lo;0;L;;;;;N;;;;; 11120;CHAKMA LETTER YYAA;Lo;0;L;;;;;N;;;;; 11121;CHAKMA LETTER YAA;Lo;0;L;;;;;N;;;;; 11122;CHAKMA LETTER RAA;Lo;0;L;;;;;N;;;;; 11123;CHAKMA LETTER LAA;Lo;0;L;;;;;N;;;;; 11124;CHAKMA LETTER WAA;Lo;0;L;;;;;N;;;;; 11125;CHAKMA LETTER SAA;Lo;0;L;;;;;N;;;;; 11126;CHAKMA LETTER HAA;Lo;0;L;;;;;N;;;;; 11127;CHAKMA VOWEL SIGN A;Mn;0;NSM;;;;;N;;;;; 11128;CHAKMA VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; 11129;CHAKMA VOWEL SIGN II;Mn;0;NSM;;;;;N;;;;; 1112A;CHAKMA VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 1112B;CHAKMA VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 1112C;CHAKMA VOWEL SIGN E;Mc;0;L;;;;;N;;;;; 1112D;CHAKMA VOWEL SIGN AI;Mn;0;NSM;;;;;N;;;;; 1112E;CHAKMA VOWEL SIGN O;Mn;0;NSM;11131 11127;;;;N;;;;; 1112F;CHAKMA VOWEL SIGN AU;Mn;0;NSM;11132 11127;;;;N;;;;; 11130;CHAKMA VOWEL SIGN OI;Mn;0;NSM;;;;;N;;;;; 11131;CHAKMA O MARK;Mn;0;NSM;;;;;N;;;;; 11132;CHAKMA AU MARK;Mn;0;NSM;;;;;N;;;;; 11133;CHAKMA VIRAMA;Mn;9;NSM;;;;;N;;;;; 11134;CHAKMA MAAYYAA;Mn;9;NSM;;;;;N;;;;; 11136;CHAKMA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 11137;CHAKMA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 11138;CHAKMA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 11139;CHAKMA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 1113A;CHAKMA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 1113B;CHAKMA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 1113C;CHAKMA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 1113D;CHAKMA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 1113E;CHAKMA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 1113F;CHAKMA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 11140;CHAKMA SECTION MARK;Po;0;L;;;;;N;;;;; 11141;CHAKMA DANDA;Po;0;L;;;;;N;;;;; 11142;CHAKMA DOUBLE DANDA;Po;0;L;;;;;N;;;;; 11143;CHAKMA QUESTION MARK;Po;0;L;;;;;N;;;;; 11180;SHARADA SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;; 11181;SHARADA SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; 11182;SHARADA SIGN VISARGA;Mc;0;L;;;;;N;;;;; 11183;SHARADA LETTER A;Lo;0;L;;;;;N;;;;; 11184;SHARADA LETTER AA;Lo;0;L;;;;;N;;;;; 11185;SHARADA LETTER I;Lo;0;L;;;;;N;;;;; 11186;SHARADA LETTER II;Lo;0;L;;;;;N;;;;; 11187;SHARADA LETTER U;Lo;0;L;;;;;N;;;;; 11188;SHARADA LETTER UU;Lo;0;L;;;;;N;;;;; 11189;SHARADA LETTER VOCALIC R;Lo;0;L;;;;;N;;;;; 1118A;SHARADA LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; 1118B;SHARADA LETTER VOCALIC L;Lo;0;L;;;;;N;;;;; 1118C;SHARADA LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;; 1118D;SHARADA LETTER E;Lo;0;L;;;;;N;;;;; 1118E;SHARADA LETTER AI;Lo;0;L;;;;;N;;;;; 1118F;SHARADA LETTER O;Lo;0;L;;;;;N;;;;; 11190;SHARADA LETTER AU;Lo;0;L;;;;;N;;;;; 11191;SHARADA LETTER KA;Lo;0;L;;;;;N;;;;; 11192;SHARADA LETTER KHA;Lo;0;L;;;;;N;;;;; 11193;SHARADA LETTER GA;Lo;0;L;;;;;N;;;;; 11194;SHARADA LETTER GHA;Lo;0;L;;;;;N;;;;; 11195;SHARADA LETTER NGA;Lo;0;L;;;;;N;;;;; 11196;SHARADA LETTER CA;Lo;0;L;;;;;N;;;;; 11197;SHARADA LETTER CHA;Lo;0;L;;;;;N;;;;; 11198;SHARADA LETTER JA;Lo;0;L;;;;;N;;;;; 11199;SHARADA LETTER JHA;Lo;0;L;;;;;N;;;;; 1119A;SHARADA LETTER NYA;Lo;0;L;;;;;N;;;;; 1119B;SHARADA LETTER TTA;Lo;0;L;;;;;N;;;;; 1119C;SHARADA LETTER TTHA;Lo;0;L;;;;;N;;;;; 1119D;SHARADA LETTER DDA;Lo;0;L;;;;;N;;;;; 1119E;SHARADA LETTER DDHA;Lo;0;L;;;;;N;;;;; 1119F;SHARADA LETTER NNA;Lo;0;L;;;;;N;;;;; 111A0;SHARADA LETTER TA;Lo;0;L;;;;;N;;;;; 111A1;SHARADA LETTER THA;Lo;0;L;;;;;N;;;;; 111A2;SHARADA LETTER DA;Lo;0;L;;;;;N;;;;; 111A3;SHARADA LETTER DHA;Lo;0;L;;;;;N;;;;; 111A4;SHARADA LETTER NA;Lo;0;L;;;;;N;;;;; 111A5;SHARADA LETTER PA;Lo;0;L;;;;;N;;;;; 111A6;SHARADA LETTER PHA;Lo;0;L;;;;;N;;;;; 111A7;SHARADA LETTER BA;Lo;0;L;;;;;N;;;;; 111A8;SHARADA LETTER BHA;Lo;0;L;;;;;N;;;;; 111A9;SHARADA LETTER MA;Lo;0;L;;;;;N;;;;; 111AA;SHARADA LETTER YA;Lo;0;L;;;;;N;;;;; 111AB;SHARADA LETTER RA;Lo;0;L;;;;;N;;;;; 111AC;SHARADA LETTER LA;Lo;0;L;;;;;N;;;;; 111AD;SHARADA LETTER LLA;Lo;0;L;;;;;N;;;;; 111AE;SHARADA LETTER VA;Lo;0;L;;;;;N;;;;; 111AF;SHARADA LETTER SHA;Lo;0;L;;;;;N;;;;; 111B0;SHARADA LETTER SSA;Lo;0;L;;;;;N;;;;; 111B1;SHARADA LETTER SA;Lo;0;L;;;;;N;;;;; 111B2;SHARADA LETTER HA;Lo;0;L;;;;;N;;;;; 111B3;SHARADA VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 111B4;SHARADA VOWEL SIGN I;Mc;0;L;;;;;N;;;;; 111B5;SHARADA VOWEL SIGN II;Mc;0;L;;;;;N;;;;; 111B6;SHARADA VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 111B7;SHARADA VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 111B8;SHARADA VOWEL SIGN VOCALIC R;Mn;0;NSM;;;;;N;;;;; 111B9;SHARADA VOWEL SIGN VOCALIC RR;Mn;0;NSM;;;;;N;;;;; 111BA;SHARADA VOWEL SIGN VOCALIC L;Mn;0;NSM;;;;;N;;;;; 111BB;SHARADA VOWEL SIGN VOCALIC LL;Mn;0;NSM;;;;;N;;;;; 111BC;SHARADA VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; 111BD;SHARADA VOWEL SIGN AI;Mn;0;NSM;;;;;N;;;;; 111BE;SHARADA VOWEL SIGN O;Mn;0;NSM;;;;;N;;;;; 111BF;SHARADA VOWEL SIGN AU;Mc;0;L;;;;;N;;;;; 111C0;SHARADA SIGN VIRAMA;Mc;9;L;;;;;N;;;;; 111C1;SHARADA SIGN AVAGRAHA;Lo;0;L;;;;;N;;;;; 111C2;SHARADA SIGN JIHVAMULIYA;Lo;0;L;;;;;N;;;;; 111C3;SHARADA SIGN UPADHMANIYA;Lo;0;L;;;;;N;;;;; 111C4;SHARADA OM;Lo;0;L;;;;;N;;;;; 111C5;SHARADA DANDA;Po;0;L;;;;;N;;;;; 111C6;SHARADA DOUBLE DANDA;Po;0;L;;;;;N;;;;; 111C7;SHARADA ABBREVIATION SIGN;Po;0;L;;;;;N;;;;; 111C8;SHARADA SEPARATOR;Po;0;L;;;;;N;;;;; 111D0;SHARADA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 111D1;SHARADA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 111D2;SHARADA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 111D3;SHARADA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 111D4;SHARADA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 111D5;SHARADA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 111D6;SHARADA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 111D7;SHARADA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 111D8;SHARADA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 111D9;SHARADA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 11680;TAKRI LETTER A;Lo;0;L;;;;;N;;;;; 11681;TAKRI LETTER AA;Lo;0;L;;;;;N;;;;; 11682;TAKRI LETTER I;Lo;0;L;;;;;N;;;;; 11683;TAKRI LETTER II;Lo;0;L;;;;;N;;;;; 11684;TAKRI LETTER U;Lo;0;L;;;;;N;;;;; 11685;TAKRI LETTER UU;Lo;0;L;;;;;N;;;;; 11686;TAKRI LETTER E;Lo;0;L;;;;;N;;;;; 11687;TAKRI LETTER AI;Lo;0;L;;;;;N;;;;; 11688;TAKRI LETTER O;Lo;0;L;;;;;N;;;;; 11689;TAKRI LETTER AU;Lo;0;L;;;;;N;;;;; 1168A;TAKRI LETTER KA;Lo;0;L;;;;;N;;;;; 1168B;TAKRI LETTER KHA;Lo;0;L;;;;;N;;;;; 1168C;TAKRI LETTER GA;Lo;0;L;;;;;N;;;;; 1168D;TAKRI LETTER GHA;Lo;0;L;;;;;N;;;;; 1168E;TAKRI LETTER NGA;Lo;0;L;;;;;N;;;;; 1168F;TAKRI LETTER CA;Lo;0;L;;;;;N;;;;; 11690;TAKRI LETTER CHA;Lo;0;L;;;;;N;;;;; 11691;TAKRI LETTER JA;Lo;0;L;;;;;N;;;;; 11692;TAKRI LETTER JHA;Lo;0;L;;;;;N;;;;; 11693;TAKRI LETTER NYA;Lo;0;L;;;;;N;;;;; 11694;TAKRI LETTER TTA;Lo;0;L;;;;;N;;;;; 11695;TAKRI LETTER TTHA;Lo;0;L;;;;;N;;;;; 11696;TAKRI LETTER DDA;Lo;0;L;;;;;N;;;;; 11697;TAKRI LETTER DDHA;Lo;0;L;;;;;N;;;;; 11698;TAKRI LETTER NNA;Lo;0;L;;;;;N;;;;; 11699;TAKRI LETTER TA;Lo;0;L;;;;;N;;;;; 1169A;TAKRI LETTER THA;Lo;0;L;;;;;N;;;;; 1169B;TAKRI LETTER DA;Lo;0;L;;;;;N;;;;; 1169C;TAKRI LETTER DHA;Lo;0;L;;;;;N;;;;; 1169D;TAKRI LETTER NA;Lo;0;L;;;;;N;;;;; 1169E;TAKRI LETTER PA;Lo;0;L;;;;;N;;;;; 1169F;TAKRI LETTER PHA;Lo;0;L;;;;;N;;;;; 116A0;TAKRI LETTER BA;Lo;0;L;;;;;N;;;;; 116A1;TAKRI LETTER BHA;Lo;0;L;;;;;N;;;;; 116A2;TAKRI LETTER MA;Lo;0;L;;;;;N;;;;; 116A3;TAKRI LETTER YA;Lo;0;L;;;;;N;;;;; 116A4;TAKRI LETTER RA;Lo;0;L;;;;;N;;;;; 116A5;TAKRI LETTER LA;Lo;0;L;;;;;N;;;;; 116A6;TAKRI LETTER VA;Lo;0;L;;;;;N;;;;; 116A7;TAKRI LETTER SHA;Lo;0;L;;;;;N;;;;; 116A8;TAKRI LETTER SA;Lo;0;L;;;;;N;;;;; 116A9;TAKRI LETTER HA;Lo;0;L;;;;;N;;;;; 116AA;TAKRI LETTER RRA;Lo;0;L;;;;;N;;;;; 116AB;TAKRI SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; 116AC;TAKRI SIGN VISARGA;Mc;0;L;;;;;N;;;;; 116AD;TAKRI VOWEL SIGN AA;Mn;0;NSM;;;;;N;;;;; 116AE;TAKRI VOWEL SIGN I;Mc;0;L;;;;;N;;;;; 116AF;TAKRI VOWEL SIGN II;Mc;0;L;;;;;N;;;;; 116B0;TAKRI VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; 116B1;TAKRI VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; 116B2;TAKRI VOWEL SIGN E;Mn;0;NSM;;;;;N;;;;; 116B3;TAKRI VOWEL SIGN AI;Mn;0;NSM;;;;;N;;;;; 116B4;TAKRI VOWEL SIGN O;Mn;0;NSM;;;;;N;;;;; 116B5;TAKRI VOWEL SIGN AU;Mn;0;NSM;;;;;N;;;;; 116B6;TAKRI SIGN VIRAMA;Mc;9;L;;;;;N;;;;; 116B7;TAKRI SIGN NUKTA;Mn;7;NSM;;;;;N;;;;; 116C0;TAKRI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 116C1;TAKRI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 116C2;TAKRI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; 116C3;TAKRI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; 116C4;TAKRI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; 116C5;TAKRI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; 116C6;TAKRI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; 116C7;TAKRI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 116C8;TAKRI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 116C9;TAKRI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 12000;CUNEIFORM SIGN A;Lo;0;L;;;;;N;;;;; 12001;CUNEIFORM SIGN A TIMES A;Lo;0;L;;;;;N;;;;; 12002;CUNEIFORM SIGN A TIMES BAD;Lo;0;L;;;;;N;;;;; 12003;CUNEIFORM SIGN A TIMES GAN2 TENU;Lo;0;L;;;;;N;;;;; 12004;CUNEIFORM SIGN A TIMES HA;Lo;0;L;;;;;N;;;;; 12005;CUNEIFORM SIGN A TIMES IGI;Lo;0;L;;;;;N;;;;; 12006;CUNEIFORM SIGN A TIMES LAGAR GUNU;Lo;0;L;;;;;N;;;;; 12007;CUNEIFORM SIGN A TIMES MUSH;Lo;0;L;;;;;N;;;;; 12008;CUNEIFORM SIGN A TIMES SAG;Lo;0;L;;;;;N;;;;; 12009;CUNEIFORM SIGN A2;Lo;0;L;;;;;N;;;;; 1200A;CUNEIFORM SIGN AB;Lo;0;L;;;;;N;;;;; 1200B;CUNEIFORM SIGN AB TIMES ASH2;Lo;0;L;;;;;N;;;;; 1200C;CUNEIFORM SIGN AB TIMES DUN3 GUNU;Lo;0;L;;;;;N;;;;; 1200D;CUNEIFORM SIGN AB TIMES GAL;Lo;0;L;;;;;N;;;;; 1200E;CUNEIFORM SIGN AB TIMES GAN2 TENU;Lo;0;L;;;;;N;;;;; 1200F;CUNEIFORM SIGN AB TIMES HA;Lo;0;L;;;;;N;;;;; 12010;CUNEIFORM SIGN AB TIMES IGI GUNU;Lo;0;L;;;;;N;;;;; 12011;CUNEIFORM SIGN AB TIMES IMIN;Lo;0;L;;;;;N;;;;; 12012;CUNEIFORM SIGN AB TIMES LAGAB;Lo;0;L;;;;;N;;;;; 12013;CUNEIFORM SIGN AB TIMES SHESH;Lo;0;L;;;;;N;;;;; 12014;CUNEIFORM SIGN AB TIMES U PLUS U PLUS U;Lo;0;L;;;;;N;;;;; 12015;CUNEIFORM SIGN AB GUNU;Lo;0;L;;;;;N;;;;; 12016;CUNEIFORM SIGN AB2;Lo;0;L;;;;;N;;;;; 12017;CUNEIFORM SIGN AB2 TIMES BALAG;Lo;0;L;;;;;N;;;;; 12018;CUNEIFORM SIGN AB2 TIMES GAN2 TENU;Lo;0;L;;;;;N;;;;; 12019;CUNEIFORM SIGN AB2 TIMES ME PLUS EN;Lo;0;L;;;;;N;;;;; 1201A;CUNEIFORM SIGN AB2 TIMES SHA3;Lo;0;L;;;;;N;;;;; 1201B;CUNEIFORM SIGN AB2 TIMES TAK4;Lo;0;L;;;;;N;;;;; 1201C;CUNEIFORM SIGN AD;Lo;0;L;;;;;N;;;;; 1201D;CUNEIFORM SIGN AK;Lo;0;L;;;;;N;;;;; 1201E;CUNEIFORM SIGN AK TIMES ERIN2;Lo;0;L;;;;;N;;;;; 1201F;CUNEIFORM SIGN AK TIMES SHITA PLUS GISH;Lo;0;L;;;;;N;;;;; 12020;CUNEIFORM SIGN AL;Lo;0;L;;;;;N;;;;; 12021;CUNEIFORM SIGN AL TIMES AL;Lo;0;L;;;;;N;;;;; 12022;CUNEIFORM SIGN AL TIMES DIM2;Lo;0;L;;;;;N;;;;; 12023;CUNEIFORM SIGN AL TIMES GISH;Lo;0;L;;;;;N;;;;; 12024;CUNEIFORM SIGN AL TIMES HA;Lo;0;L;;;;;N;;;;; 12025;CUNEIFORM SIGN AL TIMES KAD3;Lo;0;L;;;;;N;;;;; 12026;CUNEIFORM SIGN AL TIMES KI;Lo;0;L;;;;;N;;;;; 12027;CUNEIFORM SIGN AL TIMES SHE;Lo;0;L;;;;;N;;;;; 12028;CUNEIFORM SIGN AL TIMES USH;Lo;0;L;;;;;N;;;;; 12029;CUNEIFORM SIGN ALAN;Lo;0;L;;;;;N;;;;; 1202A;CUNEIFORM SIGN ALEPH;Lo;0;L;;;;;N;;;;; 1202B;CUNEIFORM SIGN AMAR;Lo;0;L;;;;;N;;;;; 1202C;CUNEIFORM SIGN AMAR TIMES SHE;Lo;0;L;;;;;N;;;;; 1202D;CUNEIFORM SIGN AN;Lo;0;L;;;;;N;;;;; 1202E;CUNEIFORM SIGN AN OVER AN;Lo;0;L;;;;;N;;;;; 1202F;CUNEIFORM SIGN AN THREE TIMES;Lo;0;L;;;;;N;;;;; 12030;CUNEIFORM SIGN AN PLUS NAGA OPPOSING AN PLUS NAGA;Lo;0;L;;;;;N;;;;; 12031;CUNEIFORM SIGN AN PLUS NAGA SQUARED;Lo;0;L;;;;;N;;;;; 12032;CUNEIFORM SIGN ANSHE;Lo;0;L;;;;;N;;;;; 12033;CUNEIFORM SIGN APIN;Lo;0;L;;;;;N;;;;; 12034;CUNEIFORM SIGN ARAD;Lo;0;L;;;;;N;;;;; 12035;CUNEIFORM SIGN ARAD TIMES KUR;Lo;0;L;;;;;N;;;;; 12036;CUNEIFORM SIGN ARKAB;Lo;0;L;;;;;N;;;;; 12037;CUNEIFORM SIGN ASAL2;Lo;0;L;;;;;N;;;;; 12038;CUNEIFORM SIGN ASH;Lo;0;L;;;;;N;;;;; 12039;CUNEIFORM SIGN ASH ZIDA TENU;Lo;0;L;;;;;N;;;;; 1203A;CUNEIFORM SIGN ASH KABA TENU;Lo;0;L;;;;;N;;;;; 1203B;CUNEIFORM SIGN ASH OVER ASH TUG2 OVER TUG2 TUG2 OVER TUG2 PAP;Lo;0;L;;;;;N;;;;; 1203C;CUNEIFORM SIGN ASH OVER ASH OVER ASH;Lo;0;L;;;;;N;;;;; 1203D;CUNEIFORM SIGN ASH OVER ASH OVER ASH CROSSING ASH OVER ASH OVER ASH;Lo;0;L;;;;;N;;;;; 1203E;CUNEIFORM SIGN ASH2;Lo;0;L;;;;;N;;;;; 1203F;CUNEIFORM SIGN ASHGAB;Lo;0;L;;;;;N;;;;; 12040;CUNEIFORM SIGN BA;Lo;0;L;;;;;N;;;;; 12041;CUNEIFORM SIGN BAD;Lo;0;L;;;;;N;;;;; 12042;CUNEIFORM SIGN BAG3;Lo;0;L;;;;;N;;;;; 12043;CUNEIFORM SIGN BAHAR2;Lo;0;L;;;;;N;;;;; 12044;CUNEIFORM SIGN BAL;Lo;0;L;;;;;N;;;;; 12045;CUNEIFORM SIGN BAL OVER BAL;Lo;0;L;;;;;N;;;;; 12046;CUNEIFORM SIGN BALAG;Lo;0;L;;;;;N;;;;; 12047;CUNEIFORM SIGN BAR;Lo;0;L;;;;;N;;;;; 12048;CUNEIFORM SIGN BARA2;Lo;0;L;;;;;N;;;;; 12049;CUNEIFORM SIGN BI;Lo;0;L;;;;;N;;;;; 1204A;CUNEIFORM SIGN BI TIMES A;Lo;0;L;;;;;N;;;;; 1204B;CUNEIFORM SIGN BI TIMES GAR;Lo;0;L;;;;;N;;;;; 1204C;CUNEIFORM SIGN BI TIMES IGI GUNU;Lo;0;L;;;;;N;;;;; 1204D;CUNEIFORM SIGN BU;Lo;0;L;;;;;N;;;;; 1204E;CUNEIFORM SIGN BU OVER BU AB;Lo;0;L;;;;;N;;;;; 1204F;CUNEIFORM SIGN BU OVER BU UN;Lo;0;L;;;;;N;;;;; 12050;CUNEIFORM SIGN BU CROSSING BU;Lo;0;L;;;;;N;;;;; 12051;CUNEIFORM SIGN BULUG;Lo;0;L;;;;;N;;;;; 12052;CUNEIFORM SIGN BULUG OVER BULUG;Lo;0;L;;;;;N;;;;; 12053;CUNEIFORM SIGN BUR;Lo;0;L;;;;;N;;;;; 12054;CUNEIFORM SIGN BUR2;Lo;0;L;;;;;N;;;;; 12055;CUNEIFORM SIGN DA;Lo;0;L;;;;;N;;;;; 12056;CUNEIFORM SIGN DAG;Lo;0;L;;;;;N;;;;; 12057;CUNEIFORM SIGN DAG KISIM5 TIMES A PLUS MASH;Lo;0;L;;;;;N;;;;; 12058;CUNEIFORM SIGN DAG KISIM5 TIMES AMAR;Lo;0;L;;;;;N;;;;; 12059;CUNEIFORM SIGN DAG KISIM5 TIMES BALAG;Lo;0;L;;;;;N;;;;; 1205A;CUNEIFORM SIGN DAG KISIM5 TIMES BI;Lo;0;L;;;;;N;;;;; 1205B;CUNEIFORM SIGN DAG KISIM5 TIMES GA;Lo;0;L;;;;;N;;;;; 1205C;CUNEIFORM SIGN DAG KISIM5 TIMES GA PLUS MASH;Lo;0;L;;;;;N;;;;; 1205D;CUNEIFORM SIGN DAG KISIM5 TIMES GI;Lo;0;L;;;;;N;;;;; 1205E;CUNEIFORM SIGN DAG KISIM5 TIMES GIR2;Lo;0;L;;;;;N;;;;; 1205F;CUNEIFORM SIGN DAG KISIM5 TIMES GUD;Lo;0;L;;;;;N;;;;; 12060;CUNEIFORM SIGN DAG KISIM5 TIMES HA;Lo;0;L;;;;;N;;;;; 12061;CUNEIFORM SIGN DAG KISIM5 TIMES IR;Lo;0;L;;;;;N;;;;; 12062;CUNEIFORM SIGN DAG KISIM5 TIMES IR PLUS LU;Lo;0;L;;;;;N;;;;; 12063;CUNEIFORM SIGN DAG KISIM5 TIMES KAK;Lo;0;L;;;;;N;;;;; 12064;CUNEIFORM SIGN DAG KISIM5 TIMES LA;Lo;0;L;;;;;N;;;;; 12065;CUNEIFORM SIGN DAG KISIM5 TIMES LU;Lo;0;L;;;;;N;;;;; 12066;CUNEIFORM SIGN DAG KISIM5 TIMES LU PLUS MASH2;Lo;0;L;;;;;N;;;;; 12067;CUNEIFORM SIGN DAG KISIM5 TIMES LUM;Lo;0;L;;;;;N;;;;; 12068;CUNEIFORM SIGN DAG KISIM5 TIMES NE;Lo;0;L;;;;;N;;;;; 12069;CUNEIFORM SIGN DAG KISIM5 TIMES PAP PLUS PAP;Lo;0;L;;;;;N;;;;; 1206A;CUNEIFORM SIGN DAG KISIM5 TIMES SI;Lo;0;L;;;;;N;;;;; 1206B;CUNEIFORM SIGN DAG KISIM5 TIMES TAK4;Lo;0;L;;;;;N;;;;; 1206C;CUNEIFORM SIGN DAG KISIM5 TIMES U2 PLUS GIR2;Lo;0;L;;;;;N;;;;; 1206D;CUNEIFORM SIGN DAG KISIM5 TIMES USH;Lo;0;L;;;;;N;;;;; 1206E;CUNEIFORM SIGN DAM;Lo;0;L;;;;;N;;;;; 1206F;CUNEIFORM SIGN DAR;Lo;0;L;;;;;N;;;;; 12070;CUNEIFORM SIGN DARA3;Lo;0;L;;;;;N;;;;; 12071;CUNEIFORM SIGN DARA4;Lo;0;L;;;;;N;;;;; 12072;CUNEIFORM SIGN DI;Lo;0;L;;;;;N;;;;; 12073;CUNEIFORM SIGN DIB;Lo;0;L;;;;;N;;;;; 12074;CUNEIFORM SIGN DIM;Lo;0;L;;;;;N;;;;; 12075;CUNEIFORM SIGN DIM TIMES SHE;Lo;0;L;;;;;N;;;;; 12076;CUNEIFORM SIGN DIM2;Lo;0;L;;;;;N;;;;; 12077;CUNEIFORM SIGN DIN;Lo;0;L;;;;;N;;;;; 12078;CUNEIFORM SIGN DIN KASKAL U GUNU DISH;Lo;0;L;;;;;N;;;;; 12079;CUNEIFORM SIGN DISH;Lo;0;L;;;;;N;;;;; 1207A;CUNEIFORM SIGN DU;Lo;0;L;;;;;N;;;;; 1207B;CUNEIFORM SIGN DU OVER DU;Lo;0;L;;;;;N;;;;; 1207C;CUNEIFORM SIGN DU GUNU;Lo;0;L;;;;;N;;;;; 1207D;CUNEIFORM SIGN DU SHESHIG;Lo;0;L;;;;;N;;;;; 1207E;CUNEIFORM SIGN DUB;Lo;0;L;;;;;N;;;;; 1207F;CUNEIFORM SIGN DUB TIMES ESH2;Lo;0;L;;;;;N;;;;; 12080;CUNEIFORM SIGN DUB2;Lo;0;L;;;;;N;;;;; 12081;CUNEIFORM SIGN DUG;Lo;0;L;;;;;N;;;;; 12082;CUNEIFORM SIGN DUGUD;Lo;0;L;;;;;N;;;;; 12083;CUNEIFORM SIGN DUH;Lo;0;L;;;;;N;;;;; 12084;CUNEIFORM SIGN DUN;Lo;0;L;;;;;N;;;;; 12085;CUNEIFORM SIGN DUN3;Lo;0;L;;;;;N;;;;; 12086;CUNEIFORM SIGN DUN3 GUNU;Lo;0;L;;;;;N;;;;; 12087;CUNEIFORM SIGN DUN3 GUNU GUNU;Lo;0;L;;;;;N;;;;; 12088;CUNEIFORM SIGN DUN4;Lo;0;L;;;;;N;;;;; 12089;CUNEIFORM SIGN DUR2;Lo;0;L;;;;;N;;;;; 1208A;CUNEIFORM SIGN E;Lo;0;L;;;;;N;;;;; 1208B;CUNEIFORM SIGN E TIMES PAP;Lo;0;L;;;;;N;;;;; 1208C;CUNEIFORM SIGN E OVER E NUN OVER NUN;Lo;0;L;;;;;N;;;;; 1208D;CUNEIFORM SIGN E2;Lo;0;L;;;;;N;;;;; 1208E;CUNEIFORM SIGN E2 TIMES A PLUS HA PLUS DA;Lo;0;L;;;;;N;;;;; 1208F;CUNEIFORM SIGN E2 TIMES GAR;Lo;0;L;;;;;N;;;;; 12090;CUNEIFORM SIGN E2 TIMES MI;Lo;0;L;;;;;N;;;;; 12091;CUNEIFORM SIGN E2 TIMES SAL;Lo;0;L;;;;;N;;;;; 12092;CUNEIFORM SIGN E2 TIMES SHE;Lo;0;L;;;;;N;;;;; 12093;CUNEIFORM SIGN E2 TIMES U;Lo;0;L;;;;;N;;;;; 12094;CUNEIFORM SIGN EDIN;Lo;0;L;;;;;N;;;;; 12095;CUNEIFORM SIGN EGIR;Lo;0;L;;;;;N;;;;; 12096;CUNEIFORM SIGN EL;Lo;0;L;;;;;N;;;;; 12097;CUNEIFORM SIGN EN;Lo;0;L;;;;;N;;;;; 12098;CUNEIFORM SIGN EN TIMES GAN2;Lo;0;L;;;;;N;;;;; 12099;CUNEIFORM SIGN EN TIMES GAN2 TENU;Lo;0;L;;;;;N;;;;; 1209A;CUNEIFORM SIGN EN TIMES ME;Lo;0;L;;;;;N;;;;; 1209B;CUNEIFORM SIGN EN CROSSING EN;Lo;0;L;;;;;N;;;;; 1209C;CUNEIFORM SIGN EN OPPOSING EN;Lo;0;L;;;;;N;;;;; 1209D;CUNEIFORM SIGN EN SQUARED;Lo;0;L;;;;;N;;;;; 1209E;CUNEIFORM SIGN EREN;Lo;0;L;;;;;N;;;;; 1209F;CUNEIFORM SIGN ERIN2;Lo;0;L;;;;;N;;;;; 120A0;CUNEIFORM SIGN ESH2;Lo;0;L;;;;;N;;;;; 120A1;CUNEIFORM SIGN EZEN;Lo;0;L;;;;;N;;;;; 120A2;CUNEIFORM SIGN EZEN TIMES A;Lo;0;L;;;;;N;;;;; 120A3;CUNEIFORM SIGN EZEN TIMES A PLUS LAL;Lo;0;L;;;;;N;;;;; 120A4;CUNEIFORM SIGN EZEN TIMES A PLUS LAL TIMES LAL;Lo;0;L;;;;;N;;;;; 120A5;CUNEIFORM SIGN EZEN TIMES AN;Lo;0;L;;;;;N;;;;; 120A6;CUNEIFORM SIGN EZEN TIMES BAD;Lo;0;L;;;;;N;;;;; 120A7;CUNEIFORM SIGN EZEN TIMES DUN3 GUNU;Lo;0;L;;;;;N;;;;; 120A8;CUNEIFORM SIGN EZEN TIMES DUN3 GUNU GUNU;Lo;0;L;;;;;N;;;;; 120A9;CUNEIFORM SIGN EZEN TIMES HA;Lo;0;L;;;;;N;;;;; 120AA;CUNEIFORM SIGN EZEN TIMES HA GUNU;Lo;0;L;;;;;N;;;;; 120AB;CUNEIFORM SIGN EZEN TIMES IGI GUNU;Lo;0;L;;;;;N;;;;; 120AC;CUNEIFORM SIGN EZEN TIMES KASKAL;Lo;0;L;;;;;N;;;;; 120AD;CUNEIFORM SIGN EZEN TIMES KASKAL SQUARED;Lo;0;L;;;;;N;;;;; 120AE;CUNEIFORM SIGN EZEN TIMES KU3;Lo;0;L;;;;;N;;;;; 120AF;CUNEIFORM SIGN EZEN TIMES LA;Lo;0;L;;;;;N;;;;; 120B0;CUNEIFORM SIGN EZEN TIMES LAL TIMES LAL;Lo;0;L;;;;;N;;;;; 120B1;CUNEIFORM SIGN EZEN TIMES LI;Lo;0;L;;;;;N;;;;; 120B2;CUNEIFORM SIGN EZEN TIMES LU;Lo;0;L;;;;;N;;;;; 120B3;CUNEIFORM SIGN EZEN TIMES U2;Lo;0;L;;;;;N;;;;; 120B4;CUNEIFORM SIGN EZEN TIMES UD;Lo;0;L;;;;;N;;;;; 120B5;CUNEIFORM SIGN GA;Lo;0;L;;;;;N;;;;; 120B6;CUNEIFORM SIGN GA GUNU;Lo;0;L;;;;;N;;;;; 120B7;CUNEIFORM SIGN GA2;Lo;0;L;;;;;N;;;;; 120B8;CUNEIFORM SIGN GA2 TIMES A PLUS DA PLUS HA;Lo;0;L;;;;;N;;;;; 120B9;CUNEIFORM SIGN GA2 TIMES A PLUS HA;Lo;0;L;;;;;N;;;;; 120BA;CUNEIFORM SIGN GA2 TIMES A PLUS IGI;Lo;0;L;;;;;N;;;;; 120BB;CUNEIFORM SIGN GA2 TIMES AB2 TENU PLUS TAB;Lo;0;L;;;;;N;;;;; 120BC;CUNEIFORM SIGN GA2 TIMES AN;Lo;0;L;;;;;N;;;;; 120BD;CUNEIFORM SIGN GA2 TIMES ASH;Lo;0;L;;;;;N;;;;; 120BE;CUNEIFORM SIGN GA2 TIMES ASH2 PLUS GAL;Lo;0;L;;;;;N;;;;; 120BF;CUNEIFORM SIGN GA2 TIMES BAD;Lo;0;L;;;;;N;;;;; 120C0;CUNEIFORM SIGN GA2 TIMES BAR PLUS RA;Lo;0;L;;;;;N;;;;; 120C1;CUNEIFORM SIGN GA2 TIMES BUR;Lo;0;L;;;;;N;;;;; 120C2;CUNEIFORM SIGN GA2 TIMES BUR PLUS RA;Lo;0;L;;;;;N;;;;; 120C3;CUNEIFORM SIGN GA2 TIMES DA;Lo;0;L;;;;;N;;;;; 120C4;CUNEIFORM SIGN GA2 TIMES DI;Lo;0;L;;;;;N;;;;; 120C5;CUNEIFORM SIGN GA2 TIMES DIM TIMES SHE;Lo;0;L;;;;;N;;;;; 120C6;CUNEIFORM SIGN GA2 TIMES DUB;Lo;0;L;;;;;N;;;;; 120C7;CUNEIFORM SIGN GA2 TIMES EL;Lo;0;L;;;;;N;;;;; 120C8;CUNEIFORM SIGN GA2 TIMES EL PLUS LA;Lo;0;L;;;;;N;;;;; 120C9;CUNEIFORM SIGN GA2 TIMES EN;Lo;0;L;;;;;N;;;;; 120CA;CUNEIFORM SIGN GA2 TIMES EN TIMES GAN2 TENU;Lo;0;L;;;;;N;;;;; 120CB;CUNEIFORM SIGN GA2 TIMES GAN2 TENU;Lo;0;L;;;;;N;;;;; 120CC;CUNEIFORM SIGN GA2 TIMES GAR;Lo;0;L;;;;;N;;;;; 120CD;CUNEIFORM SIGN GA2 TIMES GI;Lo;0;L;;;;;N;;;;; 120CE;CUNEIFORM SIGN GA2 TIMES GI4;Lo;0;L;;;;;N;;;;; 120CF;CUNEIFORM SIGN GA2 TIMES GI4 PLUS A;Lo;0;L;;;;;N;;;;; 120D0;CUNEIFORM SIGN GA2 TIMES GIR2 PLUS SU;Lo;0;L;;;;;N;;;;; 120D1;CUNEIFORM SIGN GA2 TIMES HA PLUS LU PLUS ESH2;Lo;0;L;;;;;N;;;;; 120D2;CUNEIFORM SIGN GA2 TIMES HAL;Lo;0;L;;;;;N;;;;; 120D3;CUNEIFORM SIGN GA2 TIMES HAL PLUS LA;Lo;0;L;;;;;N;;;;; 120D4;CUNEIFORM SIGN GA2 TIMES HI PLUS LI;Lo;0;L;;;;;N;;;;; 120D5;CUNEIFORM SIGN GA2 TIMES HUB2;Lo;0;L;;;;;N;;;;; 120D6;CUNEIFORM SIGN GA2 TIMES IGI GUNU;Lo;0;L;;;;;N;;;;; 120D7;CUNEIFORM SIGN GA2 TIMES ISH PLUS HU PLUS ASH;Lo;0;L;;;;;N;;;;; 120D8;CUNEIFORM SIGN GA2 TIMES KAK;Lo;0;L;;;;;N;;;;; 120D9;CUNEIFORM SIGN GA2 TIMES KASKAL;Lo;0;L;;;;;N;;;;; 120DA;CUNEIFORM SIGN GA2 TIMES KID;Lo;0;L;;;;;N;;;;; 120DB;CUNEIFORM SIGN GA2 TIMES KID PLUS LAL;Lo;0;L;;;;;N;;;;; 120DC;CUNEIFORM SIGN GA2 TIMES KU3 PLUS AN;Lo;0;L;;;;;N;;;;; 120DD;CUNEIFORM SIGN GA2 TIMES LA;Lo;0;L;;;;;N;;;;; 120DE;CUNEIFORM SIGN GA2 TIMES ME PLUS EN;Lo;0;L;;;;;N;;;;; 120DF;CUNEIFORM SIGN GA2 TIMES MI;Lo;0;L;;;;;N;;;;; 120E0;CUNEIFORM SIGN GA2 TIMES NUN;Lo;0;L;;;;;N;;;;; 120E1;CUNEIFORM SIGN GA2 TIMES NUN OVER NUN;Lo;0;L;;;;;N;;;;; 120E2;CUNEIFORM SIGN GA2 TIMES PA;Lo;0;L;;;;;N;;;;; 120E3;CUNEIFORM SIGN GA2 TIMES SAL;Lo;0;L;;;;;N;;;;; 120E4;CUNEIFORM SIGN GA2 TIMES SAR;Lo;0;L;;;;;N;;;;; 120E5;CUNEIFORM SIGN GA2 TIMES SHE;Lo;0;L;;;;;N;;;;; 120E6;CUNEIFORM SIGN GA2 TIMES SHE PLUS TUR;Lo;0;L;;;;;N;;;;; 120E7;CUNEIFORM SIGN GA2 TIMES SHID;Lo;0;L;;;;;N;;;;; 120E8;CUNEIFORM SIGN GA2 TIMES SUM;Lo;0;L;;;;;N;;;;; 120E9;CUNEIFORM SIGN GA2 TIMES TAK4;Lo;0;L;;;;;N;;;;; 120EA;CUNEIFORM SIGN GA2 TIMES U;Lo;0;L;;;;;N;;;;; 120EB;CUNEIFORM SIGN GA2 TIMES UD;Lo;0;L;;;;;N;;;;; 120EC;CUNEIFORM SIGN GA2 TIMES UD PLUS DU;Lo;0;L;;;;;N;;;;; 120ED;CUNEIFORM SIGN GA2 OVER GA2;Lo;0;L;;;;;N;;;;; 120EE;CUNEIFORM SIGN GABA;Lo;0;L;;;;;N;;;;; 120EF;CUNEIFORM SIGN GABA CROSSING GABA;Lo;0;L;;;;;N;;;;; 120F0;CUNEIFORM SIGN GAD;Lo;0;L;;;;;N;;;;; 120F1;CUNEIFORM SIGN GAD OVER GAD GAR OVER GAR;Lo;0;L;;;;;N;;;;; 120F2;CUNEIFORM SIGN GAL;Lo;0;L;;;;;N;;;;; 120F3;CUNEIFORM SIGN GAL GAD OVER GAD GAR OVER GAR;Lo;0;L;;;;;N;;;;; 120F4;CUNEIFORM SIGN GALAM;Lo;0;L;;;;;N;;;;; 120F5;CUNEIFORM SIGN GAM;Lo;0;L;;;;;N;;;;; 120F6;CUNEIFORM SIGN GAN;Lo;0;L;;;;;N;;;;; 120F7;CUNEIFORM SIGN GAN2;Lo;0;L;;;;;N;;;;; 120F8;CUNEIFORM SIGN GAN2 TENU;Lo;0;L;;;;;N;;;;; 120F9;CUNEIFORM SIGN GAN2 OVER GAN2;Lo;0;L;;;;;N;;;;; 120FA;CUNEIFORM SIGN GAN2 CROSSING GAN2;Lo;0;L;;;;;N;;;;; 120FB;CUNEIFORM SIGN GAR;Lo;0;L;;;;;N;;;;; 120FC;CUNEIFORM SIGN GAR3;Lo;0;L;;;;;N;;;;; 120FD;CUNEIFORM SIGN GASHAN;Lo;0;L;;;;;N;;;;; 120FE;CUNEIFORM SIGN GESHTIN;Lo;0;L;;;;;N;;;;; 120FF;CUNEIFORM SIGN GESHTIN TIMES KUR;Lo;0;L;;;;;N;;;;; 12100;CUNEIFORM SIGN GI;Lo;0;L;;;;;N;;;;; 12101;CUNEIFORM SIGN GI TIMES E;Lo;0;L;;;;;N;;;;; 12102;CUNEIFORM SIGN GI TIMES U;Lo;0;L;;;;;N;;;;; 12103;CUNEIFORM SIGN GI CROSSING GI;Lo;0;L;;;;;N;;;;; 12104;CUNEIFORM SIGN GI4;Lo;0;L;;;;;N;;;;; 12105;CUNEIFORM SIGN GI4 OVER GI4;Lo;0;L;;;;;N;;;;; 12106;CUNEIFORM SIGN GI4 CROSSING GI4;Lo;0;L;;;;;N;;;;; 12107;CUNEIFORM SIGN GIDIM;Lo;0;L;;;;;N;;;;; 12108;CUNEIFORM SIGN GIR2;Lo;0;L;;;;;N;;;;; 12109;CUNEIFORM SIGN GIR2 GUNU;Lo;0;L;;;;;N;;;;; 1210A;CUNEIFORM SIGN GIR3;Lo;0;L;;;;;N;;;;; 1210B;CUNEIFORM SIGN GIR3 TIMES A PLUS IGI;Lo;0;L;;;;;N;;;;; 1210C;CUNEIFORM SIGN GIR3 TIMES GAN2 TENU;Lo;0;L;;;;;N;;;;; 1210D;CUNEIFORM SIGN GIR3 TIMES IGI;Lo;0;L;;;;;N;;;;; 1210E;CUNEIFORM SIGN GIR3 TIMES LU PLUS IGI;Lo;0;L;;;;;N;;;;; 1210F;CUNEIFORM SIGN GIR3 TIMES PA;Lo;0;L;;;;;N;;;;; 12110;CUNEIFORM SIGN GISAL;Lo;0;L;;;;;N;;;;; 12111;CUNEIFORM SIGN GISH;Lo;0;L;;;;;N;;;;; 12112;CUNEIFORM SIGN GISH CROSSING GISH;Lo;0;L;;;;;N;;;;; 12113;CUNEIFORM SIGN GISH TIMES BAD;Lo;0;L;;;;;N;;;;; 12114;CUNEIFORM SIGN GISH TIMES TAK4;Lo;0;L;;;;;N;;;;; 12115;CUNEIFORM SIGN GISH TENU;Lo;0;L;;;;;N;;;;; 12116;CUNEIFORM SIGN GU;Lo;0;L;;;;;N;;;;; 12117;CUNEIFORM SIGN GU CROSSING GU;Lo;0;L;;;;;N;;;;; 12118;CUNEIFORM SIGN GU2;Lo;0;L;;;;;N;;;;; 12119;CUNEIFORM SIGN GU2 TIMES KAK;Lo;0;L;;;;;N;;;;; 1211A;CUNEIFORM SIGN GU2 TIMES KAK TIMES IGI GUNU;Lo;0;L;;;;;N;;;;; 1211B;CUNEIFORM SIGN GU2 TIMES NUN;Lo;0;L;;;;;N;;;;; 1211C;CUNEIFORM SIGN GU2 TIMES SAL PLUS TUG2;Lo;0;L;;;;;N;;;;; 1211D;CUNEIFORM SIGN GU2 GUNU;Lo;0;L;;;;;N;;;;; 1211E;CUNEIFORM SIGN GUD;Lo;0;L;;;;;N;;;;; 1211F;CUNEIFORM SIGN GUD TIMES A PLUS KUR;Lo;0;L;;;;;N;;;;; 12120;CUNEIFORM SIGN GUD TIMES KUR;Lo;0;L;;;;;N;;;;; 12121;CUNEIFORM SIGN GUD OVER GUD LUGAL;Lo;0;L;;;;;N;;;;; 12122;CUNEIFORM SIGN GUL;Lo;0;L;;;;;N;;;;; 12123;CUNEIFORM SIGN GUM;Lo;0;L;;;;;N;;;;; 12124;CUNEIFORM SIGN GUM TIMES SHE;Lo;0;L;;;;;N;;;;; 12125;CUNEIFORM SIGN GUR;Lo;0;L;;;;;N;;;;; 12126;CUNEIFORM SIGN GUR7;Lo;0;L;;;;;N;;;;; 12127;CUNEIFORM SIGN GURUN;Lo;0;L;;;;;N;;;;; 12128;CUNEIFORM SIGN GURUSH;Lo;0;L;;;;;N;;;;; 12129;CUNEIFORM SIGN HA;Lo;0;L;;;;;N;;;;; 1212A;CUNEIFORM SIGN HA TENU;Lo;0;L;;;;;N;;;;; 1212B;CUNEIFORM SIGN HA GUNU;Lo;0;L;;;;;N;;;;; 1212C;CUNEIFORM SIGN HAL;Lo;0;L;;;;;N;;;;; 1212D;CUNEIFORM SIGN HI;Lo;0;L;;;;;N;;;;; 1212E;CUNEIFORM SIGN HI TIMES ASH;Lo;0;L;;;;;N;;;;; 1212F;CUNEIFORM SIGN HI TIMES ASH2;Lo;0;L;;;;;N;;;;; 12130;CUNEIFORM SIGN HI TIMES BAD;Lo;0;L;;;;;N;;;;; 12131;CUNEIFORM SIGN HI TIMES DISH;Lo;0;L;;;;;N;;;;; 12132;CUNEIFORM SIGN HI TIMES GAD;Lo;0;L;;;;;N;;;;; 12133;CUNEIFORM SIGN HI TIMES KIN;Lo;0;L;;;;;N;;;;; 12134;CUNEIFORM SIGN HI TIMES NUN;Lo;0;L;;;;;N;;;;; 12135;CUNEIFORM SIGN HI TIMES SHE;Lo;0;L;;;;;N;;;;; 12136;CUNEIFORM SIGN HI TIMES U;Lo;0;L;;;;;N;;;;; 12137;CUNEIFORM SIGN HU;Lo;0;L;;;;;N;;;;; 12138;CUNEIFORM SIGN HUB2;Lo;0;L;;;;;N;;;;; 12139;CUNEIFORM SIGN HUB2 TIMES AN;Lo;0;L;;;;;N;;;;; 1213A;CUNEIFORM SIGN HUB2 TIMES HAL;Lo;0;L;;;;;N;;;;; 1213B;CUNEIFORM SIGN HUB2 TIMES KASKAL;Lo;0;L;;;;;N;;;;; 1213C;CUNEIFORM SIGN HUB2 TIMES LISH;Lo;0;L;;;;;N;;;;; 1213D;CUNEIFORM SIGN HUB2 TIMES UD;Lo;0;L;;;;;N;;;;; 1213E;CUNEIFORM SIGN HUL2;Lo;0;L;;;;;N;;;;; 1213F;CUNEIFORM SIGN I;Lo;0;L;;;;;N;;;;; 12140;CUNEIFORM SIGN I A;Lo;0;L;;;;;N;;;;; 12141;CUNEIFORM SIGN IB;Lo;0;L;;;;;N;;;;; 12142;CUNEIFORM SIGN IDIM;Lo;0;L;;;;;N;;;;; 12143;CUNEIFORM SIGN IDIM OVER IDIM BUR;Lo;0;L;;;;;N;;;;; 12144;CUNEIFORM SIGN IDIM OVER IDIM SQUARED;Lo;0;L;;;;;N;;;;; 12145;CUNEIFORM SIGN IG;Lo;0;L;;;;;N;;;;; 12146;CUNEIFORM SIGN IGI;Lo;0;L;;;;;N;;;;; 12147;CUNEIFORM SIGN IGI DIB;Lo;0;L;;;;;N;;;;; 12148;CUNEIFORM SIGN IGI RI;Lo;0;L;;;;;N;;;;; 12149;CUNEIFORM SIGN IGI OVER IGI SHIR OVER SHIR UD OVER UD;Lo;0;L;;;;;N;;;;; 1214A;CUNEIFORM SIGN IGI GUNU;Lo;0;L;;;;;N;;;;; 1214B;CUNEIFORM SIGN IL;Lo;0;L;;;;;N;;;;; 1214C;CUNEIFORM SIGN IL TIMES GAN2 TENU;Lo;0;L;;;;;N;;;;; 1214D;CUNEIFORM SIGN IL2;Lo;0;L;;;;;N;;;;; 1214E;CUNEIFORM SIGN IM;Lo;0;L;;;;;N;;;;; 1214F;CUNEIFORM SIGN IM TIMES TAK4;Lo;0;L;;;;;N;;;;; 12150;CUNEIFORM SIGN IM CROSSING IM;Lo;0;L;;;;;N;;;;; 12151;CUNEIFORM SIGN IM OPPOSING IM;Lo;0;L;;;;;N;;;;; 12152;CUNEIFORM SIGN IM SQUARED;Lo;0;L;;;;;N;;;;; 12153;CUNEIFORM SIGN IMIN;Lo;0;L;;;;;N;;;;; 12154;CUNEIFORM SIGN IN;Lo;0;L;;;;;N;;;;; 12155;CUNEIFORM SIGN IR;Lo;0;L;;;;;N;;;;; 12156;CUNEIFORM SIGN ISH;Lo;0;L;;;;;N;;;;; 12157;CUNEIFORM SIGN KA;Lo;0;L;;;;;N;;;;; 12158;CUNEIFORM SIGN KA TIMES A;Lo;0;L;;;;;N;;;;; 12159;CUNEIFORM SIGN KA TIMES AD;Lo;0;L;;;;;N;;;;; 1215A;CUNEIFORM SIGN KA TIMES AD PLUS KU3;Lo;0;L;;;;;N;;;;; 1215B;CUNEIFORM SIGN KA TIMES ASH2;Lo;0;L;;;;;N;;;;; 1215C;CUNEIFORM SIGN KA TIMES BAD;Lo;0;L;;;;;N;;;;; 1215D;CUNEIFORM SIGN KA TIMES BALAG;Lo;0;L;;;;;N;;;;; 1215E;CUNEIFORM SIGN KA TIMES BAR;Lo;0;L;;;;;N;;;;; 1215F;CUNEIFORM SIGN KA TIMES BI;Lo;0;L;;;;;N;;;;; 12160;CUNEIFORM SIGN KA TIMES ERIN2;Lo;0;L;;;;;N;;;;; 12161;CUNEIFORM SIGN KA TIMES ESH2;Lo;0;L;;;;;N;;;;; 12162;CUNEIFORM SIGN KA TIMES GA;Lo;0;L;;;;;N;;;;; 12163;CUNEIFORM SIGN KA TIMES GAL;Lo;0;L;;;;;N;;;;; 12164;CUNEIFORM SIGN KA TIMES GAN2 TENU;Lo;0;L;;;;;N;;;;; 12165;CUNEIFORM SIGN KA TIMES GAR;Lo;0;L;;;;;N;;;;; 12166;CUNEIFORM SIGN KA TIMES GAR PLUS SHA3 PLUS A;Lo;0;L;;;;;N;;;;; 12167;CUNEIFORM SIGN KA TIMES GI;Lo;0;L;;;;;N;;;;; 12168;CUNEIFORM SIGN KA TIMES GIR2;Lo;0;L;;;;;N;;;;; 12169;CUNEIFORM SIGN KA TIMES GISH PLUS SAR;Lo;0;L;;;;;N;;;;; 1216A;CUNEIFORM SIGN KA TIMES GISH CROSSING GISH;Lo;0;L;;;;;N;;;;; 1216B;CUNEIFORM SIGN KA TIMES GU;Lo;0;L;;;;;N;;;;; 1216C;CUNEIFORM SIGN KA TIMES GUR7;Lo;0;L;;;;;N;;;;; 1216D;CUNEIFORM SIGN KA TIMES IGI;Lo;0;L;;;;;N;;;;; 1216E;CUNEIFORM SIGN KA TIMES IM;Lo;0;L;;;;;N;;;;; 1216F;CUNEIFORM SIGN KA TIMES KAK;Lo;0;L;;;;;N;;;;; 12170;CUNEIFORM SIGN KA TIMES KI;Lo;0;L;;;;;N;;;;; 12171;CUNEIFORM SIGN KA TIMES KID;Lo;0;L;;;;;N;;;;; 12172;CUNEIFORM SIGN KA TIMES LI;Lo;0;L;;;;;N;;;;; 12173;CUNEIFORM SIGN KA TIMES LU;Lo;0;L;;;;;N;;;;; 12174;CUNEIFORM SIGN KA TIMES ME;Lo;0;L;;;;;N;;;;; 12175;CUNEIFORM SIGN KA TIMES ME PLUS DU;Lo;0;L;;;;;N;;;;; 12176;CUNEIFORM SIGN KA TIMES ME PLUS GI;Lo;0;L;;;;;N;;;;; 12177;CUNEIFORM SIGN KA TIMES ME PLUS TE;Lo;0;L;;;;;N;;;;; 12178;CUNEIFORM SIGN KA TIMES MI;Lo;0;L;;;;;N;;;;; 12179;CUNEIFORM SIGN KA TIMES MI PLUS NUNUZ;Lo;0;L;;;;;N;;;;; 1217A;CUNEIFORM SIGN KA TIMES NE;Lo;0;L;;;;;N;;;;; 1217B;CUNEIFORM SIGN KA TIMES NUN;Lo;0;L;;;;;N;;;;; 1217C;CUNEIFORM SIGN KA TIMES PI;Lo;0;L;;;;;N;;;;; 1217D;CUNEIFORM SIGN KA TIMES RU;Lo;0;L;;;;;N;;;;; 1217E;CUNEIFORM SIGN KA TIMES SA;Lo;0;L;;;;;N;;;;; 1217F;CUNEIFORM SIGN KA TIMES SAR;Lo;0;L;;;;;N;;;;; 12180;CUNEIFORM SIGN KA TIMES SHA;Lo;0;L;;;;;N;;;;; 12181;CUNEIFORM SIGN KA TIMES SHE;Lo;0;L;;;;;N;;;;; 12182;CUNEIFORM SIGN KA TIMES SHID;Lo;0;L;;;;;N;;;;; 12183;CUNEIFORM SIGN KA TIMES SHU;Lo;0;L;;;;;N;;;;; 12184;CUNEIFORM SIGN KA TIMES SIG;Lo;0;L;;;;;N;;;;; 12185;CUNEIFORM SIGN KA TIMES SUHUR;Lo;0;L;;;;;N;;;;; 12186;CUNEIFORM SIGN KA TIMES TAR;Lo;0;L;;;;;N;;;;; 12187;CUNEIFORM SIGN KA TIMES U;Lo;0;L;;;;;N;;;;; 12188;CUNEIFORM SIGN KA TIMES U2;Lo;0;L;;;;;N;;;;; 12189;CUNEIFORM SIGN KA TIMES UD;Lo;0;L;;;;;N;;;;; 1218A;CUNEIFORM SIGN KA TIMES UMUM TIMES PA;Lo;0;L;;;;;N;;;;; 1218B;CUNEIFORM SIGN KA TIMES USH;Lo;0;L;;;;;N;;;;; 1218C;CUNEIFORM SIGN KA TIMES ZI;Lo;0;L;;;;;N;;;;; 1218D;CUNEIFORM SIGN KA2;Lo;0;L;;;;;N;;;;; 1218E;CUNEIFORM SIGN KA2 CROSSING KA2;Lo;0;L;;;;;N;;;;; 1218F;CUNEIFORM SIGN KAB;Lo;0;L;;;;;N;;;;; 12190;CUNEIFORM SIGN KAD2;Lo;0;L;;;;;N;;;;; 12191;CUNEIFORM SIGN KAD3;Lo;0;L;;;;;N;;;;; 12192;CUNEIFORM SIGN KAD4;Lo;0;L;;;;;N;;;;; 12193;CUNEIFORM SIGN KAD5;Lo;0;L;;;;;N;;;;; 12194;CUNEIFORM SIGN KAD5 OVER KAD5;Lo;0;L;;;;;N;;;;; 12195;CUNEIFORM SIGN KAK;Lo;0;L;;;;;N;;;;; 12196;CUNEIFORM SIGN KAK TIMES IGI GUNU;Lo;0;L;;;;;N;;;;; 12197;CUNEIFORM SIGN KAL;Lo;0;L;;;;;N;;;;; 12198;CUNEIFORM SIGN KAL TIMES BAD;Lo;0;L;;;;;N;;;;; 12199;CUNEIFORM SIGN KAL CROSSING KAL;Lo;0;L;;;;;N;;;;; 1219A;CUNEIFORM SIGN KAM2;Lo;0;L;;;;;N;;;;; 1219B;CUNEIFORM SIGN KAM4;Lo;0;L;;;;;N;;;;; 1219C;CUNEIFORM SIGN KASKAL;Lo;0;L;;;;;N;;;;; 1219D;CUNEIFORM SIGN KASKAL LAGAB TIMES U OVER LAGAB TIMES U;Lo;0;L;;;;;N;;;;; 1219E;CUNEIFORM SIGN KASKAL OVER KASKAL LAGAB TIMES U OVER LAGAB TIMES U;Lo;0;L;;;;;N;;;;; 1219F;CUNEIFORM SIGN KESH2;Lo;0;L;;;;;N;;;;; 121A0;CUNEIFORM SIGN KI;Lo;0;L;;;;;N;;;;; 121A1;CUNEIFORM SIGN KI TIMES BAD;Lo;0;L;;;;;N;;;;; 121A2;CUNEIFORM SIGN KI TIMES U;Lo;0;L;;;;;N;;;;; 121A3;CUNEIFORM SIGN KI TIMES UD;Lo;0;L;;;;;N;;;;; 121A4;CUNEIFORM SIGN KID;Lo;0;L;;;;;N;;;;; 121A5;CUNEIFORM SIGN KIN;Lo;0;L;;;;;N;;;;; 121A6;CUNEIFORM SIGN KISAL;Lo;0;L;;;;;N;;;;; 121A7;CUNEIFORM SIGN KISH;Lo;0;L;;;;;N;;;;; 121A8;CUNEIFORM SIGN KISIM5;Lo;0;L;;;;;N;;;;; 121A9;CUNEIFORM SIGN KISIM5 OVER KISIM5;Lo;0;L;;;;;N;;;;; 121AA;CUNEIFORM SIGN KU;Lo;0;L;;;;;N;;;;; 121AB;CUNEIFORM SIGN KU OVER HI TIMES ASH2 KU OVER HI TIMES ASH2;Lo;0;L;;;;;N;;;;; 121AC;CUNEIFORM SIGN KU3;Lo;0;L;;;;;N;;;;; 121AD;CUNEIFORM SIGN KU4;Lo;0;L;;;;;N;;;;; 121AE;CUNEIFORM SIGN KU4 VARIANT FORM;Lo;0;L;;;;;N;;;;; 121AF;CUNEIFORM SIGN KU7;Lo;0;L;;;;;N;;;;; 121B0;CUNEIFORM SIGN KUL;Lo;0;L;;;;;N;;;;; 121B1;CUNEIFORM SIGN KUL GUNU;Lo;0;L;;;;;N;;;;; 121B2;CUNEIFORM SIGN KUN;Lo;0;L;;;;;N;;;;; 121B3;CUNEIFORM SIGN KUR;Lo;0;L;;;;;N;;;;; 121B4;CUNEIFORM SIGN KUR OPPOSING KUR;Lo;0;L;;;;;N;;;;; 121B5;CUNEIFORM SIGN KUSHU2;Lo;0;L;;;;;N;;;;; 121B6;CUNEIFORM SIGN KWU318;Lo;0;L;;;;;N;;;;; 121B7;CUNEIFORM SIGN LA;Lo;0;L;;;;;N;;;;; 121B8;CUNEIFORM SIGN LAGAB;Lo;0;L;;;;;N;;;;; 121B9;CUNEIFORM SIGN LAGAB TIMES A;Lo;0;L;;;;;N;;;;; 121BA;CUNEIFORM SIGN LAGAB TIMES A PLUS DA PLUS HA;Lo;0;L;;;;;N;;;;; 121BB;CUNEIFORM SIGN LAGAB TIMES A PLUS GAR;Lo;0;L;;;;;N;;;;; 121BC;CUNEIFORM SIGN LAGAB TIMES A PLUS LAL;Lo;0;L;;;;;N;;;;; 121BD;CUNEIFORM SIGN LAGAB TIMES AL;Lo;0;L;;;;;N;;;;; 121BE;CUNEIFORM SIGN LAGAB TIMES AN;Lo;0;L;;;;;N;;;;; 121BF;CUNEIFORM SIGN LAGAB TIMES ASH ZIDA TENU;Lo;0;L;;;;;N;;;;; 121C0;CUNEIFORM SIGN LAGAB TIMES BAD;Lo;0;L;;;;;N;;;;; 121C1;CUNEIFORM SIGN LAGAB TIMES BI;Lo;0;L;;;;;N;;;;; 121C2;CUNEIFORM SIGN LAGAB TIMES DAR;Lo;0;L;;;;;N;;;;; 121C3;CUNEIFORM SIGN LAGAB TIMES EN;Lo;0;L;;;;;N;;;;; 121C4;CUNEIFORM SIGN LAGAB TIMES GA;Lo;0;L;;;;;N;;;;; 121C5;CUNEIFORM SIGN LAGAB TIMES GAR;Lo;0;L;;;;;N;;;;; 121C6;CUNEIFORM SIGN LAGAB TIMES GUD;Lo;0;L;;;;;N;;;;; 121C7;CUNEIFORM SIGN LAGAB TIMES GUD PLUS GUD;Lo;0;L;;;;;N;;;;; 121C8;CUNEIFORM SIGN LAGAB TIMES HA;Lo;0;L;;;;;N;;;;; 121C9;CUNEIFORM SIGN LAGAB TIMES HAL;Lo;0;L;;;;;N;;;;; 121CA;CUNEIFORM SIGN LAGAB TIMES HI TIMES NUN;Lo;0;L;;;;;N;;;;; 121CB;CUNEIFORM SIGN LAGAB TIMES IGI GUNU;Lo;0;L;;;;;N;;;;; 121CC;CUNEIFORM SIGN LAGAB TIMES IM;Lo;0;L;;;;;N;;;;; 121CD;CUNEIFORM SIGN LAGAB TIMES IM PLUS HA;Lo;0;L;;;;;N;;;;; 121CE;CUNEIFORM SIGN LAGAB TIMES IM PLUS LU;Lo;0;L;;;;;N;;;;; 121CF;CUNEIFORM SIGN LAGAB TIMES KI;Lo;0;L;;;;;N;;;;; 121D0;CUNEIFORM SIGN LAGAB TIMES KIN;Lo;0;L;;;;;N;;;;; 121D1;CUNEIFORM SIGN LAGAB TIMES KU3;Lo;0;L;;;;;N;;;;; 121D2;CUNEIFORM SIGN LAGAB TIMES KUL;Lo;0;L;;;;;N;;;;; 121D3;CUNEIFORM SIGN LAGAB TIMES KUL PLUS HI PLUS A;Lo;0;L;;;;;N;;;;; 121D4;CUNEIFORM SIGN LAGAB TIMES LAGAB;Lo;0;L;;;;;N;;;;; 121D5;CUNEIFORM SIGN LAGAB TIMES LISH;Lo;0;L;;;;;N;;;;; 121D6;CUNEIFORM SIGN LAGAB TIMES LU;Lo;0;L;;;;;N;;;;; 121D7;CUNEIFORM SIGN LAGAB TIMES LUL;Lo;0;L;;;;;N;;;;; 121D8;CUNEIFORM SIGN LAGAB TIMES ME;Lo;0;L;;;;;N;;;;; 121D9;CUNEIFORM SIGN LAGAB TIMES ME PLUS EN;Lo;0;L;;;;;N;;;;; 121DA;CUNEIFORM SIGN LAGAB TIMES MUSH;Lo;0;L;;;;;N;;;;; 121DB;CUNEIFORM SIGN LAGAB TIMES NE;Lo;0;L;;;;;N;;;;; 121DC;CUNEIFORM SIGN LAGAB TIMES SHE PLUS SUM;Lo;0;L;;;;;N;;;;; 121DD;CUNEIFORM SIGN LAGAB TIMES SHITA PLUS GISH PLUS ERIN2;Lo;0;L;;;;;N;;;;; 121DE;CUNEIFORM SIGN LAGAB TIMES SHITA PLUS GISH TENU;Lo;0;L;;;;;N;;;;; 121DF;CUNEIFORM SIGN LAGAB TIMES SHU2;Lo;0;L;;;;;N;;;;; 121E0;CUNEIFORM SIGN LAGAB TIMES SHU2 PLUS SHU2;Lo;0;L;;;;;N;;;;; 121E1;CUNEIFORM SIGN LAGAB TIMES SUM;Lo;0;L;;;;;N;;;;; 121E2;CUNEIFORM SIGN LAGAB TIMES TAG;Lo;0;L;;;;;N;;;;; 121E3;CUNEIFORM SIGN LAGAB TIMES TAK4;Lo;0;L;;;;;N;;;;; 121E4;CUNEIFORM SIGN LAGAB TIMES TE PLUS A PLUS SU PLUS NA;Lo;0;L;;;;;N;;;;; 121E5;CUNEIFORM SIGN LAGAB TIMES U;Lo;0;L;;;;;N;;;;; 121E6;CUNEIFORM SIGN LAGAB TIMES U PLUS A;Lo;0;L;;;;;N;;;;; 121E7;CUNEIFORM SIGN LAGAB TIMES U PLUS U PLUS U;Lo;0;L;;;;;N;;;;; 121E8;CUNEIFORM SIGN LAGAB TIMES U2 PLUS ASH;Lo;0;L;;;;;N;;;;; 121E9;CUNEIFORM SIGN LAGAB TIMES UD;Lo;0;L;;;;;N;;;;; 121EA;CUNEIFORM SIGN LAGAB TIMES USH;Lo;0;L;;;;;N;;;;; 121EB;CUNEIFORM SIGN LAGAB SQUARED;Lo;0;L;;;;;N;;;;; 121EC;CUNEIFORM SIGN LAGAR;Lo;0;L;;;;;N;;;;; 121ED;CUNEIFORM SIGN LAGAR TIMES SHE;Lo;0;L;;;;;N;;;;; 121EE;CUNEIFORM SIGN LAGAR TIMES SHE PLUS SUM;Lo;0;L;;;;;N;;;;; 121EF;CUNEIFORM SIGN LAGAR GUNU;Lo;0;L;;;;;N;;;;; 121F0;CUNEIFORM SIGN LAGAR GUNU OVER LAGAR GUNU SHE;Lo;0;L;;;;;N;;;;; 121F1;CUNEIFORM SIGN LAHSHU;Lo;0;L;;;;;N;;;;; 121F2;CUNEIFORM SIGN LAL;Lo;0;L;;;;;N;;;;; 121F3;CUNEIFORM SIGN LAL TIMES LAL;Lo;0;L;;;;;N;;;;; 121F4;CUNEIFORM SIGN LAM;Lo;0;L;;;;;N;;;;; 121F5;CUNEIFORM SIGN LAM TIMES KUR;Lo;0;L;;;;;N;;;;; 121F6;CUNEIFORM SIGN LAM TIMES KUR PLUS RU;Lo;0;L;;;;;N;;;;; 121F7;CUNEIFORM SIGN LI;Lo;0;L;;;;;N;;;;; 121F8;CUNEIFORM SIGN LIL;Lo;0;L;;;;;N;;;;; 121F9;CUNEIFORM SIGN LIMMU2;Lo;0;L;;;;;N;;;;; 121FA;CUNEIFORM SIGN LISH;Lo;0;L;;;;;N;;;;; 121FB;CUNEIFORM SIGN LU;Lo;0;L;;;;;N;;;;; 121FC;CUNEIFORM SIGN LU TIMES BAD;Lo;0;L;;;;;N;;;;; 121FD;CUNEIFORM SIGN LU2;Lo;0;L;;;;;N;;;;; 121FE;CUNEIFORM SIGN LU2 TIMES AL;Lo;0;L;;;;;N;;;;; 121FF;CUNEIFORM SIGN LU2 TIMES BAD;Lo;0;L;;;;;N;;;;; 12200;CUNEIFORM SIGN LU2 TIMES ESH2;Lo;0;L;;;;;N;;;;; 12201;CUNEIFORM SIGN LU2 TIMES ESH2 TENU;Lo;0;L;;;;;N;;;;; 12202;CUNEIFORM SIGN LU2 TIMES GAN2 TENU;Lo;0;L;;;;;N;;;;; 12203;CUNEIFORM SIGN LU2 TIMES HI TIMES BAD;Lo;0;L;;;;;N;;;;; 12204;CUNEIFORM SIGN LU2 TIMES IM;Lo;0;L;;;;;N;;;;; 12205;CUNEIFORM SIGN LU2 TIMES KAD2;Lo;0;L;;;;;N;;;;; 12206;CUNEIFORM SIGN LU2 TIMES KAD3;Lo;0;L;;;;;N;;;;; 12207;CUNEIFORM SIGN LU2 TIMES KAD3 PLUS ASH;Lo;0;L;;;;;N;;;;; 12208;CUNEIFORM SIGN LU2 TIMES KI;Lo;0;L;;;;;N;;;;; 12209;CUNEIFORM SIGN LU2 TIMES LA PLUS ASH;Lo;0;L;;;;;N;;;;; 1220A;CUNEIFORM SIGN LU2 TIMES LAGAB;Lo;0;L;;;;;N;;;;; 1220B;CUNEIFORM SIGN LU2 TIMES ME PLUS EN;Lo;0;L;;;;;N;;;;; 1220C;CUNEIFORM SIGN LU2 TIMES NE;Lo;0;L;;;;;N;;;;; 1220D;CUNEIFORM SIGN LU2 TIMES NU;Lo;0;L;;;;;N;;;;; 1220E;CUNEIFORM SIGN LU2 TIMES SI PLUS ASH;Lo;0;L;;;;;N;;;;; 1220F;CUNEIFORM SIGN LU2 TIMES SIK2 PLUS BU;Lo;0;L;;;;;N;;;;; 12210;CUNEIFORM SIGN LU2 TIMES TUG2;Lo;0;L;;;;;N;;;;; 12211;CUNEIFORM SIGN LU2 TENU;Lo;0;L;;;;;N;;;;; 12212;CUNEIFORM SIGN LU2 CROSSING LU2;Lo;0;L;;;;;N;;;;; 12213;CUNEIFORM SIGN LU2 OPPOSING LU2;Lo;0;L;;;;;N;;;;; 12214;CUNEIFORM SIGN LU2 SQUARED;Lo;0;L;;;;;N;;;;; 12215;CUNEIFORM SIGN LU2 SHESHIG;Lo;0;L;;;;;N;;;;; 12216;CUNEIFORM SIGN LU3;Lo;0;L;;;;;N;;;;; 12217;CUNEIFORM SIGN LUGAL;Lo;0;L;;;;;N;;;;; 12218;CUNEIFORM SIGN LUGAL OVER LUGAL;Lo;0;L;;;;;N;;;;; 12219;CUNEIFORM SIGN LUGAL OPPOSING LUGAL;Lo;0;L;;;;;N;;;;; 1221A;CUNEIFORM SIGN LUGAL SHESHIG;Lo;0;L;;;;;N;;;;; 1221B;CUNEIFORM SIGN LUH;Lo;0;L;;;;;N;;;;; 1221C;CUNEIFORM SIGN LUL;Lo;0;L;;;;;N;;;;; 1221D;CUNEIFORM SIGN LUM;Lo;0;L;;;;;N;;;;; 1221E;CUNEIFORM SIGN LUM OVER LUM;Lo;0;L;;;;;N;;;;; 1221F;CUNEIFORM SIGN LUM OVER LUM GAR OVER GAR;Lo;0;L;;;;;N;;;;; 12220;CUNEIFORM SIGN MA;Lo;0;L;;;;;N;;;;; 12221;CUNEIFORM SIGN MA TIMES TAK4;Lo;0;L;;;;;N;;;;; 12222;CUNEIFORM SIGN MA GUNU;Lo;0;L;;;;;N;;;;; 12223;CUNEIFORM SIGN MA2;Lo;0;L;;;;;N;;;;; 12224;CUNEIFORM SIGN MAH;Lo;0;L;;;;;N;;;;; 12225;CUNEIFORM SIGN MAR;Lo;0;L;;;;;N;;;;; 12226;CUNEIFORM SIGN MASH;Lo;0;L;;;;;N;;;;; 12227;CUNEIFORM SIGN MASH2;Lo;0;L;;;;;N;;;;; 12228;CUNEIFORM SIGN ME;Lo;0;L;;;;;N;;;;; 12229;CUNEIFORM SIGN MES;Lo;0;L;;;;;N;;;;; 1222A;CUNEIFORM SIGN MI;Lo;0;L;;;;;N;;;;; 1222B;CUNEIFORM SIGN MIN;Lo;0;L;;;;;N;;;;; 1222C;CUNEIFORM SIGN MU;Lo;0;L;;;;;N;;;;; 1222D;CUNEIFORM SIGN MU OVER MU;Lo;0;L;;;;;N;;;;; 1222E;CUNEIFORM SIGN MUG;Lo;0;L;;;;;N;;;;; 1222F;CUNEIFORM SIGN MUG GUNU;Lo;0;L;;;;;N;;;;; 12230;CUNEIFORM SIGN MUNSUB;Lo;0;L;;;;;N;;;;; 12231;CUNEIFORM SIGN MURGU2;Lo;0;L;;;;;N;;;;; 12232;CUNEIFORM SIGN MUSH;Lo;0;L;;;;;N;;;;; 12233;CUNEIFORM SIGN MUSH TIMES A;Lo;0;L;;;;;N;;;;; 12234;CUNEIFORM SIGN MUSH TIMES KUR;Lo;0;L;;;;;N;;;;; 12235;CUNEIFORM SIGN MUSH TIMES ZA;Lo;0;L;;;;;N;;;;; 12236;CUNEIFORM SIGN MUSH OVER MUSH;Lo;0;L;;;;;N;;;;; 12237;CUNEIFORM SIGN MUSH OVER MUSH TIMES A PLUS NA;Lo;0;L;;;;;N;;;;; 12238;CUNEIFORM SIGN MUSH CROSSING MUSH;Lo;0;L;;;;;N;;;;; 12239;CUNEIFORM SIGN MUSH3;Lo;0;L;;;;;N;;;;; 1223A;CUNEIFORM SIGN MUSH3 TIMES A;Lo;0;L;;;;;N;;;;; 1223B;CUNEIFORM SIGN MUSH3 TIMES A PLUS DI;Lo;0;L;;;;;N;;;;; 1223C;CUNEIFORM SIGN MUSH3 TIMES DI;Lo;0;L;;;;;N;;;;; 1223D;CUNEIFORM SIGN MUSH3 GUNU;Lo;0;L;;;;;N;;;;; 1223E;CUNEIFORM SIGN NA;Lo;0;L;;;;;N;;;;; 1223F;CUNEIFORM SIGN NA2;Lo;0;L;;;;;N;;;;; 12240;CUNEIFORM SIGN NAGA;Lo;0;L;;;;;N;;;;; 12241;CUNEIFORM SIGN NAGA INVERTED;Lo;0;L;;;;;N;;;;; 12242;CUNEIFORM SIGN NAGA TIMES SHU TENU;Lo;0;L;;;;;N;;;;; 12243;CUNEIFORM SIGN NAGA OPPOSING NAGA;Lo;0;L;;;;;N;;;;; 12244;CUNEIFORM SIGN NAGAR;Lo;0;L;;;;;N;;;;; 12245;CUNEIFORM SIGN NAM NUTILLU;Lo;0;L;;;;;N;;;;; 12246;CUNEIFORM SIGN NAM;Lo;0;L;;;;;N;;;;; 12247;CUNEIFORM SIGN NAM2;Lo;0;L;;;;;N;;;;; 12248;CUNEIFORM SIGN NE;Lo;0;L;;;;;N;;;;; 12249;CUNEIFORM SIGN NE TIMES A;Lo;0;L;;;;;N;;;;; 1224A;CUNEIFORM SIGN NE TIMES UD;Lo;0;L;;;;;N;;;;; 1224B;CUNEIFORM SIGN NE SHESHIG;Lo;0;L;;;;;N;;;;; 1224C;CUNEIFORM SIGN NI;Lo;0;L;;;;;N;;;;; 1224D;CUNEIFORM SIGN NI TIMES E;Lo;0;L;;;;;N;;;;; 1224E;CUNEIFORM SIGN NI2;Lo;0;L;;;;;N;;;;; 1224F;CUNEIFORM SIGN NIM;Lo;0;L;;;;;N;;;;; 12250;CUNEIFORM SIGN NIM TIMES GAN2 TENU;Lo;0;L;;;;;N;;;;; 12251;CUNEIFORM SIGN NIM TIMES GAR PLUS GAN2 TENU;Lo;0;L;;;;;N;;;;; 12252;CUNEIFORM SIGN NINDA2;Lo;0;L;;;;;N;;;;; 12253;CUNEIFORM SIGN NINDA2 TIMES AN;Lo;0;L;;;;;N;;;;; 12254;CUNEIFORM SIGN NINDA2 TIMES ASH;Lo;0;L;;;;;N;;;;; 12255;CUNEIFORM SIGN NINDA2 TIMES ASH PLUS ASH;Lo;0;L;;;;;N;;;;; 12256;CUNEIFORM SIGN NINDA2 TIMES GUD;Lo;0;L;;;;;N;;;;; 12257;CUNEIFORM SIGN NINDA2 TIMES ME PLUS GAN2 TENU;Lo;0;L;;;;;N;;;;; 12258;CUNEIFORM SIGN NINDA2 TIMES NE;Lo;0;L;;;;;N;;;;; 12259;CUNEIFORM SIGN NINDA2 TIMES NUN;Lo;0;L;;;;;N;;;;; 1225A;CUNEIFORM SIGN NINDA2 TIMES SHE;Lo;0;L;;;;;N;;;;; 1225B;CUNEIFORM SIGN NINDA2 TIMES SHE PLUS A AN;Lo;0;L;;;;;N;;;;; 1225C;CUNEIFORM SIGN NINDA2 TIMES SHE PLUS ASH;Lo;0;L;;;;;N;;;;; 1225D;CUNEIFORM SIGN NINDA2 TIMES SHE PLUS ASH PLUS ASH;Lo;0;L;;;;;N;;;;; 1225E;CUNEIFORM SIGN NINDA2 TIMES U2 PLUS ASH;Lo;0;L;;;;;N;;;;; 1225F;CUNEIFORM SIGN NINDA2 TIMES USH;Lo;0;L;;;;;N;;;;; 12260;CUNEIFORM SIGN NISAG;Lo;0;L;;;;;N;;;;; 12261;CUNEIFORM SIGN NU;Lo;0;L;;;;;N;;;;; 12262;CUNEIFORM SIGN NU11;Lo;0;L;;;;;N;;;;; 12263;CUNEIFORM SIGN NUN;Lo;0;L;;;;;N;;;;; 12264;CUNEIFORM SIGN NUN LAGAR TIMES GAR;Lo;0;L;;;;;N;;;;; 12265;CUNEIFORM SIGN NUN LAGAR TIMES MASH;Lo;0;L;;;;;N;;;;; 12266;CUNEIFORM SIGN NUN LAGAR TIMES SAL;Lo;0;L;;;;;N;;;;; 12267;CUNEIFORM SIGN NUN LAGAR TIMES SAL OVER NUN LAGAR TIMES SAL;Lo;0;L;;;;;N;;;;; 12268;CUNEIFORM SIGN NUN LAGAR TIMES USH;Lo;0;L;;;;;N;;;;; 12269;CUNEIFORM SIGN NUN TENU;Lo;0;L;;;;;N;;;;; 1226A;CUNEIFORM SIGN NUN OVER NUN;Lo;0;L;;;;;N;;;;; 1226B;CUNEIFORM SIGN NUN CROSSING NUN;Lo;0;L;;;;;N;;;;; 1226C;CUNEIFORM SIGN NUN CROSSING NUN LAGAR OVER LAGAR;Lo;0;L;;;;;N;;;;; 1226D;CUNEIFORM SIGN NUNUZ;Lo;0;L;;;;;N;;;;; 1226E;CUNEIFORM SIGN NUNUZ AB2 TIMES ASHGAB;Lo;0;L;;;;;N;;;;; 1226F;CUNEIFORM SIGN NUNUZ AB2 TIMES BI;Lo;0;L;;;;;N;;;;; 12270;CUNEIFORM SIGN NUNUZ AB2 TIMES DUG;Lo;0;L;;;;;N;;;;; 12271;CUNEIFORM SIGN NUNUZ AB2 TIMES GUD;Lo;0;L;;;;;N;;;;; 12272;CUNEIFORM SIGN NUNUZ AB2 TIMES IGI GUNU;Lo;0;L;;;;;N;;;;; 12273;CUNEIFORM SIGN NUNUZ AB2 TIMES KAD3;Lo;0;L;;;;;N;;;;; 12274;CUNEIFORM SIGN NUNUZ AB2 TIMES LA;Lo;0;L;;;;;N;;;;; 12275;CUNEIFORM SIGN NUNUZ AB2 TIMES NE;Lo;0;L;;;;;N;;;;; 12276;CUNEIFORM SIGN NUNUZ AB2 TIMES SILA3;Lo;0;L;;;;;N;;;;; 12277;CUNEIFORM SIGN NUNUZ AB2 TIMES U2;Lo;0;L;;;;;N;;;;; 12278;CUNEIFORM SIGN NUNUZ KISIM5 TIMES BI;Lo;0;L;;;;;N;;;;; 12279;CUNEIFORM SIGN NUNUZ KISIM5 TIMES BI U;Lo;0;L;;;;;N;;;;; 1227A;CUNEIFORM SIGN PA;Lo;0;L;;;;;N;;;;; 1227B;CUNEIFORM SIGN PAD;Lo;0;L;;;;;N;;;;; 1227C;CUNEIFORM SIGN PAN;Lo;0;L;;;;;N;;;;; 1227D;CUNEIFORM SIGN PAP;Lo;0;L;;;;;N;;;;; 1227E;CUNEIFORM SIGN PESH2;Lo;0;L;;;;;N;;;;; 1227F;CUNEIFORM SIGN PI;Lo;0;L;;;;;N;;;;; 12280;CUNEIFORM SIGN PI TIMES A;Lo;0;L;;;;;N;;;;; 12281;CUNEIFORM SIGN PI TIMES AB;Lo;0;L;;;;;N;;;;; 12282;CUNEIFORM SIGN PI TIMES BI;Lo;0;L;;;;;N;;;;; 12283;CUNEIFORM SIGN PI TIMES BU;Lo;0;L;;;;;N;;;;; 12284;CUNEIFORM SIGN PI TIMES E;Lo;0;L;;;;;N;;;;; 12285;CUNEIFORM SIGN PI TIMES I;Lo;0;L;;;;;N;;;;; 12286;CUNEIFORM SIGN PI TIMES IB;Lo;0;L;;;;;N;;;;; 12287;CUNEIFORM SIGN PI TIMES U;Lo;0;L;;;;;N;;;;; 12288;CUNEIFORM SIGN PI TIMES U2;Lo;0;L;;;;;N;;;;; 12289;CUNEIFORM SIGN PI CROSSING PI;Lo;0;L;;;;;N;;;;; 1228A;CUNEIFORM SIGN PIRIG;Lo;0;L;;;;;N;;;;; 1228B;CUNEIFORM SIGN PIRIG TIMES KAL;Lo;0;L;;;;;N;;;;; 1228C;CUNEIFORM SIGN PIRIG TIMES UD;Lo;0;L;;;;;N;;;;; 1228D;CUNEIFORM SIGN PIRIG TIMES ZA;Lo;0;L;;;;;N;;;;; 1228E;CUNEIFORM SIGN PIRIG OPPOSING PIRIG;Lo;0;L;;;;;N;;;;; 1228F;CUNEIFORM SIGN RA;Lo;0;L;;;;;N;;;;; 12290;CUNEIFORM SIGN RAB;Lo;0;L;;;;;N;;;;; 12291;CUNEIFORM SIGN RI;Lo;0;L;;;;;N;;;;; 12292;CUNEIFORM SIGN RU;Lo;0;L;;;;;N;;;;; 12293;CUNEIFORM SIGN SA;Lo;0;L;;;;;N;;;;; 12294;CUNEIFORM SIGN SAG NUTILLU;Lo;0;L;;;;;N;;;;; 12295;CUNEIFORM SIGN SAG;Lo;0;L;;;;;N;;;;; 12296;CUNEIFORM SIGN SAG TIMES A;Lo;0;L;;;;;N;;;;; 12297;CUNEIFORM SIGN SAG TIMES DU;Lo;0;L;;;;;N;;;;; 12298;CUNEIFORM SIGN SAG TIMES DUB;Lo;0;L;;;;;N;;;;; 12299;CUNEIFORM SIGN SAG TIMES HA;Lo;0;L;;;;;N;;;;; 1229A;CUNEIFORM SIGN SAG TIMES KAK;Lo;0;L;;;;;N;;;;; 1229B;CUNEIFORM SIGN SAG TIMES KUR;Lo;0;L;;;;;N;;;;; 1229C;CUNEIFORM SIGN SAG TIMES LUM;Lo;0;L;;;;;N;;;;; 1229D;CUNEIFORM SIGN SAG TIMES MI;Lo;0;L;;;;;N;;;;; 1229E;CUNEIFORM SIGN SAG TIMES NUN;Lo;0;L;;;;;N;;;;; 1229F;CUNEIFORM SIGN SAG TIMES SAL;Lo;0;L;;;;;N;;;;; 122A0;CUNEIFORM SIGN SAG TIMES SHID;Lo;0;L;;;;;N;;;;; 122A1;CUNEIFORM SIGN SAG TIMES TAB;Lo;0;L;;;;;N;;;;; 122A2;CUNEIFORM SIGN SAG TIMES U2;Lo;0;L;;;;;N;;;;; 122A3;CUNEIFORM SIGN SAG TIMES UB;Lo;0;L;;;;;N;;;;; 122A4;CUNEIFORM SIGN SAG TIMES UM;Lo;0;L;;;;;N;;;;; 122A5;CUNEIFORM SIGN SAG TIMES UR;Lo;0;L;;;;;N;;;;; 122A6;CUNEIFORM SIGN SAG TIMES USH;Lo;0;L;;;;;N;;;;; 122A7;CUNEIFORM SIGN SAG OVER SAG;Lo;0;L;;;;;N;;;;; 122A8;CUNEIFORM SIGN SAG GUNU;Lo;0;L;;;;;N;;;;; 122A9;CUNEIFORM SIGN SAL;Lo;0;L;;;;;N;;;;; 122AA;CUNEIFORM SIGN SAL LAGAB TIMES ASH2;Lo;0;L;;;;;N;;;;; 122AB;CUNEIFORM SIGN SANGA2;Lo;0;L;;;;;N;;;;; 122AC;CUNEIFORM SIGN SAR;Lo;0;L;;;;;N;;;;; 122AD;CUNEIFORM SIGN SHA;Lo;0;L;;;;;N;;;;; 122AE;CUNEIFORM SIGN SHA3;Lo;0;L;;;;;N;;;;; 122AF;CUNEIFORM SIGN SHA3 TIMES A;Lo;0;L;;;;;N;;;;; 122B0;CUNEIFORM SIGN SHA3 TIMES BAD;Lo;0;L;;;;;N;;;;; 122B1;CUNEIFORM SIGN SHA3 TIMES GISH;Lo;0;L;;;;;N;;;;; 122B2;CUNEIFORM SIGN SHA3 TIMES NE;Lo;0;L;;;;;N;;;;; 122B3;CUNEIFORM SIGN SHA3 TIMES SHU2;Lo;0;L;;;;;N;;;;; 122B4;CUNEIFORM SIGN SHA3 TIMES TUR;Lo;0;L;;;;;N;;;;; 122B5;CUNEIFORM SIGN SHA3 TIMES U;Lo;0;L;;;;;N;;;;; 122B6;CUNEIFORM SIGN SHA3 TIMES U PLUS A;Lo;0;L;;;;;N;;;;; 122B7;CUNEIFORM SIGN SHA6;Lo;0;L;;;;;N;;;;; 122B8;CUNEIFORM SIGN SHAB6;Lo;0;L;;;;;N;;;;; 122B9;CUNEIFORM SIGN SHAR2;Lo;0;L;;;;;N;;;;; 122BA;CUNEIFORM SIGN SHE;Lo;0;L;;;;;N;;;;; 122BB;CUNEIFORM SIGN SHE HU;Lo;0;L;;;;;N;;;;; 122BC;CUNEIFORM SIGN SHE OVER SHE GAD OVER GAD GAR OVER GAR;Lo;0;L;;;;;N;;;;; 122BD;CUNEIFORM SIGN SHE OVER SHE TAB OVER TAB GAR OVER GAR;Lo;0;L;;;;;N;;;;; 122BE;CUNEIFORM SIGN SHEG9;Lo;0;L;;;;;N;;;;; 122BF;CUNEIFORM SIGN SHEN;Lo;0;L;;;;;N;;;;; 122C0;CUNEIFORM SIGN SHESH;Lo;0;L;;;;;N;;;;; 122C1;CUNEIFORM SIGN SHESH2;Lo;0;L;;;;;N;;;;; 122C2;CUNEIFORM SIGN SHESHLAM;Lo;0;L;;;;;N;;;;; 122C3;CUNEIFORM SIGN SHID;Lo;0;L;;;;;N;;;;; 122C4;CUNEIFORM SIGN SHID TIMES A;Lo;0;L;;;;;N;;;;; 122C5;CUNEIFORM SIGN SHID TIMES IM;Lo;0;L;;;;;N;;;;; 122C6;CUNEIFORM SIGN SHIM;Lo;0;L;;;;;N;;;;; 122C7;CUNEIFORM SIGN SHIM TIMES A;Lo;0;L;;;;;N;;;;; 122C8;CUNEIFORM SIGN SHIM TIMES BAL;Lo;0;L;;;;;N;;;;; 122C9;CUNEIFORM SIGN SHIM TIMES BULUG;Lo;0;L;;;;;N;;;;; 122CA;CUNEIFORM SIGN SHIM TIMES DIN;Lo;0;L;;;;;N;;;;; 122CB;CUNEIFORM SIGN SHIM TIMES GAR;Lo;0;L;;;;;N;;;;; 122CC;CUNEIFORM SIGN SHIM TIMES IGI;Lo;0;L;;;;;N;;;;; 122CD;CUNEIFORM SIGN SHIM TIMES IGI GUNU;Lo;0;L;;;;;N;;;;; 122CE;CUNEIFORM SIGN SHIM TIMES KUSHU2;Lo;0;L;;;;;N;;;;; 122CF;CUNEIFORM SIGN SHIM TIMES LUL;Lo;0;L;;;;;N;;;;; 122D0;CUNEIFORM SIGN SHIM TIMES MUG;Lo;0;L;;;;;N;;;;; 122D1;CUNEIFORM SIGN SHIM TIMES SAL;Lo;0;L;;;;;N;;;;; 122D2;CUNEIFORM SIGN SHINIG;Lo;0;L;;;;;N;;;;; 122D3;CUNEIFORM SIGN SHIR;Lo;0;L;;;;;N;;;;; 122D4;CUNEIFORM SIGN SHIR TENU;Lo;0;L;;;;;N;;;;; 122D5;CUNEIFORM SIGN SHIR OVER SHIR BUR OVER BUR;Lo;0;L;;;;;N;;;;; 122D6;CUNEIFORM SIGN SHITA;Lo;0;L;;;;;N;;;;; 122D7;CUNEIFORM SIGN SHU;Lo;0;L;;;;;N;;;;; 122D8;CUNEIFORM SIGN SHU OVER INVERTED SHU;Lo;0;L;;;;;N;;;;; 122D9;CUNEIFORM SIGN SHU2;Lo;0;L;;;;;N;;;;; 122DA;CUNEIFORM SIGN SHUBUR;Lo;0;L;;;;;N;;;;; 122DB;CUNEIFORM SIGN SI;Lo;0;L;;;;;N;;;;; 122DC;CUNEIFORM SIGN SI GUNU;Lo;0;L;;;;;N;;;;; 122DD;CUNEIFORM SIGN SIG;Lo;0;L;;;;;N;;;;; 122DE;CUNEIFORM SIGN SIG4;Lo;0;L;;;;;N;;;;; 122DF;CUNEIFORM SIGN SIG4 OVER SIG4 SHU2;Lo;0;L;;;;;N;;;;; 122E0;CUNEIFORM SIGN SIK2;Lo;0;L;;;;;N;;;;; 122E1;CUNEIFORM SIGN SILA3;Lo;0;L;;;;;N;;;;; 122E2;CUNEIFORM SIGN SU;Lo;0;L;;;;;N;;;;; 122E3;CUNEIFORM SIGN SU OVER SU;Lo;0;L;;;;;N;;;;; 122E4;CUNEIFORM SIGN SUD;Lo;0;L;;;;;N;;;;; 122E5;CUNEIFORM SIGN SUD2;Lo;0;L;;;;;N;;;;; 122E6;CUNEIFORM SIGN SUHUR;Lo;0;L;;;;;N;;;;; 122E7;CUNEIFORM SIGN SUM;Lo;0;L;;;;;N;;;;; 122E8;CUNEIFORM SIGN SUMASH;Lo;0;L;;;;;N;;;;; 122E9;CUNEIFORM SIGN SUR;Lo;0;L;;;;;N;;;;; 122EA;CUNEIFORM SIGN SUR9;Lo;0;L;;;;;N;;;;; 122EB;CUNEIFORM SIGN TA;Lo;0;L;;;;;N;;;;; 122EC;CUNEIFORM SIGN TA ASTERISK;Lo;0;L;;;;;N;;;;; 122ED;CUNEIFORM SIGN TA TIMES HI;Lo;0;L;;;;;N;;;;; 122EE;CUNEIFORM SIGN TA TIMES MI;Lo;0;L;;;;;N;;;;; 122EF;CUNEIFORM SIGN TA GUNU;Lo;0;L;;;;;N;;;;; 122F0;CUNEIFORM SIGN TAB;Lo;0;L;;;;;N;;;;; 122F1;CUNEIFORM SIGN TAB OVER TAB NI OVER NI DISH OVER DISH;Lo;0;L;;;;;N;;;;; 122F2;CUNEIFORM SIGN TAB SQUARED;Lo;0;L;;;;;N;;;;; 122F3;CUNEIFORM SIGN TAG;Lo;0;L;;;;;N;;;;; 122F4;CUNEIFORM SIGN TAG TIMES BI;Lo;0;L;;;;;N;;;;; 122F5;CUNEIFORM SIGN TAG TIMES GUD;Lo;0;L;;;;;N;;;;; 122F6;CUNEIFORM SIGN TAG TIMES SHE;Lo;0;L;;;;;N;;;;; 122F7;CUNEIFORM SIGN TAG TIMES SHU;Lo;0;L;;;;;N;;;;; 122F8;CUNEIFORM SIGN TAG TIMES TUG2;Lo;0;L;;;;;N;;;;; 122F9;CUNEIFORM SIGN TAG TIMES UD;Lo;0;L;;;;;N;;;;; 122FA;CUNEIFORM SIGN TAK4;Lo;0;L;;;;;N;;;;; 122FB;CUNEIFORM SIGN TAR;Lo;0;L;;;;;N;;;;; 122FC;CUNEIFORM SIGN TE;Lo;0;L;;;;;N;;;;; 122FD;CUNEIFORM SIGN TE GUNU;Lo;0;L;;;;;N;;;;; 122FE;CUNEIFORM SIGN TI;Lo;0;L;;;;;N;;;;; 122FF;CUNEIFORM SIGN TI TENU;Lo;0;L;;;;;N;;;;; 12300;CUNEIFORM SIGN TIL;Lo;0;L;;;;;N;;;;; 12301;CUNEIFORM SIGN TIR;Lo;0;L;;;;;N;;;;; 12302;CUNEIFORM SIGN TIR TIMES TAK4;Lo;0;L;;;;;N;;;;; 12303;CUNEIFORM SIGN TIR OVER TIR;Lo;0;L;;;;;N;;;;; 12304;CUNEIFORM SIGN TIR OVER TIR GAD OVER GAD GAR OVER GAR;Lo;0;L;;;;;N;;;;; 12305;CUNEIFORM SIGN TU;Lo;0;L;;;;;N;;;;; 12306;CUNEIFORM SIGN TUG2;Lo;0;L;;;;;N;;;;; 12307;CUNEIFORM SIGN TUK;Lo;0;L;;;;;N;;;;; 12308;CUNEIFORM SIGN TUM;Lo;0;L;;;;;N;;;;; 12309;CUNEIFORM SIGN TUR;Lo;0;L;;;;;N;;;;; 1230A;CUNEIFORM SIGN TUR OVER TUR ZA OVER ZA;Lo;0;L;;;;;N;;;;; 1230B;CUNEIFORM SIGN U;Lo;0;L;;;;;N;;;;; 1230C;CUNEIFORM SIGN U GUD;Lo;0;L;;;;;N;;;;; 1230D;CUNEIFORM SIGN U U U;Lo;0;L;;;;;N;;;;; 1230E;CUNEIFORM SIGN U OVER U PA OVER PA GAR OVER GAR;Lo;0;L;;;;;N;;;;; 1230F;CUNEIFORM SIGN U OVER U SUR OVER SUR;Lo;0;L;;;;;N;;;;; 12310;CUNEIFORM SIGN U OVER U U REVERSED OVER U REVERSED;Lo;0;L;;;;;N;;;;; 12311;CUNEIFORM SIGN U2;Lo;0;L;;;;;N;;;;; 12312;CUNEIFORM SIGN UB;Lo;0;L;;;;;N;;;;; 12313;CUNEIFORM SIGN UD;Lo;0;L;;;;;N;;;;; 12314;CUNEIFORM SIGN UD KUSHU2;Lo;0;L;;;;;N;;;;; 12315;CUNEIFORM SIGN UD TIMES BAD;Lo;0;L;;;;;N;;;;; 12316;CUNEIFORM SIGN UD TIMES MI;Lo;0;L;;;;;N;;;;; 12317;CUNEIFORM SIGN UD TIMES U PLUS U PLUS U;Lo;0;L;;;;;N;;;;; 12318;CUNEIFORM SIGN UD TIMES U PLUS U PLUS U GUNU;Lo;0;L;;;;;N;;;;; 12319;CUNEIFORM SIGN UD GUNU;Lo;0;L;;;;;N;;;;; 1231A;CUNEIFORM SIGN UD SHESHIG;Lo;0;L;;;;;N;;;;; 1231B;CUNEIFORM SIGN UD SHESHIG TIMES BAD;Lo;0;L;;;;;N;;;;; 1231C;CUNEIFORM SIGN UDUG;Lo;0;L;;;;;N;;;;; 1231D;CUNEIFORM SIGN UM;Lo;0;L;;;;;N;;;;; 1231E;CUNEIFORM SIGN UM TIMES LAGAB;Lo;0;L;;;;;N;;;;; 1231F;CUNEIFORM SIGN UM TIMES ME PLUS DA;Lo;0;L;;;;;N;;;;; 12320;CUNEIFORM SIGN UM TIMES SHA3;Lo;0;L;;;;;N;;;;; 12321;CUNEIFORM SIGN UM TIMES U;Lo;0;L;;;;;N;;;;; 12322;CUNEIFORM SIGN UMBIN;Lo;0;L;;;;;N;;;;; 12323;CUNEIFORM SIGN UMUM;Lo;0;L;;;;;N;;;;; 12324;CUNEIFORM SIGN UMUM TIMES KASKAL;Lo;0;L;;;;;N;;;;; 12325;CUNEIFORM SIGN UMUM TIMES PA;Lo;0;L;;;;;N;;;;; 12326;CUNEIFORM SIGN UN;Lo;0;L;;;;;N;;;;; 12327;CUNEIFORM SIGN UN GUNU;Lo;0;L;;;;;N;;;;; 12328;CUNEIFORM SIGN UR;Lo;0;L;;;;;N;;;;; 12329;CUNEIFORM SIGN UR CROSSING UR;Lo;0;L;;;;;N;;;;; 1232A;CUNEIFORM SIGN UR SHESHIG;Lo;0;L;;;;;N;;;;; 1232B;CUNEIFORM SIGN UR2;Lo;0;L;;;;;N;;;;; 1232C;CUNEIFORM SIGN UR2 TIMES A PLUS HA;Lo;0;L;;;;;N;;;;; 1232D;CUNEIFORM SIGN UR2 TIMES A PLUS NA;Lo;0;L;;;;;N;;;;; 1232E;CUNEIFORM SIGN UR2 TIMES AL;Lo;0;L;;;;;N;;;;; 1232F;CUNEIFORM SIGN UR2 TIMES HA;Lo;0;L;;;;;N;;;;; 12330;CUNEIFORM SIGN UR2 TIMES NUN;Lo;0;L;;;;;N;;;;; 12331;CUNEIFORM SIGN UR2 TIMES U2;Lo;0;L;;;;;N;;;;; 12332;CUNEIFORM SIGN UR2 TIMES U2 PLUS ASH;Lo;0;L;;;;;N;;;;; 12333;CUNEIFORM SIGN UR2 TIMES U2 PLUS BI;Lo;0;L;;;;;N;;;;; 12334;CUNEIFORM SIGN UR4;Lo;0;L;;;;;N;;;;; 12335;CUNEIFORM SIGN URI;Lo;0;L;;;;;N;;;;; 12336;CUNEIFORM SIGN URI3;Lo;0;L;;;;;N;;;;; 12337;CUNEIFORM SIGN URU;Lo;0;L;;;;;N;;;;; 12338;CUNEIFORM SIGN URU TIMES A;Lo;0;L;;;;;N;;;;; 12339;CUNEIFORM SIGN URU TIMES ASHGAB;Lo;0;L;;;;;N;;;;; 1233A;CUNEIFORM SIGN URU TIMES BAR;Lo;0;L;;;;;N;;;;; 1233B;CUNEIFORM SIGN URU TIMES DUN;Lo;0;L;;;;;N;;;;; 1233C;CUNEIFORM SIGN URU TIMES GA;Lo;0;L;;;;;N;;;;; 1233D;CUNEIFORM SIGN URU TIMES GAL;Lo;0;L;;;;;N;;;;; 1233E;CUNEIFORM SIGN URU TIMES GAN2 TENU;Lo;0;L;;;;;N;;;;; 1233F;CUNEIFORM SIGN URU TIMES GAR;Lo;0;L;;;;;N;;;;; 12340;CUNEIFORM SIGN URU TIMES GU;Lo;0;L;;;;;N;;;;; 12341;CUNEIFORM SIGN URU TIMES HA;Lo;0;L;;;;;N;;;;; 12342;CUNEIFORM SIGN URU TIMES IGI;Lo;0;L;;;;;N;;;;; 12343;CUNEIFORM SIGN URU TIMES IM;Lo;0;L;;;;;N;;;;; 12344;CUNEIFORM SIGN URU TIMES ISH;Lo;0;L;;;;;N;;;;; 12345;CUNEIFORM SIGN URU TIMES KI;Lo;0;L;;;;;N;;;;; 12346;CUNEIFORM SIGN URU TIMES LUM;Lo;0;L;;;;;N;;;;; 12347;CUNEIFORM SIGN URU TIMES MIN;Lo;0;L;;;;;N;;;;; 12348;CUNEIFORM SIGN URU TIMES PA;Lo;0;L;;;;;N;;;;; 12349;CUNEIFORM SIGN URU TIMES SHE;Lo;0;L;;;;;N;;;;; 1234A;CUNEIFORM SIGN URU TIMES SIG4;Lo;0;L;;;;;N;;;;; 1234B;CUNEIFORM SIGN URU TIMES TU;Lo;0;L;;;;;N;;;;; 1234C;CUNEIFORM SIGN URU TIMES U PLUS GUD;Lo;0;L;;;;;N;;;;; 1234D;CUNEIFORM SIGN URU TIMES UD;Lo;0;L;;;;;N;;;;; 1234E;CUNEIFORM SIGN URU TIMES URUDA;Lo;0;L;;;;;N;;;;; 1234F;CUNEIFORM SIGN URUDA;Lo;0;L;;;;;N;;;;; 12350;CUNEIFORM SIGN URUDA TIMES U;Lo;0;L;;;;;N;;;;; 12351;CUNEIFORM SIGN USH;Lo;0;L;;;;;N;;;;; 12352;CUNEIFORM SIGN USH TIMES A;Lo;0;L;;;;;N;;;;; 12353;CUNEIFORM SIGN USH TIMES KU;Lo;0;L;;;;;N;;;;; 12354;CUNEIFORM SIGN USH TIMES KUR;Lo;0;L;;;;;N;;;;; 12355;CUNEIFORM SIGN USH TIMES TAK4;Lo;0;L;;;;;N;;;;; 12356;CUNEIFORM SIGN USHX;Lo;0;L;;;;;N;;;;; 12357;CUNEIFORM SIGN USH2;Lo;0;L;;;;;N;;;;; 12358;CUNEIFORM SIGN USHUMX;Lo;0;L;;;;;N;;;;; 12359;CUNEIFORM SIGN UTUKI;Lo;0;L;;;;;N;;;;; 1235A;CUNEIFORM SIGN UZ3;Lo;0;L;;;;;N;;;;; 1235B;CUNEIFORM SIGN UZ3 TIMES KASKAL;Lo;0;L;;;;;N;;;;; 1235C;CUNEIFORM SIGN UZU;Lo;0;L;;;;;N;;;;; 1235D;CUNEIFORM SIGN ZA;Lo;0;L;;;;;N;;;;; 1235E;CUNEIFORM SIGN ZA TENU;Lo;0;L;;;;;N;;;;; 1235F;CUNEIFORM SIGN ZA SQUARED TIMES KUR;Lo;0;L;;;;;N;;;;; 12360;CUNEIFORM SIGN ZAG;Lo;0;L;;;;;N;;;;; 12361;CUNEIFORM SIGN ZAMX;Lo;0;L;;;;;N;;;;; 12362;CUNEIFORM SIGN ZE2;Lo;0;L;;;;;N;;;;; 12363;CUNEIFORM SIGN ZI;Lo;0;L;;;;;N;;;;; 12364;CUNEIFORM SIGN ZI OVER ZI;Lo;0;L;;;;;N;;;;; 12365;CUNEIFORM SIGN ZI3;Lo;0;L;;;;;N;;;;; 12366;CUNEIFORM SIGN ZIB;Lo;0;L;;;;;N;;;;; 12367;CUNEIFORM SIGN ZIB KABA TENU;Lo;0;L;;;;;N;;;;; 12368;CUNEIFORM SIGN ZIG;Lo;0;L;;;;;N;;;;; 12369;CUNEIFORM SIGN ZIZ2;Lo;0;L;;;;;N;;;;; 1236A;CUNEIFORM SIGN ZU;Lo;0;L;;;;;N;;;;; 1236B;CUNEIFORM SIGN ZU5;Lo;0;L;;;;;N;;;;; 1236C;CUNEIFORM SIGN ZU5 TIMES A;Lo;0;L;;;;;N;;;;; 1236D;CUNEIFORM SIGN ZUBUR;Lo;0;L;;;;;N;;;;; 1236E;CUNEIFORM SIGN ZUM;Lo;0;L;;;;;N;;;;; 12400;CUNEIFORM NUMERIC SIGN TWO ASH;Nl;0;L;;;;2;N;;;;; 12401;CUNEIFORM NUMERIC SIGN THREE ASH;Nl;0;L;;;;3;N;;;;; 12402;CUNEIFORM NUMERIC SIGN FOUR ASH;Nl;0;L;;;;4;N;;;;; 12403;CUNEIFORM NUMERIC SIGN FIVE ASH;Nl;0;L;;;;5;N;;;;; 12404;CUNEIFORM NUMERIC SIGN SIX ASH;Nl;0;L;;;;6;N;;;;; 12405;CUNEIFORM NUMERIC SIGN SEVEN ASH;Nl;0;L;;;;7;N;;;;; 12406;CUNEIFORM NUMERIC SIGN EIGHT ASH;Nl;0;L;;;;8;N;;;;; 12407;CUNEIFORM NUMERIC SIGN NINE ASH;Nl;0;L;;;;9;N;;;;; 12408;CUNEIFORM NUMERIC SIGN THREE DISH;Nl;0;L;;;;3;N;;;;; 12409;CUNEIFORM NUMERIC SIGN FOUR DISH;Nl;0;L;;;;4;N;;;;; 1240A;CUNEIFORM NUMERIC SIGN FIVE DISH;Nl;0;L;;;;5;N;;;;; 1240B;CUNEIFORM NUMERIC SIGN SIX DISH;Nl;0;L;;;;6;N;;;;; 1240C;CUNEIFORM NUMERIC SIGN SEVEN DISH;Nl;0;L;;;;7;N;;;;; 1240D;CUNEIFORM NUMERIC SIGN EIGHT DISH;Nl;0;L;;;;8;N;;;;; 1240E;CUNEIFORM NUMERIC SIGN NINE DISH;Nl;0;L;;;;9;N;;;;; 1240F;CUNEIFORM NUMERIC SIGN FOUR U;Nl;0;L;;;;4;N;;;;; 12410;CUNEIFORM NUMERIC SIGN FIVE U;Nl;0;L;;;;5;N;;;;; 12411;CUNEIFORM NUMERIC SIGN SIX U;Nl;0;L;;;;6;N;;;;; 12412;CUNEIFORM NUMERIC SIGN SEVEN U;Nl;0;L;;;;7;N;;;;; 12413;CUNEIFORM NUMERIC SIGN EIGHT U;Nl;0;L;;;;8;N;;;;; 12414;CUNEIFORM NUMERIC SIGN NINE U;Nl;0;L;;;;9;N;;;;; 12415;CUNEIFORM NUMERIC SIGN ONE GESH2;Nl;0;L;;;;1;N;;;;; 12416;CUNEIFORM NUMERIC SIGN TWO GESH2;Nl;0;L;;;;2;N;;;;; 12417;CUNEIFORM NUMERIC SIGN THREE GESH2;Nl;0;L;;;;3;N;;;;; 12418;CUNEIFORM NUMERIC SIGN FOUR GESH2;Nl;0;L;;;;4;N;;;;; 12419;CUNEIFORM NUMERIC SIGN FIVE GESH2;Nl;0;L;;;;5;N;;;;; 1241A;CUNEIFORM NUMERIC SIGN SIX GESH2;Nl;0;L;;;;6;N;;;;; 1241B;CUNEIFORM NUMERIC SIGN SEVEN GESH2;Nl;0;L;;;;7;N;;;;; 1241C;CUNEIFORM NUMERIC SIGN EIGHT GESH2;Nl;0;L;;;;8;N;;;;; 1241D;CUNEIFORM NUMERIC SIGN NINE GESH2;Nl;0;L;;;;9;N;;;;; 1241E;CUNEIFORM NUMERIC SIGN ONE GESHU;Nl;0;L;;;;1;N;;;;; 1241F;CUNEIFORM NUMERIC SIGN TWO GESHU;Nl;0;L;;;;2;N;;;;; 12420;CUNEIFORM NUMERIC SIGN THREE GESHU;Nl;0;L;;;;3;N;;;;; 12421;CUNEIFORM NUMERIC SIGN FOUR GESHU;Nl;0;L;;;;4;N;;;;; 12422;CUNEIFORM NUMERIC SIGN FIVE GESHU;Nl;0;L;;;;5;N;;;;; 12423;CUNEIFORM NUMERIC SIGN TWO SHAR2;Nl;0;L;;;;2;N;;;;; 12424;CUNEIFORM NUMERIC SIGN THREE SHAR2;Nl;0;L;;;;3;N;;;;; 12425;CUNEIFORM NUMERIC SIGN THREE SHAR2 VARIANT FORM;Nl;0;L;;;;3;N;;;;; 12426;CUNEIFORM NUMERIC SIGN FOUR SHAR2;Nl;0;L;;;;4;N;;;;; 12427;CUNEIFORM NUMERIC SIGN FIVE SHAR2;Nl;0;L;;;;5;N;;;;; 12428;CUNEIFORM NUMERIC SIGN SIX SHAR2;Nl;0;L;;;;6;N;;;;; 12429;CUNEIFORM NUMERIC SIGN SEVEN SHAR2;Nl;0;L;;;;7;N;;;;; 1242A;CUNEIFORM NUMERIC SIGN EIGHT SHAR2;Nl;0;L;;;;8;N;;;;; 1242B;CUNEIFORM NUMERIC SIGN NINE SHAR2;Nl;0;L;;;;9;N;;;;; 1242C;CUNEIFORM NUMERIC SIGN ONE SHARU;Nl;0;L;;;;1;N;;;;; 1242D;CUNEIFORM NUMERIC SIGN TWO SHARU;Nl;0;L;;;;2;N;;;;; 1242E;CUNEIFORM NUMERIC SIGN THREE SHARU;Nl;0;L;;;;3;N;;;;; 1242F;CUNEIFORM NUMERIC SIGN THREE SHARU VARIANT FORM;Nl;0;L;;;;3;N;;;;; 12430;CUNEIFORM NUMERIC SIGN FOUR SHARU;Nl;0;L;;;;4;N;;;;; 12431;CUNEIFORM NUMERIC SIGN FIVE SHARU;Nl;0;L;;;;5;N;;;;; 12432;CUNEIFORM NUMERIC SIGN SHAR2 TIMES GAL PLUS DISH;Nl;0;L;;;;;N;;;;; 12433;CUNEIFORM NUMERIC SIGN SHAR2 TIMES GAL PLUS MIN;Nl;0;L;;;;;N;;;;; 12434;CUNEIFORM NUMERIC SIGN ONE BURU;Nl;0;L;;;;1;N;;;;; 12435;CUNEIFORM NUMERIC SIGN TWO BURU;Nl;0;L;;;;2;N;;;;; 12436;CUNEIFORM NUMERIC SIGN THREE BURU;Nl;0;L;;;;3;N;;;;; 12437;CUNEIFORM NUMERIC SIGN THREE BURU VARIANT FORM;Nl;0;L;;;;3;N;;;;; 12438;CUNEIFORM NUMERIC SIGN FOUR BURU;Nl;0;L;;;;4;N;;;;; 12439;CUNEIFORM NUMERIC SIGN FIVE BURU;Nl;0;L;;;;5;N;;;;; 1243A;CUNEIFORM NUMERIC SIGN THREE VARIANT FORM ESH16;Nl;0;L;;;;3;N;;;;; 1243B;CUNEIFORM NUMERIC SIGN THREE VARIANT FORM ESH21;Nl;0;L;;;;3;N;;;;; 1243C;CUNEIFORM NUMERIC SIGN FOUR VARIANT FORM LIMMU;Nl;0;L;;;;4;N;;;;; 1243D;CUNEIFORM NUMERIC SIGN FOUR VARIANT FORM LIMMU4;Nl;0;L;;;;4;N;;;;; 1243E;CUNEIFORM NUMERIC SIGN FOUR VARIANT FORM LIMMU A;Nl;0;L;;;;4;N;;;;; 1243F;CUNEIFORM NUMERIC SIGN FOUR VARIANT FORM LIMMU B;Nl;0;L;;;;4;N;;;;; 12440;CUNEIFORM NUMERIC SIGN SIX VARIANT FORM ASH9;Nl;0;L;;;;6;N;;;;; 12441;CUNEIFORM NUMERIC SIGN SEVEN VARIANT FORM IMIN3;Nl;0;L;;;;7;N;;;;; 12442;CUNEIFORM NUMERIC SIGN SEVEN VARIANT FORM IMIN A;Nl;0;L;;;;7;N;;;;; 12443;CUNEIFORM NUMERIC SIGN SEVEN VARIANT FORM IMIN B;Nl;0;L;;;;7;N;;;;; 12444;CUNEIFORM NUMERIC SIGN EIGHT VARIANT FORM USSU;Nl;0;L;;;;8;N;;;;; 12445;CUNEIFORM NUMERIC SIGN EIGHT VARIANT FORM USSU3;Nl;0;L;;;;8;N;;;;; 12446;CUNEIFORM NUMERIC SIGN NINE VARIANT FORM ILIMMU;Nl;0;L;;;;9;N;;;;; 12447;CUNEIFORM NUMERIC SIGN NINE VARIANT FORM ILIMMU3;Nl;0;L;;;;9;N;;;;; 12448;CUNEIFORM NUMERIC SIGN NINE VARIANT FORM ILIMMU4;Nl;0;L;;;;9;N;;;;; 12449;CUNEIFORM NUMERIC SIGN NINE VARIANT FORM ILIMMU A;Nl;0;L;;;;9;N;;;;; 1244A;CUNEIFORM NUMERIC SIGN TWO ASH TENU;Nl;0;L;;;;2;N;;;;; 1244B;CUNEIFORM NUMERIC SIGN THREE ASH TENU;Nl;0;L;;;;3;N;;;;; 1244C;CUNEIFORM NUMERIC SIGN FOUR ASH TENU;Nl;0;L;;;;4;N;;;;; 1244D;CUNEIFORM NUMERIC SIGN FIVE ASH TENU;Nl;0;L;;;;5;N;;;;; 1244E;CUNEIFORM NUMERIC SIGN SIX ASH TENU;Nl;0;L;;;;6;N;;;;; 1244F;CUNEIFORM NUMERIC SIGN ONE BAN2;Nl;0;L;;;;1;N;;;;; 12450;CUNEIFORM NUMERIC SIGN TWO BAN2;Nl;0;L;;;;2;N;;;;; 12451;CUNEIFORM NUMERIC SIGN THREE BAN2;Nl;0;L;;;;3;N;;;;; 12452;CUNEIFORM NUMERIC SIGN FOUR BAN2;Nl;0;L;;;;4;N;;;;; 12453;CUNEIFORM NUMERIC SIGN FOUR BAN2 VARIANT FORM;Nl;0;L;;;;4;N;;;;; 12454;CUNEIFORM NUMERIC SIGN FIVE BAN2;Nl;0;L;;;;5;N;;;;; 12455;CUNEIFORM NUMERIC SIGN FIVE BAN2 VARIANT FORM;Nl;0;L;;;;5;N;;;;; 12456;CUNEIFORM NUMERIC SIGN NIGIDAMIN;Nl;0;L;;;;;N;;;;; 12457;CUNEIFORM NUMERIC SIGN NIGIDAESH;Nl;0;L;;;;;N;;;;; 12458;CUNEIFORM NUMERIC SIGN ONE ESHE3;Nl;0;L;;;;1;N;;;;; 12459;CUNEIFORM NUMERIC SIGN TWO ESHE3;Nl;0;L;;;;2;N;;;;; 1245A;CUNEIFORM NUMERIC SIGN ONE THIRD DISH;Nl;0;L;;;;1/3;N;;;;; 1245B;CUNEIFORM NUMERIC SIGN TWO THIRDS DISH;Nl;0;L;;;;2/3;N;;;;; 1245C;CUNEIFORM NUMERIC SIGN FIVE SIXTHS DISH;Nl;0;L;;;;5/6;N;;;;; 1245D;CUNEIFORM NUMERIC SIGN ONE THIRD VARIANT FORM A;Nl;0;L;;;;1/3;N;;;;; 1245E;CUNEIFORM NUMERIC SIGN TWO THIRDS VARIANT FORM A;Nl;0;L;;;;2/3;N;;;;; 1245F;CUNEIFORM NUMERIC SIGN ONE EIGHTH ASH;Nl;0;L;;;;1/8;N;;;;; 12460;CUNEIFORM NUMERIC SIGN ONE QUARTER ASH;Nl;0;L;;;;1/4;N;;;;; 12461;CUNEIFORM NUMERIC SIGN OLD ASSYRIAN ONE SIXTH;Nl;0;L;;;;1/6;N;;;;; 12462;CUNEIFORM NUMERIC SIGN OLD ASSYRIAN ONE QUARTER;Nl;0;L;;;;1/4;N;;;;; 12470;CUNEIFORM PUNCTUATION SIGN OLD ASSYRIAN WORD DIVIDER;Po;0;L;;;;;N;;;;; 12471;CUNEIFORM PUNCTUATION SIGN VERTICAL COLON;Po;0;L;;;;;N;;;;; 12472;CUNEIFORM PUNCTUATION SIGN DIAGONAL COLON;Po;0;L;;;;;N;;;;; 12473;CUNEIFORM PUNCTUATION SIGN DIAGONAL TRICOLON;Po;0;L;;;;;N;;;;; 13000;EGYPTIAN HIEROGLYPH A001;Lo;0;L;;;;;N;;;;; 13001;EGYPTIAN HIEROGLYPH A002;Lo;0;L;;;;;N;;;;; 13002;EGYPTIAN HIEROGLYPH A003;Lo;0;L;;;;;N;;;;; 13003;EGYPTIAN HIEROGLYPH A004;Lo;0;L;;;;;N;;;;; 13004;EGYPTIAN HIEROGLYPH A005;Lo;0;L;;;;;N;;;;; 13005;EGYPTIAN HIEROGLYPH A005A;Lo;0;L;;;;;N;;;;; 13006;EGYPTIAN HIEROGLYPH A006;Lo;0;L;;;;;N;;;;; 13007;EGYPTIAN HIEROGLYPH A006A;Lo;0;L;;;;;N;;;;; 13008;EGYPTIAN HIEROGLYPH A006B;Lo;0;L;;;;;N;;;;; 13009;EGYPTIAN HIEROGLYPH A007;Lo;0;L;;;;;N;;;;; 1300A;EGYPTIAN HIEROGLYPH A008;Lo;0;L;;;;;N;;;;; 1300B;EGYPTIAN HIEROGLYPH A009;Lo;0;L;;;;;N;;;;; 1300C;EGYPTIAN HIEROGLYPH A010;Lo;0;L;;;;;N;;;;; 1300D;EGYPTIAN HIEROGLYPH A011;Lo;0;L;;;;;N;;;;; 1300E;EGYPTIAN HIEROGLYPH A012;Lo;0;L;;;;;N;;;;; 1300F;EGYPTIAN HIEROGLYPH A013;Lo;0;L;;;;;N;;;;; 13010;EGYPTIAN HIEROGLYPH A014;Lo;0;L;;;;;N;;;;; 13011;EGYPTIAN HIEROGLYPH A014A;Lo;0;L;;;;;N;;;;; 13012;EGYPTIAN HIEROGLYPH A015;Lo;0;L;;;;;N;;;;; 13013;EGYPTIAN HIEROGLYPH A016;Lo;0;L;;;;;N;;;;; 13014;EGYPTIAN HIEROGLYPH A017;Lo;0;L;;;;;N;;;;; 13015;EGYPTIAN HIEROGLYPH A017A;Lo;0;L;;;;;N;;;;; 13016;EGYPTIAN HIEROGLYPH A018;Lo;0;L;;;;;N;;;;; 13017;EGYPTIAN HIEROGLYPH A019;Lo;0;L;;;;;N;;;;; 13018;EGYPTIAN HIEROGLYPH A020;Lo;0;L;;;;;N;;;;; 13019;EGYPTIAN HIEROGLYPH A021;Lo;0;L;;;;;N;;;;; 1301A;EGYPTIAN HIEROGLYPH A022;Lo;0;L;;;;;N;;;;; 1301B;EGYPTIAN HIEROGLYPH A023;Lo;0;L;;;;;N;;;;; 1301C;EGYPTIAN HIEROGLYPH A024;Lo;0;L;;;;;N;;;;; 1301D;EGYPTIAN HIEROGLYPH A025;Lo;0;L;;;;;N;;;;; 1301E;EGYPTIAN HIEROGLYPH A026;Lo;0;L;;;;;N;;;;; 1301F;EGYPTIAN HIEROGLYPH A027;Lo;0;L;;;;;N;;;;; 13020;EGYPTIAN HIEROGLYPH A028;Lo;0;L;;;;;N;;;;; 13021;EGYPTIAN HIEROGLYPH A029;Lo;0;L;;;;;N;;;;; 13022;EGYPTIAN HIEROGLYPH A030;Lo;0;L;;;;;N;;;;; 13023;EGYPTIAN HIEROGLYPH A031;Lo;0;L;;;;;N;;;;; 13024;EGYPTIAN HIEROGLYPH A032;Lo;0;L;;;;;N;;;;; 13025;EGYPTIAN HIEROGLYPH A032A;Lo;0;L;;;;;N;;;;; 13026;EGYPTIAN HIEROGLYPH A033;Lo;0;L;;;;;N;;;;; 13027;EGYPTIAN HIEROGLYPH A034;Lo;0;L;;;;;N;;;;; 13028;EGYPTIAN HIEROGLYPH A035;Lo;0;L;;;;;N;;;;; 13029;EGYPTIAN HIEROGLYPH A036;Lo;0;L;;;;;N;;;;; 1302A;EGYPTIAN HIEROGLYPH A037;Lo;0;L;;;;;N;;;;; 1302B;EGYPTIAN HIEROGLYPH A038;Lo;0;L;;;;;N;;;;; 1302C;EGYPTIAN HIEROGLYPH A039;Lo;0;L;;;;;N;;;;; 1302D;EGYPTIAN HIEROGLYPH A040;Lo;0;L;;;;;N;;;;; 1302E;EGYPTIAN HIEROGLYPH A040A;Lo;0;L;;;;;N;;;;; 1302F;EGYPTIAN HIEROGLYPH A041;Lo;0;L;;;;;N;;;;; 13030;EGYPTIAN HIEROGLYPH A042;Lo;0;L;;;;;N;;;;; 13031;EGYPTIAN HIEROGLYPH A042A;Lo;0;L;;;;;N;;;;; 13032;EGYPTIAN HIEROGLYPH A043;Lo;0;L;;;;;N;;;;; 13033;EGYPTIAN HIEROGLYPH A043A;Lo;0;L;;;;;N;;;;; 13034;EGYPTIAN HIEROGLYPH A044;Lo;0;L;;;;;N;;;;; 13035;EGYPTIAN HIEROGLYPH A045;Lo;0;L;;;;;N;;;;; 13036;EGYPTIAN HIEROGLYPH A045A;Lo;0;L;;;;;N;;;;; 13037;EGYPTIAN HIEROGLYPH A046;Lo;0;L;;;;;N;;;;; 13038;EGYPTIAN HIEROGLYPH A047;Lo;0;L;;;;;N;;;;; 13039;EGYPTIAN HIEROGLYPH A048;Lo;0;L;;;;;N;;;;; 1303A;EGYPTIAN HIEROGLYPH A049;Lo;0;L;;;;;N;;;;; 1303B;EGYPTIAN HIEROGLYPH A050;Lo;0;L;;;;;N;;;;; 1303C;EGYPTIAN HIEROGLYPH A051;Lo;0;L;;;;;N;;;;; 1303D;EGYPTIAN HIEROGLYPH A052;Lo;0;L;;;;;N;;;;; 1303E;EGYPTIAN HIEROGLYPH A053;Lo;0;L;;;;;N;;;;; 1303F;EGYPTIAN HIEROGLYPH A054;Lo;0;L;;;;;N;;;;; 13040;EGYPTIAN HIEROGLYPH A055;Lo;0;L;;;;;N;;;;; 13041;EGYPTIAN HIEROGLYPH A056;Lo;0;L;;;;;N;;;;; 13042;EGYPTIAN HIEROGLYPH A057;Lo;0;L;;;;;N;;;;; 13043;EGYPTIAN HIEROGLYPH A058;Lo;0;L;;;;;N;;;;; 13044;EGYPTIAN HIEROGLYPH A059;Lo;0;L;;;;;N;;;;; 13045;EGYPTIAN HIEROGLYPH A060;Lo;0;L;;;;;N;;;;; 13046;EGYPTIAN HIEROGLYPH A061;Lo;0;L;;;;;N;;;;; 13047;EGYPTIAN HIEROGLYPH A062;Lo;0;L;;;;;N;;;;; 13048;EGYPTIAN HIEROGLYPH A063;Lo;0;L;;;;;N;;;;; 13049;EGYPTIAN HIEROGLYPH A064;Lo;0;L;;;;;N;;;;; 1304A;EGYPTIAN HIEROGLYPH A065;Lo;0;L;;;;;N;;;;; 1304B;EGYPTIAN HIEROGLYPH A066;Lo;0;L;;;;;N;;;;; 1304C;EGYPTIAN HIEROGLYPH A067;Lo;0;L;;;;;N;;;;; 1304D;EGYPTIAN HIEROGLYPH A068;Lo;0;L;;;;;N;;;;; 1304E;EGYPTIAN HIEROGLYPH A069;Lo;0;L;;;;;N;;;;; 1304F;EGYPTIAN HIEROGLYPH A070;Lo;0;L;;;;;N;;;;; 13050;EGYPTIAN HIEROGLYPH B001;Lo;0;L;;;;;N;;;;; 13051;EGYPTIAN HIEROGLYPH B002;Lo;0;L;;;;;N;;;;; 13052;EGYPTIAN HIEROGLYPH B003;Lo;0;L;;;;;N;;;;; 13053;EGYPTIAN HIEROGLYPH B004;Lo;0;L;;;;;N;;;;; 13054;EGYPTIAN HIEROGLYPH B005;Lo;0;L;;;;;N;;;;; 13055;EGYPTIAN HIEROGLYPH B005A;Lo;0;L;;;;;N;;;;; 13056;EGYPTIAN HIEROGLYPH B006;Lo;0;L;;;;;N;;;;; 13057;EGYPTIAN HIEROGLYPH B007;Lo;0;L;;;;;N;;;;; 13058;EGYPTIAN HIEROGLYPH B008;Lo;0;L;;;;;N;;;;; 13059;EGYPTIAN HIEROGLYPH B009;Lo;0;L;;;;;N;;;;; 1305A;EGYPTIAN HIEROGLYPH C001;Lo;0;L;;;;;N;;;;; 1305B;EGYPTIAN HIEROGLYPH C002;Lo;0;L;;;;;N;;;;; 1305C;EGYPTIAN HIEROGLYPH C002A;Lo;0;L;;;;;N;;;;; 1305D;EGYPTIAN HIEROGLYPH C002B;Lo;0;L;;;;;N;;;;; 1305E;EGYPTIAN HIEROGLYPH C002C;Lo;0;L;;;;;N;;;;; 1305F;EGYPTIAN HIEROGLYPH C003;Lo;0;L;;;;;N;;;;; 13060;EGYPTIAN HIEROGLYPH C004;Lo;0;L;;;;;N;;;;; 13061;EGYPTIAN HIEROGLYPH C005;Lo;0;L;;;;;N;;;;; 13062;EGYPTIAN HIEROGLYPH C006;Lo;0;L;;;;;N;;;;; 13063;EGYPTIAN HIEROGLYPH C007;Lo;0;L;;;;;N;;;;; 13064;EGYPTIAN HIEROGLYPH C008;Lo;0;L;;;;;N;;;;; 13065;EGYPTIAN HIEROGLYPH C009;Lo;0;L;;;;;N;;;;; 13066;EGYPTIAN HIEROGLYPH C010;Lo;0;L;;;;;N;;;;; 13067;EGYPTIAN HIEROGLYPH C010A;Lo;0;L;;;;;N;;;;; 13068;EGYPTIAN HIEROGLYPH C011;Lo;0;L;;;;;N;;;;; 13069;EGYPTIAN HIEROGLYPH C012;Lo;0;L;;;;;N;;;;; 1306A;EGYPTIAN HIEROGLYPH C013;Lo;0;L;;;;;N;;;;; 1306B;EGYPTIAN HIEROGLYPH C014;Lo;0;L;;;;;N;;;;; 1306C;EGYPTIAN HIEROGLYPH C015;Lo;0;L;;;;;N;;;;; 1306D;EGYPTIAN HIEROGLYPH C016;Lo;0;L;;;;;N;;;;; 1306E;EGYPTIAN HIEROGLYPH C017;Lo;0;L;;;;;N;;;;; 1306F;EGYPTIAN HIEROGLYPH C018;Lo;0;L;;;;;N;;;;; 13070;EGYPTIAN HIEROGLYPH C019;Lo;0;L;;;;;N;;;;; 13071;EGYPTIAN HIEROGLYPH C020;Lo;0;L;;;;;N;;;;; 13072;EGYPTIAN HIEROGLYPH C021;Lo;0;L;;;;;N;;;;; 13073;EGYPTIAN HIEROGLYPH C022;Lo;0;L;;;;;N;;;;; 13074;EGYPTIAN HIEROGLYPH C023;Lo;0;L;;;;;N;;;;; 13075;EGYPTIAN HIEROGLYPH C024;Lo;0;L;;;;;N;;;;; 13076;EGYPTIAN HIEROGLYPH D001;Lo;0;L;;;;;N;;;;; 13077;EGYPTIAN HIEROGLYPH D002;Lo;0;L;;;;;N;;;;; 13078;EGYPTIAN HIEROGLYPH D003;Lo;0;L;;;;;N;;;;; 13079;EGYPTIAN HIEROGLYPH D004;Lo;0;L;;;;;N;;;;; 1307A;EGYPTIAN HIEROGLYPH D005;Lo;0;L;;;;;N;;;;; 1307B;EGYPTIAN HIEROGLYPH D006;Lo;0;L;;;;;N;;;;; 1307C;EGYPTIAN HIEROGLYPH D007;Lo;0;L;;;;;N;;;;; 1307D;EGYPTIAN HIEROGLYPH D008;Lo;0;L;;;;;N;;;;; 1307E;EGYPTIAN HIEROGLYPH D008A;Lo;0;L;;;;;N;;;;; 1307F;EGYPTIAN HIEROGLYPH D009;Lo;0;L;;;;;N;;;;; 13080;EGYPTIAN HIEROGLYPH D010;Lo;0;L;;;;;N;;;;; 13081;EGYPTIAN HIEROGLYPH D011;Lo;0;L;;;;;N;;;;; 13082;EGYPTIAN HIEROGLYPH D012;Lo;0;L;;;;;N;;;;; 13083;EGYPTIAN HIEROGLYPH D013;Lo;0;L;;;;;N;;;;; 13084;EGYPTIAN HIEROGLYPH D014;Lo;0;L;;;;;N;;;;; 13085;EGYPTIAN HIEROGLYPH D015;Lo;0;L;;;;;N;;;;; 13086;EGYPTIAN HIEROGLYPH D016;Lo;0;L;;;;;N;;;;; 13087;EGYPTIAN HIEROGLYPH D017;Lo;0;L;;;;;N;;;;; 13088;EGYPTIAN HIEROGLYPH D018;Lo;0;L;;;;;N;;;;; 13089;EGYPTIAN HIEROGLYPH D019;Lo;0;L;;;;;N;;;;; 1308A;EGYPTIAN HIEROGLYPH D020;Lo;0;L;;;;;N;;;;; 1308B;EGYPTIAN HIEROGLYPH D021;Lo;0;L;;;;;N;;;;; 1308C;EGYPTIAN HIEROGLYPH D022;Lo;0;L;;;;;N;;;;; 1308D;EGYPTIAN HIEROGLYPH D023;Lo;0;L;;;;;N;;;;; 1308E;EGYPTIAN HIEROGLYPH D024;Lo;0;L;;;;;N;;;;; 1308F;EGYPTIAN HIEROGLYPH D025;Lo;0;L;;;;;N;;;;; 13090;EGYPTIAN HIEROGLYPH D026;Lo;0;L;;;;;N;;;;; 13091;EGYPTIAN HIEROGLYPH D027;Lo;0;L;;;;;N;;;;; 13092;EGYPTIAN HIEROGLYPH D027A;Lo;0;L;;;;;N;;;;; 13093;EGYPTIAN HIEROGLYPH D028;Lo;0;L;;;;;N;;;;; 13094;EGYPTIAN HIEROGLYPH D029;Lo;0;L;;;;;N;;;;; 13095;EGYPTIAN HIEROGLYPH D030;Lo;0;L;;;;;N;;;;; 13096;EGYPTIAN HIEROGLYPH D031;Lo;0;L;;;;;N;;;;; 13097;EGYPTIAN HIEROGLYPH D031A;Lo;0;L;;;;;N;;;;; 13098;EGYPTIAN HIEROGLYPH D032;Lo;0;L;;;;;N;;;;; 13099;EGYPTIAN HIEROGLYPH D033;Lo;0;L;;;;;N;;;;; 1309A;EGYPTIAN HIEROGLYPH D034;Lo;0;L;;;;;N;;;;; 1309B;EGYPTIAN HIEROGLYPH D034A;Lo;0;L;;;;;N;;;;; 1309C;EGYPTIAN HIEROGLYPH D035;Lo;0;L;;;;;N;;;;; 1309D;EGYPTIAN HIEROGLYPH D036;Lo;0;L;;;;;N;;;;; 1309E;EGYPTIAN HIEROGLYPH D037;Lo;0;L;;;;;N;;;;; 1309F;EGYPTIAN HIEROGLYPH D038;Lo;0;L;;;;;N;;;;; 130A0;EGYPTIAN HIEROGLYPH D039;Lo;0;L;;;;;N;;;;; 130A1;EGYPTIAN HIEROGLYPH D040;Lo;0;L;;;;;N;;;;; 130A2;EGYPTIAN HIEROGLYPH D041;Lo;0;L;;;;;N;;;;; 130A3;EGYPTIAN HIEROGLYPH D042;Lo;0;L;;;;;N;;;;; 130A4;EGYPTIAN HIEROGLYPH D043;Lo;0;L;;;;;N;;;;; 130A5;EGYPTIAN HIEROGLYPH D044;Lo;0;L;;;;;N;;;;; 130A6;EGYPTIAN HIEROGLYPH D045;Lo;0;L;;;;;N;;;;; 130A7;EGYPTIAN HIEROGLYPH D046;Lo;0;L;;;;;N;;;;; 130A8;EGYPTIAN HIEROGLYPH D046A;Lo;0;L;;;;;N;;;;; 130A9;EGYPTIAN HIEROGLYPH D047;Lo;0;L;;;;;N;;;;; 130AA;EGYPTIAN HIEROGLYPH D048;Lo;0;L;;;;;N;;;;; 130AB;EGYPTIAN HIEROGLYPH D048A;Lo;0;L;;;;;N;;;;; 130AC;EGYPTIAN HIEROGLYPH D049;Lo;0;L;;;;;N;;;;; 130AD;EGYPTIAN HIEROGLYPH D050;Lo;0;L;;;;;N;;;;; 130AE;EGYPTIAN HIEROGLYPH D050A;Lo;0;L;;;;;N;;;;; 130AF;EGYPTIAN HIEROGLYPH D050B;Lo;0;L;;;;;N;;;;; 130B0;EGYPTIAN HIEROGLYPH D050C;Lo;0;L;;;;;N;;;;; 130B1;EGYPTIAN HIEROGLYPH D050D;Lo;0;L;;;;;N;;;;; 130B2;EGYPTIAN HIEROGLYPH D050E;Lo;0;L;;;;;N;;;;; 130B3;EGYPTIAN HIEROGLYPH D050F;Lo;0;L;;;;;N;;;;; 130B4;EGYPTIAN HIEROGLYPH D050G;Lo;0;L;;;;;N;;;;; 130B5;EGYPTIAN HIEROGLYPH D050H;Lo;0;L;;;;;N;;;;; 130B6;EGYPTIAN HIEROGLYPH D050I;Lo;0;L;;;;;N;;;;; 130B7;EGYPTIAN HIEROGLYPH D051;Lo;0;L;;;;;N;;;;; 130B8;EGYPTIAN HIEROGLYPH D052;Lo;0;L;;;;;N;;;;; 130B9;EGYPTIAN HIEROGLYPH D052A;Lo;0;L;;;;;N;;;;; 130BA;EGYPTIAN HIEROGLYPH D053;Lo;0;L;;;;;N;;;;; 130BB;EGYPTIAN HIEROGLYPH D054;Lo;0;L;;;;;N;;;;; 130BC;EGYPTIAN HIEROGLYPH D054A;Lo;0;L;;;;;N;;;;; 130BD;EGYPTIAN HIEROGLYPH D055;Lo;0;L;;;;;N;;;;; 130BE;EGYPTIAN HIEROGLYPH D056;Lo;0;L;;;;;N;;;;; 130BF;EGYPTIAN HIEROGLYPH D057;Lo;0;L;;;;;N;;;;; 130C0;EGYPTIAN HIEROGLYPH D058;Lo;0;L;;;;;N;;;;; 130C1;EGYPTIAN HIEROGLYPH D059;Lo;0;L;;;;;N;;;;; 130C2;EGYPTIAN HIEROGLYPH D060;Lo;0;L;;;;;N;;;;; 130C3;EGYPTIAN HIEROGLYPH D061;Lo;0;L;;;;;N;;;;; 130C4;EGYPTIAN HIEROGLYPH D062;Lo;0;L;;;;;N;;;;; 130C5;EGYPTIAN HIEROGLYPH D063;Lo;0;L;;;;;N;;;;; 130C6;EGYPTIAN HIEROGLYPH D064;Lo;0;L;;;;;N;;;;; 130C7;EGYPTIAN HIEROGLYPH D065;Lo;0;L;;;;;N;;;;; 130C8;EGYPTIAN HIEROGLYPH D066;Lo;0;L;;;;;N;;;;; 130C9;EGYPTIAN HIEROGLYPH D067;Lo;0;L;;;;;N;;;;; 130CA;EGYPTIAN HIEROGLYPH D067A;Lo;0;L;;;;;N;;;;; 130CB;EGYPTIAN HIEROGLYPH D067B;Lo;0;L;;;;;N;;;;; 130CC;EGYPTIAN HIEROGLYPH D067C;Lo;0;L;;;;;N;;;;; 130CD;EGYPTIAN HIEROGLYPH D067D;Lo;0;L;;;;;N;;;;; 130CE;EGYPTIAN HIEROGLYPH D067E;Lo;0;L;;;;;N;;;;; 130CF;EGYPTIAN HIEROGLYPH D067F;Lo;0;L;;;;;N;;;;; 130D0;EGYPTIAN HIEROGLYPH D067G;Lo;0;L;;;;;N;;;;; 130D1;EGYPTIAN HIEROGLYPH D067H;Lo;0;L;;;;;N;;;;; 130D2;EGYPTIAN HIEROGLYPH E001;Lo;0;L;;;;;N;;;;; 130D3;EGYPTIAN HIEROGLYPH E002;Lo;0;L;;;;;N;;;;; 130D4;EGYPTIAN HIEROGLYPH E003;Lo;0;L;;;;;N;;;;; 130D5;EGYPTIAN HIEROGLYPH E004;Lo;0;L;;;;;N;;;;; 130D6;EGYPTIAN HIEROGLYPH E005;Lo;0;L;;;;;N;;;;; 130D7;EGYPTIAN HIEROGLYPH E006;Lo;0;L;;;;;N;;;;; 130D8;EGYPTIAN HIEROGLYPH E007;Lo;0;L;;;;;N;;;;; 130D9;EGYPTIAN HIEROGLYPH E008;Lo;0;L;;;;;N;;;;; 130DA;EGYPTIAN HIEROGLYPH E008A;Lo;0;L;;;;;N;;;;; 130DB;EGYPTIAN HIEROGLYPH E009;Lo;0;L;;;;;N;;;;; 130DC;EGYPTIAN HIEROGLYPH E009A;Lo;0;L;;;;;N;;;;; 130DD;EGYPTIAN HIEROGLYPH E010;Lo;0;L;;;;;N;;;;; 130DE;EGYPTIAN HIEROGLYPH E011;Lo;0;L;;;;;N;;;;; 130DF;EGYPTIAN HIEROGLYPH E012;Lo;0;L;;;;;N;;;;; 130E0;EGYPTIAN HIEROGLYPH E013;Lo;0;L;;;;;N;;;;; 130E1;EGYPTIAN HIEROGLYPH E014;Lo;0;L;;;;;N;;;;; 130E2;EGYPTIAN HIEROGLYPH E015;Lo;0;L;;;;;N;;;;; 130E3;EGYPTIAN HIEROGLYPH E016;Lo;0;L;;;;;N;;;;; 130E4;EGYPTIAN HIEROGLYPH E016A;Lo;0;L;;;;;N;;;;; 130E5;EGYPTIAN HIEROGLYPH E017;Lo;0;L;;;;;N;;;;; 130E6;EGYPTIAN HIEROGLYPH E017A;Lo;0;L;;;;;N;;;;; 130E7;EGYPTIAN HIEROGLYPH E018;Lo;0;L;;;;;N;;;;; 130E8;EGYPTIAN HIEROGLYPH E019;Lo;0;L;;;;;N;;;;; 130E9;EGYPTIAN HIEROGLYPH E020;Lo;0;L;;;;;N;;;;; 130EA;EGYPTIAN HIEROGLYPH E020A;Lo;0;L;;;;;N;;;;; 130EB;EGYPTIAN HIEROGLYPH E021;Lo;0;L;;;;;N;;;;; 130EC;EGYPTIAN HIEROGLYPH E022;Lo;0;L;;;;;N;;;;; 130ED;EGYPTIAN HIEROGLYPH E023;Lo;0;L;;;;;N;;;;; 130EE;EGYPTIAN HIEROGLYPH E024;Lo;0;L;;;;;N;;;;; 130EF;EGYPTIAN HIEROGLYPH E025;Lo;0;L;;;;;N;;;;; 130F0;EGYPTIAN HIEROGLYPH E026;Lo;0;L;;;;;N;;;;; 130F1;EGYPTIAN HIEROGLYPH E027;Lo;0;L;;;;;N;;;;; 130F2;EGYPTIAN HIEROGLYPH E028;Lo;0;L;;;;;N;;;;; 130F3;EGYPTIAN HIEROGLYPH E028A;Lo;0;L;;;;;N;;;;; 130F4;EGYPTIAN HIEROGLYPH E029;Lo;0;L;;;;;N;;;;; 130F5;EGYPTIAN HIEROGLYPH E030;Lo;0;L;;;;;N;;;;; 130F6;EGYPTIAN HIEROGLYPH E031;Lo;0;L;;;;;N;;;;; 130F7;EGYPTIAN HIEROGLYPH E032;Lo;0;L;;;;;N;;;;; 130F8;EGYPTIAN HIEROGLYPH E033;Lo;0;L;;;;;N;;;;; 130F9;EGYPTIAN HIEROGLYPH E034;Lo;0;L;;;;;N;;;;; 130FA;EGYPTIAN HIEROGLYPH E034A;Lo;0;L;;;;;N;;;;; 130FB;EGYPTIAN HIEROGLYPH E036;Lo;0;L;;;;;N;;;;; 130FC;EGYPTIAN HIEROGLYPH E037;Lo;0;L;;;;;N;;;;; 130FD;EGYPTIAN HIEROGLYPH E038;Lo;0;L;;;;;N;;;;; 130FE;EGYPTIAN HIEROGLYPH F001;Lo;0;L;;;;;N;;;;; 130FF;EGYPTIAN HIEROGLYPH F001A;Lo;0;L;;;;;N;;;;; 13100;EGYPTIAN HIEROGLYPH F002;Lo;0;L;;;;;N;;;;; 13101;EGYPTIAN HIEROGLYPH F003;Lo;0;L;;;;;N;;;;; 13102;EGYPTIAN HIEROGLYPH F004;Lo;0;L;;;;;N;;;;; 13103;EGYPTIAN HIEROGLYPH F005;Lo;0;L;;;;;N;;;;; 13104;EGYPTIAN HIEROGLYPH F006;Lo;0;L;;;;;N;;;;; 13105;EGYPTIAN HIEROGLYPH F007;Lo;0;L;;;;;N;;;;; 13106;EGYPTIAN HIEROGLYPH F008;Lo;0;L;;;;;N;;;;; 13107;EGYPTIAN HIEROGLYPH F009;Lo;0;L;;;;;N;;;;; 13108;EGYPTIAN HIEROGLYPH F010;Lo;0;L;;;;;N;;;;; 13109;EGYPTIAN HIEROGLYPH F011;Lo;0;L;;;;;N;;;;; 1310A;EGYPTIAN HIEROGLYPH F012;Lo;0;L;;;;;N;;;;; 1310B;EGYPTIAN HIEROGLYPH F013;Lo;0;L;;;;;N;;;;; 1310C;EGYPTIAN HIEROGLYPH F013A;Lo;0;L;;;;;N;;;;; 1310D;EGYPTIAN HIEROGLYPH F014;Lo;0;L;;;;;N;;;;; 1310E;EGYPTIAN HIEROGLYPH F015;Lo;0;L;;;;;N;;;;; 1310F;EGYPTIAN HIEROGLYPH F016;Lo;0;L;;;;;N;;;;; 13110;EGYPTIAN HIEROGLYPH F017;Lo;0;L;;;;;N;;;;; 13111;EGYPTIAN HIEROGLYPH F018;Lo;0;L;;;;;N;;;;; 13112;EGYPTIAN HIEROGLYPH F019;Lo;0;L;;;;;N;;;;; 13113;EGYPTIAN HIEROGLYPH F020;Lo;0;L;;;;;N;;;;; 13114;EGYPTIAN HIEROGLYPH F021;Lo;0;L;;;;;N;;;;; 13115;EGYPTIAN HIEROGLYPH F021A;Lo;0;L;;;;;N;;;;; 13116;EGYPTIAN HIEROGLYPH F022;Lo;0;L;;;;;N;;;;; 13117;EGYPTIAN HIEROGLYPH F023;Lo;0;L;;;;;N;;;;; 13118;EGYPTIAN HIEROGLYPH F024;Lo;0;L;;;;;N;;;;; 13119;EGYPTIAN HIEROGLYPH F025;Lo;0;L;;;;;N;;;;; 1311A;EGYPTIAN HIEROGLYPH F026;Lo;0;L;;;;;N;;;;; 1311B;EGYPTIAN HIEROGLYPH F027;Lo;0;L;;;;;N;;;;; 1311C;EGYPTIAN HIEROGLYPH F028;Lo;0;L;;;;;N;;;;; 1311D;EGYPTIAN HIEROGLYPH F029;Lo;0;L;;;;;N;;;;; 1311E;EGYPTIAN HIEROGLYPH F030;Lo;0;L;;;;;N;;;;; 1311F;EGYPTIAN HIEROGLYPH F031;Lo;0;L;;;;;N;;;;; 13120;EGYPTIAN HIEROGLYPH F031A;Lo;0;L;;;;;N;;;;; 13121;EGYPTIAN HIEROGLYPH F032;Lo;0;L;;;;;N;;;;; 13122;EGYPTIAN HIEROGLYPH F033;Lo;0;L;;;;;N;;;;; 13123;EGYPTIAN HIEROGLYPH F034;Lo;0;L;;;;;N;;;;; 13124;EGYPTIAN HIEROGLYPH F035;Lo;0;L;;;;;N;;;;; 13125;EGYPTIAN HIEROGLYPH F036;Lo;0;L;;;;;N;;;;; 13126;EGYPTIAN HIEROGLYPH F037;Lo;0;L;;;;;N;;;;; 13127;EGYPTIAN HIEROGLYPH F037A;Lo;0;L;;;;;N;;;;; 13128;EGYPTIAN HIEROGLYPH F038;Lo;0;L;;;;;N;;;;; 13129;EGYPTIAN HIEROGLYPH F038A;Lo;0;L;;;;;N;;;;; 1312A;EGYPTIAN HIEROGLYPH F039;Lo;0;L;;;;;N;;;;; 1312B;EGYPTIAN HIEROGLYPH F040;Lo;0;L;;;;;N;;;;; 1312C;EGYPTIAN HIEROGLYPH F041;Lo;0;L;;;;;N;;;;; 1312D;EGYPTIAN HIEROGLYPH F042;Lo;0;L;;;;;N;;;;; 1312E;EGYPTIAN HIEROGLYPH F043;Lo;0;L;;;;;N;;;;; 1312F;EGYPTIAN HIEROGLYPH F044;Lo;0;L;;;;;N;;;;; 13130;EGYPTIAN HIEROGLYPH F045;Lo;0;L;;;;;N;;;;; 13131;EGYPTIAN HIEROGLYPH F045A;Lo;0;L;;;;;N;;;;; 13132;EGYPTIAN HIEROGLYPH F046;Lo;0;L;;;;;N;;;;; 13133;EGYPTIAN HIEROGLYPH F046A;Lo;0;L;;;;;N;;;;; 13134;EGYPTIAN HIEROGLYPH F047;Lo;0;L;;;;;N;;;;; 13135;EGYPTIAN HIEROGLYPH F047A;Lo;0;L;;;;;N;;;;; 13136;EGYPTIAN HIEROGLYPH F048;Lo;0;L;;;;;N;;;;; 13137;EGYPTIAN HIEROGLYPH F049;Lo;0;L;;;;;N;;;;; 13138;EGYPTIAN HIEROGLYPH F050;Lo;0;L;;;;;N;;;;; 13139;EGYPTIAN HIEROGLYPH F051;Lo;0;L;;;;;N;;;;; 1313A;EGYPTIAN HIEROGLYPH F051A;Lo;0;L;;;;;N;;;;; 1313B;EGYPTIAN HIEROGLYPH F051B;Lo;0;L;;;;;N;;;;; 1313C;EGYPTIAN HIEROGLYPH F051C;Lo;0;L;;;;;N;;;;; 1313D;EGYPTIAN HIEROGLYPH F052;Lo;0;L;;;;;N;;;;; 1313E;EGYPTIAN HIEROGLYPH F053;Lo;0;L;;;;;N;;;;; 1313F;EGYPTIAN HIEROGLYPH G001;Lo;0;L;;;;;N;;;;; 13140;EGYPTIAN HIEROGLYPH G002;Lo;0;L;;;;;N;;;;; 13141;EGYPTIAN HIEROGLYPH G003;Lo;0;L;;;;;N;;;;; 13142;EGYPTIAN HIEROGLYPH G004;Lo;0;L;;;;;N;;;;; 13143;EGYPTIAN HIEROGLYPH G005;Lo;0;L;;;;;N;;;;; 13144;EGYPTIAN HIEROGLYPH G006;Lo;0;L;;;;;N;;;;; 13145;EGYPTIAN HIEROGLYPH G006A;Lo;0;L;;;;;N;;;;; 13146;EGYPTIAN HIEROGLYPH G007;Lo;0;L;;;;;N;;;;; 13147;EGYPTIAN HIEROGLYPH G007A;Lo;0;L;;;;;N;;;;; 13148;EGYPTIAN HIEROGLYPH G007B;Lo;0;L;;;;;N;;;;; 13149;EGYPTIAN HIEROGLYPH G008;Lo;0;L;;;;;N;;;;; 1314A;EGYPTIAN HIEROGLYPH G009;Lo;0;L;;;;;N;;;;; 1314B;EGYPTIAN HIEROGLYPH G010;Lo;0;L;;;;;N;;;;; 1314C;EGYPTIAN HIEROGLYPH G011;Lo;0;L;;;;;N;;;;; 1314D;EGYPTIAN HIEROGLYPH G011A;Lo;0;L;;;;;N;;;;; 1314E;EGYPTIAN HIEROGLYPH G012;Lo;0;L;;;;;N;;;;; 1314F;EGYPTIAN HIEROGLYPH G013;Lo;0;L;;;;;N;;;;; 13150;EGYPTIAN HIEROGLYPH G014;Lo;0;L;;;;;N;;;;; 13151;EGYPTIAN HIEROGLYPH G015;Lo;0;L;;;;;N;;;;; 13152;EGYPTIAN HIEROGLYPH G016;Lo;0;L;;;;;N;;;;; 13153;EGYPTIAN HIEROGLYPH G017;Lo;0;L;;;;;N;;;;; 13154;EGYPTIAN HIEROGLYPH G018;Lo;0;L;;;;;N;;;;; 13155;EGYPTIAN HIEROGLYPH G019;Lo;0;L;;;;;N;;;;; 13156;EGYPTIAN HIEROGLYPH G020;Lo;0;L;;;;;N;;;;; 13157;EGYPTIAN HIEROGLYPH G020A;Lo;0;L;;;;;N;;;;; 13158;EGYPTIAN HIEROGLYPH G021;Lo;0;L;;;;;N;;;;; 13159;EGYPTIAN HIEROGLYPH G022;Lo;0;L;;;;;N;;;;; 1315A;EGYPTIAN HIEROGLYPH G023;Lo;0;L;;;;;N;;;;; 1315B;EGYPTIAN HIEROGLYPH G024;Lo;0;L;;;;;N;;;;; 1315C;EGYPTIAN HIEROGLYPH G025;Lo;0;L;;;;;N;;;;; 1315D;EGYPTIAN HIEROGLYPH G026;Lo;0;L;;;;;N;;;;; 1315E;EGYPTIAN HIEROGLYPH G026A;Lo;0;L;;;;;N;;;;; 1315F;EGYPTIAN HIEROGLYPH G027;Lo;0;L;;;;;N;;;;; 13160;EGYPTIAN HIEROGLYPH G028;Lo;0;L;;;;;N;;;;; 13161;EGYPTIAN HIEROGLYPH G029;Lo;0;L;;;;;N;;;;; 13162;EGYPTIAN HIEROGLYPH G030;Lo;0;L;;;;;N;;;;; 13163;EGYPTIAN HIEROGLYPH G031;Lo;0;L;;;;;N;;;;; 13164;EGYPTIAN HIEROGLYPH G032;Lo;0;L;;;;;N;;;;; 13165;EGYPTIAN HIEROGLYPH G033;Lo;0;L;;;;;N;;;;; 13166;EGYPTIAN HIEROGLYPH G034;Lo;0;L;;;;;N;;;;; 13167;EGYPTIAN HIEROGLYPH G035;Lo;0;L;;;;;N;;;;; 13168;EGYPTIAN HIEROGLYPH G036;Lo;0;L;;;;;N;;;;; 13169;EGYPTIAN HIEROGLYPH G036A;Lo;0;L;;;;;N;;;;; 1316A;EGYPTIAN HIEROGLYPH G037;Lo;0;L;;;;;N;;;;; 1316B;EGYPTIAN HIEROGLYPH G037A;Lo;0;L;;;;;N;;;;; 1316C;EGYPTIAN HIEROGLYPH G038;Lo;0;L;;;;;N;;;;; 1316D;EGYPTIAN HIEROGLYPH G039;Lo;0;L;;;;;N;;;;; 1316E;EGYPTIAN HIEROGLYPH G040;Lo;0;L;;;;;N;;;;; 1316F;EGYPTIAN HIEROGLYPH G041;Lo;0;L;;;;;N;;;;; 13170;EGYPTIAN HIEROGLYPH G042;Lo;0;L;;;;;N;;;;; 13171;EGYPTIAN HIEROGLYPH G043;Lo;0;L;;;;;N;;;;; 13172;EGYPTIAN HIEROGLYPH G043A;Lo;0;L;;;;;N;;;;; 13173;EGYPTIAN HIEROGLYPH G044;Lo;0;L;;;;;N;;;;; 13174;EGYPTIAN HIEROGLYPH G045;Lo;0;L;;;;;N;;;;; 13175;EGYPTIAN HIEROGLYPH G045A;Lo;0;L;;;;;N;;;;; 13176;EGYPTIAN HIEROGLYPH G046;Lo;0;L;;;;;N;;;;; 13177;EGYPTIAN HIEROGLYPH G047;Lo;0;L;;;;;N;;;;; 13178;EGYPTIAN HIEROGLYPH G048;Lo;0;L;;;;;N;;;;; 13179;EGYPTIAN HIEROGLYPH G049;Lo;0;L;;;;;N;;;;; 1317A;EGYPTIAN HIEROGLYPH G050;Lo;0;L;;;;;N;;;;; 1317B;EGYPTIAN HIEROGLYPH G051;Lo;0;L;;;;;N;;;;; 1317C;EGYPTIAN HIEROGLYPH G052;Lo;0;L;;;;;N;;;;; 1317D;EGYPTIAN HIEROGLYPH G053;Lo;0;L;;;;;N;;;;; 1317E;EGYPTIAN HIEROGLYPH G054;Lo;0;L;;;;;N;;;;; 1317F;EGYPTIAN HIEROGLYPH H001;Lo;0;L;;;;;N;;;;; 13180;EGYPTIAN HIEROGLYPH H002;Lo;0;L;;;;;N;;;;; 13181;EGYPTIAN HIEROGLYPH H003;Lo;0;L;;;;;N;;;;; 13182;EGYPTIAN HIEROGLYPH H004;Lo;0;L;;;;;N;;;;; 13183;EGYPTIAN HIEROGLYPH H005;Lo;0;L;;;;;N;;;;; 13184;EGYPTIAN HIEROGLYPH H006;Lo;0;L;;;;;N;;;;; 13185;EGYPTIAN HIEROGLYPH H006A;Lo;0;L;;;;;N;;;;; 13186;EGYPTIAN HIEROGLYPH H007;Lo;0;L;;;;;N;;;;; 13187;EGYPTIAN HIEROGLYPH H008;Lo;0;L;;;;;N;;;;; 13188;EGYPTIAN HIEROGLYPH I001;Lo;0;L;;;;;N;;;;; 13189;EGYPTIAN HIEROGLYPH I002;Lo;0;L;;;;;N;;;;; 1318A;EGYPTIAN HIEROGLYPH I003;Lo;0;L;;;;;N;;;;; 1318B;EGYPTIAN HIEROGLYPH I004;Lo;0;L;;;;;N;;;;; 1318C;EGYPTIAN HIEROGLYPH I005;Lo;0;L;;;;;N;;;;; 1318D;EGYPTIAN HIEROGLYPH I005A;Lo;0;L;;;;;N;;;;; 1318E;EGYPTIAN HIEROGLYPH I006;Lo;0;L;;;;;N;;;;; 1318F;EGYPTIAN HIEROGLYPH I007;Lo;0;L;;;;;N;;;;; 13190;EGYPTIAN HIEROGLYPH I008;Lo;0;L;;;;;N;;;;; 13191;EGYPTIAN HIEROGLYPH I009;Lo;0;L;;;;;N;;;;; 13192;EGYPTIAN HIEROGLYPH I009A;Lo;0;L;;;;;N;;;;; 13193;EGYPTIAN HIEROGLYPH I010;Lo;0;L;;;;;N;;;;; 13194;EGYPTIAN HIEROGLYPH I010A;Lo;0;L;;;;;N;;;;; 13195;EGYPTIAN HIEROGLYPH I011;Lo;0;L;;;;;N;;;;; 13196;EGYPTIAN HIEROGLYPH I011A;Lo;0;L;;;;;N;;;;; 13197;EGYPTIAN HIEROGLYPH I012;Lo;0;L;;;;;N;;;;; 13198;EGYPTIAN HIEROGLYPH I013;Lo;0;L;;;;;N;;;;; 13199;EGYPTIAN HIEROGLYPH I014;Lo;0;L;;;;;N;;;;; 1319A;EGYPTIAN HIEROGLYPH I015;Lo;0;L;;;;;N;;;;; 1319B;EGYPTIAN HIEROGLYPH K001;Lo;0;L;;;;;N;;;;; 1319C;EGYPTIAN HIEROGLYPH K002;Lo;0;L;;;;;N;;;;; 1319D;EGYPTIAN HIEROGLYPH K003;Lo;0;L;;;;;N;;;;; 1319E;EGYPTIAN HIEROGLYPH K004;Lo;0;L;;;;;N;;;;; 1319F;EGYPTIAN HIEROGLYPH K005;Lo;0;L;;;;;N;;;;; 131A0;EGYPTIAN HIEROGLYPH K006;Lo;0;L;;;;;N;;;;; 131A1;EGYPTIAN HIEROGLYPH K007;Lo;0;L;;;;;N;;;;; 131A2;EGYPTIAN HIEROGLYPH K008;Lo;0;L;;;;;N;;;;; 131A3;EGYPTIAN HIEROGLYPH L001;Lo;0;L;;;;;N;;;;; 131A4;EGYPTIAN HIEROGLYPH L002;Lo;0;L;;;;;N;;;;; 131A5;EGYPTIAN HIEROGLYPH L002A;Lo;0;L;;;;;N;;;;; 131A6;EGYPTIAN HIEROGLYPH L003;Lo;0;L;;;;;N;;;;; 131A7;EGYPTIAN HIEROGLYPH L004;Lo;0;L;;;;;N;;;;; 131A8;EGYPTIAN HIEROGLYPH L005;Lo;0;L;;;;;N;;;;; 131A9;EGYPTIAN HIEROGLYPH L006;Lo;0;L;;;;;N;;;;; 131AA;EGYPTIAN HIEROGLYPH L006A;Lo;0;L;;;;;N;;;;; 131AB;EGYPTIAN HIEROGLYPH L007;Lo;0;L;;;;;N;;;;; 131AC;EGYPTIAN HIEROGLYPH L008;Lo;0;L;;;;;N;;;;; 131AD;EGYPTIAN HIEROGLYPH M001;Lo;0;L;;;;;N;;;;; 131AE;EGYPTIAN HIEROGLYPH M001A;Lo;0;L;;;;;N;;;;; 131AF;EGYPTIAN HIEROGLYPH M001B;Lo;0;L;;;;;N;;;;; 131B0;EGYPTIAN HIEROGLYPH M002;Lo;0;L;;;;;N;;;;; 131B1;EGYPTIAN HIEROGLYPH M003;Lo;0;L;;;;;N;;;;; 131B2;EGYPTIAN HIEROGLYPH M003A;Lo;0;L;;;;;N;;;;; 131B3;EGYPTIAN HIEROGLYPH M004;Lo;0;L;;;;;N;;;;; 131B4;EGYPTIAN HIEROGLYPH M005;Lo;0;L;;;;;N;;;;; 131B5;EGYPTIAN HIEROGLYPH M006;Lo;0;L;;;;;N;;;;; 131B6;EGYPTIAN HIEROGLYPH M007;Lo;0;L;;;;;N;;;;; 131B7;EGYPTIAN HIEROGLYPH M008;Lo;0;L;;;;;N;;;;; 131B8;EGYPTIAN HIEROGLYPH M009;Lo;0;L;;;;;N;;;;; 131B9;EGYPTIAN HIEROGLYPH M010;Lo;0;L;;;;;N;;;;; 131BA;EGYPTIAN HIEROGLYPH M010A;Lo;0;L;;;;;N;;;;; 131BB;EGYPTIAN HIEROGLYPH M011;Lo;0;L;;;;;N;;;;; 131BC;EGYPTIAN HIEROGLYPH M012;Lo;0;L;;;;;N;;;;; 131BD;EGYPTIAN HIEROGLYPH M012A;Lo;0;L;;;;;N;;;;; 131BE;EGYPTIAN HIEROGLYPH M012B;Lo;0;L;;;;;N;;;;; 131BF;EGYPTIAN HIEROGLYPH M012C;Lo;0;L;;;;;N;;;;; 131C0;EGYPTIAN HIEROGLYPH M012D;Lo;0;L;;;;;N;;;;; 131C1;EGYPTIAN HIEROGLYPH M012E;Lo;0;L;;;;;N;;;;; 131C2;EGYPTIAN HIEROGLYPH M012F;Lo;0;L;;;;;N;;;;; 131C3;EGYPTIAN HIEROGLYPH M012G;Lo;0;L;;;;;N;;;;; 131C4;EGYPTIAN HIEROGLYPH M012H;Lo;0;L;;;;;N;;;;; 131C5;EGYPTIAN HIEROGLYPH M013;Lo;0;L;;;;;N;;;;; 131C6;EGYPTIAN HIEROGLYPH M014;Lo;0;L;;;;;N;;;;; 131C7;EGYPTIAN HIEROGLYPH M015;Lo;0;L;;;;;N;;;;; 131C8;EGYPTIAN HIEROGLYPH M015A;Lo;0;L;;;;;N;;;;; 131C9;EGYPTIAN HIEROGLYPH M016;Lo;0;L;;;;;N;;;;; 131CA;EGYPTIAN HIEROGLYPH M016A;Lo;0;L;;;;;N;;;;; 131CB;EGYPTIAN HIEROGLYPH M017;Lo;0;L;;;;;N;;;;; 131CC;EGYPTIAN HIEROGLYPH M017A;Lo;0;L;;;;;N;;;;; 131CD;EGYPTIAN HIEROGLYPH M018;Lo;0;L;;;;;N;;;;; 131CE;EGYPTIAN HIEROGLYPH M019;Lo;0;L;;;;;N;;;;; 131CF;EGYPTIAN HIEROGLYPH M020;Lo;0;L;;;;;N;;;;; 131D0;EGYPTIAN HIEROGLYPH M021;Lo;0;L;;;;;N;;;;; 131D1;EGYPTIAN HIEROGLYPH M022;Lo;0;L;;;;;N;;;;; 131D2;EGYPTIAN HIEROGLYPH M022A;Lo;0;L;;;;;N;;;;; 131D3;EGYPTIAN HIEROGLYPH M023;Lo;0;L;;;;;N;;;;; 131D4;EGYPTIAN HIEROGLYPH M024;Lo;0;L;;;;;N;;;;; 131D5;EGYPTIAN HIEROGLYPH M024A;Lo;0;L;;;;;N;;;;; 131D6;EGYPTIAN HIEROGLYPH M025;Lo;0;L;;;;;N;;;;; 131D7;EGYPTIAN HIEROGLYPH M026;Lo;0;L;;;;;N;;;;; 131D8;EGYPTIAN HIEROGLYPH M027;Lo;0;L;;;;;N;;;;; 131D9;EGYPTIAN HIEROGLYPH M028;Lo;0;L;;;;;N;;;;; 131DA;EGYPTIAN HIEROGLYPH M028A;Lo;0;L;;;;;N;;;;; 131DB;EGYPTIAN HIEROGLYPH M029;Lo;0;L;;;;;N;;;;; 131DC;EGYPTIAN HIEROGLYPH M030;Lo;0;L;;;;;N;;;;; 131DD;EGYPTIAN HIEROGLYPH M031;Lo;0;L;;;;;N;;;;; 131DE;EGYPTIAN HIEROGLYPH M031A;Lo;0;L;;;;;N;;;;; 131DF;EGYPTIAN HIEROGLYPH M032;Lo;0;L;;;;;N;;;;; 131E0;EGYPTIAN HIEROGLYPH M033;Lo;0;L;;;;;N;;;;; 131E1;EGYPTIAN HIEROGLYPH M033A;Lo;0;L;;;;;N;;;;; 131E2;EGYPTIAN HIEROGLYPH M033B;Lo;0;L;;;;;N;;;;; 131E3;EGYPTIAN HIEROGLYPH M034;Lo;0;L;;;;;N;;;;; 131E4;EGYPTIAN HIEROGLYPH M035;Lo;0;L;;;;;N;;;;; 131E5;EGYPTIAN HIEROGLYPH M036;Lo;0;L;;;;;N;;;;; 131E6;EGYPTIAN HIEROGLYPH M037;Lo;0;L;;;;;N;;;;; 131E7;EGYPTIAN HIEROGLYPH M038;Lo;0;L;;;;;N;;;;; 131E8;EGYPTIAN HIEROGLYPH M039;Lo;0;L;;;;;N;;;;; 131E9;EGYPTIAN HIEROGLYPH M040;Lo;0;L;;;;;N;;;;; 131EA;EGYPTIAN HIEROGLYPH M040A;Lo;0;L;;;;;N;;;;; 131EB;EGYPTIAN HIEROGLYPH M041;Lo;0;L;;;;;N;;;;; 131EC;EGYPTIAN HIEROGLYPH M042;Lo;0;L;;;;;N;;;;; 131ED;EGYPTIAN HIEROGLYPH M043;Lo;0;L;;;;;N;;;;; 131EE;EGYPTIAN HIEROGLYPH M044;Lo;0;L;;;;;N;;;;; 131EF;EGYPTIAN HIEROGLYPH N001;Lo;0;L;;;;;N;;;;; 131F0;EGYPTIAN HIEROGLYPH N002;Lo;0;L;;;;;N;;;;; 131F1;EGYPTIAN HIEROGLYPH N003;Lo;0;L;;;;;N;;;;; 131F2;EGYPTIAN HIEROGLYPH N004;Lo;0;L;;;;;N;;;;; 131F3;EGYPTIAN HIEROGLYPH N005;Lo;0;L;;;;;N;;;;; 131F4;EGYPTIAN HIEROGLYPH N006;Lo;0;L;;;;;N;;;;; 131F5;EGYPTIAN HIEROGLYPH N007;Lo;0;L;;;;;N;;;;; 131F6;EGYPTIAN HIEROGLYPH N008;Lo;0;L;;;;;N;;;;; 131F7;EGYPTIAN HIEROGLYPH N009;Lo;0;L;;;;;N;;;;; 131F8;EGYPTIAN HIEROGLYPH N010;Lo;0;L;;;;;N;;;;; 131F9;EGYPTIAN HIEROGLYPH N011;Lo;0;L;;;;;N;;;;; 131FA;EGYPTIAN HIEROGLYPH N012;Lo;0;L;;;;;N;;;;; 131FB;EGYPTIAN HIEROGLYPH N013;Lo;0;L;;;;;N;;;;; 131FC;EGYPTIAN HIEROGLYPH N014;Lo;0;L;;;;;N;;;;; 131FD;EGYPTIAN HIEROGLYPH N015;Lo;0;L;;;;;N;;;;; 131FE;EGYPTIAN HIEROGLYPH N016;Lo;0;L;;;;;N;;;;; 131FF;EGYPTIAN HIEROGLYPH N017;Lo;0;L;;;;;N;;;;; 13200;EGYPTIAN HIEROGLYPH N018;Lo;0;L;;;;;N;;;;; 13201;EGYPTIAN HIEROGLYPH N018A;Lo;0;L;;;;;N;;;;; 13202;EGYPTIAN HIEROGLYPH N018B;Lo;0;L;;;;;N;;;;; 13203;EGYPTIAN HIEROGLYPH N019;Lo;0;L;;;;;N;;;;; 13204;EGYPTIAN HIEROGLYPH N020;Lo;0;L;;;;;N;;;;; 13205;EGYPTIAN HIEROGLYPH N021;Lo;0;L;;;;;N;;;;; 13206;EGYPTIAN HIEROGLYPH N022;Lo;0;L;;;;;N;;;;; 13207;EGYPTIAN HIEROGLYPH N023;Lo;0;L;;;;;N;;;;; 13208;EGYPTIAN HIEROGLYPH N024;Lo;0;L;;;;;N;;;;; 13209;EGYPTIAN HIEROGLYPH N025;Lo;0;L;;;;;N;;;;; 1320A;EGYPTIAN HIEROGLYPH N025A;Lo;0;L;;;;;N;;;;; 1320B;EGYPTIAN HIEROGLYPH N026;Lo;0;L;;;;;N;;;;; 1320C;EGYPTIAN HIEROGLYPH N027;Lo;0;L;;;;;N;;;;; 1320D;EGYPTIAN HIEROGLYPH N028;Lo;0;L;;;;;N;;;;; 1320E;EGYPTIAN HIEROGLYPH N029;Lo;0;L;;;;;N;;;;; 1320F;EGYPTIAN HIEROGLYPH N030;Lo;0;L;;;;;N;;;;; 13210;EGYPTIAN HIEROGLYPH N031;Lo;0;L;;;;;N;;;;; 13211;EGYPTIAN HIEROGLYPH N032;Lo;0;L;;;;;N;;;;; 13212;EGYPTIAN HIEROGLYPH N033;Lo;0;L;;;;;N;;;;; 13213;EGYPTIAN HIEROGLYPH N033A;Lo;0;L;;;;;N;;;;; 13214;EGYPTIAN HIEROGLYPH N034;Lo;0;L;;;;;N;;;;; 13215;EGYPTIAN HIEROGLYPH N034A;Lo;0;L;;;;;N;;;;; 13216;EGYPTIAN HIEROGLYPH N035;Lo;0;L;;;;;N;;;;; 13217;EGYPTIAN HIEROGLYPH N035A;Lo;0;L;;;;;N;;;;; 13218;EGYPTIAN HIEROGLYPH N036;Lo;0;L;;;;;N;;;;; 13219;EGYPTIAN HIEROGLYPH N037;Lo;0;L;;;;;N;;;;; 1321A;EGYPTIAN HIEROGLYPH N037A;Lo;0;L;;;;;N;;;;; 1321B;EGYPTIAN HIEROGLYPH N038;Lo;0;L;;;;;N;;;;; 1321C;EGYPTIAN HIEROGLYPH N039;Lo;0;L;;;;;N;;;;; 1321D;EGYPTIAN HIEROGLYPH N040;Lo;0;L;;;;;N;;;;; 1321E;EGYPTIAN HIEROGLYPH N041;Lo;0;L;;;;;N;;;;; 1321F;EGYPTIAN HIEROGLYPH N042;Lo;0;L;;;;;N;;;;; 13220;EGYPTIAN HIEROGLYPH NL001;Lo;0;L;;;;;N;;;;; 13221;EGYPTIAN HIEROGLYPH NL002;Lo;0;L;;;;;N;;;;; 13222;EGYPTIAN HIEROGLYPH NL003;Lo;0;L;;;;;N;;;;; 13223;EGYPTIAN HIEROGLYPH NL004;Lo;0;L;;;;;N;;;;; 13224;EGYPTIAN HIEROGLYPH NL005;Lo;0;L;;;;;N;;;;; 13225;EGYPTIAN HIEROGLYPH NL005A;Lo;0;L;;;;;N;;;;; 13226;EGYPTIAN HIEROGLYPH NL006;Lo;0;L;;;;;N;;;;; 13227;EGYPTIAN HIEROGLYPH NL007;Lo;0;L;;;;;N;;;;; 13228;EGYPTIAN HIEROGLYPH NL008;Lo;0;L;;;;;N;;;;; 13229;EGYPTIAN HIEROGLYPH NL009;Lo;0;L;;;;;N;;;;; 1322A;EGYPTIAN HIEROGLYPH NL010;Lo;0;L;;;;;N;;;;; 1322B;EGYPTIAN HIEROGLYPH NL011;Lo;0;L;;;;;N;;;;; 1322C;EGYPTIAN HIEROGLYPH NL012;Lo;0;L;;;;;N;;;;; 1322D;EGYPTIAN HIEROGLYPH NL013;Lo;0;L;;;;;N;;;;; 1322E;EGYPTIAN HIEROGLYPH NL014;Lo;0;L;;;;;N;;;;; 1322F;EGYPTIAN HIEROGLYPH NL015;Lo;0;L;;;;;N;;;;; 13230;EGYPTIAN HIEROGLYPH NL016;Lo;0;L;;;;;N;;;;; 13231;EGYPTIAN HIEROGLYPH NL017;Lo;0;L;;;;;N;;;;; 13232;EGYPTIAN HIEROGLYPH NL017A;Lo;0;L;;;;;N;;;;; 13233;EGYPTIAN HIEROGLYPH NL018;Lo;0;L;;;;;N;;;;; 13234;EGYPTIAN HIEROGLYPH NL019;Lo;0;L;;;;;N;;;;; 13235;EGYPTIAN HIEROGLYPH NL020;Lo;0;L;;;;;N;;;;; 13236;EGYPTIAN HIEROGLYPH NU001;Lo;0;L;;;;;N;;;;; 13237;EGYPTIAN HIEROGLYPH NU002;Lo;0;L;;;;;N;;;;; 13238;EGYPTIAN HIEROGLYPH NU003;Lo;0;L;;;;;N;;;;; 13239;EGYPTIAN HIEROGLYPH NU004;Lo;0;L;;;;;N;;;;; 1323A;EGYPTIAN HIEROGLYPH NU005;Lo;0;L;;;;;N;;;;; 1323B;EGYPTIAN HIEROGLYPH NU006;Lo;0;L;;;;;N;;;;; 1323C;EGYPTIAN HIEROGLYPH NU007;Lo;0;L;;;;;N;;;;; 1323D;EGYPTIAN HIEROGLYPH NU008;Lo;0;L;;;;;N;;;;; 1323E;EGYPTIAN HIEROGLYPH NU009;Lo;0;L;;;;;N;;;;; 1323F;EGYPTIAN HIEROGLYPH NU010;Lo;0;L;;;;;N;;;;; 13240;EGYPTIAN HIEROGLYPH NU010A;Lo;0;L;;;;;N;;;;; 13241;EGYPTIAN HIEROGLYPH NU011;Lo;0;L;;;;;N;;;;; 13242;EGYPTIAN HIEROGLYPH NU011A;Lo;0;L;;;;;N;;;;; 13243;EGYPTIAN HIEROGLYPH NU012;Lo;0;L;;;;;N;;;;; 13244;EGYPTIAN HIEROGLYPH NU013;Lo;0;L;;;;;N;;;;; 13245;EGYPTIAN HIEROGLYPH NU014;Lo;0;L;;;;;N;;;;; 13246;EGYPTIAN HIEROGLYPH NU015;Lo;0;L;;;;;N;;;;; 13247;EGYPTIAN HIEROGLYPH NU016;Lo;0;L;;;;;N;;;;; 13248;EGYPTIAN HIEROGLYPH NU017;Lo;0;L;;;;;N;;;;; 13249;EGYPTIAN HIEROGLYPH NU018;Lo;0;L;;;;;N;;;;; 1324A;EGYPTIAN HIEROGLYPH NU018A;Lo;0;L;;;;;N;;;;; 1324B;EGYPTIAN HIEROGLYPH NU019;Lo;0;L;;;;;N;;;;; 1324C;EGYPTIAN HIEROGLYPH NU020;Lo;0;L;;;;;N;;;;; 1324D;EGYPTIAN HIEROGLYPH NU021;Lo;0;L;;;;;N;;;;; 1324E;EGYPTIAN HIEROGLYPH NU022;Lo;0;L;;;;;N;;;;; 1324F;EGYPTIAN HIEROGLYPH NU022A;Lo;0;L;;;;;N;;;;; 13250;EGYPTIAN HIEROGLYPH O001;Lo;0;L;;;;;N;;;;; 13251;EGYPTIAN HIEROGLYPH O001A;Lo;0;L;;;;;N;;;;; 13252;EGYPTIAN HIEROGLYPH O002;Lo;0;L;;;;;N;;;;; 13253;EGYPTIAN HIEROGLYPH O003;Lo;0;L;;;;;N;;;;; 13254;EGYPTIAN HIEROGLYPH O004;Lo;0;L;;;;;N;;;;; 13255;EGYPTIAN HIEROGLYPH O005;Lo;0;L;;;;;N;;;;; 13256;EGYPTIAN HIEROGLYPH O005A;Lo;0;L;;;;;N;;;;; 13257;EGYPTIAN HIEROGLYPH O006;Lo;0;L;;;;;N;;;;; 13258;EGYPTIAN HIEROGLYPH O006A;Lo;0;L;;;;;N;;;;; 13259;EGYPTIAN HIEROGLYPH O006B;Lo;0;L;;;;;N;;;;; 1325A;EGYPTIAN HIEROGLYPH O006C;Lo;0;L;;;;;N;;;;; 1325B;EGYPTIAN HIEROGLYPH O006D;Lo;0;L;;;;;N;;;;; 1325C;EGYPTIAN HIEROGLYPH O006E;Lo;0;L;;;;;N;;;;; 1325D;EGYPTIAN HIEROGLYPH O006F;Lo;0;L;;;;;N;;;;; 1325E;EGYPTIAN HIEROGLYPH O007;Lo;0;L;;;;;N;;;;; 1325F;EGYPTIAN HIEROGLYPH O008;Lo;0;L;;;;;N;;;;; 13260;EGYPTIAN HIEROGLYPH O009;Lo;0;L;;;;;N;;;;; 13261;EGYPTIAN HIEROGLYPH O010;Lo;0;L;;;;;N;;;;; 13262;EGYPTIAN HIEROGLYPH O010A;Lo;0;L;;;;;N;;;;; 13263;EGYPTIAN HIEROGLYPH O010B;Lo;0;L;;;;;N;;;;; 13264;EGYPTIAN HIEROGLYPH O010C;Lo;0;L;;;;;N;;;;; 13265;EGYPTIAN HIEROGLYPH O011;Lo;0;L;;;;;N;;;;; 13266;EGYPTIAN HIEROGLYPH O012;Lo;0;L;;;;;N;;;;; 13267;EGYPTIAN HIEROGLYPH O013;Lo;0;L;;;;;N;;;;; 13268;EGYPTIAN HIEROGLYPH O014;Lo;0;L;;;;;N;;;;; 13269;EGYPTIAN HIEROGLYPH O015;Lo;0;L;;;;;N;;;;; 1326A;EGYPTIAN HIEROGLYPH O016;Lo;0;L;;;;;N;;;;; 1326B;EGYPTIAN HIEROGLYPH O017;Lo;0;L;;;;;N;;;;; 1326C;EGYPTIAN HIEROGLYPH O018;Lo;0;L;;;;;N;;;;; 1326D;EGYPTIAN HIEROGLYPH O019;Lo;0;L;;;;;N;;;;; 1326E;EGYPTIAN HIEROGLYPH O019A;Lo;0;L;;;;;N;;;;; 1326F;EGYPTIAN HIEROGLYPH O020;Lo;0;L;;;;;N;;;;; 13270;EGYPTIAN HIEROGLYPH O020A;Lo;0;L;;;;;N;;;;; 13271;EGYPTIAN HIEROGLYPH O021;Lo;0;L;;;;;N;;;;; 13272;EGYPTIAN HIEROGLYPH O022;Lo;0;L;;;;;N;;;;; 13273;EGYPTIAN HIEROGLYPH O023;Lo;0;L;;;;;N;;;;; 13274;EGYPTIAN HIEROGLYPH O024;Lo;0;L;;;;;N;;;;; 13275;EGYPTIAN HIEROGLYPH O024A;Lo;0;L;;;;;N;;;;; 13276;EGYPTIAN HIEROGLYPH O025;Lo;0;L;;;;;N;;;;; 13277;EGYPTIAN HIEROGLYPH O025A;Lo;0;L;;;;;N;;;;; 13278;EGYPTIAN HIEROGLYPH O026;Lo;0;L;;;;;N;;;;; 13279;EGYPTIAN HIEROGLYPH O027;Lo;0;L;;;;;N;;;;; 1327A;EGYPTIAN HIEROGLYPH O028;Lo;0;L;;;;;N;;;;; 1327B;EGYPTIAN HIEROGLYPH O029;Lo;0;L;;;;;N;;;;; 1327C;EGYPTIAN HIEROGLYPH O029A;Lo;0;L;;;;;N;;;;; 1327D;EGYPTIAN HIEROGLYPH O030;Lo;0;L;;;;;N;;;;; 1327E;EGYPTIAN HIEROGLYPH O030A;Lo;0;L;;;;;N;;;;; 1327F;EGYPTIAN HIEROGLYPH O031;Lo;0;L;;;;;N;;;;; 13280;EGYPTIAN HIEROGLYPH O032;Lo;0;L;;;;;N;;;;; 13281;EGYPTIAN HIEROGLYPH O033;Lo;0;L;;;;;N;;;;; 13282;EGYPTIAN HIEROGLYPH O033A;Lo;0;L;;;;;N;;;;; 13283;EGYPTIAN HIEROGLYPH O034;Lo;0;L;;;;;N;;;;; 13284;EGYPTIAN HIEROGLYPH O035;Lo;0;L;;;;;N;;;;; 13285;EGYPTIAN HIEROGLYPH O036;Lo;0;L;;;;;N;;;;; 13286;EGYPTIAN HIEROGLYPH O036A;Lo;0;L;;;;;N;;;;; 13287;EGYPTIAN HIEROGLYPH O036B;Lo;0;L;;;;;N;;;;; 13288;EGYPTIAN HIEROGLYPH O036C;Lo;0;L;;;;;N;;;;; 13289;EGYPTIAN HIEROGLYPH O036D;Lo;0;L;;;;;N;;;;; 1328A;EGYPTIAN HIEROGLYPH O037;Lo;0;L;;;;;N;;;;; 1328B;EGYPTIAN HIEROGLYPH O038;Lo;0;L;;;;;N;;;;; 1328C;EGYPTIAN HIEROGLYPH O039;Lo;0;L;;;;;N;;;;; 1328D;EGYPTIAN HIEROGLYPH O040;Lo;0;L;;;;;N;;;;; 1328E;EGYPTIAN HIEROGLYPH O041;Lo;0;L;;;;;N;;;;; 1328F;EGYPTIAN HIEROGLYPH O042;Lo;0;L;;;;;N;;;;; 13290;EGYPTIAN HIEROGLYPH O043;Lo;0;L;;;;;N;;;;; 13291;EGYPTIAN HIEROGLYPH O044;Lo;0;L;;;;;N;;;;; 13292;EGYPTIAN HIEROGLYPH O045;Lo;0;L;;;;;N;;;;; 13293;EGYPTIAN HIEROGLYPH O046;Lo;0;L;;;;;N;;;;; 13294;EGYPTIAN HIEROGLYPH O047;Lo;0;L;;;;;N;;;;; 13295;EGYPTIAN HIEROGLYPH O048;Lo;0;L;;;;;N;;;;; 13296;EGYPTIAN HIEROGLYPH O049;Lo;0;L;;;;;N;;;;; 13297;EGYPTIAN HIEROGLYPH O050;Lo;0;L;;;;;N;;;;; 13298;EGYPTIAN HIEROGLYPH O050A;Lo;0;L;;;;;N;;;;; 13299;EGYPTIAN HIEROGLYPH O050B;Lo;0;L;;;;;N;;;;; 1329A;EGYPTIAN HIEROGLYPH O051;Lo;0;L;;;;;N;;;;; 1329B;EGYPTIAN HIEROGLYPH P001;Lo;0;L;;;;;N;;;;; 1329C;EGYPTIAN HIEROGLYPH P001A;Lo;0;L;;;;;N;;;;; 1329D;EGYPTIAN HIEROGLYPH P002;Lo;0;L;;;;;N;;;;; 1329E;EGYPTIAN HIEROGLYPH P003;Lo;0;L;;;;;N;;;;; 1329F;EGYPTIAN HIEROGLYPH P003A;Lo;0;L;;;;;N;;;;; 132A0;EGYPTIAN HIEROGLYPH P004;Lo;0;L;;;;;N;;;;; 132A1;EGYPTIAN HIEROGLYPH P005;Lo;0;L;;;;;N;;;;; 132A2;EGYPTIAN HIEROGLYPH P006;Lo;0;L;;;;;N;;;;; 132A3;EGYPTIAN HIEROGLYPH P007;Lo;0;L;;;;;N;;;;; 132A4;EGYPTIAN HIEROGLYPH P008;Lo;0;L;;;;;N;;;;; 132A5;EGYPTIAN HIEROGLYPH P009;Lo;0;L;;;;;N;;;;; 132A6;EGYPTIAN HIEROGLYPH P010;Lo;0;L;;;;;N;;;;; 132A7;EGYPTIAN HIEROGLYPH P011;Lo;0;L;;;;;N;;;;; 132A8;EGYPTIAN HIEROGLYPH Q001;Lo;0;L;;;;;N;;;;; 132A9;EGYPTIAN HIEROGLYPH Q002;Lo;0;L;;;;;N;;;;; 132AA;EGYPTIAN HIEROGLYPH Q003;Lo;0;L;;;;;N;;;;; 132AB;EGYPTIAN HIEROGLYPH Q004;Lo;0;L;;;;;N;;;;; 132AC;EGYPTIAN HIEROGLYPH Q005;Lo;0;L;;;;;N;;;;; 132AD;EGYPTIAN HIEROGLYPH Q006;Lo;0;L;;;;;N;;;;; 132AE;EGYPTIAN HIEROGLYPH Q007;Lo;0;L;;;;;N;;;;; 132AF;EGYPTIAN HIEROGLYPH R001;Lo;0;L;;;;;N;;;;; 132B0;EGYPTIAN HIEROGLYPH R002;Lo;0;L;;;;;N;;;;; 132B1;EGYPTIAN HIEROGLYPH R002A;Lo;0;L;;;;;N;;;;; 132B2;EGYPTIAN HIEROGLYPH R003;Lo;0;L;;;;;N;;;;; 132B3;EGYPTIAN HIEROGLYPH R003A;Lo;0;L;;;;;N;;;;; 132B4;EGYPTIAN HIEROGLYPH R003B;Lo;0;L;;;;;N;;;;; 132B5;EGYPTIAN HIEROGLYPH R004;Lo;0;L;;;;;N;;;;; 132B6;EGYPTIAN HIEROGLYPH R005;Lo;0;L;;;;;N;;;;; 132B7;EGYPTIAN HIEROGLYPH R006;Lo;0;L;;;;;N;;;;; 132B8;EGYPTIAN HIEROGLYPH R007;Lo;0;L;;;;;N;;;;; 132B9;EGYPTIAN HIEROGLYPH R008;Lo;0;L;;;;;N;;;;; 132BA;EGYPTIAN HIEROGLYPH R009;Lo;0;L;;;;;N;;;;; 132BB;EGYPTIAN HIEROGLYPH R010;Lo;0;L;;;;;N;;;;; 132BC;EGYPTIAN HIEROGLYPH R010A;Lo;0;L;;;;;N;;;;; 132BD;EGYPTIAN HIEROGLYPH R011;Lo;0;L;;;;;N;;;;; 132BE;EGYPTIAN HIEROGLYPH R012;Lo;0;L;;;;;N;;;;; 132BF;EGYPTIAN HIEROGLYPH R013;Lo;0;L;;;;;N;;;;; 132C0;EGYPTIAN HIEROGLYPH R014;Lo;0;L;;;;;N;;;;; 132C1;EGYPTIAN HIEROGLYPH R015;Lo;0;L;;;;;N;;;;; 132C2;EGYPTIAN HIEROGLYPH R016;Lo;0;L;;;;;N;;;;; 132C3;EGYPTIAN HIEROGLYPH R016A;Lo;0;L;;;;;N;;;;; 132C4;EGYPTIAN HIEROGLYPH R017;Lo;0;L;;;;;N;;;;; 132C5;EGYPTIAN HIEROGLYPH R018;Lo;0;L;;;;;N;;;;; 132C6;EGYPTIAN HIEROGLYPH R019;Lo;0;L;;;;;N;;;;; 132C7;EGYPTIAN HIEROGLYPH R020;Lo;0;L;;;;;N;;;;; 132C8;EGYPTIAN HIEROGLYPH R021;Lo;0;L;;;;;N;;;;; 132C9;EGYPTIAN HIEROGLYPH R022;Lo;0;L;;;;;N;;;;; 132CA;EGYPTIAN HIEROGLYPH R023;Lo;0;L;;;;;N;;;;; 132CB;EGYPTIAN HIEROGLYPH R024;Lo;0;L;;;;;N;;;;; 132CC;EGYPTIAN HIEROGLYPH R025;Lo;0;L;;;;;N;;;;; 132CD;EGYPTIAN HIEROGLYPH R026;Lo;0;L;;;;;N;;;;; 132CE;EGYPTIAN HIEROGLYPH R027;Lo;0;L;;;;;N;;;;; 132CF;EGYPTIAN HIEROGLYPH R028;Lo;0;L;;;;;N;;;;; 132D0;EGYPTIAN HIEROGLYPH R029;Lo;0;L;;;;;N;;;;; 132D1;EGYPTIAN HIEROGLYPH S001;Lo;0;L;;;;;N;;;;; 132D2;EGYPTIAN HIEROGLYPH S002;Lo;0;L;;;;;N;;;;; 132D3;EGYPTIAN HIEROGLYPH S002A;Lo;0;L;;;;;N;;;;; 132D4;EGYPTIAN HIEROGLYPH S003;Lo;0;L;;;;;N;;;;; 132D5;EGYPTIAN HIEROGLYPH S004;Lo;0;L;;;;;N;;;;; 132D6;EGYPTIAN HIEROGLYPH S005;Lo;0;L;;;;;N;;;;; 132D7;EGYPTIAN HIEROGLYPH S006;Lo;0;L;;;;;N;;;;; 132D8;EGYPTIAN HIEROGLYPH S006A;Lo;0;L;;;;;N;;;;; 132D9;EGYPTIAN HIEROGLYPH S007;Lo;0;L;;;;;N;;;;; 132DA;EGYPTIAN HIEROGLYPH S008;Lo;0;L;;;;;N;;;;; 132DB;EGYPTIAN HIEROGLYPH S009;Lo;0;L;;;;;N;;;;; 132DC;EGYPTIAN HIEROGLYPH S010;Lo;0;L;;;;;N;;;;; 132DD;EGYPTIAN HIEROGLYPH S011;Lo;0;L;;;;;N;;;;; 132DE;EGYPTIAN HIEROGLYPH S012;Lo;0;L;;;;;N;;;;; 132DF;EGYPTIAN HIEROGLYPH S013;Lo;0;L;;;;;N;;;;; 132E0;EGYPTIAN HIEROGLYPH S014;Lo;0;L;;;;;N;;;;; 132E1;EGYPTIAN HIEROGLYPH S014A;Lo;0;L;;;;;N;;;;; 132E2;EGYPTIAN HIEROGLYPH S014B;Lo;0;L;;;;;N;;;;; 132E3;EGYPTIAN HIEROGLYPH S015;Lo;0;L;;;;;N;;;;; 132E4;EGYPTIAN HIEROGLYPH S016;Lo;0;L;;;;;N;;;;; 132E5;EGYPTIAN HIEROGLYPH S017;Lo;0;L;;;;;N;;;;; 132E6;EGYPTIAN HIEROGLYPH S017A;Lo;0;L;;;;;N;;;;; 132E7;EGYPTIAN HIEROGLYPH S018;Lo;0;L;;;;;N;;;;; 132E8;EGYPTIAN HIEROGLYPH S019;Lo;0;L;;;;;N;;;;; 132E9;EGYPTIAN HIEROGLYPH S020;Lo;0;L;;;;;N;;;;; 132EA;EGYPTIAN HIEROGLYPH S021;Lo;0;L;;;;;N;;;;; 132EB;EGYPTIAN HIEROGLYPH S022;Lo;0;L;;;;;N;;;;; 132EC;EGYPTIAN HIEROGLYPH S023;Lo;0;L;;;;;N;;;;; 132ED;EGYPTIAN HIEROGLYPH S024;Lo;0;L;;;;;N;;;;; 132EE;EGYPTIAN HIEROGLYPH S025;Lo;0;L;;;;;N;;;;; 132EF;EGYPTIAN HIEROGLYPH S026;Lo;0;L;;;;;N;;;;; 132F0;EGYPTIAN HIEROGLYPH S026A;Lo;0;L;;;;;N;;;;; 132F1;EGYPTIAN HIEROGLYPH S026B;Lo;0;L;;;;;N;;;;; 132F2;EGYPTIAN HIEROGLYPH S027;Lo;0;L;;;;;N;;;;; 132F3;EGYPTIAN HIEROGLYPH S028;Lo;0;L;;;;;N;;;;; 132F4;EGYPTIAN HIEROGLYPH S029;Lo;0;L;;;;;N;;;;; 132F5;EGYPTIAN HIEROGLYPH S030;Lo;0;L;;;;;N;;;;; 132F6;EGYPTIAN HIEROGLYPH S031;Lo;0;L;;;;;N;;;;; 132F7;EGYPTIAN HIEROGLYPH S032;Lo;0;L;;;;;N;;;;; 132F8;EGYPTIAN HIEROGLYPH S033;Lo;0;L;;;;;N;;;;; 132F9;EGYPTIAN HIEROGLYPH S034;Lo;0;L;;;;;N;;;;; 132FA;EGYPTIAN HIEROGLYPH S035;Lo;0;L;;;;;N;;;;; 132FB;EGYPTIAN HIEROGLYPH S035A;Lo;0;L;;;;;N;;;;; 132FC;EGYPTIAN HIEROGLYPH S036;Lo;0;L;;;;;N;;;;; 132FD;EGYPTIAN HIEROGLYPH S037;Lo;0;L;;;;;N;;;;; 132FE;EGYPTIAN HIEROGLYPH S038;Lo;0;L;;;;;N;;;;; 132FF;EGYPTIAN HIEROGLYPH S039;Lo;0;L;;;;;N;;;;; 13300;EGYPTIAN HIEROGLYPH S040;Lo;0;L;;;;;N;;;;; 13301;EGYPTIAN HIEROGLYPH S041;Lo;0;L;;;;;N;;;;; 13302;EGYPTIAN HIEROGLYPH S042;Lo;0;L;;;;;N;;;;; 13303;EGYPTIAN HIEROGLYPH S043;Lo;0;L;;;;;N;;;;; 13304;EGYPTIAN HIEROGLYPH S044;Lo;0;L;;;;;N;;;;; 13305;EGYPTIAN HIEROGLYPH S045;Lo;0;L;;;;;N;;;;; 13306;EGYPTIAN HIEROGLYPH S046;Lo;0;L;;;;;N;;;;; 13307;EGYPTIAN HIEROGLYPH T001;Lo;0;L;;;;;N;;;;; 13308;EGYPTIAN HIEROGLYPH T002;Lo;0;L;;;;;N;;;;; 13309;EGYPTIAN HIEROGLYPH T003;Lo;0;L;;;;;N;;;;; 1330A;EGYPTIAN HIEROGLYPH T003A;Lo;0;L;;;;;N;;;;; 1330B;EGYPTIAN HIEROGLYPH T004;Lo;0;L;;;;;N;;;;; 1330C;EGYPTIAN HIEROGLYPH T005;Lo;0;L;;;;;N;;;;; 1330D;EGYPTIAN HIEROGLYPH T006;Lo;0;L;;;;;N;;;;; 1330E;EGYPTIAN HIEROGLYPH T007;Lo;0;L;;;;;N;;;;; 1330F;EGYPTIAN HIEROGLYPH T007A;Lo;0;L;;;;;N;;;;; 13310;EGYPTIAN HIEROGLYPH T008;Lo;0;L;;;;;N;;;;; 13311;EGYPTIAN HIEROGLYPH T008A;Lo;0;L;;;;;N;;;;; 13312;EGYPTIAN HIEROGLYPH T009;Lo;0;L;;;;;N;;;;; 13313;EGYPTIAN HIEROGLYPH T009A;Lo;0;L;;;;;N;;;;; 13314;EGYPTIAN HIEROGLYPH T010;Lo;0;L;;;;;N;;;;; 13315;EGYPTIAN HIEROGLYPH T011;Lo;0;L;;;;;N;;;;; 13316;EGYPTIAN HIEROGLYPH T011A;Lo;0;L;;;;;N;;;;; 13317;EGYPTIAN HIEROGLYPH T012;Lo;0;L;;;;;N;;;;; 13318;EGYPTIAN HIEROGLYPH T013;Lo;0;L;;;;;N;;;;; 13319;EGYPTIAN HIEROGLYPH T014;Lo;0;L;;;;;N;;;;; 1331A;EGYPTIAN HIEROGLYPH T015;Lo;0;L;;;;;N;;;;; 1331B;EGYPTIAN HIEROGLYPH T016;Lo;0;L;;;;;N;;;;; 1331C;EGYPTIAN HIEROGLYPH T016A;Lo;0;L;;;;;N;;;;; 1331D;EGYPTIAN HIEROGLYPH T017;Lo;0;L;;;;;N;;;;; 1331E;EGYPTIAN HIEROGLYPH T018;Lo;0;L;;;;;N;;;;; 1331F;EGYPTIAN HIEROGLYPH T019;Lo;0;L;;;;;N;;;;; 13320;EGYPTIAN HIEROGLYPH T020;Lo;0;L;;;;;N;;;;; 13321;EGYPTIAN HIEROGLYPH T021;Lo;0;L;;;;;N;;;;; 13322;EGYPTIAN HIEROGLYPH T022;Lo;0;L;;;;;N;;;;; 13323;EGYPTIAN HIEROGLYPH T023;Lo;0;L;;;;;N;;;;; 13324;EGYPTIAN HIEROGLYPH T024;Lo;0;L;;;;;N;;;;; 13325;EGYPTIAN HIEROGLYPH T025;Lo;0;L;;;;;N;;;;; 13326;EGYPTIAN HIEROGLYPH T026;Lo;0;L;;;;;N;;;;; 13327;EGYPTIAN HIEROGLYPH T027;Lo;0;L;;;;;N;;;;; 13328;EGYPTIAN HIEROGLYPH T028;Lo;0;L;;;;;N;;;;; 13329;EGYPTIAN HIEROGLYPH T029;Lo;0;L;;;;;N;;;;; 1332A;EGYPTIAN HIEROGLYPH T030;Lo;0;L;;;;;N;;;;; 1332B;EGYPTIAN HIEROGLYPH T031;Lo;0;L;;;;;N;;;;; 1332C;EGYPTIAN HIEROGLYPH T032;Lo;0;L;;;;;N;;;;; 1332D;EGYPTIAN HIEROGLYPH T032A;Lo;0;L;;;;;N;;;;; 1332E;EGYPTIAN HIEROGLYPH T033;Lo;0;L;;;;;N;;;;; 1332F;EGYPTIAN HIEROGLYPH T033A;Lo;0;L;;;;;N;;;;; 13330;EGYPTIAN HIEROGLYPH T034;Lo;0;L;;;;;N;;;;; 13331;EGYPTIAN HIEROGLYPH T035;Lo;0;L;;;;;N;;;;; 13332;EGYPTIAN HIEROGLYPH T036;Lo;0;L;;;;;N;;;;; 13333;EGYPTIAN HIEROGLYPH U001;Lo;0;L;;;;;N;;;;; 13334;EGYPTIAN HIEROGLYPH U002;Lo;0;L;;;;;N;;;;; 13335;EGYPTIAN HIEROGLYPH U003;Lo;0;L;;;;;N;;;;; 13336;EGYPTIAN HIEROGLYPH U004;Lo;0;L;;;;;N;;;;; 13337;EGYPTIAN HIEROGLYPH U005;Lo;0;L;;;;;N;;;;; 13338;EGYPTIAN HIEROGLYPH U006;Lo;0;L;;;;;N;;;;; 13339;EGYPTIAN HIEROGLYPH U006A;Lo;0;L;;;;;N;;;;; 1333A;EGYPTIAN HIEROGLYPH U006B;Lo;0;L;;;;;N;;;;; 1333B;EGYPTIAN HIEROGLYPH U007;Lo;0;L;;;;;N;;;;; 1333C;EGYPTIAN HIEROGLYPH U008;Lo;0;L;;;;;N;;;;; 1333D;EGYPTIAN HIEROGLYPH U009;Lo;0;L;;;;;N;;;;; 1333E;EGYPTIAN HIEROGLYPH U010;Lo;0;L;;;;;N;;;;; 1333F;EGYPTIAN HIEROGLYPH U011;Lo;0;L;;;;;N;;;;; 13340;EGYPTIAN HIEROGLYPH U012;Lo;0;L;;;;;N;;;;; 13341;EGYPTIAN HIEROGLYPH U013;Lo;0;L;;;;;N;;;;; 13342;EGYPTIAN HIEROGLYPH U014;Lo;0;L;;;;;N;;;;; 13343;EGYPTIAN HIEROGLYPH U015;Lo;0;L;;;;;N;;;;; 13344;EGYPTIAN HIEROGLYPH U016;Lo;0;L;;;;;N;;;;; 13345;EGYPTIAN HIEROGLYPH U017;Lo;0;L;;;;;N;;;;; 13346;EGYPTIAN HIEROGLYPH U018;Lo;0;L;;;;;N;;;;; 13347;EGYPTIAN HIEROGLYPH U019;Lo;0;L;;;;;N;;;;; 13348;EGYPTIAN HIEROGLYPH U020;Lo;0;L;;;;;N;;;;; 13349;EGYPTIAN HIEROGLYPH U021;Lo;0;L;;;;;N;;;;; 1334A;EGYPTIAN HIEROGLYPH U022;Lo;0;L;;;;;N;;;;; 1334B;EGYPTIAN HIEROGLYPH U023;Lo;0;L;;;;;N;;;;; 1334C;EGYPTIAN HIEROGLYPH U023A;Lo;0;L;;;;;N;;;;; 1334D;EGYPTIAN HIEROGLYPH U024;Lo;0;L;;;;;N;;;;; 1334E;EGYPTIAN HIEROGLYPH U025;Lo;0;L;;;;;N;;;;; 1334F;EGYPTIAN HIEROGLYPH U026;Lo;0;L;;;;;N;;;;; 13350;EGYPTIAN HIEROGLYPH U027;Lo;0;L;;;;;N;;;;; 13351;EGYPTIAN HIEROGLYPH U028;Lo;0;L;;;;;N;;;;; 13352;EGYPTIAN HIEROGLYPH U029;Lo;0;L;;;;;N;;;;; 13353;EGYPTIAN HIEROGLYPH U029A;Lo;0;L;;;;;N;;;;; 13354;EGYPTIAN HIEROGLYPH U030;Lo;0;L;;;;;N;;;;; 13355;EGYPTIAN HIEROGLYPH U031;Lo;0;L;;;;;N;;;;; 13356;EGYPTIAN HIEROGLYPH U032;Lo;0;L;;;;;N;;;;; 13357;EGYPTIAN HIEROGLYPH U032A;Lo;0;L;;;;;N;;;;; 13358;EGYPTIAN HIEROGLYPH U033;Lo;0;L;;;;;N;;;;; 13359;EGYPTIAN HIEROGLYPH U034;Lo;0;L;;;;;N;;;;; 1335A;EGYPTIAN HIEROGLYPH U035;Lo;0;L;;;;;N;;;;; 1335B;EGYPTIAN HIEROGLYPH U036;Lo;0;L;;;;;N;;;;; 1335C;EGYPTIAN HIEROGLYPH U037;Lo;0;L;;;;;N;;;;; 1335D;EGYPTIAN HIEROGLYPH U038;Lo;0;L;;;;;N;;;;; 1335E;EGYPTIAN HIEROGLYPH U039;Lo;0;L;;;;;N;;;;; 1335F;EGYPTIAN HIEROGLYPH U040;Lo;0;L;;;;;N;;;;; 13360;EGYPTIAN HIEROGLYPH U041;Lo;0;L;;;;;N;;;;; 13361;EGYPTIAN HIEROGLYPH U042;Lo;0;L;;;;;N;;;;; 13362;EGYPTIAN HIEROGLYPH V001;Lo;0;L;;;;;N;;;;; 13363;EGYPTIAN HIEROGLYPH V001A;Lo;0;L;;;;;N;;;;; 13364;EGYPTIAN HIEROGLYPH V001B;Lo;0;L;;;;;N;;;;; 13365;EGYPTIAN HIEROGLYPH V001C;Lo;0;L;;;;;N;;;;; 13366;EGYPTIAN HIEROGLYPH V001D;Lo;0;L;;;;;N;;;;; 13367;EGYPTIAN HIEROGLYPH V001E;Lo;0;L;;;;;N;;;;; 13368;EGYPTIAN HIEROGLYPH V001F;Lo;0;L;;;;;N;;;;; 13369;EGYPTIAN HIEROGLYPH V001G;Lo;0;L;;;;;N;;;;; 1336A;EGYPTIAN HIEROGLYPH V001H;Lo;0;L;;;;;N;;;;; 1336B;EGYPTIAN HIEROGLYPH V001I;Lo;0;L;;;;;N;;;;; 1336C;EGYPTIAN HIEROGLYPH V002;Lo;0;L;;;;;N;;;;; 1336D;EGYPTIAN HIEROGLYPH V002A;Lo;0;L;;;;;N;;;;; 1336E;EGYPTIAN HIEROGLYPH V003;Lo;0;L;;;;;N;;;;; 1336F;EGYPTIAN HIEROGLYPH V004;Lo;0;L;;;;;N;;;;; 13370;EGYPTIAN HIEROGLYPH V005;Lo;0;L;;;;;N;;;;; 13371;EGYPTIAN HIEROGLYPH V006;Lo;0;L;;;;;N;;;;; 13372;EGYPTIAN HIEROGLYPH V007;Lo;0;L;;;;;N;;;;; 13373;EGYPTIAN HIEROGLYPH V007A;Lo;0;L;;;;;N;;;;; 13374;EGYPTIAN HIEROGLYPH V007B;Lo;0;L;;;;;N;;;;; 13375;EGYPTIAN HIEROGLYPH V008;Lo;0;L;;;;;N;;;;; 13376;EGYPTIAN HIEROGLYPH V009;Lo;0;L;;;;;N;;;;; 13377;EGYPTIAN HIEROGLYPH V010;Lo;0;L;;;;;N;;;;; 13378;EGYPTIAN HIEROGLYPH V011;Lo;0;L;;;;;N;;;;; 13379;EGYPTIAN HIEROGLYPH V011A;Lo;0;L;;;;;N;;;;; 1337A;EGYPTIAN HIEROGLYPH V011B;Lo;0;L;;;;;N;;;;; 1337B;EGYPTIAN HIEROGLYPH V011C;Lo;0;L;;;;;N;;;;; 1337C;EGYPTIAN HIEROGLYPH V012;Lo;0;L;;;;;N;;;;; 1337D;EGYPTIAN HIEROGLYPH V012A;Lo;0;L;;;;;N;;;;; 1337E;EGYPTIAN HIEROGLYPH V012B;Lo;0;L;;;;;N;;;;; 1337F;EGYPTIAN HIEROGLYPH V013;Lo;0;L;;;;;N;;;;; 13380;EGYPTIAN HIEROGLYPH V014;Lo;0;L;;;;;N;;;;; 13381;EGYPTIAN HIEROGLYPH V015;Lo;0;L;;;;;N;;;;; 13382;EGYPTIAN HIEROGLYPH V016;Lo;0;L;;;;;N;;;;; 13383;EGYPTIAN HIEROGLYPH V017;Lo;0;L;;;;;N;;;;; 13384;EGYPTIAN HIEROGLYPH V018;Lo;0;L;;;;;N;;;;; 13385;EGYPTIAN HIEROGLYPH V019;Lo;0;L;;;;;N;;;;; 13386;EGYPTIAN HIEROGLYPH V020;Lo;0;L;;;;;N;;;;; 13387;EGYPTIAN HIEROGLYPH V020A;Lo;0;L;;;;;N;;;;; 13388;EGYPTIAN HIEROGLYPH V020B;Lo;0;L;;;;;N;;;;; 13389;EGYPTIAN HIEROGLYPH V020C;Lo;0;L;;;;;N;;;;; 1338A;EGYPTIAN HIEROGLYPH V020D;Lo;0;L;;;;;N;;;;; 1338B;EGYPTIAN HIEROGLYPH V020E;Lo;0;L;;;;;N;;;;; 1338C;EGYPTIAN HIEROGLYPH V020F;Lo;0;L;;;;;N;;;;; 1338D;EGYPTIAN HIEROGLYPH V020G;Lo;0;L;;;;;N;;;;; 1338E;EGYPTIAN HIEROGLYPH V020H;Lo;0;L;;;;;N;;;;; 1338F;EGYPTIAN HIEROGLYPH V020I;Lo;0;L;;;;;N;;;;; 13390;EGYPTIAN HIEROGLYPH V020J;Lo;0;L;;;;;N;;;;; 13391;EGYPTIAN HIEROGLYPH V020K;Lo;0;L;;;;;N;;;;; 13392;EGYPTIAN HIEROGLYPH V020L;Lo;0;L;;;;;N;;;;; 13393;EGYPTIAN HIEROGLYPH V021;Lo;0;L;;;;;N;;;;; 13394;EGYPTIAN HIEROGLYPH V022;Lo;0;L;;;;;N;;;;; 13395;EGYPTIAN HIEROGLYPH V023;Lo;0;L;;;;;N;;;;; 13396;EGYPTIAN HIEROGLYPH V023A;Lo;0;L;;;;;N;;;;; 13397;EGYPTIAN HIEROGLYPH V024;Lo;0;L;;;;;N;;;;; 13398;EGYPTIAN HIEROGLYPH V025;Lo;0;L;;;;;N;;;;; 13399;EGYPTIAN HIEROGLYPH V026;Lo;0;L;;;;;N;;;;; 1339A;EGYPTIAN HIEROGLYPH V027;Lo;0;L;;;;;N;;;;; 1339B;EGYPTIAN HIEROGLYPH V028;Lo;0;L;;;;;N;;;;; 1339C;EGYPTIAN HIEROGLYPH V028A;Lo;0;L;;;;;N;;;;; 1339D;EGYPTIAN HIEROGLYPH V029;Lo;0;L;;;;;N;;;;; 1339E;EGYPTIAN HIEROGLYPH V029A;Lo;0;L;;;;;N;;;;; 1339F;EGYPTIAN HIEROGLYPH V030;Lo;0;L;;;;;N;;;;; 133A0;EGYPTIAN HIEROGLYPH V030A;Lo;0;L;;;;;N;;;;; 133A1;EGYPTIAN HIEROGLYPH V031;Lo;0;L;;;;;N;;;;; 133A2;EGYPTIAN HIEROGLYPH V031A;Lo;0;L;;;;;N;;;;; 133A3;EGYPTIAN HIEROGLYPH V032;Lo;0;L;;;;;N;;;;; 133A4;EGYPTIAN HIEROGLYPH V033;Lo;0;L;;;;;N;;;;; 133A5;EGYPTIAN HIEROGLYPH V033A;Lo;0;L;;;;;N;;;;; 133A6;EGYPTIAN HIEROGLYPH V034;Lo;0;L;;;;;N;;;;; 133A7;EGYPTIAN HIEROGLYPH V035;Lo;0;L;;;;;N;;;;; 133A8;EGYPTIAN HIEROGLYPH V036;Lo;0;L;;;;;N;;;;; 133A9;EGYPTIAN HIEROGLYPH V037;Lo;0;L;;;;;N;;;;; 133AA;EGYPTIAN HIEROGLYPH V037A;Lo;0;L;;;;;N;;;;; 133AB;EGYPTIAN HIEROGLYPH V038;Lo;0;L;;;;;N;;;;; 133AC;EGYPTIAN HIEROGLYPH V039;Lo;0;L;;;;;N;;;;; 133AD;EGYPTIAN HIEROGLYPH V040;Lo;0;L;;;;;N;;;;; 133AE;EGYPTIAN HIEROGLYPH V040A;Lo;0;L;;;;;N;;;;; 133AF;EGYPTIAN HIEROGLYPH W001;Lo;0;L;;;;;N;;;;; 133B0;EGYPTIAN HIEROGLYPH W002;Lo;0;L;;;;;N;;;;; 133B1;EGYPTIAN HIEROGLYPH W003;Lo;0;L;;;;;N;;;;; 133B2;EGYPTIAN HIEROGLYPH W003A;Lo;0;L;;;;;N;;;;; 133B3;EGYPTIAN HIEROGLYPH W004;Lo;0;L;;;;;N;;;;; 133B4;EGYPTIAN HIEROGLYPH W005;Lo;0;L;;;;;N;;;;; 133B5;EGYPTIAN HIEROGLYPH W006;Lo;0;L;;;;;N;;;;; 133B6;EGYPTIAN HIEROGLYPH W007;Lo;0;L;;;;;N;;;;; 133B7;EGYPTIAN HIEROGLYPH W008;Lo;0;L;;;;;N;;;;; 133B8;EGYPTIAN HIEROGLYPH W009;Lo;0;L;;;;;N;;;;; 133B9;EGYPTIAN HIEROGLYPH W009A;Lo;0;L;;;;;N;;;;; 133BA;EGYPTIAN HIEROGLYPH W010;Lo;0;L;;;;;N;;;;; 133BB;EGYPTIAN HIEROGLYPH W010A;Lo;0;L;;;;;N;;;;; 133BC;EGYPTIAN HIEROGLYPH W011;Lo;0;L;;;;;N;;;;; 133BD;EGYPTIAN HIEROGLYPH W012;Lo;0;L;;;;;N;;;;; 133BE;EGYPTIAN HIEROGLYPH W013;Lo;0;L;;;;;N;;;;; 133BF;EGYPTIAN HIEROGLYPH W014;Lo;0;L;;;;;N;;;;; 133C0;EGYPTIAN HIEROGLYPH W014A;Lo;0;L;;;;;N;;;;; 133C1;EGYPTIAN HIEROGLYPH W015;Lo;0;L;;;;;N;;;;; 133C2;EGYPTIAN HIEROGLYPH W016;Lo;0;L;;;;;N;;;;; 133C3;EGYPTIAN HIEROGLYPH W017;Lo;0;L;;;;;N;;;;; 133C4;EGYPTIAN HIEROGLYPH W017A;Lo;0;L;;;;;N;;;;; 133C5;EGYPTIAN HIEROGLYPH W018;Lo;0;L;;;;;N;;;;; 133C6;EGYPTIAN HIEROGLYPH W018A;Lo;0;L;;;;;N;;;;; 133C7;EGYPTIAN HIEROGLYPH W019;Lo;0;L;;;;;N;;;;; 133C8;EGYPTIAN HIEROGLYPH W020;Lo;0;L;;;;;N;;;;; 133C9;EGYPTIAN HIEROGLYPH W021;Lo;0;L;;;;;N;;;;; 133CA;EGYPTIAN HIEROGLYPH W022;Lo;0;L;;;;;N;;;;; 133CB;EGYPTIAN HIEROGLYPH W023;Lo;0;L;;;;;N;;;;; 133CC;EGYPTIAN HIEROGLYPH W024;Lo;0;L;;;;;N;;;;; 133CD;EGYPTIAN HIEROGLYPH W024A;Lo;0;L;;;;;N;;;;; 133CE;EGYPTIAN HIEROGLYPH W025;Lo;0;L;;;;;N;;;;; 133CF;EGYPTIAN HIEROGLYPH X001;Lo;0;L;;;;;N;;;;; 133D0;EGYPTIAN HIEROGLYPH X002;Lo;0;L;;;;;N;;;;; 133D1;EGYPTIAN HIEROGLYPH X003;Lo;0;L;;;;;N;;;;; 133D2;EGYPTIAN HIEROGLYPH X004;Lo;0;L;;;;;N;;;;; 133D3;EGYPTIAN HIEROGLYPH X004A;Lo;0;L;;;;;N;;;;; 133D4;EGYPTIAN HIEROGLYPH X004B;Lo;0;L;;;;;N;;;;; 133D5;EGYPTIAN HIEROGLYPH X005;Lo;0;L;;;;;N;;;;; 133D6;EGYPTIAN HIEROGLYPH X006;Lo;0;L;;;;;N;;;;; 133D7;EGYPTIAN HIEROGLYPH X006A;Lo;0;L;;;;;N;;;;; 133D8;EGYPTIAN HIEROGLYPH X007;Lo;0;L;;;;;N;;;;; 133D9;EGYPTIAN HIEROGLYPH X008;Lo;0;L;;;;;N;;;;; 133DA;EGYPTIAN HIEROGLYPH X008A;Lo;0;L;;;;;N;;;;; 133DB;EGYPTIAN HIEROGLYPH Y001;Lo;0;L;;;;;N;;;;; 133DC;EGYPTIAN HIEROGLYPH Y001A;Lo;0;L;;;;;N;;;;; 133DD;EGYPTIAN HIEROGLYPH Y002;Lo;0;L;;;;;N;;;;; 133DE;EGYPTIAN HIEROGLYPH Y003;Lo;0;L;;;;;N;;;;; 133DF;EGYPTIAN HIEROGLYPH Y004;Lo;0;L;;;;;N;;;;; 133E0;EGYPTIAN HIEROGLYPH Y005;Lo;0;L;;;;;N;;;;; 133E1;EGYPTIAN HIEROGLYPH Y006;Lo;0;L;;;;;N;;;;; 133E2;EGYPTIAN HIEROGLYPH Y007;Lo;0;L;;;;;N;;;;; 133E3;EGYPTIAN HIEROGLYPH Y008;Lo;0;L;;;;;N;;;;; 133E4;EGYPTIAN HIEROGLYPH Z001;Lo;0;L;;;;;N;;;;; 133E5;EGYPTIAN HIEROGLYPH Z002;Lo;0;L;;;;;N;;;;; 133E6;EGYPTIAN HIEROGLYPH Z002A;Lo;0;L;;;;;N;;;;; 133E7;EGYPTIAN HIEROGLYPH Z002B;Lo;0;L;;;;;N;;;;; 133E8;EGYPTIAN HIEROGLYPH Z002C;Lo;0;L;;;;;N;;;;; 133E9;EGYPTIAN HIEROGLYPH Z002D;Lo;0;L;;;;;N;;;;; 133EA;EGYPTIAN HIEROGLYPH Z003;Lo;0;L;;;;;N;;;;; 133EB;EGYPTIAN HIEROGLYPH Z003A;Lo;0;L;;;;;N;;;;; 133EC;EGYPTIAN HIEROGLYPH Z003B;Lo;0;L;;;;;N;;;;; 133ED;EGYPTIAN HIEROGLYPH Z004;Lo;0;L;;;;;N;;;;; 133EE;EGYPTIAN HIEROGLYPH Z004A;Lo;0;L;;;;;N;;;;; 133EF;EGYPTIAN HIEROGLYPH Z005;Lo;0;L;;;;;N;;;;; 133F0;EGYPTIAN HIEROGLYPH Z005A;Lo;0;L;;;;;N;;;;; 133F1;EGYPTIAN HIEROGLYPH Z006;Lo;0;L;;;;;N;;;;; 133F2;EGYPTIAN HIEROGLYPH Z007;Lo;0;L;;;;;N;;;;; 133F3;EGYPTIAN HIEROGLYPH Z008;Lo;0;L;;;;;N;;;;; 133F4;EGYPTIAN HIEROGLYPH Z009;Lo;0;L;;;;;N;;;;; 133F5;EGYPTIAN HIEROGLYPH Z010;Lo;0;L;;;;;N;;;;; 133F6;EGYPTIAN HIEROGLYPH Z011;Lo;0;L;;;;;N;;;;; 133F7;EGYPTIAN HIEROGLYPH Z012;Lo;0;L;;;;;N;;;;; 133F8;EGYPTIAN HIEROGLYPH Z013;Lo;0;L;;;;;N;;;;; 133F9;EGYPTIAN HIEROGLYPH Z014;Lo;0;L;;;;;N;;;;; 133FA;EGYPTIAN HIEROGLYPH Z015;Lo;0;L;;;;;N;;;;; 133FB;EGYPTIAN HIEROGLYPH Z015A;Lo;0;L;;;;;N;;;;; 133FC;EGYPTIAN HIEROGLYPH Z015B;Lo;0;L;;;;;N;;;;; 133FD;EGYPTIAN HIEROGLYPH Z015C;Lo;0;L;;;;;N;;;;; 133FE;EGYPTIAN HIEROGLYPH Z015D;Lo;0;L;;;;;N;;;;; 133FF;EGYPTIAN HIEROGLYPH Z015E;Lo;0;L;;;;;N;;;;; 13400;EGYPTIAN HIEROGLYPH Z015F;Lo;0;L;;;;;N;;;;; 13401;EGYPTIAN HIEROGLYPH Z015G;Lo;0;L;;;;;N;;;;; 13402;EGYPTIAN HIEROGLYPH Z015H;Lo;0;L;;;;;N;;;;; 13403;EGYPTIAN HIEROGLYPH Z015I;Lo;0;L;;;;;N;;;;; 13404;EGYPTIAN HIEROGLYPH Z016;Lo;0;L;;;;;N;;;;; 13405;EGYPTIAN HIEROGLYPH Z016A;Lo;0;L;;;;;N;;;;; 13406;EGYPTIAN HIEROGLYPH Z016B;Lo;0;L;;;;;N;;;;; 13407;EGYPTIAN HIEROGLYPH Z016C;Lo;0;L;;;;;N;;;;; 13408;EGYPTIAN HIEROGLYPH Z016D;Lo;0;L;;;;;N;;;;; 13409;EGYPTIAN HIEROGLYPH Z016E;Lo;0;L;;;;;N;;;;; 1340A;EGYPTIAN HIEROGLYPH Z016F;Lo;0;L;;;;;N;;;;; 1340B;EGYPTIAN HIEROGLYPH Z016G;Lo;0;L;;;;;N;;;;; 1340C;EGYPTIAN HIEROGLYPH Z016H;Lo;0;L;;;;;N;;;;; 1340D;EGYPTIAN HIEROGLYPH AA001;Lo;0;L;;;;;N;;;;; 1340E;EGYPTIAN HIEROGLYPH AA002;Lo;0;L;;;;;N;;;;; 1340F;EGYPTIAN HIEROGLYPH AA003;Lo;0;L;;;;;N;;;;; 13410;EGYPTIAN HIEROGLYPH AA004;Lo;0;L;;;;;N;;;;; 13411;EGYPTIAN HIEROGLYPH AA005;Lo;0;L;;;;;N;;;;; 13412;EGYPTIAN HIEROGLYPH AA006;Lo;0;L;;;;;N;;;;; 13413;EGYPTIAN HIEROGLYPH AA007;Lo;0;L;;;;;N;;;;; 13414;EGYPTIAN HIEROGLYPH AA007A;Lo;0;L;;;;;N;;;;; 13415;EGYPTIAN HIEROGLYPH AA007B;Lo;0;L;;;;;N;;;;; 13416;EGYPTIAN HIEROGLYPH AA008;Lo;0;L;;;;;N;;;;; 13417;EGYPTIAN HIEROGLYPH AA009;Lo;0;L;;;;;N;;;;; 13418;EGYPTIAN HIEROGLYPH AA010;Lo;0;L;;;;;N;;;;; 13419;EGYPTIAN HIEROGLYPH AA011;Lo;0;L;;;;;N;;;;; 1341A;EGYPTIAN HIEROGLYPH AA012;Lo;0;L;;;;;N;;;;; 1341B;EGYPTIAN HIEROGLYPH AA013;Lo;0;L;;;;;N;;;;; 1341C;EGYPTIAN HIEROGLYPH AA014;Lo;0;L;;;;;N;;;;; 1341D;EGYPTIAN HIEROGLYPH AA015;Lo;0;L;;;;;N;;;;; 1341E;EGYPTIAN HIEROGLYPH AA016;Lo;0;L;;;;;N;;;;; 1341F;EGYPTIAN HIEROGLYPH AA017;Lo;0;L;;;;;N;;;;; 13420;EGYPTIAN HIEROGLYPH AA018;Lo;0;L;;;;;N;;;;; 13421;EGYPTIAN HIEROGLYPH AA019;Lo;0;L;;;;;N;;;;; 13422;EGYPTIAN HIEROGLYPH AA020;Lo;0;L;;;;;N;;;;; 13423;EGYPTIAN HIEROGLYPH AA021;Lo;0;L;;;;;N;;;;; 13424;EGYPTIAN HIEROGLYPH AA022;Lo;0;L;;;;;N;;;;; 13425;EGYPTIAN HIEROGLYPH AA023;Lo;0;L;;;;;N;;;;; 13426;EGYPTIAN HIEROGLYPH AA024;Lo;0;L;;;;;N;;;;; 13427;EGYPTIAN HIEROGLYPH AA025;Lo;0;L;;;;;N;;;;; 13428;EGYPTIAN HIEROGLYPH AA026;Lo;0;L;;;;;N;;;;; 13429;EGYPTIAN HIEROGLYPH AA027;Lo;0;L;;;;;N;;;;; 1342A;EGYPTIAN HIEROGLYPH AA028;Lo;0;L;;;;;N;;;;; 1342B;EGYPTIAN HIEROGLYPH AA029;Lo;0;L;;;;;N;;;;; 1342C;EGYPTIAN HIEROGLYPH AA030;Lo;0;L;;;;;N;;;;; 1342D;EGYPTIAN HIEROGLYPH AA031;Lo;0;L;;;;;N;;;;; 1342E;EGYPTIAN HIEROGLYPH AA032;Lo;0;L;;;;;N;;;;; 16800;BAMUM LETTER PHASE-A NGKUE MFON;Lo;0;L;;;;;N;;;;; 16801;BAMUM LETTER PHASE-A GBIEE FON;Lo;0;L;;;;;N;;;;; 16802;BAMUM LETTER PHASE-A PON MFON PIPAEMGBIEE;Lo;0;L;;;;;N;;;;; 16803;BAMUM LETTER PHASE-A PON MFON PIPAEMBA;Lo;0;L;;;;;N;;;;; 16804;BAMUM LETTER PHASE-A NAA MFON;Lo;0;L;;;;;N;;;;; 16805;BAMUM LETTER PHASE-A SHUENSHUET;Lo;0;L;;;;;N;;;;; 16806;BAMUM LETTER PHASE-A TITA MFON;Lo;0;L;;;;;N;;;;; 16807;BAMUM LETTER PHASE-A NZA MFON;Lo;0;L;;;;;N;;;;; 16808;BAMUM LETTER PHASE-A SHINDA PA NJI;Lo;0;L;;;;;N;;;;; 16809;BAMUM LETTER PHASE-A PON PA NJI PIPAEMGBIEE;Lo;0;L;;;;;N;;;;; 1680A;BAMUM LETTER PHASE-A PON PA NJI PIPAEMBA;Lo;0;L;;;;;N;;;;; 1680B;BAMUM LETTER PHASE-A MAEMBGBIEE;Lo;0;L;;;;;N;;;;; 1680C;BAMUM LETTER PHASE-A TU MAEMBA;Lo;0;L;;;;;N;;;;; 1680D;BAMUM LETTER PHASE-A NGANGU;Lo;0;L;;;;;N;;;;; 1680E;BAMUM LETTER PHASE-A MAEMVEUX;Lo;0;L;;;;;N;;;;; 1680F;BAMUM LETTER PHASE-A MANSUAE;Lo;0;L;;;;;N;;;;; 16810;BAMUM LETTER PHASE-A MVEUAENGAM;Lo;0;L;;;;;N;;;;; 16811;BAMUM LETTER PHASE-A SEUNYAM;Lo;0;L;;;;;N;;;;; 16812;BAMUM LETTER PHASE-A NTOQPEN;Lo;0;L;;;;;N;;;;; 16813;BAMUM LETTER PHASE-A KEUKEUTNDA;Lo;0;L;;;;;N;;;;; 16814;BAMUM LETTER PHASE-A NKINDI;Lo;0;L;;;;;N;;;;; 16815;BAMUM LETTER PHASE-A SUU;Lo;0;L;;;;;N;;;;; 16816;BAMUM LETTER PHASE-A NGKUENZEUM;Lo;0;L;;;;;N;;;;; 16817;BAMUM LETTER PHASE-A LAPAQ;Lo;0;L;;;;;N;;;;; 16818;BAMUM LETTER PHASE-A LET KUT;Lo;0;L;;;;;N;;;;; 16819;BAMUM LETTER PHASE-A NTAP MFAA;Lo;0;L;;;;;N;;;;; 1681A;BAMUM LETTER PHASE-A MAEKEUP;Lo;0;L;;;;;N;;;;; 1681B;BAMUM LETTER PHASE-A PASHAE;Lo;0;L;;;;;N;;;;; 1681C;BAMUM LETTER PHASE-A GHEUAERAE;Lo;0;L;;;;;N;;;;; 1681D;BAMUM LETTER PHASE-A PAMSHAE;Lo;0;L;;;;;N;;;;; 1681E;BAMUM LETTER PHASE-A MON NGGEUAET;Lo;0;L;;;;;N;;;;; 1681F;BAMUM LETTER PHASE-A NZUN MEUT;Lo;0;L;;;;;N;;;;; 16820;BAMUM LETTER PHASE-A U YUQ NAE;Lo;0;L;;;;;N;;;;; 16821;BAMUM LETTER PHASE-A GHEUAEGHEUAE;Lo;0;L;;;;;N;;;;; 16822;BAMUM LETTER PHASE-A NTAP NTAA;Lo;0;L;;;;;N;;;;; 16823;BAMUM LETTER PHASE-A SISA;Lo;0;L;;;;;N;;;;; 16824;BAMUM LETTER PHASE-A MGBASA;Lo;0;L;;;;;N;;;;; 16825;BAMUM LETTER PHASE-A MEUNJOMNDEUQ;Lo;0;L;;;;;N;;;;; 16826;BAMUM LETTER PHASE-A MOOMPUQ;Lo;0;L;;;;;N;;;;; 16827;BAMUM LETTER PHASE-A KAFA;Lo;0;L;;;;;N;;;;; 16828;BAMUM LETTER PHASE-A PA LEERAEWA;Lo;0;L;;;;;N;;;;; 16829;BAMUM LETTER PHASE-A NDA LEERAEWA;Lo;0;L;;;;;N;;;;; 1682A;BAMUM LETTER PHASE-A PET;Lo;0;L;;;;;N;;;;; 1682B;BAMUM LETTER PHASE-A MAEMKPEN;Lo;0;L;;;;;N;;;;; 1682C;BAMUM LETTER PHASE-A NIKA;Lo;0;L;;;;;N;;;;; 1682D;BAMUM LETTER PHASE-A PUP;Lo;0;L;;;;;N;;;;; 1682E;BAMUM LETTER PHASE-A TUAEP;Lo;0;L;;;;;N;;;;; 1682F;BAMUM LETTER PHASE-A LUAEP;Lo;0;L;;;;;N;;;;; 16830;BAMUM LETTER PHASE-A SONJAM;Lo;0;L;;;;;N;;;;; 16831;BAMUM LETTER PHASE-A TEUTEUWEN;Lo;0;L;;;;;N;;;;; 16832;BAMUM LETTER PHASE-A MAENYI;Lo;0;L;;;;;N;;;;; 16833;BAMUM LETTER PHASE-A KET;Lo;0;L;;;;;N;;;;; 16834;BAMUM LETTER PHASE-A NDAANGGEUAET;Lo;0;L;;;;;N;;;;; 16835;BAMUM LETTER PHASE-A KUOQ;Lo;0;L;;;;;N;;;;; 16836;BAMUM LETTER PHASE-A MOOMEUT;Lo;0;L;;;;;N;;;;; 16837;BAMUM LETTER PHASE-A SHUM;Lo;0;L;;;;;N;;;;; 16838;BAMUM LETTER PHASE-A LOMMAE;Lo;0;L;;;;;N;;;;; 16839;BAMUM LETTER PHASE-A FIRI;Lo;0;L;;;;;N;;;;; 1683A;BAMUM LETTER PHASE-A ROM;Lo;0;L;;;;;N;;;;; 1683B;BAMUM LETTER PHASE-A KPOQ;Lo;0;L;;;;;N;;;;; 1683C;BAMUM LETTER PHASE-A SOQ;Lo;0;L;;;;;N;;;;; 1683D;BAMUM LETTER PHASE-A MAP PIEET;Lo;0;L;;;;;N;;;;; 1683E;BAMUM LETTER PHASE-A SHIRAE;Lo;0;L;;;;;N;;;;; 1683F;BAMUM LETTER PHASE-A NTAP;Lo;0;L;;;;;N;;;;; 16840;BAMUM LETTER PHASE-A SHOQ NSHUT YUM;Lo;0;L;;;;;N;;;;; 16841;BAMUM LETTER PHASE-A NYIT MONGKEUAEQ;Lo;0;L;;;;;N;;;;; 16842;BAMUM LETTER PHASE-A PAARAE;Lo;0;L;;;;;N;;;;; 16843;BAMUM LETTER PHASE-A NKAARAE;Lo;0;L;;;;;N;;;;; 16844;BAMUM LETTER PHASE-A UNKNOWN;Lo;0;L;;;;;N;;;;; 16845;BAMUM LETTER PHASE-A NGGEN;Lo;0;L;;;;;N;;;;; 16846;BAMUM LETTER PHASE-A MAESI;Lo;0;L;;;;;N;;;;; 16847;BAMUM LETTER PHASE-A NJAM;Lo;0;L;;;;;N;;;;; 16848;BAMUM LETTER PHASE-A MBANYI;Lo;0;L;;;;;N;;;;; 16849;BAMUM LETTER PHASE-A NYET;Lo;0;L;;;;;N;;;;; 1684A;BAMUM LETTER PHASE-A TEUAEN;Lo;0;L;;;;;N;;;;; 1684B;BAMUM LETTER PHASE-A SOT;Lo;0;L;;;;;N;;;;; 1684C;BAMUM LETTER PHASE-A PAAM;Lo;0;L;;;;;N;;;;; 1684D;BAMUM LETTER PHASE-A NSHIEE;Lo;0;L;;;;;N;;;;; 1684E;BAMUM LETTER PHASE-A MAEM;Lo;0;L;;;;;N;;;;; 1684F;BAMUM LETTER PHASE-A NYI;Lo;0;L;;;;;N;;;;; 16850;BAMUM LETTER PHASE-A KAQ;Lo;0;L;;;;;N;;;;; 16851;BAMUM LETTER PHASE-A NSHA;Lo;0;L;;;;;N;;;;; 16852;BAMUM LETTER PHASE-A VEE;Lo;0;L;;;;;N;;;;; 16853;BAMUM LETTER PHASE-A LU;Lo;0;L;;;;;N;;;;; 16854;BAMUM LETTER PHASE-A NEN;Lo;0;L;;;;;N;;;;; 16855;BAMUM LETTER PHASE-A NAQ;Lo;0;L;;;;;N;;;;; 16856;BAMUM LETTER PHASE-A MBAQ;Lo;0;L;;;;;N;;;;; 16857;BAMUM LETTER PHASE-B NSHUET;Lo;0;L;;;;;N;;;;; 16858;BAMUM LETTER PHASE-B TU MAEMGBIEE;Lo;0;L;;;;;N;;;;; 16859;BAMUM LETTER PHASE-B SIEE;Lo;0;L;;;;;N;;;;; 1685A;BAMUM LETTER PHASE-B SET TU;Lo;0;L;;;;;N;;;;; 1685B;BAMUM LETTER PHASE-B LOM NTEUM;Lo;0;L;;;;;N;;;;; 1685C;BAMUM LETTER PHASE-B MBA MAELEE;Lo;0;L;;;;;N;;;;; 1685D;BAMUM LETTER PHASE-B KIEEM;Lo;0;L;;;;;N;;;;; 1685E;BAMUM LETTER PHASE-B YEURAE;Lo;0;L;;;;;N;;;;; 1685F;BAMUM LETTER PHASE-B MBAARAE;Lo;0;L;;;;;N;;;;; 16860;BAMUM LETTER PHASE-B KAM;Lo;0;L;;;;;N;;;;; 16861;BAMUM LETTER PHASE-B PEESHI;Lo;0;L;;;;;N;;;;; 16862;BAMUM LETTER PHASE-B YAFU LEERAEWA;Lo;0;L;;;;;N;;;;; 16863;BAMUM LETTER PHASE-B LAM NSHUT NYAM;Lo;0;L;;;;;N;;;;; 16864;BAMUM LETTER PHASE-B NTIEE SHEUOQ;Lo;0;L;;;;;N;;;;; 16865;BAMUM LETTER PHASE-B NDU NJAA;Lo;0;L;;;;;N;;;;; 16866;BAMUM LETTER PHASE-B GHEUGHEUAEM;Lo;0;L;;;;;N;;;;; 16867;BAMUM LETTER PHASE-B PIT;Lo;0;L;;;;;N;;;;; 16868;BAMUM LETTER PHASE-B TU NSIEE;Lo;0;L;;;;;N;;;;; 16869;BAMUM LETTER PHASE-B SHET NJAQ;Lo;0;L;;;;;N;;;;; 1686A;BAMUM LETTER PHASE-B SHEUAEQTU;Lo;0;L;;;;;N;;;;; 1686B;BAMUM LETTER PHASE-B MFON TEUAEQ;Lo;0;L;;;;;N;;;;; 1686C;BAMUM LETTER PHASE-B MBIT MBAAKET;Lo;0;L;;;;;N;;;;; 1686D;BAMUM LETTER PHASE-B NYI NTEUM;Lo;0;L;;;;;N;;;;; 1686E;BAMUM LETTER PHASE-B KEUPUQ;Lo;0;L;;;;;N;;;;; 1686F;BAMUM LETTER PHASE-B GHEUGHEN;Lo;0;L;;;;;N;;;;; 16870;BAMUM LETTER PHASE-B KEUYEUX;Lo;0;L;;;;;N;;;;; 16871;BAMUM LETTER PHASE-B LAANAE;Lo;0;L;;;;;N;;;;; 16872;BAMUM LETTER PHASE-B PARUM;Lo;0;L;;;;;N;;;;; 16873;BAMUM LETTER PHASE-B VEUM;Lo;0;L;;;;;N;;;;; 16874;BAMUM LETTER PHASE-B NGKINDI MVOP;Lo;0;L;;;;;N;;;;; 16875;BAMUM LETTER PHASE-B NGGEU MBU;Lo;0;L;;;;;N;;;;; 16876;BAMUM LETTER PHASE-B WUAET;Lo;0;L;;;;;N;;;;; 16877;BAMUM LETTER PHASE-B SAKEUAE;Lo;0;L;;;;;N;;;;; 16878;BAMUM LETTER PHASE-B TAAM;Lo;0;L;;;;;N;;;;; 16879;BAMUM LETTER PHASE-B MEUQ;Lo;0;L;;;;;N;;;;; 1687A;BAMUM LETTER PHASE-B NGGUOQ;Lo;0;L;;;;;N;;;;; 1687B;BAMUM LETTER PHASE-B NGGUOQ LARGE;Lo;0;L;;;;;N;;;;; 1687C;BAMUM LETTER PHASE-B MFIYAQ;Lo;0;L;;;;;N;;;;; 1687D;BAMUM LETTER PHASE-B SUE;Lo;0;L;;;;;N;;;;; 1687E;BAMUM LETTER PHASE-B MBEURI;Lo;0;L;;;;;N;;;;; 1687F;BAMUM LETTER PHASE-B MONTIEEN;Lo;0;L;;;;;N;;;;; 16880;BAMUM LETTER PHASE-B NYAEMAE;Lo;0;L;;;;;N;;;;; 16881;BAMUM LETTER PHASE-B PUNGAAM;Lo;0;L;;;;;N;;;;; 16882;BAMUM LETTER PHASE-B MEUT NGGEET;Lo;0;L;;;;;N;;;;; 16883;BAMUM LETTER PHASE-B FEUX;Lo;0;L;;;;;N;;;;; 16884;BAMUM LETTER PHASE-B MBUOQ;Lo;0;L;;;;;N;;;;; 16885;BAMUM LETTER PHASE-B FEE;Lo;0;L;;;;;N;;;;; 16886;BAMUM LETTER PHASE-B KEUAEM;Lo;0;L;;;;;N;;;;; 16887;BAMUM LETTER PHASE-B MA NJEUAENA;Lo;0;L;;;;;N;;;;; 16888;BAMUM LETTER PHASE-B MA NJUQA;Lo;0;L;;;;;N;;;;; 16889;BAMUM LETTER PHASE-B LET;Lo;0;L;;;;;N;;;;; 1688A;BAMUM LETTER PHASE-B NGGAAM;Lo;0;L;;;;;N;;;;; 1688B;BAMUM LETTER PHASE-B NSEN;Lo;0;L;;;;;N;;;;; 1688C;BAMUM LETTER PHASE-B MA;Lo;0;L;;;;;N;;;;; 1688D;BAMUM LETTER PHASE-B KIQ;Lo;0;L;;;;;N;;;;; 1688E;BAMUM LETTER PHASE-B NGOM;Lo;0;L;;;;;N;;;;; 1688F;BAMUM LETTER PHASE-C NGKUE MAEMBA;Lo;0;L;;;;;N;;;;; 16890;BAMUM LETTER PHASE-C NZA;Lo;0;L;;;;;N;;;;; 16891;BAMUM LETTER PHASE-C YUM;Lo;0;L;;;;;N;;;;; 16892;BAMUM LETTER PHASE-C WANGKUOQ;Lo;0;L;;;;;N;;;;; 16893;BAMUM LETTER PHASE-C NGGEN;Lo;0;L;;;;;N;;;;; 16894;BAMUM LETTER PHASE-C NDEUAEREE;Lo;0;L;;;;;N;;;;; 16895;BAMUM LETTER PHASE-C NGKAQ;Lo;0;L;;;;;N;;;;; 16896;BAMUM LETTER PHASE-C GHARAE;Lo;0;L;;;;;N;;;;; 16897;BAMUM LETTER PHASE-C MBEEKEET;Lo;0;L;;;;;N;;;;; 16898;BAMUM LETTER PHASE-C GBAYI;Lo;0;L;;;;;N;;;;; 16899;BAMUM LETTER PHASE-C NYIR MKPARAQ MEUN;Lo;0;L;;;;;N;;;;; 1689A;BAMUM LETTER PHASE-C NTU MBIT;Lo;0;L;;;;;N;;;;; 1689B;BAMUM LETTER PHASE-C MBEUM;Lo;0;L;;;;;N;;;;; 1689C;BAMUM LETTER PHASE-C PIRIEEN;Lo;0;L;;;;;N;;;;; 1689D;BAMUM LETTER PHASE-C NDOMBU;Lo;0;L;;;;;N;;;;; 1689E;BAMUM LETTER PHASE-C MBAA CABBAGE-TREE;Lo;0;L;;;;;N;;;;; 1689F;BAMUM LETTER PHASE-C KEUSHEUAEP;Lo;0;L;;;;;N;;;;; 168A0;BAMUM LETTER PHASE-C GHAP;Lo;0;L;;;;;N;;;;; 168A1;BAMUM LETTER PHASE-C KEUKAQ;Lo;0;L;;;;;N;;;;; 168A2;BAMUM LETTER PHASE-C YU MUOMAE;Lo;0;L;;;;;N;;;;; 168A3;BAMUM LETTER PHASE-C NZEUM;Lo;0;L;;;;;N;;;;; 168A4;BAMUM LETTER PHASE-C MBUE;Lo;0;L;;;;;N;;;;; 168A5;BAMUM LETTER PHASE-C NSEUAEN;Lo;0;L;;;;;N;;;;; 168A6;BAMUM LETTER PHASE-C MBIT;Lo;0;L;;;;;N;;;;; 168A7;BAMUM LETTER PHASE-C YEUQ;Lo;0;L;;;;;N;;;;; 168A8;BAMUM LETTER PHASE-C KPARAQ;Lo;0;L;;;;;N;;;;; 168A9;BAMUM LETTER PHASE-C KAA;Lo;0;L;;;;;N;;;;; 168AA;BAMUM LETTER PHASE-C SEUX;Lo;0;L;;;;;N;;;;; 168AB;BAMUM LETTER PHASE-C NDIDA;Lo;0;L;;;;;N;;;;; 168AC;BAMUM LETTER PHASE-C TAASHAE;Lo;0;L;;;;;N;;;;; 168AD;BAMUM LETTER PHASE-C NJUEQ;Lo;0;L;;;;;N;;;;; 168AE;BAMUM LETTER PHASE-C TITA YUE;Lo;0;L;;;;;N;;;;; 168AF;BAMUM LETTER PHASE-C SUAET;Lo;0;L;;;;;N;;;;; 168B0;BAMUM LETTER PHASE-C NGGUAEN NYAM;Lo;0;L;;;;;N;;;;; 168B1;BAMUM LETTER PHASE-C VEUX;Lo;0;L;;;;;N;;;;; 168B2;BAMUM LETTER PHASE-C NANSANAQ;Lo;0;L;;;;;N;;;;; 168B3;BAMUM LETTER PHASE-C MA KEUAERI;Lo;0;L;;;;;N;;;;; 168B4;BAMUM LETTER PHASE-C NTAA;Lo;0;L;;;;;N;;;;; 168B5;BAMUM LETTER PHASE-C NGGUON;Lo;0;L;;;;;N;;;;; 168B6;BAMUM LETTER PHASE-C LAP;Lo;0;L;;;;;N;;;;; 168B7;BAMUM LETTER PHASE-C MBIRIEEN;Lo;0;L;;;;;N;;;;; 168B8;BAMUM LETTER PHASE-C MGBASAQ;Lo;0;L;;;;;N;;;;; 168B9;BAMUM LETTER PHASE-C NTEUNGBA;Lo;0;L;;;;;N;;;;; 168BA;BAMUM LETTER PHASE-C TEUTEUX;Lo;0;L;;;;;N;;;;; 168BB;BAMUM LETTER PHASE-C NGGUM;Lo;0;L;;;;;N;;;;; 168BC;BAMUM LETTER PHASE-C FUE;Lo;0;L;;;;;N;;;;; 168BD;BAMUM LETTER PHASE-C NDEUT;Lo;0;L;;;;;N;;;;; 168BE;BAMUM LETTER PHASE-C NSA;Lo;0;L;;;;;N;;;;; 168BF;BAMUM LETTER PHASE-C NSHAQ;Lo;0;L;;;;;N;;;;; 168C0;BAMUM LETTER PHASE-C BUNG;Lo;0;L;;;;;N;;;;; 168C1;BAMUM LETTER PHASE-C VEUAEPEN;Lo;0;L;;;;;N;;;;; 168C2;BAMUM LETTER PHASE-C MBERAE;Lo;0;L;;;;;N;;;;; 168C3;BAMUM LETTER PHASE-C RU;Lo;0;L;;;;;N;;;;; 168C4;BAMUM LETTER PHASE-C NJAEM;Lo;0;L;;;;;N;;;;; 168C5;BAMUM LETTER PHASE-C LAM;Lo;0;L;;;;;N;;;;; 168C6;BAMUM LETTER PHASE-C TITUAEP;Lo;0;L;;;;;N;;;;; 168C7;BAMUM LETTER PHASE-C NSUOT NGOM;Lo;0;L;;;;;N;;;;; 168C8;BAMUM LETTER PHASE-C NJEEEE;Lo;0;L;;;;;N;;;;; 168C9;BAMUM LETTER PHASE-C KET;Lo;0;L;;;;;N;;;;; 168CA;BAMUM LETTER PHASE-C NGGU;Lo;0;L;;;;;N;;;;; 168CB;BAMUM LETTER PHASE-C MAESI;Lo;0;L;;;;;N;;;;; 168CC;BAMUM LETTER PHASE-C MBUAEM;Lo;0;L;;;;;N;;;;; 168CD;BAMUM LETTER PHASE-C LU;Lo;0;L;;;;;N;;;;; 168CE;BAMUM LETTER PHASE-C KUT;Lo;0;L;;;;;N;;;;; 168CF;BAMUM LETTER PHASE-C NJAM;Lo;0;L;;;;;N;;;;; 168D0;BAMUM LETTER PHASE-C NGOM;Lo;0;L;;;;;N;;;;; 168D1;BAMUM LETTER PHASE-C WUP;Lo;0;L;;;;;N;;;;; 168D2;BAMUM LETTER PHASE-C NGGUEET;Lo;0;L;;;;;N;;;;; 168D3;BAMUM LETTER PHASE-C NSOM;Lo;0;L;;;;;N;;;;; 168D4;BAMUM LETTER PHASE-C NTEN;Lo;0;L;;;;;N;;;;; 168D5;BAMUM LETTER PHASE-C KUOP NKAARAE;Lo;0;L;;;;;N;;;;; 168D6;BAMUM LETTER PHASE-C NSUN;Lo;0;L;;;;;N;;;;; 168D7;BAMUM LETTER PHASE-C NDAM;Lo;0;L;;;;;N;;;;; 168D8;BAMUM LETTER PHASE-C MA NSIEE;Lo;0;L;;;;;N;;;;; 168D9;BAMUM LETTER PHASE-C YAA;Lo;0;L;;;;;N;;;;; 168DA;BAMUM LETTER PHASE-C NDAP;Lo;0;L;;;;;N;;;;; 168DB;BAMUM LETTER PHASE-C SHUEQ;Lo;0;L;;;;;N;;;;; 168DC;BAMUM LETTER PHASE-C SETFON;Lo;0;L;;;;;N;;;;; 168DD;BAMUM LETTER PHASE-C MBI;Lo;0;L;;;;;N;;;;; 168DE;BAMUM LETTER PHASE-C MAEMBA;Lo;0;L;;;;;N;;;;; 168DF;BAMUM LETTER PHASE-C MBANYI;Lo;0;L;;;;;N;;;;; 168E0;BAMUM LETTER PHASE-C KEUSEUX;Lo;0;L;;;;;N;;;;; 168E1;BAMUM LETTER PHASE-C MBEUX;Lo;0;L;;;;;N;;;;; 168E2;BAMUM LETTER PHASE-C KEUM;Lo;0;L;;;;;N;;;;; 168E3;BAMUM LETTER PHASE-C MBAA PICKET;Lo;0;L;;;;;N;;;;; 168E4;BAMUM LETTER PHASE-C YUWOQ;Lo;0;L;;;;;N;;;;; 168E5;BAMUM LETTER PHASE-C NJEUX;Lo;0;L;;;;;N;;;;; 168E6;BAMUM LETTER PHASE-C MIEE;Lo;0;L;;;;;N;;;;; 168E7;BAMUM LETTER PHASE-C MUAE;Lo;0;L;;;;;N;;;;; 168E8;BAMUM LETTER PHASE-C SHIQ;Lo;0;L;;;;;N;;;;; 168E9;BAMUM LETTER PHASE-C KEN LAW;Lo;0;L;;;;;N;;;;; 168EA;BAMUM LETTER PHASE-C KEN FATIGUE;Lo;0;L;;;;;N;;;;; 168EB;BAMUM LETTER PHASE-C NGAQ;Lo;0;L;;;;;N;;;;; 168EC;BAMUM LETTER PHASE-C NAQ;Lo;0;L;;;;;N;;;;; 168ED;BAMUM LETTER PHASE-C LIQ;Lo;0;L;;;;;N;;;;; 168EE;BAMUM LETTER PHASE-C PIN;Lo;0;L;;;;;N;;;;; 168EF;BAMUM LETTER PHASE-C PEN;Lo;0;L;;;;;N;;;;; 168F0;BAMUM LETTER PHASE-C TET;Lo;0;L;;;;;N;;;;; 168F1;BAMUM LETTER PHASE-D MBUO;Lo;0;L;;;;;N;;;;; 168F2;BAMUM LETTER PHASE-D WAP;Lo;0;L;;;;;N;;;;; 168F3;BAMUM LETTER PHASE-D NJI;Lo;0;L;;;;;N;;;;; 168F4;BAMUM LETTER PHASE-D MFON;Lo;0;L;;;;;N;;;;; 168F5;BAMUM LETTER PHASE-D NJIEE;Lo;0;L;;;;;N;;;;; 168F6;BAMUM LETTER PHASE-D LIEE;Lo;0;L;;;;;N;;;;; 168F7;BAMUM LETTER PHASE-D NJEUT;Lo;0;L;;;;;N;;;;; 168F8;BAMUM LETTER PHASE-D NSHEE;Lo;0;L;;;;;N;;;;; 168F9;BAMUM LETTER PHASE-D NGGAAMAE;Lo;0;L;;;;;N;;;;; 168FA;BAMUM LETTER PHASE-D NYAM;Lo;0;L;;;;;N;;;;; 168FB;BAMUM LETTER PHASE-D WUAEN;Lo;0;L;;;;;N;;;;; 168FC;BAMUM LETTER PHASE-D NGKUN;Lo;0;L;;;;;N;;;;; 168FD;BAMUM LETTER PHASE-D SHEE;Lo;0;L;;;;;N;;;;; 168FE;BAMUM LETTER PHASE-D NGKAP;Lo;0;L;;;;;N;;;;; 168FF;BAMUM LETTER PHASE-D KEUAETMEUN;Lo;0;L;;;;;N;;;;; 16900;BAMUM LETTER PHASE-D TEUT;Lo;0;L;;;;;N;;;;; 16901;BAMUM LETTER PHASE-D SHEUAE;Lo;0;L;;;;;N;;;;; 16902;BAMUM LETTER PHASE-D NJAP;Lo;0;L;;;;;N;;;;; 16903;BAMUM LETTER PHASE-D SUE;Lo;0;L;;;;;N;;;;; 16904;BAMUM LETTER PHASE-D KET;Lo;0;L;;;;;N;;;;; 16905;BAMUM LETTER PHASE-D YAEMMAE;Lo;0;L;;;;;N;;;;; 16906;BAMUM LETTER PHASE-D KUOM;Lo;0;L;;;;;N;;;;; 16907;BAMUM LETTER PHASE-D SAP;Lo;0;L;;;;;N;;;;; 16908;BAMUM LETTER PHASE-D MFEUT;Lo;0;L;;;;;N;;;;; 16909;BAMUM LETTER PHASE-D NDEUX;Lo;0;L;;;;;N;;;;; 1690A;BAMUM LETTER PHASE-D MALEERI;Lo;0;L;;;;;N;;;;; 1690B;BAMUM LETTER PHASE-D MEUT;Lo;0;L;;;;;N;;;;; 1690C;BAMUM LETTER PHASE-D SEUAEQ;Lo;0;L;;;;;N;;;;; 1690D;BAMUM LETTER PHASE-D YEN;Lo;0;L;;;;;N;;;;; 1690E;BAMUM LETTER PHASE-D NJEUAEM;Lo;0;L;;;;;N;;;;; 1690F;BAMUM LETTER PHASE-D KEUOT MBUAE;Lo;0;L;;;;;N;;;;; 16910;BAMUM LETTER PHASE-D NGKEURI;Lo;0;L;;;;;N;;;;; 16911;BAMUM LETTER PHASE-D TU;Lo;0;L;;;;;N;;;;; 16912;BAMUM LETTER PHASE-D GHAA;Lo;0;L;;;;;N;;;;; 16913;BAMUM LETTER PHASE-D NGKYEE;Lo;0;L;;;;;N;;;;; 16914;BAMUM LETTER PHASE-D FEUFEUAET;Lo;0;L;;;;;N;;;;; 16915;BAMUM LETTER PHASE-D NDEE;Lo;0;L;;;;;N;;;;; 16916;BAMUM LETTER PHASE-D MGBOFUM;Lo;0;L;;;;;N;;;;; 16917;BAMUM LETTER PHASE-D LEUAEP;Lo;0;L;;;;;N;;;;; 16918;BAMUM LETTER PHASE-D NDON;Lo;0;L;;;;;N;;;;; 16919;BAMUM LETTER PHASE-D MONI;Lo;0;L;;;;;N;;;;; 1691A;BAMUM LETTER PHASE-D MGBEUN;Lo;0;L;;;;;N;;;;; 1691B;BAMUM LETTER PHASE-D PUUT;Lo;0;L;;;;;N;;;;; 1691C;BAMUM LETTER PHASE-D MGBIEE;Lo;0;L;;;;;N;;;;; 1691D;BAMUM LETTER PHASE-D MFO;Lo;0;L;;;;;N;;;;; 1691E;BAMUM LETTER PHASE-D LUM;Lo;0;L;;;;;N;;;;; 1691F;BAMUM LETTER PHASE-D NSIEEP;Lo;0;L;;;;;N;;;;; 16920;BAMUM LETTER PHASE-D MBAA;Lo;0;L;;;;;N;;;;; 16921;BAMUM LETTER PHASE-D KWAET;Lo;0;L;;;;;N;;;;; 16922;BAMUM LETTER PHASE-D NYET;Lo;0;L;;;;;N;;;;; 16923;BAMUM LETTER PHASE-D TEUAEN;Lo;0;L;;;;;N;;;;; 16924;BAMUM LETTER PHASE-D SOT;Lo;0;L;;;;;N;;;;; 16925;BAMUM LETTER PHASE-D YUWOQ;Lo;0;L;;;;;N;;;;; 16926;BAMUM LETTER PHASE-D KEUM;Lo;0;L;;;;;N;;;;; 16927;BAMUM LETTER PHASE-D RAEM;Lo;0;L;;;;;N;;;;; 16928;BAMUM LETTER PHASE-D TEEEE;Lo;0;L;;;;;N;;;;; 16929;BAMUM LETTER PHASE-D NGKEUAEQ;Lo;0;L;;;;;N;;;;; 1692A;BAMUM LETTER PHASE-D MFEUAE;Lo;0;L;;;;;N;;;;; 1692B;BAMUM LETTER PHASE-D NSIEET;Lo;0;L;;;;;N;;;;; 1692C;BAMUM LETTER PHASE-D KEUP;Lo;0;L;;;;;N;;;;; 1692D;BAMUM LETTER PHASE-D PIP;Lo;0;L;;;;;N;;;;; 1692E;BAMUM LETTER PHASE-D PEUTAE;Lo;0;L;;;;;N;;;;; 1692F;BAMUM LETTER PHASE-D NYUE;Lo;0;L;;;;;N;;;;; 16930;BAMUM LETTER PHASE-D LET;Lo;0;L;;;;;N;;;;; 16931;BAMUM LETTER PHASE-D NGGAAM;Lo;0;L;;;;;N;;;;; 16932;BAMUM LETTER PHASE-D MFIEE;Lo;0;L;;;;;N;;;;; 16933;BAMUM LETTER PHASE-D NGGWAEN;Lo;0;L;;;;;N;;;;; 16934;BAMUM LETTER PHASE-D YUOM;Lo;0;L;;;;;N;;;;; 16935;BAMUM LETTER PHASE-D PAP;Lo;0;L;;;;;N;;;;; 16936;BAMUM LETTER PHASE-D YUOP;Lo;0;L;;;;;N;;;;; 16937;BAMUM LETTER PHASE-D NDAM;Lo;0;L;;;;;N;;;;; 16938;BAMUM LETTER PHASE-D NTEUM;Lo;0;L;;;;;N;;;;; 16939;BAMUM LETTER PHASE-D SUAE;Lo;0;L;;;;;N;;;;; 1693A;BAMUM LETTER PHASE-D KUN;Lo;0;L;;;;;N;;;;; 1693B;BAMUM LETTER PHASE-D NGGEUX;Lo;0;L;;;;;N;;;;; 1693C;BAMUM LETTER PHASE-D NGKIEE;Lo;0;L;;;;;N;;;;; 1693D;BAMUM LETTER PHASE-D TUOT;Lo;0;L;;;;;N;;;;; 1693E;BAMUM LETTER PHASE-D MEUN;Lo;0;L;;;;;N;;;;; 1693F;BAMUM LETTER PHASE-D KUQ;Lo;0;L;;;;;N;;;;; 16940;BAMUM LETTER PHASE-D NSUM;Lo;0;L;;;;;N;;;;; 16941;BAMUM LETTER PHASE-D TEUN;Lo;0;L;;;;;N;;;;; 16942;BAMUM LETTER PHASE-D MAENJET;Lo;0;L;;;;;N;;;;; 16943;BAMUM LETTER PHASE-D NGGAP;Lo;0;L;;;;;N;;;;; 16944;BAMUM LETTER PHASE-D LEUM;Lo;0;L;;;;;N;;;;; 16945;BAMUM LETTER PHASE-D NGGUOM;Lo;0;L;;;;;N;;;;; 16946;BAMUM LETTER PHASE-D NSHUT;Lo;0;L;;;;;N;;;;; 16947;BAMUM LETTER PHASE-D NJUEQ;Lo;0;L;;;;;N;;;;; 16948;BAMUM LETTER PHASE-D GHEUAE;Lo;0;L;;;;;N;;;;; 16949;BAMUM LETTER PHASE-D KU;Lo;0;L;;;;;N;;;;; 1694A;BAMUM LETTER PHASE-D REN OLD;Lo;0;L;;;;;N;;;;; 1694B;BAMUM LETTER PHASE-D TAE;Lo;0;L;;;;;N;;;;; 1694C;BAMUM LETTER PHASE-D TOQ;Lo;0;L;;;;;N;;;;; 1694D;BAMUM LETTER PHASE-D NYI;Lo;0;L;;;;;N;;;;; 1694E;BAMUM LETTER PHASE-D RII;Lo;0;L;;;;;N;;;;; 1694F;BAMUM LETTER PHASE-D LEEEE;Lo;0;L;;;;;N;;;;; 16950;BAMUM LETTER PHASE-D MEEEE;Lo;0;L;;;;;N;;;;; 16951;BAMUM LETTER PHASE-D M;Lo;0;L;;;;;N;;;;; 16952;BAMUM LETTER PHASE-D SUU;Lo;0;L;;;;;N;;;;; 16953;BAMUM LETTER PHASE-D MU;Lo;0;L;;;;;N;;;;; 16954;BAMUM LETTER PHASE-D SHII;Lo;0;L;;;;;N;;;;; 16955;BAMUM LETTER PHASE-D SHEUX;Lo;0;L;;;;;N;;;;; 16956;BAMUM LETTER PHASE-D KYEE;Lo;0;L;;;;;N;;;;; 16957;BAMUM LETTER PHASE-D NU;Lo;0;L;;;;;N;;;;; 16958;BAMUM LETTER PHASE-D SHU;Lo;0;L;;;;;N;;;;; 16959;BAMUM LETTER PHASE-D NTEE;Lo;0;L;;;;;N;;;;; 1695A;BAMUM LETTER PHASE-D PEE;Lo;0;L;;;;;N;;;;; 1695B;BAMUM LETTER PHASE-D NI;Lo;0;L;;;;;N;;;;; 1695C;BAMUM LETTER PHASE-D SHOQ;Lo;0;L;;;;;N;;;;; 1695D;BAMUM LETTER PHASE-D PUQ;Lo;0;L;;;;;N;;;;; 1695E;BAMUM LETTER PHASE-D MVOP;Lo;0;L;;;;;N;;;;; 1695F;BAMUM LETTER PHASE-D LOQ;Lo;0;L;;;;;N;;;;; 16960;BAMUM LETTER PHASE-D REN MUCH;Lo;0;L;;;;;N;;;;; 16961;BAMUM LETTER PHASE-D TI;Lo;0;L;;;;;N;;;;; 16962;BAMUM LETTER PHASE-D NTUU;Lo;0;L;;;;;N;;;;; 16963;BAMUM LETTER PHASE-D MBAA SEVEN;Lo;0;L;;;;;N;;;;; 16964;BAMUM LETTER PHASE-D SAQ;Lo;0;L;;;;;N;;;;; 16965;BAMUM LETTER PHASE-D FAA;Lo;0;L;;;;;N;;;;; 16966;BAMUM LETTER PHASE-E NDAP;Lo;0;L;;;;;N;;;;; 16967;BAMUM LETTER PHASE-E TOON;Lo;0;L;;;;;N;;;;; 16968;BAMUM LETTER PHASE-E MBEUM;Lo;0;L;;;;;N;;;;; 16969;BAMUM LETTER PHASE-E LAP;Lo;0;L;;;;;N;;;;; 1696A;BAMUM LETTER PHASE-E VOM;Lo;0;L;;;;;N;;;;; 1696B;BAMUM LETTER PHASE-E LOON;Lo;0;L;;;;;N;;;;; 1696C;BAMUM LETTER PHASE-E PAA;Lo;0;L;;;;;N;;;;; 1696D;BAMUM LETTER PHASE-E SOM;Lo;0;L;;;;;N;;;;; 1696E;BAMUM LETTER PHASE-E RAQ;Lo;0;L;;;;;N;;;;; 1696F;BAMUM LETTER PHASE-E NSHUOP;Lo;0;L;;;;;N;;;;; 16970;BAMUM LETTER PHASE-E NDUN;Lo;0;L;;;;;N;;;;; 16971;BAMUM LETTER PHASE-E PUAE;Lo;0;L;;;;;N;;;;; 16972;BAMUM LETTER PHASE-E TAM;Lo;0;L;;;;;N;;;;; 16973;BAMUM LETTER PHASE-E NGKA;Lo;0;L;;;;;N;;;;; 16974;BAMUM LETTER PHASE-E KPEUX;Lo;0;L;;;;;N;;;;; 16975;BAMUM LETTER PHASE-E WUO;Lo;0;L;;;;;N;;;;; 16976;BAMUM LETTER PHASE-E SEE;Lo;0;L;;;;;N;;;;; 16977;BAMUM LETTER PHASE-E NGGEUAET;Lo;0;L;;;;;N;;;;; 16978;BAMUM LETTER PHASE-E PAAM;Lo;0;L;;;;;N;;;;; 16979;BAMUM LETTER PHASE-E TOO;Lo;0;L;;;;;N;;;;; 1697A;BAMUM LETTER PHASE-E KUOP;Lo;0;L;;;;;N;;;;; 1697B;BAMUM LETTER PHASE-E LOM;Lo;0;L;;;;;N;;;;; 1697C;BAMUM LETTER PHASE-E NSHIEE;Lo;0;L;;;;;N;;;;; 1697D;BAMUM LETTER PHASE-E NGOP;Lo;0;L;;;;;N;;;;; 1697E;BAMUM LETTER PHASE-E MAEM;Lo;0;L;;;;;N;;;;; 1697F;BAMUM LETTER PHASE-E NGKEUX;Lo;0;L;;;;;N;;;;; 16980;BAMUM LETTER PHASE-E NGOQ;Lo;0;L;;;;;N;;;;; 16981;BAMUM LETTER PHASE-E NSHUE;Lo;0;L;;;;;N;;;;; 16982;BAMUM LETTER PHASE-E RIMGBA;Lo;0;L;;;;;N;;;;; 16983;BAMUM LETTER PHASE-E NJEUX;Lo;0;L;;;;;N;;;;; 16984;BAMUM LETTER PHASE-E PEEM;Lo;0;L;;;;;N;;;;; 16985;BAMUM LETTER PHASE-E SAA;Lo;0;L;;;;;N;;;;; 16986;BAMUM LETTER PHASE-E NGGURAE;Lo;0;L;;;;;N;;;;; 16987;BAMUM LETTER PHASE-E MGBA;Lo;0;L;;;;;N;;;;; 16988;BAMUM LETTER PHASE-E GHEUX;Lo;0;L;;;;;N;;;;; 16989;BAMUM LETTER PHASE-E NGKEUAEM;Lo;0;L;;;;;N;;;;; 1698A;BAMUM LETTER PHASE-E NJAEMLI;Lo;0;L;;;;;N;;;;; 1698B;BAMUM LETTER PHASE-E MAP;Lo;0;L;;;;;N;;;;; 1698C;BAMUM LETTER PHASE-E LOOT;Lo;0;L;;;;;N;;;;; 1698D;BAMUM LETTER PHASE-E NGGEEEE;Lo;0;L;;;;;N;;;;; 1698E;BAMUM LETTER PHASE-E NDIQ;Lo;0;L;;;;;N;;;;; 1698F;BAMUM LETTER PHASE-E TAEN NTEUM;Lo;0;L;;;;;N;;;;; 16990;BAMUM LETTER PHASE-E SET;Lo;0;L;;;;;N;;;;; 16991;BAMUM LETTER PHASE-E PUM;Lo;0;L;;;;;N;;;;; 16992;BAMUM LETTER PHASE-E NDAA SOFTNESS;Lo;0;L;;;;;N;;;;; 16993;BAMUM LETTER PHASE-E NGGUAESHAE NYAM;Lo;0;L;;;;;N;;;;; 16994;BAMUM LETTER PHASE-E YIEE;Lo;0;L;;;;;N;;;;; 16995;BAMUM LETTER PHASE-E GHEUN;Lo;0;L;;;;;N;;;;; 16996;BAMUM LETTER PHASE-E TUAE;Lo;0;L;;;;;N;;;;; 16997;BAMUM LETTER PHASE-E YEUAE;Lo;0;L;;;;;N;;;;; 16998;BAMUM LETTER PHASE-E PO;Lo;0;L;;;;;N;;;;; 16999;BAMUM LETTER PHASE-E TUMAE;Lo;0;L;;;;;N;;;;; 1699A;BAMUM LETTER PHASE-E KEUAE;Lo;0;L;;;;;N;;;;; 1699B;BAMUM LETTER PHASE-E SUAEN;Lo;0;L;;;;;N;;;;; 1699C;BAMUM LETTER PHASE-E TEUAEQ;Lo;0;L;;;;;N;;;;; 1699D;BAMUM LETTER PHASE-E VEUAE;Lo;0;L;;;;;N;;;;; 1699E;BAMUM LETTER PHASE-E WEUX;Lo;0;L;;;;;N;;;;; 1699F;BAMUM LETTER PHASE-E LAAM;Lo;0;L;;;;;N;;;;; 169A0;BAMUM LETTER PHASE-E PU;Lo;0;L;;;;;N;;;;; 169A1;BAMUM LETTER PHASE-E TAAQ;Lo;0;L;;;;;N;;;;; 169A2;BAMUM LETTER PHASE-E GHAAMAE;Lo;0;L;;;;;N;;;;; 169A3;BAMUM LETTER PHASE-E NGEUREUT;Lo;0;L;;;;;N;;;;; 169A4;BAMUM LETTER PHASE-E SHEUAEQ;Lo;0;L;;;;;N;;;;; 169A5;BAMUM LETTER PHASE-E MGBEN;Lo;0;L;;;;;N;;;;; 169A6;BAMUM LETTER PHASE-E MBEE;Lo;0;L;;;;;N;;;;; 169A7;BAMUM LETTER PHASE-E NZAQ;Lo;0;L;;;;;N;;;;; 169A8;BAMUM LETTER PHASE-E NKOM;Lo;0;L;;;;;N;;;;; 169A9;BAMUM LETTER PHASE-E GBET;Lo;0;L;;;;;N;;;;; 169AA;BAMUM LETTER PHASE-E TUM;Lo;0;L;;;;;N;;;;; 169AB;BAMUM LETTER PHASE-E KUET;Lo;0;L;;;;;N;;;;; 169AC;BAMUM LETTER PHASE-E YAP;Lo;0;L;;;;;N;;;;; 169AD;BAMUM LETTER PHASE-E NYI CLEAVER;Lo;0;L;;;;;N;;;;; 169AE;BAMUM LETTER PHASE-E YIT;Lo;0;L;;;;;N;;;;; 169AF;BAMUM LETTER PHASE-E MFEUQ;Lo;0;L;;;;;N;;;;; 169B0;BAMUM LETTER PHASE-E NDIAQ;Lo;0;L;;;;;N;;;;; 169B1;BAMUM LETTER PHASE-E PIEEQ;Lo;0;L;;;;;N;;;;; 169B2;BAMUM LETTER PHASE-E YUEQ;Lo;0;L;;;;;N;;;;; 169B3;BAMUM LETTER PHASE-E LEUAEM;Lo;0;L;;;;;N;;;;; 169B4;BAMUM LETTER PHASE-E FUE;Lo;0;L;;;;;N;;;;; 169B5;BAMUM LETTER PHASE-E GBEUX;Lo;0;L;;;;;N;;;;; 169B6;BAMUM LETTER PHASE-E NGKUP;Lo;0;L;;;;;N;;;;; 169B7;BAMUM LETTER PHASE-E KET;Lo;0;L;;;;;N;;;;; 169B8;BAMUM LETTER PHASE-E MAE;Lo;0;L;;;;;N;;;;; 169B9;BAMUM LETTER PHASE-E NGKAAMI;Lo;0;L;;;;;N;;;;; 169BA;BAMUM LETTER PHASE-E GHET;Lo;0;L;;;;;N;;;;; 169BB;BAMUM LETTER PHASE-E FA;Lo;0;L;;;;;N;;;;; 169BC;BAMUM LETTER PHASE-E NTUM;Lo;0;L;;;;;N;;;;; 169BD;BAMUM LETTER PHASE-E PEUT;Lo;0;L;;;;;N;;;;; 169BE;BAMUM LETTER PHASE-E YEUM;Lo;0;L;;;;;N;;;;; 169BF;BAMUM LETTER PHASE-E NGGEUAE;Lo;0;L;;;;;N;;;;; 169C0;BAMUM LETTER PHASE-E NYI BETWEEN;Lo;0;L;;;;;N;;;;; 169C1;BAMUM LETTER PHASE-E NZUQ;Lo;0;L;;;;;N;;;;; 169C2;BAMUM LETTER PHASE-E POON;Lo;0;L;;;;;N;;;;; 169C3;BAMUM LETTER PHASE-E MIEE;Lo;0;L;;;;;N;;;;; 169C4;BAMUM LETTER PHASE-E FUET;Lo;0;L;;;;;N;;;;; 169C5;BAMUM LETTER PHASE-E NAE;Lo;0;L;;;;;N;;;;; 169C6;BAMUM LETTER PHASE-E MUAE;Lo;0;L;;;;;N;;;;; 169C7;BAMUM LETTER PHASE-E GHEUAE;Lo;0;L;;;;;N;;;;; 169C8;BAMUM LETTER PHASE-E FU I;Lo;0;L;;;;;N;;;;; 169C9;BAMUM LETTER PHASE-E MVI;Lo;0;L;;;;;N;;;;; 169CA;BAMUM LETTER PHASE-E PUAQ;Lo;0;L;;;;;N;;;;; 169CB;BAMUM LETTER PHASE-E NGKUM;Lo;0;L;;;;;N;;;;; 169CC;BAMUM LETTER PHASE-E KUT;Lo;0;L;;;;;N;;;;; 169CD;BAMUM LETTER PHASE-E PIET;Lo;0;L;;;;;N;;;;; 169CE;BAMUM LETTER PHASE-E NTAP;Lo;0;L;;;;;N;;;;; 169CF;BAMUM LETTER PHASE-E YEUAET;Lo;0;L;;;;;N;;;;; 169D0;BAMUM LETTER PHASE-E NGGUP;Lo;0;L;;;;;N;;;;; 169D1;BAMUM LETTER PHASE-E PA PEOPLE;Lo;0;L;;;;;N;;;;; 169D2;BAMUM LETTER PHASE-E FU CALL;Lo;0;L;;;;;N;;;;; 169D3;BAMUM LETTER PHASE-E FOM;Lo;0;L;;;;;N;;;;; 169D4;BAMUM LETTER PHASE-E NJEE;Lo;0;L;;;;;N;;;;; 169D5;BAMUM LETTER PHASE-E A;Lo;0;L;;;;;N;;;;; 169D6;BAMUM LETTER PHASE-E TOQ;Lo;0;L;;;;;N;;;;; 169D7;BAMUM LETTER PHASE-E O;Lo;0;L;;;;;N;;;;; 169D8;BAMUM LETTER PHASE-E I;Lo;0;L;;;;;N;;;;; 169D9;BAMUM LETTER PHASE-E LAQ;Lo;0;L;;;;;N;;;;; 169DA;BAMUM LETTER PHASE-E PA PLURAL;Lo;0;L;;;;;N;;;;; 169DB;BAMUM LETTER PHASE-E TAA;Lo;0;L;;;;;N;;;;; 169DC;BAMUM LETTER PHASE-E TAQ;Lo;0;L;;;;;N;;;;; 169DD;BAMUM LETTER PHASE-E NDAA MY HOUSE;Lo;0;L;;;;;N;;;;; 169DE;BAMUM LETTER PHASE-E SHIQ;Lo;0;L;;;;;N;;;;; 169DF;BAMUM LETTER PHASE-E YEUX;Lo;0;L;;;;;N;;;;; 169E0;BAMUM LETTER PHASE-E NGUAE;Lo;0;L;;;;;N;;;;; 169E1;BAMUM LETTER PHASE-E YUAEN;Lo;0;L;;;;;N;;;;; 169E2;BAMUM LETTER PHASE-E YOQ SWIMMING;Lo;0;L;;;;;N;;;;; 169E3;BAMUM LETTER PHASE-E YOQ COVER;Lo;0;L;;;;;N;;;;; 169E4;BAMUM LETTER PHASE-E YUQ;Lo;0;L;;;;;N;;;;; 169E5;BAMUM LETTER PHASE-E YUN;Lo;0;L;;;;;N;;;;; 169E6;BAMUM LETTER PHASE-E KEUX;Lo;0;L;;;;;N;;;;; 169E7;BAMUM LETTER PHASE-E PEUX;Lo;0;L;;;;;N;;;;; 169E8;BAMUM LETTER PHASE-E NJEE EPOCH;Lo;0;L;;;;;N;;;;; 169E9;BAMUM LETTER PHASE-E PUE;Lo;0;L;;;;;N;;;;; 169EA;BAMUM LETTER PHASE-E WUE;Lo;0;L;;;;;N;;;;; 169EB;BAMUM LETTER PHASE-E FEE;Lo;0;L;;;;;N;;;;; 169EC;BAMUM LETTER PHASE-E VEE;Lo;0;L;;;;;N;;;;; 169ED;BAMUM LETTER PHASE-E LU;Lo;0;L;;;;;N;;;;; 169EE;BAMUM LETTER PHASE-E MI;Lo;0;L;;;;;N;;;;; 169EF;BAMUM LETTER PHASE-E REUX;Lo;0;L;;;;;N;;;;; 169F0;BAMUM LETTER PHASE-E RAE;Lo;0;L;;;;;N;;;;; 169F1;BAMUM LETTER PHASE-E NGUAET;Lo;0;L;;;;;N;;;;; 169F2;BAMUM LETTER PHASE-E NGA;Lo;0;L;;;;;N;;;;; 169F3;BAMUM LETTER PHASE-E SHO;Lo;0;L;;;;;N;;;;; 169F4;BAMUM LETTER PHASE-E SHOQ;Lo;0;L;;;;;N;;;;; 169F5;BAMUM LETTER PHASE-E FU REMEDY;Lo;0;L;;;;;N;;;;; 169F6;BAMUM LETTER PHASE-E NA;Lo;0;L;;;;;N;;;;; 169F7;BAMUM LETTER PHASE-E PI;Lo;0;L;;;;;N;;;;; 169F8;BAMUM LETTER PHASE-E LOQ;Lo;0;L;;;;;N;;;;; 169F9;BAMUM LETTER PHASE-E KO;Lo;0;L;;;;;N;;;;; 169FA;BAMUM LETTER PHASE-E MEN;Lo;0;L;;;;;N;;;;; 169FB;BAMUM LETTER PHASE-E MA;Lo;0;L;;;;;N;;;;; 169FC;BAMUM LETTER PHASE-E MAQ;Lo;0;L;;;;;N;;;;; 169FD;BAMUM LETTER PHASE-E TEU;Lo;0;L;;;;;N;;;;; 169FE;BAMUM LETTER PHASE-E KI;Lo;0;L;;;;;N;;;;; 169FF;BAMUM LETTER PHASE-E MON;Lo;0;L;;;;;N;;;;; 16A00;BAMUM LETTER PHASE-E TEN;Lo;0;L;;;;;N;;;;; 16A01;BAMUM LETTER PHASE-E FAQ;Lo;0;L;;;;;N;;;;; 16A02;BAMUM LETTER PHASE-E GHOM;Lo;0;L;;;;;N;;;;; 16A03;BAMUM LETTER PHASE-F KA;Lo;0;L;;;;;N;;;;; 16A04;BAMUM LETTER PHASE-F U;Lo;0;L;;;;;N;;;;; 16A05;BAMUM LETTER PHASE-F KU;Lo;0;L;;;;;N;;;;; 16A06;BAMUM LETTER PHASE-F EE;Lo;0;L;;;;;N;;;;; 16A07;BAMUM LETTER PHASE-F REE;Lo;0;L;;;;;N;;;;; 16A08;BAMUM LETTER PHASE-F TAE;Lo;0;L;;;;;N;;;;; 16A09;BAMUM LETTER PHASE-F NYI;Lo;0;L;;;;;N;;;;; 16A0A;BAMUM LETTER PHASE-F LA;Lo;0;L;;;;;N;;;;; 16A0B;BAMUM LETTER PHASE-F RII;Lo;0;L;;;;;N;;;;; 16A0C;BAMUM LETTER PHASE-F RIEE;Lo;0;L;;;;;N;;;;; 16A0D;BAMUM LETTER PHASE-F MEEEE;Lo;0;L;;;;;N;;;;; 16A0E;BAMUM LETTER PHASE-F TAA;Lo;0;L;;;;;N;;;;; 16A0F;BAMUM LETTER PHASE-F NDAA;Lo;0;L;;;;;N;;;;; 16A10;BAMUM LETTER PHASE-F NJAEM;Lo;0;L;;;;;N;;;;; 16A11;BAMUM LETTER PHASE-F M;Lo;0;L;;;;;N;;;;; 16A12;BAMUM LETTER PHASE-F SUU;Lo;0;L;;;;;N;;;;; 16A13;BAMUM LETTER PHASE-F SHII;Lo;0;L;;;;;N;;;;; 16A14;BAMUM LETTER PHASE-F SI;Lo;0;L;;;;;N;;;;; 16A15;BAMUM LETTER PHASE-F SEUX;Lo;0;L;;;;;N;;;;; 16A16;BAMUM LETTER PHASE-F KYEE;Lo;0;L;;;;;N;;;;; 16A17;BAMUM LETTER PHASE-F KET;Lo;0;L;;;;;N;;;;; 16A18;BAMUM LETTER PHASE-F NUAE;Lo;0;L;;;;;N;;;;; 16A19;BAMUM LETTER PHASE-F NU;Lo;0;L;;;;;N;;;;; 16A1A;BAMUM LETTER PHASE-F NJUAE;Lo;0;L;;;;;N;;;;; 16A1B;BAMUM LETTER PHASE-F YOQ;Lo;0;L;;;;;N;;;;; 16A1C;BAMUM LETTER PHASE-F SHU;Lo;0;L;;;;;N;;;;; 16A1D;BAMUM LETTER PHASE-F YA;Lo;0;L;;;;;N;;;;; 16A1E;BAMUM LETTER PHASE-F NSHA;Lo;0;L;;;;;N;;;;; 16A1F;BAMUM LETTER PHASE-F PEUX;Lo;0;L;;;;;N;;;;; 16A20;BAMUM LETTER PHASE-F NTEE;Lo;0;L;;;;;N;;;;; 16A21;BAMUM LETTER PHASE-F WUE;Lo;0;L;;;;;N;;;;; 16A22;BAMUM LETTER PHASE-F PEE;Lo;0;L;;;;;N;;;;; 16A23;BAMUM LETTER PHASE-F RU;Lo;0;L;;;;;N;;;;; 16A24;BAMUM LETTER PHASE-F NI;Lo;0;L;;;;;N;;;;; 16A25;BAMUM LETTER PHASE-F REUX;Lo;0;L;;;;;N;;;;; 16A26;BAMUM LETTER PHASE-F KEN;Lo;0;L;;;;;N;;;;; 16A27;BAMUM LETTER PHASE-F NGKWAEN;Lo;0;L;;;;;N;;;;; 16A28;BAMUM LETTER PHASE-F NGGA;Lo;0;L;;;;;N;;;;; 16A29;BAMUM LETTER PHASE-F SHO;Lo;0;L;;;;;N;;;;; 16A2A;BAMUM LETTER PHASE-F PUAE;Lo;0;L;;;;;N;;;;; 16A2B;BAMUM LETTER PHASE-F FOM;Lo;0;L;;;;;N;;;;; 16A2C;BAMUM LETTER PHASE-F WA;Lo;0;L;;;;;N;;;;; 16A2D;BAMUM LETTER PHASE-F LI;Lo;0;L;;;;;N;;;;; 16A2E;BAMUM LETTER PHASE-F LOQ;Lo;0;L;;;;;N;;;;; 16A2F;BAMUM LETTER PHASE-F KO;Lo;0;L;;;;;N;;;;; 16A30;BAMUM LETTER PHASE-F MBEN;Lo;0;L;;;;;N;;;;; 16A31;BAMUM LETTER PHASE-F REN;Lo;0;L;;;;;N;;;;; 16A32;BAMUM LETTER PHASE-F MA;Lo;0;L;;;;;N;;;;; 16A33;BAMUM LETTER PHASE-F MO;Lo;0;L;;;;;N;;;;; 16A34;BAMUM LETTER PHASE-F MBAA;Lo;0;L;;;;;N;;;;; 16A35;BAMUM LETTER PHASE-F TET;Lo;0;L;;;;;N;;;;; 16A36;BAMUM LETTER PHASE-F KPA;Lo;0;L;;;;;N;;;;; 16A37;BAMUM LETTER PHASE-F SAMBA;Lo;0;L;;;;;N;;;;; 16A38;BAMUM LETTER PHASE-F VUEQ;Lo;0;L;;;;;N;;;;; 16F00;MIAO LETTER PA;Lo;0;L;;;;;N;;;;; 16F01;MIAO LETTER BA;Lo;0;L;;;;;N;;;;; 16F02;MIAO LETTER YI PA;Lo;0;L;;;;;N;;;;; 16F03;MIAO LETTER PLA;Lo;0;L;;;;;N;;;;; 16F04;MIAO LETTER MA;Lo;0;L;;;;;N;;;;; 16F05;MIAO LETTER MHA;Lo;0;L;;;;;N;;;;; 16F06;MIAO LETTER ARCHAIC MA;Lo;0;L;;;;;N;;;;; 16F07;MIAO LETTER FA;Lo;0;L;;;;;N;;;;; 16F08;MIAO LETTER VA;Lo;0;L;;;;;N;;;;; 16F09;MIAO LETTER VFA;Lo;0;L;;;;;N;;;;; 16F0A;MIAO LETTER TA;Lo;0;L;;;;;N;;;;; 16F0B;MIAO LETTER DA;Lo;0;L;;;;;N;;;;; 16F0C;MIAO LETTER YI TTA;Lo;0;L;;;;;N;;;;; 16F0D;MIAO LETTER YI TA;Lo;0;L;;;;;N;;;;; 16F0E;MIAO LETTER TTA;Lo;0;L;;;;;N;;;;; 16F0F;MIAO LETTER DDA;Lo;0;L;;;;;N;;;;; 16F10;MIAO LETTER NA;Lo;0;L;;;;;N;;;;; 16F11;MIAO LETTER NHA;Lo;0;L;;;;;N;;;;; 16F12;MIAO LETTER YI NNA;Lo;0;L;;;;;N;;;;; 16F13;MIAO LETTER ARCHAIC NA;Lo;0;L;;;;;N;;;;; 16F14;MIAO LETTER NNA;Lo;0;L;;;;;N;;;;; 16F15;MIAO LETTER NNHA;Lo;0;L;;;;;N;;;;; 16F16;MIAO LETTER LA;Lo;0;L;;;;;N;;;;; 16F17;MIAO LETTER LYA;Lo;0;L;;;;;N;;;;; 16F18;MIAO LETTER LHA;Lo;0;L;;;;;N;;;;; 16F19;MIAO LETTER LHYA;Lo;0;L;;;;;N;;;;; 16F1A;MIAO LETTER TLHA;Lo;0;L;;;;;N;;;;; 16F1B;MIAO LETTER DLHA;Lo;0;L;;;;;N;;;;; 16F1C;MIAO LETTER TLHYA;Lo;0;L;;;;;N;;;;; 16F1D;MIAO LETTER DLHYA;Lo;0;L;;;;;N;;;;; 16F1E;MIAO LETTER KA;Lo;0;L;;;;;N;;;;; 16F1F;MIAO LETTER GA;Lo;0;L;;;;;N;;;;; 16F20;MIAO LETTER YI KA;Lo;0;L;;;;;N;;;;; 16F21;MIAO LETTER QA;Lo;0;L;;;;;N;;;;; 16F22;MIAO LETTER QGA;Lo;0;L;;;;;N;;;;; 16F23;MIAO LETTER NGA;Lo;0;L;;;;;N;;;;; 16F24;MIAO LETTER NGHA;Lo;0;L;;;;;N;;;;; 16F25;MIAO LETTER ARCHAIC NGA;Lo;0;L;;;;;N;;;;; 16F26;MIAO LETTER HA;Lo;0;L;;;;;N;;;;; 16F27;MIAO LETTER XA;Lo;0;L;;;;;N;;;;; 16F28;MIAO LETTER GHA;Lo;0;L;;;;;N;;;;; 16F29;MIAO LETTER GHHA;Lo;0;L;;;;;N;;;;; 16F2A;MIAO LETTER TSSA;Lo;0;L;;;;;N;;;;; 16F2B;MIAO LETTER DZZA;Lo;0;L;;;;;N;;;;; 16F2C;MIAO LETTER NYA;Lo;0;L;;;;;N;;;;; 16F2D;MIAO LETTER NYHA;Lo;0;L;;;;;N;;;;; 16F2E;MIAO LETTER TSHA;Lo;0;L;;;;;N;;;;; 16F2F;MIAO LETTER DZHA;Lo;0;L;;;;;N;;;;; 16F30;MIAO LETTER YI TSHA;Lo;0;L;;;;;N;;;;; 16F31;MIAO LETTER YI DZHA;Lo;0;L;;;;;N;;;;; 16F32;MIAO LETTER REFORMED TSHA;Lo;0;L;;;;;N;;;;; 16F33;MIAO LETTER SHA;Lo;0;L;;;;;N;;;;; 16F34;MIAO LETTER SSA;Lo;0;L;;;;;N;;;;; 16F35;MIAO LETTER ZHA;Lo;0;L;;;;;N;;;;; 16F36;MIAO LETTER ZSHA;Lo;0;L;;;;;N;;;;; 16F37;MIAO LETTER TSA;Lo;0;L;;;;;N;;;;; 16F38;MIAO LETTER DZA;Lo;0;L;;;;;N;;;;; 16F39;MIAO LETTER YI TSA;Lo;0;L;;;;;N;;;;; 16F3A;MIAO LETTER SA;Lo;0;L;;;;;N;;;;; 16F3B;MIAO LETTER ZA;Lo;0;L;;;;;N;;;;; 16F3C;MIAO LETTER ZSA;Lo;0;L;;;;;N;;;;; 16F3D;MIAO LETTER ZZA;Lo;0;L;;;;;N;;;;; 16F3E;MIAO LETTER ZZSA;Lo;0;L;;;;;N;;;;; 16F3F;MIAO LETTER ARCHAIC ZZA;Lo;0;L;;;;;N;;;;; 16F40;MIAO LETTER ZZYA;Lo;0;L;;;;;N;;;;; 16F41;MIAO LETTER ZZSYA;Lo;0;L;;;;;N;;;;; 16F42;MIAO LETTER WA;Lo;0;L;;;;;N;;;;; 16F43;MIAO LETTER AH;Lo;0;L;;;;;N;;;;; 16F44;MIAO LETTER HHA;Lo;0;L;;;;;N;;;;; 16F50;MIAO LETTER NASALIZATION;Lo;0;L;;;;;N;;;;; 16F51;MIAO SIGN ASPIRATION;Mc;0;L;;;;;N;;;;; 16F52;MIAO SIGN REFORMED VOICING;Mc;0;L;;;;;N;;;;; 16F53;MIAO SIGN REFORMED ASPIRATION;Mc;0;L;;;;;N;;;;; 16F54;MIAO VOWEL SIGN A;Mc;0;L;;;;;N;;;;; 16F55;MIAO VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; 16F56;MIAO VOWEL SIGN AHH;Mc;0;L;;;;;N;;;;; 16F57;MIAO VOWEL SIGN AN;Mc;0;L;;;;;N;;;;; 16F58;MIAO VOWEL SIGN ANG;Mc;0;L;;;;;N;;;;; 16F59;MIAO VOWEL SIGN O;Mc;0;L;;;;;N;;;;; 16F5A;MIAO VOWEL SIGN OO;Mc;0;L;;;;;N;;;;; 16F5B;MIAO VOWEL SIGN WO;Mc;0;L;;;;;N;;;;; 16F5C;MIAO VOWEL SIGN W;Mc;0;L;;;;;N;;;;; 16F5D;MIAO VOWEL SIGN E;Mc;0;L;;;;;N;;;;; 16F5E;MIAO VOWEL SIGN EN;Mc;0;L;;;;;N;;;;; 16F5F;MIAO VOWEL SIGN ENG;Mc;0;L;;;;;N;;;;; 16F60;MIAO VOWEL SIGN OEY;Mc;0;L;;;;;N;;;;; 16F61;MIAO VOWEL SIGN I;Mc;0;L;;;;;N;;;;; 16F62;MIAO VOWEL SIGN IA;Mc;0;L;;;;;N;;;;; 16F63;MIAO VOWEL SIGN IAN;Mc;0;L;;;;;N;;;;; 16F64;MIAO VOWEL SIGN IANG;Mc;0;L;;;;;N;;;;; 16F65;MIAO VOWEL SIGN IO;Mc;0;L;;;;;N;;;;; 16F66;MIAO VOWEL SIGN IE;Mc;0;L;;;;;N;;;;; 16F67;MIAO VOWEL SIGN II;Mc;0;L;;;;;N;;;;; 16F68;MIAO VOWEL SIGN IU;Mc;0;L;;;;;N;;;;; 16F69;MIAO VOWEL SIGN ING;Mc;0;L;;;;;N;;;;; 16F6A;MIAO VOWEL SIGN U;Mc;0;L;;;;;N;;;;; 16F6B;MIAO VOWEL SIGN UA;Mc;0;L;;;;;N;;;;; 16F6C;MIAO VOWEL SIGN UAN;Mc;0;L;;;;;N;;;;; 16F6D;MIAO VOWEL SIGN UANG;Mc;0;L;;;;;N;;;;; 16F6E;MIAO VOWEL SIGN UU;Mc;0;L;;;;;N;;;;; 16F6F;MIAO VOWEL SIGN UEI;Mc;0;L;;;;;N;;;;; 16F70;MIAO VOWEL SIGN UNG;Mc;0;L;;;;;N;;;;; 16F71;MIAO VOWEL SIGN Y;Mc;0;L;;;;;N;;;;; 16F72;MIAO VOWEL SIGN YI;Mc;0;L;;;;;N;;;;; 16F73;MIAO VOWEL SIGN AE;Mc;0;L;;;;;N;;;;; 16F74;MIAO VOWEL SIGN AEE;Mc;0;L;;;;;N;;;;; 16F75;MIAO VOWEL SIGN ERR;Mc;0;L;;;;;N;;;;; 16F76;MIAO VOWEL SIGN ROUNDED ERR;Mc;0;L;;;;;N;;;;; 16F77;MIAO VOWEL SIGN ER;Mc;0;L;;;;;N;;;;; 16F78;MIAO VOWEL SIGN ROUNDED ER;Mc;0;L;;;;;N;;;;; 16F79;MIAO VOWEL SIGN AI;Mc;0;L;;;;;N;;;;; 16F7A;MIAO VOWEL SIGN EI;Mc;0;L;;;;;N;;;;; 16F7B;MIAO VOWEL SIGN AU;Mc;0;L;;;;;N;;;;; 16F7C;MIAO VOWEL SIGN OU;Mc;0;L;;;;;N;;;;; 16F7D;MIAO VOWEL SIGN N;Mc;0;L;;;;;N;;;;; 16F7E;MIAO VOWEL SIGN NG;Mc;0;L;;;;;N;;;;; 16F8F;MIAO TONE RIGHT;Mn;0;NSM;;;;;N;;;;; 16F90;MIAO TONE TOP RIGHT;Mn;0;NSM;;;;;N;;;;; 16F91;MIAO TONE ABOVE;Mn;0;NSM;;;;;N;;;;; 16F92;MIAO TONE BELOW;Mn;0;NSM;;;;;N;;;;; 16F93;MIAO LETTER TONE-2;Lm;0;L;;;;;N;;;;; 16F94;MIAO LETTER TONE-3;Lm;0;L;;;;;N;;;;; 16F95;MIAO LETTER TONE-4;Lm;0;L;;;;;N;;;;; 16F96;MIAO LETTER TONE-5;Lm;0;L;;;;;N;;;;; 16F97;MIAO LETTER TONE-6;Lm;0;L;;;;;N;;;;; 16F98;MIAO LETTER TONE-7;Lm;0;L;;;;;N;;;;; 16F99;MIAO LETTER TONE-8;Lm;0;L;;;;;N;;;;; 16F9A;MIAO LETTER REFORMED TONE-1;Lm;0;L;;;;;N;;;;; 16F9B;MIAO LETTER REFORMED TONE-2;Lm;0;L;;;;;N;;;;; 16F9C;MIAO LETTER REFORMED TONE-4;Lm;0;L;;;;;N;;;;; 16F9D;MIAO LETTER REFORMED TONE-5;Lm;0;L;;;;;N;;;;; 16F9E;MIAO LETTER REFORMED TONE-6;Lm;0;L;;;;;N;;;;; 16F9F;MIAO LETTER REFORMED TONE-8;Lm;0;L;;;;;N;;;;; 1B000;KATAKANA LETTER ARCHAIC E;Lo;0;L;;;;;N;;;;; 1B001;HIRAGANA LETTER ARCHAIC YE;Lo;0;L;;;;;N;;;;; 1D000;BYZANTINE MUSICAL SYMBOL PSILI;So;0;L;;;;;N;;;;; 1D001;BYZANTINE MUSICAL SYMBOL DASEIA;So;0;L;;;;;N;;;;; 1D002;BYZANTINE MUSICAL SYMBOL PERISPOMENI;So;0;L;;;;;N;;;;; 1D003;BYZANTINE MUSICAL SYMBOL OXEIA EKFONITIKON;So;0;L;;;;;N;;;;; 1D004;BYZANTINE MUSICAL SYMBOL OXEIA DIPLI;So;0;L;;;;;N;;;;; 1D005;BYZANTINE MUSICAL SYMBOL VAREIA EKFONITIKON;So;0;L;;;;;N;;;;; 1D006;BYZANTINE MUSICAL SYMBOL VAREIA DIPLI;So;0;L;;;;;N;;;;; 1D007;BYZANTINE MUSICAL SYMBOL KATHISTI;So;0;L;;;;;N;;;;; 1D008;BYZANTINE MUSICAL SYMBOL SYRMATIKI;So;0;L;;;;;N;;;;; 1D009;BYZANTINE MUSICAL SYMBOL PARAKLITIKI;So;0;L;;;;;N;;;;; 1D00A;BYZANTINE MUSICAL SYMBOL YPOKRISIS;So;0;L;;;;;N;;;;; 1D00B;BYZANTINE MUSICAL SYMBOL YPOKRISIS DIPLI;So;0;L;;;;;N;;;;; 1D00C;BYZANTINE MUSICAL SYMBOL KREMASTI;So;0;L;;;;;N;;;;; 1D00D;BYZANTINE MUSICAL SYMBOL APESO EKFONITIKON;So;0;L;;;;;N;;;;; 1D00E;BYZANTINE MUSICAL SYMBOL EXO EKFONITIKON;So;0;L;;;;;N;;;;; 1D00F;BYZANTINE MUSICAL SYMBOL TELEIA;So;0;L;;;;;N;;;;; 1D010;BYZANTINE MUSICAL SYMBOL KENTIMATA;So;0;L;;;;;N;;;;; 1D011;BYZANTINE MUSICAL SYMBOL APOSTROFOS;So;0;L;;;;;N;;;;; 1D012;BYZANTINE MUSICAL SYMBOL APOSTROFOS DIPLI;So;0;L;;;;;N;;;;; 1D013;BYZANTINE MUSICAL SYMBOL SYNEVMA;So;0;L;;;;;N;;;;; 1D014;BYZANTINE MUSICAL SYMBOL THITA;So;0;L;;;;;N;;;;; 1D015;BYZANTINE MUSICAL SYMBOL OLIGON ARCHAION;So;0;L;;;;;N;;;;; 1D016;BYZANTINE MUSICAL SYMBOL GORGON ARCHAION;So;0;L;;;;;N;;;;; 1D017;BYZANTINE MUSICAL SYMBOL PSILON;So;0;L;;;;;N;;;;; 1D018;BYZANTINE MUSICAL SYMBOL CHAMILON;So;0;L;;;;;N;;;;; 1D019;BYZANTINE MUSICAL SYMBOL VATHY;So;0;L;;;;;N;;;;; 1D01A;BYZANTINE MUSICAL SYMBOL ISON ARCHAION;So;0;L;;;;;N;;;;; 1D01B;BYZANTINE MUSICAL SYMBOL KENTIMA ARCHAION;So;0;L;;;;;N;;;;; 1D01C;BYZANTINE MUSICAL SYMBOL KENTIMATA ARCHAION;So;0;L;;;;;N;;;;; 1D01D;BYZANTINE MUSICAL SYMBOL SAXIMATA;So;0;L;;;;;N;;;;; 1D01E;BYZANTINE MUSICAL SYMBOL PARICHON;So;0;L;;;;;N;;;;; 1D01F;BYZANTINE MUSICAL SYMBOL STAVROS APODEXIA;So;0;L;;;;;N;;;;; 1D020;BYZANTINE MUSICAL SYMBOL OXEIAI ARCHAION;So;0;L;;;;;N;;;;; 1D021;BYZANTINE MUSICAL SYMBOL VAREIAI ARCHAION;So;0;L;;;;;N;;;;; 1D022;BYZANTINE MUSICAL SYMBOL APODERMA ARCHAION;So;0;L;;;;;N;;;;; 1D023;BYZANTINE MUSICAL SYMBOL APOTHEMA;So;0;L;;;;;N;;;;; 1D024;BYZANTINE MUSICAL SYMBOL KLASMA;So;0;L;;;;;N;;;;; 1D025;BYZANTINE MUSICAL SYMBOL REVMA;So;0;L;;;;;N;;;;; 1D026;BYZANTINE MUSICAL SYMBOL PIASMA ARCHAION;So;0;L;;;;;N;;;;; 1D027;BYZANTINE MUSICAL SYMBOL TINAGMA;So;0;L;;;;;N;;;;; 1D028;BYZANTINE MUSICAL SYMBOL ANATRICHISMA;So;0;L;;;;;N;;;;; 1D029;BYZANTINE MUSICAL SYMBOL SEISMA;So;0;L;;;;;N;;;;; 1D02A;BYZANTINE MUSICAL SYMBOL SYNAGMA ARCHAION;So;0;L;;;;;N;;;;; 1D02B;BYZANTINE MUSICAL SYMBOL SYNAGMA META STAVROU;So;0;L;;;;;N;;;;; 1D02C;BYZANTINE MUSICAL SYMBOL OYRANISMA ARCHAION;So;0;L;;;;;N;;;;; 1D02D;BYZANTINE MUSICAL SYMBOL THEMA;So;0;L;;;;;N;;;;; 1D02E;BYZANTINE MUSICAL SYMBOL LEMOI;So;0;L;;;;;N;;;;; 1D02F;BYZANTINE MUSICAL SYMBOL DYO;So;0;L;;;;;N;;;;; 1D030;BYZANTINE MUSICAL SYMBOL TRIA;So;0;L;;;;;N;;;;; 1D031;BYZANTINE MUSICAL SYMBOL TESSERA;So;0;L;;;;;N;;;;; 1D032;BYZANTINE MUSICAL SYMBOL KRATIMATA;So;0;L;;;;;N;;;;; 1D033;BYZANTINE MUSICAL SYMBOL APESO EXO NEO;So;0;L;;;;;N;;;;; 1D034;BYZANTINE MUSICAL SYMBOL FTHORA ARCHAION;So;0;L;;;;;N;;;;; 1D035;BYZANTINE MUSICAL SYMBOL IMIFTHORA;So;0;L;;;;;N;;;;; 1D036;BYZANTINE MUSICAL SYMBOL TROMIKON ARCHAION;So;0;L;;;;;N;;;;; 1D037;BYZANTINE MUSICAL SYMBOL KATAVA TROMIKON;So;0;L;;;;;N;;;;; 1D038;BYZANTINE MUSICAL SYMBOL PELASTON;So;0;L;;;;;N;;;;; 1D039;BYZANTINE MUSICAL SYMBOL PSIFISTON;So;0;L;;;;;N;;;;; 1D03A;BYZANTINE MUSICAL SYMBOL KONTEVMA;So;0;L;;;;;N;;;;; 1D03B;BYZANTINE MUSICAL SYMBOL CHOREVMA ARCHAION;So;0;L;;;;;N;;;;; 1D03C;BYZANTINE MUSICAL SYMBOL RAPISMA;So;0;L;;;;;N;;;;; 1D03D;BYZANTINE MUSICAL SYMBOL PARAKALESMA ARCHAION;So;0;L;;;;;N;;;;; 1D03E;BYZANTINE MUSICAL SYMBOL PARAKLITIKI ARCHAION;So;0;L;;;;;N;;;;; 1D03F;BYZANTINE MUSICAL SYMBOL ICHADIN;So;0;L;;;;;N;;;;; 1D040;BYZANTINE MUSICAL SYMBOL NANA;So;0;L;;;;;N;;;;; 1D041;BYZANTINE MUSICAL SYMBOL PETASMA;So;0;L;;;;;N;;;;; 1D042;BYZANTINE MUSICAL SYMBOL KONTEVMA ALLO;So;0;L;;;;;N;;;;; 1D043;BYZANTINE MUSICAL SYMBOL TROMIKON ALLO;So;0;L;;;;;N;;;;; 1D044;BYZANTINE MUSICAL SYMBOL STRAGGISMATA;So;0;L;;;;;N;;;;; 1D045;BYZANTINE MUSICAL SYMBOL GRONTHISMATA;So;0;L;;;;;N;;;;; 1D046;BYZANTINE MUSICAL SYMBOL ISON NEO;So;0;L;;;;;N;;;;; 1D047;BYZANTINE MUSICAL SYMBOL OLIGON NEO;So;0;L;;;;;N;;;;; 1D048;BYZANTINE MUSICAL SYMBOL OXEIA NEO;So;0;L;;;;;N;;;;; 1D049;BYZANTINE MUSICAL SYMBOL PETASTI;So;0;L;;;;;N;;;;; 1D04A;BYZANTINE MUSICAL SYMBOL KOUFISMA;So;0;L;;;;;N;;;;; 1D04B;BYZANTINE MUSICAL SYMBOL PETASTOKOUFISMA;So;0;L;;;;;N;;;;; 1D04C;BYZANTINE MUSICAL SYMBOL KRATIMOKOUFISMA;So;0;L;;;;;N;;;;; 1D04D;BYZANTINE MUSICAL SYMBOL PELASTON NEO;So;0;L;;;;;N;;;;; 1D04E;BYZANTINE MUSICAL SYMBOL KENTIMATA NEO ANO;So;0;L;;;;;N;;;;; 1D04F;BYZANTINE MUSICAL SYMBOL KENTIMA NEO ANO;So;0;L;;;;;N;;;;; 1D050;BYZANTINE MUSICAL SYMBOL YPSILI;So;0;L;;;;;N;;;;; 1D051;BYZANTINE MUSICAL SYMBOL APOSTROFOS NEO;So;0;L;;;;;N;;;;; 1D052;BYZANTINE MUSICAL SYMBOL APOSTROFOI SYNDESMOS NEO;So;0;L;;;;;N;;;;; 1D053;BYZANTINE MUSICAL SYMBOL YPORROI;So;0;L;;;;;N;;;;; 1D054;BYZANTINE MUSICAL SYMBOL KRATIMOYPORROON;So;0;L;;;;;N;;;;; 1D055;BYZANTINE MUSICAL SYMBOL ELAFRON;So;0;L;;;;;N;;;;; 1D056;BYZANTINE MUSICAL SYMBOL CHAMILI;So;0;L;;;;;N;;;;; 1D057;BYZANTINE MUSICAL SYMBOL MIKRON ISON;So;0;L;;;;;N;;;;; 1D058;BYZANTINE MUSICAL SYMBOL VAREIA NEO;So;0;L;;;;;N;;;;; 1D059;BYZANTINE MUSICAL SYMBOL PIASMA NEO;So;0;L;;;;;N;;;;; 1D05A;BYZANTINE MUSICAL SYMBOL PSIFISTON NEO;So;0;L;;;;;N;;;;; 1D05B;BYZANTINE MUSICAL SYMBOL OMALON;So;0;L;;;;;N;;;;; 1D05C;BYZANTINE MUSICAL SYMBOL ANTIKENOMA;So;0;L;;;;;N;;;;; 1D05D;BYZANTINE MUSICAL SYMBOL LYGISMA;So;0;L;;;;;N;;;;; 1D05E;BYZANTINE MUSICAL SYMBOL PARAKLITIKI NEO;So;0;L;;;;;N;;;;; 1D05F;BYZANTINE MUSICAL SYMBOL PARAKALESMA NEO;So;0;L;;;;;N;;;;; 1D060;BYZANTINE MUSICAL SYMBOL ETERON PARAKALESMA;So;0;L;;;;;N;;;;; 1D061;BYZANTINE MUSICAL SYMBOL KYLISMA;So;0;L;;;;;N;;;;; 1D062;BYZANTINE MUSICAL SYMBOL ANTIKENOKYLISMA;So;0;L;;;;;N;;;;; 1D063;BYZANTINE MUSICAL SYMBOL TROMIKON NEO;So;0;L;;;;;N;;;;; 1D064;BYZANTINE MUSICAL SYMBOL EKSTREPTON;So;0;L;;;;;N;;;;; 1D065;BYZANTINE MUSICAL SYMBOL SYNAGMA NEO;So;0;L;;;;;N;;;;; 1D066;BYZANTINE MUSICAL SYMBOL SYRMA;So;0;L;;;;;N;;;;; 1D067;BYZANTINE MUSICAL SYMBOL CHOREVMA NEO;So;0;L;;;;;N;;;;; 1D068;BYZANTINE MUSICAL SYMBOL EPEGERMA;So;0;L;;;;;N;;;;; 1D069;BYZANTINE MUSICAL SYMBOL SEISMA NEO;So;0;L;;;;;N;;;;; 1D06A;BYZANTINE MUSICAL SYMBOL XIRON KLASMA;So;0;L;;;;;N;;;;; 1D06B;BYZANTINE MUSICAL SYMBOL TROMIKOPSIFISTON;So;0;L;;;;;N;;;;; 1D06C;BYZANTINE MUSICAL SYMBOL PSIFISTOLYGISMA;So;0;L;;;;;N;;;;; 1D06D;BYZANTINE MUSICAL SYMBOL TROMIKOLYGISMA;So;0;L;;;;;N;;;;; 1D06E;BYZANTINE MUSICAL SYMBOL TROMIKOPARAKALESMA;So;0;L;;;;;N;;;;; 1D06F;BYZANTINE MUSICAL SYMBOL PSIFISTOPARAKALESMA;So;0;L;;;;;N;;;;; 1D070;BYZANTINE MUSICAL SYMBOL TROMIKOSYNAGMA;So;0;L;;;;;N;;;;; 1D071;BYZANTINE MUSICAL SYMBOL PSIFISTOSYNAGMA;So;0;L;;;;;N;;;;; 1D072;BYZANTINE MUSICAL SYMBOL GORGOSYNTHETON;So;0;L;;;;;N;;;;; 1D073;BYZANTINE MUSICAL SYMBOL ARGOSYNTHETON;So;0;L;;;;;N;;;;; 1D074;BYZANTINE MUSICAL SYMBOL ETERON ARGOSYNTHETON;So;0;L;;;;;N;;;;; 1D075;BYZANTINE MUSICAL SYMBOL OYRANISMA NEO;So;0;L;;;;;N;;;;; 1D076;BYZANTINE MUSICAL SYMBOL THEMATISMOS ESO;So;0;L;;;;;N;;;;; 1D077;BYZANTINE MUSICAL SYMBOL THEMATISMOS EXO;So;0;L;;;;;N;;;;; 1D078;BYZANTINE MUSICAL SYMBOL THEMA APLOUN;So;0;L;;;;;N;;;;; 1D079;BYZANTINE MUSICAL SYMBOL THES KAI APOTHES;So;0;L;;;;;N;;;;; 1D07A;BYZANTINE MUSICAL SYMBOL KATAVASMA;So;0;L;;;;;N;;;;; 1D07B;BYZANTINE MUSICAL SYMBOL ENDOFONON;So;0;L;;;;;N;;;;; 1D07C;BYZANTINE MUSICAL SYMBOL YFEN KATO;So;0;L;;;;;N;;;;; 1D07D;BYZANTINE MUSICAL SYMBOL YFEN ANO;So;0;L;;;;;N;;;;; 1D07E;BYZANTINE MUSICAL SYMBOL STAVROS;So;0;L;;;;;N;;;;; 1D07F;BYZANTINE MUSICAL SYMBOL KLASMA ANO;So;0;L;;;;;N;;;;; 1D080;BYZANTINE MUSICAL SYMBOL DIPLI ARCHAION;So;0;L;;;;;N;;;;; 1D081;BYZANTINE MUSICAL SYMBOL KRATIMA ARCHAION;So;0;L;;;;;N;;;;; 1D082;BYZANTINE MUSICAL SYMBOL KRATIMA ALLO;So;0;L;;;;;N;;;;; 1D083;BYZANTINE MUSICAL SYMBOL KRATIMA NEO;So;0;L;;;;;N;;;;; 1D084;BYZANTINE MUSICAL SYMBOL APODERMA NEO;So;0;L;;;;;N;;;;; 1D085;BYZANTINE MUSICAL SYMBOL APLI;So;0;L;;;;;N;;;;; 1D086;BYZANTINE MUSICAL SYMBOL DIPLI;So;0;L;;;;;N;;;;; 1D087;BYZANTINE MUSICAL SYMBOL TRIPLI;So;0;L;;;;;N;;;;; 1D088;BYZANTINE MUSICAL SYMBOL TETRAPLI;So;0;L;;;;;N;;;;; 1D089;BYZANTINE MUSICAL SYMBOL KORONIS;So;0;L;;;;;N;;;;; 1D08A;BYZANTINE MUSICAL SYMBOL LEIMMA ENOS CHRONOU;So;0;L;;;;;N;;;;; 1D08B;BYZANTINE MUSICAL SYMBOL LEIMMA DYO CHRONON;So;0;L;;;;;N;;;;; 1D08C;BYZANTINE MUSICAL SYMBOL LEIMMA TRION CHRONON;So;0;L;;;;;N;;;;; 1D08D;BYZANTINE MUSICAL SYMBOL LEIMMA TESSARON CHRONON;So;0;L;;;;;N;;;;; 1D08E;BYZANTINE MUSICAL SYMBOL LEIMMA IMISEOS CHRONOU;So;0;L;;;;;N;;;;; 1D08F;BYZANTINE MUSICAL SYMBOL GORGON NEO ANO;So;0;L;;;;;N;;;;; 1D090;BYZANTINE MUSICAL SYMBOL GORGON PARESTIGMENON ARISTERA;So;0;L;;;;;N;;;;; 1D091;BYZANTINE MUSICAL SYMBOL GORGON PARESTIGMENON DEXIA;So;0;L;;;;;N;;;;; 1D092;BYZANTINE MUSICAL SYMBOL DIGORGON;So;0;L;;;;;N;;;;; 1D093;BYZANTINE MUSICAL SYMBOL DIGORGON PARESTIGMENON ARISTERA KATO;So;0;L;;;;;N;;;;; 1D094;BYZANTINE MUSICAL SYMBOL DIGORGON PARESTIGMENON ARISTERA ANO;So;0;L;;;;;N;;;;; 1D095;BYZANTINE MUSICAL SYMBOL DIGORGON PARESTIGMENON DEXIA;So;0;L;;;;;N;;;;; 1D096;BYZANTINE MUSICAL SYMBOL TRIGORGON;So;0;L;;;;;N;;;;; 1D097;BYZANTINE MUSICAL SYMBOL ARGON;So;0;L;;;;;N;;;;; 1D098;BYZANTINE MUSICAL SYMBOL IMIDIARGON;So;0;L;;;;;N;;;;; 1D099;BYZANTINE MUSICAL SYMBOL DIARGON;So;0;L;;;;;N;;;;; 1D09A;BYZANTINE MUSICAL SYMBOL AGOGI POLI ARGI;So;0;L;;;;;N;;;;; 1D09B;BYZANTINE MUSICAL SYMBOL AGOGI ARGOTERI;So;0;L;;;;;N;;;;; 1D09C;BYZANTINE MUSICAL SYMBOL AGOGI ARGI;So;0;L;;;;;N;;;;; 1D09D;BYZANTINE MUSICAL SYMBOL AGOGI METRIA;So;0;L;;;;;N;;;;; 1D09E;BYZANTINE MUSICAL SYMBOL AGOGI MESI;So;0;L;;;;;N;;;;; 1D09F;BYZANTINE MUSICAL SYMBOL AGOGI GORGI;So;0;L;;;;;N;;;;; 1D0A0;BYZANTINE MUSICAL SYMBOL AGOGI GORGOTERI;So;0;L;;;;;N;;;;; 1D0A1;BYZANTINE MUSICAL SYMBOL AGOGI POLI GORGI;So;0;L;;;;;N;;;;; 1D0A2;BYZANTINE MUSICAL SYMBOL MARTYRIA PROTOS ICHOS;So;0;L;;;;;N;;;;; 1D0A3;BYZANTINE MUSICAL SYMBOL MARTYRIA ALLI PROTOS ICHOS;So;0;L;;;;;N;;;;; 1D0A4;BYZANTINE MUSICAL SYMBOL MARTYRIA DEYTEROS ICHOS;So;0;L;;;;;N;;;;; 1D0A5;BYZANTINE MUSICAL SYMBOL MARTYRIA ALLI DEYTEROS ICHOS;So;0;L;;;;;N;;;;; 1D0A6;BYZANTINE MUSICAL SYMBOL MARTYRIA TRITOS ICHOS;So;0;L;;;;;N;;;;; 1D0A7;BYZANTINE MUSICAL SYMBOL MARTYRIA TRIFONIAS;So;0;L;;;;;N;;;;; 1D0A8;BYZANTINE MUSICAL SYMBOL MARTYRIA TETARTOS ICHOS;So;0;L;;;;;N;;;;; 1D0A9;BYZANTINE MUSICAL SYMBOL MARTYRIA TETARTOS LEGETOS ICHOS;So;0;L;;;;;N;;;;; 1D0AA;BYZANTINE MUSICAL SYMBOL MARTYRIA LEGETOS ICHOS;So;0;L;;;;;N;;;;; 1D0AB;BYZANTINE MUSICAL SYMBOL MARTYRIA PLAGIOS ICHOS;So;0;L;;;;;N;;;;; 1D0AC;BYZANTINE MUSICAL SYMBOL ISAKIA TELOUS ICHIMATOS;So;0;L;;;;;N;;;;; 1D0AD;BYZANTINE MUSICAL SYMBOL APOSTROFOI TELOUS ICHIMATOS;So;0;L;;;;;N;;;;; 1D0AE;BYZANTINE MUSICAL SYMBOL FANEROSIS TETRAFONIAS;So;0;L;;;;;N;;;;; 1D0AF;BYZANTINE MUSICAL SYMBOL FANEROSIS MONOFONIAS;So;0;L;;;;;N;;;;; 1D0B0;BYZANTINE MUSICAL SYMBOL FANEROSIS DIFONIAS;So;0;L;;;;;N;;;;; 1D0B1;BYZANTINE MUSICAL SYMBOL MARTYRIA VARYS ICHOS;So;0;L;;;;;N;;;;; 1D0B2;BYZANTINE MUSICAL SYMBOL MARTYRIA PROTOVARYS ICHOS;So;0;L;;;;;N;;;;; 1D0B3;BYZANTINE MUSICAL SYMBOL MARTYRIA PLAGIOS TETARTOS ICHOS;So;0;L;;;;;N;;;;; 1D0B4;BYZANTINE MUSICAL SYMBOL GORTHMIKON N APLOUN;So;0;L;;;;;N;;;;; 1D0B5;BYZANTINE MUSICAL SYMBOL GORTHMIKON N DIPLOUN;So;0;L;;;;;N;;;;; 1D0B6;BYZANTINE MUSICAL SYMBOL ENARXIS KAI FTHORA VOU;So;0;L;;;;;N;;;;; 1D0B7;BYZANTINE MUSICAL SYMBOL IMIFONON;So;0;L;;;;;N;;;;; 1D0B8;BYZANTINE MUSICAL SYMBOL IMIFTHORON;So;0;L;;;;;N;;;;; 1D0B9;BYZANTINE MUSICAL SYMBOL FTHORA ARCHAION DEYTEROU ICHOU;So;0;L;;;;;N;;;;; 1D0BA;BYZANTINE MUSICAL SYMBOL FTHORA DIATONIKI PA;So;0;L;;;;;N;;;;; 1D0BB;BYZANTINE MUSICAL SYMBOL FTHORA DIATONIKI NANA;So;0;L;;;;;N;;;;; 1D0BC;BYZANTINE MUSICAL SYMBOL FTHORA NAOS ICHOS;So;0;L;;;;;N;;;;; 1D0BD;BYZANTINE MUSICAL SYMBOL FTHORA DIATONIKI DI;So;0;L;;;;;N;;;;; 1D0BE;BYZANTINE MUSICAL SYMBOL FTHORA SKLIRON DIATONON DI;So;0;L;;;;;N;;;;; 1D0BF;BYZANTINE MUSICAL SYMBOL FTHORA DIATONIKI KE;So;0;L;;;;;N;;;;; 1D0C0;BYZANTINE MUSICAL SYMBOL FTHORA DIATONIKI ZO;So;0;L;;;;;N;;;;; 1D0C1;BYZANTINE MUSICAL SYMBOL FTHORA DIATONIKI NI KATO;So;0;L;;;;;N;;;;; 1D0C2;BYZANTINE MUSICAL SYMBOL FTHORA DIATONIKI NI ANO;So;0;L;;;;;N;;;;; 1D0C3;BYZANTINE MUSICAL SYMBOL FTHORA MALAKON CHROMA DIFONIAS;So;0;L;;;;;N;;;;; 1D0C4;BYZANTINE MUSICAL SYMBOL FTHORA MALAKON CHROMA MONOFONIAS;So;0;L;;;;;N;;;;; 1D0C5;BYZANTINE MUSICAL SYMBOL FHTORA SKLIRON CHROMA VASIS;So;0;L;;;;;N;;;;; 1D0C6;BYZANTINE MUSICAL SYMBOL FTHORA SKLIRON CHROMA SYNAFI;So;0;L;;;;;N;;;;; 1D0C7;BYZANTINE MUSICAL SYMBOL FTHORA NENANO;So;0;L;;;;;N;;;;; 1D0C8;BYZANTINE MUSICAL SYMBOL CHROA ZYGOS;So;0;L;;;;;N;;;;; 1D0C9;BYZANTINE MUSICAL SYMBOL CHROA KLITON;So;0;L;;;;;N;;;;; 1D0CA;BYZANTINE MUSICAL SYMBOL CHROA SPATHI;So;0;L;;;;;N;;;;; 1D0CB;BYZANTINE MUSICAL SYMBOL FTHORA I YFESIS TETARTIMORION;So;0;L;;;;;N;;;;; 1D0CC;BYZANTINE MUSICAL SYMBOL FTHORA ENARMONIOS ANTIFONIA;So;0;L;;;;;N;;;;; 1D0CD;BYZANTINE MUSICAL SYMBOL YFESIS TRITIMORION;So;0;L;;;;;N;;;;; 1D0CE;BYZANTINE MUSICAL SYMBOL DIESIS TRITIMORION;So;0;L;;;;;N;;;;; 1D0CF;BYZANTINE MUSICAL SYMBOL DIESIS TETARTIMORION;So;0;L;;;;;N;;;;; 1D0D0;BYZANTINE MUSICAL SYMBOL DIESIS APLI DYO DODEKATA;So;0;L;;;;;N;;;;; 1D0D1;BYZANTINE MUSICAL SYMBOL DIESIS MONOGRAMMOS TESSERA DODEKATA;So;0;L;;;;;N;;;;; 1D0D2;BYZANTINE MUSICAL SYMBOL DIESIS DIGRAMMOS EX DODEKATA;So;0;L;;;;;N;;;;; 1D0D3;BYZANTINE MUSICAL SYMBOL DIESIS TRIGRAMMOS OKTO DODEKATA;So;0;L;;;;;N;;;;; 1D0D4;BYZANTINE MUSICAL SYMBOL YFESIS APLI DYO DODEKATA;So;0;L;;;;;N;;;;; 1D0D5;BYZANTINE MUSICAL SYMBOL YFESIS MONOGRAMMOS TESSERA DODEKATA;So;0;L;;;;;N;;;;; 1D0D6;BYZANTINE MUSICAL SYMBOL YFESIS DIGRAMMOS EX DODEKATA;So;0;L;;;;;N;;;;; 1D0D7;BYZANTINE MUSICAL SYMBOL YFESIS TRIGRAMMOS OKTO DODEKATA;So;0;L;;;;;N;;;;; 1D0D8;BYZANTINE MUSICAL SYMBOL GENIKI DIESIS;So;0;L;;;;;N;;;;; 1D0D9;BYZANTINE MUSICAL SYMBOL GENIKI YFESIS;So;0;L;;;;;N;;;;; 1D0DA;BYZANTINE MUSICAL SYMBOL DIASTOLI APLI MIKRI;So;0;L;;;;;N;;;;; 1D0DB;BYZANTINE MUSICAL SYMBOL DIASTOLI APLI MEGALI;So;0;L;;;;;N;;;;; 1D0DC;BYZANTINE MUSICAL SYMBOL DIASTOLI DIPLI;So;0;L;;;;;N;;;;; 1D0DD;BYZANTINE MUSICAL SYMBOL DIASTOLI THESEOS;So;0;L;;;;;N;;;;; 1D0DE;BYZANTINE MUSICAL SYMBOL SIMANSIS THESEOS;So;0;L;;;;;N;;;;; 1D0DF;BYZANTINE MUSICAL SYMBOL SIMANSIS THESEOS DISIMOU;So;0;L;;;;;N;;;;; 1D0E0;BYZANTINE MUSICAL SYMBOL SIMANSIS THESEOS TRISIMOU;So;0;L;;;;;N;;;;; 1D0E1;BYZANTINE MUSICAL SYMBOL SIMANSIS THESEOS TETRASIMOU;So;0;L;;;;;N;;;;; 1D0E2;BYZANTINE MUSICAL SYMBOL SIMANSIS ARSEOS;So;0;L;;;;;N;;;;; 1D0E3;BYZANTINE MUSICAL SYMBOL SIMANSIS ARSEOS DISIMOU;So;0;L;;;;;N;;;;; 1D0E4;BYZANTINE MUSICAL SYMBOL SIMANSIS ARSEOS TRISIMOU;So;0;L;;;;;N;;;;; 1D0E5;BYZANTINE MUSICAL SYMBOL SIMANSIS ARSEOS TETRASIMOU;So;0;L;;;;;N;;;;; 1D0E6;BYZANTINE MUSICAL SYMBOL DIGRAMMA GG;So;0;L;;;;;N;;;;; 1D0E7;BYZANTINE MUSICAL SYMBOL DIFTOGGOS OU;So;0;L;;;;;N;;;;; 1D0E8;BYZANTINE MUSICAL SYMBOL STIGMA;So;0;L;;;;;N;;;;; 1D0E9;BYZANTINE MUSICAL SYMBOL ARKTIKO PA;So;0;L;;;;;N;;;;; 1D0EA;BYZANTINE MUSICAL SYMBOL ARKTIKO VOU;So;0;L;;;;;N;;;;; 1D0EB;BYZANTINE MUSICAL SYMBOL ARKTIKO GA;So;0;L;;;;;N;;;;; 1D0EC;BYZANTINE MUSICAL SYMBOL ARKTIKO DI;So;0;L;;;;;N;;;;; 1D0ED;BYZANTINE MUSICAL SYMBOL ARKTIKO KE;So;0;L;;;;;N;;;;; 1D0EE;BYZANTINE MUSICAL SYMBOL ARKTIKO ZO;So;0;L;;;;;N;;;;; 1D0EF;BYZANTINE MUSICAL SYMBOL ARKTIKO NI;So;0;L;;;;;N;;;;; 1D0F0;BYZANTINE MUSICAL SYMBOL KENTIMATA NEO MESO;So;0;L;;;;;N;;;;; 1D0F1;BYZANTINE MUSICAL SYMBOL KENTIMA NEO MESO;So;0;L;;;;;N;;;;; 1D0F2;BYZANTINE MUSICAL SYMBOL KENTIMATA NEO KATO;So;0;L;;;;;N;;;;; 1D0F3;BYZANTINE MUSICAL SYMBOL KENTIMA NEO KATO;So;0;L;;;;;N;;;;; 1D0F4;BYZANTINE MUSICAL SYMBOL KLASMA KATO;So;0;L;;;;;N;;;;; 1D0F5;BYZANTINE MUSICAL SYMBOL GORGON NEO KATO;So;0;L;;;;;N;;;;; 1D100;MUSICAL SYMBOL SINGLE BARLINE;So;0;L;;;;;N;;;;; 1D101;MUSICAL SYMBOL DOUBLE BARLINE;So;0;L;;;;;N;;;;; 1D102;MUSICAL SYMBOL FINAL BARLINE;So;0;L;;;;;N;;;;; 1D103;MUSICAL SYMBOL REVERSE FINAL BARLINE;So;0;L;;;;;N;;;;; 1D104;MUSICAL SYMBOL DASHED BARLINE;So;0;L;;;;;N;;;;; 1D105;MUSICAL SYMBOL SHORT BARLINE;So;0;L;;;;;N;;;;; 1D106;MUSICAL SYMBOL LEFT REPEAT SIGN;So;0;L;;;;;N;;;;; 1D107;MUSICAL SYMBOL RIGHT REPEAT SIGN;So;0;L;;;;;N;;;;; 1D108;MUSICAL SYMBOL REPEAT DOTS;So;0;L;;;;;N;;;;; 1D109;MUSICAL SYMBOL DAL SEGNO;So;0;L;;;;;N;;;;; 1D10A;MUSICAL SYMBOL DA CAPO;So;0;L;;;;;N;;;;; 1D10B;MUSICAL SYMBOL SEGNO;So;0;L;;;;;N;;;;; 1D10C;MUSICAL SYMBOL CODA;So;0;L;;;;;N;;;;; 1D10D;MUSICAL SYMBOL REPEATED FIGURE-1;So;0;L;;;;;N;;;;; 1D10E;MUSICAL SYMBOL REPEATED FIGURE-2;So;0;L;;;;;N;;;;; 1D10F;MUSICAL SYMBOL REPEATED FIGURE-3;So;0;L;;;;;N;;;;; 1D110;MUSICAL SYMBOL FERMATA;So;0;L;;;;;N;;;;; 1D111;MUSICAL SYMBOL FERMATA BELOW;So;0;L;;;;;N;;;;; 1D112;MUSICAL SYMBOL BREATH MARK;So;0;L;;;;;N;;;;; 1D113;MUSICAL SYMBOL CAESURA;So;0;L;;;;;N;;;;; 1D114;MUSICAL SYMBOL BRACE;So;0;L;;;;;N;;;;; 1D115;MUSICAL SYMBOL BRACKET;So;0;L;;;;;N;;;;; 1D116;MUSICAL SYMBOL ONE-LINE STAFF;So;0;L;;;;;N;;;;; 1D117;MUSICAL SYMBOL TWO-LINE STAFF;So;0;L;;;;;N;;;;; 1D118;MUSICAL SYMBOL THREE-LINE STAFF;So;0;L;;;;;N;;;;; 1D119;MUSICAL SYMBOL FOUR-LINE STAFF;So;0;L;;;;;N;;;;; 1D11A;MUSICAL SYMBOL FIVE-LINE STAFF;So;0;L;;;;;N;;;;; 1D11B;MUSICAL SYMBOL SIX-LINE STAFF;So;0;L;;;;;N;;;;; 1D11C;MUSICAL SYMBOL SIX-STRING FRETBOARD;So;0;L;;;;;N;;;;; 1D11D;MUSICAL SYMBOL FOUR-STRING FRETBOARD;So;0;L;;;;;N;;;;; 1D11E;MUSICAL SYMBOL G CLEF;So;0;L;;;;;N;;;;; 1D11F;MUSICAL SYMBOL G CLEF OTTAVA ALTA;So;0;L;;;;;N;;;;; 1D120;MUSICAL SYMBOL G CLEF OTTAVA BASSA;So;0;L;;;;;N;;;;; 1D121;MUSICAL SYMBOL C CLEF;So;0;L;;;;;N;;;;; 1D122;MUSICAL SYMBOL F CLEF;So;0;L;;;;;N;;;;; 1D123;MUSICAL SYMBOL F CLEF OTTAVA ALTA;So;0;L;;;;;N;;;;; 1D124;MUSICAL SYMBOL F CLEF OTTAVA BASSA;So;0;L;;;;;N;;;;; 1D125;MUSICAL SYMBOL DRUM CLEF-1;So;0;L;;;;;N;;;;; 1D126;MUSICAL SYMBOL DRUM CLEF-2;So;0;L;;;;;N;;;;; 1D129;MUSICAL SYMBOL MULTIPLE MEASURE REST;So;0;L;;;;;N;;;;; 1D12A;MUSICAL SYMBOL DOUBLE SHARP;So;0;L;;;;;N;;;;; 1D12B;MUSICAL SYMBOL DOUBLE FLAT;So;0;L;;;;;N;;;;; 1D12C;MUSICAL SYMBOL FLAT UP;So;0;L;;;;;N;;;;; 1D12D;MUSICAL SYMBOL FLAT DOWN;So;0;L;;;;;N;;;;; 1D12E;MUSICAL SYMBOL NATURAL UP;So;0;L;;;;;N;;;;; 1D12F;MUSICAL SYMBOL NATURAL DOWN;So;0;L;;;;;N;;;;; 1D130;MUSICAL SYMBOL SHARP UP;So;0;L;;;;;N;;;;; 1D131;MUSICAL SYMBOL SHARP DOWN;So;0;L;;;;;N;;;;; 1D132;MUSICAL SYMBOL QUARTER TONE SHARP;So;0;L;;;;;N;;;;; 1D133;MUSICAL SYMBOL QUARTER TONE FLAT;So;0;L;;;;;N;;;;; 1D134;MUSICAL SYMBOL COMMON TIME;So;0;L;;;;;N;;;;; 1D135;MUSICAL SYMBOL CUT TIME;So;0;L;;;;;N;;;;; 1D136;MUSICAL SYMBOL OTTAVA ALTA;So;0;L;;;;;N;;;;; 1D137;MUSICAL SYMBOL OTTAVA BASSA;So;0;L;;;;;N;;;;; 1D138;MUSICAL SYMBOL QUINDICESIMA ALTA;So;0;L;;;;;N;;;;; 1D139;MUSICAL SYMBOL QUINDICESIMA BASSA;So;0;L;;;;;N;;;;; 1D13A;MUSICAL SYMBOL MULTI REST;So;0;L;;;;;N;;;;; 1D13B;MUSICAL SYMBOL WHOLE REST;So;0;L;;;;;N;;;;; 1D13C;MUSICAL SYMBOL HALF REST;So;0;L;;;;;N;;;;; 1D13D;MUSICAL SYMBOL QUARTER REST;So;0;L;;;;;N;;;;; 1D13E;MUSICAL SYMBOL EIGHTH REST;So;0;L;;;;;N;;;;; 1D13F;MUSICAL SYMBOL SIXTEENTH REST;So;0;L;;;;;N;;;;; 1D140;MUSICAL SYMBOL THIRTY-SECOND REST;So;0;L;;;;;N;;;;; 1D141;MUSICAL SYMBOL SIXTY-FOURTH REST;So;0;L;;;;;N;;;;; 1D142;MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH REST;So;0;L;;;;;N;;;;; 1D143;MUSICAL SYMBOL X NOTEHEAD;So;0;L;;;;;N;;;;; 1D144;MUSICAL SYMBOL PLUS NOTEHEAD;So;0;L;;;;;N;;;;; 1D145;MUSICAL SYMBOL CIRCLE X NOTEHEAD;So;0;L;;;;;N;;;;; 1D146;MUSICAL SYMBOL SQUARE NOTEHEAD WHITE;So;0;L;;;;;N;;;;; 1D147;MUSICAL SYMBOL SQUARE NOTEHEAD BLACK;So;0;L;;;;;N;;;;; 1D148;MUSICAL SYMBOL TRIANGLE NOTEHEAD UP WHITE;So;0;L;;;;;N;;;;; 1D149;MUSICAL SYMBOL TRIANGLE NOTEHEAD UP BLACK;So;0;L;;;;;N;;;;; 1D14A;MUSICAL SYMBOL TRIANGLE NOTEHEAD LEFT WHITE;So;0;L;;;;;N;;;;; 1D14B;MUSICAL SYMBOL TRIANGLE NOTEHEAD LEFT BLACK;So;0;L;;;;;N;;;;; 1D14C;MUSICAL SYMBOL TRIANGLE NOTEHEAD RIGHT WHITE;So;0;L;;;;;N;;;;; 1D14D;MUSICAL SYMBOL TRIANGLE NOTEHEAD RIGHT BLACK;So;0;L;;;;;N;;;;; 1D14E;MUSICAL SYMBOL TRIANGLE NOTEHEAD DOWN WHITE;So;0;L;;;;;N;;;;; 1D14F;MUSICAL SYMBOL TRIANGLE NOTEHEAD DOWN BLACK;So;0;L;;;;;N;;;;; 1D150;MUSICAL SYMBOL TRIANGLE NOTEHEAD UP RIGHT WHITE;So;0;L;;;;;N;;;;; 1D151;MUSICAL SYMBOL TRIANGLE NOTEHEAD UP RIGHT BLACK;So;0;L;;;;;N;;;;; 1D152;MUSICAL SYMBOL MOON NOTEHEAD WHITE;So;0;L;;;;;N;;;;; 1D153;MUSICAL SYMBOL MOON NOTEHEAD BLACK;So;0;L;;;;;N;;;;; 1D154;MUSICAL SYMBOL TRIANGLE-ROUND NOTEHEAD DOWN WHITE;So;0;L;;;;;N;;;;; 1D155;MUSICAL SYMBOL TRIANGLE-ROUND NOTEHEAD DOWN BLACK;So;0;L;;;;;N;;;;; 1D156;MUSICAL SYMBOL PARENTHESIS NOTEHEAD;So;0;L;;;;;N;;;;; 1D157;MUSICAL SYMBOL VOID NOTEHEAD;So;0;L;;;;;N;;;;; 1D158;MUSICAL SYMBOL NOTEHEAD BLACK;So;0;L;;;;;N;;;;; 1D159;MUSICAL SYMBOL NULL NOTEHEAD;So;0;L;;;;;N;;;;; 1D15A;MUSICAL SYMBOL CLUSTER NOTEHEAD WHITE;So;0;L;;;;;N;;;;; 1D15B;MUSICAL SYMBOL CLUSTER NOTEHEAD BLACK;So;0;L;;;;;N;;;;; 1D15C;MUSICAL SYMBOL BREVE;So;0;L;;;;;N;;;;; 1D15D;MUSICAL SYMBOL WHOLE NOTE;So;0;L;;;;;N;;;;; 1D15E;MUSICAL SYMBOL HALF NOTE;So;0;L;1D157 1D165;;;;N;;;;; 1D15F;MUSICAL SYMBOL QUARTER NOTE;So;0;L;1D158 1D165;;;;N;;;;; 1D160;MUSICAL SYMBOL EIGHTH NOTE;So;0;L;1D15F 1D16E;;;;N;;;;; 1D161;MUSICAL SYMBOL SIXTEENTH NOTE;So;0;L;1D15F 1D16F;;;;N;;;;; 1D162;MUSICAL SYMBOL THIRTY-SECOND NOTE;So;0;L;1D15F 1D170;;;;N;;;;; 1D163;MUSICAL SYMBOL SIXTY-FOURTH NOTE;So;0;L;1D15F 1D171;;;;N;;;;; 1D164;MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE;So;0;L;1D15F 1D172;;;;N;;;;; 1D165;MUSICAL SYMBOL COMBINING STEM;Mc;216;L;;;;;N;;;;; 1D166;MUSICAL SYMBOL COMBINING SPRECHGESANG STEM;Mc;216;L;;;;;N;;;;; 1D167;MUSICAL SYMBOL COMBINING TREMOLO-1;Mn;1;NSM;;;;;N;;;;; 1D168;MUSICAL SYMBOL COMBINING TREMOLO-2;Mn;1;NSM;;;;;N;;;;; 1D169;MUSICAL SYMBOL COMBINING TREMOLO-3;Mn;1;NSM;;;;;N;;;;; 1D16A;MUSICAL SYMBOL FINGERED TREMOLO-1;So;0;L;;;;;N;;;;; 1D16B;MUSICAL SYMBOL FINGERED TREMOLO-2;So;0;L;;;;;N;;;;; 1D16C;MUSICAL SYMBOL FINGERED TREMOLO-3;So;0;L;;;;;N;;;;; 1D16D;MUSICAL SYMBOL COMBINING AUGMENTATION DOT;Mc;226;L;;;;;N;;;;; 1D16E;MUSICAL SYMBOL COMBINING FLAG-1;Mc;216;L;;;;;N;;;;; 1D16F;MUSICAL SYMBOL COMBINING FLAG-2;Mc;216;L;;;;;N;;;;; 1D170;MUSICAL SYMBOL COMBINING FLAG-3;Mc;216;L;;;;;N;;;;; 1D171;MUSICAL SYMBOL COMBINING FLAG-4;Mc;216;L;;;;;N;;;;; 1D172;MUSICAL SYMBOL COMBINING FLAG-5;Mc;216;L;;;;;N;;;;; 1D173;MUSICAL SYMBOL BEGIN BEAM;Cf;0;BN;;;;;N;;;;; 1D174;MUSICAL SYMBOL END BEAM;Cf;0;BN;;;;;N;;;;; 1D175;MUSICAL SYMBOL BEGIN TIE;Cf;0;BN;;;;;N;;;;; 1D176;MUSICAL SYMBOL END TIE;Cf;0;BN;;;;;N;;;;; 1D177;MUSICAL SYMBOL BEGIN SLUR;Cf;0;BN;;;;;N;;;;; 1D178;MUSICAL SYMBOL END SLUR;Cf;0;BN;;;;;N;;;;; 1D179;MUSICAL SYMBOL BEGIN PHRASE;Cf;0;BN;;;;;N;;;;; 1D17A;MUSICAL SYMBOL END PHRASE;Cf;0;BN;;;;;N;;;;; 1D17B;MUSICAL SYMBOL COMBINING ACCENT;Mn;220;NSM;;;;;N;;;;; 1D17C;MUSICAL SYMBOL COMBINING STACCATO;Mn;220;NSM;;;;;N;;;;; 1D17D;MUSICAL SYMBOL COMBINING TENUTO;Mn;220;NSM;;;;;N;;;;; 1D17E;MUSICAL SYMBOL COMBINING STACCATISSIMO;Mn;220;NSM;;;;;N;;;;; 1D17F;MUSICAL SYMBOL COMBINING MARCATO;Mn;220;NSM;;;;;N;;;;; 1D180;MUSICAL SYMBOL COMBINING MARCATO-STACCATO;Mn;220;NSM;;;;;N;;;;; 1D181;MUSICAL SYMBOL COMBINING ACCENT-STACCATO;Mn;220;NSM;;;;;N;;;;; 1D182;MUSICAL SYMBOL COMBINING LOURE;Mn;220;NSM;;;;;N;;;;; 1D183;MUSICAL SYMBOL ARPEGGIATO UP;So;0;L;;;;;N;;;;; 1D184;MUSICAL SYMBOL ARPEGGIATO DOWN;So;0;L;;;;;N;;;;; 1D185;MUSICAL SYMBOL COMBINING DOIT;Mn;230;NSM;;;;;N;;;;; 1D186;MUSICAL SYMBOL COMBINING RIP;Mn;230;NSM;;;;;N;;;;; 1D187;MUSICAL SYMBOL COMBINING FLIP;Mn;230;NSM;;;;;N;;;;; 1D188;MUSICAL SYMBOL COMBINING SMEAR;Mn;230;NSM;;;;;N;;;;; 1D189;MUSICAL SYMBOL COMBINING BEND;Mn;230;NSM;;;;;N;;;;; 1D18A;MUSICAL SYMBOL COMBINING DOUBLE TONGUE;Mn;220;NSM;;;;;N;;;;; 1D18B;MUSICAL SYMBOL COMBINING TRIPLE TONGUE;Mn;220;NSM;;;;;N;;;;; 1D18C;MUSICAL SYMBOL RINFORZANDO;So;0;L;;;;;N;;;;; 1D18D;MUSICAL SYMBOL SUBITO;So;0;L;;;;;N;;;;; 1D18E;MUSICAL SYMBOL Z;So;0;L;;;;;N;;;;; 1D18F;MUSICAL SYMBOL PIANO;So;0;L;;;;;N;;;;; 1D190;MUSICAL SYMBOL MEZZO;So;0;L;;;;;N;;;;; 1D191;MUSICAL SYMBOL FORTE;So;0;L;;;;;N;;;;; 1D192;MUSICAL SYMBOL CRESCENDO;So;0;L;;;;;N;;;;; 1D193;MUSICAL SYMBOL DECRESCENDO;So;0;L;;;;;N;;;;; 1D194;MUSICAL SYMBOL GRACE NOTE SLASH;So;0;L;;;;;N;;;;; 1D195;MUSICAL SYMBOL GRACE NOTE NO SLASH;So;0;L;;;;;N;;;;; 1D196;MUSICAL SYMBOL TR;So;0;L;;;;;N;;;;; 1D197;MUSICAL SYMBOL TURN;So;0;L;;;;;N;;;;; 1D198;MUSICAL SYMBOL INVERTED TURN;So;0;L;;;;;N;;;;; 1D199;MUSICAL SYMBOL TURN SLASH;So;0;L;;;;;N;;;;; 1D19A;MUSICAL SYMBOL TURN UP;So;0;L;;;;;N;;;;; 1D19B;MUSICAL SYMBOL ORNAMENT STROKE-1;So;0;L;;;;;N;;;;; 1D19C;MUSICAL SYMBOL ORNAMENT STROKE-2;So;0;L;;;;;N;;;;; 1D19D;MUSICAL SYMBOL ORNAMENT STROKE-3;So;0;L;;;;;N;;;;; 1D19E;MUSICAL SYMBOL ORNAMENT STROKE-4;So;0;L;;;;;N;;;;; 1D19F;MUSICAL SYMBOL ORNAMENT STROKE-5;So;0;L;;;;;N;;;;; 1D1A0;MUSICAL SYMBOL ORNAMENT STROKE-6;So;0;L;;;;;N;;;;; 1D1A1;MUSICAL SYMBOL ORNAMENT STROKE-7;So;0;L;;;;;N;;;;; 1D1A2;MUSICAL SYMBOL ORNAMENT STROKE-8;So;0;L;;;;;N;;;;; 1D1A3;MUSICAL SYMBOL ORNAMENT STROKE-9;So;0;L;;;;;N;;;;; 1D1A4;MUSICAL SYMBOL ORNAMENT STROKE-10;So;0;L;;;;;N;;;;; 1D1A5;MUSICAL SYMBOL ORNAMENT STROKE-11;So;0;L;;;;;N;;;;; 1D1A6;MUSICAL SYMBOL HAUPTSTIMME;So;0;L;;;;;N;;;;; 1D1A7;MUSICAL SYMBOL NEBENSTIMME;So;0;L;;;;;N;;;;; 1D1A8;MUSICAL SYMBOL END OF STIMME;So;0;L;;;;;N;;;;; 1D1A9;MUSICAL SYMBOL DEGREE SLASH;So;0;L;;;;;N;;;;; 1D1AA;MUSICAL SYMBOL COMBINING DOWN BOW;Mn;230;NSM;;;;;N;;;;; 1D1AB;MUSICAL SYMBOL COMBINING UP BOW;Mn;230;NSM;;;;;N;;;;; 1D1AC;MUSICAL SYMBOL COMBINING HARMONIC;Mn;230;NSM;;;;;N;;;;; 1D1AD;MUSICAL SYMBOL COMBINING SNAP PIZZICATO;Mn;230;NSM;;;;;N;;;;; 1D1AE;MUSICAL SYMBOL PEDAL MARK;So;0;L;;;;;N;;;;; 1D1AF;MUSICAL SYMBOL PEDAL UP MARK;So;0;L;;;;;N;;;;; 1D1B0;MUSICAL SYMBOL HALF PEDAL MARK;So;0;L;;;;;N;;;;; 1D1B1;MUSICAL SYMBOL GLISSANDO UP;So;0;L;;;;;N;;;;; 1D1B2;MUSICAL SYMBOL GLISSANDO DOWN;So;0;L;;;;;N;;;;; 1D1B3;MUSICAL SYMBOL WITH FINGERNAILS;So;0;L;;;;;N;;;;; 1D1B4;MUSICAL SYMBOL DAMP;So;0;L;;;;;N;;;;; 1D1B5;MUSICAL SYMBOL DAMP ALL;So;0;L;;;;;N;;;;; 1D1B6;MUSICAL SYMBOL MAXIMA;So;0;L;;;;;N;;;;; 1D1B7;MUSICAL SYMBOL LONGA;So;0;L;;;;;N;;;;; 1D1B8;MUSICAL SYMBOL BREVIS;So;0;L;;;;;N;;;;; 1D1B9;MUSICAL SYMBOL SEMIBREVIS WHITE;So;0;L;;;;;N;;;;; 1D1BA;MUSICAL SYMBOL SEMIBREVIS BLACK;So;0;L;;;;;N;;;;; 1D1BB;MUSICAL SYMBOL MINIMA;So;0;L;1D1B9 1D165;;;;N;;;;; 1D1BC;MUSICAL SYMBOL MINIMA BLACK;So;0;L;1D1BA 1D165;;;;N;;;;; 1D1BD;MUSICAL SYMBOL SEMIMINIMA WHITE;So;0;L;1D1BB 1D16E;;;;N;;;;; 1D1BE;MUSICAL SYMBOL SEMIMINIMA BLACK;So;0;L;1D1BC 1D16E;;;;N;;;;; 1D1BF;MUSICAL SYMBOL FUSA WHITE;So;0;L;1D1BB 1D16F;;;;N;;;;; 1D1C0;MUSICAL SYMBOL FUSA BLACK;So;0;L;1D1BC 1D16F;;;;N;;;;; 1D1C1;MUSICAL SYMBOL LONGA PERFECTA REST;So;0;L;;;;;N;;;;; 1D1C2;MUSICAL SYMBOL LONGA IMPERFECTA REST;So;0;L;;;;;N;;;;; 1D1C3;MUSICAL SYMBOL BREVIS REST;So;0;L;;;;;N;;;;; 1D1C4;MUSICAL SYMBOL SEMIBREVIS REST;So;0;L;;;;;N;;;;; 1D1C5;MUSICAL SYMBOL MINIMA REST;So;0;L;;;;;N;;;;; 1D1C6;MUSICAL SYMBOL SEMIMINIMA REST;So;0;L;;;;;N;;;;; 1D1C7;MUSICAL SYMBOL TEMPUS PERFECTUM CUM PROLATIONE PERFECTA;So;0;L;;;;;N;;;;; 1D1C8;MUSICAL SYMBOL TEMPUS PERFECTUM CUM PROLATIONE IMPERFECTA;So;0;L;;;;;N;;;;; 1D1C9;MUSICAL SYMBOL TEMPUS PERFECTUM CUM PROLATIONE PERFECTA DIMINUTION-1;So;0;L;;;;;N;;;;; 1D1CA;MUSICAL SYMBOL TEMPUS IMPERFECTUM CUM PROLATIONE PERFECTA;So;0;L;;;;;N;;;;; 1D1CB;MUSICAL SYMBOL TEMPUS IMPERFECTUM CUM PROLATIONE IMPERFECTA;So;0;L;;;;;N;;;;; 1D1CC;MUSICAL SYMBOL TEMPUS IMPERFECTUM CUM PROLATIONE IMPERFECTA DIMINUTION-1;So;0;L;;;;;N;;;;; 1D1CD;MUSICAL SYMBOL TEMPUS IMPERFECTUM CUM PROLATIONE IMPERFECTA DIMINUTION-2;So;0;L;;;;;N;;;;; 1D1CE;MUSICAL SYMBOL TEMPUS IMPERFECTUM CUM PROLATIONE IMPERFECTA DIMINUTION-3;So;0;L;;;;;N;;;;; 1D1CF;MUSICAL SYMBOL CROIX;So;0;L;;;;;N;;;;; 1D1D0;MUSICAL SYMBOL GREGORIAN C CLEF;So;0;L;;;;;N;;;;; 1D1D1;MUSICAL SYMBOL GREGORIAN F CLEF;So;0;L;;;;;N;;;;; 1D1D2;MUSICAL SYMBOL SQUARE B;So;0;L;;;;;N;;;;; 1D1D3;MUSICAL SYMBOL VIRGA;So;0;L;;;;;N;;;;; 1D1D4;MUSICAL SYMBOL PODATUS;So;0;L;;;;;N;;;;; 1D1D5;MUSICAL SYMBOL CLIVIS;So;0;L;;;;;N;;;;; 1D1D6;MUSICAL SYMBOL SCANDICUS;So;0;L;;;;;N;;;;; 1D1D7;MUSICAL SYMBOL CLIMACUS;So;0;L;;;;;N;;;;; 1D1D8;MUSICAL SYMBOL TORCULUS;So;0;L;;;;;N;;;;; 1D1D9;MUSICAL SYMBOL PORRECTUS;So;0;L;;;;;N;;;;; 1D1DA;MUSICAL SYMBOL PORRECTUS FLEXUS;So;0;L;;;;;N;;;;; 1D1DB;MUSICAL SYMBOL SCANDICUS FLEXUS;So;0;L;;;;;N;;;;; 1D1DC;MUSICAL SYMBOL TORCULUS RESUPINUS;So;0;L;;;;;N;;;;; 1D1DD;MUSICAL SYMBOL PES SUBPUNCTIS;So;0;L;;;;;N;;;;; 1D200;GREEK VOCAL NOTATION SYMBOL-1;So;0;ON;;;;;N;;;;; 1D201;GREEK VOCAL NOTATION SYMBOL-2;So;0;ON;;;;;N;;;;; 1D202;GREEK VOCAL NOTATION SYMBOL-3;So;0;ON;;;;;N;;;;; 1D203;GREEK VOCAL NOTATION SYMBOL-4;So;0;ON;;;;;N;;;;; 1D204;GREEK VOCAL NOTATION SYMBOL-5;So;0;ON;;;;;N;;;;; 1D205;GREEK VOCAL NOTATION SYMBOL-6;So;0;ON;;;;;N;;;;; 1D206;GREEK VOCAL NOTATION SYMBOL-7;So;0;ON;;;;;N;;;;; 1D207;GREEK VOCAL NOTATION SYMBOL-8;So;0;ON;;;;;N;;;;; 1D208;GREEK VOCAL NOTATION SYMBOL-9;So;0;ON;;;;;N;;;;; 1D209;GREEK VOCAL NOTATION SYMBOL-10;So;0;ON;;;;;N;;;;; 1D20A;GREEK VOCAL NOTATION SYMBOL-11;So;0;ON;;;;;N;;;;; 1D20B;GREEK VOCAL NOTATION SYMBOL-12;So;0;ON;;;;;N;;;;; 1D20C;GREEK VOCAL NOTATION SYMBOL-13;So;0;ON;;;;;N;;;;; 1D20D;GREEK VOCAL NOTATION SYMBOL-14;So;0;ON;;;;;N;;;;; 1D20E;GREEK VOCAL NOTATION SYMBOL-15;So;0;ON;;;;;N;;;;; 1D20F;GREEK VOCAL NOTATION SYMBOL-16;So;0;ON;;;;;N;;;;; 1D210;GREEK VOCAL NOTATION SYMBOL-17;So;0;ON;;;;;N;;;;; 1D211;GREEK VOCAL NOTATION SYMBOL-18;So;0;ON;;;;;N;;;;; 1D212;GREEK VOCAL NOTATION SYMBOL-19;So;0;ON;;;;;N;;;;; 1D213;GREEK VOCAL NOTATION SYMBOL-20;So;0;ON;;;;;N;;;;; 1D214;GREEK VOCAL NOTATION SYMBOL-21;So;0;ON;;;;;N;;;;; 1D215;GREEK VOCAL NOTATION SYMBOL-22;So;0;ON;;;;;N;;;;; 1D216;GREEK VOCAL NOTATION SYMBOL-23;So;0;ON;;;;;N;;;;; 1D217;GREEK VOCAL NOTATION SYMBOL-24;So;0;ON;;;;;N;;;;; 1D218;GREEK VOCAL NOTATION SYMBOL-50;So;0;ON;;;;;N;;;;; 1D219;GREEK VOCAL NOTATION SYMBOL-51;So;0;ON;;;;;N;;;;; 1D21A;GREEK VOCAL NOTATION SYMBOL-52;So;0;ON;;;;;N;;;;; 1D21B;GREEK VOCAL NOTATION SYMBOL-53;So;0;ON;;;;;N;;;;; 1D21C;GREEK VOCAL NOTATION SYMBOL-54;So;0;ON;;;;;N;;;;; 1D21D;GREEK INSTRUMENTAL NOTATION SYMBOL-1;So;0;ON;;;;;N;;;;; 1D21E;GREEK INSTRUMENTAL NOTATION SYMBOL-2;So;0;ON;;;;;N;;;;; 1D21F;GREEK INSTRUMENTAL NOTATION SYMBOL-4;So;0;ON;;;;;N;;;;; 1D220;GREEK INSTRUMENTAL NOTATION SYMBOL-5;So;0;ON;;;;;N;;;;; 1D221;GREEK INSTRUMENTAL NOTATION SYMBOL-7;So;0;ON;;;;;N;;;;; 1D222;GREEK INSTRUMENTAL NOTATION SYMBOL-8;So;0;ON;;;;;N;;;;; 1D223;GREEK INSTRUMENTAL NOTATION SYMBOL-11;So;0;ON;;;;;N;;;;; 1D224;GREEK INSTRUMENTAL NOTATION SYMBOL-12;So;0;ON;;;;;N;;;;; 1D225;GREEK INSTRUMENTAL NOTATION SYMBOL-13;So;0;ON;;;;;N;;;;; 1D226;GREEK INSTRUMENTAL NOTATION SYMBOL-14;So;0;ON;;;;;N;;;;; 1D227;GREEK INSTRUMENTAL NOTATION SYMBOL-17;So;0;ON;;;;;N;;;;; 1D228;GREEK INSTRUMENTAL NOTATION SYMBOL-18;So;0;ON;;;;;N;;;;; 1D229;GREEK INSTRUMENTAL NOTATION SYMBOL-19;So;0;ON;;;;;N;;;;; 1D22A;GREEK INSTRUMENTAL NOTATION SYMBOL-23;So;0;ON;;;;;N;;;;; 1D22B;GREEK INSTRUMENTAL NOTATION SYMBOL-24;So;0;ON;;;;;N;;;;; 1D22C;GREEK INSTRUMENTAL NOTATION SYMBOL-25;So;0;ON;;;;;N;;;;; 1D22D;GREEK INSTRUMENTAL NOTATION SYMBOL-26;So;0;ON;;;;;N;;;;; 1D22E;GREEK INSTRUMENTAL NOTATION SYMBOL-27;So;0;ON;;;;;N;;;;; 1D22F;GREEK INSTRUMENTAL NOTATION SYMBOL-29;So;0;ON;;;;;N;;;;; 1D230;GREEK INSTRUMENTAL NOTATION SYMBOL-30;So;0;ON;;;;;N;;;;; 1D231;GREEK INSTRUMENTAL NOTATION SYMBOL-32;So;0;ON;;;;;N;;;;; 1D232;GREEK INSTRUMENTAL NOTATION SYMBOL-36;So;0;ON;;;;;N;;;;; 1D233;GREEK INSTRUMENTAL NOTATION SYMBOL-37;So;0;ON;;;;;N;;;;; 1D234;GREEK INSTRUMENTAL NOTATION SYMBOL-38;So;0;ON;;;;;N;;;;; 1D235;GREEK INSTRUMENTAL NOTATION SYMBOL-39;So;0;ON;;;;;N;;;;; 1D236;GREEK INSTRUMENTAL NOTATION SYMBOL-40;So;0;ON;;;;;N;;;;; 1D237;GREEK INSTRUMENTAL NOTATION SYMBOL-42;So;0;ON;;;;;N;;;;; 1D238;GREEK INSTRUMENTAL NOTATION SYMBOL-43;So;0;ON;;;;;N;;;;; 1D239;GREEK INSTRUMENTAL NOTATION SYMBOL-45;So;0;ON;;;;;N;;;;; 1D23A;GREEK INSTRUMENTAL NOTATION SYMBOL-47;So;0;ON;;;;;N;;;;; 1D23B;GREEK INSTRUMENTAL NOTATION SYMBOL-48;So;0;ON;;;;;N;;;;; 1D23C;GREEK INSTRUMENTAL NOTATION SYMBOL-49;So;0;ON;;;;;N;;;;; 1D23D;GREEK INSTRUMENTAL NOTATION SYMBOL-50;So;0;ON;;;;;N;;;;; 1D23E;GREEK INSTRUMENTAL NOTATION SYMBOL-51;So;0;ON;;;;;N;;;;; 1D23F;GREEK INSTRUMENTAL NOTATION SYMBOL-52;So;0;ON;;;;;N;;;;; 1D240;GREEK INSTRUMENTAL NOTATION SYMBOL-53;So;0;ON;;;;;N;;;;; 1D241;GREEK INSTRUMENTAL NOTATION SYMBOL-54;So;0;ON;;;;;N;;;;; 1D242;COMBINING GREEK MUSICAL TRISEME;Mn;230;NSM;;;;;N;;;;; 1D243;COMBINING GREEK MUSICAL TETRASEME;Mn;230;NSM;;;;;N;;;;; 1D244;COMBINING GREEK MUSICAL PENTASEME;Mn;230;NSM;;;;;N;;;;; 1D245;GREEK MUSICAL LEIMMA;So;0;ON;;;;;N;;;;; 1D300;MONOGRAM FOR EARTH;So;0;ON;;;;;N;;;;; 1D301;DIGRAM FOR HEAVENLY EARTH;So;0;ON;;;;;N;;;;; 1D302;DIGRAM FOR HUMAN EARTH;So;0;ON;;;;;N;;;;; 1D303;DIGRAM FOR EARTHLY HEAVEN;So;0;ON;;;;;N;;;;; 1D304;DIGRAM FOR EARTHLY HUMAN;So;0;ON;;;;;N;;;;; 1D305;DIGRAM FOR EARTH;So;0;ON;;;;;N;;;;; 1D306;TETRAGRAM FOR CENTRE;So;0;ON;;;;;N;;;;; 1D307;TETRAGRAM FOR FULL CIRCLE;So;0;ON;;;;;N;;;;; 1D308;TETRAGRAM FOR MIRED;So;0;ON;;;;;N;;;;; 1D309;TETRAGRAM FOR BARRIER;So;0;ON;;;;;N;;;;; 1D30A;TETRAGRAM FOR KEEPING SMALL;So;0;ON;;;;;N;;;;; 1D30B;TETRAGRAM FOR CONTRARIETY;So;0;ON;;;;;N;;;;; 1D30C;TETRAGRAM FOR ASCENT;So;0;ON;;;;;N;;;;; 1D30D;TETRAGRAM FOR OPPOSITION;So;0;ON;;;;;N;;;;; 1D30E;TETRAGRAM FOR BRANCHING OUT;So;0;ON;;;;;N;;;;; 1D30F;TETRAGRAM FOR DEFECTIVENESS OR DISTORTION;So;0;ON;;;;;N;;;;; 1D310;TETRAGRAM FOR DIVERGENCE;So;0;ON;;;;;N;;;;; 1D311;TETRAGRAM FOR YOUTHFULNESS;So;0;ON;;;;;N;;;;; 1D312;TETRAGRAM FOR INCREASE;So;0;ON;;;;;N;;;;; 1D313;TETRAGRAM FOR PENETRATION;So;0;ON;;;;;N;;;;; 1D314;TETRAGRAM FOR REACH;So;0;ON;;;;;N;;;;; 1D315;TETRAGRAM FOR CONTACT;So;0;ON;;;;;N;;;;; 1D316;TETRAGRAM FOR HOLDING BACK;So;0;ON;;;;;N;;;;; 1D317;TETRAGRAM FOR WAITING;So;0;ON;;;;;N;;;;; 1D318;TETRAGRAM FOR FOLLOWING;So;0;ON;;;;;N;;;;; 1D319;TETRAGRAM FOR ADVANCE;So;0;ON;;;;;N;;;;; 1D31A;TETRAGRAM FOR RELEASE;So;0;ON;;;;;N;;;;; 1D31B;TETRAGRAM FOR RESISTANCE;So;0;ON;;;;;N;;;;; 1D31C;TETRAGRAM FOR EASE;So;0;ON;;;;;N;;;;; 1D31D;TETRAGRAM FOR JOY;So;0;ON;;;;;N;;;;; 1D31E;TETRAGRAM FOR CONTENTION;So;0;ON;;;;;N;;;;; 1D31F;TETRAGRAM FOR ENDEAVOUR;So;0;ON;;;;;N;;;;; 1D320;TETRAGRAM FOR DUTIES;So;0;ON;;;;;N;;;;; 1D321;TETRAGRAM FOR CHANGE;So;0;ON;;;;;N;;;;; 1D322;TETRAGRAM FOR DECISIVENESS;So;0;ON;;;;;N;;;;; 1D323;TETRAGRAM FOR BOLD RESOLUTION;So;0;ON;;;;;N;;;;; 1D324;TETRAGRAM FOR PACKING;So;0;ON;;;;;N;;;;; 1D325;TETRAGRAM FOR LEGION;So;0;ON;;;;;N;;;;; 1D326;TETRAGRAM FOR CLOSENESS;So;0;ON;;;;;N;;;;; 1D327;TETRAGRAM FOR KINSHIP;So;0;ON;;;;;N;;;;; 1D328;TETRAGRAM FOR GATHERING;So;0;ON;;;;;N;;;;; 1D329;TETRAGRAM FOR STRENGTH;So;0;ON;;;;;N;;;;; 1D32A;TETRAGRAM FOR PURITY;So;0;ON;;;;;N;;;;; 1D32B;TETRAGRAM FOR FULLNESS;So;0;ON;;;;;N;;;;; 1D32C;TETRAGRAM FOR RESIDENCE;So;0;ON;;;;;N;;;;; 1D32D;TETRAGRAM FOR LAW OR MODEL;So;0;ON;;;;;N;;;;; 1D32E;TETRAGRAM FOR RESPONSE;So;0;ON;;;;;N;;;;; 1D32F;TETRAGRAM FOR GOING TO MEET;So;0;ON;;;;;N;;;;; 1D330;TETRAGRAM FOR ENCOUNTERS;So;0;ON;;;;;N;;;;; 1D331;TETRAGRAM FOR STOVE;So;0;ON;;;;;N;;;;; 1D332;TETRAGRAM FOR GREATNESS;So;0;ON;;;;;N;;;;; 1D333;TETRAGRAM FOR ENLARGEMENT;So;0;ON;;;;;N;;;;; 1D334;TETRAGRAM FOR PATTERN;So;0;ON;;;;;N;;;;; 1D335;TETRAGRAM FOR RITUAL;So;0;ON;;;;;N;;;;; 1D336;TETRAGRAM FOR FLIGHT;So;0;ON;;;;;N;;;;; 1D337;TETRAGRAM FOR VASTNESS OR WASTING;So;0;ON;;;;;N;;;;; 1D338;TETRAGRAM FOR CONSTANCY;So;0;ON;;;;;N;;;;; 1D339;TETRAGRAM FOR MEASURE;So;0;ON;;;;;N;;;;; 1D33A;TETRAGRAM FOR ETERNITY;So;0;ON;;;;;N;;;;; 1D33B;TETRAGRAM FOR UNITY;So;0;ON;;;;;N;;;;; 1D33C;TETRAGRAM FOR DIMINISHMENT;So;0;ON;;;;;N;;;;; 1D33D;TETRAGRAM FOR CLOSED MOUTH;So;0;ON;;;;;N;;;;; 1D33E;TETRAGRAM FOR GUARDEDNESS;So;0;ON;;;;;N;;;;; 1D33F;TETRAGRAM FOR GATHERING IN;So;0;ON;;;;;N;;;;; 1D340;TETRAGRAM FOR MASSING;So;0;ON;;;;;N;;;;; 1D341;TETRAGRAM FOR ACCUMULATION;So;0;ON;;;;;N;;;;; 1D342;TETRAGRAM FOR EMBELLISHMENT;So;0;ON;;;;;N;;;;; 1D343;TETRAGRAM FOR DOUBT;So;0;ON;;;;;N;;;;; 1D344;TETRAGRAM FOR WATCH;So;0;ON;;;;;N;;;;; 1D345;TETRAGRAM FOR SINKING;So;0;ON;;;;;N;;;;; 1D346;TETRAGRAM FOR INNER;So;0;ON;;;;;N;;;;; 1D347;TETRAGRAM FOR DEPARTURE;So;0;ON;;;;;N;;;;; 1D348;TETRAGRAM FOR DARKENING;So;0;ON;;;;;N;;;;; 1D349;TETRAGRAM FOR DIMMING;So;0;ON;;;;;N;;;;; 1D34A;TETRAGRAM FOR EXHAUSTION;So;0;ON;;;;;N;;;;; 1D34B;TETRAGRAM FOR SEVERANCE;So;0;ON;;;;;N;;;;; 1D34C;TETRAGRAM FOR STOPPAGE;So;0;ON;;;;;N;;;;; 1D34D;TETRAGRAM FOR HARDNESS;So;0;ON;;;;;N;;;;; 1D34E;TETRAGRAM FOR COMPLETION;So;0;ON;;;;;N;;;;; 1D34F;TETRAGRAM FOR CLOSURE;So;0;ON;;;;;N;;;;; 1D350;TETRAGRAM FOR FAILURE;So;0;ON;;;;;N;;;;; 1D351;TETRAGRAM FOR AGGRAVATION;So;0;ON;;;;;N;;;;; 1D352;TETRAGRAM FOR COMPLIANCE;So;0;ON;;;;;N;;;;; 1D353;TETRAGRAM FOR ON THE VERGE;So;0;ON;;;;;N;;;;; 1D354;TETRAGRAM FOR DIFFICULTIES;So;0;ON;;;;;N;;;;; 1D355;TETRAGRAM FOR LABOURING;So;0;ON;;;;;N;;;;; 1D356;TETRAGRAM FOR FOSTERING;So;0;ON;;;;;N;;;;; 1D360;COUNTING ROD UNIT DIGIT ONE;No;0;L;;;;1;N;;;;; 1D361;COUNTING ROD UNIT DIGIT TWO;No;0;L;;;;2;N;;;;; 1D362;COUNTING ROD UNIT DIGIT THREE;No;0;L;;;;3;N;;;;; 1D363;COUNTING ROD UNIT DIGIT FOUR;No;0;L;;;;4;N;;;;; 1D364;COUNTING ROD UNIT DIGIT FIVE;No;0;L;;;;5;N;;;;; 1D365;COUNTING ROD UNIT DIGIT SIX;No;0;L;;;;6;N;;;;; 1D366;COUNTING ROD UNIT DIGIT SEVEN;No;0;L;;;;7;N;;;;; 1D367;COUNTING ROD UNIT DIGIT EIGHT;No;0;L;;;;8;N;;;;; 1D368;COUNTING ROD UNIT DIGIT NINE;No;0;L;;;;9;N;;;;; 1D369;COUNTING ROD TENS DIGIT ONE;No;0;L;;;;10;N;;;;; 1D36A;COUNTING ROD TENS DIGIT TWO;No;0;L;;;;20;N;;;;; 1D36B;COUNTING ROD TENS DIGIT THREE;No;0;L;;;;30;N;;;;; 1D36C;COUNTING ROD TENS DIGIT FOUR;No;0;L;;;;40;N;;;;; 1D36D;COUNTING ROD TENS DIGIT FIVE;No;0;L;;;;50;N;;;;; 1D36E;COUNTING ROD TENS DIGIT SIX;No;0;L;;;;60;N;;;;; 1D36F;COUNTING ROD TENS DIGIT SEVEN;No;0;L;;;;70;N;;;;; 1D370;COUNTING ROD TENS DIGIT EIGHT;No;0;L;;;;80;N;;;;; 1D371;COUNTING ROD TENS DIGIT NINE;No;0;L;;;;90;N;;;;; 1D400;MATHEMATICAL BOLD CAPITAL A;Lu;0;L; 0041;;;;N;;;;; 1D401;MATHEMATICAL BOLD CAPITAL B;Lu;0;L; 0042;;;;N;;;;; 1D402;MATHEMATICAL BOLD CAPITAL C;Lu;0;L; 0043;;;;N;;;;; 1D403;MATHEMATICAL BOLD CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 1D404;MATHEMATICAL BOLD CAPITAL E;Lu;0;L; 0045;;;;N;;;;; 1D405;MATHEMATICAL BOLD CAPITAL F;Lu;0;L; 0046;;;;N;;;;; 1D406;MATHEMATICAL BOLD CAPITAL G;Lu;0;L; 0047;;;;N;;;;; 1D407;MATHEMATICAL BOLD CAPITAL H;Lu;0;L; 0048;;;;N;;;;; 1D408;MATHEMATICAL BOLD CAPITAL I;Lu;0;L; 0049;;;;N;;;;; 1D409;MATHEMATICAL BOLD CAPITAL J;Lu;0;L; 004A;;;;N;;;;; 1D40A;MATHEMATICAL BOLD CAPITAL K;Lu;0;L; 004B;;;;N;;;;; 1D40B;MATHEMATICAL BOLD CAPITAL L;Lu;0;L; 004C;;;;N;;;;; 1D40C;MATHEMATICAL BOLD CAPITAL M;Lu;0;L; 004D;;;;N;;;;; 1D40D;MATHEMATICAL BOLD CAPITAL N;Lu;0;L; 004E;;;;N;;;;; 1D40E;MATHEMATICAL BOLD CAPITAL O;Lu;0;L; 004F;;;;N;;;;; 1D40F;MATHEMATICAL BOLD CAPITAL P;Lu;0;L; 0050;;;;N;;;;; 1D410;MATHEMATICAL BOLD CAPITAL Q;Lu;0;L; 0051;;;;N;;;;; 1D411;MATHEMATICAL BOLD CAPITAL R;Lu;0;L; 0052;;;;N;;;;; 1D412;MATHEMATICAL BOLD CAPITAL S;Lu;0;L; 0053;;;;N;;;;; 1D413;MATHEMATICAL BOLD CAPITAL T;Lu;0;L; 0054;;;;N;;;;; 1D414;MATHEMATICAL BOLD CAPITAL U;Lu;0;L; 0055;;;;N;;;;; 1D415;MATHEMATICAL BOLD CAPITAL V;Lu;0;L; 0056;;;;N;;;;; 1D416;MATHEMATICAL BOLD CAPITAL W;Lu;0;L; 0057;;;;N;;;;; 1D417;MATHEMATICAL BOLD CAPITAL X;Lu;0;L; 0058;;;;N;;;;; 1D418;MATHEMATICAL BOLD CAPITAL Y;Lu;0;L; 0059;;;;N;;;;; 1D419;MATHEMATICAL BOLD CAPITAL Z;Lu;0;L; 005A;;;;N;;;;; 1D41A;MATHEMATICAL BOLD SMALL A;Ll;0;L; 0061;;;;N;;;;; 1D41B;MATHEMATICAL BOLD SMALL B;Ll;0;L; 0062;;;;N;;;;; 1D41C;MATHEMATICAL BOLD SMALL C;Ll;0;L; 0063;;;;N;;;;; 1D41D;MATHEMATICAL BOLD SMALL D;Ll;0;L; 0064;;;;N;;;;; 1D41E;MATHEMATICAL BOLD SMALL E;Ll;0;L; 0065;;;;N;;;;; 1D41F;MATHEMATICAL BOLD SMALL F;Ll;0;L; 0066;;;;N;;;;; 1D420;MATHEMATICAL BOLD SMALL G;Ll;0;L; 0067;;;;N;;;;; 1D421;MATHEMATICAL BOLD SMALL H;Ll;0;L; 0068;;;;N;;;;; 1D422;MATHEMATICAL BOLD SMALL I;Ll;0;L; 0069;;;;N;;;;; 1D423;MATHEMATICAL BOLD SMALL J;Ll;0;L; 006A;;;;N;;;;; 1D424;MATHEMATICAL BOLD SMALL K;Ll;0;L; 006B;;;;N;;;;; 1D425;MATHEMATICAL BOLD SMALL L;Ll;0;L; 006C;;;;N;;;;; 1D426;MATHEMATICAL BOLD SMALL M;Ll;0;L; 006D;;;;N;;;;; 1D427;MATHEMATICAL BOLD SMALL N;Ll;0;L; 006E;;;;N;;;;; 1D428;MATHEMATICAL BOLD SMALL O;Ll;0;L; 006F;;;;N;;;;; 1D429;MATHEMATICAL BOLD SMALL P;Ll;0;L; 0070;;;;N;;;;; 1D42A;MATHEMATICAL BOLD SMALL Q;Ll;0;L; 0071;;;;N;;;;; 1D42B;MATHEMATICAL BOLD SMALL R;Ll;0;L; 0072;;;;N;;;;; 1D42C;MATHEMATICAL BOLD SMALL S;Ll;0;L; 0073;;;;N;;;;; 1D42D;MATHEMATICAL BOLD SMALL T;Ll;0;L; 0074;;;;N;;;;; 1D42E;MATHEMATICAL BOLD SMALL U;Ll;0;L; 0075;;;;N;;;;; 1D42F;MATHEMATICAL BOLD SMALL V;Ll;0;L; 0076;;;;N;;;;; 1D430;MATHEMATICAL BOLD SMALL W;Ll;0;L; 0077;;;;N;;;;; 1D431;MATHEMATICAL BOLD SMALL X;Ll;0;L; 0078;;;;N;;;;; 1D432;MATHEMATICAL BOLD SMALL Y;Ll;0;L; 0079;;;;N;;;;; 1D433;MATHEMATICAL BOLD SMALL Z;Ll;0;L; 007A;;;;N;;;;; 1D434;MATHEMATICAL ITALIC CAPITAL A;Lu;0;L; 0041;;;;N;;;;; 1D435;MATHEMATICAL ITALIC CAPITAL B;Lu;0;L; 0042;;;;N;;;;; 1D436;MATHEMATICAL ITALIC CAPITAL C;Lu;0;L; 0043;;;;N;;;;; 1D437;MATHEMATICAL ITALIC CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 1D438;MATHEMATICAL ITALIC CAPITAL E;Lu;0;L; 0045;;;;N;;;;; 1D439;MATHEMATICAL ITALIC CAPITAL F;Lu;0;L; 0046;;;;N;;;;; 1D43A;MATHEMATICAL ITALIC CAPITAL G;Lu;0;L; 0047;;;;N;;;;; 1D43B;MATHEMATICAL ITALIC CAPITAL H;Lu;0;L; 0048;;;;N;;;;; 1D43C;MATHEMATICAL ITALIC CAPITAL I;Lu;0;L; 0049;;;;N;;;;; 1D43D;MATHEMATICAL ITALIC CAPITAL J;Lu;0;L; 004A;;;;N;;;;; 1D43E;MATHEMATICAL ITALIC CAPITAL K;Lu;0;L; 004B;;;;N;;;;; 1D43F;MATHEMATICAL ITALIC CAPITAL L;Lu;0;L; 004C;;;;N;;;;; 1D440;MATHEMATICAL ITALIC CAPITAL M;Lu;0;L; 004D;;;;N;;;;; 1D441;MATHEMATICAL ITALIC CAPITAL N;Lu;0;L; 004E;;;;N;;;;; 1D442;MATHEMATICAL ITALIC CAPITAL O;Lu;0;L; 004F;;;;N;;;;; 1D443;MATHEMATICAL ITALIC CAPITAL P;Lu;0;L; 0050;;;;N;;;;; 1D444;MATHEMATICAL ITALIC CAPITAL Q;Lu;0;L; 0051;;;;N;;;;; 1D445;MATHEMATICAL ITALIC CAPITAL R;Lu;0;L; 0052;;;;N;;;;; 1D446;MATHEMATICAL ITALIC CAPITAL S;Lu;0;L; 0053;;;;N;;;;; 1D447;MATHEMATICAL ITALIC CAPITAL T;Lu;0;L; 0054;;;;N;;;;; 1D448;MATHEMATICAL ITALIC CAPITAL U;Lu;0;L; 0055;;;;N;;;;; 1D449;MATHEMATICAL ITALIC CAPITAL V;Lu;0;L; 0056;;;;N;;;;; 1D44A;MATHEMATICAL ITALIC CAPITAL W;Lu;0;L; 0057;;;;N;;;;; 1D44B;MATHEMATICAL ITALIC CAPITAL X;Lu;0;L; 0058;;;;N;;;;; 1D44C;MATHEMATICAL ITALIC CAPITAL Y;Lu;0;L; 0059;;;;N;;;;; 1D44D;MATHEMATICAL ITALIC CAPITAL Z;Lu;0;L; 005A;;;;N;;;;; 1D44E;MATHEMATICAL ITALIC SMALL A;Ll;0;L; 0061;;;;N;;;;; 1D44F;MATHEMATICAL ITALIC SMALL B;Ll;0;L; 0062;;;;N;;;;; 1D450;MATHEMATICAL ITALIC SMALL C;Ll;0;L; 0063;;;;N;;;;; 1D451;MATHEMATICAL ITALIC SMALL D;Ll;0;L; 0064;;;;N;;;;; 1D452;MATHEMATICAL ITALIC SMALL E;Ll;0;L; 0065;;;;N;;;;; 1D453;MATHEMATICAL ITALIC SMALL F;Ll;0;L; 0066;;;;N;;;;; 1D454;MATHEMATICAL ITALIC SMALL G;Ll;0;L; 0067;;;;N;;;;; 1D456;MATHEMATICAL ITALIC SMALL I;Ll;0;L; 0069;;;;N;;;;; 1D457;MATHEMATICAL ITALIC SMALL J;Ll;0;L; 006A;;;;N;;;;; 1D458;MATHEMATICAL ITALIC SMALL K;Ll;0;L; 006B;;;;N;;;;; 1D459;MATHEMATICAL ITALIC SMALL L;Ll;0;L; 006C;;;;N;;;;; 1D45A;MATHEMATICAL ITALIC SMALL M;Ll;0;L; 006D;;;;N;;;;; 1D45B;MATHEMATICAL ITALIC SMALL N;Ll;0;L; 006E;;;;N;;;;; 1D45C;MATHEMATICAL ITALIC SMALL O;Ll;0;L; 006F;;;;N;;;;; 1D45D;MATHEMATICAL ITALIC SMALL P;Ll;0;L; 0070;;;;N;;;;; 1D45E;MATHEMATICAL ITALIC SMALL Q;Ll;0;L; 0071;;;;N;;;;; 1D45F;MATHEMATICAL ITALIC SMALL R;Ll;0;L; 0072;;;;N;;;;; 1D460;MATHEMATICAL ITALIC SMALL S;Ll;0;L; 0073;;;;N;;;;; 1D461;MATHEMATICAL ITALIC SMALL T;Ll;0;L; 0074;;;;N;;;;; 1D462;MATHEMATICAL ITALIC SMALL U;Ll;0;L; 0075;;;;N;;;;; 1D463;MATHEMATICAL ITALIC SMALL V;Ll;0;L; 0076;;;;N;;;;; 1D464;MATHEMATICAL ITALIC SMALL W;Ll;0;L; 0077;;;;N;;;;; 1D465;MATHEMATICAL ITALIC SMALL X;Ll;0;L; 0078;;;;N;;;;; 1D466;MATHEMATICAL ITALIC SMALL Y;Ll;0;L; 0079;;;;N;;;;; 1D467;MATHEMATICAL ITALIC SMALL Z;Ll;0;L; 007A;;;;N;;;;; 1D468;MATHEMATICAL BOLD ITALIC CAPITAL A;Lu;0;L; 0041;;;;N;;;;; 1D469;MATHEMATICAL BOLD ITALIC CAPITAL B;Lu;0;L; 0042;;;;N;;;;; 1D46A;MATHEMATICAL BOLD ITALIC CAPITAL C;Lu;0;L; 0043;;;;N;;;;; 1D46B;MATHEMATICAL BOLD ITALIC CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 1D46C;MATHEMATICAL BOLD ITALIC CAPITAL E;Lu;0;L; 0045;;;;N;;;;; 1D46D;MATHEMATICAL BOLD ITALIC CAPITAL F;Lu;0;L; 0046;;;;N;;;;; 1D46E;MATHEMATICAL BOLD ITALIC CAPITAL G;Lu;0;L; 0047;;;;N;;;;; 1D46F;MATHEMATICAL BOLD ITALIC CAPITAL H;Lu;0;L; 0048;;;;N;;;;; 1D470;MATHEMATICAL BOLD ITALIC CAPITAL I;Lu;0;L; 0049;;;;N;;;;; 1D471;MATHEMATICAL BOLD ITALIC CAPITAL J;Lu;0;L; 004A;;;;N;;;;; 1D472;MATHEMATICAL BOLD ITALIC CAPITAL K;Lu;0;L; 004B;;;;N;;;;; 1D473;MATHEMATICAL BOLD ITALIC CAPITAL L;Lu;0;L; 004C;;;;N;;;;; 1D474;MATHEMATICAL BOLD ITALIC CAPITAL M;Lu;0;L; 004D;;;;N;;;;; 1D475;MATHEMATICAL BOLD ITALIC CAPITAL N;Lu;0;L; 004E;;;;N;;;;; 1D476;MATHEMATICAL BOLD ITALIC CAPITAL O;Lu;0;L; 004F;;;;N;;;;; 1D477;MATHEMATICAL BOLD ITALIC CAPITAL P;Lu;0;L; 0050;;;;N;;;;; 1D478;MATHEMATICAL BOLD ITALIC CAPITAL Q;Lu;0;L; 0051;;;;N;;;;; 1D479;MATHEMATICAL BOLD ITALIC CAPITAL R;Lu;0;L; 0052;;;;N;;;;; 1D47A;MATHEMATICAL BOLD ITALIC CAPITAL S;Lu;0;L; 0053;;;;N;;;;; 1D47B;MATHEMATICAL BOLD ITALIC CAPITAL T;Lu;0;L; 0054;;;;N;;;;; 1D47C;MATHEMATICAL BOLD ITALIC CAPITAL U;Lu;0;L; 0055;;;;N;;;;; 1D47D;MATHEMATICAL BOLD ITALIC CAPITAL V;Lu;0;L; 0056;;;;N;;;;; 1D47E;MATHEMATICAL BOLD ITALIC CAPITAL W;Lu;0;L; 0057;;;;N;;;;; 1D47F;MATHEMATICAL BOLD ITALIC CAPITAL X;Lu;0;L; 0058;;;;N;;;;; 1D480;MATHEMATICAL BOLD ITALIC CAPITAL Y;Lu;0;L; 0059;;;;N;;;;; 1D481;MATHEMATICAL BOLD ITALIC CAPITAL Z;Lu;0;L; 005A;;;;N;;;;; 1D482;MATHEMATICAL BOLD ITALIC SMALL A;Ll;0;L; 0061;;;;N;;;;; 1D483;MATHEMATICAL BOLD ITALIC SMALL B;Ll;0;L; 0062;;;;N;;;;; 1D484;MATHEMATICAL BOLD ITALIC SMALL C;Ll;0;L; 0063;;;;N;;;;; 1D485;MATHEMATICAL BOLD ITALIC SMALL D;Ll;0;L; 0064;;;;N;;;;; 1D486;MATHEMATICAL BOLD ITALIC SMALL E;Ll;0;L; 0065;;;;N;;;;; 1D487;MATHEMATICAL BOLD ITALIC SMALL F;Ll;0;L; 0066;;;;N;;;;; 1D488;MATHEMATICAL BOLD ITALIC SMALL G;Ll;0;L; 0067;;;;N;;;;; 1D489;MATHEMATICAL BOLD ITALIC SMALL H;Ll;0;L; 0068;;;;N;;;;; 1D48A;MATHEMATICAL BOLD ITALIC SMALL I;Ll;0;L; 0069;;;;N;;;;; 1D48B;MATHEMATICAL BOLD ITALIC SMALL J;Ll;0;L; 006A;;;;N;;;;; 1D48C;MATHEMATICAL BOLD ITALIC SMALL K;Ll;0;L; 006B;;;;N;;;;; 1D48D;MATHEMATICAL BOLD ITALIC SMALL L;Ll;0;L; 006C;;;;N;;;;; 1D48E;MATHEMATICAL BOLD ITALIC SMALL M;Ll;0;L; 006D;;;;N;;;;; 1D48F;MATHEMATICAL BOLD ITALIC SMALL N;Ll;0;L; 006E;;;;N;;;;; 1D490;MATHEMATICAL BOLD ITALIC SMALL O;Ll;0;L; 006F;;;;N;;;;; 1D491;MATHEMATICAL BOLD ITALIC SMALL P;Ll;0;L; 0070;;;;N;;;;; 1D492;MATHEMATICAL BOLD ITALIC SMALL Q;Ll;0;L; 0071;;;;N;;;;; 1D493;MATHEMATICAL BOLD ITALIC SMALL R;Ll;0;L; 0072;;;;N;;;;; 1D494;MATHEMATICAL BOLD ITALIC SMALL S;Ll;0;L; 0073;;;;N;;;;; 1D495;MATHEMATICAL BOLD ITALIC SMALL T;Ll;0;L; 0074;;;;N;;;;; 1D496;MATHEMATICAL BOLD ITALIC SMALL U;Ll;0;L; 0075;;;;N;;;;; 1D497;MATHEMATICAL BOLD ITALIC SMALL V;Ll;0;L; 0076;;;;N;;;;; 1D498;MATHEMATICAL BOLD ITALIC SMALL W;Ll;0;L; 0077;;;;N;;;;; 1D499;MATHEMATICAL BOLD ITALIC SMALL X;Ll;0;L; 0078;;;;N;;;;; 1D49A;MATHEMATICAL BOLD ITALIC SMALL Y;Ll;0;L; 0079;;;;N;;;;; 1D49B;MATHEMATICAL BOLD ITALIC SMALL Z;Ll;0;L; 007A;;;;N;;;;; 1D49C;MATHEMATICAL SCRIPT CAPITAL A;Lu;0;L; 0041;;;;N;;;;; 1D49E;MATHEMATICAL SCRIPT CAPITAL C;Lu;0;L; 0043;;;;N;;;;; 1D49F;MATHEMATICAL SCRIPT CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 1D4A2;MATHEMATICAL SCRIPT CAPITAL G;Lu;0;L; 0047;;;;N;;;;; 1D4A5;MATHEMATICAL SCRIPT CAPITAL J;Lu;0;L; 004A;;;;N;;;;; 1D4A6;MATHEMATICAL SCRIPT CAPITAL K;Lu;0;L; 004B;;;;N;;;;; 1D4A9;MATHEMATICAL SCRIPT CAPITAL N;Lu;0;L; 004E;;;;N;;;;; 1D4AA;MATHEMATICAL SCRIPT CAPITAL O;Lu;0;L; 004F;;;;N;;;;; 1D4AB;MATHEMATICAL SCRIPT CAPITAL P;Lu;0;L; 0050;;;;N;;;;; 1D4AC;MATHEMATICAL SCRIPT CAPITAL Q;Lu;0;L; 0051;;;;N;;;;; 1D4AE;MATHEMATICAL SCRIPT CAPITAL S;Lu;0;L; 0053;;;;N;;;;; 1D4AF;MATHEMATICAL SCRIPT CAPITAL T;Lu;0;L; 0054;;;;N;;;;; 1D4B0;MATHEMATICAL SCRIPT CAPITAL U;Lu;0;L; 0055;;;;N;;;;; 1D4B1;MATHEMATICAL SCRIPT CAPITAL V;Lu;0;L; 0056;;;;N;;;;; 1D4B2;MATHEMATICAL SCRIPT CAPITAL W;Lu;0;L; 0057;;;;N;;;;; 1D4B3;MATHEMATICAL SCRIPT CAPITAL X;Lu;0;L; 0058;;;;N;;;;; 1D4B4;MATHEMATICAL SCRIPT CAPITAL Y;Lu;0;L; 0059;;;;N;;;;; 1D4B5;MATHEMATICAL SCRIPT CAPITAL Z;Lu;0;L; 005A;;;;N;;;;; 1D4B6;MATHEMATICAL SCRIPT SMALL A;Ll;0;L; 0061;;;;N;;;;; 1D4B7;MATHEMATICAL SCRIPT SMALL B;Ll;0;L; 0062;;;;N;;;;; 1D4B8;MATHEMATICAL SCRIPT SMALL C;Ll;0;L; 0063;;;;N;;;;; 1D4B9;MATHEMATICAL SCRIPT SMALL D;Ll;0;L; 0064;;;;N;;;;; 1D4BB;MATHEMATICAL SCRIPT SMALL F;Ll;0;L; 0066;;;;N;;;;; 1D4BD;MATHEMATICAL SCRIPT SMALL H;Ll;0;L; 0068;;;;N;;;;; 1D4BE;MATHEMATICAL SCRIPT SMALL I;Ll;0;L; 0069;;;;N;;;;; 1D4BF;MATHEMATICAL SCRIPT SMALL J;Ll;0;L; 006A;;;;N;;;;; 1D4C0;MATHEMATICAL SCRIPT SMALL K;Ll;0;L; 006B;;;;N;;;;; 1D4C1;MATHEMATICAL SCRIPT SMALL L;Ll;0;L; 006C;;;;N;;;;; 1D4C2;MATHEMATICAL SCRIPT SMALL M;Ll;0;L; 006D;;;;N;;;;; 1D4C3;MATHEMATICAL SCRIPT SMALL N;Ll;0;L; 006E;;;;N;;;;; 1D4C5;MATHEMATICAL SCRIPT SMALL P;Ll;0;L; 0070;;;;N;;;;; 1D4C6;MATHEMATICAL SCRIPT SMALL Q;Ll;0;L; 0071;;;;N;;;;; 1D4C7;MATHEMATICAL SCRIPT SMALL R;Ll;0;L; 0072;;;;N;;;;; 1D4C8;MATHEMATICAL SCRIPT SMALL S;Ll;0;L; 0073;;;;N;;;;; 1D4C9;MATHEMATICAL SCRIPT SMALL T;Ll;0;L; 0074;;;;N;;;;; 1D4CA;MATHEMATICAL SCRIPT SMALL U;Ll;0;L; 0075;;;;N;;;;; 1D4CB;MATHEMATICAL SCRIPT SMALL V;Ll;0;L; 0076;;;;N;;;;; 1D4CC;MATHEMATICAL SCRIPT SMALL W;Ll;0;L; 0077;;;;N;;;;; 1D4CD;MATHEMATICAL SCRIPT SMALL X;Ll;0;L; 0078;;;;N;;;;; 1D4CE;MATHEMATICAL SCRIPT SMALL Y;Ll;0;L; 0079;;;;N;;;;; 1D4CF;MATHEMATICAL SCRIPT SMALL Z;Ll;0;L; 007A;;;;N;;;;; 1D4D0;MATHEMATICAL BOLD SCRIPT CAPITAL A;Lu;0;L; 0041;;;;N;;;;; 1D4D1;MATHEMATICAL BOLD SCRIPT CAPITAL B;Lu;0;L; 0042;;;;N;;;;; 1D4D2;MATHEMATICAL BOLD SCRIPT CAPITAL C;Lu;0;L; 0043;;;;N;;;;; 1D4D3;MATHEMATICAL BOLD SCRIPT CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 1D4D4;MATHEMATICAL BOLD SCRIPT CAPITAL E;Lu;0;L; 0045;;;;N;;;;; 1D4D5;MATHEMATICAL BOLD SCRIPT CAPITAL F;Lu;0;L; 0046;;;;N;;;;; 1D4D6;MATHEMATICAL BOLD SCRIPT CAPITAL G;Lu;0;L; 0047;;;;N;;;;; 1D4D7;MATHEMATICAL BOLD SCRIPT CAPITAL H;Lu;0;L; 0048;;;;N;;;;; 1D4D8;MATHEMATICAL BOLD SCRIPT CAPITAL I;Lu;0;L; 0049;;;;N;;;;; 1D4D9;MATHEMATICAL BOLD SCRIPT CAPITAL J;Lu;0;L; 004A;;;;N;;;;; 1D4DA;MATHEMATICAL BOLD SCRIPT CAPITAL K;Lu;0;L; 004B;;;;N;;;;; 1D4DB;MATHEMATICAL BOLD SCRIPT CAPITAL L;Lu;0;L; 004C;;;;N;;;;; 1D4DC;MATHEMATICAL BOLD SCRIPT CAPITAL M;Lu;0;L; 004D;;;;N;;;;; 1D4DD;MATHEMATICAL BOLD SCRIPT CAPITAL N;Lu;0;L; 004E;;;;N;;;;; 1D4DE;MATHEMATICAL BOLD SCRIPT CAPITAL O;Lu;0;L; 004F;;;;N;;;;; 1D4DF;MATHEMATICAL BOLD SCRIPT CAPITAL P;Lu;0;L; 0050;;;;N;;;;; 1D4E0;MATHEMATICAL BOLD SCRIPT CAPITAL Q;Lu;0;L; 0051;;;;N;;;;; 1D4E1;MATHEMATICAL BOLD SCRIPT CAPITAL R;Lu;0;L; 0052;;;;N;;;;; 1D4E2;MATHEMATICAL BOLD SCRIPT CAPITAL S;Lu;0;L; 0053;;;;N;;;;; 1D4E3;MATHEMATICAL BOLD SCRIPT CAPITAL T;Lu;0;L; 0054;;;;N;;;;; 1D4E4;MATHEMATICAL BOLD SCRIPT CAPITAL U;Lu;0;L; 0055;;;;N;;;;; 1D4E5;MATHEMATICAL BOLD SCRIPT CAPITAL V;Lu;0;L; 0056;;;;N;;;;; 1D4E6;MATHEMATICAL BOLD SCRIPT CAPITAL W;Lu;0;L; 0057;;;;N;;;;; 1D4E7;MATHEMATICAL BOLD SCRIPT CAPITAL X;Lu;0;L; 0058;;;;N;;;;; 1D4E8;MATHEMATICAL BOLD SCRIPT CAPITAL Y;Lu;0;L; 0059;;;;N;;;;; 1D4E9;MATHEMATICAL BOLD SCRIPT CAPITAL Z;Lu;0;L; 005A;;;;N;;;;; 1D4EA;MATHEMATICAL BOLD SCRIPT SMALL A;Ll;0;L; 0061;;;;N;;;;; 1D4EB;MATHEMATICAL BOLD SCRIPT SMALL B;Ll;0;L; 0062;;;;N;;;;; 1D4EC;MATHEMATICAL BOLD SCRIPT SMALL C;Ll;0;L; 0063;;;;N;;;;; 1D4ED;MATHEMATICAL BOLD SCRIPT SMALL D;Ll;0;L; 0064;;;;N;;;;; 1D4EE;MATHEMATICAL BOLD SCRIPT SMALL E;Ll;0;L; 0065;;;;N;;;;; 1D4EF;MATHEMATICAL BOLD SCRIPT SMALL F;Ll;0;L; 0066;;;;N;;;;; 1D4F0;MATHEMATICAL BOLD SCRIPT SMALL G;Ll;0;L; 0067;;;;N;;;;; 1D4F1;MATHEMATICAL BOLD SCRIPT SMALL H;Ll;0;L; 0068;;;;N;;;;; 1D4F2;MATHEMATICAL BOLD SCRIPT SMALL I;Ll;0;L; 0069;;;;N;;;;; 1D4F3;MATHEMATICAL BOLD SCRIPT SMALL J;Ll;0;L; 006A;;;;N;;;;; 1D4F4;MATHEMATICAL BOLD SCRIPT SMALL K;Ll;0;L; 006B;;;;N;;;;; 1D4F5;MATHEMATICAL BOLD SCRIPT SMALL L;Ll;0;L; 006C;;;;N;;;;; 1D4F6;MATHEMATICAL BOLD SCRIPT SMALL M;Ll;0;L; 006D;;;;N;;;;; 1D4F7;MATHEMATICAL BOLD SCRIPT SMALL N;Ll;0;L; 006E;;;;N;;;;; 1D4F8;MATHEMATICAL BOLD SCRIPT SMALL O;Ll;0;L; 006F;;;;N;;;;; 1D4F9;MATHEMATICAL BOLD SCRIPT SMALL P;Ll;0;L; 0070;;;;N;;;;; 1D4FA;MATHEMATICAL BOLD SCRIPT SMALL Q;Ll;0;L; 0071;;;;N;;;;; 1D4FB;MATHEMATICAL BOLD SCRIPT SMALL R;Ll;0;L; 0072;;;;N;;;;; 1D4FC;MATHEMATICAL BOLD SCRIPT SMALL S;Ll;0;L; 0073;;;;N;;;;; 1D4FD;MATHEMATICAL BOLD SCRIPT SMALL T;Ll;0;L; 0074;;;;N;;;;; 1D4FE;MATHEMATICAL BOLD SCRIPT SMALL U;Ll;0;L; 0075;;;;N;;;;; 1D4FF;MATHEMATICAL BOLD SCRIPT SMALL V;Ll;0;L; 0076;;;;N;;;;; 1D500;MATHEMATICAL BOLD SCRIPT SMALL W;Ll;0;L; 0077;;;;N;;;;; 1D501;MATHEMATICAL BOLD SCRIPT SMALL X;Ll;0;L; 0078;;;;N;;;;; 1D502;MATHEMATICAL BOLD SCRIPT SMALL Y;Ll;0;L; 0079;;;;N;;;;; 1D503;MATHEMATICAL BOLD SCRIPT SMALL Z;Ll;0;L; 007A;;;;N;;;;; 1D504;MATHEMATICAL FRAKTUR CAPITAL A;Lu;0;L; 0041;;;;N;;;;; 1D505;MATHEMATICAL FRAKTUR CAPITAL B;Lu;0;L; 0042;;;;N;;;;; 1D507;MATHEMATICAL FRAKTUR CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 1D508;MATHEMATICAL FRAKTUR CAPITAL E;Lu;0;L; 0045;;;;N;;;;; 1D509;MATHEMATICAL FRAKTUR CAPITAL F;Lu;0;L; 0046;;;;N;;;;; 1D50A;MATHEMATICAL FRAKTUR CAPITAL G;Lu;0;L; 0047;;;;N;;;;; 1D50D;MATHEMATICAL FRAKTUR CAPITAL J;Lu;0;L; 004A;;;;N;;;;; 1D50E;MATHEMATICAL FRAKTUR CAPITAL K;Lu;0;L; 004B;;;;N;;;;; 1D50F;MATHEMATICAL FRAKTUR CAPITAL L;Lu;0;L; 004C;;;;N;;;;; 1D510;MATHEMATICAL FRAKTUR CAPITAL M;Lu;0;L; 004D;;;;N;;;;; 1D511;MATHEMATICAL FRAKTUR CAPITAL N;Lu;0;L; 004E;;;;N;;;;; 1D512;MATHEMATICAL FRAKTUR CAPITAL O;Lu;0;L; 004F;;;;N;;;;; 1D513;MATHEMATICAL FRAKTUR CAPITAL P;Lu;0;L; 0050;;;;N;;;;; 1D514;MATHEMATICAL FRAKTUR CAPITAL Q;Lu;0;L; 0051;;;;N;;;;; 1D516;MATHEMATICAL FRAKTUR CAPITAL S;Lu;0;L; 0053;;;;N;;;;; 1D517;MATHEMATICAL FRAKTUR CAPITAL T;Lu;0;L; 0054;;;;N;;;;; 1D518;MATHEMATICAL FRAKTUR CAPITAL U;Lu;0;L; 0055;;;;N;;;;; 1D519;MATHEMATICAL FRAKTUR CAPITAL V;Lu;0;L; 0056;;;;N;;;;; 1D51A;MATHEMATICAL FRAKTUR CAPITAL W;Lu;0;L; 0057;;;;N;;;;; 1D51B;MATHEMATICAL FRAKTUR CAPITAL X;Lu;0;L; 0058;;;;N;;;;; 1D51C;MATHEMATICAL FRAKTUR CAPITAL Y;Lu;0;L; 0059;;;;N;;;;; 1D51E;MATHEMATICAL FRAKTUR SMALL A;Ll;0;L; 0061;;;;N;;;;; 1D51F;MATHEMATICAL FRAKTUR SMALL B;Ll;0;L; 0062;;;;N;;;;; 1D520;MATHEMATICAL FRAKTUR SMALL C;Ll;0;L; 0063;;;;N;;;;; 1D521;MATHEMATICAL FRAKTUR SMALL D;Ll;0;L; 0064;;;;N;;;;; 1D522;MATHEMATICAL FRAKTUR SMALL E;Ll;0;L; 0065;;;;N;;;;; 1D523;MATHEMATICAL FRAKTUR SMALL F;Ll;0;L; 0066;;;;N;;;;; 1D524;MATHEMATICAL FRAKTUR SMALL G;Ll;0;L; 0067;;;;N;;;;; 1D525;MATHEMATICAL FRAKTUR SMALL H;Ll;0;L; 0068;;;;N;;;;; 1D526;MATHEMATICAL FRAKTUR SMALL I;Ll;0;L; 0069;;;;N;;;;; 1D527;MATHEMATICAL FRAKTUR SMALL J;Ll;0;L; 006A;;;;N;;;;; 1D528;MATHEMATICAL FRAKTUR SMALL K;Ll;0;L; 006B;;;;N;;;;; 1D529;MATHEMATICAL FRAKTUR SMALL L;Ll;0;L; 006C;;;;N;;;;; 1D52A;MATHEMATICAL FRAKTUR SMALL M;Ll;0;L; 006D;;;;N;;;;; 1D52B;MATHEMATICAL FRAKTUR SMALL N;Ll;0;L; 006E;;;;N;;;;; 1D52C;MATHEMATICAL FRAKTUR SMALL O;Ll;0;L; 006F;;;;N;;;;; 1D52D;MATHEMATICAL FRAKTUR SMALL P;Ll;0;L; 0070;;;;N;;;;; 1D52E;MATHEMATICAL FRAKTUR SMALL Q;Ll;0;L; 0071;;;;N;;;;; 1D52F;MATHEMATICAL FRAKTUR SMALL R;Ll;0;L; 0072;;;;N;;;;; 1D530;MATHEMATICAL FRAKTUR SMALL S;Ll;0;L; 0073;;;;N;;;;; 1D531;MATHEMATICAL FRAKTUR SMALL T;Ll;0;L; 0074;;;;N;;;;; 1D532;MATHEMATICAL FRAKTUR SMALL U;Ll;0;L; 0075;;;;N;;;;; 1D533;MATHEMATICAL FRAKTUR SMALL V;Ll;0;L; 0076;;;;N;;;;; 1D534;MATHEMATICAL FRAKTUR SMALL W;Ll;0;L; 0077;;;;N;;;;; 1D535;MATHEMATICAL FRAKTUR SMALL X;Ll;0;L; 0078;;;;N;;;;; 1D536;MATHEMATICAL FRAKTUR SMALL Y;Ll;0;L; 0079;;;;N;;;;; 1D537;MATHEMATICAL FRAKTUR SMALL Z;Ll;0;L; 007A;;;;N;;;;; 1D538;MATHEMATICAL DOUBLE-STRUCK CAPITAL A;Lu;0;L; 0041;;;;N;;;;; 1D539;MATHEMATICAL DOUBLE-STRUCK CAPITAL B;Lu;0;L; 0042;;;;N;;;;; 1D53B;MATHEMATICAL DOUBLE-STRUCK CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 1D53C;MATHEMATICAL DOUBLE-STRUCK CAPITAL E;Lu;0;L; 0045;;;;N;;;;; 1D53D;MATHEMATICAL DOUBLE-STRUCK CAPITAL F;Lu;0;L; 0046;;;;N;;;;; 1D53E;MATHEMATICAL DOUBLE-STRUCK CAPITAL G;Lu;0;L; 0047;;;;N;;;;; 1D540;MATHEMATICAL DOUBLE-STRUCK CAPITAL I;Lu;0;L; 0049;;;;N;;;;; 1D541;MATHEMATICAL DOUBLE-STRUCK CAPITAL J;Lu;0;L; 004A;;;;N;;;;; 1D542;MATHEMATICAL DOUBLE-STRUCK CAPITAL K;Lu;0;L; 004B;;;;N;;;;; 1D543;MATHEMATICAL DOUBLE-STRUCK CAPITAL L;Lu;0;L; 004C;;;;N;;;;; 1D544;MATHEMATICAL DOUBLE-STRUCK CAPITAL M;Lu;0;L; 004D;;;;N;;;;; 1D546;MATHEMATICAL DOUBLE-STRUCK CAPITAL O;Lu;0;L; 004F;;;;N;;;;; 1D54A;MATHEMATICAL DOUBLE-STRUCK CAPITAL S;Lu;0;L; 0053;;;;N;;;;; 1D54B;MATHEMATICAL DOUBLE-STRUCK CAPITAL T;Lu;0;L; 0054;;;;N;;;;; 1D54C;MATHEMATICAL DOUBLE-STRUCK CAPITAL U;Lu;0;L; 0055;;;;N;;;;; 1D54D;MATHEMATICAL DOUBLE-STRUCK CAPITAL V;Lu;0;L; 0056;;;;N;;;;; 1D54E;MATHEMATICAL DOUBLE-STRUCK CAPITAL W;Lu;0;L; 0057;;;;N;;;;; 1D54F;MATHEMATICAL DOUBLE-STRUCK CAPITAL X;Lu;0;L; 0058;;;;N;;;;; 1D550;MATHEMATICAL DOUBLE-STRUCK CAPITAL Y;Lu;0;L; 0059;;;;N;;;;; 1D552;MATHEMATICAL DOUBLE-STRUCK SMALL A;Ll;0;L; 0061;;;;N;;;;; 1D553;MATHEMATICAL DOUBLE-STRUCK SMALL B;Ll;0;L; 0062;;;;N;;;;; 1D554;MATHEMATICAL DOUBLE-STRUCK SMALL C;Ll;0;L; 0063;;;;N;;;;; 1D555;MATHEMATICAL DOUBLE-STRUCK SMALL D;Ll;0;L; 0064;;;;N;;;;; 1D556;MATHEMATICAL DOUBLE-STRUCK SMALL E;Ll;0;L; 0065;;;;N;;;;; 1D557;MATHEMATICAL DOUBLE-STRUCK SMALL F;Ll;0;L; 0066;;;;N;;;;; 1D558;MATHEMATICAL DOUBLE-STRUCK SMALL G;Ll;0;L; 0067;;;;N;;;;; 1D559;MATHEMATICAL DOUBLE-STRUCK SMALL H;Ll;0;L; 0068;;;;N;;;;; 1D55A;MATHEMATICAL DOUBLE-STRUCK SMALL I;Ll;0;L; 0069;;;;N;;;;; 1D55B;MATHEMATICAL DOUBLE-STRUCK SMALL J;Ll;0;L; 006A;;;;N;;;;; 1D55C;MATHEMATICAL DOUBLE-STRUCK SMALL K;Ll;0;L; 006B;;;;N;;;;; 1D55D;MATHEMATICAL DOUBLE-STRUCK SMALL L;Ll;0;L; 006C;;;;N;;;;; 1D55E;MATHEMATICAL DOUBLE-STRUCK SMALL M;Ll;0;L; 006D;;;;N;;;;; 1D55F;MATHEMATICAL DOUBLE-STRUCK SMALL N;Ll;0;L; 006E;;;;N;;;;; 1D560;MATHEMATICAL DOUBLE-STRUCK SMALL O;Ll;0;L; 006F;;;;N;;;;; 1D561;MATHEMATICAL DOUBLE-STRUCK SMALL P;Ll;0;L; 0070;;;;N;;;;; 1D562;MATHEMATICAL DOUBLE-STRUCK SMALL Q;Ll;0;L; 0071;;;;N;;;;; 1D563;MATHEMATICAL DOUBLE-STRUCK SMALL R;Ll;0;L; 0072;;;;N;;;;; 1D564;MATHEMATICAL DOUBLE-STRUCK SMALL S;Ll;0;L; 0073;;;;N;;;;; 1D565;MATHEMATICAL DOUBLE-STRUCK SMALL T;Ll;0;L; 0074;;;;N;;;;; 1D566;MATHEMATICAL DOUBLE-STRUCK SMALL U;Ll;0;L; 0075;;;;N;;;;; 1D567;MATHEMATICAL DOUBLE-STRUCK SMALL V;Ll;0;L; 0076;;;;N;;;;; 1D568;MATHEMATICAL DOUBLE-STRUCK SMALL W;Ll;0;L; 0077;;;;N;;;;; 1D569;MATHEMATICAL DOUBLE-STRUCK SMALL X;Ll;0;L; 0078;;;;N;;;;; 1D56A;MATHEMATICAL DOUBLE-STRUCK SMALL Y;Ll;0;L; 0079;;;;N;;;;; 1D56B;MATHEMATICAL DOUBLE-STRUCK SMALL Z;Ll;0;L; 007A;;;;N;;;;; 1D56C;MATHEMATICAL BOLD FRAKTUR CAPITAL A;Lu;0;L; 0041;;;;N;;;;; 1D56D;MATHEMATICAL BOLD FRAKTUR CAPITAL B;Lu;0;L; 0042;;;;N;;;;; 1D56E;MATHEMATICAL BOLD FRAKTUR CAPITAL C;Lu;0;L; 0043;;;;N;;;;; 1D56F;MATHEMATICAL BOLD FRAKTUR CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 1D570;MATHEMATICAL BOLD FRAKTUR CAPITAL E;Lu;0;L; 0045;;;;N;;;;; 1D571;MATHEMATICAL BOLD FRAKTUR CAPITAL F;Lu;0;L; 0046;;;;N;;;;; 1D572;MATHEMATICAL BOLD FRAKTUR CAPITAL G;Lu;0;L; 0047;;;;N;;;;; 1D573;MATHEMATICAL BOLD FRAKTUR CAPITAL H;Lu;0;L; 0048;;;;N;;;;; 1D574;MATHEMATICAL BOLD FRAKTUR CAPITAL I;Lu;0;L; 0049;;;;N;;;;; 1D575;MATHEMATICAL BOLD FRAKTUR CAPITAL J;Lu;0;L; 004A;;;;N;;;;; 1D576;MATHEMATICAL BOLD FRAKTUR CAPITAL K;Lu;0;L; 004B;;;;N;;;;; 1D577;MATHEMATICAL BOLD FRAKTUR CAPITAL L;Lu;0;L; 004C;;;;N;;;;; 1D578;MATHEMATICAL BOLD FRAKTUR CAPITAL M;Lu;0;L; 004D;;;;N;;;;; 1D579;MATHEMATICAL BOLD FRAKTUR CAPITAL N;Lu;0;L; 004E;;;;N;;;;; 1D57A;MATHEMATICAL BOLD FRAKTUR CAPITAL O;Lu;0;L; 004F;;;;N;;;;; 1D57B;MATHEMATICAL BOLD FRAKTUR CAPITAL P;Lu;0;L; 0050;;;;N;;;;; 1D57C;MATHEMATICAL BOLD FRAKTUR CAPITAL Q;Lu;0;L; 0051;;;;N;;;;; 1D57D;MATHEMATICAL BOLD FRAKTUR CAPITAL R;Lu;0;L; 0052;;;;N;;;;; 1D57E;MATHEMATICAL BOLD FRAKTUR CAPITAL S;Lu;0;L; 0053;;;;N;;;;; 1D57F;MATHEMATICAL BOLD FRAKTUR CAPITAL T;Lu;0;L; 0054;;;;N;;;;; 1D580;MATHEMATICAL BOLD FRAKTUR CAPITAL U;Lu;0;L; 0055;;;;N;;;;; 1D581;MATHEMATICAL BOLD FRAKTUR CAPITAL V;Lu;0;L; 0056;;;;N;;;;; 1D582;MATHEMATICAL BOLD FRAKTUR CAPITAL W;Lu;0;L; 0057;;;;N;;;;; 1D583;MATHEMATICAL BOLD FRAKTUR CAPITAL X;Lu;0;L; 0058;;;;N;;;;; 1D584;MATHEMATICAL BOLD FRAKTUR CAPITAL Y;Lu;0;L; 0059;;;;N;;;;; 1D585;MATHEMATICAL BOLD FRAKTUR CAPITAL Z;Lu;0;L; 005A;;;;N;;;;; 1D586;MATHEMATICAL BOLD FRAKTUR SMALL A;Ll;0;L; 0061;;;;N;;;;; 1D587;MATHEMATICAL BOLD FRAKTUR SMALL B;Ll;0;L; 0062;;;;N;;;;; 1D588;MATHEMATICAL BOLD FRAKTUR SMALL C;Ll;0;L; 0063;;;;N;;;;; 1D589;MATHEMATICAL BOLD FRAKTUR SMALL D;Ll;0;L; 0064;;;;N;;;;; 1D58A;MATHEMATICAL BOLD FRAKTUR SMALL E;Ll;0;L; 0065;;;;N;;;;; 1D58B;MATHEMATICAL BOLD FRAKTUR SMALL F;Ll;0;L; 0066;;;;N;;;;; 1D58C;MATHEMATICAL BOLD FRAKTUR SMALL G;Ll;0;L; 0067;;;;N;;;;; 1D58D;MATHEMATICAL BOLD FRAKTUR SMALL H;Ll;0;L; 0068;;;;N;;;;; 1D58E;MATHEMATICAL BOLD FRAKTUR SMALL I;Ll;0;L; 0069;;;;N;;;;; 1D58F;MATHEMATICAL BOLD FRAKTUR SMALL J;Ll;0;L; 006A;;;;N;;;;; 1D590;MATHEMATICAL BOLD FRAKTUR SMALL K;Ll;0;L; 006B;;;;N;;;;; 1D591;MATHEMATICAL BOLD FRAKTUR SMALL L;Ll;0;L; 006C;;;;N;;;;; 1D592;MATHEMATICAL BOLD FRAKTUR SMALL M;Ll;0;L; 006D;;;;N;;;;; 1D593;MATHEMATICAL BOLD FRAKTUR SMALL N;Ll;0;L; 006E;;;;N;;;;; 1D594;MATHEMATICAL BOLD FRAKTUR SMALL O;Ll;0;L; 006F;;;;N;;;;; 1D595;MATHEMATICAL BOLD FRAKTUR SMALL P;Ll;0;L; 0070;;;;N;;;;; 1D596;MATHEMATICAL BOLD FRAKTUR SMALL Q;Ll;0;L; 0071;;;;N;;;;; 1D597;MATHEMATICAL BOLD FRAKTUR SMALL R;Ll;0;L; 0072;;;;N;;;;; 1D598;MATHEMATICAL BOLD FRAKTUR SMALL S;Ll;0;L; 0073;;;;N;;;;; 1D599;MATHEMATICAL BOLD FRAKTUR SMALL T;Ll;0;L; 0074;;;;N;;;;; 1D59A;MATHEMATICAL BOLD FRAKTUR SMALL U;Ll;0;L; 0075;;;;N;;;;; 1D59B;MATHEMATICAL BOLD FRAKTUR SMALL V;Ll;0;L; 0076;;;;N;;;;; 1D59C;MATHEMATICAL BOLD FRAKTUR SMALL W;Ll;0;L; 0077;;;;N;;;;; 1D59D;MATHEMATICAL BOLD FRAKTUR SMALL X;Ll;0;L; 0078;;;;N;;;;; 1D59E;MATHEMATICAL BOLD FRAKTUR SMALL Y;Ll;0;L; 0079;;;;N;;;;; 1D59F;MATHEMATICAL BOLD FRAKTUR SMALL Z;Ll;0;L; 007A;;;;N;;;;; 1D5A0;MATHEMATICAL SANS-SERIF CAPITAL A;Lu;0;L; 0041;;;;N;;;;; 1D5A1;MATHEMATICAL SANS-SERIF CAPITAL B;Lu;0;L; 0042;;;;N;;;;; 1D5A2;MATHEMATICAL SANS-SERIF CAPITAL C;Lu;0;L; 0043;;;;N;;;;; 1D5A3;MATHEMATICAL SANS-SERIF CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 1D5A4;MATHEMATICAL SANS-SERIF CAPITAL E;Lu;0;L; 0045;;;;N;;;;; 1D5A5;MATHEMATICAL SANS-SERIF CAPITAL F;Lu;0;L; 0046;;;;N;;;;; 1D5A6;MATHEMATICAL SANS-SERIF CAPITAL G;Lu;0;L; 0047;;;;N;;;;; 1D5A7;MATHEMATICAL SANS-SERIF CAPITAL H;Lu;0;L; 0048;;;;N;;;;; 1D5A8;MATHEMATICAL SANS-SERIF CAPITAL I;Lu;0;L; 0049;;;;N;;;;; 1D5A9;MATHEMATICAL SANS-SERIF CAPITAL J;Lu;0;L; 004A;;;;N;;;;; 1D5AA;MATHEMATICAL SANS-SERIF CAPITAL K;Lu;0;L; 004B;;;;N;;;;; 1D5AB;MATHEMATICAL SANS-SERIF CAPITAL L;Lu;0;L; 004C;;;;N;;;;; 1D5AC;MATHEMATICAL SANS-SERIF CAPITAL M;Lu;0;L; 004D;;;;N;;;;; 1D5AD;MATHEMATICAL SANS-SERIF CAPITAL N;Lu;0;L; 004E;;;;N;;;;; 1D5AE;MATHEMATICAL SANS-SERIF CAPITAL O;Lu;0;L; 004F;;;;N;;;;; 1D5AF;MATHEMATICAL SANS-SERIF CAPITAL P;Lu;0;L; 0050;;;;N;;;;; 1D5B0;MATHEMATICAL SANS-SERIF CAPITAL Q;Lu;0;L; 0051;;;;N;;;;; 1D5B1;MATHEMATICAL SANS-SERIF CAPITAL R;Lu;0;L; 0052;;;;N;;;;; 1D5B2;MATHEMATICAL SANS-SERIF CAPITAL S;Lu;0;L; 0053;;;;N;;;;; 1D5B3;MATHEMATICAL SANS-SERIF CAPITAL T;Lu;0;L; 0054;;;;N;;;;; 1D5B4;MATHEMATICAL SANS-SERIF CAPITAL U;Lu;0;L; 0055;;;;N;;;;; 1D5B5;MATHEMATICAL SANS-SERIF CAPITAL V;Lu;0;L; 0056;;;;N;;;;; 1D5B6;MATHEMATICAL SANS-SERIF CAPITAL W;Lu;0;L; 0057;;;;N;;;;; 1D5B7;MATHEMATICAL SANS-SERIF CAPITAL X;Lu;0;L; 0058;;;;N;;;;; 1D5B8;MATHEMATICAL SANS-SERIF CAPITAL Y;Lu;0;L; 0059;;;;N;;;;; 1D5B9;MATHEMATICAL SANS-SERIF CAPITAL Z;Lu;0;L; 005A;;;;N;;;;; 1D5BA;MATHEMATICAL SANS-SERIF SMALL A;Ll;0;L; 0061;;;;N;;;;; 1D5BB;MATHEMATICAL SANS-SERIF SMALL B;Ll;0;L; 0062;;;;N;;;;; 1D5BC;MATHEMATICAL SANS-SERIF SMALL C;Ll;0;L; 0063;;;;N;;;;; 1D5BD;MATHEMATICAL SANS-SERIF SMALL D;Ll;0;L; 0064;;;;N;;;;; 1D5BE;MATHEMATICAL SANS-SERIF SMALL E;Ll;0;L; 0065;;;;N;;;;; 1D5BF;MATHEMATICAL SANS-SERIF SMALL F;Ll;0;L; 0066;;;;N;;;;; 1D5C0;MATHEMATICAL SANS-SERIF SMALL G;Ll;0;L; 0067;;;;N;;;;; 1D5C1;MATHEMATICAL SANS-SERIF SMALL H;Ll;0;L; 0068;;;;N;;;;; 1D5C2;MATHEMATICAL SANS-SERIF SMALL I;Ll;0;L; 0069;;;;N;;;;; 1D5C3;MATHEMATICAL SANS-SERIF SMALL J;Ll;0;L; 006A;;;;N;;;;; 1D5C4;MATHEMATICAL SANS-SERIF SMALL K;Ll;0;L; 006B;;;;N;;;;; 1D5C5;MATHEMATICAL SANS-SERIF SMALL L;Ll;0;L; 006C;;;;N;;;;; 1D5C6;MATHEMATICAL SANS-SERIF SMALL M;Ll;0;L; 006D;;;;N;;;;; 1D5C7;MATHEMATICAL SANS-SERIF SMALL N;Ll;0;L; 006E;;;;N;;;;; 1D5C8;MATHEMATICAL SANS-SERIF SMALL O;Ll;0;L; 006F;;;;N;;;;; 1D5C9;MATHEMATICAL SANS-SERIF SMALL P;Ll;0;L; 0070;;;;N;;;;; 1D5CA;MATHEMATICAL SANS-SERIF SMALL Q;Ll;0;L; 0071;;;;N;;;;; 1D5CB;MATHEMATICAL SANS-SERIF SMALL R;Ll;0;L; 0072;;;;N;;;;; 1D5CC;MATHEMATICAL SANS-SERIF SMALL S;Ll;0;L; 0073;;;;N;;;;; 1D5CD;MATHEMATICAL SANS-SERIF SMALL T;Ll;0;L; 0074;;;;N;;;;; 1D5CE;MATHEMATICAL SANS-SERIF SMALL U;Ll;0;L; 0075;;;;N;;;;; 1D5CF;MATHEMATICAL SANS-SERIF SMALL V;Ll;0;L; 0076;;;;N;;;;; 1D5D0;MATHEMATICAL SANS-SERIF SMALL W;Ll;0;L; 0077;;;;N;;;;; 1D5D1;MATHEMATICAL SANS-SERIF SMALL X;Ll;0;L; 0078;;;;N;;;;; 1D5D2;MATHEMATICAL SANS-SERIF SMALL Y;Ll;0;L; 0079;;;;N;;;;; 1D5D3;MATHEMATICAL SANS-SERIF SMALL Z;Ll;0;L; 007A;;;;N;;;;; 1D5D4;MATHEMATICAL SANS-SERIF BOLD CAPITAL A;Lu;0;L; 0041;;;;N;;;;; 1D5D5;MATHEMATICAL SANS-SERIF BOLD CAPITAL B;Lu;0;L; 0042;;;;N;;;;; 1D5D6;MATHEMATICAL SANS-SERIF BOLD CAPITAL C;Lu;0;L; 0043;;;;N;;;;; 1D5D7;MATHEMATICAL SANS-SERIF BOLD CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 1D5D8;MATHEMATICAL SANS-SERIF BOLD CAPITAL E;Lu;0;L; 0045;;;;N;;;;; 1D5D9;MATHEMATICAL SANS-SERIF BOLD CAPITAL F;Lu;0;L; 0046;;;;N;;;;; 1D5DA;MATHEMATICAL SANS-SERIF BOLD CAPITAL G;Lu;0;L; 0047;;;;N;;;;; 1D5DB;MATHEMATICAL SANS-SERIF BOLD CAPITAL H;Lu;0;L; 0048;;;;N;;;;; 1D5DC;MATHEMATICAL SANS-SERIF BOLD CAPITAL I;Lu;0;L; 0049;;;;N;;;;; 1D5DD;MATHEMATICAL SANS-SERIF BOLD CAPITAL J;Lu;0;L; 004A;;;;N;;;;; 1D5DE;MATHEMATICAL SANS-SERIF BOLD CAPITAL K;Lu;0;L; 004B;;;;N;;;;; 1D5DF;MATHEMATICAL SANS-SERIF BOLD CAPITAL L;Lu;0;L; 004C;;;;N;;;;; 1D5E0;MATHEMATICAL SANS-SERIF BOLD CAPITAL M;Lu;0;L; 004D;;;;N;;;;; 1D5E1;MATHEMATICAL SANS-SERIF BOLD CAPITAL N;Lu;0;L; 004E;;;;N;;;;; 1D5E2;MATHEMATICAL SANS-SERIF BOLD CAPITAL O;Lu;0;L; 004F;;;;N;;;;; 1D5E3;MATHEMATICAL SANS-SERIF BOLD CAPITAL P;Lu;0;L; 0050;;;;N;;;;; 1D5E4;MATHEMATICAL SANS-SERIF BOLD CAPITAL Q;Lu;0;L; 0051;;;;N;;;;; 1D5E5;MATHEMATICAL SANS-SERIF BOLD CAPITAL R;Lu;0;L; 0052;;;;N;;;;; 1D5E6;MATHEMATICAL SANS-SERIF BOLD CAPITAL S;Lu;0;L; 0053;;;;N;;;;; 1D5E7;MATHEMATICAL SANS-SERIF BOLD CAPITAL T;Lu;0;L; 0054;;;;N;;;;; 1D5E8;MATHEMATICAL SANS-SERIF BOLD CAPITAL U;Lu;0;L; 0055;;;;N;;;;; 1D5E9;MATHEMATICAL SANS-SERIF BOLD CAPITAL V;Lu;0;L; 0056;;;;N;;;;; 1D5EA;MATHEMATICAL SANS-SERIF BOLD CAPITAL W;Lu;0;L; 0057;;;;N;;;;; 1D5EB;MATHEMATICAL SANS-SERIF BOLD CAPITAL X;Lu;0;L; 0058;;;;N;;;;; 1D5EC;MATHEMATICAL SANS-SERIF BOLD CAPITAL Y;Lu;0;L; 0059;;;;N;;;;; 1D5ED;MATHEMATICAL SANS-SERIF BOLD CAPITAL Z;Lu;0;L; 005A;;;;N;;;;; 1D5EE;MATHEMATICAL SANS-SERIF BOLD SMALL A;Ll;0;L; 0061;;;;N;;;;; 1D5EF;MATHEMATICAL SANS-SERIF BOLD SMALL B;Ll;0;L; 0062;;;;N;;;;; 1D5F0;MATHEMATICAL SANS-SERIF BOLD SMALL C;Ll;0;L; 0063;;;;N;;;;; 1D5F1;MATHEMATICAL SANS-SERIF BOLD SMALL D;Ll;0;L; 0064;;;;N;;;;; 1D5F2;MATHEMATICAL SANS-SERIF BOLD SMALL E;Ll;0;L; 0065;;;;N;;;;; 1D5F3;MATHEMATICAL SANS-SERIF BOLD SMALL F;Ll;0;L; 0066;;;;N;;;;; 1D5F4;MATHEMATICAL SANS-SERIF BOLD SMALL G;Ll;0;L; 0067;;;;N;;;;; 1D5F5;MATHEMATICAL SANS-SERIF BOLD SMALL H;Ll;0;L; 0068;;;;N;;;;; 1D5F6;MATHEMATICAL SANS-SERIF BOLD SMALL I;Ll;0;L; 0069;;;;N;;;;; 1D5F7;MATHEMATICAL SANS-SERIF BOLD SMALL J;Ll;0;L; 006A;;;;N;;;;; 1D5F8;MATHEMATICAL SANS-SERIF BOLD SMALL K;Ll;0;L; 006B;;;;N;;;;; 1D5F9;MATHEMATICAL SANS-SERIF BOLD SMALL L;Ll;0;L; 006C;;;;N;;;;; 1D5FA;MATHEMATICAL SANS-SERIF BOLD SMALL M;Ll;0;L; 006D;;;;N;;;;; 1D5FB;MATHEMATICAL SANS-SERIF BOLD SMALL N;Ll;0;L; 006E;;;;N;;;;; 1D5FC;MATHEMATICAL SANS-SERIF BOLD SMALL O;Ll;0;L; 006F;;;;N;;;;; 1D5FD;MATHEMATICAL SANS-SERIF BOLD SMALL P;Ll;0;L; 0070;;;;N;;;;; 1D5FE;MATHEMATICAL SANS-SERIF BOLD SMALL Q;Ll;0;L; 0071;;;;N;;;;; 1D5FF;MATHEMATICAL SANS-SERIF BOLD SMALL R;Ll;0;L; 0072;;;;N;;;;; 1D600;MATHEMATICAL SANS-SERIF BOLD SMALL S;Ll;0;L; 0073;;;;N;;;;; 1D601;MATHEMATICAL SANS-SERIF BOLD SMALL T;Ll;0;L; 0074;;;;N;;;;; 1D602;MATHEMATICAL SANS-SERIF BOLD SMALL U;Ll;0;L; 0075;;;;N;;;;; 1D603;MATHEMATICAL SANS-SERIF BOLD SMALL V;Ll;0;L; 0076;;;;N;;;;; 1D604;MATHEMATICAL SANS-SERIF BOLD SMALL W;Ll;0;L; 0077;;;;N;;;;; 1D605;MATHEMATICAL SANS-SERIF BOLD SMALL X;Ll;0;L; 0078;;;;N;;;;; 1D606;MATHEMATICAL SANS-SERIF BOLD SMALL Y;Ll;0;L; 0079;;;;N;;;;; 1D607;MATHEMATICAL SANS-SERIF BOLD SMALL Z;Ll;0;L; 007A;;;;N;;;;; 1D608;MATHEMATICAL SANS-SERIF ITALIC CAPITAL A;Lu;0;L; 0041;;;;N;;;;; 1D609;MATHEMATICAL SANS-SERIF ITALIC CAPITAL B;Lu;0;L; 0042;;;;N;;;;; 1D60A;MATHEMATICAL SANS-SERIF ITALIC CAPITAL C;Lu;0;L; 0043;;;;N;;;;; 1D60B;MATHEMATICAL SANS-SERIF ITALIC CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 1D60C;MATHEMATICAL SANS-SERIF ITALIC CAPITAL E;Lu;0;L; 0045;;;;N;;;;; 1D60D;MATHEMATICAL SANS-SERIF ITALIC CAPITAL F;Lu;0;L; 0046;;;;N;;;;; 1D60E;MATHEMATICAL SANS-SERIF ITALIC CAPITAL G;Lu;0;L; 0047;;;;N;;;;; 1D60F;MATHEMATICAL SANS-SERIF ITALIC CAPITAL H;Lu;0;L; 0048;;;;N;;;;; 1D610;MATHEMATICAL SANS-SERIF ITALIC CAPITAL I;Lu;0;L; 0049;;;;N;;;;; 1D611;MATHEMATICAL SANS-SERIF ITALIC CAPITAL J;Lu;0;L; 004A;;;;N;;;;; 1D612;MATHEMATICAL SANS-SERIF ITALIC CAPITAL K;Lu;0;L; 004B;;;;N;;;;; 1D613;MATHEMATICAL SANS-SERIF ITALIC CAPITAL L;Lu;0;L; 004C;;;;N;;;;; 1D614;MATHEMATICAL SANS-SERIF ITALIC CAPITAL M;Lu;0;L; 004D;;;;N;;;;; 1D615;MATHEMATICAL SANS-SERIF ITALIC CAPITAL N;Lu;0;L; 004E;;;;N;;;;; 1D616;MATHEMATICAL SANS-SERIF ITALIC CAPITAL O;Lu;0;L; 004F;;;;N;;;;; 1D617;MATHEMATICAL SANS-SERIF ITALIC CAPITAL P;Lu;0;L; 0050;;;;N;;;;; 1D618;MATHEMATICAL SANS-SERIF ITALIC CAPITAL Q;Lu;0;L; 0051;;;;N;;;;; 1D619;MATHEMATICAL SANS-SERIF ITALIC CAPITAL R;Lu;0;L; 0052;;;;N;;;;; 1D61A;MATHEMATICAL SANS-SERIF ITALIC CAPITAL S;Lu;0;L; 0053;;;;N;;;;; 1D61B;MATHEMATICAL SANS-SERIF ITALIC CAPITAL T;Lu;0;L; 0054;;;;N;;;;; 1D61C;MATHEMATICAL SANS-SERIF ITALIC CAPITAL U;Lu;0;L; 0055;;;;N;;;;; 1D61D;MATHEMATICAL SANS-SERIF ITALIC CAPITAL V;Lu;0;L; 0056;;;;N;;;;; 1D61E;MATHEMATICAL SANS-SERIF ITALIC CAPITAL W;Lu;0;L; 0057;;;;N;;;;; 1D61F;MATHEMATICAL SANS-SERIF ITALIC CAPITAL X;Lu;0;L; 0058;;;;N;;;;; 1D620;MATHEMATICAL SANS-SERIF ITALIC CAPITAL Y;Lu;0;L; 0059;;;;N;;;;; 1D621;MATHEMATICAL SANS-SERIF ITALIC CAPITAL Z;Lu;0;L; 005A;;;;N;;;;; 1D622;MATHEMATICAL SANS-SERIF ITALIC SMALL A;Ll;0;L; 0061;;;;N;;;;; 1D623;MATHEMATICAL SANS-SERIF ITALIC SMALL B;Ll;0;L; 0062;;;;N;;;;; 1D624;MATHEMATICAL SANS-SERIF ITALIC SMALL C;Ll;0;L; 0063;;;;N;;;;; 1D625;MATHEMATICAL SANS-SERIF ITALIC SMALL D;Ll;0;L; 0064;;;;N;;;;; 1D626;MATHEMATICAL SANS-SERIF ITALIC SMALL E;Ll;0;L; 0065;;;;N;;;;; 1D627;MATHEMATICAL SANS-SERIF ITALIC SMALL F;Ll;0;L; 0066;;;;N;;;;; 1D628;MATHEMATICAL SANS-SERIF ITALIC SMALL G;Ll;0;L; 0067;;;;N;;;;; 1D629;MATHEMATICAL SANS-SERIF ITALIC SMALL H;Ll;0;L; 0068;;;;N;;;;; 1D62A;MATHEMATICAL SANS-SERIF ITALIC SMALL I;Ll;0;L; 0069;;;;N;;;;; 1D62B;MATHEMATICAL SANS-SERIF ITALIC SMALL J;Ll;0;L; 006A;;;;N;;;;; 1D62C;MATHEMATICAL SANS-SERIF ITALIC SMALL K;Ll;0;L; 006B;;;;N;;;;; 1D62D;MATHEMATICAL SANS-SERIF ITALIC SMALL L;Ll;0;L; 006C;;;;N;;;;; 1D62E;MATHEMATICAL SANS-SERIF ITALIC SMALL M;Ll;0;L; 006D;;;;N;;;;; 1D62F;MATHEMATICAL SANS-SERIF ITALIC SMALL N;Ll;0;L; 006E;;;;N;;;;; 1D630;MATHEMATICAL SANS-SERIF ITALIC SMALL O;Ll;0;L; 006F;;;;N;;;;; 1D631;MATHEMATICAL SANS-SERIF ITALIC SMALL P;Ll;0;L; 0070;;;;N;;;;; 1D632;MATHEMATICAL SANS-SERIF ITALIC SMALL Q;Ll;0;L; 0071;;;;N;;;;; 1D633;MATHEMATICAL SANS-SERIF ITALIC SMALL R;Ll;0;L; 0072;;;;N;;;;; 1D634;MATHEMATICAL SANS-SERIF ITALIC SMALL S;Ll;0;L; 0073;;;;N;;;;; 1D635;MATHEMATICAL SANS-SERIF ITALIC SMALL T;Ll;0;L; 0074;;;;N;;;;; 1D636;MATHEMATICAL SANS-SERIF ITALIC SMALL U;Ll;0;L; 0075;;;;N;;;;; 1D637;MATHEMATICAL SANS-SERIF ITALIC SMALL V;Ll;0;L; 0076;;;;N;;;;; 1D638;MATHEMATICAL SANS-SERIF ITALIC SMALL W;Ll;0;L; 0077;;;;N;;;;; 1D639;MATHEMATICAL SANS-SERIF ITALIC SMALL X;Ll;0;L; 0078;;;;N;;;;; 1D63A;MATHEMATICAL SANS-SERIF ITALIC SMALL Y;Ll;0;L; 0079;;;;N;;;;; 1D63B;MATHEMATICAL SANS-SERIF ITALIC SMALL Z;Ll;0;L; 007A;;;;N;;;;; 1D63C;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL A;Lu;0;L; 0041;;;;N;;;;; 1D63D;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL B;Lu;0;L; 0042;;;;N;;;;; 1D63E;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL C;Lu;0;L; 0043;;;;N;;;;; 1D63F;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 1D640;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL E;Lu;0;L; 0045;;;;N;;;;; 1D641;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL F;Lu;0;L; 0046;;;;N;;;;; 1D642;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL G;Lu;0;L; 0047;;;;N;;;;; 1D643;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL H;Lu;0;L; 0048;;;;N;;;;; 1D644;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL I;Lu;0;L; 0049;;;;N;;;;; 1D645;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL J;Lu;0;L; 004A;;;;N;;;;; 1D646;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL K;Lu;0;L; 004B;;;;N;;;;; 1D647;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL L;Lu;0;L; 004C;;;;N;;;;; 1D648;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL M;Lu;0;L; 004D;;;;N;;;;; 1D649;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL N;Lu;0;L; 004E;;;;N;;;;; 1D64A;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL O;Lu;0;L; 004F;;;;N;;;;; 1D64B;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL P;Lu;0;L; 0050;;;;N;;;;; 1D64C;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Q;Lu;0;L; 0051;;;;N;;;;; 1D64D;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL R;Lu;0;L; 0052;;;;N;;;;; 1D64E;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL S;Lu;0;L; 0053;;;;N;;;;; 1D64F;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL T;Lu;0;L; 0054;;;;N;;;;; 1D650;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL U;Lu;0;L; 0055;;;;N;;;;; 1D651;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL V;Lu;0;L; 0056;;;;N;;;;; 1D652;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL W;Lu;0;L; 0057;;;;N;;;;; 1D653;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL X;Lu;0;L; 0058;;;;N;;;;; 1D654;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Y;Lu;0;L; 0059;;;;N;;;;; 1D655;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Z;Lu;0;L; 005A;;;;N;;;;; 1D656;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL A;Ll;0;L; 0061;;;;N;;;;; 1D657;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL B;Ll;0;L; 0062;;;;N;;;;; 1D658;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL C;Ll;0;L; 0063;;;;N;;;;; 1D659;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL D;Ll;0;L; 0064;;;;N;;;;; 1D65A;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL E;Ll;0;L; 0065;;;;N;;;;; 1D65B;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL F;Ll;0;L; 0066;;;;N;;;;; 1D65C;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL G;Ll;0;L; 0067;;;;N;;;;; 1D65D;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL H;Ll;0;L; 0068;;;;N;;;;; 1D65E;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL I;Ll;0;L; 0069;;;;N;;;;; 1D65F;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL J;Ll;0;L; 006A;;;;N;;;;; 1D660;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL K;Ll;0;L; 006B;;;;N;;;;; 1D661;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL L;Ll;0;L; 006C;;;;N;;;;; 1D662;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL M;Ll;0;L; 006D;;;;N;;;;; 1D663;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL N;Ll;0;L; 006E;;;;N;;;;; 1D664;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL O;Ll;0;L; 006F;;;;N;;;;; 1D665;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL P;Ll;0;L; 0070;;;;N;;;;; 1D666;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Q;Ll;0;L; 0071;;;;N;;;;; 1D667;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL R;Ll;0;L; 0072;;;;N;;;;; 1D668;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL S;Ll;0;L; 0073;;;;N;;;;; 1D669;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL T;Ll;0;L; 0074;;;;N;;;;; 1D66A;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL U;Ll;0;L; 0075;;;;N;;;;; 1D66B;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL V;Ll;0;L; 0076;;;;N;;;;; 1D66C;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL W;Ll;0;L; 0077;;;;N;;;;; 1D66D;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL X;Ll;0;L; 0078;;;;N;;;;; 1D66E;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Y;Ll;0;L; 0079;;;;N;;;;; 1D66F;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Z;Ll;0;L; 007A;;;;N;;;;; 1D670;MATHEMATICAL MONOSPACE CAPITAL A;Lu;0;L; 0041;;;;N;;;;; 1D671;MATHEMATICAL MONOSPACE CAPITAL B;Lu;0;L; 0042;;;;N;;;;; 1D672;MATHEMATICAL MONOSPACE CAPITAL C;Lu;0;L; 0043;;;;N;;;;; 1D673;MATHEMATICAL MONOSPACE CAPITAL D;Lu;0;L; 0044;;;;N;;;;; 1D674;MATHEMATICAL MONOSPACE CAPITAL E;Lu;0;L; 0045;;;;N;;;;; 1D675;MATHEMATICAL MONOSPACE CAPITAL F;Lu;0;L; 0046;;;;N;;;;; 1D676;MATHEMATICAL MONOSPACE CAPITAL G;Lu;0;L; 0047;;;;N;;;;; 1D677;MATHEMATICAL MONOSPACE CAPITAL H;Lu;0;L; 0048;;;;N;;;;; 1D678;MATHEMATICAL MONOSPACE CAPITAL I;Lu;0;L; 0049;;;;N;;;;; 1D679;MATHEMATICAL MONOSPACE CAPITAL J;Lu;0;L; 004A;;;;N;;;;; 1D67A;MATHEMATICAL MONOSPACE CAPITAL K;Lu;0;L; 004B;;;;N;;;;; 1D67B;MATHEMATICAL MONOSPACE CAPITAL L;Lu;0;L; 004C;;;;N;;;;; 1D67C;MATHEMATICAL MONOSPACE CAPITAL M;Lu;0;L; 004D;;;;N;;;;; 1D67D;MATHEMATICAL MONOSPACE CAPITAL N;Lu;0;L; 004E;;;;N;;;;; 1D67E;MATHEMATICAL MONOSPACE CAPITAL O;Lu;0;L; 004F;;;;N;;;;; 1D67F;MATHEMATICAL MONOSPACE CAPITAL P;Lu;0;L; 0050;;;;N;;;;; 1D680;MATHEMATICAL MONOSPACE CAPITAL Q;Lu;0;L; 0051;;;;N;;;;; 1D681;MATHEMATICAL MONOSPACE CAPITAL R;Lu;0;L; 0052;;;;N;;;;; 1D682;MATHEMATICAL MONOSPACE CAPITAL S;Lu;0;L; 0053;;;;N;;;;; 1D683;MATHEMATICAL MONOSPACE CAPITAL T;Lu;0;L; 0054;;;;N;;;;; 1D684;MATHEMATICAL MONOSPACE CAPITAL U;Lu;0;L; 0055;;;;N;;;;; 1D685;MATHEMATICAL MONOSPACE CAPITAL V;Lu;0;L; 0056;;;;N;;;;; 1D686;MATHEMATICAL MONOSPACE CAPITAL W;Lu;0;L; 0057;;;;N;;;;; 1D687;MATHEMATICAL MONOSPACE CAPITAL X;Lu;0;L; 0058;;;;N;;;;; 1D688;MATHEMATICAL MONOSPACE CAPITAL Y;Lu;0;L; 0059;;;;N;;;;; 1D689;MATHEMATICAL MONOSPACE CAPITAL Z;Lu;0;L; 005A;;;;N;;;;; 1D68A;MATHEMATICAL MONOSPACE SMALL A;Ll;0;L; 0061;;;;N;;;;; 1D68B;MATHEMATICAL MONOSPACE SMALL B;Ll;0;L; 0062;;;;N;;;;; 1D68C;MATHEMATICAL MONOSPACE SMALL C;Ll;0;L; 0063;;;;N;;;;; 1D68D;MATHEMATICAL MONOSPACE SMALL D;Ll;0;L; 0064;;;;N;;;;; 1D68E;MATHEMATICAL MONOSPACE SMALL E;Ll;0;L; 0065;;;;N;;;;; 1D68F;MATHEMATICAL MONOSPACE SMALL F;Ll;0;L; 0066;;;;N;;;;; 1D690;MATHEMATICAL MONOSPACE SMALL G;Ll;0;L; 0067;;;;N;;;;; 1D691;MATHEMATICAL MONOSPACE SMALL H;Ll;0;L; 0068;;;;N;;;;; 1D692;MATHEMATICAL MONOSPACE SMALL I;Ll;0;L; 0069;;;;N;;;;; 1D693;MATHEMATICAL MONOSPACE SMALL J;Ll;0;L; 006A;;;;N;;;;; 1D694;MATHEMATICAL MONOSPACE SMALL K;Ll;0;L; 006B;;;;N;;;;; 1D695;MATHEMATICAL MONOSPACE SMALL L;Ll;0;L; 006C;;;;N;;;;; 1D696;MATHEMATICAL MONOSPACE SMALL M;Ll;0;L; 006D;;;;N;;;;; 1D697;MATHEMATICAL MONOSPACE SMALL N;Ll;0;L; 006E;;;;N;;;;; 1D698;MATHEMATICAL MONOSPACE SMALL O;Ll;0;L; 006F;;;;N;;;;; 1D699;MATHEMATICAL MONOSPACE SMALL P;Ll;0;L; 0070;;;;N;;;;; 1D69A;MATHEMATICAL MONOSPACE SMALL Q;Ll;0;L; 0071;;;;N;;;;; 1D69B;MATHEMATICAL MONOSPACE SMALL R;Ll;0;L; 0072;;;;N;;;;; 1D69C;MATHEMATICAL MONOSPACE SMALL S;Ll;0;L; 0073;;;;N;;;;; 1D69D;MATHEMATICAL MONOSPACE SMALL T;Ll;0;L; 0074;;;;N;;;;; 1D69E;MATHEMATICAL MONOSPACE SMALL U;Ll;0;L; 0075;;;;N;;;;; 1D69F;MATHEMATICAL MONOSPACE SMALL V;Ll;0;L; 0076;;;;N;;;;; 1D6A0;MATHEMATICAL MONOSPACE SMALL W;Ll;0;L; 0077;;;;N;;;;; 1D6A1;MATHEMATICAL MONOSPACE SMALL X;Ll;0;L; 0078;;;;N;;;;; 1D6A2;MATHEMATICAL MONOSPACE SMALL Y;Ll;0;L; 0079;;;;N;;;;; 1D6A3;MATHEMATICAL MONOSPACE SMALL Z;Ll;0;L; 007A;;;;N;;;;; 1D6A4;MATHEMATICAL ITALIC SMALL DOTLESS I;Ll;0;L; 0131;;;;N;;;;; 1D6A5;MATHEMATICAL ITALIC SMALL DOTLESS J;Ll;0;L; 0237;;;;N;;;;; 1D6A8;MATHEMATICAL BOLD CAPITAL ALPHA;Lu;0;L; 0391;;;;N;;;;; 1D6A9;MATHEMATICAL BOLD CAPITAL BETA;Lu;0;L; 0392;;;;N;;;;; 1D6AA;MATHEMATICAL BOLD CAPITAL GAMMA;Lu;0;L; 0393;;;;N;;;;; 1D6AB;MATHEMATICAL BOLD CAPITAL DELTA;Lu;0;L; 0394;;;;N;;;;; 1D6AC;MATHEMATICAL BOLD CAPITAL EPSILON;Lu;0;L; 0395;;;;N;;;;; 1D6AD;MATHEMATICAL BOLD CAPITAL ZETA;Lu;0;L; 0396;;;;N;;;;; 1D6AE;MATHEMATICAL BOLD CAPITAL ETA;Lu;0;L; 0397;;;;N;;;;; 1D6AF;MATHEMATICAL BOLD CAPITAL THETA;Lu;0;L; 0398;;;;N;;;;; 1D6B0;MATHEMATICAL BOLD CAPITAL IOTA;Lu;0;L; 0399;;;;N;;;;; 1D6B1;MATHEMATICAL BOLD CAPITAL KAPPA;Lu;0;L; 039A;;;;N;;;;; 1D6B2;MATHEMATICAL BOLD CAPITAL LAMDA;Lu;0;L; 039B;;;;N;;;;; 1D6B3;MATHEMATICAL BOLD CAPITAL MU;Lu;0;L; 039C;;;;N;;;;; 1D6B4;MATHEMATICAL BOLD CAPITAL NU;Lu;0;L; 039D;;;;N;;;;; 1D6B5;MATHEMATICAL BOLD CAPITAL XI;Lu;0;L; 039E;;;;N;;;;; 1D6B6;MATHEMATICAL BOLD CAPITAL OMICRON;Lu;0;L; 039F;;;;N;;;;; 1D6B7;MATHEMATICAL BOLD CAPITAL PI;Lu;0;L; 03A0;;;;N;;;;; 1D6B8;MATHEMATICAL BOLD CAPITAL RHO;Lu;0;L; 03A1;;;;N;;;;; 1D6B9;MATHEMATICAL BOLD CAPITAL THETA SYMBOL;Lu;0;L; 03F4;;;;N;;;;; 1D6BA;MATHEMATICAL BOLD CAPITAL SIGMA;Lu;0;L; 03A3;;;;N;;;;; 1D6BB;MATHEMATICAL BOLD CAPITAL TAU;Lu;0;L; 03A4;;;;N;;;;; 1D6BC;MATHEMATICAL BOLD CAPITAL UPSILON;Lu;0;L; 03A5;;;;N;;;;; 1D6BD;MATHEMATICAL BOLD CAPITAL PHI;Lu;0;L; 03A6;;;;N;;;;; 1D6BE;MATHEMATICAL BOLD CAPITAL CHI;Lu;0;L; 03A7;;;;N;;;;; 1D6BF;MATHEMATICAL BOLD CAPITAL PSI;Lu;0;L; 03A8;;;;N;;;;; 1D6C0;MATHEMATICAL BOLD CAPITAL OMEGA;Lu;0;L; 03A9;;;;N;;;;; 1D6C1;MATHEMATICAL BOLD NABLA;Sm;0;L; 2207;;;;N;;;;; 1D6C2;MATHEMATICAL BOLD SMALL ALPHA;Ll;0;L; 03B1;;;;N;;;;; 1D6C3;MATHEMATICAL BOLD SMALL BETA;Ll;0;L; 03B2;;;;N;;;;; 1D6C4;MATHEMATICAL BOLD SMALL GAMMA;Ll;0;L; 03B3;;;;N;;;;; 1D6C5;MATHEMATICAL BOLD SMALL DELTA;Ll;0;L; 03B4;;;;N;;;;; 1D6C6;MATHEMATICAL BOLD SMALL EPSILON;Ll;0;L; 03B5;;;;N;;;;; 1D6C7;MATHEMATICAL BOLD SMALL ZETA;Ll;0;L; 03B6;;;;N;;;;; 1D6C8;MATHEMATICAL BOLD SMALL ETA;Ll;0;L; 03B7;;;;N;;;;; 1D6C9;MATHEMATICAL BOLD SMALL THETA;Ll;0;L; 03B8;;;;N;;;;; 1D6CA;MATHEMATICAL BOLD SMALL IOTA;Ll;0;L; 03B9;;;;N;;;;; 1D6CB;MATHEMATICAL BOLD SMALL KAPPA;Ll;0;L; 03BA;;;;N;;;;; 1D6CC;MATHEMATICAL BOLD SMALL LAMDA;Ll;0;L; 03BB;;;;N;;;;; 1D6CD;MATHEMATICAL BOLD SMALL MU;Ll;0;L; 03BC;;;;N;;;;; 1D6CE;MATHEMATICAL BOLD SMALL NU;Ll;0;L; 03BD;;;;N;;;;; 1D6CF;MATHEMATICAL BOLD SMALL XI;Ll;0;L; 03BE;;;;N;;;;; 1D6D0;MATHEMATICAL BOLD SMALL OMICRON;Ll;0;L; 03BF;;;;N;;;;; 1D6D1;MATHEMATICAL BOLD SMALL PI;Ll;0;L; 03C0;;;;N;;;;; 1D6D2;MATHEMATICAL BOLD SMALL RHO;Ll;0;L; 03C1;;;;N;;;;; 1D6D3;MATHEMATICAL BOLD SMALL FINAL SIGMA;Ll;0;L; 03C2;;;;N;;;;; 1D6D4;MATHEMATICAL BOLD SMALL SIGMA;Ll;0;L; 03C3;;;;N;;;;; 1D6D5;MATHEMATICAL BOLD SMALL TAU;Ll;0;L; 03C4;;;;N;;;;; 1D6D6;MATHEMATICAL BOLD SMALL UPSILON;Ll;0;L; 03C5;;;;N;;;;; 1D6D7;MATHEMATICAL BOLD SMALL PHI;Ll;0;L; 03C6;;;;N;;;;; 1D6D8;MATHEMATICAL BOLD SMALL CHI;Ll;0;L; 03C7;;;;N;;;;; 1D6D9;MATHEMATICAL BOLD SMALL PSI;Ll;0;L; 03C8;;;;N;;;;; 1D6DA;MATHEMATICAL BOLD SMALL OMEGA;Ll;0;L; 03C9;;;;N;;;;; 1D6DB;MATHEMATICAL BOLD PARTIAL DIFFERENTIAL;Sm;0;ON; 2202;;;;Y;;;;; 1D6DC;MATHEMATICAL BOLD EPSILON SYMBOL;Ll;0;L; 03F5;;;;N;;;;; 1D6DD;MATHEMATICAL BOLD THETA SYMBOL;Ll;0;L; 03D1;;;;N;;;;; 1D6DE;MATHEMATICAL BOLD KAPPA SYMBOL;Ll;0;L; 03F0;;;;N;;;;; 1D6DF;MATHEMATICAL BOLD PHI SYMBOL;Ll;0;L; 03D5;;;;N;;;;; 1D6E0;MATHEMATICAL BOLD RHO SYMBOL;Ll;0;L; 03F1;;;;N;;;;; 1D6E1;MATHEMATICAL BOLD PI SYMBOL;Ll;0;L; 03D6;;;;N;;;;; 1D6E2;MATHEMATICAL ITALIC CAPITAL ALPHA;Lu;0;L; 0391;;;;N;;;;; 1D6E3;MATHEMATICAL ITALIC CAPITAL BETA;Lu;0;L; 0392;;;;N;;;;; 1D6E4;MATHEMATICAL ITALIC CAPITAL GAMMA;Lu;0;L; 0393;;;;N;;;;; 1D6E5;MATHEMATICAL ITALIC CAPITAL DELTA;Lu;0;L; 0394;;;;N;;;;; 1D6E6;MATHEMATICAL ITALIC CAPITAL EPSILON;Lu;0;L; 0395;;;;N;;;;; 1D6E7;MATHEMATICAL ITALIC CAPITAL ZETA;Lu;0;L; 0396;;;;N;;;;; 1D6E8;MATHEMATICAL ITALIC CAPITAL ETA;Lu;0;L; 0397;;;;N;;;;; 1D6E9;MATHEMATICAL ITALIC CAPITAL THETA;Lu;0;L; 0398;;;;N;;;;; 1D6EA;MATHEMATICAL ITALIC CAPITAL IOTA;Lu;0;L; 0399;;;;N;;;;; 1D6EB;MATHEMATICAL ITALIC CAPITAL KAPPA;Lu;0;L; 039A;;;;N;;;;; 1D6EC;MATHEMATICAL ITALIC CAPITAL LAMDA;Lu;0;L; 039B;;;;N;;;;; 1D6ED;MATHEMATICAL ITALIC CAPITAL MU;Lu;0;L; 039C;;;;N;;;;; 1D6EE;MATHEMATICAL ITALIC CAPITAL NU;Lu;0;L; 039D;;;;N;;;;; 1D6EF;MATHEMATICAL ITALIC CAPITAL XI;Lu;0;L; 039E;;;;N;;;;; 1D6F0;MATHEMATICAL ITALIC CAPITAL OMICRON;Lu;0;L; 039F;;;;N;;;;; 1D6F1;MATHEMATICAL ITALIC CAPITAL PI;Lu;0;L; 03A0;;;;N;;;;; 1D6F2;MATHEMATICAL ITALIC CAPITAL RHO;Lu;0;L; 03A1;;;;N;;;;; 1D6F3;MATHEMATICAL ITALIC CAPITAL THETA SYMBOL;Lu;0;L; 03F4;;;;N;;;;; 1D6F4;MATHEMATICAL ITALIC CAPITAL SIGMA;Lu;0;L; 03A3;;;;N;;;;; 1D6F5;MATHEMATICAL ITALIC CAPITAL TAU;Lu;0;L; 03A4;;;;N;;;;; 1D6F6;MATHEMATICAL ITALIC CAPITAL UPSILON;Lu;0;L; 03A5;;;;N;;;;; 1D6F7;MATHEMATICAL ITALIC CAPITAL PHI;Lu;0;L; 03A6;;;;N;;;;; 1D6F8;MATHEMATICAL ITALIC CAPITAL CHI;Lu;0;L; 03A7;;;;N;;;;; 1D6F9;MATHEMATICAL ITALIC CAPITAL PSI;Lu;0;L; 03A8;;;;N;;;;; 1D6FA;MATHEMATICAL ITALIC CAPITAL OMEGA;Lu;0;L; 03A9;;;;N;;;;; 1D6FB;MATHEMATICAL ITALIC NABLA;Sm;0;L; 2207;;;;N;;;;; 1D6FC;MATHEMATICAL ITALIC SMALL ALPHA;Ll;0;L; 03B1;;;;N;;;;; 1D6FD;MATHEMATICAL ITALIC SMALL BETA;Ll;0;L; 03B2;;;;N;;;;; 1D6FE;MATHEMATICAL ITALIC SMALL GAMMA;Ll;0;L; 03B3;;;;N;;;;; 1D6FF;MATHEMATICAL ITALIC SMALL DELTA;Ll;0;L; 03B4;;;;N;;;;; 1D700;MATHEMATICAL ITALIC SMALL EPSILON;Ll;0;L; 03B5;;;;N;;;;; 1D701;MATHEMATICAL ITALIC SMALL ZETA;Ll;0;L; 03B6;;;;N;;;;; 1D702;MATHEMATICAL ITALIC SMALL ETA;Ll;0;L; 03B7;;;;N;;;;; 1D703;MATHEMATICAL ITALIC SMALL THETA;Ll;0;L; 03B8;;;;N;;;;; 1D704;MATHEMATICAL ITALIC SMALL IOTA;Ll;0;L; 03B9;;;;N;;;;; 1D705;MATHEMATICAL ITALIC SMALL KAPPA;Ll;0;L; 03BA;;;;N;;;;; 1D706;MATHEMATICAL ITALIC SMALL LAMDA;Ll;0;L; 03BB;;;;N;;;;; 1D707;MATHEMATICAL ITALIC SMALL MU;Ll;0;L; 03BC;;;;N;;;;; 1D708;MATHEMATICAL ITALIC SMALL NU;Ll;0;L; 03BD;;;;N;;;;; 1D709;MATHEMATICAL ITALIC SMALL XI;Ll;0;L; 03BE;;;;N;;;;; 1D70A;MATHEMATICAL ITALIC SMALL OMICRON;Ll;0;L; 03BF;;;;N;;;;; 1D70B;MATHEMATICAL ITALIC SMALL PI;Ll;0;L; 03C0;;;;N;;;;; 1D70C;MATHEMATICAL ITALIC SMALL RHO;Ll;0;L; 03C1;;;;N;;;;; 1D70D;MATHEMATICAL ITALIC SMALL FINAL SIGMA;Ll;0;L; 03C2;;;;N;;;;; 1D70E;MATHEMATICAL ITALIC SMALL SIGMA;Ll;0;L; 03C3;;;;N;;;;; 1D70F;MATHEMATICAL ITALIC SMALL TAU;Ll;0;L; 03C4;;;;N;;;;; 1D710;MATHEMATICAL ITALIC SMALL UPSILON;Ll;0;L; 03C5;;;;N;;;;; 1D711;MATHEMATICAL ITALIC SMALL PHI;Ll;0;L; 03C6;;;;N;;;;; 1D712;MATHEMATICAL ITALIC SMALL CHI;Ll;0;L; 03C7;;;;N;;;;; 1D713;MATHEMATICAL ITALIC SMALL PSI;Ll;0;L; 03C8;;;;N;;;;; 1D714;MATHEMATICAL ITALIC SMALL OMEGA;Ll;0;L; 03C9;;;;N;;;;; 1D715;MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL;Sm;0;ON; 2202;;;;Y;;;;; 1D716;MATHEMATICAL ITALIC EPSILON SYMBOL;Ll;0;L; 03F5;;;;N;;;;; 1D717;MATHEMATICAL ITALIC THETA SYMBOL;Ll;0;L; 03D1;;;;N;;;;; 1D718;MATHEMATICAL ITALIC KAPPA SYMBOL;Ll;0;L; 03F0;;;;N;;;;; 1D719;MATHEMATICAL ITALIC PHI SYMBOL;Ll;0;L; 03D5;;;;N;;;;; 1D71A;MATHEMATICAL ITALIC RHO SYMBOL;Ll;0;L; 03F1;;;;N;;;;; 1D71B;MATHEMATICAL ITALIC PI SYMBOL;Ll;0;L; 03D6;;;;N;;;;; 1D71C;MATHEMATICAL BOLD ITALIC CAPITAL ALPHA;Lu;0;L; 0391;;;;N;;;;; 1D71D;MATHEMATICAL BOLD ITALIC CAPITAL BETA;Lu;0;L; 0392;;;;N;;;;; 1D71E;MATHEMATICAL BOLD ITALIC CAPITAL GAMMA;Lu;0;L; 0393;;;;N;;;;; 1D71F;MATHEMATICAL BOLD ITALIC CAPITAL DELTA;Lu;0;L; 0394;;;;N;;;;; 1D720;MATHEMATICAL BOLD ITALIC CAPITAL EPSILON;Lu;0;L; 0395;;;;N;;;;; 1D721;MATHEMATICAL BOLD ITALIC CAPITAL ZETA;Lu;0;L; 0396;;;;N;;;;; 1D722;MATHEMATICAL BOLD ITALIC CAPITAL ETA;Lu;0;L; 0397;;;;N;;;;; 1D723;MATHEMATICAL BOLD ITALIC CAPITAL THETA;Lu;0;L; 0398;;;;N;;;;; 1D724;MATHEMATICAL BOLD ITALIC CAPITAL IOTA;Lu;0;L; 0399;;;;N;;;;; 1D725;MATHEMATICAL BOLD ITALIC CAPITAL KAPPA;Lu;0;L; 039A;;;;N;;;;; 1D726;MATHEMATICAL BOLD ITALIC CAPITAL LAMDA;Lu;0;L; 039B;;;;N;;;;; 1D727;MATHEMATICAL BOLD ITALIC CAPITAL MU;Lu;0;L; 039C;;;;N;;;;; 1D728;MATHEMATICAL BOLD ITALIC CAPITAL NU;Lu;0;L; 039D;;;;N;;;;; 1D729;MATHEMATICAL BOLD ITALIC CAPITAL XI;Lu;0;L; 039E;;;;N;;;;; 1D72A;MATHEMATICAL BOLD ITALIC CAPITAL OMICRON;Lu;0;L; 039F;;;;N;;;;; 1D72B;MATHEMATICAL BOLD ITALIC CAPITAL PI;Lu;0;L; 03A0;;;;N;;;;; 1D72C;MATHEMATICAL BOLD ITALIC CAPITAL RHO;Lu;0;L; 03A1;;;;N;;;;; 1D72D;MATHEMATICAL BOLD ITALIC CAPITAL THETA SYMBOL;Lu;0;L; 03F4;;;;N;;;;; 1D72E;MATHEMATICAL BOLD ITALIC CAPITAL SIGMA;Lu;0;L; 03A3;;;;N;;;;; 1D72F;MATHEMATICAL BOLD ITALIC CAPITAL TAU;Lu;0;L; 03A4;;;;N;;;;; 1D730;MATHEMATICAL BOLD ITALIC CAPITAL UPSILON;Lu;0;L; 03A5;;;;N;;;;; 1D731;MATHEMATICAL BOLD ITALIC CAPITAL PHI;Lu;0;L; 03A6;;;;N;;;;; 1D732;MATHEMATICAL BOLD ITALIC CAPITAL CHI;Lu;0;L; 03A7;;;;N;;;;; 1D733;MATHEMATICAL BOLD ITALIC CAPITAL PSI;Lu;0;L; 03A8;;;;N;;;;; 1D734;MATHEMATICAL BOLD ITALIC CAPITAL OMEGA;Lu;0;L; 03A9;;;;N;;;;; 1D735;MATHEMATICAL BOLD ITALIC NABLA;Sm;0;L; 2207;;;;N;;;;; 1D736;MATHEMATICAL BOLD ITALIC SMALL ALPHA;Ll;0;L; 03B1;;;;N;;;;; 1D737;MATHEMATICAL BOLD ITALIC SMALL BETA;Ll;0;L; 03B2;;;;N;;;;; 1D738;MATHEMATICAL BOLD ITALIC SMALL GAMMA;Ll;0;L; 03B3;;;;N;;;;; 1D739;MATHEMATICAL BOLD ITALIC SMALL DELTA;Ll;0;L; 03B4;;;;N;;;;; 1D73A;MATHEMATICAL BOLD ITALIC SMALL EPSILON;Ll;0;L; 03B5;;;;N;;;;; 1D73B;MATHEMATICAL BOLD ITALIC SMALL ZETA;Ll;0;L; 03B6;;;;N;;;;; 1D73C;MATHEMATICAL BOLD ITALIC SMALL ETA;Ll;0;L; 03B7;;;;N;;;;; 1D73D;MATHEMATICAL BOLD ITALIC SMALL THETA;Ll;0;L; 03B8;;;;N;;;;; 1D73E;MATHEMATICAL BOLD ITALIC SMALL IOTA;Ll;0;L; 03B9;;;;N;;;;; 1D73F;MATHEMATICAL BOLD ITALIC SMALL KAPPA;Ll;0;L; 03BA;;;;N;;;;; 1D740;MATHEMATICAL BOLD ITALIC SMALL LAMDA;Ll;0;L; 03BB;;;;N;;;;; 1D741;MATHEMATICAL BOLD ITALIC SMALL MU;Ll;0;L; 03BC;;;;N;;;;; 1D742;MATHEMATICAL BOLD ITALIC SMALL NU;Ll;0;L; 03BD;;;;N;;;;; 1D743;MATHEMATICAL BOLD ITALIC SMALL XI;Ll;0;L; 03BE;;;;N;;;;; 1D744;MATHEMATICAL BOLD ITALIC SMALL OMICRON;Ll;0;L; 03BF;;;;N;;;;; 1D745;MATHEMATICAL BOLD ITALIC SMALL PI;Ll;0;L; 03C0;;;;N;;;;; 1D746;MATHEMATICAL BOLD ITALIC SMALL RHO;Ll;0;L; 03C1;;;;N;;;;; 1D747;MATHEMATICAL BOLD ITALIC SMALL FINAL SIGMA;Ll;0;L; 03C2;;;;N;;;;; 1D748;MATHEMATICAL BOLD ITALIC SMALL SIGMA;Ll;0;L; 03C3;;;;N;;;;; 1D749;MATHEMATICAL BOLD ITALIC SMALL TAU;Ll;0;L; 03C4;;;;N;;;;; 1D74A;MATHEMATICAL BOLD ITALIC SMALL UPSILON;Ll;0;L; 03C5;;;;N;;;;; 1D74B;MATHEMATICAL BOLD ITALIC SMALL PHI;Ll;0;L; 03C6;;;;N;;;;; 1D74C;MATHEMATICAL BOLD ITALIC SMALL CHI;Ll;0;L; 03C7;;;;N;;;;; 1D74D;MATHEMATICAL BOLD ITALIC SMALL PSI;Ll;0;L; 03C8;;;;N;;;;; 1D74E;MATHEMATICAL BOLD ITALIC SMALL OMEGA;Ll;0;L; 03C9;;;;N;;;;; 1D74F;MATHEMATICAL BOLD ITALIC PARTIAL DIFFERENTIAL;Sm;0;ON; 2202;;;;Y;;;;; 1D750;MATHEMATICAL BOLD ITALIC EPSILON SYMBOL;Ll;0;L; 03F5;;;;N;;;;; 1D751;MATHEMATICAL BOLD ITALIC THETA SYMBOL;Ll;0;L; 03D1;;;;N;;;;; 1D752;MATHEMATICAL BOLD ITALIC KAPPA SYMBOL;Ll;0;L; 03F0;;;;N;;;;; 1D753;MATHEMATICAL BOLD ITALIC PHI SYMBOL;Ll;0;L; 03D5;;;;N;;;;; 1D754;MATHEMATICAL BOLD ITALIC RHO SYMBOL;Ll;0;L; 03F1;;;;N;;;;; 1D755;MATHEMATICAL BOLD ITALIC PI SYMBOL;Ll;0;L; 03D6;;;;N;;;;; 1D756;MATHEMATICAL SANS-SERIF BOLD CAPITAL ALPHA;Lu;0;L; 0391;;;;N;;;;; 1D757;MATHEMATICAL SANS-SERIF BOLD CAPITAL BETA;Lu;0;L; 0392;;;;N;;;;; 1D758;MATHEMATICAL SANS-SERIF BOLD CAPITAL GAMMA;Lu;0;L; 0393;;;;N;;;;; 1D759;MATHEMATICAL SANS-SERIF BOLD CAPITAL DELTA;Lu;0;L; 0394;;;;N;;;;; 1D75A;MATHEMATICAL SANS-SERIF BOLD CAPITAL EPSILON;Lu;0;L; 0395;;;;N;;;;; 1D75B;MATHEMATICAL SANS-SERIF BOLD CAPITAL ZETA;Lu;0;L; 0396;;;;N;;;;; 1D75C;MATHEMATICAL SANS-SERIF BOLD CAPITAL ETA;Lu;0;L; 0397;;;;N;;;;; 1D75D;MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA;Lu;0;L; 0398;;;;N;;;;; 1D75E;MATHEMATICAL SANS-SERIF BOLD CAPITAL IOTA;Lu;0;L; 0399;;;;N;;;;; 1D75F;MATHEMATICAL SANS-SERIF BOLD CAPITAL KAPPA;Lu;0;L; 039A;;;;N;;;;; 1D760;MATHEMATICAL SANS-SERIF BOLD CAPITAL LAMDA;Lu;0;L; 039B;;;;N;;;;; 1D761;MATHEMATICAL SANS-SERIF BOLD CAPITAL MU;Lu;0;L; 039C;;;;N;;;;; 1D762;MATHEMATICAL SANS-SERIF BOLD CAPITAL NU;Lu;0;L; 039D;;;;N;;;;; 1D763;MATHEMATICAL SANS-SERIF BOLD CAPITAL XI;Lu;0;L; 039E;;;;N;;;;; 1D764;MATHEMATICAL SANS-SERIF BOLD CAPITAL OMICRON;Lu;0;L; 039F;;;;N;;;;; 1D765;MATHEMATICAL SANS-SERIF BOLD CAPITAL PI;Lu;0;L; 03A0;;;;N;;;;; 1D766;MATHEMATICAL SANS-SERIF BOLD CAPITAL RHO;Lu;0;L; 03A1;;;;N;;;;; 1D767;MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA SYMBOL;Lu;0;L; 03F4;;;;N;;;;; 1D768;MATHEMATICAL SANS-SERIF BOLD CAPITAL SIGMA;Lu;0;L; 03A3;;;;N;;;;; 1D769;MATHEMATICAL SANS-SERIF BOLD CAPITAL TAU;Lu;0;L; 03A4;;;;N;;;;; 1D76A;MATHEMATICAL SANS-SERIF BOLD CAPITAL UPSILON;Lu;0;L; 03A5;;;;N;;;;; 1D76B;MATHEMATICAL SANS-SERIF BOLD CAPITAL PHI;Lu;0;L; 03A6;;;;N;;;;; 1D76C;MATHEMATICAL SANS-SERIF BOLD CAPITAL CHI;Lu;0;L; 03A7;;;;N;;;;; 1D76D;MATHEMATICAL SANS-SERIF BOLD CAPITAL PSI;Lu;0;L; 03A8;;;;N;;;;; 1D76E;MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA;Lu;0;L; 03A9;;;;N;;;;; 1D76F;MATHEMATICAL SANS-SERIF BOLD NABLA;Sm;0;L; 2207;;;;N;;;;; 1D770;MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA;Ll;0;L; 03B1;;;;N;;;;; 1D771;MATHEMATICAL SANS-SERIF BOLD SMALL BETA;Ll;0;L; 03B2;;;;N;;;;; 1D772;MATHEMATICAL SANS-SERIF BOLD SMALL GAMMA;Ll;0;L; 03B3;;;;N;;;;; 1D773;MATHEMATICAL SANS-SERIF BOLD SMALL DELTA;Ll;0;L; 03B4;;;;N;;;;; 1D774;MATHEMATICAL SANS-SERIF BOLD SMALL EPSILON;Ll;0;L; 03B5;;;;N;;;;; 1D775;MATHEMATICAL SANS-SERIF BOLD SMALL ZETA;Ll;0;L; 03B6;;;;N;;;;; 1D776;MATHEMATICAL SANS-SERIF BOLD SMALL ETA;Ll;0;L; 03B7;;;;N;;;;; 1D777;MATHEMATICAL SANS-SERIF BOLD SMALL THETA;Ll;0;L; 03B8;;;;N;;;;; 1D778;MATHEMATICAL SANS-SERIF BOLD SMALL IOTA;Ll;0;L; 03B9;;;;N;;;;; 1D779;MATHEMATICAL SANS-SERIF BOLD SMALL KAPPA;Ll;0;L; 03BA;;;;N;;;;; 1D77A;MATHEMATICAL SANS-SERIF BOLD SMALL LAMDA;Ll;0;L; 03BB;;;;N;;;;; 1D77B;MATHEMATICAL SANS-SERIF BOLD SMALL MU;Ll;0;L; 03BC;;;;N;;;;; 1D77C;MATHEMATICAL SANS-SERIF BOLD SMALL NU;Ll;0;L; 03BD;;;;N;;;;; 1D77D;MATHEMATICAL SANS-SERIF BOLD SMALL XI;Ll;0;L; 03BE;;;;N;;;;; 1D77E;MATHEMATICAL SANS-SERIF BOLD SMALL OMICRON;Ll;0;L; 03BF;;;;N;;;;; 1D77F;MATHEMATICAL SANS-SERIF BOLD SMALL PI;Ll;0;L; 03C0;;;;N;;;;; 1D780;MATHEMATICAL SANS-SERIF BOLD SMALL RHO;Ll;0;L; 03C1;;;;N;;;;; 1D781;MATHEMATICAL SANS-SERIF BOLD SMALL FINAL SIGMA;Ll;0;L; 03C2;;;;N;;;;; 1D782;MATHEMATICAL SANS-SERIF BOLD SMALL SIGMA;Ll;0;L; 03C3;;;;N;;;;; 1D783;MATHEMATICAL SANS-SERIF BOLD SMALL TAU;Ll;0;L; 03C4;;;;N;;;;; 1D784;MATHEMATICAL SANS-SERIF BOLD SMALL UPSILON;Ll;0;L; 03C5;;;;N;;;;; 1D785;MATHEMATICAL SANS-SERIF BOLD SMALL PHI;Ll;0;L; 03C6;;;;N;;;;; 1D786;MATHEMATICAL SANS-SERIF BOLD SMALL CHI;Ll;0;L; 03C7;;;;N;;;;; 1D787;MATHEMATICAL SANS-SERIF BOLD SMALL PSI;Ll;0;L; 03C8;;;;N;;;;; 1D788;MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA;Ll;0;L; 03C9;;;;N;;;;; 1D789;MATHEMATICAL SANS-SERIF BOLD PARTIAL DIFFERENTIAL;Sm;0;ON; 2202;;;;Y;;;;; 1D78A;MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL;Ll;0;L; 03F5;;;;N;;;;; 1D78B;MATHEMATICAL SANS-SERIF BOLD THETA SYMBOL;Ll;0;L; 03D1;;;;N;;;;; 1D78C;MATHEMATICAL SANS-SERIF BOLD KAPPA SYMBOL;Ll;0;L; 03F0;;;;N;;;;; 1D78D;MATHEMATICAL SANS-SERIF BOLD PHI SYMBOL;Ll;0;L; 03D5;;;;N;;;;; 1D78E;MATHEMATICAL SANS-SERIF BOLD RHO SYMBOL;Ll;0;L; 03F1;;;;N;;;;; 1D78F;MATHEMATICAL SANS-SERIF BOLD PI SYMBOL;Ll;0;L; 03D6;;;;N;;;;; 1D790;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ALPHA;Lu;0;L; 0391;;;;N;;;;; 1D791;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL BETA;Lu;0;L; 0392;;;;N;;;;; 1D792;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL GAMMA;Lu;0;L; 0393;;;;N;;;;; 1D793;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL DELTA;Lu;0;L; 0394;;;;N;;;;; 1D794;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL EPSILON;Lu;0;L; 0395;;;;N;;;;; 1D795;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ZETA;Lu;0;L; 0396;;;;N;;;;; 1D796;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ETA;Lu;0;L; 0397;;;;N;;;;; 1D797;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA;Lu;0;L; 0398;;;;N;;;;; 1D798;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL IOTA;Lu;0;L; 0399;;;;N;;;;; 1D799;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL KAPPA;Lu;0;L; 039A;;;;N;;;;; 1D79A;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL LAMDA;Lu;0;L; 039B;;;;N;;;;; 1D79B;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL MU;Lu;0;L; 039C;;;;N;;;;; 1D79C;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL NU;Lu;0;L; 039D;;;;N;;;;; 1D79D;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL XI;Lu;0;L; 039E;;;;N;;;;; 1D79E;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMICRON;Lu;0;L; 039F;;;;N;;;;; 1D79F;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PI;Lu;0;L; 03A0;;;;N;;;;; 1D7A0;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL RHO;Lu;0;L; 03A1;;;;N;;;;; 1D7A1;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA SYMBOL;Lu;0;L; 03F4;;;;N;;;;; 1D7A2;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL SIGMA;Lu;0;L; 03A3;;;;N;;;;; 1D7A3;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL TAU;Lu;0;L; 03A4;;;;N;;;;; 1D7A4;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL UPSILON;Lu;0;L; 03A5;;;;N;;;;; 1D7A5;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PHI;Lu;0;L; 03A6;;;;N;;;;; 1D7A6;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL CHI;Lu;0;L; 03A7;;;;N;;;;; 1D7A7;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PSI;Lu;0;L; 03A8;;;;N;;;;; 1D7A8;MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA;Lu;0;L; 03A9;;;;N;;;;; 1D7A9;MATHEMATICAL SANS-SERIF BOLD ITALIC NABLA;Sm;0;L; 2207;;;;N;;;;; 1D7AA;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA;Ll;0;L; 03B1;;;;N;;;;; 1D7AB;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL BETA;Ll;0;L; 03B2;;;;N;;;;; 1D7AC;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL GAMMA;Ll;0;L; 03B3;;;;N;;;;; 1D7AD;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL DELTA;Ll;0;L; 03B4;;;;N;;;;; 1D7AE;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL EPSILON;Ll;0;L; 03B5;;;;N;;;;; 1D7AF;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ZETA;Ll;0;L; 03B6;;;;N;;;;; 1D7B0;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ETA;Ll;0;L; 03B7;;;;N;;;;; 1D7B1;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL THETA;Ll;0;L; 03B8;;;;N;;;;; 1D7B2;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL IOTA;Ll;0;L; 03B9;;;;N;;;;; 1D7B3;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL KAPPA;Ll;0;L; 03BA;;;;N;;;;; 1D7B4;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL LAMDA;Ll;0;L; 03BB;;;;N;;;;; 1D7B5;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL MU;Ll;0;L; 03BC;;;;N;;;;; 1D7B6;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL NU;Ll;0;L; 03BD;;;;N;;;;; 1D7B7;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL XI;Ll;0;L; 03BE;;;;N;;;;; 1D7B8;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMICRON;Ll;0;L; 03BF;;;;N;;;;; 1D7B9;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PI;Ll;0;L; 03C0;;;;N;;;;; 1D7BA;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL RHO;Ll;0;L; 03C1;;;;N;;;;; 1D7BB;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL FINAL SIGMA;Ll;0;L; 03C2;;;;N;;;;; 1D7BC;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL SIGMA;Ll;0;L; 03C3;;;;N;;;;; 1D7BD;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL TAU;Ll;0;L; 03C4;;;;N;;;;; 1D7BE;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL UPSILON;Ll;0;L; 03C5;;;;N;;;;; 1D7BF;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PHI;Ll;0;L; 03C6;;;;N;;;;; 1D7C0;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL CHI;Ll;0;L; 03C7;;;;N;;;;; 1D7C1;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PSI;Ll;0;L; 03C8;;;;N;;;;; 1D7C2;MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA;Ll;0;L; 03C9;;;;N;;;;; 1D7C3;MATHEMATICAL SANS-SERIF BOLD ITALIC PARTIAL DIFFERENTIAL;Sm;0;ON; 2202;;;;Y;;;;; 1D7C4;MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL;Ll;0;L; 03F5;;;;N;;;;; 1D7C5;MATHEMATICAL SANS-SERIF BOLD ITALIC THETA SYMBOL;Ll;0;L; 03D1;;;;N;;;;; 1D7C6;MATHEMATICAL SANS-SERIF BOLD ITALIC KAPPA SYMBOL;Ll;0;L; 03F0;;;;N;;;;; 1D7C7;MATHEMATICAL SANS-SERIF BOLD ITALIC PHI SYMBOL;Ll;0;L; 03D5;;;;N;;;;; 1D7C8;MATHEMATICAL SANS-SERIF BOLD ITALIC RHO SYMBOL;Ll;0;L; 03F1;;;;N;;;;; 1D7C9;MATHEMATICAL SANS-SERIF BOLD ITALIC PI SYMBOL;Ll;0;L; 03D6;;;;N;;;;; 1D7CA;MATHEMATICAL BOLD CAPITAL DIGAMMA;Lu;0;L; 03DC;;;;N;;;;; 1D7CB;MATHEMATICAL BOLD SMALL DIGAMMA;Ll;0;L; 03DD;;;;N;;;;; 1D7CE;MATHEMATICAL BOLD DIGIT ZERO;Nd;0;EN; 0030;0;0;0;N;;;;; 1D7CF;MATHEMATICAL BOLD DIGIT ONE;Nd;0;EN; 0031;1;1;1;N;;;;; 1D7D0;MATHEMATICAL BOLD DIGIT TWO;Nd;0;EN; 0032;2;2;2;N;;;;; 1D7D1;MATHEMATICAL BOLD DIGIT THREE;Nd;0;EN; 0033;3;3;3;N;;;;; 1D7D2;MATHEMATICAL BOLD DIGIT FOUR;Nd;0;EN; 0034;4;4;4;N;;;;; 1D7D3;MATHEMATICAL BOLD DIGIT FIVE;Nd;0;EN; 0035;5;5;5;N;;;;; 1D7D4;MATHEMATICAL BOLD DIGIT SIX;Nd;0;EN; 0036;6;6;6;N;;;;; 1D7D5;MATHEMATICAL BOLD DIGIT SEVEN;Nd;0;EN; 0037;7;7;7;N;;;;; 1D7D6;MATHEMATICAL BOLD DIGIT EIGHT;Nd;0;EN; 0038;8;8;8;N;;;;; 1D7D7;MATHEMATICAL BOLD DIGIT NINE;Nd;0;EN; 0039;9;9;9;N;;;;; 1D7D8;MATHEMATICAL DOUBLE-STRUCK DIGIT ZERO;Nd;0;EN; 0030;0;0;0;N;;;;; 1D7D9;MATHEMATICAL DOUBLE-STRUCK DIGIT ONE;Nd;0;EN; 0031;1;1;1;N;;;;; 1D7DA;MATHEMATICAL DOUBLE-STRUCK DIGIT TWO;Nd;0;EN; 0032;2;2;2;N;;;;; 1D7DB;MATHEMATICAL DOUBLE-STRUCK DIGIT THREE;Nd;0;EN; 0033;3;3;3;N;;;;; 1D7DC;MATHEMATICAL DOUBLE-STRUCK DIGIT FOUR;Nd;0;EN; 0034;4;4;4;N;;;;; 1D7DD;MATHEMATICAL DOUBLE-STRUCK DIGIT FIVE;Nd;0;EN; 0035;5;5;5;N;;;;; 1D7DE;MATHEMATICAL DOUBLE-STRUCK DIGIT SIX;Nd;0;EN; 0036;6;6;6;N;;;;; 1D7DF;MATHEMATICAL DOUBLE-STRUCK DIGIT SEVEN;Nd;0;EN; 0037;7;7;7;N;;;;; 1D7E0;MATHEMATICAL DOUBLE-STRUCK DIGIT EIGHT;Nd;0;EN; 0038;8;8;8;N;;;;; 1D7E1;MATHEMATICAL DOUBLE-STRUCK DIGIT NINE;Nd;0;EN; 0039;9;9;9;N;;;;; 1D7E2;MATHEMATICAL SANS-SERIF DIGIT ZERO;Nd;0;EN; 0030;0;0;0;N;;;;; 1D7E3;MATHEMATICAL SANS-SERIF DIGIT ONE;Nd;0;EN; 0031;1;1;1;N;;;;; 1D7E4;MATHEMATICAL SANS-SERIF DIGIT TWO;Nd;0;EN; 0032;2;2;2;N;;;;; 1D7E5;MATHEMATICAL SANS-SERIF DIGIT THREE;Nd;0;EN; 0033;3;3;3;N;;;;; 1D7E6;MATHEMATICAL SANS-SERIF DIGIT FOUR;Nd;0;EN; 0034;4;4;4;N;;;;; 1D7E7;MATHEMATICAL SANS-SERIF DIGIT FIVE;Nd;0;EN; 0035;5;5;5;N;;;;; 1D7E8;MATHEMATICAL SANS-SERIF DIGIT SIX;Nd;0;EN; 0036;6;6;6;N;;;;; 1D7E9;MATHEMATICAL SANS-SERIF DIGIT SEVEN;Nd;0;EN; 0037;7;7;7;N;;;;; 1D7EA;MATHEMATICAL SANS-SERIF DIGIT EIGHT;Nd;0;EN; 0038;8;8;8;N;;;;; 1D7EB;MATHEMATICAL SANS-SERIF DIGIT NINE;Nd;0;EN; 0039;9;9;9;N;;;;; 1D7EC;MATHEMATICAL SANS-SERIF BOLD DIGIT ZERO;Nd;0;EN; 0030;0;0;0;N;;;;; 1D7ED;MATHEMATICAL SANS-SERIF BOLD DIGIT ONE;Nd;0;EN; 0031;1;1;1;N;;;;; 1D7EE;MATHEMATICAL SANS-SERIF BOLD DIGIT TWO;Nd;0;EN; 0032;2;2;2;N;;;;; 1D7EF;MATHEMATICAL SANS-SERIF BOLD DIGIT THREE;Nd;0;EN; 0033;3;3;3;N;;;;; 1D7F0;MATHEMATICAL SANS-SERIF BOLD DIGIT FOUR;Nd;0;EN; 0034;4;4;4;N;;;;; 1D7F1;MATHEMATICAL SANS-SERIF BOLD DIGIT FIVE;Nd;0;EN; 0035;5;5;5;N;;;;; 1D7F2;MATHEMATICAL SANS-SERIF BOLD DIGIT SIX;Nd;0;EN; 0036;6;6;6;N;;;;; 1D7F3;MATHEMATICAL SANS-SERIF BOLD DIGIT SEVEN;Nd;0;EN; 0037;7;7;7;N;;;;; 1D7F4;MATHEMATICAL SANS-SERIF BOLD DIGIT EIGHT;Nd;0;EN; 0038;8;8;8;N;;;;; 1D7F5;MATHEMATICAL SANS-SERIF BOLD DIGIT NINE;Nd;0;EN; 0039;9;9;9;N;;;;; 1D7F6;MATHEMATICAL MONOSPACE DIGIT ZERO;Nd;0;EN; 0030;0;0;0;N;;;;; 1D7F7;MATHEMATICAL MONOSPACE DIGIT ONE;Nd;0;EN; 0031;1;1;1;N;;;;; 1D7F8;MATHEMATICAL MONOSPACE DIGIT TWO;Nd;0;EN; 0032;2;2;2;N;;;;; 1D7F9;MATHEMATICAL MONOSPACE DIGIT THREE;Nd;0;EN; 0033;3;3;3;N;;;;; 1D7FA;MATHEMATICAL MONOSPACE DIGIT FOUR;Nd;0;EN; 0034;4;4;4;N;;;;; 1D7FB;MATHEMATICAL MONOSPACE DIGIT FIVE;Nd;0;EN; 0035;5;5;5;N;;;;; 1D7FC;MATHEMATICAL MONOSPACE DIGIT SIX;Nd;0;EN; 0036;6;6;6;N;;;;; 1D7FD;MATHEMATICAL MONOSPACE DIGIT SEVEN;Nd;0;EN; 0037;7;7;7;N;;;;; 1D7FE;MATHEMATICAL MONOSPACE DIGIT EIGHT;Nd;0;EN; 0038;8;8;8;N;;;;; 1D7FF;MATHEMATICAL MONOSPACE DIGIT NINE;Nd;0;EN; 0039;9;9;9;N;;;;; 1EE00;ARABIC MATHEMATICAL ALEF;Lo;0;AL; 0627;;;;N;;;;; 1EE01;ARABIC MATHEMATICAL BEH;Lo;0;AL; 0628;;;;N;;;;; 1EE02;ARABIC MATHEMATICAL JEEM;Lo;0;AL; 062C;;;;N;;;;; 1EE03;ARABIC MATHEMATICAL DAL;Lo;0;AL; 062F;;;;N;;;;; 1EE05;ARABIC MATHEMATICAL WAW;Lo;0;AL; 0648;;;;N;;;;; 1EE06;ARABIC MATHEMATICAL ZAIN;Lo;0;AL; 0632;;;;N;;;;; 1EE07;ARABIC MATHEMATICAL HAH;Lo;0;AL; 062D;;;;N;;;;; 1EE08;ARABIC MATHEMATICAL TAH;Lo;0;AL; 0637;;;;N;;;;; 1EE09;ARABIC MATHEMATICAL YEH;Lo;0;AL; 064A;;;;N;;;;; 1EE0A;ARABIC MATHEMATICAL KAF;Lo;0;AL; 0643;;;;N;;;;; 1EE0B;ARABIC MATHEMATICAL LAM;Lo;0;AL; 0644;;;;N;;;;; 1EE0C;ARABIC MATHEMATICAL MEEM;Lo;0;AL; 0645;;;;N;;;;; 1EE0D;ARABIC MATHEMATICAL NOON;Lo;0;AL; 0646;;;;N;;;;; 1EE0E;ARABIC MATHEMATICAL SEEN;Lo;0;AL; 0633;;;;N;;;;; 1EE0F;ARABIC MATHEMATICAL AIN;Lo;0;AL; 0639;;;;N;;;;; 1EE10;ARABIC MATHEMATICAL FEH;Lo;0;AL; 0641;;;;N;;;;; 1EE11;ARABIC MATHEMATICAL SAD;Lo;0;AL; 0635;;;;N;;;;; 1EE12;ARABIC MATHEMATICAL QAF;Lo;0;AL; 0642;;;;N;;;;; 1EE13;ARABIC MATHEMATICAL REH;Lo;0;AL; 0631;;;;N;;;;; 1EE14;ARABIC MATHEMATICAL SHEEN;Lo;0;AL; 0634;;;;N;;;;; 1EE15;ARABIC MATHEMATICAL TEH;Lo;0;AL; 062A;;;;N;;;;; 1EE16;ARABIC MATHEMATICAL THEH;Lo;0;AL; 062B;;;;N;;;;; 1EE17;ARABIC MATHEMATICAL KHAH;Lo;0;AL; 062E;;;;N;;;;; 1EE18;ARABIC MATHEMATICAL THAL;Lo;0;AL; 0630;;;;N;;;;; 1EE19;ARABIC MATHEMATICAL DAD;Lo;0;AL; 0636;;;;N;;;;; 1EE1A;ARABIC MATHEMATICAL ZAH;Lo;0;AL; 0638;;;;N;;;;; 1EE1B;ARABIC MATHEMATICAL GHAIN;Lo;0;AL; 063A;;;;N;;;;; 1EE1C;ARABIC MATHEMATICAL DOTLESS BEH;Lo;0;AL; 066E;;;;N;;;;; 1EE1D;ARABIC MATHEMATICAL DOTLESS NOON;Lo;0;AL; 06BA;;;;N;;;;; 1EE1E;ARABIC MATHEMATICAL DOTLESS FEH;Lo;0;AL; 06A1;;;;N;;;;; 1EE1F;ARABIC MATHEMATICAL DOTLESS QAF;Lo;0;AL; 066F;;;;N;;;;; 1EE21;ARABIC MATHEMATICAL INITIAL BEH;Lo;0;AL; 0628;;;;N;;;;; 1EE22;ARABIC MATHEMATICAL INITIAL JEEM;Lo;0;AL; 062C;;;;N;;;;; 1EE24;ARABIC MATHEMATICAL INITIAL HEH;Lo;0;AL; 0647;;;;N;;;;; 1EE27;ARABIC MATHEMATICAL INITIAL HAH;Lo;0;AL; 062D;;;;N;;;;; 1EE29;ARABIC MATHEMATICAL INITIAL YEH;Lo;0;AL; 064A;;;;N;;;;; 1EE2A;ARABIC MATHEMATICAL INITIAL KAF;Lo;0;AL; 0643;;;;N;;;;; 1EE2B;ARABIC MATHEMATICAL INITIAL LAM;Lo;0;AL; 0644;;;;N;;;;; 1EE2C;ARABIC MATHEMATICAL INITIAL MEEM;Lo;0;AL; 0645;;;;N;;;;; 1EE2D;ARABIC MATHEMATICAL INITIAL NOON;Lo;0;AL; 0646;;;;N;;;;; 1EE2E;ARABIC MATHEMATICAL INITIAL SEEN;Lo;0;AL; 0633;;;;N;;;;; 1EE2F;ARABIC MATHEMATICAL INITIAL AIN;Lo;0;AL; 0639;;;;N;;;;; 1EE30;ARABIC MATHEMATICAL INITIAL FEH;Lo;0;AL; 0641;;;;N;;;;; 1EE31;ARABIC MATHEMATICAL INITIAL SAD;Lo;0;AL; 0635;;;;N;;;;; 1EE32;ARABIC MATHEMATICAL INITIAL QAF;Lo;0;AL; 0642;;;;N;;;;; 1EE34;ARABIC MATHEMATICAL INITIAL SHEEN;Lo;0;AL; 0634;;;;N;;;;; 1EE35;ARABIC MATHEMATICAL INITIAL TEH;Lo;0;AL; 062A;;;;N;;;;; 1EE36;ARABIC MATHEMATICAL INITIAL THEH;Lo;0;AL; 062B;;;;N;;;;; 1EE37;ARABIC MATHEMATICAL INITIAL KHAH;Lo;0;AL; 062E;;;;N;;;;; 1EE39;ARABIC MATHEMATICAL INITIAL DAD;Lo;0;AL; 0636;;;;N;;;;; 1EE3B;ARABIC MATHEMATICAL INITIAL GHAIN;Lo;0;AL; 063A;;;;N;;;;; 1EE42;ARABIC MATHEMATICAL TAILED JEEM;Lo;0;AL; 062C;;;;N;;;;; 1EE47;ARABIC MATHEMATICAL TAILED HAH;Lo;0;AL; 062D;;;;N;;;;; 1EE49;ARABIC MATHEMATICAL TAILED YEH;Lo;0;AL; 064A;;;;N;;;;; 1EE4B;ARABIC MATHEMATICAL TAILED LAM;Lo;0;AL; 0644;;;;N;;;;; 1EE4D;ARABIC MATHEMATICAL TAILED NOON;Lo;0;AL; 0646;;;;N;;;;; 1EE4E;ARABIC MATHEMATICAL TAILED SEEN;Lo;0;AL; 0633;;;;N;;;;; 1EE4F;ARABIC MATHEMATICAL TAILED AIN;Lo;0;AL; 0639;;;;N;;;;; 1EE51;ARABIC MATHEMATICAL TAILED SAD;Lo;0;AL; 0635;;;;N;;;;; 1EE52;ARABIC MATHEMATICAL TAILED QAF;Lo;0;AL; 0642;;;;N;;;;; 1EE54;ARABIC MATHEMATICAL TAILED SHEEN;Lo;0;AL; 0634;;;;N;;;;; 1EE57;ARABIC MATHEMATICAL TAILED KHAH;Lo;0;AL; 062E;;;;N;;;;; 1EE59;ARABIC MATHEMATICAL TAILED DAD;Lo;0;AL; 0636;;;;N;;;;; 1EE5B;ARABIC MATHEMATICAL TAILED GHAIN;Lo;0;AL; 063A;;;;N;;;;; 1EE5D;ARABIC MATHEMATICAL TAILED DOTLESS NOON;Lo;0;AL; 06BA;;;;N;;;;; 1EE5F;ARABIC MATHEMATICAL TAILED DOTLESS QAF;Lo;0;AL; 066F;;;;N;;;;; 1EE61;ARABIC MATHEMATICAL STRETCHED BEH;Lo;0;AL; 0628;;;;N;;;;; 1EE62;ARABIC MATHEMATICAL STRETCHED JEEM;Lo;0;AL; 062C;;;;N;;;;; 1EE64;ARABIC MATHEMATICAL STRETCHED HEH;Lo;0;AL; 0647;;;;N;;;;; 1EE67;ARABIC MATHEMATICAL STRETCHED HAH;Lo;0;AL; 062D;;;;N;;;;; 1EE68;ARABIC MATHEMATICAL STRETCHED TAH;Lo;0;AL; 0637;;;;N;;;;; 1EE69;ARABIC MATHEMATICAL STRETCHED YEH;Lo;0;AL; 064A;;;;N;;;;; 1EE6A;ARABIC MATHEMATICAL STRETCHED KAF;Lo;0;AL; 0643;;;;N;;;;; 1EE6C;ARABIC MATHEMATICAL STRETCHED MEEM;Lo;0;AL; 0645;;;;N;;;;; 1EE6D;ARABIC MATHEMATICAL STRETCHED NOON;Lo;0;AL; 0646;;;;N;;;;; 1EE6E;ARABIC MATHEMATICAL STRETCHED SEEN;Lo;0;AL; 0633;;;;N;;;;; 1EE6F;ARABIC MATHEMATICAL STRETCHED AIN;Lo;0;AL; 0639;;;;N;;;;; 1EE70;ARABIC MATHEMATICAL STRETCHED FEH;Lo;0;AL; 0641;;;;N;;;;; 1EE71;ARABIC MATHEMATICAL STRETCHED SAD;Lo;0;AL; 0635;;;;N;;;;; 1EE72;ARABIC MATHEMATICAL STRETCHED QAF;Lo;0;AL; 0642;;;;N;;;;; 1EE74;ARABIC MATHEMATICAL STRETCHED SHEEN;Lo;0;AL; 0634;;;;N;;;;; 1EE75;ARABIC MATHEMATICAL STRETCHED TEH;Lo;0;AL; 062A;;;;N;;;;; 1EE76;ARABIC MATHEMATICAL STRETCHED THEH;Lo;0;AL; 062B;;;;N;;;;; 1EE77;ARABIC MATHEMATICAL STRETCHED KHAH;Lo;0;AL; 062E;;;;N;;;;; 1EE79;ARABIC MATHEMATICAL STRETCHED DAD;Lo;0;AL; 0636;;;;N;;;;; 1EE7A;ARABIC MATHEMATICAL STRETCHED ZAH;Lo;0;AL; 0638;;;;N;;;;; 1EE7B;ARABIC MATHEMATICAL STRETCHED GHAIN;Lo;0;AL; 063A;;;;N;;;;; 1EE7C;ARABIC MATHEMATICAL STRETCHED DOTLESS BEH;Lo;0;AL; 066E;;;;N;;;;; 1EE7E;ARABIC MATHEMATICAL STRETCHED DOTLESS FEH;Lo;0;AL; 06A1;;;;N;;;;; 1EE80;ARABIC MATHEMATICAL LOOPED ALEF;Lo;0;AL; 0627;;;;N;;;;; 1EE81;ARABIC MATHEMATICAL LOOPED BEH;Lo;0;AL; 0628;;;;N;;;;; 1EE82;ARABIC MATHEMATICAL LOOPED JEEM;Lo;0;AL; 062C;;;;N;;;;; 1EE83;ARABIC MATHEMATICAL LOOPED DAL;Lo;0;AL; 062F;;;;N;;;;; 1EE84;ARABIC MATHEMATICAL LOOPED HEH;Lo;0;AL; 0647;;;;N;;;;; 1EE85;ARABIC MATHEMATICAL LOOPED WAW;Lo;0;AL; 0648;;;;N;;;;; 1EE86;ARABIC MATHEMATICAL LOOPED ZAIN;Lo;0;AL; 0632;;;;N;;;;; 1EE87;ARABIC MATHEMATICAL LOOPED HAH;Lo;0;AL; 062D;;;;N;;;;; 1EE88;ARABIC MATHEMATICAL LOOPED TAH;Lo;0;AL; 0637;;;;N;;;;; 1EE89;ARABIC MATHEMATICAL LOOPED YEH;Lo;0;AL; 064A;;;;N;;;;; 1EE8B;ARABIC MATHEMATICAL LOOPED LAM;Lo;0;AL; 0644;;;;N;;;;; 1EE8C;ARABIC MATHEMATICAL LOOPED MEEM;Lo;0;AL; 0645;;;;N;;;;; 1EE8D;ARABIC MATHEMATICAL LOOPED NOON;Lo;0;AL; 0646;;;;N;;;;; 1EE8E;ARABIC MATHEMATICAL LOOPED SEEN;Lo;0;AL; 0633;;;;N;;;;; 1EE8F;ARABIC MATHEMATICAL LOOPED AIN;Lo;0;AL; 0639;;;;N;;;;; 1EE90;ARABIC MATHEMATICAL LOOPED FEH;Lo;0;AL; 0641;;;;N;;;;; 1EE91;ARABIC MATHEMATICAL LOOPED SAD;Lo;0;AL; 0635;;;;N;;;;; 1EE92;ARABIC MATHEMATICAL LOOPED QAF;Lo;0;AL; 0642;;;;N;;;;; 1EE93;ARABIC MATHEMATICAL LOOPED REH;Lo;0;AL; 0631;;;;N;;;;; 1EE94;ARABIC MATHEMATICAL LOOPED SHEEN;Lo;0;AL; 0634;;;;N;;;;; 1EE95;ARABIC MATHEMATICAL LOOPED TEH;Lo;0;AL; 062A;;;;N;;;;; 1EE96;ARABIC MATHEMATICAL LOOPED THEH;Lo;0;AL; 062B;;;;N;;;;; 1EE97;ARABIC MATHEMATICAL LOOPED KHAH;Lo;0;AL; 062E;;;;N;;;;; 1EE98;ARABIC MATHEMATICAL LOOPED THAL;Lo;0;AL; 0630;;;;N;;;;; 1EE99;ARABIC MATHEMATICAL LOOPED DAD;Lo;0;AL; 0636;;;;N;;;;; 1EE9A;ARABIC MATHEMATICAL LOOPED ZAH;Lo;0;AL; 0638;;;;N;;;;; 1EE9B;ARABIC MATHEMATICAL LOOPED GHAIN;Lo;0;AL; 063A;;;;N;;;;; 1EEA1;ARABIC MATHEMATICAL DOUBLE-STRUCK BEH;Lo;0;AL; 0628;;;;N;;;;; 1EEA2;ARABIC MATHEMATICAL DOUBLE-STRUCK JEEM;Lo;0;AL; 062C;;;;N;;;;; 1EEA3;ARABIC MATHEMATICAL DOUBLE-STRUCK DAL;Lo;0;AL; 062F;;;;N;;;;; 1EEA5;ARABIC MATHEMATICAL DOUBLE-STRUCK WAW;Lo;0;AL; 0648;;;;N;;;;; 1EEA6;ARABIC MATHEMATICAL DOUBLE-STRUCK ZAIN;Lo;0;AL; 0632;;;;N;;;;; 1EEA7;ARABIC MATHEMATICAL DOUBLE-STRUCK HAH;Lo;0;AL; 062D;;;;N;;;;; 1EEA8;ARABIC MATHEMATICAL DOUBLE-STRUCK TAH;Lo;0;AL; 0637;;;;N;;;;; 1EEA9;ARABIC MATHEMATICAL DOUBLE-STRUCK YEH;Lo;0;AL; 064A;;;;N;;;;; 1EEAB;ARABIC MATHEMATICAL DOUBLE-STRUCK LAM;Lo;0;AL; 0644;;;;N;;;;; 1EEAC;ARABIC MATHEMATICAL DOUBLE-STRUCK MEEM;Lo;0;AL; 0645;;;;N;;;;; 1EEAD;ARABIC MATHEMATICAL DOUBLE-STRUCK NOON;Lo;0;AL; 0646;;;;N;;;;; 1EEAE;ARABIC MATHEMATICAL DOUBLE-STRUCK SEEN;Lo;0;AL; 0633;;;;N;;;;; 1EEAF;ARABIC MATHEMATICAL DOUBLE-STRUCK AIN;Lo;0;AL; 0639;;;;N;;;;; 1EEB0;ARABIC MATHEMATICAL DOUBLE-STRUCK FEH;Lo;0;AL; 0641;;;;N;;;;; 1EEB1;ARABIC MATHEMATICAL DOUBLE-STRUCK SAD;Lo;0;AL; 0635;;;;N;;;;; 1EEB2;ARABIC MATHEMATICAL DOUBLE-STRUCK QAF;Lo;0;AL; 0642;;;;N;;;;; 1EEB3;ARABIC MATHEMATICAL DOUBLE-STRUCK REH;Lo;0;AL; 0631;;;;N;;;;; 1EEB4;ARABIC MATHEMATICAL DOUBLE-STRUCK SHEEN;Lo;0;AL; 0634;;;;N;;;;; 1EEB5;ARABIC MATHEMATICAL DOUBLE-STRUCK TEH;Lo;0;AL; 062A;;;;N;;;;; 1EEB6;ARABIC MATHEMATICAL DOUBLE-STRUCK THEH;Lo;0;AL; 062B;;;;N;;;;; 1EEB7;ARABIC MATHEMATICAL DOUBLE-STRUCK KHAH;Lo;0;AL; 062E;;;;N;;;;; 1EEB8;ARABIC MATHEMATICAL DOUBLE-STRUCK THAL;Lo;0;AL; 0630;;;;N;;;;; 1EEB9;ARABIC MATHEMATICAL DOUBLE-STRUCK DAD;Lo;0;AL; 0636;;;;N;;;;; 1EEBA;ARABIC MATHEMATICAL DOUBLE-STRUCK ZAH;Lo;0;AL; 0638;;;;N;;;;; 1EEBB;ARABIC MATHEMATICAL DOUBLE-STRUCK GHAIN;Lo;0;AL; 063A;;;;N;;;;; 1EEF0;ARABIC MATHEMATICAL OPERATOR MEEM WITH HAH WITH TATWEEL;Sm;0;ON;;;;;N;;;;; 1EEF1;ARABIC MATHEMATICAL OPERATOR HAH WITH DAL;Sm;0;ON;;;;;N;;;;; 1F000;MAHJONG TILE EAST WIND;So;0;ON;;;;;N;;;;; 1F001;MAHJONG TILE SOUTH WIND;So;0;ON;;;;;N;;;;; 1F002;MAHJONG TILE WEST WIND;So;0;ON;;;;;N;;;;; 1F003;MAHJONG TILE NORTH WIND;So;0;ON;;;;;N;;;;; 1F004;MAHJONG TILE RED DRAGON;So;0;ON;;;;;N;;;;; 1F005;MAHJONG TILE GREEN DRAGON;So;0;ON;;;;;N;;;;; 1F006;MAHJONG TILE WHITE DRAGON;So;0;ON;;;;;N;;;;; 1F007;MAHJONG TILE ONE OF CHARACTERS;So;0;ON;;;;;N;;;;; 1F008;MAHJONG TILE TWO OF CHARACTERS;So;0;ON;;;;;N;;;;; 1F009;MAHJONG TILE THREE OF CHARACTERS;So;0;ON;;;;;N;;;;; 1F00A;MAHJONG TILE FOUR OF CHARACTERS;So;0;ON;;;;;N;;;;; 1F00B;MAHJONG TILE FIVE OF CHARACTERS;So;0;ON;;;;;N;;;;; 1F00C;MAHJONG TILE SIX OF CHARACTERS;So;0;ON;;;;;N;;;;; 1F00D;MAHJONG TILE SEVEN OF CHARACTERS;So;0;ON;;;;;N;;;;; 1F00E;MAHJONG TILE EIGHT OF CHARACTERS;So;0;ON;;;;;N;;;;; 1F00F;MAHJONG TILE NINE OF CHARACTERS;So;0;ON;;;;;N;;;;; 1F010;MAHJONG TILE ONE OF BAMBOOS;So;0;ON;;;;;N;;;;; 1F011;MAHJONG TILE TWO OF BAMBOOS;So;0;ON;;;;;N;;;;; 1F012;MAHJONG TILE THREE OF BAMBOOS;So;0;ON;;;;;N;;;;; 1F013;MAHJONG TILE FOUR OF BAMBOOS;So;0;ON;;;;;N;;;;; 1F014;MAHJONG TILE FIVE OF BAMBOOS;So;0;ON;;;;;N;;;;; 1F015;MAHJONG TILE SIX OF BAMBOOS;So;0;ON;;;;;N;;;;; 1F016;MAHJONG TILE SEVEN OF BAMBOOS;So;0;ON;;;;;N;;;;; 1F017;MAHJONG TILE EIGHT OF BAMBOOS;So;0;ON;;;;;N;;;;; 1F018;MAHJONG TILE NINE OF BAMBOOS;So;0;ON;;;;;N;;;;; 1F019;MAHJONG TILE ONE OF CIRCLES;So;0;ON;;;;;N;;;;; 1F01A;MAHJONG TILE TWO OF CIRCLES;So;0;ON;;;;;N;;;;; 1F01B;MAHJONG TILE THREE OF CIRCLES;So;0;ON;;;;;N;;;;; 1F01C;MAHJONG TILE FOUR OF CIRCLES;So;0;ON;;;;;N;;;;; 1F01D;MAHJONG TILE FIVE OF CIRCLES;So;0;ON;;;;;N;;;;; 1F01E;MAHJONG TILE SIX OF CIRCLES;So;0;ON;;;;;N;;;;; 1F01F;MAHJONG TILE SEVEN OF CIRCLES;So;0;ON;;;;;N;;;;; 1F020;MAHJONG TILE EIGHT OF CIRCLES;So;0;ON;;;;;N;;;;; 1F021;MAHJONG TILE NINE OF CIRCLES;So;0;ON;;;;;N;;;;; 1F022;MAHJONG TILE PLUM;So;0;ON;;;;;N;;;;; 1F023;MAHJONG TILE ORCHID;So;0;ON;;;;;N;;;;; 1F024;MAHJONG TILE BAMBOO;So;0;ON;;;;;N;;;;; 1F025;MAHJONG TILE CHRYSANTHEMUM;So;0;ON;;;;;N;;;;; 1F026;MAHJONG TILE SPRING;So;0;ON;;;;;N;;;;; 1F027;MAHJONG TILE SUMMER;So;0;ON;;;;;N;;;;; 1F028;MAHJONG TILE AUTUMN;So;0;ON;;;;;N;;;;; 1F029;MAHJONG TILE WINTER;So;0;ON;;;;;N;;;;; 1F02A;MAHJONG TILE JOKER;So;0;ON;;;;;N;;;;; 1F02B;MAHJONG TILE BACK;So;0;ON;;;;;N;;;;; 1F030;DOMINO TILE HORIZONTAL BACK;So;0;ON;;;;;N;;;;; 1F031;DOMINO TILE HORIZONTAL-00-00;So;0;ON;;;;;N;;;;; 1F032;DOMINO TILE HORIZONTAL-00-01;So;0;ON;;;;;N;;;;; 1F033;DOMINO TILE HORIZONTAL-00-02;So;0;ON;;;;;N;;;;; 1F034;DOMINO TILE HORIZONTAL-00-03;So;0;ON;;;;;N;;;;; 1F035;DOMINO TILE HORIZONTAL-00-04;So;0;ON;;;;;N;;;;; 1F036;DOMINO TILE HORIZONTAL-00-05;So;0;ON;;;;;N;;;;; 1F037;DOMINO TILE HORIZONTAL-00-06;So;0;ON;;;;;N;;;;; 1F038;DOMINO TILE HORIZONTAL-01-00;So;0;ON;;;;;N;;;;; 1F039;DOMINO TILE HORIZONTAL-01-01;So;0;ON;;;;;N;;;;; 1F03A;DOMINO TILE HORIZONTAL-01-02;So;0;ON;;;;;N;;;;; 1F03B;DOMINO TILE HORIZONTAL-01-03;So;0;ON;;;;;N;;;;; 1F03C;DOMINO TILE HORIZONTAL-01-04;So;0;ON;;;;;N;;;;; 1F03D;DOMINO TILE HORIZONTAL-01-05;So;0;ON;;;;;N;;;;; 1F03E;DOMINO TILE HORIZONTAL-01-06;So;0;ON;;;;;N;;;;; 1F03F;DOMINO TILE HORIZONTAL-02-00;So;0;ON;;;;;N;;;;; 1F040;DOMINO TILE HORIZONTAL-02-01;So;0;ON;;;;;N;;;;; 1F041;DOMINO TILE HORIZONTAL-02-02;So;0;ON;;;;;N;;;;; 1F042;DOMINO TILE HORIZONTAL-02-03;So;0;ON;;;;;N;;;;; 1F043;DOMINO TILE HORIZONTAL-02-04;So;0;ON;;;;;N;;;;; 1F044;DOMINO TILE HORIZONTAL-02-05;So;0;ON;;;;;N;;;;; 1F045;DOMINO TILE HORIZONTAL-02-06;So;0;ON;;;;;N;;;;; 1F046;DOMINO TILE HORIZONTAL-03-00;So;0;ON;;;;;N;;;;; 1F047;DOMINO TILE HORIZONTAL-03-01;So;0;ON;;;;;N;;;;; 1F048;DOMINO TILE HORIZONTAL-03-02;So;0;ON;;;;;N;;;;; 1F049;DOMINO TILE HORIZONTAL-03-03;So;0;ON;;;;;N;;;;; 1F04A;DOMINO TILE HORIZONTAL-03-04;So;0;ON;;;;;N;;;;; 1F04B;DOMINO TILE HORIZONTAL-03-05;So;0;ON;;;;;N;;;;; 1F04C;DOMINO TILE HORIZONTAL-03-06;So;0;ON;;;;;N;;;;; 1F04D;DOMINO TILE HORIZONTAL-04-00;So;0;ON;;;;;N;;;;; 1F04E;DOMINO TILE HORIZONTAL-04-01;So;0;ON;;;;;N;;;;; 1F04F;DOMINO TILE HORIZONTAL-04-02;So;0;ON;;;;;N;;;;; 1F050;DOMINO TILE HORIZONTAL-04-03;So;0;ON;;;;;N;;;;; 1F051;DOMINO TILE HORIZONTAL-04-04;So;0;ON;;;;;N;;;;; 1F052;DOMINO TILE HORIZONTAL-04-05;So;0;ON;;;;;N;;;;; 1F053;DOMINO TILE HORIZONTAL-04-06;So;0;ON;;;;;N;;;;; 1F054;DOMINO TILE HORIZONTAL-05-00;So;0;ON;;;;;N;;;;; 1F055;DOMINO TILE HORIZONTAL-05-01;So;0;ON;;;;;N;;;;; 1F056;DOMINO TILE HORIZONTAL-05-02;So;0;ON;;;;;N;;;;; 1F057;DOMINO TILE HORIZONTAL-05-03;So;0;ON;;;;;N;;;;; 1F058;DOMINO TILE HORIZONTAL-05-04;So;0;ON;;;;;N;;;;; 1F059;DOMINO TILE HORIZONTAL-05-05;So;0;ON;;;;;N;;;;; 1F05A;DOMINO TILE HORIZONTAL-05-06;So;0;ON;;;;;N;;;;; 1F05B;DOMINO TILE HORIZONTAL-06-00;So;0;ON;;;;;N;;;;; 1F05C;DOMINO TILE HORIZONTAL-06-01;So;0;ON;;;;;N;;;;; 1F05D;DOMINO TILE HORIZONTAL-06-02;So;0;ON;;;;;N;;;;; 1F05E;DOMINO TILE HORIZONTAL-06-03;So;0;ON;;;;;N;;;;; 1F05F;DOMINO TILE HORIZONTAL-06-04;So;0;ON;;;;;N;;;;; 1F060;DOMINO TILE HORIZONTAL-06-05;So;0;ON;;;;;N;;;;; 1F061;DOMINO TILE HORIZONTAL-06-06;So;0;ON;;;;;N;;;;; 1F062;DOMINO TILE VERTICAL BACK;So;0;ON;;;;;N;;;;; 1F063;DOMINO TILE VERTICAL-00-00;So;0;ON;;;;;N;;;;; 1F064;DOMINO TILE VERTICAL-00-01;So;0;ON;;;;;N;;;;; 1F065;DOMINO TILE VERTICAL-00-02;So;0;ON;;;;;N;;;;; 1F066;DOMINO TILE VERTICAL-00-03;So;0;ON;;;;;N;;;;; 1F067;DOMINO TILE VERTICAL-00-04;So;0;ON;;;;;N;;;;; 1F068;DOMINO TILE VERTICAL-00-05;So;0;ON;;;;;N;;;;; 1F069;DOMINO TILE VERTICAL-00-06;So;0;ON;;;;;N;;;;; 1F06A;DOMINO TILE VERTICAL-01-00;So;0;ON;;;;;N;;;;; 1F06B;DOMINO TILE VERTICAL-01-01;So;0;ON;;;;;N;;;;; 1F06C;DOMINO TILE VERTICAL-01-02;So;0;ON;;;;;N;;;;; 1F06D;DOMINO TILE VERTICAL-01-03;So;0;ON;;;;;N;;;;; 1F06E;DOMINO TILE VERTICAL-01-04;So;0;ON;;;;;N;;;;; 1F06F;DOMINO TILE VERTICAL-01-05;So;0;ON;;;;;N;;;;; 1F070;DOMINO TILE VERTICAL-01-06;So;0;ON;;;;;N;;;;; 1F071;DOMINO TILE VERTICAL-02-00;So;0;ON;;;;;N;;;;; 1F072;DOMINO TILE VERTICAL-02-01;So;0;ON;;;;;N;;;;; 1F073;DOMINO TILE VERTICAL-02-02;So;0;ON;;;;;N;;;;; 1F074;DOMINO TILE VERTICAL-02-03;So;0;ON;;;;;N;;;;; 1F075;DOMINO TILE VERTICAL-02-04;So;0;ON;;;;;N;;;;; 1F076;DOMINO TILE VERTICAL-02-05;So;0;ON;;;;;N;;;;; 1F077;DOMINO TILE VERTICAL-02-06;So;0;ON;;;;;N;;;;; 1F078;DOMINO TILE VERTICAL-03-00;So;0;ON;;;;;N;;;;; 1F079;DOMINO TILE VERTICAL-03-01;So;0;ON;;;;;N;;;;; 1F07A;DOMINO TILE VERTICAL-03-02;So;0;ON;;;;;N;;;;; 1F07B;DOMINO TILE VERTICAL-03-03;So;0;ON;;;;;N;;;;; 1F07C;DOMINO TILE VERTICAL-03-04;So;0;ON;;;;;N;;;;; 1F07D;DOMINO TILE VERTICAL-03-05;So;0;ON;;;;;N;;;;; 1F07E;DOMINO TILE VERTICAL-03-06;So;0;ON;;;;;N;;;;; 1F07F;DOMINO TILE VERTICAL-04-00;So;0;ON;;;;;N;;;;; 1F080;DOMINO TILE VERTICAL-04-01;So;0;ON;;;;;N;;;;; 1F081;DOMINO TILE VERTICAL-04-02;So;0;ON;;;;;N;;;;; 1F082;DOMINO TILE VERTICAL-04-03;So;0;ON;;;;;N;;;;; 1F083;DOMINO TILE VERTICAL-04-04;So;0;ON;;;;;N;;;;; 1F084;DOMINO TILE VERTICAL-04-05;So;0;ON;;;;;N;;;;; 1F085;DOMINO TILE VERTICAL-04-06;So;0;ON;;;;;N;;;;; 1F086;DOMINO TILE VERTICAL-05-00;So;0;ON;;;;;N;;;;; 1F087;DOMINO TILE VERTICAL-05-01;So;0;ON;;;;;N;;;;; 1F088;DOMINO TILE VERTICAL-05-02;So;0;ON;;;;;N;;;;; 1F089;DOMINO TILE VERTICAL-05-03;So;0;ON;;;;;N;;;;; 1F08A;DOMINO TILE VERTICAL-05-04;So;0;ON;;;;;N;;;;; 1F08B;DOMINO TILE VERTICAL-05-05;So;0;ON;;;;;N;;;;; 1F08C;DOMINO TILE VERTICAL-05-06;So;0;ON;;;;;N;;;;; 1F08D;DOMINO TILE VERTICAL-06-00;So;0;ON;;;;;N;;;;; 1F08E;DOMINO TILE VERTICAL-06-01;So;0;ON;;;;;N;;;;; 1F08F;DOMINO TILE VERTICAL-06-02;So;0;ON;;;;;N;;;;; 1F090;DOMINO TILE VERTICAL-06-03;So;0;ON;;;;;N;;;;; 1F091;DOMINO TILE VERTICAL-06-04;So;0;ON;;;;;N;;;;; 1F092;DOMINO TILE VERTICAL-06-05;So;0;ON;;;;;N;;;;; 1F093;DOMINO TILE VERTICAL-06-06;So;0;ON;;;;;N;;;;; 1F0A0;PLAYING CARD BACK;So;0;ON;;;;;N;;;;; 1F0A1;PLAYING CARD ACE OF SPADES;So;0;ON;;;;;N;;;;; 1F0A2;PLAYING CARD TWO OF SPADES;So;0;ON;;;;;N;;;;; 1F0A3;PLAYING CARD THREE OF SPADES;So;0;ON;;;;;N;;;;; 1F0A4;PLAYING CARD FOUR OF SPADES;So;0;ON;;;;;N;;;;; 1F0A5;PLAYING CARD FIVE OF SPADES;So;0;ON;;;;;N;;;;; 1F0A6;PLAYING CARD SIX OF SPADES;So;0;ON;;;;;N;;;;; 1F0A7;PLAYING CARD SEVEN OF SPADES;So;0;ON;;;;;N;;;;; 1F0A8;PLAYING CARD EIGHT OF SPADES;So;0;ON;;;;;N;;;;; 1F0A9;PLAYING CARD NINE OF SPADES;So;0;ON;;;;;N;;;;; 1F0AA;PLAYING CARD TEN OF SPADES;So;0;ON;;;;;N;;;;; 1F0AB;PLAYING CARD JACK OF SPADES;So;0;ON;;;;;N;;;;; 1F0AC;PLAYING CARD KNIGHT OF SPADES;So;0;ON;;;;;N;;;;; 1F0AD;PLAYING CARD QUEEN OF SPADES;So;0;ON;;;;;N;;;;; 1F0AE;PLAYING CARD KING OF SPADES;So;0;ON;;;;;N;;;;; 1F0B1;PLAYING CARD ACE OF HEARTS;So;0;ON;;;;;N;;;;; 1F0B2;PLAYING CARD TWO OF HEARTS;So;0;ON;;;;;N;;;;; 1F0B3;PLAYING CARD THREE OF HEARTS;So;0;ON;;;;;N;;;;; 1F0B4;PLAYING CARD FOUR OF HEARTS;So;0;ON;;;;;N;;;;; 1F0B5;PLAYING CARD FIVE OF HEARTS;So;0;ON;;;;;N;;;;; 1F0B6;PLAYING CARD SIX OF HEARTS;So;0;ON;;;;;N;;;;; 1F0B7;PLAYING CARD SEVEN OF HEARTS;So;0;ON;;;;;N;;;;; 1F0B8;PLAYING CARD EIGHT OF HEARTS;So;0;ON;;;;;N;;;;; 1F0B9;PLAYING CARD NINE OF HEARTS;So;0;ON;;;;;N;;;;; 1F0BA;PLAYING CARD TEN OF HEARTS;So;0;ON;;;;;N;;;;; 1F0BB;PLAYING CARD JACK OF HEARTS;So;0;ON;;;;;N;;;;; 1F0BC;PLAYING CARD KNIGHT OF HEARTS;So;0;ON;;;;;N;;;;; 1F0BD;PLAYING CARD QUEEN OF HEARTS;So;0;ON;;;;;N;;;;; 1F0BE;PLAYING CARD KING OF HEARTS;So;0;ON;;;;;N;;;;; 1F0C1;PLAYING CARD ACE OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0C2;PLAYING CARD TWO OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0C3;PLAYING CARD THREE OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0C4;PLAYING CARD FOUR OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0C5;PLAYING CARD FIVE OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0C6;PLAYING CARD SIX OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0C7;PLAYING CARD SEVEN OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0C8;PLAYING CARD EIGHT OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0C9;PLAYING CARD NINE OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0CA;PLAYING CARD TEN OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0CB;PLAYING CARD JACK OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0CC;PLAYING CARD KNIGHT OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0CD;PLAYING CARD QUEEN OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0CE;PLAYING CARD KING OF DIAMONDS;So;0;ON;;;;;N;;;;; 1F0CF;PLAYING CARD BLACK JOKER;So;0;ON;;;;;N;;;;; 1F0D1;PLAYING CARD ACE OF CLUBS;So;0;ON;;;;;N;;;;; 1F0D2;PLAYING CARD TWO OF CLUBS;So;0;ON;;;;;N;;;;; 1F0D3;PLAYING CARD THREE OF CLUBS;So;0;ON;;;;;N;;;;; 1F0D4;PLAYING CARD FOUR OF CLUBS;So;0;ON;;;;;N;;;;; 1F0D5;PLAYING CARD FIVE OF CLUBS;So;0;ON;;;;;N;;;;; 1F0D6;PLAYING CARD SIX OF CLUBS;So;0;ON;;;;;N;;;;; 1F0D7;PLAYING CARD SEVEN OF CLUBS;So;0;ON;;;;;N;;;;; 1F0D8;PLAYING CARD EIGHT OF CLUBS;So;0;ON;;;;;N;;;;; 1F0D9;PLAYING CARD NINE OF CLUBS;So;0;ON;;;;;N;;;;; 1F0DA;PLAYING CARD TEN OF CLUBS;So;0;ON;;;;;N;;;;; 1F0DB;PLAYING CARD JACK OF CLUBS;So;0;ON;;;;;N;;;;; 1F0DC;PLAYING CARD KNIGHT OF CLUBS;So;0;ON;;;;;N;;;;; 1F0DD;PLAYING CARD QUEEN OF CLUBS;So;0;ON;;;;;N;;;;; 1F0DE;PLAYING CARD KING OF CLUBS;So;0;ON;;;;;N;;;;; 1F0DF;PLAYING CARD WHITE JOKER;So;0;ON;;;;;N;;;;; 1F100;DIGIT ZERO FULL STOP;No;0;EN; 0030 002E;;0;0;N;;;;; 1F101;DIGIT ZERO COMMA;No;0;EN; 0030 002C;;0;0;N;;;;; 1F102;DIGIT ONE COMMA;No;0;EN; 0031 002C;;1;1;N;;;;; 1F103;DIGIT TWO COMMA;No;0;EN; 0032 002C;;2;2;N;;;;; 1F104;DIGIT THREE COMMA;No;0;EN; 0033 002C;;3;3;N;;;;; 1F105;DIGIT FOUR COMMA;No;0;EN; 0034 002C;;4;4;N;;;;; 1F106;DIGIT FIVE COMMA;No;0;EN; 0035 002C;;5;5;N;;;;; 1F107;DIGIT SIX COMMA;No;0;EN; 0036 002C;;6;6;N;;;;; 1F108;DIGIT SEVEN COMMA;No;0;EN; 0037 002C;;7;7;N;;;;; 1F109;DIGIT EIGHT COMMA;No;0;EN; 0038 002C;;8;8;N;;;;; 1F10A;DIGIT NINE COMMA;No;0;EN; 0039 002C;;9;9;N;;;;; 1F110;PARENTHESIZED LATIN CAPITAL LETTER A;So;0;L; 0028 0041 0029;;;;N;;;;; 1F111;PARENTHESIZED LATIN CAPITAL LETTER B;So;0;L; 0028 0042 0029;;;;N;;;;; 1F112;PARENTHESIZED LATIN CAPITAL LETTER C;So;0;L; 0028 0043 0029;;;;N;;;;; 1F113;PARENTHESIZED LATIN CAPITAL LETTER D;So;0;L; 0028 0044 0029;;;;N;;;;; 1F114;PARENTHESIZED LATIN CAPITAL LETTER E;So;0;L; 0028 0045 0029;;;;N;;;;; 1F115;PARENTHESIZED LATIN CAPITAL LETTER F;So;0;L; 0028 0046 0029;;;;N;;;;; 1F116;PARENTHESIZED LATIN CAPITAL LETTER G;So;0;L; 0028 0047 0029;;;;N;;;;; 1F117;PARENTHESIZED LATIN CAPITAL LETTER H;So;0;L; 0028 0048 0029;;;;N;;;;; 1F118;PARENTHESIZED LATIN CAPITAL LETTER I;So;0;L; 0028 0049 0029;;;;N;;;;; 1F119;PARENTHESIZED LATIN CAPITAL LETTER J;So;0;L; 0028 004A 0029;;;;N;;;;; 1F11A;PARENTHESIZED LATIN CAPITAL LETTER K;So;0;L; 0028 004B 0029;;;;N;;;;; 1F11B;PARENTHESIZED LATIN CAPITAL LETTER L;So;0;L; 0028 004C 0029;;;;N;;;;; 1F11C;PARENTHESIZED LATIN CAPITAL LETTER M;So;0;L; 0028 004D 0029;;;;N;;;;; 1F11D;PARENTHESIZED LATIN CAPITAL LETTER N;So;0;L; 0028 004E 0029;;;;N;;;;; 1F11E;PARENTHESIZED LATIN CAPITAL LETTER O;So;0;L; 0028 004F 0029;;;;N;;;;; 1F11F;PARENTHESIZED LATIN CAPITAL LETTER P;So;0;L; 0028 0050 0029;;;;N;;;;; 1F120;PARENTHESIZED LATIN CAPITAL LETTER Q;So;0;L; 0028 0051 0029;;;;N;;;;; 1F121;PARENTHESIZED LATIN CAPITAL LETTER R;So;0;L; 0028 0052 0029;;;;N;;;;; 1F122;PARENTHESIZED LATIN CAPITAL LETTER S;So;0;L; 0028 0053 0029;;;;N;;;;; 1F123;PARENTHESIZED LATIN CAPITAL LETTER T;So;0;L; 0028 0054 0029;;;;N;;;;; 1F124;PARENTHESIZED LATIN CAPITAL LETTER U;So;0;L; 0028 0055 0029;;;;N;;;;; 1F125;PARENTHESIZED LATIN CAPITAL LETTER V;So;0;L; 0028 0056 0029;;;;N;;;;; 1F126;PARENTHESIZED LATIN CAPITAL LETTER W;So;0;L; 0028 0057 0029;;;;N;;;;; 1F127;PARENTHESIZED LATIN CAPITAL LETTER X;So;0;L; 0028 0058 0029;;;;N;;;;; 1F128;PARENTHESIZED LATIN CAPITAL LETTER Y;So;0;L; 0028 0059 0029;;;;N;;;;; 1F129;PARENTHESIZED LATIN CAPITAL LETTER Z;So;0;L; 0028 005A 0029;;;;N;;;;; 1F12A;TORTOISE SHELL BRACKETED LATIN CAPITAL LETTER S;So;0;L; 3014 0053 3015;;;;N;;;;; 1F12B;CIRCLED ITALIC LATIN CAPITAL LETTER C;So;0;L; 0043;;;;N;;;;; 1F12C;CIRCLED ITALIC LATIN CAPITAL LETTER R;So;0;L; 0052;;;;N;;;;; 1F12D;CIRCLED CD;So;0;L; 0043 0044;;;;N;;;;; 1F12E;CIRCLED WZ;So;0;L; 0057 005A;;;;N;;;;; 1F130;SQUARED LATIN CAPITAL LETTER A;So;0;L; 0041;;;;N;;;;; 1F131;SQUARED LATIN CAPITAL LETTER B;So;0;L; 0042;;;;N;;;;; 1F132;SQUARED LATIN CAPITAL LETTER C;So;0;L; 0043;;;;N;;;;; 1F133;SQUARED LATIN CAPITAL LETTER D;So;0;L; 0044;;;;N;;;;; 1F134;SQUARED LATIN CAPITAL LETTER E;So;0;L; 0045;;;;N;;;;; 1F135;SQUARED LATIN CAPITAL LETTER F;So;0;L; 0046;;;;N;;;;; 1F136;SQUARED LATIN CAPITAL LETTER G;So;0;L; 0047;;;;N;;;;; 1F137;SQUARED LATIN CAPITAL LETTER H;So;0;L; 0048;;;;N;;;;; 1F138;SQUARED LATIN CAPITAL LETTER I;So;0;L; 0049;;;;N;;;;; 1F139;SQUARED LATIN CAPITAL LETTER J;So;0;L; 004A;;;;N;;;;; 1F13A;SQUARED LATIN CAPITAL LETTER K;So;0;L; 004B;;;;N;;;;; 1F13B;SQUARED LATIN CAPITAL LETTER L;So;0;L; 004C;;;;N;;;;; 1F13C;SQUARED LATIN CAPITAL LETTER M;So;0;L; 004D;;;;N;;;;; 1F13D;SQUARED LATIN CAPITAL LETTER N;So;0;L; 004E;;;;N;;;;; 1F13E;SQUARED LATIN CAPITAL LETTER O;So;0;L; 004F;;;;N;;;;; 1F13F;SQUARED LATIN CAPITAL LETTER P;So;0;L; 0050;;;;N;;;;; 1F140;SQUARED LATIN CAPITAL LETTER Q;So;0;L; 0051;;;;N;;;;; 1F141;SQUARED LATIN CAPITAL LETTER R;So;0;L; 0052;;;;N;;;;; 1F142;SQUARED LATIN CAPITAL LETTER S;So;0;L; 0053;;;;N;;;;; 1F143;SQUARED LATIN CAPITAL LETTER T;So;0;L; 0054;;;;N;;;;; 1F144;SQUARED LATIN CAPITAL LETTER U;So;0;L; 0055;;;;N;;;;; 1F145;SQUARED LATIN CAPITAL LETTER V;So;0;L; 0056;;;;N;;;;; 1F146;SQUARED LATIN CAPITAL LETTER W;So;0;L; 0057;;;;N;;;;; 1F147;SQUARED LATIN CAPITAL LETTER X;So;0;L; 0058;;;;N;;;;; 1F148;SQUARED LATIN CAPITAL LETTER Y;So;0;L; 0059;;;;N;;;;; 1F149;SQUARED LATIN CAPITAL LETTER Z;So;0;L; 005A;;;;N;;;;; 1F14A;SQUARED HV;So;0;L; 0048 0056;;;;N;;;;; 1F14B;SQUARED MV;So;0;L; 004D 0056;;;;N;;;;; 1F14C;SQUARED SD;So;0;L; 0053 0044;;;;N;;;;; 1F14D;SQUARED SS;So;0;L; 0053 0053;;;;N;;;;; 1F14E;SQUARED PPV;So;0;L; 0050 0050 0056;;;;N;;;;; 1F14F;SQUARED WC;So;0;L; 0057 0043;;;;N;;;;; 1F150;NEGATIVE CIRCLED LATIN CAPITAL LETTER A;So;0;L;;;;;N;;;;; 1F151;NEGATIVE CIRCLED LATIN CAPITAL LETTER B;So;0;L;;;;;N;;;;; 1F152;NEGATIVE CIRCLED LATIN CAPITAL LETTER C;So;0;L;;;;;N;;;;; 1F153;NEGATIVE CIRCLED LATIN CAPITAL LETTER D;So;0;L;;;;;N;;;;; 1F154;NEGATIVE CIRCLED LATIN CAPITAL LETTER E;So;0;L;;;;;N;;;;; 1F155;NEGATIVE CIRCLED LATIN CAPITAL LETTER F;So;0;L;;;;;N;;;;; 1F156;NEGATIVE CIRCLED LATIN CAPITAL LETTER G;So;0;L;;;;;N;;;;; 1F157;NEGATIVE CIRCLED LATIN CAPITAL LETTER H;So;0;L;;;;;N;;;;; 1F158;NEGATIVE CIRCLED LATIN CAPITAL LETTER I;So;0;L;;;;;N;;;;; 1F159;NEGATIVE CIRCLED LATIN CAPITAL LETTER J;So;0;L;;;;;N;;;;; 1F15A;NEGATIVE CIRCLED LATIN CAPITAL LETTER K;So;0;L;;;;;N;;;;; 1F15B;NEGATIVE CIRCLED LATIN CAPITAL LETTER L;So;0;L;;;;;N;;;;; 1F15C;NEGATIVE CIRCLED LATIN CAPITAL LETTER M;So;0;L;;;;;N;;;;; 1F15D;NEGATIVE CIRCLED LATIN CAPITAL LETTER N;So;0;L;;;;;N;;;;; 1F15E;NEGATIVE CIRCLED LATIN CAPITAL LETTER O;So;0;L;;;;;N;;;;; 1F15F;NEGATIVE CIRCLED LATIN CAPITAL LETTER P;So;0;L;;;;;N;;;;; 1F160;NEGATIVE CIRCLED LATIN CAPITAL LETTER Q;So;0;L;;;;;N;;;;; 1F161;NEGATIVE CIRCLED LATIN CAPITAL LETTER R;So;0;L;;;;;N;;;;; 1F162;NEGATIVE CIRCLED LATIN CAPITAL LETTER S;So;0;L;;;;;N;;;;; 1F163;NEGATIVE CIRCLED LATIN CAPITAL LETTER T;So;0;L;;;;;N;;;;; 1F164;NEGATIVE CIRCLED LATIN CAPITAL LETTER U;So;0;L;;;;;N;;;;; 1F165;NEGATIVE CIRCLED LATIN CAPITAL LETTER V;So;0;L;;;;;N;;;;; 1F166;NEGATIVE CIRCLED LATIN CAPITAL LETTER W;So;0;L;;;;;N;;;;; 1F167;NEGATIVE CIRCLED LATIN CAPITAL LETTER X;So;0;L;;;;;N;;;;; 1F168;NEGATIVE CIRCLED LATIN CAPITAL LETTER Y;So;0;L;;;;;N;;;;; 1F169;NEGATIVE CIRCLED LATIN CAPITAL LETTER Z;So;0;L;;;;;N;;;;; 1F16A;RAISED MC SIGN;So;0;ON; 004D 0043;;;;N;;;;; 1F16B;RAISED MD SIGN;So;0;ON; 004D 0044;;;;N;;;;; 1F170;NEGATIVE SQUARED LATIN CAPITAL LETTER A;So;0;L;;;;;N;;;;; 1F171;NEGATIVE SQUARED LATIN CAPITAL LETTER B;So;0;L;;;;;N;;;;; 1F172;NEGATIVE SQUARED LATIN CAPITAL LETTER C;So;0;L;;;;;N;;;;; 1F173;NEGATIVE SQUARED LATIN CAPITAL LETTER D;So;0;L;;;;;N;;;;; 1F174;NEGATIVE SQUARED LATIN CAPITAL LETTER E;So;0;L;;;;;N;;;;; 1F175;NEGATIVE SQUARED LATIN CAPITAL LETTER F;So;0;L;;;;;N;;;;; 1F176;NEGATIVE SQUARED LATIN CAPITAL LETTER G;So;0;L;;;;;N;;;;; 1F177;NEGATIVE SQUARED LATIN CAPITAL LETTER H;So;0;L;;;;;N;;;;; 1F178;NEGATIVE SQUARED LATIN CAPITAL LETTER I;So;0;L;;;;;N;;;;; 1F179;NEGATIVE SQUARED LATIN CAPITAL LETTER J;So;0;L;;;;;N;;;;; 1F17A;NEGATIVE SQUARED LATIN CAPITAL LETTER K;So;0;L;;;;;N;;;;; 1F17B;NEGATIVE SQUARED LATIN CAPITAL LETTER L;So;0;L;;;;;N;;;;; 1F17C;NEGATIVE SQUARED LATIN CAPITAL LETTER M;So;0;L;;;;;N;;;;; 1F17D;NEGATIVE SQUARED LATIN CAPITAL LETTER N;So;0;L;;;;;N;;;;; 1F17E;NEGATIVE SQUARED LATIN CAPITAL LETTER O;So;0;L;;;;;N;;;;; 1F17F;NEGATIVE SQUARED LATIN CAPITAL LETTER P;So;0;L;;;;;N;;;;; 1F180;NEGATIVE SQUARED LATIN CAPITAL LETTER Q;So;0;L;;;;;N;;;;; 1F181;NEGATIVE SQUARED LATIN CAPITAL LETTER R;So;0;L;;;;;N;;;;; 1F182;NEGATIVE SQUARED LATIN CAPITAL LETTER S;So;0;L;;;;;N;;;;; 1F183;NEGATIVE SQUARED LATIN CAPITAL LETTER T;So;0;L;;;;;N;;;;; 1F184;NEGATIVE SQUARED LATIN CAPITAL LETTER U;So;0;L;;;;;N;;;;; 1F185;NEGATIVE SQUARED LATIN CAPITAL LETTER V;So;0;L;;;;;N;;;;; 1F186;NEGATIVE SQUARED LATIN CAPITAL LETTER W;So;0;L;;;;;N;;;;; 1F187;NEGATIVE SQUARED LATIN CAPITAL LETTER X;So;0;L;;;;;N;;;;; 1F188;NEGATIVE SQUARED LATIN CAPITAL LETTER Y;So;0;L;;;;;N;;;;; 1F189;NEGATIVE SQUARED LATIN CAPITAL LETTER Z;So;0;L;;;;;N;;;;; 1F18A;CROSSED NEGATIVE SQUARED LATIN CAPITAL LETTER P;So;0;L;;;;;N;;;;; 1F18B;NEGATIVE SQUARED IC;So;0;L;;;;;N;;;;; 1F18C;NEGATIVE SQUARED PA;So;0;L;;;;;N;;;;; 1F18D;NEGATIVE SQUARED SA;So;0;L;;;;;N;;;;; 1F18E;NEGATIVE SQUARED AB;So;0;L;;;;;N;;;;; 1F18F;NEGATIVE SQUARED WC;So;0;L;;;;;N;;;;; 1F190;SQUARE DJ;So;0;L; 0044 004A;;;;N;;;;; 1F191;SQUARED CL;So;0;L;;;;;N;;;;; 1F192;SQUARED COOL;So;0;L;;;;;N;;;;; 1F193;SQUARED FREE;So;0;L;;;;;N;;;;; 1F194;SQUARED ID;So;0;L;;;;;N;;;;; 1F195;SQUARED NEW;So;0;L;;;;;N;;;;; 1F196;SQUARED NG;So;0;L;;;;;N;;;;; 1F197;SQUARED OK;So;0;L;;;;;N;;;;; 1F198;SQUARED SOS;So;0;L;;;;;N;;;;; 1F199;SQUARED UP WITH EXCLAMATION MARK;So;0;L;;;;;N;;;;; 1F19A;SQUARED VS;So;0;L;;;;;N;;;;; 1F1E6;REGIONAL INDICATOR SYMBOL LETTER A;So;0;L;;;;;N;;;;; 1F1E7;REGIONAL INDICATOR SYMBOL LETTER B;So;0;L;;;;;N;;;;; 1F1E8;REGIONAL INDICATOR SYMBOL LETTER C;So;0;L;;;;;N;;;;; 1F1E9;REGIONAL INDICATOR SYMBOL LETTER D;So;0;L;;;;;N;;;;; 1F1EA;REGIONAL INDICATOR SYMBOL LETTER E;So;0;L;;;;;N;;;;; 1F1EB;REGIONAL INDICATOR SYMBOL LETTER F;So;0;L;;;;;N;;;;; 1F1EC;REGIONAL INDICATOR SYMBOL LETTER G;So;0;L;;;;;N;;;;; 1F1ED;REGIONAL INDICATOR SYMBOL LETTER H;So;0;L;;;;;N;;;;; 1F1EE;REGIONAL INDICATOR SYMBOL LETTER I;So;0;L;;;;;N;;;;; 1F1EF;REGIONAL INDICATOR SYMBOL LETTER J;So;0;L;;;;;N;;;;; 1F1F0;REGIONAL INDICATOR SYMBOL LETTER K;So;0;L;;;;;N;;;;; 1F1F1;REGIONAL INDICATOR SYMBOL LETTER L;So;0;L;;;;;N;;;;; 1F1F2;REGIONAL INDICATOR SYMBOL LETTER M;So;0;L;;;;;N;;;;; 1F1F3;REGIONAL INDICATOR SYMBOL LETTER N;So;0;L;;;;;N;;;;; 1F1F4;REGIONAL INDICATOR SYMBOL LETTER O;So;0;L;;;;;N;;;;; 1F1F5;REGIONAL INDICATOR SYMBOL LETTER P;So;0;L;;;;;N;;;;; 1F1F6;REGIONAL INDICATOR SYMBOL LETTER Q;So;0;L;;;;;N;;;;; 1F1F7;REGIONAL INDICATOR SYMBOL LETTER R;So;0;L;;;;;N;;;;; 1F1F8;REGIONAL INDICATOR SYMBOL LETTER S;So;0;L;;;;;N;;;;; 1F1F9;REGIONAL INDICATOR SYMBOL LETTER T;So;0;L;;;;;N;;;;; 1F1FA;REGIONAL INDICATOR SYMBOL LETTER U;So;0;L;;;;;N;;;;; 1F1FB;REGIONAL INDICATOR SYMBOL LETTER V;So;0;L;;;;;N;;;;; 1F1FC;REGIONAL INDICATOR SYMBOL LETTER W;So;0;L;;;;;N;;;;; 1F1FD;REGIONAL INDICATOR SYMBOL LETTER X;So;0;L;;;;;N;;;;; 1F1FE;REGIONAL INDICATOR SYMBOL LETTER Y;So;0;L;;;;;N;;;;; 1F1FF;REGIONAL INDICATOR SYMBOL LETTER Z;So;0;L;;;;;N;;;;; 1F200;SQUARE HIRAGANA HOKA;So;0;L; 307B 304B;;;;N;;;;; 1F201;SQUARED KATAKANA KOKO;So;0;L; 30B3 30B3;;;;N;;;;; 1F202;SQUARED KATAKANA SA;So;0;L; 30B5;;;;N;;;;; 1F210;SQUARED CJK UNIFIED IDEOGRAPH-624B;So;0;L; 624B;;;;N;;;;; 1F211;SQUARED CJK UNIFIED IDEOGRAPH-5B57;So;0;L; 5B57;;;;N;;;;; 1F212;SQUARED CJK UNIFIED IDEOGRAPH-53CC;So;0;L; 53CC;;;;N;;;;; 1F213;SQUARED KATAKANA DE;So;0;L; 30C7;;;;N;;;;; 1F214;SQUARED CJK UNIFIED IDEOGRAPH-4E8C;So;0;L; 4E8C;;;;N;;;;; 1F215;SQUARED CJK UNIFIED IDEOGRAPH-591A;So;0;L; 591A;;;;N;;;;; 1F216;SQUARED CJK UNIFIED IDEOGRAPH-89E3;So;0;L; 89E3;;;;N;;;;; 1F217;SQUARED CJK UNIFIED IDEOGRAPH-5929;So;0;L; 5929;;;;N;;;;; 1F218;SQUARED CJK UNIFIED IDEOGRAPH-4EA4;So;0;L; 4EA4;;;;N;;;;; 1F219;SQUARED CJK UNIFIED IDEOGRAPH-6620;So;0;L; 6620;;;;N;;;;; 1F21A;SQUARED CJK UNIFIED IDEOGRAPH-7121;So;0;L; 7121;;;;N;;;;; 1F21B;SQUARED CJK UNIFIED IDEOGRAPH-6599;So;0;L; 6599;;;;N;;;;; 1F21C;SQUARED CJK UNIFIED IDEOGRAPH-524D;So;0;L; 524D;;;;N;;;;; 1F21D;SQUARED CJK UNIFIED IDEOGRAPH-5F8C;So;0;L; 5F8C;;;;N;;;;; 1F21E;SQUARED CJK UNIFIED IDEOGRAPH-518D;So;0;L; 518D;;;;N;;;;; 1F21F;SQUARED CJK UNIFIED IDEOGRAPH-65B0;So;0;L; 65B0;;;;N;;;;; 1F220;SQUARED CJK UNIFIED IDEOGRAPH-521D;So;0;L; 521D;;;;N;;;;; 1F221;SQUARED CJK UNIFIED IDEOGRAPH-7D42;So;0;L; 7D42;;;;N;;;;; 1F222;SQUARED CJK UNIFIED IDEOGRAPH-751F;So;0;L; 751F;;;;N;;;;; 1F223;SQUARED CJK UNIFIED IDEOGRAPH-8CA9;So;0;L; 8CA9;;;;N;;;;; 1F224;SQUARED CJK UNIFIED IDEOGRAPH-58F0;So;0;L; 58F0;;;;N;;;;; 1F225;SQUARED CJK UNIFIED IDEOGRAPH-5439;So;0;L; 5439;;;;N;;;;; 1F226;SQUARED CJK UNIFIED IDEOGRAPH-6F14;So;0;L; 6F14;;;;N;;;;; 1F227;SQUARED CJK UNIFIED IDEOGRAPH-6295;So;0;L; 6295;;;;N;;;;; 1F228;SQUARED CJK UNIFIED IDEOGRAPH-6355;So;0;L; 6355;;;;N;;;;; 1F229;SQUARED CJK UNIFIED IDEOGRAPH-4E00;So;0;L; 4E00;;;;N;;;;; 1F22A;SQUARED CJK UNIFIED IDEOGRAPH-4E09;So;0;L; 4E09;;;;N;;;;; 1F22B;SQUARED CJK UNIFIED IDEOGRAPH-904A;So;0;L; 904A;;;;N;;;;; 1F22C;SQUARED CJK UNIFIED IDEOGRAPH-5DE6;So;0;L; 5DE6;;;;N;;;;; 1F22D;SQUARED CJK UNIFIED IDEOGRAPH-4E2D;So;0;L; 4E2D;;;;N;;;;; 1F22E;SQUARED CJK UNIFIED IDEOGRAPH-53F3;So;0;L; 53F3;;;;N;;;;; 1F22F;SQUARED CJK UNIFIED IDEOGRAPH-6307;So;0;L; 6307;;;;N;;;;; 1F230;SQUARED CJK UNIFIED IDEOGRAPH-8D70;So;0;L; 8D70;;;;N;;;;; 1F231;SQUARED CJK UNIFIED IDEOGRAPH-6253;So;0;L; 6253;;;;N;;;;; 1F232;SQUARED CJK UNIFIED IDEOGRAPH-7981;So;0;L; 7981;;;;N;;;;; 1F233;SQUARED CJK UNIFIED IDEOGRAPH-7A7A;So;0;L; 7A7A;;;;N;;;;; 1F234;SQUARED CJK UNIFIED IDEOGRAPH-5408;So;0;L; 5408;;;;N;;;;; 1F235;SQUARED CJK UNIFIED IDEOGRAPH-6E80;So;0;L; 6E80;;;;N;;;;; 1F236;SQUARED CJK UNIFIED IDEOGRAPH-6709;So;0;L; 6709;;;;N;;;;; 1F237;SQUARED CJK UNIFIED IDEOGRAPH-6708;So;0;L; 6708;;;;N;;;;; 1F238;SQUARED CJK UNIFIED IDEOGRAPH-7533;So;0;L; 7533;;;;N;;;;; 1F239;SQUARED CJK UNIFIED IDEOGRAPH-5272;So;0;L; 5272;;;;N;;;;; 1F23A;SQUARED CJK UNIFIED IDEOGRAPH-55B6;So;0;L; 55B6;;;;N;;;;; 1F240;TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-672C;So;0;L; 3014 672C 3015;;;;N;;;;; 1F241;TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-4E09;So;0;L; 3014 4E09 3015;;;;N;;;;; 1F242;TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-4E8C;So;0;L; 3014 4E8C 3015;;;;N;;;;; 1F243;TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-5B89;So;0;L; 3014 5B89 3015;;;;N;;;;; 1F244;TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-70B9;So;0;L; 3014 70B9 3015;;;;N;;;;; 1F245;TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-6253;So;0;L; 3014 6253 3015;;;;N;;;;; 1F246;TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-76D7;So;0;L; 3014 76D7 3015;;;;N;;;;; 1F247;TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-52DD;So;0;L; 3014 52DD 3015;;;;N;;;;; 1F248;TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-6557;So;0;L; 3014 6557 3015;;;;N;;;;; 1F250;CIRCLED IDEOGRAPH ADVANTAGE;So;0;L; 5F97;;;;N;;;;; 1F251;CIRCLED IDEOGRAPH ACCEPT;So;0;L; 53EF;;;;N;;;;; 1F300;CYCLONE;So;0;ON;;;;;N;;;;; 1F301;FOGGY;So;0;ON;;;;;N;;;;; 1F302;CLOSED UMBRELLA;So;0;ON;;;;;N;;;;; 1F303;NIGHT WITH STARS;So;0;ON;;;;;N;;;;; 1F304;SUNRISE OVER MOUNTAINS;So;0;ON;;;;;N;;;;; 1F305;SUNRISE;So;0;ON;;;;;N;;;;; 1F306;CITYSCAPE AT DUSK;So;0;ON;;;;;N;;;;; 1F307;SUNSET OVER BUILDINGS;So;0;ON;;;;;N;;;;; 1F308;RAINBOW;So;0;ON;;;;;N;;;;; 1F309;BRIDGE AT NIGHT;So;0;ON;;;;;N;;;;; 1F30A;WATER WAVE;So;0;ON;;;;;N;;;;; 1F30B;VOLCANO;So;0;ON;;;;;N;;;;; 1F30C;MILKY WAY;So;0;ON;;;;;N;;;;; 1F30D;EARTH GLOBE EUROPE-AFRICA;So;0;ON;;;;;N;;;;; 1F30E;EARTH GLOBE AMERICAS;So;0;ON;;;;;N;;;;; 1F30F;EARTH GLOBE ASIA-AUSTRALIA;So;0;ON;;;;;N;;;;; 1F310;GLOBE WITH MERIDIANS;So;0;ON;;;;;N;;;;; 1F311;NEW MOON SYMBOL;So;0;ON;;;;;N;;;;; 1F312;WAXING CRESCENT MOON SYMBOL;So;0;ON;;;;;N;;;;; 1F313;FIRST QUARTER MOON SYMBOL;So;0;ON;;;;;N;;;;; 1F314;WAXING GIBBOUS MOON SYMBOL;So;0;ON;;;;;N;;;;; 1F315;FULL MOON SYMBOL;So;0;ON;;;;;N;;;;; 1F316;WANING GIBBOUS MOON SYMBOL;So;0;ON;;;;;N;;;;; 1F317;LAST QUARTER MOON SYMBOL;So;0;ON;;;;;N;;;;; 1F318;WANING CRESCENT MOON SYMBOL;So;0;ON;;;;;N;;;;; 1F319;CRESCENT MOON;So;0;ON;;;;;N;;;;; 1F31A;NEW MOON WITH FACE;So;0;ON;;;;;N;;;;; 1F31B;FIRST QUARTER MOON WITH FACE;So;0;ON;;;;;N;;;;; 1F31C;LAST QUARTER MOON WITH FACE;So;0;ON;;;;;N;;;;; 1F31D;FULL MOON WITH FACE;So;0;ON;;;;;N;;;;; 1F31E;SUN WITH FACE;So;0;ON;;;;;N;;;;; 1F31F;GLOWING STAR;So;0;ON;;;;;N;;;;; 1F320;SHOOTING STAR;So;0;ON;;;;;N;;;;; 1F330;CHESTNUT;So;0;ON;;;;;N;;;;; 1F331;SEEDLING;So;0;ON;;;;;N;;;;; 1F332;EVERGREEN TREE;So;0;ON;;;;;N;;;;; 1F333;DECIDUOUS TREE;So;0;ON;;;;;N;;;;; 1F334;PALM TREE;So;0;ON;;;;;N;;;;; 1F335;CACTUS;So;0;ON;;;;;N;;;;; 1F337;TULIP;So;0;ON;;;;;N;;;;; 1F338;CHERRY BLOSSOM;So;0;ON;;;;;N;;;;; 1F339;ROSE;So;0;ON;;;;;N;;;;; 1F33A;HIBISCUS;So;0;ON;;;;;N;;;;; 1F33B;SUNFLOWER;So;0;ON;;;;;N;;;;; 1F33C;BLOSSOM;So;0;ON;;;;;N;;;;; 1F33D;EAR OF MAIZE;So;0;ON;;;;;N;;;;; 1F33E;EAR OF RICE;So;0;ON;;;;;N;;;;; 1F33F;HERB;So;0;ON;;;;;N;;;;; 1F340;FOUR LEAF CLOVER;So;0;ON;;;;;N;;;;; 1F341;MAPLE LEAF;So;0;ON;;;;;N;;;;; 1F342;FALLEN LEAF;So;0;ON;;;;;N;;;;; 1F343;LEAF FLUTTERING IN WIND;So;0;ON;;;;;N;;;;; 1F344;MUSHROOM;So;0;ON;;;;;N;;;;; 1F345;TOMATO;So;0;ON;;;;;N;;;;; 1F346;AUBERGINE;So;0;ON;;;;;N;;;;; 1F347;GRAPES;So;0;ON;;;;;N;;;;; 1F348;MELON;So;0;ON;;;;;N;;;;; 1F349;WATERMELON;So;0;ON;;;;;N;;;;; 1F34A;TANGERINE;So;0;ON;;;;;N;;;;; 1F34B;LEMON;So;0;ON;;;;;N;;;;; 1F34C;BANANA;So;0;ON;;;;;N;;;;; 1F34D;PINEAPPLE;So;0;ON;;;;;N;;;;; 1F34E;RED APPLE;So;0;ON;;;;;N;;;;; 1F34F;GREEN APPLE;So;0;ON;;;;;N;;;;; 1F350;PEAR;So;0;ON;;;;;N;;;;; 1F351;PEACH;So;0;ON;;;;;N;;;;; 1F352;CHERRIES;So;0;ON;;;;;N;;;;; 1F353;STRAWBERRY;So;0;ON;;;;;N;;;;; 1F354;HAMBURGER;So;0;ON;;;;;N;;;;; 1F355;SLICE OF PIZZA;So;0;ON;;;;;N;;;;; 1F356;MEAT ON BONE;So;0;ON;;;;;N;;;;; 1F357;POULTRY LEG;So;0;ON;;;;;N;;;;; 1F358;RICE CRACKER;So;0;ON;;;;;N;;;;; 1F359;RICE BALL;So;0;ON;;;;;N;;;;; 1F35A;COOKED RICE;So;0;ON;;;;;N;;;;; 1F35B;CURRY AND RICE;So;0;ON;;;;;N;;;;; 1F35C;STEAMING BOWL;So;0;ON;;;;;N;;;;; 1F35D;SPAGHETTI;So;0;ON;;;;;N;;;;; 1F35E;BREAD;So;0;ON;;;;;N;;;;; 1F35F;FRENCH FRIES;So;0;ON;;;;;N;;;;; 1F360;ROASTED SWEET POTATO;So;0;ON;;;;;N;;;;; 1F361;DANGO;So;0;ON;;;;;N;;;;; 1F362;ODEN;So;0;ON;;;;;N;;;;; 1F363;SUSHI;So;0;ON;;;;;N;;;;; 1F364;FRIED SHRIMP;So;0;ON;;;;;N;;;;; 1F365;FISH CAKE WITH SWIRL DESIGN;So;0;ON;;;;;N;;;;; 1F366;SOFT ICE CREAM;So;0;ON;;;;;N;;;;; 1F367;SHAVED ICE;So;0;ON;;;;;N;;;;; 1F368;ICE CREAM;So;0;ON;;;;;N;;;;; 1F369;DOUGHNUT;So;0;ON;;;;;N;;;;; 1F36A;COOKIE;So;0;ON;;;;;N;;;;; 1F36B;CHOCOLATE BAR;So;0;ON;;;;;N;;;;; 1F36C;CANDY;So;0;ON;;;;;N;;;;; 1F36D;LOLLIPOP;So;0;ON;;;;;N;;;;; 1F36E;CUSTARD;So;0;ON;;;;;N;;;;; 1F36F;HONEY POT;So;0;ON;;;;;N;;;;; 1F370;SHORTCAKE;So;0;ON;;;;;N;;;;; 1F371;BENTO BOX;So;0;ON;;;;;N;;;;; 1F372;POT OF FOOD;So;0;ON;;;;;N;;;;; 1F373;COOKING;So;0;ON;;;;;N;;;;; 1F374;FORK AND KNIFE;So;0;ON;;;;;N;;;;; 1F375;TEACUP WITHOUT HANDLE;So;0;ON;;;;;N;;;;; 1F376;SAKE BOTTLE AND CUP;So;0;ON;;;;;N;;;;; 1F377;WINE GLASS;So;0;ON;;;;;N;;;;; 1F378;COCKTAIL GLASS;So;0;ON;;;;;N;;;;; 1F379;TROPICAL DRINK;So;0;ON;;;;;N;;;;; 1F37A;BEER MUG;So;0;ON;;;;;N;;;;; 1F37B;CLINKING BEER MUGS;So;0;ON;;;;;N;;;;; 1F37C;BABY BOTTLE;So;0;ON;;;;;N;;;;; 1F380;RIBBON;So;0;ON;;;;;N;;;;; 1F381;WRAPPED PRESENT;So;0;ON;;;;;N;;;;; 1F382;BIRTHDAY CAKE;So;0;ON;;;;;N;;;;; 1F383;JACK-O-LANTERN;So;0;ON;;;;;N;;;;; 1F384;CHRISTMAS TREE;So;0;ON;;;;;N;;;;; 1F385;FATHER CHRISTMAS;So;0;ON;;;;;N;;;;; 1F386;FIREWORKS;So;0;ON;;;;;N;;;;; 1F387;FIREWORK SPARKLER;So;0;ON;;;;;N;;;;; 1F388;BALLOON;So;0;ON;;;;;N;;;;; 1F389;PARTY POPPER;So;0;ON;;;;;N;;;;; 1F38A;CONFETTI BALL;So;0;ON;;;;;N;;;;; 1F38B;TANABATA TREE;So;0;ON;;;;;N;;;;; 1F38C;CROSSED FLAGS;So;0;ON;;;;;N;;;;; 1F38D;PINE DECORATION;So;0;ON;;;;;N;;;;; 1F38E;JAPANESE DOLLS;So;0;ON;;;;;N;;;;; 1F38F;CARP STREAMER;So;0;ON;;;;;N;;;;; 1F390;WIND CHIME;So;0;ON;;;;;N;;;;; 1F391;MOON VIEWING CEREMONY;So;0;ON;;;;;N;;;;; 1F392;SCHOOL SATCHEL;So;0;ON;;;;;N;;;;; 1F393;GRADUATION CAP;So;0;ON;;;;;N;;;;; 1F3A0;CAROUSEL HORSE;So;0;ON;;;;;N;;;;; 1F3A1;FERRIS WHEEL;So;0;ON;;;;;N;;;;; 1F3A2;ROLLER COASTER;So;0;ON;;;;;N;;;;; 1F3A3;FISHING POLE AND FISH;So;0;ON;;;;;N;;;;; 1F3A4;MICROPHONE;So;0;ON;;;;;N;;;;; 1F3A5;MOVIE CAMERA;So;0;ON;;;;;N;;;;; 1F3A6;CINEMA;So;0;ON;;;;;N;;;;; 1F3A7;HEADPHONE;So;0;ON;;;;;N;;;;; 1F3A8;ARTIST PALETTE;So;0;ON;;;;;N;;;;; 1F3A9;TOP HAT;So;0;ON;;;;;N;;;;; 1F3AA;CIRCUS TENT;So;0;ON;;;;;N;;;;; 1F3AB;TICKET;So;0;ON;;;;;N;;;;; 1F3AC;CLAPPER BOARD;So;0;ON;;;;;N;;;;; 1F3AD;PERFORMING ARTS;So;0;ON;;;;;N;;;;; 1F3AE;VIDEO GAME;So;0;ON;;;;;N;;;;; 1F3AF;DIRECT HIT;So;0;ON;;;;;N;;;;; 1F3B0;SLOT MACHINE;So;0;ON;;;;;N;;;;; 1F3B1;BILLIARDS;So;0;ON;;;;;N;;;;; 1F3B2;GAME DIE;So;0;ON;;;;;N;;;;; 1F3B3;BOWLING;So;0;ON;;;;;N;;;;; 1F3B4;FLOWER PLAYING CARDS;So;0;ON;;;;;N;;;;; 1F3B5;MUSICAL NOTE;So;0;ON;;;;;N;;;;; 1F3B6;MULTIPLE MUSICAL NOTES;So;0;ON;;;;;N;;;;; 1F3B7;SAXOPHONE;So;0;ON;;;;;N;;;;; 1F3B8;GUITAR;So;0;ON;;;;;N;;;;; 1F3B9;MUSICAL KEYBOARD;So;0;ON;;;;;N;;;;; 1F3BA;TRUMPET;So;0;ON;;;;;N;;;;; 1F3BB;VIOLIN;So;0;ON;;;;;N;;;;; 1F3BC;MUSICAL SCORE;So;0;ON;;;;;N;;;;; 1F3BD;RUNNING SHIRT WITH SASH;So;0;ON;;;;;N;;;;; 1F3BE;TENNIS RACQUET AND BALL;So;0;ON;;;;;N;;;;; 1F3BF;SKI AND SKI BOOT;So;0;ON;;;;;N;;;;; 1F3C0;BASKETBALL AND HOOP;So;0;ON;;;;;N;;;;; 1F3C1;CHEQUERED FLAG;So;0;ON;;;;;N;;;;; 1F3C2;SNOWBOARDER;So;0;ON;;;;;N;;;;; 1F3C3;RUNNER;So;0;ON;;;;;N;;;;; 1F3C4;SURFER;So;0;ON;;;;;N;;;;; 1F3C6;TROPHY;So;0;ON;;;;;N;;;;; 1F3C7;HORSE RACING;So;0;ON;;;;;N;;;;; 1F3C8;AMERICAN FOOTBALL;So;0;ON;;;;;N;;;;; 1F3C9;RUGBY FOOTBALL;So;0;ON;;;;;N;;;;; 1F3CA;SWIMMER;So;0;ON;;;;;N;;;;; 1F3E0;HOUSE BUILDING;So;0;ON;;;;;N;;;;; 1F3E1;HOUSE WITH GARDEN;So;0;ON;;;;;N;;;;; 1F3E2;OFFICE BUILDING;So;0;ON;;;;;N;;;;; 1F3E3;JAPANESE POST OFFICE;So;0;ON;;;;;N;;;;; 1F3E4;EUROPEAN POST OFFICE;So;0;ON;;;;;N;;;;; 1F3E5;HOSPITAL;So;0;ON;;;;;N;;;;; 1F3E6;BANK;So;0;ON;;;;;N;;;;; 1F3E7;AUTOMATED TELLER MACHINE;So;0;ON;;;;;N;;;;; 1F3E8;HOTEL;So;0;ON;;;;;N;;;;; 1F3E9;LOVE HOTEL;So;0;ON;;;;;N;;;;; 1F3EA;CONVENIENCE STORE;So;0;ON;;;;;N;;;;; 1F3EB;SCHOOL;So;0;ON;;;;;N;;;;; 1F3EC;DEPARTMENT STORE;So;0;ON;;;;;N;;;;; 1F3ED;FACTORY;So;0;ON;;;;;N;;;;; 1F3EE;IZAKAYA LANTERN;So;0;ON;;;;;N;;;;; 1F3EF;JAPANESE CASTLE;So;0;ON;;;;;N;;;;; 1F3F0;EUROPEAN CASTLE;So;0;ON;;;;;N;;;;; 1F400;RAT;So;0;ON;;;;;N;;;;; 1F401;MOUSE;So;0;ON;;;;;N;;;;; 1F402;OX;So;0;ON;;;;;N;;;;; 1F403;WATER BUFFALO;So;0;ON;;;;;N;;;;; 1F404;COW;So;0;ON;;;;;N;;;;; 1F405;TIGER;So;0;ON;;;;;N;;;;; 1F406;LEOPARD;So;0;ON;;;;;N;;;;; 1F407;RABBIT;So;0;ON;;;;;N;;;;; 1F408;CAT;So;0;ON;;;;;N;;;;; 1F409;DRAGON;So;0;ON;;;;;N;;;;; 1F40A;CROCODILE;So;0;ON;;;;;N;;;;; 1F40B;WHALE;So;0;ON;;;;;N;;;;; 1F40C;SNAIL;So;0;ON;;;;;N;;;;; 1F40D;SNAKE;So;0;ON;;;;;N;;;;; 1F40E;HORSE;So;0;ON;;;;;N;;;;; 1F40F;RAM;So;0;ON;;;;;N;;;;; 1F410;GOAT;So;0;ON;;;;;N;;;;; 1F411;SHEEP;So;0;ON;;;;;N;;;;; 1F412;MONKEY;So;0;ON;;;;;N;;;;; 1F413;ROOSTER;So;0;ON;;;;;N;;;;; 1F414;CHICKEN;So;0;ON;;;;;N;;;;; 1F415;DOG;So;0;ON;;;;;N;;;;; 1F416;PIG;So;0;ON;;;;;N;;;;; 1F417;BOAR;So;0;ON;;;;;N;;;;; 1F418;ELEPHANT;So;0;ON;;;;;N;;;;; 1F419;OCTOPUS;So;0;ON;;;;;N;;;;; 1F41A;SPIRAL SHELL;So;0;ON;;;;;N;;;;; 1F41B;BUG;So;0;ON;;;;;N;;;;; 1F41C;ANT;So;0;ON;;;;;N;;;;; 1F41D;HONEYBEE;So;0;ON;;;;;N;;;;; 1F41E;LADY BEETLE;So;0;ON;;;;;N;;;;; 1F41F;FISH;So;0;ON;;;;;N;;;;; 1F420;TROPICAL FISH;So;0;ON;;;;;N;;;;; 1F421;BLOWFISH;So;0;ON;;;;;N;;;;; 1F422;TURTLE;So;0;ON;;;;;N;;;;; 1F423;HATCHING CHICK;So;0;ON;;;;;N;;;;; 1F424;BABY CHICK;So;0;ON;;;;;N;;;;; 1F425;FRONT-FACING BABY CHICK;So;0;ON;;;;;N;;;;; 1F426;BIRD;So;0;ON;;;;;N;;;;; 1F427;PENGUIN;So;0;ON;;;;;N;;;;; 1F428;KOALA;So;0;ON;;;;;N;;;;; 1F429;POODLE;So;0;ON;;;;;N;;;;; 1F42A;DROMEDARY CAMEL;So;0;ON;;;;;N;;;;; 1F42B;BACTRIAN CAMEL;So;0;ON;;;;;N;;;;; 1F42C;DOLPHIN;So;0;ON;;;;;N;;;;; 1F42D;MOUSE FACE;So;0;ON;;;;;N;;;;; 1F42E;COW FACE;So;0;ON;;;;;N;;;;; 1F42F;TIGER FACE;So;0;ON;;;;;N;;;;; 1F430;RABBIT FACE;So;0;ON;;;;;N;;;;; 1F431;CAT FACE;So;0;ON;;;;;N;;;;; 1F432;DRAGON FACE;So;0;ON;;;;;N;;;;; 1F433;SPOUTING WHALE;So;0;ON;;;;;N;;;;; 1F434;HORSE FACE;So;0;ON;;;;;N;;;;; 1F435;MONKEY FACE;So;0;ON;;;;;N;;;;; 1F436;DOG FACE;So;0;ON;;;;;N;;;;; 1F437;PIG FACE;So;0;ON;;;;;N;;;;; 1F438;FROG FACE;So;0;ON;;;;;N;;;;; 1F439;HAMSTER FACE;So;0;ON;;;;;N;;;;; 1F43A;WOLF FACE;So;0;ON;;;;;N;;;;; 1F43B;BEAR FACE;So;0;ON;;;;;N;;;;; 1F43C;PANDA FACE;So;0;ON;;;;;N;;;;; 1F43D;PIG NOSE;So;0;ON;;;;;N;;;;; 1F43E;PAW PRINTS;So;0;ON;;;;;N;;;;; 1F440;EYES;So;0;ON;;;;;N;;;;; 1F442;EAR;So;0;ON;;;;;N;;;;; 1F443;NOSE;So;0;ON;;;;;N;;;;; 1F444;MOUTH;So;0;ON;;;;;N;;;;; 1F445;TONGUE;So;0;ON;;;;;N;;;;; 1F446;WHITE UP POINTING BACKHAND INDEX;So;0;ON;;;;;N;;;;; 1F447;WHITE DOWN POINTING BACKHAND INDEX;So;0;ON;;;;;N;;;;; 1F448;WHITE LEFT POINTING BACKHAND INDEX;So;0;ON;;;;;N;;;;; 1F449;WHITE RIGHT POINTING BACKHAND INDEX;So;0;ON;;;;;N;;;;; 1F44A;FISTED HAND SIGN;So;0;ON;;;;;N;;;;; 1F44B;WAVING HAND SIGN;So;0;ON;;;;;N;;;;; 1F44C;OK HAND SIGN;So;0;ON;;;;;N;;;;; 1F44D;THUMBS UP SIGN;So;0;ON;;;;;N;;;;; 1F44E;THUMBS DOWN SIGN;So;0;ON;;;;;N;;;;; 1F44F;CLAPPING HANDS SIGN;So;0;ON;;;;;N;;;;; 1F450;OPEN HANDS SIGN;So;0;ON;;;;;N;;;;; 1F451;CROWN;So;0;ON;;;;;N;;;;; 1F452;WOMANS HAT;So;0;ON;;;;;N;;;;; 1F453;EYEGLASSES;So;0;ON;;;;;N;;;;; 1F454;NECKTIE;So;0;ON;;;;;N;;;;; 1F455;T-SHIRT;So;0;ON;;;;;N;;;;; 1F456;JEANS;So;0;ON;;;;;N;;;;; 1F457;DRESS;So;0;ON;;;;;N;;;;; 1F458;KIMONO;So;0;ON;;;;;N;;;;; 1F459;BIKINI;So;0;ON;;;;;N;;;;; 1F45A;WOMANS CLOTHES;So;0;ON;;;;;N;;;;; 1F45B;PURSE;So;0;ON;;;;;N;;;;; 1F45C;HANDBAG;So;0;ON;;;;;N;;;;; 1F45D;POUCH;So;0;ON;;;;;N;;;;; 1F45E;MANS SHOE;So;0;ON;;;;;N;;;;; 1F45F;ATHLETIC SHOE;So;0;ON;;;;;N;;;;; 1F460;HIGH-HEELED SHOE;So;0;ON;;;;;N;;;;; 1F461;WOMANS SANDAL;So;0;ON;;;;;N;;;;; 1F462;WOMANS BOOTS;So;0;ON;;;;;N;;;;; 1F463;FOOTPRINTS;So;0;ON;;;;;N;;;;; 1F464;BUST IN SILHOUETTE;So;0;ON;;;;;N;;;;; 1F465;BUSTS IN SILHOUETTE;So;0;ON;;;;;N;;;;; 1F466;BOY;So;0;ON;;;;;N;;;;; 1F467;GIRL;So;0;ON;;;;;N;;;;; 1F468;MAN;So;0;ON;;;;;N;;;;; 1F469;WOMAN;So;0;ON;;;;;N;;;;; 1F46A;FAMILY;So;0;ON;;;;;N;;;;; 1F46B;MAN AND WOMAN HOLDING HANDS;So;0;ON;;;;;N;;;;; 1F46C;TWO MEN HOLDING HANDS;So;0;ON;;;;;N;;;;; 1F46D;TWO WOMEN HOLDING HANDS;So;0;ON;;;;;N;;;;; 1F46E;POLICE OFFICER;So;0;ON;;;;;N;;;;; 1F46F;WOMAN WITH BUNNY EARS;So;0;ON;;;;;N;;;;; 1F470;BRIDE WITH VEIL;So;0;ON;;;;;N;;;;; 1F471;PERSON WITH BLOND HAIR;So;0;ON;;;;;N;;;;; 1F472;MAN WITH GUA PI MAO;So;0;ON;;;;;N;;;;; 1F473;MAN WITH TURBAN;So;0;ON;;;;;N;;;;; 1F474;OLDER MAN;So;0;ON;;;;;N;;;;; 1F475;OLDER WOMAN;So;0;ON;;;;;N;;;;; 1F476;BABY;So;0;ON;;;;;N;;;;; 1F477;CONSTRUCTION WORKER;So;0;ON;;;;;N;;;;; 1F478;PRINCESS;So;0;ON;;;;;N;;;;; 1F479;JAPANESE OGRE;So;0;ON;;;;;N;;;;; 1F47A;JAPANESE GOBLIN;So;0;ON;;;;;N;;;;; 1F47B;GHOST;So;0;ON;;;;;N;;;;; 1F47C;BABY ANGEL;So;0;ON;;;;;N;;;;; 1F47D;EXTRATERRESTRIAL ALIEN;So;0;ON;;;;;N;;;;; 1F47E;ALIEN MONSTER;So;0;ON;;;;;N;;;;; 1F47F;IMP;So;0;ON;;;;;N;;;;; 1F480;SKULL;So;0;ON;;;;;N;;;;; 1F481;INFORMATION DESK PERSON;So;0;ON;;;;;N;;;;; 1F482;GUARDSMAN;So;0;ON;;;;;N;;;;; 1F483;DANCER;So;0;ON;;;;;N;;;;; 1F484;LIPSTICK;So;0;ON;;;;;N;;;;; 1F485;NAIL POLISH;So;0;ON;;;;;N;;;;; 1F486;FACE MASSAGE;So;0;ON;;;;;N;;;;; 1F487;HAIRCUT;So;0;ON;;;;;N;;;;; 1F488;BARBER POLE;So;0;ON;;;;;N;;;;; 1F489;SYRINGE;So;0;ON;;;;;N;;;;; 1F48A;PILL;So;0;ON;;;;;N;;;;; 1F48B;KISS MARK;So;0;ON;;;;;N;;;;; 1F48C;LOVE LETTER;So;0;ON;;;;;N;;;;; 1F48D;RING;So;0;ON;;;;;N;;;;; 1F48E;GEM STONE;So;0;ON;;;;;N;;;;; 1F48F;KISS;So;0;ON;;;;;N;;;;; 1F490;BOUQUET;So;0;ON;;;;;N;;;;; 1F491;COUPLE WITH HEART;So;0;ON;;;;;N;;;;; 1F492;WEDDING;So;0;ON;;;;;N;;;;; 1F493;BEATING HEART;So;0;ON;;;;;N;;;;; 1F494;BROKEN HEART;So;0;ON;;;;;N;;;;; 1F495;TWO HEARTS;So;0;ON;;;;;N;;;;; 1F496;SPARKLING HEART;So;0;ON;;;;;N;;;;; 1F497;GROWING HEART;So;0;ON;;;;;N;;;;; 1F498;HEART WITH ARROW;So;0;ON;;;;;N;;;;; 1F499;BLUE HEART;So;0;ON;;;;;N;;;;; 1F49A;GREEN HEART;So;0;ON;;;;;N;;;;; 1F49B;YELLOW HEART;So;0;ON;;;;;N;;;;; 1F49C;PURPLE HEART;So;0;ON;;;;;N;;;;; 1F49D;HEART WITH RIBBON;So;0;ON;;;;;N;;;;; 1F49E;REVOLVING HEARTS;So;0;ON;;;;;N;;;;; 1F49F;HEART DECORATION;So;0;ON;;;;;N;;;;; 1F4A0;DIAMOND SHAPE WITH A DOT INSIDE;So;0;ON;;;;;N;;;;; 1F4A1;ELECTRIC LIGHT BULB;So;0;ON;;;;;N;;;;; 1F4A2;ANGER SYMBOL;So;0;ON;;;;;N;;;;; 1F4A3;BOMB;So;0;ON;;;;;N;;;;; 1F4A4;SLEEPING SYMBOL;So;0;ON;;;;;N;;;;; 1F4A5;COLLISION SYMBOL;So;0;ON;;;;;N;;;;; 1F4A6;SPLASHING SWEAT SYMBOL;So;0;ON;;;;;N;;;;; 1F4A7;DROPLET;So;0;ON;;;;;N;;;;; 1F4A8;DASH SYMBOL;So;0;ON;;;;;N;;;;; 1F4A9;PILE OF POO;So;0;ON;;;;;N;;;;; 1F4AA;FLEXED BICEPS;So;0;ON;;;;;N;;;;; 1F4AB;DIZZY SYMBOL;So;0;ON;;;;;N;;;;; 1F4AC;SPEECH BALLOON;So;0;ON;;;;;N;;;;; 1F4AD;THOUGHT BALLOON;So;0;ON;;;;;N;;;;; 1F4AE;WHITE FLOWER;So;0;ON;;;;;N;;;;; 1F4AF;HUNDRED POINTS SYMBOL;So;0;ON;;;;;N;;;;; 1F4B0;MONEY BAG;So;0;ON;;;;;N;;;;; 1F4B1;CURRENCY EXCHANGE;So;0;ON;;;;;N;;;;; 1F4B2;HEAVY DOLLAR SIGN;So;0;ON;;;;;N;;;;; 1F4B3;CREDIT CARD;So;0;ON;;;;;N;;;;; 1F4B4;BANKNOTE WITH YEN SIGN;So;0;ON;;;;;N;;;;; 1F4B5;BANKNOTE WITH DOLLAR SIGN;So;0;ON;;;;;N;;;;; 1F4B6;BANKNOTE WITH EURO SIGN;So;0;ON;;;;;N;;;;; 1F4B7;BANKNOTE WITH POUND SIGN;So;0;ON;;;;;N;;;;; 1F4B8;MONEY WITH WINGS;So;0;ON;;;;;N;;;;; 1F4B9;CHART WITH UPWARDS TREND AND YEN SIGN;So;0;ON;;;;;N;;;;; 1F4BA;SEAT;So;0;ON;;;;;N;;;;; 1F4BB;PERSONAL COMPUTER;So;0;ON;;;;;N;;;;; 1F4BC;BRIEFCASE;So;0;ON;;;;;N;;;;; 1F4BD;MINIDISC;So;0;ON;;;;;N;;;;; 1F4BE;FLOPPY DISK;So;0;ON;;;;;N;;;;; 1F4BF;OPTICAL DISC;So;0;ON;;;;;N;;;;; 1F4C0;DVD;So;0;ON;;;;;N;;;;; 1F4C1;FILE FOLDER;So;0;ON;;;;;N;;;;; 1F4C2;OPEN FILE FOLDER;So;0;ON;;;;;N;;;;; 1F4C3;PAGE WITH CURL;So;0;ON;;;;;N;;;;; 1F4C4;PAGE FACING UP;So;0;ON;;;;;N;;;;; 1F4C5;CALENDAR;So;0;ON;;;;;N;;;;; 1F4C6;TEAR-OFF CALENDAR;So;0;ON;;;;;N;;;;; 1F4C7;CARD INDEX;So;0;ON;;;;;N;;;;; 1F4C8;CHART WITH UPWARDS TREND;So;0;ON;;;;;N;;;;; 1F4C9;CHART WITH DOWNWARDS TREND;So;0;ON;;;;;N;;;;; 1F4CA;BAR CHART;So;0;ON;;;;;N;;;;; 1F4CB;CLIPBOARD;So;0;ON;;;;;N;;;;; 1F4CC;PUSHPIN;So;0;ON;;;;;N;;;;; 1F4CD;ROUND PUSHPIN;So;0;ON;;;;;N;;;;; 1F4CE;PAPERCLIP;So;0;ON;;;;;N;;;;; 1F4CF;STRAIGHT RULER;So;0;ON;;;;;N;;;;; 1F4D0;TRIANGULAR RULER;So;0;ON;;;;;N;;;;; 1F4D1;BOOKMARK TABS;So;0;ON;;;;;N;;;;; 1F4D2;LEDGER;So;0;ON;;;;;N;;;;; 1F4D3;NOTEBOOK;So;0;ON;;;;;N;;;;; 1F4D4;NOTEBOOK WITH DECORATIVE COVER;So;0;ON;;;;;N;;;;; 1F4D5;CLOSED BOOK;So;0;ON;;;;;N;;;;; 1F4D6;OPEN BOOK;So;0;ON;;;;;N;;;;; 1F4D7;GREEN BOOK;So;0;ON;;;;;N;;;;; 1F4D8;BLUE BOOK;So;0;ON;;;;;N;;;;; 1F4D9;ORANGE BOOK;So;0;ON;;;;;N;;;;; 1F4DA;BOOKS;So;0;ON;;;;;N;;;;; 1F4DB;NAME BADGE;So;0;ON;;;;;N;;;;; 1F4DC;SCROLL;So;0;ON;;;;;N;;;;; 1F4DD;MEMO;So;0;ON;;;;;N;;;;; 1F4DE;TELEPHONE RECEIVER;So;0;ON;;;;;N;;;;; 1F4DF;PAGER;So;0;ON;;;;;N;;;;; 1F4E0;FAX MACHINE;So;0;ON;;;;;N;;;;; 1F4E1;SATELLITE ANTENNA;So;0;ON;;;;;N;;;;; 1F4E2;PUBLIC ADDRESS LOUDSPEAKER;So;0;ON;;;;;N;;;;; 1F4E3;CHEERING MEGAPHONE;So;0;ON;;;;;N;;;;; 1F4E4;OUTBOX TRAY;So;0;ON;;;;;N;;;;; 1F4E5;INBOX TRAY;So;0;ON;;;;;N;;;;; 1F4E6;PACKAGE;So;0;ON;;;;;N;;;;; 1F4E7;E-MAIL SYMBOL;So;0;ON;;;;;N;;;;; 1F4E8;INCOMING ENVELOPE;So;0;ON;;;;;N;;;;; 1F4E9;ENVELOPE WITH DOWNWARDS ARROW ABOVE;So;0;ON;;;;;N;;;;; 1F4EA;CLOSED MAILBOX WITH LOWERED FLAG;So;0;ON;;;;;N;;;;; 1F4EB;CLOSED MAILBOX WITH RAISED FLAG;So;0;ON;;;;;N;;;;; 1F4EC;OPEN MAILBOX WITH RAISED FLAG;So;0;ON;;;;;N;;;;; 1F4ED;OPEN MAILBOX WITH LOWERED FLAG;So;0;ON;;;;;N;;;;; 1F4EE;POSTBOX;So;0;ON;;;;;N;;;;; 1F4EF;POSTAL HORN;So;0;ON;;;;;N;;;;; 1F4F0;NEWSPAPER;So;0;ON;;;;;N;;;;; 1F4F1;MOBILE PHONE;So;0;ON;;;;;N;;;;; 1F4F2;MOBILE PHONE WITH RIGHTWARDS ARROW AT LEFT;So;0;ON;;;;;N;;;;; 1F4F3;VIBRATION MODE;So;0;ON;;;;;N;;;;; 1F4F4;MOBILE PHONE OFF;So;0;ON;;;;;N;;;;; 1F4F5;NO MOBILE PHONES;So;0;ON;;;;;N;;;;; 1F4F6;ANTENNA WITH BARS;So;0;ON;;;;;N;;;;; 1F4F7;CAMERA;So;0;ON;;;;;N;;;;; 1F4F9;VIDEO CAMERA;So;0;ON;;;;;N;;;;; 1F4FA;TELEVISION;So;0;ON;;;;;N;;;;; 1F4FB;RADIO;So;0;ON;;;;;N;;;;; 1F4FC;VIDEOCASSETTE;So;0;ON;;;;;N;;;;; 1F500;TWISTED RIGHTWARDS ARROWS;So;0;ON;;;;;N;;;;; 1F501;CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS;So;0;ON;;;;;N;;;;; 1F502;CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS WITH CIRCLED ONE OVERLAY;So;0;ON;;;;;N;;;;; 1F503;CLOCKWISE DOWNWARDS AND UPWARDS OPEN CIRCLE ARROWS;So;0;ON;;;;;N;;;;; 1F504;ANTICLOCKWISE DOWNWARDS AND UPWARDS OPEN CIRCLE ARROWS;So;0;ON;;;;;N;;;;; 1F505;LOW BRIGHTNESS SYMBOL;So;0;ON;;;;;N;;;;; 1F506;HIGH BRIGHTNESS SYMBOL;So;0;ON;;;;;N;;;;; 1F507;SPEAKER WITH CANCELLATION STROKE;So;0;ON;;;;;N;;;;; 1F508;SPEAKER;So;0;ON;;;;;N;;;;; 1F509;SPEAKER WITH ONE SOUND WAVE;So;0;ON;;;;;N;;;;; 1F50A;SPEAKER WITH THREE SOUND WAVES;So;0;ON;;;;;N;;;;; 1F50B;BATTERY;So;0;ON;;;;;N;;;;; 1F50C;ELECTRIC PLUG;So;0;ON;;;;;N;;;;; 1F50D;LEFT-POINTING MAGNIFYING GLASS;So;0;ON;;;;;N;;;;; 1F50E;RIGHT-POINTING MAGNIFYING GLASS;So;0;ON;;;;;N;;;;; 1F50F;LOCK WITH INK PEN;So;0;ON;;;;;N;;;;; 1F510;CLOSED LOCK WITH KEY;So;0;ON;;;;;N;;;;; 1F511;KEY;So;0;ON;;;;;N;;;;; 1F512;LOCK;So;0;ON;;;;;N;;;;; 1F513;OPEN LOCK;So;0;ON;;;;;N;;;;; 1F514;BELL;So;0;ON;;;;;N;;;;; 1F515;BELL WITH CANCELLATION STROKE;So;0;ON;;;;;N;;;;; 1F516;BOOKMARK;So;0;ON;;;;;N;;;;; 1F517;LINK SYMBOL;So;0;ON;;;;;N;;;;; 1F518;RADIO BUTTON;So;0;ON;;;;;N;;;;; 1F519;BACK WITH LEFTWARDS ARROW ABOVE;So;0;ON;;;;;N;;;;; 1F51A;END WITH LEFTWARDS ARROW ABOVE;So;0;ON;;;;;N;;;;; 1F51B;ON WITH EXCLAMATION MARK WITH LEFT RIGHT ARROW ABOVE;So;0;ON;;;;;N;;;;; 1F51C;SOON WITH RIGHTWARDS ARROW ABOVE;So;0;ON;;;;;N;;;;; 1F51D;TOP WITH UPWARDS ARROW ABOVE;So;0;ON;;;;;N;;;;; 1F51E;NO ONE UNDER EIGHTEEN SYMBOL;So;0;ON;;;;;N;;;;; 1F51F;KEYCAP TEN;So;0;ON;;;;;N;;;;; 1F520;INPUT SYMBOL FOR LATIN CAPITAL LETTERS;So;0;ON;;;;;N;;;;; 1F521;INPUT SYMBOL FOR LATIN SMALL LETTERS;So;0;ON;;;;;N;;;;; 1F522;INPUT SYMBOL FOR NUMBERS;So;0;ON;;;;;N;;;;; 1F523;INPUT SYMBOL FOR SYMBOLS;So;0;ON;;;;;N;;;;; 1F524;INPUT SYMBOL FOR LATIN LETTERS;So;0;ON;;;;;N;;;;; 1F525;FIRE;So;0;ON;;;;;N;;;;; 1F526;ELECTRIC TORCH;So;0;ON;;;;;N;;;;; 1F527;WRENCH;So;0;ON;;;;;N;;;;; 1F528;HAMMER;So;0;ON;;;;;N;;;;; 1F529;NUT AND BOLT;So;0;ON;;;;;N;;;;; 1F52A;HOCHO;So;0;ON;;;;;N;;;;; 1F52B;PISTOL;So;0;ON;;;;;N;;;;; 1F52C;MICROSCOPE;So;0;ON;;;;;N;;;;; 1F52D;TELESCOPE;So;0;ON;;;;;N;;;;; 1F52E;CRYSTAL BALL;So;0;ON;;;;;N;;;;; 1F52F;SIX POINTED STAR WITH MIDDLE DOT;So;0;ON;;;;;N;;;;; 1F530;JAPANESE SYMBOL FOR BEGINNER;So;0;ON;;;;;N;;;;; 1F531;TRIDENT EMBLEM;So;0;ON;;;;;N;;;;; 1F532;BLACK SQUARE BUTTON;So;0;ON;;;;;N;;;;; 1F533;WHITE SQUARE BUTTON;So;0;ON;;;;;N;;;;; 1F534;LARGE RED CIRCLE;So;0;ON;;;;;N;;;;; 1F535;LARGE BLUE CIRCLE;So;0;ON;;;;;N;;;;; 1F536;LARGE ORANGE DIAMOND;So;0;ON;;;;;N;;;;; 1F537;LARGE BLUE DIAMOND;So;0;ON;;;;;N;;;;; 1F538;SMALL ORANGE DIAMOND;So;0;ON;;;;;N;;;;; 1F539;SMALL BLUE DIAMOND;So;0;ON;;;;;N;;;;; 1F53A;UP-POINTING RED TRIANGLE;So;0;ON;;;;;N;;;;; 1F53B;DOWN-POINTING RED TRIANGLE;So;0;ON;;;;;N;;;;; 1F53C;UP-POINTING SMALL RED TRIANGLE;So;0;ON;;;;;N;;;;; 1F53D;DOWN-POINTING SMALL RED TRIANGLE;So;0;ON;;;;;N;;;;; 1F540;CIRCLED CROSS POMMEE;So;0;ON;;;;;N;;;;; 1F541;CROSS POMMEE WITH HALF-CIRCLE BELOW;So;0;ON;;;;;N;;;;; 1F542;CROSS POMMEE;So;0;ON;;;;;N;;;;; 1F543;NOTCHED LEFT SEMICIRCLE WITH THREE DOTS;So;0;ON;;;;;N;;;;; 1F550;CLOCK FACE ONE OCLOCK;So;0;ON;;;;;N;;;;; 1F551;CLOCK FACE TWO OCLOCK;So;0;ON;;;;;N;;;;; 1F552;CLOCK FACE THREE OCLOCK;So;0;ON;;;;;N;;;;; 1F553;CLOCK FACE FOUR OCLOCK;So;0;ON;;;;;N;;;;; 1F554;CLOCK FACE FIVE OCLOCK;So;0;ON;;;;;N;;;;; 1F555;CLOCK FACE SIX OCLOCK;So;0;ON;;;;;N;;;;; 1F556;CLOCK FACE SEVEN OCLOCK;So;0;ON;;;;;N;;;;; 1F557;CLOCK FACE EIGHT OCLOCK;So;0;ON;;;;;N;;;;; 1F558;CLOCK FACE NINE OCLOCK;So;0;ON;;;;;N;;;;; 1F559;CLOCK FACE TEN OCLOCK;So;0;ON;;;;;N;;;;; 1F55A;CLOCK FACE ELEVEN OCLOCK;So;0;ON;;;;;N;;;;; 1F55B;CLOCK FACE TWELVE OCLOCK;So;0;ON;;;;;N;;;;; 1F55C;CLOCK FACE ONE-THIRTY;So;0;ON;;;;;N;;;;; 1F55D;CLOCK FACE TWO-THIRTY;So;0;ON;;;;;N;;;;; 1F55E;CLOCK FACE THREE-THIRTY;So;0;ON;;;;;N;;;;; 1F55F;CLOCK FACE FOUR-THIRTY;So;0;ON;;;;;N;;;;; 1F560;CLOCK FACE FIVE-THIRTY;So;0;ON;;;;;N;;;;; 1F561;CLOCK FACE SIX-THIRTY;So;0;ON;;;;;N;;;;; 1F562;CLOCK FACE SEVEN-THIRTY;So;0;ON;;;;;N;;;;; 1F563;CLOCK FACE EIGHT-THIRTY;So;0;ON;;;;;N;;;;; 1F564;CLOCK FACE NINE-THIRTY;So;0;ON;;;;;N;;;;; 1F565;CLOCK FACE TEN-THIRTY;So;0;ON;;;;;N;;;;; 1F566;CLOCK FACE ELEVEN-THIRTY;So;0;ON;;;;;N;;;;; 1F567;CLOCK FACE TWELVE-THIRTY;So;0;ON;;;;;N;;;;; 1F5FB;MOUNT FUJI;So;0;ON;;;;;N;;;;; 1F5FC;TOKYO TOWER;So;0;ON;;;;;N;;;;; 1F5FD;STATUE OF LIBERTY;So;0;ON;;;;;N;;;;; 1F5FE;SILHOUETTE OF JAPAN;So;0;ON;;;;;N;;;;; 1F5FF;MOYAI;So;0;ON;;;;;N;;;;; 1F600;GRINNING FACE;So;0;ON;;;;;N;;;;; 1F601;GRINNING FACE WITH SMILING EYES;So;0;ON;;;;;N;;;;; 1F602;FACE WITH TEARS OF JOY;So;0;ON;;;;;N;;;;; 1F603;SMILING FACE WITH OPEN MOUTH;So;0;ON;;;;;N;;;;; 1F604;SMILING FACE WITH OPEN MOUTH AND SMILING EYES;So;0;ON;;;;;N;;;;; 1F605;SMILING FACE WITH OPEN MOUTH AND COLD SWEAT;So;0;ON;;;;;N;;;;; 1F606;SMILING FACE WITH OPEN MOUTH AND TIGHTLY-CLOSED EYES;So;0;ON;;;;;N;;;;; 1F607;SMILING FACE WITH HALO;So;0;ON;;;;;N;;;;; 1F608;SMILING FACE WITH HORNS;So;0;ON;;;;;N;;;;; 1F609;WINKING FACE;So;0;ON;;;;;N;;;;; 1F60A;SMILING FACE WITH SMILING EYES;So;0;ON;;;;;N;;;;; 1F60B;FACE SAVOURING DELICIOUS FOOD;So;0;ON;;;;;N;;;;; 1F60C;RELIEVED FACE;So;0;ON;;;;;N;;;;; 1F60D;SMILING FACE WITH HEART-SHAPED EYES;So;0;ON;;;;;N;;;;; 1F60E;SMILING FACE WITH SUNGLASSES;So;0;ON;;;;;N;;;;; 1F60F;SMIRKING FACE;So;0;ON;;;;;N;;;;; 1F610;NEUTRAL FACE;So;0;ON;;;;;N;;;;; 1F611;EXPRESSIONLESS FACE;So;0;ON;;;;;N;;;;; 1F612;UNAMUSED FACE;So;0;ON;;;;;N;;;;; 1F613;FACE WITH COLD SWEAT;So;0;ON;;;;;N;;;;; 1F614;PENSIVE FACE;So;0;ON;;;;;N;;;;; 1F615;CONFUSED FACE;So;0;ON;;;;;N;;;;; 1F616;CONFOUNDED FACE;So;0;ON;;;;;N;;;;; 1F617;KISSING FACE;So;0;ON;;;;;N;;;;; 1F618;FACE THROWING A KISS;So;0;ON;;;;;N;;;;; 1F619;KISSING FACE WITH SMILING EYES;So;0;ON;;;;;N;;;;; 1F61A;KISSING FACE WITH CLOSED EYES;So;0;ON;;;;;N;;;;; 1F61B;FACE WITH STUCK-OUT TONGUE;So;0;ON;;;;;N;;;;; 1F61C;FACE WITH STUCK-OUT TONGUE AND WINKING EYE;So;0;ON;;;;;N;;;;; 1F61D;FACE WITH STUCK-OUT TONGUE AND TIGHTLY-CLOSED EYES;So;0;ON;;;;;N;;;;; 1F61E;DISAPPOINTED FACE;So;0;ON;;;;;N;;;;; 1F61F;WORRIED FACE;So;0;ON;;;;;N;;;;; 1F620;ANGRY FACE;So;0;ON;;;;;N;;;;; 1F621;POUTING FACE;So;0;ON;;;;;N;;;;; 1F622;CRYING FACE;So;0;ON;;;;;N;;;;; 1F623;PERSEVERING FACE;So;0;ON;;;;;N;;;;; 1F624;FACE WITH LOOK OF TRIUMPH;So;0;ON;;;;;N;;;;; 1F625;DISAPPOINTED BUT RELIEVED FACE;So;0;ON;;;;;N;;;;; 1F626;FROWNING FACE WITH OPEN MOUTH;So;0;ON;;;;;N;;;;; 1F627;ANGUISHED FACE;So;0;ON;;;;;N;;;;; 1F628;FEARFUL FACE;So;0;ON;;;;;N;;;;; 1F629;WEARY FACE;So;0;ON;;;;;N;;;;; 1F62A;SLEEPY FACE;So;0;ON;;;;;N;;;;; 1F62B;TIRED FACE;So;0;ON;;;;;N;;;;; 1F62C;GRIMACING FACE;So;0;ON;;;;;N;;;;; 1F62D;LOUDLY CRYING FACE;So;0;ON;;;;;N;;;;; 1F62E;FACE WITH OPEN MOUTH;So;0;ON;;;;;N;;;;; 1F62F;HUSHED FACE;So;0;ON;;;;;N;;;;; 1F630;FACE WITH OPEN MOUTH AND COLD SWEAT;So;0;ON;;;;;N;;;;; 1F631;FACE SCREAMING IN FEAR;So;0;ON;;;;;N;;;;; 1F632;ASTONISHED FACE;So;0;ON;;;;;N;;;;; 1F633;FLUSHED FACE;So;0;ON;;;;;N;;;;; 1F634;SLEEPING FACE;So;0;ON;;;;;N;;;;; 1F635;DIZZY FACE;So;0;ON;;;;;N;;;;; 1F636;FACE WITHOUT MOUTH;So;0;ON;;;;;N;;;;; 1F637;FACE WITH MEDICAL MASK;So;0;ON;;;;;N;;;;; 1F638;GRINNING CAT FACE WITH SMILING EYES;So;0;ON;;;;;N;;;;; 1F639;CAT FACE WITH TEARS OF JOY;So;0;ON;;;;;N;;;;; 1F63A;SMILING CAT FACE WITH OPEN MOUTH;So;0;ON;;;;;N;;;;; 1F63B;SMILING CAT FACE WITH HEART-SHAPED EYES;So;0;ON;;;;;N;;;;; 1F63C;CAT FACE WITH WRY SMILE;So;0;ON;;;;;N;;;;; 1F63D;KISSING CAT FACE WITH CLOSED EYES;So;0;ON;;;;;N;;;;; 1F63E;POUTING CAT FACE;So;0;ON;;;;;N;;;;; 1F63F;CRYING CAT FACE;So;0;ON;;;;;N;;;;; 1F640;WEARY CAT FACE;So;0;ON;;;;;N;;;;; 1F645;FACE WITH NO GOOD GESTURE;So;0;ON;;;;;N;;;;; 1F646;FACE WITH OK GESTURE;So;0;ON;;;;;N;;;;; 1F647;PERSON BOWING DEEPLY;So;0;ON;;;;;N;;;;; 1F648;SEE-NO-EVIL MONKEY;So;0;ON;;;;;N;;;;; 1F649;HEAR-NO-EVIL MONKEY;So;0;ON;;;;;N;;;;; 1F64A;SPEAK-NO-EVIL MONKEY;So;0;ON;;;;;N;;;;; 1F64B;HAPPY PERSON RAISING ONE HAND;So;0;ON;;;;;N;;;;; 1F64C;PERSON RAISING BOTH HANDS IN CELEBRATION;So;0;ON;;;;;N;;;;; 1F64D;PERSON FROWNING;So;0;ON;;;;;N;;;;; 1F64E;PERSON WITH POUTING FACE;So;0;ON;;;;;N;;;;; 1F64F;PERSON WITH FOLDED HANDS;So;0;ON;;;;;N;;;;; 1F680;ROCKET;So;0;ON;;;;;N;;;;; 1F681;HELICOPTER;So;0;ON;;;;;N;;;;; 1F682;STEAM LOCOMOTIVE;So;0;ON;;;;;N;;;;; 1F683;RAILWAY CAR;So;0;ON;;;;;N;;;;; 1F684;HIGH-SPEED TRAIN;So;0;ON;;;;;N;;;;; 1F685;HIGH-SPEED TRAIN WITH BULLET NOSE;So;0;ON;;;;;N;;;;; 1F686;TRAIN;So;0;ON;;;;;N;;;;; 1F687;METRO;So;0;ON;;;;;N;;;;; 1F688;LIGHT RAIL;So;0;ON;;;;;N;;;;; 1F689;STATION;So;0;ON;;;;;N;;;;; 1F68A;TRAM;So;0;ON;;;;;N;;;;; 1F68B;TRAM CAR;So;0;ON;;;;;N;;;;; 1F68C;BUS;So;0;ON;;;;;N;;;;; 1F68D;ONCOMING BUS;So;0;ON;;;;;N;;;;; 1F68E;TROLLEYBUS;So;0;ON;;;;;N;;;;; 1F68F;BUS STOP;So;0;ON;;;;;N;;;;; 1F690;MINIBUS;So;0;ON;;;;;N;;;;; 1F691;AMBULANCE;So;0;ON;;;;;N;;;;; 1F692;FIRE ENGINE;So;0;ON;;;;;N;;;;; 1F693;POLICE CAR;So;0;ON;;;;;N;;;;; 1F694;ONCOMING POLICE CAR;So;0;ON;;;;;N;;;;; 1F695;TAXI;So;0;ON;;;;;N;;;;; 1F696;ONCOMING TAXI;So;0;ON;;;;;N;;;;; 1F697;AUTOMOBILE;So;0;ON;;;;;N;;;;; 1F698;ONCOMING AUTOMOBILE;So;0;ON;;;;;N;;;;; 1F699;RECREATIONAL VEHICLE;So;0;ON;;;;;N;;;;; 1F69A;DELIVERY TRUCK;So;0;ON;;;;;N;;;;; 1F69B;ARTICULATED LORRY;So;0;ON;;;;;N;;;;; 1F69C;TRACTOR;So;0;ON;;;;;N;;;;; 1F69D;MONORAIL;So;0;ON;;;;;N;;;;; 1F69E;MOUNTAIN RAILWAY;So;0;ON;;;;;N;;;;; 1F69F;SUSPENSION RAILWAY;So;0;ON;;;;;N;;;;; 1F6A0;MOUNTAIN CABLEWAY;So;0;ON;;;;;N;;;;; 1F6A1;AERIAL TRAMWAY;So;0;ON;;;;;N;;;;; 1F6A2;SHIP;So;0;ON;;;;;N;;;;; 1F6A3;ROWBOAT;So;0;ON;;;;;N;;;;; 1F6A4;SPEEDBOAT;So;0;ON;;;;;N;;;;; 1F6A5;HORIZONTAL TRAFFIC LIGHT;So;0;ON;;;;;N;;;;; 1F6A6;VERTICAL TRAFFIC LIGHT;So;0;ON;;;;;N;;;;; 1F6A7;CONSTRUCTION SIGN;So;0;ON;;;;;N;;;;; 1F6A8;POLICE CARS REVOLVING LIGHT;So;0;ON;;;;;N;;;;; 1F6A9;TRIANGULAR FLAG ON POST;So;0;ON;;;;;N;;;;; 1F6AA;DOOR;So;0;ON;;;;;N;;;;; 1F6AB;NO ENTRY SIGN;So;0;ON;;;;;N;;;;; 1F6AC;SMOKING SYMBOL;So;0;ON;;;;;N;;;;; 1F6AD;NO SMOKING SYMBOL;So;0;ON;;;;;N;;;;; 1F6AE;PUT LITTER IN ITS PLACE SYMBOL;So;0;ON;;;;;N;;;;; 1F6AF;DO NOT LITTER SYMBOL;So;0;ON;;;;;N;;;;; 1F6B0;POTABLE WATER SYMBOL;So;0;ON;;;;;N;;;;; 1F6B1;NON-POTABLE WATER SYMBOL;So;0;ON;;;;;N;;;;; 1F6B2;BICYCLE;So;0;ON;;;;;N;;;;; 1F6B3;NO BICYCLES;So;0;ON;;;;;N;;;;; 1F6B4;BICYCLIST;So;0;ON;;;;;N;;;;; 1F6B5;MOUNTAIN BICYCLIST;So;0;ON;;;;;N;;;;; 1F6B6;PEDESTRIAN;So;0;ON;;;;;N;;;;; 1F6B7;NO PEDESTRIANS;So;0;ON;;;;;N;;;;; 1F6B8;CHILDREN CROSSING;So;0;ON;;;;;N;;;;; 1F6B9;MENS SYMBOL;So;0;ON;;;;;N;;;;; 1F6BA;WOMENS SYMBOL;So;0;ON;;;;;N;;;;; 1F6BB;RESTROOM;So;0;ON;;;;;N;;;;; 1F6BC;BABY SYMBOL;So;0;ON;;;;;N;;;;; 1F6BD;TOILET;So;0;ON;;;;;N;;;;; 1F6BE;WATER CLOSET;So;0;ON;;;;;N;;;;; 1F6BF;SHOWER;So;0;ON;;;;;N;;;;; 1F6C0;BATH;So;0;ON;;;;;N;;;;; 1F6C1;BATHTUB;So;0;ON;;;;;N;;;;; 1F6C2;PASSPORT CONTROL;So;0;ON;;;;;N;;;;; 1F6C3;CUSTOMS;So;0;ON;;;;;N;;;;; 1F6C4;BAGGAGE CLAIM;So;0;ON;;;;;N;;;;; 1F6C5;LEFT LUGGAGE;So;0;ON;;;;;N;;;;; 1F700;ALCHEMICAL SYMBOL FOR QUINTESSENCE;So;0;ON;;;;;N;;;;; 1F701;ALCHEMICAL SYMBOL FOR AIR;So;0;ON;;;;;N;;;;; 1F702;ALCHEMICAL SYMBOL FOR FIRE;So;0;ON;;;;;N;;;;; 1F703;ALCHEMICAL SYMBOL FOR EARTH;So;0;ON;;;;;N;;;;; 1F704;ALCHEMICAL SYMBOL FOR WATER;So;0;ON;;;;;N;;;;; 1F705;ALCHEMICAL SYMBOL FOR AQUAFORTIS;So;0;ON;;;;;N;;;;; 1F706;ALCHEMICAL SYMBOL FOR AQUA REGIA;So;0;ON;;;;;N;;;;; 1F707;ALCHEMICAL SYMBOL FOR AQUA REGIA-2;So;0;ON;;;;;N;;;;; 1F708;ALCHEMICAL SYMBOL FOR AQUA VITAE;So;0;ON;;;;;N;;;;; 1F709;ALCHEMICAL SYMBOL FOR AQUA VITAE-2;So;0;ON;;;;;N;;;;; 1F70A;ALCHEMICAL SYMBOL FOR VINEGAR;So;0;ON;;;;;N;;;;; 1F70B;ALCHEMICAL SYMBOL FOR VINEGAR-2;So;0;ON;;;;;N;;;;; 1F70C;ALCHEMICAL SYMBOL FOR VINEGAR-3;So;0;ON;;;;;N;;;;; 1F70D;ALCHEMICAL SYMBOL FOR SULFUR;So;0;ON;;;;;N;;;;; 1F70E;ALCHEMICAL SYMBOL FOR PHILOSOPHERS SULFUR;So;0;ON;;;;;N;;;;; 1F70F;ALCHEMICAL SYMBOL FOR BLACK SULFUR;So;0;ON;;;;;N;;;;; 1F710;ALCHEMICAL SYMBOL FOR MERCURY SUBLIMATE;So;0;ON;;;;;N;;;;; 1F711;ALCHEMICAL SYMBOL FOR MERCURY SUBLIMATE-2;So;0;ON;;;;;N;;;;; 1F712;ALCHEMICAL SYMBOL FOR MERCURY SUBLIMATE-3;So;0;ON;;;;;N;;;;; 1F713;ALCHEMICAL SYMBOL FOR CINNABAR;So;0;ON;;;;;N;;;;; 1F714;ALCHEMICAL SYMBOL FOR SALT;So;0;ON;;;;;N;;;;; 1F715;ALCHEMICAL SYMBOL FOR NITRE;So;0;ON;;;;;N;;;;; 1F716;ALCHEMICAL SYMBOL FOR VITRIOL;So;0;ON;;;;;N;;;;; 1F717;ALCHEMICAL SYMBOL FOR VITRIOL-2;So;0;ON;;;;;N;;;;; 1F718;ALCHEMICAL SYMBOL FOR ROCK SALT;So;0;ON;;;;;N;;;;; 1F719;ALCHEMICAL SYMBOL FOR ROCK SALT-2;So;0;ON;;;;;N;;;;; 1F71A;ALCHEMICAL SYMBOL FOR GOLD;So;0;ON;;;;;N;;;;; 1F71B;ALCHEMICAL SYMBOL FOR SILVER;So;0;ON;;;;;N;;;;; 1F71C;ALCHEMICAL SYMBOL FOR IRON ORE;So;0;ON;;;;;N;;;;; 1F71D;ALCHEMICAL SYMBOL FOR IRON ORE-2;So;0;ON;;;;;N;;;;; 1F71E;ALCHEMICAL SYMBOL FOR CROCUS OF IRON;So;0;ON;;;;;N;;;;; 1F71F;ALCHEMICAL SYMBOL FOR REGULUS OF IRON;So;0;ON;;;;;N;;;;; 1F720;ALCHEMICAL SYMBOL FOR COPPER ORE;So;0;ON;;;;;N;;;;; 1F721;ALCHEMICAL SYMBOL FOR IRON-COPPER ORE;So;0;ON;;;;;N;;;;; 1F722;ALCHEMICAL SYMBOL FOR SUBLIMATE OF COPPER;So;0;ON;;;;;N;;;;; 1F723;ALCHEMICAL SYMBOL FOR CROCUS OF COPPER;So;0;ON;;;;;N;;;;; 1F724;ALCHEMICAL SYMBOL FOR CROCUS OF COPPER-2;So;0;ON;;;;;N;;;;; 1F725;ALCHEMICAL SYMBOL FOR COPPER ANTIMONIATE;So;0;ON;;;;;N;;;;; 1F726;ALCHEMICAL SYMBOL FOR SALT OF COPPER ANTIMONIATE;So;0;ON;;;;;N;;;;; 1F727;ALCHEMICAL SYMBOL FOR SUBLIMATE OF SALT OF COPPER;So;0;ON;;;;;N;;;;; 1F728;ALCHEMICAL SYMBOL FOR VERDIGRIS;So;0;ON;;;;;N;;;;; 1F729;ALCHEMICAL SYMBOL FOR TIN ORE;So;0;ON;;;;;N;;;;; 1F72A;ALCHEMICAL SYMBOL FOR LEAD ORE;So;0;ON;;;;;N;;;;; 1F72B;ALCHEMICAL SYMBOL FOR ANTIMONY ORE;So;0;ON;;;;;N;;;;; 1F72C;ALCHEMICAL SYMBOL FOR SUBLIMATE OF ANTIMONY;So;0;ON;;;;;N;;;;; 1F72D;ALCHEMICAL SYMBOL FOR SALT OF ANTIMONY;So;0;ON;;;;;N;;;;; 1F72E;ALCHEMICAL SYMBOL FOR SUBLIMATE OF SALT OF ANTIMONY;So;0;ON;;;;;N;;;;; 1F72F;ALCHEMICAL SYMBOL FOR VINEGAR OF ANTIMONY;So;0;ON;;;;;N;;;;; 1F730;ALCHEMICAL SYMBOL FOR REGULUS OF ANTIMONY;So;0;ON;;;;;N;;;;; 1F731;ALCHEMICAL SYMBOL FOR REGULUS OF ANTIMONY-2;So;0;ON;;;;;N;;;;; 1F732;ALCHEMICAL SYMBOL FOR REGULUS;So;0;ON;;;;;N;;;;; 1F733;ALCHEMICAL SYMBOL FOR REGULUS-2;So;0;ON;;;;;N;;;;; 1F734;ALCHEMICAL SYMBOL FOR REGULUS-3;So;0;ON;;;;;N;;;;; 1F735;ALCHEMICAL SYMBOL FOR REGULUS-4;So;0;ON;;;;;N;;;;; 1F736;ALCHEMICAL SYMBOL FOR ALKALI;So;0;ON;;;;;N;;;;; 1F737;ALCHEMICAL SYMBOL FOR ALKALI-2;So;0;ON;;;;;N;;;;; 1F738;ALCHEMICAL SYMBOL FOR MARCASITE;So;0;ON;;;;;N;;;;; 1F739;ALCHEMICAL SYMBOL FOR SAL-AMMONIAC;So;0;ON;;;;;N;;;;; 1F73A;ALCHEMICAL SYMBOL FOR ARSENIC;So;0;ON;;;;;N;;;;; 1F73B;ALCHEMICAL SYMBOL FOR REALGAR;So;0;ON;;;;;N;;;;; 1F73C;ALCHEMICAL SYMBOL FOR REALGAR-2;So;0;ON;;;;;N;;;;; 1F73D;ALCHEMICAL SYMBOL FOR AURIPIGMENT;So;0;ON;;;;;N;;;;; 1F73E;ALCHEMICAL SYMBOL FOR BISMUTH ORE;So;0;ON;;;;;N;;;;; 1F73F;ALCHEMICAL SYMBOL FOR TARTAR;So;0;ON;;;;;N;;;;; 1F740;ALCHEMICAL SYMBOL FOR TARTAR-2;So;0;ON;;;;;N;;;;; 1F741;ALCHEMICAL SYMBOL FOR QUICK LIME;So;0;ON;;;;;N;;;;; 1F742;ALCHEMICAL SYMBOL FOR BORAX;So;0;ON;;;;;N;;;;; 1F743;ALCHEMICAL SYMBOL FOR BORAX-2;So;0;ON;;;;;N;;;;; 1F744;ALCHEMICAL SYMBOL FOR BORAX-3;So;0;ON;;;;;N;;;;; 1F745;ALCHEMICAL SYMBOL FOR ALUM;So;0;ON;;;;;N;;;;; 1F746;ALCHEMICAL SYMBOL FOR OIL;So;0;ON;;;;;N;;;;; 1F747;ALCHEMICAL SYMBOL FOR SPIRIT;So;0;ON;;;;;N;;;;; 1F748;ALCHEMICAL SYMBOL FOR TINCTURE;So;0;ON;;;;;N;;;;; 1F749;ALCHEMICAL SYMBOL FOR GUM;So;0;ON;;;;;N;;;;; 1F74A;ALCHEMICAL SYMBOL FOR WAX;So;0;ON;;;;;N;;;;; 1F74B;ALCHEMICAL SYMBOL FOR POWDER;So;0;ON;;;;;N;;;;; 1F74C;ALCHEMICAL SYMBOL FOR CALX;So;0;ON;;;;;N;;;;; 1F74D;ALCHEMICAL SYMBOL FOR TUTTY;So;0;ON;;;;;N;;;;; 1F74E;ALCHEMICAL SYMBOL FOR CAPUT MORTUUM;So;0;ON;;;;;N;;;;; 1F74F;ALCHEMICAL SYMBOL FOR SCEPTER OF JOVE;So;0;ON;;;;;N;;;;; 1F750;ALCHEMICAL SYMBOL FOR CADUCEUS;So;0;ON;;;;;N;;;;; 1F751;ALCHEMICAL SYMBOL FOR TRIDENT;So;0;ON;;;;;N;;;;; 1F752;ALCHEMICAL SYMBOL FOR STARRED TRIDENT;So;0;ON;;;;;N;;;;; 1F753;ALCHEMICAL SYMBOL FOR LODESTONE;So;0;ON;;;;;N;;;;; 1F754;ALCHEMICAL SYMBOL FOR SOAP;So;0;ON;;;;;N;;;;; 1F755;ALCHEMICAL SYMBOL FOR URINE;So;0;ON;;;;;N;;;;; 1F756;ALCHEMICAL SYMBOL FOR HORSE DUNG;So;0;ON;;;;;N;;;;; 1F757;ALCHEMICAL SYMBOL FOR ASHES;So;0;ON;;;;;N;;;;; 1F758;ALCHEMICAL SYMBOL FOR POT ASHES;So;0;ON;;;;;N;;;;; 1F759;ALCHEMICAL SYMBOL FOR BRICK;So;0;ON;;;;;N;;;;; 1F75A;ALCHEMICAL SYMBOL FOR POWDERED BRICK;So;0;ON;;;;;N;;;;; 1F75B;ALCHEMICAL SYMBOL FOR AMALGAM;So;0;ON;;;;;N;;;;; 1F75C;ALCHEMICAL SYMBOL FOR STRATUM SUPER STRATUM;So;0;ON;;;;;N;;;;; 1F75D;ALCHEMICAL SYMBOL FOR STRATUM SUPER STRATUM-2;So;0;ON;;;;;N;;;;; 1F75E;ALCHEMICAL SYMBOL FOR SUBLIMATION;So;0;ON;;;;;N;;;;; 1F75F;ALCHEMICAL SYMBOL FOR PRECIPITATE;So;0;ON;;;;;N;;;;; 1F760;ALCHEMICAL SYMBOL FOR DISTILL;So;0;ON;;;;;N;;;;; 1F761;ALCHEMICAL SYMBOL FOR DISSOLVE;So;0;ON;;;;;N;;;;; 1F762;ALCHEMICAL SYMBOL FOR DISSOLVE-2;So;0;ON;;;;;N;;;;; 1F763;ALCHEMICAL SYMBOL FOR PURIFY;So;0;ON;;;;;N;;;;; 1F764;ALCHEMICAL SYMBOL FOR PUTREFACTION;So;0;ON;;;;;N;;;;; 1F765;ALCHEMICAL SYMBOL FOR CRUCIBLE;So;0;ON;;;;;N;;;;; 1F766;ALCHEMICAL SYMBOL FOR CRUCIBLE-2;So;0;ON;;;;;N;;;;; 1F767;ALCHEMICAL SYMBOL FOR CRUCIBLE-3;So;0;ON;;;;;N;;;;; 1F768;ALCHEMICAL SYMBOL FOR CRUCIBLE-4;So;0;ON;;;;;N;;;;; 1F769;ALCHEMICAL SYMBOL FOR CRUCIBLE-5;So;0;ON;;;;;N;;;;; 1F76A;ALCHEMICAL SYMBOL FOR ALEMBIC;So;0;ON;;;;;N;;;;; 1F76B;ALCHEMICAL SYMBOL FOR BATH OF MARY;So;0;ON;;;;;N;;;;; 1F76C;ALCHEMICAL SYMBOL FOR BATH OF VAPOURS;So;0;ON;;;;;N;;;;; 1F76D;ALCHEMICAL SYMBOL FOR RETORT;So;0;ON;;;;;N;;;;; 1F76E;ALCHEMICAL SYMBOL FOR HOUR;So;0;ON;;;;;N;;;;; 1F76F;ALCHEMICAL SYMBOL FOR NIGHT;So;0;ON;;;;;N;;;;; 1F770;ALCHEMICAL SYMBOL FOR DAY-NIGHT;So;0;ON;;;;;N;;;;; 1F771;ALCHEMICAL SYMBOL FOR MONTH;So;0;ON;;;;;N;;;;; 1F772;ALCHEMICAL SYMBOL FOR HALF DRAM;So;0;ON;;;;;N;;;;; 1F773;ALCHEMICAL SYMBOL FOR HALF OUNCE;So;0;ON;;;;;N;;;;; 20000;;Lo;0;L;;;;;N;;;;; 2A6D6;;Lo;0;L;;;;;N;;;;; 2A700;;Lo;0;L;;;;;N;;;;; 2B734;;Lo;0;L;;;;;N;;;;; 2B740;;Lo;0;L;;;;;N;;;;; 2B81D;;Lo;0;L;;;;;N;;;;; 2F800;CJK COMPATIBILITY IDEOGRAPH-2F800;Lo;0;L;4E3D;;;;N;;;;; 2F801;CJK COMPATIBILITY IDEOGRAPH-2F801;Lo;0;L;4E38;;;;N;;;;; 2F802;CJK COMPATIBILITY IDEOGRAPH-2F802;Lo;0;L;4E41;;;;N;;;;; 2F803;CJK COMPATIBILITY IDEOGRAPH-2F803;Lo;0;L;20122;;;;N;;;;; 2F804;CJK COMPATIBILITY IDEOGRAPH-2F804;Lo;0;L;4F60;;;;N;;;;; 2F805;CJK COMPATIBILITY IDEOGRAPH-2F805;Lo;0;L;4FAE;;;;N;;;;; 2F806;CJK COMPATIBILITY IDEOGRAPH-2F806;Lo;0;L;4FBB;;;;N;;;;; 2F807;CJK COMPATIBILITY IDEOGRAPH-2F807;Lo;0;L;5002;;;;N;;;;; 2F808;CJK COMPATIBILITY IDEOGRAPH-2F808;Lo;0;L;507A;;;;N;;;;; 2F809;CJK COMPATIBILITY IDEOGRAPH-2F809;Lo;0;L;5099;;;;N;;;;; 2F80A;CJK COMPATIBILITY IDEOGRAPH-2F80A;Lo;0;L;50E7;;;;N;;;;; 2F80B;CJK COMPATIBILITY IDEOGRAPH-2F80B;Lo;0;L;50CF;;;;N;;;;; 2F80C;CJK COMPATIBILITY IDEOGRAPH-2F80C;Lo;0;L;349E;;;;N;;;;; 2F80D;CJK COMPATIBILITY IDEOGRAPH-2F80D;Lo;0;L;2063A;;;;N;;;;; 2F80E;CJK COMPATIBILITY IDEOGRAPH-2F80E;Lo;0;L;514D;;;;N;;;;; 2F80F;CJK COMPATIBILITY IDEOGRAPH-2F80F;Lo;0;L;5154;;;;N;;;;; 2F810;CJK COMPATIBILITY IDEOGRAPH-2F810;Lo;0;L;5164;;;;N;;;;; 2F811;CJK COMPATIBILITY IDEOGRAPH-2F811;Lo;0;L;5177;;;;N;;;;; 2F812;CJK COMPATIBILITY IDEOGRAPH-2F812;Lo;0;L;2051C;;;;N;;;;; 2F813;CJK COMPATIBILITY IDEOGRAPH-2F813;Lo;0;L;34B9;;;;N;;;;; 2F814;CJK COMPATIBILITY IDEOGRAPH-2F814;Lo;0;L;5167;;;;N;;;;; 2F815;CJK COMPATIBILITY IDEOGRAPH-2F815;Lo;0;L;518D;;;;N;;;;; 2F816;CJK COMPATIBILITY IDEOGRAPH-2F816;Lo;0;L;2054B;;;;N;;;;; 2F817;CJK COMPATIBILITY IDEOGRAPH-2F817;Lo;0;L;5197;;;;N;;;;; 2F818;CJK COMPATIBILITY IDEOGRAPH-2F818;Lo;0;L;51A4;;;;N;;;;; 2F819;CJK COMPATIBILITY IDEOGRAPH-2F819;Lo;0;L;4ECC;;;;N;;;;; 2F81A;CJK COMPATIBILITY IDEOGRAPH-2F81A;Lo;0;L;51AC;;;;N;;;;; 2F81B;CJK COMPATIBILITY IDEOGRAPH-2F81B;Lo;0;L;51B5;;;;N;;;;; 2F81C;CJK COMPATIBILITY IDEOGRAPH-2F81C;Lo;0;L;291DF;;;;N;;;;; 2F81D;CJK COMPATIBILITY IDEOGRAPH-2F81D;Lo;0;L;51F5;;;;N;;;;; 2F81E;CJK COMPATIBILITY IDEOGRAPH-2F81E;Lo;0;L;5203;;;;N;;;;; 2F81F;CJK COMPATIBILITY IDEOGRAPH-2F81F;Lo;0;L;34DF;;;;N;;;;; 2F820;CJK COMPATIBILITY IDEOGRAPH-2F820;Lo;0;L;523B;;;;N;;;;; 2F821;CJK COMPATIBILITY IDEOGRAPH-2F821;Lo;0;L;5246;;;;N;;;;; 2F822;CJK COMPATIBILITY IDEOGRAPH-2F822;Lo;0;L;5272;;;;N;;;;; 2F823;CJK COMPATIBILITY IDEOGRAPH-2F823;Lo;0;L;5277;;;;N;;;;; 2F824;CJK COMPATIBILITY IDEOGRAPH-2F824;Lo;0;L;3515;;;;N;;;;; 2F825;CJK COMPATIBILITY IDEOGRAPH-2F825;Lo;0;L;52C7;;;;N;;;;; 2F826;CJK COMPATIBILITY IDEOGRAPH-2F826;Lo;0;L;52C9;;;;N;;;;; 2F827;CJK COMPATIBILITY IDEOGRAPH-2F827;Lo;0;L;52E4;;;;N;;;;; 2F828;CJK COMPATIBILITY IDEOGRAPH-2F828;Lo;0;L;52FA;;;;N;;;;; 2F829;CJK COMPATIBILITY IDEOGRAPH-2F829;Lo;0;L;5305;;;;N;;;;; 2F82A;CJK COMPATIBILITY IDEOGRAPH-2F82A;Lo;0;L;5306;;;;N;;;;; 2F82B;CJK COMPATIBILITY IDEOGRAPH-2F82B;Lo;0;L;5317;;;;N;;;;; 2F82C;CJK COMPATIBILITY IDEOGRAPH-2F82C;Lo;0;L;5349;;;;N;;;;; 2F82D;CJK COMPATIBILITY IDEOGRAPH-2F82D;Lo;0;L;5351;;;;N;;;;; 2F82E;CJK COMPATIBILITY IDEOGRAPH-2F82E;Lo;0;L;535A;;;;N;;;;; 2F82F;CJK COMPATIBILITY IDEOGRAPH-2F82F;Lo;0;L;5373;;;;N;;;;; 2F830;CJK COMPATIBILITY IDEOGRAPH-2F830;Lo;0;L;537D;;;;N;;;;; 2F831;CJK COMPATIBILITY IDEOGRAPH-2F831;Lo;0;L;537F;;;;N;;;;; 2F832;CJK COMPATIBILITY IDEOGRAPH-2F832;Lo;0;L;537F;;;;N;;;;; 2F833;CJK COMPATIBILITY IDEOGRAPH-2F833;Lo;0;L;537F;;;;N;;;;; 2F834;CJK COMPATIBILITY IDEOGRAPH-2F834;Lo;0;L;20A2C;;;;N;;;;; 2F835;CJK COMPATIBILITY IDEOGRAPH-2F835;Lo;0;L;7070;;;;N;;;;; 2F836;CJK COMPATIBILITY IDEOGRAPH-2F836;Lo;0;L;53CA;;;;N;;;;; 2F837;CJK COMPATIBILITY IDEOGRAPH-2F837;Lo;0;L;53DF;;;;N;;;;; 2F838;CJK COMPATIBILITY IDEOGRAPH-2F838;Lo;0;L;20B63;;;;N;;;;; 2F839;CJK COMPATIBILITY IDEOGRAPH-2F839;Lo;0;L;53EB;;;;N;;;;; 2F83A;CJK COMPATIBILITY IDEOGRAPH-2F83A;Lo;0;L;53F1;;;;N;;;;; 2F83B;CJK COMPATIBILITY IDEOGRAPH-2F83B;Lo;0;L;5406;;;;N;;;;; 2F83C;CJK COMPATIBILITY IDEOGRAPH-2F83C;Lo;0;L;549E;;;;N;;;;; 2F83D;CJK COMPATIBILITY IDEOGRAPH-2F83D;Lo;0;L;5438;;;;N;;;;; 2F83E;CJK COMPATIBILITY IDEOGRAPH-2F83E;Lo;0;L;5448;;;;N;;;;; 2F83F;CJK COMPATIBILITY IDEOGRAPH-2F83F;Lo;0;L;5468;;;;N;;;;; 2F840;CJK COMPATIBILITY IDEOGRAPH-2F840;Lo;0;L;54A2;;;;N;;;;; 2F841;CJK COMPATIBILITY IDEOGRAPH-2F841;Lo;0;L;54F6;;;;N;;;;; 2F842;CJK COMPATIBILITY IDEOGRAPH-2F842;Lo;0;L;5510;;;;N;;;;; 2F843;CJK COMPATIBILITY IDEOGRAPH-2F843;Lo;0;L;5553;;;;N;;;;; 2F844;CJK COMPATIBILITY IDEOGRAPH-2F844;Lo;0;L;5563;;;;N;;;;; 2F845;CJK COMPATIBILITY IDEOGRAPH-2F845;Lo;0;L;5584;;;;N;;;;; 2F846;CJK COMPATIBILITY IDEOGRAPH-2F846;Lo;0;L;5584;;;;N;;;;; 2F847;CJK COMPATIBILITY IDEOGRAPH-2F847;Lo;0;L;5599;;;;N;;;;; 2F848;CJK COMPATIBILITY IDEOGRAPH-2F848;Lo;0;L;55AB;;;;N;;;;; 2F849;CJK COMPATIBILITY IDEOGRAPH-2F849;Lo;0;L;55B3;;;;N;;;;; 2F84A;CJK COMPATIBILITY IDEOGRAPH-2F84A;Lo;0;L;55C2;;;;N;;;;; 2F84B;CJK COMPATIBILITY IDEOGRAPH-2F84B;Lo;0;L;5716;;;;N;;;;; 2F84C;CJK COMPATIBILITY IDEOGRAPH-2F84C;Lo;0;L;5606;;;;N;;;;; 2F84D;CJK COMPATIBILITY IDEOGRAPH-2F84D;Lo;0;L;5717;;;;N;;;;; 2F84E;CJK COMPATIBILITY IDEOGRAPH-2F84E;Lo;0;L;5651;;;;N;;;;; 2F84F;CJK COMPATIBILITY IDEOGRAPH-2F84F;Lo;0;L;5674;;;;N;;;;; 2F850;CJK COMPATIBILITY IDEOGRAPH-2F850;Lo;0;L;5207;;;;N;;;;; 2F851;CJK COMPATIBILITY IDEOGRAPH-2F851;Lo;0;L;58EE;;;;N;;;;; 2F852;CJK COMPATIBILITY IDEOGRAPH-2F852;Lo;0;L;57CE;;;;N;;;;; 2F853;CJK COMPATIBILITY IDEOGRAPH-2F853;Lo;0;L;57F4;;;;N;;;;; 2F854;CJK COMPATIBILITY IDEOGRAPH-2F854;Lo;0;L;580D;;;;N;;;;; 2F855;CJK COMPATIBILITY IDEOGRAPH-2F855;Lo;0;L;578B;;;;N;;;;; 2F856;CJK COMPATIBILITY IDEOGRAPH-2F856;Lo;0;L;5832;;;;N;;;;; 2F857;CJK COMPATIBILITY IDEOGRAPH-2F857;Lo;0;L;5831;;;;N;;;;; 2F858;CJK COMPATIBILITY IDEOGRAPH-2F858;Lo;0;L;58AC;;;;N;;;;; 2F859;CJK COMPATIBILITY IDEOGRAPH-2F859;Lo;0;L;214E4;;;;N;;;;; 2F85A;CJK COMPATIBILITY IDEOGRAPH-2F85A;Lo;0;L;58F2;;;;N;;;;; 2F85B;CJK COMPATIBILITY IDEOGRAPH-2F85B;Lo;0;L;58F7;;;;N;;;;; 2F85C;CJK COMPATIBILITY IDEOGRAPH-2F85C;Lo;0;L;5906;;;;N;;;;; 2F85D;CJK COMPATIBILITY IDEOGRAPH-2F85D;Lo;0;L;591A;;;;N;;;;; 2F85E;CJK COMPATIBILITY IDEOGRAPH-2F85E;Lo;0;L;5922;;;;N;;;;; 2F85F;CJK COMPATIBILITY IDEOGRAPH-2F85F;Lo;0;L;5962;;;;N;;;;; 2F860;CJK COMPATIBILITY IDEOGRAPH-2F860;Lo;0;L;216A8;;;;N;;;;; 2F861;CJK COMPATIBILITY IDEOGRAPH-2F861;Lo;0;L;216EA;;;;N;;;;; 2F862;CJK COMPATIBILITY IDEOGRAPH-2F862;Lo;0;L;59EC;;;;N;;;;; 2F863;CJK COMPATIBILITY IDEOGRAPH-2F863;Lo;0;L;5A1B;;;;N;;;;; 2F864;CJK COMPATIBILITY IDEOGRAPH-2F864;Lo;0;L;5A27;;;;N;;;;; 2F865;CJK COMPATIBILITY IDEOGRAPH-2F865;Lo;0;L;59D8;;;;N;;;;; 2F866;CJK COMPATIBILITY IDEOGRAPH-2F866;Lo;0;L;5A66;;;;N;;;;; 2F867;CJK COMPATIBILITY IDEOGRAPH-2F867;Lo;0;L;36EE;;;;N;;;;; 2F868;CJK COMPATIBILITY IDEOGRAPH-2F868;Lo;0;L;36FC;;;;N;;;;; 2F869;CJK COMPATIBILITY IDEOGRAPH-2F869;Lo;0;L;5B08;;;;N;;;;; 2F86A;CJK COMPATIBILITY IDEOGRAPH-2F86A;Lo;0;L;5B3E;;;;N;;;;; 2F86B;CJK COMPATIBILITY IDEOGRAPH-2F86B;Lo;0;L;5B3E;;;;N;;;;; 2F86C;CJK COMPATIBILITY IDEOGRAPH-2F86C;Lo;0;L;219C8;;;;N;;;;; 2F86D;CJK COMPATIBILITY IDEOGRAPH-2F86D;Lo;0;L;5BC3;;;;N;;;;; 2F86E;CJK COMPATIBILITY IDEOGRAPH-2F86E;Lo;0;L;5BD8;;;;N;;;;; 2F86F;CJK COMPATIBILITY IDEOGRAPH-2F86F;Lo;0;L;5BE7;;;;N;;;;; 2F870;CJK COMPATIBILITY IDEOGRAPH-2F870;Lo;0;L;5BF3;;;;N;;;;; 2F871;CJK COMPATIBILITY IDEOGRAPH-2F871;Lo;0;L;21B18;;;;N;;;;; 2F872;CJK COMPATIBILITY IDEOGRAPH-2F872;Lo;0;L;5BFF;;;;N;;;;; 2F873;CJK COMPATIBILITY IDEOGRAPH-2F873;Lo;0;L;5C06;;;;N;;;;; 2F874;CJK COMPATIBILITY IDEOGRAPH-2F874;Lo;0;L;5F53;;;;N;;;;; 2F875;CJK COMPATIBILITY IDEOGRAPH-2F875;Lo;0;L;5C22;;;;N;;;;; 2F876;CJK COMPATIBILITY IDEOGRAPH-2F876;Lo;0;L;3781;;;;N;;;;; 2F877;CJK COMPATIBILITY IDEOGRAPH-2F877;Lo;0;L;5C60;;;;N;;;;; 2F878;CJK COMPATIBILITY IDEOGRAPH-2F878;Lo;0;L;5C6E;;;;N;;;;; 2F879;CJK COMPATIBILITY IDEOGRAPH-2F879;Lo;0;L;5CC0;;;;N;;;;; 2F87A;CJK COMPATIBILITY IDEOGRAPH-2F87A;Lo;0;L;5C8D;;;;N;;;;; 2F87B;CJK COMPATIBILITY IDEOGRAPH-2F87B;Lo;0;L;21DE4;;;;N;;;;; 2F87C;CJK COMPATIBILITY IDEOGRAPH-2F87C;Lo;0;L;5D43;;;;N;;;;; 2F87D;CJK COMPATIBILITY IDEOGRAPH-2F87D;Lo;0;L;21DE6;;;;N;;;;; 2F87E;CJK COMPATIBILITY IDEOGRAPH-2F87E;Lo;0;L;5D6E;;;;N;;;;; 2F87F;CJK COMPATIBILITY IDEOGRAPH-2F87F;Lo;0;L;5D6B;;;;N;;;;; 2F880;CJK COMPATIBILITY IDEOGRAPH-2F880;Lo;0;L;5D7C;;;;N;;;;; 2F881;CJK COMPATIBILITY IDEOGRAPH-2F881;Lo;0;L;5DE1;;;;N;;;;; 2F882;CJK COMPATIBILITY IDEOGRAPH-2F882;Lo;0;L;5DE2;;;;N;;;;; 2F883;CJK COMPATIBILITY IDEOGRAPH-2F883;Lo;0;L;382F;;;;N;;;;; 2F884;CJK COMPATIBILITY IDEOGRAPH-2F884;Lo;0;L;5DFD;;;;N;;;;; 2F885;CJK COMPATIBILITY IDEOGRAPH-2F885;Lo;0;L;5E28;;;;N;;;;; 2F886;CJK COMPATIBILITY IDEOGRAPH-2F886;Lo;0;L;5E3D;;;;N;;;;; 2F887;CJK COMPATIBILITY IDEOGRAPH-2F887;Lo;0;L;5E69;;;;N;;;;; 2F888;CJK COMPATIBILITY IDEOGRAPH-2F888;Lo;0;L;3862;;;;N;;;;; 2F889;CJK COMPATIBILITY IDEOGRAPH-2F889;Lo;0;L;22183;;;;N;;;;; 2F88A;CJK COMPATIBILITY IDEOGRAPH-2F88A;Lo;0;L;387C;;;;N;;;;; 2F88B;CJK COMPATIBILITY IDEOGRAPH-2F88B;Lo;0;L;5EB0;;;;N;;;;; 2F88C;CJK COMPATIBILITY IDEOGRAPH-2F88C;Lo;0;L;5EB3;;;;N;;;;; 2F88D;CJK COMPATIBILITY IDEOGRAPH-2F88D;Lo;0;L;5EB6;;;;N;;;;; 2F88E;CJK COMPATIBILITY IDEOGRAPH-2F88E;Lo;0;L;5ECA;;;;N;;;;; 2F88F;CJK COMPATIBILITY IDEOGRAPH-2F88F;Lo;0;L;2A392;;;;N;;;;; 2F890;CJK COMPATIBILITY IDEOGRAPH-2F890;Lo;0;L;5EFE;;;9;N;;;;; 2F891;CJK COMPATIBILITY IDEOGRAPH-2F891;Lo;0;L;22331;;;;N;;;;; 2F892;CJK COMPATIBILITY IDEOGRAPH-2F892;Lo;0;L;22331;;;;N;;;;; 2F893;CJK COMPATIBILITY IDEOGRAPH-2F893;Lo;0;L;8201;;;;N;;;;; 2F894;CJK COMPATIBILITY IDEOGRAPH-2F894;Lo;0;L;5F22;;;;N;;;;; 2F895;CJK COMPATIBILITY IDEOGRAPH-2F895;Lo;0;L;5F22;;;;N;;;;; 2F896;CJK COMPATIBILITY IDEOGRAPH-2F896;Lo;0;L;38C7;;;;N;;;;; 2F897;CJK COMPATIBILITY IDEOGRAPH-2F897;Lo;0;L;232B8;;;;N;;;;; 2F898;CJK COMPATIBILITY IDEOGRAPH-2F898;Lo;0;L;261DA;;;;N;;;;; 2F899;CJK COMPATIBILITY IDEOGRAPH-2F899;Lo;0;L;5F62;;;;N;;;;; 2F89A;CJK COMPATIBILITY IDEOGRAPH-2F89A;Lo;0;L;5F6B;;;;N;;;;; 2F89B;CJK COMPATIBILITY IDEOGRAPH-2F89B;Lo;0;L;38E3;;;;N;;;;; 2F89C;CJK COMPATIBILITY IDEOGRAPH-2F89C;Lo;0;L;5F9A;;;;N;;;;; 2F89D;CJK COMPATIBILITY IDEOGRAPH-2F89D;Lo;0;L;5FCD;;;;N;;;;; 2F89E;CJK COMPATIBILITY IDEOGRAPH-2F89E;Lo;0;L;5FD7;;;;N;;;;; 2F89F;CJK COMPATIBILITY IDEOGRAPH-2F89F;Lo;0;L;5FF9;;;;N;;;;; 2F8A0;CJK COMPATIBILITY IDEOGRAPH-2F8A0;Lo;0;L;6081;;;;N;;;;; 2F8A1;CJK COMPATIBILITY IDEOGRAPH-2F8A1;Lo;0;L;393A;;;;N;;;;; 2F8A2;CJK COMPATIBILITY IDEOGRAPH-2F8A2;Lo;0;L;391C;;;;N;;;;; 2F8A3;CJK COMPATIBILITY IDEOGRAPH-2F8A3;Lo;0;L;6094;;;;N;;;;; 2F8A4;CJK COMPATIBILITY IDEOGRAPH-2F8A4;Lo;0;L;226D4;;;;N;;;;; 2F8A5;CJK COMPATIBILITY IDEOGRAPH-2F8A5;Lo;0;L;60C7;;;;N;;;;; 2F8A6;CJK COMPATIBILITY IDEOGRAPH-2F8A6;Lo;0;L;6148;;;;N;;;;; 2F8A7;CJK COMPATIBILITY IDEOGRAPH-2F8A7;Lo;0;L;614C;;;;N;;;;; 2F8A8;CJK COMPATIBILITY IDEOGRAPH-2F8A8;Lo;0;L;614E;;;;N;;;;; 2F8A9;CJK COMPATIBILITY IDEOGRAPH-2F8A9;Lo;0;L;614C;;;;N;;;;; 2F8AA;CJK COMPATIBILITY IDEOGRAPH-2F8AA;Lo;0;L;617A;;;;N;;;;; 2F8AB;CJK COMPATIBILITY IDEOGRAPH-2F8AB;Lo;0;L;618E;;;;N;;;;; 2F8AC;CJK COMPATIBILITY IDEOGRAPH-2F8AC;Lo;0;L;61B2;;;;N;;;;; 2F8AD;CJK COMPATIBILITY IDEOGRAPH-2F8AD;Lo;0;L;61A4;;;;N;;;;; 2F8AE;CJK COMPATIBILITY IDEOGRAPH-2F8AE;Lo;0;L;61AF;;;;N;;;;; 2F8AF;CJK COMPATIBILITY IDEOGRAPH-2F8AF;Lo;0;L;61DE;;;;N;;;;; 2F8B0;CJK COMPATIBILITY IDEOGRAPH-2F8B0;Lo;0;L;61F2;;;;N;;;;; 2F8B1;CJK COMPATIBILITY IDEOGRAPH-2F8B1;Lo;0;L;61F6;;;;N;;;;; 2F8B2;CJK COMPATIBILITY IDEOGRAPH-2F8B2;Lo;0;L;6210;;;;N;;;;; 2F8B3;CJK COMPATIBILITY IDEOGRAPH-2F8B3;Lo;0;L;621B;;;;N;;;;; 2F8B4;CJK COMPATIBILITY IDEOGRAPH-2F8B4;Lo;0;L;625D;;;;N;;;;; 2F8B5;CJK COMPATIBILITY IDEOGRAPH-2F8B5;Lo;0;L;62B1;;;;N;;;;; 2F8B6;CJK COMPATIBILITY IDEOGRAPH-2F8B6;Lo;0;L;62D4;;;;N;;;;; 2F8B7;CJK COMPATIBILITY IDEOGRAPH-2F8B7;Lo;0;L;6350;;;;N;;;;; 2F8B8;CJK COMPATIBILITY IDEOGRAPH-2F8B8;Lo;0;L;22B0C;;;;N;;;;; 2F8B9;CJK COMPATIBILITY IDEOGRAPH-2F8B9;Lo;0;L;633D;;;;N;;;;; 2F8BA;CJK COMPATIBILITY IDEOGRAPH-2F8BA;Lo;0;L;62FC;;;;N;;;;; 2F8BB;CJK COMPATIBILITY IDEOGRAPH-2F8BB;Lo;0;L;6368;;;;N;;;;; 2F8BC;CJK COMPATIBILITY IDEOGRAPH-2F8BC;Lo;0;L;6383;;;;N;;;;; 2F8BD;CJK COMPATIBILITY IDEOGRAPH-2F8BD;Lo;0;L;63E4;;;;N;;;;; 2F8BE;CJK COMPATIBILITY IDEOGRAPH-2F8BE;Lo;0;L;22BF1;;;;N;;;;; 2F8BF;CJK COMPATIBILITY IDEOGRAPH-2F8BF;Lo;0;L;6422;;;;N;;;;; 2F8C0;CJK COMPATIBILITY IDEOGRAPH-2F8C0;Lo;0;L;63C5;;;;N;;;;; 2F8C1;CJK COMPATIBILITY IDEOGRAPH-2F8C1;Lo;0;L;63A9;;;;N;;;;; 2F8C2;CJK COMPATIBILITY IDEOGRAPH-2F8C2;Lo;0;L;3A2E;;;;N;;;;; 2F8C3;CJK COMPATIBILITY IDEOGRAPH-2F8C3;Lo;0;L;6469;;;;N;;;;; 2F8C4;CJK COMPATIBILITY IDEOGRAPH-2F8C4;Lo;0;L;647E;;;;N;;;;; 2F8C5;CJK COMPATIBILITY IDEOGRAPH-2F8C5;Lo;0;L;649D;;;;N;;;;; 2F8C6;CJK COMPATIBILITY IDEOGRAPH-2F8C6;Lo;0;L;6477;;;;N;;;;; 2F8C7;CJK COMPATIBILITY IDEOGRAPH-2F8C7;Lo;0;L;3A6C;;;;N;;;;; 2F8C8;CJK COMPATIBILITY IDEOGRAPH-2F8C8;Lo;0;L;654F;;;;N;;;;; 2F8C9;CJK COMPATIBILITY IDEOGRAPH-2F8C9;Lo;0;L;656C;;;;N;;;;; 2F8CA;CJK COMPATIBILITY IDEOGRAPH-2F8CA;Lo;0;L;2300A;;;;N;;;;; 2F8CB;CJK COMPATIBILITY IDEOGRAPH-2F8CB;Lo;0;L;65E3;;;;N;;;;; 2F8CC;CJK COMPATIBILITY IDEOGRAPH-2F8CC;Lo;0;L;66F8;;;;N;;;;; 2F8CD;CJK COMPATIBILITY IDEOGRAPH-2F8CD;Lo;0;L;6649;;;;N;;;;; 2F8CE;CJK COMPATIBILITY IDEOGRAPH-2F8CE;Lo;0;L;3B19;;;;N;;;;; 2F8CF;CJK COMPATIBILITY IDEOGRAPH-2F8CF;Lo;0;L;6691;;;;N;;;;; 2F8D0;CJK COMPATIBILITY IDEOGRAPH-2F8D0;Lo;0;L;3B08;;;;N;;;;; 2F8D1;CJK COMPATIBILITY IDEOGRAPH-2F8D1;Lo;0;L;3AE4;;;;N;;;;; 2F8D2;CJK COMPATIBILITY IDEOGRAPH-2F8D2;Lo;0;L;5192;;;;N;;;;; 2F8D3;CJK COMPATIBILITY IDEOGRAPH-2F8D3;Lo;0;L;5195;;;;N;;;;; 2F8D4;CJK COMPATIBILITY IDEOGRAPH-2F8D4;Lo;0;L;6700;;;;N;;;;; 2F8D5;CJK COMPATIBILITY IDEOGRAPH-2F8D5;Lo;0;L;669C;;;;N;;;;; 2F8D6;CJK COMPATIBILITY IDEOGRAPH-2F8D6;Lo;0;L;80AD;;;;N;;;;; 2F8D7;CJK COMPATIBILITY IDEOGRAPH-2F8D7;Lo;0;L;43D9;;;;N;;;;; 2F8D8;CJK COMPATIBILITY IDEOGRAPH-2F8D8;Lo;0;L;6717;;;;N;;;;; 2F8D9;CJK COMPATIBILITY IDEOGRAPH-2F8D9;Lo;0;L;671B;;;;N;;;;; 2F8DA;CJK COMPATIBILITY IDEOGRAPH-2F8DA;Lo;0;L;6721;;;;N;;;;; 2F8DB;CJK COMPATIBILITY IDEOGRAPH-2F8DB;Lo;0;L;675E;;;;N;;;;; 2F8DC;CJK COMPATIBILITY IDEOGRAPH-2F8DC;Lo;0;L;6753;;;;N;;;;; 2F8DD;CJK COMPATIBILITY IDEOGRAPH-2F8DD;Lo;0;L;233C3;;;;N;;;;; 2F8DE;CJK COMPATIBILITY IDEOGRAPH-2F8DE;Lo;0;L;3B49;;;;N;;;;; 2F8DF;CJK COMPATIBILITY IDEOGRAPH-2F8DF;Lo;0;L;67FA;;;;N;;;;; 2F8E0;CJK COMPATIBILITY IDEOGRAPH-2F8E0;Lo;0;L;6785;;;;N;;;;; 2F8E1;CJK COMPATIBILITY IDEOGRAPH-2F8E1;Lo;0;L;6852;;;;N;;;;; 2F8E2;CJK COMPATIBILITY IDEOGRAPH-2F8E2;Lo;0;L;6885;;;;N;;;;; 2F8E3;CJK COMPATIBILITY IDEOGRAPH-2F8E3;Lo;0;L;2346D;;;;N;;;;; 2F8E4;CJK COMPATIBILITY IDEOGRAPH-2F8E4;Lo;0;L;688E;;;;N;;;;; 2F8E5;CJK COMPATIBILITY IDEOGRAPH-2F8E5;Lo;0;L;681F;;;;N;;;;; 2F8E6;CJK COMPATIBILITY IDEOGRAPH-2F8E6;Lo;0;L;6914;;;;N;;;;; 2F8E7;CJK COMPATIBILITY IDEOGRAPH-2F8E7;Lo;0;L;3B9D;;;;N;;;;; 2F8E8;CJK COMPATIBILITY IDEOGRAPH-2F8E8;Lo;0;L;6942;;;;N;;;;; 2F8E9;CJK COMPATIBILITY IDEOGRAPH-2F8E9;Lo;0;L;69A3;;;;N;;;;; 2F8EA;CJK COMPATIBILITY IDEOGRAPH-2F8EA;Lo;0;L;69EA;;;;N;;;;; 2F8EB;CJK COMPATIBILITY IDEOGRAPH-2F8EB;Lo;0;L;6AA8;;;;N;;;;; 2F8EC;CJK COMPATIBILITY IDEOGRAPH-2F8EC;Lo;0;L;236A3;;;;N;;;;; 2F8ED;CJK COMPATIBILITY IDEOGRAPH-2F8ED;Lo;0;L;6ADB;;;;N;;;;; 2F8EE;CJK COMPATIBILITY IDEOGRAPH-2F8EE;Lo;0;L;3C18;;;;N;;;;; 2F8EF;CJK COMPATIBILITY IDEOGRAPH-2F8EF;Lo;0;L;6B21;;;;N;;;;; 2F8F0;CJK COMPATIBILITY IDEOGRAPH-2F8F0;Lo;0;L;238A7;;;;N;;;;; 2F8F1;CJK COMPATIBILITY IDEOGRAPH-2F8F1;Lo;0;L;6B54;;;;N;;;;; 2F8F2;CJK COMPATIBILITY IDEOGRAPH-2F8F2;Lo;0;L;3C4E;;;;N;;;;; 2F8F3;CJK COMPATIBILITY IDEOGRAPH-2F8F3;Lo;0;L;6B72;;;;N;;;;; 2F8F4;CJK COMPATIBILITY IDEOGRAPH-2F8F4;Lo;0;L;6B9F;;;;N;;;;; 2F8F5;CJK COMPATIBILITY IDEOGRAPH-2F8F5;Lo;0;L;6BBA;;;;N;;;;; 2F8F6;CJK COMPATIBILITY IDEOGRAPH-2F8F6;Lo;0;L;6BBB;;;;N;;;;; 2F8F7;CJK COMPATIBILITY IDEOGRAPH-2F8F7;Lo;0;L;23A8D;;;;N;;;;; 2F8F8;CJK COMPATIBILITY IDEOGRAPH-2F8F8;Lo;0;L;21D0B;;;;N;;;;; 2F8F9;CJK COMPATIBILITY IDEOGRAPH-2F8F9;Lo;0;L;23AFA;;;;N;;;;; 2F8FA;CJK COMPATIBILITY IDEOGRAPH-2F8FA;Lo;0;L;6C4E;;;;N;;;;; 2F8FB;CJK COMPATIBILITY IDEOGRAPH-2F8FB;Lo;0;L;23CBC;;;;N;;;;; 2F8FC;CJK COMPATIBILITY IDEOGRAPH-2F8FC;Lo;0;L;6CBF;;;;N;;;;; 2F8FD;CJK COMPATIBILITY IDEOGRAPH-2F8FD;Lo;0;L;6CCD;;;;N;;;;; 2F8FE;CJK COMPATIBILITY IDEOGRAPH-2F8FE;Lo;0;L;6C67;;;;N;;;;; 2F8FF;CJK COMPATIBILITY IDEOGRAPH-2F8FF;Lo;0;L;6D16;;;;N;;;;; 2F900;CJK COMPATIBILITY IDEOGRAPH-2F900;Lo;0;L;6D3E;;;;N;;;;; 2F901;CJK COMPATIBILITY IDEOGRAPH-2F901;Lo;0;L;6D77;;;;N;;;;; 2F902;CJK COMPATIBILITY IDEOGRAPH-2F902;Lo;0;L;6D41;;;;N;;;;; 2F903;CJK COMPATIBILITY IDEOGRAPH-2F903;Lo;0;L;6D69;;;;N;;;;; 2F904;CJK COMPATIBILITY IDEOGRAPH-2F904;Lo;0;L;6D78;;;;N;;;;; 2F905;CJK COMPATIBILITY IDEOGRAPH-2F905;Lo;0;L;6D85;;;;N;;;;; 2F906;CJK COMPATIBILITY IDEOGRAPH-2F906;Lo;0;L;23D1E;;;;N;;;;; 2F907;CJK COMPATIBILITY IDEOGRAPH-2F907;Lo;0;L;6D34;;;;N;;;;; 2F908;CJK COMPATIBILITY IDEOGRAPH-2F908;Lo;0;L;6E2F;;;;N;;;;; 2F909;CJK COMPATIBILITY IDEOGRAPH-2F909;Lo;0;L;6E6E;;;;N;;;;; 2F90A;CJK COMPATIBILITY IDEOGRAPH-2F90A;Lo;0;L;3D33;;;;N;;;;; 2F90B;CJK COMPATIBILITY IDEOGRAPH-2F90B;Lo;0;L;6ECB;;;;N;;;;; 2F90C;CJK COMPATIBILITY IDEOGRAPH-2F90C;Lo;0;L;6EC7;;;;N;;;;; 2F90D;CJK COMPATIBILITY IDEOGRAPH-2F90D;Lo;0;L;23ED1;;;;N;;;;; 2F90E;CJK COMPATIBILITY IDEOGRAPH-2F90E;Lo;0;L;6DF9;;;;N;;;;; 2F90F;CJK COMPATIBILITY IDEOGRAPH-2F90F;Lo;0;L;6F6E;;;;N;;;;; 2F910;CJK COMPATIBILITY IDEOGRAPH-2F910;Lo;0;L;23F5E;;;;N;;;;; 2F911;CJK COMPATIBILITY IDEOGRAPH-2F911;Lo;0;L;23F8E;;;;N;;;;; 2F912;CJK COMPATIBILITY IDEOGRAPH-2F912;Lo;0;L;6FC6;;;;N;;;;; 2F913;CJK COMPATIBILITY IDEOGRAPH-2F913;Lo;0;L;7039;;;;N;;;;; 2F914;CJK COMPATIBILITY IDEOGRAPH-2F914;Lo;0;L;701E;;;;N;;;;; 2F915;CJK COMPATIBILITY IDEOGRAPH-2F915;Lo;0;L;701B;;;;N;;;;; 2F916;CJK COMPATIBILITY IDEOGRAPH-2F916;Lo;0;L;3D96;;;;N;;;;; 2F917;CJK COMPATIBILITY IDEOGRAPH-2F917;Lo;0;L;704A;;;;N;;;;; 2F918;CJK COMPATIBILITY IDEOGRAPH-2F918;Lo;0;L;707D;;;;N;;;;; 2F919;CJK COMPATIBILITY IDEOGRAPH-2F919;Lo;0;L;7077;;;;N;;;;; 2F91A;CJK COMPATIBILITY IDEOGRAPH-2F91A;Lo;0;L;70AD;;;;N;;;;; 2F91B;CJK COMPATIBILITY IDEOGRAPH-2F91B;Lo;0;L;20525;;;;N;;;;; 2F91C;CJK COMPATIBILITY IDEOGRAPH-2F91C;Lo;0;L;7145;;;;N;;;;; 2F91D;CJK COMPATIBILITY IDEOGRAPH-2F91D;Lo;0;L;24263;;;;N;;;;; 2F91E;CJK COMPATIBILITY IDEOGRAPH-2F91E;Lo;0;L;719C;;;;N;;;;; 2F91F;CJK COMPATIBILITY IDEOGRAPH-2F91F;Lo;0;L;243AB;;;;N;;;;; 2F920;CJK COMPATIBILITY IDEOGRAPH-2F920;Lo;0;L;7228;;;;N;;;;; 2F921;CJK COMPATIBILITY IDEOGRAPH-2F921;Lo;0;L;7235;;;;N;;;;; 2F922;CJK COMPATIBILITY IDEOGRAPH-2F922;Lo;0;L;7250;;;;N;;;;; 2F923;CJK COMPATIBILITY IDEOGRAPH-2F923;Lo;0;L;24608;;;;N;;;;; 2F924;CJK COMPATIBILITY IDEOGRAPH-2F924;Lo;0;L;7280;;;;N;;;;; 2F925;CJK COMPATIBILITY IDEOGRAPH-2F925;Lo;0;L;7295;;;;N;;;;; 2F926;CJK COMPATIBILITY IDEOGRAPH-2F926;Lo;0;L;24735;;;;N;;;;; 2F927;CJK COMPATIBILITY IDEOGRAPH-2F927;Lo;0;L;24814;;;;N;;;;; 2F928;CJK COMPATIBILITY IDEOGRAPH-2F928;Lo;0;L;737A;;;;N;;;;; 2F929;CJK COMPATIBILITY IDEOGRAPH-2F929;Lo;0;L;738B;;;;N;;;;; 2F92A;CJK COMPATIBILITY IDEOGRAPH-2F92A;Lo;0;L;3EAC;;;;N;;;;; 2F92B;CJK COMPATIBILITY IDEOGRAPH-2F92B;Lo;0;L;73A5;;;;N;;;;; 2F92C;CJK COMPATIBILITY IDEOGRAPH-2F92C;Lo;0;L;3EB8;;;;N;;;;; 2F92D;CJK COMPATIBILITY IDEOGRAPH-2F92D;Lo;0;L;3EB8;;;;N;;;;; 2F92E;CJK COMPATIBILITY IDEOGRAPH-2F92E;Lo;0;L;7447;;;;N;;;;; 2F92F;CJK COMPATIBILITY IDEOGRAPH-2F92F;Lo;0;L;745C;;;;N;;;;; 2F930;CJK COMPATIBILITY IDEOGRAPH-2F930;Lo;0;L;7471;;;;N;;;;; 2F931;CJK COMPATIBILITY IDEOGRAPH-2F931;Lo;0;L;7485;;;;N;;;;; 2F932;CJK COMPATIBILITY IDEOGRAPH-2F932;Lo;0;L;74CA;;;;N;;;;; 2F933;CJK COMPATIBILITY IDEOGRAPH-2F933;Lo;0;L;3F1B;;;;N;;;;; 2F934;CJK COMPATIBILITY IDEOGRAPH-2F934;Lo;0;L;7524;;;;N;;;;; 2F935;CJK COMPATIBILITY IDEOGRAPH-2F935;Lo;0;L;24C36;;;;N;;;;; 2F936;CJK COMPATIBILITY IDEOGRAPH-2F936;Lo;0;L;753E;;;;N;;;;; 2F937;CJK COMPATIBILITY IDEOGRAPH-2F937;Lo;0;L;24C92;;;;N;;;;; 2F938;CJK COMPATIBILITY IDEOGRAPH-2F938;Lo;0;L;7570;;;;N;;;;; 2F939;CJK COMPATIBILITY IDEOGRAPH-2F939;Lo;0;L;2219F;;;;N;;;;; 2F93A;CJK COMPATIBILITY IDEOGRAPH-2F93A;Lo;0;L;7610;;;;N;;;;; 2F93B;CJK COMPATIBILITY IDEOGRAPH-2F93B;Lo;0;L;24FA1;;;;N;;;;; 2F93C;CJK COMPATIBILITY IDEOGRAPH-2F93C;Lo;0;L;24FB8;;;;N;;;;; 2F93D;CJK COMPATIBILITY IDEOGRAPH-2F93D;Lo;0;L;25044;;;;N;;;;; 2F93E;CJK COMPATIBILITY IDEOGRAPH-2F93E;Lo;0;L;3FFC;;;;N;;;;; 2F93F;CJK COMPATIBILITY IDEOGRAPH-2F93F;Lo;0;L;4008;;;;N;;;;; 2F940;CJK COMPATIBILITY IDEOGRAPH-2F940;Lo;0;L;76F4;;;;N;;;;; 2F941;CJK COMPATIBILITY IDEOGRAPH-2F941;Lo;0;L;250F3;;;;N;;;;; 2F942;CJK COMPATIBILITY IDEOGRAPH-2F942;Lo;0;L;250F2;;;;N;;;;; 2F943;CJK COMPATIBILITY IDEOGRAPH-2F943;Lo;0;L;25119;;;;N;;;;; 2F944;CJK COMPATIBILITY IDEOGRAPH-2F944;Lo;0;L;25133;;;;N;;;;; 2F945;CJK COMPATIBILITY IDEOGRAPH-2F945;Lo;0;L;771E;;;;N;;;;; 2F946;CJK COMPATIBILITY IDEOGRAPH-2F946;Lo;0;L;771F;;;;N;;;;; 2F947;CJK COMPATIBILITY IDEOGRAPH-2F947;Lo;0;L;771F;;;;N;;;;; 2F948;CJK COMPATIBILITY IDEOGRAPH-2F948;Lo;0;L;774A;;;;N;;;;; 2F949;CJK COMPATIBILITY IDEOGRAPH-2F949;Lo;0;L;4039;;;;N;;;;; 2F94A;CJK COMPATIBILITY IDEOGRAPH-2F94A;Lo;0;L;778B;;;;N;;;;; 2F94B;CJK COMPATIBILITY IDEOGRAPH-2F94B;Lo;0;L;4046;;;;N;;;;; 2F94C;CJK COMPATIBILITY IDEOGRAPH-2F94C;Lo;0;L;4096;;;;N;;;;; 2F94D;CJK COMPATIBILITY IDEOGRAPH-2F94D;Lo;0;L;2541D;;;;N;;;;; 2F94E;CJK COMPATIBILITY IDEOGRAPH-2F94E;Lo;0;L;784E;;;;N;;;;; 2F94F;CJK COMPATIBILITY IDEOGRAPH-2F94F;Lo;0;L;788C;;;;N;;;;; 2F950;CJK COMPATIBILITY IDEOGRAPH-2F950;Lo;0;L;78CC;;;;N;;;;; 2F951;CJK COMPATIBILITY IDEOGRAPH-2F951;Lo;0;L;40E3;;;;N;;;;; 2F952;CJK COMPATIBILITY IDEOGRAPH-2F952;Lo;0;L;25626;;;;N;;;;; 2F953;CJK COMPATIBILITY IDEOGRAPH-2F953;Lo;0;L;7956;;;;N;;;;; 2F954;CJK COMPATIBILITY IDEOGRAPH-2F954;Lo;0;L;2569A;;;;N;;;;; 2F955;CJK COMPATIBILITY IDEOGRAPH-2F955;Lo;0;L;256C5;;;;N;;;;; 2F956;CJK COMPATIBILITY IDEOGRAPH-2F956;Lo;0;L;798F;;;;N;;;;; 2F957;CJK COMPATIBILITY IDEOGRAPH-2F957;Lo;0;L;79EB;;;;N;;;;; 2F958;CJK COMPATIBILITY IDEOGRAPH-2F958;Lo;0;L;412F;;;;N;;;;; 2F959;CJK COMPATIBILITY IDEOGRAPH-2F959;Lo;0;L;7A40;;;;N;;;;; 2F95A;CJK COMPATIBILITY IDEOGRAPH-2F95A;Lo;0;L;7A4A;;;;N;;;;; 2F95B;CJK COMPATIBILITY IDEOGRAPH-2F95B;Lo;0;L;7A4F;;;;N;;;;; 2F95C;CJK COMPATIBILITY IDEOGRAPH-2F95C;Lo;0;L;2597C;;;;N;;;;; 2F95D;CJK COMPATIBILITY IDEOGRAPH-2F95D;Lo;0;L;25AA7;;;;N;;;;; 2F95E;CJK COMPATIBILITY IDEOGRAPH-2F95E;Lo;0;L;25AA7;;;;N;;;;; 2F95F;CJK COMPATIBILITY IDEOGRAPH-2F95F;Lo;0;L;7AEE;;;;N;;;;; 2F960;CJK COMPATIBILITY IDEOGRAPH-2F960;Lo;0;L;4202;;;;N;;;;; 2F961;CJK COMPATIBILITY IDEOGRAPH-2F961;Lo;0;L;25BAB;;;;N;;;;; 2F962;CJK COMPATIBILITY IDEOGRAPH-2F962;Lo;0;L;7BC6;;;;N;;;;; 2F963;CJK COMPATIBILITY IDEOGRAPH-2F963;Lo;0;L;7BC9;;;;N;;;;; 2F964;CJK COMPATIBILITY IDEOGRAPH-2F964;Lo;0;L;4227;;;;N;;;;; 2F965;CJK COMPATIBILITY IDEOGRAPH-2F965;Lo;0;L;25C80;;;;N;;;;; 2F966;CJK COMPATIBILITY IDEOGRAPH-2F966;Lo;0;L;7CD2;;;;N;;;;; 2F967;CJK COMPATIBILITY IDEOGRAPH-2F967;Lo;0;L;42A0;;;;N;;;;; 2F968;CJK COMPATIBILITY IDEOGRAPH-2F968;Lo;0;L;7CE8;;;;N;;;;; 2F969;CJK COMPATIBILITY IDEOGRAPH-2F969;Lo;0;L;7CE3;;;;N;;;;; 2F96A;CJK COMPATIBILITY IDEOGRAPH-2F96A;Lo;0;L;7D00;;;;N;;;;; 2F96B;CJK COMPATIBILITY IDEOGRAPH-2F96B;Lo;0;L;25F86;;;;N;;;;; 2F96C;CJK COMPATIBILITY IDEOGRAPH-2F96C;Lo;0;L;7D63;;;;N;;;;; 2F96D;CJK COMPATIBILITY IDEOGRAPH-2F96D;Lo;0;L;4301;;;;N;;;;; 2F96E;CJK COMPATIBILITY IDEOGRAPH-2F96E;Lo;0;L;7DC7;;;;N;;;;; 2F96F;CJK COMPATIBILITY IDEOGRAPH-2F96F;Lo;0;L;7E02;;;;N;;;;; 2F970;CJK COMPATIBILITY IDEOGRAPH-2F970;Lo;0;L;7E45;;;;N;;;;; 2F971;CJK COMPATIBILITY IDEOGRAPH-2F971;Lo;0;L;4334;;;;N;;;;; 2F972;CJK COMPATIBILITY IDEOGRAPH-2F972;Lo;0;L;26228;;;;N;;;;; 2F973;CJK COMPATIBILITY IDEOGRAPH-2F973;Lo;0;L;26247;;;;N;;;;; 2F974;CJK COMPATIBILITY IDEOGRAPH-2F974;Lo;0;L;4359;;;;N;;;;; 2F975;CJK COMPATIBILITY IDEOGRAPH-2F975;Lo;0;L;262D9;;;;N;;;;; 2F976;CJK COMPATIBILITY IDEOGRAPH-2F976;Lo;0;L;7F7A;;;;N;;;;; 2F977;CJK COMPATIBILITY IDEOGRAPH-2F977;Lo;0;L;2633E;;;;N;;;;; 2F978;CJK COMPATIBILITY IDEOGRAPH-2F978;Lo;0;L;7F95;;;;N;;;;; 2F979;CJK COMPATIBILITY IDEOGRAPH-2F979;Lo;0;L;7FFA;;;;N;;;;; 2F97A;CJK COMPATIBILITY IDEOGRAPH-2F97A;Lo;0;L;8005;;;;N;;;;; 2F97B;CJK COMPATIBILITY IDEOGRAPH-2F97B;Lo;0;L;264DA;;;;N;;;;; 2F97C;CJK COMPATIBILITY IDEOGRAPH-2F97C;Lo;0;L;26523;;;;N;;;;; 2F97D;CJK COMPATIBILITY IDEOGRAPH-2F97D;Lo;0;L;8060;;;;N;;;;; 2F97E;CJK COMPATIBILITY IDEOGRAPH-2F97E;Lo;0;L;265A8;;;;N;;;;; 2F97F;CJK COMPATIBILITY IDEOGRAPH-2F97F;Lo;0;L;8070;;;;N;;;;; 2F980;CJK COMPATIBILITY IDEOGRAPH-2F980;Lo;0;L;2335F;;;;N;;;;; 2F981;CJK COMPATIBILITY IDEOGRAPH-2F981;Lo;0;L;43D5;;;;N;;;;; 2F982;CJK COMPATIBILITY IDEOGRAPH-2F982;Lo;0;L;80B2;;;;N;;;;; 2F983;CJK COMPATIBILITY IDEOGRAPH-2F983;Lo;0;L;8103;;;;N;;;;; 2F984;CJK COMPATIBILITY IDEOGRAPH-2F984;Lo;0;L;440B;;;;N;;;;; 2F985;CJK COMPATIBILITY IDEOGRAPH-2F985;Lo;0;L;813E;;;;N;;;;; 2F986;CJK COMPATIBILITY IDEOGRAPH-2F986;Lo;0;L;5AB5;;;;N;;;;; 2F987;CJK COMPATIBILITY IDEOGRAPH-2F987;Lo;0;L;267A7;;;;N;;;;; 2F988;CJK COMPATIBILITY IDEOGRAPH-2F988;Lo;0;L;267B5;;;;N;;;;; 2F989;CJK COMPATIBILITY IDEOGRAPH-2F989;Lo;0;L;23393;;;;N;;;;; 2F98A;CJK COMPATIBILITY IDEOGRAPH-2F98A;Lo;0;L;2339C;;;;N;;;;; 2F98B;CJK COMPATIBILITY IDEOGRAPH-2F98B;Lo;0;L;8201;;;;N;;;;; 2F98C;CJK COMPATIBILITY IDEOGRAPH-2F98C;Lo;0;L;8204;;;;N;;;;; 2F98D;CJK COMPATIBILITY IDEOGRAPH-2F98D;Lo;0;L;8F9E;;;;N;;;;; 2F98E;CJK COMPATIBILITY IDEOGRAPH-2F98E;Lo;0;L;446B;;;;N;;;;; 2F98F;CJK COMPATIBILITY IDEOGRAPH-2F98F;Lo;0;L;8291;;;;N;;;;; 2F990;CJK COMPATIBILITY IDEOGRAPH-2F990;Lo;0;L;828B;;;;N;;;;; 2F991;CJK COMPATIBILITY IDEOGRAPH-2F991;Lo;0;L;829D;;;;N;;;;; 2F992;CJK COMPATIBILITY IDEOGRAPH-2F992;Lo;0;L;52B3;;;;N;;;;; 2F993;CJK COMPATIBILITY IDEOGRAPH-2F993;Lo;0;L;82B1;;;;N;;;;; 2F994;CJK COMPATIBILITY IDEOGRAPH-2F994;Lo;0;L;82B3;;;;N;;;;; 2F995;CJK COMPATIBILITY IDEOGRAPH-2F995;Lo;0;L;82BD;;;;N;;;;; 2F996;CJK COMPATIBILITY IDEOGRAPH-2F996;Lo;0;L;82E6;;;;N;;;;; 2F997;CJK COMPATIBILITY IDEOGRAPH-2F997;Lo;0;L;26B3C;;;;N;;;;; 2F998;CJK COMPATIBILITY IDEOGRAPH-2F998;Lo;0;L;82E5;;;;N;;;;; 2F999;CJK COMPATIBILITY IDEOGRAPH-2F999;Lo;0;L;831D;;;;N;;;;; 2F99A;CJK COMPATIBILITY IDEOGRAPH-2F99A;Lo;0;L;8363;;;;N;;;;; 2F99B;CJK COMPATIBILITY IDEOGRAPH-2F99B;Lo;0;L;83AD;;;;N;;;;; 2F99C;CJK COMPATIBILITY IDEOGRAPH-2F99C;Lo;0;L;8323;;;;N;;;;; 2F99D;CJK COMPATIBILITY IDEOGRAPH-2F99D;Lo;0;L;83BD;;;;N;;;;; 2F99E;CJK COMPATIBILITY IDEOGRAPH-2F99E;Lo;0;L;83E7;;;;N;;;;; 2F99F;CJK COMPATIBILITY IDEOGRAPH-2F99F;Lo;0;L;8457;;;;N;;;;; 2F9A0;CJK COMPATIBILITY IDEOGRAPH-2F9A0;Lo;0;L;8353;;;;N;;;;; 2F9A1;CJK COMPATIBILITY IDEOGRAPH-2F9A1;Lo;0;L;83CA;;;;N;;;;; 2F9A2;CJK COMPATIBILITY IDEOGRAPH-2F9A2;Lo;0;L;83CC;;;;N;;;;; 2F9A3;CJK COMPATIBILITY IDEOGRAPH-2F9A3;Lo;0;L;83DC;;;;N;;;;; 2F9A4;CJK COMPATIBILITY IDEOGRAPH-2F9A4;Lo;0;L;26C36;;;;N;;;;; 2F9A5;CJK COMPATIBILITY IDEOGRAPH-2F9A5;Lo;0;L;26D6B;;;;N;;;;; 2F9A6;CJK COMPATIBILITY IDEOGRAPH-2F9A6;Lo;0;L;26CD5;;;;N;;;;; 2F9A7;CJK COMPATIBILITY IDEOGRAPH-2F9A7;Lo;0;L;452B;;;;N;;;;; 2F9A8;CJK COMPATIBILITY IDEOGRAPH-2F9A8;Lo;0;L;84F1;;;;N;;;;; 2F9A9;CJK COMPATIBILITY IDEOGRAPH-2F9A9;Lo;0;L;84F3;;;;N;;;;; 2F9AA;CJK COMPATIBILITY IDEOGRAPH-2F9AA;Lo;0;L;8516;;;;N;;;;; 2F9AB;CJK COMPATIBILITY IDEOGRAPH-2F9AB;Lo;0;L;273CA;;;;N;;;;; 2F9AC;CJK COMPATIBILITY IDEOGRAPH-2F9AC;Lo;0;L;8564;;;;N;;;;; 2F9AD;CJK COMPATIBILITY IDEOGRAPH-2F9AD;Lo;0;L;26F2C;;;;N;;;;; 2F9AE;CJK COMPATIBILITY IDEOGRAPH-2F9AE;Lo;0;L;455D;;;;N;;;;; 2F9AF;CJK COMPATIBILITY IDEOGRAPH-2F9AF;Lo;0;L;4561;;;;N;;;;; 2F9B0;CJK COMPATIBILITY IDEOGRAPH-2F9B0;Lo;0;L;26FB1;;;;N;;;;; 2F9B1;CJK COMPATIBILITY IDEOGRAPH-2F9B1;Lo;0;L;270D2;;;;N;;;;; 2F9B2;CJK COMPATIBILITY IDEOGRAPH-2F9B2;Lo;0;L;456B;;;;N;;;;; 2F9B3;CJK COMPATIBILITY IDEOGRAPH-2F9B3;Lo;0;L;8650;;;;N;;;;; 2F9B4;CJK COMPATIBILITY IDEOGRAPH-2F9B4;Lo;0;L;865C;;;;N;;;;; 2F9B5;CJK COMPATIBILITY IDEOGRAPH-2F9B5;Lo;0;L;8667;;;;N;;;;; 2F9B6;CJK COMPATIBILITY IDEOGRAPH-2F9B6;Lo;0;L;8669;;;;N;;;;; 2F9B7;CJK COMPATIBILITY IDEOGRAPH-2F9B7;Lo;0;L;86A9;;;;N;;;;; 2F9B8;CJK COMPATIBILITY IDEOGRAPH-2F9B8;Lo;0;L;8688;;;;N;;;;; 2F9B9;CJK COMPATIBILITY IDEOGRAPH-2F9B9;Lo;0;L;870E;;;;N;;;;; 2F9BA;CJK COMPATIBILITY IDEOGRAPH-2F9BA;Lo;0;L;86E2;;;;N;;;;; 2F9BB;CJK COMPATIBILITY IDEOGRAPH-2F9BB;Lo;0;L;8779;;;;N;;;;; 2F9BC;CJK COMPATIBILITY IDEOGRAPH-2F9BC;Lo;0;L;8728;;;;N;;;;; 2F9BD;CJK COMPATIBILITY IDEOGRAPH-2F9BD;Lo;0;L;876B;;;;N;;;;; 2F9BE;CJK COMPATIBILITY IDEOGRAPH-2F9BE;Lo;0;L;8786;;;;N;;;;; 2F9BF;CJK COMPATIBILITY IDEOGRAPH-2F9BF;Lo;0;L;45D7;;;;N;;;;; 2F9C0;CJK COMPATIBILITY IDEOGRAPH-2F9C0;Lo;0;L;87E1;;;;N;;;;; 2F9C1;CJK COMPATIBILITY IDEOGRAPH-2F9C1;Lo;0;L;8801;;;;N;;;;; 2F9C2;CJK COMPATIBILITY IDEOGRAPH-2F9C2;Lo;0;L;45F9;;;;N;;;;; 2F9C3;CJK COMPATIBILITY IDEOGRAPH-2F9C3;Lo;0;L;8860;;;;N;;;;; 2F9C4;CJK COMPATIBILITY IDEOGRAPH-2F9C4;Lo;0;L;8863;;;;N;;;;; 2F9C5;CJK COMPATIBILITY IDEOGRAPH-2F9C5;Lo;0;L;27667;;;;N;;;;; 2F9C6;CJK COMPATIBILITY IDEOGRAPH-2F9C6;Lo;0;L;88D7;;;;N;;;;; 2F9C7;CJK COMPATIBILITY IDEOGRAPH-2F9C7;Lo;0;L;88DE;;;;N;;;;; 2F9C8;CJK COMPATIBILITY IDEOGRAPH-2F9C8;Lo;0;L;4635;;;;N;;;;; 2F9C9;CJK COMPATIBILITY IDEOGRAPH-2F9C9;Lo;0;L;88FA;;;;N;;;;; 2F9CA;CJK COMPATIBILITY IDEOGRAPH-2F9CA;Lo;0;L;34BB;;;;N;;;;; 2F9CB;CJK COMPATIBILITY IDEOGRAPH-2F9CB;Lo;0;L;278AE;;;;N;;;;; 2F9CC;CJK COMPATIBILITY IDEOGRAPH-2F9CC;Lo;0;L;27966;;;;N;;;;; 2F9CD;CJK COMPATIBILITY IDEOGRAPH-2F9CD;Lo;0;L;46BE;;;;N;;;;; 2F9CE;CJK COMPATIBILITY IDEOGRAPH-2F9CE;Lo;0;L;46C7;;;;N;;;;; 2F9CF;CJK COMPATIBILITY IDEOGRAPH-2F9CF;Lo;0;L;8AA0;;;;N;;;;; 2F9D0;CJK COMPATIBILITY IDEOGRAPH-2F9D0;Lo;0;L;8AED;;;;N;;;;; 2F9D1;CJK COMPATIBILITY IDEOGRAPH-2F9D1;Lo;0;L;8B8A;;;;N;;;;; 2F9D2;CJK COMPATIBILITY IDEOGRAPH-2F9D2;Lo;0;L;8C55;;;;N;;;;; 2F9D3;CJK COMPATIBILITY IDEOGRAPH-2F9D3;Lo;0;L;27CA8;;;;N;;;;; 2F9D4;CJK COMPATIBILITY IDEOGRAPH-2F9D4;Lo;0;L;8CAB;;;;N;;;;; 2F9D5;CJK COMPATIBILITY IDEOGRAPH-2F9D5;Lo;0;L;8CC1;;;;N;;;;; 2F9D6;CJK COMPATIBILITY IDEOGRAPH-2F9D6;Lo;0;L;8D1B;;;;N;;;;; 2F9D7;CJK COMPATIBILITY IDEOGRAPH-2F9D7;Lo;0;L;8D77;;;;N;;;;; 2F9D8;CJK COMPATIBILITY IDEOGRAPH-2F9D8;Lo;0;L;27F2F;;;;N;;;;; 2F9D9;CJK COMPATIBILITY IDEOGRAPH-2F9D9;Lo;0;L;20804;;;;N;;;;; 2F9DA;CJK COMPATIBILITY IDEOGRAPH-2F9DA;Lo;0;L;8DCB;;;;N;;;;; 2F9DB;CJK COMPATIBILITY IDEOGRAPH-2F9DB;Lo;0;L;8DBC;;;;N;;;;; 2F9DC;CJK COMPATIBILITY IDEOGRAPH-2F9DC;Lo;0;L;8DF0;;;;N;;;;; 2F9DD;CJK COMPATIBILITY IDEOGRAPH-2F9DD;Lo;0;L;208DE;;;;N;;;;; 2F9DE;CJK COMPATIBILITY IDEOGRAPH-2F9DE;Lo;0;L;8ED4;;;;N;;;;; 2F9DF;CJK COMPATIBILITY IDEOGRAPH-2F9DF;Lo;0;L;8F38;;;;N;;;;; 2F9E0;CJK COMPATIBILITY IDEOGRAPH-2F9E0;Lo;0;L;285D2;;;;N;;;;; 2F9E1;CJK COMPATIBILITY IDEOGRAPH-2F9E1;Lo;0;L;285ED;;;;N;;;;; 2F9E2;CJK COMPATIBILITY IDEOGRAPH-2F9E2;Lo;0;L;9094;;;;N;;;;; 2F9E3;CJK COMPATIBILITY IDEOGRAPH-2F9E3;Lo;0;L;90F1;;;;N;;;;; 2F9E4;CJK COMPATIBILITY IDEOGRAPH-2F9E4;Lo;0;L;9111;;;;N;;;;; 2F9E5;CJK COMPATIBILITY IDEOGRAPH-2F9E5;Lo;0;L;2872E;;;;N;;;;; 2F9E6;CJK COMPATIBILITY IDEOGRAPH-2F9E6;Lo;0;L;911B;;;;N;;;;; 2F9E7;CJK COMPATIBILITY IDEOGRAPH-2F9E7;Lo;0;L;9238;;;;N;;;;; 2F9E8;CJK COMPATIBILITY IDEOGRAPH-2F9E8;Lo;0;L;92D7;;;;N;;;;; 2F9E9;CJK COMPATIBILITY IDEOGRAPH-2F9E9;Lo;0;L;92D8;;;;N;;;;; 2F9EA;CJK COMPATIBILITY IDEOGRAPH-2F9EA;Lo;0;L;927C;;;;N;;;;; 2F9EB;CJK COMPATIBILITY IDEOGRAPH-2F9EB;Lo;0;L;93F9;;;;N;;;;; 2F9EC;CJK COMPATIBILITY IDEOGRAPH-2F9EC;Lo;0;L;9415;;;;N;;;;; 2F9ED;CJK COMPATIBILITY IDEOGRAPH-2F9ED;Lo;0;L;28BFA;;;;N;;;;; 2F9EE;CJK COMPATIBILITY IDEOGRAPH-2F9EE;Lo;0;L;958B;;;;N;;;;; 2F9EF;CJK COMPATIBILITY IDEOGRAPH-2F9EF;Lo;0;L;4995;;;;N;;;;; 2F9F0;CJK COMPATIBILITY IDEOGRAPH-2F9F0;Lo;0;L;95B7;;;;N;;;;; 2F9F1;CJK COMPATIBILITY IDEOGRAPH-2F9F1;Lo;0;L;28D77;;;;N;;;;; 2F9F2;CJK COMPATIBILITY IDEOGRAPH-2F9F2;Lo;0;L;49E6;;;;N;;;;; 2F9F3;CJK COMPATIBILITY IDEOGRAPH-2F9F3;Lo;0;L;96C3;;;;N;;;;; 2F9F4;CJK COMPATIBILITY IDEOGRAPH-2F9F4;Lo;0;L;5DB2;;;;N;;;;; 2F9F5;CJK COMPATIBILITY IDEOGRAPH-2F9F5;Lo;0;L;9723;;;;N;;;;; 2F9F6;CJK COMPATIBILITY IDEOGRAPH-2F9F6;Lo;0;L;29145;;;;N;;;;; 2F9F7;CJK COMPATIBILITY IDEOGRAPH-2F9F7;Lo;0;L;2921A;;;;N;;;;; 2F9F8;CJK COMPATIBILITY IDEOGRAPH-2F9F8;Lo;0;L;4A6E;;;;N;;;;; 2F9F9;CJK COMPATIBILITY IDEOGRAPH-2F9F9;Lo;0;L;4A76;;;;N;;;;; 2F9FA;CJK COMPATIBILITY IDEOGRAPH-2F9FA;Lo;0;L;97E0;;;;N;;;;; 2F9FB;CJK COMPATIBILITY IDEOGRAPH-2F9FB;Lo;0;L;2940A;;;;N;;;;; 2F9FC;CJK COMPATIBILITY IDEOGRAPH-2F9FC;Lo;0;L;4AB2;;;;N;;;;; 2F9FD;CJK COMPATIBILITY IDEOGRAPH-2F9FD;Lo;0;L;29496;;;;N;;;;; 2F9FE;CJK COMPATIBILITY IDEOGRAPH-2F9FE;Lo;0;L;980B;;;;N;;;;; 2F9FF;CJK COMPATIBILITY IDEOGRAPH-2F9FF;Lo;0;L;980B;;;;N;;;;; 2FA00;CJK COMPATIBILITY IDEOGRAPH-2FA00;Lo;0;L;9829;;;;N;;;;; 2FA01;CJK COMPATIBILITY IDEOGRAPH-2FA01;Lo;0;L;295B6;;;;N;;;;; 2FA02;CJK COMPATIBILITY IDEOGRAPH-2FA02;Lo;0;L;98E2;;;;N;;;;; 2FA03;CJK COMPATIBILITY IDEOGRAPH-2FA03;Lo;0;L;4B33;;;;N;;;;; 2FA04;CJK COMPATIBILITY IDEOGRAPH-2FA04;Lo;0;L;9929;;;;N;;;;; 2FA05;CJK COMPATIBILITY IDEOGRAPH-2FA05;Lo;0;L;99A7;;;;N;;;;; 2FA06;CJK COMPATIBILITY IDEOGRAPH-2FA06;Lo;0;L;99C2;;;;N;;;;; 2FA07;CJK COMPATIBILITY IDEOGRAPH-2FA07;Lo;0;L;99FE;;;;N;;;;; 2FA08;CJK COMPATIBILITY IDEOGRAPH-2FA08;Lo;0;L;4BCE;;;;N;;;;; 2FA09;CJK COMPATIBILITY IDEOGRAPH-2FA09;Lo;0;L;29B30;;;;N;;;;; 2FA0A;CJK COMPATIBILITY IDEOGRAPH-2FA0A;Lo;0;L;9B12;;;;N;;;;; 2FA0B;CJK COMPATIBILITY IDEOGRAPH-2FA0B;Lo;0;L;9C40;;;;N;;;;; 2FA0C;CJK COMPATIBILITY IDEOGRAPH-2FA0C;Lo;0;L;9CFD;;;;N;;;;; 2FA0D;CJK COMPATIBILITY IDEOGRAPH-2FA0D;Lo;0;L;4CCE;;;;N;;;;; 2FA0E;CJK COMPATIBILITY IDEOGRAPH-2FA0E;Lo;0;L;4CED;;;;N;;;;; 2FA0F;CJK COMPATIBILITY IDEOGRAPH-2FA0F;Lo;0;L;9D67;;;;N;;;;; 2FA10;CJK COMPATIBILITY IDEOGRAPH-2FA10;Lo;0;L;2A0CE;;;;N;;;;; 2FA11;CJK COMPATIBILITY IDEOGRAPH-2FA11;Lo;0;L;4CF8;;;;N;;;;; 2FA12;CJK COMPATIBILITY IDEOGRAPH-2FA12;Lo;0;L;2A105;;;;N;;;;; 2FA13;CJK COMPATIBILITY IDEOGRAPH-2FA13;Lo;0;L;2A20E;;;;N;;;;; 2FA14;CJK COMPATIBILITY IDEOGRAPH-2FA14;Lo;0;L;2A291;;;;N;;;;; 2FA15;CJK COMPATIBILITY IDEOGRAPH-2FA15;Lo;0;L;9EBB;;;;N;;;;; 2FA16;CJK COMPATIBILITY IDEOGRAPH-2FA16;Lo;0;L;4D56;;;;N;;;;; 2FA17;CJK COMPATIBILITY IDEOGRAPH-2FA17;Lo;0;L;9EF9;;;;N;;;;; 2FA18;CJK COMPATIBILITY IDEOGRAPH-2FA18;Lo;0;L;9EFE;;;;N;;;;; 2FA19;CJK COMPATIBILITY IDEOGRAPH-2FA19;Lo;0;L;9F05;;;;N;;;;; 2FA1A;CJK COMPATIBILITY IDEOGRAPH-2FA1A;Lo;0;L;9F0F;;;;N;;;;; 2FA1B;CJK COMPATIBILITY IDEOGRAPH-2FA1B;Lo;0;L;9F16;;;;N;;;;; 2FA1C;CJK COMPATIBILITY IDEOGRAPH-2FA1C;Lo;0;L;9F3B;;;;N;;;;; 2FA1D;CJK COMPATIBILITY IDEOGRAPH-2FA1D;Lo;0;L;2A600;;;;N;;;;; E0001;LANGUAGE TAG;Cf;0;BN;;;;;N;;;;; E0020;TAG SPACE;Cf;0;BN;;;;;N;;;;; E0021;TAG EXCLAMATION MARK;Cf;0;BN;;;;;N;;;;; E0022;TAG QUOTATION MARK;Cf;0;BN;;;;;N;;;;; E0023;TAG NUMBER SIGN;Cf;0;BN;;;;;N;;;;; E0024;TAG DOLLAR SIGN;Cf;0;BN;;;;;N;;;;; E0025;TAG PERCENT SIGN;Cf;0;BN;;;;;N;;;;; E0026;TAG AMPERSAND;Cf;0;BN;;;;;N;;;;; E0027;TAG APOSTROPHE;Cf;0;BN;;;;;N;;;;; E0028;TAG LEFT PARENTHESIS;Cf;0;BN;;;;;N;;;;; E0029;TAG RIGHT PARENTHESIS;Cf;0;BN;;;;;N;;;;; E002A;TAG ASTERISK;Cf;0;BN;;;;;N;;;;; E002B;TAG PLUS SIGN;Cf;0;BN;;;;;N;;;;; E002C;TAG COMMA;Cf;0;BN;;;;;N;;;;; E002D;TAG HYPHEN-MINUS;Cf;0;BN;;;;;N;;;;; E002E;TAG FULL STOP;Cf;0;BN;;;;;N;;;;; E002F;TAG SOLIDUS;Cf;0;BN;;;;;N;;;;; E0030;TAG DIGIT ZERO;Cf;0;BN;;;;;N;;;;; E0031;TAG DIGIT ONE;Cf;0;BN;;;;;N;;;;; E0032;TAG DIGIT TWO;Cf;0;BN;;;;;N;;;;; E0033;TAG DIGIT THREE;Cf;0;BN;;;;;N;;;;; E0034;TAG DIGIT FOUR;Cf;0;BN;;;;;N;;;;; E0035;TAG DIGIT FIVE;Cf;0;BN;;;;;N;;;;; E0036;TAG DIGIT SIX;Cf;0;BN;;;;;N;;;;; E0037;TAG DIGIT SEVEN;Cf;0;BN;;;;;N;;;;; E0038;TAG DIGIT EIGHT;Cf;0;BN;;;;;N;;;;; E0039;TAG DIGIT NINE;Cf;0;BN;;;;;N;;;;; E003A;TAG COLON;Cf;0;BN;;;;;N;;;;; E003B;TAG SEMICOLON;Cf;0;BN;;;;;N;;;;; E003C;TAG LESS-THAN SIGN;Cf;0;BN;;;;;N;;;;; E003D;TAG EQUALS SIGN;Cf;0;BN;;;;;N;;;;; E003E;TAG GREATER-THAN SIGN;Cf;0;BN;;;;;N;;;;; E003F;TAG QUESTION MARK;Cf;0;BN;;;;;N;;;;; E0040;TAG COMMERCIAL AT;Cf;0;BN;;;;;N;;;;; E0041;TAG LATIN CAPITAL LETTER A;Cf;0;BN;;;;;N;;;;; E0042;TAG LATIN CAPITAL LETTER B;Cf;0;BN;;;;;N;;;;; E0043;TAG LATIN CAPITAL LETTER C;Cf;0;BN;;;;;N;;;;; E0044;TAG LATIN CAPITAL LETTER D;Cf;0;BN;;;;;N;;;;; E0045;TAG LATIN CAPITAL LETTER E;Cf;0;BN;;;;;N;;;;; E0046;TAG LATIN CAPITAL LETTER F;Cf;0;BN;;;;;N;;;;; E0047;TAG LATIN CAPITAL LETTER G;Cf;0;BN;;;;;N;;;;; E0048;TAG LATIN CAPITAL LETTER H;Cf;0;BN;;;;;N;;;;; E0049;TAG LATIN CAPITAL LETTER I;Cf;0;BN;;;;;N;;;;; E004A;TAG LATIN CAPITAL LETTER J;Cf;0;BN;;;;;N;;;;; E004B;TAG LATIN CAPITAL LETTER K;Cf;0;BN;;;;;N;;;;; E004C;TAG LATIN CAPITAL LETTER L;Cf;0;BN;;;;;N;;;;; E004D;TAG LATIN CAPITAL LETTER M;Cf;0;BN;;;;;N;;;;; E004E;TAG LATIN CAPITAL LETTER N;Cf;0;BN;;;;;N;;;;; E004F;TAG LATIN CAPITAL LETTER O;Cf;0;BN;;;;;N;;;;; E0050;TAG LATIN CAPITAL LETTER P;Cf;0;BN;;;;;N;;;;; E0051;TAG LATIN CAPITAL LETTER Q;Cf;0;BN;;;;;N;;;;; E0052;TAG LATIN CAPITAL LETTER R;Cf;0;BN;;;;;N;;;;; E0053;TAG LATIN CAPITAL LETTER S;Cf;0;BN;;;;;N;;;;; E0054;TAG LATIN CAPITAL LETTER T;Cf;0;BN;;;;;N;;;;; E0055;TAG LATIN CAPITAL LETTER U;Cf;0;BN;;;;;N;;;;; E0056;TAG LATIN CAPITAL LETTER V;Cf;0;BN;;;;;N;;;;; E0057;TAG LATIN CAPITAL LETTER W;Cf;0;BN;;;;;N;;;;; E0058;TAG LATIN CAPITAL LETTER X;Cf;0;BN;;;;;N;;;;; E0059;TAG LATIN CAPITAL LETTER Y;Cf;0;BN;;;;;N;;;;; E005A;TAG LATIN CAPITAL LETTER Z;Cf;0;BN;;;;;N;;;;; E005B;TAG LEFT SQUARE BRACKET;Cf;0;BN;;;;;N;;;;; E005C;TAG REVERSE SOLIDUS;Cf;0;BN;;;;;N;;;;; E005D;TAG RIGHT SQUARE BRACKET;Cf;0;BN;;;;;N;;;;; E005E;TAG CIRCUMFLEX ACCENT;Cf;0;BN;;;;;N;;;;; E005F;TAG LOW LINE;Cf;0;BN;;;;;N;;;;; E0060;TAG GRAVE ACCENT;Cf;0;BN;;;;;N;;;;; E0061;TAG LATIN SMALL LETTER A;Cf;0;BN;;;;;N;;;;; E0062;TAG LATIN SMALL LETTER B;Cf;0;BN;;;;;N;;;;; E0063;TAG LATIN SMALL LETTER C;Cf;0;BN;;;;;N;;;;; E0064;TAG LATIN SMALL LETTER D;Cf;0;BN;;;;;N;;;;; E0065;TAG LATIN SMALL LETTER E;Cf;0;BN;;;;;N;;;;; E0066;TAG LATIN SMALL LETTER F;Cf;0;BN;;;;;N;;;;; E0067;TAG LATIN SMALL LETTER G;Cf;0;BN;;;;;N;;;;; E0068;TAG LATIN SMALL LETTER H;Cf;0;BN;;;;;N;;;;; E0069;TAG LATIN SMALL LETTER I;Cf;0;BN;;;;;N;;;;; E006A;TAG LATIN SMALL LETTER J;Cf;0;BN;;;;;N;;;;; E006B;TAG LATIN SMALL LETTER K;Cf;0;BN;;;;;N;;;;; E006C;TAG LATIN SMALL LETTER L;Cf;0;BN;;;;;N;;;;; E006D;TAG LATIN SMALL LETTER M;Cf;0;BN;;;;;N;;;;; E006E;TAG LATIN SMALL LETTER N;Cf;0;BN;;;;;N;;;;; E006F;TAG LATIN SMALL LETTER O;Cf;0;BN;;;;;N;;;;; E0070;TAG LATIN SMALL LETTER P;Cf;0;BN;;;;;N;;;;; E0071;TAG LATIN SMALL LETTER Q;Cf;0;BN;;;;;N;;;;; E0072;TAG LATIN SMALL LETTER R;Cf;0;BN;;;;;N;;;;; E0073;TAG LATIN SMALL LETTER S;Cf;0;BN;;;;;N;;;;; E0074;TAG LATIN SMALL LETTER T;Cf;0;BN;;;;;N;;;;; E0075;TAG LATIN SMALL LETTER U;Cf;0;BN;;;;;N;;;;; E0076;TAG LATIN SMALL LETTER V;Cf;0;BN;;;;;N;;;;; E0077;TAG LATIN SMALL LETTER W;Cf;0;BN;;;;;N;;;;; E0078;TAG LATIN SMALL LETTER X;Cf;0;BN;;;;;N;;;;; E0079;TAG LATIN SMALL LETTER Y;Cf;0;BN;;;;;N;;;;; E007A;TAG LATIN SMALL LETTER Z;Cf;0;BN;;;;;N;;;;; E007B;TAG LEFT CURLY BRACKET;Cf;0;BN;;;;;N;;;;; E007C;TAG VERTICAL LINE;Cf;0;BN;;;;;N;;;;; E007D;TAG RIGHT CURLY BRACKET;Cf;0;BN;;;;;N;;;;; E007E;TAG TILDE;Cf;0;BN;;;;;N;;;;; E007F;CANCEL TAG;Cf;0;BN;;;;;N;;;;; E0100;VARIATION SELECTOR-17;Mn;0;NSM;;;;;N;;;;; E0101;VARIATION SELECTOR-18;Mn;0;NSM;;;;;N;;;;; E0102;VARIATION SELECTOR-19;Mn;0;NSM;;;;;N;;;;; E0103;VARIATION SELECTOR-20;Mn;0;NSM;;;;;N;;;;; E0104;VARIATION SELECTOR-21;Mn;0;NSM;;;;;N;;;;; E0105;VARIATION SELECTOR-22;Mn;0;NSM;;;;;N;;;;; E0106;VARIATION SELECTOR-23;Mn;0;NSM;;;;;N;;;;; E0107;VARIATION SELECTOR-24;Mn;0;NSM;;;;;N;;;;; E0108;VARIATION SELECTOR-25;Mn;0;NSM;;;;;N;;;;; E0109;VARIATION SELECTOR-26;Mn;0;NSM;;;;;N;;;;; E010A;VARIATION SELECTOR-27;Mn;0;NSM;;;;;N;;;;; E010B;VARIATION SELECTOR-28;Mn;0;NSM;;;;;N;;;;; E010C;VARIATION SELECTOR-29;Mn;0;NSM;;;;;N;;;;; E010D;VARIATION SELECTOR-30;Mn;0;NSM;;;;;N;;;;; E010E;VARIATION SELECTOR-31;Mn;0;NSM;;;;;N;;;;; E010F;VARIATION SELECTOR-32;Mn;0;NSM;;;;;N;;;;; E0110;VARIATION SELECTOR-33;Mn;0;NSM;;;;;N;;;;; E0111;VARIATION SELECTOR-34;Mn;0;NSM;;;;;N;;;;; E0112;VARIATION SELECTOR-35;Mn;0;NSM;;;;;N;;;;; E0113;VARIATION SELECTOR-36;Mn;0;NSM;;;;;N;;;;; E0114;VARIATION SELECTOR-37;Mn;0;NSM;;;;;N;;;;; E0115;VARIATION SELECTOR-38;Mn;0;NSM;;;;;N;;;;; E0116;VARIATION SELECTOR-39;Mn;0;NSM;;;;;N;;;;; E0117;VARIATION SELECTOR-40;Mn;0;NSM;;;;;N;;;;; E0118;VARIATION SELECTOR-41;Mn;0;NSM;;;;;N;;;;; E0119;VARIATION SELECTOR-42;Mn;0;NSM;;;;;N;;;;; E011A;VARIATION SELECTOR-43;Mn;0;NSM;;;;;N;;;;; E011B;VARIATION SELECTOR-44;Mn;0;NSM;;;;;N;;;;; E011C;VARIATION SELECTOR-45;Mn;0;NSM;;;;;N;;;;; E011D;VARIATION SELECTOR-46;Mn;0;NSM;;;;;N;;;;; E011E;VARIATION SELECTOR-47;Mn;0;NSM;;;;;N;;;;; E011F;VARIATION SELECTOR-48;Mn;0;NSM;;;;;N;;;;; E0120;VARIATION SELECTOR-49;Mn;0;NSM;;;;;N;;;;; E0121;VARIATION SELECTOR-50;Mn;0;NSM;;;;;N;;;;; E0122;VARIATION SELECTOR-51;Mn;0;NSM;;;;;N;;;;; E0123;VARIATION SELECTOR-52;Mn;0;NSM;;;;;N;;;;; E0124;VARIATION SELECTOR-53;Mn;0;NSM;;;;;N;;;;; E0125;VARIATION SELECTOR-54;Mn;0;NSM;;;;;N;;;;; E0126;VARIATION SELECTOR-55;Mn;0;NSM;;;;;N;;;;; E0127;VARIATION SELECTOR-56;Mn;0;NSM;;;;;N;;;;; E0128;VARIATION SELECTOR-57;Mn;0;NSM;;;;;N;;;;; E0129;VARIATION SELECTOR-58;Mn;0;NSM;;;;;N;;;;; E012A;VARIATION SELECTOR-59;Mn;0;NSM;;;;;N;;;;; E012B;VARIATION SELECTOR-60;Mn;0;NSM;;;;;N;;;;; E012C;VARIATION SELECTOR-61;Mn;0;NSM;;;;;N;;;;; E012D;VARIATION SELECTOR-62;Mn;0;NSM;;;;;N;;;;; E012E;VARIATION SELECTOR-63;Mn;0;NSM;;;;;N;;;;; E012F;VARIATION SELECTOR-64;Mn;0;NSM;;;;;N;;;;; E0130;VARIATION SELECTOR-65;Mn;0;NSM;;;;;N;;;;; E0131;VARIATION SELECTOR-66;Mn;0;NSM;;;;;N;;;;; E0132;VARIATION SELECTOR-67;Mn;0;NSM;;;;;N;;;;; E0133;VARIATION SELECTOR-68;Mn;0;NSM;;;;;N;;;;; E0134;VARIATION SELECTOR-69;Mn;0;NSM;;;;;N;;;;; E0135;VARIATION SELECTOR-70;Mn;0;NSM;;;;;N;;;;; E0136;VARIATION SELECTOR-71;Mn;0;NSM;;;;;N;;;;; E0137;VARIATION SELECTOR-72;Mn;0;NSM;;;;;N;;;;; E0138;VARIATION SELECTOR-73;Mn;0;NSM;;;;;N;;;;; E0139;VARIATION SELECTOR-74;Mn;0;NSM;;;;;N;;;;; E013A;VARIATION SELECTOR-75;Mn;0;NSM;;;;;N;;;;; E013B;VARIATION SELECTOR-76;Mn;0;NSM;;;;;N;;;;; E013C;VARIATION SELECTOR-77;Mn;0;NSM;;;;;N;;;;; E013D;VARIATION SELECTOR-78;Mn;0;NSM;;;;;N;;;;; E013E;VARIATION SELECTOR-79;Mn;0;NSM;;;;;N;;;;; E013F;VARIATION SELECTOR-80;Mn;0;NSM;;;;;N;;;;; E0140;VARIATION SELECTOR-81;Mn;0;NSM;;;;;N;;;;; E0141;VARIATION SELECTOR-82;Mn;0;NSM;;;;;N;;;;; E0142;VARIATION SELECTOR-83;Mn;0;NSM;;;;;N;;;;; E0143;VARIATION SELECTOR-84;Mn;0;NSM;;;;;N;;;;; E0144;VARIATION SELECTOR-85;Mn;0;NSM;;;;;N;;;;; E0145;VARIATION SELECTOR-86;Mn;0;NSM;;;;;N;;;;; E0146;VARIATION SELECTOR-87;Mn;0;NSM;;;;;N;;;;; E0147;VARIATION SELECTOR-88;Mn;0;NSM;;;;;N;;;;; E0148;VARIATION SELECTOR-89;Mn;0;NSM;;;;;N;;;;; E0149;VARIATION SELECTOR-90;Mn;0;NSM;;;;;N;;;;; E014A;VARIATION SELECTOR-91;Mn;0;NSM;;;;;N;;;;; E014B;VARIATION SELECTOR-92;Mn;0;NSM;;;;;N;;;;; E014C;VARIATION SELECTOR-93;Mn;0;NSM;;;;;N;;;;; E014D;VARIATION SELECTOR-94;Mn;0;NSM;;;;;N;;;;; E014E;VARIATION SELECTOR-95;Mn;0;NSM;;;;;N;;;;; E014F;VARIATION SELECTOR-96;Mn;0;NSM;;;;;N;;;;; E0150;VARIATION SELECTOR-97;Mn;0;NSM;;;;;N;;;;; E0151;VARIATION SELECTOR-98;Mn;0;NSM;;;;;N;;;;; E0152;VARIATION SELECTOR-99;Mn;0;NSM;;;;;N;;;;; E0153;VARIATION SELECTOR-100;Mn;0;NSM;;;;;N;;;;; E0154;VARIATION SELECTOR-101;Mn;0;NSM;;;;;N;;;;; E0155;VARIATION SELECTOR-102;Mn;0;NSM;;;;;N;;;;; E0156;VARIATION SELECTOR-103;Mn;0;NSM;;;;;N;;;;; E0157;VARIATION SELECTOR-104;Mn;0;NSM;;;;;N;;;;; E0158;VARIATION SELECTOR-105;Mn;0;NSM;;;;;N;;;;; E0159;VARIATION SELECTOR-106;Mn;0;NSM;;;;;N;;;;; E015A;VARIATION SELECTOR-107;Mn;0;NSM;;;;;N;;;;; E015B;VARIATION SELECTOR-108;Mn;0;NSM;;;;;N;;;;; E015C;VARIATION SELECTOR-109;Mn;0;NSM;;;;;N;;;;; E015D;VARIATION SELECTOR-110;Mn;0;NSM;;;;;N;;;;; E015E;VARIATION SELECTOR-111;Mn;0;NSM;;;;;N;;;;; E015F;VARIATION SELECTOR-112;Mn;0;NSM;;;;;N;;;;; E0160;VARIATION SELECTOR-113;Mn;0;NSM;;;;;N;;;;; E0161;VARIATION SELECTOR-114;Mn;0;NSM;;;;;N;;;;; E0162;VARIATION SELECTOR-115;Mn;0;NSM;;;;;N;;;;; E0163;VARIATION SELECTOR-116;Mn;0;NSM;;;;;N;;;;; E0164;VARIATION SELECTOR-117;Mn;0;NSM;;;;;N;;;;; E0165;VARIATION SELECTOR-118;Mn;0;NSM;;;;;N;;;;; E0166;VARIATION SELECTOR-119;Mn;0;NSM;;;;;N;;;;; E0167;VARIATION SELECTOR-120;Mn;0;NSM;;;;;N;;;;; E0168;VARIATION SELECTOR-121;Mn;0;NSM;;;;;N;;;;; E0169;VARIATION SELECTOR-122;Mn;0;NSM;;;;;N;;;;; E016A;VARIATION SELECTOR-123;Mn;0;NSM;;;;;N;;;;; E016B;VARIATION SELECTOR-124;Mn;0;NSM;;;;;N;;;;; E016C;VARIATION SELECTOR-125;Mn;0;NSM;;;;;N;;;;; E016D;VARIATION SELECTOR-126;Mn;0;NSM;;;;;N;;;;; E016E;VARIATION SELECTOR-127;Mn;0;NSM;;;;;N;;;;; E016F;VARIATION SELECTOR-128;Mn;0;NSM;;;;;N;;;;; E0170;VARIATION SELECTOR-129;Mn;0;NSM;;;;;N;;;;; E0171;VARIATION SELECTOR-130;Mn;0;NSM;;;;;N;;;;; E0172;VARIATION SELECTOR-131;Mn;0;NSM;;;;;N;;;;; E0173;VARIATION SELECTOR-132;Mn;0;NSM;;;;;N;;;;; E0174;VARIATION SELECTOR-133;Mn;0;NSM;;;;;N;;;;; E0175;VARIATION SELECTOR-134;Mn;0;NSM;;;;;N;;;;; E0176;VARIATION SELECTOR-135;Mn;0;NSM;;;;;N;;;;; E0177;VARIATION SELECTOR-136;Mn;0;NSM;;;;;N;;;;; E0178;VARIATION SELECTOR-137;Mn;0;NSM;;;;;N;;;;; E0179;VARIATION SELECTOR-138;Mn;0;NSM;;;;;N;;;;; E017A;VARIATION SELECTOR-139;Mn;0;NSM;;;;;N;;;;; E017B;VARIATION SELECTOR-140;Mn;0;NSM;;;;;N;;;;; E017C;VARIATION SELECTOR-141;Mn;0;NSM;;;;;N;;;;; E017D;VARIATION SELECTOR-142;Mn;0;NSM;;;;;N;;;;; E017E;VARIATION SELECTOR-143;Mn;0;NSM;;;;;N;;;;; E017F;VARIATION SELECTOR-144;Mn;0;NSM;;;;;N;;;;; E0180;VARIATION SELECTOR-145;Mn;0;NSM;;;;;N;;;;; E0181;VARIATION SELECTOR-146;Mn;0;NSM;;;;;N;;;;; E0182;VARIATION SELECTOR-147;Mn;0;NSM;;;;;N;;;;; E0183;VARIATION SELECTOR-148;Mn;0;NSM;;;;;N;;;;; E0184;VARIATION SELECTOR-149;Mn;0;NSM;;;;;N;;;;; E0185;VARIATION SELECTOR-150;Mn;0;NSM;;;;;N;;;;; E0186;VARIATION SELECTOR-151;Mn;0;NSM;;;;;N;;;;; E0187;VARIATION SELECTOR-152;Mn;0;NSM;;;;;N;;;;; E0188;VARIATION SELECTOR-153;Mn;0;NSM;;;;;N;;;;; E0189;VARIATION SELECTOR-154;Mn;0;NSM;;;;;N;;;;; E018A;VARIATION SELECTOR-155;Mn;0;NSM;;;;;N;;;;; E018B;VARIATION SELECTOR-156;Mn;0;NSM;;;;;N;;;;; E018C;VARIATION SELECTOR-157;Mn;0;NSM;;;;;N;;;;; E018D;VARIATION SELECTOR-158;Mn;0;NSM;;;;;N;;;;; E018E;VARIATION SELECTOR-159;Mn;0;NSM;;;;;N;;;;; E018F;VARIATION SELECTOR-160;Mn;0;NSM;;;;;N;;;;; E0190;VARIATION SELECTOR-161;Mn;0;NSM;;;;;N;;;;; E0191;VARIATION SELECTOR-162;Mn;0;NSM;;;;;N;;;;; E0192;VARIATION SELECTOR-163;Mn;0;NSM;;;;;N;;;;; E0193;VARIATION SELECTOR-164;Mn;0;NSM;;;;;N;;;;; E0194;VARIATION SELECTOR-165;Mn;0;NSM;;;;;N;;;;; E0195;VARIATION SELECTOR-166;Mn;0;NSM;;;;;N;;;;; E0196;VARIATION SELECTOR-167;Mn;0;NSM;;;;;N;;;;; E0197;VARIATION SELECTOR-168;Mn;0;NSM;;;;;N;;;;; E0198;VARIATION SELECTOR-169;Mn;0;NSM;;;;;N;;;;; E0199;VARIATION SELECTOR-170;Mn;0;NSM;;;;;N;;;;; E019A;VARIATION SELECTOR-171;Mn;0;NSM;;;;;N;;;;; E019B;VARIATION SELECTOR-172;Mn;0;NSM;;;;;N;;;;; E019C;VARIATION SELECTOR-173;Mn;0;NSM;;;;;N;;;;; E019D;VARIATION SELECTOR-174;Mn;0;NSM;;;;;N;;;;; E019E;VARIATION SELECTOR-175;Mn;0;NSM;;;;;N;;;;; E019F;VARIATION SELECTOR-176;Mn;0;NSM;;;;;N;;;;; E01A0;VARIATION SELECTOR-177;Mn;0;NSM;;;;;N;;;;; E01A1;VARIATION SELECTOR-178;Mn;0;NSM;;;;;N;;;;; E01A2;VARIATION SELECTOR-179;Mn;0;NSM;;;;;N;;;;; E01A3;VARIATION SELECTOR-180;Mn;0;NSM;;;;;N;;;;; E01A4;VARIATION SELECTOR-181;Mn;0;NSM;;;;;N;;;;; E01A5;VARIATION SELECTOR-182;Mn;0;NSM;;;;;N;;;;; E01A6;VARIATION SELECTOR-183;Mn;0;NSM;;;;;N;;;;; E01A7;VARIATION SELECTOR-184;Mn;0;NSM;;;;;N;;;;; E01A8;VARIATION SELECTOR-185;Mn;0;NSM;;;;;N;;;;; E01A9;VARIATION SELECTOR-186;Mn;0;NSM;;;;;N;;;;; E01AA;VARIATION SELECTOR-187;Mn;0;NSM;;;;;N;;;;; E01AB;VARIATION SELECTOR-188;Mn;0;NSM;;;;;N;;;;; E01AC;VARIATION SELECTOR-189;Mn;0;NSM;;;;;N;;;;; E01AD;VARIATION SELECTOR-190;Mn;0;NSM;;;;;N;;;;; E01AE;VARIATION SELECTOR-191;Mn;0;NSM;;;;;N;;;;; E01AF;VARIATION SELECTOR-192;Mn;0;NSM;;;;;N;;;;; E01B0;VARIATION SELECTOR-193;Mn;0;NSM;;;;;N;;;;; E01B1;VARIATION SELECTOR-194;Mn;0;NSM;;;;;N;;;;; E01B2;VARIATION SELECTOR-195;Mn;0;NSM;;;;;N;;;;; E01B3;VARIATION SELECTOR-196;Mn;0;NSM;;;;;N;;;;; E01B4;VARIATION SELECTOR-197;Mn;0;NSM;;;;;N;;;;; E01B5;VARIATION SELECTOR-198;Mn;0;NSM;;;;;N;;;;; E01B6;VARIATION SELECTOR-199;Mn;0;NSM;;;;;N;;;;; E01B7;VARIATION SELECTOR-200;Mn;0;NSM;;;;;N;;;;; E01B8;VARIATION SELECTOR-201;Mn;0;NSM;;;;;N;;;;; E01B9;VARIATION SELECTOR-202;Mn;0;NSM;;;;;N;;;;; E01BA;VARIATION SELECTOR-203;Mn;0;NSM;;;;;N;;;;; E01BB;VARIATION SELECTOR-204;Mn;0;NSM;;;;;N;;;;; E01BC;VARIATION SELECTOR-205;Mn;0;NSM;;;;;N;;;;; E01BD;VARIATION SELECTOR-206;Mn;0;NSM;;;;;N;;;;; E01BE;VARIATION SELECTOR-207;Mn;0;NSM;;;;;N;;;;; E01BF;VARIATION SELECTOR-208;Mn;0;NSM;;;;;N;;;;; E01C0;VARIATION SELECTOR-209;Mn;0;NSM;;;;;N;;;;; E01C1;VARIATION SELECTOR-210;Mn;0;NSM;;;;;N;;;;; E01C2;VARIATION SELECTOR-211;Mn;0;NSM;;;;;N;;;;; E01C3;VARIATION SELECTOR-212;Mn;0;NSM;;;;;N;;;;; E01C4;VARIATION SELECTOR-213;Mn;0;NSM;;;;;N;;;;; E01C5;VARIATION SELECTOR-214;Mn;0;NSM;;;;;N;;;;; E01C6;VARIATION SELECTOR-215;Mn;0;NSM;;;;;N;;;;; E01C7;VARIATION SELECTOR-216;Mn;0;NSM;;;;;N;;;;; E01C8;VARIATION SELECTOR-217;Mn;0;NSM;;;;;N;;;;; E01C9;VARIATION SELECTOR-218;Mn;0;NSM;;;;;N;;;;; E01CA;VARIATION SELECTOR-219;Mn;0;NSM;;;;;N;;;;; E01CB;VARIATION SELECTOR-220;Mn;0;NSM;;;;;N;;;;; E01CC;VARIATION SELECTOR-221;Mn;0;NSM;;;;;N;;;;; E01CD;VARIATION SELECTOR-222;Mn;0;NSM;;;;;N;;;;; E01CE;VARIATION SELECTOR-223;Mn;0;NSM;;;;;N;;;;; E01CF;VARIATION SELECTOR-224;Mn;0;NSM;;;;;N;;;;; E01D0;VARIATION SELECTOR-225;Mn;0;NSM;;;;;N;;;;; E01D1;VARIATION SELECTOR-226;Mn;0;NSM;;;;;N;;;;; E01D2;VARIATION SELECTOR-227;Mn;0;NSM;;;;;N;;;;; E01D3;VARIATION SELECTOR-228;Mn;0;NSM;;;;;N;;;;; E01D4;VARIATION SELECTOR-229;Mn;0;NSM;;;;;N;;;;; E01D5;VARIATION SELECTOR-230;Mn;0;NSM;;;;;N;;;;; E01D6;VARIATION SELECTOR-231;Mn;0;NSM;;;;;N;;;;; E01D7;VARIATION SELECTOR-232;Mn;0;NSM;;;;;N;;;;; E01D8;VARIATION SELECTOR-233;Mn;0;NSM;;;;;N;;;;; E01D9;VARIATION SELECTOR-234;Mn;0;NSM;;;;;N;;;;; E01DA;VARIATION SELECTOR-235;Mn;0;NSM;;;;;N;;;;; E01DB;VARIATION SELECTOR-236;Mn;0;NSM;;;;;N;;;;; E01DC;VARIATION SELECTOR-237;Mn;0;NSM;;;;;N;;;;; E01DD;VARIATION SELECTOR-238;Mn;0;NSM;;;;;N;;;;; E01DE;VARIATION SELECTOR-239;Mn;0;NSM;;;;;N;;;;; E01DF;VARIATION SELECTOR-240;Mn;0;NSM;;;;;N;;;;; E01E0;VARIATION SELECTOR-241;Mn;0;NSM;;;;;N;;;;; E01E1;VARIATION SELECTOR-242;Mn;0;NSM;;;;;N;;;;; E01E2;VARIATION SELECTOR-243;Mn;0;NSM;;;;;N;;;;; E01E3;VARIATION SELECTOR-244;Mn;0;NSM;;;;;N;;;;; E01E4;VARIATION SELECTOR-245;Mn;0;NSM;;;;;N;;;;; E01E5;VARIATION SELECTOR-246;Mn;0;NSM;;;;;N;;;;; E01E6;VARIATION SELECTOR-247;Mn;0;NSM;;;;;N;;;;; E01E7;VARIATION SELECTOR-248;Mn;0;NSM;;;;;N;;;;; E01E8;VARIATION SELECTOR-249;Mn;0;NSM;;;;;N;;;;; E01E9;VARIATION SELECTOR-250;Mn;0;NSM;;;;;N;;;;; E01EA;VARIATION SELECTOR-251;Mn;0;NSM;;;;;N;;;;; E01EB;VARIATION SELECTOR-252;Mn;0;NSM;;;;;N;;;;; E01EC;VARIATION SELECTOR-253;Mn;0;NSM;;;;;N;;;;; E01ED;VARIATION SELECTOR-254;Mn;0;NSM;;;;;N;;;;; E01EE;VARIATION SELECTOR-255;Mn;0;NSM;;;;;N;;;;; E01EF;VARIATION SELECTOR-256;Mn;0;NSM;;;;;N;;;;; F0000;;Co;0;L;;;;;N;;;;; FFFFD;;Co;0;L;;;;;N;;;;; 100000;;Co;0;L;;;;;N;;;;; 10FFFD;;Co;0;L;;;;;N;;;;; ================================================ FILE: v2/testdata/_sqlite/ext/fts3/unicode/mkunicode.tcl ================================================ source [file join [file dirname [info script]] parseunicode.tcl] proc print_rd {map} { global tl_lookup_table set aChar [list] set lRange [list] set nRange 1 set iFirst [lindex $map 0 0] set cPrev [lindex $map 0 1] foreach m [lrange $map 1 end] { foreach {i c} $m {} if {$cPrev == $c} { for {set j [expr $iFirst+$nRange]} {$j<$i} {incr j} { if {[info exists tl_lookup_table($j)]==0} break } if {$j==$i} { set nNew [expr {(1 + $i - $iFirst)}] if {$nNew<=8} { set nRange $nNew continue } } } lappend lRange [list $iFirst $nRange] lappend aChar $cPrev set iFirst $i set cPrev $c set nRange 1 } lappend lRange [list $iFirst $nRange] lappend aChar $cPrev puts "/*" puts "** If the argument is a codepoint corresponding to a lowercase letter" puts "** in the ASCII range with a diacritic added, return the codepoint" puts "** of the ASCII letter only. For example, if passed 235 - \"LATIN" puts "** SMALL LETTER E WITH DIAERESIS\" - return 65 (\"LATIN SMALL LETTER" puts "** E\"). The resuls of passing a codepoint that corresponds to an" puts "** uppercase letter are undefined." puts "*/" puts "static int ${::remove_diacritic}(int c)\{" puts " unsigned short aDia\[\] = \{" puts -nonewline " 0, " set i 1 foreach r $lRange { foreach {iCode nRange} $r {} if {($i % 8)==0} {puts "" ; puts -nonewline " " } incr i puts -nonewline [format "%5d" [expr ($iCode<<3) + $nRange-1]] puts -nonewline ", " } puts "" puts " \};" puts " char aChar\[\] = \{" puts -nonewline " '\\0', " set i 1 foreach c $aChar { set str "'$c', " if {$c == ""} { set str "'\\0', " } if {($i % 12)==0} {puts "" ; puts -nonewline " " } incr i puts -nonewline "$str" } puts "" puts " \};" puts { unsigned int key = (((unsigned int)c)<<3) | 0x00000007; int iRes = 0; int iHi = sizeof(aDia)/sizeof(aDia[0]) - 1; int iLo = 0; while( iHi>=iLo ){ int iTest = (iHi + iLo) / 2; if( key >= aDia[iTest] ){ iRes = iTest; iLo = iTest+1; }else{ iHi = iTest-1; } } assert( key>=aDia[iRes] ); return ((c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : (int)aChar[iRes]);} puts "\}" } proc print_isdiacritic {zFunc map} { set lCode [list] foreach m $map { foreach {code char} $m {} if {$code && $char == ""} { lappend lCode $code } } set lCode [lsort -integer $lCode] set iFirst [lindex $lCode 0] set iLast [lindex $lCode end] set i1 0 set i2 0 foreach c $lCode { set i [expr $c - $iFirst] if {$i < 32} { set i1 [expr {$i1 | (1<<$i)}] } else { set i2 [expr {$i2 | (1<<($i-32))}] } } puts "/*" puts "** Return true if the argument interpreted as a unicode codepoint" puts "** is a diacritical modifier character." puts "*/" puts "int ${zFunc}\(int c)\{" puts " unsigned int mask0 = [format "0x%08X" $i1];" puts " unsigned int mask1 = [format "0x%08X" $i2];" puts " if( c<$iFirst || c>$iLast ) return 0;" puts " return (c < $iFirst+32) ?" puts " (mask0 & (1 << (c-$iFirst))) :" puts " (mask1 & (1 << (c-$iFirst-32)));" puts "\}" } #------------------------------------------------------------------------- proc an_load_separator_ranges {} { global unicodedata.txt set lSep [an_load_unicodedata_text ${unicodedata.txt}] unset -nocomplain iFirst unset -nocomplain nRange set lRange [list] foreach sep $lSep { if {0==[info exists iFirst]} { set iFirst $sep set nRange 1 } elseif { $sep == ($iFirst+$nRange) } { incr nRange } else { lappend lRange [list $iFirst $nRange] set iFirst $sep set nRange 1 } } lappend lRange [list $iFirst $nRange] set lRange } proc an_print_range_array {lRange} { set iFirstMax 0 set nRangeMax 0 foreach range $lRange { foreach {iFirst nRange} $range {} if {$iFirst > $iFirstMax} {set iFirstMax $iFirst} if {$nRange > $nRangeMax} {set nRangeMax $nRange} } if {$iFirstMax >= (1<<22)} {error "first-max is too large for format"} if {$nRangeMax >= (1<<10)} {error "range-max is too large for format"} puts -nonewline " " puts [string trim { /* Each unsigned integer in the following array corresponds to a contiguous ** range of unicode codepoints that are not either letters or numbers (i.e. ** codepoints for which this function should return 0). ** ** The most significant 22 bits in each 32-bit value contain the first ** codepoint in the range. The least significant 10 bits are used to store ** the size of the range (always at least 1). In other words, the value ** ((C<<22) + N) represents a range of N codepoints starting with codepoint ** C. It is not possible to represent a range larger than 1023 codepoints ** using this format. */ }] puts -nonewline " static const unsigned int aEntry\[\] = \{" set i 0 foreach range $lRange { foreach {iFirst nRange} $range {} set u32 [format "0x%08X" [expr ($iFirst<<10) + $nRange]] if {($i % 5)==0} {puts "" ; puts -nonewline " "} puts -nonewline " $u32," incr i } puts "" puts " \};" } proc an_print_ascii_bitmap {lRange} { foreach range $lRange { foreach {iFirst nRange} $range {} for {set i $iFirst} {$i < ($iFirst+$nRange)} {incr i} { if {$i<=127} { set a($i) 1 } } } set aAscii [list 0 0 0 0] foreach key [array names a] { set idx [expr $key >> 5] lset aAscii $idx [expr [lindex $aAscii $idx] | (1 << ($key&0x001F))] } puts " static const unsigned int aAscii\[4\] = \{" puts -nonewline " " foreach v $aAscii { puts -nonewline [format " 0x%08X," $v] } puts "" puts " \};" } proc print_isalnum {zFunc lRange} { puts "/*" puts "** Return true if the argument corresponds to a unicode codepoint" puts "** classified as either a letter or a number. Otherwise false." puts "**" puts "** The results are undefined if the value passed to this function" puts "** is less than zero." puts "*/" puts "int ${zFunc}\(int c)\{" an_print_range_array $lRange an_print_ascii_bitmap $lRange puts { if( (unsigned int)c<128 ){ return ( (aAscii[c >> 5] & ((unsigned int)1 << (c & 0x001F)))==0 ); }else if( (unsigned int)c<(1<<22) ){ unsigned int key = (((unsigned int)c)<<10) | 0x000003FF; int iRes = 0; int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; int iLo = 0; while( iHi>=iLo ){ int iTest = (iHi + iLo) / 2; if( key >= aEntry[iTest] ){ iRes = iTest; iLo = iTest+1; }else{ iHi = iTest-1; } } assert( aEntry[0]=aEntry[iRes] ); return (((unsigned int)c) >= ((aEntry[iRes]>>10) + (aEntry[iRes]&0x3FF))); } return 1;} puts "\}" } proc print_test_isalnum {zFunc lRange} { foreach range $lRange { foreach {iFirst nRange} $range {} for {set i $iFirst} {$i < ($iFirst+$nRange)} {incr i} { set a($i) 1 } } puts "static int isalnum_test(int *piCode)\{" puts -nonewline " unsigned char aAlnum\[\] = \{" for {set i 0} {$i < 70000} {incr i} { if {($i % 32)==0} { puts "" ; puts -nonewline " " } set bFlag [expr ![info exists a($i)]] puts -nonewline "${bFlag}," } puts "" puts " \};" puts -nonewline " int aLargeSep\[\] = \{" set i 0 foreach iSep [lsort -integer [array names a]] { if {$iSep<70000} continue if {($i % 8)==0} { puts "" ; puts -nonewline " " } puts -nonewline " $iSep," incr i } puts "" puts " \};" puts -nonewline " int aLargeOther\[\] = \{" set i 0 foreach iSep [lsort -integer [array names a]] { if {$iSep<70000} continue if {[info exists a([expr $iSep-1])]==0} { if {($i % 8)==0} { puts "" ; puts -nonewline " " } puts -nonewline " [expr $iSep-1]," incr i } if {[info exists a([expr $iSep+1])]==0} { if {($i % 8)==0} { puts "" ; puts -nonewline " " } puts -nonewline " [expr $iSep+1]," incr i } } puts "" puts " \};" puts [subst -nocommands { int i; for(i=0; i>1]) & 0xFFFF). ** ** The contents of this array are generated by parsing the CaseFolding.txt ** file distributed as part of the "Unicode Character Database". See ** http://www.unicode.org for details. */ }] puts " static const struct TableEntry \{" puts " unsigned short iCode;" puts " unsigned char flags;" puts " unsigned char nRange;" puts " \} aEntry\[\] = \{" } proc tl_print_table_entry {togglevar entry liOff} { upvar $togglevar t foreach {iFirst nIncr nRange nOff} $entry {} if {$iFirst > (1<<16)} { return 1 } if {[info exists t]==0} {set t 0} if {$t==0} { puts -nonewline " " } set flags 0 if {$nIncr==2} { set flags 1 ; set nRange [expr $nRange * 2]} if {$nOff<0} { incr nOff [expr (1<<16)] } set idx [lsearch $liOff $nOff] if {$idx<0} {error "malfunction generating aiOff"} set flags [expr $flags + $idx*2] set txt "{$iFirst, $flags, $nRange}," if {$t==2} { puts $txt } else { puts -nonewline [format "% -23s" $txt] } set t [expr ($t+1)%3] return 0 } proc tl_print_table_footer {togglevar} { upvar $togglevar t if {$t!=0} {puts ""} puts " \};" } proc tl_print_if_entry {entry} { foreach {iFirst nIncr nRange nOff} $entry {} if {$nIncr==2} {error "tl_print_if_entry needs improvement!"} puts " else if( c>=$iFirst && c<[expr $iFirst+$nRange] )\{" puts " ret = c + $nOff;" puts " \}" } proc tl_generate_ioff_table {lRecord} { foreach entry $lRecord { foreach {iFirst nIncr nRange iOff} $entry {} if {$iOff<0} { incr iOff [expr (1<<16)] } if {[info exists a($iOff)]} continue set a($iOff) 1 } set liOff [lsort -integer [array names a]] if {[llength $liOff]>128} { error "Too many distinct ioffs" } return $liOff } proc tl_print_ioff_table {liOff} { puts -nonewline " static const unsigned short aiOff\[\] = \{" set i 0 foreach off $liOff { if {($i % 8)==0} {puts "" ; puts -nonewline " "} puts -nonewline [format "% -7s" "$off,"] incr i } puts "" puts " \};" } proc print_fold {zFunc} { set lRecord [tl_create_records] set lHigh [list] puts "/*" puts "** Interpret the argument as a unicode codepoint. If the codepoint" puts "** is an upper case character that has a lower case equivalent," puts "** return the codepoint corresponding to the lower case version." puts "** Otherwise, return a copy of the argument." puts "**" puts "** The results are undefined if the value passed to this function" puts "** is less than zero." puts "*/" puts "int ${zFunc}\(int c, int bRemoveDiacritic)\{" set liOff [tl_generate_ioff_table $lRecord] tl_print_table_header foreach entry $lRecord { if {[tl_print_table_entry toggle $entry $liOff]} { lappend lHigh $entry } } tl_print_table_footer toggle tl_print_ioff_table $liOff puts [subst -nocommands { int ret = c; assert( sizeof(unsigned short)==2 && sizeof(unsigned char)==1 ); if( c<128 ){ if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); }else if( c<65536 ){ const struct TableEntry *p; int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; int iLo = 0; int iRes = -1; assert( c>aEntry[0].iCode ); while( iHi>=iLo ){ int iTest = (iHi + iLo) / 2; int cmp = (c - aEntry[iTest].iCode); if( cmp>=0 ){ iRes = iTest; iLo = iTest+1; }else{ iHi = iTest-1; } } assert( iRes>=0 && c>=aEntry[iRes].iCode ); p = &aEntry[iRes]; if( c<(p->iCode + p->nRange) && 0==(0x01 & p->flags & (p->iCode ^ c)) ){ ret = (c + (aiOff[p->flags>>1])) & 0x0000FFFF; assert( ret>0 ); } if( bRemoveDiacritic ) ret = ${::remove_diacritic}(ret); } }] foreach entry $lHigh { tl_print_if_entry $entry } puts "" puts " return ret;" puts "\}" } proc print_fold_test {zFunc mappings} { global tl_lookup_table foreach m $mappings { set c [lindex $m 1] if {$c == ""} { set extra([lindex $m 0]) 0 } else { scan $c %c i set extra([lindex $m 0]) $i } } puts "static int fold_test(int *piCode)\{" puts -nonewline " static int aLookup\[\] = \{" for {set i 0} {$i < 70000} {incr i} { set expected $i catch { set expected $tl_lookup_table($i) } set expected2 $expected catch { set expected2 $extra($expected2) } if {($i % 4)==0} { puts "" ; puts -nonewline " " } puts -nonewline "$expected, $expected2, " } puts " \};" puts " int i;" puts " for(i=0; i" puts "" } proc print_test_main {} { puts "" puts "#include " puts "" puts "int main(int argc, char **argv)\{" puts " int r1, r2;" puts " int code;" puts " r1 = isalnum_test(&code);" puts " if( r1 ) printf(\"isalnum(): Problem with code %d\\n\",code);" puts " else printf(\"isalnum(): test passed\\n\");" puts " r2 = fold_test(&code);" puts " if( r2 ) printf(\"fold(): Problem with code %d\\n\",code);" puts " else printf(\"fold(): test passed\\n\");" puts " return (r1 || r2);" puts "\}" } # Proces the command line arguments. Exit early if they are not to # our liking. # proc usage {} { puts -nonewline stderr "Usage: $::argv0 ?-test? ?-fts5? " puts stderr " " exit 1 } if {[llength $argv]<2} usage set unicodedata.txt [lindex $argv end] set casefolding.txt [lindex $argv end-1] set remove_diacritic remove_diacritic set generate_test_code 0 set generate_fts5_code 0 set function_prefix "sqlite3Fts" for {set i 0} {$i < [llength $argv]-2} {incr i} { switch -- [lindex $argv $i] { -test { set generate_test_code 1 } -fts5 { set function_prefix sqlite3Fts5 set generate_fts5_code 1 set remove_diacritic fts5_remove_diacritic } default { usage } } } print_fileheader # Print the isalnum() function to stdout. # set lRange [an_load_separator_ranges] print_isalnum ${function_prefix}UnicodeIsalnum $lRange # Leave a gap between the two generated C functions. # puts "" puts "" # Load the fold data. This is used by the [rd_XXX] commands # as well as [print_fold]. tl_load_casefolding_txt ${casefolding.txt} set mappings [rd_load_unicodedata_text ${unicodedata.txt}] print_rd $mappings puts "" puts "" print_isdiacritic ${function_prefix}UnicodeIsdiacritic $mappings puts "" puts "" # Print the fold() function to stdout. # print_fold ${function_prefix}UnicodeFold # Print the test routines and main() function to stdout, if -test # was specified. # if {$::generate_test_code} { print_test_isalnum ${function_prefix}UnicodeIsalnum $lRange print_fold_test ${function_prefix}UnicodeFold $mappings print_test_main } if {$generate_fts5_code} { # no-op } else { puts "#endif /* defined(SQLITE_ENABLE_FTS3) || defined(SQLITE_ENABLE_FTS4) */" puts "#endif /* !defined(SQLITE_DISABLE_FTS3_UNICODE) */" } ================================================ FILE: v2/testdata/_sqlite/ext/fts3/unicode/parseunicode.tcl ================================================ #-------------------------------------------------------------------------- # Parameter $zName must be a path to the file UnicodeData.txt. This command # reads the file and returns a list of mappings required to remove all # diacritical marks from a unicode string. Each mapping is itself a list # consisting of two elements - the unicode codepoint and the single ASCII # character that it should be replaced with, or an empty string if the # codepoint should simply be removed from the input. Examples: # # { 224 a } (replace codepoint 224 to "a") # { 769 "" } (remove codepoint 769 from input) # # Mappings are only returned for non-upper case codepoints. It is assumed # that the input has already been folded to lower case. # proc rd_load_unicodedata_text {zName} { global tl_lookup_table set fd [open $zName] set lField { code character_name general_category canonical_combining_classes bidirectional_category character_decomposition_mapping decimal_digit_value digit_value numeric_value mirrored unicode_1_name iso10646_comment_field uppercase_mapping lowercase_mapping titlecase_mapping } set lRet [list] while { ![eof $fd] } { set line [gets $fd] if {$line == ""} continue set fields [split $line ";"] if {[llength $fields] != [llength $lField]} { error "parse error: $line" } foreach $lField $fields {} if { [llength $character_decomposition_mapping]!=2 || [string is xdigit [lindex $character_decomposition_mapping 0]]==0 } { continue } set iCode [expr "0x$code"] set iAscii [expr "0x[lindex $character_decomposition_mapping 0]"] set iDia [expr "0x[lindex $character_decomposition_mapping 1]"] if {[info exists tl_lookup_table($iCode)]} continue if { ($iAscii >= 97 && $iAscii <= 122) || ($iAscii >= 65 && $iAscii <= 90) } { lappend lRet [list $iCode [string tolower [format %c $iAscii]]] set dia($iDia) 1 } } foreach d [array names dia] { lappend lRet [list $d ""] } set lRet [lsort -integer -index 0 $lRet] close $fd set lRet } #------------------------------------------------------------------------- # Parameter $zName must be a path to the file UnicodeData.txt. This command # reads the file and returns a list of codepoints (integers). The list # contains all codepoints in the UnicodeData.txt assigned to any "General # Category" that is not a "Letter" or "Number". # proc an_load_unicodedata_text {zName} { set fd [open $zName] set lField { code character_name general_category canonical_combining_classes bidirectional_category character_decomposition_mapping decimal_digit_value digit_value numeric_value mirrored unicode_1_name iso10646_comment_field uppercase_mapping lowercase_mapping titlecase_mapping } set lRet [list] while { ![eof $fd] } { set line [gets $fd] if {$line == ""} continue set fields [split $line ";"] if {[llength $fields] != [llength $lField]} { error "parse error: $line" } foreach $lField $fields {} set iCode [expr "0x$code"] set bAlnum [expr { [lsearch {L N} [string range $general_category 0 0]] >= 0 || $general_category=="Co" }] if { !$bAlnum } { lappend lRet $iCode } } close $fd set lRet } proc tl_load_casefolding_txt {zName} { global tl_lookup_table set fd [open $zName] while { ![eof $fd] } { set line [gets $fd] if {[string range $line 0 0] == "#"} continue if {$line == ""} continue foreach x {a b c d} {unset -nocomplain $x} foreach {a b c d} [split $line ";"] {} set a2 [list] set c2 [list] foreach elem $a { lappend a2 [expr "0x[string trim $elem]"] } foreach elem $c { lappend c2 [expr "0x[string trim $elem]"] } set b [string trim $b] set d [string trim $d] if {$b=="C" || $b=="S"} { set tl_lookup_table($a2) $c2 } } } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/extract_api_docs.tcl ================================================ # # 2014 August 24 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #-------------------------------------------------------------------------- # # This script extracts the documentation for the API used by fts5 auxiliary # functions from header file fts5.h. It outputs html text on stdout that # is included in the documentation on the web. # set ::fts5_docs_output "" if {[info commands hd_putsnl]==""} { if {[llength $argv]>0} { set ::extract_api_docs_mode [lindex $argv 0] } proc output {text} { puts $text } } else { proc output {text} { append ::fts5_docs_output "$text\n" } } if {[info exists ::extract_api_docs_mode]==0} {set ::extract_api_docs_mode api} set input_file [file join [file dir [info script]] fts5.h] set fd [open $input_file] set data [read $fd] close $fd # Argument $data is the entire text of the fts5.h file. This function # extracts the definition of the Fts5ExtensionApi structure from it and # returns a key/value list of structure member names and definitions. i.e. # # iVersion {int iVersion} xUserData {void *(*xUserData)(Fts5Context*)} ... # proc get_struct_members {data} { # Extract the structure definition from the fts5.h file. regexp "struct Fts5ExtensionApi {(.*?)};" $data -> defn # Remove all comments from the structure definition regsub -all {/[*].*?[*]/} $defn {} defn2 set res [list] foreach member [split $defn2 {;}] { set member [string trim $member] if {$member!=""} { catch { set name [lindex $member end] } regexp {.*?[(][*]([^)]*)[)]} $member -> name lappend res $name $member } } set res } proc get_struct_docs {data names} { # Extract the structure definition from the fts5.h file. regexp {EXTENSION API FUNCTIONS(.*?)[*]/} $data -> docs set current_doc "" set current_header "" foreach line [split $docs "\n"] { regsub {[*]*} $line {} line if {[regexp {^ } $line]} { append current_doc "$line\n" } elseif {[string trim $line]==""} { if {$current_header!=""} { append current_doc "\n" } } else { if {$current_doc != ""} { lappend res $current_header $current_doc set current_doc "" } set subject n/a regexp {^ *([[:alpha:]]*)} $line -> subject if {[lsearch $names $subject]>=0} { set current_header $subject } else { set current_header [string trim $line] } } } if {$current_doc != ""} { lappend res $current_header $current_doc } set res } proc get_tokenizer_docs {data} { regexp {(xCreate:.*?)[*]/} $data -> docs set res "
\n" foreach line [split [string trim $docs] "\n"] { regexp {[*][*](.*)} $line -> line if {[regexp {^ ?x.*:} $line]} { append res "
$line

\n" continue } if {[regexp {SYNONYM SUPPORT} $line]} { set line "

Synonym Support

" } if {[string trim $line] == ""} { append res "

\n" } else { append res "$line\n" } } set res } proc get_api_docs {data} { # Initialize global array M as a map from Fts5StructureApi member name # to member definition. i.e. # # iVersion -> {int iVersion} # xUserData -> {void *(*xUserData)(Fts5Context*)} # ... # array set M [get_struct_members $data] # Initialize global list D as a map from section name to documentation # text. Most (all?) section names are structure member names. # set D [get_struct_docs $data [array names M]] output "

" foreach {sub docs} $D { if {[info exists M($sub)]} { set hdr $M($sub) set link " id=$sub" } else { set link "" } #output "
" #set style "padding-left:6ex;font-size:1.4em;display:block" #output "
$hdr
" regsub -line {^ *[)]} $hdr ")" hdr output "
" output "$hdr
" set mode "" set margin " style=margin-top:0.1em" foreach line [split [string trim $docs] "\n"] { if {[string trim $line]==""} { if {$mode != ""} {output ""} set mode "" } elseif {$mode == ""} { if {[regexp {^ } $line]} { set mode codeblock } else { set mode p } output "<$mode$margin>" set margin "" } output $line } if {$mode != ""} {output ""} output "
" } output "
" } proc get_fts5_struct {data start end} { set res "" set bOut 0 foreach line [split $data "\n"] { if {$bOut==0} { if {[regexp $start $line]} { set bOut 1 } } if {$bOut} { append res "$line\n" } if {$bOut} { if {[regexp $end $line]} { set bOut 0 } } } set map [list /* /* */ */] string map $map $res } proc main {data} { switch $::extract_api_docs_mode { fts5_api { output [get_fts5_struct $data "typedef struct fts5_api" "^\};"] } fts5_tokenizer { output [get_fts5_struct $data "typedef struct Fts5Tokenizer" "^\};"] output [get_fts5_struct $data \ "Flags that may be passed as the third argument to xTokenize()" \ "#define FTS5_TOKEN_COLOCATED" ] } fts5_extension { output [get_fts5_struct $data "typedef.*Fts5ExtensionApi" "^.;"] } Fts5ExtensionApi { set struct [get_fts5_struct $data "^struct Fts5ExtensionApi" "^.;"] set map [list] foreach {k v} [get_struct_members $data] { if {[string match x* $k]==0} continue lappend map $k "$k" } output [string map $map $struct] } api { get_api_docs $data } tokenizer_api { output [get_tokenizer_docs $data] } default { } } } main $data set ::fts5_docs_output ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5.h ================================================ /* ** 2014 May 31 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** Interfaces to extend FTS5. Using the interfaces defined in this file, ** FTS5 may be extended with: ** ** * custom tokenizers, and ** * custom auxiliary functions. */ #ifndef _FTS5_H #define _FTS5_H #include "sqlite3.h" #ifdef __cplusplus extern "C" { #endif /************************************************************************* ** CUSTOM AUXILIARY FUNCTIONS ** ** Virtual table implementations may overload SQL functions by implementing ** the sqlite3_module.xFindFunction() method. */ typedef struct Fts5ExtensionApi Fts5ExtensionApi; typedef struct Fts5Context Fts5Context; typedef struct Fts5PhraseIter Fts5PhraseIter; typedef void (*fts5_extension_function)( const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ Fts5Context *pFts, /* First arg to pass to pApi functions */ sqlite3_context *pCtx, /* Context for returning result/error */ int nVal, /* Number of values in apVal[] array */ sqlite3_value **apVal /* Array of trailing arguments */ ); struct Fts5PhraseIter { const unsigned char *a; const unsigned char *b; }; /* ** EXTENSION API FUNCTIONS ** ** xUserData(pFts): ** Return a copy of the context pointer the extension function was ** registered with. ** ** xColumnTotalSize(pFts, iCol, pnToken): ** If parameter iCol is less than zero, set output variable *pnToken ** to the total number of tokens in the FTS5 table. Or, if iCol is ** non-negative but less than the number of columns in the table, return ** the total number of tokens in column iCol, considering all rows in ** the FTS5 table. ** ** If parameter iCol is greater than or equal to the number of columns ** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. ** an OOM condition or IO error), an appropriate SQLite error code is ** returned. ** ** xColumnCount(pFts): ** Return the number of columns in the table. ** ** xColumnSize(pFts, iCol, pnToken): ** If parameter iCol is less than zero, set output variable *pnToken ** to the total number of tokens in the current row. Or, if iCol is ** non-negative but less than the number of columns in the table, set ** *pnToken to the number of tokens in column iCol of the current row. ** ** If parameter iCol is greater than or equal to the number of columns ** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. ** an OOM condition or IO error), an appropriate SQLite error code is ** returned. ** ** This function may be quite inefficient if used with an FTS5 table ** created with the "columnsize=0" option. ** ** xColumnText: ** This function attempts to retrieve the text of column iCol of the ** current document. If successful, (*pz) is set to point to a buffer ** containing the text in utf-8 encoding, (*pn) is set to the size in bytes ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, ** if an error occurs, an SQLite error code is returned and the final values ** of (*pz) and (*pn) are undefined. ** ** xPhraseCount: ** Returns the number of phrases in the current query expression. ** ** xPhraseSize: ** Returns the number of tokens in phrase iPhrase of the query. Phrases ** are numbered starting from zero. ** ** xInstCount: ** Set *pnInst to the total number of occurrences of all phrases within ** the query within the current row. Return SQLITE_OK if successful, or ** an error code (i.e. SQLITE_NOMEM) if an error occurs. ** ** This API can be quite slow if used with an FTS5 table created with the ** "detail=none" or "detail=column" option. If the FTS5 table is created ** with either "detail=none" or "detail=column" and "content=" option ** (i.e. if it is a contentless table), then this API always returns 0. ** ** xInst: ** Query for the details of phrase match iIdx within the current row. ** Phrase matches are numbered starting from zero, so the iIdx argument ** should be greater than or equal to zero and smaller than the value ** output by xInstCount(). ** ** Usually, output parameter *piPhrase is set to the phrase number, *piCol ** to the column in which it occurs and *piOff the token offset of the ** first token of the phrase. The exception is if the table was created ** with the offsets=0 option specified. In this case *piOff is always ** set to -1. ** ** Returns SQLITE_OK if successful, or an error code (i.e. SQLITE_NOMEM) ** if an error occurs. ** ** This API can be quite slow if used with an FTS5 table created with the ** "detail=none" or "detail=column" option. ** ** xRowid: ** Returns the rowid of the current row. ** ** xTokenize: ** Tokenize text using the tokenizer belonging to the FTS5 table. ** ** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): ** This API function is used to query the FTS table for phrase iPhrase ** of the current query. Specifically, a query equivalent to: ** ** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid ** ** with $p set to a phrase equivalent to the phrase iPhrase of the ** current query is executed. Any column filter that applies to ** phrase iPhrase of the current query is included in $p. For each ** row visited, the callback function passed as the fourth argument ** is invoked. The context and API objects passed to the callback ** function may be used to access the properties of each matched row. ** Invoking Api.xUserData() returns a copy of the pointer passed as ** the third argument to pUserData. ** ** If the callback function returns any value other than SQLITE_OK, the ** query is abandoned and the xQueryPhrase function returns immediately. ** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. ** Otherwise, the error code is propagated upwards. ** ** If the query runs to completion without incident, SQLITE_OK is returned. ** Or, if some error occurs before the query completes or is aborted by ** the callback, an SQLite error code is returned. ** ** ** xSetAuxdata(pFts5, pAux, xDelete) ** ** Save the pointer passed as the second argument as the extension functions ** "auxiliary data". The pointer may then be retrieved by the current or any ** future invocation of the same fts5 extension function made as part of ** of the same MATCH query using the xGetAuxdata() API. ** ** Each extension function is allocated a single auxiliary data slot for ** each FTS query (MATCH expression). If the extension function is invoked ** more than once for a single FTS query, then all invocations share a ** single auxiliary data context. ** ** If there is already an auxiliary data pointer when this function is ** invoked, then it is replaced by the new pointer. If an xDelete callback ** was specified along with the original pointer, it is invoked at this ** point. ** ** The xDelete callback, if one is specified, is also invoked on the ** auxiliary data pointer after the FTS5 query has finished. ** ** If an error (e.g. an OOM condition) occurs within this function, an ** the auxiliary data is set to NULL and an error code returned. If the ** xDelete parameter was not NULL, it is invoked on the auxiliary data ** pointer before returning. ** ** ** xGetAuxdata(pFts5, bClear) ** ** Returns the current auxiliary data pointer for the fts5 extension ** function. See the xSetAuxdata() method for details. ** ** If the bClear argument is non-zero, then the auxiliary data is cleared ** (set to NULL) before this function returns. In this case the xDelete, ** if any, is not invoked. ** ** ** xRowCount(pFts5, pnRow) ** ** This function is used to retrieve the total number of rows in the table. ** In other words, the same value that would be returned by: ** ** SELECT count(*) FROM ftstable; ** ** xPhraseFirst() ** This function is used, along with type Fts5PhraseIter and the xPhraseNext ** method, to iterate through all instances of a single query phrase within ** the current row. This is the same information as is accessible via the ** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient ** to use, this API may be faster under some circumstances. To iterate ** through instances of phrase iPhrase, use the following code: ** ** Fts5PhraseIter iter; ** int iCol, iOff; ** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); ** iCol>=0; ** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) ** ){ ** // An instance of phrase iPhrase at offset iOff of column iCol ** } ** ** The Fts5PhraseIter structure is defined above. Applications should not ** modify this structure directly - it should only be used as shown above ** with the xPhraseFirst() and xPhraseNext() API methods (and by ** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). ** ** This API can be quite slow if used with an FTS5 table created with the ** "detail=none" or "detail=column" option. If the FTS5 table is created ** with either "detail=none" or "detail=column" and "content=" option ** (i.e. if it is a contentless table), then this API always iterates ** through an empty set (all calls to xPhraseFirst() set iCol to -1). ** ** xPhraseNext() ** See xPhraseFirst above. ** ** xPhraseFirstColumn() ** This function and xPhraseNextColumn() are similar to the xPhraseFirst() ** and xPhraseNext() APIs described above. The difference is that instead ** of iterating through all instances of a phrase in the current row, these ** APIs are used to iterate through the set of columns in the current row ** that contain one or more instances of a specified phrase. For example: ** ** Fts5PhraseIter iter; ** int iCol; ** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); ** iCol>=0; ** pApi->xPhraseNextColumn(pFts, &iter, &iCol) ** ){ ** // Column iCol contains at least one instance of phrase iPhrase ** } ** ** This API can be quite slow if used with an FTS5 table created with the ** "detail=none" option. If the FTS5 table is created with either ** "detail=none" "content=" option (i.e. if it is a contentless table), ** then this API always iterates through an empty set (all calls to ** xPhraseFirstColumn() set iCol to -1). ** ** The information accessed using this API and its companion ** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext ** (or xInst/xInstCount). The chief advantage of this API is that it is ** significantly more efficient than those alternatives when used with ** "detail=column" tables. ** ** xPhraseNextColumn() ** See xPhraseFirstColumn above. */ struct Fts5ExtensionApi { int iVersion; /* Currently always set to 3 */ void *(*xUserData)(Fts5Context*); int (*xColumnCount)(Fts5Context*); int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); int (*xTokenize)(Fts5Context*, const char *pText, int nText, /* Text to tokenize */ void *pCtx, /* Context passed to xToken() */ int (*xToken)(void*, int, const char*, int, int, int) /* Callback */ ); int (*xPhraseCount)(Fts5Context*); int (*xPhraseSize)(Fts5Context*, int iPhrase); int (*xInstCount)(Fts5Context*, int *pnInst); int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff); sqlite3_int64 (*xRowid)(Fts5Context*); int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn); int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken); int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData, int(*)(const Fts5ExtensionApi*,Fts5Context*,void*) ); int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*)); void *(*xGetAuxdata)(Fts5Context*, int bClear); int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*); void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff); int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*); void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); }; /* ** CUSTOM AUXILIARY FUNCTIONS *************************************************************************/ /************************************************************************* ** CUSTOM TOKENIZERS ** ** Applications may also register custom tokenizer types. A tokenizer ** is registered by providing fts5 with a populated instance of the ** following structure. All structure methods must be defined, setting ** any member of the fts5_tokenizer struct to NULL leads to undefined ** behaviour. The structure methods are expected to function as follows: ** ** xCreate: ** This function is used to allocate and initialize a tokenizer instance. ** A tokenizer instance is required to actually tokenize text. ** ** The first argument passed to this function is a copy of the (void*) ** pointer provided by the application when the fts5_tokenizer object ** was registered with FTS5 (the third argument to xCreateTokenizer()). ** The second and third arguments are an array of nul-terminated strings ** containing the tokenizer arguments, if any, specified following the ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used ** to create the FTS5 table. ** ** The final argument is an output variable. If successful, (*ppOut) ** should be set to point to the new tokenizer handle and SQLITE_OK ** returned. If an error occurs, some value other than SQLITE_OK should ** be returned. In this case, fts5 assumes that the final value of *ppOut ** is undefined. ** ** xDelete: ** This function is invoked to delete a tokenizer handle previously ** allocated using xCreate(). Fts5 guarantees that this function will ** be invoked exactly once for each successful call to xCreate(). ** ** xTokenize: ** This function is expected to tokenize the nText byte string indicated ** by argument pText. pText may or may not be nul-terminated. The first ** argument passed to this function is a pointer to an Fts5Tokenizer object ** returned by an earlier call to xCreate(). ** ** The second argument indicates the reason that FTS5 is requesting ** tokenization of the supplied text. This is always one of the following ** four values: ** **
  • FTS5_TOKENIZE_DOCUMENT - A document is being inserted into ** or removed from the FTS table. The tokenizer is being invoked to ** determine the set of tokens to add to (or delete from) the ** FTS index. ** **
  • FTS5_TOKENIZE_QUERY - A MATCH query is being executed ** against the FTS index. The tokenizer is being called to tokenize ** a bareword or quoted string specified as part of the query. ** **
  • (FTS5_TOKENIZE_QUERY | FTS5_TOKENIZE_PREFIX) - Same as ** FTS5_TOKENIZE_QUERY, except that the bareword or quoted string is ** followed by a "*" character, indicating that the last token ** returned by the tokenizer will be treated as a token prefix. ** **
  • FTS5_TOKENIZE_AUX - The tokenizer is being invoked to ** satisfy an fts5_api.xTokenize() request made by an auxiliary ** function. Or an fts5_api.xColumnSize() request made by the same ** on a columnsize=0 database. **
** ** For each token in the input string, the supplied callback xToken() must ** be invoked. The first argument to it should be a copy of the pointer ** passed as the second argument to xTokenize(). The third and fourth ** arguments are a pointer to a buffer containing the token text, and the ** size of the token in bytes. The 4th and 5th arguments are the byte offsets ** of the first byte of and first byte immediately following the text from ** which the token is derived within the input. ** ** The second argument passed to the xToken() callback ("tflags") should ** normally be set to 0. The exception is if the tokenizer supports ** synonyms. In this case see the discussion below for details. ** ** FTS5 assumes the xToken() callback is invoked for each token in the ** order that they occur within the input text. ** ** If an xToken() callback returns any value other than SQLITE_OK, then ** the tokenization should be abandoned and the xTokenize() method should ** immediately return a copy of the xToken() return value. Or, if the ** input buffer is exhausted, xTokenize() should return SQLITE_OK. Finally, ** if an error occurs with the xTokenize() implementation itself, it ** may abandon the tokenization and return any error code other than ** SQLITE_OK or SQLITE_DONE. ** ** SYNONYM SUPPORT ** ** Custom tokenizers may also support synonyms. Consider a case in which a ** user wishes to query for a phrase such as "first place". Using the ** built-in tokenizers, the FTS5 query 'first + place' will match instances ** of "first place" within the document set, but not alternative forms ** such as "1st place". In some applications, it would be better to match ** all instances of "first place" or "1st place" regardless of which form ** the user specified in the MATCH query text. ** ** There are several ways to approach this in FTS5: ** **
  1. By mapping all synonyms to a single token. In this case, the ** In the above example, this means that the tokenizer returns the ** same token for inputs "first" and "1st". Say that token is in ** fact "first", so that when the user inserts the document "I won ** 1st place" entries are added to the index for tokens "i", "won", ** "first" and "place". If the user then queries for '1st + place', ** the tokenizer substitutes "first" for "1st" and the query works ** as expected. ** **
  2. By adding multiple synonyms for a single term to the FTS index. ** In this case, when tokenizing query text, the tokenizer may ** provide multiple synonyms for a single term within the document. ** FTS5 then queries the index for each synonym individually. For ** example, faced with the query: ** ** ** ... MATCH 'first place' ** ** the tokenizer offers both "1st" and "first" as synonyms for the ** first token in the MATCH query and FTS5 effectively runs a query ** similar to: ** ** ** ... MATCH '(first OR 1st) place' ** ** except that, for the purposes of auxiliary functions, the query ** still appears to contain just two phrases - "(first OR 1st)" ** being treated as a single phrase. ** **
  3. By adding multiple synonyms for a single term to the FTS index. ** Using this method, when tokenizing document text, the tokenizer ** provides multiple synonyms for each token. So that when a ** document such as "I won first place" is tokenized, entries are ** added to the FTS index for "i", "won", "first", "1st" and ** "place". ** ** This way, even if the tokenizer does not provide synonyms ** when tokenizing query text (it should not - to do would be ** inefficient), it doesn't matter if the user queries for ** 'first + place' or '1st + place', as there are entires in the ** FTS index corresponding to both forms of the first token. **
** ** Whether it is parsing document or query text, any call to xToken that ** specifies a tflags argument with the FTS5_TOKEN_COLOCATED bit ** is considered to supply a synonym for the previous token. For example, ** when parsing the document "I won first place", a tokenizer that supports ** synonyms would call xToken() 5 times, as follows: ** ** ** xToken(pCtx, 0, "i", 1, 0, 1); ** xToken(pCtx, 0, "won", 3, 2, 5); ** xToken(pCtx, 0, "first", 5, 6, 11); ** xToken(pCtx, FTS5_TOKEN_COLOCATED, "1st", 3, 6, 11); ** xToken(pCtx, 0, "place", 5, 12, 17); ** ** ** It is an error to specify the FTS5_TOKEN_COLOCATED flag the first time ** xToken() is called. Multiple synonyms may be specified for a single token ** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence. ** There is no limit to the number of synonyms that may be provided for a ** single token. ** ** In many cases, method (1) above is the best approach. It does not add ** extra data to the FTS index or require FTS5 to query for multiple terms, ** so it is efficient in terms of disk space and query speed. However, it ** does not support prefix queries very well. If, as suggested above, the ** token "first" is subsituted for "1st" by the tokenizer, then the query: ** ** ** ... MATCH '1s*' ** ** will not match documents that contain the token "1st" (as the tokenizer ** will probably not map "1s" to any prefix of "first"). ** ** For full prefix support, method (3) may be preferred. In this case, ** because the index contains entries for both "first" and "1st", prefix ** queries such as 'fi*' or '1s*' will match correctly. However, because ** extra entries are added to the FTS index, this method uses more space ** within the database. ** ** Method (2) offers a midpoint between (1) and (3). Using this method, ** a query such as '1s*' will match documents that contain the literal ** token "1st", but not "first" (assuming the tokenizer is not able to ** provide synonyms for prefixes). However, a non-prefix query like '1st' ** will match against "1st" and "first". This method does not require ** extra disk space, as no extra entries are added to the FTS index. ** On the other hand, it may require more CPU cycles to run MATCH queries, ** as separate queries of the FTS index are required for each synonym. ** ** When using methods (2) or (3), it is important that the tokenizer only ** provide synonyms when tokenizing document text (method (2)) or query ** text (method (3)), not both. Doing so will not cause any errors, but is ** inefficient. */ typedef struct Fts5Tokenizer Fts5Tokenizer; typedef struct fts5_tokenizer fts5_tokenizer; struct fts5_tokenizer { int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); void (*xDelete)(Fts5Tokenizer*); int (*xTokenize)(Fts5Tokenizer*, void *pCtx, int flags, /* Mask of FTS5_TOKENIZE_* flags */ const char *pText, int nText, int (*xToken)( void *pCtx, /* Copy of 2nd argument to xTokenize() */ int tflags, /* Mask of FTS5_TOKEN_* flags */ const char *pToken, /* Pointer to buffer containing token */ int nToken, /* Size of token in bytes */ int iStart, /* Byte offset of token within input text */ int iEnd /* Byte offset of end of token within input text */ ) ); }; /* Flags that may be passed as the third argument to xTokenize() */ #define FTS5_TOKENIZE_QUERY 0x0001 #define FTS5_TOKENIZE_PREFIX 0x0002 #define FTS5_TOKENIZE_DOCUMENT 0x0004 #define FTS5_TOKENIZE_AUX 0x0008 /* Flags that may be passed by the tokenizer implementation back to FTS5 ** as the third argument to the supplied xToken callback. */ #define FTS5_TOKEN_COLOCATED 0x0001 /* Same position as prev. token */ /* ** END OF CUSTOM TOKENIZERS *************************************************************************/ /************************************************************************* ** FTS5 EXTENSION REGISTRATION API */ typedef struct fts5_api fts5_api; struct fts5_api { int iVersion; /* Currently always set to 2 */ /* Create a new tokenizer */ int (*xCreateTokenizer)( fts5_api *pApi, const char *zName, void *pContext, fts5_tokenizer *pTokenizer, void (*xDestroy)(void*) ); /* Find an existing tokenizer */ int (*xFindTokenizer)( fts5_api *pApi, const char *zName, void **ppContext, fts5_tokenizer *pTokenizer ); /* Create a new auxiliary function */ int (*xCreateFunction)( fts5_api *pApi, const char *zName, void *pContext, fts5_extension_function xFunction, void (*xDestroy)(void*) ); }; /* ** END OF REGISTRATION API *************************************************************************/ #ifdef __cplusplus } /* end of the 'extern "C"' block */ #endif #endif /* _FTS5_H */ ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5Int.h ================================================ /* ** 2014 May 31 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** */ #ifndef _FTS5INT_H #define _FTS5INT_H #include "fts5.h" #include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 #include #include #ifndef SQLITE_AMALGAMATION typedef unsigned char u8; typedef unsigned int u32; typedef unsigned short u16; typedef short i16; typedef sqlite3_int64 i64; typedef sqlite3_uint64 u64; #ifndef ArraySize # define ArraySize(x) ((int)(sizeof(x) / sizeof(x[0]))) #endif #define testcase(x) #define ALWAYS(x) 1 #define NEVER(x) 0 #define MIN(x,y) (((x) < (y)) ? (x) : (y)) #define MAX(x,y) (((x) > (y)) ? (x) : (y)) /* ** Constants for the largest and smallest possible 64-bit signed integers. */ # define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32)) # define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64) #endif /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset ** field that occurs at the start of each leaf page (see fts5_index.c). */ #define FTS5_MAX_TOKEN_SIZE 32768 /* ** Maximum number of prefix indexes on single FTS5 table. This must be ** less than 32. If it is set to anything large than that, an #error ** directive in fts5_index.c will cause the build to fail. */ #define FTS5_MAX_PREFIX_INDEXES 31 #define FTS5_DEFAULT_NEARDIST 10 #define FTS5_DEFAULT_RANK "bm25" /* Name of rank and rowid columns */ #define FTS5_RANK_NAME "rank" #define FTS5_ROWID_NAME "rowid" #ifdef SQLITE_DEBUG # define FTS5_CORRUPT sqlite3Fts5Corrupt() int sqlite3Fts5Corrupt(void); #else # define FTS5_CORRUPT SQLITE_CORRUPT_VTAB #endif /* ** The assert_nc() macro is similar to the assert() macro, except that it ** is used for assert() conditions that are true only if it can be ** guranteed that the database is not corrupt. */ #ifdef SQLITE_DEBUG extern int sqlite3_fts5_may_be_corrupt; # define assert_nc(x) assert(sqlite3_fts5_may_be_corrupt || (x)) #else # define assert_nc(x) assert(x) #endif /* Mark a function parameter as unused, to suppress nuisance compiler ** warnings. */ #ifndef UNUSED_PARAM # define UNUSED_PARAM(X) (void)(X) #endif #ifndef UNUSED_PARAM2 # define UNUSED_PARAM2(X, Y) (void)(X), (void)(Y) #endif typedef struct Fts5Global Fts5Global; typedef struct Fts5Colset Fts5Colset; /* If a NEAR() clump or phrase may only match a specific set of columns, ** then an object of the following type is used to record the set of columns. ** Each entry in the aiCol[] array is a column that may be matched. ** ** This object is used by fts5_expr.c and fts5_index.c. */ struct Fts5Colset { int nCol; int aiCol[1]; }; /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. */ typedef struct Fts5Config Fts5Config; /* ** An instance of the following structure encodes all information that can ** be gleaned from the CREATE VIRTUAL TABLE statement. ** ** And all information loaded from the %_config table. ** ** nAutomerge: ** The minimum number of segments that an auto-merge operation should ** attempt to merge together. A value of 1 sets the object to use the ** compile time default. Zero disables auto-merge altogether. ** ** zContent: ** ** zContentRowid: ** The value of the content_rowid= option, if one was specified. Or ** the string "rowid" otherwise. This text is not quoted - if it is ** used as part of an SQL statement it needs to be quoted appropriately. ** ** zContentExprlist: ** ** pzErrmsg: ** This exists in order to allow the fts5_index.c module to return a ** decent error message if it encounters a file-format version it does ** not understand. ** ** bColumnsize: ** True if the %_docsize table is created. ** ** bPrefixIndex: ** This is only used for debugging. If set to false, any prefix indexes ** are ignored. This value is configured using: ** ** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); ** */ struct Fts5Config { sqlite3 *db; /* Database handle */ char *zDb; /* Database holding FTS index (e.g. "main") */ char *zName; /* Name of FTS index */ int nCol; /* Number of columns */ char **azCol; /* Column names */ u8 *abUnindexed; /* True for unindexed columns */ int nPrefix; /* Number of prefix indexes */ int *aPrefix; /* Sizes in bytes of nPrefix prefix indexes */ int eContent; /* An FTS5_CONTENT value */ char *zContent; /* content table */ char *zContentRowid; /* "content_rowid=" option value */ int bColumnsize; /* "columnsize=" option value (dflt==1) */ int eDetail; /* FTS5_DETAIL_XXX value */ char *zContentExprlist; Fts5Tokenizer *pTok; fts5_tokenizer *pTokApi; /* Values loaded from the %_config table */ int iCookie; /* Incremented when %_config is modified */ int pgsz; /* Approximate page size used in %_data */ int nAutomerge; /* 'automerge' setting */ int nCrisisMerge; /* Maximum allowed segments per level */ int nUsermerge; /* 'usermerge' setting */ int nHashSize; /* Bytes of memory for in-memory hash */ char *zRank; /* Name of rank function */ char *zRankArgs; /* Arguments to rank function */ /* If non-NULL, points to sqlite3_vtab.base.zErrmsg. Often NULL. */ char **pzErrmsg; #ifdef SQLITE_DEBUG int bPrefixIndex; /* True to use prefix-indexes */ #endif }; /* Current expected value of %_config table 'version' field */ #define FTS5_CURRENT_VERSION 4 #define FTS5_CONTENT_NORMAL 0 #define FTS5_CONTENT_NONE 1 #define FTS5_CONTENT_EXTERNAL 2 #define FTS5_DETAIL_FULL 0 #define FTS5_DETAIL_NONE 1 #define FTS5_DETAIL_COLUMNS 2 int sqlite3Fts5ConfigParse( Fts5Global*, sqlite3*, int, const char **, Fts5Config**, char** ); void sqlite3Fts5ConfigFree(Fts5Config*); int sqlite3Fts5ConfigDeclareVtab(Fts5Config *pConfig); int sqlite3Fts5Tokenize( Fts5Config *pConfig, /* FTS5 Configuration object */ int flags, /* FTS5_TOKENIZE_* flags */ const char *pText, int nText, /* Text to tokenize */ void *pCtx, /* Context passed to xToken() */ int (*xToken)(void*, int, const char*, int, int, int) /* Callback */ ); void sqlite3Fts5Dequote(char *z); /* Load the contents of the %_config table */ int sqlite3Fts5ConfigLoad(Fts5Config*, int); /* Set the value of a single config attribute */ int sqlite3Fts5ConfigSetValue(Fts5Config*, const char*, sqlite3_value*, int*); int sqlite3Fts5ConfigParseRank(const char*, char**, char**); /* ** End of interface to code in fts5_config.c. **************************************************************************/ /************************************************************************** ** Interface to code in fts5_buffer.c. */ /* ** Buffer object for the incremental building of string data. */ typedef struct Fts5Buffer Fts5Buffer; struct Fts5Buffer { u8 *p; int n; int nSpace; }; int sqlite3Fts5BufferSize(int*, Fts5Buffer*, u32); void sqlite3Fts5BufferAppendVarint(int*, Fts5Buffer*, i64); void sqlite3Fts5BufferAppendBlob(int*, Fts5Buffer*, u32, const u8*); void sqlite3Fts5BufferAppendString(int *, Fts5Buffer*, const char*); void sqlite3Fts5BufferFree(Fts5Buffer*); void sqlite3Fts5BufferZero(Fts5Buffer*); void sqlite3Fts5BufferSet(int*, Fts5Buffer*, int, const u8*); void sqlite3Fts5BufferAppendPrintf(int *, Fts5Buffer*, char *zFmt, ...); char *sqlite3Fts5Mprintf(int *pRc, const char *zFmt, ...); #define fts5BufferZero(x) sqlite3Fts5BufferZero(x) #define fts5BufferAppendVarint(a,b,c) sqlite3Fts5BufferAppendVarint(a,b,c) #define fts5BufferFree(a) sqlite3Fts5BufferFree(a) #define fts5BufferAppendBlob(a,b,c,d) sqlite3Fts5BufferAppendBlob(a,b,c,d) #define fts5BufferSet(a,b,c,d) sqlite3Fts5BufferSet(a,b,c,d) #define fts5BufferGrow(pRc,pBuf,nn) ( \ (u32)((pBuf)->n) + (u32)(nn) <= (u32)((pBuf)->nSpace) ? 0 : \ sqlite3Fts5BufferSize((pRc),(pBuf),(nn)+(pBuf)->n) \ ) /* Write and decode big-endian 32-bit integer values */ void sqlite3Fts5Put32(u8*, int); int sqlite3Fts5Get32(const u8*); #define FTS5_POS2COLUMN(iPos) (int)(iPos >> 32) #define FTS5_POS2OFFSET(iPos) (int)(iPos & 0xFFFFFFFF) typedef struct Fts5PoslistReader Fts5PoslistReader; struct Fts5PoslistReader { /* Variables used only by sqlite3Fts5PoslistIterXXX() functions. */ const u8 *a; /* Position list to iterate through */ int n; /* Size of buffer at a[] in bytes */ int i; /* Current offset in a[] */ u8 bFlag; /* For client use (any custom purpose) */ /* Output variables */ u8 bEof; /* Set to true at EOF */ i64 iPos; /* (iCol<<32) + iPos */ }; int sqlite3Fts5PoslistReaderInit( const u8 *a, int n, /* Poslist buffer to iterate through */ Fts5PoslistReader *pIter /* Iterator object to initialize */ ); int sqlite3Fts5PoslistReaderNext(Fts5PoslistReader*); typedef struct Fts5PoslistWriter Fts5PoslistWriter; struct Fts5PoslistWriter { i64 iPrev; }; int sqlite3Fts5PoslistWriterAppend(Fts5Buffer*, Fts5PoslistWriter*, i64); void sqlite3Fts5PoslistSafeAppend(Fts5Buffer*, i64*, i64); int sqlite3Fts5PoslistNext64( const u8 *a, int n, /* Buffer containing poslist */ int *pi, /* IN/OUT: Offset within a[] */ i64 *piOff /* IN/OUT: Current offset */ ); /* Malloc utility */ void *sqlite3Fts5MallocZero(int *pRc, int nByte); char *sqlite3Fts5Strndup(int *pRc, const char *pIn, int nIn); /* Character set tests (like isspace(), isalpha() etc.) */ int sqlite3Fts5IsBareword(char t); /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ typedef struct Fts5Termset Fts5Termset; int sqlite3Fts5TermsetNew(Fts5Termset**); int sqlite3Fts5TermsetAdd(Fts5Termset*, int, const char*, int, int *pbPresent); void sqlite3Fts5TermsetFree(Fts5Termset*); /* ** End of interface to code in fts5_buffer.c. **************************************************************************/ /************************************************************************** ** Interface to code in fts5_index.c. fts5_index.c contains contains code ** to access the data stored in the %_data table. */ typedef struct Fts5Index Fts5Index; typedef struct Fts5IndexIter Fts5IndexIter; struct Fts5IndexIter { i64 iRowid; const u8 *pData; int nData; u8 bEof; }; #define sqlite3Fts5IterEof(x) ((x)->bEof) /* ** Values used as part of the flags argument passed to IndexQuery(). */ #define FTS5INDEX_QUERY_PREFIX 0x0001 /* Prefix query */ #define FTS5INDEX_QUERY_DESC 0x0002 /* Docs in descending rowid order */ #define FTS5INDEX_QUERY_TEST_NOIDX 0x0004 /* Do not use prefix index */ #define FTS5INDEX_QUERY_SCAN 0x0008 /* Scan query (fts5vocab) */ /* The following are used internally by the fts5_index.c module. They are ** defined here only to make it easier to avoid clashes with the flags ** above. */ #define FTS5INDEX_QUERY_SKIPEMPTY 0x0010 #define FTS5INDEX_QUERY_NOOUTPUT 0x0020 /* ** Create/destroy an Fts5Index object. */ int sqlite3Fts5IndexOpen(Fts5Config *pConfig, int bCreate, Fts5Index**, char**); int sqlite3Fts5IndexClose(Fts5Index *p); /* ** Return a simple checksum value based on the arguments. */ u64 sqlite3Fts5IndexEntryCksum( i64 iRowid, int iCol, int iPos, int iIdx, const char *pTerm, int nTerm ); /* ** Argument p points to a buffer containing utf-8 text that is n bytes in ** size. Return the number of bytes in the nChar character prefix of the ** buffer, or 0 if there are less than nChar characters in total. */ int sqlite3Fts5IndexCharlenToBytelen( const char *p, int nByte, int nChar ); /* ** Open a new iterator to iterate though all rowids that match the ** specified token or token prefix. */ int sqlite3Fts5IndexQuery( Fts5Index *p, /* FTS index to query */ const char *pToken, int nToken, /* Token (or prefix) to query for */ int flags, /* Mask of FTS5INDEX_QUERY_X flags */ Fts5Colset *pColset, /* Match these columns only */ Fts5IndexIter **ppIter /* OUT: New iterator object */ ); /* ** The various operations on open token or token prefix iterators opened ** using sqlite3Fts5IndexQuery(). */ int sqlite3Fts5IterNext(Fts5IndexIter*); int sqlite3Fts5IterNextFrom(Fts5IndexIter*, i64 iMatch); /* ** Close an iterator opened by sqlite3Fts5IndexQuery(). */ void sqlite3Fts5IterClose(Fts5IndexIter*); /* ** This interface is used by the fts5vocab module. */ const char *sqlite3Fts5IterTerm(Fts5IndexIter*, int*); int sqlite3Fts5IterNextScan(Fts5IndexIter*); /* ** Insert or remove data to or from the index. Each time a document is ** added to or removed from the index, this function is called one or more ** times. ** ** For an insert, it must be called once for each token in the new document. ** If the operation is a delete, it must be called (at least) once for each ** unique token in the document with an iCol value less than zero. The iPos ** argument is ignored for a delete. */ int sqlite3Fts5IndexWrite( Fts5Index *p, /* Index to write to */ int iCol, /* Column token appears in (-ve -> delete) */ int iPos, /* Position of token within column */ const char *pToken, int nToken /* Token to add or remove to or from index */ ); /* ** Indicate that subsequent calls to sqlite3Fts5IndexWrite() pertain to ** document iDocid. */ int sqlite3Fts5IndexBeginWrite( Fts5Index *p, /* Index to write to */ int bDelete, /* True if current operation is a delete */ i64 iDocid /* Docid to add or remove data from */ ); /* ** Flush any data stored in the in-memory hash tables to the database. ** Also close any open blob handles. */ int sqlite3Fts5IndexSync(Fts5Index *p); /* ** Discard any data stored in the in-memory hash tables. Do not write it ** to the database. Additionally, assume that the contents of the %_data ** table may have changed on disk. So any in-memory caches of %_data ** records must be invalidated. */ int sqlite3Fts5IndexRollback(Fts5Index *p); /* ** Get or set the "averages" values. */ int sqlite3Fts5IndexGetAverages(Fts5Index *p, i64 *pnRow, i64 *anSize); int sqlite3Fts5IndexSetAverages(Fts5Index *p, const u8*, int); /* ** Functions called by the storage module as part of integrity-check. */ int sqlite3Fts5IndexIntegrityCheck(Fts5Index*, u64 cksum); /* ** Called during virtual module initialization to register UDF ** fts5_decode() with SQLite */ int sqlite3Fts5IndexInit(sqlite3*); int sqlite3Fts5IndexSetCookie(Fts5Index*, int); /* ** Return the total number of entries read from the %_data table by ** this connection since it was created. */ int sqlite3Fts5IndexReads(Fts5Index *p); int sqlite3Fts5IndexReinit(Fts5Index *p); int sqlite3Fts5IndexOptimize(Fts5Index *p); int sqlite3Fts5IndexMerge(Fts5Index *p, int nMerge); int sqlite3Fts5IndexReset(Fts5Index *p); int sqlite3Fts5IndexLoadConfig(Fts5Index *p); /* ** End of interface to code in fts5_index.c. **************************************************************************/ /************************************************************************** ** Interface to code in fts5_varint.c. */ int sqlite3Fts5GetVarint32(const unsigned char *p, u32 *v); int sqlite3Fts5GetVarintLen(u32 iVal); u8 sqlite3Fts5GetVarint(const unsigned char*, u64*); int sqlite3Fts5PutVarint(unsigned char *p, u64 v); #define fts5GetVarint32(a,b) sqlite3Fts5GetVarint32(a,(u32*)&b) #define fts5GetVarint sqlite3Fts5GetVarint #define fts5FastGetVarint32(a, iOff, nVal) { \ nVal = (a)[iOff++]; \ if( nVal & 0x80 ){ \ iOff--; \ iOff += fts5GetVarint32(&(a)[iOff], nVal); \ } \ } /* ** End of interface to code in fts5_varint.c. **************************************************************************/ /************************************************************************** ** Interface to code in fts5.c. */ int sqlite3Fts5GetTokenizer( Fts5Global*, const char **azArg, int nArg, Fts5Tokenizer**, fts5_tokenizer**, char **pzErr ); Fts5Index *sqlite3Fts5IndexFromCsrid(Fts5Global*, i64, Fts5Config **); /* ** End of interface to code in fts5.c. **************************************************************************/ /************************************************************************** ** Interface to code in fts5_hash.c. */ typedef struct Fts5Hash Fts5Hash; /* ** Create a hash table, free a hash table. */ int sqlite3Fts5HashNew(Fts5Config*, Fts5Hash**, int *pnSize); void sqlite3Fts5HashFree(Fts5Hash*); int sqlite3Fts5HashWrite( Fts5Hash*, i64 iRowid, /* Rowid for this entry */ int iCol, /* Column token appears in (-ve -> delete) */ int iPos, /* Position of token within column */ char bByte, const char *pToken, int nToken /* Token to add or remove to or from index */ ); /* ** Empty (but do not delete) a hash table. */ void sqlite3Fts5HashClear(Fts5Hash*); int sqlite3Fts5HashQuery( Fts5Hash*, /* Hash table to query */ const char *pTerm, int nTerm, /* Query term */ const u8 **ppDoclist, /* OUT: Pointer to doclist for pTerm */ int *pnDoclist /* OUT: Size of doclist in bytes */ ); int sqlite3Fts5HashScanInit( Fts5Hash*, /* Hash table to query */ const char *pTerm, int nTerm /* Query prefix */ ); void sqlite3Fts5HashScanNext(Fts5Hash*); int sqlite3Fts5HashScanEof(Fts5Hash*); void sqlite3Fts5HashScanEntry(Fts5Hash *, const char **pzTerm, /* OUT: term (nul-terminated) */ const u8 **ppDoclist, /* OUT: pointer to doclist */ int *pnDoclist /* OUT: size of doclist in bytes */ ); /* ** End of interface to code in fts5_hash.c. **************************************************************************/ /************************************************************************** ** Interface to code in fts5_storage.c. fts5_storage.c contains contains ** code to access the data stored in the %_content and %_docsize tables. */ #define FTS5_STMT_SCAN_ASC 0 /* SELECT rowid, * FROM ... ORDER BY 1 ASC */ #define FTS5_STMT_SCAN_DESC 1 /* SELECT rowid, * FROM ... ORDER BY 1 DESC */ #define FTS5_STMT_LOOKUP 2 /* SELECT rowid, * FROM ... WHERE rowid=? */ typedef struct Fts5Storage Fts5Storage; int sqlite3Fts5StorageOpen(Fts5Config*, Fts5Index*, int, Fts5Storage**, char**); int sqlite3Fts5StorageClose(Fts5Storage *p); int sqlite3Fts5StorageRename(Fts5Storage*, const char *zName); int sqlite3Fts5DropAll(Fts5Config*); int sqlite3Fts5CreateTable(Fts5Config*, const char*, const char*, int, char **); int sqlite3Fts5StorageDelete(Fts5Storage *p, i64, sqlite3_value**); int sqlite3Fts5StorageContentInsert(Fts5Storage *p, sqlite3_value**, i64*); int sqlite3Fts5StorageIndexInsert(Fts5Storage *p, sqlite3_value**, i64); int sqlite3Fts5StorageIntegrity(Fts5Storage *p); int sqlite3Fts5StorageStmt(Fts5Storage *p, int eStmt, sqlite3_stmt**, char**); void sqlite3Fts5StorageStmtRelease(Fts5Storage *p, int eStmt, sqlite3_stmt*); int sqlite3Fts5StorageDocsize(Fts5Storage *p, i64 iRowid, int *aCol); int sqlite3Fts5StorageSize(Fts5Storage *p, int iCol, i64 *pnAvg); int sqlite3Fts5StorageRowCount(Fts5Storage *p, i64 *pnRow); int sqlite3Fts5StorageSync(Fts5Storage *p); int sqlite3Fts5StorageRollback(Fts5Storage *p); int sqlite3Fts5StorageConfigValue( Fts5Storage *p, const char*, sqlite3_value*, int ); int sqlite3Fts5StorageDeleteAll(Fts5Storage *p); int sqlite3Fts5StorageRebuild(Fts5Storage *p); int sqlite3Fts5StorageOptimize(Fts5Storage *p); int sqlite3Fts5StorageMerge(Fts5Storage *p, int nMerge); int sqlite3Fts5StorageReset(Fts5Storage *p); /* ** End of interface to code in fts5_storage.c. **************************************************************************/ /************************************************************************** ** Interface to code in fts5_expr.c. */ typedef struct Fts5Expr Fts5Expr; typedef struct Fts5ExprNode Fts5ExprNode; typedef struct Fts5Parse Fts5Parse; typedef struct Fts5Token Fts5Token; typedef struct Fts5ExprPhrase Fts5ExprPhrase; typedef struct Fts5ExprNearset Fts5ExprNearset; struct Fts5Token { const char *p; /* Token text (not NULL terminated) */ int n; /* Size of buffer p in bytes */ }; /* Parse a MATCH expression. */ int sqlite3Fts5ExprNew( Fts5Config *pConfig, int iCol, /* Column on LHS of MATCH operator */ const char *zExpr, Fts5Expr **ppNew, char **pzErr ); /* ** for(rc = sqlite3Fts5ExprFirst(pExpr, pIdx, bDesc); ** rc==SQLITE_OK && 0==sqlite3Fts5ExprEof(pExpr); ** rc = sqlite3Fts5ExprNext(pExpr) ** ){ ** // The document with rowid iRowid matches the expression! ** i64 iRowid = sqlite3Fts5ExprRowid(pExpr); ** } */ int sqlite3Fts5ExprFirst(Fts5Expr*, Fts5Index *pIdx, i64 iMin, int bDesc); int sqlite3Fts5ExprNext(Fts5Expr*, i64 iMax); int sqlite3Fts5ExprEof(Fts5Expr*); i64 sqlite3Fts5ExprRowid(Fts5Expr*); void sqlite3Fts5ExprFree(Fts5Expr*); /* Called during startup to register a UDF with SQLite */ int sqlite3Fts5ExprInit(Fts5Global*, sqlite3*); int sqlite3Fts5ExprPhraseCount(Fts5Expr*); int sqlite3Fts5ExprPhraseSize(Fts5Expr*, int iPhrase); int sqlite3Fts5ExprPoslist(Fts5Expr*, int, const u8 **); typedef struct Fts5PoslistPopulator Fts5PoslistPopulator; Fts5PoslistPopulator *sqlite3Fts5ExprClearPoslists(Fts5Expr*, int); int sqlite3Fts5ExprPopulatePoslists( Fts5Config*, Fts5Expr*, Fts5PoslistPopulator*, int, const char*, int ); void sqlite3Fts5ExprCheckPoslists(Fts5Expr*, i64); int sqlite3Fts5ExprClonePhrase(Fts5Expr*, int, Fts5Expr**); int sqlite3Fts5ExprPhraseCollist(Fts5Expr *, int, const u8 **, int *); /******************************************* ** The fts5_expr.c API above this point is used by the other hand-written ** C code in this module. The interfaces below this point are called by ** the parser code in fts5parse.y. */ void sqlite3Fts5ParseError(Fts5Parse *pParse, const char *zFmt, ...); Fts5ExprNode *sqlite3Fts5ParseNode( Fts5Parse *pParse, int eType, Fts5ExprNode *pLeft, Fts5ExprNode *pRight, Fts5ExprNearset *pNear ); Fts5ExprNode *sqlite3Fts5ParseImplicitAnd( Fts5Parse *pParse, Fts5ExprNode *pLeft, Fts5ExprNode *pRight ); Fts5ExprPhrase *sqlite3Fts5ParseTerm( Fts5Parse *pParse, Fts5ExprPhrase *pPhrase, Fts5Token *pToken, int bPrefix ); Fts5ExprNearset *sqlite3Fts5ParseNearset( Fts5Parse*, Fts5ExprNearset*, Fts5ExprPhrase* ); Fts5Colset *sqlite3Fts5ParseColset( Fts5Parse*, Fts5Colset*, Fts5Token * ); void sqlite3Fts5ParsePhraseFree(Fts5ExprPhrase*); void sqlite3Fts5ParseNearsetFree(Fts5ExprNearset*); void sqlite3Fts5ParseNodeFree(Fts5ExprNode*); void sqlite3Fts5ParseSetDistance(Fts5Parse*, Fts5ExprNearset*, Fts5Token*); void sqlite3Fts5ParseSetColset(Fts5Parse*, Fts5ExprNode*, Fts5Colset*); Fts5Colset *sqlite3Fts5ParseColsetInvert(Fts5Parse*, Fts5Colset*); void sqlite3Fts5ParseFinished(Fts5Parse *pParse, Fts5ExprNode *p); void sqlite3Fts5ParseNear(Fts5Parse *pParse, Fts5Token*); /* ** End of interface to code in fts5_expr.c. **************************************************************************/ /************************************************************************** ** Interface to code in fts5_aux.c. */ int sqlite3Fts5AuxInit(fts5_api*); /* ** End of interface to code in fts5_aux.c. **************************************************************************/ /************************************************************************** ** Interface to code in fts5_tokenizer.c. */ int sqlite3Fts5TokenizerInit(fts5_api*); /* ** End of interface to code in fts5_tokenizer.c. **************************************************************************/ /************************************************************************** ** Interface to code in fts5_vocab.c. */ int sqlite3Fts5VocabInit(Fts5Global*, sqlite3*); /* ** End of interface to code in fts5_vocab.c. **************************************************************************/ /************************************************************************** ** Interface to automatically generated code in fts5_unicode2.c. */ int sqlite3Fts5UnicodeIsalnum(int c); int sqlite3Fts5UnicodeIsdiacritic(int c); int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic); /* ** End of interface to code in fts5_unicode2.c. **************************************************************************/ #endif ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_aux.c ================================================ /* ** 2014 May 31 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** */ #include "fts5Int.h" #include /* amalgamator: keep */ /* ** Object used to iterate through all "coalesced phrase instances" in ** a single column of the current row. If the phrase instances in the ** column being considered do not overlap, this object simply iterates ** through them. Or, if they do overlap (share one or more tokens in ** common), each set of overlapping instances is treated as a single ** match. See documentation for the highlight() auxiliary function for ** details. ** ** Usage is: ** ** for(rc = fts5CInstIterNext(pApi, pFts, iCol, &iter); ** (rc==SQLITE_OK && 0==fts5CInstIterEof(&iter); ** rc = fts5CInstIterNext(&iter) ** ){ ** printf("instance starts at %d, ends at %d\n", iter.iStart, iter.iEnd); ** } ** */ typedef struct CInstIter CInstIter; struct CInstIter { const Fts5ExtensionApi *pApi; /* API offered by current FTS version */ Fts5Context *pFts; /* First arg to pass to pApi functions */ int iCol; /* Column to search */ int iInst; /* Next phrase instance index */ int nInst; /* Total number of phrase instances */ /* Output variables */ int iStart; /* First token in coalesced phrase instance */ int iEnd; /* Last token in coalesced phrase instance */ }; /* ** Advance the iterator to the next coalesced phrase instance. Return ** an SQLite error code if an error occurs, or SQLITE_OK otherwise. */ static int fts5CInstIterNext(CInstIter *pIter){ int rc = SQLITE_OK; pIter->iStart = -1; pIter->iEnd = -1; while( rc==SQLITE_OK && pIter->iInstnInst ){ int ip; int ic; int io; rc = pIter->pApi->xInst(pIter->pFts, pIter->iInst, &ip, &ic, &io); if( rc==SQLITE_OK ){ if( ic==pIter->iCol ){ int iEnd = io - 1 + pIter->pApi->xPhraseSize(pIter->pFts, ip); if( pIter->iStart<0 ){ pIter->iStart = io; pIter->iEnd = iEnd; }else if( io<=pIter->iEnd ){ if( iEnd>pIter->iEnd ) pIter->iEnd = iEnd; }else{ break; } } pIter->iInst++; } } return rc; } /* ** Initialize the iterator object indicated by the final parameter to ** iterate through coalesced phrase instances in column iCol. */ static int fts5CInstIterInit( const Fts5ExtensionApi *pApi, Fts5Context *pFts, int iCol, CInstIter *pIter ){ int rc; memset(pIter, 0, sizeof(CInstIter)); pIter->pApi = pApi; pIter->pFts = pFts; pIter->iCol = iCol; rc = pApi->xInstCount(pFts, &pIter->nInst); if( rc==SQLITE_OK ){ rc = fts5CInstIterNext(pIter); } return rc; } /************************************************************************* ** Start of highlight() implementation. */ typedef struct HighlightContext HighlightContext; struct HighlightContext { CInstIter iter; /* Coalesced Instance Iterator */ int iPos; /* Current token offset in zIn[] */ int iRangeStart; /* First token to include */ int iRangeEnd; /* If non-zero, last token to include */ const char *zOpen; /* Opening highlight */ const char *zClose; /* Closing highlight */ const char *zIn; /* Input text */ int nIn; /* Size of input text in bytes */ int iOff; /* Current offset within zIn[] */ char *zOut; /* Output value */ }; /* ** Append text to the HighlightContext output string - p->zOut. Argument ** z points to a buffer containing n bytes of text to append. If n is ** negative, everything up until the first '\0' is appended to the output. ** ** If *pRc is set to any value other than SQLITE_OK when this function is ** called, it is a no-op. If an error (i.e. an OOM condition) is encountered, ** *pRc is set to an error code before returning. */ static void fts5HighlightAppend( int *pRc, HighlightContext *p, const char *z, int n ){ if( *pRc==SQLITE_OK ){ if( n<0 ) n = (int)strlen(z); p->zOut = sqlite3_mprintf("%z%.*s", p->zOut, n, z); if( p->zOut==0 ) *pRc = SQLITE_NOMEM; } } /* ** Tokenizer callback used by implementation of highlight() function. */ static int fts5HighlightCb( void *pContext, /* Pointer to HighlightContext object */ int tflags, /* Mask of FTS5_TOKEN_* flags */ const char *pToken, /* Buffer containing token */ int nToken, /* Size of token in bytes */ int iStartOff, /* Start offset of token */ int iEndOff /* End offset of token */ ){ HighlightContext *p = (HighlightContext*)pContext; int rc = SQLITE_OK; int iPos; UNUSED_PARAM2(pToken, nToken); if( tflags & FTS5_TOKEN_COLOCATED ) return SQLITE_OK; iPos = p->iPos++; if( p->iRangeEnd>0 ){ if( iPosiRangeStart || iPos>p->iRangeEnd ) return SQLITE_OK; if( p->iRangeStart && iPos==p->iRangeStart ) p->iOff = iStartOff; } if( iPos==p->iter.iStart ){ fts5HighlightAppend(&rc, p, &p->zIn[p->iOff], iStartOff - p->iOff); fts5HighlightAppend(&rc, p, p->zOpen, -1); p->iOff = iStartOff; } if( iPos==p->iter.iEnd ){ if( p->iRangeEnd && p->iter.iStartiRangeStart ){ fts5HighlightAppend(&rc, p, p->zOpen, -1); } fts5HighlightAppend(&rc, p, &p->zIn[p->iOff], iEndOff - p->iOff); fts5HighlightAppend(&rc, p, p->zClose, -1); p->iOff = iEndOff; if( rc==SQLITE_OK ){ rc = fts5CInstIterNext(&p->iter); } } if( p->iRangeEnd>0 && iPos==p->iRangeEnd ){ fts5HighlightAppend(&rc, p, &p->zIn[p->iOff], iEndOff - p->iOff); p->iOff = iEndOff; if( iPos>=p->iter.iStart && iPositer.iEnd ){ fts5HighlightAppend(&rc, p, p->zClose, -1); } } return rc; } /* ** Implementation of highlight() function. */ static void fts5HighlightFunction( const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ Fts5Context *pFts, /* First arg to pass to pApi functions */ sqlite3_context *pCtx, /* Context for returning result/error */ int nVal, /* Number of values in apVal[] array */ sqlite3_value **apVal /* Array of trailing arguments */ ){ HighlightContext ctx; int rc; int iCol; if( nVal!=3 ){ const char *zErr = "wrong number of arguments to function highlight()"; sqlite3_result_error(pCtx, zErr, -1); return; } iCol = sqlite3_value_int(apVal[0]); memset(&ctx, 0, sizeof(HighlightContext)); ctx.zOpen = (const char*)sqlite3_value_text(apVal[1]); ctx.zClose = (const char*)sqlite3_value_text(apVal[2]); rc = pApi->xColumnText(pFts, iCol, &ctx.zIn, &ctx.nIn); if( ctx.zIn ){ if( rc==SQLITE_OK ){ rc = fts5CInstIterInit(pApi, pFts, iCol, &ctx.iter); } if( rc==SQLITE_OK ){ rc = pApi->xTokenize(pFts, ctx.zIn, ctx.nIn, (void*)&ctx,fts5HighlightCb); } fts5HighlightAppend(&rc, &ctx, &ctx.zIn[ctx.iOff], ctx.nIn - ctx.iOff); if( rc==SQLITE_OK ){ sqlite3_result_text(pCtx, (const char*)ctx.zOut, -1, SQLITE_TRANSIENT); } sqlite3_free(ctx.zOut); } if( rc!=SQLITE_OK ){ sqlite3_result_error_code(pCtx, rc); } } /* ** End of highlight() implementation. **************************************************************************/ /* ** Context object passed to the fts5SentenceFinderCb() function. */ typedef struct Fts5SFinder Fts5SFinder; struct Fts5SFinder { int iPos; /* Current token position */ int nFirstAlloc; /* Allocated size of aFirst[] */ int nFirst; /* Number of entries in aFirst[] */ int *aFirst; /* Array of first token in each sentence */ const char *zDoc; /* Document being tokenized */ }; /* ** Add an entry to the Fts5SFinder.aFirst[] array. Grow the array if ** necessary. Return SQLITE_OK if successful, or SQLITE_NOMEM if an ** error occurs. */ static int fts5SentenceFinderAdd(Fts5SFinder *p, int iAdd){ if( p->nFirstAlloc==p->nFirst ){ int nNew = p->nFirstAlloc ? p->nFirstAlloc*2 : 64; int *aNew; aNew = (int*)sqlite3_realloc(p->aFirst, nNew*sizeof(int)); if( aNew==0 ) return SQLITE_NOMEM; p->aFirst = aNew; p->nFirstAlloc = nNew; } p->aFirst[p->nFirst++] = iAdd; return SQLITE_OK; } /* ** This function is an xTokenize() callback used by the auxiliary snippet() ** function. Its job is to identify tokens that are the first in a sentence. ** For each such token, an entry is added to the SFinder.aFirst[] array. */ static int fts5SentenceFinderCb( void *pContext, /* Pointer to HighlightContext object */ int tflags, /* Mask of FTS5_TOKEN_* flags */ const char *pToken, /* Buffer containing token */ int nToken, /* Size of token in bytes */ int iStartOff, /* Start offset of token */ int iEndOff /* End offset of token */ ){ int rc = SQLITE_OK; UNUSED_PARAM2(pToken, nToken); UNUSED_PARAM(iEndOff); if( (tflags & FTS5_TOKEN_COLOCATED)==0 ){ Fts5SFinder *p = (Fts5SFinder*)pContext; if( p->iPos>0 ){ int i; char c = 0; for(i=iStartOff-1; i>=0; i--){ c = p->zDoc[i]; if( c!=' ' && c!='\t' && c!='\n' && c!='\r' ) break; } if( i!=iStartOff-1 && (c=='.' || c==':') ){ rc = fts5SentenceFinderAdd(p, p->iPos); } }else{ rc = fts5SentenceFinderAdd(p, 0); } p->iPos++; } return rc; } static int fts5SnippetScore( const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ Fts5Context *pFts, /* First arg to pass to pApi functions */ int nDocsize, /* Size of column in tokens */ unsigned char *aSeen, /* Array with one element per query phrase */ int iCol, /* Column to score */ int iPos, /* Starting offset to score */ int nToken, /* Max tokens per snippet */ int *pnScore, /* OUT: Score */ int *piPos /* OUT: Adjusted offset */ ){ int rc; int i; int ip = 0; int ic = 0; int iOff = 0; int iFirst = -1; int nInst; int nScore = 0; int iLast = 0; rc = pApi->xInstCount(pFts, &nInst); for(i=0; ixInst(pFts, i, &ip, &ic, &iOff); if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff<(iPos+nToken) ){ nScore += (aSeen[ip] ? 1 : 1000); aSeen[ip] = 1; if( iFirst<0 ) iFirst = iOff; iLast = iOff + pApi->xPhraseSize(pFts, ip); } } *pnScore = nScore; if( piPos ){ int iAdj = iFirst - (nToken - (iLast-iFirst)) / 2; if( (iAdj+nToken)>nDocsize ) iAdj = nDocsize - nToken; if( iAdj<0 ) iAdj = 0; *piPos = iAdj; } return rc; } /* ** Implementation of snippet() function. */ static void fts5SnippetFunction( const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ Fts5Context *pFts, /* First arg to pass to pApi functions */ sqlite3_context *pCtx, /* Context for returning result/error */ int nVal, /* Number of values in apVal[] array */ sqlite3_value **apVal /* Array of trailing arguments */ ){ HighlightContext ctx; int rc = SQLITE_OK; /* Return code */ int iCol; /* 1st argument to snippet() */ const char *zEllips; /* 4th argument to snippet() */ int nToken; /* 5th argument to snippet() */ int nInst = 0; /* Number of instance matches this row */ int i; /* Used to iterate through instances */ int nPhrase; /* Number of phrases in query */ unsigned char *aSeen; /* Array of "seen instance" flags */ int iBestCol; /* Column containing best snippet */ int iBestStart = 0; /* First token of best snippet */ int nBestScore = 0; /* Score of best snippet */ int nColSize = 0; /* Total size of iBestCol in tokens */ Fts5SFinder sFinder; /* Used to find the beginnings of sentences */ int nCol; if( nVal!=5 ){ const char *zErr = "wrong number of arguments to function snippet()"; sqlite3_result_error(pCtx, zErr, -1); return; } nCol = pApi->xColumnCount(pFts); memset(&ctx, 0, sizeof(HighlightContext)); iCol = sqlite3_value_int(apVal[0]); ctx.zOpen = (const char*)sqlite3_value_text(apVal[1]); ctx.zClose = (const char*)sqlite3_value_text(apVal[2]); zEllips = (const char*)sqlite3_value_text(apVal[3]); nToken = sqlite3_value_int(apVal[4]); iBestCol = (iCol>=0 ? iCol : 0); nPhrase = pApi->xPhraseCount(pFts); aSeen = sqlite3_malloc(nPhrase); if( aSeen==0 ){ rc = SQLITE_NOMEM; } if( rc==SQLITE_OK ){ rc = pApi->xInstCount(pFts, &nInst); } memset(&sFinder, 0, sizeof(Fts5SFinder)); for(i=0; ixColumnText(pFts, i, &sFinder.zDoc, &nDoc); if( rc!=SQLITE_OK ) break; rc = pApi->xTokenize(pFts, sFinder.zDoc, nDoc, (void*)&sFinder,fts5SentenceFinderCb ); if( rc!=SQLITE_OK ) break; rc = pApi->xColumnSize(pFts, i, &nDocsize); if( rc!=SQLITE_OK ) break; for(ii=0; rc==SQLITE_OK && iixInst(pFts, ii, &ip, &ic, &io); if( ic!=i || rc!=SQLITE_OK ) continue; memset(aSeen, 0, nPhrase); rc = fts5SnippetScore(pApi, pFts, nDocsize, aSeen, i, io, nToken, &nScore, &iAdj ); if( rc==SQLITE_OK && nScore>nBestScore ){ nBestScore = nScore; iBestCol = i; iBestStart = iAdj; nColSize = nDocsize; } if( rc==SQLITE_OK && sFinder.nFirst && nDocsize>nToken ){ for(jj=0; jj<(sFinder.nFirst-1); jj++){ if( sFinder.aFirst[jj+1]>io ) break; } if( sFinder.aFirst[jj]nBestScore ){ nBestScore = nScore; iBestCol = i; iBestStart = sFinder.aFirst[jj]; nColSize = nDocsize; } } } } } } if( rc==SQLITE_OK ){ rc = pApi->xColumnText(pFts, iBestCol, &ctx.zIn, &ctx.nIn); } if( rc==SQLITE_OK && nColSize==0 ){ rc = pApi->xColumnSize(pFts, iBestCol, &nColSize); } if( ctx.zIn ){ if( rc==SQLITE_OK ){ rc = fts5CInstIterInit(pApi, pFts, iBestCol, &ctx.iter); } ctx.iRangeStart = iBestStart; ctx.iRangeEnd = iBestStart + nToken - 1; if( iBestStart>0 ){ fts5HighlightAppend(&rc, &ctx, zEllips, -1); } /* Advance iterator ctx.iter so that it points to the first coalesced ** phrase instance at or following position iBestStart. */ while( ctx.iter.iStart>=0 && ctx.iter.iStartxTokenize(pFts, ctx.zIn, ctx.nIn, (void*)&ctx,fts5HighlightCb); } if( ctx.iRangeEnd>=(nColSize-1) ){ fts5HighlightAppend(&rc, &ctx, &ctx.zIn[ctx.iOff], ctx.nIn - ctx.iOff); }else{ fts5HighlightAppend(&rc, &ctx, zEllips, -1); } } if( rc==SQLITE_OK ){ sqlite3_result_text(pCtx, (const char*)ctx.zOut, -1, SQLITE_TRANSIENT); }else{ sqlite3_result_error_code(pCtx, rc); } sqlite3_free(ctx.zOut); sqlite3_free(aSeen); sqlite3_free(sFinder.aFirst); } /************************************************************************/ /* ** The first time the bm25() function is called for a query, an instance ** of the following structure is allocated and populated. */ typedef struct Fts5Bm25Data Fts5Bm25Data; struct Fts5Bm25Data { int nPhrase; /* Number of phrases in query */ double avgdl; /* Average number of tokens in each row */ double *aIDF; /* IDF for each phrase */ double *aFreq; /* Array used to calculate phrase freq. */ }; /* ** Callback used by fts5Bm25GetData() to count the number of rows in the ** table matched by each individual phrase within the query. */ static int fts5CountCb( const Fts5ExtensionApi *pApi, Fts5Context *pFts, void *pUserData /* Pointer to sqlite3_int64 variable */ ){ sqlite3_int64 *pn = (sqlite3_int64*)pUserData; UNUSED_PARAM2(pApi, pFts); (*pn)++; return SQLITE_OK; } /* ** Set *ppData to point to the Fts5Bm25Data object for the current query. ** If the object has not already been allocated, allocate and populate it ** now. */ static int fts5Bm25GetData( const Fts5ExtensionApi *pApi, Fts5Context *pFts, Fts5Bm25Data **ppData /* OUT: bm25-data object for this query */ ){ int rc = SQLITE_OK; /* Return code */ Fts5Bm25Data *p; /* Object to return */ p = pApi->xGetAuxdata(pFts, 0); if( p==0 ){ int nPhrase; /* Number of phrases in query */ sqlite3_int64 nRow = 0; /* Number of rows in table */ sqlite3_int64 nToken = 0; /* Number of tokens in table */ int nByte; /* Bytes of space to allocate */ int i; /* Allocate the Fts5Bm25Data object */ nPhrase = pApi->xPhraseCount(pFts); nByte = sizeof(Fts5Bm25Data) + nPhrase*2*sizeof(double); p = (Fts5Bm25Data*)sqlite3_malloc(nByte); if( p==0 ){ rc = SQLITE_NOMEM; }else{ memset(p, 0, nByte); p->nPhrase = nPhrase; p->aIDF = (double*)&p[1]; p->aFreq = &p->aIDF[nPhrase]; } /* Calculate the average document length for this FTS5 table */ if( rc==SQLITE_OK ) rc = pApi->xRowCount(pFts, &nRow); if( rc==SQLITE_OK ) rc = pApi->xColumnTotalSize(pFts, -1, &nToken); if( rc==SQLITE_OK ) p->avgdl = (double)nToken / (double)nRow; /* Calculate an IDF for each phrase in the query */ for(i=0; rc==SQLITE_OK && ixQueryPhrase(pFts, i, (void*)&nHit, fts5CountCb); if( rc==SQLITE_OK ){ /* Calculate the IDF (Inverse Document Frequency) for phrase i. ** This is done using the standard BM25 formula as found on wikipedia: ** ** IDF = log( (N - nHit + 0.5) / (nHit + 0.5) ) ** ** where "N" is the total number of documents in the set and nHit ** is the number that contain at least one instance of the phrase ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is ** negative. Which is undesirable. So the mimimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ double idf = log( (nRow - nHit + 0.5) / (nHit + 0.5) ); if( idf<=0.0 ) idf = 1e-6; p->aIDF[i] = idf; } } if( rc!=SQLITE_OK ){ sqlite3_free(p); }else{ rc = pApi->xSetAuxdata(pFts, p, sqlite3_free); } if( rc!=SQLITE_OK ) p = 0; } *ppData = p; return rc; } /* ** Implementation of bm25() function. */ static void fts5Bm25Function( const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ Fts5Context *pFts, /* First arg to pass to pApi functions */ sqlite3_context *pCtx, /* Context for returning result/error */ int nVal, /* Number of values in apVal[] array */ sqlite3_value **apVal /* Array of trailing arguments */ ){ const double k1 = 1.2; /* Constant "k1" from BM25 formula */ const double b = 0.75; /* Constant "b" from BM25 formula */ int rc = SQLITE_OK; /* Error code */ double score = 0.0; /* SQL function return value */ Fts5Bm25Data *pData; /* Values allocated/calculated once only */ int i; /* Iterator variable */ int nInst = 0; /* Value returned by xInstCount() */ double D = 0.0; /* Total number of tokens in row */ double *aFreq = 0; /* Array of phrase freq. for current row */ /* Calculate the phrase frequency (symbol "f(qi,D)" in the documentation) ** for each phrase in the query for the current row. */ rc = fts5Bm25GetData(pApi, pFts, &pData); if( rc==SQLITE_OK ){ aFreq = pData->aFreq; memset(aFreq, 0, sizeof(double) * pData->nPhrase); rc = pApi->xInstCount(pFts, &nInst); } for(i=0; rc==SQLITE_OK && ixInst(pFts, i, &ip, &ic, &io); if( rc==SQLITE_OK ){ double w = (nVal > ic) ? sqlite3_value_double(apVal[ic]) : 1.0; aFreq[ip] += w; } } /* Figure out the total size of the current row in tokens. */ if( rc==SQLITE_OK ){ int nTok; rc = pApi->xColumnSize(pFts, -1, &nTok); D = (double)nTok; } /* Determine the BM25 score for the current row. */ for(i=0; rc==SQLITE_OK && inPhrase; i++){ score += pData->aIDF[i] * ( ( aFreq[i] * (k1 + 1.0) ) / ( aFreq[i] + k1 * (1 - b + b * D / pData->avgdl) ) ); } /* If no error has occurred, return the calculated score. Otherwise, ** throw an SQL exception. */ if( rc==SQLITE_OK ){ sqlite3_result_double(pCtx, -1.0 * score); }else{ sqlite3_result_error_code(pCtx, rc); } } int sqlite3Fts5AuxInit(fts5_api *pApi){ struct Builtin { const char *zFunc; /* Function name (nul-terminated) */ void *pUserData; /* User-data pointer */ fts5_extension_function xFunc;/* Callback function */ void (*xDestroy)(void*); /* Destructor function */ } aBuiltin [] = { { "snippet", 0, fts5SnippetFunction, 0 }, { "highlight", 0, fts5HighlightFunction, 0 }, { "bm25", 0, fts5Bm25Function, 0 }, }; int rc = SQLITE_OK; /* Return code */ int i; /* To iterate through builtin functions */ for(i=0; rc==SQLITE_OK && ixCreateFunction(pApi, aBuiltin[i].zFunc, aBuiltin[i].pUserData, aBuiltin[i].xFunc, aBuiltin[i].xDestroy ); } return rc; } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_buffer.c ================================================ /* ** 2014 May 31 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** */ #include "fts5Int.h" int sqlite3Fts5BufferSize(int *pRc, Fts5Buffer *pBuf, u32 nByte){ if( (u32)pBuf->nSpacenSpace ? pBuf->nSpace : 64; u8 *pNew; while( nNewp, nNew); if( pNew==0 ){ *pRc = SQLITE_NOMEM; return 1; }else{ pBuf->nSpace = nNew; pBuf->p = pNew; } } return 0; } /* ** Encode value iVal as an SQLite varint and append it to the buffer object ** pBuf. If an OOM error occurs, set the error code in p. */ void sqlite3Fts5BufferAppendVarint(int *pRc, Fts5Buffer *pBuf, i64 iVal){ if( fts5BufferGrow(pRc, pBuf, 9) ) return; pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], iVal); } void sqlite3Fts5Put32(u8 *aBuf, int iVal){ aBuf[0] = (iVal>>24) & 0x00FF; aBuf[1] = (iVal>>16) & 0x00FF; aBuf[2] = (iVal>> 8) & 0x00FF; aBuf[3] = (iVal>> 0) & 0x00FF; } int sqlite3Fts5Get32(const u8 *aBuf){ return (aBuf[0] << 24) + (aBuf[1] << 16) + (aBuf[2] << 8) + aBuf[3]; } /* ** Append buffer nData/pData to buffer pBuf. If an OOM error occurs, set ** the error code in p. If an error has already occurred when this function ** is called, it is a no-op. */ void sqlite3Fts5BufferAppendBlob( int *pRc, Fts5Buffer *pBuf, u32 nData, const u8 *pData ){ assert_nc( *pRc || nData>=0 ); if( nData ){ if( fts5BufferGrow(pRc, pBuf, nData) ) return; memcpy(&pBuf->p[pBuf->n], pData, nData); pBuf->n += nData; } } /* ** Append the nul-terminated string zStr to the buffer pBuf. This function ** ensures that the byte following the buffer data is set to 0x00, even ** though this byte is not included in the pBuf->n count. */ void sqlite3Fts5BufferAppendString( int *pRc, Fts5Buffer *pBuf, const char *zStr ){ int nStr = (int)strlen(zStr); sqlite3Fts5BufferAppendBlob(pRc, pBuf, nStr+1, (const u8*)zStr); pBuf->n--; } /* ** Argument zFmt is a printf() style format string. This function performs ** the printf() style processing, then appends the results to buffer pBuf. ** ** Like sqlite3Fts5BufferAppendString(), this function ensures that the byte ** following the buffer data is set to 0x00, even though this byte is not ** included in the pBuf->n count. */ void sqlite3Fts5BufferAppendPrintf( int *pRc, Fts5Buffer *pBuf, char *zFmt, ... ){ if( *pRc==SQLITE_OK ){ char *zTmp; va_list ap; va_start(ap, zFmt); zTmp = sqlite3_vmprintf(zFmt, ap); va_end(ap); if( zTmp==0 ){ *pRc = SQLITE_NOMEM; }else{ sqlite3Fts5BufferAppendString(pRc, pBuf, zTmp); sqlite3_free(zTmp); } } } char *sqlite3Fts5Mprintf(int *pRc, const char *zFmt, ...){ char *zRet = 0; if( *pRc==SQLITE_OK ){ va_list ap; va_start(ap, zFmt); zRet = sqlite3_vmprintf(zFmt, ap); va_end(ap); if( zRet==0 ){ *pRc = SQLITE_NOMEM; } } return zRet; } /* ** Free any buffer allocated by pBuf. Zero the structure before returning. */ void sqlite3Fts5BufferFree(Fts5Buffer *pBuf){ sqlite3_free(pBuf->p); memset(pBuf, 0, sizeof(Fts5Buffer)); } /* ** Zero the contents of the buffer object. But do not free the associated ** memory allocation. */ void sqlite3Fts5BufferZero(Fts5Buffer *pBuf){ pBuf->n = 0; } /* ** Set the buffer to contain nData/pData. If an OOM error occurs, leave an ** the error code in p. If an error has already occurred when this function ** is called, it is a no-op. */ void sqlite3Fts5BufferSet( int *pRc, Fts5Buffer *pBuf, int nData, const u8 *pData ){ pBuf->n = 0; sqlite3Fts5BufferAppendBlob(pRc, pBuf, nData, pData); } int sqlite3Fts5PoslistNext64( const u8 *a, int n, /* Buffer containing poslist */ int *pi, /* IN/OUT: Offset within a[] */ i64 *piOff /* IN/OUT: Current offset */ ){ int i = *pi; if( i>=n ){ /* EOF */ *piOff = -1; return 1; }else{ i64 iOff = *piOff; int iVal; fts5FastGetVarint32(a, i, iVal); if( iVal==1 ){ fts5FastGetVarint32(a, i, iVal); iOff = ((i64)iVal) << 32; fts5FastGetVarint32(a, i, iVal); } *piOff = iOff + (iVal-2); *pi = i; return 0; } } /* ** Advance the iterator object passed as the only argument. Return true ** if the iterator reaches EOF, or false otherwise. */ int sqlite3Fts5PoslistReaderNext(Fts5PoslistReader *pIter){ if( sqlite3Fts5PoslistNext64(pIter->a, pIter->n, &pIter->i, &pIter->iPos) ){ pIter->bEof = 1; } return pIter->bEof; } int sqlite3Fts5PoslistReaderInit( const u8 *a, int n, /* Poslist buffer to iterate through */ Fts5PoslistReader *pIter /* Iterator object to initialize */ ){ memset(pIter, 0, sizeof(*pIter)); pIter->a = a; pIter->n = n; sqlite3Fts5PoslistReaderNext(pIter); return pIter->bEof; } /* ** Append position iPos to the position list being accumulated in buffer ** pBuf, which must be already be large enough to hold the new data. ** The previous position written to this list is *piPrev. *piPrev is set ** to iPos before returning. */ void sqlite3Fts5PoslistSafeAppend( Fts5Buffer *pBuf, i64 *piPrev, i64 iPos ){ static const i64 colmask = ((i64)(0x7FFFFFFF)) << 32; if( (iPos & colmask) != (*piPrev & colmask) ){ pBuf->p[pBuf->n++] = 1; pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], (iPos>>32)); *piPrev = (iPos & colmask); } pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], (iPos-*piPrev)+2); *piPrev = iPos; } int sqlite3Fts5PoslistWriterAppend( Fts5Buffer *pBuf, Fts5PoslistWriter *pWriter, i64 iPos ){ int rc = 0; /* Initialized only to suppress erroneous warning from Clang */ if( fts5BufferGrow(&rc, pBuf, 5+5+5) ) return rc; sqlite3Fts5PoslistSafeAppend(pBuf, &pWriter->iPrev, iPos); return SQLITE_OK; } void *sqlite3Fts5MallocZero(int *pRc, int nByte){ void *pRet = 0; if( *pRc==SQLITE_OK ){ pRet = sqlite3_malloc(nByte); if( pRet==0 ){ if( nByte>0 ) *pRc = SQLITE_NOMEM; }else{ memset(pRet, 0, nByte); } } return pRet; } /* ** Return a nul-terminated copy of the string indicated by pIn. If nIn ** is non-negative, then it is the length of the string in bytes. Otherwise, ** the length of the string is determined using strlen(). ** ** It is the responsibility of the caller to eventually free the returned ** buffer using sqlite3_free(). If an OOM error occurs, NULL is returned. */ char *sqlite3Fts5Strndup(int *pRc, const char *pIn, int nIn){ char *zRet = 0; if( *pRc==SQLITE_OK ){ if( nIn<0 ){ nIn = (int)strlen(pIn); } zRet = (char*)sqlite3_malloc(nIn+1); if( zRet ){ memcpy(zRet, pIn, nIn); zRet[nIn] = '\0'; }else{ *pRc = SQLITE_NOMEM; } } return zRet; } /* ** Return true if character 't' may be part of an FTS5 bareword, or false ** otherwise. Characters that may be part of barewords: ** ** * All non-ASCII characters, ** * The 52 upper and lower case ASCII characters, and ** * The 10 integer ASCII characters. ** * The underscore character "_" (0x5F). ** * The unicode "subsitute" character (0x1A). */ int sqlite3Fts5IsBareword(char t){ u8 aBareword[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 .. 0x0F */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, /* 0x10 .. 0x1F */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 .. 0x2F */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 0x30 .. 0x3F */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x40 .. 0x4F */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 0x50 .. 0x5F */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x60 .. 0x6F */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 /* 0x70 .. 0x7F */ }; return (t & 0x80) || aBareword[(int)t]; } /************************************************************************* */ typedef struct Fts5TermsetEntry Fts5TermsetEntry; struct Fts5TermsetEntry { char *pTerm; int nTerm; int iIdx; /* Index (main or aPrefix[] entry) */ Fts5TermsetEntry *pNext; }; struct Fts5Termset { Fts5TermsetEntry *apHash[512]; }; int sqlite3Fts5TermsetNew(Fts5Termset **pp){ int rc = SQLITE_OK; *pp = sqlite3Fts5MallocZero(&rc, sizeof(Fts5Termset)); return rc; } int sqlite3Fts5TermsetAdd( Fts5Termset *p, int iIdx, const char *pTerm, int nTerm, int *pbPresent ){ int rc = SQLITE_OK; *pbPresent = 0; if( p ){ int i; u32 hash = 13; Fts5TermsetEntry *pEntry; /* Calculate a hash value for this term. This is the same hash checksum ** used by the fts5_hash.c module. This is not important for correct ** operation of the module, but is necessary to ensure that some tests ** designed to produce hash table collisions really do work. */ for(i=nTerm-1; i>=0; i--){ hash = (hash << 3) ^ hash ^ pTerm[i]; } hash = (hash << 3) ^ hash ^ iIdx; hash = hash % ArraySize(p->apHash); for(pEntry=p->apHash[hash]; pEntry; pEntry=pEntry->pNext){ if( pEntry->iIdx==iIdx && pEntry->nTerm==nTerm && memcmp(pEntry->pTerm, pTerm, nTerm)==0 ){ *pbPresent = 1; break; } } if( pEntry==0 ){ pEntry = sqlite3Fts5MallocZero(&rc, sizeof(Fts5TermsetEntry) + nTerm); if( pEntry ){ pEntry->pTerm = (char*)&pEntry[1]; pEntry->nTerm = nTerm; pEntry->iIdx = iIdx; memcpy(pEntry->pTerm, pTerm, nTerm); pEntry->pNext = p->apHash[hash]; p->apHash[hash] = pEntry; } } } return rc; } void sqlite3Fts5TermsetFree(Fts5Termset *p){ if( p ){ u32 i; for(i=0; iapHash); i++){ Fts5TermsetEntry *pEntry = p->apHash[i]; while( pEntry ){ Fts5TermsetEntry *pDel = pEntry; pEntry = pEntry->pNext; sqlite3_free(pDel); } } sqlite3_free(p); } } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_config.c ================================================ /* ** 2014 Jun 09 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This is an SQLite module implementing full-text search. */ #include "fts5Int.h" #define FTS5_DEFAULT_PAGE_SIZE 4050 #define FTS5_DEFAULT_AUTOMERGE 4 #define FTS5_DEFAULT_USERMERGE 4 #define FTS5_DEFAULT_CRISISMERGE 16 #define FTS5_DEFAULT_HASHSIZE (1024*1024) /* Maximum allowed page size */ #define FTS5_MAX_PAGE_SIZE (128*1024) static int fts5_iswhitespace(char x){ return (x==' '); } static int fts5_isopenquote(char x){ return (x=='"' || x=='\'' || x=='[' || x=='`'); } /* ** Argument pIn points to a character that is part of a nul-terminated ** string. Return a pointer to the first character following *pIn in ** the string that is not a white-space character. */ static const char *fts5ConfigSkipWhitespace(const char *pIn){ const char *p = pIn; if( p ){ while( fts5_iswhitespace(*p) ){ p++; } } return p; } /* ** Argument pIn points to a character that is part of a nul-terminated ** string. Return a pointer to the first character following *pIn in ** the string that is not a "bareword" character. */ static const char *fts5ConfigSkipBareword(const char *pIn){ const char *p = pIn; while ( sqlite3Fts5IsBareword(*p) ) p++; if( p==pIn ) p = 0; return p; } static int fts5_isdigit(char a){ return (a>='0' && a<='9'); } static const char *fts5ConfigSkipLiteral(const char *pIn){ const char *p = pIn; switch( *p ){ case 'n': case 'N': if( sqlite3_strnicmp("null", p, 4)==0 ){ p = &p[4]; }else{ p = 0; } break; case 'x': case 'X': p++; if( *p=='\'' ){ p++; while( (*p>='a' && *p<='f') || (*p>='A' && *p<='F') || (*p>='0' && *p<='9') ){ p++; } if( *p=='\'' && 0==((p-pIn)%2) ){ p++; }else{ p = 0; } }else{ p = 0; } break; case '\'': p++; while( p ){ if( *p=='\'' ){ p++; if( *p!='\'' ) break; } p++; if( *p==0 ) p = 0; } break; default: /* maybe a number */ if( *p=='+' || *p=='-' ) p++; while( fts5_isdigit(*p) ) p++; /* At this point, if the literal was an integer, the parse is ** finished. Or, if it is a floating point value, it may continue ** with either a decimal point or an 'E' character. */ if( *p=='.' && fts5_isdigit(p[1]) ){ p += 2; while( fts5_isdigit(*p) ) p++; } if( p==pIn ) p = 0; break; } return p; } /* ** The first character of the string pointed to by argument z is guaranteed ** to be an open-quote character (see function fts5_isopenquote()). ** ** This function searches for the corresponding close-quote character within ** the string and, if found, dequotes the string in place and adds a new ** nul-terminator byte. ** ** If the close-quote is found, the value returned is the byte offset of ** the character immediately following it. Or, if the close-quote is not ** found, -1 is returned. If -1 is returned, the buffer is left in an ** undefined state. */ static int fts5Dequote(char *z){ char q; int iIn = 1; int iOut = 0; q = z[0]; /* Set stack variable q to the close-quote character */ assert( q=='[' || q=='\'' || q=='"' || q=='`' ); if( q=='[' ) q = ']'; while( ALWAYS(z[iIn]) ){ if( z[iIn]==q ){ if( z[iIn+1]!=q ){ /* Character iIn was the close quote. */ iIn++; break; }else{ /* Character iIn and iIn+1 form an escaped quote character. Skip ** the input cursor past both and copy a single quote character ** to the output buffer. */ iIn += 2; z[iOut++] = q; } }else{ z[iOut++] = z[iIn++]; } } z[iOut] = '\0'; return iIn; } /* ** Convert an SQL-style quoted string into a normal string by removing ** the quote characters. The conversion is done in-place. If the ** input does not begin with a quote character, then this routine ** is a no-op. ** ** Examples: ** ** "abc" becomes abc ** 'xyz' becomes xyz ** [pqr] becomes pqr ** `mno` becomes mno */ void sqlite3Fts5Dequote(char *z){ char quote; /* Quote character (if any ) */ assert( 0==fts5_iswhitespace(z[0]) ); quote = z[0]; if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){ fts5Dequote(z); } } struct Fts5Enum { const char *zName; int eVal; }; typedef struct Fts5Enum Fts5Enum; static int fts5ConfigSetEnum( const Fts5Enum *aEnum, const char *zEnum, int *peVal ){ int nEnum = (int)strlen(zEnum); int i; int iVal = -1; for(i=0; aEnum[i].zName; i++){ if( sqlite3_strnicmp(aEnum[i].zName, zEnum, nEnum)==0 ){ if( iVal>=0 ) return SQLITE_ERROR; iVal = aEnum[i].eVal; } } *peVal = iVal; return iVal<0 ? SQLITE_ERROR : SQLITE_OK; } /* ** Parse a "special" CREATE VIRTUAL TABLE directive and update ** configuration object pConfig as appropriate. ** ** If successful, object pConfig is updated and SQLITE_OK returned. If ** an error occurs, an SQLite error code is returned and an error message ** may be left in *pzErr. It is the responsibility of the caller to ** eventually free any such error message using sqlite3_free(). */ static int fts5ConfigParseSpecial( Fts5Global *pGlobal, Fts5Config *pConfig, /* Configuration object to update */ const char *zCmd, /* Special command to parse */ const char *zArg, /* Argument to parse */ char **pzErr /* OUT: Error message */ ){ int rc = SQLITE_OK; int nCmd = (int)strlen(zCmd); if( sqlite3_strnicmp("prefix", zCmd, nCmd)==0 ){ const int nByte = sizeof(int) * FTS5_MAX_PREFIX_INDEXES; const char *p; int bFirst = 1; if( pConfig->aPrefix==0 ){ pConfig->aPrefix = sqlite3Fts5MallocZero(&rc, nByte); if( rc ) return rc; } p = zArg; while( 1 ){ int nPre = 0; while( p[0]==' ' ) p++; if( bFirst==0 && p[0]==',' ){ p++; while( p[0]==' ' ) p++; }else if( p[0]=='\0' ){ break; } if( p[0]<'0' || p[0]>'9' ){ *pzErr = sqlite3_mprintf("malformed prefix=... directive"); rc = SQLITE_ERROR; break; } if( pConfig->nPrefix==FTS5_MAX_PREFIX_INDEXES ){ *pzErr = sqlite3_mprintf( "too many prefix indexes (max %d)", FTS5_MAX_PREFIX_INDEXES ); rc = SQLITE_ERROR; break; } while( p[0]>='0' && p[0]<='9' && nPre<1000 ){ nPre = nPre*10 + (p[0] - '0'); p++; } if( nPre<=0 || nPre>=1000 ){ *pzErr = sqlite3_mprintf("prefix length out of range (max 999)"); rc = SQLITE_ERROR; break; } pConfig->aPrefix[pConfig->nPrefix] = nPre; pConfig->nPrefix++; bFirst = 0; } assert( pConfig->nPrefix<=FTS5_MAX_PREFIX_INDEXES ); return rc; } if( sqlite3_strnicmp("tokenize", zCmd, nCmd)==0 ){ const char *p = (const char*)zArg; int nArg = (int)strlen(zArg) + 1; char **azArg = sqlite3Fts5MallocZero(&rc, sizeof(char*) * nArg); char *pDel = sqlite3Fts5MallocZero(&rc, nArg * 2); char *pSpace = pDel; if( azArg && pSpace ){ if( pConfig->pTok ){ *pzErr = sqlite3_mprintf("multiple tokenize=... directives"); rc = SQLITE_ERROR; }else{ for(nArg=0; p && *p; nArg++){ const char *p2 = fts5ConfigSkipWhitespace(p); if( *p2=='\'' ){ p = fts5ConfigSkipLiteral(p2); }else{ p = fts5ConfigSkipBareword(p2); } if( p ){ memcpy(pSpace, p2, p-p2); azArg[nArg] = pSpace; sqlite3Fts5Dequote(pSpace); pSpace += (p - p2) + 1; p = fts5ConfigSkipWhitespace(p); } } if( p==0 ){ *pzErr = sqlite3_mprintf("parse error in tokenize directive"); rc = SQLITE_ERROR; }else{ rc = sqlite3Fts5GetTokenizer(pGlobal, (const char**)azArg, nArg, &pConfig->pTok, &pConfig->pTokApi, pzErr ); } } } sqlite3_free(azArg); sqlite3_free(pDel); return rc; } if( sqlite3_strnicmp("content", zCmd, nCmd)==0 ){ if( pConfig->eContent!=FTS5_CONTENT_NORMAL ){ *pzErr = sqlite3_mprintf("multiple content=... directives"); rc = SQLITE_ERROR; }else{ if( zArg[0] ){ pConfig->eContent = FTS5_CONTENT_EXTERNAL; pConfig->zContent = sqlite3Fts5Mprintf(&rc, "%Q.%Q", pConfig->zDb,zArg); }else{ pConfig->eContent = FTS5_CONTENT_NONE; } } return rc; } if( sqlite3_strnicmp("content_rowid", zCmd, nCmd)==0 ){ if( pConfig->zContentRowid ){ *pzErr = sqlite3_mprintf("multiple content_rowid=... directives"); rc = SQLITE_ERROR; }else{ pConfig->zContentRowid = sqlite3Fts5Strndup(&rc, zArg, -1); } return rc; } if( sqlite3_strnicmp("columnsize", zCmd, nCmd)==0 ){ if( (zArg[0]!='0' && zArg[0]!='1') || zArg[1]!='\0' ){ *pzErr = sqlite3_mprintf("malformed columnsize=... directive"); rc = SQLITE_ERROR; }else{ pConfig->bColumnsize = (zArg[0]=='1'); } return rc; } if( sqlite3_strnicmp("detail", zCmd, nCmd)==0 ){ const Fts5Enum aDetail[] = { { "none", FTS5_DETAIL_NONE }, { "full", FTS5_DETAIL_FULL }, { "columns", FTS5_DETAIL_COLUMNS }, { 0, 0 } }; if( (rc = fts5ConfigSetEnum(aDetail, zArg, &pConfig->eDetail)) ){ *pzErr = sqlite3_mprintf("malformed detail=... directive"); } return rc; } *pzErr = sqlite3_mprintf("unrecognized option: \"%.*s\"", nCmd, zCmd); return SQLITE_ERROR; } /* ** Allocate an instance of the default tokenizer ("simple") at ** Fts5Config.pTokenizer. Return SQLITE_OK if successful, or an SQLite error ** code if an error occurs. */ static int fts5ConfigDefaultTokenizer(Fts5Global *pGlobal, Fts5Config *pConfig){ assert( pConfig->pTok==0 && pConfig->pTokApi==0 ); return sqlite3Fts5GetTokenizer( pGlobal, 0, 0, &pConfig->pTok, &pConfig->pTokApi, 0 ); } /* ** Gobble up the first bareword or quoted word from the input buffer zIn. ** Return a pointer to the character immediately following the last in ** the gobbled word if successful, or a NULL pointer otherwise (failed ** to find close-quote character). ** ** Before returning, set pzOut to point to a new buffer containing a ** nul-terminated, dequoted copy of the gobbled word. If the word was ** quoted, *pbQuoted is also set to 1 before returning. ** ** If *pRc is other than SQLITE_OK when this function is called, it is ** a no-op (NULL is returned). Otherwise, if an OOM occurs within this ** function, *pRc is set to SQLITE_NOMEM before returning. *pRc is *not* ** set if a parse error (failed to find close quote) occurs. */ static const char *fts5ConfigGobbleWord( int *pRc, /* IN/OUT: Error code */ const char *zIn, /* Buffer to gobble string/bareword from */ char **pzOut, /* OUT: malloc'd buffer containing str/bw */ int *pbQuoted /* OUT: Set to true if dequoting required */ ){ const char *zRet = 0; int nIn = (int)strlen(zIn); char *zOut = sqlite3_malloc(nIn+1); assert( *pRc==SQLITE_OK ); *pbQuoted = 0; *pzOut = 0; if( zOut==0 ){ *pRc = SQLITE_NOMEM; }else{ memcpy(zOut, zIn, nIn+1); if( fts5_isopenquote(zOut[0]) ){ int ii = fts5Dequote(zOut); zRet = &zIn[ii]; *pbQuoted = 1; }else{ zRet = fts5ConfigSkipBareword(zIn); if( zRet ){ zOut[zRet-zIn] = '\0'; } } } if( zRet==0 ){ sqlite3_free(zOut); }else{ *pzOut = zOut; } return zRet; } static int fts5ConfigParseColumn( Fts5Config *p, char *zCol, char *zArg, char **pzErr ){ int rc = SQLITE_OK; if( 0==sqlite3_stricmp(zCol, FTS5_RANK_NAME) || 0==sqlite3_stricmp(zCol, FTS5_ROWID_NAME) ){ *pzErr = sqlite3_mprintf("reserved fts5 column name: %s", zCol); rc = SQLITE_ERROR; }else if( zArg ){ if( 0==sqlite3_stricmp(zArg, "unindexed") ){ p->abUnindexed[p->nCol] = 1; }else{ *pzErr = sqlite3_mprintf("unrecognized column option: %s", zArg); rc = SQLITE_ERROR; } } p->azCol[p->nCol++] = zCol; return rc; } /* ** Populate the Fts5Config.zContentExprlist string. */ static int fts5ConfigMakeExprlist(Fts5Config *p){ int i; int rc = SQLITE_OK; Fts5Buffer buf = {0, 0, 0}; sqlite3Fts5BufferAppendPrintf(&rc, &buf, "T.%Q", p->zContentRowid); if( p->eContent!=FTS5_CONTENT_NONE ){ for(i=0; inCol; i++){ if( p->eContent==FTS5_CONTENT_EXTERNAL ){ sqlite3Fts5BufferAppendPrintf(&rc, &buf, ", T.%Q", p->azCol[i]); }else{ sqlite3Fts5BufferAppendPrintf(&rc, &buf, ", T.c%d", i); } } } assert( p->zContentExprlist==0 ); p->zContentExprlist = (char*)buf.p; return rc; } /* ** Arguments nArg/azArg contain the string arguments passed to the xCreate ** or xConnect method of the virtual table. This function attempts to ** allocate an instance of Fts5Config containing the results of parsing ** those arguments. ** ** If successful, SQLITE_OK is returned and *ppOut is set to point to the ** new Fts5Config object. If an error occurs, an SQLite error code is ** returned, *ppOut is set to NULL and an error message may be left in ** *pzErr. It is the responsibility of the caller to eventually free any ** such error message using sqlite3_free(). */ int sqlite3Fts5ConfigParse( Fts5Global *pGlobal, sqlite3 *db, int nArg, /* Number of arguments */ const char **azArg, /* Array of nArg CREATE VIRTUAL TABLE args */ Fts5Config **ppOut, /* OUT: Results of parse */ char **pzErr /* OUT: Error message */ ){ int rc = SQLITE_OK; /* Return code */ Fts5Config *pRet; /* New object to return */ int i; int nByte; *ppOut = pRet = (Fts5Config*)sqlite3_malloc(sizeof(Fts5Config)); if( pRet==0 ) return SQLITE_NOMEM; memset(pRet, 0, sizeof(Fts5Config)); pRet->db = db; pRet->iCookie = -1; nByte = nArg * (sizeof(char*) + sizeof(u8)); pRet->azCol = (char**)sqlite3Fts5MallocZero(&rc, nByte); pRet->abUnindexed = (u8*)&pRet->azCol[nArg]; pRet->zDb = sqlite3Fts5Strndup(&rc, azArg[1], -1); pRet->zName = sqlite3Fts5Strndup(&rc, azArg[2], -1); pRet->bColumnsize = 1; pRet->eDetail = FTS5_DETAIL_FULL; #ifdef SQLITE_DEBUG pRet->bPrefixIndex = 1; #endif if( rc==SQLITE_OK && sqlite3_stricmp(pRet->zName, FTS5_RANK_NAME)==0 ){ *pzErr = sqlite3_mprintf("reserved fts5 table name: %s", pRet->zName); rc = SQLITE_ERROR; } for(i=3; rc==SQLITE_OK && ipTok==0 ){ rc = fts5ConfigDefaultTokenizer(pGlobal, pRet); } /* If no zContent option was specified, fill in the default values. */ if( rc==SQLITE_OK && pRet->zContent==0 ){ const char *zTail = 0; assert( pRet->eContent==FTS5_CONTENT_NORMAL || pRet->eContent==FTS5_CONTENT_NONE ); if( pRet->eContent==FTS5_CONTENT_NORMAL ){ zTail = "content"; }else if( pRet->bColumnsize ){ zTail = "docsize"; } if( zTail ){ pRet->zContent = sqlite3Fts5Mprintf( &rc, "%Q.'%q_%s'", pRet->zDb, pRet->zName, zTail ); } } if( rc==SQLITE_OK && pRet->zContentRowid==0 ){ pRet->zContentRowid = sqlite3Fts5Strndup(&rc, "rowid", -1); } /* Formulate the zContentExprlist text */ if( rc==SQLITE_OK ){ rc = fts5ConfigMakeExprlist(pRet); } if( rc!=SQLITE_OK ){ sqlite3Fts5ConfigFree(pRet); *ppOut = 0; } return rc; } /* ** Free the configuration object passed as the only argument. */ void sqlite3Fts5ConfigFree(Fts5Config *pConfig){ if( pConfig ){ int i; if( pConfig->pTok ){ pConfig->pTokApi->xDelete(pConfig->pTok); } sqlite3_free(pConfig->zDb); sqlite3_free(pConfig->zName); for(i=0; inCol; i++){ sqlite3_free(pConfig->azCol[i]); } sqlite3_free(pConfig->azCol); sqlite3_free(pConfig->aPrefix); sqlite3_free(pConfig->zRank); sqlite3_free(pConfig->zRankArgs); sqlite3_free(pConfig->zContent); sqlite3_free(pConfig->zContentRowid); sqlite3_free(pConfig->zContentExprlist); sqlite3_free(pConfig); } } /* ** Call sqlite3_declare_vtab() based on the contents of the configuration ** object passed as the only argument. Return SQLITE_OK if successful, or ** an SQLite error code if an error occurs. */ int sqlite3Fts5ConfigDeclareVtab(Fts5Config *pConfig){ int i; int rc = SQLITE_OK; char *zSql; zSql = sqlite3Fts5Mprintf(&rc, "CREATE TABLE x("); for(i=0; zSql && inCol; i++){ const char *zSep = (i==0?"":", "); zSql = sqlite3Fts5Mprintf(&rc, "%z%s%Q", zSql, zSep, pConfig->azCol[i]); } zSql = sqlite3Fts5Mprintf(&rc, "%z, %Q HIDDEN, %s HIDDEN)", zSql, pConfig->zName, FTS5_RANK_NAME ); assert( zSql || rc==SQLITE_NOMEM ); if( zSql ){ rc = sqlite3_declare_vtab(pConfig->db, zSql); sqlite3_free(zSql); } return rc; } /* ** Tokenize the text passed via the second and third arguments. ** ** The callback is invoked once for each token in the input text. The ** arguments passed to it are, in order: ** ** void *pCtx // Copy of 4th argument to sqlite3Fts5Tokenize() ** const char *pToken // Pointer to buffer containing token ** int nToken // Size of token in bytes ** int iStart // Byte offset of start of token within input text ** int iEnd // Byte offset of end of token within input text ** int iPos // Position of token in input (first token is 0) ** ** If the callback returns a non-zero value the tokenization is abandoned ** and no further callbacks are issued. ** ** This function returns SQLITE_OK if successful or an SQLite error code ** if an error occurs. If the tokenization was abandoned early because ** the callback returned SQLITE_DONE, this is not an error and this function ** still returns SQLITE_OK. Or, if the tokenization was abandoned early ** because the callback returned another non-zero value, it is assumed ** to be an SQLite error code and returned to the caller. */ int sqlite3Fts5Tokenize( Fts5Config *pConfig, /* FTS5 Configuration object */ int flags, /* FTS5_TOKENIZE_* flags */ const char *pText, int nText, /* Text to tokenize */ void *pCtx, /* Context passed to xToken() */ int (*xToken)(void*, int, const char*, int, int, int) /* Callback */ ){ if( pText==0 ) return SQLITE_OK; return pConfig->pTokApi->xTokenize( pConfig->pTok, pCtx, flags, pText, nText, xToken ); } /* ** Argument pIn points to the first character in what is expected to be ** a comma-separated list of SQL literals followed by a ')' character. ** If it actually is this, return a pointer to the ')'. Otherwise, return ** NULL to indicate a parse error. */ static const char *fts5ConfigSkipArgs(const char *pIn){ const char *p = pIn; while( 1 ){ p = fts5ConfigSkipWhitespace(p); p = fts5ConfigSkipLiteral(p); p = fts5ConfigSkipWhitespace(p); if( p==0 || *p==')' ) break; if( *p!=',' ){ p = 0; break; } p++; } return p; } /* ** Parameter zIn contains a rank() function specification. The format of ** this is: ** ** + Bareword (function name) ** + Open parenthesis - "(" ** + Zero or more SQL literals in a comma separated list ** + Close parenthesis - ")" */ int sqlite3Fts5ConfigParseRank( const char *zIn, /* Input string */ char **pzRank, /* OUT: Rank function name */ char **pzRankArgs /* OUT: Rank function arguments */ ){ const char *p = zIn; const char *pRank; char *zRank = 0; char *zRankArgs = 0; int rc = SQLITE_OK; *pzRank = 0; *pzRankArgs = 0; if( p==0 ){ rc = SQLITE_ERROR; }else{ p = fts5ConfigSkipWhitespace(p); pRank = p; p = fts5ConfigSkipBareword(p); if( p ){ zRank = sqlite3Fts5MallocZero(&rc, 1 + p - pRank); if( zRank ) memcpy(zRank, pRank, p-pRank); }else{ rc = SQLITE_ERROR; } if( rc==SQLITE_OK ){ p = fts5ConfigSkipWhitespace(p); if( *p!='(' ) rc = SQLITE_ERROR; p++; } if( rc==SQLITE_OK ){ const char *pArgs; p = fts5ConfigSkipWhitespace(p); pArgs = p; if( *p!=')' ){ p = fts5ConfigSkipArgs(p); if( p==0 ){ rc = SQLITE_ERROR; }else{ zRankArgs = sqlite3Fts5MallocZero(&rc, 1 + p - pArgs); if( zRankArgs ) memcpy(zRankArgs, pArgs, p-pArgs); } } } } if( rc!=SQLITE_OK ){ sqlite3_free(zRank); assert( zRankArgs==0 ); }else{ *pzRank = zRank; *pzRankArgs = zRankArgs; } return rc; } int sqlite3Fts5ConfigSetValue( Fts5Config *pConfig, const char *zKey, sqlite3_value *pVal, int *pbBadkey ){ int rc = SQLITE_OK; if( 0==sqlite3_stricmp(zKey, "pgsz") ){ int pgsz = 0; if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ pgsz = sqlite3_value_int(pVal); } if( pgsz<=0 || pgsz>FTS5_MAX_PAGE_SIZE ){ *pbBadkey = 1; }else{ pConfig->pgsz = pgsz; } } else if( 0==sqlite3_stricmp(zKey, "hashsize") ){ int nHashSize = -1; if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ nHashSize = sqlite3_value_int(pVal); } if( nHashSize<=0 ){ *pbBadkey = 1; }else{ pConfig->nHashSize = nHashSize; } } else if( 0==sqlite3_stricmp(zKey, "automerge") ){ int nAutomerge = -1; if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ nAutomerge = sqlite3_value_int(pVal); } if( nAutomerge<0 || nAutomerge>64 ){ *pbBadkey = 1; }else{ if( nAutomerge==1 ) nAutomerge = FTS5_DEFAULT_AUTOMERGE; pConfig->nAutomerge = nAutomerge; } } else if( 0==sqlite3_stricmp(zKey, "usermerge") ){ int nUsermerge = -1; if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ nUsermerge = sqlite3_value_int(pVal); } if( nUsermerge<2 || nUsermerge>16 ){ *pbBadkey = 1; }else{ pConfig->nUsermerge = nUsermerge; } } else if( 0==sqlite3_stricmp(zKey, "crisismerge") ){ int nCrisisMerge = -1; if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ nCrisisMerge = sqlite3_value_int(pVal); } if( nCrisisMerge<0 ){ *pbBadkey = 1; }else{ if( nCrisisMerge<=1 ) nCrisisMerge = FTS5_DEFAULT_CRISISMERGE; pConfig->nCrisisMerge = nCrisisMerge; } } else if( 0==sqlite3_stricmp(zKey, "rank") ){ const char *zIn = (const char*)sqlite3_value_text(pVal); char *zRank; char *zRankArgs; rc = sqlite3Fts5ConfigParseRank(zIn, &zRank, &zRankArgs); if( rc==SQLITE_OK ){ sqlite3_free(pConfig->zRank); sqlite3_free(pConfig->zRankArgs); pConfig->zRank = zRank; pConfig->zRankArgs = zRankArgs; }else if( rc==SQLITE_ERROR ){ rc = SQLITE_OK; *pbBadkey = 1; } }else{ *pbBadkey = 1; } return rc; } /* ** Load the contents of the %_config table into memory. */ int sqlite3Fts5ConfigLoad(Fts5Config *pConfig, int iCookie){ const char *zSelect = "SELECT k, v FROM %Q.'%q_config'"; char *zSql; sqlite3_stmt *p = 0; int rc = SQLITE_OK; int iVersion = 0; /* Set default values */ pConfig->pgsz = FTS5_DEFAULT_PAGE_SIZE; pConfig->nAutomerge = FTS5_DEFAULT_AUTOMERGE; pConfig->nUsermerge = FTS5_DEFAULT_USERMERGE; pConfig->nCrisisMerge = FTS5_DEFAULT_CRISISMERGE; pConfig->nHashSize = FTS5_DEFAULT_HASHSIZE; zSql = sqlite3Fts5Mprintf(&rc, zSelect, pConfig->zDb, pConfig->zName); if( zSql ){ rc = sqlite3_prepare_v2(pConfig->db, zSql, -1, &p, 0); sqlite3_free(zSql); } assert( rc==SQLITE_OK || p==0 ); if( rc==SQLITE_OK ){ while( SQLITE_ROW==sqlite3_step(p) ){ const char *zK = (const char*)sqlite3_column_text(p, 0); sqlite3_value *pVal = sqlite3_column_value(p, 1); if( 0==sqlite3_stricmp(zK, "version") ){ iVersion = sqlite3_value_int(pVal); }else{ int bDummy = 0; sqlite3Fts5ConfigSetValue(pConfig, zK, pVal, &bDummy); } } rc = sqlite3_finalize(p); } if( rc==SQLITE_OK && iVersion!=FTS5_CURRENT_VERSION ){ rc = SQLITE_ERROR; if( pConfig->pzErrmsg ){ assert( 0==*pConfig->pzErrmsg ); *pConfig->pzErrmsg = sqlite3_mprintf( "invalid fts5 file format (found %d, expected %d) - run 'rebuild'", iVersion, FTS5_CURRENT_VERSION ); } } if( rc==SQLITE_OK ){ pConfig->iCookie = iCookie; } return rc; } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_expr.c ================================================ /* ** 2014 May 31 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** */ #include "fts5Int.h" #include "fts5parse.h" /* ** All token types in the generated fts5parse.h file are greater than 0. */ #define FTS5_EOF 0 #define FTS5_LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32)) typedef struct Fts5ExprTerm Fts5ExprTerm; /* ** Functions generated by lemon from fts5parse.y. */ void *sqlite3Fts5ParserAlloc(void *(*mallocProc)(u64)); void sqlite3Fts5ParserFree(void*, void (*freeProc)(void*)); void sqlite3Fts5Parser(void*, int, Fts5Token, Fts5Parse*); #ifndef NDEBUG #include void sqlite3Fts5ParserTrace(FILE*, char*); #endif struct Fts5Expr { Fts5Index *pIndex; Fts5Config *pConfig; Fts5ExprNode *pRoot; int bDesc; /* Iterate in descending rowid order */ int nPhrase; /* Number of phrases in expression */ Fts5ExprPhrase **apExprPhrase; /* Pointers to phrase objects */ }; /* ** eType: ** Expression node type. Always one of: ** ** FTS5_AND (nChild, apChild valid) ** FTS5_OR (nChild, apChild valid) ** FTS5_NOT (nChild, apChild valid) ** FTS5_STRING (pNear valid) ** FTS5_TERM (pNear valid) */ struct Fts5ExprNode { int eType; /* Node type */ int bEof; /* True at EOF */ int bNomatch; /* True if entry is not a match */ /* Next method for this node. */ int (*xNext)(Fts5Expr*, Fts5ExprNode*, int, i64); i64 iRowid; /* Current rowid */ Fts5ExprNearset *pNear; /* For FTS5_STRING - cluster of phrases */ /* Child nodes. For a NOT node, this array always contains 2 entries. For ** AND or OR nodes, it contains 2 or more entries. */ int nChild; /* Number of child nodes */ Fts5ExprNode *apChild[1]; /* Array of child nodes */ }; #define Fts5NodeIsString(p) ((p)->eType==FTS5_TERM || (p)->eType==FTS5_STRING) /* ** Invoke the xNext method of an Fts5ExprNode object. This macro should be ** used as if it has the same signature as the xNext() methods themselves. */ #define fts5ExprNodeNext(a,b,c,d) (b)->xNext((a), (b), (c), (d)) /* ** An instance of the following structure represents a single search term ** or term prefix. */ struct Fts5ExprTerm { int bPrefix; /* True for a prefix term */ char *zTerm; /* nul-terminated term */ Fts5IndexIter *pIter; /* Iterator for this term */ Fts5ExprTerm *pSynonym; /* Pointer to first in list of synonyms */ }; /* ** A phrase. One or more terms that must appear in a contiguous sequence ** within a document for it to match. */ struct Fts5ExprPhrase { Fts5ExprNode *pNode; /* FTS5_STRING node this phrase is part of */ Fts5Buffer poslist; /* Current position list */ int nTerm; /* Number of entries in aTerm[] */ Fts5ExprTerm aTerm[1]; /* Terms that make up this phrase */ }; /* ** One or more phrases that must appear within a certain token distance of ** each other within each matching document. */ struct Fts5ExprNearset { int nNear; /* NEAR parameter */ Fts5Colset *pColset; /* Columns to search (NULL -> all columns) */ int nPhrase; /* Number of entries in aPhrase[] array */ Fts5ExprPhrase *apPhrase[1]; /* Array of phrase pointers */ }; /* ** Parse context. */ struct Fts5Parse { Fts5Config *pConfig; char *zErr; int rc; int nPhrase; /* Size of apPhrase array */ Fts5ExprPhrase **apPhrase; /* Array of all phrases */ Fts5ExprNode *pExpr; /* Result of a successful parse */ }; void sqlite3Fts5ParseError(Fts5Parse *pParse, const char *zFmt, ...){ va_list ap; va_start(ap, zFmt); if( pParse->rc==SQLITE_OK ){ pParse->zErr = sqlite3_vmprintf(zFmt, ap); pParse->rc = SQLITE_ERROR; } va_end(ap); } static int fts5ExprIsspace(char t){ return t==' ' || t=='\t' || t=='\n' || t=='\r'; } /* ** Read the first token from the nul-terminated string at *pz. */ static int fts5ExprGetToken( Fts5Parse *pParse, const char **pz, /* IN/OUT: Pointer into buffer */ Fts5Token *pToken ){ const char *z = *pz; int tok; /* Skip past any whitespace */ while( fts5ExprIsspace(*z) ) z++; pToken->p = z; pToken->n = 1; switch( *z ){ case '(': tok = FTS5_LP; break; case ')': tok = FTS5_RP; break; case '{': tok = FTS5_LCP; break; case '}': tok = FTS5_RCP; break; case ':': tok = FTS5_COLON; break; case ',': tok = FTS5_COMMA; break; case '+': tok = FTS5_PLUS; break; case '*': tok = FTS5_STAR; break; case '-': tok = FTS5_MINUS; break; case '\0': tok = FTS5_EOF; break; case '"': { const char *z2; tok = FTS5_STRING; for(z2=&z[1]; 1; z2++){ if( z2[0]=='"' ){ z2++; if( z2[0]!='"' ) break; } if( z2[0]=='\0' ){ sqlite3Fts5ParseError(pParse, "unterminated string"); return FTS5_EOF; } } pToken->n = (z2 - z); break; } default: { const char *z2; if( sqlite3Fts5IsBareword(z[0])==0 ){ sqlite3Fts5ParseError(pParse, "fts5: syntax error near \"%.1s\"", z); return FTS5_EOF; } tok = FTS5_STRING; for(z2=&z[1]; sqlite3Fts5IsBareword(*z2); z2++); pToken->n = (z2 - z); if( pToken->n==2 && memcmp(pToken->p, "OR", 2)==0 ) tok = FTS5_OR; if( pToken->n==3 && memcmp(pToken->p, "NOT", 3)==0 ) tok = FTS5_NOT; if( pToken->n==3 && memcmp(pToken->p, "AND", 3)==0 ) tok = FTS5_AND; break; } } *pz = &pToken->p[pToken->n]; return tok; } static void *fts5ParseAlloc(u64 t){ return sqlite3_malloc((int)t); } static void fts5ParseFree(void *p){ sqlite3_free(p); } int sqlite3Fts5ExprNew( Fts5Config *pConfig, /* FTS5 Configuration */ int iCol, const char *zExpr, /* Expression text */ Fts5Expr **ppNew, char **pzErr ){ Fts5Parse sParse; Fts5Token token; const char *z = zExpr; int t; /* Next token type */ void *pEngine; Fts5Expr *pNew; *ppNew = 0; *pzErr = 0; memset(&sParse, 0, sizeof(sParse)); pEngine = sqlite3Fts5ParserAlloc(fts5ParseAlloc); if( pEngine==0 ){ return SQLITE_NOMEM; } sParse.pConfig = pConfig; do { t = fts5ExprGetToken(&sParse, &z, &token); sqlite3Fts5Parser(pEngine, t, token, &sParse); }while( sParse.rc==SQLITE_OK && t!=FTS5_EOF ); sqlite3Fts5ParserFree(pEngine, fts5ParseFree); /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if( iColnCol && sParse.pExpr && sParse.rc==SQLITE_OK ){ int n = sizeof(Fts5Colset); Fts5Colset *pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&sParse.rc, n); if( pColset ){ pColset->nCol = 1; pColset->aiCol[0] = iCol; sqlite3Fts5ParseSetColset(&sParse, sParse.pExpr, pColset); } } assert( sParse.rc!=SQLITE_OK || sParse.zErr==0 ); if( sParse.rc==SQLITE_OK ){ *ppNew = pNew = sqlite3_malloc(sizeof(Fts5Expr)); if( pNew==0 ){ sParse.rc = SQLITE_NOMEM; sqlite3Fts5ParseNodeFree(sParse.pExpr); }else{ if( !sParse.pExpr ){ const int nByte = sizeof(Fts5ExprNode); pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&sParse.rc, nByte); if( pNew->pRoot ){ pNew->pRoot->bEof = 1; } }else{ pNew->pRoot = sParse.pExpr; } pNew->pIndex = 0; pNew->pConfig = pConfig; pNew->apExprPhrase = sParse.apPhrase; pNew->nPhrase = sParse.nPhrase; sParse.apPhrase = 0; } }else{ sqlite3Fts5ParseNodeFree(sParse.pExpr); } sqlite3_free(sParse.apPhrase); *pzErr = sParse.zErr; return sParse.rc; } /* ** Free the expression node object passed as the only argument. */ void sqlite3Fts5ParseNodeFree(Fts5ExprNode *p){ if( p ){ int i; for(i=0; inChild; i++){ sqlite3Fts5ParseNodeFree(p->apChild[i]); } sqlite3Fts5ParseNearsetFree(p->pNear); sqlite3_free(p); } } /* ** Free the expression object passed as the only argument. */ void sqlite3Fts5ExprFree(Fts5Expr *p){ if( p ){ sqlite3Fts5ParseNodeFree(p->pRoot); sqlite3_free(p->apExprPhrase); sqlite3_free(p); } } /* ** Argument pTerm must be a synonym iterator. Return the current rowid ** that it points to. */ static i64 fts5ExprSynonymRowid(Fts5ExprTerm *pTerm, int bDesc, int *pbEof){ i64 iRet = 0; int bRetValid = 0; Fts5ExprTerm *p; assert( pTerm->pSynonym ); assert( bDesc==0 || bDesc==1 ); for(p=pTerm; p; p=p->pSynonym){ if( 0==sqlite3Fts5IterEof(p->pIter) ){ i64 iRowid = p->pIter->iRowid; if( bRetValid==0 || (bDesc!=(iRowidpSynonym ); for(p=pTerm; p; p=p->pSynonym){ Fts5IndexIter *pIter = p->pIter; if( sqlite3Fts5IterEof(pIter)==0 && pIter->iRowid==iRowid ){ if( pIter->nData==0 ) continue; if( nIter==nAlloc ){ int nByte = sizeof(Fts5PoslistReader) * nAlloc * 2; Fts5PoslistReader *aNew = (Fts5PoslistReader*)sqlite3_malloc(nByte); if( aNew==0 ){ rc = SQLITE_NOMEM; goto synonym_poslist_out; } memcpy(aNew, aIter, sizeof(Fts5PoslistReader) * nIter); nAlloc = nAlloc*2; if( aIter!=aStatic ) sqlite3_free(aIter); aIter = aNew; } sqlite3Fts5PoslistReaderInit(pIter->pData, pIter->nData, &aIter[nIter]); assert( aIter[nIter].bEof==0 ); nIter++; } } if( nIter==1 ){ *pa = (u8*)aIter[0].a; *pn = aIter[0].n; }else{ Fts5PoslistWriter writer = {0}; i64 iPrev = -1; fts5BufferZero(pBuf); while( 1 ){ int i; i64 iMin = FTS5_LARGEST_INT64; for(i=0; ip; *pn = pBuf->n; } } synonym_poslist_out: if( aIter!=aStatic ) sqlite3_free(aIter); return rc; } /* ** All individual term iterators in pPhrase are guaranteed to be valid and ** pointing to the same rowid when this function is called. This function ** checks if the current rowid really is a match, and if so populates ** the pPhrase->poslist buffer accordingly. Output parameter *pbMatch ** is set to true if this is really a match, or false otherwise. ** ** SQLITE_OK is returned if an error occurs, or an SQLite error code ** otherwise. It is not considered an error code if the current rowid is ** not a match. */ static int fts5ExprPhraseIsMatch( Fts5ExprNode *pNode, /* Node pPhrase belongs to */ Fts5ExprPhrase *pPhrase, /* Phrase object to initialize */ int *pbMatch /* OUT: Set to true if really a match */ ){ Fts5PoslistWriter writer = {0}; Fts5PoslistReader aStatic[4]; Fts5PoslistReader *aIter = aStatic; int i; int rc = SQLITE_OK; fts5BufferZero(&pPhrase->poslist); /* If the aStatic[] array is not large enough, allocate a large array ** using sqlite3_malloc(). This approach could be improved upon. */ if( pPhrase->nTerm>ArraySize(aStatic) ){ int nByte = sizeof(Fts5PoslistReader) * pPhrase->nTerm; aIter = (Fts5PoslistReader*)sqlite3_malloc(nByte); if( !aIter ) return SQLITE_NOMEM; } memset(aIter, 0, sizeof(Fts5PoslistReader) * pPhrase->nTerm); /* Initialize a term iterator for each term in the phrase */ for(i=0; inTerm; i++){ Fts5ExprTerm *pTerm = &pPhrase->aTerm[i]; int n = 0; int bFlag = 0; u8 *a = 0; if( pTerm->pSynonym ){ Fts5Buffer buf = {0, 0, 0}; rc = fts5ExprSynonymList(pTerm, pNode->iRowid, &buf, &a, &n); if( rc ){ sqlite3_free(a); goto ismatch_out; } if( a==buf.p ) bFlag = 1; }else{ a = (u8*)pTerm->pIter->pData; n = pTerm->pIter->nData; } sqlite3Fts5PoslistReaderInit(a, n, &aIter[i]); aIter[i].bFlag = (u8)bFlag; if( aIter[i].bEof ) goto ismatch_out; } while( 1 ){ int bMatch; i64 iPos = aIter[0].iPos; do { bMatch = 1; for(i=0; inTerm; i++){ Fts5PoslistReader *pPos = &aIter[i]; i64 iAdj = iPos + i; if( pPos->iPos!=iAdj ){ bMatch = 0; while( pPos->iPosiPos>iAdj ) iPos = pPos->iPos-i; } } }while( bMatch==0 ); /* Append position iPos to the output */ rc = sqlite3Fts5PoslistWriterAppend(&pPhrase->poslist, &writer, iPos); if( rc!=SQLITE_OK ) goto ismatch_out; for(i=0; inTerm; i++){ if( sqlite3Fts5PoslistReaderNext(&aIter[i]) ) goto ismatch_out; } } ismatch_out: *pbMatch = (pPhrase->poslist.n>0); for(i=0; inTerm; i++){ if( aIter[i].bFlag ) sqlite3_free((u8*)aIter[i].a); } if( aIter!=aStatic ) sqlite3_free(aIter); return rc; } typedef struct Fts5LookaheadReader Fts5LookaheadReader; struct Fts5LookaheadReader { const u8 *a; /* Buffer containing position list */ int n; /* Size of buffer a[] in bytes */ int i; /* Current offset in position list */ i64 iPos; /* Current position */ i64 iLookahead; /* Next position */ }; #define FTS5_LOOKAHEAD_EOF (((i64)1) << 62) static int fts5LookaheadReaderNext(Fts5LookaheadReader *p){ p->iPos = p->iLookahead; if( sqlite3Fts5PoslistNext64(p->a, p->n, &p->i, &p->iLookahead) ){ p->iLookahead = FTS5_LOOKAHEAD_EOF; } return (p->iPos==FTS5_LOOKAHEAD_EOF); } static int fts5LookaheadReaderInit( const u8 *a, int n, /* Buffer to read position list from */ Fts5LookaheadReader *p /* Iterator object to initialize */ ){ memset(p, 0, sizeof(Fts5LookaheadReader)); p->a = a; p->n = n; fts5LookaheadReaderNext(p); return fts5LookaheadReaderNext(p); } typedef struct Fts5NearTrimmer Fts5NearTrimmer; struct Fts5NearTrimmer { Fts5LookaheadReader reader; /* Input iterator */ Fts5PoslistWriter writer; /* Writer context */ Fts5Buffer *pOut; /* Output poslist */ }; /* ** The near-set object passed as the first argument contains more than ** one phrase. All phrases currently point to the same row. The ** Fts5ExprPhrase.poslist buffers are populated accordingly. This function ** tests if the current row contains instances of each phrase sufficiently ** close together to meet the NEAR constraint. Non-zero is returned if it ** does, or zero otherwise. ** ** If in/out parameter (*pRc) is set to other than SQLITE_OK when this ** function is called, it is a no-op. Or, if an error (e.g. SQLITE_NOMEM) ** occurs within this function (*pRc) is set accordingly before returning. ** The return value is undefined in both these cases. ** ** If no error occurs and non-zero (a match) is returned, the position-list ** of each phrase object is edited to contain only those entries that ** meet the constraint before returning. */ static int fts5ExprNearIsMatch(int *pRc, Fts5ExprNearset *pNear){ Fts5NearTrimmer aStatic[4]; Fts5NearTrimmer *a = aStatic; Fts5ExprPhrase **apPhrase = pNear->apPhrase; int i; int rc = *pRc; int bMatch; assert( pNear->nPhrase>1 ); /* If the aStatic[] array is not large enough, allocate a large array ** using sqlite3_malloc(). This approach could be improved upon. */ if( pNear->nPhrase>ArraySize(aStatic) ){ int nByte = sizeof(Fts5NearTrimmer) * pNear->nPhrase; a = (Fts5NearTrimmer*)sqlite3Fts5MallocZero(&rc, nByte); }else{ memset(aStatic, 0, sizeof(aStatic)); } if( rc!=SQLITE_OK ){ *pRc = rc; return 0; } /* Initialize a lookahead iterator for each phrase. After passing the ** buffer and buffer size to the lookaside-reader init function, zero ** the phrase poslist buffer. The new poslist for the phrase (containing ** the same entries as the original with some entries removed on account ** of the NEAR constraint) is written over the original even as it is ** being read. This is safe as the entries for the new poslist are a ** subset of the old, so it is not possible for data yet to be read to ** be overwritten. */ for(i=0; inPhrase; i++){ Fts5Buffer *pPoslist = &apPhrase[i]->poslist; fts5LookaheadReaderInit(pPoslist->p, pPoslist->n, &a[i].reader); pPoslist->n = 0; a[i].pOut = pPoslist; } while( 1 ){ int iAdv; i64 iMin; i64 iMax; /* This block advances the phrase iterators until they point to a set of ** entries that together comprise a match. */ iMax = a[0].reader.iPos; do { bMatch = 1; for(i=0; inPhrase; i++){ Fts5LookaheadReader *pPos = &a[i].reader; iMin = iMax - pNear->apPhrase[i]->nTerm - pNear->nNear; if( pPos->iPosiPos>iMax ){ bMatch = 0; while( pPos->iPosiPos>iMax ) iMax = pPos->iPos; } } }while( bMatch==0 ); /* Add an entry to each output position list */ for(i=0; inPhrase; i++){ i64 iPos = a[i].reader.iPos; Fts5PoslistWriter *pWriter = &a[i].writer; if( a[i].pOut->n==0 || iPos!=pWriter->iPrev ){ sqlite3Fts5PoslistWriterAppend(a[i].pOut, pWriter, iPos); } } iAdv = 0; iMin = a[0].reader.iLookahead; for(i=0; inPhrase; i++){ if( a[i].reader.iLookahead < iMin ){ iMin = a[i].reader.iLookahead; iAdv = i; } } if( fts5LookaheadReaderNext(&a[iAdv].reader) ) goto ismatch_out; } ismatch_out: { int bRet = a[0].pOut->n>0; *pRc = rc; if( a!=aStatic ) sqlite3_free(a); return bRet; } } /* ** Advance iterator pIter until it points to a value equal to or laster ** than the initial value of *piLast. If this means the iterator points ** to a value laster than *piLast, update *piLast to the new lastest value. ** ** If the iterator reaches EOF, set *pbEof to true before returning. If ** an error occurs, set *pRc to an error code. If either *pbEof or *pRc ** are set, return a non-zero value. Otherwise, return zero. */ static int fts5ExprAdvanceto( Fts5IndexIter *pIter, /* Iterator to advance */ int bDesc, /* True if iterator is "rowid DESC" */ i64 *piLast, /* IN/OUT: Lastest rowid seen so far */ int *pRc, /* OUT: Error code */ int *pbEof /* OUT: Set to true if EOF */ ){ i64 iLast = *piLast; i64 iRowid; iRowid = pIter->iRowid; if( (bDesc==0 && iLast>iRowid) || (bDesc && iLastiRowid; assert( (bDesc==0 && iRowid>=iLast) || (bDesc==1 && iRowid<=iLast) ); } *piLast = iRowid; return 0; } static int fts5ExprSynonymAdvanceto( Fts5ExprTerm *pTerm, /* Term iterator to advance */ int bDesc, /* True if iterator is "rowid DESC" */ i64 *piLast, /* IN/OUT: Lastest rowid seen so far */ int *pRc /* OUT: Error code */ ){ int rc = SQLITE_OK; i64 iLast = *piLast; Fts5ExprTerm *p; int bEof = 0; for(p=pTerm; rc==SQLITE_OK && p; p=p->pSynonym){ if( sqlite3Fts5IterEof(p->pIter)==0 ){ i64 iRowid = p->pIter->iRowid; if( (bDesc==0 && iLast>iRowid) || (bDesc && iLastpIter, iLast); } } } if( rc!=SQLITE_OK ){ *pRc = rc; bEof = 1; }else{ *piLast = fts5ExprSynonymRowid(pTerm, bDesc, &bEof); } return bEof; } static int fts5ExprNearTest( int *pRc, Fts5Expr *pExpr, /* Expression that pNear is a part of */ Fts5ExprNode *pNode /* The "NEAR" node (FTS5_STRING) */ ){ Fts5ExprNearset *pNear = pNode->pNear; int rc = *pRc; if( pExpr->pConfig->eDetail!=FTS5_DETAIL_FULL ){ Fts5ExprTerm *pTerm; Fts5ExprPhrase *pPhrase = pNear->apPhrase[0]; pPhrase->poslist.n = 0; for(pTerm=&pPhrase->aTerm[0]; pTerm; pTerm=pTerm->pSynonym){ Fts5IndexIter *pIter = pTerm->pIter; if( sqlite3Fts5IterEof(pIter)==0 ){ if( pIter->iRowid==pNode->iRowid && pIter->nData>0 ){ pPhrase->poslist.n = 1; } } } return pPhrase->poslist.n; }else{ int i; /* Check that each phrase in the nearset matches the current row. ** Populate the pPhrase->poslist buffers at the same time. If any ** phrase is not a match, break out of the loop early. */ for(i=0; rc==SQLITE_OK && inPhrase; i++){ Fts5ExprPhrase *pPhrase = pNear->apPhrase[i]; if( pPhrase->nTerm>1 || pPhrase->aTerm[0].pSynonym || pNear->pColset ){ int bMatch = 0; rc = fts5ExprPhraseIsMatch(pNode, pPhrase, &bMatch); if( bMatch==0 ) break; }else{ Fts5IndexIter *pIter = pPhrase->aTerm[0].pIter; fts5BufferSet(&rc, &pPhrase->poslist, pIter->nData, pIter->pData); } } *pRc = rc; if( i==pNear->nPhrase && (i==1 || fts5ExprNearIsMatch(pRc, pNear)) ){ return 1; } return 0; } } /* ** Initialize all term iterators in the pNear object. If any term is found ** to match no documents at all, return immediately without initializing any ** further iterators. ** ** If an error occurs, return an SQLite error code. Otherwise, return ** SQLITE_OK. It is not considered an error if some term matches zero ** documents. */ static int fts5ExprNearInitAll( Fts5Expr *pExpr, Fts5ExprNode *pNode ){ Fts5ExprNearset *pNear = pNode->pNear; int i; assert( pNode->bNomatch==0 ); for(i=0; inPhrase; i++){ Fts5ExprPhrase *pPhrase = pNear->apPhrase[i]; if( pPhrase->nTerm==0 ){ pNode->bEof = 1; return SQLITE_OK; }else{ int j; for(j=0; jnTerm; j++){ Fts5ExprTerm *pTerm = &pPhrase->aTerm[j]; Fts5ExprTerm *p; int bHit = 0; for(p=pTerm; p; p=p->pSynonym){ int rc; if( p->pIter ){ sqlite3Fts5IterClose(p->pIter); p->pIter = 0; } rc = sqlite3Fts5IndexQuery( pExpr->pIndex, p->zTerm, (int)strlen(p->zTerm), (pTerm->bPrefix ? FTS5INDEX_QUERY_PREFIX : 0) | (pExpr->bDesc ? FTS5INDEX_QUERY_DESC : 0), pNear->pColset, &p->pIter ); assert( (rc==SQLITE_OK)==(p->pIter!=0) ); if( rc!=SQLITE_OK ) return rc; if( 0==sqlite3Fts5IterEof(p->pIter) ){ bHit = 1; } } if( bHit==0 ){ pNode->bEof = 1; return SQLITE_OK; } } } } pNode->bEof = 0; return SQLITE_OK; } /* ** If pExpr is an ASC iterator, this function returns a value with the ** same sign as: ** ** (iLhs - iRhs) ** ** Otherwise, if this is a DESC iterator, the opposite is returned: ** ** (iRhs - iLhs) */ static int fts5RowidCmp( Fts5Expr *pExpr, i64 iLhs, i64 iRhs ){ assert( pExpr->bDesc==0 || pExpr->bDesc==1 ); if( pExpr->bDesc==0 ){ if( iLhs iRhs); }else{ if( iLhs>iRhs ) return -1; return (iLhs < iRhs); } } static void fts5ExprSetEof(Fts5ExprNode *pNode){ int i; pNode->bEof = 1; pNode->bNomatch = 0; for(i=0; inChild; i++){ fts5ExprSetEof(pNode->apChild[i]); } } static void fts5ExprNodeZeroPoslist(Fts5ExprNode *pNode){ if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){ Fts5ExprNearset *pNear = pNode->pNear; int i; for(i=0; inPhrase; i++){ Fts5ExprPhrase *pPhrase = pNear->apPhrase[i]; pPhrase->poslist.n = 0; } }else{ int i; for(i=0; inChild; i++){ fts5ExprNodeZeroPoslist(pNode->apChild[i]); } } } /* ** Compare the values currently indicated by the two nodes as follows: ** ** res = (*p1) - (*p2) ** ** Nodes that point to values that come later in the iteration order are ** considered to be larger. Nodes at EOF are the largest of all. ** ** This means that if the iteration order is ASC, then numerically larger ** rowids are considered larger. Or if it is the default DESC, numerically ** smaller rowids are larger. */ static int fts5NodeCompare( Fts5Expr *pExpr, Fts5ExprNode *p1, Fts5ExprNode *p2 ){ if( p2->bEof ) return -1; if( p1->bEof ) return +1; return fts5RowidCmp(pExpr, p1->iRowid, p2->iRowid); } /* ** All individual term iterators in pNear are guaranteed to be valid when ** this function is called. This function checks if all term iterators ** point to the same rowid, and if not, advances them until they do. ** If an EOF is reached before this happens, *pbEof is set to true before ** returning. ** ** SQLITE_OK is returned if an error occurs, or an SQLite error code ** otherwise. It is not considered an error code if an iterator reaches ** EOF. */ static int fts5ExprNodeTest_STRING( Fts5Expr *pExpr, /* Expression pPhrase belongs to */ Fts5ExprNode *pNode ){ Fts5ExprNearset *pNear = pNode->pNear; Fts5ExprPhrase *pLeft = pNear->apPhrase[0]; int rc = SQLITE_OK; i64 iLast; /* Lastest rowid any iterator points to */ int i, j; /* Phrase and token index, respectively */ int bMatch; /* True if all terms are at the same rowid */ const int bDesc = pExpr->bDesc; /* Check that this node should not be FTS5_TERM */ assert( pNear->nPhrase>1 || pNear->apPhrase[0]->nTerm>1 || pNear->apPhrase[0]->aTerm[0].pSynonym ); /* Initialize iLast, the "lastest" rowid any iterator points to. If the ** iterator skips through rowids in the default ascending order, this means ** the maximum rowid. Or, if the iterator is "ORDER BY rowid DESC", then it ** means the minimum rowid. */ if( pLeft->aTerm[0].pSynonym ){ iLast = fts5ExprSynonymRowid(&pLeft->aTerm[0], bDesc, 0); }else{ iLast = pLeft->aTerm[0].pIter->iRowid; } do { bMatch = 1; for(i=0; inPhrase; i++){ Fts5ExprPhrase *pPhrase = pNear->apPhrase[i]; for(j=0; jnTerm; j++){ Fts5ExprTerm *pTerm = &pPhrase->aTerm[j]; if( pTerm->pSynonym ){ i64 iRowid = fts5ExprSynonymRowid(pTerm, bDesc, 0); if( iRowid==iLast ) continue; bMatch = 0; if( fts5ExprSynonymAdvanceto(pTerm, bDesc, &iLast, &rc) ){ pNode->bNomatch = 0; pNode->bEof = 1; return rc; } }else{ Fts5IndexIter *pIter = pPhrase->aTerm[j].pIter; if( pIter->iRowid==iLast || pIter->bEof ) continue; bMatch = 0; if( fts5ExprAdvanceto(pIter, bDesc, &iLast, &rc, &pNode->bEof) ){ return rc; } } } } }while( bMatch==0 ); pNode->iRowid = iLast; pNode->bNomatch = ((0==fts5ExprNearTest(&rc, pExpr, pNode)) && rc==SQLITE_OK); assert( pNode->bEof==0 || pNode->bNomatch==0 ); return rc; } /* ** Advance the first term iterator in the first phrase of pNear. Set output ** variable *pbEof to true if it reaches EOF or if an error occurs. ** ** Return SQLITE_OK if successful, or an SQLite error code if an error ** occurs. */ static int fts5ExprNodeNext_STRING( Fts5Expr *pExpr, /* Expression pPhrase belongs to */ Fts5ExprNode *pNode, /* FTS5_STRING or FTS5_TERM node */ int bFromValid, i64 iFrom ){ Fts5ExprTerm *pTerm = &pNode->pNear->apPhrase[0]->aTerm[0]; int rc = SQLITE_OK; pNode->bNomatch = 0; if( pTerm->pSynonym ){ int bEof = 1; Fts5ExprTerm *p; /* Find the firstest rowid any synonym points to. */ i64 iRowid = fts5ExprSynonymRowid(pTerm, pExpr->bDesc, 0); /* Advance each iterator that currently points to iRowid. Or, if iFrom ** is valid - each iterator that points to a rowid before iFrom. */ for(p=pTerm; p; p=p->pSynonym){ if( sqlite3Fts5IterEof(p->pIter)==0 ){ i64 ii = p->pIter->iRowid; if( ii==iRowid || (bFromValid && ii!=iFrom && (ii>iFrom)==pExpr->bDesc) ){ if( bFromValid ){ rc = sqlite3Fts5IterNextFrom(p->pIter, iFrom); }else{ rc = sqlite3Fts5IterNext(p->pIter); } if( rc!=SQLITE_OK ) break; if( sqlite3Fts5IterEof(p->pIter)==0 ){ bEof = 0; } }else{ bEof = 0; } } } /* Set the EOF flag if either all synonym iterators are at EOF or an ** error has occurred. */ pNode->bEof = (rc || bEof); }else{ Fts5IndexIter *pIter = pTerm->pIter; assert( Fts5NodeIsString(pNode) ); if( bFromValid ){ rc = sqlite3Fts5IterNextFrom(pIter, iFrom); }else{ rc = sqlite3Fts5IterNext(pIter); } pNode->bEof = (rc || sqlite3Fts5IterEof(pIter)); } if( pNode->bEof==0 ){ assert( rc==SQLITE_OK ); rc = fts5ExprNodeTest_STRING(pExpr, pNode); } return rc; } static int fts5ExprNodeTest_TERM( Fts5Expr *pExpr, /* Expression that pNear is a part of */ Fts5ExprNode *pNode /* The "NEAR" node (FTS5_TERM) */ ){ /* As this "NEAR" object is actually a single phrase that consists ** of a single term only, grab pointers into the poslist managed by the ** fts5_index.c iterator object. This is much faster than synthesizing ** a new poslist the way we have to for more complicated phrase or NEAR ** expressions. */ Fts5ExprPhrase *pPhrase = pNode->pNear->apPhrase[0]; Fts5IndexIter *pIter = pPhrase->aTerm[0].pIter; assert( pNode->eType==FTS5_TERM ); assert( pNode->pNear->nPhrase==1 && pPhrase->nTerm==1 ); assert( pPhrase->aTerm[0].pSynonym==0 ); pPhrase->poslist.n = pIter->nData; if( pExpr->pConfig->eDetail==FTS5_DETAIL_FULL ){ pPhrase->poslist.p = (u8*)pIter->pData; } pNode->iRowid = pIter->iRowid; pNode->bNomatch = (pPhrase->poslist.n==0); return SQLITE_OK; } /* ** xNext() method for a node of type FTS5_TERM. */ static int fts5ExprNodeNext_TERM( Fts5Expr *pExpr, Fts5ExprNode *pNode, int bFromValid, i64 iFrom ){ int rc; Fts5IndexIter *pIter = pNode->pNear->apPhrase[0]->aTerm[0].pIter; assert( pNode->bEof==0 ); if( bFromValid ){ rc = sqlite3Fts5IterNextFrom(pIter, iFrom); }else{ rc = sqlite3Fts5IterNext(pIter); } if( rc==SQLITE_OK && sqlite3Fts5IterEof(pIter)==0 ){ rc = fts5ExprNodeTest_TERM(pExpr, pNode); }else{ pNode->bEof = 1; pNode->bNomatch = 0; } return rc; } static void fts5ExprNodeTest_OR( Fts5Expr *pExpr, /* Expression of which pNode is a part */ Fts5ExprNode *pNode /* Expression node to test */ ){ Fts5ExprNode *pNext = pNode->apChild[0]; int i; for(i=1; inChild; i++){ Fts5ExprNode *pChild = pNode->apChild[i]; int cmp = fts5NodeCompare(pExpr, pNext, pChild); if( cmp>0 || (cmp==0 && pChild->bNomatch==0) ){ pNext = pChild; } } pNode->iRowid = pNext->iRowid; pNode->bEof = pNext->bEof; pNode->bNomatch = pNext->bNomatch; } static int fts5ExprNodeNext_OR( Fts5Expr *pExpr, Fts5ExprNode *pNode, int bFromValid, i64 iFrom ){ int i; i64 iLast = pNode->iRowid; for(i=0; inChild; i++){ Fts5ExprNode *p1 = pNode->apChild[i]; assert( p1->bEof || fts5RowidCmp(pExpr, p1->iRowid, iLast)>=0 ); if( p1->bEof==0 ){ if( (p1->iRowid==iLast) || (bFromValid && fts5RowidCmp(pExpr, p1->iRowid, iFrom)<0) ){ int rc = fts5ExprNodeNext(pExpr, p1, bFromValid, iFrom); if( rc!=SQLITE_OK ){ pNode->bNomatch = 0; return rc; } } } } fts5ExprNodeTest_OR(pExpr, pNode); return SQLITE_OK; } /* ** Argument pNode is an FTS5_AND node. */ static int fts5ExprNodeTest_AND( Fts5Expr *pExpr, /* Expression pPhrase belongs to */ Fts5ExprNode *pAnd /* FTS5_AND node to advance */ ){ int iChild; i64 iLast = pAnd->iRowid; int rc = SQLITE_OK; int bMatch; assert( pAnd->bEof==0 ); do { pAnd->bNomatch = 0; bMatch = 1; for(iChild=0; iChildnChild; iChild++){ Fts5ExprNode *pChild = pAnd->apChild[iChild]; int cmp = fts5RowidCmp(pExpr, iLast, pChild->iRowid); if( cmp>0 ){ /* Advance pChild until it points to iLast or laster */ rc = fts5ExprNodeNext(pExpr, pChild, 1, iLast); if( rc!=SQLITE_OK ){ pAnd->bNomatch = 0; return rc; } } /* If the child node is now at EOF, so is the parent AND node. Otherwise, ** the child node is guaranteed to have advanced at least as far as ** rowid iLast. So if it is not at exactly iLast, pChild->iRowid is the ** new lastest rowid seen so far. */ assert( pChild->bEof || fts5RowidCmp(pExpr, iLast, pChild->iRowid)<=0 ); if( pChild->bEof ){ fts5ExprSetEof(pAnd); bMatch = 1; break; }else if( iLast!=pChild->iRowid ){ bMatch = 0; iLast = pChild->iRowid; } if( pChild->bNomatch ){ pAnd->bNomatch = 1; } } }while( bMatch==0 ); if( pAnd->bNomatch && pAnd!=pExpr->pRoot ){ fts5ExprNodeZeroPoslist(pAnd); } pAnd->iRowid = iLast; return SQLITE_OK; } static int fts5ExprNodeNext_AND( Fts5Expr *pExpr, Fts5ExprNode *pNode, int bFromValid, i64 iFrom ){ int rc = fts5ExprNodeNext(pExpr, pNode->apChild[0], bFromValid, iFrom); if( rc==SQLITE_OK ){ rc = fts5ExprNodeTest_AND(pExpr, pNode); }else{ pNode->bNomatch = 0; } return rc; } static int fts5ExprNodeTest_NOT( Fts5Expr *pExpr, /* Expression pPhrase belongs to */ Fts5ExprNode *pNode /* FTS5_NOT node to advance */ ){ int rc = SQLITE_OK; Fts5ExprNode *p1 = pNode->apChild[0]; Fts5ExprNode *p2 = pNode->apChild[1]; assert( pNode->nChild==2 ); while( rc==SQLITE_OK && p1->bEof==0 ){ int cmp = fts5NodeCompare(pExpr, p1, p2); if( cmp>0 ){ rc = fts5ExprNodeNext(pExpr, p2, 1, p1->iRowid); cmp = fts5NodeCompare(pExpr, p1, p2); } assert( rc!=SQLITE_OK || cmp<=0 ); if( cmp || p2->bNomatch ) break; rc = fts5ExprNodeNext(pExpr, p1, 0, 0); } pNode->bEof = p1->bEof; pNode->bNomatch = p1->bNomatch; pNode->iRowid = p1->iRowid; if( p1->bEof ){ fts5ExprNodeZeroPoslist(p2); } return rc; } static int fts5ExprNodeNext_NOT( Fts5Expr *pExpr, Fts5ExprNode *pNode, int bFromValid, i64 iFrom ){ int rc = fts5ExprNodeNext(pExpr, pNode->apChild[0], bFromValid, iFrom); if( rc==SQLITE_OK ){ rc = fts5ExprNodeTest_NOT(pExpr, pNode); } if( rc!=SQLITE_OK ){ pNode->bNomatch = 0; } return rc; } /* ** If pNode currently points to a match, this function returns SQLITE_OK ** without modifying it. Otherwise, pNode is advanced until it does point ** to a match or EOF is reached. */ static int fts5ExprNodeTest( Fts5Expr *pExpr, /* Expression of which pNode is a part */ Fts5ExprNode *pNode /* Expression node to test */ ){ int rc = SQLITE_OK; if( pNode->bEof==0 ){ switch( pNode->eType ){ case FTS5_STRING: { rc = fts5ExprNodeTest_STRING(pExpr, pNode); break; } case FTS5_TERM: { rc = fts5ExprNodeTest_TERM(pExpr, pNode); break; } case FTS5_AND: { rc = fts5ExprNodeTest_AND(pExpr, pNode); break; } case FTS5_OR: { fts5ExprNodeTest_OR(pExpr, pNode); break; } default: assert( pNode->eType==FTS5_NOT ); { rc = fts5ExprNodeTest_NOT(pExpr, pNode); break; } } } return rc; } /* ** Set node pNode, which is part of expression pExpr, to point to the first ** match. If there are no matches, set the Node.bEof flag to indicate EOF. ** ** Return an SQLite error code if an error occurs, or SQLITE_OK otherwise. ** It is not an error if there are no matches. */ static int fts5ExprNodeFirst(Fts5Expr *pExpr, Fts5ExprNode *pNode){ int rc = SQLITE_OK; pNode->bEof = 0; pNode->bNomatch = 0; if( Fts5NodeIsString(pNode) ){ /* Initialize all term iterators in the NEAR object. */ rc = fts5ExprNearInitAll(pExpr, pNode); }else if( pNode->xNext==0 ){ pNode->bEof = 1; }else{ int i; int nEof = 0; for(i=0; inChild && rc==SQLITE_OK; i++){ Fts5ExprNode *pChild = pNode->apChild[i]; rc = fts5ExprNodeFirst(pExpr, pNode->apChild[i]); assert( pChild->bEof==0 || pChild->bEof==1 ); nEof += pChild->bEof; } pNode->iRowid = pNode->apChild[0]->iRowid; switch( pNode->eType ){ case FTS5_AND: if( nEof>0 ) fts5ExprSetEof(pNode); break; case FTS5_OR: if( pNode->nChild==nEof ) fts5ExprSetEof(pNode); break; default: assert( pNode->eType==FTS5_NOT ); pNode->bEof = pNode->apChild[0]->bEof; break; } } if( rc==SQLITE_OK ){ rc = fts5ExprNodeTest(pExpr, pNode); } return rc; } /* ** Begin iterating through the set of documents in index pIdx matched by ** the MATCH expression passed as the first argument. If the "bDesc" ** parameter is passed a non-zero value, iteration is in descending rowid ** order. Or, if it is zero, in ascending order. ** ** If iterating in ascending rowid order (bDesc==0), the first document ** visited is that with the smallest rowid that is larger than or equal ** to parameter iFirst. Or, if iterating in ascending order (bDesc==1), ** then the first document visited must have a rowid smaller than or ** equal to iFirst. ** ** Return SQLITE_OK if successful, or an SQLite error code otherwise. It ** is not considered an error if the query does not match any documents. */ int sqlite3Fts5ExprFirst(Fts5Expr *p, Fts5Index *pIdx, i64 iFirst, int bDesc){ Fts5ExprNode *pRoot = p->pRoot; int rc; /* Return code */ p->pIndex = pIdx; p->bDesc = bDesc; rc = fts5ExprNodeFirst(p, pRoot); /* If not at EOF but the current rowid occurs earlier than iFirst in ** the iteration order, move to document iFirst or later. */ if( rc==SQLITE_OK && 0==pRoot->bEof && fts5RowidCmp(p, pRoot->iRowid, iFirst)<0 ){ rc = fts5ExprNodeNext(p, pRoot, 1, iFirst); } /* If the iterator is not at a real match, skip forward until it is. */ while( pRoot->bNomatch ){ assert( pRoot->bEof==0 && rc==SQLITE_OK ); rc = fts5ExprNodeNext(p, pRoot, 0, 0); } return rc; } /* ** Move to the next document ** ** Return SQLITE_OK if successful, or an SQLite error code otherwise. It ** is not considered an error if the query does not match any documents. */ int sqlite3Fts5ExprNext(Fts5Expr *p, i64 iLast){ int rc; Fts5ExprNode *pRoot = p->pRoot; assert( pRoot->bEof==0 && pRoot->bNomatch==0 ); do { rc = fts5ExprNodeNext(p, pRoot, 0, 0); assert( pRoot->bNomatch==0 || (rc==SQLITE_OK && pRoot->bEof==0) ); }while( pRoot->bNomatch ); if( fts5RowidCmp(p, pRoot->iRowid, iLast)>0 ){ pRoot->bEof = 1; } return rc; } int sqlite3Fts5ExprEof(Fts5Expr *p){ return p->pRoot->bEof; } i64 sqlite3Fts5ExprRowid(Fts5Expr *p){ return p->pRoot->iRowid; } static int fts5ParseStringFromToken(Fts5Token *pToken, char **pz){ int rc = SQLITE_OK; *pz = sqlite3Fts5Strndup(&rc, pToken->p, pToken->n); return rc; } /* ** Free the phrase object passed as the only argument. */ static void fts5ExprPhraseFree(Fts5ExprPhrase *pPhrase){ if( pPhrase ){ int i; for(i=0; inTerm; i++){ Fts5ExprTerm *pSyn; Fts5ExprTerm *pNext; Fts5ExprTerm *pTerm = &pPhrase->aTerm[i]; sqlite3_free(pTerm->zTerm); sqlite3Fts5IterClose(pTerm->pIter); for(pSyn=pTerm->pSynonym; pSyn; pSyn=pNext){ pNext = pSyn->pSynonym; sqlite3Fts5IterClose(pSyn->pIter); fts5BufferFree((Fts5Buffer*)&pSyn[1]); sqlite3_free(pSyn); } } if( pPhrase->poslist.nSpace>0 ) fts5BufferFree(&pPhrase->poslist); sqlite3_free(pPhrase); } } /* ** If argument pNear is NULL, then a new Fts5ExprNearset object is allocated ** and populated with pPhrase. Or, if pNear is not NULL, phrase pPhrase is ** appended to it and the results returned. ** ** If an OOM error occurs, both the pNear and pPhrase objects are freed and ** NULL returned. */ Fts5ExprNearset *sqlite3Fts5ParseNearset( Fts5Parse *pParse, /* Parse context */ Fts5ExprNearset *pNear, /* Existing nearset, or NULL */ Fts5ExprPhrase *pPhrase /* Recently parsed phrase */ ){ const int SZALLOC = 8; Fts5ExprNearset *pRet = 0; if( pParse->rc==SQLITE_OK ){ if( pPhrase==0 ){ return pNear; } if( pNear==0 ){ int nByte = sizeof(Fts5ExprNearset) + SZALLOC * sizeof(Fts5ExprPhrase*); pRet = sqlite3_malloc(nByte); if( pRet==0 ){ pParse->rc = SQLITE_NOMEM; }else{ memset(pRet, 0, nByte); } }else if( (pNear->nPhrase % SZALLOC)==0 ){ int nNew = pNear->nPhrase + SZALLOC; int nByte = sizeof(Fts5ExprNearset) + nNew * sizeof(Fts5ExprPhrase*); pRet = (Fts5ExprNearset*)sqlite3_realloc(pNear, nByte); if( pRet==0 ){ pParse->rc = SQLITE_NOMEM; } }else{ pRet = pNear; } } if( pRet==0 ){ assert( pParse->rc!=SQLITE_OK ); sqlite3Fts5ParseNearsetFree(pNear); sqlite3Fts5ParsePhraseFree(pPhrase); }else{ if( pRet->nPhrase>0 ){ Fts5ExprPhrase *pLast = pRet->apPhrase[pRet->nPhrase-1]; assert( pLast==pParse->apPhrase[pParse->nPhrase-2] ); if( pPhrase->nTerm==0 ){ fts5ExprPhraseFree(pPhrase); pRet->nPhrase--; pParse->nPhrase--; pPhrase = pLast; }else if( pLast->nTerm==0 ){ fts5ExprPhraseFree(pLast); pParse->apPhrase[pParse->nPhrase-2] = pPhrase; pParse->nPhrase--; pRet->nPhrase--; } } pRet->apPhrase[pRet->nPhrase++] = pPhrase; } return pRet; } typedef struct TokenCtx TokenCtx; struct TokenCtx { Fts5ExprPhrase *pPhrase; int rc; }; /* ** Callback for tokenizing terms used by ParseTerm(). */ static int fts5ParseTokenize( void *pContext, /* Pointer to Fts5InsertCtx object */ int tflags, /* Mask of FTS5_TOKEN_* flags */ const char *pToken, /* Buffer containing token */ int nToken, /* Size of token in bytes */ int iUnused1, /* Start offset of token */ int iUnused2 /* End offset of token */ ){ int rc = SQLITE_OK; const int SZALLOC = 8; TokenCtx *pCtx = (TokenCtx*)pContext; Fts5ExprPhrase *pPhrase = pCtx->pPhrase; UNUSED_PARAM2(iUnused1, iUnused2); /* If an error has already occurred, this is a no-op */ if( pCtx->rc!=SQLITE_OK ) return pCtx->rc; if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE; if( pPhrase && pPhrase->nTerm>0 && (tflags & FTS5_TOKEN_COLOCATED) ){ Fts5ExprTerm *pSyn; int nByte = sizeof(Fts5ExprTerm) + sizeof(Fts5Buffer) + nToken+1; pSyn = (Fts5ExprTerm*)sqlite3_malloc(nByte); if( pSyn==0 ){ rc = SQLITE_NOMEM; }else{ memset(pSyn, 0, nByte); pSyn->zTerm = ((char*)pSyn) + sizeof(Fts5ExprTerm) + sizeof(Fts5Buffer); memcpy(pSyn->zTerm, pToken, nToken); pSyn->pSynonym = pPhrase->aTerm[pPhrase->nTerm-1].pSynonym; pPhrase->aTerm[pPhrase->nTerm-1].pSynonym = pSyn; } }else{ Fts5ExprTerm *pTerm; if( pPhrase==0 || (pPhrase->nTerm % SZALLOC)==0 ){ Fts5ExprPhrase *pNew; int nNew = SZALLOC + (pPhrase ? pPhrase->nTerm : 0); pNew = (Fts5ExprPhrase*)sqlite3_realloc(pPhrase, sizeof(Fts5ExprPhrase) + sizeof(Fts5ExprTerm) * nNew ); if( pNew==0 ){ rc = SQLITE_NOMEM; }else{ if( pPhrase==0 ) memset(pNew, 0, sizeof(Fts5ExprPhrase)); pCtx->pPhrase = pPhrase = pNew; pNew->nTerm = nNew - SZALLOC; } } if( rc==SQLITE_OK ){ pTerm = &pPhrase->aTerm[pPhrase->nTerm++]; memset(pTerm, 0, sizeof(Fts5ExprTerm)); pTerm->zTerm = sqlite3Fts5Strndup(&rc, pToken, nToken); } } pCtx->rc = rc; return rc; } /* ** Free the phrase object passed as the only argument. */ void sqlite3Fts5ParsePhraseFree(Fts5ExprPhrase *pPhrase){ fts5ExprPhraseFree(pPhrase); } /* ** Free the phrase object passed as the second argument. */ void sqlite3Fts5ParseNearsetFree(Fts5ExprNearset *pNear){ if( pNear ){ int i; for(i=0; inPhrase; i++){ fts5ExprPhraseFree(pNear->apPhrase[i]); } sqlite3_free(pNear->pColset); sqlite3_free(pNear); } } void sqlite3Fts5ParseFinished(Fts5Parse *pParse, Fts5ExprNode *p){ assert( pParse->pExpr==0 ); pParse->pExpr = p; } /* ** This function is called by the parser to process a string token. The ** string may or may not be quoted. In any case it is tokenized and a ** phrase object consisting of all tokens returned. */ Fts5ExprPhrase *sqlite3Fts5ParseTerm( Fts5Parse *pParse, /* Parse context */ Fts5ExprPhrase *pAppend, /* Phrase to append to */ Fts5Token *pToken, /* String to tokenize */ int bPrefix /* True if there is a trailing "*" */ ){ Fts5Config *pConfig = pParse->pConfig; TokenCtx sCtx; /* Context object passed to callback */ int rc; /* Tokenize return code */ char *z = 0; memset(&sCtx, 0, sizeof(TokenCtx)); sCtx.pPhrase = pAppend; rc = fts5ParseStringFromToken(pToken, &z); if( rc==SQLITE_OK ){ int flags = FTS5_TOKENIZE_QUERY | (bPrefix ? FTS5_TOKENIZE_PREFIX : 0); int n; sqlite3Fts5Dequote(z); n = (int)strlen(z); rc = sqlite3Fts5Tokenize(pConfig, flags, z, n, &sCtx, fts5ParseTokenize); } sqlite3_free(z); if( rc || (rc = sCtx.rc) ){ pParse->rc = rc; fts5ExprPhraseFree(sCtx.pPhrase); sCtx.pPhrase = 0; }else{ if( pAppend==0 ){ if( (pParse->nPhrase % 8)==0 ){ int nByte = sizeof(Fts5ExprPhrase*) * (pParse->nPhrase + 8); Fts5ExprPhrase **apNew; apNew = (Fts5ExprPhrase**)sqlite3_realloc(pParse->apPhrase, nByte); if( apNew==0 ){ pParse->rc = SQLITE_NOMEM; fts5ExprPhraseFree(sCtx.pPhrase); return 0; } pParse->apPhrase = apNew; } pParse->nPhrase++; } if( sCtx.pPhrase==0 ){ /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ sCtx.pPhrase = sqlite3Fts5MallocZero(&pParse->rc, sizeof(Fts5ExprPhrase)); }else if( sCtx.pPhrase->nTerm ){ sCtx.pPhrase->aTerm[sCtx.pPhrase->nTerm-1].bPrefix = bPrefix; } pParse->apPhrase[pParse->nPhrase-1] = sCtx.pPhrase; } return sCtx.pPhrase; } /* ** Create a new FTS5 expression by cloning phrase iPhrase of the ** expression passed as the second argument. */ int sqlite3Fts5ExprClonePhrase( Fts5Expr *pExpr, int iPhrase, Fts5Expr **ppNew ){ int rc = SQLITE_OK; /* Return code */ Fts5ExprPhrase *pOrig; /* The phrase extracted from pExpr */ Fts5Expr *pNew = 0; /* Expression to return via *ppNew */ TokenCtx sCtx = {0,0}; /* Context object for fts5ParseTokenize */ pOrig = pExpr->apExprPhrase[iPhrase]; pNew = (Fts5Expr*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5Expr)); if( rc==SQLITE_OK ){ pNew->apExprPhrase = (Fts5ExprPhrase**)sqlite3Fts5MallocZero(&rc, sizeof(Fts5ExprPhrase*)); } if( rc==SQLITE_OK ){ pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5ExprNode)); } if( rc==SQLITE_OK ){ pNew->pRoot->pNear = (Fts5ExprNearset*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5ExprNearset) + sizeof(Fts5ExprPhrase*)); } if( rc==SQLITE_OK ){ Fts5Colset *pColsetOrig = pOrig->pNode->pNear->pColset; if( pColsetOrig ){ int nByte = sizeof(Fts5Colset) + (pColsetOrig->nCol-1) * sizeof(int); Fts5Colset *pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&rc, nByte); if( pColset ){ memcpy(pColset, pColsetOrig, nByte); } pNew->pRoot->pNear->pColset = pColset; } } if( pOrig->nTerm ){ int i; /* Used to iterate through phrase terms */ for(i=0; rc==SQLITE_OK && inTerm; i++){ int tflags = 0; Fts5ExprTerm *p; for(p=&pOrig->aTerm[i]; p && rc==SQLITE_OK; p=p->pSynonym){ const char *zTerm = p->zTerm; rc = fts5ParseTokenize((void*)&sCtx, tflags, zTerm, (int)strlen(zTerm), 0, 0); tflags = FTS5_TOKEN_COLOCATED; } if( rc==SQLITE_OK ){ sCtx.pPhrase->aTerm[i].bPrefix = pOrig->aTerm[i].bPrefix; } } }else{ /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ sCtx.pPhrase = sqlite3Fts5MallocZero(&rc, sizeof(Fts5ExprPhrase)); } if( rc==SQLITE_OK ){ /* All the allocations succeeded. Put the expression object together. */ pNew->pIndex = pExpr->pIndex; pNew->pConfig = pExpr->pConfig; pNew->nPhrase = 1; pNew->apExprPhrase[0] = sCtx.pPhrase; pNew->pRoot->pNear->apPhrase[0] = sCtx.pPhrase; pNew->pRoot->pNear->nPhrase = 1; sCtx.pPhrase->pNode = pNew->pRoot; if( pOrig->nTerm==1 && pOrig->aTerm[0].pSynonym==0 ){ pNew->pRoot->eType = FTS5_TERM; pNew->pRoot->xNext = fts5ExprNodeNext_TERM; }else{ pNew->pRoot->eType = FTS5_STRING; pNew->pRoot->xNext = fts5ExprNodeNext_STRING; } }else{ sqlite3Fts5ExprFree(pNew); fts5ExprPhraseFree(sCtx.pPhrase); pNew = 0; } *ppNew = pNew; return rc; } /* ** Token pTok has appeared in a MATCH expression where the NEAR operator ** is expected. If token pTok does not contain "NEAR", store an error ** in the pParse object. */ void sqlite3Fts5ParseNear(Fts5Parse *pParse, Fts5Token *pTok){ if( pTok->n!=4 || memcmp("NEAR", pTok->p, 4) ){ sqlite3Fts5ParseError( pParse, "fts5: syntax error near \"%.*s\"", pTok->n, pTok->p ); } } void sqlite3Fts5ParseSetDistance( Fts5Parse *pParse, Fts5ExprNearset *pNear, Fts5Token *p ){ if( pNear ){ int nNear = 0; int i; if( p->n ){ for(i=0; in; i++){ char c = (char)p->p[i]; if( c<'0' || c>'9' ){ sqlite3Fts5ParseError( pParse, "expected integer, got \"%.*s\"", p->n, p->p ); return; } nNear = nNear * 10 + (p->p[i] - '0'); } }else{ nNear = FTS5_DEFAULT_NEARDIST; } pNear->nNear = nNear; } } /* ** The second argument passed to this function may be NULL, or it may be ** an existing Fts5Colset object. This function returns a pointer to ** a new colset object containing the contents of (p) with new value column ** number iCol appended. ** ** If an OOM error occurs, store an error code in pParse and return NULL. ** The old colset object (if any) is not freed in this case. */ static Fts5Colset *fts5ParseColset( Fts5Parse *pParse, /* Store SQLITE_NOMEM here if required */ Fts5Colset *p, /* Existing colset object */ int iCol /* New column to add to colset object */ ){ int nCol = p ? p->nCol : 0; /* Num. columns already in colset object */ Fts5Colset *pNew; /* New colset object to return */ assert( pParse->rc==SQLITE_OK ); assert( iCol>=0 && iColpConfig->nCol ); pNew = sqlite3_realloc(p, sizeof(Fts5Colset) + sizeof(int)*nCol); if( pNew==0 ){ pParse->rc = SQLITE_NOMEM; }else{ int *aiCol = pNew->aiCol; int i, j; for(i=0; iiCol ) break; } for(j=nCol; j>i; j--){ aiCol[j] = aiCol[j-1]; } aiCol[i] = iCol; pNew->nCol = nCol+1; #ifndef NDEBUG /* Check that the array is in order and contains no duplicate entries. */ for(i=1; inCol; i++) assert( pNew->aiCol[i]>pNew->aiCol[i-1] ); #endif } return pNew; } /* ** Allocate and return an Fts5Colset object specifying the inverse of ** the colset passed as the second argument. Free the colset passed ** as the second argument before returning. */ Fts5Colset *sqlite3Fts5ParseColsetInvert(Fts5Parse *pParse, Fts5Colset *p){ Fts5Colset *pRet; int nCol = pParse->pConfig->nCol; pRet = (Fts5Colset*)sqlite3Fts5MallocZero(&pParse->rc, sizeof(Fts5Colset) + sizeof(int)*nCol ); if( pRet ){ int i; int iOld = 0; for(i=0; i=p->nCol || p->aiCol[iOld]!=i ){ pRet->aiCol[pRet->nCol++] = i; }else{ iOld++; } } } sqlite3_free(p); return pRet; } Fts5Colset *sqlite3Fts5ParseColset( Fts5Parse *pParse, /* Store SQLITE_NOMEM here if required */ Fts5Colset *pColset, /* Existing colset object */ Fts5Token *p ){ Fts5Colset *pRet = 0; int iCol; char *z; /* Dequoted copy of token p */ z = sqlite3Fts5Strndup(&pParse->rc, p->p, p->n); if( pParse->rc==SQLITE_OK ){ Fts5Config *pConfig = pParse->pConfig; sqlite3Fts5Dequote(z); for(iCol=0; iColnCol; iCol++){ if( 0==sqlite3_stricmp(pConfig->azCol[iCol], z) ) break; } if( iCol==pConfig->nCol ){ sqlite3Fts5ParseError(pParse, "no such column: %s", z); }else{ pRet = fts5ParseColset(pParse, pColset, iCol); } sqlite3_free(z); } if( pRet==0 ){ assert( pParse->rc!=SQLITE_OK ); sqlite3_free(pColset); } return pRet; } /* ** If argument pOrig is NULL, or if (*pRc) is set to anything other than ** SQLITE_OK when this function is called, NULL is returned. ** ** Otherwise, a copy of (*pOrig) is made into memory obtained from ** sqlite3Fts5MallocZero() and a pointer to it returned. If the allocation ** fails, (*pRc) is set to SQLITE_NOMEM and NULL is returned. */ static Fts5Colset *fts5CloneColset(int *pRc, Fts5Colset *pOrig){ Fts5Colset *pRet; if( pOrig ){ int nByte = sizeof(Fts5Colset) + (pOrig->nCol-1) * sizeof(int); pRet = (Fts5Colset*)sqlite3Fts5MallocZero(pRc, nByte); if( pRet ){ memcpy(pRet, pOrig, nByte); } }else{ pRet = 0; } return pRet; } /* ** Remove from colset pColset any columns that are not also in colset pMerge. */ static void fts5MergeColset(Fts5Colset *pColset, Fts5Colset *pMerge){ int iIn = 0; /* Next input in pColset */ int iMerge = 0; /* Next input in pMerge */ int iOut = 0; /* Next output slot in pColset */ while( iInnCol && iMergenCol ){ int iDiff = pColset->aiCol[iIn] - pMerge->aiCol[iMerge]; if( iDiff==0 ){ pColset->aiCol[iOut++] = pMerge->aiCol[iMerge]; iMerge++; iIn++; }else if( iDiff>0 ){ iMerge++; }else{ iIn++; } } pColset->nCol = iOut; } /* ** Recursively apply colset pColset to expression node pNode and all of ** its decendents. If (*ppFree) is not NULL, it contains a spare copy ** of pColset. This function may use the spare copy and set (*ppFree) to ** zero, or it may create copies of pColset using fts5CloneColset(). */ static void fts5ParseSetColset( Fts5Parse *pParse, Fts5ExprNode *pNode, Fts5Colset *pColset, Fts5Colset **ppFree ){ if( pParse->rc==SQLITE_OK ){ assert( pNode->eType==FTS5_TERM || pNode->eType==FTS5_STRING || pNode->eType==FTS5_AND || pNode->eType==FTS5_OR || pNode->eType==FTS5_NOT || pNode->eType==FTS5_EOF ); if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){ Fts5ExprNearset *pNear = pNode->pNear; if( pNear->pColset ){ fts5MergeColset(pNear->pColset, pColset); if( pNear->pColset->nCol==0 ){ pNode->eType = FTS5_EOF; pNode->xNext = 0; } }else if( *ppFree ){ pNear->pColset = pColset; *ppFree = 0; }else{ pNear->pColset = fts5CloneColset(&pParse->rc, pColset); } }else{ int i; assert( pNode->eType!=FTS5_EOF || pNode->nChild==0 ); for(i=0; inChild; i++){ fts5ParseSetColset(pParse, pNode->apChild[i], pColset, ppFree); } } } } /* ** Apply colset pColset to expression node pExpr and all of its descendents. */ void sqlite3Fts5ParseSetColset( Fts5Parse *pParse, Fts5ExprNode *pExpr, Fts5Colset *pColset ){ Fts5Colset *pFree = pColset; if( pParse->pConfig->eDetail==FTS5_DETAIL_NONE ){ pParse->rc = SQLITE_ERROR; pParse->zErr = sqlite3_mprintf( "fts5: column queries are not supported (detail=none)" ); }else{ fts5ParseSetColset(pParse, pExpr, pColset, &pFree); } sqlite3_free(pFree); } static void fts5ExprAssignXNext(Fts5ExprNode *pNode){ switch( pNode->eType ){ case FTS5_STRING: { Fts5ExprNearset *pNear = pNode->pNear; if( pNear->nPhrase==1 && pNear->apPhrase[0]->nTerm==1 && pNear->apPhrase[0]->aTerm[0].pSynonym==0 ){ pNode->eType = FTS5_TERM; pNode->xNext = fts5ExprNodeNext_TERM; }else{ pNode->xNext = fts5ExprNodeNext_STRING; } break; }; case FTS5_OR: { pNode->xNext = fts5ExprNodeNext_OR; break; }; case FTS5_AND: { pNode->xNext = fts5ExprNodeNext_AND; break; }; default: assert( pNode->eType==FTS5_NOT ); { pNode->xNext = fts5ExprNodeNext_NOT; break; }; } } static void fts5ExprAddChildren(Fts5ExprNode *p, Fts5ExprNode *pSub){ if( p->eType!=FTS5_NOT && pSub->eType==p->eType ){ int nByte = sizeof(Fts5ExprNode*) * pSub->nChild; memcpy(&p->apChild[p->nChild], pSub->apChild, nByte); p->nChild += pSub->nChild; sqlite3_free(pSub); }else{ p->apChild[p->nChild++] = pSub; } } /* ** Allocate and return a new expression object. If anything goes wrong (i.e. ** OOM error), leave an error code in pParse and return NULL. */ Fts5ExprNode *sqlite3Fts5ParseNode( Fts5Parse *pParse, /* Parse context */ int eType, /* FTS5_STRING, AND, OR or NOT */ Fts5ExprNode *pLeft, /* Left hand child expression */ Fts5ExprNode *pRight, /* Right hand child expression */ Fts5ExprNearset *pNear /* For STRING expressions, the near cluster */ ){ Fts5ExprNode *pRet = 0; if( pParse->rc==SQLITE_OK ){ int nChild = 0; /* Number of children of returned node */ int nByte; /* Bytes of space to allocate for this node */ assert( (eType!=FTS5_STRING && !pNear) || (eType==FTS5_STRING && !pLeft && !pRight) ); if( eType==FTS5_STRING && pNear==0 ) return 0; if( eType!=FTS5_STRING && pLeft==0 ) return pRight; if( eType!=FTS5_STRING && pRight==0 ) return pLeft; if( eType==FTS5_NOT ){ nChild = 2; }else if( eType==FTS5_AND || eType==FTS5_OR ){ nChild = 2; if( pLeft->eType==eType ) nChild += pLeft->nChild-1; if( pRight->eType==eType ) nChild += pRight->nChild-1; } nByte = sizeof(Fts5ExprNode) + sizeof(Fts5ExprNode*)*(nChild-1); pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte); if( pRet ){ pRet->eType = eType; pRet->pNear = pNear; fts5ExprAssignXNext(pRet); if( eType==FTS5_STRING ){ int iPhrase; for(iPhrase=0; iPhrasenPhrase; iPhrase++){ pNear->apPhrase[iPhrase]->pNode = pRet; if( pNear->apPhrase[iPhrase]->nTerm==0 ){ pRet->xNext = 0; pRet->eType = FTS5_EOF; } } if( pParse->pConfig->eDetail!=FTS5_DETAIL_FULL && (pNear->nPhrase!=1 || pNear->apPhrase[0]->nTerm>1) ){ assert( pParse->rc==SQLITE_OK ); pParse->rc = SQLITE_ERROR; assert( pParse->zErr==0 ); pParse->zErr = sqlite3_mprintf( "fts5: %s queries are not supported (detail!=full)", pNear->nPhrase==1 ? "phrase": "NEAR" ); sqlite3_free(pRet); pRet = 0; } }else{ fts5ExprAddChildren(pRet, pLeft); fts5ExprAddChildren(pRet, pRight); } } } if( pRet==0 ){ assert( pParse->rc!=SQLITE_OK ); sqlite3Fts5ParseNodeFree(pLeft); sqlite3Fts5ParseNodeFree(pRight); sqlite3Fts5ParseNearsetFree(pNear); } return pRet; } Fts5ExprNode *sqlite3Fts5ParseImplicitAnd( Fts5Parse *pParse, /* Parse context */ Fts5ExprNode *pLeft, /* Left hand child expression */ Fts5ExprNode *pRight /* Right hand child expression */ ){ Fts5ExprNode *pRet = 0; Fts5ExprNode *pPrev; if( pParse->rc ){ sqlite3Fts5ParseNodeFree(pLeft); sqlite3Fts5ParseNodeFree(pRight); }else{ assert( pLeft->eType==FTS5_STRING || pLeft->eType==FTS5_TERM || pLeft->eType==FTS5_EOF || pLeft->eType==FTS5_AND ); assert( pRight->eType==FTS5_STRING || pRight->eType==FTS5_TERM || pRight->eType==FTS5_EOF ); if( pLeft->eType==FTS5_AND ){ pPrev = pLeft->apChild[pLeft->nChild-1]; }else{ pPrev = pLeft; } assert( pPrev->eType==FTS5_STRING || pPrev->eType==FTS5_TERM || pPrev->eType==FTS5_EOF ); if( pRight->eType==FTS5_EOF ){ assert( pParse->apPhrase[pParse->nPhrase-1]==pRight->pNear->apPhrase[0] ); sqlite3Fts5ParseNodeFree(pRight); pRet = pLeft; pParse->nPhrase--; } else if( pPrev->eType==FTS5_EOF ){ Fts5ExprPhrase **ap; if( pPrev==pLeft ){ pRet = pRight; }else{ pLeft->apChild[pLeft->nChild-1] = pRight; pRet = pLeft; } ap = &pParse->apPhrase[pParse->nPhrase-1-pRight->pNear->nPhrase]; assert( ap[0]==pPrev->pNear->apPhrase[0] ); memmove(ap, &ap[1], sizeof(Fts5ExprPhrase*)*pRight->pNear->nPhrase); pParse->nPhrase--; sqlite3Fts5ParseNodeFree(pPrev); } else{ pRet = sqlite3Fts5ParseNode(pParse, FTS5_AND, pLeft, pRight, 0); } } return pRet; } static char *fts5ExprTermPrint(Fts5ExprTerm *pTerm){ int nByte = 0; Fts5ExprTerm *p; char *zQuoted; /* Determine the maximum amount of space required. */ for(p=pTerm; p; p=p->pSynonym){ nByte += (int)strlen(pTerm->zTerm) * 2 + 3 + 2; } zQuoted = sqlite3_malloc(nByte); if( zQuoted ){ int i = 0; for(p=pTerm; p; p=p->pSynonym){ char *zIn = p->zTerm; zQuoted[i++] = '"'; while( *zIn ){ if( *zIn=='"' ) zQuoted[i++] = '"'; zQuoted[i++] = *zIn++; } zQuoted[i++] = '"'; if( p->pSynonym ) zQuoted[i++] = '|'; } if( pTerm->bPrefix ){ zQuoted[i++] = ' '; zQuoted[i++] = '*'; } zQuoted[i++] = '\0'; } return zQuoted; } static char *fts5PrintfAppend(char *zApp, const char *zFmt, ...){ char *zNew; va_list ap; va_start(ap, zFmt); zNew = sqlite3_vmprintf(zFmt, ap); va_end(ap); if( zApp && zNew ){ char *zNew2 = sqlite3_mprintf("%s%s", zApp, zNew); sqlite3_free(zNew); zNew = zNew2; } sqlite3_free(zApp); return zNew; } /* ** Compose a tcl-readable representation of expression pExpr. Return a ** pointer to a buffer containing that representation. It is the ** responsibility of the caller to at some point free the buffer using ** sqlite3_free(). */ static char *fts5ExprPrintTcl( Fts5Config *pConfig, const char *zNearsetCmd, Fts5ExprNode *pExpr ){ char *zRet = 0; if( pExpr->eType==FTS5_STRING || pExpr->eType==FTS5_TERM ){ Fts5ExprNearset *pNear = pExpr->pNear; int i; int iTerm; zRet = fts5PrintfAppend(zRet, "%s ", zNearsetCmd); if( zRet==0 ) return 0; if( pNear->pColset ){ int *aiCol = pNear->pColset->aiCol; int nCol = pNear->pColset->nCol; if( nCol==1 ){ zRet = fts5PrintfAppend(zRet, "-col %d ", aiCol[0]); }else{ zRet = fts5PrintfAppend(zRet, "-col {%d", aiCol[0]); for(i=1; ipColset->nCol; i++){ zRet = fts5PrintfAppend(zRet, " %d", aiCol[i]); } zRet = fts5PrintfAppend(zRet, "} "); } if( zRet==0 ) return 0; } if( pNear->nPhrase>1 ){ zRet = fts5PrintfAppend(zRet, "-near %d ", pNear->nNear); if( zRet==0 ) return 0; } zRet = fts5PrintfAppend(zRet, "--"); if( zRet==0 ) return 0; for(i=0; inPhrase; i++){ Fts5ExprPhrase *pPhrase = pNear->apPhrase[i]; zRet = fts5PrintfAppend(zRet, " {"); for(iTerm=0; zRet && iTermnTerm; iTerm++){ char *zTerm = pPhrase->aTerm[iTerm].zTerm; zRet = fts5PrintfAppend(zRet, "%s%s", iTerm==0?"":" ", zTerm); if( pPhrase->aTerm[iTerm].bPrefix ){ zRet = fts5PrintfAppend(zRet, "*"); } } if( zRet ) zRet = fts5PrintfAppend(zRet, "}"); if( zRet==0 ) return 0; } }else{ char const *zOp = 0; int i; switch( pExpr->eType ){ case FTS5_AND: zOp = "AND"; break; case FTS5_NOT: zOp = "NOT"; break; default: assert( pExpr->eType==FTS5_OR ); zOp = "OR"; break; } zRet = sqlite3_mprintf("%s", zOp); for(i=0; zRet && inChild; i++){ char *z = fts5ExprPrintTcl(pConfig, zNearsetCmd, pExpr->apChild[i]); if( !z ){ sqlite3_free(zRet); zRet = 0; }else{ zRet = fts5PrintfAppend(zRet, " [%z]", z); } } } return zRet; } static char *fts5ExprPrint(Fts5Config *pConfig, Fts5ExprNode *pExpr){ char *zRet = 0; if( pExpr->eType==0 ){ return sqlite3_mprintf("\"\""); }else if( pExpr->eType==FTS5_STRING || pExpr->eType==FTS5_TERM ){ Fts5ExprNearset *pNear = pExpr->pNear; int i; int iTerm; if( pNear->pColset ){ int iCol = pNear->pColset->aiCol[0]; zRet = fts5PrintfAppend(zRet, "%s : ", pConfig->azCol[iCol]); if( zRet==0 ) return 0; } if( pNear->nPhrase>1 ){ zRet = fts5PrintfAppend(zRet, "NEAR("); if( zRet==0 ) return 0; } for(i=0; inPhrase; i++){ Fts5ExprPhrase *pPhrase = pNear->apPhrase[i]; if( i!=0 ){ zRet = fts5PrintfAppend(zRet, " "); if( zRet==0 ) return 0; } for(iTerm=0; iTermnTerm; iTerm++){ char *zTerm = fts5ExprTermPrint(&pPhrase->aTerm[iTerm]); if( zTerm ){ zRet = fts5PrintfAppend(zRet, "%s%s", iTerm==0?"":" + ", zTerm); sqlite3_free(zTerm); } if( zTerm==0 || zRet==0 ){ sqlite3_free(zRet); return 0; } } } if( pNear->nPhrase>1 ){ zRet = fts5PrintfAppend(zRet, ", %d)", pNear->nNear); if( zRet==0 ) return 0; } }else{ char const *zOp = 0; int i; switch( pExpr->eType ){ case FTS5_AND: zOp = " AND "; break; case FTS5_NOT: zOp = " NOT "; break; default: assert( pExpr->eType==FTS5_OR ); zOp = " OR "; break; } for(i=0; inChild; i++){ char *z = fts5ExprPrint(pConfig, pExpr->apChild[i]); if( z==0 ){ sqlite3_free(zRet); zRet = 0; }else{ int e = pExpr->apChild[i]->eType; int b = (e!=FTS5_STRING && e!=FTS5_TERM && e!=FTS5_EOF); zRet = fts5PrintfAppend(zRet, "%s%s%z%s", (i==0 ? "" : zOp), (b?"(":""), z, (b?")":"") ); } if( zRet==0 ) break; } } return zRet; } /* ** The implementation of user-defined scalar functions fts5_expr() (bTcl==0) ** and fts5_expr_tcl() (bTcl!=0). */ static void fts5ExprFunction( sqlite3_context *pCtx, /* Function call context */ int nArg, /* Number of args */ sqlite3_value **apVal, /* Function arguments */ int bTcl ){ Fts5Global *pGlobal = (Fts5Global*)sqlite3_user_data(pCtx); sqlite3 *db = sqlite3_context_db_handle(pCtx); const char *zExpr = 0; char *zErr = 0; Fts5Expr *pExpr = 0; int rc; int i; const char **azConfig; /* Array of arguments for Fts5Config */ const char *zNearsetCmd = "nearset"; int nConfig; /* Size of azConfig[] */ Fts5Config *pConfig = 0; int iArg = 1; if( nArg<1 ){ zErr = sqlite3_mprintf("wrong number of arguments to function %s", bTcl ? "fts5_expr_tcl" : "fts5_expr" ); sqlite3_result_error(pCtx, zErr, -1); sqlite3_free(zErr); return; } if( bTcl && nArg>1 ){ zNearsetCmd = (const char*)sqlite3_value_text(apVal[1]); iArg = 2; } nConfig = 3 + (nArg-iArg); azConfig = (const char**)sqlite3_malloc(sizeof(char*) * nConfig); if( azConfig==0 ){ sqlite3_result_error_nomem(pCtx); return; } azConfig[0] = 0; azConfig[1] = "main"; azConfig[2] = "tbl"; for(i=3; iArgnCol, zExpr, &pExpr, &zErr); } if( rc==SQLITE_OK ){ char *zText; if( pExpr->pRoot->xNext==0 ){ zText = sqlite3_mprintf(""); }else if( bTcl ){ zText = fts5ExprPrintTcl(pConfig, zNearsetCmd, pExpr->pRoot); }else{ zText = fts5ExprPrint(pConfig, pExpr->pRoot); } if( zText==0 ){ rc = SQLITE_NOMEM; }else{ sqlite3_result_text(pCtx, zText, -1, SQLITE_TRANSIENT); sqlite3_free(zText); } } if( rc!=SQLITE_OK ){ if( zErr ){ sqlite3_result_error(pCtx, zErr, -1); sqlite3_free(zErr); }else{ sqlite3_result_error_code(pCtx, rc); } } sqlite3_free((void *)azConfig); sqlite3Fts5ConfigFree(pConfig); sqlite3Fts5ExprFree(pExpr); } static void fts5ExprFunctionHr( sqlite3_context *pCtx, /* Function call context */ int nArg, /* Number of args */ sqlite3_value **apVal /* Function arguments */ ){ fts5ExprFunction(pCtx, nArg, apVal, 0); } static void fts5ExprFunctionTcl( sqlite3_context *pCtx, /* Function call context */ int nArg, /* Number of args */ sqlite3_value **apVal /* Function arguments */ ){ fts5ExprFunction(pCtx, nArg, apVal, 1); } /* ** The implementation of an SQLite user-defined-function that accepts a ** single integer as an argument. If the integer is an alpha-numeric ** unicode code point, 1 is returned. Otherwise 0. */ static void fts5ExprIsAlnum( sqlite3_context *pCtx, /* Function call context */ int nArg, /* Number of args */ sqlite3_value **apVal /* Function arguments */ ){ int iCode; if( nArg!=1 ){ sqlite3_result_error(pCtx, "wrong number of arguments to function fts5_isalnum", -1 ); return; } iCode = sqlite3_value_int(apVal[0]); sqlite3_result_int(pCtx, sqlite3Fts5UnicodeIsalnum(iCode)); } static void fts5ExprFold( sqlite3_context *pCtx, /* Function call context */ int nArg, /* Number of args */ sqlite3_value **apVal /* Function arguments */ ){ if( nArg!=1 && nArg!=2 ){ sqlite3_result_error(pCtx, "wrong number of arguments to function fts5_fold", -1 ); }else{ int iCode; int bRemoveDiacritics = 0; iCode = sqlite3_value_int(apVal[0]); if( nArg==2 ) bRemoveDiacritics = sqlite3_value_int(apVal[1]); sqlite3_result_int(pCtx, sqlite3Fts5UnicodeFold(iCode, bRemoveDiacritics)); } } /* ** This is called during initialization to register the fts5_expr() scalar ** UDF with the SQLite handle passed as the only argument. */ int sqlite3Fts5ExprInit(Fts5Global *pGlobal, sqlite3 *db){ struct Fts5ExprFunc { const char *z; void (*x)(sqlite3_context*,int,sqlite3_value**); } aFunc[] = { { "fts5_expr", fts5ExprFunctionHr }, { "fts5_expr_tcl", fts5ExprFunctionTcl }, { "fts5_isalnum", fts5ExprIsAlnum }, { "fts5_fold", fts5ExprFold }, }; int i; int rc = SQLITE_OK; void *pCtx = (void*)pGlobal; for(i=0; rc==SQLITE_OK && iz, -1, SQLITE_UTF8, pCtx, p->x, 0, 0); } /* Avoid a warning indicating that sqlite3Fts5ParserTrace() is unused */ #ifndef NDEBUG (void)sqlite3Fts5ParserTrace; #endif return rc; } /* ** Return the number of phrases in expression pExpr. */ int sqlite3Fts5ExprPhraseCount(Fts5Expr *pExpr){ return (pExpr ? pExpr->nPhrase : 0); } /* ** Return the number of terms in the iPhrase'th phrase in pExpr. */ int sqlite3Fts5ExprPhraseSize(Fts5Expr *pExpr, int iPhrase){ if( iPhrase<0 || iPhrase>=pExpr->nPhrase ) return 0; return pExpr->apExprPhrase[iPhrase]->nTerm; } /* ** This function is used to access the current position list for phrase ** iPhrase. */ int sqlite3Fts5ExprPoslist(Fts5Expr *pExpr, int iPhrase, const u8 **pa){ int nRet; Fts5ExprPhrase *pPhrase = pExpr->apExprPhrase[iPhrase]; Fts5ExprNode *pNode = pPhrase->pNode; if( pNode->bEof==0 && pNode->iRowid==pExpr->pRoot->iRowid ){ *pa = pPhrase->poslist.p; nRet = pPhrase->poslist.n; }else{ *pa = 0; nRet = 0; } return nRet; } struct Fts5PoslistPopulator { Fts5PoslistWriter writer; int bOk; /* True if ok to populate */ int bMiss; }; Fts5PoslistPopulator *sqlite3Fts5ExprClearPoslists(Fts5Expr *pExpr, int bLive){ Fts5PoslistPopulator *pRet; pRet = sqlite3_malloc(sizeof(Fts5PoslistPopulator)*pExpr->nPhrase); if( pRet ){ int i; memset(pRet, 0, sizeof(Fts5PoslistPopulator)*pExpr->nPhrase); for(i=0; inPhrase; i++){ Fts5Buffer *pBuf = &pExpr->apExprPhrase[i]->poslist; Fts5ExprNode *pNode = pExpr->apExprPhrase[i]->pNode; assert( pExpr->apExprPhrase[i]->nTerm==1 ); if( bLive && (pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof) ){ pRet[i].bMiss = 1; }else{ pBuf->n = 0; } } } return pRet; } struct Fts5ExprCtx { Fts5Expr *pExpr; Fts5PoslistPopulator *aPopulator; i64 iOff; }; typedef struct Fts5ExprCtx Fts5ExprCtx; /* ** TODO: Make this more efficient! */ static int fts5ExprColsetTest(Fts5Colset *pColset, int iCol){ int i; for(i=0; inCol; i++){ if( pColset->aiCol[i]==iCol ) return 1; } return 0; } static int fts5ExprPopulatePoslistsCb( void *pCtx, /* Copy of 2nd argument to xTokenize() */ int tflags, /* Mask of FTS5_TOKEN_* flags */ const char *pToken, /* Pointer to buffer containing token */ int nToken, /* Size of token in bytes */ int iUnused1, /* Byte offset of token within input text */ int iUnused2 /* Byte offset of end of token within input text */ ){ Fts5ExprCtx *p = (Fts5ExprCtx*)pCtx; Fts5Expr *pExpr = p->pExpr; int i; UNUSED_PARAM2(iUnused1, iUnused2); if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE; if( (tflags & FTS5_TOKEN_COLOCATED)==0 ) p->iOff++; for(i=0; inPhrase; i++){ Fts5ExprTerm *pTerm; if( p->aPopulator[i].bOk==0 ) continue; for(pTerm=&pExpr->apExprPhrase[i]->aTerm[0]; pTerm; pTerm=pTerm->pSynonym){ int nTerm = (int)strlen(pTerm->zTerm); if( (nTerm==nToken || (nTermbPrefix)) && memcmp(pTerm->zTerm, pToken, nTerm)==0 ){ int rc = sqlite3Fts5PoslistWriterAppend( &pExpr->apExprPhrase[i]->poslist, &p->aPopulator[i].writer, p->iOff ); if( rc ) return rc; break; } } } return SQLITE_OK; } int sqlite3Fts5ExprPopulatePoslists( Fts5Config *pConfig, Fts5Expr *pExpr, Fts5PoslistPopulator *aPopulator, int iCol, const char *z, int n ){ int i; Fts5ExprCtx sCtx; sCtx.pExpr = pExpr; sCtx.aPopulator = aPopulator; sCtx.iOff = (((i64)iCol) << 32) - 1; for(i=0; inPhrase; i++){ Fts5ExprNode *pNode = pExpr->apExprPhrase[i]->pNode; Fts5Colset *pColset = pNode->pNear->pColset; if( (pColset && 0==fts5ExprColsetTest(pColset, iCol)) || aPopulator[i].bMiss ){ aPopulator[i].bOk = 0; }else{ aPopulator[i].bOk = 1; } } return sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, z, n, (void*)&sCtx, fts5ExprPopulatePoslistsCb ); } static void fts5ExprClearPoslists(Fts5ExprNode *pNode){ if( pNode->eType==FTS5_TERM || pNode->eType==FTS5_STRING ){ pNode->pNear->apPhrase[0]->poslist.n = 0; }else{ int i; for(i=0; inChild; i++){ fts5ExprClearPoslists(pNode->apChild[i]); } } } static int fts5ExprCheckPoslists(Fts5ExprNode *pNode, i64 iRowid){ pNode->iRowid = iRowid; pNode->bEof = 0; switch( pNode->eType ){ case FTS5_TERM: case FTS5_STRING: return (pNode->pNear->apPhrase[0]->poslist.n>0); case FTS5_AND: { int i; for(i=0; inChild; i++){ if( fts5ExprCheckPoslists(pNode->apChild[i], iRowid)==0 ){ fts5ExprClearPoslists(pNode); return 0; } } break; } case FTS5_OR: { int i; int bRet = 0; for(i=0; inChild; i++){ if( fts5ExprCheckPoslists(pNode->apChild[i], iRowid) ){ bRet = 1; } } return bRet; } default: { assert( pNode->eType==FTS5_NOT ); if( 0==fts5ExprCheckPoslists(pNode->apChild[0], iRowid) || 0!=fts5ExprCheckPoslists(pNode->apChild[1], iRowid) ){ fts5ExprClearPoslists(pNode); return 0; } break; } } return 1; } void sqlite3Fts5ExprCheckPoslists(Fts5Expr *pExpr, i64 iRowid){ fts5ExprCheckPoslists(pExpr->pRoot, iRowid); } /* ** This function is only called for detail=columns tables. */ int sqlite3Fts5ExprPhraseCollist( Fts5Expr *pExpr, int iPhrase, const u8 **ppCollist, int *pnCollist ){ Fts5ExprPhrase *pPhrase = pExpr->apExprPhrase[iPhrase]; Fts5ExprNode *pNode = pPhrase->pNode; int rc = SQLITE_OK; assert( iPhrase>=0 && iPhrasenPhrase ); assert( pExpr->pConfig->eDetail==FTS5_DETAIL_COLUMNS ); if( pNode->bEof==0 && pNode->iRowid==pExpr->pRoot->iRowid && pPhrase->poslist.n>0 ){ Fts5ExprTerm *pTerm = &pPhrase->aTerm[0]; if( pTerm->pSynonym ){ Fts5Buffer *pBuf = (Fts5Buffer*)&pTerm->pSynonym[1]; rc = fts5ExprSynonymList( pTerm, pNode->iRowid, pBuf, (u8**)ppCollist, pnCollist ); }else{ *ppCollist = pPhrase->aTerm[0].pIter->pData; *pnCollist = pPhrase->aTerm[0].pIter->nData; } }else{ *ppCollist = 0; *pnCollist = 0; } return rc; } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_hash.c ================================================ /* ** 2014 August 11 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** */ #include "fts5Int.h" typedef struct Fts5HashEntry Fts5HashEntry; /* ** This file contains the implementation of an in-memory hash table used ** to accumuluate "term -> doclist" content before it is flused to a level-0 ** segment. */ struct Fts5Hash { int eDetail; /* Copy of Fts5Config.eDetail */ int *pnByte; /* Pointer to bytes counter */ int nEntry; /* Number of entries currently in hash */ int nSlot; /* Size of aSlot[] array */ Fts5HashEntry *pScan; /* Current ordered scan item */ Fts5HashEntry **aSlot; /* Array of hash slots */ }; /* ** Each entry in the hash table is represented by an object of the ** following type. Each object, its key (a nul-terminated string) and ** its current data are stored in a single memory allocation. The ** key immediately follows the object in memory. The position list ** data immediately follows the key data in memory. ** ** The data that follows the key is in a similar, but not identical format ** to the doclist data stored in the database. It is: ** ** * Rowid, as a varint ** * Position list, without 0x00 terminator. ** * Size of previous position list and rowid, as a 4 byte ** big-endian integer. ** ** iRowidOff: ** Offset of last rowid written to data area. Relative to first byte of ** structure. ** ** nData: ** Bytes of data written since iRowidOff. */ struct Fts5HashEntry { Fts5HashEntry *pHashNext; /* Next hash entry with same hash-key */ Fts5HashEntry *pScanNext; /* Next entry in sorted order */ int nAlloc; /* Total size of allocation */ int iSzPoslist; /* Offset of space for 4-byte poslist size */ int nData; /* Total bytes of data (incl. structure) */ int nKey; /* Length of key in bytes */ u8 bDel; /* Set delete-flag @ iSzPoslist */ u8 bContent; /* Set content-flag (detail=none mode) */ i16 iCol; /* Column of last value written */ int iPos; /* Position of last value written */ i64 iRowid; /* Rowid of last value written */ }; /* ** Eqivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ #define fts5EntryKey(p) ( ((char *)(&(p)[1])) ) /* ** Allocate a new hash table. */ int sqlite3Fts5HashNew(Fts5Config *pConfig, Fts5Hash **ppNew, int *pnByte){ int rc = SQLITE_OK; Fts5Hash *pNew; *ppNew = pNew = (Fts5Hash*)sqlite3_malloc(sizeof(Fts5Hash)); if( pNew==0 ){ rc = SQLITE_NOMEM; }else{ int nByte; memset(pNew, 0, sizeof(Fts5Hash)); pNew->pnByte = pnByte; pNew->eDetail = pConfig->eDetail; pNew->nSlot = 1024; nByte = sizeof(Fts5HashEntry*) * pNew->nSlot; pNew->aSlot = (Fts5HashEntry**)sqlite3_malloc(nByte); if( pNew->aSlot==0 ){ sqlite3_free(pNew); *ppNew = 0; rc = SQLITE_NOMEM; }else{ memset(pNew->aSlot, 0, nByte); } } return rc; } /* ** Free a hash table object. */ void sqlite3Fts5HashFree(Fts5Hash *pHash){ if( pHash ){ sqlite3Fts5HashClear(pHash); sqlite3_free(pHash->aSlot); sqlite3_free(pHash); } } /* ** Empty (but do not delete) a hash table. */ void sqlite3Fts5HashClear(Fts5Hash *pHash){ int i; for(i=0; inSlot; i++){ Fts5HashEntry *pNext; Fts5HashEntry *pSlot; for(pSlot=pHash->aSlot[i]; pSlot; pSlot=pNext){ pNext = pSlot->pHashNext; sqlite3_free(pSlot); } } memset(pHash->aSlot, 0, pHash->nSlot * sizeof(Fts5HashEntry*)); pHash->nEntry = 0; } static unsigned int fts5HashKey(int nSlot, const u8 *p, int n){ int i; unsigned int h = 13; for(i=n-1; i>=0; i--){ h = (h << 3) ^ h ^ p[i]; } return (h % nSlot); } static unsigned int fts5HashKey2(int nSlot, u8 b, const u8 *p, int n){ int i; unsigned int h = 13; for(i=n-1; i>=0; i--){ h = (h << 3) ^ h ^ p[i]; } h = (h << 3) ^ h ^ b; return (h % nSlot); } /* ** Resize the hash table by doubling the number of slots. */ static int fts5HashResize(Fts5Hash *pHash){ int nNew = pHash->nSlot*2; int i; Fts5HashEntry **apNew; Fts5HashEntry **apOld = pHash->aSlot; apNew = (Fts5HashEntry**)sqlite3_malloc(nNew*sizeof(Fts5HashEntry*)); if( !apNew ) return SQLITE_NOMEM; memset(apNew, 0, nNew*sizeof(Fts5HashEntry*)); for(i=0; inSlot; i++){ while( apOld[i] ){ unsigned int iHash; Fts5HashEntry *p = apOld[i]; apOld[i] = p->pHashNext; iHash = fts5HashKey(nNew, (u8*)fts5EntryKey(p), (int)strlen(fts5EntryKey(p))); p->pHashNext = apNew[iHash]; apNew[iHash] = p; } } sqlite3_free(apOld); pHash->nSlot = nNew; pHash->aSlot = apNew; return SQLITE_OK; } static void fts5HashAddPoslistSize(Fts5Hash *pHash, Fts5HashEntry *p){ if( p->iSzPoslist ){ u8 *pPtr = (u8*)p; if( pHash->eDetail==FTS5_DETAIL_NONE ){ assert( p->nData==p->iSzPoslist ); if( p->bDel ){ pPtr[p->nData++] = 0x00; if( p->bContent ){ pPtr[p->nData++] = 0x00; } } }else{ int nSz = (p->nData - p->iSzPoslist - 1); /* Size in bytes */ int nPos = nSz*2 + p->bDel; /* Value of nPos field */ assert( p->bDel==0 || p->bDel==1 ); if( nPos<=127 ){ pPtr[p->iSzPoslist] = (u8)nPos; }else{ int nByte = sqlite3Fts5GetVarintLen((u32)nPos); memmove(&pPtr[p->iSzPoslist + nByte], &pPtr[p->iSzPoslist + 1], nSz); sqlite3Fts5PutVarint(&pPtr[p->iSzPoslist], nPos); p->nData += (nByte-1); } } p->iSzPoslist = 0; p->bDel = 0; p->bContent = 0; } } /* ** Add an entry to the in-memory hash table. The key is the concatenation ** of bByte and (pToken/nToken). The value is (iRowid/iCol/iPos). ** ** (bByte || pToken) -> (iRowid,iCol,iPos) ** ** Or, if iCol is negative, then the value is a delete marker. */ int sqlite3Fts5HashWrite( Fts5Hash *pHash, i64 iRowid, /* Rowid for this entry */ int iCol, /* Column token appears in (-ve -> delete) */ int iPos, /* Position of token within column */ char bByte, /* First byte of token */ const char *pToken, int nToken /* Token to add or remove to or from index */ ){ unsigned int iHash; Fts5HashEntry *p; u8 *pPtr; int nIncr = 0; /* Amount to increment (*pHash->pnByte) by */ int bNew; /* If non-delete entry should be written */ bNew = (pHash->eDetail==FTS5_DETAIL_FULL); /* Attempt to locate an existing hash entry */ iHash = fts5HashKey2(pHash->nSlot, (u8)bByte, (const u8*)pToken, nToken); for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ char *zKey = fts5EntryKey(p); if( zKey[0]==bByte && p->nKey==nToken && memcmp(&zKey[1], pToken, nToken)==0 ){ break; } } /* If an existing hash entry cannot be found, create a new one. */ if( p==0 ){ /* Figure out how much space to allocate */ char *zKey; int nByte = sizeof(Fts5HashEntry) + (nToken+1) + 1 + 64; if( nByte<128 ) nByte = 128; /* Grow the Fts5Hash.aSlot[] array if necessary. */ if( (pHash->nEntry*2)>=pHash->nSlot ){ int rc = fts5HashResize(pHash); if( rc!=SQLITE_OK ) return rc; iHash = fts5HashKey2(pHash->nSlot, (u8)bByte, (const u8*)pToken, nToken); } /* Allocate new Fts5HashEntry and add it to the hash table. */ p = (Fts5HashEntry*)sqlite3_malloc(nByte); if( !p ) return SQLITE_NOMEM; memset(p, 0, sizeof(Fts5HashEntry)); p->nAlloc = nByte; zKey = fts5EntryKey(p); zKey[0] = bByte; memcpy(&zKey[1], pToken, nToken); assert( iHash==fts5HashKey(pHash->nSlot, (u8*)zKey, nToken+1) ); p->nKey = nToken; zKey[nToken+1] = '\0'; p->nData = nToken+1 + 1 + sizeof(Fts5HashEntry); p->pHashNext = pHash->aSlot[iHash]; pHash->aSlot[iHash] = p; pHash->nEntry++; /* Add the first rowid field to the hash-entry */ p->nData += sqlite3Fts5PutVarint(&((u8*)p)[p->nData], iRowid); p->iRowid = iRowid; p->iSzPoslist = p->nData; if( pHash->eDetail!=FTS5_DETAIL_NONE ){ p->nData += 1; p->iCol = (pHash->eDetail==FTS5_DETAIL_FULL ? 0 : -1); } nIncr += p->nData; }else{ /* Appending to an existing hash-entry. Check that there is enough ** space to append the largest possible new entry. Worst case scenario ** is: ** ** + 9 bytes for a new rowid, ** + 4 byte reserved for the "poslist size" varint. ** + 1 byte for a "new column" byte, ** + 3 bytes for a new column number (16-bit max) as a varint, ** + 5 bytes for the new position offset (32-bit max). */ if( (p->nAlloc - p->nData) < (9 + 4 + 1 + 3 + 5) ){ int nNew = p->nAlloc * 2; Fts5HashEntry *pNew; Fts5HashEntry **pp; pNew = (Fts5HashEntry*)sqlite3_realloc(p, nNew); if( pNew==0 ) return SQLITE_NOMEM; pNew->nAlloc = nNew; for(pp=&pHash->aSlot[iHash]; *pp!=p; pp=&(*pp)->pHashNext); *pp = pNew; p = pNew; } nIncr -= p->nData; } assert( (p->nAlloc - p->nData) >= (9 + 4 + 1 + 3 + 5) ); pPtr = (u8*)p; /* If this is a new rowid, append the 4-byte size field for the previous ** entry, and the new rowid for this entry. */ if( iRowid!=p->iRowid ){ fts5HashAddPoslistSize(pHash, p); p->nData += sqlite3Fts5PutVarint(&pPtr[p->nData], iRowid - p->iRowid); p->iRowid = iRowid; bNew = 1; p->iSzPoslist = p->nData; if( pHash->eDetail!=FTS5_DETAIL_NONE ){ p->nData += 1; p->iCol = (pHash->eDetail==FTS5_DETAIL_FULL ? 0 : -1); p->iPos = 0; } } if( iCol>=0 ){ if( pHash->eDetail==FTS5_DETAIL_NONE ){ p->bContent = 1; }else{ /* Append a new column value, if necessary */ assert( iCol>=p->iCol ); if( iCol!=p->iCol ){ if( pHash->eDetail==FTS5_DETAIL_FULL ){ pPtr[p->nData++] = 0x01; p->nData += sqlite3Fts5PutVarint(&pPtr[p->nData], iCol); p->iCol = (i16)iCol; p->iPos = 0; }else{ bNew = 1; p->iCol = (i16)(iPos = iCol); } } /* Append the new position offset, if necessary */ if( bNew ){ p->nData += sqlite3Fts5PutVarint(&pPtr[p->nData], iPos - p->iPos + 2); p->iPos = iPos; } } }else{ /* This is a delete. Set the delete flag. */ p->bDel = 1; } nIncr += p->nData; *pHash->pnByte += nIncr; return SQLITE_OK; } /* ** Arguments pLeft and pRight point to linked-lists of hash-entry objects, ** each sorted in key order. This function merges the two lists into a ** single list and returns a pointer to its first element. */ static Fts5HashEntry *fts5HashEntryMerge( Fts5HashEntry *pLeft, Fts5HashEntry *pRight ){ Fts5HashEntry *p1 = pLeft; Fts5HashEntry *p2 = pRight; Fts5HashEntry *pRet = 0; Fts5HashEntry **ppOut = &pRet; while( p1 || p2 ){ if( p1==0 ){ *ppOut = p2; p2 = 0; }else if( p2==0 ){ *ppOut = p1; p1 = 0; }else{ int i = 0; char *zKey1 = fts5EntryKey(p1); char *zKey2 = fts5EntryKey(p2); while( zKey1[i]==zKey2[i] ) i++; if( ((u8)zKey1[i])>((u8)zKey2[i]) ){ /* p2 is smaller */ *ppOut = p2; ppOut = &p2->pScanNext; p2 = p2->pScanNext; }else{ /* p1 is smaller */ *ppOut = p1; ppOut = &p1->pScanNext; p1 = p1->pScanNext; } *ppOut = 0; } } return pRet; } /* ** Extract all tokens from hash table iHash and link them into a list ** in sorted order. The hash table is cleared before returning. It is ** the responsibility of the caller to free the elements of the returned ** list. */ static int fts5HashEntrySort( Fts5Hash *pHash, const char *pTerm, int nTerm, /* Query prefix, if any */ Fts5HashEntry **ppSorted ){ const int nMergeSlot = 32; Fts5HashEntry **ap; Fts5HashEntry *pList; int iSlot; int i; *ppSorted = 0; ap = sqlite3_malloc(sizeof(Fts5HashEntry*) * nMergeSlot); if( !ap ) return SQLITE_NOMEM; memset(ap, 0, sizeof(Fts5HashEntry*) * nMergeSlot); for(iSlot=0; iSlotnSlot; iSlot++){ Fts5HashEntry *pIter; for(pIter=pHash->aSlot[iSlot]; pIter; pIter=pIter->pHashNext){ if( pTerm==0 || 0==memcmp(fts5EntryKey(pIter), pTerm, nTerm) ){ Fts5HashEntry *pEntry = pIter; pEntry->pScanNext = 0; for(i=0; ap[i]; i++){ pEntry = fts5HashEntryMerge(pEntry, ap[i]); ap[i] = 0; } ap[i] = pEntry; } } } pList = 0; for(i=0; inEntry = 0; sqlite3_free(ap); *ppSorted = pList; return SQLITE_OK; } /* ** Query the hash table for a doclist associated with term pTerm/nTerm. */ int sqlite3Fts5HashQuery( Fts5Hash *pHash, /* Hash table to query */ const char *pTerm, int nTerm, /* Query term */ const u8 **ppDoclist, /* OUT: Pointer to doclist for pTerm */ int *pnDoclist /* OUT: Size of doclist in bytes */ ){ unsigned int iHash = fts5HashKey(pHash->nSlot, (const u8*)pTerm, nTerm); char *zKey = 0; Fts5HashEntry *p; for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ zKey = fts5EntryKey(p); if( memcmp(zKey, pTerm, nTerm)==0 && zKey[nTerm]==0 ) break; } if( p ){ fts5HashAddPoslistSize(pHash, p); *ppDoclist = (const u8*)&zKey[nTerm+1]; *pnDoclist = p->nData - (sizeof(Fts5HashEntry) + nTerm + 1); }else{ *ppDoclist = 0; *pnDoclist = 0; } return SQLITE_OK; } int sqlite3Fts5HashScanInit( Fts5Hash *p, /* Hash table to query */ const char *pTerm, int nTerm /* Query prefix */ ){ return fts5HashEntrySort(p, pTerm, nTerm, &p->pScan); } void sqlite3Fts5HashScanNext(Fts5Hash *p){ assert( !sqlite3Fts5HashScanEof(p) ); p->pScan = p->pScan->pScanNext; } int sqlite3Fts5HashScanEof(Fts5Hash *p){ return (p->pScan==0); } void sqlite3Fts5HashScanEntry( Fts5Hash *pHash, const char **pzTerm, /* OUT: term (nul-terminated) */ const u8 **ppDoclist, /* OUT: pointer to doclist */ int *pnDoclist /* OUT: size of doclist in bytes */ ){ Fts5HashEntry *p; if( (p = pHash->pScan) ){ char *zKey = fts5EntryKey(p); int nTerm = (int)strlen(zKey); fts5HashAddPoslistSize(pHash, p); *pzTerm = zKey; *ppDoclist = (const u8*)&zKey[nTerm+1]; *pnDoclist = p->nData - (sizeof(Fts5HashEntry) + nTerm + 1); }else{ *pzTerm = 0; *ppDoclist = 0; *pnDoclist = 0; } } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_index.c ================================================ /* ** 2014 May 31 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** Low level access to the FTS index stored in the database file. The ** routines in this file file implement all read and write access to the ** %_data table. Other parts of the system access this functionality via ** the interface defined in fts5Int.h. */ #include "fts5Int.h" /* ** Overview: ** ** The %_data table contains all the FTS indexes for an FTS5 virtual table. ** As well as the main term index, there may be up to 31 prefix indexes. ** The format is similar to FTS3/4, except that: ** ** * all segment b-tree leaf data is stored in fixed size page records ** (e.g. 1000 bytes). A single doclist may span multiple pages. Care is ** taken to ensure it is possible to iterate in either direction through ** the entries in a doclist, or to seek to a specific entry within a ** doclist, without loading it into memory. ** ** * large doclists that span many pages have associated "doclist index" ** records that contain a copy of the first rowid on each page spanned by ** the doclist. This is used to speed up seek operations, and merges of ** large doclists with very small doclists. ** ** * extra fields in the "structure record" record the state of ongoing ** incremental merge operations. ** */ #define FTS5_OPT_WORK_UNIT 1000 /* Number of leaf pages per optimize step */ #define FTS5_WORK_UNIT 64 /* Number of leaf pages in unit of work */ #define FTS5_MIN_DLIDX_SIZE 4 /* Add dlidx if this many empty pages */ #define FTS5_MAIN_PREFIX '0' #if FTS5_MAX_PREFIX_INDEXES > 31 # error "FTS5_MAX_PREFIX_INDEXES is too large" #endif /* ** Details: ** ** The %_data table managed by this module, ** ** CREATE TABLE %_data(id INTEGER PRIMARY KEY, block BLOB); ** ** , contains the following 5 types of records. See the comments surrounding ** the FTS5_*_ROWID macros below for a description of how %_data rowids are ** assigned to each fo them. ** ** 1. Structure Records: ** ** The set of segments that make up an index - the index structure - are ** recorded in a single record within the %_data table. The record consists ** of a single 32-bit configuration cookie value followed by a list of ** SQLite varints. If the FTS table features more than one index (because ** there are one or more prefix indexes), it is guaranteed that all share ** the same cookie value. ** ** Immediately following the configuration cookie, the record begins with ** three varints: ** ** + number of levels, ** + total number of segments on all levels, ** + value of write counter. ** ** Then, for each level from 0 to nMax: ** ** + number of input segments in ongoing merge. ** + total number of segments in level. ** + for each segment from oldest to newest: ** + segment id (always > 0) ** + first leaf page number (often 1, always greater than 0) ** + final leaf page number ** ** 2. The Averages Record: ** ** A single record within the %_data table. The data is a list of varints. ** The first value is the number of rows in the index. Then, for each column ** from left to right, the total number of tokens in the column for all ** rows of the table. ** ** 3. Segment leaves: ** ** TERM/DOCLIST FORMAT: ** ** Most of each segment leaf is taken up by term/doclist data. The ** general format of term/doclist, starting with the first term ** on the leaf page, is: ** ** varint : size of first term ** blob: first term data ** doclist: first doclist ** zero-or-more { ** varint: number of bytes in common with previous term ** varint: number of bytes of new term data (nNew) ** blob: nNew bytes of new term data ** doclist: next doclist ** } ** ** doclist format: ** ** varint: first rowid ** poslist: first poslist ** zero-or-more { ** varint: rowid delta (always > 0) ** poslist: next poslist ** } ** ** poslist format: ** ** varint: size of poslist in bytes multiplied by 2, not including ** this field. Plus 1 if this entry carries the "delete" flag. ** collist: collist for column 0 ** zero-or-more { ** 0x01 byte ** varint: column number (I) ** collist: collist for column I ** } ** ** collist format: ** ** varint: first offset + 2 ** zero-or-more { ** varint: offset delta + 2 ** } ** ** PAGE FORMAT ** ** Each leaf page begins with a 4-byte header containing 2 16-bit ** unsigned integer fields in big-endian format. They are: ** ** * The byte offset of the first rowid on the page, if it exists ** and occurs before the first term (otherwise 0). ** ** * The byte offset of the start of the page footer. If the page ** footer is 0 bytes in size, then this field is the same as the ** size of the leaf page in bytes. ** ** The page footer consists of a single varint for each term located ** on the page. Each varint is the byte offset of the current term ** within the page, delta-compressed against the previous value. In ** other words, the first varint in the footer is the byte offset of ** the first term, the second is the byte offset of the second less that ** of the first, and so on. ** ** The term/doclist format described above is accurate if the entire ** term/doclist data fits on a single leaf page. If this is not the case, ** the format is changed in two ways: ** ** + if the first rowid on a page occurs before the first term, it ** is stored as a literal value: ** ** varint: first rowid ** ** + the first term on each page is stored in the same way as the ** very first term of the segment: ** ** varint : size of first term ** blob: first term data ** ** 5. Segment doclist indexes: ** ** Doclist indexes are themselves b-trees, however they usually consist of ** a single leaf record only. The format of each doclist index leaf page ** is: ** ** * Flags byte. Bits are: ** 0x01: Clear if leaf is also the root page, otherwise set. ** ** * Page number of fts index leaf page. As a varint. ** ** * First rowid on page indicated by previous field. As a varint. ** ** * A list of varints, one for each subsequent termless page. A ** positive delta if the termless page contains at least one rowid, ** or an 0x00 byte otherwise. ** ** Internal doclist index nodes are: ** ** * Flags byte. Bits are: ** 0x01: Clear for root page, otherwise set. ** ** * Page number of first child page. As a varint. ** ** * Copy of first rowid on page indicated by previous field. As a varint. ** ** * A list of delta-encoded varints - the first rowid on each subsequent ** child page. ** */ /* ** Rowids for the averages and structure records in the %_data table. */ #define FTS5_AVERAGES_ROWID 1 /* Rowid used for the averages record */ #define FTS5_STRUCTURE_ROWID 10 /* The structure record */ /* ** Macros determining the rowids used by segment leaves and dlidx leaves ** and nodes. All nodes and leaves are stored in the %_data table with large ** positive rowids. ** ** Each segment has a unique non-zero 16-bit id. ** ** The rowid for each segment leaf is found by passing the segment id and ** the leaf page number to the FTS5_SEGMENT_ROWID macro. Leaves are numbered ** sequentially starting from 1. */ #define FTS5_DATA_ID_B 16 /* Max seg id number 65535 */ #define FTS5_DATA_DLI_B 1 /* Doclist-index flag (1 bit) */ #define FTS5_DATA_HEIGHT_B 5 /* Max dlidx tree height of 32 */ #define FTS5_DATA_PAGE_B 31 /* Max page number of 2147483648 */ #define fts5_dri(segid, dlidx, height, pgno) ( \ ((i64)(segid) << (FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)) + \ ((i64)(dlidx) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B)) + \ ((i64)(height) << (FTS5_DATA_PAGE_B)) + \ ((i64)(pgno)) \ ) #define FTS5_SEGMENT_ROWID(segid, pgno) fts5_dri(segid, 0, 0, pgno) #define FTS5_DLIDX_ROWID(segid, height, pgno) fts5_dri(segid, 1, height, pgno) /* ** Maximum segments permitted in a single index */ #define FTS5_MAX_SEGMENT 2000 #ifdef SQLITE_DEBUG int sqlite3Fts5Corrupt() { return SQLITE_CORRUPT_VTAB; } #endif /* ** Each time a blob is read from the %_data table, it is padded with this ** many zero bytes. This makes it easier to decode the various record formats ** without overreading if the records are corrupt. */ #define FTS5_DATA_ZERO_PADDING 8 #define FTS5_DATA_PADDING 20 typedef struct Fts5Data Fts5Data; typedef struct Fts5DlidxIter Fts5DlidxIter; typedef struct Fts5DlidxLvl Fts5DlidxLvl; typedef struct Fts5DlidxWriter Fts5DlidxWriter; typedef struct Fts5Iter Fts5Iter; typedef struct Fts5PageWriter Fts5PageWriter; typedef struct Fts5SegIter Fts5SegIter; typedef struct Fts5DoclistIter Fts5DoclistIter; typedef struct Fts5SegWriter Fts5SegWriter; typedef struct Fts5Structure Fts5Structure; typedef struct Fts5StructureLevel Fts5StructureLevel; typedef struct Fts5StructureSegment Fts5StructureSegment; struct Fts5Data { u8 *p; /* Pointer to buffer containing record */ int nn; /* Size of record in bytes */ int szLeaf; /* Size of leaf without page-index */ }; /* ** One object per %_data table. */ struct Fts5Index { Fts5Config *pConfig; /* Virtual table configuration */ char *zDataTbl; /* Name of %_data table */ int nWorkUnit; /* Leaf pages in a "unit" of work */ /* ** Variables related to the accumulation of tokens and doclists within the ** in-memory hash tables before they are flushed to disk. */ Fts5Hash *pHash; /* Hash table for in-memory data */ int nPendingData; /* Current bytes of pending data */ i64 iWriteRowid; /* Rowid for current doc being written */ int bDelete; /* Current write is a delete */ /* Error state. */ int rc; /* Current error code */ /* State used by the fts5DataXXX() functions. */ sqlite3_blob *pReader; /* RO incr-blob open on %_data table */ sqlite3_stmt *pWriter; /* "INSERT ... %_data VALUES(?,?)" */ sqlite3_stmt *pDeleter; /* "DELETE FROM %_data ... id>=? AND id<=?" */ sqlite3_stmt *pIdxWriter; /* "INSERT ... %_idx VALUES(?,?,?,?)" */ sqlite3_stmt *pIdxDeleter; /* "DELETE FROM %_idx WHERE segid=? */ sqlite3_stmt *pIdxSelect; int nRead; /* Total number of blocks read */ sqlite3_stmt *pDataVersion; i64 iStructVersion; /* data_version when pStruct read */ Fts5Structure *pStruct; /* Current db structure (or NULL) */ }; struct Fts5DoclistIter { u8 *aEof; /* Pointer to 1 byte past end of doclist */ /* Output variables. aPoslist==0 at EOF */ i64 iRowid; u8 *aPoslist; int nPoslist; int nSize; }; /* ** The contents of the "structure" record for each index are represented ** using an Fts5Structure record in memory. Which uses instances of the ** other Fts5StructureXXX types as components. */ struct Fts5StructureSegment { int iSegid; /* Segment id */ int pgnoFirst; /* First leaf page number in segment */ int pgnoLast; /* Last leaf page number in segment */ }; struct Fts5StructureLevel { int nMerge; /* Number of segments in incr-merge */ int nSeg; /* Total number of segments on level */ Fts5StructureSegment *aSeg; /* Array of segments. aSeg[0] is oldest. */ }; struct Fts5Structure { int nRef; /* Object reference count */ u64 nWriteCounter; /* Total leaves written to level 0 */ int nSegment; /* Total segments in this structure */ int nLevel; /* Number of levels in this index */ Fts5StructureLevel aLevel[1]; /* Array of nLevel level objects */ }; /* ** An object of type Fts5SegWriter is used to write to segments. */ struct Fts5PageWriter { int pgno; /* Page number for this page */ int iPrevPgidx; /* Previous value written into pgidx */ Fts5Buffer buf; /* Buffer containing leaf data */ Fts5Buffer pgidx; /* Buffer containing page-index */ Fts5Buffer term; /* Buffer containing previous term on page */ }; struct Fts5DlidxWriter { int pgno; /* Page number for this page */ int bPrevValid; /* True if iPrev is valid */ i64 iPrev; /* Previous rowid value written to page */ Fts5Buffer buf; /* Buffer containing page data */ }; struct Fts5SegWriter { int iSegid; /* Segid to write to */ Fts5PageWriter writer; /* PageWriter object */ i64 iPrevRowid; /* Previous rowid written to current leaf */ u8 bFirstRowidInDoclist; /* True if next rowid is first in doclist */ u8 bFirstRowidInPage; /* True if next rowid is first in page */ /* TODO1: Can use (writer.pgidx.n==0) instead of bFirstTermInPage */ u8 bFirstTermInPage; /* True if next term will be first in leaf */ int nLeafWritten; /* Number of leaf pages written */ int nEmpty; /* Number of contiguous term-less nodes */ int nDlidx; /* Allocated size of aDlidx[] array */ Fts5DlidxWriter *aDlidx; /* Array of Fts5DlidxWriter objects */ /* Values to insert into the %_idx table */ Fts5Buffer btterm; /* Next term to insert into %_idx table */ int iBtPage; /* Page number corresponding to btterm */ }; typedef struct Fts5CResult Fts5CResult; struct Fts5CResult { u16 iFirst; /* aSeg[] index of firstest iterator */ u8 bTermEq; /* True if the terms are equal */ }; /* ** Object for iterating through a single segment, visiting each term/rowid ** pair in the segment. ** ** pSeg: ** The segment to iterate through. ** ** iLeafPgno: ** Current leaf page number within segment. ** ** iLeafOffset: ** Byte offset within the current leaf that is the first byte of the ** position list data (one byte passed the position-list size field). ** rowid field of the current entry. Usually this is the size field of the ** position list data. The exception is if the rowid for the current entry ** is the last thing on the leaf page. ** ** pLeaf: ** Buffer containing current leaf page data. Set to NULL at EOF. ** ** iTermLeafPgno, iTermLeafOffset: ** Leaf page number containing the last term read from the segment. And ** the offset immediately following the term data. ** ** flags: ** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: ** ** FTS5_SEGITER_ONETERM: ** If set, set the iterator to point to EOF after the current doclist ** has been exhausted. Do not proceed to the next term in the segment. ** ** FTS5_SEGITER_REVERSE: ** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If ** it is set, iterate through rowid in descending order instead of the ** default ascending order. ** ** iRowidOffset/nRowidOffset/aRowidOffset: ** These are used if the FTS5_SEGITER_REVERSE flag is set. ** ** For each rowid on the page corresponding to the current term, the ** corresponding aRowidOffset[] entry is set to the byte offset of the ** start of the "position-list-size" field within the page. ** ** iTermIdx: ** Index of current term on iTermLeafPgno. */ struct Fts5SegIter { Fts5StructureSegment *pSeg; /* Segment to iterate through */ int flags; /* Mask of configuration flags */ int iLeafPgno; /* Current leaf page number */ Fts5Data *pLeaf; /* Current leaf data */ Fts5Data *pNextLeaf; /* Leaf page (iLeafPgno+1) */ int iLeafOffset; /* Byte offset within current leaf */ /* Next method */ void (*xNext)(Fts5Index*, Fts5SegIter*, int*); /* The page and offset from which the current term was read. The offset ** is the offset of the first rowid in the current doclist. */ int iTermLeafPgno; int iTermLeafOffset; int iPgidxOff; /* Next offset in pgidx */ int iEndofDoclist; /* The following are only used if the FTS5_SEGITER_REVERSE flag is set. */ int iRowidOffset; /* Current entry in aRowidOffset[] */ int nRowidOffset; /* Allocated size of aRowidOffset[] array */ int *aRowidOffset; /* Array of offset to rowid fields */ Fts5DlidxIter *pDlidx; /* If there is a doclist-index */ /* Variables populated based on current entry. */ Fts5Buffer term; /* Current term */ i64 iRowid; /* Current rowid */ int nPos; /* Number of bytes in current position list */ u8 bDel; /* True if the delete flag is set */ }; /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. */ #define ASSERT_SZLEAF_OK(x) assert( \ (x)->szLeaf==(x)->nn || (x)->szLeaf==fts5GetU16(&(x)->p[2]) \ ) #define FTS5_SEGITER_ONETERM 0x01 #define FTS5_SEGITER_REVERSE 0x02 /* ** Argument is a pointer to an Fts5Data structure that contains a leaf ** page. This macro evaluates to true if the leaf contains no terms, or ** false if it contains at least one term. */ #define fts5LeafIsTermless(x) ((x)->szLeaf >= (x)->nn) #define fts5LeafTermOff(x, i) (fts5GetU16(&(x)->p[(x)->szLeaf + (i)*2])) #define fts5LeafFirstRowidOff(x) (fts5GetU16((x)->p)) /* ** Object for iterating through the merged results of one or more segments, ** visiting each term/rowid pair in the merged data. ** ** nSeg is always a power of two greater than or equal to the number of ** segments that this object is merging data from. Both the aSeg[] and ** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded ** with zeroed objects - these are handled as if they were iterators opened ** on empty segments. ** ** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an ** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the ** comparison in this context is the index of the iterator that currently ** points to the smaller term/rowid combination. Iterators at EOF are ** considered to be greater than all other iterators. ** ** aFirst[1] contains the index in aSeg[] of the iterator that points to ** the smallest key overall. aFirst[0] is unused. ** ** poslist: ** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. ** There is no way to tell if this is populated or not. */ struct Fts5Iter { Fts5IndexIter base; /* Base class containing output vars */ Fts5Index *pIndex; /* Index that owns this iterator */ Fts5Structure *pStruct; /* Database structure for this iterator */ Fts5Buffer poslist; /* Buffer containing current poslist */ Fts5Colset *pColset; /* Restrict matches to these columns */ /* Invoked to set output variables. */ void (*xSetOutputs)(Fts5Iter*, Fts5SegIter*); int nSeg; /* Size of aSeg[] array */ int bRev; /* True to iterate in reverse order */ u8 bSkipEmpty; /* True to skip deleted entries */ i64 iSwitchRowid; /* Firstest rowid of other than aFirst[1] */ Fts5CResult *aFirst; /* Current merge state (see above) */ Fts5SegIter aSeg[1]; /* Array of segment iterators */ }; /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. ** ** pData: ** Record containing the doclist-index data. ** ** bEof: ** Set to true once iterator has reached EOF. ** ** iOff: ** Set to the current offset within record pData. */ struct Fts5DlidxLvl { Fts5Data *pData; /* Data for current page of this level */ int iOff; /* Current offset into pData */ int bEof; /* At EOF already */ int iFirstOff; /* Used by reverse iterators */ /* Output variables */ int iLeafPgno; /* Page number of current leaf page */ i64 iRowid; /* First rowid on leaf iLeafPgno */ }; struct Fts5DlidxIter { int nLvl; int iSegid; Fts5DlidxLvl aLvl[1]; }; static void fts5PutU16(u8 *aOut, u16 iVal){ aOut[0] = (iVal>>8); aOut[1] = (iVal&0xFF); } static u16 fts5GetU16(const u8 *aIn){ return ((u16)aIn[0] << 8) + aIn[1]; } /* ** Allocate and return a buffer at least nByte bytes in size. ** ** If an OOM error is encountered, return NULL and set the error code in ** the Fts5Index handle passed as the first argument. */ static void *fts5IdxMalloc(Fts5Index *p, int nByte){ return sqlite3Fts5MallocZero(&p->rc, nByte); } /* ** Compare the contents of the pLeft buffer with the pRight/nRight blob. ** ** Return -ve if pLeft is smaller than pRight, 0 if they are equal or ** +ve if pRight is smaller than pLeft. In other words: ** ** res = *pLeft - *pRight */ #ifdef SQLITE_DEBUG static int fts5BufferCompareBlob( Fts5Buffer *pLeft, /* Left hand side of comparison */ const u8 *pRight, int nRight /* Right hand side of comparison */ ){ int nCmp = MIN(pLeft->n, nRight); int res = memcmp(pLeft->p, pRight, nCmp); return (res==0 ? (pLeft->n - nRight) : res); } #endif /* ** Compare the contents of the two buffers using memcmp(). If one buffer ** is a prefix of the other, it is considered the lesser. ** ** Return -ve if pLeft is smaller than pRight, 0 if they are equal or ** +ve if pRight is smaller than pLeft. In other words: ** ** res = *pLeft - *pRight */ static int fts5BufferCompare(Fts5Buffer *pLeft, Fts5Buffer *pRight){ int nCmp = MIN(pLeft->n, pRight->n); int res = memcmp(pLeft->p, pRight->p, nCmp); return (res==0 ? (pLeft->n - pRight->n) : res); } static int fts5LeafFirstTermOff(Fts5Data *pLeaf){ int ret; fts5GetVarint32(&pLeaf->p[pLeaf->szLeaf], ret); return ret; } /* ** Close the read-only blob handle, if it is open. */ static void fts5CloseReader(Fts5Index *p){ if( p->pReader ){ sqlite3_blob *pReader = p->pReader; p->pReader = 0; sqlite3_blob_close(pReader); } } /* ** Retrieve a record from the %_data table. ** ** If an error occurs, NULL is returned and an error left in the ** Fts5Index object. */ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){ Fts5Data *pRet = 0; if( p->rc==SQLITE_OK ){ int rc = SQLITE_OK; if( p->pReader ){ /* This call may return SQLITE_ABORT if there has been a savepoint ** rollback since it was last used. In this case a new blob handle ** is required. */ sqlite3_blob *pBlob = p->pReader; p->pReader = 0; rc = sqlite3_blob_reopen(pBlob, iRowid); assert( p->pReader==0 ); p->pReader = pBlob; if( rc!=SQLITE_OK ){ fts5CloseReader(p); } if( rc==SQLITE_ABORT ) rc = SQLITE_OK; } /* If the blob handle is not open at this point, open it and seek ** to the requested entry. */ if( p->pReader==0 && rc==SQLITE_OK ){ Fts5Config *pConfig = p->pConfig; rc = sqlite3_blob_open(pConfig->db, pConfig->zDb, p->zDataTbl, "block", iRowid, 0, &p->pReader ); } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. ** All the reasons those functions might return SQLITE_ERROR - missing ** table, missing row, non-blob/text in block column - indicate ** backing store corruption. */ if( rc==SQLITE_ERROR ) rc = FTS5_CORRUPT; if( rc==SQLITE_OK ){ u8 *aOut = 0; /* Read blob data into this buffer */ int nByte = sqlite3_blob_bytes(p->pReader); int nAlloc = sizeof(Fts5Data) + nByte + FTS5_DATA_PADDING; pRet = (Fts5Data*)sqlite3_malloc(nAlloc); if( pRet ){ pRet->nn = nByte; aOut = pRet->p = (u8*)&pRet[1]; }else{ rc = SQLITE_NOMEM; } if( rc==SQLITE_OK ){ rc = sqlite3_blob_read(p->pReader, aOut, nByte, 0); } if( rc!=SQLITE_OK ){ sqlite3_free(pRet); pRet = 0; }else{ /* TODO1: Fix this */ pRet->szLeaf = fts5GetU16(&pRet->p[2]); } } p->rc = rc; p->nRead++; } assert( (pRet==0)==(p->rc!=SQLITE_OK) ); return pRet; } /* ** Release a reference to data record returned by an earlier call to ** fts5DataRead(). */ static void fts5DataRelease(Fts5Data *pData){ sqlite3_free(pData); } static Fts5Data *fts5LeafRead(Fts5Index *p, i64 iRowid){ Fts5Data *pRet = fts5DataRead(p, iRowid); if( pRet ){ if( pRet->szLeaf>pRet->nn ){ p->rc = FTS5_CORRUPT; fts5DataRelease(pRet); pRet = 0; } } return pRet; } static int fts5IndexPrepareStmt( Fts5Index *p, sqlite3_stmt **ppStmt, char *zSql ){ if( p->rc==SQLITE_OK ){ if( zSql ){ p->rc = sqlite3_prepare_v3(p->pConfig->db, zSql, -1, SQLITE_PREPARE_PERSISTENT, ppStmt, 0); }else{ p->rc = SQLITE_NOMEM; } } sqlite3_free(zSql); return p->rc; } /* ** INSERT OR REPLACE a record into the %_data table. */ static void fts5DataWrite(Fts5Index *p, i64 iRowid, const u8 *pData, int nData){ if( p->rc!=SQLITE_OK ) return; if( p->pWriter==0 ){ Fts5Config *pConfig = p->pConfig; fts5IndexPrepareStmt(p, &p->pWriter, sqlite3_mprintf( "REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)", pConfig->zDb, pConfig->zName )); if( p->rc ) return; } sqlite3_bind_int64(p->pWriter, 1, iRowid); sqlite3_bind_blob(p->pWriter, 2, pData, nData, SQLITE_STATIC); sqlite3_step(p->pWriter); p->rc = sqlite3_reset(p->pWriter); } /* ** Execute the following SQL: ** ** DELETE FROM %_data WHERE id BETWEEN $iFirst AND $iLast */ static void fts5DataDelete(Fts5Index *p, i64 iFirst, i64 iLast){ if( p->rc!=SQLITE_OK ) return; if( p->pDeleter==0 ){ int rc; Fts5Config *pConfig = p->pConfig; char *zSql = sqlite3_mprintf( "DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?", pConfig->zDb, pConfig->zName ); if( zSql==0 ){ rc = SQLITE_NOMEM; }else{ rc = sqlite3_prepare_v3(pConfig->db, zSql, -1, SQLITE_PREPARE_PERSISTENT, &p->pDeleter, 0); sqlite3_free(zSql); } if( rc!=SQLITE_OK ){ p->rc = rc; return; } } sqlite3_bind_int64(p->pDeleter, 1, iFirst); sqlite3_bind_int64(p->pDeleter, 2, iLast); sqlite3_step(p->pDeleter); p->rc = sqlite3_reset(p->pDeleter); } /* ** Remove all records associated with segment iSegid. */ static void fts5DataRemoveSegment(Fts5Index *p, int iSegid){ i64 iFirst = FTS5_SEGMENT_ROWID(iSegid, 0); i64 iLast = FTS5_SEGMENT_ROWID(iSegid+1, 0)-1; fts5DataDelete(p, iFirst, iLast); if( p->pIdxDeleter==0 ){ Fts5Config *pConfig = p->pConfig; fts5IndexPrepareStmt(p, &p->pIdxDeleter, sqlite3_mprintf( "DELETE FROM '%q'.'%q_idx' WHERE segid=?", pConfig->zDb, pConfig->zName )); } if( p->rc==SQLITE_OK ){ sqlite3_bind_int(p->pIdxDeleter, 1, iSegid); sqlite3_step(p->pIdxDeleter); p->rc = sqlite3_reset(p->pIdxDeleter); } } /* ** Release a reference to an Fts5Structure object returned by an earlier ** call to fts5StructureRead() or fts5StructureDecode(). */ static void fts5StructureRelease(Fts5Structure *pStruct){ if( pStruct && 0>=(--pStruct->nRef) ){ int i; assert( pStruct->nRef==0 ); for(i=0; inLevel; i++){ sqlite3_free(pStruct->aLevel[i].aSeg); } sqlite3_free(pStruct); } } static void fts5StructureRef(Fts5Structure *pStruct){ pStruct->nRef++; } /* ** Deserialize and return the structure record currently stored in serialized ** form within buffer pData/nData. ** ** The Fts5Structure.aLevel[] and each Fts5StructureLevel.aSeg[] array ** are over-allocated by one slot. This allows the structure contents ** to be more easily edited. ** ** If an error occurs, *ppOut is set to NULL and an SQLite error code ** returned. Otherwise, *ppOut is set to point to the new object and ** SQLITE_OK returned. */ static int fts5StructureDecode( const u8 *pData, /* Buffer containing serialized structure */ int nData, /* Size of buffer pData in bytes */ int *piCookie, /* Configuration cookie value */ Fts5Structure **ppOut /* OUT: Deserialized object */ ){ int rc = SQLITE_OK; int i = 0; int iLvl; int nLevel = 0; int nSegment = 0; int nByte; /* Bytes of space to allocate at pRet */ Fts5Structure *pRet = 0; /* Structure object to return */ /* Grab the cookie value */ if( piCookie ) *piCookie = sqlite3Fts5Get32(pData); i = 4; /* Read the total number of levels and segments from the start of the ** structure record. */ i += fts5GetVarint32(&pData[i], nLevel); i += fts5GetVarint32(&pData[i], nSegment); nByte = ( sizeof(Fts5Structure) + /* Main structure */ sizeof(Fts5StructureLevel) * (nLevel-1) /* aLevel[] array */ ); pRet = (Fts5Structure*)sqlite3Fts5MallocZero(&rc, nByte); if( pRet ){ pRet->nRef = 1; pRet->nLevel = nLevel; pRet->nSegment = nSegment; i += sqlite3Fts5GetVarint(&pData[i], &pRet->nWriteCounter); for(iLvl=0; rc==SQLITE_OK && iLvlaLevel[iLvl]; int nTotal = 0; int iSeg; if( i>=nData ){ rc = FTS5_CORRUPT; }else{ i += fts5GetVarint32(&pData[i], pLvl->nMerge); i += fts5GetVarint32(&pData[i], nTotal); assert( nTotal>=pLvl->nMerge ); pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&rc, nTotal * sizeof(Fts5StructureSegment) ); } if( rc==SQLITE_OK ){ pLvl->nSeg = nTotal; for(iSeg=0; iSeg=nData ){ rc = FTS5_CORRUPT; break; } i += fts5GetVarint32(&pData[i], pLvl->aSeg[iSeg].iSegid); i += fts5GetVarint32(&pData[i], pLvl->aSeg[iSeg].pgnoFirst); i += fts5GetVarint32(&pData[i], pLvl->aSeg[iSeg].pgnoLast); } } } if( rc!=SQLITE_OK ){ fts5StructureRelease(pRet); pRet = 0; } } *ppOut = pRet; return rc; } /* ** */ static void fts5StructureAddLevel(int *pRc, Fts5Structure **ppStruct){ if( *pRc==SQLITE_OK ){ Fts5Structure *pStruct = *ppStruct; int nLevel = pStruct->nLevel; int nByte = ( sizeof(Fts5Structure) + /* Main structure */ sizeof(Fts5StructureLevel) * (nLevel+1) /* aLevel[] array */ ); pStruct = sqlite3_realloc(pStruct, nByte); if( pStruct ){ memset(&pStruct->aLevel[nLevel], 0, sizeof(Fts5StructureLevel)); pStruct->nLevel++; *ppStruct = pStruct; }else{ *pRc = SQLITE_NOMEM; } } } /* ** Extend level iLvl so that there is room for at least nExtra more ** segments. */ static void fts5StructureExtendLevel( int *pRc, Fts5Structure *pStruct, int iLvl, int nExtra, int bInsert ){ if( *pRc==SQLITE_OK ){ Fts5StructureLevel *pLvl = &pStruct->aLevel[iLvl]; Fts5StructureSegment *aNew; int nByte; nByte = (pLvl->nSeg + nExtra) * sizeof(Fts5StructureSegment); aNew = sqlite3_realloc(pLvl->aSeg, nByte); if( aNew ){ if( bInsert==0 ){ memset(&aNew[pLvl->nSeg], 0, sizeof(Fts5StructureSegment) * nExtra); }else{ int nMove = pLvl->nSeg * sizeof(Fts5StructureSegment); memmove(&aNew[nExtra], aNew, nMove); memset(aNew, 0, sizeof(Fts5StructureSegment) * nExtra); } pLvl->aSeg = aNew; }else{ *pRc = SQLITE_NOMEM; } } } static Fts5Structure *fts5StructureReadUncached(Fts5Index *p){ Fts5Structure *pRet = 0; Fts5Config *pConfig = p->pConfig; int iCookie; /* Configuration cookie */ Fts5Data *pData; pData = fts5DataRead(p, FTS5_STRUCTURE_ROWID); if( p->rc==SQLITE_OK ){ /* TODO: Do we need this if the leaf-index is appended? Probably... */ memset(&pData->p[pData->nn], 0, FTS5_DATA_PADDING); p->rc = fts5StructureDecode(pData->p, pData->nn, &iCookie, &pRet); if( p->rc==SQLITE_OK && pConfig->iCookie!=iCookie ){ p->rc = sqlite3Fts5ConfigLoad(pConfig, iCookie); } fts5DataRelease(pData); if( p->rc!=SQLITE_OK ){ fts5StructureRelease(pRet); pRet = 0; } } return pRet; } static i64 fts5IndexDataVersion(Fts5Index *p){ i64 iVersion = 0; if( p->rc==SQLITE_OK ){ if( p->pDataVersion==0 ){ p->rc = fts5IndexPrepareStmt(p, &p->pDataVersion, sqlite3_mprintf("PRAGMA %Q.data_version", p->pConfig->zDb) ); if( p->rc ) return 0; } if( SQLITE_ROW==sqlite3_step(p->pDataVersion) ){ iVersion = sqlite3_column_int64(p->pDataVersion, 0); } p->rc = sqlite3_reset(p->pDataVersion); } return iVersion; } /* ** Read, deserialize and return the structure record. ** ** The Fts5Structure.aLevel[] and each Fts5StructureLevel.aSeg[] array ** are over-allocated as described for function fts5StructureDecode() ** above. ** ** If an error occurs, NULL is returned and an error code left in the ** Fts5Index handle. If an error has already occurred when this function ** is called, it is a no-op. */ static Fts5Structure *fts5StructureRead(Fts5Index *p){ if( p->pStruct==0 ){ p->iStructVersion = fts5IndexDataVersion(p); if( p->rc==SQLITE_OK ){ p->pStruct = fts5StructureReadUncached(p); } } #if 0 else{ Fts5Structure *pTest = fts5StructureReadUncached(p); if( pTest ){ int i, j; assert_nc( p->pStruct->nSegment==pTest->nSegment ); assert_nc( p->pStruct->nLevel==pTest->nLevel ); for(i=0; inLevel; i++){ assert_nc( p->pStruct->aLevel[i].nMerge==pTest->aLevel[i].nMerge ); assert_nc( p->pStruct->aLevel[i].nSeg==pTest->aLevel[i].nSeg ); for(j=0; jaLevel[i].nSeg; j++){ Fts5StructureSegment *p1 = &pTest->aLevel[i].aSeg[j]; Fts5StructureSegment *p2 = &p->pStruct->aLevel[i].aSeg[j]; assert_nc( p1->iSegid==p2->iSegid ); assert_nc( p1->pgnoFirst==p2->pgnoFirst ); assert_nc( p1->pgnoLast==p2->pgnoLast ); } } fts5StructureRelease(pTest); } } #endif if( p->rc!=SQLITE_OK ) return 0; assert( p->iStructVersion!=0 ); assert( p->pStruct!=0 ); fts5StructureRef(p->pStruct); return p->pStruct; } static void fts5StructureInvalidate(Fts5Index *p){ if( p->pStruct ){ fts5StructureRelease(p->pStruct); p->pStruct = 0; } } /* ** Return the total number of segments in index structure pStruct. This ** function is only ever used as part of assert() conditions. */ #ifdef SQLITE_DEBUG static int fts5StructureCountSegments(Fts5Structure *pStruct){ int nSegment = 0; /* Total number of segments */ if( pStruct ){ int iLvl; /* Used to iterate through levels */ for(iLvl=0; iLvlnLevel; iLvl++){ nSegment += pStruct->aLevel[iLvl].nSeg; } } return nSegment; } #endif #define fts5BufferSafeAppendBlob(pBuf, pBlob, nBlob) { \ assert( (pBuf)->nSpace>=((pBuf)->n+nBlob) ); \ memcpy(&(pBuf)->p[(pBuf)->n], pBlob, nBlob); \ (pBuf)->n += nBlob; \ } #define fts5BufferSafeAppendVarint(pBuf, iVal) { \ (pBuf)->n += sqlite3Fts5PutVarint(&(pBuf)->p[(pBuf)->n], (iVal)); \ assert( (pBuf)->nSpace>=(pBuf)->n ); \ } /* ** Serialize and store the "structure" record. ** ** If an error occurs, leave an error code in the Fts5Index object. If an ** error has already occurred, this function is a no-op. */ static void fts5StructureWrite(Fts5Index *p, Fts5Structure *pStruct){ if( p->rc==SQLITE_OK ){ Fts5Buffer buf; /* Buffer to serialize record into */ int iLvl; /* Used to iterate through levels */ int iCookie; /* Cookie value to store */ assert( pStruct->nSegment==fts5StructureCountSegments(pStruct) ); memset(&buf, 0, sizeof(Fts5Buffer)); /* Append the current configuration cookie */ iCookie = p->pConfig->iCookie; if( iCookie<0 ) iCookie = 0; if( 0==sqlite3Fts5BufferSize(&p->rc, &buf, 4+9+9+9) ){ sqlite3Fts5Put32(buf.p, iCookie); buf.n = 4; fts5BufferSafeAppendVarint(&buf, pStruct->nLevel); fts5BufferSafeAppendVarint(&buf, pStruct->nSegment); fts5BufferSafeAppendVarint(&buf, (i64)pStruct->nWriteCounter); } for(iLvl=0; iLvlnLevel; iLvl++){ int iSeg; /* Used to iterate through segments */ Fts5StructureLevel *pLvl = &pStruct->aLevel[iLvl]; fts5BufferAppendVarint(&p->rc, &buf, pLvl->nMerge); fts5BufferAppendVarint(&p->rc, &buf, pLvl->nSeg); assert( pLvl->nMerge<=pLvl->nSeg ); for(iSeg=0; iSegnSeg; iSeg++){ fts5BufferAppendVarint(&p->rc, &buf, pLvl->aSeg[iSeg].iSegid); fts5BufferAppendVarint(&p->rc, &buf, pLvl->aSeg[iSeg].pgnoFirst); fts5BufferAppendVarint(&p->rc, &buf, pLvl->aSeg[iSeg].pgnoLast); } } fts5DataWrite(p, FTS5_STRUCTURE_ROWID, buf.p, buf.n); fts5BufferFree(&buf); } } #if 0 static void fts5DebugStructure(int*,Fts5Buffer*,Fts5Structure*); static void fts5PrintStructure(const char *zCaption, Fts5Structure *pStruct){ int rc = SQLITE_OK; Fts5Buffer buf; memset(&buf, 0, sizeof(buf)); fts5DebugStructure(&rc, &buf, pStruct); fprintf(stdout, "%s: %s\n", zCaption, buf.p); fflush(stdout); fts5BufferFree(&buf); } #else # define fts5PrintStructure(x,y) #endif static int fts5SegmentSize(Fts5StructureSegment *pSeg){ return 1 + pSeg->pgnoLast - pSeg->pgnoFirst; } /* ** Return a copy of index structure pStruct. Except, promote as many ** segments as possible to level iPromote. If an OOM occurs, NULL is ** returned. */ static void fts5StructurePromoteTo( Fts5Index *p, int iPromote, int szPromote, Fts5Structure *pStruct ){ int il, is; Fts5StructureLevel *pOut = &pStruct->aLevel[iPromote]; if( pOut->nMerge==0 ){ for(il=iPromote+1; ilnLevel; il++){ Fts5StructureLevel *pLvl = &pStruct->aLevel[il]; if( pLvl->nMerge ) return; for(is=pLvl->nSeg-1; is>=0; is--){ int sz = fts5SegmentSize(&pLvl->aSeg[is]); if( sz>szPromote ) return; fts5StructureExtendLevel(&p->rc, pStruct, iPromote, 1, 1); if( p->rc ) return; memcpy(pOut->aSeg, &pLvl->aSeg[is], sizeof(Fts5StructureSegment)); pOut->nSeg++; pLvl->nSeg--; } } } } /* ** A new segment has just been written to level iLvl of index structure ** pStruct. This function determines if any segments should be promoted ** as a result. Segments are promoted in two scenarios: ** ** a) If the segment just written is smaller than one or more segments ** within the previous populated level, it is promoted to the previous ** populated level. ** ** b) If the segment just written is larger than the newest segment on ** the next populated level, then that segment, and any other adjacent ** segments that are also smaller than the one just written, are ** promoted. ** ** If one or more segments are promoted, the structure object is updated ** to reflect this. */ static void fts5StructurePromote( Fts5Index *p, /* FTS5 backend object */ int iLvl, /* Index level just updated */ Fts5Structure *pStruct /* Index structure */ ){ if( p->rc==SQLITE_OK ){ int iTst; int iPromote = -1; int szPromote = 0; /* Promote anything this size or smaller */ Fts5StructureSegment *pSeg; /* Segment just written */ int szSeg; /* Size of segment just written */ int nSeg = pStruct->aLevel[iLvl].nSeg; if( nSeg==0 ) return; pSeg = &pStruct->aLevel[iLvl].aSeg[pStruct->aLevel[iLvl].nSeg-1]; szSeg = (1 + pSeg->pgnoLast - pSeg->pgnoFirst); /* Check for condition (a) */ for(iTst=iLvl-1; iTst>=0 && pStruct->aLevel[iTst].nSeg==0; iTst--); if( iTst>=0 ){ int i; int szMax = 0; Fts5StructureLevel *pTst = &pStruct->aLevel[iTst]; assert( pTst->nMerge==0 ); for(i=0; inSeg; i++){ int sz = pTst->aSeg[i].pgnoLast - pTst->aSeg[i].pgnoFirst + 1; if( sz>szMax ) szMax = sz; } if( szMax>=szSeg ){ /* Condition (a) is true. Promote the newest segment on level ** iLvl to level iTst. */ iPromote = iTst; szPromote = szMax; } } /* If condition (a) is not met, assume (b) is true. StructurePromoteTo() ** is a no-op if it is not. */ if( iPromote<0 ){ iPromote = iLvl; szPromote = szSeg; } fts5StructurePromoteTo(p, iPromote, szPromote, pStruct); } } /* ** Advance the iterator passed as the only argument. If the end of the ** doclist-index page is reached, return non-zero. */ static int fts5DlidxLvlNext(Fts5DlidxLvl *pLvl){ Fts5Data *pData = pLvl->pData; if( pLvl->iOff==0 ){ assert( pLvl->bEof==0 ); pLvl->iOff = 1; pLvl->iOff += fts5GetVarint32(&pData->p[1], pLvl->iLeafPgno); pLvl->iOff += fts5GetVarint(&pData->p[pLvl->iOff], (u64*)&pLvl->iRowid); pLvl->iFirstOff = pLvl->iOff; }else{ int iOff; for(iOff=pLvl->iOff; iOffnn; iOff++){ if( pData->p[iOff] ) break; } if( iOffnn ){ i64 iVal; pLvl->iLeafPgno += (iOff - pLvl->iOff) + 1; iOff += fts5GetVarint(&pData->p[iOff], (u64*)&iVal); pLvl->iRowid += iVal; pLvl->iOff = iOff; }else{ pLvl->bEof = 1; } } return pLvl->bEof; } /* ** Advance the iterator passed as the only argument. */ static int fts5DlidxIterNextR(Fts5Index *p, Fts5DlidxIter *pIter, int iLvl){ Fts5DlidxLvl *pLvl = &pIter->aLvl[iLvl]; assert( iLvlnLvl ); if( fts5DlidxLvlNext(pLvl) ){ if( (iLvl+1) < pIter->nLvl ){ fts5DlidxIterNextR(p, pIter, iLvl+1); if( pLvl[1].bEof==0 ){ fts5DataRelease(pLvl->pData); memset(pLvl, 0, sizeof(Fts5DlidxLvl)); pLvl->pData = fts5DataRead(p, FTS5_DLIDX_ROWID(pIter->iSegid, iLvl, pLvl[1].iLeafPgno) ); if( pLvl->pData ) fts5DlidxLvlNext(pLvl); } } } return pIter->aLvl[0].bEof; } static int fts5DlidxIterNext(Fts5Index *p, Fts5DlidxIter *pIter){ return fts5DlidxIterNextR(p, pIter, 0); } /* ** The iterator passed as the first argument has the following fields set ** as follows. This function sets up the rest of the iterator so that it ** points to the first rowid in the doclist-index. ** ** pData: ** pointer to doclist-index record, ** ** When this function is called pIter->iLeafPgno is the page number the ** doclist is associated with (the one featuring the term). */ static int fts5DlidxIterFirst(Fts5DlidxIter *pIter){ int i; for(i=0; inLvl; i++){ fts5DlidxLvlNext(&pIter->aLvl[i]); } return pIter->aLvl[0].bEof; } static int fts5DlidxIterEof(Fts5Index *p, Fts5DlidxIter *pIter){ return p->rc!=SQLITE_OK || pIter->aLvl[0].bEof; } static void fts5DlidxIterLast(Fts5Index *p, Fts5DlidxIter *pIter){ int i; /* Advance each level to the last entry on the last page */ for(i=pIter->nLvl-1; p->rc==SQLITE_OK && i>=0; i--){ Fts5DlidxLvl *pLvl = &pIter->aLvl[i]; while( fts5DlidxLvlNext(pLvl)==0 ); pLvl->bEof = 0; if( i>0 ){ Fts5DlidxLvl *pChild = &pLvl[-1]; fts5DataRelease(pChild->pData); memset(pChild, 0, sizeof(Fts5DlidxLvl)); pChild->pData = fts5DataRead(p, FTS5_DLIDX_ROWID(pIter->iSegid, i-1, pLvl->iLeafPgno) ); } } } /* ** Move the iterator passed as the only argument to the previous entry. */ static int fts5DlidxLvlPrev(Fts5DlidxLvl *pLvl){ int iOff = pLvl->iOff; assert( pLvl->bEof==0 ); if( iOff<=pLvl->iFirstOff ){ pLvl->bEof = 1; }else{ u8 *a = pLvl->pData->p; i64 iVal; int iLimit; int ii; int nZero = 0; /* Currently iOff points to the first byte of a varint. This block ** decrements iOff until it points to the first byte of the previous ** varint. Taking care not to read any memory locations that occur ** before the buffer in memory. */ iLimit = (iOff>9 ? iOff-9 : 0); for(iOff--; iOff>iLimit; iOff--){ if( (a[iOff-1] & 0x80)==0 ) break; } fts5GetVarint(&a[iOff], (u64*)&iVal); pLvl->iRowid -= iVal; pLvl->iLeafPgno--; /* Skip backwards past any 0x00 varints. */ for(ii=iOff-1; ii>=pLvl->iFirstOff && a[ii]==0x00; ii--){ nZero++; } if( ii>=pLvl->iFirstOff && (a[ii] & 0x80) ){ /* The byte immediately before the last 0x00 byte has the 0x80 bit ** set. So the last 0x00 is only a varint 0 if there are 8 more 0x80 ** bytes before a[ii]. */ int bZero = 0; /* True if last 0x00 counts */ if( (ii-8)>=pLvl->iFirstOff ){ int j; for(j=1; j<=8 && (a[ii-j] & 0x80); j++); bZero = (j>8); } if( bZero==0 ) nZero--; } pLvl->iLeafPgno -= nZero; pLvl->iOff = iOff - nZero; } return pLvl->bEof; } static int fts5DlidxIterPrevR(Fts5Index *p, Fts5DlidxIter *pIter, int iLvl){ Fts5DlidxLvl *pLvl = &pIter->aLvl[iLvl]; assert( iLvlnLvl ); if( fts5DlidxLvlPrev(pLvl) ){ if( (iLvl+1) < pIter->nLvl ){ fts5DlidxIterPrevR(p, pIter, iLvl+1); if( pLvl[1].bEof==0 ){ fts5DataRelease(pLvl->pData); memset(pLvl, 0, sizeof(Fts5DlidxLvl)); pLvl->pData = fts5DataRead(p, FTS5_DLIDX_ROWID(pIter->iSegid, iLvl, pLvl[1].iLeafPgno) ); if( pLvl->pData ){ while( fts5DlidxLvlNext(pLvl)==0 ); pLvl->bEof = 0; } } } } return pIter->aLvl[0].bEof; } static int fts5DlidxIterPrev(Fts5Index *p, Fts5DlidxIter *pIter){ return fts5DlidxIterPrevR(p, pIter, 0); } /* ** Free a doclist-index iterator object allocated by fts5DlidxIterInit(). */ static void fts5DlidxIterFree(Fts5DlidxIter *pIter){ if( pIter ){ int i; for(i=0; inLvl; i++){ fts5DataRelease(pIter->aLvl[i].pData); } sqlite3_free(pIter); } } static Fts5DlidxIter *fts5DlidxIterInit( Fts5Index *p, /* Fts5 Backend to iterate within */ int bRev, /* True for ORDER BY ASC */ int iSegid, /* Segment id */ int iLeafPg /* Leaf page number to load dlidx for */ ){ Fts5DlidxIter *pIter = 0; int i; int bDone = 0; for(i=0; p->rc==SQLITE_OK && bDone==0; i++){ int nByte = sizeof(Fts5DlidxIter) + i * sizeof(Fts5DlidxLvl); Fts5DlidxIter *pNew; pNew = (Fts5DlidxIter*)sqlite3_realloc(pIter, nByte); if( pNew==0 ){ p->rc = SQLITE_NOMEM; }else{ i64 iRowid = FTS5_DLIDX_ROWID(iSegid, i, iLeafPg); Fts5DlidxLvl *pLvl = &pNew->aLvl[i]; pIter = pNew; memset(pLvl, 0, sizeof(Fts5DlidxLvl)); pLvl->pData = fts5DataRead(p, iRowid); if( pLvl->pData && (pLvl->pData->p[0] & 0x0001)==0 ){ bDone = 1; } pIter->nLvl = i+1; } } if( p->rc==SQLITE_OK ){ pIter->iSegid = iSegid; if( bRev==0 ){ fts5DlidxIterFirst(pIter); }else{ fts5DlidxIterLast(p, pIter); } } if( p->rc!=SQLITE_OK ){ fts5DlidxIterFree(pIter); pIter = 0; } return pIter; } static i64 fts5DlidxIterRowid(Fts5DlidxIter *pIter){ return pIter->aLvl[0].iRowid; } static int fts5DlidxIterPgno(Fts5DlidxIter *pIter){ return pIter->aLvl[0].iLeafPgno; } /* ** Load the next leaf page into the segment iterator. */ static void fts5SegIterNextPage( Fts5Index *p, /* FTS5 backend object */ Fts5SegIter *pIter /* Iterator to advance to next page */ ){ Fts5Data *pLeaf; Fts5StructureSegment *pSeg = pIter->pSeg; fts5DataRelease(pIter->pLeaf); pIter->iLeafPgno++; if( pIter->pNextLeaf ){ pIter->pLeaf = pIter->pNextLeaf; pIter->pNextLeaf = 0; }else if( pIter->iLeafPgno<=pSeg->pgnoLast ){ pIter->pLeaf = fts5LeafRead(p, FTS5_SEGMENT_ROWID(pSeg->iSegid, pIter->iLeafPgno) ); }else{ pIter->pLeaf = 0; } pLeaf = pIter->pLeaf; if( pLeaf ){ pIter->iPgidxOff = pLeaf->szLeaf; if( fts5LeafIsTermless(pLeaf) ){ pIter->iEndofDoclist = pLeaf->nn+1; }else{ pIter->iPgidxOff += fts5GetVarint32(&pLeaf->p[pIter->iPgidxOff], pIter->iEndofDoclist ); } } } /* ** Argument p points to a buffer containing a varint to be interpreted as a ** position list size field. Read the varint and return the number of bytes ** read. Before returning, set *pnSz to the number of bytes in the position ** list, and *pbDel to true if the delete flag is set, or false otherwise. */ static int fts5GetPoslistSize(const u8 *p, int *pnSz, int *pbDel){ int nSz; int n = 0; fts5FastGetVarint32(p, n, nSz); assert_nc( nSz>=0 ); *pnSz = nSz/2; *pbDel = nSz & 0x0001; return n; } /* ** Fts5SegIter.iLeafOffset currently points to the first byte of a ** position-list size field. Read the value of the field and store it ** in the following variables: ** ** Fts5SegIter.nPos ** Fts5SegIter.bDel ** ** Leave Fts5SegIter.iLeafOffset pointing to the first byte of the ** position list content (if any). */ static void fts5SegIterLoadNPos(Fts5Index *p, Fts5SegIter *pIter){ if( p->rc==SQLITE_OK ){ int iOff = pIter->iLeafOffset; /* Offset to read at */ ASSERT_SZLEAF_OK(pIter->pLeaf); if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){ int iEod = MIN(pIter->iEndofDoclist, pIter->pLeaf->szLeaf); pIter->bDel = 0; pIter->nPos = 1; if( iOffpLeaf->p[iOff]==0 ){ pIter->bDel = 1; iOff++; if( iOffpLeaf->p[iOff]==0 ){ pIter->nPos = 1; iOff++; }else{ pIter->nPos = 0; } } }else{ int nSz; fts5FastGetVarint32(pIter->pLeaf->p, iOff, nSz); pIter->bDel = (nSz & 0x0001); pIter->nPos = nSz>>1; assert_nc( pIter->nPos>=0 ); } pIter->iLeafOffset = iOff; } } static void fts5SegIterLoadRowid(Fts5Index *p, Fts5SegIter *pIter){ u8 *a = pIter->pLeaf->p; /* Buffer to read data from */ int iOff = pIter->iLeafOffset; ASSERT_SZLEAF_OK(pIter->pLeaf); if( iOff>=pIter->pLeaf->szLeaf ){ fts5SegIterNextPage(p, pIter); if( pIter->pLeaf==0 ){ if( p->rc==SQLITE_OK ) p->rc = FTS5_CORRUPT; return; } iOff = 4; a = pIter->pLeaf->p; } iOff += sqlite3Fts5GetVarint(&a[iOff], (u64*)&pIter->iRowid); pIter->iLeafOffset = iOff; } /* ** Fts5SegIter.iLeafOffset currently points to the first byte of the ** "nSuffix" field of a term. Function parameter nKeep contains the value ** of the "nPrefix" field (if there was one - it is passed 0 if this is ** the first term in the segment). ** ** This function populates: ** ** Fts5SegIter.term ** Fts5SegIter.rowid ** ** accordingly and leaves (Fts5SegIter.iLeafOffset) set to the content of ** the first position list. The position list belonging to document ** (Fts5SegIter.iRowid). */ static void fts5SegIterLoadTerm(Fts5Index *p, Fts5SegIter *pIter, int nKeep){ u8 *a = pIter->pLeaf->p; /* Buffer to read data from */ int iOff = pIter->iLeafOffset; /* Offset to read at */ int nNew; /* Bytes of new data */ iOff += fts5GetVarint32(&a[iOff], nNew); if( iOff+nNew>pIter->pLeaf->nn ){ p->rc = FTS5_CORRUPT; return; } pIter->term.n = nKeep; fts5BufferAppendBlob(&p->rc, &pIter->term, nNew, &a[iOff]); iOff += nNew; pIter->iTermLeafOffset = iOff; pIter->iTermLeafPgno = pIter->iLeafPgno; pIter->iLeafOffset = iOff; if( pIter->iPgidxOff>=pIter->pLeaf->nn ){ pIter->iEndofDoclist = pIter->pLeaf->nn+1; }else{ int nExtra; pIter->iPgidxOff += fts5GetVarint32(&a[pIter->iPgidxOff], nExtra); pIter->iEndofDoclist += nExtra; } fts5SegIterLoadRowid(p, pIter); } static void fts5SegIterNext(Fts5Index*, Fts5SegIter*, int*); static void fts5SegIterNext_Reverse(Fts5Index*, Fts5SegIter*, int*); static void fts5SegIterNext_None(Fts5Index*, Fts5SegIter*, int*); static void fts5SegIterSetNext(Fts5Index *p, Fts5SegIter *pIter){ if( pIter->flags & FTS5_SEGITER_REVERSE ){ pIter->xNext = fts5SegIterNext_Reverse; }else if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){ pIter->xNext = fts5SegIterNext_None; }else{ pIter->xNext = fts5SegIterNext; } } /* ** Initialize the iterator object pIter to iterate through the entries in ** segment pSeg. The iterator is left pointing to the first entry when ** this function returns. ** ** If an error occurs, Fts5Index.rc is set to an appropriate error code. If ** an error has already occurred when this function is called, it is a no-op. */ static void fts5SegIterInit( Fts5Index *p, /* FTS index object */ Fts5StructureSegment *pSeg, /* Description of segment */ Fts5SegIter *pIter /* Object to populate */ ){ if( pSeg->pgnoFirst==0 ){ /* This happens if the segment is being used as an input to an incremental ** merge and all data has already been "trimmed". See function ** fts5TrimSegments() for details. In this case leave the iterator empty. ** The caller will see the (pIter->pLeaf==0) and assume the iterator is ** at EOF already. */ assert( pIter->pLeaf==0 ); return; } if( p->rc==SQLITE_OK ){ memset(pIter, 0, sizeof(*pIter)); fts5SegIterSetNext(p, pIter); pIter->pSeg = pSeg; pIter->iLeafPgno = pSeg->pgnoFirst-1; fts5SegIterNextPage(p, pIter); } if( p->rc==SQLITE_OK ){ pIter->iLeafOffset = 4; assert_nc( pIter->pLeaf->nn>4 ); assert( fts5LeafFirstTermOff(pIter->pLeaf)==4 ); pIter->iPgidxOff = pIter->pLeaf->szLeaf+1; fts5SegIterLoadTerm(p, pIter, 0); fts5SegIterLoadNPos(p, pIter); } } /* ** This function is only ever called on iterators created by calls to ** Fts5IndexQuery() with the FTS5INDEX_QUERY_DESC flag set. ** ** The iterator is in an unusual state when this function is called: the ** Fts5SegIter.iLeafOffset variable is set to the offset of the start of ** the position-list size field for the first relevant rowid on the page. ** Fts5SegIter.rowid is set, but nPos and bDel are not. ** ** This function advances the iterator so that it points to the last ** relevant rowid on the page and, if necessary, initializes the ** aRowidOffset[] and iRowidOffset variables. At this point the iterator ** is in its regular state - Fts5SegIter.iLeafOffset points to the first ** byte of the position list content associated with said rowid. */ static void fts5SegIterReverseInitPage(Fts5Index *p, Fts5SegIter *pIter){ int eDetail = p->pConfig->eDetail; int n = pIter->pLeaf->szLeaf; int i = pIter->iLeafOffset; u8 *a = pIter->pLeaf->p; int iRowidOffset = 0; if( n>pIter->iEndofDoclist ){ n = pIter->iEndofDoclist; } ASSERT_SZLEAF_OK(pIter->pLeaf); while( 1 ){ i64 iDelta = 0; if( eDetail==FTS5_DETAIL_NONE ){ /* todo */ if( i=n ) break; i += fts5GetVarint(&a[i], (u64*)&iDelta); pIter->iRowid += iDelta; /* If necessary, grow the pIter->aRowidOffset[] array. */ if( iRowidOffset>=pIter->nRowidOffset ){ int nNew = pIter->nRowidOffset + 8; int *aNew = (int*)sqlite3_realloc(pIter->aRowidOffset, nNew*sizeof(int)); if( aNew==0 ){ p->rc = SQLITE_NOMEM; break; } pIter->aRowidOffset = aNew; pIter->nRowidOffset = nNew; } pIter->aRowidOffset[iRowidOffset++] = pIter->iLeafOffset; pIter->iLeafOffset = i; } pIter->iRowidOffset = iRowidOffset; fts5SegIterLoadNPos(p, pIter); } /* ** */ static void fts5SegIterReverseNewPage(Fts5Index *p, Fts5SegIter *pIter){ assert( pIter->flags & FTS5_SEGITER_REVERSE ); assert( pIter->flags & FTS5_SEGITER_ONETERM ); fts5DataRelease(pIter->pLeaf); pIter->pLeaf = 0; while( p->rc==SQLITE_OK && pIter->iLeafPgno>pIter->iTermLeafPgno ){ Fts5Data *pNew; pIter->iLeafPgno--; pNew = fts5DataRead(p, FTS5_SEGMENT_ROWID( pIter->pSeg->iSegid, pIter->iLeafPgno )); if( pNew ){ /* iTermLeafOffset may be equal to szLeaf if the term is the last ** thing on the page - i.e. the first rowid is on the following page. ** In this case leave pIter->pLeaf==0, this iterator is at EOF. */ if( pIter->iLeafPgno==pIter->iTermLeafPgno ){ assert( pIter->pLeaf==0 ); if( pIter->iTermLeafOffsetszLeaf ){ pIter->pLeaf = pNew; pIter->iLeafOffset = pIter->iTermLeafOffset; } }else{ int iRowidOff; iRowidOff = fts5LeafFirstRowidOff(pNew); if( iRowidOff ){ pIter->pLeaf = pNew; pIter->iLeafOffset = iRowidOff; } } if( pIter->pLeaf ){ u8 *a = &pIter->pLeaf->p[pIter->iLeafOffset]; pIter->iLeafOffset += fts5GetVarint(a, (u64*)&pIter->iRowid); break; }else{ fts5DataRelease(pNew); } } } if( pIter->pLeaf ){ pIter->iEndofDoclist = pIter->pLeaf->nn+1; fts5SegIterReverseInitPage(p, pIter); } } /* ** Return true if the iterator passed as the second argument currently ** points to a delete marker. A delete marker is an entry with a 0 byte ** position-list. */ static int fts5MultiIterIsEmpty(Fts5Index *p, Fts5Iter *pIter){ Fts5SegIter *pSeg = &pIter->aSeg[pIter->aFirst[1].iFirst]; return (p->rc==SQLITE_OK && pSeg->pLeaf && pSeg->nPos==0); } /* ** Advance iterator pIter to the next entry. ** ** This version of fts5SegIterNext() is only used by reverse iterators. */ static void fts5SegIterNext_Reverse( Fts5Index *p, /* FTS5 backend object */ Fts5SegIter *pIter, /* Iterator to advance */ int *pbUnused /* Unused */ ){ assert( pIter->flags & FTS5_SEGITER_REVERSE ); assert( pIter->pNextLeaf==0 ); UNUSED_PARAM(pbUnused); if( pIter->iRowidOffset>0 ){ u8 *a = pIter->pLeaf->p; int iOff; i64 iDelta; pIter->iRowidOffset--; pIter->iLeafOffset = pIter->aRowidOffset[pIter->iRowidOffset]; fts5SegIterLoadNPos(p, pIter); iOff = pIter->iLeafOffset; if( p->pConfig->eDetail!=FTS5_DETAIL_NONE ){ iOff += pIter->nPos; } fts5GetVarint(&a[iOff], (u64*)&iDelta); pIter->iRowid -= iDelta; }else{ fts5SegIterReverseNewPage(p, pIter); } } /* ** Advance iterator pIter to the next entry. ** ** This version of fts5SegIterNext() is only used if detail=none and the ** iterator is not a reverse direction iterator. */ static void fts5SegIterNext_None( Fts5Index *p, /* FTS5 backend object */ Fts5SegIter *pIter, /* Iterator to advance */ int *pbNewTerm /* OUT: Set for new term */ ){ int iOff; assert( p->rc==SQLITE_OK ); assert( (pIter->flags & FTS5_SEGITER_REVERSE)==0 ); assert( p->pConfig->eDetail==FTS5_DETAIL_NONE ); ASSERT_SZLEAF_OK(pIter->pLeaf); iOff = pIter->iLeafOffset; /* Next entry is on the next page */ if( pIter->pSeg && iOff>=pIter->pLeaf->szLeaf ){ fts5SegIterNextPage(p, pIter); if( p->rc || pIter->pLeaf==0 ) return; pIter->iRowid = 0; iOff = 4; } if( iOffiEndofDoclist ){ /* Next entry is on the current page */ i64 iDelta; iOff += sqlite3Fts5GetVarint(&pIter->pLeaf->p[iOff], (u64*)&iDelta); pIter->iLeafOffset = iOff; pIter->iRowid += iDelta; }else if( (pIter->flags & FTS5_SEGITER_ONETERM)==0 ){ if( pIter->pSeg ){ int nKeep = 0; if( iOff!=fts5LeafFirstTermOff(pIter->pLeaf) ){ iOff += fts5GetVarint32(&pIter->pLeaf->p[iOff], nKeep); } pIter->iLeafOffset = iOff; fts5SegIterLoadTerm(p, pIter, nKeep); }else{ const u8 *pList = 0; const char *zTerm = 0; int nList; sqlite3Fts5HashScanNext(p->pHash); sqlite3Fts5HashScanEntry(p->pHash, &zTerm, &pList, &nList); if( pList==0 ) goto next_none_eof; pIter->pLeaf->p = (u8*)pList; pIter->pLeaf->nn = nList; pIter->pLeaf->szLeaf = nList; pIter->iEndofDoclist = nList; sqlite3Fts5BufferSet(&p->rc,&pIter->term, (int)strlen(zTerm), (u8*)zTerm); pIter->iLeafOffset = fts5GetVarint(pList, (u64*)&pIter->iRowid); } if( pbNewTerm ) *pbNewTerm = 1; }else{ goto next_none_eof; } fts5SegIterLoadNPos(p, pIter); return; next_none_eof: fts5DataRelease(pIter->pLeaf); pIter->pLeaf = 0; } /* ** Advance iterator pIter to the next entry. ** ** If an error occurs, Fts5Index.rc is set to an appropriate error code. It ** is not considered an error if the iterator reaches EOF. If an error has ** already occurred when this function is called, it is a no-op. */ static void fts5SegIterNext( Fts5Index *p, /* FTS5 backend object */ Fts5SegIter *pIter, /* Iterator to advance */ int *pbNewTerm /* OUT: Set for new term */ ){ Fts5Data *pLeaf = pIter->pLeaf; int iOff; int bNewTerm = 0; int nKeep = 0; u8 *a; int n; assert( pbNewTerm==0 || *pbNewTerm==0 ); assert( p->pConfig->eDetail!=FTS5_DETAIL_NONE ); /* Search for the end of the position list within the current page. */ a = pLeaf->p; n = pLeaf->szLeaf; ASSERT_SZLEAF_OK(pLeaf); iOff = pIter->iLeafOffset + pIter->nPos; if( iOffiEndofDoclist ); if( iOff>=pIter->iEndofDoclist ){ bNewTerm = 1; if( iOff!=fts5LeafFirstTermOff(pLeaf) ){ iOff += fts5GetVarint32(&a[iOff], nKeep); } }else{ u64 iDelta; iOff += sqlite3Fts5GetVarint(&a[iOff], &iDelta); pIter->iRowid += iDelta; assert_nc( iDelta>0 ); } pIter->iLeafOffset = iOff; }else if( pIter->pSeg==0 ){ const u8 *pList = 0; const char *zTerm = 0; int nList = 0; assert( (pIter->flags & FTS5_SEGITER_ONETERM) || pbNewTerm ); if( 0==(pIter->flags & FTS5_SEGITER_ONETERM) ){ sqlite3Fts5HashScanNext(p->pHash); sqlite3Fts5HashScanEntry(p->pHash, &zTerm, &pList, &nList); } if( pList==0 ){ fts5DataRelease(pIter->pLeaf); pIter->pLeaf = 0; }else{ pIter->pLeaf->p = (u8*)pList; pIter->pLeaf->nn = nList; pIter->pLeaf->szLeaf = nList; pIter->iEndofDoclist = nList+1; sqlite3Fts5BufferSet(&p->rc, &pIter->term, (int)strlen(zTerm), (u8*)zTerm); pIter->iLeafOffset = fts5GetVarint(pList, (u64*)&pIter->iRowid); *pbNewTerm = 1; } }else{ iOff = 0; /* Next entry is not on the current page */ while( iOff==0 ){ fts5SegIterNextPage(p, pIter); pLeaf = pIter->pLeaf; if( pLeaf==0 ) break; ASSERT_SZLEAF_OK(pLeaf); if( (iOff = fts5LeafFirstRowidOff(pLeaf)) && iOffszLeaf ){ iOff += sqlite3Fts5GetVarint(&pLeaf->p[iOff], (u64*)&pIter->iRowid); pIter->iLeafOffset = iOff; if( pLeaf->nn>pLeaf->szLeaf ){ pIter->iPgidxOff = pLeaf->szLeaf + fts5GetVarint32( &pLeaf->p[pLeaf->szLeaf], pIter->iEndofDoclist ); } } else if( pLeaf->nn>pLeaf->szLeaf ){ pIter->iPgidxOff = pLeaf->szLeaf + fts5GetVarint32( &pLeaf->p[pLeaf->szLeaf], iOff ); pIter->iLeafOffset = iOff; pIter->iEndofDoclist = iOff; bNewTerm = 1; } assert_nc( iOffszLeaf ); if( iOff>pLeaf->szLeaf ){ p->rc = FTS5_CORRUPT; return; } } } /* Check if the iterator is now at EOF. If so, return early. */ if( pIter->pLeaf ){ if( bNewTerm ){ if( pIter->flags & FTS5_SEGITER_ONETERM ){ fts5DataRelease(pIter->pLeaf); pIter->pLeaf = 0; }else{ fts5SegIterLoadTerm(p, pIter, nKeep); fts5SegIterLoadNPos(p, pIter); if( pbNewTerm ) *pbNewTerm = 1; } }else{ /* The following could be done by calling fts5SegIterLoadNPos(). But ** this block is particularly performance critical, so equivalent ** code is inlined. ** ** Later: Switched back to fts5SegIterLoadNPos() because it supports ** detail=none mode. Not ideal. */ int nSz; assert( p->rc==SQLITE_OK ); assert( pIter->iLeafOffset<=pIter->pLeaf->nn ); fts5FastGetVarint32(pIter->pLeaf->p, pIter->iLeafOffset, nSz); pIter->bDel = (nSz & 0x0001); pIter->nPos = nSz>>1; assert_nc( pIter->nPos>=0 ); } } } #define SWAPVAL(T, a, b) { T tmp; tmp=a; a=b; b=tmp; } #define fts5IndexSkipVarint(a, iOff) { \ int iEnd = iOff+9; \ while( (a[iOff++] & 0x80) && iOffpDlidx; Fts5Data *pLast = 0; int pgnoLast = 0; if( pDlidx ){ int iSegid = pIter->pSeg->iSegid; pgnoLast = fts5DlidxIterPgno(pDlidx); pLast = fts5DataRead(p, FTS5_SEGMENT_ROWID(iSegid, pgnoLast)); }else{ Fts5Data *pLeaf = pIter->pLeaf; /* Current leaf data */ /* Currently, Fts5SegIter.iLeafOffset points to the first byte of ** position-list content for the current rowid. Back it up so that it ** points to the start of the position-list size field. */ int iPoslist; if( pIter->iTermLeafPgno==pIter->iLeafPgno ){ iPoslist = pIter->iTermLeafOffset; }else{ iPoslist = 4; } fts5IndexSkipVarint(pLeaf->p, iPoslist); pIter->iLeafOffset = iPoslist; /* If this condition is true then the largest rowid for the current ** term may not be stored on the current page. So search forward to ** see where said rowid really is. */ if( pIter->iEndofDoclist>=pLeaf->szLeaf ){ int pgno; Fts5StructureSegment *pSeg = pIter->pSeg; /* The last rowid in the doclist may not be on the current page. Search ** forward to find the page containing the last rowid. */ for(pgno=pIter->iLeafPgno+1; !p->rc && pgno<=pSeg->pgnoLast; pgno++){ i64 iAbs = FTS5_SEGMENT_ROWID(pSeg->iSegid, pgno); Fts5Data *pNew = fts5DataRead(p, iAbs); if( pNew ){ int iRowid, bTermless; iRowid = fts5LeafFirstRowidOff(pNew); bTermless = fts5LeafIsTermless(pNew); if( iRowid ){ SWAPVAL(Fts5Data*, pNew, pLast); pgnoLast = pgno; } fts5DataRelease(pNew); if( bTermless==0 ) break; } } } } /* If pLast is NULL at this point, then the last rowid for this doclist ** lies on the page currently indicated by the iterator. In this case ** pIter->iLeafOffset is already set to point to the position-list size ** field associated with the first relevant rowid on the page. ** ** Or, if pLast is non-NULL, then it is the page that contains the last ** rowid. In this case configure the iterator so that it points to the ** first rowid on this page. */ if( pLast ){ int iOff; fts5DataRelease(pIter->pLeaf); pIter->pLeaf = pLast; pIter->iLeafPgno = pgnoLast; iOff = fts5LeafFirstRowidOff(pLast); iOff += fts5GetVarint(&pLast->p[iOff], (u64*)&pIter->iRowid); pIter->iLeafOffset = iOff; if( fts5LeafIsTermless(pLast) ){ pIter->iEndofDoclist = pLast->nn+1; }else{ pIter->iEndofDoclist = fts5LeafFirstTermOff(pLast); } } fts5SegIterReverseInitPage(p, pIter); } /* ** Iterator pIter currently points to the first rowid of a doclist. ** There is a doclist-index associated with the final term on the current ** page. If the current term is the last term on the page, load the ** doclist-index from disk and initialize an iterator at (pIter->pDlidx). */ static void fts5SegIterLoadDlidx(Fts5Index *p, Fts5SegIter *pIter){ int iSeg = pIter->pSeg->iSegid; int bRev = (pIter->flags & FTS5_SEGITER_REVERSE); Fts5Data *pLeaf = pIter->pLeaf; /* Current leaf data */ assert( pIter->flags & FTS5_SEGITER_ONETERM ); assert( pIter->pDlidx==0 ); /* Check if the current doclist ends on this page. If it does, return ** early without loading the doclist-index (as it belongs to a different ** term. */ if( pIter->iTermLeafPgno==pIter->iLeafPgno && pIter->iEndofDoclistszLeaf ){ return; } pIter->pDlidx = fts5DlidxIterInit(p, bRev, iSeg, pIter->iTermLeafPgno); } /* ** The iterator object passed as the second argument currently contains ** no valid values except for the Fts5SegIter.pLeaf member variable. This ** function searches the leaf page for a term matching (pTerm/nTerm). ** ** If the specified term is found on the page, then the iterator is left ** pointing to it. If argument bGe is zero and the term is not found, ** the iterator is left pointing at EOF. ** ** If bGe is non-zero and the specified term is not found, then the ** iterator is left pointing to the smallest term in the segment that ** is larger than the specified term, even if this term is not on the ** current page. */ static void fts5LeafSeek( Fts5Index *p, /* Leave any error code here */ int bGe, /* True for a >= search */ Fts5SegIter *pIter, /* Iterator to seek */ const u8 *pTerm, int nTerm /* Term to search for */ ){ int iOff; const u8 *a = pIter->pLeaf->p; int szLeaf = pIter->pLeaf->szLeaf; int n = pIter->pLeaf->nn; int nMatch = 0; int nKeep = 0; int nNew = 0; int iTermOff; int iPgidx; /* Current offset in pgidx */ int bEndOfPage = 0; assert( p->rc==SQLITE_OK ); iPgidx = szLeaf; iPgidx += fts5GetVarint32(&a[iPgidx], iTermOff); iOff = iTermOff; if( iOff>n ){ p->rc = FTS5_CORRUPT; return; } while( 1 ){ /* Figure out how many new bytes are in this term */ fts5FastGetVarint32(a, iOff, nNew); if( nKeep=nMatch ); if( nKeep==nMatch ){ int nCmp; int i; nCmp = MIN(nNew, nTerm-nMatch); for(i=0; ipTerm[nMatch] ){ goto search_failed; } } if( iPgidx>=n ){ bEndOfPage = 1; break; } iPgidx += fts5GetVarint32(&a[iPgidx], nKeep); iTermOff += nKeep; iOff = iTermOff; if( iOff>=n ){ p->rc = FTS5_CORRUPT; return; } /* Read the nKeep field of the next term. */ fts5FastGetVarint32(a, iOff, nKeep); } search_failed: if( bGe==0 ){ fts5DataRelease(pIter->pLeaf); pIter->pLeaf = 0; return; }else if( bEndOfPage ){ do { fts5SegIterNextPage(p, pIter); if( pIter->pLeaf==0 ) return; a = pIter->pLeaf->p; if( fts5LeafIsTermless(pIter->pLeaf)==0 ){ iPgidx = pIter->pLeaf->szLeaf; iPgidx += fts5GetVarint32(&pIter->pLeaf->p[iPgidx], iOff); if( iOff<4 || iOff>=pIter->pLeaf->szLeaf ){ p->rc = FTS5_CORRUPT; }else{ nKeep = 0; iTermOff = iOff; n = pIter->pLeaf->nn; iOff += fts5GetVarint32(&a[iOff], nNew); break; } } }while( 1 ); } search_success: pIter->iLeafOffset = iOff + nNew; pIter->iTermLeafOffset = pIter->iLeafOffset; pIter->iTermLeafPgno = pIter->iLeafPgno; fts5BufferSet(&p->rc, &pIter->term, nKeep, pTerm); fts5BufferAppendBlob(&p->rc, &pIter->term, nNew, &a[iOff]); if( iPgidx>=n ){ pIter->iEndofDoclist = pIter->pLeaf->nn+1; }else{ int nExtra; iPgidx += fts5GetVarint32(&a[iPgidx], nExtra); pIter->iEndofDoclist = iTermOff + nExtra; } pIter->iPgidxOff = iPgidx; fts5SegIterLoadRowid(p, pIter); fts5SegIterLoadNPos(p, pIter); } static sqlite3_stmt *fts5IdxSelectStmt(Fts5Index *p){ if( p->pIdxSelect==0 ){ Fts5Config *pConfig = p->pConfig; fts5IndexPrepareStmt(p, &p->pIdxSelect, sqlite3_mprintf( "SELECT pgno FROM '%q'.'%q_idx' WHERE " "segid=? AND term<=? ORDER BY term DESC LIMIT 1", pConfig->zDb, pConfig->zName )); } return p->pIdxSelect; } /* ** Initialize the object pIter to point to term pTerm/nTerm within segment ** pSeg. If there is no such term in the index, the iterator is set to EOF. ** ** If an error occurs, Fts5Index.rc is set to an appropriate error code. If ** an error has already occurred when this function is called, it is a no-op. */ static void fts5SegIterSeekInit( Fts5Index *p, /* FTS5 backend */ const u8 *pTerm, int nTerm, /* Term to seek to */ int flags, /* Mask of FTS5INDEX_XXX flags */ Fts5StructureSegment *pSeg, /* Description of segment */ Fts5SegIter *pIter /* Object to populate */ ){ int iPg = 1; int bGe = (flags & FTS5INDEX_QUERY_SCAN); int bDlidx = 0; /* True if there is a doclist-index */ sqlite3_stmt *pIdxSelect = 0; assert( bGe==0 || (flags & FTS5INDEX_QUERY_DESC)==0 ); assert( pTerm && nTerm ); memset(pIter, 0, sizeof(*pIter)); pIter->pSeg = pSeg; /* This block sets stack variable iPg to the leaf page number that may ** contain term (pTerm/nTerm), if it is present in the segment. */ pIdxSelect = fts5IdxSelectStmt(p); if( p->rc ) return; sqlite3_bind_int(pIdxSelect, 1, pSeg->iSegid); sqlite3_bind_blob(pIdxSelect, 2, pTerm, nTerm, SQLITE_STATIC); if( SQLITE_ROW==sqlite3_step(pIdxSelect) ){ i64 val = sqlite3_column_int(pIdxSelect, 0); iPg = (int)(val>>1); bDlidx = (val & 0x0001); } p->rc = sqlite3_reset(pIdxSelect); if( iPgpgnoFirst ){ iPg = pSeg->pgnoFirst; bDlidx = 0; } pIter->iLeafPgno = iPg - 1; fts5SegIterNextPage(p, pIter); if( pIter->pLeaf ){ fts5LeafSeek(p, bGe, pIter, pTerm, nTerm); } if( p->rc==SQLITE_OK && bGe==0 ){ pIter->flags |= FTS5_SEGITER_ONETERM; if( pIter->pLeaf ){ if( flags & FTS5INDEX_QUERY_DESC ){ pIter->flags |= FTS5_SEGITER_REVERSE; } if( bDlidx ){ fts5SegIterLoadDlidx(p, pIter); } if( flags & FTS5INDEX_QUERY_DESC ){ fts5SegIterReverse(p, pIter); } } } fts5SegIterSetNext(p, pIter); /* Either: ** ** 1) an error has occurred, or ** 2) the iterator points to EOF, or ** 3) the iterator points to an entry with term (pTerm/nTerm), or ** 4) the FTS5INDEX_QUERY_SCAN flag was set and the iterator points ** to an entry with a term greater than or equal to (pTerm/nTerm). */ assert( p->rc!=SQLITE_OK /* 1 */ || pIter->pLeaf==0 /* 2 */ || fts5BufferCompareBlob(&pIter->term, pTerm, nTerm)==0 /* 3 */ || (bGe && fts5BufferCompareBlob(&pIter->term, pTerm, nTerm)>0) /* 4 */ ); } /* ** Initialize the object pIter to point to term pTerm/nTerm within the ** in-memory hash table. If there is no such term in the hash-table, the ** iterator is set to EOF. ** ** If an error occurs, Fts5Index.rc is set to an appropriate error code. If ** an error has already occurred when this function is called, it is a no-op. */ static void fts5SegIterHashInit( Fts5Index *p, /* FTS5 backend */ const u8 *pTerm, int nTerm, /* Term to seek to */ int flags, /* Mask of FTS5INDEX_XXX flags */ Fts5SegIter *pIter /* Object to populate */ ){ const u8 *pList = 0; int nList = 0; const u8 *z = 0; int n = 0; assert( p->pHash ); assert( p->rc==SQLITE_OK ); if( pTerm==0 || (flags & FTS5INDEX_QUERY_SCAN) ){ p->rc = sqlite3Fts5HashScanInit(p->pHash, (const char*)pTerm, nTerm); sqlite3Fts5HashScanEntry(p->pHash, (const char**)&z, &pList, &nList); n = (z ? (int)strlen((const char*)z) : 0); }else{ pIter->flags |= FTS5_SEGITER_ONETERM; sqlite3Fts5HashQuery(p->pHash, (const char*)pTerm, nTerm, &pList, &nList); z = pTerm; n = nTerm; } if( pList ){ Fts5Data *pLeaf; sqlite3Fts5BufferSet(&p->rc, &pIter->term, n, z); pLeaf = fts5IdxMalloc(p, sizeof(Fts5Data)); if( pLeaf==0 ) return; pLeaf->p = (u8*)pList; pLeaf->nn = pLeaf->szLeaf = nList; pIter->pLeaf = pLeaf; pIter->iLeafOffset = fts5GetVarint(pLeaf->p, (u64*)&pIter->iRowid); pIter->iEndofDoclist = pLeaf->nn; if( flags & FTS5INDEX_QUERY_DESC ){ pIter->flags |= FTS5_SEGITER_REVERSE; fts5SegIterReverseInitPage(p, pIter); }else{ fts5SegIterLoadNPos(p, pIter); } } fts5SegIterSetNext(p, pIter); } /* ** Zero the iterator passed as the only argument. */ static void fts5SegIterClear(Fts5SegIter *pIter){ fts5BufferFree(&pIter->term); fts5DataRelease(pIter->pLeaf); fts5DataRelease(pIter->pNextLeaf); fts5DlidxIterFree(pIter->pDlidx); sqlite3_free(pIter->aRowidOffset); memset(pIter, 0, sizeof(Fts5SegIter)); } #ifdef SQLITE_DEBUG /* ** This function is used as part of the big assert() procedure implemented by ** fts5AssertMultiIterSetup(). It ensures that the result currently stored ** in *pRes is the correct result of comparing the current positions of the ** two iterators. */ static void fts5AssertComparisonResult( Fts5Iter *pIter, Fts5SegIter *p1, Fts5SegIter *p2, Fts5CResult *pRes ){ int i1 = p1 - pIter->aSeg; int i2 = p2 - pIter->aSeg; if( p1->pLeaf || p2->pLeaf ){ if( p1->pLeaf==0 ){ assert( pRes->iFirst==i2 ); }else if( p2->pLeaf==0 ){ assert( pRes->iFirst==i1 ); }else{ int nMin = MIN(p1->term.n, p2->term.n); int res = memcmp(p1->term.p, p2->term.p, nMin); if( res==0 ) res = p1->term.n - p2->term.n; if( res==0 ){ assert( pRes->bTermEq==1 ); assert( p1->iRowid!=p2->iRowid ); res = ((p1->iRowid > p2->iRowid)==pIter->bRev) ? -1 : 1; }else{ assert( pRes->bTermEq==0 ); } if( res<0 ){ assert( pRes->iFirst==i1 ); }else{ assert( pRes->iFirst==i2 ); } } } } /* ** This function is a no-op unless SQLITE_DEBUG is defined when this module ** is compiled. In that case, this function is essentially an assert() ** statement used to verify that the contents of the pIter->aFirst[] array ** are correct. */ static void fts5AssertMultiIterSetup(Fts5Index *p, Fts5Iter *pIter){ if( p->rc==SQLITE_OK ){ Fts5SegIter *pFirst = &pIter->aSeg[ pIter->aFirst[1].iFirst ]; int i; assert( (pFirst->pLeaf==0)==pIter->base.bEof ); /* Check that pIter->iSwitchRowid is set correctly. */ for(i=0; inSeg; i++){ Fts5SegIter *p1 = &pIter->aSeg[i]; assert( p1==pFirst || p1->pLeaf==0 || fts5BufferCompare(&pFirst->term, &p1->term) || p1->iRowid==pIter->iSwitchRowid || (p1->iRowidiSwitchRowid)==pIter->bRev ); } for(i=0; inSeg; i+=2){ Fts5SegIter *p1 = &pIter->aSeg[i]; Fts5SegIter *p2 = &pIter->aSeg[i+1]; Fts5CResult *pRes = &pIter->aFirst[(pIter->nSeg + i) / 2]; fts5AssertComparisonResult(pIter, p1, p2, pRes); } for(i=1; i<(pIter->nSeg / 2); i+=2){ Fts5SegIter *p1 = &pIter->aSeg[ pIter->aFirst[i*2].iFirst ]; Fts5SegIter *p2 = &pIter->aSeg[ pIter->aFirst[i*2+1].iFirst ]; Fts5CResult *pRes = &pIter->aFirst[i]; fts5AssertComparisonResult(pIter, p1, p2, pRes); } } } #else # define fts5AssertMultiIterSetup(x,y) #endif /* ** Do the comparison necessary to populate pIter->aFirst[iOut]. ** ** If the returned value is non-zero, then it is the index of an entry ** in the pIter->aSeg[] array that is (a) not at EOF, and (b) pointing ** to a key that is a duplicate of another, higher priority, ** segment-iterator in the pSeg->aSeg[] array. */ static int fts5MultiIterDoCompare(Fts5Iter *pIter, int iOut){ int i1; /* Index of left-hand Fts5SegIter */ int i2; /* Index of right-hand Fts5SegIter */ int iRes; Fts5SegIter *p1; /* Left-hand Fts5SegIter */ Fts5SegIter *p2; /* Right-hand Fts5SegIter */ Fts5CResult *pRes = &pIter->aFirst[iOut]; assert( iOutnSeg && iOut>0 ); assert( pIter->bRev==0 || pIter->bRev==1 ); if( iOut>=(pIter->nSeg/2) ){ i1 = (iOut - pIter->nSeg/2) * 2; i2 = i1 + 1; }else{ i1 = pIter->aFirst[iOut*2].iFirst; i2 = pIter->aFirst[iOut*2+1].iFirst; } p1 = &pIter->aSeg[i1]; p2 = &pIter->aSeg[i2]; pRes->bTermEq = 0; if( p1->pLeaf==0 ){ /* If p1 is at EOF */ iRes = i2; }else if( p2->pLeaf==0 ){ /* If p2 is at EOF */ iRes = i1; }else{ int res = fts5BufferCompare(&p1->term, &p2->term); if( res==0 ){ assert( i2>i1 ); assert( i2!=0 ); pRes->bTermEq = 1; if( p1->iRowid==p2->iRowid ){ p1->bDel = p2->bDel; return i2; } res = ((p1->iRowid > p2->iRowid)==pIter->bRev) ? -1 : +1; } assert( res!=0 ); if( res<0 ){ iRes = i1; }else{ iRes = i2; } } pRes->iFirst = (u16)iRes; return 0; } /* ** Move the seg-iter so that it points to the first rowid on page iLeafPgno. ** It is an error if leaf iLeafPgno does not exist or contains no rowids. */ static void fts5SegIterGotoPage( Fts5Index *p, /* FTS5 backend object */ Fts5SegIter *pIter, /* Iterator to advance */ int iLeafPgno ){ assert( iLeafPgno>pIter->iLeafPgno ); if( iLeafPgno>pIter->pSeg->pgnoLast ){ p->rc = FTS5_CORRUPT; }else{ fts5DataRelease(pIter->pNextLeaf); pIter->pNextLeaf = 0; pIter->iLeafPgno = iLeafPgno-1; fts5SegIterNextPage(p, pIter); assert( p->rc!=SQLITE_OK || pIter->iLeafPgno==iLeafPgno ); if( p->rc==SQLITE_OK ){ int iOff; u8 *a = pIter->pLeaf->p; int n = pIter->pLeaf->szLeaf; iOff = fts5LeafFirstRowidOff(pIter->pLeaf); if( iOff<4 || iOff>=n ){ p->rc = FTS5_CORRUPT; }else{ iOff += fts5GetVarint(&a[iOff], (u64*)&pIter->iRowid); pIter->iLeafOffset = iOff; fts5SegIterLoadNPos(p, pIter); } } } } /* ** Advance the iterator passed as the second argument until it is at or ** past rowid iFrom. Regardless of the value of iFrom, the iterator is ** always advanced at least once. */ static void fts5SegIterNextFrom( Fts5Index *p, /* FTS5 backend object */ Fts5SegIter *pIter, /* Iterator to advance */ i64 iMatch /* Advance iterator at least this far */ ){ int bRev = (pIter->flags & FTS5_SEGITER_REVERSE); Fts5DlidxIter *pDlidx = pIter->pDlidx; int iLeafPgno = pIter->iLeafPgno; int bMove = 1; assert( pIter->flags & FTS5_SEGITER_ONETERM ); assert( pIter->pDlidx ); assert( pIter->pLeaf ); if( bRev==0 ){ while( !fts5DlidxIterEof(p, pDlidx) && iMatch>fts5DlidxIterRowid(pDlidx) ){ iLeafPgno = fts5DlidxIterPgno(pDlidx); fts5DlidxIterNext(p, pDlidx); } assert_nc( iLeafPgno>=pIter->iLeafPgno || p->rc ); if( iLeafPgno>pIter->iLeafPgno ){ fts5SegIterGotoPage(p, pIter, iLeafPgno); bMove = 0; } }else{ assert( pIter->pNextLeaf==0 ); assert( iMatchiRowid ); while( !fts5DlidxIterEof(p, pDlidx) && iMatchiLeafPgno ); if( iLeafPgnoiLeafPgno ){ pIter->iLeafPgno = iLeafPgno+1; fts5SegIterReverseNewPage(p, pIter); bMove = 0; } } do{ if( bMove && p->rc==SQLITE_OK ) pIter->xNext(p, pIter, 0); if( pIter->pLeaf==0 ) break; if( bRev==0 && pIter->iRowid>=iMatch ) break; if( bRev!=0 && pIter->iRowid<=iMatch ) break; bMove = 1; }while( p->rc==SQLITE_OK ); } /* ** Free the iterator object passed as the second argument. */ static void fts5MultiIterFree(Fts5Iter *pIter){ if( pIter ){ int i; for(i=0; inSeg; i++){ fts5SegIterClear(&pIter->aSeg[i]); } fts5StructureRelease(pIter->pStruct); fts5BufferFree(&pIter->poslist); sqlite3_free(pIter); } } static void fts5MultiIterAdvanced( Fts5Index *p, /* FTS5 backend to iterate within */ Fts5Iter *pIter, /* Iterator to update aFirst[] array for */ int iChanged, /* Index of sub-iterator just advanced */ int iMinset /* Minimum entry in aFirst[] to set */ ){ int i; for(i=(pIter->nSeg+iChanged)/2; i>=iMinset && p->rc==SQLITE_OK; i=i/2){ int iEq; if( (iEq = fts5MultiIterDoCompare(pIter, i)) ){ Fts5SegIter *pSeg = &pIter->aSeg[iEq]; assert( p->rc==SQLITE_OK ); pSeg->xNext(p, pSeg, 0); i = pIter->nSeg + iEq; } } } /* ** Sub-iterator iChanged of iterator pIter has just been advanced. It still ** points to the same term though - just a different rowid. This function ** attempts to update the contents of the pIter->aFirst[] accordingly. ** If it does so successfully, 0 is returned. Otherwise 1. ** ** If non-zero is returned, the caller should call fts5MultiIterAdvanced() ** on the iterator instead. That function does the same as this one, except ** that it deals with more complicated cases as well. */ static int fts5MultiIterAdvanceRowid( Fts5Iter *pIter, /* Iterator to update aFirst[] array for */ int iChanged, /* Index of sub-iterator just advanced */ Fts5SegIter **ppFirst ){ Fts5SegIter *pNew = &pIter->aSeg[iChanged]; if( pNew->iRowid==pIter->iSwitchRowid || (pNew->iRowidiSwitchRowid)==pIter->bRev ){ int i; Fts5SegIter *pOther = &pIter->aSeg[iChanged ^ 0x0001]; pIter->iSwitchRowid = pIter->bRev ? SMALLEST_INT64 : LARGEST_INT64; for(i=(pIter->nSeg+iChanged)/2; 1; i=i/2){ Fts5CResult *pRes = &pIter->aFirst[i]; assert( pNew->pLeaf ); assert( pRes->bTermEq==0 || pOther->pLeaf ); if( pRes->bTermEq ){ if( pNew->iRowid==pOther->iRowid ){ return 1; }else if( (pOther->iRowid>pNew->iRowid)==pIter->bRev ){ pIter->iSwitchRowid = pOther->iRowid; pNew = pOther; }else if( (pOther->iRowid>pIter->iSwitchRowid)==pIter->bRev ){ pIter->iSwitchRowid = pOther->iRowid; } } pRes->iFirst = (u16)(pNew - pIter->aSeg); if( i==1 ) break; pOther = &pIter->aSeg[ pIter->aFirst[i ^ 0x0001].iFirst ]; } } *ppFirst = pNew; return 0; } /* ** Set the pIter->bEof variable based on the state of the sub-iterators. */ static void fts5MultiIterSetEof(Fts5Iter *pIter){ Fts5SegIter *pSeg = &pIter->aSeg[ pIter->aFirst[1].iFirst ]; pIter->base.bEof = pSeg->pLeaf==0; pIter->iSwitchRowid = pSeg->iRowid; } /* ** Move the iterator to the next entry. ** ** If an error occurs, an error code is left in Fts5Index.rc. It is not ** considered an error if the iterator reaches EOF, or if it is already at ** EOF when this function is called. */ static void fts5MultiIterNext( Fts5Index *p, Fts5Iter *pIter, int bFrom, /* True if argument iFrom is valid */ i64 iFrom /* Advance at least as far as this */ ){ int bUseFrom = bFrom; assert( pIter->base.bEof==0 ); while( p->rc==SQLITE_OK ){ int iFirst = pIter->aFirst[1].iFirst; int bNewTerm = 0; Fts5SegIter *pSeg = &pIter->aSeg[iFirst]; assert( p->rc==SQLITE_OK ); if( bUseFrom && pSeg->pDlidx ){ fts5SegIterNextFrom(p, pSeg, iFrom); }else{ pSeg->xNext(p, pSeg, &bNewTerm); } if( pSeg->pLeaf==0 || bNewTerm || fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg) ){ fts5MultiIterAdvanced(p, pIter, iFirst, 1); fts5MultiIterSetEof(pIter); pSeg = &pIter->aSeg[pIter->aFirst[1].iFirst]; if( pSeg->pLeaf==0 ) return; } fts5AssertMultiIterSetup(p, pIter); assert( pSeg==&pIter->aSeg[pIter->aFirst[1].iFirst] && pSeg->pLeaf ); if( pIter->bSkipEmpty==0 || pSeg->nPos ){ pIter->xSetOutputs(pIter, pSeg); return; } bUseFrom = 0; } } static void fts5MultiIterNext2( Fts5Index *p, Fts5Iter *pIter, int *pbNewTerm /* OUT: True if *might* be new term */ ){ assert( pIter->bSkipEmpty ); if( p->rc==SQLITE_OK ){ *pbNewTerm = 0; do{ int iFirst = pIter->aFirst[1].iFirst; Fts5SegIter *pSeg = &pIter->aSeg[iFirst]; int bNewTerm = 0; assert( p->rc==SQLITE_OK ); pSeg->xNext(p, pSeg, &bNewTerm); if( pSeg->pLeaf==0 || bNewTerm || fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg) ){ fts5MultiIterAdvanced(p, pIter, iFirst, 1); fts5MultiIterSetEof(pIter); *pbNewTerm = 1; } fts5AssertMultiIterSetup(p, pIter); }while( fts5MultiIterIsEmpty(p, pIter) ); } } static void fts5IterSetOutputs_Noop(Fts5Iter *pUnused1, Fts5SegIter *pUnused2){ UNUSED_PARAM2(pUnused1, pUnused2); } static Fts5Iter *fts5MultiIterAlloc( Fts5Index *p, /* FTS5 backend to iterate within */ int nSeg ){ Fts5Iter *pNew; int nSlot; /* Power of two >= nSeg */ for(nSlot=2; nSlotaSeg[] */ sizeof(Fts5CResult) * nSlot /* pNew->aFirst[] */ ); if( pNew ){ pNew->nSeg = nSlot; pNew->aFirst = (Fts5CResult*)&pNew->aSeg[nSlot]; pNew->pIndex = p; pNew->xSetOutputs = fts5IterSetOutputs_Noop; } return pNew; } static void fts5PoslistCallback( Fts5Index *pUnused, void *pContext, const u8 *pChunk, int nChunk ){ UNUSED_PARAM(pUnused); assert_nc( nChunk>=0 ); if( nChunk>0 ){ fts5BufferSafeAppendBlob((Fts5Buffer*)pContext, pChunk, nChunk); } } typedef struct PoslistCallbackCtx PoslistCallbackCtx; struct PoslistCallbackCtx { Fts5Buffer *pBuf; /* Append to this buffer */ Fts5Colset *pColset; /* Restrict matches to this column */ int eState; /* See above */ }; typedef struct PoslistOffsetsCtx PoslistOffsetsCtx; struct PoslistOffsetsCtx { Fts5Buffer *pBuf; /* Append to this buffer */ Fts5Colset *pColset; /* Restrict matches to this column */ int iRead; int iWrite; }; /* ** TODO: Make this more efficient! */ static int fts5IndexColsetTest(Fts5Colset *pColset, int iCol){ int i; for(i=0; inCol; i++){ if( pColset->aiCol[i]==iCol ) return 1; } return 0; } static void fts5PoslistOffsetsCallback( Fts5Index *pUnused, void *pContext, const u8 *pChunk, int nChunk ){ PoslistOffsetsCtx *pCtx = (PoslistOffsetsCtx*)pContext; UNUSED_PARAM(pUnused); assert_nc( nChunk>=0 ); if( nChunk>0 ){ int i = 0; while( iiRead - 2; pCtx->iRead = iVal; if( fts5IndexColsetTest(pCtx->pColset, iVal) ){ fts5BufferSafeAppendVarint(pCtx->pBuf, iVal + 2 - pCtx->iWrite); pCtx->iWrite = iVal; } } } } static void fts5PoslistFilterCallback( Fts5Index *pUnused, void *pContext, const u8 *pChunk, int nChunk ){ PoslistCallbackCtx *pCtx = (PoslistCallbackCtx*)pContext; UNUSED_PARAM(pUnused); assert_nc( nChunk>=0 ); if( nChunk>0 ){ /* Search through to find the first varint with value 1. This is the ** start of the next columns hits. */ int i = 0; int iStart = 0; if( pCtx->eState==2 ){ int iCol; fts5FastGetVarint32(pChunk, i, iCol); if( fts5IndexColsetTest(pCtx->pColset, iCol) ){ pCtx->eState = 1; fts5BufferSafeAppendVarint(pCtx->pBuf, 1); }else{ pCtx->eState = 0; } } do { while( ieState ){ fts5BufferSafeAppendBlob(pCtx->pBuf, &pChunk[iStart], i-iStart); } if( i=nChunk ){ pCtx->eState = 2; }else{ fts5FastGetVarint32(pChunk, i, iCol); pCtx->eState = fts5IndexColsetTest(pCtx->pColset, iCol); if( pCtx->eState ){ fts5BufferSafeAppendBlob(pCtx->pBuf, &pChunk[iStart], i-iStart); iStart = i; } } } }while( inPos; /* Number of bytes still to come */ Fts5Data *pData = 0; u8 *pChunk = &pSeg->pLeaf->p[pSeg->iLeafOffset]; int nChunk = MIN(nRem, pSeg->pLeaf->szLeaf - pSeg->iLeafOffset); int pgno = pSeg->iLeafPgno; int pgnoSave = 0; /* This function does notmwork with detail=none databases. */ assert( p->pConfig->eDetail!=FTS5_DETAIL_NONE ); if( (pSeg->flags & FTS5_SEGITER_REVERSE)==0 ){ pgnoSave = pgno+1; } while( 1 ){ xChunk(p, pCtx, pChunk, nChunk); nRem -= nChunk; fts5DataRelease(pData); if( nRem<=0 ){ break; }else{ pgno++; pData = fts5LeafRead(p, FTS5_SEGMENT_ROWID(pSeg->pSeg->iSegid, pgno)); if( pData==0 ) break; pChunk = &pData->p[4]; nChunk = MIN(nRem, pData->szLeaf - 4); if( pgno==pgnoSave ){ assert( pSeg->pNextLeaf==0 ); pSeg->pNextLeaf = pData; pData = 0; } } } } /* ** Iterator pIter currently points to a valid entry (not EOF). This ** function appends the position list data for the current entry to ** buffer pBuf. It does not make a copy of the position-list size ** field. */ static void fts5SegiterPoslist( Fts5Index *p, Fts5SegIter *pSeg, Fts5Colset *pColset, Fts5Buffer *pBuf ){ if( 0==fts5BufferGrow(&p->rc, pBuf, pSeg->nPos) ){ if( pColset==0 ){ fts5ChunkIterate(p, pSeg, (void*)pBuf, fts5PoslistCallback); }else{ if( p->pConfig->eDetail==FTS5_DETAIL_FULL ){ PoslistCallbackCtx sCtx; sCtx.pBuf = pBuf; sCtx.pColset = pColset; sCtx.eState = fts5IndexColsetTest(pColset, 0); assert( sCtx.eState==0 || sCtx.eState==1 ); fts5ChunkIterate(p, pSeg, (void*)&sCtx, fts5PoslistFilterCallback); }else{ PoslistOffsetsCtx sCtx; memset(&sCtx, 0, sizeof(sCtx)); sCtx.pBuf = pBuf; sCtx.pColset = pColset; fts5ChunkIterate(p, pSeg, (void*)&sCtx, fts5PoslistOffsetsCallback); } } } } /* ** IN/OUT parameter (*pa) points to a position list n bytes in size. If ** the position list contains entries for column iCol, then (*pa) is set ** to point to the sub-position-list for that column and the number of ** bytes in it returned. Or, if the argument position list does not ** contain any entries for column iCol, return 0. */ static int fts5IndexExtractCol( const u8 **pa, /* IN/OUT: Pointer to poslist */ int n, /* IN: Size of poslist in bytes */ int iCol /* Column to extract from poslist */ ){ int iCurrent = 0; /* Anything before the first 0x01 is col 0 */ const u8 *p = *pa; const u8 *pEnd = &p[n]; /* One byte past end of position list */ while( iCol>iCurrent ){ /* Advance pointer p until it points to pEnd or an 0x01 byte that is ** not part of a varint. Note that it is not possible for a negative ** or extremely large varint to occur within an uncorrupted position ** list. So the last byte of each varint may be assumed to have a clear ** 0x80 bit. */ while( *p!=0x01 ){ while( *p++ & 0x80 ); if( p>=pEnd ) return 0; } *pa = p++; iCurrent = *p++; if( iCurrent & 0x80 ){ p--; p += fts5GetVarint32(p, iCurrent); } } if( iCol!=iCurrent ) return 0; /* Advance pointer p until it points to pEnd or an 0x01 byte that is ** not part of a varint */ while( pnCol; i++){ const u8 *pSub = pPos; int nSub = fts5IndexExtractCol(&pSub, nPos, pColset->aiCol[i]); if( nSub ){ fts5BufferAppendBlob(pRc, pBuf, nSub, pSub); } } } } /* ** xSetOutputs callback used by detail=none tables. */ static void fts5IterSetOutputs_None(Fts5Iter *pIter, Fts5SegIter *pSeg){ assert( pIter->pIndex->pConfig->eDetail==FTS5_DETAIL_NONE ); pIter->base.iRowid = pSeg->iRowid; pIter->base.nData = pSeg->nPos; } /* ** xSetOutputs callback used by detail=full and detail=col tables when no ** column filters are specified. */ static void fts5IterSetOutputs_Nocolset(Fts5Iter *pIter, Fts5SegIter *pSeg){ pIter->base.iRowid = pSeg->iRowid; pIter->base.nData = pSeg->nPos; assert( pIter->pIndex->pConfig->eDetail!=FTS5_DETAIL_NONE ); assert( pIter->pColset==0 ); if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){ /* All data is stored on the current page. Populate the output ** variables to point into the body of the page object. */ pIter->base.pData = &pSeg->pLeaf->p[pSeg->iLeafOffset]; }else{ /* The data is distributed over two or more pages. Copy it into the ** Fts5Iter.poslist buffer and then set the output pointer to point ** to this buffer. */ fts5BufferZero(&pIter->poslist); fts5SegiterPoslist(pIter->pIndex, pSeg, 0, &pIter->poslist); pIter->base.pData = pIter->poslist.p; } } /* ** xSetOutputs callback used when the Fts5Colset object has nCol==0 (match ** against no columns at all). */ static void fts5IterSetOutputs_ZeroColset(Fts5Iter *pIter, Fts5SegIter *pSeg){ UNUSED_PARAM(pSeg); pIter->base.nData = 0; } /* ** xSetOutputs callback used by detail=col when there is a column filter ** and there are 100 or more columns. Also called as a fallback from ** fts5IterSetOutputs_Col100 if the column-list spans more than one page. */ static void fts5IterSetOutputs_Col(Fts5Iter *pIter, Fts5SegIter *pSeg){ fts5BufferZero(&pIter->poslist); fts5SegiterPoslist(pIter->pIndex, pSeg, pIter->pColset, &pIter->poslist); pIter->base.iRowid = pSeg->iRowid; pIter->base.pData = pIter->poslist.p; pIter->base.nData = pIter->poslist.n; } /* ** xSetOutputs callback used when: ** ** * detail=col, ** * there is a column filter, and ** * the table contains 100 or fewer columns. ** ** The last point is to ensure all column numbers are stored as ** single-byte varints. */ static void fts5IterSetOutputs_Col100(Fts5Iter *pIter, Fts5SegIter *pSeg){ assert( pIter->pIndex->pConfig->eDetail==FTS5_DETAIL_COLUMNS ); assert( pIter->pColset ); if( pSeg->iLeafOffset+pSeg->nPos>pSeg->pLeaf->szLeaf ){ fts5IterSetOutputs_Col(pIter, pSeg); }else{ u8 *a = (u8*)&pSeg->pLeaf->p[pSeg->iLeafOffset]; u8 *pEnd = (u8*)&a[pSeg->nPos]; int iPrev = 0; int *aiCol = pIter->pColset->aiCol; int *aiColEnd = &aiCol[pIter->pColset->nCol]; u8 *aOut = pIter->poslist.p; int iPrevOut = 0; pIter->base.iRowid = pSeg->iRowid; while( abase.pData = pIter->poslist.p; pIter->base.nData = aOut - pIter->poslist.p; } } /* ** xSetOutputs callback used by detail=full when there is a column filter. */ static void fts5IterSetOutputs_Full(Fts5Iter *pIter, Fts5SegIter *pSeg){ Fts5Colset *pColset = pIter->pColset; pIter->base.iRowid = pSeg->iRowid; assert( pIter->pIndex->pConfig->eDetail==FTS5_DETAIL_FULL ); assert( pColset ); if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){ /* All data is stored on the current page. Populate the output ** variables to point into the body of the page object. */ const u8 *a = &pSeg->pLeaf->p[pSeg->iLeafOffset]; if( pColset->nCol==1 ){ pIter->base.nData = fts5IndexExtractCol(&a, pSeg->nPos,pColset->aiCol[0]); pIter->base.pData = a; }else{ int *pRc = &pIter->pIndex->rc; fts5BufferZero(&pIter->poslist); fts5IndexExtractColset(pRc, pColset, a, pSeg->nPos, &pIter->poslist); pIter->base.pData = pIter->poslist.p; pIter->base.nData = pIter->poslist.n; } }else{ /* The data is distributed over two or more pages. Copy it into the ** Fts5Iter.poslist buffer and then set the output pointer to point ** to this buffer. */ fts5BufferZero(&pIter->poslist); fts5SegiterPoslist(pIter->pIndex, pSeg, pColset, &pIter->poslist); pIter->base.pData = pIter->poslist.p; pIter->base.nData = pIter->poslist.n; } } static void fts5IterSetOutputCb(int *pRc, Fts5Iter *pIter){ if( *pRc==SQLITE_OK ){ Fts5Config *pConfig = pIter->pIndex->pConfig; if( pConfig->eDetail==FTS5_DETAIL_NONE ){ pIter->xSetOutputs = fts5IterSetOutputs_None; } else if( pIter->pColset==0 ){ pIter->xSetOutputs = fts5IterSetOutputs_Nocolset; } else if( pIter->pColset->nCol==0 ){ pIter->xSetOutputs = fts5IterSetOutputs_ZeroColset; } else if( pConfig->eDetail==FTS5_DETAIL_FULL ){ pIter->xSetOutputs = fts5IterSetOutputs_Full; } else{ assert( pConfig->eDetail==FTS5_DETAIL_COLUMNS ); if( pConfig->nCol<=100 ){ pIter->xSetOutputs = fts5IterSetOutputs_Col100; sqlite3Fts5BufferSize(pRc, &pIter->poslist, pConfig->nCol); }else{ pIter->xSetOutputs = fts5IterSetOutputs_Col; } } } } /* ** Allocate a new Fts5Iter object. ** ** The new object will be used to iterate through data in structure pStruct. ** If iLevel is -ve, then all data in all segments is merged. Or, if iLevel ** is zero or greater, data from the first nSegment segments on level iLevel ** is merged. ** ** The iterator initially points to the first term/rowid entry in the ** iterated data. */ static void fts5MultiIterNew( Fts5Index *p, /* FTS5 backend to iterate within */ Fts5Structure *pStruct, /* Structure of specific index */ int flags, /* FTS5INDEX_QUERY_XXX flags */ Fts5Colset *pColset, /* Colset to filter on (or NULL) */ const u8 *pTerm, int nTerm, /* Term to seek to (or NULL/0) */ int iLevel, /* Level to iterate (-1 for all) */ int nSegment, /* Number of segments to merge (iLevel>=0) */ Fts5Iter **ppOut /* New object */ ){ int nSeg = 0; /* Number of segment-iters in use */ int iIter = 0; /* */ int iSeg; /* Used to iterate through segments */ Fts5StructureLevel *pLvl; Fts5Iter *pNew; assert( (pTerm==0 && nTerm==0) || iLevel<0 ); /* Allocate space for the new multi-seg-iterator. */ if( p->rc==SQLITE_OK ){ if( iLevel<0 ){ assert( pStruct->nSegment==fts5StructureCountSegments(pStruct) ); nSeg = pStruct->nSegment; nSeg += (p->pHash ? 1 : 0); }else{ nSeg = MIN(pStruct->aLevel[iLevel].nSeg, nSegment); } } *ppOut = pNew = fts5MultiIterAlloc(p, nSeg); if( pNew==0 ) return; pNew->bRev = (0!=(flags & FTS5INDEX_QUERY_DESC)); pNew->bSkipEmpty = (0!=(flags & FTS5INDEX_QUERY_SKIPEMPTY)); pNew->pStruct = pStruct; pNew->pColset = pColset; fts5StructureRef(pStruct); if( (flags & FTS5INDEX_QUERY_NOOUTPUT)==0 ){ fts5IterSetOutputCb(&p->rc, pNew); } /* Initialize each of the component segment iterators. */ if( p->rc==SQLITE_OK ){ if( iLevel<0 ){ Fts5StructureLevel *pEnd = &pStruct->aLevel[pStruct->nLevel]; if( p->pHash ){ /* Add a segment iterator for the current contents of the hash table. */ Fts5SegIter *pIter = &pNew->aSeg[iIter++]; fts5SegIterHashInit(p, pTerm, nTerm, flags, pIter); } for(pLvl=&pStruct->aLevel[0]; pLvlnSeg-1; iSeg>=0; iSeg--){ Fts5StructureSegment *pSeg = &pLvl->aSeg[iSeg]; Fts5SegIter *pIter = &pNew->aSeg[iIter++]; if( pTerm==0 ){ fts5SegIterInit(p, pSeg, pIter); }else{ fts5SegIterSeekInit(p, pTerm, nTerm, flags, pSeg, pIter); } } } }else{ pLvl = &pStruct->aLevel[iLevel]; for(iSeg=nSeg-1; iSeg>=0; iSeg--){ fts5SegIterInit(p, &pLvl->aSeg[iSeg], &pNew->aSeg[iIter++]); } } assert( iIter==nSeg ); } /* If the above was successful, each component iterators now points ** to the first entry in its segment. In this case initialize the ** aFirst[] array. Or, if an error has occurred, free the iterator ** object and set the output variable to NULL. */ if( p->rc==SQLITE_OK ){ for(iIter=pNew->nSeg-1; iIter>0; iIter--){ int iEq; if( (iEq = fts5MultiIterDoCompare(pNew, iIter)) ){ Fts5SegIter *pSeg = &pNew->aSeg[iEq]; if( p->rc==SQLITE_OK ) pSeg->xNext(p, pSeg, 0); fts5MultiIterAdvanced(p, pNew, iEq, iIter); } } fts5MultiIterSetEof(pNew); fts5AssertMultiIterSetup(p, pNew); if( pNew->bSkipEmpty && fts5MultiIterIsEmpty(p, pNew) ){ fts5MultiIterNext(p, pNew, 0, 0); }else if( pNew->base.bEof==0 ){ Fts5SegIter *pSeg = &pNew->aSeg[pNew->aFirst[1].iFirst]; pNew->xSetOutputs(pNew, pSeg); } }else{ fts5MultiIterFree(pNew); *ppOut = 0; } } /* ** Create an Fts5Iter that iterates through the doclist provided ** as the second argument. */ static void fts5MultiIterNew2( Fts5Index *p, /* FTS5 backend to iterate within */ Fts5Data *pData, /* Doclist to iterate through */ int bDesc, /* True for descending rowid order */ Fts5Iter **ppOut /* New object */ ){ Fts5Iter *pNew; pNew = fts5MultiIterAlloc(p, 2); if( pNew ){ Fts5SegIter *pIter = &pNew->aSeg[1]; pIter->flags = FTS5_SEGITER_ONETERM; if( pData->szLeaf>0 ){ pIter->pLeaf = pData; pIter->iLeafOffset = fts5GetVarint(pData->p, (u64*)&pIter->iRowid); pIter->iEndofDoclist = pData->nn; pNew->aFirst[1].iFirst = 1; if( bDesc ){ pNew->bRev = 1; pIter->flags |= FTS5_SEGITER_REVERSE; fts5SegIterReverseInitPage(p, pIter); }else{ fts5SegIterLoadNPos(p, pIter); } pData = 0; }else{ pNew->base.bEof = 1; } fts5SegIterSetNext(p, pIter); *ppOut = pNew; } fts5DataRelease(pData); } /* ** Return true if the iterator is at EOF or if an error has occurred. ** False otherwise. */ static int fts5MultiIterEof(Fts5Index *p, Fts5Iter *pIter){ assert( p->rc || (pIter->aSeg[ pIter->aFirst[1].iFirst ].pLeaf==0)==pIter->base.bEof ); return (p->rc || pIter->base.bEof); } /* ** Return the rowid of the entry that the iterator currently points ** to. If the iterator points to EOF when this function is called the ** results are undefined. */ static i64 fts5MultiIterRowid(Fts5Iter *pIter){ assert( pIter->aSeg[ pIter->aFirst[1].iFirst ].pLeaf ); return pIter->aSeg[ pIter->aFirst[1].iFirst ].iRowid; } /* ** Move the iterator to the next entry at or following iMatch. */ static void fts5MultiIterNextFrom( Fts5Index *p, Fts5Iter *pIter, i64 iMatch ){ while( 1 ){ i64 iRowid; fts5MultiIterNext(p, pIter, 1, iMatch); if( fts5MultiIterEof(p, pIter) ) break; iRowid = fts5MultiIterRowid(pIter); if( pIter->bRev==0 && iRowid>=iMatch ) break; if( pIter->bRev!=0 && iRowid<=iMatch ) break; } } /* ** Return a pointer to a buffer containing the term associated with the ** entry that the iterator currently points to. */ static const u8 *fts5MultiIterTerm(Fts5Iter *pIter, int *pn){ Fts5SegIter *p = &pIter->aSeg[ pIter->aFirst[1].iFirst ]; *pn = p->term.n; return p->term.p; } /* ** Allocate a new segment-id for the structure pStruct. The new segment ** id must be between 1 and 65335 inclusive, and must not be used by ** any currently existing segment. If a free segment id cannot be found, ** SQLITE_FULL is returned. ** ** If an error has already occurred, this function is a no-op. 0 is ** returned in this case. */ static int fts5AllocateSegid(Fts5Index *p, Fts5Structure *pStruct){ int iSegid = 0; if( p->rc==SQLITE_OK ){ if( pStruct->nSegment>=FTS5_MAX_SEGMENT ){ p->rc = SQLITE_FULL; }else{ /* FTS5_MAX_SEGMENT is currently defined as 2000. So the following ** array is 63 elements, or 252 bytes, in size. */ u32 aUsed[(FTS5_MAX_SEGMENT+31) / 32]; int iLvl, iSeg; int i; u32 mask; memset(aUsed, 0, sizeof(aUsed)); for(iLvl=0; iLvlnLevel; iLvl++){ for(iSeg=0; iSegaLevel[iLvl].nSeg; iSeg++){ int iId = pStruct->aLevel[iLvl].aSeg[iSeg].iSegid; if( iId<=FTS5_MAX_SEGMENT ){ aUsed[(iId-1) / 32] |= 1 << ((iId-1) % 32); } } } for(i=0; aUsed[i]==0xFFFFFFFF; i++); mask = aUsed[i]; for(iSegid=0; mask & (1 << iSegid); iSegid++); iSegid += 1 + i*32; #ifdef SQLITE_DEBUG for(iLvl=0; iLvlnLevel; iLvl++){ for(iSeg=0; iSegaLevel[iLvl].nSeg; iSeg++){ assert( iSegid!=pStruct->aLevel[iLvl].aSeg[iSeg].iSegid ); } } assert( iSegid>0 && iSegid<=FTS5_MAX_SEGMENT ); { sqlite3_stmt *pIdxSelect = fts5IdxSelectStmt(p); if( p->rc==SQLITE_OK ){ u8 aBlob[2] = {0xff, 0xff}; sqlite3_bind_int(pIdxSelect, 1, iSegid); sqlite3_bind_blob(pIdxSelect, 2, aBlob, 2, SQLITE_STATIC); assert( sqlite3_step(pIdxSelect)!=SQLITE_ROW ); p->rc = sqlite3_reset(pIdxSelect); } } #endif } } return iSegid; } /* ** Discard all data currently cached in the hash-tables. */ static void fts5IndexDiscardData(Fts5Index *p){ assert( p->pHash || p->nPendingData==0 ); if( p->pHash ){ sqlite3Fts5HashClear(p->pHash); p->nPendingData = 0; } } /* ** Return the size of the prefix, in bytes, that buffer ** (pNew/) shares with buffer (pOld/nOld). ** ** Buffer (pNew/) is guaranteed to be greater ** than buffer (pOld/nOld). */ static int fts5PrefixCompress(int nOld, const u8 *pOld, const u8 *pNew){ int i; for(i=0; inDlidx>0 && pWriter->aDlidx[0].buf.n>0) ); for(i=0; inDlidx; i++){ Fts5DlidxWriter *pDlidx = &pWriter->aDlidx[i]; if( pDlidx->buf.n==0 ) break; if( bFlush ){ assert( pDlidx->pgno!=0 ); fts5DataWrite(p, FTS5_DLIDX_ROWID(pWriter->iSegid, i, pDlidx->pgno), pDlidx->buf.p, pDlidx->buf.n ); } sqlite3Fts5BufferZero(&pDlidx->buf); pDlidx->bPrevValid = 0; } } /* ** Grow the pWriter->aDlidx[] array to at least nLvl elements in size. ** Any new array elements are zeroed before returning. */ static int fts5WriteDlidxGrow( Fts5Index *p, Fts5SegWriter *pWriter, int nLvl ){ if( p->rc==SQLITE_OK && nLvl>=pWriter->nDlidx ){ Fts5DlidxWriter *aDlidx = (Fts5DlidxWriter*)sqlite3_realloc( pWriter->aDlidx, sizeof(Fts5DlidxWriter) * nLvl ); if( aDlidx==0 ){ p->rc = SQLITE_NOMEM; }else{ int nByte = sizeof(Fts5DlidxWriter) * (nLvl - pWriter->nDlidx); memset(&aDlidx[pWriter->nDlidx], 0, nByte); pWriter->aDlidx = aDlidx; pWriter->nDlidx = nLvl; } } return p->rc; } /* ** If the current doclist-index accumulating in pWriter->aDlidx[] is large ** enough, flush it to disk and return 1. Otherwise discard it and return ** zero. */ static int fts5WriteFlushDlidx(Fts5Index *p, Fts5SegWriter *pWriter){ int bFlag = 0; /* If there were FTS5_MIN_DLIDX_SIZE or more empty leaf pages written ** to the database, also write the doclist-index to disk. */ if( pWriter->aDlidx[0].buf.n>0 && pWriter->nEmpty>=FTS5_MIN_DLIDX_SIZE ){ bFlag = 1; } fts5WriteDlidxClear(p, pWriter, bFlag); pWriter->nEmpty = 0; return bFlag; } /* ** This function is called whenever processing of the doclist for the ** last term on leaf page (pWriter->iBtPage) is completed. ** ** The doclist-index for that term is currently stored in-memory within the ** Fts5SegWriter.aDlidx[] array. If it is large enough, this function ** writes it out to disk. Or, if it is too small to bother with, discards ** it. ** ** Fts5SegWriter.btterm currently contains the first term on page iBtPage. */ static void fts5WriteFlushBtree(Fts5Index *p, Fts5SegWriter *pWriter){ int bFlag; assert( pWriter->iBtPage || pWriter->nEmpty==0 ); if( pWriter->iBtPage==0 ) return; bFlag = fts5WriteFlushDlidx(p, pWriter); if( p->rc==SQLITE_OK ){ const char *z = (pWriter->btterm.n>0?(const char*)pWriter->btterm.p:""); /* The following was already done in fts5WriteInit(): */ /* sqlite3_bind_int(p->pIdxWriter, 1, pWriter->iSegid); */ sqlite3_bind_blob(p->pIdxWriter, 2, z, pWriter->btterm.n, SQLITE_STATIC); sqlite3_bind_int64(p->pIdxWriter, 3, bFlag + ((i64)pWriter->iBtPage<<1)); sqlite3_step(p->pIdxWriter); p->rc = sqlite3_reset(p->pIdxWriter); } pWriter->iBtPage = 0; } /* ** This is called once for each leaf page except the first that contains ** at least one term. Argument (nTerm/pTerm) is the split-key - a term that ** is larger than all terms written to earlier leaves, and equal to or ** smaller than the first term on the new leaf. ** ** If an error occurs, an error code is left in Fts5Index.rc. If an error ** has already occurred when this function is called, it is a no-op. */ static void fts5WriteBtreeTerm( Fts5Index *p, /* FTS5 backend object */ Fts5SegWriter *pWriter, /* Writer object */ int nTerm, const u8 *pTerm /* First term on new page */ ){ fts5WriteFlushBtree(p, pWriter); fts5BufferSet(&p->rc, &pWriter->btterm, nTerm, pTerm); pWriter->iBtPage = pWriter->writer.pgno; } /* ** This function is called when flushing a leaf page that contains no ** terms at all to disk. */ static void fts5WriteBtreeNoTerm( Fts5Index *p, /* FTS5 backend object */ Fts5SegWriter *pWriter /* Writer object */ ){ /* If there were no rowids on the leaf page either and the doclist-index ** has already been started, append an 0x00 byte to it. */ if( pWriter->bFirstRowidInPage && pWriter->aDlidx[0].buf.n>0 ){ Fts5DlidxWriter *pDlidx = &pWriter->aDlidx[0]; assert( pDlidx->bPrevValid ); sqlite3Fts5BufferAppendVarint(&p->rc, &pDlidx->buf, 0); } /* Increment the "number of sequential leaves without a term" counter. */ pWriter->nEmpty++; } static i64 fts5DlidxExtractFirstRowid(Fts5Buffer *pBuf){ i64 iRowid; int iOff; iOff = 1 + fts5GetVarint(&pBuf->p[1], (u64*)&iRowid); fts5GetVarint(&pBuf->p[iOff], (u64*)&iRowid); return iRowid; } /* ** Rowid iRowid has just been appended to the current leaf page. It is the ** first on the page. This function appends an appropriate entry to the current ** doclist-index. */ static void fts5WriteDlidxAppend( Fts5Index *p, Fts5SegWriter *pWriter, i64 iRowid ){ int i; int bDone = 0; for(i=0; p->rc==SQLITE_OK && bDone==0; i++){ i64 iVal; Fts5DlidxWriter *pDlidx = &pWriter->aDlidx[i]; if( pDlidx->buf.n>=p->pConfig->pgsz ){ /* The current doclist-index page is full. Write it to disk and push ** a copy of iRowid (which will become the first rowid on the next ** doclist-index leaf page) up into the next level of the b-tree ** hierarchy. If the node being flushed is currently the root node, ** also push its first rowid upwards. */ pDlidx->buf.p[0] = 0x01; /* Not the root node */ fts5DataWrite(p, FTS5_DLIDX_ROWID(pWriter->iSegid, i, pDlidx->pgno), pDlidx->buf.p, pDlidx->buf.n ); fts5WriteDlidxGrow(p, pWriter, i+2); pDlidx = &pWriter->aDlidx[i]; if( p->rc==SQLITE_OK && pDlidx[1].buf.n==0 ){ i64 iFirst = fts5DlidxExtractFirstRowid(&pDlidx->buf); /* This was the root node. Push its first rowid up to the new root. */ pDlidx[1].pgno = pDlidx->pgno; sqlite3Fts5BufferAppendVarint(&p->rc, &pDlidx[1].buf, 0); sqlite3Fts5BufferAppendVarint(&p->rc, &pDlidx[1].buf, pDlidx->pgno); sqlite3Fts5BufferAppendVarint(&p->rc, &pDlidx[1].buf, iFirst); pDlidx[1].bPrevValid = 1; pDlidx[1].iPrev = iFirst; } sqlite3Fts5BufferZero(&pDlidx->buf); pDlidx->bPrevValid = 0; pDlidx->pgno++; }else{ bDone = 1; } if( pDlidx->bPrevValid ){ iVal = iRowid - pDlidx->iPrev; }else{ i64 iPgno = (i==0 ? pWriter->writer.pgno : pDlidx[-1].pgno); assert( pDlidx->buf.n==0 ); sqlite3Fts5BufferAppendVarint(&p->rc, &pDlidx->buf, !bDone); sqlite3Fts5BufferAppendVarint(&p->rc, &pDlidx->buf, iPgno); iVal = iRowid; } sqlite3Fts5BufferAppendVarint(&p->rc, &pDlidx->buf, iVal); pDlidx->bPrevValid = 1; pDlidx->iPrev = iRowid; } } static void fts5WriteFlushLeaf(Fts5Index *p, Fts5SegWriter *pWriter){ static const u8 zero[] = { 0x00, 0x00, 0x00, 0x00 }; Fts5PageWriter *pPage = &pWriter->writer; i64 iRowid; assert( (pPage->pgidx.n==0)==(pWriter->bFirstTermInPage) ); /* Set the szLeaf header field. */ assert( 0==fts5GetU16(&pPage->buf.p[2]) ); fts5PutU16(&pPage->buf.p[2], (u16)pPage->buf.n); if( pWriter->bFirstTermInPage ){ /* No term was written to this page. */ assert( pPage->pgidx.n==0 ); fts5WriteBtreeNoTerm(p, pWriter); }else{ /* Append the pgidx to the page buffer. Set the szLeaf header field. */ fts5BufferAppendBlob(&p->rc, &pPage->buf, pPage->pgidx.n, pPage->pgidx.p); } /* Write the page out to disk */ iRowid = FTS5_SEGMENT_ROWID(pWriter->iSegid, pPage->pgno); fts5DataWrite(p, iRowid, pPage->buf.p, pPage->buf.n); /* Initialize the next page. */ fts5BufferZero(&pPage->buf); fts5BufferZero(&pPage->pgidx); fts5BufferAppendBlob(&p->rc, &pPage->buf, 4, zero); pPage->iPrevPgidx = 0; pPage->pgno++; /* Increase the leaves written counter */ pWriter->nLeafWritten++; /* The new leaf holds no terms or rowids */ pWriter->bFirstTermInPage = 1; pWriter->bFirstRowidInPage = 1; } /* ** Append term pTerm/nTerm to the segment being written by the writer passed ** as the second argument. ** ** If an error occurs, set the Fts5Index.rc error code. If an error has ** already occurred, this function is a no-op. */ static void fts5WriteAppendTerm( Fts5Index *p, Fts5SegWriter *pWriter, int nTerm, const u8 *pTerm ){ int nPrefix; /* Bytes of prefix compression for term */ Fts5PageWriter *pPage = &pWriter->writer; Fts5Buffer *pPgidx = &pWriter->writer.pgidx; assert( p->rc==SQLITE_OK ); assert( pPage->buf.n>=4 ); assert( pPage->buf.n>4 || pWriter->bFirstTermInPage ); /* If the current leaf page is full, flush it to disk. */ if( (pPage->buf.n + pPgidx->n + nTerm + 2)>=p->pConfig->pgsz ){ if( pPage->buf.n>4 ){ fts5WriteFlushLeaf(p, pWriter); } fts5BufferGrow(&p->rc, &pPage->buf, nTerm+FTS5_DATA_PADDING); } /* TODO1: Updating pgidx here. */ pPgidx->n += sqlite3Fts5PutVarint( &pPgidx->p[pPgidx->n], pPage->buf.n - pPage->iPrevPgidx ); pPage->iPrevPgidx = pPage->buf.n; #if 0 fts5PutU16(&pPgidx->p[pPgidx->n], pPage->buf.n); pPgidx->n += 2; #endif if( pWriter->bFirstTermInPage ){ nPrefix = 0; if( pPage->pgno!=1 ){ /* This is the first term on a leaf that is not the leftmost leaf in ** the segment b-tree. In this case it is necessary to add a term to ** the b-tree hierarchy that is (a) larger than the largest term ** already written to the segment and (b) smaller than or equal to ** this term. In other words, a prefix of (pTerm/nTerm) that is one ** byte longer than the longest prefix (pTerm/nTerm) shares with the ** previous term. ** ** Usually, the previous term is available in pPage->term. The exception ** is if this is the first term written in an incremental-merge step. ** In this case the previous term is not available, so just write a ** copy of (pTerm/nTerm) into the parent node. This is slightly ** inefficient, but still correct. */ int n = nTerm; if( pPage->term.n ){ n = 1 + fts5PrefixCompress(pPage->term.n, pPage->term.p, pTerm); } fts5WriteBtreeTerm(p, pWriter, n, pTerm); pPage = &pWriter->writer; } }else{ nPrefix = fts5PrefixCompress(pPage->term.n, pPage->term.p, pTerm); fts5BufferAppendVarint(&p->rc, &pPage->buf, nPrefix); } /* Append the number of bytes of new data, then the term data itself ** to the page. */ fts5BufferAppendVarint(&p->rc, &pPage->buf, nTerm - nPrefix); fts5BufferAppendBlob(&p->rc, &pPage->buf, nTerm - nPrefix, &pTerm[nPrefix]); /* Update the Fts5PageWriter.term field. */ fts5BufferSet(&p->rc, &pPage->term, nTerm, pTerm); pWriter->bFirstTermInPage = 0; pWriter->bFirstRowidInPage = 0; pWriter->bFirstRowidInDoclist = 1; assert( p->rc || (pWriter->nDlidx>0 && pWriter->aDlidx[0].buf.n==0) ); pWriter->aDlidx[0].pgno = pPage->pgno; } /* ** Append a rowid and position-list size field to the writers output. */ static void fts5WriteAppendRowid( Fts5Index *p, Fts5SegWriter *pWriter, i64 iRowid ){ if( p->rc==SQLITE_OK ){ Fts5PageWriter *pPage = &pWriter->writer; if( (pPage->buf.n + pPage->pgidx.n)>=p->pConfig->pgsz ){ fts5WriteFlushLeaf(p, pWriter); } /* If this is to be the first rowid written to the page, set the ** rowid-pointer in the page-header. Also append a value to the dlidx ** buffer, in case a doclist-index is required. */ if( pWriter->bFirstRowidInPage ){ fts5PutU16(pPage->buf.p, (u16)pPage->buf.n); fts5WriteDlidxAppend(p, pWriter, iRowid); } /* Write the rowid. */ if( pWriter->bFirstRowidInDoclist || pWriter->bFirstRowidInPage ){ fts5BufferAppendVarint(&p->rc, &pPage->buf, iRowid); }else{ assert( p->rc || iRowid>pWriter->iPrevRowid ); fts5BufferAppendVarint(&p->rc, &pPage->buf, iRowid - pWriter->iPrevRowid); } pWriter->iPrevRowid = iRowid; pWriter->bFirstRowidInDoclist = 0; pWriter->bFirstRowidInPage = 0; } } static void fts5WriteAppendPoslistData( Fts5Index *p, Fts5SegWriter *pWriter, const u8 *aData, int nData ){ Fts5PageWriter *pPage = &pWriter->writer; const u8 *a = aData; int n = nData; assert( p->pConfig->pgsz>0 ); while( p->rc==SQLITE_OK && (pPage->buf.n + pPage->pgidx.n + n)>=p->pConfig->pgsz ){ int nReq = p->pConfig->pgsz - pPage->buf.n - pPage->pgidx.n; int nCopy = 0; while( nCopyrc, &pPage->buf, nCopy, a); a += nCopy; n -= nCopy; fts5WriteFlushLeaf(p, pWriter); } if( n>0 ){ fts5BufferAppendBlob(&p->rc, &pPage->buf, n, a); } } /* ** Flush any data cached by the writer object to the database. Free any ** allocations associated with the writer. */ static void fts5WriteFinish( Fts5Index *p, Fts5SegWriter *pWriter, /* Writer object */ int *pnLeaf /* OUT: Number of leaf pages in b-tree */ ){ int i; Fts5PageWriter *pLeaf = &pWriter->writer; if( p->rc==SQLITE_OK ){ assert( pLeaf->pgno>=1 ); if( pLeaf->buf.n>4 ){ fts5WriteFlushLeaf(p, pWriter); } *pnLeaf = pLeaf->pgno-1; if( pLeaf->pgno>1 ){ fts5WriteFlushBtree(p, pWriter); } } fts5BufferFree(&pLeaf->term); fts5BufferFree(&pLeaf->buf); fts5BufferFree(&pLeaf->pgidx); fts5BufferFree(&pWriter->btterm); for(i=0; inDlidx; i++){ sqlite3Fts5BufferFree(&pWriter->aDlidx[i].buf); } sqlite3_free(pWriter->aDlidx); } static void fts5WriteInit( Fts5Index *p, Fts5SegWriter *pWriter, int iSegid ){ const int nBuffer = p->pConfig->pgsz + FTS5_DATA_PADDING; memset(pWriter, 0, sizeof(Fts5SegWriter)); pWriter->iSegid = iSegid; fts5WriteDlidxGrow(p, pWriter, 1); pWriter->writer.pgno = 1; pWriter->bFirstTermInPage = 1; pWriter->iBtPage = 1; assert( pWriter->writer.buf.n==0 ); assert( pWriter->writer.pgidx.n==0 ); /* Grow the two buffers to pgsz + padding bytes in size. */ sqlite3Fts5BufferSize(&p->rc, &pWriter->writer.pgidx, nBuffer); sqlite3Fts5BufferSize(&p->rc, &pWriter->writer.buf, nBuffer); if( p->pIdxWriter==0 ){ Fts5Config *pConfig = p->pConfig; fts5IndexPrepareStmt(p, &p->pIdxWriter, sqlite3_mprintf( "INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)", pConfig->zDb, pConfig->zName )); } if( p->rc==SQLITE_OK ){ /* Initialize the 4-byte leaf-page header to 0x00. */ memset(pWriter->writer.buf.p, 0, 4); pWriter->writer.buf.n = 4; /* Bind the current output segment id to the index-writer. This is an ** optimization over binding the same value over and over as rows are ** inserted into %_idx by the current writer. */ sqlite3_bind_int(p->pIdxWriter, 1, pWriter->iSegid); } } /* ** Iterator pIter was used to iterate through the input segments of on an ** incremental merge operation. This function is called if the incremental ** merge step has finished but the input has not been completely exhausted. */ static void fts5TrimSegments(Fts5Index *p, Fts5Iter *pIter){ int i; Fts5Buffer buf; memset(&buf, 0, sizeof(Fts5Buffer)); for(i=0; inSeg; i++){ Fts5SegIter *pSeg = &pIter->aSeg[i]; if( pSeg->pSeg==0 ){ /* no-op */ }else if( pSeg->pLeaf==0 ){ /* All keys from this input segment have been transfered to the output. ** Set both the first and last page-numbers to 0 to indicate that the ** segment is now empty. */ pSeg->pSeg->pgnoLast = 0; pSeg->pSeg->pgnoFirst = 0; }else{ int iOff = pSeg->iTermLeafOffset; /* Offset on new first leaf page */ i64 iLeafRowid; Fts5Data *pData; int iId = pSeg->pSeg->iSegid; u8 aHdr[4] = {0x00, 0x00, 0x00, 0x00}; iLeafRowid = FTS5_SEGMENT_ROWID(iId, pSeg->iTermLeafPgno); pData = fts5DataRead(p, iLeafRowid); if( pData ){ fts5BufferZero(&buf); fts5BufferGrow(&p->rc, &buf, pData->nn); fts5BufferAppendBlob(&p->rc, &buf, sizeof(aHdr), aHdr); fts5BufferAppendVarint(&p->rc, &buf, pSeg->term.n); fts5BufferAppendBlob(&p->rc, &buf, pSeg->term.n, pSeg->term.p); fts5BufferAppendBlob(&p->rc, &buf, pData->szLeaf-iOff, &pData->p[iOff]); if( p->rc==SQLITE_OK ){ /* Set the szLeaf field */ fts5PutU16(&buf.p[2], (u16)buf.n); } /* Set up the new page-index array */ fts5BufferAppendVarint(&p->rc, &buf, 4); if( pSeg->iLeafPgno==pSeg->iTermLeafPgno && pSeg->iEndofDoclistszLeaf ){ int nDiff = pData->szLeaf - pSeg->iEndofDoclist; fts5BufferAppendVarint(&p->rc, &buf, buf.n - 1 - nDiff - 4); fts5BufferAppendBlob(&p->rc, &buf, pData->nn - pSeg->iPgidxOff, &pData->p[pSeg->iPgidxOff] ); } fts5DataRelease(pData); pSeg->pSeg->pgnoFirst = pSeg->iTermLeafPgno; fts5DataDelete(p, FTS5_SEGMENT_ROWID(iId, 1), iLeafRowid); fts5DataWrite(p, iLeafRowid, buf.p, buf.n); } } } fts5BufferFree(&buf); } static void fts5MergeChunkCallback( Fts5Index *p, void *pCtx, const u8 *pChunk, int nChunk ){ Fts5SegWriter *pWriter = (Fts5SegWriter*)pCtx; fts5WriteAppendPoslistData(p, pWriter, pChunk, nChunk); } /* ** */ static void fts5IndexMergeLevel( Fts5Index *p, /* FTS5 backend object */ Fts5Structure **ppStruct, /* IN/OUT: Stucture of index */ int iLvl, /* Level to read input from */ int *pnRem /* Write up to this many output leaves */ ){ Fts5Structure *pStruct = *ppStruct; Fts5StructureLevel *pLvl = &pStruct->aLevel[iLvl]; Fts5StructureLevel *pLvlOut; Fts5Iter *pIter = 0; /* Iterator to read input data */ int nRem = pnRem ? *pnRem : 0; /* Output leaf pages left to write */ int nInput; /* Number of input segments */ Fts5SegWriter writer; /* Writer object */ Fts5StructureSegment *pSeg; /* Output segment */ Fts5Buffer term; int bOldest; /* True if the output segment is the oldest */ int eDetail = p->pConfig->eDetail; const int flags = FTS5INDEX_QUERY_NOOUTPUT; int bTermWritten = 0; /* True if current term already output */ assert( iLvlnLevel ); assert( pLvl->nMerge<=pLvl->nSeg ); memset(&writer, 0, sizeof(Fts5SegWriter)); memset(&term, 0, sizeof(Fts5Buffer)); if( pLvl->nMerge ){ pLvlOut = &pStruct->aLevel[iLvl+1]; assert( pLvlOut->nSeg>0 ); nInput = pLvl->nMerge; pSeg = &pLvlOut->aSeg[pLvlOut->nSeg-1]; fts5WriteInit(p, &writer, pSeg->iSegid); writer.writer.pgno = pSeg->pgnoLast+1; writer.iBtPage = 0; }else{ int iSegid = fts5AllocateSegid(p, pStruct); /* Extend the Fts5Structure object as required to ensure the output ** segment exists. */ if( iLvl==pStruct->nLevel-1 ){ fts5StructureAddLevel(&p->rc, ppStruct); pStruct = *ppStruct; } fts5StructureExtendLevel(&p->rc, pStruct, iLvl+1, 1, 0); if( p->rc ) return; pLvl = &pStruct->aLevel[iLvl]; pLvlOut = &pStruct->aLevel[iLvl+1]; fts5WriteInit(p, &writer, iSegid); /* Add the new segment to the output level */ pSeg = &pLvlOut->aSeg[pLvlOut->nSeg]; pLvlOut->nSeg++; pSeg->pgnoFirst = 1; pSeg->iSegid = iSegid; pStruct->nSegment++; /* Read input from all segments in the input level */ nInput = pLvl->nSeg; } bOldest = (pLvlOut->nSeg==1 && pStruct->nLevel==iLvl+2); assert( iLvl>=0 ); for(fts5MultiIterNew(p, pStruct, flags, 0, 0, 0, iLvl, nInput, &pIter); fts5MultiIterEof(p, pIter)==0; fts5MultiIterNext(p, pIter, 0, 0) ){ Fts5SegIter *pSegIter = &pIter->aSeg[ pIter->aFirst[1].iFirst ]; int nPos; /* position-list size field value */ int nTerm; const u8 *pTerm; pTerm = fts5MultiIterTerm(pIter, &nTerm); if( nTerm!=term.n || memcmp(pTerm, term.p, nTerm) ){ if( pnRem && writer.nLeafWritten>nRem ){ break; } fts5BufferSet(&p->rc, &term, nTerm, pTerm); bTermWritten =0; } /* Check for key annihilation. */ if( pSegIter->nPos==0 && (bOldest || pSegIter->bDel==0) ) continue; if( p->rc==SQLITE_OK && bTermWritten==0 ){ /* This is a new term. Append a term to the output segment. */ fts5WriteAppendTerm(p, &writer, nTerm, pTerm); bTermWritten = 1; } /* Append the rowid to the output */ /* WRITEPOSLISTSIZE */ fts5WriteAppendRowid(p, &writer, fts5MultiIterRowid(pIter)); if( eDetail==FTS5_DETAIL_NONE ){ if( pSegIter->bDel ){ fts5BufferAppendVarint(&p->rc, &writer.writer.buf, 0); if( pSegIter->nPos>0 ){ fts5BufferAppendVarint(&p->rc, &writer.writer.buf, 0); } } }else{ /* Append the position-list data to the output */ nPos = pSegIter->nPos*2 + pSegIter->bDel; fts5BufferAppendVarint(&p->rc, &writer.writer.buf, nPos); fts5ChunkIterate(p, pSegIter, (void*)&writer, fts5MergeChunkCallback); } } /* Flush the last leaf page to disk. Set the output segment b-tree height ** and last leaf page number at the same time. */ fts5WriteFinish(p, &writer, &pSeg->pgnoLast); if( fts5MultiIterEof(p, pIter) ){ int i; /* Remove the redundant segments from the %_data table */ for(i=0; iaSeg[i].iSegid); } /* Remove the redundant segments from the input level */ if( pLvl->nSeg!=nInput ){ int nMove = (pLvl->nSeg - nInput) * sizeof(Fts5StructureSegment); memmove(pLvl->aSeg, &pLvl->aSeg[nInput], nMove); } pStruct->nSegment -= nInput; pLvl->nSeg -= nInput; pLvl->nMerge = 0; if( pSeg->pgnoLast==0 ){ pLvlOut->nSeg--; pStruct->nSegment--; } }else{ assert( pSeg->pgnoLast>0 ); fts5TrimSegments(p, pIter); pLvl->nMerge = nInput; } fts5MultiIterFree(pIter); fts5BufferFree(&term); if( pnRem ) *pnRem -= writer.nLeafWritten; } /* ** Do up to nPg pages of automerge work on the index. ** ** Return true if any changes were actually made, or false otherwise. */ static int fts5IndexMerge( Fts5Index *p, /* FTS5 backend object */ Fts5Structure **ppStruct, /* IN/OUT: Current structure of index */ int nPg, /* Pages of work to do */ int nMin /* Minimum number of segments to merge */ ){ int nRem = nPg; int bRet = 0; Fts5Structure *pStruct = *ppStruct; while( nRem>0 && p->rc==SQLITE_OK ){ int iLvl; /* To iterate through levels */ int iBestLvl = 0; /* Level offering the most input segments */ int nBest = 0; /* Number of input segments on best level */ /* Set iBestLvl to the level to read input segments from. */ assert( pStruct->nLevel>0 ); for(iLvl=0; iLvlnLevel; iLvl++){ Fts5StructureLevel *pLvl = &pStruct->aLevel[iLvl]; if( pLvl->nMerge ){ if( pLvl->nMerge>nBest ){ iBestLvl = iLvl; nBest = pLvl->nMerge; } break; } if( pLvl->nSeg>nBest ){ nBest = pLvl->nSeg; iBestLvl = iLvl; } } /* If nBest is still 0, then the index must be empty. */ #ifdef SQLITE_DEBUG for(iLvl=0; nBest==0 && iLvlnLevel; iLvl++){ assert( pStruct->aLevel[iLvl].nSeg==0 ); } #endif if( nBestaLevel[iBestLvl].nMerge==0 ){ break; } bRet = 1; fts5IndexMergeLevel(p, &pStruct, iBestLvl, &nRem); if( p->rc==SQLITE_OK && pStruct->aLevel[iBestLvl].nMerge==0 ){ fts5StructurePromote(p, iBestLvl+1, pStruct); } } *ppStruct = pStruct; return bRet; } /* ** A total of nLeaf leaf pages of data has just been flushed to a level-0 ** segment. This function updates the write-counter accordingly and, if ** necessary, performs incremental merge work. ** ** If an error occurs, set the Fts5Index.rc error code. If an error has ** already occurred, this function is a no-op. */ static void fts5IndexAutomerge( Fts5Index *p, /* FTS5 backend object */ Fts5Structure **ppStruct, /* IN/OUT: Current structure of index */ int nLeaf /* Number of output leaves just written */ ){ if( p->rc==SQLITE_OK && p->pConfig->nAutomerge>0 ){ Fts5Structure *pStruct = *ppStruct; u64 nWrite; /* Initial value of write-counter */ int nWork; /* Number of work-quanta to perform */ int nRem; /* Number of leaf pages left to write */ /* Update the write-counter. While doing so, set nWork. */ nWrite = pStruct->nWriteCounter; nWork = (int)(((nWrite + nLeaf) / p->nWorkUnit) - (nWrite / p->nWorkUnit)); pStruct->nWriteCounter += nLeaf; nRem = (int)(p->nWorkUnit * nWork * pStruct->nLevel); fts5IndexMerge(p, ppStruct, nRem, p->pConfig->nAutomerge); } } static void fts5IndexCrisismerge( Fts5Index *p, /* FTS5 backend object */ Fts5Structure **ppStruct /* IN/OUT: Current structure of index */ ){ const int nCrisis = p->pConfig->nCrisisMerge; Fts5Structure *pStruct = *ppStruct; int iLvl = 0; assert( p->rc!=SQLITE_OK || pStruct->nLevel>0 ); while( p->rc==SQLITE_OK && pStruct->aLevel[iLvl].nSeg>=nCrisis ){ fts5IndexMergeLevel(p, &pStruct, iLvl, 0); assert( p->rc!=SQLITE_OK || pStruct->nLevel>(iLvl+1) ); fts5StructurePromote(p, iLvl+1, pStruct); iLvl++; } *ppStruct = pStruct; } static int fts5IndexReturn(Fts5Index *p){ int rc = p->rc; p->rc = SQLITE_OK; return rc; } typedef struct Fts5FlushCtx Fts5FlushCtx; struct Fts5FlushCtx { Fts5Index *pIdx; Fts5SegWriter writer; }; /* ** Buffer aBuf[] contains a list of varints, all small enough to fit ** in a 32-bit integer. Return the size of the largest prefix of this ** list nMax bytes or less in size. */ static int fts5PoslistPrefix(const u8 *aBuf, int nMax){ int ret; u32 dummy; ret = fts5GetVarint32(aBuf, dummy); if( ret nMax ) break; ret += i; } } return ret; } /* ** Flush the contents of in-memory hash table iHash to a new level-0 ** segment on disk. Also update the corresponding structure record. ** ** If an error occurs, set the Fts5Index.rc error code. If an error has ** already occurred, this function is a no-op. */ static void fts5FlushOneHash(Fts5Index *p){ Fts5Hash *pHash = p->pHash; Fts5Structure *pStruct; int iSegid; int pgnoLast = 0; /* Last leaf page number in segment */ /* Obtain a reference to the index structure and allocate a new segment-id ** for the new level-0 segment. */ pStruct = fts5StructureRead(p); iSegid = fts5AllocateSegid(p, pStruct); fts5StructureInvalidate(p); if( iSegid ){ const int pgsz = p->pConfig->pgsz; int eDetail = p->pConfig->eDetail; Fts5StructureSegment *pSeg; /* New segment within pStruct */ Fts5Buffer *pBuf; /* Buffer in which to assemble leaf page */ Fts5Buffer *pPgidx; /* Buffer in which to assemble pgidx */ Fts5SegWriter writer; fts5WriteInit(p, &writer, iSegid); pBuf = &writer.writer.buf; pPgidx = &writer.writer.pgidx; /* fts5WriteInit() should have initialized the buffers to (most likely) ** the maximum space required. */ assert( p->rc || pBuf->nSpace>=(pgsz + FTS5_DATA_PADDING) ); assert( p->rc || pPgidx->nSpace>=(pgsz + FTS5_DATA_PADDING) ); /* Begin scanning through hash table entries. This loop runs once for each ** term/doclist currently stored within the hash table. */ if( p->rc==SQLITE_OK ){ p->rc = sqlite3Fts5HashScanInit(pHash, 0, 0); } while( p->rc==SQLITE_OK && 0==sqlite3Fts5HashScanEof(pHash) ){ const char *zTerm; /* Buffer containing term */ const u8 *pDoclist; /* Pointer to doclist for this term */ int nDoclist; /* Size of doclist in bytes */ /* Write the term for this entry to disk. */ sqlite3Fts5HashScanEntry(pHash, &zTerm, &pDoclist, &nDoclist); fts5WriteAppendTerm(p, &writer, (int)strlen(zTerm), (const u8*)zTerm); assert( writer.bFirstRowidInPage==0 ); if( pgsz>=(pBuf->n + pPgidx->n + nDoclist + 1) ){ /* The entire doclist will fit on the current leaf. */ fts5BufferSafeAppendBlob(pBuf, pDoclist, nDoclist); }else{ i64 iRowid = 0; i64 iDelta = 0; int iOff = 0; /* The entire doclist will not fit on this leaf. The following ** loop iterates through the poslists that make up the current ** doclist. */ while( p->rc==SQLITE_OK && iOffp[0], (u16)pBuf->n); /* first rowid on page */ pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], iRowid); writer.bFirstRowidInPage = 0; fts5WriteDlidxAppend(p, &writer, iRowid); }else{ pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], iDelta); } assert( pBuf->n<=pBuf->nSpace ); if( eDetail==FTS5_DETAIL_NONE ){ if( iOffp[pBuf->n++] = 0; iOff++; if( iOffp[pBuf->n++] = 0; iOff++; } } if( (pBuf->n + pPgidx->n)>=pgsz ){ fts5WriteFlushLeaf(p, &writer); } }else{ int bDummy; int nPos; int nCopy = fts5GetPoslistSize(&pDoclist[iOff], &nPos, &bDummy); nCopy += nPos; if( (pBuf->n + pPgidx->n + nCopy) <= pgsz ){ /* The entire poslist will fit on the current leaf. So copy ** it in one go. */ fts5BufferSafeAppendBlob(pBuf, &pDoclist[iOff], nCopy); }else{ /* The entire poslist will not fit on this leaf. So it needs ** to be broken into sections. The only qualification being ** that each varint must be stored contiguously. */ const u8 *pPoslist = &pDoclist[iOff]; int iPos = 0; while( p->rc==SQLITE_OK ){ int nSpace = pgsz - pBuf->n - pPgidx->n; int n = 0; if( (nCopy - iPos)<=nSpace ){ n = nCopy - iPos; }else{ n = fts5PoslistPrefix(&pPoslist[iPos], nSpace); } assert( n>0 ); fts5BufferSafeAppendBlob(pBuf, &pPoslist[iPos], n); iPos += n; if( (pBuf->n + pPgidx->n)>=pgsz ){ fts5WriteFlushLeaf(p, &writer); } if( iPos>=nCopy ) break; } } iOff += nCopy; } } } /* TODO2: Doclist terminator written here. */ /* pBuf->p[pBuf->n++] = '\0'; */ assert( pBuf->n<=pBuf->nSpace ); sqlite3Fts5HashScanNext(pHash); } sqlite3Fts5HashClear(pHash); fts5WriteFinish(p, &writer, &pgnoLast); /* Update the Fts5Structure. It is written back to the database by the ** fts5StructureRelease() call below. */ if( pStruct->nLevel==0 ){ fts5StructureAddLevel(&p->rc, &pStruct); } fts5StructureExtendLevel(&p->rc, pStruct, 0, 1, 0); if( p->rc==SQLITE_OK ){ pSeg = &pStruct->aLevel[0].aSeg[ pStruct->aLevel[0].nSeg++ ]; pSeg->iSegid = iSegid; pSeg->pgnoFirst = 1; pSeg->pgnoLast = pgnoLast; pStruct->nSegment++; } fts5StructurePromote(p, 0, pStruct); } fts5IndexAutomerge(p, &pStruct, pgnoLast); fts5IndexCrisismerge(p, &pStruct); fts5StructureWrite(p, pStruct); fts5StructureRelease(pStruct); } /* ** Flush any data stored in the in-memory hash tables to the database. */ static void fts5IndexFlush(Fts5Index *p){ /* Unless it is empty, flush the hash table to disk */ if( p->nPendingData ){ assert( p->pHash ); p->nPendingData = 0; fts5FlushOneHash(p); } } static Fts5Structure *fts5IndexOptimizeStruct( Fts5Index *p, Fts5Structure *pStruct ){ Fts5Structure *pNew = 0; int nByte = sizeof(Fts5Structure); int nSeg = pStruct->nSegment; int i; /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: ** ** + it consists of fewer than two segments, or ** + all segments are on the same level, or ** + all segments except one are currently inputs to a merge operation. ** ** In the first case, return NULL. In the second, increment the ref-count ** on *pStruct and return a copy of the pointer to it. */ if( nSeg<2 ) return 0; for(i=0; inLevel; i++){ int nThis = pStruct->aLevel[i].nSeg; if( nThis==nSeg || (nThis==nSeg-1 && pStruct->aLevel[i].nMerge==nThis) ){ fts5StructureRef(pStruct); return pStruct; } assert( pStruct->aLevel[i].nMerge<=nThis ); } nByte += (pStruct->nLevel+1) * sizeof(Fts5StructureLevel); pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte); if( pNew ){ Fts5StructureLevel *pLvl; nByte = nSeg * sizeof(Fts5StructureSegment); pNew->nLevel = pStruct->nLevel+1; pNew->nRef = 1; pNew->nWriteCounter = pStruct->nWriteCounter; pLvl = &pNew->aLevel[pStruct->nLevel]; pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&p->rc, nByte); if( pLvl->aSeg ){ int iLvl, iSeg; int iSegOut = 0; /* Iterate through all segments, from oldest to newest. Add them to ** the new Fts5Level object so that pLvl->aSeg[0] is the oldest ** segment in the data structure. */ for(iLvl=pStruct->nLevel-1; iLvl>=0; iLvl--){ for(iSeg=0; iSegaLevel[iLvl].nSeg; iSeg++){ pLvl->aSeg[iSegOut] = pStruct->aLevel[iLvl].aSeg[iSeg]; iSegOut++; } } pNew->nSegment = pLvl->nSeg = nSeg; }else{ sqlite3_free(pNew); pNew = 0; } } return pNew; } int sqlite3Fts5IndexOptimize(Fts5Index *p){ Fts5Structure *pStruct; Fts5Structure *pNew = 0; assert( p->rc==SQLITE_OK ); fts5IndexFlush(p); pStruct = fts5StructureRead(p); fts5StructureInvalidate(p); if( pStruct ){ pNew = fts5IndexOptimizeStruct(p, pStruct); } fts5StructureRelease(pStruct); assert( pNew==0 || pNew->nSegment>0 ); if( pNew ){ int iLvl; for(iLvl=0; pNew->aLevel[iLvl].nSeg==0; iLvl++){} while( p->rc==SQLITE_OK && pNew->aLevel[iLvl].nSeg>0 ){ int nRem = FTS5_OPT_WORK_UNIT; fts5IndexMergeLevel(p, &pNew, iLvl, &nRem); } fts5StructureWrite(p, pNew); fts5StructureRelease(pNew); } return fts5IndexReturn(p); } /* ** This is called to implement the special "VALUES('merge', $nMerge)" ** INSERT command. */ int sqlite3Fts5IndexMerge(Fts5Index *p, int nMerge){ Fts5Structure *pStruct = fts5StructureRead(p); if( pStruct ){ int nMin = p->pConfig->nUsermerge; fts5StructureInvalidate(p); if( nMerge<0 ){ Fts5Structure *pNew = fts5IndexOptimizeStruct(p, pStruct); fts5StructureRelease(pStruct); pStruct = pNew; nMin = 2; nMerge = nMerge*-1; } if( pStruct && pStruct->nLevel ){ if( fts5IndexMerge(p, &pStruct, nMerge, nMin) ){ fts5StructureWrite(p, pStruct); } } fts5StructureRelease(pStruct); } return fts5IndexReturn(p); } static void fts5AppendRowid( Fts5Index *p, i64 iDelta, Fts5Iter *pUnused, Fts5Buffer *pBuf ){ UNUSED_PARAM(pUnused); fts5BufferAppendVarint(&p->rc, pBuf, iDelta); } static void fts5AppendPoslist( Fts5Index *p, i64 iDelta, Fts5Iter *pMulti, Fts5Buffer *pBuf ){ int nData = pMulti->base.nData; assert( nData>0 ); if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nData+9+9) ){ fts5BufferSafeAppendVarint(pBuf, iDelta); fts5BufferSafeAppendVarint(pBuf, nData*2); fts5BufferSafeAppendBlob(pBuf, pMulti->base.pData, nData); } } static void fts5DoclistIterNext(Fts5DoclistIter *pIter){ u8 *p = pIter->aPoslist + pIter->nSize + pIter->nPoslist; assert( pIter->aPoslist ); if( p>=pIter->aEof ){ pIter->aPoslist = 0; }else{ i64 iDelta; p += fts5GetVarint(p, (u64*)&iDelta); pIter->iRowid += iDelta; /* Read position list size */ if( p[0] & 0x80 ){ int nPos; pIter->nSize = fts5GetVarint32(p, nPos); pIter->nPoslist = (nPos>>1); }else{ pIter->nPoslist = ((int)(p[0])) >> 1; pIter->nSize = 1; } pIter->aPoslist = p; } } static void fts5DoclistIterInit( Fts5Buffer *pBuf, Fts5DoclistIter *pIter ){ memset(pIter, 0, sizeof(*pIter)); pIter->aPoslist = pBuf->p; pIter->aEof = &pBuf->p[pBuf->n]; fts5DoclistIterNext(pIter); } #if 0 /* ** Append a doclist to buffer pBuf. ** ** This function assumes that space within the buffer has already been ** allocated. */ static void fts5MergeAppendDocid( Fts5Buffer *pBuf, /* Buffer to write to */ i64 *piLastRowid, /* IN/OUT: Previous rowid written (if any) */ i64 iRowid /* Rowid to append */ ){ assert( pBuf->n!=0 || (*piLastRowid)==0 ); fts5BufferSafeAppendVarint(pBuf, iRowid - *piLastRowid); *piLastRowid = iRowid; } #endif #define fts5MergeAppendDocid(pBuf, iLastRowid, iRowid) { \ assert( (pBuf)->n!=0 || (iLastRowid)==0 ); \ fts5BufferSafeAppendVarint((pBuf), (iRowid) - (iLastRowid)); \ (iLastRowid) = (iRowid); \ } /* ** Swap the contents of buffer *p1 with that of *p2. */ static void fts5BufferSwap(Fts5Buffer *p1, Fts5Buffer *p2){ Fts5Buffer tmp = *p1; *p1 = *p2; *p2 = tmp; } static void fts5NextRowid(Fts5Buffer *pBuf, int *piOff, i64 *piRowid){ int i = *piOff; if( i>=pBuf->n ){ *piOff = -1; }else{ u64 iVal; *piOff = i + sqlite3Fts5GetVarint(&pBuf->p[i], &iVal); *piRowid += iVal; } } /* ** This is the equivalent of fts5MergePrefixLists() for detail=none mode. ** In this case the buffers consist of a delta-encoded list of rowids only. */ static void fts5MergeRowidLists( Fts5Index *p, /* FTS5 backend object */ Fts5Buffer *p1, /* First list to merge */ Fts5Buffer *p2 /* Second list to merge */ ){ int i1 = 0; int i2 = 0; i64 iRowid1 = 0; i64 iRowid2 = 0; i64 iOut = 0; Fts5Buffer out; memset(&out, 0, sizeof(out)); sqlite3Fts5BufferSize(&p->rc, &out, p1->n + p2->n); if( p->rc ) return; fts5NextRowid(p1, &i1, &iRowid1); fts5NextRowid(p2, &i2, &iRowid2); while( i1>=0 || i2>=0 ){ if( i1>=0 && (i2<0 || iRowid1iOut ); fts5BufferSafeAppendVarint(&out, iRowid1 - iOut); iOut = iRowid1; fts5NextRowid(p1, &i1, &iRowid1); }else{ assert( iOut==0 || iRowid2>iOut ); fts5BufferSafeAppendVarint(&out, iRowid2 - iOut); iOut = iRowid2; if( i1>=0 && iRowid1==iRowid2 ){ fts5NextRowid(p1, &i1, &iRowid1); } fts5NextRowid(p2, &i2, &iRowid2); } } fts5BufferSwap(&out, p1); fts5BufferFree(&out); } /* ** Buffers p1 and p2 contain doclists. This function merges the content ** of the two doclists together and sets buffer p1 to the result before ** returning. ** ** If an error occurs, an error code is left in p->rc. If an error has ** already occurred, this function is a no-op. */ static void fts5MergePrefixLists( Fts5Index *p, /* FTS5 backend object */ Fts5Buffer *p1, /* First list to merge */ Fts5Buffer *p2 /* Second list to merge */ ){ if( p2->n ){ i64 iLastRowid = 0; Fts5DoclistIter i1; Fts5DoclistIter i2; Fts5Buffer out = {0, 0, 0}; Fts5Buffer tmp = {0, 0, 0}; if( sqlite3Fts5BufferSize(&p->rc, &out, p1->n + p2->n) ) return; fts5DoclistIterInit(p1, &i1); fts5DoclistIterInit(p2, &i2); while( 1 ){ if( i1.iRowidrc, &tmp, i1.nPoslist + i2.nPoslist); if( p->rc ) break; sqlite3Fts5PoslistNext64(a1, i1.nPoslist, &iOff1, &iPos1); sqlite3Fts5PoslistNext64(a2, i2.nPoslist, &iOff2, &iPos2); assert( iPos1>=0 && iPos2>=0 ); if( iPos1=0 && iPos2>=0 ){ while( 1 ){ if( iPos1=0 ){ if( iPos1!=iPrev ){ sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos1); } fts5BufferSafeAppendBlob(&tmp, &a1[iOff1], i1.nPoslist-iOff1); }else{ assert( iPos2>=0 && iPos2!=iPrev ); sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos2); fts5BufferSafeAppendBlob(&tmp, &a2[iOff2], i2.nPoslist-iOff2); } /* WRITEPOSLISTSIZE */ fts5BufferSafeAppendVarint(&out, tmp.n * 2); fts5BufferSafeAppendBlob(&out, tmp.p, tmp.n); fts5DoclistIterNext(&i1); fts5DoclistIterNext(&i2); if( i1.aPoslist==0 || i2.aPoslist==0 ) break; } } if( i1.aPoslist ){ fts5MergeAppendDocid(&out, iLastRowid, i1.iRowid); fts5BufferSafeAppendBlob(&out, i1.aPoslist, i1.aEof - i1.aPoslist); } else if( i2.aPoslist ){ fts5MergeAppendDocid(&out, iLastRowid, i2.iRowid); fts5BufferSafeAppendBlob(&out, i2.aPoslist, i2.aEof - i2.aPoslist); } fts5BufferSet(&p->rc, p1, out.n, out.p); fts5BufferFree(&tmp); fts5BufferFree(&out); } } static void fts5SetupPrefixIter( Fts5Index *p, /* Index to read from */ int bDesc, /* True for "ORDER BY rowid DESC" */ const u8 *pToken, /* Buffer containing prefix to match */ int nToken, /* Size of buffer pToken in bytes */ Fts5Colset *pColset, /* Restrict matches to these columns */ Fts5Iter **ppIter /* OUT: New iterator */ ){ Fts5Structure *pStruct; Fts5Buffer *aBuf; const int nBuf = 32; void (*xMerge)(Fts5Index*, Fts5Buffer*, Fts5Buffer*); void (*xAppend)(Fts5Index*, i64, Fts5Iter*, Fts5Buffer*); if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){ xMerge = fts5MergeRowidLists; xAppend = fts5AppendRowid; }else{ xMerge = fts5MergePrefixLists; xAppend = fts5AppendPoslist; } aBuf = (Fts5Buffer*)fts5IdxMalloc(p, sizeof(Fts5Buffer)*nBuf); pStruct = fts5StructureRead(p); if( aBuf && pStruct ){ const int flags = FTS5INDEX_QUERY_SCAN | FTS5INDEX_QUERY_SKIPEMPTY | FTS5INDEX_QUERY_NOOUTPUT; int i; i64 iLastRowid = 0; Fts5Iter *p1 = 0; /* Iterator used to gather data from index */ Fts5Data *pData; Fts5Buffer doclist; int bNewTerm = 1; memset(&doclist, 0, sizeof(doclist)); fts5MultiIterNew(p, pStruct, flags, pColset, pToken, nToken, -1, 0, &p1); fts5IterSetOutputCb(&p->rc, p1); for( /* no-op */ ; fts5MultiIterEof(p, p1)==0; fts5MultiIterNext2(p, p1, &bNewTerm) ){ Fts5SegIter *pSeg = &p1->aSeg[ p1->aFirst[1].iFirst ]; int nTerm = pSeg->term.n; const u8 *pTerm = pSeg->term.p; p1->xSetOutputs(p1, pSeg); assert_nc( memcmp(pToken, pTerm, MIN(nToken, nTerm))<=0 ); if( bNewTerm ){ if( nTermbase.nData==0 ) continue; if( p1->base.iRowid<=iLastRowid && doclist.n>0 ){ for(i=0; p->rc==SQLITE_OK && doclist.n; i++){ assert( ibase.iRowid-iLastRowid, p1, &doclist); iLastRowid = p1->base.iRowid; } for(i=0; irc==SQLITE_OK ){ xMerge(p, &doclist, &aBuf[i]); } fts5BufferFree(&aBuf[i]); } fts5MultiIterFree(p1); pData = fts5IdxMalloc(p, sizeof(Fts5Data) + doclist.n); if( pData ){ pData->p = (u8*)&pData[1]; pData->nn = pData->szLeaf = doclist.n; if( doclist.n ) memcpy(pData->p, doclist.p, doclist.n); fts5MultiIterNew2(p, pData, bDesc, ppIter); } fts5BufferFree(&doclist); } fts5StructureRelease(pStruct); sqlite3_free(aBuf); } /* ** Indicate that all subsequent calls to sqlite3Fts5IndexWrite() pertain ** to the document with rowid iRowid. */ int sqlite3Fts5IndexBeginWrite(Fts5Index *p, int bDelete, i64 iRowid){ assert( p->rc==SQLITE_OK ); /* Allocate the hash table if it has not already been allocated */ if( p->pHash==0 ){ p->rc = sqlite3Fts5HashNew(p->pConfig, &p->pHash, &p->nPendingData); } /* Flush the hash table to disk if required */ if( iRowidiWriteRowid || (iRowid==p->iWriteRowid && p->bDelete==0) || (p->nPendingData > p->pConfig->nHashSize) ){ fts5IndexFlush(p); } p->iWriteRowid = iRowid; p->bDelete = bDelete; return fts5IndexReturn(p); } /* ** Commit data to disk. */ int sqlite3Fts5IndexSync(Fts5Index *p){ assert( p->rc==SQLITE_OK ); fts5IndexFlush(p); fts5CloseReader(p); return fts5IndexReturn(p); } /* ** Discard any data stored in the in-memory hash tables. Do not write it ** to the database. Additionally, assume that the contents of the %_data ** table may have changed on disk. So any in-memory caches of %_data ** records must be invalidated. */ int sqlite3Fts5IndexRollback(Fts5Index *p){ fts5CloseReader(p); fts5IndexDiscardData(p); fts5StructureInvalidate(p); /* assert( p->rc==SQLITE_OK ); */ return SQLITE_OK; } /* ** The %_data table is completely empty when this function is called. This ** function populates it with the initial structure objects for each index, ** and the initial version of the "averages" record (a zero-byte blob). */ int sqlite3Fts5IndexReinit(Fts5Index *p){ Fts5Structure s; fts5StructureInvalidate(p); memset(&s, 0, sizeof(Fts5Structure)); fts5DataWrite(p, FTS5_AVERAGES_ROWID, (const u8*)"", 0); fts5StructureWrite(p, &s); return fts5IndexReturn(p); } /* ** Open a new Fts5Index handle. If the bCreate argument is true, create ** and initialize the underlying %_data table. ** ** If successful, set *pp to point to the new object and return SQLITE_OK. ** Otherwise, set *pp to NULL and return an SQLite error code. */ int sqlite3Fts5IndexOpen( Fts5Config *pConfig, int bCreate, Fts5Index **pp, char **pzErr ){ int rc = SQLITE_OK; Fts5Index *p; /* New object */ *pp = p = (Fts5Index*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5Index)); if( rc==SQLITE_OK ){ p->pConfig = pConfig; p->nWorkUnit = FTS5_WORK_UNIT; p->zDataTbl = sqlite3Fts5Mprintf(&rc, "%s_data", pConfig->zName); if( p->zDataTbl && bCreate ){ rc = sqlite3Fts5CreateTable( pConfig, "data", "id INTEGER PRIMARY KEY, block BLOB", 0, pzErr ); if( rc==SQLITE_OK ){ rc = sqlite3Fts5CreateTable(pConfig, "idx", "segid, term, pgno, PRIMARY KEY(segid, term)", 1, pzErr ); } if( rc==SQLITE_OK ){ rc = sqlite3Fts5IndexReinit(p); } } } assert( rc!=SQLITE_OK || p->rc==SQLITE_OK ); if( rc ){ sqlite3Fts5IndexClose(p); *pp = 0; } return rc; } /* ** Close a handle opened by an earlier call to sqlite3Fts5IndexOpen(). */ int sqlite3Fts5IndexClose(Fts5Index *p){ int rc = SQLITE_OK; if( p ){ assert( p->pReader==0 ); fts5StructureInvalidate(p); sqlite3_finalize(p->pWriter); sqlite3_finalize(p->pDeleter); sqlite3_finalize(p->pIdxWriter); sqlite3_finalize(p->pIdxDeleter); sqlite3_finalize(p->pIdxSelect); sqlite3_finalize(p->pDataVersion); sqlite3Fts5HashFree(p->pHash); sqlite3_free(p->zDataTbl); sqlite3_free(p); } return rc; } /* ** Argument p points to a buffer containing utf-8 text that is n bytes in ** size. Return the number of bytes in the nChar character prefix of the ** buffer, or 0 if there are less than nChar characters in total. */ int sqlite3Fts5IndexCharlenToBytelen( const char *p, int nByte, int nChar ){ int n = 0; int i; for(i=0; i=nByte ) return 0; /* Input contains fewer than nChar chars */ if( (unsigned char)p[n++]>=0xc0 ){ while( (p[n] & 0xc0)==0x80 ) n++; } } return n; } /* ** pIn is a UTF-8 encoded string, nIn bytes in size. Return the number of ** unicode characters in the string. */ static int fts5IndexCharlen(const char *pIn, int nIn){ int nChar = 0; int i = 0; while( i=0xc0 ){ while( i delete) */ int iPos, /* Position of token within column */ const char *pToken, int nToken /* Token to add or remove to or from index */ ){ int i; /* Used to iterate through indexes */ int rc = SQLITE_OK; /* Return code */ Fts5Config *pConfig = p->pConfig; assert( p->rc==SQLITE_OK ); assert( (iCol<0)==p->bDelete ); /* Add the entry to the main terms index. */ rc = sqlite3Fts5HashWrite( p->pHash, p->iWriteRowid, iCol, iPos, FTS5_MAIN_PREFIX, pToken, nToken ); for(i=0; inPrefix && rc==SQLITE_OK; i++){ const int nChar = pConfig->aPrefix[i]; int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar); if( nByte ){ rc = sqlite3Fts5HashWrite(p->pHash, p->iWriteRowid, iCol, iPos, (char)(FTS5_MAIN_PREFIX+i+1), pToken, nByte ); } } return rc; } /* ** Open a new iterator to iterate though all rowid that match the ** specified token or token prefix. */ int sqlite3Fts5IndexQuery( Fts5Index *p, /* FTS index to query */ const char *pToken, int nToken, /* Token (or prefix) to query for */ int flags, /* Mask of FTS5INDEX_QUERY_X flags */ Fts5Colset *pColset, /* Match these columns only */ Fts5IndexIter **ppIter /* OUT: New iterator object */ ){ Fts5Config *pConfig = p->pConfig; Fts5Iter *pRet = 0; Fts5Buffer buf = {0, 0, 0}; /* If the QUERY_SCAN flag is set, all other flags must be clear. */ assert( (flags & FTS5INDEX_QUERY_SCAN)==0 || flags==FTS5INDEX_QUERY_SCAN ); if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){ int iIdx = 0; /* Index to search */ if( nToken ) memcpy(&buf.p[1], pToken, nToken); /* Figure out which index to search and set iIdx accordingly. If this ** is a prefix query for which there is no prefix index, set iIdx to ** greater than pConfig->nPrefix to indicate that the query will be ** satisfied by scanning multiple terms in the main index. ** ** If the QUERY_TEST_NOIDX flag was specified, then this must be a ** prefix-query. Instead of using a prefix-index (if one exists), ** evaluate the prefix query using the main FTS index. This is used ** for internal sanity checking by the integrity-check in debug ** mode only. */ #ifdef SQLITE_DEBUG if( pConfig->bPrefixIndex==0 || (flags & FTS5INDEX_QUERY_TEST_NOIDX) ){ assert( flags & FTS5INDEX_QUERY_PREFIX ); iIdx = 1+pConfig->nPrefix; }else #endif if( flags & FTS5INDEX_QUERY_PREFIX ){ int nChar = fts5IndexCharlen(pToken, nToken); for(iIdx=1; iIdx<=pConfig->nPrefix; iIdx++){ if( pConfig->aPrefix[iIdx-1]==nChar ) break; } } if( iIdx<=pConfig->nPrefix ){ /* Straight index lookup */ Fts5Structure *pStruct = fts5StructureRead(p); buf.p[0] = (u8)(FTS5_MAIN_PREFIX + iIdx); if( pStruct ){ fts5MultiIterNew(p, pStruct, flags | FTS5INDEX_QUERY_SKIPEMPTY, pColset, buf.p, nToken+1, -1, 0, &pRet ); fts5StructureRelease(pStruct); } }else{ /* Scan multiple terms in the main index */ int bDesc = (flags & FTS5INDEX_QUERY_DESC)!=0; buf.p[0] = FTS5_MAIN_PREFIX; fts5SetupPrefixIter(p, bDesc, buf.p, nToken+1, pColset, &pRet); assert( p->rc!=SQLITE_OK || pRet->pColset==0 ); fts5IterSetOutputCb(&p->rc, pRet); if( p->rc==SQLITE_OK ){ Fts5SegIter *pSeg = &pRet->aSeg[pRet->aFirst[1].iFirst]; if( pSeg->pLeaf ) pRet->xSetOutputs(pRet, pSeg); } } if( p->rc ){ sqlite3Fts5IterClose((Fts5IndexIter*)pRet); pRet = 0; fts5CloseReader(p); } *ppIter = &pRet->base; sqlite3Fts5BufferFree(&buf); } return fts5IndexReturn(p); } /* ** Return true if the iterator passed as the only argument is at EOF. */ /* ** Move to the next matching rowid. */ int sqlite3Fts5IterNext(Fts5IndexIter *pIndexIter){ Fts5Iter *pIter = (Fts5Iter*)pIndexIter; assert( pIter->pIndex->rc==SQLITE_OK ); fts5MultiIterNext(pIter->pIndex, pIter, 0, 0); return fts5IndexReturn(pIter->pIndex); } /* ** Move to the next matching term/rowid. Used by the fts5vocab module. */ int sqlite3Fts5IterNextScan(Fts5IndexIter *pIndexIter){ Fts5Iter *pIter = (Fts5Iter*)pIndexIter; Fts5Index *p = pIter->pIndex; assert( pIter->pIndex->rc==SQLITE_OK ); fts5MultiIterNext(p, pIter, 0, 0); if( p->rc==SQLITE_OK ){ Fts5SegIter *pSeg = &pIter->aSeg[ pIter->aFirst[1].iFirst ]; if( pSeg->pLeaf && pSeg->term.p[0]!=FTS5_MAIN_PREFIX ){ fts5DataRelease(pSeg->pLeaf); pSeg->pLeaf = 0; pIter->base.bEof = 1; } } return fts5IndexReturn(pIter->pIndex); } /* ** Move to the next matching rowid that occurs at or after iMatch. The ** definition of "at or after" depends on whether this iterator iterates ** in ascending or descending rowid order. */ int sqlite3Fts5IterNextFrom(Fts5IndexIter *pIndexIter, i64 iMatch){ Fts5Iter *pIter = (Fts5Iter*)pIndexIter; fts5MultiIterNextFrom(pIter->pIndex, pIter, iMatch); return fts5IndexReturn(pIter->pIndex); } /* ** Return the current term. */ const char *sqlite3Fts5IterTerm(Fts5IndexIter *pIndexIter, int *pn){ int n; const char *z = (const char*)fts5MultiIterTerm((Fts5Iter*)pIndexIter, &n); *pn = n-1; return &z[1]; } /* ** Close an iterator opened by an earlier call to sqlite3Fts5IndexQuery(). */ void sqlite3Fts5IterClose(Fts5IndexIter *pIndexIter){ if( pIndexIter ){ Fts5Iter *pIter = (Fts5Iter*)pIndexIter; Fts5Index *pIndex = pIter->pIndex; fts5MultiIterFree(pIter); fts5CloseReader(pIndex); } } /* ** Read and decode the "averages" record from the database. ** ** Parameter anSize must point to an array of size nCol, where nCol is ** the number of user defined columns in the FTS table. */ int sqlite3Fts5IndexGetAverages(Fts5Index *p, i64 *pnRow, i64 *anSize){ int nCol = p->pConfig->nCol; Fts5Data *pData; *pnRow = 0; memset(anSize, 0, sizeof(i64) * nCol); pData = fts5DataRead(p, FTS5_AVERAGES_ROWID); if( p->rc==SQLITE_OK && pData->nn ){ int i = 0; int iCol; i += fts5GetVarint(&pData->p[i], (u64*)pnRow); for(iCol=0; inn && iColp[i], (u64*)&anSize[iCol]); } } fts5DataRelease(pData); return fts5IndexReturn(p); } /* ** Replace the current "averages" record with the contents of the buffer ** supplied as the second argument. */ int sqlite3Fts5IndexSetAverages(Fts5Index *p, const u8 *pData, int nData){ assert( p->rc==SQLITE_OK ); fts5DataWrite(p, FTS5_AVERAGES_ROWID, pData, nData); return fts5IndexReturn(p); } /* ** Return the total number of blocks this module has read from the %_data ** table since it was created. */ int sqlite3Fts5IndexReads(Fts5Index *p){ return p->nRead; } /* ** Set the 32-bit cookie value stored at the start of all structure ** records to the value passed as the second argument. ** ** Return SQLITE_OK if successful, or an SQLite error code if an error ** occurs. */ int sqlite3Fts5IndexSetCookie(Fts5Index *p, int iNew){ int rc; /* Return code */ Fts5Config *pConfig = p->pConfig; /* Configuration object */ u8 aCookie[4]; /* Binary representation of iNew */ sqlite3_blob *pBlob = 0; assert( p->rc==SQLITE_OK ); sqlite3Fts5Put32(aCookie, iNew); rc = sqlite3_blob_open(pConfig->db, pConfig->zDb, p->zDataTbl, "block", FTS5_STRUCTURE_ROWID, 1, &pBlob ); if( rc==SQLITE_OK ){ sqlite3_blob_write(pBlob, aCookie, 4, 0); rc = sqlite3_blob_close(pBlob); } return rc; } int sqlite3Fts5IndexLoadConfig(Fts5Index *p){ Fts5Structure *pStruct; pStruct = fts5StructureRead(p); fts5StructureRelease(pStruct); return fts5IndexReturn(p); } /************************************************************************* ************************************************************************** ** Below this point is the implementation of the integrity-check ** functionality. */ /* ** Return a simple checksum value based on the arguments. */ u64 sqlite3Fts5IndexEntryCksum( i64 iRowid, int iCol, int iPos, int iIdx, const char *pTerm, int nTerm ){ int i; u64 ret = iRowid; ret += (ret<<3) + iCol; ret += (ret<<3) + iPos; if( iIdx>=0 ) ret += (ret<<3) + (FTS5_MAIN_PREFIX + iIdx); for(i=0; iiLeaf ); cksum1 += iRowid + ((i64)pgno<<32); } fts5DlidxIterFree(pDlidx); pDlidx = 0; for(pDlidx=fts5DlidxIterInit(p, 1, iSegid, iLeaf); fts5DlidxIterEof(p, pDlidx)==0; fts5DlidxIterPrev(p, pDlidx) ){ i64 iRowid = fts5DlidxIterRowid(pDlidx); int pgno = fts5DlidxIterPgno(pDlidx); assert( fts5DlidxIterPgno(pDlidx)>iLeaf ); cksum2 += iRowid + ((i64)pgno<<32); } fts5DlidxIterFree(pDlidx); pDlidx = 0; if( p->rc==SQLITE_OK && cksum1!=cksum2 ) p->rc = FTS5_CORRUPT; } static int fts5QueryCksum( Fts5Index *p, /* Fts5 index object */ int iIdx, const char *z, /* Index key to query for */ int n, /* Size of index key in bytes */ int flags, /* Flags for Fts5IndexQuery */ u64 *pCksum /* IN/OUT: Checksum value */ ){ int eDetail = p->pConfig->eDetail; u64 cksum = *pCksum; Fts5IndexIter *pIter = 0; int rc = sqlite3Fts5IndexQuery(p, z, n, flags, 0, &pIter); while( rc==SQLITE_OK && 0==sqlite3Fts5IterEof(pIter) ){ i64 rowid = pIter->iRowid; if( eDetail==FTS5_DETAIL_NONE ){ cksum ^= sqlite3Fts5IndexEntryCksum(rowid, 0, 0, iIdx, z, n); }else{ Fts5PoslistReader sReader; for(sqlite3Fts5PoslistReaderInit(pIter->pData, pIter->nData, &sReader); sReader.bEof==0; sqlite3Fts5PoslistReaderNext(&sReader) ){ int iCol = FTS5_POS2COLUMN(sReader.iPos); int iOff = FTS5_POS2OFFSET(sReader.iPos); cksum ^= sqlite3Fts5IndexEntryCksum(rowid, iCol, iOff, iIdx, z, n); } } if( rc==SQLITE_OK ){ rc = sqlite3Fts5IterNext(pIter); } } sqlite3Fts5IterClose(pIter); *pCksum = cksum; return rc; } /* ** This function is also purely an internal test. It does not contribute to ** FTS functionality, or even the integrity-check, in any way. */ static void fts5TestTerm( Fts5Index *p, Fts5Buffer *pPrev, /* Previous term */ const char *z, int n, /* Possibly new term to test */ u64 expected, u64 *pCksum ){ int rc = p->rc; if( pPrev->n==0 ){ fts5BufferSet(&rc, pPrev, n, (const u8*)z); }else if( rc==SQLITE_OK && (pPrev->n!=n || memcmp(pPrev->p, z, n)) ){ u64 cksum3 = *pCksum; const char *zTerm = (const char*)&pPrev->p[1]; /* term sans prefix-byte */ int nTerm = pPrev->n-1; /* Size of zTerm in bytes */ int iIdx = (pPrev->p[0] - FTS5_MAIN_PREFIX); int flags = (iIdx==0 ? 0 : FTS5INDEX_QUERY_PREFIX); u64 ck1 = 0; u64 ck2 = 0; /* Check that the results returned for ASC and DESC queries are ** the same. If not, call this corruption. */ rc = fts5QueryCksum(p, iIdx, zTerm, nTerm, flags, &ck1); if( rc==SQLITE_OK ){ int f = flags|FTS5INDEX_QUERY_DESC; rc = fts5QueryCksum(p, iIdx, zTerm, nTerm, f, &ck2); } if( rc==SQLITE_OK && ck1!=ck2 ) rc = FTS5_CORRUPT; /* If this is a prefix query, check that the results returned if the ** the index is disabled are the same. In both ASC and DESC order. ** ** This check may only be performed if the hash table is empty. This ** is because the hash table only supports a single scan query at ** a time, and the multi-iter loop from which this function is called ** is already performing such a scan. */ if( p->nPendingData==0 ){ if( iIdx>0 && rc==SQLITE_OK ){ int f = flags|FTS5INDEX_QUERY_TEST_NOIDX; ck2 = 0; rc = fts5QueryCksum(p, iIdx, zTerm, nTerm, f, &ck2); if( rc==SQLITE_OK && ck1!=ck2 ) rc = FTS5_CORRUPT; } if( iIdx>0 && rc==SQLITE_OK ){ int f = flags|FTS5INDEX_QUERY_TEST_NOIDX|FTS5INDEX_QUERY_DESC; ck2 = 0; rc = fts5QueryCksum(p, iIdx, zTerm, nTerm, f, &ck2); if( rc==SQLITE_OK && ck1!=ck2 ) rc = FTS5_CORRUPT; } } cksum3 ^= ck1; fts5BufferSet(&rc, pPrev, n, (const u8*)z); if( rc==SQLITE_OK && cksum3!=expected ){ rc = FTS5_CORRUPT; } *pCksum = cksum3; } p->rc = rc; } #else # define fts5TestDlidxReverse(x,y,z) # define fts5TestTerm(u,v,w,x,y,z) #endif /* ** Check that: ** ** 1) All leaves of pSeg between iFirst and iLast (inclusive) exist and ** contain zero terms. ** 2) All leaves of pSeg between iNoRowid and iLast (inclusive) exist and ** contain zero rowids. */ static void fts5IndexIntegrityCheckEmpty( Fts5Index *p, Fts5StructureSegment *pSeg, /* Segment to check internal consistency */ int iFirst, int iNoRowid, int iLast ){ int i; /* Now check that the iter.nEmpty leaves following the current leaf ** (a) exist and (b) contain no terms. */ for(i=iFirst; p->rc==SQLITE_OK && i<=iLast; i++){ Fts5Data *pLeaf = fts5DataRead(p, FTS5_SEGMENT_ROWID(pSeg->iSegid, i)); if( pLeaf ){ if( !fts5LeafIsTermless(pLeaf) ) p->rc = FTS5_CORRUPT; if( i>=iNoRowid && 0!=fts5LeafFirstRowidOff(pLeaf) ) p->rc = FTS5_CORRUPT; } fts5DataRelease(pLeaf); } } static void fts5IntegrityCheckPgidx(Fts5Index *p, Fts5Data *pLeaf){ int iTermOff = 0; int ii; Fts5Buffer buf1 = {0,0,0}; Fts5Buffer buf2 = {0,0,0}; ii = pLeaf->szLeaf; while( iinn && p->rc==SQLITE_OK ){ int res; int iOff; int nIncr; ii += fts5GetVarint32(&pLeaf->p[ii], nIncr); iTermOff += nIncr; iOff = iTermOff; if( iOff>=pLeaf->szLeaf ){ p->rc = FTS5_CORRUPT; }else if( iTermOff==nIncr ){ int nByte; iOff += fts5GetVarint32(&pLeaf->p[iOff], nByte); if( (iOff+nByte)>pLeaf->szLeaf ){ p->rc = FTS5_CORRUPT; }else{ fts5BufferSet(&p->rc, &buf1, nByte, &pLeaf->p[iOff]); } }else{ int nKeep, nByte; iOff += fts5GetVarint32(&pLeaf->p[iOff], nKeep); iOff += fts5GetVarint32(&pLeaf->p[iOff], nByte); if( nKeep>buf1.n || (iOff+nByte)>pLeaf->szLeaf ){ p->rc = FTS5_CORRUPT; }else{ buf1.n = nKeep; fts5BufferAppendBlob(&p->rc, &buf1, nByte, &pLeaf->p[iOff]); } if( p->rc==SQLITE_OK ){ res = fts5BufferCompare(&buf1, &buf2); if( res<=0 ) p->rc = FTS5_CORRUPT; } } fts5BufferSet(&p->rc, &buf2, buf1.n, buf1.p); } fts5BufferFree(&buf1); fts5BufferFree(&buf2); } static void fts5IndexIntegrityCheckSegment( Fts5Index *p, /* FTS5 backend object */ Fts5StructureSegment *pSeg /* Segment to check internal consistency */ ){ Fts5Config *pConfig = p->pConfig; sqlite3_stmt *pStmt = 0; int rc2; int iIdxPrevLeaf = pSeg->pgnoFirst-1; int iDlidxPrevLeaf = pSeg->pgnoLast; if( pSeg->pgnoFirst==0 ) return; fts5IndexPrepareStmt(p, &pStmt, sqlite3_mprintf( "SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d", pConfig->zDb, pConfig->zName, pSeg->iSegid )); /* Iterate through the b-tree hierarchy. */ while( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ i64 iRow; /* Rowid for this leaf */ Fts5Data *pLeaf; /* Data for this leaf */ int nIdxTerm = sqlite3_column_bytes(pStmt, 1); const char *zIdxTerm = (const char*)sqlite3_column_text(pStmt, 1); int iIdxLeaf = sqlite3_column_int(pStmt, 2); int bIdxDlidx = sqlite3_column_int(pStmt, 3); /* If the leaf in question has already been trimmed from the segment, ** ignore this b-tree entry. Otherwise, load it into memory. */ if( iIdxLeafpgnoFirst ) continue; iRow = FTS5_SEGMENT_ROWID(pSeg->iSegid, iIdxLeaf); pLeaf = fts5LeafRead(p, iRow); if( pLeaf==0 ) break; /* Check that the leaf contains at least one term, and that it is equal ** to or larger than the split-key in zIdxTerm. Also check that if there ** is also a rowid pointer within the leaf page header, it points to a ** location before the term. */ if( pLeaf->nn<=pLeaf->szLeaf ){ p->rc = FTS5_CORRUPT; }else{ int iOff; /* Offset of first term on leaf */ int iRowidOff; /* Offset of first rowid on leaf */ int nTerm; /* Size of term on leaf in bytes */ int res; /* Comparison of term and split-key */ iOff = fts5LeafFirstTermOff(pLeaf); iRowidOff = fts5LeafFirstRowidOff(pLeaf); if( iRowidOff>=iOff ){ p->rc = FTS5_CORRUPT; }else{ iOff += fts5GetVarint32(&pLeaf->p[iOff], nTerm); res = memcmp(&pLeaf->p[iOff], zIdxTerm, MIN(nTerm, nIdxTerm)); if( res==0 ) res = nTerm - nIdxTerm; if( res<0 ) p->rc = FTS5_CORRUPT; } fts5IntegrityCheckPgidx(p, pLeaf); } fts5DataRelease(pLeaf); if( p->rc ) break; /* Now check that the iter.nEmpty leaves following the current leaf ** (a) exist and (b) contain no terms. */ fts5IndexIntegrityCheckEmpty( p, pSeg, iIdxPrevLeaf+1, iDlidxPrevLeaf+1, iIdxLeaf-1 ); if( p->rc ) break; /* If there is a doclist-index, check that it looks right. */ if( bIdxDlidx ){ Fts5DlidxIter *pDlidx = 0; /* For iterating through doclist index */ int iPrevLeaf = iIdxLeaf; int iSegid = pSeg->iSegid; int iPg = 0; i64 iKey; for(pDlidx=fts5DlidxIterInit(p, 0, iSegid, iIdxLeaf); fts5DlidxIterEof(p, pDlidx)==0; fts5DlidxIterNext(p, pDlidx) ){ /* Check any rowid-less pages that occur before the current leaf. */ for(iPg=iPrevLeaf+1; iPgrc = FTS5_CORRUPT; fts5DataRelease(pLeaf); } } iPrevLeaf = fts5DlidxIterPgno(pDlidx); /* Check that the leaf page indicated by the iterator really does ** contain the rowid suggested by the same. */ iKey = FTS5_SEGMENT_ROWID(iSegid, iPrevLeaf); pLeaf = fts5DataRead(p, iKey); if( pLeaf ){ i64 iRowid; int iRowidOff = fts5LeafFirstRowidOff(pLeaf); ASSERT_SZLEAF_OK(pLeaf); if( iRowidOff>=pLeaf->szLeaf ){ p->rc = FTS5_CORRUPT; }else{ fts5GetVarint(&pLeaf->p[iRowidOff], (u64*)&iRowid); if( iRowid!=fts5DlidxIterRowid(pDlidx) ) p->rc = FTS5_CORRUPT; } fts5DataRelease(pLeaf); } } iDlidxPrevLeaf = iPg; fts5DlidxIterFree(pDlidx); fts5TestDlidxReverse(p, iSegid, iIdxLeaf); }else{ iDlidxPrevLeaf = pSeg->pgnoLast; /* TODO: Check there is no doclist index */ } iIdxPrevLeaf = iIdxLeaf; } rc2 = sqlite3_finalize(pStmt); if( p->rc==SQLITE_OK ) p->rc = rc2; /* Page iter.iLeaf must now be the rightmost leaf-page in the segment */ #if 0 if( p->rc==SQLITE_OK && iter.iLeaf!=pSeg->pgnoLast ){ p->rc = FTS5_CORRUPT; } #endif } /* ** Run internal checks to ensure that the FTS index (a) is internally ** consistent and (b) contains entries for which the XOR of the checksums ** as calculated by sqlite3Fts5IndexEntryCksum() is cksum. ** ** Return SQLITE_CORRUPT if any of the internal checks fail, or if the ** checksum does not match. Return SQLITE_OK if all checks pass without ** error, or some other SQLite error code if another error (e.g. OOM) ** occurs. */ int sqlite3Fts5IndexIntegrityCheck(Fts5Index *p, u64 cksum){ int eDetail = p->pConfig->eDetail; u64 cksum2 = 0; /* Checksum based on contents of indexes */ Fts5Buffer poslist = {0,0,0}; /* Buffer used to hold a poslist */ Fts5Iter *pIter; /* Used to iterate through entire index */ Fts5Structure *pStruct; /* Index structure */ #ifdef SQLITE_DEBUG /* Used by extra internal tests only run if NDEBUG is not defined */ u64 cksum3 = 0; /* Checksum based on contents of indexes */ Fts5Buffer term = {0,0,0}; /* Buffer used to hold most recent term */ #endif const int flags = FTS5INDEX_QUERY_NOOUTPUT; /* Load the FTS index structure */ pStruct = fts5StructureRead(p); /* Check that the internal nodes of each segment match the leaves */ if( pStruct ){ int iLvl, iSeg; for(iLvl=0; iLvlnLevel; iLvl++){ for(iSeg=0; iSegaLevel[iLvl].nSeg; iSeg++){ Fts5StructureSegment *pSeg = &pStruct->aLevel[iLvl].aSeg[iSeg]; fts5IndexIntegrityCheckSegment(p, pSeg); } } } /* The cksum argument passed to this function is a checksum calculated ** based on all expected entries in the FTS index (including prefix index ** entries). This block checks that a checksum calculated based on the ** actual contents of FTS index is identical. ** ** Two versions of the same checksum are calculated. The first (stack ** variable cksum2) based on entries extracted from the full-text index ** while doing a linear scan of each individual index in turn. ** ** As each term visited by the linear scans, a separate query for the ** same term is performed. cksum3 is calculated based on the entries ** extracted by these queries. */ for(fts5MultiIterNew(p, pStruct, flags, 0, 0, 0, -1, 0, &pIter); fts5MultiIterEof(p, pIter)==0; fts5MultiIterNext(p, pIter, 0, 0) ){ int n; /* Size of term in bytes */ i64 iPos = 0; /* Position read from poslist */ int iOff = 0; /* Offset within poslist */ i64 iRowid = fts5MultiIterRowid(pIter); char *z = (char*)fts5MultiIterTerm(pIter, &n); /* If this is a new term, query for it. Update cksum3 with the results. */ fts5TestTerm(p, &term, z, n, cksum2, &cksum3); if( eDetail==FTS5_DETAIL_NONE ){ if( 0==fts5MultiIterIsEmpty(p, pIter) ){ cksum2 ^= sqlite3Fts5IndexEntryCksum(iRowid, 0, 0, -1, z, n); } }else{ poslist.n = 0; fts5SegiterPoslist(p, &pIter->aSeg[pIter->aFirst[1].iFirst], 0, &poslist); while( 0==sqlite3Fts5PoslistNext64(poslist.p, poslist.n, &iOff, &iPos) ){ int iCol = FTS5_POS2COLUMN(iPos); int iTokOff = FTS5_POS2OFFSET(iPos); cksum2 ^= sqlite3Fts5IndexEntryCksum(iRowid, iCol, iTokOff, -1, z, n); } } } fts5TestTerm(p, &term, 0, 0, cksum2, &cksum3); fts5MultiIterFree(pIter); if( p->rc==SQLITE_OK && cksum!=cksum2 ) p->rc = FTS5_CORRUPT; fts5StructureRelease(pStruct); #ifdef SQLITE_DEBUG fts5BufferFree(&term); #endif fts5BufferFree(&poslist); return fts5IndexReturn(p); } /************************************************************************* ************************************************************************** ** Below this point is the implementation of the fts5_decode() scalar ** function only. */ /* ** Decode a segment-data rowid from the %_data table. This function is ** the opposite of macro FTS5_SEGMENT_ROWID(). */ static void fts5DecodeRowid( i64 iRowid, /* Rowid from %_data table */ int *piSegid, /* OUT: Segment id */ int *pbDlidx, /* OUT: Dlidx flag */ int *piHeight, /* OUT: Height */ int *piPgno /* OUT: Page number */ ){ *piPgno = (int)(iRowid & (((i64)1 << FTS5_DATA_PAGE_B) - 1)); iRowid >>= FTS5_DATA_PAGE_B; *piHeight = (int)(iRowid & (((i64)1 << FTS5_DATA_HEIGHT_B) - 1)); iRowid >>= FTS5_DATA_HEIGHT_B; *pbDlidx = (int)(iRowid & 0x0001); iRowid >>= FTS5_DATA_DLI_B; *piSegid = (int)(iRowid & (((i64)1 << FTS5_DATA_ID_B) - 1)); } static void fts5DebugRowid(int *pRc, Fts5Buffer *pBuf, i64 iKey){ int iSegid, iHeight, iPgno, bDlidx; /* Rowid compenents */ fts5DecodeRowid(iKey, &iSegid, &bDlidx, &iHeight, &iPgno); if( iSegid==0 ){ if( iKey==FTS5_AVERAGES_ROWID ){ sqlite3Fts5BufferAppendPrintf(pRc, pBuf, "{averages} "); }else{ sqlite3Fts5BufferAppendPrintf(pRc, pBuf, "{structure}"); } } else{ sqlite3Fts5BufferAppendPrintf(pRc, pBuf, "{%ssegid=%d h=%d pgno=%d}", bDlidx ? "dlidx " : "", iSegid, iHeight, iPgno ); } } static void fts5DebugStructure( int *pRc, /* IN/OUT: error code */ Fts5Buffer *pBuf, Fts5Structure *p ){ int iLvl, iSeg; /* Iterate through levels, segments */ for(iLvl=0; iLvlnLevel; iLvl++){ Fts5StructureLevel *pLvl = &p->aLevel[iLvl]; sqlite3Fts5BufferAppendPrintf(pRc, pBuf, " {lvl=%d nMerge=%d nSeg=%d", iLvl, pLvl->nMerge, pLvl->nSeg ); for(iSeg=0; iSegnSeg; iSeg++){ Fts5StructureSegment *pSeg = &pLvl->aSeg[iSeg]; sqlite3Fts5BufferAppendPrintf(pRc, pBuf, " {id=%d leaves=%d..%d}", pSeg->iSegid, pSeg->pgnoFirst, pSeg->pgnoLast ); } sqlite3Fts5BufferAppendPrintf(pRc, pBuf, "}"); } } /* ** This is part of the fts5_decode() debugging aid. ** ** Arguments pBlob/nBlob contain a serialized Fts5Structure object. This ** function appends a human-readable representation of the same object ** to the buffer passed as the second argument. */ static void fts5DecodeStructure( int *pRc, /* IN/OUT: error code */ Fts5Buffer *pBuf, const u8 *pBlob, int nBlob ){ int rc; /* Return code */ Fts5Structure *p = 0; /* Decoded structure object */ rc = fts5StructureDecode(pBlob, nBlob, 0, &p); if( rc!=SQLITE_OK ){ *pRc = rc; return; } fts5DebugStructure(pRc, pBuf, p); fts5StructureRelease(p); } /* ** This is part of the fts5_decode() debugging aid. ** ** Arguments pBlob/nBlob contain an "averages" record. This function ** appends a human-readable representation of record to the buffer passed ** as the second argument. */ static void fts5DecodeAverages( int *pRc, /* IN/OUT: error code */ Fts5Buffer *pBuf, const u8 *pBlob, int nBlob ){ int i = 0; const char *zSpace = ""; while( i0 ){ iOff = sqlite3Fts5GetVarint(a, (u64*)&iDocid); sqlite3Fts5BufferAppendPrintf(pRc, pBuf, " id=%lld", iDocid); } while( iOffpStruct==0 || p->iStructVersion!=0 ); if( fts5IndexDataVersion(p)!=p->iStructVersion ){ fts5StructureInvalidate(p); } return fts5IndexReturn(p); } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_main.c ================================================ /* ** 2014 Jun 09 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This is an SQLite module implementing full-text search. */ #include "fts5Int.h" /* ** This variable is set to false when running tests for which the on disk ** structures should not be corrupt. Otherwise, true. If it is false, extra ** assert() conditions in the fts5 code are activated - conditions that are ** only true if it is guaranteed that the fts5 database is not corrupt. */ int sqlite3_fts5_may_be_corrupt = 1; typedef struct Fts5Auxdata Fts5Auxdata; typedef struct Fts5Auxiliary Fts5Auxiliary; typedef struct Fts5Cursor Fts5Cursor; typedef struct Fts5Sorter Fts5Sorter; typedef struct Fts5Table Fts5Table; typedef struct Fts5TokenizerModule Fts5TokenizerModule; /* ** NOTES ON TRANSACTIONS: ** ** SQLite invokes the following virtual table methods as transactions are ** opened and closed by the user: ** ** xBegin(): Start of a new transaction. ** xSync(): Initial part of two-phase commit. ** xCommit(): Final part of two-phase commit. ** xRollback(): Rollback the transaction. ** ** Anything that is required as part of a commit that may fail is performed ** in the xSync() callback. Current versions of SQLite ignore any errors ** returned by xCommit(). ** ** And as sub-transactions are opened/closed: ** ** xSavepoint(int S): Open savepoint S. ** xRelease(int S): Commit and close savepoint S. ** xRollbackTo(int S): Rollback to start of savepoint S. ** ** During a write-transaction the fts5_index.c module may cache some data ** in-memory. It is flushed to disk whenever xSync(), xRelease() or ** xSavepoint() is called. And discarded whenever xRollback() or xRollbackTo() ** is called. ** ** Additionally, if SQLITE_DEBUG is defined, an instance of the following ** structure is used to record the current transaction state. This information ** is not required, but it is used in the assert() statements executed by ** function fts5CheckTransactionState() (see below). */ struct Fts5TransactionState { int eState; /* 0==closed, 1==open, 2==synced */ int iSavepoint; /* Number of open savepoints (0 -> none) */ }; /* ** A single object of this type is allocated when the FTS5 module is ** registered with a database handle. It is used to store pointers to ** all registered FTS5 extensions - tokenizers and auxiliary functions. */ struct Fts5Global { fts5_api api; /* User visible part of object (see fts5.h) */ sqlite3 *db; /* Associated database connection */ i64 iNextId; /* Used to allocate unique cursor ids */ Fts5Auxiliary *pAux; /* First in list of all aux. functions */ Fts5TokenizerModule *pTok; /* First in list of all tokenizer modules */ Fts5TokenizerModule *pDfltTok; /* Default tokenizer module */ Fts5Cursor *pCsr; /* First in list of all open cursors */ }; /* ** Each auxiliary function registered with the FTS5 module is represented ** by an object of the following type. All such objects are stored as part ** of the Fts5Global.pAux list. */ struct Fts5Auxiliary { Fts5Global *pGlobal; /* Global context for this function */ char *zFunc; /* Function name (nul-terminated) */ void *pUserData; /* User-data pointer */ fts5_extension_function xFunc; /* Callback function */ void (*xDestroy)(void*); /* Destructor function */ Fts5Auxiliary *pNext; /* Next registered auxiliary function */ }; /* ** Each tokenizer module registered with the FTS5 module is represented ** by an object of the following type. All such objects are stored as part ** of the Fts5Global.pTok list. */ struct Fts5TokenizerModule { char *zName; /* Name of tokenizer */ void *pUserData; /* User pointer passed to xCreate() */ fts5_tokenizer x; /* Tokenizer functions */ void (*xDestroy)(void*); /* Destructor function */ Fts5TokenizerModule *pNext; /* Next registered tokenizer module */ }; /* ** Virtual-table object. */ struct Fts5Table { sqlite3_vtab base; /* Base class used by SQLite core */ Fts5Config *pConfig; /* Virtual table configuration */ Fts5Index *pIndex; /* Full-text index */ Fts5Storage *pStorage; /* Document store */ Fts5Global *pGlobal; /* Global (connection wide) data */ Fts5Cursor *pSortCsr; /* Sort data from this cursor */ #ifdef SQLITE_DEBUG struct Fts5TransactionState ts; #endif }; struct Fts5MatchPhrase { Fts5Buffer *pPoslist; /* Pointer to current poslist */ int nTerm; /* Size of phrase in terms */ }; /* ** pStmt: ** SELECT rowid, FROM ORDER BY +rank; ** ** aIdx[]: ** There is one entry in the aIdx[] array for each phrase in the query, ** the value of which is the offset within aPoslist[] following the last ** byte of the position list for the corresponding phrase. */ struct Fts5Sorter { sqlite3_stmt *pStmt; i64 iRowid; /* Current rowid */ const u8 *aPoslist; /* Position lists for current row */ int nIdx; /* Number of entries in aIdx[] */ int aIdx[1]; /* Offsets into aPoslist for current row */ }; /* ** Virtual-table cursor object. ** ** iSpecial: ** If this is a 'special' query (refer to function fts5SpecialMatch()), ** then this variable contains the result of the query. ** ** iFirstRowid, iLastRowid: ** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the ** cursor iterates in ascending order of rowids, iFirstRowid is the lower ** limit of rowids to return, and iLastRowid the upper. In other words, the ** WHERE clause in the user's query might have been: ** ** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid ** ** If the cursor iterates in descending order of rowid, iFirstRowid ** is the upper limit (i.e. the "first" rowid visited) and iLastRowid ** the lower. */ struct Fts5Cursor { sqlite3_vtab_cursor base; /* Base class used by SQLite core */ Fts5Cursor *pNext; /* Next cursor in Fts5Cursor.pCsr list */ int *aColumnSize; /* Values for xColumnSize() */ i64 iCsrId; /* Cursor id */ /* Zero from this point onwards on cursor reset */ int ePlan; /* FTS5_PLAN_XXX value */ int bDesc; /* True for "ORDER BY rowid DESC" queries */ i64 iFirstRowid; /* Return no rowids earlier than this */ i64 iLastRowid; /* Return no rowids later than this */ sqlite3_stmt *pStmt; /* Statement used to read %_content */ Fts5Expr *pExpr; /* Expression for MATCH queries */ Fts5Sorter *pSorter; /* Sorter for "ORDER BY rank" queries */ int csrflags; /* Mask of cursor flags (see below) */ i64 iSpecial; /* Result of special query */ /* "rank" function. Populated on demand from vtab.xColumn(). */ char *zRank; /* Custom rank function */ char *zRankArgs; /* Custom rank function args */ Fts5Auxiliary *pRank; /* Rank callback (or NULL) */ int nRankArg; /* Number of trailing arguments for rank() */ sqlite3_value **apRankArg; /* Array of trailing arguments */ sqlite3_stmt *pRankArgStmt; /* Origin of objects in apRankArg[] */ /* Auxiliary data storage */ Fts5Auxiliary *pAux; /* Currently executing extension function */ Fts5Auxdata *pAuxdata; /* First in linked list of saved aux-data */ /* Cache used by auxiliary functions xInst() and xInstCount() */ Fts5PoslistReader *aInstIter; /* One for each phrase */ int nInstAlloc; /* Size of aInst[] array (entries / 3) */ int nInstCount; /* Number of phrase instances */ int *aInst; /* 3 integers per phrase instance */ }; /* ** Bits that make up the "idxNum" parameter passed indirectly by ** xBestIndex() to xFilter(). */ #define FTS5_BI_MATCH 0x0001 /* MATCH ? */ #define FTS5_BI_RANK 0x0002 /* rank MATCH ? */ #define FTS5_BI_ROWID_EQ 0x0004 /* rowid == ? */ #define FTS5_BI_ROWID_LE 0x0008 /* rowid <= ? */ #define FTS5_BI_ROWID_GE 0x0010 /* rowid >= ? */ #define FTS5_BI_ORDER_RANK 0x0020 #define FTS5_BI_ORDER_ROWID 0x0040 #define FTS5_BI_ORDER_DESC 0x0080 /* ** Values for Fts5Cursor.csrflags */ #define FTS5CSR_EOF 0x01 #define FTS5CSR_REQUIRE_CONTENT 0x02 #define FTS5CSR_REQUIRE_DOCSIZE 0x04 #define FTS5CSR_REQUIRE_INST 0x08 #define FTS5CSR_FREE_ZRANK 0x10 #define FTS5CSR_REQUIRE_RESEEK 0x20 #define FTS5CSR_REQUIRE_POSLIST 0x40 #define BitFlagAllTest(x,y) (((x) & (y))==(y)) #define BitFlagTest(x,y) (((x) & (y))!=0) /* ** Macros to Set(), Clear() and Test() cursor flags. */ #define CsrFlagSet(pCsr, flag) ((pCsr)->csrflags |= (flag)) #define CsrFlagClear(pCsr, flag) ((pCsr)->csrflags &= ~(flag)) #define CsrFlagTest(pCsr, flag) ((pCsr)->csrflags & (flag)) struct Fts5Auxdata { Fts5Auxiliary *pAux; /* Extension to which this belongs */ void *pPtr; /* Pointer value */ void(*xDelete)(void*); /* Destructor */ Fts5Auxdata *pNext; /* Next object in linked list */ }; #ifdef SQLITE_DEBUG #define FTS5_BEGIN 1 #define FTS5_SYNC 2 #define FTS5_COMMIT 3 #define FTS5_ROLLBACK 4 #define FTS5_SAVEPOINT 5 #define FTS5_RELEASE 6 #define FTS5_ROLLBACKTO 7 static void fts5CheckTransactionState(Fts5Table *p, int op, int iSavepoint){ switch( op ){ case FTS5_BEGIN: assert( p->ts.eState==0 ); p->ts.eState = 1; p->ts.iSavepoint = -1; break; case FTS5_SYNC: assert( p->ts.eState==1 ); p->ts.eState = 2; break; case FTS5_COMMIT: assert( p->ts.eState==2 ); p->ts.eState = 0; break; case FTS5_ROLLBACK: assert( p->ts.eState==1 || p->ts.eState==2 || p->ts.eState==0 ); p->ts.eState = 0; break; case FTS5_SAVEPOINT: assert( p->ts.eState==1 ); assert( iSavepoint>=0 ); assert( iSavepoint>p->ts.iSavepoint ); p->ts.iSavepoint = iSavepoint; break; case FTS5_RELEASE: assert( p->ts.eState==1 ); assert( iSavepoint>=0 ); assert( iSavepoint<=p->ts.iSavepoint ); p->ts.iSavepoint = iSavepoint-1; break; case FTS5_ROLLBACKTO: assert( p->ts.eState==1 ); assert( iSavepoint>=0 ); assert( iSavepoint<=p->ts.iSavepoint ); p->ts.iSavepoint = iSavepoint; break; } } #else # define fts5CheckTransactionState(x,y,z) #endif /* ** Return true if pTab is a contentless table. */ static int fts5IsContentless(Fts5Table *pTab){ return pTab->pConfig->eContent==FTS5_CONTENT_NONE; } /* ** Delete a virtual table handle allocated by fts5InitVtab(). */ static void fts5FreeVtab(Fts5Table *pTab){ if( pTab ){ sqlite3Fts5IndexClose(pTab->pIndex); sqlite3Fts5StorageClose(pTab->pStorage); sqlite3Fts5ConfigFree(pTab->pConfig); sqlite3_free(pTab); } } /* ** The xDisconnect() virtual table method. */ static int fts5DisconnectMethod(sqlite3_vtab *pVtab){ fts5FreeVtab((Fts5Table*)pVtab); return SQLITE_OK; } /* ** The xDestroy() virtual table method. */ static int fts5DestroyMethod(sqlite3_vtab *pVtab){ Fts5Table *pTab = (Fts5Table*)pVtab; int rc = sqlite3Fts5DropAll(pTab->pConfig); if( rc==SQLITE_OK ){ fts5FreeVtab((Fts5Table*)pVtab); } return rc; } /* ** This function is the implementation of both the xConnect and xCreate ** methods of the FTS3 virtual table. ** ** The argv[] array contains the following: ** ** argv[0] -> module name ("fts5") ** argv[1] -> database name ** argv[2] -> table name ** argv[...] -> "column name" and other module argument fields. */ static int fts5InitVtab( int bCreate, /* True for xCreate, false for xConnect */ sqlite3 *db, /* The SQLite database connection */ void *pAux, /* Hash table containing tokenizers */ int argc, /* Number of elements in argv array */ const char * const *argv, /* xCreate/xConnect argument array */ sqlite3_vtab **ppVTab, /* Write the resulting vtab structure here */ char **pzErr /* Write any error message here */ ){ Fts5Global *pGlobal = (Fts5Global*)pAux; const char **azConfig = (const char**)argv; int rc = SQLITE_OK; /* Return code */ Fts5Config *pConfig = 0; /* Results of parsing argc/argv */ Fts5Table *pTab = 0; /* New virtual table object */ /* Allocate the new vtab object and parse the configuration */ pTab = (Fts5Table*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5Table)); if( rc==SQLITE_OK ){ rc = sqlite3Fts5ConfigParse(pGlobal, db, argc, azConfig, &pConfig, pzErr); assert( (rc==SQLITE_OK && *pzErr==0) || pConfig==0 ); } if( rc==SQLITE_OK ){ pTab->pConfig = pConfig; pTab->pGlobal = pGlobal; } /* Open the index sub-system */ if( rc==SQLITE_OK ){ rc = sqlite3Fts5IndexOpen(pConfig, bCreate, &pTab->pIndex, pzErr); } /* Open the storage sub-system */ if( rc==SQLITE_OK ){ rc = sqlite3Fts5StorageOpen( pConfig, pTab->pIndex, bCreate, &pTab->pStorage, pzErr ); } /* Call sqlite3_declare_vtab() */ if( rc==SQLITE_OK ){ rc = sqlite3Fts5ConfigDeclareVtab(pConfig); } /* Load the initial configuration */ if( rc==SQLITE_OK ){ assert( pConfig->pzErrmsg==0 ); pConfig->pzErrmsg = pzErr; rc = sqlite3Fts5IndexLoadConfig(pTab->pIndex); sqlite3Fts5IndexRollback(pTab->pIndex); pConfig->pzErrmsg = 0; } if( rc!=SQLITE_OK ){ fts5FreeVtab(pTab); pTab = 0; }else if( bCreate ){ fts5CheckTransactionState(pTab, FTS5_BEGIN, 0); } *ppVTab = (sqlite3_vtab*)pTab; return rc; } /* ** The xConnect() and xCreate() methods for the virtual table. All the ** work is done in function fts5InitVtab(). */ static int fts5ConnectMethod( sqlite3 *db, /* Database connection */ void *pAux, /* Pointer to tokenizer hash table */ int argc, /* Number of elements in argv array */ const char * const *argv, /* xCreate/xConnect argument array */ sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */ char **pzErr /* OUT: sqlite3_malloc'd error message */ ){ return fts5InitVtab(0, db, pAux, argc, argv, ppVtab, pzErr); } static int fts5CreateMethod( sqlite3 *db, /* Database connection */ void *pAux, /* Pointer to tokenizer hash table */ int argc, /* Number of elements in argv array */ const char * const *argv, /* xCreate/xConnect argument array */ sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */ char **pzErr /* OUT: sqlite3_malloc'd error message */ ){ return fts5InitVtab(1, db, pAux, argc, argv, ppVtab, pzErr); } /* ** The different query plans. */ #define FTS5_PLAN_MATCH 1 /* ( MATCH ?) */ #define FTS5_PLAN_SOURCE 2 /* A source cursor for SORTED_MATCH */ #define FTS5_PLAN_SPECIAL 3 /* An internal query */ #define FTS5_PLAN_SORTED_MATCH 4 /* ( MATCH ? ORDER BY rank) */ #define FTS5_PLAN_SCAN 5 /* No usable constraint */ #define FTS5_PLAN_ROWID 6 /* (rowid = ?) */ /* ** Set the SQLITE_INDEX_SCAN_UNIQUE flag in pIdxInfo->flags. Unless this ** extension is currently being used by a version of SQLite too old to ** support index-info flags. In that case this function is a no-op. */ static void fts5SetUniqueFlag(sqlite3_index_info *pIdxInfo){ #if SQLITE_VERSION_NUMBER>=3008012 #ifndef SQLITE_CORE if( sqlite3_libversion_number()>=3008012 ) #endif { pIdxInfo->idxFlags |= SQLITE_INDEX_SCAN_UNIQUE; } #endif } /* ** Implementation of the xBestIndex method for FTS5 tables. Within the ** WHERE constraint, it searches for the following: ** ** 1. A MATCH constraint against the special column. ** 2. A MATCH constraint against the "rank" column. ** 3. An == constraint against the rowid column. ** 4. A < or <= constraint against the rowid column. ** 5. A > or >= constraint against the rowid column. ** ** Within the ORDER BY, either: ** ** 5. ORDER BY rank [ASC|DESC] ** 6. ORDER BY rowid [ASC|DESC] ** ** Costs are assigned as follows: ** ** a) If an unusable MATCH operator is present in the WHERE clause, the ** cost is unconditionally set to 1e50 (a really big number). ** ** a) If a MATCH operator is present, the cost depends on the other ** constraints also present. As follows: ** ** * No other constraints: cost=1000.0 ** * One rowid range constraint: cost=750.0 ** * Both rowid range constraints: cost=500.0 ** * An == rowid constraint: cost=100.0 ** ** b) Otherwise, if there is no MATCH: ** ** * No other constraints: cost=1000000.0 ** * One rowid range constraint: cost=750000.0 ** * Both rowid range constraints: cost=250000.0 ** * An == rowid constraint: cost=10.0 ** ** Costs are not modified by the ORDER BY clause. */ static int fts5BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ Fts5Table *pTab = (Fts5Table*)pVTab; Fts5Config *pConfig = pTab->pConfig; const int nCol = pConfig->nCol; int idxFlags = 0; /* Parameter passed through to xFilter() */ int bHasMatch; int iNext; int i; struct Constraint { int op; /* Mask against sqlite3_index_constraint.op */ int fts5op; /* FTS5 mask for idxFlags */ int iCol; /* 0==rowid, 1==tbl, 2==rank */ int omit; /* True to omit this if found */ int iConsIndex; /* Index in pInfo->aConstraint[] */ } aConstraint[] = { {SQLITE_INDEX_CONSTRAINT_MATCH|SQLITE_INDEX_CONSTRAINT_EQ, FTS5_BI_MATCH, 1, 1, -1}, {SQLITE_INDEX_CONSTRAINT_MATCH|SQLITE_INDEX_CONSTRAINT_EQ, FTS5_BI_RANK, 2, 1, -1}, {SQLITE_INDEX_CONSTRAINT_EQ, FTS5_BI_ROWID_EQ, 0, 0, -1}, {SQLITE_INDEX_CONSTRAINT_LT|SQLITE_INDEX_CONSTRAINT_LE, FTS5_BI_ROWID_LE, 0, 0, -1}, {SQLITE_INDEX_CONSTRAINT_GT|SQLITE_INDEX_CONSTRAINT_GE, FTS5_BI_ROWID_GE, 0, 0, -1}, }; int aColMap[3]; aColMap[0] = -1; aColMap[1] = nCol; aColMap[2] = nCol+1; /* Set idxFlags flags for all WHERE clause terms that will be used. */ for(i=0; inConstraint; i++){ struct sqlite3_index_constraint *p = &pInfo->aConstraint[i]; int iCol = p->iColumn; if( (p->op==SQLITE_INDEX_CONSTRAINT_MATCH && iCol>=0 && iCol<=nCol) || (p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol==nCol) ){ /* A MATCH operator or equivalent */ if( p->usable ){ idxFlags = (idxFlags & 0xFFFF) | FTS5_BI_MATCH | (iCol << 16); aConstraint[0].iConsIndex = i; }else{ /* As there exists an unusable MATCH constraint this is an ** unusable plan. Set a prohibitively high cost. */ pInfo->estimatedCost = 1e50; return SQLITE_OK; } }else{ int j; for(j=1; jiCol] && p->op & pC->op && p->usable ){ pC->iConsIndex = i; idxFlags |= pC->fts5op; } } } } /* Set idxFlags flags for the ORDER BY clause */ if( pInfo->nOrderBy==1 ){ int iSort = pInfo->aOrderBy[0].iColumn; if( iSort==(pConfig->nCol+1) && BitFlagTest(idxFlags, FTS5_BI_MATCH) ){ idxFlags |= FTS5_BI_ORDER_RANK; }else if( iSort==-1 ){ idxFlags |= FTS5_BI_ORDER_ROWID; } if( BitFlagTest(idxFlags, FTS5_BI_ORDER_RANK|FTS5_BI_ORDER_ROWID) ){ pInfo->orderByConsumed = 1; if( pInfo->aOrderBy[0].desc ){ idxFlags |= FTS5_BI_ORDER_DESC; } } } /* Calculate the estimated cost based on the flags set in idxFlags. */ bHasMatch = BitFlagTest(idxFlags, FTS5_BI_MATCH); if( BitFlagTest(idxFlags, FTS5_BI_ROWID_EQ) ){ pInfo->estimatedCost = bHasMatch ? 100.0 : 10.0; if( bHasMatch==0 ) fts5SetUniqueFlag(pInfo); }else if( BitFlagAllTest(idxFlags, FTS5_BI_ROWID_LE|FTS5_BI_ROWID_GE) ){ pInfo->estimatedCost = bHasMatch ? 500.0 : 250000.0; }else if( BitFlagTest(idxFlags, FTS5_BI_ROWID_LE|FTS5_BI_ROWID_GE) ){ pInfo->estimatedCost = bHasMatch ? 750.0 : 750000.0; }else{ pInfo->estimatedCost = bHasMatch ? 1000.0 : 1000000.0; } /* Assign argvIndex values to each constraint in use. */ iNext = 1; for(i=0; iiConsIndex>=0 ){ pInfo->aConstraintUsage[pC->iConsIndex].argvIndex = iNext++; pInfo->aConstraintUsage[pC->iConsIndex].omit = (unsigned char)pC->omit; } } pInfo->idxNum = idxFlags; return SQLITE_OK; } static int fts5NewTransaction(Fts5Table *pTab){ Fts5Cursor *pCsr; for(pCsr=pTab->pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){ if( pCsr->base.pVtab==(sqlite3_vtab*)pTab ) return SQLITE_OK; } return sqlite3Fts5StorageReset(pTab->pStorage); } /* ** Implementation of xOpen method. */ static int fts5OpenMethod(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr){ Fts5Table *pTab = (Fts5Table*)pVTab; Fts5Config *pConfig = pTab->pConfig; Fts5Cursor *pCsr = 0; /* New cursor object */ int nByte; /* Bytes of space to allocate */ int rc; /* Return code */ rc = fts5NewTransaction(pTab); if( rc==SQLITE_OK ){ nByte = sizeof(Fts5Cursor) + pConfig->nCol * sizeof(int); pCsr = (Fts5Cursor*)sqlite3_malloc(nByte); if( pCsr ){ Fts5Global *pGlobal = pTab->pGlobal; memset(pCsr, 0, nByte); pCsr->aColumnSize = (int*)&pCsr[1]; pCsr->pNext = pGlobal->pCsr; pGlobal->pCsr = pCsr; pCsr->iCsrId = ++pGlobal->iNextId; }else{ rc = SQLITE_NOMEM; } } *ppCsr = (sqlite3_vtab_cursor*)pCsr; return rc; } static int fts5StmtType(Fts5Cursor *pCsr){ if( pCsr->ePlan==FTS5_PLAN_SCAN ){ return (pCsr->bDesc) ? FTS5_STMT_SCAN_DESC : FTS5_STMT_SCAN_ASC; } return FTS5_STMT_LOOKUP; } /* ** This function is called after the cursor passed as the only argument ** is moved to point at a different row. It clears all cached data ** specific to the previous row stored by the cursor object. */ static void fts5CsrNewrow(Fts5Cursor *pCsr){ CsrFlagSet(pCsr, FTS5CSR_REQUIRE_CONTENT | FTS5CSR_REQUIRE_DOCSIZE | FTS5CSR_REQUIRE_INST | FTS5CSR_REQUIRE_POSLIST ); } static void fts5FreeCursorComponents(Fts5Cursor *pCsr){ Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab); Fts5Auxdata *pData; Fts5Auxdata *pNext; sqlite3_free(pCsr->aInstIter); sqlite3_free(pCsr->aInst); if( pCsr->pStmt ){ int eStmt = fts5StmtType(pCsr); sqlite3Fts5StorageStmtRelease(pTab->pStorage, eStmt, pCsr->pStmt); } if( pCsr->pSorter ){ Fts5Sorter *pSorter = pCsr->pSorter; sqlite3_finalize(pSorter->pStmt); sqlite3_free(pSorter); } if( pCsr->ePlan!=FTS5_PLAN_SOURCE ){ sqlite3Fts5ExprFree(pCsr->pExpr); } for(pData=pCsr->pAuxdata; pData; pData=pNext){ pNext = pData->pNext; if( pData->xDelete ) pData->xDelete(pData->pPtr); sqlite3_free(pData); } sqlite3_finalize(pCsr->pRankArgStmt); sqlite3_free(pCsr->apRankArg); if( CsrFlagTest(pCsr, FTS5CSR_FREE_ZRANK) ){ sqlite3_free(pCsr->zRank); sqlite3_free(pCsr->zRankArgs); } memset(&pCsr->ePlan, 0, sizeof(Fts5Cursor) - ((u8*)&pCsr->ePlan - (u8*)pCsr)); } /* ** Close the cursor. For additional information see the documentation ** on the xClose method of the virtual table interface. */ static int fts5CloseMethod(sqlite3_vtab_cursor *pCursor){ if( pCursor ){ Fts5Table *pTab = (Fts5Table*)(pCursor->pVtab); Fts5Cursor *pCsr = (Fts5Cursor*)pCursor; Fts5Cursor **pp; fts5FreeCursorComponents(pCsr); /* Remove the cursor from the Fts5Global.pCsr list */ for(pp=&pTab->pGlobal->pCsr; (*pp)!=pCsr; pp=&(*pp)->pNext); *pp = pCsr->pNext; sqlite3_free(pCsr); } return SQLITE_OK; } static int fts5SorterNext(Fts5Cursor *pCsr){ Fts5Sorter *pSorter = pCsr->pSorter; int rc; rc = sqlite3_step(pSorter->pStmt); if( rc==SQLITE_DONE ){ rc = SQLITE_OK; CsrFlagSet(pCsr, FTS5CSR_EOF); }else if( rc==SQLITE_ROW ){ const u8 *a; const u8 *aBlob; int nBlob; int i; int iOff = 0; rc = SQLITE_OK; pSorter->iRowid = sqlite3_column_int64(pSorter->pStmt, 0); nBlob = sqlite3_column_bytes(pSorter->pStmt, 1); aBlob = a = sqlite3_column_blob(pSorter->pStmt, 1); /* nBlob==0 in detail=none mode. */ if( nBlob>0 ){ for(i=0; i<(pSorter->nIdx-1); i++){ int iVal; a += fts5GetVarint32(a, iVal); iOff += iVal; pSorter->aIdx[i] = iOff; } pSorter->aIdx[i] = &aBlob[nBlob] - a; pSorter->aPoslist = a; } fts5CsrNewrow(pCsr); } return rc; } /* ** Set the FTS5CSR_REQUIRE_RESEEK flag on all FTS5_PLAN_MATCH cursors ** open on table pTab. */ static void fts5TripCursors(Fts5Table *pTab){ Fts5Cursor *pCsr; for(pCsr=pTab->pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){ if( pCsr->ePlan==FTS5_PLAN_MATCH && pCsr->base.pVtab==(sqlite3_vtab*)pTab ){ CsrFlagSet(pCsr, FTS5CSR_REQUIRE_RESEEK); } } } /* ** If the REQUIRE_RESEEK flag is set on the cursor passed as the first ** argument, close and reopen all Fts5IndexIter iterators that the cursor ** is using. Then attempt to move the cursor to a rowid equal to or laster ** (in the cursors sort order - ASC or DESC) than the current rowid. ** ** If the new rowid is not equal to the old, set output parameter *pbSkip ** to 1 before returning. Otherwise, leave it unchanged. ** ** Return SQLITE_OK if successful or if no reseek was required, or an ** error code if an error occurred. */ static int fts5CursorReseek(Fts5Cursor *pCsr, int *pbSkip){ int rc = SQLITE_OK; assert( *pbSkip==0 ); if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_RESEEK) ){ Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab); int bDesc = pCsr->bDesc; i64 iRowid = sqlite3Fts5ExprRowid(pCsr->pExpr); rc = sqlite3Fts5ExprFirst(pCsr->pExpr, pTab->pIndex, iRowid, bDesc); if( rc==SQLITE_OK && iRowid!=sqlite3Fts5ExprRowid(pCsr->pExpr) ){ *pbSkip = 1; } CsrFlagClear(pCsr, FTS5CSR_REQUIRE_RESEEK); fts5CsrNewrow(pCsr); if( sqlite3Fts5ExprEof(pCsr->pExpr) ){ CsrFlagSet(pCsr, FTS5CSR_EOF); *pbSkip = 1; } } return rc; } /* ** Advance the cursor to the next row in the table that matches the ** search criteria. ** ** Return SQLITE_OK if nothing goes wrong. SQLITE_OK is returned ** even if we reach end-of-file. The fts5EofMethod() will be called ** subsequently to determine whether or not an EOF was hit. */ static int fts5NextMethod(sqlite3_vtab_cursor *pCursor){ Fts5Cursor *pCsr = (Fts5Cursor*)pCursor; int rc; assert( (pCsr->ePlan<3)== (pCsr->ePlan==FTS5_PLAN_MATCH || pCsr->ePlan==FTS5_PLAN_SOURCE) ); assert( !CsrFlagTest(pCsr, FTS5CSR_EOF) ); if( pCsr->ePlan<3 ){ int bSkip = 0; if( (rc = fts5CursorReseek(pCsr, &bSkip)) || bSkip ) return rc; rc = sqlite3Fts5ExprNext(pCsr->pExpr, pCsr->iLastRowid); CsrFlagSet(pCsr, sqlite3Fts5ExprEof(pCsr->pExpr)); fts5CsrNewrow(pCsr); }else{ switch( pCsr->ePlan ){ case FTS5_PLAN_SPECIAL: { CsrFlagSet(pCsr, FTS5CSR_EOF); rc = SQLITE_OK; break; } case FTS5_PLAN_SORTED_MATCH: { rc = fts5SorterNext(pCsr); break; } default: rc = sqlite3_step(pCsr->pStmt); if( rc!=SQLITE_ROW ){ CsrFlagSet(pCsr, FTS5CSR_EOF); rc = sqlite3_reset(pCsr->pStmt); }else{ rc = SQLITE_OK; } break; } } return rc; } static int fts5PrepareStatement( sqlite3_stmt **ppStmt, Fts5Config *pConfig, const char *zFmt, ... ){ sqlite3_stmt *pRet = 0; int rc; char *zSql; va_list ap; va_start(ap, zFmt); zSql = sqlite3_vmprintf(zFmt, ap); if( zSql==0 ){ rc = SQLITE_NOMEM; }else{ rc = sqlite3_prepare_v3(pConfig->db, zSql, -1, SQLITE_PREPARE_PERSISTENT, &pRet, 0); if( rc!=SQLITE_OK ){ *pConfig->pzErrmsg = sqlite3_mprintf("%s", sqlite3_errmsg(pConfig->db)); } sqlite3_free(zSql); } va_end(ap); *ppStmt = pRet; return rc; } static int fts5CursorFirstSorted(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){ Fts5Config *pConfig = pTab->pConfig; Fts5Sorter *pSorter; int nPhrase; int nByte; int rc; const char *zRank = pCsr->zRank; const char *zRankArgs = pCsr->zRankArgs; nPhrase = sqlite3Fts5ExprPhraseCount(pCsr->pExpr); nByte = sizeof(Fts5Sorter) + sizeof(int) * (nPhrase-1); pSorter = (Fts5Sorter*)sqlite3_malloc(nByte); if( pSorter==0 ) return SQLITE_NOMEM; memset(pSorter, 0, nByte); pSorter->nIdx = nPhrase; /* TODO: It would be better to have some system for reusing statement ** handles here, rather than preparing a new one for each query. But that ** is not possible as SQLite reference counts the virtual table objects. ** And since the statement required here reads from this very virtual ** table, saving it creates a circular reference. ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ rc = fts5PrepareStatement(&pSorter->pStmt, pConfig, "SELECT rowid, rank FROM %Q.%Q ORDER BY %s(%s%s%s) %s", pConfig->zDb, pConfig->zName, zRank, pConfig->zName, (zRankArgs ? ", " : ""), (zRankArgs ? zRankArgs : ""), bDesc ? "DESC" : "ASC" ); pCsr->pSorter = pSorter; if( rc==SQLITE_OK ){ assert( pTab->pSortCsr==0 ); pTab->pSortCsr = pCsr; rc = fts5SorterNext(pCsr); pTab->pSortCsr = 0; } if( rc!=SQLITE_OK ){ sqlite3_finalize(pSorter->pStmt); sqlite3_free(pSorter); pCsr->pSorter = 0; } return rc; } static int fts5CursorFirst(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){ int rc; Fts5Expr *pExpr = pCsr->pExpr; rc = sqlite3Fts5ExprFirst(pExpr, pTab->pIndex, pCsr->iFirstRowid, bDesc); if( sqlite3Fts5ExprEof(pExpr) ){ CsrFlagSet(pCsr, FTS5CSR_EOF); } fts5CsrNewrow(pCsr); return rc; } /* ** Process a "special" query. A special query is identified as one with a ** MATCH expression that begins with a '*' character. The remainder of ** the text passed to the MATCH operator are used as the special query ** parameters. */ static int fts5SpecialMatch( Fts5Table *pTab, Fts5Cursor *pCsr, const char *zQuery ){ int rc = SQLITE_OK; /* Return code */ const char *z = zQuery; /* Special query text */ int n; /* Number of bytes in text at z */ while( z[0]==' ' ) z++; for(n=0; z[n] && z[n]!=' '; n++); assert( pTab->base.zErrMsg==0 ); pCsr->ePlan = FTS5_PLAN_SPECIAL; if( 0==sqlite3_strnicmp("reads", z, n) ){ pCsr->iSpecial = sqlite3Fts5IndexReads(pTab->pIndex); } else if( 0==sqlite3_strnicmp("id", z, n) ){ pCsr->iSpecial = pCsr->iCsrId; } else{ /* An unrecognized directive. Return an error message. */ pTab->base.zErrMsg = sqlite3_mprintf("unknown special query: %.*s", n, z); rc = SQLITE_ERROR; } return rc; } /* ** Search for an auxiliary function named zName that can be used with table ** pTab. If one is found, return a pointer to the corresponding Fts5Auxiliary ** structure. Otherwise, if no such function exists, return NULL. */ static Fts5Auxiliary *fts5FindAuxiliary(Fts5Table *pTab, const char *zName){ Fts5Auxiliary *pAux; for(pAux=pTab->pGlobal->pAux; pAux; pAux=pAux->pNext){ if( sqlite3_stricmp(zName, pAux->zFunc)==0 ) return pAux; } /* No function of the specified name was found. Return 0. */ return 0; } static int fts5FindRankFunction(Fts5Cursor *pCsr){ Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab); Fts5Config *pConfig = pTab->pConfig; int rc = SQLITE_OK; Fts5Auxiliary *pAux = 0; const char *zRank = pCsr->zRank; const char *zRankArgs = pCsr->zRankArgs; if( zRankArgs ){ char *zSql = sqlite3Fts5Mprintf(&rc, "SELECT %s", zRankArgs); if( zSql ){ sqlite3_stmt *pStmt = 0; rc = sqlite3_prepare_v3(pConfig->db, zSql, -1, SQLITE_PREPARE_PERSISTENT, &pStmt, 0); sqlite3_free(zSql); assert( rc==SQLITE_OK || pCsr->pRankArgStmt==0 ); if( rc==SQLITE_OK ){ if( SQLITE_ROW==sqlite3_step(pStmt) ){ int nByte; pCsr->nRankArg = sqlite3_column_count(pStmt); nByte = sizeof(sqlite3_value*)*pCsr->nRankArg; pCsr->apRankArg = (sqlite3_value**)sqlite3Fts5MallocZero(&rc, nByte); if( rc==SQLITE_OK ){ int i; for(i=0; inRankArg; i++){ pCsr->apRankArg[i] = sqlite3_column_value(pStmt, i); } } pCsr->pRankArgStmt = pStmt; }else{ rc = sqlite3_finalize(pStmt); assert( rc!=SQLITE_OK ); } } } } if( rc==SQLITE_OK ){ pAux = fts5FindAuxiliary(pTab, zRank); if( pAux==0 ){ assert( pTab->base.zErrMsg==0 ); pTab->base.zErrMsg = sqlite3_mprintf("no such function: %s", zRank); rc = SQLITE_ERROR; } } pCsr->pRank = pAux; return rc; } static int fts5CursorParseRank( Fts5Config *pConfig, Fts5Cursor *pCsr, sqlite3_value *pRank ){ int rc = SQLITE_OK; if( pRank ){ const char *z = (const char*)sqlite3_value_text(pRank); char *zRank = 0; char *zRankArgs = 0; if( z==0 ){ if( sqlite3_value_type(pRank)==SQLITE_NULL ) rc = SQLITE_ERROR; }else{ rc = sqlite3Fts5ConfigParseRank(z, &zRank, &zRankArgs); } if( rc==SQLITE_OK ){ pCsr->zRank = zRank; pCsr->zRankArgs = zRankArgs; CsrFlagSet(pCsr, FTS5CSR_FREE_ZRANK); }else if( rc==SQLITE_ERROR ){ pCsr->base.pVtab->zErrMsg = sqlite3_mprintf( "parse error in rank function: %s", z ); } }else{ if( pConfig->zRank ){ pCsr->zRank = (char*)pConfig->zRank; pCsr->zRankArgs = (char*)pConfig->zRankArgs; }else{ pCsr->zRank = (char*)FTS5_DEFAULT_RANK; pCsr->zRankArgs = 0; } } return rc; } static i64 fts5GetRowidLimit(sqlite3_value *pVal, i64 iDefault){ if( pVal ){ int eType = sqlite3_value_numeric_type(pVal); if( eType==SQLITE_INTEGER ){ return sqlite3_value_int64(pVal); } } return iDefault; } /* ** This is the xFilter interface for the virtual table. See ** the virtual table xFilter method documentation for additional ** information. ** ** There are three possible query strategies: ** ** 1. Full-text search using a MATCH operator. ** 2. A by-rowid lookup. ** 3. A full-table scan. */ static int fts5FilterMethod( sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */ int idxNum, /* Strategy index */ const char *zUnused, /* Unused */ int nVal, /* Number of elements in apVal */ sqlite3_value **apVal /* Arguments for the indexing scheme */ ){ Fts5Table *pTab = (Fts5Table*)(pCursor->pVtab); Fts5Config *pConfig = pTab->pConfig; Fts5Cursor *pCsr = (Fts5Cursor*)pCursor; int rc = SQLITE_OK; /* Error code */ int iVal = 0; /* Counter for apVal[] */ int bDesc; /* True if ORDER BY [rank|rowid] DESC */ int bOrderByRank; /* True if ORDER BY rank */ sqlite3_value *pMatch = 0; /* MATCH ? expression (or NULL) */ sqlite3_value *pRank = 0; /* rank MATCH ? expression (or NULL) */ sqlite3_value *pRowidEq = 0; /* rowid = ? expression (or NULL) */ sqlite3_value *pRowidLe = 0; /* rowid <= ? expression (or NULL) */ sqlite3_value *pRowidGe = 0; /* rowid >= ? expression (or NULL) */ int iCol; /* Column on LHS of MATCH operator */ char **pzErrmsg = pConfig->pzErrmsg; UNUSED_PARAM(zUnused); UNUSED_PARAM(nVal); if( pCsr->ePlan ){ fts5FreeCursorComponents(pCsr); memset(&pCsr->ePlan, 0, sizeof(Fts5Cursor) - ((u8*)&pCsr->ePlan-(u8*)pCsr)); } assert( pCsr->pStmt==0 ); assert( pCsr->pExpr==0 ); assert( pCsr->csrflags==0 ); assert( pCsr->pRank==0 ); assert( pCsr->zRank==0 ); assert( pCsr->zRankArgs==0 ); assert( pzErrmsg==0 || pzErrmsg==&pTab->base.zErrMsg ); pConfig->pzErrmsg = &pTab->base.zErrMsg; /* Decode the arguments passed through to this function. ** ** Note: The following set of if(...) statements must be in the same ** order as the corresponding entries in the struct at the top of ** fts5BestIndexMethod(). */ if( BitFlagTest(idxNum, FTS5_BI_MATCH) ) pMatch = apVal[iVal++]; if( BitFlagTest(idxNum, FTS5_BI_RANK) ) pRank = apVal[iVal++]; if( BitFlagTest(idxNum, FTS5_BI_ROWID_EQ) ) pRowidEq = apVal[iVal++]; if( BitFlagTest(idxNum, FTS5_BI_ROWID_LE) ) pRowidLe = apVal[iVal++]; if( BitFlagTest(idxNum, FTS5_BI_ROWID_GE) ) pRowidGe = apVal[iVal++]; iCol = (idxNum>>16); assert( iCol>=0 && iCol<=pConfig->nCol ); assert( iVal==nVal ); bOrderByRank = ((idxNum & FTS5_BI_ORDER_RANK) ? 1 : 0); pCsr->bDesc = bDesc = ((idxNum & FTS5_BI_ORDER_DESC) ? 1 : 0); /* Set the cursor upper and lower rowid limits. Only some strategies ** actually use them. This is ok, as the xBestIndex() method leaves the ** sqlite3_index_constraint.omit flag clear for range constraints ** on the rowid field. */ if( pRowidEq ){ pRowidLe = pRowidGe = pRowidEq; } if( bDesc ){ pCsr->iFirstRowid = fts5GetRowidLimit(pRowidLe, LARGEST_INT64); pCsr->iLastRowid = fts5GetRowidLimit(pRowidGe, SMALLEST_INT64); }else{ pCsr->iLastRowid = fts5GetRowidLimit(pRowidLe, LARGEST_INT64); pCsr->iFirstRowid = fts5GetRowidLimit(pRowidGe, SMALLEST_INT64); } if( pTab->pSortCsr ){ /* If pSortCsr is non-NULL, then this call is being made as part of ** processing for a "... MATCH ORDER BY rank" query (ePlan is ** set to FTS5_PLAN_SORTED_MATCH). pSortCsr is the cursor that will ** return results to the user for this query. The current cursor ** (pCursor) is used to execute the query issued by function ** fts5CursorFirstSorted() above. */ assert( pRowidEq==0 && pRowidLe==0 && pRowidGe==0 && pRank==0 ); assert( nVal==0 && pMatch==0 && bOrderByRank==0 && bDesc==0 ); assert( pCsr->iLastRowid==LARGEST_INT64 ); assert( pCsr->iFirstRowid==SMALLEST_INT64 ); pCsr->ePlan = FTS5_PLAN_SOURCE; pCsr->pExpr = pTab->pSortCsr->pExpr; rc = fts5CursorFirst(pTab, pCsr, bDesc); }else if( pMatch ){ const char *zExpr = (const char*)sqlite3_value_text(apVal[0]); if( zExpr==0 ) zExpr = ""; rc = fts5CursorParseRank(pConfig, pCsr, pRank); if( rc==SQLITE_OK ){ if( zExpr[0]=='*' ){ /* The user has issued a query of the form "MATCH '*...'". This ** indicates that the MATCH expression is not a full text query, ** but a request for an internal parameter. */ rc = fts5SpecialMatch(pTab, pCsr, &zExpr[1]); }else{ char **pzErr = &pTab->base.zErrMsg; rc = sqlite3Fts5ExprNew(pConfig, iCol, zExpr, &pCsr->pExpr, pzErr); if( rc==SQLITE_OK ){ if( bOrderByRank ){ pCsr->ePlan = FTS5_PLAN_SORTED_MATCH; rc = fts5CursorFirstSorted(pTab, pCsr, bDesc); }else{ pCsr->ePlan = FTS5_PLAN_MATCH; rc = fts5CursorFirst(pTab, pCsr, bDesc); } } } } }else if( pConfig->zContent==0 ){ *pConfig->pzErrmsg = sqlite3_mprintf( "%s: table does not support scanning", pConfig->zName ); rc = SQLITE_ERROR; }else{ /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup ** by rowid (ePlan==FTS5_PLAN_ROWID). */ pCsr->ePlan = (pRowidEq ? FTS5_PLAN_ROWID : FTS5_PLAN_SCAN); rc = sqlite3Fts5StorageStmt( pTab->pStorage, fts5StmtType(pCsr), &pCsr->pStmt, &pTab->base.zErrMsg ); if( rc==SQLITE_OK ){ if( pCsr->ePlan==FTS5_PLAN_ROWID ){ sqlite3_bind_value(pCsr->pStmt, 1, apVal[0]); }else{ sqlite3_bind_int64(pCsr->pStmt, 1, pCsr->iFirstRowid); sqlite3_bind_int64(pCsr->pStmt, 2, pCsr->iLastRowid); } rc = fts5NextMethod(pCursor); } } pConfig->pzErrmsg = pzErrmsg; return rc; } /* ** This is the xEof method of the virtual table. SQLite calls this ** routine to find out if it has reached the end of a result set. */ static int fts5EofMethod(sqlite3_vtab_cursor *pCursor){ Fts5Cursor *pCsr = (Fts5Cursor*)pCursor; return (CsrFlagTest(pCsr, FTS5CSR_EOF) ? 1 : 0); } /* ** Return the rowid that the cursor currently points to. */ static i64 fts5CursorRowid(Fts5Cursor *pCsr){ assert( pCsr->ePlan==FTS5_PLAN_MATCH || pCsr->ePlan==FTS5_PLAN_SORTED_MATCH || pCsr->ePlan==FTS5_PLAN_SOURCE ); if( pCsr->pSorter ){ return pCsr->pSorter->iRowid; }else{ return sqlite3Fts5ExprRowid(pCsr->pExpr); } } /* ** This is the xRowid method. The SQLite core calls this routine to ** retrieve the rowid for the current row of the result set. fts5 ** exposes %_content.rowid as the rowid for the virtual table. The ** rowid should be written to *pRowid. */ static int fts5RowidMethod(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ Fts5Cursor *pCsr = (Fts5Cursor*)pCursor; int ePlan = pCsr->ePlan; assert( CsrFlagTest(pCsr, FTS5CSR_EOF)==0 ); switch( ePlan ){ case FTS5_PLAN_SPECIAL: *pRowid = 0; break; case FTS5_PLAN_SOURCE: case FTS5_PLAN_MATCH: case FTS5_PLAN_SORTED_MATCH: *pRowid = fts5CursorRowid(pCsr); break; default: *pRowid = sqlite3_column_int64(pCsr->pStmt, 0); break; } return SQLITE_OK; } /* ** If the cursor requires seeking (bSeekRequired flag is set), seek it. ** Return SQLITE_OK if no error occurs, or an SQLite error code otherwise. ** ** If argument bErrormsg is true and an error occurs, an error message may ** be left in sqlite3_vtab.zErrMsg. */ static int fts5SeekCursor(Fts5Cursor *pCsr, int bErrormsg){ int rc = SQLITE_OK; /* If the cursor does not yet have a statement handle, obtain one now. */ if( pCsr->pStmt==0 ){ Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab); int eStmt = fts5StmtType(pCsr); rc = sqlite3Fts5StorageStmt( pTab->pStorage, eStmt, &pCsr->pStmt, (bErrormsg?&pTab->base.zErrMsg:0) ); assert( rc!=SQLITE_OK || pTab->base.zErrMsg==0 ); assert( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_CONTENT) ); } if( rc==SQLITE_OK && CsrFlagTest(pCsr, FTS5CSR_REQUIRE_CONTENT) ){ assert( pCsr->pExpr ); sqlite3_reset(pCsr->pStmt); sqlite3_bind_int64(pCsr->pStmt, 1, fts5CursorRowid(pCsr)); rc = sqlite3_step(pCsr->pStmt); if( rc==SQLITE_ROW ){ rc = SQLITE_OK; CsrFlagClear(pCsr, FTS5CSR_REQUIRE_CONTENT); }else{ rc = sqlite3_reset(pCsr->pStmt); if( rc==SQLITE_OK ){ rc = FTS5_CORRUPT; } } } return rc; } static void fts5SetVtabError(Fts5Table *p, const char *zFormat, ...){ va_list ap; /* ... printf arguments */ va_start(ap, zFormat); assert( p->base.zErrMsg==0 ); p->base.zErrMsg = sqlite3_vmprintf(zFormat, ap); va_end(ap); } /* ** This function is called to handle an FTS INSERT command. In other words, ** an INSERT statement of the form: ** ** INSERT INTO fts(fts) VALUES($pCmd) ** INSERT INTO fts(fts, rank) VALUES($pCmd, $pVal) ** ** Argument pVal is the value assigned to column "fts" by the INSERT ** statement. This function returns SQLITE_OK if successful, or an SQLite ** error code if an error occurs. ** ** The commands implemented by this function are documented in the "Special ** INSERT Directives" section of the documentation. It should be updated if ** more commands are added to this function. */ static int fts5SpecialInsert( Fts5Table *pTab, /* Fts5 table object */ const char *zCmd, /* Text inserted into table-name column */ sqlite3_value *pVal /* Value inserted into rank column */ ){ Fts5Config *pConfig = pTab->pConfig; int rc = SQLITE_OK; int bError = 0; if( 0==sqlite3_stricmp("delete-all", zCmd) ){ if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ fts5SetVtabError(pTab, "'delete-all' may only be used with a " "contentless or external content fts5 table" ); rc = SQLITE_ERROR; }else{ rc = sqlite3Fts5StorageDeleteAll(pTab->pStorage); } }else if( 0==sqlite3_stricmp("rebuild", zCmd) ){ if( pConfig->eContent==FTS5_CONTENT_NONE ){ fts5SetVtabError(pTab, "'rebuild' may not be used with a contentless fts5 table" ); rc = SQLITE_ERROR; }else{ rc = sqlite3Fts5StorageRebuild(pTab->pStorage); } }else if( 0==sqlite3_stricmp("optimize", zCmd) ){ rc = sqlite3Fts5StorageOptimize(pTab->pStorage); }else if( 0==sqlite3_stricmp("merge", zCmd) ){ int nMerge = sqlite3_value_int(pVal); rc = sqlite3Fts5StorageMerge(pTab->pStorage, nMerge); }else if( 0==sqlite3_stricmp("integrity-check", zCmd) ){ rc = sqlite3Fts5StorageIntegrity(pTab->pStorage); #ifdef SQLITE_DEBUG }else if( 0==sqlite3_stricmp("prefix-index", zCmd) ){ pConfig->bPrefixIndex = sqlite3_value_int(pVal); #endif }else{ rc = sqlite3Fts5IndexLoadConfig(pTab->pIndex); if( rc==SQLITE_OK ){ rc = sqlite3Fts5ConfigSetValue(pTab->pConfig, zCmd, pVal, &bError); } if( rc==SQLITE_OK ){ if( bError ){ rc = SQLITE_ERROR; }else{ rc = sqlite3Fts5StorageConfigValue(pTab->pStorage, zCmd, pVal, 0); } } } return rc; } static int fts5SpecialDelete( Fts5Table *pTab, sqlite3_value **apVal ){ int rc = SQLITE_OK; int eType1 = sqlite3_value_type(apVal[1]); if( eType1==SQLITE_INTEGER ){ sqlite3_int64 iDel = sqlite3_value_int64(apVal[1]); rc = sqlite3Fts5StorageDelete(pTab->pStorage, iDel, &apVal[2]); } return rc; } static void fts5StorageInsert( int *pRc, Fts5Table *pTab, sqlite3_value **apVal, i64 *piRowid ){ int rc = *pRc; if( rc==SQLITE_OK ){ rc = sqlite3Fts5StorageContentInsert(pTab->pStorage, apVal, piRowid); } if( rc==SQLITE_OK ){ rc = sqlite3Fts5StorageIndexInsert(pTab->pStorage, apVal, *piRowid); } *pRc = rc; } /* ** This function is the implementation of the xUpdate callback used by ** FTS3 virtual tables. It is invoked by SQLite each time a row is to be ** inserted, updated or deleted. ** ** A delete specifies a single argument - the rowid of the row to remove. ** ** Update and insert operations pass: ** ** 1. The "old" rowid, or NULL. ** 2. The "new" rowid. ** 3. Values for each of the nCol matchable columns. ** 4. Values for the two hidden columns ( and "rank"). */ static int fts5UpdateMethod( sqlite3_vtab *pVtab, /* Virtual table handle */ int nArg, /* Size of argument array */ sqlite3_value **apVal, /* Array of arguments */ sqlite_int64 *pRowid /* OUT: The affected (or effected) rowid */ ){ Fts5Table *pTab = (Fts5Table*)pVtab; Fts5Config *pConfig = pTab->pConfig; int eType0; /* value_type() of apVal[0] */ int rc = SQLITE_OK; /* Return code */ /* A transaction must be open when this is called. */ assert( pTab->ts.eState==1 ); assert( pVtab->zErrMsg==0 ); assert( nArg==1 || nArg==(2+pConfig->nCol+2) ); assert( nArg==1 || sqlite3_value_type(apVal[1])==SQLITE_INTEGER || sqlite3_value_type(apVal[1])==SQLITE_NULL ); assert( pTab->pConfig->pzErrmsg==0 ); pTab->pConfig->pzErrmsg = &pTab->base.zErrMsg; /* Put any active cursors into REQUIRE_SEEK state. */ fts5TripCursors(pTab); eType0 = sqlite3_value_type(apVal[0]); if( eType0==SQLITE_NULL && sqlite3_value_type(apVal[2+pConfig->nCol])!=SQLITE_NULL ){ /* A "special" INSERT op. These are handled separately. */ const char *z = (const char*)sqlite3_value_text(apVal[2+pConfig->nCol]); if( pConfig->eContent!=FTS5_CONTENT_NORMAL && 0==sqlite3_stricmp("delete", z) ){ rc = fts5SpecialDelete(pTab, apVal); }else{ rc = fts5SpecialInsert(pTab, z, apVal[2 + pConfig->nCol + 1]); } }else{ /* A regular INSERT, UPDATE or DELETE statement. The trick here is that ** any conflict on the rowid value must be detected before any ** modifications are made to the database file. There are 4 cases: ** ** 1) DELETE ** 2) UPDATE (rowid not modified) ** 3) UPDATE (rowid modified) ** 4) INSERT ** ** Cases 3 and 4 may violate the rowid constraint. */ int eConflict = SQLITE_ABORT; if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ eConflict = sqlite3_vtab_on_conflict(pConfig->db); } assert( eType0==SQLITE_INTEGER || eType0==SQLITE_NULL ); assert( nArg!=1 || eType0==SQLITE_INTEGER ); /* Filter out attempts to run UPDATE or DELETE on contentless tables. ** This is not suported. */ if( eType0==SQLITE_INTEGER && fts5IsContentless(pTab) ){ pTab->base.zErrMsg = sqlite3_mprintf( "cannot %s contentless fts5 table: %s", (nArg>1 ? "UPDATE" : "DELETE from"), pConfig->zName ); rc = SQLITE_ERROR; } /* DELETE */ else if( nArg==1 ){ i64 iDel = sqlite3_value_int64(apVal[0]); /* Rowid to delete */ rc = sqlite3Fts5StorageDelete(pTab->pStorage, iDel, 0); } /* INSERT */ else if( eType0!=SQLITE_INTEGER ){ /* If this is a REPLACE, first remove the current entry (if any) */ if( eConflict==SQLITE_REPLACE && sqlite3_value_type(apVal[1])==SQLITE_INTEGER ){ i64 iNew = sqlite3_value_int64(apVal[1]); /* Rowid to delete */ rc = sqlite3Fts5StorageDelete(pTab->pStorage, iNew, 0); } fts5StorageInsert(&rc, pTab, apVal, pRowid); } /* UPDATE */ else{ i64 iOld = sqlite3_value_int64(apVal[0]); /* Old rowid */ i64 iNew = sqlite3_value_int64(apVal[1]); /* New rowid */ if( iOld!=iNew ){ if( eConflict==SQLITE_REPLACE ){ rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0); if( rc==SQLITE_OK ){ rc = sqlite3Fts5StorageDelete(pTab->pStorage, iNew, 0); } fts5StorageInsert(&rc, pTab, apVal, pRowid); }else{ rc = sqlite3Fts5StorageContentInsert(pTab->pStorage, apVal, pRowid); if( rc==SQLITE_OK ){ rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0); } if( rc==SQLITE_OK ){ rc = sqlite3Fts5StorageIndexInsert(pTab->pStorage, apVal, *pRowid); } } }else{ rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0); fts5StorageInsert(&rc, pTab, apVal, pRowid); } } } pTab->pConfig->pzErrmsg = 0; return rc; } /* ** Implementation of xSync() method. */ static int fts5SyncMethod(sqlite3_vtab *pVtab){ int rc; Fts5Table *pTab = (Fts5Table*)pVtab; fts5CheckTransactionState(pTab, FTS5_SYNC, 0); pTab->pConfig->pzErrmsg = &pTab->base.zErrMsg; fts5TripCursors(pTab); rc = sqlite3Fts5StorageSync(pTab->pStorage); pTab->pConfig->pzErrmsg = 0; return rc; } /* ** Implementation of xBegin() method. */ static int fts5BeginMethod(sqlite3_vtab *pVtab){ fts5CheckTransactionState((Fts5Table*)pVtab, FTS5_BEGIN, 0); fts5NewTransaction((Fts5Table*)pVtab); return SQLITE_OK; } /* ** Implementation of xCommit() method. This is a no-op. The contents of ** the pending-terms hash-table have already been flushed into the database ** by fts5SyncMethod(). */ static int fts5CommitMethod(sqlite3_vtab *pVtab){ UNUSED_PARAM(pVtab); /* Call below is a no-op for NDEBUG builds */ fts5CheckTransactionState((Fts5Table*)pVtab, FTS5_COMMIT, 0); return SQLITE_OK; } /* ** Implementation of xRollback(). Discard the contents of the pending-terms ** hash-table. Any changes made to the database are reverted by SQLite. */ static int fts5RollbackMethod(sqlite3_vtab *pVtab){ int rc; Fts5Table *pTab = (Fts5Table*)pVtab; fts5CheckTransactionState(pTab, FTS5_ROLLBACK, 0); rc = sqlite3Fts5StorageRollback(pTab->pStorage); return rc; } static int fts5CsrPoslist(Fts5Cursor*, int, const u8**, int*); static void *fts5ApiUserData(Fts5Context *pCtx){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; return pCsr->pAux->pUserData; } static int fts5ApiColumnCount(Fts5Context *pCtx){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; return ((Fts5Table*)(pCsr->base.pVtab))->pConfig->nCol; } static int fts5ApiColumnTotalSize( Fts5Context *pCtx, int iCol, sqlite3_int64 *pnToken ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab); return sqlite3Fts5StorageSize(pTab->pStorage, iCol, pnToken); } static int fts5ApiRowCount(Fts5Context *pCtx, i64 *pnRow){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab); return sqlite3Fts5StorageRowCount(pTab->pStorage, pnRow); } static int fts5ApiTokenize( Fts5Context *pCtx, const char *pText, int nText, void *pUserData, int (*xToken)(void*, int, const char*, int, int, int) ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab); return sqlite3Fts5Tokenize( pTab->pConfig, FTS5_TOKENIZE_AUX, pText, nText, pUserData, xToken ); } static int fts5ApiPhraseCount(Fts5Context *pCtx){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; return sqlite3Fts5ExprPhraseCount(pCsr->pExpr); } static int fts5ApiPhraseSize(Fts5Context *pCtx, int iPhrase){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; return sqlite3Fts5ExprPhraseSize(pCsr->pExpr, iPhrase); } static int fts5ApiColumnText( Fts5Context *pCtx, int iCol, const char **pz, int *pn ){ int rc = SQLITE_OK; Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; if( fts5IsContentless((Fts5Table*)(pCsr->base.pVtab)) ){ *pz = 0; *pn = 0; }else{ rc = fts5SeekCursor(pCsr, 0); if( rc==SQLITE_OK ){ *pz = (const char*)sqlite3_column_text(pCsr->pStmt, iCol+1); *pn = sqlite3_column_bytes(pCsr->pStmt, iCol+1); } } return rc; } static int fts5CsrPoslist( Fts5Cursor *pCsr, int iPhrase, const u8 **pa, int *pn ){ Fts5Config *pConfig = ((Fts5Table*)(pCsr->base.pVtab))->pConfig; int rc = SQLITE_OK; int bLive = (pCsr->pSorter==0); if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_POSLIST) ){ if( pConfig->eDetail!=FTS5_DETAIL_FULL ){ Fts5PoslistPopulator *aPopulator; int i; aPopulator = sqlite3Fts5ExprClearPoslists(pCsr->pExpr, bLive); if( aPopulator==0 ) rc = SQLITE_NOMEM; for(i=0; inCol && rc==SQLITE_OK; i++){ int n; const char *z; rc = fts5ApiColumnText((Fts5Context*)pCsr, i, &z, &n); if( rc==SQLITE_OK ){ rc = sqlite3Fts5ExprPopulatePoslists( pConfig, pCsr->pExpr, aPopulator, i, z, n ); } } sqlite3_free(aPopulator); if( pCsr->pSorter ){ sqlite3Fts5ExprCheckPoslists(pCsr->pExpr, pCsr->pSorter->iRowid); } } CsrFlagClear(pCsr, FTS5CSR_REQUIRE_POSLIST); } if( pCsr->pSorter && pConfig->eDetail==FTS5_DETAIL_FULL ){ Fts5Sorter *pSorter = pCsr->pSorter; int i1 = (iPhrase==0 ? 0 : pSorter->aIdx[iPhrase-1]); *pn = pSorter->aIdx[iPhrase] - i1; *pa = &pSorter->aPoslist[i1]; }else{ *pn = sqlite3Fts5ExprPoslist(pCsr->pExpr, iPhrase, pa); } return rc; } /* ** Ensure that the Fts5Cursor.nInstCount and aInst[] variables are populated ** correctly for the current view. Return SQLITE_OK if successful, or an ** SQLite error code otherwise. */ static int fts5CacheInstArray(Fts5Cursor *pCsr){ int rc = SQLITE_OK; Fts5PoslistReader *aIter; /* One iterator for each phrase */ int nIter; /* Number of iterators/phrases */ nIter = sqlite3Fts5ExprPhraseCount(pCsr->pExpr); if( pCsr->aInstIter==0 ){ int nByte = sizeof(Fts5PoslistReader) * nIter; pCsr->aInstIter = (Fts5PoslistReader*)sqlite3Fts5MallocZero(&rc, nByte); } aIter = pCsr->aInstIter; if( aIter ){ int nInst = 0; /* Number instances seen so far */ int i; /* Initialize all iterators */ for(i=0; i=pCsr->nInstAlloc ){ pCsr->nInstAlloc = pCsr->nInstAlloc ? pCsr->nInstAlloc*2 : 32; aInst = (int*)sqlite3_realloc( pCsr->aInst, pCsr->nInstAlloc*sizeof(int)*3 ); if( aInst ){ pCsr->aInst = aInst; }else{ rc = SQLITE_NOMEM; break; } } aInst = &pCsr->aInst[3 * (nInst-1)]; aInst[0] = iBest; aInst[1] = FTS5_POS2COLUMN(aIter[iBest].iPos); aInst[2] = FTS5_POS2OFFSET(aIter[iBest].iPos); sqlite3Fts5PoslistReaderNext(&aIter[iBest]); } } pCsr->nInstCount = nInst; CsrFlagClear(pCsr, FTS5CSR_REQUIRE_INST); } return rc; } static int fts5ApiInstCount(Fts5Context *pCtx, int *pnInst){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; int rc = SQLITE_OK; if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_INST)==0 || SQLITE_OK==(rc = fts5CacheInstArray(pCsr)) ){ *pnInst = pCsr->nInstCount; } return rc; } static int fts5ApiInst( Fts5Context *pCtx, int iIdx, int *piPhrase, int *piCol, int *piOff ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; int rc = SQLITE_OK; if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_INST)==0 || SQLITE_OK==(rc = fts5CacheInstArray(pCsr)) ){ if( iIdx<0 || iIdx>=pCsr->nInstCount ){ rc = SQLITE_RANGE; #if 0 }else if( fts5IsOffsetless((Fts5Table*)pCsr->base.pVtab) ){ *piPhrase = pCsr->aInst[iIdx*3]; *piCol = pCsr->aInst[iIdx*3 + 2]; *piOff = -1; #endif }else{ *piPhrase = pCsr->aInst[iIdx*3]; *piCol = pCsr->aInst[iIdx*3 + 1]; *piOff = pCsr->aInst[iIdx*3 + 2]; } } return rc; } static sqlite3_int64 fts5ApiRowid(Fts5Context *pCtx){ return fts5CursorRowid((Fts5Cursor*)pCtx); } static int fts5ColumnSizeCb( void *pContext, /* Pointer to int */ int tflags, const char *pUnused, /* Buffer containing token */ int nUnused, /* Size of token in bytes */ int iUnused1, /* Start offset of token */ int iUnused2 /* End offset of token */ ){ int *pCnt = (int*)pContext; UNUSED_PARAM2(pUnused, nUnused); UNUSED_PARAM2(iUnused1, iUnused2); if( (tflags & FTS5_TOKEN_COLOCATED)==0 ){ (*pCnt)++; } return SQLITE_OK; } static int fts5ApiColumnSize(Fts5Context *pCtx, int iCol, int *pnToken){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab); Fts5Config *pConfig = pTab->pConfig; int rc = SQLITE_OK; if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_DOCSIZE) ){ if( pConfig->bColumnsize ){ i64 iRowid = fts5CursorRowid(pCsr); rc = sqlite3Fts5StorageDocsize(pTab->pStorage, iRowid, pCsr->aColumnSize); }else if( pConfig->zContent==0 ){ int i; for(i=0; inCol; i++){ if( pConfig->abUnindexed[i]==0 ){ pCsr->aColumnSize[i] = -1; } } }else{ int i; for(i=0; rc==SQLITE_OK && inCol; i++){ if( pConfig->abUnindexed[i]==0 ){ const char *z; int n; void *p = (void*)(&pCsr->aColumnSize[i]); pCsr->aColumnSize[i] = 0; rc = fts5ApiColumnText(pCtx, i, &z, &n); if( rc==SQLITE_OK ){ rc = sqlite3Fts5Tokenize( pConfig, FTS5_TOKENIZE_AUX, z, n, p, fts5ColumnSizeCb ); } } } } CsrFlagClear(pCsr, FTS5CSR_REQUIRE_DOCSIZE); } if( iCol<0 ){ int i; *pnToken = 0; for(i=0; inCol; i++){ *pnToken += pCsr->aColumnSize[i]; } }else if( iColnCol ){ *pnToken = pCsr->aColumnSize[iCol]; }else{ *pnToken = 0; rc = SQLITE_RANGE; } return rc; } /* ** Implementation of the xSetAuxdata() method. */ static int fts5ApiSetAuxdata( Fts5Context *pCtx, /* Fts5 context */ void *pPtr, /* Pointer to save as auxdata */ void(*xDelete)(void*) /* Destructor for pPtr (or NULL) */ ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; Fts5Auxdata *pData; /* Search through the cursors list of Fts5Auxdata objects for one that ** corresponds to the currently executing auxiliary function. */ for(pData=pCsr->pAuxdata; pData; pData=pData->pNext){ if( pData->pAux==pCsr->pAux ) break; } if( pData ){ if( pData->xDelete ){ pData->xDelete(pData->pPtr); } }else{ int rc = SQLITE_OK; pData = (Fts5Auxdata*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5Auxdata)); if( pData==0 ){ if( xDelete ) xDelete(pPtr); return rc; } pData->pAux = pCsr->pAux; pData->pNext = pCsr->pAuxdata; pCsr->pAuxdata = pData; } pData->xDelete = xDelete; pData->pPtr = pPtr; return SQLITE_OK; } static void *fts5ApiGetAuxdata(Fts5Context *pCtx, int bClear){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; Fts5Auxdata *pData; void *pRet = 0; for(pData=pCsr->pAuxdata; pData; pData=pData->pNext){ if( pData->pAux==pCsr->pAux ) break; } if( pData ){ pRet = pData->pPtr; if( bClear ){ pData->pPtr = 0; pData->xDelete = 0; } } return pRet; } static void fts5ApiPhraseNext( Fts5Context *pUnused, Fts5PhraseIter *pIter, int *piCol, int *piOff ){ UNUSED_PARAM(pUnused); if( pIter->a>=pIter->b ){ *piCol = -1; *piOff = -1; }else{ int iVal; pIter->a += fts5GetVarint32(pIter->a, iVal); if( iVal==1 ){ pIter->a += fts5GetVarint32(pIter->a, iVal); *piCol = iVal; *piOff = 0; pIter->a += fts5GetVarint32(pIter->a, iVal); } *piOff += (iVal-2); } } static int fts5ApiPhraseFirst( Fts5Context *pCtx, int iPhrase, Fts5PhraseIter *pIter, int *piCol, int *piOff ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; int n; int rc = fts5CsrPoslist(pCsr, iPhrase, &pIter->a, &n); if( rc==SQLITE_OK ){ pIter->b = &pIter->a[n]; *piCol = 0; *piOff = 0; fts5ApiPhraseNext(pCtx, pIter, piCol, piOff); } return rc; } static void fts5ApiPhraseNextColumn( Fts5Context *pCtx, Fts5PhraseIter *pIter, int *piCol ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; Fts5Config *pConfig = ((Fts5Table*)(pCsr->base.pVtab))->pConfig; if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){ if( pIter->a>=pIter->b ){ *piCol = -1; }else{ int iIncr; pIter->a += fts5GetVarint32(&pIter->a[0], iIncr); *piCol += (iIncr-2); } }else{ while( 1 ){ int dummy; if( pIter->a>=pIter->b ){ *piCol = -1; return; } if( pIter->a[0]==0x01 ) break; pIter->a += fts5GetVarint32(pIter->a, dummy); } pIter->a += 1 + fts5GetVarint32(&pIter->a[1], *piCol); } } static int fts5ApiPhraseFirstColumn( Fts5Context *pCtx, int iPhrase, Fts5PhraseIter *pIter, int *piCol ){ int rc = SQLITE_OK; Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; Fts5Config *pConfig = ((Fts5Table*)(pCsr->base.pVtab))->pConfig; if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){ Fts5Sorter *pSorter = pCsr->pSorter; int n; if( pSorter ){ int i1 = (iPhrase==0 ? 0 : pSorter->aIdx[iPhrase-1]); n = pSorter->aIdx[iPhrase] - i1; pIter->a = &pSorter->aPoslist[i1]; }else{ rc = sqlite3Fts5ExprPhraseCollist(pCsr->pExpr, iPhrase, &pIter->a, &n); } if( rc==SQLITE_OK ){ pIter->b = &pIter->a[n]; *piCol = 0; fts5ApiPhraseNextColumn(pCtx, pIter, piCol); } }else{ int n; rc = fts5CsrPoslist(pCsr, iPhrase, &pIter->a, &n); if( rc==SQLITE_OK ){ pIter->b = &pIter->a[n]; if( n<=0 ){ *piCol = -1; }else if( pIter->a[0]==0x01 ){ pIter->a += 1 + fts5GetVarint32(&pIter->a[1], *piCol); }else{ *piCol = 0; } } } return rc; } static int fts5ApiQueryPhrase(Fts5Context*, int, void*, int(*)(const Fts5ExtensionApi*, Fts5Context*, void*) ); static const Fts5ExtensionApi sFts5Api = { 2, /* iVersion */ fts5ApiUserData, fts5ApiColumnCount, fts5ApiRowCount, fts5ApiColumnTotalSize, fts5ApiTokenize, fts5ApiPhraseCount, fts5ApiPhraseSize, fts5ApiInstCount, fts5ApiInst, fts5ApiRowid, fts5ApiColumnText, fts5ApiColumnSize, fts5ApiQueryPhrase, fts5ApiSetAuxdata, fts5ApiGetAuxdata, fts5ApiPhraseFirst, fts5ApiPhraseNext, fts5ApiPhraseFirstColumn, fts5ApiPhraseNextColumn, }; /* ** Implementation of API function xQueryPhrase(). */ static int fts5ApiQueryPhrase( Fts5Context *pCtx, int iPhrase, void *pUserData, int(*xCallback)(const Fts5ExtensionApi*, Fts5Context*, void*) ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab); int rc; Fts5Cursor *pNew = 0; rc = fts5OpenMethod(pCsr->base.pVtab, (sqlite3_vtab_cursor**)&pNew); if( rc==SQLITE_OK ){ pNew->ePlan = FTS5_PLAN_MATCH; pNew->iFirstRowid = SMALLEST_INT64; pNew->iLastRowid = LARGEST_INT64; pNew->base.pVtab = (sqlite3_vtab*)pTab; rc = sqlite3Fts5ExprClonePhrase(pCsr->pExpr, iPhrase, &pNew->pExpr); } if( rc==SQLITE_OK ){ for(rc = fts5CursorFirst(pTab, pNew, 0); rc==SQLITE_OK && CsrFlagTest(pNew, FTS5CSR_EOF)==0; rc = fts5NextMethod((sqlite3_vtab_cursor*)pNew) ){ rc = xCallback(&sFts5Api, (Fts5Context*)pNew, pUserData); if( rc!=SQLITE_OK ){ if( rc==SQLITE_DONE ) rc = SQLITE_OK; break; } } } fts5CloseMethod((sqlite3_vtab_cursor*)pNew); return rc; } static void fts5ApiInvoke( Fts5Auxiliary *pAux, Fts5Cursor *pCsr, sqlite3_context *context, int argc, sqlite3_value **argv ){ assert( pCsr->pAux==0 ); pCsr->pAux = pAux; pAux->xFunc(&sFts5Api, (Fts5Context*)pCsr, context, argc, argv); pCsr->pAux = 0; } static Fts5Cursor *fts5CursorFromCsrid(Fts5Global *pGlobal, i64 iCsrId){ Fts5Cursor *pCsr; for(pCsr=pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){ if( pCsr->iCsrId==iCsrId ) break; } return pCsr; } static void fts5ApiCallback( sqlite3_context *context, int argc, sqlite3_value **argv ){ Fts5Auxiliary *pAux; Fts5Cursor *pCsr; i64 iCsrId; assert( argc>=1 ); pAux = (Fts5Auxiliary*)sqlite3_user_data(context); iCsrId = sqlite3_value_int64(argv[0]); pCsr = fts5CursorFromCsrid(pAux->pGlobal, iCsrId); if( pCsr==0 ){ char *zErr = sqlite3_mprintf("no such cursor: %lld", iCsrId); sqlite3_result_error(context, zErr, -1); sqlite3_free(zErr); }else{ fts5ApiInvoke(pAux, pCsr, context, argc-1, &argv[1]); } } /* ** Given cursor id iId, return a pointer to the corresponding Fts5Index ** object. Or NULL If the cursor id does not exist. ** ** If successful, set *ppConfig to point to the associated config object ** before returning. */ Fts5Index *sqlite3Fts5IndexFromCsrid( Fts5Global *pGlobal, /* FTS5 global context for db handle */ i64 iCsrId, /* Id of cursor to find */ Fts5Config **ppConfig /* OUT: Configuration object */ ){ Fts5Cursor *pCsr; Fts5Table *pTab; pCsr = fts5CursorFromCsrid(pGlobal, iCsrId); pTab = (Fts5Table*)pCsr->base.pVtab; *ppConfig = pTab->pConfig; return pTab->pIndex; } /* ** Return a "position-list blob" corresponding to the current position of ** cursor pCsr via sqlite3_result_blob(). A position-list blob contains ** the current position-list for each phrase in the query associated with ** cursor pCsr. ** ** A position-list blob begins with (nPhrase-1) varints, where nPhrase is ** the number of phrases in the query. Following the varints are the ** concatenated position lists for each phrase, in order. ** ** The first varint (if it exists) contains the size of the position list ** for phrase 0. The second (same disclaimer) contains the size of position ** list 1. And so on. There is no size field for the final position list, ** as it can be derived from the total size of the blob. */ static int fts5PoslistBlob(sqlite3_context *pCtx, Fts5Cursor *pCsr){ int i; int rc = SQLITE_OK; int nPhrase = sqlite3Fts5ExprPhraseCount(pCsr->pExpr); Fts5Buffer val; memset(&val, 0, sizeof(Fts5Buffer)); switch( ((Fts5Table*)(pCsr->base.pVtab))->pConfig->eDetail ){ case FTS5_DETAIL_FULL: /* Append the varints */ for(i=0; i<(nPhrase-1); i++){ const u8 *dummy; int nByte = sqlite3Fts5ExprPoslist(pCsr->pExpr, i, &dummy); sqlite3Fts5BufferAppendVarint(&rc, &val, nByte); } /* Append the position lists */ for(i=0; ipExpr, i, &pPoslist); sqlite3Fts5BufferAppendBlob(&rc, &val, nPoslist, pPoslist); } break; case FTS5_DETAIL_COLUMNS: /* Append the varints */ for(i=0; rc==SQLITE_OK && i<(nPhrase-1); i++){ const u8 *dummy; int nByte; rc = sqlite3Fts5ExprPhraseCollist(pCsr->pExpr, i, &dummy, &nByte); sqlite3Fts5BufferAppendVarint(&rc, &val, nByte); } /* Append the position lists */ for(i=0; rc==SQLITE_OK && ipExpr, i, &pPoslist, &nPoslist); sqlite3Fts5BufferAppendBlob(&rc, &val, nPoslist, pPoslist); } break; default: break; } sqlite3_result_blob(pCtx, val.p, val.n, sqlite3_free); return rc; } /* ** This is the xColumn method, called by SQLite to request a value from ** the row that the supplied cursor currently points to. */ static int fts5ColumnMethod( sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ sqlite3_context *pCtx, /* Context for sqlite3_result_xxx() calls */ int iCol /* Index of column to read value from */ ){ Fts5Table *pTab = (Fts5Table*)(pCursor->pVtab); Fts5Config *pConfig = pTab->pConfig; Fts5Cursor *pCsr = (Fts5Cursor*)pCursor; int rc = SQLITE_OK; assert( CsrFlagTest(pCsr, FTS5CSR_EOF)==0 ); if( pCsr->ePlan==FTS5_PLAN_SPECIAL ){ if( iCol==pConfig->nCol ){ sqlite3_result_int64(pCtx, pCsr->iSpecial); } }else if( iCol==pConfig->nCol ){ /* User is requesting the value of the special column with the same name ** as the table. Return the cursor integer id number. This value is only ** useful in that it may be passed as the first argument to an FTS5 ** auxiliary function. */ sqlite3_result_int64(pCtx, pCsr->iCsrId); }else if( iCol==pConfig->nCol+1 ){ /* The value of the "rank" column. */ if( pCsr->ePlan==FTS5_PLAN_SOURCE ){ fts5PoslistBlob(pCtx, pCsr); }else if( pCsr->ePlan==FTS5_PLAN_MATCH || pCsr->ePlan==FTS5_PLAN_SORTED_MATCH ){ if( pCsr->pRank || SQLITE_OK==(rc = fts5FindRankFunction(pCsr)) ){ fts5ApiInvoke(pCsr->pRank, pCsr, pCtx, pCsr->nRankArg, pCsr->apRankArg); } } }else if( !fts5IsContentless(pTab) ){ rc = fts5SeekCursor(pCsr, 1); if( rc==SQLITE_OK ){ sqlite3_result_value(pCtx, sqlite3_column_value(pCsr->pStmt, iCol+1)); } } return rc; } /* ** This routine implements the xFindFunction method for the FTS3 ** virtual table. */ static int fts5FindFunctionMethod( sqlite3_vtab *pVtab, /* Virtual table handle */ int nUnused, /* Number of SQL function arguments */ const char *zName, /* Name of SQL function */ void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), /* OUT: Result */ void **ppArg /* OUT: User data for *pxFunc */ ){ Fts5Table *pTab = (Fts5Table*)pVtab; Fts5Auxiliary *pAux; UNUSED_PARAM(nUnused); pAux = fts5FindAuxiliary(pTab, zName); if( pAux ){ *pxFunc = fts5ApiCallback; *ppArg = (void*)pAux; return 1; } /* No function of the specified name was found. Return 0. */ return 0; } /* ** Implementation of FTS5 xRename method. Rename an fts5 table. */ static int fts5RenameMethod( sqlite3_vtab *pVtab, /* Virtual table handle */ const char *zName /* New name of table */ ){ Fts5Table *pTab = (Fts5Table*)pVtab; return sqlite3Fts5StorageRename(pTab->pStorage, zName); } /* ** The xSavepoint() method. ** ** Flush the contents of the pending-terms table to disk. */ static int fts5SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){ Fts5Table *pTab = (Fts5Table*)pVtab; UNUSED_PARAM(iSavepoint); /* Call below is a no-op for NDEBUG builds */ fts5CheckTransactionState(pTab, FTS5_SAVEPOINT, iSavepoint); fts5TripCursors(pTab); return sqlite3Fts5StorageSync(pTab->pStorage); } /* ** The xRelease() method. ** ** This is a no-op. */ static int fts5ReleaseMethod(sqlite3_vtab *pVtab, int iSavepoint){ Fts5Table *pTab = (Fts5Table*)pVtab; UNUSED_PARAM(iSavepoint); /* Call below is a no-op for NDEBUG builds */ fts5CheckTransactionState(pTab, FTS5_RELEASE, iSavepoint); fts5TripCursors(pTab); return sqlite3Fts5StorageSync(pTab->pStorage); } /* ** The xRollbackTo() method. ** ** Discard the contents of the pending terms table. */ static int fts5RollbackToMethod(sqlite3_vtab *pVtab, int iSavepoint){ Fts5Table *pTab = (Fts5Table*)pVtab; UNUSED_PARAM(iSavepoint); /* Call below is a no-op for NDEBUG builds */ fts5CheckTransactionState(pTab, FTS5_ROLLBACKTO, iSavepoint); fts5TripCursors(pTab); return sqlite3Fts5StorageRollback(pTab->pStorage); } /* ** Register a new auxiliary function with global context pGlobal. */ static int fts5CreateAux( fts5_api *pApi, /* Global context (one per db handle) */ const char *zName, /* Name of new function */ void *pUserData, /* User data for aux. function */ fts5_extension_function xFunc, /* Aux. function implementation */ void(*xDestroy)(void*) /* Destructor for pUserData */ ){ Fts5Global *pGlobal = (Fts5Global*)pApi; int rc = sqlite3_overload_function(pGlobal->db, zName, -1); if( rc==SQLITE_OK ){ Fts5Auxiliary *pAux; int nName; /* Size of zName in bytes, including \0 */ int nByte; /* Bytes of space to allocate */ nName = (int)strlen(zName) + 1; nByte = sizeof(Fts5Auxiliary) + nName; pAux = (Fts5Auxiliary*)sqlite3_malloc(nByte); if( pAux ){ memset(pAux, 0, nByte); pAux->zFunc = (char*)&pAux[1]; memcpy(pAux->zFunc, zName, nName); pAux->pGlobal = pGlobal; pAux->pUserData = pUserData; pAux->xFunc = xFunc; pAux->xDestroy = xDestroy; pAux->pNext = pGlobal->pAux; pGlobal->pAux = pAux; }else{ rc = SQLITE_NOMEM; } } return rc; } /* ** Register a new tokenizer. This is the implementation of the ** fts5_api.xCreateTokenizer() method. */ static int fts5CreateTokenizer( fts5_api *pApi, /* Global context (one per db handle) */ const char *zName, /* Name of new function */ void *pUserData, /* User data for aux. function */ fts5_tokenizer *pTokenizer, /* Tokenizer implementation */ void(*xDestroy)(void*) /* Destructor for pUserData */ ){ Fts5Global *pGlobal = (Fts5Global*)pApi; Fts5TokenizerModule *pNew; int nName; /* Size of zName and its \0 terminator */ int nByte; /* Bytes of space to allocate */ int rc = SQLITE_OK; nName = (int)strlen(zName) + 1; nByte = sizeof(Fts5TokenizerModule) + nName; pNew = (Fts5TokenizerModule*)sqlite3_malloc(nByte); if( pNew ){ memset(pNew, 0, nByte); pNew->zName = (char*)&pNew[1]; memcpy(pNew->zName, zName, nName); pNew->pUserData = pUserData; pNew->x = *pTokenizer; pNew->xDestroy = xDestroy; pNew->pNext = pGlobal->pTok; pGlobal->pTok = pNew; if( pNew->pNext==0 ){ pGlobal->pDfltTok = pNew; } }else{ rc = SQLITE_NOMEM; } return rc; } static Fts5TokenizerModule *fts5LocateTokenizer( Fts5Global *pGlobal, const char *zName ){ Fts5TokenizerModule *pMod = 0; if( zName==0 ){ pMod = pGlobal->pDfltTok; }else{ for(pMod=pGlobal->pTok; pMod; pMod=pMod->pNext){ if( sqlite3_stricmp(zName, pMod->zName)==0 ) break; } } return pMod; } /* ** Find a tokenizer. This is the implementation of the ** fts5_api.xFindTokenizer() method. */ static int fts5FindTokenizer( fts5_api *pApi, /* Global context (one per db handle) */ const char *zName, /* Name of new function */ void **ppUserData, fts5_tokenizer *pTokenizer /* Populate this object */ ){ int rc = SQLITE_OK; Fts5TokenizerModule *pMod; pMod = fts5LocateTokenizer((Fts5Global*)pApi, zName); if( pMod ){ *pTokenizer = pMod->x; *ppUserData = pMod->pUserData; }else{ memset(pTokenizer, 0, sizeof(fts5_tokenizer)); rc = SQLITE_ERROR; } return rc; } int sqlite3Fts5GetTokenizer( Fts5Global *pGlobal, const char **azArg, int nArg, Fts5Tokenizer **ppTok, fts5_tokenizer **ppTokApi, char **pzErr ){ Fts5TokenizerModule *pMod; int rc = SQLITE_OK; pMod = fts5LocateTokenizer(pGlobal, nArg==0 ? 0 : azArg[0]); if( pMod==0 ){ assert( nArg>0 ); rc = SQLITE_ERROR; *pzErr = sqlite3_mprintf("no such tokenizer: %s", azArg[0]); }else{ rc = pMod->x.xCreate(pMod->pUserData, &azArg[1], (nArg?nArg-1:0), ppTok); *ppTokApi = &pMod->x; if( rc!=SQLITE_OK && pzErr ){ *pzErr = sqlite3_mprintf("error in tokenizer constructor"); } } if( rc!=SQLITE_OK ){ *ppTokApi = 0; *ppTok = 0; } return rc; } static void fts5ModuleDestroy(void *pCtx){ Fts5TokenizerModule *pTok, *pNextTok; Fts5Auxiliary *pAux, *pNextAux; Fts5Global *pGlobal = (Fts5Global*)pCtx; for(pAux=pGlobal->pAux; pAux; pAux=pNextAux){ pNextAux = pAux->pNext; if( pAux->xDestroy ) pAux->xDestroy(pAux->pUserData); sqlite3_free(pAux); } for(pTok=pGlobal->pTok; pTok; pTok=pNextTok){ pNextTok = pTok->pNext; if( pTok->xDestroy ) pTok->xDestroy(pTok->pUserData); sqlite3_free(pTok); } sqlite3_free(pGlobal); } static void fts5Fts5Func( sqlite3_context *pCtx, /* Function call context */ int nArg, /* Number of args */ sqlite3_value **apArg /* Function arguments */ ){ Fts5Global *pGlobal = (Fts5Global*)sqlite3_user_data(pCtx); fts5_api **ppApi; UNUSED_PARAM(nArg); assert( nArg==1 ); ppApi = (fts5_api**)sqlite3_value_pointer(apArg[0], "fts5_api_ptr"); if( ppApi ) *ppApi = &pGlobal->api; } /* ** Implementation of fts5_source_id() function. */ static void fts5SourceIdFunc( sqlite3_context *pCtx, /* Function call context */ int nArg, /* Number of args */ sqlite3_value **apUnused /* Function arguments */ ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); sqlite3_result_text(pCtx, "--FTS5-SOURCE-ID--", -1, SQLITE_TRANSIENT); } static int fts5Init(sqlite3 *db){ static const sqlite3_module fts5Mod = { /* iVersion */ 2, /* xCreate */ fts5CreateMethod, /* xConnect */ fts5ConnectMethod, /* xBestIndex */ fts5BestIndexMethod, /* xDisconnect */ fts5DisconnectMethod, /* xDestroy */ fts5DestroyMethod, /* xOpen */ fts5OpenMethod, /* xClose */ fts5CloseMethod, /* xFilter */ fts5FilterMethod, /* xNext */ fts5NextMethod, /* xEof */ fts5EofMethod, /* xColumn */ fts5ColumnMethod, /* xRowid */ fts5RowidMethod, /* xUpdate */ fts5UpdateMethod, /* xBegin */ fts5BeginMethod, /* xSync */ fts5SyncMethod, /* xCommit */ fts5CommitMethod, /* xRollback */ fts5RollbackMethod, /* xFindFunction */ fts5FindFunctionMethod, /* xRename */ fts5RenameMethod, /* xSavepoint */ fts5SavepointMethod, /* xRelease */ fts5ReleaseMethod, /* xRollbackTo */ fts5RollbackToMethod, }; int rc; Fts5Global *pGlobal = 0; pGlobal = (Fts5Global*)sqlite3_malloc(sizeof(Fts5Global)); if( pGlobal==0 ){ rc = SQLITE_NOMEM; }else{ void *p = (void*)pGlobal; memset(pGlobal, 0, sizeof(Fts5Global)); pGlobal->db = db; pGlobal->api.iVersion = 2; pGlobal->api.xCreateFunction = fts5CreateAux; pGlobal->api.xCreateTokenizer = fts5CreateTokenizer; pGlobal->api.xFindTokenizer = fts5FindTokenizer; rc = sqlite3_create_module_v2(db, "fts5", &fts5Mod, p, fts5ModuleDestroy); if( rc==SQLITE_OK ) rc = sqlite3Fts5IndexInit(db); if( rc==SQLITE_OK ) rc = sqlite3Fts5ExprInit(pGlobal, db); if( rc==SQLITE_OK ) rc = sqlite3Fts5AuxInit(&pGlobal->api); if( rc==SQLITE_OK ) rc = sqlite3Fts5TokenizerInit(&pGlobal->api); if( rc==SQLITE_OK ) rc = sqlite3Fts5VocabInit(pGlobal, db); if( rc==SQLITE_OK ){ rc = sqlite3_create_function( db, "fts5", 1, SQLITE_UTF8, p, fts5Fts5Func, 0, 0 ); } if( rc==SQLITE_OK ){ rc = sqlite3_create_function( db, "fts5_source_id", 0, SQLITE_UTF8, p, fts5SourceIdFunc, 0, 0 ); } } /* If SQLITE_FTS5_ENABLE_TEST_MI is defined, assume that the file ** fts5_test_mi.c is compiled and linked into the executable. And call ** its entry point to enable the matchinfo() demo. */ #ifdef SQLITE_FTS5_ENABLE_TEST_MI if( rc==SQLITE_OK ){ extern int sqlite3Fts5TestRegisterMatchinfo(sqlite3*); rc = sqlite3Fts5TestRegisterMatchinfo(db); } #endif return rc; } /* ** The following functions are used to register the module with SQLite. If ** this module is being built as part of the SQLite core (SQLITE_CORE is ** defined), then sqlite3_open() will call sqlite3Fts5Init() directly. ** ** Or, if this module is being built as a loadable extension, ** sqlite3Fts5Init() is omitted and the two standard entry points ** sqlite3_fts_init() and sqlite3_fts5_init() defined instead. */ #ifndef SQLITE_CORE #ifdef _WIN32 __declspec(dllexport) #endif int sqlite3_fts_init( sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ return fts5Init(db); } #ifdef _WIN32 __declspec(dllexport) #endif int sqlite3_fts5_init( sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ return fts5Init(db); } #else int sqlite3Fts5Init(sqlite3 *db){ return fts5Init(db); } #endif ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_storage.c ================================================ /* ** 2014 May 31 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** */ #include "fts5Int.h" struct Fts5Storage { Fts5Config *pConfig; Fts5Index *pIndex; int bTotalsValid; /* True if nTotalRow/aTotalSize[] are valid */ i64 nTotalRow; /* Total number of rows in FTS table */ i64 *aTotalSize; /* Total sizes of each column */ sqlite3_stmt *aStmt[11]; }; #if FTS5_STMT_SCAN_ASC!=0 # error "FTS5_STMT_SCAN_ASC mismatch" #endif #if FTS5_STMT_SCAN_DESC!=1 # error "FTS5_STMT_SCAN_DESC mismatch" #endif #if FTS5_STMT_LOOKUP!=2 # error "FTS5_STMT_LOOKUP mismatch" #endif #define FTS5_STMT_INSERT_CONTENT 3 #define FTS5_STMT_REPLACE_CONTENT 4 #define FTS5_STMT_DELETE_CONTENT 5 #define FTS5_STMT_REPLACE_DOCSIZE 6 #define FTS5_STMT_DELETE_DOCSIZE 7 #define FTS5_STMT_LOOKUP_DOCSIZE 8 #define FTS5_STMT_REPLACE_CONFIG 9 #define FTS5_STMT_SCAN 10 /* ** Prepare the two insert statements - Fts5Storage.pInsertContent and ** Fts5Storage.pInsertDocsize - if they have not already been prepared. ** Return SQLITE_OK if successful, or an SQLite error code if an error ** occurs. */ static int fts5StorageGetStmt( Fts5Storage *p, /* Storage handle */ int eStmt, /* FTS5_STMT_XXX constant */ sqlite3_stmt **ppStmt, /* OUT: Prepared statement handle */ char **pzErrMsg /* OUT: Error message (if any) */ ){ int rc = SQLITE_OK; /* If there is no %_docsize table, there should be no requests for ** statements to operate on it. */ assert( p->pConfig->bColumnsize || ( eStmt!=FTS5_STMT_REPLACE_DOCSIZE && eStmt!=FTS5_STMT_DELETE_DOCSIZE && eStmt!=FTS5_STMT_LOOKUP_DOCSIZE )); assert( eStmt>=0 && eStmtaStmt) ); if( p->aStmt[eStmt]==0 ){ const char *azStmt[] = { "SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC", "SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC", "SELECT %s FROM %s T WHERE T.%Q=?", /* LOOKUP */ "INSERT INTO %Q.'%q_content' VALUES(%s)", /* INSERT_CONTENT */ "REPLACE INTO %Q.'%q_content' VALUES(%s)", /* REPLACE_CONTENT */ "DELETE FROM %Q.'%q_content' WHERE id=?", /* DELETE_CONTENT */ "REPLACE INTO %Q.'%q_docsize' VALUES(?,?)", /* REPLACE_DOCSIZE */ "DELETE FROM %Q.'%q_docsize' WHERE id=?", /* DELETE_DOCSIZE */ "SELECT sz FROM %Q.'%q_docsize' WHERE id=?", /* LOOKUP_DOCSIZE */ "REPLACE INTO %Q.'%q_config' VALUES(?,?)", /* REPLACE_CONFIG */ "SELECT %s FROM %s AS T", /* SCAN */ }; Fts5Config *pC = p->pConfig; char *zSql = 0; switch( eStmt ){ case FTS5_STMT_SCAN: zSql = sqlite3_mprintf(azStmt[eStmt], pC->zContentExprlist, pC->zContent ); break; case FTS5_STMT_SCAN_ASC: case FTS5_STMT_SCAN_DESC: zSql = sqlite3_mprintf(azStmt[eStmt], pC->zContentExprlist, pC->zContent, pC->zContentRowid, pC->zContentRowid, pC->zContentRowid ); break; case FTS5_STMT_LOOKUP: zSql = sqlite3_mprintf(azStmt[eStmt], pC->zContentExprlist, pC->zContent, pC->zContentRowid ); break; case FTS5_STMT_INSERT_CONTENT: case FTS5_STMT_REPLACE_CONTENT: { int nCol = pC->nCol + 1; char *zBind; int i; zBind = sqlite3_malloc(1 + nCol*2); if( zBind ){ for(i=0; izDb, pC->zName, zBind); sqlite3_free(zBind); } break; } default: zSql = sqlite3_mprintf(azStmt[eStmt], pC->zDb, pC->zName); break; } if( zSql==0 ){ rc = SQLITE_NOMEM; }else{ rc = sqlite3_prepare_v3(pC->db, zSql, -1, SQLITE_PREPARE_PERSISTENT, &p->aStmt[eStmt], 0); sqlite3_free(zSql); if( rc!=SQLITE_OK && pzErrMsg ){ *pzErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pC->db)); } } } *ppStmt = p->aStmt[eStmt]; sqlite3_reset(*ppStmt); return rc; } static int fts5ExecPrintf( sqlite3 *db, char **pzErr, const char *zFormat, ... ){ int rc; va_list ap; /* ... printf arguments */ char *zSql; va_start(ap, zFormat); zSql = sqlite3_vmprintf(zFormat, ap); if( zSql==0 ){ rc = SQLITE_NOMEM; }else{ rc = sqlite3_exec(db, zSql, 0, 0, pzErr); sqlite3_free(zSql); } va_end(ap); return rc; } /* ** Drop all shadow tables. Return SQLITE_OK if successful or an SQLite error ** code otherwise. */ int sqlite3Fts5DropAll(Fts5Config *pConfig){ int rc = fts5ExecPrintf(pConfig->db, 0, "DROP TABLE IF EXISTS %Q.'%q_data';" "DROP TABLE IF EXISTS %Q.'%q_idx';" "DROP TABLE IF EXISTS %Q.'%q_config';", pConfig->zDb, pConfig->zName, pConfig->zDb, pConfig->zName, pConfig->zDb, pConfig->zName ); if( rc==SQLITE_OK && pConfig->bColumnsize ){ rc = fts5ExecPrintf(pConfig->db, 0, "DROP TABLE IF EXISTS %Q.'%q_docsize';", pConfig->zDb, pConfig->zName ); } if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){ rc = fts5ExecPrintf(pConfig->db, 0, "DROP TABLE IF EXISTS %Q.'%q_content';", pConfig->zDb, pConfig->zName ); } return rc; } static void fts5StorageRenameOne( Fts5Config *pConfig, /* Current FTS5 configuration */ int *pRc, /* IN/OUT: Error code */ const char *zTail, /* Tail of table name e.g. "data", "config" */ const char *zName /* New name of FTS5 table */ ){ if( *pRc==SQLITE_OK ){ *pRc = fts5ExecPrintf(pConfig->db, 0, "ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';", pConfig->zDb, pConfig->zName, zTail, zName, zTail ); } } int sqlite3Fts5StorageRename(Fts5Storage *pStorage, const char *zName){ Fts5Config *pConfig = pStorage->pConfig; int rc = sqlite3Fts5StorageSync(pStorage); fts5StorageRenameOne(pConfig, &rc, "data", zName); fts5StorageRenameOne(pConfig, &rc, "idx", zName); fts5StorageRenameOne(pConfig, &rc, "config", zName); if( pConfig->bColumnsize ){ fts5StorageRenameOne(pConfig, &rc, "docsize", zName); } if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ fts5StorageRenameOne(pConfig, &rc, "content", zName); } return rc; } /* ** Create the shadow table named zPost, with definition zDefn. Return ** SQLITE_OK if successful, or an SQLite error code otherwise. */ int sqlite3Fts5CreateTable( Fts5Config *pConfig, /* FTS5 configuration */ const char *zPost, /* Shadow table to create (e.g. "content") */ const char *zDefn, /* Columns etc. for shadow table */ int bWithout, /* True for without rowid */ char **pzErr /* OUT: Error message */ ){ int rc; char *zErr = 0; rc = fts5ExecPrintf(pConfig->db, &zErr, "CREATE TABLE %Q.'%q_%q'(%s)%s", pConfig->zDb, pConfig->zName, zPost, zDefn, #ifndef SQLITE_FTS5_NO_WITHOUT_ROWID bWithout?" WITHOUT ROWID": #endif "" ); if( zErr ){ *pzErr = sqlite3_mprintf( "fts5: error creating shadow table %q_%s: %s", pConfig->zName, zPost, zErr ); sqlite3_free(zErr); } return rc; } /* ** Open a new Fts5Index handle. If the bCreate argument is true, create ** and initialize the underlying tables ** ** If successful, set *pp to point to the new object and return SQLITE_OK. ** Otherwise, set *pp to NULL and return an SQLite error code. */ int sqlite3Fts5StorageOpen( Fts5Config *pConfig, Fts5Index *pIndex, int bCreate, Fts5Storage **pp, char **pzErr /* OUT: Error message */ ){ int rc = SQLITE_OK; Fts5Storage *p; /* New object */ int nByte; /* Bytes of space to allocate */ nByte = sizeof(Fts5Storage) /* Fts5Storage object */ + pConfig->nCol * sizeof(i64); /* Fts5Storage.aTotalSize[] */ *pp = p = (Fts5Storage*)sqlite3_malloc(nByte); if( !p ) return SQLITE_NOMEM; memset(p, 0, nByte); p->aTotalSize = (i64*)&p[1]; p->pConfig = pConfig; p->pIndex = pIndex; if( bCreate ){ if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ int nDefn = 32 + pConfig->nCol*10; char *zDefn = sqlite3_malloc(32 + pConfig->nCol * 10); if( zDefn==0 ){ rc = SQLITE_NOMEM; }else{ int i; int iOff; sqlite3_snprintf(nDefn, zDefn, "id INTEGER PRIMARY KEY"); iOff = (int)strlen(zDefn); for(i=0; inCol; i++){ sqlite3_snprintf(nDefn-iOff, &zDefn[iOff], ", c%d", i); iOff += (int)strlen(&zDefn[iOff]); } rc = sqlite3Fts5CreateTable(pConfig, "content", zDefn, 0, pzErr); } sqlite3_free(zDefn); } if( rc==SQLITE_OK && pConfig->bColumnsize ){ rc = sqlite3Fts5CreateTable( pConfig, "docsize", "id INTEGER PRIMARY KEY, sz BLOB", 0, pzErr ); } if( rc==SQLITE_OK ){ rc = sqlite3Fts5CreateTable( pConfig, "config", "k PRIMARY KEY, v", 1, pzErr ); } if( rc==SQLITE_OK ){ rc = sqlite3Fts5StorageConfigValue(p, "version", 0, FTS5_CURRENT_VERSION); } } if( rc ){ sqlite3Fts5StorageClose(p); *pp = 0; } return rc; } /* ** Close a handle opened by an earlier call to sqlite3Fts5StorageOpen(). */ int sqlite3Fts5StorageClose(Fts5Storage *p){ int rc = SQLITE_OK; if( p ){ int i; /* Finalize all SQL statements */ for(i=0; iaStmt); i++){ sqlite3_finalize(p->aStmt[i]); } sqlite3_free(p); } return rc; } typedef struct Fts5InsertCtx Fts5InsertCtx; struct Fts5InsertCtx { Fts5Storage *pStorage; int iCol; int szCol; /* Size of column value in tokens */ }; /* ** Tokenization callback used when inserting tokens into the FTS index. */ static int fts5StorageInsertCallback( void *pContext, /* Pointer to Fts5InsertCtx object */ int tflags, const char *pToken, /* Buffer containing token */ int nToken, /* Size of token in bytes */ int iUnused1, /* Start offset of token */ int iUnused2 /* End offset of token */ ){ Fts5InsertCtx *pCtx = (Fts5InsertCtx*)pContext; Fts5Index *pIdx = pCtx->pStorage->pIndex; UNUSED_PARAM2(iUnused1, iUnused2); if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE; if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){ pCtx->szCol++; } return sqlite3Fts5IndexWrite(pIdx, pCtx->iCol, pCtx->szCol-1, pToken, nToken); } /* ** If a row with rowid iDel is present in the %_content table, add the ** delete-markers to the FTS index necessary to delete it. Do not actually ** remove the %_content row at this time though. */ static int fts5StorageDeleteFromIndex( Fts5Storage *p, i64 iDel, sqlite3_value **apVal ){ Fts5Config *pConfig = p->pConfig; sqlite3_stmt *pSeek = 0; /* SELECT to read row iDel from %_data */ int rc; /* Return code */ int rc2; /* sqlite3_reset() return code */ int iCol; Fts5InsertCtx ctx; if( apVal==0 ){ rc = fts5StorageGetStmt(p, FTS5_STMT_LOOKUP, &pSeek, 0); if( rc!=SQLITE_OK ) return rc; sqlite3_bind_int64(pSeek, 1, iDel); if( sqlite3_step(pSeek)!=SQLITE_ROW ){ return sqlite3_reset(pSeek); } } ctx.pStorage = p; ctx.iCol = -1; rc = sqlite3Fts5IndexBeginWrite(p->pIndex, 1, iDel); for(iCol=1; rc==SQLITE_OK && iCol<=pConfig->nCol; iCol++){ if( pConfig->abUnindexed[iCol-1]==0 ){ const char *zText; int nText; if( pSeek ){ zText = (const char*)sqlite3_column_text(pSeek, iCol); nText = sqlite3_column_bytes(pSeek, iCol); }else{ zText = (const char*)sqlite3_value_text(apVal[iCol-1]); nText = sqlite3_value_bytes(apVal[iCol-1]); } ctx.szCol = 0; rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, zText, nText, (void*)&ctx, fts5StorageInsertCallback ); p->aTotalSize[iCol-1] -= (i64)ctx.szCol; } } p->nTotalRow--; rc2 = sqlite3_reset(pSeek); if( rc==SQLITE_OK ) rc = rc2; return rc; } /* ** Insert a record into the %_docsize table. Specifically, do: ** ** INSERT OR REPLACE INTO %_docsize(id, sz) VALUES(iRowid, pBuf); ** ** If there is no %_docsize table (as happens if the columnsize=0 option ** is specified when the FTS5 table is created), this function is a no-op. */ static int fts5StorageInsertDocsize( Fts5Storage *p, /* Storage module to write to */ i64 iRowid, /* id value */ Fts5Buffer *pBuf /* sz value */ ){ int rc = SQLITE_OK; if( p->pConfig->bColumnsize ){ sqlite3_stmt *pReplace = 0; rc = fts5StorageGetStmt(p, FTS5_STMT_REPLACE_DOCSIZE, &pReplace, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pReplace, 1, iRowid); sqlite3_bind_blob(pReplace, 2, pBuf->p, pBuf->n, SQLITE_STATIC); sqlite3_step(pReplace); rc = sqlite3_reset(pReplace); } } return rc; } /* ** Load the contents of the "averages" record from disk into the ** p->nTotalRow and p->aTotalSize[] variables. If successful, and if ** argument bCache is true, set the p->bTotalsValid flag to indicate ** that the contents of aTotalSize[] and nTotalRow are valid until ** further notice. ** ** Return SQLITE_OK if successful, or an SQLite error code if an error ** occurs. */ static int fts5StorageLoadTotals(Fts5Storage *p, int bCache){ int rc = SQLITE_OK; if( p->bTotalsValid==0 ){ rc = sqlite3Fts5IndexGetAverages(p->pIndex, &p->nTotalRow, p->aTotalSize); p->bTotalsValid = bCache; } return rc; } /* ** Store the current contents of the p->nTotalRow and p->aTotalSize[] ** variables in the "averages" record on disk. ** ** Return SQLITE_OK if successful, or an SQLite error code if an error ** occurs. */ static int fts5StorageSaveTotals(Fts5Storage *p){ int nCol = p->pConfig->nCol; int i; Fts5Buffer buf; int rc = SQLITE_OK; memset(&buf, 0, sizeof(buf)); sqlite3Fts5BufferAppendVarint(&rc, &buf, p->nTotalRow); for(i=0; iaTotalSize[i]); } if( rc==SQLITE_OK ){ rc = sqlite3Fts5IndexSetAverages(p->pIndex, buf.p, buf.n); } sqlite3_free(buf.p); return rc; } /* ** Remove a row from the FTS table. */ int sqlite3Fts5StorageDelete(Fts5Storage *p, i64 iDel, sqlite3_value **apVal){ Fts5Config *pConfig = p->pConfig; int rc; sqlite3_stmt *pDel = 0; assert( pConfig->eContent!=FTS5_CONTENT_NORMAL || apVal==0 ); rc = fts5StorageLoadTotals(p, 1); /* Delete the index records */ if( rc==SQLITE_OK ){ rc = fts5StorageDeleteFromIndex(p, iDel, apVal); } /* Delete the %_docsize record */ if( rc==SQLITE_OK && pConfig->bColumnsize ){ rc = fts5StorageGetStmt(p, FTS5_STMT_DELETE_DOCSIZE, &pDel, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pDel, 1, iDel); sqlite3_step(pDel); rc = sqlite3_reset(pDel); } } /* Delete the %_content record */ if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ if( rc==SQLITE_OK ){ rc = fts5StorageGetStmt(p, FTS5_STMT_DELETE_CONTENT, &pDel, 0); } if( rc==SQLITE_OK ){ sqlite3_bind_int64(pDel, 1, iDel); sqlite3_step(pDel); rc = sqlite3_reset(pDel); } } return rc; } /* ** Delete all entries in the FTS5 index. */ int sqlite3Fts5StorageDeleteAll(Fts5Storage *p){ Fts5Config *pConfig = p->pConfig; int rc; /* Delete the contents of the %_data and %_docsize tables. */ rc = fts5ExecPrintf(pConfig->db, 0, "DELETE FROM %Q.'%q_data';" "DELETE FROM %Q.'%q_idx';", pConfig->zDb, pConfig->zName, pConfig->zDb, pConfig->zName ); if( rc==SQLITE_OK && pConfig->bColumnsize ){ rc = fts5ExecPrintf(pConfig->db, 0, "DELETE FROM %Q.'%q_docsize';", pConfig->zDb, pConfig->zName ); } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ if( rc==SQLITE_OK ){ rc = sqlite3Fts5IndexReinit(p->pIndex); } if( rc==SQLITE_OK ){ rc = sqlite3Fts5StorageConfigValue(p, "version", 0, FTS5_CURRENT_VERSION); } return rc; } int sqlite3Fts5StorageRebuild(Fts5Storage *p){ Fts5Buffer buf = {0,0,0}; Fts5Config *pConfig = p->pConfig; sqlite3_stmt *pScan = 0; Fts5InsertCtx ctx; int rc; memset(&ctx, 0, sizeof(Fts5InsertCtx)); ctx.pStorage = p; rc = sqlite3Fts5StorageDeleteAll(p); if( rc==SQLITE_OK ){ rc = fts5StorageLoadTotals(p, 1); } if( rc==SQLITE_OK ){ rc = fts5StorageGetStmt(p, FTS5_STMT_SCAN, &pScan, 0); } while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pScan) ){ i64 iRowid = sqlite3_column_int64(pScan, 0); sqlite3Fts5BufferZero(&buf); rc = sqlite3Fts5IndexBeginWrite(p->pIndex, 0, iRowid); for(ctx.iCol=0; rc==SQLITE_OK && ctx.iColnCol; ctx.iCol++){ ctx.szCol = 0; if( pConfig->abUnindexed[ctx.iCol]==0 ){ rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, (const char*)sqlite3_column_text(pScan, ctx.iCol+1), sqlite3_column_bytes(pScan, ctx.iCol+1), (void*)&ctx, fts5StorageInsertCallback ); } sqlite3Fts5BufferAppendVarint(&rc, &buf, ctx.szCol); p->aTotalSize[ctx.iCol] += (i64)ctx.szCol; } p->nTotalRow++; if( rc==SQLITE_OK ){ rc = fts5StorageInsertDocsize(p, iRowid, &buf); } } sqlite3_free(buf.p); /* Write the averages record */ if( rc==SQLITE_OK ){ rc = fts5StorageSaveTotals(p); } return rc; } int sqlite3Fts5StorageOptimize(Fts5Storage *p){ return sqlite3Fts5IndexOptimize(p->pIndex); } int sqlite3Fts5StorageMerge(Fts5Storage *p, int nMerge){ return sqlite3Fts5IndexMerge(p->pIndex, nMerge); } int sqlite3Fts5StorageReset(Fts5Storage *p){ return sqlite3Fts5IndexReset(p->pIndex); } /* ** Allocate a new rowid. This is used for "external content" tables when ** a NULL value is inserted into the rowid column. The new rowid is allocated ** by inserting a dummy row into the %_docsize table. The dummy will be ** overwritten later. ** ** If the %_docsize table does not exist, SQLITE_MISMATCH is returned. In ** this case the user is required to provide a rowid explicitly. */ static int fts5StorageNewRowid(Fts5Storage *p, i64 *piRowid){ int rc = SQLITE_MISMATCH; if( p->pConfig->bColumnsize ){ sqlite3_stmt *pReplace = 0; rc = fts5StorageGetStmt(p, FTS5_STMT_REPLACE_DOCSIZE, &pReplace, 0); if( rc==SQLITE_OK ){ sqlite3_bind_null(pReplace, 1); sqlite3_bind_null(pReplace, 2); sqlite3_step(pReplace); rc = sqlite3_reset(pReplace); } if( rc==SQLITE_OK ){ *piRowid = sqlite3_last_insert_rowid(p->pConfig->db); } } return rc; } /* ** Insert a new row into the FTS content table. */ int sqlite3Fts5StorageContentInsert( Fts5Storage *p, sqlite3_value **apVal, i64 *piRowid ){ Fts5Config *pConfig = p->pConfig; int rc = SQLITE_OK; /* Insert the new row into the %_content table. */ if( pConfig->eContent!=FTS5_CONTENT_NORMAL ){ if( sqlite3_value_type(apVal[1])==SQLITE_INTEGER ){ *piRowid = sqlite3_value_int64(apVal[1]); }else{ rc = fts5StorageNewRowid(p, piRowid); } }else{ sqlite3_stmt *pInsert = 0; /* Statement to write %_content table */ int i; /* Counter variable */ rc = fts5StorageGetStmt(p, FTS5_STMT_INSERT_CONTENT, &pInsert, 0); for(i=1; rc==SQLITE_OK && i<=pConfig->nCol+1; i++){ rc = sqlite3_bind_value(pInsert, i, apVal[i]); } if( rc==SQLITE_OK ){ sqlite3_step(pInsert); rc = sqlite3_reset(pInsert); } *piRowid = sqlite3_last_insert_rowid(pConfig->db); } return rc; } /* ** Insert new entries into the FTS index and %_docsize table. */ int sqlite3Fts5StorageIndexInsert( Fts5Storage *p, sqlite3_value **apVal, i64 iRowid ){ Fts5Config *pConfig = p->pConfig; int rc = SQLITE_OK; /* Return code */ Fts5InsertCtx ctx; /* Tokenization callback context object */ Fts5Buffer buf; /* Buffer used to build up %_docsize blob */ memset(&buf, 0, sizeof(Fts5Buffer)); ctx.pStorage = p; rc = fts5StorageLoadTotals(p, 1); if( rc==SQLITE_OK ){ rc = sqlite3Fts5IndexBeginWrite(p->pIndex, 0, iRowid); } for(ctx.iCol=0; rc==SQLITE_OK && ctx.iColnCol; ctx.iCol++){ ctx.szCol = 0; if( pConfig->abUnindexed[ctx.iCol]==0 ){ rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, (const char*)sqlite3_value_text(apVal[ctx.iCol+2]), sqlite3_value_bytes(apVal[ctx.iCol+2]), (void*)&ctx, fts5StorageInsertCallback ); } sqlite3Fts5BufferAppendVarint(&rc, &buf, ctx.szCol); p->aTotalSize[ctx.iCol] += (i64)ctx.szCol; } p->nTotalRow++; /* Write the %_docsize record */ if( rc==SQLITE_OK ){ rc = fts5StorageInsertDocsize(p, iRowid, &buf); } sqlite3_free(buf.p); return rc; } static int fts5StorageCount(Fts5Storage *p, const char *zSuffix, i64 *pnRow){ Fts5Config *pConfig = p->pConfig; char *zSql; int rc; zSql = sqlite3_mprintf("SELECT count(*) FROM %Q.'%q_%s'", pConfig->zDb, pConfig->zName, zSuffix ); if( zSql==0 ){ rc = SQLITE_NOMEM; }else{ sqlite3_stmt *pCnt = 0; rc = sqlite3_prepare_v2(pConfig->db, zSql, -1, &pCnt, 0); if( rc==SQLITE_OK ){ if( SQLITE_ROW==sqlite3_step(pCnt) ){ *pnRow = sqlite3_column_int64(pCnt, 0); } rc = sqlite3_finalize(pCnt); } } sqlite3_free(zSql); return rc; } /* ** Context object used by sqlite3Fts5StorageIntegrity(). */ typedef struct Fts5IntegrityCtx Fts5IntegrityCtx; struct Fts5IntegrityCtx { i64 iRowid; int iCol; int szCol; u64 cksum; Fts5Termset *pTermset; Fts5Config *pConfig; }; /* ** Tokenization callback used by integrity check. */ static int fts5StorageIntegrityCallback( void *pContext, /* Pointer to Fts5IntegrityCtx object */ int tflags, const char *pToken, /* Buffer containing token */ int nToken, /* Size of token in bytes */ int iUnused1, /* Start offset of token */ int iUnused2 /* End offset of token */ ){ Fts5IntegrityCtx *pCtx = (Fts5IntegrityCtx*)pContext; Fts5Termset *pTermset = pCtx->pTermset; int bPresent; int ii; int rc = SQLITE_OK; int iPos; int iCol; UNUSED_PARAM2(iUnused1, iUnused2); if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE; if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){ pCtx->szCol++; } switch( pCtx->pConfig->eDetail ){ case FTS5_DETAIL_FULL: iPos = pCtx->szCol-1; iCol = pCtx->iCol; break; case FTS5_DETAIL_COLUMNS: iPos = pCtx->iCol; iCol = 0; break; default: assert( pCtx->pConfig->eDetail==FTS5_DETAIL_NONE ); iPos = 0; iCol = 0; break; } rc = sqlite3Fts5TermsetAdd(pTermset, 0, pToken, nToken, &bPresent); if( rc==SQLITE_OK && bPresent==0 ){ pCtx->cksum ^= sqlite3Fts5IndexEntryCksum( pCtx->iRowid, iCol, iPos, 0, pToken, nToken ); } for(ii=0; rc==SQLITE_OK && iipConfig->nPrefix; ii++){ const int nChar = pCtx->pConfig->aPrefix[ii]; int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar); if( nByte ){ rc = sqlite3Fts5TermsetAdd(pTermset, ii+1, pToken, nByte, &bPresent); if( bPresent==0 ){ pCtx->cksum ^= sqlite3Fts5IndexEntryCksum( pCtx->iRowid, iCol, iPos, ii+1, pToken, nByte ); } } } return rc; } /* ** Check that the contents of the FTS index match that of the %_content ** table. Return SQLITE_OK if they do, or SQLITE_CORRUPT if not. Return ** some other SQLite error code if an error occurs while attempting to ** determine this. */ int sqlite3Fts5StorageIntegrity(Fts5Storage *p){ Fts5Config *pConfig = p->pConfig; int rc; /* Return code */ int *aColSize; /* Array of size pConfig->nCol */ i64 *aTotalSize; /* Array of size pConfig->nCol */ Fts5IntegrityCtx ctx; sqlite3_stmt *pScan; memset(&ctx, 0, sizeof(Fts5IntegrityCtx)); ctx.pConfig = p->pConfig; aTotalSize = (i64*)sqlite3_malloc(pConfig->nCol * (sizeof(int)+sizeof(i64))); if( !aTotalSize ) return SQLITE_NOMEM; aColSize = (int*)&aTotalSize[pConfig->nCol]; memset(aTotalSize, 0, sizeof(i64) * pConfig->nCol); /* Generate the expected index checksum based on the contents of the ** %_content table. This block stores the checksum in ctx.cksum. */ rc = fts5StorageGetStmt(p, FTS5_STMT_SCAN, &pScan, 0); if( rc==SQLITE_OK ){ int rc2; while( SQLITE_ROW==sqlite3_step(pScan) ){ int i; ctx.iRowid = sqlite3_column_int64(pScan, 0); ctx.szCol = 0; if( pConfig->bColumnsize ){ rc = sqlite3Fts5StorageDocsize(p, ctx.iRowid, aColSize); } if( rc==SQLITE_OK && pConfig->eDetail==FTS5_DETAIL_NONE ){ rc = sqlite3Fts5TermsetNew(&ctx.pTermset); } for(i=0; rc==SQLITE_OK && inCol; i++){ if( pConfig->abUnindexed[i] ) continue; ctx.iCol = i; ctx.szCol = 0; if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){ rc = sqlite3Fts5TermsetNew(&ctx.pTermset); } if( rc==SQLITE_OK ){ rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, (const char*)sqlite3_column_text(pScan, i+1), sqlite3_column_bytes(pScan, i+1), (void*)&ctx, fts5StorageIntegrityCallback ); } if( rc==SQLITE_OK && pConfig->bColumnsize && ctx.szCol!=aColSize[i] ){ rc = FTS5_CORRUPT; } aTotalSize[i] += ctx.szCol; if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){ sqlite3Fts5TermsetFree(ctx.pTermset); ctx.pTermset = 0; } } sqlite3Fts5TermsetFree(ctx.pTermset); ctx.pTermset = 0; if( rc!=SQLITE_OK ) break; } rc2 = sqlite3_reset(pScan); if( rc==SQLITE_OK ) rc = rc2; } /* Test that the "totals" (sometimes called "averages") record looks Ok */ if( rc==SQLITE_OK ){ int i; rc = fts5StorageLoadTotals(p, 0); for(i=0; rc==SQLITE_OK && inCol; i++){ if( p->aTotalSize[i]!=aTotalSize[i] ) rc = FTS5_CORRUPT; } } /* Check that the %_docsize and %_content tables contain the expected ** number of rows. */ if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){ i64 nRow = 0; rc = fts5StorageCount(p, "content", &nRow); if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT; } if( rc==SQLITE_OK && pConfig->bColumnsize ){ i64 nRow = 0; rc = fts5StorageCount(p, "docsize", &nRow); if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT; } /* Pass the expected checksum down to the FTS index module. It will ** verify, amongst other things, that it matches the checksum generated by ** inspecting the index itself. */ if( rc==SQLITE_OK ){ rc = sqlite3Fts5IndexIntegrityCheck(p->pIndex, ctx.cksum); } sqlite3_free(aTotalSize); return rc; } /* ** Obtain an SQLite statement handle that may be used to read data from the ** %_content table. */ int sqlite3Fts5StorageStmt( Fts5Storage *p, int eStmt, sqlite3_stmt **pp, char **pzErrMsg ){ int rc; assert( eStmt==FTS5_STMT_SCAN_ASC || eStmt==FTS5_STMT_SCAN_DESC || eStmt==FTS5_STMT_LOOKUP ); rc = fts5StorageGetStmt(p, eStmt, pp, pzErrMsg); if( rc==SQLITE_OK ){ assert( p->aStmt[eStmt]==*pp ); p->aStmt[eStmt] = 0; } return rc; } /* ** Release an SQLite statement handle obtained via an earlier call to ** sqlite3Fts5StorageStmt(). The eStmt parameter passed to this function ** must match that passed to the sqlite3Fts5StorageStmt() call. */ void sqlite3Fts5StorageStmtRelease( Fts5Storage *p, int eStmt, sqlite3_stmt *pStmt ){ assert( eStmt==FTS5_STMT_SCAN_ASC || eStmt==FTS5_STMT_SCAN_DESC || eStmt==FTS5_STMT_LOOKUP ); if( p->aStmt[eStmt]==0 ){ sqlite3_reset(pStmt); p->aStmt[eStmt] = pStmt; }else{ sqlite3_finalize(pStmt); } } static int fts5StorageDecodeSizeArray( int *aCol, int nCol, /* Array to populate */ const u8 *aBlob, int nBlob /* Record to read varints from */ ){ int i; int iOff = 0; for(i=0; i=nBlob ) return 1; iOff += fts5GetVarint32(&aBlob[iOff], aCol[i]); } return (iOff!=nBlob); } /* ** Argument aCol points to an array of integers containing one entry for ** each table column. This function reads the %_docsize record for the ** specified rowid and populates aCol[] with the results. ** ** An SQLite error code is returned if an error occurs, or SQLITE_OK ** otherwise. */ int sqlite3Fts5StorageDocsize(Fts5Storage *p, i64 iRowid, int *aCol){ int nCol = p->pConfig->nCol; /* Number of user columns in table */ sqlite3_stmt *pLookup = 0; /* Statement to query %_docsize */ int rc; /* Return Code */ assert( p->pConfig->bColumnsize ); rc = fts5StorageGetStmt(p, FTS5_STMT_LOOKUP_DOCSIZE, &pLookup, 0); if( rc==SQLITE_OK ){ int bCorrupt = 1; sqlite3_bind_int64(pLookup, 1, iRowid); if( SQLITE_ROW==sqlite3_step(pLookup) ){ const u8 *aBlob = sqlite3_column_blob(pLookup, 0); int nBlob = sqlite3_column_bytes(pLookup, 0); if( 0==fts5StorageDecodeSizeArray(aCol, nCol, aBlob, nBlob) ){ bCorrupt = 0; } } rc = sqlite3_reset(pLookup); if( bCorrupt && rc==SQLITE_OK ){ rc = FTS5_CORRUPT; } } return rc; } int sqlite3Fts5StorageSize(Fts5Storage *p, int iCol, i64 *pnToken){ int rc = fts5StorageLoadTotals(p, 0); if( rc==SQLITE_OK ){ *pnToken = 0; if( iCol<0 ){ int i; for(i=0; ipConfig->nCol; i++){ *pnToken += p->aTotalSize[i]; } }else if( iColpConfig->nCol ){ *pnToken = p->aTotalSize[iCol]; }else{ rc = SQLITE_RANGE; } } return rc; } int sqlite3Fts5StorageRowCount(Fts5Storage *p, i64 *pnRow){ int rc = fts5StorageLoadTotals(p, 0); if( rc==SQLITE_OK ){ *pnRow = p->nTotalRow; } return rc; } /* ** Flush any data currently held in-memory to disk. */ int sqlite3Fts5StorageSync(Fts5Storage *p){ int rc = SQLITE_OK; i64 iLastRowid = sqlite3_last_insert_rowid(p->pConfig->db); if( p->bTotalsValid ){ rc = fts5StorageSaveTotals(p); p->bTotalsValid = 0; } if( rc==SQLITE_OK ){ rc = sqlite3Fts5IndexSync(p->pIndex); } sqlite3_set_last_insert_rowid(p->pConfig->db, iLastRowid); return rc; } int sqlite3Fts5StorageRollback(Fts5Storage *p){ p->bTotalsValid = 0; return sqlite3Fts5IndexRollback(p->pIndex); } int sqlite3Fts5StorageConfigValue( Fts5Storage *p, const char *z, sqlite3_value *pVal, int iVal ){ sqlite3_stmt *pReplace = 0; int rc = fts5StorageGetStmt(p, FTS5_STMT_REPLACE_CONFIG, &pReplace, 0); if( rc==SQLITE_OK ){ sqlite3_bind_text(pReplace, 1, z, -1, SQLITE_STATIC); if( pVal ){ sqlite3_bind_value(pReplace, 2, pVal); }else{ sqlite3_bind_int(pReplace, 2, iVal); } sqlite3_step(pReplace); rc = sqlite3_reset(pReplace); } if( rc==SQLITE_OK && pVal ){ int iNew = p->pConfig->iCookie + 1; rc = sqlite3Fts5IndexSetCookie(p->pIndex, iNew); if( rc==SQLITE_OK ){ p->pConfig->iCookie = iNew; } } return rc; } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_tcl.c ================================================ /* ** 2014 Dec 01 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** */ #ifdef SQLITE_TEST #if defined(INCLUDE_SQLITE_TCL_H) # include "sqlite_tcl.h" #else # include "tcl.h" # ifndef SQLITE_TCLAPI # define SQLITE_TCLAPI # endif #endif #ifdef SQLITE_ENABLE_FTS5 #include "fts5.h" #include #include extern int sqlite3_fts5_may_be_corrupt; extern int sqlite3Fts5TestRegisterMatchinfo(sqlite3*); extern int sqlite3Fts5TestRegisterTok(sqlite3*, fts5_api*); /************************************************************************* ** This is a copy of the first part of the SqliteDb structure in ** tclsqlite.c. We need it here so that the get_sqlite_pointer routine ** can extract the sqlite3* pointer from an existing Tcl SQLite ** connection. */ extern const char *sqlite3ErrName(int); struct SqliteDb { sqlite3 *db; }; /* ** Decode a pointer to an sqlite3 object. */ static int f5tDbPointer(Tcl_Interp *interp, Tcl_Obj *pObj, sqlite3 **ppDb){ struct SqliteDb *p; Tcl_CmdInfo cmdInfo; char *z = Tcl_GetString(pObj); if( Tcl_GetCommandInfo(interp, z, &cmdInfo) ){ p = (struct SqliteDb*)cmdInfo.objClientData; *ppDb = p->db; return TCL_OK; } return TCL_ERROR; } /* End of code that accesses the SqliteDb struct. **************************************************************************/ static int f5tResultToErrorCode(const char *zRes){ struct ErrorCode { int rc; const char *zError; } aErr[] = { { SQLITE_DONE, "SQLITE_DONE" }, { SQLITE_ERROR, "SQLITE_ERROR" }, { SQLITE_OK, "SQLITE_OK" }, { SQLITE_OK, "" }, }; int i; for(i=0; ipScript); int rc; Tcl_IncrRefCount(pEval); Tcl_ListObjAppendElement(p->interp, pEval, Tcl_NewStringObj(zToken, nToken)); Tcl_ListObjAppendElement(p->interp, pEval, Tcl_NewIntObj(iStart)); Tcl_ListObjAppendElement(p->interp, pEval, Tcl_NewIntObj(iEnd)); rc = Tcl_EvalObjEx(p->interp, pEval, 0); Tcl_DecrRefCount(pEval); if( rc==TCL_OK ){ rc = f5tResultToErrorCode(Tcl_GetStringResult(p->interp)); } return rc; } static int SQLITE_TCLAPI xF5tApi(void*, Tcl_Interp*, int, Tcl_Obj *CONST []); static int xQueryPhraseCb( const Fts5ExtensionApi *pApi, Fts5Context *pFts, void *pCtx ){ F5tFunction *p = (F5tFunction*)pCtx; static sqlite3_int64 iCmd = 0; Tcl_Obj *pEval; int rc; char zCmd[64]; F5tApi sApi; sApi.pApi = pApi; sApi.pFts = pFts; sprintf(zCmd, "f5t_2_%lld", iCmd++); Tcl_CreateObjCommand(p->interp, zCmd, xF5tApi, &sApi, 0); pEval = Tcl_DuplicateObj(p->pScript); Tcl_IncrRefCount(pEval); Tcl_ListObjAppendElement(p->interp, pEval, Tcl_NewStringObj(zCmd, -1)); rc = Tcl_EvalObjEx(p->interp, pEval, 0); Tcl_DecrRefCount(pEval); Tcl_DeleteCommand(p->interp, zCmd); if( rc==TCL_OK ){ rc = f5tResultToErrorCode(Tcl_GetStringResult(p->interp)); } return rc; } static void xSetAuxdataDestructor(void *p){ F5tAuxData *pData = (F5tAuxData*)p; Tcl_DecrRefCount(pData->pObj); sqlite3_free(pData); } /* ** api sub-command... ** ** Description... */ static int SQLITE_TCLAPI xF5tApi( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ struct Sub { const char *zName; int nArg; const char *zMsg; } aSub[] = { { "xColumnCount", 0, "" }, /* 0 */ { "xRowCount", 0, "" }, /* 1 */ { "xColumnTotalSize", 1, "COL" }, /* 2 */ { "xTokenize", 2, "TEXT SCRIPT" }, /* 3 */ { "xPhraseCount", 0, "" }, /* 4 */ { "xPhraseSize", 1, "PHRASE" }, /* 5 */ { "xInstCount", 0, "" }, /* 6 */ { "xInst", 1, "IDX" }, /* 7 */ { "xRowid", 0, "" }, /* 8 */ { "xColumnText", 1, "COL" }, /* 9 */ { "xColumnSize", 1, "COL" }, /* 10 */ { "xQueryPhrase", 2, "PHRASE SCRIPT" }, /* 11 */ { "xSetAuxdata", 1, "VALUE" }, /* 12 */ { "xGetAuxdata", 1, "CLEAR" }, /* 13 */ { "xSetAuxdataInt", 1, "INTEGER" }, /* 14 */ { "xGetAuxdataInt", 1, "CLEAR" }, /* 15 */ { "xPhraseForeach", 4, "IPHRASE COLVAR OFFVAR SCRIPT" }, /* 16 */ { "xPhraseColumnForeach", 3, "IPHRASE COLVAR SCRIPT" }, /* 17 */ { 0, 0, 0} }; int rc; int iSub = 0; F5tApi *p = (F5tApi*)clientData; if( objc<2 ){ Tcl_WrongNumArgs(interp, 1, objv, "SUB-COMMAND"); return TCL_ERROR; } rc = Tcl_GetIndexFromObjStruct( interp, objv[1], aSub, sizeof(aSub[0]), "SUB-COMMAND", 0, &iSub ); if( rc!=TCL_OK ) return rc; if( aSub[iSub].nArg!=objc-2 ){ Tcl_WrongNumArgs(interp, 1, objv, aSub[iSub].zMsg); return TCL_ERROR; } #define CASE(i,str) case i: assert( strcmp(aSub[i].zName, str)==0 ); switch( iSub ){ CASE(0, "xColumnCount") { int nCol; nCol = p->pApi->xColumnCount(p->pFts); if( rc==SQLITE_OK ){ Tcl_SetObjResult(interp, Tcl_NewIntObj(nCol)); } break; } CASE(1, "xRowCount") { sqlite3_int64 nRow; rc = p->pApi->xRowCount(p->pFts, &nRow); if( rc==SQLITE_OK ){ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(nRow)); } break; } CASE(2, "xColumnTotalSize") { int iCol; sqlite3_int64 nSize; if( Tcl_GetIntFromObj(interp, objv[2], &iCol) ) return TCL_ERROR; rc = p->pApi->xColumnTotalSize(p->pFts, iCol, &nSize); if( rc==SQLITE_OK ){ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(nSize)); } break; } CASE(3, "xTokenize") { int nText; char *zText = Tcl_GetStringFromObj(objv[2], &nText); F5tFunction ctx; ctx.interp = interp; ctx.pScript = objv[3]; rc = p->pApi->xTokenize(p->pFts, zText, nText, &ctx, xTokenizeCb); if( rc==SQLITE_OK ){ Tcl_ResetResult(interp); } return rc; } CASE(4, "xPhraseCount") { int nPhrase; nPhrase = p->pApi->xPhraseCount(p->pFts); if( rc==SQLITE_OK ){ Tcl_SetObjResult(interp, Tcl_NewIntObj(nPhrase)); } break; } CASE(5, "xPhraseSize") { int iPhrase; int sz; if( Tcl_GetIntFromObj(interp, objv[2], &iPhrase) ){ return TCL_ERROR; } sz = p->pApi->xPhraseSize(p->pFts, iPhrase); if( rc==SQLITE_OK ){ Tcl_SetObjResult(interp, Tcl_NewIntObj(sz)); } break; } CASE(6, "xInstCount") { int nInst; rc = p->pApi->xInstCount(p->pFts, &nInst); if( rc==SQLITE_OK ){ Tcl_SetObjResult(interp, Tcl_NewIntObj(nInst)); } break; } CASE(7, "xInst") { int iIdx, ip, ic, io; if( Tcl_GetIntFromObj(interp, objv[2], &iIdx) ){ return TCL_ERROR; } rc = p->pApi->xInst(p->pFts, iIdx, &ip, &ic, &io); if( rc==SQLITE_OK ){ Tcl_Obj *pList = Tcl_NewObj(); Tcl_ListObjAppendElement(interp, pList, Tcl_NewIntObj(ip)); Tcl_ListObjAppendElement(interp, pList, Tcl_NewIntObj(ic)); Tcl_ListObjAppendElement(interp, pList, Tcl_NewIntObj(io)); Tcl_SetObjResult(interp, pList); } break; } CASE(8, "xRowid") { sqlite3_int64 iRowid = p->pApi->xRowid(p->pFts); Tcl_SetObjResult(interp, Tcl_NewWideIntObj(iRowid)); break; } CASE(9, "xColumnText") { const char *z = 0; int n = 0; int iCol; if( Tcl_GetIntFromObj(interp, objv[2], &iCol) ){ return TCL_ERROR; } rc = p->pApi->xColumnText(p->pFts, iCol, &z, &n); if( rc==SQLITE_OK ){ Tcl_SetObjResult(interp, Tcl_NewStringObj(z, n)); } break; } CASE(10, "xColumnSize") { int n = 0; int iCol; if( Tcl_GetIntFromObj(interp, objv[2], &iCol) ){ return TCL_ERROR; } rc = p->pApi->xColumnSize(p->pFts, iCol, &n); if( rc==SQLITE_OK ){ Tcl_SetObjResult(interp, Tcl_NewIntObj(n)); } break; } CASE(11, "xQueryPhrase") { int iPhrase; F5tFunction ctx; if( Tcl_GetIntFromObj(interp, objv[2], &iPhrase) ){ return TCL_ERROR; } ctx.interp = interp; ctx.pScript = objv[3]; rc = p->pApi->xQueryPhrase(p->pFts, iPhrase, &ctx, xQueryPhraseCb); if( rc==SQLITE_OK ){ Tcl_ResetResult(interp); } break; } CASE(12, "xSetAuxdata") { F5tAuxData *pData = (F5tAuxData*)sqlite3_malloc(sizeof(F5tAuxData)); if( pData==0 ){ Tcl_AppendResult(interp, "out of memory", 0); return TCL_ERROR; } pData->pObj = objv[2]; Tcl_IncrRefCount(pData->pObj); rc = p->pApi->xSetAuxdata(p->pFts, pData, xSetAuxdataDestructor); break; } CASE(13, "xGetAuxdata") { F5tAuxData *pData; int bClear; if( Tcl_GetBooleanFromObj(interp, objv[2], &bClear) ){ return TCL_ERROR; } pData = (F5tAuxData*)p->pApi->xGetAuxdata(p->pFts, bClear); if( pData==0 ){ Tcl_ResetResult(interp); }else{ Tcl_SetObjResult(interp, pData->pObj); if( bClear ){ xSetAuxdataDestructor((void*)pData); } } break; } /* These two - xSetAuxdataInt and xGetAuxdataInt - are similar to the ** xSetAuxdata and xGetAuxdata methods implemented above. The difference ** is that they may only save an integer value as auxiliary data, and ** do not specify a destructor function. */ CASE(14, "xSetAuxdataInt") { int iVal; if( Tcl_GetIntFromObj(interp, objv[2], &iVal) ) return TCL_ERROR; rc = p->pApi->xSetAuxdata(p->pFts, (void*)((char*)0 + iVal), 0); break; } CASE(15, "xGetAuxdataInt") { int iVal; int bClear; if( Tcl_GetBooleanFromObj(interp, objv[2], &bClear) ) return TCL_ERROR; iVal = ((char*)p->pApi->xGetAuxdata(p->pFts, bClear) - (char*)0); Tcl_SetObjResult(interp, Tcl_NewIntObj(iVal)); break; } CASE(16, "xPhraseForeach") { int iPhrase; int iCol; int iOff; const char *zColvar; const char *zOffvar; Tcl_Obj *pScript = objv[5]; Fts5PhraseIter iter; if( Tcl_GetIntFromObj(interp, objv[2], &iPhrase) ) return TCL_ERROR; zColvar = Tcl_GetString(objv[3]); zOffvar = Tcl_GetString(objv[4]); rc = p->pApi->xPhraseFirst(p->pFts, iPhrase, &iter, &iCol, &iOff); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); return TCL_ERROR; } for( ;iCol>=0; p->pApi->xPhraseNext(p->pFts, &iter, &iCol, &iOff) ){ Tcl_SetVar2Ex(interp, zColvar, 0, Tcl_NewIntObj(iCol), 0); Tcl_SetVar2Ex(interp, zOffvar, 0, Tcl_NewIntObj(iOff), 0); rc = Tcl_EvalObjEx(interp, pScript, 0); if( rc==TCL_CONTINUE ) rc = TCL_OK; if( rc!=TCL_OK ){ if( rc==TCL_BREAK ) rc = TCL_OK; break; } } break; } CASE(17, "xPhraseColumnForeach") { int iPhrase; int iCol; const char *zColvar; Tcl_Obj *pScript = objv[4]; Fts5PhraseIter iter; if( Tcl_GetIntFromObj(interp, objv[2], &iPhrase) ) return TCL_ERROR; zColvar = Tcl_GetString(objv[3]); rc = p->pApi->xPhraseFirstColumn(p->pFts, iPhrase, &iter, &iCol); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); return TCL_ERROR; } for( ; iCol>=0; p->pApi->xPhraseNextColumn(p->pFts, &iter, &iCol)){ Tcl_SetVar2Ex(interp, zColvar, 0, Tcl_NewIntObj(iCol), 0); rc = Tcl_EvalObjEx(interp, pScript, 0); if( rc==TCL_CONTINUE ) rc = TCL_OK; if( rc!=TCL_OK ){ if( rc==TCL_BREAK ) rc = TCL_OK; break; } } break; } default: assert( 0 ); break; } #undef CASE if( rc!=SQLITE_OK ){ Tcl_SetResult(interp, (char*)sqlite3ErrName(rc), TCL_VOLATILE); return TCL_ERROR; } return TCL_OK; } static void xF5tFunction( const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ Fts5Context *pFts, /* First arg to pass to pApi functions */ sqlite3_context *pCtx, /* Context for returning result/error */ int nVal, /* Number of values in apVal[] array */ sqlite3_value **apVal /* Array of trailing arguments */ ){ F5tFunction *p = (F5tFunction*)pApi->xUserData(pFts); Tcl_Obj *pEval; /* Script to evaluate */ int i; int rc; static sqlite3_int64 iCmd = 0; char zCmd[64]; F5tApi sApi; sApi.pApi = pApi; sApi.pFts = pFts; sprintf(zCmd, "f5t_%lld", iCmd++); Tcl_CreateObjCommand(p->interp, zCmd, xF5tApi, &sApi, 0); pEval = Tcl_DuplicateObj(p->pScript); Tcl_IncrRefCount(pEval); Tcl_ListObjAppendElement(p->interp, pEval, Tcl_NewStringObj(zCmd, -1)); for(i=0; iinterp, pEval, pObj); } rc = Tcl_EvalObjEx(p->interp, pEval, TCL_GLOBAL_ONLY); Tcl_DecrRefCount(pEval); Tcl_DeleteCommand(p->interp, zCmd); if( rc!=TCL_OK ){ sqlite3_result_error(pCtx, Tcl_GetStringResult(p->interp), -1); }else{ Tcl_Obj *pVar = Tcl_GetObjResult(p->interp); int n; const char *zType = (pVar->typePtr ? pVar->typePtr->name : ""); char c = zType[0]; if( c=='b' && strcmp(zType,"bytearray")==0 && pVar->bytes==0 ){ /* Only return a BLOB type if the Tcl variable is a bytearray and ** has no string representation. */ unsigned char *data = Tcl_GetByteArrayFromObj(pVar, &n); sqlite3_result_blob(pCtx, data, n, SQLITE_TRANSIENT); }else if( c=='b' && strcmp(zType,"boolean")==0 ){ Tcl_GetIntFromObj(0, pVar, &n); sqlite3_result_int(pCtx, n); }else if( c=='d' && strcmp(zType,"double")==0 ){ double r; Tcl_GetDoubleFromObj(0, pVar, &r); sqlite3_result_double(pCtx, r); }else if( (c=='w' && strcmp(zType,"wideInt")==0) || (c=='i' && strcmp(zType,"int")==0) ){ Tcl_WideInt v; Tcl_GetWideIntFromObj(0, pVar, &v); sqlite3_result_int64(pCtx, v); }else{ unsigned char *data = (unsigned char *)Tcl_GetStringFromObj(pVar, &n); sqlite3_result_text(pCtx, (char *)data, n, SQLITE_TRANSIENT); } } } static void xF5tDestroy(void *pCtx){ F5tFunction *p = (F5tFunction*)pCtx; Tcl_DecrRefCount(p->pScript); ckfree((char *)p); } /* ** sqlite3_fts5_create_function DB NAME SCRIPT ** ** Description... */ static int SQLITE_TCLAPI f5tCreateFunction( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ char *zName; Tcl_Obj *pScript; sqlite3 *db = 0; fts5_api *pApi = 0; F5tFunction *pCtx = 0; int rc; if( objc!=4 ){ Tcl_WrongNumArgs(interp, 1, objv, "DB NAME SCRIPT"); return TCL_ERROR; } if( f5tDbAndApi(interp, objv[1], &db, &pApi) ) return TCL_ERROR; zName = Tcl_GetString(objv[2]); pScript = objv[3]; pCtx = (F5tFunction*)ckalloc(sizeof(F5tFunction)); pCtx->interp = interp; pCtx->pScript = pScript; Tcl_IncrRefCount(pScript); rc = pApi->xCreateFunction( pApi, zName, (void*)pCtx, xF5tFunction, xF5tDestroy ); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, "error: ", sqlite3_errmsg(db), 0); return TCL_ERROR; } return TCL_OK; } typedef struct F5tTokenizeCtx F5tTokenizeCtx; struct F5tTokenizeCtx { Tcl_Obj *pRet; int bSubst; const char *zInput; }; static int xTokenizeCb2( void *pCtx, int tflags, const char *zToken, int nToken, int iStart, int iEnd ){ F5tTokenizeCtx *p = (F5tTokenizeCtx*)pCtx; if( p->bSubst ){ Tcl_ListObjAppendElement(0, p->pRet, Tcl_NewStringObj(zToken, nToken)); Tcl_ListObjAppendElement( 0, p->pRet, Tcl_NewStringObj(&p->zInput[iStart], iEnd-iStart) ); }else{ Tcl_ListObjAppendElement(0, p->pRet, Tcl_NewStringObj(zToken, nToken)); Tcl_ListObjAppendElement(0, p->pRet, Tcl_NewIntObj(iStart)); Tcl_ListObjAppendElement(0, p->pRet, Tcl_NewIntObj(iEnd)); } return SQLITE_OK; } /* ** sqlite3_fts5_tokenize DB TOKENIZER TEXT ** ** Description... */ static int SQLITE_TCLAPI f5tTokenize( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ char *zText; int nText; sqlite3 *db = 0; fts5_api *pApi = 0; Fts5Tokenizer *pTok = 0; fts5_tokenizer tokenizer; Tcl_Obj *pRet = 0; void *pUserdata; int rc; int nArg; const char **azArg; F5tTokenizeCtx ctx; if( objc!=4 && objc!=5 ){ Tcl_WrongNumArgs(interp, 1, objv, "?-subst? DB NAME TEXT"); return TCL_ERROR; } if( objc==5 ){ char *zOpt = Tcl_GetString(objv[1]); if( strcmp("-subst", zOpt) ){ Tcl_AppendResult(interp, "unrecognized option: ", zOpt, 0); return TCL_ERROR; } } if( f5tDbAndApi(interp, objv[objc-3], &db, &pApi) ) return TCL_ERROR; if( Tcl_SplitList(interp, Tcl_GetString(objv[objc-2]), &nArg, &azArg) ){ return TCL_ERROR; } if( nArg==0 ){ Tcl_AppendResult(interp, "no such tokenizer: ", 0); Tcl_Free((void*)azArg); return TCL_ERROR; } zText = Tcl_GetStringFromObj(objv[objc-1], &nText); rc = pApi->xFindTokenizer(pApi, azArg[0], &pUserdata, &tokenizer); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, "no such tokenizer: ", azArg[0], 0); return TCL_ERROR; } rc = tokenizer.xCreate(pUserdata, &azArg[1], nArg-1, &pTok); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, "error in tokenizer.xCreate()", 0); return TCL_ERROR; } pRet = Tcl_NewObj(); Tcl_IncrRefCount(pRet); ctx.bSubst = (objc==5); ctx.pRet = pRet; ctx.zInput = zText; rc = tokenizer.xTokenize( pTok, (void*)&ctx, FTS5_TOKENIZE_DOCUMENT, zText, nText, xTokenizeCb2 ); tokenizer.xDelete(pTok); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, "error in tokenizer.xTokenize()", 0); Tcl_DecrRefCount(pRet); return TCL_ERROR; } Tcl_Free((void*)azArg); Tcl_SetObjResult(interp, pRet); Tcl_DecrRefCount(pRet); return TCL_OK; } /************************************************************************* ** Start of tokenizer wrapper. */ typedef struct F5tTokenizerContext F5tTokenizerContext; typedef struct F5tTokenizerCb F5tTokenizerCb; typedef struct F5tTokenizerModule F5tTokenizerModule; typedef struct F5tTokenizerInstance F5tTokenizerInstance; struct F5tTokenizerContext { void *pCtx; int (*xToken)(void*, int, const char*, int, int, int); }; struct F5tTokenizerModule { Tcl_Interp *interp; Tcl_Obj *pScript; F5tTokenizerContext *pContext; }; struct F5tTokenizerInstance { Tcl_Interp *interp; Tcl_Obj *pScript; F5tTokenizerContext *pContext; }; static int f5tTokenizerCreate( void *pCtx, const char **azArg, int nArg, Fts5Tokenizer **ppOut ){ F5tTokenizerModule *pMod = (F5tTokenizerModule*)pCtx; Tcl_Obj *pEval; int rc = TCL_OK; int i; pEval = Tcl_DuplicateObj(pMod->pScript); Tcl_IncrRefCount(pEval); for(i=0; rc==TCL_OK && iinterp, pEval, pObj); } if( rc==TCL_OK ){ rc = Tcl_EvalObjEx(pMod->interp, pEval, TCL_GLOBAL_ONLY); } Tcl_DecrRefCount(pEval); if( rc==TCL_OK ){ F5tTokenizerInstance *pInst; pInst = (F5tTokenizerInstance*)ckalloc(sizeof(F5tTokenizerInstance)); memset(pInst, 0, sizeof(F5tTokenizerInstance)); pInst->interp = pMod->interp; pInst->pScript = Tcl_GetObjResult(pMod->interp); pInst->pContext = pMod->pContext; Tcl_IncrRefCount(pInst->pScript); *ppOut = (Fts5Tokenizer*)pInst; } return rc; } static void f5tTokenizerDelete(Fts5Tokenizer *p){ F5tTokenizerInstance *pInst = (F5tTokenizerInstance*)p; Tcl_DecrRefCount(pInst->pScript); ckfree((char *)pInst); } static int f5tTokenizerTokenize( Fts5Tokenizer *p, void *pCtx, int flags, const char *pText, int nText, int (*xToken)(void*, int, const char*, int, int, int) ){ F5tTokenizerInstance *pInst = (F5tTokenizerInstance*)p; void *pOldCtx; int (*xOldToken)(void*, int, const char*, int, int, int); Tcl_Obj *pEval; int rc; const char *zFlags; pOldCtx = pInst->pContext->pCtx; xOldToken = pInst->pContext->xToken; pInst->pContext->pCtx = pCtx; pInst->pContext->xToken = xToken; assert( flags==FTS5_TOKENIZE_DOCUMENT || flags==FTS5_TOKENIZE_AUX || flags==FTS5_TOKENIZE_QUERY || flags==(FTS5_TOKENIZE_QUERY | FTS5_TOKENIZE_PREFIX) ); pEval = Tcl_DuplicateObj(pInst->pScript); Tcl_IncrRefCount(pEval); switch( flags ){ case FTS5_TOKENIZE_DOCUMENT: zFlags = "document"; break; case FTS5_TOKENIZE_AUX: zFlags = "aux"; break; case FTS5_TOKENIZE_QUERY: zFlags = "query"; break; case (FTS5_TOKENIZE_PREFIX | FTS5_TOKENIZE_QUERY): zFlags = "prefixquery"; break; default: assert( 0 ); zFlags = "invalid"; break; } Tcl_ListObjAppendElement(pInst->interp, pEval, Tcl_NewStringObj(zFlags, -1)); Tcl_ListObjAppendElement(pInst->interp, pEval, Tcl_NewStringObj(pText,nText)); rc = Tcl_EvalObjEx(pInst->interp, pEval, TCL_GLOBAL_ONLY); Tcl_DecrRefCount(pEval); pInst->pContext->pCtx = pOldCtx; pInst->pContext->xToken = xOldToken; return rc; } /* ** sqlite3_fts5_token ?-colocated? TEXT START END */ static int SQLITE_TCLAPI f5tTokenizerReturn( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ F5tTokenizerContext *p = (F5tTokenizerContext*)clientData; int iStart; int iEnd; int nToken; int tflags = 0; char *zToken; int rc; if( objc==5 ){ int nArg; char *zArg = Tcl_GetStringFromObj(objv[1], &nArg); if( nArg<=10 && nArg>=2 && memcmp("-colocated", zArg, nArg)==0 ){ tflags |= FTS5_TOKEN_COLOCATED; }else{ goto usage; } }else if( objc!=4 ){ goto usage; } zToken = Tcl_GetStringFromObj(objv[objc-3], &nToken); if( Tcl_GetIntFromObj(interp, objv[objc-2], &iStart) || Tcl_GetIntFromObj(interp, objv[objc-1], &iEnd) ){ return TCL_ERROR; } if( p->xToken==0 ){ Tcl_AppendResult(interp, "sqlite3_fts5_token may only be used by tokenizer callback", 0 ); return TCL_ERROR; } rc = p->xToken(p->pCtx, tflags, zToken, nToken, iStart, iEnd); Tcl_SetResult(interp, (char*)sqlite3ErrName(rc), TCL_VOLATILE); return TCL_OK; usage: Tcl_WrongNumArgs(interp, 1, objv, "?-colocated? TEXT START END"); return TCL_ERROR; } static void f5tDelTokenizer(void *pCtx){ F5tTokenizerModule *pMod = (F5tTokenizerModule*)pCtx; Tcl_DecrRefCount(pMod->pScript); ckfree((char *)pMod); } /* ** sqlite3_fts5_create_tokenizer DB NAME SCRIPT ** ** Register a tokenizer named NAME implemented by script SCRIPT. When ** a tokenizer instance is created (fts5_tokenizer.xCreate), any tokenizer ** arguments are appended to SCRIPT and the result executed. ** ** The value returned by (SCRIPT + args) is itself a tcl script. This ** script - call it SCRIPT2 - is executed to tokenize text using the ** tokenizer instance "returned" by SCRIPT. Specifically, to tokenize ** text SCRIPT2 is invoked with a single argument appended to it - the ** text to tokenize. ** ** SCRIPT2 should invoke the [sqlite3_fts5_token] command once for each ** token within the tokenized text. */ static int SQLITE_TCLAPI f5tCreateTokenizer( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ F5tTokenizerContext *pContext = (F5tTokenizerContext*)clientData; sqlite3 *db; fts5_api *pApi; char *zName; Tcl_Obj *pScript; fts5_tokenizer t; F5tTokenizerModule *pMod; int rc; if( objc!=4 ){ Tcl_WrongNumArgs(interp, 1, objv, "DB NAME SCRIPT"); return TCL_ERROR; } if( f5tDbAndApi(interp, objv[1], &db, &pApi) ){ return TCL_ERROR; } zName = Tcl_GetString(objv[2]); pScript = objv[3]; t.xCreate = f5tTokenizerCreate; t.xTokenize = f5tTokenizerTokenize; t.xDelete = f5tTokenizerDelete; pMod = (F5tTokenizerModule*)ckalloc(sizeof(F5tTokenizerModule)); pMod->interp = interp; pMod->pScript = pScript; pMod->pContext = pContext; Tcl_IncrRefCount(pScript); rc = pApi->xCreateTokenizer(pApi, zName, (void*)pMod, &t, f5tDelTokenizer); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, "error in fts5_api.xCreateTokenizer()", 0); return TCL_ERROR; } return TCL_OK; } static void SQLITE_TCLAPI xF5tFree(ClientData clientData){ ckfree(clientData); } /* ** sqlite3_fts5_may_be_corrupt BOOLEAN ** ** Set or clear the global "may-be-corrupt" flag. Return the old value. */ static int SQLITE_TCLAPI f5tMayBeCorrupt( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ int bOld = sqlite3_fts5_may_be_corrupt; if( objc!=2 && objc!=1 ){ Tcl_WrongNumArgs(interp, 1, objv, "?BOOLEAN?"); return TCL_ERROR; } if( objc==2 ){ int bNew; if( Tcl_GetBooleanFromObj(interp, objv[1], &bNew) ) return TCL_ERROR; sqlite3_fts5_may_be_corrupt = bNew; } Tcl_SetObjResult(interp, Tcl_NewIntObj(bOld)); return TCL_OK; } static unsigned int f5t_fts5HashKey(int nSlot, const char *p, int n){ int i; unsigned int h = 13; for(i=n-1; i>=0; i--){ h = (h << 3) ^ h ^ p[i]; } return (h % nSlot); } static int SQLITE_TCLAPI f5tTokenHash( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ char *z; int n; unsigned int iVal; int nSlot; if( objc!=3 ){ Tcl_WrongNumArgs(interp, 1, objv, "NSLOT TOKEN"); return TCL_ERROR; } if( Tcl_GetIntFromObj(interp, objv[1], &nSlot) ){ return TCL_ERROR; } z = Tcl_GetStringFromObj(objv[2], &n); iVal = f5t_fts5HashKey(nSlot, z, n); Tcl_SetObjResult(interp, Tcl_NewIntObj(iVal)); return TCL_OK; } static int SQLITE_TCLAPI f5tRegisterMatchinfo( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ int rc; sqlite3 *db = 0; if( objc!=2 ){ Tcl_WrongNumArgs(interp, 1, objv, "DB"); return TCL_ERROR; } if( f5tDbPointer(interp, objv[1], &db) ){ return TCL_ERROR; } rc = sqlite3Fts5TestRegisterMatchinfo(db); if( rc!=SQLITE_OK ){ Tcl_SetResult(interp, (char*)sqlite3ErrName(rc), TCL_VOLATILE); return TCL_ERROR; } return TCL_OK; } static int SQLITE_TCLAPI f5tRegisterTok( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ int rc; sqlite3 *db = 0; fts5_api *pApi = 0; if( objc!=2 ){ Tcl_WrongNumArgs(interp, 1, objv, "DB"); return TCL_ERROR; } if( f5tDbAndApi(interp, objv[1], &db, &pApi) ){ return TCL_ERROR; } rc = sqlite3Fts5TestRegisterTok(db, pApi); if( rc!=SQLITE_OK ){ Tcl_SetResult(interp, (char*)sqlite3ErrName(rc), TCL_VOLATILE); return TCL_ERROR; } return TCL_OK; } /* ** Entry point. */ int Fts5tcl_Init(Tcl_Interp *interp){ static struct Cmd { char *zName; Tcl_ObjCmdProc *xProc; int bTokenizeCtx; } aCmd[] = { { "sqlite3_fts5_create_tokenizer", f5tCreateTokenizer, 1 }, { "sqlite3_fts5_token", f5tTokenizerReturn, 1 }, { "sqlite3_fts5_tokenize", f5tTokenize, 0 }, { "sqlite3_fts5_create_function", f5tCreateFunction, 0 }, { "sqlite3_fts5_may_be_corrupt", f5tMayBeCorrupt, 0 }, { "sqlite3_fts5_token_hash", f5tTokenHash, 0 }, { "sqlite3_fts5_register_matchinfo", f5tRegisterMatchinfo, 0 }, { "sqlite3_fts5_register_fts5tokenize", f5tRegisterTok, 0 } }; int i; F5tTokenizerContext *pContext; pContext = (F5tTokenizerContext*)ckalloc(sizeof(F5tTokenizerContext)); memset(pContext, 0, sizeof(*pContext)); for(i=0; ibTokenizeCtx ) pCtx = (void*)pContext; Tcl_CreateObjCommand(interp, p->zName, p->xProc, pCtx, (i ? 0 : xF5tFree)); } return TCL_OK; } #else /* SQLITE_ENABLE_FTS5 */ int Fts5tcl_Init(Tcl_Interp *interp){ return TCL_OK; } #endif /* SQLITE_ENABLE_FTS5 */ #endif /* SQLITE_TEST */ ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_test_mi.c ================================================ /* ** 2015 Aug 04 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This file contains test code only, it is not included in release ** versions of FTS5. It contains the implementation of an FTS5 auxiliary ** function very similar to the FTS4 function matchinfo(): ** ** https://www.sqlite.org/fts3.html#matchinfo ** ** Known differences are that: ** ** 1) this function uses the FTS5 definition of "matchable phrase", which ** excludes any phrases that are part of an expression sub-tree that ** does not match the current row. This comes up for MATCH queries ** such as: ** ** "a OR (b AND c)" ** ** In FTS4, if a single row contains instances of tokens "a" and "c", ** but not "b", all instances of "c" are considered matches. In FTS5, ** they are not (as the "b AND c" sub-tree does not match the current ** row. ** ** 2) For the values returned by 'x' that apply to all rows of the table, ** NEAR constraints are not considered. But for the number of hits in ** the current row, they are. ** ** This file exports a single function that may be called to register the ** matchinfo() implementation with a database handle: ** ** int sqlite3Fts5TestRegisterMatchinfo(sqlite3 *db); */ #ifdef SQLITE_ENABLE_FTS5 #include "fts5.h" #include #include typedef struct Fts5MatchinfoCtx Fts5MatchinfoCtx; #ifndef SQLITE_AMALGAMATION typedef unsigned int u32; #endif struct Fts5MatchinfoCtx { int nCol; /* Number of cols in FTS5 table */ int nPhrase; /* Number of phrases in FTS5 query */ char *zArg; /* nul-term'd copy of 2nd arg */ int nRet; /* Number of elements in aRet[] */ u32 *aRet; /* Array of 32-bit unsigned ints to return */ }; /* ** Return a pointer to the fts5_api pointer for database connection db. ** If an error occurs, return NULL and leave an error in the database ** handle (accessible using sqlite3_errcode()/errmsg()). */ static int fts5_api_from_db(sqlite3 *db, fts5_api **ppApi){ sqlite3_stmt *pStmt = 0; int rc; *ppApi = 0; rc = sqlite3_prepare(db, "SELECT fts5(?1)", -1, &pStmt, 0); if( rc==SQLITE_OK ){ sqlite3_bind_pointer(pStmt, 1, (void*)ppApi, "fts5_api_ptr", 0); (void)sqlite3_step(pStmt); rc = sqlite3_finalize(pStmt); } return rc; } /* ** Argument f should be a flag accepted by matchinfo() (a valid character ** in the string passed as the second argument). If it is not, -1 is ** returned. Otherwise, if f is a valid matchinfo flag, the value returned ** is the number of 32-bit integers added to the output array if the ** table has nCol columns and the query nPhrase phrases. */ static int fts5MatchinfoFlagsize(int nCol, int nPhrase, char f){ int ret = -1; switch( f ){ case 'p': ret = 1; break; case 'c': ret = 1; break; case 'x': ret = 3 * nCol * nPhrase; break; case 'y': ret = nCol * nPhrase; break; case 'b': ret = ((nCol + 31) / 32) * nPhrase; break; case 'n': ret = 1; break; case 'a': ret = nCol; break; case 'l': ret = nCol; break; case 's': ret = nCol; break; } return ret; } static int fts5MatchinfoIter( const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ Fts5Context *pFts, /* First arg to pass to pApi functions */ Fts5MatchinfoCtx *p, int(*x)(const Fts5ExtensionApi*,Fts5Context*,Fts5MatchinfoCtx*,char,u32*) ){ int i; int n = 0; int rc = SQLITE_OK; char f; for(i=0; (f = p->zArg[i]); i++){ rc = x(pApi, pFts, p, f, &p->aRet[n]); if( rc!=SQLITE_OK ) break; n += fts5MatchinfoFlagsize(p->nCol, p->nPhrase, f); } return rc; } static int fts5MatchinfoXCb( const Fts5ExtensionApi *pApi, Fts5Context *pFts, void *pUserData ){ Fts5PhraseIter iter; int iCol, iOff; u32 *aOut = (u32*)pUserData; int iPrev = -1; for(pApi->xPhraseFirst(pFts, 0, &iter, &iCol, &iOff); iCol>=0; pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) ){ aOut[iCol*3+1]++; if( iCol!=iPrev ) aOut[iCol*3 + 2]++; iPrev = iCol; } return SQLITE_OK; } static int fts5MatchinfoGlobalCb( const Fts5ExtensionApi *pApi, Fts5Context *pFts, Fts5MatchinfoCtx *p, char f, u32 *aOut ){ int rc = SQLITE_OK; switch( f ){ case 'p': aOut[0] = p->nPhrase; break; case 'c': aOut[0] = p->nCol; break; case 'x': { int i; for(i=0; inPhrase && rc==SQLITE_OK; i++){ void *pPtr = (void*)&aOut[i * p->nCol * 3]; rc = pApi->xQueryPhrase(pFts, i, pPtr, fts5MatchinfoXCb); } break; } case 'n': { sqlite3_int64 nRow; rc = pApi->xRowCount(pFts, &nRow); aOut[0] = (u32)nRow; break; } case 'a': { sqlite3_int64 nRow = 0; rc = pApi->xRowCount(pFts, &nRow); if( nRow==0 ){ memset(aOut, 0, sizeof(u32) * p->nCol); }else{ int i; for(i=0; rc==SQLITE_OK && inCol; i++){ sqlite3_int64 nToken; rc = pApi->xColumnTotalSize(pFts, i, &nToken); if( rc==SQLITE_OK){ aOut[i] = (u32)((2*nToken + nRow) / (2*nRow)); } } } break; } } return rc; } static int fts5MatchinfoLocalCb( const Fts5ExtensionApi *pApi, Fts5Context *pFts, Fts5MatchinfoCtx *p, char f, u32 *aOut ){ int i; int rc = SQLITE_OK; switch( f ){ case 'b': { int iPhrase; int nInt = ((p->nCol + 31) / 32) * p->nPhrase; for(i=0; inPhrase; iPhrase++){ Fts5PhraseIter iter; int iCol; for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); iCol>=0; pApi->xPhraseNextColumn(pFts, &iter, &iCol) ){ aOut[iPhrase * ((p->nCol+31)/32) + iCol/32] |= ((u32)1 << iCol%32); } } break; } case 'x': case 'y': { int nMul = (f=='x' ? 3 : 1); int iPhrase; for(i=0; i<(p->nCol*p->nPhrase); i++) aOut[i*nMul] = 0; for(iPhrase=0; iPhrasenPhrase; iPhrase++){ Fts5PhraseIter iter; int iOff, iCol; for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); iOff>=0; pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) ){ aOut[nMul * (iCol + iPhrase * p->nCol)]++; } } break; } case 'l': { for(i=0; rc==SQLITE_OK && inCol; i++){ int nToken; rc = pApi->xColumnSize(pFts, i, &nToken); aOut[i] = (u32)nToken; } break; } case 's': { int nInst; memset(aOut, 0, sizeof(u32) * p->nCol); rc = pApi->xInstCount(pFts, &nInst); for(i=0; rc==SQLITE_OK && ixInst(pFts, i, &iPhrase, &iCol, &iOff); iNextPhrase = iPhrase+1; iNextOff = iOff+pApi->xPhraseSize(pFts, 0); for(j=i+1; rc==SQLITE_OK && jxInst(pFts, j, &ip, &ic, &io); if( ic!=iCol || io>iNextOff ) break; if( ip==iNextPhrase && io==iNextOff ){ nSeq++; iNextPhrase = ip+1; iNextOff = io + pApi->xPhraseSize(pFts, ip); } } if( nSeq>aOut[iCol] ) aOut[iCol] = nSeq; } break; } } return rc; } static Fts5MatchinfoCtx *fts5MatchinfoNew( const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ Fts5Context *pFts, /* First arg to pass to pApi functions */ sqlite3_context *pCtx, /* Context for returning error message */ const char *zArg /* Matchinfo flag string */ ){ Fts5MatchinfoCtx *p; int nCol; int nPhrase; int i; int nInt; int nByte; int rc; nCol = pApi->xColumnCount(pFts); nPhrase = pApi->xPhraseCount(pFts); nInt = 0; for(i=0; zArg[i]; i++){ int n = fts5MatchinfoFlagsize(nCol, nPhrase, zArg[i]); if( n<0 ){ char *zErr = sqlite3_mprintf("unrecognized matchinfo flag: %c", zArg[i]); sqlite3_result_error(pCtx, zErr, -1); sqlite3_free(zErr); return 0; } nInt += n; } nByte = sizeof(Fts5MatchinfoCtx) /* The struct itself */ + sizeof(u32) * nInt /* The p->aRet[] array */ + (i+1); /* The p->zArg string */ p = (Fts5MatchinfoCtx*)sqlite3_malloc(nByte); if( p==0 ){ sqlite3_result_error_nomem(pCtx); return 0; } memset(p, 0, nByte); p->nCol = nCol; p->nPhrase = nPhrase; p->aRet = (u32*)&p[1]; p->nRet = nInt; p->zArg = (char*)&p->aRet[nInt]; memcpy(p->zArg, zArg, i); rc = fts5MatchinfoIter(pApi, pFts, p, fts5MatchinfoGlobalCb); if( rc!=SQLITE_OK ){ sqlite3_result_error_code(pCtx, rc); sqlite3_free(p); p = 0; } return p; } static void fts5MatchinfoFunc( const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ Fts5Context *pFts, /* First arg to pass to pApi functions */ sqlite3_context *pCtx, /* Context for returning result/error */ int nVal, /* Number of values in apVal[] array */ sqlite3_value **apVal /* Array of trailing arguments */ ){ const char *zArg; Fts5MatchinfoCtx *p; int rc = SQLITE_OK; if( nVal>0 ){ zArg = (const char*)sqlite3_value_text(apVal[0]); }else{ zArg = "pcx"; } p = (Fts5MatchinfoCtx*)pApi->xGetAuxdata(pFts, 0); if( p==0 || sqlite3_stricmp(zArg, p->zArg) ){ p = fts5MatchinfoNew(pApi, pFts, pCtx, zArg); if( p==0 ){ rc = SQLITE_NOMEM; }else{ rc = pApi->xSetAuxdata(pFts, p, sqlite3_free); } } if( rc==SQLITE_OK ){ rc = fts5MatchinfoIter(pApi, pFts, p, fts5MatchinfoLocalCb); } if( rc!=SQLITE_OK ){ sqlite3_result_error_code(pCtx, rc); }else{ /* No errors has occured, so return a copy of the array of integers. */ int nByte = p->nRet * sizeof(u32); sqlite3_result_blob(pCtx, (void*)p->aRet, nByte, SQLITE_TRANSIENT); } } int sqlite3Fts5TestRegisterMatchinfo(sqlite3 *db){ int rc; /* Return code */ fts5_api *pApi; /* FTS5 API functions */ /* Extract the FTS5 API pointer from the database handle. The ** fts5_api_from_db() function above is copied verbatim from the ** FTS5 documentation. Refer there for details. */ rc = fts5_api_from_db(db, &pApi); if( rc!=SQLITE_OK ) return rc; /* If fts5_api_from_db() returns NULL, then either FTS5 is not registered ** with this database handle, or an error (OOM perhaps?) has occurred. ** ** Also check that the fts5_api object is version 2 or newer. */ if( pApi==0 || pApi->iVersion<2 ){ return SQLITE_ERROR; } /* Register the implementation of matchinfo() */ rc = pApi->xCreateFunction(pApi, "matchinfo", 0, fts5MatchinfoFunc, 0); return rc; } #endif /* SQLITE_ENABLE_FTS5 */ ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_test_tok.c ================================================ /* ** 2013 Apr 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This file contains code for the "fts5tokenize" virtual table module. ** An fts5tokenize virtual table is created as follows: ** ** CREATE VIRTUAL TABLE USING fts5tokenize( ** , , ... ** ); ** ** The table created has the following schema: ** ** CREATE TABLE (input HIDDEN, token, start, end, position) ** ** When queried, the query must include a WHERE clause of type: ** ** input = ** ** The virtual table module tokenizes this , using the FTS3 ** tokenizer specified by the arguments to the CREATE VIRTUAL TABLE ** statement and returns one row for each token in the result. With ** fields set as follows: ** ** input: Always set to a copy of ** token: A token from the input. ** start: Byte offset of the token within the input . ** end: Byte offset of the byte immediately following the end of the ** token within the input string. ** pos: Token offset of token within input. ** */ #if defined(SQLITE_TEST) && defined(SQLITE_ENABLE_FTS5) #include "fts5.h" #include #include typedef struct Fts5tokTable Fts5tokTable; typedef struct Fts5tokCursor Fts5tokCursor; typedef struct Fts5tokRow Fts5tokRow; /* ** Virtual table structure. */ struct Fts5tokTable { sqlite3_vtab base; /* Base class used by SQLite core */ fts5_tokenizer tok; /* Tokenizer functions */ Fts5Tokenizer *pTok; /* Tokenizer instance */ }; /* ** A container for a rows values. */ struct Fts5tokRow { char *zToken; int iStart; int iEnd; int iPos; }; /* ** Virtual table cursor structure. */ struct Fts5tokCursor { sqlite3_vtab_cursor base; /* Base class used by SQLite core */ int iRowid; /* Current 'rowid' value */ char *zInput; /* Input string */ int nRow; /* Number of entries in aRow[] */ Fts5tokRow *aRow; /* Array of rows to return */ }; static void fts5tokDequote(char *z){ char q = z[0]; if( q=='[' || q=='\'' || q=='"' || q=='`' ){ int iIn = 1; int iOut = 0; if( q=='[' ) q = ']'; while( z[iIn] ){ if( z[iIn]==q ){ if( z[iIn+1]!=q ){ /* Character iIn was the close quote. */ iIn++; break; }else{ /* Character iIn and iIn+1 form an escaped quote character. Skip ** the input cursor past both and copy a single quote character ** to the output buffer. */ iIn += 2; z[iOut++] = q; } }else{ z[iOut++] = z[iIn++]; } } z[iOut] = '\0'; } } /* ** The second argument, argv[], is an array of pointers to nul-terminated ** strings. This function makes a copy of the array and strings into a ** single block of memory. It then dequotes any of the strings that appear ** to be quoted. ** ** If successful, output parameter *pazDequote is set to point at the ** array of dequoted strings and SQLITE_OK is returned. The caller is ** responsible for eventually calling sqlite3_free() to free the array ** in this case. Or, if an error occurs, an SQLite error code is returned. ** The final value of *pazDequote is undefined in this case. */ static int fts5tokDequoteArray( int argc, /* Number of elements in argv[] */ const char * const *argv, /* Input array */ char ***pazDequote /* Output array */ ){ int rc = SQLITE_OK; /* Return code */ if( argc==0 ){ *pazDequote = 0; }else{ int i; int nByte = 0; char **azDequote; for(i=0; i0 ){ zModule = azDequote[0]; } rc = pApi->xFindTokenizer(pApi, zModule, &pTokCtx, &pTab->tok); if( rc==SQLITE_OK ){ const char **azArg = (const char **)&azDequote[1]; int nArg = nDequote>0 ? nDequote-1 : 0; rc = pTab->tok.xCreate(pTokCtx, azArg, nArg, &pTab->pTok); } } if( rc!=SQLITE_OK ){ sqlite3_free(pTab); pTab = 0; } *ppVtab = (sqlite3_vtab*)pTab; sqlite3_free(azDequote); return rc; } /* ** This function does the work for both the xDisconnect and xDestroy methods. ** These tables have no persistent representation of their own, so xDisconnect ** and xDestroy are identical operations. */ static int fts5tokDisconnectMethod(sqlite3_vtab *pVtab){ Fts5tokTable *pTab = (Fts5tokTable *)pVtab; if( pTab->pTok ){ pTab->tok.xDelete(pTab->pTok); } sqlite3_free(pTab); return SQLITE_OK; } /* ** xBestIndex - Analyze a WHERE and ORDER BY clause. */ static int fts5tokBestIndexMethod( sqlite3_vtab *pVTab, sqlite3_index_info *pInfo ){ int i; for(i=0; inConstraint; i++){ if( pInfo->aConstraint[i].usable && pInfo->aConstraint[i].iColumn==0 && pInfo->aConstraint[i].op==SQLITE_INDEX_CONSTRAINT_EQ ){ pInfo->idxNum = 1; pInfo->aConstraintUsage[i].argvIndex = 1; pInfo->aConstraintUsage[i].omit = 1; pInfo->estimatedCost = 1; return SQLITE_OK; } } pInfo->idxNum = 0; assert( pInfo->estimatedCost>1000000.0 ); return SQLITE_OK; } /* ** xOpen - Open a cursor. */ static int fts5tokOpenMethod(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr){ Fts5tokCursor *pCsr; pCsr = (Fts5tokCursor *)sqlite3_malloc(sizeof(Fts5tokCursor)); if( pCsr==0 ){ return SQLITE_NOMEM; } memset(pCsr, 0, sizeof(Fts5tokCursor)); *ppCsr = (sqlite3_vtab_cursor *)pCsr; return SQLITE_OK; } /* ** Reset the tokenizer cursor passed as the only argument. As if it had ** just been returned by fts5tokOpenMethod(). */ static void fts5tokResetCursor(Fts5tokCursor *pCsr){ int i; for(i=0; inRow; i++){ sqlite3_free(pCsr->aRow[i].zToken); } sqlite3_free(pCsr->zInput); sqlite3_free(pCsr->aRow); pCsr->zInput = 0; pCsr->aRow = 0; pCsr->nRow = 0; pCsr->iRowid = 0; } /* ** xClose - Close a cursor. */ static int fts5tokCloseMethod(sqlite3_vtab_cursor *pCursor){ Fts5tokCursor *pCsr = (Fts5tokCursor *)pCursor; fts5tokResetCursor(pCsr); sqlite3_free(pCsr); return SQLITE_OK; } /* ** xNext - Advance the cursor to the next row, if any. */ static int fts5tokNextMethod(sqlite3_vtab_cursor *pCursor){ Fts5tokCursor *pCsr = (Fts5tokCursor *)pCursor; pCsr->iRowid++; return SQLITE_OK; } static int fts5tokCb( void *pCtx, /* Pointer to Fts5tokCursor */ int tflags, /* Mask of FTS5_TOKEN_* flags */ const char *pToken, /* Pointer to buffer containing token */ int nToken, /* Size of token in bytes */ int iStart, /* Byte offset of token within input text */ int iEnd /* Byte offset of end of token within input text */ ){ Fts5tokCursor *pCsr = (Fts5tokCursor*)pCtx; Fts5tokRow *pRow; if( (pCsr->nRow & (pCsr->nRow-1))==0 ){ int nNew = pCsr->nRow ? pCsr->nRow*2 : 32; Fts5tokRow *aNew; aNew = (Fts5tokRow*)sqlite3_realloc(pCsr->aRow, nNew*sizeof(Fts5tokRow)); if( aNew==0 ) return SQLITE_NOMEM; memset(&aNew[pCsr->nRow], 0, sizeof(Fts5tokRow)*(nNew-pCsr->nRow)); pCsr->aRow = aNew; } pRow = &pCsr->aRow[pCsr->nRow]; pRow->iStart = iStart; pRow->iEnd = iEnd; if( pCsr->nRow ){ pRow->iPos = pRow[-1].iPos + ((tflags & FTS5_TOKEN_COLOCATED) ? 0 : 1); } pRow->zToken = sqlite3_malloc(nToken+1); if( pRow->zToken==0 ) return SQLITE_NOMEM; memcpy(pRow->zToken, pToken, nToken); pRow->zToken[nToken] = 0; pCsr->nRow++; return SQLITE_OK; } /* ** xFilter - Initialize a cursor to point at the start of its data. */ static int fts5tokFilterMethod( sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */ int idxNum, /* Strategy index */ const char *idxStr, /* Unused */ int nVal, /* Number of elements in apVal */ sqlite3_value **apVal /* Arguments for the indexing scheme */ ){ int rc = SQLITE_ERROR; Fts5tokCursor *pCsr = (Fts5tokCursor *)pCursor; Fts5tokTable *pTab = (Fts5tokTable *)(pCursor->pVtab); fts5tokResetCursor(pCsr); if( idxNum==1 ){ const char *zByte = (const char *)sqlite3_value_text(apVal[0]); int nByte = sqlite3_value_bytes(apVal[0]); pCsr->zInput = sqlite3_malloc(nByte+1); if( pCsr->zInput==0 ){ rc = SQLITE_NOMEM; }else{ memcpy(pCsr->zInput, zByte, nByte); pCsr->zInput[nByte] = 0; rc = pTab->tok.xTokenize( pTab->pTok, (void*)pCsr, 0, zByte, nByte, fts5tokCb ); } } if( rc!=SQLITE_OK ) return rc; return fts5tokNextMethod(pCursor); } /* ** xEof - Return true if the cursor is at EOF, or false otherwise. */ static int fts5tokEofMethod(sqlite3_vtab_cursor *pCursor){ Fts5tokCursor *pCsr = (Fts5tokCursor *)pCursor; return (pCsr->iRowid>pCsr->nRow); } /* ** xColumn - Return a column value. */ static int fts5tokColumnMethod( sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ sqlite3_context *pCtx, /* Context for sqlite3_result_xxx() calls */ int iCol /* Index of column to read value from */ ){ Fts5tokCursor *pCsr = (Fts5tokCursor *)pCursor; Fts5tokRow *pRow = &pCsr->aRow[pCsr->iRowid-1]; /* CREATE TABLE x(input, token, start, end, position) */ switch( iCol ){ case 0: sqlite3_result_text(pCtx, pCsr->zInput, -1, SQLITE_TRANSIENT); break; case 1: sqlite3_result_text(pCtx, pRow->zToken, -1, SQLITE_TRANSIENT); break; case 2: sqlite3_result_int(pCtx, pRow->iStart); break; case 3: sqlite3_result_int(pCtx, pRow->iEnd); break; default: assert( iCol==4 ); sqlite3_result_int(pCtx, pRow->iPos); break; } return SQLITE_OK; } /* ** xRowid - Return the current rowid for the cursor. */ static int fts5tokRowidMethod( sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ sqlite_int64 *pRowid /* OUT: Rowid value */ ){ Fts5tokCursor *pCsr = (Fts5tokCursor *)pCursor; *pRowid = (sqlite3_int64)pCsr->iRowid; return SQLITE_OK; } /* ** Register the fts5tok module with database connection db. Return SQLITE_OK ** if successful or an error code if sqlite3_create_module() fails. */ int sqlite3Fts5TestRegisterTok(sqlite3 *db, fts5_api *pApi){ static const sqlite3_module fts5tok_module = { 0, /* iVersion */ fts5tokConnectMethod, /* xCreate */ fts5tokConnectMethod, /* xConnect */ fts5tokBestIndexMethod, /* xBestIndex */ fts5tokDisconnectMethod, /* xDisconnect */ fts5tokDisconnectMethod, /* xDestroy */ fts5tokOpenMethod, /* xOpen */ fts5tokCloseMethod, /* xClose */ fts5tokFilterMethod, /* xFilter */ fts5tokNextMethod, /* xNext */ fts5tokEofMethod, /* xEof */ fts5tokColumnMethod, /* xColumn */ fts5tokRowidMethod, /* xRowid */ 0, /* xUpdate */ 0, /* xBegin */ 0, /* xSync */ 0, /* xCommit */ 0, /* xRollback */ 0, /* xFindFunction */ 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ 0 /* xRollbackTo */ }; int rc; /* Return code */ rc = sqlite3_create_module(db, "fts5tokenize", &fts5tok_module, (void*)pApi); return rc; } #endif /* defined(SQLITE_TEST) && defined(SQLITE_ENABLE_FTS5) */ ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_tokenize.c ================================================ /* ** 2014 May 31 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** */ #include "fts5Int.h" /************************************************************************** ** Start of ascii tokenizer implementation. */ /* ** For tokenizers with no "unicode" modifier, the set of token characters ** is the same as the set of ASCII range alphanumeric characters. */ static unsigned char aAsciiTokenChar[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00..0x0F */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10..0x1F */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20..0x2F */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 0x30..0x3F */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x40..0x4F */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 0x50..0x5F */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x60..0x6F */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 0x70..0x7F */ }; typedef struct AsciiTokenizer AsciiTokenizer; struct AsciiTokenizer { unsigned char aTokenChar[128]; }; static void fts5AsciiAddExceptions( AsciiTokenizer *p, const char *zArg, int bTokenChars ){ int i; for(i=0; zArg[i]; i++){ if( (zArg[i] & 0x80)==0 ){ p->aTokenChar[(int)zArg[i]] = (unsigned char)bTokenChars; } } } /* ** Delete a "ascii" tokenizer. */ static void fts5AsciiDelete(Fts5Tokenizer *p){ sqlite3_free(p); } /* ** Create an "ascii" tokenizer. */ static int fts5AsciiCreate( void *pUnused, const char **azArg, int nArg, Fts5Tokenizer **ppOut ){ int rc = SQLITE_OK; AsciiTokenizer *p = 0; UNUSED_PARAM(pUnused); if( nArg%2 ){ rc = SQLITE_ERROR; }else{ p = sqlite3_malloc(sizeof(AsciiTokenizer)); if( p==0 ){ rc = SQLITE_NOMEM; }else{ int i; memset(p, 0, sizeof(AsciiTokenizer)); memcpy(p->aTokenChar, aAsciiTokenChar, sizeof(aAsciiTokenChar)); for(i=0; rc==SQLITE_OK && i='A' && c<='Z' ) c += 32; aOut[i] = c; } } /* ** Tokenize some text using the ascii tokenizer. */ static int fts5AsciiTokenize( Fts5Tokenizer *pTokenizer, void *pCtx, int iUnused, const char *pText, int nText, int (*xToken)(void*, int, const char*, int nToken, int iStart, int iEnd) ){ AsciiTokenizer *p = (AsciiTokenizer*)pTokenizer; int rc = SQLITE_OK; int ie; int is = 0; char aFold[64]; int nFold = sizeof(aFold); char *pFold = aFold; unsigned char *a = p->aTokenChar; UNUSED_PARAM(iUnused); while( isnFold ){ if( pFold!=aFold ) sqlite3_free(pFold); pFold = sqlite3_malloc(nByte*2); if( pFold==0 ){ rc = SQLITE_NOMEM; break; } nFold = nByte*2; } asciiFold(pFold, &pText[is], nByte); /* Invoke the token callback */ rc = xToken(pCtx, 0, pFold, nByte, is, ie); is = ie+1; } if( pFold!=aFold ) sqlite3_free(pFold); if( rc==SQLITE_DONE ) rc = SQLITE_OK; return rc; } /************************************************************************** ** Start of unicode61 tokenizer implementation. */ /* ** The following two macros - READ_UTF8 and WRITE_UTF8 - have been copied ** from the sqlite3 source file utf.c. If this file is compiled as part ** of the amalgamation, they are not required. */ #ifndef SQLITE_AMALGAMATION static const unsigned char sqlite3Utf8Trans1[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x00, 0x00, }; #define READ_UTF8(zIn, zTerm, c) \ c = *(zIn++); \ if( c>=0xc0 ){ \ c = sqlite3Utf8Trans1[c-0xc0]; \ while( zIn!=zTerm && (*zIn & 0xc0)==0x80 ){ \ c = (c<<6) + (0x3f & *(zIn++)); \ } \ if( c<0x80 \ || (c&0xFFFFF800)==0xD800 \ || (c&0xFFFFFFFE)==0xFFFE ){ c = 0xFFFD; } \ } #define WRITE_UTF8(zOut, c) { \ if( c<0x00080 ){ \ *zOut++ = (unsigned char)(c&0xFF); \ } \ else if( c<0x00800 ){ \ *zOut++ = 0xC0 + (unsigned char)((c>>6)&0x1F); \ *zOut++ = 0x80 + (unsigned char)(c & 0x3F); \ } \ else if( c<0x10000 ){ \ *zOut++ = 0xE0 + (unsigned char)((c>>12)&0x0F); \ *zOut++ = 0x80 + (unsigned char)((c>>6) & 0x3F); \ *zOut++ = 0x80 + (unsigned char)(c & 0x3F); \ }else{ \ *zOut++ = 0xF0 + (unsigned char)((c>>18) & 0x07); \ *zOut++ = 0x80 + (unsigned char)((c>>12) & 0x3F); \ *zOut++ = 0x80 + (unsigned char)((c>>6) & 0x3F); \ *zOut++ = 0x80 + (unsigned char)(c & 0x3F); \ } \ } #endif /* ifndef SQLITE_AMALGAMATION */ typedef struct Unicode61Tokenizer Unicode61Tokenizer; struct Unicode61Tokenizer { unsigned char aTokenChar[128]; /* ASCII range token characters */ char *aFold; /* Buffer to fold text into */ int nFold; /* Size of aFold[] in bytes */ int bRemoveDiacritic; /* True if remove_diacritics=1 is set */ int nException; int *aiException; }; static int fts5UnicodeAddExceptions( Unicode61Tokenizer *p, /* Tokenizer object */ const char *z, /* Characters to treat as exceptions */ int bTokenChars /* 1 for 'tokenchars', 0 for 'separators' */ ){ int rc = SQLITE_OK; int n = (int)strlen(z); int *aNew; if( n>0 ){ aNew = (int*)sqlite3_realloc(p->aiException, (n+p->nException)*sizeof(int)); if( aNew ){ int nNew = p->nException; const unsigned char *zCsr = (const unsigned char*)z; const unsigned char *zTerm = (const unsigned char*)&z[n]; while( zCsraTokenChar[iCode] = (unsigned char)bTokenChars; }else{ bToken = sqlite3Fts5UnicodeIsalnum(iCode); assert( (bToken==0 || bToken==1) ); assert( (bTokenChars==0 || bTokenChars==1) ); if( bToken!=bTokenChars && sqlite3Fts5UnicodeIsdiacritic(iCode)==0 ){ int i; for(i=0; iiCode ) break; } memmove(&aNew[i+1], &aNew[i], (nNew-i)*sizeof(int)); aNew[i] = iCode; nNew++; } } } p->aiException = aNew; p->nException = nNew; }else{ rc = SQLITE_NOMEM; } } return rc; } /* ** Return true if the p->aiException[] array contains the value iCode. */ static int fts5UnicodeIsException(Unicode61Tokenizer *p, int iCode){ if( p->nException>0 ){ int *a = p->aiException; int iLo = 0; int iHi = p->nException-1; while( iHi>=iLo ){ int iTest = (iHi + iLo) / 2; if( iCode==a[iTest] ){ return 1; }else if( iCode>a[iTest] ){ iLo = iTest+1; }else{ iHi = iTest-1; } } } return 0; } /* ** Delete a "unicode61" tokenizer. */ static void fts5UnicodeDelete(Fts5Tokenizer *pTok){ if( pTok ){ Unicode61Tokenizer *p = (Unicode61Tokenizer*)pTok; sqlite3_free(p->aiException); sqlite3_free(p->aFold); sqlite3_free(p); } return; } /* ** Create a "unicode61" tokenizer. */ static int fts5UnicodeCreate( void *pUnused, const char **azArg, int nArg, Fts5Tokenizer **ppOut ){ int rc = SQLITE_OK; /* Return code */ Unicode61Tokenizer *p = 0; /* New tokenizer object */ UNUSED_PARAM(pUnused); if( nArg%2 ){ rc = SQLITE_ERROR; }else{ p = (Unicode61Tokenizer*)sqlite3_malloc(sizeof(Unicode61Tokenizer)); if( p ){ int i; memset(p, 0, sizeof(Unicode61Tokenizer)); memcpy(p->aTokenChar, aAsciiTokenChar, sizeof(aAsciiTokenChar)); p->bRemoveDiacritic = 1; p->nFold = 64; p->aFold = sqlite3_malloc(p->nFold * sizeof(char)); if( p->aFold==0 ){ rc = SQLITE_NOMEM; } for(i=0; rc==SQLITE_OK && ibRemoveDiacritic = (zArg[0]=='1'); }else if( 0==sqlite3_stricmp(azArg[i], "tokenchars") ){ rc = fts5UnicodeAddExceptions(p, zArg, 1); }else if( 0==sqlite3_stricmp(azArg[i], "separators") ){ rc = fts5UnicodeAddExceptions(p, zArg, 0); }else{ rc = SQLITE_ERROR; } } }else{ rc = SQLITE_NOMEM; } if( rc!=SQLITE_OK ){ fts5UnicodeDelete((Fts5Tokenizer*)p); p = 0; } *ppOut = (Fts5Tokenizer*)p; } return rc; } /* ** Return true if, for the purposes of tokenizing with the tokenizer ** passed as the first argument, codepoint iCode is considered a token ** character (not a separator). */ static int fts5UnicodeIsAlnum(Unicode61Tokenizer *p, int iCode){ assert( (sqlite3Fts5UnicodeIsalnum(iCode) & 0xFFFFFFFE)==0 ); return sqlite3Fts5UnicodeIsalnum(iCode) ^ fts5UnicodeIsException(p, iCode); } static int fts5UnicodeTokenize( Fts5Tokenizer *pTokenizer, void *pCtx, int iUnused, const char *pText, int nText, int (*xToken)(void*, int, const char*, int nToken, int iStart, int iEnd) ){ Unicode61Tokenizer *p = (Unicode61Tokenizer*)pTokenizer; int rc = SQLITE_OK; unsigned char *a = p->aTokenChar; unsigned char *zTerm = (unsigned char*)&pText[nText]; unsigned char *zCsr = (unsigned char *)pText; /* Output buffer */ char *aFold = p->aFold; int nFold = p->nFold; const char *pEnd = &aFold[nFold-6]; UNUSED_PARAM(iUnused); /* Each iteration of this loop gobbles up a contiguous run of separators, ** then the next token. */ while( rc==SQLITE_OK ){ int iCode; /* non-ASCII codepoint read from input */ char *zOut = aFold; int is; int ie; /* Skip any separator characters. */ while( 1 ){ if( zCsr>=zTerm ) goto tokenize_done; if( *zCsr & 0x80 ) { /* A character outside of the ascii range. Skip past it if it is ** a separator character. Or break out of the loop if it is not. */ is = zCsr - (unsigned char*)pText; READ_UTF8(zCsr, zTerm, iCode); if( fts5UnicodeIsAlnum(p, iCode) ){ goto non_ascii_tokenchar; } }else{ if( a[*zCsr] ){ is = zCsr - (unsigned char*)pText; goto ascii_tokenchar; } zCsr++; } } /* Run through the tokenchars. Fold them into the output buffer along ** the way. */ while( zCsrpEnd ){ aFold = sqlite3_malloc(nFold*2); if( aFold==0 ){ rc = SQLITE_NOMEM; goto tokenize_done; } zOut = &aFold[zOut - p->aFold]; memcpy(aFold, p->aFold, nFold); sqlite3_free(p->aFold); p->aFold = aFold; p->nFold = nFold = nFold*2; pEnd = &aFold[nFold-6]; } if( *zCsr & 0x80 ){ /* An non-ascii-range character. Fold it into the output buffer if ** it is a token character, or break out of the loop if it is not. */ READ_UTF8(zCsr, zTerm, iCode); if( fts5UnicodeIsAlnum(p,iCode)||sqlite3Fts5UnicodeIsdiacritic(iCode) ){ non_ascii_tokenchar: iCode = sqlite3Fts5UnicodeFold(iCode, p->bRemoveDiacritic); if( iCode ) WRITE_UTF8(zOut, iCode); }else{ break; } }else if( a[*zCsr]==0 ){ /* An ascii-range separator character. End of token. */ break; }else{ ascii_tokenchar: if( *zCsr>='A' && *zCsr<='Z' ){ *zOut++ = *zCsr + 32; }else{ *zOut++ = *zCsr; } zCsr++; } ie = zCsr - (unsigned char*)pText; } /* Invoke the token callback */ rc = xToken(pCtx, 0, aFold, zOut-aFold, is, ie); } tokenize_done: if( rc==SQLITE_DONE ) rc = SQLITE_OK; return rc; } /************************************************************************** ** Start of porter stemmer implementation. */ /* Any tokens larger than this (in bytes) are passed through without ** stemming. */ #define FTS5_PORTER_MAX_TOKEN 64 typedef struct PorterTokenizer PorterTokenizer; struct PorterTokenizer { fts5_tokenizer tokenizer; /* Parent tokenizer module */ Fts5Tokenizer *pTokenizer; /* Parent tokenizer instance */ char aBuf[FTS5_PORTER_MAX_TOKEN + 64]; }; /* ** Delete a "porter" tokenizer. */ static void fts5PorterDelete(Fts5Tokenizer *pTok){ if( pTok ){ PorterTokenizer *p = (PorterTokenizer*)pTok; if( p->pTokenizer ){ p->tokenizer.xDelete(p->pTokenizer); } sqlite3_free(p); } } /* ** Create a "porter" tokenizer. */ static int fts5PorterCreate( void *pCtx, const char **azArg, int nArg, Fts5Tokenizer **ppOut ){ fts5_api *pApi = (fts5_api*)pCtx; int rc = SQLITE_OK; PorterTokenizer *pRet; void *pUserdata = 0; const char *zBase = "unicode61"; if( nArg>0 ){ zBase = azArg[0]; } pRet = (PorterTokenizer*)sqlite3_malloc(sizeof(PorterTokenizer)); if( pRet ){ memset(pRet, 0, sizeof(PorterTokenizer)); rc = pApi->xFindTokenizer(pApi, zBase, &pUserdata, &pRet->tokenizer); }else{ rc = SQLITE_NOMEM; } if( rc==SQLITE_OK ){ int nArg2 = (nArg>0 ? nArg-1 : 0); const char **azArg2 = (nArg2 ? &azArg[1] : 0); rc = pRet->tokenizer.xCreate(pUserdata, azArg2, nArg2, &pRet->pTokenizer); } if( rc!=SQLITE_OK ){ fts5PorterDelete((Fts5Tokenizer*)pRet); pRet = 0; } *ppOut = (Fts5Tokenizer*)pRet; return rc; } typedef struct PorterContext PorterContext; struct PorterContext { void *pCtx; int (*xToken)(void*, int, const char*, int, int, int); char *aBuf; }; typedef struct PorterRule PorterRule; struct PorterRule { const char *zSuffix; int nSuffix; int (*xCond)(char *zStem, int nStem); const char *zOutput; int nOutput; }; #if 0 static int fts5PorterApply(char *aBuf, int *pnBuf, PorterRule *aRule){ int ret = -1; int nBuf = *pnBuf; PorterRule *p; for(p=aRule; p->zSuffix; p++){ assert( strlen(p->zSuffix)==p->nSuffix ); assert( strlen(p->zOutput)==p->nOutput ); if( nBufnSuffix ) continue; if( 0==memcmp(&aBuf[nBuf - p->nSuffix], p->zSuffix, p->nSuffix) ) break; } if( p->zSuffix ){ int nStem = nBuf - p->nSuffix; if( p->xCond==0 || p->xCond(aBuf, nStem) ){ memcpy(&aBuf[nStem], p->zOutput, p->nOutput); *pnBuf = nStem + p->nOutput; ret = p - aRule; } } return ret; } #endif static int fts5PorterIsVowel(char c, int bYIsVowel){ return ( c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || (bYIsVowel && c=='y') ); } static int fts5PorterGobbleVC(char *zStem, int nStem, int bPrevCons){ int i; int bCons = bPrevCons; /* Scan for a vowel */ for(i=0; i 0) */ static int fts5Porter_MGt0(char *zStem, int nStem){ return !!fts5PorterGobbleVC(zStem, nStem, 0); } /* porter rule condition: (m > 1) */ static int fts5Porter_MGt1(char *zStem, int nStem){ int n; n = fts5PorterGobbleVC(zStem, nStem, 0); if( n && fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){ return 1; } return 0; } /* porter rule condition: (m = 1) */ static int fts5Porter_MEq1(char *zStem, int nStem){ int n; n = fts5PorterGobbleVC(zStem, nStem, 0); if( n && 0==fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){ return 1; } return 0; } /* porter rule condition: (*o) */ static int fts5Porter_Ostar(char *zStem, int nStem){ if( zStem[nStem-1]=='w' || zStem[nStem-1]=='x' || zStem[nStem-1]=='y' ){ return 0; }else{ int i; int mask = 0; int bCons = 0; for(i=0; i 1 and (*S or *T)) */ static int fts5Porter_MGt1_and_S_or_T(char *zStem, int nStem){ assert( nStem>0 ); return (zStem[nStem-1]=='s' || zStem[nStem-1]=='t') && fts5Porter_MGt1(zStem, nStem); } /* porter rule condition: (*v*) */ static int fts5Porter_Vowel(char *zStem, int nStem){ int i; for(i=0; i0) ){ return 1; } } return 0; } /************************************************************************** *************************************************************************** ** GENERATED CODE STARTS HERE (mkportersteps.tcl) */ static int fts5PorterStep4(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ case 'a': if( nBuf>2 && 0==memcmp("al", &aBuf[nBuf-2], 2) ){ if( fts5Porter_MGt1(aBuf, nBuf-2) ){ *pnBuf = nBuf - 2; } } break; case 'c': if( nBuf>4 && 0==memcmp("ance", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt1(aBuf, nBuf-4) ){ *pnBuf = nBuf - 4; } }else if( nBuf>4 && 0==memcmp("ence", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt1(aBuf, nBuf-4) ){ *pnBuf = nBuf - 4; } } break; case 'e': if( nBuf>2 && 0==memcmp("er", &aBuf[nBuf-2], 2) ){ if( fts5Porter_MGt1(aBuf, nBuf-2) ){ *pnBuf = nBuf - 2; } } break; case 'i': if( nBuf>2 && 0==memcmp("ic", &aBuf[nBuf-2], 2) ){ if( fts5Porter_MGt1(aBuf, nBuf-2) ){ *pnBuf = nBuf - 2; } } break; case 'l': if( nBuf>4 && 0==memcmp("able", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt1(aBuf, nBuf-4) ){ *pnBuf = nBuf - 4; } }else if( nBuf>4 && 0==memcmp("ible", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt1(aBuf, nBuf-4) ){ *pnBuf = nBuf - 4; } } break; case 'n': if( nBuf>3 && 0==memcmp("ant", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } }else if( nBuf>5 && 0==memcmp("ement", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt1(aBuf, nBuf-5) ){ *pnBuf = nBuf - 5; } }else if( nBuf>4 && 0==memcmp("ment", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt1(aBuf, nBuf-4) ){ *pnBuf = nBuf - 4; } }else if( nBuf>3 && 0==memcmp("ent", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; case 'o': if( nBuf>3 && 0==memcmp("ion", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1_and_S_or_T(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } }else if( nBuf>2 && 0==memcmp("ou", &aBuf[nBuf-2], 2) ){ if( fts5Porter_MGt1(aBuf, nBuf-2) ){ *pnBuf = nBuf - 2; } } break; case 's': if( nBuf>3 && 0==memcmp("ism", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; case 't': if( nBuf>3 && 0==memcmp("ate", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } }else if( nBuf>3 && 0==memcmp("iti", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; case 'u': if( nBuf>3 && 0==memcmp("ous", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; case 'v': if( nBuf>3 && 0==memcmp("ive", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; case 'z': if( nBuf>3 && 0==memcmp("ize", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; } return ret; } static int fts5PorterStep1B2(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ case 'a': if( nBuf>2 && 0==memcmp("at", &aBuf[nBuf-2], 2) ){ memcpy(&aBuf[nBuf-2], "ate", 3); *pnBuf = nBuf - 2 + 3; ret = 1; } break; case 'b': if( nBuf>2 && 0==memcmp("bl", &aBuf[nBuf-2], 2) ){ memcpy(&aBuf[nBuf-2], "ble", 3); *pnBuf = nBuf - 2 + 3; ret = 1; } break; case 'i': if( nBuf>2 && 0==memcmp("iz", &aBuf[nBuf-2], 2) ){ memcpy(&aBuf[nBuf-2], "ize", 3); *pnBuf = nBuf - 2 + 3; ret = 1; } break; } return ret; } static int fts5PorterStep2(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ case 'a': if( nBuf>7 && 0==memcmp("ational", &aBuf[nBuf-7], 7) ){ if( fts5Porter_MGt0(aBuf, nBuf-7) ){ memcpy(&aBuf[nBuf-7], "ate", 3); *pnBuf = nBuf - 7 + 3; } }else if( nBuf>6 && 0==memcmp("tional", &aBuf[nBuf-6], 6) ){ if( fts5Porter_MGt0(aBuf, nBuf-6) ){ memcpy(&aBuf[nBuf-6], "tion", 4); *pnBuf = nBuf - 6 + 4; } } break; case 'c': if( nBuf>4 && 0==memcmp("enci", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "ence", 4); *pnBuf = nBuf - 4 + 4; } }else if( nBuf>4 && 0==memcmp("anci", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "ance", 4); *pnBuf = nBuf - 4 + 4; } } break; case 'e': if( nBuf>4 && 0==memcmp("izer", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "ize", 3); *pnBuf = nBuf - 4 + 3; } } break; case 'g': if( nBuf>4 && 0==memcmp("logi", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "log", 3); *pnBuf = nBuf - 4 + 3; } } break; case 'l': if( nBuf>3 && 0==memcmp("bli", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt0(aBuf, nBuf-3) ){ memcpy(&aBuf[nBuf-3], "ble", 3); *pnBuf = nBuf - 3 + 3; } }else if( nBuf>4 && 0==memcmp("alli", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "al", 2); *pnBuf = nBuf - 4 + 2; } }else if( nBuf>5 && 0==memcmp("entli", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "ent", 3); *pnBuf = nBuf - 5 + 3; } }else if( nBuf>3 && 0==memcmp("eli", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt0(aBuf, nBuf-3) ){ memcpy(&aBuf[nBuf-3], "e", 1); *pnBuf = nBuf - 3 + 1; } }else if( nBuf>5 && 0==memcmp("ousli", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "ous", 3); *pnBuf = nBuf - 5 + 3; } } break; case 'o': if( nBuf>7 && 0==memcmp("ization", &aBuf[nBuf-7], 7) ){ if( fts5Porter_MGt0(aBuf, nBuf-7) ){ memcpy(&aBuf[nBuf-7], "ize", 3); *pnBuf = nBuf - 7 + 3; } }else if( nBuf>5 && 0==memcmp("ation", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "ate", 3); *pnBuf = nBuf - 5 + 3; } }else if( nBuf>4 && 0==memcmp("ator", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "ate", 3); *pnBuf = nBuf - 4 + 3; } } break; case 's': if( nBuf>5 && 0==memcmp("alism", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "al", 2); *pnBuf = nBuf - 5 + 2; } }else if( nBuf>7 && 0==memcmp("iveness", &aBuf[nBuf-7], 7) ){ if( fts5Porter_MGt0(aBuf, nBuf-7) ){ memcpy(&aBuf[nBuf-7], "ive", 3); *pnBuf = nBuf - 7 + 3; } }else if( nBuf>7 && 0==memcmp("fulness", &aBuf[nBuf-7], 7) ){ if( fts5Porter_MGt0(aBuf, nBuf-7) ){ memcpy(&aBuf[nBuf-7], "ful", 3); *pnBuf = nBuf - 7 + 3; } }else if( nBuf>7 && 0==memcmp("ousness", &aBuf[nBuf-7], 7) ){ if( fts5Porter_MGt0(aBuf, nBuf-7) ){ memcpy(&aBuf[nBuf-7], "ous", 3); *pnBuf = nBuf - 7 + 3; } } break; case 't': if( nBuf>5 && 0==memcmp("aliti", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "al", 2); *pnBuf = nBuf - 5 + 2; } }else if( nBuf>5 && 0==memcmp("iviti", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "ive", 3); *pnBuf = nBuf - 5 + 3; } }else if( nBuf>6 && 0==memcmp("biliti", &aBuf[nBuf-6], 6) ){ if( fts5Porter_MGt0(aBuf, nBuf-6) ){ memcpy(&aBuf[nBuf-6], "ble", 3); *pnBuf = nBuf - 6 + 3; } } break; } return ret; } static int fts5PorterStep3(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ case 'a': if( nBuf>4 && 0==memcmp("ical", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "ic", 2); *pnBuf = nBuf - 4 + 2; } } break; case 's': if( nBuf>4 && 0==memcmp("ness", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ *pnBuf = nBuf - 4; } } break; case 't': if( nBuf>5 && 0==memcmp("icate", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "ic", 2); *pnBuf = nBuf - 5 + 2; } }else if( nBuf>5 && 0==memcmp("iciti", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "ic", 2); *pnBuf = nBuf - 5 + 2; } } break; case 'u': if( nBuf>3 && 0==memcmp("ful", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt0(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; case 'v': if( nBuf>5 && 0==memcmp("ative", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ *pnBuf = nBuf - 5; } } break; case 'z': if( nBuf>5 && 0==memcmp("alize", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "al", 2); *pnBuf = nBuf - 5 + 2; } } break; } return ret; } static int fts5PorterStep1B(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ case 'e': if( nBuf>3 && 0==memcmp("eed", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt0(aBuf, nBuf-3) ){ memcpy(&aBuf[nBuf-3], "ee", 2); *pnBuf = nBuf - 3 + 2; } }else if( nBuf>2 && 0==memcmp("ed", &aBuf[nBuf-2], 2) ){ if( fts5Porter_Vowel(aBuf, nBuf-2) ){ *pnBuf = nBuf - 2; ret = 1; } } break; case 'n': if( nBuf>3 && 0==memcmp("ing", &aBuf[nBuf-3], 3) ){ if( fts5Porter_Vowel(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; ret = 1; } } break; } return ret; } /* ** GENERATED CODE ENDS HERE (mkportersteps.tcl) *************************************************************************** **************************************************************************/ static void fts5PorterStep1A(char *aBuf, int *pnBuf){ int nBuf = *pnBuf; if( aBuf[nBuf-1]=='s' ){ if( aBuf[nBuf-2]=='e' ){ if( (nBuf>4 && aBuf[nBuf-4]=='s' && aBuf[nBuf-3]=='s') || (nBuf>3 && aBuf[nBuf-3]=='i' ) ){ *pnBuf = nBuf-2; }else{ *pnBuf = nBuf-1; } } else if( aBuf[nBuf-2]!='s' ){ *pnBuf = nBuf-1; } } } static int fts5PorterCb( void *pCtx, int tflags, const char *pToken, int nToken, int iStart, int iEnd ){ PorterContext *p = (PorterContext*)pCtx; char *aBuf; int nBuf; if( nToken>FTS5_PORTER_MAX_TOKEN || nToken<3 ) goto pass_through; aBuf = p->aBuf; nBuf = nToken; memcpy(aBuf, pToken, nBuf); /* Step 1. */ fts5PorterStep1A(aBuf, &nBuf); if( fts5PorterStep1B(aBuf, &nBuf) ){ if( fts5PorterStep1B2(aBuf, &nBuf)==0 ){ char c = aBuf[nBuf-1]; if( fts5PorterIsVowel(c, 0)==0 && c!='l' && c!='s' && c!='z' && c==aBuf[nBuf-2] ){ nBuf--; }else if( fts5Porter_MEq1(aBuf, nBuf) && fts5Porter_Ostar(aBuf, nBuf) ){ aBuf[nBuf++] = 'e'; } } } /* Step 1C. */ if( aBuf[nBuf-1]=='y' && fts5Porter_Vowel(aBuf, nBuf-1) ){ aBuf[nBuf-1] = 'i'; } /* Steps 2 through 4. */ fts5PorterStep2(aBuf, &nBuf); fts5PorterStep3(aBuf, &nBuf); fts5PorterStep4(aBuf, &nBuf); /* Step 5a. */ assert( nBuf>0 ); if( aBuf[nBuf-1]=='e' ){ if( fts5Porter_MGt1(aBuf, nBuf-1) || (fts5Porter_MEq1(aBuf, nBuf-1) && !fts5Porter_Ostar(aBuf, nBuf-1)) ){ nBuf--; } } /* Step 5b. */ if( nBuf>1 && aBuf[nBuf-1]=='l' && aBuf[nBuf-2]=='l' && fts5Porter_MGt1(aBuf, nBuf-1) ){ nBuf--; } return p->xToken(p->pCtx, tflags, aBuf, nBuf, iStart, iEnd); pass_through: return p->xToken(p->pCtx, tflags, pToken, nToken, iStart, iEnd); } /* ** Tokenize using the porter tokenizer. */ static int fts5PorterTokenize( Fts5Tokenizer *pTokenizer, void *pCtx, int flags, const char *pText, int nText, int (*xToken)(void*, int, const char*, int nToken, int iStart, int iEnd) ){ PorterTokenizer *p = (PorterTokenizer*)pTokenizer; PorterContext sCtx; sCtx.xToken = xToken; sCtx.pCtx = pCtx; sCtx.aBuf = p->aBuf; return p->tokenizer.xTokenize( p->pTokenizer, (void*)&sCtx, flags, pText, nText, fts5PorterCb ); } /* ** Register all built-in tokenizers with FTS5. */ int sqlite3Fts5TokenizerInit(fts5_api *pApi){ struct BuiltinTokenizer { const char *zName; fts5_tokenizer x; } aBuiltin[] = { { "unicode61", {fts5UnicodeCreate, fts5UnicodeDelete, fts5UnicodeTokenize}}, { "ascii", {fts5AsciiCreate, fts5AsciiDelete, fts5AsciiTokenize }}, { "porter", {fts5PorterCreate, fts5PorterDelete, fts5PorterTokenize }}, }; int rc = SQLITE_OK; /* Return code */ int i; /* To iterate through builtin functions */ for(i=0; rc==SQLITE_OK && ixCreateTokenizer(pApi, aBuiltin[i].zName, (void*)pApi, &aBuiltin[i].x, 0 ); } return rc; } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_unicode2.c ================================================ /* ** 2012 May 25 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** */ /* ** DO NOT EDIT THIS MACHINE GENERATED FILE. */ #include /* ** Return true if the argument corresponds to a unicode codepoint ** classified as either a letter or a number. Otherwise false. ** ** The results are undefined if the value passed to this function ** is less than zero. */ int sqlite3Fts5UnicodeIsalnum(int c){ /* Each unsigned integer in the following array corresponds to a contiguous ** range of unicode codepoints that are not either letters or numbers (i.e. ** codepoints for which this function should return 0). ** ** The most significant 22 bits in each 32-bit value contain the first ** codepoint in the range. The least significant 10 bits are used to store ** the size of the range (always at least 1). In other words, the value ** ((C<<22) + N) represents a range of N codepoints starting with codepoint ** C. It is not possible to represent a range larger than 1023 codepoints ** using this format. */ static const unsigned int aEntry[] = { 0x00000030, 0x0000E807, 0x00016C06, 0x0001EC2F, 0x0002AC07, 0x0002D001, 0x0002D803, 0x0002EC01, 0x0002FC01, 0x00035C01, 0x0003DC01, 0x000B0804, 0x000B480E, 0x000B9407, 0x000BB401, 0x000BBC81, 0x000DD401, 0x000DF801, 0x000E1002, 0x000E1C01, 0x000FD801, 0x00120808, 0x00156806, 0x00162402, 0x00163C01, 0x00164437, 0x0017CC02, 0x00180005, 0x00181816, 0x00187802, 0x00192C15, 0x0019A804, 0x0019C001, 0x001B5001, 0x001B580F, 0x001B9C07, 0x001BF402, 0x001C000E, 0x001C3C01, 0x001C4401, 0x001CC01B, 0x001E980B, 0x001FAC09, 0x001FD804, 0x00205804, 0x00206C09, 0x00209403, 0x0020A405, 0x0020C00F, 0x00216403, 0x00217801, 0x0023901B, 0x00240004, 0x0024E803, 0x0024F812, 0x00254407, 0x00258804, 0x0025C001, 0x00260403, 0x0026F001, 0x0026F807, 0x00271C02, 0x00272C03, 0x00275C01, 0x00278802, 0x0027C802, 0x0027E802, 0x00280403, 0x0028F001, 0x0028F805, 0x00291C02, 0x00292C03, 0x00294401, 0x0029C002, 0x0029D401, 0x002A0403, 0x002AF001, 0x002AF808, 0x002B1C03, 0x002B2C03, 0x002B8802, 0x002BC002, 0x002C0403, 0x002CF001, 0x002CF807, 0x002D1C02, 0x002D2C03, 0x002D5802, 0x002D8802, 0x002DC001, 0x002E0801, 0x002EF805, 0x002F1803, 0x002F2804, 0x002F5C01, 0x002FCC08, 0x00300403, 0x0030F807, 0x00311803, 0x00312804, 0x00315402, 0x00318802, 0x0031FC01, 0x00320802, 0x0032F001, 0x0032F807, 0x00331803, 0x00332804, 0x00335402, 0x00338802, 0x00340802, 0x0034F807, 0x00351803, 0x00352804, 0x00355C01, 0x00358802, 0x0035E401, 0x00360802, 0x00372801, 0x00373C06, 0x00375801, 0x00376008, 0x0037C803, 0x0038C401, 0x0038D007, 0x0038FC01, 0x00391C09, 0x00396802, 0x003AC401, 0x003AD006, 0x003AEC02, 0x003B2006, 0x003C041F, 0x003CD00C, 0x003DC417, 0x003E340B, 0x003E6424, 0x003EF80F, 0x003F380D, 0x0040AC14, 0x00412806, 0x00415804, 0x00417803, 0x00418803, 0x00419C07, 0x0041C404, 0x0042080C, 0x00423C01, 0x00426806, 0x0043EC01, 0x004D740C, 0x004E400A, 0x00500001, 0x0059B402, 0x005A0001, 0x005A6C02, 0x005BAC03, 0x005C4803, 0x005CC805, 0x005D4802, 0x005DC802, 0x005ED023, 0x005F6004, 0x005F7401, 0x0060000F, 0x0062A401, 0x0064800C, 0x0064C00C, 0x00650001, 0x00651002, 0x0066C011, 0x00672002, 0x00677822, 0x00685C05, 0x00687802, 0x0069540A, 0x0069801D, 0x0069FC01, 0x006A8007, 0x006AA006, 0x006C0005, 0x006CD011, 0x006D6823, 0x006E0003, 0x006E840D, 0x006F980E, 0x006FF004, 0x00709014, 0x0070EC05, 0x0071F802, 0x00730008, 0x00734019, 0x0073B401, 0x0073C803, 0x00770027, 0x0077F004, 0x007EF401, 0x007EFC03, 0x007F3403, 0x007F7403, 0x007FB403, 0x007FF402, 0x00800065, 0x0081A806, 0x0081E805, 0x00822805, 0x0082801A, 0x00834021, 0x00840002, 0x00840C04, 0x00842002, 0x00845001, 0x00845803, 0x00847806, 0x00849401, 0x00849C01, 0x0084A401, 0x0084B801, 0x0084E802, 0x00850005, 0x00852804, 0x00853C01, 0x00864264, 0x00900027, 0x0091000B, 0x0092704E, 0x00940200, 0x009C0475, 0x009E53B9, 0x00AD400A, 0x00B39406, 0x00B3BC03, 0x00B3E404, 0x00B3F802, 0x00B5C001, 0x00B5FC01, 0x00B7804F, 0x00B8C00C, 0x00BA001A, 0x00BA6C59, 0x00BC00D6, 0x00BFC00C, 0x00C00005, 0x00C02019, 0x00C0A807, 0x00C0D802, 0x00C0F403, 0x00C26404, 0x00C28001, 0x00C3EC01, 0x00C64002, 0x00C6580A, 0x00C70024, 0x00C8001F, 0x00C8A81E, 0x00C94001, 0x00C98020, 0x00CA2827, 0x00CB003F, 0x00CC0100, 0x01370040, 0x02924037, 0x0293F802, 0x02983403, 0x0299BC10, 0x029A7C01, 0x029BC008, 0x029C0017, 0x029C8002, 0x029E2402, 0x02A00801, 0x02A01801, 0x02A02C01, 0x02A08C09, 0x02A0D804, 0x02A1D004, 0x02A20002, 0x02A2D011, 0x02A33802, 0x02A38012, 0x02A3E003, 0x02A4980A, 0x02A51C0D, 0x02A57C01, 0x02A60004, 0x02A6CC1B, 0x02A77802, 0x02A8A40E, 0x02A90C01, 0x02A93002, 0x02A97004, 0x02A9DC03, 0x02A9EC01, 0x02AAC001, 0x02AAC803, 0x02AADC02, 0x02AAF802, 0x02AB0401, 0x02AB7802, 0x02ABAC07, 0x02ABD402, 0x02AF8C0B, 0x03600001, 0x036DFC02, 0x036FFC02, 0x037FFC01, 0x03EC7801, 0x03ECA401, 0x03EEC810, 0x03F4F802, 0x03F7F002, 0x03F8001A, 0x03F88007, 0x03F8C023, 0x03F95013, 0x03F9A004, 0x03FBFC01, 0x03FC040F, 0x03FC6807, 0x03FCEC06, 0x03FD6C0B, 0x03FF8007, 0x03FFA007, 0x03FFE405, 0x04040003, 0x0404DC09, 0x0405E411, 0x0406400C, 0x0407402E, 0x040E7C01, 0x040F4001, 0x04215C01, 0x04247C01, 0x0424FC01, 0x04280403, 0x04281402, 0x04283004, 0x0428E003, 0x0428FC01, 0x04294009, 0x0429FC01, 0x042CE407, 0x04400003, 0x0440E016, 0x04420003, 0x0442C012, 0x04440003, 0x04449C0E, 0x04450004, 0x04460003, 0x0446CC0E, 0x04471404, 0x045AAC0D, 0x0491C004, 0x05BD442E, 0x05BE3C04, 0x074000F6, 0x07440027, 0x0744A4B5, 0x07480046, 0x074C0057, 0x075B0401, 0x075B6C01, 0x075BEC01, 0x075C5401, 0x075CD401, 0x075D3C01, 0x075DBC01, 0x075E2401, 0x075EA401, 0x075F0C01, 0x07BBC002, 0x07C0002C, 0x07C0C064, 0x07C2800F, 0x07C2C40E, 0x07C3040F, 0x07C3440F, 0x07C4401F, 0x07C4C03C, 0x07C5C02B, 0x07C7981D, 0x07C8402B, 0x07C90009, 0x07C94002, 0x07CC0021, 0x07CCC006, 0x07CCDC46, 0x07CE0014, 0x07CE8025, 0x07CF1805, 0x07CF8011, 0x07D0003F, 0x07D10001, 0x07D108B6, 0x07D3E404, 0x07D4003E, 0x07D50004, 0x07D54018, 0x07D7EC46, 0x07D9140B, 0x07DA0046, 0x07DC0074, 0x38000401, 0x38008060, 0x380400F0, }; static const unsigned int aAscii[4] = { 0xFFFFFFFF, 0xFC00FFFF, 0xF8000001, 0xF8000001, }; if( (unsigned int)c<128 ){ return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 ); }else if( (unsigned int)c<(1<<22) ){ unsigned int key = (((unsigned int)c)<<10) | 0x000003FF; int iRes = 0; int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; int iLo = 0; while( iHi>=iLo ){ int iTest = (iHi + iLo) / 2; if( key >= aEntry[iTest] ){ iRes = iTest; iLo = iTest+1; }else{ iHi = iTest-1; } } assert( aEntry[0]=aEntry[iRes] ); return (((unsigned int)c) >= ((aEntry[iRes]>>10) + (aEntry[iRes]&0x3FF))); } return 1; } /* ** If the argument is a codepoint corresponding to a lowercase letter ** in the ASCII range with a diacritic added, return the codepoint ** of the ASCII letter only. For example, if passed 235 - "LATIN ** SMALL LETTER E WITH DIAERESIS" - return 65 ("LATIN SMALL LETTER ** E"). The resuls of passing a codepoint that corresponds to an ** uppercase letter are undefined. */ static int fts5_remove_diacritic(int c){ unsigned short aDia[] = { 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, 62924, 63050, 63082, 63274, 63390, }; char aChar[] = { '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', 'e', 'i', 'o', 'u', 'y', }; unsigned int key = (((unsigned int)c)<<3) | 0x00000007; int iRes = 0; int iHi = sizeof(aDia)/sizeof(aDia[0]) - 1; int iLo = 0; while( iHi>=iLo ){ int iTest = (iHi + iLo) / 2; if( key >= aDia[iTest] ){ iRes = iTest; iLo = iTest+1; }else{ iHi = iTest-1; } } assert( key>=aDia[iRes] ); return ((c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : (int)aChar[iRes]); } /* ** Return true if the argument interpreted as a unicode codepoint ** is a diacritical modifier character. */ int sqlite3Fts5UnicodeIsdiacritic(int c){ unsigned int mask0 = 0x08029FDF; unsigned int mask1 = 0x000361F8; if( c<768 || c>817 ) return 0; return (c < 768+32) ? (mask0 & (1 << (c-768))) : (mask1 & (1 << (c-768-32))); } /* ** Interpret the argument as a unicode codepoint. If the codepoint ** is an upper case character that has a lower case equivalent, ** return the codepoint corresponding to the lower case version. ** Otherwise, return a copy of the argument. ** ** The results are undefined if the value passed to this function ** is less than zero. */ int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic){ /* Each entry in the following array defines a rule for folding a range ** of codepoints to lower case. The rule applies to a range of nRange ** codepoints starting at codepoint iCode. ** ** If the least significant bit in flags is clear, then the rule applies ** to all nRange codepoints (i.e. all nRange codepoints are upper case and ** need to be folded). Or, if it is set, then the rule only applies to ** every second codepoint in the range, starting with codepoint C. ** ** The 7 most significant bits in flags are an index into the aiOff[] ** array. If a specific codepoint C does require folding, then its lower ** case equivalent is ((C + aiOff[flags>>1]) & 0xFFFF). ** ** The contents of this array are generated by parsing the CaseFolding.txt ** file distributed as part of the "Unicode Character Database". See ** http://www.unicode.org for details. */ static const struct TableEntry { unsigned short iCode; unsigned char flags; unsigned char nRange; } aEntry[] = { {65, 14, 26}, {181, 64, 1}, {192, 14, 23}, {216, 14, 7}, {256, 1, 48}, {306, 1, 6}, {313, 1, 16}, {330, 1, 46}, {376, 116, 1}, {377, 1, 6}, {383, 104, 1}, {385, 50, 1}, {386, 1, 4}, {390, 44, 1}, {391, 0, 1}, {393, 42, 2}, {395, 0, 1}, {398, 32, 1}, {399, 38, 1}, {400, 40, 1}, {401, 0, 1}, {403, 42, 1}, {404, 46, 1}, {406, 52, 1}, {407, 48, 1}, {408, 0, 1}, {412, 52, 1}, {413, 54, 1}, {415, 56, 1}, {416, 1, 6}, {422, 60, 1}, {423, 0, 1}, {425, 60, 1}, {428, 0, 1}, {430, 60, 1}, {431, 0, 1}, {433, 58, 2}, {435, 1, 4}, {439, 62, 1}, {440, 0, 1}, {444, 0, 1}, {452, 2, 1}, {453, 0, 1}, {455, 2, 1}, {456, 0, 1}, {458, 2, 1}, {459, 1, 18}, {478, 1, 18}, {497, 2, 1}, {498, 1, 4}, {502, 122, 1}, {503, 134, 1}, {504, 1, 40}, {544, 110, 1}, {546, 1, 18}, {570, 70, 1}, {571, 0, 1}, {573, 108, 1}, {574, 68, 1}, {577, 0, 1}, {579, 106, 1}, {580, 28, 1}, {581, 30, 1}, {582, 1, 10}, {837, 36, 1}, {880, 1, 4}, {886, 0, 1}, {902, 18, 1}, {904, 16, 3}, {908, 26, 1}, {910, 24, 2}, {913, 14, 17}, {931, 14, 9}, {962, 0, 1}, {975, 4, 1}, {976, 140, 1}, {977, 142, 1}, {981, 146, 1}, {982, 144, 1}, {984, 1, 24}, {1008, 136, 1}, {1009, 138, 1}, {1012, 130, 1}, {1013, 128, 1}, {1015, 0, 1}, {1017, 152, 1}, {1018, 0, 1}, {1021, 110, 3}, {1024, 34, 16}, {1040, 14, 32}, {1120, 1, 34}, {1162, 1, 54}, {1216, 6, 1}, {1217, 1, 14}, {1232, 1, 88}, {1329, 22, 38}, {4256, 66, 38}, {4295, 66, 1}, {4301, 66, 1}, {7680, 1, 150}, {7835, 132, 1}, {7838, 96, 1}, {7840, 1, 96}, {7944, 150, 8}, {7960, 150, 6}, {7976, 150, 8}, {7992, 150, 8}, {8008, 150, 6}, {8025, 151, 8}, {8040, 150, 8}, {8072, 150, 8}, {8088, 150, 8}, {8104, 150, 8}, {8120, 150, 2}, {8122, 126, 2}, {8124, 148, 1}, {8126, 100, 1}, {8136, 124, 4}, {8140, 148, 1}, {8152, 150, 2}, {8154, 120, 2}, {8168, 150, 2}, {8170, 118, 2}, {8172, 152, 1}, {8184, 112, 2}, {8186, 114, 2}, {8188, 148, 1}, {8486, 98, 1}, {8490, 92, 1}, {8491, 94, 1}, {8498, 12, 1}, {8544, 8, 16}, {8579, 0, 1}, {9398, 10, 26}, {11264, 22, 47}, {11360, 0, 1}, {11362, 88, 1}, {11363, 102, 1}, {11364, 90, 1}, {11367, 1, 6}, {11373, 84, 1}, {11374, 86, 1}, {11375, 80, 1}, {11376, 82, 1}, {11378, 0, 1}, {11381, 0, 1}, {11390, 78, 2}, {11392, 1, 100}, {11499, 1, 4}, {11506, 0, 1}, {42560, 1, 46}, {42624, 1, 24}, {42786, 1, 14}, {42802, 1, 62}, {42873, 1, 4}, {42877, 76, 1}, {42878, 1, 10}, {42891, 0, 1}, {42893, 74, 1}, {42896, 1, 4}, {42912, 1, 10}, {42922, 72, 1}, {65313, 14, 26}, }; static const unsigned short aiOff[] = { 1, 2, 8, 15, 16, 26, 28, 32, 37, 38, 40, 48, 63, 64, 69, 71, 79, 80, 116, 202, 203, 205, 206, 207, 209, 210, 211, 213, 214, 217, 218, 219, 775, 7264, 10792, 10795, 23228, 23256, 30204, 54721, 54753, 54754, 54756, 54787, 54793, 54809, 57153, 57274, 57921, 58019, 58363, 61722, 65268, 65341, 65373, 65406, 65408, 65410, 65415, 65424, 65436, 65439, 65450, 65462, 65472, 65476, 65478, 65480, 65482, 65488, 65506, 65511, 65514, 65521, 65527, 65528, 65529, }; int ret = c; assert( sizeof(unsigned short)==2 && sizeof(unsigned char)==1 ); if( c<128 ){ if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); }else if( c<65536 ){ const struct TableEntry *p; int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; int iLo = 0; int iRes = -1; assert( c>aEntry[0].iCode ); while( iHi>=iLo ){ int iTest = (iHi + iLo) / 2; int cmp = (c - aEntry[iTest].iCode); if( cmp>=0 ){ iRes = iTest; iLo = iTest+1; }else{ iHi = iTest-1; } } assert( iRes>=0 && c>=aEntry[iRes].iCode ); p = &aEntry[iRes]; if( c<(p->iCode + p->nRange) && 0==(0x01 & p->flags & (p->iCode ^ c)) ){ ret = (c + (aiOff[p->flags>>1])) & 0x0000FFFF; assert( ret>0 ); } if( bRemoveDiacritic ) ret = fts5_remove_diacritic(ret); } else if( c>=66560 && c<66600 ){ ret = c + 40; } return ret; } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_varint.c ================================================ /* ** 2015 May 30 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** Routines for varint serialization and deserialization. */ #include "fts5Int.h" /* ** This is a copy of the sqlite3GetVarint32() routine from the SQLite core. ** Except, this version does handle the single byte case that the core ** version depends on being handled before its function is called. */ int sqlite3Fts5GetVarint32(const unsigned char *p, u32 *v){ u32 a,b; /* The 1-byte case. Overwhelmingly the most common. */ a = *p; /* a: p0 (unmasked) */ if (!(a&0x80)) { /* Values between 0 and 127 */ *v = a; return 1; } /* The 2-byte case */ p++; b = *p; /* b: p1 (unmasked) */ if (!(b&0x80)) { /* Values between 128 and 16383 */ a &= 0x7f; a = a<<7; *v = a | b; return 2; } /* The 3-byte case */ p++; a = a<<14; a |= *p; /* a: p0<<14 | p2 (unmasked) */ if (!(a&0x80)) { /* Values between 16384 and 2097151 */ a &= (0x7f<<14)|(0x7f); b &= 0x7f; b = b<<7; *v = a | b; return 3; } /* A 32-bit varint is used to store size information in btrees. ** Objects are rarely larger than 2MiB limit of a 3-byte varint. ** A 3-byte varint is sufficient, for example, to record the size ** of a 1048569-byte BLOB or string. ** ** We only unroll the first 1-, 2-, and 3- byte cases. The very ** rare larger cases can be handled by the slower 64-bit varint ** routine. */ { u64 v64; u8 n; p -= 2; n = sqlite3Fts5GetVarint(p, &v64); *v = (u32)v64; assert( n>3 && n<=9 ); return n; } } /* ** Bitmasks used by sqlite3GetVarint(). These precomputed constants ** are defined here rather than simply putting the constant expressions ** inline in order to work around bugs in the RVT compiler. ** ** SLOT_2_0 A mask for (0x7f<<14) | 0x7f ** ** SLOT_4_2_0 A mask for (0x7f<<28) | SLOT_2_0 */ #define SLOT_2_0 0x001fc07f #define SLOT_4_2_0 0xf01fc07f /* ** Read a 64-bit variable-length integer from memory starting at p[0]. ** Return the number of bytes read. The value is stored in *v. */ u8 sqlite3Fts5GetVarint(const unsigned char *p, u64 *v){ u32 a,b,s; a = *p; /* a: p0 (unmasked) */ if (!(a&0x80)) { *v = a; return 1; } p++; b = *p; /* b: p1 (unmasked) */ if (!(b&0x80)) { a &= 0x7f; a = a<<7; a |= b; *v = a; return 2; } /* Verify that constants are precomputed correctly */ assert( SLOT_2_0 == ((0x7f<<14) | (0x7f)) ); assert( SLOT_4_2_0 == ((0xfU<<28) | (0x7f<<14) | (0x7f)) ); p++; a = a<<14; a |= *p; /* a: p0<<14 | p2 (unmasked) */ if (!(a&0x80)) { a &= SLOT_2_0; b &= 0x7f; b = b<<7; a |= b; *v = a; return 3; } /* CSE1 from below */ a &= SLOT_2_0; p++; b = b<<14; b |= *p; /* b: p1<<14 | p3 (unmasked) */ if (!(b&0x80)) { b &= SLOT_2_0; /* moved CSE1 up */ /* a &= (0x7f<<14)|(0x7f); */ a = a<<7; a |= b; *v = a; return 4; } /* a: p0<<14 | p2 (masked) */ /* b: p1<<14 | p3 (unmasked) */ /* 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) */ /* moved CSE1 up */ /* a &= (0x7f<<14)|(0x7f); */ b &= SLOT_2_0; s = a; /* s: p0<<14 | p2 (masked) */ p++; a = a<<14; a |= *p; /* a: p0<<28 | p2<<14 | p4 (unmasked) */ if (!(a&0x80)) { /* we can skip these cause they were (effectively) done above in calc'ing s */ /* a &= (0x7f<<28)|(0x7f<<14)|(0x7f); */ /* b &= (0x7f<<14)|(0x7f); */ b = b<<7; a |= b; s = s>>18; *v = ((u64)s)<<32 | a; return 5; } /* 2:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) */ s = s<<7; s |= b; /* s: p0<<21 | p1<<14 | p2<<7 | p3 (masked) */ p++; b = b<<14; b |= *p; /* b: p1<<28 | p3<<14 | p5 (unmasked) */ if (!(b&0x80)) { /* we can skip this cause it was (effectively) done above in calc'ing s */ /* b &= (0x7f<<28)|(0x7f<<14)|(0x7f); */ a &= SLOT_2_0; a = a<<7; a |= b; s = s>>18; *v = ((u64)s)<<32 | a; return 6; } p++; a = a<<14; a |= *p; /* a: p2<<28 | p4<<14 | p6 (unmasked) */ if (!(a&0x80)) { a &= SLOT_4_2_0; b &= SLOT_2_0; b = b<<7; a |= b; s = s>>11; *v = ((u64)s)<<32 | a; return 7; } /* CSE2 from below */ a &= SLOT_2_0; p++; b = b<<14; b |= *p; /* b: p3<<28 | p5<<14 | p7 (unmasked) */ if (!(b&0x80)) { b &= SLOT_4_2_0; /* moved CSE2 up */ /* a &= (0x7f<<14)|(0x7f); */ a = a<<7; a |= b; s = s>>4; *v = ((u64)s)<<32 | a; return 8; } p++; a = a<<15; a |= *p; /* a: p4<<29 | p6<<15 | p8 (unmasked) */ /* moved CSE2 up */ /* a &= (0x7f<<29)|(0x7f<<15)|(0xff); */ b &= SLOT_2_0; b = b<<8; a |= b; s = s<<4; b = p[-4]; b &= 0x7f; b = b>>3; s |= b; *v = ((u64)s)<<32 | a; return 9; } /* ** The variable-length integer encoding is as follows: ** ** KEY: ** A = 0xxxxxxx 7 bits of data and one flag bit ** B = 1xxxxxxx 7 bits of data and one flag bit ** C = xxxxxxxx 8 bits of data ** ** 7 bits - A ** 14 bits - BA ** 21 bits - BBA ** 28 bits - BBBA ** 35 bits - BBBBA ** 42 bits - BBBBBA ** 49 bits - BBBBBBA ** 56 bits - BBBBBBBA ** 64 bits - BBBBBBBBC */ #ifdef SQLITE_NOINLINE # define FTS5_NOINLINE SQLITE_NOINLINE #else # define FTS5_NOINLINE #endif /* ** Write a 64-bit variable-length integer to memory starting at p[0]. ** The length of data write will be between 1 and 9 bytes. The number ** of bytes written is returned. ** ** A variable-length integer consists of the lower 7 bits of each byte ** for all bytes that have the 8th bit set and one byte with the 8th ** bit clear. Except, if we get to the 9th byte, it stores the full ** 8 bits and is the last byte. */ static int FTS5_NOINLINE fts5PutVarint64(unsigned char *p, u64 v){ int i, j, n; u8 buf[10]; if( v & (((u64)0xff000000)<<32) ){ p[8] = (u8)v; v >>= 8; for(i=7; i>=0; i--){ p[i] = (u8)((v & 0x7f) | 0x80); v >>= 7; } return 9; } n = 0; do{ buf[n++] = (u8)((v & 0x7f) | 0x80); v >>= 7; }while( v!=0 ); buf[0] &= 0x7f; assert( n<=9 ); for(i=0, j=n-1; j>=0; j--, i++){ p[i] = buf[j]; } return n; } int sqlite3Fts5PutVarint(unsigned char *p, u64 v){ if( v<=0x7f ){ p[0] = v&0x7f; return 1; } if( v<=0x3fff ){ p[0] = ((v>>7)&0x7f)|0x80; p[1] = v&0x7f; return 2; } return fts5PutVarint64(p,v); } int sqlite3Fts5GetVarintLen(u32 iVal){ #if 0 if( iVal<(1 << 7 ) ) return 1; #endif assert( iVal>=(1 << 7) ); if( iVal<(1 << 14) ) return 2; if( iVal<(1 << 21) ) return 3; if( iVal<(1 << 28) ) return 4; return 5; } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5_vocab.c ================================================ /* ** 2015 May 08 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This is an SQLite virtual table module implementing direct access to an ** existing FTS5 index. The module may create several different types of ** tables: ** ** col: ** CREATE TABLE vocab(term, col, doc, cnt, PRIMARY KEY(term, col)); ** ** One row for each term/column combination. The value of $doc is set to ** the number of fts5 rows that contain at least one instance of term ** $term within column $col. Field $cnt is set to the total number of ** instances of term $term in column $col (in any row of the fts5 table). ** ** row: ** CREATE TABLE vocab(term, doc, cnt, PRIMARY KEY(term)); ** ** One row for each term in the database. The value of $doc is set to ** the number of fts5 rows that contain at least one instance of term ** $term. Field $cnt is set to the total number of instances of term ** $term in the database. ** ** instance: ** CREATE TABLE vocab(term, doc, col, offset, PRIMARY KEY()); ** ** One row for each term instance in the database. */ #include "fts5Int.h" typedef struct Fts5VocabTable Fts5VocabTable; typedef struct Fts5VocabCursor Fts5VocabCursor; struct Fts5VocabTable { sqlite3_vtab base; char *zFts5Tbl; /* Name of fts5 table */ char *zFts5Db; /* Db containing fts5 table */ sqlite3 *db; /* Database handle */ Fts5Global *pGlobal; /* FTS5 global object for this database */ int eType; /* FTS5_VOCAB_COL, ROW or INSTANCE */ }; struct Fts5VocabCursor { sqlite3_vtab_cursor base; sqlite3_stmt *pStmt; /* Statement holding lock on pIndex */ Fts5Index *pIndex; /* Associated FTS5 index */ int bEof; /* True if this cursor is at EOF */ Fts5IndexIter *pIter; /* Term/rowid iterator object */ int nLeTerm; /* Size of zLeTerm in bytes */ char *zLeTerm; /* (term <= $zLeTerm) paramater, or NULL */ /* These are used by 'col' tables only */ Fts5Config *pConfig; /* Fts5 table configuration */ int iCol; i64 *aCnt; i64 *aDoc; /* Output values used by all tables. */ i64 rowid; /* This table's current rowid value */ Fts5Buffer term; /* Current value of 'term' column */ /* Output values Used by 'instance' tables only */ i64 iInstPos; int iInstOff; }; #define FTS5_VOCAB_COL 0 #define FTS5_VOCAB_ROW 1 #define FTS5_VOCAB_INSTANCE 2 #define FTS5_VOCAB_COL_SCHEMA "term, col, doc, cnt" #define FTS5_VOCAB_ROW_SCHEMA "term, doc, cnt" #define FTS5_VOCAB_INST_SCHEMA "term, doc, col, offset" /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ #define FTS5_VOCAB_TERM_EQ 0x01 #define FTS5_VOCAB_TERM_GE 0x02 #define FTS5_VOCAB_TERM_LE 0x04 /* ** Translate a string containing an fts5vocab table type to an ** FTS5_VOCAB_XXX constant. If successful, set *peType to the output ** value and return SQLITE_OK. Otherwise, set *pzErr to an error message ** and return SQLITE_ERROR. */ static int fts5VocabTableType(const char *zType, char **pzErr, int *peType){ int rc = SQLITE_OK; char *zCopy = sqlite3Fts5Strndup(&rc, zType, -1); if( rc==SQLITE_OK ){ sqlite3Fts5Dequote(zCopy); if( sqlite3_stricmp(zCopy, "col")==0 ){ *peType = FTS5_VOCAB_COL; }else if( sqlite3_stricmp(zCopy, "row")==0 ){ *peType = FTS5_VOCAB_ROW; }else if( sqlite3_stricmp(zCopy, "instance")==0 ){ *peType = FTS5_VOCAB_INSTANCE; }else { *pzErr = sqlite3_mprintf("fts5vocab: unknown table type: %Q", zCopy); rc = SQLITE_ERROR; } sqlite3_free(zCopy); } return rc; } /* ** The xDisconnect() virtual table method. */ static int fts5VocabDisconnectMethod(sqlite3_vtab *pVtab){ Fts5VocabTable *pTab = (Fts5VocabTable*)pVtab; sqlite3_free(pTab); return SQLITE_OK; } /* ** The xDestroy() virtual table method. */ static int fts5VocabDestroyMethod(sqlite3_vtab *pVtab){ Fts5VocabTable *pTab = (Fts5VocabTable*)pVtab; sqlite3_free(pTab); return SQLITE_OK; } /* ** This function is the implementation of both the xConnect and xCreate ** methods of the FTS3 virtual table. ** ** The argv[] array contains the following: ** ** argv[0] -> module name ("fts5vocab") ** argv[1] -> database name ** argv[2] -> table name ** ** then: ** ** argv[3] -> name of fts5 table ** argv[4] -> type of fts5vocab table ** ** or, for tables in the TEMP schema only. ** ** argv[3] -> name of fts5 tables database ** argv[4] -> name of fts5 table ** argv[5] -> type of fts5vocab table */ static int fts5VocabInitVtab( sqlite3 *db, /* The SQLite database connection */ void *pAux, /* Pointer to Fts5Global object */ int argc, /* Number of elements in argv array */ const char * const *argv, /* xCreate/xConnect argument array */ sqlite3_vtab **ppVTab, /* Write the resulting vtab structure here */ char **pzErr /* Write any error message here */ ){ const char *azSchema[] = { "CREATE TABlE vocab(" FTS5_VOCAB_COL_SCHEMA ")", "CREATE TABlE vocab(" FTS5_VOCAB_ROW_SCHEMA ")", "CREATE TABlE vocab(" FTS5_VOCAB_INST_SCHEMA ")" }; Fts5VocabTable *pRet = 0; int rc = SQLITE_OK; /* Return code */ int bDb; bDb = (argc==6 && strlen(argv[1])==4 && memcmp("temp", argv[1], 4)==0); if( argc!=5 && bDb==0 ){ *pzErr = sqlite3_mprintf("wrong number of vtable arguments"); rc = SQLITE_ERROR; }else{ int nByte; /* Bytes of space to allocate */ const char *zDb = bDb ? argv[3] : argv[1]; const char *zTab = bDb ? argv[4] : argv[3]; const char *zType = bDb ? argv[5] : argv[4]; int nDb = (int)strlen(zDb)+1; int nTab = (int)strlen(zTab)+1; int eType = 0; rc = fts5VocabTableType(zType, pzErr, &eType); if( rc==SQLITE_OK ){ assert( eType>=0 && eTypepGlobal = (Fts5Global*)pAux; pRet->eType = eType; pRet->db = db; pRet->zFts5Tbl = (char*)&pRet[1]; pRet->zFts5Db = &pRet->zFts5Tbl[nTab]; memcpy(pRet->zFts5Tbl, zTab, nTab); memcpy(pRet->zFts5Db, zDb, nDb); sqlite3Fts5Dequote(pRet->zFts5Tbl); sqlite3Fts5Dequote(pRet->zFts5Db); } } *ppVTab = (sqlite3_vtab*)pRet; return rc; } /* ** The xConnect() and xCreate() methods for the virtual table. All the ** work is done in function fts5VocabInitVtab(). */ static int fts5VocabConnectMethod( sqlite3 *db, /* Database connection */ void *pAux, /* Pointer to tokenizer hash table */ int argc, /* Number of elements in argv array */ const char * const *argv, /* xCreate/xConnect argument array */ sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */ char **pzErr /* OUT: sqlite3_malloc'd error message */ ){ return fts5VocabInitVtab(db, pAux, argc, argv, ppVtab, pzErr); } static int fts5VocabCreateMethod( sqlite3 *db, /* Database connection */ void *pAux, /* Pointer to tokenizer hash table */ int argc, /* Number of elements in argv array */ const char * const *argv, /* xCreate/xConnect argument array */ sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */ char **pzErr /* OUT: sqlite3_malloc'd error message */ ){ return fts5VocabInitVtab(db, pAux, argc, argv, ppVtab, pzErr); } /* ** Implementation of the xBestIndex method. ** ** Only constraints of the form: ** ** term <= ? ** term == ? ** term >= ? ** ** are interpreted. Less-than and less-than-or-equal are treated ** identically, as are greater-than and greater-than-or-equal. */ static int fts5VocabBestIndexMethod( sqlite3_vtab *pUnused, sqlite3_index_info *pInfo ){ int i; int iTermEq = -1; int iTermGe = -1; int iTermLe = -1; int idxNum = 0; int nArg = 0; UNUSED_PARAM(pUnused); for(i=0; inConstraint; i++){ struct sqlite3_index_constraint *p = &pInfo->aConstraint[i]; if( p->usable==0 ) continue; if( p->iColumn==0 ){ /* term column */ if( p->op==SQLITE_INDEX_CONSTRAINT_EQ ) iTermEq = i; if( p->op==SQLITE_INDEX_CONSTRAINT_LE ) iTermLe = i; if( p->op==SQLITE_INDEX_CONSTRAINT_LT ) iTermLe = i; if( p->op==SQLITE_INDEX_CONSTRAINT_GE ) iTermGe = i; if( p->op==SQLITE_INDEX_CONSTRAINT_GT ) iTermGe = i; } } if( iTermEq>=0 ){ idxNum |= FTS5_VOCAB_TERM_EQ; pInfo->aConstraintUsage[iTermEq].argvIndex = ++nArg; pInfo->estimatedCost = 100; }else{ pInfo->estimatedCost = 1000000; if( iTermGe>=0 ){ idxNum |= FTS5_VOCAB_TERM_GE; pInfo->aConstraintUsage[iTermGe].argvIndex = ++nArg; pInfo->estimatedCost = pInfo->estimatedCost / 2; } if( iTermLe>=0 ){ idxNum |= FTS5_VOCAB_TERM_LE; pInfo->aConstraintUsage[iTermLe].argvIndex = ++nArg; pInfo->estimatedCost = pInfo->estimatedCost / 2; } } /* This virtual table always delivers results in ascending order of ** the "term" column (column 0). So if the user has requested this ** specifically - "ORDER BY term" or "ORDER BY term ASC" - set the ** sqlite3_index_info.orderByConsumed flag to tell the core the results ** are already in sorted order. */ if( pInfo->nOrderBy==1 && pInfo->aOrderBy[0].iColumn==0 && pInfo->aOrderBy[0].desc==0 ){ pInfo->orderByConsumed = 1; } pInfo->idxNum = idxNum; return SQLITE_OK; } /* ** Implementation of xOpen method. */ static int fts5VocabOpenMethod( sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr ){ Fts5VocabTable *pTab = (Fts5VocabTable*)pVTab; Fts5Index *pIndex = 0; Fts5Config *pConfig = 0; Fts5VocabCursor *pCsr = 0; int rc = SQLITE_OK; sqlite3_stmt *pStmt = 0; char *zSql = 0; zSql = sqlite3Fts5Mprintf(&rc, "SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'", pTab->zFts5Tbl, pTab->zFts5Db, pTab->zFts5Tbl, pTab->zFts5Tbl ); if( zSql ){ rc = sqlite3_prepare_v2(pTab->db, zSql, -1, &pStmt, 0); } sqlite3_free(zSql); assert( rc==SQLITE_OK || pStmt==0 ); if( rc==SQLITE_ERROR ) rc = SQLITE_OK; if( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){ i64 iId = sqlite3_column_int64(pStmt, 0); pIndex = sqlite3Fts5IndexFromCsrid(pTab->pGlobal, iId, &pConfig); } if( rc==SQLITE_OK && pIndex==0 ){ rc = sqlite3_finalize(pStmt); pStmt = 0; if( rc==SQLITE_OK ){ pVTab->zErrMsg = sqlite3_mprintf( "no such fts5 table: %s.%s", pTab->zFts5Db, pTab->zFts5Tbl ); rc = SQLITE_ERROR; } } if( rc==SQLITE_OK ){ int nByte = pConfig->nCol * sizeof(i64) * 2 + sizeof(Fts5VocabCursor); pCsr = (Fts5VocabCursor*)sqlite3Fts5MallocZero(&rc, nByte); } if( pCsr ){ pCsr->pIndex = pIndex; pCsr->pStmt = pStmt; pCsr->pConfig = pConfig; pCsr->aCnt = (i64*)&pCsr[1]; pCsr->aDoc = &pCsr->aCnt[pConfig->nCol]; }else{ sqlite3_finalize(pStmt); } *ppCsr = (sqlite3_vtab_cursor*)pCsr; return rc; } static void fts5VocabResetCursor(Fts5VocabCursor *pCsr){ pCsr->rowid = 0; sqlite3Fts5IterClose(pCsr->pIter); pCsr->pIter = 0; sqlite3_free(pCsr->zLeTerm); pCsr->nLeTerm = -1; pCsr->zLeTerm = 0; } /* ** Close the cursor. For additional information see the documentation ** on the xClose method of the virtual table interface. */ static int fts5VocabCloseMethod(sqlite3_vtab_cursor *pCursor){ Fts5VocabCursor *pCsr = (Fts5VocabCursor*)pCursor; fts5VocabResetCursor(pCsr); sqlite3Fts5BufferFree(&pCsr->term); sqlite3_finalize(pCsr->pStmt); sqlite3_free(pCsr); return SQLITE_OK; } static int fts5VocabInstanceNewTerm(Fts5VocabCursor *pCsr){ int rc = SQLITE_OK; if( sqlite3Fts5IterEof(pCsr->pIter) ){ pCsr->bEof = 1; }else{ const char *zTerm; int nTerm; zTerm = sqlite3Fts5IterTerm(pCsr->pIter, &nTerm); if( pCsr->nLeTerm>=0 ){ int nCmp = MIN(nTerm, pCsr->nLeTerm); int bCmp = memcmp(pCsr->zLeTerm, zTerm, nCmp); if( bCmp<0 || (bCmp==0 && pCsr->nLeTermbEof = 1; } } sqlite3Fts5BufferSet(&rc, &pCsr->term, nTerm, (const u8*)zTerm); } return rc; } static int fts5VocabInstanceNext(Fts5VocabCursor *pCsr){ int eDetail = pCsr->pConfig->eDetail; int rc = SQLITE_OK; Fts5IndexIter *pIter = pCsr->pIter; i64 *pp = &pCsr->iInstPos; int *po = &pCsr->iInstOff; while( eDetail==FTS5_DETAIL_NONE || sqlite3Fts5PoslistNext64(pIter->pData, pIter->nData, po, pp) ){ pCsr->iInstPos = 0; pCsr->iInstOff = 0; rc = sqlite3Fts5IterNextScan(pCsr->pIter); if( rc==SQLITE_OK ){ rc = fts5VocabInstanceNewTerm(pCsr); if( eDetail==FTS5_DETAIL_NONE ) break; } if( rc ){ pCsr->bEof = 1; break; } } return rc; } /* ** Advance the cursor to the next row in the table. */ static int fts5VocabNextMethod(sqlite3_vtab_cursor *pCursor){ Fts5VocabCursor *pCsr = (Fts5VocabCursor*)pCursor; Fts5VocabTable *pTab = (Fts5VocabTable*)pCursor->pVtab; int rc = SQLITE_OK; int nCol = pCsr->pConfig->nCol; pCsr->rowid++; if( pTab->eType==FTS5_VOCAB_INSTANCE ){ return fts5VocabInstanceNext(pCsr); } if( pTab->eType==FTS5_VOCAB_COL ){ for(pCsr->iCol++; pCsr->iColiCol++){ if( pCsr->aDoc[pCsr->iCol] ) break; } } if( pTab->eType!=FTS5_VOCAB_COL || pCsr->iCol>=nCol ){ if( sqlite3Fts5IterEof(pCsr->pIter) ){ pCsr->bEof = 1; }else{ const char *zTerm; int nTerm; zTerm = sqlite3Fts5IterTerm(pCsr->pIter, &nTerm); if( pCsr->nLeTerm>=0 ){ int nCmp = MIN(nTerm, pCsr->nLeTerm); int bCmp = memcmp(pCsr->zLeTerm, zTerm, nCmp); if( bCmp<0 || (bCmp==0 && pCsr->nLeTermbEof = 1; return SQLITE_OK; } } sqlite3Fts5BufferSet(&rc, &pCsr->term, nTerm, (const u8*)zTerm); memset(pCsr->aCnt, 0, nCol * sizeof(i64)); memset(pCsr->aDoc, 0, nCol * sizeof(i64)); pCsr->iCol = 0; assert( pTab->eType==FTS5_VOCAB_COL || pTab->eType==FTS5_VOCAB_ROW ); while( rc==SQLITE_OK ){ int eDetail = pCsr->pConfig->eDetail; const u8 *pPos; int nPos; /* Position list */ i64 iPos = 0; /* 64-bit position read from poslist */ int iOff = 0; /* Current offset within position list */ pPos = pCsr->pIter->pData; nPos = pCsr->pIter->nData; switch( pTab->eType ){ case FTS5_VOCAB_ROW: if( eDetail==FTS5_DETAIL_FULL ){ while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff, &iPos) ){ pCsr->aCnt[0]++; } } pCsr->aDoc[0]++; break; case FTS5_VOCAB_COL: if( eDetail==FTS5_DETAIL_FULL ){ int iCol = -1; while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff, &iPos) ){ int ii = FTS5_POS2COLUMN(iPos); pCsr->aCnt[ii]++; if( iCol!=ii ){ if( ii>=nCol ){ rc = FTS5_CORRUPT; break; } pCsr->aDoc[ii]++; iCol = ii; } } }else if( eDetail==FTS5_DETAIL_COLUMNS ){ while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff,&iPos) ){ assert_nc( iPos>=0 && iPos=nCol ){ rc = FTS5_CORRUPT; break; } pCsr->aDoc[iPos]++; } }else{ assert( eDetail==FTS5_DETAIL_NONE ); pCsr->aDoc[0]++; } break; default: assert( pTab->eType==FTS5_VOCAB_INSTANCE ); break; } if( rc==SQLITE_OK ){ rc = sqlite3Fts5IterNextScan(pCsr->pIter); } if( pTab->eType==FTS5_VOCAB_INSTANCE ) break; if( rc==SQLITE_OK ){ zTerm = sqlite3Fts5IterTerm(pCsr->pIter, &nTerm); if( nTerm!=pCsr->term.n || memcmp(zTerm, pCsr->term.p, nTerm) ){ break; } if( sqlite3Fts5IterEof(pCsr->pIter) ) break; } } } } if( rc==SQLITE_OK && pCsr->bEof==0 && pTab->eType==FTS5_VOCAB_COL ){ while( pCsr->aDoc[pCsr->iCol]==0 ) pCsr->iCol++; assert( pCsr->iColpConfig->nCol ); } return rc; } /* ** This is the xFilter implementation for the virtual table. */ static int fts5VocabFilterMethod( sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */ int idxNum, /* Strategy index */ const char *zUnused, /* Unused */ int nUnused, /* Number of elements in apVal */ sqlite3_value **apVal /* Arguments for the indexing scheme */ ){ Fts5VocabTable *pTab = (Fts5VocabTable*)pCursor->pVtab; Fts5VocabCursor *pCsr = (Fts5VocabCursor*)pCursor; int eType = pTab->eType; int rc = SQLITE_OK; int iVal = 0; int f = FTS5INDEX_QUERY_SCAN; const char *zTerm = 0; int nTerm = 0; sqlite3_value *pEq = 0; sqlite3_value *pGe = 0; sqlite3_value *pLe = 0; UNUSED_PARAM2(zUnused, nUnused); fts5VocabResetCursor(pCsr); if( idxNum & FTS5_VOCAB_TERM_EQ ) pEq = apVal[iVal++]; if( idxNum & FTS5_VOCAB_TERM_GE ) pGe = apVal[iVal++]; if( idxNum & FTS5_VOCAB_TERM_LE ) pLe = apVal[iVal++]; if( pEq ){ zTerm = (const char *)sqlite3_value_text(pEq); nTerm = sqlite3_value_bytes(pEq); f = 0; }else{ if( pGe ){ zTerm = (const char *)sqlite3_value_text(pGe); nTerm = sqlite3_value_bytes(pGe); } if( pLe ){ const char *zCopy = (const char *)sqlite3_value_text(pLe); pCsr->nLeTerm = sqlite3_value_bytes(pLe); pCsr->zLeTerm = sqlite3_malloc(pCsr->nLeTerm+1); if( pCsr->zLeTerm==0 ){ rc = SQLITE_NOMEM; }else{ memcpy(pCsr->zLeTerm, zCopy, pCsr->nLeTerm+1); } } } if( rc==SQLITE_OK ){ rc = sqlite3Fts5IndexQuery(pCsr->pIndex, zTerm, nTerm, f, 0, &pCsr->pIter); } if( rc==SQLITE_OK && eType==FTS5_VOCAB_INSTANCE ){ rc = fts5VocabInstanceNewTerm(pCsr); } if( rc==SQLITE_OK && !pCsr->bEof && (eType!=FTS5_VOCAB_INSTANCE || pCsr->pConfig->eDetail!=FTS5_DETAIL_NONE) ){ rc = fts5VocabNextMethod(pCursor); } return rc; } /* ** This is the xEof method of the virtual table. SQLite calls this ** routine to find out if it has reached the end of a result set. */ static int fts5VocabEofMethod(sqlite3_vtab_cursor *pCursor){ Fts5VocabCursor *pCsr = (Fts5VocabCursor*)pCursor; return pCsr->bEof; } static int fts5VocabColumnMethod( sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ sqlite3_context *pCtx, /* Context for sqlite3_result_xxx() calls */ int iCol /* Index of column to read value from */ ){ Fts5VocabCursor *pCsr = (Fts5VocabCursor*)pCursor; int eDetail = pCsr->pConfig->eDetail; int eType = ((Fts5VocabTable*)(pCursor->pVtab))->eType; i64 iVal = 0; if( iCol==0 ){ sqlite3_result_text( pCtx, (const char*)pCsr->term.p, pCsr->term.n, SQLITE_TRANSIENT ); }else if( eType==FTS5_VOCAB_COL ){ assert( iCol==1 || iCol==2 || iCol==3 ); if( iCol==1 ){ if( eDetail!=FTS5_DETAIL_NONE ){ const char *z = pCsr->pConfig->azCol[pCsr->iCol]; sqlite3_result_text(pCtx, z, -1, SQLITE_STATIC); } }else if( iCol==2 ){ iVal = pCsr->aDoc[pCsr->iCol]; }else{ iVal = pCsr->aCnt[pCsr->iCol]; } }else if( eType==FTS5_VOCAB_ROW ){ assert( iCol==1 || iCol==2 ); if( iCol==1 ){ iVal = pCsr->aDoc[0]; }else{ iVal = pCsr->aCnt[0]; } }else{ assert( eType==FTS5_VOCAB_INSTANCE ); switch( iCol ){ case 1: sqlite3_result_int64(pCtx, pCsr->pIter->iRowid); break; case 2: { int ii = -1; if( eDetail==FTS5_DETAIL_FULL ){ ii = FTS5_POS2COLUMN(pCsr->iInstPos); }else if( eDetail==FTS5_DETAIL_COLUMNS ){ ii = (int)pCsr->iInstPos; } if( ii>=0 && iipConfig->nCol ){ const char *z = pCsr->pConfig->azCol[ii]; sqlite3_result_text(pCtx, z, -1, SQLITE_STATIC); } break; } default: { assert( iCol==3 ); if( eDetail==FTS5_DETAIL_FULL ){ int ii = FTS5_POS2OFFSET(pCsr->iInstPos); sqlite3_result_int(pCtx, ii); } break; } } } if( iVal>0 ) sqlite3_result_int64(pCtx, iVal); return SQLITE_OK; } /* ** This is the xRowid method. The SQLite core calls this routine to ** retrieve the rowid for the current row of the result set. The ** rowid should be written to *pRowid. */ static int fts5VocabRowidMethod( sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid ){ Fts5VocabCursor *pCsr = (Fts5VocabCursor*)pCursor; *pRowid = pCsr->rowid; return SQLITE_OK; } int sqlite3Fts5VocabInit(Fts5Global *pGlobal, sqlite3 *db){ static const sqlite3_module fts5Vocab = { /* iVersion */ 2, /* xCreate */ fts5VocabCreateMethod, /* xConnect */ fts5VocabConnectMethod, /* xBestIndex */ fts5VocabBestIndexMethod, /* xDisconnect */ fts5VocabDisconnectMethod, /* xDestroy */ fts5VocabDestroyMethod, /* xOpen */ fts5VocabOpenMethod, /* xClose */ fts5VocabCloseMethod, /* xFilter */ fts5VocabFilterMethod, /* xNext */ fts5VocabNextMethod, /* xEof */ fts5VocabEofMethod, /* xColumn */ fts5VocabColumnMethod, /* xRowid */ fts5VocabRowidMethod, /* xUpdate */ 0, /* xBegin */ 0, /* xSync */ 0, /* xCommit */ 0, /* xRollback */ 0, /* xFindFunction */ 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ 0, /* xRollbackTo */ 0, }; void *p = (void*)pGlobal; return sqlite3_create_module_v2(db, "fts5vocab", &fts5Vocab, p, 0); } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/fts5parse.y ================================================ /* ** 2014 May 31 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** */ // All token codes are small integers with #defines that begin with "TK_" %token_prefix FTS5_ // The type of the data attached to each token is Token. This is also the // default type for non-terminals. // %token_type {Fts5Token} %default_type {Fts5Token} // The generated parser function takes a 4th argument as follows: %extra_argument {Fts5Parse *pParse} // This code runs whenever there is a syntax error // %syntax_error { UNUSED_PARAM(yymajor); /* Silence a compiler warning */ sqlite3Fts5ParseError( pParse, "fts5: syntax error near \"%.*s\"",TOKEN.n,TOKEN.p ); } %stack_overflow { sqlite3Fts5ParseError(pParse, "fts5: parser stack overflow"); } // The name of the generated procedure that implements the parser // is as follows: %name sqlite3Fts5Parser // The following text is included near the beginning of the C source // code file that implements the parser. // %include { #include "fts5Int.h" #include "fts5parse.h" /* ** Disable all error recovery processing in the parser push-down ** automaton. */ #define YYNOERRORRECOVERY 1 /* ** Make yytestcase() the same as testcase() */ #define yytestcase(X) testcase(X) /* ** Indicate that sqlite3ParserFree() will never be called with a null ** pointer. */ #define YYPARSEFREENOTNULL 1 /* ** Alternative datatype for the argument to the malloc() routine passed ** into sqlite3ParserAlloc(). The default is size_t. */ #define YYMALLOCARGTYPE u64 } // end %include %left OR. %left AND. %left NOT. %left TERM. %left COLON. input ::= expr(X). { sqlite3Fts5ParseFinished(pParse, X); } %destructor input { (void)pParse; } %type cnearset {Fts5ExprNode*} %type expr {Fts5ExprNode*} %type exprlist {Fts5ExprNode*} %destructor cnearset { sqlite3Fts5ParseNodeFree($$); } %destructor expr { sqlite3Fts5ParseNodeFree($$); } %destructor exprlist { sqlite3Fts5ParseNodeFree($$); } %type colset {Fts5Colset*} %destructor colset { sqlite3_free($$); } %type colsetlist {Fts5Colset*} %destructor colsetlist { sqlite3_free($$); } colset(A) ::= MINUS LCP colsetlist(X) RCP. { A = sqlite3Fts5ParseColsetInvert(pParse, X); } colset(A) ::= LCP colsetlist(X) RCP. { A = X; } colset(A) ::= STRING(X). { A = sqlite3Fts5ParseColset(pParse, 0, &X); } colset(A) ::= MINUS STRING(X). { A = sqlite3Fts5ParseColset(pParse, 0, &X); A = sqlite3Fts5ParseColsetInvert(pParse, A); } colsetlist(A) ::= colsetlist(Y) STRING(X). { A = sqlite3Fts5ParseColset(pParse, Y, &X); } colsetlist(A) ::= STRING(X). { A = sqlite3Fts5ParseColset(pParse, 0, &X); } expr(A) ::= expr(X) AND expr(Y). { A = sqlite3Fts5ParseNode(pParse, FTS5_AND, X, Y, 0); } expr(A) ::= expr(X) OR expr(Y). { A = sqlite3Fts5ParseNode(pParse, FTS5_OR, X, Y, 0); } expr(A) ::= expr(X) NOT expr(Y). { A = sqlite3Fts5ParseNode(pParse, FTS5_NOT, X, Y, 0); } expr(A) ::= colset(X) COLON LP expr(Y) RP. { sqlite3Fts5ParseSetColset(pParse, Y, X); A = Y; } expr(A) ::= LP expr(X) RP. {A = X;} expr(A) ::= exprlist(X). {A = X;} exprlist(A) ::= cnearset(X). {A = X;} exprlist(A) ::= exprlist(X) cnearset(Y). { A = sqlite3Fts5ParseImplicitAnd(pParse, X, Y); } cnearset(A) ::= nearset(X). { A = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, X); } cnearset(A) ::= colset(X) COLON nearset(Y). { A = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, Y); sqlite3Fts5ParseSetColset(pParse, A, X); } %type nearset {Fts5ExprNearset*} %type nearphrases {Fts5ExprNearset*} %destructor nearset { sqlite3Fts5ParseNearsetFree($$); } %destructor nearphrases { sqlite3Fts5ParseNearsetFree($$); } nearset(A) ::= phrase(X). { A = sqlite3Fts5ParseNearset(pParse, 0, X); } nearset(A) ::= STRING(X) LP nearphrases(Y) neardist_opt(Z) RP. { sqlite3Fts5ParseNear(pParse, &X); sqlite3Fts5ParseSetDistance(pParse, Y, &Z); A = Y; } nearphrases(A) ::= phrase(X). { A = sqlite3Fts5ParseNearset(pParse, 0, X); } nearphrases(A) ::= nearphrases(X) phrase(Y). { A = sqlite3Fts5ParseNearset(pParse, X, Y); } /* ** The optional ", " at the end of the NEAR() arguments. */ neardist_opt(A) ::= . { A.p = 0; A.n = 0; } neardist_opt(A) ::= COMMA STRING(X). { A = X; } /* ** A phrase. A set of primitives connected by "+" operators. Examples: ** ** "the" + "quick brown" + fo * ** "the quick brown fo" * ** the+quick+brown+fo* */ %type phrase {Fts5ExprPhrase*} %destructor phrase { sqlite3Fts5ParsePhraseFree($$); } phrase(A) ::= phrase(X) PLUS STRING(Y) star_opt(Z). { A = sqlite3Fts5ParseTerm(pParse, X, &Y, Z); } phrase(A) ::= STRING(Y) star_opt(Z). { A = sqlite3Fts5ParseTerm(pParse, 0, &Y, Z); } /* ** Optional "*" character. */ %type star_opt {int} star_opt(A) ::= STAR. { A = 1; } star_opt(A) ::= . { A = 0; } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/mkportersteps.tcl ================================================ # # 2014 Jun 09 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #------------------------------------------------------------------------- # # This script generates the implementations of the following C functions, # which are part of the porter tokenizer implementation: # # static int fts5PorterStep1B(char *aBuf, int *pnBuf); # static int fts5PorterStep1B2(char *aBuf, int *pnBuf); # static int fts5PorterStep2(char *aBuf, int *pnBuf); # static int fts5PorterStep3(char *aBuf, int *pnBuf); # static int fts5PorterStep4(char *aBuf, int *pnBuf); # set O(Step1B2) { { at {} ate 1 } { bl {} ble 1 } { iz {} ize 1 } } set O(Step1B) { { "eed" fts5Porter_MGt0 "ee" 0 } { "ed" fts5Porter_Vowel "" 1 } { "ing" fts5Porter_Vowel "" 1 } } set O(Step2) { { "ational" fts5Porter_MGt0 "ate" } { "tional" fts5Porter_MGt0 "tion" } { "enci" fts5Porter_MGt0 "ence" } { "anci" fts5Porter_MGt0 "ance" } { "izer" fts5Porter_MGt0 "ize" } { "logi" fts5Porter_MGt0 "log" } { "bli" fts5Porter_MGt0 "ble" } { "alli" fts5Porter_MGt0 "al" } { "entli" fts5Porter_MGt0 "ent" } { "eli" fts5Porter_MGt0 "e" } { "ousli" fts5Porter_MGt0 "ous" } { "ization" fts5Porter_MGt0 "ize" } { "ation" fts5Porter_MGt0 "ate" } { "ator" fts5Porter_MGt0 "ate" } { "alism" fts5Porter_MGt0 "al" } { "iveness" fts5Porter_MGt0 "ive" } { "fulness" fts5Porter_MGt0 "ful" } { "ousness" fts5Porter_MGt0 "ous" } { "aliti" fts5Porter_MGt0 "al" } { "iviti" fts5Porter_MGt0 "ive" } { "biliti" fts5Porter_MGt0 "ble" } } set O(Step3) { { "icate" fts5Porter_MGt0 "ic" } { "ative" fts5Porter_MGt0 "" } { "alize" fts5Porter_MGt0 "al" } { "iciti" fts5Porter_MGt0 "ic" } { "ical" fts5Porter_MGt0 "ic" } { "ful" fts5Porter_MGt0 "" } { "ness" fts5Porter_MGt0 "" } } set O(Step4) { { "al" fts5Porter_MGt1 "" } { "ance" fts5Porter_MGt1 "" } { "ence" fts5Porter_MGt1 "" } { "er" fts5Porter_MGt1 "" } { "ic" fts5Porter_MGt1 "" } { "able" fts5Porter_MGt1 "" } { "ible" fts5Porter_MGt1 "" } { "ant" fts5Porter_MGt1 "" } { "ement" fts5Porter_MGt1 "" } { "ment" fts5Porter_MGt1 "" } { "ent" fts5Porter_MGt1 "" } { "ion" fts5Porter_MGt1_and_S_or_T "" } { "ou" fts5Porter_MGt1 "" } { "ism" fts5Porter_MGt1 "" } { "ate" fts5Porter_MGt1 "" } { "iti" fts5Porter_MGt1 "" } { "ous" fts5Porter_MGt1 "" } { "ive" fts5Porter_MGt1 "" } { "ize" fts5Porter_MGt1 "" } } proc sort_cb {lhs rhs} { set L [string range [lindex $lhs 0] end-1 end-1] set R [string range [lindex $rhs 0] end-1 end-1] string compare $L $R } proc create_step_function {name data} { set T(function) { static int fts5Porter${name}(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ ${switchbody} } return ret; } } set T(case) { case '${k}': ${ifstmts} break; } set T(if_0_0_0) { if( ${match} ){ *pnBuf = nBuf - $n; } } set T(if_1_0_0) { if( ${match} ){ if( ${cond} ){ *pnBuf = nBuf - $n; } } } set T(if_0_1_0) { if( ${match} ){ ${memcpy} *pnBuf = nBuf - $n + $nRep; } } set T(if_1_1_0) { if( ${match} ){ if( ${cond} ){ ${memcpy} *pnBuf = nBuf - $n + $nRep; } } } set T(if_1_0_1) { if( ${match} ){ if( ${cond} ){ *pnBuf = nBuf - $n; ret = 1; } } } set T(if_0_1_1) { if( ${match} ){ ${memcpy} *pnBuf = nBuf - $n + $nRep; ret = 1; } } set T(if_1_1_1) { if( ${match} ){ if( ${cond} ){ ${memcpy} *pnBuf = nBuf - $n + $nRep; ret = 1; } } } set switchbody "" foreach I $data { set k [string range [lindex $I 0] end-1 end-1] lappend aCase($k) $I } foreach k [lsort [array names aCase]] { set ifstmts "" foreach I $aCase($k) { set zSuffix [lindex $I 0] ;# Suffix text for this rule set zRep [lindex $I 2] ;# Replacement text for rule set xCond [lindex $I 1] ;# Condition callback (or "") set n [string length $zSuffix] set nRep [string length $zRep] set match "nBuf>$n && 0==memcmp(\"$zSuffix\", &aBuf\[nBuf-$n\], $n)" set memcpy "memcpy(&aBuf\[nBuf-$n\], \"$zRep\", $nRep);" set cond "${xCond}(aBuf, nBuf-$n)" set bMemcpy [expr {$nRep>0}] set bCond [expr {$xCond!=""}] set bRet [expr {[llength $I]>3 && [lindex $I 3]}] set t $T(if_${bCond}_${bMemcpy}_${bRet}) lappend ifstmts [string trim [subst -nocommands $t]] } set ifstmts [join $ifstmts "else "] append switchbody [subst -nocommands $T(case)] } puts [subst -nocommands $T(function)] } puts [string trim { /************************************************************************** *************************************************************************** ** GENERATED CODE STARTS HERE (mkportersteps.tcl) */ }] foreach step [array names O] { create_step_function $step $O($step) } puts [string trim { /* ** GENERATED CODE ENDS HERE (mkportersteps.tcl) *************************************************************************** **************************************************************************/ }] ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5_common.tcl ================================================ # 2014 Dec 19 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. .. test] } source $testdir/tester.tcl ifcapable !fts5 { proc return_if_no_fts5 {} { finish_test return -code return } return } else { proc return_if_no_fts5 {} {} } catch { sqlite3_fts5_may_be_corrupt 0 reset_db } proc fts5_test_poslist {cmd} { set res [list] for {set i 0} {$i < [$cmd xInstCount]} {incr i} { lappend res [string map {{ } .} [$cmd xInst $i]] } set res } proc fts5_test_poslist2 {cmd} { set res [list] for {set i 0} {$i < [$cmd xPhraseCount]} {incr i} { $cmd xPhraseForeach $i c o { lappend res $i.$c.$o } } #set res sort_poslist $res } proc fts5_test_collist {cmd} { set res [list] for {set i 0} {$i < [$cmd xPhraseCount]} {incr i} { $cmd xPhraseColumnForeach $i c { lappend res $i.$c } } set res } proc fts5_test_columnsize {cmd} { set res [list] for {set i 0} {$i < [$cmd xColumnCount]} {incr i} { lappend res [$cmd xColumnSize $i] } set res } proc fts5_test_columntext {cmd} { set res [list] for {set i 0} {$i < [$cmd xColumnCount]} {incr i} { lappend res [$cmd xColumnText $i] } set res } proc fts5_test_columntotalsize {cmd} { set res [list] for {set i 0} {$i < [$cmd xColumnCount]} {incr i} { lappend res [$cmd xColumnTotalSize $i] } set res } proc test_append_token {varname token iStart iEnd} { upvar $varname var lappend var $token return "SQLITE_OK" } proc fts5_test_tokenize {cmd} { set res [list] for {set i 0} {$i < [$cmd xColumnCount]} {incr i} { set tokens [list] $cmd xTokenize [$cmd xColumnText $i] [list test_append_token tokens] lappend res $tokens } set res } proc fts5_test_rowcount {cmd} { $cmd xRowCount } proc test_queryphrase_cb {cnt cmd} { upvar $cnt L for {set i 0} {$i < [$cmd xInstCount]} {incr i} { foreach {ip ic io} [$cmd xInst $i] break set A($ic) 1 } foreach ic [array names A] { lset L $ic [expr {[lindex $L $ic] + 1}] } } proc fts5_test_queryphrase {cmd} { set res [list] for {set i 0} {$i < [$cmd xPhraseCount]} {incr i} { set cnt [list] for {set j 0} {$j < [$cmd xColumnCount]} {incr j} { lappend cnt 0 } $cmd xQueryPhrase $i [list test_queryphrase_cb cnt] lappend res $cnt } set res } proc fts5_test_phrasecount {cmd} { $cmd xPhraseCount } proc fts5_test_all {cmd} { set res [list] lappend res columnsize [fts5_test_columnsize $cmd] lappend res columntext [fts5_test_columntext $cmd] lappend res columntotalsize [fts5_test_columntotalsize $cmd] lappend res poslist [fts5_test_poslist $cmd] lappend res tokenize [fts5_test_tokenize $cmd] lappend res rowcount [fts5_test_rowcount $cmd] set res } proc fts5_aux_test_functions {db} { foreach f { fts5_test_columnsize fts5_test_columntext fts5_test_columntotalsize fts5_test_poslist fts5_test_poslist2 fts5_test_collist fts5_test_tokenize fts5_test_rowcount fts5_test_all fts5_test_queryphrase fts5_test_phrasecount } { sqlite3_fts5_create_function $db $f $f } } proc fts5_segcount {tbl} { set N 0 foreach n [fts5_level_segs $tbl] { incr N $n } set N } proc fts5_level_segs {tbl} { set sql "SELECT fts5_decode(rowid,block) aS r FROM ${tbl}_data WHERE rowid=10" set ret [list] foreach L [lrange [db one $sql] 1 end] { lappend ret [expr [llength $L] - 3] } set ret } proc fts5_level_segids {tbl} { set sql "SELECT fts5_decode(rowid,block) aS r FROM ${tbl}_data WHERE rowid=10" set ret [list] foreach L [lrange [db one $sql] 1 end] { set lvl [list] foreach S [lrange $L 3 end] { regexp {id=([1234567890]*)} $S -> segid lappend lvl $segid } lappend ret $lvl } set ret } proc fts5_rnddoc {n} { set map [list 0 a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j] set doc [list] for {set i 0} {$i < $n} {incr i} { lappend doc "x[string map $map [format %.3d [expr int(rand()*1000)]]]" } set doc } #------------------------------------------------------------------------- # Usage: # # nearset aCol ?-pc VARNAME? ?-near N? ?-col C? -- phrase1 phrase2... # # This command is used to test if a document (set of column values) matches # the logical equivalent of a single FTS5 NEAR() clump and, if so, return # the equivalent of an FTS5 position list. # # Parameter $aCol is passed a list of the column values for the document # to test. Parameters $phrase1 and so on are the phrases. # # The result is a list of phrase hits. Each phrase hit is formatted as # three integers separated by "." characters, in the following format: # # . . # # Options: # # -near N (NEAR distance. Default 10) # -col C (List of column indexes to match against) # -pc VARNAME (variable in caller frame to use for phrase numbering) # -dict VARNAME (array in caller frame to use for synonyms) # proc nearset {aCol args} { # Process the command line options. # set O(-near) 10 set O(-col) {} set O(-pc) "" set O(-dict) "" set nOpt [lsearch -exact $args --] if {$nOpt<0} { error "no -- option" } # Set $lPhrase to be a list of phrases. $nPhrase its length. set lPhrase [lrange $args [expr $nOpt+1] end] set nPhrase [llength $lPhrase] foreach {k v} [lrange $args 0 [expr $nOpt-1]] { if {[info exists O($k)]==0} { error "unrecognized option $k" } set O($k) $v } if {$O(-pc) == ""} { set counter 0 } else { upvar $O(-pc) counter } if {$O(-dict)!=""} { upvar $O(-dict) aDict } for {set j 0} {$j < [llength $aCol]} {incr j} { for {set i 0} {$i < $nPhrase} {incr i} { set A($j,$i) [list] } } # Loop through each column of the current row. for {set iCol 0} {$iCol < [llength $aCol]} {incr iCol} { # If there is a column filter, test whether this column is excluded. If # so, skip to the next iteration of this loop. Otherwise, set zCol to the # column value and nToken to the number of tokens that comprise it. if {$O(-col)!="" && [lsearch $O(-col) $iCol]<0} continue set zCol [lindex $aCol $iCol] set nToken [llength $zCol] # Each iteration of the following loop searches a substring of the # column value for phrase matches. The last token of the substring # is token $iLast of the column value. The first token is: # # iFirst = ($iLast - $O(-near) - 1) # # where $sz is the length of the phrase being searched for. A phrase # counts as matching the substring if its first token lies on or before # $iLast and its last token on or after $iFirst. # # For example, if the query is "NEAR(a+b c, 2)" and the column value: # # "x x x x A B x x C x" # 0 1 2 3 4 5 6 7 8 9" # # when (iLast==8 && iFirst=5) the range will contain both phrases and # so both instances can be added to the output poslists. # set iLast [expr $O(-near) >= $nToken ? $nToken - 1 : $O(-near)] for { } {$iLast < $nToken} {incr iLast} { catch { array unset B } for {set iPhrase 0} {$iPhrase<$nPhrase} {incr iPhrase} { set p [lindex $lPhrase $iPhrase] set nPm1 [expr {[llength $p] - 1}] set iFirst [expr $iLast - $O(-near) - [llength $p]] for {set i $iFirst} {$i <= $iLast} {incr i} { set lCand [lrange $zCol $i [expr $i+$nPm1]] set bMatch 1 foreach tok $p term $lCand { if {[nearset_match aDict $tok $term]==0} { set bMatch 0 ; break } } if {$bMatch} { lappend B($iPhrase) $i } } if {![info exists B($iPhrase)]} break } if {$iPhrase==$nPhrase} { for {set iPhrase 0} {$iPhrase<$nPhrase} {incr iPhrase} { set A($iCol,$iPhrase) [concat $A($iCol,$iPhrase) $B($iPhrase)] set A($iCol,$iPhrase) [lsort -integer -uniq $A($iCol,$iPhrase)] } } } } set res [list] #puts [array names A] for {set iPhrase 0} {$iPhrase<$nPhrase} {incr iPhrase} { for {set iCol 0} {$iCol < [llength $aCol]} {incr iCol} { foreach a $A($iCol,$iPhrase) { lappend res "$counter.$iCol.$a" } } incr counter } #puts "$aCol -> $res" sort_poslist $res } proc nearset_match {aDictVar tok term} { if {[string match $tok $term]} { return 1 } upvar $aDictVar aDict if {[info exists aDict($tok)]} { foreach s $aDict($tok) { if {[string match $s $term]} { return 1 } } } return 0; } #------------------------------------------------------------------------- # Usage: # # sort_poslist LIST # # Sort a position list of the type returned by command [nearset] # proc sort_poslist {L} { lsort -command instcompare $L } proc instcompare {lhs rhs} { foreach {p1 c1 o1} [split $lhs .] {} foreach {p2 c2 o2} [split $rhs .] {} set res [expr $c1 - $c2] if {$res==0} { set res [expr $o1 - $o2] } if {$res==0} { set res [expr $p1 - $p2] } return $res } #------------------------------------------------------------------------- # Logical operators used by the commands returned by fts5_tcl_expr(). # proc AND {args} { foreach a $args { if {[llength $a]==0} { return [list] } } sort_poslist [concat {*}$args] } proc OR {args} { sort_poslist [concat {*}$args] } proc NOT {a b} { if {[llength $b]>0} { return [list] } return $a } #------------------------------------------------------------------------- # This command is similar to [split], except that it also provides the # start and end offsets of each token. For example: # # [fts5_tokenize_split "abc d ef"] -> {abc 0 3 d 4 5 ef 6 8} # proc gobble_whitespace {textvar} { upvar $textvar t regexp {([ ]*)(.*)} $t -> space t return [string length $space] } proc gobble_text {textvar wordvar} { upvar $textvar t upvar $wordvar w regexp {([^ ]*)(.*)} $t -> w t return [string length $w] } proc fts5_tokenize_split {text} { set token "" set ret [list] set iOff [gobble_whitespace text] while {[set nToken [gobble_text text word]]} { lappend ret $word $iOff [expr $iOff+$nToken] incr iOff $nToken incr iOff [gobble_whitespace text] } set ret } #------------------------------------------------------------------------- # proc foreach_detail_mode {prefix script} { set saved $::testprefix foreach d [list full col none] { set s [string map [list %DETAIL% $d] $script] set ::detail $d set ::testprefix "$prefix-$d" reset_db uplevel $s unset ::detail } set ::testprefix $saved } proc detail_check {} { if {$::detail != "none" && $::detail!="full" && $::detail!="col"} { error "not in foreach_detail_mode {...} block" } } proc detail_is_none {} { detail_check ; expr {$::detail == "none"} } proc detail_is_col {} { detail_check ; expr {$::detail == "col" } } proc detail_is_full {} { detail_check ; expr {$::detail == "full"} } #------------------------------------------------------------------------- # Convert a poslist of the type returned by fts5_test_poslist() to a # collist as returned by fts5_test_collist(). # proc fts5_poslist2collist {poslist} { set res [list] foreach h $poslist { regexp {(.*)\.[1234567890]+} $h -> cand lappend res $cand } set res [lsort -command fts5_collist_elem_compare -unique $res] return $res } # Comparison function used by fts5_poslist2collist to sort collist entries. proc fts5_collist_elem_compare {a b} { foreach {a1 a2} [split $a .] {} foreach {b1 b2} [split $b .] {} if {$a1==$b1} { return [expr $a2 - $b2] } return [expr $a1 - $b1] } #-------------------------------------------------------------------------- # Construct and return a tcl list equivalent to that returned by the SQL # query executed against database handle [db]: # # SELECT # rowid, # fts5_test_poslist($tbl), # fts5_test_collist($tbl) # FROM $tbl('$expr') # ORDER BY rowid $order; # proc fts5_query_data {expr tbl {order ASC} {aDictVar ""}} { # Figure out the set of columns in the FTS5 table. This routine does # not handle tables with UNINDEXED columns, but if it did, it would # have to be here. db eval "PRAGMA table_info = $tbl" x { lappend lCols $x(name) } set d "" if {$aDictVar != ""} { upvar $aDictVar aDict set d aDict } set cols "" foreach e $lCols { append cols ", '$e'" } set tclexpr [db one [subst -novar { SELECT fts5_expr_tcl( $expr, 'nearset $cols -dict $d -pc ::pc' [set cols] ) }]] set res [list] db eval "SELECT rowid, * FROM $tbl ORDER BY rowid $order" x { set cols [list] foreach col $lCols { lappend cols $x($col) } set ::pc 0 set rowdata [eval $tclexpr] if {$rowdata != ""} { lappend res $x(rowid) $rowdata [fts5_poslist2collist $rowdata] } } set res } #------------------------------------------------------------------------- # Similar to [fts5_query_data], but omit the collist field. # proc fts5_poslist_data {expr tbl {order ASC} {aDictVar ""}} { set res [list] if {$aDictVar!=""} { upvar $aDictVar aDict set dict aDict } else { set dict "" } foreach {rowid poslist collist} [fts5_query_data $expr $tbl $order $dict] { lappend res $rowid $poslist } set res } proc fts5_collist_data {expr tbl {order ASC} {aDictVar ""}} { set res [list] if {$aDictVar!=""} { upvar $aDictVar aDict set dict aDict } else { set dict "" } foreach {rowid poslist collist} [fts5_query_data $expr $tbl $order $dict] { lappend res $rowid $collist } set res } #------------------------------------------------------------------------- # # This command will only work inside a [foreach_detail_mode] block. It tests # whether or not expression $expr run on FTS5 table $tbl is supported by # the current mode. If so, 1 is returned. If not, 0. # # detail=full (all queries supported) # detail=col (all but phrase queries and NEAR queries) # detail=none (all but phrase queries, NEAR queries, and column filters) # proc fts5_expr_ok {expr tbl} { if {![detail_is_full]} { set nearset "nearset_rc" if {[detail_is_col]} { set nearset "nearset_rf" } set ::expr_not_ok 0 db eval "PRAGMA table_info = $tbl" x { lappend lCols $x(name) } set cols "" foreach e $lCols { append cols ", '$e'" } set ::pc 0 set tclexpr [db one [subst -novar { SELECT fts5_expr_tcl( $expr, '[set nearset] $cols -pc ::pc' [set cols] ) }]] eval $tclexpr if {$::expr_not_ok} { return 0 } } return 1 } # Helper for [fts5_expr_ok] proc nearset_rf {aCol args} { set idx [lsearch -exact $args --] if {$idx != [llength $args]-2 || [llength [lindex $args end]]!=1} { set ::expr_not_ok 1 } list } # Helper for [fts5_expr_ok] proc nearset_rc {aCol args} { nearset_rf $aCol {*}$args if {[lsearch $args -col]>=0} { set ::expr_not_ok 1 } list } #------------------------------------------------------------------------- # Code for a simple Tcl tokenizer that supports synonyms at query time. # proc tclnum_tokenize {mode tflags text} { foreach {w iStart iEnd} [fts5_tokenize_split $text] { sqlite3_fts5_token $w $iStart $iEnd if {$tflags == $mode && [info exists ::tclnum_syn($w)]} { foreach s $::tclnum_syn($w) { sqlite3_fts5_token -colo $s $iStart $iEnd } } } } proc tclnum_create {args} { set mode query if {[llength $args]} { set mode [lindex $args 0] } if {$mode != "query" && $mode != "document"} { error "bad mode: $mode" } return [list tclnum_tokenize $mode] } proc fts5_tclnum_register {db} { foreach SYNDICT { {zero 0} {one 1 i} {two 2 ii} {three 3 iii} {four 4 iv} {five 5 v} {six 6 vi} {seven 7 vii} {eight 8 viii} {nine 9 ix} {a1 a2 a3 a4 a5 a6 a7 a8 a9} {b1 b2 b3 b4 b5 b6 b7 b8 b9} {c1 c2 c3 c4 c5 c6 c7 c8 c9} } { foreach s $SYNDICT { set o [list] foreach x $SYNDICT {if {$x!=$s} {lappend o $x}} set ::tclnum_syn($s) $o } } sqlite3_fts5_create_tokenizer db tclnum tclnum_create } # # End of tokenizer code. #------------------------------------------------------------------------- ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5aa.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5aa # If SQLITE_ENABLE_FTS5 is not defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $::testprefix { do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, c); SELECT name, sql FROM sqlite_master; } { t1 {CREATE VIRTUAL TABLE t1 USING fts5(a, b, c)} t1_data {CREATE TABLE 't1_data'(id INTEGER PRIMARY KEY, block BLOB)} t1_idx {CREATE TABLE 't1_idx'(segid, term, pgno, PRIMARY KEY(segid, term)) WITHOUT ROWID} t1_content {CREATE TABLE 't1_content'(id INTEGER PRIMARY KEY, c0, c1, c2)} t1_docsize {CREATE TABLE 't1_docsize'(id INTEGER PRIMARY KEY, sz BLOB)} t1_config {CREATE TABLE 't1_config'(k PRIMARY KEY, v) WITHOUT ROWID} } do_execsql_test 1.1 { DROP TABLE t1; SELECT name, sql FROM sqlite_master; } { } #------------------------------------------------------------------------- # do_execsql_test 2.0 { CREATE VIRTUAL TABLE t1 USING fts5(x, y, detail=%DETAIL%); } do_execsql_test 2.1 { INSERT INTO t1 VALUES('a b c', 'd e f'); } do_test 2.2 { execsql { SELECT fts5_decode(id, block) FROM t1_data WHERE id==10 } } {/{{structure} {lvl=0 nMerge=0 nSeg=1 {id=[0123456789]* leaves=1..1}}}/} foreach w {a b c d e f} { do_execsql_test 2.3.$w.asc { SELECT rowid FROM t1 WHERE t1 MATCH $w; } {1} do_execsql_test 2.3.$w.desc { SELECT rowid FROM t1 WHERE t1 MATCH $w ORDER BY rowid DESC; } {1} } do_execsql_test 2.4 { INSERT INTO t1(t1) VALUES('integrity-check'); } #------------------------------------------------------------------------- # reset_db do_execsql_test 3.0 { CREATE VIRTUAL TABLE t1 USING fts5(x,y, detail=%DETAIL%); } foreach {i x y} { 1 {g f d b f} {h h e i a} 2 {f i g j e} {i j c f f} 3 {e e i f a} {e h f d f} 4 {h j f j i} {h a c f j} 5 {d b j c g} {f e i b e} 6 {a j a e e} {j d f d e} 7 {g i j c h} {j d h c a} 8 {j j i d d} {e e d f b} 9 {c j j d c} {h j i f g} 10 {b f h i a} {c f b b j} } { do_execsql_test 3.$i.1 { INSERT INTO t1 VALUES($x, $y) } do_execsql_test 3.$i.2 { INSERT INTO t1(t1) VALUES('integrity-check') } if {[set_test_counter errors]} break } #------------------------------------------------------------------------- # reset_db do_execsql_test 4.0 { CREATE VIRTUAL TABLE t1 USING fts5(x,y, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } foreach {i x y} { 1 {g f d b f} {h h e i a} 2 {f i g j e} {i j c f f} 3 {e e i f a} {e h f d f} 4 {h j f j i} {h a c f j} 5 {d b j c g} {f e i b e} 6 {a j a e e} {j d f d e} 7 {g i j c h} {j d h c a} 8 {j j i d d} {e e d f b} 9 {c j j d c} {h j i f g} 10 {b f h i a} {c f b b j} } { do_execsql_test 4.$i.1 { INSERT INTO t1 VALUES($x, $y) } do_execsql_test 4.$i.2 { INSERT INTO t1(t1) VALUES('integrity-check') } if {[set_test_counter errors]} break } #------------------------------------------------------------------------- # reset_db do_execsql_test 5.0 { CREATE VIRTUAL TABLE t1 USING fts5(x,y, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } foreach {i x y} { 1 {dd abc abc abc abcde} {aaa dd ddd ddd aab} 2 {dd aab d aaa b} {abcde c aaa aaa aaa} 3 {abcde dd b b dd} {abc abc d abc ddddd} 4 {aaa abcde dddd dddd abcde} {abc b b abcde abc} 5 {aab dddd d dddd c} {ddd abcde dddd abcde c} 6 {ddd dd b aab abcde} {d ddddd dddd c abc} 7 {d ddddd ddd c abcde} {c aab d abcde ddd} 8 {abcde aaa aab c c} {ddd c dddd b aaa} 9 {abcde aab ddddd c aab} {dddd dddd b c dd} 10 {ddd abcde dddd dd c} {dddd c c d abcde} } { do_execsql_test 5.$i.1 { INSERT INTO t1 VALUES($x, $y) } do_execsql_test 5.$i.2 { INSERT INTO t1(t1) VALUES('integrity-check') } if {[set_test_counter errors]} break } #------------------------------------------------------------------------- # reset_db do_execsql_test 6.0 { CREATE VIRTUAL TABLE t1 USING fts5(x,y, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } do_execsql_test 6.1 { INSERT INTO t1(rowid, x, y) VALUES(22, 'a b c', 'c b a'); REPLACE INTO t1(rowid, x, y) VALUES(22, 'd e f', 'f e d'); } do_execsql_test 6.2 { INSERT INTO t1(t1) VALUES('integrity-check') } do_execsql_test 6.3 { REPLACE INTO t1(rowid, x, y) VALUES('22', 'l l l', 'l l l'); } do_execsql_test 6.4 { REPLACE INTO t1(x, y) VALUES('x y z', 'x y z'); } do_execsql_test 6.5 { INSERT INTO t1(t1) VALUES('integrity-check') } do_execsql_test 6.6 { SELECT rowid, * FROM t1; } { 22 {l l l} {l l l} 23 {x y z} {x y z} } #------------------------------------------------------------------------- # reset_db expr srand(0) do_execsql_test 7.0 { CREATE VIRTUAL TABLE t1 USING fts5(x,y,z); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } proc doc {} { set v [list aaa aab abc abcde b c d dd ddd dddd ddddd] set ret [list] for {set j 0} {$j < 20} {incr j} { lappend ret [lindex $v [expr int(rand()*[llength $v])]] } return $ret } proc dump_structure {} { db eval {SELECT fts5_decode(id, block) AS t FROM t1_data WHERE id=10} { foreach lvl [lrange $t 1 end] { set seg [string repeat . [expr [llength $lvl]-2]] puts "[lrange $lvl 0 1] $seg" } } } for {set i 1} {$i <= 10} {incr i} { do_test 7.$i { for {set j 0} {$j < 10} {incr j} { set x [doc] set y [doc] set z [doc] set rowid [expr int(rand() * 100)] execsql { REPLACE INTO t1(rowid,x,y,z) VALUES($rowid, $x, $y, $z) } } execsql { INSERT INTO t1(t1) VALUES('integrity-check'); } } {} if {[set_test_counter errors]} break } #------------------------------------------------------------------------- # reset_db do_execsql_test 8.0 { CREATE VIRTUAL TABLE t1 USING fts5(x, prefix="1,2,3"); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } do_execsql_test 8.1 { INSERT INTO t1 VALUES('the quick brown fox'); INSERT INTO t1(t1) VALUES('integrity-check'); } #------------------------------------------------------------------------- # reset_db expr srand(0) do_execsql_test 9.0 { CREATE VIRTUAL TABLE t1 USING fts5(x,y,z, prefix="1,2,3"); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } proc doc {} { set v [list aaa aab abc abcde b c d dd ddd dddd ddddd] set ret [list] for {set j 0} {$j < 20} {incr j} { lappend ret [lindex $v [expr int(rand()*[llength $v])]] } return $ret } proc dump_structure {} { db eval {SELECT fts5_decode(id, block) AS t FROM t1_data WHERE id=10} { foreach lvl [lrange $t 1 end] { set seg [string repeat . [expr [llength $lvl]-2]] puts "[lrange $lvl 0 1] $seg" } } } for {set i 1} {$i <= 10} {incr i} { do_test 9.$i { for {set j 0} {$j < 100} {incr j} { set x [doc] set y [doc] set z [doc] set rowid [expr int(rand() * 100)] execsql { REPLACE INTO t1(rowid,x,y,z) VALUES($rowid, $x, $y, $z) } } execsql { INSERT INTO t1(t1) VALUES('integrity-check'); } } {} if {[set_test_counter errors]} break } #------------------------------------------------------------------------- # reset_db do_execsql_test 10.0 { CREATE VIRTUAL TABLE t1 USING fts5(x,y, detail=%DETAIL%); } set d10 { 1 {g f d b f} {h h e i a} 2 {f i g j e} {i j c f f} 3 {e e i f a} {e h f d f} 4 {h j f j i} {h a c f j} 5 {d b j c g} {f e i b e} 6 {a j a e e} {j d f d e} 7 {g i j c h} {j d h c a} 8 {j j i d d} {e e d f b} 9 {c j j d c} {h j i f g} 10 {b f h i a} {c f b b j} } foreach {rowid x y} $d10 { do_execsql_test 10.1.$rowid.1 { INSERT INTO t1 VALUES($x, $y) } do_execsql_test 10.1.$rowid.2 { INSERT INTO t1(t1) VALUES('integrity-check') } } foreach rowid {5 9 8 1 2 4 10 7 3 5 6} { do_execsql_test 10.2.$rowid.1 { DELETE FROM t1 WHERE rowid = $rowid } do_execsql_test 10.2.$rowid.2 { INSERT INTO t1(t1) VALUES('integrity-check') } } foreach {rowid x y} $d10 { do_execsql_test 10.3.$rowid.1 { INSERT INTO t1 VALUES($x, $y) } do_execsql_test 10.3.$rowid.2 { INSERT INTO t1(t1) VALUES('integrity-check') } } do_execsql_test 10.4.1 { DELETE FROM t1 } do_execsql_test 10.4.2 { INSERT INTO t1(t1) VALUES('integrity-check') } #------------------------------------------------------------------------- # do_catchsql_test 11.1 { CREATE VIRTUAL TABLE t2 USING fts5(a, b, c, rank, detail=%DETAIL%); } {1 {reserved fts5 column name: rank}} do_catchsql_test 11.2 { CREATE VIRTUAL TABLE rank USING fts5(a, b, c, detail=%DETAIL%); } {1 {reserved fts5 table name: rank}} do_catchsql_test 11.3 { CREATE VIRTUAL TABLE t2 USING fts5(a, b, c, rowid, detail=%DETAIL%); } {1 {reserved fts5 column name: rowid}} #------------------------------------------------------------------------- # do_execsql_test 12.1 { CREATE VIRTUAL TABLE t2 USING fts5(x,y, detail=%DETAIL%); } {} do_catchsql_test 12.2 { SELECT t2 FROM t2 WHERE t2 MATCH '*stuff' } {1 {unknown special query: stuff}} do_test 12.3 { set res [db eval { SELECT t2 FROM t2 WHERE t2 MATCH '* reads ' }] string is integer $res } {1} #------------------------------------------------------------------------- # reset_db do_execsql_test 13.1 { CREATE VIRTUAL TABLE t1 USING fts5(x, detail=%DETAIL%); INSERT INTO t1(rowid, x) VALUES(1, 'o n e'), (2, 't w o'); } {} do_execsql_test 13.2 { SELECT rowid FROM t1 WHERE t1 MATCH 'o'; } {1 2} do_execsql_test 13.4 { DELETE FROM t1 WHERE rowid=2; } {} do_execsql_test 13.5 { SELECT rowid FROM t1 WHERE t1 MATCH 'o'; } {1} do_execsql_test 13.6 { SELECT rowid FROM t1 WHERE t1 MATCH '""'; } {} #------------------------------------------------------------------------- # reset_db do_execsql_test 14.1 { CREATE VIRTUAL TABLE t1 USING fts5(x, y, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); WITH d(x,y) AS ( SELECT NULL, 'xyz xyz xyz xyz xyz xyz' UNION ALL SELECT NULL, 'xyz xyz xyz xyz xyz xyz' FROM d ) INSERT INTO t1 SELECT * FROM d LIMIT 200; } do_execsql_test 15.x { INSERT INTO t1(t1) VALUES('integrity-check'); } do_test 14.2 { set nRow 0 db eval { SELECT * FROM t1 WHERE t1 MATCH 'xyz' } { db eval { BEGIN; CREATE TABLE t2(a, b); ROLLBACK; } incr nRow } set nRow } {200} do_test 14.3 { set nRow 0 db eval { BEGIN; } db eval { SELECT * FROM t1 WHERE t1 MATCH 'xyz' } { db eval { SAVEPOINT aaa; CREATE TABLE t2(a, b); ROLLBACK TO aaa; RELEASE aaa; } incr nRow } set nRow } {200} do_execsql_test 15.0 { INSERT INTO t1(t1) VALUES('integrity-check'); } do_execsql_test 15.1 { UPDATE t1_content SET c1 = 'xyz xyz xyz xyz xyz abc' WHERE rowid = 1; } do_catchsql_test 15.2 { INSERT INTO t1(t1) VALUES('integrity-check'); } {1 {database disk image is malformed}} #------------------------------------------------------------------------- # do_execsql_test 16.1 { CREATE VIRTUAL TABLE n1 USING fts5(a); INSERT INTO n1 VALUES('a b c d'); } proc funk {} { db eval { UPDATE n1_config SET v=50 WHERE k='version' } set fd [db incrblob main n1_data block 10] fconfigure $fd -encoding binary -translation binary puts -nonewline $fd "\x44\x45" close $fd } db func funk funk # This test case corrupts the structure record within the first invocation # of function funk(). Which used to cause the bm25() function to throw an # exception. But since bm25() can now used the cached structure record, # it never sees the corruption introduced by funk() and so the following # statement no longer fails. # do_catchsql_test 16.2 { SELECT funk(), bm25(n1), funk() FROM n1 WHERE n1 MATCH 'a+b+c+d' } {0 {{} -1e-06 {}}} # {1 {SQL logic error}} #------------------------------------------------------------------------- # reset_db do_execsql_test 17.1 { CREATE VIRTUAL TABLE b2 USING fts5(x, detail=%DETAIL%); INSERT INTO b2 VALUES('a'); INSERT INTO b2 VALUES('b'); INSERT INTO b2 VALUES('c'); } do_test 17.2 { set res [list] db eval { SELECT * FROM b2 ORDER BY rowid ASC } { lappend res [execsql { SELECT * FROM b2 ORDER BY rowid ASC }] } set res } {{a b c} {a b c} {a b c}} if {[string match n* %DETAIL%]==0} { reset_db do_execsql_test 17.3 { CREATE VIRTUAL TABLE c2 USING fts5(x, y, detail=%DETAIL%); INSERT INTO c2 VALUES('x x x', 'x x x'); SELECT rowid FROM c2 WHERE c2 MATCH 'y:x'; } {1} } #------------------------------------------------------------------------- # reset_db do_execsql_test 17.1 { CREATE VIRTUAL TABLE uio USING fts5(ttt, detail=%DETAIL%); INSERT INTO uio VALUES(NULL); INSERT INTO uio SELECT NULL FROM uio; INSERT INTO uio SELECT NULL FROM uio; INSERT INTO uio SELECT NULL FROM uio; INSERT INTO uio SELECT NULL FROM uio; INSERT INTO uio SELECT NULL FROM uio; INSERT INTO uio SELECT NULL FROM uio; INSERT INTO uio SELECT NULL FROM uio; INSERT INTO uio SELECT NULL FROM uio; SELECT count(*) FROM uio; } {256} do_execsql_test 17.2 { SELECT count(*) FROM uio WHERE rowid BETWEEN 8 AND 17 } {10} do_execsql_test 17.3 { SELECT rowid FROM uio WHERE rowid BETWEEN 8 AND 17 } {8 9 10 11 12 13 14 15 16 17} do_execsql_test 17.4 { SELECT rowid FROM uio WHERE rowid BETWEEN 8 AND 17 ORDER BY rowid DESC } {17 16 15 14 13 12 11 10 9 8} do_execsql_test 17.5 { SELECT count(*) FROM uio } {256} do_execsql_test 17.6 { INSERT INTO uio(rowid) VALUES(9223372036854775807); INSERT INTO uio(rowid) VALUES(-9223372036854775808); SELECT count(*) FROM uio; } {258} do_execsql_test 17.7 { SELECT min(rowid), max(rowid) FROM uio; } {-9223372036854775808 9223372036854775807} do_execsql_test 17.8 { INSERT INTO uio DEFAULT VALUES; SELECT min(rowid), max(rowid), count(*) FROM uio; } {-9223372036854775808 9223372036854775807 259} do_execsql_test 17.9 { SELECT min(rowid), max(rowid), count(*) FROM uio WHERE rowid < 10; } {-9223372036854775808 9 10} #-------------------------------------------------------------------- # do_execsql_test 18.1 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, detail=%DETAIL%); CREATE VIRTUAL TABLE t2 USING fts5(c, d, detail=%DETAIL%); INSERT INTO t1 VALUES('abc*', NULL); INSERT INTO t2 VALUES(1, 'abcdefg'); } do_execsql_test 18.2 { SELECT t1.rowid, t2.rowid FROM t1, t2 WHERE t2 MATCH t1.a AND t1.rowid = t2.c } {1 1} do_execsql_test 18.3 { SELECT t1.rowid, t2.rowid FROM t2, t1 WHERE t2 MATCH t1.a AND t1.rowid = t2.c } {1 1} #-------------------------------------------------------------------- # fts5 table in the temp schema. # reset_db do_execsql_test 19.0 { CREATE VIRTUAL TABLE temp.t1 USING fts5(x, detail=%DETAIL%); INSERT INTO t1 VALUES('x y z'); INSERT INTO t1 VALUES('w x 1'); SELECT rowid FROM t1 WHERE t1 MATCH 'x'; } {1 2} #-------------------------------------------------------------------- # Test that 6 and 7 byte varints can be read. # reset_db do_execsql_test 20.0 { CREATE VIRTUAL TABLE temp.tmp USING fts5(x, detail=%DETAIL%); } set ::ids [list \ 0 [expr 1<<36] [expr 2<<36] [expr 1<<43] [expr 2<<43] ] do_test 20.1 { foreach id $::ids { execsql { INSERT INTO tmp(rowid, x) VALUES($id, 'x y z') } } execsql { SELECT rowid FROM tmp WHERE tmp MATCH 'y' } } $::ids #-------------------------------------------------------------------- # Test that a DROP TABLE may be executed within a transaction that # writes to an FTS5 table. # do_execsql_test 21.0 { CREATE TEMP TABLE t8(a, b); CREATE VIRTUAL TABLE ft USING fts5(x, detail=%DETAIL%); } do_execsql_test 21.1 { BEGIN; INSERT INTO ft VALUES('a b c'); DROP TABLE t8; COMMIT; } do_execsql_test 22.0 { CREATE VIRTUAL TABLE t9 USING fts5(x, detail=%DETAIL%); INSERT INTO t9(rowid, x) VALUES(2, 'bbb'); BEGIN; INSERT INTO t9(rowid, x) VALUES(1, 'aaa'); DELETE FROM t9 WHERE rowid = 2; INSERT INTO t9(rowid, x) VALUES(3, 'bbb'); COMMIT; } do_execsql_test 22.1 { SELECT rowid FROM t9('a*') } {1} } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5ab.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5ab # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, detail=%DETAIL%); INSERT INTO t1 VALUES('hello', 'world'); INSERT INTO t1 VALUES('one two', 'three four'); INSERT INTO t1(rowid, a, b) VALUES(45, 'forty', 'five'); } do_execsql_test 1.1 { SELECT * FROM t1 ORDER BY rowid DESC; } { forty five {one two} {three four} hello world } do_execsql_test 1.2 { SELECT rowid FROM t1 ORDER BY rowid DESC; } {45 2 1} do_execsql_test 1.3 { SELECT rowid FROM t1 ORDER BY rowid ASC; } {1 2 45} do_execsql_test 1.4 { SELECT * FROM t1 WHERE rowid=2; } {{one two} {three four}} do_execsql_test 1.5 { SELECT * FROM t1 WHERE rowid=2.01; } {} do_execsql_test 1.6 { SELECT * FROM t1 WHERE rowid=1.99; } {} #------------------------------------------------------------------------- reset_db do_execsql_test 2.1 { CREATE VIRTUAL TABLE t1 USING fts5(x, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); INSERT INTO t1 VALUES('one'); INSERT INTO t1 VALUES('two'); INSERT INTO t1 VALUES('three'); } do_catchsql_test 2.2 { SELECT rowid, * FROM t1 WHERE t1 MATCH 'AND AND' } {1 {fts5: syntax error near "AND"}} do_execsql_test 2.3 { SELECT rowid, * FROM t1 WHERE t1 MATCH 'two' } {2 two} do_execsql_test 2.4 { SELECT rowid, * FROM t1 WHERE t1 MATCH 'three' } {3 three} do_execsql_test 2.5 { SELECT rowid, * FROM t1 WHERE t1 MATCH 'one' } {1 one} do_execsql_test 2.6 { INSERT INTO t1 VALUES('a b c d e f g'); INSERT INTO t1 VALUES('b d e a a a i'); INSERT INTO t1 VALUES('x y z b c c c'); } foreach {tn expr res} { 1 a {5 4} 2 b {6 5 4} 3 c {6 4} 4 d {5 4} 5 e {5 4} 6 f {4} 7 g {4} 8 x {6} 9 y {6} 10 z {6} } { do_execsql_test 2.7.$tn.1 { SELECT rowid FROM t1 WHERE t1 MATCH $expr ORDER BY rowid DESC } $res do_execsql_test 2.7.$tn.2 { SELECT rowid FROM t1 WHERE t1 MATCH $expr ORDER BY rowid ASC } [lsort -integer $res] } #------------------------------------------------------------------------- # reset_db do_execsql_test 3.0 { CREATE VIRTUAL TABLE t1 USING fts5(a,b); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } foreach {tn a b} { 1 {abashed abandons abase abash abaft} {abases abased} 2 {abasing abases abaft abated abandons} {abases abandoned} 3 {abatement abash abash abated abase} {abasements abashing} 4 {abaft abasements abase abasement abasing} {abasement abases} 5 {abaft abashing abatement abash abasements} {abandons abandoning} 6 {aback abate abasements abashes abandoned} {abasement abased} 7 {abandons abated abased aback abandoning} {abases abandoned} 8 {abashing abases abasement abaft abashing} {abashed abate} 9 {abash abase abate abashing abashed} {abandon abandoned} 10 {abate abandoning abandons abasement aback} {abandon abandoning} } { do_execsql_test 3.1.$tn.1 { INSERT INTO t1 VALUES($a, $b) } do_execsql_test 3.1.$tn.2 { INSERT INTO t1(t1) VALUES('integrity-check') } } foreach {tn expr res} { 1 {abash} {9 5 3 1} 2 {abase} {9 4 3 1} 3 {abase + abash} {1} 4 {abash + abase} {9} 5 {abaft + abashing} {8 5} 6 {abandon + abandoning} {10} 7 {"abashing abases abasement abaft abashing"} {8} } { do_execsql_test 3.2.$tn { SELECT rowid FROM t1 WHERE t1 MATCH $expr ORDER BY rowid DESC } $res } do_execsql_test 3.3 { SELECT rowid FROM t1 WHERE t1 MATCH 'NEAR(aback abate, 2)' } {6} foreach {tn expr res} { 1 {abash} {1 3 5 9} 2 {abase} {1 3 4 9} 3 {abase + abash} {1} 4 {abash + abase} {9} 5 {abaft + abashing} {5 8} 6 {abandon + abandoning} {10} 7 {"abashing abases abasement abaft abashing"} {8} } { do_execsql_test 3.4.$tn { SELECT rowid FROM t1 WHERE t1 MATCH $expr } $res } #------------------------------------------------------------------------- # Documents with more than 2M tokens. # do_execsql_test 4.0 { CREATE VIRTUAL TABLE s1 USING fts5(x, detail=%DETAIL%); } foreach {tn doc} [list \ 1 [string repeat {a x } 1500000] \ 2 "[string repeat {a a } 1500000] x" \ ] { do_execsql_test 4.$tn { INSERT INTO s1 VALUES($doc) } } do_execsql_test 4.3 { SELECT rowid FROM s1 WHERE s1 MATCH 'x' } {1 2} if {[detail_is_full]} { do_execsql_test 4.4 { SELECT rowid FROM s1 WHERE s1 MATCH '"a x"' } {1 2} } do_execsql_test 4.5 { SELECT rowid FROM s1 WHERE s1 MATCH 'a x' } {1 2} #------------------------------------------------------------------------- # Check that a special case of segment promotion works. The case is where # a new segment is written to level L, but the oldest segment within level # (L-2) is larger than it. # do_execsql_test 5.0 { CREATE VIRTUAL TABLE s2 USING fts5(x, detail=%DETAIL%); INSERT INTO s2(s2, rank) VALUES('pgsz', 32); INSERT INTO s2(s2, rank) VALUES('automerge', 0); } proc rnddoc {n} { set map [list 0 a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j] set doc [list] for {set i 0} {$i < $n} {incr i} { lappend doc [string map $map [format %.3d [expr int(rand()*1000)]]] } set doc } db func rnddoc rnddoc do_test 5.1 { for {set i 1} {$i <= 65} {incr i} { execsql { INSERT INTO s2 VALUES(rnddoc(10)) } } for {set i 1} {$i <= 63} {incr i} { execsql { DELETE FROM s2 WHERE rowid = $i } } fts5_level_segs s2 } {0 8} do_test 5.2 { execsql { INSERT INTO s2(s2, rank) VALUES('automerge', 8); } for {set i 0} {$i < 7} {incr i} { execsql { INSERT INTO s2 VALUES(rnddoc(50)) } } fts5_level_segs s2 } {8 0 0} # Test also the other type of segment promotion - when a new segment is written # that is larger than segments immediately following it. do_test 5.3 { execsql { DROP TABLE s2; CREATE VIRTUAL TABLE s2 USING fts5(x, detail=%DETAIL%); INSERT INTO s2(s2, rank) VALUES('pgsz', 32); INSERT INTO s2(s2, rank) VALUES('automerge', 0); } for {set i 1} {$i <= 16} {incr i} { execsql { INSERT INTO s2 VALUES(rnddoc(5)) } } fts5_level_segs s2 } {0 1} do_test 5.4 { execsql { INSERT INTO s2 VALUES(rnddoc(160)) } fts5_level_segs s2 } {2 0} #------------------------------------------------------------------------- # do_execsql_test 6.0 { CREATE VIRTUAL TABLE s3 USING fts5(x, detail=%DETAIL%); BEGIN; INSERT INTO s3 VALUES('a b c'); INSERT INTO s3 VALUES('A B C'); } do_execsql_test 6.1.1 { SELECT rowid FROM s3 WHERE s3 MATCH 'a' } {1 2} do_execsql_test 6.1.2 { SELECT rowid FROM s3 WHERE s3 MATCH 'a' ORDER BY rowid DESC } {2 1} do_execsql_test 6.2 { COMMIT; } do_execsql_test 6.3 { SELECT rowid FROM s3 WHERE s3 MATCH 'a' } {1 2} do_test 6.4 { db close sqlite3 db test.db execsql { BEGIN; INSERT INTO s3(s3) VALUES('optimize'); ROLLBACK; } } {} #------------------------------------------------------------------------- # set doc [string repeat "a b c " 500] do_execsql_test 7.0 { CREATE VIRTUAL TABLE x1 USING fts5(x, detail=%DETAIL%); INSERT INTO x1(x1, rank) VALUES('pgsz', 32); INSERT INTO x1 VALUES($doc); } } ;# foreach_detail_mode... finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5ac.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5ac # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { set data { 0 {p o q e z k z p n f y u z y n y} {l o o l v v k} 1 {p k h h p y l l h i p v n} {p p l u r i f a j g e r r x w} 2 {l s z j k i m p s} {l w e j t j e e i t w r o p o} 3 {x g y m y m h p} {k j j b r e y y a k y} 4 {q m a i y i z} {o w a g k x g j m w e u k} 5 {k o a w y b s z} {s g l m m l m g p} 6 {d a q i z h b l c p k j g k} {p x u j x t v c z} 7 {f d a g o c t i} {w f c x l d r k i j} 8 {y g w u b q p o m j y b p a e k} {r i d k y w o z q m a t p} 9 {r k o m c c j s x m x m x m q r} {y r c a q d z k n x n} 10 {k j q m g q a j d} {d d e z g w h c d o o g x d} 11 {j z u m o y q j f w e e w t r j w} {g m o r x n t n w i f g l z f} 12 {s y w a w d o h x m k} {c w k z b p o r a} 13 {u t h x e g s k n g i} {f j w g c s r} 14 {b f i c s u z t k} {c k q s j u i z o} 15 {n a f n u s w h y n s i q e w} {x g e g a s s h n} 16 {k s q e j n p} {t r j f t o e k k l m i} 17 {g d t u w r o p m n m n p h b o u} {h s w o s l j e} 18 {f l q y q q g e e x j r} {n b r r g e i r t x q k} 19 {f i r g o a w e p i l o a w} {e k r z t d g h g i b d i e m} 20 {l d u u f p y} {g o m m u x m g l j t t x x u} 21 {m c d k x i c z l} {m i a i e u h} 22 {w b f o c g x y j} {z d w x d f h i p} 23 {w u i u x t c h k i b} {b y k h b v r t g j} 24 {h f d j s w s b a p k} {a q y u z e y m m j q r} 25 {d i x y x x k i y f s d j h z p n} {l l q m e t c w g y h t s v g} 26 {g s q w t d k x g f m j p k y} {r m b x e l t d} 27 {j l s q u g y v e c l o} {m f l m m m h g x x l n c} 28 {c t j g v r s b z j} {l c f y d t q n} 29 {e x z y w i h l} {b n b x e y q e n u m} 30 {g y y h j b w r} {q b q f u s k c k g r} 31 {g u l x l b r c m z b u c} {k g t b x k x n t e z d h o} 32 {w g v l z f b z h p s c v h} {g e w v m h k r g w a r f q} 33 {c g n f u d o y o b} {e y o h x x y y i z s b h a j} 34 {v y h c q u u s q y x x k s q} {d n r m y k n t i r n w e} 35 {o u c x l e b t a} {y b a x y f z x r} 36 {x p h l j a a u u j h} {x o f s z m b c q p} 37 {k q t i c a q n m v v} {v r z e f m y o} 38 {r w t t t t r v v o e p g h} {l w x a g a u h y} 39 {o p v g v b a g o} {j t q c r b b g y z} 40 {f s o r o d t h q f x l} {r d b m k i f s t d l m y x j w} 41 {t m o t m f m f} {i p i q j v n v m b q} 42 {t x w a r l w d t b c o d o} {a h f h w z d n s} 43 {t u q c d g p q x j o l c x c} {m n t o z z j a y} 44 {v d i i k b f s z r v r z y} {g n q y s x x m b x c l w} 45 {p v v a c s z y e o l} {m v t u d k m k q b d c v z r} 46 {f y k l d r q w r s t r e} {h m v r r l r r t f q e x y} 47 {w l n l t y x} {n h s l a f c h u f l x x m v n o} 48 {t n v i k e b p z p d j j l i o} {i v z p g u e j s i k n h w d c} 49 {z v x p n l t a j c} {e j l e n c e t a d} 50 {w u b x u i v h a i y m m r p m s} {s r h d o g z y f f x e} 51 {d c c x b c a x g} {p r a j v u y} 52 {f w g r c o d l t u e z h i} {j l l s s b j m} 53 {p m t f k i x} {u v y a z g w v v m x h i} 54 {l c z g l o j i c d e b} {b f v y w u i b e i y} 55 {r h c x f x a d s} {z x y k f l r b q c v} 56 {v x x c y h z x b g m o q n c} {h n b i t g h a q b c o r u} 57 {d g l o h t b s b r} {n u e p t i m u} 58 {t d y e t d c w u o s w x f c h} {i o s v y b r d r} 59 {l b a p q n d r} {k d c c d n y q h g a o p e x} 60 {f r z v m p k r} {x x r i s b a g f c} 61 {s a z i e r f i w c n y v z t k s} {y y i r y n l s b w i e k n} 62 {n x p r e x q r m v i b y} {f o o z n b s r q j} 63 {y j s u j x o n r q t f} {f v k n v x u s o a d e f e} 64 {u s i l y c x q} {r k c h p c h b o s s u s p b} 65 {m p i o s h o} {s w h u n d m n q t y k b w c} 66 {l d f g m x x x o} {s w d d f b y j j h h t i y p j o} 67 {c b m h f n v w n h} {i r w i e x r w l z p x u g u l s} 68 {y a h u h i m a y q} {d d r x h e v q n z y c j} 69 {c x f d x o n p o b r t b l p l} {m i t k b x v f p t m l l y r o} 70 {u t l w w m s} {m f m o l t k o p e} 71 {f g q e l n d m z x q} {z s i i i m f w w f n g p e q} 72 {n l h a v u o d f j d e x} {v v s l f g d g r a j x i f z x} 73 {x v m v f i g q e w} {r y s j i k m j j e d g r n o i f} 74 {g d y n o h p s y q z j d w n h w} {x o d l t j i b r d o r y} 75 {p g b i u r b e q d v o a g w m k} {q y z s f q o h} 76 {u z a q u f i f f b} {b s p b a a d x r r i q f} 77 {w h h z t h p o a h h e e} {h w r p h k z v y f r x} 78 {c a r k i a p u x} {f w l p t e m l} 79 {q q u k o t r k z} {f b m c w p s s o z} 80 {t i g v y q s r x m r x z e f} {x o j w a u e y s j c b u p p r o} 81 {n j n h r l a r e o z w e} {v o r r j a v b} 82 {i f i d k w d n h} {o i d z i z l m w s b q v u} 83 {m d g q q b k b w f q q p p} {j m q f b y c i z k y q p l e a} 84 {m x o n y f g} {y c n x n q j i y c l h b r q z} 85 {v o z l n p c} {g n j n t b b x n c l d a g j v} 86 {z n a y f b t k k t d b z a v} {r p c n r u k u} 87 {b q t x z e c w} {q a o a l o a h i m j r} 88 {j f h o x x a z g b a f a m i b} {j z c z y x e x w t} 89 {t c t p r s u c q n} {z x l i k n f q l n t} 90 {w t d q j g m r f k n} {l e w f w w a l y q k i q t p c t} 91 {c b o k l i c b s j n m b l} {y f p q o w g} 92 {f y d j o q t c c q m f j s t} {f h e d y m o k} 93 {k x j r m a d o i z j} {r t t t f e b r x i v j v g o} 94 {s f e a e t i h h d q p z t q} {b k m k w h c} 95 {h b n j t k i h o q u} {w n g i t o k c a m y p f l x c p} 96 {f c x p y r b m o l m o a} {p c a q s u n n x d c f a o} 97 {u h h k m n k} {u b v n u a o c} 98 {s p e t c z d f n w f} {l s f j b l c e s h} 99 {r c v w i v h a t a c v c r e} {h h u m g o f b a e o} } foreach {tn2 sql} { 1 {} 2 {BEGIN} } { reset_db fts5_aux_test_functions db do_execsql_test 1.$tn2.0 { CREATE VIRTUAL TABLE xx USING fts5(x,y, detail=%DETAIL%); INSERT INTO xx(xx, rank) VALUES('pgsz', 32); } execsql $sql do_test 1.$tn2.1.1 { foreach {id x y} $data { execsql { INSERT INTO xx(rowid, x, y) VALUES($id, $x, $y) } } execsql { INSERT INTO xx(xx) VALUES('integrity-check') } } {} #------------------------------------------------------------------------- # do_execsql_test 1.$tn2.integrity { INSERT INTO xx(xx) VALUES('integrity-check'); } #------------------------------------------------------------------------- # foreach {tn expr} { 1.1 "a AND b" 1.2 "a OR b" 1.3 "o" 1.4 "b q" 1.5 "e a e" 1.6 "m d g q q b k b w f q q p p" 1.7 "l o o l v v k" 1.8 "a" 1.9 "b" 1.10 "c" 1.11 "no" 1.12 "L O O L V V K" 1.13 "a AND b AND c" 1.14 "x:a" 2.1 "x:a" 2.2 "y:a" 2.3 "x:b" 2.4 "y:b" 3.1 "{x}:a" 3.2 "{y}:a" 3.3 "{x}:b" 3.4 "{y}:b" 4.1 "{x y}:a" 4.2 "{y x}:a" 4.3 "{x x}:b" 4.4 "{y y}:b" 5.1 {{"x" "y"}:a} 5.2 {{"y" x}:a} 5.3 {{x "x"}:b} 5.4 {{"y" y}:b} 6.1 "b + q" 6.2 "e + a + e" 6.3 "m + d + g + q + q + b + k + b + w + f + q + q + p + p" 6.4 "l + o + o + l + v + v + k" 6.5 "L + O + O + L + V + V + K" 7.1 "a+b AND c" 7.2 "d+c AND u" 7.3 "d+c AND u+d" 7.4 "a+b OR c" 7.5 "d+c OR u" 7.6 "d+c OR u+d" 8.1 "NEAR(a b)" 8.2 "NEAR(r c)" 8.2 { NEAR(r c, 5) } 8.3 { NEAR(r c, 3) } 8.4 { NEAR(r c, 2) } 8.5 { NEAR(r c, 0) } 8.6 { NEAR(a b c) } 8.7 { NEAR(a b c, 8) } 8.8 { x : NEAR(r c) } 8.9 { y : NEAR(r c) } 9.1 { NEAR(r c) } 9.2 { NEAR(r c, 5) } 9.3 { NEAR(r c, 3) } 9.4 { NEAR(r c, 2) } 9.5 { NEAR(r c, 0) } 9.6 { NEAR(a b c) } 9.7 { NEAR(a b c, 8) } 9.8 { x : NEAR(r c) } 9.9 { y : NEAR(r c) } 9.10 { x : "r c" } 9.11 { y : "r c" } 9.12 { a AND b } 9.13 { a AND b AND c } 9.14a { a } 9.14b { a OR b } 9.15 { a OR b AND c } 9.16 { c AND b OR a } 9.17 { c AND (b OR a) } 9.18 { c NOT (b OR a) } 9.19 { (c NOT b) OR (a AND d) } } { if {[fts5_expr_ok $expr xx]==0} { do_test 1.$tn2.$tn.OMITTED { list } [list] continue } set res [fts5_query_data $expr xx] do_execsql_test 1.$tn2.$tn.[llength $res].asc { SELECT rowid, fts5_test_poslist(xx), fts5_test_collist(xx) FROM xx WHERE xx match $expr } $res set res [fts5_query_data $expr xx DESC] do_execsql_test 1.$tn2.$tn.[llength $res].desc { SELECT rowid, fts5_test_poslist(xx), fts5_test_collist(xx) FROM xx WHERE xx match $expr ORDER BY 1 DESC } $res } } } do_execsql_test 2.1 { SELECT fts5_expr_tcl('a AND b'); } {{AND [nearset -- {a}] [nearset -- {b}]}} do_test 2.2.1 { nearset {{a b c}} -- a } {0.0.0} do_test 2.2.2 { nearset {{a b c}} -- c } {0.0.2} foreach {tn expr tclexpr} { 1 {a b} {AND [N $x -- {a}] [N $x -- {b}]} } { do_execsql_test 2.3.$tn { SELECT fts5_expr_tcl($expr, 'N $x') } [list $tclexpr] } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5ad.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # # More specifically, the focus is on testing prefix queries, both with and # without prefix indexes. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5ad # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { do_execsql_test 1.0 { CREATE VIRTUAL TABLE yy USING fts5(x, y, detail=%DETAIL%); INSERT INTO yy VALUES('Changes the result to be', 'the list of all matching'); INSERT INTO yy VALUES('indices (or all matching', 'values if -inline is'); INSERT INTO yy VALUES('specified as well.) If', 'indices are returned, the'); } {} foreach {tn match res} { 1 {c*} {1} 2 {i*} {3 2} 3 {t*} {3 1} 4 {r*} {3 1} } { do_execsql_test 1.$tn { SELECT rowid FROM yy WHERE yy MATCH $match ORDER BY rowid DESC } $res } foreach {tn match res} { 5 {c*} {1} 6 {i*} {2 3} 7 {t*} {1 3} 8 {r*} {1 3} } { do_execsql_test 1.$tn { SELECT rowid FROM yy WHERE yy MATCH $match } $res } foreach {T create} { 2 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } 3 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, prefix="1,2,3,4", detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } 4 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); BEGIN; } 5 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, prefix="1,2,3,4", detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); BEGIN; } } { do_test $T.1 { execsql { DROP TABLE IF EXISTS t1 } execsql $create } {} do_test $T.1 { foreach {rowid a b} { 0 {fghij uvwxyz klmn pq uvwx} {klmn f fgh uv fghij klmno} 1 {uv f abcd abcd fghi} {pq klm uv uv fgh uv a} 2 {klmn klm pqrs fghij uv} {f k uvw ab abcd pqr uv} 3 {ab pqrst a fghi ab pqr fg} {k klmno a fg abcd} 4 {abcd pqrst uvwx a fgh} {f klmno fghij kl pqrst} 5 {uvwxyz k abcde u a} {uv k k kl klmn} 6 {uvwxyz k klmn pqrst uv} {fghi pqrs abcde u k} 7 {uvwxy klmn u p pqrst fgh} {p f fghi abcd uvw kl uv} 8 {f klmno pqrst uvwxy pqrst} {uv abcde klm pq pqr} 9 {f abcde a uvwxyz pqrst} {fghij abc k uvwx pqr fghij uvwxy} 10 {ab uv f fg pqrst uvwxy} {fgh p uv k abc klm uvw} 11 {pq klmno a uvw abcde uvwxyz} {fghij pq uvwxyz pqr fghi} 12 {fgh u pq fgh uvw} {uvw pqr f uvwxy uvwx} 13 {uvwx klmn f fgh abcd pqr} {uvw k fg uv klm abcd} 14 {ab uvwx pqrst pqr uvwxyz pqrs} {uvwxyz abcde ab ab uvw abcde} 15 {abc abcde uvwxyz abc kl k pqr} {klm k k klmno u fgh} 16 {fghi abcd fghij uv uvwxyz ab uv} {klmn pqr a uvw fghi} 17 {abc pqrst fghi uvwx uvw klmn fghi} {ab fg pqr pqrs p} 18 {pqr kl a fghij fgh fg kl} {pqr uvwxyz uvw abcd uvwxyz} 19 {fghi fghi pqr kl fghi f} {klmn u u klmno klmno} 20 {abc pqrst klmno kl pq uvwxy} {abc k fghi pqrs klm} 21 {a pqr uvwxyz uv fghi a fgh} {abc pqrs pqrst pq klm} 22 {klm abc uvwxyz klm pqrst} {fghij k pq pqr u klm fghij} 23 {p klm uv p a a} {uvwxy klmn uvw abcde pq} 24 {uv fgh fg pq uvwxy u uvwxy} {pqrs a uvw p uvwx uvwxyz fg} 25 {fghij fghi klmn abcd pq kl} {fghi abcde pqrs abcd fgh uvwxy} 26 {pq fgh a abc klmno klmn} {fgh p k p fg fghij} 27 {fg pq kl uvwx fghij pqrst klmn} {abcd uvw abcd fghij f fghij} 28 {uvw fghi p fghij pq fgh uvwx} {k fghij abcd uvwx pqr fghi} 29 {klm pq abcd pq f uvwxy} {pqrst p fghij pqr p} 30 {ab uvwx fg uvwx klmn klm} {klmn klmno fghij klmn klm} 31 {pq k pqr abcd a pqrs} {abcd abcd uvw a abcd klmno ab} 32 {pqrst u abc pq klm} {abc kl uvwxyz fghij u fghi p} 33 {f uvwxy u k f uvw uvwx} {pqrs uvw fghi fg pqrst klm} 34 {pqrs pq fghij uvwxyz pqr} {ab abc abc uvw f pq f} 35 {uvwxy ab uvwxy klmno kl pqrs} {abcde uvw pqrs uvwx k k} 36 {uvwxyz k ab abcde abc uvw} {uvw abcde uvw klmn uv klmn} 37 {k kl uv abcde uvwx fg u} {u abc uvwxy k fg abcd} 38 {fghi pqrst fghi pqr pqrst uvwx} {u uv uvwx fghi abcde} 39 {k pqrst k uvw fg pqrst fghij} {uvwxy ab kl klmn uvwxyz abcde} 40 {fg uvwxy pqrs klmn uvwxyz klm p} {k uv ab fghij fgh k pqrs} 41 {uvwx abc f pq uvwxy k} {ab uvwxyz abc f fghij} 42 {uvwxy klmno uvwxyz uvwxyz pqrst} {uv kl kl klmno k f abcde} 43 {abcde ab pqrs fg f fgh} {abc fghij fghi k k} 44 {uvw abcd a ab pqrst klmn fg} {pqrst u uvwx pqrst fghij f pqrst} 45 {uvwxy p kl uvwxyz ab pqrst fghi} {abc f pqr fg a k} 46 {u p f a fgh} {a kl pq uv f} 47 {pqrs abc fghij fg abcde ab a} {p ab uv pqrs kl fghi abcd} 48 {abcde uvwxy pqrst uv abc pqr uvwx} {uvwxy klm uvwxy uvwx k} 49 {fgh klm abcde klmno u} {a f fghij f uvwxyz abc u} 50 {uv uvw uvwxyz uvwxyz uv ab} {uvwx pq fg u k uvwxy} 51 {uvwxy pq p kl fghi} {pqrs fghi pqrs abcde uvwxyz ab} 52 {pqr p uvwxy kl pqrs klmno fghij} {ab abcde abc pqrst pqrs uv} 53 {fgh pqrst p a klmno} {ab ab pqrst pqr kl pqrst} 54 {abcd klm ab uvw a fg u} {f pqr f abcd uv} 55 {u fg uvwxyz k uvw} {abc pqrs f fghij fg pqrs uvwxy} 56 {klm fg p fghi fg a} {uv a fghi uvwxyz a fghi} 57 {uvwxy k abcde fgh f fghi} {f kl klmn f fghi klm} 58 {klm k fgh uvw fgh fghi} {klmno uvwx u pqrst u} 59 {fghi pqr pqrst p uvw fghij} {uv pqrst pqrs pq fghij klm} 60 {uvwx klm uvwxy uv klmn} {p a a abc klmn ab k} 61 {uvwxy uvwx klm uvwx klm} {pqrs ab ab uvwxyz fg} 62 {kl uv uv uvw fg kl k} {abcde uvw fgh uvwxy klm} 63 {a abc fgh u klm abcd} {fgh pqr uv klmn fghij} 64 {klmn k klmn klmno pqrs pqr} {fg kl abcde klmno uvwxy kl pq} 65 {uvwxyz klm fghi abc abcde kl} {uvwxy uvw uvwxyz uvwxyz pq pqrst} 66 {pq klm abc pqrst fgh f} {u abcde pqrst abcde fg} 67 {u pqrst kl u uvw klmno} {u pqr pqrs fgh u p} 68 {abc fghi uvwxy fgh k pq} {uv p uvwx uvwxyz ab} 69 {klmno f uvwxyz uvwxy klmn fg ab} {fgh kl a pqr abcd pqr} 70 {fghi pqrst pqrst uv a} {uvwxy k p uvw uvwx a} 71 {a fghij f p uvw} {klm fg abcd abcde klmno pqrs} 72 {uv uvwx uvwx uvw klm} {uv fghi klmno uvwxy uvw} 73 {kl uvwxy ab f pq klm u} {uvwxy klmn klm abcd pq fg k} 74 {uvw pqrst abcd uvwxyz ab} {fgh fgh klmn abc pq} 75 {uvwxyz klm pq abcd klmno pqr uvwxyz} {kl f a fg pqr klmn} 76 {uvw uvwxy pqr k pqrst kl} {uvwxy abc uvw uvw u} 77 {fgh klm u uvwxyz f uvwxy abcde} {uv abcde klmno u u ab} 78 {klmno abc pq pqr fgh} {p uv abcd fgh abc u k} 79 {fg pqr uvw pq uvwx} {uv uvw fghij pqrs fg p} 80 {abcd pqrs uvwx uvwxy uvwx} {u uvw pqrst pqr abcde pqrs kl} 81 {uvwxyz klm pq uvwxy fghij} {p pq klm fghij u a a} 82 {uvwx k uvwxyz klmno pqrst kl} {abcde p f pqrst abcd uvwxyz p} 83 {abcd abcde klm pqrst uvwxyz} {uvw pqrst u p uvwxyz a pqrs} 84 {k klm abc uv uvwxy klm klmn} {k abc pqr a abc p kl} 85 {klmn abcd pqrs p pq klm a} {klmn kl ab uvw pq} 86 {klmn a pqrs abc uvw pqrst} {a pqr kl klm a k f} 87 {pqrs ab uvwx uvwxy a pqr f} {fg klm uvwx pqr pqr} 88 {klmno ab k kl u uvwxyz} {uv kl uvw fghi uv uvw} 89 {pq fghi pqrst klmn uvwxy abc pqrs} {fg f f fg abc abcde klm} 90 {kl a k fghi uvwx fghi u} {ab uvw pqr fg a p abc} 91 {uvwx pqrs klmno ab fgh uvwx} {pqr uvwx abc kl f klmno kl} 92 {fghij pq pqrs fghij f pqrst} {u abcde fg pq pqr fgh k} 93 {fgh u pqrs abcde klmno abc} {abc fg pqrst pqr abcde} 94 {uvwx p abc f pqr p} {k pqrs kl klm abc fghi klm} 95 {kl p klmno uvwxyz klmn} {fghi ab a fghi pqrs kl} 96 {pqr fgh pq uvwx a} {uvw klm klmno fg uvwxy uvwx} 97 {fg abc uvwxyz fghi pqrst pq} {abc k a ab abcde f} 98 {uvwxy fghi uvwxy u abcde abcde uvw} {klmn uvwx pqrs uvw uvwxy abcde} 99 {pq fg fghi uvwx uvwx fghij uvwxy} {klmn klmn f abc fg a} } { execsql { INSERT INTO t1(rowid, a, b) VALUES($rowid, $a, $b); } } } {} proc prefix_query {prefixlist} { set ret [list] db eval {SELECT rowid, a, b FROM t1 ORDER BY rowid DESC} { set bMatch 1 foreach pref $prefixlist { if { [lsearch -glob $a $pref]<0 && [lsearch -glob $b $pref]<0 } { set bMatch 0 break } } if {$bMatch} { lappend ret $rowid } } return $ret } do_execsql_test $T.integrity { INSERT INTO t1(t1) VALUES('integrity-check'); } foreach {bAsc sql} { 1 {SELECT rowid FROM t1 WHERE t1 MATCH $prefix} 0 {SELECT rowid FROM t1 WHERE t1 MATCH $prefix ORDER BY rowid DESC} } { foreach {tn prefix} { 1 {a*} 2 {ab*} 3 {abc*} 4 {abcd*} 5 {abcde*} 6 {f*} 7 {fg*} 8 {fgh*} 9 {fghi*} 10 {fghij*} 11 {k*} 12 {kl*} 13 {klm*} 14 {klmn*} 15 {klmno*} 16 {p*} 17 {pq*} 18 {pqr*} 19 {pqrs*} 20 {pqrst*} 21 {u*} 22 {uv*} 23 {uvw*} 24 {uvwx*} 25 {uvwxy*} 26 {uvwxyz*} 27 {x*} 28 {a f*} 29 {a* f*} 30 {a* fghij*} } { set res [prefix_query $prefix] if {$bAsc} { set res [lsort -integer -increasing $res] } set n [llength $res] do_execsql_test $T.$bAsc.$tn.$n $sql $res } } catchsql COMMIT } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5ae.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5ae # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } do_execsql_test 1.1 { INSERT INTO t1 VALUES('hello', 'world'); SELECT rowid FROM t1 WHERE t1 MATCH 'hello' ORDER BY rowid ASC; } {1} do_execsql_test 1.2 { INSERT INTO t1 VALUES('world', 'hello'); SELECT rowid FROM t1 WHERE t1 MATCH 'hello' ORDER BY rowid ASC; } {1 2} do_execsql_test 1.3 { INSERT INTO t1 VALUES('world', 'world'); SELECT rowid FROM t1 WHERE t1 MATCH 'hello' ORDER BY rowid ASC; } {1 2} do_execsql_test 1.4.1 { INSERT INTO t1 VALUES('hello', 'hello'); } do_execsql_test 1.4.2 { SELECT rowid FROM t1 WHERE t1 MATCH 'hello' ORDER BY rowid ASC; } {1 2 4} fts5_aux_test_functions db #------------------------------------------------------------------------- # do_execsql_test 2.0 { CREATE VIRTUAL TABLE t2 USING fts5(x, y, detail=%DETAIL%); INSERT INTO t2 VALUES('u t l w w m s', 'm f m o l t k o p e'); INSERT INTO t2 VALUES('f g q e l n d m z x q', 'z s i i i m f w w f n g p'); } do_execsql_test 2.1 { SELECT rowid, fts5_test_poslist(t2) FROM t2 WHERE t2 MATCH 'm' ORDER BY rowid; } { 1 {0.0.5 0.1.0 0.1.2} 2 {0.0.7 0.1.5} } do_execsql_test 2.2 { SELECT rowid, fts5_test_poslist(t2) FROM t2 WHERE t2 MATCH 'u OR q' ORDER BY rowid; } { 1 {0.0.0} 2 {1.0.2 1.0.10} } if {[detail_is_full]} { do_execsql_test 2.3 { SELECT rowid, fts5_test_poslist(t2) FROM t2 WHERE t2 MATCH 'y:o' ORDER BY rowid; } { 1 {0.1.3 0.1.7} } } #------------------------------------------------------------------------- # do_execsql_test 3.0 { CREATE VIRTUAL TABLE t3 USING fts5(x, y, detail=%DETAIL%); INSERT INTO t3 VALUES( 'j f h o x x a z g b a f a m i b', 'j z c z y x w t'); INSERT INTO t3 VALUES( 'r c', ''); } if {[detail_is_full]} { do_execsql_test 3.1 { SELECT rowid, fts5_test_poslist(t3) FROM t3 WHERE t3 MATCH 'NEAR(a b)'; } { 1 {0.0.6 1.0.9 0.0.10 0.0.12 1.0.15} } do_execsql_test 3.2 { SELECT rowid, fts5_test_poslist(t3) FROM t3 WHERE t3 MATCH 'NEAR(r c)'; } { 2 {0.0.0 1.0.1} } } do_execsql_test 3.3 { INSERT INTO t3 VALUES('k x j r m a d o i z j', 'r t t t f e b r x i v j v g o'); SELECT rowid, fts5_test_poslist(t3) FROM t3 WHERE t3 MATCH 'a OR b AND c'; } { 1 {0.0.6 1.0.9 0.0.10 0.0.12 1.0.15 2.1.2} 3 0.0.5 } #------------------------------------------------------------------------- # do_execsql_test 4.0 { CREATE VIRTUAL TABLE t4 USING fts5(x, y, detail=%DETAIL%); INSERT INTO t4 VALUES('k x j r m a d o i z j', 'r t t t f e b r x i v j v g o'); } do_execsql_test 4.1 { SELECT rowid, fts5_test_poslist(t4) FROM t4 WHERE t4 MATCH 'a OR b AND c'; } { 1 0.0.5 } #------------------------------------------------------------------------- # Test that the xColumnSize() and xColumnAvgsize() APIs work. # reset_db fts5_aux_test_functions db do_execsql_test 5.1 { CREATE VIRTUAL TABLE t5 USING fts5(x, y, detail=%DETAIL%); INSERT INTO t5 VALUES('a b c d', 'e f g h i j'); INSERT INTO t5 VALUES('', 'a'); INSERT INTO t5 VALUES('a', ''); } do_execsql_test 5.2 { SELECT rowid, fts5_test_columnsize(t5) FROM t5 WHERE t5 MATCH 'a' ORDER BY rowid DESC; } { 3 {1 0} 2 {0 1} 1 {4 6} } do_execsql_test 5.3 { SELECT rowid, fts5_test_columntext(t5) FROM t5 WHERE t5 MATCH 'a' ORDER BY rowid DESC; } { 3 {a {}} 2 {{} a} 1 {{a b c d} {e f g h i j}} } do_execsql_test 5.4 { SELECT rowid, fts5_test_columntotalsize(t5) FROM t5 WHERE t5 MATCH 'a' ORDER BY rowid DESC; } { 3 {5 7} 2 {5 7} 1 {5 7} } do_execsql_test 5.5 { INSERT INTO t5 VALUES('x y z', 'v w x y z'); SELECT rowid, fts5_test_columntotalsize(t5) FROM t5 WHERE t5 MATCH 'a' ORDER BY rowid DESC; } { 3 {8 12} 2 {8 12} 1 {8 12} } #------------------------------------------------------------------------- # Test the xTokenize() API # reset_db fts5_aux_test_functions db do_execsql_test 6.1 { CREATE VIRTUAL TABLE t6 USING fts5(x, y, detail=%DETAIL%); INSERT INTO t6 VALUES('There are more', 'things in heaven and earth'); INSERT INTO t6 VALUES(', Horatio, Than are', 'dreamt of in your philosophy.'); } do_execsql_test 6.2 { SELECT rowid, fts5_test_tokenize(t6) FROM t6 WHERE t6 MATCH 't*' } { 1 {{there are more} {things in heaven and earth}} 2 {{horatio than are} {dreamt of in your philosophy}} } #------------------------------------------------------------------------- # Test the xQueryPhrase() API # reset_db fts5_aux_test_functions db do_execsql_test 7.1 { CREATE VIRTUAL TABLE t7 USING fts5(x, y, detail=%DETAIL%); } do_test 7.2 { foreach {x y} { {q i b w s a a e l o} {i b z a l f p t e u} {b a z t a l o x d i} {b p a d b f h d w y} {z m h n p p u i e g} {v h d v b x j j c z} {a g i m v a u c b i} {p k s o t l r t b m} {v v c j o d a s c p} {f f v o k p o f o g} } { execsql {INSERT INTO t7 VALUES($x, $y)} } execsql { SELECT count(*) FROM t7 } } {5} foreach {tn q res} { 1 a {{4 2}} 2 b {{3 4}} 3 c {{2 1}} 4 d {{2 2}} 5 {a AND b} {{4 2} {3 4}} 6 {a OR b OR c OR d} {{4 2} {3 4} {2 1} {2 2}} } { do_execsql_test 7.3.$tn { SELECT fts5_test_queryphrase(t7) FROM t7 WHERE t7 MATCH $q LIMIT 1 } [list $res] } do_execsql_test 7.4 { SELECT fts5_test_rowcount(t7) FROM t7 WHERE t7 MATCH 'a'; } {5 5 5 5} #do_execsql_test 7.4 { # SELECT rowid, bm25debug(t7) FROM t7 WHERE t7 MATCH 'a'; #} {5 5 5 5} # #------------------------------------------------------------------------- # do_test 8.1 { execsql { CREATE VIRTUAL TABLE t8 USING fts5(x, y, detail=%DETAIL%) } foreach {rowid x y} { 0 {A o} {o o o C o o o o o o o o} 1 {o o B} {o o o C C o o o o o o o} 2 {A o o} {o o o o D D o o o o o o} 3 {o B} {o o o o o D o o o o o o} 4 {E o G} {H o o o o o o o o o o o} 5 {F o G} {I o J o o o o o o o o o} 6 {E o o} {H o J o o o o o o o o o} 7 {o o o} {o o o o o o o o o o o o} 9 {o o o} {o o o o o o o o o o o o} } { execsql { INSERT INTO t8(rowid, x, y) VALUES($rowid, $x, $y) } } } {} foreach {tn q res} { 1 {a} {0 2} 2 {b} {3 1} 3 {c} {1 0} 4 {d} {2 3} 5 {g AND (e OR f)} {5 4} 6 {j AND (h OR i)} {5 6} } { do_execsql_test 8.2.$tn.1 { SELECT rowid FROM t8 WHERE t8 MATCH $q ORDER BY bm25(t8); } $res do_execsql_test 8.2.$tn.2 { SELECT rowid FROM t8 WHERE t8 MATCH $q ORDER BY +rank; } $res do_execsql_test 8.2.$tn.3 { SELECT rowid FROM t8 WHERE t8 MATCH $q ORDER BY rank; } $res } #------------------------------------------------------------------------- # Test xPhraseCount() for some different queries. # do_test 9.1 { execsql { CREATE VIRTUAL TABLE t9 USING fts5(x) } foreach x { "a b c" "d e f" } { execsql { INSERT INTO t9 VALUES($x) } } } {} foreach {tn q cnt} { 1 {a AND b} 2 2 {a OR b} 2 3 {a OR b OR c} 3 4 {NEAR(a b)} 2 } { do_execsql_test 9.2.$tn { SELECT fts5_test_phrasecount(t9) FROM t9 WHERE t9 MATCH $q LIMIT 1 } $cnt } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5af.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # # More specifically, the tests in this file focus on the built-in # snippet() function. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5af # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(x, y, detail=%DETAIL%); } proc do_snippet_test {tn doc match res} { uplevel #0 [list set v1 $doc] uplevel #0 [list set v2 $match] do_execsql_test $tn.1 { DELETE FROM t1; INSERT INTO t1 VALUES($v1, NULL); SELECT snippet(t1, -1, '[', ']', '...', 7) FROM t1 WHERE t1 MATCH $v2; } [list $res] do_execsql_test $tn.2 { DELETE FROM t1; INSERT INTO t1 VALUES(NULL, $v1); SELECT snippet(t1, -1, '[', ']', '...', 7) FROM t1 WHERE t1 MATCH $v2; } [list $res] do_execsql_test $tn.3 { DELETE FROM t1; INSERT INTO t1 VALUES($v1, NULL); SELECT snippet(t1, -1, '[', ']', '...', 7) FROM t1 WHERE t1 MATCH $v2 ORDER BY rank DESC; } [list $res] } foreach {tn doc res} { 1.1 {X o o o o o o} {[X] o o o o o o} 1.2 {o X o o o o o} {o [X] o o o o o} 1.3 {o o X o o o o} {o o [X] o o o o} 1.4 {o o o X o o o} {o o o [X] o o o} 1.5 {o o o o X o o} {o o o o [X] o o} 1.6 {o o o o o X o} {o o o o o [X] o} 1.7 {o o o o o o X} {o o o o o o [X]} 2.1 {X o o o o o o o} {[X] o o o o o o...} 2.2 {o X o o o o o o} {o [X] o o o o o...} 2.3 {o o X o o o o o} {o o [X] o o o o...} 2.4 {o o o X o o o o} {o o o [X] o o o...} 2.5 {o o o o X o o o} {o o o o [X] o o...} 2.6 {o o o o o X o o} {o o o o o [X] o...} 2.7 {o o o o o o X o} {o o o o o o [X]...} 2.8 {o o o o o o o X} {...o o o o o o [X]} 2.9 {o o o o o o o X o} {...o o o o o [X] o} 2.10 {o o o o o o o X o o} {...o o o o [X] o o} 2.11 {o o o o o o o X o o o} {...o o o [X] o o o} 2.12 {o o o o o o o X o o o o} {...o o o [X] o o o...} 3.1 {X o o o o o o o o} {[X] o o o o o o...} 3.2 {o X o o o o o o o} {o [X] o o o o o...} 3.3 {o o X o o o o o o} {o o [X] o o o o...} 3.4 {o o o X o o o o o} {o o o [X] o o o...} 3.5 {o o o o o o o X o o o o} {...o o o [X] o o o...} 3.6 {o o o o o o o o X o o o} {...o o o [X] o o o} 3.7 {o o o o o o o o o X o o} {...o o o o [X] o o} 3.8 {o o o o o o o o o o X o} {...o o o o o [X] o} 3.9 {o o o o o o o o o o o X} {...o o o o o o [X]} 4.1 {X o o o o o X o o} {[X] o o o o o [X]...} 4.2 {o o o o o o o X o o o o o X o} {...[X] o o o o o [X]...} 4.3 {o o o o o o o o X o o o o o X} {...[X] o o o o o [X]} 5.1 {X o o o o X o o o} {[X] o o o o [X] o...} 5.2 {o o o o o o o X o o o o X o o} {...[X] o o o o [X] o...} 5.3 {o o o o o o o o X o o o o X o} {...[X] o o o o [X] o} 5.4 {o o o o o o o o o X o o o o X} {...o [X] o o o o [X]} 6.1 {X o o o X o o o} {[X] o o o [X] o o...} 6.2 {o X o o o X o o o} {o [X] o o o [X] o...} 6.3 {o o o o o o o X o o o X o o} {...o [X] o o o [X] o...} 6.4 {o o o o o o o o X o o o X o} {...o [X] o o o [X] o} 6.5 {o o o o o o o o o X o o o X} {...o o [X] o o o [X]} 7.1 {X o o X o o o o o} {[X] o o [X] o o o...} 7.2 {o X o o X o o o o} {o [X] o o [X] o o...} 7.3 {o o o o o o o X o o X o o o} {...o [X] o o [X] o o...} 7.4 {o o o o o o o o X o o X o o} {...o [X] o o [X] o o} 7.5 {o o o o o o o o o X o o X o} {...o o [X] o o [X] o} 7.6 {o o o o o o o o o o X o o X} {...o o o [X] o o [X]} 8.1 {o o o o o o o o o X o o o o o o o o o o o o o o o o X X X o o o} {...o o [X] [X] [X] o o...} 8.2 {o o o o o o o. o o X o o o o o o o o o o o o o o o o X X X o o o} {...o o [X] o o o o...} 8.3 {o o o o X o o o o o o o o o o o o o o o o o o o o o X X X o o o} {o o o o [X] o o...} } { do_snippet_test 1.$tn $doc X $res } if {[detail_is_full]} { foreach {tn doc res} { 1.1 {X Y o o o o o} {[X Y] o o o o o} 1.2 {o X Y o o o o} {o [X Y] o o o o} 1.3 {o o X Y o o o} {o o [X Y] o o o} 1.4 {o o o X Y o o} {o o o [X Y] o o} 1.5 {o o o o X Y o} {o o o o [X Y] o} 1.6 {o o o o o X Y} {o o o o o [X Y]} 2.1 {X Y o o o o o o} {[X Y] o o o o o...} 2.2 {o X Y o o o o o} {o [X Y] o o o o...} 2.3 {o o X Y o o o o} {o o [X Y] o o o...} 2.4 {o o o o o o o X Y o o o} {...o o [X Y] o o o} 2.5 {o o o o o o o o X Y o o} {...o o o [X Y] o o} 2.6 {o o o o o o o o o X Y o} {...o o o o [X Y] o} 2.7 {o o o o o o o o o o X Y} {...o o o o o [X Y]} 3.1 {X Y o o o o o o o} {[X Y] o o o o o...} 3.2 {o X Y o o o o o o} {o [X Y] o o o o...} 3.3 {o o X Y o o o o o} {o o [X Y] o o o...} 3.4 {o o o o o o o X Y o o o o} {...o o [X Y] o o o...} 3.5 {o o o o o o o o X Y o o o} {...o o [X Y] o o o} 3.6 {o o o o o o o o o X Y o o} {...o o o [X Y] o o} 3.7 {o o o o o o o o o o X Y o} {...o o o o [X Y] o} 3.8 {o o o o o o o o o o o X Y} {...o o o o o [X Y]} } { do_snippet_test 2.$tn $doc "X + Y" $res } } do_execsql_test 4.0 { CREATE VIRTUAL TABLE x1 USING fts5(a, b); INSERT INTO x1 VALUES('xyz', '1 2 3 4 5 6 7 8 9 10 11 12 13'); SELECT snippet(x1, 1, '[', ']', '...', 5) FROM x1('xyz'); } { {1 2 3 4 5...} } do_execsql_test 5.0 { CREATE VIRTUAL TABLE p1 USING fts5(a, b); INSERT INTO p1 VALUES( 'x a a a a a a a a a a', 'a a a a a a a a a a a a a a a a a a a x' ); } do_execsql_test 5.1 { SELECT snippet(p1, 0, '[', ']', '...', 6) FROM p1('x'); } {{[x] a a a a a...}} } ;# foreach_detail_mode finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5ag.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5ag # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } #------------------------------------------------------------------------- # This file attempts to verify that the extension APIs work with # "ORDER BY rank" queries. This is done by comparing the results of # the fts5_test() function when run with queries of the form: # # ... WHERE fts MATCH ? ORDER BY bm25(fts) [ASC|DESC] # # and # # ... WHERE fts MATCH ? ORDER BY rank [ASC|DESC] # foreach_detail_mode $testprefix { do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(x, y, z, detail=%DETAIL%); } do_test 1.1 { foreach {x y z} { {j s m y m r n l u k} {z k f u z g h s w g} {r n o s s b v n w w} {m v g n d x q r r s} {q t d a q a v l h j} {s k l f s i n v q v} {m f f d h h s o h a} {y e v r q i u m h d} {b c k q m z l z h n} {j e m v k p e c j m} {m p v z d x l n i a} {v p u p m t p q i f} {v r w l e e t d z p} {c s b w k m n k o u} {w g y f v w v w v p} {k d g o u j p z n o} {t g e q l z i g b j} {f i q q j y h b g h} {j s w x o t j b t m} {v a v v r t x c q a} {r t k x w u l h a g} {j y b i u d e m d w} {y s o j h i n a u p} {n a g b u c w e b m} {b c k s c w j p w b} {m o c o w o b d q q} {n t y o y z y r z e} {p n q l e l h z q c} {n s e i h c v b b u} {m p d i t a o o f f} {k c o n v e z l b m} {s m n i n s d e s u} {t a u e q d a o u c} {h d t o i a g b b p} {k x c i g f g b b k} {x f i v n a n n j i} {f z k r b u s k z e} {n z v z w l e r h t} {t i s v v a v p n s} {k f e c t z r e f d} {f m g r c w q k b v} {v y s y f r b f e f} {z r c t d q q h x b} {u c g z n z u v s s} {y t n f f x b f d x} {u n p n u t i m e j} {p j j d m f k p m z} {d o l v c o e a h w} {h o q w t f v i c y} {c q u n r z s l l q} {z x a q w s b w s y} {y m s x k i m n x c} {b i a n v h z n k a} {w l q p b h h g d y} {z v s j f p v l f w} {c s b i z e k i g c} {x b v d w j f e d z} {r k k j e o m k g b} {h b d c h m y b t u} {u j s h k z c u d y} {v h i v s y z i k l} {d t m w q w c a z p} {r s e s x v d w k b} {u r e q j y h o o s} {x x z r x y t f j s} {k n h x i i u e c v} {q l f d a p w l q o} {y z q w j o p b o v} {s u h z h f d f n l} {q o e o x x l g q i} {j g m h q q w c d b} {o m d h w a g b f n} {m x k t s s y l v a} {j x t c a u w b w g} {n f j b v x y p u t} {u w k a q b u w k w} {a h j u o w f s k p} {j o f s h y t j h g} {x v b l m t l m h l} {t p y i y i q b q a} {k o o z w a c h c f} {j g c d k w b d t v} {a k v c m a v h v p} {i c a i j g h l j h} {l m v l c z j b p b} {z p z f l n k i b a} {j v q k g i x g i b} {m c i w u z m i s z} {i z r f n l q z k w} {x n b p b q r g i z} {d g i o o x l f x d} {r t m f b n q y c b} {i u g k w x n m p o} {t o s i q d z x d t} {v a k s q z j c o o} {z f n n r l y w v v} {w k h d t l j g n n} {r z m v y b l n c u} {v b v s c l n k g v} {m a g r a b u u n z} {u y l h v w v k b f} {x l p g i s j f x v} {v s g x k z a k a r} {l t g v j q l k p l} {f h n a x t v s t y} {z u v u x p s j y t} {g b q e e g l n w g} {e n p j i g j f u r} {q z l t w o l m p e} {t s g h r p r o t z} {y b f a o n u m z g} {d t w n y b o g f o} {d a j e r l g g s h} {d z e l w q l t h f} {f l u w q v x j a h} {f n u l l d m h h w} {d x c c e r o d q j} {b y f q s q f u l g} {u z w l f d b i a g} {m v q b g u o z e z} {h z p t s e x i v m} {l h q m e o x x x j} {e e d n p r m g j f} {k h s g o n s d a x} {u d t t s j o v h a} {z r b a e u v o e s} {m b b g a f c p a t} {w c m j o d b l g e} {f p j p m o s y v j} {c r n h d w c a b l} {s g e u s d n j b g} {b o n a x a b x y l} {r h u x f c d z n o} {x y l g u m i i w d} {t f h b z v r s r g} {t i o r b v g g p a} {d x l u q k m o s u} {j f h t u n z u k m} {g j t y d c n j y g} {w e s k v c w i g t} {g a h r g v g h r o} {e j l a q j g i n h} {d z k c u p n u p p} {t u e e v z v r r g} {l j s g k j k h z l} {p v d a t x d e q u} {r l u z b m g k s j} {i e y d u x d i n l} {p f z k m m w p u l} {z l p m r q w n d a} } { execsql { INSERT INTO t1 VALUES($x, $y, $z) } } set {} {} } {} fts5_aux_test_functions db proc do_fts5ag_test {tn E} { set q1 {SELECT fts5_test_all(t1) FROM t1 WHERE t1 MATCH $E ORDER BY rank} set q2 {SELECT fts5_test_all(t1) FROM t1 WHERE t1 MATCH $E ORDER BY bm25(t1)} set res [execsql $q1] set expected [execsql $q2] uplevel [list do_test $tn.1 [list set {} $res] $expected] append q1 " DESC" append q2 " DESC" set res [execsql $q1] set expected [execsql $q2] uplevel [list do_test $tn.2 [list set {} $res] $expected] } foreach {tn expr} { 2.1 a 2.2 b 2.3 c 2.4 d 3.0 {a AND b} 3.1 {a OR b} 3.2 {b OR c AND d} } { do_fts5ag_test $tn $expr } if {[detail_is_full]} { foreach {tn expr} { 4.1 {"m m"} 4.2 {e + s} 4.3 {NEAR(c d)} } { do_fts5ag_test $tn $expr } } } ;# foreach_detail_mode finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5ah.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5ah # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { #------------------------------------------------------------------------- # This file contains tests for very large doclists. # set Y [list] set W [list] do_test 1.0 { execsql { CREATE VIRTUAL TABLE t1 USING fts5(a, detail=%DETAIL%) } execsql { INSERT INTO t1(t1, rank) VALUES('pgsz', 128) } set v {w w w w w w w w w w w w w w w w w w w w} execsql { INSERT INTO t1(rowid, a) VALUES(0, $v) } for {set i 1} {$i <= 10000} {incr i} { set v {x x x x x x x x x x x x x x x x x x x x} if {($i % 2139)==0} {lset v 3 Y ; lappend Y $i} if {($i % 1577)==0} {lset v 5 W ; lappend W $i} execsql { INSERT INTO t1 VALUES($v) } } set v {w w w w w w w w w w w w w w w w w w w w} execsql { INSERT INTO t1 VALUES($v) } } {} do_execsql_test 1.1.1 { SELECT rowid FROM t1 WHERE t1 MATCH 'x AND w' } [lsort -integer -incr $W] do_execsql_test 1.1.2 { SELECT rowid FROM t1 WHERE t1 MATCH 'x* AND w*' } [lsort -integer -incr $W] do_execsql_test 1.2 { SELECT rowid FROM t1 WHERE t1 MATCH 'y AND x' } [lsort -integer -incr $Y] do_execsql_test 1.3 { INSERT INTO t1(t1) VALUES('integrity-check'); } proc reads {} { db one {SELECT t1 FROM t1 WHERE t1 MATCH '*reads'} } proc execsql_reads {sql} { set nRead [reads] execsql $sql expr [reads] - $nRead } do_test 1.4 { set nRead [reads] execsql { SELECT rowid FROM t1 WHERE t1 MATCH 'x' } set nReadX [expr [reads] - $nRead] #puts -nonewline "(nReadX=$nReadX)" if {[detail_is_full]} { set expect 1000 } if {[detail_is_col]} { set expect 250 } if {[detail_is_none]} { set expect 80 } expr $nReadX>$expect } {1} do_test 1.5 { set fwd [execsql_reads {SELECT rowid FROM t1 WHERE t1 MATCH 'x' }] set bwd [execsql_reads { SELECT rowid FROM t1 WHERE t1 MATCH 'x' ORDER BY 1 ASC }] expr {$bwd < $fwd + 12} } {1} foreach {tn q res} " 1 { SELECT rowid FROM t1 WHERE t1 MATCH 'w + x' } [list $W] 2 { SELECT rowid FROM t1 WHERE t1 MATCH 'x + w' } [list $W] 3 { SELECT rowid FROM t1 WHERE t1 MATCH 'x AND w' } [list $W] 4 { SELECT rowid FROM t1 WHERE t1 MATCH 'y AND x' } [list $Y] " { if {[detail_is_full]==0 && ($tn==1 || $tn==2)} continue if {[detail_is_full]} { set ratio 8 } if {[detail_is_col]} { set ratio 4 } if {[detail_is_none]} { set ratio 2 } do_test 1.6.$tn.1 { set n [execsql_reads $q] #puts -nonewline "(n=$n nReadX=$nReadX)" expr {$n < ($nReadX / $ratio)} } {1} do_test 1.6.$tn.2 { set n [execsql_reads "$q ORDER BY rowid DESC"] #puts -nonewline "(n=$n nReadX=$nReadX)" expr {$n < ($nReadX / $ratio)} } {1} do_execsql_test 1.6.$tn.3 $q [lsort -int -incr $res] do_execsql_test 1.6.$tn.4 "$q ORDER BY rowid DESC" [lsort -int -decr $res] } #------------------------------------------------------------------------- # Now test that adding range constraints on the rowid field reduces the # number of pages loaded from disk. # foreach {tn fraction tail cnt} { 1 0.6 {rowid > 5000} 5000 2 0.2 {rowid > 9000} 1000 3 0.2 {rowid < 1000} 999 4 0.2 {rowid BETWEEN 4000 AND 5000} 1001 5 0.6 {rowid >= 5000} 5001 6 0.2 {rowid >= 9000} 1001 7 0.2 {rowid <= 1000} 1000 8 0.6 {rowid > '5000'} 5000 9 0.2 {rowid > '9000'} 1000 10 0.1 {rowid = 444} 1 } { set q "SELECT rowid FROM t1 WHERE t1 MATCH 'x' AND $tail" set n [execsql_reads $q] set ret [llength [execsql $q]] # Because the position lists for 'x' are quite long in this db, the # advantage is a bit smaller in detail=none mode. Update $fraction to # reflect this. if {[detail_is_none] && $fraction<0.5} { set fraction [expr $fraction*2] } do_test "1.7.$tn.asc.(n=$n ret=$ret)" { expr {$n < ($fraction*$nReadX) && $ret==$cnt} } {1} set q "SELECT rowid FROM t1 WHERE t1 MATCH 'x' AND $tail ORDER BY rowid DESC" set n [execsql_reads $q] set ret [llength [execsql $q]] do_test "1.7.$tn.desc.(n=$n ret=$ret)" { expr {$n < 2*$fraction*$nReadX && $ret==$cnt} } {1} } do_execsql_test 1.8.1 { SELECT count(*) FROM t1 WHERE t1 MATCH 'x' AND +rowid < 'text'; } {10000} do_execsql_test 1.8.2 { SELECT count(*) FROM t1 WHERE t1 MATCH 'x' AND rowid < 'text'; } {10000} } ;# foreach_detail_mode #db eval {SELECT rowid, fts5_decode(rowid, block) aS r FROM t1_data} {puts $r} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5ai.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # # Specifically, it tests transactions and savepoints # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5ai # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, detail=%DETAIL%); } {} do_execsql_test 1.1 { BEGIN; INSERT INTO t1 VALUES('a b c'); INSERT INTO t1 VALUES('d e f'); SAVEPOINT one; INSERT INTO t1 VALUES('g h i'); SAVEPOINT two; INSERT INTO t1 VALUES('j k l'); ROLLBACK TO one; INSERT INTO t1 VALUES('m n o'); SAVEPOINT two; INSERT INTO t1 VALUES('p q r'); RELEASE one; SAVEPOINT one; INSERT INTO t1 VALUES('s t u'); ROLLBACK TO one; COMMIT; } do_execsql_test 1.2 { INSERT INTO t1(t1) VALUES('integrity-check'); } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5aj.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # # Specifically, this tests that, provided the amount of data remains # constant, the FTS index does not grow indefinitely as rows are inserted # and deleted, # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5aj # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } proc doc {} { set dict [list a b c d e f g h i j k l m n o p q r s t u v w x y z] set res [list] for {set i 0} {$i < 20} {incr i} { lappend res [lindex $dict [expr int(rand() * 26)]] } set res } proc structure {} { set val [db one {SELECT fts5_decode(rowid,block) FROM t1_data WHERE rowid=10}] foreach lvl [lrange $val 1 end] { lappend res [expr [llength $lvl]-2] } set res } expr srand(0) do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(x); INSERT INTO t1(t1, rank) VALUES('pgsz', 64); } for {set iTest 0} {$iTest < 50000} {incr iTest} { if {$iTest > 1000} { execsql { DELETE FROM t1 WHERE rowid=($iTest-1000) } } set new [doc] execsql { INSERT INTO t1 VALUES($new) } if {$iTest==10000} { set sz1 [db one {SELECT count(*) FROM t1_data}] } if {0==($iTest % 1000)} { set sz [db one {SELECT count(*) FROM t1_data}] set s [structure] do_execsql_test 1.$iTest.$sz.{$s} { INSERT INTO t1(t1) VALUES('integrity-check') } } } do_execsql_test 2.0 { INSERT INTO t1(t1) VALUES('integrity-check') } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5ak.test ================================================ # 2014 November 24 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # # Specifically, the auxiliary function "highlight". # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5ak # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { do_execsql_test 1.1 { CREATE VIRTUAL TABLE ft1 USING fts5(x, detail=%DETAIL%); INSERT INTO ft1 VALUES('i d d a g i b g d d'); INSERT INTO ft1 VALUES('h d b j c c g a c a'); INSERT INTO ft1 VALUES('e j a e f h b f h h'); INSERT INTO ft1 VALUES('j f h d g h i b d f'); INSERT INTO ft1 VALUES('d c j d c j b c g e'); INSERT INTO ft1 VALUES('i a d e g j g d a a'); INSERT INTO ft1 VALUES('j f c e d a h j d b'); INSERT INTO ft1 VALUES('i c c f a d g h j e'); INSERT INTO ft1 VALUES('i d i g c d c h b f'); INSERT INTO ft1 VALUES('g d a e h a b c f j'); CREATE VIRTUAL TABLE ft2 USING fts5(x, detail=%DETAIL%); INSERT INTO ft2 VALUES('a b c d e f g h i j'); } do_execsql_test 1.2 { SELECT highlight(ft1, 0, '[', ']') FROM ft1 WHERE ft1 MATCH 'e'; } { {[e] j a [e] f h b f h h} {d c j d c j b c g [e]} {i a d [e] g j g d a a} {j f c [e] d a h j d b} {i c c f a d g h j [e]} {g d a [e] h a b c f j} } do_execsql_test 1.3 { SELECT highlight(ft1, 0, '[', ']') FROM ft1 WHERE ft1 MATCH 'e e e' } { {[e] j a [e] f h b f h h} {d c j d c j b c g [e]} {i a d [e] g j g d a a} {j f c [e] d a h j d b} {i c c f a d g h j [e]} {g d a [e] h a b c f j} } do_execsql_test 1.4 { SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'f d' } { {a b c [d] e [f] g h i j} } do_execsql_test 1.5 { SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'd f' } { {a b c [d] e [f] g h i j} } #------------------------------------------------------------------------- # Tests below this point require detail=full. #------------------------------------------------------------------------- if {[detail_is_full]==0} continue do_execsql_test 2.1 { SELECT highlight(ft1, 0, '[', ']') FROM ft1 WHERE ft1 MATCH 'h + d'; } { {[h d] b j c c g a c a} {j f [h d] g h i b d f} } do_execsql_test 2.2 { SELECT highlight(ft1, 0, '[', ']') FROM ft1 WHERE ft1 MATCH 'd + d'; } { {i [d d] a g i b g [d d]} } do_execsql_test 2.3 { SELECT highlight(ft1, 0, '[', ']') FROM ft1 WHERE ft1 MATCH 'd + d d + d'; } { {i [d d] a g i b g [d d]} } do_execsql_test 2.4 { SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'b+c+d c+d+e' } {{a [b c d e] f g h i j}} do_execsql_test 2.5 { SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'b+c+d e+f+g' } { {a [b c d] [e f g] h i j} } do_execsql_test 2.6 { SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'b+c+d c' } { {a [b c d] e f g h i j} } do_execsql_test 2.7 { SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'b+c c+d+e' } { {a [b c d e] f g h i j} } #------------------------------------------------------------------------- # The example from the docs. # do_execsql_test 3.1 { -- Assuming this: CREATE VIRTUAL TABLE ft USING fts5(a, detail=%DETAIL%); INSERT INTO ft VALUES('a b c x c d e'); INSERT INTO ft VALUES('a b c c d e'); INSERT INTO ft VALUES('a b c d e'); -- The following SELECT statement returns these three rows: -- '[a b c] x [c d e]' -- '[a b c] [c d e]' -- '[a b c d e]' SELECT highlight(ft, 0, '[', ']') FROM ft WHERE ft MATCH 'a+b+c AND c+d+e'; } { {[a b c] x [c d e]} {[a b c] [c d e]} {[a b c d e]} } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5al.test ================================================ # 2014 November 24 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # # Specifically, this function tests the %_config table. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5al # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { do_execsql_test 1.1 { CREATE VIRTUAL TABLE ft1 USING fts5(x, detail=%DETAIL%); SELECT * FROM ft1_config; } {version 4} do_execsql_test 1.2 { INSERT INTO ft1(ft1, rank) VALUES('pgsz', 32); SELECT * FROM ft1_config; } {pgsz 32 version 4} do_execsql_test 1.3 { INSERT INTO ft1(ft1, rank) VALUES('pgsz', 64); SELECT * FROM ft1_config; } {pgsz 64 version 4} #-------------------------------------------------------------------------- # Test the logic for parsing the rank() function definition. # foreach {tn defn} { 1 "fname()" 2 "fname(1)" 3 "fname(1,2)" 4 "fname(null,NULL,nUlL)" 5 " fname ( null , NULL , nUlL ) " 6 "fname('abc')" 7 "fname('a''bc')" 8 "fname('''abc')" 9 "fname('abc''')" 7 "fname( 'a''bc' )" 8 "fname('''abc' )" 9 "fname( 'abc''' )" 10 "fname(X'1234ab')" 11 "myfunc(1.2)" 12 "myfunc(-1.0)" 13 "myfunc(.01,'abc')" } { do_execsql_test 2.1.$tn { INSERT INTO ft1(ft1, rank) VALUES('rank', $defn); } } foreach {tn defn} { 1 "" 2 "fname" 3 "fname(X'234ab')" 4 "myfunc(-1.,'abc')" } { do_test 2.2.$tn { catchsql { INSERT INTO ft1(ft1, rank) VALUES('rank', $defn) } } {1 {SQL logic error}} } #------------------------------------------------------------------------- # Assorted tests of the tcl interface for creating extension functions. # do_execsql_test 3.1 { CREATE VIRTUAL TABLE t1 USING fts5(x, detail=%DETAIL%); INSERT INTO t1 VALUES('q w e r t y'); INSERT INTO t1 VALUES('y t r e w q'); } proc argtest {cmd args} { return $args } sqlite3_fts5_create_function db argtest argtest do_execsql_test 3.2.1 { SELECT argtest(t1, 123) FROM t1 WHERE t1 MATCH 'q' } {123 123} do_execsql_test 3.2.2 { SELECT argtest(t1, 123, 456) FROM t1 WHERE t1 MATCH 'q' } {{123 456} {123 456}} proc rowidtest {cmd} { $cmd xRowid } sqlite3_fts5_create_function db rowidtest rowidtest do_execsql_test 3.3.1 { SELECT rowidtest(t1) FROM t1 WHERE t1 MATCH 'q' } {1 2} proc insttest {cmd} { set res [list] for {set i 0} {$i < [$cmd xInstCount]} {incr i} { lappend res [$cmd xInst $i] } set res } sqlite3_fts5_create_function db insttest insttest do_execsql_test 3.4.1 { SELECT insttest(t1) FROM t1 WHERE t1 MATCH 'q' } { {{0 0 0}} {{0 0 5}} } if {[detail_is_full]} { do_execsql_test 3.4.2 { SELECT insttest(t1) FROM t1 WHERE t1 MATCH 'r+e OR w' } { {{1 0 1}} {{0 0 2} {1 0 4}} } } proc coltest {cmd} { list [$cmd xColumnSize 0] [$cmd xColumnText 0] } sqlite3_fts5_create_function db coltest coltest do_execsql_test 3.5.1 { SELECT coltest(t1) FROM t1 WHERE t1 MATCH 'q' } { {6 {q w e r t y}} {6 {y t r e w q}} } #------------------------------------------------------------------------- # Tests for remapping the "rank" column. # # 4.1.*: Mapped to a function with no arguments. # 4.2.*: Mapped to a function with one or more arguments. # do_execsql_test 4.0 { CREATE VIRTUAL TABLE t2 USING fts5(a, b, detail=%DETAIL%); INSERT INTO t2 VALUES('a s h g s b j m r h', 's b p a d b b a o e'); INSERT INTO t2 VALUES('r h n t a g r d d i', 'l d n j r c f t o q'); INSERT INTO t2 VALUES('q k n i k c a a e m', 'c h n j p g s c i t'); INSERT INTO t2 VALUES('h j g t r e l s g s', 'k q k c i i c k n s'); INSERT INTO t2 VALUES('b l k h d n n n m i', 'p t i a r b t q o l'); INSERT INTO t2 VALUES('k r i l j b g i p a', 't q c h a i m g n l'); INSERT INTO t2 VALUES('a e c q n m o m d g', 'l c t g i s q g q e'); INSERT INTO t2 VALUES('b o j h f o g b p e', 'r t l h s b g i c p'); INSERT INTO t2 VALUES('s q k f q b j g h f', 'n m a o p e i e k t'); INSERT INTO t2 VALUES('o q g g q c o k a b', 'r t k p t f t h p c'); } proc firstinst {cmd} { foreach {p c o} [$cmd xInst 0] {} expr $c*100 + $o } sqlite3_fts5_create_function db firstinst firstinst do_execsql_test 4.1.1 { SELECT rowid, firstinst(t2) FROM t2 WHERE t2 MATCH 'a' ORDER BY rowid ASC } { 1 0 2 4 3 6 5 103 6 9 7 0 9 102 10 8 } do_execsql_test 4.1.2 { SELECT rowid, rank FROM t2 WHERE t2 MATCH 'a' AND rank MATCH 'firstinst()' ORDER BY rowid ASC } { 1 0 2 4 3 6 5 103 6 9 7 0 9 102 10 8 } do_execsql_test 4.1.3 { SELECT rowid, rank FROM t2 WHERE t2 MATCH 'a' AND rank MATCH 'firstinst()' ORDER BY rank DESC } { 5 103 9 102 6 9 10 8 3 6 2 4 1 0 7 0 } do_execsql_test 4.1.4 { INSERT INTO t2(t2, rank) VALUES('rank', 'firstinst()'); SELECT rowid, rank FROM t2 WHERE t2 MATCH 'a' ORDER BY rowid ASC } { 1 0 2 4 3 6 5 103 6 9 7 0 9 102 10 8 } do_execsql_test 4.1.5 { SELECT rowid, rank FROM t2 WHERE t2 MATCH 'a' ORDER BY rank DESC } { 5 103 9 102 6 9 10 8 3 6 2 4 1 0 7 0 } do_execsql_test 4.1.6 { INSERT INTO t2(t2, rank) VALUES('rank', 'firstinst ( ) '); SELECT rowid, rank FROM t2 WHERE t2 MATCH 'a' ORDER BY rank DESC } { 5 103 9 102 6 9 10 8 3 6 2 4 1 0 7 0 } proc rowidplus {cmd ival} { expr [$cmd xRowid] + $ival } sqlite3_fts5_create_function db rowidplus rowidplus if {[detail_is_full]} { do_execsql_test 4.2.1 { INSERT INTO t2(t2, rank) VALUES('rank', 'rowidplus(100) '); SELECT rowid, rank FROM t2 WHERE t2 MATCH 'o + q + g' } { 10 110 } do_execsql_test 4.2.2 { INSERT INTO t2(t2, rank) VALUES('rank', 'rowidplus(111) '); SELECT rowid, rank FROM t2 WHERE t2 MATCH 'o + q + g' } { 10 121 } do_execsql_test 4.2.3 { SELECT rowid, rank FROM t2 WHERE t2 MATCH 'o + q + g' AND rank MATCH 'rowidplus(112)' } { 10 122 } } proc rowidmod {cmd imod} { expr [$cmd xRowid] % $imod } sqlite3_fts5_create_function db rowidmod rowidmod do_execsql_test 4.3.1 { CREATE VIRTUAL TABLE t3 USING fts5(x, detail=%DETAIL%); INSERT INTO t3 VALUES('a one'); INSERT INTO t3 VALUES('a two'); INSERT INTO t3 VALUES('a three'); INSERT INTO t3 VALUES('a four'); INSERT INTO t3 VALUES('a five'); INSERT INTO t3(t3, rank) VALUES('rank', 'bm25()'); } do_execsql_test 4.3.2 { SELECT * FROM t3 WHERE t3 MATCH 'a' AND rank MATCH 'rowidmod(4)' ORDER BY rank ASC } { {a four} {a one} {a five} {a two} {a three} } do_execsql_test 4.3.3 { SELECT *, rank FROM t3 WHERE t3 MATCH 'a' AND rank MATCH 'rowidmod(3)' ORDER BY rank ASC } { {a three} 0 {a one} 1 {a four} 1 {a two} 2 {a five} 2 } do_execsql_test 4.3.4 { SELECT * FROM t3('a', 'rowidmod(4)') ORDER BY rank ASC; } { {a four} {a one} {a five} {a two} {a three} } do_execsql_test 4.3.5 { SELECT *, rank FROM t3('a', 'rowidmod(3)') ORDER BY rank ASC } { {a three} 0 {a one} 1 {a four} 1 {a two} 2 {a five} 2 } do_catchsql_test 4.4.3 { SELECT *, rank FROM t3 WHERE t3 MATCH 'a' AND rank MATCH 'xyz(3)' } {1 {no such function: xyz}} do_catchsql_test 4.4.4 { SELECT *, rank FROM t3 WHERE t3 MATCH 'a' AND rank MATCH NULL } {1 {parse error in rank function: }} } ;# foreach_detail_mode finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5alter.test ================================================ # 2015 Jun 10 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # The tests in this file focus on renaming FTS5 tables using the # "ALTER TABLE ... RENAME TO ..." command # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5alter # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } #------------------------------------------------------------------------- # Test renaming regular, contentless and columnsize=0 FTS5 tables. # do_execsql_test 1.1.0 { CREATE VIRTUAL TABLE "a x" USING fts5(a, x); INSERT INTO "a x" VALUES('a a a', 'x x x'); ALTER TABLE "a x" RENAME TO "x y"; } do_execsql_test 1.1.1 { SELECT * FROM "x y"; SELECT rowid FROM "x y" WHERE "x y" MATCH 'a' } {{a a a} {x x x} 1} do_execsql_test 1.2.0 { CREATE VIRTUAL TABLE "one/two" USING fts5(one, columnsize=0); INSERT INTO "one/two"(rowid, one) VALUES(456, 'd d d'); ALTER TABLE "one/two" RENAME TO "three/four"; } do_execsql_test 1.2.1 { SELECT * FROM "three/four"; SELECT rowid FROM "three/four" WHERE "three/four" MATCH 'd' } {{d d d} 456} do_execsql_test 1.3.0 { CREATE VIRTUAL TABLE t1 USING fts5(val, content=''); INSERT INTO t1(rowid, val) VALUES(-1, 'drop table'); INSERT INTO t1(rowid, val) VALUES(-2, 'drop view'); ALTER TABLE t1 RENAME TO t2; } do_execsql_test 1.3.1 { SELECT rowid, * FROM t2; SELECT rowid FROM t2 WHERE t2 MATCH 'table' } {-2 {} -1 {} -1} #------------------------------------------------------------------------- # Test renaming an FTS5 table within a transaction. # do_execsql_test 2.1 { CREATE VIRTUAL TABLE zz USING fts5(a); INSERT INTO zz(rowid, a) VALUES(-56, 'a b c'); BEGIN; INSERT INTO zz(rowid, a) VALUES(-22, 'a b c'); ALTER TABLE zz RENAME TO yy; SELECT rowid FROM yy WHERE yy MATCH 'a + b + c'; COMMIT; } {-56 -22} do_execsql_test 2.2 { BEGIN; ALTER TABLE yy RENAME TO ww; INSERT INTO ww(rowid, a) VALUES(-11, 'a b c'); SELECT rowid FROM ww WHERE ww MATCH 'a + b + c'; } {-56 -22 -11} do_execsql_test 2.3 { ROLLBACK; SELECT rowid FROM yy WHERE yy MATCH 'a + b + c'; } {-56 -22} #------------------------------------------------------------------------- do_execsql_test 3.1 { CREATE VIRTUAL TABLE abc USING fts5(a); INSERT INTO abc(rowid, a) VALUES(1, 'a'); BEGIN; INSERT INTO abc(rowid, a) VALUES(2, 'a'); } do_execsql_test 3.2 { SELECT rowid FROM abc WHERE abc MATCH 'a'; } {1 2} do_execsql_test 3.3 { COMMIT; SELECT rowid FROM abc WHERE abc MATCH 'a'; } {1 2} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5auto.test ================================================ # 2015 May 30 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # This file contains automatically generated tests for various types # of MATCH expressions. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5auto # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } set data { -4026076 {n x w k b p x b n t t d s} {f j j s p j o} {w v i y r} {i p y s} {a o q v e n q r} {q v g u c y a z y} 3995120 {c} {e e w d t} {x c p f w r s m l r b f d} {g g u e} {s n u t d v p d} {b k v p m f} -2913881 {k m} {a} {w r j z n s l} {m j i w d t w e l} {z n c} {v f b m} 174082 {j} {q l w u k e q v r i} {j l} {u v w r s p e l} {p i k j k q c t g u s} {g u y s m h q k g t e s o r} 3207399 {e t} {} {p} {y v r b e k h d e v} {t m w z b g q t s d d h} {o n v u i t o y k j} 182399 {} {m o s o x d y f a x j z} {x n z r c d} {n r x i r} {s v s} {a u} 768994 {e u t q v z q k j p u f j p} {y c b} {p s d} {k n w p m p p} {u o x s d} {f s g r d b d r m m m z y} 3931037 {c j p x e} {c n k t h z o i} {} {r r p j k x w q} {o r d z d} {x} 3105748 {p x r u} {x i s w o t o g x m z i w} {q x m z} {h c j w b l y w x c o} {m b k v} {t v q i s a d x} -2501642 {o u d n w o m o o s n t r h} {k p e u y p e z d j r y g} {v b b h d d q y j q j} {a m w d t} {y e f n} {a k x i x} -1745680 {z u w j f d b f} {j w i c g u d w e} {m f p v m a s p v c o s} {s c r z o t w l b e a q} {m k q} {k b a v o} -932328 {r v i u m q d r} {f z u v h c m r f g} {r x r} {k p i d h h w h z u a x} {k m j p} {h l j a e u c i q x x f x g} -3923818 {t t p b n u i h e c k} {m z} {v u d c} {v y y j s g} {o a f k k q p h g x e n z x} {h d w c o l} -2145922 {z z l f a l g e d c d h} {j b j p k o o u b q} {d i g q t f d r h k} {n w g j c x r p t y f l c t} {d o c u k f o} {r y s x z s p p h g t p y c} 4552917 {j w j y h l k u} {n a} {y h w c n k} {b} {w} {z l r t s i m v c y} 2292008 {q v q j w y y x u t} {r q z n h a b o} {d q y} {y v o e j} {} {a b h c d l p d x} 1407892 {n j j u q d o a u c f} {r d b w o q n g} {d e v w s} {v d v o u o x s l s j z y} {j y w h i f g i h m} {v n z b n y} -4412544 {g h h r s} {h e r e} {n q s} {o p z r m l l t} {p} {f s u o b j} 1209110 {o a a z t t u h j} {z z i r k r} {i c x q w g v o x z i z p} {q o g k i n z x e d v w v} {p f v b g f e d n p u c y k} {q z z a i p a a s r e z} 3448977 {i v} {l u x t b o k} {f h u v p} {k a o y j} {d m k c j} {v c e r u e f i t} -4703774 {d h v w u z r e h x o l t} {p s f y w y r q d a m w} {c h g c g j j f t b i c q} {s e} {c t q j g f} {v n r w y r a g e j d} 2414151 {s o o s d s k q b f q v p e} {j r o b t o p d l o o x} {d d k t v e} {} {t v o d w} {w e q w h y c y y i j b a m} -3342407 {m c h n e p d o c r w n t} {j d k s p q l} {t g s r w x j l r z r} {h} {r q v x i r a n h s} {m y p b v w r a u o g q r} -993951 {l n p u o j d x t u u c o j} {k r n a r e k v i t o e} {q f t t a a c z v f} {o n m p v f o e n} {h z h i p s b j z h} {i t w m k c u g n i} 1575251 {} {z s i j d o x j a r t} {h g j u j n v e n z} {p z j n n f} {s q q f d w r l y i z d o m} {b a n d h t b y g h d} 4263668 {q g t h f s} {s g x p f q z i s o f l i} {q k} {w v h a x n a r b} {m j a h o b i x k r w z q u} {m t r g j o e q t m p u l} 2487819 {m w g x r n e u t s r} {b x a t u u j c r n} {j} {w f j r e e y l p} {o u h b} {o c a c a b v} 167966 {o d b s d o a u m o x y} {c} {r w d o b v} {z e b} {i n z a f g z o} {m u b a g} 1948599 {n r g q d j s} {n k} {l b p d v t k h y y} {u m k e c} {t b n y o t b} {j w c i r x x} 2941631 {l d p l b g f} {e k e} {p j} {m c s w t b k n l d x} {f o v y v l} {c w p s w j w c u t y} 3561104 {d r j j r j i g p} {u} {g r j q} {z l p d s n f c h t d c v z} {w r c f s x z y} {g f o k g g} -2223281 {y e t j j z f p o m m z} {h k o g o} {m x a t} {l q x l} {r w k d l s y b} {q g k b} -4502874 {k k b x k l f} {r} {} {q m z b k h k u n e z} {z q g y m y u} {} 1757599 {d p z j y u r} {z p l q w j t j} {n i r x r y j} {} {h} {w t d q c x z z x e e} -4809589 {} {z p x u h i i n g} {w q s u d b f x n} {l y k b b r x t i} {n d v j q o t o d p z e} {u r y u v u c} 1068408 {y e} {e g s k e w t p v o b k} {z c m s} {r u r u h n h b p q g b} {j k b l} {m c d t s r s q a d b o f} -1972554 {m s w} {d k v s a r k p a r i v} {g j z k p} {y k c v r e u o q f i b a} {i p i} {c z w c y b n z i v} -2052385 {} {x e u f f g n c i x n e i e} {} {p s w d x p g} {} {s j a h n} 2805981 {m x g c w o e} {k g u y r y i u e g g} {f k j v t x p h x k u} {w i} {b l f z f v t n} {i u d o d p h s m u} 2507621 {} {u b n l x f n j t} {u r x l h} {h r l m r} {d y e n b s q v t k n q q} {x l t v w h a s k} -3138375 {e o f j y x u w v e w z} {r d q g k n n v r c z n e w} {l y i q z k j p u f q s k} {c i l l i m a a g a z r x f} {a v k h m q z b y n z} {q g w c y r r o a} -457971 {j x a w e c s h f l f} {q} {j f v j u m d q r v v} {x n v a w} {i e h d h f u w t t z} {v s u l s v o v i k n e} 2265221 {z t c y w n y r t} {n b a x s} {q w a v} {a b s d x i g w t e z h} {t l} {j k r w f f y j o k u} -3941280 {r x t o z} {f j n z k} {t x e b t d b k w i s} {j t y h i h} {y q g n g s u v c z j z n g} {n n g t l p h} 2084745 {z d z d} {j} {o e k t b k a z l w} {o p i h k c x} {c r b t i j f} {z e n m} 1265843 {} {j s g j j x u y} {u q t f} {g o g} {w o j e d} {w q n a c t q x j} -2941116 {i n c u o} {f b} {o m s q d o z a q} {f s v o b b} {o a z c h r} {j e w h b f z} -1265441 {p g z q v a o a x a} {s t h} {w i p o c} {s n d g f z w q o d v v l j} {y f b i a s v} {u m o z k k s t s d p b l p} -1989158 {r i c n} {r e w w i n z} {q u s y b w u g y g f o} {y} {d} {j x i b x u y d c p v a h} 2391989 {b n w x w f q h p i} {e u b b i n a i o c d g} {v a z o i e n l x l r} {r u f o r k w m d w} {k s} {r f e j q p w} } do_execsql_test 1.0 { CREATE VIRTUAL TABLE tt USING fts5(a, b, c, d, e, f); } {} fts5_aux_test_functions db proc do_auto_test {tn tbl expr} { foreach order {asc desc} { set res [fts5_poslist_data $expr $tbl $order] set testname "$tn.[string range $order 0 0].rows=[expr [llength $res]/2]" set ::autotest_expr $expr do_execsql_test $testname [subst -novar { SELECT rowid, fts5_test_poslist([set tbl]) FROM [set tbl] WHERE [set tbl] MATCH $::autotest_expr ORDER BY rowid [set order] }] $res } } #------------------------------------------------------------------------- # for {set fold 0} {$fold < 3} {incr fold} { switch $fold { 0 { set map {} } 1 { set map { a a b a c b d b e c f c g d h d i e j e k f l f m g g g o h p h q i r i s j t j u k v k w l x l y m z m }} 2 { set map { a a b a c a d a e a f a g a h a i b j b k b l b m b g b o b p b q c r c s c t c u c v c w c x c }} } execsql { BEGIN; DELETE FROM tt; } foreach {rowid a b c d e f} [string map $map $data] { if {$rowid==-4703774} { execsql { INSERT INTO tt(rowid, a, b, c, d, e, f) VALUES($rowid, $a, $b, $c, $d, $e, $f) } } } execsql COMMIT foreach {tn expr} { A.1 { {a} : x } A.2 { {a b} : x } A.3 { {a b f} : x } A.4 { {f a b} : x } A.5 { {f a b} : x y } A.6 { {f a b} : x + y } A.7 { {c a b} : x + c } A.8 { {c d} : "l m" } A.9 { {c e} : "l m" } A.10 { {a b c a b c a b c f f e} : "l m" } B.1 { a NOT b } B.2 { a NOT a:b } B.3 { a OR (b AND c) } B.4 { a OR (b AND {a b c}:c) } B.5 { a OR "b c" } B.6 { a OR b OR c } C.1 { a OR (b AND "b c") } C.2 { a OR (b AND "z c") } } { do_auto_test 3.$fold.$tn tt $expr } } proc replace_elems {list args} { set ret $list foreach {idx elem} $args { set ret [lreplace $ret $idx $idx $elem] } set ret } #------------------------------------------------------------------------- # set bigdoc [string trim [string repeat "a " 1000]] do_test 4.0 { set a [replace_elems $bigdoc 50 x 950 x] set b [replace_elems $bigdoc 20 y 21 x 887 x 888 y] set c [replace_elems $bigdoc 1 z 444 z 789 z] execsql { CREATE VIRTUAL TABLE yy USING fts5(c1, c2, c3); INSERT INTO yy(rowid, c1, c2, c3) VALUES(-56789, $a, $b, $c); INSERT INTO yy(rowid, c1, c2, c3) VALUES(250, $a, $b, $c); } } {} foreach {tn expr} { 1 x 2 y 3 z 4 {c1 : x} 5 {c2 : x} 6 {c3 : x} 7 {c1 : y} 8 {c2 : y} 9 {c3 : y} 10 {c1 : z} 11 {c2 : z} 12 {c3 : z} } { do_auto_test 4.$tn yy $expr } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5aux.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests focusing on the auxiliary function APIs. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5aux # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } proc inst {cmd i} { $cmd xInst $i } sqlite3_fts5_create_function db inst inst proc colsize {cmd i} { $cmd xColumnSize $i } sqlite3_fts5_create_function db colsize colsize proc totalsize {cmd i} { $cmd xColumnTotalSize $i } sqlite3_fts5_create_function db totalsize totalsize do_execsql_test 1.0 { CREATE VIRTUAL TABLE f1 USING fts5(a, b); INSERT INTO f1 VALUES('one two', 'two one zero'); INSERT INTO f1 VALUES('one one', 'one one one'); } do_catchsql_test 1.1 { SELECT inst(f1, -1) FROM f1 WHERE f1 MATCH 'two'; } {1 SQLITE_RANGE} do_catchsql_test 1.2 { SELECT inst(f1, 0) FROM f1 WHERE f1 MATCH 'two'; } {0 {{0 0 1}}} do_catchsql_test 1.3 { SELECT inst(f1, 1) FROM f1 WHERE f1 MATCH 'two'; } {0 {{0 1 0}}} do_catchsql_test 1.4 { SELECT inst(f1, 2) FROM f1 WHERE f1 MATCH 'two'; } {1 SQLITE_RANGE} do_catchsql_test 2.1 { SELECT colsize(f1, 2) FROM f1 WHERE f1 MATCH 'two'; } {1 SQLITE_RANGE} do_execsql_test 2.2 { SELECT colsize(f1, 0), colsize(f1, 1) FROM f1 WHERE f1 MATCH 'zero'; } {2 3} do_execsql_test 2.3 { SELECT colsize(f1, -1) FROM f1 WHERE f1 MATCH 'zero'; } {5} do_execsql_test 2.4.1 { SELECT totalsize(f1, -1) FROM f1 WHERE f1 MATCH 'zero'; } {10} do_execsql_test 2.4.2 { SELECT totalsize(f1, 0) FROM f1 WHERE f1 MATCH 'zero'; } {4} do_execsql_test 2.4.3 { SELECT totalsize(f1, 1) FROM f1 WHERE f1 MATCH 'zero'; } {6} do_catchsql_test 2.4.4 { SELECT totalsize(f1, 2) FROM f1 WHERE f1 MATCH 'zero'; } {1 SQLITE_RANGE} #------------------------------------------------------------------------- # Test the xSet and xGetAuxdata APIs with a NULL destructor. # proc prevrowid {add cmd} { set res [$cmd xGetAuxdataInt 0] set r [$cmd xRowid] $cmd xSetAuxdataInt $r return [expr $res + $add] } sqlite3_fts5_create_function db prevrowid [list prevrowid 0] sqlite3_fts5_create_function db prevrowid1 [list prevrowid 1] do_execsql_test 3.0 { CREATE VIRTUAL TABLE e5 USING fts5(x); INSERT INTO e5 VALUES('a b c'); INSERT INTO e5 VALUES('d e f'); INSERT INTO e5 VALUES('a b c'); INSERT INTO e5 VALUES('d e f'); INSERT INTO e5 VALUES('a b c'); } do_execsql_test 3.1 { SELECT prevrowid(e5) || '+' || rowid FROM e5 WHERE e5 MATCH 'c' } {0+1 1+3 3+5} do_execsql_test 3.2 { SELECT prevrowid(e5) || '+' || prevrowid1(e5) || '+' || rowid FROM e5 WHERE e5 MATCH 'e' } {0+1+2 2+3+4} #------------------------------------------------------------------------- # Test that if the xQueryPhrase callback returns other than SQLITE_OK, # the query is abandoned. And that if it returns an error code other than # SQLITE_DONE, the error is propagated back to the caller. # do_execsql_test 4.0 { CREATE VIRTUAL TABLE e7 USING fts5(x); INSERT INTO e7 VALUES('a x a'); INSERT INTO e7 VALUES('b x b'); INSERT INTO e7 VALUES('c x c'); INSERT INTO e7 VALUES('d x d'); INSERT INTO e7 VALUES('e x e'); } proc xCallback {rowid code cmd} { set r [$cmd xRowid] lappend ::cb $r if {$r==$rowid} { return $code } return "" } proc phrasequery {cmd code} { set ::cb [list] $cmd xQueryPhrase 1 [list xCallback [$cmd xRowid] $code] set ::cb } sqlite3_fts5_create_function db phrasequery phrasequery do_execsql_test 4.1 { SELECT phrasequery(e7, 'SQLITE_OK') FROM e7 WHERE e7 MATCH 'c x' } {{1 2 3 4 5}} do_execsql_test 4.2 { SELECT phrasequery(e7, 'SQLITE_DONE') FROM e7 WHERE e7 MATCH 'c x' } {{1 2 3}} do_catchsql_test 4.3 { SELECT phrasequery(e7, 'SQLITE_ERROR') FROM e7 WHERE e7 MATCH 'c x' } {1 SQLITE_ERROR} #------------------------------------------------------------------------- # Auxiliary function calls with many cursors in the global cursor list. # do_execsql_test 5.0 { CREATE VIRTUAL TABLE e9 USING fts5(y); INSERT INTO e9(rowid, y) VALUES(1, 'i iii'); INSERT INTO e9(rowid, y) VALUES(2, 'ii iv'); INSERT INTO e9(rowid, y) VALUES(3, 'ii'); INSERT INTO e9(rowid, y) VALUES(4, 'i iv'); INSERT INTO e9(rowid, y) VALUES(5, 'iii'); } proc my_rowid {cmd} { $cmd xRowid } sqlite3_fts5_create_function db my_rowid my_rowid foreach {var q} { s1 i s2 ii s3 iii s4 iv } { set sql "SELECT my_rowid(e9) FROM e9 WHERE e9 MATCH '$q'" set $var [sqlite3_prepare db $sql -1 dummy] } do_test 5.1.1 { sqlite3_step $s1 ; sqlite3_column_int $s1 0 } 1 do_test 5.1.2 { sqlite3_step $s2 ; sqlite3_column_int $s2 0 } 2 do_test 5.1.3 { sqlite3_step $s3 ; sqlite3_column_int $s3 0 } 1 do_test 5.1.4 { sqlite3_step $s4 ; sqlite3_column_int $s4 0 } 2 do_test 5.2.1 { sqlite3_step $s1 ; sqlite3_column_int $s1 0 } 4 do_test 5.2.2 { sqlite3_step $s2 ; sqlite3_column_int $s2 0 } 3 do_test 5.2.3 { sqlite3_step $s3 ; sqlite3_column_int $s3 0 } 5 do_test 5.2.4 { sqlite3_step $s4 ; sqlite3_column_int $s4 0 } 4 sqlite3_finalize $s1 sqlite3_finalize $s2 sqlite3_finalize $s3 sqlite3_finalize $s4 #------------------------------------------------------------------------- # Passing an invalid first argument to an auxiliary function is detected. # do_execsql_test 6.0 { CREATE VIRTUAL TABLE e11 USING fts5(y, z); INSERT INTO e11(rowid, y, z) VALUES(1, 'a b', 45); INSERT INTO e11(rowid, y, z) VALUES(2, 'b c', 46); } do_catchsql_test 6.1 { SELECT my_rowid(z) FROM e11 WHERE e11 MATCH 'b' } {1 {no such cursor: 45}} do_catchsql_test 6.2 { SELECT my_rowid(y) FROM e11 WHERE e11 MATCH 'b' } {1 {no such cursor: 0}} #------------------------------------------------------------------------- # Test passing an out-of-range phrase number to xPhraseSize (should # return 0). # proc my_phrasesize {cmd iPhrase} { $cmd xPhraseSize $iPhrase } sqlite3_fts5_create_function db my_phrasesize my_phrasesize do_execsql_test 7.1 { CREATE VIRTUAL TABLE t1 USING fts5(a); INSERT INTO t1 VALUES('a b c'); } do_execsql_test 7.2 { SELECT my_phrasesize(t1, -1), my_phrasesize(t1, 0), my_phrasesize(t1, 1), my_phrasesize(t1, 2) FROM t1 WHERE t1 MATCH 'a OR b+c' } {0 1 2 0} #------------------------------------------------------------------------- # do_execsql_test 8.0 { CREATE VIRTUAL TABLE x1 USING fts5(a); } foreach {tn lRow res} { 4 {"a a a" "b" "a d"} {"[a] [a] [a]" "[a] d"} 1 {"b d" "a b"} {"[b] [d]" "[a] b"} 2 {"d b" "a d"} {"[d] [b]" "[a] d"} 3 {"a a d"} {"[a] [a] d"} } { execsql { DELETE FROM x1 } foreach row $lRow { execsql { INSERT INTO x1 VALUES($row) } } do_execsql_test 8.$tn { SELECT highlight(x1, 0, '[', ']') FROM x1 WHERE x1 MATCH 'a OR (b AND d)'; } $res } #------------------------------------------------------------------------- # Test the built-in bm25() demo. # reset_db do_execsql_test 9.1 { CREATE VIRTUAL TABLE t1 USING fts5(a, b); INSERT INTO t1 VALUES('a', NULL); -- 1 INSERT INTO t1 VALUES('a', NULL); -- 2 INSERT INTO t1 VALUES('a', NULL); -- 3 INSERT INTO t1 VALUES('a', NULL); -- 4 INSERT INTO t1 VALUES('a', NULL); -- 5 INSERT INTO t1 VALUES('a', NULL); -- 6 INSERT INTO t1 VALUES('a', NULL); -- 7 INSERT INTO t1 VALUES('a', NULL); -- 8 INSERT INTO t1 VALUES(NULL, 'a a b'); -- 9 INSERT INTO t1 VALUES(NULL, 'b b a'); -- 10 } do_execsql_test 9.2 { SELECT rowid FROM t1('a AND b') ORDER BY rank; } { 10 9 } do_execsql_test 9.3 { SELECT rowid FROM t1('b:a AND b:b') ORDER BY rank; } { 9 10 } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5auxdata.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests focusing on the fts5 xSetAuxdata() and xGetAuxdata() APIs. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5auxdata # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE f1 USING fts5(a, b); INSERT INTO f1(rowid, a, b) VALUES(1, 'a', 'b1'); INSERT INTO f1(rowid, a, b) VALUES(2, 'a', 'b2'); INSERT INTO f1(rowid, a, b) VALUES(3, 'a', 'b3'); INSERT INTO f1(rowid, a, b) VALUES(4, 'a', 'b4'); INSERT INTO f1(rowid, a, b) VALUES(5, 'a', 'b5'); } proc aux_function_1 {cmd tn} { switch [$cmd xRowid] { 1 { do_test $tn.1 [list $cmd xGetAuxdata 0 ] {} $cmd xSetAuxdata "one" } 2 { do_test $tn.2 [list $cmd xGetAuxdata 0 ] {one} $cmd xSetAuxdata "two" } 3 { do_test $tn.3 [list $cmd xGetAuxdata 0 ] {two} } 4 { do_test $tn.4 [list $cmd xGetAuxdata 1 ] {two} } 5 { do_test $tn.5 [list $cmd xGetAuxdata 0 ] {} } } } sqlite3_fts5_create_function db aux_function_1 aux_function_1 db eval { SELECT aux_function_1(f1, 1) FROM f1 WHERE f1 MATCH 'a' ORDER BY rowid ASC } proc aux_function_2 {cmd tn inst} { if {$inst == "A"} { switch [$cmd xRowid] { 1 { do_test $tn.1.$inst [list $cmd xGetAuxdata 0 ] {} $cmd xSetAuxdata "one $inst" } 2 { do_test $tn.2.$inst [list $cmd xGetAuxdata 0 ] "one $inst" $cmd xSetAuxdata "two $inst" } 3 { do_test $tn.3.$inst [list $cmd xGetAuxdata 0 ] "two $inst" } 4 { do_test $tn.4.$inst [list $cmd xGetAuxdata 1 ] "two $inst" } 5 { do_test $tn.5.$inst [list $cmd xGetAuxdata 0 ] {} } } } else { switch [$cmd xRowid] { 1 { do_test $tn.1.$inst [list $cmd xGetAuxdata 0 ] "one A" } 2 { do_test $tn.2.$inst [list $cmd xGetAuxdata 0 ] "two A" } 3 { do_test $tn.3.$inst [list $cmd xGetAuxdata 0 ] "two A" } 4 { do_test $tn.4.$inst [list $cmd xGetAuxdata 0 ] {} } 5 { do_test $tn.5.$inst [list $cmd xGetAuxdata 0 ] {} } } } } sqlite3_fts5_create_function db aux_function_2 aux_function_2 db eval { SELECT aux_function_2(f1, 2, 'A'), aux_function_2(f1, 2, 'B') FROM f1 WHERE f1 MATCH 'a' ORDER BY rowid ASC } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5bigpl.test ================================================ # 2015 April 21 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # This test is focused on really large position lists. Those that require # 4 or 5 byte position-list size varints. Because of the amount of memory # required, these tests only run on 64-bit platforms. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5bigpl # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } if { $tcl_platform(wordSize)<8 } { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(x) } do_test 1.1 { foreach t {a b c d e f g h i j} { set doc [string repeat "$t " 1200000] execsql { INSERT INTO t1 VALUES($doc) } } execsql { INSERT INTO t1(t1) VALUES('integrity-check') } } {} do_test 1.2 { execsql { DELETE FROM t1 } foreach t {"a b" "b a" "c d" "d c"} { set doc [string repeat "$t " 600000] execsql { INSERT INTO t1 VALUES($doc) } } execsql { INSERT INTO t1(t1) VALUES('integrity-check') } } {} # 5-byte varint. This test takes 30 seconds or so on a 2014 workstation. # The generated database is roughly 635MiB. # do_test 2.1...slow { execsql { DELETE FROM t1 } foreach t {a} { set doc [string repeat "$t " 150000000] execsql { INSERT INTO t1 VALUES($doc) } } execsql { INSERT INTO t1(t1) VALUES('integrity-check') } } {} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5bigtok.test ================================================ # 2016 Jan 19 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5bigtok return_if_no_fts5 proc rndterm {} { set L [list a b c d e f g h i j k l m n o p q r s t u v w x y z] set l [lindex $L [expr int(rand() * [llength $L])]] string repeat $l [expr int(rand() * 5) + 60] } proc rnddoc {n} { set res [list] for {set i 0} {$i < $n} {incr i} { lappend res [rndterm] } set res } foreach_detail_mode $::testprefix { db func rnddoc rnddoc do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(x, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); CREATE VIRTUAL TABLE t1vocab USING fts5vocab(t1, row); WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<10 ) INSERT INTO t1 SELECT rnddoc(3) FROM s; WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<10 ) INSERT INTO t1 SELECT rnddoc(3) FROM s; } foreach v [db eval {SELECT term FROM t1vocab}] { set res [db eval {SELECT rowid FROM t1($v)}] do_execsql_test 1.[string range $v 0 0] { SELECT rowid FROM t1($v) ORDER BY rowid DESC } [lsort -integer -decr $res] } do_execsql_test 2.0 { INSERT INTO t1(t1) VALUES('optimize'); } foreach v [db eval {SELECT term FROM t1vocab}] { set res [db eval {SELECT rowid FROM t1($v)}] do_execsql_test 2.[string range $v 0 0] { SELECT rowid FROM t1($v) ORDER BY rowid DESC } [lsort -integer -decr $res] } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5colset.test ================================================ # 2016 August 10 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5colset # If SQLITE_ENABLE_FTS5 is not defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $::testprefix { if {[detail_is_none]} continue do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, c, d, detail=%DETAIL%); INSERT INTO t1 VALUES('a', 'b', 'c', 'd'); -- 1 INSERT INTO t1 VALUES('d', 'a', 'b', 'c'); -- 2 INSERT INTO t1 VALUES('c', 'd', 'a', 'b'); -- 3 INSERT INTO t1 VALUES('b', 'c', 'd', 'a'); -- 4 } foreach {tn q res} { 1 "a" {1 2 3 4} 2 "{a} : a" {1} 3 "-{a} : a" {2 3 4} 4 "- {a c} : a" {2 4} 5 " - {d d c} : a" {1 2} 6 "- {d c b a} : a" {} 7 "-{\"a\"} : b" {1 2 3} 8 "- c : a" {1 2 4} 9 "-c : a" {1 2 4} 10 "-\"c\" : a" {1 2 4} } { do_execsql_test 1.$tn { SELECT rowid FROM t1($q) } $res } foreach {tn q res} { 0 {{a} : (a AND ":")} {} 1 "{a b c} : (a AND d)" {2 3} 2 "{a b c} : (a AND b:d)" {3} 3 "{a b c} : (a AND d:d)" {} 4 "{b} : ( {b a} : ( {c b a} : ( {d b c a} : ( d OR c ) ) ) )" {3 4} 5 "{a} : ( {b a} : ( {c b a} : ( {d b c a} : ( d OR c ) ) ) )" {2 3} 6 "{a} : ( {b a} : ( {c b} : ( {d b c a} : ( d OR c ) ) ) )" {} 7 "{a b c} : (b:a AND c:b)" {2} } { do_execsql_test 2.$tn { SELECT rowid FROM t1($q) } $res } foreach {tn w res} { 0 "a MATCH 'a'" {1} 1 "b MATCH 'a'" {2} 2 "b MATCH '{a b c} : a'" {2} 3 "b MATCH 'a OR b'" {1 2} 4 "b MATCH 'a OR a:b'" {2} 5 "b MATCH 'a OR b:b'" {1 2} } { do_execsql_test 3.$tn " SELECT rowid FROM t1 WHERE $w " $res } do_catchsql_test 4.1 { SELECT * FROM t1 WHERE rowid MATCH 'a' } {1 {unable to use function MATCH in the requested context}} } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5columnsize.test ================================================ # 2015 Jun 10 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests focusing on fts5 tables with the columnsize=0 option. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5columnsize # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } #------------------------------------------------------------------------- # Check that the option can be parsed and that the %_docsize table is # only created if it is set to true. # foreach {tn outcome stmt} { 1 0 { CREATE VIRTUAL TABLE t1 USING fts5(x, columnsize=0) } 2 1 { CREATE VIRTUAL TABLE t1 USING fts5(x, columnsize=1) } 3 0 { CREATE VIRTUAL TABLE t1 USING fts5(x, columnsize='0') } 4 1 { CREATE VIRTUAL TABLE t1 USING fts5(x, columnsize='1') } 5 2 { CREATE VIRTUAL TABLE t1 USING fts5(x, columnsize='') } 6 2 { CREATE VIRTUAL TABLE t1 USING fts5(x, columnsize=2) } 7 1 { CREATE VIRTUAL TABLE t1 USING fts5(x, columnsize=0, columnsize=1) } 8 1 { CREATE VIRTUAL TABLE t1 USING fts5(x) } 9 2 { CREATE VIRTUAL TABLE t1 USING fts5(x, columnsize=11) } } { execsql { DROP TABLE IF EXISTS t1; } if {$outcome==2} { do_catchsql_test 1.$tn.1 $stmt {1 {malformed columnsize=... directive}} } else { do_execsql_test 1.$tn.2 $stmt do_execsql_test 1.$tn.3 { SELECT count(*) FROM sqlite_master WHERE name = 't1_docsize' } $outcome } } #------------------------------------------------------------------------- # Run tests on a table with no %_content or %_docsize backing store. # do_execsql_test 2.0 { CREATE VIRTUAL TABLE t2 USING fts5(x, columnsize=0, content=''); } do_catchsql_test 2.1 { INSERT INTO t2 VALUES('a b c d e f'); } {1 {datatype mismatch}} do_execsql_test 2.2 { INSERT INTO t2(rowid, x) VALUES(1, 'c d e f'); INSERT INTO t2(rowid, x) VALUES(2, 'c d e f g h'); INSERT INTO t2(rowid, x) VALUES(3, 'a b c d e f g h'); } {} do_execsql_test 2.3 { SELECT rowid FROM t2 WHERE t2 MATCH 'b'; SELECT '::'; SELECT rowid FROM t2 WHERE t2 MATCH 'e'; SELECT '::'; SELECT rowid FROM t2 WHERE t2 MATCH 'h'; } {3 :: 1 2 3 :: 2 3} do_execsql_test 2.4 { INSERT INTO t2(t2, rowid, x) VALUES('delete', 2, 'c d e f g h'); SELECT rowid FROM t2 WHERE t2 MATCH 'b'; SELECT '::'; SELECT rowid FROM t2 WHERE t2 MATCH 'e'; SELECT '::'; SELECT rowid FROM t2 WHERE t2 MATCH 'h'; } {3 :: 1 3 :: 3} do_execsql_test 2.5 { INSERT INTO t2(t2) VALUES('delete-all'); SELECT rowid FROM t2 WHERE t2 MATCH 'b'; SELECT '::'; SELECT rowid FROM t2 WHERE t2 MATCH 'e'; SELECT '::'; SELECT rowid FROM t2 WHERE t2 MATCH 'h'; } {:: ::} do_execsql_test 2.6 { INSERT INTO t2(rowid, x) VALUES(1, 'o t t f'); INSERT INTO t2(rowid, x) VALUES(2, 'f s s e'); INSERT INTO t2(rowid, x) VALUES(3, 'n t e t'); } do_catchsql_test 2.7.1 { SELECT rowid FROM t2 } {1 {t2: table does not support scanning}} do_catchsql_test 2.7.2 { SELECT rowid FROM t2 WHERE rowid=2 } {1 {t2: table does not support scanning}} do_catchsql_test 2.7.3 { SELECT rowid FROM t2 WHERE rowid BETWEEN 1 AND 3 } {1 {t2: table does not support scanning}} do_execsql_test 2.X { DROP TABLE t2 } #------------------------------------------------------------------------- # Test the xColumnSize() API # fts5_aux_test_functions db do_execsql_test 3.1.0 { CREATE VIRTUAL TABLE t3 USING fts5(x, y UNINDEXED, z, columnsize=0); INSERT INTO t3 VALUES('a a', 'b b b', 'c'); INSERT INTO t3 VALUES('x a x', 'b b b y', ''); } do_execsql_test 3.1.1 { SELECT rowid, fts5_test_columnsize(t3) FROM t3 WHERE t3 MATCH 'a' } { 1 {2 0 1} 2 {3 0 0} } do_execsql_test 3.1.2 { INSERT INTO t3 VALUES(NULL, NULL, 'a a a a'); DELETE FROM t3 WHERE rowid = 1; SELECT rowid, fts5_test_columnsize(t3) FROM t3 WHERE t3 MATCH 'a' } { 2 {3 0 0} 3 {0 0 4} } do_execsql_test 3.2.0 { CREATE VIRTUAL TABLE t4 USING fts5(x, y UNINDEXED, z, columnsize=0, content=''); INSERT INTO t4(rowid, x, y, z) VALUES(1, 'a a', 'b b b', 'c'); INSERT INTO t4(rowid, x, y, z) VALUES(2, 'x a x', 'b b b y', ''); } do_execsql_test 3.2.1 { SELECT rowid, fts5_test_columnsize(t4) FROM t4 WHERE t4 MATCH 'a' } { 1 {-1 0 -1} 2 {-1 0 -1} } #------------------------------------------------------------------------- # Test the integrity-check # do_execsql_test 4.1.1 { CREATE VIRTUAL TABLE t5 USING fts5(x, columnsize=0); INSERT INTO t5 VALUES('1 2 3 4'); INSERT INTO t5 VALUES('2 4 6 8'); } do_execsql_test 4.1.2 { INSERT INTO t5(t5) VALUES('integrity-check'); } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5config.test ================================================ # 2015 Jan 13 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # This file focuses on the code in fts5_config.c, which is largely concerned # with parsing the various configuration and CREATE TABLE options. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5config # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } #------------------------------------------------------------------------- # Try different types of quote characters. # do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5('a', "b", [c], `d`); PRAGMA table_info = t1; } { 0 a {} 0 {} 0 1 b {} 0 {} 0 2 c {} 0 {} 0 3 d {} 0 {} 0 } #------------------------------------------------------------------------- # Syntax errors in the prefix= option. # foreach {tn opt} { 1 {prefix=x} 2 {prefix='x'} 3 {prefix='$'} 4 {prefix='1,2,'} 5 {prefix=',1'} 6 {prefix='1,2,3...'} 7 {prefix='1,2,3xyz'} } { set res [list 1 {malformed prefix=... directive}] do_catchsql_test 2.$tn "CREATE VIRTUAL TABLE f1 USING fts5(x, $opt)" $res } #------------------------------------------------------------------------- # Syntax errors in the 'rank' option. # foreach {tn val} { 1 "f1(xyz)" 2 "f1(zyx)" 3 "f1(nzz)" 4 "f1(x'!!')" 5 "f1(x':;')" 6 "f1(x'[]')" 7 "f1(x'{}')" 8 "f1('abc)" } { do_catchsql_test 3.$tn { INSERT INTO t1(t1, rank) VALUES('rank', $val); } {1 {SQL logic error}} } #------------------------------------------------------------------------- # The parsing of SQL literals specified as part of 'rank' options. # do_execsql_test 4.0 { CREATE VIRTUAL TABLE zzz USING fts5(one); INSERT INTO zzz VALUES('a b c'); } proc first {cmd A} { return $A } sqlite3_fts5_create_function db first first foreach {tn arg} { 1 "123" 2 "'01234567890ABCDEF'" 3 "x'0123'" 4 "x'ABCD'" 5 "x'0123456789ABCDEF'" 6 "x'0123456789abcdef'" 7 "22.5" 8 "-91.5" 9 "-.5" 10 "''''" 11 "+.5" } { set func [string map {' ''} "first($arg)"] do_execsql_test 4.1.$tn " INSERT INTO zzz(zzz, rank) VALUES('rank', '$func'); SELECT rank IS $arg FROM zzz WHERE zzz MATCH 'a + b + c' " 1 } do_execsql_test 4.2 { INSERT INTO zzz(zzz, rank) VALUES('rank', 'f1()'); } {} #------------------------------------------------------------------------- # Misquoting in tokenize= and other options. # do_catchsql_test 5.1 { CREATE VIRTUAL TABLE xx USING fts5(x, tokenize="porter 'ascii"); } {1 {parse error in tokenize directive}} do_catchsql_test 5.2 { CREATE VIRTUAL TABLE xx USING fts5(x, [y[]); } {0 {}} do_catchsql_test 5.3 { CREATE VIRTUAL TABLE yy USING fts5(x, [y]]); } {1 {unrecognized token: "]"}} #------------------------------------------------------------------------- # Errors in prefix= directives. # do_catchsql_test 6.2 { CREATE VIRTUAL TABLE abc USING fts5(a, prefix='1, 2, 1001'); } {1 {prefix length out of range (max 999)}} do_catchsql_test 6.3 { CREATE VIRTUAL TAbLE abc USING fts5(a, prefix='1, 2, 0000'); } {1 {prefix length out of range (max 999)}} do_catchsql_test 6.4 { CREATE VIRTUAL TABLE abc USING fts5(a, prefix='1 , 1000000'); } {1 {prefix length out of range (max 999)}} #------------------------------------------------------------------------- # Duplicate tokenize= and other options. # do_catchsql_test 7.1 { CREATE VIRTUAL TABLE abc USING fts5(a, tokenize=porter, tokenize=ascii); } {1 {multiple tokenize=... directives}} do_catchsql_test 7.2 { CREATE VIRTUAL TABLE abc USING fts5(a, content=porter, content=ascii); } {1 {multiple content=... directives}} do_catchsql_test 7.3 { CREATE VIRTUAL TABLE abc USING fts5(a, content_rowid=porter, content_rowid=a); } {1 {multiple content_rowid=... directives}} #------------------------------------------------------------------------- # Unrecognized option. # do_catchsql_test 8.0 { CREATE VIRTUAL TABLE abc USING fts5(a, nosuchoption=123); } {1 {unrecognized option: "nosuchoption"}} do_catchsql_test 8.1 { CREATE VIRTUAL TABLE abc USING fts5(a, "nosuchoption"=123); } {1 {parse error in ""nosuchoption"=123"}} #------------------------------------------------------------------------- # Errors in: # # 9.1.* 'pgsz' options. # 9.2.* 'automerge' options. # 9.3.* 'crisismerge' options. # 9.4.* a non-existant option. # 9.5.* 'hashsize' options. # do_execsql_test 9.0 { CREATE VIRTUAL TABLE abc USING fts5(a, b); } {} do_catchsql_test 9.1.1 { INSERT INTO abc(abc, rank) VALUES('pgsz', -5); } {1 {SQL logic error}} do_catchsql_test 9.1.2 { INSERT INTO abc(abc, rank) VALUES('pgsz', 50000000); } {1 {SQL logic error}} do_catchsql_test 9.1.3 { INSERT INTO abc(abc, rank) VALUES('pgsz', 66.67); } {1 {SQL logic error}} do_catchsql_test 9.2.1 { INSERT INTO abc(abc, rank) VALUES('automerge', -5); } {1 {SQL logic error}} do_catchsql_test 9.2.2 { INSERT INTO abc(abc, rank) VALUES('automerge', 50000000); } {1 {SQL logic error}} do_catchsql_test 9.2.3 { INSERT INTO abc(abc, rank) VALUES('automerge', 66.67); } {1 {SQL logic error}} do_execsql_test 9.2.4 { INSERT INTO abc(abc, rank) VALUES('automerge', 1); } {} do_catchsql_test 9.3.1 { INSERT INTO abc(abc, rank) VALUES('crisismerge', -5); } {1 {SQL logic error}} do_catchsql_test 9.3.2 { INSERT INTO abc(abc, rank) VALUES('crisismerge', 66.67); } {1 {SQL logic error}} do_execsql_test 9.3.3 { INSERT INTO abc(abc, rank) VALUES('crisismerge', 1); } {} do_execsql_test 9.3.4 { INSERT INTO abc(abc, rank) VALUES('crisismerge', 50000000); } {} do_catchsql_test 9.4.1 { INSERT INTO abc(abc, rank) VALUES('nosuchoption', 1); } {1 {SQL logic error}} do_catchsql_test 9.5.1 { INSERT INTO abc(abc, rank) VALUES('hashsize', 'not an integer'); } {1 {SQL logic error}} do_catchsql_test 9.5.2 { INSERT INTO abc(abc, rank) VALUES('hashsize', -500000); } {1 {SQL logic error}} do_catchsql_test 9.5.3 { INSERT INTO abc(abc, rank) VALUES('hashsize', 500000); } {0 {}} #------------------------------------------------------------------------- # Too many prefix indexes. Maximum allowed is 31. # foreach {tn spec} { 1 {prefix="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32"} 2 {prefix="1 2 3 4", prefix="5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32"} } { set sql "CREATE VIRTUAL TABLE xyz USING fts5(x, $spec)" do_catchsql_test 10.$tn $sql {1 {too many prefix indexes (max 31)}} } #------------------------------------------------------------------------- # errors in the detail= option. # foreach {tn opt} { 1 {detail=x} 2 {detail='x'} 3 {detail='$'} 4 {detail='1,2,'} 5 {detail=',1'} 6 {detail=''} } { set res [list 1 {malformed detail=... directive}] do_catchsql_test 11.$tn "CREATE VIRTUAL TABLE f1 USING fts5(x, $opt)" $res } do_catchsql_test 12.1 { INSERT INTO t1(t1, rank) VALUES('rank', NULL);; } {1 {SQL logic error}} #------------------------------------------------------------------------- # errors in the 'usermerge' option # do_execsql_test 13.0 { CREATE VIRTUAL TABLE tt USING fts5(ttt); } foreach {tn val} { 1 -1 2 4.2 3 17 4 1 } { set sql "INSERT INTO tt(tt, rank) VALUES('usermerge', $val)" do_catchsql_test 13.$tn $sql {1 {SQL logic error}} } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5conflict.test ================================================ # 2015 October 27 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5conflict # If SQLITE_ENABLE_FTS5 is not defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE TABLE t1(x INTEGER PRIMARY KEY, a, b); CREATE VIRTUAL TABLE ft USING fts5(a, b, content=t1, content_rowid=x); } do_execsql_test 1.1 { REPLACE INTO ft(rowid, a, b) VALUES(1, 'a b c', 'a b c'); REPLACE INTO t1 VALUES(1, 'a b c', 'a b c'); } do_execsql_test 1.2 { INSERT INTO ft(ft) VALUES('integrity-check'); } do_execsql_test 2.0 { CREATE TABLE tbl(a INTEGER PRIMARY KEY, b, c); CREATE VIRTUAL TABLE fts_idx USING fts5(b, c, content=tbl, content_rowid=a); CREATE TRIGGER tbl_ai AFTER INSERT ON tbl BEGIN INSERT INTO fts_idx(rowid, b, c) VALUES (new.a, new.b, new.c); END; CREATE TRIGGER tbl_ad AFTER DELETE ON tbl BEGIN INSERT INTO fts_idx(fts_idx, rowid, b, c) VALUES('delete', old.a, old.b, old.c); END; CREATE TRIGGER tbl_au AFTER UPDATE ON tbl BEGIN INSERT INTO fts_idx(fts_idx, rowid, b, c) VALUES('delete', old.a, old.b, old.c); INSERT INTO fts_idx(rowid, b, c) VALUES (new.a, new.b, new.c); END; } do_execsql_test 2.1 { PRAGMA recursive_triggers = 1; INSERT INTO tbl VALUES(1, 'x y z', '1 2 3'); INSERT INTO tbl VALUES(10, 'x y z', '1 2 3'); INSERT INTO tbl VALUES(100, 'x 1 z', '1 y 3'); UPDATE tbl SET b = '1 2 x' WHERE rowid=10; REPLACE INTO tbl VALUES(1, '4 5 6', '3 2 1'); DELETE FROM tbl WHERE a=100; INSERT INTO fts_idx(fts_idx) VALUES('integrity-check'); } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5connect.test ================================================ # 2017 August 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5connect ifcapable !fts5 { finish_test return } #------------------------------------------------------------------------- # The tests in this file test the outcome of a schema-reset happening # within the xConnect() method of an FTS5 table. At one point this # was causing a problem in SQLite. Each test proceeds as follows: # # 1. Connection [db] opens the db and reads from some unrelated, non-FTS5 # table causing SQLite to load the db schema into memory. # # 2. Connection [db2] opens the db and modifies the db schema. # # 3. Connection [db] reads or writes an existing fts5 table. That the # schema has been modified is detected inside the fts5 xConnect() # callback that is invoked by sqlite3_prepare(). # # 4. Verify that the statement in 3 has worked. SQLite should detect # that the schema has changed and successfully prepare the # statement against the new schema. # # Test plan: # # 1.*: Trigger the xConnect()/schema-reset using statements executed # directly against an FTS5 table. # # 2.*: Using various statements executed by various BEFORE triggers. # # 3.*: Using various statements executed by various AFTER triggers. # # 4.*: Using various statements executed by various INSTEAD OF triggers. # do_execsql_test 1.0 { CREATE VIRTUAL TABLE ft1 USING fts5(a, b); CREATE TABLE abc(x INTEGER PRIMARY KEY); CREATE TABLE t1(i INTEGER PRIMARY KEY, a, b); INSERT INTO ft1 VALUES('one', 'two'); INSERT INTO ft1 VALUES('three', 'four'); } foreach {tn sql res} { 1 "SELECT * FROM ft1" {one two three four} 2 "REPLACE INTO ft1(rowid, a, b) VALUES(1, 'five', 'six')" {} 3 "SELECT * FROM ft1" {five six three four} 4 "INSERT INTO ft1 VALUES('seven', 'eight')" {} 5 "SELECT * FROM ft1" {five six three four seven eight} 6 "DELETE FROM ft1 WHERE rowid=2" {} 7 "UPDATE ft1 SET b='nine' WHERE rowid=1" {} 8 "SELECT * FROM ft1" {five nine seven eight} } { catch { db close } catch { db2 close } sqlite3 db test.db sqlite3 db2 test.db do_test 1.$tn.1 { db eval { INSERT INTO abc DEFAULT VALUES } db2 eval { CREATE TABLE newtable(x,y); DROP TABLE newtable } } {} do_execsql_test 1.$tn.2 $sql $res do_execsql_test 1.$tn.3 { INSERT INTO ft1(ft1) VALUES('integrity-check'); } } do_execsql_test 2.0 { CREATE VIRTUAL TABLE ft2 USING fts5(a, b); CREATE TABLE t2(a, b); CREATE TABLE log(txt); CREATE TRIGGER t2_ai AFTER INSERT ON t2 BEGIN INSERT INTO ft2(rowid, a, b) VALUES(new.rowid, new.a, new.b); INSERT INTO log VALUES('insert'); END; CREATE TRIGGER t2_ad AFTER DELETE ON t2 BEGIN DELETE FROM ft2 WHERE rowid = old.rowid; INSERT INTO log VALUES('delete'); END; CREATE TRIGGER t2_au AFTER UPDATE ON t2 BEGIN UPDATE ft2 SET a=new.a, b=new.b WHERE rowid=new.rowid; INSERT INTO log VALUES('update'); END; INSERT INTO t2 VALUES('one', 'two'); INSERT INTO t2 VALUES('three', 'four'); } foreach {tn sql res} { 1 "SELECT * FROM t2" {one two three four} 2 "REPLACE INTO t2(rowid, a, b) VALUES(1, 'five', 'six')" {} 3 "SELECT * FROM ft2" {five six three four} 4 "INSERT INTO t2 VALUES('seven', 'eight')" {} 5 "SELECT * FROM ft2" {five six three four seven eight} 6 "DELETE FROM t2 WHERE rowid=2" {} 7 "UPDATE t2 SET b='nine' WHERE rowid=1" {} 8 "SELECT * FROM ft2" {five nine seven eight} } { catch { db close } catch { db2 close } sqlite3 db test.db sqlite3 db2 test.db do_test 2.$tn.1 { db eval { INSERT INTO abc DEFAULT VALUES } db2 eval { CREATE TABLE newtable(x,y); DROP TABLE newtable } } {} do_execsql_test 2.$tn.2 $sql $res do_execsql_test 2.$tn.3 { INSERT INTO ft2(ft2) VALUES('integrity-check'); } } do_execsql_test 3.0 { CREATE VIRTUAL TABLE ft3 USING fts5(a, b); CREATE TABLE t3(a, b); CREATE TRIGGER t3_ai BEFORE INSERT ON t3 BEGIN INSERT INTO ft3(rowid, a, b) VALUES(new.rowid, new.a, new.b); INSERT INTO log VALUES('insert'); END; CREATE TRIGGER t3_ad BEFORE DELETE ON t3 BEGIN DELETE FROM ft3 WHERE rowid = old.rowid; INSERT INTO log VALUES('delete'); END; CREATE TRIGGER t3_au BEFORE UPDATE ON t3 BEGIN UPDATE ft3 SET a=new.a, b=new.b WHERE rowid=new.rowid; INSERT INTO log VALUES('update'); END; INSERT INTO t3(rowid, a, b) VALUES(1, 'one', 'two'); INSERT INTO t3(rowid, a, b) VALUES(2, 'three', 'four'); } foreach {tn sql res} { 1 "SELECT * FROM t3" {one two three four} 2 "REPLACE INTO t3(rowid, a, b) VALUES(1, 'five', 'six')" {} 3 "SELECT * FROM ft3" {five six three four} 4 "INSERT INTO t3(rowid, a, b) VALUES(3, 'seven', 'eight')" {} 5 "SELECT * FROM ft3" {five six three four seven eight} 6 "DELETE FROM t3 WHERE rowid=2" {} 7 "UPDATE t3 SET b='nine' WHERE rowid=1" {} 8 "SELECT * FROM ft3" {five nine seven eight} } { catch { db close } catch { db2 close } sqlite3 db test.db sqlite3 db2 test.db do_test 3.$tn.1 { db eval { INSERT INTO abc DEFAULT VALUES } db2 eval { CREATE TABLE newtable(x,y); DROP TABLE newtable } } {} do_execsql_test 3.$tn.2 $sql $res do_execsql_test 3.$tn.3 { INSERT INTO ft3(ft3) VALUES('integrity-check'); } } do_execsql_test 4.0 { CREATE VIRTUAL TABLE ft4 USING fts5(a, b); CREATE VIEW v4 AS SELECT rowid, * FROM ft4; CREATE TRIGGER t4_ai INSTEAD OF INSERT ON v4 BEGIN INSERT INTO ft4(rowid, a, b) VALUES(new.rowid, new.a, new.b); INSERT INTO log VALUES('insert'); END; CREATE TRIGGER t4_ad INSTEAD OF DELETE ON v4 BEGIN DELETE FROM ft4 WHERE rowid = old.rowid; INSERT INTO log VALUES('delete'); END; CREATE TRIGGER t4_au INSTEAD OF UPDATE ON v4 BEGIN UPDATE ft4 SET a=new.a, b=new.b WHERE rowid=new.rowid; INSERT INTO log VALUES('update'); END; INSERT INTO ft4(rowid, a, b) VALUES(1, 'one', 'two'); INSERT INTO ft4(rowid, a, b) VALUES(2, 'three', 'four'); } foreach {tn sql res} { 1 "SELECT * FROM ft4" {one two three four} 2 "REPLACE INTO v4(rowid, a, b) VALUES(1, 'five', 'six')" {} 3 "SELECT * FROM ft4" {five six three four} 4 "INSERT INTO v4(rowid, a, b) VALUES(3, 'seven', 'eight')" {} 5 "SELECT * FROM ft4" {five six three four seven eight} 6 "DELETE FROM v4 WHERE rowid=2" {} 7 "UPDATE v4 SET b='nine' WHERE rowid=1" {} 8 "SELECT * FROM ft4" {five nine seven eight} } { catch { db close } catch { db2 close } sqlite3 db test.db sqlite3 db2 test.db do_test 4.$tn.1 { db eval { INSERT INTO abc DEFAULT VALUES } db2 eval { CREATE TABLE newtable(x,y); DROP TABLE newtable } } {} do_execsql_test 4.$tn.2 $sql $res do_execsql_test 4.$tn.3 { INSERT INTO ft3(ft3) VALUES('integrity-check'); } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5content.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # This file contains tests for the content= and content_rowid= options. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5content # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } #------------------------------------------------------------------------- # Contentless tables # do_execsql_test 1.1 { CREATE VIRTUAL TABLE f1 USING fts5(a, b, content=''); INSERT INTO f1(rowid, a, b) VALUES(1, 'one', 'o n e'); INSERT INTO f1(rowid, a, b) VALUES(2, 'two', 't w o'); INSERT INTO f1(rowid, a, b) VALUES(3, 'three', 't h r e e'); } do_execsql_test 1.2 { SELECT rowid FROM f1 WHERE f1 MATCH 'o'; } {1 2} do_execsql_test 1.3 { INSERT INTO f1(a, b) VALUES('four', 'f o u r'); SELECT rowid FROM f1 WHERE f1 MATCH 'o'; } {1 2 4} do_execsql_test 1.4 { SELECT rowid, a, b FROM f1 WHERE f1 MATCH 'o'; } {1 {} {} 2 {} {} 4 {} {}} do_execsql_test 1.5 { SELECT rowid, highlight(f1, 0, '[', ']') FROM f1 WHERE f1 MATCH 'o'; } {1 {} 2 {} 4 {}} do_execsql_test 1.6 { SELECT rowid, highlight(f1, 0, '[', ']') IS NULL FROM f1 WHERE f1 MATCH 'o'; } {1 1 2 1 4 1} do_execsql_test 1.7 { SELECT rowid, snippet(f1, -1, '[', ']', '...', 5) IS NULL FROM f1 WHERE f1 MATCH 'o'; } {1 1 2 1 4 1} do_execsql_test 1.8 { SELECT rowid, snippet(f1, 1, '[', ']', '...', 5) IS NULL FROM f1 WHERE f1 MATCH 'o'; } {1 1 2 1 4 1} do_execsql_test 1.9 { SELECT rowid FROM f1; } {1 2 3 4} do_execsql_test 1.10 { SELECT * FROM f1; } {{} {} {} {} {} {} {} {}} do_execsql_test 1.11 { SELECT rowid, a, b FROM f1 ORDER BY rowid ASC; } {1 {} {} 2 {} {} 3 {} {} 4 {} {}} do_execsql_test 1.12 { SELECT a IS NULL FROM f1; } {1 1 1 1} do_catchsql_test 1.13 { DELETE FROM f1 WHERE rowid = 2; } {1 {cannot DELETE from contentless fts5 table: f1}} do_catchsql_test 1.14 { UPDATE f1 SET a = 'a b c' WHERE rowid = 2; } {1 {cannot UPDATE contentless fts5 table: f1}} do_execsql_test 1.15 { INSERT INTO f1(f1, rowid, a, b) VALUES('delete', 2, 'two', 't w o'); } {} do_execsql_test 1.16 { SELECT rowid FROM f1 WHERE f1 MATCH 'o'; } {1 4} do_execsql_test 1.17 { SELECT rowid FROM f1; } {1 3 4} #------------------------------------------------------------------------- # External content tables # reset_db do_execsql_test 2.1 { -- Create a table. And an external content fts5 table to index it. CREATE TABLE tbl(a INTEGER PRIMARY KEY, b, c); CREATE VIRTUAL TABLE fts_idx USING fts5(b, c, content='tbl', content_rowid='a'); -- Triggers to keep the FTS index up to date. CREATE TRIGGER tbl_ai AFTER INSERT ON tbl BEGIN INSERT INTO fts_idx(rowid, b, c) VALUES (new.a, new.b, new.c); END; CREATE TRIGGER tbl_ad AFTER DELETE ON tbl BEGIN INSERT INTO fts_idx(fts_idx, rowid, b, c) VALUES('delete', old.a, old.b, old.c); END; CREATE TRIGGER tbl_au AFTER UPDATE ON tbl BEGIN INSERT INTO fts_idx(fts_idx, rowid, b, c) VALUES('delete', old.a, old.b, old.c); INSERT INTO fts_idx(rowid, b, c) VALUES (new.a, new.b, new.c); END; } do_execsql_test 2.2 { INSERT INTO tbl VALUES(1, 'one', 'o n e'); INSERT INTO tbl VALUES(NULL, 'two', 't w o'); INSERT INTO tbl VALUES(3, 'three', 't h r e e'); } do_execsql_test 2.3 { INSERT INTO fts_idx(fts_idx) VALUES('integrity-check'); } do_execsql_test 2.4 { DELETE FROM tbl WHERE rowid=2; INSERT INTO fts_idx(fts_idx) VALUES('integrity-check'); } do_execsql_test 2.5 { UPDATE tbl SET c = c || ' x y z'; INSERT INTO fts_idx(fts_idx) VALUES('integrity-check'); } do_execsql_test 2.6 { SELECT * FROM fts_idx WHERE fts_idx MATCH 't AND x'; } {three {t h r e e x y z}} do_execsql_test 2.7 { SELECT highlight(fts_idx, 1, '[', ']') FROM fts_idx WHERE fts_idx MATCH 't AND x'; } {{[t] h r e e [x] y z}} #------------------------------------------------------------------------- # Quick tests of the 'delete-all' command. # do_execsql_test 3.1 { CREATE VIRTUAL TABLE t3 USING fts5(x, content=''); INSERT INTO t3 VALUES('a b c'); INSERT INTO t3 VALUES('d e f'); } do_execsql_test 3.2 { SELECT count(*) FROM t3_docsize; SELECT count(*) FROM t3_data; } {2 4} do_execsql_test 3.3 { INSERT INTO t3(t3) VALUES('delete-all'); SELECT count(*) FROM t3_docsize; SELECT count(*) FROM t3_data; } {0 2} do_execsql_test 3.4 { INSERT INTO t3 VALUES('a b c'); INSERT INTO t3 VALUES('d e f'); SELECT rowid FROM t3 WHERE t3 MATCH 'e'; } {2} do_execsql_test 3.5 { SELECT rowid FROM t3 WHERE t3 MATCH 'c'; } {1} do_execsql_test 3.6 { SELECT count(*) FROM t3_docsize; SELECT count(*) FROM t3_data; } {2 4} do_execsql_test 3.7 { CREATE VIRTUAL TABLE t4 USING fts5(x); } {} do_catchsql_test 3.8 { INSERT INTO t4(t4) VALUES('delete-all'); } {1 {'delete-all' may only be used with a contentless or external content fts5 table}} #------------------------------------------------------------------------- # Test an external content table with a more interesting schema. # do_execsql_test 4.1 { CREATE TABLE x2(a, "key col" PRIMARY KEY, b, c) WITHOUT ROWID; INSERT INTO x2 VALUES('a b', 1, 'c d' , 'e f'); INSERT INTO x2 VALUES('x y', -40, 'z z' , 'y x'); CREATE VIRTUAL TABLE t2 USING fts5(a, c, content=x2, content_rowid='key col'); INSERT INTO t2(t2) VALUES('rebuild'); } do_execsql_test 4.2 { SELECT rowid FROM t2 } {-40 1} do_execsql_test 4.3 { SELECT rowid FROM t2 WHERE t2 MATCH 'c'} {} do_execsql_test 4.4 { SELECT rowid FROM t2 WHERE t2 MATCH 'a'} {1} do_execsql_test 4.5 { SELECT rowid FROM t2 WHERE t2 MATCH 'x'} {-40} do_execsql_test 4.6 { INSERT INTO t2(t2) VALUES('integrity-check') } {} do_execsql_test 4.7 { DELETE FROM x2 WHERE "key col" = 1; INSERT INTO t2(t2, rowid, a, c) VALUES('delete', 1, 'a b', 'e f'); INSERT INTO t2(t2) VALUES('integrity-check'); } do_execsql_test 4.8 { SELECT rowid FROM t2 WHERE t2 MATCH 'b'} {} do_execsql_test 4.9 { SELECT rowid FROM t2 WHERE t2 MATCH 'y'} {-40} #------------------------------------------------------------------------- # Test that if the 'rowid' field of a 'delete' is not an integer, no # changes are made to the FTS index. # do_execsql_test 5.0 { CREATE VIRTUAL TABLE t5 USING fts5(a, b, content=); INSERT INTO t5(rowid, a, b) VALUES(-1, 'one', 'two'); INSERT INTO t5(rowid, a, b) VALUES( 0, 'three', 'four'); INSERT INTO t5(rowid, a, b) VALUES( 1, 'five', 'six'); } set ::checksum [execsql {SELECT md5sum(id, block) FROM t5_data}] do_execsql_test 5.1 { INSERT INTO t5(t5, rowid, a, b) VALUES('delete', NULL, 'three', 'four'); SELECT md5sum(id, block) FROM t5_data; } $::checksum #------------------------------------------------------------------------- # Check that a contentless table can be dropped. # reset_db do_execsql_test 6.1 { CREATE VIRTUAL TABLE xx USING fts5(x, y, content=""); SELECT name FROM sqlite_master; } {xx xx_data xx_idx xx_docsize xx_config} do_execsql_test 6.2 { DROP TABLE xx; SELECT name FROM sqlite_master; } {} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5corrupt.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # This file tests that the FTS5 'integrity-check' command detects # inconsistencies (corruption) in the on-disk backing tables. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5corrupt # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(x); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } do_test 1.1 { db transaction { for {set i 1} {$i < 200} {incr i} { set doc [list [string repeat x $i] [string repeat y $i]] execsql { INSERT INTO t1(rowid, x) VALUES($i, $doc) } } } fts5_level_segs t1 } {1} db_save do_execsql_test 1.2 { INSERT INTO t1(t1) VALUES('integrity-check') } set segid [lindex [fts5_level_segids t1] 0] do_test 1.3 { execsql { DELETE FROM t1_data WHERE rowid = fts5_rowid('segment', $segid, 4); } catchsql { INSERT INTO t1(t1) VALUES('integrity-check') } } {1 {database disk image is malformed}} do_test 1.4 { db_restore_and_reopen execsql { UPDATE t1_data set block = X'00000000' || substr(block, 5) WHERE rowid = fts5_rowid('segment', $segid, 4); } catchsql { INSERT INTO t1(t1) VALUES('integrity-check') } } {1 {database disk image is malformed}} db_restore_and_reopen #db eval {SELECT rowid, fts5_decode(rowid, block) aS r FROM t1_data} {puts $r} #-------------------------------------------------------------------- # do_execsql_test 2.0 { CREATE VIRTUAL TABLE t2 USING fts5(x); INSERT INTO t2(t2, rank) VALUES('pgsz', 64); } db func rnddoc fts5_rnddoc do_test 2.1 { for {set i 0} {$i < 500} {incr i} { execsql { INSERT INTO t2 VALUES(rnddoc(50)) } } execsql { INSERT INTO t2(t2) VALUES('integrity-check') } } {} #-------------------------------------------------------------------- # A mundane test - missing row in the %_content table. # do_execsql_test 3.0 { CREATE VIRTUAL TABLE t3 USING fts5(x); INSERT INTO t3 VALUES('one o'); INSERT INTO t3 VALUES('two e'); INSERT INTO t3 VALUES('three o'); INSERT INTO t3 VALUES('four e'); INSERT INTO t3 VALUES('five o'); } do_execsql_test 3.1 { SELECT * FROM t3 WHERE t3 MATCH 'o' } {{one o} {three o} {five o}} do_catchsql_test 3.1 { DELETE FROM t3_content WHERE rowid = 3; SELECT * FROM t3 WHERE t3 MATCH 'o'; } {1 {database disk image is malformed}} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5corrupt2.test ================================================ # 2015 Apr 24 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # This file tests that FTS5 handles corrupt databases (i.e. internal # inconsistencies in the backing tables) correctly. In this case # "correctly" means without crashing. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5corrupt2 # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } sqlite3_fts5_may_be_corrupt 1 # Create a simple FTS5 table containing 100 documents. Each document # contains 10 terms, each of which start with the character "x". # expr srand(0) db func rnddoc fts5_rnddoc do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(x); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); WITH ii(i) AS (SELECT 1 UNION SELECT i+1 FROM ii WHERE i<100) INSERT INTO t1 SELECT rnddoc(10) FROM ii; } set mask [expr 31 << 31] if 0 { # Test 1: # # For each page in the t1_data table, open a transaction and DELETE # the t1_data entry. Then run: # # * an integrity-check, and # * unless the deleted block was a b-tree node, a query for "t1 MATCH 'x*'" # # and check that the corruption is detected in both cases. The # rollback the transaction. # # Test 2: # # Same thing, except instead of deleting a row from t1_data, replace its # blob content with integer value 14. # foreach {tno stmt} { 1 { DELETE FROM t1_data WHERE rowid=$rowid } 2 { UPDATE t1_data SET block=14 WHERE rowid=$rowid } } { set tn 0 foreach rowid [db eval {SELECT rowid FROM t1_data WHERE rowid>10}] { incr tn #if {$tn!=224} continue do_test 1.$tno.$tn.1.$rowid { execsql { BEGIN } execsql $stmt catchsql { INSERT INTO t1(t1) VALUES('integrity-check') } } {1 {database disk image is malformed}} if {($rowid & $mask)==0} { # Node is a leaf node, not a b-tree node. do_catchsql_test 1.$tno.$tn.2.$rowid { SELECT rowid FROM t1 WHERE t1 MATCH 'x*' } {1 {database disk image is malformed}} } do_execsql_test 1.$tno.$tn.3.$rowid { ROLLBACK; INSERT INTO t1(t1) VALUES('integrity-check'); } {} } } } # Using the same database as the 1.* tests. # # Run N-1 tests, where N is the number of bytes in the rightmost leaf page # of the fts index. For test $i, truncate the rightmost leafpage to $i # bytes. Then test both the integrity-check detects the corruption. # # Also tested is that "MATCH 'x*'" does not crash and sometimes reports # corruption. It may not report the db as corrupt because truncating the # final leaf to some sizes may create a valid leaf page. # set lrowid [db one {SELECT max(rowid) FROM t1_data WHERE (rowid & $mask)=0}] set nbyte [db one {SELECT length(block) FROM t1_data WHERE rowid=$lrowid}] set all [db eval {SELECT rowid FROM t1}] for {set i [expr $nbyte-2]} {$i>=0} {incr i -1} { do_execsql_test 2.$i.1 { BEGIN; UPDATE t1_data SET block = substr(block, 1, $i) WHERE rowid=$lrowid; } do_catchsql_test 2.$i.2 { INSERT INTO t1(t1) VALUES('integrity-check'); } {1 {database disk image is malformed}} do_test 2.$i.3 { set res [catchsql {SELECT rowid FROM t1 WHERE t1 MATCH 'x*'}] expr { $res=="1 {database disk image is malformed}" || $res=="0 {$all}" } } 1 do_execsql_test 2.$i.4 { ROLLBACK; INSERT INTO t1(t1) VALUES('integrity-check'); } {} } #------------------------------------------------------------------------- # Test that corruption in leaf page headers is detected by queries that use # doclist-indexes. # set doc "A B C D E F G H I J " do_execsql_test 3.0 { CREATE VIRTUAL TABLE x3 USING fts5(tt); INSERT INTO x3(x3, rank) VALUES('pgsz', 32); WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<1000) INSERT INTO x3 SELECT ($doc || CASE WHEN (i%50)==0 THEN 'X' ELSE 'Y' END) FROM ii; } foreach {tn hdr} { 1 "\x00\x00\x00\x00" 2 "\xFF\xFF\xFF\xFF" 3 "\x44\x45" } { set tn2 0 set nCorrupt 0 set nCorrupt2 0 foreach rowid [db eval {SELECT rowid FROM x3_data WHERE rowid>10}] { if {$rowid & $mask} continue incr tn2 do_test 3.$tn.$tn2.1 { execsql BEGIN set fd [db incrblob main x3_data block $rowid] fconfigure $fd -encoding binary -translation binary set existing [read $fd [string length $hdr]] seek $fd 0 puts -nonewline $fd $hdr close $fd set res [catchsql {SELECT rowid FROM x3 WHERE x3 MATCH 'x AND a'}] if {$res == "1 {database disk image is malformed}"} {incr nCorrupt} set {} 1 } {1} if {($tn2 % 10)==0 && $existing != $hdr} { do_test 3.$tn.$tn2.2 { catchsql { INSERT INTO x3(x3) VALUES('integrity-check') } } {1 {database disk image is malformed}} } execsql ROLLBACK } do_test 3.$tn.x { expr $nCorrupt>0 } 1 } #-------------------------------------------------------------------- # set doc "A B C D E F G H I J " do_execsql_test 4.0 { CREATE VIRTUAL TABLE x4 USING fts5(tt); INSERT INTO x4(x4, rank) VALUES('pgsz', 32); WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<10) INSERT INTO x4 SELECT ($doc || CASE WHEN (i%50)==0 THEN 'X' ELSE 'Y' END) FROM ii; } foreach {tn nCut} { 1 1 2 10 } { set tn2 0 set nCorrupt 0 foreach rowid [db eval {SELECT rowid FROM x4_data WHERE rowid>10}] { if {$rowid & $mask} continue incr tn2 do_test 4.$tn.$tn2 { execsql { BEGIN; UPDATE x4_data SET block = substr(block, 1, length(block)-$nCut) WHERE id = $rowid; } set res [catchsql { SELECT rowid FROM x4 WHERE x4 MATCH 'a' ORDER BY 1 DESC }] if {$res == "1 {database disk image is malformed}"} {incr nCorrupt} set {} 1 } {1} execsql ROLLBACK } # do_test 4.$tn.x { expr $nCorrupt>0 } 1 } set doc [string repeat "A B C " 1000] do_execsql_test 5.0 { CREATE VIRTUAL TABLE x5 USING fts5(tt); INSERT INTO x5(x5, rank) VALUES('pgsz', 32); WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<10) INSERT INTO x5 SELECT $doc FROM ii; } foreach {tn hdr} { 1 "\x00\x01" } { set tn2 0 set nCorrupt 0 foreach rowid [db eval {SELECT rowid FROM x5_data WHERE rowid>10}] { if {$rowid & $mask} continue incr tn2 do_test 5.$tn.$tn2 { execsql BEGIN set fd [db incrblob main x5_data block $rowid] fconfigure $fd -encoding binary -translation binary puts -nonewline $fd $hdr close $fd catchsql { INSERT INTO x5(x5) VALUES('integrity-check') } set {} {} } {} execsql ROLLBACK } } #-------------------------------------------------------------------- reset_db do_execsql_test 6.1 { CREATE VIRTUAL TABLE x5 USING fts5(tt); INSERT INTO x5 VALUES('a'); INSERT INTO x5 VALUES('a a'); INSERT INTO x5 VALUES('a a a'); INSERT INTO x5 VALUES('a a a a'); UPDATE x5_docsize SET sz = X'' WHERE id=3; } proc colsize {cmd i} { $cmd xColumnSize $i } sqlite3_fts5_create_function db colsize colsize do_catchsql_test 6.2 { SELECT colsize(x5, 0) FROM x5 WHERE x5 MATCH 'a' } {1 SQLITE_CORRUPT_VTAB} sqlite3_fts5_may_be_corrupt 0 finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5corrupt3.test ================================================ # 2015 Apr 24 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # This file tests that FTS5 handles corrupt databases (i.e. internal # inconsistencies in the backing tables) correctly. In this case # "correctly" means without crashing. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5corrupt3 # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } sqlite3_fts5_may_be_corrupt 1 proc create_t1 {} { expr srand(0) db func rnddoc fts5_rnddoc db eval { CREATE VIRTUAL TABLE t1 USING fts5(x); INSERT INTO t1(t1, rank) VALUES('pgsz', 64); WITH ii(i) AS (SELECT 1 UNION SELECT i+1 FROM ii WHERE i<100) INSERT INTO t1 SELECT rnddoc(10) FROM ii; } } if 1 { # Create a simple FTS5 table containing 100 documents. Each document # contains 10 terms, each of which start with the character "x". # do_test 1.0 { create_t1 } {} do_test 1.1 { # Pick out the rowid of the right-most b-tree leaf in the new segment. set rowid [db one { SELECT max(rowid) FROM t1_data WHERE ((rowid>>31) & 0x0F)==1 }] set L [db one {SELECT length(block) FROM t1_data WHERE rowid = $rowid}] set {} {} } {} for {set i 0} {$i < $L} {incr i} { do_test 1.2.$i { catchsql { BEGIN; UPDATE t1_data SET block = substr(block, 1, $i) WHERE id = $rowid; INSERT INTO t1(t1) VALUES('integrity-check'); } } {1 {database disk image is malformed}} catchsql ROLLBACK } #------------------------------------------------------------------------- # Test that trailing bytes appended to the averages record are ignored. # do_execsql_test 2.1 { CREATE VIRTUAL TABLE t2 USING fts5(x); INSERT INTO t2 VALUES(rnddoc(10)); INSERT INTO t2 VALUES(rnddoc(10)); SELECT length(block) FROM t2_data WHERE id=1; } {2} do_execsql_test 2.2 { UPDATE t2_data SET block = block || 'abcd' WHERE id=1; SELECT length(block) FROM t2_data WHERE id=1; } {6} do_execsql_test 2.2 { INSERT INTO t2 VALUES(rnddoc(10)); SELECT length(block) FROM t2_data WHERE id=1; } {2} #------------------------------------------------------------------------- # Test that missing leaf pages are recognized as corruption. # reset_db do_test 3.0 { create_t1 } {} do_execsql_test 3.1 { SELECT count(*) FROM t1_data; } {105} proc do_3_test {tn} { set i 0 foreach ::rowid [db eval "SELECT rowid FROM t1_data WHERE rowid>100"] { incr i do_test $tn.$i { db eval BEGIN db eval {DELETE FROM t1_data WHERE rowid = $::rowid} list [ catch { db eval {SELECT rowid FROM t1 WHERE t1 MATCH 'x*'} } msg ] $msg } {1 {database disk image is malformed}} catch { db eval ROLLBACK } } } do_3_test 3.2 do_execsql_test 3.3 { INSERT INTO t1(t1, rank) VALUES('pgsz', 32); INSERT INTO t1 SELECT x FROM t1; INSERT INTO t1(t1) VALUES('optimize'); } {} do_3_test 3.4 do_test 3.5 { execsql { DELETE FROM t1; INSERT INTO t1(t1, rank) VALUES('pgsz', 40); } for {set i 0} {$i < 1000} {incr i} { set rnd [expr int(rand() * 1000)] set doc [string repeat "x$rnd " [expr int(rand() * 3) + 1]] execsql { INSERT INTO t1(rowid, x) VALUES($i, $doc) } } } {} do_3_test 3.6 do_test 3.7 { execsql { INSERT INTO t1(t1, rank) VALUES('pgsz', 40); INSERT INTO t1 SELECT x FROM t1; INSERT INTO t1(t1) VALUES('optimize'); } } {} do_3_test 3.8 do_test 3.9 { execsql { DELETE FROM t1; INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } for {set i 0} {$i < 100} {incr i} { set rnd [expr int(rand() * 100)] set doc "x[string repeat $rnd 20]" execsql { INSERT INTO t1(rowid, x) VALUES($i, $doc) } } } {} do_3_test 3.10 #------------------------------------------------------------------------- # Test that segments that end unexpectedly are identified as corruption. # reset_db do_test 4.0 { execsql { CREATE VIRTUAL TABLE t1 USING fts5(x); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } for {set i 0} {$i < 100} {incr i} { set rnd [expr int(rand() * 100)] set doc "x[string repeat $rnd 20]" execsql { INSERT INTO t1(rowid, x) VALUES($i, $doc) } } execsql { INSERT INTO t1(t1) VALUES('optimize') } } {} set nErr 0 for {set i 1} {1} {incr i} { set struct [db one {SELECT block FROM t1_data WHERE id=10}] binary scan $struct c* var set end [lindex $var end] if {$end<=$i} break lset var end [expr $end - $i] set struct [binary format c* $var] db close sqlite3 db test.db db eval { BEGIN; UPDATE t1_data SET block = $struct WHERE id=10; } do_test 4.1.$i { incr nErr [catch { db eval { SELECT rowid FROM t1 WHERE t1 MATCH 'x*' } }] set {} {} } {} catch { db eval ROLLBACK } } do_test 4.1.x { expr $nErr>45 } 1 #------------------------------------------------------------------------- # # The first argument passed to this command must be a binary blob # containing an FTS5 leaf page. This command returns a copy of this # blob, with the pgidx of the leaf page replaced by a single varint # containing value $iVal. # proc rewrite_pgidx {blob iVal} { binary scan $blob SS off1 szLeaf if {$iVal<0 || $iVal>=128} { error "$iVal out of range!" } else { set pgidx [binary format c $iVal] } binary format a${szLeaf}a* $blob $pgidx } reset_db do_execsql_test 5.1 { CREATE VIRTUAL TABLE x1 USING fts5(x); INSERT INTO x1(x1, rank) VALUES('pgsz', 40); BEGIN; INSERT INTO x1 VALUES('xaaa xabb xccc xcdd xeee xeff xggg xghh xiii xijj'); INSERT INTO x1 SELECT x FROM x1; INSERT INTO x1 SELECT x FROM x1; INSERT INTO x1 SELECT x FROM x1; INSERT INTO x1 SELECT x FROM x1; INSERT INTO x1(x1) VALUES('optimize'); COMMIT; } #db eval { SELECT fts5_decode(id, block) b from x1_data } { puts $b } # db func rewrite_pgidx rewrite_pgidx set i 0 foreach rowid [db eval {SELECT rowid FROM x1_data WHERE rowid>100}] { foreach val {2 100} { do_test 5.2.$val.[incr i] { catchsql { BEGIN; UPDATE x1_data SET block=rewrite_pgidx(block, $val) WHERE id=$rowid; SELECT rowid FROM x1 WHERE x1 MATCH 'xa*'; SELECT rowid FROM x1 WHERE x1 MATCH 'xb*'; SELECT rowid FROM x1 WHERE x1 MATCH 'xc*'; SELECT rowid FROM x1 WHERE x1 MATCH 'xd*'; SELECT rowid FROM x1 WHERE x1 MATCH 'xe*'; SELECT rowid FROM x1 WHERE x1 MATCH 'xf*'; SELECT rowid FROM x1 WHERE x1 MATCH 'xg*'; SELECT rowid FROM x1 WHERE x1 MATCH 'xh*'; SELECT rowid FROM x1 WHERE x1 MATCH 'xi*'; } set {} {} } {} catch { db eval ROLLBACK } } } #------------------------------------------------------------------------ # reset_db do_execsql_test 6.1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a); INSERT INTO t1 VALUES('bbbbb ccccc'); SELECT quote(block) FROM t1_data WHERE rowid>100; } {X'000000180630626262626201020201056363636363010203040A'} do_execsql_test 6.1.1 { UPDATE t1_data SET block = X'000000180630626262626201020201056161616161010203040A' WHERE rowid>100; } do_catchsql_test 6.1.2 { INSERT INTO t1(t1) VALUES('integrity-check'); } {1 {database disk image is malformed}} #------- reset_db do_execsql_test 6.2.0 { CREATE VIRTUAL TABLE t1 USING fts5(a); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); INSERT INTO t1 VALUES('aa bb cc dd ee'); SELECT pgno, quote(term) FROM t1_idx; } {2 X'' 4 X'3064'} do_execsql_test 6.2.1 { UPDATE t1_idx SET term = X'3065' WHERE pgno=4; } do_catchsql_test 6.2.2 { INSERT INTO t1(t1) VALUES('integrity-check'); } {1 {database disk image is malformed}} #------- reset_db do_execsql_test 6.3.0 { CREATE VIRTUAL TABLE t1 USING fts5(a); INSERT INTO t1 VALUES('abc abcdef abcdefghi'); SELECT quote(block) FROM t1_data WHERE id>100; } {X'0000001C043061626301020204036465660102030703676869010204040808'} do_execsql_test 6.3.1 { BEGIN; UPDATE t1_data SET block = X'0000001C043061626301020204036465660102035003676869010204040808' ------------------------------------------^^--------------------- WHERE id>100; } do_catchsql_test 6.3.2 { INSERT INTO t1(t1) VALUES('integrity-check'); } {1 {database disk image is malformed}} do_execsql_test 6.3.3 { ROLLBACK; BEGIN; UPDATE t1_data SET block = X'0000001C043061626301020204036465660102030750676869010204040808' --------------------------------------------^^------------------- WHERE id>100; } do_catchsql_test 6.3.3 { INSERT INTO t1(t1) VALUES('integrity-check'); } {1 {database disk image is malformed}} do_execsql_test 6.3.4 { ROLLBACK; BEGIN; UPDATE t1_data SET block = X'0000001C043061626301020204036465660102030707676869010204040850' --------------------------------------------------------------^^- WHERE id>100; } do_catchsql_test 6.3.5 { INSERT INTO t1(t1) VALUES('integrity-check'); } {1 {database disk image is malformed}} do_execsql_test 6.3.6 { ROLLBACK; BEGIN; UPDATE t1_data SET block = X'0000001C503061626301020204036465660102030707676869010204040808' ----------^^----------------------------------------------------- WHERE id>100; } do_catchsql_test 6.3.5 { INSERT INTO t1(t1) VALUES('integrity-check'); } {1 {database disk image is malformed}} #------------------------------------------------------------------------ # reset_db proc rnddoc {n} { set map [list a b c d] set doc [list] for {set i 0} {$i < $n} {incr i} { lappend doc "x[lindex $map [expr int(rand()*4)]]" } set doc } db func rnddoc rnddoc do_test 7.0 { execsql { CREATE VIRTUAL TABLE t5 USING fts5(x); INSERT INTO t5 VALUES( rnddoc(10000) ); INSERT INTO t5 VALUES( rnddoc(10000) ); INSERT INTO t5 VALUES( rnddoc(10000) ); INSERT INTO t5 VALUES( rnddoc(10000) ); INSERT INTO t5(t5) VALUES('optimize'); } } {} do_test 7.1 { foreach i [db eval { SELECT rowid FROM t5_data WHERE rowid>100 }] { db eval BEGIN db eval {DELETE FROM t5_data WHERE rowid = $i} set r [catchsql { INSERT INTO t5(t5) VALUES('integrity-check')} ] if {$r != "1 {database disk image is malformed}"} { error $r } db eval ROLLBACK } } {} } #------------------------------------------------------------------------ # Corruption within the structure record. # reset_db do_execsql_test 8.1 { CREATE VIRTUAL TABLE t1 USING fts5(x, y); INSERT INTO t1 VALUES('one', 'two'); } do_test 9.1.1 { set blob "12345678" ;# cookie append blob "0105" ;# 1 level, total of 5 segments append blob "06" ;# write counter append blob "0002" ;# first level has 0 segments merging, 2 other. append blob "450108" ;# first segment execsql "REPLACE INTO t1_data VALUES(10, X'$blob')" } {} do_catchsql_test 9.1.2 { SELECT * FROM t1('one AND two'); } {1 {database disk image is malformed}} do_test 9.2.1 { set blob "12345678" ;# cookie append blob "0205" ;# 2 levels, total of 5 segments append blob "06" ;# write counter append blob "0001" ;# first level has 0 segments merging, 1 other. append blob "450108" ;# first segment execsql "REPLACE INTO t1_data VALUES(10, X'$blob')" } {} do_catchsql_test 9.2.2 { SELECT * FROM t1('one AND two'); } {1 {database disk image is malformed}} sqlite3_fts5_may_be_corrupt 0 finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5delete.test ================================================ # 2017 May 12 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5delete # If SQLITE_ENABLE_FTS5 is not defined, omit this file. ifcapable !fts5 { finish_test return } fts5_aux_test_functions db do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(x); WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<5000 ) INSERT INTO t1(rowid, x) SELECT i, (i/2)*2 FROM s; } do_test 1.1 { execsql BEGIN for {set i 1} {$i<=5000} {incr i} { if {$i % 2} { execsql { INSERT INTO t1 VALUES($i) } } else { execsql { DELETE FROM t1 WHERE rowid = $i } } } execsql COMMIT } {} do_test 1.2 { execsql { INSERT INTO t1(t1, rank) VALUES('usermerge', 2); } for {set i 0} {$i < 5} {incr i} { execsql { INSERT INTO t1(t1, rank) VALUES('merge', 1) } execsql { INSERT INTO t1(t1) VALUES('integrity-check') } } } {} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5detail.test ================================================ # 2015 December 18 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5detail # If SQLITE_ENABLE_FTS5 is not defined, omit this file. ifcapable !fts5 { finish_test return } fts5_aux_test_functions db #-------------------------------------------------------------------------- # Simple tests. # do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, c, detail=col); INSERT INTO t1 VALUES('h d g', 'j b b g b', 'i e i d h g g'); -- 1 INSERT INTO t1 VALUES('h j d', 'j h d a h', 'f d d g g f b'); -- 2 INSERT INTO t1 VALUES('j c i', 'f f h e f', 'c j i j c h f'); -- 3 INSERT INTO t1 VALUES('e g g', 'g e d h i', 'e d b e g d c'); -- 4 INSERT INTO t1 VALUES('b c c', 'd i h a f', 'd i j f a b c'); -- 5 INSERT INTO t1 VALUES('e d e', 'b c j g d', 'a i f d h b d'); -- 6 INSERT INTO t1 VALUES('g h e', 'b c d i d', 'e f c i f i c'); -- 7 INSERT INTO t1 VALUES('c f j', 'j j i e a', 'h a c f d h e'); -- 8 INSERT INTO t1 VALUES('a h i', 'c i a f a', 'c f d h g d g'); -- 9 INSERT INTO t1 VALUES('j g g', 'e f e f f', 'h j b i c g e'); -- 10 } do_execsql_test 1.1 { INSERT INTO t1(t1) VALUES('integrity-check'); } foreach {tn match res} { 1 "a:a" {9} 2 "b:g" {1 4 6} 3 "c:h" {1 3 6 8 9 10} } { do_execsql_test 1.2.$tn.1 { SELECT rowid FROM t1($match); } $res do_execsql_test 1.2.$tn.2 { SELECT rowid FROM t1($match || '*'); } $res } do_catchsql_test 1.3.1 { SELECT rowid FROM t1('h + d'); } {1 {fts5: phrase queries are not supported (detail!=full)}} do_catchsql_test 1.3.2 { SELECT rowid FROM t1('NEAR(h d)'); } {1 {fts5: NEAR queries are not supported (detail!=full)}} #------------------------------------------------------------------------- # integrity-check with both detail= and prefix= options. # do_execsql_test 2.0 { CREATE VIRTUAL TABLE t2 USING fts5(a, detail=col, prefix="1"); INSERT INTO t2(a) VALUES('aa ab'); } #db eval {SELECT rowid, fts5_decode(rowid, block) aS r FROM t2_data} {puts $r} do_execsql_test 2.1 { INSERT INTO t2(t2) VALUES('integrity-check'); } do_execsql_test 2.2 { SELECT fts5_test_poslist(t2) FROM t2('aa'); } {0.0.0} do_execsql_test 2.3 { SELECT fts5_test_collist(t2) FROM t2('aa'); } {0.0} set ::pc 0 #puts [nearset {{ax bx cx}} -pc ::pc -near 10 -- b*] #exit #------------------------------------------------------------------------- # Check that the xInstCount, xInst, xPhraseFirst and xPhraseNext APIs # work with detail=col tables. # set data { 1 {abb aca aca} {aba bab aab aac caa} {abc cbc ccb bcc bab ccb aca} 2 {bca aca acb} {ccb bcc bca aab bcc} {bab aaa aac cbb bba aca abc} 3 {cca abc cab} {aab aba bcc cac baa} {bab cbb acb aba aab ccc cca} 4 {ccb bcb aba} {aba bbb bcc cac bbb} {cbb aaa bca bcc aab cac aca} 5 {bca bbc cac} {aba cbb cac cca aca} {cab acb cbc ccb cac bbb bcb} 6 {acc bba cba} {bab bbc bbb bcb aca} {bca ccc cbb aca bac ccc ccb} 7 {aba bab aaa} {abb bca aac bcb bcc} {bcb bbc aba aaa cba abc acc} 8 {cab aba aaa} {ccb aca caa bbc bcc} {aaa abc ccb bbb cac cca abb} 9 {bcb bab bac} {bcb cba cac bbb abc} {aba aca cbb acb abb ccc ccb} 10 {aba aab ccc} {abc ccc bcc cab bbb} {aab bcc cbb ccc aaa bac baa} 11 {bab acb cba} {aac cab cab bca cbc} {aab cbc aac baa ccb acc cac} 12 {ccc cbb cbc} {aaa aab bcc aac bbc} {cbc cbc bac bac ccc bbc acc} 13 {cab bbc abc} {bbb bab bba aca bab} {baa bbb aab bbb ccb bbb ccc} 14 {bbc cab caa} {acb aac abb cba acc} {cba bba bba acb abc abb baa} 15 {aba cca bcc} {aaa acb abc aab ccb} {cca bcb acc aaa caa cca cbc} 16 {bcb bba aba} {cbc acb cab caa ccb} {aac aaa bbc cab cca cba abc} 17 {caa cbb acc} {ccb bcb bca aaa bcc} {bbb aca bcb bca cbc cbc cca} 18 {cbb bbc aac} {ccc bbc aaa aab baa} {cab cab cac cca bbc abc bbc} 19 {ccc acc aaa} {aab cbb bca cca caa} {bcb aca aca cab acc bac bcc} 20 {aab ccc bcb} {bbc cbb bbc aaa bcc} {cbc aab ccc aaa bcb bac cbc} 21 {aba cab ccc} {bbc cbc cba acc bbb} {acc aab aac acb aca bca acb} 22 {bcb bca baa} {cca bbc aca ccb cbb} {aab abc bbc aaa cab bcc bcc} 23 {cac cbb caa} {bbc aba bbb bcc ccb} {bbc bbb cab bbc cac abb acc} 24 {ccb acb caa} {cab bba cac bbc aac} {aac bca abc cab bca cab bcb} 25 {bbb aca bca} {bcb acc ccc cac aca} {ccc acb acc cac cac bba bbc} 26 {bab acc caa} {caa cab cac bac aca} {aba cac caa acc bac ccc aaa} 27 {bca bca aaa} {ccb aca bca aaa baa} {bab acc aaa cca cba cca bac} 28 {ccb cac cac} {bca abb bba bbc baa} {aca ccb aac cab ccc cab caa} 29 {abc bca cab} {cac cbc cbb ccc bcc} {bcc aaa aaa acc aac cac aac} 30 {aca acc acb} {aab aac cbb caa acb} {acb bbc bbc acc cbb bbc aac} 31 {aba aca baa} {aca bcc cab bab acb} {bcc acb baa bcb bbc acc aba} 32 {abb cbc caa} {cba abb bbb cbb aca} {bac aca caa cac caa ccb bbc} 33 {bcc bcb bcb} {cca cab cbc abb bab} {caa bbc aac bbb cab cba aaa} 34 {caa cab acc} {ccc ccc bcc acb bcc} {bac bba aca bcb bba bcb cac} 35 {bac bcb cba} {bcc acb bbc cba bab} {abb cbb abc abc bac acc cbb} 36 {cab bab ccb} {bca bba bab cca acc} {acc aab bcc bac acb cbb caa} 37 {aca cbc cab} {bba aac aca aac aaa} {baa cbb cba aba cab bca bcb} 38 {acb aab baa} {baa bab bca bbc bbb} {abc baa acc aba cab baa cac} 39 {bcb aac cba} {bcb baa caa cac bbc} {cbc ccc bab ccb bbb caa aba} 40 {cba ccb abc} {cbb caa cba aac bab} {cbb bbb bca bbb bac cac bca} } set data { 1 {abb aca aca} {aba bab aab aac caa} {abc cbc ccb bcc bab ccb aca} } proc matchdata {expr {bAsc 1}} { set tclexpr [db one { SELECT fts5_expr_tcl($expr, 'nearset $cols -pc ::pc', 'x', 'y', 'z') }] set res [list] #puts "$expr -> $tclexpr" foreach {id x y z} $::data { set cols [list $x $y $z] set ::pc 0 #set hits [lsort -command instcompare [eval $tclexpr]] set hits [eval $tclexpr] if {[llength $hits]>0} { lappend res [list $id $hits] } } if {$bAsc} { set res [lsort -integer -increasing -index 0 $res] } else { set res [lsort -integer -decreasing -index 0 $res] } return [concat {*}$res] } foreach {tn tbl} { 1 { CREATE VIRTUAL TABLE t3 USING fts5(x, y, z, detail=col) } 2 { CREATE VIRTUAL TABLE t3 USING fts5(x, y, z, detail=none) } } { reset_db fts5_aux_test_functions db execsql $tbl foreach {id x y z} $data { execsql { INSERT INTO t3(rowid, x, y, z) VALUES($id, $x, $y, $z) } } foreach {tn2 expr} { 1 aaa 2 ccc 3 bab 4 aac 5 aa* 6 cc* 7 ba* 8 aa* 9 a* 10 b* 11 c* } { set res [matchdata $expr] do_execsql_test 3.$tn.$tn2.1 { SELECT rowid, fts5_test_poslist(t3) FROM t3($expr) } $res do_execsql_test 3.$tn.$tn2.2 { SELECT rowid, fts5_test_poslist2(t3) FROM t3($expr) } $res } } #------------------------------------------------------------------------- # Simple tests for detail=none tables. # do_execsql_test 4.0 { CREATE VIRTUAL TABLE t4 USING fts5(a, b, c, detail=none); INSERT INTO t4 VALUES('a b c', 'b c d', 'e f g'); INSERT INTO t4 VALUES('1 2 3', '4 5 6', '7 8 9'); } do_catchsql_test 4.1 { SELECT * FROM t4('a:a') } {1 {fts5: column queries are not supported (detail=none)}} #------------------------------------------------------------------------- # Test that for the same content detail=none uses less space than # detail=col, and that detail=col uses less space than detail=full # reset_db do_test 5.1 { foreach {tbl detail} {t1 none t2 col t3 full} { execsql "CREATE VIRTUAL TABLE $tbl USING fts5(x, y, z, detail=$detail)" foreach {rowid x y z} $::data { execsql "INSERT INTO $tbl (rowid, x, y, z) VALUES(\$rowid, \$x, \$y, \$z)" } } } {} do_execsql_test 5.2 { SELECT (SELECT sum(length(block)) from t1_data) < (SELECT sum(length(block)) from t2_data) } {1} do_execsql_test 5.3 { SELECT (SELECT sum(length(block)) from t2_data) < (SELECT sum(length(block)) from t3_data) } {1} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5determin.test ================================================ # 2016 March 21 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # # Specifically, that the fts5 module is deterministic. At one point, when # segment ids were allocated using sqlite3_randomness(), this was not the # case. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5aa return_if_no_fts5 proc do_determin_test {tn} { uplevel [list do_execsql_test $tn { SELECT (SELECT md5sum(id, block) FROM t1_data)== (SELECT md5sum(id, block) FROM t2_data), (SELECT md5sum(id, block) FROM t1_data)== (SELECT md5sum(id, block) FROM t3_data) } {1 1} ] } foreach_detail_mode $::testprefix { do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, prefix="1 2", detail=%DETAIL%); CREATE VIRTUAL TABLE t2 USING fts5(a, b, prefix="1 2", detail=%DETAIL%); CREATE VIRTUAL TABLE t3 USING fts5(a, b, prefix="1 2", detail=%DETAIL%); } do_test 1.1 { foreach t {t1 t2 t3} { execsql [string map [list TBL $t] { INSERT INTO TBL VALUES('a b c', 'd e f'); INSERT INTO TBL VALUES('c1 c2 c3', 'c1 c2 c3'); INSERT INTO TBL VALUES('xyzxyzxyz', 'xyzxyzxyz'); }] } } {} do_determin_test 1.2 do_test 1.3 { foreach t {t1 t2 t3} { execsql [string map [list TBL $t] { INSERT INTO TBL(TBL) VALUES('optimize'); }] } } {} do_determin_test 1.4 } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5dlidx.test ================================================ # 2015 April 21 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # This test is focused on uses of doclist-index records. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5dlidx # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } if { $tcl_platform(wordSize)<8 } { finish_test return } foreach_detail_mode $testprefix { proc do_fb_test {tn sql res} { set res2 [lsort -integer -decr $res] uplevel [list do_execsql_test $tn.1 $sql $res] uplevel [list do_execsql_test $tn.2 "$sql ORDER BY rowid DESC" $res2] } # This test populates the FTS5 table with $nEntry entries. Rows are # numbered from 0 to ($nEntry-1). The rowid for row $i is: # # ($iFirst + $i*$nStep) # # Each document is of the form "a b c a b c a b c...". If the row number ($i) # is an integer multiple of $spc1, then an "x" token is appended to the # document. If it is *also* a multiple of $spc2, a "y" token is also appended. # proc do_dlidx_test1 {tn spc1 spc2 nEntry iFirst nStep} { do_execsql_test $tn.0 { DELETE FROM t1 } set xdoc [list] set ydoc [list] execsql BEGIN for {set i 0} {$i < $nEntry} {incr i} { set rowid [expr $i * $nStep] set doc [string trim [string repeat "a b c " 100]] if {($i % $spc1)==0} { lappend xdoc $rowid append doc " x" if {($i % $spc2)==0} { lappend ydoc $rowid append doc " y" } } execsql { INSERT INTO t1(rowid, x) VALUES($rowid, $doc) } } execsql COMMIT do_test $tn.1 { execsql { INSERT INTO t1(t1) VALUES('integrity-check') } } {} do_fb_test $tn.3.1 { SELECT rowid FROM t1 WHERE t1 MATCH 'a AND x' } $xdoc do_fb_test $tn.3.2 { SELECT rowid FROM t1 WHERE t1 MATCH 'x AND a' } $xdoc do_fb_test $tn.4.1 { SELECT rowid FROM t1 WHERE t1 MATCH 'a AND y' } $ydoc do_fb_test $tn.4.2 { SELECT rowid FROM t1 WHERE t1 MATCH 'y AND a' } $ydoc if {[detail_is_full]} { do_fb_test $tn.5.1 { SELECT rowid FROM t1 WHERE t1 MATCH 'a + b + c + x' } $xdoc do_fb_test $tn.5.2 { SELECT rowid FROM t1 WHERE t1 MATCH 'b + c + x + y' } $ydoc } } foreach {tn pgsz} { 1 32 2 200 } { do_execsql_test $tn.0 { DROP TABLE IF EXISTS t1; CREATE VIRTUAL TABLE t1 USING fts5(x, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', $pgsz); } do_dlidx_test1 1.$tn.1 10 100 10000 0 1000 do_dlidx_test1 1.$tn.2 10 10 10000 0 128 do_dlidx_test1 1.$tn.3 10 10 66 0 36028797018963970 do_dlidx_test1 1.$tn.4 10 10 50 0 150000000000000000 do_dlidx_test1 1.$tn.5 10 10 200 0 [expr 1<<55] do_dlidx_test1 1.$tn.6 10 10 30 0 [expr 1<<58] } proc do_dlidx_test2 {tn nEntry iFirst nStep} { set str [string repeat "a " 500] execsql { BEGIN; DROP TABLE IF EXISTS t1; CREATE VIRTUAL TABLE t1 USING fts5(x, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 64); INSERT INTO t1 VALUES('b a'); WITH iii(ii, i) AS ( SELECT 1, $iFirst UNION ALL SELECT ii+1, i+$nStep FROM iii WHERE ii<$nEntry ) INSERT INTO t1(rowid,x) SELECT i, $str FROM iii; COMMIT; } do_execsql_test $tn.1 { SELECT rowid FROM t1 WHERE t1 MATCH 'b AND a' } {1} do_execsql_test $tn.2 { SELECT rowid FROM t1 WHERE t1 MATCH 'b AND a' ORDER BY rowid DESC } {1} } do_dlidx_test2 2.1 [expr 20] [expr 1<<57] [expr (1<<57) + 128] #-------------------------------------------------------------------- # reset_db set ::vocab [list \ IteratorpItercurrentlypointstothefirstrowidofadoclist \ Thereisadoclistindexassociatedwiththefinaltermonthecurrent \ pageIfthecurrenttermisthelasttermonthepageloadthe \ doclistindexfromdiskandinitializeaniteratoratpIterpDlidx \ IteratorpItercurrentlypointstothefirstrowidofadoclist \ Thereisadoclistindexassociatedwiththefinaltermonthecurrent \ pageIfthecurrenttermisthelasttermonthepageloadthe \ doclistindexfromdiskandinitializeaniteratoratpIterpDlidx \ ] proc rnddoc {} { global vocab set nVocab [llength $vocab] set ret [list] for {set i 0} {$i < 64} {incr i} { lappend ret [lindex $vocab [expr $i % $nVocab]] } set ret } db func rnddoc rnddoc do_execsql_test 3.1 { CREATE VIRTUAL TABLE abc USING fts5(a, detail=%DETAIL%); INSERT INTO abc(abc, rank) VALUES('pgsz', 32); INSERT INTO abc VALUES ( rnddoc() ); INSERT INTO abc VALUES ( rnddoc() ); INSERT INTO abc VALUES ( rnddoc() ); INSERT INTO abc VALUES ( rnddoc() ); INSERT INTO abc SELECT rnddoc() FROM abc; INSERT INTO abc SELECT rnddoc() FROM abc; } do_execsql_test 3.2 { SELECT rowid FROM abc WHERE abc MATCH 'IteratorpItercurrentlypointstothefirstrowidofadoclist' ORDER BY rowid DESC; } {16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} do_execsql_test 3.3 { INSERT INTO abc(abc) VALUES('integrity-check'); INSERT INTO abc(abc) VALUES('optimize'); INSERT INTO abc(abc) VALUES('integrity-check'); } set v [lindex $vocab 0] set i 0 foreach v $vocab { do_execsql_test 3.4.[incr i] { SELECT rowid FROM abc WHERE abc MATCH $v } {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16} } } ;# foreach_detail_mode finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5doclist.test ================================================ # 2015 April 21 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # This test is focused on edge cases in the doclist format. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5doclist # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } #------------------------------------------------------------------------- # Create a table with 1000 columns. Then add some large documents to it. # All text is in the right most column of the table. # do_test 1.0 { set cols [list] for {set i 0} {$i < 900} {incr i} { lappend cols "x$i" } execsql "CREATE VIRTUAL TABLE ccc USING fts5([join $cols ,])" } {} db func rnddoc fts5_rnddoc do_execsql_test 1.1 { WITH ii(i) AS (SELECT 1 UNION SELECT i+1 FROM ii WHERE i<100) INSERT INTO ccc(x899) SELECT rnddoc(500) FROM ii; } do_execsql_test 1.2 { INSERT INTO ccc(ccc) VALUES('integrity-check'); } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5ea.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # Test the fts5 expression parser directly using the fts5_expr() SQL # test function. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5ea # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } proc do_syntax_error_test {tn expr err} { set ::se_expr $expr do_catchsql_test $tn {SELECT fts5_expr($se_expr)} [list 1 $err] } proc do_syntax_test {tn expr res} { set ::se_expr $expr do_execsql_test $tn {SELECT fts5_expr($se_expr)} [list $res] } foreach {tn expr res} { 1 {abc} {"abc"} 2 {abc def} {"abc" AND "def"} 3 {abc*} {"abc" *} 4 {"abc def ghi" *} {"abc" + "def" + "ghi" *} 5 {one AND two} {"one" AND "two"} 6 {one+two} {"one" + "two"} 7 {one AND two OR three} {("one" AND "two") OR "three"} 8 {one OR two AND three} {"one" OR ("two" AND "three")} 9 {NEAR(one two)} {NEAR("one" "two", 10)} 10 {NEAR("one three"* two, 5)} {NEAR("one" + "three" * "two", 5)} 11 {a OR b NOT c} {"a" OR ("b" NOT "c")} 12 "\x20one\x20two\x20three" {"one" AND "two" AND "three"} 13 "\x09one\x0Atwo\x0Dthree" {"one" AND "two" AND "three"} 14 {"abc""def"} {"abc" + "def"} } { do_execsql_test 1.$tn {SELECT fts5_expr($expr)} [list $res] } foreach {tn expr res} { 1 {c1:abc} {c1 : "abc"} 2 {c2 : NEAR(one two) c1:"hello world"} {c2 : NEAR("one" "two", 10) AND c1 : "hello" + "world"} } { do_execsql_test 2.$tn {SELECT fts5_expr($expr, 'c1', 'c2')} [list $res] } foreach {tn expr err} { 1 {AND} {fts5: syntax error near "AND"} 2 {abc def AND} {fts5: syntax error near ""} 3 {abc OR AND} {fts5: syntax error near "AND"} 4 {(a OR b) abc} {fts5: syntax error near "abc"} 5 {NEaR (a b)} {fts5: syntax error near "NEaR"} 6 {NEa (a b)} {fts5: syntax error near "NEa"} 7 {(a OR b) NOT c)} {fts5: syntax error near ")"} 8 {nosuch: a nosuch2: b} {no such column: nosuch} 9 {addr: a nosuch2: b} {no such column: nosuch2} 10 {NOT} {fts5: syntax error near "NOT"} 11 {a AND "abc} {unterminated string} 12 {NEAR(a b, xyz)} {expected integer, got "xyz"} 13 {NEAR(a b, // )} {fts5: syntax error near "/"} 14 {NEAR(a b, "xyz" )} {expected integer, got ""xyz""} } { do_catchsql_test 3.$tn {SELECT fts5_expr($expr, 'name', 'addr')} [list 1 $err] } #------------------------------------------------------------------------- # Experiment with a tokenizer that considers " to be a token character. # do_execsql_test 4.0 { SELECT fts5_expr('a AND """"', 'x', 'tokenize="unicode61 tokenchars ''""''"'); } {{"a" AND """"}} #------------------------------------------------------------------------- # Experiment with a tokenizer that considers " to be a token character. # do_catchsql_test 5.0 { SELECT fts5_expr('abc | def'); } {1 {fts5: syntax error near "|"}} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5eb.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5eb # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } proc do_syntax_error_test {tn expr err} { set ::se_expr $expr do_catchsql_test $tn {SELECT fts5_expr($se_expr)} [list 1 $err] } proc do_syntax_test {tn expr res} { set ::se_expr $expr do_execsql_test $tn {SELECT fts5_expr($se_expr)} [list $res] } foreach {tn expr res} { 1 {abc} {"abc"} 2 {abc ""} {"abc"} 3 {""} {} 4 {abc OR ""} {"abc" OR ""} 5 {abc NOT ""} {"abc" NOT ""} 6 {abc AND ""} {"abc" AND ""} 7 {"" OR abc} {"" OR "abc"} 8 {"" NOT abc} {"" NOT "abc"} 9 {"" AND abc} {"" AND "abc"} 10 {abc + "" + def} {"abc" + "def"} 11 {abc "" def} {"abc" AND "def"} 12 {r+e OR w} {"r" + "e" OR "w"} 13 {a AND b NOT c} {"a" AND ("b" NOT "c")} 14 {a OR b NOT c} {"a" OR ("b" NOT "c")} 15 {a NOT b AND c} {("a" NOT "b") AND "c"} 16 {a NOT b OR c} {("a" NOT "b") OR "c"} 17 {a AND b OR c} {("a" AND "b") OR "c"} 18 {a OR b AND c} {"a" OR ("b" AND "c")} } { do_execsql_test 1.$tn {SELECT fts5_expr($expr)} [list $res] } do_catchsql_test 2.1 { SELECT fts5_expr() } {1 {wrong number of arguments to function fts5_expr}} do_catchsql_test 2.1 { SELECT fts5_expr_tcl() } {1 {wrong number of arguments to function fts5_expr_tcl}} do_execsql_test 3.0 { CREATE VIRTUAL TABLE e1 USING fts5(text, tokenize = 'porter unicode61'); INSERT INTO e1 VALUES ("just a few words with a / inside"); } do_execsql_test 3.1 { SELECT rowid, bm25(e1) FROM e1 WHERE e1 MATCH '"just"' ORDER BY rank; } {1 -1e-06} do_execsql_test 3.2 { SELECT rowid FROM e1 WHERE e1 MATCH '"/" OR "just"' } 1 do_execsql_test 3.3 { SELECT rowid, bm25(e1) FROM e1 WHERE e1 MATCH '"/" OR "just"' ORDER BY rank; } {1 -1e-06} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5fault1.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # source [file join [file dirname [info script]] fts5_common.tcl] source $testdir/malloc_common.tcl set testprefix fts5fault1 # If SQLITE_ENABLE_FTS3 is defined, omit this file. ifcapable !fts5 { finish_test return } # Simple tests: # # 1: CREATE VIRTUAL TABLE # 2: INSERT statement # 3: DELETE statement # 4: MATCH expressions # # faultsim_save_and_close do_faultsim_test 1 -faults ioerr-t* -prep { faultsim_restore_and_reopen } -body { execsql { CREATE VIRTUAL TABLE t1 USING fts5(a, b, prefix='1, 2, 3') } } -test { faultsim_test_result {0 {}} {1 {vtable constructor failed: t1}} } reset_db do_execsql_test 2.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, prefix='1, 2, 3'); } faultsim_save_and_close do_faultsim_test 2 -prep { faultsim_restore_and_reopen } -body { execsql { INSERT INTO t1 VALUES('a b c', 'a bc def ghij klmno'); } } -test { faultsim_test_result {0 {}} {1 {vtable constructor failed: t1}} } reset_db do_execsql_test 3.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, prefix='1, 2, 3'); INSERT INTO t1 VALUES('a b c', 'a bc def ghij klmno'); } faultsim_save_and_close do_faultsim_test 3 -prep { faultsim_restore_and_reopen } -body { execsql { DELETE FROM t1 } } -test { faultsim_test_result {0 {}} {1 {vtable constructor failed: t1}} } reset_db do_execsql_test 4.0 { CREATE VIRTUAL TABLE t2 USING fts5(a, b); INSERT INTO t2 VALUES('m f a jj th q gi ar', 'hj n h h sg j i m'); INSERT INTO t2 VALUES('nr s t g od j kf h', 'sb h aq rg op rb n nl'); INSERT INTO t2 VALUES('do h h pb p p q fr', 'c rj qs or cr a l i'); INSERT INTO t2 VALUES('lk gp t i lq mq qm p', 'h mr g f op ld aj h'); INSERT INTO t2 VALUES('ct d sq kc qi k f j', 'sn gh c of g s qt q'); INSERT INTO t2 VALUES('d ea d d om mp s ab', 'dm hg l df cm ft pa c'); INSERT INTO t2 VALUES('tc dk c jn n t sr ge', 'a a kn bc n i af h'); INSERT INTO t2 VALUES('ie ii d i b sa qo rf', 'a h m aq i b m fn'); INSERT INTO t2 VALUES('gs r fo a er m h li', 'tm c p gl eb ml q r'); INSERT INTO t2 VALUES('k fe fd rd a gi ho kk', 'ng m c r d ml rm r'); } faultsim_save_and_close foreach {tn expr res} { 1 { dk } 7 2 { m f } 1 3 { f* } {1 3 4 5 6 8 9 10} 4 { m OR f } {1 4 5 8 9 10} 5 { sn + gh } {5} 6 { "sn gh" } {5} 7 { NEAR(r a, 5) } {9} 8 { m* f* } {1 4 6 8 9 10} 9 { m* + f* } {1 8} 10 { c NOT p } {5 6 7 10} } { do_faultsim_test 4.$tn -prep { faultsim_restore_and_reopen } -body " execsql { SELECT rowid FROM t2 WHERE t2 MATCH '$expr' } " -test " faultsim_test_result {[list 0 $res]} {1 {vtable constructor failed: t2}} " } #------------------------------------------------------------------------- # The following tests use a larger database populated with random data. # # The database page size is set to 512 bytes and the FTS5 page size left # at the default 1000 bytes. This means that reading a node may require # pulling an overflow page from disk, which is an extra opportunity for # an error to occur. # reset_db do_execsql_test 5.0.1 { PRAGMA main.page_size = 512; CREATE VIRTUAL TABLE x1 USING fts5(a, b); PRAGMA main.page_size; } {512} proc rnddoc {n} { set map [list 0 a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j] set doc [list] for {set i 0} {$i < $n} {incr i} { lappend doc [string map $map [format %.3d [expr int(rand()*1000)]]] } set doc } db func rnddoc rnddoc do_execsql_test 5.0.2 { WITH r(a, b) AS ( SELECT rnddoc(6), rnddoc(6) UNION ALL SELECT rnddoc(6), rnddoc(6) FROM r ) INSERT INTO x1 SELECT * FROM r LIMIT 10000; } set res [db one { SELECT count(*) FROM x1 WHERE x1.a LIKE '%abc%' OR x1.b LIKE '%abc%'} ] do_faultsim_test 5.1 -faults oom* -body { execsql { SELECT count(*) FROM x1 WHERE x1 MATCH 'abc' } } -test { faultsim_test_result [list 0 $::res] } do_faultsim_test 5.2 -faults oom* -body { execsql { SELECT count(*) FROM x1 WHERE x1 MATCH 'abcd' } } -test { faultsim_test_result [list 0 0] } proc test_astar {a b} { return [expr { [regexp {a[^ ][^ ]} $a] || [regexp {a[^ ][^ ]} $b] }] } db func test_astar test_astar set res [db one { SELECT count(*) FROM x1 WHERE test_astar(a, b) } ] do_faultsim_test 5.3 -faults oom* -body { execsql { SELECT count(*) FROM x1 WHERE x1 MATCH 'a*' } } -test { faultsim_test_result [list 0 $::res] } do_faultsim_test 5.4 -faults oom* -prep { db close sqlite3 db test.db } -body { execsql { INSERT INTO x1 VALUES('a b c d', 'e f g h') } } -test { faultsim_test_result [list 0 {}] } do_faultsim_test 5.5.1 -faults oom* -body { execsql { SELECT count(fts5_decode(rowid, block)) FROM x1_data WHERE rowid=1 } } -test { faultsim_test_result [list 0 1] } do_faultsim_test 5.5.2 -faults oom* -body { execsql { SELECT count(fts5_decode(rowid, block)) FROM x1_data WHERE rowid=10 } } -test { faultsim_test_result [list 0 1] } do_faultsim_test 5.5.3 -faults oom* -body { execsql { SELECT count(fts5_decode(rowid, block)) FROM x1_data WHERE rowid = ( SELECT min(rowid) FROM x1_data WHERE rowid>20 ) } } -test { faultsim_test_result [list 0 1] } do_faultsim_test 5.5.4 -faults oom* -body { execsql { SELECT count(fts5_decode(rowid, block)) FROM x1_data WHERE rowid = ( SELECT max(rowid) FROM x1_data ) } } -test { faultsim_test_result [list 0 1] } #------------------------------------------------------------------------- # reset_db do_execsql_test 6.0 { CREATE VIRTUAL TABLE x1 USING fts5(x); INSERT INTO x1(x1, rank) VALUES('automerge', 0); INSERT INTO x1 VALUES('a b c'); -- 1 INSERT INTO x1 VALUES('a b c'); -- 2 INSERT INTO x1 VALUES('a b c'); -- 3 INSERT INTO x1 VALUES('a b c'); -- 4 INSERT INTO x1 VALUES('a b c'); -- 5 INSERT INTO x1 VALUES('a b c'); -- 6 INSERT INTO x1 VALUES('a b c'); -- 7 INSERT INTO x1 VALUES('a b c'); -- 8 INSERT INTO x1 VALUES('a b c'); -- 9 INSERT INTO x1 VALUES('a b c'); -- 10 INSERT INTO x1 VALUES('a b c'); -- 11 INSERT INTO x1 VALUES('a b c'); -- 12 INSERT INTO x1 VALUES('a b c'); -- 13 INSERT INTO x1 VALUES('a b c'); -- 14 INSERT INTO x1 VALUES('a b c'); -- 15 SELECT count(*) FROM x1_data; } {17} faultsim_save_and_close do_faultsim_test 6.1 -faults oom* -prep { faultsim_restore_and_reopen } -body { execsql { INSERT INTO x1 VALUES('d e f') } } -test { faultsim_test_result [list 0 {}] if {$testrc==0} { set nCnt [db one {SELECT count(*) FROM x1_data}] if {$nCnt!=3} { error "expected 3 entries but there are $nCnt" } } } do_faultsim_test 6.2 -faults oom* -prep { faultsim_restore_and_reopen } -body { execsql { INSERT INTO x1(x1, rank) VALUES('pgsz', 32) } } -test { faultsim_test_result [list 0 {}] } do_faultsim_test 6.3 -faults oom-* -prep { faultsim_restore_and_reopen } -body { execsql { INSERT INTO x1(x1) VALUES('integrity-check') } } -test { faultsim_test_result [list 0 {}] } do_faultsim_test 6.4 -faults oom-* -prep { faultsim_restore_and_reopen } -body { execsql { INSERT INTO x1(x1) VALUES('optimize') } } -test { faultsim_test_result [list 0 {}] } #------------------------------------------------------------------------- # do_faultsim_test 7.0 -faults oom* -prep { catch { db close } } -body { sqlite3 db test.db } -test { faultsim_test_result [list 0 {}] {1 {}} {1 {initialization of fts5 failed: }} } #------------------------------------------------------------------------- # A prefix query against a large document set. # proc rnddoc {n} { set map [list 0 a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j] set doc [list] for {set i 0} {$i < $n} {incr i} { lappend doc "x[string map $map [format %.3d [expr int(rand()*1000)]]]" } set doc } reset_db db func rnddoc rnddoc do_test 8.0 { execsql { CREATE VIRTUAL TABLE x1 USING fts5(a) } set ::res [list] for {set i 1} {$i<100} {incr i 1} { execsql { INSERT INTO x1 VALUES( rnddoc(50) ) } lappend ::res $i } } {} do_faultsim_test 8.1 -faults oom* -prep { } -body { execsql { SELECT rowid FROM x1 WHERE x1 MATCH 'x*' } } -test { faultsim_test_result [list 0 $::res] } #------------------------------------------------------------------------- # Segment promotion. # do_test 9.0 { reset_db db func rnddoc fts5_rnddoc execsql { CREATE VIRTUAL TABLE s2 USING fts5(x); INSERT INTO s2(s2, rank) VALUES('pgsz', 32); INSERT INTO s2(s2, rank) VALUES('automerge', 0); } for {set i 1} {$i <= 16} {incr i} { execsql { INSERT INTO s2 VALUES(rnddoc(5)) } } fts5_level_segs s2 } {0 1} set insert_doc [db one {SELECT rnddoc(160)}] faultsim_save_and_close do_faultsim_test 9.1 -faults oom-* -prep { faultsim_restore_and_reopen } -body { execsql { INSERT INTO s2 VALUES($::insert_doc) } } -test { faultsim_test_result {0 {}} if {$testrc==0} { set ls [fts5_level_segs s2] if {$ls != "2 0"} { error "fts5_level_segs says {$ls}" } } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5fault2.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # This file is focused on OOM errors. # source [file join [file dirname [info script]] fts5_common.tcl] source $testdir/malloc_common.tcl set testprefix fts5fault2 # If SQLITE_ENABLE_FTS5 is not defined, omit this file. ifcapable !fts5 { finish_test return } set doc [string trim [string repeat "x y z " 200]] do_execsql_test 1.0 { CREATE TABLE t1(a INTEGER PRIMARY KEY, x); CREATE VIRTUAL TABLE x1 USING fts5(x, content='t1', content_rowid='a'); INSERT INTO x1(x1, rank) VALUES('pgsz', 32); WITH input(a,b) AS ( SELECT 1, $doc UNION ALL SELECT a+1, ($doc || CASE WHEN (a+1)%100 THEN '' ELSE ' xyz' END) FROM input WHERE a < 1000 ) INSERT INTO t1 SELECT * FROM input; INSERT INTO x1(x1) VALUES('rebuild'); } do_faultsim_test 1.1 -faults oom-* -prep { } -body { execsql { SELECT rowid FROM x1 WHERE x1 MATCH 'z AND xyz' } } -test { faultsim_test_result {0 {100 200 300 400 500 600 700 800 900 1000}} } do_faultsim_test 1.2 -faults oom-* -prep { } -body { execsql { SELECT rowid FROM x1 WHERE x1 MATCH 'z + xyz' ORDER BY 1 DESC} } -test { faultsim_test_result {0 {1000 900 800 700 600 500 400 300 200 100}} } #------------------------------------------------------------------------- # OOM within a query that accesses the in-memory hash table. # reset_db do_execsql_test 2.0 { CREATE VIRTUAL TABLE "a b c" USING fts5(a, b, c); INSERT INTO "a b c" VALUES('one two', 'x x x', 'three four'); INSERT INTO "a b c" VALUES('nine ten', 'y y y', 'two two'); } do_faultsim_test 2.1 -faults oom-trans* -prep { execsql { BEGIN; INSERT INTO "a b c" VALUES('one one', 'z z z', 'nine ten'); } } -body { execsql { SELECT rowid FROM "a b c" WHERE "a b c" MATCH 'one' } } -test { faultsim_test_result {0 {1 3}} catchsql { ROLLBACK } } #------------------------------------------------------------------------- # OOM within an 'optimize' operation that writes multiple pages to disk. # reset_db do_execsql_test 3.0 { CREATE VIRTUAL TABLE zzz USING fts5(z); INSERT INTO zzz(zzz, rank) VALUES('pgsz', 32); INSERT INTO zzz VALUES('a b c d'); INSERT INTO zzz SELECT 'c d e f' FROM zzz; INSERT INTO zzz SELECT 'e f g h' FROM zzz; INSERT INTO zzz SELECT 'i j k l' FROM zzz; INSERT INTO zzz SELECT 'l k m n' FROM zzz; INSERT INTO zzz SELECT 'o p q r' FROM zzz; } faultsim_save_and_close do_faultsim_test 3.1 -faults oom-trans* -prep { faultsim_restore_and_reopen execsql { SELECT rowid FROM zzz } } -body { execsql { INSERT INTO zzz(zzz) VALUES('optimize') } } -test { faultsim_test_result {0 {}} } #------------------------------------------------------------------------- # OOM within an 'integrity-check' operation. # reset_db db func rnddoc fts5_rnddoc do_execsql_test 4.0 { CREATE VIRTUAL TABLE zzz USING fts5(z); INSERT INTO zzz(zzz, rank) VALUES('pgsz', 32); WITH ii(i) AS (SELECT 1 UNION SELECT i+1 FROM ii WHERE i<10) INSERT INTO zzz SELECT rnddoc(10) || ' xccc' FROM ii; } do_faultsim_test 4.1 -faults oom-trans* -prep { } -body { execsql { INSERT INTO zzz(zzz) VALUES('integrity-check') } } -test { faultsim_test_result {0 {}} } #------------------------------------------------------------------------- # OOM while parsing a tokenize=option # reset_db faultsim_save_and_close do_faultsim_test 5.0 -faults oom-* -prep { faultsim_restore_and_reopen } -body { execsql { CREATE VIRTUAL TABLE uio USING fts5(a, b, tokenize="porter 'ascii'", content="another table", content_rowid="somecolumn" ); } } -test { faultsim_test_result {0 {}} } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5fault3.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # This file is focused on OOM errors. # source [file join [file dirname [info script]] fts5_common.tcl] source $testdir/malloc_common.tcl set testprefix fts5fault3 # If SQLITE_ENABLE_FTS3 is defined, omit this file. ifcapable !fts5 { finish_test return } #------------------------------------------------------------------------- # An OOM while resuming a partially completed segment merge. # db func rnddoc fts5_rnddoc do_test 1.0 { expr srand(0) execsql { CREATE VIRTUAL TABLE xx USING fts5(x); INSERT INTO xx(xx, rank) VALUES('pgsz', 32); INSERT INTO xx(xx, rank) VALUES('automerge', 16); } for {set i 0} {$i < 10} {incr i} { execsql { BEGIN; INSERT INTO xx(x) VALUES(rnddoc(20)); INSERT INTO xx(x) VALUES(rnddoc(20)); INSERT INTO xx(x) VALUES(rnddoc(20)); COMMIT } } execsql { INSERT INTO xx(xx, rank) VALUES('automerge', 2); INSERT INTO xx(xx, rank) VALUES('merge', 50); } } {} faultsim_save_and_close do_faultsim_test 1 -faults oom-* -prep { faultsim_restore_and_reopen } -body { execsql { INSERT INTO xx(xx, rank) VALUES('merge', 1) } } -test { faultsim_test_result [list 0 {}] } #------------------------------------------------------------------------- # An OOM while flushing an unusually large term to disk. # reset_db do_execsql_test 2.0 { CREATE VIRTUAL TABLE xx USING fts5(x); INSERT INTO xx(xx, rank) VALUES('pgsz', 32); } faultsim_save_and_close set doc "a long term abcdefghijklmnopqrstuvwxyz " append doc "and then abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz " append doc [string repeat "abcdefghijklmnopqrstuvwxyz" 10] do_faultsim_test 2 -faults oom-* -prep { faultsim_restore_and_reopen } -body { execsql { INSERT INTO xx(x) VALUES ($::doc) } } -test { faultsim_test_result [list 0 {}] } #------------------------------------------------------------------------- # An OOM while flushing an unusually large term to disk. # reset_db do_execsql_test 3.0 { CREATE VIRTUAL TABLE xx USING fts5(x); } faultsim_save_and_close set doc [fts5_rnddoc 1000] do_faultsim_test 3.1 -faults oom-* -prep { faultsim_restore_and_reopen } -body { execsql { INSERT INTO xx(x) VALUES ($::doc) } } -test { faultsim_test_result [list 0 {}] } set doc [string repeat "abc " 100] do_faultsim_test 3.2 -faults oom-* -prep { faultsim_restore_and_reopen } -body { execsql { INSERT INTO xx(x) VALUES ($::doc) } } -test { faultsim_test_result [list 0 {}] } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5fault4.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # This file is focused on OOM errors. # source [file join [file dirname [info script]] fts5_common.tcl] source $testdir/malloc_common.tcl set testprefix fts5fault4 # If SQLITE_ENABLE_FTS3 is defined, omit this file. ifcapable !fts5 { finish_test return } #------------------------------------------------------------------------- # An OOM while dropping an fts5 table. # db func rnddoc fts5_rnddoc do_test 1.0 { execsql { CREATE VIRTUAL TABLE xx USING fts5(x) } } {} faultsim_save_and_close do_faultsim_test 1 -faults oom-* -prep { faultsim_restore_and_reopen execsql { SELECT * FROM xx } } -body { execsql { DROP TABLE xx } } -test { faultsim_test_result [list 0 {}] } #------------------------------------------------------------------------- # An OOM while "reseeking" an FTS cursor. # do_execsql_test 3.0 { CREATE VIRTUAL TABLE jj USING fts5(j); INSERT INTO jj(rowid, j) VALUES(101, 'm t w t f s s'); INSERT INTO jj(rowid, j) VALUES(202, 't w t f s'); INSERT INTO jj(rowid, j) VALUES(303, 'w t f'); INSERT INTO jj(rowid, j) VALUES(404, 't'); } faultsim_save_and_close do_faultsim_test 3 -faults oom-* -prep { faultsim_restore_and_reopen execsql { SELECT * FROM jj } } -body { set res [list] db eval { SELECT rowid FROM jj WHERE jj MATCH 't' } { lappend res $rowid if {$rowid==303} { execsql { DELETE FROM jj WHERE rowid=404 } } } set res } -test { faultsim_test_result [list 0 {101 202 303}] } #------------------------------------------------------------------------- # An OOM within a special "*reads" query. # reset_db db func rnddoc fts5_rnddoc do_execsql_test 4.0 { CREATE VIRTUAL TABLE x1 USING fts5(x); INSERT INTO x1(x1, rank) VALUES('pgsz', 32); WITH ii(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<10 ) INSERT INTO x1 SELECT rnddoc(5) FROM ii; } set ::res [db eval {SELECT rowid, x1 FROM x1 WHERE x1 MATCH '*reads'}] do_faultsim_test 4 -faults oom-* -body { db eval {SELECT rowid, x, x1 FROM x1 WHERE x1 MATCH '*reads'} } -test { faultsim_test_result {0 {0 {} 3}} } #------------------------------------------------------------------------- # An OOM within a query that uses a custom rank function. # reset_db do_execsql_test 5.0 { PRAGMA encoding='utf16'; CREATE VIRTUAL TABLE x2 USING fts5(x); INSERT INTO x2(rowid, x) VALUES(10, 'a b c'); -- 3 INSERT INTO x2(rowid, x) VALUES(20, 'a b c'); -- 6 INSERT INTO x2(rowid, x) VALUES(30, 'a b c'); -- 2 INSERT INTO x2(rowid, x) VALUES(40, 'a b c'); -- 5 INSERT INTO x2(rowid, x) VALUES(50, 'a b c'); -- 1 } proc rowidmod {cmd mod} { set row [$cmd xRowid] expr {$row % $mod} } sqlite3_fts5_create_function db rowidmod rowidmod do_faultsim_test 5.1 -faults oom-* -body { db eval { SELECT rowid || '-' || rank FROM x2 WHERE x2 MATCH 'b' AND rank MATCH "rowidmod('7')" ORDER BY rank } } -test { faultsim_test_result {0 {50-1 30-2 10-3 40-5 20-6}} } proc rowidprefix {cmd prefix} { set row [$cmd xRowid] set {} "${row}-${prefix}" } sqlite3_fts5_create_function db rowidprefix rowidprefix set str [string repeat abcdefghijklmnopqrstuvwxyz 10] do_faultsim_test 5.2 -faults oom-* -body { db eval " SELECT rank, x FROM x2 WHERE x2 MATCH 'b' AND rank MATCH 'rowidprefix(''$::str'')' LIMIT 1 " } -test { faultsim_test_result "0 {10-$::str {a b c}}" } #------------------------------------------------------------------------- # OOM errors within auxiliary functions. # reset_db do_execsql_test 6.0 { CREATE VIRTUAL TABLE x3 USING fts5(xxx); INSERT INTO x3 VALUES('a b c d c b a'); INSERT INTO x3 VALUES('a a a a a a a'); INSERT INTO x3 VALUES('a a a a a a a'); } do_faultsim_test 6.1 -faults oom-t* -body { db eval { SELECT highlight(x3, 0, '*', '*') FROM x3 WHERE x3 MATCH 'c' } } -test { faultsim_test_result {0 {{a b *c* d *c* b a}}} } proc firstinst {cmd} { foreach {p c o} [$cmd xInst 0] {} expr $c*100 + $o } sqlite3_fts5_create_function db firstinst firstinst do_faultsim_test 6.2 -faults oom-t* -body { db eval { SELECT firstinst(x3) FROM x3 WHERE x3 MATCH 'c' } } -test { faultsim_test_result {0 2} {1 SQLITE_NOMEM} } proc previc {cmd} { set res [$cmd xGetAuxdataInt 0] $cmd xSetAuxdataInt [$cmd xInstCount] return $res } sqlite3_fts5_create_function db previc previc do_faultsim_test 6.2 -faults oom-t* -body { db eval { SELECT previc(x3) FROM x3 WHERE x3 MATCH 'a' } } -test { faultsim_test_result {0 {0 2 7}} {1 SQLITE_NOMEM} } #------------------------------------------------------------------------- # OOM error when querying for a phrase with many tokens. # reset_db do_execsql_test 7.0 { CREATE VIRTUAL TABLE tt USING fts5(x, y); INSERT INTO tt VALUES('f b g b c b', 'f a d c c b'); -- 1 INSERT INTO tt VALUES('d a e f e d', 'f b b d e e'); -- 2 INSERT INTO tt VALUES('f b g a d c', 'e f c f a d'); -- 3 INSERT INTO tt VALUES('f f c d g f', 'f a e b g b'); -- 4 INSERT INTO tt VALUES('a g b d a g', 'e g a e a c'); -- 5 INSERT INTO tt VALUES('c d b d e f', 'f g e g e e'); -- 6 INSERT INTO tt VALUES('e g f f b c', 'f c e f g f'); -- 7 INSERT INTO tt VALUES('e g c f c e', 'f e e a f g'); -- 8 INSERT INTO tt VALUES('e a e b e e', 'd c c f f f'); -- 9 INSERT INTO tt VALUES('f a g g c c', 'e g d g c e'); -- 10 INSERT INTO tt VALUES('c d b a e f', 'f g e h e e'); -- 11 CREATE VIRTUAL TABLE tt2 USING fts5(o); INSERT INTO tt2(rowid, o) SELECT rowid, x||' '||y FROM tt; INSERT INTO tt2(rowid, o) VALUES(12, 'a b c d e f g h i j k l'); } do_faultsim_test 7.2 -faults oom-* -body { db eval { SELECT rowid FROM tt WHERE tt MATCH 'f+g+e+g+e+e' } } -test { faultsim_test_result {0 6} {1 SQLITE_NOMEM} } do_faultsim_test 7.3 -faults oom-* -body { db eval { SELECT rowid FROM tt WHERE tt MATCH 'NEAR(a b c d e f)' } } -test { faultsim_test_result {0 11} {1 SQLITE_NOMEM} } do_faultsim_test 7.4 -faults oom-t* -body { db eval { SELECT rowid FROM tt2 WHERE tt2 MATCH '"g c f c e f e e a f"' } } -test { faultsim_test_result {0 8} {1 SQLITE_NOMEM} } do_faultsim_test 7.5 -faults oom-* -body { db eval {SELECT rowid FROM tt2 WHERE tt2 MATCH 'NEAR(a b c d e f g h i j k)'} } -test { faultsim_test_result {0 12} {1 SQLITE_NOMEM} } do_faultsim_test 7.6 -faults oom-* -body { db eval {SELECT rowid FROM tt WHERE tt MATCH 'y: "c c"'} } -test { faultsim_test_result {0 {1 9}} {1 SQLITE_NOMEM} } #------------------------------------------------------------------------- # reset_db do_execsql_test 8.0 { CREATE VIRTUAL TABLE tt USING fts5(x); INSERT INTO tt(tt, rank) VALUES('pgsz', 32); BEGIN; INSERT INTO tt(rowid, x) VALUES(1, 'a b c d x x'); WITH ii(i) AS (SELECT 2 UNION ALL SELECT i+1 FROM ii WHERE i<99) INSERT INTO tt(rowid, x) SELECT i, 'a b c x x d' FROM ii; INSERT INTO tt(rowid, x) VALUES(100, 'a b c d x x'); COMMIT; } do_faultsim_test 8.1 -faults oom-t* -body { db eval { SELECT rowid FROM tt WHERE tt MATCH 'NEAR(a b c d, 2)' } } -test { faultsim_test_result {0 {1 100}} {1 SQLITE_NOMEM} } do_faultsim_test 8.2 -faults oom-t* -body { db eval { SELECT count(*) FROM tt WHERE tt MATCH 'a OR d' } } -test { faultsim_test_result {0 100} {1 SQLITE_NOMEM} } #------------------------------------------------------------------------- # Fault in NOT query. # reset_db do_execsql_test 9.0 { CREATE VIRTUAL TABLE tt USING fts5(x); INSERT INTO tt(tt, rank) VALUES('pgsz', 32); BEGIN; WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<200) INSERT INTO tt(rowid, x) SELECT i, CASE WHEN (i%50)==0 THEN 'a a a a a a' ELSE 'a x a x a x' END FROM ii; COMMIT; } do_faultsim_test 9.1 -faults oom-* -body { db eval { SELECT rowid FROM tt WHERE tt MATCH 'a NOT x' } } -test { faultsim_test_result {0 {50 100 150 200}} {1 SQLITE_NOMEM} } #------------------------------------------------------------------------- # OOM in fts5_expr() SQL function. # do_faultsim_test 10.1 -faults oom-t* -body { db one { SELECT fts5_expr('a AND b NEAR(a b)') } } -test { faultsim_test_result {0 {"a" AND "b" AND NEAR("a" "b", 10)}} } do_faultsim_test 10.2 -faults oom-t* -body { db one { SELECT fts5_expr_tcl('x:"a b c" AND b NEAR(a b)', 'ns', 'x') } } -test { set res {AND [ns -col 0 -- {a b c}] [ns -- {b}] [ns -near 10 -- {a} {b}]} faultsim_test_result [list 0 $res] } do_faultsim_test 10.3 -faults oom-t* -body { db one { SELECT fts5_expr('x:a', 'x') } } -test { faultsim_test_result {0 {x : "a"}} } #------------------------------------------------------------------------- # OOM while configuring 'rank' option. # reset_db do_execsql_test 11.0 { CREATE VIRTUAL TABLE ft USING fts5(x); } do_faultsim_test 11.1 -faults oom-t* -body { db eval { INSERT INTO ft(ft, rank) VALUES('rank', 'bm25(10.0, 5.0)') } } -test { faultsim_test_result {0 {}} {1 {disk I/O error}} } #------------------------------------------------------------------------- # OOM while creating an fts5vocab table. # reset_db do_execsql_test 12.0 { CREATE VIRTUAL TABLE ft USING fts5(x); } faultsim_save_and_close do_faultsim_test 12.1 -faults oom-t* -prep { faultsim_restore_and_reopen db eval { SELECT * FROM sqlite_master } } -body { db eval { CREATE VIRTUAL TABLE vv USING fts5vocab(ft, 'row') } } -test { faultsim_test_result {0 {}} } #------------------------------------------------------------------------- # OOM while querying an fts5vocab table. # reset_db do_execsql_test 13.0 { CREATE VIRTUAL TABLE ft USING fts5(x); INSERT INTO ft VALUES('a b'); CREATE VIRTUAL TABLE vv USING fts5vocab(ft, 'row'); } faultsim_save_and_close do_faultsim_test 13.1 -faults oom-t* -prep { faultsim_restore_and_reopen db eval { SELECT * FROM vv } } -body { db eval { SELECT * FROM vv } } -test { faultsim_test_result {0 {a 1 1 b 1 1}} } #------------------------------------------------------------------------- # OOM in multi-column token query. # reset_db do_execsql_test 13.0 { CREATE VIRTUAL TABLE ft USING fts5(x, y, z); INSERT INTO ft(ft, rank) VALUES('pgsz', 32); INSERT INTO ft VALUES( 'x x x x x x x x x x x x x x x x', 'y y y y y y y y y y y y y y y y', 'z z z z z z z z x x x x x x x x' ); INSERT INTO ft SELECT * FROM ft; INSERT INTO ft SELECT * FROM ft; INSERT INTO ft SELECT * FROM ft; INSERT INTO ft SELECT * FROM ft; } faultsim_save_and_close do_faultsim_test 13.1 -faults oom-t* -prep { faultsim_restore_and_reopen db eval { SELECT * FROM ft } } -body { db eval { SELECT rowid FROM ft WHERE ft MATCH '{x z}: x' } } -test { faultsim_test_result {0 {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16}} } #------------------------------------------------------------------------- # OOM in an "ALTER TABLE RENAME TO" # reset_db do_execsql_test 14.0 { CREATE VIRTUAL TABLE "tbl one" USING fts5(x, y, z); } faultsim_save_and_close do_faultsim_test 14.1 -faults oom-t* -prep { faultsim_restore_and_reopen db eval { SELECT * FROM "tbl one" } } -body { db eval { ALTER TABLE "tbl one" RENAME TO "tbl two" } } -test { faultsim_test_result {0 {}} } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5fault5.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # This file is focused on OOM errors. # source [file join [file dirname [info script]] fts5_common.tcl] source $testdir/malloc_common.tcl set testprefix fts5fault5 # If SQLITE_ENABLE_FTS3 is defined, omit this file. ifcapable !fts5 { finish_test return } #------------------------------------------------------------------------- # OOM while creating an FTS5 table. # do_faultsim_test 1.1 -faults oom-t* -prep { db eval { DROP TABLE IF EXISTS abc } } -body { db eval { CREATE VIRTUAL TABLE abc USING fts5(x,y) } } -test { faultsim_test_result {0 {}} } #------------------------------------------------------------------------- # OOM while writing a multi-tier doclist-index. And while running # integrity-check on the same. # reset_db do_execsql_test 2.0 { CREATE VIRTUAL TABLE tt USING fts5(x); INSERT INTO tt(tt, rank) VALUES('pgsz', 32); } faultsim_save_and_close do_faultsim_test 2.1 -faults oom-t* -prep { faultsim_restore_and_reopen db eval { SELECT * FROM tt } } -body { set str [string repeat "abc " 50] db eval { WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<100) INSERT INTO tt(rowid, x) SELECT i, $str FROM ii; } } -test { faultsim_test_result {0 {}} } do_faultsim_test 2.2 -faults oom-t* -body { db eval { INSERT INTO tt(tt) VALUES('integrity-check') } } -test { faultsim_test_result {0 {}} } #------------------------------------------------------------------------- # OOM while scanning fts5vocab tables. # reset_db do_test 3.0 { execsql { CREATE VIRTUAL TABLE tt USING fts5(x); CREATE VIRTUAL TABLE tv USING fts5vocab(tt, 'row'); CREATE VIRTUAL TABLE tt2 USING fts5(x, detail=col); CREATE VIRTUAL TABLE tv2 USING fts5vocab(tt2, 'col'); INSERT INTO tt(tt, rank) VALUES('pgsz', 32); INSERT INTO tt2(tt2, rank) VALUES('pgsz', 32); BEGIN; } for {set i 0} {$i < 20} {incr i} { set str [string repeat "$i " 50] execsql { INSERT INTO tt VALUES($str) } execsql { INSERT INTO tt2 VALUES($str) } } execsql COMMIT } {} do_faultsim_test 3.1 -faults oom-t* -body { db eval { SELECT term FROM tv; } } -test { faultsim_test_result {0 {0 1 10 11 12 13 14 15 16 17 18 19 2 3 4 5 6 7 8 9}} } do_faultsim_test 3.2 -faults oom-t* -body { db eval { SELECT term FROM tv WHERE term BETWEEN '1' AND '2'; } } -test { faultsim_test_result {0 {1 10 11 12 13 14 15 16 17 18 19 2}} } do_execsql_test 3.3.0 { SELECT * FROM tv2; } { 0 x 1 {} 1 x 1 {} 10 x 1 {} 11 x 1 {} 12 x 1 {} 13 x 1 {} 14 x 1 {} 15 x 1 {} 16 x 1 {} 17 x 1 {} 18 x 1 {} 19 x 1 {} 2 x 1 {} 3 x 1 {} 4 x 1 {} 5 x 1 {} 6 x 1 {} 7 x 1 {} 8 x 1 {} 9 x 1 {} } do_faultsim_test 3.3 -faults oom-t* -body { db eval { SELECT * FROM tv2; } } -test { faultsim_test_result [list 0 [list \ 0 x 1 {} 1 x 1 {} 10 x 1 {} 11 x 1 {} 12 x 1 {} 13 x 1 {} \ 14 x 1 {} 15 x 1 {} 16 x 1 {} 17 x 1 {} 18 x 1 {} 19 x 1 {} \ 2 x 1 {} 3 x 1 {} 4 x 1 {} 5 x 1 {} 6 x 1 {} 7 x 1 {} 8 x 1 {} \ 9 x 1 {} ]] } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5fault6.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # This file is focused on OOM errors. # source [file join [file dirname [info script]] fts5_common.tcl] source $testdir/malloc_common.tcl set testprefix fts5fault6 # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } #------------------------------------------------------------------------- # OOM while rebuilding an FTS5 table. # do_execsql_test 1.0 { CREATE VIRTUAL TABLE tt USING fts5(a, b); INSERT INTO tt VALUES('c d c g g f', 'a a a d g a'); INSERT INTO tt VALUES('c d g b f d', 'b g e c g c'); INSERT INTO tt VALUES('c c f d e d', 'c e g d b c'); INSERT INTO tt VALUES('e a f c e f', 'g b a c d g'); INSERT INTO tt VALUES('c g f b b d', 'g c d c f g'); INSERT INTO tt VALUES('d a g a b b', 'g c g g c e'); INSERT INTO tt VALUES('e f a b c e', 'f d c d c c'); INSERT INTO tt VALUES('e c a g c d', 'b b g f f b'); INSERT INTO tt VALUES('g b d d e b', 'f f b d a c'); INSERT INTO tt VALUES('e a d a e d', 'c e a e f g'); } faultsim_save_and_close do_faultsim_test 1.1 -faults oom-t* -prep { faultsim_restore_and_reopen } -body { db eval { INSERT INTO tt(tt) VALUES('rebuild') } } -test { faultsim_test_result {0 {}} } do_faultsim_test 1.2 -faults oom-t* -prep { faultsim_restore_and_reopen } -body { db eval { REPLACE INTO tt(rowid, a, b) VALUES(6, 'x y z', 'l l l'); } } -test { faultsim_test_result {0 {}} } #------------------------------------------------------------------------- # OOM within a special delete. # reset_db do_execsql_test 2.0 { CREATE VIRTUAL TABLE tt USING fts5(a, content=""); INSERT INTO tt VALUES('c d c g g f'); INSERT INTO tt VALUES('c d g b f d'); INSERT INTO tt VALUES('c c f d e d'); INSERT INTO tt VALUES('e a f c e f'); INSERT INTO tt VALUES('c g f b b d'); INSERT INTO tt VALUES('d a g a b b'); INSERT INTO tt VALUES('e f a b c e'); INSERT INTO tt VALUES('e c a g c d'); INSERT INTO tt VALUES('g b d d e b'); INSERT INTO tt VALUES('e a d a e d'); } faultsim_save_and_close do_faultsim_test 2.1 -faults oom-t* -prep { faultsim_restore_and_reopen } -body { db eval { INSERT INTO tt(tt, rowid, a) VALUES('delete', 3, 'c d g b f d'); } } -test { faultsim_test_result {0 {}} } do_faultsim_test 2.2 -faults oom-t* -prep { faultsim_restore_and_reopen } -body { db eval { INSERT INTO tt(tt) VALUES('delete-all') } } -test { faultsim_test_result {0 {}} } do_faultsim_test 2.3 -faults oom-t* -prep { faultsim_restore_and_reopen } -body { db eval { INSERT INTO tt VALUES('x y z') } } -test { faultsim_test_result {0 {}} } #------------------------------------------------------------------------- # OOM in the ASCII tokenizer with very large tokens. # # Also the unicode tokenizer. # set t1 [string repeat wxyz 20] set t2 [string repeat wxyz 200] set t3 [string repeat wxyz 2000] set doc "$t1 $t2 $t3" do_execsql_test 3.0 { CREATE VIRTUAL TABLE xyz USING fts5(c, tokenize=ascii, content=""); CREATE VIRTUAL TABLE xyz2 USING fts5(c, content=""); } faultsim_save_and_close do_faultsim_test 3.1 -faults oom-t* -prep { faultsim_restore_and_reopen db eval { SELECT * FROM xyz } } -body { db eval { INSERT INTO xyz VALUES($::doc) } } -test { faultsim_test_result {0 {}} } do_faultsim_test 3.2 -faults oom-t* -prep { faultsim_restore_and_reopen db eval { SELECT * FROM xyz2 } } -body { db eval { INSERT INTO xyz2 VALUES($::doc) } } -test { faultsim_test_result {0 {}} } #------------------------------------------------------------------------- # OOM while initializing a unicode61 tokenizer. # reset_db faultsim_save_and_close do_faultsim_test 4.1 -faults oom-t* -prep { faultsim_restore_and_reopen } -body { db eval { CREATE VIRTUAL TABLE yu USING fts5(x, tokenize="unicode61 separators abc"); } } -test { faultsim_test_result {0 {}} } #------------------------------------------------------------------------- # # 5.2.* OOM while running a query that includes synonyms and matchinfo(). # # 5.3.* OOM while running a query that returns a row containing instances # of more than 4 synonyms for a single term. # proc mit {blob} { set scan(littleEndian) i* set scan(bigEndian) I* binary scan $blob $scan($::tcl_platform(byteOrder)) r return $r } proc tcl_tokenize {tflags text} { foreach {w iStart iEnd} [fts5_tokenize_split $text] { sqlite3_fts5_token $w $iStart $iEnd if {$tflags=="query" && [string length $w]==1} { for {set i 2} {$i < 7} {incr i} { sqlite3_fts5_token -colo [string repeat $w $i] $iStart $iEnd } } } } proc tcl_create {args} { return "tcl_tokenize" } reset_db sqlite3_fts5_create_tokenizer db tcl tcl_create db func mit mit sqlite3_fts5_register_matchinfo db do_test 5.0 { execsql { CREATE VIRTUAL TABLE t1 USING fts5(a, tokenize=tcl) } execsql { INSERT INTO t1(t1, rank) VALUES('pgsz', 32) } foreach {rowid text} { 1 {aaaa cc b aaaaa cc aa} 2 {aa aa bb a bbb} 3 {bb aaaaa aaaaa b aaaa aaaaa} 4 {aa a b aaaa aa} 5 {aa b ccc aaaaa cc} 6 {aa aaaaa bbbb cc aaa} 7 {aaaaa aa aa ccccc bb} 8 {ccc bbbbb ccccc bbb c} 9 {cccccc bbbb a aaa cccc c} 20 {ddd f ddd eeeee fff ffff eeee ddd fff eeeee dddddd eeee} 21 {fffff eee dddd fffff dd ee ee eeeee eee eeeeee ee dd e} 22 {fffff d eeee dddd fffff dddddd ffff ddddd eeeee ee eee dddd ddddd} 23 {ddddd fff ddd eeeee ffff eeee ddd ff ff ffffff eeeeee dddd ffffff} 24 {eee dd ee dddd dddd eeeeee e eee fff ffff} 25 {ddddd ffffff dddddd fff ddd ddddd ddd f eeee fff dddd f} 26 {f ffff fff fff eeeeee dddd d dddddd ddddd eee ff eeeee} 27 {eee fff dddddd eeeee eeeee dddd ddddd ffff f eeeee eee dddddd ddddd d} 28 {dd ddddd d ddd d fff d dddd ee dddd ee ddd dddddd dddddd} 29 {eeee dddd ee dddd eeee dddd dd fffff f ddd eeeee ddd ee} 30 {ff ffffff eeeeee eeeee eee ffffff ff ffff f fffff eeeee} 31 {fffff eeeeee dddd eeee eeee eeeeee eee fffff d ddddd ffffff ffff dddddd} 32 {dddddd fffff ee eeeeee eeee ee fff dddd fff eeee ffffff eeeeee ffffff} 33 {ddddd eeee dd ffff dddddd fff eeee ddddd ffff eeee ddd} 34 {ee dddd ddddd dddddd eeee eeeeee f dd ee dddddd ffffff} 35 {ee dddd dd eeeeee ddddd eee d eeeeee dddddd eee dddd fffff} 36 {eee ffffff ffffff e fffff eeeee ff dddddd dddddd fff} 37 {eeeee fffff dddddd dddd ffffff fff f dd ee dd dd eeeee} 38 {eeeeee ee d ff eeeeee eeeeee eee eeeee ee ffffff dddd eeee dddddd ee} 39 {eeeeee ddd fffff e dddd ee eee eee ffffff ee f d dddd} 40 {ffffff dddddd eee ee ffffff eee eeee ddddd ee eeeeee f} 41 {ddd ddd fff fffff ee fffff f fff ddddd fffff} 42 {dddd ee ff d f ffffff fff ffffff ff dd dddddd f eeee} 43 {d dd fff fffff d f fff e dddd ee ee} 44 {ff ffff eee ddd d dd ffff dddd d eeee d eeeeee} 45 {eeee f eeeee ee e ffff f ddd e fff} 46 {ffff d ffff eeee ffff eeeee f ffff ddddd eee} 47 {dd dd dddddd ddddd fffff dddddd ddd ddddd eeeeee ffff eeee eee ee} 48 {ffff ffff e dddd ffffff dd dd dddd f fffff} 49 {ffffff d dddddd ffff eeeee f ffff ffff d dd fffff eeeee} 50 {x e} } { execsql { INSERT INTO t1(rowid, a) VALUES($rowid, $text) } } } {} set res [list {*}{ 1 {3 24 8 2 12 6} 5 {2 24 8 2 12 6} 6 {3 24 8 1 12 6} 7 {3 24 8 1 12 6} 9 {2 24 8 3 12 6} }] do_execsql_test 5.1.1 { SELECT rowid, mit(matchinfo(t1, 'x')) FROM t1 WHERE t1 MATCH 'a AND c' } $res do_execsql_test 5.1.2 { SELECT count(*) FROM t1 WHERE t1 MATCH 'd e f' } 29 faultsim_save_and_close do_faultsim_test 5.2 -faults oom* -prep { faultsim_restore_and_reopen sqlite3_fts5_create_tokenizer db tcl tcl_create sqlite3_fts5_register_matchinfo db db func mit mit } -body { db eval { SELECT rowid, mit(matchinfo(t1, 'x')) FROM t1 WHERE t1 MATCH 'a AND c' } } -test { faultsim_test_result [list 0 $::res] } do_faultsim_test 5.3 -faults oom* -prep { faultsim_restore_and_reopen sqlite3_fts5_create_tokenizer db tcl tcl_create } -body { db eval { SELECT count(*) FROM t1 WHERE t1 MATCH 'd AND e AND f' } } -test { faultsim_test_result {0 29} } do_faultsim_test 5.4 -faults oom* -prep { faultsim_restore_and_reopen sqlite3_fts5_create_tokenizer db tcl tcl_create } -body { db eval { SELECT count(*) FROM t1 WHERE t1 MATCH 'x + e' } } -test { faultsim_test_result {0 1} } #------------------------------------------------------------------------- catch { db close } do_faultsim_test 6 -faults oom* -prep { sqlite_orig db test.db sqlite3_db_config_lookaside db 0 0 0 } -test { faultsim_test_result {0 {}} {1 {initialization of fts5 failed: }} if {$testrc==0} { db eval { CREATE VIRTUAL TABLE temp.t1 USING fts5(x) } } db close } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5fault7.test ================================================ # 2015 September 3 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # This file is focused on OOM errors. # source [file join [file dirname [info script]] fts5_common.tcl] source $testdir/malloc_common.tcl set testprefix fts5fault7 # If SQLITE_ENABLE_FTS3 is defined, omit this file. ifcapable !fts5 { finish_test return } if 1 { #------------------------------------------------------------------------- # Test fault-injection on a query that uses xColumnSize() on columnsize=0 # table. # do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(x, columnsize=0); INSERT INTO t1 VALUES('a b c d e f g'); INSERT INTO t1 VALUES('a b c d'); INSERT INTO t1 VALUES('a b c d e f g h i j'); } fts5_aux_test_functions db do_faultsim_test 1 -faults oom* -body { execsql { SELECT fts5_test_columnsize(t1) FROM t1 WHERE t1 MATCH 'b' } } -test { faultsim_test_result {0 {7 4 10}} {1 SQLITE_NOMEM} } } #------------------------------------------------------------------------- # Test fault-injection when a segment is promoted. # do_execsql_test 1.0 { CREATE VIRTUAL TABLE t2 USING fts5(a); INSERT INTO t2(t2, rank) VALUES('automerge', 0); INSERT INTO t2(t2, rank) VALUES('crisismerge', 4); INSERT INTO t2(t2, rank) VALUES('pgsz', 40); INSERT INTO t2 VALUES('a b c'); INSERT INTO t2 VALUES('d e f'); INSERT INTO t2 VALUES('f e d'); INSERT INTO t2 VALUES('c b a'); INSERT INTO t2 VALUES('a b c'); INSERT INTO t2 VALUES('d e f'); INSERT INTO t2 VALUES('f e d'); INSERT INTO t2 VALUES('c b a'); } {} faultsim_save_and_close do_faultsim_test 1 -faults oom-t* -prep { faultsim_restore_and_reopen db eval { BEGIN; INSERT INTO t2 VALUES('c d c g g f'); INSERT INTO t2 VALUES('c d g b f d'); INSERT INTO t2 VALUES('c c f d e d'); INSERT INTO t2 VALUES('e a f c e f'); INSERT INTO t2 VALUES('c g f b b d'); INSERT INTO t2 VALUES('d a g a b b'); INSERT INTO t2 VALUES('e f a b c e'); INSERT INTO t2 VALUES('e c a g c d'); INSERT INTO t2 VALUES('g b d d e b'); INSERT INTO t2 VALUES('e a d a e d'); } } -body { db eval COMMIT } -test { faultsim_test_result {0 {}} } #------------------------------------------------------------------------- # Test fault-injection when a segment is promoted. # reset_db do_execsql_test 2.0 { CREATE VIRTUAL TABLE xy USING fts5(x); INSERT INTO xy(rowid, x) VALUES(1, '1 2 3'); INSERT INTO xy(rowid, x) VALUES(2, '2 3 4'); INSERT INTO xy(rowid, x) VALUES(3, '3 4 5'); } faultsim_save_and_close do_faultsim_test 2.1 -faults oom-* -prep { faultsim_restore_and_reopen } -body { db eval { UPDATE OR REPLACE xy SET rowid=3 WHERE rowid = 2 } } -test { faultsim_test_result {0 {}} } # Test fault-injection when an empty expression is parsed. # do_faultsim_test 2.2 -faults oom-* -body { db eval { SELECT * FROM xy('""') } } -test { faultsim_test_result {0 {}} } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5fault8.test ================================================ # 2015 September 3 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # This file is focused on OOM errors. # source [file join [file dirname [info script]] fts5_common.tcl] source $testdir/malloc_common.tcl set testprefix fts5fault8 # If SQLITE_ENABLE_FTS3 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { fts5_aux_test_functions db do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, detail=%DETAIL%); INSERT INTO t1 VALUES('a b c d', '1 2 3 4'); INSERT INTO t1 VALUES('a b a b', NULL); INSERT INTO t1 VALUES(NULL, '1 2 1 2'); } do_faultsim_test 1 -faults oom-* -body { execsql { SELECT rowid, fts5_test_poslist(t1) FROM t1 WHERE t1 MATCH 'b OR 2' } } -test { faultsim_test_result {0 {1 {0.0.1 1.1.1} 2 {0.0.1 0.0.3} 3 {1.1.1 1.1.3}}} \ {1 SQLITE_NOMEM} } do_faultsim_test 2 -faults oom-* -body { execsql { INSERT INTO t1(t1) VALUES('integrity-check') } } -test { faultsim_test_result {0 {}} {1 SQLITE_NOMEM} } if {[detail_is_none]==0} { do_faultsim_test 3 -faults oom-* -body { execsql { SELECT rowid FROM t1('b:2') } } -test { faultsim_test_result {0 {1 3}} {1 SQLITE_NOMEM} } } } ;# foreach_detail_mode... do_execsql_test 4.0 { CREATE VIRTUAL TABLE x2 USING fts5(a); INSERT INTO x2(x2, rank) VALUES('crisismerge', 2); INSERT INTO x2(x2, rank) VALUES('pgsz', 32); INSERT INTO x2 VALUES('a b c d'); INSERT INTO x2 VALUES('e f g h'); INSERT INTO x2 VALUES('i j k l'); INSERT INTO x2 VALUES('m n o p'); INSERT INTO x2 VALUES('q r s t'); INSERT INTO x2 VALUES('u v w x'); INSERT INTO x2 VALUES('y z a b'); } faultsim_save_and_close do_faultsim_test 4 -faults oom-* -prep { faultsim_restore_and_reopen } -body { execsql { INSERT INTO x2(x2) VALUES('optimize') } } -test { faultsim_test_result {0 {}} {1 SQLITE_NOMEM} } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5fault9.test ================================================ # 2015 September 3 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # This file is focused on OOM errors. # source [file join [file dirname [info script]] fts5_common.tcl] source $testdir/malloc_common.tcl set testprefix fts5fault9 # If SQLITE_ENABLE_FTS3 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { fts5_aux_test_functions db do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); WITH seq(s) AS ( SELECT 1 UNION ALL SELECT s+1 FROM seq WHERE s<50) INSERT INTO t1 SELECT 'x x x y y y', 'a b c d e f' FROM seq; } do_faultsim_test 1 -faults oom-* -body { execsql { SELECT count(*) FROM t1('x AND y') } } -test { faultsim_test_result {0 50} } do_execsql_test 2.0 { CREATE VIRTUAL TABLE t2 USING fts5(a, b, detail=%DETAIL%); INSERT INTO t2(t2, rank) VALUES('pgsz', 32); INSERT INTO t2 VALUES('abc cba', 'cba abc'); INSERT INTO t2 VALUES('abc cba', 'cba abc'); INSERT INTO t2 VALUES('abc cba', 'cba abc'); INSERT INTO t2 VALUES('axy cyx', 'cyx axy'); INSERT INTO t2 VALUES('axy cyx', 'cyx axy'); INSERT INTO t2 VALUES('axy cyx', 'cyx axy'); } do_faultsim_test 2 -faults oom-* -body { execsql { SELECT count(*) FROM t2('a* AND c*') } } -test { faultsim_test_result {0 6} } do_execsql_test 3.0 { CREATE VIRTUAL TABLE t3 USING fts5(a, detail=%DETAIL%); INSERT INTO t3 VALUES('a x x a x a a a'); INSERT INTO t3 VALUES('x a a x a x x x'); } do_faultsim_test 3.1 -faults oom-* -body { execsql { SELECT highlight(t3, 0, '[', ']') FROM t3('a') } } -test { faultsim_test_result {0 {{[a] x x [a] x [a] [a] [a]} {x [a] [a] x [a] x x x}}} } do_faultsim_test 3.2 -faults oom-t* -body { execsql { SELECT fts5_test_poslist2(t3) FROM t3('x') } } -test { faultsim_test_result \ {0 {{0.0.1 0.0.2 0.0.4} {0.0.0 0.0.3 0.0.5 0.0.6 0.0.7}}} \ {1 SQLITE_NOMEM} } #------------------------------------------------------------------------- # Test OOM injection with the xPhraseFirstColumn() API and a tokenizer # uses query synonyms. # fts5_tclnum_register db do_execsql_test 4.0 { CREATE VIRTUAL TABLE t4 USING fts5(x, y, z, detail=%DETAIL%, tokenize=tclnum); INSERT INTO t4 VALUES('one two three', '1 2 3', 'i ii iii'); INSERT INTO t4 VALUES('1 2 3', 'i ii iii', 'one two three'); INSERT INTO t4 VALUES('i ii iii', 'one two three', 'i ii iii'); INSERT INTO t4 VALUES('a1 a2 a3', 'a4 a5 a6', 'a7 a8 a9'); INSERT INTO t4 VALUES('b1 b2 b3', 'b4 b5 b6', 'b7 b8 b9'); INSERT INTO t4 VALUES('c1 c2 c3', 'c4 c5 c6', 'c7 c8 c9'); } do_faultsim_test 4.1 -faults oom-t* -body { execsql { SELECT rowid, fts5_test_collist(t4) FROM t4('2') } } -test { faultsim_test_result \ {0 {1 {0.0 0.1 0.2} 2 {0.0 0.1 0.2} 3 {0.0 0.1 0.2}}} {1 SQLITE_NOMEM} } do_faultsim_test 4.2 -faults oom-t* -body { execsql { SELECT rowid, fts5_test_collist(t4) FROM t4('a5 OR b5 OR c5') } } -test { faultsim_test_result \ {0 {4 {0.0 0.1 0.2} 5 {1.0 1.1 1.2} 6 {2.0 2.1 2.2}}} {1 SQLITE_NOMEM} } #------------------------------------------------------------------------- # An OOM within an "ORDER BY rank" query. # db func rnddoc fts5_rnddoc do_execsql_test 5.0 { CREATE VIRTUAL TABLE xx USING fts5(x, y, detail=%DETAIL%); INSERT INTO xx VALUES ('def', 'abc ' || rnddoc(10)); INSERT INTO xx VALUES ('def', 'abc abc' || rnddoc(9)); INSERT INTO xx VALUES ('def', 'abc abc abc' || rnddoc(8)); } {} faultsim_save_and_close do_faultsim_test 5 -faults oom-* -prep { faultsim_restore_and_reopen execsql { SELECT * FROM xx } } -body { execsql { SELECT rowid FROM xx('abc AND def') ORDER BY rank } } -test { faultsim_test_result [list 0 {3 2 1}] } set doc [string repeat "xyz " 500] do_execsql_test 6.0 { CREATE VIRTUAL TABLE yy USING fts5(y, detail=%DETAIL%); INSERT INTO yy(yy, rank) VALUES('pgsz', 64); INSERT INTO yy VALUES ($doc); INSERT INTO yy VALUES ('1 2 3'); INSERT INTO yy VALUES ('xyz'); UPDATE yy SET y = y WHERE rowid = 1; UPDATE yy SET y = y WHERE rowid = 1; UPDATE yy SET y = y WHERE rowid = 1; UPDATE yy SET y = y WHERE rowid = 1; } {} do_faultsim_test 6 -faults oom-* -body { execsql { SELECT rowid FROM yy('xyz') } } -test { faultsim_test_result [list 0 {1 3}] } } ;# foreach_detail_mode... finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5faultA.test ================================================ # 2016 February 2 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # This file is focused on OOM errors. # source [file join [file dirname [info script]] fts5_common.tcl] source $testdir/malloc_common.tcl set testprefix fts5faultA # If SQLITE_ENABLE_FTS3 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { do_execsql_test 1.0 { CREATE VIRTUAL TABLE o1 USING fts5(a, detail=%DETAIL%); INSERT INTO o1(o1, rank) VALUES('pgsz', 32); WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<300 ) INSERT INTO o1 SELECT 'A B C' FROM s; INSERT INTO o1 VALUES('A X C'); WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<300 ) INSERT INTO o1 SELECT 'A B C' FROM s; } do_faultsim_test 1 -faults oom* -prep { sqlite3 db test.db } -body { execsql { SELECT rowid FROM o1('a NOT b') } } -test { faultsim_test_result {0 301} } } do_execsql_test 2.0 { CREATE VIRTUAL TABLE o2 USING fts5(a); INSERT INTO o2 VALUES('A B C'); WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<300 ) INSERT INTO o2 SELECT group_concat('A B C ') FROM s; } do_faultsim_test 2 -faults oom* -prep { sqlite3 db test.db } -body { execsql { SELECT rowid FROM o2('a+b+c NOT xyz') } } -test { faultsim_test_result {0 {1 2}} } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5faultB.test ================================================ # 2016 February 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # This file is focused on OOM errors. # source [file join [file dirname [info script]] fts5_common.tcl] source $testdir/malloc_common.tcl set testprefix fts5faultB # If SQLITE_ENABLE_FTS3 is defined, omit this file. ifcapable !fts5 { finish_test return } proc mit {blob} { set scan(littleEndian) i* set scan(bigEndian) I* binary scan $blob $scan($::tcl_platform(byteOrder)) r return $r } db func mit mit #------------------------------------------------------------------------- # Errors while registering the matchinfo() demo function. # do_faultsim_test 1 -faults oom* -prep { sqlite3 db test.db } -body { sqlite3_fts5_register_matchinfo db } -test { faultsim_test_result {0 {}} {1 SQLITE_ERROR} {1 SQLITE_NOMEM} } #------------------------------------------------------------------------- # Errors while executing the matchinfo() demo function. # reset_db sqlite3_fts5_register_matchinfo db db func mit mit do_execsql_test 2 { CREATE VIRTUAL TABLE t1 USING fts5(a, b); INSERT INTO t1 VALUES('x y z', '1 2 3'); INSERT INTO t1 VALUES('x', '1 2 3 4 5 6 7'); } do_faultsim_test 2.1 -faults oom* -body { execsql { SELECT mit(matchinfo(t1, 'a')) FROM t1('x') } } -test { faultsim_test_result {0 {{2 5} {2 5}}} } do_faultsim_test 2.2 -faults oom* -body { execsql { SELECT mit(matchinfo(t1, 'l')) FROM t1('x') } } -test { faultsim_test_result {0 {{3 3} {1 7}}} } do_execsql_test 2.3 { INSERT INTO t1 VALUES('a b c d e f', 'a b d e f c'); INSERT INTO t1 VALUES('l m b c a', 'n o a b c z'); } do_faultsim_test 2.4 -faults oom* -body { execsql { SELECT mit(matchinfo(t1, 's')) FROM t1('a b c') } } -test { faultsim_test_result {0 {{3 2} {2 3}}} } #------------------------------------------------------------------------- # reset_db do_execsql_test 3.0 { CREATE VIRTUAL TABLE x1 USING fts5(z); } do_faultsim_test 3.1 -faults oom* -body { execsql { SELECT rowid FROM x1('c') WHERE rowid>1; } } -test { faultsim_test_result {0 {}} } do_execsql_test 3.2 { INSERT INTO x1 VALUES('a b c'); INSERT INTO x1 VALUES('b c d'); INSERT INTO x1 VALUES('c d e'); INSERT INTO x1 VALUES('d e f'); } do_faultsim_test 3.3 -faults oom* -body { execsql { SELECT rowid FROM x1('c') WHERE rowid>1; } } -test { faultsim_test_result {0 {2 3}} } #------------------------------------------------------------------------- # Test OOM injection with nested colsets. # reset_db do_execsql_test 4.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, c, d); INSERT INTO t1 VALUES('a', 'b', 'c', 'd'); -- 1 INSERT INTO t1 VALUES('d', 'a', 'b', 'c'); -- 2 INSERT INTO t1 VALUES('c', 'd', 'a', 'b'); -- 3 INSERT INTO t1 VALUES('b', 'c', 'd', 'a'); -- 4 } do_faultsim_test 4.1 -faults oom* -body { execsql { SELECT rowid FROM t1('{a b c} : (b:a AND c:b)'); } } -test { faultsim_test_result {0 2} } do_faultsim_test 4.2 -faults oom* -body { execsql { SELECT rowid FROM t1('{a b c} : (a AND d)') } } -test { faultsim_test_result {0 {2 3}} } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5faultD.test ================================================ # 2016 February 2 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # This file is focused on OOM errors. # source [file join [file dirname [info script]] fts5_common.tcl] source $testdir/malloc_common.tcl set testprefix fts5faultA # If SQLITE_ENABLE_FTS3 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { if {"%DETAIL%"=="none"} continue do_execsql_test 1.0 { CREATE VIRTUAL TABLE o1 USING fts5(a, b, c, detail=%DETAIL%); INSERT INTO o1(o1, rank) VALUES('pgsz', 32); WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<60 ) INSERT INTO o1 SELECT 'A', 'B', 'C' FROM s; WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<60 ) INSERT INTO o1 SELECT 'C', 'A', 'B' FROM s; WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<60 ) INSERT INTO o1 SELECT 'B', 'C', 'A' FROM s; } do_faultsim_test 1 -faults int* -prep { sqlite3 db test.db } -body { execsql { SELECT count(*) FROM o1('a') } } -test { faultsim_test_result {0 180} {1 {vtable constructor failed: o1}} } do_faultsim_test 2 -faults int* -prep { sqlite3 db test.db } -body { execsql { SELECT * FROM o1('a:a AND {b c}:b') ORDER BY rank } expr 1 } -test { faultsim_test_result {0 1} {1 {vtable constructor failed: o1}} } do_faultsim_test 3 -faults int* -prep { sqlite3 db test.db } -body { execsql { SELECT * FROM o1('{b c}:b NOT a:a') ORDER BY rank } expr 1 } -test { faultsim_test_result {0 1} {1 {vtable constructor failed: o1}} } do_faultsim_test 4 -faults int* -prep { sqlite3 db test.db } -body { execsql { SELECT * FROM o1('b:b OR a:a') } expr 1 } -test { faultsim_test_result {0 1} {1 {vtable constructor failed: o1}} } do_faultsim_test 5 -faults int* -prep { sqlite3 db test.db } -body { execsql { SELECT count(*) FROM o1('c:b') } expr 1 } -test { faultsim_test_result {0 1} {1 {vtable constructor failed: o1}} } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5full.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Test that SQLITE_FULL is returned if the FTS5 table cannot find a free # segid to use. In practice this can only really happen when automerge and # crisismerge are both disabled. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5full # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE x8 USING fts5(i); INSERT INTO x8(x8, rank) VALUES('automerge', 0); INSERT INTO x8(x8, rank) VALUES('crisismerge', 100000); } db func rnddoc fts5_rnddoc do_test 1.1 { list [catch { for {set i 0} {$i < 2500} {incr i} { execsql { INSERT INTO x8 VALUES( rnddoc(5) ); } } } msg] $msg } {1 {database or disk is full}} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5fuzz1.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # source [file join [file dirname [info script]] fts5_common.tcl] return_if_no_fts5 set testprefix fts5fuzz1 #------------------------------------------------------------------------- reset_db do_catchsql_test 1.1 { CREATE VIRTUAL TABLE f1 USING fts5(a b); } {/1 {parse error in.*}/} #------------------------------------------------------------------------- reset_db do_execsql_test 2.1 { CREATE VIRTUAL TABLE f1 USING fts5(a, b); INSERT INTO f1 VALUES('a b', 'c d'); INSERT INTO f1 VALUES('e f', 'a b'); } do_execsql_test 2.2.1 { SELECT rowid FROM f1('""'); } {} do_execsql_test 2.2.2 { SELECT rowid FROM f1('"" AND a'); } {} do_execsql_test 2.2.3 { SELECT rowid FROM f1('"" a'); } {1 2} do_execsql_test 2.2.4 { SELECT rowid FROM f1('"" OR a'); } {1 2} do_execsql_test 2.3 { SELECT a, b FROM f1('NEAR("")'); } {} do_execsql_test 2.4 { SELECT a, b FROM f1('NEAR("", 5)'); } {} do_execsql_test 2.5 { SELECT a, b FROM f1('NEAR("" c, 5)'); } {{a b} {c d}} do_execsql_test 2.6 { SELECT a, b FROM f1('NEAR("" c d, 5)'); } {{a b} {c d}} do_execsql_test 2.7 { SELECT a, b FROM f1('NEAR(c d, 5)'); } {{a b} {c d}} do_execsql_test 2.8 { SELECT rowid FROM f1('NEAR("a" "b", 5)'); } {1 2} #------------------------------------------------------------------------- reset_db do_execsql_test 3.2 { CREATE VIRTUAL TABLE f2 USING fts5(o, t, tokenize="ascii separators abc"); SELECT * FROM f2('a+4'); } {} #------------------------------------------------------------------------- reset_db do_catchsql_test 4.1 { CREATE VIRTUAL TABLE f2 USING fts5(o, t); SELECT * FROM f2('(8 AND 9)`AND 10'); } {1 {fts5: syntax error near "`"}} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5hash.test ================================================ # 2015 April 21 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # The tests in this file are focused on the code in fts5_hash.c. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5hash # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } #------------------------------------------------------------------------- # Return a list of tokens (a vocabulary) that all share the same hash # key value. This can be used to test hash collisions. # proc build_vocab1 {args} { set O(-nslot) 1024 set O(-nword) 20 set O(-hash) 88 set O(-prefix) "" if {[llength $args] % 2} { error "bad args" } array set O2 $args foreach {k v} $args { if {[info exists O($k)]==0} { error "bad option: $k" } set O($k) $v } set L [list] while {[llength $L] < $O(-nword)} { set t "$O(-prefix)[random_token]" set h [sqlite3_fts5_token_hash $O(-nslot) $t] if {$O(-hash)==$h} { lappend L $t } } return $L } proc random_token {} { set map [list 0 a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j] set iVal [expr int(rand() * 2000000)] return [string map $map $iVal] } proc random_doc {vocab nWord} { set doc "" set nVocab [llength $vocab] for {set i 0} {$i<$nWord} {incr i} { set j [expr {int(rand() * $nVocab)}] lappend doc [lindex $vocab $j] } return $doc } foreach_detail_mode $testprefix { set vocab [build_vocab1] db func r random_doc do_execsql_test 1.0 { CREATE VIRTUAL TABLE eee USING fts5(e, ee, detail=%DETAIL%); BEGIN; WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<100) INSERT INTO eee SELECT r($vocab, 5), r($vocab, 7) FROM ii; INSERT INTO eee(eee) VALUES('integrity-check'); COMMIT; INSERT INTO eee(eee) VALUES('integrity-check'); } set hash [sqlite3_fts5_token_hash 1024 xyz] set vocab [build_vocab1 -prefix xyz -hash $hash] lappend vocab xyz do_execsql_test 1.1 { CREATE VIRTUAL TABLE vocab USING fts5vocab(eee, 'row'); BEGIN; } do_test 1.2 { for {set i 1} {$i <= 100} {incr i} { execsql { INSERT INTO eee VALUES( r($vocab, 5), r($vocab, 7) ) } } } {} do_test 1.3 { db eval { SELECT term, doc FROM vocab } { set nRow [db one {SELECT count(*) FROM eee WHERE eee MATCH $term}] if {$nRow != $doc} { error "term=$term fts5vocab=$doc cnt=$nRow" } } set {} {} } {} do_execsql_test 1.4 { COMMIT; INSERT INTO eee(eee) VALUES('integrity-check'); } #----------------------------------------------------------------------- # Add a small and very large token with the same hash value to an # empty table. At one point this would provoke an asan error. # do_test 2.0 { set big [string repeat 12345 40] set hash [sqlite3_fts5_token_hash 1024 $big] while {1} { set small [random_token] if {[sqlite3_fts5_token_hash 1024 $small]==$hash} break } execsql { CREATE VIRTUAL TABLE t2 USING fts5(x, detail=%DETAIL%) } execsql { INSERT INTO t2 VALUES($small || ' ' || $big); } } {} } ;# foreach_detail_mode finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5integrity.test ================================================ # 2015 Jan 13 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # This file contains tests focused on the integrity-check procedure. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5integrity # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE xx USING fts5(x); INSERT INTO xx VALUES('term'); } do_execsql_test 1.1 { INSERT INTO xx(xx) VALUES('integrity-check'); } do_execsql_test 2.0 { CREATE VIRTUAL TABLE yy USING fts5(x, prefix=1); INSERT INTO yy VALUES('term'); } do_execsql_test 2.1 { INSERT INTO yy(yy) VALUES('integrity-check'); } #-------------------------------------------------------------------- # do_execsql_test 3.0 { CREATE VIRTUAL TABLE zz USING fts5(z); INSERT INTO zz(zz, rank) VALUES('pgsz', 32); INSERT INTO zz VALUES('b b b b b b b b b b b b b b'); INSERT INTO zz SELECT z FROM zz; INSERT INTO zz SELECT z FROM zz; INSERT INTO zz SELECT z FROM zz; INSERT INTO zz SELECT z FROM zz; INSERT INTO zz SELECT z FROM zz; INSERT INTO zz SELECT z FROM zz; INSERT INTO zz(zz) VALUES('optimize'); } do_execsql_test 3.1 { INSERT INTO zz(zz) VALUES('integrity-check'); } #-------------------------------------------------------------------- # Mess around with a docsize record. And the averages record. Then # check that integrity-check picks it up. # do_execsql_test 4.0 { CREATE VIRTUAL TABLE aa USING fts5(zz); INSERT INTO aa(zz) VALUES('a b c d e'); INSERT INTO aa(zz) VALUES('a b c d'); INSERT INTO aa(zz) VALUES('a b c'); INSERT INTO aa(zz) VALUES('a b'); INSERT INTO aa(zz) VALUES('a'); SELECT length(sz) FROM aa_docsize; } {1 1 1 1 1} do_execsql_test 4.1 { INSERT INTO aa(aa) VALUES('integrity-check'); } do_catchsql_test 4.2 { BEGIN; UPDATE aa_docsize SET sz = X'44' WHERE rowid = 3; INSERT INTO aa(aa) VALUES('integrity-check'); } {1 {database disk image is malformed}} do_catchsql_test 4.3 { ROLLBACK; BEGIN; UPDATE aa_data SET block = X'44' WHERE rowid = 1; INSERT INTO aa(aa) VALUES('integrity-check'); } {1 {database disk image is malformed}} do_catchsql_test 4.4 { ROLLBACK; BEGIN; INSERT INTO aa_docsize VALUES(23, X'04'); INSERT INTO aa(aa) VALUES('integrity-check'); } {1 {database disk image is malformed}} do_catchsql_test 4.5 { ROLLBACK; BEGIN; INSERT INTO aa_docsize VALUES(23, X'00'); INSERT INTO aa_content VALUES(23, ''); INSERT INTO aa(aa) VALUES('integrity-check'); } {1 {database disk image is malformed}} #db eval {SELECT rowid, fts5_decode(rowid, block) aS r FROM zz_data} {puts $r} #exit execsql { ROLLBACK } #------------------------------------------------------------------------- # Test that integrity-check works on a reasonably large db with many # different terms. # Document generator command. proc rnddoc {n} { set doc [list] for {set i 0} {$i<$n} {incr i} { lappend doc [format %.5d [expr int(rand()*10000)]] } return $doc } db func rnddoc rnddoc expr srand(0) do_execsql_test 5.0 { CREATE VIRTUAL TABLE gg USING fts5(a, prefix="1,2,3"); INSERT INTO gg(gg, rank) VALUES('pgsz', 256); INSERT INTO gg VALUES(rnddoc(20)); INSERT INTO gg SELECT rnddoc(20) FROM gg; INSERT INTO gg SELECT rnddoc(20) FROM gg; INSERT INTO gg SELECT rnddoc(20) FROM gg; INSERT INTO gg SELECT rnddoc(20) FROM gg; INSERT INTO gg SELECT rnddoc(20) FROM gg; INSERT INTO gg SELECT rnddoc(20) FROM gg; INSERT INTO gg SELECT rnddoc(20) FROM gg; INSERT INTO gg SELECT rnddoc(20) FROM gg; INSERT INTO gg SELECT rnddoc(20) FROM gg; INSERT INTO gg SELECT rnddoc(20) FROM gg; INSERT INTO gg SELECT rnddoc(20) FROM gg; } do_execsql_test 5.1 { INSERT INTO gg(gg) VALUES('integrity-check'); } do_execsql_test 5.2 { INSERT INTO gg(gg) VALUES('optimize'); } do_execsql_test 5.3 { INSERT INTO gg(gg) VALUES('integrity-check'); } do_test 5.4.1 { set ok 0 for {set i 0} {$i < 10000} {incr i} { set T [format %.5d $i] set res [db eval { SELECT rowid FROM gg($T) ORDER BY rowid ASC }] set res2 [db eval { SELECT rowid FROM gg($T) ORDER BY rowid DESC }] if {$res == [lsort -integer $res2]} { incr ok } } set ok } {10000} do_test 5.4.2 { set ok 0 for {set i 0} {$i < 100} {incr i} { set T "[format %.3d $i]*" set res [db eval { SELECT rowid FROM gg($T) ORDER BY rowid ASC }] set res2 [db eval { SELECT rowid FROM gg($T) ORDER BY rowid DESC }] if {$res == [lsort -integer $res2]} { incr ok } } set ok } {100} #------------------------------------------------------------------------- # Similar to 5.*. # foreach {tn pgsz} { 1 32 2 36 3 40 4 44 5 48 } { do_execsql_test 6.$tn.1 { DROP TABLE IF EXISTS hh; CREATE VIRTUAL TABLE hh USING fts5(y); INSERT INTO hh(hh, rank) VALUES('pgsz', $pgsz); WITH s(i) AS (SELECT 0 UNION ALL SELECT i+1 FROM s WHERE i<999) INSERT INTO hh SELECT printf("%.3d%.3d%.3d %.3d%.3d%.3d",i,i,i,i+1,i+1,i+1) FROM s; WITH s(i) AS (SELECT 0 UNION ALL SELECT i+1 FROM s WHERE i<999) INSERT INTO hh SELECT printf("%.3d%.3d%.3d %.3d%.3d%.3d",i,i,i,i+1,i+1,i+1) FROM s; INSERT INTO hh(hh) VALUES('optimize'); } do_test 6.$tn.2 { set ok 0 for {set i 0} {$i < 1000} {incr i} { set T [format %.3d%.3d%.3d $i $i $i] set res [db eval { SELECT rowid FROM hh($T) ORDER BY rowid ASC }] set res2 [db eval { SELECT rowid FROM hh($T) ORDER BY rowid DESC }] if {$res == [lsort -integer $res2]} { incr ok } } set ok } {1000} } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5lastrowid.test ================================================ # 2017 Feb 27 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests of the last_insert_rowid functionality with fts5. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5lastrowid # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(str); } do_execsql_test 1.1 { INSERT INTO t1 VALUES('one string'); INSERT INTO t1 VALUES('two string'); INSERT INTO t1 VALUES('three string'); SELECT last_insert_rowid(); } {3} do_execsql_test 1.2 { BEGIN; INSERT INTO t1 VALUES('one string'); INSERT INTO t1 VALUES('two string'); INSERT INTO t1 VALUES('three string'); COMMIT; SELECT last_insert_rowid(); } {6} do_execsql_test 1.3 { INSERT INTO t1(rowid, str) VALUES(-22, 'some more text'); SELECT last_insert_rowid(); } {-22} do_execsql_test 1.4 { BEGIN; INSERT INTO t1(rowid, str) VALUES(45, 'some more text'); INSERT INTO t1(rowid, str) VALUES(46, 'some more text'); INSERT INTO t1(rowid, str) VALUES(222, 'some more text'); SELECT last_insert_rowid(); COMMIT; SELECT last_insert_rowid(); } {222 222} do_execsql_test 1.5 { CREATE TABLE x1(x); INSERT INTO x1 VALUES('john'), ('paul'), ('george'), ('ringo'); INSERT INTO t1 SELECT x FROM x1; SELECT last_insert_rowid(); } {226} do_execsql_test 1.6 { INSERT INTO t1(rowid, str) SELECT rowid+10, x FROM x1; SELECT last_insert_rowid(); } {14} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5leftjoin.test ================================================ # 2014 June 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5leftjoin # If SQLITE_ENABLE_FTS5 is not defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE vt USING fts5(x); INSERT INTO vt VALUES('abc'); INSERT INTO vt VALUES('xyz'); CREATE TABLE t1(a INTEGER PRIMARY KEY); INSERT INTO t1 VALUES(1), (2); } do_execsql_test 1.1 { SELECT * FROM t1 LEFT JOIN ( SELECT rowid AS rrr, * FROM vt WHERE vt MATCH 'abc' ) ON t1.a = rrr } {1 1 abc 2 {} {}} do_execsql_test 1.2 { SELECT * FROM t1 LEFT JOIN vt ON (vt MATCH 'abc') } {1 abc 2 abc} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5matchinfo.test ================================================ # 2015 August 05 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5matchinfo # If SQLITE_ENABLE_FTS5 is not defined, omit this file. ifcapable !fts5 { finish_test ; return } foreach_detail_mode $testprefix { proc mit {blob} { set scan(littleEndian) i* set scan(bigEndian) I* binary scan $blob $scan($::tcl_platform(byteOrder)) r return $r } db func mit mit sqlite3_fts5_register_matchinfo db do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(content, detail=%DETAIL%); } do_execsql_test 1.1 { INSERT INTO t1(content) VALUES('I wandered lonely as a cloud'); INSERT INTO t1(content) VALUES('That floats on high o''er vales and hills,'); INSERT INTO t1(content) VALUES('When all at once I saw a crowd,'); INSERT INTO t1(content) VALUES('A host, of golden daffodils,'); SELECT mit(matchinfo(t1)) FROM t1 WHERE t1 MATCH 'I'; } {{1 1 1 2 2} {1 1 1 2 2}} # Now create an FTS4 table that does not specify matchinfo=fts3. # do_execsql_test 1.2 { CREATE VIRTUAL TABLE t2 USING fts5(content, detail=%DETAIL%); INSERT INTO t2 SELECT * FROM t1; SELECT mit(matchinfo(t2)) FROM t2 WHERE t2 MATCH 'I'; } {{1 1 1 2 2} {1 1 1 2 2}} #-------------------------------------------------------------------------- # Proc [do_matchinfo_test] is used to test the FTSX matchinfo() function. # # The first argument - $tn - is a test identifier. This may be either a # full identifier (i.e. "fts3matchinfo-1.1") or, if global var $testprefix # is set, just the numeric component (i.e. "1.1"). # # The second argument is the name of an FTSX table. The third is the # full text of a WHERE/MATCH expression to query the table for # (i.e. "t1 MATCH 'abc'"). The final argument - $results - should be a # key-value list (serialized array) with matchinfo() format specifiers # as keys, and the results of executing the statement: # # SELECT matchinfo($tbl, '$key') FROM $tbl WHERE $expr # # For example: # # CREATE VIRTUAL TABLE t1 USING fts4; # INSERT INTO t1 VALUES('abc'); # INSERT INTO t1 VALUES('def'); # INSERT INTO t1 VALUES('abc abc'); # # do_matchinfo_test 1.1 t1 "t1 MATCH 'abc'" { # n {3 3} # p {1 1} # c {1 1} # x {{1 3 2} {2 3 2}} # } # # If the $results list contains keys mapped to "-" instead of a matchinfo() # result, then this command computes the expected results based on other # mappings to test the matchinfo() function. For example, the command above # could be changed to: # # do_matchinfo_test 1.1 t1 "t1 MATCH 'abc'" { # n {3 3} p {1 1} c {1 1} x {{1 3 2} {2 3 2}} # pcx - # } # # And this command would compute the expected results for matchinfo(t1, 'pcx') # based on the results of matchinfo(t1, 'p'), matchinfo(t1, 'c') and # matchinfo(t1, 'x') in order to test 'pcx'. # proc do_matchinfo_test {tn tbl expr results} { foreach {fmt res} $results { if {$res == "-"} continue set resarray($fmt) $res } set nRow 0 foreach {fmt res} [array get resarray] { if {[llength $res]>$nRow} { set nRow [llength $res] } } # Construct expected results for any formats for which the caller # supplied result is "-". # foreach {fmt res} $results { if {$res == "-"} { set res [list] for {set iRow 0} {$iRow<$nRow} {incr iRow} { set rowres [list] foreach c [split $fmt ""] { set rowres [concat $rowres [lindex $resarray($c) $iRow]] } lappend res $rowres } set resarray($fmt) $res } } # Test each matchinfo() request individually. # foreach {fmt res} [array get resarray] { set sql "SELECT mit(matchinfo($tbl, '$fmt')) FROM $tbl WHERE $expr" do_execsql_test $tn.$fmt $sql [normalize2 $res] } # Test them all executed together (multiple invocations of matchinfo()). # set exprlist [list] foreach {format res} [array get resarray] { lappend exprlist "mit(matchinfo($tbl, '$format'))" } set allres [list] for {set iRow 0} {$iRow<$nRow} {incr iRow} { foreach {format res} [array get resarray] { lappend allres [lindex $res $iRow] } } set sql "SELECT [join $exprlist ,] FROM $tbl WHERE $expr" do_execsql_test $tn.multi $sql [normalize2 $allres] } proc normalize2 {list_of_lists} { set res [list] foreach elem $list_of_lists { lappend res [list {*}$elem] } return $res } # Similar to [do_matchinfo_test], except that this is a no-op if the FTS5 # mode is not detail=full. # proc do_matchinfo_p_test {tn tbl expr results} { if {[detail_is_full]} { uplevel [list do_matchinfo_test $tn $tbl $expr $results] } } do_execsql_test 4.1.0 { CREATE VIRTUAL TABLE t4 USING fts5(x, y, detail=%DETAIL%); INSERT INTO t4 VALUES('a b c d e', 'f g h i j'); INSERT INTO t4 VALUES('f g h i j', 'a b c d e'); } do_matchinfo_test 4.1.1 t4 {t4 MATCH 'a b c'} { s {{3 0} {0 3}} } do_matchinfo_test 4.1.1 t4 {t4 MATCH 'a b c'} { p {3 3} x { {1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1} {0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1} } } do_matchinfo_test 4.1.1 t4 {t4 MATCH 'a b c'} { p {3 3} c {2 2} x { {1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1} {0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1} } n {2 2} l {{5 5} {5 5}} a {{5 5} {5 5}} s {{3 0} {0 3}} xxxxxxxxxxxxxxxxxx - pcx - xpc - ccc - pppxpcpcx - laxnpc - xpxsscplax - } do_matchinfo_p_test 4.1.2 t4 {t4 MATCH '"g h i"'} { p {1 1} c {2 2} x { {0 1 1 1 1 1} {1 1 1 0 1 1} } n {2 2} l {{5 5} {5 5}} a {{5 5} {5 5}} s {{0 1} {1 0}} xxxxxxxxxxxxxxxxxx - pcx - xpc - ccc - pppxpcpcx - laxnpc - sxsxs - } do_matchinfo_test 4.1.3 t4 {t4 MATCH 'a b'} { s {{2 0} {0 2}} } do_matchinfo_p_test 4.1.4 t4 {t4 MATCH '"a b" c'} { s {{2 0} {0 2}} } do_matchinfo_p_test 4.1.5 t4 {t4 MATCH 'a "b c"'} { s {{2 0} {0 2}} } do_matchinfo_test 4.1.6 t4 {t4 MATCH 'd d'} { s {{1 0} {0 1}} } do_matchinfo_test 4.1.7 t4 {t4 MATCH 'f OR abcd'} { x { {0 1 1 1 1 1 0 0 0 0 0 0} {1 1 1 0 1 1 0 0 0 0 0 0} } } do_matchinfo_test 4.1.8 t4 {t4 MATCH 'f NOT abcd'} { x { {0 1 1 1 1 1 0 0 0 0 0 0} {1 1 1 0 1 1 0 0 0 0 0 0} } } do_execsql_test 4.2.0 { CREATE VIRTUAL TABLE t5 USING fts5(content, detail=%DETAIL%); INSERT INTO t5 VALUES('a a a a a'); INSERT INTO t5 VALUES('a b a b a'); INSERT INTO t5 VALUES('c b c b c'); INSERT INTO t5 VALUES('x x x x x'); } do_matchinfo_test 4.2.1 t5 {t5 MATCH 'a a'} { x {{5 8 2 5 8 2} {3 8 2 3 8 2}} s {2 1} } do_matchinfo_test 4.2.2 t5 {t5 MATCH 'a b'} { s {2} } do_matchinfo_test 4.2.3 t5 {t5 MATCH 'a b a'} { s {3} } do_matchinfo_test 4.2.4 t5 {t5 MATCH 'a a a'} { s {3 1} } do_matchinfo_p_test 4.2.5 t5 {t5 MATCH '"a b" "a b"'} { s {2} } do_matchinfo_test 4.2.6 t5 {t5 MATCH 'a OR b'} { s {1 2 1} } do_execsql_test 4.3.0 "INSERT INTO t5 VALUES('x y [string repeat {b } 50000]')"; # It used to be that the second 'a' token would be deferred. That doesn't # work any longer. if 0 { do_matchinfo_test 4.3.1 t5 {t5 MATCH 'a a'} { x {{5 8 2 5 5 5} {3 8 2 3 5 5}} s {2 1} } } do_matchinfo_test 4.3.2 t5 {t5 MATCH 'a b'} { s {2} } do_matchinfo_test 4.3.3 t5 {t5 MATCH 'a b a'} { s {3} } do_matchinfo_test 4.3.4 t5 {t5 MATCH 'a a a'} { s {3 1} } do_matchinfo_p_test 4.3.5 t5 {t5 MATCH '"a b" "a b"'} { s {2} } do_matchinfo_test 4.3.6 t5 {t5 MATCH 'a OR b'} { s {1 2 1 1} } do_execsql_test 4.4.0.1 { INSERT INTO t5(t5) VALUES('optimize') } do_matchinfo_test 4.4.2 t5 {t5 MATCH 'a b'} { s {2} } do_matchinfo_test 4.4.1 t5 {t5 MATCH 'a a'} { s {2 1} } do_matchinfo_test 4.4.2 t5 {t5 MATCH 'a b'} { s {2} } do_matchinfo_test 4.4.3 t5 {t5 MATCH 'a b a'} { s {3} } do_matchinfo_test 4.4.4 t5 {t5 MATCH 'a a a'} { s {3 1} } do_matchinfo_p_test 4.4.5 t5 {t5 MATCH '"a b" "a b"'} { s {2} } do_execsql_test 4.5.0 { CREATE VIRTUAL TABLE t6 USING fts5(a, b, c, detail=%DETAIL%); INSERT INTO t6 VALUES('a', 'b', 'c'); } do_matchinfo_test 4.5.1 t6 {t6 MATCH 'a b c'} { s {{1 1 1}} } #------------------------------------------------------------------------- # Test the outcome of matchinfo() when used within a query that does not # use the full-text index (i.e. lookup by rowid or full-table scan). # do_execsql_test 7.1 { CREATE VIRTUAL TABLE t10 USING fts5(content, detail=%DETAIL%); INSERT INTO t10 VALUES('first record'); INSERT INTO t10 VALUES('second record'); } do_execsql_test 7.2 { SELECT typeof(matchinfo(t10)), length(matchinfo(t10)) FROM t10; } {blob 8 blob 8} do_execsql_test 7.3 { SELECT typeof(matchinfo(t10)), length(matchinfo(t10)) FROM t10 WHERE rowid=1; } {blob 8} do_execsql_test 7.4 { SELECT typeof(matchinfo(t10)), length(matchinfo(t10)) FROM t10 WHERE t10 MATCH 'record' } {blob 20 blob 20} #------------------------------------------------------------------------- # Test a special case - matchinfo('nxa') with many zero length documents. # Special because "x" internally uses a statement used by both "n" and "a". # This was causing a problem at one point in the obscure case where the # total number of bytes of data stored in an fts3 table was greater than # the number of rows. i.e. when the following query returns true: # # SELECT sum(length(content)) < count(*) FROM fts4table; # do_execsql_test 8.1 { CREATE VIRTUAL TABLE t11 USING fts5(content, detail=%DETAIL%); INSERT INTO t11(t11, rank) VALUES('pgsz', 32); INSERT INTO t11 VALUES('quitealongstringoftext'); INSERT INTO t11 VALUES('anotherquitealongstringoftext'); INSERT INTO t11 VALUES('athirdlongstringoftext'); INSERT INTO t11 VALUES('andonemoreforgoodluck'); } do_test 8.2 { for {set i 0} {$i < 200} {incr i} { execsql { INSERT INTO t11 VALUES('') } } execsql { INSERT INTO t11(t11) VALUES('optimize') } } {} do_execsql_test 8.3 { SELECT mit(matchinfo(t11, 'nxa')) FROM t11 WHERE t11 MATCH 'a*' } {{204 1 3 3 0} {204 1 3 3 0} {204 1 3 3 0}} #------------------------------------------------------------------------- if {[detail_is_full]} { do_execsql_test 9.1 { CREATE VIRTUAL TABLE t12 USING fts5(content, detail=%DETAIL%); INSERT INTO t12 VALUES('a b c d'); SELECT mit(matchinfo(t12,'x')) FROM t12 WHERE t12 MATCH 'NEAR(a d, 1) OR a'; } {{0 1 1 0 1 1 1 1 1}} do_execsql_test 9.2 { INSERT INTO t12 VALUES('a d c d'); SELECT mit(matchinfo(t12,'x')) FROM t12 WHERE t12 MATCH 'NEAR(a d, 1) OR a'; } { {0 2 2 0 3 2 1 2 2} {1 2 2 1 3 2 1 2 2} } do_execsql_test 9.3 { INSERT INTO t12 VALUES('a d d a'); SELECT mit(matchinfo(t12,'x')) FROM t12 WHERE t12 MATCH 'NEAR(a d, 1) OR a'; } { {0 4 3 0 5 3 1 4 3} {1 4 3 1 5 3 1 4 3} {2 4 3 2 5 3 2 4 3} } } #--------------------------------------------------------------------------- # Test for a memory leak # do_execsql_test 10.1 { DROP TABLE t10; CREATE VIRTUAL TABLE t10 USING fts5(idx, value, detail=%DETAIL%); INSERT INTO t10 values (1, 'one'),(2, 'two'),(3, 'three'); SELECT t10.rowid, t10.* FROM t10 JOIN (SELECT 1 AS idx UNION SELECT 2 UNION SELECT 3) AS x WHERE t10 MATCH x.idx AND matchinfo(t10) not null GROUP BY t10.rowid ORDER BY 1; } {1 1 one 2 2 two 3 3 three} #--------------------------------------------------------------------------- # Test the 'y' matchinfo flag # reset_db sqlite3_fts5_register_matchinfo db do_execsql_test 11.0 { CREATE VIRTUAL TABLE tt USING fts5(x, y, detail=%DETAIL%); INSERT INTO tt VALUES('c d a c d d', 'e a g b d a'); -- 1 INSERT INTO tt VALUES('c c g a e b', 'c g d g e c'); -- 2 INSERT INTO tt VALUES('b e f d e g', 'b a c b c g'); -- 3 INSERT INTO tt VALUES('a c f f g d', 'd b f d e g'); -- 4 INSERT INTO tt VALUES('g a c f c f', 'd g g b c c'); -- 5 INSERT INTO tt VALUES('g a c e b b', 'd b f b g g'); -- 6 INSERT INTO tt VALUES('f d a a f c', 'e e a d c f'); -- 7 INSERT INTO tt VALUES('a c b b g f', 'a b a e d f'); -- 8 INSERT INTO tt VALUES('b a f e c c', 'f d b b a b'); -- 9 INSERT INTO tt VALUES('f d c e a c', 'f a f a a f'); -- 10 } db func mit mit foreach {tn expr res} { 1 "a" { 1 {1 2} 2 {1 0} 3 {0 1} 4 {1 0} 5 {1 0} 6 {1 0} 7 {2 1} 8 {1 2} 9 {1 1} 10 {1 3} } 2 "b" { 1 {0 1} 2 {1 0} 3 {1 2} 4 {0 1} 5 {0 1} 6 {2 2} 8 {2 1} 9 {1 3} } 3 "y:a" { 1 {0 2} 3 {0 1} 7 {0 1} 8 {0 2} 9 {0 1} 10 {0 3} } 4 "x:a" { 1 {1 0} 2 {1 0} 4 {1 0} 5 {1 0} 6 {1 0} 7 {2 0} 8 {1 0} 9 {1 0} 10 {1 0} } 5 "a OR b" { 1 {1 2 0 1} 2 {1 0 1 0} 3 {0 1 1 2} 4 {1 0 0 1} 5 {1 0 0 1} 6 {1 0 2 2} 7 {2 1 0 0} 8 {1 2 2 1} 9 {1 1 1 3} 10 {1 3 0 0} } 6 "a AND b" { 1 {1 2 0 1} 2 {1 0 1 0} 3 {0 1 1 2} 4 {1 0 0 1} 5 {1 0 0 1} 6 {1 0 2 2} 8 {1 2 2 1} 9 {1 1 1 3} } 7 "a OR (a AND b)" { 1 {1 2 1 2 0 1} 2 {1 0 1 0 1 0} 3 {0 1 0 1 1 2} 4 {1 0 1 0 0 1} 5 {1 0 1 0 0 1} 6 {1 0 1 0 2 2} 7 {2 1 0 0 0 0} 8 {1 2 1 2 2 1} 9 {1 1 1 1 1 3} 10 {1 3 0 0 0 0} } } { if {[string match *:* $expr] && [detail_is_none]} continue do_execsql_test 11.1.$tn.1 { SELECT rowid, mit(matchinfo(tt, 'y')) FROM tt WHERE tt MATCH $expr } $res set r2 [list] foreach {rowid L} $res { lappend r2 $rowid set M [list] foreach {a b} $L { lappend M [expr ($a ? 1 : 0) + ($b ? 2 : 0)] } lappend r2 $M } do_execsql_test 11.1.$tn.2 { SELECT rowid, mit(matchinfo(tt, 'b')) FROM tt WHERE tt MATCH $expr } $r2 do_execsql_test 11.1.$tn.2 { SELECT rowid, mit(matchinfo(tt, 'b')) FROM tt WHERE tt MATCH $expr } $r2 } #--------------------------------------------------------------------------- # Test the 'b' matchinfo flag # reset_db sqlite3_fts5_register_matchinfo db db func mit mit do_test 12.0 { set cols [list] for {set i 0} {$i < 50} {incr i} { lappend cols "c$i" } execsql "CREATE VIRTUAL TABLE tt USING fts5([join $cols ,], detail=%DETAIL%)" } {} do_execsql_test 12.1 { INSERT INTO tt (rowid, c4, c45) VALUES(1, 'abc', 'abc'); SELECT mit(matchinfo(tt, 'b')) FROM tt WHERE tt MATCH 'abc'; } [list [list [expr 1<<4] [expr 1<<(45-32)]]] } ;# foreach_detail_mode #------------------------------------------------------------------------- # Test that a bad fts5() return is detected # reset_db proc xyz {} {} db func fts5 -argcount 1 xyz do_test 13.1 { list [catch { sqlite3_fts5_register_matchinfo db } msg] $msg } {1 SQLITE_ERROR} #------------------------------------------------------------------------- # Test that an invalid matchinfo() flag is detected # reset_db sqlite3_fts5_register_matchinfo db do_execsql_test 14.1 { CREATE VIRTUAL TABLE x1 USING fts5(z); INSERT INTO x1 VALUES('a b c a b c a b c'); } {} do_catchsql_test 14.2 { SELECT matchinfo(x1, 'd') FROM x1('a b c'); } {1 {unrecognized matchinfo flag: d}} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5merge.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Test that focus on incremental merges of segments. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5merge # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } db func repeat [list string repeat] #------------------------------------------------------------------------- # Create an fts index so that: # # * the index consists of two top-level segments # * each segment contains records related to $nRowPerSeg rows # * all rows consist of tokens "x" and "y" only. # # Then run ('merge', 1) until everything is completely merged. # proc do_merge1_test {testname nRowPerSeg} { set ::nRowPerSeg [expr $nRowPerSeg] do_execsql_test $testname.0 { DROP TABLE IF EXISTS x8; CREATE VIRTUAL TABLE x8 USING fts5(i); INSERT INTO x8(x8, rank) VALUES('pgsz', 32); WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<$::nRowPerSeg) INSERT INTO x8 SELECT repeat('x y ', i % 16) FROM ii; WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<$::nRowPerSeg) INSERT INTO x8 SELECT repeat('x y ', i % 16) FROM ii; INSERT INTO x8(x8, rank) VALUES('usermerge', 2); } for {set tn 1} {[lindex [fts5_level_segs x8] 0]>0} {incr tn} { do_execsql_test $testname.$tn { INSERT INTO x8(x8, rank) VALUES('merge', 1); INSERT INTO x8(x8) VALUES('integrity-check'); } if {$tn>5} break } do_test $testname.x [list expr "$tn < 5"] 1 } do_merge1_test 1.1 1 do_merge1_test 1.2 2 do_merge1_test 1.3 3 do_merge1_test 1.4 4 do_merge1_test 1.5 10 do_merge1_test 1.6 20 do_merge1_test 1.7 100 #------------------------------------------------------------------------- # proc do_merge2_test {testname nRow} { db func rnddoc fts5_rnddoc do_execsql_test $testname.0 { DROP TABLE IF EXISTS x8; CREATE VIRTUAL TABLE x8 USING fts5(i); INSERT INTO x8(x8, rank) VALUES('pgsz', 32); } set ::nRow $nRow do_test $testname.1 { for {set i 0} {$i < $::nRow} {incr i} { execsql { INSERT INTO x8 VALUES( rnddoc(($i%16) + 5) ) } while {[not_merged x8]} { execsql { INSERT INTO x8(x8, rank) VALUES('usermerge', 2); INSERT INTO x8(x8, rank) VALUES('merge', 1); INSERT INTO x8(x8, rank) VALUES('usermerge', 16); INSERT INTO x8(x8) VALUES('integrity-check'); } } } } {} } proc not_merged {tbl} { set segs [fts5_level_segs $tbl] foreach s $segs { if {$s>1} { return 1 } } return 0 } do_merge2_test 2.1 5 do_merge2_test 2.2 10 do_merge2_test 2.3 20 #------------------------------------------------------------------------- # Test that a merge will complete any merge that has already been # started, even if the number of input segments is less than the current # value of the 'usermerge' configuration parameter. # db func rnddoc fts5_rnddoc do_execsql_test 3.1 { DROP TABLE IF EXISTS x8; CREATE VIRTUAL TABLE x8 USING fts5(i); INSERT INTO x8(x8, rank) VALUES('pgsz', 32); INSERT INTO x8 VALUES(rnddoc(100)); INSERT INTO x8 VALUES(rnddoc(100)); } do_test 3.2 { execsql { INSERT INTO x8(x8, rank) VALUES('usermerge', 4); INSERT INTO x8(x8, rank) VALUES('merge', 1); } fts5_level_segs x8 } {2} do_test 3.3 { execsql { INSERT INTO x8(x8, rank) VALUES('usermerge', 2); INSERT INTO x8(x8, rank) VALUES('merge', 1); } fts5_level_segs x8 } {2 1} do_test 3.4 { execsql { INSERT INTO x8(x8, rank) VALUES('usermerge', 4) } while {[not_merged x8]} { execsql { INSERT INTO x8(x8, rank) VALUES('merge', 1) } } fts5_level_segs x8 } {0 1} #------------------------------------------------------------------------- # proc mydoc {} { set x [lindex {a b c d e f g h i j} [expr int(rand()*10)]] return [string repeat "$x " 30] } db func mydoc mydoc proc mycount {} { set res [list] foreach x {a b c d e f g h i j} { lappend res [db one {SELECT count(*) FROM x8 WHERE x8 MATCH $x}] } set res } #1 32 foreach {tn pgsz} { 2 1000 } { do_execsql_test 4.$tn.1 { DROP TABLE IF EXISTS x8; CREATE VIRTUAL TABLE x8 USING fts5(i); INSERT INTO x8(x8, rank) VALUES('pgsz', $pgsz); } do_execsql_test 4.$tn.2 { INSERT INTO x8(x8, rank) VALUES('merge', 1); } do_execsql_test 4.$tn.3 { WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<100) INSERT INTO x8 SELECT mydoc() FROM ii; WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<100) INSERT INTO x8 SELECT mydoc() FROM ii; INSERT INTO x8(x8, rank) VALUES('usermerge', 2); } set expect [mycount] for {set i 0} {$i < 20} {incr i} { do_test 4.$tn.4.$i { execsql { INSERT INTO x8(x8, rank) VALUES('merge', 1); } mycount } $expect break } # db eval {SELECT fts5_decode(rowid, block) AS r FROM x8_data} { puts $r } } #------------------------------------------------------------------------- # Test that the 'merge' command does not modify the database if there is # no work to do. do_execsql_test 5.1 { CREATE VIRTUAL TABLE x9 USING fts5(one, two); INSERT INTO x9(x9, rank) VALUES('pgsz', 32); INSERT INTO x9(x9, rank) VALUES('automerge', 2); INSERT INTO x9(x9, rank) VALUES('usermerge', 2); INSERT INTO x9 VALUES(rnddoc(100), rnddoc(100)); INSERT INTO x9 VALUES(rnddoc(100), rnddoc(100)); INSERT INTO x9 VALUES(rnddoc(100), rnddoc(100)); INSERT INTO x9 VALUES(rnddoc(100), rnddoc(100)); INSERT INTO x9 VALUES(rnddoc(100), rnddoc(100)); INSERT INTO x9 VALUES(rnddoc(100), rnddoc(100)); INSERT INTO x9 VALUES(rnddoc(100), rnddoc(100)); INSERT INTO x9 VALUES(rnddoc(100), rnddoc(100)); } do_test 5.2 { while 1 { set nChange [db total_changes] execsql { INSERT INTO x9(x9, rank) VALUES('merge', 1); } set nChange [expr [db total_changes] - $nChange] #puts $nChange if {$nChange<2} break } } {} #-------------------------------------------------------------------------- # Test that running 'merge' on an empty database does not cause a # problem. # reset_db do_execsql_test 6.0 { CREATE VIRTUAL TABLE g1 USING fts5(a, b); } do_execsql_test 6.1 { INSERT INTO g1(g1, rank) VALUES('merge', 10); } do_execsql_test 6.2 { INSERT INTO g1(g1, rank) VALUES('merge', -10); } do_execsql_test 6.3 { INSERT INTO g1(g1) VALUES('integrity-check'); } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5merge2.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Test that focus on incremental merges of segments. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5merge2 return_if_no_fts5 proc dump_structure {} { db eval {SELECT fts5_decode(id, block) AS t FROM t1_data WHERE id=10} { foreach lvl [lrange $t 1 end] { set seg [string repeat . [expr [llength $lvl]-2]] puts "[lrange $lvl 0 1] $seg" } } } foreach_detail_mode $testprefix { do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(x, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); INSERT INTO t1(t1, rank) VALUES('crisismerge', 2); INSERT INTO t1 VALUES('1 2 3 4'); } expr srand(0) db func rnddoc fts5_rnddoc do_test 1.1 { for {set i 0} {$i < 100} {incr i} { execsql { BEGIN; DELETE FROM t1 WHERE rowid = 1; INSERT INTO t1(rowid, x) VALUES(1, '1 2 3 4'); INSERT INTO t1 VALUES(rnddoc(10)); COMMIT; } } } {} do_execsql_test 1.2 { INSERT INTO t1(t1) VALUES('integrity-check'); } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5multiclient.test ================================================ # 2016 March 17 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # source [file join [file dirname [info script]] fts5_common.tcl] source $testdir/lock_common.tcl set testprefix fts5multiclient return_if_no_fts5 foreach_detail_mode $testprefix { do_multiclient_test tn { do_test 1.$tn.1 { sql1 { CREATE VIRTUAL TABLE t1 USING fts5(x, detail=%DETAIL%) } sql1 { INSERT INTO t1 VALUES('a b c') } sql2 { SELECT rowid FROM t1('b') } } {1} do_test 1.$tn.2 { sql2 { INSERT INTO t1 VALUES('a b c') } sql1 { SELECT rowid FROM t1('b') } } {1 2} do_test 1.$tn.3 { sql2 { INSERT INTO t1 VALUES('a b c') } sql1 { SELECT rowid FROM t1('b') } } {1 2 3} do_test 1.$tn.4 { sql2 { INSERT INTO t1 VALUES('a b c') } sql1 { INSERT INTO t1 VALUES('a b c') } sql3 { INSERT INTO t1(t1) VALUES('integrity-check') } } {} };# do_multiclient_test };# foreach_detail_mode finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5near.test ================================================ # 2014 Jan 08 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests focused on the NEAR operator. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5near # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } proc do_near_test {tn doc near res} { uplevel [list do_execsql_test $tn " DELETE FROM t1; INSERT INTO t1 VALUES('$doc'); SELECT count(*) FROM t1 WHERE t1 MATCH '$near'; " $res] } execsql { CREATE VIRTUAL TABLE t1 USING fts5(x, tokenize = "ascii tokenchars '.'") } do_near_test 1.1 ". . a . . . b . ." { NEAR(a b, 5) } 1 do_near_test 1.2 ". . a . . . b . ." { NEAR(a b, 4) } 1 do_near_test 1.3 ". . a . . . b . ." { NEAR(a b, 3) } 1 do_near_test 1.4 ". . a . . . b . ." { NEAR(a b, 2) } 0 do_near_test 1.5 ". . a . . . b . ." { NEAR(b a, 5) } 1 do_near_test 1.6 ". . a . . . b . ." { NEAR(b a, 4) } 1 do_near_test 1.7 ". . a . . . b . ." { NEAR(b a, 3) } 1 do_near_test 1.8 ". . a . . . b . ." { NEAR(b a, 2) } 0 do_near_test 1.9 ". a b . . . c . ." { NEAR("a b" c, 3) } 1 do_near_test 1.10 ". a b . . . c . ." { NEAR("a b" c, 2) } 0 do_near_test 1.11 ". a b . . . c . ." { NEAR(c "a b", 3) } 1 do_near_test 1.12 ". a b . . . c . ." { NEAR(c "a b", 2) } 0 do_near_test 1.13 ". a b . . . c d ." { NEAR(a+b c+d, 3) } 1 do_near_test 1.14 ". a b . . . c d ." { NEAR(a+b c+d, 2) } 0 do_near_test 1.15 ". a b . . . c d ." { NEAR(c+d a+b, 3) } 1 do_near_test 1.16 ". a b . . . c d ." { NEAR(c+d a+b, 2) } 0 do_near_test 1.17 ". a b . . . c d ." { NEAR(a b c d, 5) } 1 do_near_test 1.18 ". a b . . . c d ." { NEAR(a b c d, 4) } 0 do_near_test 1.19 ". a b . . . c d ." { NEAR(a+b c d, 4) } 1 do_near_test 1.20 "a b c d e f g h i" { NEAR(b+c a+b+c+d i, 5) } 1 do_near_test 1.21 "a b c d e f g h i" { NEAR(b+c a+b+c+d i, 4) } 0 do_near_test 1.22 "a b c d e f g h i" { NEAR(a+b+c+d i b+c, 5) } 1 do_near_test 1.23 "a b c d e f g h i" { NEAR(a+b+c+d i b+c, 4) } 0 do_near_test 1.24 "a b c d e f g h i" { NEAR(i a+b+c+d b+c, 5) } 1 do_near_test 1.25 "a b c d e f g h i" { NEAR(i a+b+c+d b+c, 4) } 0 finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5onepass.test ================================================ # 2015 Sep 27 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5onepass # If SQLITE_ENABLE_FTS3 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE ft USING fts5(content); INSERT INTO ft(rowid, content) VALUES(1, '1 2 3'); INSERT INTO ft(rowid, content) VALUES(2, '4 5 6'); INSERT INTO ft(rowid, content) VALUES(3, '7 8 9'); } #------------------------------------------------------------------------- # Check that UPDATE and DELETE statements that feature "WHERE rowid=?" or # or "WHERE rowid=?" clauses do not use statement journals. But that other # DELETE and UPDATE statements do. # # Note: "MATCH ? AND rowid=?" does use a statement journal. # foreach {tn sql uses} { 1.1 { DELETE FROM ft } 1 1.2 { DELETE FROM ft WHERE rowid=? } 0 1.3 { DELETE FROM ft WHERE rowid=? } 0 1.4 { DELETE FROM ft WHERE ft MATCH '1' } 1 1.5 { DELETE FROM ft WHERE ft MATCH '1' AND rowid=? } 1 1.6 { DELETE FROM ft WHERE ft MATCH '1' AND rowid=? } 1 2.1 { UPDATE ft SET content='a b c' } 1 2.2 { UPDATE ft SET content='a b c' WHERE rowid=? } 0 2.3 { UPDATE ft SET content='a b c' WHERE rowid=? } 0 2.4 { UPDATE ft SET content='a b c' WHERE ft MATCH '1' } 1 2.5 { UPDATE ft SET content='a b c' WHERE ft MATCH '1' AND rowid=? } 1 2.6 { UPDATE ft SET content='a b c' WHERE ft MATCH '1' AND rowid=? } 1 } { do_test 1.$tn { sql_uses_stmt db $sql } $uses } #------------------------------------------------------------------------- # Check that putting a "DELETE/UPDATE ... WHERE rowid=?" statement in a # trigger program does not prevent the VM from using a statement # transaction. Even if the calling statement cannot hit a constraint. # do_execsql_test 2.0 { CREATE TABLE t1(x); CREATE TRIGGER t1_ai AFTER INSERT ON t1 BEGIN DELETE FROM ft WHERE rowid=new.x; END; CREATE TRIGGER t1_ad AFTER DELETE ON t1 BEGIN UPDATE ft SET content = 'a b c' WHERE rowid=old.x; END; CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 BEGIN DELETE FROM ft WHERE rowid=old.x; END; } foreach {tn sql uses} { 1 { INSERT INTO t1 VALUES(1) } 1 2 { DELETE FROM t1 WHERE x=4 } 1 3 { UPDATE t1 SET x=10 WHERE x=11 } 1 } { do_test 2.$tn { sql_uses_stmt db $sql } $uses } #------------------------------------------------------------------------- # Test that an "UPDATE ... WHERE rowid=?" works and does not corrupt the # index when it strikes a constraint. Both inside and outside a # transaction. # foreach {tn tcl1 tcl2} { 1 {} {} 2 { execsql BEGIN } { if {[sqlite3_get_autocommit db]==1} { error "transaction rolled back!" } execsql COMMIT } } { do_execsql_test 3.$tn.0 { DROP TABLE IF EXISTS ft2; CREATE VIRTUAL TABLE ft2 USING fts5(content); INSERT INTO ft2(rowid, content) VALUES(1, 'a b c'); INSERT INTO ft2(rowid, content) VALUES(2, 'a b d'); INSERT INTO ft2(rowid, content) VALUES(3, 'a b e'); } eval $tcl1 foreach {tn2 sql content} { 1 { UPDATE ft2 SET rowid=2 WHERE rowid=1 } { 1 {a b c} 2 {a b d} 3 {a b e} } 2 { INSERT INTO ft2(rowid, content) VALUES(4, 'a b f'); UPDATE ft2 SET rowid=5 WHERE rowid=4; UPDATE ft2 SET rowid=3 WHERE rowid=5; } { 1 {a b c} 2 {a b d} 3 {a b e} 5 {a b f} } 3 { UPDATE ft2 SET rowid=3 WHERE rowid=4; -- matches 0 rows UPDATE ft2 SET rowid=2 WHERE rowid=3; } { 1 {a b c} 2 {a b d} 3 {a b e} 5 {a b f} } 4 { INSERT INTO ft2(rowid, content) VALUES(4, 'a b g'); UPDATE ft2 SET rowid=-1 WHERE rowid=4; UPDATE ft2 SET rowid=3 WHERE rowid=-1; } {-1 {a b g} 1 {a b c} 2 {a b d} 3 {a b e} 5 {a b f} } 5 { DELETE FROM ft2 WHERE rowid=451; DELETE FROM ft2 WHERE rowid=-1; UPDATE ft2 SET rowid = 2 WHERE rowid = 1; } {1 {a b c} 2 {a b d} 3 {a b e} 5 {a b f} } } { do_catchsql_test 3.$tn.$tn2.a $sql {1 {constraint failed}} do_execsql_test 3.$tn.$tn2.b { SELECT rowid, content FROM ft2 } $content do_execsql_test 3.$tn.$tn2.c { INSERT INTO ft2(ft2) VALUES('integrity-check'); } } eval $tcl2 } #------------------------------------------------------------------------- # Check that DELETE and UPDATE operations can be done without flushing # the in-memory hash table to disk. # reset_db do_execsql_test 4.1.1 { CREATE VIRTUAL TABLE ttt USING fts5(x); BEGIN; INSERT INTO ttt(rowid, x) VALUES(1, 'a b c'); INSERT INTO ttt(rowid, x) VALUES(2, 'a b c'); INSERT INTO ttt(rowid, x) VALUES(3, 'a b c'); COMMIT } do_test 4.1.2 { fts5_level_segs ttt } {1} do_execsql_test 4.2.1 { BEGIN; DELETE FROM ttt WHERE rowid=1; DELETE FROM ttt WHERE rowid=3; INSERT INTO ttt(rowid, x) VALUES(4, 'd e f'); INSERT INTO ttt(rowid, x) VALUES(5, 'd e f'); COMMIT; } {} do_test 4.2.2 { fts5_level_segs ttt } {2} do_execsql_test 4.3.1 { BEGIN; UPDATE ttt SET x = 'd e f' WHERE rowid = 2; UPDATE ttt SET x = 'A B C' WHERE rowid = 4; INSERT INTO ttt(rowid, x) VALUES(6, 'd e f'); COMMIT; } {} do_test 4.2.2 { fts5_level_segs ttt } {3} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5optimize.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5optimize # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } # # 1.* - Warm body tests for index optimization using ('optimize') # # 2.* - Warm body tests for index optimization using ('merge', -1) # proc rnddoc {nWord} { set vocab {a b c d e f g h i j k l m n o p q r s t u v w x y z} set nVocab [llength $vocab] set ret [list] for {set i 0} {$i < $nWord} {incr i} { lappend ret [lindex $vocab [expr {int(rand() * $nVocab)}]] } return $ret } foreach {tn nStep} { 1 2 2 10 3 50 4 500 } { reset_db db func rnddoc rnddoc do_execsql_test 1.$tn.1 { CREATE VIRTUAL TABLE t1 USING fts5(x, y); } do_test 1.$tn.2 { for {set i 0} {$i < $nStep} {incr i} { execsql { INSERT INTO t1 VALUES( rnddoc(5), rnddoc(5) ) } } } {} do_execsql_test 1.$tn.3 { INSERT INTO t1(t1) VALUES('integrity-check'); } do_execsql_test 1.$tn.4 { INSERT INTO t1(t1) VALUES('optimize'); } do_execsql_test 1.$tn.5 { INSERT INTO t1(t1) VALUES('integrity-check'); } do_test 1.$tn.6 { fts5_segcount t1 } 1 } foreach {tn nStep} { 1 2 2 10 3 50 4 500 } { reset_db db func rnddoc rnddoc do_execsql_test 1.$tn.1 { CREATE VIRTUAL TABLE t1 USING fts5(x, y); } do_test 2.$tn.2 { for {set i 0} {$i < $nStep} {incr i} { execsql { INSERT INTO t1 VALUES( rnddoc(5), rnddoc(5) ) } } } {} do_execsql_test 2.$tn.3 { INSERT INTO t1(t1) VALUES('integrity-check'); } do_test 2.$tn.4 { execsql { INSERT INTO t1(t1, rank) VALUES('merge', -1) } while 1 { set c [db total_changes] execsql { INSERT INTO t1(t1, rank) VALUES('merge', 1) } set c [expr [db total_changes]-$c] if {$c<2} break } } {} do_execsql_test 2.$tn.5 { INSERT INTO t1(t1) VALUES('integrity-check'); } do_test 2.$tn.6 { fts5_segcount t1 } 1 } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5phrase.test ================================================ # 2014 Jan 08 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests focused on phrase queries. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5phrase # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE t3 USING fts5(a, b, c); INSERT INTO t3 VALUES('d e a', 'd i j j f', 'i j i e b f h'); -- 1 INSERT INTO t3 VALUES('g a e', 'f g i g a', 'h d g i g h c'); -- 2 INSERT INTO t3 VALUES('e a d', 'e i h a f', 'c e h i f b i'); -- 3 INSERT INTO t3 VALUES('a g c', 'd j d j c', 'c d f j i g j'); -- 4 INSERT INTO t3 VALUES('b c b', 'j g c d f', 'j c j d g f b'); -- 5 INSERT INTO t3 VALUES('j a d', 'e b i h h', 'c c f g d i d'); -- 6 INSERT INTO t3 VALUES('a d f', 'h g i i i', 'e a g c i f b'); -- 7 INSERT INTO t3 VALUES('g f d', 'f c g b j', 'b b h h h j j'); -- 8 INSERT INTO t3 VALUES('f h g', 'c j f g j', 'd h d f e b h'); -- 9 INSERT INTO t3 VALUES('f h d', 'c i a d b', 'g b j b a d e'); -- 10 INSERT INTO t3 VALUES('j h h', 'j i h a g', 'd e i e a g j'); -- 11 INSERT INTO t3 VALUES('a b e', 'h g a g c', 'h c a a d e g'); -- 12 INSERT INTO t3 VALUES('a j g', 'i h i f i', 'a g h j g i b'); -- 13 INSERT INTO t3 VALUES('j h e', 'f e d i e', 'i d c f e d c'); -- 14 INSERT INTO t3 VALUES('d j d', 'd b i a c', 'g d h i d b e'); -- 15 INSERT INTO t3 VALUES('h j e', 'e b b c f', 'j a f g h d j'); -- 16 INSERT INTO t3 VALUES('c b j', 'c a b a i', 'h f i d a d c'); -- 17 INSERT INTO t3 VALUES('e e d', 'i d f c c', 'g i d a f e a'); -- 18 INSERT INTO t3 VALUES('e i g', 'e a b i h', 'i f d d a d f'); -- 19 INSERT INTO t3 VALUES('h g f', 'b h h j d', 'i f d e g j a'); -- 20 INSERT INTO t3 VALUES('e h f', 'j c b c f', 'j a j g h a c'); -- 21 INSERT INTO t3 VALUES('d c h', 'b g i c e', 'i i c d e h i'); -- 22 INSERT INTO t3 VALUES('a h i', 'a g d f f', 'e f i i b b h'); -- 23 INSERT INTO t3 VALUES('d d g', 'c c b c g', 'g c h e b c e'); -- 24 INSERT INTO t3 VALUES('a b b', 'b f a d i', 'd a h a b c i'); -- 25 INSERT INTO t3 VALUES('a f d', 'a j e a h', 'j i h j a i f'); -- 26 INSERT INTO t3 VALUES('d j d', 'h a d i a', 'h h f j h g a'); -- 27 INSERT INTO t3 VALUES('g a e', 'd g f a g', 'i d b c g g j'); -- 28 INSERT INTO t3 VALUES('j e h', 'g h j h g', 'd a e j a a h'); -- 29 INSERT INTO t3 VALUES('e j e', 'g e j g c', 'f c e b e e a'); -- 30 INSERT INTO t3 VALUES('h f f', 'i j g e c', 'j j f c a i j'); -- 31 INSERT INTO t3 VALUES('a g c', 'c g d b i', 'g h c b a a f'); -- 32 INSERT INTO t3 VALUES('c h i', 'j d h e e', 'a h i d c c j'); -- 33 INSERT INTO t3 VALUES('d a c', 'e d d b j', 'c e b b h i h'); -- 34 INSERT INTO t3 VALUES('d f h', 'c a f c c', 'j b b c c j f'); -- 35 INSERT INTO t3 VALUES('b g h', 'g c c c f', 'c g c f h e e'); -- 36 INSERT INTO t3 VALUES('f e a', 'b h f j h', 'j g h f d g f'); -- 37 INSERT INTO t3 VALUES('h f a', 'a e i j g', 'f d a f d f c'); -- 38 INSERT INTO t3 VALUES('f i c', 'f i i i i', 'e c f d h j f'); -- 39 INSERT INTO t3 VALUES('h h d', 'd i e d i', 'd f e i a h a'); -- 40 INSERT INTO t3 VALUES('f g c', 'd a f c h', 'b b g j c e g'); -- 41 INSERT INTO t3 VALUES('h i h', 'h d j d e', 'e d b b i e g'); -- 42 INSERT INTO t3 VALUES('b h i', 'j e i d a', 'j j h e e c a'); -- 43 INSERT INTO t3 VALUES('g i g', 'f c c f d', 'a c i c a d a'); -- 44 INSERT INTO t3 VALUES('c c f', 'a b j d b', 'c a e g f e c'); -- 45 INSERT INTO t3 VALUES('d h j', 'g c b j d', 'e a h f h j g'); -- 46 INSERT INTO t3 VALUES('a a d', 'j e j a i', 'i d c f f f b'); -- 47 INSERT INTO t3 VALUES('b g j', 'e c i h f', 'd d h b g a d'); -- 48 INSERT INTO t3 VALUES('c i a', 'a c c c c', 'e h i e h i e'); -- 49 INSERT INTO t3 VALUES('f f c', 'f f b i i', 'f f a j e c i'); -- 50 } proc pmatch {col expr} { return [expr {[string first $expr $col]>=0}] } db func pmatch pmatch foreach {tn cols tokens} { 1 a "c c" 2 b "c c" 3 c "c c" 4 {a b c} "c c" 5 {a b c} "b h" 6 {a b} "b h" 7 {a c} "b h" 8 {c a} "b h" 9 {c} "i e" 10 {b} "i e" 11 {a} "i e" } { set fts "{$cols}:[join $tokens +]" set where [list] foreach c $cols { lappend where "pmatch($c, '$tokens')" } set where [join $where " OR "] set res [db eval "SELECT rowid FROM t3 WHERE $where"] do_execsql_test "1.$tn.$fts->([llength $res] rows)" { SELECT rowid FROM t3($fts) } $res } do_execsql_test 2.0 { SELECT rowid, highlight(t3, 0, '*', '*'), highlight(t3, 1, '*', '*'), highlight(t3, 2, '*', '*') FROM t3('a:f+f') } { 31 {h *f f*} {i j g e c} {j j f c a i j} 50 {*f f* c} {f f b i i} {f f a j e c i} } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5plan.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # This file focuses on testing the planner (xBestIndex function). # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5plan # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE TABLE t1(x, y); CREATE VIRTUAL TABLE f1 USING fts5(ff); } do_eqp_test 1.1 { SELECT * FROM t1, f1 WHERE f1 MATCH t1.x } { 0 0 0 {SCAN TABLE t1} 0 1 1 {SCAN TABLE f1 VIRTUAL TABLE INDEX 65537:} } do_eqp_test 1.2 { SELECT * FROM t1, f1 WHERE f1 > t1.x } { 0 0 1 {SCAN TABLE f1 VIRTUAL TABLE INDEX 0:} 0 1 0 {SCAN TABLE t1} } do_eqp_test 1.3 { SELECT * FROM f1 WHERE f1 MATCH ? ORDER BY ff } { 0 0 0 {SCAN TABLE f1 VIRTUAL TABLE INDEX 65537:} 0 0 0 {USE TEMP B-TREE FOR ORDER BY} } do_eqp_test 1.4 { SELECT * FROM f1 ORDER BY rank } { 0 0 0 {SCAN TABLE f1 VIRTUAL TABLE INDEX 0:} 0 0 0 {USE TEMP B-TREE FOR ORDER BY} } do_eqp_test 1.5 { SELECT * FROM f1 WHERE rank MATCH ? } { 0 0 0 {SCAN TABLE f1 VIRTUAL TABLE INDEX 2:} } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5porter.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests focusing on the fts5 porter stemmer implementation. # # http://tartarus.org/martin/PorterStemmer/ # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5porter # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } set test_vocab { a a aaron aaron abaissiez abaissiez abandon abandon abandoned abandon abase abas abash abash abate abat abated abat abatement abat abatements abat abates abat abbess abbess abbey abbei abbeys abbei abbominable abbomin abbot abbot abbots abbot abbreviated abbrevi abed ab abel abel aberga aberga abergavenny abergavenni abet abet abetting abet abhominable abhomin abhor abhor abhorr abhorr abhorred abhor abhorring abhor abhors abhor abhorson abhorson abide abid abides abid abilities abil ability abil abject abject abjectly abjectli abjects abject abjur abjur abjure abjur able abl abler abler aboard aboard abode abod aboded abod abodements abod aboding abod abominable abomin abominably abomin abominations abomin abortive abort abortives abort abound abound abounding abound about about above abov abr abr abraham abraham abram abram abreast abreast abridg abridg abridge abridg abridged abridg abridgment abridg abroach abroach abroad abroad abrogate abrog abrook abrook abrupt abrupt abruption abrupt abruptly abruptli absence absenc absent absent absey absei absolute absolut absolutely absolut absolv absolv absolver absolv abstains abstain abstemious abstemi abstinence abstin abstract abstract absurd absurd absyrtus absyrtu abundance abund abundant abund abundantly abundantli abus abu abuse abus abused abus abuser abus abuses abus abusing abus abutting abut aby abi abysm abysm ac ac academe academ academes academ accent accent accents accent accept accept acceptable accept acceptance accept accepted accept accepts accept access access accessary accessari accessible access accidence accid accident accid accidental accident accidentally accident accidents accid accite accit accited accit accites accit acclamations acclam accommodate accommod accommodated accommod accommodation accommod accommodations accommod accommodo accommodo accompanied accompani accompany accompani accompanying accompani accomplices accomplic accomplish accomplish accomplished accomplish accomplishing accomplish accomplishment accomplish accompt accompt accord accord accordant accord accorded accord accordeth accordeth according accord accordingly accordingli accords accord accost accost accosted accost account account accountant account accounted account accounts account accoutred accoutr accoutrement accoutr accoutrements accoutr accrue accru accumulate accumul accumulated accumul accumulation accumul accurs accur accursed accurs accurst accurst accus accu accusation accus accusations accus accusative accus accusativo accusativo accuse accus accused accus accuser accus accusers accus accuses accus accuseth accuseth accusing accus accustom accustom accustomed accustom ace ac acerb acerb ache ach acheron acheron aches ach achiev achiev achieve achiev achieved achiev achievement achiev achievements achiev achiever achiev achieves achiev achieving achiev achilles achil aching ach achitophel achitophel acknowledg acknowledg acknowledge acknowledg acknowledged acknowledg acknowledgment acknowledg acknown acknown acold acold aconitum aconitum acordo acordo acorn acorn acquaint acquaint acquaintance acquaint acquainted acquaint acquaints acquaint acquir acquir acquire acquir acquisition acquisit acquit acquit acquittance acquitt acquittances acquitt acquitted acquit acre acr acres acr across across act act actaeon actaeon acted act acting act action action actions action actium actium active activ actively activ activity activ actor actor actors actor acts act actual actual acture actur acute acut acutely acut ad ad adage adag adallas adalla adam adam adamant adam add add added ad adder adder adders adder addeth addeth addict addict addicted addict addiction addict adding ad addition addit additions addit addle addl address address addressing address addrest addrest adds add adhere adher adheres adher adieu adieu adieus adieu adjacent adjac adjoin adjoin adjoining adjoin adjourn adjourn adjudg adjudg adjudged adjudg adjunct adjunct administer administ administration administr admir admir admirable admir admiral admir admiration admir admire admir admired admir admirer admir admiring admir admiringly admiringli admission admiss admit admit admits admit admittance admitt admitted admit admitting admit admonish admonish admonishing admonish admonishment admonish admonishments admonish admonition admonit ado ado adonis adoni adopt adopt adopted adopt adoptedly adoptedli adoption adopt adoptious adopti adopts adopt ador ador adoration ador adorations ador adore ador adorer ador adores ador adorest adorest adoreth adoreth adoring ador adorn adorn adorned adorn adornings adorn adornment adorn adorns adorn adown adown adramadio adramadio adrian adrian adriana adriana adriano adriano adriatic adriat adsum adsum adulation adul adulterate adulter adulterates adulter adulterers adulter adulteress adulteress adulteries adulteri adulterous adulter adultery adulteri adultress adultress advanc advanc advance advanc advanced advanc advancement advanc advancements advanc advances advanc advancing advanc advantage advantag advantageable advantag advantaged advantag advantageous advantag advantages advantag advantaging advantag advent advent adventur adventur adventure adventur adventures adventur adventuring adventur adventurous adventur adventurously adventur adversaries adversari adversary adversari adverse advers adversely advers adversities advers adversity advers advertis adverti advertise advertis advertised advertis advertisement advertis advertising advertis advice advic advis advi advise advis advised advis advisedly advisedli advises advis advisings advis advocate advoc advocation advoc aeacida aeacida aeacides aeacid aedile aedil aediles aedil aegeon aegeon aegion aegion aegles aegl aemelia aemelia aemilia aemilia aemilius aemiliu aeneas aenea aeolus aeolu aer aer aerial aerial aery aeri aesculapius aesculapiu aeson aeson aesop aesop aetna aetna afar afar afear afear afeard afeard affability affabl affable affabl affair affair affaire affair affairs affair affect affect affectation affect affectations affect affected affect affectedly affectedli affecteth affecteth affecting affect affection affect affectionate affection affectionately affection affections affect affects affect affeer affeer affianc affianc affiance affianc affianced affianc affied affi affin affin affined affin affinity affin affirm affirm affirmation affirm affirmatives affirm afflict afflict afflicted afflict affliction afflict afflictions afflict afflicts afflict afford afford affordeth affordeth affords afford affray affrai affright affright affrighted affright affrights affright affront affront affronted affront affy affi afield afield afire afir afloat afloat afoot afoot afore afor aforehand aforehand aforesaid aforesaid afraid afraid afresh afresh afric afric africa africa african african afront afront after after afternoon afternoon afterward afterward afterwards afterward ag ag again again against against agamemmon agamemmon agamemnon agamemnon agate agat agaz agaz age ag aged ag agenor agenor agent agent agents agent ages ag aggravate aggrav aggrief aggrief agile agil agincourt agincourt agitation agit aglet aglet agnize agniz ago ago agone agon agony agoni agree agre agreed agre agreeing agre agreement agreement agrees agre agrippa agrippa aground aground ague agu aguecheek aguecheek agued agu agueface aguefac agues agu ah ah aha aha ahungry ahungri ai ai aialvolio aialvolio aiaria aiaria aid aid aidance aidanc aidant aidant aided aid aiding aid aidless aidless aids aid ail ail aim aim aimed aim aimest aimest aiming aim aims aim ainsi ainsi aio aio air air aired air airless airless airs air airy airi ajax ajax akilling akil al al alabaster alabast alack alack alacrity alacr alarbus alarbu alarm alarm alarms alarm alarum alarum alarums alarum alas ala alb alb alban alban albans alban albany albani albeit albeit albion albion alchemist alchemist alchemy alchemi alcibiades alcibiad alcides alcid alder alder alderman alderman aldermen aldermen ale al alecto alecto alehouse alehous alehouses alehous alencon alencon alengon alengon aleppo aleppo ales al alewife alewif alexander alexand alexanders alexand alexandria alexandria alexandrian alexandrian alexas alexa alias alia alice alic alien alien aliena aliena alight alight alighted alight alights alight aliis alii alike alik alisander alisand alive aliv all all alla alla allay allai allayed allai allaying allai allayment allay allayments allay allays allai allegation alleg allegations alleg allege alleg alleged alleg allegiance allegi allegiant allegi alley allei alleys allei allhallowmas allhallowma alliance allianc allicholy allicholi allied alli allies alli alligant allig alligator allig allons allon allot allot allots allot allotted allot allottery allotteri allow allow allowance allow allowed allow allowing allow allows allow allur allur allure allur allurement allur alluring allur allusion allus ally alli allycholly allycholli almain almain almanac almanac almanack almanack almanacs almanac almighty almighti almond almond almost almost alms alm almsman almsman aloes alo aloft aloft alone alon along along alonso alonso aloof aloof aloud aloud alphabet alphabet alphabetical alphabet alphonso alphonso alps alp already alreadi also also alt alt altar altar altars altar alter alter alteration alter altered alter alters alter althaea althaea although although altitude altitud altogether altogeth alton alton alway alwai always alwai am am amaimon amaimon amain amain amaking amak amamon amamon amaz amaz amaze amaz amazed amaz amazedly amazedli amazedness amazed amazement amaz amazes amaz amazeth amazeth amazing amaz amazon amazon amazonian amazonian amazons amazon ambassador ambassador ambassadors ambassador amber amber ambiguides ambiguid ambiguities ambigu ambiguous ambigu ambition ambit ambitions ambit ambitious ambiti ambitiously ambiti amble ambl ambled ambl ambles ambl ambling ambl ambo ambo ambuscadoes ambuscado ambush ambush amen amen amend amend amended amend amendment amend amends amend amerce amerc america america ames am amiable amiabl amid amid amidst amidst amiens amien amis ami amiss amiss amities amiti amity amiti amnipotent amnipot among among amongst amongst amorous amor amorously amor amort amort amount amount amounts amount amour amour amphimacus amphimacu ample ampl ampler ampler amplest amplest amplified amplifi amplify amplifi amply ampli ampthill ampthil amurath amurath amyntas amynta an an anatomiz anatomiz anatomize anatom anatomy anatomi ancestor ancestor ancestors ancestor ancestry ancestri anchises anchis anchor anchor anchorage anchorag anchored anchor anchoring anchor anchors anchor anchovies anchovi ancient ancient ancientry ancientri ancients ancient ancus ancu and and andirons andiron andpholus andpholu andren andren andrew andrew andromache andromach andronici andronici andronicus andronicu anew anew ang ang angel angel angelica angelica angelical angel angelo angelo angels angel anger anger angerly angerli angers anger anges ang angiers angier angl angl anglais anglai angle angl angler angler angleterre angleterr angliae anglia angling angl anglish anglish angrily angrili angry angri anguish anguish angus angu animal anim animals anim animis animi anjou anjou ankle ankl anna anna annals annal anne ann annex annex annexed annex annexions annexion annexment annex annothanize annothan announces announc annoy annoi annoyance annoy annoying annoi annual annual anoint anoint anointed anoint anon anon another anoth anselmo anselmo answer answer answerable answer answered answer answerest answerest answering answer answers answer ant ant ante ant antenor antenor antenorides antenorid anteroom anteroom anthem anthem anthems anthem anthony anthoni anthropophagi anthropophagi anthropophaginian anthropophaginian antiates antiat antic antic anticipate anticip anticipates anticip anticipatest anticipatest anticipating anticip anticipation anticip antick antick anticly anticli antics antic antidote antidot antidotes antidot antigonus antigonu antiopa antiopa antipathy antipathi antipholus antipholu antipholuses antipholus antipodes antipod antiquary antiquari antique antiqu antiquity antiqu antium antium antoniad antoniad antonio antonio antonius antoniu antony antoni antres antr anvil anvil any ani anybody anybodi anyone anyon anything anyth anywhere anywher ap ap apace apac apart apart apartment apart apartments apart ape ap apemantus apemantu apennines apennin apes ap apiece apiec apish apish apollinem apollinem apollo apollo apollodorus apollodoru apology apolog apoplex apoplex apoplexy apoplexi apostle apostl apostles apostl apostrophas apostropha apoth apoth apothecary apothecari appal appal appall appal appalled appal appals appal apparel apparel apparell apparel apparelled apparel apparent appar apparently appar apparition apparit apparitions apparit appeach appeach appeal appeal appeals appeal appear appear appearance appear appeared appear appeareth appeareth appearing appear appears appear appeas appea appease appeas appeased appeas appelant appel appele appel appelee appele appeles appel appelez appelez appellant appel appellants appel appelons appelon appendix appendix apperil apperil appertain appertain appertaining appertain appertainings appertain appertains appertain appertinent appertin appertinents appertin appetite appetit appetites appetit applaud applaud applauded applaud applauding applaud applause applaus applauses applaus apple appl apples appl appletart appletart appliance applianc appliances applianc applications applic applied appli applies appli apply appli applying appli appoint appoint appointed appoint appointment appoint appointments appoint appoints appoint apprehend apprehend apprehended apprehend apprehends apprehend apprehension apprehens apprehensions apprehens apprehensive apprehens apprendre apprendr apprenne apprenn apprenticehood apprenticehood appris appri approach approach approachers approach approaches approach approacheth approacheth approaching approach approbation approb approof approof appropriation appropri approv approv approve approv approved approv approvers approv approves approv appurtenance appurten appurtenances appurten apricocks apricock april april apron apron aprons apron apt apt apter apter aptest aptest aptly aptli aptness apt aqua aqua aquilon aquilon aquitaine aquitain arabia arabia arabian arabian araise arais arbitrate arbitr arbitrating arbitr arbitrator arbitr arbitrement arbitr arbors arbor arbour arbour arc arc arch arch archbishop archbishop archbishopric archbishopr archdeacon archdeacon arched arch archelaus archelau archer archer archers archer archery archeri archibald archibald archidamus archidamu architect architect arcu arcu arde ard arden arden ardent ardent ardour ardour are ar argal argal argier argier argo argo argosies argosi argosy argosi argu argu argue argu argued argu argues argu arguing argu argument argument arguments argument argus argu ariachne ariachn ariadne ariadn ariel ariel aries ari aright aright arinado arinado arinies arini arion arion arise aris arises aris ariseth ariseth arising aris aristode aristod aristotle aristotl arithmetic arithmet arithmetician arithmetician ark ark arm arm arma arma armado armado armadoes armado armagnac armagnac arme arm armed arm armenia armenia armies armi armigero armigero arming arm armipotent armipot armor armor armour armour armourer armour armourers armour armours armour armoury armouri arms arm army armi arn arn aroint aroint arose aros arouse arous aroused arous arragon arragon arraign arraign arraigned arraign arraigning arraign arraignment arraign arrant arrant arras arra array arrai arrearages arrearag arrest arrest arrested arrest arrests arrest arriv arriv arrival arriv arrivance arriv arrive arriv arrived arriv arrives arriv arriving arriv arrogance arrog arrogancy arrog arrogant arrog arrow arrow arrows arrow art art artemidorus artemidoru arteries arteri arthur arthur article articl articles articl articulate articul artificer artific artificial artifici artillery artilleri artire artir artist artist artists artist artless artless artois artoi arts art artus artu arviragus arviragu as as asaph asaph ascanius ascaniu ascend ascend ascended ascend ascendeth ascendeth ascends ascend ascension ascens ascent ascent ascribe ascrib ascribes ascrib ash ash asham asham ashamed asham asher asher ashes ash ashford ashford ashore ashor ashouting ashout ashy ashi asia asia aside asid ask ask askance askanc asked ask asker asker asketh asketh asking ask asks ask aslant aslant asleep asleep asmath asmath asp asp aspect aspect aspects aspect aspen aspen aspersion aspers aspic aspic aspicious aspici aspics aspic aspir aspir aspiration aspir aspire aspir aspiring aspir asquint asquint ass ass assail assail assailable assail assailant assail assailants assail assailed assail assaileth assaileth assailing assail assails assail assassination assassin assault assault assaulted assault assaults assault assay assai assaying assai assays assai assemblance assembl assemble assembl assembled assembl assemblies assembl assembly assembl assent assent asses ass assez assez assign assign assigned assign assigns assign assinico assinico assist assist assistance assist assistances assist assistant assist assistants assist assisted assist assisting assist associate associ associated associ associates associ assuage assuag assubjugate assubjug assum assum assume assum assumes assum assumption assumpt assur assur assurance assur assure assur assured assur assuredly assuredli assures assur assyrian assyrian astonish astonish astonished astonish astraea astraea astray astrai astrea astrea astronomer astronom astronomers astronom astronomical astronom astronomy astronomi asunder asund at at atalanta atalanta ate at ates at athenian athenian athenians athenian athens athen athol athol athversary athversari athwart athwart atlas atla atomies atomi atomy atomi atone aton atonement aton atonements aton atropos atropo attach attach attached attach attachment attach attain attain attainder attaind attains attain attaint attaint attainted attaint attainture attaintur attempt attempt attemptable attempt attempted attempt attempting attempt attempts attempt attend attend attendance attend attendant attend attendants attend attended attend attendents attend attendeth attendeth attending attend attends attend attent attent attention attent attentive attent attentivenes attentiven attest attest attested attest attir attir attire attir attired attir attires attir attorney attornei attorneyed attornei attorneys attornei attorneyship attorneyship attract attract attraction attract attractive attract attracts attract attribute attribut attributed attribut attributes attribut attribution attribut attributive attribut atwain atwain au au aubrey aubrei auburn auburn aucun aucun audacious audaci audaciously audaci audacity audac audible audibl audience audienc audis audi audit audit auditor auditor auditors auditor auditory auditori audre audr audrey audrei aufidius aufidiu aufidiuses aufidius auger auger aught aught augment augment augmentation augment augmented augment augmenting augment augurer augur augurers augur augures augur auguring augur augurs augur augury auguri august august augustus augustu auld auld aumerle aumerl aunchient aunchient aunt aunt aunts aunt auricular auricular aurora aurora auspicious auspici aussi aussi austere auster austerely auster austereness auster austerity auster austria austria aut aut authentic authent author author authorities author authority author authorized author authorizing author authors author autolycus autolycu autre autr autumn autumn auvergne auvergn avail avail avails avail avarice avaric avaricious avarici avaunt avaunt ave av aveng aveng avenge aveng avenged aveng averring aver avert avert aves av avez avez avis avi avoid avoid avoided avoid avoiding avoid avoids avoid avoirdupois avoirdupoi avouch avouch avouched avouch avouches avouch avouchment avouch avow avow aw aw await await awaits await awak awak awake awak awaked awak awaken awaken awakened awaken awakens awaken awakes awak awaking awak award award awards award awasy awasi away awai awe aw aweary aweari aweless aweless awful aw awhile awhil awkward awkward awl awl awooing awoo awork awork awry awri axe ax axle axl axletree axletre ay ay aye ay ayez ayez ayli ayli azur azur azure azur b b ba ba baa baa babbl babbl babble babbl babbling babbl babe babe babes babe babies babi baboon baboon baboons baboon baby babi babylon babylon bacare bacar bacchanals bacchan bacchus bacchu bach bach bachelor bachelor bachelors bachelor back back backbite backbit backbitten backbitten backing back backs back backward backward backwardly backwardli backwards backward bacon bacon bacons bacon bad bad bade bade badge badg badged badg badges badg badly badli badness bad baes bae baffl baffl baffle baffl baffled baffl bag bag baggage baggag bagot bagot bagpipe bagpip bags bag bail bail bailiff bailiff baillez baillez baily baili baisant baisant baisees baise baiser baiser bait bait baited bait baiting bait baitings bait baits bait bajazet bajazet bak bak bake bake baked bake baker baker bakers baker bakes bake baking bake bal bal balanc balanc balance balanc balcony balconi bald bald baldrick baldrick bale bale baleful bale balk balk ball ball ballad ballad ballads ballad ballast ballast ballasting ballast ballet ballet ballow ballow balls ball balm balm balms balm balmy balmi balsam balsam balsamum balsamum balth balth balthasar balthasar balthazar balthazar bames bame ban ban banbury banburi band band bandied bandi banding band bandit bandit banditti banditti banditto banditto bands band bandy bandi bandying bandi bane bane banes bane bang bang bangor bangor banish banish banished banish banishers banish banishment banish banister banist bank bank bankrout bankrout bankrupt bankrupt bankrupts bankrupt banks bank banner banner bannerets banneret banners banner banning ban banns bann banquet banquet banqueted banquet banqueting banquet banquets banquet banquo banquo bans ban baptism baptism baptista baptista baptiz baptiz bar bar barbarian barbarian barbarians barbarian barbarism barbar barbarous barbar barbary barbari barbason barbason barbed barb barber barber barbermonger barbermong bard bard bardolph bardolph bards bard bare bare bared bare barefac barefac barefaced barefac barefoot barefoot bareheaded barehead barely bare bareness bare barful bar bargain bargain bargains bargain barge barg bargulus bargulu baring bare bark bark barking bark barkloughly barkloughli barks bark barky barki barley barlei barm barm barn barn barnacles barnacl barnardine barnardin barne barn barnes barn barnet barnet barns barn baron baron barons baron barony baroni barr barr barrabas barraba barrel barrel barrels barrel barren barren barrenly barrenli barrenness barren barricado barricado barricadoes barricado barrow barrow bars bar barson barson barter barter bartholomew bartholomew bas ba basan basan base base baseless baseless basely base baseness base baser baser bases base basest basest bashful bash bashfulness bash basilisco basilisco basilisk basilisk basilisks basilisk basimecu basimecu basin basin basingstoke basingstok basins basin basis basi bask bask basket basket baskets basket bass bass bassanio bassanio basset basset bassianus bassianu basta basta bastard bastard bastardizing bastard bastardly bastardli bastards bastard bastardy bastardi basted bast bastes bast bastinado bastinado basting bast bat bat batailles batail batch batch bate bate bated bate bates bate bath bath bathe bath bathed bath bathing bath baths bath bating bate batler batler bats bat batt batt battalia battalia battalions battalion batten batten batter batter battering batter batters batter battery batteri battle battl battled battl battlefield battlefield battlements battlement battles battl batty batti bauble baubl baubles baubl baubling baubl baulk baulk bavin bavin bawcock bawcock bawd bawd bawdry bawdri bawds bawd bawdy bawdi bawl bawl bawling bawl bay bai baying bai baynard baynard bayonne bayonn bays bai be be beach beach beached beach beachy beachi beacon beacon bead bead beaded bead beadle beadl beadles beadl beads bead beadsmen beadsmen beagle beagl beagles beagl beak beak beaks beak beam beam beamed beam beams beam bean bean beans bean bear bear beard beard bearded beard beardless beardless beards beard bearer bearer bearers bearer bearest bearest beareth beareth bearing bear bears bear beast beast beastliest beastliest beastliness beastli beastly beastli beasts beast beat beat beated beat beaten beaten beating beat beatrice beatric beats beat beau beau beaufort beaufort beaumond beaumond beaumont beaumont beauteous beauteou beautied beauti beauties beauti beautified beautifi beautiful beauti beautify beautifi beauty beauti beaver beaver beavers beaver became becam because becaus bechanc bechanc bechance bechanc bechanced bechanc beck beck beckon beckon beckons beckon becks beck becom becom become becom becomed becom becomes becom becoming becom becomings becom bed bed bedabbled bedabbl bedash bedash bedaub bedaub bedazzled bedazzl bedchamber bedchamb bedclothes bedcloth bedded bed bedeck bedeck bedecking bedeck bedew bedew bedfellow bedfellow bedfellows bedfellow bedford bedford bedlam bedlam bedrench bedrench bedrid bedrid beds bed bedtime bedtim bedward bedward bee bee beef beef beefs beef beehives beehiv been been beer beer bees bee beest beest beetle beetl beetles beetl beeves beev befall befal befallen befallen befalls befal befell befel befits befit befitted befit befitting befit befor befor before befor beforehand beforehand befortune befortun befriend befriend befriended befriend befriends befriend beg beg began began beget beget begets beget begetting beget begg begg beggar beggar beggared beggar beggarly beggarli beggarman beggarman beggars beggar beggary beggari begging beg begin begin beginners beginn beginning begin beginnings begin begins begin begnawn begnawn begone begon begot begot begotten begotten begrimed begrim begs beg beguil beguil beguile beguil beguiled beguil beguiles beguil beguiling beguil begun begun behalf behalf behalfs behalf behav behav behaved behav behavedst behavedst behavior behavior behaviors behavior behaviour behaviour behaviours behaviour behead behead beheaded behead beheld beheld behest behest behests behest behind behind behold behold beholder behold beholders behold beholdest beholdest beholding behold beholds behold behoof behoof behooffull behoofful behooves behoov behove behov behoves behov behowls behowl being be bel bel belarius belariu belch belch belching belch beldam beldam beldame beldam beldams beldam belee bele belgia belgia belie beli belied beli belief belief beliest beliest believ believ believe believ believed believ believes believ believest believest believing believ belike belik bell bell bellario bellario belle bell bellied belli bellies belli bellman bellman bellona bellona bellow bellow bellowed bellow bellowing bellow bellows bellow bells bell belly belli bellyful belly belman belman belmont belmont belock belock belong belong belonging belong belongings belong belongs belong belov belov beloved belov beloving belov below below belt belt belzebub belzebub bemadding bemad bemet bemet bemete bemet bemoan bemoan bemoaned bemoan bemock bemock bemoil bemoil bemonster bemonst ben ben bench bench bencher bencher benches bench bend bend bended bend bending bend bends bend bene bene beneath beneath benedicite benedicit benedick benedick benediction benedict benedictus benedictu benefactors benefactor benefice benefic beneficial benefici benefit benefit benefited benefit benefits benefit benetted benet benevolence benevol benevolences benevol benied beni benison benison bennet bennet bent bent bentii bentii bentivolii bentivolii bents bent benumbed benumb benvolio benvolio bepaint bepaint bepray beprai bequeath bequeath bequeathed bequeath bequeathing bequeath bequest bequest ber ber berard berard berattle berattl beray berai bere bere bereave bereav bereaved bereav bereaves bereav bereft bereft bergamo bergamo bergomask bergomask berhym berhym berhyme berhym berkeley berkelei bermoothes bermooth bernardo bernardo berod berod berowne berown berri berri berries berri berrord berrord berry berri bertram bertram berwick berwick bescreen bescreen beseech beseech beseeched beseech beseechers beseech beseeching beseech beseek beseek beseem beseem beseemeth beseemeth beseeming beseem beseems beseem beset beset beshrew beshrew beside besid besides besid besieg besieg besiege besieg besieged besieg beslubber beslubb besmear besmear besmeared besmear besmirch besmirch besom besom besort besort besotted besot bespake bespak bespeak bespeak bespice bespic bespoke bespok bespotted bespot bess bess bessy bessi best best bestained bestain bested best bestial bestial bestir bestir bestirr bestirr bestow bestow bestowed bestow bestowing bestow bestows bestow bestraught bestraught bestrew bestrew bestrid bestrid bestride bestrid bestrides bestrid bet bet betake betak beteem beteem bethink bethink bethought bethought bethrothed bethroth bethump bethump betid betid betide betid betideth betideth betime betim betimes betim betoken betoken betook betook betossed betoss betray betrai betrayed betrai betraying betrai betrays betrai betrims betrim betroth betroth betrothed betroth betroths betroth bett bett betted bet better better bettered better bettering better betters better betting bet bettre bettr between between betwixt betwixt bevel bevel beverage beverag bevis bevi bevy bevi bewail bewail bewailed bewail bewailing bewail bewails bewail beware bewar bewasted bewast beweep beweep bewept bewept bewet bewet bewhored bewhor bewitch bewitch bewitched bewitch bewitchment bewitch bewray bewrai beyond beyond bezonian bezonian bezonians bezonian bianca bianca bianco bianco bias bia bibble bibbl bickerings bicker bid bid bidden bidden bidding bid biddings bid biddy biddi bide bide bides bide biding bide bids bid bien bien bier bier bifold bifold big big bigamy bigami biggen biggen bigger bigger bigness big bigot bigot bilberry bilberri bilbo bilbo bilboes bilbo bilbow bilbow bill bill billeted billet billets billet billiards billiard billing bill billow billow billows billow bills bill bin bin bind bind bindeth bindeth binding bind binds bind biondello biondello birch birch bird bird birding bird birdlime birdlim birds bird birnam birnam birth birth birthday birthdai birthdom birthdom birthplace birthplac birthright birthright birthrights birthright births birth bis bi biscuit biscuit bishop bishop bishops bishop bisson bisson bit bit bitch bitch bite bite biter biter bites bite biting bite bits bit bitt bitt bitten bitten bitter bitter bitterest bitterest bitterly bitterli bitterness bitter blab blab blabb blabb blabbing blab blabs blab black black blackamoor blackamoor blackamoors blackamoor blackberries blackberri blackberry blackberri blacker blacker blackest blackest blackfriars blackfriar blackheath blackheath blackmere blackmer blackness black blacks black bladder bladder bladders bladder blade blade bladed blade blades blade blains blain blam blam blame blame blamed blame blameful blame blameless blameless blames blame blanc blanc blanca blanca blanch blanch blank blank blanket blanket blanks blank blaspheme blasphem blaspheming blasphem blasphemous blasphem blasphemy blasphemi blast blast blasted blast blasting blast blastments blastment blasts blast blaz blaz blaze blaze blazes blaze blazing blaze blazon blazon blazoned blazon blazoning blazon bleach bleach bleaching bleach bleak bleak blear blear bleared blear bleat bleat bleated bleat bleats bleat bled bled bleed bleed bleedest bleedest bleedeth bleedeth bleeding bleed bleeds bleed blemish blemish blemishes blemish blench blench blenches blench blend blend blended blend blent blent bless bless blessed bless blessedly blessedli blessedness blessed blesses bless blesseth blesseth blessing bless blessings bless blest blest blew blew blind blind blinded blind blindfold blindfold blinding blind blindly blindli blindness blind blinds blind blink blink blinking blink bliss bliss blist blist blister blister blisters blister blithe blith blithild blithild bloat bloat block block blockish blockish blocks block blois bloi blood blood blooded blood bloodhound bloodhound bloodied bloodi bloodier bloodier bloodiest bloodiest bloodily bloodili bloodless bloodless bloods blood bloodshed bloodsh bloodshedding bloodshed bloodstained bloodstain bloody bloodi bloom bloom blooms bloom blossom blossom blossoming blossom blossoms blossom blot blot blots blot blotted blot blotting blot blount blount blow blow blowed blow blowers blower blowest blowest blowing blow blown blown blows blow blowse blows blubb blubb blubber blubber blubbering blubber blue blue bluecaps bluecap bluest bluest blunt blunt blunted blunt blunter blunter bluntest bluntest blunting blunt bluntly bluntli bluntness blunt blunts blunt blur blur blurr blurr blurs blur blush blush blushes blush blushest blushest blushing blush blust blust bluster bluster blusterer bluster blusters bluster bo bo boar boar board board boarded board boarding board boards board boarish boarish boars boar boast boast boasted boast boastful boast boasting boast boasts boast boat boat boats boat boatswain boatswain bob bob bobb bobb boblibindo boblibindo bobtail bobtail bocchus bocchu bode bode boded bode bodements bodement bodes bode bodg bodg bodied bodi bodies bodi bodiless bodiless bodily bodili boding bode bodkin bodkin body bodi bodykins bodykin bog bog boggle boggl boggler boggler bogs bog bohemia bohemia bohemian bohemian bohun bohun boil boil boiling boil boils boil boist boist boisterous boister boisterously boister boitier boitier bold bold bolden bolden bolder bolder boldest boldest boldly boldli boldness bold bolds bold bolingbroke bolingbrok bolster bolster bolt bolt bolted bolt bolter bolter bolters bolter bolting bolt bolts bolt bombard bombard bombards bombard bombast bombast bon bon bona bona bond bond bondage bondag bonded bond bondmaid bondmaid bondman bondman bondmen bondmen bonds bond bondslave bondslav bone bone boneless boneless bones bone bonfire bonfir bonfires bonfir bonjour bonjour bonne bonn bonnet bonnet bonneted bonnet bonny bonni bonos bono bonto bonto bonville bonvil bood bood book book bookish bookish books book boon boon boor boor boorish boorish boors boor boot boot booted boot booties booti bootless bootless boots boot booty booti bor bor bora bora borachio borachio bordeaux bordeaux border border bordered border borderers border borders border bore bore boreas borea bores bore boring bore born born borne born borough borough boroughs borough borrow borrow borrowed borrow borrower borrow borrowing borrow borrows borrow bosko bosko boskos bosko bosky boski bosom bosom bosoms bosom boson boson boss boss bosworth bosworth botch botch botcher botcher botches botch botchy botchi both both bots bot bottle bottl bottled bottl bottles bottl bottom bottom bottomless bottomless bottoms bottom bouciqualt bouciqualt bouge boug bough bough boughs bough bought bought bounce bounc bouncing bounc bound bound bounded bound bounden bounden boundeth boundeth bounding bound boundless boundless bounds bound bounteous bounteou bounteously bounteous bounties bounti bountiful bounti bountifully bountifulli bounty bounti bourbier bourbier bourbon bourbon bourchier bourchier bourdeaux bourdeaux bourn bourn bout bout bouts bout bove bove bow bow bowcase bowcas bowed bow bowels bowel bower bower bowing bow bowl bowl bowler bowler bowling bowl bowls bowl bows bow bowsprit bowsprit bowstring bowstr box box boxes box boy boi boyet boyet boyish boyish boys boi brabant brabant brabantio brabantio brabble brabbl brabbler brabbler brac brac brace brace bracelet bracelet bracelets bracelet brach brach bracy braci brag brag bragg bragg braggardism braggard braggards braggard braggart braggart braggarts braggart bragged brag bragging brag bragless bragless brags brag braid braid braided braid brain brain brained brain brainford brainford brainish brainish brainless brainless brains brain brainsick brainsick brainsickly brainsickli brake brake brakenbury brakenburi brakes brake brambles brambl bran bran branch branch branches branch branchless branchless brand brand branded brand brandish brandish brandon brandon brands brand bras bra brass brass brassy brassi brat brat brats brat brav brav brave brave braved brave bravely brave braver braver bravery braveri braves brave bravest bravest braving brave brawl brawl brawler brawler brawling brawl brawls brawl brawn brawn brawns brawn bray brai braying brai braz braz brazen brazen brazier brazier breach breach breaches breach bread bread breadth breadth break break breaker breaker breakfast breakfast breaking break breaks break breast breast breasted breast breasting breast breastplate breastplat breasts breast breath breath breathe breath breathed breath breather breather breathers breather breathes breath breathest breathest breathing breath breathless breathless breaths breath brecknock brecknock bred bred breech breech breeches breech breeching breech breed breed breeder breeder breeders breeder breeding breed breeds breed breese brees breeze breez breff breff bretagne bretagn brethen brethen bretheren bretheren brethren brethren brevis brevi brevity breviti brew brew brewage brewag brewer brewer brewers brewer brewing brew brews brew briareus briareu briars briar brib brib bribe bribe briber briber bribes bribe brick brick bricklayer bricklay bricks brick bridal bridal bride bride bridegroom bridegroom bridegrooms bridegroom brides bride bridge bridg bridgenorth bridgenorth bridges bridg bridget bridget bridle bridl bridled bridl brief brief briefer briefer briefest briefest briefly briefli briefness brief brier brier briers brier brigandine brigandin bright bright brighten brighten brightest brightest brightly brightli brightness bright brim brim brimful brim brims brim brimstone brimston brinded brind brine brine bring bring bringer bringer bringeth bringeth bringing bring bringings bring brings bring brinish brinish brink brink brisk brisk brisky briski bristle bristl bristled bristl bristly bristli bristol bristol bristow bristow britain britain britaine britain britaines britain british british briton briton britons briton brittany brittani brittle brittl broach broach broached broach broad broad broader broader broadsides broadsid brocas broca brock brock brogues brogu broil broil broiling broil broils broil broke broke broken broken brokenly brokenli broker broker brokers broker brokes broke broking broke brooch brooch brooches brooch brood brood brooded brood brooding brood brook brook brooks brook broom broom broomstaff broomstaff broth broth brothel brothel brother brother brotherhood brotherhood brotherhoods brotherhood brotherly brotherli brothers brother broths broth brought brought brow brow brown brown browner browner brownist brownist browny browni brows brow browse brows browsing brows bruis brui bruise bruis bruised bruis bruises bruis bruising bruis bruit bruit bruited bruit brundusium brundusium brunt brunt brush brush brushes brush brute brute brutish brutish brutus brutu bubble bubbl bubbles bubbl bubbling bubbl bubukles bubukl buck buck bucket bucket buckets bucket bucking buck buckingham buckingham buckle buckl buckled buckl buckler buckler bucklers buckler bucklersbury bucklersburi buckles buckl buckram buckram bucks buck bud bud budded bud budding bud budge budg budger budger budget budget buds bud buff buff buffet buffet buffeting buffet buffets buffet bug bug bugbear bugbear bugle bugl bugs bug build build builded build buildeth buildeth building build buildings build builds build built built bulk bulk bulks bulk bull bull bullcalf bullcalf bullen bullen bullens bullen bullet bullet bullets bullet bullocks bullock bulls bull bully bulli bulmer bulmer bulwark bulwark bulwarks bulwark bum bum bumbast bumbast bump bump bumper bumper bums bum bunch bunch bunches bunch bundle bundl bung bung bunghole bunghol bungle bungl bunting bunt buoy buoi bur bur burbolt burbolt burd burd burden burden burdened burden burdening burden burdenous burden burdens burden burgh burgh burgher burgher burghers burgher burglary burglari burgomasters burgomast burgonet burgonet burgundy burgundi burial burial buried buri burier burier buriest buriest burly burli burn burn burned burn burnet burnet burneth burneth burning burn burnish burnish burns burn burnt burnt burr burr burrows burrow burs bur burst burst bursting burst bursts burst burthen burthen burthens burthen burton burton bury buri burying buri bush bush bushels bushel bushes bush bushy bushi busied busi busily busili busines busin business busi businesses busi buskin buskin busky buski buss buss busses buss bussing buss bustle bustl bustling bustl busy busi but but butcheed butche butcher butcher butchered butcher butcheries butcheri butcherly butcherli butchers butcher butchery butcheri butler butler butt butt butter butter buttered butter butterflies butterfli butterfly butterfli butterwoman butterwoman buttery butteri buttock buttock buttocks buttock button button buttonhole buttonhol buttons button buttress buttress buttry buttri butts butt buxom buxom buy bui buyer buyer buying bui buys bui buzz buzz buzzard buzzard buzzards buzzard buzzers buzzer buzzing buzz by by bye bye byzantium byzantium c c ca ca cabbage cabbag cabileros cabilero cabin cabin cabins cabin cable cabl cables cabl cackling cackl cacodemon cacodemon caddis caddi caddisses caddiss cade cade cadence cadenc cadent cadent cades cade cadmus cadmu caduceus caduceu cadwal cadwal cadwallader cadwallad caelius caeliu caelo caelo caesar caesar caesarion caesarion caesars caesar cage cage caged cage cagion cagion cain cain caithness caith caitiff caitiff caitiffs caitiff caius caiu cak cak cake cake cakes cake calaber calab calais calai calamities calam calamity calam calchas calcha calculate calcul calen calen calendar calendar calendars calendar calf calf caliban caliban calibans caliban calipolis calipoli cality caliti caliver caliv call call callat callat called call callet callet calling call calls call calm calm calmest calmest calmly calmli calmness calm calms calm calpurnia calpurnia calumniate calumni calumniating calumni calumnious calumni calumny calumni calve calv calved calv calves calv calveskins calveskin calydon calydon cam cam cambio cambio cambria cambria cambric cambric cambrics cambric cambridge cambridg cambyses cambys came came camel camel camelot camelot camels camel camest camest camillo camillo camlet camlet camomile camomil camp camp campeius campeiu camping camp camps camp can can canakin canakin canaries canari canary canari cancel cancel cancell cancel cancelled cancel cancelling cancel cancels cancel cancer cancer candidatus candidatu candied candi candle candl candles candl candlesticks candlestick candy candi canidius canidiu cank cank canker canker cankerblossom cankerblossom cankers canker cannibally cannib cannibals cannib cannon cannon cannoneer cannon cannons cannon cannot cannot canon canon canoniz canoniz canonize canon canonized canon canons canon canopied canopi canopies canopi canopy canopi canst canst canstick canstick canterbury canterburi cantle cantl cantons canton canus canu canvas canva canvass canvass canzonet canzonet cap cap capability capabl capable capabl capacities capac capacity capac caparison caparison capdv capdv cape cape capel capel capels capel caper caper capers caper capet capet caphis caphi capilet capilet capitaine capitain capital capit capite capit capitol capitol capitulate capitul capocchia capocchia capon capon capons capon capp capp cappadocia cappadocia capriccio capriccio capricious caprici caps cap capt capt captain captain captains captain captainship captainship captious captiou captivate captiv captivated captiv captivates captiv captive captiv captives captiv captivity captiv captum captum capucius capuciu capulet capulet capulets capulet car car carack carack caracks carack carat carat caraways carawai carbonado carbonado carbuncle carbuncl carbuncled carbuncl carbuncles carbuncl carcanet carcanet carcase carcas carcases carcas carcass carcass carcasses carcass card card cardecue cardecu carded card carders carder cardinal cardin cardinally cardin cardinals cardin cardmaker cardmak cards card carduus carduu care care cared care career career careers career careful care carefully carefulli careless careless carelessly carelessli carelessness careless cares care caret caret cargo cargo carl carl carlisle carlisl carlot carlot carman carman carmen carmen carnal carnal carnally carnal carnarvonshire carnarvonshir carnation carnat carnations carnat carol carol carous carou carouse carous caroused carous carouses carous carousing carous carp carp carpenter carpent carper carper carpet carpet carpets carpet carping carp carriage carriag carriages carriag carried carri carrier carrier carriers carrier carries carri carrion carrion carrions carrion carry carri carrying carri cars car cart cart carters carter carthage carthag carts cart carv carv carve carv carved carv carver carver carves carv carving carv cas ca casa casa casaer casaer casca casca case case casement casement casements casement cases case cash cash cashier cashier casing case cask cask casket casket casketed casket caskets casket casque casqu casques casqu cassado cassado cassandra cassandra cassibelan cassibelan cassio cassio cassius cassiu cassocks cassock cast cast castalion castalion castaway castawai castaways castawai casted cast caster caster castigate castig castigation castig castile castil castiliano castiliano casting cast castle castl castles castl casts cast casual casual casually casual casualties casualti casualty casualti cat cat cataian cataian catalogue catalogu cataplasm cataplasm cataracts cataract catarrhs catarrh catastrophe catastroph catch catch catcher catcher catches catch catching catch cate cate catechising catechis catechism catech catechize catech cater cater caterpillars caterpillar caters cater caterwauling caterwaul cates cate catesby catesbi cathedral cathedr catlike catlik catling catl catlings catl cato cato cats cat cattle cattl caucasus caucasu caudle caudl cauf cauf caught caught cauldron cauldron caus cau cause caus caused caus causeless causeless causer causer causes caus causest causest causeth causeth cautel cautel cautelous cautel cautels cautel cauterizing cauter caution caution cautions caution cavaleiro cavaleiro cavalery cavaleri cavaliers cavali cave cave cavern cavern caverns cavern caves cave caveto caveto caviary caviari cavil cavil cavilling cavil cawdor cawdor cawdron cawdron cawing caw ce ce ceas cea cease ceas ceases ceas ceaseth ceaseth cedar cedar cedars cedar cedius cediu celebrate celebr celebrated celebr celebrates celebr celebration celebr celerity celer celestial celesti celia celia cell cell cellar cellar cellarage cellarag celsa celsa cement cement censer censer censor censor censorinus censorinu censur censur censure censur censured censur censurers censur censures censur censuring censur centaur centaur centaurs centaur centre centr cents cent centuries centuri centurion centurion centurions centurion century centuri cerberus cerberu cerecloth cerecloth cerements cerement ceremonial ceremoni ceremonies ceremoni ceremonious ceremoni ceremoniously ceremoni ceremony ceremoni ceres cere cerns cern certain certain certainer certain certainly certainli certainties certainti certainty certainti certes cert certificate certif certified certifi certifies certifi certify certifi ces ce cesario cesario cess cess cesse cess cestern cestern cetera cetera cette cett chaces chace chaf chaf chafe chafe chafed chafe chafes chafe chaff chaff chaffless chaffless chafing chafe chain chain chains chain chair chair chairs chair chalic chalic chalice chalic chalices chalic chalk chalk chalks chalk chalky chalki challeng challeng challenge challeng challenged challeng challenger challeng challengers challeng challenges challeng cham cham chamber chamber chamberers chamber chamberlain chamberlain chamberlains chamberlain chambermaid chambermaid chambermaids chambermaid chambers chamber chameleon chameleon champ champ champagne champagn champain champain champains champain champion champion champions champion chanc chanc chance chanc chanced chanc chancellor chancellor chances chanc chandler chandler chang chang change chang changeable changeabl changed chang changeful chang changeling changel changelings changel changer changer changes chang changest changest changing chang channel channel channels channel chanson chanson chant chant chanticleer chanticl chanting chant chantries chantri chantry chantri chants chant chaos chao chap chap chape chape chapel chapel chapeless chapeless chapels chapel chaplain chaplain chaplains chaplain chapless chapless chaplet chaplet chapmen chapmen chaps chap chapter chapter character charact charactered charact characterless characterless characters charact charactery characteri characts charact charbon charbon chare chare chares chare charg charg charge charg charged charg chargeful charg charges charg chargeth chargeth charging charg chariest chariest chariness chari charing chare chariot chariot chariots chariot charitable charit charitably charit charities chariti charity chariti charlemain charlemain charles charl charm charm charmed charm charmer charmer charmeth charmeth charmian charmian charming charm charmingly charmingli charms charm charneco charneco charnel charnel charolois charoloi charon charon charter charter charters charter chartreux chartreux chary chari charybdis charybdi chas cha chase chase chased chase chaser chaser chaseth chaseth chasing chase chaste chast chastely chast chastis chasti chastise chastis chastised chastis chastisement chastis chastity chastiti chat chat chatham chatham chatillon chatillon chats chat chatt chatt chattels chattel chatter chatter chattering chatter chattles chattl chaud chaud chaunted chaunt chaw chaw chawdron chawdron che che cheap cheap cheapen cheapen cheaper cheaper cheapest cheapest cheaply cheapli cheapside cheapsid cheat cheat cheated cheat cheater cheater cheaters cheater cheating cheat cheats cheat check check checked check checker checker checking check checks check cheek cheek cheeks cheek cheer cheer cheered cheer cheerer cheerer cheerful cheer cheerfully cheerfulli cheering cheer cheerless cheerless cheerly cheerli cheers cheer cheese chees chequer chequer cher cher cherish cherish cherished cherish cherisher cherish cherishes cherish cherishing cherish cherries cherri cherry cherri cherrypit cherrypit chertsey chertsei cherub cherub cherubims cherubim cherubin cherubin cherubins cherubin cheshu cheshu chess chess chest chest chester chester chestnut chestnut chestnuts chestnut chests chest chetas cheta chev chev cheval cheval chevalier chevali chevaliers chevali cheveril cheveril chew chew chewed chew chewet chewet chewing chew chez chez chi chi chick chick chicken chicken chickens chicken chicurmurco chicurmurco chid chid chidden chidden chide chide chiders chider chides chide chiding chide chief chief chiefest chiefest chiefly chiefli chien chien child child childed child childeric childer childhood childhood childhoods childhood childing child childish childish childishness childish childlike childlik childness child children children chill chill chilling chill chime chime chimes chime chimney chimnei chimneypiece chimneypiec chimneys chimnei chimurcho chimurcho chin chin china china chine chine chines chine chink chink chinks chink chins chin chipp chipp chipper chipper chips chip chiron chiron chirping chirp chirrah chirrah chirurgeonly chirurgeonli chisel chisel chitopher chitoph chivalrous chivalr chivalry chivalri choice choic choicely choic choicest choicest choir choir choirs choir chok chok choke choke choked choke chokes choke choking choke choler choler choleric choler cholers choler chollors chollor choose choos chooser chooser chooses choos chooseth chooseth choosing choos chop chop chopine chopin choplogic choplog chopp chopp chopped chop chopping chop choppy choppi chops chop chopt chopt chor chor choristers chorist chorus choru chose chose chosen chosen chough chough choughs chough chrish chrish christ christ christen christen christendom christendom christendoms christendom christening christen christenings christen christian christian christianlike christianlik christians christian christmas christma christom christom christopher christoph christophero christophero chronicle chronicl chronicled chronicl chronicler chronicl chroniclers chronicl chronicles chronicl chrysolite chrysolit chuck chuck chucks chuck chud chud chuffs chuff church church churches church churchman churchman churchmen churchmen churchyard churchyard churchyards churchyard churl churl churlish churlish churlishly churlishli churls churl churn churn chus chu cicatrice cicatric cicatrices cicatric cicely cice cicero cicero ciceter cicet ciel ciel ciitzens ciitzen cilicia cilicia cimber cimber cimmerian cimmerian cinable cinabl cincture cinctur cinders cinder cine cine cinna cinna cinque cinqu cipher cipher ciphers cipher circa circa circe circ circle circl circled circl circlets circlet circling circl circuit circuit circum circum circumcised circumcis circumference circumfer circummur circummur circumscrib circumscrib circumscribed circumscrib circumscription circumscript circumspect circumspect circumstance circumst circumstanced circumstanc circumstances circumst circumstantial circumstanti circumvent circumv circumvention circumvent cistern cistern citadel citadel cital cital cite cite cited cite cites cite cities citi citing cite citizen citizen citizens citizen cittern cittern city citi civet civet civil civil civility civil civilly civilli clack clack clad clad claim claim claiming claim claims claim clamb clamb clamber clamber clammer clammer clamor clamor clamorous clamor clamors clamor clamour clamour clamours clamour clang clang clangor clangor clap clap clapp clapp clapped clap clapper clapper clapping clap claps clap clare clare clarence clarenc claret claret claribel claribel clasp clasp clasps clasp clatter clatter claud claud claudio claudio claudius claudiu clause claus claw claw clawed claw clawing claw claws claw clay clai clays clai clean clean cleanliest cleanliest cleanly cleanli cleans clean cleanse cleans cleansing cleans clear clear clearer clearer clearest clearest clearly clearli clearness clear clears clear cleave cleav cleaving cleav clef clef cleft cleft cleitus cleitu clemency clemenc clement clement cleomenes cleomen cleopatpa cleopatpa cleopatra cleopatra clepeth clepeth clept clept clerestories clerestori clergy clergi clergyman clergyman clergymen clergymen clerk clerk clerkly clerkli clerks clerk clew clew client client clients client cliff cliff clifford clifford cliffords clifford cliffs cliff clifton clifton climate climat climature climatur climb climb climbed climb climber climber climbeth climbeth climbing climb climbs climb clime clime cling cling clink clink clinking clink clinquant clinquant clip clip clipp clipp clipper clipper clippeth clippeth clipping clip clipt clipt clitus clitu clo clo cloak cloak cloakbag cloakbag cloaks cloak clock clock clocks clock clod clod cloddy cloddi clodpole clodpol clog clog clogging clog clogs clog cloister cloister cloistress cloistress cloquence cloquenc clos clo close close closed close closely close closeness close closer closer closes close closest closest closet closet closing close closure closur cloten cloten clotens cloten cloth cloth clothair clothair clotharius clothariu clothe cloth clothes cloth clothier clothier clothiers clothier clothing cloth cloths cloth clotpoles clotpol clotpoll clotpol cloud cloud clouded cloud cloudiness cloudi clouds cloud cloudy cloudi clout clout clouted clout clouts clout cloven cloven clover clover cloves clove clovest clovest clowder clowder clown clown clownish clownish clowns clown cloy cloi cloyed cloi cloying cloi cloyless cloyless cloyment cloyment cloys cloi club club clubs club cluck cluck clung clung clust clust clusters cluster clutch clutch clyster clyster cneius cneiu cnemies cnemi co co coach coach coaches coach coachmakers coachmak coact coact coactive coactiv coagulate coagul coal coal coals coal coarse coars coarsely coars coast coast coasting coast coasts coast coat coat coated coat coats coat cobble cobbl cobbled cobbl cobbler cobbler cobham cobham cobloaf cobloaf cobweb cobweb cobwebs cobweb cock cock cockatrice cockatric cockatrices cockatric cockle cockl cockled cockl cockney cocknei cockpit cockpit cocks cock cocksure cocksur coctus coctu cocytus cocytu cod cod codding cod codling codl codpiece codpiec codpieces codpiec cods cod coelestibus coelestibu coesar coesar coeur coeur coffer coffer coffers coffer coffin coffin coffins coffin cog cog cogging cog cogitation cogit cogitations cogit cognition cognit cognizance cogniz cogscomb cogscomb cohabitants cohabit coher coher cohere coher coherence coher coherent coher cohorts cohort coif coif coign coign coil coil coin coin coinage coinag coiner coiner coining coin coins coin col col colbrand colbrand colchos colcho cold cold colder colder coldest coldest coldly coldli coldness cold coldspur coldspur colebrook colebrook colic colic collar collar collars collar collateral collater colleagued colleagu collect collect collected collect collection collect college colleg colleges colleg collied colli collier collier colliers collier collop collop collusion collus colme colm colmekill colmekil coloquintida coloquintida color color colors color colossus colossu colour colour colourable colour coloured colour colouring colour colours colour colt colt colted colt colts colt columbine columbin columbines columbin colville colvil com com comagene comagen comart comart comb comb combat combat combatant combat combatants combat combated combat combating combat combin combin combinate combin combination combin combine combin combined combin combless combless combustion combust come come comedian comedian comedians comedian comedy comedi comeliness comeli comely come comer comer comers comer comes come comest comest comet comet cometh cometh comets comet comfect comfect comfit comfit comfits comfit comfort comfort comfortable comfort comforted comfort comforter comfort comforting comfort comfortless comfortless comforts comfort comic comic comical comic coming come comings come cominius cominiu comma comma command command commande command commanded command commander command commanders command commanding command commandment command commandments command commands command comme comm commenc commenc commence commenc commenced commenc commencement commenc commences commenc commencing commenc commend commend commendable commend commendation commend commendations commend commended commend commending commend commends commend comment comment commentaries commentari commenting comment comments comment commerce commerc commingled commingl commiseration commiser commission commiss commissioners commission commissions commiss commit commit commits commit committ committ committed commit committing commit commix commix commixed commix commixtion commixt commixture commixtur commodious commodi commodities commod commodity commod common common commonalty commonalti commoner common commoners common commonly commonli commons common commonweal commonw commonwealth commonwealth commotion commot commotions commot commune commun communicat communicat communicate commun communication commun communities commun community commun comonty comonti compact compact companies compani companion companion companions companion companionship companionship company compani compar compar comparative compar compare compar compared compar comparing compar comparison comparison comparisons comparison compartner compartn compass compass compasses compass compassing compass compassion compass compassionate compassion compeers compeer compel compel compell compel compelled compel compelling compel compels compel compensation compens competence compet competency compet competent compet competitor competitor competitors competitor compil compil compile compil compiled compil complain complain complainer complain complainest complainest complaining complain complainings complain complains complain complaint complaint complaints complaint complement complement complements complement complete complet complexion complexion complexioned complexion complexions complexion complices complic complies compli compliment compliment complimental compliment compliments compliment complot complot complots complot complotted complot comply compli compos compo compose compos composed compos composition composit compost compost composture compostur composure composur compound compound compounded compound compounds compound comprehend comprehend comprehended comprehend comprehends comprehend compremises compremis compris compri comprising compris compromis compromi compromise compromis compt compt comptible comptibl comptrollers comptrol compulsatory compulsatori compulsion compuls compulsive compuls compunctious compuncti computation comput comrade comrad comrades comrad comutual comutu con con concave concav concavities concav conceal conceal concealed conceal concealing conceal concealment conceal concealments conceal conceals conceal conceit conceit conceited conceit conceitless conceitless conceits conceit conceiv conceiv conceive conceiv conceived conceiv conceives conceiv conceiving conceiv conception concept conceptions concept conceptious concepti concern concern concernancy concern concerneth concerneth concerning concern concernings concern concerns concern conclave conclav conclud conclud conclude conclud concluded conclud concludes conclud concluding conclud conclusion conclus conclusions conclus concolinel concolinel concord concord concubine concubin concupiscible concupisc concupy concupi concur concur concurring concur concurs concur condemn condemn condemnation condemn condemned condemn condemning condemn condemns condemn condescend condescend condign condign condition condit conditionally condition conditions condit condole condol condolement condol condoling condol conduce conduc conduct conduct conducted conduct conducting conduct conductor conductor conduit conduit conduits conduit conected conect coney conei confection confect confectionary confectionari confections confect confederacy confederaci confederate confeder confederates confeder confer confer conference confer conferr conferr conferring confer confess confess confessed confess confesses confess confesseth confesseth confessing confess confession confess confessions confess confessor confessor confidence confid confident confid confidently confid confin confin confine confin confined confin confineless confineless confiners confin confines confin confining confin confirm confirm confirmation confirm confirmations confirm confirmed confirm confirmer confirm confirmers confirm confirming confirm confirmities confirm confirms confirm confiscate confisc confiscated confisc confiscation confisc confixed confix conflict conflict conflicting conflict conflicts conflict confluence confluenc conflux conflux conform conform conformable conform confound confound confounded confound confounding confound confounds confound confront confront confronted confront confus confu confused confus confusedly confusedli confusion confus confusions confus confutation confut confutes confut congeal congeal congealed congeal congealment congeal congee conge conger conger congest congest congied congi congratulate congratul congreeing congre congreeted congreet congregate congreg congregated congreg congregation congreg congregations congreg congruent congruent congruing congru conies coni conjectural conjectur conjecture conjectur conjectures conjectur conjoin conjoin conjoined conjoin conjoins conjoin conjointly conjointli conjunct conjunct conjunction conjunct conjunctive conjunct conjur conjur conjuration conjur conjurations conjur conjure conjur conjured conjur conjurer conjur conjurers conjur conjures conjur conjuring conjur conjuro conjuro conn conn connected connect connive conniv conqu conqu conquer conquer conquered conquer conquering conquer conqueror conqueror conquerors conqueror conquers conquer conquest conquest conquests conquest conquring conqur conrade conrad cons con consanguineous consanguin consanguinity consanguin conscienc conscienc conscience conscienc consciences conscienc conscionable conscion consecrate consecr consecrated consecr consecrations consecr consent consent consented consent consenting consent consents consent consequence consequ consequences consequ consequently consequ conserve conserv conserved conserv conserves conserv consider consid considerance consider considerate consider consideration consider considerations consider considered consid considering consid considerings consid considers consid consign consign consigning consign consist consist consisteth consisteth consisting consist consistory consistori consists consist consolate consol consolation consol consonancy conson consonant conson consort consort consorted consort consortest consortest conspectuities conspectu conspir conspir conspiracy conspiraci conspirant conspir conspirator conspir conspirators conspir conspire conspir conspired conspir conspirers conspir conspires conspir conspiring conspir constable constabl constables constabl constance constanc constancies constanc constancy constanc constant constant constantine constantin constantinople constantinopl constantly constantli constellation constel constitution constitut constrain constrain constrained constrain constraineth constraineth constrains constrain constraint constraint constring constr construction construct construe constru consul consul consuls consul consulship consulship consulships consulship consult consult consulting consult consults consult consum consum consume consum consumed consum consumes consum consuming consum consummate consumm consummation consumm consumption consumpt consumptions consumpt contagion contagion contagious contagi contain contain containing contain contains contain contaminate contamin contaminated contamin contemn contemn contemned contemn contemning contemn contemns contemn contemplate contempl contemplation contempl contemplative contempl contempt contempt contemptible contempt contempts contempt contemptuous contemptu contemptuously contemptu contend contend contended contend contending contend contendon contendon content content contenta contenta contented content contenteth contenteth contention content contentious contenti contentless contentless contento contento contents content contest contest contestation contest continence contin continency contin continent contin continents contin continu continu continual continu continually continu continuance continu continuantly continuantli continuate continu continue continu continued continu continuer continu continues continu continuing continu contract contract contracted contract contracting contract contraction contract contradict contradict contradicted contradict contradiction contradict contradicts contradict contraries contrari contrarieties contrarieti contrariety contrarieti contrarious contrari contrariously contrari contrary contrari contre contr contribution contribut contributors contributor contrite contrit contriv contriv contrive contriv contrived contriv contriver contriv contrives contriv contriving contriv control control controll control controller control controlling control controlment control controls control controversy controversi contumelious contumeli contumeliously contumeli contumely contum contusions contus convenience conveni conveniences conveni conveniency conveni convenient conveni conveniently conveni convented convent conventicles conventicl convents convent convers conver conversant convers conversation convers conversations convers converse convers conversed convers converses convers conversing convers conversion convers convert convert converted convert convertest convertest converting convert convertite convertit convertites convertit converts convert convey convei conveyance convey conveyances convey conveyers convey conveying convei convict convict convicted convict convince convinc convinced convinc convinces convinc convive conviv convocation convoc convoy convoi convulsions convuls cony coni cook cook cookery cookeri cooks cook cool cool cooled cool cooling cool cools cool coop coop coops coop cop cop copatain copatain cope cope cophetua cophetua copied copi copies copi copious copiou copper copper copperspur copperspur coppice coppic copulation copul copulatives copul copy copi cor cor coragio coragio coral coral coram coram corambus corambu coranto coranto corantos coranto corbo corbo cord cord corded cord cordelia cordelia cordial cordial cordis cordi cords cord core core corin corin corinth corinth corinthian corinthian coriolanus coriolanu corioli corioli cork cork corky corki cormorant cormor corn corn cornelia cornelia cornelius corneliu corner corner corners corner cornerstone cornerston cornets cornet cornish cornish corns corn cornuto cornuto cornwall cornwal corollary corollari coronal coron coronation coron coronet coronet coronets coronet corporal corpor corporals corpor corporate corpor corpse corps corpulent corpul correct correct corrected correct correcting correct correction correct correctioner correction corrects correct correspondence correspond correspondent correspond corresponding correspond corresponsive correspons corrigible corrig corrival corriv corrivals corriv corroborate corrobor corrosive corros corrupt corrupt corrupted corrupt corrupter corrupt corrupters corrupt corruptible corrupt corruptibly corrupt corrupting corrupt corruption corrupt corruptly corruptli corrupts corrupt corse cors corses cors corslet corslet cosmo cosmo cost cost costard costard costermongers costermong costlier costlier costly costli costs cost cot cot cote cote coted cote cotsall cotsal cotsole cotsol cotswold cotswold cottage cottag cottages cottag cotus cotu couch couch couched couch couching couch couchings couch coude coud cough cough coughing cough could could couldst couldst coulter coulter council council councillor councillor councils council counsel counsel counsell counsel counsellor counsellor counsellors counsellor counselor counselor counselors counselor counsels counsel count count counted count countenanc countenanc countenance counten countenances counten counter counter counterchange counterchang countercheck countercheck counterfeit counterfeit counterfeited counterfeit counterfeiting counterfeit counterfeitly counterfeitli counterfeits counterfeit countermand countermand countermands countermand countermines countermin counterpart counterpart counterpoints counterpoint counterpois counterpoi counterpoise counterpois counters counter countervail countervail countess countess countesses countess counties counti counting count countless countless countries countri countrv countrv country countri countryman countryman countrymen countrymen counts count county counti couper couper couple coupl coupled coupl couplement couplement couples coupl couplet couplet couplets couplet cour cour courage courag courageous courag courageously courag courages courag courier courier couriers courier couronne couronn cours cour course cours coursed cours courser courser coursers courser courses cours coursing cours court court courted court courteous courteou courteously courteous courtesan courtesan courtesies courtesi courtesy courtesi courtezan courtezan courtezans courtezan courtier courtier courtiers courtier courtlike courtlik courtly courtli courtney courtnei courts court courtship courtship cousin cousin cousins cousin couterfeit couterfeit coutume coutum covenant coven covenants coven covent covent coventry coventri cover cover covered cover covering cover coverlet coverlet covers cover covert covert covertly covertli coverture covertur covet covet coveted covet coveting covet covetings covet covetous covet covetously covet covetousness covet covets covet cow cow coward coward cowarded coward cowardice cowardic cowardly cowardli cowards coward cowardship cowardship cowish cowish cowl cowl cowslip cowslip cowslips cowslip cox cox coxcomb coxcomb coxcombs coxcomb coy coi coystrill coystril coz coz cozen cozen cozenage cozenag cozened cozen cozener cozen cozeners cozen cozening cozen coziers cozier crab crab crabbed crab crabs crab crack crack cracked crack cracker cracker crackers cracker cracking crack cracks crack cradle cradl cradled cradl cradles cradl craft craft crafted craft craftied crafti craftier craftier craftily craftili crafts craft craftsmen craftsmen crafty crafti cram cram cramm cramm cramp cramp cramps cramp crams cram cranking crank cranks crank cranmer cranmer crannied cranni crannies cranni cranny cranni crants crant crare crare crash crash crassus crassu crav crav crave crave craved crave craven craven cravens craven craves crave craveth craveth craving crave crawl crawl crawling crawl crawls crawl craz craz crazed craze crazy crazi creaking creak cream cream create creat created creat creates creat creating creat creation creation creator creator creature creatur creatures creatur credence credenc credent credent credible credibl credit credit creditor creditor creditors creditor credo credo credulity credul credulous credul creed creed creek creek creeks creek creep creep creeping creep creeps creep crept crept crescent crescent crescive cresciv cressets cresset cressid cressid cressida cressida cressids cressid cressy cressi crest crest crested crest crestfall crestfal crestless crestless crests crest cretan cretan crete crete crevice crevic crew crew crews crew crib crib cribb cribb cribs crib cricket cricket crickets cricket cried cri criedst criedst crier crier cries cri criest criest crieth crieth crime crime crimeful crime crimeless crimeless crimes crime criminal crimin crimson crimson cringe cring cripple crippl crisp crisp crisped crisp crispian crispian crispianus crispianu crispin crispin critic critic critical critic critics critic croak croak croaking croak croaks croak crocodile crocodil cromer cromer cromwell cromwel crone crone crook crook crookback crookback crooked crook crooking crook crop crop cropp cropp crosby crosbi cross cross crossed cross crosses cross crossest crossest crossing cross crossings cross crossly crossli crossness cross crost crost crotchets crotchet crouch crouch crouching crouch crow crow crowd crowd crowded crowd crowding crowd crowds crowd crowflowers crowflow crowing crow crowkeeper crowkeep crown crown crowned crown crowner crowner crownet crownet crownets crownet crowning crown crowns crown crows crow crudy crudi cruel cruel cruell cruell crueller crueller cruelly cruelli cruels cruel cruelty cruelti crum crum crumble crumbl crumbs crumb crupper crupper crusadoes crusado crush crush crushed crush crushest crushest crushing crush crust crust crusts crust crusty crusti crutch crutch crutches crutch cry cry crying cry crystal crystal crystalline crystallin crystals crystal cub cub cubbert cubbert cubiculo cubiculo cubit cubit cubs cub cuckold cuckold cuckoldly cuckoldli cuckolds cuckold cuckoo cuckoo cucullus cucullu cudgel cudgel cudgeled cudgel cudgell cudgel cudgelling cudgel cudgels cudgel cue cue cues cue cuff cuff cuffs cuff cuique cuiqu cull cull culling cull cullion cullion cullionly cullionli cullions cullion culpable culpabl culverin culverin cum cum cumber cumber cumberland cumberland cunning cun cunningly cunningli cunnings cun cuore cuor cup cup cupbearer cupbear cupboarding cupboard cupid cupid cupids cupid cuppele cuppel cups cup cur cur curan curan curate curat curb curb curbed curb curbing curb curbs curb curd curd curdied curdi curds curd cure cure cured cure cureless cureless curer curer cures cure curfew curfew curing cure curio curio curiosity curios curious curiou curiously curious curl curl curled curl curling curl curls curl currance curranc currants currant current current currents current currish currish curry curri curs cur curse curs cursed curs curses curs cursies cursi cursing curs cursorary cursorari curst curst curster curster curstest curstest curstness curst cursy cursi curtail curtail curtain curtain curtains curtain curtal curtal curtis curti curtle curtl curtsied curtsi curtsies curtsi curtsy curtsi curvet curvet curvets curvet cushes cush cushion cushion cushions cushion custalorum custalorum custard custard custody custodi custom custom customary customari customed custom customer custom customers custom customs custom custure custur cut cut cutler cutler cutpurse cutpurs cutpurses cutpurs cuts cut cutter cutter cutting cut cuttle cuttl cxsar cxsar cyclops cyclop cydnus cydnu cygnet cygnet cygnets cygnet cym cym cymbals cymbal cymbeline cymbelin cyme cyme cynic cynic cynthia cynthia cypress cypress cypriot cypriot cyprus cypru cyrus cyru cytherea cytherea d d dabbled dabbl dace dace dad dad daedalus daedalu daemon daemon daff daff daffed daf daffest daffest daffodils daffodil dagger dagger daggers dagger dagonet dagonet daily daili daintier daintier dainties dainti daintiest daintiest daintily daintili daintiness dainti daintry daintri dainty dainti daisied daisi daisies daisi daisy daisi dale dale dalliance dallianc dallied dalli dallies dalli dally dalli dallying dalli dalmatians dalmatian dam dam damage damag damascus damascu damask damask damasked damask dame dame dames dame damm damm damn damn damnable damnabl damnably damnabl damnation damnat damned damn damns damn damoiselle damoisel damon damon damosella damosella damp damp dams dam damsel damsel damsons damson dan dan danc danc dance danc dancer dancer dances danc dancing danc dandle dandl dandy dandi dane dane dang dang danger danger dangerous danger dangerously danger dangers danger dangling dangl daniel daniel danish danish dank dank dankish dankish danskers dansker daphne daphn dappled dappl dapples dappl dar dar dardan dardan dardanian dardanian dardanius dardaniu dare dare dared dare dareful dare dares dare darest darest daring dare darius dariu dark dark darken darken darkening darken darkens darken darker darker darkest darkest darkling darkl darkly darkli darkness dark darling darl darlings darl darnel darnel darraign darraign dart dart darted dart darter darter dartford dartford darting dart darts dart dash dash dashes dash dashing dash dastard dastard dastards dastard dat dat datchet datchet date date dated date dateless dateless dates date daub daub daughter daughter daughters daughter daunt daunt daunted daunt dauntless dauntless dauphin dauphin daventry daventri davy davi daw daw dawn dawn dawning dawn daws daw day dai daylight daylight days dai dazzle dazzl dazzled dazzl dazzling dazzl de de dead dead deadly deadli deaf deaf deafing deaf deafness deaf deafs deaf deal deal dealer dealer dealers dealer dealest dealest dealing deal dealings deal deals deal dealt dealt dean dean deanery deaneri dear dear dearer dearer dearest dearest dearly dearli dearness dear dears dear dearth dearth dearths dearth death death deathbed deathb deathful death deaths death deathsman deathsman deathsmen deathsmen debarred debar debase debas debate debat debated debat debatement debat debateth debateth debating debat debauch debauch debile debil debility debil debitor debitor debonair debonair deborah deborah debosh debosh debt debt debted debt debtor debtor debtors debtor debts debt debuty debuti decay decai decayed decai decayer decay decaying decai decays decai deceas decea decease deceas deceased deceas deceit deceit deceitful deceit deceits deceit deceiv deceiv deceivable deceiv deceive deceiv deceived deceiv deceiver deceiv deceivers deceiv deceives deceiv deceivest deceivest deceiveth deceiveth deceiving deceiv december decemb decent decent deceptious decepti decerns decern decide decid decides decid decimation decim decipher deciph deciphers deciph decision decis decius deciu deck deck decking deck decks deck deckt deckt declare declar declares declar declension declens declensions declens declin declin decline declin declined declin declines declin declining declin decoct decoct decorum decorum decreas decrea decrease decreas decreasing decreas decree decre decreed decre decrees decre decrepit decrepit dedicate dedic dedicated dedic dedicates dedic dedication dedic deed deed deedless deedless deeds deed deem deem deemed deem deep deep deeper deeper deepest deepest deeply deepli deeps deep deepvow deepvow deer deer deesse deess defac defac deface defac defaced defac defacer defac defacers defac defacing defac defam defam default default defeat defeat defeated defeat defeats defeat defeatures defeatur defect defect defective defect defects defect defence defenc defences defenc defend defend defendant defend defended defend defender defend defenders defend defending defend defends defend defense defens defensible defens defensive defens defer defer deferr deferr defiance defianc deficient defici defied defi defies defi defil defil defile defil defiler defil defiles defil defiling defil define defin definement defin definite definit definitive definit definitively definit deflow deflow deflower deflow deflowered deflow deform deform deformed deform deformities deform deformity deform deftly deftli defunct defunct defunction defunct defuse defus defy defi defying defi degenerate degener degraded degrad degree degre degrees degre deified deifi deifying deifi deign deign deigned deign deiphobus deiphobu deities deiti deity deiti deja deja deject deject dejected deject delabreth delabreth delay delai delayed delai delaying delai delays delai delectable delect deliberate deliber delicate delic delicates delic delicious delici deliciousness delici delight delight delighted delight delightful delight delights delight delinquents delinqu deliv deliv deliver deliv deliverance deliver delivered deliv delivering deliv delivers deliv delivery deliveri delphos delpho deluded delud deluding delud deluge delug delve delv delver delver delves delv demand demand demanded demand demanding demand demands demand demean demean demeanor demeanor demeanour demeanour demerits demerit demesnes demesn demetrius demetriu demi demi demigod demigod demise demis demoiselles demoisel demon demon demonstrable demonstr demonstrate demonstr demonstrated demonstr demonstrating demonstr demonstration demonstr demonstrative demonstr demure demur demurely demur demuring demur den den denay denai deni deni denial denial denials denial denied deni denier denier denies deni deniest deniest denis deni denmark denmark dennis denni denny denni denote denot denoted denot denotement denot denounc denounc denounce denounc denouncing denounc dens den denunciation denunci deny deni denying deni deo deo depart depart departed depart departest departest departing depart departure departur depeche depech depend depend dependant depend dependants depend depended depend dependence depend dependences depend dependency depend dependent depend dependents depend depender depend depending depend depends depend deplore deplor deploring deplor depopulate depopul depos depo depose depos deposed depos deposing depos depositaries depositari deprav deprav depravation deprav deprave deprav depraved deprav depraves deprav depress depress depriv depriv deprive depriv depth depth depths depth deputation deput depute deput deputed deput deputies deputi deputing deput deputy deputi deracinate deracin derby derbi dercetas derceta dere dere derides derid derision deris deriv deriv derivation deriv derivative deriv derive deriv derived deriv derives deriv derogate derog derogately derog derogation derog des de desartless desartless descant descant descend descend descended descend descending descend descends descend descension descens descent descent descents descent describe describ described describ describes describ descried descri description descript descriptions descript descry descri desdemon desdemon desdemona desdemona desert desert deserts desert deserv deserv deserve deserv deserved deserv deservedly deservedli deserver deserv deservers deserv deserves deserv deservest deservest deserving deserv deservings deserv design design designment design designments design designs design desir desir desire desir desired desir desirers desir desires desir desirest desirest desiring desir desirous desir desist desist desk desk desolate desol desolation desol desp desp despair despair despairing despair despairs despair despatch despatch desperate desper desperately desper desperation desper despis despi despise despis despised despis despiser despis despiseth despiseth despising despis despite despit despiteful despit despoiled despoil dest dest destin destin destined destin destinies destini destiny destini destitute destitut destroy destroi destroyed destroi destroyer destroy destroyers destroy destroying destroi destroys destroi destruction destruct destructions destruct det det detain detain detains detain detect detect detected detect detecting detect detection detect detector detector detects detect detention detent determin determin determinate determin determination determin determinations determin determine determin determined determin determines determin detest detest detestable detest detested detest detesting detest detests detest detract detract detraction detract detractions detract deucalion deucalion deuce deuc deum deum deux deux devant devant devesting devest device devic devices devic devil devil devilish devilish devils devil devis devi devise devis devised devis devises devis devising devis devoid devoid devonshire devonshir devote devot devoted devot devotion devot devour devour devoured devour devourers devour devouring devour devours devour devout devout devoutly devoutli dew dew dewberries dewberri dewdrops dewdrop dewlap dewlap dewlapp dewlapp dews dew dewy dewi dexter dexter dexteriously dexteri dexterity dexter di di diable diabl diablo diablo diadem diadem dial dial dialect dialect dialogue dialogu dialogued dialogu dials dial diameter diamet diamond diamond diamonds diamond dian dian diana diana diaper diaper dibble dibbl dic dic dice dice dicers dicer dich dich dick dick dickens dicken dickon dickon dicky dicki dictator dictat diction diction dictynna dictynna did did diddle diddl didest didest dido dido didst didst die die died di diedst diedst dies di diest diest diet diet dieted diet dieter dieter dieu dieu diff diff differ differ difference differ differences differ differency differ different differ differing differ differs differ difficile difficil difficult difficult difficulties difficulti difficulty difficulti diffidence diffid diffidences diffid diffus diffu diffused diffus diffusest diffusest dig dig digest digest digested digest digestion digest digestions digest digg digg digging dig dighton dighton dignified dignifi dignifies dignifi dignify dignifi dignities digniti dignity digniti digress digress digressing digress digression digress digs dig digt digt dilate dilat dilated dilat dilations dilat dilatory dilatori dild dild dildos dildo dilemma dilemma dilemmas dilemma diligence dilig diligent dilig diluculo diluculo dim dim dimension dimens dimensions dimens diminish diminish diminishing diminish diminution diminut diminutive diminut diminutives diminut dimm dimm dimmed dim dimming dim dimpled dimpl dimples dimpl dims dim din din dine dine dined dine diner diner dines dine ding ding dining dine dinner dinner dinners dinner dinnertime dinnertim dint dint diomed diom diomede diomed diomedes diomed dion dion dip dip dipp dipp dipping dip dips dip dir dir dire dire direct direct directed direct directing direct direction direct directions direct directitude directitud directive direct directly directli directs direct direful dire direness dire direst direst dirge dirg dirges dirg dirt dirt dirty dirti dis di disability disabl disable disabl disabled disabl disabling disabl disadvantage disadvantag disagree disagre disallow disallow disanimates disanim disannul disannul disannuls disannul disappointed disappoint disarm disarm disarmed disarm disarmeth disarmeth disarms disarm disaster disast disasters disast disastrous disastr disbench disbench disbranch disbranch disburdened disburden disburs disbur disburse disburs disbursed disburs discandy discandi discandying discandi discard discard discarded discard discase discas discased discas discern discern discerner discern discerning discern discernings discern discerns discern discharg discharg discharge discharg discharged discharg discharging discharg discipled discipl disciples discipl disciplin disciplin discipline disciplin disciplined disciplin disciplines disciplin disclaim disclaim disclaiming disclaim disclaims disclaim disclos disclo disclose disclos disclosed disclos discloses disclos discolour discolour discoloured discolour discolours discolour discomfit discomfit discomfited discomfit discomfiture discomfitur discomfort discomfort discomfortable discomfort discommend discommend disconsolate disconsol discontent discont discontented discont discontentedly discontentedli discontenting discont discontents discont discontinue discontinu discontinued discontinu discord discord discordant discord discords discord discourse discours discoursed discours discourser discours discourses discours discoursive discours discourtesy discourtesi discov discov discover discov discovered discov discoverers discover discoveries discoveri discovering discov discovers discov discovery discoveri discredit discredit discredited discredit discredits discredit discreet discreet discreetly discreetli discretion discret discretions discret discuss discuss disdain disdain disdained disdain disdaineth disdaineth disdainful disdain disdainfully disdainfulli disdaining disdain disdains disdain disdnguish disdnguish diseas disea disease diseas diseased diseas diseases diseas disedg disedg disembark disembark disfigure disfigur disfigured disfigur disfurnish disfurnish disgorge disgorg disgrac disgrac disgrace disgrac disgraced disgrac disgraceful disgrac disgraces disgrac disgracing disgrac disgracious disgraci disguis disgui disguise disguis disguised disguis disguiser disguis disguises disguis disguising disguis dish dish dishabited dishabit dishclout dishclout dishearten dishearten disheartens dishearten dishes dish dishonest dishonest dishonestly dishonestli dishonesty dishonesti dishonor dishonor dishonorable dishonor dishonors dishonor dishonour dishonour dishonourable dishonour dishonoured dishonour dishonours dishonour disinherit disinherit disinherited disinherit disjoin disjoin disjoining disjoin disjoins disjoin disjoint disjoint disjunction disjunct dislik dislik dislike dislik disliken disliken dislikes dislik dislimns dislimn dislocate disloc dislodg dislodg disloyal disloy disloyalty disloyalti dismal dismal dismantle dismantl dismantled dismantl dismask dismask dismay dismai dismayed dismai dismemb dismemb dismember dismemb dismes dism dismiss dismiss dismissed dismiss dismissing dismiss dismission dismiss dismount dismount dismounted dismount disnatur disnatur disobedience disobedi disobedient disobedi disobey disobei disobeys disobei disorb disorb disorder disord disordered disord disorderly disorderli disorders disord disparage disparag disparagement disparag disparagements disparag dispark dispark dispatch dispatch dispensation dispens dispense dispens dispenses dispens dispers disper disperse dispers dispersed dispers dispersedly dispersedli dispersing dispers dispiteous dispit displac displac displace displac displaced displac displant displant displanting displant display displai displayed displai displeas displea displease displeas displeased displeas displeasing displeas displeasure displeasur displeasures displeasur disponge dispong disport disport disports disport dispos dispo dispose dispos disposed dispos disposer dispos disposing dispos disposition disposit dispositions disposit dispossess dispossess dispossessing dispossess disprais disprai dispraise disprais dispraising disprais dispraisingly dispraisingli dispropertied disproperti disproportion disproport disproportioned disproport disprov disprov disprove disprov disproved disprov dispursed dispurs disputable disput disputation disput disputations disput dispute disput disputed disput disputes disput disputing disput disquantity disquant disquiet disquiet disquietly disquietli disrelish disrelish disrobe disrob disseat disseat dissemble dissembl dissembled dissembl dissembler dissembl dissemblers dissembl dissembling dissembl dissembly dissembl dissension dissens dissensions dissens dissentious dissenti dissever dissev dissipation dissip dissolute dissolut dissolutely dissolut dissolution dissolut dissolutions dissolut dissolv dissolv dissolve dissolv dissolved dissolv dissolves dissolv dissuade dissuad dissuaded dissuad distaff distaff distaffs distaff distain distain distains distain distance distanc distant distant distaste distast distasted distast distasteful distast distemp distemp distemper distemp distemperature distemperatur distemperatures distemperatur distempered distemp distempering distemp distil distil distill distil distillation distil distilled distil distills distil distilment distil distinct distinct distinction distinct distinctly distinctli distingue distingu distinguish distinguish distinguishes distinguish distinguishment distinguish distract distract distracted distract distractedly distractedli distraction distract distractions distract distracts distract distrain distrain distraught distraught distress distress distressed distress distresses distress distressful distress distribute distribut distributed distribut distribution distribut distrust distrust distrustful distrust disturb disturb disturbed disturb disturbers disturb disturbing disturb disunite disunit disvalued disvalu disvouch disvouch dit dit ditch ditch ditchers ditcher ditches ditch dites dite ditties ditti ditty ditti diurnal diurnal div div dive dive diver diver divers diver diversely divers diversity divers divert divert diverted divert diverts divert dives dive divest divest dividable divid dividant divid divide divid divided divid divides divid divideth divideth divin divin divination divin divine divin divinely divin divineness divin diviner divin divines divin divinest divinest divining divin divinity divin division divis divisions divis divorc divorc divorce divorc divorced divorc divorcement divorc divorcing divorc divulg divulg divulge divulg divulged divulg divulging divulg dizy dizi dizzy dizzi do do doating doat dobbin dobbin dock dock docks dock doct doct doctor doctor doctors doctor doctrine doctrin document document dodge dodg doe doe doer doer doers doer does doe doest doest doff doff dog dog dogberry dogberri dogfish dogfish dogg dogg dogged dog dogs dog doigts doigt doing do doings do doit doit doits doit dolabella dolabella dole dole doleful dole doll doll dollar dollar dollars dollar dolor dolor dolorous dolor dolour dolour dolours dolour dolphin dolphin dolt dolt dolts dolt domestic domest domestics domest dominance domin dominations domin dominator domin domine domin domineer domin domineering domin dominical domin dominion dominion dominions dominion domitius domitiu dommelton dommelton don don donalbain donalbain donation donat donc donc doncaster doncast done done dong dong donn donn donne donn donner donner donnerai donnerai doom doom doomsday doomsdai door door doorkeeper doorkeep doors door dorcas dorca doreus doreu doricles doricl dormouse dormous dorothy dorothi dorset dorset dorsetshire dorsetshir dost dost dotage dotag dotant dotant dotard dotard dotards dotard dote dote doted dote doters doter dotes dote doteth doteth doth doth doting dote double doubl doubled doubl doubleness doubl doubler doubler doublet doublet doublets doublet doubling doubl doubly doubli doubt doubt doubted doubt doubtful doubt doubtfully doubtfulli doubting doubt doubtless doubtless doubts doubt doug doug dough dough doughty doughti doughy doughi douglas dougla dout dout doute dout douts dout dove dove dovehouse dovehous dover dover doves dove dow dow dowager dowag dowdy dowdi dower dower dowerless dowerless dowers dower dowlas dowla dowle dowl down down downfall downfal downright downright downs down downstairs downstair downtrod downtrod downward downward downwards downward downy downi dowries dowri dowry dowri dowsabel dowsabel doxy doxi dozed doze dozen dozen dozens dozen dozy dozi drab drab drabbing drab drabs drab drachma drachma drachmas drachma draff draff drag drag dragg dragg dragged drag dragging drag dragon dragon dragonish dragonish dragons dragon drain drain drained drain drains drain drake drake dram dram dramatis dramati drank drank draught draught draughts draught drave drave draw draw drawbridge drawbridg drawer drawer drawers drawer draweth draweth drawing draw drawling drawl drawn drawn draws draw drayman drayman draymen draymen dread dread dreaded dread dreadful dread dreadfully dreadfulli dreading dread dreads dread dream dream dreamer dreamer dreamers dreamer dreaming dream dreams dream dreamt dreamt drearning drearn dreary dreari dreg dreg dregs dreg drench drench drenched drench dress dress dressed dress dresser dresser dressing dress dressings dress drest drest drew drew dribbling dribbl dried dri drier drier dries dri drift drift drily drili drink drink drinketh drinketh drinking drink drinkings drink drinks drink driv driv drive drive drivelling drivel driven driven drives drive driveth driveth driving drive drizzle drizzl drizzled drizzl drizzles drizzl droit droit drollery drolleri dromio dromio dromios dromio drone drone drones drone droop droop droopeth droopeth drooping droop droops droop drop drop dropheir dropheir droplets droplet dropp dropp dropper dropper droppeth droppeth dropping drop droppings drop drops drop dropsied dropsi dropsies dropsi dropsy dropsi dropt dropt dross dross drossy drossi drought drought drove drove droven droven drovier drovier drown drown drowned drown drowning drown drowns drown drows drow drowse drows drowsily drowsili drowsiness drowsi drowsy drowsi drudge drudg drudgery drudgeri drudges drudg drug drug drugg drugg drugs drug drum drum drumble drumbl drummer drummer drumming drum drums drum drunk drunk drunkard drunkard drunkards drunkard drunken drunken drunkenly drunkenli drunkenness drunken dry dry dryness dryness dst dst du du dub dub dubb dubb ducat ducat ducats ducat ducdame ducdam duchess duchess duchies duchi duchy duchi duck duck ducking duck ducks duck dudgeon dudgeon due due duellist duellist duello duello duer duer dues due duff duff dug dug dugs dug duke duke dukedom dukedom dukedoms dukedom dukes duke dulcet dulcet dulche dulch dull dull dullard dullard duller duller dullest dullest dulling dull dullness dull dulls dull dully dulli dulness dul duly duli dumain dumain dumb dumb dumbe dumb dumbly dumbl dumbness dumb dump dump dumps dump dun dun duncan duncan dung dung dungeon dungeon dungeons dungeon dunghill dunghil dunghills dunghil dungy dungi dunnest dunnest dunsinane dunsinan dunsmore dunsmor dunstable dunstabl dupp dupp durance duranc during dure durst durst dusky duski dust dust dusted dust dusty dusti dutch dutch dutchman dutchman duteous duteou duties duti dutiful duti duty duti dwarf dwarf dwarfish dwarfish dwell dwell dwellers dweller dwelling dwell dwells dwell dwelt dwelt dwindle dwindl dy dy dye dye dyed dy dyer dyer dying dy e e each each eager eager eagerly eagerli eagerness eager eagle eagl eagles eagl eaning ean eanlings eanl ear ear earing ear earl earl earldom earldom earlier earlier earliest earliest earliness earli earls earl early earli earn earn earned earn earnest earnest earnestly earnestli earnestness earnest earns earn ears ear earth earth earthen earthen earthlier earthlier earthly earthli earthquake earthquak earthquakes earthquak earthy earthi eas ea ease eas eased eas easeful eas eases eas easier easier easiest easiest easiliest easiliest easily easili easiness easi easing eas east east eastcheap eastcheap easter easter eastern eastern eastward eastward easy easi eat eat eaten eaten eater eater eaters eater eating eat eats eat eaux eaux eaves eav ebb ebb ebbing eb ebbs ebb ebon ebon ebony eboni ebrew ebrew ecce ecc echapper echapp echo echo echoes echo eclips eclip eclipse eclips eclipses eclips ecolier ecoli ecoutez ecoutez ecstacy ecstaci ecstasies ecstasi ecstasy ecstasi ecus ecu eden eden edg edg edgar edgar edge edg edged edg edgeless edgeless edges edg edict edict edicts edict edifice edific edifices edific edified edifi edifies edifi edition edit edm edm edmund edmund edmunds edmund edmundsbury edmundsburi educate educ educated educ education educ edward edward eel eel eels eel effect effect effected effect effectless effectless effects effect effectual effectu effectually effectu effeminate effemin effigies effigi effus effu effuse effus effusion effus eftest eftest egal egal egally egal eget eget egeus egeu egg egg eggs egg eggshell eggshel eglamour eglamour eglantine eglantin egma egma ego ego egregious egregi egregiously egregi egress egress egypt egypt egyptian egyptian egyptians egyptian eie eie eight eight eighteen eighteen eighth eighth eightpenny eightpenni eighty eighti eisel eisel either either eject eject eke ek el el elbe elb elbow elbow elbows elbow eld eld elder elder elders elder eldest eldest eleanor eleanor elect elect elected elect election elect elegancy eleg elegies elegi element element elements element elephant eleph elephants eleph elevated elev eleven eleven eleventh eleventh elf elf elflocks elflock eliads eliad elinor elinor elizabeth elizabeth ell ell elle ell ellen ellen elm elm eloquence eloqu eloquent eloqu else els elsewhere elsewher elsinore elsinor eltham eltham elves elv elvish elvish ely eli elysium elysium em em emballing embal embalm embalm embalms embalm embark embark embarked embark embarquements embarqu embassade embassad embassage embassag embassies embassi embassy embassi embattailed embattail embattl embattl embattle embattl embay embai embellished embellish embers ember emblaze emblaz emblem emblem emblems emblem embodied embodi embold embold emboldens embolden emboss emboss embossed emboss embounded embound embowel embowel embowell embowel embrac embrac embrace embrac embraced embrac embracement embrac embracements embrac embraces embrac embracing embrac embrasures embrasur embroider embroid embroidery embroideri emhracing emhrac emilia emilia eminence emin eminent emin eminently emin emmanuel emmanuel emnity emniti empale empal emperal emper emperess emperess emperial emperi emperor emperor empery emperi emphasis emphasi empire empir empirics empir empiricutic empiricut empleached empleach employ emploi employed emploi employer employ employment employ employments employ empoison empoison empress empress emptied empti emptier emptier empties empti emptiness empti empty empti emptying empti emulate emul emulation emul emulations emul emulator emul emulous emul en en enact enact enacted enact enacts enact enactures enactur enamell enamel enamelled enamel enamour enamour enamoured enamour enanmour enanmour encamp encamp encamped encamp encave encav enceladus enceladu enchaf enchaf enchafed enchaf enchant enchant enchanted enchant enchanting enchant enchantingly enchantingli enchantment enchant enchantress enchantress enchants enchant enchas encha encircle encircl encircled encircl enclos enclo enclose enclos enclosed enclos encloses enclos encloseth encloseth enclosing enclos enclouded encloud encompass encompass encompassed encompass encompasseth encompasseth encompassment encompass encore encor encorporal encorpor encount encount encounter encount encountered encount encounters encount encourage encourag encouraged encourag encouragement encourag encrimsoned encrimson encroaching encroach encumb encumb end end endamage endamag endamagement endamag endanger endang endart endart endear endear endeared endear endeavour endeavour endeavours endeavour ended end ender ender ending end endings end endite endit endless endless endow endow endowed endow endowments endow endows endow ends end endu endu endue endu endur endur endurance endur endure endur endured endur endures endur enduring endur endymion endymion eneas enea enemies enemi enemy enemi enernies enerni enew enew enfeebled enfeebl enfeebles enfeebl enfeoff enfeoff enfetter enfett enfoldings enfold enforc enforc enforce enforc enforced enforc enforcedly enforcedli enforcement enforc enforces enforc enforcest enforcest enfranched enfranch enfranchis enfranchi enfranchise enfranchis enfranchised enfranchis enfranchisement enfranchis enfreed enfre enfreedoming enfreedom engag engag engage engag engaged engag engagements engag engaging engag engaol engaol engend engend engender engend engenders engend engilds engild engine engin engineer engin enginer engin engines engin engirt engirt england england english english englishman englishman englishmen englishmen engluts englut englutted englut engraffed engraf engraft engraft engrafted engraft engrav engrav engrave engrav engross engross engrossed engross engrossest engrossest engrossing engross engrossments engross enguard enguard enigma enigma enigmatical enigmat enjoin enjoin enjoined enjoin enjoy enjoi enjoyed enjoi enjoyer enjoy enjoying enjoi enjoys enjoi enkindle enkindl enkindled enkindl enlard enlard enlarg enlarg enlarge enlarg enlarged enlarg enlargement enlarg enlargeth enlargeth enlighten enlighten enlink enlink enmesh enmesh enmities enmiti enmity enmiti ennoble ennobl ennobled ennobl enobarb enobarb enobarbus enobarbu enon enon enormity enorm enormous enorm enough enough enow enow enpatron enpatron enpierced enpierc enquir enquir enquire enquir enquired enquir enrag enrag enrage enrag enraged enrag enrages enrag enrank enrank enrapt enrapt enrich enrich enriched enrich enriches enrich enridged enridg enrings enr enrob enrob enrobe enrob enroll enrol enrolled enrol enrooted enroot enrounded enround enschedul enschedul ensconce ensconc ensconcing ensconc enseamed enseam ensear ensear enseigne enseign enseignez enseignez ensemble ensembl enshelter enshelt enshielded enshield enshrines enshrin ensign ensign ensigns ensign enskied enski ensman ensman ensnare ensnar ensnared ensnar ensnareth ensnareth ensteep ensteep ensu ensu ensue ensu ensued ensu ensues ensu ensuing ensu enswathed enswath ent ent entail entail entame entam entangled entangl entangles entangl entendre entendr enter enter entered enter entering enter enterprise enterpris enterprises enterpris enters enter entertain entertain entertained entertain entertainer entertain entertaining entertain entertainment entertain entertainments entertain enthrall enthral enthralled enthral enthron enthron enthroned enthron entice entic enticements entic enticing entic entire entir entirely entir entitle entitl entitled entitl entitling entitl entomb entomb entombed entomb entrails entrail entrance entranc entrances entranc entrap entrap entrapp entrapp entre entr entreat entreat entreated entreat entreaties entreati entreating entreat entreatments entreat entreats entreat entreaty entreati entrench entrench entry entri entwist entwist envelop envelop envenom envenom envenomed envenom envenoms envenom envied envi envies envi envious enviou enviously envious environ environ environed environ envoy envoi envy envi envying envi enwheel enwheel enwombed enwomb enwraps enwrap ephesian ephesian ephesians ephesian ephesus ephesu epicure epicur epicurean epicurean epicures epicur epicurism epicur epicurus epicuru epidamnum epidamnum epidaurus epidauru epigram epigram epilepsy epilepsi epileptic epilept epilogue epilogu epilogues epilogu epistles epistl epistrophus epistrophu epitaph epitaph epitaphs epitaph epithet epithet epitheton epitheton epithets epithet epitome epitom equal equal equalities equal equality equal equall equal equally equal equalness equal equals equal equinoctial equinocti equinox equinox equipage equipag equity equiti equivocal equivoc equivocate equivoc equivocates equivoc equivocation equivoc equivocator equivoc er er erbear erbear erbearing erbear erbears erbear erbeat erbeat erblows erblow erboard erboard erborne erborn ercame ercam ercast ercast ercharg ercharg ercharged ercharg ercharging ercharg ercles ercl ercome ercom ercover ercov ercrows ercrow erdoing erdo ere er erebus erebu erect erect erected erect erecting erect erection erect erects erect erewhile erewhil erflourish erflourish erflow erflow erflowing erflow erflows erflow erfraught erfraught erga erga ergalled ergal erglanced erglanc ergo ergo ergone ergon ergrow ergrow ergrown ergrown ergrowth ergrowth erhang erhang erhanging erhang erhasty erhasti erhear erhear erheard erheard eringoes eringo erjoy erjoi erleap erleap erleaps erleap erleavens erleaven erlook erlook erlooking erlook ermaster ermast ermengare ermengar ermount ermount ern ern ernight ernight eros ero erpaid erpaid erparted erpart erpast erpast erpays erpai erpeer erpeer erperch erperch erpicturing erpictur erpingham erpingham erposting erpost erpow erpow erpress erpress erpressed erpress err err errand errand errands errand errant errant errate errat erraught erraught erreaches erreach erred er errest errest erring er erroneous erron error error errors error errs err errule errul errun errun erset erset ershade ershad ershades ershad ershine ershin ershot ershot ersized ersiz erskip erskip erslips erslip erspreads erspread erst erst erstare erstar erstep erstep erstunk erstunk ersway erswai ersways erswai erswell erswel erta erta ertake ertak erteemed erteem erthrow erthrow erthrown erthrown erthrows erthrow ertook ertook ertop ertop ertopping ertop ertrip ertrip erturn erturn erudition erudit eruption erupt eruptions erupt ervalues ervalu erwalk erwalk erwatch erwatch erween erween erweens erween erweigh erweigh erweighs erweigh erwhelm erwhelm erwhelmed erwhelm erworn erworn es es escalus escalu escap escap escape escap escaped escap escapes escap eschew eschew escoted escot esill esil especial especi especially especi esperance esper espials espial espied espi espies espi espous espou espouse espous espy espi esquire esquir esquires esquir essay essai essays essai essence essenc essential essenti essentially essenti esses ess essex essex est est establish establish established establish estate estat estates estat esteem esteem esteemed esteem esteemeth esteemeth esteeming esteem esteems esteem estimable estim estimate estim estimation estim estimations estim estime estim estranged estrang estridge estridg estridges estridg et et etc etc etceteras etcetera ete et eternal etern eternally etern eterne etern eternity etern eterniz eterniz etes et ethiop ethiop ethiope ethiop ethiopes ethiop ethiopian ethiopian etna etna eton eton etre etr eunuch eunuch eunuchs eunuch euphrates euphrat euphronius euphroniu euriphile euriphil europa europa europe europ ev ev evade evad evades evad evans evan evasion evas evasions evas eve ev even even evening even evenly evenli event event eventful event events event ever ever everlasting everlast everlastingly everlastingli evermore evermor every everi everyone everyon everything everyth everywhere everywher evidence evid evidences evid evident evid evil evil evilly evilli evils evil evitate evit ewe ew ewer ewer ewers ewer ewes ew exact exact exacted exact exactest exactest exacting exact exaction exact exactions exact exactly exactli exacts exact exalt exalt exalted exalt examin examin examination examin examinations examin examine examin examined examin examines examin exampl exampl example exampl exampled exampl examples exampl exasperate exasper exasperates exasper exceed exce exceeded exceed exceedeth exceedeth exceeding exceed exceedingly exceedingli exceeds exce excel excel excelled excel excellence excel excellencies excel excellency excel excellent excel excellently excel excelling excel excels excel except except excepted except excepting except exception except exceptions except exceptless exceptless excess excess excessive excess exchang exchang exchange exchang exchanged exchang exchequer exchequ exchequers exchequ excite excit excited excit excitements excit excites excit exclaim exclaim exclaims exclaim exclamation exclam exclamations exclam excludes exclud excommunicate excommun excommunication excommun excrement excrement excrements excrement excursion excurs excursions excurs excus excu excusable excus excuse excus excused excus excuses excus excusez excusez excusing excus execrable execr execrations execr execute execut executed execut executing execut execution execut executioner execution executioners execution executor executor executors executor exempt exempt exempted exempt exequies exequi exercise exercis exercises exercis exeter exet exeunt exeunt exhal exhal exhalation exhal exhalations exhal exhale exhal exhales exhal exhaust exhaust exhibit exhibit exhibiters exhibit exhibition exhibit exhort exhort exhortation exhort exigent exig exil exil exile exil exiled exil exion exion exist exist exists exist exit exit exits exit exorciser exorcis exorcisms exorc exorcist exorcist expect expect expectance expect expectancy expect expectation expect expectations expect expected expect expecters expect expecting expect expects expect expedience expedi expedient expedi expediently expedi expedition expedit expeditious expediti expel expel expell expel expelling expel expels expel expend expend expense expens expenses expens experienc experienc experience experi experiences experi experiment experi experimental experiment experiments experi expert expert expertness expert expiate expiat expiation expiat expir expir expiration expir expire expir expired expir expires expir expiring expir explication explic exploit exploit exploits exploit expos expo expose expos exposing expos exposition exposit expositor expositor expostulate expostul expostulation expostul exposture expostur exposure exposur expound expound expounded expound express express expressed express expresseth expresseth expressing express expressive express expressly expressli expressure expressur expuls expul expulsion expuls exquisite exquisit exsufflicate exsuffl extant extant extemporal extempor extemporally extempor extempore extempor extend extend extended extend extends extend extent extent extenuate extenu extenuated extenu extenuates extenu extenuation extenu exterior exterior exteriorly exteriorli exteriors exterior extermin extermin extern extern external extern extinct extinct extincted extinct extincture extinctur extinguish extinguish extirp extirp extirpate extirp extirped extirp extol extol extoll extol extolment extol exton exton extort extort extorted extort extortion extort extortions extort extra extra extract extract extracted extract extracting extract extraordinarily extraordinarili extraordinary extraordinari extraught extraught extravagancy extravag extravagant extravag extreme extrem extremely extrem extremes extrem extremest extremest extremities extrem extremity extrem exuent exuent exult exult exultation exult ey ey eyas eya eyases eyas eye ey eyeball eyebal eyeballs eyebal eyebrow eyebrow eyebrows eyebrow eyed ei eyeless eyeless eyelid eyelid eyelids eyelid eyes ey eyesight eyesight eyestrings eyestr eying ei eyne eyn eyrie eyri fa fa fabian fabian fable fabl fables fabl fabric fabric fabulous fabul fac fac face face faced face facere facer faces face faciant faciant facile facil facility facil facinerious facineri facing face facit facit fact fact faction faction factionary factionari factions faction factious factiou factor factor factors factor faculties faculti faculty faculti fade fade faded fade fadeth fadeth fadge fadg fading fade fadings fade fadom fadom fadoms fadom fagot fagot fagots fagot fail fail failing fail fails fail fain fain faint faint fainted faint fainter fainter fainting faint faintly faintli faintness faint faints faint fair fair fairer fairer fairest fairest fairies fairi fairing fair fairings fair fairly fairli fairness fair fairs fair fairwell fairwel fairy fairi fais fai fait fait faites fait faith faith faithful faith faithfull faithful faithfully faithfulli faithless faithless faiths faith faitors faitor fal fal falchion falchion falcon falcon falconbridge falconbridg falconer falcon falconers falcon fall fall fallacy fallaci fallen fallen falleth falleth falliable falliabl fallible fallibl falling fall fallow fallow fallows fallow falls fall fally falli falorous falor false fals falsehood falsehood falsely fals falseness fals falser falser falsify falsifi falsing fals falstaff falstaff falstaffs falstaff falter falter fam fam fame fame famed fame familiar familiar familiarity familiar familiarly familiarli familiars familiar family famili famine famin famish famish famished famish famous famou famoused famous famously famous fan fan fanatical fanat fancies fanci fancy fanci fane fane fanes fane fang fang fangled fangl fangless fangless fangs fang fann fann fanning fan fans fan fantasied fantasi fantasies fantasi fantastic fantast fantastical fantast fantastically fantast fantasticoes fantastico fantasy fantasi fap fap far far farborough farborough farced farc fardel fardel fardels fardel fare fare fares fare farewell farewel farewells farewel fariner farin faring fare farm farm farmer farmer farmhouse farmhous farms farm farre farr farrow farrow farther farther farthest farthest farthing farth farthingale farthingal farthingales farthingal farthings farth fartuous fartuou fas fa fashion fashion fashionable fashion fashioning fashion fashions fashion fast fast fasted fast fasten fasten fastened fasten faster faster fastest fastest fasting fast fastly fastli fastolfe fastolf fasts fast fat fat fatal fatal fatally fatal fate fate fated fate fates fate father father fathered father fatherless fatherless fatherly fatherli fathers father fathom fathom fathomless fathomless fathoms fathom fatigate fatig fatness fat fats fat fatted fat fatter fatter fattest fattest fatting fat fatuus fatuu fauconbridge fauconbridg faulconbridge faulconbridg fault fault faultiness faulti faultless faultless faults fault faulty faulti fausse fauss fauste faust faustuses faustus faut faut favor favor favorable favor favorably favor favors favor favour favour favourable favour favoured favour favouredly favouredli favourer favour favourers favour favouring favour favourite favourit favourites favourit favours favour favout favout fawn fawn fawneth fawneth fawning fawn fawns fawn fay fai fe fe fealty fealti fear fear feared fear fearest fearest fearful fear fearfull fearful fearfully fearfulli fearfulness fear fearing fear fearless fearless fears fear feast feast feasted feast feasting feast feasts feast feat feat feated feat feater feater feather feather feathered feather feathers feather featly featli feats feat featur featur feature featur featured featur featureless featureless features featur february februari fecks feck fed fed fedary fedari federary federari fee fee feeble feebl feebled feebl feebleness feebl feebling feebl feebly feebli feed feed feeder feeder feeders feeder feedeth feedeth feeding feed feeds feed feel feel feeler feeler feeling feel feelingly feelingli feels feel fees fee feet feet fehemently fehement feign feign feigned feign feigning feign feil feil feith feith felicitate felicit felicity felic fell fell fellest fellest fellies felli fellow fellow fellowly fellowli fellows fellow fellowship fellowship fellowships fellowship fells fell felon felon felonious feloni felony feloni felt felt female femal females femal feminine feminin fen fen fenc fenc fence fenc fencer fencer fencing fenc fends fend fennel fennel fenny fenni fens fen fenton fenton fer fer ferdinand ferdinand fere fere fernseed fernse ferrara ferrara ferrers ferrer ferret ferret ferry ferri ferryman ferryman fertile fertil fertility fertil fervency fervenc fervour fervour fery feri fest fest feste fest fester fester festinate festin festinately festin festival festiv festivals festiv fet fet fetch fetch fetches fetch fetching fetch fetlock fetlock fetlocks fetlock fett fett fetter fetter fettering fetter fetters fetter fettle fettl feu feu feud feud fever fever feverous fever fevers fever few few fewer fewer fewest fewest fewness few fickle fickl fickleness fickl fico fico fiction fiction fiddle fiddl fiddler fiddler fiddlestick fiddlestick fidele fidel fidelicet fidelicet fidelity fidel fidius fidiu fie fie field field fielded field fields field fiend fiend fiends fiend fierce fierc fiercely fierc fierceness fierc fiery fieri fife fife fifes fife fifteen fifteen fifteens fifteen fifteenth fifteenth fifth fifth fifty fifti fiftyfold fiftyfold fig fig fight fight fighter fighter fightest fightest fighteth fighteth fighting fight fights fight figo figo figs fig figur figur figure figur figured figur figures figur figuring figur fike fike fil fil filberts filbert filch filch filches filch filching filch file file filed file files file filial filial filius filiu fill fill filled fill fillet fillet filling fill fillip fillip fills fill filly filli film film fils fil filth filth filths filth filthy filthi fin fin finally final finch finch find find finder finder findeth findeth finding find findings find finds find fine fine fineless fineless finely fine finem finem fineness fine finer finer fines fine finest finest fing fing finger finger fingering finger fingers finger fingre fingr fingres fingr finical finic finish finish finished finish finisher finish finless finless finn finn fins fin finsbury finsburi fir fir firago firago fire fire firebrand firebrand firebrands firebrand fired fire fires fire firework firework fireworks firework firing fire firk firk firm firm firmament firmament firmly firmli firmness firm first first firstlings firstl fish fish fisher fisher fishermen fishermen fishers fisher fishes fish fishified fishifi fishmonger fishmong fishpond fishpond fisnomy fisnomi fist fist fisting fist fists fist fistula fistula fit fit fitchew fitchew fitful fit fitly fitli fitment fitment fitness fit fits fit fitted fit fitter fitter fittest fittest fitteth fitteth fitting fit fitzwater fitzwat five five fivepence fivep fives five fix fix fixed fix fixes fix fixeth fixeth fixing fix fixture fixtur fl fl flag flag flagging flag flagon flagon flagons flagon flags flag flail flail flakes flake flaky flaki flam flam flame flame flamen flamen flamens flamen flames flame flaming flame flaminius flaminiu flanders flander flannel flannel flap flap flaring flare flash flash flashes flash flashing flash flask flask flat flat flatly flatli flatness flat flats flat flatt flatt flatter flatter flattered flatter flatterer flatter flatterers flatter flatterest flatterest flatteries flatteri flattering flatter flatters flatter flattery flatteri flaunts flaunt flavio flavio flavius flaviu flaw flaw flaws flaw flax flax flaxen flaxen flay flai flaying flai flea flea fleance fleanc fleas flea flecked fleck fled fled fledge fledg flee flee fleec fleec fleece fleec fleeces fleec fleer fleer fleering fleer fleers fleer fleet fleet fleeter fleeter fleeting fleet fleming fleme flemish flemish flesh flesh fleshes flesh fleshly fleshli fleshment fleshment fleshmonger fleshmong flew flew flexible flexibl flexure flexur flibbertigibbet flibbertigibbet flickering flicker flidge flidg fliers flier flies fli flieth flieth flight flight flights flight flighty flighti flinch flinch fling fling flint flint flints flint flinty flinti flirt flirt float float floated float floating float flock flock flocks flock flood flood floodgates floodgat floods flood floor floor flora flora florence florenc florentine florentin florentines florentin florentius florentiu florizel florizel flote flote floulish floulish flour flour flourish flourish flourishes flourish flourisheth flourisheth flourishing flourish flout flout flouted flout flouting flout flouts flout flow flow flowed flow flower flower flowerets floweret flowers flower flowing flow flown flown flows flow fluellen fluellen fluent fluent flung flung flush flush flushing flush fluster fluster flute flute flutes flute flutter flutter flux flux fluxive fluxiv fly fly flying fly fo fo foal foal foals foal foam foam foamed foam foaming foam foams foam foamy foami fob fob focative foc fodder fodder foe foe foeman foeman foemen foemen foes foe fog fog foggy foggi fogs fog foh foh foi foi foil foil foiled foil foils foil foin foin foining foin foins foin fois foi foison foison foisons foison foist foist foix foix fold fold folded fold folds fold folio folio folk folk folks folk follies folli follow follow followed follow follower follow followers follow followest followest following follow follows follow folly folli fond fond fonder fonder fondly fondli fondness fond font font fontibell fontibel food food fool fool fooleries fooleri foolery fooleri foolhardy foolhardi fooling fool foolish foolish foolishly foolishli foolishness foolish fools fool foot foot football footbal footboy footboi footboys footboi footed foot footfall footfal footing foot footman footman footmen footmen footpath footpath footsteps footstep footstool footstool fopp fopp fopped fop foppery fopperi foppish foppish fops fop for for forage forag foragers forag forbade forbad forbear forbear forbearance forbear forbears forbear forbid forbid forbidden forbidden forbiddenly forbiddenli forbids forbid forbod forbod forborne forborn forc forc force forc forced forc forceful forc forceless forceless forces forc forcible forcibl forcibly forcibl forcing forc ford ford fordid fordid fordo fordo fordoes fordo fordone fordon fore fore forecast forecast forefather forefath forefathers forefath forefinger forefing forego forego foregone foregon forehand forehand forehead forehead foreheads forehead forehorse forehors foreign foreign foreigner foreign foreigners foreign foreknowing foreknow foreknowledge foreknowledg foremost foremost forenamed forenam forenoon forenoon forerun forerun forerunner forerunn forerunning forerun foreruns forerun foresaid foresaid foresaw foresaw foresay foresai foresee forese foreseeing forese foresees forese foreshow foreshow foreskirt foreskirt forespent foresp forest forest forestall forestal forestalled forestal forester forest foresters forest forests forest foretell foretel foretelling foretel foretells foretel forethink forethink forethought forethought foretold foretold forever forev foreward foreward forewarn forewarn forewarned forewarn forewarning forewarn forfeit forfeit forfeited forfeit forfeiters forfeit forfeiting forfeit forfeits forfeit forfeiture forfeitur forfeitures forfeitur forfend forfend forfended forfend forg forg forgave forgav forge forg forged forg forgeries forgeri forgery forgeri forges forg forget forget forgetful forget forgetfulness forget forgetive forget forgets forget forgetting forget forgive forgiv forgiven forgiven forgiveness forgiv forgo forgo forgoing forgo forgone forgon forgot forgot forgotten forgotten fork fork forked fork forks fork forlorn forlorn form form formal formal formally formal formed form former former formerly formerli formless formless forms form fornication fornic fornications fornic fornicatress fornicatress forres forr forrest forrest forsake forsak forsaken forsaken forsaketh forsaketh forslow forslow forsook forsook forsooth forsooth forspent forspent forspoke forspok forswear forswear forswearing forswear forswore forswor forsworn forsworn fort fort forted fort forth forth forthcoming forthcom forthlight forthlight forthright forthright forthwith forthwith fortification fortif fortifications fortif fortified fortifi fortifies fortifi fortify fortifi fortinbras fortinbra fortitude fortitud fortnight fortnight fortress fortress fortresses fortress forts fort fortun fortun fortuna fortuna fortunate fortun fortunately fortun fortune fortun fortuned fortun fortunes fortun fortward fortward forty forti forum forum forward forward forwarding forward forwardness forward forwards forward forwearied forweari fosset fosset fost fost foster foster fostered foster fought fought foughten foughten foul foul fouler fouler foulest foulest foully foulli foulness foul found found foundation foundat foundations foundat founded found founder founder fount fount fountain fountain fountains fountain founts fount four four fourscore fourscor fourteen fourteen fourth fourth foutra foutra fowl fowl fowler fowler fowling fowl fowls fowl fox fox foxes fox foxship foxship fracted fract fraction fraction fractions fraction fragile fragil fragment fragment fragments fragment fragrant fragrant frail frail frailer frailer frailties frailti frailty frailti fram fram frame frame framed frame frames frame frampold frampold fran fran francais francai france franc frances franc franchise franchis franchised franchis franchisement franchis franchises franchis franciae francia francis franci francisca francisca franciscan franciscan francisco francisco frank frank franker franker frankfort frankfort franklin franklin franklins franklin frankly frankli frankness frank frantic frantic franticly franticli frateretto frateretto fratrum fratrum fraud fraud fraudful fraud fraught fraught fraughtage fraughtag fraughting fraught fray frai frays frai freckl freckl freckled freckl freckles freckl frederick frederick free free freed freed freedom freedom freedoms freedom freehearted freeheart freelier freelier freely freeli freeman freeman freemen freemen freeness freeness freer freer frees free freestone freeston freetown freetown freeze freez freezes freez freezing freez freezings freez french french frenchman frenchman frenchmen frenchmen frenchwoman frenchwoman frenzy frenzi frequent frequent frequents frequent fresh fresh fresher fresher freshes fresh freshest freshest freshly freshli freshness fresh fret fret fretful fret frets fret fretted fret fretten fretten fretting fret friar friar friars friar friday fridai fridays fridai friend friend friended friend friending friend friendless friendless friendliness friendli friendly friendli friends friend friendship friendship friendships friendship frieze friez fright fright frighted fright frightened frighten frightful fright frighting fright frights fright fringe fring fringed fring frippery fripperi frisk frisk fritters fritter frivolous frivol fro fro frock frock frog frog frogmore frogmor froissart froissart frolic frolic from from front front fronted front frontier frontier frontiers frontier fronting front frontlet frontlet fronts front frost frost frosts frost frosty frosti froth froth froward froward frown frown frowning frown frowningly frowningli frowns frown froze froze frozen frozen fructify fructifi frugal frugal fruit fruit fruiterer fruiter fruitful fruit fruitfully fruitfulli fruitfulness fruit fruition fruition fruitless fruitless fruits fruit frush frush frustrate frustrat frutify frutifi fry fry fubb fubb fuel fuel fugitive fugit fulfil fulfil fulfill fulfil fulfilling fulfil fulfils fulfil full full fullam fullam fuller fuller fullers fuller fullest fullest fullness full fully fulli fulness ful fulsome fulsom fulvia fulvia fum fum fumble fumbl fumbles fumbl fumblest fumblest fumbling fumbl fume fume fumes fume fuming fume fumiter fumit fumitory fumitori fun fun function function functions function fundamental fundament funeral funer funerals funer fur fur furbish furbish furies furi furious furiou furlongs furlong furnace furnac furnaces furnac furnish furnish furnished furnish furnishings furnish furniture furnitur furnival furniv furor furor furr furr furrow furrow furrowed furrow furrows furrow furth furth further further furtherance further furtherer further furthermore furthermor furthest furthest fury furi furze furz furzes furz fust fust fustian fustian fustilarian fustilarian fusty fusti fut fut future futur futurity futur g g gabble gabbl gaberdine gaberdin gabriel gabriel gad gad gadding gad gads gad gadshill gadshil gag gag gage gage gaged gage gagg gagg gaging gage gagne gagn gain gain gained gain gainer gainer gaingiving gaingiv gains gain gainsaid gainsaid gainsay gainsai gainsaying gainsai gainsays gainsai gainst gainst gait gait gaited gait galathe galath gale gale galen galen gales gale gall gall gallant gallant gallantly gallantli gallantry gallantri gallants gallant galled gall gallery galleri galley gallei galleys gallei gallia gallia gallian gallian galliard galliard galliasses galliass gallimaufry gallimaufri galling gall gallons gallon gallop gallop galloping gallop gallops gallop gallow gallow galloway gallowai gallowglasses gallowglass gallows gallow gallowses gallows galls gall gallus gallu gam gam gambol gambol gambold gambold gambols gambol gamboys gamboi game game gamers gamer games game gamesome gamesom gamester gamest gaming game gammon gammon gamut gamut gan gan gangren gangren ganymede ganymed gaol gaol gaoler gaoler gaolers gaoler gaols gaol gap gap gape gape gapes gape gaping gape gar gar garb garb garbage garbag garboils garboil garcon garcon gard gard garde gard garden garden gardener garden gardeners garden gardens garden gardez gardez gardiner gardin gardon gardon gargantua gargantua gargrave gargrav garish garish garland garland garlands garland garlic garlic garment garment garments garment garmet garmet garner garner garners garner garnish garnish garnished garnish garret garret garrison garrison garrisons garrison gart gart garter garter garterd garterd gartering garter garters garter gascony gasconi gash gash gashes gash gaskins gaskin gasp gasp gasping gasp gasted gast gastness gast gat gat gate gate gated gate gates gate gath gath gather gather gathered gather gathering gather gathers gather gatories gatori gatory gatori gaud gaud gaudeo gaudeo gaudy gaudi gauge gaug gaul gaul gaultree gaultre gaunt gaunt gauntlet gauntlet gauntlets gauntlet gav gav gave gave gavest gavest gawded gawd gawds gawd gawsey gawsei gay gai gayness gay gaz gaz gaze gaze gazed gaze gazer gazer gazers gazer gazes gaze gazeth gazeth gazing gaze gear gear geck geck geese gees geffrey geffrei geld geld gelded geld gelding geld gelida gelida gelidus gelidu gelt gelt gem gem geminy gemini gems gem gen gen gender gender genders gender general gener generally gener generals gener generation gener generations gener generative gener generosity generos generous gener genitive genit genitivo genitivo genius geniu gennets gennet genoa genoa genoux genoux gens gen gent gent gentilhomme gentilhomm gentility gentil gentle gentl gentlefolks gentlefolk gentleman gentleman gentlemanlike gentlemanlik gentlemen gentlemen gentleness gentl gentler gentler gentles gentl gentlest gentlest gentlewoman gentlewoman gentlewomen gentlewomen gently gentli gentry gentri george georg gerard gerard germaines germain germains germain german german germane german germans german germany germani gertrude gertrud gest gest gests gest gesture gestur gestures gestur get get getrude getrud gets get getter getter getting get ghastly ghastli ghost ghost ghosted ghost ghostly ghostli ghosts ghost gi gi giant giant giantess giantess giantlike giantlik giants giant gib gib gibber gibber gibbet gibbet gibbets gibbet gibe gibe giber giber gibes gibe gibing gibe gibingly gibingli giddily giddili giddiness giddi giddy giddi gift gift gifts gift gig gig giglets giglet giglot giglot gilbert gilbert gild gild gilded gild gilding gild gilliams gilliam gillian gillian gills gill gillyvors gillyvor gilt gilt gimmal gimmal gimmers gimmer gin gin ging ging ginger ginger gingerbread gingerbread gingerly gingerli ginn ginn gins gin gioucestershire gioucestershir gipes gipe gipsies gipsi gipsy gipsi gird gird girded gird girdle girdl girdled girdl girdles girdl girdling girdl girl girl girls girl girt girt girth girth gis gi giv giv give give given given giver giver givers giver gives give givest givest giveth giveth giving give givings give glad glad gladded glad gladding glad gladly gladli gladness glad glamis glami glanc glanc glance glanc glanced glanc glances glanc glancing glanc glanders glander glansdale glansdal glare glare glares glare glass glass glasses glass glassy glassi glaz glaz glazed glaze gleams gleam glean glean gleaned glean gleaning glean gleeful gleeful gleek gleek gleeking gleek gleeks gleek glend glend glendower glendow glib glib glide glide glided glide glides glide glideth glideth gliding glide glimmer glimmer glimmering glimmer glimmers glimmer glimpse glimps glimpses glimps glist glist glistening glisten glister glister glistering glister glisters glister glitt glitt glittering glitter globe globe globes globe glooming gloom gloomy gloomi glories glori glorified glorifi glorify glorifi glorious gloriou gloriously glorious glory glori glose glose gloss gloss glosses gloss glou glou glouceste gloucest gloucester gloucest gloucestershire gloucestershir glove glove glover glover gloves glove glow glow glowed glow glowing glow glowworm glowworm gloz gloz gloze gloze glozes gloze glu glu glue glue glued glu glues glue glut glut glutt glutt glutted glut glutton glutton gluttoning glutton gluttony gluttoni gnarled gnarl gnarling gnarl gnat gnat gnats gnat gnaw gnaw gnawing gnaw gnawn gnawn gnaws gnaw go go goad goad goaded goad goads goad goal goal goat goat goatish goatish goats goat gobbets gobbet gobbo gobbo goblet goblet goblets goblet goblin goblin goblins goblin god god godded god godden godden goddess goddess goddesses goddess goddild goddild godfather godfath godfathers godfath godhead godhead godlike godlik godliness godli godly godli godmother godmoth gods god godson godson goer goer goers goer goes goe goest goest goeth goeth goffe goff gogs gog going go gold gold golden golden goldenly goldenli goldsmith goldsmith goldsmiths goldsmith golgotha golgotha goliases golias goliath goliath gon gon gondola gondola gondolier gondoli gone gone goneril goneril gong gong gonzago gonzago gonzalo gonzalo good good goodfellow goodfellow goodlier goodlier goodliest goodliest goodly goodli goodman goodman goodness good goodnight goodnight goodrig goodrig goods good goodwife goodwif goodwill goodwil goodwin goodwin goodwins goodwin goodyear goodyear goodyears goodyear goose goos gooseberry gooseberri goosequills goosequil goot goot gor gor gorbellied gorbelli gorboduc gorboduc gordian gordian gore gore gored gore gorg gorg gorge gorg gorgeous gorgeou gorget gorget gorging gorg gorgon gorgon gormandize gormand gormandizing gormand gory gori gosling gosl gospel gospel gospels gospel goss goss gossamer gossam gossip gossip gossiping gossip gossiplike gossiplik gossips gossip got got goth goth goths goth gotten gotten gourd gourd gout gout gouts gout gouty gouti govern govern governance govern governed govern governess gover government govern governor governor governors governor governs govern gower gower gown gown gowns gown grac grac grace grace graced grace graceful grace gracefully gracefulli graceless graceless graces grace gracing grace gracious graciou graciously gracious gradation gradat graff graff graffing graf graft graft grafted graft grafters grafter grain grain grained grain grains grain gramercies gramerci gramercy gramerci grammar grammar grand grand grandam grandam grandame grandam grandchild grandchild grande grand grandeur grandeur grandfather grandfath grandjurors grandjuror grandmother grandmoth grandpre grandpr grandsir grandsir grandsire grandsir grandsires grandsir grange grang grant grant granted grant granting grant grants grant grape grape grapes grape grapple grappl grapples grappl grappling grappl grasp grasp grasped grasp grasps grasp grass grass grasshoppers grasshopp grassy grassi grate grate grated grate grateful grate grates grate gratiano gratiano gratify gratifi gratii gratii gratillity gratil grating grate gratis grati gratitude gratitud gratulate gratul grav grav grave grave gravediggers gravedigg gravel gravel graveless graveless gravell gravel gravely grave graven graven graveness grave graver graver graves grave gravest gravest gravestone graveston gravities graviti gravity graviti gravy gravi gray grai graymalkin graymalkin graz graz graze graze grazed graze grazing graze grease greas greases greas greasily greasili greasy greasi great great greater greater greatest greatest greatly greatli greatness great grecian grecian grecians grecian gree gree greece greec greed greed greedily greedili greediness greedi greedy greedi greeing gree greek greek greekish greekish greeks greek green green greener greener greenly greenli greens green greensleeves greensleev greenwich greenwich greenwood greenwood greet greet greeted greet greeting greet greetings greet greets greet greg greg gregory gregori gremio gremio grew grew grey grei greybeard greybeard greybeards greybeard greyhound greyhound greyhounds greyhound grief grief griefs grief griev griev grievance grievanc grievances grievanc grieve griev grieved griev grieves griev grievest grievest grieving griev grievingly grievingli grievous grievou grievously grievous griffin griffin griffith griffith grim grim grime grime grimly grimli grin grin grind grind grinding grind grindstone grindston grinning grin grip grip gripe gripe gripes gripe griping gripe grise grise grisly grisli grissel grissel grize grize grizzle grizzl grizzled grizzl groan groan groaning groan groans groan groat groat groats groat groin groin groom groom grooms groom grop grop groping grope gros gro gross gross grosser grosser grossly grossli grossness gross ground ground grounded ground groundlings groundl grounds ground grove grove grovel grovel grovelling grovel groves grove grow grow groweth groweth growing grow grown grown grows grow growth growth grub grub grubb grubb grubs grub grudge grudg grudged grudg grudges grudg grudging grudg gruel gruel grumble grumbl grumblest grumblest grumbling grumbl grumblings grumbl grumio grumio grund grund grunt grunt gualtier gualtier guard guard guardage guardag guardant guardant guarded guard guardian guardian guardians guardian guards guard guardsman guardsman gud gud gudgeon gudgeon guerdon guerdon guerra guerra guess guess guesses guess guessingly guessingli guest guest guests guest guiana guiana guichard guichard guide guid guided guid guider guider guiderius guideriu guides guid guiding guid guidon guidon guienne guienn guil guil guildenstern guildenstern guilders guilder guildford guildford guildhall guildhal guile guil guiled guil guileful guil guilfords guilford guilt guilt guiltian guiltian guiltier guiltier guiltily guiltili guiltiness guilti guiltless guiltless guilts guilt guilty guilti guinea guinea guinever guinev guise guis gul gul gules gule gulf gulf gulfs gulf gull gull gulls gull gum gum gumm gumm gums gum gun gun gunner gunner gunpowder gunpowd guns gun gurnet gurnet gurney gurnei gust gust gusts gust gusty gusti guts gut gutter gutter guy gui guynes guyn guysors guysor gypsy gypsi gyve gyve gyved gyve gyves gyve h h ha ha haberdasher haberdash habiliment habili habiliments habili habit habit habitation habit habited habit habits habit habitude habitud hack hack hacket hacket hackney hacknei hacks hack had had hadst hadst haec haec haeres haer hag hag hagar hagar haggard haggard haggards haggard haggish haggish haggled haggl hags hag hail hail hailed hail hailstone hailston hailstones hailston hair hair hairless hairless hairs hair hairy hairi hal hal halberd halberd halberds halberd halcyon halcyon hale hale haled hale hales hale half half halfcan halfcan halfpence halfpenc halfpenny halfpenni halfpennyworth halfpennyworth halfway halfwai halidom halidom hall hall halloa halloa halloing hallo hallond hallond halloo halloo hallooing halloo hallow hallow hallowed hallow hallowmas hallowma hallown hallown hals hal halt halt halter halter halters halter halting halt halts halt halves halv ham ham hames hame hamlet hamlet hammer hammer hammered hammer hammering hammer hammers hammer hamper hamper hampton hampton hams ham hamstring hamstr hand hand handed hand handful hand handicraft handicraft handicraftsmen handicraftsmen handing hand handiwork handiwork handkercher handkerch handkerchers handkerch handkerchief handkerchief handle handl handled handl handles handl handless handless handlest handlest handling handl handmaid handmaid handmaids handmaid hands hand handsaw handsaw handsome handsom handsomely handsom handsomeness handsom handwriting handwrit handy handi hang hang hanged hang hangers hanger hangeth hangeth hanging hang hangings hang hangman hangman hangmen hangmen hangs hang hannibal hannib hap hap hapless hapless haply hapli happ happ happen happen happened happen happier happier happies happi happiest happiest happily happili happiness happi happy happi haps hap harbinger harbing harbingers harbing harbor harbor harbour harbour harbourage harbourag harbouring harbour harbours harbour harcourt harcourt hard hard harder harder hardest hardest hardiest hardiest hardiment hardiment hardiness hardi hardly hardli hardness hard hardocks hardock hardy hardi hare hare harelip harelip hares hare harfleur harfleur hark hark harlot harlot harlotry harlotri harlots harlot harm harm harmed harm harmful harm harming harm harmless harmless harmonious harmoni harmony harmoni harms harm harness har harp harp harper harper harpier harpier harping harp harpy harpi harried harri harrow harrow harrows harrow harry harri harsh harsh harshly harshli harshness harsh hart hart harts hart harum harum harvest harvest has ha hast hast haste hast hasted hast hasten hasten hastes hast hastily hastili hasting hast hastings hast hasty hasti hat hat hatch hatch hatches hatch hatchet hatchet hatching hatch hatchment hatchment hate hate hated hate hateful hate hater hater haters hater hates hate hateth hateth hatfield hatfield hath hath hating hate hatred hatr hats hat haud haud hauf hauf haught haught haughtiness haughti haughty haughti haunch haunch haunches haunch haunt haunt haunted haunt haunting haunt haunts haunt hautboy hautboi hautboys hautboi have have haven haven havens haven haver haver having have havings have havior havior haviour haviour havoc havoc hawk hawk hawking hawk hawks hawk hawthorn hawthorn hawthorns hawthorn hay hai hazard hazard hazarded hazard hazards hazard hazel hazel hazelnut hazelnut he he head head headborough headborough headed head headier headier heading head headland headland headless headless headlong headlong heads head headsman headsman headstrong headstrong heady headi heal heal healed heal healing heal heals heal health health healthful health healths health healthsome healthsom healthy healthi heap heap heaping heap heaps heap hear hear heard heard hearer hearer hearers hearer hearest hearest heareth heareth hearing hear hearings hear heark heark hearken hearken hearkens hearken hears hear hearsay hearsai hearse hears hearsed hears hearst hearst heart heart heartache heartach heartbreak heartbreak heartbreaking heartbreak hearted heart hearten hearten hearth hearth hearths hearth heartily heartili heartiness hearti heartless heartless heartlings heartl heartly heartli hearts heart heartsick heartsick heartstrings heartstr hearty hearti heat heat heated heat heath heath heathen heathen heathenish heathenish heating heat heats heat heauties heauti heav heav heave heav heaved heav heaven heaven heavenly heavenli heavens heaven heaves heav heavier heavier heaviest heaviest heavily heavili heaviness heavi heaving heav heavings heav heavy heavi hebona hebona hebrew hebrew hecate hecat hectic hectic hector hector hectors hector hecuba hecuba hedg hedg hedge hedg hedgehog hedgehog hedgehogs hedgehog hedges hedg heed heed heeded heed heedful heed heedfull heedful heedfully heedfulli heedless heedless heel heel heels heel hefted heft hefts heft heifer heifer heifers heifer heigh heigh height height heighten heighten heinous heinou heinously heinous heir heir heiress heiress heirless heirless heirs heir held held helen helen helena helena helenus helenu helias helia helicons helicon hell hell hellespont hellespont hellfire hellfir hellish hellish helm helm helmed helm helmet helmet helmets helmet helms helm help help helper helper helpers helper helpful help helping help helpless helpless helps help helter helter hem hem heme heme hemlock hemlock hemm hemm hemp hemp hempen hempen hems hem hen hen hence henc henceforth henceforth henceforward henceforward henchman henchman henri henri henricus henricu henry henri hens hen hent hent henton henton her her herald herald heraldry heraldri heralds herald herb herb herbert herbert herblets herblet herbs herb herculean herculean hercules hercul herd herd herds herd herdsman herdsman herdsmen herdsmen here here hereabout hereabout hereabouts hereabout hereafter hereaft hereby herebi hereditary hereditari hereford hereford herefordshire herefordshir herein herein hereof hereof heresies heresi heresy heresi heretic heret heretics heret hereto hereto hereupon hereupon heritage heritag heritier heriti hermes herm hermia hermia hermione hermion hermit hermit hermitage hermitag hermits hermit herne hern hero hero herod herod herods herod heroes hero heroic heroic heroical heroic herring her herrings her hers her herself herself hesperides hesperid hesperus hesperu hest hest hests hest heure heur heureux heureux hew hew hewgh hewgh hewing hew hewn hewn hews hew hey hei heyday heydai hibocrates hibocr hic hic hiccups hiccup hick hick hid hid hidden hidden hide hide hideous hideou hideously hideous hideousness hideous hides hide hidest hidest hiding hide hie hie hied hi hiems hiem hies hi hig hig high high higher higher highest highest highly highli highmost highmost highness high hight hight highway highwai highways highwai hilding hild hildings hild hill hill hillo hillo hilloa hilloa hills hill hilt hilt hilts hilt hily hili him him himself himself hinc hinc hinckley hincklei hind hind hinder hinder hindered hinder hinders hinder hindmost hindmost hinds hind hing hing hinge hing hinges hing hint hint hip hip hipp hipp hipparchus hipparchu hippolyta hippolyta hips hip hir hir hire hire hired hire hiren hiren hirtius hirtiu his hi hisperia hisperia hiss hiss hisses hiss hissing hiss hist hist historical histor history histori hit hit hither hither hitherto hitherto hitherward hitherward hitherwards hitherward hits hit hitting hit hive hive hives hive hizzing hizz ho ho hoa hoa hoar hoar hoard hoard hoarded hoard hoarding hoard hoars hoar hoarse hoars hoary hoari hob hob hobbididence hobbidid hobby hobbi hobbyhorse hobbyhors hobgoblin hobgoblin hobnails hobnail hoc hoc hod hod hodge hodg hog hog hogs hog hogshead hogshead hogsheads hogshead hois hoi hoise hois hoist hoist hoisted hoist hoists hoist holborn holborn hold hold holden holden holder holder holdeth holdeth holdfast holdfast holding hold holds hold hole hole holes hole holidam holidam holidame holidam holiday holidai holidays holidai holier holier holiest holiest holily holili holiness holi holla holla holland holland hollander holland hollanders holland holloa holloa holloaing holloa hollow hollow hollowly hollowli hollowness hollow holly holli holmedon holmedon holofernes holofern holp holp holy holi homage homag homager homag home home homely home homes home homespuns homespun homeward homeward homewards homeward homicide homicid homicides homicid homily homili hominem hominem hommes homm homo homo honest honest honester honest honestest honestest honestly honestli honesty honesti honey honei honeycomb honeycomb honeying honei honeyless honeyless honeysuckle honeysuckl honeysuckles honeysuckl honi honi honneur honneur honor honor honorable honor honorably honor honorato honorato honorificabilitudinitatibus honorificabilitudinitatibu honors honor honour honour honourable honour honourably honour honoured honour honourest honourest honourible honour honouring honour honours honour hoo hoo hood hood hooded hood hoodman hoodman hoods hood hoodwink hoodwink hoof hoof hoofs hoof hook hook hooking hook hooks hook hoop hoop hoops hoop hoot hoot hooted hoot hooting hoot hoots hoot hop hop hope hope hopeful hope hopeless hopeless hopes hope hopest hopest hoping hope hopkins hopkin hoppedance hopped hor hor horace horac horatio horatio horizon horizon horn horn hornbook hornbook horned horn horner horner horning horn hornpipes hornpip horns horn horologe horolog horrible horribl horribly horribl horrid horrid horrider horrid horridly horridli horror horror horrors horror hors hor horse hors horseback horseback horsed hors horsehairs horsehair horseman horseman horsemanship horsemanship horsemen horsemen horses hors horseway horsewai horsing hors hortensio hortensio hortensius hortensiu horum horum hose hose hospitable hospit hospital hospit hospitality hospit host host hostage hostag hostages hostag hostess hostess hostile hostil hostility hostil hostilius hostiliu hosts host hot hot hotly hotli hotspur hotspur hotter hotter hottest hottest hound hound hounds hound hour hour hourly hourli hours hour hous hou house hous household household householder household householders household households household housekeeper housekeep housekeepers housekeep housekeeping housekeep houseless houseless houses hous housewife housewif housewifery housewiferi housewives housew hovel hovel hover hover hovered hover hovering hover hovers hover how how howbeit howbeit howe how howeer howeer however howev howl howl howled howl howlet howlet howling howl howls howl howsoe howso howsoever howsoev howsome howsom hoxes hox hoy hoi hoyday hoydai hubert hubert huddled huddl huddling huddl hue hue hued hu hues hue hug hug huge huge hugely huge hugeness huge hugg hugg hugger hugger hugh hugh hugs hug hujus huju hulk hulk hulks hulk hull hull hulling hull hullo hullo hum hum human human humane human humanely human humanity human humble humbl humbled humbl humbleness humbl humbler humbler humbles humbl humblest humblest humbling humbl humbly humbl hume hume humh humh humidity humid humility humil humming hum humor humor humorous humor humors humor humour humour humourists humourist humours humour humphrey humphrei humphry humphri hums hum hundred hundr hundreds hundr hundredth hundredth hung hung hungarian hungarian hungary hungari hunger hunger hungerford hungerford hungerly hungerli hungry hungri hunt hunt hunted hunt hunter hunter hunters hunter hunteth hunteth hunting hunt huntington huntington huntress huntress hunts hunt huntsman huntsman huntsmen huntsmen hurdle hurdl hurl hurl hurling hurl hurls hurl hurly hurli hurlyburly hurlyburli hurricano hurricano hurricanoes hurricano hurried hurri hurries hurri hurry hurri hurt hurt hurting hurt hurtled hurtl hurtless hurtless hurtling hurtl hurts hurt husband husband husbanded husband husbandless husbandless husbandry husbandri husbands husband hush hush hushes hush husht husht husks husk huswife huswif huswifes huswif hutch hutch hybla hybla hydra hydra hyen hyen hymen hymen hymenaeus hymenaeu hymn hymn hymns hymn hyperboles hyperbol hyperbolical hyperbol hyperion hyperion hypocrisy hypocrisi hypocrite hypocrit hypocrites hypocrit hyrcan hyrcan hyrcania hyrcania hyrcanian hyrcanian hyssop hyssop hysterica hysterica i i iachimo iachimo iaculis iaculi iago iago iament iament ibat ibat icarus icaru ice ic iceland iceland ici ici icicle icicl icicles icicl icy ici idea idea ideas idea idem idem iden iden ides id idiot idiot idiots idiot idle idl idleness idl idles idl idly idli idol idol idolatrous idolatr idolatry idolatri ield ield if if ifs if ignis igni ignoble ignobl ignobly ignobl ignominious ignomini ignominy ignomini ignomy ignomi ignorance ignor ignorant ignor ii ii iii iii iiii iiii il il ilbow ilbow ild ild ilion ilion ilium ilium ill ill illegitimate illegitim illiterate illiter illness ill illo illo ills ill illume illum illumin illumin illuminate illumin illumineth illumineth illusion illus illusions illus illustrate illustr illustrated illustr illustrious illustri illyria illyria illyrian illyrian ils il im im image imag imagery imageri images imag imagin imagin imaginary imaginari imagination imagin imaginations imagin imagine imagin imagining imagin imaginings imagin imbar imbar imbecility imbecil imbrue imbru imitari imitari imitate imit imitated imit imitation imit imitations imit immaculate immacul immanity imman immask immask immaterial immateri immediacy immediaci immediate immedi immediately immedi imminence immin imminent immin immoderate immoder immoderately immoder immodest immodest immoment immoment immortal immort immortaliz immortaliz immortally immort immur immur immured immur immures immur imogen imogen imp imp impaint impaint impair impair impairing impair impale impal impaled impal impanelled impanel impart impart imparted impart impartial imparti impartment impart imparts impart impasted impast impatience impati impatient impati impatiently impati impawn impawn impeach impeach impeached impeach impeachment impeach impeachments impeach impedes imped impediment impedi impediments impedi impenetrable impenetr imperator imper imperceiverant imperceiver imperfect imperfect imperfection imperfect imperfections imperfect imperfectly imperfectli imperial imperi imperious imperi imperiously imperi impertinency impertin impertinent impertin impeticos impetico impetuosity impetuos impetuous impetu impieties impieti impiety impieti impious impiou implacable implac implements implement implies impli implor implor implorators implor implore implor implored implor imploring implor impon impon import import importance import importancy import important import importantly importantli imported import importeth importeth importing import importless importless imports import importun importun importunacy importunaci importunate importun importune importun importunes importun importunity importun impos impo impose impos imposed impos imposition imposit impositions imposit impossibilities imposs impossibility imposs impossible imposs imposthume imposthum impostor impostor impostors impostor impotence impot impotent impot impounded impound impregnable impregn imprese impres impress impress impressed impress impressest impressest impression impress impressure impressur imprimendum imprimendum imprimis imprimi imprint imprint imprinted imprint imprison imprison imprisoned imprison imprisoning imprison imprisonment imprison improbable improb improper improp improve improv improvident improvid impudence impud impudency impud impudent impud impudently impud impudique impudiqu impugn impugn impugns impugn impure impur imputation imput impute imput in in inaccessible inaccess inaidable inaid inaudible inaud inauspicious inauspici incaged incag incantations incant incapable incap incardinate incardin incarnadine incarnadin incarnate incarn incarnation incarn incens incen incense incens incensed incens incensement incens incenses incens incensing incens incertain incertain incertainties incertainti incertainty incertainti incessant incess incessantly incessantli incest incest incestuous incestu inch inch incharitable incharit inches inch incidency incid incident incid incision incis incite incit incites incit incivil incivil incivility incivil inclin inclin inclinable inclin inclination inclin incline inclin inclined inclin inclines inclin inclining inclin inclips inclip include includ included includ includes includ inclusive inclus incomparable incompar incomprehensible incomprehens inconsiderate inconsider inconstancy inconst inconstant inconst incontinency incontin incontinent incontin incontinently incontin inconvenience inconveni inconveniences inconveni inconvenient inconveni incony inconi incorporate incorpor incorps incorp incorrect incorrect increas increa increase increas increases increas increaseth increaseth increasing increas incredible incred incredulous incredul incur incur incurable incur incurr incurr incurred incur incursions incurs ind ind inde ind indebted indebt indeed inde indent indent indented indent indenture indentur indentures indentur index index indexes index india india indian indian indict indict indicted indict indictment indict indies indi indifferency indiffer indifferent indiffer indifferently indiffer indigent indig indigest indigest indigested indigest indign indign indignation indign indignations indign indigne indign indignities indign indignity indign indirect indirect indirection indirect indirections indirect indirectly indirectli indiscreet indiscreet indiscretion indiscret indispos indispo indisposition indisposit indissoluble indissolubl indistinct indistinct indistinguish indistinguish indistinguishable indistinguish indited indit individable individ indrench indrench indu indu indubitate indubit induc induc induce induc induced induc inducement induc induction induct inductions induct indue indu indued indu indues indu indulgence indulg indulgences indulg indulgent indulg indurance indur industrious industri industriously industri industry industri inequality inequ inestimable inestim inevitable inevit inexecrable inexecr inexorable inexor inexplicable inexplic infallible infal infallibly infal infamonize infamon infamous infam infamy infami infancy infanc infant infant infants infant infect infect infected infect infecting infect infection infect infections infect infectious infecti infectiously infecti infects infect infer infer inference infer inferior inferior inferiors inferior infernal infern inferr inferr inferreth inferreth inferring infer infest infest infidel infidel infidels infidel infinite infinit infinitely infinit infinitive infinit infirm infirm infirmities infirm infirmity infirm infixed infix infixing infix inflam inflam inflame inflam inflaming inflam inflammation inflamm inflict inflict infliction inflict influence influenc influences influenc infold infold inform inform informal inform information inform informations inform informed inform informer inform informs inform infortunate infortun infring infr infringe infring infringed infring infus infu infuse infus infused infus infusing infus infusion infus ingener ingen ingenious ingeni ingeniously ingeni inglorious inglori ingots ingot ingraffed ingraf ingraft ingraft ingrate ingrat ingrated ingrat ingrateful ingrat ingratitude ingratitud ingratitudes ingratitud ingredient ingredi ingredients ingredi ingross ingross inhabit inhabit inhabitable inhabit inhabitants inhabit inhabited inhabit inhabits inhabit inhearse inhears inhearsed inhears inherent inher inherit inherit inheritance inherit inherited inherit inheriting inherit inheritor inheritor inheritors inheritor inheritrix inheritrix inherits inherit inhibited inhibit inhibition inhibit inhoop inhoop inhuman inhuman iniquities iniqu iniquity iniqu initiate initi injointed injoint injunction injunct injunctions injunct injur injur injure injur injurer injur injuries injuri injurious injuri injury injuri injustice injustic ink ink inkhorn inkhorn inkle inkl inkles inkl inkling inkl inky inki inlaid inlaid inland inland inlay inlai inly inli inmost inmost inn inn inner inner innkeeper innkeep innocence innoc innocency innoc innocent innoc innocents innoc innovation innov innovator innov inns inn innumerable innumer inoculate inocul inordinate inordin inprimis inprimi inquir inquir inquire inquir inquiry inquiri inquisition inquisit inquisitive inquisit inroads inroad insane insan insanie insani insatiate insati insconce insconc inscrib inscrib inscription inscript inscriptions inscript inscroll inscrol inscrutable inscrut insculp insculp insculpture insculptur insensible insens inseparable insepar inseparate insepar insert insert inserted insert inset inset inshell inshel inshipp inshipp inside insid insinewed insinew insinuate insinu insinuateth insinuateth insinuating insinu insinuation insinu insisted insist insisting insist insisture insistur insociable insoci insolence insol insolent insol insomuch insomuch inspir inspir inspiration inspir inspirations inspir inspire inspir inspired inspir install instal installed instal instalment instal instance instanc instances instanc instant instant instantly instantli instate instat instead instead insteeped insteep instigate instig instigated instig instigation instig instigations instig instigator instig instinct instinct instinctively instinct institute institut institutions institut instruct instruct instructed instruct instruction instruct instructions instruct instructs instruct instrument instrument instrumental instrument instruments instrument insubstantial insubstanti insufficience insuffici insufficiency insuffici insult insult insulted insult insulting insult insultment insult insults insult insupportable insupport insuppressive insuppress insurrection insurrect insurrections insurrect int int integer integ integritas integrita integrity integr intellect intellect intellects intellect intellectual intellectu intelligence intellig intelligencer intelligenc intelligencing intelligenc intelligent intellig intelligis intelligi intelligo intelligo intemperance intemper intemperate intemper intend intend intended intend intendeth intendeth intending intend intendment intend intends intend intenible inten intent intent intention intent intentively intent intents intent inter inter intercept intercept intercepted intercept intercepter intercept interception intercept intercepts intercept intercession intercess intercessors intercessor interchained interchain interchang interchang interchange interchang interchangeably interchang interchangement interchang interchanging interchang interdiction interdict interest interest interim interim interims interim interior interior interjections interject interjoin interjoin interlude interlud intermingle intermingl intermission intermiss intermissive intermiss intermit intermit intermix intermix intermixed intermix interpose interpos interposer interpos interposes interpos interpret interpret interpretation interpret interpreted interpret interpreter interpret interpreters interpret interprets interpret interr interr interred inter interrogatories interrogatori interrupt interrupt interrupted interrupt interrupter interrupt interruptest interruptest interruption interrupt interrupts interrupt intertissued intertissu intervallums intervallum interview interview intestate intest intestine intestin intil intil intimate intim intimation intim intitled intitl intituled intitul into into intolerable intoler intoxicates intox intreasured intreasur intreat intreat intrench intrench intrenchant intrench intricate intric intrinse intrins intrinsicate intrins intrude intrud intruder intrud intruding intrud intrusion intrus inundation inund inure inur inurn inurn invade invad invades invad invasion invas invasive invas invectively invect invectives invect inveigled inveigl invent invent invented invent invention invent inventions invent inventor inventor inventorially inventori inventoried inventori inventors inventor inventory inventori inverness inver invert invert invest invest invested invest investing invest investments invest inveterate inveter invincible invinc inviolable inviol invised invis invisible invis invitation invit invite invit invited invit invites invit inviting invit invitis inviti invocate invoc invocation invoc invoke invok invoked invok invulnerable invulner inward inward inwardly inwardli inwardness inward inwards inward ionia ionia ionian ionian ipse ips ipswich ipswich ira ira irae ira iras ira ire ir ireful ir ireland ireland iris iri irish irish irishman irishman irishmen irishmen irks irk irksome irksom iron iron irons iron irreconcil irreconcil irrecoverable irrecover irregular irregular irregulous irregul irreligious irreligi irremovable irremov irreparable irrepar irresolute irresolut irrevocable irrevoc is is isabel isabel isabella isabella isbel isbel isbels isbel iscariot iscariot ise is ish ish isidore isidor isis isi island island islander island islanders island islands island isle isl isles isl israel israel issu issu issue issu issued issu issueless issueless issues issu issuing issu ist ist ista ista it it italian italian italy itali itch itch itches itch itching itch item item items item iteration iter ithaca ithaca its it itself itself itshall itshal iv iv ivory ivori ivy ivi iwis iwi ix ix j j jacet jacet jack jack jackanapes jackanap jacks jack jacksauce jacksauc jackslave jackslav jacob jacob jade jade jaded jade jades jade jail jail jakes jake jamany jamani james jame jamy jami jane jane jangled jangl jangling jangl january januari janus janu japhet japhet jaquenetta jaquenetta jaques jaqu jar jar jarring jar jars jar jarteer jarteer jasons jason jaunce jaunc jauncing jaunc jaundice jaundic jaundies jaundi jaw jaw jawbone jawbon jaws jaw jay jai jays jai jc jc je je jealous jealou jealousies jealousi jealousy jealousi jeer jeer jeering jeer jelly jelli jenny jenni jeopardy jeopardi jephtha jephtha jephthah jephthah jerkin jerkin jerkins jerkin jerks jerk jeronimy jeronimi jerusalem jerusalem jeshu jeshu jesses jess jessica jessica jest jest jested jest jester jester jesters jester jesting jest jests jest jesu jesu jesus jesu jet jet jets jet jew jew jewel jewel jeweller jewel jewels jewel jewess jewess jewish jewish jewry jewri jews jew jezebel jezebel jig jig jigging jig jill jill jills jill jingling jingl joan joan job job jockey jockei jocund jocund jog jog jogging jog john john johns john join join joinder joinder joined join joiner joiner joineth joineth joins join joint joint jointed joint jointing joint jointly jointli jointress jointress joints joint jointure jointur jollity jolliti jolly jolli jolt jolt joltheads jolthead jordan jordan joseph joseph joshua joshua jot jot jour jour jourdain jourdain journal journal journey journei journeying journei journeyman journeyman journeymen journeymen journeys journei jove jove jovem jovem jovial jovial jowl jowl jowls jowl joy joi joyed joi joyful joy joyfully joyfulli joyless joyless joyous joyou joys joi juan juan jud jud judas juda judases judas jude jude judg judg judge judg judged judg judgement judgement judges judg judgest judgest judging judg judgment judgment judgments judgment judicious judici jug jug juggle juggl juggled juggl juggler juggler jugglers juggler juggling juggl jugs jug juice juic juiced juic jul jul jule jule julia julia juliet juliet julietta julietta julio julio julius juliu july juli jump jump jumpeth jumpeth jumping jump jumps jump june june junes june junior junior junius juniu junkets junket juno juno jupiter jupit jure jure jurement jurement jurisdiction jurisdict juror juror jurors juror jury juri jurymen jurymen just just justeius justeiu justest justest justice justic justicer justic justicers justic justices justic justification justif justified justifi justify justifi justle justl justled justl justles justl justling justl justly justli justness just justs just jutting jut jutty jutti juvenal juven kam kam kate kate kated kate kates kate katharine katharin katherina katherina katherine katherin kecksies kecksi keech keech keel keel keels keel keen keen keenness keen keep keep keepdown keepdown keeper keeper keepers keeper keepest keepest keeping keep keeps keep keiser keiser ken ken kendal kendal kennel kennel kent kent kentish kentish kentishman kentishman kentishmen kentishmen kept kept kerchief kerchief kerely kere kern kern kernal kernal kernel kernel kernels kernel kerns kern kersey kersei kettle kettl kettledrum kettledrum kettledrums kettledrum key kei keys kei kibe kibe kibes kibe kick kick kicked kick kickshaws kickshaw kickshawses kickshaws kicky kicki kid kid kidney kidnei kikely kike kildare kildar kill kill killed kill killer killer killeth killeth killing kill killingworth killingworth kills kill kiln kiln kimbolton kimbolton kin kin kind kind kinder kinder kindest kindest kindle kindl kindled kindl kindless kindless kindlier kindlier kindling kindl kindly kindli kindness kind kindnesses kind kindred kindr kindreds kindr kinds kind kine kine king king kingdom kingdom kingdoms kingdom kingly kingli kings king kinred kinr kins kin kinsman kinsman kinsmen kinsmen kinswoman kinswoman kirtle kirtl kirtles kirtl kiss kiss kissed kiss kisses kiss kissing kiss kitchen kitchen kitchens kitchen kite kite kites kite kitten kitten kj kj kl kl klll klll knack knack knacks knack knapp knapp knav knav knave knave knaveries knaveri knavery knaveri knaves knave knavish knavish knead knead kneaded knead kneading knead knee knee kneel kneel kneeling kneel kneels kneel knees knee knell knell knew knew knewest knewest knife knife knight knight knighted knight knighthood knighthood knighthoods knighthood knightly knightli knights knight knit knit knits knit knitters knitter knitteth knitteth knives knive knobs knob knock knock knocking knock knocks knock knog knog knoll knoll knot knot knots knot knotted knot knotty knotti know know knower knower knowest knowest knowing know knowingly knowingli knowings know knowledge knowledg known known knows know l l la la laban laban label label labell label labienus labienu labio labio labor labor laboring labor labors labor labour labour laboured labour labourer labour labourers labour labouring labour labours labour laboursome laboursom labras labra labyrinth labyrinth lac lac lace lace laced lace lacedaemon lacedaemon laces lace lacies laci lack lack lackbeard lackbeard lacked lack lackey lackei lackeying lackei lackeys lackei lacking lack lacks lack lad lad ladder ladder ladders ladder lade lade laden laden ladies ladi lading lade lads lad lady ladi ladybird ladybird ladyship ladyship ladyships ladyship laer laer laertes laert lafeu lafeu lag lag lagging lag laid laid lain lain laissez laissez lake lake lakes lake lakin lakin lam lam lamb lamb lambert lambert lambkin lambkin lambkins lambkin lambs lamb lame lame lamely lame lameness lame lament lament lamentable lament lamentably lament lamentation lament lamentations lament lamented lament lamenting lament lamentings lament laments lament lames lame laming lame lammas lamma lammastide lammastid lamound lamound lamp lamp lampass lampass lamps lamp lanc lanc lancaster lancast lance lanc lances lanc lanceth lanceth lanch lanch land land landed land landing land landless landless landlord landlord landmen landmen lands land lane lane lanes lane langage langag langley langlei langton langton language languag languageless languageless languages languag langues langu languish languish languished languish languishes languish languishing languish languishings languish languishment languish languor languor lank lank lantern lantern lanterns lantern lanthorn lanthorn lap lap lapis lapi lapland lapland lapp lapp laps lap lapse laps lapsed laps lapsing laps lapwing lapw laquais laquai larded lard larder larder larding lard lards lard large larg largely larg largeness larg larger larger largess largess largest largest lark lark larks lark larron larron lartius lartiu larum larum larums larum las la lascivious lascivi lash lash lass lass lasses lass last last lasted last lasting last lastly lastli lasts last latch latch latches latch late late lated late lately late later later latest latest lath lath latin latin latten latten latter latter lattice lattic laud laud laudable laudabl laudis laudi laugh laugh laughable laughabl laughed laugh laugher laugher laughest laughest laughing laugh laughs laugh laughter laughter launce launc launcelot launcelot launces launc launch launch laund laund laundress laundress laundry laundri laur laur laura laura laurel laurel laurels laurel laurence laurenc laus lau lavache lavach lave lave lavee lave lavender lavend lavina lavina lavinia lavinia lavish lavish lavishly lavishli lavolt lavolt lavoltas lavolta law law lawful law lawfully lawfulli lawless lawless lawlessly lawlessli lawn lawn lawns lawn lawrence lawrenc laws law lawyer lawyer lawyers lawyer lay lai layer layer layest layest laying lai lays lai lazar lazar lazars lazar lazarus lazaru lazy lazi lc lc ld ld ldst ldst le le lead lead leaden leaden leader leader leaders leader leadest leadest leading lead leads lead leaf leaf leagu leagu league leagu leagued leagu leaguer leaguer leagues leagu leah leah leak leak leaky leaki lean lean leander leander leaner leaner leaning lean leanness lean leans lean leap leap leaped leap leaping leap leaps leap leapt leapt lear lear learn learn learned learn learnedly learnedli learning learn learnings learn learns learn learnt learnt leas lea lease leas leases leas leash leash leasing leas least least leather leather leathern leathern leav leav leave leav leaven leaven leavening leaven leaver leaver leaves leav leaving leav leavy leavi lecher lecher lecherous lecher lechers lecher lechery lecheri lecon lecon lecture lectur lectures lectur led led leda leda leech leech leeches leech leek leek leeks leek leer leer leers leer lees lee leese lees leet leet leets leet left left leg leg legacies legaci legacy legaci legate legat legatine legatin lege lege legerity leger leges lege legg legg legion legion legions legion legitimate legitim legitimation legitim legs leg leicester leicest leicestershire leicestershir leiger leiger leigers leiger leisure leisur leisurely leisur leisures leisur leman leman lemon lemon lena lena lend lend lender lender lending lend lendings lend lends lend length length lengthen lengthen lengthens lengthen lengths length lenity leniti lennox lennox lent lent lenten lenten lentus lentu leo leo leon leon leonardo leonardo leonati leonati leonato leonato leonatus leonatu leontes leont leopard leopard leopards leopard leper leper leperous leper lepidus lepidu leprosy leprosi lequel lequel lers ler les le less less lessen lessen lessens lessen lesser lesser lesson lesson lessoned lesson lessons lesson lest lest lestrake lestrak let let lethargied lethargi lethargies lethargi lethargy lethargi lethe leth lets let lett lett letter letter letters letter letting let lettuce lettuc leur leur leve leve level level levell level levelled level levels level leven leven levers lever leviathan leviathan leviathans leviathan levied levi levies levi levity leviti levy levi levying levi lewd lewd lewdly lewdli lewdness lewd lewdsters lewdster lewis lewi liable liabl liar liar liars liar libbard libbard libelling libel libels libel liberal liber liberality liber liberte libert liberties liberti libertine libertin libertines libertin liberty liberti library librari libya libya licence licenc licens licen license licens licentious licenti lichas licha licio licio lick lick licked lick licker licker lictors lictor lid lid lids lid lie lie lied li lief lief liefest liefest liege lieg liegeman liegeman liegemen liegemen lien lien lies li liest liest lieth lieth lieu lieu lieutenant lieuten lieutenantry lieutenantri lieutenants lieuten lieve liev life life lifeblood lifeblood lifeless lifeless lifelings lifel lift lift lifted lift lifter lifter lifteth lifteth lifting lift lifts lift lig lig ligarius ligariu liggens liggen light light lighted light lighten lighten lightens lighten lighter lighter lightest lightest lightly lightli lightness light lightning lightn lightnings lightn lights light lik lik like like liked like likeliest likeliest likelihood likelihood likelihoods likelihood likely like likeness like liker liker likes like likest likest likewise likewis liking like likings like lilies lili lily lili lim lim limander limand limb limb limbeck limbeck limbecks limbeck limber limber limbo limbo limbs limb lime lime limed lime limehouse limehous limekilns limekiln limit limit limitation limit limited limit limits limit limn limn limp limp limping limp limps limp lin lin lincoln lincoln lincolnshire lincolnshir line line lineal lineal lineally lineal lineament lineament lineaments lineament lined line linen linen linens linen lines line ling ling lingare lingar linger linger lingered linger lingers linger linguist linguist lining line link link links link linsey linsei linstock linstock linta linta lion lion lionel lionel lioness lioness lions lion lip lip lipp lipp lips lip lipsbury lipsburi liquid liquid liquor liquor liquorish liquorish liquors liquor lirra lirra lisbon lisbon lisp lisp lisping lisp list list listen listen listening listen lists list literatured literatur lither lither litter litter little littl littlest littlest liv liv live live lived live livelier liveli livelihood livelihood livelong livelong lively live liver liver liveries liveri livers liver livery liveri lives live livest livest liveth liveth livia livia living live livings live lizard lizard lizards lizard ll ll lll lll llous llou lnd lnd lo lo loa loa loach loach load load loaden loaden loading load loads load loaf loaf loam loam loan loan loath loath loathe loath loathed loath loather loather loathes loath loathing loath loathly loathli loathness loath loathsome loathsom loathsomeness loathsom loathsomest loathsomest loaves loav lob lob lobbies lobbi lobby lobbi local local lochaber lochab lock lock locked lock locking lock lockram lockram locks lock locusts locust lode lode lodg lodg lodge lodg lodged lodg lodgers lodger lodges lodg lodging lodg lodgings lodg lodovico lodovico lodowick lodowick lofty lofti log log logger logger loggerhead loggerhead loggerheads loggerhead loggets logget logic logic logs log loins loin loiter loiter loiterer loiter loiterers loiter loitering loiter lolling loll lolls loll lombardy lombardi london london londoners london lone lone loneliness loneli lonely lone long long longaville longavil longboat longboat longed long longer longer longest longest longeth longeth longing long longings long longly longli longs long longtail longtail loo loo loof loof look look looked look looker looker lookers looker lookest lookest looking look looks look loon loon loop loop loos loo loose loos loosed loos loosely loos loosen loosen loosing loos lop lop lopp lopp loquitur loquitur lord lord lorded lord lording lord lordings lord lordliness lordli lordly lordli lords lord lordship lordship lordships lordship lorenzo lorenzo lorn lorn lorraine lorrain lorship lorship los lo lose lose loser loser losers loser loses lose losest losest loseth loseth losing lose loss loss losses loss lost lost lot lot lots lot lott lott lottery lotteri loud loud louder louder loudly loudli lour lour loureth loureth louring lour louse lous louses lous lousy lousi lout lout louted lout louts lout louvre louvr lov lov love love loved love lovedst lovedst lovel lovel lovelier loveli loveliness loveli lovell lovel lovely love lover lover lovered lover lovers lover loves love lovest lovest loveth loveth loving love lovingly lovingli low low lowe low lower lower lowest lowest lowing low lowliness lowli lowly lowli lown lown lowness low loyal loyal loyally loyal loyalties loyalti loyalty loyalti lozel lozel lt lt lubber lubber lubberly lubberli luc luc luccicos luccico luce luce lucentio lucentio luces luce lucetta lucetta luciana luciana lucianus lucianu lucifer lucif lucifier lucifi lucilius luciliu lucina lucina lucio lucio lucius luciu luck luck luckier luckier luckiest luckiest luckily luckili luckless luckless lucky lucki lucre lucr lucrece lucrec lucretia lucretia lucullius luculliu lucullus lucullu lucy luci lud lud ludlow ludlow lug lug lugg lugg luggage luggag luke luke lukewarm lukewarm lull lull lulla lulla lullaby lullabi lulls lull lumbert lumbert lump lump lumpish lumpish luna luna lunacies lunaci lunacy lunaci lunatic lunat lunatics lunat lunes lune lungs lung lupercal luperc lurch lurch lure lure lurk lurk lurketh lurketh lurking lurk lurks lurk luscious lusciou lush lush lust lust lusted lust luster luster lustful lust lustier lustier lustiest lustiest lustig lustig lustihood lustihood lustily lustili lustre lustr lustrous lustrou lusts lust lusty lusti lute lute lutes lute lutestring lutestr lutheran lutheran luxurious luxuri luxuriously luxuri luxury luxuri ly ly lycaonia lycaonia lycurguses lycurgus lydia lydia lye lye lyen lyen lying ly lym lym lymoges lymog lynn lynn lysander lysand m m ma ma maan maan mab mab macbeth macbeth maccabaeus maccabaeu macdonwald macdonwald macduff macduff mace mace macedon macedon maces mace machiavel machiavel machination machin machinations machin machine machin mack mack macmorris macmorri maculate macul maculation macul mad mad madam madam madame madam madams madam madcap madcap madded mad madding mad made made madeira madeira madly madli madman madman madmen madmen madness mad madonna madonna madrigals madrig mads mad maecenas maecena maggot maggot maggots maggot magic magic magical magic magician magician magistrate magistr magistrates magistr magnanimity magnanim magnanimous magnanim magni magni magnifi magnifi magnificence magnific magnificent magnific magnifico magnifico magnificoes magnifico magnus magnu mahomet mahomet mahu mahu maid maid maiden maiden maidenhead maidenhead maidenheads maidenhead maidenhood maidenhood maidenhoods maidenhood maidenliest maidenliest maidenly maidenli maidens maiden maidhood maidhood maids maid mail mail mailed mail mails mail maim maim maimed maim maims maim main main maincourse maincours maine main mainly mainli mainmast mainmast mains main maintain maintain maintained maintain maintains maintain maintenance mainten mais mai maison maison majestas majesta majestee majeste majestic majest majestical majest majestically majest majesties majesti majesty majesti major major majority major mak mak make make makeless makeless maker maker makers maker makes make makest makest maketh maketh making make makings make mal mal mala mala maladies maladi malady maladi malapert malapert malcolm malcolm malcontent malcont malcontents malcont male male maledictions maledict malefactions malefact malefactor malefactor malefactors malefactor males male malevolence malevol malevolent malevol malhecho malhecho malice malic malicious malici maliciously malici malign malign malignancy malign malignant malign malignantly malignantli malkin malkin mall mall mallard mallard mallet mallet mallows mallow malmsey malmsei malt malt maltworms maltworm malvolio malvolio mamillius mamilliu mammering mammer mammet mammet mammets mammet mammock mammock man man manacle manacl manacles manacl manage manag managed manag manager manag managing manag manakin manakin manchus manchu mandate mandat mandragora mandragora mandrake mandrak mandrakes mandrak mane mane manent manent manes mane manet manet manfully manfulli mangle mangl mangled mangl mangles mangl mangling mangl mangy mangi manhood manhood manhoods manhood manifest manifest manifested manifest manifests manifest manifold manifold manifoldly manifoldli manka manka mankind mankind manlike manlik manly manli mann mann manna manna manner manner mannerly mannerli manners manner manningtree manningtre mannish mannish manor manor manors manor mans man mansion mansion mansionry mansionri mansions mansion manslaughter manslaught mantle mantl mantled mantl mantles mantl mantua mantua mantuan mantuan manual manual manure manur manured manur manus manu many mani map map mapp mapp maps map mar mar marble marbl marbled marbl marcade marcad marcellus marcellu march march marches march marcheth marcheth marching march marchioness marchio marchpane marchpan marcians marcian marcius marciu marcus marcu mardian mardian mare mare mares mare marg marg margarelon margarelon margaret margaret marge marg margent margent margery margeri maria maria marian marian mariana mariana maries mari marigold marigold mariner marin mariners marin maritime maritim marjoram marjoram mark mark marked mark market market marketable market marketplace marketplac markets market marking mark markman markman marks mark marl marl marle marl marmoset marmoset marquess marquess marquis marqui marr marr marriage marriag marriages marriag married marri marries marri marring mar marrow marrow marrowless marrowless marrows marrow marry marri marrying marri mars mar marseilles marseil marsh marsh marshal marshal marshalsea marshalsea marshalship marshalship mart mart marted mart martem martem martext martext martial martial martin martin martino martino martius martiu martlemas martlema martlet martlet marts mart martyr martyr martyrs martyr marullus marullu marv marv marvel marvel marvell marvel marvellous marvel marvellously marvel marvels marvel mary mari mas ma masculine masculin masham masham mask mask masked mask masker masker maskers masker masking mask masks mask mason mason masonry masonri masons mason masque masqu masquers masquer masques masqu masquing masqu mass mass massacre massacr massacres massacr masses mass massy massi mast mast mastcr mastcr master master masterdom masterdom masterest masterest masterless masterless masterly masterli masterpiece masterpiec masters master mastership mastership mastic mastic mastiff mastiff mastiffs mastiff masts mast match match matches match matcheth matcheth matching match matchless matchless mate mate mated mate mater mater material materi mates mate mathematics mathemat matin matin matron matron matrons matron matter matter matters matter matthew matthew mattock mattock mattress mattress mature matur maturity matur maud maud maudlin maudlin maugre maugr maul maul maund maund mauri mauri mauritania mauritania mauvais mauvai maw maw maws maw maxim maxim may mai mayday maydai mayest mayest mayor mayor maypole maypol mayst mayst maz maz maze maze mazed maze mazes maze mazzard mazzard me me meacock meacock mead mead meadow meadow meadows meadow meads mead meagre meagr meal meal meals meal mealy meali mean mean meanders meander meaner meaner meanest meanest meaneth meaneth meaning mean meanings mean meanly meanli means mean meant meant meantime meantim meanwhile meanwhil measles measl measur measur measurable measur measure measur measured measur measureless measureless measures measur measuring measur meat meat meats meat mechanic mechan mechanical mechan mechanicals mechan mechanics mechan mechante mechant med med medal medal meddle meddl meddler meddler meddling meddl mede mede medea medea media media mediation mediat mediators mediat medice medic medicinal medicin medicine medicin medicines medicin meditate medit meditates medit meditating medit meditation medit meditations medit mediterranean mediterranean mediterraneum mediterraneum medlar medlar medlars medlar meed meed meeds meed meek meek meekly meekli meekness meek meet meet meeter meeter meetest meetest meeting meet meetings meet meetly meetli meetness meet meets meet meg meg mehercle mehercl meilleur meilleur meiny meini meisen meisen melancholies melancholi melancholy melancholi melford melford mell mell mellifluous melliflu mellow mellow mellowing mellow melodious melodi melody melodi melt melt melted melt melteth melteth melting melt melts melt melun melun member member members member memento memento memorable memor memorandums memorandum memorial memori memorials memori memories memori memoriz memoriz memorize memor memory memori memphis memphi men men menac menac menace menac menaces menac menaphon menaphon menas mena mend mend mended mend mender mender mending mend mends mend menecrates menecr menelaus menelau menenius meneniu mental mental menteith menteith mention mention mentis menti menton menton mephostophilus mephostophilu mer mer mercatante mercatant mercatio mercatio mercenaries mercenari mercenary mercenari mercer mercer merchandise merchandis merchandized merchand merchant merchant merchants merchant mercies merci merciful merci mercifully mercifulli merciless merciless mercurial mercuri mercuries mercuri mercury mercuri mercutio mercutio mercy merci mere mere mered mere merely mere merest merest meridian meridian merit merit merited merit meritorious meritori merits merit merlin merlin mermaid mermaid mermaids mermaid merops merop merrier merrier merriest merriest merrily merrili merriman merriman merriment merriment merriments merriment merriness merri merry merri mervailous mervail mes me mesh mesh meshes mesh mesopotamia mesopotamia mess mess message messag messages messag messala messala messaline messalin messenger messeng messengers messeng messes mess messina messina met met metal metal metals metal metamorphis metamorphi metamorphoses metamorphos metaphor metaphor metaphysical metaphys metaphysics metaphys mete mete metellus metellu meteor meteor meteors meteor meteyard meteyard metheglin metheglin metheglins metheglin methink methink methinks methink method method methods method methought methought methoughts methought metre metr metres metr metropolis metropoli mette mett mettle mettl mettled mettl meus meu mew mew mewed mew mewling mewl mexico mexico mi mi mice mice michael michael michaelmas michaelma micher micher miching mich mickle mickl microcosm microcosm mid mid midas mida middest middest middle middl middleham middleham midnight midnight midriff midriff midst midst midsummer midsumm midway midwai midwife midwif midwives midwiv mienne mienn might might mightful might mightier mightier mightiest mightiest mightily mightili mightiness mighti mightst mightst mighty mighti milan milan milch milch mild mild milder milder mildest mildest mildew mildew mildews mildew mildly mildli mildness mild mile mile miles mile milford milford militarist militarist military militari milk milk milking milk milkmaid milkmaid milks milk milksops milksop milky milki mill mill mille mill miller miller milliner millin million million millioned million millions million mills mill millstones millston milo milo mimic mimic minc minc mince minc minces minc mincing minc mind mind minded mind minding mind mindless mindless minds mind mine mine mineral miner minerals miner minerva minerva mines mine mingle mingl mingled mingl mingling mingl minikin minikin minim minim minime minim minimo minimo minimus minimu mining mine minion minion minions minion minist minist minister minist ministers minist ministration ministr minnow minnow minnows minnow minola minola minority minor minos mino minotaurs minotaur minstrel minstrel minstrels minstrel minstrelsy minstrelsi mint mint mints mint minute minut minutely minut minutes minut minx minx mio mio mir mir mirable mirabl miracle miracl miracles miracl miraculous miracul miranda miranda mire mire mirror mirror mirrors mirror mirth mirth mirthful mirth miry miri mis mi misadventur misadventur misadventure misadventur misanthropos misanthropo misapplied misappli misbecame misbecam misbecom misbecom misbecome misbecom misbegot misbegot misbegotten misbegotten misbeliever misbeliev misbelieving misbeliev misbhav misbhav miscall miscal miscalled miscal miscarried miscarri miscarries miscarri miscarry miscarri miscarrying miscarri mischance mischanc mischances mischanc mischief mischief mischiefs mischief mischievous mischiev misconceived misconceiv misconst misconst misconster misconst misconstruction misconstruct misconstrued misconstru misconstrues misconstru miscreant miscreant miscreate miscreat misdeed misde misdeeds misde misdemean misdemean misdemeanours misdemeanour misdoubt misdoubt misdoubteth misdoubteth misdoubts misdoubt misenum misenum miser miser miserable miser miserably miser misericorde misericord miseries miseri misers miser misery miseri misfortune misfortun misfortunes misfortun misgive misgiv misgives misgiv misgiving misgiv misgoverned misgovern misgovernment misgovern misgraffed misgraf misguide misguid mishap mishap mishaps mishap misheard misheard misinterpret misinterpret mislead mislead misleader mislead misleaders mislead misleading mislead misled misl mislike mislik misord misord misplac misplac misplaced misplac misplaces misplac mispris mispri misprised mispris misprision mispris misprizing mispriz misproud misproud misquote misquot misreport misreport miss miss missed miss misses miss misshap misshap misshapen misshapen missheathed missheath missing miss missingly missingli missions mission missive missiv missives missiv misspoke misspok mist mist mista mista mistak mistak mistake mistak mistaken mistaken mistakes mistak mistaketh mistaketh mistaking mistak mistakings mistak mistemp mistemp mistempered mistemp misterm misterm mistful mist misthink misthink misthought misthought mistletoe mistleto mistook mistook mistreadings mistread mistress mistress mistresses mistress mistresss mistresss mistriship mistriship mistrust mistrust mistrusted mistrust mistrustful mistrust mistrusting mistrust mists mist misty misti misus misu misuse misus misused misus misuses misus mites mite mithridates mithrid mitigate mitig mitigation mitig mix mix mixed mix mixture mixtur mixtures mixtur mm mm mnd mnd moan moan moans moan moat moat moated moat mobled mobl mock mock mockable mockabl mocker mocker mockeries mockeri mockers mocker mockery mockeri mocking mock mocks mock mockvater mockvat mockwater mockwat model model modena modena moderate moder moderately moder moderation moder modern modern modest modest modesties modesti modestly modestli modesty modesti modicums modicum modo modo module modul moe moe moi moi moiety moieti moist moist moisten moisten moisture moistur moldwarp moldwarp mole mole molehill molehil moles mole molest molest molestation molest mollification mollif mollis molli molten molten molto molto mome mome moment moment momentary momentari moming mome mon mon monachum monachum monarch monarch monarchies monarchi monarchize monarch monarcho monarcho monarchs monarch monarchy monarchi monast monast monastery monasteri monastic monast monday mondai monde mond money monei moneys monei mong mong monger monger mongers monger monging mong mongrel mongrel mongrels mongrel mongst mongst monk monk monkey monkei monkeys monkei monks monk monmouth monmouth monopoly monopoli mons mon monsieur monsieur monsieurs monsieur monster monster monsters monster monstrous monstrou monstrously monstrous monstrousness monstrous monstruosity monstruos montacute montacut montage montag montague montagu montagues montagu montano montano montant montant montez montez montferrat montferrat montgomery montgomeri month month monthly monthli months month montjoy montjoi monument monument monumental monument monuments monument mood mood moods mood moody moodi moon moon moonbeams moonbeam moonish moonish moonlight moonlight moons moon moonshine moonshin moonshines moonshin moor moor moorfields moorfield moors moor moorship moorship mop mop mope mope moping mope mopping mop mopsa mopsa moral moral moraler moral morality moral moralize moral mordake mordak more more moreover moreov mores more morgan morgan mori mori morisco morisco morn morn morning morn mornings morn morocco morocco morris morri morrow morrow morrows morrow morsel morsel morsels morsel mort mort mortal mortal mortality mortal mortally mortal mortals mortal mortar mortar mortgaged mortgag mortified mortifi mortifying mortifi mortimer mortim mortimers mortim mortis morti mortise mortis morton morton mose mose moss moss mossgrown mossgrown most most mote mote moth moth mother mother mothers mother moths moth motion motion motionless motionless motions motion motive motiv motives motiv motley motlei mots mot mought mought mould mould moulded mould mouldeth mouldeth moulds mould mouldy mouldi moult moult moulten moulten mounch mounch mounseur mounseur mounsieur mounsieur mount mount mountain mountain mountaineer mountain mountaineers mountain mountainous mountain mountains mountain mountant mountant mountanto mountanto mountebank mountebank mountebanks mountebank mounted mount mounteth mounteth mounting mount mounts mount mourn mourn mourned mourn mourner mourner mourners mourner mournful mourn mournfully mournfulli mourning mourn mourningly mourningli mournings mourn mourns mourn mous mou mouse mous mousetrap mousetrap mousing mous mouth mouth mouthed mouth mouths mouth mov mov movables movabl move move moveable moveabl moveables moveabl moved move mover mover movers mover moves move moveth moveth moving move movingly movingli movousus movousu mow mow mowbray mowbrai mower mower mowing mow mows mow moy moi moys moi moyses moys mrs mr much much muck muck mud mud mudded mud muddied muddi muddy muddi muffins muffin muffl muffl muffle muffl muffled muffl muffler muffler muffling muffl mugger mugger mugs mug mulberries mulberri mulberry mulberri mule mule mules mule muleteers mulet mulier mulier mulieres mulier muliteus muliteu mull mull mulmutius mulmutiu multiplied multipli multiply multipli multiplying multipli multipotent multipot multitude multitud multitudes multitud multitudinous multitudin mum mum mumble mumbl mumbling mumbl mummers mummer mummy mummi mun mun munch munch muniments muniment munition munit murd murd murder murder murdered murder murderer murder murderers murder murdering murder murderous murder murders murder mure mure murk murk murkiest murkiest murky murki murmur murmur murmurers murmur murmuring murmur murrain murrain murray murrai murrion murrion murther murther murtherer murther murtherers murther murthering murther murtherous murther murthers murther mus mu muscadel muscadel muscovites muscovit muscovits muscovit muscovy muscovi muse muse muses muse mush mush mushrooms mushroom music music musical music musician musician musicians musician musics music musing muse musings muse musk musk musket musket muskets musket muskos musko muss muss mussel mussel mussels mussel must must mustachio mustachio mustard mustard mustardseed mustardse muster muster mustering muster musters muster musty musti mutability mutabl mutable mutabl mutation mutat mutations mutat mute mute mutes mute mutest mutest mutine mutin mutineer mutin mutineers mutin mutines mutin mutinies mutini mutinous mutin mutiny mutini mutius mutiu mutter mutter muttered mutter mutton mutton muttons mutton mutual mutual mutualities mutual mutually mutual muzzl muzzl muzzle muzzl muzzled muzzl mv mv mww mww my my mynheers mynheer myrmidon myrmidon myrmidons myrmidon myrtle myrtl myself myself myst myst mysteries mysteri mystery mysteri n n nag nag nage nage nags nag naiads naiad nail nail nails nail nak nak naked nake nakedness naked nal nal nam nam name name named name nameless nameless namely name names name namest namest naming name nan nan nance nanc nap nap nape nape napes nape napkin napkin napkins napkin naples napl napless napless napping nap naps nap narbon narbon narcissus narcissu narines narin narrow narrow narrowly narrowli naso naso nasty nasti nathaniel nathaniel natifs natif nation nation nations nation native nativ nativity nativ natur natur natural natur naturalize natur naturally natur nature natur natured natur natures natur natus natu naught naught naughtily naughtili naughty naughti navarre navarr nave nave navel navel navigation navig navy navi nay nai nayward nayward nayword nayword nazarite nazarit ne ne neaf neaf neamnoins neamnoin neanmoins neanmoin neapolitan neapolitan neapolitans neapolitan near near nearer nearer nearest nearest nearly nearli nearness near neat neat neatly neatli neb neb nebour nebour nebuchadnezzar nebuchadnezzar nec nec necessaries necessari necessarily necessarili necessary necessari necessitied necess necessities necess necessity necess neck neck necklace necklac necks neck nectar nectar ned ned nedar nedar need need needed need needer needer needful need needfull needful needing need needle needl needles needl needless needless needly needli needs need needy needi neer neer neeze neez nefas nefa negation negat negative neg negatives neg neglect neglect neglected neglect neglecting neglect neglectingly neglectingli neglection neglect negligence neglig negligent neglig negotiate negoti negotiations negoti negro negro neigh neigh neighbors neighbor neighbour neighbour neighbourhood neighbourhood neighbouring neighbour neighbourly neighbourli neighbours neighbour neighing neigh neighs neigh neither neither nell nell nemean nemean nemesis nemesi neoptolemus neoptolemu nephew nephew nephews nephew neptune neptun ner ner nereides nereid nerissa nerissa nero nero neroes nero ners ner nerve nerv nerves nerv nervii nervii nervy nervi nessus nessu nest nest nestor nestor nests nest net net nether nether netherlands netherland nets net nettle nettl nettled nettl nettles nettl neuter neuter neutral neutral nev nev never never nevil nevil nevils nevil new new newborn newborn newer newer newest newest newgate newgat newly newli newness new news new newsmongers newsmong newt newt newts newt next next nibbling nibbl nicanor nicanor nice nice nicely nice niceness nice nicer nicer nicety niceti nicholas nichola nick nick nickname nicknam nicks nick niece niec nieces niec niggard niggard niggarding niggard niggardly niggardli nigh nigh night night nightcap nightcap nightcaps nightcap nighted night nightgown nightgown nightingale nightingal nightingales nightingal nightly nightli nightmare nightmar nights night nightwork nightwork nihil nihil nile nile nill nill nilus nilu nimble nimbl nimbleness nimbl nimbler nimbler nimbly nimbl nine nine nineteen nineteen ning ning ningly ningli ninny ninni ninth ninth ninus ninu niobe niob niobes niob nip nip nipp nipp nipping nip nipple nippl nips nip nit nit nly nly nnight nnight nnights nnight no no noah noah nob nob nobility nobil nobis nobi noble nobl nobleman nobleman noblemen noblemen nobleness nobl nobler nobler nobles nobl noblesse nobless noblest noblest nobly nobli nobody nobodi noces noce nod nod nodded nod nodding nod noddle noddl noddles noddl noddy noddi nods nod noes noe nointed noint nois noi noise nois noiseless noiseless noisemaker noisemak noises nois noisome noisom nole nole nominate nomin nominated nomin nomination nomin nominativo nominativo non non nonage nonag nonce nonc none none nonino nonino nonny nonni nonpareil nonpareil nonsuits nonsuit nony noni nook nook nooks nook noon noon noonday noondai noontide noontid nor nor norbery norberi norfolk norfolk norman norman normandy normandi normans norman north north northampton northampton northamptonshire northamptonshir northerly northerli northern northern northgate northgat northumberland northumberland northumberlands northumberland northward northward norway norwai norways norwai norwegian norwegian norweyan norweyan nos no nose nose nosegays nosegai noseless noseless noses nose noster noster nostra nostra nostril nostril nostrils nostril not not notable notabl notably notabl notary notari notch notch note note notebook notebook noted note notedly notedli notes note notest notest noteworthy noteworthi nothing noth nothings noth notice notic notify notifi noting note notion notion notorious notori notoriously notori notre notr notwithstanding notwithstand nought nought noun noun nouns noun nourish nourish nourished nourish nourisher nourish nourishes nourish nourisheth nourisheth nourishing nourish nourishment nourish nous nou novel novel novelties novelti novelty novelti noverbs noverb novi novi novice novic novices novic novum novum now now nowhere nowher noyance noyanc ns ns nt nt nubibus nubibu numa numa numb numb number number numbered number numbering number numberless numberless numbers number numbness numb nun nun nuncio nuncio nuncle nuncl nunnery nunneri nuns nun nuntius nuntiu nuptial nuptial nurs nur nurse nurs nursed nurs nurser nurser nursery nurseri nurses nurs nurseth nurseth nursh nursh nursing nurs nurtur nurtur nurture nurtur nut nut nuthook nuthook nutmeg nutmeg nutmegs nutmeg nutriment nutriment nuts nut nutshell nutshel ny ny nym nym nymph nymph nymphs nymph o o oak oak oaken oaken oaks oak oared oar oars oar oatcake oatcak oaten oaten oath oath oathable oathabl oaths oath oats oat ob ob obduracy obduraci obdurate obdur obedience obedi obedient obedi obeisance obeis oberon oberon obey obei obeyed obei obeying obei obeys obei obidicut obidicut object object objected object objections object objects object oblation oblat oblations oblat obligation oblig obligations oblig obliged oblig oblique obliqu oblivion oblivion oblivious oblivi obloquy obloqui obscene obscen obscenely obscen obscur obscur obscure obscur obscured obscur obscurely obscur obscures obscur obscuring obscur obscurity obscur obsequies obsequi obsequious obsequi obsequiously obsequi observ observ observance observ observances observ observancy observ observant observ observants observ observation observ observe observ observed observ observer observ observers observ observing observ observingly observingli obsque obsqu obstacle obstacl obstacles obstacl obstinacy obstinaci obstinate obstin obstinately obstin obstruct obstruct obstruction obstruct obstructions obstruct obtain obtain obtained obtain obtaining obtain occasion occas occasions occas occident occid occidental occident occulted occult occupat occupat occupation occup occupations occup occupied occupi occupies occupi occupy occupi occurrence occurr occurrences occurr occurrents occurr ocean ocean oceans ocean octavia octavia octavius octaviu ocular ocular od od odd odd oddest oddest oddly oddli odds odd ode od odes od odious odiou odoriferous odorifer odorous odor odour odour odours odour ods od oeillades oeillad oes oe oeuvres oeuvr of of ofephesus ofephesu off off offal offal offence offenc offenceful offenc offences offenc offend offend offended offend offendendo offendendo offender offend offenders offend offendeth offendeth offending offend offendress offendress offends offend offense offens offenseless offenseless offenses offens offensive offens offer offer offered offer offering offer offerings offer offers offer offert offert offic offic office offic officed offic officer offic officers offic offices offic official offici officious offici offspring offspr oft oft often often oftener often oftentimes oftentim oh oh oil oil oils oil oily oili old old oldcastle oldcastl olden olden older older oldest oldest oldness old olive oliv oliver oliv olivers oliv olives oliv olivia olivia olympian olympian olympus olympu oman oman omans oman omen omen ominous omin omission omiss omit omit omittance omitt omitted omit omitting omit omne omn omnes omn omnipotent omnipot on on once onc one on ones on oneyers oney ongles ongl onion onion onions onion only onli onset onset onward onward onwards onward oo oo ooze ooz oozes ooz oozy oozi op op opal opal ope op open open opener open opening open openly openli openness open opens open operant oper operate oper operation oper operations oper operative oper opes op oph oph ophelia ophelia opinion opinion opinions opinion opportune opportun opportunities opportun opportunity opportun oppos oppo oppose oppos opposed oppos opposeless opposeless opposer oppos opposers oppos opposes oppos opposing oppos opposite opposit opposites opposit opposition opposit oppositions opposit oppress oppress oppressed oppress oppresses oppress oppresseth oppresseth oppressing oppress oppression oppress oppressor oppressor opprest opprest opprobriously opprobri oppugnancy oppugn opulency opul opulent opul or or oracle oracl oracles oracl orange orang oration orat orator orat orators orat oratory oratori orb orb orbed orb orbs orb orchard orchard orchards orchard ord ord ordain ordain ordained ordain ordaining ordain order order ordered order ordering order orderless orderless orderly orderli orders order ordinance ordin ordinant ordin ordinaries ordinari ordinary ordinari ordnance ordnanc ords ord ordure ordur ore or organ organ organs organ orgillous orgil orient orient orifex orifex origin origin original origin orisons orison ork ork orlando orlando orld orld orleans orlean ornament ornament ornaments ornament orodes orod orphan orphan orphans orphan orpheus orpheu orsino orsino ort ort orthography orthographi orts ort oscorbidulchos oscorbidulcho osier osier osiers osier osprey osprei osr osr osric osric ossa ossa ost ost ostent ostent ostentare ostentar ostentation ostent ostents ostent ostler ostler ostlers ostler ostrich ostrich osw osw oswald oswald othello othello other other othergates otherg others other otherwhere otherwher otherwhiles otherwhil otherwise otherwis otter otter ottoman ottoman ottomites ottomit oublie oubli ouches ouch ought ought oui oui ounce ounc ounces ounc ouphes ouph our our ours our ourself ourself ourselves ourselv ousel ousel out out outbids outbid outbrave outbrav outbraves outbrav outbreak outbreak outcast outcast outcries outcri outcry outcri outdar outdar outdare outdar outdares outdar outdone outdon outfac outfac outface outfac outfaced outfac outfacing outfac outfly outfli outfrown outfrown outgo outgo outgoes outgo outgrown outgrown outjest outjest outlaw outlaw outlawry outlawri outlaws outlaw outliv outliv outlive outliv outlives outliv outliving outliv outlook outlook outlustres outlustr outpriz outpriz outrage outrag outrageous outrag outrages outrag outran outran outright outright outroar outroar outrun outrun outrunning outrun outruns outrun outscold outscold outscorn outscorn outsell outsel outsells outsel outside outsid outsides outsid outspeaks outspeak outsport outsport outstare outstar outstay outstai outstood outstood outstretch outstretch outstretched outstretch outstrike outstrik outstrip outstrip outstripped outstrip outswear outswear outvenoms outvenom outward outward outwardly outwardli outwards outward outwear outwear outweighs outweigh outwent outwent outworn outworn outworths outworth oven oven over over overawe overaw overbear overbear overblown overblown overboard overboard overbold overbold overborne overborn overbulk overbulk overbuys overbui overcame overcam overcast overcast overcharg overcharg overcharged overcharg overcome overcom overcomes overcom overdone overdon overearnest overearnest overfar overfar overflow overflow overflown overflown overglance overgl overgo overgo overgone overgon overgorg overgorg overgrown overgrown overhead overhead overhear overhear overheard overheard overhold overhold overjoyed overjoi overkind overkind overland overland overleather overleath overlive overl overlook overlook overlooking overlook overlooks overlook overmaster overmast overmounting overmount overmuch overmuch overpass overpass overpeer overp overpeering overp overplus overplu overrul overrul overrun overrun overscutch overscutch overset overset overshades overshad overshine overshin overshines overshin overshot overshot oversights oversight overspread overspread overstain overstain overswear overswear overt overt overta overta overtake overtak overtaketh overtaketh overthrow overthrow overthrown overthrown overthrows overthrow overtook overtook overtopp overtopp overture overtur overturn overturn overwatch overwatch overween overween overweening overween overweigh overweigh overwhelm overwhelm overwhelming overwhelm overworn overworn ovid ovid ovidius ovidiu ow ow owe ow owed ow owedst owedst owen owen owes ow owest owest oweth oweth owing ow owl owl owls owl own own owner owner owners owner owning own owns own owy owi ox ox oxen oxen oxford oxford oxfordshire oxfordshir oxlips oxlip oyes oy oyster oyster p p pabble pabbl pabylon pabylon pac pac pace pace paced pace paces pace pacified pacifi pacify pacifi pacing pace pack pack packet packet packets packet packhorses packhors packing pack packings pack packs pack packthread packthread pacorus pacoru paction paction pad pad paddle paddl paddling paddl paddock paddock padua padua pagan pagan pagans pagan page page pageant pageant pageants pageant pages page pah pah paid paid pail pail pailfuls pail pails pail pain pain pained pain painful pain painfully painfulli pains pain paint paint painted paint painter painter painting paint paintings paint paints paint pair pair paired pair pairs pair pajock pajock pal pal palabras palabra palace palac palaces palac palamedes palamed palate palat palates palat palatine palatin palating palat pale pale paled pale paleness pale paler paler pales pale palestine palestin palfrey palfrei palfreys palfrei palisadoes palisado pall pall pallabris pallabri pallas palla pallets pallet palm palm palmer palmer palmers palmer palms palm palmy palmi palpable palpabl palsied palsi palsies palsi palsy palsi palt palt palter palter paltry paltri paly pali pamp pamp pamper pamper pamphlets pamphlet pan pan pancackes pancack pancake pancak pancakes pancak pandar pandar pandars pandar pandarus pandaru pander pander panderly panderli panders pander pandulph pandulph panel panel pang pang panging pang pangs pang pannier pannier pannonians pannonian pansa pansa pansies pansi pant pant pantaloon pantaloon panted pant pantheon pantheon panther panther panthino panthino panting pant pantingly pantingli pantler pantler pantry pantri pants pant pap pap papal papal paper paper papers paper paphlagonia paphlagonia paphos papho papist papist paps pap par par parable parabl paracelsus paracelsu paradise paradis paradox paradox paradoxes paradox paragon paragon paragons paragon parallel parallel parallels parallel paramour paramour paramours paramour parapets parapet paraquito paraquito parasite parasit parasites parasit parca parca parcel parcel parcell parcel parcels parcel parch parch parched parch parching parch parchment parchment pard pard pardon pardon pardona pardona pardoned pardon pardoner pardon pardoning pardon pardonne pardonn pardonner pardonn pardonnez pardonnez pardons pardon pare pare pared pare parel parel parent parent parentage parentag parents parent parfect parfect paring pare parings pare paris pari parish parish parishioners parishion parisians parisian paritors paritor park park parks park parle parl parler parler parles parl parley parlei parlez parlez parliament parliament parlors parlor parlour parlour parlous parlou parmacity parmac parolles parol parricide parricid parricides parricid parrot parrot parrots parrot parsley parslei parson parson part part partake partak partaken partaken partaker partak partakers partak parted part parthia parthia parthian parthian parthians parthian parti parti partial partial partialize partial partially partial participate particip participation particip particle particl particular particular particularities particular particularize particular particularly particularli particulars particular parties parti parting part partisan partisan partisans partisan partition partit partizan partizan partlet partlet partly partli partner partner partners partner partridge partridg parts part party parti pas pa pash pash pashed pash pashful pash pass pass passable passabl passado passado passage passag passages passag passant passant passed pass passenger passeng passengers passeng passes pass passeth passeth passing pass passio passio passion passion passionate passion passioning passion passions passion passive passiv passport passport passy passi past past paste past pasterns pastern pasties pasti pastime pastim pastimes pastim pastoral pastor pastorals pastor pastors pastor pastry pastri pasture pastur pastures pastur pasty pasti pat pat patay patai patch patch patchery patcheri patches patch pate pate pated pate patent patent patents patent paternal patern pates pate path path pathetical pathet paths path pathway pathwai pathways pathwai patience patienc patient patient patiently patient patients patient patines patin patrician patrician patricians patrician patrick patrick patrimony patrimoni patroclus patroclu patron patron patronage patronag patroness patro patrons patron patrum patrum patter patter pattern pattern patterns pattern pattle pattl pauca pauca paucas pauca paul paul paulina paulina paunch paunch paunches paunch pause paus pauser pauser pauses paus pausingly pausingli pauvres pauvr pav pav paved pave pavement pavement pavilion pavilion pavilions pavilion pavin pavin paw paw pawn pawn pawns pawn paws paw pax pax pay pai payest payest paying pai payment payment payments payment pays pai paysan paysan paysans paysan pe pe peace peac peaceable peaceabl peaceably peaceabl peaceful peac peacemakers peacemak peaces peac peach peach peaches peach peacock peacock peacocks peacock peak peak peaking peak peal peal peals peal pear pear peard peard pearl pearl pearls pearl pears pear peas pea peasant peasant peasantry peasantri peasants peasant peascod peascod pease peas peaseblossom peaseblossom peat peat peaten peaten peating peat pebble pebbl pebbled pebbl pebbles pebbl peck peck pecks peck peculiar peculiar pecus pecu pedant pedant pedantical pedant pedascule pedascul pede pede pedestal pedest pedigree pedigre pedlar pedlar pedlars pedlar pedro pedro peds ped peel peel peep peep peeped peep peeping peep peeps peep peer peer peereth peereth peering peer peerless peerless peers peer peesel peesel peevish peevish peevishly peevishli peflur peflur peg peg pegasus pegasu pegs peg peise peis peised peis peize peiz pelf pelf pelican pelican pelion pelion pell pell pella pella pelleted pellet peloponnesus peloponnesu pelt pelt pelting pelt pembroke pembrok pen pen penalties penalti penalty penalti penance penanc pence penc pencil pencil pencill pencil pencils pencil pendant pendant pendent pendent pendragon pendragon pendulous pendul penelope penelop penetrable penetr penetrate penetr penetrative penetr penitence penit penitent penit penitential penitenti penitently penit penitents penit penker penker penknife penknif penn penn penned pen penning pen pennons pennon penny penni pennyworth pennyworth pennyworths pennyworth pens pen pense pens pension pension pensioners pension pensive pensiv pensived pensiv pensively pensiv pent pent pentecost pentecost penthesilea penthesilea penthouse penthous penurious penuri penury penuri peopl peopl people peopl peopled peopl peoples peopl pepin pepin pepper pepper peppercorn peppercorn peppered pepper per per peradventure peradventur peradventures peradventur perceiv perceiv perceive perceiv perceived perceiv perceives perceiv perceiveth perceiveth perch perch perchance perchanc percies perci percussion percuss percy perci perdie perdi perdita perdita perdition perdit perdonato perdonato perdu perdu perdurable perdur perdurably perdur perdy perdi pere pere peregrinate peregrin peremptorily peremptorili peremptory peremptori perfect perfect perfected perfect perfecter perfect perfectest perfectest perfection perfect perfections perfect perfectly perfectli perfectness perfect perfidious perfidi perfidiously perfidi perforce perforc perform perform performance perform performances perform performed perform performer perform performers perform performing perform performs perform perfum perfum perfume perfum perfumed perfum perfumer perfum perfumes perfum perge perg perhaps perhap periapts periapt perigort perigort perigouna perigouna peril peril perilous peril perils peril period period periods period perish perish perished perish perishest perishest perisheth perisheth perishing perish periwig periwig perjur perjur perjure perjur perjured perjur perjuries perjuri perjury perjuri perk perk perkes perk permafoy permafoi permanent perman permission permiss permissive permiss permit permit permitted permit pernicious pernici perniciously pernici peroration peror perpend perpend perpendicular perpendicular perpendicularly perpendicularli perpetual perpetu perpetually perpetu perpetuity perpetu perplex perplex perplexed perplex perplexity perplex pers per persecuted persecut persecutions persecut persecutor persecutor perseus perseu persever persev perseverance persever persevers persev persia persia persian persian persist persist persisted persist persistency persist persistive persist persists persist person person personae persona personage personag personages personag personal person personally person personate person personated person personates person personating person persons person perspective perspect perspectively perspect perspectives perspect perspicuous perspicu persuade persuad persuaded persuad persuades persuad persuading persuad persuasion persuas persuasions persuas pert pert pertain pertain pertaining pertain pertains pertain pertaunt pertaunt pertinent pertin pertly pertli perturb perturb perturbation perturb perturbations perturb perturbed perturb perus peru perusal perus peruse perus perused perus perusing perus perverse pervers perversely pervers perverseness pervers pervert pervert perverted pervert peseech peseech pest pest pester pester pestiferous pestifer pestilence pestil pestilent pestil pet pet petar petar peter peter petit petit petition petit petitionary petitionari petitioner petition petitioners petition petitions petit peto peto petrarch petrarch petruchio petruchio petter petter petticoat petticoat petticoats petticoat pettiness petti pettish pettish pettitoes pettito petty petti peu peu pew pew pewter pewter pewterer pewter phaethon phaethon phaeton phaeton phantasime phantasim phantasimes phantasim phantasma phantasma pharamond pharamond pharaoh pharaoh pharsalia pharsalia pheasant pheasant pheazar pheazar phebe phebe phebes phebe pheebus pheebu pheeze pheez phibbus phibbu philadelphos philadelpho philario philario philarmonus philarmonu philemon philemon philip philip philippan philippan philippe philipp philippi philippi phillida phillida philo philo philomel philomel philomela philomela philosopher philosoph philosophers philosoph philosophical philosoph philosophy philosophi philostrate philostr philotus philotu phlegmatic phlegmat phoebe phoeb phoebus phoebu phoenicia phoenicia phoenicians phoenician phoenix phoenix phorbus phorbu photinus photinu phrase phrase phraseless phraseless phrases phrase phrygia phrygia phrygian phrygian phrynia phrynia physic physic physical physic physician physician physicians physician physics physic pia pia pibble pibbl pible pibl picardy picardi pick pick pickaxe pickax pickaxes pickax pickbone pickbon picked pick pickers picker picking pick pickle pickl picklock picklock pickpurse pickpurs picks pick pickt pickt pickthanks pickthank pictur pictur picture pictur pictured pictur pictures pictur pid pid pie pie piec piec piece piec pieces piec piecing piec pied pi piedness pied pier pier pierc pierc pierce pierc pierced pierc pierces pierc pierceth pierceth piercing pierc piercy pierci piers pier pies pi piety pieti pig pig pigeon pigeon pigeons pigeon pight pight pigmy pigmi pigrogromitus pigrogromitu pike pike pikes pike pil pil pilate pilat pilates pilat pilchers pilcher pile pile piles pile pilf pilf pilfering pilfer pilgrim pilgrim pilgrimage pilgrimag pilgrims pilgrim pill pill pillage pillag pillagers pillag pillar pillar pillars pillar pillicock pillicock pillory pillori pillow pillow pillows pillow pills pill pilot pilot pilots pilot pimpernell pimpernel pin pin pinch pinch pinched pinch pinches pinch pinching pinch pindarus pindaru pine pine pined pine pines pine pinfold pinfold pining pine pinion pinion pink pink pinn pinn pinnace pinnac pins pin pinse pins pint pint pintpot pintpot pioned pion pioneers pioneer pioner pioner pioners pioner pious piou pip pip pipe pipe piper piper pipers piper pipes pipe piping pipe pippin pippin pippins pippin pirate pirat pirates pirat pisa pisa pisanio pisanio pish pish pismires pismir piss piss pissing piss pistol pistol pistols pistol pit pit pitch pitch pitched pitch pitcher pitcher pitchers pitcher pitchy pitchi piteous piteou piteously piteous pitfall pitfal pith pith pithless pithless pithy pithi pitie piti pitied piti pities piti pitiful piti pitifully pitifulli pitiless pitiless pits pit pittance pittanc pittie pitti pittikins pittikin pity piti pitying piti pius piu plac plac place place placed place placentio placentio places place placeth placeth placid placid placing place plack plack placket placket plackets placket plagu plagu plague plagu plagued plagu plagues plagu plaguing plagu plaguy plagui plain plain plainer plainer plainest plainest plaining plain plainings plain plainly plainli plainness plain plains plain plainsong plainsong plaintful plaint plaintiff plaintiff plaintiffs plaintiff plaints plaint planched planch planet planet planetary planetari planets planet planks plank plant plant plantage plantag plantagenet plantagenet plantagenets plantagenet plantain plantain plantation plantat planted plant planteth planteth plants plant plash plash plashy plashi plast plast plaster plaster plasterer plaster plat plat plate plate plated plate plates plate platform platform platforms platform plats plat platted plat plausible plausibl plausive plausiv plautus plautu play plai played plai player player players player playeth playeth playfellow playfellow playfellows playfellow playhouse playhous playing plai plays plai plea plea pleach pleach pleached pleach plead plead pleaded plead pleader pleader pleaders pleader pleading plead pleads plead pleas plea pleasance pleasanc pleasant pleasant pleasantly pleasantli please pleas pleased pleas pleaser pleaser pleasers pleaser pleases pleas pleasest pleasest pleaseth pleaseth pleasing pleas pleasure pleasur pleasures pleasur plebeians plebeian plebeii plebeii plebs pleb pledge pledg pledges pledg pleines plein plenitude plenitud plenteous plenteou plenteously plenteous plenties plenti plentiful plenti plentifully plentifulli plenty plenti pless pless plessed pless plessing pless pliant pliant plied pli plies pli plight plight plighted plight plighter plighter plod plod plodded plod plodders plodder plodding plod plods plod plood plood ploody ploodi plot plot plots plot plotted plot plotter plotter plough plough ploughed plough ploughman ploughman ploughmen ploughmen plow plow plows plow pluck pluck plucked pluck plucker plucker plucking pluck plucks pluck plue plue plum plum plume plume plumed plume plumes plume plummet plummet plump plump plumpy plumpi plums plum plung plung plunge plung plunged plung plural plural plurisy plurisi plus plu pluto pluto plutus plutu ply ply po po pocket pocket pocketing pocket pockets pocket pocky pocki pody podi poem poem poesy poesi poet poet poetical poetic poetry poetri poets poet poictiers poictier poinards poinard poins poin point point pointblank pointblank pointed point pointing point points point pois poi poise pois poising pois poison poison poisoned poison poisoner poison poisoning poison poisonous poison poisons poison poke poke poking poke pol pol polack polack polacks polack poland poland pold pold pole pole poleaxe poleax polecat polecat polecats polecat polemon polemon poles pole poli poli policies polici policy polici polish polish polished polish politic polit politician politician politicians politician politicly politicli polixenes polixen poll poll polluted pollut pollution pollut polonius poloniu poltroons poltroon polusion polus polydamus polydamu polydore polydor polyxena polyxena pomander pomand pomegranate pomegran pomewater pomewat pomfret pomfret pomgarnet pomgarnet pommel pommel pomp pomp pompeius pompeiu pompey pompei pompion pompion pompous pompou pomps pomp pond pond ponder ponder ponderous ponder ponds pond poniard poniard poniards poniard pont pont pontic pontic pontifical pontif ponton ponton pooh pooh pool pool poole pool poop poop poor poor poorer poorer poorest poorest poorly poorli pop pop pope pope popedom popedom popilius popiliu popingay popingai popish popish popp popp poppy poppi pops pop popular popular popularity popular populous popul porch porch porches porch pore pore poring pore pork pork porn porn porpentine porpentin porridge porridg porringer porring port port portable portabl portage portag portal portal portance portanc portcullis portculli portend portend portends portend portent portent portentous portent portents portent porter porter porters porter portia portia portion portion portly portli portotartarossa portotartarossa portrait portrait portraiture portraitur ports port portugal portug pose pose posied posi posies posi position posit positive posit positively posit posse poss possess possess possessed possess possesses possess possesseth possesseth possessing possess possession possess possessions possess possessor possessor posset posset possets posset possibilities possibl possibility possibl possible possibl possibly possibl possitable possit post post poste post posted post posterior posterior posteriors posterior posterity poster postern postern posterns postern posters poster posthorse posthors posthorses posthors posthumus posthumu posting post postmaster postmast posts post postscript postscript posture postur postures postur posy posi pot pot potable potabl potations potat potato potato potatoes potato potch potch potency potenc potent potent potentates potent potential potenti potently potent potents potent pothecary pothecari pother pother potion potion potions potion potpan potpan pots pot potter potter potting pot pottle pottl pouch pouch poulter poulter poultice poultic poultney poultnei pouncet pouncet pound pound pounds pound pour pour pourest pourest pouring pour pourquoi pourquoi pours pour pout pout poverty poverti pow pow powd powd powder powder power power powerful power powerfully powerfulli powerless powerless powers power pox pox poys poi poysam poysam prabbles prabbl practic practic practice practic practiced practic practicer practic practices practic practicing practic practis practi practisants practis practise practis practiser practis practisers practis practises practis practising practis praeclarissimus praeclarissimu praemunire praemunir praetor praetor praetors praetor pragging prag prague pragu prain prain prains prain prais prai praise prais praised prais praises prais praisest praisest praiseworthy praiseworthi praising prais prancing pranc prank prank pranks prank prat prat prate prate prated prate prater prater prating prate prattle prattl prattler prattler prattling prattl prave prave prawls prawl prawns prawn pray prai prayer prayer prayers prayer praying prai prays prai pre pre preach preach preached preach preachers preacher preaches preach preaching preach preachment preachment pread pread preambulate preambul precedence preced precedent preced preceding preced precept precept preceptial precepti precepts precept precinct precinct precious preciou preciously precious precipice precipic precipitating precipit precipitation precipit precise precis precisely precis preciseness precis precisian precisian precor precor precurse precurs precursors precursor predeceased predeceas predecessor predecessor predecessors predecessor predestinate predestin predicament predica predict predict prediction predict predictions predict predominance predomin predominant predomin predominate predomin preeches preech preeminence preemin preface prefac prefer prefer preferment prefer preferments prefer preferr preferr preferreth preferreth preferring prefer prefers prefer prefiguring prefigur prefix prefix prefixed prefix preformed preform pregnancy pregnanc pregnant pregnant pregnantly pregnantli prejudicates prejud prejudice prejudic prejudicial prejudici prelate prelat premeditated premedit premeditation premedit premised premis premises premis prenez prenez prenominate prenomin prentice prentic prentices prentic preordinance preordin prepar prepar preparation prepar preparations prepar prepare prepar prepared prepar preparedly preparedli prepares prepar preparing prepar prepost prepost preposterous preposter preposterously preposter prerogatifes prerogatif prerogative prerog prerogatived prerogativ presage presag presagers presag presages presag presageth presageth presaging presag prescience prescienc prescribe prescrib prescript prescript prescription prescript prescriptions prescript prescripts prescript presence presenc presences presenc present present presentation present presented present presenter present presenters present presenteth presenteth presenting present presently present presentment present presents present preserv preserv preservation preserv preservative preserv preserve preserv preserved preserv preserver preserv preservers preserv preserving preserv president presid press press pressed press presser presser presses press pressing press pressure pressur pressures pressur prest prest prester prester presume presum presumes presum presuming presum presumption presumpt presumptuous presumptu presuppos presuppo pret pret pretence pretenc pretences pretenc pretend pretend pretended pretend pretending pretend pretense pretens pretext pretext pretia pretia prettier prettier prettiest prettiest prettily prettili prettiness pretti pretty pretti prevail prevail prevailed prevail prevaileth prevaileth prevailing prevail prevailment prevail prevails prevail prevent prevent prevented prevent prevention prevent preventions prevent prevents prevent prey prei preyful prey preys prei priam priam priami priami priamus priamu pribbles pribbl price price prick prick pricked prick pricket pricket pricking prick pricks prick pricksong pricksong pride pride prides pride pridge pridg prie prie pried pri prief prief pries pri priest priest priesthood priesthood priests priest prig prig primal primal prime prime primer primer primero primero primest primest primitive primit primo primo primogenity primogen primrose primros primroses primros primy primi prince princ princely princ princes princ princess princess principal princip principalities princip principality princip principle principl principles principl princox princox prings pring print print printed print printing print printless printless prints print prioress prioress priories priori priority prioriti priory priori priscian priscian prison prison prisoner prison prisoners prison prisonment prison prisonnier prisonni prisons prison pristine pristin prithe prith prithee prithe privacy privaci private privat privately privat privates privat privilage privilag privileg privileg privilege privileg privileged privileg privileges privileg privilegio privilegio privily privili privity priviti privy privi priz priz prize prize prized prize prizer prizer prizes prize prizest prizest prizing prize pro pro probable probabl probal probal probation probat proceed proce proceeded proceed proceeders proceed proceeding proceed proceedings proceed proceeds proce process process procession process proclaim proclaim proclaimed proclaim proclaimeth proclaimeth proclaims proclaim proclamation proclam proclamations proclam proconsul proconsul procrastinate procrastin procreant procreant procreants procreant procreation procreat procrus procru proculeius proculeiu procur procur procurator procur procure procur procured procur procures procur procuring procur prodigal prodig prodigality prodig prodigally prodig prodigals prodig prodigies prodigi prodigious prodigi prodigiously prodigi prodigy prodigi proditor proditor produc produc produce produc produced produc produces produc producing produc proface profac profan profan profanation profan profane profan profaned profan profanely profan profaneness profan profaners profan profaning profan profess profess professed profess professes profess profession profess professions profess professors professor proffer proffer proffered proffer profferer proffer proffers proffer proficient profici profit profit profitable profit profitably profit profited profit profiting profit profitless profitless profits profit profound profound profoundest profoundest profoundly profoundli progenitors progenitor progeny progeni progne progn prognosticate prognost prognostication prognost progress progress progression progress prohibit prohibit prohibition prohibit project project projection project projects project prolixious prolixi prolixity prolix prologue prologu prologues prologu prolong prolong prolongs prolong promethean promethean prometheus prometheu promis promi promise promis promised promis promises promis promiseth promiseth promising promis promontory promontori promotion promot promotions promot prompt prompt prompted prompt promptement promptement prompter prompter prompting prompt prompts prompt prompture promptur promulgate promulg prone prone prononcer prononc prononcez prononcez pronoun pronoun pronounc pronounc pronounce pronounc pronounced pronounc pronouncing pronounc pronouns pronoun proof proof proofs proof prop prop propagate propag propagation propag propend propend propension propens proper proper properer proper properly properli propertied properti properties properti property properti prophecies propheci prophecy propheci prophesied prophesi prophesier prophesi prophesy prophesi prophesying prophesi prophet prophet prophetess prophetess prophetic prophet prophetically prophet prophets prophet propinquity propinqu propontic propont proportion proport proportionable proportion proportions proport propos propo propose propos proposed propos proposer propos proposes propos proposing propos proposition proposit propositions proposit propounded propound propp propp propre propr propriety proprieti props prop propugnation propugn prorogue prorogu prorogued prorogu proscription proscript proscriptions proscript prose prose prosecute prosecut prosecution prosecut proselytes proselyt proserpina proserpina prosp prosp prospect prospect prosper prosper prosperity prosper prospero prospero prosperous prosper prosperously prosper prospers prosper prostitute prostitut prostrate prostrat protect protect protected protect protection protect protector protector protectors protector protectorship protectorship protectress protectress protects protect protest protest protestation protest protestations protest protested protest protester protest protesting protest protests protest proteus proteu protheus protheu protract protract protractive protract proud proud prouder prouder proudest proudest proudlier proudlier proudly proudli prouds proud prov prov provand provand prove prove proved prove provender provend proverb proverb proverbs proverb proves prove proveth proveth provide provid provided provid providence provid provident provid providently provid provider provid provides provid province provinc provinces provinc provincial provinci proving prove provision provis proviso proviso provocation provoc provok provok provoke provok provoked provok provoker provok provokes provok provoketh provoketh provoking provok provost provost prowess prowess prudence prudenc prudent prudent prun prun prune prune prunes prune pruning prune pry pry prying pry psalm psalm psalmist psalmist psalms psalm psalteries psalteri ptolemies ptolemi ptolemy ptolemi public public publican publican publication public publicly publicli publicola publicola publish publish published publish publisher publish publishing publish publius publiu pucelle pucel puck puck pudder pudder pudding pud puddings pud puddle puddl puddled puddl pudency pudenc pueritia pueritia puff puff puffing puf puffs puff pugging pug puis pui puissance puissanc puissant puissant puke puke puking puke pulcher pulcher puling pule pull pull puller puller pullet pullet pulling pull pulls pull pulpit pulpit pulpiter pulpit pulpits pulpit pulse puls pulsidge pulsidg pump pump pumpion pumpion pumps pump pun pun punched punch punish punish punished punish punishes punish punishment punish punishments punish punk punk punto punto puny puni pupil pupil pupils pupil puppet puppet puppets puppet puppies puppi puppy puppi pur pur purblind purblind purchas purcha purchase purchas purchased purchas purchases purchas purchaseth purchaseth purchasing purchas pure pure purely pure purer purer purest purest purg purg purgation purgat purgative purg purgatory purgatori purge purg purged purg purgers purger purging purg purifies purifi purifying purifi puritan puritan purity puriti purlieus purlieu purple purpl purpled purpl purples purpl purport purport purpos purpo purpose purpos purposed purpos purposely purpos purposes purpos purposeth purposeth purposing purpos purr purr purs pur purse purs pursents pursent purses purs pursu pursu pursue pursu pursued pursu pursuers pursuer pursues pursu pursuest pursuest pursueth pursueth pursuing pursu pursuit pursuit pursuivant pursuiv pursuivants pursuiv pursy pursi purus puru purveyor purveyor push push pushes push pusillanimity pusillanim put put putrefy putrefi putrified putrifi puts put putter putter putting put puttock puttock puzzel puzzel puzzle puzzl puzzled puzzl puzzles puzzl py py pygmalion pygmalion pygmies pygmi pygmy pygmi pyramid pyramid pyramides pyramid pyramids pyramid pyramis pyrami pyramises pyramis pyramus pyramu pyrenean pyrenean pyrrhus pyrrhu pythagoras pythagora qu qu quadrangle quadrangl quae quae quaff quaff quaffing quaf quagmire quagmir quail quail quailing quail quails quail quaint quaint quaintly quaintli quak quak quake quak quakes quak qualification qualif qualified qualifi qualifies qualifi qualify qualifi qualifying qualifi qualite qualit qualities qualiti quality qualiti qualm qualm qualmish qualmish quam quam quand quand quando quando quantities quantiti quantity quantiti quare quar quarrel quarrel quarrell quarrel quarreller quarrel quarrelling quarrel quarrelous quarrel quarrels quarrel quarrelsome quarrelsom quarries quarri quarry quarri quart quart quarter quarter quartered quarter quartering quarter quarters quarter quarts quart quasi quasi quat quat quatch quatch quay quai que que quean quean queas quea queasiness queasi queasy queasi queen queen queens queen quell quell queller queller quench quench quenched quench quenching quench quenchless quenchless quern quern quest quest questant questant question question questionable question questioned question questioning question questionless questionless questions question questrists questrist quests quest queubus queubu qui qui quick quick quicken quicken quickens quicken quicker quicker quicklier quicklier quickly quickli quickness quick quicksand quicksand quicksands quicksand quicksilverr quicksilverr quid quid quiddities quidditi quiddits quiddit quier quier quiet quiet quieter quieter quietly quietli quietness quiet quietus quietu quill quill quillets quillet quills quill quilt quilt quinapalus quinapalu quince quinc quinces quinc quintain quintain quintessence quintess quintus quintu quip quip quips quip quire quir quiring quir quirk quirk quirks quirk quis qui quit quit quite quit quits quit quittance quittanc quitted quit quitting quit quiver quiver quivering quiver quivers quiver quo quo quod quod quoifs quoif quoint quoint quoit quoit quoits quoit quondam quondam quoniam quoniam quote quot quoted quot quotes quot quoth quoth quotidian quotidian r r rabbit rabbit rabble rabbl rabblement rabblement race race rack rack rackers racker racket racket rackets racket racking rack racks rack radiance radianc radiant radiant radish radish rafe rafe raft raft rag rag rage rage rages rage rageth rageth ragg ragg ragged rag raggedness ragged raging rage ragozine ragozin rags rag rah rah rail rail railed rail railer railer railest railest raileth raileth railing rail rails rail raiment raiment rain rain rainbow rainbow raineth raineth raining rain rainold rainold rains rain rainy raini rais rai raise rais raised rais raises rais raising rais raisins raisin rak rak rake rake rakers raker rakes rake ral ral rald rald ralph ralph ram ram rambures rambur ramm ramm rampallian rampallian rampant rampant ramping ramp rampir rampir ramps ramp rams ram ramsey ramsei ramston ramston ran ran rance ranc rancorous rancor rancors rancor rancour rancour random random rang rang range rang ranged rang rangers ranger ranges rang ranging rang rank rank ranker ranker rankest rankest ranking rank rankle rankl rankly rankli rankness rank ranks rank ransack ransack ransacking ransack ransom ransom ransomed ransom ransoming ransom ransomless ransomless ransoms ransom rant rant ranting rant rap rap rape rape rapes rape rapier rapier rapiers rapier rapine rapin raps rap rapt rapt rapture raptur raptures raptur rar rar rare rare rarely rare rareness rare rarer rarer rarest rarest rarities rariti rarity rariti rascal rascal rascalliest rascalliest rascally rascal rascals rascal rased rase rash rash rasher rasher rashly rashli rashness rash rat rat ratcatcher ratcatch ratcliff ratcliff rate rate rated rate rately rate rates rate rather rather ratherest ratherest ratified ratifi ratifiers ratifi ratify ratifi rating rate rational ration ratolorum ratolorum rats rat ratsbane ratsban rattle rattl rattles rattl rattling rattl rature ratur raught raught rav rav rave rave ravel ravel raven raven ravening raven ravenous raven ravens raven ravenspurgh ravenspurgh raves rave ravin ravin raving rave ravish ravish ravished ravish ravisher ravish ravishing ravish ravishments ravish raw raw rawer rawer rawly rawli rawness raw ray rai rayed rai rays rai raz raz raze raze razed raze razes raze razeth razeth razing raze razor razor razorable razor razors razor razure razur re re reach reach reaches reach reacheth reacheth reaching reach read read reader reader readiest readiest readily readili readiness readi reading read readins readin reads read ready readi real real really realli realm realm realms realm reap reap reapers reaper reaping reap reaps reap rear rear rears rear rearward rearward reason reason reasonable reason reasonably reason reasoned reason reasoning reason reasonless reasonless reasons reason reave reav rebate rebat rebato rebato rebeck rebeck rebel rebel rebell rebel rebelling rebel rebellion rebellion rebellious rebelli rebels rebel rebound rebound rebuk rebuk rebuke rebuk rebukeable rebuk rebuked rebuk rebukes rebuk rebus rebu recall recal recant recant recantation recant recanter recant recanting recant receipt receipt receipts receipt receiv receiv receive receiv received receiv receiver receiv receives receiv receivest receivest receiveth receiveth receiving receiv receptacle receptacl rechate rechat reciprocal reciproc reciprocally reciproc recite recit recited recit reciterai reciterai reck reck recking reck reckless reckless reckon reckon reckoned reckon reckoning reckon reckonings reckon recks reck reclaim reclaim reclaims reclaim reclusive reclus recognizance recogniz recognizances recogniz recoil recoil recoiling recoil recollected recollect recomforted recomfort recomforture recomfortur recommend recommend recommended recommend recommends recommend recompens recompen recompense recompens reconcil reconcil reconcile reconcil reconciled reconcil reconcilement reconcil reconciler reconcil reconciles reconcil reconciliation reconcili record record recordation record recorded record recorder record recorders record records record recount recount recounted recount recounting recount recountments recount recounts recount recourse recours recov recov recover recov recoverable recover recovered recov recoveries recoveri recovers recov recovery recoveri recreant recreant recreants recreant recreate recreat recreation recreat rectify rectifi rector rector rectorship rectorship recure recur recured recur red red redbreast redbreast redder redder reddest reddest rede rede redeem redeem redeemed redeem redeemer redeem redeeming redeem redeems redeem redeliver redeliv redemption redempt redime redim redness red redoubled redoubl redoubted redoubt redound redound redress redress redressed redress redresses redress reduce reduc reechy reechi reed reed reeds reed reek reek reeking reek reeks reek reeky reeki reel reel reeleth reeleth reeling reel reels reel refell refel refer refer reference refer referr referr referred refer refigured refigur refin refin refined refin reflect reflect reflecting reflect reflection reflect reflex reflex reform reform reformation reform reformed reform refractory refractori refrain refrain refresh refresh refreshing refresh reft reft refts reft refuge refug refus refu refusal refus refuse refus refused refus refusest refusest refusing refus reg reg regal regal regalia regalia regan regan regard regard regardance regard regarded regard regardfully regardfulli regarding regard regards regard regenerate regener regent regent regentship regentship regia regia regiment regiment regiments regiment regina regina region region regions region regist regist register regist registers regist regreet regreet regreets regreet regress regress reguerdon reguerdon regular regular rehears rehear rehearsal rehears rehearse rehears reign reign reigned reign reignier reignier reigning reign reigns reign rein rein reinforc reinforc reinforce reinforc reinforcement reinforc reins rein reiterate reiter reject reject rejected reject rejoic rejoic rejoice rejoic rejoices rejoic rejoiceth rejoiceth rejoicing rejoic rejoicingly rejoicingli rejoindure rejoindur rejourn rejourn rel rel relapse relaps relate relat relates relat relation relat relations relat relative rel releas relea release releas released releas releasing releas relent relent relenting relent relents relent reliances relianc relics relic relief relief reliev reliev relieve reliev relieved reliev relieves reliev relieving reliev religion religion religions religion religious religi religiously religi relinquish relinquish reliques reliqu reliquit reliquit relish relish relume relum rely reli relying reli remain remain remainder remaind remainders remaind remained remain remaineth remaineth remaining remain remains remain remark remark remarkable remark remediate remedi remedied remedi remedies remedi remedy remedi rememb rememb remember rememb remembered rememb remembers rememb remembrance remembr remembrancer remembranc remembrances remembr remercimens remercimen remiss remiss remission remiss remissness remiss remit remit remnant remnant remnants remnant remonstrance remonstr remorse remors remorseful remors remorseless remorseless remote remot remotion remot remov remov remove remov removed remov removedness removed remover remov removes remov removing remov remunerate remuner remuneration remuner rence renc rend rend render render rendered render renders render rendezvous rendezv renegado renegado renege reneg reneges reneg renew renew renewed renew renewest renewest renounce renounc renouncement renounc renouncing renounc renowmed renowm renown renown renowned renown rent rent rents rent repaid repaid repair repair repaired repair repairing repair repairs repair repass repass repast repast repasture repastur repay repai repaying repai repays repai repeal repeal repealing repeal repeals repeal repeat repeat repeated repeat repeating repeat repeats repeat repel repel repent repent repentance repent repentant repent repented repent repenting repent repents repent repetition repetit repetitions repetit repin repin repine repin repining repin replant replant replenish replenish replenished replenish replete replet replication replic replied repli replies repli repliest repliest reply repli replying repli report report reported report reporter report reportest reportest reporting report reportingly reportingli reports report reposal repos repose repos reposeth reposeth reposing repos repossess repossess reprehend reprehend reprehended reprehend reprehending reprehend represent repres representing repres reprieve repriev reprieves repriev reprisal repris reproach reproach reproaches reproach reproachful reproach reproachfully reproachfulli reprobate reprob reprobation reprob reproof reproof reprov reprov reprove reprov reproveable reprov reproves reprov reproving reprov repugn repugn repugnancy repugn repugnant repugn repulse repuls repulsed repuls repurchas repurcha repured repur reputation reput repute reput reputed reput reputeless reputeless reputes reput reputing reput request request requested request requesting request requests request requiem requiem requir requir require requir required requir requires requir requireth requireth requiring requir requisite requisit requisites requisit requit requit requital requit requite requit requited requit requites requit rer rer rere rere rers rer rescu rescu rescue rescu rescued rescu rescues rescu rescuing rescu resemblance resembl resemble resembl resembled resembl resembles resembl resembleth resembleth resembling resembl reserv reserv reservation reserv reserve reserv reserved reserv reserves reserv reside resid residence resid resident resid resides resid residing resid residue residu resign resign resignation resign resist resist resistance resist resisted resist resisting resist resists resist resolute resolut resolutely resolut resolutes resolut resolution resolut resolv resolv resolve resolv resolved resolv resolvedly resolvedli resolves resolv resolveth resolveth resort resort resorted resort resounding resound resounds resound respeaking respeak respect respect respected respect respecting respect respective respect respectively respect respects respect respice respic respite respit respites respit responsive respons respose respos ress ress rest rest rested rest resteth resteth restful rest resting rest restitution restitut restless restless restor restor restoration restor restorative restor restore restor restored restor restores restor restoring restor restrain restrain restrained restrain restraining restrain restrains restrain restraint restraint rests rest resty resti resum resum resume resum resumes resum resurrections resurrect retail retail retails retail retain retain retainers retain retaining retain retell retel retention retent retentive retent retinue retinu retir retir retire retir retired retir retirement retir retires retir retiring retir retold retold retort retort retorts retort retourne retourn retract retract retreat retreat retrograde retrograd rets ret return return returned return returnest returnest returneth returneth returning return returns return revania revania reveal reveal reveals reveal revel revel reveler revel revell revel reveller revel revellers revel revelling revel revelry revelri revels revel reveng reveng revenge reveng revenged reveng revengeful reveng revengement reveng revenger reveng revengers reveng revenges reveng revenging reveng revengingly revengingli revenue revenu revenues revenu reverb reverb reverberate reverber reverbs reverb reverenc reverenc reverence rever reverend reverend reverent rever reverently rever revers rever reverse revers reversion revers reverted revert review review reviewest reviewest revil revil revile revil revisits revisit reviv reviv revive reviv revives reviv reviving reviv revok revok revoke revok revokement revok revolt revolt revolted revolt revolting revolt revolts revolt revolution revolut revolutions revolut revolve revolv revolving revolv reward reward rewarded reward rewarder reward rewarding reward rewards reward reword reword reworded reword rex rex rey rei reynaldo reynaldo rford rford rful rful rfull rfull rhapsody rhapsodi rheims rheim rhenish rhenish rhesus rhesu rhetoric rhetor rheum rheum rheumatic rheumat rheums rheum rheumy rheumi rhinoceros rhinocero rhodes rhode rhodope rhodop rhubarb rhubarb rhym rhym rhyme rhyme rhymers rhymer rhymes rhyme rhyming rhyme rialto rialto rib rib ribald ribald riband riband ribands riband ribaudred ribaudr ribb ribb ribbed rib ribbon ribbon ribbons ribbon ribs rib rice rice rich rich richard richard richer richer riches rich richest richest richly richli richmond richmond richmonds richmond rid rid riddance riddanc ridden ridden riddle riddl riddles riddl riddling riddl ride ride rider rider riders rider rides ride ridest ridest rideth rideth ridge ridg ridges ridg ridiculous ridicul riding ride rids rid rien rien ries ri rifle rifl rift rift rifted rift rig rig rigg rigg riggish riggish right right righteous righteou righteously righteous rightful right rightfully rightfulli rightly rightli rights right rigol rigol rigorous rigor rigorously rigor rigour rigour ril ril rim rim rin rin rinaldo rinaldo rind rind ring ring ringing ring ringleader ringlead ringlets ringlet rings ring ringwood ringwood riot riot rioter rioter rioting riot riotous riotou riots riot rip rip ripe ripe ripely ripe ripen ripen ripened ripen ripeness ripe ripening ripen ripens ripen riper riper ripest ripest riping ripe ripp ripp ripping rip rise rise risen risen rises rise riseth riseth rish rish rising rise rite rite rites rite rivage rivag rival rival rivality rival rivall rival rivals rival rive rive rived rive rivelled rivel river river rivers river rivet rivet riveted rivet rivets rivet rivo rivo rj rj rless rless road road roads road roam roam roaming roam roan roan roar roar roared roar roarers roarer roaring roar roars roar roast roast roasted roast rob rob roba roba robas roba robb robb robbed rob robber robber robbers robber robbery robberi robbing rob robe robe robed robe robert robert robes robe robin robin robs rob robustious robusti rochester rochest rochford rochford rock rock rocks rock rocky rocki rod rod rode rode roderigo roderigo rods rod roe roe roes roe roger roger rogero rogero rogue rogu roguery rogueri rogues rogu roguish roguish roi roi roisting roist roll roll rolled roll rolling roll rolls roll rom rom romage romag roman roman romano romano romanos romano romans roman rome rome romeo romeo romish romish rondure rondur ronyon ronyon rood rood roof roof roofs roof rook rook rooks rook rooky rooki room room rooms room root root rooted root rootedly rootedli rooteth rooteth rooting root roots root rope rope ropery roperi ropes rope roping rope ros ro rosalind rosalind rosalinda rosalinda rosalinde rosalind rosaline rosalin roscius rosciu rose rose rosed rose rosemary rosemari rosencrantz rosencrantz roses rose ross ross rosy rosi rot rot rote rote roted rote rother rother rotherham rotherham rots rot rotted rot rotten rotten rottenness rotten rotting rot rotundity rotund rouen rouen rough rough rougher rougher roughest roughest roughly roughli roughness rough round round rounded round roundel roundel rounder rounder roundest roundest rounding round roundly roundli rounds round roundure roundur rous rou rouse rous roused rous rousillon rousillon rously rousli roussi roussi rout rout routed rout routs rout rove rove rover rover row row rowel rowel rowland rowland rowlands rowland roy roi royal royal royalize royal royally royal royalties royalti royalty royalti roynish roynish rs rs rt rt rub rub rubb rubb rubbing rub rubbish rubbish rubies rubi rubious rubiou rubs rub ruby rubi rud rud rudand rudand rudder rudder ruddiness ruddi ruddock ruddock ruddy ruddi rude rude rudely rude rudeness rude ruder ruder rudesby rudesbi rudest rudest rudiments rudiment rue rue rued ru ruff ruff ruffian ruffian ruffians ruffian ruffle ruffl ruffling ruffl ruffs ruff rug rug rugby rugbi rugemount rugemount rugged rug ruin ruin ruinate ruinat ruined ruin ruining ruin ruinous ruinou ruins ruin rul rul rule rule ruled rule ruler ruler rulers ruler rules rule ruling rule rumble rumbl ruminaies ruminai ruminat ruminat ruminate rumin ruminated rumin ruminates rumin rumination rumin rumor rumor rumour rumour rumourer rumour rumours rumour rump rump run run runagate runag runagates runag runaway runawai runaways runawai rung rung runn runn runner runner runners runner running run runs run rupture ruptur ruptures ruptur rural rural rush rush rushes rush rushing rush rushling rushl rushy rushi russet russet russia russia russian russian russians russian rust rust rusted rust rustic rustic rustically rustic rustics rustic rustle rustl rustling rustl rusts rust rusty rusti rut rut ruth ruth ruthful ruth ruthless ruthless rutland rutland ruttish ruttish ry ry rye rye rything ryth s s sa sa saba saba sabbath sabbath sable sabl sables sabl sack sack sackbuts sackbut sackcloth sackcloth sacked sack sackerson sackerson sacks sack sacrament sacrament sacred sacr sacrific sacrif sacrifice sacrific sacrificers sacrific sacrifices sacrific sacrificial sacrifici sacrificing sacrif sacrilegious sacrilegi sacring sacr sad sad sadder sadder saddest saddest saddle saddl saddler saddler saddles saddl sadly sadli sadness sad saf saf safe safe safeguard safeguard safely safe safer safer safest safest safeties safeti safety safeti saffron saffron sag sag sage sage sagittary sagittari said said saidst saidst sail sail sailing sail sailmaker sailmak sailor sailor sailors sailor sails sail sain sain saint saint sainted saint saintlike saintlik saints saint saith saith sake sake sakes sake sala sala salad salad salamander salamand salary salari sale sale salerio salerio salicam salicam salique saliqu salisbury salisburi sall sall sallet sallet sallets sallet sallies salli sallow sallow sally salli salmon salmon salmons salmon salt salt salter salter saltiers saltier saltness salt saltpetre saltpetr salutation salut salutations salut salute salut saluted salut salutes salut saluteth saluteth salv salv salvation salvat salve salv salving salv same same samingo samingo samp samp sampire sampir sample sampl sampler sampler sampson sampson samson samson samsons samson sancta sancta sanctified sanctifi sanctifies sanctifi sanctify sanctifi sanctimonies sanctimoni sanctimonious sanctimoni sanctimony sanctimoni sanctities sanctiti sanctity sanctiti sanctuarize sanctuar sanctuary sanctuari sand sand sandal sandal sandbag sandbag sanded sand sands sand sandy sandi sandys sandi sang sang sanguine sanguin sanguis sangui sanity saniti sans san santrailles santrail sap sap sapient sapient sapit sapit sapless sapless sapling sapl sapphire sapphir sapphires sapphir saracens saracen sarcenet sarcenet sard sard sardians sardian sardinia sardinia sardis sardi sarum sarum sat sat satan satan satchel satchel sate sate sated sate satiate satiat satiety satieti satin satin satire satir satirical satir satis sati satisfaction satisfact satisfied satisfi satisfies satisfi satisfy satisfi satisfying satisfi saturday saturdai saturdays saturdai saturn saturn saturnine saturnin saturninus saturninu satyr satyr satyrs satyr sauc sauc sauce sauc sauced sauc saucers saucer sauces sauc saucily saucili sauciness sauci saucy sauci sauf sauf saunder saunder sav sav savage savag savagely savag savageness savag savagery savageri savages savag save save saved save saves save saving save saviour saviour savory savori savour savour savouring savour savours savour savoury savouri savoy savoi saw saw sawed saw sawest sawest sawn sawn sawpit sawpit saws saw sawyer sawyer saxons saxon saxony saxoni saxton saxton say sai sayest sayest saying sai sayings sai says sai sayst sayst sblood sblood sc sc scab scab scabbard scabbard scabs scab scaffold scaffold scaffoldage scaffoldag scal scal scald scald scalded scald scalding scald scale scale scaled scale scales scale scaling scale scall scall scalp scalp scalps scalp scaly scali scamble scambl scambling scambl scamels scamel scan scan scandal scandal scandaliz scandaliz scandalous scandal scandy scandi scann scann scant scant scanted scant scanter scanter scanting scant scantling scantl scants scant scap scap scape scape scaped scape scapes scape scapeth scapeth scar scar scarce scarc scarcely scarc scarcity scarciti scare scare scarecrow scarecrow scarecrows scarecrow scarf scarf scarfed scarf scarfs scarf scaring scare scarlet scarlet scarr scarr scarre scarr scars scar scarus scaru scath scath scathe scath scathful scath scatt scatt scatter scatter scattered scatter scattering scatter scatters scatter scelera scelera scelerisque scelerisqu scene scene scenes scene scent scent scented scent scept scept scepter scepter sceptre sceptr sceptred sceptr sceptres sceptr schedule schedul schedules schedul scholar scholar scholarly scholarli scholars scholar school school schoolboy schoolboi schoolboys schoolboi schoolfellows schoolfellow schooling school schoolmaster schoolmast schoolmasters schoolmast schools school sciatica sciatica sciaticas sciatica science scienc sciences scienc scimitar scimitar scion scion scions scion scissors scissor scoff scoff scoffer scoffer scoffing scof scoffs scoff scoggin scoggin scold scold scolding scold scolds scold sconce sconc scone scone scope scope scopes scope scorch scorch scorched scorch score score scored score scores score scoring score scorn scorn scorned scorn scornful scorn scornfully scornfulli scorning scorn scorns scorn scorpion scorpion scorpions scorpion scot scot scotch scotch scotches scotch scotland scotland scots scot scottish scottish scoundrels scoundrel scour scour scoured scour scourg scourg scourge scourg scouring scour scout scout scouts scout scowl scowl scrap scrap scrape scrape scraping scrape scraps scrap scratch scratch scratches scratch scratching scratch scream scream screams scream screech screech screeching screech screen screen screens screen screw screw screws screw scribbl scribbl scribbled scribbl scribe scribe scribes scribe scrimers scrimer scrip scrip scrippage scrippag scripture scriptur scriptures scriptur scrivener scriven scroll scroll scrolls scroll scroop scroop scrowl scrowl scroyles scroyl scrubbed scrub scruple scrupl scruples scrupl scrupulous scrupul scuffles scuffl scuffling scuffl scullion scullion sculls scull scum scum scurril scurril scurrility scurril scurrilous scurril scurvy scurvi scuse scuse scut scut scutcheon scutcheon scutcheons scutcheon scylla scylla scythe scyth scythed scyth scythia scythia scythian scythian sdeath sdeath se se sea sea seacoal seacoal seafaring seafar seal seal sealed seal sealing seal seals seal seam seam seamen seamen seamy seami seaport seaport sear sear searce searc search search searchers searcher searches search searcheth searcheth searching search seared sear seas sea seasick seasick seaside seasid season season seasoned season seasons season seat seat seated seat seats seat sebastian sebastian second second secondarily secondarili secondary secondari seconded second seconds second secrecy secreci secret secret secretaries secretari secretary secretari secretly secretli secrets secret sect sect sectary sectari sects sect secundo secundo secure secur securely secur securing secur security secur sedg sedg sedge sedg sedges sedg sedgy sedgi sedition sedit seditious sediti seduc seduc seduce seduc seduced seduc seducer seduc seducing seduc see see seed seed seeded seed seedness seed seeds seed seedsman seedsman seein seein seeing see seek seek seeking seek seeks seek seel seel seeling seel seely seeli seem seem seemed seem seemers seemer seemest seemest seemeth seemeth seeming seem seemingly seemingli seemly seemli seems seem seen seen seer seer sees see seese sees seest seest seethe seeth seethes seeth seething seeth seeting seet segregation segreg seigneur seigneur seigneurs seigneur seiz seiz seize seiz seized seiz seizes seiz seizeth seizeth seizing seiz seizure seizur seld seld seldom seldom select select seleucus seleucu self self selfsame selfsam sell sell seller seller selling sell sells sell selves selv semblable semblabl semblably semblabl semblance semblanc semblances semblanc semblative sembl semi semi semicircle semicircl semiramis semirami semper semper sempronius semproniu senate senat senator senat senators senat send send sender sender sendeth sendeth sending send sends send seneca seneca senior senior seniory seniori senis seni sennet sennet senoys senoi sense sens senseless senseless senses sens sensible sensibl sensibly sensibl sensual sensual sensuality sensual sent sent sentenc sentenc sentence sentenc sentences sentenc sententious sententi sentinel sentinel sentinels sentinel separable separ separate separ separated separ separates separ separation separ septentrion septentrion sepulchre sepulchr sepulchres sepulchr sepulchring sepulchr sequel sequel sequence sequenc sequent sequent sequest sequest sequester sequest sequestration sequestr sere sere serenis sereni serge serg sergeant sergeant serious seriou seriously serious sermon sermon sermons sermon serpent serpent serpentine serpentin serpents serpent serpigo serpigo serv serv servant servant servanted servant servants servant serve serv served serv server server serves serv serveth serveth service servic serviceable servic services servic servile servil servility servil servilius serviliu serving serv servingman servingman servingmen servingmen serviteur serviteur servitor servitor servitors servitor servitude servitud sessa sessa session session sessions session sestos sesto set set setebos setebo sets set setter setter setting set settle settl settled settl settlest settlest settling settl sev sev seven seven sevenfold sevenfold sevennight sevennight seventeen seventeen seventh seventh seventy seventi sever sever several sever severally sever severals sever severe sever severed sever severely sever severest severest severing sever severity sever severn severn severs sever sew sew seward seward sewer sewer sewing sew sex sex sexes sex sexton sexton sextus sextu seymour seymour seyton seyton sfoot sfoot sh sh shackle shackl shackles shackl shade shade shades shade shadow shadow shadowed shadow shadowing shadow shadows shadow shadowy shadowi shady shadi shafalus shafalu shaft shaft shafts shaft shag shag shak shak shake shake shaked shake shaken shaken shakes shake shaking shake shales shale shall shall shallenge shalleng shallow shallow shallowest shallowest shallowly shallowli shallows shallow shalt shalt sham sham shambles shambl shame shame shamed shame shameful shame shamefully shamefulli shameless shameless shames shame shamest shamest shaming shame shank shank shanks shank shap shap shape shape shaped shape shapeless shapeless shapen shapen shapes shape shaping shape shar shar shard shard sharded shard shards shard share share shared share sharers sharer shares share sharing share shark shark sharp sharp sharpen sharpen sharpened sharpen sharpens sharpen sharper sharper sharpest sharpest sharply sharpli sharpness sharp sharps sharp shatter shatter shav shav shave shave shaven shaven shaw shaw she she sheaf sheaf sheal sheal shear shear shearers shearer shearing shear shearman shearman shears shear sheath sheath sheathe sheath sheathed sheath sheathes sheath sheathing sheath sheaved sheav sheaves sheav shed shed shedding shed sheds shed sheen sheen sheep sheep sheepcote sheepcot sheepcotes sheepcot sheeps sheep sheepskins sheepskin sheer sheer sheet sheet sheeted sheet sheets sheet sheffield sheffield shelf shelf shell shell shells shell shelt shelt shelter shelter shelters shelter shelves shelv shelving shelv shelvy shelvi shent shent shepherd shepherd shepherdes shepherd shepherdess shepherdess shepherdesses shepherdess shepherds shepherd sher sher sheriff sheriff sherris sherri shes she sheweth sheweth shield shield shielded shield shields shield shift shift shifted shift shifting shift shifts shift shilling shill shillings shill shin shin shine shine shines shine shineth shineth shining shine shins shin shiny shini ship ship shipboard shipboard shipman shipman shipmaster shipmast shipmen shipmen shipp shipp shipped ship shipping ship ships ship shipt shipt shipwreck shipwreck shipwrecking shipwreck shipwright shipwright shipwrights shipwright shire shire shirley shirlei shirt shirt shirts shirt shive shive shiver shiver shivering shiver shivers shiver shoal shoal shoals shoal shock shock shocks shock shod shod shoe shoe shoeing shoe shoemaker shoemak shoes shoe shog shog shone shone shook shook shoon shoon shoot shoot shooter shooter shootie shooti shooting shoot shoots shoot shop shop shops shop shore shore shores shore shorn shorn short short shortcake shortcak shorten shorten shortened shorten shortens shorten shorter shorter shortly shortli shortness short shot shot shotten shotten shoughs shough should should shoulder shoulder shouldering shoulder shoulders shoulder shouldst shouldst shout shout shouted shout shouting shout shouts shout shov shov shove shove shovel shovel shovels shovel show show showed show shower shower showers shower showest showest showing show shown shown shows show shreds shred shrew shrew shrewd shrewd shrewdly shrewdli shrewdness shrewd shrewish shrewish shrewishly shrewishli shrewishness shrewish shrews shrew shrewsbury shrewsburi shriek shriek shrieking shriek shrieks shriek shrieve shriev shrift shrift shrill shrill shriller shriller shrills shrill shrilly shrilli shrimp shrimp shrine shrine shrink shrink shrinking shrink shrinks shrink shriv shriv shrive shrive shriver shriver shrives shrive shriving shrive shroud shroud shrouded shroud shrouding shroud shrouds shroud shrove shrove shrow shrow shrows shrow shrub shrub shrubs shrub shrug shrug shrugs shrug shrunk shrunk shudd shudd shudders shudder shuffl shuffl shuffle shuffl shuffled shuffl shuffling shuffl shun shun shunless shunless shunn shunn shunned shun shunning shun shuns shun shut shut shuts shut shuttle shuttl shy shy shylock shylock si si sibyl sibyl sibylla sibylla sibyls sibyl sicil sicil sicilia sicilia sicilian sicilian sicilius siciliu sicils sicil sicily sicili sicinius siciniu sick sick sicken sicken sickens sicken sicker sicker sickle sickl sicklemen sicklemen sicklied sickli sickliness sickli sickly sickli sickness sick sicles sicl sicyon sicyon side side sided side sides side siege sieg sieges sieg sienna sienna sies si sieve siev sift sift sifted sift sigeia sigeia sigh sigh sighed sigh sighing sigh sighs sigh sight sight sighted sight sightless sightless sightly sightli sights sight sign sign signal signal signet signet signieur signieur significant signific significants signific signified signifi signifies signifi signify signifi signifying signifi signior signior signiories signiori signiors signior signiory signiori signor signor signories signori signs sign signum signum silenc silenc silence silenc silenced silenc silencing silenc silent silent silently silent silius siliu silk silk silken silken silkman silkman silks silk silliest silliest silliness silli silling sill silly silli silva silva silver silver silvered silver silverly silverli silvia silvia silvius silviu sima sima simile simil similes simil simois simoi simon simon simony simoni simp simp simpcox simpcox simple simpl simpleness simpl simpler simpler simples simpl simplicity simplic simply simpli simular simular simulation simul sin sin since sinc sincere sincer sincerely sincer sincerity sincer sinel sinel sinew sinew sinewed sinew sinews sinew sinewy sinewi sinful sin sinfully sinfulli sing sing singe sing singeing sing singer singer singes sing singeth singeth singing sing single singl singled singl singleness singl singly singli sings sing singular singular singulariter singularit singularities singular singularity singular singuled singul sinister sinist sink sink sinking sink sinks sink sinn sinn sinner sinner sinners sinner sinning sin sinon sinon sins sin sip sip sipping sip sir sir sire sire siren siren sirrah sirrah sirs sir sist sist sister sister sisterhood sisterhood sisterly sisterli sisters sister sit sit sith sith sithence sithenc sits sit sitting sit situate situat situation situat situations situat siward siward six six sixpence sixpenc sixpences sixpenc sixpenny sixpenni sixteen sixteen sixth sixth sixty sixti siz siz size size sizes size sizzle sizzl skains skain skamble skambl skein skein skelter skelter skies ski skilful skil skilfully skilfulli skill skill skilless skilless skillet skillet skillful skill skills skill skim skim skimble skimbl skin skin skinker skinker skinny skinni skins skin skip skip skipp skipp skipper skipper skipping skip skirmish skirmish skirmishes skirmish skirr skirr skirted skirt skirts skirt skittish skittish skulking skulk skull skull skulls skull sky sky skyey skyei skyish skyish slab slab slack slack slackly slackli slackness slack slain slain slake slake sland sland slander slander slandered slander slanderer slander slanderers slander slandering slander slanderous slander slanders slander slash slash slaught slaught slaughter slaughter slaughtered slaughter slaughterer slaughter slaughterman slaughterman slaughtermen slaughtermen slaughterous slaughter slaughters slaughter slave slave slaver slaver slavery slaveri slaves slave slavish slavish slay slai slayeth slayeth slaying slai slays slai sleave sleav sledded sled sleek sleek sleekly sleekli sleep sleep sleeper sleeper sleepers sleeper sleepest sleepest sleeping sleep sleeps sleep sleepy sleepi sleeve sleev sleeves sleev sleid sleid sleided sleid sleight sleight sleights sleight slender slender slenderer slender slenderly slenderli slept slept slew slew slewest slewest slice slice slid slid slide slide slides slide sliding slide slight slight slighted slight slightest slightest slightly slightli slightness slight slights slight slily slili slime slime slimy slimi slings sling slink slink slip slip slipp slipp slipper slipper slippers slipper slippery slipperi slips slip slish slish slit slit sliver sliver slobb slobb slomber slomber slop slop slope slope slops slop sloth sloth slothful sloth slough slough slovenly slovenli slovenry slovenri slow slow slower slower slowly slowli slowness slow slubber slubber slug slug sluggard sluggard sluggardiz sluggardiz sluggish sluggish sluic sluic slumb slumb slumber slumber slumbers slumber slumbery slumberi slunk slunk slut slut sluts slut sluttery slutteri sluttish sluttish sluttishness sluttish sly sly slys sly smack smack smacking smack smacks smack small small smaller smaller smallest smallest smallness small smalus smalu smart smart smarting smart smartly smartli smatch smatch smatter smatter smear smear smell smell smelling smell smells smell smelt smelt smil smil smile smile smiled smile smiles smile smilest smilest smilets smilet smiling smile smilingly smilingli smirch smirch smirched smirch smit smit smite smite smites smite smith smith smithfield smithfield smock smock smocks smock smok smok smoke smoke smoked smoke smokes smoke smoking smoke smoky smoki smooth smooth smoothed smooth smoothing smooth smoothly smoothli smoothness smooth smooths smooth smote smote smoth smoth smother smother smothered smother smothering smother smug smug smulkin smulkin smutch smutch snaffle snaffl snail snail snails snail snake snake snakes snake snaky snaki snap snap snapp snapp snapper snapper snar snar snare snare snares snare snarl snarl snarleth snarleth snarling snarl snatch snatch snatchers snatcher snatches snatch snatching snatch sneak sneak sneaking sneak sneap sneap sneaping sneap sneck sneck snip snip snipe snipe snipt snipt snore snore snores snore snoring snore snorting snort snout snout snow snow snowballs snowbal snowed snow snowy snowi snuff snuff snuffs snuff snug snug so so soak soak soaking soak soaks soak soar soar soaring soar soars soar sob sob sobbing sob sober sober soberly soberli sobriety sobrieti sobs sob sociable sociabl societies societi society societi socks sock socrates socrat sod sod sodden sodden soe soe soever soever soft soft soften soften softens soften softer softer softest softest softly softli softness soft soil soil soiled soil soilure soilur soit soit sojourn sojourn sol sol sola sola solace solac solanio solanio sold sold soldat soldat solder solder soldest soldest soldier soldier soldiers soldier soldiership soldiership sole sole solely sole solem solem solemn solemn solemness solem solemnities solemn solemnity solemn solemniz solemniz solemnize solemn solemnized solemn solemnly solemnli soles sole solicit solicit solicitation solicit solicited solicit soliciting solicit solicitings solicit solicitor solicitor solicits solicit solid solid solidares solidar solidity solid solinus solinu solitary solitari solomon solomon solon solon solum solum solus solu solyman solyman some some somebody somebodi someone someon somerset somerset somerville somervil something someth sometime sometim sometimes sometim somever somev somewhat somewhat somewhere somewher somewhither somewhith somme somm son son sonance sonanc song song songs song sonnet sonnet sonneting sonnet sonnets sonnet sons son sont sont sonties sonti soon soon sooner sooner soonest soonest sooth sooth soothe sooth soothers soother soothing sooth soothsay soothsai soothsayer soothsay sooty sooti sop sop sophister sophist sophisticated sophist sophy sophi sops sop sorcerer sorcer sorcerers sorcer sorceress sorceress sorceries sorceri sorcery sorceri sore sore sorel sorel sorely sore sorer sorer sores sore sorrier sorrier sorriest sorriest sorrow sorrow sorrowed sorrow sorrowest sorrowest sorrowful sorrow sorrowing sorrow sorrows sorrow sorry sorri sort sort sortance sortanc sorted sort sorting sort sorts sort sossius sossiu sot sot soto soto sots sot sottish sottish soud soud sought sought soul soul sould sould soulless soulless souls soul sound sound sounded sound sounder sounder soundest soundest sounding sound soundless soundless soundly soundli soundness sound soundpost soundpost sounds sound sour sour source sourc sources sourc sourest sourest sourly sourli sours sour sous sou souse sous south south southam southam southampton southampton southerly southerli southern southern southward southward southwark southwark southwell southwel souviendrai souviendrai sov sov sovereign sovereign sovereignest sovereignest sovereignly sovereignli sovereignty sovereignti sovereignvours sovereignvour sow sow sowing sow sowl sowl sowter sowter space space spaces space spacious spaciou spade spade spades spade spain spain spak spak spake spake spakest spakest span span spangle spangl spangled spangl spaniard spaniard spaniel spaniel spaniels spaniel spanish spanish spann spann spans span spar spar spare spare spares spare sparing spare sparingly sparingli spark spark sparkle sparkl sparkles sparkl sparkling sparkl sparks spark sparrow sparrow sparrows sparrow sparta sparta spartan spartan spavin spavin spavins spavin spawn spawn speak speak speaker speaker speakers speaker speakest speakest speaketh speaketh speaking speak speaks speak spear spear speargrass speargrass spears spear special special specialities special specially special specialties specialti specialty specialti specify specifi speciously specious spectacle spectacl spectacled spectacl spectacles spectacl spectators spectat spectatorship spectatorship speculation specul speculations specul speculative specul sped sped speech speech speeches speech speechless speechless speed speed speeded speed speedier speedier speediest speediest speedily speedili speediness speedi speeding speed speeds speed speedy speedi speens speen spell spell spelling spell spells spell spelt spelt spencer spencer spend spend spendest spendest spending spend spends spend spendthrift spendthrift spent spent sperato sperato sperm sperm spero spero sperr sperr spher spher sphere sphere sphered sphere spheres sphere spherical spheric sphery spheri sphinx sphinx spice spice spiced spice spicery spiceri spices spice spider spider spiders spider spied spi spies spi spieth spieth spightfully spightfulli spigot spigot spill spill spilling spill spills spill spilt spilt spilth spilth spin spin spinii spinii spinners spinner spinster spinster spinsters spinster spire spire spirit spirit spirited spirit spiritless spiritless spirits spirit spiritual spiritu spiritualty spiritualti spirt spirt spit spit spital spital spite spite spited spite spiteful spite spites spite spits spit spitted spit spitting spit splay splai spleen spleen spleenful spleen spleens spleen spleeny spleeni splendour splendour splenitive splenit splinter splinter splinters splinter split split splits split splitted split splitting split spoil spoil spoils spoil spok spok spoke spoke spoken spoken spokes spoke spokesman spokesman sponge spong spongy spongi spoon spoon spoons spoon sport sport sportful sport sporting sport sportive sportiv sports sport spot spot spotless spotless spots spot spotted spot spousal spousal spouse spous spout spout spouting spout spouts spout sprag sprag sprang sprang sprat sprat sprawl sprawl spray sprai sprays sprai spread spread spreading spread spreads spread sprighted spright sprightful spright sprightly sprightli sprigs sprig spring spring springe spring springes spring springeth springeth springhalt springhalt springing spring springs spring springtime springtim sprinkle sprinkl sprinkles sprinkl sprite sprite sprited sprite spritely sprite sprites sprite spriting sprite sprout sprout spruce spruce sprung sprung spun spun spur spur spurio spurio spurn spurn spurns spurn spurr spurr spurrer spurrer spurring spur spurs spur spy spy spying spy squabble squabbl squadron squadron squadrons squadron squand squand squar squar square squar squarer squarer squares squar squash squash squeak squeak squeaking squeak squeal squeal squealing squeal squeezes squeez squeezing squeez squele squel squier squier squints squint squiny squini squire squir squires squir squirrel squirrel st st stab stab stabb stabb stabbed stab stabbing stab stable stabl stableness stabl stables stabl stablish stablish stablishment stablish stabs stab stacks stack staff staff stafford stafford staffords stafford staffordshire staffordshir stag stag stage stage stages stage stagger stagger staggering stagger staggers stagger stags stag staid staid staider staider stain stain stained stain staines stain staineth staineth staining stain stainless stainless stains stain stair stair stairs stair stake stake stakes stake stale stale staled stale stalk stalk stalking stalk stalks stalk stall stall stalling stall stalls stall stamford stamford stammer stammer stamp stamp stamped stamp stamps stamp stanch stanch stanchless stanchless stand stand standard standard standards standard stander stander standers stander standest standest standeth standeth standing stand stands stand staniel staniel stanley stanlei stanze stanz stanzo stanzo stanzos stanzo staple stapl staples stapl star star stare stare stared stare stares stare staring stare starings stare stark stark starkly starkli starlight starlight starling starl starr starr starry starri stars star start start started start starting start startingly startingli startle startl startles startl starts start starv starv starve starv starved starv starvelackey starvelackei starveling starvel starveth starveth starving starv state state statelier stateli stately state states state statesman statesman statesmen statesmen statilius statiliu station station statist statist statists statist statue statu statues statu stature statur statures statur statute statut statutes statut stave stave staves stave stay stai stayed stai stayest stayest staying stai stays stai stead stead steaded stead steadfast steadfast steadier steadier steads stead steal steal stealer stealer stealers stealer stealing steal steals steal stealth stealth stealthy stealthi steed steed steeds steed steel steel steeled steel steely steeli steep steep steeped steep steeple steepl steeples steepl steeps steep steepy steepi steer steer steerage steerag steering steer steers steer stelled stell stem stem stemming stem stench stench step step stepdame stepdam stephano stephano stephen stephen stepmothers stepmoth stepp stepp stepping step steps step sterile steril sterility steril sterling sterl stern stern sternage sternag sterner sterner sternest sternest sternness stern steterat steterat stew stew steward steward stewards steward stewardship stewardship stewed stew stews stew stick stick sticking stick stickler stickler sticks stick stiff stiff stiffen stiffen stiffly stiffli stifle stifl stifled stifl stifles stifl stigmatic stigmat stigmatical stigmat stile stile still still stiller stiller stillest stillest stillness still stilly stilli sting sting stinging sting stingless stingless stings sting stink stink stinking stink stinkingly stinkingli stinks stink stint stint stinted stint stints stint stir stir stirr stirr stirred stir stirrer stirrer stirrers stirrer stirreth stirreth stirring stir stirrup stirrup stirrups stirrup stirs stir stitchery stitcheri stitches stitch stithied stithi stithy stithi stoccadoes stoccado stoccata stoccata stock stock stockfish stockfish stocking stock stockings stock stockish stockish stocks stock stog stog stogs stog stoics stoic stokesly stokesli stol stol stole stole stolen stolen stolest stolest stomach stomach stomachers stomach stomaching stomach stomachs stomach ston ston stone stone stonecutter stonecutt stones stone stonish stonish stony stoni stood stood stool stool stools stool stoop stoop stooping stoop stoops stoop stop stop stope stope stopp stopp stopped stop stopping stop stops stop stor stor store store storehouse storehous storehouses storehous stores store stories stori storm storm stormed storm storming storm storms storm stormy stormi story stori stoup stoup stoups stoup stout stout stouter stouter stoutly stoutli stoutness stout stover stover stow stow stowage stowag stowed stow strachy strachi stragglers straggler straggling straggl straight straight straightest straightest straightway straightwai strain strain strained strain straining strain strains strain strait strait straited strait straiter straiter straitly straitli straitness strait straits strait strand strand strange strang strangely strang strangeness strang stranger stranger strangers stranger strangest strangest strangle strangl strangled strangl strangler strangler strangles strangl strangling strangl strappado strappado straps strap stratagem stratagem stratagems stratagem stratford stratford strato strato straw straw strawberries strawberri strawberry strawberri straws straw strawy strawi stray strai straying strai strays strai streak streak streaks streak stream stream streamers streamer streaming stream streams stream streching strech street street streets street strength strength strengthen strengthen strengthened strengthen strengthless strengthless strengths strength stretch stretch stretched stretch stretches stretch stretching stretch strew strew strewing strew strewings strew strewments strewment stricken stricken strict strict stricter stricter strictest strictest strictly strictli stricture strictur stride stride strides stride striding stride strife strife strifes strife strik strik strike strike strikers striker strikes strike strikest strikest striking strike string string stringless stringless strings string strip strip stripes stripe stripling stripl striplings stripl stripp stripp stripping strip striv striv strive strive strives strive striving strive strok strok stroke stroke strokes stroke strond strond stronds strond strong strong stronger stronger strongest strongest strongly strongli strooke strook strossers strosser strove strove strown strown stroy stroi struck struck strucken strucken struggle struggl struggles struggl struggling struggl strumpet strumpet strumpeted strumpet strumpets strumpet strung strung strut strut struts strut strutted strut strutting strut stubble stubbl stubborn stubborn stubbornest stubbornest stubbornly stubbornli stubbornness stubborn stuck stuck studded stud student student students student studied studi studies studi studious studiou studiously studious studs stud study studi studying studi stuff stuff stuffing stuf stuffs stuff stumble stumbl stumbled stumbl stumblest stumblest stumbling stumbl stump stump stumps stump stung stung stupefy stupefi stupid stupid stupified stupifi stuprum stuprum sturdy sturdi sty sty styga styga stygian stygian styl styl style style styx styx su su sub sub subcontracted subcontract subdu subdu subdue subdu subdued subdu subduements subduement subdues subdu subduing subdu subject subject subjected subject subjection subject subjects subject submerg submerg submission submiss submissive submiss submit submit submits submit submitting submit suborn suborn subornation suborn suborned suborn subscrib subscrib subscribe subscrib subscribed subscrib subscribes subscrib subscription subscript subsequent subsequ subsidies subsidi subsidy subsidi subsist subsist subsisting subsist substance substanc substances substanc substantial substanti substitute substitut substituted substitut substitutes substitut substitution substitut subtile subtil subtilly subtilli subtle subtl subtleties subtleti subtlety subtleti subtly subtli subtractors subtractor suburbs suburb subversion subvers subverts subvert succedant succed succeed succe succeeded succeed succeeders succeed succeeding succeed succeeds succe success success successantly successantli successes success successful success successfully successfulli succession success successive success successively success successor successor successors successor succour succour succours succour such such suck suck sucker sucker suckers sucker sucking suck suckle suckl sucks suck sudden sudden suddenly suddenli sue sue sued su suerly suerli sues sue sueth sueth suff suff suffer suffer sufferance suffer sufferances suffer suffered suffer suffering suffer suffers suffer suffic suffic suffice suffic sufficed suffic suffices suffic sufficeth sufficeth sufficiency suffici sufficient suffici sufficiently suffici sufficing suffic sufficit sufficit suffigance suffig suffocate suffoc suffocating suffoc suffocation suffoc suffolk suffolk suffrage suffrag suffrages suffrag sug sug sugar sugar sugarsop sugarsop suggest suggest suggested suggest suggesting suggest suggestion suggest suggestions suggest suggests suggest suis sui suit suit suitable suitabl suited suit suiting suit suitor suitor suitors suitor suits suit suivez suivez sullen sullen sullens sullen sullied sulli sullies sulli sully sulli sulph sulph sulpherous sulpher sulphur sulphur sulphurous sulphur sultan sultan sultry sultri sum sum sumless sumless summ summ summa summa summary summari summer summer summers summer summit summit summon summon summoners summon summons summon sumpter sumpter sumptuous sumptuou sumptuously sumptuous sums sum sun sun sunbeams sunbeam sunburning sunburn sunburnt sunburnt sund sund sunday sundai sundays sundai sunder sunder sunders sunder sundry sundri sung sung sunk sunk sunken sunken sunny sunni sunrising sunris suns sun sunset sunset sunshine sunshin sup sup super super superficial superfici superficially superfici superfluity superflu superfluous superflu superfluously superflu superflux superflux superior superior supernal supern supernatural supernatur superpraise superprais superscript superscript superscription superscript superserviceable superservic superstition superstit superstitious superstiti superstitiously superstiti supersubtle supersubtl supervise supervis supervisor supervisor supp supp supper supper suppers supper suppertime suppertim supping sup supplant supplant supple suppl suppler suppler suppliance supplianc suppliant suppliant suppliants suppliant supplicant supplic supplication supplic supplications supplic supplie suppli supplied suppli supplies suppli suppliest suppliest supply suppli supplyant supplyant supplying suppli supplyment supplyment support support supportable support supportance support supported support supporter support supporters support supporting support supportor supportor suppos suppo supposal suppos suppose suppos supposed suppos supposes suppos supposest supposest supposing suppos supposition supposit suppress suppress suppressed suppress suppresseth suppresseth supremacy supremaci supreme suprem sups sup sur sur surance suranc surcease surceas surd surd sure sure surecard surecard surely sure surer surer surest surest sureties sureti surety sureti surfeit surfeit surfeited surfeit surfeiter surfeit surfeiting surfeit surfeits surfeit surge surg surgeon surgeon surgeons surgeon surgere surger surgery surgeri surges surg surly surli surmis surmi surmise surmis surmised surmis surmises surmis surmount surmount surmounted surmount surmounts surmount surnam surnam surname surnam surnamed surnam surpasseth surpasseth surpassing surpass surplice surplic surplus surplu surpris surpri surprise surpris surprised surpris surrender surrend surrey surrei surreys surrei survey survei surveyest surveyest surveying survei surveyor surveyor surveyors surveyor surveys survei survive surviv survives surviv survivor survivor susan susan suspect suspect suspected suspect suspecting suspect suspects suspect suspend suspend suspense suspens suspicion suspicion suspicions suspicion suspicious suspici suspiration suspir suspire suspir sust sust sustain sustain sustaining sustain sutler sutler sutton sutton suum suum swabber swabber swaddling swaddl swag swag swagg swagg swagger swagger swaggerer swagger swaggerers swagger swaggering swagger swain swain swains swain swallow swallow swallowed swallow swallowing swallow swallows swallow swam swam swan swan swans swan sward sward sware sware swarm swarm swarming swarm swart swart swarth swarth swarths swarth swarthy swarthi swashers swasher swashing swash swath swath swathing swath swathling swathl sway swai swaying swai sways swai swear swear swearer swearer swearers swearer swearest swearest swearing swear swearings swear swears swear sweat sweat sweaten sweaten sweating sweat sweats sweat sweaty sweati sweep sweep sweepers sweeper sweeps sweep sweet sweet sweeten sweeten sweetens sweeten sweeter sweeter sweetest sweetest sweetheart sweetheart sweeting sweet sweetly sweetli sweetmeats sweetmeat sweetness sweet sweets sweet swell swell swelling swell swellings swell swells swell swelter swelter sweno sweno swept swept swerve swerv swerver swerver swerving swerv swift swift swifter swifter swiftest swiftest swiftly swiftli swiftness swift swill swill swills swill swim swim swimmer swimmer swimmers swimmer swimming swim swims swim swine swine swineherds swineherd swing swing swinge swing swinish swinish swinstead swinstead switches switch swits swit switzers switzer swol swol swoll swoll swoln swoln swoon swoon swooned swoon swooning swoon swoons swoon swoop swoop swoopstake swoopstak swor swor sword sword sworder sworder swords sword swore swore sworn sworn swounded swound swounds swound swum swum swung swung sy sy sycamore sycamor sycorax sycorax sylla sylla syllable syllabl syllables syllabl syllogism syllog symbols symbol sympathise sympathis sympathiz sympathiz sympathize sympath sympathized sympath sympathy sympathi synagogue synagogu synod synod synods synod syracuse syracus syracusian syracusian syracusians syracusian syria syria syrups syrup t t ta ta taber taber table tabl tabled tabl tables tabl tablet tablet tabor tabor taborer tabor tabors tabor tabourines tabourin taciturnity taciturn tack tack tackle tackl tackled tackl tackles tackl tackling tackl tacklings tackl taddle taddl tadpole tadpol taffeta taffeta taffety taffeti tag tag tagrag tagrag tah tah tail tail tailor tailor tailors tailor tails tail taint taint tainted taint tainting taint taints taint tainture taintur tak tak take take taken taken taker taker takes take takest takest taketh taketh taking take tal tal talbot talbot talbotites talbotit talbots talbot tale tale talent talent talents talent taleporter taleport tales tale talk talk talked talk talker talker talkers talker talkest talkest talking talk talks talk tall tall taller taller tallest tallest tallies talli tallow tallow tally talli talons talon tam tam tambourines tambourin tame tame tamed tame tamely tame tameness tame tamer tamer tames tame taming tame tamora tamora tamworth tamworth tan tan tang tang tangle tangl tangled tangl tank tank tanlings tanl tann tann tanned tan tanner tanner tanquam tanquam tanta tanta tantaene tantaen tap tap tape tape taper taper tapers taper tapestries tapestri tapestry tapestri taphouse taphous tapp tapp tapster tapster tapsters tapster tar tar tardied tardi tardily tardili tardiness tardi tardy tardi tarentum tarentum targe targ targes targ target target targets target tarpeian tarpeian tarquin tarquin tarquins tarquin tarr tarr tarre tarr tarriance tarrianc tarried tarri tarries tarri tarry tarri tarrying tarri tart tart tartar tartar tartars tartar tartly tartli tartness tart task task tasker tasker tasking task tasks task tassel tassel taste tast tasted tast tastes tast tasting tast tatt tatt tatter tatter tattered tatter tatters tatter tattle tattl tattling tattl tattlings tattl taught taught taunt taunt taunted taunt taunting taunt tauntingly tauntingli taunts taunt taurus tauru tavern tavern taverns tavern tavy tavi tawdry tawdri tawny tawni tax tax taxation taxat taxations taxat taxes tax taxing tax tc tc te te teach teach teacher teacher teachers teacher teaches teach teachest teachest teacheth teacheth teaching teach team team tear tear tearful tear tearing tear tears tear tearsheet tearsheet teat teat tedious tediou tediously tedious tediousness tedious teem teem teeming teem teems teem teen teen teeth teeth teipsum teipsum telamon telamon telamonius telamoniu tell tell teller teller telling tell tells tell tellus tellu temp temp temper temper temperality temper temperance temper temperate temper temperately temper tempers temper tempest tempest tempests tempest tempestuous tempestu temple templ temples templ temporal tempor temporary temporari temporiz temporiz temporize tempor temporizer tempor temps temp tempt tempt temptation temptat temptations temptat tempted tempt tempter tempter tempters tempter tempteth tempteth tempting tempt tempts tempt ten ten tenable tenabl tenant tenant tenantius tenantiu tenantless tenantless tenants tenant tench tench tend tend tendance tendanc tended tend tender tender tendered tender tenderly tenderli tenderness tender tenders tender tending tend tends tend tenedos tenedo tenement tenement tenements tenement tenfold tenfold tennis tenni tenour tenour tenours tenour tens ten tent tent tented tent tenth tenth tenths tenth tents tent tenure tenur tenures tenur tercel tercel tereus tereu term term termagant termag termed term terminations termin termless termless terms term terra terra terrace terrac terram terram terras terra terre terr terrene terren terrestrial terrestri terrible terribl terribly terribl territories territori territory territori terror terror terrors terror tertian tertian tertio tertio test test testament testament tested test tester tester testern testern testify testifi testimonied testimoni testimonies testimoni testimony testimoni testiness testi testril testril testy testi tetchy tetchi tether tether tetter tetter tevil tevil tewksbury tewksburi text text tgv tgv th th thaes thae thames thame than than thane thane thanes thane thank thank thanked thank thankful thank thankfully thankfulli thankfulness thank thanking thank thankings thank thankless thankless thanks thank thanksgiving thanksgiv thasos thaso that that thatch thatch thaw thaw thawing thaw thaws thaw the the theatre theatr theban theban thebes thebe thee thee theft theft thefts theft thein thein their their theirs their theise theis them them theme theme themes theme themselves themselv then then thence thenc thenceforth thenceforth theoric theoric there there thereabout thereabout thereabouts thereabout thereafter thereaft thereat thereat thereby therebi therefore therefor therein therein thereof thereof thereon thereon thereto thereto thereunto thereunto thereupon thereupon therewith therewith therewithal therewith thersites thersit these these theseus theseu thessalian thessalian thessaly thessali thetis theti thews thew they thei thick thick thicken thicken thickens thicken thicker thicker thickest thickest thicket thicket thickskin thickskin thief thief thievery thieveri thieves thiev thievish thievish thigh thigh thighs thigh thimble thimbl thimbles thimbl thin thin thine thine thing thing things thing think think thinkest thinkest thinking think thinkings think thinks think thinkst thinkst thinly thinli third third thirdly thirdli thirds third thirst thirst thirsting thirst thirsts thirst thirsty thirsti thirteen thirteen thirties thirti thirtieth thirtieth thirty thirti this thi thisby thisbi thisne thisn thistle thistl thistles thistl thither thither thitherward thitherward thoas thoa thomas thoma thorn thorn thorns thorn thorny thorni thorough thorough thoroughly thoroughli those those thou thou though though thought thought thoughtful thought thoughts thought thousand thousand thousands thousand thracian thracian thraldom thraldom thrall thrall thralled thrall thralls thrall thrash thrash thrasonical thrason thread thread threadbare threadbar threaden threaden threading thread threat threat threaten threaten threatening threaten threatens threaten threatest threatest threats threat three three threefold threefold threepence threepenc threepile threepil threes three threescore threescor thresher thresher threshold threshold threw threw thrice thrice thrift thrift thriftless thriftless thrifts thrift thrifty thrifti thrill thrill thrilling thrill thrills thrill thrive thrive thrived thrive thrivers thriver thrives thrive thriving thrive throat throat throats throat throbbing throb throbs throb throca throca throe throe throes throe thromuldo thromuldo thron thron throne throne throned throne thrones throne throng throng thronging throng throngs throng throstle throstl throttle throttl through through throughfare throughfar throughfares throughfar throughly throughli throughout throughout throw throw thrower thrower throwest throwest throwing throw thrown thrown throws throw thrum thrum thrumm thrumm thrush thrush thrust thrust thrusteth thrusteth thrusting thrust thrusts thrust thumb thumb thumbs thumb thump thump thund thund thunder thunder thunderbolt thunderbolt thunderbolts thunderbolt thunderer thunder thunders thunder thunderstone thunderston thunderstroke thunderstrok thurio thurio thursday thursdai thus thu thwack thwack thwart thwart thwarted thwart thwarting thwart thwartings thwart thy thy thyme thyme thymus thymu thyreus thyreu thyself thyself ti ti tib tib tiber tiber tiberio tiberio tibey tibei ticed tice tick tick tickl tickl tickle tickl tickled tickl tickles tickl tickling tickl ticklish ticklish tiddle tiddl tide tide tides tide tidings tide tidy tidi tie tie tied ti ties ti tiff tiff tiger tiger tigers tiger tight tight tightly tightli tike tike til til tile tile till till tillage tillag tilly tilli tilt tilt tilter tilter tilth tilth tilting tilt tilts tilt tiltyard tiltyard tim tim timandra timandra timber timber time time timeless timeless timelier timeli timely time times time timon timon timor timor timorous timor timorously timor tinct tinct tincture tinctur tinctures tinctur tinder tinder tingling tingl tinker tinker tinkers tinker tinsel tinsel tiny tini tip tip tipp tipp tippling tippl tips tip tipsy tipsi tiptoe tipto tir tir tire tire tired tire tires tire tirest tirest tiring tire tirra tirra tirrits tirrit tis ti tish tish tisick tisick tissue tissu titan titan titania titania tithe tith tithed tith tithing tith titinius titiniu title titl titled titl titleless titleless titles titl tittle tittl tittles tittl titular titular titus titu tn tn to to toad toad toads toad toadstool toadstool toast toast toasted toast toasting toast toasts toast toaze toaz toby tobi tock tock tod tod today todai todpole todpol tods tod toe toe toes toe tofore tofor toge toge toged toge together togeth toil toil toiled toil toiling toil toils toil token token tokens token told told toledo toledo tolerable toler toll toll tolling toll tom tom tomb tomb tombe tomb tombed tomb tombless tombless tomboys tomboi tombs tomb tomorrow tomorrow tomyris tomyri ton ton tongs tong tongu tongu tongue tongu tongued tongu tongueless tongueless tongues tongu tonight tonight too too took took tool tool tools tool tooth tooth toothache toothach toothpick toothpick toothpicker toothpick top top topas topa topful top topgallant topgal topless topless topmast topmast topp topp topping top topple toppl topples toppl tops top topsail topsail topsy topsi torch torch torchbearer torchbear torchbearers torchbear torcher torcher torches torch torchlight torchlight tore tore torment torment tormenta tormenta tormente torment tormented torment tormenting torment tormentors tormentor torments torment torn torn torrent torrent tortive tortiv tortoise tortois tortur tortur torture tortur tortured tortur torturer tortur torturers tortur tortures tortur torturest torturest torturing tortur toryne toryn toss toss tossed toss tosseth tosseth tossing toss tot tot total total totally total tott tott tottered totter totters totter tou tou touch touch touched touch touches touch toucheth toucheth touching touch touchstone touchston tough tough tougher tougher toughness tough touraine tourain tournaments tournament tours tour tous tou tout tout touze touz tow tow toward toward towardly towardli towards toward tower tower towering tower towers tower town town towns town township township townsman townsman townsmen townsmen towton towton toy toi toys toi trace trace traces trace track track tract tract tractable tractabl trade trade traded trade traders trader trades trade tradesman tradesman tradesmen tradesmen trading trade tradition tradit traditional tradit traduc traduc traduced traduc traducement traduc traffic traffic traffickers traffick traffics traffic tragedian tragedian tragedians tragedian tragedies tragedi tragedy tragedi tragic tragic tragical tragic trail trail train train trained train training train trains train trait trait traitor traitor traitorly traitorli traitorous traitor traitorously traitor traitors traitor traitress traitress traject traject trammel trammel trample trampl trampled trampl trampling trampl tranc tranc trance tranc tranio tranio tranquil tranquil tranquillity tranquil transcendence transcend transcends transcend transferred transfer transfigur transfigur transfix transfix transform transform transformation transform transformations transform transformed transform transgress transgress transgresses transgress transgressing transgress transgression transgress translate translat translated translat translates translat translation translat transmigrates transmigr transmutation transmut transparent transpar transport transport transportance transport transported transport transporting transport transports transport transpose transpos transshape transshap trap trap trapp trapp trappings trap traps trap trash trash travail travail travails travail travel travel traveler travel traveling travel travell travel travelled travel traveller travel travellers travel travellest travellest travelling travel travels travel travers traver traverse travers tray trai treacherous treacher treacherously treacher treachers treacher treachery treacheri tread tread treading tread treads tread treason treason treasonable treason treasonous treason treasons treason treasure treasur treasurer treasur treasures treasur treasuries treasuri treasury treasuri treat treat treaties treati treatise treatis treats treat treaty treati treble trebl trebled trebl trebles trebl trebonius treboniu tree tree trees tree tremble trembl trembled trembl trembles trembl tremblest tremblest trembling trembl tremblingly tremblingli tremor tremor trempling trempl trench trench trenchant trenchant trenched trench trencher trencher trenchering trencher trencherman trencherman trenchers trencher trenches trench trenching trench trent trent tres tre trespass trespass trespasses trespass tressel tressel tresses tress treys trei trial trial trials trial trib trib tribe tribe tribes tribe tribulation tribul tribunal tribun tribune tribun tribunes tribun tributaries tributari tributary tributari tribute tribut tributes tribut trice trice trick trick tricking trick trickling trickl tricks trick tricksy tricksi trident trident tried tri trier trier trifle trifl trifled trifl trifler trifler trifles trifl trifling trifl trigon trigon trill trill trim trim trimly trimli trimm trimm trimmed trim trimming trim trims trim trinculo trinculo trinculos trinculo trinkets trinket trip trip tripartite tripartit tripe tripe triple tripl triplex triplex tripoli tripoli tripolis tripoli tripp tripp tripping trip trippingly trippingli trips trip tristful trist triton triton triumph triumph triumphant triumphant triumphantly triumphantli triumpher triumpher triumphers triumpher triumphing triumph triumphs triumph triumvir triumvir triumvirate triumvir triumvirs triumvir triumviry triumviri trivial trivial troat troat trod trod trodden trodden troiant troiant troien troien troilus troilu troiluses troilus trojan trojan trojans trojan troll troll tromperies tromperi trompet trompet troop troop trooping troop troops troop trop trop trophies trophi trophy trophi tropically tropic trot trot troth troth trothed troth troths troth trots trot trotting trot trouble troubl troubled troubl troubler troubler troubles troubl troublesome troublesom troublest troublest troublous troublou trough trough trout trout trouts trout trovato trovato trow trow trowel trowel trowest trowest troy troi troyan troyan troyans troyan truant truant truce truce truckle truckl trudge trudg true true trueborn trueborn truepenny truepenni truer truer truest truest truie truie trull trull trulls trull truly truli trump trump trumpery trumperi trumpet trumpet trumpeter trumpet trumpeters trumpet trumpets trumpet truncheon truncheon truncheoners truncheon trundle trundl trunk trunk trunks trunk trust trust trusted trust truster truster trusters truster trusting trust trusts trust trusty trusti truth truth truths truth try try ts ts tu tu tuae tuae tub tub tubal tubal tubs tub tuck tuck tucket tucket tuesday tuesdai tuft tuft tufts tuft tug tug tugg tugg tugging tug tuition tuition tullus tullu tully tulli tumble tumbl tumbled tumbl tumbler tumbler tumbling tumbl tumult tumult tumultuous tumultu tun tun tune tune tuneable tuneabl tuned tune tuners tuner tunes tune tunis tuni tuns tun tupping tup turban turban turbans turban turbulence turbul turbulent turbul turd turd turf turf turfy turfi turk turk turkey turkei turkeys turkei turkish turkish turks turk turlygod turlygod turmoil turmoil turmoiled turmoil turn turn turnbull turnbul turncoat turncoat turncoats turncoat turned turn turneth turneth turning turn turnips turnip turns turn turph turph turpitude turpitud turquoise turquois turret turret turrets turret turtle turtl turtles turtl turvy turvi tuscan tuscan tush tush tut tut tutor tutor tutored tutor tutors tutor tutto tutto twain twain twang twang twangling twangl twas twa tway twai tweaks tweak tween tween twelfth twelfth twelve twelv twelvemonth twelvemonth twentieth twentieth twenty twenti twere twere twice twice twig twig twiggen twiggen twigs twig twilight twilight twill twill twilled twill twin twin twine twine twink twink twinkle twinkl twinkled twinkl twinkling twinkl twinn twinn twins twin twire twire twist twist twisted twist twit twit twits twit twitting twit twixt twixt two two twofold twofold twopence twopenc twopences twopenc twos two twould twould tyb tyb tybalt tybalt tybalts tybalt tyburn tyburn tying ty tyke tyke tymbria tymbria type type types type typhon typhon tyrannical tyrann tyrannically tyrann tyrannize tyrann tyrannous tyrann tyranny tyranni tyrant tyrant tyrants tyrant tyrian tyrian tyrrel tyrrel u u ubique ubiqu udders udder udge udg uds ud uglier uglier ugliest ugliest ugly ugli ulcer ulcer ulcerous ulcer ulysses ulyss um um umber umber umbra umbra umbrage umbrag umfrevile umfrevil umpire umpir umpires umpir un un unable unabl unaccommodated unaccommod unaccompanied unaccompani unaccustom unaccustom unaching unach unacquainted unacquaint unactive unact unadvis unadvi unadvised unadvis unadvisedly unadvisedli unagreeable unagre unanel unanel unanswer unansw unappeas unappea unapproved unapprov unapt unapt unaptness unapt unarm unarm unarmed unarm unarms unarm unassail unassail unassailable unassail unattainted unattaint unattempted unattempt unattended unattend unauspicious unauspici unauthorized unauthor unavoided unavoid unawares unawar unback unback unbak unbak unbanded unband unbar unbar unbarb unbarb unbashful unbash unbated unbat unbatter unbatt unbecoming unbecom unbefitting unbefit unbegot unbegot unbegotten unbegotten unbelieved unbeliev unbend unbend unbent unbent unbewail unbewail unbid unbid unbidden unbidden unbind unbind unbinds unbind unbitted unbit unbless unbless unblest unblest unbloodied unbloodi unblown unblown unbodied unbodi unbolt unbolt unbolted unbolt unbonneted unbonnet unbookish unbookish unborn unborn unbosom unbosom unbound unbound unbounded unbound unbow unbow unbowed unbow unbrac unbrac unbraced unbrac unbraided unbraid unbreathed unbreath unbred unbr unbreech unbreech unbridled unbridl unbroke unbrok unbruis unbrui unbruised unbruis unbuckle unbuckl unbuckles unbuckl unbuckling unbuckl unbuild unbuild unburden unburden unburdens unburden unburied unburi unburnt unburnt unburthen unburthen unbutton unbutton unbuttoning unbutton uncapable uncap uncape uncap uncase uncas uncasing uncas uncaught uncaught uncertain uncertain uncertainty uncertainti unchain unchain unchanging unchang uncharge uncharg uncharged uncharg uncharitably uncharit unchary unchari unchaste unchast uncheck uncheck unchilded unchild uncivil uncivil unclaim unclaim unclasp unclasp uncle uncl unclean unclean uncleanliness uncleanli uncleanly uncleanli uncleanness unclean uncles uncl unclew unclew unclog unclog uncoined uncoin uncolted uncolt uncomeliness uncomeli uncomfortable uncomfort uncompassionate uncompassion uncomprehensive uncomprehens unconfinable unconfin unconfirm unconfirm unconfirmed unconfirm unconquer unconqu unconquered unconqu unconsidered unconsid unconstant unconst unconstrain unconstrain unconstrained unconstrain uncontemn uncontemn uncontroll uncontrol uncorrected uncorrect uncounted uncount uncouple uncoupl uncourteous uncourt uncouth uncouth uncover uncov uncovered uncov uncropped uncrop uncross uncross uncrown uncrown unction unction unctuous unctuou uncuckolded uncuckold uncurable uncur uncurbable uncurb uncurbed uncurb uncurls uncurl uncurrent uncurr uncurse uncurs undaunted undaunt undeaf undeaf undeck undeck undeeded undeed under under underbearing underbear underborne underborn undercrest undercrest underfoot underfoot undergo undergo undergoes undergo undergoing undergo undergone undergon underground underground underhand underhand underlings underl undermine undermin underminers undermin underneath underneath underprizing underpr underprop underprop understand understand understandeth understandeth understanding understand understandings understand understands understand understood understood underta underta undertake undertak undertakeing undertak undertaker undertak undertakes undertak undertaking undertak undertakings undertak undertook undertook undervalu undervalu undervalued undervalu underwent underw underwrit underwrit underwrite underwrit undescried undescri undeserved undeserv undeserver undeserv undeservers undeserv undeserving undeserv undetermin undetermin undid undid undinted undint undiscernible undiscern undiscover undiscov undishonoured undishonour undispos undispo undistinguishable undistinguish undistinguished undistinguish undividable undivid undivided undivid undivulged undivulg undo undo undoes undo undoing undo undone undon undoubted undoubt undoubtedly undoubtedli undream undream undress undress undressed undress undrown undrown unduteous undut undutiful unduti une un uneared unear unearned unearn unearthly unearthli uneasines uneasin uneasy uneasi uneath uneath uneducated uneduc uneffectual uneffectu unelected unelect unequal unequ uneven uneven unexamin unexamin unexecuted unexecut unexpected unexpect unexperienc unexperienc unexperient unexperi unexpressive unexpress unfair unfair unfaithful unfaith unfallible unfal unfam unfam unfashionable unfashion unfasten unfasten unfather unfath unfathered unfath unfed unf unfeed unfe unfeeling unfeel unfeigned unfeign unfeignedly unfeignedli unfellowed unfellow unfelt unfelt unfenced unfenc unfilial unfili unfill unfil unfinish unfinish unfirm unfirm unfit unfit unfitness unfit unfix unfix unfledg unfledg unfold unfold unfolded unfold unfoldeth unfoldeth unfolding unfold unfolds unfold unfool unfool unforc unforc unforced unforc unforfeited unforfeit unfortified unfortifi unfortunate unfortun unfought unfought unfrequented unfrequ unfriended unfriend unfurnish unfurnish ungain ungain ungalled ungal ungart ungart ungarter ungart ungenitur ungenitur ungentle ungentl ungentleness ungentl ungently ungent ungird ungird ungodly ungodli ungor ungor ungot ungot ungotten ungotten ungovern ungovern ungracious ungraci ungrateful ungrat ungravely ungrav ungrown ungrown unguarded unguard unguem unguem unguided unguid unhack unhack unhair unhair unhallow unhallow unhallowed unhallow unhand unhand unhandled unhandl unhandsome unhandsom unhang unhang unhappied unhappi unhappily unhappili unhappiness unhappi unhappy unhappi unhardened unharden unharm unharm unhatch unhatch unheard unheard unhearts unheart unheedful unheed unheedfully unheedfulli unheedy unheedi unhelpful unhelp unhidden unhidden unholy unholi unhop unhop unhopefullest unhopefullest unhorse unhors unhospitable unhospit unhous unhou unhoused unhous unhurtful unhurt unicorn unicorn unicorns unicorn unimproved unimprov uninhabitable uninhabit uninhabited uninhabit unintelligent unintellig union union unions union unite unit united unit unity uniti universal univers universe univers universities univers university univers unjointed unjoint unjust unjust unjustice unjustic unjustly unjustli unkennel unkennel unkept unkept unkind unkind unkindest unkindest unkindly unkindli unkindness unkind unking unk unkinglike unkinglik unkiss unkiss unknit unknit unknowing unknow unknown unknown unlace unlac unlaid unlaid unlawful unlaw unlawfully unlawfulli unlearn unlearn unlearned unlearn unless unless unlesson unlesson unletter unlett unlettered unlett unlick unlick unlike unlik unlikely unlik unlimited unlimit unlineal unlin unlink unlink unload unload unloaded unload unloading unload unloads unload unlock unlock unlocks unlock unlook unlook unlooked unlook unloos unloo unloose unloos unlov unlov unloving unlov unluckily unluckili unlucky unlucki unmade unmad unmake unmak unmanly unmanli unmann unmann unmanner unmann unmannerd unmannerd unmannerly unmannerli unmarried unmarri unmask unmask unmasked unmask unmasking unmask unmasks unmask unmast unmast unmatch unmatch unmatchable unmatch unmatched unmatch unmeasurable unmeasur unmeet unmeet unmellowed unmellow unmerciful unmerci unmeritable unmerit unmeriting unmerit unminded unmind unmindfull unmindful unmingled unmingl unmitigable unmitig unmitigated unmitig unmix unmix unmoan unmoan unmov unmov unmoved unmov unmoving unmov unmuffles unmuffl unmuffling unmuffl unmusical unmus unmuzzle unmuzzl unmuzzled unmuzzl unnatural unnatur unnaturally unnatur unnaturalness unnatur unnecessarily unnecessarili unnecessary unnecessari unneighbourly unneighbourli unnerved unnerv unnoble unnobl unnoted unnot unnumb unnumb unnumber unnumb unowed unow unpack unpack unpaid unpaid unparagon unparagon unparallel unparallel unpartial unparti unpath unpath unpaved unpav unpay unpai unpeaceable unpeac unpeg unpeg unpeople unpeopl unpeopled unpeopl unperfect unperfect unperfectness unperfect unpick unpick unpin unpin unpink unpink unpitied unpiti unpitifully unpitifulli unplagu unplagu unplausive unplaus unpleas unplea unpleasant unpleas unpleasing unpleas unpolicied unpolici unpolish unpolish unpolished unpolish unpolluted unpollut unpossess unpossess unpossessing unpossess unpossible unposs unpractis unpracti unpregnant unpregn unpremeditated unpremedit unprepar unprepar unprepared unprepar unpress unpress unprevailing unprevail unprevented unprev unpriz unpriz unprizable unpriz unprofitable unprofit unprofited unprofit unproper unprop unproperly unproperli unproportion unproport unprovide unprovid unprovided unprovid unprovident unprovid unprovokes unprovok unprun unprun unpruned unprun unpublish unpublish unpurged unpurg unpurpos unpurpo unqualitied unqual unqueen unqueen unquestion unquest unquestionable unquestion unquiet unquiet unquietly unquietli unquietness unquiet unraised unrais unrak unrak unread unread unready unreadi unreal unreal unreasonable unreason unreasonably unreason unreclaimed unreclaim unreconciled unreconcil unreconciliable unreconcili unrecounted unrecount unrecuring unrecur unregarded unregard unregist unregist unrelenting unrel unremovable unremov unremovably unremov unreprievable unrepriev unresolv unresolv unrespected unrespect unrespective unrespect unrest unrest unrestor unrestor unrestrained unrestrain unreveng unreveng unreverend unreverend unreverent unrever unrevers unrev unrewarded unreward unrighteous unright unrightful unright unripe unrip unripp unripp unrivall unrival unroll unrol unroof unroof unroosted unroost unroot unroot unrough unrough unruly unruli unsafe unsaf unsaluted unsalut unsanctified unsanctifi unsatisfied unsatisfi unsavoury unsavouri unsay unsai unscalable unscal unscann unscann unscarr unscarr unschool unschool unscorch unscorch unscour unscour unscratch unscratch unseal unseal unseam unseam unsearch unsearch unseason unseason unseasonable unseason unseasonably unseason unseasoned unseason unseconded unsecond unsecret unsecret unseduc unseduc unseeing unse unseeming unseem unseemly unseemli unseen unseen unseminar unseminar unseparable unsepar unserviceable unservic unset unset unsettle unsettl unsettled unsettl unsever unsev unsex unsex unshak unshak unshaked unshak unshaken unshaken unshaped unshap unshapes unshap unsheath unsheath unsheathe unsheath unshorn unshorn unshout unshout unshown unshown unshrinking unshrink unshrubb unshrubb unshunn unshunn unshunnable unshunn unsifted unsift unsightly unsightli unsinew unsinew unsisting unsist unskilful unskil unskilfully unskilfulli unskillful unskil unslipping unslip unsmirched unsmirch unsoil unsoil unsolicited unsolicit unsorted unsort unsought unsought unsound unsound unsounded unsound unspeak unspeak unspeakable unspeak unspeaking unspeak unsphere unspher unspoke unspok unspoken unspoken unspotted unspot unsquar unsquar unstable unstabl unstaid unstaid unstain unstain unstained unstain unstanched unstanch unstate unstat unsteadfast unsteadfast unstooping unstoop unstringed unstring unstuff unstuff unsubstantial unsubstanti unsuitable unsuit unsuiting unsuit unsullied unsulli unsunn unsunn unsur unsur unsure unsur unsuspected unsuspect unsway unswai unswayable unsway unswayed unswai unswear unswear unswept unswept unsworn unsworn untainted untaint untalk untalk untangle untangl untangled untangl untasted untast untaught untaught untempering untemp untender untend untent untent untented untent unthankful unthank unthankfulness unthank unthink unthink unthought unthought unthread unthread unthrift unthrift unthrifts unthrift unthrifty unthrifti untie unti untied unti until until untimber untimb untimely untim untir untir untirable untir untired untir untitled untitl unto unto untold untold untouch untouch untoward untoward untowardly untowardli untraded untrad untrain untrain untrained untrain untread untread untreasur untreasur untried untri untrimmed untrim untrod untrod untrodden untrodden untroubled untroubl untrue untru untrussing untruss untruth untruth untruths untruth untucked untuck untun untun untune untun untuneable untun untutor untutor untutored untutor untwine untwin unurg unurg unus unu unused unus unusual unusu unvalued unvalu unvanquish unvanquish unvarnish unvarnish unveil unveil unveiling unveil unvenerable unvener unvex unvex unviolated unviol unvirtuous unvirtu unvisited unvisit unvulnerable unvulner unwares unwar unwarily unwarili unwash unwash unwatch unwatch unwearied unweari unwed unw unwedgeable unwedg unweeded unweed unweighed unweigh unweighing unweigh unwelcome unwelcom unwept unwept unwhipp unwhipp unwholesome unwholesom unwieldy unwieldi unwilling unwil unwillingly unwillingli unwillingness unwilling unwind unwind unwiped unwip unwise unwis unwisely unwis unwish unwish unwished unwish unwitted unwit unwittingly unwittingli unwonted unwont unwooed unwoo unworthier unworthi unworthiest unworthiest unworthily unworthili unworthiness unworthi unworthy unworthi unwrung unwrung unyok unyok unyoke unyok up up upbraid upbraid upbraided upbraid upbraidings upbraid upbraids upbraid uphoarded uphoard uphold uphold upholdeth upholdeth upholding uphold upholds uphold uplift uplift uplifted uplift upmost upmost upon upon upper upper uprear uprear upreared uprear upright upright uprighteously upright uprightness upright uprise upris uprising upris uproar uproar uproars uproar uprous uprou upshoot upshoot upshot upshot upside upsid upspring upspr upstairs upstair upstart upstart upturned upturn upward upward upwards upward urchin urchin urchinfield urchinfield urchins urchin urg urg urge urg urged urg urgent urgent urges urg urgest urgest urging urg urinal urin urinals urin urine urin urn urn urns urn urs ur ursa ursa ursley urslei ursula ursula urswick urswick us us usage usag usance usanc usances usanc use us used us useful us useless useless user user uses us usest usest useth useth usher usher ushered usher ushering usher ushers usher using us usual usual usually usual usurer usur usurers usur usuries usuri usuring usur usurp usurp usurpation usurp usurped usurp usurper usurp usurpers usurp usurping usurp usurpingly usurpingli usurps usurp usury usuri ut ut utensil utensil utensils utensil utility util utmost utmost utt utt utter utter utterance utter uttered utter uttereth uttereth uttering utter utterly utterli uttermost uttermost utters utter uy uy v v va va vacancy vacanc vacant vacant vacation vacat vade vade vagabond vagabond vagabonds vagabond vagram vagram vagrom vagrom vail vail vailed vail vailing vail vaillant vaillant vain vain vainer vainer vainglory vainglori vainly vainli vainness vain vais vai valanc valanc valance valanc vale vale valence valenc valentine valentin valentinus valentinu valentio valentio valeria valeria valerius valeriu vales vale valiant valiant valiantly valiantli valiantness valiant validity valid vallant vallant valley vallei valleys vallei vally valli valor valor valorous valor valorously valor valour valour valu valu valuation valuat value valu valued valu valueless valueless values valu valuing valu vane vane vanish vanish vanished vanish vanishes vanish vanishest vanishest vanishing vanish vanities vaniti vanity vaniti vanquish vanquish vanquished vanquish vanquisher vanquish vanquishest vanquishest vanquisheth vanquisheth vant vant vantage vantag vantages vantag vantbrace vantbrac vapians vapian vapor vapor vaporous vapor vapour vapour vapours vapour vara vara variable variabl variance varianc variation variat variations variat varied vari variest variest variety varieti varld varld varlet varlet varletry varletri varlets varlet varletto varletto varnish varnish varrius varriu varro varro vary vari varying vari vassal vassal vassalage vassalag vassals vassal vast vast vastidity vastid vasty vasti vat vat vater vater vaudemont vaudemont vaughan vaughan vault vault vaultages vaultag vaulted vault vaulting vault vaults vault vaulty vaulti vaumond vaumond vaunt vaunt vaunted vaunt vaunter vaunter vaunting vaunt vauntingly vauntingli vaunts vaunt vauvado vauvado vaux vaux vaward vaward ve ve veal veal vede vede vehemence vehem vehemency vehem vehement vehement vehor vehor veil veil veiled veil veiling veil vein vein veins vein vell vell velure velur velutus velutu velvet velvet vendible vendibl venerable vener venereal vener venetia venetia venetian venetian venetians venetian veneys venei venge veng vengeance vengeanc vengeances vengeanc vengeful veng veni veni venial venial venice venic venison venison venit venit venom venom venomous venom venomously venom vent vent ventages ventag vented vent ventidius ventidiu ventricle ventricl vents vent ventur ventur venture ventur ventured ventur ventures ventur venturing ventur venturous ventur venue venu venus venu venuto venuto ver ver verb verb verba verba verbal verbal verbatim verbatim verbosity verbos verdict verdict verdun verdun verdure verdur vere vere verefore verefor verg verg verge verg vergers verger verges verg verier verier veriest veriest verified verifi verify verifi verily verili veritable verit verite verit verities veriti verity veriti vermilion vermilion vermin vermin vernon vernon verona verona veronesa veronesa versal versal verse vers verses vers versing vers vert vert very veri vesper vesper vessel vessel vessels vessel vestal vestal vestments vestment vesture vestur vetch vetch vetches vetch veux veux vex vex vexation vexat vexations vexat vexed vex vexes vex vexest vexest vexeth vexeth vexing vex vi vi via via vial vial vials vial viand viand viands viand vic vic vicar vicar vice vice vicegerent viceger vicentio vicentio viceroy viceroi viceroys viceroi vices vice vici vici vicious viciou viciousness vicious vict vict victims victim victor victor victoress victoress victories victori victorious victori victors victor victory victori victual victual victuall victual victuals victual videlicet videlicet video video vides vide videsne videsn vidi vidi vie vie vied vi vienna vienna view view viewest viewest vieweth vieweth viewing view viewless viewless views view vigil vigil vigilance vigil vigilant vigil vigitant vigit vigour vigour vii vii viii viii vile vile vilely vile vileness vile viler viler vilest vilest vill vill village villag villager villag villagery villageri villages villag villain villain villainies villaini villainous villain villainously villain villains villain villainy villaini villanies villani villanous villan villany villani villiago villiago villian villian villianda villianda villians villian vinaigre vinaigr vincentio vincentio vincere vincer vindicative vindic vine vine vinegar vinegar vines vine vineyard vineyard vineyards vineyard vint vint vintner vintner viol viol viola viola violate violat violated violat violates violat violation violat violator violat violence violenc violent violent violenta violenta violenteth violenteth violently violent violet violet violets violet viper viper viperous viper vipers viper vir vir virgilia virgilia virgin virgin virginal virgin virginalling virginal virginity virgin virginius virginiu virgins virgin virgo virgo virtue virtu virtues virtu virtuous virtuou virtuously virtuous visag visag visage visag visages visag visard visard viscount viscount visible visibl visibly visibl vision vision visions vision visit visit visitation visit visitations visit visited visit visiting visit visitings visit visitor visitor visitors visitor visits visit visor visor vita vita vitae vita vital vital vitement vitement vitruvio vitruvio vitx vitx viva viva vivant vivant vive vive vixen vixen viz viz vizaments vizament vizard vizard vizarded vizard vizards vizard vizor vizor vlouting vlout vocation vocat vocativo vocativo vocatur vocatur voce voce voic voic voice voic voices voic void void voided void voiding void voke voke volable volabl volant volant volivorco volivorco volley vollei volquessen volquessen volsce volsc volsces volsc volscian volscian volscians volscian volt volt voltemand voltemand volubility volubl voluble volubl volume volum volumes volum volumnia volumnia volumnius volumniu voluntaries voluntari voluntary voluntari voluptuously voluptu voluptuousness voluptu vomissement vomiss vomit vomit vomits vomit vor vor vore vore vortnight vortnight vot vot votaries votari votarist votarist votarists votarist votary votari votre votr vouch vouch voucher voucher vouchers voucher vouches vouch vouching vouch vouchsaf vouchsaf vouchsafe vouchsaf vouchsafed vouchsaf vouchsafes vouchsaf vouchsafing vouchsaf voudrais voudrai vour vour vous vou voutsafe voutsaf vow vow vowed vow vowel vowel vowels vowel vowing vow vows vow vox vox voyage voyag voyages voyag vraiment vraiment vulcan vulcan vulgar vulgar vulgarly vulgarli vulgars vulgar vulgo vulgo vulnerable vulner vulture vultur vultures vultur vurther vurther w w wad wad waddled waddl wade wade waded wade wafer wafer waft waft waftage waftag wafting waft wafts waft wag wag wage wage wager wager wagers wager wages wage wagging wag waggish waggish waggling waggl waggon waggon waggoner waggon wagon wagon wagoner wagon wags wag wagtail wagtail wail wail wailful wail wailing wail wails wail wain wain wainropes wainrop wainscot wainscot waist waist wait wait waited wait waiter waiter waiteth waiteth waiting wait waits wait wak wak wake wake waked wake wakefield wakefield waken waken wakened waken wakes wake wakest wakest waking wake wales wale walk walk walked walk walking walk walks walk wall wall walled wall wallet wallet wallets wallet wallon wallon walloon walloon wallow wallow walls wall walnut walnut walter walter wan wan wand wand wander wander wanderer wander wanderers wander wandering wander wanders wander wands wand wane wane waned wane wanes wane waning wane wann wann want want wanted want wanteth wanteth wanting want wanton wanton wantonly wantonli wantonness wanton wantons wanton wants want wappen wappen war war warble warbl warbling warbl ward ward warded ward warden warden warder warder warders warder wardrobe wardrob wardrop wardrop wards ward ware ware wares ware warily warili warkworth warkworth warlike warlik warm warm warmed warm warmer warmer warming warm warms warm warmth warmth warn warn warned warn warning warn warnings warn warns warn warp warp warped warp warr warr warrant warrant warranted warrant warranteth warranteth warrantise warrantis warrantize warrant warrants warrant warranty warranti warren warren warrener warren warring war warrior warrior warriors warrior wars war wart wart warwick warwick warwickshire warwickshir wary wari was wa wash wash washed wash washer washer washes wash washford washford washing wash wasp wasp waspish waspish wasps wasp wassail wassail wassails wassail wast wast waste wast wasted wast wasteful wast wasters waster wastes wast wasting wast wat wat watch watch watched watch watchers watcher watches watch watchful watch watching watch watchings watch watchman watchman watchmen watchmen watchword watchword water water waterdrops waterdrop watered water waterfly waterfli waterford waterford watering water waterish waterish waterpots waterpot waterrugs waterrug waters water waterton waterton watery wateri wav wav wave wave waved wave waver waver waverer waver wavering waver waves wave waving wave waw waw wawl wawl wax wax waxed wax waxen waxen waxes wax waxing wax way wai waylaid waylaid waylay waylai ways wai wayward wayward waywarder wayward waywardness wayward we we weak weak weaken weaken weakens weaken weaker weaker weakest weakest weakling weakl weakly weakli weakness weak weal weal wealsmen wealsmen wealth wealth wealthiest wealthiest wealthily wealthili wealthy wealthi wealtlly wealtlli wean wean weapon weapon weapons weapon wear wear wearer wearer wearers wearer wearied weari wearies weari weariest weariest wearily wearili weariness weari wearing wear wearisome wearisom wears wear weary weari weasel weasel weather weather weathercock weathercock weathers weather weav weav weave weav weaver weaver weavers weaver weaves weav weaving weav web web wed wed wedded wed wedding wed wedg wedg wedged wedg wedges wedg wedlock wedlock wednesday wednesdai weed weed weeded weed weeder weeder weeding weed weeds weed weedy weedi week week weeke week weekly weekli weeks week ween ween weening ween weep weep weeper weeper weeping weep weepingly weepingli weepings weep weeps weep weet weet weigh weigh weighed weigh weighing weigh weighs weigh weight weight weightier weightier weightless weightless weights weight weighty weighti weird weird welcom welcom welcome welcom welcomer welcom welcomes welcom welcomest welcomest welfare welfar welkin welkin well well wells well welsh welsh welshman welshman welshmen welshmen welshwomen welshwomen wench wench wenches wench wenching wench wend wend went went wept wept weraday weradai were were wert wert west west western western westminster westminst westmoreland westmoreland westward westward wet wet wether wether wetting wet wezand wezand whale whale whales whale wharf wharf wharfs wharf what what whate whate whatever whatev whatsoe whatso whatsoever whatsoev whatsome whatsom whe whe wheat wheat wheaten wheaten wheel wheel wheeling wheel wheels wheel wheer wheer wheeson wheeson wheezing wheez whelk whelk whelks whelk whelm whelm whelp whelp whelped whelp whelps whelp when when whenas whena whence whenc whencesoever whencesoev whene whene whenever whenev whensoever whensoev where where whereabout whereabout whereas wherea whereat whereat whereby wherebi wherefore wherefor wherein wherein whereinto whereinto whereof whereof whereon whereon whereout whereout whereso whereso wheresoe whereso wheresoever wheresoev wheresome wheresom whereto whereto whereuntil whereuntil whereunto whereunto whereupon whereupon wherever wherev wherewith wherewith wherewithal wherewith whet whet whether whether whetstone whetston whetted whet whew whew whey whei which which whiff whiff whiffler whiffler while while whiles while whilst whilst whin whin whine whine whined whine whinid whinid whining whine whip whip whipp whipp whippers whipper whipping whip whips whip whipster whipster whipstock whipstock whipt whipt whirl whirl whirled whirl whirligig whirligig whirling whirl whirlpool whirlpool whirls whirl whirlwind whirlwind whirlwinds whirlwind whisp whisp whisper whisper whispering whisper whisperings whisper whispers whisper whist whist whistle whistl whistles whistl whistling whistl whit whit white white whitehall whitehal whitely white whiteness white whiter whiter whites white whitest whitest whither whither whiting white whitmore whitmor whitsters whitster whitsun whitsun whittle whittl whizzing whizz who who whoa whoa whoe whoe whoever whoever whole whole wholesom wholesom wholesome wholesom wholly wholli whom whom whoobub whoobub whoop whoop whooping whoop whor whor whore whore whoremaster whoremast whoremasterly whoremasterli whoremonger whoremong whores whore whoreson whoreson whoresons whoreson whoring whore whorish whorish whose whose whoso whoso whosoe whoso whosoever whosoev why why wi wi wick wick wicked wick wickednes wickedn wickedness wicked wicket wicket wicky wicki wid wid wide wide widens widen wider wider widow widow widowed widow widower widow widowhood widowhood widows widow wield wield wife wife wight wight wights wight wild wild wildcats wildcat wilder wilder wilderness wilder wildest wildest wildfire wildfir wildly wildli wildness wild wilds wild wiles wile wilful wil wilfull wilful wilfully wilfulli wilfulnes wilfuln wilfulness wil will will willed will willers willer willeth willeth william william williams william willing will willingly willingli willingness willing willoughby willoughbi willow willow wills will wilt wilt wiltshire wiltshir wimpled wimpl win win wince winc winch winch winchester winchest wincot wincot wind wind winded wind windgalls windgal winding wind windlasses windlass windmill windmil window window windows window windpipe windpip winds wind windsor windsor windy windi wine wine wing wing winged wing wingfield wingfield wingham wingham wings wing wink wink winking wink winks wink winner winner winners winner winning win winnow winnow winnowed winnow winnows winnow wins win winter winter winterly winterli winters winter wip wip wipe wipe wiped wipe wipes wipe wiping wipe wire wire wires wire wiry wiri wisdom wisdom wisdoms wisdom wise wise wiselier wiseli wisely wise wiser wiser wisest wisest wish wish wished wish wisher wisher wishers wisher wishes wish wishest wishest wisheth wisheth wishful wish wishing wish wishtly wishtli wisp wisp wist wist wit wit witb witb witch witch witchcraft witchcraft witches witch witching witch with with withal withal withdraw withdraw withdrawing withdraw withdrawn withdrawn withdrew withdrew wither wither withered wither withering wither withers wither withheld withheld withhold withhold withholds withhold within within withold withold without without withstand withstand withstanding withstand withstood withstood witless witless witness wit witnesses wit witnesseth witnesseth witnessing wit wits wit witted wit wittenberg wittenberg wittiest wittiest wittily wittili witting wit wittingly wittingli wittol wittol wittolly wittolli witty witti wiv wiv wive wive wived wive wives wive wiving wive wizard wizard wizards wizard wo wo woe woe woeful woeful woefull woeful woefullest woefullest woes woe woful woful wolf wolf wolfish wolfish wolsey wolsei wolves wolv wolvish wolvish woman woman womanhood womanhood womanish womanish womankind womankind womanly womanli womb womb wombs womb womby wombi women women won won woncot woncot wond wond wonder wonder wondered wonder wonderful wonder wonderfully wonderfulli wondering wonder wonders wonder wondrous wondrou wondrously wondrous wont wont wonted wont woo woo wood wood woodbine woodbin woodcock woodcock woodcocks woodcock wooden wooden woodland woodland woodman woodman woodmonger woodmong woods wood woodstock woodstock woodville woodvil wooed woo wooer wooer wooers wooer wooes wooe woof woof wooing woo wooingly wooingli wool wool woollen woollen woolly woolli woolsack woolsack woolsey woolsei woolward woolward woos woo wor wor worcester worcest word word words word wore wore worins worin work work workers worker working work workings work workman workman workmanly workmanli workmanship workmanship workmen workmen works work worky worki world world worldlings worldl worldly worldli worlds world worm worm worms worm wormwood wormwood wormy wormi worn worn worried worri worries worri worry worri worrying worri worse wors worser worser worship worship worshipful worship worshipfully worshipfulli worshipp worshipp worshipper worshipp worshippers worshipp worshippest worshippest worships worship worst worst worsted worst wort wort worth worth worthied worthi worthier worthier worthies worthi worthiest worthiest worthily worthili worthiness worthi worthless worthless worths worth worthy worthi worts wort wot wot wots wot wotting wot wouid wouid would would wouldest wouldest wouldst wouldst wound wound wounded wound wounding wound woundings wound woundless woundless wounds wound wouns woun woven woven wow wow wrack wrack wrackful wrack wrangle wrangl wrangler wrangler wranglers wrangler wrangling wrangl wrap wrap wrapp wrapp wraps wrap wrapt wrapt wrath wrath wrathful wrath wrathfully wrathfulli wraths wrath wreak wreak wreakful wreak wreaks wreak wreath wreath wreathed wreath wreathen wreathen wreaths wreath wreck wreck wrecked wreck wrecks wreck wren wren wrench wrench wrenching wrench wrens wren wrest wrest wrested wrest wresting wrest wrestle wrestl wrestled wrestl wrestler wrestler wrestling wrestl wretch wretch wretchcd wretchcd wretched wretch wretchedness wretched wretches wretch wring wring wringer wringer wringing wring wrings wring wrinkle wrinkl wrinkled wrinkl wrinkles wrinkl wrist wrist wrists wrist writ writ write write writer writer writers writer writes write writhled writhl writing write writings write writs writ written written wrong wrong wronged wrong wronger wronger wrongful wrong wrongfully wrongfulli wronging wrong wrongly wrongli wrongs wrong wronk wronk wrote wrote wroth wroth wrought wrought wrung wrung wry wry wrying wry wt wt wul wul wye wye x x xanthippe xanthipp xi xi xii xii xiii xiii xiv xiv xv xv y y yard yard yards yard yare yare yarely yare yarn yarn yaughan yaughan yaw yaw yawn yawn yawning yawn ycleped yclepe ycliped yclipe ye ye yea yea yead yead year year yearly yearli yearn yearn yearns yearn years year yeas yea yeast yeast yedward yedward yell yell yellow yellow yellowed yellow yellowing yellow yellowness yellow yellows yellow yells yell yelping yelp yeoman yeoman yeomen yeomen yerk yerk yes ye yesterday yesterdai yesterdays yesterdai yesternight yesternight yesty yesti yet yet yew yew yicld yicld yield yield yielded yield yielder yielder yielders yielder yielding yield yields yield yok yok yoke yoke yoked yoke yokefellow yokefellow yokes yoke yoketh yoketh yon yon yond yond yonder yonder yongrey yongrei yore yore yorick yorick york york yorkists yorkist yorks york yorkshire yorkshir you you young young younger younger youngest youngest youngling youngl younglings youngl youngly youngli younker younker your your yours your yourself yourself yourselves yourselv youth youth youthful youth youths youth youtli youtli zanies zani zany zani zeal zeal zealous zealou zeals zeal zed zed zenelophon zenelophon zenith zenith zephyrs zephyr zir zir zo zo zodiac zodiac zodiacs zodiac zone zone zounds zound zwagger zwagger } set i 0 foreach {in out} $test_vocab { do_test "1.$i.($in -> $out)" { lindex [sqlite3_fts5_tokenize db porter $in] 0 } $out incr i } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5porter2.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests focusing on the fts5 porter stemmer implementation. # # These are extra tests added to those in fts5porter.test in order to # improve test coverage of the porter stemmer implementation. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5porter2 # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } set test_vocab { tion tion ation ation vation vation avation avat vion vion ion ion relational relat relation relat relate relat zzz zzz ii ii iiing ii xtional xtional xenci xenci xlogi xlogi realization realiz realize realiz xization xizat capitalism capit talism talism xiveness xive xfulness xful xousness xous xical xical xicate xicat xicity xiciti ies ie eed e eing e s s } set i 0 foreach {in out} $test_vocab { do_test "1.$i.($in -> $out)" { lindex [sqlite3_fts5_tokenize db porter $in] 0 } $out incr i } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5prefix.test ================================================ # 2015 Jan 13 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # This file contains tests focused on prefix indexes. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5prefix # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE xx USING fts5(x, prefix=1); INSERT INTO xx VALUES('one two three'); INSERT INTO xx VALUES('four five six'); INSERT INTO xx VALUES('seven eight nine ten'); } do_execsql_test 1.1 { SELECT rowid FROM xx WHERE xx MATCH 't*' } {1 3} #------------------------------------------------------------------------- # Check that prefix indexes really do index n-character prefixes, not # n-byte prefixes. Use the ascii tokenizer so as not to be confused by # diacritic removal. # do_execsql_test 2.0 { CREATE VIRTUAL TABLE t1 USING fts5(x, tokenize = ascii, prefix = 2) } do_test 2.1 { foreach {rowid string} { 1 "\xCA\xCB\xCC\xCD" 2 "\u1234\u5678\u4321\u8765" } { execsql { INSERT INTO t1(rowid, x) VALUES($rowid, $string) } } } {} do_execsql_test 2.2 { INSERT INTO t1(t1) VALUES('integrity-check'); } foreach {tn q res} { 1 "SELECT rowid FROM t1 WHERE t1 MATCH '\xCA\xCB*'" 1 2 "SELECT rowid FROM t1 WHERE t1 MATCH '\u1234\u5678*'" 2 } { do_execsql_test 2.3.$tn $q $res } #------------------------------------------------------------------------- # Check that prefix queries with: # # * a column filter, and # * no prefix index. # # work Ok. # do_execsql_test 3.0 { CREATE VIRTUAL TABLE t3 USING fts5(a, b, c); INSERT INTO t3(t3, rank) VALUES('pgsz', 32); BEGIN; INSERT INTO t3 VALUES('acb ccc bba', 'cca bba bca', 'bbc ccc bca'); -- 1 INSERT INTO t3 VALUES('cbb cac cab', 'abb aac bba', 'aab ccc cac'); -- 2 INSERT INTO t3 VALUES('aac bcb aac', 'acb bcb caa', 'aca bab bca'); -- 3 INSERT INTO t3 VALUES('aab ccb ccc', 'aca cba cca', 'aca aac cbb'); -- 4 INSERT INTO t3 VALUES('bac aab bab', 'ccb bac cba', 'acb aba abb'); -- 5 INSERT INTO t3 VALUES('bab abc ccb', 'acb cba abb', 'cbb aaa cab'); -- 6 INSERT INTO t3 VALUES('cbb bbc baa', 'aab aca baa', 'bcc cca aca'); -- 7 INSERT INTO t3 VALUES('abc bba abb', 'cac abc cba', 'acc aac cac'); -- 8 INSERT INTO t3 VALUES('bbc bbc cab', 'bcb ccb cba', 'bcc cac acb'); -- 9 COMMIT; } foreach {tn match res} { 1 "a : c*" {1 2 4 6 7 9} 2 "b : c*" {1 3 4 5 6 8 9} 3 "c : c*" {1 2 4 6 7 8 9} 4 "a : b*" {1 3 5 6 7 8 9} 5 "b : b*" {1 2 3 5 7 9} 6 "c : b*" {1 3 7 9} 7 "a : a*" {1 3 4 5 6 8} 8 "b : a*" {2 3 4 6 7 8} 9 "c : a*" {2 3 4 5 6 7 8 9} } { do_execsql_test 3.1.$tn { SELECT rowid FROM t3($match) } $res } do_test 3.2 { expr srand(0) execsql { DELETE FROM t3 } for {set i 0} {$i < 1000} {incr i} { set a [fts5_rnddoc 3] set b [fts5_rnddoc 8] set c [fts5_rnddoc 20] execsql { INSERT INTO t3 VALUES($a, $b, $c) } } execsql { INSERT INTO t3(t3) VALUES('integrity-check') } } {} proc gmatch {col pattern} { expr {[lsearch -glob $col $pattern]>=0} } db func gmatch gmatch proc ghl {col pattern} { foreach t $col { if {[string match $pattern $t]} { lappend res "*$t*" } else { lappend res $t } } set res } db func ghl ghl set COLS(a) 0 set COLS(b) 1 set COLS(c) 2 for {set x 0} {$x<2} {incr x} { foreach {tn pattern} { 1 {xa*} 2 {xb*} 3 {xc*} 4 {xd*} 5 {xe*} 6 {xf*} 7 {xg*} 8 {xh*} 9 {xi*} 10 {xj*} } { foreach col {a b c} { # Check that the list of returned rowids is correct. # set res [db eval "SELECT rowid FROM t3 WHERE gmatch($col, '$pattern')"] set query "$col : $pattern" do_execsql_test 3.3.$x.$tn.$col.rowid { SELECT rowid FROM t3($query); } $res # Check that the highlight() function works. # set res [db eval \ "SELECT ghl($col, '$pattern') FROM t3 WHERE gmatch($col, '$pattern')" ] set idx $COLS($col) do_execsql_test 3.3.$x.$tn.$col.highlight { SELECT highlight(t3, $idx, '*', '*') FROM t3($query); } $res } foreach colset {{a b} {b c} {c a} {a c} {b a}} { # Check that the list of returned rowids is correct. # foreach {col1 col2} $colset {} set expr "gmatch($col1, '$pattern') OR gmatch($col2, '$pattern')" set res [db eval "SELECT rowid FROM t3 WHERE $expr"] set query "{$colset} : $pattern" do_execsql_test 3.3.$x.$tn.{$colset}.rowid { SELECT rowid FROM t3($query); } $res set resq "SELECT ghl($col1, '$pattern'), ghl($col2, '$pattern')" append resq " FROM t3 WHERE $expr" set res [db eval $resq] set idx1 $COLS($col1) set idx2 $COLS($col2) do_execsql_test 3.3.$x.$tn.{$colset}.highlight { SELECT highlight(t3, $idx1, '*', '*'), highlight(t3, $idx2, '*', '*') FROM t3($query) } $res } } execsql { INSERT INTO t3(t3) VALUES('optimize') } execsql { INSERT INTO t3(t3) VALUES('integrity-check') } } #------------------------------------------------------------------------- # reset_db do_execsql_test 4.0 { CREATE VIRTUAL TABLE t2 USING fts5(c1, c2); INSERT INTO t2 VALUES('xa xb', 'xb xa'); INSERT INTO t2 SELECT c1||' '||c1, c2||' '||c2 FROM t2; -- 2 INSERT INTO t2 SELECT c1||' '||c1, c2||' '||c2 FROM t2; -- 4 INSERT INTO t2 SELECT c1||' '||c1, c2||' '||c2 FROM t2; -- 8 INSERT INTO t2 SELECT c1||' '||c1, c2||' '||c2 FROM t2; -- 16 INSERT INTO t2 SELECT c1||' '||c1, c2||' '||c2 FROM t2; -- 32 INSERT INTO t2 SELECT c1||' '||c1, c2||' '||c2 FROM t2; -- 64 INSERT INTO t2 SELECT c1||' '||c1, c2||' '||c2 FROM t2; -- 128 INSERT INTO t2 SELECT c1||' '||c1, c2||' '||c2 FROM t2; -- 256 INSERT INTO t2 SELECT c1||' '||c1, c2||' '||c2 FROM t2; -- 512 INSERT INTO t2 SELECT c1||' '||c1, c2||' '||c2 FROM t2; -- 1024 INSERT INTO t2 SELECT c1||' '||c1, c2||' '||c2 FROM t2; -- 2048 INSERT INTO t2 SELECT c1||' '||c1, c2||' '||c2 FROM t2; -- 4096 SELECT count(*) FROM t2('x*'); } {4096} do_execsql_test 4.1 { UPDATE t2 SET c2 = 'ya yb'; SELECT count(*) FROM t2('c1:x*'); SELECT count(*) FROM t2('c2:x*'); } {4096 0} do_execsql_test 4.2 { UPDATE t2 SET c2 = 'xa'; SELECT count(*) FROM t2('c1:x*'); SELECT count(*) FROM t2('c2:x*'); } {4096 4096} #------------------------------------------------------------------------- # reset_db proc rnddoc {n} { set map [list a b c d] set doc [list] for {set i 0} {$i < $n} {incr i} { lappend doc "x[lindex $map [expr int(rand()*4)]]" } set doc } set cols [list] for {set i 1} {$i<250} {incr i} { lappend cols "c$i" lappend vals "'[rnddoc 10]'" } do_test 5.0 { execsql "CREATE VIRTUAL TABLE t4 USING fts5([join $cols ,])" execsql {INSERT INTO t4(t4, rank) VALUES('pgsz', 32)} execsql "INSERT INTO t4 VALUES([join $vals ,])" execsql "INSERT INTO t4 VALUES([join $vals ,])" execsql "INSERT INTO t4 VALUES([join $vals ,])" execsql "INSERT INTO t4 VALUES([join $vals ,])" } {} proc gmatch {col pattern} { expr {[lsearch -glob $col $pattern]>=0} } db func gmatch gmatch foreach {tn col pattern} { 1 c100 {xa*} 2 c200 {xb*} } { set res [db eval "SELECT rowid FROM t4 WHERE gmatch($col, \$pattern)"] set query "$col : $pattern" do_execsql_test 5.$tn { SELECT rowid FROM t4($query) } $res } reset_db db func fts5_rnddoc fts5_rnddoc do_test 6.0 { execsql { CREATE VIRTUAL TABLE t5 USING fts5(x, y); INSERT INTO t5 VALUES( fts5_rnddoc(10000), fts5_rnddoc(10000) ); INSERT INTO t5 VALUES( fts5_rnddoc(10000), fts5_rnddoc(10000) ); INSERT INTO t5 VALUES( fts5_rnddoc(10000), fts5_rnddoc(10000) ); INSERT INTO t5 VALUES( fts5_rnddoc(10000), fts5_rnddoc(10000) ); } } {} proc gmatch {col pattern} { expr {[lsearch -glob $col $pattern]>=0} } db func gmatch gmatch foreach {tn col pattern} { 1 y {xa*} 2 y {xb*} 3 y {xc*} 4 x {xa*} 5 x {xb*} 6 x {xc*} } { set res [db eval "SELECT rowid FROM t5 WHERE gmatch($col, \$pattern)"] set query "$col : $pattern" do_execsql_test 6.$tn { SELECT rowid FROM t5($query) } $res } #------------------------------------------------------------------------- # Check that the various ways of creating prefix indexes produce the # same database on disk. # save_prng_state foreach {tn create} { 1 { CREATE VIRTUAL TABLE tt USING fts5(x, y, prefix="1,2,3") } 2 { CREATE VIRTUAL TABLE tt USING fts5(x, y, prefix="1 2 3") } 3 { CREATE VIRTUAL TABLE tt USING fts5(x, y, prefix=1, prefix=2, prefix=3) } 4 { CREATE VIRTUAL TABLE tt USING fts5(x, y, prefix="1 2", prefix=3) } } { execsql { DROP TABLE IF EXISTS tt } restore_prng_state execsql $create execsql { INSERT INTO tt VALUES('cc b ggg ccc aa eee hh', 'aa g b hh a e'); INSERT INTO tt VALUES('cc bb cc gg j g cc', 'ii jjj ggg jjj cc cc'); INSERT INTO tt VALUES('h eee cc h iii', 'aaa iii dd iii dd'); INSERT INTO tt VALUES('jjj hh eee c e b gg', 'j bbb jj ddd jj'); INSERT INTO tt VALUES('ii hhh aaa ff c hhh iii', 'j cc hh bb e'); INSERT INTO tt VALUES('e fff hhh i aaa', 'g b aa gg c aa dd'); INSERT INTO tt VALUES('i aaa ccc gg hhh aa h', 'j bbb bbb d ff'); INSERT INTO tt VALUES('g f gg ff ff jjj d', 'jjj d j fff fff ee j'); INSERT INTO tt VALUES('a cc e ccc jjj c', 'ccc iii d bb a eee g'); INSERT INTO tt VALUES('jj hh hh bb bbb gg', 'j c jjj bb iii f'); INSERT INTO tt VALUES('a ggg g cc ccc aa', 'jjj j j aaa c'); INSERT INTO tt VALUES('ddd j dd b i', 'aaa bbb iii ggg ff ccc ddd'); INSERT INTO tt VALUES('jj ii hh c ii h gg', 'hhh bbb ddd bbb hh g ggg'); INSERT INTO tt VALUES('aa hhh ccc h ggg ccc', 'iii d jj a ff ii'); } #db eval {SELECT rowid, fts5_decode(rowid, block) aS r FROM tt_data} {puts $r} if {$tn==1} { set ::checksum [execsql {SELECT md5sum(id, block) FROM tt_data}] } else { do_execsql_test 7.$tn { SELECT md5sum(id, block) FROM tt_data } [list $::checksum] } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5query.test ================================================ # 2015 October 27 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5query # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } for {set tn 1 ; set pgsz 64} {$tn<32} {incr tn; incr pgsz 16} { reset_db do_test 1.$tn.1 { execsql { CREATE VIRTUAL TABLE t1 USING fts5(x); INSERT INTO t1(t1, rank) VALUES('pgsz', $pgsz); BEGIN; } foreach x [list aaa bbb ccc ddd eee fff ggg hhh iii jjj] { set doc [string repeat "$x " 30] execsql { INSERT INTO t1 VALUES($doc) } } execsql COMMIT } {} do_execsql_test 1.$tn.2 { INSERT INTO t1(t1) VALUES('integrity-check'); } set ret 1 foreach x [list a b c d e f g h i j] { do_execsql_test 1.$tn.3.$ret { SELECT rowid FROM t1 WHERE t1 MATCH $x || '*'; } $ret incr ret } } for {set tn 1 ; set pgsz 64} {$tn<32} {incr tn; incr pgsz 16} { reset_db do_test 2.$tn.1 { execsql { CREATE VIRTUAL TABLE t1 USING fts5(x); INSERT INTO t1(t1, rank) VALUES('pgsz', $pgsz); BEGIN; } foreach x [list bbb ddd fff hhh jjj lll nnn ppp rrr ttt] { set doc [string repeat "$x " 30] execsql { INSERT INTO t1 VALUES($doc) } } execsql COMMIT } {} do_execsql_test 1.$tn.2 { INSERT INTO t1(t1) VALUES('integrity-check'); } set ret 1 foreach x [list a c e g i k m o q s u] { do_execsql_test 2.$tn.3.$ret { SELECT rowid FROM t1 WHERE t1 MATCH $x || '*'; } {} incr ret } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5rank.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # This file focuses on testing queries that use the "rank" column. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5rank # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } #------------------------------------------------------------------------- # "ORDER BY rank" + highlight() + large poslists. # do_execsql_test 1.0 { CREATE VIRTUAL TABLE xyz USING fts5(z); } do_test 1.1 { set doc [string trim [string repeat "x y " 500]] execsql { INSERT INTO xyz VALUES($doc) } } {} do_execsql_test 1.2 { SELECT highlight(xyz, 0, '[', ']') FROM xyz WHERE xyz MATCH 'x' ORDER BY rank } [list [string map {x [x]} $doc]] do_execsql_test 1.3 { SELECT highlight(xyz, 0, '[', ']') FROM xyz WHERE xyz MATCH 'x AND y' ORDER BY rank } [list [string map {x [x] y [y]} $doc]] #------------------------------------------------------------------------- # Check that the 'rank' option really is persistent. # do_execsql_test 2.0 { CREATE VIRTUAL TABLE tt USING fts5(a); INSERT INTO tt VALUES('a x x x x'); INSERT INTO tt VALUES('x x a a a'); INSERT INTO tt VALUES('x a a x x'); } proc firstinst {cmd} { foreach {p c o} [$cmd xInst 0] {} return $o } sqlite3_fts5_create_function db firstinst firstinst do_execsql_test 2.1 { SELECT rowid FROM tt('a') ORDER BY rank; } {2 3 1} do_execsql_test 2.2 { SELECT rowid FROM tt('a', 'firstinst()') ORDER BY rank; } {1 3 2} do_execsql_test 2.3 { INSERT INTO tt(tt, rank) VALUES('rank', 'firstinst()'); SELECT rowid FROM tt('a') ORDER BY rank; } {1 3 2} do_test 2.4 { sqlite3 db2 test.db catchsql { SELECT rowid FROM tt('a') ORDER BY rank; } db2 } {1 {no such function: firstinst}} do_test 2.5 { db2 close sqlite3 db2 test.db sqlite3_fts5_create_function db2 firstinst firstinst execsql { SELECT rowid FROM tt('a') ORDER BY rank; } db2 } {1 3 2} do_test 2.6 { execsql { SELECT rowid FROM tt('a') ORDER BY rank; } db2 } {1 3 2} do_test 2.7 { execsql { SELECT rowid FROM tt('a') ORDER BY rank; } db } {1 3 2} db2 close #-------------------------------------------------------------------------- # At one point there was a problem with queries such as: # # ... MATCH 'x OR y' ORDER BY rank; # # if there were zero occurrences of token 'y' in the dataset. The # following tests verify that that problem has been addressed. # foreach_detail_mode $::testprefix { do_execsql_test 3.1.0 { CREATE VIRTUAL TABLE y1 USING fts5(z, detail=%DETAIL%); INSERT INTO y1 VALUES('test xyz'); INSERT INTO y1 VALUES('test test xyz test'); INSERT INTO y1 VALUES('test test xyz'); } do_execsql_test 3.1.1 { SELECT rowid FROM y1('test OR tset'); } {1 2 3} do_execsql_test 3.1.2 { SELECT rowid FROM y1('test OR tset') ORDER BY bm25(y1) } {2 3 1} do_execsql_test 3.1.3 { SELECT rowid FROM y1('test OR tset') ORDER BY +rank } {2 3 1} do_execsql_test 3.1.4 { SELECT rowid FROM y1('test OR tset') ORDER BY rank } {2 3 1} do_execsql_test 3.1.5 { SELECT rowid FROM y1('test OR xyz') ORDER BY rank } {3 2 1} do_execsql_test 3.2.1 { CREATE VIRTUAL TABLE z1 USING fts5(a, detail=%DETAIL%); INSERT INTO z1 VALUES('wrinkle in time'); SELECT * FROM z1 WHERE z1 MATCH 'wrinkle in time OR a wrinkle in time'; } {{wrinkle in time}} } do_execsql_test 4.1 { DROP TABLE IF EXISTS VTest; CREATE virtual TABLE VTest USING FTS5( Title, AUthor, tokenize ='porter unicode61 remove_diacritics 1', columnsize='1', detail=full ); INSERT INTO VTest (Title, Author) VALUES ('wrinkle in time', 'Bill Smith'); SELECT * FROM VTest WHERE VTest MATCH 'wrinkle in time OR a wrinkle in time' ORDER BY rank; } {{wrinkle in time} {Bill Smith}} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5rebuild.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5rebuild # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.1 { CREATE VIRTUAL TABLE f1 USING fts5(a, b); INSERT INTO f1(a, b) VALUES('one', 'o n e'); INSERT INTO f1(a, b) VALUES('two', 't w o'); INSERT INTO f1(a, b) VALUES('three', 't h r e e'); } do_execsql_test 1.2 { INSERT INTO f1(f1) VALUES('integrity-check'); } {} do_execsql_test 1.3 { INSERT INTO f1(f1) VALUES('rebuild'); } {} do_execsql_test 1.4 { INSERT INTO f1(f1) VALUES('integrity-check'); } {} do_execsql_test 1.5 { DELETE FROM f1_data; } {} do_catchsql_test 1.6 { INSERT INTO f1(f1) VALUES('integrity-check'); } {1 {database disk image is malformed}} do_execsql_test 1.7 { INSERT INTO f1(f1) VALUES('rebuild'); INSERT INTO f1(f1) VALUES('integrity-check'); } {} #------------------------------------------------------------------------- # Check that 'rebuild' may not be used with a contentless table. # do_execsql_test 2.1 { CREATE VIRTUAL TABLE nc USING fts5(doc, content=); } do_catchsql_test 2.2 { INSERT INTO nc(nc) VALUES('rebuild'); } {1 {'rebuild' may not be used with a contentless fts5 table}} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5restart.test ================================================ # 2015 April 28 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # This file focuses on testing the planner (xBestIndex function). # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5restart # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE f1 USING fts5(ff); } #------------------------------------------------------------------------- # Run the 'optimize' command. Check that it does not disturb ongoing # full-text queries. # do_test 1.1 { for {set i 1} {$i < 1000} {incr i} { execsql { INSERT INTO f1 VALUES('a b c d e') } lappend lRowid $i } } {} do_execsql_test 1.2 { SELECT rowid FROM f1 WHERE f1 MATCH 'c'; } $lRowid do_test 1.3 { set res [list] db eval { SELECT rowid FROM f1 WHERE f1 MATCH 'c' } { if {$rowid == 100} { execsql { INSERT INTO f1(f1) VALUES('optimize') } } lappend res $rowid } set res } $lRowid do_test 1.4.1 { sqlite3 db2 test.db set res [list] db2 eval { SELECT rowid FROM f1 WHERE f1 MATCH 'c' } { if {$rowid == 100} { set cres [catchsql { INSERT INTO f1(f1) VALUES('optimize') }] } lappend res $rowid } set res } $lRowid do_test 1.4.2 { db2 close set cres } {1 {database is locked}} #------------------------------------------------------------------------- # Open a couple of cursors. Then close them in the same order. # do_test 2.1 { set ::s1 [sqlite3_prepare db "SELECT rowid FROM f1 WHERE f1 MATCH 'b'" -1 X] set ::s2 [sqlite3_prepare db "SELECT rowid FROM f1 WHERE f1 MATCH 'c'" -1 X] sqlite3_step $::s1 } {SQLITE_ROW} do_test 2.2 { sqlite3_step $::s2 } {SQLITE_ROW} do_test 2.1 { sqlite3_finalize $::s1 sqlite3_finalize $::s2 } {SQLITE_OK} #------------------------------------------------------------------------- # Copy data between two FTS5 tables. # do_execsql_test 3.1 { CREATE VIRTUAL TABLE f2 USING fts5(gg); INSERT INTO f2 SELECT ff FROM f1 WHERE f1 MATCH 'b+c+d'; } do_execsql_test 3.2 { SELECT rowid FROM f2 WHERE f2 MATCH 'a+b+c+d+e' } $lRowid #------------------------------------------------------------------------- # Remove the row that an FTS5 cursor is currently pointing to. And # various other similar things. Check that this does not disturb # ongoing scans. # do_execsql_test 4.0 { CREATE VIRTUAL TABLE n4 USING fts5(n); INSERT INTO n4(rowid, n) VALUES(100, '1 2 3 4 5'); INSERT INTO n4(rowid, n) VALUES(200, '1 2 3 4'); INSERT INTO n4(rowid, n) VALUES(300, '2 3 4'); INSERT INTO n4(rowid, n) VALUES(400, '2 3'); INSERT INTO n4(rowid, n) VALUES(500, '3'); } do_test 4.1 { set res [list] db eval { SELECT rowid FROM n4 WHERE n4 MATCH '3' } { if {$rowid==300} { execsql { DELETE FROM n4 WHERE rowid=300 } } lappend res $rowid } set res } {100 200 300 400 500} do_test 4.2 { execsql { INSERT INTO n4(rowid, n) VALUES(300, '2 3 4') } set res [list] db eval { SELECT rowid FROM n4 WHERE n4 MATCH '3' ORDER BY rowid DESC} { if {$rowid==300} { execsql { DELETE FROM n4 WHERE rowid=300 } } lappend res $rowid } set res } {500 400 300 200 100} do_test 4.3 { execsql { INSERT INTO n4(rowid, n) VALUES(300, '2 3 4') } set res [list] db eval { SELECT rowid FROM n4 WHERE n4 MATCH '3' ORDER BY rowid DESC} { if {$rowid==300} { execsql { DELETE FROM n4 } } lappend res $rowid } set res } {500 400 300} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5rowid.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests of the scalar fts5_rowid() and fts5_decode() functions. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5rowid # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_catchsql_test 1.1 { SELECT fts5_rowid() } {1 {should be: fts5_rowid(subject, ....)}} do_catchsql_test 1.2 { SELECT fts5_rowid('segment') } {1 {should be: fts5_rowid('segment', segid, pgno))}} do_execsql_test 1.3 { SELECT fts5_rowid('segment', 1, 1) } {137438953473} do_catchsql_test 1.4 { SELECT fts5_rowid('nosucharg'); } {1 {first arg to fts5_rowid() must be 'segment'}} #------------------------------------------------------------------------- # Tests of the fts5_decode() function. # reset_db do_execsql_test 2.1 { CREATE VIRTUAL TABLE x1 USING fts5(a, b); INSERT INTO x1(x1, rank) VALUES('pgsz', 32); } {} proc rnddoc {n} { set map [list 0 a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j] set doc [list] for {set i 0} {$i < $n} {incr i} { lappend doc [string map $map [format %.3d [expr int(rand()*100)]]] } set doc } db func rnddoc rnddoc do_execsql_test 2.2 { WITH r(a, b) AS ( SELECT rnddoc(6), rnddoc(6) UNION ALL SELECT rnddoc(6), rnddoc(6) FROM r ) INSERT INTO x1 SELECT * FROM r LIMIT 10000; DELETE FROM x1 WHERE (rowid%2); } set res [db one {SELECT count(*) FROM x1_data}] do_execsql_test 2.3 { SELECT count(fts5_decode(rowid, block)) FROM x1_data; } $res do_execsql_test 2.4 { UPDATE x1_data SET block = X''; SELECT count(fts5_decode(rowid, block)) FROM x1_data; } $res do_execsql_test 2.5 { INSERT INTO x1(x1, rank) VALUES('pgsz', 1024); INSERT INTO x1(x1) VALUES('rebuild'); } set res [db one {SELECT count(*) FROM x1_data}] do_execsql_test 2.6 { SELECT count(fts5_decode(rowid, block)) FROM x1_data; } $res # This is really a corruption test... #do_execsql_test 2.7 { # UPDATE x1_data SET block = X''; # SELECT count(fts5_decode(rowid, block)) FROM x1_data; #} $res do_execsql_test 2.8 { SELECT fts5_decode(fts5_rowid('segment', 1000, 1), X'AB') } {corrupt} #------------------------------------------------------------------------- # Tests with very large tokens. # set strlist [list \ "[string repeat x 400]" \ "[string repeat x 300][string repeat w 100]" \ "[string repeat x 300][string repeat y 100]" \ "[string repeat x 300][string repeat z 600]" \ ] do_test 3.0 { execsql { BEGIN; CREATE VIRTUAL TABLE x2 USING fts5(a); } foreach str $strlist { execsql { INSERT INTO x2 VALUES($str) } } execsql COMMIT } {} for {set tn 0} {$tn<[llength $strlist]} {incr tn} { set str [lindex $strlist $tn] do_execsql_test 3.1.$tn { SELECT rowid FROM x2 WHERE x2 MATCH $str } [expr $tn+1] } set res [db one {SELECT count(*) FROM x2_data}] do_execsql_test 3.2 { SELECT count(fts5_decode(rowid, block)) FROM x2_data; } $res #------------------------------------------------------------------------- # Leaf pages with no terms or rowids at all. # set strlist [list \ "[string repeat {w } 400]" \ "[string repeat {x } 400]" \ "[string repeat {y } 400]" \ "[string repeat {z } 400]" \ ] do_test 4.0 { execsql { BEGIN; CREATE VIRTUAL TABLE x3 USING fts5(a); INSERT INTO x3(x3, rank) VALUES('pgsz', 32); } foreach str $strlist { execsql { INSERT INTO x3 VALUES($str) } } execsql COMMIT } {} for {set tn 0} {$tn<[llength $strlist]} {incr tn} { set str [lindex $strlist $tn] do_execsql_test 4.1.$tn { SELECT rowid FROM x3 WHERE x3 MATCH $str } [expr $tn+1] } set res [db one {SELECT count(*) FROM x3_data}] do_execsql_test 4.2 { SELECT count(fts5_decode(rowid, block)) FROM x3_data; } $res #------------------------------------------------------------------------- # Position lists with large values. # set strlist [list \ "[string repeat {w } 400]a" \ "[string repeat {x } 400]a" \ "[string repeat {y } 400]a" \ "[string repeat {z } 400]a" \ ] do_test 5.0 { execsql { BEGIN; CREATE VIRTUAL TABLE x4 USING fts5(a); INSERT INTO x4(x4, rank) VALUES('pgsz', 32); } foreach str $strlist { execsql { INSERT INTO x4 VALUES($str) } } execsql COMMIT } {} do_execsql_test 5.1 { SELECT rowid FROM x4 WHERE x4 MATCH 'a' } {1 2 3 4} set res [db one {SELECT count(*) FROM x4_data}] do_execsql_test 5.2 { SELECT count(fts5_decode(rowid, block)) FROM x4_data; } $res #------------------------------------------------------------------------- # do_execsql_test 6.0 { CREATE VIRTUAL TABLE x5 USING fts5(x, detail=none); INSERT INTO x5(x5, rank) VALUES('pgsz', 32); INSERT INTO x5 VALUES('a b c d e f'); INSERT INTO x5 VALUES('a b c d e f'); INSERT INTO x5 VALUES('a b c d e f'); BEGIN; WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<100 ) INSERT INTO x5 SELECT 'a b c d e f' FROM s; COMMIT; SELECT count(fts5_decode_none(rowid, block)) FROM x5_data; } {32} do_execsql_test 6.1 { DELETE FROM x5 WHERE rowid <= 2; SELECT count(fts5_decode_none(rowid, block)) FROM x5_data; } {34} do_execsql_test 6.2 { UPDATE x5 SET x='a b c d e f' WHERE rowid=3; SELECT count(fts5_decode_none(rowid, block)) FROM x5_data; } {36} #db eval {SELECT rowid, fts5_decode_none(rowid, block) aS r FROM x5_data} {puts $r} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5simple.test ================================================ # 2015 September 05 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5simple # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } if 1 { #------------------------------------------------------------------------- # set doc "x x [string repeat {y } 50]z z" do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(x); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); BEGIN; INSERT INTO t1 VALUES($doc); COMMIT; } do_execsql_test 1.1 { INSERT INTO t1(t1) VALUES('integrity-check'); } #------------------------------------------------------------------------- # reset_db do_execsql_test 2.0 { CREATE VIRTUAL TABLE t1 USING fts5(x); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); INSERT INTO t1 VALUES('a b c'); INSERT INTO t1 VALUES('d e f'); INSERT INTO t1(t1) VALUES('optimize'); } do_execsql_test 2.1 { INSERT INTO t1(t1) VALUES('integrity-check'); } {} #------------------------------------------------------------------------- # reset_db do_execsql_test 3.0 { CREATE VIRTUAL TABLE t1 USING fts5(x, prefix='1,2'); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); BEGIN; INSERT INTO t1 VALUES('one'); SELECT * FROM t1 WHERE t1 MATCH 'o*'; } {one} do_execsql_test 3.1 { INSERT INTO t1(t1) VALUES('integrity-check'); } {} #------------------------------------------------------------------------- reset_db do_execsql_test 4.1 { CREATE VIRTUAL TABLE t11 USING fts5(content); INSERT INTO t11(t11, rank) VALUES('pgsz', 32); INSERT INTO t11 VALUES('another'); INSERT INTO t11 VALUES('string'); INSERT INTO t11 VALUES('of'); INSERT INTO t11 VALUES('text'); } do_test 4.2 { execsql { INSERT INTO t11(t11) VALUES('optimize') } } {} do_execsql_test 4.3 { INSERT INTO t11(t11) VALUES('integrity-check'); } {} #db eval { SELECT fts5_decode(rowid, block) as x FROM t11_data } { puts $x } #------------------------------------------------------------------------- reset_db set doc [string repeat "x y " 5] do_execsql_test 5.1 { CREATE VIRTUAL TABLE yy USING fts5(content); INSERT INTO yy(yy, rank) VALUES('pgsz', 32); BEGIN; INSERT INTO yy VALUES($doc); INSERT INTO yy VALUES($doc); INSERT INTO yy VALUES($doc); INSERT INTO yy VALUES($doc); INSERT INTO yy VALUES($doc); INSERT INTO yy VALUES($doc); INSERT INTO yy VALUES($doc); INSERT INTO yy VALUES($doc); COMMIT; } do_execsql_test 5.2 { SELECT rowid FROM yy WHERE yy MATCH 'y' ORDER BY rowid ASC } {1 2 3 4 5 6 7 8} do_execsql_test 5.3 { SELECT rowid FROM yy WHERE yy MATCH 'y' ORDER BY rowid DESC } {8 7 6 5 4 3 2 1} #db eval { SELECT fts5_decode(rowid, block) as x FROM yy_data } { puts $x } #------------------------------------------------------------------------- reset_db do_execsql_test 5.1 { CREATE VIRTUAL TABLE tt USING fts5(content); INSERT INTO tt(tt, rank) VALUES('pgsz', 32); INSERT INTO tt VALUES('aa'); } do_execsql_test 5.2 { SELECT rowid FROM tt WHERE tt MATCH 'a*'; } {1} do_execsql_test 5.3 { DELETE FROM tt; BEGIN; INSERT INTO tt VALUES('aa'); INSERT INTO tt VALUES('ab'); COMMIT; } {} do_execsql_test 5.4 { SELECT rowid FROM tt WHERE tt MATCH 'a*'; } {1 2} do_execsql_test 5.5 { DELETE FROM tt; BEGIN; INSERT INTO tt VALUES('aa'); INSERT INTO tt VALUES('ab'); INSERT INTO tt VALUES('aa'); INSERT INTO tt VALUES('ab'); INSERT INTO tt VALUES('aa'); INSERT INTO tt VALUES('ab'); INSERT INTO tt VALUES('aa'); INSERT INTO tt VALUES('ab'); COMMIT; SELECT rowid FROM tt WHERE tt MATCH 'a*'; } {1 2 3 4 5 6 7 8} do_execsql_test 5.6 { INSERT INTO tt(tt) VALUES('integrity-check'); } reset_db do_execsql_test 5.7 { CREATE VIRTUAL TABLE tt USING fts5(content); INSERT INTO tt(tt, rank) VALUES('pgsz', 32); INSERT INTO tt VALUES('aa ab ac ad ae af'); } do_execsql_test 5.8 { SELECT rowid FROM tt WHERE tt MATCH 'a*'; } {1} #------------------------------------------------------------------------- reset_db do_execsql_test 6.1 { CREATE VIRTUAL TABLE xyz USING fts5(x, y, z); INSERT INTO xyz VALUES('x', 'y', 'z'); } do_catchsql_test 6.2 { SELECT * FROM xyz WHERE xyz MATCH '' } {1 {fts5: syntax error near ""}} do_catchsql_test 6.3 { SELECT * FROM xyz WHERE xyz MATCH NULL } {1 {fts5: syntax error near ""}} #------------------------------------------------------------------------- do_execsql_test 7.1 { CREATE VIRTUAL TABLE ft2 USING fts5(content); INSERT INTO ft2(rowid, content) VALUES(1, 'a b c'); INSERT INTO ft2(rowid, content) VALUES(2, 'a b d'); } do_catchsql_test 7.2 { BEGIN; UPDATE ft2 SET rowid=2 WHERE rowid=1; } {1 {constraint failed}} do_execsql_test 7.3 { COMMIT; INSERT INTO ft2(ft2) VALUES('integrity-check'); } {} do_execsql_test 7.4 { SELECT * FROM ft2; } {{a b c} {a b d}} #------------------------------------------------------------------------- # reset_db do_execsql_test 8.1 { CREATE VIRTUAL TABLE ft2 USING fts5(content); INSERT INTO ft2(rowid, content) VALUES(1, 'a b'); } do_execsql_test 8.2 { BEGIN; INSERT INTO ft2(rowid, content) VALUES(4, 'a x'); } do_execsql_test 8.3 { INSERT INTO ft2(ft2) VALUES('integrity-check'); } #------------------------------------------------------------------------- # Check that the "table function" syntax works. # reset_db do_execsql_test 9.1 { CREATE VIRTUAL TABLE ft2 USING fts5(content); INSERT INTO ft2(rowid, content) VALUES(1, 'a b'); INSERT INTO ft2(rowid, content) VALUES(2, 'a b c d'); INSERT INTO ft2(rowid, content) VALUES(3, 'c d e f'); } do_execsql_test 9.2 { SELECT rowid FROM ft2('a'); } {1 2} do_execsql_test 9.3 { SELECT rowid FROM ft2('b AND c'); } {2} #------------------------------------------------------------------------- # do_execsql_test 10.0 { CREATE VIRTUAL TABLE t3 USING fts5(a, b, c); INSERT INTO t3 VALUES('bac aab bab', 'c bac c', 'acb aba abb'); -- 1 INSERT INTO t3 VALUES('bab abc c', 'acb c abb', 'c aaa c'); -- 2 } do_execsql_test 10.1 { SELECT rowid FROM t3('c: c*'); } {2} do_execsql_test 10.2 { SELECT rowid FROM t3('b: acb'); } {2} #------------------------------------------------------------------------- # Test that character 0x1A is allowed in fts5 barewords. # do_test 11.0 { execsql "CREATE VIRTUAL TABLE t4 USING fts5(x, tokenize=\"ascii tokenchars '\x1A'\")" execsql " INSERT INTO t4 VALUES('a b c \x1A'); INSERT INTO t4 VALUES('a b c d\x1A'); INSERT INTO t4 VALUES('a b c \x1Ag'); INSERT INTO t4 VALUES('a b c d'); " } {} do_test 11.1 { execsql "SELECT rowid FROM t4('\x1A')" } {1} do_test 11.2 { execsql "SELECT rowid FROM t4('\x1A*')" } {1 3} do_test 11.3 { execsql "SELECT rowid FROM t4('d\x1A')" } {2} do_test 11.4 { catchsql "SELECT rowid FROM t4('d\x1B')" } {/fts5: syntax error/} do_test 11.5 { catchsql "SELECT rowid FROM t4('d\x19')" } {/fts5: syntax error/} #------------------------------------------------------------------------- # do_test 12.1 { execsql { CREATE VIRTUAL TABLE xx USING fts5(x,y); BEGIN; INSERT INTO xx VALUES('1 2 3', 'a b c'); } } {} do_execsql_test 12.2 { SELECT rowid FROM xx('x:a'); COMMIT; } {} #------------------------------------------------------------------------- # Try an UPDATE OR REPLACE query. # do_execsql_test 13.1 { CREATE VIRTUAL TABLE xy USING fts5(x); INSERT INTO xy(rowid, x) VALUES(1, '1 2 3'); INSERT INTO xy(rowid, x) VALUES(2, '2 3 4'); INSERT INTO xy(rowid, x) VALUES(3, '3 4 5'); } do_execsql_test 13.2 { UPDATE OR REPLACE xy SET rowid=3 WHERE rowid = 2; SELECT rowid, x FROM xy; } { 1 {1 2 3} 3 {2 3 4} } do_execsql_test 13.3 { INSERT INTO xy(xy) VALUES('integrity-check'); } #------------------------------------------------------------------------- # do_execsql_test 14.1 { CREATE VIRTUAL TABLE ttt USING fts5(x); BEGIN; INSERT INTO ttt(rowid, x) VALUES(1, 'a b c'); INSERT INTO ttt(rowid, x) VALUES(2, 'a b c'); INSERT INTO ttt(rowid, x) VALUES(3, 'a b c'); COMMIT; } do_test 14.2 { fts5_level_segs ttt } {1} #------------------------------------------------------------------------- db func rnddoc fts5_rnddoc do_execsql_test 14.3 { CREATE VIRTUAL TABLE x1 USING fts5(x); INSERT INTO x1(x1, rank) VALUES('pgsz', 32); WITH ii(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<10 ) INSERT INTO x1 SELECT rnddoc(5) FROM ii; } do_execsql_test 14.4 { SELECT rowid, x, x1 FROM x1 WHERE x1 MATCH '*reads' } {0 {} 3} #------------------------------------------------------------------------- reset_db do_execsql_test 15.0 { CREATE VIRTUAL TABLE x2 USING fts5(x, prefix=1); INSERT INTO x2 VALUES('ab'); } do_execsql_test 15.1 { INSERT INTO x2(x2) VALUES('integrity-check'); } #------------------------------------------------------------------------- foreach_detail_mode $testprefix { reset_db fts5_aux_test_functions db do_execsql_test 16.0 { CREATE VIRTUAL TABLE x3 USING fts5(x, detail=%DETAIL%); INSERT INTO x3 VALUES('a b c d e f'); } do_execsql_test 16.1 { SELECT fts5_test_poslist(x3) FROM x3('(a NOT b) OR c'); } {2.0.2} do_execsql_test 16.1 { SELECT fts5_test_poslist(x3) FROM x3('a OR c'); } {{0.0.0 1.0.2}} } } #------------------------------------------------------------------------- reset_db do_execsql_test 17.0 { CREATE VIRTUAL TABLE x3 USING fts5(x); INSERT INTO x3 VALUES('a b c'); } do_execsql_test 17.1 { SELECT rowid FROM x3('b AND d'); } #------------------------------------------------------------------------- do_execsql_test 18.1 { CREATE VIRTUAL TABLE x4 USING fts5(x); SELECT rowid FROM x4('""'); } #------------------------------------------------------------------------- reset_db do_execsql_test 19.1 { CREATE VIRTUAL TABLE x1 USING fts5(a,b,c); } do_catchsql_test 19.2 { SELECT * FROM x1 WHERE x1 MATCH 'c0 AND (c1 AND (c2 AND (c3 AND (c4 AND (c5 AND (c6 AND (c7 AND (c8 AND (c9 AND (c10 AND (c11 AND (c12 AND (c13 AND (c14 AND (c15 AND (c16 AND (c17 AND (c18 AND (c19 AND (c20 AND (c21 AND (c22 AND (c23 AND (c24 AND (c25 AND (c26 AND (c27 AND (c28 AND (c29 AND (c30 AND (c31 AND (c32 AND (c33 AND (c34 AND (c35 AND (c36 AND (c37 AND (c38 AND (c39 AND (c40 AND (c41 AND (c42 AND (c43 AND (c44 AND (c45 AND (c46 AND (c47 AND (c48 AND (c49 AND (c50 AND (c51 AND (c52 AND (c53 AND (c54 AND (c55 AND (c56 AND (c57 AND (c58 AND (c59 AND (c60 AND (c61 AND (c62 AND (c63 AND (c64 AND (c65 AND (c66 AND (c67 AND (c68 AND (c69 AND (c70 AND (c71 AND (c72 AND (c73 AND (c74 AND (c75 AND (c76 AND (c77 AND (c78 AND (c79 AND (c80 AND (c81 AND (c82 AND (c83 AND (c84 AND (c85 AND (c86 AND (c87 AND (c88 AND (c89 AND (c90 AND (c91 AND (c92 AND (c93 AND (c94 AND (c95 AND (c96 AND (c97 AND (c98 AND (c99 AND (c100 AND (c101 AND (c102 AND (c103 AND (c104 AND (c105 AND (c106 AND (c107 AND (c108 AND (c109 AND (c110 AND (c111 AND (c112 AND (c113 AND (c114 AND (c115 AND (c116 AND (c117 AND (c118 AND (c119 AND (c120 AND (c121 AND (c122 AND (c123 AND (c124 AND (c125 AND (c126 AND (c127 AND (c128 AND (c129 AND (c130 AND (c131 AND (c132 AND (c133 AND (c134 AND (c135 AND (c136 AND (c137 AND (c138 AND (c139 AND (c140 AND (c141 AND (c142 AND (c143 AND (c144 AND (c145 AND (c146 AND (c147 AND (c148 AND (c149 AND (c150 AND (c151 AND (c152 AND (c153 AND (c154 AND (c155 AND (c156 AND (c157 AND (c158 AND (c159 AND (c160 AND (c161 AND (c162 AND (c163 AND (c164 AND (c165 AND (c166 AND (c167 AND (c168 AND (c169 AND (c170 AND (c171 AND (c172 AND (c173 AND (c174 AND (c175 AND (c176 AND (c177 AND (c178 AND (c179 AND (c180 AND (c181 AND (c182 AND (c183 AND (c184 AND (c185 AND (c186 AND (c187 AND (c188 AND (c189 AND (c190 AND (c191 AND (c192 AND (c193 AND (c194 AND (c195 AND (c196 AND (c197 AND (c198 AND (c199 AND c200)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))'; } {1 {fts5: parser stack overflow}} #------------------------------------------------------------------------- reset_db do_execsql_test 20.0 { CREATE VIRTUAL TABLE x1 USING fts5(x); INSERT INTO x1(x1, rank) VALUES('pgsz', 32); INSERT INTO x1(rowid, x) VALUES(11111, 'onetwothree'); } do_test 20.1 { for {set i 1} {$i <= 200} {incr i} { execsql { INSERT INTO x1(rowid, x) VALUES($i, 'one two three'); } } execsql { INSERT INTO x1(x1) VALUES('optimize'); } execsql { DELETE FROM x1 WHERE rowid = 4; } } {} do_execsql_test 20.2 { INSERT INTO x1(x1) VALUES('optimize'); INSERT INTO x1(x1) VALUES('integrity-check'); } {} #------------------------------------------------------------------------- reset_db do_execsql_test 20.0 { CREATE VIRTUAL TABLE x1 USING fts5(x); INSERT INTO x1(x1, rank) VALUES('pgsz', 32); INSERT INTO x1(rowid, x) VALUES(11111, 'onetwothree'); } do_test 20.1 { for {set i 1} {$i <= 200} {incr i} { execsql { INSERT INTO x1(rowid, x) VALUES($i, 'one two three'); } } execsql { INSERT INTO x1(x1) VALUES('optimize'); } execsql { DELETE FROM x1 WHERE rowid = 4; } } {} do_execsql_test 20.2 { INSERT INTO x1(x1) VALUES('optimize'); INSERT INTO x1(x1) VALUES('integrity-check'); } {} #------------------------------------------------------------------------- reset_db set doc "a b [string repeat x 100000]" do_execsql_test 21.0 { CREATE VIRTUAL TABLE x1 USING fts5(x); INSERT INTO x1(rowid, x) VALUES(11111, $doc); INSERT INTO x1(rowid, x) VALUES(11112, $doc); } do_execsql_test 21.1 { INSERT INTO x1(x1) VALUES('integrity-check'); } do_execsql_test 21.2 { SELECT rowid FROM x1($doc); } {11111 11112} do_execsql_test 21.3 { DELETE FROM x1 WHERE rowid=11111; INSERT INTO x1(x1) VALUES('integrity-check'); SELECT rowid FROM x1($doc); } {11112} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5simple2.test ================================================ # 2015 September 05 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5simple2 # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, detail=none); INSERT INTO t1 VALUES('a b c'); } do_execsql_test 1.1 { SELECT rowid FROM t1('c a b') } {1} #------------------------------------------------------------------------- # reset_db do_execsql_test 2.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, detail=none); BEGIN; INSERT INTO t1 VALUES('b c d'); INSERT INTO t1 VALUES('b c d'); COMMIT; } do_execsql_test 2.1 { SELECT rowid FROM t1('b c d') } {1 2} #------------------------------------------------------------------------- # reset_db do_execsql_test 3.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, detail=none); BEGIN; INSERT INTO t1 VALUES('b c d'); INSERT INTO t1 VALUES('b c d'); } do_execsql_test 3.1 { SELECT rowid FROM t1('b c d'); COMMIT; } {1 2} #------------------------------------------------------------------------- # reset_db do_execsql_test 4.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, detail=none); BEGIN; INSERT INTO t1 VALUES('a1 b1 c1'); INSERT INTO t1 VALUES('a2 b2 c2'); INSERT INTO t1 VALUES('a3 b3 c3'); COMMIT; } do_execsql_test 4.1 { SELECT rowid FROM t1('b*'); } {1 2 3} #------------------------------------------------------------------------- # reset_db do_execsql_test 5.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, detail=none); BEGIN; INSERT INTO t1 VALUES('a1 b1 c1'); INSERT INTO t1 VALUES('a2 b2 c2'); INSERT INTO t1 VALUES('a1 b1 c1'); COMMIT; } do_execsql_test 5.1 { SELECT rowid FROM t1('b*') } {1 2 3} #------------------------------------------------------------------------- # reset_db do_execsql_test 6.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, detail=full); BEGIN; INSERT INTO t1 VALUES('a1 b1 c1'); INSERT INTO t1 VALUES('a1 b1 c1'); INSERT INTO t1 VALUES('a1 b1 c1'); COMMIT; } do_execsql_test 6.1 { SELECT rowid FROM t1('a1') ORDER BY rowid DESC } {3 2 1} do_execsql_test 6.2 { SELECT rowid FROM t1('b1') ORDER BY rowid DESC } {3 2 1} do_execsql_test 6.3 { SELECT rowid FROM t1('c1') ORDER BY rowid DESC } {3 2 1} #------------------------------------------------------------------------- # reset_db do_execsql_test 7.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, detail=none); BEGIN; INSERT INTO t1 VALUES('a1 b1'); INSERT INTO t1 VALUES('a1 b2'); COMMIT; } do_execsql_test 7.1 { SELECT rowid FROM t1('b*') ORDER BY rowid DESC } {2 1} do_execsql_test 7.2 { SELECT rowid FROM t1('a1') ORDER BY rowid DESC } {2 1} #------------------------------------------------------------------------- # reset_db do_execsql_test 8.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, detail=none); INSERT INTO t1 VALUES('a1 b1 c1'); INSERT INTO t1 VALUES('a2 b2 c2'); INSERT INTO t1 VALUES('a1 b1 c1'); } do_execsql_test 8.0.1 { SELECT rowid FROM t1('b*') } {1 2 3} do_execsql_test 8.0.2 { SELECT rowid FROM t1('a1') } {1 3} do_execsql_test 8.0.3 { SELECT rowid FROM t1('c2') } {2} do_execsql_test 8.0.4 { SELECT rowid FROM t1('b*') ORDER BY rowid DESC } {3 2 1} do_execsql_test 8.0.5 { SELECT rowid FROM t1('a1') ORDER BY rowid DESC } {3 1} do_execsql_test 8.0.8 { SELECT rowid FROM t1('c2') ORDER BY rowid DESC } {2} do_execsql_test 8.1.0 { INSERT INTO t1(t1) VALUES('optimize') } do_execsql_test 8.1.1 { SELECT rowid FROM t1('b*') } {1 2 3} do_execsql_test 8.1.2 { SELECT rowid FROM t1('a1') } {1 3} do_execsql_test 8.1.3 { SELECT rowid FROM t1('c2') } {2} do_execsql_test 8.2.1 { SELECT rowid FROM t1('b*') ORDER BY rowid DESC} {3 2 1} do_execsql_test 8.2.2 { SELECT rowid FROM t1('a1') ORDER BY rowid DESC} {3 1} do_execsql_test 8.2.3 { SELECT rowid FROM t1('c2') ORDER BY rowid DESC} {2} #-------------------------------------------------------------------------- # reset_db do_execsql_test 9.0.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, detail=none); INSERT INTO t1 VALUES('a1 b1 c1'); INSERT INTO t1 VALUES('a2 b2 c2'); INSERT INTO t1 VALUES('a1 b1 c1'); } do_execsql_test 9.0.1 { INSERT INTO t1(t1) VALUES('integrity-check'); } {} reset_db do_execsql_test 9.1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, detail=none); INSERT INTO t1 VALUES('a1 b1 c1', 'x y z'); INSERT INTO t1 VALUES('a2 b2 c2', '1 2 3'); INSERT INTO t1 VALUES('a1 b1 c1', 'x 2 z'); } do_execsql_test 9.2.1 { INSERT INTO t1(t1) VALUES('integrity-check'); } {} #-------------------------------------------------------------------------- # reset_db do_execsql_test 10.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, detail=none); INSERT INTO t1 VALUES('b1'); INSERT INTO t1 VALUES('b1'); DELETE FROM t1 WHERE rowid=1; } do_execsql_test 10.1 { SELECT rowid FROM t1('b1'); } {2} do_execsql_test 10.2 { SELECT rowid FROM t1('b1') ORDER BY rowid DESC; } {2} do_execsql_test 10.3 { INSERT INTO t1(t1) VALUES('integrity-check'); } {} #-------------------------------------------------------------------------- # reset_db do_execsql_test 11.1 { CREATE VIRTUAL TABLE t1 USING fts5(x, y, detail=none); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); WITH d(x,y) AS ( SELECT NULL, 'xyz' UNION ALL SELECT NULL, 'xyz' FROM d ) INSERT INTO t1 SELECT * FROM d LIMIT 23; } #db eval { SELECT rowid AS r, quote(block) AS b FROM t1_data } { puts "$r: $b" } do_execsql_test 11.2 { SELECT rowid FROM t1; } {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23} do_execsql_test 11.3 { SELECT rowid FROM t1('xyz'); } {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23} do_execsql_test 11.4 { INSERT INTO t1(t1) VALUES('integrity-check'); } #------------------------------------------------------------------------- # reset_db do_execsql_test 12.0 { CREATE VIRTUAL TABLE yy USING fts5(x, detail=none); INSERT INTO yy VALUES('in if'); INSERT INTO yy VALUES('if'); } {} do_execsql_test 12.1 { SELECT rowid FROM yy('i*'); } {1 2} #------------------------------------------------------------------------- # reset_db do_execsql_test 13.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, prefix=1, detail=none); } {} foreach {rowid a} { 0 {f} 1 {u} 2 {k} 3 {a} 4 {a} 5 {u} 6 {u} 7 {u} 8 {f} 9 {f} 10 {a} 11 {p} 12 {f} 13 {u} 14 {a} 15 {a} } { do_execsql_test 13.1.$rowid { INSERT INTO t1(rowid, a) VALUES($rowid, $a); } } #------------------------------------------------------------------------- # reset_db fts5_aux_test_functions db do_execsql_test 14.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, detail=none); INSERT INTO t1 VALUES('a b c d'); } {} do_execsql_test 14.1 { SELECT fts5_test_poslist(t1) FROM t1('b') ORDER BY rank; } {0.0.1} #------------------------------------------------------------------------- # reset_db do_execsql_test 15.1 { CREATE VIRTUAL TABLE t1 USING fts5(x, detail=none); BEGIN; INSERT INTO t1(rowid, x) VALUES(1, 'sqlite'); INSERT INTO t1(rowid, x) VALUES(2, 'sqlite'); COMMIT; } {} do_test 15.1 { execsql { INSERT INTO t1(t1) VALUES('integrity-check') } } {} do_test 15.2 { execsql { DELETE FROM t1 } } {} do_execsql_test 15.3.1 { SELECT rowid FROM t1('sqlite'); } {} do_execsql_test 15.3.2 { SELECT rowid FROM t1('sqlite') ORDER BY rowid DESC; } {} do_test 15.4 { execsql { INSERT INTO t1(t1) VALUES('integrity-check') } } {} #------------------------------------------------------------------------- # reset_db do_execsql_test 16.0 { CREATE VIRTUAL TABLE t2 USING fts5(x, detail=none); BEGIN; INSERT INTO t2(rowid, x) VALUES(1, 'a b c'); INSERT INTO t2(rowid, x) VALUES(456, 'a b c'); INSERT INTO t2(rowid, x) VALUES(1000, 'a b c'); COMMIT; UPDATE t2 SET x=x; } do_execsql_test 16.1 { INSERT INTO t2(t2) VALUES('integrity-check'); } {} do_execsql_test 16.2 { SELECT rowid FROM t2('b') ORDER BY rowid DESC } {1000 456 1} #------------------------------------------------------------------------- # reset_db do_execsql_test 16.0 { CREATE VIRTUAL TABLE t2 USING fts5(x, detail=none); BEGIN; INSERT INTO t2(rowid, x) VALUES(1, 'a b c'); INSERT INTO t2(rowid, x) VALUES(456, 'a b c'); INSERT INTO t2(rowid, x) VALUES(1000, 'a b c'); COMMIT; UPDATE t2 SET x=x; DELETE FROM t2; } #------------------------------------------------------------------------- # reset_db do_execsql_test 17.0 { CREATE VIRTUAL TABLE t2 USING fts5(x, y); BEGIN; INSERT INTO t2 VALUES('a aa aaa', 'b bb bbb'); INSERT INTO t2 VALUES('a aa aaa', 'b bb bbb'); INSERT INTO t2 VALUES('a aa aaa', 'b bb bbb'); COMMIT; } do_execsql_test 17.1 { SELECT * FROM t2('y:a*') WHERE rowid BETWEEN 10 AND 20 } do_execsql_test 17.2 { BEGIN; INSERT INTO t2 VALUES('a aa aaa', 'b bb bbb'); SELECT * FROM t2('y:a*') WHERE rowid BETWEEN 10 AND 20 ; } do_execsql_test 17.3 { COMMIT } reset_db do_execsql_test 17.4 { CREATE VIRTUAL TABLE t2 USING fts5(x, y); BEGIN; INSERT INTO t2 VALUES('a aa aaa', 'b bb bbb'); INSERT INTO t2 VALUES('a aa aaa', 'b bb bbb'); SELECT * FROM t2('y:a*') WHERE rowid>66; } do_execsql_test 17.5 { SELECT * FROM t2('x:b* OR y:a*') } do_execsql_test 17.5 { COMMIT ; SELECT * FROM t2('x:b* OR y:a*') } do_execsql_test 17.6 { SELECT * FROM t2('x:b* OR y:a*') WHERE rowid>55 } #db eval {SELECT rowid, fts5_decode_none(rowid, block) aS r FROM t2_data} {puts $r} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5simple3.test ================================================ # 2015 September 05 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5simple3 # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } fts5_aux_test_functions db do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, c, detail=col); INSERT INTO t1 VALUES('a', 'b', 'c'); INSERT INTO t1 VALUES('x', 'x', 'x'); } do_execsql_test 1.1 { SELECT rowid, fts5_test_collist(t1) FROM t1('a:a'); } {1 0.0} do_execsql_test 1.2 { SELECT rowid, fts5_test_collist(t1) FROM t1('b:x'); } {2 0.1} do_execsql_test 1.3 { SELECT rowid, fts5_test_collist(t1) FROM t1('b:a'); } {} #------------------------------------------------------------------------- # Create detail=col and detail=full tables with 998 columns. # foreach_detail_mode $testprefix { if {[detail_is_none]} continue do_test 2.1 { execsql { DROP TABLE IF EXISTS t2 } set cols [list] set vals [list] for {set i 1} {$i <= 998} {incr i} { lappend cols "c$i" lappend vals "'val$i'" } execsql "CREATE VIRTUAL TABLE t2 USING fts5(detail=%DETAIL%,[join $cols ,])" } {} do_test 2.2 { execsql "INSERT INTO t2 VALUES([join $vals ,])" } {} foreach {tn q res} { 1 { c1:val1 } 1 2 { c300:val300 } 1 3 { c300:val1 } {} 4 { c1:val300 } {} } { do_execsql_test 2.3.$tn { SELECT rowid FROM t2($q) } $res } } do_execsql_test 3.0 { CREATE VIRTUAL TABLE x3 USING fts5(one); INSERT INTO x3 VALUES('a b c'); INSERT INTO x3 VALUES('c b a'); INSERT INTO x3 VALUES('o t t'); SELECT * FROM x3('x OR y OR z'); } #------------------------------------------------------------------------- # Test that a crash occuring when the second or subsequent tokens in a # phrase matched zero rows has been fixed. # do_execsql_test 4.0 { CREATE VIRTUAL TABLE t1 USING fts5(x); INSERT INTO t1 VALUES('ab'); INSERT INTO t1 VALUES('cd'); INSERT INTO t1 VALUES('ab cd'); INSERT INTO t1 VALUES('ab cdXXX'); INSERT INTO t1 VALUES('abXXX cd'); } do_execsql_test 4.1 { SELECT * FROM t1('"ab cd" OR "ab cd" *'); } {{ab cd} {ab cdXXX}} do_execsql_test 4.2 { SELECT * FROM t1('"xy zz" OR "ab cd" *'); } {{ab cd} {ab cdXXX}} do_execsql_test 4.3 { SELECT * FROM t1('"xy zz" OR "xy zz" *'); } do_execsql_test 4.4 { SELECT * FROM t1('"ab cd" OR "xy zz" *'); } {{ab cd}} do_execsql_test 4.5 { CREATE VIRTUAL TABLE t2 USING fts5(x); INSERT INTO t2 VALUES('ab'); INSERT INTO t2 VALUES('cd'); INSERT INTO t2 VALUES('ef'); } do_execsql_test 4.6 { SELECT * FROM t2('ab + xyz'); } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5synonym.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests focusing on custom tokenizers that support synonyms. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5synonym # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } proc tcl_create {args} { return "tcl_tokenize" } foreach_detail_mode $testprefix { #------------------------------------------------------------------------- # Warm body test for the code in fts5_tcl.c. # fts5_tclnum_register db do_execsql_test 1.0 { CREATE VIRTUAL TABLE ft USING fts5(x, tokenize = "tclnum document", detail=%DETAIL%); INSERT INTO ft VALUES('abc def ghi'); INSERT INTO ft VALUES('jkl mno pqr'); SELECT rowid, x FROM ft WHERE ft MATCH 'def'; SELECT x, rowid FROM ft WHERE ft MATCH 'pqr'; } {1 {abc def ghi} {jkl mno pqr} 2} #------------------------------------------------------------------------- # Test a tokenizer that supports synonyms by adding extra entries to the # FTS index. # reset_db fts5_tclnum_register db do_execsql_test 2.0 { CREATE VIRTUAL TABLE ft USING fts5( x, tokenize = "tclnum document", detail=%DETAIL% ); INSERT INTO ft VALUES('one two three'); INSERT INTO ft VALUES('four five six'); INSERT INTO ft VALUES('eight nine ten'); } {} foreach {tn expr res} { 1 "3" 1 2 "eight OR 8 OR 5" {2 3} 3 "10" {} 4 "1*" {1} 5 "1 + 2" {1} } { if {![fts5_expr_ok $expr ft]} continue do_execsql_test 2.1.$tn { SELECT rowid FROM ft WHERE ft MATCH $expr } $res } #------------------------------------------------------------------------- # Test some broken tokenizers: # # 3.1.*: A tokenizer that declares the very first token to be colocated. # # 3.2.*: A tokenizer that reports two identical tokens at the same position. # This is allowed. # reset_db sqlite3_fts5_create_tokenizer db tcl tcl_create proc tcl_tokenize {tflags text} { set bColo 1 foreach {w iStart iEnd} [fts5_tokenize_split $text] { if {$bColo} { sqlite3_fts5_token -colo $w $iStart $iEnd set bColo 0 } { sqlite3_fts5_token $w $iStart $iEnd } } } do_execsql_test 3.1.0 { CREATE VIRTUAL TABLE ft USING fts5(x, tokenize = tcl); INSERT INTO ft VALUES('one two three'); CREATE VIRTUAL TABLE vv USING fts5vocab(ft, row); SELECT * FROM vv; } { one 1 1 three 1 1 two 1 1 } do_execsql_test 3.1.1 { INSERT INTO ft(ft) VALUES('integrity-check'); } {} proc tcl_tokenize {tflags text} { foreach {w iStart iEnd} [fts5_tokenize_split $text] { sqlite3_fts5_token $w $iStart $iEnd } } do_execsql_test 3.1.2 { SELECT rowid FROM ft WHERE ft MATCH 'one two three' } {1} reset_db sqlite3_fts5_create_tokenizer db tcl tcl_create proc tcl_tokenize {tflags text} { foreach {w iStart iEnd} [fts5_tokenize_split $text] { sqlite3_fts5_token $w $iStart $iEnd sqlite3_fts5_token -colo $w $iStart $iEnd } } do_execsql_test 3.2.0 { CREATE VIRTUAL TABLE ft USING fts5(x, tokenize = tcl); INSERT INTO ft VALUES('one one two three'); CREATE VIRTUAL TABLE vv USING fts5vocab(ft, row); SELECT * FROM vv; } { one 1 4 three 1 2 two 1 2 } do_execsql_test 3.2.1 { SELECT rowid FROM ft WHERE ft MATCH 'one'; } {1} do_execsql_test 3.2.2 { SELECT rowid FROM ft WHERE ft MATCH 'one two three'; } {1} do_execsql_test 3.2.3 { SELECT rowid FROM ft WHERE ft MATCH 'one + one + two + three'; } {1} do_execsql_test 3.2.4 { SELECT rowid FROM ft WHERE ft MATCH 'one two two three'; } {1} do_execsql_test 3.2.5 { SELECT rowid FROM ft WHERE ft MATCH 'one + two + two + three'; } {} #------------------------------------------------------------------------- # Check that expressions with synonyms can be parsed and executed. # reset_db fts5_tclnum_register db foreach {tn expr res} { 1 {abc} {"abc"} 2 {one} {"one"|"i"|"1"} 3 {3} {"3"|"iii"|"three"} 4 {3*} {"3" *} } { do_execsql_test 4.1.$tn { SELECT fts5_expr($expr, 'tokenize=tclnum') } [list $res] } do_execsql_test 4.2.1 { CREATE VIRTUAL TABLE xx USING fts5(x, tokenize=tclnum, detail=%DETAIL%); INSERT INTO xx VALUES('one two'); INSERT INTO xx VALUES('three four'); } do_execsql_test 4.2.2 { SELECT rowid FROM xx WHERE xx MATCH '2' } {1} do_execsql_test 4.2.3 { SELECT rowid FROM xx WHERE xx MATCH '3' } {2} do_test 5.0 { execsql { CREATE VIRTUAL TABLE t1 USING fts5(a, b, tokenize=tclnum, detail=%DETAIL%) } foreach {rowid a b} { 1 {four v 4 i three} {1 3 five five 4 one} 2 {5 1 3 4 i} {2 2 v two 4} 3 {5 i 5 2 four 4 1} {iii ii five two 1} 4 {ii four 4 one 5 three five} {one 5 1 iii 4 3} 5 {three i v i four 4 1} {ii five five five iii} 6 {4 2 ii two 2 iii} {three 1 four 4 iv 1 iv} 7 {ii ii two three 2 5} {iii i ii iii iii one one} 8 {2 ii i two 3 three 2} {two iv v iii 3 five} 9 {i 2 iv 3 five four v} {iii 4 three i three ii 1} } { execsql { INSERT INTO t1(rowid, a, b) VALUES($rowid, $a, $b) } } } {} foreach {tn q res} { 1 {one} { 1 {four v 4 [i] three} {[1] 3 five five 4 [one]} 2 {5 [1] 3 4 [i]} {2 2 v two 4} 3 {5 [i] 5 2 four 4 [1]} {iii ii five two [1]} 4 {ii four 4 [one] 5 three five} {[one] 5 [1] iii 4 3} 5 {three [i] v [i] four 4 [1]} {ii five five five iii} 6 {4 2 ii two 2 iii} {three [1] four 4 iv [1] iv} 7 {ii ii two three 2 5} {iii [i] ii iii iii [one] [one]} 8 {2 ii [i] two 3 three 2} {two iv v iii 3 five} 9 {[i] 2 iv 3 five four v} {iii 4 three [i] three ii [1]} } 2 {five four} { 1 {[four] [v] [4] i three} {1 3 [five] [five] [4] one} 2 {[5] 1 3 [4] i} {2 2 [v] two [4]} 3 {[5] i [5] 2 [four] [4] 1} {iii ii [five] two 1} 4 {ii [four] [4] one [5] three [five]} {one [5] 1 iii [4] 3} 5 {three i [v] i [four] [4] 1} {ii [five] [five] [five] iii} 8 {2 ii i two 3 three 2} {two [iv] [v] iii 3 [five]} 9 {i 2 [iv] 3 [five] [four] [v]} {iii [4] three i three ii 1} } 3 {one OR two OR iii OR 4 OR v} { 1 {[four] [v] [4] [i] [three]} {[1] [3] [five] [five] [4] [one]} 2 {[5] [1] [3] [4] [i]} {[2] [2] [v] [two] [4]} 3 {[5] [i] [5] [2] [four] [4] [1]} {[iii] [ii] [five] [two] [1]} 4 {[ii] [four] [4] [one] [5] [three] [five]} {[one] [5] [1] [iii] [4] [3]} 5 {[three] [i] [v] [i] [four] [4] [1]} {[ii] [five] [five] [five] [iii]} 6 {[4] [2] [ii] [two] [2] [iii]} {[three] [1] [four] [4] [iv] [1] [iv]} 7 {[ii] [ii] [two] [three] [2] [5]} {[iii] [i] [ii] [iii] [iii] [one] [one]} 8 {[2] [ii] [i] [two] [3] [three] [2]} {[two] [iv] [v] [iii] [3] [five]} 9 {[i] [2] [iv] [3] [five] [four] [v]} {[iii] [4] [three] [i] [three] [ii] [1]} } 4 {5 + 1} { 2 {[5 1] 3 4 i} {2 2 v two 4} 3 {[5 i] 5 2 four 4 1} {iii ii five two 1} 4 {ii four 4 one 5 three five} {one [5 1] iii 4 3} 5 {three i [v i] four 4 1} {ii five five five iii} } 5 {one + two + three} { 7 {ii ii two three 2 5} {iii [i ii iii] iii one one} 8 {2 ii [i two 3] three 2} {two iv v iii 3 five} } 6 {"v v"} { 1 {four v 4 i three} {1 3 [five five] 4 one} 5 {three i v i four 4 1} {ii [five five five] iii} } } { if {![fts5_expr_ok $q t1]} continue do_execsql_test 5.1.$tn { SELECT rowid, highlight(t1, 0, '[', ']'), highlight(t1, 1, '[', ']') FROM t1 WHERE t1 MATCH $q } $res } # Test that the xQueryPhrase() API works with synonyms. # proc mit {blob} { set scan(littleEndian) i* set scan(bigEndian) I* binary scan $blob $scan($::tcl_platform(byteOrder)) r return $r } db func mit mit sqlite3_fts5_register_matchinfo db foreach {tn q res} { 1 {one} { 1 {1 11 7 2 12 6} 2 {2 11 7 0 12 6} 3 {2 11 7 1 12 6} 4 {1 11 7 2 12 6} 5 {3 11 7 0 12 6} 6 {0 11 7 2 12 6} 7 {0 11 7 3 12 6} 8 {1 11 7 0 12 6} 9 {1 11 7 2 12 6} } } { do_execsql_test 5.2.$tn { SELECT rowid, mit(matchinfo(t1, 'x')) FROM t1 WHERE t1 MATCH $q } $res } #------------------------------------------------------------------------- # Test terms with more than 4 synonyms. # reset_db sqlite3_fts5_create_tokenizer db tcl tcl_create proc tcl_tokenize {tflags text} { foreach {w iStart iEnd} [fts5_tokenize_split $text] { sqlite3_fts5_token $w $iStart $iEnd if {$tflags=="query" && [string length $w]==1} { for {set i 2} {$i<=10} {incr i} { sqlite3_fts5_token -colo [string repeat $w $i] $iStart $iEnd } } } } do_execsql_test 6.0.1 { CREATE VIRTUAL TABLE t1 USING fts5(x, tokenize=tcl, detail=%DETAIL%); INSERT INTO t1 VALUES('yy xx qq'); INSERT INTO t1 VALUES('yy xx xx'); } if {[fts5_expr_ok "NEAR(y q)" t1]} { do_execsql_test 6.0.2 { SELECT * FROM t1 WHERE t1 MATCH 'NEAR(y q)'; } {{yy xx qq}} } do_test 6.0.3 { execsql { CREATE VIRTUAL TABLE t2 USING fts5(a, b, tokenize=tcl, detail=%DETAIL%) } foreach {rowid a b} { 1 {yyyy vvvvv qq oo yyyyyy vvvv eee} {ffff uu r qq aaaa} 2 {ww oooooo bbbbb ssssss mm} {ffffff yy iiii rr s ccc qqqqq} 3 {zzzz llll gggggg cccc uu} {hhhhhh aaaa ppppp rr ee jjjj} 4 {r f i rrrrrr ww hhh} {aa yyy t x aaaaa ii} 5 {fffff mm vvvv ooo ffffff kkkk tttt} {cccccc bb e zzz d n} 6 {iii dddd hh qqqq ddd ooo} {ttt d c b aaaaaa qqqq} 7 {jjjj rrrr v zzzzz u tt t} {ppppp pp dddd mm hhh uuu} 8 {gggg rrrrrr kkkk vvvv gggg jjjjjj b} {dddddd jj r w cccc wwwwww ss} 9 {kkkkk qqq oooo e tttttt mmm} {e ss qqqqqq hhhh llllll gg} } { execsql { INSERT INTO t2(rowid, a, b) VALUES($rowid, $a, $b) } } } {} foreach {tn q res} { 1 {a} { 1 {yyyy vvvvv qq oo yyyyyy vvvv eee} {ffff uu r qq [aaaa]} 3 {zzzz llll gggggg cccc uu} {hhhhhh [aaaa] ppppp rr ee jjjj} 4 {r f i rrrrrr ww hhh} {[aa] yyy t x [aaaaa] ii} 6 {iii dddd hh qqqq ddd ooo} {ttt d c b [aaaaaa] qqqq} } 2 {a AND q} { 1 {yyyy vvvvv [qq] oo yyyyyy vvvv eee} {ffff uu r [qq] [aaaa]} 6 {iii dddd hh [qqqq] ddd ooo} {ttt d c b [aaaaaa] [qqqq]} } 3 {o OR (q AND a)} { 1 {yyyy vvvvv [qq] [oo] yyyyyy vvvv eee} {ffff uu r [qq] [aaaa]} 2 {ww [oooooo] bbbbb ssssss mm} {ffffff yy iiii rr s ccc qqqqq} 5 {fffff mm vvvv [ooo] ffffff kkkk tttt} {cccccc bb e zzz d n} 6 {iii dddd hh [qqqq] ddd [ooo]} {ttt d c b [aaaaaa] [qqqq]} 9 {kkkkk qqq [oooo] e tttttt mmm} {e ss qqqqqq hhhh llllll gg} } 4 {NEAR(q y, 20)} { 1 {[yyyy] vvvvv [qq] oo [yyyyyy] vvvv eee} {ffff uu r qq aaaa} 2 {ww oooooo bbbbb ssssss mm} {ffffff [yy] iiii rr s ccc [qqqqq]} } } { if {![fts5_expr_ok $q t2]} continue do_execsql_test 6.1.$tn.asc { SELECT rowid, highlight(t2, 0, '[', ']'), highlight(t2, 1, '[', ']') FROM t2 WHERE t2 MATCH $q } $res set res2 [list] foreach {rowid a b} $res { set res2 [concat [list $rowid $a $b] $res2] } do_execsql_test 6.1.$tn.desc { SELECT rowid, highlight(t2, 0, '[', ']'), highlight(t2, 1, '[', ']') FROM t2 WHERE t2 MATCH $q ORDER BY rowid DESC } $res2 } do_execsql_test 6.2.1 { INSERT INTO t2(rowid, a, b) VALUES(13, 'x xx xxx xxxx xxxxx xxxxxx xxxxxxx', 'y yy yyy yyyy yyyyy yyyyyy yyyyyyy' ); SELECT rowid, highlight(t2, 0, '<', '>'), highlight(t2, 1, '(', ')') FROM t2 WHERE t2 MATCH 'x OR y' } { 1 { vvvvv qq oo vvvv eee} {ffff uu r qq aaaa} 2 {ww oooooo bbbbb ssssss mm} {ffffff (yy) iiii rr s ccc qqqqq} 4 {r f i rrrrrr ww hhh} {aa (yyy) t (x) aaaaa ii} 13 { } {(y) (yy) (yyy) (yyyy) (yyyyy) (yyyyyy) (yyyyyyy)} } #------------------------------------------------------------------------- # Test that the xColumnSize() API is not confused by colocated tokens. # reset_db sqlite3_fts5_create_tokenizer db tcl tcl_create fts5_aux_test_functions db proc tcl_tokenize {tflags text} { foreach {w iStart iEnd} [fts5_tokenize_split $text] { sqlite3_fts5_token $w $iStart $iEnd if {[string length $w]==1} { for {set i 2} {$i<=10} {incr i} { sqlite3_fts5_token -colo [string repeat $w $i] $iStart $iEnd } } } } do_execsql_test 7.0.1 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, columnsize=1, tokenize=tcl, detail=%DETAIL%); INSERT INTO t1 VALUES('0 2 3', '4 5 6 7'); INSERT INTO t1 VALUES('8 9', '0 0 0 0 0 0 0 0 0 0'); SELECT fts5_test_columnsize(t1) FROM t1 WHERE t1 MATCH '000 AND 00 AND 0'; } {{3 4} {2 10}} do_execsql_test 7.0.2 { INSERT INTO t1(t1) VALUES('integrity-check'); } do_execsql_test 7.1.1 { CREATE VIRTUAL TABLE t2 USING fts5(a, b, columnsize=0, tokenize=tcl, detail=%DETAIL%); INSERT INTO t2 VALUES('0 2 3', '4 5 6 7'); INSERT INTO t2 VALUES('8 9', '0 0 0 0 0 0 0 0 0 0'); SELECT fts5_test_columnsize(t2) FROM t2 WHERE t2 MATCH '000 AND 00 AND 0'; } {{3 4} {2 10}} do_execsql_test 7.1.2 { INSERT INTO t2(t2) VALUES('integrity-check'); } } ;# foreach_detail_mode finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5synonym2.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests focusing on custom tokenizers that support synonyms. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5synonym2 # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach tok {query document} { foreach_detail_mode $testprefix { fts5_tclnum_register db fts5_aux_test_functions db proc fts5_test_bothlist {cmd} { for {set i 0} {$i < [$cmd xPhraseCount]} {incr i} { set bFirst 1 $cmd xPhraseColumnForeach $i c { lappend CL $i.$c if {$bFirst} { $cmd xPhraseForeach $i c o { lappend PL $i.$c.$o } } set bFirst 0 } } list [sort_poslist $PL] $CL } sqlite3_fts5_create_function db fts5_test_bothlist fts5_test_bothlist proc fts5_rowid {cmd} { expr [$cmd xColumnText -1] } sqlite3_fts5_create_function db fts5_rowid fts5_rowid do_execsql_test 1.$tok.0.1 " CREATE VIRTUAL TABLE ss USING fts5(a, b, tokenize='tclnum $tok', detail=%DETAIL%); INSERT INTO ss(ss, rank) VALUES('rank', 'fts5_rowid()'); " do_execsql_test 1.$tok.0.2 { INSERT INTO ss VALUES('5 5 five seven 3 seven i', '2 1 5 0 two 1 i'); INSERT INTO ss VALUES('six ix iii 7 i vii iii', 'one seven nine 4 9 1 vi'); INSERT INTO ss VALUES('6 viii i five six zero seven', '5 v iii iv iv 3'); INSERT INTO ss VALUES('9 ii six 8 1 6', 'six 4 iv iv 7'); INSERT INTO ss VALUES('1 5 4 eight ii iv iii', 'nine 2 eight ix v vii'); INSERT INTO ss VALUES('one 7 seven six 2 two', '1 2 four 7 4 3 4'); INSERT INTO ss VALUES('eight iv 4 nine vii six 1', '5 6 v one zero 4'); INSERT INTO ss VALUES('v 9 8 iii 4', '9 4 seven two vi vii'); INSERT INTO ss VALUES('3 ix two 9 0 nine i', 'five ii nine two viii i five'); INSERT INTO ss VALUES('six iii 9 two eight 2', 'nine i nine vii nine'); INSERT INTO ss VALUES('6 three zero seven vii five', '8 vii ix 0 7 seven'); INSERT INTO ss VALUES('8 vii 8 7 3 4', 'eight iii four viii nine iv three'); INSERT INTO ss VALUES('4 v 7 two 0 one 8', 'vii 1 two five i zero 9'); INSERT INTO ss VALUES('3 ii vii vi eight', '8 4 ix one three eight'); INSERT INTO ss VALUES('iv eight seven 6 9 seven', 'one vi two five seven'); INSERT INTO ss VALUES('i i 5 i v vii eight', '2 seven i 2 2 four'); INSERT INTO ss VALUES('0 i iii nine 3 ix five', '0 eight iv 0 six 2'); INSERT INTO ss VALUES('iv vii three 3 9 one 8', '2 ii 6 eight ii six six'); INSERT INTO ss VALUES('eight one two nine six', '8 9 3 viii vi'); INSERT INTO ss VALUES('one 0 four ii eight one 3', 'iii eight vi vi vi'); INSERT INTO ss VALUES('4 0 eight 0 0', '1 four one vii seven ii'); INSERT INTO ss VALUES('1 zero nine 2 2', 'viii iv two vi nine v iii'); INSERT INTO ss VALUES('5 five viii four four vi', '8 five 7 vii 6 4'); INSERT INTO ss VALUES('7 ix four 8 vii', 'nine three nine ii ix vii'); INSERT INTO ss VALUES('nine iv v i 0 v', 'two iv vii six i ix 4'); INSERT INTO ss VALUES('one v v one viii 3 8', '2 1 3 five iii'); INSERT INTO ss VALUES('six ii 5 nine 4 viii seven', 'eight i ix ix 7 four'); INSERT INTO ss VALUES('9 ii two seven three 7 0', 'six viii seven 7 five'); INSERT INTO ss VALUES('five two 4 viii nine', '9 7 nine zero 1 two one'); INSERT INTO ss VALUES('viii 8 iii i ii 8 3', '4 2 7 v 8 8'); INSERT INTO ss VALUES('four vii 4 iii zero 0 vii', '3 viii iii zero 9 i'); INSERT INTO ss VALUES('0 seven v five i five v', 'one 4 2 ix 9'); INSERT INTO ss VALUES('two 5 two two ix 4 1', '3 nine ii v nine 3 five'); INSERT INTO ss VALUES('five 5 7 4 6 vii', 'three 2 ix 2 8 6'); INSERT INTO ss VALUES('six iii vi iv seven eight', '8 six 7 0 4'); INSERT INTO ss VALUES('vi vi iv 3 0 one one', '9 6 eight ix iv'); INSERT INTO ss VALUES('7 2 2 iii 0', '0 0 seven 1 nine'); INSERT INTO ss VALUES('8 6 iv six ii', 'iv 6 3 4 ii five'); INSERT INTO ss VALUES('0 two two seven ii', 'vii ix four 4 zero vi vi'); INSERT INTO ss VALUES('2 one eight 8 9 7', 'vi 3 0 3 vii'); INSERT INTO ss VALUES('iii ii ix iv three', 'vi i 6 1 two'); INSERT INTO ss VALUES('eight four nine 8 seven', 'one three i nine iii one'); INSERT INTO ss VALUES('iii seven five ix 8', 'ii 7 seven 0 four ii'); INSERT INTO ss VALUES('four 0 1 5 two', 'iii 9 5 ii ii 2 4'); INSERT INTO ss VALUES('iii nine four vi 8 five six', 'i i ii seven vi vii'); INSERT INTO ss VALUES('eight vii eight six 3', 'i vii 1 six 9 vii'); INSERT INTO ss VALUES('9 0 viii viii five', 'i 1 viii ix 3 4'); INSERT INTO ss VALUES('three nine 5 nine viii four zero', 'ii i 1 5 2 viii'); INSERT INTO ss VALUES('5 vii three 9 four', 'three five one 7 2 eight one'); } foreach {tn expr} { 2.1 "one OR two OR three OR four" 1.1 "one" 1.2 "two" 1.3 "three" 1.4 "four" 1.5 "v" 1.6 "vi" 1.7 "vii" 1.8 "viii" 1.9 "9" 1.10 "0" 1.11 "1" 1.12 "2" 2.1 "one OR two OR three OR four" 2.2 "(one AND two) OR (three AND four)" 2.3 "(one AND two) OR (three AND four) NOT five" 2.4 "(one AND two) NOT 6" 3.1 "b:one AND a:two" 3.2 "b:one OR a:two" 3.3 "a:one OR b:1 OR {a b} : i" 4.1 "NEAR(one two, 2)" 4.2 "NEAR(one two three, 2)" 4.3 "NEAR(eight nine, 1) OR NEAR(six seven, 1)" } { if {[fts5_expr_ok $expr ss]==0} { do_test 1.$tok.$tn.OMITTED { list } [list] continue } set res [fts5_query_data $expr ss ASC ::tclnum_syn] do_execsql_test 1.$tok.$tn.[llength $res].asc.1 { SELECT rowid, fts5_test_poslist2(ss), fts5_test_collist(ss) FROM ss($expr) } $res do_execsql_test 1.$tok.$tn.[llength $res].asc.2 { SELECT rowid, fts5_test_poslist(ss), fts5_test_collist(ss) FROM ss($expr) } $res do_execsql_test 1.$tok.$tn.[llength $res].asc.2 { SELECT rowid, fts5_test_poslist2(ss), fts5_test_collist(ss) FROM ss($expr) ORDER BY rank ASC } $res set res2 [list] foreach {a b c} $res { lappend res2 $a $c $b } do_execsql_test 1.$tok.$tn.[llength $res].asc.3 { SELECT rowid, fts5_test_collist(ss), fts5_test_poslist2(ss) FROM ss($expr) } $res2 set res3 [list] foreach {a b c} $res { lappend res3 $a [list $b $c] } do_execsql_test 1.$tok.$tn.[llength $res].asc.3 { SELECT rowid, fts5_test_bothlist(ss) FROM ss($expr) } $res3 } } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5tok1.test ================================================ # 2016 Jan 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # source [file join [file dirname [info script]] fts5_common.tcl] ifcapable !fts5 { finish_test ; return } set ::testprefix fts5tok1 sqlite3_fts5_register_fts5tokenize db #------------------------------------------------------------------------- # Simple test cases. Using the default (ascii) tokenizer. # do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5tokenize(ascii); CREATE VIRTUAL TABLE t2 USING fts5tokenize(); CREATE VIRTUAL TABLE t3 USING fts5tokenize( ascii, 'separators', 'xyz', tokenchars, '''' ); } foreach {tn tbl} {1 t1 2 t2 3 t3} { do_execsql_test 1.$tn.1 "SELECT input, * FROM $tbl ('one two three')" { {one two three} one 0 3 0 {one two three} two 4 7 1 {one two three} three 8 13 2 } do_execsql_test 1.$tn.2 " SELECT token FROM $tbl WHERE input = 'OnE tWo tHrEe' " { one two three } } do_execsql_test 1.4 { SELECT token FROM t3 WHERE input = '1x2x3x' } {1 2 3} do_execsql_test 1.5 { SELECT token FROM t1 WHERE input = '1x2x3x' } {1x2x3x} do_execsql_test 1.6 { SELECT token FROM t3 WHERE input = '1''2x3x' } {1'2 3} do_execsql_test 1.7 { SELECT token FROM t3 WHERE input = '' } {} do_execsql_test 1.8 { SELECT token FROM t3 WHERE input = NULL } {} do_execsql_test 1.9 { SELECT input, * FROM t3 WHERE input = 123 } {123 123 0 3 0} do_execsql_test 1.10 { SELECT input, * FROM t1 WHERE input = 'a b c' AND token = 'b'; } { {a b c} b 2 3 1 } do_execsql_test 1.11 { SELECT input, * FROM t1 WHERE token = 'b' AND input = 'a b c'; } { {a b c} b 2 3 1 } do_execsql_test 1.12 { SELECT input, * FROM t1 WHERE input < 'b' AND input = 'a b c'; } { {a b c} a 0 1 0 {a b c} b 2 3 1 {a b c} c 4 5 2 } do_execsql_test 1.13.1 { CREATE TABLE c1(x); INSERT INTO c1(x) VALUES('a b c'); INSERT INTO c1(x) VALUES('d e f'); } do_execsql_test 1.13.2 { SELECT c1.*, input, t1.* FROM c1, t1 WHERE input = x AND c1.rowid=t1.rowid; } { {a b c} {a b c} a 0 1 0 {d e f} {d e f} e 2 3 1 } #------------------------------------------------------------------------- # Error cases. # do_catchsql_test 2.0 { CREATE VIRTUAL TABLE tX USING fts5tokenize(nosuchtokenizer); } {1 {vtable constructor failed: tX}} do_catchsql_test 2.1 { CREATE VIRTUAL TABLE t4 USING fts5tokenize; SELECT * FROM t4; } {1 {SQL logic error}} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5tok2.test ================================================ # 2016 Jan 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # source [file join [file dirname [info script]] fts5_common.tcl] ifcapable !fts5||!fts3 { finish_test ; return } set ::testprefix fts5tok2 sqlite3_fts5_register_fts5tokenize db #------------------------------------------------------------------------- # Simple test cases. Using the default (ascii) tokenizer. # do_execsql_test 1.0 { CREATE VIRTUAL TABLE t5 USING fts5tokenize(unicode61); CREATE VIRTUAL TABLE t3 USING fts3tokenize(unicode61); } do_test 1.1 { array unset -nocomplain A for {set i 1} {$i < 65536} {incr i} { set input [format "abc%cxyz" $i] set expect [execsql { SELECT input, token, start, end FROM t3 WHERE input=$input }] incr A([llength $expect]) set res [execsql { SELECT input, token, start, end FROM t5($input) }] if {$res != $expect} {error "failed at i=$i"} } } {} do_test 1.1.nTokenChars=$A(4).nSeparators=$A(8) {} {} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5tokenizer.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests focusing on the built-in fts5 tokenizers. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5tokenizer # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE ft1 USING fts5(x, tokenize=porter); DROP TABLE ft1; } do_execsql_test 1.1 { CREATE VIRTUAL TABLE ft1 USING fts5(x, tokenize='porter'); DROP TABLE ft1; } do_execsql_test 1.2 { CREATE VIRTUAL TABLE ft1 USING fts5(x, tokenize = porter); DROP TABLE ft1; } do_execsql_test 1.3 { CREATE VIRTUAL TABLE ft1 USING fts5(x, tokenize = 'porter'); DROP TABLE ft1; } do_execsql_test 1.4 { CREATE VIRTUAL TABLE ft1 USING fts5(x, tokenize = 'porter ascii'); DROP TABLE ft1; } do_catchsql_test 1.5 { CREATE VIRTUAL TABLE ft1 USING fts5(x, tokenize = 'nosuch'); } {1 {no such tokenizer: nosuch}} do_catchsql_test 1.6 { CREATE VIRTUAL TABLE ft1 USING fts5(x, tokenize = 'porter nosuch'); } {1 {error in tokenizer constructor}} do_execsql_test 2.0 { CREATE VIRTUAL TABLE ft1 USING fts5(x, tokenize=porter); INSERT INTO ft1 VALUES('embedded databases'); } do_execsql_test 2.1 { SELECT rowid FROM ft1 WHERE ft1 MATCH 'embedding' } 1 do_execsql_test 2.2 { SELECT rowid FROM ft1 WHERE ft1 MATCH 'database' } 1 do_execsql_test 2.3 { SELECT rowid FROM ft1 WHERE ft1 MATCH 'database embedding' } 1 proc tcl_create {args} { set ::targs $args error "failed" } sqlite3_fts5_create_tokenizer db tcl tcl_create foreach {tn directive expected} { 1 {tokenize='tcl a b c'} {a b c} 2 {tokenize='tcl ''d'' ''e'' ''f'''} {d e f} 3 {tokenize="tcl 'g' 'h' 'i'"} {g h i} 4 {tokenize = tcl} {} } { do_catchsql_test 3.$tn.1 " CREATE VIRTUAL TABLE ft2 USING fts5(x, $directive) " {1 {error in tokenizer constructor}} do_test 3.$tn.2 { set ::targs } $expected } do_catchsql_test 4.1 { CREATE VIRTUAL TABLE ft2 USING fts5(x, tokenize = tcl abc); } {1 {parse error in "tokenize = tcl abc"}} do_catchsql_test 4.2 { CREATE VIRTUAL TABLE ft2 USING fts5(x y) } {1 {unrecognized column option: y}} #------------------------------------------------------------------------- # Test the "separators" and "tokenchars" options a bit. # foreach {tn tokenizer} {1 ascii 2 unicode61} { reset_db set T "$tokenizer tokenchars ',.:' separators 'xyz'" execsql "CREATE VIRTUAL TABLE t1 USING fts5(x, tokenize = \"$T\")" do_execsql_test 5.$tn.1 { INSERT INTO t1 VALUES('abcxdefyghizjkl.mno,pqr:stu/vwx+yz'); } foreach {tn2 token res} { 1 abc 1 2 def 1 3 ghi 1 4 jkl {} 5 mno {} 6 pqr {} 7 stu {} 8 jkl.mno,pqr:stu 1 9 vw 1 } { do_execsql_test 5.$tn.2.$tn2 " SELECT rowid FROM t1 WHERE t1 MATCH '\"$token\"' " $res } } #------------------------------------------------------------------------- # Miscellaneous tests for the ascii tokenizer. # # 5.1.*: Test that the ascii tokenizer ignores non-ASCII characters in the # 'separators' option. But unicode61 does not. # # 5.2.*: An option without an argument is an error. # do_test 5.1.1 { execsql " CREATE VIRTUAL TABLE a1 USING fts5(x, tokenize=`ascii separators '\u1234'`); INSERT INTO a1 VALUES('abc\u1234def'); " execsql { SELECT rowid FROM a1 WHERE a1 MATCH 'def' } } {} do_test 5.1.2 { execsql " CREATE VIRTUAL TABLE a2 USING fts5( x, tokenize=`unicode61 separators '\u1234'`); INSERT INTO a2 VALUES('abc\u1234def'); " execsql { SELECT rowid FROM a2 WHERE a2 MATCH 'def' } } {1} do_catchsql_test 5.2 { CREATE VIRTUAL TABLE a3 USING fts5(x, y, tokenize = 'ascii tokenchars'); } {1 {error in tokenizer constructor}} do_catchsql_test 5.3 { CREATE VIRTUAL TABLE a3 USING fts5(x, y, tokenize = 'ascii opt arg'); } {1 {error in tokenizer constructor}} #------------------------------------------------------------------------- # Test that the ASCII and unicode61 tokenizers both handle SQLITE_DONE # correctly. # proc test_token_cb {varname token iStart iEnd} { upvar $varname var lappend var $token if {[llength $var]==3} { return "SQLITE_DONE" } return "SQLITE_OK" } proc tokenize {cmd} { set res [list] $cmd xTokenize [$cmd xColumnText 0] [list test_token_cb res] set res } sqlite3_fts5_create_function db tokenize tokenize do_execsql_test 6.0 { CREATE VIRTUAL TABLE x1 USING fts5(a, tokenize=ascii); INSERT INTO x1 VALUES('q w e r t y'); INSERT INTO x1 VALUES('y t r e w q'); SELECT tokenize(x1) FROM x1 WHERE x1 MATCH 'e AND r'; } { {q w e} {y t r} } do_execsql_test 6.1 { CREATE VIRTUAL TABLE x2 USING fts5(a, tokenize=unicode61); INSERT INTO x2 VALUES('q w e r t y'); INSERT INTO x2 VALUES('y t r e w q'); SELECT tokenize(x2) FROM x2 WHERE x2 MATCH 'e AND r'; } { {q w e} {y t r} } #------------------------------------------------------------------------- # Miscellaneous tests for the unicode tokenizer. # do_catchsql_test 6.1 { CREATE VIRTUAL TABLE a3 USING fts5(x, y, tokenize = 'unicode61 tokenchars'); } {1 {error in tokenizer constructor}} do_catchsql_test 6.2 { CREATE VIRTUAL TABLE a3 USING fts5(x, y, tokenize = 'unicode61 a b'); } {1 {error in tokenizer constructor}} do_catchsql_test 6.3 { CREATE VIRTUAL TABLE a3 USING fts5( x, y, tokenize = 'unicode61 remove_diacritics 2' ); } {1 {error in tokenizer constructor}} do_catchsql_test 6.4 { CREATE VIRTUAL TABLE a3 USING fts5( x, y, tokenize = 'unicode61 remove_diacritics 10' ); } {1 {error in tokenizer constructor}} #------------------------------------------------------------------------- # Porter tokenizer with very large tokens. # set a [string repeat a 100] set b [string repeat b 500] set c [string repeat c 1000] do_execsql_test 7.0 { CREATE VIRTUAL TABLE e5 USING fts5(x, tokenize=porter); INSERT INTO e5 VALUES($a || ' ' || $b); INSERT INTO e5 VALUES($b || ' ' || $c); INSERT INTO e5 VALUES($c || ' ' || $a); } do_execsql_test 7.1 {SELECT rowid FROM e5 WHERE e5 MATCH $a} { 1 3 } do_execsql_test 7.2 {SELECT rowid FROM e5 WHERE e5 MATCH $b} { 1 2 } do_execsql_test 7.3 {SELECT rowid FROM e5 WHERE e5 MATCH $c} { 2 3 } #------------------------------------------------------------------------- # Test the 'separators' option with the unicode61 tokenizer. # do_execsql_test 8.1 { BEGIN; CREATE VIRTUAL TABLE e6 USING fts5(x, tokenize="unicode61 separators ABCDEFGHIJKLMNOPQRSTUVWXYZ" ); INSERT INTO e6 VALUES('theAquickBbrownCfoxDjumpedWoverXtheYlazyZdog'); CREATE VIRTUAL TABLE e7 USING fts5vocab(e6, 'row'); SELECT term FROM e7; ROLLBACK; } { brown dog fox jumped lazy over quick the } do_execsql_test 8.2 [subst { BEGIN; CREATE VIRTUAL TABLE e6 USING fts5(x, tokenize="unicode61 separators '\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07'" ); INSERT INTO e6 VALUES('the\u0E01quick\u0E01brown\u0E01fox\u0E01' || 'jumped\u0E01over\u0E01the\u0E01lazy\u0E01dog' ); INSERT INTO e6 VALUES('\u0E08\u0E07\u0E09'); CREATE VIRTUAL TABLE e7 USING fts5vocab(e6, 'row'); SELECT term FROM e7; ROLLBACK; }] [subst { brown dog fox jumped lazy over quick the \u0E08 \u0E09 }] # Test that the porter tokenizer correctly passes arguments through to # its parent tokenizer. do_execsql_test 8.3 { BEGIN; CREATE VIRTUAL TABLE e6 USING fts5(x, tokenize="porter unicode61 separators ABCDEFGHIJKLMNOPQRSTUVWXYZ" ); INSERT INTO e6 VALUES('theAquickBbrownCfoxDjumpedWoverXtheYlazyZdog'); CREATE VIRTUAL TABLE e7 USING fts5vocab(e6, 'row'); SELECT term FROM e7; ROLLBACK; } { brown dog fox jump lazi over quick the } #------------------------------------------------------------------------- # Check that the FTS5_TOKENIZE_PREFIX flag is passed to the tokenizer # implementation. # reset_db proc tcl_create {args} { return "tcl_tokenize" } sqlite3_fts5_create_tokenizer db tcl tcl_create set ::flags [list] proc tcl_tokenize {tflags text} { lappend ::flags $tflags foreach {w iStart iEnd} [fts5_tokenize_split $text] { sqlite3_fts5_token $w $iStart $iEnd } } do_execsql_test 9.1.1 { CREATE VIRTUAL TABLE t1 USING fts5(a, tokenize=tcl); INSERT INTO t1 VALUES('abc'); INSERT INTO t1 VALUES('xyz'); } {} do_test 9.1.2 { set ::flags } {document document} set ::flags [list] do_execsql_test 9.2.1 { SELECT * FROM t1('abc'); } {abc} do_test 9.2.2 { set ::flags } {query} set ::flags [list] do_execsql_test 9.3.1 { SELECT * FROM t1('ab*'); } {abc} do_test 9.3.2 { set ::flags } {prefixquery} set ::flags [list] do_execsql_test 9.4.1 { SELECT * FROM t1('"abc xyz" *'); } {} do_test 9.4.2 { set ::flags } {prefixquery} set ::flags [list] do_execsql_test 9.5.1 { SELECT * FROM t1('"abc xyz*"'); } {} do_test 9.5.2 { set ::flags } {query} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5unicode.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests focusing on the fts5 tokenizers # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5unicode # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } proc tokenize_test {tn tokenizer input output} { uplevel [list do_test $tn [subst -nocommands { set ret {} foreach {z s e} [sqlite3_fts5_tokenize db {$tokenizer} {$input}] { lappend ret [set z] } set ret }] [list {*}$output]] } foreach {tn t} {1 ascii 2 unicode61} { tokenize_test 1.$tn.0 $t {A B C D} {a b c d} tokenize_test 1.$tn.1 $t {May you share freely,} {may you share freely} tokenize_test 1.$tn.2 $t {..May...you.shAre.freely} {may you share freely} tokenize_test 1.$tn.3 $t {} {} } #------------------------------------------------------------------------- # Check that "unicode61" really is the default tokenizer. # do_execsql_test 2.0 " CREATE VIRTUAL TABLE t1 USING fts5(x); CREATE VIRTUAL TABLE t2 USING fts5(x, tokenize = unicode61); CREATE VIRTUAL TABLE t3 USING fts5(x, tokenize = ascii); INSERT INTO t1 VALUES('\xC0\xC8\xCC'); INSERT INTO t2 VALUES('\xC0\xC8\xCC'); INSERT INTO t3 VALUES('\xC0\xC8\xCC'); " do_execsql_test 2.1 " SELECT 't1' FROM t1 WHERE t1 MATCH '\xE0\xE8\xEC'; SELECT 't2' FROM t2 WHERE t2 MATCH '\xE0\xE8\xEC'; SELECT 't3' FROM t3 WHERE t3 MATCH '\xE0\xE8\xEC'; " {t1 t2} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5unicode2.test ================================================ # 2012 May 25 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # # The tests in this file focus on testing the "unicode" FTS tokenizer. # # This is a modified copy of FTS4 test file "fts4_unicode.test". # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5unicode2 # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } proc do_unicode_token_test {tn input res} { uplevel [list do_test $tn [list \ sqlite3_fts5_tokenize -subst db "unicode61 remove_diacritics 0" $input ] [list {*}$res]] } proc do_unicode_token_test2 {tn input res} { uplevel [list do_test $tn [list \ sqlite3_fts5_tokenize -subst db "unicode61" $input ] [list {*}$res]] } proc do_unicode_token_test3 {tn args} { set tokenizer [concat unicode61 {*}[lrange $args 0 end-2]] set input [lindex $args end-1] set res [lindex $args end] uplevel [list do_test $tn [list \ sqlite3_fts5_tokenize -subst db $tokenizer $input ] [list {*}$res]] } do_unicode_token_test 1.0 {a B c D} {a a b B c c d D} do_unicode_token_test 1.1 "\uC4 \uD6 \uDC" \ "\uE4 \uC4 \uF6 \uD6 \uFC \uDC" do_unicode_token_test 1.2 "x\uC4x x\uD6x x\uDCx" \ "x\uE4x x\uC4x x\uF6x x\uD6x x\uFCx x\uDCx" # 0x00DF is a small "sharp s". 0x1E9E is a capital sharp s. do_unicode_token_test 1.3 "\uDF" "\uDF \uDF" do_unicode_token_test 1.4 "\u1E9E" "\uDF \u1E9E" do_unicode_token_test 1.5 "The quick brown fox" { the The quick quick brown brown fox fox } do_unicode_token_test 1.6 "The\u00bfquick\u224ebrown\u2263fox" { the The quick quick brown brown fox fox } do_unicode_token_test2 1.7 {a B c D} {a a b B c c d D} do_unicode_token_test2 1.8 "\uC4 \uD6 \uDC" "a \uC4 o \uD6 u \uDC" do_unicode_token_test2 1.9 "x\uC4x x\uD6x x\uDCx" \ "xax x\uC4x xox x\uD6x xux x\uDCx" # Check that diacritics are removed if remove_diacritics=1 is specified. # And that they do not break tokens. do_unicode_token_test2 1.10 "xx\u0301xx" "xxxx xx\u301xx" # Title-case mappings work do_unicode_token_test 1.11 "\u01c5" "\u01c6 \u01c5" do_unicode_token_test 1.12 "\u00C1abc\u00C2 \u00D1def\u00C3" \ "\u00E1abc\u00E2 \u00C1abc\u00C2 \u00F1def\u00E3 \u00D1def\u00C3" do_unicode_token_test 1.13 "\u00A2abc\u00A3 \u00A4def\u00A5" \ "abc abc def def" #------------------------------------------------------------------------- # set docs [list { Enhance the INSERT syntax to allow multiple rows to be inserted via the VALUES clause. } { Enhance the CREATE VIRTUAL TABLE command to support the IF NOT EXISTS clause. } { Added the sqlite3_stricmp() interface as a counterpart to sqlite3_strnicmp(). } { Added the sqlite3_db_readonly() interface. } { Added the SQLITE_FCNTL_PRAGMA file control, giving VFS implementations the ability to add new PRAGMA statements or to override built-in PRAGMAs. } { Queries of the form: "SELECT max(x), y FROM table" returns the value of y on the same row that contains the maximum x value. } { Added support for the FTS4 languageid option. } { Documented support for the FTS4 content option. This feature has actually been in the code since version 3.7.9 but is only now considered to be officially supported. } { Pending statements no longer block ROLLBACK. Instead, the pending statement will return SQLITE_ABORT upon next access after the ROLLBACK. } { Improvements to the handling of CSV inputs in the command-line shell } { Fix a bug introduced in version 3.7.10 that might cause a LEFT JOIN to be incorrectly converted into an INNER JOIN if the WHERE clause indexable terms connected by OR. }] set map(a) [list "\u00C4" "\u00E4"] ; # LATIN LETTER A WITH DIAERESIS set map(e) [list "\u00CB" "\u00EB"] ; # LATIN LETTER E WITH DIAERESIS set map(i) [list "\u00CF" "\u00EF"] ; # LATIN LETTER I WITH DIAERESIS set map(o) [list "\u00D6" "\u00F6"] ; # LATIN LETTER O WITH DIAERESIS set map(u) [list "\u00DC" "\u00FC"] ; # LATIN LETTER U WITH DIAERESIS set map(y) [list "\u0178" "\u00FF"] ; # LATIN LETTER Y WITH DIAERESIS set map(h) [list "\u1E26" "\u1E27"] ; # LATIN LETTER H WITH DIAERESIS set map(w) [list "\u1E84" "\u1E85"] ; # LATIN LETTER W WITH DIAERESIS set map(x) [list "\u1E8C" "\u1E8D"] ; # LATIN LETTER X WITH DIAERESIS foreach k [array names map] { lappend mappings [string toupper $k] [lindex $map($k) 0] lappend mappings $k [lindex $map($k) 1] } proc mapdoc {doc} { set doc [regsub -all {[[:space:]]+} $doc " "] string map $::mappings [string trim $doc] } do_test 2.0 { execsql { CREATE VIRTUAL TABLE t2 USING fts5(tokenize=unicode61, x); } foreach doc $docs { set d [mapdoc $doc] execsql { INSERT INTO t2 VALUES($d) } } } {} do_test 2.1 { set q [mapdoc "row"] execsql { SELECT * FROM t2 WHERE t2 MATCH $q } } [list [mapdoc { Queries of the form: "SELECT max(x), y FROM table" returns the value of y on the same row that contains the maximum x value. }]] foreach {tn query snippet} { 2 "row" { ...returns the value of y on the same [row] that contains the maximum x value. } 3 "ROW" { ...returns the value of y on the same [row] that contains the maximum x value. } 4 "rollback" { Pending statements no longer block [ROLLBACK]. Instead, the pending statement will return SQLITE_ABORT upon... } 5 "rOllback" { Pending statements no longer block [ROLLBACK]. Instead, the pending statement will return SQLITE_ABORT upon... } 6 "lang*" { Added support for the FTS4 [languageid] option. } } { do_test 2.$tn { set q [mapdoc $query] execsql { SELECT snippet(t2, -1, '[', ']', '...', 15) FROM t2 WHERE t2 MATCH $q } } [list [mapdoc $snippet]] } #------------------------------------------------------------------------- # Make sure the unicode61 tokenizer does not crash if it is passed a # NULL pointer. reset_db do_execsql_test 3.1 { CREATE VIRTUAL TABLE t1 USING fts5(tokenize=unicode61, x, y); INSERT INTO t1 VALUES(NULL, 'a b c'); } do_execsql_test 3.2 { SELECT snippet(t1, -1, '[', ']', '...', 15) FROM t1 WHERE t1 MATCH 'b' } {{a [b] c}} do_execsql_test 3.3 { BEGIN; DELETE FROM t1; INSERT INTO t1 VALUES('b b b b b b b b b b b', 'b b b b b b b b b b b b b'); INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 VALUES('a b c', NULL); INSERT INTO t1 VALUES('a x c', NULL); COMMIT; } do_execsql_test 3.4 { SELECT * FROM t1 WHERE t1 MATCH 'a b'; } {{a b c} {}} #------------------------------------------------------------------------- # reset_db do_test 4.1 { set a "abc\uFFFEdef" set b "abc\uD800def" set c "\uFFFEdef" set d "\uD800def" execsql { CREATE VIRTUAL TABLE t1 USING fts5(tokenize=unicode61, x); INSERT INTO t1 VALUES($a); INSERT INTO t1 VALUES($b); INSERT INTO t1 VALUES($c); INSERT INTO t1 VALUES($d); } execsql "CREATE VIRTUAL TABLE t8 USING fts5( a, b, tokenize=\"unicode61 separators '\uFFFE\uD800\u00BF'\" )" } {} do_test 4.2 { set a [binary format c* {0x61 0xF7 0xBF 0xBF 0xBF 0x62}] set b [binary format c* {0x61 0xF7 0xBF 0xBF 0xBF 0xBF 0x62}] set c [binary format c* {0x61 0xF7 0xBF 0xBF 0xBF 0xBF 0xBF 0x62}] set d [binary format c* {0x61 0xF7 0xBF 0xBF 0xBF 0xBF 0xBF 0xBF 0x62}] execsql { INSERT INTO t1 VALUES($a); INSERT INTO t1 VALUES($b); INSERT INTO t1 VALUES($c); INSERT INTO t1 VALUES($d); } } {} do_test 4.3 { set a [binary format c* {0xF7 0xBF 0xBF 0xBF}] set b [binary format c* {0xF7 0xBF 0xBF 0xBF 0xBF}] set c [binary format c* {0xF7 0xBF 0xBF 0xBF 0xBF 0xBF}] set d [binary format c* {0xF7 0xBF 0xBF 0xBF 0xBF 0xBF 0xBF}] execsql { INSERT INTO t1 VALUES($a); INSERT INTO t1 VALUES($b); INSERT INTO t1 VALUES($c); INSERT INTO t1 VALUES($d); } } {} do_test 4.4 { sqlite3_exec_hex db { CREATE VIRTUAL TABLE t9 USING fts5(a, b, tokenize="unicode61 separators '%C09004'" ); INSERT INTO t9(a) VALUES('abc%88def %89ghi%90'); } } {0 {}} #------------------------------------------------------------------------- do_unicode_token_test3 5.1 {tokenchars {}} { sqlite3_reset sqlite3_column_int } { sqlite3 sqlite3 reset reset sqlite3 sqlite3 column column int int } do_unicode_token_test3 5.2 {tokenchars _} { sqlite3_reset sqlite3_column_int } { sqlite3_reset sqlite3_reset sqlite3_column_int sqlite3_column_int } do_unicode_token_test3 5.3 {separators xyz} { Laotianxhorseyrunszfast } { laotian Laotian horse horse runs runs fast fast } do_unicode_token_test3 5.4 {tokenchars xyz} { Laotianxhorseyrunszfast } { laotianxhorseyrunszfast Laotianxhorseyrunszfast } do_unicode_token_test3 5.5 {tokenchars _} {separators zyx} { sqlite3_resetxsqlite3_column_intyhonda_phantom } { sqlite3_reset sqlite3_reset sqlite3_column_int sqlite3_column_int honda_phantom honda_phantom } do_unicode_token_test3 5.6 "separators \u05D1" "abc\u05D1def" { abc abc def def } do_unicode_token_test3 5.7 \ "tokenchars \u2444\u2445" \ "separators \u05D0\u05D1\u05D2" \ "\u2444fre\u2445sh\u05D0water\u05D2fish.\u2445timer" \ [list \ \u2444fre\u2445sh \u2444fre\u2445sh \ water water \ fish fish \ \u2445timer \u2445timer \ ] # Check that it is not possible to add a standalone diacritic codepoint # to either separators or tokenchars. do_unicode_token_test3 5.8 "separators \u0301" \ "hello\u0301world \u0301helloworld" \ "helloworld hello\u0301world helloworld helloworld" do_unicode_token_test3 5.9 "tokenchars \u0301" \ "hello\u0301world \u0301helloworld" \ "helloworld hello\u0301world helloworld helloworld" do_unicode_token_test3 5.10 "separators \u0301" \ "remove_diacritics 0" \ "hello\u0301world \u0301helloworld" \ "hello\u0301world hello\u0301world helloworld helloworld" do_unicode_token_test3 5.11 "tokenchars \u0301" \ "remove_diacritics 0" \ "hello\u0301world \u0301helloworld" \ "hello\u0301world hello\u0301world helloworld helloworld" #------------------------------------------------------------------------- proc do_tokenize {tokenizer txt} { set res [list] foreach {b c} [sqlite3_fts5_tokenize -subst db $tokenizer $txt] { lappend res $b } set res } # Argument $lCodepoint must be a list of codepoints (integers) that # correspond to whitespace characters. This command creates a string # $W from the codepoints, then tokenizes "${W}hello{$W}world${W}" # using tokenizer $tokenizer. The test passes if the tokenizer successfully # extracts the two 5 character tokens. # proc do_isspace_test {tn tokenizer lCp} { set whitespace [format [string repeat %c [llength $lCp]] {*}$lCp] set txt "${whitespace}hello${whitespace}world${whitespace}" uplevel [list do_test $tn [list do_tokenize $tokenizer $txt] {hello world}] } set tokenizers [list unicode61] #ifcapable icu { lappend tokenizers icu } # Some tests to check that the tokenizers can both identify white-space # codepoints. All codepoints tested below are of type "Zs" in the # UnicodeData.txt file. foreach T $tokenizers { do_isspace_test 6.$T.1 $T 32 do_isspace_test 6.$T.2 $T 160 do_isspace_test 6.$T.3 $T 5760 do_isspace_test 6.$T.4 $T 6158 do_isspace_test 6.$T.5 $T 8192 do_isspace_test 6.$T.6 $T 8193 do_isspace_test 6.$T.7 $T 8194 do_isspace_test 6.$T.8 $T 8195 do_isspace_test 6.$T.9 $T 8196 do_isspace_test 6.$T.10 $T 8197 do_isspace_test 6.$T.11 $T 8198 do_isspace_test 6.$T.12 $T 8199 do_isspace_test 6.$T.13 $T 8200 do_isspace_test 6.$T.14 $T 8201 do_isspace_test 6.$T.15 $T 8202 do_isspace_test 6.$T.16 $T 8239 do_isspace_test 6.$T.17 $T 8287 do_isspace_test 6.$T.18 $T 12288 do_isspace_test 6.$T.19 $T {32 160 5760 6158} do_isspace_test 6.$T.20 $T {8192 8193 8194 8195} do_isspace_test 6.$T.21 $T {8196 8197 8198 8199} do_isspace_test 6.$T.22 $T {8200 8201 8202 8239} do_isspace_test 6.$T.23 $T {8287 12288} } #------------------------------------------------------------------------- # Test that the private use ranges are treated as alphanumeric. # foreach {tn1 c} { 1 \ue000 2 \ue001 3 \uf000 4 \uf8fe 5 \uf8ff } { foreach {tn2 config res} { 1 "" "hello*world hello*world" 2 "separators *" "hello hello world world" } { set config [string map [list * $c] $config] set input [string map [list * $c] "hello*world"] set output [string map [list * $c] $res] do_unicode_token_test3 7.$tn1.$tn2 {*}$config $input $output } } #------------------------------------------------------------------------- # Cursory test of remove_diacritics=0. # # 00C4;LATIN CAPITAL LETTER A WITH DIAERESIS # 00D6;LATIN CAPITAL LETTER O WITH DIAERESIS # 00E4;LATIN SMALL LETTER A WITH DIAERESIS # 00F6;LATIN SMALL LETTER O WITH DIAERESIS # do_execsql_test 8.1.1 " CREATE VIRTUAL TABLE t3 USING fts5( content, tokenize='unicode61 remove_diacritics 1' ); INSERT INTO t3 VALUES('o'); INSERT INTO t3 VALUES('a'); INSERT INTO t3 VALUES('O'); INSERT INTO t3 VALUES('A'); INSERT INTO t3 VALUES('\xD6'); INSERT INTO t3 VALUES('\xC4'); INSERT INTO t3 VALUES('\xF6'); INSERT INTO t3 VALUES('\xE4'); " do_execsql_test 8.1.2 { SELECT rowid FROM t3 WHERE t3 MATCH 'o' ORDER BY rowid ASC; } {1 3 5 7} do_execsql_test 8.1.3 { SELECT rowid FROM t3 WHERE t3 MATCH 'a' ORDER BY rowid ASC; } {2 4 6 8} do_execsql_test 8.2.1 { CREATE VIRTUAL TABLE t4 USING fts5( content, tokenize='unicode61 remove_diacritics 0' ); INSERT INTO t4 SELECT * FROM t3 ORDER BY rowid ASC; } do_execsql_test 8.2.2 { SELECT rowid FROM t4 WHERE t4 MATCH 'o' ORDER BY rowid ASC; } {1 3} do_execsql_test 8.2.3 { SELECT rowid FROM t4 WHERE t4 MATCH 'a' ORDER BY rowid ASC; } {2 4} #------------------------------------------------------------------------- # if 0 { foreach {tn sql} { 1 { CREATE VIRTUAL TABLE t5 USING fts4(tokenize=unicode61 [tokenchars= .]); CREATE VIRTUAL TABLE t6 USING fts4( tokenize=unicode61 [tokenchars=="] "tokenchars=[]"); CREATE VIRTUAL TABLE t7 USING fts4(tokenize=unicode61 [separators=x\xC4]); } 2 { CREATE VIRTUAL TABLE t5 USING fts4(tokenize=unicode61 "tokenchars= ."); CREATE VIRTUAL TABLE t6 USING fts4(tokenize=unicode61 "tokenchars=[=""]"); CREATE VIRTUAL TABLE t7 USING fts4(tokenize=unicode61 "separators=x\xC4"); } 3 { CREATE VIRTUAL TABLE t5 USING fts4(tokenize=unicode61 'tokenchars= .'); CREATE VIRTUAL TABLE t6 USING fts4(tokenize=unicode61 'tokenchars=="[]'); CREATE VIRTUAL TABLE t7 USING fts4(tokenize=unicode61 'separators=x\xC4'); } 4 { CREATE VIRTUAL TABLE t5 USING fts4(tokenize=unicode61 `tokenchars= .`); CREATE VIRTUAL TABLE t6 USING fts4(tokenize=unicode61 `tokenchars=[="]`); CREATE VIRTUAL TABLE t7 USING fts4(tokenize=unicode61 `separators=x\xC4`); } } { do_execsql_test 9.$tn.0 { DROP TABLE IF EXISTS t5; DROP TABLE IF EXISTS t5aux; DROP TABLE IF EXISTS t6; DROP TABLE IF EXISTS t6aux; DROP TABLE IF EXISTS t7; DROP TABLE IF EXISTS t7aux; } do_execsql_test 9.$tn.1 $sql do_execsql_test 9.$tn.2 { CREATE VIRTUAL TABLE t5aux USING fts4aux(t5); INSERT INTO t5 VALUES('one two three/four.five.six'); SELECT * FROM t5aux; } { four.five.six * 1 1 four.five.six 0 1 1 {one two three} * 1 1 {one two three} 0 1 1 } do_execsql_test 9.$tn.3 { CREATE VIRTUAL TABLE t6aux USING fts4aux(t6); INSERT INTO t6 VALUES('alpha=beta"gamma/delta[epsilon]zeta'); SELECT * FROM t6aux; } { {alpha=beta"gamma} * 1 1 {alpha=beta"gamma} 0 1 1 {delta[epsilon]zeta} * 1 1 {delta[epsilon]zeta} 0 1 1 } do_execsql_test 9.$tn.4 { CREATE VIRTUAL TABLE t7aux USING fts4aux(t7); INSERT INTO t7 VALUES('alephxbeth\xC4gimel'); SELECT * FROM t7aux; } { aleph * 1 1 aleph 0 1 1 beth * 1 1 beth 0 1 1 gimel * 1 1 gimel 0 1 1 } } # Check that multiple options are handled correctly. # do_execsql_test 10.1 { DROP TABLE IF EXISTS t1; CREATE VIRTUAL TABLE t1 USING fts4(tokenize=unicode61 "tokenchars=xyz" "tokenchars=.=" "separators=.=" "separators=xy" "separators=a" "separators=a" "tokenchars=a" "tokenchars=a" ); INSERT INTO t1 VALUES('oneatwoxthreeyfour'); INSERT INTO t1 VALUES('a.single=word'); CREATE VIRTUAL TABLE t1aux USING fts4aux(t1); SELECT * FROM t1aux; } { .single=word * 1 1 .single=word 0 1 1 four * 1 1 four 0 1 1 one * 1 1 one 0 1 1 three * 1 1 three 0 1 1 two * 1 1 two 0 1 1 } # Test that case folding happens after tokenization, not before. # do_execsql_test 10.2 { DROP TABLE IF EXISTS t2; CREATE VIRTUAL TABLE t2 USING fts4(tokenize=unicode61 "separators=aB"); INSERT INTO t2 VALUES('oneatwoBthree'); INSERT INTO t2 VALUES('onebtwoAthree'); CREATE VIRTUAL TABLE t2aux USING fts4aux(t2); SELECT * FROM t2aux; } { one * 1 1 one 0 1 1 onebtwoathree * 1 1 onebtwoathree 0 1 1 three * 1 1 three 0 1 1 two * 1 1 two 0 1 1 } # Test that the tokenchars and separators options work with the # fts3tokenize table. # do_execsql_test 11.1 { CREATE VIRTUAL TABLE ft1 USING fts3tokenize( "unicode61", "tokenchars=@.", "separators=1234567890" ); SELECT token FROM ft1 WHERE input = 'berlin@street123sydney.road'; } { berlin@street sydney.road } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5unicode3.test ================================================ # 2014 Dec 20 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # Tests focusing on the fts5 tokenizers # source [file join [file dirname [info script]] fts5_common.tcl] # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } proc fts3_unicode_path {file} { file join [file dirname [info script]] .. .. fts3 unicode $file } source [fts3_unicode_path parseunicode.tcl] set testprefix fts5unicode3 set CF [fts3_unicode_path CaseFolding.txt] set UD [fts3_unicode_path UnicodeData.txt] tl_load_casefolding_txt $CF foreach x [an_load_unicodedata_text $UD] { set aNotAlnum($x) 1 } foreach {y} [rd_load_unicodedata_text $UD] { foreach {code ascii} $y {} if {$ascii==""} { set int 0 } else { binary scan $ascii c int } set aDiacritic($code) $int } proc tcl_fold {i {bRemoveDiacritic 0}} { global tl_lookup_table global aDiacritic if {[info exists tl_lookup_table($i)]} { set i $tl_lookup_table($i) } if {$bRemoveDiacritic && [info exists aDiacritic($i)]} { set i $aDiacritic($i) } expr $i } db func tcl_fold tcl_fold proc tcl_isalnum {i} { global aNotAlnum expr {![info exists aNotAlnum($i)]} } db func tcl_isalnum tcl_isalnum do_catchsql_test 1.0.1 { SELECT fts5_isalnum(1, 2, 3); } {1 {wrong number of arguments to function fts5_isalnum}} do_catchsql_test 1.0.2 { SELECT fts5_fold(); } {1 {wrong number of arguments to function fts5_fold}} do_catchsql_test 1.0.3 { SELECT fts5_fold(1,2,3); } {1 {wrong number of arguments to function fts5_fold}} do_execsql_test 1.1 { WITH ii(i) AS ( SELECT -1 UNION ALL SELECT i+1 FROM ii WHERE i<100000 ) SELECT count(*), min(i) FROM ii WHERE fts5_fold(i)!=CAST(tcl_fold(i) AS int); } {0 {}} do_execsql_test 1.2 { WITH ii(i) AS ( SELECT -1 UNION ALL SELECT i+1 FROM ii WHERE i<100000 ) SELECT count(*), min(i) FROM ii WHERE fts5_fold(i,1)!=CAST(tcl_fold(i,1) AS int); } {0 {}} do_execsql_test 1.3 { WITH ii(i) AS ( SELECT -1 UNION ALL SELECT i+1 FROM ii WHERE i<100000 ) SELECT count(*), min(i) FROM ii WHERE fts5_isalnum(i)!=CAST(tcl_isalnum(i) AS int); } {0 {}} do_test 1.4 { set str {CREATE VIRTUAL TABLE f3 USING fts5(a, tokenize=} append str {"unicode61 separators '} for {set i 700} {$i<900} {incr i} { append str [format %c $i] } append str {'");} execsql $str } {} do_test 1.5 { set str {CREATE VIRTUAL TABLE f5 USING fts5(a, tokenize=} append str {"unicode61 tokenchars '} for {set i 700} {$i<900} {incr i} { append str [format %c $i] } append str {'");} execsql $str } {} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5unindexed.test ================================================ # 2015 Apr 24 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # The tests in this file focus on "unindexed" columns. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5unindexed # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.1 { CREATE VIRTUAL TABLE t1 USING fts5(a, b UNINDEXED); INSERT INTO t1 VALUES('a b c', 'd e f'); INSERT INTO t1 VALUES('g h i', 'j k l'); } {} do_execsql_test 1.2 { SELECT rowid FROM t1 WHERE t1 MATCH 'b' } {1} do_execsql_test 1.3 { SELECT rowid FROM t1 WHERE t1 MATCH 'e' } {} do_execsql_test 1.4 { INSERT INTO t1(t1) VALUES('integrity-check') } {} do_execsql_test 1.5 { INSERT INTO t1(t1) VALUES('rebuild') } {} do_execsql_test 1.6 { INSERT INTO t1(t1) VALUES('integrity-check') } {} do_execsql_test 1.7 { SELECT rowid FROM t1 WHERE t1 MATCH 'b' } {1} do_execsql_test 1.8 { SELECT rowid FROM t1 WHERE t1 MATCH 'e' } {} do_execsql_test 1.9 { DELETE FROM t1 WHERE t1 MATCH 'b' } {} do_execsql_test 1.10 { INSERT INTO t1(t1) VALUES('integrity-check') } {} do_execsql_test 1.11 { INSERT INTO t1(t1) VALUES('rebuild') } {} do_execsql_test 1.12 { INSERT INTO t1(t1) VALUES('integrity-check') } {} do_execsql_test 1.13 { SELECT rowid FROM t1 WHERE t1 MATCH 'i' } {2} do_execsql_test 1.14 { SELECT rowid FROM t1 WHERE t1 MATCH 'l' } {} do_execsql_test 2.1 { CREATE VIRTUAL TABLE t2 USING fts5(a UNINDEXED, b UNINDEXED); INSERT INTO t1 VALUES('a b c', 'd e f'); INSERT INTO t1 VALUES('g h i', 'j k l'); SELECT rowid FROM t2_data; } {1 10} do_execsql_test 2.2 { INSERT INTO t2(t2) VALUES('rebuild'); INSERT INTO t2(t2) VALUES('integrity-check'); SELECT rowid FROM t2_data; } {1 10} do_execsql_test 3.1 { CREATE TABLE x4(i INTEGER PRIMARY KEY, a, b, c); CREATE VIRTUAL TABLE t4 USING fts5(a, b UNINDEXED, c, content=x4); INSERT INTO x4 VALUES(10, 'a b c', 'd e f', 'g h i'); INSERT INTO x4 VALUES(20, 'j k l', 'm n o', 'p q r'); INSERT INTO t4(t4) VALUES('rebuild'); INSERT INTO t4(t4) VALUES('integrity-check'); } {} do_execsql_test 3.2 { INSERT INTO t4(t4, rowid, a, b, c) VALUES('delete', 20, 'j k l', '', 'p q r'); DELETE FROM x4 WHERE rowid=20; INSERT INTO t4(t4) VALUES('integrity-check'); } {} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5update.test ================================================ # 2016 Jan 16 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5update # If SQLITE_ENABLE_FTS5 is not defined, omit this file. ifcapable !fts5 { finish_test return } set docs { "eight zero iv eight 7" "ix one 8 one three ii one" "1 9 9 three viii" "5 zero ii 6 nine ix 3" "3 zero 5 2 seven nine" "two eight viii eight 1" "4 six two 5 9 vii" "viii ii four 8 i i iv" "vii 0 iv seven 7 viii" "five 1 nine vi seven" "1 zero zero iii 1" "one one six 6 nine seven" "one v 4 zero 4 iii ii" "2 3 eight six ix" "six iv 7 three 5" "ix zero 0 8 ii 7 3" "four six nine 2 vii 3" "five viii 5 8 0 7" } foreach_detail_mode $::testprefix { do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, detail=%DETAIL%); } {} do_test 1.1 { foreach {a b} $docs { execsql {INSERT INTO t1 VALUES($a, $b)} } } {} proc update {iRowid iA iB} { set a [lindex $::docs $iA] set b [lindex $::docs $iB] execsql { UPDATE t1 SET a=$a, b=$b WHERE rowid=$iRowid } } set nDoc [llength $::docs] foreach n {1 5 10 50 100} { do_test 1.2.$n { execsql BEGIN for {set i 1} {$i <= 1000} {incr i} { set iRowid [expr {int(rand() * ($nDoc/2)) + 1}] set iA [expr {int(rand() * $nDoc)}] set iB [expr {int(rand() * $nDoc)}] update $iRowid $iA $iB if {($i % $n)==0} { execsql { COMMIT; BEGIN } } if {($i % $n)==100} { execsql { INSERT INTO t1(t1) VALUES('integrity-check') } } } execsql COMMIT execsql { INSERT INTO t1(t1) VALUES('integrity-check') } } {} } do_execsql_test 1.3 { UPDATE t1 SET a=a AND b=b; INSERT INTO t1(t1) VALUES('integrity-check'); } do_test 1.4 { execsql { INSERT INTO t1(t1, rank) VALUES('pgsz', 32) } for {set i 0} {$i < 50} {incr i} { execsql { UPDATE t1 SET a=a AND b=b } execsql { INSERT INTO t1(t1) VALUES('integrity-check') } } } {} #------------------------------------------------------------------------- # Lots of deletes/inserts of the same document with the same rowid. # do_execsql_test 2.0 { CREATE VIRTUAL TABLE x2 USING fts5(x, detail=%DETAIL%); INSERT INTO x2(x2, rank) VALUES('crisismerge', 2); INSERT INTO x2 VALUES('a b c'); INSERT INTO x2 VALUES('a b c'); } do_test 2.1 { for {set i 0} {$i < 1000} {incr i} { execsql { DELETE FROM x2 WHERE rowid = 2 } execsql { INSERT INTO x2(rowid, x) VALUES(2, 'a b c') } } } {} do_execsql_test 2.1.integrity { INSERT INTO x2(x2) VALUES('integrity-check'); } do_test 2.2 { for {set i 0} {$i < 1000} {incr i} { execsql { UPDATE x2 SET x=x WHERE rowid=2 } } } {} do_execsql_test 2.2.integrity { INSERT INTO x2(x2) VALUES('integrity-check'); } } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5version.test ================================================ # 2015 Apr 24 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # The tests in this file focus on testing that unrecognized file-format # versions are detected and reported. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5version # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.1 { CREATE VIRTUAL TABLE t1 USING fts5(one); INSERT INTO t1 VALUES('a b c d'); } {} do_execsql_test 1.2 { SELECT * FROM t1_config WHERE k='version' } {version 4} do_execsql_test 1.3 { SELECT rowid FROM t1 WHERE t1 MATCH 'a'; } {1} do_execsql_test 1.4 { UPDATE t1_config set v=5 WHERE k='version'; } do_test 1.5 { db close sqlite3 db test.db catchsql { SELECT * FROM t1 WHERE t1 MATCH 'a' } } {1 {invalid fts5 file format (found 5, expected 4) - run 'rebuild'}} do_test 1.6 { db close sqlite3 db test.db catchsql { INSERT INTO t1 VALUES('x y z') } } {1 {invalid fts5 file format (found 5, expected 4) - run 'rebuild'}} do_test 1.7 { execsql { DELETE FROM t1_config WHERE k='version' } db close sqlite3 db test.db catchsql { SELECT * FROM t1 WHERE t1 MATCH 'a' } } {1 {invalid fts5 file format (found 0, expected 4) - run 'rebuild'}} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5vocab.test ================================================ # 2015 Apr 24 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # The tests in this file focus on testing the fts5vocab module. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5vocab # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } foreach_detail_mode $testprefix { proc null_list_entries {iFirst nInterval L} { for {set i $iFirst} {$i < [llength $L]} {incr i $nInterval} { lset L $i {} } return $L } proc star_from_row {L} { if {[detail_is_full]==0} { set L [null_list_entries 2 3 $L] } return $L } proc star_from_col {L} { if {[detail_is_col]} { set L [null_list_entries 3 4 $L] } if {[detail_is_none]} { set L [null_list_entries 1 4 $L] set L [null_list_entries 3 4 $L] } return $L } proc row_to_col {L} { if {[detail_is_none]==0} { error "this is for detail=none mode" } set ret [list] foreach {a b c} $L { lappend ret $a {} $b {} } set ret } if 1 { do_execsql_test 1.1.1 { CREATE VIRTUAL TABLE t1 USING fts5(one, prefix=1, detail=%DETAIL%); CREATE VIRTUAL TABLE v1 USING fts5vocab(t1, 'row'); PRAGMA table_info = v1; } { 0 term {} 0 {} 0 1 doc {} 0 {} 0 2 cnt {} 0 {} 0 } do_execsql_test 1.1.2 { CREATE VIRTUAL TABLE v2 USING fts5vocab(t1, 'col'); PRAGMA table_info = v2; } { 0 term {} 0 {} 0 1 col {} 0 {} 0 2 doc {} 0 {} 0 3 cnt {} 0 {} 0 } do_execsql_test 1.2.1 { SELECT * FROM v1 } { } do_execsql_test 1.2.2 { SELECT * FROM v2 } { } do_execsql_test 1.3 { INSERT INTO t1 VALUES('x y z'); INSERT INTO t1 VALUES('x x x'); } do_execsql_test 1.4.1 { SELECT * FROM v1; } [star_from_row {x 2 4 y 1 1 z 1 1}] do_execsql_test 1.4.2 { SELECT * FROM v2; } [star_from_col {x one 2 4 y one 1 1 z one 1 1}] do_execsql_test 1.5.1 { BEGIN; INSERT INTO t1 VALUES('a b c'); SELECT * FROM v1 WHERE term<'d'; } [star_from_row {a 1 1 b 1 1 c 1 1}] do_execsql_test 1.5.2 { SELECT * FROM v2 WHERE term<'d'; COMMIT; } [star_from_col {a one 1 1 b one 1 1 c one 1 1}] do_execsql_test 1.6 { DELETE FROM t1 WHERE one = 'a b c'; SELECT * FROM v1; } [star_from_row {x 2 4 y 1 1 z 1 1}] #------------------------------------------------------------------------- # do_execsql_test 2.0 { CREATE VIRTUAL TABLE tt USING fts5(a, b, detail=%DETAIL%); INSERT INTO tt VALUES('d g b f d f', 'f c e c d a'); INSERT INTO tt VALUES('f a e a a b', 'e d c f d d'); INSERT INTO tt VALUES('b c a a a b', 'f f c c b c'); INSERT INTO tt VALUES('f d c a c e', 'd g d e g d'); INSERT INTO tt VALUES('g d e f a g x', 'f f d a a b'); INSERT INTO tt VALUES('g c f b c g', 'a g f d c b'); INSERT INTO tt VALUES('c e c f g b', 'f e d b g a'); INSERT INTO tt VALUES('g d e f d e', 'a c d b a g'); INSERT INTO tt VALUES('e f a c c b', 'b f e a f d y'); INSERT INTO tt VALUES('c c a a c f', 'd g a e b g'); } set res_row [star_from_row { a 10 20 b 9 14 c 9 20 d 9 19 e 8 13 f 10 20 g 7 14 x 1 1 y 1 1 }] set res_col [star_from_col { a a 6 11 a b 7 9 b a 6 7 b b 7 7 c a 6 12 c b 5 8 d a 4 6 d b 9 13 e a 6 7 e b 6 6 f a 9 10 f b 7 10 g a 5 7 g b 5 7 x a 1 1 y b 1 1 }] if {[detail_is_none]} { set res_col [row_to_col $res_row] } foreach {tn tbl resname} { 1 "fts5vocab(tt, 'col')" res_col 2 "fts5vocab(tt, 'row')" res_row 3 "fts5vocab(tt, \"row\")" res_row 4 "fts5vocab(tt, [row])" res_row 5 "fts5vocab(tt, `row`)" res_row 6 "fts5vocab('tt', 'row')" res_row 7 "fts5vocab(\"tt\", \"row\")" res_row 8 "fts5vocab([tt], [row])" res_row 9 "fts5vocab(`tt`, `row`)" res_row } { do_execsql_test 2.$tn " DROP TABLE IF EXISTS tv; CREATE VIRTUAL TABLE tv USING $tbl; SELECT * FROM tv; " [set $resname] } #------------------------------------------------------------------------- # Test errors in the CREATE VIRTUAL TABLE statement. # foreach {tn sql} { 1 { CREATE VIRTUAL TABLE aa USING fts5vocab() } 2 { CREATE VIRTUAL TABLE aa USING fts5vocab(x) } 3 { CREATE VIRTUAL TABLE aa USING fts5vocab(x,y,z) } 4 { CREATE VIRTUAL TABLE temp.aa USING fts5vocab(x,y,z,y) } } { do_catchsql_test 3.$tn $sql {1 {wrong number of vtable arguments}} } do_catchsql_test 4.0 { CREATE VIRTUAL TABLE cc USING fts5vocab(tbl, unknown); } {1 {fts5vocab: unknown table type: 'unknown'}} do_catchsql_test 4.1 { ATTACH 'test.db' AS aux; CREATE VIRTUAL TABLE aux.cc USING fts5vocab(main, tbl, row); } {1 {wrong number of vtable arguments}} #------------------------------------------------------------------------- # Test fts5vocab tables created in the temp schema. # reset_db forcedelete test.db2 do_execsql_test 5.0 { ATTACH 'test.db2' AS aux; CREATE VIRTUAL TABLE t1 USING fts5(x, detail=%DETAIL%); CREATE VIRTUAL TABLE temp.t1 USING fts5(x, detail=%DETAIL%); CREATE VIRTUAL TABLE aux.t1 USING fts5(x, detail=%DETAIL%); INSERT INTO main.t1 VALUES('a b c'); INSERT INTO main.t1 VALUES('d e f'); INSERT INTO main.t1 VALUES('a e c'); INSERT INTO temp.t1 VALUES('1 2 3'); INSERT INTO temp.t1 VALUES('4 5 6'); INSERT INTO temp.t1 VALUES('1 5 3'); INSERT INTO aux.t1 VALUES('x y z'); INSERT INTO aux.t1 VALUES('m n o'); INSERT INTO aux.t1 VALUES('x n z'); } do_execsql_test 5.1 { CREATE VIRTUAL TABLE temp.vm USING fts5vocab(main, t1, row); CREATE VIRTUAL TABLE temp.vt1 USING fts5vocab(t1, row); CREATE VIRTUAL TABLE temp.vt2 USING fts5vocab(temp, t1, row); CREATE VIRTUAL TABLE temp.va USING fts5vocab(aux, t1, row); } do_execsql_test 5.2 { SELECT * FROM vm } [star_from_row { a 2 2 b 1 1 c 2 2 d 1 1 e 2 2 f 1 1 }] do_execsql_test 5.3 { SELECT * FROM vt1 } [star_from_row { 1 2 2 2 1 1 3 2 2 4 1 1 5 2 2 6 1 1 }] do_execsql_test 5.4 { SELECT * FROM vt2 } [star_from_row { 1 2 2 2 1 1 3 2 2 4 1 1 5 2 2 6 1 1 }] do_execsql_test 5.5 { SELECT * FROM va } [star_from_row { m 1 1 n 2 2 o 1 1 x 2 2 y 1 1 z 2 2 }] #------------------------------------------------------------------------- # do_execsql_test 6.0 { CREATE TABLE iii(iii); CREATE TABLE jjj(x); } do_catchsql_test 6.1 { CREATE VIRTUAL TABLE vocab1 USING fts5vocab(iii, row); SELECT * FROM vocab1; } {1 {no such fts5 table: main.iii}} do_catchsql_test 6.2 { CREATE VIRTUAL TABLE vocab2 USING fts5vocab(jjj, row); SELECT * FROM vocab2; } {1 {no such fts5 table: main.jjj}} do_catchsql_test 6.2 { CREATE VIRTUAL TABLE vocab3 USING fts5vocab(lll, row); SELECT * FROM vocab3; } {1 {no such fts5 table: main.lll}} #------------------------------------------------------------------------- # Test single term queries on fts5vocab tables (i.e. those with term=? # constraints in the WHERE clause). # do_execsql_test 7.0 { CREATE VIRTUAL TABLE tx USING fts5(one, two, detail=%DETAIL%); INSERT INTO tx VALUES('g a ggg g a b eee', 'cc d aa ff g ee'); INSERT INTO tx VALUES('dd fff i a i jjj', 'f fff hh jj e f'); INSERT INTO tx VALUES('ggg a f f fff dd aa', 'd ggg f f j gg ddd'); INSERT INTO tx VALUES('e bb h jjj ii gg', 'e aa e f c fff'); INSERT INTO tx VALUES('j ff aa a h', 'h a j bbb bb'); INSERT INTO tx VALUES('cc i ff c d f', 'dd ii fff f c cc d'); INSERT INTO tx VALUES('jjj g i bb cc eee', 'hhh iii aaa b bbb aaa'); INSERT INTO tx VALUES('hhh hhh hhh bb fff f', 'fff gg aa ii h a'); INSERT INTO tx VALUES('b c cc aaa iii ggg f', 'iii ff ee a ff c cc'); INSERT INTO tx VALUES('hhh b hhh aaa j i i', 'dd ee ee aa bbb iii'); INSERT INTO tx VALUES('hh dd h b g ff i', 'ccc bb cc ccc f a d'); INSERT INTO tx VALUES('g d b ggg jj', 'fff jj ff jj g gg ee'); INSERT INTO tx VALUES('g ee ggg ggg cc bb eee', 'aa j jjj bbb dd eee ff'); INSERT INTO tx VALUES('c jjj hh ddd dd h', 'e aaa h jjj gg'); CREATE VIRTUAL TABLE txr USING fts5vocab(tx, row); CREATE VIRTUAL TABLE txc USING fts5vocab(tx, col); } proc cont {L elem} { set n 0 foreach e $L { if {$elem==$e} {incr n} } set n } db func cont cont foreach {term} { a aa aaa b bb bbb c cc ccc d dd ddd e ee eee f ff fff g gg ggg h hh hhh i ii iii j jj jjj } { set resr [db eval { SELECT $term, sum(cont(one || ' ' || two, $term) > 0), sum(cont(one || ' ' || two, $term)) FROM tx }] if {[lindex $resr 1]==0} {set resr [list]} set r1 [db eval { SELECT $term, 'one', sum(cont(one, $term)>0), sum(cont(one, $term)) FROM tx }] if {[lindex $r1 2]==0} {set r1 [list]} set r2 [db eval { SELECT $term, 'two', sum(cont(two, $term)>0), sum(cont(two, $term)) FROM tx }] if {[lindex $r2 2]==0} {set r2 [list]} set resc [concat $r1 $r2] set resc [star_from_col $resc] set resr [star_from_row $resr] if {[detail_is_none]} { set resc [row_to_col $resr] } do_execsql_test 7.$term.1 {SELECT * FROM txc WHERE term=$term} $resc do_execsql_test 7.$term.2 {SELECT * FROM txr WHERE term=$term} $resr } do_execsql_test 7.1 { CREATE TABLE txr_c AS SELECT * FROM txr; CREATE TABLE txc_c AS SELECT * FROM txc; } # Test range queries on the fts5vocab tables created above. # foreach {tn a b} { 1 a jjj 2 bb j 3 ccc ddd 4 dd xyz 5 xzy dd 6 h hh } { do_execsql_test 7.2.$tn.1 { SELECT * FROM txr WHERE term>=$a } [db eval {SELECT * FROM txr_c WHERE term>=$a}] do_execsql_test 7.2.$tn.2 { SELECT * FROM txr WHERE term<=$b } [db eval {SELECT * FROM txr_c WHERE term <=$b}] do_execsql_test 7.2.$tn.3 { SELECT * FROM txr WHERE term>=$a AND term<=$b } [db eval {SELECT * FROM txr_c WHERE term>=$a AND term <=$b}] do_execsql_test 7.2.$tn.4 { SELECT * FROM txc WHERE term>=$a } [db eval {SELECT * FROM txc_c WHERE term>=$a}] do_execsql_test 7.2.$tn.5 { SELECT * FROM txc WHERE term<=$b } [db eval {SELECT * FROM txc_c WHERE term <=$b}] do_execsql_test 7.2.$tn.6 { SELECT * FROM txc WHERE term>=$a AND term<=$b } [db eval {SELECT * FROM txc_c WHERE term>=$a AND term <=$b}] do_execsql_test 7.2.$tn.7 { SELECT * FROM txr WHERE term>$a } [db eval {SELECT * FROM txr_c WHERE term>$a}] do_execsql_test 7.2.$tn.8 { SELECT * FROM txr WHERE term<$b } [db eval {SELECT * FROM txr_c WHERE term<$b}] do_execsql_test 7.2.$tn.9 { SELECT * FROM txr WHERE term>$a AND term<$b } [db eval {SELECT * FROM txr_c WHERE term>$a AND term <$b}] do_execsql_test 7.2.$tn.10 { SELECT * FROM txc WHERE term>$a } [db eval {SELECT * FROM txc_c WHERE term>$a}] do_execsql_test 7.2.$tn.11 { SELECT * FROM txc WHERE term<$b } [db eval {SELECT * FROM txc_c WHERE term<$b}] do_execsql_test 7.2.$tn.12 { SELECT * FROM txc WHERE term>$a AND term<$b } [db eval {SELECT * FROM txc_c WHERE term>$a AND term <$b}] } do_execsql_test 7.3.1 { SELECT count(*) FROM txr, txr_c WHERE txr.term = txr_c.term; } {30} if {![detail_is_none]} { do_execsql_test 7.3.2 { SELECT count(*) FROM txc, txc_c WHERE txc.term = txc_c.term AND txc.col=txc_c.col; } {57} } } #------------------------------------------------------------------------- # Test the fts5vocab tables response to a specific types of corruption: # where the fts5 index contains hits for columns that do not exist. # do_execsql_test 8.0 { CREATE VIRTUAL TABLE x1 USING fts5(a, b, c, detail=%DETAIL%); INSERT INTO x1 VALUES('a b c', 'd e f', 'g h i'); INSERT INTO x1 VALUES('g h i', 'a b c', 'd e f'); INSERT INTO x1 VALUES('d e f', 'g h i', 'a b c'); CREATE VIRTUAL TABLE x1_r USING fts5vocab(x1, row); CREATE VIRTUAL TABLE x1_c USING fts5vocab(x1, col); } set resr [star_from_row {a 3 3 b 3 3 c 3 3 d 3 3 e 3 3 f 3 3 g 3 3 h 3 3 i 3 3}] set resc [star_from_col { a a 1 1 a b 1 1 a c 1 1 b a 1 1 b b 1 1 b c 1 1 c a 1 1 c b 1 1 c c 1 1 d a 1 1 d b 1 1 d c 1 1 e a 1 1 e b 1 1 e c 1 1 f a 1 1 f b 1 1 f c 1 1 g a 1 1 g b 1 1 g c 1 1 h a 1 1 h b 1 1 h c 1 1 i a 1 1 i b 1 1 i c 1 1 }] if {[detail_is_none]} { set resc [row_to_col $resr] } do_execsql_test 8.1.1 { SELECT * FROM x1_r; } $resr do_execsql_test 8.1.2 { SELECT * FROM x1_c } $resc do_execsql_test 8.2 { PRAGMA writable_schema = 1; UPDATE sqlite_master SET sql = 'CREATE VIRTUAL TABLE x1 USING fts5(a, detail=%DETAIL%)' WHERE name = 'x1'; } db close sqlite3 db test.db sqlite3_fts5_may_be_corrupt 1 do_execsql_test 8.2.1 { SELECT * FROM x1_r } $resr if {[detail_is_none]} { do_execsql_test 8.2.2 { SELECT * FROM x1_c } $resc } else { do_catchsql_test 8.2.2 { SELECT * FROM x1_c } {1 {database disk image is malformed}} } sqlite3_fts5_may_be_corrupt 0 } #------------------------------------------------------------------------- # Test that both "ORDER BY term" and "ORDER BY term DESC" work. # reset_db do_execsql_test 9.1 { CREATE VIRTUAL TABLE x1 USING fts5(x); INSERT INTO x1 VALUES('def ABC ghi'); INSERT INTO x1 VALUES('DEF abc GHI'); } do_execsql_test 9.2 { CREATE VIRTUAL TABLE rrr USING fts5vocab(x1, row); SELECT * FROM rrr } { abc 2 2 def 2 2 ghi 2 2 } do_execsql_test 9.3 { SELECT * FROM rrr ORDER BY term ASC } { abc 2 2 def 2 2 ghi 2 2 } do_execsql_test 9.4 { SELECT * FROM rrr ORDER BY term DESC } { ghi 2 2 def 2 2 abc 2 2 } do_test 9.5 { set e2 [db eval { EXPLAIN SELECT * FROM rrr ORDER BY term ASC }] expr [lsearch $e2 SorterSort]<0 } 1 do_test 9.6 { set e2 [db eval { EXPLAIN SELECT * FROM rrr ORDER BY term DESC }] expr [lsearch $e2 SorterSort]<0 } 0 finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/test/fts5vocab2.test ================================================ # 2017 August 10 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # # The tests in this file focus on testing the fts5vocab module. # source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5vocab # If SQLITE_ENABLE_FTS5 is defined, omit this file. ifcapable !fts5 { finish_test return } do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a, b); CREATE VIRTUAL TABLE v1 USING fts5vocab(t1, instance); INSERT INTO t1 VALUES('one two', 'two three'); INSERT INTO t1 VALUES('three four', 'four five five five'); } do_execsql_test 1.1 { SELECT * FROM v1; } { five 2 b 1 five 2 b 2 five 2 b 3 four 2 a 1 four 2 b 0 one 1 a 0 three 1 b 1 three 2 a 0 two 1 a 1 two 1 b 0 } do_execsql_test 1.2 { SELECT * FROM v1 WHERE term='three'; } { three 1 b 1 three 2 a 0 } do_execsql_test 1.3 { BEGIN; DELETE FROM t1 WHERE rowid=2; SELECT * FROM v1; ROLLBACK; } { one 1 a 0 three 1 b 1 two 1 a 1 two 1 b 0 } do_execsql_test 1.4 { BEGIN; DELETE FROM t1 WHERE rowid=1; SELECT * FROM v1; ROLLBACK; } { five 2 b 1 five 2 b 2 five 2 b 3 four 2 a 1 four 2 b 0 three 2 a 0 } do_execsql_test 1.5 { DELETE FROM t1; SELECT * FROM v1; } { } #------------------------------------------------------------------------- # do_execsql_test 2.0 { DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS v1; CREATE VIRTUAL TABLE t1 USING fts5(a, b, detail=column); CREATE VIRTUAL TABLE v1 USING fts5vocab(t1, instance); INSERT INTO t1 VALUES('one two', 'two three'); INSERT INTO t1 VALUES('three four', 'four five five five'); } do_execsql_test 2.1 { SELECT * FROM v1; } { five 2 b {} four 2 a {} four 2 b {} one 1 a {} three 1 b {} three 2 a {} two 1 a {} two 1 b {} } do_execsql_test 2.2 { SELECT * FROM v1 WHERE term='three'; } { three 1 b {} three 2 a {} } do_execsql_test 2.3 { BEGIN; DELETE FROM t1 WHERE rowid=2; SELECT * FROM v1; ROLLBACK; } { one 1 a {} three 1 b {} two 1 a {} two 1 b {} } do_execsql_test 2.4 { BEGIN; DELETE FROM t1 WHERE rowid=1; SELECT * FROM v1; ROLLBACK; } { five 2 b {} four 2 a {} four 2 b {} three 2 a {} } do_execsql_test 2.5 { DELETE FROM t1; SELECT * FROM v1; } { } #------------------------------------------------------------------------- # do_execsql_test 3.0 { DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS v1; CREATE VIRTUAL TABLE t1 USING fts5(a, b, detail=none); CREATE VIRTUAL TABLE v1 USING fts5vocab(t1, instance); INSERT INTO t1 VALUES('one two', 'two three'); INSERT INTO t1 VALUES('three four', 'four five five five'); } do_execsql_test 3.1 { SELECT * FROM v1; } { five 2 {} {} four 2 {} {} one 1 {} {} three 1 {} {} three 2 {} {} two 1 {} {} } do_execsql_test 3.2 { SELECT * FROM v1 WHERE term='three'; } { three 1 {} {} three 2 {} {} } do_execsql_test 3.3 { BEGIN; DELETE FROM t1 WHERE rowid=2; SELECT * FROM v1; ROLLBACK; } { one 1 {} {} three 1 {} {} two 1 {} {} } do_execsql_test 3.4 { BEGIN; DELETE FROM t1 WHERE rowid=1; SELECT * FROM v1; ROLLBACK; } { five 2 {} {} four 2 {} {} three 2 {} {} } do_execsql_test 3.5 { DELETE FROM t1; SELECT * FROM v1; } { } finish_test ================================================ FILE: v2/testdata/_sqlite/ext/fts5/tool/fts5speed.tcl ================================================ set Q { {1 "SELECT count(*) FROM t1 WHERE t1 MATCH 'enron'"} {25 "SELECT count(*) FROM t1 WHERE t1 MATCH 'hours'"} {300 "SELECT count(*) FROM t1 WHERE t1 MATCH 'acid'"} {100 "SELECT count(*) FROM t1 WHERE t1 MATCH 'loaned OR mobility OR popcore OR sunk'"} {100 "SELECT count(*) FROM t1 WHERE t1 MATCH 'enron AND myapps'"} {1 "SELECT count(*) FROM t1 WHERE t1 MATCH 'en* AND my*'"} {1 "SELECT count(*) FROM t1 WHERE t1 MATCH 'c:t*'"} {1 "SELECT count(*) FROM t1 WHERE t1 MATCH 'a:t* OR b:t* OR c:t* OR d:t* OR e:t* OR f:t* OR g:t*'"} {1 "SELECT count(*) FROM t1 WHERE t1 MATCH 'a:t*'"} {2 "SELECT count(*) FROM t1 WHERE t1 MATCH 'c:the'"} {2 "SELECT count(*) FROM t1 WHERE t1 MATCH 'd:holmes OR e:holmes OR f:holmes OR g:holmes'" } {2 "SELECT count(*) FROM t1 WHERE t1 MATCH 'd:holmes AND e:holmes AND f:holmes AND g:holmes'" } {4 "SELECT count(*) FROM t1 WHERE t1 MATCH 'd:holmes NOT e:holmes'" } } proc usage {} { global Q puts stderr "Usage: $::argv0 DATABASE QUERY" puts stderr "" for {set i 1} {$i <= [llength $Q]} {incr i} { puts stderr " $i. [lindex $Q [expr $i-1]]" } puts stderr "" exit -1 } set nArg [llength $argv] if {$nArg!=2 && $nArg!=3} usage set database [lindex $argv 0] set iquery [lindex $argv 1] if {$iquery<1 || $iquery>[llength $Q]} usage set nRepeat 0 if {$nArg==3} { set nRepeat [lindex $argv 2] } sqlite3 db $database catch { load_static_extension db fts5 } incr iquery -1 set sql [lindex $Q $iquery 1] if {$nRepeat==0} { set nRepeat [lindex $Q $iquery 0] } puts "sql: $sql" puts "nRepeat: $nRepeat" if {[regexp matchinfo $sql]} { sqlite3_fts5_register_matchinfo db db eval $sql } else { puts "result: [db eval $sql]" } for {set i 1} {$i < $nRepeat} {incr i} { db eval $sql } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/tool/fts5txt2db.tcl ================================================ ########################################################################## # 2016 Jan 27 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # proc process_cmdline {} { cmdline::process ::A $::argv { {fts5 "use fts5 (this is the default)"} {fts4 "use fts4"} {colsize "10 10 10" "list of column sizes"} {tblname "t1" "table name to create"} {detail "full" "Fts5 detail mode to use"} {repeat 1 "Load each file this many times"} {prefix "" "Fts prefix= option"} {trans 1 "True to use a transaction"} database file... } { This script is designed to create fts4/5 tables with more than one column. The -colsize option should be set to a Tcl list of integer values, one for each column in the table. Each value is the number of tokens that will be inserted into the column value for each row. For example, setting the -colsize option to "5 10" creates an FTS table with 2 columns, with roughly 5 and 10 tokens per row in each, respectively. Each "FILE" argument should be a text file. The contents of these text files is split on whitespace characters to form a list of tokens. The first N1 tokens are used for the first column of the first row, where N1 is the first element of the -colsize list. The next N2 are used for the second column of the first row, and so on. Rows are added to the table until the entire list of tokens is exhausted. } } ########################################################################### ########################################################################### # Command line options processor. This is generic code that can be copied # between scripts. # namespace eval cmdline { proc cmdline_error {O E {msg ""}} { if {$msg != ""} { puts stderr "Error: $msg" puts stderr "" } set L [list] foreach o $O { if {[llength $o]==1} { lappend L [string toupper $o] } } puts stderr "Usage: $::argv0 ?SWITCHES? $L" puts stderr "" puts stderr "Switches are:" foreach o $O { if {[llength $o]==3} { foreach {a b c} $o {} puts stderr [format " -%-15s %s (default \"%s\")" "$a VAL" $c $b] } elseif {[llength $o]==2} { foreach {a b} $o {} puts stderr [format " -%-15s %s" $a $b] } } puts stderr "" puts stderr $E exit -1 } proc process {avar lArgs O E} { upvar $avar A set zTrailing "" ;# True if ... is present in $O set lPosargs [list] # Populate A() with default values. Also, for each switch in the command # line spec, set an entry in the idx() array as follows: # # {tblname t1 "table name to use"} # -> [set idx(-tblname) {tblname t1 "table name to use"} # # For each position parameter, append its name to $lPosargs. If the ... # specifier is present, set $zTrailing to the name of the prefix. # foreach o $O { set nm [lindex $o 0] set nArg [llength $o] switch -- $nArg { 1 { if {[string range $nm end-2 end]=="..."} { set zTrailing [string range $nm 0 end-3] } else { lappend lPosargs $nm } } 2 { set A($nm) 0 set idx(-$nm) $o } 3 { set A($nm) [lindex $o 1] set idx(-$nm) $o } default { error "Error in command line specification" } } } # Set explicitly specified option values # set nArg [llength $lArgs] for {set i 0} {$i < $nArg} {incr i} { set opt [lindex $lArgs $i] if {[string range $opt 0 0]!="-" || $opt=="--"} break set c [array names idx "${opt}*"] if {[llength $c]==0} { cmdline_error $O $E "Unrecognized option: $opt"} if {[llength $c]>1} { cmdline_error $O $E "Ambiguous option: $opt"} if {[llength $idx($c)]==3} { if {$i==[llength $lArgs]-1} { cmdline_error $O $E "Option requires argument: $c" } incr i set A([lindex $idx($c) 0]) [lindex $lArgs $i] } else { set A([lindex $idx($c) 0]) 1 } } # Deal with position arguments. # set nPosarg [llength $lPosargs] set nRem [expr $nArg - $i] if {$nRem < $nPosarg || ($zTrailing=="" && $nRem > $nPosarg)} { cmdline_error $O $E } for {set j 0} {$j < $nPosarg} {incr j} { set A([lindex $lPosargs $j]) [lindex $lArgs [expr $j+$i]] } if {$zTrailing!=""} { set A($zTrailing) [lrange $lArgs [expr $j+$i] end] } } } ;# namespace eval cmdline # End of command line options processor. ########################################################################### ########################################################################### process_cmdline # If -fts4 was specified, use fts4. Otherwise, fts5. if {$A(fts4)} { set A(fts) fts4 } else { set A(fts) fts5 } sqlite3 db $A(database) # Create the FTS table in the db. Return a list of the table columns. # proc create_table {} { global A set cols [list a b c d e f g h i j k l m n o p q r s t u v w x y z] set nCol [llength $A(colsize)] set cols [lrange $cols 0 [expr $nCol-1]] set sql "CREATE VIRTUAL TABLE IF NOT EXISTS $A(tblname) USING $A(fts) (" append sql [join $cols ,] if {$A(fts)=="fts5"} { append sql ",detail=$A(detail)" } append sql ", prefix='$A(prefix)');" db eval $sql return $cols } # Return a list of tokens from the named file. # proc readfile {file} { set fd [open $file] set data [read $fd] close $fd split $data } proc repeat {L n} { set res [list] for {set i 0} {$i < $n} {incr i} { set res [concat $res $L] } set res } # Load all the data into a big list of tokens. # set tokens [list] foreach f $A(file) { set tokens [concat $tokens [repeat [readfile $f] $A(repeat)]] } set N [llength $tokens] set i 0 set cols [create_table] set sql "INSERT INTO $A(tblname) VALUES(\$R([lindex $cols 0])" foreach c [lrange $cols 1 end] { append sql ", \$R($c)" } append sql ")" if {$A(trans)} { db eval BEGIN } while {$i < $N} { foreach c $cols s $A(colsize) { set R($c) [lrange $tokens $i [expr $i+$s-1]] incr i $s } db eval $sql } if {$A(trans)} { db eval COMMIT } ================================================ FILE: v2/testdata/_sqlite/ext/fts5/tool/loadfts5.tcl ================================================ proc loadfile {f} { set fd [open $f] set data [read $fd] close $fd return $data } set ::nRow 0 set ::nRowPerDot 1000 proc load_hierachy {dir} { foreach f [glob -nocomplain -dir $dir *] { if {$::O(limit) && $::nRow>=$::O(limit)} break if {[file isdir $f]} { load_hierachy $f } else { db eval { INSERT INTO t1 VALUES($f, loadfile($f)) } incr ::nRow if {$::O(trans) && ($::nRow % $::O(trans))==0} { db eval { COMMIT } db eval { INSERT INTO t1(t1) VALUES('integrity-check') } db eval { BEGIN } } if {($::nRow % $::nRowPerDot)==0} { puts -nonewline . if {($::nRow % (65*$::nRowPerDot))==0} { puts "" } flush stdout } } } } proc usage {} { puts stderr "Usage: $::argv0 ?SWITCHES? DATABASE PATH" puts stderr "" puts stderr "Switches are:" puts stderr " -fts4 (use fts4 instead of fts5)" puts stderr " -fts5 (use fts5)" puts stderr " -porter (use porter tokenizer)" puts stderr " -delete (delete the database file before starting)" puts stderr " -limit N (load no more than N documents)" puts stderr " -automerge N (set the automerge parameter to N)" puts stderr " -crisismerge N (set the crisismerge parameter to N)" puts stderr " -prefix PREFIX (comma separated prefix= argument)" puts stderr " -trans N (commit after N inserts - 0 == never)" puts stderr " -hashsize N (set the fts5 hashsize parameter to N)" puts stderr " -detail MODE (detail mode for fts5 tables)" exit 1 } set O(vtab) fts5 set O(tok) "" set O(limit) 0 set O(delete) 0 set O(automerge) -1 set O(crisismerge) -1 set O(prefix) "" set O(trans) 0 set O(hashsize) -1 set O(detail) full if {[llength $argv]<2} usage set nOpt [expr {[llength $argv]-2}] for {set i 0} {$i < $nOpt} {incr i} { set arg [lindex $argv $i] switch -- [lindex $argv $i] { -fts4 { set O(vtab) fts4 } -fts5 { set O(vtab) fts5 } -porter { set O(tok) ", tokenize=porter" } -delete { set O(delete) 1 } -limit { if { [incr i]>=$nOpt } usage set O(limit) [lindex $argv $i] } -trans { if { [incr i]>=$nOpt } usage set O(trans) [lindex $argv $i] } -automerge { if { [incr i]>=$nOpt } usage set O(automerge) [lindex $argv $i] } -crisismerge { if { [incr i]>=$nOpt } usage set O(crisismerge) [lindex $argv $i] } -prefix { if { [incr i]>=$nOpt } usage set O(prefix) [lindex $argv $i] } -hashsize { if { [incr i]>=$nOpt } usage set O(hashsize) [lindex $argv $i] } -detail { if { [incr i]>=$nOpt } usage set O(detail) [lindex $argv $i] } default { usage } } } set dbfile [lindex $argv end-1] if {$O(delete)} { file delete -force $dbfile } sqlite3 db $dbfile catch { load_static_extension db fts5 } db func loadfile loadfile db eval "PRAGMA page_size=4096" db eval BEGIN set pref "" if {$O(prefix)!=""} { set pref ", prefix='$O(prefix)'" } if {$O(vtab)=="fts5"} { append pref ", detail=$O(detail)" } catch { db eval "CREATE VIRTUAL TABLE t1 USING $O(vtab) (path, content$O(tok)$pref)" db eval "INSERT INTO t1(t1, rank) VALUES('pgsz', 4050);" } if {$O(hashsize)>=0} { catch { db eval "INSERT INTO t1(t1, rank) VALUES('hashsize', $O(hashsize));" } } if {$O(automerge)>=0} { if {$O(vtab) == "fts5"} { db eval { INSERT INTO t1(t1, rank) VALUES('automerge', $O(automerge)) } } else { db eval { INSERT INTO t1(t1) VALUES('automerge=' || $O(automerge)) } } } if {$O(crisismerge)>=0} { if {$O(vtab) == "fts5"} { db eval {INSERT INTO t1(t1, rank) VALUES('crisismerge', $O(crisismerge))} } else { } } load_hierachy [lindex $argv end] db eval COMMIT puts "" ================================================ FILE: v2/testdata/_sqlite/ext/fts5/tool/mkfts5c.tcl ================================================ #!/bin/sh # restart with tclsh \ exec tclsh "$0" "$@" set srcdir [file dirname [file dirname [info script]]] set G(src) [string map [list %dir% $srcdir] { %dir%/fts5.h %dir%/fts5Int.h fts5parse.h fts5parse.c %dir%/fts5_aux.c %dir%/fts5_buffer.c %dir%/fts5_config.c %dir%/fts5_expr.c %dir%/fts5_hash.c %dir%/fts5_index.c %dir%/fts5_main.c %dir%/fts5_storage.c %dir%/fts5_tokenize.c %dir%/fts5_unicode2.c %dir%/fts5_varint.c %dir%/fts5_vocab.c }] set G(hdr) { #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) #if !defined(NDEBUG) && !defined(SQLITE_DEBUG) # define NDEBUG 1 #endif #if defined(NDEBUG) && defined(SQLITE_DEBUG) # undef NDEBUG #endif } set G(footer) { #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) */ } #------------------------------------------------------------------------- # Read and return the entire contents of text file $zFile from disk. # proc readfile {zFile} { set fd [open $zFile] set data [read $fd] close $fd return $data } #------------------------------------------------------------------------- # This command returns a string identifying the current sqlite version - # the equivalent of the SQLITE_SOURCE_ID string. # proc fts5_source_id {zDir} { set top [file dirname [file dirname $zDir]] set uuid [string trim [readfile [file join $top manifest.uuid]]] set L [split [readfile [file join $top manifest]]] set date [lindex $L [expr [lsearch -exact $L D]+1]] set date [string range $date 0 [string last . $date]-1] set date [string map {T { }} $date] return "fts5: $date $uuid" } proc fts5c_init {zOut} { global G set G(fd) stdout set G(fd) [open $zOut w] puts -nonewline $G(fd) $G(hdr) } proc fts5c_printfile {zIn} { global G set data [readfile $zIn] set zTail [file tail $zIn] puts $G(fd) "#line 1 \"$zTail\"" set sub_map [list --FTS5-SOURCE-ID-- [fts5_source_id $::srcdir]] if {$zTail=="fts5parse.c"} { lappend sub_map yy fts5yy YY fts5YY TOKEN FTS5TOKEN } foreach line [split $data "\n"] { if {[regexp {^#include.*fts5} $line]} { set line "/* $line */" } elseif { ![regexp { sqlite3Fts5Init\(} $line] && [regexp {^(const )?[a-zA-Z][a-zA-Z0-9]* [*]?sqlite3Fts5} $line] } { set line "static $line" } set line [string map $sub_map $line] puts $G(fd) $line } } proc fts5c_close {} { global G puts -nonewline $G(fd) $G(footer) if {$G(fd)!="stdout"} { close $G(fd) } } fts5c_init fts5.c foreach f $G(src) { fts5c_printfile $f } fts5c_close ================================================ FILE: v2/testdata/_sqlite/ext/fts5/tool/showfts5.tcl ================================================ #------------------------------------------------------------------------- # Process command line arguments. # proc usage {} { puts stderr "usage: $::argv0 ?OPTIONS? database table" puts stderr "" puts stderr " -nterm (count number of terms in each segment)" puts stderr " -segments (output segment contents)" puts stderr "" exit 1 } set O(nterm) 0 set O(segments) 0 if {[llength $argv]<2} usage foreach a [lrange $argv 0 end-2] { switch -- $a { -nterm { set O(nterm) 1 } -segments { set O(segments) 1 } default { usage } } } set database [lindex $argv end-1] set tbl [lindex $argv end] #------------------------------------------------------------------------- # Count the number of terms in each segment of fts5 table $tbl. Store the # counts in the array variable in the parent context named by parameter # $arrayname, indexed by segment-id. Example: # # count_terms fts_tbl A # foreach {k v} [array get A] { puts "segid=$k nTerm=$v" } # proc count_terms {tbl arrayname} { upvar A $arrayname array unset A db eval "SELECT fts5_decode(rowid, block) AS d FROM ${tbl}_data" { set desc [lindex $d 0] if {[regexp {^segid=([0-9]*)} $desc -> id]} { foreach i [lrange $d 1 end] { if {[string match {term=*} $i]} { incr A($id) } } } } } #------------------------------------------------------------------------- # Start of main program. # sqlite3 db $database catch { load_static_extension db fts5 } if {$O(nterm)} { count_terms $tbl A } db eval "SELECT fts5_decode(rowid, block) AS d FROM ${tbl}_data WHERE id=10" { foreach lvl [lrange $d 1 end] { puts [lrange $lvl 0 2] foreach seg [lrange $lvl 3 end] { if {$::O(nterm)} { regexp {^id=([0-9]*)} $seg -> id set nTerm 0 catch { set nTerm $A($id) } puts [format " % -28s nTerm=%d" $seg $nTerm] } else { puts [format " % -28s" $seg] } } } } if {$O(segments)} { puts "" db eval "SELECT fts5_decode(rowid, block) AS d FROM ${tbl}_data WHERE id>10" { puts $d } } ================================================ FILE: v2/testdata/_sqlite/ext/icu/README.txt ================================================ This directory contains source code for the SQLite "ICU" extension, an integration of the "International Components for Unicode" library with SQLite. Documentation follows. 1. Features 1.1 SQL Scalars upper() and lower() 1.2 Unicode Aware LIKE Operator 1.3 ICU Collation Sequences 1.4 SQL REGEXP Operator 2. Compilation and Usage 3. Bugs, Problems and Security Issues 3.1 The "case_sensitive_like" Pragma 3.2 The SQLITE_MAX_LIKE_PATTERN_LENGTH Macro 3.3 Collation Sequence Security Issue 1. FEATURES 1.1 SQL Scalars upper() and lower() SQLite's built-in implementations of these two functions only provide case mapping for the 26 letters used in the English language. The ICU based functions provided by this extension provide case mapping, where defined, for the full range of unicode characters. ICU provides two types of case mapping, "general" case mapping and "language specific". Refer to ICU documentation for the differences between the two. Specifically: http://www.icu-project.org/userguide/caseMappings.html http://www.icu-project.org/userguide/posix.html#case_mappings To utilise "general" case mapping, the upper() or lower() scalar functions are invoked with one argument: upper('ABC') -> 'abc' lower('abc') -> 'ABC' To access ICU "language specific" case mapping, upper() or lower() should be invoked with two arguments. The second argument is the name of the locale to use. Passing an empty string ("") or SQL NULL value as the second argument is the same as invoking the 1 argument version of upper() or lower(): lower('I', 'en_us') -> 'i' lower('I', 'tr_tr') -> 'ı' (small dotless i) 1.2 Unicode Aware LIKE Operator Similarly to the upper() and lower() functions, the built-in SQLite LIKE operator understands case equivalence for the 26 letters of the English language alphabet. The implementation of LIKE included in this extension uses the ICU function u_foldCase() to provide case independent comparisons for the full range of unicode characters. The U_FOLD_CASE_DEFAULT flag is passed to u_foldCase(), meaning the dotless 'I' character used in the Turkish language is considered to be in the same equivalence class as the dotted 'I' character used by many languages (including English). 1.3 ICU Collation Sequences A special SQL scalar function, icu_load_collation() is provided that may be used to register ICU collation sequences with SQLite. It is always called with exactly two arguments, the ICU locale identifying the collation sequence to ICU, and the name of the SQLite collation sequence to create. For example, to create an SQLite collation sequence named "turkish" using Turkish language sorting rules, the SQL statement: SELECT icu_load_collation('tr_TR', 'turkish'); Or, for Australian English: SELECT icu_load_collation('en_AU', 'australian'); The identifiers "turkish" and "australian" may then be used as collation sequence identifiers in SQL statements: CREATE TABLE aust_turkish_penpals( australian_penpal_name TEXT COLLATE australian, turkish_penpal_name TEXT COLLATE turkish ); 1.4 SQL REGEXP Operator This extension provides an implementation of the SQL binary comparision operator "REGEXP", based on the regular expression functions provided by the ICU library. The syntax of the operator is as described in SQLite documentation: REGEXP This extension uses the ICU defaults for regular expression matching behavior. Specifically, this means that: * Matching is case-sensitive, * Regular expression comments are not allowed within patterns, and * The '^' and '$' characters match the beginning and end of the argument, not the beginning and end of lines within the argument. Even more specifically, the value passed to the "flags" parameter of ICU C function uregex_open() is 0. 2 COMPILATION AND USAGE The easiest way to compile and use the ICU extension is to build and use it as a dynamically loadable SQLite extension. To do this using gcc on *nix: gcc -shared icu.c `icu-config --ldflags` -o libSqliteIcu.so You may need to add "-I" flags so that gcc can find sqlite3ext.h and sqlite3.h. The resulting shared lib, libSqliteIcu.so, may be loaded into sqlite in the same way as any other dynamically loadable extension. 3 BUGS, PROBLEMS AND SECURITY ISSUES 3.1 The "case_sensitive_like" Pragma This extension does not work well with the "case_sensitive_like" pragma. If this pragma is used before the ICU extension is loaded, then the pragma has no effect. If the pragma is used after the ICU extension is loaded, then SQLite ignores the ICU implementation and always uses the built-in LIKE operator. The ICU extension LIKE operator is always case insensitive. 3.2 The SQLITE_MAX_LIKE_PATTERN_LENGTH Macro Passing very long patterns to the built-in SQLite LIKE operator can cause excessive CPU usage. To curb this problem, SQLite defines the SQLITE_MAX_LIKE_PATTERN_LENGTH macro as the maximum length of a pattern in bytes (irrespective of encoding). The default value is defined in internal header file "limits.h". The ICU extension LIKE implementation suffers from the same problem and uses the same solution. However, since the ICU extension code does not include the SQLite file "limits.h", modifying the default value therein does not affect the ICU extension. The default value of SQLITE_MAX_LIKE_PATTERN_LENGTH used by the ICU extension LIKE operator is 50000, defined in source file "icu.c". 3.3 Collation Sequence Security Issue Internally, SQLite assumes that indices stored in database files are sorted according to the collation sequence indicated by the SQL schema. Changing the definition of a collation sequence after an index has been built is therefore equivalent to database corruption. The SQLite library is not very well tested under these conditions, and may contain potential buffer overruns or other programming errors that could be exploited by a malicious programmer. If the ICU extension is used in an environment where potentially malicious users may execute arbitrary SQL (i.e. gears), they should be prevented from invoking the icu_load_collation() function, possibly using the authorisation callback. ================================================ FILE: v2/testdata/_sqlite/ext/icu/icu.c ================================================ /* ** 2007 May 6 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** $Id: icu.c,v 1.7 2007/12/13 21:54:11 drh Exp $ ** ** This file implements an integration between the ICU library ** ("International Components for Unicode", an open-source library ** for handling unicode data) and SQLite. The integration uses ** ICU to provide the following to SQLite: ** ** * An implementation of the SQL regexp() function (and hence REGEXP ** operator) using the ICU uregex_XX() APIs. ** ** * Implementations of the SQL scalar upper() and lower() functions ** for case mapping. ** ** * Integration of ICU and SQLite collation sequences. ** ** * An implementation of the LIKE operator that uses ICU to ** provide case-independent matching. */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ICU) /* Include ICU headers */ #include #include #include #include #include #ifndef SQLITE_CORE #include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 #else #include "sqlite3.h" #endif /* ** Maximum length (in bytes) of the pattern in a LIKE or GLOB ** operator. */ #ifndef SQLITE_MAX_LIKE_PATTERN_LENGTH # define SQLITE_MAX_LIKE_PATTERN_LENGTH 50000 #endif /* ** Version of sqlite3_free() that is always a function, never a macro. */ static void xFree(void *p){ sqlite3_free(p); } /* ** This lookup table is used to help decode the first byte of ** a multi-byte UTF8 character. It is copied here from SQLite source ** code file utf8.c. */ static const unsigned char icuUtf8Trans1[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x00, 0x00, }; #define SQLITE_ICU_READ_UTF8(zIn, c) \ c = *(zIn++); \ if( c>=0xc0 ){ \ c = icuUtf8Trans1[c-0xc0]; \ while( (*zIn & 0xc0)==0x80 ){ \ c = (c<<6) + (0x3f & *(zIn++)); \ } \ } #define SQLITE_ICU_SKIP_UTF8(zIn) \ assert( *zIn ); \ if( *(zIn++)>=0xc0 ){ \ while( (*zIn & 0xc0)==0x80 ){zIn++;} \ } /* ** Compare two UTF-8 strings for equality where the first string is ** a "LIKE" expression. Return true (1) if they are the same and ** false (0) if they are different. */ static int icuLikeCompare( const uint8_t *zPattern, /* LIKE pattern */ const uint8_t *zString, /* The UTF-8 string to compare against */ const UChar32 uEsc /* The escape character */ ){ static const uint32_t MATCH_ONE = (uint32_t)'_'; static const uint32_t MATCH_ALL = (uint32_t)'%'; int prevEscape = 0; /* True if the previous character was uEsc */ while( 1 ){ /* Read (and consume) the next character from the input pattern. */ uint32_t uPattern; SQLITE_ICU_READ_UTF8(zPattern, uPattern); if( uPattern==0 ) break; /* There are now 4 possibilities: ** ** 1. uPattern is an unescaped match-all character "%", ** 2. uPattern is an unescaped match-one character "_", ** 3. uPattern is an unescaped escape character, or ** 4. uPattern is to be handled as an ordinary character */ if( !prevEscape && uPattern==MATCH_ALL ){ /* Case 1. */ uint8_t c; /* Skip any MATCH_ALL or MATCH_ONE characters that follow a ** MATCH_ALL. For each MATCH_ONE, skip one character in the ** test string. */ while( (c=*zPattern) == MATCH_ALL || c == MATCH_ONE ){ if( c==MATCH_ONE ){ if( *zString==0 ) return 0; SQLITE_ICU_SKIP_UTF8(zString); } zPattern++; } if( *zPattern==0 ) return 1; while( *zString ){ if( icuLikeCompare(zPattern, zString, uEsc) ){ return 1; } SQLITE_ICU_SKIP_UTF8(zString); } return 0; }else if( !prevEscape && uPattern==MATCH_ONE ){ /* Case 2. */ if( *zString==0 ) return 0; SQLITE_ICU_SKIP_UTF8(zString); }else if( !prevEscape && uPattern==(uint32_t)uEsc){ /* Case 3. */ prevEscape = 1; }else{ /* Case 4. */ uint32_t uString; SQLITE_ICU_READ_UTF8(zString, uString); uString = (uint32_t)u_foldCase((UChar32)uString, U_FOLD_CASE_DEFAULT); uPattern = (uint32_t)u_foldCase((UChar32)uPattern, U_FOLD_CASE_DEFAULT); if( uString!=uPattern ){ return 0; } prevEscape = 0; } } return *zString==0; } /* ** Implementation of the like() SQL function. This function implements ** the build-in LIKE operator. The first argument to the function is the ** pattern and the second argument is the string. So, the SQL statements: ** ** A LIKE B ** ** is implemented as like(B, A). If there is an escape character E, ** ** A LIKE B ESCAPE E ** ** is mapped to like(B, A, E). */ static void icuLikeFunc( sqlite3_context *context, int argc, sqlite3_value **argv ){ const unsigned char *zA = sqlite3_value_text(argv[0]); const unsigned char *zB = sqlite3_value_text(argv[1]); UChar32 uEsc = 0; /* Limit the length of the LIKE or GLOB pattern to avoid problems ** of deep recursion and N*N behavior in patternCompare(). */ if( sqlite3_value_bytes(argv[0])>SQLITE_MAX_LIKE_PATTERN_LENGTH ){ sqlite3_result_error(context, "LIKE or GLOB pattern too complex", -1); return; } if( argc==3 ){ /* The escape character string must consist of a single UTF-8 character. ** Otherwise, return an error. */ int nE= sqlite3_value_bytes(argv[2]); const unsigned char *zE = sqlite3_value_text(argv[2]); int i = 0; if( zE==0 ) return; U8_NEXT(zE, i, nE, uEsc); if( i!=nE){ sqlite3_result_error(context, "ESCAPE expression must be a single character", -1); return; } } if( zA && zB ){ sqlite3_result_int(context, icuLikeCompare(zA, zB, uEsc)); } } /* ** This function is called when an ICU function called from within ** the implementation of an SQL scalar function returns an error. ** ** The scalar function context passed as the first argument is ** loaded with an error message based on the following two args. */ static void icuFunctionError( sqlite3_context *pCtx, /* SQLite scalar function context */ const char *zName, /* Name of ICU function that failed */ UErrorCode e /* Error code returned by ICU function */ ){ char zBuf[128]; sqlite3_snprintf(128, zBuf, "ICU error: %s(): %s", zName, u_errorName(e)); zBuf[127] = '\0'; sqlite3_result_error(pCtx, zBuf, -1); } /* ** Function to delete compiled regexp objects. Registered as ** a destructor function with sqlite3_set_auxdata(). */ static void icuRegexpDelete(void *p){ URegularExpression *pExpr = (URegularExpression *)p; uregex_close(pExpr); } /* ** Implementation of SQLite REGEXP operator. This scalar function takes ** two arguments. The first is a regular expression pattern to compile ** the second is a string to match against that pattern. If either ** argument is an SQL NULL, then NULL Is returned. Otherwise, the result ** is 1 if the string matches the pattern, or 0 otherwise. ** ** SQLite maps the regexp() function to the regexp() operator such ** that the following two are equivalent: ** ** zString REGEXP zPattern ** regexp(zPattern, zString) ** ** Uses the following ICU regexp APIs: ** ** uregex_open() ** uregex_matches() ** uregex_close() */ static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){ UErrorCode status = U_ZERO_ERROR; URegularExpression *pExpr; UBool res; const UChar *zString = sqlite3_value_text16(apArg[1]); (void)nArg; /* Unused parameter */ /* If the left hand side of the regexp operator is NULL, ** then the result is also NULL. */ if( !zString ){ return; } pExpr = sqlite3_get_auxdata(p, 0); if( !pExpr ){ const UChar *zPattern = sqlite3_value_text16(apArg[0]); if( !zPattern ){ return; } pExpr = uregex_open(zPattern, -1, 0, 0, &status); if( U_SUCCESS(status) ){ sqlite3_set_auxdata(p, 0, pExpr, icuRegexpDelete); }else{ assert(!pExpr); icuFunctionError(p, "uregex_open", status); return; } } /* Configure the text that the regular expression operates on. */ uregex_setText(pExpr, zString, -1, &status); if( !U_SUCCESS(status) ){ icuFunctionError(p, "uregex_setText", status); return; } /* Attempt the match */ res = uregex_matches(pExpr, 0, &status); if( !U_SUCCESS(status) ){ icuFunctionError(p, "uregex_matches", status); return; } /* Set the text that the regular expression operates on to a NULL ** pointer. This is not really necessary, but it is tidier than ** leaving the regular expression object configured with an invalid ** pointer after this function returns. */ uregex_setText(pExpr, 0, 0, &status); /* Return 1 or 0. */ sqlite3_result_int(p, res ? 1 : 0); } /* ** Implementations of scalar functions for case mapping - upper() and ** lower(). Function upper() converts its input to upper-case (ABC). ** Function lower() converts to lower-case (abc). ** ** ICU provides two types of case mapping, "general" case mapping and ** "language specific". Refer to ICU documentation for the differences ** between the two. ** ** To utilise "general" case mapping, the upper() or lower() scalar ** functions are invoked with one argument: ** ** upper('ABC') -> 'abc' ** lower('abc') -> 'ABC' ** ** To access ICU "language specific" case mapping, upper() or lower() ** should be invoked with two arguments. The second argument is the name ** of the locale to use. Passing an empty string ("") or SQL NULL value ** as the second argument is the same as invoking the 1 argument version ** of upper() or lower(). ** ** lower('I', 'en_us') -> 'i' ** lower('I', 'tr_tr') -> '\u131' (small dotless i) ** ** http://www.icu-project.org/userguide/posix.html#case_mappings */ static void icuCaseFunc16(sqlite3_context *p, int nArg, sqlite3_value **apArg){ const UChar *zInput; /* Pointer to input string */ UChar *zOutput = 0; /* Pointer to output buffer */ int nInput; /* Size of utf-16 input string in bytes */ int nOut; /* Size of output buffer in bytes */ int cnt; int bToUpper; /* True for toupper(), false for tolower() */ UErrorCode status; const char *zLocale = 0; assert(nArg==1 || nArg==2); bToUpper = (sqlite3_user_data(p)!=0); if( nArg==2 ){ zLocale = (const char *)sqlite3_value_text(apArg[1]); } zInput = sqlite3_value_text16(apArg[0]); if( !zInput ){ return; } nOut = nInput = sqlite3_value_bytes16(apArg[0]); if( nOut==0 ){ sqlite3_result_text16(p, "", 0, SQLITE_STATIC); return; } for(cnt=0; cnt<2; cnt++){ UChar *zNew = sqlite3_realloc(zOutput, nOut); if( zNew==0 ){ sqlite3_free(zOutput); sqlite3_result_error_nomem(p); return; } zOutput = zNew; status = U_ZERO_ERROR; if( bToUpper ){ nOut = 2*u_strToUpper(zOutput,nOut/2,zInput,nInput/2,zLocale,&status); }else{ nOut = 2*u_strToLower(zOutput,nOut/2,zInput,nInput/2,zLocale,&status); } if( U_SUCCESS(status) ){ sqlite3_result_text16(p, zOutput, nOut, xFree); }else if( status==U_BUFFER_OVERFLOW_ERROR ){ assert( cnt==0 ); continue; }else{ icuFunctionError(p, bToUpper ? "u_strToUpper" : "u_strToLower", status); } return; } assert( 0 ); /* Unreachable */ } /* ** Collation sequence destructor function. The pCtx argument points to ** a UCollator structure previously allocated using ucol_open(). */ static void icuCollationDel(void *pCtx){ UCollator *p = (UCollator *)pCtx; ucol_close(p); } /* ** Collation sequence comparison function. The pCtx argument points to ** a UCollator structure previously allocated using ucol_open(). */ static int icuCollationColl( void *pCtx, int nLeft, const void *zLeft, int nRight, const void *zRight ){ UCollationResult res; UCollator *p = (UCollator *)pCtx; res = ucol_strcoll(p, (UChar *)zLeft, nLeft/2, (UChar *)zRight, nRight/2); switch( res ){ case UCOL_LESS: return -1; case UCOL_GREATER: return +1; case UCOL_EQUAL: return 0; } assert(!"Unexpected return value from ucol_strcoll()"); return 0; } /* ** Implementation of the scalar function icu_load_collation(). ** ** This scalar function is used to add ICU collation based collation ** types to an SQLite database connection. It is intended to be called ** as follows: ** ** SELECT icu_load_collation(, ); ** ** Where is a string containing an ICU locale identifier (i.e. ** "en_AU", "tr_TR" etc.) and is the name of the ** collation sequence to create. */ static void icuLoadCollation( sqlite3_context *p, int nArg, sqlite3_value **apArg ){ sqlite3 *db = (sqlite3 *)sqlite3_user_data(p); UErrorCode status = U_ZERO_ERROR; const char *zLocale; /* Locale identifier - (eg. "jp_JP") */ const char *zName; /* SQL Collation sequence name (eg. "japanese") */ UCollator *pUCollator; /* ICU library collation object */ int rc; /* Return code from sqlite3_create_collation_x() */ assert(nArg==2); (void)nArg; /* Unused parameter */ zLocale = (const char *)sqlite3_value_text(apArg[0]); zName = (const char *)sqlite3_value_text(apArg[1]); if( !zLocale || !zName ){ return; } pUCollator = ucol_open(zLocale, &status); if( !U_SUCCESS(status) ){ icuFunctionError(p, "ucol_open", status); return; } assert(p); rc = sqlite3_create_collation_v2(db, zName, SQLITE_UTF16, (void *)pUCollator, icuCollationColl, icuCollationDel ); if( rc!=SQLITE_OK ){ ucol_close(pUCollator); sqlite3_result_error(p, "Error registering collation function", -1); } } /* ** Register the ICU extension functions with database db. */ int sqlite3IcuInit(sqlite3 *db){ static const struct IcuScalar { const char *zName; /* Function name */ unsigned char nArg; /* Number of arguments */ unsigned short enc; /* Optimal text encoding */ unsigned char iContext; /* sqlite3_user_data() context */ void (*xFunc)(sqlite3_context*,int,sqlite3_value**); } scalars[] = { {"icu_load_collation", 2, SQLITE_UTF8, 1, icuLoadCollation}, {"regexp", 2, SQLITE_ANY|SQLITE_DETERMINISTIC, 0, icuRegexpFunc}, {"lower", 1, SQLITE_UTF16|SQLITE_DETERMINISTIC, 0, icuCaseFunc16}, {"lower", 2, SQLITE_UTF16|SQLITE_DETERMINISTIC, 0, icuCaseFunc16}, {"upper", 1, SQLITE_UTF16|SQLITE_DETERMINISTIC, 1, icuCaseFunc16}, {"upper", 2, SQLITE_UTF16|SQLITE_DETERMINISTIC, 1, icuCaseFunc16}, {"lower", 1, SQLITE_UTF8|SQLITE_DETERMINISTIC, 0, icuCaseFunc16}, {"lower", 2, SQLITE_UTF8|SQLITE_DETERMINISTIC, 0, icuCaseFunc16}, {"upper", 1, SQLITE_UTF8|SQLITE_DETERMINISTIC, 1, icuCaseFunc16}, {"upper", 2, SQLITE_UTF8|SQLITE_DETERMINISTIC, 1, icuCaseFunc16}, {"like", 2, SQLITE_UTF8|SQLITE_DETERMINISTIC, 0, icuLikeFunc}, {"like", 3, SQLITE_UTF8|SQLITE_DETERMINISTIC, 0, icuLikeFunc}, }; int rc = SQLITE_OK; int i; for(i=0; rc==SQLITE_OK && i<(int)(sizeof(scalars)/sizeof(scalars[0])); i++){ const struct IcuScalar *p = &scalars[i]; rc = sqlite3_create_function( db, p->zName, p->nArg, p->enc, p->iContext ? (void*)db : (void*)0, p->xFunc, 0, 0 ); } return rc; } #if !SQLITE_CORE #ifdef _WIN32 __declspec(dllexport) #endif int sqlite3_icu_init( sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ SQLITE_EXTENSION_INIT2(pApi) return sqlite3IcuInit(db); } #endif #endif ================================================ FILE: v2/testdata/_sqlite/ext/icu/sqliteicu.h ================================================ /* ** 2008 May 26 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This header file is used by programs that want to link against the ** ICU extension. All it does is declare the sqlite3IcuInit() interface. */ #include "sqlite3.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ int sqlite3IcuInit(sqlite3 *db); #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/Makefile ================================================ # # This Makefile is designed for use with main.mk in the root directory of # this project. After including main.mk, the users makefile should contain: # # LSMDIR=$(TOP)/ext/lsm1/ # LSMOPTS=-fPIC # include $(LSMDIR)/Makefile # # The most useful targets are [lsmtest] and [lsm.so]. # LSMOBJ = \ lsm_ckpt.o \ lsm_file.o \ lsm_log.o \ lsm_main.o \ lsm_mem.o \ lsm_mutex.o \ lsm_shared.o \ lsm_sorted.o \ lsm_str.o \ lsm_tree.o \ lsm_unix.o \ lsm_win32.o \ lsm_varint.o \ lsm_vtab.o LSMHDR = \ $(LSMDIR)/lsm.h \ $(LSMDIR)/lsmInt.h LSMTESTSRC = $(LSMDIR)/lsm-test/lsmtest1.c $(LSMDIR)/lsm-test/lsmtest2.c \ $(LSMDIR)/lsm-test/lsmtest3.c $(LSMDIR)/lsm-test/lsmtest4.c \ $(LSMDIR)/lsm-test/lsmtest5.c $(LSMDIR)/lsm-test/lsmtest6.c \ $(LSMDIR)/lsm-test/lsmtest7.c $(LSMDIR)/lsm-test/lsmtest8.c \ $(LSMDIR)/lsm-test/lsmtest9.c \ $(LSMDIR)/lsm-test/lsmtest_datasource.c \ $(LSMDIR)/lsm-test/lsmtest_func.c $(LSMDIR)/lsm-test/lsmtest_io.c \ $(LSMDIR)/lsm-test/lsmtest_main.c $(LSMDIR)/lsm-test/lsmtest_mem.c \ $(LSMDIR)/lsm-test/lsmtest_tdb.c $(LSMDIR)/lsm-test/lsmtest_tdb3.c \ $(LSMDIR)/lsm-test/lsmtest_util.c $(LSMDIR)/lsm-test/lsmtest_win32.c # all: lsm.so LSMOPTS += -DLSM_MUTEX_PTHREADS=1 -I$(LSMDIR) lsm.so: $(LSMOBJ) $(TCCX) -shared -o lsm.so $(LSMOBJ) %.o: $(LSMDIR)/%.c $(LSMHDR) sqlite3.h $(TCCX) $(LSMOPTS) -c $< lsmtest$(EXE): $(LSMOBJ) $(LSMTESTSRC) $(LSMTESTHDR) sqlite3.o # $(TCPPX) -c $(TOP)/lsm-test/lsmtest_tdb2.cc $(TCCX) $(LSMOPTS) $(LSMTESTSRC) $(LSMOBJ) sqlite3.o -o lsmtest$(EXE) $(THREADLIB) ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/Makefile.msc ================================================ # # This Makefile is designed for use with Makefile.msc in the root directory # of this project. The Makefile.msc should contain: # # LSMDIR=$(TOP)\ext\lsm1 # !INCLUDE $(LSMDIR)\Makefile.msc # # The most useful targets are [lsmtest.exe] and [lsm.dll]. # LSMOBJ = \ lsm_ckpt.lo \ lsm_file.lo \ lsm_log.lo \ lsm_main.lo \ lsm_mem.lo \ lsm_mutex.lo \ lsm_shared.lo \ lsm_sorted.lo \ lsm_str.lo \ lsm_tree.lo \ lsm_unix.lo \ lsm_win32.lo \ lsm_varint.lo \ lsm_vtab.lo LSMHDR = \ $(LSMDIR)\lsm.h \ $(LSMDIR)\lsmInt.h LSMTESTSRC = $(LSMDIR)\lsm-test\lsmtest1.c $(LSMDIR)\lsm-test\lsmtest2.c \ $(LSMDIR)\lsm-test\lsmtest3.c $(LSMDIR)\lsm-test\lsmtest4.c \ $(LSMDIR)\lsm-test\lsmtest5.c $(LSMDIR)\lsm-test\lsmtest6.c \ $(LSMDIR)\lsm-test\lsmtest7.c $(LSMDIR)\lsm-test\lsmtest8.c \ $(LSMDIR)\lsm-test\lsmtest9.c \ $(LSMDIR)\lsm-test\lsmtest_datasource.c \ $(LSMDIR)\lsm-test\lsmtest_func.c $(LSMDIR)\lsm-test\lsmtest_io.c \ $(LSMDIR)\lsm-test\lsmtest_main.c $(LSMDIR)\lsm-test\lsmtest_mem.c \ $(LSMDIR)\lsm-test\lsmtest_tdb.c $(LSMDIR)\lsm-test\lsmtest_tdb3.c \ $(LSMDIR)\lsm-test\lsmtest_util.c $(LSMDIR)\lsm-test\lsmtest_win32.c # all: lsm.dll lsmtest.exe LSMOPTS = $(NO_WARN) -DLSM_MUTEX_WIN32=1 -I$(LSMDIR) !IF $(DEBUG)>2 LSMOPTS = $(LSMOPTS) -DLSM_DEBUG=1 !ENDIF !IF $(MEMDEBUG)!=0 LSMOPTS = $(LSMOPTS) -DLSM_DEBUG_MEM=1 !ENDIF lsm_ckpt.lo: $(LSMDIR)\lsm_ckpt.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_ckpt.c lsm_file.lo: $(LSMDIR)\lsm_file.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_file.c lsm_log.lo: $(LSMDIR)\lsm_log.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_log.c lsm_main.lo: $(LSMDIR)\lsm_main.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_main.c lsm_mem.lo: $(LSMDIR)\lsm_mem.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_mem.c lsm_mutex.lo: $(LSMDIR)\lsm_mutex.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_mutex.c lsm_shared.lo: $(LSMDIR)\lsm_shared.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_shared.c lsm_sorted.lo: $(LSMDIR)\lsm_sorted.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_sorted.c lsm_str.lo: $(LSMDIR)\lsm_str.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_str.c lsm_tree.lo: $(LSMDIR)\lsm_tree.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_tree.c lsm_unix.lo: $(LSMDIR)\lsm_unix.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_unix.c lsm_win32.lo: $(LSMDIR)\lsm_win32.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_win32.c lsm_varint.lo: $(LSMDIR)\lsm_varint.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_varint.c lsm_vtab.lo: $(LSMDIR)\lsm_vtab.c $(LSMHDR) $(SQLITE3H) $(LTCOMPILE) $(LSMOPTS) -c $(LSMDIR)\lsm_vtab.c lsm.dll: $(LSMOBJ) $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ $(LSMOBJ) copy /Y $@ $(LSMDIR)\$@ lsmtest.exe: $(LSMOBJ) $(LSMTESTSRC) $(LSMTESTHDR) $(LIBOBJ) $(LTLINK) $(LSMOPTS) $(LSMTESTSRC) /link $(LSMOBJ) $(LIBOBJ) copy /Y $@ $(LSMDIR)\$@ ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/README ================================================ Organization of test case files: lsmtest1.c: Data tests. Tests that perform many inserts and deletes on a database file, then verify that the contents of the database can be queried. lsmtest2.c: Crash tests. Tests that attempt to verify that the database recovers correctly following an application or system crash. lsmtest3.c: Rollback tests. Tests that focus on the explicit rollback of transactions and sub-transactions. lsmtest4.c: Multi-client tests. lsmtest5.c: Multi-client tests with a different thread for each client. lsmtest6.c: OOM injection tests. lsmtest7.c: API tests. lsmtest8.c: Writer crash tests. Tests in this file attempt to verify that the system recovers and other clients proceed unaffected if a process fails in the middle of a write transaction. The difference from lsmtest2.c is that this file tests live-recovery (recovery from a failure that occurs while other clients are still running) whereas lsmtest2.c tests recovery from a system or power failure. lsmtest9.c: More data tests. These focus on testing that calling lsm_work(nMerge=1) to compact the database does not corrupt it. In other words, that databases containing block-redirects can be read and written. ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest.h ================================================ #ifndef __WRAPPER_INT_H_ #define __WRAPPER_INT_H_ #include "lsmtest_tdb.h" #include "sqlite3.h" #include "lsm.h" #include #include #include #include #include #ifndef _WIN32 # include #endif #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif #ifdef _WIN32 # include "windows.h" # define gettimeofday win32GetTimeOfDay # define F_OK (0) # define sleep(sec) Sleep(1000 * (sec)) # define usleep(usec) Sleep(((usec) + 999) / 1000) # ifdef _MSC_VER # include # define snprintf _snprintf # define fsync(fd) FlushFileBuffers((HANDLE)_get_osfhandle((fd))) # define fdatasync(fd) FlushFileBuffers((HANDLE)_get_osfhandle((fd))) # define __va_copy(dst,src) ((dst) = (src)) # define ftruncate(fd,sz) ((_chsize_s((fd), (sz))==0) ? 0 : -1) # else # error Unsupported C compiler for Windows. # endif int win32GetTimeOfDay(struct timeval *, void *); #endif #ifndef _LSM_INT_H typedef unsigned int u32; typedef unsigned char u8; typedef long long int i64; typedef unsigned long long int u64; #endif #define ArraySize(x) ((int)(sizeof(x) / sizeof((x)[0]))) #define MIN(x,y) ((x)<(y) ? (x) : (y)) #define MAX(x,y) ((x)>(y) ? (x) : (y)) #define unused_parameter(x) (void)(x) #define TESTDB_DEFAULT_PAGE_SIZE 4096 #define TESTDB_DEFAULT_CACHE_SIZE 2048 #ifndef _O_BINARY # define _O_BINARY (0) #endif /* ** Ideally, these should be in wrapper.c. But they are here instead so that ** they can be used by the C++ database wrappers in wrapper2.cc. */ typedef struct DatabaseMethods DatabaseMethods; struct TestDb { DatabaseMethods const *pMethods; /* Database methods */ const char *zLibrary; /* Library name for tdb_open() */ }; struct DatabaseMethods { int (*xClose)(TestDb *); int (*xWrite)(TestDb *, void *, int , void *, int); int (*xDelete)(TestDb *, void *, int); int (*xDeleteRange)(TestDb *, void *, int, void *, int); int (*xFetch)(TestDb *, void *, int, void **, int *); int (*xScan)(TestDb *, void *, int, void *, int, void *, int, void (*)(void *, void *, int , void *, int) ); int (*xBegin)(TestDb *, int); int (*xCommit)(TestDb *, int); int (*xRollback)(TestDb *, int); }; /* ** Functions in wrapper2.cc (a C++ source file). wrapper2.cc contains the ** wrapper for Kyoto Cabinet. Kyoto cabinet has a C API, but ** the primary interface is the C++ API. */ int test_kc_open(const char*, const char *zFilename, int bClear, TestDb **ppDb); int test_kc_close(TestDb *); int test_kc_write(TestDb *, void *, int , void *, int); int test_kc_delete(TestDb *, void *, int); int test_kc_delete_range(TestDb *, void *, int, void *, int); int test_kc_fetch(TestDb *, void *, int, void **, int *); int test_kc_scan(TestDb *, void *, int, void *, int, void *, int, void (*)(void *, void *, int , void *, int) ); int test_mdb_open(const char*, const char *zFile, int bClear, TestDb **ppDb); int test_mdb_close(TestDb *); int test_mdb_write(TestDb *, void *, int , void *, int); int test_mdb_delete(TestDb *, void *, int); int test_mdb_fetch(TestDb *, void *, int, void **, int *); int test_mdb_scan(TestDb *, void *, int, void *, int, void *, int, void (*)(void *, void *, int , void *, int) ); /* ** Functions in wrapper3.c. This file contains the tdb wrapper for lsm. ** The wrapper for lsm is a bit more involved than the others, as it ** includes code for a couple of different lsm configurations, and for ** various types of fault injection and robustness testing. */ int test_lsm_open(const char*, const char *zFile, int bClear, TestDb **ppDb); int test_lsm_lomem_open(const char*, const char*, int bClear, TestDb **ppDb); int test_lsm_zip_open(const char*, const char*, int bClear, TestDb **ppDb); int test_lsm_small_open(const char*, const char*, int bClear, TestDb **ppDb); int test_lsm_mt2(const char*, const char *zFile, int bClear, TestDb **ppDb); int test_lsm_mt3(const char*, const char *zFile, int bClear, TestDb **ppDb); int tdb_lsm_configure(lsm_db *, const char *); /* Functions in lsmtest_tdb4.c */ int test_bt_open(const char*, const char *zFile, int bClear, TestDb **ppDb); int test_fbt_open(const char*, const char *zFile, int bClear, TestDb **ppDb); int test_fbts_open(const char*, const char *zFile, int bClear, TestDb **ppDb); /* Functions in testutil.c. */ int testPrngInit(void); u32 testPrngValue(u32 iVal); void testPrngArray(u32 iVal, u32 *aOut, int nOut); void testPrngString(u32 iVal, char *aOut, int nOut); void testErrorInit(int argc, char **); void testPrintError(const char *zFormat, ...); void testPrintUsage(const char *zArgs); void testPrintFUsage(const char *zFormat, ...); void testTimeInit(void); int testTimeGet(void); /* Functions in testmem.c. */ void testMallocInstall(lsm_env *pEnv); void testMallocUninstall(lsm_env *pEnv); void testMallocCheck(lsm_env *pEnv, int *, int *, FILE *); void testMallocOom(lsm_env *pEnv, int, int, void(*)(void*), void *); void testMallocOomEnable(lsm_env *pEnv, int); /* lsmtest.c */ TestDb *testOpen(const char *zSystem, int, int *pRc); void testReopen(TestDb **ppDb, int *pRc); void testClose(TestDb **ppDb); void testFetch(TestDb *, void *, int, void *, int, int *); void testWrite(TestDb *, void *, int, void *, int, int *); void testDelete(TestDb *, void *, int, int *); void testDeleteRange(TestDb *, void *, int, void *, int, int *); void testWriteStr(TestDb *, const char *, const char *zVal, int *pRc); void testFetchStr(TestDb *, const char *, const char *, int *pRc); void testBegin(TestDb *pDb, int iTrans, int *pRc); void testCommit(TestDb *pDb, int iTrans, int *pRc); void test_failed(void); char *testMallocPrintf(const char *zFormat, ...); char *testMallocVPrintf(const char *zFormat, va_list ap); int testGlobMatch(const char *zPattern, const char *zStr); void testScanCompare(TestDb *, TestDb *, int, void *, int, void *, int, int *); void testFetchCompare(TestDb *, TestDb *, void *, int, int *); void *testMalloc(int); void *testMallocCopy(void *pCopy, int nByte); void *testRealloc(void *, int); void testFree(void *); /* lsmtest_bt.c */ int do_bt(int nArg, char **azArg); /* testio.c */ int testVfsConfigureDb(TestDb *pDb); /* testfunc.c */ int do_show(int nArg, char **azArg); int do_work(int nArg, char **azArg); /* testio.c */ int do_io(int nArg, char **azArg); /* lsmtest2.c */ void do_crash_test(const char *zPattern, int *pRc); int do_rollback_test(int nArg, char **azArg); /* test3.c */ void test_rollback(const char *zSystem, const char *zPattern, int *pRc); /* test4.c */ void test_mc(const char *zSystem, const char *zPattern, int *pRc); /* test5.c */ void test_mt(const char *zSystem, const char *zPattern, int *pRc); /* lsmtest6.c */ void test_oom(const char *zPattern, int *pRc); void testDeleteLsmdb(const char *zFile); void testSaveDb(const char *zFile, const char *zAuxExt); void testRestoreDb(const char *zFile, const char *zAuxExt); void testCopyLsmdb(const char *zFrom, const char *zTo); /* lsmtest7.c */ void test_api(const char *zPattern, int *pRc); /* lsmtest8.c */ void do_writer_crash_test(const char *zPattern, int *pRc); /************************************************************************* ** Interface to functionality in test_datasource.c. */ typedef struct Datasource Datasource; typedef struct DatasourceDefn DatasourceDefn; struct DatasourceDefn { int eType; /* A TEST_DATASOURCE_* value */ int nMinKey; /* Minimum key size */ int nMaxKey; /* Maximum key size */ int nMinVal; /* Minimum value size */ int nMaxVal; /* Maximum value size */ }; #define TEST_DATASOURCE_RANDOM 1 #define TEST_DATASOURCE_SEQUENCE 2 char *testDatasourceName(const DatasourceDefn *); Datasource *testDatasourceNew(const DatasourceDefn *); void testDatasourceFree(Datasource *); void testDatasourceEntry(Datasource *, int, void **, int *, void **, int *); /* End of test_datasource.c interface. *************************************************************************/ void testDatasourceFetch( TestDb *pDb, /* Database handle */ Datasource *pData, int iKey, int *pRc /* IN/OUT: Error code */ ); void testWriteDatasource(TestDb *, Datasource *, int, int *); void testWriteDatasourceRange(TestDb *, Datasource *, int, int, int *); void testDeleteDatasource(TestDb *, Datasource *, int, int *); void testDeleteDatasourceRange(TestDb *, Datasource *, int, int, int *); /* test1.c */ void test_data_1(const char *, const char *, int *pRc); void test_data_2(const char *, const char *, int *pRc); void test_data_3(const char *, const char *, int *pRc); void testDbContents(TestDb *, Datasource *, int, int, int, int, int, int *); void testCaseProgress(int, int, int, int *); int testCaseNDot(void); void testCompareDb(Datasource *, int, int, TestDb *, TestDb *, int *); int testControlDb(TestDb **ppDb); typedef struct CksumDb CksumDb; CksumDb *testCksumArrayNew(Datasource *, int, int, int); char *testCksumArrayGet(CksumDb *, int); void testCksumArrayFree(CksumDb *); void testCaseStart(int *pRc, char *zFmt, ...); void testCaseFinish(int rc); void testCaseSkip(void); int testCaseBegin(int *, const char *, const char *, ...); #define TEST_CKSUM_BYTES 29 int testCksumDatabase(TestDb *pDb, char *zOut); int testCountDatabase(TestDb *pDb); void testCompareInt(int, int, int *); void testCompareStr(const char *z1, const char *z2, int *pRc); /* lsmtest9.c */ void test_data_4(const char *, const char *, int *pRc); /* ** Similar to the Tcl_GetIndexFromObjStruct() Tcl library function. */ #define testArgSelect(w,x,y,z) testArgSelectX(w,x,sizeof(w[0]),y,z) int testArgSelectX(void *, const char *, int, const char *, int *); #ifdef __cplusplus } /* End of the 'extern "C"' block */ #endif #endif ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest1.c ================================================ #include "lsmtest.h" #define DATA_SEQUENTIAL TEST_DATASOURCE_SEQUENCE #define DATA_RANDOM TEST_DATASOURCE_RANDOM typedef struct Datatest1 Datatest1; typedef struct Datatest2 Datatest2; /* ** An instance of the following structure contains parameters used to ** customize the test function in this file. Test procedure: ** ** 1. Create a data-source based on the "datasource definition" vars. ** ** 2. Insert nRow key value pairs into the database. ** ** 3. Delete all keys from the database. Deletes are done in the same ** order as the inserts. ** ** During steps 2 and 3 above, after each Datatest1.nVerify inserts or ** deletes, the following: ** ** a. Run Datasource.nTest key lookups and check the results are as expected. ** ** b. If Datasource.bTestScan is true, run a handful (8) of range ** queries (scanning forwards and backwards). Check that the results ** are as expected. ** ** c. Close and reopen the database. Then run (a) and (b) again. */ struct Datatest1 { /* Datasource definition */ DatasourceDefn defn; /* Test procedure parameters */ int nRow; /* Number of rows to insert then delete */ int nVerify; /* How often to verify the db contents */ int nTest; /* Number of keys to test (0==all) */ int bTestScan; /* True to do scan tests */ }; /* ** An instance of the following data structure is used to describe the ** second type of test case in this file. The chief difference between ** these tests and those described by Datatest1 is that these tests also ** experiment with range-delete operations. Tests proceed as follows: ** ** 1. Open the datasource described by Datatest2.defn. ** ** 2. Open a connection on an empty database. ** ** 3. Do this Datatest2.nIter times: ** ** a) Insert Datatest2.nWrite key-value pairs from the datasource. ** ** b) Select two pseudo-random keys and use them as the start ** and end points of a range-delete operation. ** ** c) Verify that the contents of the database are as expected (see ** below for details). ** ** d) Close and then reopen the database handle. ** ** e) Verify that the contents of the database are still as expected. ** ** The inserts and range deletes are run twice - once on the database being ** tested and once using a control system (sqlite3, kc etc. - something that ** works). In order to verify that the contents of the db being tested are ** correct, the test runs a bunch of scans and lookups on both the test and ** control databases. If the results are the same, the test passes. */ struct Datatest2 { DatasourceDefn defn; int nRange; int nWrite; /* Number of writes per iteration */ int nIter; /* Total number of iterations to run */ }; /* ** Generate a unique name for the test case pTest with database system ** zSystem. */ static char *getName(const char *zSystem, int bRecover, Datatest1 *pTest){ char *zRet; char *zData; zData = testDatasourceName(&pTest->defn); zRet = testMallocPrintf("data.%s.%s.rec=%d.%d.%d", zSystem, zData, bRecover, pTest->nRow, pTest->nVerify ); testFree(zData); return zRet; } int testControlDb(TestDb **ppDb){ #ifdef HAVE_KYOTOCABINET return tdb_open("kyotocabinet", "tmp.db", 1, ppDb); #else return tdb_open("sqlite3", "", 1, ppDb); #endif } void testDatasourceFetch( TestDb *pDb, /* Database handle */ Datasource *pData, int iKey, int *pRc /* IN/OUT: Error code */ ){ void *pKey; int nKey; /* Database key to query for */ void *pVal; int nVal; /* Expected result of query */ testDatasourceEntry(pData, iKey, &pKey, &nKey, &pVal, &nVal); testFetch(pDb, pKey, nKey, pVal, nVal, pRc); } /* ** This function is called to test that the contents of database pDb ** are as expected. In this case, expected is defined as containing ** key-value pairs iFirst through iLast, inclusive, from data source ** pData. In other words, a loop like the following could be used to ** construct a database with identical contents from scratch. ** ** for(i=iFirst; i<=iLast; i++){ ** testDatasourceEntry(pData, i, &pKey, &nKey, &pVal, &nVal); ** // insert (pKey, nKey) -> (pVal, nVal) into database ** } ** ** The key domain consists of keys 0 to (nRow-1), inclusive, from ** data source pData. For both scan and lookup tests, keys are selected ** pseudo-randomly from within this set. ** ** This function runs nLookupTest lookup tests and nScanTest scan tests. ** ** A lookup test consists of selecting a key from the domain and querying ** pDb for it. The test fails if the presence of the key and, if present, ** the associated value do not match the expectations defined above. ** ** A scan test involves selecting a key from the domain and running ** the following queries: ** ** 1. Scan all keys equal to or greater than the key, in ascending order. ** 2. Scan all keys equal to or smaller than the key, in descending order. ** ** Additionally, if nLookupTest is greater than zero, the following are ** run once: ** ** 1. Scan all keys in the db, in ascending order. ** 2. Scan all keys in the db, in descending order. ** ** As you would assume, the test fails if the returned values do not match ** expectations. */ void testDbContents( TestDb *pDb, /* Database handle being tested */ Datasource *pData, /* pDb contains data from here */ int nRow, /* Size of key domain */ int iFirst, /* Index of first key from pData in pDb */ int iLast, /* Index of last key from pData in pDb */ int nLookupTest, /* Number of lookup tests to run */ int nScanTest, /* Number of scan tests to run */ int *pRc /* IN/OUT: Error code */ ){ int j; int rc = *pRc; if( rc==0 && nScanTest ){ TestDb *pDb2 = 0; /* Open a control db (i.e. one that we assume works) */ rc = testControlDb(&pDb2); for(j=iFirst; rc==0 && j<=iLast; j++){ void *pKey; int nKey; /* Database key to insert */ void *pVal; int nVal; /* Database value to insert */ testDatasourceEntry(pData, j, &pKey, &nKey, &pVal, &nVal); rc = tdb_write(pDb2, pKey, nKey, pVal, nVal); } if( rc==0 ){ int iKey1; int iKey2; void *pKey1; int nKey1; /* Start key */ void *pKey2; int nKey2; /* Final key */ iKey1 = testPrngValue((iFirst<<8) + (iLast<<16)) % nRow; iKey2 = testPrngValue((iLast<<8) + (iFirst<<16)) % nRow; testDatasourceEntry(pData, iKey1, &pKey2, &nKey1, 0, 0); pKey1 = testMalloc(nKey1+1); memcpy(pKey1, pKey2, nKey1+1); testDatasourceEntry(pData, iKey2, &pKey2, &nKey2, 0, 0); testScanCompare(pDb2, pDb, 0, 0, 0, 0, 0, &rc); testScanCompare(pDb2, pDb, 0, 0, 0, pKey2, nKey2, &rc); testScanCompare(pDb2, pDb, 0, pKey1, nKey1, 0, 0, &rc); testScanCompare(pDb2, pDb, 0, pKey1, nKey1, pKey2, nKey2, &rc); testScanCompare(pDb2, pDb, 1, 0, 0, 0, 0, &rc); testScanCompare(pDb2, pDb, 1, 0, 0, pKey2, nKey2, &rc); testScanCompare(pDb2, pDb, 1, pKey1, nKey1, 0, 0, &rc); testScanCompare(pDb2, pDb, 1, pKey1, nKey1, pKey2, nKey2, &rc); testFree(pKey1); } tdb_close(pDb2); } /* Test some lookups. */ for(j=0; rc==0 && j=nRow ){ iKey = j; }else{ iKey = testPrngValue(j + (iFirst<<8) + (iLast<<16)) % nRow; } testDatasourceEntry(pData, iKey, &pKey, &nKey, &pVal, &nVal); if( iFirst>iKey || iKey>iLast ){ pVal = 0; nVal = -1; } testFetch(pDb, pKey, nKey, pVal, nVal, &rc); } *pRc = rc; } /* ** This function should be called during long running test cases to output ** the progress dots (...) to stdout. */ void testCaseProgress(int i, int n, int nDot, int *piDot){ int iDot = *piDot; while( iDot < ( ((nDot*2+1) * i) / (n*2) ) ){ printf("."); fflush(stdout); iDot++; } *piDot = iDot; } int testCaseNDot(void){ return 20; } #if 0 static void printScanCb( void *pCtx, void *pKey, int nKey, void *pVal, int nVal ){ printf("%s\n", (char *)pKey); fflush(stdout); } #endif void testReopenRecover(TestDb **ppDb, int *pRc){ if( *pRc==0 ){ const char *zLib = tdb_library_name(*ppDb); const char *zDflt = tdb_default_db(zLib); testCopyLsmdb(zDflt, "bak.db"); testClose(ppDb); testCopyLsmdb("bak.db", zDflt); *pRc = tdb_open(zLib, 0, 0, ppDb); } } static void doDataTest1( const char *zSystem, /* Database system to test */ int bRecover, Datatest1 *p, /* Structure containing test parameters */ int *pRc /* OUT: Error code */ ){ int i; int iDot; int rc = LSM_OK; Datasource *pData; TestDb *pDb; /* Start the test case, open a database and allocate the datasource. */ pDb = testOpen(zSystem, 1, &rc); pData = testDatasourceNew(&p->defn); i = 0; iDot = 0; while( rc==LSM_OK && inRow ){ /* Insert some data */ testWriteDatasourceRange(pDb, pData, i, p->nVerify, &rc); i += p->nVerify; /* Check that the db content is correct. */ testDbContents(pDb, pData, p->nRow, 0, i-1, p->nTest, p->bTestScan, &rc); if( bRecover ){ testReopenRecover(&pDb, &rc); }else{ testReopen(&pDb, &rc); } /* Check that the db content is still correct. */ testDbContents(pDb, pData, p->nRow, 0, i-1, p->nTest, p->bTestScan, &rc); /* Update the progress dots... */ testCaseProgress(i, p->nRow, testCaseNDot()/2, &iDot); } i = 0; iDot = 0; while( rc==LSM_OK && inRow ){ /* Delete some entries */ testDeleteDatasourceRange(pDb, pData, i, p->nVerify, &rc); i += p->nVerify; /* Check that the db content is correct. */ testDbContents(pDb, pData, p->nRow, i, p->nRow-1,p->nTest,p->bTestScan,&rc); /* Close and reopen the database. */ if( bRecover ){ testReopenRecover(&pDb, &rc); }else{ testReopen(&pDb, &rc); } /* Check that the db content is still correct. */ testDbContents(pDb, pData, p->nRow, i, p->nRow-1,p->nTest,p->bTestScan,&rc); /* Update the progress dots... */ testCaseProgress(i, p->nRow, testCaseNDot()/2, &iDot); } /* Free the datasource, close the database and finish the test case. */ testDatasourceFree(pData); tdb_close(pDb); testCaseFinish(rc); *pRc = rc; } void test_data_1( const char *zSystem, /* Database system name */ const char *zPattern, /* Run test cases that match this pattern */ int *pRc /* IN/OUT: Error code */ ){ Datatest1 aTest[] = { { {DATA_RANDOM, 500,600, 1000,2000}, 1000, 100, 10, 0}, { {DATA_RANDOM, 20,25, 100,200}, 1000, 250, 1000, 1}, { {DATA_RANDOM, 8,10, 100,200}, 1000, 250, 1000, 1}, { {DATA_RANDOM, 8,10, 10,20}, 1000, 250, 1000, 1}, { {DATA_RANDOM, 8,10, 1000,2000}, 1000, 250, 1000, 1}, { {DATA_RANDOM, 8,100, 10000,20000}, 100, 25, 100, 1}, { {DATA_RANDOM, 80,100, 10,20}, 1000, 250, 1000, 1}, { {DATA_RANDOM, 5000,6000, 10,20}, 100, 25, 100, 1}, { {DATA_SEQUENTIAL, 5,10, 10,20}, 1000, 250, 1000, 1}, { {DATA_SEQUENTIAL, 5,10, 100,200}, 1000, 250, 1000, 1}, { {DATA_SEQUENTIAL, 5,10, 1000,2000}, 1000, 250, 1000, 1}, { {DATA_SEQUENTIAL, 5,100, 10000,20000}, 100, 25, 100, 1}, { {DATA_RANDOM, 10,10, 100,100}, 100000, 1000, 100, 0}, { {DATA_SEQUENTIAL, 10,10, 100,100}, 100000, 1000, 100, 0}, }; int i; int bRecover; for(bRecover=0; bRecover<2; bRecover++){ if( bRecover==1 && memcmp(zSystem, "lsm", 3) ) break; for(i=0; *pRc==LSM_OK && idefn); rc = testControlDb(&pControl); if( tdb_lsm(pDb) ){ int nBuf = 32 * 1024 * 1024; lsm_config(tdb_lsm(pDb), LSM_CONFIG_AUTOFLUSH, &nBuf); } for(i=0; rc==0 && inIter; i++){ void *pKey1; int nKey1; void *pKey2; int nKey2; int ii; int nRange = MIN(p->nIter*p->nWrite, p->nRange); for(ii=0; rc==0 && iinWrite; ii++){ int iKey = (i*p->nWrite + ii) % p->nRange; testWriteDatasource(pControl, pData, iKey, &rc); testWriteDatasource(pDb, pData, iKey, &rc); } testDatasourceEntry(pData, i+1000000, &pKey1, &nKey1, 0, 0); pKey1 = testMallocCopy(pKey1, nKey1); testDatasourceEntry(pData, i+2000000, &pKey2, &nKey2, 0, 0); testDeleteRange(pDb, pKey1, nKey1, pKey2, nKey2, &rc); testDeleteRange(pControl, pKey1, nKey1, pKey2, nKey2, &rc); testFree(pKey1); testCompareDb(pData, nRange, i, pControl, pDb, &rc); if( bRecover ){ testReopenRecover(&pDb, &rc); }else{ testReopen(&pDb, &rc); } testCompareDb(pData, nRange, i, pControl, pDb, &rc); /* Update the progress dots... */ testCaseProgress(i, p->nIter, testCaseNDot(), &iDot); } testClose(&pDb); testClose(&pControl); testDatasourceFree(pData); testCaseFinish(rc); *pRc = rc; } static char *getName2(const char *zSystem, int bRecover, Datatest2 *pTest){ char *zRet; char *zData; zData = testDatasourceName(&pTest->defn); zRet = testMallocPrintf("data2.%s.%s.rec=%d.%d.%d.%d", zSystem, zData, bRecover, pTest->nRange, pTest->nWrite, pTest->nIter ); testFree(zData); return zRet; } void test_data_2( const char *zSystem, /* Database system name */ const char *zPattern, /* Run test cases that match this pattern */ int *pRc /* IN/OUT: Error code */ ){ Datatest2 aTest[] = { /* defn, nRange, nWrite, nIter */ { {DATA_RANDOM, 20,25, 100,200}, 10000, 10, 50 }, { {DATA_RANDOM, 20,25, 100,200}, 10000, 200, 50 }, { {DATA_RANDOM, 20,25, 100,200}, 100, 10, 1000 }, { {DATA_RANDOM, 20,25, 100,200}, 100, 200, 50 }, }; int i; int bRecover; for(bRecover=0; bRecover<2; bRecover++){ if( bRecover==1 && memcmp(zSystem, "lsm", 3) ) break; for(i=0; *pRc==LSM_OK && i> 24) & 0xFF; aBuf[1] = (iVal >> 16) & 0xFF; aBuf[2] = (iVal >> 8) & 0xFF; aBuf[3] = (iVal >> 0) & 0xFF; } void dt3PutKey(u8 *aBuf, int iKey){ assert( iKey<100000 && iKey>=0 ); sprintf((char *)aBuf, "%.5d", iKey); } static void doDataTest3( const char *zSystem, /* Database system to test */ Datatest3 *p, /* Structure containing test parameters */ int *pRc /* OUT: Error code */ ){ int iDot = 0; int rc = *pRc; TestDb *pDb; u8 *abPresent; /* Array of boolean */ char *aVal; /* Buffer to hold values */ int i; u32 iSeq = 10; /* prng counter */ abPresent = (u8 *)testMalloc(p->nRange+1); aVal = (char *)testMalloc(p->nValMax+1); pDb = testOpen(zSystem, 1, &rc); for(i=0; inIter && rc==0; i++){ int ii; testCaseProgress(i, p->nIter, testCaseNDot(), &iDot); /* Perform nWrite inserts */ for(ii=0; iinWrite; ii++){ u8 aKey[6]; u32 iKey; int nVal; iKey = (testPrngValue(iSeq++) % p->nRange) + 1; nVal = (testPrngValue(iSeq++) % (p->nValMax - p->nValMin)) + p->nValMin; testPrngString(testPrngValue(iSeq++), aVal, nVal); dt3PutKey(aKey, iKey); testWrite(pDb, aKey, sizeof(aKey)-1, aVal, nVal, &rc); abPresent[iKey] = 1; } /* Perform nDelete deletes */ for(ii=0; iinDelete; ii++){ u8 aKey1[6]; u8 aKey2[6]; u32 iKey; iKey = (testPrngValue(iSeq++) % p->nRange) + 1; dt3PutKey(aKey1, iKey-1); dt3PutKey(aKey2, iKey+1); testDeleteRange(pDb, aKey1, sizeof(aKey1)-1, aKey2, sizeof(aKey2)-1, &rc); abPresent[iKey] = 0; } testReopen(&pDb, &rc); for(ii=1; rc==0 && ii<=p->nRange; ii++){ int nDbVal; void *pDbVal; u8 aKey[6]; int dbrc; dt3PutKey(aKey, ii); dbrc = tdb_fetch(pDb, aKey, sizeof(aKey)-1, &pDbVal, &nDbVal); testCompareInt(0, dbrc, &rc); if( abPresent[ii] ){ testCompareInt(1, (nDbVal>0), &rc); }else{ testCompareInt(1, (nDbVal<0), &rc); } } } testClose(&pDb); testCaseFinish(rc); *pRc = rc; } static char *getName3(const char *zSystem, Datatest3 *p){ return testMallocPrintf("data3.%s.%d.%d.%d.%d.(%d..%d)", zSystem, p->nRange, p->nIter, p->nWrite, p->nDelete, p->nValMin, p->nValMax ); } void test_data_3( const char *zSystem, /* Database system name */ const char *zPattern, /* Run test cases that match this pattern */ int *pRc /* IN/OUT: Error code */ ){ Datatest3 aTest[] = { /* nRange, nIter, nWrite, nDelete, nValMin, nValMax */ { 100, 1000, 5, 5, 50, 100 }, { 100, 1000, 2, 2, 5, 10 }, }; int i; for(i=0; *pRc==LSM_OK && inRow++; for(i=0; icksum1 += ((u8 *)pKey)[i]; p->cksum2 += p->cksum1; } for(i=0; icksum1 += ((u8 *)pVal)[i]; p->cksum2 += p->cksum1; } } /* ** tdb_scan() callback used by testCountDatabase() */ static void scanCountDb( void *pCtx, void *pKey, int nKey, void *pVal, int nVal ){ Cksum *p = (Cksum *)pCtx; p->nRow++; unused_parameter(pKey); unused_parameter(nKey); unused_parameter(pVal); unused_parameter(nVal); } /* ** Iterate through the entire contents of database pDb. Write a checksum ** string based on the db contents into buffer zOut before returning. A ** checksum string is at most 29 (TEST_CKSUM_BYTES) bytes in size: ** ** * 32-bit integer (10 bytes) ** * 1 space (1 byte) ** * 32-bit hex (8 bytes) ** * 1 space (1 byte) ** * 32-bit hex (8 bytes) ** * nul-terminator (1 byte) ** ** The number of entries in the database is returned. */ int testCksumDatabase( TestDb *pDb, /* Database handle */ char *zOut /* Buffer to write checksum to */ ){ Cksum cksum; memset(&cksum, 0, sizeof(Cksum)); tdb_scan(pDb, (void *)&cksum, 0, 0, 0, 0, 0, scanCksumDb); sprintf(zOut, "%d %x %x", cksum.nRow, (u32)cksum.cksum1, (u32)cksum.cksum2 ); assert( strlen(zOut)0 ); */ if( testrc==0 ) testrc = lsm_checkpoint(db, 0); } tdb_close(pDb); /* Check that the database content is still correct */ testCompareCksumLsmdb(DBNAME, bCompress, testCksumArrayGet(pCksumDb, nRow), 0, pRc); } testCksumArrayFree(pCksumDb); testDatasourceFree(pData); } /* ** This test verifies that if a system crash occurs while committing a ** transaction to the log file, no earlier transactions are lost or damaged. */ static void crash_test2(int bCompress, int *pRc){ const char *DBNAME = "testdb.lsm"; const DatasourceDefn defn = {TEST_DATASOURCE_RANDOM, 12, 16, 1000, 1000}; const int nIter = 200; const int nInsert = 20; int i; int iDot = 0; Datasource *pData; CksumDb *pCksumDb; TestDb *pDb; /* Allocate datasource. And calculate the expected checksums. */ pData = testDatasourceNew(&defn); pCksumDb = testCksumArrayNew(pData, 100, 100+nInsert, 1); /* Setup and save the initial database. */ testSetupSavedLsmdb("", DBNAME, pData, 100, pRc); for(i=0; izTest) ){ p->x(p->bCompress, pRc); testCaseFinish(*pRc); } } } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest3.c ================================================ /* ** This file contains tests related to the explicit rollback of database ** transactions and sub-transactions. */ /* ** Repeat 2000 times (until the db contains 100,000 entries): ** ** 1. Open a transaction and insert 500 rows, opening a nested ** sub-transaction each 100 rows. ** ** 2. Roll back to each sub-transaction savepoint. Check the database ** checksum looks Ok. ** ** 3. Every second iteration, roll back the main transaction. Check the ** db checksum is correct. Every other iteration, commit the main ** transaction (increasing the size of the db by 100 rows). */ #include "lsmtest.h" struct CksumDb { int nFirst; int nLast; int nStep; char **azCksum; }; CksumDb *testCksumArrayNew( Datasource *pData, int nFirst, int nLast, int nStep ){ TestDb *pDb; CksumDb *pRet; int i; int nEntry; int rc = 0; assert( nLast>=nFirst && ((nLast-nFirst)%nStep)==0 ); pRet = malloc(sizeof(CksumDb)); memset(pRet, 0, sizeof(CksumDb)); pRet->nFirst = nFirst; pRet->nLast = nLast; pRet->nStep = nStep; nEntry = 1 + ((nLast - nFirst) / nStep); /* Allocate space so that azCksum is an array of nEntry pointers to ** buffers each TEST_CKSUM_BYTES in size. */ pRet->azCksum = (char **)malloc(nEntry * (sizeof(char *) + TEST_CKSUM_BYTES)); for(i=0; iazCksum[nEntry]); pRet->azCksum[i] = &pStart[i * TEST_CKSUM_BYTES]; } tdb_open("lsm", "tempdb.lsm", 1, &pDb); testWriteDatasourceRange(pDb, pData, 0, nFirst, &rc); for(i=0; iazCksum[i]); if( i==nEntry ) break; testWriteDatasourceRange(pDb, pData, nFirst+i*nStep, nStep, &rc); } tdb_close(pDb); return pRet; } char *testCksumArrayGet(CksumDb *p, int nRow){ int i; assert( nRow>=p->nFirst ); assert( nRow<=p->nLast ); assert( ((nRow-p->nFirst) % p->nStep)==0 ); i = (nRow - p->nFirst) / p->nStep; return p->azCksum[i]; } void testCksumArrayFree(CksumDb *p){ free(p->azCksum); memset(p, 0x55, sizeof(*p)); free(p); } /* End of CksumDb code. **************************************************************************/ /* ** Test utility function. Write key-value pair $i from datasource pData ** into database pDb. */ void testWriteDatasource(TestDb *pDb, Datasource *pData, int i, int *pRc){ void *pKey; int nKey; void *pVal; int nVal; testDatasourceEntry(pData, i, &pKey, &nKey, &pVal, &nVal); testWrite(pDb, pKey, nKey, pVal, nVal, pRc); } /* ** Test utility function. Delete datasource pData key $i from database pDb. */ void testDeleteDatasource(TestDb *pDb, Datasource *pData, int i, int *pRc){ void *pKey; int nKey; testDatasourceEntry(pData, i, &pKey, &nKey, 0, 0); testDelete(pDb, pKey, nKey, pRc); } /* ** This function inserts nWrite key/value pairs into database pDb - the ** nWrite key value pairs starting at iFirst from data source pData. */ void testWriteDatasourceRange( TestDb *pDb, /* Database to write to */ Datasource *pData, /* Data source to read values from */ int iFirst, /* Index of first key/value pair */ int nWrite, /* Number of key/value pairs to write */ int *pRc /* IN/OUT: Error code */ ){ int i; for(i=0; i2 && rc==0; iTrans--){ tdb_rollback(pDb, iTrans); nCurrent -= 100; testCksumDatabase(pDb, zCksum); testCompareStr(zCksum, testCksumArrayGet(pCksum, nCurrent), &rc); } if( i%2 ){ tdb_rollback(pDb, 0); nCurrent -= 100; testCksumDatabase(pDb, zCksum); testCompareStr(zCksum, testCksumArrayGet(pCksum, nCurrent), &rc); }else{ tdb_commit(pDb, 0); } } testCaseFinish(rc); skip_rollback_test: tdb_close(pDb); testCksumArrayFree(pCksum); return rc; } void test_rollback( const char *zSystem, const char *zPattern, int *pRc ){ if( *pRc==0 ){ int bRun = 1; if( zPattern ){ char *zName = getName(zSystem); bRun = testGlobMatch(zPattern, zName); testFree(zName); } if( bRun ){ DatasourceDefn defn = { TEST_DATASOURCE_RANDOM, 10, 15, 50, 100 }; Datasource *pData = testDatasourceNew(&defn); *pRc = rollback_test_1(zSystem, pData); testDatasourceFree(pData); } } } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest4.c ================================================ /* ** This file contains test cases involving multiple database clients. */ #include "lsmtest.h" /* ** The following code implements test cases "mc1.*". ** ** This test case uses one writer and $nReader readers. All connections ** are driven by a single thread. All connections are opened at the start ** of the test and remain open until the test is finished. ** ** The test consists of $nStep steps. Each step the following is performed: ** ** 1. The writer inserts $nWriteStep records into the db. ** ** 2. The writer checks that the contents of the db are as expected. ** ** 3. Each reader that currently has an open read transaction also checks ** that the contents of the db are as expected (according to the snapshot ** the read transaction is reading - see below). ** ** After step 1, reader 1 opens a read transaction. After step 2, reader ** 2 opens a read transaction, and so on. At step ($nReader+1), reader 1 ** closes the current read transaction and opens a new one. And so on. ** The result is that at step N (for N > $nReader), there exists a reader ** with an open read transaction reading the snapshot committed following ** steps (N-$nReader-1) to N. */ typedef struct Mctest Mctest; struct Mctest { DatasourceDefn defn; /* Datasource to use */ int nStep; /* Total number of steps in test */ int nWriteStep; /* Number of rows to insert each step */ int nReader; /* Number of read connections */ }; static void do_mc_test( const char *zSystem, /* Database system to test */ Mctest *pTest, int *pRc /* IN/OUT: return code */ ){ const int nDomain = pTest->nStep * pTest->nWriteStep; Datasource *pData; /* Source of data */ TestDb *pDb; /* First database connection (writer) */ int iReader; /* Used to iterate through aReader */ int iStep; /* Current step in test */ int iDot = 0; /* Current step in test */ /* Array of reader connections */ struct Reader { TestDb *pDb; /* Connection handle */ int iLast; /* Current snapshot contains keys 0..iLast */ } *aReader; /* Create a data source */ pData = testDatasourceNew(&pTest->defn); /* Open the writer connection */ pDb = testOpen(zSystem, 1, pRc); /* Allocate aReader */ aReader = (struct Reader *)testMalloc(sizeof(aReader[0]) * pTest->nReader); for(iReader=0; iReadernReader; iReader++){ aReader[iReader].pDb = testOpen(zSystem, 0, pRc); } for(iStep=0; iStepnStep; iStep++){ int iLast; int iBegin; /* Start read trans using aReader[iBegin] */ /* Insert nWriteStep more records into the database */ int iFirst = iStep*pTest->nWriteStep; testWriteDatasourceRange(pDb, pData, iFirst, pTest->nWriteStep, pRc); /* Check that the db is Ok according to the writer */ iLast = (iStep+1) * pTest->nWriteStep - 1; testDbContents(pDb, pData, nDomain, 0, iLast, iLast, 1, pRc); /* Have reader (iStep % nReader) open a read transaction here. */ iBegin = (iStep % pTest->nReader); if( iBeginnReader && aReader[iReader].iLast; iReader++){ iLast = aReader[iReader].iLast; testDbContents( aReader[iReader].pDb, pData, nDomain, 0, iLast, iLast, 1, pRc ); } /* Report progress */ testCaseProgress(iStep, pTest->nStep, testCaseNDot(), &iDot); } /* Close all readers */ for(iReader=0; iReadernReader; iReader++){ testClose(&aReader[iReader].pDb); } testFree(aReader); /* Close the writer-connection and free the datasource */ testClose(&pDb); testDatasourceFree(pData); } void test_mc( const char *zSystem, /* Database system name */ const char *zPattern, /* Run test cases that match this pattern */ int *pRc /* IN/OUT: Error code */ ){ int i; Mctest aTest[] = { { { TEST_DATASOURCE_RANDOM, 10,10, 100,100 }, 100, 10, 5 }, }; for(i=0; i "k.0000000045". ** ** As well as the key/value pairs, the database also contains checksum ** entries. The checksums form a hierarchy - for every F key/value ** entries there is one level 1 checksum. And for each F level 1 checksums ** there is one level 2 checksum. And so on. ** ** Checksum keys are encoded as the two byte "c." followed by the ** checksum level, followed by a 10 digit decimal number containing ** the value of the first key that contributes to the checksum value. ** For example, assuming F==10, the level 1 checksum that spans keys ** 10 to 19 is "c.1.0000000010". ** ** Clients may perform one of two operations on the database: a read ** or a write. ** ** READ OPERATIONS: ** ** A read operation scans a range of F key/value pairs. It computes ** the expected checksum and then compares the computed value to the ** actual value stored in the level 1 checksum entry. It then scans ** the group of F level 1 checksums, and compares the computed checksum ** to the associated level 2 checksum value, and so on until the ** highest level checksum value has been verified. ** ** If a checksum ever fails to match the expected value, the test ** has failed. ** ** WRITE OPERATIONS: ** ** A write operation involves writing (possibly clobbering) a single ** key/value pair. The associated level 1 checksum is then recalculated ** updated. Then the level 2 checksum, and so on until the highest ** level checksum has been modified. ** ** All updates occur inside a single transaction. ** ** INTERFACE: ** ** The interface used by test cases to read and write the db consists ** of type DbParameters and the following functions: ** ** dbReadOperation() ** dbWriteOperation() */ #include "lsmtest.h" typedef struct DbParameters DbParameters; struct DbParameters { int nFanout; /* Checksum fanout (F) */ int nKey; /* Size of key space (N) */ }; #define DB_KEY_BYTES (2+5+10+1) /* ** Argument aBuf[] must point to a buffer at least DB_KEY_BYTES in size. ** This function populates the buffer with a nul-terminated key string ** corresponding to key iKey. */ static void dbFormatKey( DbParameters *pParam, int iLevel, int iKey, /* Key value */ char *aBuf /* Write key string here */ ){ if( iLevel==0 ){ snprintf(aBuf, DB_KEY_BYTES, "k.%.10d", iKey); }else{ int f = 1; int i; for(i=0; inFanout; snprintf(aBuf, DB_KEY_BYTES, "c.%d.%.10d", iLevel, f*(iKey/f)); } } /* ** Argument aBuf[] must point to a buffer at least DB_KEY_BYTES in size. ** This function populates the buffer with the string representation of ** checksum value iVal. */ static void dbFormatCksumValue(u32 iVal, char *aBuf){ snprintf(aBuf, DB_KEY_BYTES, "%.10u", iVal); } /* ** Return the highest level of checksum in the database described ** by *pParam. */ static int dbMaxLevel(DbParameters *pParam){ int iMax; int n = 1; for(iMax=0; nnKey; iMax++){ n = n * pParam->nFanout; } return iMax; } static void dbCksum( void *pCtx, /* IN/OUT: Pointer to u32 containing cksum */ void *pKey, int nKey, /* Database key. Unused. */ void *pVal, int nVal /* Database value. Checksum this. */ ){ u8 *aVal = (u8 *)pVal; u32 *pCksum = (u32 *)pCtx; u32 cksum = *pCksum; int i; unused_parameter(pKey); unused_parameter(nKey); for(i=0; inFanout entries at level ** iLevel-1. */ static u32 dbComputeCksum( DbParameters *pParam, /* Database parameters */ TestDb *pDb, /* Database connection handle */ int iLevel, /* Level of checksum to compute */ int iKey, /* Compute checksum for this key */ int *pRc /* IN/OUT: Error code */ ){ u32 cksum = 0; if( *pRc==0 ){ int nFirst; int nLast; int iFirst = 0; int iLast = 0; int i; int f = 1; char zFirst[DB_KEY_BYTES]; char zLast[DB_KEY_BYTES]; assert( iLevel>=1 ); for(i=0; inFanout; iFirst = f*(iKey/f); iLast = iFirst + f - 1; dbFormatKey(pParam, iLevel-1, iFirst, zFirst); dbFormatKey(pParam, iLevel-1, iLast, zLast); nFirst = strlen(zFirst); nLast = strlen(zLast); *pRc = tdb_scan(pDb, (u32*)&cksum, 0, zFirst, nFirst, zLast, nLast,dbCksum); } return cksum; } static void dbReadOperation( DbParameters *pParam, /* Database parameters */ TestDb *pDb, /* Database connection handle */ void (*xDelay)(void *), void *pDelayCtx, int iKey, /* Key to read */ int *pRc /* IN/OUT: Error code */ ){ const int iMax = dbMaxLevel(pParam); int i; if( tdb_transaction_support(pDb) ) testBegin(pDb, 1, pRc); for(i=1; *pRc==0 && i<=iMax; i++){ char zCksum[DB_KEY_BYTES]; char zKey[DB_KEY_BYTES]; u32 iCksum = 0; iCksum = dbComputeCksum(pParam, pDb, i, iKey, pRc); if( iCksum ){ if( xDelay && i==1 ) xDelay(pDelayCtx); dbFormatCksumValue(iCksum, zCksum); dbFormatKey(pParam, i, iKey, zKey); testFetchStr(pDb, zKey, zCksum, pRc); } } if( tdb_transaction_support(pDb) ) testCommit(pDb, 0, pRc); } static int dbWriteOperation( DbParameters *pParam, /* Database parameters */ TestDb *pDb, /* Database connection handle */ int iKey, /* Key to write to */ const char *zValue, /* Nul-terminated value to write */ int *pRc /* IN/OUT: Error code */ ){ const int iMax = dbMaxLevel(pParam); char zKey[DB_KEY_BYTES]; int i; int rc; assert( iKey>=0 && iKeynKey ); dbFormatKey(pParam, 0, iKey, zKey); /* Open a write transaction. This may fail - SQLITE4_BUSY */ if( *pRc==0 && tdb_transaction_support(pDb) ){ rc = tdb_begin(pDb, 2); if( rc==5 ) return 0; *pRc = rc; } testWriteStr(pDb, zKey, zValue, pRc); for(i=1; i<=iMax; i++){ char zCksum[DB_KEY_BYTES]; u32 iCksum = 0; iCksum = dbComputeCksum(pParam, pDb, i, iKey, pRc); dbFormatCksumValue(iCksum, zCksum); dbFormatKey(pParam, i, iKey, zKey); testWriteStr(pDb, zKey, zCksum, pRc); } if( tdb_transaction_support(pDb) ) testCommit(pDb, 0, pRc); return 1; } /************************************************************************* ** The following block contains testXXX() functions that implement a ** wrapper around the systems native multi-thread support. There are no ** synchronization primitives - just functions to launch and join ** threads. Wrapper functions are: ** ** testThreadSupport() ** ** testThreadInit() ** testThreadShutdown() ** testThreadLaunch() ** testThreadWait() ** ** testThreadSetHalt() ** testThreadGetHalt() ** testThreadSetResult() ** testThreadGetResult() ** ** testThreadEnterMutex() ** testThreadLeaveMutex() */ typedef struct ThreadSet ThreadSet; #ifdef LSM_MUTEX_PTHREADS #include #include typedef struct Thread Thread; struct Thread { int rc; char *zMsg; pthread_t id; void (*xMain)(ThreadSet *, int, void *); void *pCtx; ThreadSet *pThreadSet; }; struct ThreadSet { int bHalt; /* Halt flag */ int nThread; /* Number of threads */ Thread *aThread; /* Array of Thread structures */ pthread_mutex_t mutex; /* Mutex used for cheating */ }; /* ** Return true if this build supports threads, or false otherwise. If ** this function returns false, no other testThreadXXX() functions should ** be called. */ static int testThreadSupport(){ return 1; } /* ** Allocate and return a thread-set handle with enough space allocated ** to handle up to nMax threads. Each call to this function should be ** matched by a call to testThreadShutdown() to delete the object. */ static ThreadSet *testThreadInit(int nMax){ int nByte; /* Total space to allocate */ ThreadSet *p; /* Return value */ nByte = sizeof(ThreadSet) + sizeof(struct Thread) * nMax; p = (ThreadSet *)testMalloc(nByte); p->nThread = nMax; p->aThread = (Thread *)&p[1]; pthread_mutex_init(&p->mutex, 0); return p; } /* ** Delete a thread-set object and release all resources held by it. */ static void testThreadShutdown(ThreadSet *p){ int i; for(i=0; inThread; i++){ testFree(p->aThread[i].zMsg); } pthread_mutex_destroy(&p->mutex); testFree(p); } static void *ttMain(void *pArg){ Thread *pThread = (Thread *)pArg; int iThread; iThread = (pThread - pThread->pThreadSet->aThread); pThread->xMain(pThread->pThreadSet, iThread, pThread->pCtx); return 0; } /* ** Launch a new thread. */ static int testThreadLaunch( ThreadSet *p, int iThread, void (*xMain)(ThreadSet *, int, void *), void *pCtx ){ int rc; Thread *pThread; assert( iThread>=0 && iThreadnThread ); pThread = &p->aThread[iThread]; assert( pThread->pThreadSet==0 ); pThread->xMain = xMain; pThread->pCtx = pCtx; pThread->pThreadSet = p; rc = pthread_create(&pThread->id, 0, ttMain, (void *)pThread); return rc; } /* ** Set the thread-set "halt" flag. */ static void testThreadSetHalt(ThreadSet *pThreadSet){ pThreadSet->bHalt = 1; } /* ** Return the current value of the thread-set "halt" flag. */ static int testThreadGetHalt(ThreadSet *pThreadSet){ return pThreadSet->bHalt; } static void testThreadSleep(ThreadSet *pThreadSet, int nMs){ int nRem = nMs; while( nRem>0 && testThreadGetHalt(pThreadSet)==0 ){ usleep(50000); nRem -= 50; } } /* ** Wait for all threads launched to finish before returning. If nMs ** is greater than zero, set the "halt" flag to tell all threads ** to halt after waiting nMs milliseconds. */ static void testThreadWait(ThreadSet *pThreadSet, int nMs){ int i; testThreadSleep(pThreadSet, nMs); testThreadSetHalt(pThreadSet); for(i=0; inThread; i++){ Thread *pThread = &pThreadSet->aThread[i]; if( pThread->xMain ){ pthread_join(pThread->id, 0); } } } /* ** Set the result for thread iThread. */ static void testThreadSetResult( ThreadSet *pThreadSet, /* Thread-set handle */ int iThread, /* Set result for this thread */ int rc, /* Result error code */ char *zFmt, /* Result string format */ ... /* Result string formatting args... */ ){ va_list ap; testFree(pThreadSet->aThread[iThread].zMsg); pThreadSet->aThread[iThread].rc = rc; pThreadSet->aThread[iThread].zMsg = 0; if( zFmt ){ va_start(ap, zFmt); pThreadSet->aThread[iThread].zMsg = testMallocVPrintf(zFmt, ap); va_end(ap); } } /* ** Retrieve the result for thread iThread. */ static int testThreadGetResult( ThreadSet *pThreadSet, /* Thread-set handle */ int iThread, /* Get result for this thread */ const char **pzRes /* OUT: Pointer to result string */ ){ if( pzRes ) *pzRes = pThreadSet->aThread[iThread].zMsg; return pThreadSet->aThread[iThread].rc; } /* ** Enter and leave the test case mutex. */ #if 0 static void testThreadEnterMutex(ThreadSet *p){ pthread_mutex_lock(&p->mutex); } static void testThreadLeaveMutex(ThreadSet *p){ pthread_mutex_unlock(&p->mutex); } #endif #endif #if !defined(LSM_MUTEX_PTHREADS) static int testThreadSupport(){ return 0; } #define testThreadInit(a) 0 #define testThreadShutdown(a) #define testThreadLaunch(a,b,c,d) 0 #define testThreadWait(a,b) #define testThreadSetHalt(a) #define testThreadGetHalt(a) 0 #define testThreadGetResult(a,b,c) 0 #define testThreadSleep(a,b) 0 static void testThreadSetResult(ThreadSet *a, int b, int c, char *d, ...){ unused_parameter(a); unused_parameter(b); unused_parameter(c); unused_parameter(d); } #endif /* End of threads wrapper. *************************************************************************/ /************************************************************************* ** Below this point is the third part of this file - the implementation ** of the mt1.* tests. */ typedef struct Mt1Test Mt1Test; struct Mt1Test { DbParameters param; /* Description of database to read/write */ int nReadwrite; /* Number of read/write threads */ int nFastReader; /* Number of fast reader threads */ int nSlowReader; /* Number of slow reader threads */ int nMs; /* How long to run for */ const char *zSystem; /* Database system to test */ }; typedef struct Mt1DelayCtx Mt1DelayCtx; struct Mt1DelayCtx { ThreadSet *pSet; /* Threadset to sleep within */ int nMs; /* Sleep in ms */ }; static void xMt1Delay(void *pCtx){ Mt1DelayCtx *p = (Mt1DelayCtx *)pCtx; testThreadSleep(p->pSet, p->nMs); } #define MT1_THREAD_RDWR 0 #define MT1_THREAD_SLOW 1 #define MT1_THREAD_FAST 2 static void xMt1Work(lsm_db *pDb, void *pCtx){ #if 0 char *z = 0; lsm_info(pDb, LSM_INFO_DB_STRUCTURE, &z); printf("%s\n", z); fflush(stdout); #endif } /* ** This is the main() proc for all threads in test case "mt1". */ static void mt1Main(ThreadSet *pThreadSet, int iThread, void *pCtx){ Mt1Test *p = (Mt1Test *)pCtx; /* Test parameters */ Mt1DelayCtx delay; int nRead = 0; /* Number of calls to dbReadOperation() */ int nWrite = 0; /* Number of completed database writes */ int rc = 0; /* Error code */ int iPrng; /* Prng argument variable */ TestDb *pDb; /* Database handle */ int eType; delay.pSet = pThreadSet; delay.nMs = 0; if( iThreadnReadwrite ){ eType = MT1_THREAD_RDWR; }else if( iThread<(p->nReadwrite+p->nFastReader) ){ eType = MT1_THREAD_FAST; }else{ eType = MT1_THREAD_SLOW; delay.nMs = (p->nMs / 20); } /* Open a new database connection. Initialize the pseudo-random number ** argument based on the thread number. */ iPrng = testPrngValue(iThread); pDb = testOpen(p->zSystem, 0, &rc); if( rc==0 ){ tdb_lsm_config_work_hook(pDb, xMt1Work, 0); } /* Loop until either an error occurs or some other thread sets the ** halt flag. */ while( rc==0 && testThreadGetHalt(pThreadSet)==0 ){ int iKey; /* Perform a read operation on an arbitrarily selected key. */ iKey = (testPrngValue(iPrng++) % p->param.nKey); dbReadOperation(&p->param, pDb, xMt1Delay, (void *)&delay, iKey, &rc); if( rc ) continue; nRead++; /* Attempt to write an arbitrary key value pair (and update the associated ** checksum entries). dbWriteOperation() returns 1 if the write is ** successful, or 0 if it failed with an LSM_BUSY error. */ if( eType==MT1_THREAD_RDWR ){ char aValue[50]; char aRnd[25]; iKey = (testPrngValue(iPrng++) % p->param.nKey); testPrngString(iPrng, aRnd, sizeof(aRnd)); iPrng += sizeof(aRnd); snprintf(aValue, sizeof(aValue), "%d.%s", iThread, aRnd); nWrite += dbWriteOperation(&p->param, pDb, iKey, aValue, &rc); } } testClose(&pDb); /* If an error has occured, set the thread error code and the threadset ** halt flag to tell the other test threads to halt. Otherwise, set the ** thread error code to 0 and post a message with the number of read ** and write operations completed. */ if( rc ){ testThreadSetResult(pThreadSet, iThread, rc, 0); testThreadSetHalt(pThreadSet); }else{ testThreadSetResult(pThreadSet, iThread, 0, "r/w: %d/%d", nRead, nWrite); } } static void do_test_mt1( const char *zSystem, /* Database system name */ const char *zPattern, /* Run test cases that match this pattern */ int *pRc /* IN/OUT: Error code */ ){ Mt1Test aTest[] = { /* param, nReadwrite, nFastReader, nSlowReader, nMs, zSystem */ { {10, 1000}, 4, 0, 0, 10000, 0 }, { {10, 1000}, 4, 4, 2, 100000, 0 }, { {10, 100000}, 4, 0, 0, 10000, 0 }, { {10, 100000}, 4, 4, 2, 100000, 0 }, }; int i; for(i=0; *pRc==0 && iparam.nFanout, p->param.nKey, p->nMs, p->nReadwrite, p->nFastReader, p->nSlowReader ); if( bRun ){ TestDb *pDb; ThreadSet *pSet; int iThread; int nThread; p->zSystem = zSystem; pDb = testOpen(zSystem, 1, pRc); nThread = p->nReadwrite + p->nFastReader + p->nSlowReader; pSet = testThreadInit(nThread); for(iThread=0; *pRc==0 && iThreadnMs); for(iThread=0; *pRc==0 && iThreadiNext = 1; p->bEnable = 1; p->nFail = 1; p->pEnv = tdb_lsm_env(); } static void xOomHook(OomTest *p){ p->nFail++; } static int testOomContinue(OomTest *p){ if( p->rc!=0 || (p->iNext>1 && p->nFail==0) ){ return 0; } p->nFail = 0; testMallocOom(p->pEnv, p->iNext, 0, (void (*)(void*))xOomHook, (void *)p); return 1; } static void testOomEnable(OomTest *p, int bEnable){ p->bEnable = bEnable; testMallocOomEnable(p->pEnv, bEnable); } static void testOomNext(OomTest *p){ p->iNext++; } static int testOomHit(OomTest *p){ return (p->nFail>0); } static int testOomFinish(OomTest *p){ return p->rc; } static void testOomAssert(OomTest *p, int bVal){ if( bVal==0 ){ test_failed(); p->rc = 1; } } /* ** Test that the error code matches the state of the OomTest object passed ** as the first argument. Specifically, check that rc is LSM_NOMEM if an ** OOM error has already been injected, or LSM_OK if not. */ static void testOomAssertRc(OomTest *p, int rc){ testOomAssert(p, rc==LSM_OK || rc==LSM_NOMEM); testOomAssert(p, testOomHit(p)==(rc==LSM_NOMEM) || p->bEnable==0 ); } static void testOomOpen( OomTest *pOom, const char *zName, lsm_db **ppDb, int *pRc ){ if( *pRc==LSM_OK ){ int rc; rc = lsm_new(tdb_lsm_env(), ppDb); if( rc==LSM_OK ) rc = lsm_open(*ppDb, zName); testOomAssertRc(pOom, rc); *pRc = rc; } } static void testOomFetch( OomTest *pOom, lsm_db *pDb, void *pKey, int nKey, void *pVal, int nVal, int *pRc ){ testOomAssertRc(pOom, *pRc); if( *pRc==LSM_OK ){ lsm_cursor *pCsr; int rc; rc = lsm_csr_open(pDb, &pCsr); if( rc==LSM_OK ) rc = lsm_csr_seek(pCsr, pKey, nKey, 0); testOomAssertRc(pOom, rc); if( rc==LSM_OK ){ const void *p; int n; testOomAssert(pOom, lsm_csr_valid(pCsr)); rc = lsm_csr_key(pCsr, &p, &n); testOomAssertRc(pOom, rc); testOomAssert(pOom, rc!=LSM_OK || (n==nKey && memcmp(pKey, p, nKey)==0) ); } if( rc==LSM_OK ){ const void *p; int n; testOomAssert(pOom, lsm_csr_valid(pCsr)); rc = lsm_csr_value(pCsr, &p, &n); testOomAssertRc(pOom, rc); testOomAssert(pOom, rc!=LSM_OK || (n==nVal && memcmp(pVal, p, nVal)==0) ); } lsm_csr_close(pCsr); *pRc = rc; } } static void testOomWrite( OomTest *pOom, lsm_db *pDb, void *pKey, int nKey, void *pVal, int nVal, int *pRc ){ testOomAssertRc(pOom, *pRc); if( *pRc==LSM_OK ){ int rc; rc = lsm_insert(pDb, pKey, nKey, pVal, nVal); testOomAssertRc(pOom, rc); *pRc = rc; } } static void testOomFetchStr( OomTest *pOom, lsm_db *pDb, const char *zKey, const char *zVal, int *pRc ){ int nKey = strlen(zKey); int nVal = strlen(zVal); testOomFetch(pOom, pDb, (void *)zKey, nKey, (void *)zVal, nVal, pRc); } static void testOomFetchData( OomTest *pOom, lsm_db *pDb, Datasource *pData, int iKey, int *pRc ){ void *pKey; int nKey; void *pVal; int nVal; testDatasourceEntry(pData, iKey, &pKey, &nKey, &pVal, &nVal); testOomFetch(pOom, pDb, pKey, nKey, pVal, nVal, pRc); } static void testOomWriteStr( OomTest *pOom, lsm_db *pDb, const char *zKey, const char *zVal, int *pRc ){ int nKey = strlen(zKey); int nVal = strlen(zVal); testOomWrite(pOom, pDb, (void *)zKey, nKey, (void *)zVal, nVal, pRc); } static void testOomWriteData( OomTest *pOom, lsm_db *pDb, Datasource *pData, int iKey, int *pRc ){ void *pKey; int nKey; void *pVal; int nVal; testDatasourceEntry(pData, iKey, &pKey, &nKey, &pVal, &nVal); testOomWrite(pOom, pDb, pKey, nKey, pVal, nVal, pRc); } static void testOomScan( OomTest *pOom, lsm_db *pDb, int bReverse, const void *pKey, int nKey, int nScan, int *pRc ){ if( *pRc==0 ){ int rc; int iScan = 0; lsm_cursor *pCsr; int (*xAdvance)(lsm_cursor *) = 0; rc = lsm_csr_open(pDb, &pCsr); testOomAssertRc(pOom, rc); if( rc==LSM_OK ){ if( bReverse ){ rc = lsm_csr_seek(pCsr, pKey, nKey, LSM_SEEK_LE); xAdvance = lsm_csr_prev; }else{ rc = lsm_csr_seek(pCsr, pKey, nKey, LSM_SEEK_GE); xAdvance = lsm_csr_next; } } testOomAssertRc(pOom, rc); while( rc==LSM_OK && lsm_csr_valid(pCsr) && iScan "one" ** "two" -> "four" ** "three" -> "nine" ** "four" -> "sixteen" ** "five" -> "twentyfive" ** "six" -> "thirtysix" ** "seven" -> "fourtynine" ** "eight" -> "sixtyfour" */ static void setup_populate_db(void){ const char *azStr[] = { "one", "one", "two", "four", "three", "nine", "four", "sixteen", "five", "twentyfive", "six", "thirtysix", "seven", "fourtynine", "eight", "sixtyfour", }; int rc; int ii; lsm_db *pDb; testDeleteLsmdb(LSMTEST6_TESTDB); rc = lsm_new(tdb_lsm_env(), &pDb); if( rc==LSM_OK ) rc = lsm_open(pDb, LSMTEST6_TESTDB); for(ii=0; rc==LSM_OK && iiiInsStart, pStep->nIns, pRc); testDeleteDatasourceRange(pDb, pData, pStep->iDelStart, pStep->nDel, pRc); if( *pRc==0 ){ int nSave = -1; int nBuf = 64; lsm_db *db = tdb_lsm(pDb); lsm_config(db, LSM_CONFIG_AUTOFLUSH, &nSave); lsm_config(db, LSM_CONFIG_AUTOFLUSH, &nBuf); lsm_begin(db, 1); lsm_commit(db, 0); lsm_config(db, LSM_CONFIG_AUTOFLUSH, &nSave); *pRc = lsm_work(db, 0, 0, 0); if( *pRc==0 ){ *pRc = lsm_checkpoint(db, 0); } } } static void doSetupStepArray( TestDb *pDb, Datasource *pData, const SetupStep *aStep, int nStep ){ int i; for(i=0; i void testReadFile(const char *zFile, int iOff, void *pOut, int nByte, int *pRc){ if( *pRc==0 ){ FILE *fd; fd = fopen(zFile, "rb"); if( fd==0 ){ *pRc = 1; }else{ if( 0!=fseek(fd, iOff, SEEK_SET) ){ *pRc = 1; }else{ assert( nByte>=0 ); if( (size_t)nByte!=fread(pOut, 1, nByte, fd) ){ *pRc = 1; } } fclose(fd); } } } void testWriteFile( const char *zFile, int iOff, void *pOut, int nByte, int *pRc ){ if( *pRc==0 ){ FILE *fd; fd = fopen(zFile, "r+b"); if( fd==0 ){ *pRc = 1; }else{ if( 0!=fseek(fd, iOff, SEEK_SET) ){ *pRc = 1; }else{ assert( nByte>=0 ); if( (size_t)nByte!=fwrite(pOut, 1, nByte, fd) ){ *pRc = 1; } } fclose(fd); } } } static ShmHeader *getShmHeader(const char *zDb){ int rc = 0; char *zShm = testMallocPrintf("%s-shm", zDb); ShmHeader *pHdr; pHdr = testMalloc(sizeof(ShmHeader)); testReadFile(zShm, 0, (void *)pHdr, sizeof(ShmHeader), &rc); assert( rc==0 ); return pHdr; } /* ** This function makes a copy of the three files associated with LSM ** database zDb (i.e. if zDb is "test.db", it makes copies of "test.db", ** "test.db-log" and "test.db-shm"). ** ** It then opens a new database connection to the copy with the xLock() call ** instrumented so that it appears that some other process already connected ** to the db (holding a shared lock on DMS2). This prevents recovery from ** running. Then: ** ** 1) Check that the checksum of the database is zCksum. ** 2) Write a few keys to the database. Then delete the same keys. ** 3) Check that the checksum is zCksum. ** 4) Flush the db to disk and run a checkpoint. ** 5) Check once more that the checksum is still zCksum. */ static void doLiveRecovery(const char *zDb, const char *zCksum, int *pRc){ if( *pRc==LSM_OK ){ const DatasourceDefn defn = {TEST_DATASOURCE_RANDOM, 20, 25, 100, 500}; Datasource *pData; const char *zCopy = "testcopy.lsm"; char zCksum2[TEST_CKSUM_BYTES]; TestDb *pDb = 0; int rc; pData = testDatasourceNew(&defn); testCopyLsmdb(zDb, zCopy); rc = tdb_lsm_open("test_no_recovery=1", zCopy, 0, &pDb); if( rc==0 ){ ShmHeader *pHdr; lsm_db *db; testCksumDatabase(pDb, zCksum2); testCompareStr(zCksum, zCksum2, &rc); testWriteDatasourceRange(pDb, pData, 1, 10, &rc); testDeleteDatasourceRange(pDb, pData, 1, 10, &rc); /* Test that the two tree-headers are now consistent. */ pHdr = getShmHeader(zCopy); if( rc==0 && memcmp(&pHdr->hdr1, &pHdr->hdr2, sizeof(pHdr->hdr1)) ){ rc = 1; } testFree(pHdr); if( rc==0 ){ int nBuf = 64; db = tdb_lsm(pDb); lsm_config(db, LSM_CONFIG_AUTOFLUSH, &nBuf); lsm_begin(db, 1); lsm_commit(db, 0); rc = lsm_work(db, 0, 0, 0); } testCksumDatabase(pDb, zCksum2); testCompareStr(zCksum, zCksum2, &rc); } testDatasourceFree(pData); testClose(&pDb); testDeleteLsmdb(zCopy); *pRc = rc; } } static void doWriterCrash1(int *pRc){ const int nWrite = 2000; const int nStep = 10; const int iWriteStart = 20000; int rc = 0; TestDb *pDb = 0; Datasource *pData = 0; rc = tdb_lsm_open("autowork=0", "testdb.lsm", 1, &pDb); if( rc==0 ){ int iDot = 0; char zCksum[TEST_CKSUM_BYTES]; int i; setupDatabase1(pDb, &pData); testCksumDatabase(pDb, zCksum); testBegin(pDb, 2, &rc); for(i=0; rc==0 && ihdr1, &pHdr1->hdr1, sizeof(pHdr1->hdr1)); pHdr2->bWriter = 1; testWriteFile("testdb.lsm-shm", 0, (void *)pHdr2, sizeof(ShmHeader), &rc); doLiveRecovery("testdb.lsm", zCksum1, &rc); /* If both tree-headers are valid, tree-header-1 is used. */ memcpy(&pHdr2->hdr1, &pHdr2->hdr2, sizeof(pHdr1->hdr1)); memcpy(&pHdr2->hdr2, &pHdr1->hdr1, sizeof(pHdr1->hdr1)); pHdr2->bWriter = 1; testWriteFile("testdb.lsm-shm", 0, (void *)pHdr2, sizeof(ShmHeader), &rc); doLiveRecovery("testdb.lsm", zCksum2, &rc); /* If tree-header 1 is invalid, tree-header-2 is used */ memcpy(&pHdr2->hdr2, &pHdr2->hdr1, sizeof(pHdr1->hdr1)); pHdr2->hdr1.aCksum[0] = 5; pHdr2->hdr1.aCksum[0] = 6; pHdr2->bWriter = 1; testWriteFile("testdb.lsm-shm", 0, (void *)pHdr2, sizeof(ShmHeader), &rc); doLiveRecovery("testdb.lsm", zCksum2, &rc); /* If tree-header 2 is invalid, tree-header-1 is used */ memcpy(&pHdr2->hdr1, &pHdr2->hdr2, sizeof(pHdr1->hdr1)); pHdr2->hdr2.aCksum[0] = 5; pHdr2->hdr2.aCksum[0] = 6; pHdr2->bWriter = 1; testWriteFile("testdb.lsm-shm", 0, (void *)pHdr2, sizeof(ShmHeader), &rc); doLiveRecovery("testdb.lsm", zCksum2, &rc); testFree(pHdr1); testFree(pHdr2); testClose(&pDb); } *pRc = rc; } void do_writer_crash_test(const char *zPattern, int *pRc){ struct Test { const char *zName; void (*xFunc)(int *); } aTest[] = { { "writercrash1.lsm", doWriterCrash1 }, { "writercrash2.lsm", doWriterCrash2 }, }; int i; for(i=0; izName) ){ p->xFunc(pRc); testCaseFinish(*pRc); } } } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest9.c ================================================ #include "lsmtest.h" #define DATA_SEQUENTIAL TEST_DATASOURCE_SEQUENCE #define DATA_RANDOM TEST_DATASOURCE_RANDOM typedef struct Datatest4 Datatest4; /* ** Test overview: ** ** 1. Insert (Datatest4.nRec) records into a database. ** ** 2. Repeat (Datatest4.nRepeat) times: ** ** 2a. Delete 2/3 of the records in the database. ** ** 2b. Run lsm_work(nMerge=1). ** ** 2c. Insert as many records as were deleted in 2a. ** ** 2d. Check database content is as expected. ** ** 2e. If (Datatest4.bReopen) is true, close and reopen the database. */ struct Datatest4 { /* Datasource definition */ DatasourceDefn defn; int nRec; int nRepeat; int bReopen; }; static void doDataTest4( const char *zSystem, /* Database system to test */ Datatest4 *p, /* Structure containing test parameters */ int *pRc /* OUT: Error code */ ){ lsm_db *db = 0; TestDb *pDb; TestDb *pControl; Datasource *pData; int i; int rc = 0; int iDot = 0; int bMultiThreaded = 0; /* True for MT LSM database */ int nRecOn3 = (p->nRec / 3); int iData = 0; /* Start the test case, open a database and allocate the datasource. */ rc = testControlDb(&pControl); pDb = testOpen(zSystem, 1, &rc); pData = testDatasourceNew(&p->defn); if( rc==0 ){ db = tdb_lsm(pDb); bMultiThreaded = tdb_lsm_multithread(pDb); } testWriteDatasourceRange(pControl, pData, iData, nRecOn3*3, &rc); testWriteDatasourceRange(pDb, pData, iData, nRecOn3*3, &rc); for(i=0; rc==0 && inRepeat; i++){ testDeleteDatasourceRange(pControl, pData, iData, nRecOn3*2, &rc); testDeleteDatasourceRange(pDb, pData, iData, nRecOn3*2, &rc); if( db ){ int nDone; #if 0 fprintf(stderr, "lsm_work() start...\n"); fflush(stderr); #endif do { nDone = 0; rc = lsm_work(db, 1, (1<<30), &nDone); }while( rc==0 && nDone>0 ); if( bMultiThreaded && rc==LSM_BUSY ) rc = LSM_OK; #if 0 fprintf(stderr, "lsm_work() done...\n"); fflush(stderr); #endif } if( i+1nRepeat ){ iData += (nRecOn3*2); testWriteDatasourceRange(pControl, pData, iData+nRecOn3, nRecOn3*2, &rc); testWriteDatasourceRange(pDb, pData, iData+nRecOn3, nRecOn3*2, &rc); testCompareDb(pData, nRecOn3*3, iData, pControl, pDb, &rc); /* If Datatest4.bReopen is true, close and reopen the database */ if( p->bReopen ){ testReopen(&pDb, &rc); if( rc==0 ) db = tdb_lsm(pDb); } } /* Update the progress dots... */ testCaseProgress(i, p->nRepeat, testCaseNDot(), &iDot); } testClose(&pDb); testClose(&pControl); testDatasourceFree(pData); testCaseFinish(rc); *pRc = rc; } static char *getName4(const char *zSystem, Datatest4 *pTest){ char *zRet; char *zData; zData = testDatasourceName(&pTest->defn); zRet = testMallocPrintf("data4.%s.%s.%d.%d.%d", zSystem, zData, pTest->nRec, pTest->nRepeat, pTest->bReopen ); testFree(zData); return zRet; } void test_data_4( const char *zSystem, /* Database system name */ const char *zPattern, /* Run test cases that match this pattern */ int *pRc /* IN/OUT: Error code */ ){ Datatest4 aTest[] = { /* defn, nRec, nRepeat, bReopen */ { {DATA_RANDOM, 20,25, 500,600}, 10000, 10, 0 }, { {DATA_RANDOM, 20,25, 500,600}, 10000, 10, 1 }, }; int i; for(i=0; *pRc==LSM_OK && ieType ){ case TEST_DATASOURCE_RANDOM: { int nRange = (1 + p->nMaxKey - p->nMinKey); nKey = (int)( testPrngValue((u32)iData) % nRange ) + p->nMinKey; testPrngString((u32)iData, p->aKey, nKey); break; } case TEST_DATASOURCE_SEQUENCE: nKey = sprintf(p->aKey, "%012d", iData); break; } *ppKey = p->aKey; *pnKey = nKey; } if( ppVal ){ u32 nVal = testPrngValue((u32)iData)%(1+p->nMaxVal-p->nMinVal)+p->nMinVal; testPrngString((u32)~iData, p->aVal, (int)nVal); *ppVal = p->aVal; *pnVal = (int)nVal; } } void testDatasourceFree(Datasource *p){ testFree(p); } /* ** Return a pointer to a nul-terminated string that corresponds to the ** contents of the datasource-definition passed as the first argument. ** The caller should eventually free the returned pointer using testFree(). */ char *testDatasourceName(const DatasourceDefn *p){ char *zRet; zRet = testMallocPrintf("%s.(%d-%d).(%d-%d)", (p->eType==TEST_DATASOURCE_SEQUENCE ? "seq" : "rnd"), p->nMinKey, p->nMaxKey, p->nMinVal, p->nMaxVal ); return zRet; } Datasource *testDatasourceNew(const DatasourceDefn *pDefn){ Datasource *p; int nMinKey; int nMaxKey; int nMinVal; int nMaxVal; if( pDefn->eType==TEST_DATASOURCE_SEQUENCE ){ nMinKey = 128; nMaxKey = 128; }else{ nMinKey = MAX(0, pDefn->nMinKey); nMaxKey = MAX(nMinKey, pDefn->nMaxKey); } nMinVal = MAX(0, pDefn->nMinVal); nMaxVal = MAX(nMinVal, pDefn->nMaxVal); p = (Datasource *)testMalloc(sizeof(Datasource) + nMaxKey + nMaxVal + 1); p->eType = pDefn->eType; p->nMinKey = nMinKey; p->nMinVal = nMinVal; p->nMaxKey = nMaxKey; p->nMaxVal = nMaxVal; p->aKey = (char *)&p[1]; p->aVal = &p->aKey[nMaxKey]; return p; }; ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest_func.c ================================================ #include "lsmtest.h" int do_work(int nArg, char **azArg){ struct Option { const char *zName; } aOpt [] = { { "-nmerge" }, { "-nkb" }, { 0 } }; lsm_db *pDb; int rc; int i; const char *zDb; int nMerge = 1; int nKB = (1<<30); if( nArg==0 ) goto usage; zDb = azArg[nArg-1]; for(i=0; i<(nArg-1); i++){ int iSel; rc = testArgSelect(aOpt, "option", azArg[i], &iSel); if( rc ) return rc; switch( iSel ){ case 0: i++; if( i==(nArg-1) ) goto usage; nMerge = atoi(azArg[i]); break; case 1: i++; if( i==(nArg-1) ) goto usage; nKB = atoi(azArg[i]); break; } } rc = lsm_new(0, &pDb); if( rc!=LSM_OK ){ testPrintError("lsm_open(): rc=%d\n", rc); }else{ rc = lsm_open(pDb, zDb); if( rc!=LSM_OK ){ testPrintError("lsm_open(): rc=%d\n", rc); }else{ int n = -1; lsm_config(pDb, LSM_CONFIG_BLOCK_SIZE, &n); n = n*2; lsm_config(pDb, LSM_CONFIG_AUTOCHECKPOINT, &n); rc = lsm_work(pDb, nMerge, nKB, 0); if( rc!=LSM_OK ){ testPrintError("lsm_work(): rc=%d\n", rc); } } } if( rc==LSM_OK ){ rc = lsm_checkpoint(pDb, 0); } lsm_close(pDb); return rc; usage: testPrintUsage("?-optimize? ?-n N? DATABASE"); return -1; } /* ** lsmtest show ?-config LSM-CONFIG? DATABASE ?COMMAND ?PGNO?? */ int do_show(int nArg, char **azArg){ lsm_db *pDb; int rc; const char *zDb; int eOpt = LSM_INFO_DB_STRUCTURE; unsigned int iPg = 0; int bConfig = 0; const char *zConfig = ""; struct Option { const char *zName; int bConfig; int eOpt; } aOpt [] = { { "array", 0, LSM_INFO_ARRAY_STRUCTURE }, { "array-pages", 0, LSM_INFO_ARRAY_PAGES }, { "blocksize", 1, LSM_CONFIG_BLOCK_SIZE }, { "pagesize", 1, LSM_CONFIG_PAGE_SIZE }, { "freelist", 0, LSM_INFO_FREELIST }, { "page-ascii", 0, LSM_INFO_PAGE_ASCII_DUMP }, { "page-hex", 0, LSM_INFO_PAGE_HEX_DUMP }, { 0, 0 } }; char *z = 0; int iDb = 0; /* Index of DATABASE in azArg[] */ /* Check if there is a "-config" option: */ if( nArg>2 && strlen(azArg[0])>1 && memcmp(azArg[0], "-config", strlen(azArg[0]))==0 ){ zConfig = azArg[1]; iDb = 2; } if( nArg<(iDb+1) ) goto usage; if( nArg>(iDb+1) ){ rc = testArgSelect(aOpt, "option", azArg[iDb+1], &eOpt); if( rc!=0 ) return rc; bConfig = aOpt[eOpt].bConfig; eOpt = aOpt[eOpt].eOpt; if( (bConfig==0 && eOpt==LSM_INFO_FREELIST) || (bConfig==1 && eOpt==LSM_CONFIG_BLOCK_SIZE) || (bConfig==1 && eOpt==LSM_CONFIG_PAGE_SIZE) ){ if( nArg!=(iDb+2) ) goto usage; }else{ if( nArg!=(iDb+3) ) goto usage; iPg = atoi(azArg[iDb+2]); } } zDb = azArg[iDb]; rc = lsm_new(0, &pDb); tdb_lsm_configure(pDb, zConfig); if( rc!=LSM_OK ){ testPrintError("lsm_new(): rc=%d\n", rc); }else{ rc = lsm_open(pDb, zDb); if( rc!=LSM_OK ){ testPrintError("lsm_open(): rc=%d\n", rc); } } if( rc==LSM_OK ){ if( bConfig==0 ){ switch( eOpt ){ case LSM_INFO_DB_STRUCTURE: case LSM_INFO_FREELIST: rc = lsm_info(pDb, eOpt, &z); break; case LSM_INFO_ARRAY_STRUCTURE: case LSM_INFO_ARRAY_PAGES: case LSM_INFO_PAGE_ASCII_DUMP: case LSM_INFO_PAGE_HEX_DUMP: rc = lsm_info(pDb, eOpt, iPg, &z); break; default: assert( !"no chance" ); } if( rc==LSM_OK ){ printf("%s\n", z ? z : ""); fflush(stdout); } lsm_free(lsm_get_env(pDb), z); }else{ int iRes = -1; lsm_config(pDb, eOpt, &iRes); printf("%d\n", iRes); fflush(stdout); } } lsm_close(pDb); return rc; usage: testPrintUsage("DATABASE ?array|page-ascii|page-hex PGNO?"); return -1; } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest_io.c ================================================ /* ** SUMMARY ** ** This file implements the 'io' subcommand of the test program. It is used ** for testing the performance of various combinations of write() and fsync() ** system calls. All operations occur on a single file, which may or may not ** exist when a test is started. ** ** A test consists of a series of commands. Each command is either a write ** or an fsync. A write is specified as "@", where ** is the amount of data written, and is the offset of the file ** to write to. An or an is specified as an integer number ** of bytes. Or, if postfixed with a "K", "M" or "G", an integer number of ** KB, MB or GB, respectively. An fsync is simply "S". All commands are ** case-insensitive. ** ** Example test program: ** ** 2M@6M 1492K@4M S 4096@4K S ** ** This program writes 2 MB of data starting at the offset 6MB offset of ** the file, followed by 1492 KB of data written at the 4MB offset of the ** file, followed by a call to fsync(), a write of 4KB of data at byte ** offset 4096, and finally another call to fsync(). ** ** Commands may either be specified on the command line (one command per ** command line argument) or read from stdin. Commands read from stdin ** must be separated by white-space. ** ** COMMAND LINE INVOCATION ** ** The sub-command implemented in this file must be invoked with at least ** two arguments - the path to the file to write to and the page-size to ** use for writing. If there are more than two arguments, then each ** subsequent argument is assumed to be a test command. If there are exactly ** two arguments, the test commands are read from stdin. ** ** A write command does not result in a single call to system call write(). ** Instead, the specified region is written sequentially using one or ** more calls to write(), each of which writes not more than one page of ** data. For example, if the page-size is 4KB, the command "2M@6M" results ** in 512 calls to write(), each of which writes 4KB of data. ** ** EXAMPLES ** ** Two equivalent examples: ** ** $ lsmtest io testfile.db 4KB 2M@6M 1492K@4M S 4096@4K S ** 3544K written in 129 ms ** $ echo "2M@6M 1492K@4M S 4096@4K S" | lsmtest io testfile.db 4096 ** 3544K written in 127 ms ** */ #include "lsmtest.h" typedef struct IoContext IoContext; struct IoContext { int fd; int nWrite; }; /* ** As isspace(3) */ static int safe_isspace(char c){ if( c&0x80) return 0; return isspace(c); } /* ** As isdigit(3) */ static int safe_isdigit(char c){ if( c&0x80) return 0; return isdigit(c); } static i64 getNextSize(char *zIn, char **pzOut, int *pRc){ i64 iRet = 0; if( *pRc==0 ){ char *z = zIn; if( !safe_isdigit(*z) ){ *pRc = 1; return 0; } /* Process digits */ while( safe_isdigit(*z) ){ iRet = iRet*10 + (*z - '0'); z++; } /* Process suffix */ switch( *z ){ case 'k': case 'K': iRet = iRet * 1024; z++; break; case 'm': case 'M': iRet = iRet * 1024 * 1024; z++; break; case 'g': case 'G': iRet = iRet * 1024 * 1024 * 1024; z++; break; } if( pzOut ) *pzOut = z; } return iRet; } static int doOneCmd( IoContext *pCtx, u8 *aData, int pgsz, char *zCmd, char **pzOut ){ char c; char *z = zCmd; while( safe_isspace(*z) ) z++; c = *z; if( c==0 ){ if( pzOut ) *pzOut = z; return 0; } if( c=='s' || c=='S' ){ if( pzOut ) *pzOut = &z[1]; return fdatasync(pCtx->fd); } if( safe_isdigit(c) ){ i64 iOff = 0; int nByte = 0; int rc = 0; int nPg; int iPg; nByte = (int)getNextSize(z, &z, &rc); if( rc || *z!='@' ) goto bad_command; z++; iOff = getNextSize(z, &z, &rc); if( rc || (safe_isspace(*z)==0 && *z!='\0') ) goto bad_command; if( pzOut ) *pzOut = z; nPg = (nByte+pgsz-1) / pgsz; lseek(pCtx->fd, (off_t)iOff, SEEK_SET); for(iPg=0; iPgfd, aData, pgsz); } pCtx->nWrite += nByte/1024; return 0; } bad_command: testPrintError("unrecognized command: %s", zCmd); return 1; } static int readStdin(char **pzOut){ int nAlloc = 128; char *zOut = 0; int nOut = 0; while( !feof(stdin) ){ int nRead; nAlloc = nAlloc*2; zOut = realloc(zOut, nAlloc); nRead = fread(&zOut[nOut], 1, nAlloc-nOut-1, stdin); if( nRead==0 ) break; nOut += nRead; zOut[nOut] = '\0'; } *pzOut = zOut; return 0; } int do_io(int nArg, char **azArg){ IoContext ctx; int pgsz; char *zFile; char *zPgsz; int i; int rc = 0; char *zStdin = 0; char *z; u8 *aData; memset(&ctx, 0, sizeof(IoContext)); if( nArg<2 ){ testPrintUsage("FILE PGSZ ?CMD-1 ...?"); return -1; } zFile = azArg[0]; zPgsz = azArg[1]; pgsz = (int)getNextSize(zPgsz, 0, &rc); if( pgsz<=0 ){ testPrintError("Ridiculous page size: %d", pgsz); return -1; } aData = malloc(pgsz); memset(aData, 0x77, pgsz); ctx.fd = open(zFile, O_RDWR|O_CREAT|_O_BINARY, 0644); if( ctx.fd<0 ){ perror("open: "); return -1; } if( nArg==2 ){ readStdin(&zStdin); testTimeInit(); z = zStdin; while( *z && rc==0 ){ rc = doOneCmd(&ctx, aData, pgsz, z, &z); } }else{ testTimeInit(); for(i=2; i void test_failed(){ assert( 0 ); return; } #define testSetError(rc) testSetErrorFunc(rc, pRc, __FILE__, __LINE__) static void testSetErrorFunc(int rc, int *pRc, const char *zFile, int iLine){ if( rc ){ *pRc = rc; fprintf(stderr, "FAILED (%s:%d) rc=%d ", zFile, iLine, rc); test_failed(); } } static int lsm_memcmp(u8 *a, u8 *b, int c){ int i; for(i=0; i0 && lsm_memcmp(pVal, pDbVal, nVal))) ){ testSetError(1); } } } void testWrite( TestDb *pDb, /* Database handle */ void *pKey, int nKey, /* Key to query database for */ void *pVal, int nVal, /* Value to write */ int *pRc /* IN/OUT: Error code */ ){ if( *pRc==0 ){ int rc; static int nCall = 0; nCall++; rc = tdb_write(pDb, pKey, nKey, pVal, nVal); testSetError(rc); } } void testDelete( TestDb *pDb, /* Database handle */ void *pKey, int nKey, /* Key to query database for */ int *pRc /* IN/OUT: Error code */ ){ if( *pRc==0 ){ int rc; *pRc = rc = tdb_delete(pDb, pKey, nKey); testSetError(rc); } } void testDeleteRange( TestDb *pDb, /* Database handle */ void *pKey1, int nKey1, void *pKey2, int nKey2, int *pRc /* IN/OUT: Error code */ ){ if( *pRc==0 ){ int rc; *pRc = rc = tdb_delete_range(pDb, pKey1, nKey1, pKey2, nKey2); testSetError(rc); } } void testBegin(TestDb *pDb, int iTrans, int *pRc){ if( *pRc==0 ){ int rc; rc = tdb_begin(pDb, iTrans); testSetError(rc); } } void testCommit(TestDb *pDb, int iTrans, int *pRc){ if( *pRc==0 ){ int rc; rc = tdb_commit(pDb, iTrans); testSetError(rc); } } #if 0 /* unused */ static void testRollback(TestDb *pDb, int iTrans, int *pRc){ if( *pRc==0 ){ int rc; rc = tdb_rollback(pDb, iTrans); testSetError(rc); } } #endif void testWriteStr( TestDb *pDb, /* Database handle */ const char *zKey, /* Key to query database for */ const char *zVal, /* Value to write */ int *pRc /* IN/OUT: Error code */ ){ int nVal = (zVal ? strlen(zVal) : 0); testWrite(pDb, (void *)zKey, strlen(zKey), (void *)zVal, nVal, pRc); } #if 0 /* unused */ static void testDeleteStr(TestDb *pDb, const char *zKey, int *pRc){ testDelete(pDb, (void *)zKey, strlen(zKey), pRc); } #endif void testFetchStr( TestDb *pDb, /* Database handle */ const char *zKey, /* Key to query database for */ const char *zVal, /* Value to write */ int *pRc /* IN/OUT: Error code */ ){ int nVal = (zVal ? strlen(zVal) : 0); testFetch(pDb, (void *)zKey, strlen(zKey), (void *)zVal, nVal, pRc); } void testFetchCompare( TestDb *pControl, TestDb *pDb, void *pKey, int nKey, int *pRc ){ int rc; void *pDbVal1; void *pDbVal2; int nDbVal1; int nDbVal2; static int nCall = 0; nCall++; rc = tdb_fetch(pControl, pKey, nKey, &pDbVal1, &nDbVal1); testSetError(rc); rc = tdb_fetch(pDb, pKey, nKey, &pDbVal2, &nDbVal2); testSetError(rc); if( *pRc==0 && (nDbVal1!=nDbVal2 || (nDbVal1>0 && memcmp(pDbVal1, pDbVal2, nDbVal1))) ){ testSetError(1); } } typedef struct ScanResult ScanResult; struct ScanResult { TestDb *pDb; int nRow; u32 cksum1; u32 cksum2; void *pKey1; int nKey1; void *pKey2; int nKey2; int bReverse; int nPrevKey; u8 aPrevKey[256]; }; static int keyCompare(void *pKey1, int nKey1, void *pKey2, int nKey2){ int res; res = memcmp(pKey1, pKey2, MIN(nKey1, nKey2)); if( res==0 ){ res = nKey1 - nKey2; } return res; } int test_scan_debug = 0; static void scanCompareCb( void *pCtx, void *pKey, int nKey, void *pVal, int nVal ){ ScanResult *p = (ScanResult *)pCtx; u8 *aKey = (u8 *)pKey; u8 *aVal = (u8 *)pVal; int i; if( test_scan_debug ){ printf("%d: %.*s\n", p->nRow, nKey, (char *)pKey); fflush(stdout); } #if 0 if( test_scan_debug ) printf("%.20s\n", (char *)pVal); #endif #if 0 /* Check tdb_fetch() matches */ int rc = 0; testFetch(p->pDb, pKey, nKey, pVal, nVal, &rc); assert( rc==0 ); #endif /* Update the checksum data */ p->nRow++; for(i=0; icksum1 += ((int)aKey[i] << (i&0x0F)); p->cksum2 += p->cksum1; } for(i=0; icksum1 += ((int)aVal[i] << (i&0x0F)); p->cksum2 += p->cksum1; } /* Check that the delivered row is not out of order. */ if( nKey<(int)sizeof(p->aPrevKey) ){ if( p->nPrevKey ){ int res = keyCompare(p->aPrevKey, p->nPrevKey, pKey, nKey); if( (res<0 && p->bReverse) || (res>0 && p->bReverse==0) ){ testPrintError("Returned key out of order at %s:%d\n", __FILE__, __LINE__ ); } } p->nPrevKey = nKey; memcpy(p->aPrevKey, pKey, MIN(p->nPrevKey, nKey)); } /* Check that the delivered row is within range. */ if( p->pKey1 && ( (memcmp(p->pKey1, pKey, MIN(p->nKey1, nKey))>0) || (memcmp(p->pKey1, pKey, MIN(p->nKey1, nKey))==0 && p->nKey1>nKey) )){ testPrintError("Returned key too small at %s:%d\n", __FILE__, __LINE__); } if( p->pKey2 && ( (memcmp(p->pKey2, pKey, MIN(p->nKey2, nKey))<0) || (memcmp(p->pKey2, pKey, MIN(p->nKey2, nKey))==0 && p->nKey2=0 ); zRet = (char *)testMalloc(nByte+1); vsnprintf(zRet, nByte+1, zFormat, ap); return zRet; } char *testMallocPrintf(const char *zFormat, ...){ va_list ap; char *zRet; va_start(ap, zFormat); zRet = testMallocVPrintf(zFormat, ap); va_end(ap); return zRet; } /* ** A wrapper around malloc(3). ** ** This function should be used for all allocations made by test procedures. ** It has the following properties: ** ** * Test code may assume that allocations may not fail. ** * Returned memory is always zeroed. ** ** Allocations made using testMalloc() should be freed using testFree(). */ void *testMalloc(int n){ u8 *p = (u8*)malloc(n + 8); memset(p, 0, n+8); *(int*)p = n; return (void*)&p[8]; } void *testMallocCopy(void *pCopy, int nByte){ void *pRet = testMalloc(nByte); memcpy(pRet, pCopy, nByte); return pRet; } void *testRealloc(void *ptr, int n){ if( ptr ){ u8 *p = (u8*)ptr - 8; int nOrig = *(int*)p; p = (u8*)realloc(p, n+8); if( nOrig1 ){ testPrintError("Usage: test ?PATTERN?\n"); return 1; } if( nArg==1 ){ zPattern = azArg[0]; } for(j=0; tdb_system_name(j); j++){ rc = 0; test_data_1(tdb_system_name(j), zPattern, &rc); test_data_2(tdb_system_name(j), zPattern, &rc); test_data_3(tdb_system_name(j), zPattern, &rc); test_data_4(tdb_system_name(j), zPattern, &rc); test_rollback(tdb_system_name(j), zPattern, &rc); test_mc(tdb_system_name(j), zPattern, &rc); test_mt(tdb_system_name(j), zPattern, &rc); if( rc ) nFail++; } rc = 0; test_oom(zPattern, &rc); if( rc ) nFail++; rc = 0; test_api(zPattern, &rc); if( rc ) nFail++; rc = 0; do_crash_test(zPattern, &rc); if( rc ) nFail++; rc = 0; do_writer_crash_test(zPattern, &rc); if( rc ) nFail++; return (nFail!=0); } static lsm_db *configure_lsm_db(TestDb *pDb){ lsm_db *pLsm; pLsm = tdb_lsm(pDb); if( pLsm ){ tdb_lsm_config_str(pDb, "mmap=1 autowork=1 automerge=4 worker_automerge=4"); } return pLsm; } typedef struct WriteHookEvent WriteHookEvent; struct WriteHookEvent { i64 iOff; int nData; int nUs; }; WriteHookEvent prev = {0, 0, 0}; static void flushPrev(FILE *pOut){ if( prev.nData ){ fprintf(pOut, "w %s %lld %d %d\n", "d", prev.iOff, prev.nData, prev.nUs); prev.nData = 0; } } #if 0 /* unused */ static void do_speed_write_hook2( void *pCtx, int bLog, i64 iOff, int nData, int nUs ){ FILE *pOut = (FILE *)pCtx; if( bLog ) return; if( prev.nData && nData && iOff==prev.iOff+prev.nData ){ prev.nData += nData; prev.nUs += nUs; }else{ flushPrev(pOut); if( nData==0 ){ fprintf(pOut, "s %s 0 0 %d\n", (bLog ? "l" : "d"), nUs); }else{ prev.iOff = iOff; prev.nData = nData; prev.nUs = nUs; } } } #endif #define ST_REPEAT 0 #define ST_WRITE 1 #define ST_PAUSE 2 #define ST_FETCH 3 #define ST_SCAN 4 #define ST_NSCAN 5 #define ST_KEYSIZE 6 #define ST_VALSIZE 7 #define ST_TRANS 8 static void print_speed_test_help(){ printf( "\n" "Repeat the following $repeat times:\n" " 1. Insert $write key-value pairs. One transaction for each write op.\n" " 2. Pause for $pause ms.\n" " 3. Perform $fetch queries on the database.\n" "\n" " Keys are $keysize bytes in size. Values are $valsize bytes in size\n" " Both keys and values are pseudo-randomly generated\n" "\n" "Options are:\n" " -repeat $repeat (default value 10)\n" " -write $write (default value 10000)\n" " -pause $pause (default value 0)\n" " -fetch $fetch (default value 0)\n" " -keysize $keysize (default value 12)\n" " -valsize $valsize (default value 100)\n" " -system $system (default value \"lsm\")\n" " -trans $trans (default value 0)\n" "\n" ); } int do_speed_test2(int nArg, char **azArg){ struct Option { const char *zOpt; int eVal; int iDefault; } aOpt[] = { { "-repeat", ST_REPEAT, 10}, { "-write", ST_WRITE, 10000}, { "-pause", ST_PAUSE, 0}, { "-fetch", ST_FETCH, 0}, { "-scan", ST_SCAN, 0}, { "-nscan", ST_NSCAN, 0}, { "-keysize", ST_KEYSIZE, 12}, { "-valsize", ST_VALSIZE, 100}, { "-trans", ST_TRANS, 0}, { "-system", -1, 0}, { "help", -2, 0}, {0, 0, 0} }; int i; int aParam[9]; int rc = 0; int bReadonly = 0; int nContent = 0; TestDb *pDb; Datasource *pData; DatasourceDefn defn = { TEST_DATASOURCE_RANDOM, 0, 0, 0, 0 }; char *zSystem = ""; int bLsm = 1; FILE *pLog = 0; #ifdef NDEBUG /* If NDEBUG is defined, disable the dynamic memory related checks in ** lsmtest_mem.c. They slow things down. */ testMallocUninstall(tdb_lsm_env()); #endif /* Initialize aParam[] with default values. */ for(i=0; i=0 ){ aParam[aOpt[iSel].eVal] = atoi(azArg[i+1]); }else{ zSystem = azArg[i+1]; bLsm = 0; #if 0 for(j=0; zSystem[j]; j++){ if( zSystem[j]=='=' ) bLsm = 1; } #endif } } printf("#"); for(i=0; i=0 ){ printf(" %s=%d", &aOpt[i].zOpt[1], aParam[aOpt[i].eVal]); }else if( aOpt[i].eVal==-1 ){ printf(" %s=\"%s\"", &aOpt[i].zOpt[1], zSystem); } } } printf("\n"); defn.nMinKey = defn.nMaxKey = aParam[ST_KEYSIZE]; defn.nMinVal = defn.nMaxVal = aParam[ST_VALSIZE]; pData = testDatasourceNew(&defn); if( aParam[ST_WRITE]==0 ){ bReadonly = 1; } if( bLsm ){ rc = tdb_lsm_open(zSystem, "testdb.lsm", !bReadonly, &pDb); }else{ pDb = testOpen(zSystem, !bReadonly, &rc); } if( rc!=0 ) return rc; if( bReadonly ){ nContent = testCountDatabase(pDb); } #if 0 pLog = fopen("/tmp/speed.log", "w"); tdb_lsm_write_hook(pDb, do_speed_write_hook2, (void *)pLog); #endif for(i=0; i=nArg ){ testPrintError("option %s requires an argument\n", aOpt[iSel].zOpt); return 1; } if( aOpt[iSel].isSwitch==1 ){ nRow = atoi(azArg[i]); } if( aOpt[iSel].isSwitch==2 ){ nSleep = atoi(azArg[i]); } if( aOpt[iSel].isSwitch==3 ){ struct Mode { const char *zMode; int doReadTest; int doWriteTest; } aMode[] = {{"ro", 1, 0} , {"rw", 1, 1}, {"wo", 0, 1}, {0, 0, 0}}; int iMode; rc = testArgSelect(aMode, "option", azArg[i], &iMode); if( rc ) return rc; doReadTest = aMode[iMode].doReadTest; doWriteTest = aMode[iMode].doWriteTest; } if( aOpt[iSel].isSwitch==4 ){ /* The "-out FILE" switch. This option is used to specify a file to ** write the gnuplot script to. */ zOut = azArg[i]; } }else{ /* A db name */ rc = testArgSelect(aOpt, "system", azArg[i], &iSel); if( rc ) return rc; sys_mask |= (1< 100000) ? 100000 : nSelStep; aTime = malloc(sizeof(int) * ArraySize(aSys) * nRow/nStep); aWrite = malloc(sizeof(int) * nRow/nStep); aSelTime = malloc(sizeof(int) * ArraySize(aSys) * nRow/nSelStep); /* This loop collects the INSERT speed data. */ if( doWriteTest ){ printf("Writing output to file \"%s\".\n", zOut); for(j=0; aSys[j].zLibrary; j++){ FILE *pLog = 0; TestDb *pDb; /* Database being tested */ lsm_db *pLsm; int iDot = 0; if( ((1<nData ){ fprintf(pHook->pOut, "write %s %d %d\n", (pHook->bLog ? "log" : "db"), (int)pHook->iOff, pHook->nData ); pHook->nData = 0; fflush(pHook->pOut); } } static void do_insert_write_hook( void *pCtx, int bLog, i64 iOff, int nData, int nUs ){ InsertWriteHook *pHook = (InsertWriteHook *)pCtx; if( bLog ) return; if( nData==0 ){ flushHook(pHook); fprintf(pHook->pOut, "sync %s\n", (bLog ? "log" : "db")); }else if( pHook->nData && bLog==pHook->bLog && iOff==(pHook->iOff+pHook->nData) ){ pHook->nData += nData; }else{ flushHook(pHook); pHook->bLog = bLog; pHook->iOff = iOff; pHook->nData = nData; } } static int do_replay(int nArg, char **azArg){ char aBuf[4096]; FILE *pInput; FILE *pClose = 0; const char *zDb; lsm_env *pEnv; lsm_file *pOut; int rc; if( nArg!=2 ){ testPrintError("Usage: replay WRITELOG FILE\n"); return 1; } if( strcmp(azArg[0], "-")==0 ){ pInput = stdin; }else{ pClose = pInput = fopen(azArg[0], "r"); } zDb = azArg[1]; pEnv = tdb_lsm_env(); rc = pEnv->xOpen(pEnv, zDb, 0, &pOut); if( rc!=LSM_OK ) return rc; while( feof(pInput)==0 ){ char zLine[80]; fgets(zLine, sizeof(zLine)-1, pInput); zLine[sizeof(zLine)-1] = '\0'; if( 0==memcmp("sync db", zLine, 7) ){ rc = pEnv->xSync(pOut); if( rc!=0 ) break; }else{ int iOff; int nData; int nMatch; nMatch = sscanf(zLine, "write db %d %d", &iOff, &nData); if( nMatch==2 ){ int i; for(i=0; ixWrite(pOut, iOff+i, aBuf, sizeof(aBuf)); if( rc!=0 ) break; } } } } if( pClose ) fclose(pClose); pEnv->xClose(pOut); return rc; } static int do_insert(int nArg, char **azArg){ const char *zDb = "lsm"; TestDb *pDb = 0; int i; int rc; const int nRow = 1 * 1000 * 1000; DatasourceDefn defn = { TEST_DATASOURCE_RANDOM, 8, 15, 80, 150 }; Datasource *pData = 0; if( nArg>1 ){ testPrintError("Usage: insert ?DATABASE?\n"); return 1; } if( nArg==1 ){ zDb = azArg[0]; } testMallocUninstall(tdb_lsm_env()); for(i=0; zDb[i] && zDb[i]!='='; i++); if( zDb[i] ){ rc = tdb_lsm_open(zDb, "testdb.lsm", 1, &pDb); }else{ rc = tdb_open(zDb, 0, 1, &pDb); } if( rc!=0 ){ testPrintError("Error opening db \"%s\": %d\n", zDb, rc); }else{ InsertWriteHook hook; memset(&hook, 0, sizeof(hook)); hook.pOut = fopen("writelog.txt", "w"); pData = testDatasourceNew(&defn); tdb_lsm_config_work_hook(pDb, do_insert_work_hook, 0); tdb_lsm_write_hook(pDb, do_insert_write_hook, (void *)&hook); if( rc==0 ){ for(i=0; i #include static void lsmtest_rusage_report(void){ struct rusage r; memset(&r, 0, sizeof(r)); getrusage(RUSAGE_SELF, &r); printf("# getrusage: { ru_maxrss %d ru_oublock %d ru_inblock %d }\n", (int)r.ru_maxrss, (int)r.ru_oublock, (int)r.ru_inblock ); } #else static void lsmtest_rusage_report(void){ /* no-op */ } #endif int main(int argc, char **argv){ struct TestFunc { const char *zName; int bRusageReport; int (*xFunc)(int, char **); } aTest[] = { {"random", 1, do_random_tests}, {"writespeed", 1, do_writer_test}, {"io", 1, st_do_io}, {"insert", 1, do_insert}, {"replay", 1, do_replay}, {"speed", 1, do_speed_tests}, {"speed2", 1, do_speed_test2}, {"show", 0, st_do_show}, {"work", 1, st_do_work}, {"test", 1, do_test}, {0, 0} }; int rc; /* Return Code */ int iFunc; /* Index into aTest[] */ int nLeakAlloc = 0; /* Allocations leaked by lsm */ int nLeakByte = 0; /* Bytes leaked by lsm */ #ifdef LSM_DEBUG_MEM FILE *pReport = 0; /* lsm malloc() report file */ const char *zReport = "malloc.txt generated"; #else const char *zReport = "malloc.txt NOT generated"; #endif testMallocInstall(tdb_lsm_env()); if( argc<2 ){ testPrintError("Usage: %s sub-command ?args...?\n", argv[0]); return -1; } /* Initialize error reporting */ testErrorInit(argc, argv); /* Initialize PRNG system */ testPrngInit(); rc = testArgSelect(aTest, "sub-command", argv[1], &iFunc); if( rc==0 ){ rc = aTest[iFunc].xFunc(argc-2, &argv[2]); } #ifdef LSM_DEBUG_MEM pReport = fopen("malloc.txt", "w"); testMallocCheck(tdb_lsm_env(), &nLeakAlloc, &nLeakByte, pReport); fclose(pReport); #else testMallocCheck(tdb_lsm_env(), &nLeakAlloc, &nLeakByte, 0); #endif if( nLeakAlloc ){ testPrintError("Leaked %d bytes in %d allocations (%s)\n", nLeakByte, nLeakAlloc, zReport ); if( rc==0 ) rc = -1; } testMallocUninstall(tdb_lsm_env()); if( aTest[iFunc].bRusageReport ){ lsmtest_rusage_report(); } return rc; } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest_mem.c ================================================ #include #include #include #define ArraySize(x) ((int)(sizeof(x) / sizeof((x)[0]))) #define MIN(x,y) ((x)<(y) ? (x) : (y)) typedef unsigned int u32; typedef unsigned char u8; typedef long long int i64; typedef unsigned long long int u64; #if defined(__GLIBC__) && defined(LSM_DEBUG_MEM) extern int backtrace(void**,int); extern void backtrace_symbols_fd(void*const*,int,int); # define TM_BACKTRACE 12 #else # define backtrace(A,B) 1 # define backtrace_symbols_fd(A,B,C) #endif typedef struct TmBlockHdr TmBlockHdr; typedef struct TmAgg TmAgg; typedef struct TmGlobal TmGlobal; struct TmGlobal { /* Linked list of all currently outstanding allocations. And a table of ** all allocations, past and present, indexed by backtrace() info. */ TmBlockHdr *pFirst; #ifdef TM_BACKTRACE TmAgg *aHash[10000]; #endif /* Underlying malloc/realloc/free functions */ void *(*xMalloc)(int); /* underlying malloc(3) function */ void *(*xRealloc)(void *, int); /* underlying realloc(3) function */ void (*xFree)(void *); /* underlying free(3) function */ /* Mutex to protect pFirst and aHash */ void (*xEnterMutex)(TmGlobal*); /* Call this to enter the mutex */ void (*xLeaveMutex)(TmGlobal*); /* Call this to leave mutex */ void (*xDelMutex)(TmGlobal*); /* Call this to delete mutex */ void *pMutex; /* Mutex handle */ void *(*xSaveMalloc)(void *, size_t); void *(*xSaveRealloc)(void *, void *, size_t); void (*xSaveFree)(void *, void *); /* OOM injection scheduling. If nCountdown is greater than zero when a ** malloc attempt is made, it is decremented. If this means nCountdown ** transitions from 1 to 0, then the allocation fails. If bPersist is true ** when this happens, nCountdown is then incremented back to 1 (so that the ** next attempt fails too). */ int nCountdown; int bPersist; int bEnable; void (*xHook)(void *); void *pHookCtx; }; struct TmBlockHdr { TmBlockHdr *pNext; TmBlockHdr *pPrev; int nByte; #ifdef TM_BACKTRACE TmAgg *pAgg; #endif u32 iForeGuard; }; #ifdef TM_BACKTRACE struct TmAgg { int nAlloc; /* Number of allocations at this path */ int nByte; /* Total number of bytes allocated */ int nOutAlloc; /* Number of outstanding allocations */ int nOutByte; /* Number of outstanding bytes */ void *aFrame[TM_BACKTRACE]; /* backtrace() output */ TmAgg *pNext; /* Next object in hash-table collision */ }; #endif #define FOREGUARD 0x80F5E153 #define REARGUARD 0xE4676B53 static const u32 rearguard = REARGUARD; #define ROUND8(x) (((x)+7)&~7) #define BLOCK_HDR_SIZE (ROUND8( sizeof(TmBlockHdr) )) static void lsmtest_oom_error(void){ static int nErr = 0; nErr++; } static void tmEnterMutex(TmGlobal *pTm){ pTm->xEnterMutex(pTm); } static void tmLeaveMutex(TmGlobal *pTm){ pTm->xLeaveMutex(pTm); } static void *tmMalloc(TmGlobal *pTm, int nByte){ TmBlockHdr *pNew; /* New allocation header block */ u8 *pUser; /* Return value */ int nReq; /* Total number of bytes requested */ assert( sizeof(rearguard)==4 ); nReq = BLOCK_HDR_SIZE + nByte + 4; pNew = (TmBlockHdr *)pTm->xMalloc(nReq); memset(pNew, 0, sizeof(TmBlockHdr)); tmEnterMutex(pTm); assert( pTm->nCountdown>=0 ); assert( pTm->bPersist==0 || pTm->bPersist==1 ); if( pTm->bEnable && pTm->nCountdown==1 ){ /* Simulate an OOM error. */ lsmtest_oom_error(); pTm->xFree(pNew); pTm->nCountdown = pTm->bPersist; if( pTm->xHook ) pTm->xHook(pTm->pHookCtx); pUser = 0; }else{ if( pTm->bEnable && pTm->nCountdown ) pTm->nCountdown--; pNew->iForeGuard = FOREGUARD; pNew->nByte = nByte; pNew->pNext = pTm->pFirst; if( pTm->pFirst ){ pTm->pFirst->pPrev = pNew; } pTm->pFirst = pNew; pUser = &((u8 *)pNew)[BLOCK_HDR_SIZE]; memset(pUser, 0x56, nByte); memcpy(&pUser[nByte], &rearguard, 4); #ifdef TM_BACKTRACE { TmAgg *pAgg; int i; u32 iHash = 0; void *aFrame[TM_BACKTRACE]; memset(aFrame, 0, sizeof(aFrame)); backtrace(aFrame, TM_BACKTRACE); for(i=0; iaHash); for(pAgg=pTm->aHash[iHash]; pAgg; pAgg=pAgg->pNext){ if( memcmp(pAgg->aFrame, aFrame, sizeof(aFrame))==0 ) break; } if( !pAgg ){ pAgg = (TmAgg *)pTm->xMalloc(sizeof(TmAgg)); memset(pAgg, 0, sizeof(TmAgg)); memcpy(pAgg->aFrame, aFrame, sizeof(aFrame)); pAgg->pNext = pTm->aHash[iHash]; pTm->aHash[iHash] = pAgg; } pAgg->nAlloc++; pAgg->nByte += nByte; pAgg->nOutAlloc++; pAgg->nOutByte += nByte; pNew->pAgg = pAgg; } #endif } tmLeaveMutex(pTm); return pUser; } static void tmFree(TmGlobal *pTm, void *p){ if( p ){ TmBlockHdr *pHdr; u8 *pUser = (u8 *)p; tmEnterMutex(pTm); pHdr = (TmBlockHdr *)(pUser - BLOCK_HDR_SIZE); assert( pHdr->iForeGuard==FOREGUARD ); assert( 0==memcmp(&pUser[pHdr->nByte], &rearguard, 4) ); if( pHdr->pPrev ){ assert( pHdr->pPrev->pNext==pHdr ); pHdr->pPrev->pNext = pHdr->pNext; }else{ assert( pHdr==pTm->pFirst ); pTm->pFirst = pHdr->pNext; } if( pHdr->pNext ){ assert( pHdr->pNext->pPrev==pHdr ); pHdr->pNext->pPrev = pHdr->pPrev; } #ifdef TM_BACKTRACE pHdr->pAgg->nOutAlloc--; pHdr->pAgg->nOutByte -= pHdr->nByte; #endif tmLeaveMutex(pTm); memset(pUser, 0x58, pHdr->nByte); memset(pHdr, 0x57, sizeof(TmBlockHdr)); pTm->xFree(pHdr); } } static void *tmRealloc(TmGlobal *pTm, void *p, int nByte){ void *pNew; pNew = tmMalloc(pTm, nByte); if( pNew && p ){ TmBlockHdr *pHdr; u8 *pUser = (u8 *)p; pHdr = (TmBlockHdr *)(pUser - BLOCK_HDR_SIZE); memcpy(pNew, p, MIN(nByte, pHdr->nByte)); tmFree(pTm, p); } return pNew; } static void tmMallocOom( TmGlobal *pTm, int nCountdown, int bPersist, void (*xHook)(void *), void *pHookCtx ){ assert( nCountdown>=0 ); assert( bPersist==0 || bPersist==1 ); pTm->nCountdown = nCountdown; pTm->bPersist = bPersist; pTm->xHook = xHook; pTm->pHookCtx = pHookCtx; pTm->bEnable = 1; } static void tmMallocOomEnable( TmGlobal *pTm, int bEnable ){ pTm->bEnable = bEnable; } static void tmMallocCheck( TmGlobal *pTm, int *pnLeakAlloc, int *pnLeakByte, FILE *pFile ){ TmBlockHdr *pHdr; int nLeak = 0; int nByte = 0; if( pTm==0 ) return; for(pHdr=pTm->pFirst; pHdr; pHdr=pHdr->pNext){ nLeak++; nByte += pHdr->nByte; } if( pnLeakAlloc ) *pnLeakAlloc = nLeak; if( pnLeakByte ) *pnLeakByte = nByte; #ifdef TM_BACKTRACE if( pFile ){ int i; fprintf(pFile, "LEAKS\n"); for(i=0; iaHash); i++){ TmAgg *pAgg; for(pAgg=pTm->aHash[i]; pAgg; pAgg=pAgg->pNext){ if( pAgg->nOutAlloc ){ int j; fprintf(pFile, "%d %d ", pAgg->nOutByte, pAgg->nOutAlloc); for(j=0; jaFrame[j]); } fprintf(pFile, "\n"); } } } fprintf(pFile, "\nALLOCATIONS\n"); for(i=0; iaHash); i++){ TmAgg *pAgg; for(pAgg=pTm->aHash[i]; pAgg; pAgg=pAgg->pNext){ int j; fprintf(pFile, "%d %d ", pAgg->nByte, pAgg->nAlloc); for(j=0; jaFrame[j]); fprintf(pFile, "\n"); } } } #else (void)pFile; #endif } #include "lsm.h" #include "stdlib.h" typedef struct LsmMutex LsmMutex; struct LsmMutex { lsm_env *pEnv; lsm_mutex *pMutex; }; static void tmLsmMutexEnter(TmGlobal *pTm){ LsmMutex *p = (LsmMutex *)pTm->pMutex; p->pEnv->xMutexEnter(p->pMutex); } static void tmLsmMutexLeave(TmGlobal *pTm){ LsmMutex *p = (LsmMutex *)(pTm->pMutex); p->pEnv->xMutexLeave(p->pMutex); } static void tmLsmMutexDel(TmGlobal *pTm){ LsmMutex *p = (LsmMutex *)pTm->pMutex; pTm->xFree(p); } static void *tmLsmMalloc(int n){ return malloc(n); } static void tmLsmFree(void *ptr){ free(ptr); } static void *tmLsmRealloc(void *ptr, int n){ return realloc(ptr, n); } static void *tmLsmEnvMalloc(lsm_env *p, size_t n){ return tmMalloc((TmGlobal *)(p->pMemCtx), n); } static void tmLsmEnvFree(lsm_env *p, void *ptr){ tmFree((TmGlobal *)(p->pMemCtx), ptr); } static void *tmLsmEnvRealloc(lsm_env *p, void *ptr, size_t n){ return tmRealloc((TmGlobal *)(p->pMemCtx), ptr, n); } void testMallocInstall(lsm_env *pEnv){ TmGlobal *pGlobal; LsmMutex *pMutex; assert( pEnv->pMemCtx==0 ); /* Allocate and populate a TmGlobal structure. */ pGlobal = (TmGlobal *)tmLsmMalloc(sizeof(TmGlobal)); memset(pGlobal, 0, sizeof(TmGlobal)); pGlobal->xMalloc = tmLsmMalloc; pGlobal->xRealloc = tmLsmRealloc; pGlobal->xFree = tmLsmFree; pMutex = (LsmMutex *)pGlobal->xMalloc(sizeof(LsmMutex)); pMutex->pEnv = pEnv; pEnv->xMutexStatic(pEnv, LSM_MUTEX_HEAP, &pMutex->pMutex); pGlobal->xEnterMutex = tmLsmMutexEnter; pGlobal->xLeaveMutex = tmLsmMutexLeave; pGlobal->xDelMutex = tmLsmMutexDel; pGlobal->pMutex = (void *)pMutex; pGlobal->xSaveMalloc = pEnv->xMalloc; pGlobal->xSaveRealloc = pEnv->xRealloc; pGlobal->xSaveFree = pEnv->xFree; /* Set up pEnv to the use the new TmGlobal */ pEnv->pMemCtx = (void *)pGlobal; pEnv->xMalloc = tmLsmEnvMalloc; pEnv->xRealloc = tmLsmEnvRealloc; pEnv->xFree = tmLsmEnvFree; } void testMallocUninstall(lsm_env *pEnv){ TmGlobal *p = (TmGlobal *)pEnv->pMemCtx; pEnv->pMemCtx = 0; if( p ){ pEnv->xMalloc = p->xSaveMalloc; pEnv->xRealloc = p->xSaveRealloc; pEnv->xFree = p->xSaveFree; p->xDelMutex(p); tmLsmFree(p); } } void testMallocCheck( lsm_env *pEnv, int *pnLeakAlloc, int *pnLeakByte, FILE *pFile ){ if( pEnv->pMemCtx==0 ){ *pnLeakAlloc = 0; *pnLeakByte = 0; }else{ tmMallocCheck((TmGlobal *)(pEnv->pMemCtx), pnLeakAlloc, pnLeakByte, pFile); } } void testMallocOom( lsm_env *pEnv, int nCountdown, int bPersist, void (*xHook)(void *), void *pHookCtx ){ TmGlobal *pTm = (TmGlobal *)(pEnv->pMemCtx); tmMallocOom(pTm, nCountdown, bPersist, xHook, pHookCtx); } void testMallocOomEnable(lsm_env *pEnv, int bEnable){ TmGlobal *pTm = (TmGlobal *)(pEnv->pMemCtx); tmMallocOomEnable(pTm, bEnable); } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest_tdb.c ================================================ /* ** This program attempts to test the correctness of some facets of the ** LSM database library. Specifically, that the contents of the database ** are maintained correctly during a series of inserts and deletes. */ #include "lsmtest_tdb.h" #include "lsm.h" #include "lsmtest.h" #include #include #include #ifndef _WIN32 # include #endif #include typedef struct SqlDb SqlDb; static int error_transaction_function(TestDb *p, int iLevel){ unused_parameter(p); unused_parameter(iLevel); return -1; } /************************************************************************* ** Begin wrapper for LevelDB. */ #ifdef HAVE_LEVELDB #include typedef struct LevelDb LevelDb; struct LevelDb { TestDb base; leveldb_t *db; leveldb_options_t *pOpt; leveldb_writeoptions_t *pWriteOpt; leveldb_readoptions_t *pReadOpt; char *pVal; }; static int test_leveldb_close(TestDb *pTestDb){ LevelDb *pDb = (LevelDb *)pTestDb; leveldb_close(pDb->db); leveldb_writeoptions_destroy(pDb->pWriteOpt); leveldb_readoptions_destroy(pDb->pReadOpt); leveldb_options_destroy(pDb->pOpt); free(pDb->pVal); free(pDb); return 0; } static int test_leveldb_write( TestDb *pTestDb, void *pKey, int nKey, void *pVal, int nVal ){ LevelDb *pDb = (LevelDb *)pTestDb; char *zErr = 0; leveldb_put(pDb->db, pDb->pWriteOpt, pKey, nKey, pVal, nVal, &zErr); return (zErr!=0); } static int test_leveldb_delete(TestDb *pTestDb, void *pKey, int nKey){ LevelDb *pDb = (LevelDb *)pTestDb; char *zErr = 0; leveldb_delete(pDb->db, pDb->pWriteOpt, pKey, nKey, &zErr); return (zErr!=0); } static int test_leveldb_fetch( TestDb *pTestDb, void *pKey, int nKey, void **ppVal, int *pnVal ){ LevelDb *pDb = (LevelDb *)pTestDb; char *zErr = 0; size_t nVal = 0; if( pKey==0 ) return 0; free(pDb->pVal); pDb->pVal = leveldb_get(pDb->db, pDb->pReadOpt, pKey, nKey, &nVal, &zErr); *ppVal = (void *)(pDb->pVal); if( pDb->pVal==0 ){ *pnVal = -1; }else{ *pnVal = (int)nVal; } return (zErr!=0); } static int test_leveldb_scan( TestDb *pTestDb, void *pCtx, int bReverse, void *pKey1, int nKey1, /* Start of search */ void *pKey2, int nKey2, /* End of search */ void (*xCallback)(void *, void *, int , void *, int) ){ LevelDb *pDb = (LevelDb *)pTestDb; leveldb_iterator_t *iter; iter = leveldb_create_iterator(pDb->db, pDb->pReadOpt); if( bReverse==0 ){ if( pKey1 ){ leveldb_iter_seek(iter, pKey1, nKey1); }else{ leveldb_iter_seek_to_first(iter); } }else{ if( pKey2 ){ leveldb_iter_seek(iter, pKey2, nKey2); if( leveldb_iter_valid(iter)==0 ){ leveldb_iter_seek_to_last(iter); }else{ const char *k; size_t n; int res; k = leveldb_iter_key(iter, &n); res = memcmp(k, pKey2, MIN(n, nKey2)); if( res==0 ) res = n - nKey2; assert( res>=0 ); if( res>0 ){ leveldb_iter_prev(iter); } } }else{ leveldb_iter_seek_to_last(iter); } } while( leveldb_iter_valid(iter) ){ const char *k; size_t n; const char *v; size_t n2; int res; k = leveldb_iter_key(iter, &n); if( bReverse==0 && pKey2 ){ res = memcmp(k, pKey2, MIN(n, nKey2)); if( res==0 ) res = n - nKey2; if( res>0 ) break; } if( bReverse!=0 && pKey1 ){ res = memcmp(k, pKey1, MIN(n, nKey1)); if( res==0 ) res = n - nKey1; if( res<0 ) break; } v = leveldb_iter_value(iter, &n2); xCallback(pCtx, (void *)k, n, (void *)v, n2); if( bReverse==0 ){ leveldb_iter_next(iter); }else{ leveldb_iter_prev(iter); } } leveldb_iter_destroy(iter); return 0; } static int test_leveldb_open( const char *zSpec, const char *zFilename, int bClear, TestDb **ppDb ){ static const DatabaseMethods LeveldbMethods = { test_leveldb_close, test_leveldb_write, test_leveldb_delete, 0, test_leveldb_fetch, test_leveldb_scan, error_transaction_function, error_transaction_function, error_transaction_function }; LevelDb *pLevelDb; char *zErr = 0; if( bClear ){ char *zCmd = sqlite3_mprintf("rm -rf %s\n", zFilename); system(zCmd); sqlite3_free(zCmd); } pLevelDb = (LevelDb *)malloc(sizeof(LevelDb)); memset(pLevelDb, 0, sizeof(LevelDb)); pLevelDb->pOpt = leveldb_options_create(); leveldb_options_set_create_if_missing(pLevelDb->pOpt, 1); pLevelDb->pWriteOpt = leveldb_writeoptions_create(); pLevelDb->pReadOpt = leveldb_readoptions_create(); pLevelDb->db = leveldb_open(pLevelDb->pOpt, zFilename, &zErr); if( zErr ){ test_leveldb_close((TestDb *)pLevelDb); *ppDb = 0; return 1; } *ppDb = (TestDb *)pLevelDb; pLevelDb->base.pMethods = &LeveldbMethods; return 0; } #endif /* HAVE_LEVELDB */ /* ** End wrapper for LevelDB. *************************************************************************/ #ifdef HAVE_KYOTOCABINET static int kc_close(TestDb *pTestDb){ return test_kc_close(pTestDb); } static int kc_write( TestDb *pTestDb, void *pKey, int nKey, void *pVal, int nVal ){ return test_kc_write(pTestDb, pKey, nKey, pVal, nVal); } static int kc_delete(TestDb *pTestDb, void *pKey, int nKey){ return test_kc_delete(pTestDb, pKey, nKey); } static int kc_delete_range( TestDb *pTestDb, void *pKey1, int nKey1, void *pKey2, int nKey2 ){ return test_kc_delete_range(pTestDb, pKey1, nKey1, pKey2, nKey2); } static int kc_fetch( TestDb *pTestDb, void *pKey, int nKey, void **ppVal, int *pnVal ){ if( pKey==0 ) return LSM_OK; return test_kc_fetch(pTestDb, pKey, nKey, ppVal, pnVal); } static int kc_scan( TestDb *pTestDb, void *pCtx, int bReverse, void *pFirst, int nFirst, void *pLast, int nLast, void (*xCallback)(void *, void *, int , void *, int) ){ return test_kc_scan( pTestDb, pCtx, bReverse, pFirst, nFirst, pLast, nLast, xCallback ); } static int kc_open( const char *zSpec, const char *zFilename, int bClear, TestDb **ppDb ){ static const DatabaseMethods KcdbMethods = { kc_close, kc_write, kc_delete, kc_delete_range, kc_fetch, kc_scan, error_transaction_function, error_transaction_function, error_transaction_function }; int rc; TestDb *pTestDb = 0; rc = test_kc_open(zFilename, bClear, &pTestDb); if( rc!=0 ){ *ppDb = 0; return rc; } pTestDb->pMethods = &KcdbMethods; *ppDb = pTestDb; return 0; } #endif /* HAVE_KYOTOCABINET */ /* ** End wrapper for Kyoto cabinet. *************************************************************************/ #ifdef HAVE_MDB static int mdb_close(TestDb *pTestDb){ return test_mdb_close(pTestDb); } static int mdb_write( TestDb *pTestDb, void *pKey, int nKey, void *pVal, int nVal ){ return test_mdb_write(pTestDb, pKey, nKey, pVal, nVal); } static int mdb_delete(TestDb *pTestDb, void *pKey, int nKey){ return test_mdb_delete(pTestDb, pKey, nKey); } static int mdb_fetch( TestDb *pTestDb, void *pKey, int nKey, void **ppVal, int *pnVal ){ if( pKey==0 ) return LSM_OK; return test_mdb_fetch(pTestDb, pKey, nKey, ppVal, pnVal); } static int mdb_scan( TestDb *pTestDb, void *pCtx, int bReverse, void *pFirst, int nFirst, void *pLast, int nLast, void (*xCallback)(void *, void *, int , void *, int) ){ return test_mdb_scan( pTestDb, pCtx, bReverse, pFirst, nFirst, pLast, nLast, xCallback ); } static int mdb_open( const char *zSpec, const char *zFilename, int bClear, TestDb **ppDb ){ static const DatabaseMethods KcdbMethods = { mdb_close, mdb_write, mdb_delete, 0, mdb_fetch, mdb_scan, error_transaction_function, error_transaction_function, error_transaction_function }; int rc; TestDb *pTestDb = 0; rc = test_mdb_open(zSpec, zFilename, bClear, &pTestDb); if( rc!=0 ){ *ppDb = 0; return rc; } pTestDb->pMethods = &KcdbMethods; *ppDb = pTestDb; return 0; } #endif /* HAVE_MDB */ /************************************************************************* ** Begin wrapper for SQLite. */ /* ** nOpenTrans: ** The number of open nested transactions, in the same sense as used ** by the tdb_begin/commit/rollback and SQLite 4 KV interfaces. If this ** value is 0, there are no transactions open at all. If it is 1, then ** there is a read transaction. If it is 2 or greater, then there are ** (nOpenTrans-1) nested write transactions open. */ struct SqlDb { TestDb base; sqlite3 *db; sqlite3_stmt *pInsert; sqlite3_stmt *pDelete; sqlite3_stmt *pDeleteRange; sqlite3_stmt *pFetch; sqlite3_stmt *apScan[8]; int nOpenTrans; /* Used by sql_fetch() to allocate space for results */ int nAlloc; u8 *aAlloc; }; static int sql_close(TestDb *pTestDb){ SqlDb *pDb = (SqlDb *)pTestDb; sqlite3_finalize(pDb->pInsert); sqlite3_finalize(pDb->pDelete); sqlite3_finalize(pDb->pDeleteRange); sqlite3_finalize(pDb->pFetch); sqlite3_finalize(pDb->apScan[0]); sqlite3_finalize(pDb->apScan[1]); sqlite3_finalize(pDb->apScan[2]); sqlite3_finalize(pDb->apScan[3]); sqlite3_finalize(pDb->apScan[4]); sqlite3_finalize(pDb->apScan[5]); sqlite3_finalize(pDb->apScan[6]); sqlite3_finalize(pDb->apScan[7]); sqlite3_close(pDb->db); free((char *)pDb->aAlloc); free((char *)pDb); return SQLITE_OK; } static int sql_write( TestDb *pTestDb, void *pKey, int nKey, void *pVal, int nVal ){ SqlDb *pDb = (SqlDb *)pTestDb; sqlite3_bind_blob(pDb->pInsert, 1, pKey, nKey, SQLITE_STATIC); sqlite3_bind_blob(pDb->pInsert, 2, pVal, nVal, SQLITE_STATIC); sqlite3_step(pDb->pInsert); return sqlite3_reset(pDb->pInsert); } static int sql_delete(TestDb *pTestDb, void *pKey, int nKey){ SqlDb *pDb = (SqlDb *)pTestDb; sqlite3_bind_blob(pDb->pDelete, 1, pKey, nKey, SQLITE_STATIC); sqlite3_step(pDb->pDelete); return sqlite3_reset(pDb->pDelete); } static int sql_delete_range( TestDb *pTestDb, void *pKey1, int nKey1, void *pKey2, int nKey2 ){ SqlDb *pDb = (SqlDb *)pTestDb; sqlite3_bind_blob(pDb->pDeleteRange, 1, pKey1, nKey1, SQLITE_STATIC); sqlite3_bind_blob(pDb->pDeleteRange, 2, pKey2, nKey2, SQLITE_STATIC); sqlite3_step(pDb->pDeleteRange); return sqlite3_reset(pDb->pDeleteRange); } static int sql_fetch( TestDb *pTestDb, void *pKey, int nKey, void **ppVal, int *pnVal ){ SqlDb *pDb = (SqlDb *)pTestDb; int rc; sqlite3_reset(pDb->pFetch); if( pKey==0 ){ assert( ppVal==0 ); assert( pnVal==0 ); return LSM_OK; } sqlite3_bind_blob(pDb->pFetch, 1, pKey, nKey, SQLITE_STATIC); rc = sqlite3_step(pDb->pFetch); if( rc==SQLITE_ROW ){ int nVal = sqlite3_column_bytes(pDb->pFetch, 0); u8 *aVal = (void *)sqlite3_column_blob(pDb->pFetch, 0); if( nVal>pDb->nAlloc ){ free(pDb->aAlloc); pDb->aAlloc = (u8 *)malloc(nVal*2); pDb->nAlloc = nVal*2; } memcpy(pDb->aAlloc, aVal, nVal); *pnVal = nVal; *ppVal = (void *)pDb->aAlloc; }else{ *pnVal = -1; *ppVal = 0; } rc = sqlite3_reset(pDb->pFetch); return rc; } static int sql_scan( TestDb *pTestDb, void *pCtx, int bReverse, void *pFirst, int nFirst, void *pLast, int nLast, void (*xCallback)(void *, void *, int , void *, int) ){ SqlDb *pDb = (SqlDb *)pTestDb; sqlite3_stmt *pScan; assert( bReverse==1 || bReverse==0 ); pScan = pDb->apScan[(pFirst==0) + (pLast==0)*2 + bReverse*4]; if( pFirst ) sqlite3_bind_blob(pScan, 1, pFirst, nFirst, SQLITE_STATIC); if( pLast ) sqlite3_bind_blob(pScan, 2, pLast, nLast, SQLITE_STATIC); while( SQLITE_ROW==sqlite3_step(pScan) ){ void *pKey; int nKey; void *pVal; int nVal; nKey = sqlite3_column_bytes(pScan, 0); pKey = (void *)sqlite3_column_blob(pScan, 0); nVal = sqlite3_column_bytes(pScan, 1); pVal = (void *)sqlite3_column_blob(pScan, 1); xCallback(pCtx, pKey, nKey, pVal, nVal); } return sqlite3_reset(pScan); } static int sql_begin(TestDb *pTestDb, int iLevel){ int i; SqlDb *pDb = (SqlDb *)pTestDb; /* iLevel==0 is a no-op */ if( iLevel==0 ) return 0; /* If there are no transactions at all open, open a read transaction. */ if( pDb->nOpenTrans==0 ){ int rc = sqlite3_exec(pDb->db, "BEGIN; SELECT * FROM sqlite_master LIMIT 1;" , 0, 0, 0 ); if( rc!=0 ) return rc; pDb->nOpenTrans = 1; } /* Open any required write transactions */ for(i=pDb->nOpenTrans; idb, zSql, 0, 0, 0); sqlite3_free(zSql); if( rc!=SQLITE_OK ) return rc; } pDb->nOpenTrans = iLevel; return 0; } static int sql_commit(TestDb *pTestDb, int iLevel){ SqlDb *pDb = (SqlDb *)pTestDb; assert( iLevel>=0 ); /* Close the read transaction if requested. */ if( pDb->nOpenTrans>=1 && iLevel==0 ){ int rc = sqlite3_exec(pDb->db, "COMMIT", 0, 0, 0); if( rc!=0 ) return rc; pDb->nOpenTrans = 0; } /* Close write transactions as required */ if( pDb->nOpenTrans>iLevel ){ char *zSql = sqlite3_mprintf("RELEASE x%d", iLevel); int rc = sqlite3_exec(pDb->db, zSql, 0, 0, 0); sqlite3_free(zSql); if( rc!=0 ) return rc; } pDb->nOpenTrans = iLevel; return 0; } static int sql_rollback(TestDb *pTestDb, int iLevel){ SqlDb *pDb = (SqlDb *)pTestDb; assert( iLevel>=0 ); if( pDb->nOpenTrans>=1 && iLevel==0 ){ /* Close the read transaction if requested. */ int rc = sqlite3_exec(pDb->db, "ROLLBACK", 0, 0, 0); if( rc!=0 ) return rc; }else if( pDb->nOpenTrans>1 && iLevel==1 ){ /* Or, rollback and close the top-level write transaction */ int rc = sqlite3_exec(pDb->db, "ROLLBACK TO x1; RELEASE x1;", 0, 0, 0); if( rc!=0 ) return rc; }else{ /* Or, just roll back some nested transactions */ char *zSql = sqlite3_mprintf("ROLLBACK TO x%d", iLevel-1); int rc = sqlite3_exec(pDb->db, zSql, 0, 0, 0); sqlite3_free(zSql); if( rc!=0 ) return rc; } pDb->nOpenTrans = iLevel; return 0; } static int sql_open( const char *zSpec, const char *zFilename, int bClear, TestDb **ppDb ){ static const DatabaseMethods SqlMethods = { sql_close, sql_write, sql_delete, sql_delete_range, sql_fetch, sql_scan, sql_begin, sql_commit, sql_rollback }; const char *zCreate = "CREATE TABLE IF NOT EXISTS t1(k PRIMARY KEY, v)"; const char *zInsert = "REPLACE INTO t1 VALUES(?, ?)"; const char *zDelete = "DELETE FROM t1 WHERE k = ?"; const char *zRange = "DELETE FROM t1 WHERE k>? AND k= ?1 ORDER BY k"; const char *zScan3 = "SELECT * FROM t1 ORDER BY k"; const char *zScan4 = "SELECT * FROM t1 WHERE k BETWEEN ?1 AND ?2 ORDER BY k DESC"; const char *zScan5 = "SELECT * FROM t1 WHERE k <= ?2 ORDER BY k DESC"; const char *zScan6 = "SELECT * FROM t1 WHERE k >= ?1 ORDER BY k DESC"; const char *zScan7 = "SELECT * FROM t1 ORDER BY k DESC"; int rc; SqlDb *pDb; char *zPragma; if( bClear && zFilename && zFilename[0] ){ unlink(zFilename); } pDb = (SqlDb *)malloc(sizeof(SqlDb)); memset(pDb, 0, sizeof(SqlDb)); pDb->base.pMethods = &SqlMethods; if( 0!=(rc = sqlite3_open(zFilename, &pDb->db)) || 0!=(rc = sqlite3_exec(pDb->db, zCreate, 0, 0, 0)) || 0!=(rc = sqlite3_prepare_v2(pDb->db, zInsert, -1, &pDb->pInsert, 0)) || 0!=(rc = sqlite3_prepare_v2(pDb->db, zDelete, -1, &pDb->pDelete, 0)) || 0!=(rc = sqlite3_prepare_v2(pDb->db, zRange, -1, &pDb->pDeleteRange, 0)) || 0!=(rc = sqlite3_prepare_v2(pDb->db, zFetch, -1, &pDb->pFetch, 0)) || 0!=(rc = sqlite3_prepare_v2(pDb->db, zScan0, -1, &pDb->apScan[0], 0)) || 0!=(rc = sqlite3_prepare_v2(pDb->db, zScan1, -1, &pDb->apScan[1], 0)) || 0!=(rc = sqlite3_prepare_v2(pDb->db, zScan2, -1, &pDb->apScan[2], 0)) || 0!=(rc = sqlite3_prepare_v2(pDb->db, zScan3, -1, &pDb->apScan[3], 0)) || 0!=(rc = sqlite3_prepare_v2(pDb->db, zScan4, -1, &pDb->apScan[4], 0)) || 0!=(rc = sqlite3_prepare_v2(pDb->db, zScan5, -1, &pDb->apScan[5], 0)) || 0!=(rc = sqlite3_prepare_v2(pDb->db, zScan6, -1, &pDb->apScan[6], 0)) || 0!=(rc = sqlite3_prepare_v2(pDb->db, zScan7, -1, &pDb->apScan[7], 0)) ){ *ppDb = 0; sql_close((TestDb *)pDb); return rc; } zPragma = sqlite3_mprintf("PRAGMA page_size=%d", TESTDB_DEFAULT_PAGE_SIZE); sqlite3_exec(pDb->db, zPragma, 0, 0, 0); sqlite3_free(zPragma); zPragma = sqlite3_mprintf("PRAGMA cache_size=%d", TESTDB_DEFAULT_CACHE_SIZE); sqlite3_exec(pDb->db, zPragma, 0, 0, 0); sqlite3_free(zPragma); /* sqlite3_exec(pDb->db, "PRAGMA locking_mode=EXCLUSIVE", 0, 0, 0); */ sqlite3_exec(pDb->db, "PRAGMA synchronous=OFF", 0, 0, 0); sqlite3_exec(pDb->db, "PRAGMA journal_mode=WAL", 0, 0, 0); sqlite3_exec(pDb->db, "PRAGMA wal_autocheckpoint=4096", 0, 0, 0); if( zSpec ){ rc = sqlite3_exec(pDb->db, zSpec, 0, 0, 0); if( rc!=SQLITE_OK ){ sql_close((TestDb *)pDb); return rc; } } *ppDb = (TestDb *)pDb; return 0; } /* ** End wrapper for SQLite. *************************************************************************/ /************************************************************************* ** Begin exported functions. */ static struct Lib { const char *zName; const char *zDefaultDb; int (*xOpen)(const char *, const char *zFilename, int bClear, TestDb **ppDb); } aLib[] = { { "sqlite3", "testdb.sqlite", sql_open }, { "lsm_small", "testdb.lsm_small", test_lsm_small_open }, { "lsm_lomem", "testdb.lsm_lomem", test_lsm_lomem_open }, #ifdef HAVE_ZLIB { "lsm_zip", "testdb.lsm_zip", test_lsm_zip_open }, #endif { "lsm", "testdb.lsm", test_lsm_open }, #ifdef LSM_MUTEX_PTHREADS { "lsm_mt2", "testdb.lsm_mt2", test_lsm_mt2 }, { "lsm_mt3", "testdb.lsm_mt3", test_lsm_mt3 }, #endif #ifdef HAVE_LEVELDB { "leveldb", "testdb.leveldb", test_leveldb_open }, #endif #ifdef HAVE_KYOTOCABINET { "kyotocabinet", "testdb.kc", kc_open }, #endif #ifdef HAVE_MDB { "mdb", "./testdb.mdb", mdb_open } #endif }; const char *tdb_system_name(int i){ if( i<0 || i>=ArraySize(aLib) ) return 0; return aLib[i].zName; } const char *tdb_default_db(const char *zSys){ int i; for(i=0; izLibrary = aLib[i].zName; } break; } } if( rc ){ /* Failed to find the requested database library. Return an error. */ *ppDb = 0; } return rc; } int tdb_close(TestDb *pDb){ if( pDb ){ return pDb->pMethods->xClose(pDb); } return 0; } int tdb_write(TestDb *pDb, void *pKey, int nKey, void *pVal, int nVal){ return pDb->pMethods->xWrite(pDb, pKey, nKey, pVal, nVal); } int tdb_delete(TestDb *pDb, void *pKey, int nKey){ return pDb->pMethods->xDelete(pDb, pKey, nKey); } int tdb_delete_range( TestDb *pDb, void *pKey1, int nKey1, void *pKey2, int nKey2 ){ return pDb->pMethods->xDeleteRange(pDb, pKey1, nKey1, pKey2, nKey2); } int tdb_fetch(TestDb *pDb, void *pKey, int nKey, void **ppVal, int *pnVal){ return pDb->pMethods->xFetch(pDb, pKey, nKey, ppVal, pnVal); } int tdb_scan( TestDb *pDb, /* Database handle */ void *pCtx, /* Context pointer to pass to xCallback */ int bReverse, /* True to scan in reverse order */ void *pKey1, int nKey1, /* Start of search */ void *pKey2, int nKey2, /* End of search */ void (*xCallback)(void *pCtx, void *pKey, int nKey, void *pVal, int nVal) ){ return pDb->pMethods->xScan( pDb, pCtx, bReverse, pKey1, nKey1, pKey2, nKey2, xCallback ); } int tdb_begin(TestDb *pDb, int iLevel){ return pDb->pMethods->xBegin(pDb, iLevel); } int tdb_commit(TestDb *pDb, int iLevel){ return pDb->pMethods->xCommit(pDb, iLevel); } int tdb_rollback(TestDb *pDb, int iLevel){ return pDb->pMethods->xRollback(pDb, iLevel); } int tdb_transaction_support(TestDb *pDb){ return (pDb->pMethods->xBegin != error_transaction_function); } const char *tdb_library_name(TestDb *pDb){ return pDb->zLibrary; } /* ** End exported functions. *************************************************************************/ ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest_tdb.h ================================================ /* ** This file is the interface to a very simple database library used for ** testing. The interface is similar to that of the LSM. The main virtue ** of this library is that the same API may be used to access a key-value ** store implemented by LSM, SQLite or another database system. Which ** makes it easy to use for correctness and performance tests. */ #ifndef __WRAPPER_H_ #define __WRAPPER_H_ #ifdef __cplusplus extern "C" { #endif #include "lsm.h" typedef struct TestDb TestDb; /* ** Open a new database connection. The first argument is the name of the ** database library to use. e.g. something like: ** ** "sqlite3" ** "lsm" ** ** See function tdb_system_name() for a list of available database systems. ** ** The second argument is the name of the database to open (e.g. a filename). ** ** If the third parameter is non-zero, then any existing database by the ** name of zDb is removed before opening a new one. If it is zero, then an ** existing database may be opened. */ int tdb_open(const char *zLibrary, const char *zDb, int bClear, TestDb **ppDb); /* ** Close a database handle. */ int tdb_close(TestDb *pDb); /* ** Write a new key/value into the database. */ int tdb_write(TestDb *pDb, void *pKey, int nKey, void *pVal, int nVal); /* ** Delete a key from the database. */ int tdb_delete(TestDb *pDb, void *pKey, int nKey); /* ** Delete a range of keys from the database. */ int tdb_delete_range(TestDb *, void *pKey1, int nKey1, void *pKey2, int nKey2); /* ** Query the database for key (pKey/nKey). If no entry is found, set *ppVal ** to 0 and *pnVal to -1 before returning. Otherwise, set *ppVal and *pnVal ** to a pointer to and size of the value associated with (pKey/nKey). */ int tdb_fetch(TestDb *pDb, void *pKey, int nKey, void **ppVal, int *pnVal); /* ** Open and close nested transactions. Currently, these functions only ** work for SQLite3 and LSM systems. Use the tdb_transaction_support() ** function to determine if a given TestDb handle supports these methods. ** ** These functions and the iLevel parameter follow the same conventions as ** the SQLite 4 transaction interface. Note that this is slightly different ** from the way LSM does things. As follows: ** ** tdb_begin(): ** A successful call to tdb_begin() with (iLevel>1) guarantees that ** there are at least (iLevel-1) write transactions open. If iLevel==1, ** then it guarantees that at least a read-transaction is open. Calling ** tdb_begin() with iLevel==0 is a no-op. ** ** tdb_commit(): ** A successful call to tdb_commit() with (iLevel>1) guarantees that ** there are at most (iLevel-1) write transactions open. If iLevel==1, ** then it guarantees that there are no write transactions open (although ** a read-transaction may remain open). Calling tdb_commit() with ** iLevel==0 ensures that all transactions, read or write, have been ** closed and committed. ** ** tdb_rollback(): ** This call is similar to tdb_commit(), except that instead of committing ** transactions, it reverts them. For example, calling tdb_rollback() with ** iLevel==2 ensures that there is at most one write transaction open, and ** restores the database to the state that it was in when that transaction ** was opened. ** ** In other words, tdb_commit() just closes transactions - tdb_rollback() ** closes transactions and then restores the database to the state it ** was in before those transactions were even opened. */ int tdb_begin(TestDb *pDb, int iLevel); int tdb_commit(TestDb *pDb, int iLevel); int tdb_rollback(TestDb *pDb, int iLevel); /* ** Return true if transactions are supported, or false otherwise. */ int tdb_transaction_support(TestDb *pDb); /* ** Return the name of the database library (as passed to tdb_open()) used ** by the handled passed as the first argument. */ const char *tdb_library_name(TestDb *pDb); /* ** Scan a range of database keys. Invoke the callback function for each ** key visited. */ int tdb_scan( TestDb *pDb, /* Database handle */ void *pCtx, /* Context pointer to pass to xCallback */ int bReverse, /* True to scan in reverse order */ void *pKey1, int nKey1, /* Start of search */ void *pKey2, int nKey2, /* End of search */ void (*xCallback)(void *pCtx, void *pKey, int nKey, void *pVal, int nVal) ); const char *tdb_system_name(int i); const char *tdb_default_db(const char *zSys); int tdb_lsm_open(const char *zCfg, const char *zDb, int bClear, TestDb **ppDb); /* ** If the TestDb handle passed as an argument is a wrapper around an LSM ** database, return the LSM handle. Otherwise, if the argument is some other ** database system, return NULL. */ lsm_db *tdb_lsm(TestDb *pDb); /* ** Return true if the db passed as an argument is a multi-threaded LSM ** connection. */ int tdb_lsm_multithread(TestDb *pDb); /* ** Return a pointer to the lsm_env object used by all lsm database ** connections initialized as a copy of the object returned by ** lsm_default_env(). It may be modified (e.g. to override functions) ** if the caller can guarantee that it is not already in use. */ lsm_env *tdb_lsm_env(void); /* ** The following functions only work with LSM database handles. It is ** illegal to call them with any other type of database handle specified ** as an argument. */ void tdb_lsm_enable_log(TestDb *pDb, int bEnable); void tdb_lsm_application_crash(TestDb *pDb); void tdb_lsm_prepare_system_crash(TestDb *pDb); void tdb_lsm_system_crash(TestDb *pDb); void tdb_lsm_prepare_sync_crash(TestDb *pDb, int iSync); void tdb_lsm_safety(TestDb *pDb, int eMode); void tdb_lsm_config_work_hook(TestDb *pDb, void (*)(lsm_db *, void *), void *); void tdb_lsm_write_hook(TestDb *, void(*)(void*,int,lsm_i64,int,int), void*); int tdb_lsm_config_str(TestDb *pDb, const char *zStr); #ifdef __cplusplus } /* End of the 'extern "C"' block */ #endif #endif ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest_tdb2.cc ================================================ #include "lsmtest.h" #include #ifdef HAVE_KYOTOCABINET #include "kcpolydb.h" extern "C" { struct KcDb { TestDb base; kyotocabinet::TreeDB* db; char *pVal; }; } int test_kc_open(const char *zFilename, int bClear, TestDb **ppDb){ KcDb *pKcDb; int ok; int rc = 0; if( bClear ){ char *zCmd = sqlite3_mprintf("rm -rf %s\n", zFilename); system(zCmd); sqlite3_free(zCmd); } pKcDb = (KcDb *)malloc(sizeof(KcDb)); memset(pKcDb, 0, sizeof(KcDb)); pKcDb->db = new kyotocabinet::TreeDB(); pKcDb->db->tune_page(TESTDB_DEFAULT_PAGE_SIZE); pKcDb->db->tune_page_cache( TESTDB_DEFAULT_PAGE_SIZE * TESTDB_DEFAULT_CACHE_SIZE ); ok = pKcDb->db->open(zFilename, kyotocabinet::PolyDB::OWRITER | kyotocabinet::PolyDB::OCREATE ); if( ok==0 ){ free(pKcDb); pKcDb = 0; rc = 1; } *ppDb = (TestDb *)pKcDb; return rc; } int test_kc_close(TestDb *pDb){ KcDb *pKcDb = (KcDb *)pDb; if( pKcDb->pVal ){ delete [] pKcDb->pVal; } pKcDb->db->close(); delete pKcDb->db; free(pKcDb); return 0; } int test_kc_write(TestDb *pDb, void *pKey, int nKey, void *pVal, int nVal){ KcDb *pKcDb = (KcDb *)pDb; int ok; ok = pKcDb->db->set((const char *)pKey, nKey, (const char *)pVal, nVal); return (ok ? 0 : 1); } int test_kc_delete(TestDb *pDb, void *pKey, int nKey){ KcDb *pKcDb = (KcDb *)pDb; int ok; ok = pKcDb->db->remove((const char *)pKey, nKey); return (ok ? 0 : 1); } int test_kc_delete_range( TestDb *pDb, void *pKey1, int nKey1, void *pKey2, int nKey2 ){ int res; KcDb *pKcDb = (KcDb *)pDb; kyotocabinet::DB::Cursor* pCur = pKcDb->db->cursor(); if( pKey1 ){ res = pCur->jump((const char *)pKey1, nKey1); }else{ res = pCur->jump(); } while( 1 ){ const char *pKey; size_t nKey; const char *pVal; size_t nVal; pKey = pCur->get(&nKey, &pVal, &nVal); if( pKey==0 ) break; #ifndef NDEBUG if( pKey1 ){ res = memcmp(pKey, pKey1, MIN((size_t)nKey1, nKey)); assert( res>0 || (res==0 && nKey>nKey1) ); } #endif if( pKey2 ){ res = memcmp(pKey, pKey2, MIN((size_t)nKey2, nKey)); if( res>0 || (res==0 && (size_t)nKey2remove(); delete [] pKey; } delete pCur; return 0; } int test_kc_fetch( TestDb *pDb, void *pKey, int nKey, void **ppVal, int *pnVal ){ KcDb *pKcDb = (KcDb *)pDb; size_t nVal; if( pKcDb->pVal ){ delete [] pKcDb->pVal; pKcDb->pVal = 0; } pKcDb->pVal = pKcDb->db->get((const char *)pKey, nKey, &nVal); if( pKcDb->pVal ){ *ppVal = pKcDb->pVal; *pnVal = nVal; }else{ *ppVal = 0; *pnVal = -1; } return 0; } int test_kc_scan( TestDb *pDb, /* Database handle */ void *pCtx, /* Context pointer to pass to xCallback */ int bReverse, /* True for a reverse order scan */ void *pKey1, int nKey1, /* Start of search */ void *pKey2, int nKey2, /* End of search */ void (*xCallback)(void *pCtx, void *pKey, int nKey, void *pVal, int nVal) ){ KcDb *pKcDb = (KcDb *)pDb; kyotocabinet::DB::Cursor* pCur = pKcDb->db->cursor(); int res; if( bReverse==0 ){ if( pKey1 ){ res = pCur->jump((const char *)pKey1, nKey1); }else{ res = pCur->jump(); } }else{ if( pKey2 ){ res = pCur->jump_back((const char *)pKey2, nKey2); }else{ res = pCur->jump_back(); } } while( res ){ const char *pKey; size_t nKey; const char *pVal; size_t nVal; pKey = pCur->get(&nKey, &pVal, &nVal); if( bReverse==0 && pKey2 ){ res = memcmp(pKey, pKey2, MIN((size_t)nKey2, nKey)); if( res>0 || (res==0 && (size_t)nKey2nKey) ){ delete [] pKey; break; } } xCallback(pCtx, (void *)pKey, (int)nKey, (void *)pVal, (int)nVal); delete [] pKey; if( bReverse ){ res = pCur->step_back(); }else{ res = pCur->step(); } } delete pCur; return 0; } #endif /* HAVE_KYOTOCABINET */ #ifdef HAVE_MDB #include "lmdb.h" extern "C" { struct MdbDb { TestDb base; MDB_env *env; MDB_dbi dbi; }; } int test_mdb_open( const char *zSpec, const char *zFilename, int bClear, TestDb **ppDb ){ MDB_txn *txn; MdbDb *pMdb; int rc; if( bClear ){ char *zCmd = sqlite3_mprintf("rm -rf %s\n", zFilename); system(zCmd); sqlite3_free(zCmd); } pMdb = (MdbDb *)malloc(sizeof(MdbDb)); memset(pMdb, 0, sizeof(MdbDb)); rc = mdb_env_create(&pMdb->env); if( rc==0 ) rc = mdb_env_set_mapsize(pMdb->env, 1*1024*1024*1024); if( rc==0 ) rc = mdb_env_open(pMdb->env, zFilename, MDB_NOSYNC|MDB_NOSUBDIR, 0600); if( rc==0 ) rc = mdb_txn_begin(pMdb->env, NULL, 0, &txn); if( rc==0 ){ rc = mdb_open(txn, NULL, 0, &pMdb->dbi); mdb_txn_commit(txn); } *ppDb = (TestDb *)pMdb; return rc; } int test_mdb_close(TestDb *pDb){ MdbDb *pMdb = (MdbDb *)pDb; mdb_close(pMdb->env, pMdb->dbi); mdb_env_close(pMdb->env); free(pMdb); return 0; } int test_mdb_write(TestDb *pDb, void *pKey, int nKey, void *pVal, int nVal){ int rc; MdbDb *pMdb = (MdbDb *)pDb; MDB_val val; MDB_val key; MDB_txn *txn; val.mv_size = nVal; val.mv_data = pVal; key.mv_size = nKey; key.mv_data = pKey; rc = mdb_txn_begin(pMdb->env, NULL, 0, &txn); if( rc==0 ){ rc = mdb_put(txn, pMdb->dbi, &key, &val, 0); if( rc==0 ){ rc = mdb_txn_commit(txn); }else{ mdb_txn_abort(txn); } } return rc; } int test_mdb_delete(TestDb *pDb, void *pKey, int nKey){ int rc; MdbDb *pMdb = (MdbDb *)pDb; MDB_val key; MDB_txn *txn; key.mv_size = nKey; key.mv_data = pKey; rc = mdb_txn_begin(pMdb->env, NULL, 0, &txn); if( rc==0 ){ rc = mdb_del(txn, pMdb->dbi, &key, 0); if( rc==0 ){ rc = mdb_txn_commit(txn); }else{ mdb_txn_abort(txn); } } return rc; } int test_mdb_fetch( TestDb *pDb, void *pKey, int nKey, void **ppVal, int *pnVal ){ int rc; MdbDb *pMdb = (MdbDb *)pDb; MDB_val key; MDB_txn *txn; key.mv_size = nKey; key.mv_data = pKey; rc = mdb_txn_begin(pMdb->env, NULL, MDB_RDONLY, &txn); if( rc==0 ){ MDB_val val = {0, 0}; rc = mdb_get(txn, pMdb->dbi, &key, &val); if( rc==MDB_NOTFOUND ){ rc = 0; *ppVal = 0; *pnVal = -1; }else{ *ppVal = val.mv_data; *pnVal = val.mv_size; } mdb_txn_commit(txn); } return rc; } int test_mdb_scan( TestDb *pDb, /* Database handle */ void *pCtx, /* Context pointer to pass to xCallback */ int bReverse, /* True for a reverse order scan */ void *pKey1, int nKey1, /* Start of search */ void *pKey2, int nKey2, /* End of search */ void (*xCallback)(void *pCtx, void *pKey, int nKey, void *pVal, int nVal) ){ MdbDb *pMdb = (MdbDb *)pDb; int rc; MDB_cursor_op op = bReverse ? MDB_PREV : MDB_NEXT; MDB_txn *txn; rc = mdb_txn_begin(pMdb->env, NULL, MDB_RDONLY, &txn); if( rc==0 ){ MDB_cursor *csr; MDB_val key = {0, 0}; MDB_val val = {0, 0}; rc = mdb_cursor_open(txn, pMdb->dbi, &csr); if( rc==0 ){ while( mdb_cursor_get(csr, &key, &val, op)==0 ){ xCallback(pCtx, key.mv_data, key.mv_size, val.mv_data, val.mv_size); } mdb_cursor_close(csr); } } return rc; } #endif /* HAVE_MDB */ ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest_tdb3.c ================================================ #include "lsmtest_tdb.h" #include "lsm.h" #include "lsmtest.h" #include #include #include #ifndef _WIN32 # include #endif #include #ifndef _WIN32 # include #endif typedef struct LsmDb LsmDb; typedef struct LsmWorker LsmWorker; typedef struct LsmFile LsmFile; #define LSMTEST_DFLT_MT_MAX_CKPT (8*1024) #define LSMTEST_DFLT_MT_MIN_CKPT (2*1024) #ifdef LSM_MUTEX_PTHREADS #include #define LSMTEST_THREAD_CKPT 1 #define LSMTEST_THREAD_WORKER 2 #define LSMTEST_THREAD_WORKER_AC 3 /* ** There are several different types of worker threads that run in different ** test configurations, depending on the value of LsmWorker.eType. ** ** 1. Checkpointer. ** 2. Worker with auto-checkpoint. ** 3. Worker without auto-checkpoint. */ struct LsmWorker { LsmDb *pDb; /* Main database structure */ lsm_db *pWorker; /* Worker database handle */ pthread_t worker_thread; /* Worker thread */ pthread_cond_t worker_cond; /* Condition var the worker waits on */ pthread_mutex_t worker_mutex; /* Mutex used with worker_cond */ int bDoWork; /* Set to true by client when there is work */ int worker_rc; /* Store error code here */ int eType; /* LSMTEST_THREAD_XXX constant */ int bBlock; }; #else struct LsmWorker { int worker_rc; int bBlock; }; #endif static void mt_shutdown(LsmDb *); lsm_env *tdb_lsm_env(void){ static int bInit = 0; static lsm_env env; if( bInit==0 ){ memcpy(&env, lsm_default_env(), sizeof(env)); bInit = 1; } return &env; } typedef struct FileSector FileSector; typedef struct FileData FileData; struct FileSector { u8 *aOld; /* Old data for this sector */ }; struct FileData { int nSector; /* Allocated size of apSector[] array */ FileSector *aSector; /* Array of file sectors */ }; /* ** bPrepareCrash: ** If non-zero, the file wrappers maintain enough in-memory data to ** simulate the effect of a power-failure on the file-system (i.e. that ** unsynced sectors may be written, not written, or overwritten with ** arbitrary data when the crash occurs). ** ** bCrashed: ** Set to true after a crash is simulated. Once this variable is true, all ** VFS methods other than xClose() return LSM_IOERR as soon as they are ** called (without affecting the contents of the file-system). ** ** env: ** The environment object used by all lsm_db* handles opened by this ** object (i.e. LsmDb.db plus any worker connections). Variable env.pVfsCtx ** always points to the containing LsmDb structure. */ struct LsmDb { TestDb base; /* Base class - methods table */ lsm_env env; /* Environment used by connection db */ char *zName; /* Database file name */ lsm_db *db; /* LSM database handle */ lsm_cursor *pCsr; /* Cursor held open during read transaction */ void *pBuf; /* Buffer for tdb_fetch() output */ int nBuf; /* Allocated (not used) size of pBuf */ /* Crash testing related state */ int bCrashed; /* True once a crash has occurred */ int nAutoCrash; /* Number of syncs until a crash */ int bPrepareCrash; /* True to store writes in memory */ /* Unsynced data (while crash testing) */ int szSector; /* Assumed size of disk sectors (512B) */ FileData aFile[2]; /* Database and log file data */ /* Other test instrumentation */ int bNoRecovery; /* If true, assume DMS2 is locked */ /* Work hook redirection */ void (*xWork)(lsm_db *, void *); void *pWorkCtx; /* IO logging hook */ void (*xWriteHook)(void *, int, lsm_i64, int, int); void *pWriteCtx; /* Worker threads (for lsm_mt) */ int nMtMinCkpt; int nMtMaxCkpt; int eMode; int nWorker; LsmWorker *aWorker; }; #define LSMTEST_MODE_SINGLETHREAD 1 #define LSMTEST_MODE_BACKGROUND_CKPT 2 #define LSMTEST_MODE_BACKGROUND_WORK 3 #define LSMTEST_MODE_BACKGROUND_BOTH 4 /************************************************************************* ************************************************************************** ** Begin test VFS code. */ struct LsmFile { lsm_file *pReal; /* Real underlying file */ int bLog; /* True for log file. False for db file */ LsmDb *pDb; /* Database handle that uses this file */ }; static int testEnvFullpath( lsm_env *pEnv, /* Environment for current LsmDb */ const char *zFile, /* Relative path name */ char *zOut, /* Output buffer */ int *pnOut /* IN/OUT: Size of output buffer */ ){ lsm_env *pRealEnv = tdb_lsm_env(); return pRealEnv->xFullpath(pRealEnv, zFile, zOut, pnOut); } static int testEnvOpen( lsm_env *pEnv, /* Environment for current LsmDb */ const char *zFile, /* Name of file to open */ int flags, lsm_file **ppFile /* OUT: New file handle object */ ){ lsm_env *pRealEnv = tdb_lsm_env(); LsmDb *pDb = (LsmDb *)pEnv->pVfsCtx; int rc; /* Return Code */ LsmFile *pRet; /* The new file handle */ int nFile; /* Length of string zFile in bytes */ nFile = strlen(zFile); pRet = (LsmFile *)testMalloc(sizeof(LsmFile)); pRet->pDb = pDb; pRet->bLog = (nFile > 4 && 0==memcmp("-log", &zFile[nFile-4], 4)); rc = pRealEnv->xOpen(pRealEnv, zFile, flags, &pRet->pReal); if( rc!=LSM_OK ){ testFree(pRet); pRet = 0; } *ppFile = (lsm_file *)pRet; return rc; } static int testEnvRead(lsm_file *pFile, lsm_i64 iOff, void *pData, int nData){ lsm_env *pRealEnv = tdb_lsm_env(); LsmFile *p = (LsmFile *)pFile; if( p->pDb->bCrashed ) return LSM_IOERR; return pRealEnv->xRead(p->pReal, iOff, pData, nData); } static int testEnvWrite(lsm_file *pFile, lsm_i64 iOff, void *pData, int nData){ lsm_env *pRealEnv = tdb_lsm_env(); LsmFile *p = (LsmFile *)pFile; LsmDb *pDb = p->pDb; if( pDb->bCrashed ) return LSM_IOERR; if( pDb->bPrepareCrash ){ FileData *pData2 = &pDb->aFile[p->bLog]; int iFirst; int iLast; int iSector; iFirst = (int)(iOff / pDb->szSector); iLast = (int)((iOff + nData - 1) / pDb->szSector); if( pData2->nSector<(iLast+1) ){ int nNew = ( ((iLast + 1) + 63) / 64 ) * 64; assert( nNew>iLast ); pData2->aSector = (FileSector *)testRealloc( pData2->aSector, nNew*sizeof(FileSector) ); memset(&pData2->aSector[pData2->nSector], 0, (nNew - pData2->nSector) * sizeof(FileSector) ); pData2->nSector = nNew; } for(iSector=iFirst; iSector<=iLast; iSector++){ if( pData2->aSector[iSector].aOld==0 ){ u8 *aOld = (u8 *)testMalloc(pDb->szSector); pRealEnv->xRead( p->pReal, (lsm_i64)iSector*pDb->szSector, aOld, pDb->szSector ); pData2->aSector[iSector].aOld = aOld; } } } if( pDb->xWriteHook ){ int rc; int nUs; struct timeval t1; struct timeval t2; gettimeofday(&t1, 0); assert( nData>0 ); rc = pRealEnv->xWrite(p->pReal, iOff, pData, nData); gettimeofday(&t2, 0); nUs = (t2.tv_sec - t1.tv_sec) * 1000000 + (t2.tv_usec - t1.tv_usec); pDb->xWriteHook(pDb->pWriteCtx, p->bLog, iOff, nData, nUs); return rc; } return pRealEnv->xWrite(p->pReal, iOff, pData, nData); } static void doSystemCrash(LsmDb *pDb); static int testEnvSync(lsm_file *pFile){ lsm_env *pRealEnv = tdb_lsm_env(); LsmFile *p = (LsmFile *)pFile; LsmDb *pDb = p->pDb; FileData *pData = &pDb->aFile[p->bLog]; int i; if( pDb->bCrashed ) return LSM_IOERR; if( pDb->nAutoCrash ){ pDb->nAutoCrash--; if( pDb->nAutoCrash==0 ){ doSystemCrash(pDb); pDb->bCrashed = 1; return LSM_IOERR; } } if( pDb->bPrepareCrash ){ for(i=0; inSector; i++){ testFree(pData->aSector[i].aOld); pData->aSector[i].aOld = 0; } } if( pDb->xWriteHook ){ int rc; int nUs; struct timeval t1; struct timeval t2; gettimeofday(&t1, 0); rc = pRealEnv->xSync(p->pReal); gettimeofday(&t2, 0); nUs = (t2.tv_sec - t1.tv_sec) * 1000000 + (t2.tv_usec - t1.tv_usec); pDb->xWriteHook(pDb->pWriteCtx, p->bLog, 0, 0, nUs); return rc; } return pRealEnv->xSync(p->pReal); } static int testEnvTruncate(lsm_file *pFile, lsm_i64 iOff){ lsm_env *pRealEnv = tdb_lsm_env(); LsmFile *p = (LsmFile *)pFile; if( p->pDb->bCrashed ) return LSM_IOERR; return pRealEnv->xTruncate(p->pReal, iOff); } static int testEnvSectorSize(lsm_file *pFile){ lsm_env *pRealEnv = tdb_lsm_env(); LsmFile *p = (LsmFile *)pFile; return pRealEnv->xSectorSize(p->pReal); } static int testEnvRemap( lsm_file *pFile, lsm_i64 iMin, void **ppOut, lsm_i64 *pnOut ){ lsm_env *pRealEnv = tdb_lsm_env(); LsmFile *p = (LsmFile *)pFile; return pRealEnv->xRemap(p->pReal, iMin, ppOut, pnOut); } static int testEnvFileid( lsm_file *pFile, void *ppOut, int *pnOut ){ lsm_env *pRealEnv = tdb_lsm_env(); LsmFile *p = (LsmFile *)pFile; return pRealEnv->xFileid(p->pReal, ppOut, pnOut); } static int testEnvClose(lsm_file *pFile){ lsm_env *pRealEnv = tdb_lsm_env(); LsmFile *p = (LsmFile *)pFile; pRealEnv->xClose(p->pReal); testFree(p); return LSM_OK; } static int testEnvUnlink(lsm_env *pEnv, const char *zFile){ lsm_env *pRealEnv = tdb_lsm_env(); unused_parameter(pEnv); return pRealEnv->xUnlink(pRealEnv, zFile); } static int testEnvLock(lsm_file *pFile, int iLock, int eType){ LsmFile *p = (LsmFile *)pFile; lsm_env *pRealEnv = tdb_lsm_env(); if( iLock==2 && eType==LSM_LOCK_EXCL && p->pDb->bNoRecovery ){ return LSM_BUSY; } return pRealEnv->xLock(p->pReal, iLock, eType); } static int testEnvTestLock(lsm_file *pFile, int iLock, int nLock, int eType){ LsmFile *p = (LsmFile *)pFile; lsm_env *pRealEnv = tdb_lsm_env(); if( iLock==2 && eType==LSM_LOCK_EXCL && p->pDb->bNoRecovery ){ return LSM_BUSY; } return pRealEnv->xTestLock(p->pReal, iLock, nLock, eType); } static int testEnvShmMap(lsm_file *pFile, int iRegion, int sz, void **pp){ LsmFile *p = (LsmFile *)pFile; lsm_env *pRealEnv = tdb_lsm_env(); return pRealEnv->xShmMap(p->pReal, iRegion, sz, pp); } static void testEnvShmBarrier(void){ } static int testEnvShmUnmap(lsm_file *pFile, int bDel){ LsmFile *p = (LsmFile *)pFile; lsm_env *pRealEnv = tdb_lsm_env(); return pRealEnv->xShmUnmap(p->pReal, bDel); } static int testEnvSleep(lsm_env *pEnv, int us){ lsm_env *pRealEnv = tdb_lsm_env(); return pRealEnv->xSleep(pRealEnv, us); } static void doSystemCrash(LsmDb *pDb){ lsm_env *pEnv = tdb_lsm_env(); int iFile; int iSeed = pDb->aFile[0].nSector + pDb->aFile[1].nSector; char *zFile = pDb->zName; char *zFree = 0; for(iFile=0; iFile<2; iFile++){ lsm_file *pFile = 0; int i; pEnv->xOpen(pEnv, zFile, 0, &pFile); for(i=0; iaFile[iFile].nSector; i++){ u8 *aOld = pDb->aFile[iFile].aSector[i].aOld; if( aOld ){ int iOpt = testPrngValue(iSeed++) % 3; switch( iOpt ){ case 0: break; case 1: testPrngArray(iSeed++, (u32 *)aOld, pDb->szSector/4); /* Fall-through */ case 2: pEnv->xWrite( pFile, (lsm_i64)i * pDb->szSector, aOld, pDb->szSector ); break; } testFree(aOld); pDb->aFile[iFile].aSector[i].aOld = 0; } } pEnv->xClose(pFile); zFree = zFile = sqlite3_mprintf("%s-log", pDb->zName); } sqlite3_free(zFree); } /* ** End test VFS code. ************************************************************************** *************************************************************************/ /************************************************************************* ************************************************************************** ** Begin test compression hooks. */ #ifdef HAVE_ZLIB #include static int testZipBound(void *pCtx, int nSrc){ return compressBound(nSrc); } static int testZipCompress( void *pCtx, /* Context pointer */ char *aOut, int *pnOut, /* OUT: Buffer containing compressed data */ const char *aIn, int nIn /* Buffer containing input data */ ){ uLongf n = *pnOut; /* In/out buffer size for compress() */ int rc; /* compress() return code */ rc = compress((Bytef*)aOut, &n, (Bytef*)aIn, nIn); *pnOut = n; return (rc==Z_OK ? 0 : LSM_ERROR); } static int testZipUncompress( void *pCtx, /* Context pointer */ char *aOut, int *pnOut, /* OUT: Buffer containing uncompressed data */ const char *aIn, int nIn /* Buffer containing input data */ ){ uLongf n = *pnOut; /* In/out buffer size for uncompress() */ int rc; /* uncompress() return code */ rc = uncompress((Bytef*)aOut, &n, (Bytef*)aIn, nIn); *pnOut = n; return (rc==Z_OK ? 0 : LSM_ERROR); } static int testConfigureCompression(lsm_db *pDb){ static lsm_compress zip = { 0, /* Context pointer (unused) */ 1, /* Id value */ testZipBound, /* xBound method */ testZipCompress, /* xCompress method */ testZipUncompress /* xUncompress method */ }; return lsm_config(pDb, LSM_CONFIG_SET_COMPRESSION, &zip); } #endif /* ifdef HAVE_ZLIB */ /* ** End test compression hooks. ************************************************************************** *************************************************************************/ static int test_lsm_close(TestDb *pTestDb){ int i; int rc = LSM_OK; LsmDb *pDb = (LsmDb *)pTestDb; lsm_csr_close(pDb->pCsr); lsm_close(pDb->db); /* If this is a multi-threaded database, wait on the worker threads. */ mt_shutdown(pDb); for(i=0; inWorker && rc==LSM_OK; i++){ rc = pDb->aWorker[i].worker_rc; } for(i=0; iaFile[0].nSector; i++){ testFree(pDb->aFile[0].aSector[i].aOld); } testFree(pDb->aFile[0].aSector); for(i=0; iaFile[1].nSector; i++){ testFree(pDb->aFile[1].aSector[i].aOld); } testFree(pDb->aFile[1].aSector); memset(pDb, sizeof(LsmDb), 0x11); testFree((char *)pDb->pBuf); testFree((char *)pDb); return rc; } static void mt_signal_worker(LsmDb*, int); static int waitOnCheckpointer(LsmDb *pDb, lsm_db *db){ int nSleep = 0; int nKB; int rc; do { nKB = 0; rc = lsm_info(db, LSM_INFO_CHECKPOINT_SIZE, &nKB); if( rc!=LSM_OK || nKBnMtMaxCkpt ) break; #ifdef LSM_MUTEX_PTHREADS mt_signal_worker(pDb, (pDb->eMode==LSMTEST_MODE_BACKGROUND_CKPT ? 0 : 1) ); #endif usleep(5000); nSleep += 5; }while( 1 ); #if 0 if( nSleep ) printf("# waitOnCheckpointer(): nSleep=%d\n", nSleep); #endif return rc; } static int waitOnWorker(LsmDb *pDb){ int rc; int nLimit = -1; int nSleep = 0; rc = lsm_config(pDb->db, LSM_CONFIG_AUTOFLUSH, &nLimit); do { int nOld, nNew, rc2; rc2 = lsm_info(pDb->db, LSM_INFO_TREE_SIZE, &nOld, &nNew); if( rc2!=LSM_OK ) return rc2; if( nOld==0 || nNew<(nLimit/2) ) break; #ifdef LSM_MUTEX_PTHREADS mt_signal_worker(pDb, 0); #endif usleep(5000); nSleep += 5; }while( 1 ); #if 0 if( nSleep ) printf("# waitOnWorker(): nSleep=%d\n", nSleep); #endif return rc; } static int test_lsm_write( TestDb *pTestDb, void *pKey, int nKey, void *pVal, int nVal ){ LsmDb *pDb = (LsmDb *)pTestDb; int rc = LSM_OK; if( pDb->eMode==LSMTEST_MODE_BACKGROUND_CKPT ){ rc = waitOnCheckpointer(pDb, pDb->db); }else if( pDb->eMode==LSMTEST_MODE_BACKGROUND_WORK || pDb->eMode==LSMTEST_MODE_BACKGROUND_BOTH ){ rc = waitOnWorker(pDb); } if( rc==LSM_OK ){ rc = lsm_insert(pDb->db, pKey, nKey, pVal, nVal); } return rc; } static int test_lsm_delete(TestDb *pTestDb, void *pKey, int nKey){ LsmDb *pDb = (LsmDb *)pTestDb; return lsm_delete(pDb->db, pKey, nKey); } static int test_lsm_delete_range( TestDb *pTestDb, void *pKey1, int nKey1, void *pKey2, int nKey2 ){ LsmDb *pDb = (LsmDb *)pTestDb; return lsm_delete_range(pDb->db, pKey1, nKey1, pKey2, nKey2); } static int test_lsm_fetch( TestDb *pTestDb, void *pKey, int nKey, void **ppVal, int *pnVal ){ int rc; LsmDb *pDb = (LsmDb *)pTestDb; lsm_cursor *csr; if( pKey==0 ) return LSM_OK; rc = lsm_csr_open(pDb->db, &csr); if( rc!=LSM_OK ) return rc; rc = lsm_csr_seek(csr, pKey, nKey, LSM_SEEK_EQ); if( rc==LSM_OK ){ if( lsm_csr_valid(csr) ){ const void *pVal; int nVal; rc = lsm_csr_value(csr, &pVal, &nVal); if( nVal>pDb->nBuf ){ testFree(pDb->pBuf); pDb->pBuf = testMalloc(nVal*2); pDb->nBuf = nVal*2; } memcpy(pDb->pBuf, pVal, nVal); *ppVal = pDb->pBuf; *pnVal = nVal; }else{ *ppVal = 0; *pnVal = -1; } } lsm_csr_close(csr); return rc; } static int test_lsm_scan( TestDb *pTestDb, void *pCtx, int bReverse, void *pFirst, int nFirst, void *pLast, int nLast, void (*xCallback)(void *, void *, int , void *, int) ){ LsmDb *pDb = (LsmDb *)pTestDb; lsm_cursor *csr; int rc; rc = lsm_csr_open(pDb->db, &csr); if( rc!=LSM_OK ) return rc; if( bReverse ){ if( pLast ){ rc = lsm_csr_seek(csr, pLast, nLast, LSM_SEEK_LE); }else{ rc = lsm_csr_last(csr); } }else{ if( pFirst ){ rc = lsm_csr_seek(csr, pFirst, nFirst, LSM_SEEK_GE); }else{ rc = lsm_csr_first(csr); } } while( rc==LSM_OK && lsm_csr_valid(csr) ){ const void *pKey; int nKey; const void *pVal; int nVal; int cmp; lsm_csr_key(csr, &pKey, &nKey); lsm_csr_value(csr, &pVal, &nVal); if( bReverse && pFirst ){ cmp = memcmp(pFirst, pKey, MIN(nKey, nFirst)); if( cmp>0 || (cmp==0 && nFirst>nKey) ) break; }else if( bReverse==0 && pLast ){ cmp = memcmp(pLast, pKey, MIN(nKey, nLast)); if( cmp<0 || (cmp==0 && nLastpCsr==0 ) rc = lsm_csr_open(pDb->db, &pDb->pCsr); if( rc==LSM_OK && iLevel>1 ){ rc = lsm_begin(pDb->db, iLevel-1); } return rc; } static int test_lsm_commit(TestDb *pTestDb, int iLevel){ LsmDb *pDb = (LsmDb *)pTestDb; /* If iLevel==0, close any open read transaction */ if( iLevel==0 && pDb->pCsr ){ lsm_csr_close(pDb->pCsr); pDb->pCsr = 0; } /* If iLevel==0, close any open read transaction */ return lsm_commit(pDb->db, MAX(0, iLevel-1)); } static int test_lsm_rollback(TestDb *pTestDb, int iLevel){ LsmDb *pDb = (LsmDb *)pTestDb; /* If iLevel==0, close any open read transaction */ if( iLevel==0 && pDb->pCsr ){ lsm_csr_close(pDb->pCsr); pDb->pCsr = 0; } return lsm_rollback(pDb->db, MAX(0, iLevel-1)); } /* ** A log message callback registered with lsm connections. Prints all ** messages to stderr. */ static void xLog(void *pCtx, int rc, const char *z){ unused_parameter(rc); /* fprintf(stderr, "lsm: rc=%d \"%s\"\n", rc, z); */ if( pCtx ) fprintf(stderr, "%s: ", (char *)pCtx); fprintf(stderr, "%s\n", z); fflush(stderr); } static void xWorkHook(lsm_db *db, void *pArg){ LsmDb *p = (LsmDb *)pArg; if( p->xWork ) p->xWork(db, p->pWorkCtx); } #define TEST_NO_RECOVERY -1 #define TEST_COMPRESSION -3 #define TEST_MT_MODE -2 #define TEST_MT_MIN_CKPT -4 #define TEST_MT_MAX_CKPT -5 int test_lsm_config_str( LsmDb *pLsm, lsm_db *db, int bWorker, const char *zStr, int *pnThread ){ struct CfgParam { const char *zParam; int bWorker; int eParam; } aParam[] = { { "autoflush", 0, LSM_CONFIG_AUTOFLUSH }, { "page_size", 0, LSM_CONFIG_PAGE_SIZE }, { "block_size", 0, LSM_CONFIG_BLOCK_SIZE }, { "safety", 0, LSM_CONFIG_SAFETY }, { "autowork", 0, LSM_CONFIG_AUTOWORK }, { "autocheckpoint", 0, LSM_CONFIG_AUTOCHECKPOINT }, { "mmap", 0, LSM_CONFIG_MMAP }, { "use_log", 0, LSM_CONFIG_USE_LOG }, { "automerge", 0, LSM_CONFIG_AUTOMERGE }, { "max_freelist", 0, LSM_CONFIG_MAX_FREELIST }, { "multi_proc", 0, LSM_CONFIG_MULTIPLE_PROCESSES }, { "worker_automerge", 1, LSM_CONFIG_AUTOMERGE }, { "test_no_recovery", 0, TEST_NO_RECOVERY }, { "bg_min_ckpt", 0, TEST_NO_RECOVERY }, { "mt_mode", 0, TEST_MT_MODE }, { "mt_min_ckpt", 0, TEST_MT_MIN_CKPT }, { "mt_max_ckpt", 0, TEST_MT_MAX_CKPT }, #ifdef HAVE_ZLIB { "compression", 0, TEST_COMPRESSION }, #endif { 0, 0 } }; const char *z = zStr; int nThread = 1; if( zStr==0 ) return 0; assert( db ); while( z[0] ){ const char *zStart; /* Skip whitespace */ while( *z==' ' ) z++; zStart = z; while( *z && *z!='=' ) z++; if( *z ){ int eParam; int i; int iVal; int iMul = 1; int rc; char zParam[32]; int nParam = z-zStart; if( nParam==0 || nParam>sizeof(zParam)-1 ) goto syntax_error; memcpy(zParam, zStart, nParam); zParam[nParam] = '\0'; rc = testArgSelect(aParam, "param", zParam, &i); if( rc!=0 ) return rc; eParam = aParam[i].eParam; z++; zStart = z; while( *z>='0' && *z<='9' ) z++; if( *z=='k' || *z=='K' ){ iMul = 1; z++; }else if( *z=='M' || *z=='M' ){ iMul = 1024; z++; } nParam = z-zStart; if( nParam==0 || nParam>sizeof(zParam)-1 ) goto syntax_error; memcpy(zParam, zStart, nParam); zParam[nParam] = '\0'; iVal = atoi(zParam) * iMul; if( eParam>0 ){ if( bWorker || aParam[i].bWorker==0 ){ lsm_config(db, eParam, &iVal); } }else{ switch( eParam ){ case TEST_NO_RECOVERY: if( pLsm ) pLsm->bNoRecovery = iVal; break; case TEST_MT_MODE: if( pLsm ) nThread = iVal; break; case TEST_MT_MIN_CKPT: if( pLsm && iVal>0 ) pLsm->nMtMinCkpt = iVal*1024; break; case TEST_MT_MAX_CKPT: if( pLsm && iVal>0 ) pLsm->nMtMaxCkpt = iVal*1024; break; #ifdef HAVE_ZLIB case TEST_COMPRESSION: testConfigureCompression(db); break; #endif } } }else if( z!=zStart ){ goto syntax_error; } } if( pnThread ) *pnThread = nThread; if( pLsm && pLsm->nMtMaxCkpt < pLsm->nMtMinCkpt ){ pLsm->nMtMinCkpt = pLsm->nMtMaxCkpt; } return 0; syntax_error: testPrintError("syntax error at: \"%s\"\n", z); return 1; } int tdb_lsm_config_str(TestDb *pDb, const char *zStr){ int rc = 0; if( tdb_lsm(pDb) ){ #ifdef LSM_MUTEX_PTHREADS int i; #endif LsmDb *pLsm = (LsmDb *)pDb; rc = test_lsm_config_str(pLsm, pLsm->db, 0, zStr, 0); #ifdef LSM_MUTEX_PTHREADS for(i=0; rc==0 && inWorker; i++){ rc = test_lsm_config_str(0, pLsm->aWorker[i].pWorker, 1, zStr, 0); } #endif } return rc; } int tdb_lsm_configure(lsm_db *db, const char *zConfig){ return test_lsm_config_str(0, db, 0, zConfig, 0); } static int testLsmStartWorkers(LsmDb *, int, const char *, const char *); static int testLsmOpen( const char *zCfg, const char *zFilename, int bClear, TestDb **ppDb ){ static const DatabaseMethods LsmMethods = { test_lsm_close, test_lsm_write, test_lsm_delete, test_lsm_delete_range, test_lsm_fetch, test_lsm_scan, test_lsm_begin, test_lsm_commit, test_lsm_rollback }; int rc; int nFilename; LsmDb *pDb; /* If the bClear flag is set, delete any existing database. */ assert( zFilename); if( bClear ) testDeleteLsmdb(zFilename); nFilename = strlen(zFilename); pDb = (LsmDb *)testMalloc(sizeof(LsmDb) + nFilename + 1); memset(pDb, 0, sizeof(LsmDb)); pDb->base.pMethods = &LsmMethods; pDb->zName = (char *)&pDb[1]; memcpy(pDb->zName, zFilename, nFilename + 1); /* Default the sector size used for crash simulation to 512 bytes. ** Todo: There should be an OS method to obtain this value - just as ** there is in SQLite. For now, LSM assumes that it is smaller than ** the page size (default 4KB). */ pDb->szSector = 256; /* Default values for the mt_min_ckpt and mt_max_ckpt parameters. */ pDb->nMtMinCkpt = LSMTEST_DFLT_MT_MIN_CKPT; pDb->nMtMaxCkpt = LSMTEST_DFLT_MT_MAX_CKPT; memcpy(&pDb->env, tdb_lsm_env(), sizeof(lsm_env)); pDb->env.pVfsCtx = (void *)pDb; pDb->env.xFullpath = testEnvFullpath; pDb->env.xOpen = testEnvOpen; pDb->env.xRead = testEnvRead; pDb->env.xWrite = testEnvWrite; pDb->env.xTruncate = testEnvTruncate; pDb->env.xSync = testEnvSync; pDb->env.xSectorSize = testEnvSectorSize; pDb->env.xRemap = testEnvRemap; pDb->env.xFileid = testEnvFileid; pDb->env.xClose = testEnvClose; pDb->env.xUnlink = testEnvUnlink; pDb->env.xLock = testEnvLock; pDb->env.xTestLock = testEnvTestLock; pDb->env.xShmBarrier = testEnvShmBarrier; pDb->env.xShmMap = testEnvShmMap; pDb->env.xShmUnmap = testEnvShmUnmap; pDb->env.xSleep = testEnvSleep; rc = lsm_new(&pDb->env, &pDb->db); if( rc==LSM_OK ){ int nThread = 1; lsm_config_log(pDb->db, xLog, 0); lsm_config_work_hook(pDb->db, xWorkHook, (void *)pDb); rc = test_lsm_config_str(pDb, pDb->db, 0, zCfg, &nThread); if( rc==LSM_OK ) rc = lsm_open(pDb->db, zFilename); pDb->eMode = nThread; #ifdef LSM_MUTEX_PTHREADS if( rc==LSM_OK && nThread>1 ){ testLsmStartWorkers(pDb, nThread, zFilename, zCfg); } #endif if( rc!=LSM_OK ){ test_lsm_close((TestDb *)pDb); pDb = 0; } } *ppDb = (TestDb *)pDb; return rc; } int test_lsm_open( const char *zSpec, const char *zFilename, int bClear, TestDb **ppDb ){ return testLsmOpen(zSpec, zFilename, bClear, ppDb); } int test_lsm_small_open( const char *zSpec, const char *zFile, int bClear, TestDb **ppDb ){ const char *zCfg = "page_size=256 block_size=64 mmap=1024"; return testLsmOpen(zCfg, zFile, bClear, ppDb); } int test_lsm_lomem_open( const char *zSpec, const char *zFilename, int bClear, TestDb **ppDb ){ /* "max_freelist=4 autocheckpoint=32" */ const char *zCfg = "page_size=256 block_size=64 autoflush=16 " "autocheckpoint=32" "mmap=0 " ; return testLsmOpen(zCfg, zFilename, bClear, ppDb); } int test_lsm_zip_open( const char *zSpec, const char *zFilename, int bClear, TestDb **ppDb ){ const char *zCfg = "page_size=256 block_size=64 autoflush=16 " "autocheckpoint=32 compression=1 mmap=0 " ; return testLsmOpen(zCfg, zFilename, bClear, ppDb); } lsm_db *tdb_lsm(TestDb *pDb){ if( pDb->pMethods->xClose==test_lsm_close ){ return ((LsmDb *)pDb)->db; } return 0; } int tdb_lsm_multithread(TestDb *pDb){ int ret = 0; if( tdb_lsm(pDb) ){ ret = ((LsmDb*)pDb)->eMode!=LSMTEST_MODE_SINGLETHREAD; } return ret; } void tdb_lsm_enable_log(TestDb *pDb, int bEnable){ lsm_db *db = tdb_lsm(pDb); if( db ){ lsm_config_log(db, (bEnable ? xLog : 0), (void *)"client"); } } void tdb_lsm_application_crash(TestDb *pDb){ if( tdb_lsm(pDb) ){ LsmDb *p = (LsmDb *)pDb; p->bCrashed = 1; } } void tdb_lsm_prepare_system_crash(TestDb *pDb){ if( tdb_lsm(pDb) ){ LsmDb *p = (LsmDb *)pDb; p->bPrepareCrash = 1; } } void tdb_lsm_system_crash(TestDb *pDb){ if( tdb_lsm(pDb) ){ LsmDb *p = (LsmDb *)pDb; p->bCrashed = 1; doSystemCrash(p); } } void tdb_lsm_safety(TestDb *pDb, int eMode){ assert( eMode==LSM_SAFETY_OFF || eMode==LSM_SAFETY_NORMAL || eMode==LSM_SAFETY_FULL ); if( tdb_lsm(pDb) ){ int iParam = eMode; LsmDb *p = (LsmDb *)pDb; lsm_config(p->db, LSM_CONFIG_SAFETY, &iParam); } } void tdb_lsm_prepare_sync_crash(TestDb *pDb, int iSync){ assert( iSync>0 ); if( tdb_lsm(pDb) ){ LsmDb *p = (LsmDb *)pDb; p->nAutoCrash = iSync; p->bPrepareCrash = 1; } } void tdb_lsm_config_work_hook( TestDb *pDb, void (*xWork)(lsm_db *, void *), void *pWorkCtx ){ if( tdb_lsm(pDb) ){ LsmDb *p = (LsmDb *)pDb; p->xWork = xWork; p->pWorkCtx = pWorkCtx; } } void tdb_lsm_write_hook( TestDb *pDb, void (*xWrite)(void *, int, lsm_i64, int, int), void *pWriteCtx ){ if( tdb_lsm(pDb) ){ LsmDb *p = (LsmDb *)pDb; p->xWriteHook = xWrite; p->pWriteCtx = pWriteCtx; } } int tdb_lsm_open(const char *zCfg, const char *zDb, int bClear, TestDb **ppDb){ return testLsmOpen(zCfg, zDb, bClear, ppDb); } #ifdef LSM_MUTEX_PTHREADS /* ** Signal worker thread iWorker that there may be work to do. */ static void mt_signal_worker(LsmDb *pDb, int iWorker){ LsmWorker *p = &pDb->aWorker[iWorker]; pthread_mutex_lock(&p->worker_mutex); p->bDoWork = 1; pthread_cond_signal(&p->worker_cond); pthread_mutex_unlock(&p->worker_mutex); } /* ** This routine is used as the main() for all worker threads. */ static void *worker_main(void *pArg){ LsmWorker *p = (LsmWorker *)pArg; lsm_db *pWorker; /* Connection to access db through */ pthread_mutex_lock(&p->worker_mutex); while( (pWorker = p->pWorker) ){ int rc = LSM_OK; /* Do some work. If an error occurs, exit. */ pthread_mutex_unlock(&p->worker_mutex); if( p->eType==LSMTEST_THREAD_CKPT ){ int nKB = 0; rc = lsm_info(pWorker, LSM_INFO_CHECKPOINT_SIZE, &nKB); if( rc==LSM_OK && nKB>=p->pDb->nMtMinCkpt ){ rc = lsm_checkpoint(pWorker, 0); } }else{ int nWrite; do { if( p->eType==LSMTEST_THREAD_WORKER ){ waitOnCheckpointer(p->pDb, pWorker); } nWrite = 0; rc = lsm_work(pWorker, 0, 256, &nWrite); if( p->eType==LSMTEST_THREAD_WORKER && nWrite ){ mt_signal_worker(p->pDb, 1); } }while( nWrite && p->pWorker ); } pthread_mutex_lock(&p->worker_mutex); if( rc!=LSM_OK && rc!=LSM_BUSY ){ p->worker_rc = rc; break; } /* The thread will wake up when it is signaled either because another ** thread has created some work for this one or because the connection ** is being closed. */ if( p->pWorker && p->bDoWork==0 ){ pthread_cond_wait(&p->worker_cond, &p->worker_mutex); } p->bDoWork = 0; } pthread_mutex_unlock(&p->worker_mutex); return 0; } static void mt_stop_worker(LsmDb *pDb, int iWorker){ LsmWorker *p = &pDb->aWorker[iWorker]; if( p->pWorker ){ void *pDummy; lsm_db *pWorker; /* Signal the worker to stop */ pthread_mutex_lock(&p->worker_mutex); pWorker = p->pWorker; p->pWorker = 0; pthread_cond_signal(&p->worker_cond); pthread_mutex_unlock(&p->worker_mutex); /* Join the worker thread. */ pthread_join(p->worker_thread, &pDummy); /* Free resources allocated in mt_start_worker() */ pthread_cond_destroy(&p->worker_cond); pthread_mutex_destroy(&p->worker_mutex); lsm_close(pWorker); } } static void mt_shutdown(LsmDb *pDb){ int i; for(i=0; inWorker; i++){ mt_stop_worker(pDb, i); } } /* ** This callback is invoked by LSM when the client database writes to ** the database file (i.e. to flush the contents of the in-memory tree). ** This implies there may be work to do on the database, so signal ** the worker threads. */ static void mt_client_work_hook(lsm_db *db, void *pArg){ LsmDb *pDb = (LsmDb *)pArg; /* LsmDb database handle */ /* Invoke the user level work-hook, if any. */ if( pDb->xWork ) pDb->xWork(db, pDb->pWorkCtx); /* Wake up worker thread 0. */ mt_signal_worker(pDb, 0); } static void mt_worker_work_hook(lsm_db *db, void *pArg){ LsmDb *pDb = (LsmDb *)pArg; /* LsmDb database handle */ /* Invoke the user level work-hook, if any. */ if( pDb->xWork ) pDb->xWork(db, pDb->pWorkCtx); } /* ** Launch worker thread iWorker for database connection pDb. */ static int mt_start_worker( LsmDb *pDb, /* Main database structure */ int iWorker, /* Worker number to start */ const char *zFilename, /* File name of database to open */ const char *zCfg, /* Connection configuration string */ int eType /* Type of worker thread */ ){ int rc = 0; /* Return code */ LsmWorker *p; /* Object to initialize */ assert( iWorkernWorker ); assert( eType==LSMTEST_THREAD_CKPT || eType==LSMTEST_THREAD_WORKER || eType==LSMTEST_THREAD_WORKER_AC ); p = &pDb->aWorker[iWorker]; p->eType = eType; p->pDb = pDb; /* Open the worker connection */ if( rc==0 ) rc = lsm_new(&pDb->env, &p->pWorker); if( zCfg ){ test_lsm_config_str(pDb, p->pWorker, 1, zCfg, 0); } if( rc==0 ) rc = lsm_open(p->pWorker, zFilename); lsm_config_log(p->pWorker, xLog, (void *)"worker"); /* Configure the work-hook */ if( rc==0 ){ lsm_config_work_hook(p->pWorker, mt_worker_work_hook, (void *)pDb); } if( eType==LSMTEST_THREAD_WORKER ){ test_lsm_config_str(0, p->pWorker, 1, "autocheckpoint=0", 0); } /* Kick off the worker thread. */ if( rc==0 ) rc = pthread_cond_init(&p->worker_cond, 0); if( rc==0 ) rc = pthread_mutex_init(&p->worker_mutex, 0); if( rc==0 ) rc = pthread_create(&p->worker_thread, 0, worker_main, (void *)p); return rc; } static int testLsmStartWorkers( LsmDb *pDb, int eModel, const char *zFilename, const char *zCfg ){ int rc; if( eModel<1 || eModel>4 ) return 1; if( eModel==1 ) return 0; /* Configure a work-hook for the client connection. Worker 0 is signalled ** every time the users connection writes to the database. */ lsm_config_work_hook(pDb->db, mt_client_work_hook, (void *)pDb); /* Allocate space for two worker connections. They may not both be ** used, but both are allocated. */ pDb->aWorker = (LsmWorker *)testMalloc(sizeof(LsmWorker) * 2); memset(pDb->aWorker, 0, sizeof(LsmWorker) * 2); switch( eModel ){ case LSMTEST_MODE_BACKGROUND_CKPT: pDb->nWorker = 1; test_lsm_config_str(0, pDb->db, 0, "autocheckpoint=0", 0); rc = mt_start_worker(pDb, 0, zFilename, zCfg, LSMTEST_THREAD_CKPT); break; case LSMTEST_MODE_BACKGROUND_WORK: pDb->nWorker = 1; test_lsm_config_str(0, pDb->db, 0, "autowork=0", 0); rc = mt_start_worker(pDb, 0, zFilename, zCfg, LSMTEST_THREAD_WORKER_AC); break; case LSMTEST_MODE_BACKGROUND_BOTH: pDb->nWorker = 2; test_lsm_config_str(0, pDb->db, 0, "autowork=0", 0); rc = mt_start_worker(pDb, 0, zFilename, zCfg, LSMTEST_THREAD_WORKER); if( rc==0 ){ rc = mt_start_worker(pDb, 1, zFilename, zCfg, LSMTEST_THREAD_CKPT); } break; } return rc; } int test_lsm_mt2( const char *zSpec, const char *zFilename, int bClear, TestDb **ppDb ){ const char *zCfg = "mt_mode=2"; return testLsmOpen(zCfg, zFilename, bClear, ppDb); } int test_lsm_mt3( const char *zSpec, const char *zFilename, int bClear, TestDb **ppDb ){ const char *zCfg = "mt_mode=4"; return testLsmOpen(zCfg, zFilename, bClear, ppDb); } #else static void mt_shutdown(LsmDb *pDb) { unused_parameter(pDb); } int test_lsm_mt(const char *zFilename, int bClear, TestDb **ppDb){ unused_parameter(zFilename); unused_parameter(bClear); unused_parameter(ppDb); testPrintError("threads unavailable - recompile with LSM_MUTEX_PTHREADS\n"); return 1; } #endif ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest_tdb4.c ================================================ /* ** This file contains the TestDb bt wrapper. */ #include "lsmtest_tdb.h" #include "lsmtest.h" #include #include "bt.h" #include typedef struct BtDb BtDb; typedef struct BtFile BtFile; /* Background checkpointer interface (see implementations below). */ typedef struct bt_ckpter bt_ckpter; static int bgc_attach(BtDb *pDb, const char*); static int bgc_detach(BtDb *pDb); /* ** Each database or log file opened by a database handle is wrapped by ** an object of the following type. */ struct BtFile { BtDb *pBt; /* Database handle that opened this file */ bt_env *pVfs; /* Underlying VFS */ bt_file *pFile; /* File handle belonging to underlying VFS */ int nSectorSize; /* Size of sectors in bytes */ int nSector; /* Allocated size of nSector array */ u8 **apSector; /* Original sector data */ }; /* ** nCrashSync: ** If this value is non-zero, then a "crash-test" is running. If ** nCrashSync==1, then the crash is simulated during the very next ** call to the xSync() VFS method (on either the db or log file). ** If nCrashSync==2, the following call to xSync(), and so on. ** ** bCrash: ** After a crash is simulated, this variable is set. Any subsequent ** attempts to write to a file or modify the file system in any way ** fail once this is set. All the caller can do is close the connection. ** ** bFastInsert: ** If this variable is set to true, then a BT_CONTROL_FAST_INSERT_OP ** control is issued before each callto BtReplace() or BtCsrOpen(). */ struct BtDb { TestDb base; /* Base class */ bt_db *pBt; /* bt database handle */ sqlite4_env *pEnv; /* SQLite environment (for malloc/free) */ bt_env *pVfs; /* Underlying VFS */ int bFastInsert; /* True to use fast-insert */ /* Space for bt_fetch() results */ u8 *aBuffer; /* Space to store results */ int nBuffer; /* Allocated size of aBuffer[] in bytes */ int nRef; /* Background checkpointer used by mt connections */ bt_ckpter *pCkpter; /* Stuff used for crash test simulation */ BtFile *apFile[2]; /* Database and log files used by pBt */ bt_env env; /* Private VFS for this object */ int nCrashSync; /* Number of syncs until crash (see above) */ int bCrash; /* True once a crash has been simulated */ }; static int btVfsFullpath( sqlite4_env *pEnv, bt_env *pVfs, const char *z, char **pzOut ){ BtDb *pBt = (BtDb*)pVfs->pVfsCtx; if( pBt->bCrash ) return SQLITE4_IOERR; return pBt->pVfs->xFullpath(pEnv, pBt->pVfs, z, pzOut); } static int btVfsOpen( sqlite4_env *pEnv, bt_env *pVfs, const char *zFile, int flags, bt_file **ppFile ){ BtFile *p; BtDb *pBt = (BtDb*)pVfs->pVfsCtx; int rc; if( pBt->bCrash ) return SQLITE4_IOERR; p = (BtFile*)testMalloc(sizeof(BtFile)); if( !p ) return SQLITE4_NOMEM; if( flags & BT_OPEN_DATABASE ){ pBt->apFile[0] = p; }else if( flags & BT_OPEN_LOG ){ pBt->apFile[1] = p; } if( (flags & BT_OPEN_SHARED)==0 ){ p->pBt = pBt; } p->pVfs = pBt->pVfs; rc = pBt->pVfs->xOpen(pEnv, pVfs, zFile, flags, &p->pFile); if( rc!=SQLITE4_OK ){ testFree(p); p = 0; }else{ pBt->nRef++; } *ppFile = (bt_file*)p; return rc; } static int btVfsSize(bt_file *pFile, sqlite4_int64 *piRes){ BtFile *p = (BtFile*)pFile; if( p->pBt && p->pBt->bCrash ) return SQLITE4_IOERR; return p->pVfs->xSize(p->pFile, piRes); } static int btVfsRead(bt_file *pFile, sqlite4_int64 iOff, void *pBuf, int nBuf){ BtFile *p = (BtFile*)pFile; if( p->pBt && p->pBt->bCrash ) return SQLITE4_IOERR; return p->pVfs->xRead(p->pFile, iOff, pBuf, nBuf); } static int btFlushSectors(BtFile *p, int iFile){ sqlite4_int64 iSz; int rc; int i; u8 *aTmp = 0; rc = p->pBt->pVfs->xSize(p->pFile, &iSz); for(i=0; rc==SQLITE4_OK && inSector; i++){ if( p->pBt->bCrash && p->apSector[i] ){ /* The system is simulating a crash. There are three choices for ** this sector: ** ** 1) Leave it as it is (simulating a successful write), ** 2) Restore the original data (simulating a lost write), ** 3) Populate the disk sector with garbage data. */ sqlite4_int64 iSOff = p->nSectorSize*i; int nWrite = MIN(p->nSectorSize, iSz - iSOff); if( nWrite ){ u8 *aWrite = 0; int iOpt = (testPrngValue(i) % 3) + 1; if( iOpt==1 ){ aWrite = p->apSector[i]; }else if( iOpt==3 ){ if( aTmp==0 ) aTmp = testMalloc(p->nSectorSize); aWrite = aTmp; testPrngArray(i*13, (u32*)aWrite, nWrite/sizeof(u32)); } #if 0 fprintf(stderr, "handle sector %d of %s with %s\n", i, iFile==0 ? "db" : "log", iOpt==1 ? "rollback" : iOpt==2 ? "write" : "omit" ); fflush(stderr); #endif if( aWrite ){ rc = p->pBt->pVfs->xWrite(p->pFile, iSOff, aWrite, nWrite); } } } testFree(p->apSector[i]); p->apSector[i] = 0; } testFree(aTmp); return rc; } static int btSaveSectors(BtFile *p, sqlite4_int64 iOff, int nBuf){ int rc; sqlite4_int64 iSz; /* Size of file on disk */ int iFirst; /* First sector affected */ int iSector; /* Current sector */ int iLast; /* Last sector affected */ if( p->nSectorSize==0 ){ p->nSectorSize = p->pBt->pVfs->xSectorSize(p->pFile); if( p->nSectorSize<512 ) p->nSectorSize = 512; } iLast = (iOff+nBuf-1) / p->nSectorSize; iFirst = iOff / p->nSectorSize; rc = p->pBt->pVfs->xSize(p->pFile, &iSz); for(iSector=iFirst; rc==SQLITE4_OK && iSector<=iLast; iSector++){ int nRead; sqlite4_int64 iSOff = iSector * p->nSectorSize; u8 *aBuf = testMalloc(p->nSectorSize); nRead = MIN(p->nSectorSize, (iSz - iSOff)); if( nRead>0 ){ rc = p->pBt->pVfs->xRead(p->pFile, iSOff, aBuf, nRead); } while( rc==SQLITE4_OK && iSector>=p->nSector ){ int nNew = p->nSector + 32; u8 **apNew = (u8**)testMalloc(nNew * sizeof(u8*)); memcpy(apNew, p->apSector, p->nSector*sizeof(u8*)); testFree(p->apSector); p->apSector = apNew; p->nSector = nNew; } p->apSector[iSector] = aBuf; } return rc; } static int btVfsWrite(bt_file *pFile, sqlite4_int64 iOff, void *pBuf, int nBuf){ BtFile *p = (BtFile*)pFile; if( p->pBt && p->pBt->bCrash ) return SQLITE4_IOERR; if( p->pBt && p->pBt->nCrashSync ){ btSaveSectors(p, iOff, nBuf); } return p->pVfs->xWrite(p->pFile, iOff, pBuf, nBuf); } static int btVfsTruncate(bt_file *pFile, sqlite4_int64 iOff){ BtFile *p = (BtFile*)pFile; if( p->pBt && p->pBt->bCrash ) return SQLITE4_IOERR; return p->pVfs->xTruncate(p->pFile, iOff); } static int btVfsSync(bt_file *pFile){ int rc = SQLITE4_OK; BtFile *p = (BtFile*)pFile; BtDb *pBt = p->pBt; if( pBt ){ if( pBt->bCrash ) return SQLITE4_IOERR; if( pBt->nCrashSync ){ pBt->nCrashSync--; pBt->bCrash = (pBt->nCrashSync==0); if( pBt->bCrash ){ btFlushSectors(pBt->apFile[0], 0); btFlushSectors(pBt->apFile[1], 1); rc = SQLITE4_IOERR; }else{ btFlushSectors(p, 0); } } } if( rc==SQLITE4_OK ){ rc = p->pVfs->xSync(p->pFile); } return rc; } static int btVfsSectorSize(bt_file *pFile){ BtFile *p = (BtFile*)pFile; return p->pVfs->xSectorSize(p->pFile); } static void btDeref(BtDb *p){ p->nRef--; assert( p->nRef>=0 ); if( p->nRef<=0 ) testFree(p); } static int btVfsClose(bt_file *pFile){ BtFile *p = (BtFile*)pFile; BtDb *pBt = p->pBt; int rc; if( pBt ){ btFlushSectors(p, 0); if( p==pBt->apFile[0] ) pBt->apFile[0] = 0; if( p==pBt->apFile[1] ) pBt->apFile[1] = 0; } testFree(p->apSector); rc = p->pVfs->xClose(p->pFile); #if 0 btDeref(p->pBt); #endif testFree(p); return rc; } static int btVfsUnlink(sqlite4_env *pEnv, bt_env *pVfs, const char *zFile){ BtDb *pBt = (BtDb*)pVfs->pVfsCtx; if( pBt->bCrash ) return SQLITE4_IOERR; return pBt->pVfs->xUnlink(pEnv, pBt->pVfs, zFile); } static int btVfsLock(bt_file *pFile, int iLock, int eType){ BtFile *p = (BtFile*)pFile; if( p->pBt && p->pBt->bCrash ) return SQLITE4_IOERR; return p->pVfs->xLock(p->pFile, iLock, eType); } static int btVfsTestLock(bt_file *pFile, int iLock, int nLock, int eType){ BtFile *p = (BtFile*)pFile; if( p->pBt && p->pBt->bCrash ) return SQLITE4_IOERR; return p->pVfs->xTestLock(p->pFile, iLock, nLock, eType); } static int btVfsShmMap(bt_file *pFile, int iChunk, int sz, void **ppOut){ BtFile *p = (BtFile*)pFile; if( p->pBt && p->pBt->bCrash ) return SQLITE4_IOERR; return p->pVfs->xShmMap(p->pFile, iChunk, sz, ppOut); } static void btVfsShmBarrier(bt_file *pFile){ BtFile *p = (BtFile*)pFile; return p->pVfs->xShmBarrier(p->pFile); } static int btVfsShmUnmap(bt_file *pFile, int bDelete){ BtFile *p = (BtFile*)pFile; if( p->pBt && p->pBt->bCrash ) return SQLITE4_IOERR; return p->pVfs->xShmUnmap(p->pFile, bDelete); } static int bt_close(TestDb *pTestDb){ BtDb *p = (BtDb*)pTestDb; int rc = sqlite4BtClose(p->pBt); free(p->aBuffer); if( p->apFile[0] ) p->apFile[0]->pBt = 0; if( p->apFile[1] ) p->apFile[1]->pBt = 0; bgc_detach(p); testFree(p); return rc; } static int btMinTransaction(BtDb *p, int iMin, int *piLevel){ int iLevel; int rc = SQLITE4_OK; iLevel = sqlite4BtTransactionLevel(p->pBt); if( iLevelpBt, iMin); *piLevel = iLevel; }else{ *piLevel = -1; } return rc; } static int btRestoreTransaction(BtDb *p, int iLevel, int rcin){ int rc = rcin; if( iLevel>=0 ){ if( rc==SQLITE4_OK ){ rc = sqlite4BtCommit(p->pBt, iLevel); }else{ sqlite4BtRollback(p->pBt, iLevel); } assert( iLevel==sqlite4BtTransactionLevel(p->pBt) ); } return rc; } static int bt_write(TestDb *pTestDb, void *pK, int nK, void *pV, int nV){ BtDb *p = (BtDb*)pTestDb; int iLevel; int rc; rc = btMinTransaction(p, 2, &iLevel); if( rc==SQLITE4_OK ){ if( p->bFastInsert ) sqlite4BtControl(p->pBt, BT_CONTROL_FAST_INSERT_OP, 0); rc = sqlite4BtReplace(p->pBt, pK, nK, pV, nV); rc = btRestoreTransaction(p, iLevel, rc); } return rc; } static int bt_delete(TestDb *pTestDb, void *pK, int nK){ return bt_write(pTestDb, pK, nK, 0, -1); } static int bt_delete_range( TestDb *pTestDb, void *pKey1, int nKey1, void *pKey2, int nKey2 ){ BtDb *p = (BtDb*)pTestDb; bt_cursor *pCsr = 0; int rc = SQLITE4_OK; int iLevel; rc = btMinTransaction(p, 2, &iLevel); if( rc==SQLITE4_OK ){ if( p->bFastInsert ) sqlite4BtControl(p->pBt, BT_CONTROL_FAST_INSERT_OP, 0); rc = sqlite4BtCsrOpen(p->pBt, 0, &pCsr); } while( rc==SQLITE4_OK ){ const void *pK; int n; int nCmp; int res; rc = sqlite4BtCsrSeek(pCsr, pKey1, nKey1, BT_SEEK_GE); if( rc==SQLITE4_INEXACT ) rc = SQLITE4_OK; if( rc!=SQLITE4_OK ) break; rc = sqlite4BtCsrKey(pCsr, &pK, &n); if( rc!=SQLITE4_OK ) break; nCmp = MIN(n, nKey1); res = memcmp(pKey1, pK, nCmp); assert( res<0 || (res==0 && nKey1<=n) ); if( res==0 && nKey1==n ){ rc = sqlite4BtCsrNext(pCsr); if( rc!=SQLITE4_OK ) break; rc = sqlite4BtCsrKey(pCsr, &pK, &n); if( rc!=SQLITE4_OK ) break; } nCmp = MIN(n, nKey2); res = memcmp(pKey2, pK, nCmp); if( res<0 || (res==0 && nKey2<=n) ) break; rc = sqlite4BtDelete(pCsr); } if( rc==SQLITE4_NOTFOUND ) rc = SQLITE4_OK; sqlite4BtCsrClose(pCsr); rc = btRestoreTransaction(p, iLevel, rc); return rc; } static int bt_fetch( TestDb *pTestDb, void *pK, int nK, void **ppVal, int *pnVal ){ BtDb *p = (BtDb*)pTestDb; bt_cursor *pCsr = 0; int iLevel; int rc = SQLITE4_OK; iLevel = sqlite4BtTransactionLevel(p->pBt); if( iLevel==0 ){ rc = sqlite4BtBegin(p->pBt, 1); if( rc!=SQLITE4_OK ) return rc; } if( p->bFastInsert ) sqlite4BtControl(p->pBt, BT_CONTROL_FAST_INSERT_OP, 0); rc = sqlite4BtCsrOpen(p->pBt, 0, &pCsr); if( rc==SQLITE4_OK ){ rc = sqlite4BtCsrSeek(pCsr, pK, nK, BT_SEEK_EQ); if( rc==SQLITE4_OK ){ const void *pV = 0; int nV = 0; rc = sqlite4BtCsrData(pCsr, 0, -1, &pV, &nV); if( rc==SQLITE4_OK ){ if( nV>p->nBuffer ){ free(p->aBuffer); p->aBuffer = (u8*)malloc(nV*2); p->nBuffer = nV*2; } memcpy(p->aBuffer, pV, nV); *pnVal = nV; *ppVal = (void*)(p->aBuffer); } }else if( rc==SQLITE4_INEXACT || rc==SQLITE4_NOTFOUND ){ *ppVal = 0; *pnVal = -1; rc = SQLITE4_OK; } sqlite4BtCsrClose(pCsr); } if( iLevel==0 ) sqlite4BtCommit(p->pBt, 0); return rc; } static int bt_scan( TestDb *pTestDb, void *pCtx, int bReverse, void *pFirst, int nFirst, void *pLast, int nLast, void (*xCallback)(void *, void *, int , void *, int) ){ BtDb *p = (BtDb*)pTestDb; bt_cursor *pCsr = 0; int rc; int iLevel; rc = btMinTransaction(p, 1, &iLevel); if( rc==SQLITE4_OK ){ if( p->bFastInsert ) sqlite4BtControl(p->pBt, BT_CONTROL_FAST_INSERT_OP, 0); rc = sqlite4BtCsrOpen(p->pBt, 0, &pCsr); } if( rc==SQLITE4_OK ){ if( bReverse ){ if( pLast ){ rc = sqlite4BtCsrSeek(pCsr, pLast, nLast, BT_SEEK_LE); }else{ rc = sqlite4BtCsrLast(pCsr); } }else{ rc = sqlite4BtCsrSeek(pCsr, pFirst, nFirst, BT_SEEK_GE); } if( rc==SQLITE4_INEXACT ) rc = SQLITE4_OK; while( rc==SQLITE4_OK ){ const void *pK = 0; int nK = 0; const void *pV = 0; int nV = 0; rc = sqlite4BtCsrKey(pCsr, &pK, &nK); if( rc==SQLITE4_OK ){ rc = sqlite4BtCsrData(pCsr, 0, -1, &pV, &nV); } if( rc!=SQLITE4_OK ) break; if( bReverse ){ if( pFirst ){ int res; int nCmp = MIN(nK, nFirst); res = memcmp(pFirst, pK, nCmp); if( res>0 || (res==0 && nKnLast) ) break; } } xCallback(pCtx, (void*)pK, nK, (void*)pV, nV); if( bReverse ){ rc = sqlite4BtCsrPrev(pCsr); }else{ rc = sqlite4BtCsrNext(pCsr); } } if( rc==SQLITE4_NOTFOUND ) rc = SQLITE4_OK; sqlite4BtCsrClose(pCsr); } rc = btRestoreTransaction(p, iLevel, rc); return rc; } static int bt_begin(TestDb *pTestDb, int iLvl){ BtDb *p = (BtDb*)pTestDb; int rc = sqlite4BtBegin(p->pBt, iLvl); return rc; } static int bt_commit(TestDb *pTestDb, int iLvl){ BtDb *p = (BtDb*)pTestDb; int rc = sqlite4BtCommit(p->pBt, iLvl); return rc; } static int bt_rollback(TestDb *pTestDb, int iLvl){ BtDb *p = (BtDb*)pTestDb; int rc = sqlite4BtRollback(p->pBt, iLvl); return rc; } static int testParseOption( const char **pzIn, /* IN/OUT: pointer to next option */ const char **pzOpt, /* OUT: nul-terminated option name */ const char **pzArg, /* OUT: nul-terminated option argument */ char *pSpace /* Temporary space for output params */ ){ const char *p = *pzIn; const char *pStart; int n; char *pOut = pSpace; while( *p==' ' ) p++; pStart = p; while( *p && *p!='=' ) p++; if( *p==0 ) return 1; n = (p - pStart); memcpy(pOut, pStart, n); *pzOpt = pOut; pOut += n; *pOut++ = '\0'; p++; pStart = p; while( *p && *p!=' ' ) p++; n = (p - pStart); memcpy(pOut, pStart, n); *pzArg = pOut; pOut += n; *pOut++ = '\0'; *pzIn = p; return 0; } static int testParseInt(const char *z, int *piVal){ int i = 0; const char *p = z; while( *p>='0' && *p<='9' ){ i = i*10 + (*p - '0'); p++; } if( *p=='K' || *p=='k' ){ i = i * 1024; p++; }else if( *p=='M' || *p=='m' ){ i = i * 1024 * 1024; p++; } if( *p ) return SQLITE4_ERROR; *piVal = i; return SQLITE4_OK; } static int testBtConfigure(BtDb *pDb, const char *zCfg, int *pbMt){ int rc = SQLITE4_OK; if( zCfg ){ struct CfgParam { const char *zParam; int eParam; } aParam[] = { { "safety", BT_CONTROL_SAFETY }, { "autockpt", BT_CONTROL_AUTOCKPT }, { "multiproc", BT_CONTROL_MULTIPROC }, { "blksz", BT_CONTROL_BLKSZ }, { "pagesz", BT_CONTROL_PAGESZ }, { "mt", -1 }, { "fastinsert", -2 }, { 0, 0 } }; const char *z = zCfg; int n = strlen(z); char *aSpace; const char *zOpt; const char *zArg; aSpace = (char*)testMalloc(n+2); while( rc==SQLITE4_OK && 0==testParseOption(&z, &zOpt, &zArg, aSpace) ){ int i; int iVal; rc = testArgSelect(aParam, "param", zOpt, &i); if( rc!=SQLITE4_OK ) break; rc = testParseInt(zArg, &iVal); if( rc!=SQLITE4_OK ) break; switch( aParam[i].eParam ){ case -1: *pbMt = iVal; break; case -2: pDb->bFastInsert = 1; break; default: rc = sqlite4BtControl(pDb->pBt, aParam[i].eParam, (void*)&iVal); break; } } testFree(aSpace); } return rc; } int test_bt_open( const char *zSpec, const char *zFilename, int bClear, TestDb **ppDb ){ static const DatabaseMethods SqlMethods = { bt_close, bt_write, bt_delete, bt_delete_range, bt_fetch, bt_scan, bt_begin, bt_commit, bt_rollback }; BtDb *p = 0; bt_db *pBt = 0; int rc; sqlite4_env *pEnv = sqlite4_env_default(); if( bClear && zFilename && zFilename[0] ){ char *zLog = sqlite3_mprintf("%s-wal", zFilename); unlink(zFilename); unlink(zLog); sqlite3_free(zLog); } rc = sqlite4BtNew(pEnv, 0, &pBt); if( rc==SQLITE4_OK ){ int mt = 0; /* True for multi-threaded connection */ p = (BtDb*)testMalloc(sizeof(BtDb)); p->base.pMethods = &SqlMethods; p->pBt = pBt; p->pEnv = pEnv; p->nRef = 1; p->env.pVfsCtx = (void*)p; p->env.xFullpath = btVfsFullpath; p->env.xOpen = btVfsOpen; p->env.xSize = btVfsSize; p->env.xRead = btVfsRead; p->env.xWrite = btVfsWrite; p->env.xTruncate = btVfsTruncate; p->env.xSync = btVfsSync; p->env.xSectorSize = btVfsSectorSize; p->env.xClose = btVfsClose; p->env.xUnlink = btVfsUnlink; p->env.xLock = btVfsLock; p->env.xTestLock = btVfsTestLock; p->env.xShmMap = btVfsShmMap; p->env.xShmBarrier = btVfsShmBarrier; p->env.xShmUnmap = btVfsShmUnmap; sqlite4BtControl(pBt, BT_CONTROL_GETVFS, (void*)&p->pVfs); sqlite4BtControl(pBt, BT_CONTROL_SETVFS, (void*)&p->env); rc = testBtConfigure(p, zSpec, &mt); if( rc==SQLITE4_OK ){ rc = sqlite4BtOpen(pBt, zFilename); } if( rc==SQLITE4_OK && mt ){ int nAuto = 0; rc = bgc_attach(p, zSpec); sqlite4BtControl(pBt, BT_CONTROL_AUTOCKPT, (void*)&nAuto); } } if( rc!=SQLITE4_OK && p ){ bt_close(&p->base); } *ppDb = &p->base; return rc; } int test_fbt_open( const char *zSpec, const char *zFilename, int bClear, TestDb **ppDb ){ return test_bt_open("fast=1", zFilename, bClear, ppDb); } int test_fbts_open( const char *zSpec, const char *zFilename, int bClear, TestDb **ppDb ){ return test_bt_open("fast=1 blksz=32K pagesz=512", zFilename, bClear, ppDb); } void tdb_bt_prepare_sync_crash(TestDb *pTestDb, int iSync){ BtDb *p = (BtDb*)pTestDb; assert( pTestDb->pMethods->xClose==bt_close ); assert( p->bCrash==0 ); p->nCrashSync = iSync; } bt_db *tdb_bt(TestDb *pDb){ if( pDb->pMethods->xClose==bt_close ){ return ((BtDb *)pDb)->pBt; } return 0; } /************************************************************************* ** Beginning of code for background checkpointer. */ struct bt_ckpter { sqlite4_buffer file; /* File name */ sqlite4_buffer spec; /* Options */ int nLogsize; /* Minimum log size to checkpoint */ int nRef; /* Number of clients */ int bDoWork; /* Set by client threads */ pthread_t ckpter_thread; /* Checkpointer thread */ pthread_cond_t ckpter_cond; /* Condition var the ckpter waits on */ pthread_mutex_t ckpter_mutex; /* Mutex used with ckpter_cond */ bt_ckpter *pNext; /* Next object in list at gBgc.pCkpter */ }; static struct GlobalBackgroundCheckpointer { bt_ckpter *pCkpter; /* Linked list of checkpointers */ } gBgc; static void *bgc_main(void *pArg){ BtDb *pDb = 0; int rc; int mt; bt_ckpter *pCkpter = (bt_ckpter*)pArg; rc = test_bt_open("", (char*)pCkpter->file.p, 0, (TestDb**)&pDb); assert( rc==SQLITE4_OK ); rc = testBtConfigure(pDb, (char*)pCkpter->spec.p, &mt); while( pCkpter->nRef>0 ){ bt_db *db = pDb->pBt; int nLog = 0; sqlite4BtBegin(db, 1); sqlite4BtCommit(db, 0); sqlite4BtControl(db, BT_CONTROL_LOGSIZE, (void*)&nLog); if( nLog>=pCkpter->nLogsize ){ int rc; bt_checkpoint ckpt; memset(&ckpt, 0, sizeof(bt_checkpoint)); ckpt.nFrameBuffer = nLog/2; rc = sqlite4BtControl(db, BT_CONTROL_CHECKPOINT, (void*)&ckpt); assert( rc==SQLITE4_OK ); sqlite4BtControl(db, BT_CONTROL_LOGSIZE, (void*)&nLog); } /* The thread will wake up when it is signaled either because another ** thread has created some work for this one or because the connection ** is being closed. */ pthread_mutex_lock(&pCkpter->ckpter_mutex); if( pCkpter->bDoWork==0 ){ pthread_cond_wait(&pCkpter->ckpter_cond, &pCkpter->ckpter_mutex); } pCkpter->bDoWork = 0; pthread_mutex_unlock(&pCkpter->ckpter_mutex); } if( pDb ) bt_close((TestDb*)pDb); return 0; } static void bgc_logsize_cb(void *pCtx, int nLogsize){ bt_ckpter *p = (bt_ckpter*)pCtx; if( nLogsize>=p->nLogsize ){ pthread_mutex_lock(&p->ckpter_mutex); p->bDoWork = 1; pthread_cond_signal(&p->ckpter_cond); pthread_mutex_unlock(&p->ckpter_mutex); } } static int bgc_attach(BtDb *pDb, const char *zSpec){ int rc; int n; bt_info info; bt_ckpter *pCkpter; /* Figure out the full path to the database opened by handle pDb. */ info.eType = BT_INFO_FILENAME; info.pgno = 0; sqlite4_buffer_init(&info.output, 0); rc = sqlite4BtControl(pDb->pBt, BT_CONTROL_INFO, (void*)&info); if( rc!=SQLITE4_OK ) return rc; sqlite4_mutex_enter(sqlite4_mutex_alloc(pDb->pEnv, SQLITE4_MUTEX_STATIC_KV)); /* Search for an existing bt_ckpter object. */ n = info.output.n; for(pCkpter=gBgc.pCkpter; pCkpter; pCkpter=pCkpter->pNext){ if( n==pCkpter->file.n && 0==memcmp(info.output.p, pCkpter->file.p, n) ){ break; } } /* Failed to find a suitable checkpointer. Create a new one. */ if( pCkpter==0 ){ bt_logsizecb cb; pCkpter = testMalloc(sizeof(bt_ckpter)); memcpy(&pCkpter->file, &info.output, sizeof(sqlite4_buffer)); info.output.p = 0; pCkpter->pNext = gBgc.pCkpter; pCkpter->nLogsize = 1000; gBgc.pCkpter = pCkpter; pCkpter->nRef = 1; sqlite4_buffer_init(&pCkpter->spec, 0); rc = sqlite4_buffer_set(&pCkpter->spec, zSpec, strlen(zSpec)+1); assert( rc==SQLITE4_OK ); /* Kick off the checkpointer thread. */ if( rc==0 ) rc = pthread_cond_init(&pCkpter->ckpter_cond, 0); if( rc==0 ) rc = pthread_mutex_init(&pCkpter->ckpter_mutex, 0); if( rc==0 ){ rc = pthread_create(&pCkpter->ckpter_thread, 0, bgc_main, (void*)pCkpter); } assert( rc==0 ); /* todo: Fix this */ /* Set up the logsize callback for the client thread */ cb.pCtx = (void*)pCkpter; cb.xLogsize = bgc_logsize_cb; sqlite4BtControl(pDb->pBt, BT_CONTROL_LOGSIZECB, (void*)&cb); }else{ pCkpter->nRef++; } /* Assuming a checkpointer was encountered or effected, attach the ** connection to it. */ if( pCkpter ){ pDb->pCkpter = pCkpter; } sqlite4_mutex_leave(sqlite4_mutex_alloc(pDb->pEnv, SQLITE4_MUTEX_STATIC_KV)); sqlite4_buffer_clear(&info.output); return rc; } static int bgc_detach(BtDb *pDb){ int rc = SQLITE4_OK; bt_ckpter *pCkpter = pDb->pCkpter; if( pCkpter ){ int bShutdown = 0; /* True if this is the last reference */ sqlite4_mutex_enter(sqlite4_mutex_alloc(pDb->pEnv,SQLITE4_MUTEX_STATIC_KV)); pCkpter->nRef--; if( pCkpter->nRef==0 ){ bt_ckpter **pp; *pp = pCkpter->pNext; for(pp=&gBgc.pCkpter; *pp!=pCkpter; pp=&((*pp)->pNext)); bShutdown = 1; } sqlite4_mutex_leave(sqlite4_mutex_alloc(pDb->pEnv,SQLITE4_MUTEX_STATIC_KV)); if( bShutdown ){ void *pDummy; /* Signal the checkpointer thread. */ pthread_mutex_lock(&pCkpter->ckpter_mutex); pCkpter->bDoWork = 1; pthread_cond_signal(&pCkpter->ckpter_cond); pthread_mutex_unlock(&pCkpter->ckpter_mutex); /* Join the checkpointer thread. */ pthread_join(pCkpter->ckpter_thread, &pDummy); pthread_cond_destroy(&pCkpter->ckpter_cond); pthread_mutex_destroy(&pCkpter->ckpter_mutex); sqlite4_buffer_clear(&pCkpter->file); sqlite4_buffer_clear(&pCkpter->spec); testFree(pCkpter); } pDb->pCkpter = 0; } return rc; } /* ** End of background checkpointer. *************************************************************************/ ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest_util.c ================================================ #include "lsmtest.h" #include #include #include #ifndef _WIN32 # include #endif /* ** Global variables used within this module. */ static struct TestutilGlobal { char **argv; int argc; } g = {0, 0}; static struct TestutilRnd { unsigned int aRand1[2048]; /* Bits 0..10 */ unsigned int aRand2[2048]; /* Bits 11..21 */ unsigned int aRand3[1024]; /* Bits 22..31 */ } r; /************************************************************************* ** The following block is a copy of the implementation of SQLite function ** sqlite3_randomness. This version has two important differences: ** ** 1. It always uses the same seed. So the sequence of random data output ** is the same for every run of the program. ** ** 2. It is not threadsafe. */ static struct sqlite3PrngType { unsigned char i, j; /* State variables */ unsigned char s[256]; /* State variables */ } sqlite3Prng = { 0xAF, 0x28, { 0x71, 0xF5, 0xB4, 0x6E, 0x80, 0xAB, 0x1D, 0xB8, 0xFB, 0xB7, 0x49, 0xBF, 0xFF, 0x72, 0x2D, 0x14, 0x79, 0x09, 0xE3, 0x78, 0x76, 0xB0, 0x2C, 0x0A, 0x8E, 0x23, 0xEE, 0xDF, 0xE0, 0x9A, 0x2F, 0x67, 0xE1, 0xBE, 0x0E, 0xA7, 0x08, 0x97, 0xEB, 0x77, 0x78, 0xBA, 0x9D, 0xCA, 0x49, 0x4C, 0x60, 0x9A, 0xF6, 0xBD, 0xDA, 0x7F, 0xBC, 0x48, 0x58, 0x52, 0xE5, 0xCD, 0x83, 0x72, 0x23, 0x52, 0xFF, 0x6D, 0xEF, 0x0F, 0x82, 0x29, 0xA0, 0x83, 0x3F, 0x7D, 0xA4, 0x88, 0x31, 0xE7, 0x88, 0x92, 0x3B, 0x9B, 0x3B, 0x2C, 0xC2, 0x4C, 0x71, 0xA2, 0xB0, 0xEA, 0x36, 0xD0, 0x00, 0xF1, 0xD3, 0x39, 0x17, 0x5D, 0x2A, 0x7A, 0xE4, 0xAD, 0xE1, 0x64, 0xCE, 0x0F, 0x9C, 0xD9, 0xF5, 0xED, 0xB0, 0x22, 0x5E, 0x62, 0x97, 0x02, 0xA3, 0x8C, 0x67, 0x80, 0xFC, 0x88, 0x14, 0x0B, 0x15, 0x10, 0x0F, 0xC7, 0x40, 0xD4, 0xF1, 0xF9, 0x0E, 0x1A, 0xCE, 0xB9, 0x1E, 0xA1, 0x72, 0x8E, 0xD7, 0x78, 0x39, 0xCD, 0xF4, 0x5D, 0x2A, 0x59, 0x26, 0x34, 0xF2, 0x73, 0x0B, 0xA0, 0x02, 0x51, 0x2C, 0x03, 0xA3, 0xA7, 0x43, 0x13, 0xE8, 0x98, 0x2B, 0xD2, 0x53, 0xF8, 0xEE, 0x91, 0x7D, 0xE7, 0xE3, 0xDA, 0xD5, 0xBB, 0xC0, 0x92, 0x9D, 0x98, 0x01, 0x2C, 0xF9, 0xB9, 0xA0, 0xEB, 0xCF, 0x32, 0xFA, 0x01, 0x49, 0xA5, 0x1D, 0x9A, 0x76, 0x86, 0x3F, 0x40, 0xD4, 0x89, 0x8F, 0x9C, 0xE2, 0xE3, 0x11, 0x31, 0x37, 0xB2, 0x49, 0x28, 0x35, 0xC0, 0x99, 0xB6, 0xD0, 0xBC, 0x66, 0x35, 0xF7, 0x83, 0x5B, 0xD7, 0x37, 0x1A, 0x2B, 0x18, 0xA6, 0xFF, 0x8D, 0x7C, 0x81, 0xA8, 0xFC, 0x9E, 0xC4, 0xEC, 0x80, 0xD0, 0x98, 0xA7, 0x76, 0xCC, 0x9C, 0x2F, 0x7B, 0xFF, 0x8E, 0x0E, 0xBB, 0x90, 0xAE, 0x13, 0x06, 0xF5, 0x1C, 0x4E, 0x52, 0xF7 } }; /* Generate and return single random byte */ static unsigned char randomByte(void){ unsigned char t; sqlite3Prng.i++; t = sqlite3Prng.s[sqlite3Prng.i]; sqlite3Prng.j += t; sqlite3Prng.s[sqlite3Prng.i] = sqlite3Prng.s[sqlite3Prng.j]; sqlite3Prng.s[sqlite3Prng.j] = t; t += sqlite3Prng.s[sqlite3Prng.i]; return sqlite3Prng.s[t]; } /* ** Return N random bytes. */ static void randomBlob(int nBuf, unsigned char *zBuf){ int i; for(i=0; i>11) & 0x000007FF] ^ r.aRand3[(iVal>>22) & 0x000003FF] ; } void testPrngArray(unsigned int iVal, unsigned int *aOut, int nOut){ int i; for(i=0; izName; pEntry=(struct Entry *)&((unsigned char *)pEntry)[sz] ){ if( zPrev ){ testPrintError("%s, ", zPrev); } zPrev = pEntry->zName; } testPrintError("or %s\n", zPrev); } int testArgSelectX( void *aData, const char *zType, int sz, const char *zArg, int *piOut ){ struct Entry { const char *zName; }; struct Entry *pEntry; int nArg = strlen(zArg); int i = 0; int iOut = -1; int nOut = 0; for(pEntry=(struct Entry *)aData; pEntry->zName; pEntry=(struct Entry *)&((unsigned char *)pEntry)[sz] ){ int nName = strlen(pEntry->zName); if( nArg<=nName && memcmp(pEntry->zName, zArg, nArg)==0 ){ iOut = i; if( nName==nArg ){ nOut = 1; break; } nOut++; } i++; } if( nOut!=1 ){ argError(aData, zType, sz, zArg); }else{ *piOut = iOut; } return (nOut!=1); } struct timeval zero_time; void testTimeInit(void){ gettimeofday(&zero_time, 0); } int testTimeGet(void){ struct timeval now; gettimeofday(&now, 0); return (((int)now.tv_sec - (int)zero_time.tv_sec)*1000) + (((int)now.tv_usec - (int)zero_time.tv_usec)/1000); } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm-test/lsmtest_win32.c ================================================ #include "lsmtest.h" #ifdef _WIN32 #define TICKS_PER_SECOND (10000000) #define TICKS_PER_MICROSECOND (10) #define TICKS_UNIX_EPOCH (116444736000000000LL) int win32GetTimeOfDay( struct timeval *tp, void *tzp ){ FILETIME fileTime; ULONGLONG ticks; ULONGLONG unixTicks; unused_parameter(tzp); memset(&fileTime, 0, sizeof(FILETIME)); GetSystemTimeAsFileTime(&fileTime); ticks = (ULONGLONG)fileTime.dwHighDateTime << 32; ticks |= (ULONGLONG)fileTime.dwLowDateTime; unixTicks = ticks - TICKS_UNIX_EPOCH; tp->tv_sec = (long)(unixTicks / TICKS_PER_SECOND); unixTicks -= ((ULONGLONG)tp->tv_sec * TICKS_PER_SECOND); tp->tv_usec = (long)(unixTicks / TICKS_PER_MICROSECOND); return 0; } #endif ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm.h ================================================ /* ** 2011-08-10 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** This file defines the LSM API. */ #ifndef _LSM_H #define _LSM_H #include #ifdef __cplusplus extern "C" { #endif /* ** Opaque handle types. */ typedef struct lsm_compress lsm_compress; /* Compression library functions */ typedef struct lsm_compress_factory lsm_compress_factory; typedef struct lsm_cursor lsm_cursor; /* Database cursor handle */ typedef struct lsm_db lsm_db; /* Database connection handle */ typedef struct lsm_env lsm_env; /* Runtime environment */ typedef struct lsm_file lsm_file; /* OS file handle */ typedef struct lsm_mutex lsm_mutex; /* Mutex handle */ /* 64-bit integer type used for file offsets. */ typedef long long int lsm_i64; /* 64-bit signed integer type */ /* Candidate values for the 3rd argument to lsm_env.xLock() */ #define LSM_LOCK_UNLOCK 0 #define LSM_LOCK_SHARED 1 #define LSM_LOCK_EXCL 2 /* Flags for lsm_env.xOpen() */ #define LSM_OPEN_READONLY 0x0001 /* ** CAPI: Database Runtime Environment ** ** Run-time environment used by LSM */ struct lsm_env { int nByte; /* Size of this structure in bytes */ int iVersion; /* Version number of this structure (1) */ /****** file i/o ***********************************************/ void *pVfsCtx; int (*xFullpath)(lsm_env*, const char *, char *, int *); int (*xOpen)(lsm_env*, const char *, int flags, lsm_file **); int (*xRead)(lsm_file *, lsm_i64, void *, int); int (*xWrite)(lsm_file *, lsm_i64, void *, int); int (*xTruncate)(lsm_file *, lsm_i64); int (*xSync)(lsm_file *); int (*xSectorSize)(lsm_file *); int (*xRemap)(lsm_file *, lsm_i64, void **, lsm_i64*); int (*xFileid)(lsm_file *, void *pBuf, int *pnBuf); int (*xClose)(lsm_file *); int (*xUnlink)(lsm_env*, const char *); int (*xLock)(lsm_file*, int, int); int (*xTestLock)(lsm_file*, int, int, int); int (*xShmMap)(lsm_file*, int, int, void **); void (*xShmBarrier)(void); int (*xShmUnmap)(lsm_file*, int); /****** memory allocation ****************************************/ void *pMemCtx; void *(*xMalloc)(lsm_env*, size_t); /* malloc(3) function */ void *(*xRealloc)(lsm_env*, void *, size_t); /* realloc(3) function */ void (*xFree)(lsm_env*, void *); /* free(3) function */ size_t (*xSize)(lsm_env*, void *); /* xSize function */ /****** mutexes ****************************************************/ void *pMutexCtx; int (*xMutexStatic)(lsm_env*,int,lsm_mutex**); /* Obtain a static mutex */ int (*xMutexNew)(lsm_env*, lsm_mutex**); /* Get a new dynamic mutex */ void (*xMutexDel)(lsm_mutex *); /* Delete an allocated mutex */ void (*xMutexEnter)(lsm_mutex *); /* Grab a mutex */ int (*xMutexTry)(lsm_mutex *); /* Attempt to obtain a mutex */ void (*xMutexLeave)(lsm_mutex *); /* Leave a mutex */ int (*xMutexHeld)(lsm_mutex *); /* Return true if mutex is held */ int (*xMutexNotHeld)(lsm_mutex *); /* Return true if mutex not held */ /****** other ****************************************************/ int (*xSleep)(lsm_env*, int microseconds); /* New fields may be added in future releases, in which case the ** iVersion value will increase. */ }; /* ** Values that may be passed as the second argument to xMutexStatic. */ #define LSM_MUTEX_GLOBAL 1 #define LSM_MUTEX_HEAP 2 /* ** CAPI: LSM Error Codes */ #define LSM_OK 0 #define LSM_ERROR 1 #define LSM_BUSY 5 #define LSM_NOMEM 7 #define LSM_READONLY 8 #define LSM_IOERR 10 #define LSM_CORRUPT 11 #define LSM_FULL 13 #define LSM_CANTOPEN 14 #define LSM_PROTOCOL 15 #define LSM_MISUSE 21 #define LSM_MISMATCH 50 #define LSM_IOERR_NOENT (LSM_IOERR | (1<<8)) /* ** CAPI: Creating and Destroying Database Connection Handles ** ** Open and close a database connection handle. */ int lsm_new(lsm_env*, lsm_db **ppDb); int lsm_close(lsm_db *pDb); /* ** CAPI: Connecting to a Database */ int lsm_open(lsm_db *pDb, const char *zFilename); /* ** CAPI: Obtaining pointers to database environments ** ** Return a pointer to the environment used by the database connection ** passed as the first argument. Assuming the argument is valid, this ** function always returns a valid environment pointer - it cannot fail. */ lsm_env *lsm_get_env(lsm_db *pDb); /* ** The lsm_default_env() function returns a pointer to the default LSM ** environment for the current platform. */ lsm_env *lsm_default_env(void); /* ** CAPI: Configuring a database connection. ** ** The lsm_config() function is used to configure a database connection. */ int lsm_config(lsm_db *, int, ...); /* ** The following values may be passed as the second argument to lsm_config(). ** ** LSM_CONFIG_AUTOFLUSH: ** A read/write integer parameter. ** ** This value determines the amount of data allowed to accumulate in a ** live in-memory tree before it is marked as old. After committing a ** transaction, a connection checks if the size of the live in-memory tree, ** including data structure overhead, is greater than the value of this ** option in KB. If it is, and there is not already an old in-memory tree, ** the live in-memory tree is marked as old. ** ** The maximum allowable value is 1048576 (1GB). There is no minimum ** value. If this parameter is set to zero, then an attempt is made to ** mark the live in-memory tree as old after each transaction is committed. ** ** The default value is 1024 (1MB). ** ** LSM_CONFIG_PAGE_SIZE: ** A read/write integer parameter. This parameter may only be set before ** lsm_open() has been called. ** ** LSM_CONFIG_BLOCK_SIZE: ** A read/write integer parameter. ** ** This parameter may only be set before lsm_open() has been called. It ** must be set to a power of two between 64 and 65536, inclusive (block ** sizes between 64KB and 64MB). ** ** If the connection creates a new database, the block size of the new ** database is set to the value of this option in KB. After lsm_open() ** has been called, querying this parameter returns the actual block ** size of the opened database. ** ** The default value is 1024 (1MB blocks). ** ** LSM_CONFIG_SAFETY: ** A read/write integer parameter. Valid values are 0, 1 (the default) ** and 2. This parameter determines how robust the database is in the ** face of a system crash (e.g. a power failure or operating system ** crash). As follows: ** ** 0 (off): No robustness. A system crash may corrupt the database. ** ** 1 (normal): Some robustness. A system crash may not corrupt the ** database file, but recently committed transactions may ** be lost following recovery. ** ** 2 (full): Full robustness. A system crash may not corrupt the ** database file. Following recovery the database file ** contains all successfully committed transactions. ** ** LSM_CONFIG_AUTOWORK: ** A read/write integer parameter. ** ** LSM_CONFIG_AUTOCHECKPOINT: ** A read/write integer parameter. ** ** If this option is set to non-zero value N, then a checkpoint is ** automatically attempted after each N KB of data have been written to ** the database file. ** ** The amount of uncheckpointed data already written to the database file ** is a global parameter. After performing database work (writing to the ** database file), the process checks if the total amount of uncheckpointed ** data exceeds the value of this paramter. If so, a checkpoint is performed. ** This means that this option may cause the connection to perform a ** checkpoint even if the current connection has itself written very little ** data into the database file. ** ** The default value is 2048 (checkpoint every 2MB). ** ** LSM_CONFIG_MMAP: ** A read/write integer parameter. If this value is set to 0, then the ** database file is accessed using ordinary read/write IO functions. Or, ** if it is set to 1, then the database file is memory mapped and accessed ** that way. If this parameter is set to any value N greater than 1, then ** up to the first N KB of the file are memory mapped, and any remainder ** accessed using read/write IO. ** ** The default value is 1 on 64-bit platforms and 32768 on 32-bit platforms. ** ** ** LSM_CONFIG_USE_LOG: ** A read/write boolean parameter. True (the default) to use the log ** file normally. False otherwise. ** ** LSM_CONFIG_AUTOMERGE: ** A read/write integer parameter. The minimum number of segments to ** merge together at a time. Default value 4. ** ** LSM_CONFIG_MAX_FREELIST: ** A read/write integer parameter. The maximum number of free-list ** entries that are stored in a database checkpoint (the others are ** stored elsewhere in the database). ** ** There is no reason for an application to configure or query this ** parameter. It is only present because configuring a small value ** makes certain parts of the lsm code easier to test. ** ** LSM_CONFIG_MULTIPLE_PROCESSES: ** A read/write boolean parameter. This parameter may only be set before ** lsm_open() has been called. If true, the library uses shared-memory ** and posix advisory locks to co-ordinate access by clients from within ** multiple processes. Otherwise, if false, all database clients must be ** located in the same process. The default value is true. ** ** LSM_CONFIG_SET_COMPRESSION: ** Set the compression methods used to compress and decompress database ** content. The argument to this option should be a pointer to a structure ** of type lsm_compress. The lsm_config() method takes a copy of the ** structures contents. ** ** This option may only be used before lsm_open() is called. Invoking it ** after lsm_open() has been called results in an LSM_MISUSE error. ** ** LSM_CONFIG_GET_COMPRESSION: ** Query the compression methods used to compress and decompress database ** content. ** ** LSM_CONFIG_SET_COMPRESSION_FACTORY: ** Configure a factory method to be invoked in case of an LSM_MISMATCH ** error. ** ** LSM_CONFIG_READONLY: ** A read/write boolean parameter. This parameter may only be set before ** lsm_open() is called. */ #define LSM_CONFIG_AUTOFLUSH 1 #define LSM_CONFIG_PAGE_SIZE 2 #define LSM_CONFIG_SAFETY 3 #define LSM_CONFIG_BLOCK_SIZE 4 #define LSM_CONFIG_AUTOWORK 5 #define LSM_CONFIG_MMAP 7 #define LSM_CONFIG_USE_LOG 8 #define LSM_CONFIG_AUTOMERGE 9 #define LSM_CONFIG_MAX_FREELIST 10 #define LSM_CONFIG_MULTIPLE_PROCESSES 11 #define LSM_CONFIG_AUTOCHECKPOINT 12 #define LSM_CONFIG_SET_COMPRESSION 13 #define LSM_CONFIG_GET_COMPRESSION 14 #define LSM_CONFIG_SET_COMPRESSION_FACTORY 15 #define LSM_CONFIG_READONLY 16 #define LSM_SAFETY_OFF 0 #define LSM_SAFETY_NORMAL 1 #define LSM_SAFETY_FULL 2 /* ** CAPI: Compression and/or Encryption Hooks */ struct lsm_compress { void *pCtx; unsigned int iId; int (*xBound)(void *, int nSrc); int (*xCompress)(void *, char *, int *, const char *, int); int (*xUncompress)(void *, char *, int *, const char *, int); void (*xFree)(void *pCtx); }; struct lsm_compress_factory { void *pCtx; int (*xFactory)(void *, lsm_db *, unsigned int); void (*xFree)(void *pCtx); }; #define LSM_COMPRESSION_EMPTY 0 #define LSM_COMPRESSION_NONE 1 /* ** CAPI: Allocating and Freeing Memory ** ** Invoke the memory allocation functions that belong to environment ** pEnv. Or the system defaults if no memory allocation functions have ** been registered. */ void *lsm_malloc(lsm_env*, size_t); void *lsm_realloc(lsm_env*, void *, size_t); void lsm_free(lsm_env*, void *); /* ** CAPI: Querying a Connection For Operational Data ** ** Query a database connection for operational statistics or data. */ int lsm_info(lsm_db *, int, ...); int lsm_get_user_version(lsm_db *, unsigned int *); int lsm_set_user_version(lsm_db *, unsigned int); /* ** The following values may be passed as the second argument to lsm_info(). ** ** LSM_INFO_NWRITE: ** The third parameter should be of type (int *). The location pointed ** to by the third parameter is set to the number of 4KB pages written to ** the database file during the lifetime of this connection. ** ** LSM_INFO_NREAD: ** The third parameter should be of type (int *). The location pointed ** to by the third parameter is set to the number of 4KB pages read from ** the database file during the lifetime of this connection. ** ** LSM_INFO_DB_STRUCTURE: ** The third argument should be of type (char **). The location pointed ** to is populated with a pointer to a nul-terminated string containing ** the string representation of a Tcl data-structure reflecting the ** current structure of the database file. Specifically, the current state ** of the worker snapshot. The returned string should be eventually freed ** by the caller using lsm_free(). ** ** The returned list contains one element for each level in the database, ** in order from most to least recent. Each element contains a ** single element for each segment comprising the corresponding level, ** starting with the lhs segment, then each of the rhs segments (if any) ** in order from most to least recent. ** ** Each segment element is itself a list of 4 integer values, as follows: ** **
  1. First page of segment **
  2. Last page of segment **
  3. Root page of segment (if applicable) **
  4. Total number of pages in segment **
** ** LSM_INFO_ARRAY_STRUCTURE: ** There should be two arguments passed following this option (i.e. a ** total of four arguments passed to lsm_info()). The first argument ** should be the page number of the first page in a database array ** (perhaps obtained from an earlier INFO_DB_STRUCTURE call). The second ** trailing argument should be of type (char **). The location pointed ** to is populated with a pointer to a nul-terminated string that must ** be eventually freed using lsm_free() by the caller. ** ** The output string contains the text representation of a Tcl list of ** integers. Each pair of integers represent a range of pages used by ** the identified array. For example, if the array occupies database ** pages 993 to 1024, then pages 2048 to 2777, then the returned string ** will be "993 1024 2048 2777". ** ** If the specified integer argument does not correspond to the first ** page of any database array, LSM_ERROR is returned and the output ** pointer is set to a NULL value. ** ** LSM_INFO_LOG_STRUCTURE: ** The third argument should be of type (char **). The location pointed ** to is populated with a pointer to a nul-terminated string containing ** the string representation of a Tcl data-structure. The returned ** string should be eventually freed by the caller using lsm_free(). ** ** The Tcl structure returned is a list of six integers that describe ** the current structure of the log file. ** ** LSM_INFO_ARRAY_PAGES: ** ** LSM_INFO_PAGE_ASCII_DUMP: ** As with LSM_INFO_ARRAY_STRUCTURE, there should be two arguments passed ** with calls that specify this option - an integer page number and a ** (char **) used to return a nul-terminated string that must be later ** freed using lsm_free(). In this case the output string is populated ** with a human-readable description of the page content. ** ** If the page cannot be decoded, it is not an error. In this case the ** human-readable output message will report the systems failure to ** interpret the page data. ** ** LSM_INFO_PAGE_HEX_DUMP: ** This argument is similar to PAGE_ASCII_DUMP, except that keys and ** values are represented using hexadecimal notation instead of ascii. ** ** LSM_INFO_FREELIST: ** The third argument should be of type (char **). The location pointed ** to is populated with a pointer to a nul-terminated string containing ** the string representation of a Tcl data-structure. The returned ** string should be eventually freed by the caller using lsm_free(). ** ** The Tcl structure returned is a list containing one element for each ** free block in the database. The element itself consists of two ** integers - the block number and the id of the snapshot that freed it. ** ** LSM_INFO_CHECKPOINT_SIZE: ** The third argument should be of type (int *). The location pointed to ** by this argument is populated with the number of KB written to the ** database file since the most recent checkpoint. ** ** LSM_INFO_TREE_SIZE: ** If this value is passed as the second argument to an lsm_info() call, it ** should be followed by two arguments of type (int *) (for a total of four ** arguments). ** ** At any time, there are either one or two tree structures held in shared ** memory that new database clients will access (there may also be additional ** tree structures being used by older clients - this API does not provide ** information on them). One tree structure - the current tree - is used to ** accumulate new data written to the database. The other tree structure - ** the old tree - is a read-only tree holding older data and may be flushed ** to disk at any time. ** ** Assuming no error occurs, the location pointed to by the first of the two ** (int *) arguments is set to the size of the old in-memory tree in KB. ** The second is set to the size of the current, or live in-memory tree. ** ** LSM_INFO_COMPRESSION_ID: ** This value should be followed by a single argument of type ** (unsigned int *). If successful, the location pointed to is populated ** with the database compression id before returning. */ #define LSM_INFO_NWRITE 1 #define LSM_INFO_NREAD 2 #define LSM_INFO_DB_STRUCTURE 3 #define LSM_INFO_LOG_STRUCTURE 4 #define LSM_INFO_ARRAY_STRUCTURE 5 #define LSM_INFO_PAGE_ASCII_DUMP 6 #define LSM_INFO_PAGE_HEX_DUMP 7 #define LSM_INFO_FREELIST 8 #define LSM_INFO_ARRAY_PAGES 9 #define LSM_INFO_CHECKPOINT_SIZE 10 #define LSM_INFO_TREE_SIZE 11 #define LSM_INFO_FREELIST_SIZE 12 #define LSM_INFO_COMPRESSION_ID 13 /* ** CAPI: Opening and Closing Write Transactions ** ** These functions are used to open and close transactions and nested ** sub-transactions. ** ** The lsm_begin() function is used to open transactions and sub-transactions. ** A successful call to lsm_begin() ensures that there are at least iLevel ** nested transactions open. To open a top-level transaction, pass iLevel=1. ** To open a sub-transaction within the top-level transaction, iLevel=2. ** Passing iLevel=0 is a no-op. ** ** lsm_commit() is used to commit transactions and sub-transactions. A ** successful call to lsm_commit() ensures that there are at most iLevel ** nested transactions open. To commit a top-level transaction, pass iLevel=0. ** To commit all sub-transactions inside the main transaction, pass iLevel=1. ** ** Function lsm_rollback() is used to roll back transactions and ** sub-transactions. A successful call to lsm_rollback() restores the database ** to the state it was in when the iLevel'th nested sub-transaction (if any) ** was first opened. And then closes transactions to ensure that there are ** at most iLevel nested transactions open. Passing iLevel=0 rolls back and ** closes the top-level transaction. iLevel=1 also rolls back the top-level ** transaction, but leaves it open. iLevel=2 rolls back the sub-transaction ** nested directly inside the top-level transaction (and leaves it open). */ int lsm_begin(lsm_db *pDb, int iLevel); int lsm_commit(lsm_db *pDb, int iLevel); int lsm_rollback(lsm_db *pDb, int iLevel); /* ** CAPI: Writing to a Database ** ** Write a new value into the database. If a value with a duplicate key ** already exists it is replaced. */ int lsm_insert(lsm_db*, const void *pKey, int nKey, const void *pVal, int nVal); /* ** Delete a value from the database. No error is returned if the specified ** key value does not exist in the database. */ int lsm_delete(lsm_db *, const void *pKey, int nKey); /* ** Delete all database entries with keys that are greater than (pKey1/nKey1) ** and smaller than (pKey2/nKey2). Note that keys (pKey1/nKey1) and ** (pKey2/nKey2) themselves, if they exist in the database, are not deleted. ** ** Return LSM_OK if successful, or an LSM error code otherwise. */ int lsm_delete_range(lsm_db *, const void *pKey1, int nKey1, const void *pKey2, int nKey2 ); /* ** CAPI: Explicit Database Work and Checkpointing ** ** This function is called by a thread to work on the database structure. */ int lsm_work(lsm_db *pDb, int nMerge, int nKB, int *pnWrite); int lsm_flush(lsm_db *pDb); /* ** Attempt to checkpoint the current database snapshot. Return an LSM ** error code if an error occurs or LSM_OK otherwise. ** ** If the current snapshot has already been checkpointed, calling this ** function is a no-op. In this case if pnKB is not NULL, *pnKB is ** set to 0. Or, if the current snapshot is successfully checkpointed ** by this function and pbKB is not NULL, *pnKB is set to the number ** of bytes written to the database file since the previous checkpoint ** (the same measure as returned by the LSM_INFO_CHECKPOINT_SIZE query). */ int lsm_checkpoint(lsm_db *pDb, int *pnKB); /* ** CAPI: Opening and Closing Database Cursors ** ** Open and close a database cursor. */ int lsm_csr_open(lsm_db *pDb, lsm_cursor **ppCsr); int lsm_csr_close(lsm_cursor *pCsr); /* ** CAPI: Positioning Database Cursors ** ** If the fourth parameter is LSM_SEEK_EQ, LSM_SEEK_GE or LSM_SEEK_LE, ** this function searches the database for an entry with key (pKey/nKey). ** If an error occurs, an LSM error code is returned. Otherwise, LSM_OK. ** ** If no error occurs and the requested key is present in the database, the ** cursor is left pointing to the entry with the specified key. Or, if the ** specified key is not present in the database the state of the cursor ** depends on the value passed as the final parameter, as follows: ** ** LSM_SEEK_EQ: ** The cursor is left at EOF (invalidated). A call to lsm_csr_valid() ** returns non-zero. ** ** LSM_SEEK_LE: ** The cursor is left pointing to the largest key in the database that ** is smaller than (pKey/nKey). If the database contains no keys smaller ** than (pKey/nKey), the cursor is left at EOF. ** ** LSM_SEEK_GE: ** The cursor is left pointing to the smallest key in the database that ** is larger than (pKey/nKey). If the database contains no keys larger ** than (pKey/nKey), the cursor is left at EOF. ** ** If the fourth parameter is LSM_SEEK_LEFAST, this function searches the ** database in a similar manner to LSM_SEEK_LE, with two differences: ** **
  1. Even if a key can be found (the cursor is not left at EOF), the ** lsm_csr_value() function may not be used (attempts to do so return ** LSM_MISUSE). ** **
  2. The key that the cursor is left pointing to may be one that has ** been recently deleted from the database. In this case it is ** guaranteed that the returned key is larger than any key currently ** in the database that is less than or equal to (pKey/nKey). **
** ** LSM_SEEK_LEFAST requests are intended to be used to allocate database ** keys. */ int lsm_csr_seek(lsm_cursor *pCsr, const void *pKey, int nKey, int eSeek); int lsm_csr_first(lsm_cursor *pCsr); int lsm_csr_last(lsm_cursor *pCsr); /* ** Advance the specified cursor to the next or previous key in the database. ** Return LSM_OK if successful, or an LSM error code otherwise. ** ** Functions lsm_csr_seek(), lsm_csr_first() and lsm_csr_last() are "seek" ** functions. Whether or not lsm_csr_next and lsm_csr_prev may be called ** successfully also depends on the most recent seek function called on ** the cursor. Specifically: ** **
    **
  • At least one seek function must have been called on the cursor. **
  • To call lsm_csr_next(), the most recent call to a seek function must ** have been either lsm_csr_first() or a call to lsm_csr_seek() specifying ** LSM_SEEK_GE. **
  • To call lsm_csr_prev(), the most recent call to a seek function must ** have been either lsm_csr_last() or a call to lsm_csr_seek() specifying ** LSM_SEEK_LE. **
** ** Otherwise, if the above conditions are not met when lsm_csr_next or ** lsm_csr_prev is called, LSM_MISUSE is returned and the cursor position ** remains unchanged. */ int lsm_csr_next(lsm_cursor *pCsr); int lsm_csr_prev(lsm_cursor *pCsr); /* ** Values that may be passed as the fourth argument to lsm_csr_seek(). */ #define LSM_SEEK_LEFAST -2 #define LSM_SEEK_LE -1 #define LSM_SEEK_EQ 0 #define LSM_SEEK_GE 1 /* ** CAPI: Extracting Data From Database Cursors ** ** Retrieve data from a database cursor. */ int lsm_csr_valid(lsm_cursor *pCsr); int lsm_csr_key(lsm_cursor *pCsr, const void **ppKey, int *pnKey); int lsm_csr_value(lsm_cursor *pCsr, const void **ppVal, int *pnVal); /* ** If no error occurs, this function compares the database key passed via ** the pKey/nKey arguments with the key that the cursor passed as the first ** argument currently points to. If the cursors key is less than, equal to ** or greater than pKey/nKey, *piRes is set to less than, equal to or greater ** than zero before returning. LSM_OK is returned in this case. ** ** Or, if an error occurs, an LSM error code is returned and the final ** value of *piRes is undefined. If the cursor does not point to a valid ** key when this function is called, LSM_MISUSE is returned. */ int lsm_csr_cmp(lsm_cursor *pCsr, const void *pKey, int nKey, int *piRes); /* ** CAPI: Change these!! ** ** Configure a callback to which debugging and other messages should ** be directed. Only useful for debugging lsm. */ void lsm_config_log(lsm_db *, void (*)(void *, int, const char *), void *); /* ** Configure a callback that is invoked if the database connection ever ** writes to the database file. */ void lsm_config_work_hook(lsm_db *, void (*)(lsm_db *, void *), void *); /* ENDOFAPI */ #ifdef __cplusplus } /* End of the 'extern "C"' block */ #endif #endif /* ifndef _LSM_H */ ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsmInt.h ================================================ /* ** 2011-08-18 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Internal structure definitions for the LSM module. */ #ifndef _LSM_INT_H #define _LSM_INT_H #include "lsm.h" #include #include #include #include #include #include #ifdef _WIN32 # ifdef _MSC_VER # define snprintf _snprintf # endif #else # include #endif #ifdef NDEBUG # ifdef LSM_DEBUG_EXPENSIVE # undef LSM_DEBUG_EXPENSIVE # endif # ifdef LSM_DEBUG # undef LSM_DEBUG # endif #else # ifndef LSM_DEBUG # define LSM_DEBUG # endif #endif /* ** Default values for various data structure parameters. These may be ** overridden by calls to lsm_config(). */ #define LSM_DFLT_PAGE_SIZE (4 * 1024) #define LSM_DFLT_BLOCK_SIZE (1 * 1024 * 1024) #define LSM_DFLT_AUTOFLUSH (1 * 1024 * 1024) #define LSM_DFLT_AUTOCHECKPOINT (i64)(2 * 1024 * 1024) #define LSM_DFLT_AUTOWORK 1 #define LSM_DFLT_LOG_SIZE (128*1024) #define LSM_DFLT_AUTOMERGE 4 #define LSM_DFLT_SAFETY LSM_SAFETY_NORMAL #define LSM_DFLT_MMAP (LSM_IS_64_BIT ? 1 : 32768) #define LSM_DFLT_MULTIPLE_PROCESSES 1 #define LSM_DFLT_USE_LOG 1 /* Initial values for log file checksums. These are only used if the ** database file does not contain a valid checkpoint. */ #define LSM_CKSUM0_INIT 42 #define LSM_CKSUM1_INIT 42 /* "mmap" mode is currently only used in environments with 64-bit address ** spaces. The following macro is used to test for this. */ #define LSM_IS_64_BIT (sizeof(void*)==8) #define LSM_AUTOWORK_QUANT 32 typedef struct Database Database; typedef struct DbLog DbLog; typedef struct FileSystem FileSystem; typedef struct Freelist Freelist; typedef struct FreelistEntry FreelistEntry; typedef struct Level Level; typedef struct LogMark LogMark; typedef struct LogRegion LogRegion; typedef struct LogWriter LogWriter; typedef struct LsmString LsmString; typedef struct Mempool Mempool; typedef struct Merge Merge; typedef struct MergeInput MergeInput; typedef struct MetaPage MetaPage; typedef struct MultiCursor MultiCursor; typedef struct Page Page; typedef struct Redirect Redirect; typedef struct Segment Segment; typedef struct SegmentMerger SegmentMerger; typedef struct ShmChunk ShmChunk; typedef struct ShmHeader ShmHeader; typedef struct ShmReader ShmReader; typedef struct Snapshot Snapshot; typedef struct TransMark TransMark; typedef struct Tree Tree; typedef struct TreeCursor TreeCursor; typedef struct TreeHeader TreeHeader; typedef struct TreeMark TreeMark; typedef struct TreeRoot TreeRoot; #ifndef _SQLITEINT_H_ typedef unsigned char u8; typedef unsigned short int u16; typedef unsigned int u32; typedef lsm_i64 i64; typedef unsigned long long int u64; #endif /* A page number is a 64-bit integer. */ typedef i64 Pgno; #ifdef LSM_DEBUG int lsmErrorBkpt(int); #else # define lsmErrorBkpt(x) (x) #endif #define LSM_PROTOCOL_BKPT lsmErrorBkpt(LSM_PROTOCOL) #define LSM_IOERR_BKPT lsmErrorBkpt(LSM_IOERR) #define LSM_NOMEM_BKPT lsmErrorBkpt(LSM_NOMEM) #define LSM_CORRUPT_BKPT lsmErrorBkpt(LSM_CORRUPT) #define LSM_MISUSE_BKPT lsmErrorBkpt(LSM_MISUSE) #define unused_parameter(x) (void)(x) #define array_size(x) (sizeof(x)/sizeof(x[0])) /* The size of each shared-memory chunk */ #define LSM_SHM_CHUNK_SIZE (32*1024) /* The number of bytes reserved at the start of each shm chunk for MM. */ #define LSM_SHM_CHUNK_HDR (sizeof(ShmChunk)) /* The number of available read locks. */ #define LSM_LOCK_NREADER 6 /* The number of available read-write client locks. */ #define LSM_LOCK_NRWCLIENT 16 /* Lock definitions. */ #define LSM_LOCK_DMS1 1 /* Serialize connect/disconnect ops */ #define LSM_LOCK_DMS2 2 /* Read-write connections */ #define LSM_LOCK_DMS3 3 /* Read-only connections */ #define LSM_LOCK_WRITER 4 #define LSM_LOCK_WORKER 5 #define LSM_LOCK_CHECKPOINTER 6 #define LSM_LOCK_ROTRANS 7 #define LSM_LOCK_READER(i) ((i) + LSM_LOCK_ROTRANS + 1) #define LSM_LOCK_RWCLIENT(i) ((i) + LSM_LOCK_READER(LSM_LOCK_NREADER)) #define LSM_N_LOCK LSM_LOCK_RWCLIENT(LSM_LOCK_NRWCLIENT) /* ** Meta-page size and usable size. */ #define LSM_META_PAGE_SIZE 4096 #define LSM_META_RW_PAGE_SIZE (LSM_META_PAGE_SIZE - LSM_N_LOCK) /* ** Hard limit on the number of free-list entries that may be stored in ** a checkpoint (the remainder are stored as a system record in the LSM). ** See also LSM_CONFIG_MAX_FREELIST. */ #define LSM_MAX_FREELIST_ENTRIES 24 #define LSM_MAX_BLOCK_REDIRECTS 16 #define LSM_ATTEMPTS_BEFORE_PROTOCOL 10000 /* ** Each entry stored in the LSM (or in-memory tree structure) has an ** associated mask of the following flags. */ #define LSM_START_DELETE 0x01 /* Start of open-ended delete range */ #define LSM_END_DELETE 0x02 /* End of open-ended delete range */ #define LSM_POINT_DELETE 0x04 /* Delete this key */ #define LSM_INSERT 0x08 /* Insert this key and value */ #define LSM_SEPARATOR 0x10 /* True if entry is separator key only */ #define LSM_SYSTEMKEY 0x20 /* True if entry is a system key (FREELIST) */ #define LSM_CONTIGUOUS 0x40 /* Used in lsm_tree.c */ /* ** A string that can grow by appending. */ struct LsmString { lsm_env *pEnv; /* Run-time environment */ int n; /* Size of string. -1 indicates error */ int nAlloc; /* Space allocated for z[] */ char *z; /* The string content */ }; typedef struct LsmFile LsmFile; struct LsmFile { lsm_file *pFile; LsmFile *pNext; }; /* ** An instance of the following type is used to store an ordered list of ** u32 values. ** ** Note: This is a place-holder implementation. It should be replaced by ** a version that avoids making a single large allocation when the array ** contains a large number of values. For this reason, the internals of ** this object should only manipulated by the intArrayXXX() functions in ** lsm_tree.c. */ typedef struct IntArray IntArray; struct IntArray { int nAlloc; int nArray; u32 *aArray; }; struct Redirect { int n; /* Number of redirects */ struct RedirectEntry { int iFrom; int iTo; } *a; }; /* ** An instance of this structure represents a point in the history of the ** tree structure to roll back to. Refer to comments in lsm_tree.c for ** details. */ struct TreeMark { u32 iRoot; /* Offset of root node in shm file */ u32 nHeight; /* Current height of tree structure */ u32 iWrite; /* Write offset in shm file */ u32 nChunk; /* Number of chunks in shared-memory file */ u32 iFirst; /* First chunk in linked list */ u32 iNextShmid; /* Next id to allocate */ int iRollback; /* Index in lsm->rollback to revert to */ }; /* ** An instance of this structure represents a point in the database log. */ struct LogMark { i64 iOff; /* Offset into log (see lsm_log.c) */ int nBuf; /* Size of in-memory buffer here */ u8 aBuf[8]; /* Bytes of content in aBuf[] */ u32 cksum0; /* Checksum 0 at offset (iOff-nBuf) */ u32 cksum1; /* Checksum 1 at offset (iOff-nBuf) */ }; struct TransMark { TreeMark tree; LogMark log; }; /* ** A structure that defines the start and end offsets of a region in the ** log file. The size of the region in bytes is (iEnd - iStart), so if ** iEnd==iStart the region is zero bytes in size. */ struct LogRegion { i64 iStart; /* Start of region in log file */ i64 iEnd; /* End of region in log file */ }; struct DbLog { u32 cksum0; /* Checksum 0 at offset iOff */ u32 cksum1; /* Checksum 1 at offset iOff */ i64 iSnapshotId; /* Log space has been reclaimed to this ss */ LogRegion aRegion[3]; /* Log file regions (see docs in lsm_log.c) */ }; struct TreeRoot { u32 iRoot; u32 nHeight; u32 nByte; /* Total size of this tree in bytes */ u32 iTransId; }; /* ** Tree header structure. */ struct TreeHeader { u32 iUsedShmid; /* Id of first shm chunk used by this tree */ u32 iNextShmid; /* Shm-id of next chunk allocated */ u32 iFirst; /* Chunk number of smallest shm-id */ u32 nChunk; /* Number of chunks in shared-memory file */ TreeRoot root; /* Root and height of current tree */ u32 iWrite; /* Write offset in shm file */ TreeRoot oldroot; /* Root and height of the previous tree */ u32 iOldShmid; /* Last shm-id used by previous tree */ u32 iUsrVersion; /* get/set_user_version() value */ i64 iOldLog; /* Log offset associated with old tree */ u32 oldcksum0; u32 oldcksum1; DbLog log; /* Current layout of log file */ u32 aCksum[2]; /* Checksums 1 and 2. */ }; /* ** Database handle structure. ** ** mLock: ** A bitmask representing the locks currently held by the connection. ** An LSM database supports N distinct locks, where N is some number less ** than or equal to 32. Locks are numbered starting from 1 (see the ** definitions for LSM_LOCK_WRITER and co.). ** ** The least significant 32-bits in mLock represent EXCLUSIVE locks. The ** most significant are SHARED locks. So, if a connection holds a SHARED ** lock on lock region iLock, then the following is true: ** ** (mLock & ((iLock+32-1) << 1)) ** ** Or for an EXCLUSIVE lock: ** ** (mLock & ((iLock-1) << 1)) ** ** pCsr: ** Points to the head of a linked list that contains all currently open ** cursors. Once this list becomes empty, the user has no outstanding ** cursors and the database handle can be successfully closed. ** ** pCsrCache: ** This list contains cursor objects that have been closed using ** lsm_csr_close(). Each time a cursor is closed, it is shifted from ** the pCsr list to this list. When a new cursor is opened, this list ** is inspected to see if there exists a cursor object that can be ** reused. This is an optimization only. */ struct lsm_db { /* Database handle configuration */ lsm_env *pEnv; /* runtime environment */ int (*xCmp)(void *, int, void *, int); /* Compare function */ /* Values configured by calls to lsm_config */ int eSafety; /* LSM_SAFETY_OFF, NORMAL or FULL */ int bAutowork; /* Configured by LSM_CONFIG_AUTOWORK */ int nTreeLimit; /* Configured by LSM_CONFIG_AUTOFLUSH */ int nMerge; /* Configured by LSM_CONFIG_AUTOMERGE */ int bUseLog; /* Configured by LSM_CONFIG_USE_LOG */ int nDfltPgsz; /* Configured by LSM_CONFIG_PAGE_SIZE */ int nDfltBlksz; /* Configured by LSM_CONFIG_BLOCK_SIZE */ int nMaxFreelist; /* Configured by LSM_CONFIG_MAX_FREELIST */ int iMmap; /* Configured by LSM_CONFIG_MMAP */ i64 nAutockpt; /* Configured by LSM_CONFIG_AUTOCHECKPOINT */ int bMultiProc; /* Configured by L_C_MULTIPLE_PROCESSES */ int bReadonly; /* Configured by LSM_CONFIG_READONLY */ lsm_compress compress; /* Compression callbacks */ lsm_compress_factory factory; /* Compression callback factory */ /* Sub-system handles */ FileSystem *pFS; /* On-disk portion of database */ Database *pDatabase; /* Database shared data */ int iRwclient; /* Read-write client lock held (-1 == none) */ /* Client transaction context */ Snapshot *pClient; /* Client snapshot */ int iReader; /* Read lock held (-1 == unlocked) */ int bRoTrans; /* True if a read-only db trans is open */ MultiCursor *pCsr; /* List of all open cursors */ LogWriter *pLogWriter; /* Context for writing to the log file */ int nTransOpen; /* Number of opened write transactions */ int nTransAlloc; /* Allocated size of aTrans[] array */ TransMark *aTrans; /* Array of marks for transaction rollback */ IntArray rollback; /* List of tree-nodes to roll back */ int bDiscardOld; /* True if lsmTreeDiscardOld() was called */ MultiCursor *pCsrCache; /* List of all closed cursors */ /* Worker context */ Snapshot *pWorker; /* Worker snapshot (or NULL) */ Freelist *pFreelist; /* See sortedNewToplevel() */ int bUseFreelist; /* True to use pFreelist */ int bIncrMerge; /* True if currently doing a merge */ int bInFactory; /* True if within factory.xFactory() */ /* Debugging message callback */ void (*xLog)(void *, int, const char *); void *pLogCtx; /* Work done notification callback */ void (*xWork)(lsm_db *, void *); void *pWorkCtx; u64 mLock; /* Mask of current locks. See lsmShmLock(). */ lsm_db *pNext; /* Next connection to same database */ int nShm; /* Size of apShm[] array */ void **apShm; /* Shared memory chunks */ ShmHeader *pShmhdr; /* Live shared-memory header */ TreeHeader treehdr; /* Local copy of tree-header */ u32 aSnapshot[LSM_META_PAGE_SIZE / sizeof(u32)]; }; struct Segment { Pgno iFirst; /* First page of this run */ Pgno iLastPg; /* Last page of this run */ Pgno iRoot; /* Root page number (if any) */ int nSize; /* Size of this run in pages */ Redirect *pRedirect; /* Block redirects (or NULL) */ }; /* ** iSplitTopic/pSplitKey/nSplitKey: ** If nRight>0, this buffer contains a copy of the largest key that has ** already been written to the left-hand-side of the level. */ struct Level { Segment lhs; /* Left-hand (main) segment */ int nRight; /* Size of apRight[] array */ Segment *aRhs; /* Old segments being merged into this */ int iSplitTopic; /* Split key topic (if nRight>0) */ void *pSplitKey; /* Pointer to split-key (if nRight>0) */ int nSplitKey; /* Number of bytes in split-key */ u16 iAge; /* Number of times data has been written */ u16 flags; /* Mask of LEVEL_XXX bits */ Merge *pMerge; /* Merge operation currently underway */ Level *pNext; /* Next level in tree */ }; /* ** The Level.flags field is set to a combination of the following bits. ** ** LEVEL_FREELIST_ONLY: ** Set if the level consists entirely of free-list entries. ** ** LEVEL_INCOMPLETE: ** This is set while a new toplevel level is being constructed. It is ** never set for any level other than a new toplevel. */ #define LEVEL_FREELIST_ONLY 0x0001 #define LEVEL_INCOMPLETE 0x0002 /* ** A structure describing an ongoing merge. There is an instance of this ** structure for every Level currently undergoing a merge in the worker ** snapshot. ** ** It is assumed that code that uses an instance of this structure has ** access to the associated Level struct. ** ** iOutputOff: ** The byte offset to write to next within the last page of the ** output segment. */ struct MergeInput { Pgno iPg; /* Page on which next input is stored */ int iCell; /* Cell containing next input to merge */ }; struct Merge { int nInput; /* Number of input runs being merged */ MergeInput *aInput; /* Array nInput entries in size */ MergeInput splitkey; /* Location in file of current splitkey */ int nSkip; /* Number of separators entries to skip */ int iOutputOff; /* Write offset on output page */ Pgno iCurrentPtr; /* Current pointer value */ }; /* ** The first argument to this macro is a pointer to a Segment structure. ** Returns true if the structure instance indicates that the separators ** array is valid. */ #define segmentHasSeparators(pSegment) ((pSegment)->sep.iFirst>0) /* ** The values that accompany the lock held by a database reader. */ struct ShmReader { u32 iTreeId; i64 iLsmId; }; /* ** An instance of this structure is stored in the first shared-memory ** page. The shared-memory header. ** ** bWriter: ** Immediately after opening a write transaction taking the WRITER lock, ** each writer client sets this flag. It is cleared right before the ** WRITER lock is relinquished. If a subsequent writer finds that this ** flag is already set when a write transaction is opened, this indicates ** that a previous writer failed mid-transaction. ** ** iMetaPage: ** If the database file does not contain a valid, synced, checkpoint, this ** value is set to 0. Otherwise, it is set to the meta-page number that ** contains the most recently written checkpoint (either 1 or 2). ** ** hdr1, hdr2: ** The two copies of the in-memory tree header. Two copies are required ** in case a writer fails while updating one of them. */ struct ShmHeader { u32 aSnap1[LSM_META_PAGE_SIZE / 4]; u32 aSnap2[LSM_META_PAGE_SIZE / 4]; u32 bWriter; u32 iMetaPage; TreeHeader hdr1; TreeHeader hdr2; ShmReader aReader[LSM_LOCK_NREADER]; }; /* ** An instance of this structure is stored at the start of each shared-memory ** chunk except the first (which is the header chunk - see above). */ struct ShmChunk { u32 iShmid; u32 iNext; }; /* ** Maximum number of shared-memory chunks allowed in the *-shm file. Since ** each shared-memory chunk is 32KB in size, this is a theoretical limit only. */ #define LSM_MAX_SHMCHUNKS (1<<30) /* Return true if shm-sequence "a" is larger than or equal to "b" */ #define shm_sequence_ge(a, b) (((u32)a-(u32)b) < LSM_MAX_SHMCHUNKS) #define LSM_APPLIST_SZ 4 /* ** An instance of the following structure stores the in-memory part of ** the current free block list. This structure is to the free block list ** as the in-memory tree is to the users database content. The contents ** of the free block list is found by merging the in-memory components ** with those stored in the LSM, just as the contents of the database is ** found by merging the in-memory tree with the user data entries in the ** LSM. ** ** Each FreelistEntry structure in the array represents either an insert ** or delete operation on the free-list. For deletes, the FreelistEntry.iId ** field is set to -1. For inserts, it is set to zero or greater. ** ** The array of FreelistEntry structures is always sorted in order of ** block number (ascending). ** ** When the in-memory free block list is written into the LSM, each insert ** operation is written separately. The entry key is the bitwise inverse ** of the block number as a 32-bit big-endian integer. This is done so that ** the entries in the LSM are sorted in descending order of block id. ** The associated value is the snapshot id, formated as a varint. */ struct Freelist { FreelistEntry *aEntry; /* Free list entries */ int nEntry; /* Number of valid slots in aEntry[] */ int nAlloc; /* Allocated size of aEntry[] */ }; struct FreelistEntry { u32 iBlk; /* Block number */ i64 iId; /* Largest snapshot id to use this block */ }; /* ** A snapshot of a database. A snapshot contains all the information required ** to read or write a database file on disk. See the description of struct ** Database below for futher details. */ struct Snapshot { Database *pDatabase; /* Database this snapshot belongs to */ u32 iCmpId; /* Id of compression scheme */ Level *pLevel; /* Pointer to level 0 of snapshot (or NULL) */ i64 iId; /* Snapshot id */ i64 iLogOff; /* Log file offset */ Redirect redirect; /* Block redirection array */ /* Used by worker snapshots only */ int nBlock; /* Number of blocks in database file */ Pgno aiAppend[LSM_APPLIST_SZ]; /* Append point list */ Freelist freelist; /* Free block list */ u32 nWrite; /* Total number of pages written to disk */ }; #define LSM_INITIAL_SNAPSHOT_ID 11 /* ** Functions from file "lsm_ckpt.c". */ int lsmCheckpointWrite(lsm_db *, u32 *); int lsmCheckpointLevels(lsm_db *, int, void **, int *); int lsmCheckpointLoadLevels(lsm_db *pDb, void *pVal, int nVal); int lsmCheckpointRecover(lsm_db *); int lsmCheckpointDeserialize(lsm_db *, int, u32 *, Snapshot **); int lsmCheckpointLoadWorker(lsm_db *pDb); int lsmCheckpointStore(lsm_db *pDb, int); int lsmCheckpointLoad(lsm_db *pDb, int *); int lsmCheckpointLoadOk(lsm_db *pDb, int); int lsmCheckpointClientCacheOk(lsm_db *); u32 lsmCheckpointNBlock(u32 *); i64 lsmCheckpointId(u32 *, int); u32 lsmCheckpointNWrite(u32 *, int); i64 lsmCheckpointLogOffset(u32 *); int lsmCheckpointPgsz(u32 *); int lsmCheckpointBlksz(u32 *); void lsmCheckpointLogoffset(u32 *aCkpt, DbLog *pLog); void lsmCheckpointZeroLogoffset(lsm_db *); int lsmCheckpointSaveWorker(lsm_db *pDb, int); int lsmDatabaseFull(lsm_db *pDb); int lsmCheckpointSynced(lsm_db *pDb, i64 *piId, i64 *piLog, u32 *pnWrite); int lsmCheckpointSize(lsm_db *db, int *pnByte); int lsmInfoCompressionId(lsm_db *db, u32 *piCmpId); /* ** Functions from file "lsm_tree.c". */ int lsmTreeNew(lsm_env *, int (*)(void *, int, void *, int), Tree **ppTree); void lsmTreeRelease(lsm_env *, Tree *); int lsmTreeInit(lsm_db *); int lsmTreeRepair(lsm_db *); void lsmTreeMakeOld(lsm_db *pDb); void lsmTreeDiscardOld(lsm_db *pDb); int lsmTreeHasOld(lsm_db *pDb); int lsmTreeSize(lsm_db *); int lsmTreeEndTransaction(lsm_db *pDb, int bCommit); int lsmTreeLoadHeader(lsm_db *pDb, int *); int lsmTreeLoadHeaderOk(lsm_db *, int); int lsmTreeInsert(lsm_db *pDb, void *pKey, int nKey, void *pVal, int nVal); int lsmTreeDelete(lsm_db *db, void *pKey1, int nKey1, void *pKey2, int nKey2); void lsmTreeRollback(lsm_db *pDb, TreeMark *pMark); void lsmTreeMark(lsm_db *pDb, TreeMark *pMark); int lsmTreeCursorNew(lsm_db *pDb, int, TreeCursor **); void lsmTreeCursorDestroy(TreeCursor *); int lsmTreeCursorSeek(TreeCursor *pCsr, void *pKey, int nKey, int *pRes); int lsmTreeCursorNext(TreeCursor *pCsr); int lsmTreeCursorPrev(TreeCursor *pCsr); int lsmTreeCursorEnd(TreeCursor *pCsr, int bLast); void lsmTreeCursorReset(TreeCursor *pCsr); int lsmTreeCursorKey(TreeCursor *pCsr, int *pFlags, void **ppKey, int *pnKey); int lsmTreeCursorFlags(TreeCursor *pCsr); int lsmTreeCursorValue(TreeCursor *pCsr, void **ppVal, int *pnVal); int lsmTreeCursorValid(TreeCursor *pCsr); int lsmTreeCursorSave(TreeCursor *pCsr); void lsmFlagsToString(int flags, char *zFlags); /* ** Functions from file "mem.c". */ void *lsmMalloc(lsm_env*, size_t); void lsmFree(lsm_env*, void *); void *lsmRealloc(lsm_env*, void *, size_t); void *lsmReallocOrFree(lsm_env*, void *, size_t); void *lsmReallocOrFreeRc(lsm_env *, void *, size_t, int *); void *lsmMallocZeroRc(lsm_env*, size_t, int *); void *lsmMallocRc(lsm_env*, size_t, int *); void *lsmMallocZero(lsm_env *pEnv, size_t); char *lsmMallocStrdup(lsm_env *pEnv, const char *); /* ** Functions from file "lsm_mutex.c". */ int lsmMutexStatic(lsm_env*, int, lsm_mutex **); int lsmMutexNew(lsm_env*, lsm_mutex **); void lsmMutexDel(lsm_env*, lsm_mutex *); void lsmMutexEnter(lsm_env*, lsm_mutex *); int lsmMutexTry(lsm_env*, lsm_mutex *); void lsmMutexLeave(lsm_env*, lsm_mutex *); #ifndef NDEBUG int lsmMutexHeld(lsm_env *, lsm_mutex *); int lsmMutexNotHeld(lsm_env *, lsm_mutex *); #endif /************************************************************************** ** Start of functions from "lsm_file.c". */ int lsmFsOpen(lsm_db *, const char *, int); int lsmFsOpenLog(lsm_db *, int *); void lsmFsCloseLog(lsm_db *); void lsmFsClose(FileSystem *); int lsmFsUnmap(FileSystem *); int lsmFsConfigure(lsm_db *db); int lsmFsBlockSize(FileSystem *); void lsmFsSetBlockSize(FileSystem *, int); int lsmFsMoveBlock(FileSystem *pFS, Segment *pSeg, int iTo, int iFrom); int lsmFsPageSize(FileSystem *); void lsmFsSetPageSize(FileSystem *, int); int lsmFsFileid(lsm_db *pDb, void **ppId, int *pnId); /* Creating, populating, gobbling and deleting sorted runs. */ void lsmFsGobble(lsm_db *, Segment *, Pgno *, int); int lsmFsSortedDelete(FileSystem *, Snapshot *, int, Segment *); int lsmFsSortedFinish(FileSystem *, Segment *); int lsmFsSortedAppend(FileSystem *, Snapshot *, Level *, int, Page **); int lsmFsSortedPadding(FileSystem *, Snapshot *, Segment *); /* Functions to retrieve the lsm_env pointer from a FileSystem or Page object */ lsm_env *lsmFsEnv(FileSystem *); lsm_env *lsmPageEnv(Page *); FileSystem *lsmPageFS(Page *); int lsmFsSectorSize(FileSystem *); void lsmSortedSplitkey(lsm_db *, Level *, int *); /* Reading sorted run content. */ int lsmFsDbPageLast(FileSystem *pFS, Segment *pSeg, Page **ppPg); int lsmFsDbPageGet(FileSystem *, Segment *, Pgno, Page **); int lsmFsDbPageNext(Segment *, Page *, int eDir, Page **); u8 *lsmFsPageData(Page *, int *); int lsmFsPageRelease(Page *); int lsmFsPagePersist(Page *); void lsmFsPageRef(Page *); Pgno lsmFsPageNumber(Page *); int lsmFsNRead(FileSystem *); int lsmFsNWrite(FileSystem *); int lsmFsMetaPageGet(FileSystem *, int, int, MetaPage **); int lsmFsMetaPageRelease(MetaPage *); u8 *lsmFsMetaPageData(MetaPage *, int *); #ifdef LSM_DEBUG int lsmFsDbPageIsLast(Segment *pSeg, Page *pPg); int lsmFsIntegrityCheck(lsm_db *); #endif Pgno lsmFsRedirectPage(FileSystem *, Redirect *, Pgno); int lsmFsPageWritable(Page *); /* Functions to read, write and sync the log file. */ int lsmFsWriteLog(FileSystem *pFS, i64 iOff, LsmString *pStr); int lsmFsSyncLog(FileSystem *pFS); int lsmFsReadLog(FileSystem *pFS, i64 iOff, int nRead, LsmString *pStr); int lsmFsTruncateLog(FileSystem *pFS, i64 nByte); int lsmFsTruncateDb(FileSystem *pFS, i64 nByte); int lsmFsCloseAndDeleteLog(FileSystem *pFS); LsmFile *lsmFsDeferClose(FileSystem *pFS); /* And to sync the db file */ int lsmFsSyncDb(FileSystem *, int); void lsmFsFlushWaiting(FileSystem *, int *); /* Used by lsm_info(ARRAY_STRUCTURE) and lsm_config(MMAP) */ int lsmInfoArrayStructure(lsm_db *pDb, int bBlock, Pgno iFirst, char **pzOut); int lsmInfoArrayPages(lsm_db *pDb, Pgno iFirst, char **pzOut); int lsmConfigMmap(lsm_db *pDb, int *piParam); int lsmEnvOpen(lsm_env *, const char *, int, lsm_file **); int lsmEnvClose(lsm_env *pEnv, lsm_file *pFile); int lsmEnvLock(lsm_env *pEnv, lsm_file *pFile, int iLock, int eLock); int lsmEnvTestLock(lsm_env *pEnv, lsm_file *pFile, int iLock, int nLock, int); int lsmEnvShmMap(lsm_env *, lsm_file *, int, int, void **); void lsmEnvShmBarrier(lsm_env *); void lsmEnvShmUnmap(lsm_env *, lsm_file *, int); void lsmEnvSleep(lsm_env *, int); int lsmFsReadSyncedId(lsm_db *db, int, i64 *piVal); int lsmFsSegmentContainsPg(FileSystem *pFS, Segment *, Pgno, int *); void lsmFsPurgeCache(FileSystem *); /* ** End of functions from "lsm_file.c". **************************************************************************/ /* ** Functions from file "lsm_sorted.c". */ int lsmInfoPageDump(lsm_db *, Pgno, int, char **); void lsmSortedCleanup(lsm_db *); int lsmSortedAutoWork(lsm_db *, int nUnit); int lsmSortedWalkFreelist(lsm_db *, int, int (*)(void *, int, i64), void *); int lsmSaveWorker(lsm_db *, int); int lsmFlushTreeToDisk(lsm_db *pDb); void lsmSortedRemap(lsm_db *pDb); void lsmSortedFreeLevel(lsm_env *pEnv, Level *); int lsmSortedAdvanceAll(lsm_db *pDb); int lsmSortedLoadMerge(lsm_db *, Level *, u32 *, int *); int lsmSortedLoadFreelist(lsm_db *pDb, void **, int *); void *lsmSortedSplitKey(Level *pLevel, int *pnByte); void lsmSortedSaveTreeCursors(lsm_db *); int lsmMCursorNew(lsm_db *, MultiCursor **); void lsmMCursorClose(MultiCursor *, int); int lsmMCursorSeek(MultiCursor *, int, void *, int , int); int lsmMCursorFirst(MultiCursor *); int lsmMCursorPrev(MultiCursor *); int lsmMCursorLast(MultiCursor *); int lsmMCursorValid(MultiCursor *); int lsmMCursorNext(MultiCursor *); int lsmMCursorKey(MultiCursor *, void **, int *); int lsmMCursorValue(MultiCursor *, void **, int *); int lsmMCursorType(MultiCursor *, int *); lsm_db *lsmMCursorDb(MultiCursor *); void lsmMCursorFreeCache(lsm_db *); int lsmSaveCursors(lsm_db *pDb); int lsmRestoreCursors(lsm_db *pDb); void lsmSortedDumpStructure(lsm_db *pDb, Snapshot *, int, int, const char *); void lsmFsDumpBlocklists(lsm_db *); void lsmSortedExpandBtreePage(Page *pPg, int nOrig); void lsmPutU32(u8 *, u32); u32 lsmGetU32(u8 *); u64 lsmGetU64(u8 *); /* ** Functions from "lsm_varint.c". */ int lsmVarintPut32(u8 *, int); int lsmVarintGet32(u8 *, int *); int lsmVarintPut64(u8 *aData, i64 iVal); int lsmVarintGet64(const u8 *aData, i64 *piVal); int lsmVarintLen32(int); int lsmVarintSize(u8 c); /* ** Functions from file "main.c". */ void lsmLogMessage(lsm_db *, int, const char *, ...); int lsmInfoFreelist(lsm_db *pDb, char **pzOut); /* ** Functions from file "lsm_log.c". */ int lsmLogBegin(lsm_db *pDb); int lsmLogWrite(lsm_db *, int, void *, int, void *, int); int lsmLogCommit(lsm_db *); void lsmLogEnd(lsm_db *pDb, int bCommit); void lsmLogTell(lsm_db *, LogMark *); void lsmLogSeek(lsm_db *, LogMark *); void lsmLogClose(lsm_db *); int lsmLogRecover(lsm_db *); int lsmInfoLogStructure(lsm_db *pDb, char **pzVal); /* Valid values for the second argument to lsmLogWrite(). */ #define LSM_WRITE 0x06 #define LSM_DELETE 0x08 #define LSM_DRANGE 0x0A /************************************************************************** ** Functions from file "lsm_shared.c". */ int lsmDbDatabaseConnect(lsm_db*, const char *); void lsmDbDatabaseRelease(lsm_db *); int lsmBeginReadTrans(lsm_db *); int lsmBeginWriteTrans(lsm_db *); int lsmBeginFlush(lsm_db *); int lsmDetectRoTrans(lsm_db *db, int *); int lsmBeginRoTrans(lsm_db *db); int lsmBeginWork(lsm_db *); void lsmFinishWork(lsm_db *, int, int *); int lsmFinishRecovery(lsm_db *); void lsmFinishReadTrans(lsm_db *); int lsmFinishWriteTrans(lsm_db *, int); int lsmFinishFlush(lsm_db *, int); int lsmSnapshotSetFreelist(lsm_db *, int *, int); Snapshot *lsmDbSnapshotClient(lsm_db *); Snapshot *lsmDbSnapshotWorker(lsm_db *); void lsmSnapshotSetCkptid(Snapshot *, i64); Level *lsmDbSnapshotLevel(Snapshot *); void lsmDbSnapshotSetLevel(Snapshot *, Level *); void lsmDbRecoveryComplete(lsm_db *, int); int lsmBlockAllocate(lsm_db *, int, int *); int lsmBlockFree(lsm_db *, int); int lsmBlockRefree(lsm_db *, int); void lsmFreelistDeltaBegin(lsm_db *); void lsmFreelistDeltaEnd(lsm_db *); int lsmFreelistDelta(lsm_db *pDb); DbLog *lsmDatabaseLog(lsm_db *pDb); #ifdef LSM_DEBUG int lsmHoldingClientMutex(lsm_db *pDb); int lsmShmAssertLock(lsm_db *db, int iLock, int eOp); int lsmShmAssertWorker(lsm_db *db); #endif void lsmFreeSnapshot(lsm_env *, Snapshot *); /* Candidate values for the 3rd argument to lsmShmLock() */ #define LSM_LOCK_UNLOCK 0 #define LSM_LOCK_SHARED 1 #define LSM_LOCK_EXCL 2 int lsmShmCacheChunks(lsm_db *db, int nChunk); int lsmShmLock(lsm_db *db, int iLock, int eOp, int bBlock); int lsmShmTestLock(lsm_db *db, int iLock, int nLock, int eOp); void lsmShmBarrier(lsm_db *db); #ifdef LSM_DEBUG void lsmShmHasLock(lsm_db *db, int iLock, int eOp); #else # define lsmShmHasLock(x,y,z) #endif int lsmReadlock(lsm_db *, i64 iLsm, u32 iShmMin, u32 iShmMax); int lsmLsmInUse(lsm_db *db, i64 iLsmId, int *pbInUse); int lsmTreeInUse(lsm_db *db, u32 iLsmId, int *pbInUse); int lsmFreelistAppend(lsm_env *pEnv, Freelist *p, int iBlk, i64 iId); int lsmDbMultiProc(lsm_db *); void lsmDbDeferredClose(lsm_db *, lsm_file *, LsmFile *); LsmFile *lsmDbRecycleFd(lsm_db *); int lsmWalkFreelist(lsm_db *, int, int (*)(void *, int, i64), void *); int lsmCheckCompressionId(lsm_db *, u32); /************************************************************************** ** functions in lsm_str.c */ void lsmStringInit(LsmString*, lsm_env *pEnv); int lsmStringExtend(LsmString*, int); int lsmStringAppend(LsmString*, const char *, int); void lsmStringVAppendf(LsmString*, const char *zFormat, va_list, va_list); void lsmStringAppendf(LsmString*, const char *zFormat, ...); void lsmStringClear(LsmString*); char *lsmMallocPrintf(lsm_env*, const char*, ...); int lsmStringBinAppend(LsmString *pStr, const u8 *a, int n); int lsmStrlen(const char *zName); /* ** Round up a number to the next larger multiple of 8. This is used ** to force 8-byte alignment on 64-bit architectures. */ #define ROUND8(x) (((x)+7)&~7) #define LSM_MIN(x,y) ((x)>(y) ? (y) : (x)) #define LSM_MAX(x,y) ((x)>(y) ? (x) : (y)) #endif ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_ckpt.c ================================================ /* ** 2011-09-11 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** This file contains code to read and write checkpoints. ** ** A checkpoint represents the database layout at a single point in time. ** It includes a log offset. When an existing database is opened, the ** current state is determined by reading the newest checkpoint and updating ** it with all committed transactions from the log that follow the specified ** offset. */ #include "lsmInt.h" /* ** CHECKPOINT BLOB FORMAT: ** ** A checkpoint blob is a series of unsigned 32-bit integers stored in ** big-endian byte order. As follows: ** ** Checkpoint header (see the CKPT_HDR_XXX #defines): ** ** 1. The checkpoint id MSW. ** 2. The checkpoint id LSW. ** 3. The number of integer values in the entire checkpoint, including ** the two checksum values. ** 4. The compression scheme id. ** 5. The total number of blocks in the database. ** 6. The block size. ** 7. The number of levels. ** 8. The nominal database page size. ** 9. The number of pages (in total) written to the database file. ** ** Log pointer: ** ** 1. The log offset MSW. ** 2. The log offset LSW. ** 3. Log checksum 0. ** 4. Log checksum 1. ** ** Note that the "log offset" is not the literal byte offset. Instead, ** it is the byte offset multiplied by 2, with least significant bit ** toggled each time the log pointer value is changed. This is to make ** sure that this field changes each time the log pointer is updated, ** even if the log file itself is disabled. See lsmTreeMakeOld(). ** ** See ckptExportLog() and ckptImportLog(). ** ** Append points: ** ** 8 integers (4 * 64-bit page numbers). See ckptExportAppendlist(). ** ** For each level in the database, a level record. Formatted as follows: ** ** 0. Age of the level (least significant 16-bits). And flags mask (most ** significant 16-bits). ** 1. The number of right-hand segments (nRight, possibly 0), ** 2. Segment record for left-hand segment (8 integers defined below), ** 3. Segment record for each right-hand segment (8 integers defined below), ** 4. If nRight>0, The number of segments involved in the merge ** 5. if nRight>0, Current nSkip value (see Merge structure defn.), ** 6. For each segment in the merge: ** 5a. Page number of next cell to read during merge (this field ** is 64-bits - 2 integers) ** 5b. Cell number of next cell to read during merge ** 7. Page containing current split-key (64-bits - 2 integers). ** 8. Cell within page containing current split-key. ** 9. Current pointer value (64-bits - 2 integers). ** ** The block redirect array: ** ** 1. Number of redirections (maximum LSM_MAX_BLOCK_REDIRECTS). ** 2. For each redirection: ** a. "from" block number ** b. "to" block number ** ** The in-memory freelist entries. Each entry is either an insert or a ** delete. The in-memory freelist is to the free-block-list as the ** in-memory tree is to the users database content. ** ** 1. Number of free-list entries stored in checkpoint header. ** 2. Number of free blocks (in total). ** 3. Total number of blocks freed during database lifetime. ** 4. For each entry: ** 2a. Block number of free block. ** 2b. A 64-bit integer (MSW followed by LSW). -1 for a delete entry, ** or the associated checkpoint id for an insert. ** ** The checksum: ** ** 1. Checksum value 1. ** 2. Checksum value 2. ** ** In the above, a segment record consists of the following four 64-bit ** fields (converted to 2 * u32 by storing the MSW followed by LSW): ** ** 1. First page of array, ** 2. Last page of array, ** 3. Root page of array (or 0), ** 4. Size of array in pages. */ /* ** LARGE NUMBERS OF LEVEL RECORDS: ** ** A limit on the number of rhs segments that may be present in the database ** file. Defining this limit ensures that all level records fit within ** the 4096 byte limit for checkpoint blobs. ** ** The number of right-hand-side segments in a database is counted as ** follows: ** ** * For each level in the database not undergoing a merge, add 1. ** ** * For each level in the database that is undergoing a merge, add ** the number of segments on the rhs of the level. ** ** A level record not undergoing a merge is 10 integers. A level record ** with nRhs rhs segments and (nRhs+1) input segments (i.e. including the ** separators from the next level) is (11*nRhs+20) integers. The maximum ** per right-hand-side level is therefore 21 integers. So the maximum ** size of all level records in a checkpoint is 21*40=820 integers. ** ** TODO: Before pointer values were changed from 32 to 64 bits, the above ** used to come to 420 bytes - leaving significant space for a free-list ** prefix. No more. To fix this, reduce the size of the level records in ** a db snapshot, and improve management of the free-list tail in ** lsm_sorted.c. */ #define LSM_MAX_RHS_SEGMENTS 40 /* ** LARGE NUMBERS OF FREELIST ENTRIES: ** ** There is also a limit (LSM_MAX_FREELIST_ENTRIES - defined in lsmInt.h) ** on the number of free-list entries stored in a checkpoint. Since each ** free-list entry consists of 3 integers, the maximum free-list size is ** 3*100=300 integers. Combined with the limit on rhs segments defined ** above, this ensures that a checkpoint always fits within a 4096 byte ** meta page. ** ** If the database contains more than 100 free blocks, the "overflow" flag ** in the checkpoint header is set and the remainder are stored in the ** system FREELIST entry in the LSM (along with user data). The value ** accompanying the FREELIST key in the LSM is, like a checkpoint, an array ** of 32-bit big-endian integers. As follows: ** ** For each entry: ** a. Block number of free block. ** b. MSW of associated checkpoint id. ** c. LSW of associated checkpoint id. ** ** The number of entries is not required - it is implied by the size of the ** value blob containing the integer array. ** ** Note that the limit defined by LSM_MAX_FREELIST_ENTRIES is a hard limit. ** The actual value used may be configured using LSM_CONFIG_MAX_FREELIST. */ /* ** The argument to this macro must be of type u32. On a little-endian ** architecture, it returns the u32 value that results from interpreting ** the 4 bytes as a big-endian value. On a big-endian architecture, it ** returns the value that would be produced by intepreting the 4 bytes ** of the input value as a little-endian integer. */ #define BYTESWAP32(x) ( \ (((x)&0x000000FF)<<24) + (((x)&0x0000FF00)<<8) \ + (((x)&0x00FF0000)>>8) + (((x)&0xFF000000)>>24) \ ) static const int one = 1; #define LSM_LITTLE_ENDIAN (*(u8 *)(&one)) /* Sizes, in integers, of various parts of the checkpoint. */ #define CKPT_HDR_SIZE 9 #define CKPT_LOGPTR_SIZE 4 #define CKPT_APPENDLIST_SIZE (LSM_APPLIST_SZ * 2) /* A #define to describe each integer in the checkpoint header. */ #define CKPT_HDR_ID_MSW 0 #define CKPT_HDR_ID_LSW 1 #define CKPT_HDR_NCKPT 2 #define CKPT_HDR_CMPID 3 #define CKPT_HDR_NBLOCK 4 #define CKPT_HDR_BLKSZ 5 #define CKPT_HDR_NLEVEL 6 #define CKPT_HDR_PGSZ 7 #define CKPT_HDR_NWRITE 8 #define CKPT_HDR_LO_MSW 9 #define CKPT_HDR_LO_LSW 10 #define CKPT_HDR_LO_CKSUM1 11 #define CKPT_HDR_LO_CKSUM2 12 typedef struct CkptBuffer CkptBuffer; /* ** Dynamic buffer used to accumulate data for a checkpoint. */ struct CkptBuffer { lsm_env *pEnv; int nAlloc; u32 *aCkpt; }; /* ** Calculate the checksum of the checkpoint specified by arguments aCkpt and ** nCkpt. Store the checksum in *piCksum1 and *piCksum2 before returning. ** ** The value of the nCkpt parameter includes the two checksum values at ** the end of the checkpoint. They are not used as inputs to the checksum ** calculation. The checksum is based on the array of (nCkpt-2) integers ** at aCkpt[]. */ static void ckptChecksum(u32 *aCkpt, u32 nCkpt, u32 *piCksum1, u32 *piCksum2){ u32 i; u32 cksum1 = 1; u32 cksum2 = 2; if( nCkpt % 2 ){ cksum1 += aCkpt[nCkpt-3] & 0x0000FFFF; cksum2 += aCkpt[nCkpt-3] & 0xFFFF0000; } for(i=0; (i+3)=p->nAlloc ){ int nNew = LSM_MAX(8, iIdx*2); p->aCkpt = (u32 *)lsmReallocOrFree(p->pEnv, p->aCkpt, nNew*sizeof(u32)); if( !p->aCkpt ){ *pRc = LSM_NOMEM_BKPT; return; } p->nAlloc = nNew; } p->aCkpt[iIdx] = iVal; } /* ** Argument aInt points to an array nInt elements in size. Switch the ** endian-ness of each element of the array. */ static void ckptChangeEndianness(u32 *aInt, int nInt){ if( LSM_LITTLE_ENDIAN ){ int i; for(i=0; iaCkpt, nCkpt+2, &aCksum[0], &aCksum[1]); ckptSetValue(p, nCkpt, aCksum[0], pRc); ckptSetValue(p, nCkpt+1, aCksum[1], pRc); } } static void ckptAppend64(CkptBuffer *p, int *piOut, i64 iVal, int *pRc){ int iOut = *piOut; ckptSetValue(p, iOut++, (iVal >> 32) & 0xFFFFFFFF, pRc); ckptSetValue(p, iOut++, (iVal & 0xFFFFFFFF), pRc); *piOut = iOut; } static i64 ckptRead64(u32 *a){ return (((i64)a[0]) << 32) + (i64)a[1]; } static i64 ckptGobble64(u32 *a, int *piIn){ int iIn = *piIn; *piIn += 2; return ckptRead64(&a[iIn]); } /* ** Append a 6-value segment record corresponding to pSeg to the checkpoint ** buffer passed as the third argument. */ static void ckptExportSegment( Segment *pSeg, CkptBuffer *p, int *piOut, int *pRc ){ ckptAppend64(p, piOut, pSeg->iFirst, pRc); ckptAppend64(p, piOut, pSeg->iLastPg, pRc); ckptAppend64(p, piOut, pSeg->iRoot, pRc); ckptAppend64(p, piOut, pSeg->nSize, pRc); } static void ckptExportLevel( Level *pLevel, /* Level object to serialize */ CkptBuffer *p, /* Append new level record to this ckpt */ int *piOut, /* IN/OUT: Size of checkpoint so far */ int *pRc /* IN/OUT: Error code */ ){ int iOut = *piOut; Merge *pMerge; pMerge = pLevel->pMerge; ckptSetValue(p, iOut++, (u32)pLevel->iAge + (u32)(pLevel->flags<<16), pRc); ckptSetValue(p, iOut++, pLevel->nRight, pRc); ckptExportSegment(&pLevel->lhs, p, &iOut, pRc); assert( (pLevel->nRight>0)==(pMerge!=0) ); if( pMerge ){ int i; for(i=0; inRight; i++){ ckptExportSegment(&pLevel->aRhs[i], p, &iOut, pRc); } assert( pMerge->nInput==pLevel->nRight || pMerge->nInput==pLevel->nRight+1 ); ckptSetValue(p, iOut++, pMerge->nInput, pRc); ckptSetValue(p, iOut++, pMerge->nSkip, pRc); for(i=0; inInput; i++){ ckptAppend64(p, &iOut, pMerge->aInput[i].iPg, pRc); ckptSetValue(p, iOut++, pMerge->aInput[i].iCell, pRc); } ckptAppend64(p, &iOut, pMerge->splitkey.iPg, pRc); ckptSetValue(p, iOut++, pMerge->splitkey.iCell, pRc); ckptAppend64(p, &iOut, pMerge->iCurrentPtr, pRc); } *piOut = iOut; } /* ** Populate the log offset fields of the checkpoint buffer. 4 values. */ static void ckptExportLog( lsm_db *pDb, int bFlush, CkptBuffer *p, int *piOut, int *pRc ){ int iOut = *piOut; assert( iOut==CKPT_HDR_LO_MSW ); if( bFlush ){ i64 iOff = pDb->treehdr.iOldLog; ckptAppend64(p, &iOut, iOff, pRc); ckptSetValue(p, iOut++, pDb->treehdr.oldcksum0, pRc); ckptSetValue(p, iOut++, pDb->treehdr.oldcksum1, pRc); }else{ for(; iOut<=CKPT_HDR_LO_CKSUM2; iOut++){ ckptSetValue(p, iOut, pDb->pShmhdr->aSnap2[iOut], pRc); } } assert( *pRc || iOut==CKPT_HDR_LO_CKSUM2+1 ); *piOut = iOut; } static void ckptExportAppendlist( lsm_db *db, /* Database connection */ CkptBuffer *p, /* Checkpoint buffer to write to */ int *piOut, /* IN/OUT: Offset within checkpoint buffer */ int *pRc /* IN/OUT: Error code */ ){ int i; Pgno *aiAppend = db->pWorker->aiAppend; for(i=0; ipFS; /* File system object */ Snapshot *pSnap = pDb->pWorker; /* Worker snapshot */ int nLevel = 0; /* Number of levels in checkpoint */ int iLevel; /* Used to count out nLevel levels */ int iOut = 0; /* Current offset in aCkpt[] */ Level *pLevel; /* Level iterator */ int i; /* Iterator used while serializing freelist */ CkptBuffer ckpt; /* Initialize the output buffer */ memset(&ckpt, 0, sizeof(CkptBuffer)); ckpt.pEnv = pDb->pEnv; iOut = CKPT_HDR_SIZE; /* Write the log offset into the checkpoint. */ ckptExportLog(pDb, bLog, &ckpt, &iOut, &rc); /* Write the append-point list */ ckptExportAppendlist(pDb, &ckpt, &iOut, &rc); /* Figure out how many levels will be written to the checkpoint. */ for(pLevel=lsmDbSnapshotLevel(pSnap); pLevel; pLevel=pLevel->pNext) nLevel++; /* Serialize nLevel levels. */ iLevel = 0; for(pLevel=lsmDbSnapshotLevel(pSnap); iLevelpNext){ ckptExportLevel(pLevel, &ckpt, &iOut, &rc); iLevel++; } /* Write the block-redirect list */ ckptSetValue(&ckpt, iOut++, pSnap->redirect.n, &rc); for(i=0; iredirect.n; i++){ ckptSetValue(&ckpt, iOut++, pSnap->redirect.a[i].iFrom, &rc); ckptSetValue(&ckpt, iOut++, pSnap->redirect.a[i].iTo, &rc); } /* Write the freelist */ assert( pSnap->freelist.nEntry<=pDb->nMaxFreelist ); if( rc==LSM_OK ){ int nFree = pSnap->freelist.nEntry; ckptSetValue(&ckpt, iOut++, nFree, &rc); for(i=0; ifreelist.aEntry[i]; ckptSetValue(&ckpt, iOut++, p->iBlk, &rc); ckptSetValue(&ckpt, iOut++, (p->iId >> 32) & 0xFFFFFFFF, &rc); ckptSetValue(&ckpt, iOut++, p->iId & 0xFFFFFFFF, &rc); } } /* Write the checkpoint header */ assert( iId>=0 ); assert( pSnap->iCmpId==pDb->compress.iId || pSnap->iCmpId==LSM_COMPRESSION_EMPTY ); ckptSetValue(&ckpt, CKPT_HDR_ID_MSW, (u32)(iId>>32), &rc); ckptSetValue(&ckpt, CKPT_HDR_ID_LSW, (u32)(iId&0xFFFFFFFF), &rc); ckptSetValue(&ckpt, CKPT_HDR_NCKPT, iOut+2, &rc); ckptSetValue(&ckpt, CKPT_HDR_CMPID, pDb->compress.iId, &rc); ckptSetValue(&ckpt, CKPT_HDR_NBLOCK, pSnap->nBlock, &rc); ckptSetValue(&ckpt, CKPT_HDR_BLKSZ, lsmFsBlockSize(pFS), &rc); ckptSetValue(&ckpt, CKPT_HDR_NLEVEL, nLevel, &rc); ckptSetValue(&ckpt, CKPT_HDR_PGSZ, lsmFsPageSize(pFS), &rc); ckptSetValue(&ckpt, CKPT_HDR_NWRITE, pSnap->nWrite, &rc); if( bCksum ){ ckptAddChecksum(&ckpt, iOut, &rc); }else{ ckptSetValue(&ckpt, iOut, 0, &rc); ckptSetValue(&ckpt, iOut+1, 0, &rc); } iOut += 2; assert( iOut<=1024 ); #ifdef LSM_LOG_FREELIST lsmLogMessage(pDb, rc, "ckptExportSnapshot(): id=%lld freelist: %d", iId, pSnap->freelist.nEntry ); for(i=0; ifreelist.nEntry; i++){ lsmLogMessage(pDb, rc, "ckptExportSnapshot(): iBlk=%d id=%lld", pSnap->freelist.aEntry[i].iBlk, pSnap->freelist.aEntry[i].iId ); } #endif *ppCkpt = (void *)ckpt.aCkpt; if( pnCkpt ) *pnCkpt = sizeof(u32)*iOut; return rc; } /* ** Helper function for ckptImport(). */ static void ckptNewSegment( u32 *aIn, int *piIn, Segment *pSegment /* Populate this structure */ ){ assert( pSegment->iFirst==0 && pSegment->iLastPg==0 ); assert( pSegment->nSize==0 && pSegment->iRoot==0 ); pSegment->iFirst = ckptGobble64(aIn, piIn); pSegment->iLastPg = ckptGobble64(aIn, piIn); pSegment->iRoot = ckptGobble64(aIn, piIn); pSegment->nSize = (int)ckptGobble64(aIn, piIn); assert( pSegment->iFirst ); } static int ckptSetupMerge(lsm_db *pDb, u32 *aInt, int *piIn, Level *pLevel){ Merge *pMerge; /* Allocated Merge object */ int nInput; /* Number of input segments in merge */ int iIn = *piIn; /* Next value to read from aInt[] */ int i; /* Iterator variable */ int nByte; /* Number of bytes to allocate */ /* Allocate the Merge object. If malloc() fails, return LSM_NOMEM. */ nInput = (int)aInt[iIn++]; nByte = sizeof(Merge) + sizeof(MergeInput) * nInput; pMerge = (Merge *)lsmMallocZero(pDb->pEnv, nByte); if( !pMerge ) return LSM_NOMEM_BKPT; pLevel->pMerge = pMerge; /* Populate the Merge object. */ pMerge->aInput = (MergeInput *)&pMerge[1]; pMerge->nInput = nInput; pMerge->iOutputOff = -1; pMerge->nSkip = (int)aInt[iIn++]; for(i=0; iaInput[i].iPg = ckptGobble64(aInt, &iIn); pMerge->aInput[i].iCell = (int)aInt[iIn++]; } pMerge->splitkey.iPg = ckptGobble64(aInt, &iIn); pMerge->splitkey.iCell = (int)aInt[iIn++]; pMerge->iCurrentPtr = ckptGobble64(aInt, &iIn); /* Set *piIn and return LSM_OK. */ *piIn = iIn; return LSM_OK; } static int ckptLoadLevels( lsm_db *pDb, u32 *aIn, int *piIn, int nLevel, Level **ppLevel ){ int i; int rc = LSM_OK; Level *pRet = 0; Level **ppNext; int iIn = *piIn; ppNext = &pRet; for(i=0; rc==LSM_OK && ipEnv, sizeof(Level), &rc); if( rc==LSM_OK ){ pLevel->iAge = (u16)(aIn[iIn] & 0x0000FFFF); pLevel->flags = (u16)((aIn[iIn]>>16) & 0x0000FFFF); iIn++; pLevel->nRight = aIn[iIn++]; if( pLevel->nRight ){ int nByte = sizeof(Segment) * pLevel->nRight; pLevel->aRhs = (Segment *)lsmMallocZeroRc(pDb->pEnv, nByte, &rc); } if( rc==LSM_OK ){ *ppNext = pLevel; ppNext = &pLevel->pNext; /* Allocate the main segment */ ckptNewSegment(aIn, &iIn, &pLevel->lhs); /* Allocate each of the right-hand segments, if any */ for(iRight=0; iRightnRight; iRight++){ ckptNewSegment(aIn, &iIn, &pLevel->aRhs[iRight]); } /* Set up the Merge object, if required */ if( pLevel->nRight>0 ){ rc = ckptSetupMerge(pDb, aIn, &iIn, pLevel); } } } } if( rc!=LSM_OK ){ /* An OOM must have occurred. Free any level structures allocated and ** return the error to the caller. */ lsmSortedFreeLevel(pDb->pEnv, pRet); pRet = 0; } *ppLevel = pRet; *piIn = iIn; return rc; } int lsmCheckpointLoadLevels(lsm_db *pDb, void *pVal, int nVal){ int rc = LSM_OK; if( nVal>0 ){ u32 *aIn; aIn = lsmMallocRc(pDb->pEnv, nVal, &rc); if( aIn ){ Level *pLevel = 0; Level *pParent; int nIn; int nLevel; int iIn = 1; memcpy(aIn, pVal, nVal); nIn = nVal / sizeof(u32); ckptChangeEndianness(aIn, nIn); nLevel = aIn[0]; rc = ckptLoadLevels(pDb, aIn, &iIn, nLevel, &pLevel); lsmFree(pDb->pEnv, aIn); assert( rc==LSM_OK || pLevel==0 ); if( rc==LSM_OK ){ pParent = lsmDbSnapshotLevel(pDb->pWorker); assert( pParent ); while( pParent->pNext ) pParent = pParent->pNext; pParent->pNext = pLevel; } } } return rc; } /* ** Return the data for the LEVELS record. ** ** The size of the checkpoint that can be stored in the database header ** must not exceed 1024 32-bit integers. Normally, it does not. However, ** if it does, part of the checkpoint must be stored in the LSM. This ** routine returns that part. */ int lsmCheckpointLevels( lsm_db *pDb, /* Database handle */ int nLevel, /* Number of levels to write to blob */ void **paVal, /* OUT: Pointer to LEVELS blob */ int *pnVal /* OUT: Size of LEVELS blob in bytes */ ){ Level *p; /* Used to iterate through levels */ int nAll= 0; int rc; int i; int iOut; CkptBuffer ckpt; assert( nLevel>0 ); for(p=lsmDbSnapshotLevel(pDb->pWorker); p; p=p->pNext) nAll++; assert( nAll>nLevel ); nAll -= nLevel; for(p=lsmDbSnapshotLevel(pDb->pWorker); p && nAll>0; p=p->pNext) nAll--; memset(&ckpt, 0, sizeof(CkptBuffer)); ckpt.pEnv = pDb->pEnv; ckptSetValue(&ckpt, 0, nLevel, &rc); iOut = 1; for(i=0; rc==LSM_OK && ipNext; } assert( rc!=LSM_OK || p==0 ); if( rc==LSM_OK ){ ckptChangeEndianness(ckpt.aCkpt, iOut); *paVal = (void *)ckpt.aCkpt; *pnVal = iOut * sizeof(u32); }else{ *pnVal = 0; *paVal = 0; } return rc; } /* ** Read the checkpoint id from meta-page pPg. */ static i64 ckptLoadId(MetaPage *pPg){ i64 ret = 0; if( pPg ){ int nData; u8 *aData = lsmFsMetaPageData(pPg, &nData); ret = (((i64)lsmGetU32(&aData[CKPT_HDR_ID_MSW*4])) << 32) + ((i64)lsmGetU32(&aData[CKPT_HDR_ID_LSW*4])); } return ret; } /* ** Return true if the buffer passed as an argument contains a valid ** checkpoint. */ static int ckptChecksumOk(u32 *aCkpt){ u32 nCkpt = aCkpt[CKPT_HDR_NCKPT]; u32 cksum1; u32 cksum2; if( nCkpt(LSM_META_RW_PAGE_SIZE)/sizeof(u32) ){ return 0; } ckptChecksum(aCkpt, nCkpt, &cksum1, &cksum2); return (cksum1==aCkpt[nCkpt-2] && cksum2==aCkpt[nCkpt-1]); } /* ** Attempt to load a checkpoint from meta page iMeta. ** ** This function is a no-op if *pRc is set to any value other than LSM_OK ** when it is called. If an error occurs, *pRc is set to an LSM error code ** before returning. ** ** If no error occurs and the checkpoint is successfully loaded, copy it to ** ShmHeader.aSnap1[] and ShmHeader.aSnap2[], and set ShmHeader.iMetaPage ** to indicate its origin. In this case return 1. Or, if the checkpoint ** cannot be loaded (because the checksum does not compute), return 0. */ static int ckptTryLoad(lsm_db *pDb, MetaPage *pPg, u32 iMeta, int *pRc){ int bLoaded = 0; /* Return value */ if( *pRc==LSM_OK ){ int rc = LSM_OK; /* Error code */ u32 *aCkpt = 0; /* Pointer to buffer containing checkpoint */ u32 nCkpt; /* Number of elements in aCkpt[] */ int nData; /* Bytes of data in aData[] */ u8 *aData; /* Meta page data */ aData = lsmFsMetaPageData(pPg, &nData); nCkpt = (u32)lsmGetU32(&aData[CKPT_HDR_NCKPT*sizeof(u32)]); if( nCkpt<=nData/sizeof(u32) && nCkpt>CKPT_HDR_NCKPT ){ aCkpt = (u32 *)lsmMallocRc(pDb->pEnv, nCkpt*sizeof(u32), &rc); } if( aCkpt ){ memcpy(aCkpt, aData, nCkpt*sizeof(u32)); ckptChangeEndianness(aCkpt, nCkpt); if( ckptChecksumOk(aCkpt) ){ ShmHeader *pShm = pDb->pShmhdr; memcpy(pShm->aSnap1, aCkpt, nCkpt*sizeof(u32)); memcpy(pShm->aSnap2, aCkpt, nCkpt*sizeof(u32)); memcpy(pDb->aSnapshot, aCkpt, nCkpt*sizeof(u32)); pShm->iMetaPage = iMeta; bLoaded = 1; } } lsmFree(pDb->pEnv, aCkpt); *pRc = rc; } return bLoaded; } /* ** Initialize the shared-memory header with an empty snapshot. This function ** is called when no valid snapshot can be found in the database header. */ static void ckptLoadEmpty(lsm_db *pDb){ u32 aCkpt[] = { 0, /* CKPT_HDR_ID_MSW */ 10, /* CKPT_HDR_ID_LSW */ 0, /* CKPT_HDR_NCKPT */ LSM_COMPRESSION_EMPTY, /* CKPT_HDR_CMPID */ 0, /* CKPT_HDR_NBLOCK */ 0, /* CKPT_HDR_BLKSZ */ 0, /* CKPT_HDR_NLEVEL */ 0, /* CKPT_HDR_PGSZ */ 0, /* CKPT_HDR_NWRITE */ 0, 0, 1234, 5678, /* The log pointer and initial checksum */ 0,0,0,0, 0,0,0,0, /* The append list */ 0, /* The redirected block list */ 0, /* The free block list */ 0, 0 /* Space for checksum values */ }; u32 nCkpt = array_size(aCkpt); ShmHeader *pShm = pDb->pShmhdr; aCkpt[CKPT_HDR_NCKPT] = nCkpt; aCkpt[CKPT_HDR_BLKSZ] = pDb->nDfltBlksz; aCkpt[CKPT_HDR_PGSZ] = pDb->nDfltPgsz; ckptChecksum(aCkpt, array_size(aCkpt), &aCkpt[nCkpt-2], &aCkpt[nCkpt-1]); memcpy(pShm->aSnap1, aCkpt, nCkpt*sizeof(u32)); memcpy(pShm->aSnap2, aCkpt, nCkpt*sizeof(u32)); memcpy(pDb->aSnapshot, aCkpt, nCkpt*sizeof(u32)); } /* ** This function is called as part of database recovery to initialize the ** ShmHeader.aSnap1[] and ShmHeader.aSnap2[] snapshots. */ int lsmCheckpointRecover(lsm_db *pDb){ int rc = LSM_OK; /* Return Code */ i64 iId1; /* Id of checkpoint on meta-page 1 */ i64 iId2; /* Id of checkpoint on meta-page 2 */ int bLoaded = 0; /* True once checkpoint has been loaded */ int cmp; /* True if (iId2>iId1) */ MetaPage *apPg[2] = {0, 0}; /* Meta-pages 1 and 2 */ rc = lsmFsMetaPageGet(pDb->pFS, 0, 1, &apPg[0]); if( rc==LSM_OK ) rc = lsmFsMetaPageGet(pDb->pFS, 0, 2, &apPg[1]); iId1 = ckptLoadId(apPg[0]); iId2 = ckptLoadId(apPg[1]); cmp = (iId2 > iId1); bLoaded = ckptTryLoad(pDb, apPg[cmp?1:0], (cmp?2:1), &rc); if( bLoaded==0 ){ bLoaded = ckptTryLoad(pDb, apPg[cmp?0:1], (cmp?1:2), &rc); } /* The database does not contain a valid checkpoint. Initialize the shared ** memory header with an empty checkpoint. */ if( bLoaded==0 ){ ckptLoadEmpty(pDb); } lsmFsMetaPageRelease(apPg[0]); lsmFsMetaPageRelease(apPg[1]); return rc; } /* ** Store the snapshot in pDb->aSnapshot[] in meta-page iMeta. */ int lsmCheckpointStore(lsm_db *pDb, int iMeta){ MetaPage *pPg = 0; int rc; assert( iMeta==1 || iMeta==2 ); rc = lsmFsMetaPageGet(pDb->pFS, 1, iMeta, &pPg); if( rc==LSM_OK ){ u8 *aData; int nData; int nCkpt; nCkpt = (int)pDb->aSnapshot[CKPT_HDR_NCKPT]; aData = lsmFsMetaPageData(pPg, &nData); memcpy(aData, pDb->aSnapshot, nCkpt*sizeof(u32)); ckptChangeEndianness((u32 *)aData, nCkpt); rc = lsmFsMetaPageRelease(pPg); } return rc; } /* ** Copy the current client snapshot from shared-memory to pDb->aSnapshot[]. */ int lsmCheckpointLoad(lsm_db *pDb, int *piRead){ int nRem = LSM_ATTEMPTS_BEFORE_PROTOCOL; ShmHeader *pShm = pDb->pShmhdr; while( (nRem--)>0 ){ int nInt; nInt = pShm->aSnap1[CKPT_HDR_NCKPT]; if( nInt<=(LSM_META_RW_PAGE_SIZE / sizeof(u32)) ){ memcpy(pDb->aSnapshot, pShm->aSnap1, nInt*sizeof(u32)); if( ckptChecksumOk(pDb->aSnapshot) ){ if( piRead ) *piRead = 1; return LSM_OK; } } nInt = pShm->aSnap2[CKPT_HDR_NCKPT]; if( nInt<=(LSM_META_RW_PAGE_SIZE / sizeof(u32)) ){ memcpy(pDb->aSnapshot, pShm->aSnap2, nInt*sizeof(u32)); if( ckptChecksumOk(pDb->aSnapshot) ){ if( piRead ) *piRead = 2; return LSM_OK; } } lsmShmBarrier(pDb); } return LSM_PROTOCOL_BKPT; } int lsmInfoCompressionId(lsm_db *db, u32 *piCmpId){ int rc; assert( db->pClient==0 && db->pWorker==0 ); rc = lsmCheckpointLoad(db, 0); if( rc==LSM_OK ){ *piCmpId = db->aSnapshot[CKPT_HDR_CMPID]; } return rc; } int lsmCheckpointLoadOk(lsm_db *pDb, int iSnap){ u32 *aShm; assert( iSnap==1 || iSnap==2 ); aShm = (iSnap==1) ? pDb->pShmhdr->aSnap1 : pDb->pShmhdr->aSnap2; return (lsmCheckpointId(pDb->aSnapshot, 0)==lsmCheckpointId(aShm, 0) ); } int lsmCheckpointClientCacheOk(lsm_db *pDb){ return ( pDb->pClient && pDb->pClient->iId==lsmCheckpointId(pDb->aSnapshot, 0) && pDb->pClient->iId==lsmCheckpointId(pDb->pShmhdr->aSnap1, 0) && pDb->pClient->iId==lsmCheckpointId(pDb->pShmhdr->aSnap2, 0) ); } int lsmCheckpointLoadWorker(lsm_db *pDb){ int rc; ShmHeader *pShm = pDb->pShmhdr; int nInt1; int nInt2; /* Must be holding the WORKER lock to do this. Or DMS2. */ assert( lsmShmAssertLock(pDb, LSM_LOCK_WORKER, LSM_LOCK_EXCL) || lsmShmAssertLock(pDb, LSM_LOCK_DMS1, LSM_LOCK_EXCL) ); /* Check that the two snapshots match. If not, repair them. */ nInt1 = pShm->aSnap1[CKPT_HDR_NCKPT]; nInt2 = pShm->aSnap2[CKPT_HDR_NCKPT]; if( nInt1!=nInt2 || memcmp(pShm->aSnap1, pShm->aSnap2, nInt2*sizeof(u32)) ){ if( ckptChecksumOk(pShm->aSnap1) ){ memcpy(pShm->aSnap2, pShm->aSnap1, sizeof(u32)*nInt1); }else if( ckptChecksumOk(pShm->aSnap2) ){ memcpy(pShm->aSnap1, pShm->aSnap2, sizeof(u32)*nInt2); }else{ return LSM_PROTOCOL_BKPT; } } rc = lsmCheckpointDeserialize(pDb, 1, pShm->aSnap1, &pDb->pWorker); if( pDb->pWorker ) pDb->pWorker->pDatabase = pDb->pDatabase; if( rc==LSM_OK ){ rc = lsmCheckCompressionId(pDb, pDb->pWorker->iCmpId); } #if 0 assert( rc!=LSM_OK || lsmFsIntegrityCheck(pDb) ); #endif return rc; } int lsmCheckpointDeserialize( lsm_db *pDb, int bInclFreelist, /* If true, deserialize free-list */ u32 *aCkpt, Snapshot **ppSnap ){ int rc = LSM_OK; Snapshot *pNew; pNew = (Snapshot *)lsmMallocZeroRc(pDb->pEnv, sizeof(Snapshot), &rc); if( rc==LSM_OK ){ Level *pLvl; int nFree; int i; int nLevel = (int)aCkpt[CKPT_HDR_NLEVEL]; int iIn = CKPT_HDR_SIZE + CKPT_APPENDLIST_SIZE + CKPT_LOGPTR_SIZE; pNew->iId = lsmCheckpointId(aCkpt, 0); pNew->nBlock = aCkpt[CKPT_HDR_NBLOCK]; pNew->nWrite = aCkpt[CKPT_HDR_NWRITE]; rc = ckptLoadLevels(pDb, aCkpt, &iIn, nLevel, &pNew->pLevel); pNew->iLogOff = lsmCheckpointLogOffset(aCkpt); pNew->iCmpId = aCkpt[CKPT_HDR_CMPID]; /* Make a copy of the append-list */ for(i=0; iaiAppend[i] = ckptRead64(a); } /* Read the block-redirect list */ pNew->redirect.n = aCkpt[iIn++]; if( pNew->redirect.n ){ pNew->redirect.a = lsmMallocZeroRc(pDb->pEnv, (sizeof(struct RedirectEntry) * LSM_MAX_BLOCK_REDIRECTS), &rc ); if( rc==LSM_OK ){ for(i=0; iredirect.n; i++){ pNew->redirect.a[i].iFrom = aCkpt[iIn++]; pNew->redirect.a[i].iTo = aCkpt[iIn++]; } } for(pLvl=pNew->pLevel; pLvl->pNext; pLvl=pLvl->pNext); if( pLvl->nRight ){ pLvl->aRhs[pLvl->nRight-1].pRedirect = &pNew->redirect; }else{ pLvl->lhs.pRedirect = &pNew->redirect; } } /* Copy the free-list */ if( rc==LSM_OK && bInclFreelist ){ nFree = aCkpt[iIn++]; if( nFree ){ pNew->freelist.aEntry = (FreelistEntry *)lsmMallocZeroRc( pDb->pEnv, sizeof(FreelistEntry)*nFree, &rc ); if( rc==LSM_OK ){ int j; for(j=0; jfreelist.aEntry[j]; p->iBlk = aCkpt[iIn++]; p->iId = ((i64)(aCkpt[iIn])<<32) + aCkpt[iIn+1]; iIn += 2; } pNew->freelist.nEntry = pNew->freelist.nAlloc = nFree; } } } } if( rc!=LSM_OK ){ lsmFreeSnapshot(pDb->pEnv, pNew); pNew = 0; } *ppSnap = pNew; return rc; } /* ** Connection pDb must be the worker connection in order to call this ** function. It returns true if the database already contains the maximum ** number of levels or false otherwise. ** ** This is used when flushing the in-memory tree to disk. If the database ** is already full, then the caller should invoke lsm_work() or similar ** until it is not full before creating a new level by flushing the in-memory ** tree to disk. Limiting the number of levels in the database ensures that ** the records describing them always fit within the checkpoint blob. */ int lsmDatabaseFull(lsm_db *pDb){ Level *p; int nRhs = 0; assert( lsmShmAssertLock(pDb, LSM_LOCK_WORKER, LSM_LOCK_EXCL) ); assert( pDb->pWorker ); for(p=pDb->pWorker->pLevel; p; p=p->pNext){ nRhs += (p->nRight ? p->nRight : 1); } return (nRhs >= LSM_MAX_RHS_SEGMENTS); } /* ** The connection passed as the only argument is currently the worker ** connection. Some work has been performed on the database by the connection, ** but no new snapshot has been written into shared memory. ** ** This function updates the shared-memory worker and client snapshots with ** the new snapshot produced by the work performed by pDb. ** ** If successful, LSM_OK is returned. Otherwise, if an error occurs, an LSM ** error code is returned. */ int lsmCheckpointSaveWorker(lsm_db *pDb, int bFlush){ Snapshot *pSnap = pDb->pWorker; ShmHeader *pShm = pDb->pShmhdr; void *p = 0; int n = 0; int rc; pSnap->iId++; rc = ckptExportSnapshot(pDb, bFlush, pSnap->iId, 1, &p, &n); if( rc!=LSM_OK ) return rc; assert( ckptChecksumOk((u32 *)p) ); assert( n<=LSM_META_RW_PAGE_SIZE ); memcpy(pShm->aSnap2, p, n); lsmShmBarrier(pDb); memcpy(pShm->aSnap1, p, n); lsmFree(pDb->pEnv, p); /* assert( lsmFsIntegrityCheck(pDb) ); */ return LSM_OK; } /* ** This function is used to determine the snapshot-id of the most recently ** checkpointed snapshot. Variable ShmHeader.iMetaPage indicates which of ** the two meta-pages said snapshot resides on (if any). ** ** If successful, this function loads the snapshot from the meta-page, ** verifies its checksum and sets *piId to the snapshot-id before returning ** LSM_OK. Or, if the checksum attempt fails, *piId is set to zero and ** LSM_OK returned. If an error occurs, an LSM error code is returned and ** the final value of *piId is undefined. */ int lsmCheckpointSynced(lsm_db *pDb, i64 *piId, i64 *piLog, u32 *pnWrite){ int rc = LSM_OK; MetaPage *pPg; u32 iMeta; iMeta = pDb->pShmhdr->iMetaPage; if( iMeta==1 || iMeta==2 ){ rc = lsmFsMetaPageGet(pDb->pFS, 0, iMeta, &pPg); if( rc==LSM_OK ){ int nCkpt; int nData; u8 *aData; aData = lsmFsMetaPageData(pPg, &nData); assert( nData==LSM_META_RW_PAGE_SIZE ); nCkpt = lsmGetU32(&aData[CKPT_HDR_NCKPT*sizeof(u32)]); if( nCkpt<(LSM_META_RW_PAGE_SIZE/sizeof(u32)) ){ u32 *aCopy = lsmMallocRc(pDb->pEnv, sizeof(u32) * nCkpt, &rc); if( aCopy ){ memcpy(aCopy, aData, nCkpt*sizeof(u32)); ckptChangeEndianness(aCopy, nCkpt); if( ckptChecksumOk(aCopy) ){ if( piId ) *piId = lsmCheckpointId(aCopy, 0); if( piLog ) *piLog = (lsmCheckpointLogOffset(aCopy) >> 1); if( pnWrite ) *pnWrite = aCopy[CKPT_HDR_NWRITE]; } lsmFree(pDb->pEnv, aCopy); } } lsmFsMetaPageRelease(pPg); } } if( (iMeta!=1 && iMeta!=2) || rc!=LSM_OK || pDb->pShmhdr->iMetaPage!=iMeta ){ if( piId ) *piId = 0; if( piLog ) *piLog = 0; if( pnWrite ) *pnWrite = 0; } return rc; } /* ** Return the checkpoint-id of the checkpoint array passed as the first ** argument to this function. If the second argument is true, then assume ** that the checkpoint is made up of 32-bit big-endian integers. If it ** is false, assume that the integers are in machine byte order. */ i64 lsmCheckpointId(u32 *aCkpt, int bDisk){ i64 iId; if( bDisk ){ u8 *aData = (u8 *)aCkpt; iId = (((i64)lsmGetU32(&aData[CKPT_HDR_ID_MSW*4])) << 32); iId += ((i64)lsmGetU32(&aData[CKPT_HDR_ID_LSW*4])); }else{ iId = ((i64)aCkpt[CKPT_HDR_ID_MSW] << 32) + (i64)aCkpt[CKPT_HDR_ID_LSW]; } return iId; } u32 lsmCheckpointNBlock(u32 *aCkpt){ return aCkpt[CKPT_HDR_NBLOCK]; } u32 lsmCheckpointNWrite(u32 *aCkpt, int bDisk){ if( bDisk ){ return lsmGetU32((u8 *)&aCkpt[CKPT_HDR_NWRITE]); }else{ return aCkpt[CKPT_HDR_NWRITE]; } } i64 lsmCheckpointLogOffset(u32 *aCkpt){ return ((i64)aCkpt[CKPT_HDR_LO_MSW] << 32) + (i64)aCkpt[CKPT_HDR_LO_LSW]; } int lsmCheckpointPgsz(u32 *aCkpt){ return (int)aCkpt[CKPT_HDR_PGSZ]; } int lsmCheckpointBlksz(u32 *aCkpt){ return (int)aCkpt[CKPT_HDR_BLKSZ]; } void lsmCheckpointLogoffset( u32 *aCkpt, DbLog *pLog ){ pLog->aRegion[2].iStart = (lsmCheckpointLogOffset(aCkpt) >> 1); pLog->cksum0 = aCkpt[CKPT_HDR_LO_CKSUM1]; pLog->cksum1 = aCkpt[CKPT_HDR_LO_CKSUM2]; pLog->iSnapshotId = lsmCheckpointId(aCkpt, 0); } void lsmCheckpointZeroLogoffset(lsm_db *pDb){ u32 nCkpt; nCkpt = pDb->aSnapshot[CKPT_HDR_NCKPT]; assert( nCkpt>CKPT_HDR_NCKPT ); assert( nCkpt==pDb->pShmhdr->aSnap1[CKPT_HDR_NCKPT] ); assert( 0==memcmp(pDb->aSnapshot, pDb->pShmhdr->aSnap1, nCkpt*sizeof(u32)) ); assert( 0==memcmp(pDb->aSnapshot, pDb->pShmhdr->aSnap2, nCkpt*sizeof(u32)) ); pDb->aSnapshot[CKPT_HDR_LO_MSW] = 0; pDb->aSnapshot[CKPT_HDR_LO_LSW] = 0; ckptChecksum(pDb->aSnapshot, nCkpt, &pDb->aSnapshot[nCkpt-2], &pDb->aSnapshot[nCkpt-1] ); memcpy(pDb->pShmhdr->aSnap1, pDb->aSnapshot, nCkpt*sizeof(u32)); memcpy(pDb->pShmhdr->aSnap2, pDb->aSnapshot, nCkpt*sizeof(u32)); } /* ** Set the output variable to the number of KB of data written into the ** database file since the most recent checkpoint. */ int lsmCheckpointSize(lsm_db *db, int *pnKB){ int rc = LSM_OK; u32 nSynced; /* Set nSynced to the number of pages that had been written when the ** database was last checkpointed. */ rc = lsmCheckpointSynced(db, 0, 0, &nSynced); if( rc==LSM_OK ){ u32 nPgsz = db->pShmhdr->aSnap1[CKPT_HDR_PGSZ]; u32 nWrite = db->pShmhdr->aSnap1[CKPT_HDR_NWRITE]; *pnKB = (int)(( ((i64)(nWrite - nSynced) * nPgsz) + 1023) / 1024); } return rc; } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_file.c ================================================ /* ** 2011-08-26 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** NORMAL DATABASE FILE FORMAT ** ** The following database file format concepts are used by the code in ** this file to read and write the database file. ** ** Pages: ** ** A database file is divided into pages. The first 8KB of the file consists ** of two 4KB meta-pages. The meta-page size is not configurable. The ** remainder of the file is made up of database pages. The default database ** page size is 4KB. Database pages are aligned to page-size boundaries, ** so if the database page size is larger than 8KB there is a gap between ** the end of the meta pages and the start of the database pages. ** ** Database pages are numbered based on their position in the file. Page N ** begins at byte offset ((N-1)*pgsz). This means that page 1 does not ** exist - since it would always overlap with the meta pages. If the ** page-size is (say) 512 bytes, then the first usable page in the database ** is page 33. ** ** It is assumed that the first two meta pages and the data that follows ** them are located on different disk sectors. So that if a power failure ** while writing to a meta page there is no risk of damage to the other ** meta page or any other part of the database file. TODO: This may need ** to be revisited. ** ** Blocks: ** ** The database file is also divided into blocks. The default block size is ** 1MB. When writing to the database file, an attempt is made to write data ** in contiguous block-sized chunks. ** ** The first and last page on each block are special in that they are 4 ** bytes smaller than all other pages. This is because the last four bytes ** of space on the first and last pages of each block are reserved for ** pointers to other blocks (i.e. a 32-bit block number). ** ** Runs: ** ** A run is a sequence of pages that the upper layer uses to store a ** sorted array of database keys (and accompanying data - values, FC ** pointers and so on). Given a page within a run, it is possible to ** navigate to the next page in the run as follows: ** ** a) if the current page is not the last in a block, the next page ** in the run is located immediately after the current page, OR ** ** b) if the current page is the last page in a block, the next page ** in the run is the first page on the block identified by the ** block pointer stored in the last 4 bytes of the current block. ** ** It is possible to navigate to the previous page in a similar fashion, ** using the block pointer embedded in the last 4 bytes of the first page ** of each block as required. ** ** The upper layer is responsible for identifying by page number the ** first and last page of any run that it needs to navigate - there are ** no "end-of-run" markers stored or identified by this layer. This is ** necessary as clients reading different database snapshots may access ** different subsets of a run. ** ** THE LOG FILE ** ** This file opens and closes the log file. But it does not contain any ** logic related to the log file format. Instead, it exports the following ** functions that are used by the code in lsm_log.c to read and write the ** log file: ** ** lsmFsOpenLog ** lsmFsWriteLog ** lsmFsSyncLog ** lsmFsReadLog ** lsmFsTruncateLog ** lsmFsCloseAndDeleteLog ** ** COMPRESSED DATABASE FILE FORMAT ** ** The compressed database file format is very similar to the normal format. ** The file still begins with two 4KB meta-pages (which are never compressed). ** It is still divided into blocks. ** ** The first and last four bytes of each block are reserved for 32-bit ** pointer values. Similar to the way four bytes are carved from the end of ** the first and last page of each block in uncompressed databases. From ** the point of view of the upper layer, all pages are the same size - this ** is different from the uncompressed format where the first and last pages ** on each block are 4 bytes smaller than the others. ** ** Pages are stored in variable length compressed form, as follows: ** ** * 3-byte size field containing the size of the compressed page image ** in bytes. The most significant bit of each byte of the size field ** is always set. The remaining 7 bits are used to store a 21-bit ** integer value (in big-endian order - the first byte in the field ** contains the most significant 7 bits). Since the maximum allowed ** size of a compressed page image is (2^17 - 1) bytes, there are ** actually 4 unused bits in the size field. ** ** In other words, if the size of the compressed page image is nSz, ** the header can be serialized as follows: ** ** u8 aHdr[3] ** aHdr[0] = 0x80 | (u8)(nSz >> 14); ** aHdr[1] = 0x80 | (u8)(nSz >> 7); ** aHdr[2] = 0x80 | (u8)(nSz >> 0); ** ** * Compressed page image. ** ** * A second copy of the 3-byte record header. ** ** A page number is a byte offset into the database file. So the smallest ** possible page number is 8192 (immediately after the two meta-pages). ** The first and root page of a segment are identified by a page number ** corresponding to the byte offset of the first byte in the corresponding ** page record. The last page of a segment is identified by the byte offset ** of the last byte in its record. ** ** Unlike uncompressed pages, compressed page records may span blocks. ** ** Sometimes, in order to avoid touching sectors that contain synced data ** when writing, it is necessary to insert unused space between compressed ** page records. This can be done as follows: ** ** * For less than 6 bytes of empty space, the first and last byte ** of the free space contain the total number of free bytes. For ** example: ** ** Block of 4 free bytes: 0x04 0x?? 0x?? 0x04 ** Block of 2 free bytes: 0x02 0x02 ** A single free byte: 0x01 ** ** * For 6 or more bytes of empty space, a record similar to a ** compressed page record is added to the segment. A padding record ** is distinguished from a compressed page record by the most ** significant bit of the second byte of the size field, which is ** cleared instead of set. */ #include "lsmInt.h" #include #include #include /* ** File-system object. Each database connection allocates a single instance ** of the following structure. It is used for all access to the database and ** log files. ** ** The database file may be accessed via two methods - using mmap() or using ** read() and write() calls. In the general case both methods are used - a ** prefix of the file is mapped into memory and the remainder accessed using ** read() and write(). This is helpful when accessing very large files (or ** files that may grow very large during the lifetime of a database ** connection) on systems with 32-bit address spaces. However, it also requires ** that this object manage two distinct types of Page objects simultaneously - ** those that carry pointers to the mapped file and those that carry arrays ** populated by read() calls. ** ** pFree: ** The head of a singly-linked list that containing currently unused Page ** structures suitable for use as mmap-page handles. Connected by the ** Page.pFreeNext pointers. ** ** pMapped: ** The head of a singly-linked list that contains all pages that currently ** carry pointers to the mapped region. This is used if the region is ** every remapped - the pointers carried by existing pages can be adjusted ** to account for the remapping. Connected by the Page.pMappedNext pointers. ** ** pWaiting: ** When the upper layer wishes to append a new b-tree page to a segment, ** it allocates a Page object that carries a malloc'd block of memory - ** regardless of the mmap-related configuration. The page is not assigned ** a page number at first. When the upper layer has finished constructing ** the page contents, it calls lsmFsPagePersist() to assign a page number ** to it. At this point it is likely that N pages have been written to the ** segment, the (N+1)th page is still outstanding and the b-tree page is ** assigned page number (N+2). To avoid writing page (N+2) before page ** (N+1), the recently completed b-tree page is held in the singly linked ** list headed by pWaiting until page (N+1) has been written. ** ** Function lsmFsFlushWaiting() is responsible for eventually writing ** waiting pages to disk. ** ** apHash/nHash: ** Hash table used to store all Page objects that carry malloc'd arrays, ** except those b-tree pages that have not yet been assigned page numbers. ** Once they have been assigned page numbers - they are added to this ** hash table. ** ** Hash table overflow chains are connected using the Page.pHashNext ** pointers. ** ** pLruFirst, pLruLast: ** The first and last entries in a doubly-linked list of pages. This ** list contains all pages with malloc'd data that are present in the ** hash table and have a ref-count of zero. */ struct FileSystem { lsm_db *pDb; /* Database handle that owns this object */ lsm_env *pEnv; /* Environment pointer */ char *zDb; /* Database file name */ char *zLog; /* Database file name */ int nMetasize; /* Size of meta pages in bytes */ int nMetaRwSize; /* Read/written size of meta pages in bytes */ int nPagesize; /* Database page-size in bytes */ int nBlocksize; /* Database block-size in bytes */ /* r/w file descriptors for both files. */ LsmFile *pLsmFile; /* Used after lsm_close() to link into list */ lsm_file *fdDb; /* Database file */ lsm_file *fdLog; /* Log file */ int szSector; /* Database file sector size */ /* If this is a compressed database, a pointer to the compression methods. ** For an uncompressed database, a NULL pointer. */ lsm_compress *pCompress; u8 *aIBuffer; /* Buffer to compress to */ u8 *aOBuffer; /* Buffer to uncompress from */ int nBuffer; /* Allocated size of above buffers in bytes */ /* mmap() page related things */ i64 nMapLimit; /* Maximum bytes of file to map */ void *pMap; /* Current mapping of database file */ i64 nMap; /* Bytes mapped at pMap */ Page *pFree; /* Unused Page structures */ Page *pMapped; /* List of Page structs that point to pMap */ /* Page cache parameters for non-mmap() pages */ int nCacheMax; /* Configured cache size (in pages) */ int nCacheAlloc; /* Current cache size (in pages) */ Page *pLruFirst; /* Head of the LRU list */ Page *pLruLast; /* Tail of the LRU list */ int nHash; /* Number of hash slots in hash table */ Page **apHash; /* nHash Hash slots */ Page *pWaiting; /* b-tree pages waiting to be written */ /* Statistics */ int nOut; /* Number of outstanding pages */ int nWrite; /* Total number of pages written */ int nRead; /* Total number of pages read */ }; /* ** Database page handle. ** ** pSeg: ** When lsmFsSortedAppend() is called on a compressed database, the new ** page is not assigned a page number or location in the database file ** immediately. Instead, these are assigned by the lsmFsPagePersist() call ** right before it writes the compressed page image to disk. ** ** The lsmFsSortedAppend() function sets the pSeg pointer to point to the ** segment that the new page will be a part of. It is unset by ** lsmFsPagePersist() after the page is written to disk. */ struct Page { u8 *aData; /* Buffer containing page data */ int nData; /* Bytes of usable data at aData[] */ Pgno iPg; /* Page number */ int nRef; /* Number of outstanding references */ int flags; /* Combination of PAGE_XXX flags */ Page *pHashNext; /* Next page in hash table slot */ Page *pLruNext; /* Next page in LRU list */ Page *pLruPrev; /* Previous page in LRU list */ FileSystem *pFS; /* File system that owns this page */ /* Only used in compressed database mode: */ int nCompress; /* Compressed size (or 0 for uncomp. db) */ int nCompressPrev; /* Compressed size of prev page */ Segment *pSeg; /* Segment this page will be written to */ /* Pointers for singly linked lists */ Page *pWaitingNext; /* Next page in FileSystem.pWaiting list */ Page *pFreeNext; /* Next page in FileSystem.pFree list */ Page *pMappedNext; /* Next page in FileSystem.pMapped list */ }; /* ** Meta-data page handle. There are two meta-data pages at the start of ** the database file, each FileSystem.nMetasize bytes in size. */ struct MetaPage { int iPg; /* Either 1 or 2 */ int bWrite; /* Write back to db file on release */ u8 *aData; /* Pointer to buffer */ FileSystem *pFS; /* FileSystem that owns this page */ }; /* ** Values for LsmPage.flags */ #define PAGE_DIRTY 0x00000001 /* Set if page is dirty */ #define PAGE_FREE 0x00000002 /* Set if Page.aData requires lsmFree() */ #define PAGE_HASPREV 0x00000004 /* Set if page is first on uncomp. block */ /* ** Number of pgsz byte pages omitted from the start of block 1. The start ** of block 1 contains two 4096 byte meta pages (8192 bytes in total). */ #define BLOCK1_HDR_SIZE(pgsz) LSM_MAX(1, 8192/(pgsz)) /* ** If NDEBUG is not defined, set a breakpoint in function lsmIoerrBkpt() ** to catch IO errors (any error returned by a VFS method). */ #ifndef NDEBUG static void lsmIoerrBkpt(void){ static int nErr = 0; nErr++; } static int IOERR_WRAPPER(int rc){ if( rc!=LSM_OK ) lsmIoerrBkpt(); return rc; } #else # define IOERR_WRAPPER(rc) (rc) #endif #ifdef NDEBUG # define assert_lists_are_ok(x) #else static Page *fsPageFindInHash(FileSystem *pFS, Pgno iPg, int *piHash); static void assert_lists_are_ok(FileSystem *pFS){ #if 0 Page *p; assert( pFS->nMapLimit>=0 ); /* Check that all pages in the LRU list have nRef==0, pointers to buffers ** in heap memory, and corresponding entries in the hash table. */ for(p=pFS->pLruFirst; p; p=p->pLruNext){ assert( p==pFS->pLruFirst || p->pLruPrev!=0 ); assert( p==pFS->pLruLast || p->pLruNext!=0 ); assert( p->pLruPrev==0 || p->pLruPrev->pLruNext==p ); assert( p->pLruNext==0 || p->pLruNext->pLruPrev==p ); assert( p->nRef==0 ); assert( p->flags & PAGE_FREE ); assert( p==fsPageFindInHash(pFS, p->iPg, 0) ); } #endif } #endif /* ** Wrappers around the VFS methods of the lsm_env object: ** ** lsmEnvOpen() ** lsmEnvRead() ** lsmEnvWrite() ** lsmEnvSync() ** lsmEnvSectorSize() ** lsmEnvClose() ** lsmEnvTruncate() ** lsmEnvUnlink() ** lsmEnvRemap() */ int lsmEnvOpen(lsm_env *pEnv, const char *zFile, int flags, lsm_file **ppNew){ return pEnv->xOpen(pEnv, zFile, flags, ppNew); } static int lsmEnvRead( lsm_env *pEnv, lsm_file *pFile, lsm_i64 iOff, void *pRead, int nRead ){ return IOERR_WRAPPER( pEnv->xRead(pFile, iOff, pRead, nRead) ); } static int lsmEnvWrite( lsm_env *pEnv, lsm_file *pFile, lsm_i64 iOff, const void *pWrite, int nWrite ){ return IOERR_WRAPPER( pEnv->xWrite(pFile, iOff, (void *)pWrite, nWrite) ); } static int lsmEnvSync(lsm_env *pEnv, lsm_file *pFile){ return IOERR_WRAPPER( pEnv->xSync(pFile) ); } static int lsmEnvSectorSize(lsm_env *pEnv, lsm_file *pFile){ return pEnv->xSectorSize(pFile); } int lsmEnvClose(lsm_env *pEnv, lsm_file *pFile){ return IOERR_WRAPPER( pEnv->xClose(pFile) ); } static int lsmEnvTruncate(lsm_env *pEnv, lsm_file *pFile, lsm_i64 nByte){ return IOERR_WRAPPER( pEnv->xTruncate(pFile, nByte) ); } static int lsmEnvUnlink(lsm_env *pEnv, const char *zDel){ return IOERR_WRAPPER( pEnv->xUnlink(pEnv, zDel) ); } static int lsmEnvRemap( lsm_env *pEnv, lsm_file *pFile, i64 szMin, void **ppMap, i64 *pszMap ){ return pEnv->xRemap(pFile, szMin, ppMap, pszMap); } int lsmEnvLock(lsm_env *pEnv, lsm_file *pFile, int iLock, int eLock){ if( pFile==0 ) return LSM_OK; return pEnv->xLock(pFile, iLock, eLock); } int lsmEnvTestLock( lsm_env *pEnv, lsm_file *pFile, int iLock, int nLock, int eLock ){ return pEnv->xTestLock(pFile, iLock, nLock, eLock); } int lsmEnvShmMap( lsm_env *pEnv, lsm_file *pFile, int iChunk, int sz, void **ppOut ){ return pEnv->xShmMap(pFile, iChunk, sz, ppOut); } void lsmEnvShmBarrier(lsm_env *pEnv){ pEnv->xShmBarrier(); } void lsmEnvShmUnmap(lsm_env *pEnv, lsm_file *pFile, int bDel){ pEnv->xShmUnmap(pFile, bDel); } void lsmEnvSleep(lsm_env *pEnv, int nUs){ pEnv->xSleep(pEnv, nUs); } /* ** Write the contents of string buffer pStr into the log file, starting at ** offset iOff. */ int lsmFsWriteLog(FileSystem *pFS, i64 iOff, LsmString *pStr){ assert( pFS->fdLog ); return lsmEnvWrite(pFS->pEnv, pFS->fdLog, iOff, pStr->z, pStr->n); } /* ** fsync() the log file. */ int lsmFsSyncLog(FileSystem *pFS){ assert( pFS->fdLog ); return lsmEnvSync(pFS->pEnv, pFS->fdLog); } /* ** Read nRead bytes of data starting at offset iOff of the log file. Append ** the results to string buffer pStr. */ int lsmFsReadLog(FileSystem *pFS, i64 iOff, int nRead, LsmString *pStr){ int rc; /* Return code */ assert( pFS->fdLog ); rc = lsmStringExtend(pStr, nRead); if( rc==LSM_OK ){ rc = lsmEnvRead(pFS->pEnv, pFS->fdLog, iOff, &pStr->z[pStr->n], nRead); pStr->n += nRead; } return rc; } /* ** Truncate the log file to nByte bytes in size. */ int lsmFsTruncateLog(FileSystem *pFS, i64 nByte){ if( pFS->fdLog==0 ) return LSM_OK; return lsmEnvTruncate(pFS->pEnv, pFS->fdLog, nByte); } /* ** Truncate the db file to nByte bytes in size. */ int lsmFsTruncateDb(FileSystem *pFS, i64 nByte){ if( pFS->fdDb==0 ) return LSM_OK; return lsmEnvTruncate(pFS->pEnv, pFS->fdDb, nByte); } /* ** Close the log file. Then delete it from the file-system. This function ** is called during database shutdown only. */ int lsmFsCloseAndDeleteLog(FileSystem *pFS){ char *zDel; if( pFS->fdLog ){ lsmEnvClose(pFS->pEnv, pFS->fdLog ); pFS->fdLog = 0; } zDel = lsmMallocPrintf(pFS->pEnv, "%s-log", pFS->zDb); if( zDel ){ lsmEnvUnlink(pFS->pEnv, zDel); lsmFree(pFS->pEnv, zDel); } return LSM_OK; } /* ** Return true if page iReal of the database should be accessed using mmap. ** False otherwise. */ static int fsMmapPage(FileSystem *pFS, Pgno iReal){ return ((i64)iReal*pFS->nPagesize <= pFS->nMapLimit); } /* ** Given that there are currently nHash slots in the hash table, return ** the hash key for file iFile, page iPg. */ static int fsHashKey(int nHash, Pgno iPg){ return (iPg % nHash); } /* ** This is a helper function for lsmFsOpen(). It opens a single file on ** disk (either the database or log file). */ static lsm_file *fsOpenFile( FileSystem *pFS, /* File system object */ int bReadonly, /* True to open this file read-only */ int bLog, /* True for log, false for db */ int *pRc /* IN/OUT: Error code */ ){ lsm_file *pFile = 0; if( *pRc==LSM_OK ){ int flags = (bReadonly ? LSM_OPEN_READONLY : 0); const char *zPath = (bLog ? pFS->zLog : pFS->zDb); *pRc = lsmEnvOpen(pFS->pEnv, zPath, flags, &pFile); } return pFile; } /* ** If it is not already open, this function opens the log file. It returns ** LSM_OK if successful (or if the log file was already open) or an LSM ** error code otherwise. ** ** The log file must be opened before any of the following may be called: ** ** lsmFsWriteLog ** lsmFsSyncLog ** lsmFsReadLog */ int lsmFsOpenLog(lsm_db *db, int *pbOpen){ int rc = LSM_OK; FileSystem *pFS = db->pFS; if( 0==pFS->fdLog ){ pFS->fdLog = fsOpenFile(pFS, db->bReadonly, 1, &rc); if( rc==LSM_IOERR_NOENT && db->bReadonly ){ rc = LSM_OK; } } if( pbOpen ) *pbOpen = (pFS->fdLog!=0); return rc; } /* ** Close the log file, if it is open. */ void lsmFsCloseLog(lsm_db *db){ FileSystem *pFS = db->pFS; if( pFS->fdLog ){ lsmEnvClose(pFS->pEnv, pFS->fdLog); pFS->fdLog = 0; } } /* ** Open a connection to a database stored within the file-system. ** ** If parameter bReadonly is true, then open a read-only file-descriptor ** on the database file. It is possible that bReadonly will be false even ** if the user requested that pDb be opened read-only. This is because the ** file-descriptor may later on be recycled by a read-write connection. ** If the db file can be opened for read-write access, it always is. Parameter ** bReadonly is only ever true if it has already been determined that the ** db can only be opened for read-only access. ** ** Return LSM_OK if successful or an lsm error code otherwise. */ int lsmFsOpen( lsm_db *pDb, /* Database connection to open fd for */ const char *zDb, /* Full path to database file */ int bReadonly /* True to open db file read-only */ ){ FileSystem *pFS; int rc = LSM_OK; int nDb = strlen(zDb); int nByte; assert( pDb->pFS==0 ); assert( pDb->pWorker==0 && pDb->pClient==0 ); nByte = sizeof(FileSystem) + nDb+1 + nDb+4+1; pFS = (FileSystem *)lsmMallocZeroRc(pDb->pEnv, nByte, &rc); if( pFS ){ LsmFile *pLsmFile; pFS->zDb = (char *)&pFS[1]; pFS->zLog = &pFS->zDb[nDb+1]; pFS->nPagesize = LSM_DFLT_PAGE_SIZE; pFS->nBlocksize = LSM_DFLT_BLOCK_SIZE; pFS->nMetasize = LSM_META_PAGE_SIZE; pFS->nMetaRwSize = LSM_META_RW_PAGE_SIZE; pFS->pDb = pDb; pFS->pEnv = pDb->pEnv; /* Make a copy of the database and log file names. */ memcpy(pFS->zDb, zDb, nDb+1); memcpy(pFS->zLog, zDb, nDb); memcpy(&pFS->zLog[nDb], "-log", 5); /* Allocate the hash-table here. At some point, it should be changed ** so that it can grow dynamicly. */ pFS->nCacheMax = 2048*1024 / pFS->nPagesize; pFS->nHash = 4096; pFS->apHash = lsmMallocZeroRc(pDb->pEnv, sizeof(Page *) * pFS->nHash, &rc); /* Open the database file */ pLsmFile = lsmDbRecycleFd(pDb); if( pLsmFile ){ pFS->pLsmFile = pLsmFile; pFS->fdDb = pLsmFile->pFile; memset(pLsmFile, 0, sizeof(LsmFile)); }else{ pFS->pLsmFile = lsmMallocZeroRc(pDb->pEnv, sizeof(LsmFile), &rc); if( rc==LSM_OK ){ pFS->fdDb = fsOpenFile(pFS, bReadonly, 0, &rc); } } if( rc!=LSM_OK ){ lsmFsClose(pFS); pFS = 0; }else{ pFS->szSector = lsmEnvSectorSize(pFS->pEnv, pFS->fdDb); } } pDb->pFS = pFS; return rc; } /* ** Configure the file-system object according to the current values of ** the LSM_CONFIG_MMAP and LSM_CONFIG_SET_COMPRESSION options. */ int lsmFsConfigure(lsm_db *db){ FileSystem *pFS = db->pFS; if( pFS ){ lsm_env *pEnv = pFS->pEnv; Page *pPg; assert( pFS->nOut==0 ); assert( pFS->pWaiting==0 ); assert( pFS->pMapped==0 ); /* Reset any compression/decompression buffers already allocated */ lsmFree(pEnv, pFS->aIBuffer); lsmFree(pEnv, pFS->aOBuffer); pFS->nBuffer = 0; /* Unmap the file, if it is currently mapped */ if( pFS->pMap ){ lsmEnvRemap(pEnv, pFS->fdDb, -1, &pFS->pMap, &pFS->nMap); pFS->nMapLimit = 0; } /* Free all allocated page structures */ pPg = pFS->pLruFirst; while( pPg ){ Page *pNext = pPg->pLruNext; assert( pPg->flags & PAGE_FREE ); lsmFree(pEnv, pPg->aData); lsmFree(pEnv, pPg); pPg = pNext; } pPg = pFS->pFree; while( pPg ){ Page *pNext = pPg->pFreeNext; lsmFree(pEnv, pPg); pPg = pNext; } /* Zero pointers that point to deleted page objects */ pFS->nCacheAlloc = 0; pFS->pLruFirst = 0; pFS->pLruLast = 0; pFS->pFree = 0; if( pFS->apHash ){ memset(pFS->apHash, 0, pFS->nHash*sizeof(pFS->apHash[0])); } /* Configure the FileSystem object */ if( db->compress.xCompress ){ pFS->pCompress = &db->compress; pFS->nMapLimit = 0; }else{ pFS->pCompress = 0; if( db->iMmap==1 ){ /* Unlimited */ pFS->nMapLimit = (i64)1 << 60; }else{ /* iMmap is a limit in KB. Set nMapLimit to the same value in bytes. */ pFS->nMapLimit = (i64)db->iMmap * 1024; } } } return LSM_OK; } /* ** Close and destroy a FileSystem object. */ void lsmFsClose(FileSystem *pFS){ if( pFS ){ Page *pPg; lsm_env *pEnv = pFS->pEnv; assert( pFS->nOut==0 ); pPg = pFS->pLruFirst; while( pPg ){ Page *pNext = pPg->pLruNext; if( pPg->flags & PAGE_FREE ) lsmFree(pEnv, pPg->aData); lsmFree(pEnv, pPg); pPg = pNext; } pPg = pFS->pFree; while( pPg ){ Page *pNext = pPg->pFreeNext; if( pPg->flags & PAGE_FREE ) lsmFree(pEnv, pPg->aData); lsmFree(pEnv, pPg); pPg = pNext; } if( pFS->fdDb ) lsmEnvClose(pFS->pEnv, pFS->fdDb ); if( pFS->fdLog ) lsmEnvClose(pFS->pEnv, pFS->fdLog ); lsmFree(pEnv, pFS->pLsmFile); lsmFree(pEnv, pFS->apHash); lsmFree(pEnv, pFS->aIBuffer); lsmFree(pEnv, pFS->aOBuffer); lsmFree(pEnv, pFS); } } /* ** This function is called when closing a database handle (i.e. lsm_close()) ** if there exist other connections to the same database within this process. ** In that case the file-descriptor open on the database file is not closed ** when the FileSystem object is destroyed, as this would cause any POSIX ** locks held by the other connections to be silently dropped (see "man close" ** for details). Instead, the file-descriptor is stored in a list by the ** lsm_shared.c module until it is either closed or reused. ** ** This function returns a pointer to an object that can be linked into ** the list described above. The returned object now 'owns' the database ** file descriptr, so that when the FileSystem object is destroyed, it ** will not be closed. ** ** This function may be called at most once in the life-time of a ** FileSystem object. The results of any operations involving the database ** file descriptor are undefined once this function has been called. ** ** None of this is necessary on non-POSIX systems. But we do it anyway in ** the name of using as similar code as possible on all platforms. */ LsmFile *lsmFsDeferClose(FileSystem *pFS){ LsmFile *p = pFS->pLsmFile; assert( p->pNext==0 ); p->pFile = pFS->fdDb; pFS->fdDb = 0; pFS->pLsmFile = 0; return p; } /* ** Allocate a buffer and populate it with the output of the xFileid() ** method of the database file handle. If successful, set *ppId to point ** to the buffer and *pnId to the number of bytes in the buffer and return ** LSM_OK. Otherwise, set *ppId and *pnId to zero and return an LSM ** error code. */ int lsmFsFileid(lsm_db *pDb, void **ppId, int *pnId){ lsm_env *pEnv = pDb->pEnv; FileSystem *pFS = pDb->pFS; int rc; int nId = 0; void *pId; rc = pEnv->xFileid(pFS->fdDb, 0, &nId); pId = lsmMallocZeroRc(pEnv, nId, &rc); if( rc==LSM_OK ) rc = pEnv->xFileid(pFS->fdDb, pId, &nId); if( rc!=LSM_OK ){ lsmFree(pEnv, pId); pId = 0; nId = 0; } *ppId = pId; *pnId = nId; return rc; } /* ** Return the nominal page-size used by this file-system. Actual pages ** may be smaller or larger than this value. */ int lsmFsPageSize(FileSystem *pFS){ return pFS->nPagesize; } /* ** Return the block-size used by this file-system. */ int lsmFsBlockSize(FileSystem *pFS){ return pFS->nBlocksize; } /* ** Configure the nominal page-size used by this file-system. Actual ** pages may be smaller or larger than this value. */ void lsmFsSetPageSize(FileSystem *pFS, int nPgsz){ pFS->nPagesize = nPgsz; pFS->nCacheMax = 2048*1024 / pFS->nPagesize; } /* ** Configure the block-size used by this file-system. */ void lsmFsSetBlockSize(FileSystem *pFS, int nBlocksize){ pFS->nBlocksize = nBlocksize; } /* ** Return the page number of the first page on block iBlock. Blocks are ** numbered starting from 1. ** ** For a compressed database, page numbers are byte offsets. The first ** page on each block is the byte offset immediately following the 4-byte ** "previous block" pointer at the start of each block. */ static Pgno fsFirstPageOnBlock(FileSystem *pFS, int iBlock){ Pgno iPg; if( pFS->pCompress ){ if( iBlock==1 ){ iPg = pFS->nMetasize * 2 + 4; }else{ iPg = pFS->nBlocksize * (Pgno)(iBlock-1) + 4; } }else{ const int nPagePerBlock = (pFS->nBlocksize / pFS->nPagesize); if( iBlock==1 ){ iPg = 1 + ((pFS->nMetasize*2 + pFS->nPagesize - 1) / pFS->nPagesize); }else{ iPg = 1 + (iBlock-1) * nPagePerBlock; } } return iPg; } /* ** Return the page number of the last page on block iBlock. Blocks are ** numbered starting from 1. ** ** For a compressed database, page numbers are byte offsets. The first ** page on each block is the byte offset of the byte immediately before ** the 4-byte "next block" pointer at the end of each block. */ static Pgno fsLastPageOnBlock(FileSystem *pFS, int iBlock){ if( pFS->pCompress ){ return pFS->nBlocksize * (Pgno)iBlock - 1 - 4; }else{ const int nPagePerBlock = (pFS->nBlocksize / pFS->nPagesize); return iBlock * nPagePerBlock; } } /* ** Return the block number of the block that page iPg is located on. ** Blocks are numbered starting from 1. */ static int fsPageToBlock(FileSystem *pFS, Pgno iPg){ if( pFS->pCompress ){ return (int)((iPg / pFS->nBlocksize) + 1); }else{ return (int)(1 + ((iPg-1) / (pFS->nBlocksize / pFS->nPagesize))); } } /* ** Return true if page iPg is the last page on its block. ** ** This function is only called in non-compressed database mode. */ static int fsIsLast(FileSystem *pFS, Pgno iPg){ const int nPagePerBlock = (pFS->nBlocksize / pFS->nPagesize); assert( !pFS->pCompress ); return ( iPg && (iPg % nPagePerBlock)==0 ); } /* ** Return true if page iPg is the first page on its block. ** ** This function is only called in non-compressed database mode. */ static int fsIsFirst(FileSystem *pFS, Pgno iPg){ const int nPagePerBlock = (pFS->nBlocksize / pFS->nPagesize); assert( !pFS->pCompress ); return ( (iPg % nPagePerBlock)==1 || (iPgnData; } return pPage->aData; } /* ** Return the page number of a page. */ Pgno lsmFsPageNumber(Page *pPage){ /* assert( (pPage->flags & PAGE_DIRTY)==0 ); */ return pPage ? pPage->iPg : 0; } /* ** Page pPg is currently part of the LRU list belonging to pFS. Remove ** it from the list. pPg->pLruNext and pPg->pLruPrev are cleared by this ** operation. */ static void fsPageRemoveFromLru(FileSystem *pFS, Page *pPg){ assert( pPg->pLruNext || pPg==pFS->pLruLast ); assert( pPg->pLruPrev || pPg==pFS->pLruFirst ); if( pPg->pLruNext ){ pPg->pLruNext->pLruPrev = pPg->pLruPrev; }else{ pFS->pLruLast = pPg->pLruPrev; } if( pPg->pLruPrev ){ pPg->pLruPrev->pLruNext = pPg->pLruNext; }else{ pFS->pLruFirst = pPg->pLruNext; } pPg->pLruPrev = 0; pPg->pLruNext = 0; } /* ** Page pPg is not currently part of the LRU list belonging to pFS. Add it. */ static void fsPageAddToLru(FileSystem *pFS, Page *pPg){ assert( pPg->pLruNext==0 && pPg->pLruPrev==0 ); pPg->pLruPrev = pFS->pLruLast; if( pPg->pLruPrev ){ pPg->pLruPrev->pLruNext = pPg; }else{ pFS->pLruFirst = pPg; } pFS->pLruLast = pPg; } /* ** Page pPg is currently stored in the apHash/nHash hash table. Remove it. */ static void fsPageRemoveFromHash(FileSystem *pFS, Page *pPg){ int iHash; Page **pp; iHash = fsHashKey(pFS->nHash, pPg->iPg); for(pp=&pFS->apHash[iHash]; *pp!=pPg; pp=&(*pp)->pHashNext); *pp = pPg->pHashNext; pPg->pHashNext = 0; } /* ** Free a Page object allocated by fsPageBuffer(). */ static void fsPageBufferFree(Page *pPg){ pPg->pFS->nCacheAlloc--; lsmFree(pPg->pFS->pEnv, pPg->aData); lsmFree(pPg->pFS->pEnv, pPg); } /* ** Purge the cache of all non-mmap pages with nRef==0. */ void lsmFsPurgeCache(FileSystem *pFS){ Page *pPg; pPg = pFS->pLruFirst; while( pPg ){ Page *pNext = pPg->pLruNext; assert( pPg->flags & PAGE_FREE ); fsPageRemoveFromHash(pFS, pPg); fsPageBufferFree(pPg); pPg = pNext; } pFS->pLruFirst = 0; pFS->pLruLast = 0; assert( pFS->nCacheAlloc<=pFS->nOut && pFS->nCacheAlloc>=0 ); } /* ** Search the hash-table for page iPg. If an entry is round, return a pointer ** to it. Otherwise, return NULL. ** ** Either way, if argument piHash is not NULL set *piHash to the hash slot ** number that page iPg would be stored in before returning. */ static Page *fsPageFindInHash(FileSystem *pFS, Pgno iPg, int *piHash){ Page *p; /* Return value */ int iHash = fsHashKey(pFS->nHash, iPg); if( piHash ) *piHash = iHash; for(p=pFS->apHash[iHash]; p; p=p->pHashNext){ if( p->iPg==iPg) break; } return p; } /* ** Allocate and return a non-mmap Page object. If there are already ** nCacheMax such Page objects outstanding, try to recycle an existing ** Page instead. */ static int fsPageBuffer( FileSystem *pFS, Page **ppOut ){ int rc = LSM_OK; Page *pPage = 0; if( pFS->pLruFirst==0 || pFS->nCacheAllocnCacheMax ){ /* Allocate a new Page object */ pPage = lsmMallocZero(pFS->pEnv, sizeof(Page)); if( !pPage ){ rc = LSM_NOMEM_BKPT; }else{ pPage->aData = (u8 *)lsmMalloc(pFS->pEnv, pFS->nPagesize); if( !pPage->aData ){ lsmFree(pFS->pEnv, pPage); rc = LSM_NOMEM_BKPT; pPage = 0; }else{ pFS->nCacheAlloc++; } } }else{ /* Reuse an existing Page object */ u8 *aData; pPage = pFS->pLruFirst; aData = pPage->aData; fsPageRemoveFromLru(pFS, pPage); fsPageRemoveFromHash(pFS, pPage); memset(pPage, 0, sizeof(Page)); pPage->aData = aData; } if( pPage ){ pPage->flags = PAGE_FREE; } *ppOut = pPage; return rc; } /* ** Assuming *pRc is initially LSM_OK, attempt to ensure that the ** memory-mapped region is at least iSz bytes in size. If it is not already, ** iSz bytes in size, extend it and update the pointers associated with any ** outstanding Page objects. ** ** If *pRc is not LSM_OK when this function is called, it is a no-op. ** Otherwise, *pRc is set to an lsm error code if an error occurs, or ** left unmodified otherwise. ** ** This function is never called in compressed database mode. */ static void fsGrowMapping( FileSystem *pFS, /* File system object */ i64 iSz, /* Minimum size to extend mapping to */ int *pRc /* IN/OUT: Error code */ ){ assert( pFS->pCompress==0 ); assert( PAGE_HASPREV==4 ); if( *pRc==LSM_OK && iSz>pFS->nMap ){ int rc; u8 *aOld = pFS->pMap; rc = lsmEnvRemap(pFS->pEnv, pFS->fdDb, iSz, &pFS->pMap, &pFS->nMap); if( rc==LSM_OK && pFS->pMap!=aOld ){ Page *pFix; i64 iOff = (u8 *)pFS->pMap - aOld; for(pFix=pFS->pMapped; pFix; pFix=pFix->pMappedNext){ pFix->aData += iOff; } lsmSortedRemap(pFS->pDb); } *pRc = rc; } } /* ** If it is mapped, unmap the database file. */ int lsmFsUnmap(FileSystem *pFS){ int rc = LSM_OK; if( pFS ){ rc = lsmEnvRemap(pFS->pEnv, pFS->fdDb, -1, &pFS->pMap, &pFS->nMap); } return rc; } /* ** fsync() the database file. */ int lsmFsSyncDb(FileSystem *pFS, int nBlock){ return lsmEnvSync(pFS->pEnv, pFS->fdDb); } /* ** If block iBlk has been redirected according to the redirections in the ** object passed as the first argument, return the destination block to ** which it is redirected. Otherwise, return a copy of iBlk. */ static int fsRedirectBlock(Redirect *p, int iBlk){ if( p ){ int i; for(i=0; in; i++){ if( iBlk==p->a[i].iFrom ) return p->a[i].iTo; } } assert( iBlk!=0 ); return iBlk; } /* ** If page iPg has been redirected according to the redirections in the ** object passed as the second argument, return the destination page to ** which it is redirected. Otherwise, return a copy of iPg. */ Pgno lsmFsRedirectPage(FileSystem *pFS, Redirect *pRedir, Pgno iPg){ Pgno iReal = iPg; if( pRedir ){ const int nPagePerBlock = ( pFS->pCompress ? pFS->nBlocksize : (pFS->nBlocksize / pFS->nPagesize) ); int iBlk = fsPageToBlock(pFS, iPg); int i; for(i=0; in; i++){ int iFrom = pRedir->a[i].iFrom; if( iFrom>iBlk ) break; if( iFrom==iBlk ){ int iTo = pRedir->a[i].iTo; iReal = iPg - (Pgno)(iFrom - iTo) * nPagePerBlock; if( iTo==1 ){ iReal += (fsFirstPageOnBlock(pFS, 1)-1); } break; } } } assert( iReal!=0 ); return iReal; } /* Required by the circular fsBlockNext<->fsPageGet dependency. */ static int fsPageGet(FileSystem *, Segment *, Pgno, int, Page **, int *); /* ** Parameter iBlock is a database file block. This function reads the value ** stored in the blocks "next block" pointer and stores it in *piNext. ** LSM_OK is returned if everything is successful, or an LSM error code ** otherwise. */ static int fsBlockNext( FileSystem *pFS, /* File-system object handle */ Segment *pSeg, /* Use this segment for block redirects */ int iBlock, /* Read field from this block */ int *piNext /* OUT: Next block in linked list */ ){ int rc; int iRead; /* Read block from here */ if( pSeg ){ iRead = fsRedirectBlock(pSeg->pRedirect, iBlock); }else{ iRead = iBlock; } assert( pFS->nMapLimit==0 || pFS->pCompress==0 ); if( pFS->pCompress ){ i64 iOff; /* File offset to read data from */ u8 aNext[4]; /* 4-byte pointer read from db file */ iOff = (i64)iRead * pFS->nBlocksize - sizeof(aNext); rc = lsmEnvRead(pFS->pEnv, pFS->fdDb, iOff, aNext, sizeof(aNext)); if( rc==LSM_OK ){ *piNext = (int)lsmGetU32(aNext); } }else{ const int nPagePerBlock = (pFS->nBlocksize / pFS->nPagesize); Page *pLast; rc = fsPageGet(pFS, 0, iRead*nPagePerBlock, 0, &pLast, 0); if( rc==LSM_OK ){ *piNext = lsmGetU32(&pLast->aData[pFS->nPagesize-4]); lsmFsPageRelease(pLast); } } if( pSeg ){ *piNext = fsRedirectBlock(pSeg->pRedirect, *piNext); } return rc; } /* ** Return the page number of the last page on the same block as page iPg. */ Pgno fsLastPageOnPagesBlock(FileSystem *pFS, Pgno iPg){ return fsLastPageOnBlock(pFS, fsPageToBlock(pFS, iPg)); } /* ** Read nData bytes of data from offset iOff of the database file into ** buffer aData. If this means reading past the end of a block, follow ** the block pointer to the next block and continue reading. ** ** Offset iOff is an absolute offset - not subject to any block redirection. ** However any block pointer followed is. Use pSeg->pRedirect in this case. ** ** This function is only called in compressed database mode. */ static int fsReadData( FileSystem *pFS, /* File-system handle */ Segment *pSeg, /* Block redirection */ i64 iOff, /* Read data from this offset */ u8 *aData, /* Buffer to read data into */ int nData /* Number of bytes to read */ ){ i64 iEob; /* End of block */ int nRead; int rc; assert( pFS->pCompress ); iEob = fsLastPageOnPagesBlock(pFS, iOff) + 1; nRead = (int)LSM_MIN(iEob - iOff, nData); rc = lsmEnvRead(pFS->pEnv, pFS->fdDb, iOff, aData, nRead); if( rc==LSM_OK && nRead!=nData ){ int iBlk; rc = fsBlockNext(pFS, pSeg, fsPageToBlock(pFS, iOff), &iBlk); if( rc==LSM_OK ){ i64 iOff2 = fsFirstPageOnBlock(pFS, iBlk); rc = lsmEnvRead(pFS->pEnv, pFS->fdDb, iOff2, &aData[nRead], nData-nRead); } } return rc; } /* ** Parameter iBlock is a database file block. This function reads the value ** stored in the blocks "previous block" pointer and stores it in *piPrev. ** LSM_OK is returned if everything is successful, or an LSM error code ** otherwise. */ static int fsBlockPrev( FileSystem *pFS, /* File-system object handle */ Segment *pSeg, /* Use this segment for block redirects */ int iBlock, /* Read field from this block */ int *piPrev /* OUT: Previous block in linked list */ ){ int rc = LSM_OK; /* Return code */ assert( pFS->nMapLimit==0 || pFS->pCompress==0 ); assert( iBlock>0 ); if( pFS->pCompress ){ i64 iOff = fsFirstPageOnBlock(pFS, iBlock) - 4; u8 aPrev[4]; /* 4-byte pointer read from db file */ rc = lsmEnvRead(pFS->pEnv, pFS->fdDb, iOff, aPrev, sizeof(aPrev)); if( rc==LSM_OK ){ Redirect *pRedir = (pSeg ? pSeg->pRedirect : 0); *piPrev = fsRedirectBlock(pRedir, (int)lsmGetU32(aPrev)); } }else{ assert( 0 ); } return rc; } /* ** Encode and decode routines for record size fields. */ static void putRecordSize(u8 *aBuf, int nByte, int bFree){ aBuf[0] = (u8)(nByte >> 14) | 0x80; aBuf[1] = ((u8)(nByte >> 7) & 0x7F) | (bFree ? 0x00 : 0x80); aBuf[2] = (u8)nByte | 0x80; } static int getRecordSize(u8 *aBuf, int *pbFree){ int nByte; nByte = (aBuf[0] & 0x7F) << 14; nByte += (aBuf[1] & 0x7F) << 7; nByte += (aBuf[2] & 0x7F); *pbFree = !(aBuf[1] & 0x80); return nByte; } /* ** Subtract iSub from database file offset iOff and set *piRes to the ** result. If doing so means passing the start of a block, follow the ** block pointer stored in the first 4 bytes of the block. ** ** Offset iOff is an absolute offset - not subject to any block redirection. ** However any block pointer followed is. Use pSeg->pRedirect in this case. ** ** Return LSM_OK if successful or an lsm error code if an error occurs. */ static int fsSubtractOffset( FileSystem *pFS, Segment *pSeg, i64 iOff, int iSub, i64 *piRes ){ i64 iStart; int iBlk = 0; int rc; assert( pFS->pCompress ); iStart = fsFirstPageOnBlock(pFS, fsPageToBlock(pFS, iOff)); if( (iOff-iSub)>=iStart ){ *piRes = (iOff-iSub); return LSM_OK; } rc = fsBlockPrev(pFS, pSeg, fsPageToBlock(pFS, iOff), &iBlk); *piRes = fsLastPageOnBlock(pFS, iBlk) - iSub + (iOff - iStart + 1); return rc; } /* ** Add iAdd to database file offset iOff and set *piRes to the ** result. If doing so means passing the end of a block, follow the ** block pointer stored in the last 4 bytes of the block. ** ** Offset iOff is an absolute offset - not subject to any block redirection. ** However any block pointer followed is. Use pSeg->pRedirect in this case. ** ** Return LSM_OK if successful or an lsm error code if an error occurs. */ static int fsAddOffset( FileSystem *pFS, Segment *pSeg, i64 iOff, int iAdd, i64 *piRes ){ i64 iEob; int iBlk; int rc; assert( pFS->pCompress ); iEob = fsLastPageOnPagesBlock(pFS, iOff); if( (iOff+iAdd)<=iEob ){ *piRes = (iOff+iAdd); return LSM_OK; } rc = fsBlockNext(pFS, pSeg, fsPageToBlock(pFS, iOff), &iBlk); *piRes = fsFirstPageOnBlock(pFS, iBlk) + iAdd - (iEob - iOff + 1); return rc; } /* ** If it is not already allocated, allocate either the FileSystem.aOBuffer (if ** bWrite is true) or the FileSystem.aIBuffer (if bWrite is false). Return ** LSM_OK if successful if the attempt to allocate memory fails. */ static int fsAllocateBuffer(FileSystem *pFS, int bWrite){ u8 **pp; /* Pointer to either aIBuffer or aOBuffer */ assert( pFS->pCompress ); /* If neither buffer has been allocated, figure out how large they ** should be. Store this value in FileSystem.nBuffer. */ if( pFS->nBuffer==0 ){ assert( pFS->aIBuffer==0 && pFS->aOBuffer==0 ); pFS->nBuffer = pFS->pCompress->xBound(pFS->pCompress->pCtx, pFS->nPagesize); if( pFS->nBuffer<(pFS->szSector+6) ){ pFS->nBuffer = pFS->szSector+6; } } pp = (bWrite ? &pFS->aOBuffer : &pFS->aIBuffer); if( *pp==0 ){ *pp = lsmMalloc(pFS->pEnv, LSM_MAX(pFS->nBuffer, pFS->nPagesize)); if( *pp==0 ) return LSM_NOMEM_BKPT; } return LSM_OK; } /* ** This function is only called in compressed database mode. It reads and ** uncompresses the compressed data for page pPg from the database and ** populates the pPg->aData[] buffer and pPg->nCompress field. ** ** It is possible that instead of a page record, there is free space ** at offset pPg->iPgno. In this case no data is read from the file, but ** output variable *pnSpace is set to the total number of free bytes. ** ** LSM_OK is returned if successful, or an LSM error code otherwise. */ static int fsReadPagedata( FileSystem *pFS, /* File-system handle */ Segment *pSeg, /* pPg is part of this segment */ Page *pPg, /* Page to read and uncompress data for */ int *pnSpace /* OUT: Total bytes of free space */ ){ lsm_compress *p = pFS->pCompress; i64 iOff = pPg->iPg; u8 aSz[3]; int rc; assert( p && pPg->nCompress==0 ); if( fsAllocateBuffer(pFS, 0) ) return LSM_NOMEM; rc = fsReadData(pFS, pSeg, iOff, aSz, sizeof(aSz)); if( rc==LSM_OK ){ int bFree; if( aSz[0] & 0x80 ){ pPg->nCompress = (int)getRecordSize(aSz, &bFree); }else{ pPg->nCompress = (int)aSz[0] - sizeof(aSz)*2; bFree = 1; } if( bFree ){ if( pnSpace ){ *pnSpace = pPg->nCompress + sizeof(aSz)*2; }else{ rc = LSM_CORRUPT_BKPT; } }else{ rc = fsAddOffset(pFS, pSeg, iOff, 3, &iOff); if( rc==LSM_OK ){ if( pPg->nCompress>pFS->nBuffer ){ rc = LSM_CORRUPT_BKPT; }else{ rc = fsReadData(pFS, pSeg, iOff, pFS->aIBuffer, pPg->nCompress); } if( rc==LSM_OK ){ int n = pFS->nPagesize; rc = p->xUncompress(p->pCtx, (char *)pPg->aData, &n, (const char *)pFS->aIBuffer, pPg->nCompress ); if( rc==LSM_OK && n!=pPg->pFS->nPagesize ){ rc = LSM_CORRUPT_BKPT; } } } } } return rc; } /* ** Return a handle for a database page. ** ** If this file-system object is accessing a compressed database it may be ** that there is no page record at database file offset iPg. Instead, there ** may be a free space record. In this case, set *ppPg to NULL and *pnSpace ** to the total number of free bytes before returning. ** ** If no error occurs, LSM_OK is returned. Otherwise, an lsm error code. */ static int fsPageGet( FileSystem *pFS, /* File-system handle */ Segment *pSeg, /* Block redirection to use (or NULL) */ Pgno iPg, /* Page id */ int noContent, /* True to not load content from disk */ Page **ppPg, /* OUT: New page handle */ int *pnSpace /* OUT: Bytes of free space */ ){ Page *p; int iHash; int rc = LSM_OK; /* In most cases iReal is the same as iPg. Except, if pSeg->pRedirect is ** not NULL, and the block containing iPg has been redirected, then iReal ** is the page number after redirection. */ Pgno iReal = lsmFsRedirectPage(pFS, (pSeg ? pSeg->pRedirect : 0), iPg); assert_lists_are_ok(pFS); assert( iPg>=fsFirstPageOnBlock(pFS, 1) ); assert( iReal>=fsFirstPageOnBlock(pFS, 1) ); *ppPg = 0; /* Search the hash-table for the page */ p = fsPageFindInHash(pFS, iReal, &iHash); if( p ){ assert( p->flags & PAGE_FREE ); if( p->nRef==0 ) fsPageRemoveFromLru(pFS, p); }else{ if( fsMmapPage(pFS, iReal) ){ i64 iEnd = (i64)iReal * pFS->nPagesize; fsGrowMapping(pFS, iEnd, &rc); if( rc!=LSM_OK ) return rc; if( pFS->pFree ){ p = pFS->pFree; pFS->pFree = p->pFreeNext; assert( p->nRef==0 ); }else{ p = lsmMallocZeroRc(pFS->pEnv, sizeof(Page), &rc); if( rc ) return rc; p->pFS = pFS; } p->aData = &((u8 *)pFS->pMap)[pFS->nPagesize * (iReal-1)]; p->iPg = iReal; /* This page now carries a pointer to the mapping. Link it in to ** the FileSystem.pMapped list. */ assert( p->pMappedNext==0 ); p->pMappedNext = pFS->pMapped; pFS->pMapped = p; assert( pFS->pCompress==0 ); assert( (p->flags & PAGE_FREE)==0 ); }else{ rc = fsPageBuffer(pFS, &p); if( rc==LSM_OK ){ int nSpace = 0; p->iPg = iReal; p->nRef = 0; p->pFS = pFS; assert( p->flags==0 || p->flags==PAGE_FREE ); #ifdef LSM_DEBUG memset(p->aData, 0x56, pFS->nPagesize); #endif assert( p->pLruNext==0 && p->pLruPrev==0 ); if( noContent==0 ){ if( pFS->pCompress ){ rc = fsReadPagedata(pFS, pSeg, p, &nSpace); }else{ int nByte = pFS->nPagesize; i64 iOff = (i64)(iReal-1) * pFS->nPagesize; rc = lsmEnvRead(pFS->pEnv, pFS->fdDb, iOff, p->aData, nByte); } pFS->nRead++; } /* If the xRead() call was successful (or not attempted), link the ** page into the page-cache hash-table. Otherwise, if it failed, ** free the buffer. */ if( rc==LSM_OK && nSpace==0 ){ p->pHashNext = pFS->apHash[iHash]; pFS->apHash[iHash] = p; }else{ fsPageBufferFree(p); p = 0; if( pnSpace ) *pnSpace = nSpace; } } } assert( (rc==LSM_OK && (p || (pnSpace && *pnSpace))) || (rc!=LSM_OK && p==0) ); } if( rc==LSM_OK && p ){ if( pFS->pCompress==0 && (fsIsLast(pFS, iReal) || fsIsFirst(pFS, iReal)) ){ p->nData = pFS->nPagesize - 4; if( fsIsFirst(pFS, iReal) && p->nRef==0 ){ p->aData += 4; p->flags |= PAGE_HASPREV; } }else{ p->nData = pFS->nPagesize; } pFS->nOut += (p->nRef==0); p->nRef++; } *ppPg = p; return rc; } /* ** Read the 64-bit checkpoint id of the checkpoint currently stored on meta ** page iMeta of the database file. If no error occurs, store the id value ** in *piVal and return LSM_OK. Otherwise, return an LSM error code and leave ** *piVal unmodified. ** ** If a checkpointer connection is currently updating meta-page iMeta, or an ** earlier checkpointer crashed while doing so, the value read into *piVal ** may be garbage. It is the callers responsibility to deal with this. */ int lsmFsReadSyncedId(lsm_db *db, int iMeta, i64 *piVal){ FileSystem *pFS = db->pFS; int rc = LSM_OK; assert( iMeta==1 || iMeta==2 ); if( pFS->nMapLimit>0 ){ fsGrowMapping(pFS, iMeta*LSM_META_PAGE_SIZE, &rc); if( rc==LSM_OK ){ *piVal = (i64)lsmGetU64(&((u8 *)pFS->pMap)[(iMeta-1)*LSM_META_PAGE_SIZE]); } }else{ MetaPage *pMeta = 0; rc = lsmFsMetaPageGet(pFS, 0, iMeta, &pMeta); if( rc==LSM_OK ){ *piVal = (i64)lsmGetU64(pMeta->aData); lsmFsMetaPageRelease(pMeta); } } return rc; } /* ** Return true if the first or last page of segment pRun falls between iFirst ** and iLast, inclusive, and pRun is not equal to pIgnore. */ static int fsRunEndsBetween( Segment *pRun, Segment *pIgnore, Pgno iFirst, Pgno iLast ){ return (pRun!=pIgnore && ( (pRun->iFirst>=iFirst && pRun->iFirst<=iLast) || (pRun->iLastPg>=iFirst && pRun->iLastPg<=iLast) )); } /* ** Return true if level pLevel contains a segment other than pIgnore for ** which the first or last page is between iFirst and iLast, inclusive. */ static int fsLevelEndsBetween( Level *pLevel, Segment *pIgnore, Pgno iFirst, Pgno iLast ){ int i; if( fsRunEndsBetween(&pLevel->lhs, pIgnore, iFirst, iLast) ){ return 1; } for(i=0; inRight; i++){ if( fsRunEndsBetween(&pLevel->aRhs[i], pIgnore, iFirst, iLast) ){ return 1; } } return 0; } /* ** Block iBlk is no longer in use by segment pIgnore. If it is not in use ** by any other segment, move it to the free block list. */ static int fsFreeBlock( FileSystem *pFS, /* File system object */ Snapshot *pSnapshot, /* Worker snapshot */ Segment *pIgnore, /* Ignore this run when searching */ int iBlk /* Block number of block to free */ ){ int rc = LSM_OK; /* Return code */ Pgno iFirst; /* First page on block iBlk */ Pgno iLast; /* Last page on block iBlk */ Level *pLevel; /* Used to iterate through levels */ int iIn; /* Used to iterate through append points */ int iOut = 0; /* Used to output append points */ Pgno *aApp = pSnapshot->aiAppend; iFirst = fsFirstPageOnBlock(pFS, iBlk); iLast = fsLastPageOnBlock(pFS, iBlk); /* Check if any other run in the snapshot has a start or end page ** within this block. If there is such a run, return early. */ for(pLevel=lsmDbSnapshotLevel(pSnapshot); pLevel; pLevel=pLevel->pNext){ if( fsLevelEndsBetween(pLevel, pIgnore, iFirst, iLast) ){ return LSM_OK; } } /* Remove any entries that lie on this block from the append-list. */ for(iIn=0; iIniLast ){ aApp[iOut++] = aApp[iIn]; } } while( iOutpDb, iBlk); } return rc; } /* ** Delete or otherwise recycle the blocks currently occupied by run pDel. */ int lsmFsSortedDelete( FileSystem *pFS, Snapshot *pSnapshot, int bZero, /* True to zero the Segment structure */ Segment *pDel ){ if( pDel->iFirst ){ int rc = LSM_OK; int iBlk; int iLastBlk; iBlk = fsPageToBlock(pFS, pDel->iFirst); iLastBlk = fsPageToBlock(pFS, pDel->iLastPg); /* Mark all blocks currently used by this sorted run as free */ while( iBlk && rc==LSM_OK ){ int iNext = 0; if( iBlk!=iLastBlk ){ rc = fsBlockNext(pFS, pDel, iBlk, &iNext); }else if( bZero==0 && pDel->iLastPg!=fsLastPageOnBlock(pFS, iLastBlk) ){ break; } rc = fsFreeBlock(pFS, pSnapshot, pDel, iBlk); iBlk = iNext; } if( pDel->pRedirect ){ assert( pDel->pRedirect==&pSnapshot->redirect ); pSnapshot->redirect.n = 0; } if( bZero ) memset(pDel, 0, sizeof(Segment)); } return LSM_OK; } /* ** aPgno is an array containing nPgno page numbers. Return the smallest page ** number from the array that falls on block iBlk. Or, if none of the pages ** in aPgno[] fall on block iBlk, return 0. */ static Pgno firstOnBlock(FileSystem *pFS, int iBlk, Pgno *aPgno, int nPgno){ Pgno iRet = 0; int i; for(i=0; ipRedirect, iPg)); } /* ** Return true if the second argument is not NULL and any of the first ** last or root pages lie on a redirected block. */ static int fsSegmentRedirects(FileSystem *pFS, Segment *p){ return (p && ( fsPageRedirects(pFS, p, p->iFirst) || fsPageRedirects(pFS, p, p->iRoot) || fsPageRedirects(pFS, p, p->iLastPg) )); } #endif /* ** Argument aPgno is an array of nPgno page numbers. All pages belong to ** the segment pRun. This function gobbles from the start of the run to the ** first page that appears in aPgno[] (i.e. so that the aPgno[] entry is ** the new first page of the run). */ void lsmFsGobble( lsm_db *pDb, Segment *pRun, Pgno *aPgno, int nPgno ){ int rc = LSM_OK; FileSystem *pFS = pDb->pFS; Snapshot *pSnapshot = pDb->pWorker; int iBlk; assert( pRun->nSize>0 ); assert( 0==fsSegmentRedirects(pFS, pRun) ); assert( nPgno>0 && 0==fsPageRedirects(pFS, pRun, aPgno[0]) ); iBlk = fsPageToBlock(pFS, pRun->iFirst); pRun->nSize += (int)(pRun->iFirst - fsFirstPageOnBlock(pFS, iBlk)); while( rc==LSM_OK ){ int iNext = 0; Pgno iFirst = firstOnBlock(pFS, iBlk, aPgno, nPgno); if( iFirst ){ pRun->iFirst = iFirst; break; } rc = fsBlockNext(pFS, pRun, iBlk, &iNext); if( rc==LSM_OK ) rc = fsFreeBlock(pFS, pSnapshot, pRun, iBlk); pRun->nSize -= (int)( 1 + fsLastPageOnBlock(pFS, iBlk) - fsFirstPageOnBlock(pFS, iBlk) ); iBlk = iNext; } pRun->nSize -= (int)(pRun->iFirst - fsFirstPageOnBlock(pFS, iBlk)); assert( pRun->nSize>0 ); } /* ** This function is only used in compressed database mode. ** ** Argument iPg is the page number (byte offset) of a page within segment ** pSeg. The page record, including all headers, is nByte bytes in size. ** Before returning, set *piNext to the page number of the next page in ** the segment, or to zero if iPg is the last. ** ** In other words, do: ** ** *piNext = iPg + nByte; ** ** But take block overflow and redirection into account. */ static int fsNextPageOffset( FileSystem *pFS, /* File system object */ Segment *pSeg, /* Segment to move within */ Pgno iPg, /* Offset of current page */ int nByte, /* Size of current page including headers */ Pgno *piNext /* OUT: Offset of next page. Or zero (EOF) */ ){ Pgno iNext; int rc; assert( pFS->pCompress ); rc = fsAddOffset(pFS, pSeg, iPg, nByte-1, &iNext); if( pSeg && iNext==pSeg->iLastPg ){ iNext = 0; }else if( rc==LSM_OK ){ rc = fsAddOffset(pFS, pSeg, iNext, 1, &iNext); } *piNext = iNext; return rc; } /* ** This function is only used in compressed database mode. ** ** Argument iPg is the page number of a pagethat appears in segment pSeg. ** This function determines the page number of the previous page in the ** same run. *piPrev is set to the previous page number before returning. ** ** LSM_OK is returned if no error occurs. Otherwise, an lsm error code. ** If any value other than LSM_OK is returned, then the final value of ** *piPrev is undefined. */ static int fsGetPageBefore( FileSystem *pFS, Segment *pSeg, Pgno iPg, Pgno *piPrev ){ u8 aSz[3]; int rc; i64 iRead; assert( pFS->pCompress ); rc = fsSubtractOffset(pFS, pSeg, iPg, sizeof(aSz), &iRead); if( rc==LSM_OK ) rc = fsReadData(pFS, pSeg, iRead, aSz, sizeof(aSz)); if( rc==LSM_OK ){ int bFree; int nSz; if( aSz[2] & 0x80 ){ nSz = getRecordSize(aSz, &bFree) + sizeof(aSz)*2; }else{ nSz = (int)(aSz[2] & 0x7F); bFree = 1; } rc = fsSubtractOffset(pFS, pSeg, iPg, nSz, piPrev); } return rc; } /* ** The first argument to this function is a valid reference to a database ** file page that is part of a sorted run. If parameter eDir is -1, this ** function attempts to locate and load the previous page in the same run. ** Or, if eDir is +1, it attempts to find the next page in the same run. ** The results of passing an eDir value other than positive or negative one ** are undefined. ** ** If parameter pRun is not NULL then it must point to the run that page ** pPg belongs to. In this case, if pPg is the first or last page of the ** run, and the request is for the previous or next page, respectively, ** *ppNext is set to NULL before returning LSM_OK. If pRun is NULL, then it ** is assumed that the next or previous page, as requested, exists. ** ** If the previous/next page does exist and is successfully loaded, *ppNext ** is set to point to it and LSM_OK is returned. Otherwise, if an error ** occurs, *ppNext is set to NULL and and lsm error code returned. ** ** Page references returned by this function should be released by the ** caller using lsmFsPageRelease(). */ int lsmFsDbPageNext(Segment *pRun, Page *pPg, int eDir, Page **ppNext){ int rc = LSM_OK; FileSystem *pFS = pPg->pFS; Pgno iPg = pPg->iPg; assert( 0==fsSegmentRedirects(pFS, pRun) ); if( pFS->pCompress ){ int nSpace = pPg->nCompress + 2*3; do { if( eDir>0 ){ rc = fsNextPageOffset(pFS, pRun, iPg, nSpace, &iPg); }else{ if( iPg==pRun->iFirst ){ iPg = 0; }else{ rc = fsGetPageBefore(pFS, pRun, iPg, &iPg); } } nSpace = 0; if( iPg!=0 ){ rc = fsPageGet(pFS, pRun, iPg, 0, ppNext, &nSpace); assert( (*ppNext==0)==(rc!=LSM_OK || nSpace>0) ); }else{ *ppNext = 0; } }while( nSpace>0 && rc==LSM_OK ); }else{ Redirect *pRedir = pRun ? pRun->pRedirect : 0; assert( eDir==1 || eDir==-1 ); if( eDir<0 ){ if( pRun && iPg==pRun->iFirst ){ *ppNext = 0; return LSM_OK; }else if( fsIsFirst(pFS, iPg) ){ assert( pPg->flags & PAGE_HASPREV ); iPg = fsLastPageOnBlock(pFS, lsmGetU32(&pPg->aData[-4])); }else{ iPg--; } }else{ if( pRun ){ if( iPg==pRun->iLastPg ){ *ppNext = 0; return LSM_OK; } } if( fsIsLast(pFS, iPg) ){ int iBlk = fsRedirectBlock( pRedir, lsmGetU32(&pPg->aData[pFS->nPagesize-4]) ); iPg = fsFirstPageOnBlock(pFS, iBlk); }else{ iPg++; } } rc = fsPageGet(pFS, pRun, iPg, 0, ppNext, 0); } return rc; } /* ** This function is called when creating a new segment to determine if the ** first part of it can be written following an existing segment on an ** already allocated block. If it is possible, the page number of the first ** page to use for the new segment is returned. Otherwise zero. ** ** If argument pLvl is not NULL, then this function will not attempt to ** start the new segment immediately following any segment that is part ** of the right-hand-side of pLvl. */ static Pgno findAppendPoint(FileSystem *pFS, Level *pLvl){ int i; Pgno *aiAppend = pFS->pDb->pWorker->aiAppend; Pgno iRet = 0; for(i=LSM_APPLIST_SZ-1; iRet==0 && i>=0; i--){ if( (iRet = aiAppend[i]) ){ if( pLvl ){ int iBlk = fsPageToBlock(pFS, iRet); int j; for(j=0; iRet && jnRight; j++){ if( fsPageToBlock(pFS, pLvl->aRhs[j].iLastPg)==iBlk ){ iRet = 0; } } } if( iRet ) aiAppend[i] = 0; } } return iRet; } /* ** Append a page to the left-hand-side of pLvl. Set the ref-count to 1 and ** return a pointer to it. The page is writable until either ** lsmFsPagePersist() is called on it or the ref-count drops to zero. */ int lsmFsSortedAppend( FileSystem *pFS, Snapshot *pSnapshot, Level *pLvl, int bDefer, Page **ppOut ){ int rc = LSM_OK; Page *pPg = 0; Pgno iApp = 0; Pgno iNext = 0; Segment *p = &pLvl->lhs; Pgno iPrev = p->iLastPg; *ppOut = 0; assert( p->pRedirect==0 ); if( pFS->pCompress || bDefer ){ /* In compressed database mode the page is not assigned a page number ** or location in the database file at this point. This will be done ** by the lsmFsPagePersist() call. */ rc = fsPageBuffer(pFS, &pPg); if( rc==LSM_OK ){ pPg->pFS = pFS; pPg->pSeg = p; pPg->iPg = 0; pPg->flags |= PAGE_DIRTY; pPg->nData = pFS->nPagesize; assert( pPg->aData ); if( pFS->pCompress==0 ) pPg->nData -= 4; pPg->nRef = 1; pFS->nOut++; } }else{ if( iPrev==0 ){ iApp = findAppendPoint(pFS, pLvl); }else if( fsIsLast(pFS, iPrev) ){ int iNext2; rc = fsBlockNext(pFS, 0, fsPageToBlock(pFS, iPrev), &iNext2); if( rc!=LSM_OK ) return rc; iApp = fsFirstPageOnBlock(pFS, iNext2); }else{ iApp = iPrev + 1; } /* If this is the first page allocated, or if the page allocated is the ** last in the block, also allocate the next block here. */ if( iApp==0 || fsIsLast(pFS, iApp) ){ int iNew; /* New block number */ rc = lsmBlockAllocate(pFS->pDb, 0, &iNew); if( rc!=LSM_OK ) return rc; if( iApp==0 ){ iApp = fsFirstPageOnBlock(pFS, iNew); }else{ iNext = fsFirstPageOnBlock(pFS, iNew); } } /* Grab the new page. */ pPg = 0; rc = fsPageGet(pFS, 0, iApp, 1, &pPg, 0); assert( rc==LSM_OK || pPg==0 ); /* If this is the first or last page of a block, fill in the pointer ** value at the end of the new page. */ if( rc==LSM_OK ){ p->nSize++; p->iLastPg = iApp; if( p->iFirst==0 ) p->iFirst = iApp; pPg->flags |= PAGE_DIRTY; if( fsIsLast(pFS, iApp) ){ lsmPutU32(&pPg->aData[pFS->nPagesize-4], fsPageToBlock(pFS, iNext)); }else if( fsIsFirst(pFS, iApp) ){ lsmPutU32(&pPg->aData[-4], fsPageToBlock(pFS, iPrev)); } } } *ppOut = pPg; return rc; } /* ** Mark the segment passed as the second argument as finished. Once a segment ** is marked as finished it is not possible to append any further pages to ** it. ** ** Return LSM_OK if successful or an lsm error code if an error occurs. */ int lsmFsSortedFinish(FileSystem *pFS, Segment *p){ int rc = LSM_OK; if( p && p->iLastPg ){ assert( p->pRedirect==0 ); /* Check if the last page of this run happens to be the last of a block. ** If it is, then an extra block has already been allocated for this run. ** Shift this extra block back to the free-block list. ** ** Otherwise, add the first free page in the last block used by the run ** to the lAppend list. */ if( fsLastPageOnPagesBlock(pFS, p->iLastPg)!=p->iLastPg ){ int i; Pgno *aiAppend = pFS->pDb->pWorker->aiAppend; for(i=0; iiLastPg+1; break; } } }else if( pFS->pCompress==0 ){ Page *pLast; rc = fsPageGet(pFS, 0, p->iLastPg, 0, &pLast, 0); if( rc==LSM_OK ){ int iBlk = (int)lsmGetU32(&pLast->aData[pFS->nPagesize-4]); lsmBlockRefree(pFS->pDb, iBlk); lsmFsPageRelease(pLast); } }else{ int iBlk = 0; rc = fsBlockNext(pFS, p, fsPageToBlock(pFS, p->iLastPg), &iBlk); if( rc==LSM_OK ){ lsmBlockRefree(pFS->pDb, iBlk); } } } return rc; } /* ** Obtain a reference to page number iPg. ** ** Return LSM_OK if successful, or an lsm error code if an error occurs. */ int lsmFsDbPageGet(FileSystem *pFS, Segment *pSeg, Pgno iPg, Page **ppPg){ return fsPageGet(pFS, pSeg, iPg, 0, ppPg, 0); } /* ** Obtain a reference to the last page in the segment passed as the ** second argument. ** ** Return LSM_OK if successful, or an lsm error code if an error occurs. */ int lsmFsDbPageLast(FileSystem *pFS, Segment *pSeg, Page **ppPg){ int rc; Pgno iPg = pSeg->iLastPg; if( pFS->pCompress ){ int nSpace; iPg++; do { nSpace = 0; rc = fsGetPageBefore(pFS, pSeg, iPg, &iPg); if( rc==LSM_OK ){ rc = fsPageGet(pFS, pSeg, iPg, 0, ppPg, &nSpace); } }while( rc==LSM_OK && nSpace>0 ); }else{ rc = fsPageGet(pFS, pSeg, iPg, 0, ppPg, 0); } return rc; } /* ** Return a reference to meta-page iPg. If successful, LSM_OK is returned ** and *ppPg populated with the new page reference. The reference should ** be released by the caller using lsmFsPageRelease(). ** ** Otherwise, if an error occurs, *ppPg is set to NULL and an LSM error ** code is returned. */ int lsmFsMetaPageGet( FileSystem *pFS, /* File-system connection */ int bWrite, /* True for write access, false for read */ int iPg, /* Either 1 or 2 */ MetaPage **ppPg /* OUT: Pointer to MetaPage object */ ){ int rc = LSM_OK; MetaPage *pPg; assert( iPg==1 || iPg==2 ); pPg = lsmMallocZeroRc(pFS->pEnv, sizeof(Page), &rc); if( pPg ){ i64 iOff = (iPg-1) * pFS->nMetasize; if( pFS->nMapLimit>0 ){ fsGrowMapping(pFS, 2*pFS->nMetasize, &rc); pPg->aData = (u8 *)(pFS->pMap) + iOff; }else{ pPg->aData = lsmMallocRc(pFS->pEnv, pFS->nMetasize, &rc); if( rc==LSM_OK && bWrite==0 ){ rc = lsmEnvRead( pFS->pEnv, pFS->fdDb, iOff, pPg->aData, pFS->nMetaRwSize ); } #ifndef NDEBUG /* pPg->aData causes an uninitialized access via a downstreadm write(). After discussion on this list, this memory should not, for performance reasons, be memset. However, tracking down "real" misuse is more difficult with this "false" positive, so it is set when NDEBUG. */ else if( rc==LSM_OK ){ memset( pPg->aData, 0x77, pFS->nMetasize ); } #endif } if( rc!=LSM_OK ){ if( pFS->nMapLimit==0 ) lsmFree(pFS->pEnv, pPg->aData); lsmFree(pFS->pEnv, pPg); pPg = 0; }else{ pPg->iPg = iPg; pPg->bWrite = bWrite; pPg->pFS = pFS; } } *ppPg = pPg; return rc; } /* ** Release a meta-page reference obtained via a call to lsmFsMetaPageGet(). */ int lsmFsMetaPageRelease(MetaPage *pPg){ int rc = LSM_OK; if( pPg ){ FileSystem *pFS = pPg->pFS; if( pFS->nMapLimit==0 ){ if( pPg->bWrite ){ i64 iOff = (pPg->iPg==2 ? pFS->nMetasize : 0); int nWrite = pFS->nMetaRwSize; rc = lsmEnvWrite(pFS->pEnv, pFS->fdDb, iOff, pPg->aData, nWrite); } lsmFree(pFS->pEnv, pPg->aData); } lsmFree(pFS->pEnv, pPg); } return rc; } /* ** Return a pointer to a buffer containing the data associated with the ** meta-page passed as the first argument. If parameter pnData is not NULL, ** set *pnData to the size of the meta-page in bytes before returning. */ u8 *lsmFsMetaPageData(MetaPage *pPg, int *pnData){ if( pnData ) *pnData = pPg->pFS->nMetaRwSize; return pPg->aData; } /* ** Return true if page is currently writable. This is used in assert() ** statements only. */ #ifndef NDEBUG int lsmFsPageWritable(Page *pPg){ return (pPg->flags & PAGE_DIRTY) ? 1 : 0; } #endif /* ** This is called when block iFrom is being redirected to iTo. If page ** number (*piPg) lies on block iFrom, then calculate the equivalent ** page on block iTo and set *piPg to this value before returning. */ static void fsMovePage( FileSystem *pFS, /* File system object */ int iTo, /* Destination block */ int iFrom, /* Source block */ Pgno *piPg /* IN/OUT: Page number */ ){ Pgno iPg = *piPg; if( iFrom==fsPageToBlock(pFS, iPg) ){ const int nPagePerBlock = ( pFS->pCompress ? pFS ->nBlocksize : (pFS->nBlocksize / pFS->nPagesize) ); *piPg = iPg - (Pgno)(iFrom - iTo) * nPagePerBlock; } } /* ** Copy the contents of block iFrom to block iTo. ** ** It is safe to assume that there are no outstanding references to pages ** on block iTo. And that block iFrom is not currently being written. In ** other words, the data can be read and written directly. */ int lsmFsMoveBlock(FileSystem *pFS, Segment *pSeg, int iTo, int iFrom){ Snapshot *p = pFS->pDb->pWorker; int rc = LSM_OK; int i; i64 nMap; i64 iFromOff = (i64)(iFrom-1) * pFS->nBlocksize; i64 iToOff = (i64)(iTo-1) * pFS->nBlocksize; assert( iTo!=1 ); assert( iFrom>iTo ); /* Grow the mapping as required. */ nMap = LSM_MIN(pFS->nMapLimit, (i64)iFrom * pFS->nBlocksize); fsGrowMapping(pFS, nMap, &rc); if( rc==LSM_OK ){ const int nPagePerBlock = (pFS->nBlocksize / pFS->nPagesize); int nSz = pFS->nPagesize; u8 *aBuf = 0; u8 *aData = 0; for(i=0; rc==LSM_OK && inMapLimit ){ u8 *aMap = (u8 *)(pFS->pMap); aData = &aMap[iOff]; }else{ if( aBuf==0 ){ aBuf = (u8 *)lsmMallocRc(pFS->pEnv, nSz, &rc); if( aBuf==0 ) break; } aData = aBuf; rc = lsmEnvRead(pFS->pEnv, pFS->fdDb, iOff, aData, nSz); } /* Copy aData to the to page */ if( rc==LSM_OK ){ iOff = iToOff + i*nSz; if( (iOff+nSz)<=pFS->nMapLimit ){ u8 *aMap = (u8 *)(pFS->pMap); memcpy(&aMap[iOff], aData, nSz); }else{ rc = lsmEnvWrite(pFS->pEnv, pFS->fdDb, iOff, aData, nSz); } } } lsmFree(pFS->pEnv, aBuf); lsmFsPurgeCache(pFS); } /* Update append-point list if necessary */ for(i=0; iaiAppend[i]); } /* Update the Segment structure itself */ fsMovePage(pFS, iTo, iFrom, &pSeg->iFirst); fsMovePage(pFS, iTo, iFrom, &pSeg->iLastPg); fsMovePage(pFS, iTo, iFrom, &pSeg->iRoot); return rc; } /* ** Append raw data to a segment. Return the database file offset that the ** data is written to (this may be used as the page number if the data ** being appended is a new page record). ** ** This function is only used in compressed database mode. */ static Pgno fsAppendData( FileSystem *pFS, /* File-system handle */ Segment *pSeg, /* Segment to append to */ const u8 *aData, /* Buffer containing data to write */ int nData, /* Size of buffer aData[] in bytes */ int *pRc /* IN/OUT: Error code */ ){ Pgno iRet = 0; int rc = *pRc; assert( pFS->pCompress ); if( rc==LSM_OK ){ int nRem = 0; int nWrite = 0; Pgno iLastOnBlock; Pgno iApp = pSeg->iLastPg+1; /* If this is the first data written into the segment, find an append-point ** or allocate a new block. */ if( iApp==1 ){ pSeg->iFirst = iApp = findAppendPoint(pFS, 0); if( iApp==0 ){ int iBlk; rc = lsmBlockAllocate(pFS->pDb, 0, &iBlk); pSeg->iFirst = iApp = fsFirstPageOnBlock(pFS, iBlk); } } iRet = iApp; /* Write as much data as is possible at iApp (usually all of it). */ iLastOnBlock = fsLastPageOnPagesBlock(pFS, iApp); if( rc==LSM_OK ){ int nSpace = (int)(iLastOnBlock - iApp + 1); nWrite = LSM_MIN(nData, nSpace); nRem = nData - nWrite; assert( nWrite>=0 ); if( nWrite!=0 ){ rc = lsmEnvWrite(pFS->pEnv, pFS->fdDb, iApp, aData, nWrite); } iApp += nWrite; } /* If required, allocate a new block and write the rest of the data ** into it. Set the next and previous block pointers to link the new ** block to the old. */ assert( nRem<=0 || (iApp-1)==iLastOnBlock ); if( rc==LSM_OK && (iApp-1)==iLastOnBlock ){ u8 aPtr[4]; /* Space to serialize a u32 */ int iBlk; /* New block number */ if( nWrite>0 ){ /* Allocate a new block. */ rc = lsmBlockAllocate(pFS->pDb, 0, &iBlk); /* Set the "next" pointer on the old block */ if( rc==LSM_OK ){ assert( iApp==(fsPageToBlock(pFS, iApp)*pFS->nBlocksize)-4 ); lsmPutU32(aPtr, iBlk); rc = lsmEnvWrite(pFS->pEnv, pFS->fdDb, iApp, aPtr, sizeof(aPtr)); } /* Set the "prev" pointer on the new block */ if( rc==LSM_OK ){ Pgno iWrite; lsmPutU32(aPtr, fsPageToBlock(pFS, iApp)); iWrite = fsFirstPageOnBlock(pFS, iBlk); rc = lsmEnvWrite(pFS->pEnv, pFS->fdDb, iWrite-4, aPtr, sizeof(aPtr)); if( nRem>0 ) iApp = iWrite; } }else{ /* The next block is already allocated. */ assert( nRem>0 ); assert( pSeg->pRedirect==0 ); rc = fsBlockNext(pFS, 0, fsPageToBlock(pFS, iApp), &iBlk); iRet = iApp = fsFirstPageOnBlock(pFS, iBlk); } /* Write the remaining data into the new block */ if( rc==LSM_OK && nRem>0 ){ rc = lsmEnvWrite(pFS->pEnv, pFS->fdDb, iApp, &aData[nWrite], nRem); iApp += nRem; } } pSeg->iLastPg = iApp-1; *pRc = rc; } return iRet; } /* ** This function is only called in compressed database mode. It ** compresses the contents of page pPg and writes the result to the ** buffer at pFS->aOBuffer. The size of the compressed data is stored in ** pPg->nCompress. ** ** If buffer pFS->aOBuffer[] has not been allocated then this function ** allocates it. If this fails, LSM_NOMEM is returned. Otherwise, LSM_OK. */ static int fsCompressIntoBuffer(FileSystem *pFS, Page *pPg){ lsm_compress *p = pFS->pCompress; if( fsAllocateBuffer(pFS, 1) ) return LSM_NOMEM; assert( pPg->nData==pFS->nPagesize ); pPg->nCompress = pFS->nBuffer; return p->xCompress(p->pCtx, (char *)pFS->aOBuffer, &pPg->nCompress, (const char *)pPg->aData, pPg->nData ); } /* ** Append a new page to segment pSeg. Set output variable *piNew to the ** page number of the new page before returning. ** ** If the new page is the last on its block, then the 'next' block that ** will be used by the segment is allocated here too. In this case output ** variable *piNext is set to the block number of the next block. ** ** If the new page is the first on its block but not the first in the ** entire segment, set output variable *piPrev to the block number of ** the previous block in the segment. ** ** LSM_OK is returned if successful, or an lsm error code otherwise. If ** any value other than LSM_OK is returned, then the final value of all ** output variables is undefined. */ static int fsAppendPage( FileSystem *pFS, Segment *pSeg, Pgno *piNew, int *piPrev, int *piNext ){ Pgno iPrev = pSeg->iLastPg; int rc; assert( iPrev!=0 ); *piPrev = 0; *piNext = 0; if( fsIsLast(pFS, iPrev) ){ /* Grab the first page on the next block (which has already be ** allocated). In this case set *piPrev to tell the caller to set ** the "previous block" pointer in the first 4 bytes of the page. */ int iNext; int iBlk = fsPageToBlock(pFS, iPrev); assert( pSeg->pRedirect==0 ); rc = fsBlockNext(pFS, 0, iBlk, &iNext); if( rc!=LSM_OK ) return rc; *piNew = fsFirstPageOnBlock(pFS, iNext); *piPrev = iBlk; }else{ *piNew = iPrev+1; if( fsIsLast(pFS, *piNew) ){ /* Allocate the next block here. */ int iBlk; rc = lsmBlockAllocate(pFS->pDb, 0, &iBlk); if( rc!=LSM_OK ) return rc; *piNext = iBlk; } } pSeg->nSize++; pSeg->iLastPg = *piNew; return LSM_OK; } /* ** Flush all pages in the FileSystem.pWaiting list to disk. */ void lsmFsFlushWaiting(FileSystem *pFS, int *pRc){ int rc = *pRc; Page *pPg; pPg = pFS->pWaiting; pFS->pWaiting = 0; while( pPg ){ Page *pNext = pPg->pWaitingNext; if( rc==LSM_OK ) rc = lsmFsPagePersist(pPg); assert( pPg->nRef==1 ); lsmFsPageRelease(pPg); pPg = pNext; } *pRc = rc; } /* ** If there exists a hash-table entry associated with page iPg, remove it. */ static void fsRemoveHashEntry(FileSystem *pFS, Pgno iPg){ Page *p; int iHash = fsHashKey(pFS->nHash, iPg); for(p=pFS->apHash[iHash]; p && p->iPg!=iPg; p=p->pHashNext); if( p ){ assert( p->nRef==0 || (p->flags & PAGE_FREE)==0 ); fsPageRemoveFromHash(pFS, p); p->iPg = 0; iHash = fsHashKey(pFS->nHash, 0); p->pHashNext = pFS->apHash[iHash]; pFS->apHash[iHash] = p; } } /* ** If the page passed as an argument is dirty, update the database file ** (or mapping of the database file) with its current contents and mark ** the page as clean. ** ** Return LSM_OK if the operation is a success, or an LSM error code ** otherwise. */ int lsmFsPagePersist(Page *pPg){ int rc = LSM_OK; if( pPg && (pPg->flags & PAGE_DIRTY) ){ FileSystem *pFS = pPg->pFS; if( pFS->pCompress ){ int iHash; /* Hash key of assigned page number */ u8 aSz[3]; /* pPg->nCompress as a 24-bit big-endian */ assert( pPg->pSeg && pPg->iPg==0 && pPg->nCompress==0 ); /* Compress the page image. */ rc = fsCompressIntoBuffer(pFS, pPg); /* Serialize the compressed size into buffer aSz[] */ putRecordSize(aSz, pPg->nCompress, 0); /* Write the serialized page record into the database file. */ pPg->iPg = fsAppendData(pFS, pPg->pSeg, aSz, sizeof(aSz), &rc); fsAppendData(pFS, pPg->pSeg, pFS->aOBuffer, pPg->nCompress, &rc); fsAppendData(pFS, pPg->pSeg, aSz, sizeof(aSz), &rc); /* Now that it has a page number, insert the page into the hash table */ iHash = fsHashKey(pFS->nHash, pPg->iPg); pPg->pHashNext = pFS->apHash[iHash]; pFS->apHash[iHash] = pPg; pPg->pSeg->nSize += (sizeof(aSz) * 2) + pPg->nCompress; pPg->flags &= ~PAGE_DIRTY; pFS->nWrite++; }else{ if( pPg->iPg==0 ){ /* No page number has been assigned yet. This occurs with pages used ** in the b-tree hierarchy. They were not assigned page numbers when ** they were created as doing so would cause this call to ** lsmFsPagePersist() to write an out-of-order page. Instead a page ** number is assigned here so that the page data will be appended ** to the current segment. */ Page **pp; int iPrev = 0; int iNext = 0; int iHash; assert( pPg->pSeg->iFirst ); assert( pPg->flags & PAGE_FREE ); assert( (pPg->flags & PAGE_HASPREV)==0 ); assert( pPg->nData==pFS->nPagesize-4 ); rc = fsAppendPage(pFS, pPg->pSeg, &pPg->iPg, &iPrev, &iNext); if( rc!=LSM_OK ) return rc; assert( pPg->flags & PAGE_FREE ); iHash = fsHashKey(pFS->nHash, pPg->iPg); fsRemoveHashEntry(pFS, pPg->iPg); pPg->pHashNext = pFS->apHash[iHash]; pFS->apHash[iHash] = pPg; assert( pPg->pHashNext==0 || pPg->pHashNext->iPg!=pPg->iPg ); if( iPrev ){ assert( iNext==0 ); memmove(&pPg->aData[4], pPg->aData, pPg->nData); lsmPutU32(pPg->aData, iPrev); pPg->flags |= PAGE_HASPREV; pPg->aData += 4; }else if( iNext ){ assert( iPrev==0 ); lsmPutU32(&pPg->aData[pPg->nData], iNext); }else{ int nData = pPg->nData; pPg->nData += 4; lsmSortedExpandBtreePage(pPg, nData); } pPg->nRef++; for(pp=&pFS->pWaiting; *pp; pp=&(*pp)->pWaitingNext); *pp = pPg; assert( pPg->pWaitingNext==0 ); }else{ i64 iOff; /* Offset to write within database file */ iOff = (i64)pFS->nPagesize * (i64)(pPg->iPg-1); if( fsMmapPage(pFS, pPg->iPg)==0 ){ u8 *aData = pPg->aData - (pPg->flags & PAGE_HASPREV); rc = lsmEnvWrite(pFS->pEnv, pFS->fdDb, iOff, aData, pFS->nPagesize); }else if( pPg->flags & PAGE_FREE ){ fsGrowMapping(pFS, iOff + pFS->nPagesize, &rc); if( rc==LSM_OK ){ u8 *aTo = &((u8 *)(pFS->pMap))[iOff]; u8 *aFrom = pPg->aData - (pPg->flags & PAGE_HASPREV); memcpy(aTo, aFrom, pFS->nPagesize); lsmFree(pFS->pEnv, aFrom); pFS->nCacheAlloc--; pPg->aData = aTo + (pPg->flags & PAGE_HASPREV); pPg->flags &= ~PAGE_FREE; fsPageRemoveFromHash(pFS, pPg); pPg->pMappedNext = pFS->pMapped; pFS->pMapped = pPg; } } lsmFsFlushWaiting(pFS, &rc); pPg->flags &= ~PAGE_DIRTY; pFS->nWrite++; } } } return rc; } /* ** For non-compressed databases, this function is a no-op. For compressed ** databases, it adds a padding record to the segment passed as the third ** argument. ** ** The size of the padding records is selected so that the last byte ** written is the last byte of a disk sector. This means that if a ** snapshot is taken and checkpointed, subsequent worker processes will ** not write to any sector that contains checkpointed data. */ int lsmFsSortedPadding( FileSystem *pFS, Snapshot *pSnapshot, Segment *pSeg ){ int rc = LSM_OK; if( pFS->pCompress ){ Pgno iLast2; Pgno iLast = pSeg->iLastPg; /* Current last page of segment */ int nPad; /* Bytes of padding required */ u8 aSz[3]; iLast2 = (1 + iLast/pFS->szSector) * pFS->szSector - 1; assert( fsPageToBlock(pFS, iLast)==fsPageToBlock(pFS, iLast2) ); nPad = (int)(iLast2 - iLast); if( iLast2>fsLastPageOnPagesBlock(pFS, iLast) ){ nPad -= 4; } assert( nPad>=0 ); if( nPad>=6 ){ pSeg->nSize += nPad; nPad -= 6; putRecordSize(aSz, nPad, 1); fsAppendData(pFS, pSeg, aSz, sizeof(aSz), &rc); memset(pFS->aOBuffer, 0, nPad); fsAppendData(pFS, pSeg, pFS->aOBuffer, nPad, &rc); fsAppendData(pFS, pSeg, aSz, sizeof(aSz), &rc); }else if( nPad>0 ){ u8 aBuf[5] = {0,0,0,0,0}; aBuf[0] = (u8)nPad; aBuf[nPad-1] = (u8)nPad; fsAppendData(pFS, pSeg, aBuf, nPad, &rc); } assert( rc!=LSM_OK || pSeg->iLastPg==fsLastPageOnPagesBlock(pFS, pSeg->iLastPg) || ((pSeg->iLastPg + 1) % pFS->szSector)==0 ); } return rc; } /* ** Increment the reference count on the page object passed as the first ** argument. */ void lsmFsPageRef(Page *pPg){ if( pPg ){ pPg->nRef++; } } /* ** Release a page-reference obtained using fsPageGet(). */ int lsmFsPageRelease(Page *pPg){ int rc = LSM_OK; if( pPg ){ assert( pPg->nRef>0 ); pPg->nRef--; if( pPg->nRef==0 ){ FileSystem *pFS = pPg->pFS; rc = lsmFsPagePersist(pPg); pFS->nOut--; assert( pPg->pFS->pCompress || fsIsFirst(pPg->pFS, pPg->iPg)==0 || (pPg->flags & PAGE_HASPREV) ); pPg->aData -= (pPg->flags & PAGE_HASPREV); pPg->flags &= ~PAGE_HASPREV; if( (pPg->flags & PAGE_FREE)==0 ){ /* Removed from mapped list */ Page **pp; for(pp=&pFS->pMapped; (*pp)!=pPg; pp=&(*pp)->pMappedNext); *pp = pPg->pMappedNext; pPg->pMappedNext = 0; /* Add to free list */ pPg->pFreeNext = pFS->pFree; pFS->pFree = pPg; }else{ fsPageAddToLru(pFS, pPg); } } } return rc; } /* ** Return the total number of pages read from the database file. */ int lsmFsNRead(FileSystem *pFS){ return pFS->nRead; } /* ** Return the total number of pages written to the database file. */ int lsmFsNWrite(FileSystem *pFS){ return pFS->nWrite; } /* ** Return a copy of the environment pointer used by the file-system object. */ lsm_env *lsmFsEnv(FileSystem *pFS){ return pFS->pEnv; } /* ** Return a copy of the environment pointer used by the file-system object ** to which this page belongs. */ lsm_env *lsmPageEnv(Page *pPg) { return pPg->pFS->pEnv; } /* ** Return a pointer to the file-system object associated with the Page ** passed as the only argument. */ FileSystem *lsmPageFS(Page *pPg){ return pPg->pFS; } /* ** Return the sector-size as reported by the log file handle. */ int lsmFsSectorSize(FileSystem *pFS){ return pFS->szSector; } /* ** Helper function for lsmInfoArrayStructure(). */ static Segment *startsWith(Segment *pRun, Pgno iFirst){ return (iFirst==pRun->iFirst) ? pRun : 0; } /* ** Return the segment that starts with page iFirst, if any. If no such segment ** can be found, return NULL. */ static Segment *findSegment(Snapshot *pWorker, Pgno iFirst){ Level *pLvl; /* Used to iterate through db levels */ Segment *pSeg = 0; /* Pointer to segment to return */ for(pLvl=lsmDbSnapshotLevel(pWorker); pLvl && pSeg==0; pLvl=pLvl->pNext){ if( 0==(pSeg = startsWith(&pLvl->lhs, iFirst)) ){ int i; for(i=0; inRight; i++){ if( (pSeg = startsWith(&pLvl->aRhs[i], iFirst)) ) break; } } } return pSeg; } /* ** This function implements the lsm_info(LSM_INFO_ARRAY_STRUCTURE) request. ** If successful, *pzOut is set to point to a nul-terminated string ** containing the array structure and LSM_OK is returned. The caller should ** eventually free the string using lsmFree(). ** ** If an error occurs, *pzOut is set to NULL and an LSM error code returned. */ int lsmInfoArrayStructure( lsm_db *pDb, int bBlock, /* True for block numbers only */ Pgno iFirst, char **pzOut ){ int rc = LSM_OK; Snapshot *pWorker; /* Worker snapshot */ Segment *pArray = 0; /* Array to report on */ int bUnlock = 0; *pzOut = 0; if( iFirst==0 ) return LSM_ERROR; /* Obtain the worker snapshot */ pWorker = pDb->pWorker; if( !pWorker ){ rc = lsmBeginWork(pDb); if( rc!=LSM_OK ) return rc; pWorker = pDb->pWorker; bUnlock = 1; } /* Search for the array that starts on page iFirst */ pArray = findSegment(pWorker, iFirst); if( pArray==0 ){ /* Could not find the requested array. This is an error. */ rc = LSM_ERROR; }else{ FileSystem *pFS = pDb->pFS; LsmString str; int iBlk; int iLastBlk; iBlk = fsPageToBlock(pFS, pArray->iFirst); iLastBlk = fsPageToBlock(pFS, pArray->iLastPg); lsmStringInit(&str, pDb->pEnv); if( bBlock ){ lsmStringAppendf(&str, "%d", iBlk); while( iBlk!=iLastBlk ){ fsBlockNext(pFS, pArray, iBlk, &iBlk); lsmStringAppendf(&str, " %d", iBlk); } }else{ lsmStringAppendf(&str, "%d", pArray->iFirst); while( iBlk!=iLastBlk ){ lsmStringAppendf(&str, " %d", fsLastPageOnBlock(pFS, iBlk)); fsBlockNext(pFS, pArray, iBlk, &iBlk); lsmStringAppendf(&str, " %d", fsFirstPageOnBlock(pFS, iBlk)); } lsmStringAppendf(&str, " %d", pArray->iLastPg); } *pzOut = str.z; } if( bUnlock ){ int rcwork = LSM_BUSY; lsmFinishWork(pDb, 0, &rcwork); } return rc; } int lsmFsSegmentContainsPg( FileSystem *pFS, Segment *pSeg, Pgno iPg, int *pbRes ){ Redirect *pRedir = pSeg->pRedirect; int rc = LSM_OK; int iBlk; int iLastBlk; int iPgBlock; /* Block containing page iPg */ iPgBlock = fsPageToBlock(pFS, pSeg->iFirst); iBlk = fsRedirectBlock(pRedir, fsPageToBlock(pFS, pSeg->iFirst)); iLastBlk = fsRedirectBlock(pRedir, fsPageToBlock(pFS, pSeg->iLastPg)); while( iBlk!=iLastBlk && iBlk!=iPgBlock && rc==LSM_OK ){ rc = fsBlockNext(pFS, pSeg, iBlk, &iBlk); } *pbRes = (iBlk==iPgBlock); return rc; } /* ** This function implements the lsm_info(LSM_INFO_ARRAY_PAGES) request. ** If successful, *pzOut is set to point to a nul-terminated string ** containing the array structure and LSM_OK is returned. The caller should ** eventually free the string using lsmFree(). ** ** If an error occurs, *pzOut is set to NULL and an LSM error code returned. */ int lsmInfoArrayPages(lsm_db *pDb, Pgno iFirst, char **pzOut){ int rc = LSM_OK; Snapshot *pWorker; /* Worker snapshot */ Segment *pSeg = 0; /* Array to report on */ int bUnlock = 0; *pzOut = 0; if( iFirst==0 ) return LSM_ERROR; /* Obtain the worker snapshot */ pWorker = pDb->pWorker; if( !pWorker ){ rc = lsmBeginWork(pDb); if( rc!=LSM_OK ) return rc; pWorker = pDb->pWorker; bUnlock = 1; } /* Search for the array that starts on page iFirst */ pSeg = findSegment(pWorker, iFirst); if( pSeg==0 ){ /* Could not find the requested array. This is an error. */ rc = LSM_ERROR; }else{ Page *pPg = 0; FileSystem *pFS = pDb->pFS; LsmString str; lsmStringInit(&str, pDb->pEnv); rc = lsmFsDbPageGet(pFS, pSeg, iFirst, &pPg); while( rc==LSM_OK && pPg ){ Page *pNext = 0; lsmStringAppendf(&str, " %lld", lsmFsPageNumber(pPg)); rc = lsmFsDbPageNext(pSeg, pPg, 1, &pNext); lsmFsPageRelease(pPg); pPg = pNext; } if( rc!=LSM_OK ){ lsmFree(pDb->pEnv, str.z); }else{ *pzOut = str.z; } } if( bUnlock ){ int rcwork = LSM_BUSY; lsmFinishWork(pDb, 0, &rcwork); } return rc; } /* ** The following macros are used by the integrity-check code. Associated with ** each block in the database is an 8-bit bit mask (the entry in the aUsed[] ** array). As the integrity-check meanders through the database, it sets the ** following bits to indicate how each block is used. ** ** INTEGRITY_CHECK_FIRST_PG: ** First page of block is in use by sorted run. ** ** INTEGRITY_CHECK_LAST_PG: ** Last page of block is in use by sorted run. ** ** INTEGRITY_CHECK_USED: ** At least one page of the block is in use by a sorted run. ** ** INTEGRITY_CHECK_FREE: ** The free block list contains an entry corresponding to this block. */ #define INTEGRITY_CHECK_FIRST_PG 0x01 #define INTEGRITY_CHECK_LAST_PG 0x02 #define INTEGRITY_CHECK_USED 0x04 #define INTEGRITY_CHECK_FREE 0x08 /* ** Helper function for lsmFsIntegrityCheck() */ static void checkBlocks( FileSystem *pFS, Segment *pSeg, int bExtra, /* If true, count the "next" block if any */ int nUsed, u8 *aUsed ){ if( pSeg ){ if( pSeg && pSeg->nSize>0 ){ int rc; int iBlk; /* Current block (during iteration) */ int iLastBlk; /* Last block of segment */ int iFirstBlk; /* First block of segment */ int bLastIsLastOnBlock; /* True iLast is the last on its block */ assert( 0==fsSegmentRedirects(pFS, pSeg) ); iBlk = iFirstBlk = fsPageToBlock(pFS, pSeg->iFirst); iLastBlk = fsPageToBlock(pFS, pSeg->iLastPg); bLastIsLastOnBlock = (fsLastPageOnBlock(pFS, iLastBlk)==pSeg->iLastPg); assert( iBlk>0 ); do { /* iBlk is a part of this sorted run. */ aUsed[iBlk-1] |= INTEGRITY_CHECK_USED; /* If the first page of this block is also part of the segment, ** set the flag to indicate that the first page of iBlk is in use. */ if( fsFirstPageOnBlock(pFS, iBlk)==pSeg->iFirst || iBlk!=iFirstBlk ){ assert( (aUsed[iBlk-1] & INTEGRITY_CHECK_FIRST_PG)==0 ); aUsed[iBlk-1] |= INTEGRITY_CHECK_FIRST_PG; } /* Unless the sorted run finishes before the last page on this block, ** the last page of this block is also in use. */ if( iBlk!=iLastBlk || bLastIsLastOnBlock ){ assert( (aUsed[iBlk-1] & INTEGRITY_CHECK_LAST_PG)==0 ); aUsed[iBlk-1] |= INTEGRITY_CHECK_LAST_PG; } /* Special case. The sorted run being scanned is the output run of ** a level currently undergoing an incremental merge. The sorted ** run ends on the last page of iBlk, but the next block has already ** been allocated. So mark it as in use as well. */ if( iBlk==iLastBlk && bLastIsLastOnBlock && bExtra ){ int iExtra = 0; rc = fsBlockNext(pFS, pSeg, iBlk, &iExtra); assert( rc==LSM_OK ); assert( aUsed[iExtra-1]==0 ); aUsed[iExtra-1] |= INTEGRITY_CHECK_USED; aUsed[iExtra-1] |= INTEGRITY_CHECK_FIRST_PG; aUsed[iExtra-1] |= INTEGRITY_CHECK_LAST_PG; } /* Move on to the next block in the sorted run. Or set iBlk to zero ** in order to break out of the loop if this was the last block in ** the run. */ if( iBlk==iLastBlk ){ iBlk = 0; }else{ rc = fsBlockNext(pFS, pSeg, iBlk, &iBlk); assert( rc==LSM_OK ); } }while( iBlk ); } } } typedef struct CheckFreelistCtx CheckFreelistCtx; struct CheckFreelistCtx { u8 *aUsed; int nBlock; }; static int checkFreelistCb(void *pCtx, int iBlk, i64 iSnapshot){ CheckFreelistCtx *p = (CheckFreelistCtx *)pCtx; assert( iBlk>=1 ); assert( iBlk<=p->nBlock ); assert( p->aUsed[iBlk-1]==0 ); p->aUsed[iBlk-1] = INTEGRITY_CHECK_FREE; return 0; } /* ** This function checks that all blocks in the database file are accounted ** for. For each block, exactly one of the following must be true: ** ** + the block is part of a sorted run, or ** + the block is on the free-block list ** ** This function also checks that there are no references to blocks with ** out-of-range block numbers. ** ** If no errors are found, non-zero is returned. If an error is found, an ** assert() fails. */ int lsmFsIntegrityCheck(lsm_db *pDb){ CheckFreelistCtx ctx; FileSystem *pFS = pDb->pFS; int i; int rc; Freelist freelist = {0, 0, 0}; u8 *aUsed; Level *pLevel; Snapshot *pWorker = pDb->pWorker; int nBlock = pWorker->nBlock; #if 0 static int nCall = 0; nCall++; printf("%d calls\n", nCall); #endif aUsed = lsmMallocZero(pDb->pEnv, nBlock); if( aUsed==0 ){ /* Malloc has failed. Since this function is only called within debug ** builds, this probably means the user is running an OOM injection test. ** Regardless, it will not be possible to run the integrity-check at this ** time, so assume the database is Ok and return non-zero. */ return 1; } for(pLevel=pWorker->pLevel; pLevel; pLevel=pLevel->pNext){ int j; checkBlocks(pFS, &pLevel->lhs, (pLevel->nRight!=0), nBlock, aUsed); for(j=0; jnRight; j++){ checkBlocks(pFS, &pLevel->aRhs[j], 0, nBlock, aUsed); } } /* Mark all blocks in the free-list as used */ ctx.aUsed = aUsed; ctx.nBlock = nBlock; rc = lsmWalkFreelist(pDb, 0, checkFreelistCb, (void *)&ctx); if( rc==LSM_OK ){ for(i=0; ipEnv, aUsed); lsmFree(pDb->pEnv, freelist.aEntry); return 1; } #ifndef NDEBUG /* ** Return true if pPg happens to be the last page in segment pSeg. Or false ** otherwise. This function is only invoked as part of assert() conditions. */ int lsmFsDbPageIsLast(Segment *pSeg, Page *pPg){ if( pPg->pFS->pCompress ){ Pgno iNext = 0; int rc; rc = fsNextPageOffset(pPg->pFS, pSeg, pPg->iPg, pPg->nCompress+6, &iNext); return (rc!=LSM_OK || iNext==0); } return (pPg->iPg==pSeg->iLastPg); } #endif ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_log.c ================================================ /* ** 2011-08-13 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** This file contains the implementation of LSM database logging. Logging ** has one purpose in LSM - to make transactions durable. ** ** When data is written to an LSM database, it is initially stored in an ** in-memory tree structure. Since this structure is in volatile memory, ** if a power failure or application crash occurs it may be lost. To ** prevent loss of data in this case, each time a record is written to the ** in-memory tree an equivalent record is appended to the log on disk. ** If a power failure or application crash does occur, data can be recovered ** by reading the log. ** ** A log file consists of the following types of records representing data ** written into the database: ** ** LOG_WRITE: A key-value pair written to the database. ** LOG_DELETE: A delete key issued to the database. ** LOG_COMMIT: A transaction commit. ** ** And the following types of records for ancillary purposes.. ** ** LOG_EOF: A record indicating the end of a log file. ** LOG_PAD1: A single byte padding record. ** LOG_PAD2: An N byte padding record (N>1). ** LOG_JUMP: A pointer to another offset within the log file. ** ** Each transaction written to the log contains one or more LOG_WRITE and/or ** LOG_DELETE records, followed by a LOG_COMMIT record. The LOG_COMMIT record ** contains an 8-byte checksum based on all previous data written to the ** log file. ** ** LOG CHECKSUMS & RECOVERY ** ** Checksums are found in two types of log records: LOG_COMMIT and ** LOG_CKSUM records. In order to recover content from a log, a client ** reads each record from the start of the log, calculating a checksum as ** it does. Each time a LOG_COMMIT or LOG_CKSUM is encountered, the ** recovery process verifies that the checksum stored in the log ** matches the calculated checksum. If it does not, the recovery process ** can stop reading the log. ** ** If a recovery process reads records (other than COMMIT or CKSUM) ** consisting of at least LSM_CKSUM_MAXDATA bytes, then the next record in ** the log must be either a LOG_CKSUM or LOG_COMMIT record. If it is ** not, the recovery process also stops reading the log. ** ** To recover the log file, it must be read twice. The first time to ** determine the location of the last valid commit record. And the second ** time to load data into the in-memory tree. ** ** Todo: Surely there is a better way... ** ** LOG WRAPPING ** ** If the log file were never deleted or wrapped, it would be possible to ** read it from start to end each time is required recovery (i.e each time ** the number of database clients changes from 0 to 1). Effectively reading ** the entire history of the database each time. This would quickly become ** inefficient. Additionally, since the log file would grow without bound, ** it wastes storage space. ** ** Instead, part of each checkpoint written into the database file contains ** a log offset (and other information required to read the log starting at ** at this offset) at which to begin recovery. Offset $O. ** ** Once a checkpoint has been written and synced into the database file, it ** is guaranteed that no recovery process will need to read any data before ** offset $O of the log file. It is therefore safe to begin overwriting ** any data that occurs before offset $O. ** ** This implementation separates the log into three regions mapped into ** the log file - regions 0, 1 and 2. During recovery, regions are read ** in ascending order (i.e. 0, then 1, then 2). Each region is zero or ** more bytes in size. ** ** |---1---|..|--0--|.|--2--|.... ** ** New records are always appended to the end of region 2. ** ** Initially (when it is empty), all three regions are zero bytes in size. ** Each of them are located at the beginning of the file. As records are ** added to the log, region 2 grows, so that the log consists of a zero ** byte region 1, followed by a zero byte region 0, followed by an N byte ** region 2. After one or more checkpoints have been written to disk, ** the start point of region 2 is moved to $O. For example: ** ** A) ||.........|--2--|.... ** ** (both regions 0 and 1 are 0 bytes in size at offset 0). ** ** Eventually, the log wraps around to write new records into the start. ** At this point, region 2 is renamed to region 0. Region 0 is renamed ** to region 2. After appending a few records to the new region 2, the ** log file looks like this: ** ** B) ||--2--|...|--0--|.... ** ** (region 1 is still 0 bytes in size, located at offset 0). ** ** Any checkpoints made at this point may reduce the size of region 0. ** However, if they do not, and region 2 expands so that it is about to ** overwrite the start of region 0, then region 2 is renamed to region 1, ** and a new region 2 created at the end of the file following the existing ** region 0. ** ** C) |---1---|..|--0--|.|-2-| ** ** In this state records are appended to region 2 until checkpoints have ** contracted regions 0 AND 1 UNTil they are both zero bytes in size. They ** are then shifted to the start of the log file, leaving the system in ** the equivalent of state A above. ** ** Alternatively, state B may transition directly to state A if the size ** of region 0 is reduced to zero bytes before region 2 threatens to ** encroach upon it. ** ** LOG_PAD1 & LOG_PAD2 RECORDS ** ** PAD1 and PAD2 records may appear in a log file at any point. They allow ** a process writing the log file align the beginning of transactions with ** the beginning of disk sectors, which increases robustness. ** ** RECORD FORMATS: ** ** LOG_EOF: * A single 0x00 byte. ** ** LOG_PAD1: * A single 0x01 byte. ** ** LOG_PAD2: * A single 0x02 byte, followed by ** * The number of unused bytes (N) as a varint, ** * An N byte block of unused space. ** ** LOG_COMMIT: * A single 0x03 byte. ** * An 8-byte checksum. ** ** LOG_JUMP: * A single 0x04 byte. ** * Absolute file offset to jump to, encoded as a varint. ** ** LOG_WRITE: * A single 0x06 or 0x07 byte, ** * The number of bytes in the key, encoded as a varint, ** * The number of bytes in the value, encoded as a varint, ** * If the first byte was 0x07, an 8 byte checksum. ** * The key data, ** * The value data. ** ** LOG_DELETE: * A single 0x08 or 0x09 byte, ** * The number of bytes in the key, encoded as a varint, ** * If the first byte was 0x09, an 8 byte checksum. ** * The key data. ** ** Varints are as described in lsm_varint.c (SQLite 4 format). ** ** CHECKSUMS: ** ** The checksum is calculated using two 32-bit unsigned integers, s0 and ** s1. The initial value for both is 42. It is updated each time a record ** is written into the log file by treating the encoded (binary) record as ** an array of 32-bit little-endian integers. Then, if x[] is the integer ** array, updating the checksum accumulators as follows: ** ** for i from 0 to n-1 step 2: ** s0 += x[i] + s1; ** s1 += x[i+1] + s0; ** endfor ** ** If the record is not an even multiple of 8-bytes in size it is padded ** with zeroes to make it so before the checksum is updated. ** ** The checksum stored in a COMMIT, WRITE or DELETE is based on all bytes ** up to the start of the 8-byte checksum itself, including the COMMIT, ** WRITE or DELETE fields that appear before the checksum in the record. ** ** VARINT FORMAT ** ** See lsm_varint.c. */ #ifndef _LSM_INT_H # include "lsmInt.h" #endif /* Log record types */ #define LSM_LOG_EOF 0x00 #define LSM_LOG_PAD1 0x01 #define LSM_LOG_PAD2 0x02 #define LSM_LOG_COMMIT 0x03 #define LSM_LOG_JUMP 0x04 #define LSM_LOG_WRITE 0x06 #define LSM_LOG_WRITE_CKSUM 0x07 #define LSM_LOG_DELETE 0x08 #define LSM_LOG_DELETE_CKSUM 0x09 #define LSM_LOG_DRANGE 0x0A #define LSM_LOG_DRANGE_CKSUM 0x0B /* Require a checksum every 32KB. */ #define LSM_CKSUM_MAXDATA (32*1024) /* Do not wrap a log file smaller than this in bytes. */ #define LSM_MIN_LOGWRAP (128*1024) /* ** szSector: ** Commit records must be aligned to end on szSector boundaries. If ** the safety-mode is set to NORMAL or OFF, this value is 1. Otherwise, ** if the safety-mode is set to FULL, it is the size of the file-system ** sectors as reported by lsmFsSectorSize(). */ struct LogWriter { u32 cksum0; /* Checksum 0 at offset iOff */ u32 cksum1; /* Checksum 1 at offset iOff */ int iCksumBuf; /* Bytes of buf that have been checksummed */ i64 iOff; /* Offset at start of buffer buf */ int szSector; /* Sector size for this transaction */ LogRegion jump; /* Avoid writing to this region */ i64 iRegion1End; /* End of first region written by trans */ i64 iRegion2Start; /* Start of second regions written by trans */ LsmString buf; /* Buffer containing data not yet written */ }; /* ** Return the result of interpreting the first 4 bytes in buffer aIn as ** a 32-bit unsigned little-endian integer. */ static u32 getU32le(u8 *aIn){ return ((u32)aIn[3] << 24) + ((u32)aIn[2] << 16) + ((u32)aIn[1] << 8) + ((u32)aIn[0]); } /* ** This function is the same as logCksum(), except that pointer "a" need ** not be aligned to an 8-byte boundary or padded with zero bytes. This ** version is slower, but sometimes more convenient to use. */ static void logCksumUnaligned( char *z, /* Input buffer */ int n, /* Size of input buffer in bytes */ u32 *pCksum0, /* IN/OUT: Checksum value 1 */ u32 *pCksum1 /* IN/OUT: Checksum value 2 */ ){ u8 *a = (u8 *)z; u32 cksum0 = *pCksum0; u32 cksum1 = *pCksum1; int nIn = (n/8) * 8; int i; assert( n>0 ); for(i=0; inIn ); memcpy(aBuf, &a[nIn], n-nIn); cksum0 += getU32le(aBuf) + cksum1; cksum1 += getU32le(&aBuf[4]) + cksum0; } *pCksum0 = cksum0; *pCksum1 = cksum1; } /* ** Update pLog->cksum0 and pLog->cksum1 so that the first nBuf bytes in the ** write buffer (pLog->buf) are included in the checksum. */ static void logUpdateCksum(LogWriter *pLog, int nBuf){ assert( (pLog->iCksumBuf % 8)==0 ); assert( pLog->iCksumBuf<=nBuf ); assert( (nBuf % 8)==0 || nBuf==pLog->buf.n ); if( nBuf>pLog->iCksumBuf ){ logCksumUnaligned( &pLog->buf.z[pLog->iCksumBuf], nBuf-pLog->iCksumBuf, &pLog->cksum0, &pLog->cksum1 ); } pLog->iCksumBuf = nBuf; } static i64 firstByteOnSector(LogWriter *pLog, i64 iOff){ return (iOff / pLog->szSector) * pLog->szSector; } static i64 lastByteOnSector(LogWriter *pLog, i64 iOff){ return firstByteOnSector(pLog, iOff) + pLog->szSector - 1; } /* ** If possible, reclaim log file space. Log file space is reclaimed after ** a snapshot that points to the same data in the database file is synced ** into the db header. */ static int logReclaimSpace(lsm_db *pDb){ int rc; int iMeta; int bRotrans; /* True if there exists some ro-trans */ /* Test if there exists some other connection with a read-only transaction ** open. If there does, then log file space may not be reclaimed. */ rc = lsmDetectRoTrans(pDb, &bRotrans); if( rc!=LSM_OK || bRotrans ) return rc; iMeta = (int)pDb->pShmhdr->iMetaPage; if( iMeta==1 || iMeta==2 ){ DbLog *pLog = &pDb->treehdr.log; i64 iSyncedId; /* Read the snapshot-id of the snapshot stored on meta-page iMeta. Note ** that in theory, the value read is untrustworthy (due to a race ** condition - see comments above lsmFsReadSyncedId()). So it is only ** ever used to conclude that no log space can be reclaimed. If it seems ** to indicate that it may be possible to reclaim log space, a ** second call to lsmCheckpointSynced() (which does return trustworthy ** values) is made below to confirm. */ rc = lsmFsReadSyncedId(pDb, iMeta, &iSyncedId); if( rc==LSM_OK && pLog->iSnapshotId!=iSyncedId ){ i64 iSnapshotId = 0; i64 iOff = 0; rc = lsmCheckpointSynced(pDb, &iSnapshotId, &iOff, 0); if( rc==LSM_OK && pLog->iSnapshotIdaRegion[iRegion]; if( iOff>=p->iStart && iOff<=p->iEnd ) break; p->iStart = 0; p->iEnd = 0; } assert( iRegion<3 ); pLog->aRegion[iRegion].iStart = iOff; pLog->iSnapshotId = iSnapshotId; } } } return rc; } /* ** This function is called when a write-transaction is first opened. It ** is assumed that the caller is holding the client-mutex when it is ** called. ** ** Before returning, this function allocates the LogWriter object that ** will be used to write to the log file during the write transaction. ** LSM_OK is returned if no error occurs, otherwise an LSM error code. */ int lsmLogBegin(lsm_db *pDb){ int rc = LSM_OK; LogWriter *pNew; LogRegion *aReg; if( pDb->bUseLog==0 ) return LSM_OK; /* If the log file has not yet been opened, open it now. Also allocate ** the LogWriter structure, if it has not already been allocated. */ rc = lsmFsOpenLog(pDb, 0); if( pDb->pLogWriter==0 ){ pNew = lsmMallocZeroRc(pDb->pEnv, sizeof(LogWriter), &rc); if( pNew ){ lsmStringInit(&pNew->buf, pDb->pEnv); rc = lsmStringExtend(&pNew->buf, 2); } pDb->pLogWriter = pNew; }else{ pNew = pDb->pLogWriter; assert( (u8 *)(&pNew[1])==(u8 *)(&((&pNew->buf)[1])) ); memset(pNew, 0, ((u8 *)&pNew->buf) - (u8 *)pNew); pNew->buf.n = 0; } if( rc==LSM_OK ){ /* The following call detects whether or not a new snapshot has been ** synced into the database file. If so, it updates the contents of ** the pDb->treehdr.log structure to reclaim any space in the log ** file that is no longer required. ** ** TODO: Calling this every transaction is overkill. And since the ** call has to read and checksum a snapshot from the database file, ** it is expensive. It would be better to figure out a way so that ** this is only called occasionally - say for every 32KB written to ** the log file. */ rc = logReclaimSpace(pDb); } if( rc!=LSM_OK ){ lsmLogClose(pDb); return rc; } /* Set the effective sector-size for this transaction. Sectors are assumed ** to be one byte in size if the safety-mode is OFF or NORMAL, or as ** reported by lsmFsSectorSize if it is FULL. */ if( pDb->eSafety==LSM_SAFETY_FULL ){ pNew->szSector = lsmFsSectorSize(pDb->pFS); assert( pNew->szSector>0 ); }else{ pNew->szSector = 1; } /* There are now three scenarios: ** ** 1) Regions 0 and 1 are both zero bytes in size and region 2 begins ** at a file offset greater than LSM_MIN_LOGWRAP. In this case, wrap ** around to the start and write data into the start of the log file. ** ** 2) Region 1 is zero bytes in size and region 2 occurs earlier in the ** file than region 0. In this case, append data to region 2, but ** remember to jump over region 1 if required. ** ** 3) Region 2 is the last in the file. Append to it. */ aReg = &pDb->treehdr.log.aRegion[0]; assert( aReg[0].iEnd==0 || aReg[0].iEnd>aReg[0].iStart ); assert( aReg[1].iEnd==0 || aReg[1].iEnd>aReg[1].iStart ); pNew->cksum0 = pDb->treehdr.log.cksum0; pNew->cksum1 = pDb->treehdr.log.cksum1; if( aReg[0].iEnd==0 && aReg[1].iEnd==0 && aReg[2].iStart>=LSM_MIN_LOGWRAP ){ /* Case 1. Wrap around to the start of the file. Write an LSM_LOG_JUMP ** into the log file in this case. Pad it out to 8 bytes using a PAD2 ** record so that the checksums can be updated immediately. */ u8 aJump[] = { LSM_LOG_PAD2, 0x04, 0x00, 0x00, 0x00, 0x00, LSM_LOG_JUMP, 0x00 }; lsmStringBinAppend(&pNew->buf, aJump, sizeof(aJump)); logUpdateCksum(pNew, pNew->buf.n); rc = lsmFsWriteLog(pDb->pFS, aReg[2].iEnd, &pNew->buf); pNew->iCksumBuf = pNew->buf.n = 0; aReg[2].iEnd += 8; pNew->jump = aReg[0] = aReg[2]; aReg[2].iStart = aReg[2].iEnd = 0; }else if( aReg[1].iEnd==0 && aReg[2].iEndiOff = aReg[2].iEnd; pNew->jump = aReg[0]; }else{ /* Case 3. */ assert( aReg[2].iStart>=aReg[0].iEnd && aReg[2].iStart>=aReg[1].iEnd ); pNew->iOff = aReg[2].iEnd; } if( pNew->jump.iStart ){ i64 iRound; assert( pNew->jump.iStart>pNew->iOff ); iRound = firstByteOnSector(pNew, pNew->jump.iStart); if( iRound>pNew->iOff ) pNew->jump.iStart = iRound; pNew->jump.iEnd = lastByteOnSector(pNew, pNew->jump.iEnd); } assert( pDb->pLogWriter==pNew ); return rc; } /* ** This function is called when a write-transaction is being closed. ** Parameter bCommit is true if the transaction is being committed, ** or false otherwise. The caller must hold the client-mutex to call ** this function. ** ** A call to this function deletes the LogWriter object allocated by ** lsmLogBegin(). If the transaction is being committed, the shared state ** in *pLog is updated before returning. */ void lsmLogEnd(lsm_db *pDb, int bCommit){ DbLog *pLog; LogWriter *p; p = pDb->pLogWriter; if( p==0 ) return; pLog = &pDb->treehdr.log; if( bCommit ){ pLog->aRegion[2].iEnd = p->iOff; pLog->cksum0 = p->cksum0; pLog->cksum1 = p->cksum1; if( p->iRegion1End ){ /* This happens when the transaction had to jump over some other ** part of the log. */ assert( pLog->aRegion[1].iEnd==0 ); assert( pLog->aRegion[2].iStartiRegion1End ); pLog->aRegion[1].iStart = pLog->aRegion[2].iStart; pLog->aRegion[1].iEnd = p->iRegion1End; pLog->aRegion[2].iStart = p->iRegion2Start; } } } static int jumpIfRequired( lsm_db *pDb, LogWriter *pLog, int nReq, int *pbJump ){ /* Determine if it is necessary to add an LSM_LOG_JUMP to jump over the ** jump region before writing the LSM_LOG_WRITE or DELETE record. This ** is necessary if there is insufficient room between the current offset ** and the jump region to fit the new WRITE/DELETE record and the largest ** possible JUMP record with up to 7 bytes of padding (a total of 17 ** bytes). */ if( (pLog->jump.iStart > (pLog->iOff + pLog->buf.n)) && (pLog->jump.iStart < (pLog->iOff + pLog->buf.n + (nReq + 17))) ){ int rc; /* Return code */ i64 iJump; /* Offset to jump to */ u8 aJump[10]; /* Encoded jump record */ int nJump; /* Valid bytes in aJump[] */ int nPad; /* Bytes of padding required */ /* Serialize the JUMP record */ iJump = pLog->jump.iEnd+1; aJump[0] = LSM_LOG_JUMP; nJump = 1 + lsmVarintPut64(&aJump[1], iJump); /* Adding padding to the contents of the buffer so that it will be a ** multiple of 8 bytes in size after the JUMP record is appended. This ** is not strictly required, it just makes the keeping the running ** checksum up to date in this file a little simpler. */ nPad = (pLog->buf.n + nJump) % 8; if( nPad ){ u8 aPad[7] = {0,0,0,0,0,0,0}; nPad = 8-nPad; if( nPad==1 ){ aPad[0] = LSM_LOG_PAD1; }else{ aPad[0] = LSM_LOG_PAD2; aPad[1] = (u8)(nPad-2); } rc = lsmStringBinAppend(&pLog->buf, aPad, nPad); if( rc!=LSM_OK ) return rc; } /* Append the JUMP record to the buffer. Then flush the buffer to disk ** and update the checksums. The next write to the log file (assuming ** there is no transaction rollback) will be to offset iJump (just past ** the jump region). */ rc = lsmStringBinAppend(&pLog->buf, aJump, nJump); if( rc!=LSM_OK ) return rc; assert( (pLog->buf.n % 8)==0 ); rc = lsmFsWriteLog(pDb->pFS, pLog->iOff, &pLog->buf); if( rc!=LSM_OK ) return rc; logUpdateCksum(pLog, pLog->buf.n); pLog->iRegion1End = (pLog->iOff + pLog->buf.n); pLog->iRegion2Start = iJump; pLog->iOff = iJump; pLog->iCksumBuf = pLog->buf.n = 0; if( pbJump ) *pbJump = 1; } return LSM_OK; } static int logCksumAndFlush(lsm_db *pDb){ int rc; /* Return code */ LogWriter *pLog = pDb->pLogWriter; /* Calculate the checksum value. Append it to the buffer. */ logUpdateCksum(pLog, pLog->buf.n); lsmPutU32((u8 *)&pLog->buf.z[pLog->buf.n], pLog->cksum0); pLog->buf.n += 4; lsmPutU32((u8 *)&pLog->buf.z[pLog->buf.n], pLog->cksum1); pLog->buf.n += 4; /* Write the contents of the buffer to disk. */ rc = lsmFsWriteLog(pDb->pFS, pLog->iOff, &pLog->buf); pLog->iOff += pLog->buf.n; pLog->iCksumBuf = pLog->buf.n = 0; return rc; } /* ** Write the contents of the log-buffer to disk. Then write either a CKSUM ** or COMMIT record, depending on the value of parameter eType. */ static int logFlush(lsm_db *pDb, int eType){ int rc; int nReq; LogWriter *pLog = pDb->pLogWriter; assert( eType==LSM_LOG_COMMIT ); assert( pLog ); /* Commit record is always 9 bytes in size. */ nReq = 9; if( eType==LSM_LOG_COMMIT && pLog->szSector>1 ) nReq += pLog->szSector + 17; rc = jumpIfRequired(pDb, pLog, nReq, 0); /* If this is a COMMIT, add padding to the log so that the COMMIT record ** is aligned against the end of a disk sector. In other words, add padding ** so that the first byte following the COMMIT record lies on a different ** sector. */ if( eType==LSM_LOG_COMMIT && pLog->szSector>1 ){ int nPad; /* Bytes of padding to add */ /* Determine the value of nPad. */ nPad = ((pLog->iOff + pLog->buf.n + 9) % pLog->szSector); if( nPad ) nPad = pLog->szSector - nPad; rc = lsmStringExtend(&pLog->buf, nPad); if( rc!=LSM_OK ) return rc; while( nPad ){ if( nPad==1 ){ pLog->buf.z[pLog->buf.n++] = LSM_LOG_PAD1; nPad = 0; }else{ int n = LSM_MIN(200, nPad-2); pLog->buf.z[pLog->buf.n++] = LSM_LOG_PAD2; pLog->buf.z[pLog->buf.n++] = (char)n; nPad -= 2; memset(&pLog->buf.z[pLog->buf.n], 0x2B, n); pLog->buf.n += n; nPad -= n; } } } /* Make sure there is room in the log-buffer to add the CKSUM or COMMIT ** record. Then add the first byte of it. */ rc = lsmStringExtend(&pLog->buf, 9); if( rc!=LSM_OK ) return rc; pLog->buf.z[pLog->buf.n++] = (char)eType; memset(&pLog->buf.z[pLog->buf.n], 0, 8); rc = logCksumAndFlush(pDb); /* If this is a commit and synchronous=full, sync the log to disk. */ if( rc==LSM_OK && eType==LSM_LOG_COMMIT && pDb->eSafety==LSM_SAFETY_FULL ){ rc = lsmFsSyncLog(pDb->pFS); } return rc; } /* ** Append an LSM_LOG_WRITE (if nVal>=0) or LSM_LOG_DELETE (if nVal<0) ** record to the database log. */ int lsmLogWrite( lsm_db *pDb, /* Database handle */ int eType, void *pKey, int nKey, /* Database key to write to log */ void *pVal, int nVal /* Database value (or nVal<0) to write */ ){ int rc = LSM_OK; LogWriter *pLog; /* Log object to write to */ int nReq; /* Bytes of space required in log */ int bCksum = 0; /* True to embed a checksum in this record */ assert( eType==LSM_WRITE || eType==LSM_DELETE || eType==LSM_DRANGE ); assert( LSM_LOG_WRITE==LSM_WRITE ); assert( LSM_LOG_DELETE==LSM_DELETE ); assert( LSM_LOG_DRANGE==LSM_DRANGE ); assert( (eType==LSM_LOG_DELETE)==(nVal<0) ); if( pDb->bUseLog==0 ) return LSM_OK; pLog = pDb->pLogWriter; /* Determine how many bytes of space are required, assuming that a checksum ** will be embedded in this record (even though it may not be). */ nReq = 1 + lsmVarintLen32(nKey) + 8 + nKey; if( eType!=LSM_LOG_DELETE ) nReq += lsmVarintLen32(nVal) + nVal; /* Jump over the jump region if required. Set bCksum to true to tell the ** code below to include a checksum in the record if either (a) writing ** this record would mean that more than LSM_CKSUM_MAXDATA bytes of data ** have been written to the log since the last checksum, or (b) the jump ** is taken. */ rc = jumpIfRequired(pDb, pLog, nReq, &bCksum); if( (pLog->buf.n+nReq) > LSM_CKSUM_MAXDATA ) bCksum = 1; if( rc==LSM_OK ){ rc = lsmStringExtend(&pLog->buf, nReq); } if( rc==LSM_OK ){ u8 *a = (u8 *)&pLog->buf.z[pLog->buf.n]; /* Write the record header - the type byte followed by either 1 (for ** DELETE) or 2 (for WRITE) varints. */ assert( LSM_LOG_WRITE_CKSUM == (LSM_LOG_WRITE | 0x0001) ); assert( LSM_LOG_DELETE_CKSUM == (LSM_LOG_DELETE | 0x0001) ); assert( LSM_LOG_DRANGE_CKSUM == (LSM_LOG_DRANGE | 0x0001) ); *(a++) = (u8)eType | (u8)bCksum; a += lsmVarintPut32(a, nKey); if( eType!=LSM_LOG_DELETE ) a += lsmVarintPut32(a, nVal); if( bCksum ){ pLog->buf.n = (a - (u8 *)pLog->buf.z); rc = logCksumAndFlush(pDb); a = (u8 *)&pLog->buf.z[pLog->buf.n]; } memcpy(a, pKey, nKey); a += nKey; if( eType!=LSM_LOG_DELETE ){ memcpy(a, pVal, nVal); a += nVal; } pLog->buf.n = a - (u8 *)pLog->buf.z; assert( pLog->buf.n<=pLog->buf.nAlloc ); } return rc; } /* ** Append an LSM_LOG_COMMIT record to the database log. */ int lsmLogCommit(lsm_db *pDb){ if( pDb->bUseLog==0 ) return LSM_OK; return logFlush(pDb, LSM_LOG_COMMIT); } /* ** Store the current offset and other checksum related information in the ** structure *pMark. Later, *pMark can be passed to lsmLogSeek() to "rewind" ** the LogWriter object to the current log file offset. This is used when ** rolling back savepoint transactions. */ void lsmLogTell( lsm_db *pDb, /* Database handle */ LogMark *pMark /* Populate this object with current offset */ ){ LogWriter *pLog; int nCksum; if( pDb->bUseLog==0 ) return; pLog = pDb->pLogWriter; nCksum = pLog->buf.n & 0xFFFFFFF8; logUpdateCksum(pLog, nCksum); assert( pLog->iCksumBuf==nCksum ); pMark->nBuf = pLog->buf.n - nCksum; memcpy(pMark->aBuf, &pLog->buf.z[nCksum], pMark->nBuf); pMark->iOff = pLog->iOff + pLog->buf.n; pMark->cksum0 = pLog->cksum0; pMark->cksum1 = pLog->cksum1; } /* ** Seek (rewind) back to the log file offset stored by an ealier call to ** lsmLogTell() in *pMark. */ void lsmLogSeek( lsm_db *pDb, /* Database handle */ LogMark *pMark /* Object containing log offset to seek to */ ){ LogWriter *pLog; if( pDb->bUseLog==0 ) return; pLog = pDb->pLogWriter; assert( pMark->iOff<=pLog->iOff+pLog->buf.n ); if( (pMark->iOff & 0xFFFFFFF8)>=pLog->iOff ){ pLog->buf.n = (int)(pMark->iOff - pLog->iOff); pLog->iCksumBuf = (pLog->buf.n & 0xFFFFFFF8); }else{ pLog->buf.n = pMark->nBuf; memcpy(pLog->buf.z, pMark->aBuf, pMark->nBuf); pLog->iCksumBuf = 0; pLog->iOff = pMark->iOff - pMark->nBuf; } pLog->cksum0 = pMark->cksum0; pLog->cksum1 = pMark->cksum1; if( pMark->iOff > pLog->iRegion1End ) pLog->iRegion1End = 0; if( pMark->iOff > pLog->iRegion2Start ) pLog->iRegion2Start = 0; } /* ** This function does the work for an lsm_info(LOG_STRUCTURE) request. */ int lsmInfoLogStructure(lsm_db *pDb, char **pzVal){ int rc = LSM_OK; char *zVal = 0; /* If there is no read or write transaction open, read the latest ** tree-header from shared-memory to report on. If necessary, update ** it based on the contents of the database header. ** ** No locks are taken here - these are passive read operations only. */ if( pDb->pCsr==0 && pDb->nTransOpen==0 ){ rc = lsmTreeLoadHeader(pDb, 0); if( rc==LSM_OK ) rc = logReclaimSpace(pDb); } if( rc==LSM_OK ){ DbLog *pLog = &pDb->treehdr.log; zVal = lsmMallocPrintf(pDb->pEnv, "%d %d %d %d %d %d", (int)pLog->aRegion[0].iStart, (int)pLog->aRegion[0].iEnd, (int)pLog->aRegion[1].iStart, (int)pLog->aRegion[1].iEnd, (int)pLog->aRegion[2].iStart, (int)pLog->aRegion[2].iEnd ); if( !zVal ) rc = LSM_NOMEM_BKPT; } *pzVal = zVal; return rc; } /************************************************************************* ** Begin code for log recovery. */ typedef struct LogReader LogReader; struct LogReader { FileSystem *pFS; /* File system to read from */ i64 iOff; /* File offset at end of buf content */ int iBuf; /* Current read offset in buf */ LsmString buf; /* Buffer containing file content */ int iCksumBuf; /* Offset in buf corresponding to cksum[01] */ u32 cksum0; /* Checksum 0 at offset iCksumBuf */ u32 cksum1; /* Checksum 1 at offset iCksumBuf */ }; static void logReaderBlob( LogReader *p, /* Log reader object */ LsmString *pBuf, /* Dynamic storage, if required */ int nBlob, /* Number of bytes to read */ u8 **ppBlob, /* OUT: Pointer to blob read */ int *pRc /* IN/OUT: Error code */ ){ static const int LOG_READ_SIZE = 512; int rc = *pRc; /* Return code */ int nReq = nBlob; /* Bytes required */ while( rc==LSM_OK && nReq>0 ){ int nAvail; /* Bytes of data available in p->buf */ if( p->buf.n==p->iBuf ){ int nCksum; /* Total bytes requiring checksum */ int nCarry = 0; /* Total bytes requiring checksum */ nCksum = p->iBuf - p->iCksumBuf; if( nCksum>0 ){ nCarry = nCksum % 8; nCksum = ((nCksum / 8) * 8); if( nCksum>0 ){ logCksumUnaligned( &p->buf.z[p->iCksumBuf], nCksum, &p->cksum0, &p->cksum1 ); } } if( nCarry>0 ) memcpy(p->buf.z, &p->buf.z[p->iBuf-nCarry], nCarry); p->buf.n = nCarry; p->iBuf = nCarry; rc = lsmFsReadLog(p->pFS, p->iOff, LOG_READ_SIZE, &p->buf); if( rc!=LSM_OK ) break; p->iCksumBuf = 0; p->iOff += LOG_READ_SIZE; } nAvail = p->buf.n - p->iBuf; if( ppBlob && nReq==nBlob && nBlob<=nAvail ){ *ppBlob = (u8 *)&p->buf.z[p->iBuf]; p->iBuf += nBlob; nReq = 0; }else{ int nCopy = LSM_MIN(nAvail, nReq); if( nBlob==nReq ){ pBuf->n = 0; } rc = lsmStringBinAppend(pBuf, (u8 *)&p->buf.z[p->iBuf], nCopy); nReq -= nCopy; p->iBuf += nCopy; if( nReq==0 && ppBlob ){ *ppBlob = (u8*)pBuf->z; } } } *pRc = rc; } static void logReaderVarint( LogReader *p, LsmString *pBuf, int *piVal, /* OUT: Value read from log */ int *pRc /* IN/OUT: Error code */ ){ if( *pRc==LSM_OK ){ u8 *aVarint; if( p->buf.n==p->iBuf ){ logReaderBlob(p, 0, 10, &aVarint, pRc); if( LSM_OK==*pRc ) p->iBuf -= (10 - lsmVarintGet32(aVarint, piVal)); }else{ logReaderBlob(p, pBuf, lsmVarintSize(p->buf.z[p->iBuf]), &aVarint, pRc); if( LSM_OK==*pRc ) lsmVarintGet32(aVarint, piVal); } } } static void logReaderByte(LogReader *p, u8 *pByte, int *pRc){ u8 *pPtr = 0; logReaderBlob(p, 0, 1, &pPtr, pRc); if( pPtr ) *pByte = *pPtr; } static void logReaderCksum(LogReader *p, LsmString *pBuf, int *pbEof, int *pRc){ if( *pRc==LSM_OK ){ u8 *pPtr = 0; u32 cksum0, cksum1; int nCksum = p->iBuf - p->iCksumBuf; /* Update in-memory (expected) checksums */ assert( nCksum>=0 ); logCksumUnaligned(&p->buf.z[p->iCksumBuf], nCksum, &p->cksum0, &p->cksum1); p->iCksumBuf = p->iBuf + 8; logReaderBlob(p, pBuf, 8, &pPtr, pRc); assert( pPtr || *pRc ); /* Read the checksums from the log file. Set *pbEof if they do not match. */ if( pPtr ){ cksum0 = lsmGetU32(pPtr); cksum1 = lsmGetU32(&pPtr[4]); *pbEof = (cksum0!=p->cksum0 || cksum1!=p->cksum1); p->iCksumBuf = p->iBuf; } } } static void logReaderInit( lsm_db *pDb, /* Database handle */ DbLog *pLog, /* Log object associated with pDb */ int bInitBuf, /* True if p->buf is uninitialized */ LogReader *p /* Initialize this LogReader object */ ){ p->pFS = pDb->pFS; p->iOff = pLog->aRegion[2].iStart; p->cksum0 = pLog->cksum0; p->cksum1 = pLog->cksum1; if( bInitBuf ){ lsmStringInit(&p->buf, pDb->pEnv); } p->buf.n = 0; p->iCksumBuf = 0; p->iBuf = 0; } /* ** This function is called after reading the header of a LOG_DELETE or ** LOG_WRITE record. Parameter nByte is the total size of the key and ** value that follow the header just read. Return true if the size and ** position of the record indicate that it should contain a checksum. */ static int logRequireCksum(LogReader *p, int nByte){ return ((p->iBuf + nByte - p->iCksumBuf) > LSM_CKSUM_MAXDATA); } /* ** Recover the contents of the log file. */ int lsmLogRecover(lsm_db *pDb){ LsmString buf1; /* Key buffer */ LsmString buf2; /* Value buffer */ LogReader reader; /* Log reader object */ int rc = LSM_OK; /* Return code */ int nCommit = 0; /* Number of transactions to recover */ int iPass; int nJump = 0; /* Number of LSM_LOG_JUMP records in pass 0 */ DbLog *pLog; int bOpen; rc = lsmFsOpenLog(pDb, &bOpen); if( rc!=LSM_OK ) return rc; rc = lsmTreeInit(pDb); if( rc!=LSM_OK ) return rc; pLog = &pDb->treehdr.log; lsmCheckpointLogoffset(pDb->pShmhdr->aSnap2, pLog); logReaderInit(pDb, pLog, 1, &reader); lsmStringInit(&buf1, pDb->pEnv); lsmStringInit(&buf2, pDb->pEnv); /* The outer for() loop runs at most twice. The first iteration is to ** count the number of committed transactions in the log. The second ** iterates through those transactions and updates the in-memory tree ** structure with their contents. */ if( bOpen ){ for(iPass=0; iPass<2 && rc==LSM_OK; iPass++){ int bEof = 0; while( rc==LSM_OK && !bEof ){ u8 eType = 0; logReaderByte(&reader, &eType, &rc); switch( eType ){ case LSM_LOG_PAD1: break; case LSM_LOG_PAD2: { int nPad; logReaderVarint(&reader, &buf1, &nPad, &rc); logReaderBlob(&reader, &buf1, nPad, 0, &rc); break; } case LSM_LOG_DRANGE: case LSM_LOG_DRANGE_CKSUM: case LSM_LOG_WRITE: case LSM_LOG_WRITE_CKSUM: { int nKey; int nVal; u8 *aVal; logReaderVarint(&reader, &buf1, &nKey, &rc); logReaderVarint(&reader, &buf2, &nVal, &rc); if( eType==LSM_LOG_WRITE_CKSUM || eType==LSM_LOG_DRANGE_CKSUM ){ logReaderCksum(&reader, &buf1, &bEof, &rc); }else{ bEof = logRequireCksum(&reader, nKey+nVal); } if( bEof ) break; logReaderBlob(&reader, &buf1, nKey, 0, &rc); logReaderBlob(&reader, &buf2, nVal, &aVal, &rc); if( iPass==1 && rc==LSM_OK ){ if( eType==LSM_LOG_WRITE || eType==LSM_LOG_WRITE_CKSUM ){ rc = lsmTreeInsert(pDb, (u8 *)buf1.z, nKey, aVal, nVal); }else{ rc = lsmTreeDelete(pDb, (u8 *)buf1.z, nKey, aVal, nVal); } } break; } case LSM_LOG_DELETE: case LSM_LOG_DELETE_CKSUM: { int nKey; u8 *aKey; logReaderVarint(&reader, &buf1, &nKey, &rc); if( eType==LSM_LOG_DELETE_CKSUM ){ logReaderCksum(&reader, &buf1, &bEof, &rc); }else{ bEof = logRequireCksum(&reader, nKey); } if( bEof ) break; logReaderBlob(&reader, &buf1, nKey, &aKey, &rc); if( iPass==1 && rc==LSM_OK ){ rc = lsmTreeInsert(pDb, aKey, nKey, NULL, -1); } break; } case LSM_LOG_COMMIT: logReaderCksum(&reader, &buf1, &bEof, &rc); if( bEof==0 ){ nCommit++; assert( nCommit>0 || iPass==1 ); if( nCommit==0 ) bEof = 1; } break; case LSM_LOG_JUMP: { int iOff = 0; logReaderVarint(&reader, &buf1, &iOff, &rc); if( rc==LSM_OK ){ if( iPass==1 ){ if( pLog->aRegion[2].iStart==0 ){ assert( pLog->aRegion[1].iStart==0 ); pLog->aRegion[1].iEnd = reader.iOff; }else{ assert( pLog->aRegion[0].iStart==0 ); pLog->aRegion[0].iStart = pLog->aRegion[2].iStart; pLog->aRegion[0].iEnd = reader.iOff-reader.buf.n+reader.iBuf; } pLog->aRegion[2].iStart = iOff; }else{ if( (nJump++)==2 ){ bEof = 1; } } reader.iOff = iOff; reader.buf.n = reader.iBuf; } break; } default: /* Including LSM_LOG_EOF */ bEof = 1; break; } } if( rc==LSM_OK && iPass==0 ){ if( nCommit==0 ){ if( pLog->aRegion[2].iStart==0 ){ iPass = 1; }else{ pLog->aRegion[2].iStart = 0; iPass = -1; lsmCheckpointZeroLogoffset(pDb); } } logReaderInit(pDb, pLog, 0, &reader); nCommit = nCommit * -1; } } } /* Initialize DbLog object */ if( rc==LSM_OK ){ pLog->aRegion[2].iEnd = reader.iOff - reader.buf.n + reader.iBuf; pLog->cksum0 = reader.cksum0; pLog->cksum1 = reader.cksum1; } if( rc==LSM_OK ){ rc = lsmFinishRecovery(pDb); }else{ lsmFinishRecovery(pDb); } if( pDb->bRoTrans ){ lsmFsCloseLog(pDb); } lsmStringClear(&buf1); lsmStringClear(&buf2); lsmStringClear(&reader.buf); return rc; } void lsmLogClose(lsm_db *db){ if( db->pLogWriter ){ lsmFree(db->pEnv, db->pLogWriter->buf.z); lsmFree(db->pEnv, db->pLogWriter); db->pLogWriter = 0; } } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_main.c ================================================ /* ** 2011-08-18 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** The main interface to the LSM module. */ #include "lsmInt.h" #ifdef LSM_DEBUG /* ** This function returns a copy of its only argument. ** ** When the library is built with LSM_DEBUG defined, this function is called ** whenever an error code is generated (not propagated - generated). So ** if the library is mysteriously returning (say) LSM_IOERR, a breakpoint ** may be set in this function to determine why. */ int lsmErrorBkpt(int rc){ /* Set breakpoint here! */ return rc; } /* ** This function contains various assert() statements that test that the ** lsm_db structure passed as an argument is internally consistent. */ static void assert_db_state(lsm_db *pDb){ /* If there is at least one cursor or a write transaction open, the database ** handle must be holding a pointer to a client snapshot. And the reverse ** - if there are no open cursors and no write transactions then there must ** not be a client snapshot. */ assert( (pDb->pCsr!=0||pDb->nTransOpen>0)==(pDb->iReader>=0||pDb->bRoTrans) ); assert( (pDb->iReader<0 && pDb->bRoTrans==0) || pDb->pClient!=0 ); assert( pDb->nTransOpen>=0 ); } #else # define assert_db_state(x) #endif /* ** The default key-compare function. */ static int xCmp(void *p1, int n1, void *p2, int n2){ int res; res = memcmp(p1, p2, LSM_MIN(n1, n2)); if( res==0 ) res = (n1-n2); return res; } static void xLog(void *pCtx, int rc, const char *z){ (void)(rc); (void)(pCtx); fprintf(stderr, "%s\n", z); fflush(stderr); } /* ** Allocate a new db handle. */ int lsm_new(lsm_env *pEnv, lsm_db **ppDb){ lsm_db *pDb; /* If the user did not provide an environment, use the default. */ if( pEnv==0 ) pEnv = lsm_default_env(); assert( pEnv ); /* Allocate the new database handle */ *ppDb = pDb = (lsm_db *)lsmMallocZero(pEnv, sizeof(lsm_db)); if( pDb==0 ) return LSM_NOMEM_BKPT; /* Initialize the new object */ pDb->pEnv = pEnv; pDb->nTreeLimit = LSM_DFLT_AUTOFLUSH; pDb->nAutockpt = LSM_DFLT_AUTOCHECKPOINT; pDb->bAutowork = LSM_DFLT_AUTOWORK; pDb->eSafety = LSM_DFLT_SAFETY; pDb->xCmp = xCmp; pDb->nDfltPgsz = LSM_DFLT_PAGE_SIZE; pDb->nDfltBlksz = LSM_DFLT_BLOCK_SIZE; pDb->nMerge = LSM_DFLT_AUTOMERGE; pDb->nMaxFreelist = LSM_MAX_FREELIST_ENTRIES; pDb->bUseLog = LSM_DFLT_USE_LOG; pDb->iReader = -1; pDb->iRwclient = -1; pDb->bMultiProc = LSM_DFLT_MULTIPLE_PROCESSES; pDb->iMmap = LSM_DFLT_MMAP; pDb->xLog = xLog; pDb->compress.iId = LSM_COMPRESSION_NONE; return LSM_OK; } lsm_env *lsm_get_env(lsm_db *pDb){ assert( pDb->pEnv ); return pDb->pEnv; } /* ** If database handle pDb is currently holding a client snapshot, but does ** not have any open cursors or write transactions, release it. */ static void dbReleaseClientSnapshot(lsm_db *pDb){ if( pDb->nTransOpen==0 && pDb->pCsr==0 ){ lsmFinishReadTrans(pDb); } } static int getFullpathname( lsm_env *pEnv, const char *zRel, char **pzAbs ){ int nAlloc = 0; char *zAlloc = 0; int nReq = 0; int rc; do{ nAlloc = nReq; rc = pEnv->xFullpath(pEnv, zRel, zAlloc, &nReq); if( nReq>nAlloc ){ zAlloc = lsmReallocOrFreeRc(pEnv, zAlloc, nReq, &rc); } }while( nReq>nAlloc && rc==LSM_OK ); if( rc!=LSM_OK ){ lsmFree(pEnv, zAlloc); zAlloc = 0; } *pzAbs = zAlloc; return rc; } /* ** Check that the bits in the db->mLock mask are consistent with the ** value stored in db->iRwclient. An assert shall fail otherwise. */ static void assertRwclientLockValue(lsm_db *db){ #ifndef NDEBUG u64 msk; /* Mask of mLock bits for RWCLIENT locks */ u64 rwclient = 0; /* Bit corresponding to db->iRwclient */ if( db->iRwclient>=0 ){ rwclient = ((u64)1 << (LSM_LOCK_RWCLIENT(db->iRwclient)-1)); } msk = ((u64)1 << (LSM_LOCK_RWCLIENT(LSM_LOCK_NRWCLIENT)-1)) - 1; msk -= (((u64)1 << (LSM_LOCK_RWCLIENT(0)-1)) - 1); assert( (db->mLock & msk)==rwclient ); #endif } /* ** Open a new connection to database zFilename. */ int lsm_open(lsm_db *pDb, const char *zFilename){ int rc; if( pDb->pDatabase ){ rc = LSM_MISUSE; }else{ char *zFull; /* Translate the possibly relative pathname supplied by the user into ** an absolute pathname. This is required because the supplied path ** is used (either directly or with "-log" appended to it) for more ** than one purpose - to open both the database and log files, and ** perhaps to unlink the log file during disconnection. An absolute ** path is required to ensure that the correct files are operated ** on even if the application changes the cwd. */ rc = getFullpathname(pDb->pEnv, zFilename, &zFull); assert( rc==LSM_OK || zFull==0 ); /* Connect to the database. */ if( rc==LSM_OK ){ rc = lsmDbDatabaseConnect(pDb, zFull); } if( pDb->bReadonly==0 ){ /* Configure the file-system connection with the page-size and block-size ** of this database. Even if the database file is zero bytes in size ** on disk, these values have been set in shared-memory by now, and so ** are guaranteed not to change during the lifetime of this connection. */ if( rc==LSM_OK && LSM_OK==(rc = lsmCheckpointLoad(pDb, 0)) ){ lsmFsSetPageSize(pDb->pFS, lsmCheckpointPgsz(pDb->aSnapshot)); lsmFsSetBlockSize(pDb->pFS, lsmCheckpointBlksz(pDb->aSnapshot)); } } lsmFree(pDb->pEnv, zFull); assertRwclientLockValue(pDb); } assert( pDb->bReadonly==0 || pDb->bReadonly==1 ); assert( rc!=LSM_OK || (pDb->pShmhdr==0)==(pDb->bReadonly==1) ); return rc; } int lsm_close(lsm_db *pDb){ int rc = LSM_OK; if( pDb ){ assert_db_state(pDb); if( pDb->pCsr || pDb->nTransOpen ){ rc = LSM_MISUSE_BKPT; }else{ lsmMCursorFreeCache(pDb); lsmFreeSnapshot(pDb->pEnv, pDb->pClient); pDb->pClient = 0; assertRwclientLockValue(pDb); lsmDbDatabaseRelease(pDb); lsmLogClose(pDb); lsmFsClose(pDb->pFS); /* assert( pDb->mLock==0 ); */ /* Invoke any destructors registered for the compression or ** compression factory callbacks. */ if( pDb->factory.xFree ) pDb->factory.xFree(pDb->factory.pCtx); if( pDb->compress.xFree ) pDb->compress.xFree(pDb->compress.pCtx); lsmFree(pDb->pEnv, pDb->rollback.aArray); lsmFree(pDb->pEnv, pDb->aTrans); lsmFree(pDb->pEnv, pDb->apShm); lsmFree(pDb->pEnv, pDb); } } return rc; } int lsm_config(lsm_db *pDb, int eParam, ...){ int rc = LSM_OK; va_list ap; va_start(ap, eParam); switch( eParam ){ case LSM_CONFIG_AUTOFLUSH: { /* This parameter is read and written in KB. But all internal ** processing is done in bytes. */ int *piVal = va_arg(ap, int *); int iVal = *piVal; if( iVal>=0 && iVal<=(1024*1024) ){ pDb->nTreeLimit = iVal*1024; } *piVal = (pDb->nTreeLimit / 1024); break; } case LSM_CONFIG_AUTOWORK: { int *piVal = va_arg(ap, int *); if( *piVal>=0 ){ pDb->bAutowork = *piVal; } *piVal = pDb->bAutowork; break; } case LSM_CONFIG_AUTOCHECKPOINT: { /* This parameter is read and written in KB. But all internal processing ** (including the lsm_db.nAutockpt variable) is done in bytes. */ int *piVal = va_arg(ap, int *); if( *piVal>=0 ){ int iVal = *piVal; pDb->nAutockpt = (i64)iVal * 1024; } *piVal = (int)(pDb->nAutockpt / 1024); break; } case LSM_CONFIG_PAGE_SIZE: { int *piVal = va_arg(ap, int *); if( pDb->pDatabase ){ /* If lsm_open() has been called, this is a read-only parameter. ** Set the output variable to the page-size according to the ** FileSystem object. */ *piVal = lsmFsPageSize(pDb->pFS); }else{ if( *piVal>=256 && *piVal<=65536 && ((*piVal-1) & *piVal)==0 ){ pDb->nDfltPgsz = *piVal; }else{ *piVal = pDb->nDfltPgsz; } } break; } case LSM_CONFIG_BLOCK_SIZE: { /* This parameter is read and written in KB. But all internal ** processing is done in bytes. */ int *piVal = va_arg(ap, int *); if( pDb->pDatabase ){ /* If lsm_open() has been called, this is a read-only parameter. ** Set the output variable to the block-size in KB according to the ** FileSystem object. */ *piVal = lsmFsBlockSize(pDb->pFS) / 1024; }else{ int iVal = *piVal; if( iVal>=64 && iVal<=65536 && ((iVal-1) & iVal)==0 ){ pDb->nDfltBlksz = iVal * 1024; }else{ *piVal = pDb->nDfltBlksz / 1024; } } break; } case LSM_CONFIG_SAFETY: { int *piVal = va_arg(ap, int *); if( *piVal>=0 && *piVal<=2 ){ pDb->eSafety = *piVal; } *piVal = pDb->eSafety; break; } case LSM_CONFIG_MMAP: { int *piVal = va_arg(ap, int *); if( pDb->iReader<0 && *piVal>=0 ){ pDb->iMmap = *piVal; rc = lsmFsConfigure(pDb); } *piVal = pDb->iMmap; break; } case LSM_CONFIG_USE_LOG: { int *piVal = va_arg(ap, int *); if( pDb->nTransOpen==0 && (*piVal==0 || *piVal==1) ){ pDb->bUseLog = *piVal; } *piVal = pDb->bUseLog; break; } case LSM_CONFIG_AUTOMERGE: { int *piVal = va_arg(ap, int *); if( *piVal>1 ) pDb->nMerge = *piVal; *piVal = pDb->nMerge; break; } case LSM_CONFIG_MAX_FREELIST: { int *piVal = va_arg(ap, int *); if( *piVal>=2 && *piVal<=LSM_MAX_FREELIST_ENTRIES ){ pDb->nMaxFreelist = *piVal; } *piVal = pDb->nMaxFreelist; break; } case LSM_CONFIG_MULTIPLE_PROCESSES: { int *piVal = va_arg(ap, int *); if( pDb->pDatabase ){ /* If lsm_open() has been called, this is a read-only parameter. ** Set the output variable to true if this connection is currently ** in multi-process mode. */ *piVal = lsmDbMultiProc(pDb); }else{ pDb->bMultiProc = *piVal = (*piVal!=0); } break; } case LSM_CONFIG_READONLY: { int *piVal = va_arg(ap, int *); /* If lsm_open() has been called, this is a read-only parameter. */ if( pDb->pDatabase==0 && *piVal>=0 ){ pDb->bReadonly = *piVal = (*piVal!=0); } *piVal = pDb->bReadonly; break; } case LSM_CONFIG_SET_COMPRESSION: { lsm_compress *p = va_arg(ap, lsm_compress *); if( pDb->iReader>=0 && pDb->bInFactory==0 ){ /* May not change compression schemes with an open transaction */ rc = LSM_MISUSE_BKPT; }else{ if( pDb->compress.xFree ){ /* Invoke any destructor belonging to the current compression. */ pDb->compress.xFree(pDb->compress.pCtx); } if( p->xBound==0 ){ memset(&pDb->compress, 0, sizeof(lsm_compress)); pDb->compress.iId = LSM_COMPRESSION_NONE; }else{ memcpy(&pDb->compress, p, sizeof(lsm_compress)); } rc = lsmFsConfigure(pDb); } break; } case LSM_CONFIG_SET_COMPRESSION_FACTORY: { lsm_compress_factory *p = va_arg(ap, lsm_compress_factory *); if( pDb->factory.xFree ){ /* Invoke any destructor belonging to the current factory. */ pDb->factory.xFree(pDb->factory.pCtx); } memcpy(&pDb->factory, p, sizeof(lsm_compress_factory)); break; } case LSM_CONFIG_GET_COMPRESSION: { lsm_compress *p = va_arg(ap, lsm_compress *); memcpy(p, &pDb->compress, sizeof(lsm_compress)); break; } default: rc = LSM_MISUSE; break; } va_end(ap); return rc; } void lsmAppendSegmentList(LsmString *pStr, char *zPre, Segment *pSeg){ lsmStringAppendf(pStr, "%s{%d %d %d %d}", zPre, pSeg->iFirst, pSeg->iLastPg, pSeg->iRoot, pSeg->nSize ); } static int infoGetWorker(lsm_db *pDb, Snapshot **pp, int *pbUnlock){ int rc = LSM_OK; assert( *pbUnlock==0 ); if( !pDb->pWorker ){ rc = lsmBeginWork(pDb); if( rc!=LSM_OK ) return rc; *pbUnlock = 1; } if( pp ) *pp = pDb->pWorker; return rc; } static void infoFreeWorker(lsm_db *pDb, int bUnlock){ if( bUnlock ){ int rcdummy = LSM_BUSY; lsmFinishWork(pDb, 0, &rcdummy); } } int lsmStructList( lsm_db *pDb, /* Database handle */ char **pzOut /* OUT: Nul-terminated string (tcl list) */ ){ Level *pTopLevel = 0; /* Top level of snapshot to report on */ int rc = LSM_OK; Level *p; LsmString s; Snapshot *pWorker; /* Worker snapshot */ int bUnlock = 0; /* Obtain the worker snapshot */ rc = infoGetWorker(pDb, &pWorker, &bUnlock); if( rc!=LSM_OK ) return rc; /* Format the contents of the snapshot as text */ pTopLevel = lsmDbSnapshotLevel(pWorker); lsmStringInit(&s, pDb->pEnv); for(p=pTopLevel; rc==LSM_OK && p; p=p->pNext){ int i; lsmStringAppendf(&s, "%s{%d", (s.n ? " " : ""), (int)p->iAge); lsmAppendSegmentList(&s, " ", &p->lhs); for(i=0; rc==LSM_OK && inRight; i++){ lsmAppendSegmentList(&s, " ", &p->aRhs[i]); } lsmStringAppend(&s, "}", 1); } rc = s.n>=0 ? LSM_OK : LSM_NOMEM; /* Release the snapshot and return */ infoFreeWorker(pDb, bUnlock); *pzOut = s.z; return rc; } static int infoFreelistCb(void *pCtx, int iBlk, i64 iSnapshot){ LsmString *pStr = (LsmString *)pCtx; lsmStringAppendf(pStr, "%s{%d %lld}", (pStr->n?" ":""), iBlk, iSnapshot); return 0; } int lsmInfoFreelist(lsm_db *pDb, char **pzOut){ Snapshot *pWorker; /* Worker snapshot */ int bUnlock = 0; LsmString s; int rc; /* Obtain the worker snapshot */ rc = infoGetWorker(pDb, &pWorker, &bUnlock); if( rc!=LSM_OK ) return rc; lsmStringInit(&s, pDb->pEnv); rc = lsmWalkFreelist(pDb, 0, infoFreelistCb, &s); if( rc!=LSM_OK ){ lsmFree(pDb->pEnv, s.z); }else{ *pzOut = s.z; } /* Release the snapshot and return */ infoFreeWorker(pDb, bUnlock); return rc; } static int infoTreeSize(lsm_db *db, int *pnOldKB, int *pnNewKB){ ShmHeader *pShm = db->pShmhdr; TreeHeader *p = &pShm->hdr1; /* The following code suffers from two race conditions, as it accesses and ** trusts the contents of shared memory without verifying checksums: ** ** * The two values read - TreeHeader.root.nByte and oldroot.nByte - are ** 32-bit fields. It is assumed that reading from one of these ** is atomic - that it is not possible to read a partially written ** garbage value. However the two values may be mutually inconsistent. ** ** * TreeHeader.iLogOff is a 64-bit value. And lsmCheckpointLogOffset() ** reads a 64-bit value from a snapshot stored in shared memory. It ** is assumed that in each case it is possible to read a partially ** written garbage value. If this occurs, then the value returned ** for the size of the "old" tree may reflect the size of an "old" ** tree that was recently flushed to disk. ** ** Given the context in which this function is called (as a result of an ** lsm_info(LSM_INFO_TREE_SIZE) request), neither of these are considered to ** be problems. */ *pnNewKB = ((int)p->root.nByte + 1023) / 1024; if( p->iOldShmid ){ if( p->iOldLog==lsmCheckpointLogOffset(pShm->aSnap1) ){ *pnOldKB = 0; }else{ *pnOldKB = ((int)p->oldroot.nByte + 1023) / 1024; } }else{ *pnOldKB = 0; } return LSM_OK; } int lsm_info(lsm_db *pDb, int eParam, ...){ int rc = LSM_OK; va_list ap; va_start(ap, eParam); switch( eParam ){ case LSM_INFO_NWRITE: { int *piVal = va_arg(ap, int *); *piVal = lsmFsNWrite(pDb->pFS); break; } case LSM_INFO_NREAD: { int *piVal = va_arg(ap, int *); *piVal = lsmFsNRead(pDb->pFS); break; } case LSM_INFO_DB_STRUCTURE: { char **pzVal = va_arg(ap, char **); rc = lsmStructList(pDb, pzVal); break; } case LSM_INFO_ARRAY_STRUCTURE: { Pgno pgno = va_arg(ap, Pgno); char **pzVal = va_arg(ap, char **); rc = lsmInfoArrayStructure(pDb, 0, pgno, pzVal); break; } case LSM_INFO_ARRAY_PAGES: { Pgno pgno = va_arg(ap, Pgno); char **pzVal = va_arg(ap, char **); rc = lsmInfoArrayPages(pDb, pgno, pzVal); break; } case LSM_INFO_PAGE_HEX_DUMP: case LSM_INFO_PAGE_ASCII_DUMP: { Pgno pgno = va_arg(ap, Pgno); char **pzVal = va_arg(ap, char **); int bUnlock = 0; rc = infoGetWorker(pDb, 0, &bUnlock); if( rc==LSM_OK ){ int bHex = (eParam==LSM_INFO_PAGE_HEX_DUMP); rc = lsmInfoPageDump(pDb, pgno, bHex, pzVal); } infoFreeWorker(pDb, bUnlock); break; } case LSM_INFO_LOG_STRUCTURE: { char **pzVal = va_arg(ap, char **); rc = lsmInfoLogStructure(pDb, pzVal); break; } case LSM_INFO_FREELIST: { char **pzVal = va_arg(ap, char **); rc = lsmInfoFreelist(pDb, pzVal); break; } case LSM_INFO_CHECKPOINT_SIZE: { int *pnKB = va_arg(ap, int *); rc = lsmCheckpointSize(pDb, pnKB); break; } case LSM_INFO_TREE_SIZE: { int *pnOld = va_arg(ap, int *); int *pnNew = va_arg(ap, int *); rc = infoTreeSize(pDb, pnOld, pnNew); break; } case LSM_INFO_COMPRESSION_ID: { unsigned int *piOut = va_arg(ap, unsigned int *); if( pDb->pClient ){ *piOut = pDb->pClient->iCmpId; }else{ rc = lsmInfoCompressionId(pDb, piOut); } break; } default: rc = LSM_MISUSE; break; } va_end(ap); return rc; } static int doWriteOp( lsm_db *pDb, int bDeleteRange, const void *pKey, int nKey, /* Key to write or delete */ const void *pVal, int nVal /* Value to write. Or nVal==-1 for a delete */ ){ int rc = LSM_OK; /* Return code */ int bCommit = 0; /* True to commit before returning */ if( pDb->nTransOpen==0 ){ bCommit = 1; rc = lsm_begin(pDb, 1); } if( rc==LSM_OK ){ int eType = (bDeleteRange ? LSM_DRANGE : (nVal>=0?LSM_WRITE:LSM_DELETE)); rc = lsmLogWrite(pDb, eType, (void *)pKey, nKey, (void *)pVal, nVal); } lsmSortedSaveTreeCursors(pDb); if( rc==LSM_OK ){ int pgsz = lsmFsPageSize(pDb->pFS); int nQuant = LSM_AUTOWORK_QUANT * pgsz; int nBefore; int nAfter; int nDiff; if( nQuant>pDb->nTreeLimit ){ nQuant = pDb->nTreeLimit; } nBefore = lsmTreeSize(pDb); if( bDeleteRange ){ rc = lsmTreeDelete(pDb, (void *)pKey, nKey, (void *)pVal, nVal); }else{ rc = lsmTreeInsert(pDb, (void *)pKey, nKey, (void *)pVal, nVal); } nAfter = lsmTreeSize(pDb); nDiff = (nAfter/nQuant) - (nBefore/nQuant); if( rc==LSM_OK && pDb->bAutowork && nDiff!=0 ){ rc = lsmSortedAutoWork(pDb, nDiff * LSM_AUTOWORK_QUANT); } } /* If a transaction was opened at the start of this function, commit it. ** Or, if an error has occurred, roll it back. */ if( bCommit ){ if( rc==LSM_OK ){ rc = lsm_commit(pDb, 0); }else{ lsm_rollback(pDb, 0); } } return rc; } /* ** Write a new value into the database. */ int lsm_insert( lsm_db *db, /* Database connection */ const void *pKey, int nKey, /* Key to write or delete */ const void *pVal, int nVal /* Value to write. Or nVal==-1 for a delete */ ){ return doWriteOp(db, 0, pKey, nKey, pVal, nVal); } /* ** Delete a value from the database. */ int lsm_delete(lsm_db *db, const void *pKey, int nKey){ return doWriteOp(db, 0, pKey, nKey, 0, -1); } /* ** Delete a range of database keys. */ int lsm_delete_range( lsm_db *db, /* Database handle */ const void *pKey1, int nKey1, /* Lower bound of range to delete */ const void *pKey2, int nKey2 /* Upper bound of range to delete */ ){ int rc = LSM_OK; if( db->xCmp((void *)pKey1, nKey1, (void *)pKey2, nKey2)<0 ){ rc = doWriteOp(db, 1, pKey1, nKey1, pKey2, nKey2); } return rc; } /* ** Open a new cursor handle. ** ** If there are currently no other open cursor handles, and no open write ** transaction, open a read transaction here. */ int lsm_csr_open(lsm_db *pDb, lsm_cursor **ppCsr){ int rc = LSM_OK; /* Return code */ MultiCursor *pCsr = 0; /* New cursor object */ /* Open a read transaction if one is not already open. */ assert_db_state(pDb); if( pDb->pShmhdr==0 ){ assert( pDb->bReadonly ); rc = lsmBeginRoTrans(pDb); }else if( pDb->iReader<0 ){ rc = lsmBeginReadTrans(pDb); } /* Allocate the multi-cursor. */ if( rc==LSM_OK ){ rc = lsmMCursorNew(pDb, &pCsr); } /* If an error has occured, set the output to NULL and delete any partially ** allocated cursor. If this means there are no open cursors, release the ** client snapshot. */ if( rc!=LSM_OK ){ lsmMCursorClose(pCsr, 0); dbReleaseClientSnapshot(pDb); } assert_db_state(pDb); *ppCsr = (lsm_cursor *)pCsr; return rc; } /* ** Close a cursor opened using lsm_csr_open(). */ int lsm_csr_close(lsm_cursor *p){ if( p ){ lsm_db *pDb = lsmMCursorDb((MultiCursor *)p); assert_db_state(pDb); lsmMCursorClose((MultiCursor *)p, 1); dbReleaseClientSnapshot(pDb); assert_db_state(pDb); } return LSM_OK; } /* ** Attempt to seek the cursor to the database entry specified by pKey/nKey. ** If an error occurs (e.g. an OOM or IO error), return an LSM error code. ** Otherwise, return LSM_OK. */ int lsm_csr_seek(lsm_cursor *pCsr, const void *pKey, int nKey, int eSeek){ return lsmMCursorSeek((MultiCursor *)pCsr, 0, (void *)pKey, nKey, eSeek); } int lsm_csr_next(lsm_cursor *pCsr){ return lsmMCursorNext((MultiCursor *)pCsr); } int lsm_csr_prev(lsm_cursor *pCsr){ return lsmMCursorPrev((MultiCursor *)pCsr); } int lsm_csr_first(lsm_cursor *pCsr){ return lsmMCursorFirst((MultiCursor *)pCsr); } int lsm_csr_last(lsm_cursor *pCsr){ return lsmMCursorLast((MultiCursor *)pCsr); } int lsm_csr_valid(lsm_cursor *pCsr){ return lsmMCursorValid((MultiCursor *)pCsr); } int lsm_csr_key(lsm_cursor *pCsr, const void **ppKey, int *pnKey){ return lsmMCursorKey((MultiCursor *)pCsr, (void **)ppKey, pnKey); } int lsm_csr_value(lsm_cursor *pCsr, const void **ppVal, int *pnVal){ return lsmMCursorValue((MultiCursor *)pCsr, (void **)ppVal, pnVal); } void lsm_config_log( lsm_db *pDb, void (*xLog)(void *, int, const char *), void *pCtx ){ pDb->xLog = xLog; pDb->pLogCtx = pCtx; } void lsm_config_work_hook( lsm_db *pDb, void (*xWork)(lsm_db *, void *), void *pCtx ){ pDb->xWork = xWork; pDb->pWorkCtx = pCtx; } void lsmLogMessage(lsm_db *pDb, int rc, const char *zFormat, ...){ if( pDb->xLog ){ LsmString s; va_list ap, ap2; lsmStringInit(&s, pDb->pEnv); va_start(ap, zFormat); va_start(ap2, zFormat); lsmStringVAppendf(&s, zFormat, ap, ap2); va_end(ap); va_end(ap2); pDb->xLog(pDb->pLogCtx, rc, s.z); lsmStringClear(&s); } } int lsm_begin(lsm_db *pDb, int iLevel){ int rc; assert_db_state( pDb ); rc = (pDb->bReadonly ? LSM_READONLY : LSM_OK); /* A value less than zero means open one more transaction. */ if( iLevel<0 ) iLevel = pDb->nTransOpen + 1; if( iLevel>pDb->nTransOpen ){ int i; /* Extend the pDb->aTrans[] array if required. */ if( rc==LSM_OK && pDb->nTransAllocpEnv, pDb->aTrans, nByte); if( !aNew ){ rc = LSM_NOMEM; }else{ nByte = sizeof(TransMark) * (iLevel+1 - pDb->nTransAlloc); memset(&aNew[pDb->nTransAlloc], 0, nByte); pDb->nTransAlloc = iLevel+1; pDb->aTrans = aNew; } } if( rc==LSM_OK && pDb->nTransOpen==0 ){ rc = lsmBeginWriteTrans(pDb); } if( rc==LSM_OK ){ for(i=pDb->nTransOpen; iaTrans[i].tree); lsmLogTell(pDb, &pDb->aTrans[i].log); } pDb->nTransOpen = iLevel; } } return rc; } int lsm_commit(lsm_db *pDb, int iLevel){ int rc = LSM_OK; assert_db_state( pDb ); /* A value less than zero means close the innermost nested transaction. */ if( iLevel<0 ) iLevel = LSM_MAX(0, pDb->nTransOpen - 1); if( iLevelnTransOpen ){ if( iLevel==0 ){ int rc2; /* Commit the transaction to disk. */ if( rc==LSM_OK ) rc = lsmLogCommit(pDb); if( rc==LSM_OK && pDb->eSafety==LSM_SAFETY_FULL ){ rc = lsmFsSyncLog(pDb->pFS); } rc2 = lsmFinishWriteTrans(pDb, (rc==LSM_OK)); if( rc==LSM_OK ) rc = rc2; } pDb->nTransOpen = iLevel; } dbReleaseClientSnapshot(pDb); return rc; } int lsm_rollback(lsm_db *pDb, int iLevel){ int rc = LSM_OK; assert_db_state( pDb ); if( pDb->nTransOpen ){ /* A value less than zero means close the innermost nested transaction. */ if( iLevel<0 ) iLevel = LSM_MAX(0, pDb->nTransOpen - 1); if( iLevel<=pDb->nTransOpen ){ TransMark *pMark = &pDb->aTrans[(iLevel==0 ? 0 : iLevel-1)]; lsmTreeRollback(pDb, &pMark->tree); if( iLevel ) lsmLogSeek(pDb, &pMark->log); pDb->nTransOpen = iLevel; } if( pDb->nTransOpen==0 ){ lsmFinishWriteTrans(pDb, 0); } dbReleaseClientSnapshot(pDb); } return rc; } int lsm_get_user_version(lsm_db *pDb, unsigned int *piUsr){ int rc = LSM_OK; /* Return code */ /* Open a read transaction if one is not already open. */ assert_db_state(pDb); if( pDb->pShmhdr==0 ){ assert( pDb->bReadonly ); rc = lsmBeginRoTrans(pDb); }else if( pDb->iReader<0 ){ rc = lsmBeginReadTrans(pDb); } /* Allocate the multi-cursor. */ if( rc==LSM_OK ){ *piUsr = pDb->treehdr.iUsrVersion; } dbReleaseClientSnapshot(pDb); assert_db_state(pDb); return rc; } int lsm_set_user_version(lsm_db *pDb, unsigned int iUsr){ int rc = LSM_OK; /* Return code */ int bCommit = 0; /* True to commit before returning */ if( pDb->nTransOpen==0 ){ bCommit = 1; rc = lsm_begin(pDb, 1); } if( rc==LSM_OK ){ pDb->treehdr.iUsrVersion = iUsr; } /* If a transaction was opened at the start of this function, commit it. ** Or, if an error has occurred, roll it back. */ if( bCommit ){ if( rc==LSM_OK ){ rc = lsm_commit(pDb, 0); }else{ lsm_rollback(pDb, 0); } } return rc; } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_mem.c ================================================ /* ** 2011-08-18 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** Helper routines for memory allocation. */ #include "lsmInt.h" /* ** The following routines are called internally by LSM sub-routines. In ** this case a valid environment pointer must be supplied. */ void *lsmMalloc(lsm_env *pEnv, size_t N){ assert( pEnv ); return pEnv->xMalloc(pEnv, N); } void lsmFree(lsm_env *pEnv, void *p){ assert( pEnv ); pEnv->xFree(pEnv, p); } void *lsmRealloc(lsm_env *pEnv, void *p, size_t N){ assert( pEnv ); return pEnv->xRealloc(pEnv, p, N); } /* ** Core memory allocation routines for LSM. */ void *lsm_malloc(lsm_env *pEnv, size_t N){ return lsmMalloc(pEnv ? pEnv : lsm_default_env(), N); } void lsm_free(lsm_env *pEnv, void *p){ lsmFree(pEnv ? pEnv : lsm_default_env(), p); } void *lsm_realloc(lsm_env *pEnv, void *p, size_t N){ return lsmRealloc(pEnv ? pEnv : lsm_default_env(), p, N); } void *lsmMallocZero(lsm_env *pEnv, size_t N){ void *pRet; assert( pEnv ); pRet = lsmMalloc(pEnv, N); if( pRet ) memset(pRet, 0, N); return pRet; } void *lsmMallocRc(lsm_env *pEnv, size_t N, int *pRc){ void *pRet = 0; if( *pRc==LSM_OK ){ pRet = lsmMalloc(pEnv, N); if( pRet==0 ){ *pRc = LSM_NOMEM_BKPT; } } return pRet; } void *lsmMallocZeroRc(lsm_env *pEnv, size_t N, int *pRc){ void *pRet = 0; if( *pRc==LSM_OK ){ pRet = lsmMallocZero(pEnv, N); if( pRet==0 ){ *pRc = LSM_NOMEM_BKPT; } } return pRet; } void *lsmReallocOrFree(lsm_env *pEnv, void *p, size_t N){ void *pNew; pNew = lsm_realloc(pEnv, p, N); if( !pNew ) lsm_free(pEnv, p); return pNew; } void *lsmReallocOrFreeRc(lsm_env *pEnv, void *p, size_t N, int *pRc){ void *pRet = 0; if( *pRc ){ lsmFree(pEnv, p); }else{ pRet = lsmReallocOrFree(pEnv, p, N); if( !pRet ) *pRc = LSM_NOMEM_BKPT; } return pRet; } char *lsmMallocStrdup(lsm_env *pEnv, const char *zIn){ int nByte; char *zRet; nByte = strlen(zIn); zRet = lsmMalloc(pEnv, nByte+1); if( zRet ){ memcpy(zRet, zIn, nByte+1); } return zRet; } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_mutex.c ================================================ /* ** 2012-01-30 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** Mutex functions for LSM. */ #include "lsmInt.h" /* ** Allocate a new mutex. */ int lsmMutexNew(lsm_env *pEnv, lsm_mutex **ppNew){ return pEnv->xMutexNew(pEnv, ppNew); } /* ** Return a handle for one of the static mutexes. */ int lsmMutexStatic(lsm_env *pEnv, int iMutex, lsm_mutex **ppStatic){ return pEnv->xMutexStatic(pEnv, iMutex, ppStatic); } /* ** Free a mutex allocated by lsmMutexNew(). */ void lsmMutexDel(lsm_env *pEnv, lsm_mutex *pMutex){ if( pMutex ) pEnv->xMutexDel(pMutex); } /* ** Enter a mutex. */ void lsmMutexEnter(lsm_env *pEnv, lsm_mutex *pMutex){ pEnv->xMutexEnter(pMutex); } /* ** Attempt to enter a mutex, but do not block. If successful, return zero. ** Otherwise, if the mutex is already held by some other thread and is not ** entered, return non zero. ** ** Each successful call to this function must be matched by a call to ** lsmMutexLeave(). */ int lsmMutexTry(lsm_env *pEnv, lsm_mutex *pMutex){ return pEnv->xMutexTry(pMutex); } /* ** Leave a mutex. */ void lsmMutexLeave(lsm_env *pEnv, lsm_mutex *pMutex){ pEnv->xMutexLeave(pMutex); } #ifndef NDEBUG /* ** Return non-zero if the mutex passed as the second argument is held ** by the calling thread, or zero otherwise. If the implementation is not ** able to tell if the mutex is held by the caller, it should return ** non-zero. ** ** This function is only used as part of assert() statements. */ int lsmMutexHeld(lsm_env *pEnv, lsm_mutex *pMutex){ return pEnv->xMutexHeld ? pEnv->xMutexHeld(pMutex) : 1; } /* ** Return non-zero if the mutex passed as the second argument is not ** held by the calling thread, or zero otherwise. If the implementation ** is not able to tell if the mutex is held by the caller, it should ** return non-zero. ** ** This function is only used as part of assert() statements. */ int lsmMutexNotHeld(lsm_env *pEnv, lsm_mutex *pMutex){ return pEnv->xMutexNotHeld ? pEnv->xMutexNotHeld(pMutex) : 1; } #endif ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_shared.c ================================================ /* ** 2012-01-23 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** Utilities used to help multiple LSM clients to coexist within the ** same process space. */ #include "lsmInt.h" /* ** Global data. All global variables used by code in this file are grouped ** into the following structure instance. ** ** pDatabase: ** Linked list of all Database objects allocated within this process. ** This list may not be traversed without holding the global mutex (see ** functions enterGlobalMutex() and leaveGlobalMutex()). */ static struct SharedData { Database *pDatabase; /* Linked list of all Database objects */ } gShared; /* ** Database structure. There is one such structure for each distinct ** database accessed by this process. They are stored in the singly linked ** list starting at global variable gShared.pDatabase. Database objects are ** reference counted. Once the number of connections to the associated ** database drops to zero, they are removed from the linked list and deleted. ** ** pFile: ** In multi-process mode, this file descriptor is used to obtain locks ** and to access shared-memory. In single process mode, its only job is ** to hold the exclusive lock on the file. ** */ struct Database { /* Protected by the global mutex (enterGlobalMutex/leaveGlobalMutex): */ char *zName; /* Canonical path to database file */ int nName; /* strlen(zName) */ int nDbRef; /* Number of associated lsm_db handles */ Database *pDbNext; /* Next Database structure in global list */ /* Protected by the local mutex (pClientMutex) */ int bReadonly; /* True if Database.pFile is read-only */ int bMultiProc; /* True if running in multi-process mode */ lsm_file *pFile; /* Used for locks/shm in multi-proc mode */ LsmFile *pLsmFile; /* List of deferred closes */ lsm_mutex *pClientMutex; /* Protects the apShmChunk[] and pConn */ int nShmChunk; /* Number of entries in apShmChunk[] array */ void **apShmChunk; /* Array of "shared" memory regions */ lsm_db *pConn; /* List of connections to this db. */ }; /* ** Functions to enter and leave the global mutex. This mutex is used ** to protect the global linked-list headed at gShared.pDatabase. */ static int enterGlobalMutex(lsm_env *pEnv){ lsm_mutex *p; int rc = lsmMutexStatic(pEnv, LSM_MUTEX_GLOBAL, &p); if( rc==LSM_OK ) lsmMutexEnter(pEnv, p); return rc; } static void leaveGlobalMutex(lsm_env *pEnv){ lsm_mutex *p; lsmMutexStatic(pEnv, LSM_MUTEX_GLOBAL, &p); lsmMutexLeave(pEnv, p); } #ifdef LSM_DEBUG static int holdingGlobalMutex(lsm_env *pEnv){ lsm_mutex *p; lsmMutexStatic(pEnv, LSM_MUTEX_GLOBAL, &p); return lsmMutexHeld(pEnv, p); } #endif #if 0 static void assertNotInFreelist(Freelist *p, int iBlk){ int i; for(i=0; inEntry; i++){ assert( p->aEntry[i].iBlk!=iBlk ); } } #else # define assertNotInFreelist(x,y) #endif /* ** Append an entry to the free-list. If (iId==-1), this is a delete. */ int freelistAppend(lsm_db *db, u32 iBlk, i64 iId){ lsm_env *pEnv = db->pEnv; Freelist *p; int i; assert( iId==-1 || iId>=0 ); p = db->bUseFreelist ? db->pFreelist : &db->pWorker->freelist; /* Extend the space allocated for the freelist, if required */ assert( p->nAlloc>=p->nEntry ); if( p->nAlloc==p->nEntry ){ int nNew; int nByte; FreelistEntry *aNew; nNew = (p->nAlloc==0 ? 4 : p->nAlloc*2); nByte = sizeof(FreelistEntry) * nNew; aNew = (FreelistEntry *)lsmRealloc(pEnv, p->aEntry, nByte); if( !aNew ) return LSM_NOMEM_BKPT; p->nAlloc = nNew; p->aEntry = aNew; } for(i=0; inEntry; i++){ assert( i==0 || p->aEntry[i].iBlk > p->aEntry[i-1].iBlk ); if( p->aEntry[i].iBlk>=iBlk ) break; } if( inEntry && p->aEntry[i].iBlk==iBlk ){ /* Clobber an existing entry */ p->aEntry[i].iId = iId; }else{ /* Insert a new entry into the list */ int nByte = sizeof(FreelistEntry)*(p->nEntry-i); memmove(&p->aEntry[i+1], &p->aEntry[i], nByte); p->aEntry[i].iBlk = iBlk; p->aEntry[i].iId = iId; p->nEntry++; } return LSM_OK; } /* ** This function frees all resources held by the Database structure passed ** as the only argument. */ static void freeDatabase(lsm_env *pEnv, Database *p){ assert( holdingGlobalMutex(pEnv) ); if( p ){ /* Free the mutexes */ lsmMutexDel(pEnv, p->pClientMutex); if( p->pFile ){ lsmEnvClose(pEnv, p->pFile); } /* Free the array of shm pointers */ lsmFree(pEnv, p->apShmChunk); /* Free the memory allocated for the Database struct itself */ lsmFree(pEnv, p); } } typedef struct DbTruncateCtx DbTruncateCtx; struct DbTruncateCtx { int nBlock; i64 iInUse; }; static int dbTruncateCb(void *pCtx, int iBlk, i64 iSnapshot){ DbTruncateCtx *p = (DbTruncateCtx *)pCtx; if( iBlk!=p->nBlock || (p->iInUse>=0 && iSnapshot>=p->iInUse) ) return 1; p->nBlock--; return 0; } static int dbTruncate(lsm_db *pDb, i64 iInUse){ int rc = LSM_OK; #if 0 int i; DbTruncateCtx ctx; assert( pDb->pWorker ); ctx.nBlock = pDb->pWorker->nBlock; ctx.iInUse = iInUse; rc = lsmWalkFreelist(pDb, 1, dbTruncateCb, (void *)&ctx); for(i=ctx.nBlock+1; rc==LSM_OK && i<=pDb->pWorker->nBlock; i++){ rc = freelistAppend(pDb, i, -1); } if( rc==LSM_OK ){ #ifdef LSM_LOG_FREELIST if( ctx.nBlock!=pDb->pWorker->nBlock ){ lsmLogMessage(pDb, 0, "dbTruncate(): truncated db to %d blocks",ctx.nBlock ); } #endif pDb->pWorker->nBlock = ctx.nBlock; } #endif return rc; } /* ** This function is called during database shutdown (when the number of ** connections drops from one to zero). It truncates the database file ** to as small a size as possible without truncating away any blocks that ** contain data. */ static int dbTruncateFile(lsm_db *pDb){ int rc; assert( pDb->pWorker==0 ); assert( lsmShmAssertLock(pDb, LSM_LOCK_DMS1, LSM_LOCK_EXCL) ); rc = lsmCheckpointLoadWorker(pDb); if( rc==LSM_OK ){ DbTruncateCtx ctx; /* Walk the database free-block-list in reverse order. Set ctx.nBlock ** to the block number of the last block in the database that actually ** contains data. */ ctx.nBlock = pDb->pWorker->nBlock; ctx.iInUse = -1; rc = lsmWalkFreelist(pDb, 1, dbTruncateCb, (void *)&ctx); /* If the last block that contains data is not already the last block in ** the database file, truncate the database file so that it is. */ if( rc==LSM_OK ){ rc = lsmFsTruncateDb( pDb->pFS, (i64)ctx.nBlock*lsmFsBlockSize(pDb->pFS) ); } } lsmFreeSnapshot(pDb->pEnv, pDb->pWorker); pDb->pWorker = 0; return rc; } static void doDbDisconnect(lsm_db *pDb){ int rc; if( pDb->bReadonly ){ lsmShmLock(pDb, LSM_LOCK_DMS3, LSM_LOCK_UNLOCK, 0); }else{ /* Block for an exclusive lock on DMS1. This lock serializes all calls ** to doDbConnect() and doDbDisconnect() across all processes. */ rc = lsmShmLock(pDb, LSM_LOCK_DMS1, LSM_LOCK_EXCL, 1); if( rc==LSM_OK ){ lsmShmLock(pDb, LSM_LOCK_DMS2, LSM_LOCK_UNLOCK, 0); /* Try an exclusive lock on DMS2. If successful, this is the last ** connection to the database. In this case flush the contents of the ** in-memory tree to disk and write a checkpoint. */ rc = lsmShmTestLock(pDb, LSM_LOCK_DMS2, 1, LSM_LOCK_EXCL); if( rc==LSM_OK ){ rc = lsmShmTestLock(pDb, LSM_LOCK_CHECKPOINTER, 1, LSM_LOCK_EXCL); } if( rc==LSM_OK ){ int bReadonly = 0; /* True if there exist read-only conns. */ /* Flush the in-memory tree, if required. If there is data to flush, ** this will create a new client snapshot in Database.pClient. The ** checkpoint (serialization) of this snapshot may be written to disk ** by the following block. ** ** There is no need to take a WRITER lock here. That there are no ** other locks on DMS2 guarantees that there are no other read-write ** connections at this time (and the lock on DMS1 guarantees that ** no new ones may appear). */ rc = lsmTreeLoadHeader(pDb, 0); if( rc==LSM_OK && (lsmTreeHasOld(pDb) || lsmTreeSize(pDb)>0) ){ rc = lsmFlushTreeToDisk(pDb); } /* Now check if there are any read-only connections. If there are, ** then do not truncate the db file or unlink the shared-memory ** region. */ if( rc==LSM_OK ){ rc = lsmShmTestLock(pDb, LSM_LOCK_DMS3, 1, LSM_LOCK_EXCL); if( rc==LSM_BUSY ){ bReadonly = 1; rc = LSM_OK; } } /* Write a checkpoint to disk. */ if( rc==LSM_OK ){ rc = lsmCheckpointWrite(pDb, 0); } /* If the checkpoint was written successfully, delete the log file ** and, if possible, truncate the database file. */ if( rc==LSM_OK ){ int bRotrans = 0; Database *p = pDb->pDatabase; /* The log file may only be deleted if there are no clients ** read-only clients running rotrans transactions. */ rc = lsmDetectRoTrans(pDb, &bRotrans); if( rc==LSM_OK && bRotrans==0 ){ lsmFsCloseAndDeleteLog(pDb->pFS); } /* The database may only be truncated if there exist no read-only ** clients - either connected or running rotrans transactions. */ if( bReadonly==0 && bRotrans==0 ){ lsmFsUnmap(pDb->pFS); dbTruncateFile(pDb); if( p->pFile && p->bMultiProc ){ lsmEnvShmUnmap(pDb->pEnv, p->pFile, 1); } } } } } if( pDb->iRwclient>=0 ){ lsmShmLock(pDb, LSM_LOCK_RWCLIENT(pDb->iRwclient), LSM_LOCK_UNLOCK, 0); pDb->iRwclient = -1; } lsmShmLock(pDb, LSM_LOCK_DMS1, LSM_LOCK_UNLOCK, 0); } pDb->pShmhdr = 0; } static int doDbConnect(lsm_db *pDb){ const int nUsMax = 100000; /* Max value for nUs */ int nUs = 1000; /* us to wait between DMS1 attempts */ int rc; /* Obtain a pointer to the shared-memory header */ assert( pDb->pShmhdr==0 ); assert( pDb->bReadonly==0 ); /* Block for an exclusive lock on DMS1. This lock serializes all calls ** to doDbConnect() and doDbDisconnect() across all processes. */ while( 1 ){ rc = lsmShmLock(pDb, LSM_LOCK_DMS1, LSM_LOCK_EXCL, 1); if( rc!=LSM_BUSY ) break; lsmEnvSleep(pDb->pEnv, nUs); nUs = nUs * 2; if( nUs>nUsMax ) nUs = nUsMax; } if( rc==LSM_OK ){ rc = lsmShmCacheChunks(pDb, 1); } if( rc!=LSM_OK ) return rc; pDb->pShmhdr = (ShmHeader *)pDb->apShm[0]; /* Try an exclusive lock on DMS2/DMS3. If successful, this is the first ** and only connection to the database. In this case initialize the ** shared-memory and run log file recovery. */ assert( LSM_LOCK_DMS3==1+LSM_LOCK_DMS2 ); rc = lsmShmTestLock(pDb, LSM_LOCK_DMS2, 2, LSM_LOCK_EXCL); if( rc==LSM_OK ){ memset(pDb->pShmhdr, 0, sizeof(ShmHeader)); rc = lsmCheckpointRecover(pDb); if( rc==LSM_OK ){ rc = lsmLogRecover(pDb); } if( rc==LSM_OK ){ ShmHeader *pShm = pDb->pShmhdr; pShm->aReader[0].iLsmId = lsmCheckpointId(pShm->aSnap1, 0); pShm->aReader[0].iTreeId = pDb->treehdr.iUsedShmid; } }else if( rc==LSM_BUSY ){ rc = LSM_OK; } /* Take a shared lock on DMS2. In multi-process mode this lock "cannot" ** fail, as connections may only hold an exclusive lock on DMS2 if they ** first hold an exclusive lock on DMS1. And this connection is currently ** holding the exclusive lock on DSM1. ** ** However, if some other connection has the database open in single-process ** mode, this operation will fail. In this case, return the error to the ** caller - the attempt to connect to the db has failed. */ if( rc==LSM_OK ){ rc = lsmShmLock(pDb, LSM_LOCK_DMS2, LSM_LOCK_SHARED, 0); } /* If anything went wrong, unlock DMS2. Otherwise, try to take an exclusive ** lock on one of the LSM_LOCK_RWCLIENT() locks. Unlock DMS1 in any case. */ if( rc!=LSM_OK ){ pDb->pShmhdr = 0; }else{ int i; for(i=0; iiRwclient = i; if( rc2!=LSM_BUSY ){ rc = rc2; break; } } } lsmShmLock(pDb, LSM_LOCK_DMS1, LSM_LOCK_UNLOCK, 0); return rc; } static int dbOpenSharedFd(lsm_env *pEnv, Database *p, int bRoOk){ int rc; rc = lsmEnvOpen(pEnv, p->zName, 0, &p->pFile); if( rc==LSM_IOERR && bRoOk ){ rc = lsmEnvOpen(pEnv, p->zName, LSM_OPEN_READONLY, &p->pFile); p->bReadonly = 1; } return rc; } /* ** Return a reference to the shared Database handle for the database ** identified by canonical path zName. If this is the first connection to ** the named database, a new Database object is allocated. Otherwise, a ** pointer to an existing object is returned. ** ** If successful, *ppDatabase is set to point to the shared Database ** structure and LSM_OK returned. Otherwise, *ppDatabase is set to NULL ** and and LSM error code returned. ** ** Each successful call to this function should be (eventually) matched ** by a call to lsmDbDatabaseRelease(). */ int lsmDbDatabaseConnect( lsm_db *pDb, /* Database handle */ const char *zName /* Full-path to db file */ ){ lsm_env *pEnv = pDb->pEnv; int rc; /* Return code */ Database *p = 0; /* Pointer returned via *ppDatabase */ int nName = lsmStrlen(zName); assert( pDb->pDatabase==0 ); rc = enterGlobalMutex(pEnv); if( rc==LSM_OK ){ /* Search the global list for an existing object. TODO: Need something ** better than the memcmp() below to figure out if a given Database ** object represents the requested file. */ for(p=gShared.pDatabase; p; p=p->pDbNext){ if( nName==p->nName && 0==memcmp(zName, p->zName, nName) ) break; } /* If no suitable Database object was found, allocate a new one. */ if( p==0 ){ p = (Database *)lsmMallocZeroRc(pEnv, sizeof(Database)+nName+1, &rc); /* If the allocation was successful, fill in other fields and ** allocate the client mutex. */ if( rc==LSM_OK ){ p->bMultiProc = pDb->bMultiProc; p->zName = (char *)&p[1]; p->nName = nName; memcpy((void *)p->zName, zName, nName+1); rc = lsmMutexNew(pEnv, &p->pClientMutex); } /* If nothing has gone wrong so far, open the shared fd. And if that ** succeeds and this connection requested single-process mode, ** attempt to take the exclusive lock on DMS2. */ if( rc==LSM_OK ){ int bReadonly = (pDb->bReadonly && pDb->bMultiProc); rc = dbOpenSharedFd(pDb->pEnv, p, bReadonly); } if( rc==LSM_OK && p->bMultiProc==0 ){ /* Hold an exclusive lock DMS1 while grabbing DMS2. This ensures ** that any ongoing call to doDbDisconnect() (even one in another ** process) is finished before proceeding. */ assert( p->bReadonly==0 ); rc = lsmEnvLock(pDb->pEnv, p->pFile, LSM_LOCK_DMS1, LSM_LOCK_EXCL); if( rc==LSM_OK ){ rc = lsmEnvLock(pDb->pEnv, p->pFile, LSM_LOCK_DMS2, LSM_LOCK_EXCL); lsmEnvLock(pDb->pEnv, p->pFile, LSM_LOCK_DMS1, LSM_LOCK_UNLOCK); } } if( rc==LSM_OK ){ p->pDbNext = gShared.pDatabase; gShared.pDatabase = p; }else{ freeDatabase(pEnv, p); p = 0; } } if( p ){ p->nDbRef++; } leaveGlobalMutex(pEnv); if( p ){ lsmMutexEnter(pDb->pEnv, p->pClientMutex); pDb->pNext = p->pConn; p->pConn = pDb; lsmMutexLeave(pDb->pEnv, p->pClientMutex); } } pDb->pDatabase = p; if( rc==LSM_OK ){ assert( p ); rc = lsmFsOpen(pDb, zName, p->bReadonly); } /* If the db handle is read-write, then connect to the system now. Run ** recovery as necessary. Or, if this is a read-only database handle, ** defer attempting to connect to the system until a read-transaction ** is opened. */ if( pDb->bReadonly==0 ){ if( rc==LSM_OK ){ rc = lsmFsConfigure(pDb); } if( rc==LSM_OK ){ rc = doDbConnect(pDb); } } return rc; } static void dbDeferClose(lsm_db *pDb){ if( pDb->pFS ){ LsmFile *pLsmFile; Database *p = pDb->pDatabase; pLsmFile = lsmFsDeferClose(pDb->pFS); pLsmFile->pNext = p->pLsmFile; p->pLsmFile = pLsmFile; } } LsmFile *lsmDbRecycleFd(lsm_db *db){ LsmFile *pRet; Database *p = db->pDatabase; lsmMutexEnter(db->pEnv, p->pClientMutex); if( (pRet = p->pLsmFile)!=0 ){ p->pLsmFile = pRet->pNext; } lsmMutexLeave(db->pEnv, p->pClientMutex); return pRet; } /* ** Release a reference to a Database object obtained from ** lsmDbDatabaseConnect(). There should be exactly one call to this function ** for each successful call to Find(). */ void lsmDbDatabaseRelease(lsm_db *pDb){ Database *p = pDb->pDatabase; if( p ){ lsm_db **ppDb; if( pDb->pShmhdr ){ doDbDisconnect(pDb); } lsmFsUnmap(pDb->pFS); lsmMutexEnter(pDb->pEnv, p->pClientMutex); for(ppDb=&p->pConn; *ppDb!=pDb; ppDb=&((*ppDb)->pNext)); *ppDb = pDb->pNext; dbDeferClose(pDb); lsmMutexLeave(pDb->pEnv, p->pClientMutex); enterGlobalMutex(pDb->pEnv); p->nDbRef--; if( p->nDbRef==0 ){ LsmFile *pIter; LsmFile *pNext; Database **pp; /* Remove the Database structure from the linked list. */ for(pp=&gShared.pDatabase; *pp!=p; pp=&((*pp)->pDbNext)); *pp = p->pDbNext; /* If they were allocated from the heap, free the shared memory chunks */ if( p->bMultiProc==0 ){ int i; for(i=0; inShmChunk; i++){ lsmFree(pDb->pEnv, p->apShmChunk[i]); } } /* Close any outstanding file descriptors */ for(pIter=p->pLsmFile; pIter; pIter=pNext){ pNext = pIter->pNext; lsmEnvClose(pDb->pEnv, pIter->pFile); lsmFree(pDb->pEnv, pIter); } freeDatabase(pDb->pEnv, p); } leaveGlobalMutex(pDb->pEnv); } } Level *lsmDbSnapshotLevel(Snapshot *pSnapshot){ return pSnapshot->pLevel; } void lsmDbSnapshotSetLevel(Snapshot *pSnap, Level *pLevel){ pSnap->pLevel = pLevel; } /* TODO: Shuffle things around to get rid of this */ static int firstSnapshotInUse(lsm_db *, i64 *); /* ** Context object used by the lsmWalkFreelist() utility. */ typedef struct WalkFreelistCtx WalkFreelistCtx; struct WalkFreelistCtx { lsm_db *pDb; int bReverse; Freelist *pFreelist; int iFree; int (*xUsr)(void *, int, i64); /* User callback function */ void *pUsrctx; /* User callback context */ int bDone; /* Set to true after xUsr() returns true */ }; /* ** Callback used by lsmWalkFreelist(). */ static int walkFreelistCb(void *pCtx, int iBlk, i64 iSnapshot){ WalkFreelistCtx *p = (WalkFreelistCtx *)pCtx; const int iDir = (p->bReverse ? -1 : 1); Freelist *pFree = p->pFreelist; assert( p->bDone==0 ); assert( iBlk>=0 ); if( pFree ){ while( (p->iFree < pFree->nEntry) && p->iFree>=0 ){ FreelistEntry *pEntry = &pFree->aEntry[p->iFree]; if( (p->bReverse==0 && pEntry->iBlk>(u32)iBlk) || (p->bReverse!=0 && pEntry->iBlk<(u32)iBlk) ){ break; }else{ p->iFree += iDir; if( pEntry->iId>=0 && p->xUsr(p->pUsrctx, pEntry->iBlk, pEntry->iId) ){ p->bDone = 1; return 1; } if( pEntry->iBlk==(u32)iBlk ) return 0; } } } if( p->xUsr(p->pUsrctx, iBlk, iSnapshot) ){ p->bDone = 1; return 1; } return 0; } /* ** The database handle passed as the first argument must be the worker ** connection. This function iterates through the contents of the current ** free block list, invoking the supplied callback once for each list ** element. ** ** The difference between this function and lsmSortedWalkFreelist() is ** that lsmSortedWalkFreelist() only considers those free-list elements ** stored within the LSM. This function also merges in any in-memory ** elements. */ int lsmWalkFreelist( lsm_db *pDb, /* Database handle (must be worker) */ int bReverse, /* True to iterate from largest to smallest */ int (*x)(void *, int, i64), /* Callback function */ void *pCtx /* First argument to pass to callback */ ){ const int iDir = (bReverse ? -1 : 1); int rc; int iCtx; WalkFreelistCtx ctx[2]; ctx[0].pDb = pDb; ctx[0].bReverse = bReverse; ctx[0].pFreelist = &pDb->pWorker->freelist; if( ctx[0].pFreelist && bReverse ){ ctx[0].iFree = ctx[0].pFreelist->nEntry-1; }else{ ctx[0].iFree = 0; } ctx[0].xUsr = walkFreelistCb; ctx[0].pUsrctx = (void *)&ctx[1]; ctx[0].bDone = 0; ctx[1].pDb = pDb; ctx[1].bReverse = bReverse; ctx[1].pFreelist = pDb->pFreelist; if( ctx[1].pFreelist && bReverse ){ ctx[1].iFree = ctx[1].pFreelist->nEntry-1; }else{ ctx[1].iFree = 0; } ctx[1].xUsr = x; ctx[1].pUsrctx = pCtx; ctx[1].bDone = 0; rc = lsmSortedWalkFreelist(pDb, bReverse, walkFreelistCb, (void *)&ctx[0]); if( ctx[0].bDone==0 ){ for(iCtx=0; iCtx<2; iCtx++){ int i; WalkFreelistCtx *p = &ctx[iCtx]; for(i=p->iFree; p->pFreelist && rc==LSM_OK && ipFreelist->nEntry && i>=0; i += iDir ){ FreelistEntry *pEntry = &p->pFreelist->aEntry[i]; if( pEntry->iId>=0 && p->xUsr(p->pUsrctx, pEntry->iBlk, pEntry->iId) ){ return LSM_OK; } } } } return rc; } typedef struct FindFreeblockCtx FindFreeblockCtx; struct FindFreeblockCtx { i64 iInUse; int iRet; int bNotOne; }; static int findFreeblockCb(void *pCtx, int iBlk, i64 iSnapshot){ FindFreeblockCtx *p = (FindFreeblockCtx *)pCtx; if( iSnapshotiInUse && (iBlk!=1 || p->bNotOne==0) ){ p->iRet = iBlk; return 1; } return 0; } static int findFreeblock(lsm_db *pDb, i64 iInUse, int bNotOne, int *piRet){ int rc; /* Return code */ FindFreeblockCtx ctx; /* Context object */ ctx.iInUse = iInUse; ctx.iRet = 0; ctx.bNotOne = bNotOne; rc = lsmWalkFreelist(pDb, 0, findFreeblockCb, (void *)&ctx); *piRet = ctx.iRet; return rc; } /* ** Allocate a new database file block to write data to, either by extending ** the database file or by recycling a free-list entry. The worker snapshot ** must be held in order to call this function. ** ** If successful, *piBlk is set to the block number allocated and LSM_OK is ** returned. Otherwise, *piBlk is zeroed and an lsm error code returned. */ int lsmBlockAllocate(lsm_db *pDb, int iBefore, int *piBlk){ Snapshot *p = pDb->pWorker; int iRet = 0; /* Block number of allocated block */ int rc = LSM_OK; i64 iInUse = 0; /* Snapshot id still in use */ i64 iSynced = 0; /* Snapshot id synced to disk */ assert( p ); #ifdef LSM_LOG_FREELIST { static int nCall = 0; char *zFree = 0; nCall++; rc = lsmInfoFreelist(pDb, &zFree); if( rc!=LSM_OK ) return rc; lsmLogMessage(pDb, 0, "lsmBlockAllocate(): %d freelist: %s", nCall, zFree); lsmFree(pDb->pEnv, zFree); } #endif /* Set iInUse to the smallest snapshot id that is either: ** ** * Currently in use by a database client, ** * May be used by a database client in the future, or ** * Is the most recently checkpointed snapshot (i.e. the one that will ** be used following recovery if a failure occurs at this point). */ rc = lsmCheckpointSynced(pDb, &iSynced, 0, 0); if( rc==LSM_OK && iSynced==0 ) iSynced = p->iId; iInUse = iSynced; if( rc==LSM_OK && pDb->iReader>=0 ){ assert( pDb->pClient ); iInUse = LSM_MIN(iInUse, pDb->pClient->iId); } if( rc==LSM_OK ) rc = firstSnapshotInUse(pDb, &iInUse); #ifdef LSM_LOG_FREELIST { lsmLogMessage(pDb, 0, "lsmBlockAllocate(): " "snapshot-in-use: %lld (iSynced=%lld) (client-id=%lld)", iInUse, iSynced, (pDb->iReader>=0 ? pDb->pClient->iId : 0) ); } #endif /* Unless there exists a read-only transaction (which prevents us from ** recycling any blocks regardless, query the free block list for a ** suitable block to reuse. ** ** It might seem more natural to check for a read-only transaction at ** the start of this function. However, it is better do wait until after ** the call to lsmCheckpointSynced() to do so. */ if( rc==LSM_OK ){ int bRotrans; rc = lsmDetectRoTrans(pDb, &bRotrans); if( rc==LSM_OK && bRotrans==0 ){ rc = findFreeblock(pDb, iInUse, (iBefore>0), &iRet); } } if( iBefore>0 && (iRet<=0 || iRet>=iBefore) ){ iRet = 0; }else if( rc==LSM_OK ){ /* If a block was found in the free block list, use it and remove it from ** the list. Otherwise, if no suitable block was found, allocate one from ** the end of the file. */ if( iRet>0 ){ #ifdef LSM_LOG_FREELIST lsmLogMessage(pDb, 0, "reusing block %d (snapshot-in-use=%lld)", iRet, iInUse); #endif rc = freelistAppend(pDb, iRet, -1); if( rc==LSM_OK ){ rc = dbTruncate(pDb, iInUse); } }else{ iRet = ++(p->nBlock); #ifdef LSM_LOG_FREELIST lsmLogMessage(pDb, 0, "extending file to %d blocks", iRet); #endif } } assert( iBefore>0 || iRet>0 || rc!=LSM_OK ); *piBlk = iRet; return rc; } /* ** Free a database block. The worker snapshot must be held in order to call ** this function. ** ** If successful, LSM_OK is returned. Otherwise, an lsm error code (e.g. ** LSM_NOMEM). */ int lsmBlockFree(lsm_db *pDb, int iBlk){ Snapshot *p = pDb->pWorker; assert( lsmShmAssertWorker(pDb) ); #ifdef LSM_LOG_FREELIST lsmLogMessage(pDb, LSM_OK, "lsmBlockFree(): Free block %d", iBlk); #endif return freelistAppend(pDb, iBlk, p->iId); } /* ** Refree a database block. The worker snapshot must be held in order to call ** this function. ** ** Refreeing is required when a block is allocated using lsmBlockAllocate() ** but then not used. This function is used to push the block back onto ** the freelist. Refreeing a block is different from freeing is, as a refreed ** block may be reused immediately. Whereas a freed block can not be reused ** until (at least) after the next checkpoint. */ int lsmBlockRefree(lsm_db *pDb, int iBlk){ int rc = LSM_OK; /* Return code */ #ifdef LSM_LOG_FREELIST lsmLogMessage(pDb, LSM_OK, "lsmBlockRefree(): Refree block %d", iBlk); #endif rc = freelistAppend(pDb, iBlk, 0); return rc; } /* ** If required, copy a database checkpoint from shared memory into the ** database itself. ** ** The WORKER lock must not be held when this is called. This is because ** this function may indirectly call fsync(). And the WORKER lock should ** not be held that long (in case it is required by a client flushing an ** in-memory tree to disk). */ int lsmCheckpointWrite(lsm_db *pDb, u32 *pnWrite){ int rc; /* Return Code */ u32 nWrite = 0; assert( pDb->pWorker==0 ); assert( 1 || pDb->pClient==0 ); assert( lsmShmAssertLock(pDb, LSM_LOCK_WORKER, LSM_LOCK_UNLOCK) ); rc = lsmShmLock(pDb, LSM_LOCK_CHECKPOINTER, LSM_LOCK_EXCL, 0); if( rc!=LSM_OK ) return rc; rc = lsmCheckpointLoad(pDb, 0); if( rc==LSM_OK ){ int nBlock = lsmCheckpointNBlock(pDb->aSnapshot); ShmHeader *pShm = pDb->pShmhdr; int bDone = 0; /* True if checkpoint is already stored */ /* Check if this checkpoint has already been written to the database ** file. If so, set variable bDone to true. */ if( pShm->iMetaPage ){ MetaPage *pPg; /* Meta page */ u8 *aData; /* Meta-page data buffer */ int nData; /* Size of aData[] in bytes */ i64 iCkpt; /* Id of checkpoint just loaded */ i64 iDisk = 0; /* Id of checkpoint already stored in db */ iCkpt = lsmCheckpointId(pDb->aSnapshot, 0); rc = lsmFsMetaPageGet(pDb->pFS, 0, pShm->iMetaPage, &pPg); if( rc==LSM_OK ){ aData = lsmFsMetaPageData(pPg, &nData); iDisk = lsmCheckpointId((u32 *)aData, 1); nWrite = lsmCheckpointNWrite((u32 *)aData, 1); lsmFsMetaPageRelease(pPg); } bDone = (iDisk>=iCkpt); } if( rc==LSM_OK && bDone==0 ){ int iMeta = (pShm->iMetaPage % 2) + 1; if( pDb->eSafety!=LSM_SAFETY_OFF ){ rc = lsmFsSyncDb(pDb->pFS, nBlock); } if( rc==LSM_OK ) rc = lsmCheckpointStore(pDb, iMeta); if( rc==LSM_OK && pDb->eSafety!=LSM_SAFETY_OFF){ rc = lsmFsSyncDb(pDb->pFS, 0); } if( rc==LSM_OK ){ pShm->iMetaPage = iMeta; nWrite = lsmCheckpointNWrite(pDb->aSnapshot, 0) - nWrite; } #ifdef LSM_LOG_WORK lsmLogMessage(pDb, 0, "finish checkpoint %d", (int)lsmCheckpointId(pDb->aSnapshot, 0) ); #endif } } lsmShmLock(pDb, LSM_LOCK_CHECKPOINTER, LSM_LOCK_UNLOCK, 0); if( pnWrite && rc==LSM_OK ) *pnWrite = nWrite; return rc; } int lsmBeginWork(lsm_db *pDb){ int rc; /* Attempt to take the WORKER lock */ rc = lsmShmLock(pDb, LSM_LOCK_WORKER, LSM_LOCK_EXCL, 0); /* Deserialize the current worker snapshot */ if( rc==LSM_OK ){ rc = lsmCheckpointLoadWorker(pDb); } return rc; } void lsmFreeSnapshot(lsm_env *pEnv, Snapshot *p){ if( p ){ lsmSortedFreeLevel(pEnv, p->pLevel); lsmFree(pEnv, p->freelist.aEntry); lsmFree(pEnv, p->redirect.a); lsmFree(pEnv, p); } } /* ** Attempt to populate one of the read-lock slots to contain lock values ** iLsm/iShm. Or, if such a slot exists already, this function is a no-op. ** ** It is not an error if no slot can be populated because the write-lock ** cannot be obtained. If any other error occurs, return an LSM error code. ** Otherwise, LSM_OK. ** ** This function is called at various points to try to ensure that there ** always exists at least one read-lock slot that can be used by a read-only ** client. And so that, in the usual case, there is an "exact match" available ** whenever a read transaction is opened by any client. At present this ** function is called when: ** ** * A write transaction that called lsmTreeDiscardOld() is committed, and ** * Whenever the working snapshot is updated (i.e. lsmFinishWork()). */ static int dbSetReadLock(lsm_db *db, i64 iLsm, u32 iShm){ int rc = LSM_OK; ShmHeader *pShm = db->pShmhdr; int i; /* Check if there is already a slot containing the required values. */ for(i=0; iaReader[i]; if( p->iLsmId==iLsm && p->iTreeId==iShm ) return LSM_OK; } /* Iterate through all read-lock slots, attempting to take a write-lock ** on each of them. If a write-lock succeeds, populate the locked slot ** with the required values and break out of the loop. */ for(i=0; rc==LSM_OK && iaReader[i]; p->iLsmId = iLsm; p->iTreeId = iShm; lsmShmLock(db, LSM_LOCK_READER(i), LSM_LOCK_UNLOCK, 0); break; } } return rc; } /* ** Release the read-lock currently held by connection db. */ int dbReleaseReadlock(lsm_db *db){ int rc = LSM_OK; if( db->iReader>=0 ){ rc = lsmShmLock(db, LSM_LOCK_READER(db->iReader), LSM_LOCK_UNLOCK, 0); db->iReader = -1; } db->bRoTrans = 0; return rc; } /* ** Argument bFlush is true if the contents of the in-memory tree has just ** been flushed to disk. The significance of this is that once the snapshot ** created to hold the updated state of the database is synced to disk, log ** file space can be recycled. */ void lsmFinishWork(lsm_db *pDb, int bFlush, int *pRc){ int rc = *pRc; assert( rc!=0 || pDb->pWorker ); if( pDb->pWorker ){ /* If no error has occurred, serialize the worker snapshot and write ** it to shared memory. */ if( rc==LSM_OK ){ rc = lsmSaveWorker(pDb, bFlush); } /* Assuming no error has occurred, update a read lock slot with the ** new snapshot id (see comments above function dbSetReadLock()). */ if( rc==LSM_OK ){ if( pDb->iReader<0 ){ rc = lsmTreeLoadHeader(pDb, 0); } if( rc==LSM_OK ){ rc = dbSetReadLock(pDb, pDb->pWorker->iId, pDb->treehdr.iUsedShmid); } } /* Free the snapshot object. */ lsmFreeSnapshot(pDb->pEnv, pDb->pWorker); pDb->pWorker = 0; } lsmShmLock(pDb, LSM_LOCK_WORKER, LSM_LOCK_UNLOCK, 0); *pRc = rc; } /* ** Called when recovery is finished. */ int lsmFinishRecovery(lsm_db *pDb){ lsmTreeEndTransaction(pDb, 1); return LSM_OK; } /* ** Check if the currently configured compression functions ** (LSM_CONFIG_SET_COMPRESSION) are compatible with a database that has its ** compression id set to iReq. Compression routines are compatible if iReq ** is zero (indicating the database is empty), or if it is equal to the ** compression id of the configured compression routines. ** ** If the check shows that the current compression are incompatible and there ** is a compression factory registered, give it a chance to install new ** compression routines. ** ** If, after any registered factory is invoked, the compression functions ** are still incompatible, return LSM_MISMATCH. Otherwise, LSM_OK. */ int lsmCheckCompressionId(lsm_db *pDb, u32 iReq){ if( iReq!=LSM_COMPRESSION_EMPTY && pDb->compress.iId!=iReq ){ if( pDb->factory.xFactory ){ pDb->bInFactory = 1; pDb->factory.xFactory(pDb->factory.pCtx, pDb, iReq); pDb->bInFactory = 0; } if( pDb->compress.iId!=iReq ){ /* Incompatible */ return LSM_MISMATCH; } } /* Compatible */ return LSM_OK; } /* ** Begin a read transaction. This function is a no-op if the connection ** passed as the only argument already has an open read transaction. */ int lsmBeginReadTrans(lsm_db *pDb){ const int MAX_READLOCK_ATTEMPTS = 10; const int nMaxAttempt = (pDb->bRoTrans ? 1 : MAX_READLOCK_ATTEMPTS); int rc = LSM_OK; /* Return code */ int iAttempt = 0; assert( pDb->pWorker==0 ); while( rc==LSM_OK && pDb->iReader<0 && (iAttempt++)pCsr==0 && pDb->nTransOpen==0 ); /* Load the in-memory tree header. */ rc = lsmTreeLoadHeader(pDb, &iTreehdr); /* Load the database snapshot */ if( rc==LSM_OK ){ if( lsmCheckpointClientCacheOk(pDb)==0 ){ lsmFreeSnapshot(pDb->pEnv, pDb->pClient); pDb->pClient = 0; lsmMCursorFreeCache(pDb); lsmFsPurgeCache(pDb->pFS); rc = lsmCheckpointLoad(pDb, &iSnap); }else{ iSnap = 1; } } /* Take a read-lock on the tree and snapshot just loaded. Then check ** that the shared-memory still contains the same values. If so, proceed. ** Otherwise, relinquish the read-lock and retry the whole procedure ** (starting with loading the in-memory tree header). */ if( rc==LSM_OK ){ u32 iShmMax = pDb->treehdr.iUsedShmid; u32 iShmMin = pDb->treehdr.iNextShmid+1-LSM_MAX_SHMCHUNKS; rc = lsmReadlock( pDb, lsmCheckpointId(pDb->aSnapshot, 0), iShmMin, iShmMax ); if( rc==LSM_OK ){ if( lsmTreeLoadHeaderOk(pDb, iTreehdr) && lsmCheckpointLoadOk(pDb, iSnap) ){ /* Read lock has been successfully obtained. Deserialize the ** checkpoint just loaded. TODO: This will be removed after ** lsm_sorted.c is changed to work directly from the serialized ** version of the snapshot. */ if( pDb->pClient==0 ){ rc = lsmCheckpointDeserialize(pDb, 0, pDb->aSnapshot,&pDb->pClient); } assert( (rc==LSM_OK)==(pDb->pClient!=0) ); assert( pDb->iReader>=0 ); /* Check that the client has the right compression hooks loaded. ** If not, set rc to LSM_MISMATCH. */ if( rc==LSM_OK ){ rc = lsmCheckCompressionId(pDb, pDb->pClient->iCmpId); } }else{ rc = dbReleaseReadlock(pDb); } } if( rc==LSM_BUSY ){ rc = LSM_OK; } } #if 0 if( rc==LSM_OK && pDb->pClient ){ fprintf(stderr, "reading %p: snapshot:%d used-shmid:%d trans-id:%d iOldShmid=%d\n", (void *)pDb, (int)pDb->pClient->iId, (int)pDb->treehdr.iUsedShmid, (int)pDb->treehdr.root.iTransId, (int)pDb->treehdr.iOldShmid ); } #endif } if( rc==LSM_OK ){ rc = lsmShmCacheChunks(pDb, pDb->treehdr.nChunk); } if( rc!=LSM_OK ){ dbReleaseReadlock(pDb); } if( pDb->pClient==0 && rc==LSM_OK ) rc = LSM_BUSY; return rc; } /* ** This function is used by a read-write connection to determine if there ** are currently one or more read-only transactions open on the database ** (in this context a read-only transaction is one opened by a read-only ** connection on a non-live database). ** ** If no error occurs, LSM_OK is returned and *pbExists is set to true if ** some other connection has a read-only transaction open, or false ** otherwise. If an error occurs an LSM error code is returned and the final ** value of *pbExist is undefined. */ int lsmDetectRoTrans(lsm_db *db, int *pbExist){ int rc; /* Only a read-write connection may use this function. */ assert( db->bReadonly==0 ); rc = lsmShmTestLock(db, LSM_LOCK_ROTRANS, 1, LSM_LOCK_EXCL); if( rc==LSM_BUSY ){ *pbExist = 1; rc = LSM_OK; }else{ *pbExist = 0; } return rc; } /* ** db is a read-only database handle in the disconnected state. This function ** attempts to open a read-transaction on the database. This may involve ** connecting to the database system (opening shared memory etc.). */ int lsmBeginRoTrans(lsm_db *db){ int rc = LSM_OK; assert( db->bReadonly && db->pShmhdr==0 ); assert( db->iReader<0 ); if( db->bRoTrans==0 ){ /* Attempt a shared-lock on DMS1. */ rc = lsmShmLock(db, LSM_LOCK_DMS1, LSM_LOCK_SHARED, 0); if( rc!=LSM_OK ) return rc; rc = lsmShmTestLock( db, LSM_LOCK_RWCLIENT(0), LSM_LOCK_NREADER, LSM_LOCK_SHARED ); if( rc==LSM_OK ){ /* System is not live. Take a SHARED lock on the ROTRANS byte and ** release DMS1. Locking ROTRANS tells all read-write clients that they ** may not recycle any disk space from within the database or log files, ** as a read-only client may be using it. */ rc = lsmShmLock(db, LSM_LOCK_ROTRANS, LSM_LOCK_SHARED, 0); lsmShmLock(db, LSM_LOCK_DMS1, LSM_LOCK_UNLOCK, 0); if( rc==LSM_OK ){ db->bRoTrans = 1; rc = lsmShmCacheChunks(db, 1); if( rc==LSM_OK ){ db->pShmhdr = (ShmHeader *)db->apShm[0]; memset(db->pShmhdr, 0, sizeof(ShmHeader)); rc = lsmCheckpointRecover(db); if( rc==LSM_OK ){ rc = lsmLogRecover(db); } } } }else if( rc==LSM_BUSY ){ /* System is live! */ rc = lsmShmLock(db, LSM_LOCK_DMS3, LSM_LOCK_SHARED, 0); lsmShmLock(db, LSM_LOCK_DMS1, LSM_LOCK_UNLOCK, 0); if( rc==LSM_OK ){ rc = lsmShmCacheChunks(db, 1); if( rc==LSM_OK ){ db->pShmhdr = (ShmHeader *)db->apShm[0]; } } } if( rc==LSM_OK ){ rc = lsmBeginReadTrans(db); } } return rc; } /* ** Close the currently open read transaction. */ void lsmFinishReadTrans(lsm_db *pDb){ /* Worker connections should not be closing read transactions. And ** read transactions should only be closed after all cursors and write ** transactions have been closed. Finally pClient should be non-NULL ** only iff pDb->iReader>=0. */ assert( pDb->pWorker==0 ); assert( pDb->pCsr==0 && pDb->nTransOpen==0 ); if( pDb->bRoTrans ){ int i; for(i=0; inShm; i++){ lsmFree(pDb->pEnv, pDb->apShm[i]); } lsmFree(pDb->pEnv, pDb->apShm); pDb->apShm = 0; pDb->nShm = 0; pDb->pShmhdr = 0; lsmShmLock(pDb, LSM_LOCK_ROTRANS, LSM_LOCK_UNLOCK, 0); } dbReleaseReadlock(pDb); } /* ** Open a write transaction. */ int lsmBeginWriteTrans(lsm_db *pDb){ int rc = LSM_OK; /* Return code */ ShmHeader *pShm = pDb->pShmhdr; /* Shared memory header */ assert( pDb->nTransOpen==0 ); assert( pDb->bDiscardOld==0 ); assert( pDb->bReadonly==0 ); /* If there is no read-transaction open, open one now. */ if( pDb->iReader<0 ){ rc = lsmBeginReadTrans(pDb); } /* Attempt to take the WRITER lock */ if( rc==LSM_OK ){ rc = lsmShmLock(pDb, LSM_LOCK_WRITER, LSM_LOCK_EXCL, 0); } /* If the previous writer failed mid-transaction, run emergency rollback. */ if( rc==LSM_OK && pShm->bWriter ){ rc = lsmTreeRepair(pDb); if( rc==LSM_OK ) pShm->bWriter = 0; } /* Check that this connection is currently reading from the most recent ** version of the database. If not, return LSM_BUSY. */ if( rc==LSM_OK && memcmp(&pShm->hdr1, &pDb->treehdr, sizeof(TreeHeader)) ){ rc = LSM_BUSY; } if( rc==LSM_OK ){ rc = lsmLogBegin(pDb); } /* If everything was successful, set the "transaction-in-progress" flag ** and return LSM_OK. Otherwise, if some error occurred, relinquish the ** WRITER lock and return an error code. */ if( rc==LSM_OK ){ TreeHeader *p = &pDb->treehdr; pShm->bWriter = 1; p->root.iTransId++; if( lsmTreeHasOld(pDb) && p->iOldLog==pDb->pClient->iLogOff ){ lsmTreeDiscardOld(pDb); pDb->bDiscardOld = 1; } }else{ lsmShmLock(pDb, LSM_LOCK_WRITER, LSM_LOCK_UNLOCK, 0); if( pDb->pCsr==0 ) lsmFinishReadTrans(pDb); } return rc; } /* ** End the current write transaction. The connection is left with an open ** read transaction. It is an error to call this if there is no open write ** transaction. ** ** If the transaction was committed, then a commit record has already been ** written into the log file when this function is called. Or, if the ** transaction was rolled back, both the log file and in-memory tree ** structure have already been restored. In either case, this function ** merely releases locks and other resources held by the write-transaction. ** ** LSM_OK is returned if successful, or an LSM error code otherwise. */ int lsmFinishWriteTrans(lsm_db *pDb, int bCommit){ int rc = LSM_OK; int bFlush = 0; lsmLogEnd(pDb, bCommit); if( rc==LSM_OK && bCommit && lsmTreeSize(pDb)>pDb->nTreeLimit ){ bFlush = 1; lsmTreeMakeOld(pDb); } lsmTreeEndTransaction(pDb, bCommit); if( rc==LSM_OK ){ if( bFlush && pDb->bAutowork ){ rc = lsmSortedAutoWork(pDb, 1); }else if( bCommit && pDb->bDiscardOld ){ rc = dbSetReadLock(pDb, pDb->pClient->iId, pDb->treehdr.iUsedShmid); } } pDb->bDiscardOld = 0; lsmShmLock(pDb, LSM_LOCK_WRITER, LSM_LOCK_UNLOCK, 0); if( bFlush && pDb->bAutowork==0 && pDb->xWork ){ pDb->xWork(pDb, pDb->pWorkCtx); } return rc; } /* ** Return non-zero if the caller is holding the client mutex. */ #ifdef LSM_DEBUG int lsmHoldingClientMutex(lsm_db *pDb){ return lsmMutexHeld(pDb->pEnv, pDb->pDatabase->pClientMutex); } #endif static int slotIsUsable(ShmReader *p, i64 iLsm, u32 iShmMin, u32 iShmMax){ return( p->iLsmId && p->iLsmId<=iLsm && shm_sequence_ge(iShmMax, p->iTreeId) && shm_sequence_ge(p->iTreeId, iShmMin) ); } /* ** Obtain a read-lock on database version identified by the combination ** of snapshot iLsm and tree iTree. Return LSM_OK if successful, or ** an LSM error code otherwise. */ int lsmReadlock(lsm_db *db, i64 iLsm, u32 iShmMin, u32 iShmMax){ int rc = LSM_OK; ShmHeader *pShm = db->pShmhdr; int i; assert( db->iReader<0 ); assert( shm_sequence_ge(iShmMax, iShmMin) ); /* This is a no-op if the read-only transaction flag is set. */ if( db->bRoTrans ){ db->iReader = 0; return LSM_OK; } /* Search for an exact match. */ for(i=0; db->iReader<0 && rc==LSM_OK && iaReader[i]; if( p->iLsmId==iLsm && p->iTreeId==iShmMax ){ rc = lsmShmLock(db, LSM_LOCK_READER(i), LSM_LOCK_SHARED, 0); if( rc==LSM_OK && p->iLsmId==iLsm && p->iTreeId==iShmMax ){ db->iReader = i; }else if( rc==LSM_BUSY ){ rc = LSM_OK; } } } /* Try to obtain a write-lock on each slot, in order. If successful, set ** the slot values to iLsm/iTree. */ for(i=0; db->iReader<0 && rc==LSM_OK && iaReader[i]; p->iLsmId = iLsm; p->iTreeId = iShmMax; rc = lsmShmLock(db, LSM_LOCK_READER(i), LSM_LOCK_SHARED, 0); assert( rc!=LSM_BUSY ); if( rc==LSM_OK ) db->iReader = i; } } /* Search for any usable slot */ for(i=0; db->iReader<0 && rc==LSM_OK && iaReader[i]; if( slotIsUsable(p, iLsm, iShmMin, iShmMax) ){ rc = lsmShmLock(db, LSM_LOCK_READER(i), LSM_LOCK_SHARED, 0); if( rc==LSM_OK && slotIsUsable(p, iLsm, iShmMin, iShmMax) ){ db->iReader = i; }else if( rc==LSM_BUSY ){ rc = LSM_OK; } } } if( rc==LSM_OK && db->iReader<0 ){ rc = LSM_BUSY; } return rc; } /* ** This is used to check if there exists a read-lock locking a particular ** version of either the in-memory tree or database file. ** ** If iLsmId is non-zero, then it is a snapshot id. If there exists a ** read-lock using this snapshot or newer, set *pbInUse to true. Or, ** if there is no such read-lock, set it to false. ** ** Or, if iLsmId is zero, then iShmid is a shared-memory sequence id. ** Search for a read-lock using this sequence id or newer. etc. */ static int isInUse(lsm_db *db, i64 iLsmId, u32 iShmid, int *pbInUse){ ShmHeader *pShm = db->pShmhdr; int i; int rc = LSM_OK; for(i=0; rc==LSM_OK && iaReader[i]; if( p->iLsmId ){ if( (iLsmId!=0 && p->iLsmId!=0 && iLsmId>=p->iLsmId) || (iLsmId==0 && shm_sequence_ge(p->iTreeId, iShmid)) ){ rc = lsmShmLock(db, LSM_LOCK_READER(i), LSM_LOCK_EXCL, 0); if( rc==LSM_OK ){ p->iLsmId = 0; lsmShmLock(db, LSM_LOCK_READER(i), LSM_LOCK_UNLOCK, 0); } } } } if( rc==LSM_BUSY ){ *pbInUse = 1; return LSM_OK; } *pbInUse = 0; return rc; } /* ** This function is called by worker connections to determine the smallest ** snapshot id that is currently in use by a database client. The worker ** connection uses this result to determine whether or not it is safe to ** recycle a database block. */ static int firstSnapshotInUse( lsm_db *db, /* Database handle */ i64 *piInUse /* IN/OUT: Smallest snapshot id in use */ ){ ShmHeader *pShm = db->pShmhdr; i64 iInUse = *piInUse; int i; assert( iInUse>0 ); for(i=0; iaReader[i]; if( p->iLsmId ){ i64 iThis = p->iLsmId; if( iThis!=0 && iInUse>iThis ){ int rc = lsmShmLock(db, LSM_LOCK_READER(i), LSM_LOCK_EXCL, 0); if( rc==LSM_OK ){ p->iLsmId = 0; lsmShmLock(db, LSM_LOCK_READER(i), LSM_LOCK_UNLOCK, 0); }else if( rc==LSM_BUSY ){ iInUse = iThis; }else{ /* Some error other than LSM_BUSY. Return the error code to ** the caller in this case. */ return rc; } } } } *piInUse = iInUse; return LSM_OK; } int lsmTreeInUse(lsm_db *db, u32 iShmid, int *pbInUse){ if( db->treehdr.iUsedShmid==iShmid ){ *pbInUse = 1; return LSM_OK; } return isInUse(db, 0, iShmid, pbInUse); } int lsmLsmInUse(lsm_db *db, i64 iLsmId, int *pbInUse){ if( db->pClient && db->pClient->iId<=iLsmId ){ *pbInUse = 1; return LSM_OK; } return isInUse(db, iLsmId, 0, pbInUse); } /* ** This function may only be called after a successful call to ** lsmDbDatabaseConnect(). It returns true if the connection is in ** multi-process mode, or false otherwise. */ int lsmDbMultiProc(lsm_db *pDb){ return pDb->pDatabase && pDb->pDatabase->bMultiProc; } /************************************************************************* ************************************************************************** ************************************************************************** ************************************************************************** ************************************************************************** *************************************************************************/ /* ** Ensure that database connection db has cached pointers to at least the ** first nChunk chunks of shared memory. */ int lsmShmCacheChunks(lsm_db *db, int nChunk){ int rc = LSM_OK; if( nChunk>db->nShm ){ static const int NINCR = 16; Database *p = db->pDatabase; lsm_env *pEnv = db->pEnv; int nAlloc; int i; /* Ensure that the db->apShm[] array is large enough. If an attempt to ** allocate memory fails, return LSM_NOMEM immediately. The apShm[] array ** is always extended in multiples of 16 entries - so the actual allocated ** size can be inferred from nShm. */ nAlloc = ((db->nShm + NINCR - 1) / NINCR) * NINCR; while( nChunk>=nAlloc ){ void **apShm; nAlloc += NINCR; apShm = lsmRealloc(pEnv, db->apShm, sizeof(void*)*nAlloc); if( !apShm ) return LSM_NOMEM_BKPT; db->apShm = apShm; } if( db->bRoTrans ){ for(i=db->nShm; rc==LSM_OK && iapShm[i] = lsmMallocZeroRc(pEnv, LSM_SHM_CHUNK_SIZE, &rc); db->nShm++; } }else{ /* Enter the client mutex */ lsmMutexEnter(pEnv, p->pClientMutex); /* Extend the Database objects apShmChunk[] array if necessary. Using the ** same pattern as for the lsm_db.apShm[] array above. */ nAlloc = ((p->nShmChunk + NINCR - 1) / NINCR) * NINCR; while( nChunk>=nAlloc ){ void **apShm; nAlloc += NINCR; apShm = lsmRealloc(pEnv, p->apShmChunk, sizeof(void*)*nAlloc); if( !apShm ){ rc = LSM_NOMEM_BKPT; break; } p->apShmChunk = apShm; } for(i=db->nShm; rc==LSM_OK && i=p->nShmChunk ){ void *pChunk = 0; if( p->bMultiProc==0 ){ /* Single process mode */ pChunk = lsmMallocZeroRc(pEnv, LSM_SHM_CHUNK_SIZE, &rc); }else{ /* Multi-process mode */ rc = lsmEnvShmMap(pEnv, p->pFile, i, LSM_SHM_CHUNK_SIZE, &pChunk); } if( rc==LSM_OK ){ p->apShmChunk[i] = pChunk; p->nShmChunk++; } } if( rc==LSM_OK ){ db->apShm[i] = p->apShmChunk[i]; db->nShm++; } } /* Release the client mutex */ lsmMutexLeave(pEnv, p->pClientMutex); } } return rc; } static int lockSharedFile(lsm_env *pEnv, Database *p, int iLock, int eOp){ int rc = LSM_OK; if( p->bMultiProc ){ rc = lsmEnvLock(pEnv, p->pFile, iLock, eOp); } return rc; } /* ** Test if it would be possible for connection db to obtain a lock of type ** eType on the nLock locks starting at iLock. If so, return LSM_OK. If it ** would not be possible to obtain the lock due to a lock held by another ** connection, return LSM_BUSY. If an IO or other error occurs (i.e. in the ** lsm_env.xTestLock function), return some other LSM error code. ** ** Note that this function never actually locks the database - it merely ** queries the system to see if there exists a lock that would prevent ** it from doing so. */ int lsmShmTestLock( lsm_db *db, int iLock, int nLock, int eOp ){ int rc = LSM_OK; lsm_db *pIter; Database *p = db->pDatabase; int i; u64 mask = 0; for(i=iLock; i<(iLock+nLock); i++){ mask |= ((u64)1 << (iLock-1)); if( eOp==LSM_LOCK_EXCL ) mask |= ((u64)1 << (iLock+32-1)); } lsmMutexEnter(db->pEnv, p->pClientMutex); for(pIter=p->pConn; pIter; pIter=pIter->pNext){ if( pIter!=db && (pIter->mLock & mask) ){ assert( pIter!=db ); break; } } if( pIter ){ rc = LSM_BUSY; }else if( p->bMultiProc ){ rc = lsmEnvTestLock(db->pEnv, p->pFile, iLock, nLock, eOp); } lsmMutexLeave(db->pEnv, p->pClientMutex); return rc; } /* ** Attempt to obtain the lock identified by the iLock and bExcl parameters. ** If successful, return LSM_OK. If the lock cannot be obtained because ** there exists some other conflicting lock, return LSM_BUSY. If some other ** error occurs, return an LSM error code. ** ** Parameter iLock must be one of LSM_LOCK_WRITER, WORKER or CHECKPOINTER, ** or else a value returned by the LSM_LOCK_READER macro. */ int lsmShmLock( lsm_db *db, int iLock, int eOp, /* One of LSM_LOCK_UNLOCK, SHARED or EXCL */ int bBlock /* True for a blocking lock */ ){ lsm_db *pIter; const u64 me = ((u64)1 << (iLock-1)); const u64 ms = ((u64)1 << (iLock+32-1)); int rc = LSM_OK; Database *p = db->pDatabase; assert( eOp!=LSM_LOCK_EXCL || p->bReadonly==0 ); assert( iLock>=1 && iLock<=LSM_LOCK_RWCLIENT(LSM_LOCK_NRWCLIENT-1) ); assert( LSM_LOCK_RWCLIENT(LSM_LOCK_NRWCLIENT-1)<=32 ); assert( eOp==LSM_LOCK_UNLOCK || eOp==LSM_LOCK_SHARED || eOp==LSM_LOCK_EXCL ); /* Check for a no-op. Proceed only if this is not one of those. */ if( (eOp==LSM_LOCK_UNLOCK && (db->mLock & (me|ms))!=0) || (eOp==LSM_LOCK_SHARED && (db->mLock & (me|ms))!=ms) || (eOp==LSM_LOCK_EXCL && (db->mLock & me)==0) ){ int nExcl = 0; /* Number of connections holding EXCLUSIVE */ int nShared = 0; /* Number of connections holding SHARED */ lsmMutexEnter(db->pEnv, p->pClientMutex); /* Figure out the locks currently held by this process on iLock, not ** including any held by connection db. */ for(pIter=p->pConn; pIter; pIter=pIter->pNext){ assert( (pIter->mLock & me)==0 || (pIter->mLock & ms)!=0 ); if( pIter!=db ){ if( pIter->mLock & me ){ nExcl++; }else if( pIter->mLock & ms ){ nShared++; } } } assert( nExcl==0 || nExcl==1 ); assert( nExcl==0 || nShared==0 ); assert( nExcl==0 || (db->mLock & (me|ms))==0 ); switch( eOp ){ case LSM_LOCK_UNLOCK: if( nShared==0 ){ lockSharedFile(db->pEnv, p, iLock, LSM_LOCK_UNLOCK); } db->mLock &= ~(me|ms); break; case LSM_LOCK_SHARED: if( nExcl ){ rc = LSM_BUSY; }else{ if( nShared==0 ){ rc = lockSharedFile(db->pEnv, p, iLock, LSM_LOCK_SHARED); } if( rc==LSM_OK ){ db->mLock |= ms; db->mLock &= ~me; } } break; default: assert( eOp==LSM_LOCK_EXCL ); if( nExcl || nShared ){ rc = LSM_BUSY; }else{ rc = lockSharedFile(db->pEnv, p, iLock, LSM_LOCK_EXCL); if( rc==LSM_OK ){ db->mLock |= (me|ms); } } break; } lsmMutexLeave(db->pEnv, p->pClientMutex); } return rc; } #ifdef LSM_DEBUG int shmLockType(lsm_db *db, int iLock){ const u64 me = ((u64)1 << (iLock-1)); const u64 ms = ((u64)1 << (iLock+32-1)); if( db->mLock & me ) return LSM_LOCK_EXCL; if( db->mLock & ms ) return LSM_LOCK_SHARED; return LSM_LOCK_UNLOCK; } /* ** The arguments passed to this function are similar to those passed to ** the lsmShmLock() function. However, instead of obtaining a new lock ** this function returns true if the specified connection already holds ** (or does not hold) such a lock, depending on the value of eOp. As ** follows: ** ** (eOp==LSM_LOCK_UNLOCK) -> true if db has no lock on iLock ** (eOp==LSM_LOCK_SHARED) -> true if db has at least a SHARED lock on iLock. ** (eOp==LSM_LOCK_EXCL) -> true if db has an EXCLUSIVE lock on iLock. */ int lsmShmAssertLock(lsm_db *db, int iLock, int eOp){ int ret = 0; int eHave; assert( iLock>=1 && iLock<=LSM_LOCK_READER(LSM_LOCK_NREADER-1) ); assert( iLock<=16 ); assert( eOp==LSM_LOCK_UNLOCK || eOp==LSM_LOCK_SHARED || eOp==LSM_LOCK_EXCL ); eHave = shmLockType(db, iLock); switch( eOp ){ case LSM_LOCK_UNLOCK: ret = (eHave==LSM_LOCK_UNLOCK); break; case LSM_LOCK_SHARED: ret = (eHave!=LSM_LOCK_UNLOCK); break; case LSM_LOCK_EXCL: ret = (eHave==LSM_LOCK_EXCL); break; default: assert( !"bad eOp value passed to lsmShmAssertLock()" ); break; } return ret; } int lsmShmAssertWorker(lsm_db *db){ return lsmShmAssertLock(db, LSM_LOCK_WORKER, LSM_LOCK_EXCL) && db->pWorker; } /* ** This function does not contribute to library functionality, and is not ** included in release builds. It is intended to be called from within ** an interactive debugger. ** ** When called, this function prints a single line of human readable output ** to stdout describing the locks currently held by the connection. For ** example: ** ** (gdb) call print_db_locks(pDb) ** (shared on dms2) (exclusive on writer) */ void print_db_locks(lsm_db *db){ int iLock; for(iLock=0; iLock<16; iLock++){ int bOne = 0; const char *azLock[] = {0, "shared", "exclusive"}; const char *azName[] = { 0, "dms1", "dms2", "writer", "worker", "checkpointer", "reader0", "reader1", "reader2", "reader3", "reader4", "reader5" }; int eHave = shmLockType(db, iLock); if( azLock[eHave] ){ printf("%s(%s on %s)", (bOne?" ":""), azLock[eHave], azName[iLock]); bOne = 1; } } printf("\n"); } void print_all_db_locks(lsm_db *db){ lsm_db *p; for(p=db->pDatabase->pConn; p; p=p->pNext){ printf("%s connection %p ", ((p==db)?"*":""), p); print_db_locks(p); } } #endif void lsmShmBarrier(lsm_db *db){ lsmEnvShmBarrier(db->pEnv); } int lsm_checkpoint(lsm_db *pDb, int *pnKB){ int rc; /* Return code */ u32 nWrite = 0; /* Number of pages checkpointed */ /* Attempt the checkpoint. If successful, nWrite is set to the number of ** pages written between this and the previous checkpoint. */ rc = lsmCheckpointWrite(pDb, &nWrite); /* If required, calculate the output variable (KB of data checkpointed). ** Set it to zero if an error occured. */ if( pnKB ){ int nKB = 0; if( rc==LSM_OK && nWrite ){ nKB = (((i64)nWrite * lsmFsPageSize(pDb->pFS)) + 1023) / 1024; } *pnKB = nKB; } return rc; } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_sorted.c ================================================ /* ** 2011-08-14 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** PAGE FORMAT: ** ** The maximum page size is 65536 bytes. ** ** Since all records are equal to or larger than 2 bytes in size, and ** some space within the page is consumed by the page footer, there must ** be less than 2^15 records on each page. ** ** Each page ends with a footer that describes the pages contents. This ** footer serves as similar purpose to the page header in an SQLite database. ** A footer is used instead of a header because it makes it easier to ** populate a new page based on a sorted list of key/value pairs. ** ** The footer consists of the following values (starting at the end of ** the page and continuing backwards towards the start). All values are ** stored as unsigned big-endian integers. ** ** * Number of records on page (2 bytes). ** * Flags field (2 bytes). ** * Left-hand pointer value (8 bytes). ** * The starting offset of each record (2 bytes per record). ** ** Records may span pages. Unless it happens to be an exact fit, the part ** of the final record that starts on page X that does not fit on page X ** is stored at the start of page (X+1). This means there may be pages where ** (N==0). And on most pages the first record that starts on the page will ** not start at byte offset 0. For example: ** ** aaaaa bbbbb ccc
cc eeeee fffff g
gggg.... ** ** RECORD FORMAT: ** ** The first byte of the record is a flags byte. It is a combination ** of the following flags (defined in lsmInt.h): ** ** LSM_START_DELETE ** LSM_END_DELETE ** LSM_POINT_DELETE ** LSM_INSERT ** LSM_SEPARATOR ** LSM_SYSTEMKEY ** ** Immediately following the type byte is a pointer to the smallest key ** in the next file that is larger than the key in the current record. The ** pointer is encoded as a varint. When added to the 32-bit page number ** stored in the footer, it is the page number of the page that contains the ** smallest key in the next sorted file that is larger than this key. ** ** Next is the number of bytes in the key, encoded as a varint. ** ** If the LSM_INSERT flag is set, the number of bytes in the value, as ** a varint, is next. ** ** Finally, the blob of data containing the key, and for LSM_INSERT ** records, the value as well. */ #ifndef _LSM_INT_H # include "lsmInt.h" #endif #define LSM_LOG_STRUCTURE 0 #define LSM_LOG_DATA 0 /* ** Macros to help decode record types. */ #define rtTopic(eType) ((eType) & LSM_SYSTEMKEY) #define rtIsDelete(eType) (((eType) & 0x0F)==LSM_POINT_DELETE) #define rtIsSeparator(eType) (((eType) & LSM_SEPARATOR)!=0) #define rtIsWrite(eType) (((eType) & LSM_INSERT)!=0) #define rtIsSystem(eType) (((eType) & LSM_SYSTEMKEY)!=0) /* ** The following macros are used to access a page footer. */ #define SEGMENT_NRECORD_OFFSET(pgsz) ((pgsz) - 2) #define SEGMENT_FLAGS_OFFSET(pgsz) ((pgsz) - 2 - 2) #define SEGMENT_POINTER_OFFSET(pgsz) ((pgsz) - 2 - 2 - 8) #define SEGMENT_CELLPTR_OFFSET(pgsz, iCell) ((pgsz) - 2 - 2 - 8 - 2 - (iCell)*2) #define SEGMENT_EOF(pgsz, nEntry) SEGMENT_CELLPTR_OFFSET(pgsz, nEntry) #define SEGMENT_BTREE_FLAG 0x0001 #define PGFTR_SKIP_NEXT_FLAG 0x0002 #define PGFTR_SKIP_THIS_FLAG 0x0004 #ifndef LSM_SEGMENTPTR_FREE_THRESHOLD # define LSM_SEGMENTPTR_FREE_THRESHOLD 1024 #endif typedef struct SegmentPtr SegmentPtr; typedef struct Blob Blob; struct Blob { lsm_env *pEnv; void *pData; int nData; int nAlloc; }; /* ** A SegmentPtr object may be used for one of two purposes: ** ** * To iterate and/or seek within a single Segment (the combination of a ** main run and an optional sorted run). ** ** * To iterate through the separators array of a segment. */ struct SegmentPtr { Level *pLevel; /* Level object segment is part of */ Segment *pSeg; /* Segment to access */ /* Current page. See segmentPtrLoadPage(). */ Page *pPg; /* Current page */ u16 flags; /* Copy of page flags field */ int nCell; /* Number of cells on pPg */ Pgno iPtr; /* Base cascade pointer */ /* Current cell. See segmentPtrLoadCell() */ int iCell; /* Current record within page pPg */ int eType; /* Type of current record */ Pgno iPgPtr; /* Cascade pointer offset */ void *pKey; int nKey; /* Key associated with current record */ void *pVal; int nVal; /* Current record value (eType==WRITE only) */ /* Blobs used to allocate buffers for pKey and pVal as required */ Blob blob1; Blob blob2; }; /* ** Used to iterate through the keys stored in a b-tree hierarchy from start ** to finish. Only First() and Next() operations are required. ** ** btreeCursorNew() ** btreeCursorFirst() ** btreeCursorNext() ** btreeCursorFree() ** btreeCursorPosition() ** btreeCursorRestore() */ typedef struct BtreePg BtreePg; typedef struct BtreeCursor BtreeCursor; struct BtreePg { Page *pPage; int iCell; }; struct BtreeCursor { Segment *pSeg; /* Iterate through this segments btree */ FileSystem *pFS; /* File system to read pages from */ int nDepth; /* Allocated size of aPg[] */ int iPg; /* Current entry in aPg[]. -1 -> EOF. */ BtreePg *aPg; /* Pages from root to current location */ /* Cache of current entry. pKey==0 for EOF. */ void *pKey; int nKey; int eType; Pgno iPtr; /* Storage for key, if not local */ Blob blob; }; /* ** A cursor used for merged searches or iterations through up to one ** Tree structure and any number of sorted files. ** ** lsmMCursorNew() ** lsmMCursorSeek() ** lsmMCursorNext() ** lsmMCursorPrev() ** lsmMCursorFirst() ** lsmMCursorLast() ** lsmMCursorKey() ** lsmMCursorValue() ** lsmMCursorValid() ** ** iFree: ** This variable is only used by cursors providing input data for a ** new top-level segment. Such cursors only ever iterate forwards, not ** backwards. */ struct MultiCursor { lsm_db *pDb; /* Connection that owns this cursor */ MultiCursor *pNext; /* Next cursor owned by connection pDb */ int flags; /* Mask of CURSOR_XXX flags */ int eType; /* Cache of current key type */ Blob key; /* Cache of current key (or NULL) */ Blob val; /* Cache of current value */ /* All the component cursors: */ TreeCursor *apTreeCsr[2]; /* Up to two tree cursors */ int iFree; /* Next element of free-list (-ve for eof) */ SegmentPtr *aPtr; /* Array of segment pointers */ int nPtr; /* Size of array aPtr[] */ BtreeCursor *pBtCsr; /* b-tree cursor (db writes only) */ /* Comparison results */ int nTree; /* Size of aTree[] array */ int *aTree; /* Array of comparison results */ /* Used by cursors flushing the in-memory tree only */ void *pSystemVal; /* Pointer to buffer to free */ /* Used by worker cursors only */ Pgno *pPrevMergePtr; }; /* ** The following constants are used to assign integers to each component ** cursor of a multi-cursor. */ #define CURSOR_DATA_TREE0 0 /* Current tree cursor (apTreeCsr[0]) */ #define CURSOR_DATA_TREE1 1 /* The "old" tree, if any (apTreeCsr[1]) */ #define CURSOR_DATA_SYSTEM 2 /* Free-list entries (new-toplevel only) */ #define CURSOR_DATA_SEGMENT 3 /* First segment pointer (aPtr[0]) */ /* ** CURSOR_IGNORE_DELETE ** If set, this cursor will not visit SORTED_DELETE keys. ** ** CURSOR_FLUSH_FREELIST ** This cursor is being used to create a new toplevel. It should also ** iterate through the contents of the in-memory free block list. ** ** CURSOR_IGNORE_SYSTEM ** If set, this cursor ignores system keys. ** ** CURSOR_NEXT_OK ** Set if it is Ok to call lsm_csr_next(). ** ** CURSOR_PREV_OK ** Set if it is Ok to call lsm_csr_prev(). ** ** CURSOR_READ_SEPARATORS ** Set if this cursor should visit the separator keys in segment ** aPtr[nPtr-1]. ** ** CURSOR_SEEK_EQ ** Cursor has undergone a successful lsm_csr_seek(LSM_SEEK_EQ) operation. ** The key and value are stored in MultiCursor.key and MultiCursor.val ** respectively. */ #define CURSOR_IGNORE_DELETE 0x00000001 #define CURSOR_FLUSH_FREELIST 0x00000002 #define CURSOR_IGNORE_SYSTEM 0x00000010 #define CURSOR_NEXT_OK 0x00000020 #define CURSOR_PREV_OK 0x00000040 #define CURSOR_READ_SEPARATORS 0x00000080 #define CURSOR_SEEK_EQ 0x00000100 typedef struct MergeWorker MergeWorker; typedef struct Hierarchy Hierarchy; struct Hierarchy { Page **apHier; int nHier; }; /* ** aSave: ** When mergeWorkerNextPage() is called to advance to the next page in ** the output segment, if the bStore flag for an element of aSave[] is ** true, it is cleared and the corresponding iPgno value is set to the ** page number of the page just completed. ** ** aSave[0] is used to record the pointer value to be pushed into the ** b-tree hierarchy. aSave[1] is used to save the page number of the ** page containing the indirect key most recently written to the b-tree. ** see mergeWorkerPushHierarchy() for details. */ struct MergeWorker { lsm_db *pDb; /* Database handle */ Level *pLevel; /* Worker snapshot Level being merged */ MultiCursor *pCsr; /* Cursor to read new segment contents from */ int bFlush; /* True if this is an in-memory tree flush */ Hierarchy hier; /* B-tree hierarchy under construction */ Page *pPage; /* Current output page */ int nWork; /* Number of calls to mergeWorkerNextPage() */ Pgno *aGobble; /* Gobble point for each input segment */ Pgno iIndirect; struct SavedPgno { Pgno iPgno; int bStore; } aSave[2]; }; #ifdef LSM_DEBUG_EXPENSIVE static int assertPointersOk(lsm_db *, Segment *, Segment *, int); static int assertBtreeOk(lsm_db *, Segment *); static void assertRunInOrder(lsm_db *pDb, Segment *pSeg); #else #define assertRunInOrder(x,y) #define assertBtreeOk(x,y) #endif struct FilePage { u8 *aData; int nData; }; static u8 *fsPageData(Page *pPg, int *pnData){ *pnData = ((struct FilePage *)(pPg))->nData; return ((struct FilePage *)(pPg))->aData; } /*UNUSED static u8 *fsPageDataPtr(Page *pPg){ return ((struct FilePage *)(pPg))->aData; }*/ /* ** Write nVal as a 16-bit unsigned big-endian integer into buffer aOut. */ void lsmPutU16(u8 *aOut, u16 nVal){ aOut[0] = (u8)((nVal>>8) & 0xFF); aOut[1] = (u8)(nVal & 0xFF); } void lsmPutU32(u8 *aOut, u32 nVal){ aOut[0] = (u8)((nVal>>24) & 0xFF); aOut[1] = (u8)((nVal>>16) & 0xFF); aOut[2] = (u8)((nVal>> 8) & 0xFF); aOut[3] = (u8)((nVal ) & 0xFF); } int lsmGetU16(u8 *aOut){ return (aOut[0] << 8) + aOut[1]; } u32 lsmGetU32(u8 *aOut){ return ((u32)aOut[0] << 24) + ((u32)aOut[1] << 16) + ((u32)aOut[2] << 8) + ((u32)aOut[3]); } u64 lsmGetU64(u8 *aOut){ return ((u64)aOut[0] << 56) + ((u64)aOut[1] << 48) + ((u64)aOut[2] << 40) + ((u64)aOut[3] << 32) + ((u64)aOut[4] << 24) + ((u32)aOut[5] << 16) + ((u32)aOut[6] << 8) + ((u32)aOut[7]); } void lsmPutU64(u8 *aOut, u64 nVal){ aOut[0] = (u8)((nVal>>56) & 0xFF); aOut[1] = (u8)((nVal>>48) & 0xFF); aOut[2] = (u8)((nVal>>40) & 0xFF); aOut[3] = (u8)((nVal>>32) & 0xFF); aOut[4] = (u8)((nVal>>24) & 0xFF); aOut[5] = (u8)((nVal>>16) & 0xFF); aOut[6] = (u8)((nVal>> 8) & 0xFF); aOut[7] = (u8)((nVal ) & 0xFF); } static int sortedBlobGrow(lsm_env *pEnv, Blob *pBlob, int nData){ assert( pBlob->pEnv==pEnv || (pBlob->pEnv==0 && pBlob->pData==0) ); if( pBlob->nAllocpData = lsmReallocOrFree(pEnv, pBlob->pData, nData); if( !pBlob->pData ) return LSM_NOMEM_BKPT; pBlob->nAlloc = nData; pBlob->pEnv = pEnv; } return LSM_OK; } static int sortedBlobSet(lsm_env *pEnv, Blob *pBlob, void *pData, int nData){ if( sortedBlobGrow(pEnv, pBlob, nData) ) return LSM_NOMEM; memcpy(pBlob->pData, pData, nData); pBlob->nData = nData; return LSM_OK; } #if 0 static int sortedBlobCopy(Blob *pDest, Blob *pSrc){ return sortedBlobSet(pDest, pSrc->pData, pSrc->nData); } #endif static void sortedBlobFree(Blob *pBlob){ assert( pBlob->pEnv || pBlob->pData==0 ); if( pBlob->pData ) lsmFree(pBlob->pEnv, pBlob->pData); memset(pBlob, 0, sizeof(Blob)); } static int sortedReadData( Segment *pSeg, Page *pPg, int iOff, int nByte, void **ppData, Blob *pBlob ){ int rc = LSM_OK; int iEnd; int nData; int nCell; u8 *aData; aData = fsPageData(pPg, &nData); nCell = lsmGetU16(&aData[SEGMENT_NRECORD_OFFSET(nData)]); iEnd = SEGMENT_EOF(nData, nCell); assert( iEnd>0 && iEndnData = nByte; aDest = (u8 *)pBlob->pData; *ppData = pBlob->pData; /* Increment the pointer pages ref-count. */ lsmFsPageRef(pPg); while( rc==LSM_OK ){ Page *pNext; int flags; /* Copy data from pPg into the output buffer. */ int nCopy = LSM_MIN(nRem, iEnd-i); if( nCopy>0 ){ memcpy(&aDest[nByte-nRem], &aData[i], nCopy); nRem -= nCopy; i += nCopy; assert( nRem==0 || i==iEnd ); } assert( nRem>=0 ); if( nRem==0 ) break; i -= iEnd; /* Grab the next page in the segment */ do { rc = lsmFsDbPageNext(pSeg, pPg, 1, &pNext); if( rc==LSM_OK && pNext==0 ){ rc = LSM_CORRUPT_BKPT; } if( rc ) break; lsmFsPageRelease(pPg); pPg = pNext; aData = fsPageData(pPg, &nData); flags = lsmGetU16(&aData[SEGMENT_FLAGS_OFFSET(nData)]); }while( flags&SEGMENT_BTREE_FLAG ); iEnd = SEGMENT_EOF(nData, lsmGetU16(&aData[nData-2])); assert( iEnd>0 && iEnd=0 ); aCell = pageGetCell(aData, nData, iCell); lsmVarintGet64(&aCell[1], &iRet); return iRet; } static u8 *pageGetKey( Segment *pSeg, /* Segment pPg belongs to */ Page *pPg, /* Page to read from */ int iCell, /* Index of cell on page to read */ int *piTopic, /* OUT: Topic associated with this key */ int *pnKey, /* OUT: Size of key in bytes */ Blob *pBlob /* If required, use this for dynamic memory */ ){ u8 *pKey; int nDummy; int eType; u8 *aData; int nData; aData = fsPageData(pPg, &nData); assert( !(pageGetFlags(aData, nData) & SEGMENT_BTREE_FLAG) ); assert( iCellpData || nKey==pBlob->nData ); if( (void *)aKey!=pBlob->pData ){ rc = sortedBlobSet(pEnv, pBlob, aKey, nKey); } return rc; } static Pgno pageGetBtreeRef(Page *pPg, int iKey){ Pgno iRef; u8 *aData; int nData; u8 *aCell; aData = fsPageData(pPg, &nData); aCell = pageGetCell(aData, nData, iKey); assert( aCell[0]==0 ); aCell++; aCell += lsmVarintGet64(aCell, &iRef); lsmVarintGet64(aCell, &iRef); assert( iRef>0 ); return iRef; } #define GETVARINT64(a, i) (((i)=((u8*)(a))[0])<=240?1:lsmVarintGet64((a), &(i))) #define GETVARINT32(a, i) (((i)=((u8*)(a))[0])<=240?1:lsmVarintGet32((a), &(i))) static int pageGetBtreeKey( Segment *pSeg, /* Segment page pPg belongs to */ Page *pPg, int iKey, Pgno *piPtr, int *piTopic, void **ppKey, int *pnKey, Blob *pBlob ){ u8 *aData; int nData; u8 *aCell; int eType; aData = fsPageData(pPg, &nData); assert( SEGMENT_BTREE_FLAG & pageGetFlags(aData, nData) ); assert( iKey>=0 && iKeypData; *pnKey = pBlob->nData; }else{ aCell += GETVARINT32(aCell, *pnKey); *ppKey = aCell; } if( piTopic ) *piTopic = rtTopic(eType); return LSM_OK; } static int btreeCursorLoadKey(BtreeCursor *pCsr){ int rc = LSM_OK; if( pCsr->iPg<0 ){ pCsr->pKey = 0; pCsr->nKey = 0; pCsr->eType = 0; }else{ Pgno dummy; int iPg = pCsr->iPg; int iCell = pCsr->aPg[iPg].iCell; while( iCell<0 && (--iPg)>=0 ){ iCell = pCsr->aPg[iPg].iCell-1; } if( iPg<0 || iCell<0 ) return LSM_CORRUPT_BKPT; rc = pageGetBtreeKey( pCsr->pSeg, pCsr->aPg[iPg].pPage, iCell, &dummy, &pCsr->eType, &pCsr->pKey, &pCsr->nKey, &pCsr->blob ); pCsr->eType |= LSM_SEPARATOR; } return rc; } static int btreeCursorPtr(u8 *aData, int nData, int iCell){ int nCell; nCell = pageGetNRec(aData, nData); if( iCell>=nCell ){ return (int)pageGetPtr(aData, nData); } return (int)pageGetRecordPtr(aData, nData, iCell); } static int btreeCursorNext(BtreeCursor *pCsr){ int rc = LSM_OK; BtreePg *pPg = &pCsr->aPg[pCsr->iPg]; int nCell; u8 *aData; int nData; assert( pCsr->iPg>=0 ); assert( pCsr->iPg==pCsr->nDepth-1 ); aData = fsPageData(pPg->pPage, &nData); nCell = pageGetNRec(aData, nData); assert( pPg->iCell<=nCell ); pPg->iCell++; if( pPg->iCell==nCell ){ Pgno iLoad; /* Up to parent. */ lsmFsPageRelease(pPg->pPage); pPg->pPage = 0; pCsr->iPg--; while( pCsr->iPg>=0 ){ pPg = &pCsr->aPg[pCsr->iPg]; aData = fsPageData(pPg->pPage, &nData); if( pPg->iCellpPage); pCsr->iPg--; } /* Read the key */ rc = btreeCursorLoadKey(pCsr); /* Unless the cursor is at EOF, descend to cell -1 (yes, negative one) of ** the left-most most descendent. */ if( pCsr->iPg>=0 ){ pCsr->aPg[pCsr->iPg].iCell++; iLoad = btreeCursorPtr(aData, nData, pPg->iCell); do { Page *pLoad; pCsr->iPg++; rc = lsmFsDbPageGet(pCsr->pFS, pCsr->pSeg, iLoad, &pLoad); pCsr->aPg[pCsr->iPg].pPage = pLoad; pCsr->aPg[pCsr->iPg].iCell = 0; if( rc==LSM_OK ){ if( pCsr->iPg==(pCsr->nDepth-1) ) break; aData = fsPageData(pLoad, &nData); iLoad = btreeCursorPtr(aData, nData, 0); } }while( rc==LSM_OK && pCsr->iPg<(pCsr->nDepth-1) ); pCsr->aPg[pCsr->iPg].iCell = -1; } }else{ rc = btreeCursorLoadKey(pCsr); } if( rc==LSM_OK && pCsr->iPg>=0 ){ aData = fsPageData(pCsr->aPg[pCsr->iPg].pPage, &nData); pCsr->iPtr = btreeCursorPtr(aData, nData, pCsr->aPg[pCsr->iPg].iCell+1); } return rc; } static void btreeCursorFree(BtreeCursor *pCsr){ if( pCsr ){ int i; lsm_env *pEnv = lsmFsEnv(pCsr->pFS); for(i=0; i<=pCsr->iPg; i++){ lsmFsPageRelease(pCsr->aPg[i].pPage); } sortedBlobFree(&pCsr->blob); lsmFree(pEnv, pCsr->aPg); lsmFree(pEnv, pCsr); } } static int btreeCursorFirst(BtreeCursor *pCsr){ int rc; Page *pPg = 0; FileSystem *pFS = pCsr->pFS; int iPg = (int)pCsr->pSeg->iRoot; do { rc = lsmFsDbPageGet(pFS, pCsr->pSeg, iPg, &pPg); assert( (rc==LSM_OK)==(pPg!=0) ); if( rc==LSM_OK ){ u8 *aData; int nData; int flags; aData = fsPageData(pPg, &nData); flags = pageGetFlags(aData, nData); if( (flags & SEGMENT_BTREE_FLAG)==0 ) break; if( (pCsr->nDepth % 8)==0 ){ int nNew = pCsr->nDepth + 8; pCsr->aPg = (BtreePg *)lsmReallocOrFreeRc( lsmFsEnv(pFS), pCsr->aPg, sizeof(BtreePg) * nNew, &rc ); if( rc==LSM_OK ){ memset(&pCsr->aPg[pCsr->nDepth], 0, sizeof(BtreePg) * 8); } } if( rc==LSM_OK ){ assert( pCsr->aPg[pCsr->nDepth].iCell==0 ); pCsr->aPg[pCsr->nDepth].pPage = pPg; pCsr->nDepth++; iPg = (int)pageGetRecordPtr(aData, nData, 0); } } }while( rc==LSM_OK ); lsmFsPageRelease(pPg); pCsr->iPg = pCsr->nDepth-1; if( rc==LSM_OK && pCsr->nDepth ){ pCsr->aPg[pCsr->iPg].iCell = -1; rc = btreeCursorNext(pCsr); } return rc; } static void btreeCursorPosition(BtreeCursor *pCsr, MergeInput *p){ if( pCsr->iPg>=0 ){ p->iPg = lsmFsPageNumber(pCsr->aPg[pCsr->iPg].pPage); p->iCell = ((pCsr->aPg[pCsr->iPg].iCell + 1) << 8) + pCsr->nDepth; }else{ p->iPg = 0; p->iCell = 0; } } static void btreeCursorSplitkey(BtreeCursor *pCsr, MergeInput *p){ int iCell = pCsr->aPg[pCsr->iPg].iCell; if( iCell>=0 ){ p->iCell = iCell; p->iPg = lsmFsPageNumber(pCsr->aPg[pCsr->iPg].pPage); }else{ int i; for(i=pCsr->iPg-1; i>=0; i--){ if( pCsr->aPg[i].iCell>0 ) break; } assert( i>=0 ); p->iCell = pCsr->aPg[i].iCell-1; p->iPg = lsmFsPageNumber(pCsr->aPg[i].pPage); } } static int sortedKeyCompare( int (*xCmp)(void *, int, void *, int), int iLhsTopic, void *pLhsKey, int nLhsKey, int iRhsTopic, void *pRhsKey, int nRhsKey ){ int res = iLhsTopic - iRhsTopic; if( res==0 ){ res = xCmp(pLhsKey, nLhsKey, pRhsKey, nRhsKey); } return res; } static int btreeCursorRestore( BtreeCursor *pCsr, int (*xCmp)(void *, int, void *, int), MergeInput *p ){ int rc = LSM_OK; if( p->iPg ){ lsm_env *pEnv = lsmFsEnv(pCsr->pFS); int iCell; /* Current cell number on leaf page */ Pgno iLeaf; /* Page number of current leaf page */ int nDepth; /* Depth of b-tree structure */ Segment *pSeg = pCsr->pSeg; /* Decode the MergeInput structure */ iLeaf = p->iPg; nDepth = (p->iCell & 0x00FF); iCell = (p->iCell >> 8) - 1; /* Allocate the BtreeCursor.aPg[] array */ assert( pCsr->aPg==0 ); pCsr->aPg = (BtreePg *)lsmMallocZeroRc(pEnv, sizeof(BtreePg) * nDepth, &rc); /* Populate the last entry of the aPg[] array */ if( rc==LSM_OK ){ Page **pp = &pCsr->aPg[nDepth-1].pPage; pCsr->iPg = nDepth-1; pCsr->nDepth = nDepth; pCsr->aPg[pCsr->iPg].iCell = iCell; rc = lsmFsDbPageGet(pCsr->pFS, pSeg, iLeaf, pp); } /* Populate any other aPg[] array entries */ if( rc==LSM_OK && nDepth>1 ){ Blob blob = {0,0,0}; void *pSeek; int nSeek; int iTopicSeek; int iPg = 0; int iLoad = (int)pSeg->iRoot; Page *pPg = pCsr->aPg[nDepth-1].pPage; if( pageObjGetNRec(pPg)==0 ){ /* This can happen when pPg is the right-most leaf in the b-tree. ** In this case, set the iTopicSeek/pSeek/nSeek key to a value ** greater than any real key. */ assert( iCell==-1 ); iTopicSeek = 1000; pSeek = 0; nSeek = 0; }else{ Pgno dummy; rc = pageGetBtreeKey(pSeg, pPg, 0, &dummy, &iTopicSeek, &pSeek, &nSeek, &pCsr->blob ); } do { Page *pPg2; rc = lsmFsDbPageGet(pCsr->pFS, pSeg, iLoad, &pPg2); assert( rc==LSM_OK || pPg2==0 ); if( rc==LSM_OK ){ u8 *aData; /* Buffer containing page data */ int nData; /* Size of aData[] in bytes */ int iMin; int iMax; int iCell2; aData = fsPageData(pPg2, &nData); assert( (pageGetFlags(aData, nData) & SEGMENT_BTREE_FLAG) ); iLoad = (int)pageGetPtr(aData, nData); iCell2 = pageGetNRec(aData, nData); iMax = iCell2-1; iMin = 0; while( iMax>=iMin ){ int iTry = (iMin+iMax)/2; void *pKey; int nKey; /* Key for cell iTry */ int iTopic; /* Topic for key pKeyT/nKeyT */ Pgno iPtr; /* Pointer for cell iTry */ int res; /* (pSeek - pKeyT) */ rc = pageGetBtreeKey( pSeg, pPg2, iTry, &iPtr, &iTopic, &pKey, &nKey, &blob ); if( rc!=LSM_OK ) break; res = sortedKeyCompare( xCmp, iTopicSeek, pSeek, nSeek, iTopic, pKey, nKey ); assert( res!=0 ); if( res<0 ){ iLoad = (int)iPtr; iCell2 = iTry; iMax = iTry-1; }else{ iMin = iTry+1; } } pCsr->aPg[iPg].pPage = pPg2; pCsr->aPg[iPg].iCell = iCell2; iPg++; assert( iPg!=nDepth-1 || lsmFsRedirectPage(pCsr->pFS, pSeg->pRedirect, iLoad)==iLeaf ); } }while( rc==LSM_OK && iPg<(nDepth-1) ); sortedBlobFree(&blob); } /* Load the current key and pointer */ if( rc==LSM_OK ){ BtreePg *pBtreePg; u8 *aData; int nData; pBtreePg = &pCsr->aPg[pCsr->iPg]; aData = fsPageData(pBtreePg->pPage, &nData); pCsr->iPtr = btreeCursorPtr(aData, nData, pBtreePg->iCell+1); if( pBtreePg->iCell<0 ){ Pgno dummy; int i; for(i=pCsr->iPg-1; i>=0; i--){ if( pCsr->aPg[i].iCell>0 ) break; } assert( i>=0 ); rc = pageGetBtreeKey(pSeg, pCsr->aPg[i].pPage, pCsr->aPg[i].iCell-1, &dummy, &pCsr->eType, &pCsr->pKey, &pCsr->nKey, &pCsr->blob ); pCsr->eType |= LSM_SEPARATOR; }else{ rc = btreeCursorLoadKey(pCsr); } } } return rc; } static int btreeCursorNew( lsm_db *pDb, Segment *pSeg, BtreeCursor **ppCsr ){ int rc = LSM_OK; BtreeCursor *pCsr; assert( pSeg->iRoot ); pCsr = lsmMallocZeroRc(pDb->pEnv, sizeof(BtreeCursor), &rc); if( pCsr ){ pCsr->pFS = pDb->pFS; pCsr->pSeg = pSeg; pCsr->iPg = -1; } *ppCsr = pCsr; return rc; } static void segmentPtrSetPage(SegmentPtr *pPtr, Page *pNext){ lsmFsPageRelease(pPtr->pPg); if( pNext ){ int nData; u8 *aData = fsPageData(pNext, &nData); pPtr->nCell = pageGetNRec(aData, nData); pPtr->flags = (u16)pageGetFlags(aData, nData); pPtr->iPtr = pageGetPtr(aData, nData); } pPtr->pPg = pNext; } /* ** Load a new page into the SegmentPtr object pPtr. */ static int segmentPtrLoadPage( FileSystem *pFS, SegmentPtr *pPtr, /* Load page into this SegmentPtr object */ int iNew /* Page number of new page */ ){ Page *pPg = 0; /* The new page */ int rc; /* Return Code */ rc = lsmFsDbPageGet(pFS, pPtr->pSeg, iNew, &pPg); assert( rc==LSM_OK || pPg==0 ); segmentPtrSetPage(pPtr, pPg); return rc; } static int segmentPtrReadData( SegmentPtr *pPtr, int iOff, int nByte, void **ppData, Blob *pBlob ){ return sortedReadData(pPtr->pSeg, pPtr->pPg, iOff, nByte, ppData, pBlob); } static int segmentPtrNextPage( SegmentPtr *pPtr, /* Load page into this SegmentPtr object */ int eDir /* +1 for next(), -1 for prev() */ ){ Page *pNext; /* New page to load */ int rc; /* Return code */ assert( eDir==1 || eDir==-1 ); assert( pPtr->pPg ); assert( pPtr->pSeg || eDir>0 ); rc = lsmFsDbPageNext(pPtr->pSeg, pPtr->pPg, eDir, &pNext); assert( rc==LSM_OK || pNext==0 ); segmentPtrSetPage(pPtr, pNext); return rc; } static int segmentPtrLoadCell( SegmentPtr *pPtr, /* Load page into this SegmentPtr object */ int iNew /* Cell number of new cell */ ){ int rc = LSM_OK; if( pPtr->pPg ){ u8 *aData; /* Pointer to page data buffer */ int iOff; /* Offset in aData[] to read from */ int nPgsz; /* Size of page (aData[]) in bytes */ assert( iNewnCell ); pPtr->iCell = iNew; aData = fsPageData(pPtr->pPg, &nPgsz); iOff = lsmGetU16(&aData[SEGMENT_CELLPTR_OFFSET(nPgsz, pPtr->iCell)]); pPtr->eType = aData[iOff]; iOff++; iOff += GETVARINT64(&aData[iOff], pPtr->iPgPtr); iOff += GETVARINT32(&aData[iOff], pPtr->nKey); if( rtIsWrite(pPtr->eType) ){ iOff += GETVARINT32(&aData[iOff], pPtr->nVal); } assert( pPtr->nKey>=0 ); rc = segmentPtrReadData( pPtr, iOff, pPtr->nKey, &pPtr->pKey, &pPtr->blob1 ); if( rc==LSM_OK && rtIsWrite(pPtr->eType) ){ rc = segmentPtrReadData( pPtr, iOff+pPtr->nKey, pPtr->nVal, &pPtr->pVal, &pPtr->blob2 ); }else{ pPtr->nVal = 0; pPtr->pVal = 0; } } return rc; } static Segment *sortedSplitkeySegment(Level *pLevel){ Merge *pMerge = pLevel->pMerge; MergeInput *p = &pMerge->splitkey; Segment *pSeg; int i; for(i=0; inInput; i++){ if( p->iPg==pMerge->aInput[i].iPg ) break; } if( pMerge->nInput==(pLevel->nRight+1) && i>=(pMerge->nInput-1) ){ pSeg = &pLevel->pNext->lhs; }else{ pSeg = &pLevel->aRhs[i]; } return pSeg; } static void sortedSplitkey(lsm_db *pDb, Level *pLevel, int *pRc){ Segment *pSeg; Page *pPg = 0; lsm_env *pEnv = pDb->pEnv; /* Environment handle */ int rc = *pRc; Merge *pMerge = pLevel->pMerge; pSeg = sortedSplitkeySegment(pLevel); if( rc==LSM_OK ){ rc = lsmFsDbPageGet(pDb->pFS, pSeg, pMerge->splitkey.iPg, &pPg); } if( rc==LSM_OK ){ int iTopic; Blob blob = {0, 0, 0, 0}; u8 *aData; int nData; aData = lsmFsPageData(pPg, &nData); if( pageGetFlags(aData, nData) & SEGMENT_BTREE_FLAG ){ void *pKey; int nKey; Pgno dummy; rc = pageGetBtreeKey(pSeg, pPg, pMerge->splitkey.iCell, &dummy, &iTopic, &pKey, &nKey, &blob ); if( rc==LSM_OK && blob.pData!=pKey ){ rc = sortedBlobSet(pEnv, &blob, pKey, nKey); } }else{ rc = pageGetKeyCopy( pEnv, pSeg, pPg, pMerge->splitkey.iCell, &iTopic, &blob ); } pLevel->iSplitTopic = iTopic; pLevel->pSplitKey = blob.pData; pLevel->nSplitKey = blob.nData; lsmFsPageRelease(pPg); } *pRc = rc; } /* ** Reset a segment cursor. Also free its buffers if they are nThreshold ** bytes or larger in size. */ static void segmentPtrReset(SegmentPtr *pPtr, int nThreshold){ lsmFsPageRelease(pPtr->pPg); pPtr->pPg = 0; pPtr->nCell = 0; pPtr->pKey = 0; pPtr->nKey = 0; pPtr->pVal = 0; pPtr->nVal = 0; pPtr->eType = 0; pPtr->iCell = 0; if( pPtr->blob1.nAlloc>=nThreshold ) sortedBlobFree(&pPtr->blob1); if( pPtr->blob2.nAlloc>=nThreshold ) sortedBlobFree(&pPtr->blob2); } static int segmentPtrIgnoreSeparators(MultiCursor *pCsr, SegmentPtr *pPtr){ return (pCsr->flags & CURSOR_READ_SEPARATORS)==0 || (pPtr!=&pCsr->aPtr[pCsr->nPtr-1]); } static int segmentPtrAdvance( MultiCursor *pCsr, SegmentPtr *pPtr, int bReverse ){ int eDir = (bReverse ? -1 : 1); Level *pLvl = pPtr->pLevel; do { int rc; int iCell; /* Number of new cell in page */ int svFlags = 0; /* SegmentPtr.eType before advance */ iCell = pPtr->iCell + eDir; assert( pPtr->pPg ); assert( iCell<=pPtr->nCell && iCell>=-1 ); if( bReverse && pPtr->pSeg!=&pPtr->pLevel->lhs ){ svFlags = pPtr->eType; assert( svFlags ); } if( iCell>=pPtr->nCell || iCell<0 ){ do { rc = segmentPtrNextPage(pPtr, eDir); }while( rc==LSM_OK && pPtr->pPg && (pPtr->nCell==0 || (pPtr->flags & SEGMENT_BTREE_FLAG) ) ); if( rc!=LSM_OK ) return rc; iCell = bReverse ? (pPtr->nCell-1) : 0; } rc = segmentPtrLoadCell(pPtr, iCell); if( rc!=LSM_OK ) return rc; if( svFlags && pPtr->pPg ){ int res = sortedKeyCompare(pCsr->pDb->xCmp, rtTopic(pPtr->eType), pPtr->pKey, pPtr->nKey, pLvl->iSplitTopic, pLvl->pSplitKey, pLvl->nSplitKey ); if( res<0 ) segmentPtrReset(pPtr, LSM_SEGMENTPTR_FREE_THRESHOLD); } if( pPtr->pPg==0 && (svFlags & LSM_END_DELETE) ){ Segment *pSeg = pPtr->pSeg; rc = lsmFsDbPageGet(pCsr->pDb->pFS, pSeg, pSeg->iFirst, &pPtr->pPg); if( rc!=LSM_OK ) return rc; pPtr->eType = LSM_START_DELETE | LSM_POINT_DELETE; pPtr->eType |= (pLvl->iSplitTopic ? LSM_SYSTEMKEY : 0); pPtr->pKey = pLvl->pSplitKey; pPtr->nKey = pLvl->nSplitKey; } }while( pCsr && pPtr->pPg && segmentPtrIgnoreSeparators(pCsr, pPtr) && rtIsSeparator(pPtr->eType) ); return LSM_OK; } static void segmentPtrEndPage( FileSystem *pFS, SegmentPtr *pPtr, int bLast, int *pRc ){ if( *pRc==LSM_OK ){ Segment *pSeg = pPtr->pSeg; Page *pNew = 0; if( bLast ){ *pRc = lsmFsDbPageLast(pFS, pSeg, &pNew); }else{ *pRc = lsmFsDbPageGet(pFS, pSeg, pSeg->iFirst, &pNew); } segmentPtrSetPage(pPtr, pNew); } } /* ** Try to move the segment pointer passed as the second argument so that it ** points at either the first (bLast==0) or last (bLast==1) cell in the valid ** region of the segment defined by pPtr->iFirst and pPtr->iLast. ** ** Return LSM_OK if successful or an lsm error code if something goes ** wrong (IO error, OOM etc.). */ static int segmentPtrEnd(MultiCursor *pCsr, SegmentPtr *pPtr, int bLast){ Level *pLvl = pPtr->pLevel; int rc = LSM_OK; FileSystem *pFS = pCsr->pDb->pFS; int bIgnore; segmentPtrEndPage(pFS, pPtr, bLast, &rc); while( rc==LSM_OK && pPtr->pPg && (pPtr->nCell==0 || (pPtr->flags & SEGMENT_BTREE_FLAG)) ){ rc = segmentPtrNextPage(pPtr, (bLast ? -1 : 1)); } if( rc==LSM_OK && pPtr->pPg ){ rc = segmentPtrLoadCell(pPtr, bLast ? (pPtr->nCell-1) : 0); if( rc==LSM_OK && bLast && pPtr->pSeg!=&pLvl->lhs ){ int res = sortedKeyCompare(pCsr->pDb->xCmp, rtTopic(pPtr->eType), pPtr->pKey, pPtr->nKey, pLvl->iSplitTopic, pLvl->pSplitKey, pLvl->nSplitKey ); if( res<0 ) segmentPtrReset(pPtr, LSM_SEGMENTPTR_FREE_THRESHOLD); } } bIgnore = segmentPtrIgnoreSeparators(pCsr, pPtr); if( rc==LSM_OK && pPtr->pPg && bIgnore && rtIsSeparator(pPtr->eType) ){ rc = segmentPtrAdvance(pCsr, pPtr, bLast); } #if 0 if( bLast && rc==LSM_OK && pPtr->pPg && pPtr->pSeg==&pLvl->lhs && pLvl->nRight && (pPtr->eType & LSM_START_DELETE) ){ pPtr->iCell++; pPtr->eType = LSM_END_DELETE | (pLvl->iSplitTopic); pPtr->pKey = pLvl->pSplitKey; pPtr->nKey = pLvl->nSplitKey; pPtr->pVal = 0; pPtr->nVal = 0; } #endif return rc; } static void segmentPtrKey(SegmentPtr *pPtr, void **ppKey, int *pnKey){ assert( pPtr->pPg ); *ppKey = pPtr->pKey; *pnKey = pPtr->nKey; } #if 0 /* NOT USED */ static char *keyToString(lsm_env *pEnv, void *pKey, int nKey){ int i; u8 *aKey = (u8 *)pKey; char *zRet = (char *)lsmMalloc(pEnv, nKey+1); for(i=0; ipDb->pFS); Blob blob = {0, 0, 0}; int eDir; int iTopic = 0; /* TODO: Fix me */ for(eDir=-1; eDir<=1; eDir+=2){ Page *pTest = pPtr->pPg; lsmFsPageRef(pTest); while( pTest ){ Segment *pSeg = pPtr->pSeg; Page *pNext; int rc = lsmFsDbPageNext(pSeg, pTest, eDir, &pNext); lsmFsPageRelease(pTest); if( rc ) return 1; pTest = pNext; if( pTest ){ int nData; u8 *aData = fsPageData(pTest, &nData); int nCell = pageGetNRec(aData, nData); int flags = pageGetFlags(aData, nData); if( nCell && 0==(flags&SEGMENT_BTREE_FLAG) ){ int nPgKey; int iPgTopic; u8 *pPgKey; int res; int iCell; iCell = ((eDir < 0) ? (nCell-1) : 0); pPgKey = pageGetKey(pSeg, pTest, iCell, &iPgTopic, &nPgKey, &blob); res = iTopic - iPgTopic; if( res==0 ) res = pCsr->pDb->xCmp(pKey, nKey, pPgKey, nPgKey); if( (eDir==1 && res>0) || (eDir==-1 && res<0) ){ /* Taking this branch means something has gone wrong. */ char *zMsg = lsmMallocPrintf(pEnv, "Key \"%s\" is not on page %d", keyToString(pEnv, pKey, nKey), lsmFsPageNumber(pPtr->pPg) ); fprintf(stderr, "%s\n", zMsg); assert( !"assertKeyLocation() failed" ); } lsmFsPageRelease(pTest); pTest = 0; } } } } sortedBlobFree(&blob); return 1; } #endif #ifndef NDEBUG static int assertSeekResult( MultiCursor *pCsr, SegmentPtr *pPtr, int iTopic, void *pKey, int nKey, int eSeek ){ if( pPtr->pPg ){ int res; res = sortedKeyCompare(pCsr->pDb->xCmp, iTopic, pKey, nKey, rtTopic(pPtr->eType), pPtr->pKey, pPtr->nKey ); if( eSeek==LSM_SEEK_EQ ) return (res==0); if( eSeek==LSM_SEEK_LE ) return (res>=0); if( eSeek==LSM_SEEK_GE ) return (res<=0); } return 1; } #endif static int segmentPtrSearchOversized( MultiCursor *pCsr, /* Cursor context */ SegmentPtr *pPtr, /* Pointer to seek */ int iTopic, /* Topic of key to search for */ void *pKey, int nKey /* Key to seek to */ ){ int (*xCmp)(void *, int, void *, int) = pCsr->pDb->xCmp; int rc = LSM_OK; /* If the OVERSIZED flag is set, then there is no pointer in the ** upper level to the next page in the segment that contains at least ** one key. So compare the largest key on the current page with the ** key being sought (pKey/nKey). If (pKey/nKey) is larger, advance ** to the next page in the segment that contains at least one key. */ while( rc==LSM_OK && (pPtr->flags & PGFTR_SKIP_NEXT_FLAG) ){ u8 *pLastKey; int nLastKey; int iLastTopic; int res; /* Result of comparison */ Page *pNext; /* Load the last key on the current page. */ pLastKey = pageGetKey(pPtr->pSeg, pPtr->pPg, pPtr->nCell-1, &iLastTopic, &nLastKey, &pPtr->blob1 ); /* If the loaded key is >= than (pKey/nKey), break out of the loop. ** If (pKey/nKey) is present in this array, it must be on the current ** page. */ res = sortedKeyCompare( xCmp, iLastTopic, pLastKey, nLastKey, iTopic, pKey, nKey ); if( res>=0 ) break; /* Advance to the next page that contains at least one key. */ pNext = pPtr->pPg; lsmFsPageRef(pNext); while( 1 ){ Page *pLoad; u8 *aData; int nData; rc = lsmFsDbPageNext(pPtr->pSeg, pNext, 1, &pLoad); lsmFsPageRelease(pNext); pNext = pLoad; if( pNext==0 ) break; assert( rc==LSM_OK ); aData = lsmFsPageData(pNext, &nData); if( (pageGetFlags(aData, nData) & SEGMENT_BTREE_FLAG)==0 && pageGetNRec(aData, nData)>0 ){ break; } } if( pNext==0 ) break; segmentPtrSetPage(pPtr, pNext); /* This should probably be an LSM_CORRUPT error. */ assert( rc!=LSM_OK || (pPtr->flags & PGFTR_SKIP_THIS_FLAG) ); } return rc; } static int ptrFwdPointer( Page *pPage, int iCell, Segment *pSeg, Pgno *piPtr, int *pbFound ){ Page *pPg = pPage; int iFirst = iCell; int rc = LSM_OK; do { Page *pNext = 0; u8 *aData; int nData; aData = lsmFsPageData(pPg, &nData); if( (pageGetFlags(aData, nData) & SEGMENT_BTREE_FLAG)==0 ){ int i; int nCell = pageGetNRec(aData, nData); for(i=iFirst; ipPg && rc==LSM_OK ){ int res = sortedKeyCompare(pCsr->pDb->xCmp, pLvl->iSplitTopic, pLvl->pSplitKey, pLvl->nSplitKey, rtTopic(pPtr->eType), pPtr->pKey, pPtr->nKey ); if( res<=0 ) break; rc = segmentPtrAdvance(pCsr, pPtr, 0); } return rc; } /* ** This function is called as part of a SEEK_GE op on a multi-cursor if the ** FC pointer read from segment *pPtr comes from an entry with the ** LSM_START_DELETE flag set. In this case the pointer value cannot be ** trusted. Instead, the pointer that should be followed is that associated ** with the next entry in *pPtr that does not have LSM_START_DELETE set. ** ** Why the pointers can't be trusted: ** ** ** ** TODO: This is a stop-gap solution: ** ** At the moment, this function is called from within segmentPtrSeek(), ** as part of the initial lsmMCursorSeek() call. However, consider a ** database where the following has occurred: ** ** 1. A range delete removes keys 1..9999 using a range delete. ** 2. Keys 1 through 9999 are reinserted. ** 3. The levels containing the ops in 1. and 2. above are merged. Call ** this level N. Level N contains FC pointers to level N+1. ** ** Then, if the user attempts to query for (key>=2 LIMIT 10), the ** lsmMCursorSeek() call will iterate through 9998 entries searching for a ** pointer down to the level N+1 that is never actually used. It would be ** much better if the multi-cursor could do this lazily - only seek to the ** level (N+1) page after the user has moved the cursor on level N passed ** the big range-delete. */ static int segmentPtrFwdPointer( MultiCursor *pCsr, /* Multi-cursor pPtr belongs to */ SegmentPtr *pPtr, /* Segment-pointer to extract FC ptr from */ Pgno *piPtr /* OUT: FC pointer value */ ){ Level *pLvl = pPtr->pLevel; Level *pNext = pLvl->pNext; Page *pPg = pPtr->pPg; int rc; int bFound; Pgno iOut = 0; if( pPtr->pSeg==&pLvl->lhs || pPtr->pSeg==&pLvl->aRhs[pLvl->nRight-1] ){ if( pNext==0 || (pNext->nRight==0 && pNext->lhs.iRoot) || (pNext->nRight!=0 && pNext->aRhs[0].iRoot) ){ /* Do nothing. The pointer will not be used anyway. */ return LSM_OK; } }else{ if( pPtr[1].pSeg->iRoot ){ return LSM_OK; } } /* Search for a pointer within the current segment. */ lsmFsPageRef(pPg); rc = ptrFwdPointer(pPg, pPtr->iCell, pPtr->pSeg, &iOut, &bFound); if( rc==LSM_OK && bFound==0 ){ /* This case happens when pPtr points to the left-hand-side of a segment ** currently undergoing an incremental merge. In this case, jump to the ** oldest segment in the right-hand-side of the same level and continue ** searching. But - do not consider any keys smaller than the levels ** split-key. */ SegmentPtr ptr; if( pPtr->pLevel->nRight==0 || pPtr->pSeg!=&pPtr->pLevel->lhs ){ return LSM_CORRUPT_BKPT; } memset(&ptr, 0, sizeof(SegmentPtr)); ptr.pLevel = pPtr->pLevel; ptr.pSeg = &ptr.pLevel->aRhs[ptr.pLevel->nRight-1]; rc = sortedRhsFirst(pCsr, ptr.pLevel, &ptr); if( rc==LSM_OK ){ rc = ptrFwdPointer(ptr.pPg, ptr.iCell, ptr.pSeg, &iOut, &bFound); ptr.pPg = 0; } segmentPtrReset(&ptr, 0); } *piPtr = iOut; return rc; } static int segmentPtrSeek( MultiCursor *pCsr, /* Cursor context */ SegmentPtr *pPtr, /* Pointer to seek */ int iTopic, /* Key topic to seek to */ void *pKey, int nKey, /* Key to seek to */ int eSeek, /* Search bias - see above */ int *piPtr, /* OUT: FC pointer */ int *pbStop ){ int (*xCmp)(void *, int, void *, int) = pCsr->pDb->xCmp; int res = 0; /* Result of comparison operation */ int rc = LSM_OK; int iMin; int iMax; Pgno iPtrOut = 0; /* If the current page contains an oversized entry, then there are no ** pointers to one or more of the subsequent pages in the sorted run. ** The following call ensures that the segment-ptr points to the correct ** page in this case. */ rc = segmentPtrSearchOversized(pCsr, pPtr, iTopic, pKey, nKey); iPtrOut = pPtr->iPtr; /* Assert that this page is the right page of this segment for the key ** that we are searching for. Do this by loading page (iPg-1) and testing ** that pKey/nKey is greater than all keys on that page, and then by ** loading (iPg+1) and testing that pKey/nKey is smaller than all ** the keys it houses. ** ** TODO: With range-deletes in the tree, the test described above may fail. */ #if 0 assert( assertKeyLocation(pCsr, pPtr, pKey, nKey) ); #endif assert( pPtr->nCell>0 || pPtr->pSeg->nSize==1 || lsmFsDbPageIsLast(pPtr->pSeg, pPtr->pPg) ); if( pPtr->nCell==0 ){ segmentPtrReset(pPtr, LSM_SEGMENTPTR_FREE_THRESHOLD); }else{ iMin = 0; iMax = pPtr->nCell-1; while( 1 ){ int iTry = (iMin+iMax)/2; void *pKeyT; int nKeyT; /* Key for cell iTry */ int iTopicT; assert( iTryeType); res = sortedKeyCompare(xCmp, iTopicT, pKeyT, nKeyT, iTopic, pKey, nKey); if( res<=0 ){ iPtrOut = pPtr->iPtr + pPtr->iPgPtr; } if( res==0 || iMin==iMax ){ break; }else if( res>0 ){ iMax = LSM_MAX(iTry-1, iMin); }else{ iMin = iTry+1; } } if( rc==LSM_OK ){ assert( res==0 || (iMin==iMax && iMin>=0 && iMinnCell) ); if( res ){ rc = segmentPtrLoadCell(pPtr, iMin); } assert( rc!=LSM_OK || res>0 || iPtrOut==(pPtr->iPtr + pPtr->iPgPtr) ); if( rc==LSM_OK ){ switch( eSeek ){ case LSM_SEEK_EQ: { int eType = pPtr->eType; if( (res<0 && (eType & LSM_START_DELETE)) || (res>0 && (eType & LSM_END_DELETE)) || (res==0 && (eType & LSM_POINT_DELETE)) ){ *pbStop = 1; }else if( res==0 && (eType & LSM_INSERT) ){ lsm_env *pEnv = pCsr->pDb->pEnv; *pbStop = 1; pCsr->eType = pPtr->eType; rc = sortedBlobSet(pEnv, &pCsr->key, pPtr->pKey, pPtr->nKey); if( rc==LSM_OK ){ rc = sortedBlobSet(pEnv, &pCsr->val, pPtr->pVal, pPtr->nVal); } pCsr->flags |= CURSOR_SEEK_EQ; } segmentPtrReset(pPtr, LSM_SEGMENTPTR_FREE_THRESHOLD); break; } case LSM_SEEK_LE: if( res>0 ) rc = segmentPtrAdvance(pCsr, pPtr, 1); break; case LSM_SEEK_GE: { /* Figure out if we need to 'skip' the pointer forward or not */ if( (res<=0 && (pPtr->eType & LSM_START_DELETE)) || (res>0 && (pPtr->eType & LSM_END_DELETE)) ){ rc = segmentPtrFwdPointer(pCsr, pPtr, &iPtrOut); } if( res<0 && rc==LSM_OK ){ rc = segmentPtrAdvance(pCsr, pPtr, 0); } break; } } } } /* If the cursor seek has found a separator key, and this cursor is ** supposed to ignore separators keys, advance to the next entry. */ if( rc==LSM_OK && pPtr->pPg && segmentPtrIgnoreSeparators(pCsr, pPtr) && rtIsSeparator(pPtr->eType) ){ assert( eSeek!=LSM_SEEK_EQ ); rc = segmentPtrAdvance(pCsr, pPtr, eSeek==LSM_SEEK_LE); } } assert( rc!=LSM_OK || assertSeekResult(pCsr,pPtr,iTopic,pKey,nKey,eSeek) ); *piPtr = (int)iPtrOut; return rc; } static int seekInBtree( MultiCursor *pCsr, /* Multi-cursor object */ Segment *pSeg, /* Seek within this segment */ int iTopic, void *pKey, int nKey, /* Key to seek to */ Pgno *aPg, /* OUT: Page numbers */ Page **ppPg /* OUT: Leaf (sorted-run) page reference */ ){ int i = 0; int rc; int iPg; Page *pPg = 0; Blob blob = {0, 0, 0}; iPg = (int)pSeg->iRoot; do { Pgno *piFirst = 0; if( aPg ){ aPg[i++] = iPg; piFirst = &aPg[i]; } rc = lsmFsDbPageGet(pCsr->pDb->pFS, pSeg, iPg, &pPg); assert( rc==LSM_OK || pPg==0 ); if( rc==LSM_OK ){ u8 *aData; /* Buffer containing page data */ int nData; /* Size of aData[] in bytes */ int iMin; int iMax; int nRec; int flags; aData = fsPageData(pPg, &nData); flags = pageGetFlags(aData, nData); if( (flags & SEGMENT_BTREE_FLAG)==0 ) break; iPg = (int)pageGetPtr(aData, nData); nRec = pageGetNRec(aData, nData); iMin = 0; iMax = nRec-1; while( iMax>=iMin ){ int iTry = (iMin+iMax)/2; void *pKeyT; int nKeyT; /* Key for cell iTry */ int iTopicT; /* Topic for key pKeyT/nKeyT */ Pgno iPtr; /* Pointer associated with cell iTry */ int res; /* (pKey - pKeyT) */ rc = pageGetBtreeKey( pSeg, pPg, iTry, &iPtr, &iTopicT, &pKeyT, &nKeyT, &blob ); if( rc!=LSM_OK ) break; if( piFirst && pKeyT==blob.pData ){ *piFirst = pageGetBtreeRef(pPg, iTry); piFirst = 0; i++; } res = sortedKeyCompare( pCsr->pDb->xCmp, iTopic, pKey, nKey, iTopicT, pKeyT, nKeyT ); if( res<0 ){ iPg = (int)iPtr; iMax = iTry-1; }else{ iMin = iTry+1; } } lsmFsPageRelease(pPg); pPg = 0; } }while( rc==LSM_OK ); sortedBlobFree(&blob); assert( (rc==LSM_OK)==(pPg!=0) ); if( ppPg ){ *ppPg = pPg; }else{ lsmFsPageRelease(pPg); } return rc; } static int seekInSegment( MultiCursor *pCsr, SegmentPtr *pPtr, int iTopic, void *pKey, int nKey, int iPg, /* Page to search */ int eSeek, /* Search bias - see above */ int *piPtr, /* OUT: FC pointer */ int *pbStop /* OUT: Stop search flag */ ){ int iPtr = iPg; int rc = LSM_OK; if( pPtr->pSeg->iRoot ){ Page *pPg; assert( pPtr->pSeg->iRoot!=0 ); rc = seekInBtree(pCsr, pPtr->pSeg, iTopic, pKey, nKey, 0, &pPg); if( rc==LSM_OK ) segmentPtrSetPage(pPtr, pPg); }else{ if( iPtr==0 ){ iPtr = (int)pPtr->pSeg->iFirst; } if( rc==LSM_OK ){ rc = segmentPtrLoadPage(pCsr->pDb->pFS, pPtr, iPtr); } } if( rc==LSM_OK ){ rc = segmentPtrSeek(pCsr, pPtr, iTopic, pKey, nKey, eSeek, piPtr, pbStop); } return rc; } /* ** Seek each segment pointer in the array of (pLvl->nRight+1) at aPtr[]. ** ** pbStop: ** This parameter is only significant if parameter eSeek is set to ** LSM_SEEK_EQ. In this case, it is set to true before returning if ** the seek operation is finished. This can happen in two ways: ** ** a) A key matching (pKey/nKey) is found, or ** b) A point-delete or range-delete deleting the key is found. ** ** In case (a), the multi-cursor CURSOR_SEEK_EQ flag is set and the pCsr->key ** and pCsr->val blobs populated before returning. */ static int seekInLevel( MultiCursor *pCsr, /* Sorted cursor object to seek */ SegmentPtr *aPtr, /* Pointer to array of (nRhs+1) SPs */ int eSeek, /* Search bias - see above */ int iTopic, /* Key topic to search for */ void *pKey, int nKey, /* Key to search for */ Pgno *piPgno, /* IN/OUT: fraction cascade pointer (or 0) */ int *pbStop /* OUT: See above */ ){ Level *pLvl = aPtr[0].pLevel; /* Level to seek within */ int rc = LSM_OK; /* Return code */ int iOut = 0; /* Pointer to return to caller */ int res = -1; /* Result of xCmp(pKey, split) */ int nRhs = pLvl->nRight; /* Number of right-hand-side segments */ int bStop = 0; /* If this is a composite level (one currently undergoing an incremental ** merge), figure out if the search key is larger or smaller than the ** levels split-key. */ if( nRhs ){ res = sortedKeyCompare(pCsr->pDb->xCmp, iTopic, pKey, nKey, pLvl->iSplitTopic, pLvl->pSplitKey, pLvl->nSplitKey ); } /* If (res<0), then key pKey/nKey is smaller than the split-key (or this ** is not a composite level and there is no split-key). Search the ** left-hand-side of the level in this case. */ if( res<0 ){ int iPtr = 0; if( nRhs==0 ) iPtr = (int)*piPgno; rc = seekInSegment( pCsr, &aPtr[0], iTopic, pKey, nKey, iPtr, eSeek, &iOut, &bStop ); if( rc==LSM_OK && nRhs>0 && eSeek==LSM_SEEK_GE && aPtr[0].pPg==0 ){ res = 0; } } if( res>=0 ){ int bHit = 0; /* True if at least one rhs is not EOF */ int iPtr = (int)*piPgno; int i; for(i=1; rc==LSM_OK && i<=nRhs && bStop==0; i++){ SegmentPtr *pPtr = &aPtr[i]; iOut = 0; rc = seekInSegment( pCsr, pPtr, iTopic, pKey, nKey, iPtr, eSeek, &iOut, &bStop ); iPtr = iOut; /* If the segment-pointer has settled on a key that is smaller than ** the splitkey, invalidate the segment-pointer. */ if( pPtr->pPg ){ res = sortedKeyCompare(pCsr->pDb->xCmp, rtTopic(pPtr->eType), pPtr->pKey, pPtr->nKey, pLvl->iSplitTopic, pLvl->pSplitKey, pLvl->nSplitKey ); if( res<0 ){ if( pPtr->eType & LSM_START_DELETE ){ pPtr->eType &= ~LSM_INSERT; pPtr->pKey = pLvl->pSplitKey; pPtr->nKey = pLvl->nSplitKey; pPtr->pVal = 0; pPtr->nVal = 0; }else{ segmentPtrReset(pPtr, LSM_SEGMENTPTR_FREE_THRESHOLD); } } } if( aPtr[i].pKey ) bHit = 1; } if( rc==LSM_OK && eSeek==LSM_SEEK_LE && bHit==0 ){ rc = segmentPtrEnd(pCsr, &aPtr[0], 1); } } assert( eSeek==LSM_SEEK_EQ || bStop==0 ); *piPgno = iOut; *pbStop = bStop; return rc; } static void multiCursorGetKey( MultiCursor *pCsr, int iKey, int *peType, /* OUT: Key type (SORTED_WRITE etc.) */ void **ppKey, /* OUT: Pointer to buffer containing key */ int *pnKey /* OUT: Size of *ppKey in bytes */ ){ int nKey = 0; void *pKey = 0; int eType = 0; switch( iKey ){ case CURSOR_DATA_TREE0: case CURSOR_DATA_TREE1: { TreeCursor *pTreeCsr = pCsr->apTreeCsr[iKey-CURSOR_DATA_TREE0]; if( lsmTreeCursorValid(pTreeCsr) ){ lsmTreeCursorKey(pTreeCsr, &eType, &pKey, &nKey); } break; } case CURSOR_DATA_SYSTEM: { Snapshot *pWorker = pCsr->pDb->pWorker; if( pWorker && (pCsr->flags & CURSOR_FLUSH_FREELIST) ){ int nEntry = pWorker->freelist.nEntry; if( pCsr->iFree < (nEntry*2) ){ FreelistEntry *aEntry = pWorker->freelist.aEntry; int i = nEntry - 1 - (pCsr->iFree / 2); u32 iKey2 = 0; if( (pCsr->iFree % 2) ){ eType = LSM_END_DELETE|LSM_SYSTEMKEY; iKey2 = aEntry[i].iBlk-1; }else if( aEntry[i].iId>=0 ){ eType = LSM_INSERT|LSM_SYSTEMKEY; iKey2 = aEntry[i].iBlk; /* If the in-memory entry immediately before this one was a ** DELETE, and the block number is one greater than the current ** block number, mark this entry as an "end-delete-range". */ if( i<(nEntry-1) && aEntry[i+1].iBlk==iKey2+1 && aEntry[i+1].iId<0 ){ eType |= LSM_END_DELETE; } }else{ eType = LSM_START_DELETE|LSM_SYSTEMKEY; iKey2 = aEntry[i].iBlk + 1; } /* If the in-memory entry immediately after this one is a ** DELETE, and the block number is one less than the current ** key, mark this entry as an "start-delete-range". */ if( i>0 && aEntry[i-1].iBlk==iKey2-1 && aEntry[i-1].iId<0 ){ eType |= LSM_START_DELETE; } pKey = pCsr->pSystemVal; nKey = 4; lsmPutU32(pKey, ~iKey2); } } break; } default: { int iPtr = iKey - CURSOR_DATA_SEGMENT; assert( iPtr>=0 ); if( iPtr==pCsr->nPtr ){ if( pCsr->pBtCsr ){ pKey = pCsr->pBtCsr->pKey; nKey = pCsr->pBtCsr->nKey; eType = pCsr->pBtCsr->eType; } }else if( iPtrnPtr ){ SegmentPtr *pPtr = &pCsr->aPtr[iPtr]; if( pPtr->pPg ){ pKey = pPtr->pKey; nKey = pPtr->nKey; eType = pPtr->eType; } } break; } } if( peType ) *peType = eType; if( pnKey ) *pnKey = nKey; if( ppKey ) *ppKey = pKey; } static int sortedDbKeyCompare( MultiCursor *pCsr, int iLhsFlags, void *pLhsKey, int nLhsKey, int iRhsFlags, void *pRhsKey, int nRhsKey ){ int (*xCmp)(void *, int, void *, int) = pCsr->pDb->xCmp; int res; /* Compare the keys, including the system flag. */ res = sortedKeyCompare(xCmp, rtTopic(iLhsFlags), pLhsKey, nLhsKey, rtTopic(iRhsFlags), pRhsKey, nRhsKey ); /* If a key has the LSM_START_DELETE flag set, but not the LSM_INSERT or ** LSM_POINT_DELETE flags, it is considered a delta larger. This prevents ** the beginning of an open-ended set from masking a database entry or ** delete at a lower level. */ if( res==0 && (pCsr->flags & CURSOR_IGNORE_DELETE) ){ const int m = LSM_POINT_DELETE|LSM_INSERT|LSM_END_DELETE |LSM_START_DELETE; int iDel1 = 0; int iDel2 = 0; if( LSM_START_DELETE==(iLhsFlags & m) ) iDel1 = +1; if( LSM_END_DELETE ==(iLhsFlags & m) ) iDel1 = -1; if( LSM_START_DELETE==(iRhsFlags & m) ) iDel2 = +1; if( LSM_END_DELETE ==(iRhsFlags & m) ) iDel2 = -1; res = (iDel1 - iDel2); } return res; } static void multiCursorDoCompare(MultiCursor *pCsr, int iOut, int bReverse){ int i1; int i2; int iRes; void *pKey1; int nKey1; int eType1; void *pKey2; int nKey2; int eType2; const int mul = (bReverse ? -1 : 1); assert( pCsr->aTree && iOutnTree ); if( iOut>=(pCsr->nTree/2) ){ i1 = (iOut - pCsr->nTree/2) * 2; i2 = i1 + 1; }else{ i1 = pCsr->aTree[iOut*2]; i2 = pCsr->aTree[iOut*2+1]; } multiCursorGetKey(pCsr, i1, &eType1, &pKey1, &nKey1); multiCursorGetKey(pCsr, i2, &eType2, &pKey2, &nKey2); if( pKey1==0 ){ iRes = i2; }else if( pKey2==0 ){ iRes = i1; }else{ int res; /* Compare the keys */ res = sortedDbKeyCompare(pCsr, eType1, pKey1, nKey1, eType2, pKey2, nKey2 ); res = res * mul; if( res==0 ){ /* The two keys are identical. Normally, this means that the key from ** the newer run clobbers the old. However, if the newer key is a ** separator key, or a range-delete-boundary only, do not allow it ** to clobber an older entry. */ int nc1 = (eType1 & (LSM_INSERT|LSM_POINT_DELETE))==0; int nc2 = (eType2 & (LSM_INSERT|LSM_POINT_DELETE))==0; iRes = (nc1 > nc2) ? i2 : i1; }else if( res<0 ){ iRes = i1; }else{ iRes = i2; } } pCsr->aTree[iOut] = iRes; } /* ** This function advances segment pointer iPtr belonging to multi-cursor ** pCsr forward (bReverse==0) or backward (bReverse!=0). ** ** If the segment pointer points to a segment that is part of a composite ** level, then the following special case is handled. ** ** * If iPtr is the lhs of a composite level, and the cursor is being ** advanced forwards, and segment iPtr is at EOF, move all pointers ** that correspond to rhs segments of the same level to the first ** key in their respective data. */ static int segmentCursorAdvance( MultiCursor *pCsr, int iPtr, int bReverse ){ int rc; SegmentPtr *pPtr = &pCsr->aPtr[iPtr]; Level *pLvl = pPtr->pLevel; int bComposite; /* True if pPtr is part of composite level */ /* Advance the segment-pointer object. */ rc = segmentPtrAdvance(pCsr, pPtr, bReverse); if( rc!=LSM_OK ) return rc; bComposite = (pLvl->nRight>0 && pCsr->nPtr>pLvl->nRight); if( bComposite && pPtr->pPg==0 ){ int bFix = 0; if( (bReverse==0)==(pPtr->pSeg==&pLvl->lhs) ){ int i; if( bReverse ){ SegmentPtr *pLhs = &pCsr->aPtr[iPtr - 1 - (pPtr->pSeg - pLvl->aRhs)]; for(i=0; inRight; i++){ if( pLhs[i+1].pPg ) break; } if( i==pLvl->nRight ){ bFix = 1; rc = segmentPtrEnd(pCsr, pLhs, 1); } }else{ bFix = 1; for(i=0; rc==LSM_OK && inRight; i++){ rc = sortedRhsFirst(pCsr, pLvl, &pCsr->aPtr[iPtr+1+i]); } } } if( bFix ){ int i; for(i=pCsr->nTree-1; i>0; i--){ multiCursorDoCompare(pCsr, i, bReverse); } } } #if 0 if( bComposite && pPtr->pSeg==&pLvl->lhs /* lhs of composite level */ && bReverse==0 /* csr advanced forwards */ && pPtr->pPg==0 /* segment at EOF */ ){ int i; for(i=0; rc==LSM_OK && inRight; i++){ rc = sortedRhsFirst(pCsr, pLvl, &pCsr->aPtr[iPtr+1+i]); } for(i=pCsr->nTree-1; i>0; i--){ multiCursorDoCompare(pCsr, i, 0); } } #endif return rc; } static void mcursorFreeComponents(MultiCursor *pCsr){ int i; lsm_env *pEnv = pCsr->pDb->pEnv; /* Close the tree cursor, if any. */ lsmTreeCursorDestroy(pCsr->apTreeCsr[0]); lsmTreeCursorDestroy(pCsr->apTreeCsr[1]); /* Reset the segment pointers */ for(i=0; inPtr; i++){ segmentPtrReset(&pCsr->aPtr[i], 0); } /* And the b-tree cursor, if any */ btreeCursorFree(pCsr->pBtCsr); /* Free allocations */ lsmFree(pEnv, pCsr->aPtr); lsmFree(pEnv, pCsr->aTree); lsmFree(pEnv, pCsr->pSystemVal); /* Zero fields */ pCsr->nPtr = 0; pCsr->aPtr = 0; pCsr->nTree = 0; pCsr->aTree = 0; pCsr->pSystemVal = 0; pCsr->apTreeCsr[0] = 0; pCsr->apTreeCsr[1] = 0; pCsr->pBtCsr = 0; } void lsmMCursorFreeCache(lsm_db *pDb){ MultiCursor *p; MultiCursor *pNext; for(p=pDb->pCsrCache; p; p=pNext){ pNext = p->pNext; lsmMCursorClose(p, 0); } pDb->pCsrCache = 0; } /* ** Close the cursor passed as the first argument. ** ** If the bCache parameter is true, then shift the cursor to the pCsrCache ** list for possible reuse instead of actually deleting it. */ void lsmMCursorClose(MultiCursor *pCsr, int bCache){ if( pCsr ){ lsm_db *pDb = pCsr->pDb; MultiCursor **pp; /* Iterator variable */ /* The cursor may or may not be currently part of the linked list ** starting at lsm_db.pCsr. If it is, extract it. */ for(pp=&pDb->pCsr; *pp; pp=&((*pp)->pNext)){ if( *pp==pCsr ){ *pp = pCsr->pNext; break; } } if( bCache ){ int i; /* Used to iterate through segment-pointers */ /* Release any page references held by this cursor. */ assert( !pCsr->pBtCsr ); for(i=0; inPtr; i++){ SegmentPtr *pPtr = &pCsr->aPtr[i]; lsmFsPageRelease(pPtr->pPg); pPtr->pPg = 0; } /* Reset the tree cursors */ lsmTreeCursorReset(pCsr->apTreeCsr[0]); lsmTreeCursorReset(pCsr->apTreeCsr[1]); /* Add the cursor to the pCsrCache list */ pCsr->pNext = pDb->pCsrCache; pDb->pCsrCache = pCsr; }else{ /* Free the allocation used to cache the current key, if any. */ sortedBlobFree(&pCsr->key); sortedBlobFree(&pCsr->val); /* Free the component cursors */ mcursorFreeComponents(pCsr); /* Free the cursor structure itself */ lsmFree(pDb->pEnv, pCsr); } } } #define TREE_NONE 0 #define TREE_OLD 1 #define TREE_BOTH 2 /* ** Parameter eTree is one of TREE_OLD or TREE_BOTH. */ static int multiCursorAddTree(MultiCursor *pCsr, Snapshot *pSnap, int eTree){ int rc = LSM_OK; lsm_db *db = pCsr->pDb; /* Add a tree cursor on the 'old' tree, if it exists. */ if( eTree!=TREE_NONE && lsmTreeHasOld(db) && db->treehdr.iOldLog!=pSnap->iLogOff ){ rc = lsmTreeCursorNew(db, 1, &pCsr->apTreeCsr[1]); } /* Add a tree cursor on the 'current' tree, if required. */ if( rc==LSM_OK && eTree==TREE_BOTH ){ rc = lsmTreeCursorNew(db, 0, &pCsr->apTreeCsr[0]); } return rc; } static int multiCursorAddRhs(MultiCursor *pCsr, Level *pLvl){ int i; int nRhs = pLvl->nRight; assert( pLvl->nRight>0 ); assert( pCsr->aPtr==0 ); pCsr->aPtr = lsmMallocZero(pCsr->pDb->pEnv, sizeof(SegmentPtr) * nRhs); if( !pCsr->aPtr ) return LSM_NOMEM_BKPT; pCsr->nPtr = nRhs; for(i=0; iaPtr[i].pSeg = &pLvl->aRhs[i]; pCsr->aPtr[i].pLevel = pLvl; } return LSM_OK; } static void multiCursorAddOne(MultiCursor *pCsr, Level *pLvl, int *pRc){ if( *pRc==LSM_OK ){ int iPtr = pCsr->nPtr; int i; pCsr->aPtr[iPtr].pLevel = pLvl; pCsr->aPtr[iPtr].pSeg = &pLvl->lhs; iPtr++; for(i=0; inRight; i++){ pCsr->aPtr[iPtr].pLevel = pLvl; pCsr->aPtr[iPtr].pSeg = &pLvl->aRhs[i]; iPtr++; } if( pLvl->nRight && pLvl->pSplitKey==0 ){ sortedSplitkey(pCsr->pDb, pLvl, pRc); } pCsr->nPtr = iPtr; } } static int multiCursorAddAll(MultiCursor *pCsr, Snapshot *pSnap){ Level *pLvl; int nPtr = 0; int rc = LSM_OK; for(pLvl=pSnap->pLevel; pLvl; pLvl=pLvl->pNext){ /* If the LEVEL_INCOMPLETE flag is set, then this function is being ** called (indirectly) from within a sortedNewToplevel() call to ** construct pLvl. In this case ignore pLvl - this cursor is going to ** be used to retrieve a freelist entry from the LSM, and the partially ** complete level may confuse it. */ if( pLvl->flags & LEVEL_INCOMPLETE ) continue; nPtr += (1 + pLvl->nRight); } assert( pCsr->aPtr==0 ); pCsr->aPtr = lsmMallocZeroRc(pCsr->pDb->pEnv, sizeof(SegmentPtr) * nPtr, &rc); for(pLvl=pSnap->pLevel; pLvl; pLvl=pLvl->pNext){ if( (pLvl->flags & LEVEL_INCOMPLETE)==0 ){ multiCursorAddOne(pCsr, pLvl, &rc); } } return rc; } static int multiCursorInit(MultiCursor *pCsr, Snapshot *pSnap){ int rc; rc = multiCursorAddAll(pCsr, pSnap); if( rc==LSM_OK ){ rc = multiCursorAddTree(pCsr, pSnap, TREE_BOTH); } pCsr->flags |= (CURSOR_IGNORE_SYSTEM | CURSOR_IGNORE_DELETE); return rc; } static MultiCursor *multiCursorNew(lsm_db *db, int *pRc){ MultiCursor *pCsr; pCsr = (MultiCursor *)lsmMallocZeroRc(db->pEnv, sizeof(MultiCursor), pRc); if( pCsr ){ pCsr->pNext = db->pCsr; db->pCsr = pCsr; pCsr->pDb = db; } return pCsr; } void lsmSortedRemap(lsm_db *pDb){ MultiCursor *pCsr; for(pCsr=pDb->pCsr; pCsr; pCsr=pCsr->pNext){ int iPtr; if( pCsr->pBtCsr ){ btreeCursorLoadKey(pCsr->pBtCsr); } for(iPtr=0; iPtrnPtr; iPtr++){ segmentPtrLoadCell(&pCsr->aPtr[iPtr], pCsr->aPtr[iPtr].iCell); } } } static void multiCursorReadSeparators(MultiCursor *pCsr){ if( pCsr->nPtr>0 ){ pCsr->flags |= CURSOR_READ_SEPARATORS; } } /* ** Have this cursor skip over SORTED_DELETE entries. */ static void multiCursorIgnoreDelete(MultiCursor *pCsr){ if( pCsr ) pCsr->flags |= CURSOR_IGNORE_DELETE; } /* ** If the free-block list is not empty, then have this cursor visit a key ** with (a) the system bit set, and (b) the key "FREELIST" and (c) a value ** blob containing the serialized free-block list. */ static int multiCursorVisitFreelist(MultiCursor *pCsr){ int rc = LSM_OK; pCsr->flags |= CURSOR_FLUSH_FREELIST; pCsr->pSystemVal = lsmMallocRc(pCsr->pDb->pEnv, 4 + 8, &rc); return rc; } /* ** Allocate and return a new database cursor. ** ** This method should only be called to allocate user cursors. As it may ** recycle a cursor from lsm_db.pCsrCache. */ int lsmMCursorNew( lsm_db *pDb, /* Database handle */ MultiCursor **ppCsr /* OUT: Allocated cursor */ ){ MultiCursor *pCsr = 0; int rc = LSM_OK; if( pDb->pCsrCache ){ int bOld; /* True if there is an old in-memory tree */ /* Remove a cursor from the pCsrCache list and add it to the open list. */ pCsr = pDb->pCsrCache; pDb->pCsrCache = pCsr->pNext; pCsr->pNext = pDb->pCsr; pDb->pCsr = pCsr; /* The cursor can almost be used as is, except that the old in-memory ** tree cursor may be present and not required, or required and not ** present. Fix this if required. */ bOld = (lsmTreeHasOld(pDb) && pDb->treehdr.iOldLog!=pDb->pClient->iLogOff); if( !bOld && pCsr->apTreeCsr[1] ){ lsmTreeCursorDestroy(pCsr->apTreeCsr[1]); pCsr->apTreeCsr[1] = 0; }else if( bOld && !pCsr->apTreeCsr[1] ){ rc = lsmTreeCursorNew(pDb, 1, &pCsr->apTreeCsr[1]); } pCsr->flags = (CURSOR_IGNORE_SYSTEM | CURSOR_IGNORE_DELETE); }else{ pCsr = multiCursorNew(pDb, &rc); if( rc==LSM_OK ) rc = multiCursorInit(pCsr, pDb->pClient); } if( rc!=LSM_OK ){ lsmMCursorClose(pCsr, 0); pCsr = 0; } assert( (rc==LSM_OK)==(pCsr!=0) ); *ppCsr = pCsr; return rc; } static int multiCursorGetVal( MultiCursor *pCsr, int iVal, void **ppVal, int *pnVal ){ int rc = LSM_OK; *ppVal = 0; *pnVal = 0; switch( iVal ){ case CURSOR_DATA_TREE0: case CURSOR_DATA_TREE1: { TreeCursor *pTreeCsr = pCsr->apTreeCsr[iVal-CURSOR_DATA_TREE0]; if( lsmTreeCursorValid(pTreeCsr) ){ lsmTreeCursorValue(pTreeCsr, ppVal, pnVal); }else{ *ppVal = 0; *pnVal = 0; } break; } case CURSOR_DATA_SYSTEM: { Snapshot *pWorker = pCsr->pDb->pWorker; if( pWorker && (pCsr->iFree % 2)==0 && pCsr->iFree < (pWorker->freelist.nEntry*2) ){ int iEntry = pWorker->freelist.nEntry - 1 - (pCsr->iFree / 2); u8 *aVal = &((u8 *)(pCsr->pSystemVal))[4]; lsmPutU64(aVal, pWorker->freelist.aEntry[iEntry].iId); *ppVal = aVal; *pnVal = 8; } break; } default: { int iPtr = iVal-CURSOR_DATA_SEGMENT; if( iPtrnPtr ){ SegmentPtr *pPtr = &pCsr->aPtr[iPtr]; if( pPtr->pPg ){ *ppVal = pPtr->pVal; *pnVal = pPtr->nVal; } } } } assert( rc==LSM_OK || (*ppVal==0 && *pnVal==0) ); return rc; } static int multiCursorAdvance(MultiCursor *pCsr, int bReverse); /* ** This function is called by worker connections to walk the part of the ** free-list stored within the LSM data structure. */ int lsmSortedWalkFreelist( lsm_db *pDb, /* Database handle */ int bReverse, /* True to iterate from largest to smallest */ int (*x)(void *, int, i64), /* Callback function */ void *pCtx /* First argument to pass to callback */ ){ MultiCursor *pCsr; /* Cursor used to read db */ int rc = LSM_OK; /* Return Code */ Snapshot *pSnap = 0; assert( pDb->pWorker ); if( pDb->bIncrMerge ){ rc = lsmCheckpointDeserialize(pDb, 0, pDb->pShmhdr->aSnap1, &pSnap); if( rc!=LSM_OK ) return rc; }else{ pSnap = pDb->pWorker; } pCsr = multiCursorNew(pDb, &rc); if( pCsr ){ rc = multiCursorAddAll(pCsr, pSnap); pCsr->flags |= CURSOR_IGNORE_DELETE; } if( rc==LSM_OK ){ if( bReverse==0 ){ rc = lsmMCursorLast(pCsr); }else{ rc = lsmMCursorSeek(pCsr, 1, "", 0, LSM_SEEK_GE); } while( rc==LSM_OK && lsmMCursorValid(pCsr) && rtIsSystem(pCsr->eType) ){ void *pKey; int nKey; void *pVal = 0; int nVal = 0; rc = lsmMCursorKey(pCsr, &pKey, &nKey); if( rc==LSM_OK ) rc = lsmMCursorValue(pCsr, &pVal, &nVal); if( rc==LSM_OK && (nKey!=4 || nVal!=8) ) rc = LSM_CORRUPT_BKPT; if( rc==LSM_OK ){ int iBlk; i64 iSnap; iBlk = (int)(~(lsmGetU32((u8 *)pKey))); iSnap = (i64)lsmGetU64((u8 *)pVal); if( x(pCtx, iBlk, iSnap) ) break; rc = multiCursorAdvance(pCsr, !bReverse); } } } lsmMCursorClose(pCsr, 0); if( pSnap!=pDb->pWorker ){ lsmFreeSnapshot(pDb->pEnv, pSnap); } return rc; } int lsmSortedLoadFreelist( lsm_db *pDb, /* Database handle (must be worker) */ void **ppVal, /* OUT: Blob containing LSM free-list */ int *pnVal /* OUT: Size of *ppVal blob in bytes */ ){ MultiCursor *pCsr; /* Cursor used to retreive free-list */ int rc = LSM_OK; /* Return Code */ assert( pDb->pWorker ); assert( *ppVal==0 && *pnVal==0 ); pCsr = multiCursorNew(pDb, &rc); if( pCsr ){ rc = multiCursorAddAll(pCsr, pDb->pWorker); pCsr->flags |= CURSOR_IGNORE_DELETE; } if( rc==LSM_OK ){ rc = lsmMCursorLast(pCsr); if( rc==LSM_OK && rtIsWrite(pCsr->eType) && rtIsSystem(pCsr->eType) && pCsr->key.nData==8 && 0==memcmp(pCsr->key.pData, "FREELIST", 8) ){ void *pVal; int nVal; /* Value read from database */ rc = lsmMCursorValue(pCsr, &pVal, &nVal); if( rc==LSM_OK ){ *ppVal = lsmMallocRc(pDb->pEnv, nVal, &rc); if( *ppVal ){ memcpy(*ppVal, pVal, nVal); *pnVal = nVal; } } } lsmMCursorClose(pCsr, 0); } return rc; } static int multiCursorAllocTree(MultiCursor *pCsr){ int rc = LSM_OK; if( pCsr->aTree==0 ){ int nByte; /* Bytes of space to allocate */ int nMin; /* Total number of cursors being merged */ nMin = CURSOR_DATA_SEGMENT + pCsr->nPtr + (pCsr->pBtCsr!=0); pCsr->nTree = 2; while( pCsr->nTreenTree = pCsr->nTree*2; } nByte = sizeof(int)*pCsr->nTree*2; pCsr->aTree = (int *)lsmMallocZeroRc(pCsr->pDb->pEnv, nByte, &rc); } return rc; } static void multiCursorCacheKey(MultiCursor *pCsr, int *pRc){ if( *pRc==LSM_OK ){ void *pKey; int nKey; multiCursorGetKey(pCsr, pCsr->aTree[1], &pCsr->eType, &pKey, &nKey); *pRc = sortedBlobSet(pCsr->pDb->pEnv, &pCsr->key, pKey, nKey); } } #ifdef LSM_DEBUG_EXPENSIVE static void assertCursorTree(MultiCursor *pCsr){ int bRev = !!(pCsr->flags & CURSOR_PREV_OK); int *aSave = pCsr->aTree; int nSave = pCsr->nTree; int rc; pCsr->aTree = 0; pCsr->nTree = 0; rc = multiCursorAllocTree(pCsr); if( rc==LSM_OK ){ int i; for(i=pCsr->nTree-1; i>0; i--){ multiCursorDoCompare(pCsr, i, bRev); } assert( nSave==pCsr->nTree && 0==memcmp(aSave, pCsr->aTree, sizeof(int)*nSave) ); lsmFree(pCsr->pDb->pEnv, pCsr->aTree); } pCsr->aTree = aSave; pCsr->nTree = nSave; } #else # define assertCursorTree(x) #endif static int mcursorLocationOk(MultiCursor *pCsr, int bDeleteOk){ int eType = pCsr->eType; int iKey; int i; int rdmask; assert( pCsr->flags & (CURSOR_NEXT_OK|CURSOR_PREV_OK) ); assertCursorTree(pCsr); rdmask = (pCsr->flags & CURSOR_NEXT_OK) ? LSM_END_DELETE : LSM_START_DELETE; /* If the cursor does not currently point to an actual database key (i.e. ** it points to a delete key, or the start or end of a range-delete), and ** the CURSOR_IGNORE_DELETE flag is set, skip past this entry. */ if( (pCsr->flags & CURSOR_IGNORE_DELETE) && bDeleteOk==0 ){ if( (eType & LSM_INSERT)==0 ) return 0; } /* If the cursor points to a system key (free-list entry), and the ** CURSOR_IGNORE_SYSTEM flag is set, skip thie entry. */ if( (pCsr->flags & CURSOR_IGNORE_SYSTEM) && rtTopic(eType)!=0 ){ return 0; } #ifndef NDEBUG /* This block fires assert() statements to check one of the assumptions ** in the comment below - that if the lhs sub-cursor of a level undergoing ** a merge is valid, then all the rhs sub-cursors must be at EOF. ** ** Also assert that all rhs sub-cursors are either at EOF or point to ** a key that is not less than the level split-key. */ for(i=0; inPtr; i++){ SegmentPtr *pPtr = &pCsr->aPtr[i]; Level *pLvl = pPtr->pLevel; if( pLvl->nRight && pPtr->pPg ){ if( pPtr->pSeg==&pLvl->lhs ){ int j; for(j=0; jnRight; j++) assert( pPtr[j+1].pPg==0 ); }else{ int res = sortedKeyCompare(pCsr->pDb->xCmp, rtTopic(pPtr->eType), pPtr->pKey, pPtr->nKey, pLvl->iSplitTopic, pLvl->pSplitKey, pLvl->nSplitKey ); assert( res>=0 ); } } } #endif /* Now check if this key has already been deleted by a range-delete. If ** so, skip past it. ** ** Assume, for the moment, that the tree contains no levels currently ** undergoing incremental merge, and that this cursor is iterating forwards ** through the database keys. The cursor currently points to a key in ** level L. This key has already been deleted if any of the sub-cursors ** that point to levels newer than L (or to the in-memory tree) point to ** a key greater than the current key with the LSM_END_DELETE flag set. ** ** Or, if the cursor is iterating backwards through data keys, if any ** such sub-cursor points to a key smaller than the current key with the ** LSM_START_DELETE flag set. ** ** Why it works with levels undergoing a merge too: ** ** When a cursor iterates forwards, the sub-cursors for the rhs of a ** level are only activated once the lhs reaches EOF. So when iterating ** forwards, the keys visited are the same as if the level was completely ** merged. ** ** If the cursor is iterating backwards, then the lhs sub-cursor is not ** initialized until the last of the rhs sub-cursors has reached EOF. ** Additionally, if the START_DELETE flag is set on the last entry (in ** reverse order - so the entry with the smallest key) of a rhs sub-cursor, ** then a pseudo-key equal to the levels split-key with the END_DELETE ** flag set is visited by the sub-cursor. */ iKey = pCsr->aTree[1]; for(i=0; iflags & CURSOR_IGNORE_DELETE)==0 ){ void *pKey; int nKey; multiCursorGetKey(pCsr, i, 0, &pKey, &nKey); if( 0==sortedKeyCompare(pCsr->pDb->xCmp, rtTopic(eType), pCsr->key.pData, pCsr->key.nData, rtTopic(csrflags), pKey, nKey )){ continue; } } return 0; } } /* The current cursor position is one this cursor should visit. Return 1. */ return 1; } static int multiCursorSetupTree(MultiCursor *pCsr, int bRev){ int rc; rc = multiCursorAllocTree(pCsr); if( rc==LSM_OK ){ int i; for(i=pCsr->nTree-1; i>0; i--){ multiCursorDoCompare(pCsr, i, bRev); } } assertCursorTree(pCsr); multiCursorCacheKey(pCsr, &rc); if( rc==LSM_OK && mcursorLocationOk(pCsr, 0)==0 ){ rc = multiCursorAdvance(pCsr, bRev); } return rc; } static int multiCursorEnd(MultiCursor *pCsr, int bLast){ int rc = LSM_OK; int i; pCsr->flags &= ~(CURSOR_NEXT_OK | CURSOR_PREV_OK); pCsr->flags |= (bLast ? CURSOR_PREV_OK : CURSOR_NEXT_OK); pCsr->iFree = 0; /* Position the two in-memory tree cursors */ for(i=0; rc==LSM_OK && i<2; i++){ if( pCsr->apTreeCsr[i] ){ rc = lsmTreeCursorEnd(pCsr->apTreeCsr[i], bLast); } } for(i=0; rc==LSM_OK && inPtr; i++){ SegmentPtr *pPtr = &pCsr->aPtr[i]; Level *pLvl = pPtr->pLevel; int iRhs; int bHit = 0; if( bLast ){ for(iRhs=0; iRhsnRight && rc==LSM_OK; iRhs++){ rc = segmentPtrEnd(pCsr, &pPtr[iRhs+1], 1); if( pPtr[iRhs+1].pPg ) bHit = 1; } if( bHit==0 && rc==LSM_OK ){ rc = segmentPtrEnd(pCsr, pPtr, 1); }else{ segmentPtrReset(pPtr, LSM_SEGMENTPTR_FREE_THRESHOLD); } }else{ int bLhs = (pPtr->pSeg==&pLvl->lhs); assert( pPtr->pSeg==&pLvl->lhs || pPtr->pSeg==&pLvl->aRhs[0] ); if( bLhs ){ rc = segmentPtrEnd(pCsr, pPtr, 0); if( pPtr->pKey ) bHit = 1; } for(iRhs=0; iRhsnRight && rc==LSM_OK; iRhs++){ if( bHit ){ segmentPtrReset(&pPtr[iRhs+1], LSM_SEGMENTPTR_FREE_THRESHOLD); }else{ rc = sortedRhsFirst(pCsr, pLvl, &pPtr[iRhs+bLhs]); } } } i += pLvl->nRight; } /* And the b-tree cursor, if applicable */ if( rc==LSM_OK && pCsr->pBtCsr ){ assert( bLast==0 ); rc = btreeCursorFirst(pCsr->pBtCsr); } if( rc==LSM_OK ){ rc = multiCursorSetupTree(pCsr, bLast); } return rc; } int mcursorSave(MultiCursor *pCsr){ int rc = LSM_OK; if( pCsr->aTree ){ int iTree = pCsr->aTree[1]; if( iTree==CURSOR_DATA_TREE0 || iTree==CURSOR_DATA_TREE1 ){ multiCursorCacheKey(pCsr, &rc); } } mcursorFreeComponents(pCsr); return rc; } int mcursorRestore(lsm_db *pDb, MultiCursor *pCsr){ int rc; rc = multiCursorInit(pCsr, pDb->pClient); if( rc==LSM_OK && pCsr->key.pData ){ rc = lsmMCursorSeek(pCsr, rtTopic(pCsr->eType), pCsr->key.pData, pCsr->key.nData, +1 ); } return rc; } int lsmSaveCursors(lsm_db *pDb){ int rc = LSM_OK; MultiCursor *pCsr; for(pCsr=pDb->pCsr; rc==LSM_OK && pCsr; pCsr=pCsr->pNext){ rc = mcursorSave(pCsr); } return rc; } int lsmRestoreCursors(lsm_db *pDb){ int rc = LSM_OK; MultiCursor *pCsr; for(pCsr=pDb->pCsr; rc==LSM_OK && pCsr; pCsr=pCsr->pNext){ rc = mcursorRestore(pDb, pCsr); } return rc; } int lsmMCursorFirst(MultiCursor *pCsr){ return multiCursorEnd(pCsr, 0); } int lsmMCursorLast(MultiCursor *pCsr){ return multiCursorEnd(pCsr, 1); } lsm_db *lsmMCursorDb(MultiCursor *pCsr){ return pCsr->pDb; } void lsmMCursorReset(MultiCursor *pCsr){ int i; lsmTreeCursorReset(pCsr->apTreeCsr[0]); lsmTreeCursorReset(pCsr->apTreeCsr[1]); for(i=0; inPtr; i++){ segmentPtrReset(&pCsr->aPtr[i], LSM_SEGMENTPTR_FREE_THRESHOLD); } pCsr->key.nData = 0; } static int treeCursorSeek( MultiCursor *pCsr, TreeCursor *pTreeCsr, void *pKey, int nKey, int eSeek, int *pbStop ){ int rc = LSM_OK; if( pTreeCsr ){ int res = 0; lsmTreeCursorSeek(pTreeCsr, pKey, nKey, &res); switch( eSeek ){ case LSM_SEEK_EQ: { int eType = lsmTreeCursorFlags(pTreeCsr); if( (res<0 && (eType & LSM_START_DELETE)) || (res>0 && (eType & LSM_END_DELETE)) || (res==0 && (eType & LSM_POINT_DELETE)) ){ *pbStop = 1; }else if( res==0 && (eType & LSM_INSERT) ){ lsm_env *pEnv = pCsr->pDb->pEnv; void *p; int n; /* Key/value from tree-cursor */ *pbStop = 1; pCsr->flags |= CURSOR_SEEK_EQ; rc = lsmTreeCursorKey(pTreeCsr, &pCsr->eType, &p, &n); if( rc==LSM_OK ) rc = sortedBlobSet(pEnv, &pCsr->key, p, n); if( rc==LSM_OK ) rc = lsmTreeCursorValue(pTreeCsr, &p, &n); if( rc==LSM_OK ) rc = sortedBlobSet(pEnv, &pCsr->val, p, n); } lsmTreeCursorReset(pTreeCsr); break; } case LSM_SEEK_GE: if( res<0 && lsmTreeCursorValid(pTreeCsr) ){ lsmTreeCursorNext(pTreeCsr); } break; default: if( res>0 ){ assert( lsmTreeCursorValid(pTreeCsr) ); lsmTreeCursorPrev(pTreeCsr); } break; } } return rc; } /* ** Seek the cursor. */ int lsmMCursorSeek( MultiCursor *pCsr, int iTopic, void *pKey, int nKey, int eSeek ){ int eESeek = eSeek; /* Effective eSeek parameter */ int bStop = 0; /* Set to true to halt search operation */ int rc = LSM_OK; /* Return code */ int iPtr = 0; /* Used to iterate through pCsr->aPtr[] */ Pgno iPgno = 0; /* FC pointer value */ assert( pCsr->apTreeCsr[0]==0 || iTopic==0 ); assert( pCsr->apTreeCsr[1]==0 || iTopic==0 ); if( eESeek==LSM_SEEK_LEFAST ) eESeek = LSM_SEEK_LE; assert( eESeek==LSM_SEEK_EQ || eESeek==LSM_SEEK_LE || eESeek==LSM_SEEK_GE ); assert( (pCsr->flags & CURSOR_FLUSH_FREELIST)==0 ); assert( pCsr->nPtr==0 || pCsr->aPtr[0].pLevel ); pCsr->flags &= ~(CURSOR_NEXT_OK | CURSOR_PREV_OK | CURSOR_SEEK_EQ); rc = treeCursorSeek(pCsr, pCsr->apTreeCsr[0], pKey, nKey, eESeek, &bStop); if( rc==LSM_OK && bStop==0 ){ rc = treeCursorSeek(pCsr, pCsr->apTreeCsr[1], pKey, nKey, eESeek, &bStop); } /* Seek all segment pointers. */ for(iPtr=0; iPtrnPtr && rc==LSM_OK && bStop==0; iPtr++){ SegmentPtr *pPtr = &pCsr->aPtr[iPtr]; assert( pPtr->pSeg==&pPtr->pLevel->lhs ); rc = seekInLevel(pCsr, pPtr, eESeek, iTopic, pKey, nKey, &iPgno, &bStop); iPtr += pPtr->pLevel->nRight; } if( eSeek!=LSM_SEEK_EQ ){ if( rc==LSM_OK ){ rc = multiCursorAllocTree(pCsr); } if( rc==LSM_OK ){ int i; for(i=pCsr->nTree-1; i>0; i--){ multiCursorDoCompare(pCsr, i, eESeek==LSM_SEEK_LE); } if( eSeek==LSM_SEEK_GE ) pCsr->flags |= CURSOR_NEXT_OK; if( eSeek==LSM_SEEK_LE ) pCsr->flags |= CURSOR_PREV_OK; } multiCursorCacheKey(pCsr, &rc); if( rc==LSM_OK && eSeek!=LSM_SEEK_LEFAST && 0==mcursorLocationOk(pCsr, 0) ){ switch( eESeek ){ case LSM_SEEK_EQ: lsmMCursorReset(pCsr); break; case LSM_SEEK_GE: rc = lsmMCursorNext(pCsr); break; default: rc = lsmMCursorPrev(pCsr); break; } } } return rc; } int lsmMCursorValid(MultiCursor *pCsr){ int res = 0; if( pCsr->flags & CURSOR_SEEK_EQ ){ res = 1; }else if( pCsr->aTree ){ int iKey = pCsr->aTree[1]; if( iKey==CURSOR_DATA_TREE0 || iKey==CURSOR_DATA_TREE1 ){ res = lsmTreeCursorValid(pCsr->apTreeCsr[iKey-CURSOR_DATA_TREE0]); }else{ void *pKey; multiCursorGetKey(pCsr, iKey, 0, &pKey, 0); res = pKey!=0; } } return res; } static int mcursorAdvanceOk( MultiCursor *pCsr, int bReverse, int *pRc ){ void *pNew; /* Pointer to buffer containing new key */ int nNew; /* Size of buffer pNew in bytes */ int eNewType; /* Type of new record */ if( *pRc ) return 1; /* Check the current key value. If it is not greater than (if bReverse==0) ** or less than (if bReverse!=0) the key currently cached in pCsr->key, ** then the cursor has not yet been successfully advanced. */ multiCursorGetKey(pCsr, pCsr->aTree[1], &eNewType, &pNew, &nNew); if( pNew ){ int typemask = (pCsr->flags & CURSOR_IGNORE_DELETE) ? ~(0) : LSM_SYSTEMKEY; int res = sortedDbKeyCompare(pCsr, eNewType & typemask, pNew, nNew, pCsr->eType & typemask, pCsr->key.pData, pCsr->key.nData ); if( (bReverse==0 && res<=0) || (bReverse!=0 && res>=0) ){ return 0; } multiCursorCacheKey(pCsr, pRc); assert( pCsr->eType==eNewType ); /* If this cursor is configured to skip deleted keys, and the current ** cursor points to a SORTED_DELETE entry, then the cursor has not been ** successfully advanced. ** ** Similarly, if the cursor is configured to skip system keys and the ** current cursor points to a system key, it has not yet been advanced. */ if( *pRc==LSM_OK && 0==mcursorLocationOk(pCsr, 0) ) return 0; } return 1; } static void flCsrAdvance(MultiCursor *pCsr){ assert( pCsr->flags & CURSOR_FLUSH_FREELIST ); if( pCsr->iFree % 2 ){ pCsr->iFree++; }else{ int nEntry = pCsr->pDb->pWorker->freelist.nEntry; FreelistEntry *aEntry = pCsr->pDb->pWorker->freelist.aEntry; int i = nEntry - 1 - (pCsr->iFree / 2); /* If the current entry is a delete and the "end-delete" key will not ** be attached to the next entry, increment iFree by 1 only. */ if( aEntry[i].iId<0 ){ while( 1 ){ if( i==0 || aEntry[i-1].iBlk!=aEntry[i].iBlk-1 ){ pCsr->iFree--; break; } if( aEntry[i-1].iId>=0 ) break; pCsr->iFree += 2; i--; } } pCsr->iFree += 2; } } static int multiCursorAdvance(MultiCursor *pCsr, int bReverse){ int rc = LSM_OK; /* Return Code */ if( lsmMCursorValid(pCsr) ){ do { int iKey = pCsr->aTree[1]; assertCursorTree(pCsr); /* If this multi-cursor is advancing forwards, and the sub-cursor ** being advanced is the one that separator keys may be being read ** from, record the current absolute pointer value. */ if( pCsr->pPrevMergePtr ){ if( iKey==(CURSOR_DATA_SEGMENT+pCsr->nPtr) ){ assert( pCsr->pBtCsr ); *pCsr->pPrevMergePtr = pCsr->pBtCsr->iPtr; }else if( pCsr->pBtCsr==0 && pCsr->nPtr>0 && iKey==(CURSOR_DATA_SEGMENT+pCsr->nPtr-1) ){ SegmentPtr *pPtr = &pCsr->aPtr[iKey-CURSOR_DATA_SEGMENT]; *pCsr->pPrevMergePtr = pPtr->iPtr+pPtr->iPgPtr; } } if( iKey==CURSOR_DATA_TREE0 || iKey==CURSOR_DATA_TREE1 ){ TreeCursor *pTreeCsr = pCsr->apTreeCsr[iKey-CURSOR_DATA_TREE0]; if( bReverse ){ rc = lsmTreeCursorPrev(pTreeCsr); }else{ rc = lsmTreeCursorNext(pTreeCsr); } }else if( iKey==CURSOR_DATA_SYSTEM ){ assert( pCsr->flags & CURSOR_FLUSH_FREELIST ); assert( bReverse==0 ); flCsrAdvance(pCsr); }else if( iKey==(CURSOR_DATA_SEGMENT+pCsr->nPtr) ){ assert( bReverse==0 && pCsr->pBtCsr ); rc = btreeCursorNext(pCsr->pBtCsr); }else{ rc = segmentCursorAdvance(pCsr, iKey-CURSOR_DATA_SEGMENT, bReverse); } if( rc==LSM_OK ){ int i; for(i=(iKey+pCsr->nTree)/2; i>0; i=i/2){ multiCursorDoCompare(pCsr, i, bReverse); } assertCursorTree(pCsr); } }while( mcursorAdvanceOk(pCsr, bReverse, &rc)==0 ); } return rc; } int lsmMCursorNext(MultiCursor *pCsr){ if( (pCsr->flags & CURSOR_NEXT_OK)==0 ) return LSM_MISUSE_BKPT; return multiCursorAdvance(pCsr, 0); } int lsmMCursorPrev(MultiCursor *pCsr){ if( (pCsr->flags & CURSOR_PREV_OK)==0 ) return LSM_MISUSE_BKPT; return multiCursorAdvance(pCsr, 1); } int lsmMCursorKey(MultiCursor *pCsr, void **ppKey, int *pnKey){ if( (pCsr->flags & CURSOR_SEEK_EQ) || pCsr->aTree==0 ){ *pnKey = pCsr->key.nData; *ppKey = pCsr->key.pData; }else{ int iKey = pCsr->aTree[1]; if( iKey==CURSOR_DATA_TREE0 || iKey==CURSOR_DATA_TREE1 ){ TreeCursor *pTreeCsr = pCsr->apTreeCsr[iKey-CURSOR_DATA_TREE0]; lsmTreeCursorKey(pTreeCsr, 0, ppKey, pnKey); }else{ int nKey; #ifndef NDEBUG void *pKey; int eType; multiCursorGetKey(pCsr, iKey, &eType, &pKey, &nKey); assert( eType==pCsr->eType ); assert( nKey==pCsr->key.nData ); assert( memcmp(pKey, pCsr->key.pData, nKey)==0 ); #endif nKey = pCsr->key.nData; if( nKey==0 ){ *ppKey = 0; }else{ *ppKey = pCsr->key.pData; } *pnKey = nKey; } } return LSM_OK; } /* ** Compare the current key that cursor csr points to with pKey/nKey. Set ** *piRes to the result and return LSM_OK. */ int lsm_csr_cmp(lsm_cursor *csr, const void *pKey, int nKey, int *piRes){ MultiCursor *pCsr = (MultiCursor *)csr; void *pCsrkey; int nCsrkey; int rc; rc = lsmMCursorKey(pCsr, &pCsrkey, &nCsrkey); if( rc==LSM_OK ){ int (*xCmp)(void *, int, void *, int) = pCsr->pDb->xCmp; *piRes = sortedKeyCompare(xCmp, 0, pCsrkey, nCsrkey, 0, (void *)pKey, nKey); } return rc; } int lsmMCursorValue(MultiCursor *pCsr, void **ppVal, int *pnVal){ void *pVal; int nVal; int rc; if( (pCsr->flags & CURSOR_SEEK_EQ) || pCsr->aTree==0 ){ rc = LSM_OK; nVal = pCsr->val.nData; pVal = pCsr->val.pData; }else{ assert( pCsr->aTree ); assert( mcursorLocationOk(pCsr, (pCsr->flags & CURSOR_IGNORE_DELETE)) ); rc = multiCursorGetVal(pCsr, pCsr->aTree[1], &pVal, &nVal); if( pVal && rc==LSM_OK ){ rc = sortedBlobSet(pCsr->pDb->pEnv, &pCsr->val, pVal, nVal); pVal = pCsr->val.pData; } if( rc!=LSM_OK ){ pVal = 0; nVal = 0; } } *ppVal = pVal; *pnVal = nVal; return rc; } int lsmMCursorType(MultiCursor *pCsr, int *peType){ assert( pCsr->aTree ); multiCursorGetKey(pCsr, pCsr->aTree[1], peType, 0, 0); return LSM_OK; } /* ** Buffer aData[], size nData, is assumed to contain a valid b-tree ** hierarchy page image. Return the offset in aData[] of the next free ** byte in the data area (where a new cell may be written if there is ** space). */ static int mergeWorkerPageOffset(u8 *aData, int nData){ int nRec; int iOff; int nKey; int eType; nRec = lsmGetU16(&aData[SEGMENT_NRECORD_OFFSET(nData)]); iOff = lsmGetU16(&aData[SEGMENT_CELLPTR_OFFSET(nData, nRec-1)]); eType = aData[iOff++]; assert( eType==0 || eType==(LSM_SYSTEMKEY|LSM_SEPARATOR) || eType==(LSM_SEPARATOR) ); iOff += lsmVarintGet32(&aData[iOff], &nKey); iOff += lsmVarintGet32(&aData[iOff], &nKey); return iOff + (eType ? nKey : 0); } /* ** Following a checkpoint operation, database pages that are part of the ** checkpointed state of the LSM are deemed read-only. This includes the ** right-most page of the b-tree hierarchy of any separators array under ** construction, and all pages between it and the b-tree root, inclusive. ** This is a problem, as when further pages are appended to the separators ** array, entries must be added to the indicated b-tree hierarchy pages. ** ** This function copies all such b-tree pages to new locations, so that ** they can be modified as required. ** ** The complication is that not all database pages are the same size - due ** to the way the file.c module works some (the first and last in each block) ** are 4 bytes smaller than the others. */ static int mergeWorkerMoveHierarchy( MergeWorker *pMW, /* Merge worker */ int bSep /* True for separators run */ ){ lsm_db *pDb = pMW->pDb; /* Database handle */ int rc = LSM_OK; /* Return code */ int i; Page **apHier = pMW->hier.apHier; int nHier = pMW->hier.nHier; for(i=0; rc==LSM_OK && ipFS, pDb->pWorker, pMW->pLevel, 1, &pNew); assert( rc==LSM_OK ); if( rc==LSM_OK ){ u8 *a1; int n1; u8 *a2; int n2; a1 = fsPageData(pNew, &n1); a2 = fsPageData(apHier[i], &n2); assert( n1==n2 || n1+4==n2 ); if( n1==n2 ){ memcpy(a1, a2, n2); }else{ int nEntry = pageGetNRec(a2, n2); int iEof1 = SEGMENT_EOF(n1, nEntry); int iEof2 = SEGMENT_EOF(n2, nEntry); memcpy(a1, a2, iEof2 - 4); memcpy(&a1[iEof1], &a2[iEof2], n2 - iEof2); } lsmFsPageRelease(apHier[i]); apHier[i] = pNew; #if 0 assert( n1==n2 || n1+4==n2 || n2+4==n1 ); if( n1>=n2 ){ /* If n1 (size of the new page) is equal to or greater than n2 (the ** size of the old page), then copy the data into the new page. If ** n1==n2, this could be done with a single memcpy(). However, ** since sometimes n1>n2, the page content and footer must be copied ** separately. */ int nEntry = pageGetNRec(a2, n2); int iEof1 = SEGMENT_EOF(n1, nEntry); int iEof2 = SEGMENT_EOF(n2, nEntry); memcpy(a1, a2, iEof2); memcpy(&a1[iEof1], &a2[iEof2], n2 - iEof2); lsmFsPageRelease(apHier[i]); apHier[i] = pNew; }else{ lsmPutU16(&a1[SEGMENT_FLAGS_OFFSET(n1)], SEGMENT_BTREE_FLAG); lsmPutU16(&a1[SEGMENT_NRECORD_OFFSET(n1)], 0); lsmPutU64(&a1[SEGMENT_POINTER_OFFSET(n1)], 0); i = i - 1; lsmFsPageRelease(pNew); } #endif } } #ifdef LSM_DEBUG if( rc==LSM_OK ){ for(i=0; ipLevel->lhs; p = &pMW->hier; if( p->apHier==0 && pSeg->iRoot!=0 ){ FileSystem *pFS = pMW->pDb->pFS; lsm_env *pEnv = pMW->pDb->pEnv; Page **apHier = 0; int nHier = 0; int iPg = (int)pSeg->iRoot; do { Page *pPg = 0; u8 *aData; int nData; int flags; rc = lsmFsDbPageGet(pFS, pSeg, iPg, &pPg); if( rc!=LSM_OK ) break; aData = fsPageData(pPg, &nData); flags = pageGetFlags(aData, nData); if( flags&SEGMENT_BTREE_FLAG ){ Page **apNew = (Page **)lsmRealloc( pEnv, apHier, sizeof(Page *)*(nHier+1) ); if( apNew==0 ){ rc = LSM_NOMEM_BKPT; break; } apHier = apNew; memmove(&apHier[1], &apHier[0], sizeof(Page *) * nHier); nHier++; apHier[0] = pPg; iPg = (int)pageGetPtr(aData, nData); }else{ lsmFsPageRelease(pPg); break; } }while( 1 ); if( rc==LSM_OK ){ u8 *aData; int nData; aData = fsPageData(apHier[0], &nData); pMW->aSave[0].iPgno = pageGetPtr(aData, nData); p->nHier = nHier; p->apHier = apHier; rc = mergeWorkerMoveHierarchy(pMW, 0); }else{ int i; for(i=0; ihier; lsm_db *pDb = pMW->pDb; /* Database handle */ int rc = LSM_OK; /* Return Code */ int iLevel; /* Level of b-tree hierachy to write to */ int nData; /* Size of aData[] in bytes */ u8 *aData; /* Page data for level iLevel */ int iOff; /* Offset on b-tree page to write record to */ int nRec; /* Initial number of records on b-tree page */ /* iKeyPg should be zero for an ordinary b-tree key, or non-zero for an ** indirect key. The flags byte for an indirect key is 0x00. */ assert( (eType==0)==(iKeyPg!=0) ); /* The MergeWorker.apHier[] array contains the right-most leaf of the b-tree ** hierarchy, the root node, and all nodes that lie on the path between. ** apHier[0] is the right-most leaf and apHier[pMW->nHier-1] is the current ** root page. ** ** This loop searches for a node with enough space to store the key on, ** starting with the leaf and iterating up towards the root. When the loop ** exits, the key may be written to apHier[iLevel]. */ for(iLevel=0; iLevel<=p->nHier; iLevel++){ int nByte; /* Number of free bytes required */ if( iLevel==p->nHier ){ /* Extend the array and allocate a new root page. */ Page **aNew; aNew = (Page **)lsmRealloc( pMW->pDb->pEnv, p->apHier, sizeof(Page *)*(p->nHier+1) ); if( !aNew ){ return LSM_NOMEM_BKPT; } p->apHier = aNew; }else{ Page *pOld; int nFree; /* If the key will fit on this page, break out of the loop here. ** The new entry will be written to page apHier[iLevel]. */ pOld = p->apHier[iLevel]; assert( lsmFsPageWritable(pOld) ); aData = fsPageData(pOld, &nData); if( eType==0 ){ nByte = 2 + 1 + lsmVarintLen32((int)iPtr) + lsmVarintLen32((int)iKeyPg); }else{ nByte = 2 + 1 + lsmVarintLen32((int)iPtr) + lsmVarintLen32(nKey) + nKey; } nRec = pageGetNRec(aData, nData); nFree = SEGMENT_EOF(nData, nRec) - mergeWorkerPageOffset(aData, nData); if( nByte<=nFree ) break; /* Otherwise, this page is full. Set the right-hand-child pointer ** to iPtr and release it. */ lsmPutU64(&aData[SEGMENT_POINTER_OFFSET(nData)], iPtr); assert( lsmFsPageNumber(pOld)==0 ); rc = lsmFsPagePersist(pOld); if( rc==LSM_OK ){ iPtr = lsmFsPageNumber(pOld); lsmFsPageRelease(pOld); } } /* Allocate a new page for apHier[iLevel]. */ p->apHier[iLevel] = 0; if( rc==LSM_OK ){ rc = lsmFsSortedAppend( pDb->pFS, pDb->pWorker, pMW->pLevel, 1, &p->apHier[iLevel] ); } if( rc!=LSM_OK ) return rc; aData = fsPageData(p->apHier[iLevel], &nData); memset(aData, 0, nData); lsmPutU16(&aData[SEGMENT_FLAGS_OFFSET(nData)], SEGMENT_BTREE_FLAG); lsmPutU16(&aData[SEGMENT_NRECORD_OFFSET(nData)], 0); if( iLevel==p->nHier ){ p->nHier++; break; } } /* Write the key into page apHier[iLevel]. */ aData = fsPageData(p->apHier[iLevel], &nData); iOff = mergeWorkerPageOffset(aData, nData); nRec = pageGetNRec(aData, nData); lsmPutU16(&aData[SEGMENT_CELLPTR_OFFSET(nData, nRec)], (u16)iOff); lsmPutU16(&aData[SEGMENT_NRECORD_OFFSET(nData)], (u16)(nRec+1)); if( eType==0 ){ aData[iOff++] = 0x00; iOff += lsmVarintPut32(&aData[iOff], (int)iPtr); iOff += lsmVarintPut32(&aData[iOff], (int)iKeyPg); }else{ aData[iOff++] = eType; iOff += lsmVarintPut32(&aData[iOff], (int)iPtr); iOff += lsmVarintPut32(&aData[iOff], nKey); memcpy(&aData[iOff], pKey, nKey); } return rc; } static int mergeWorkerBtreeIndirect(MergeWorker *pMW){ int rc = LSM_OK; if( pMW->iIndirect ){ Pgno iKeyPg = pMW->aSave[1].iPgno; rc = mergeWorkerBtreeWrite(pMW, 0, pMW->iIndirect, iKeyPg, 0, 0); pMW->iIndirect = 0; } return rc; } /* ** Append the database key (iTopic/pKey/nKey) to the b-tree under ** construction. This key has not yet been written to a segment page. ** The pointer that will accompany the new key in the b-tree - that ** points to the completed segment page that contains keys smaller than ** (pKey/nKey) is currently stored in pMW->aSave[0].iPgno. */ static int mergeWorkerPushHierarchy( MergeWorker *pMW, /* Merge worker object */ int iTopic, /* Topic value for this key */ void *pKey, /* Pointer to key buffer */ int nKey /* Size of pKey buffer in bytes */ ){ int rc = LSM_OK; /* Return Code */ Pgno iPtr; /* Pointer value to accompany pKey/nKey */ assert( pMW->aSave[0].bStore==0 ); assert( pMW->aSave[1].bStore==0 ); rc = mergeWorkerBtreeIndirect(pMW); /* Obtain the absolute pointer value to store along with the key in the ** page body. This pointer points to a page that contains keys that are ** smaller than pKey/nKey. */ iPtr = pMW->aSave[0].iPgno; assert( iPtr!=0 ); /* Determine if the indirect format should be used. */ if( (nKey*4 > lsmFsPageSize(pMW->pDb->pFS)) ){ pMW->iIndirect = iPtr; pMW->aSave[1].bStore = 1; }else{ rc = mergeWorkerBtreeWrite( pMW, (u8)(iTopic | LSM_SEPARATOR), iPtr, 0, pKey, nKey ); } /* Ensure that the SortedRun.iRoot field is correct. */ return rc; } static int mergeWorkerFinishHierarchy( MergeWorker *pMW /* Merge worker object */ ){ int i; /* Used to loop through apHier[] */ int rc = LSM_OK; /* Return code */ Pgno iPtr; /* New right-hand-child pointer value */ iPtr = pMW->aSave[0].iPgno; for(i=0; ihier.nHier && rc==LSM_OK; i++){ Page *pPg = pMW->hier.apHier[i]; int nData; /* Size of aData[] in bytes */ u8 *aData; /* Page data for pPg */ aData = fsPageData(pPg, &nData); lsmPutU64(&aData[SEGMENT_POINTER_OFFSET(nData)], iPtr); rc = lsmFsPagePersist(pPg); iPtr = lsmFsPageNumber(pPg); lsmFsPageRelease(pPg); } if( pMW->hier.nHier ){ pMW->pLevel->lhs.iRoot = iPtr; lsmFree(pMW->pDb->pEnv, pMW->hier.apHier); pMW->hier.apHier = 0; pMW->hier.nHier = 0; } return rc; } static int mergeWorkerAddPadding( MergeWorker *pMW /* Merge worker object */ ){ FileSystem *pFS = pMW->pDb->pFS; return lsmFsSortedPadding(pFS, pMW->pDb->pWorker, &pMW->pLevel->lhs); } /* ** Release all page references currently held by the merge-worker passed ** as the only argument. Unless an error has occurred, all pages have ** already been released. */ static void mergeWorkerReleaseAll(MergeWorker *pMW){ int i; lsmFsPageRelease(pMW->pPage); pMW->pPage = 0; for(i=0; ihier.nHier; i++){ lsmFsPageRelease(pMW->hier.apHier[i]); pMW->hier.apHier[i] = 0; } lsmFree(pMW->pDb->pEnv, pMW->hier.apHier); pMW->hier.apHier = 0; pMW->hier.nHier = 0; } static int keyszToSkip(FileSystem *pFS, int nKey){ int nPgsz; /* Nominal database page size */ nPgsz = lsmFsPageSize(pFS); return LSM_MIN(((nKey * 4) / nPgsz), 3); } /* ** Release the reference to the current output page of merge-worker *pMW ** (reference pMW->pPage). Set the page number values in aSave[] as ** required (see comments above struct MergeWorker for details). */ static int mergeWorkerPersistAndRelease(MergeWorker *pMW){ int rc; int i; assert( pMW->pPage || (pMW->aSave[0].bStore==0 && pMW->aSave[1].bStore==0) ); /* Persist the page */ rc = lsmFsPagePersist(pMW->pPage); /* If required, save the page number. */ for(i=0; i<2; i++){ if( pMW->aSave[i].bStore ){ pMW->aSave[i].iPgno = lsmFsPageNumber(pMW->pPage); pMW->aSave[i].bStore = 0; } } /* Release the completed output page. */ lsmFsPageRelease(pMW->pPage); pMW->pPage = 0; return rc; } /* ** Advance to the next page of an output run being populated by merge-worker ** pMW. The footer of the new page is initialized to indicate that it contains ** zero records. The flags field is cleared. The page footer pointer field ** is set to iFPtr. ** ** If successful, LSM_OK is returned. Otherwise, an error code. */ static int mergeWorkerNextPage( MergeWorker *pMW, /* Merge worker object to append page to */ Pgno iFPtr /* Pointer value for footer of new page */ ){ int rc = LSM_OK; /* Return code */ Page *pNext = 0; /* New page appended to run */ lsm_db *pDb = pMW->pDb; /* Database handle */ rc = lsmFsSortedAppend(pDb->pFS, pDb->pWorker, pMW->pLevel, 0, &pNext); assert( rc || pMW->pLevel->lhs.iFirst>0 || pMW->pDb->compress.xCompress ); if( rc==LSM_OK ){ u8 *aData; /* Data buffer belonging to page pNext */ int nData; /* Size of aData[] in bytes */ rc = mergeWorkerPersistAndRelease(pMW); pMW->pPage = pNext; pMW->pLevel->pMerge->iOutputOff = 0; aData = fsPageData(pNext, &nData); lsmPutU16(&aData[SEGMENT_NRECORD_OFFSET(nData)], 0); lsmPutU16(&aData[SEGMENT_FLAGS_OFFSET(nData)], 0); lsmPutU64(&aData[SEGMENT_POINTER_OFFSET(nData)], iFPtr); pMW->nWork++; } return rc; } /* ** Write a blob of data into an output segment being populated by a ** merge-worker object. If argument bSep is true, write into the separators ** array. Otherwise, the main array. ** ** This function is used to write the blobs of data for keys and values. */ static int mergeWorkerData( MergeWorker *pMW, /* Merge worker object */ int bSep, /* True to write to separators run */ int iFPtr, /* Footer ptr for new pages */ u8 *aWrite, /* Write data from this buffer */ int nWrite /* Size of aWrite[] in bytes */ ){ int rc = LSM_OK; /* Return code */ int nRem = nWrite; /* Number of bytes still to write */ while( rc==LSM_OK && nRem>0 ){ Merge *pMerge = pMW->pLevel->pMerge; int nCopy; /* Number of bytes to copy */ u8 *aData; /* Pointer to buffer of current output page */ int nData; /* Size of aData[] in bytes */ int nRec; /* Number of records on current output page */ int iOff; /* Offset in aData[] to write to */ assert( lsmFsPageWritable(pMW->pPage) ); aData = fsPageData(pMW->pPage, &nData); nRec = pageGetNRec(aData, nData); iOff = pMerge->iOutputOff; nCopy = LSM_MIN(nRem, SEGMENT_EOF(nData, nRec) - iOff); memcpy(&aData[iOff], &aWrite[nWrite-nRem], nCopy); nRem -= nCopy; if( nRem>0 ){ rc = mergeWorkerNextPage(pMW, iFPtr); }else{ pMerge->iOutputOff = iOff + nCopy; } } return rc; } /* ** The MergeWorker passed as the only argument is working to merge two or ** more existing segments together (not to flush an in-memory tree). It ** has not yet written the first key to the first page of the output. */ static int mergeWorkerFirstPage(MergeWorker *pMW){ int rc = LSM_OK; /* Return code */ Page *pPg = 0; /* First page of run pSeg */ int iFPtr = 0; /* Pointer value read from footer of pPg */ MultiCursor *pCsr = pMW->pCsr; assert( pMW->pPage==0 ); if( pCsr->pBtCsr ){ rc = LSM_OK; iFPtr = (int)pMW->pLevel->pNext->lhs.iFirst; }else if( pCsr->nPtr>0 ){ Segment *pSeg; pSeg = pCsr->aPtr[pCsr->nPtr-1].pSeg; rc = lsmFsDbPageGet(pMW->pDb->pFS, pSeg, pSeg->iFirst, &pPg); if( rc==LSM_OK ){ u8 *aData; /* Buffer for page pPg */ int nData; /* Size of aData[] in bytes */ aData = fsPageData(pPg, &nData); iFPtr = (int)pageGetPtr(aData, nData); lsmFsPageRelease(pPg); } } if( rc==LSM_OK ){ rc = mergeWorkerNextPage(pMW, iFPtr); if( pCsr->pPrevMergePtr ) *pCsr->pPrevMergePtr = iFPtr; pMW->aSave[0].bStore = 1; } return rc; } static int mergeWorkerWrite( MergeWorker *pMW, /* Merge worker object to write into */ int eType, /* One of SORTED_SEPARATOR, WRITE or DELETE */ void *pKey, int nKey, /* Key value */ void *pVal, int nVal, /* Value value */ int iPtr /* Absolute value of page pointer, or 0 */ ){ int rc = LSM_OK; /* Return code */ Merge *pMerge; /* Persistent part of level merge state */ int nHdr; /* Space required for this record header */ Page *pPg; /* Page to write to */ u8 *aData; /* Data buffer for page pWriter->pPage */ int nData = 0; /* Size of buffer aData[] in bytes */ int nRec = 0; /* Number of records on page pPg */ int iFPtr = 0; /* Value of pointer in footer of pPg */ int iRPtr = 0; /* Value of pointer written into record */ int iOff = 0; /* Current write offset within page pPg */ Segment *pSeg; /* Segment being written */ int flags = 0; /* If != 0, flags value for page footer */ int bFirst = 0; /* True for first key of output run */ pMerge = pMW->pLevel->pMerge; pSeg = &pMW->pLevel->lhs; if( pSeg->iFirst==0 && pMW->pPage==0 ){ rc = mergeWorkerFirstPage(pMW); bFirst = 1; } pPg = pMW->pPage; if( pPg ){ aData = fsPageData(pPg, &nData); nRec = pageGetNRec(aData, nData); iFPtr = (int)pageGetPtr(aData, nData); iRPtr = iPtr - iFPtr; } /* Figure out how much space is required by the new record. The space ** required is divided into two sections: the header and the body. The ** header consists of the intial varint fields. The body are the blobs ** of data that correspond to the key and value data. The entire header ** must be stored on the page. The body may overflow onto the next and ** subsequent pages. ** ** The header space is: ** ** 1) record type - 1 byte. ** 2) Page-pointer-offset - 1 varint ** 3) Key size - 1 varint ** 4) Value size - 1 varint (only if LSM_INSERT flag is set) */ if( rc==LSM_OK ){ nHdr = 1 + lsmVarintLen32(iRPtr) + lsmVarintLen32(nKey); if( rtIsWrite(eType) ) nHdr += lsmVarintLen32(nVal); /* If the entire header will not fit on page pPg, or if page pPg is ** marked read-only, advance to the next page of the output run. */ iOff = pMerge->iOutputOff; if( iOff<0 || pPg==0 || iOff+nHdr > SEGMENT_EOF(nData, nRec+1) ){ iFPtr = (int)*pMW->pCsr->pPrevMergePtr; iRPtr = iPtr - iFPtr; iOff = 0; nRec = 0; rc = mergeWorkerNextPage(pMW, iFPtr); pPg = pMW->pPage; } } /* If this record header will be the first on the page, and the page is ** not the very first in the entire run, add a copy of the key to the ** b-tree hierarchy. */ if( rc==LSM_OK && nRec==0 && bFirst==0 ){ assert( pMerge->nSkip>=0 ); if( pMerge->nSkip==0 ){ rc = mergeWorkerPushHierarchy(pMW, rtTopic(eType), pKey, nKey); assert( pMW->aSave[0].bStore==0 ); pMW->aSave[0].bStore = 1; pMerge->nSkip = keyszToSkip(pMW->pDb->pFS, nKey); }else{ pMerge->nSkip--; flags = PGFTR_SKIP_THIS_FLAG; } if( pMerge->nSkip ) flags |= PGFTR_SKIP_NEXT_FLAG; } /* Update the output segment */ if( rc==LSM_OK ){ aData = fsPageData(pPg, &nData); /* Update the page footer. */ lsmPutU16(&aData[SEGMENT_NRECORD_OFFSET(nData)], (u16)(nRec+1)); lsmPutU16(&aData[SEGMENT_CELLPTR_OFFSET(nData, nRec)], (u16)iOff); if( flags ) lsmPutU16(&aData[SEGMENT_FLAGS_OFFSET(nData)], (u16)flags); /* Write the entry header into the current page. */ aData[iOff++] = (u8)eType; /* 1 */ iOff += lsmVarintPut32(&aData[iOff], iRPtr); /* 2 */ iOff += lsmVarintPut32(&aData[iOff], nKey); /* 3 */ if( rtIsWrite(eType) ) iOff += lsmVarintPut32(&aData[iOff], nVal); /* 4 */ pMerge->iOutputOff = iOff; /* Write the key and data into the segment. */ assert( iFPtr==pageGetPtr(aData, nData) ); rc = mergeWorkerData(pMW, 0, iFPtr+iRPtr, pKey, nKey); if( rc==LSM_OK && rtIsWrite(eType) ){ if( rc==LSM_OK ){ rc = mergeWorkerData(pMW, 0, iFPtr+iRPtr, pVal, nVal); } } } return rc; } /* ** Free all resources allocated by mergeWorkerInit(). */ static void mergeWorkerShutdown(MergeWorker *pMW, int *pRc){ int i; /* Iterator variable */ int rc = *pRc; MultiCursor *pCsr = pMW->pCsr; /* Unless the merge has finished, save the cursor position in the ** Merge.aInput[] array. See function mergeWorkerInit() for the ** code to restore a cursor position based on aInput[]. */ if( rc==LSM_OK && pCsr && lsmMCursorValid(pCsr) ){ Merge *pMerge = pMW->pLevel->pMerge; int bBtree = (pCsr->pBtCsr!=0); int iPtr; /* pMerge->nInput==0 indicates that this is a FlushTree() operation. */ assert( pMerge->nInput==0 || pMW->pLevel->nRight>0 ); assert( pMerge->nInput==0 || pMerge->nInput==(pCsr->nPtr+bBtree) ); for(i=0; i<(pMerge->nInput-bBtree); i++){ SegmentPtr *pPtr = &pCsr->aPtr[i]; if( pPtr->pPg ){ pMerge->aInput[i].iPg = lsmFsPageNumber(pPtr->pPg); pMerge->aInput[i].iCell = pPtr->iCell; }else{ pMerge->aInput[i].iPg = 0; pMerge->aInput[i].iCell = 0; } } if( bBtree && pMerge->nInput ){ assert( i==pCsr->nPtr ); btreeCursorPosition(pCsr->pBtCsr, &pMerge->aInput[i]); } /* Store the location of the split-key */ iPtr = pCsr->aTree[1] - CURSOR_DATA_SEGMENT; if( iPtrnPtr ){ pMerge->splitkey = pMerge->aInput[iPtr]; }else{ btreeCursorSplitkey(pCsr->pBtCsr, &pMerge->splitkey); } pMerge->iOutputOff = -1; } lsmMCursorClose(pCsr, 0); /* Persist and release the output page. */ if( rc==LSM_OK ) rc = mergeWorkerPersistAndRelease(pMW); if( rc==LSM_OK ) rc = mergeWorkerBtreeIndirect(pMW); if( rc==LSM_OK ) rc = mergeWorkerFinishHierarchy(pMW); if( rc==LSM_OK ) rc = mergeWorkerAddPadding(pMW); lsmFsFlushWaiting(pMW->pDb->pFS, &rc); mergeWorkerReleaseAll(pMW); lsmFree(pMW->pDb->pEnv, pMW->aGobble); pMW->aGobble = 0; pMW->pCsr = 0; *pRc = rc; } /* ** The cursor passed as the first argument is being used as the input for ** a merge operation. When this function is called, *piFlags contains the ** database entry flags for the current entry. The entry about to be written ** to the output. ** ** Note that this function only has to work for cursors configured to ** iterate forwards (not backwards). */ static void mergeRangeDeletes(MultiCursor *pCsr, int *piVal, int *piFlags){ int f = *piFlags; int iKey = pCsr->aTree[1]; int i; assert( pCsr->flags & CURSOR_NEXT_OK ); if( pCsr->flags & CURSOR_IGNORE_DELETE ){ /* The ignore-delete flag is set when the output of the merge will form ** the oldest level in the database. In this case there is no point in ** retaining any range-delete flags. */ assert( (f & LSM_POINT_DELETE)==0 ); f &= ~(LSM_START_DELETE|LSM_END_DELETE); }else{ for(i=0; i<(CURSOR_DATA_SEGMENT + pCsr->nPtr); i++){ if( i!=iKey ){ int eType; void *pKey; int nKey; int res; multiCursorGetKey(pCsr, i, &eType, &pKey, &nKey); if( pKey ){ res = sortedKeyCompare(pCsr->pDb->xCmp, rtTopic(pCsr->eType), pCsr->key.pData, pCsr->key.nData, rtTopic(eType), pKey, nKey ); assert( res<=0 ); if( res==0 ){ if( (f & (LSM_INSERT|LSM_POINT_DELETE))==0 ){ if( eType & LSM_INSERT ){ f |= LSM_INSERT; *piVal = i; } else if( eType & LSM_POINT_DELETE ){ f |= LSM_POINT_DELETE; } } f |= (eType & (LSM_END_DELETE|LSM_START_DELETE)); } if( i>iKey && (eType & LSM_END_DELETE) && res<0 ){ if( f & (LSM_INSERT|LSM_POINT_DELETE) ){ f |= (LSM_END_DELETE|LSM_START_DELETE); }else{ f = 0; } break; } } } } assert( (f & LSM_INSERT)==0 || (f & LSM_POINT_DELETE)==0 ); if( (f & LSM_START_DELETE) && (f & LSM_END_DELETE) && (f & LSM_POINT_DELETE ) ){ f = 0; } } *piFlags = f; } static int mergeWorkerStep(MergeWorker *pMW){ lsm_db *pDb = pMW->pDb; /* Database handle */ MultiCursor *pCsr; /* Cursor to read input data from */ int rc = LSM_OK; /* Return code */ int eType; /* SORTED_SEPARATOR, WRITE or DELETE */ void *pKey; int nKey; /* Key */ Pgno iPtr; int iVal; pCsr = pMW->pCsr; /* Pull the next record out of the source cursor. */ lsmMCursorKey(pCsr, &pKey, &nKey); eType = pCsr->eType; /* Figure out if the output record may have a different pointer value ** than the previous. This is the case if the current key is identical to ** a key that appears in the lowest level run being merged. If so, set ** iPtr to the absolute pointer value. If not, leave iPtr set to zero, ** indicating that the output pointer value should be a copy of the pointer ** value written with the previous key. */ iPtr = (pCsr->pPrevMergePtr ? *pCsr->pPrevMergePtr : 0); if( pCsr->pBtCsr ){ BtreeCursor *pBtCsr = pCsr->pBtCsr; if( pBtCsr->pKey ){ int res = rtTopic(pBtCsr->eType) - rtTopic(eType); if( res==0 ) res = pDb->xCmp(pBtCsr->pKey, pBtCsr->nKey, pKey, nKey); if( 0==res ) iPtr = pBtCsr->iPtr; assert( res>=0 ); } }else if( pCsr->nPtr ){ SegmentPtr *pPtr = &pCsr->aPtr[pCsr->nPtr-1]; if( pPtr->pPg && 0==pDb->xCmp(pPtr->pKey, pPtr->nKey, pKey, nKey) ){ iPtr = pPtr->iPtr+pPtr->iPgPtr; } } iVal = pCsr->aTree[1]; mergeRangeDeletes(pCsr, &iVal, &eType); if( eType!=0 ){ if( pMW->aGobble ){ int iGobble = pCsr->aTree[1] - CURSOR_DATA_SEGMENT; if( iGobblenPtr && iGobble>=0 ){ SegmentPtr *pGobble = &pCsr->aPtr[iGobble]; if( (pGobble->flags & PGFTR_SKIP_THIS_FLAG)==0 ){ pMW->aGobble[iGobble] = lsmFsPageNumber(pGobble->pPg); } } } /* If this is a separator key and we know that the output pointer has not ** changed, there is no point in writing an output record. Otherwise, ** proceed. */ if( rc==LSM_OK && (rtIsSeparator(eType)==0 || iPtr!=0) ){ /* Write the record into the main run. */ void *pVal; int nVal; rc = multiCursorGetVal(pCsr, iVal, &pVal, &nVal); if( pVal && rc==LSM_OK ){ assert( nVal>=0 ); rc = sortedBlobSet(pDb->pEnv, &pCsr->val, pVal, nVal); pVal = pCsr->val.pData; } if( rc==LSM_OK ){ rc = mergeWorkerWrite(pMW, eType, pKey, nKey, pVal, nVal, (int)iPtr); } } } /* Advance the cursor to the next input record (assuming one exists). */ assert( lsmMCursorValid(pMW->pCsr) ); if( rc==LSM_OK ) rc = lsmMCursorNext(pMW->pCsr); return rc; } static int mergeWorkerDone(MergeWorker *pMW){ return pMW->pCsr==0 || !lsmMCursorValid(pMW->pCsr); } static void sortedFreeLevel(lsm_env *pEnv, Level *p){ if( p ){ lsmFree(pEnv, p->pSplitKey); lsmFree(pEnv, p->pMerge); lsmFree(pEnv, p->aRhs); lsmFree(pEnv, p); } } static void sortedInvokeWorkHook(lsm_db *pDb){ if( pDb->xWork ){ pDb->xWork(pDb, pDb->pWorkCtx); } } static int sortedNewToplevel( lsm_db *pDb, /* Connection handle */ int eTree, /* One of the TREE_XXX constants */ int *pnWrite /* OUT: Number of database pages written */ ){ int rc = LSM_OK; /* Return Code */ MultiCursor *pCsr = 0; Level *pNext = 0; /* The current top level */ Level *pNew; /* The new level itself */ Segment *pLinked = 0; /* Delete separators from this segment */ Level *pDel = 0; /* Delete this entire level */ int nWrite = 0; /* Number of database pages written */ Freelist freelist; if( eTree!=TREE_NONE ){ rc = lsmShmCacheChunks(pDb, pDb->treehdr.nChunk); } assert( pDb->bUseFreelist==0 ); pDb->pFreelist = &freelist; pDb->bUseFreelist = 1; memset(&freelist, 0, sizeof(freelist)); /* Allocate the new level structure to write to. */ pNext = lsmDbSnapshotLevel(pDb->pWorker); pNew = (Level *)lsmMallocZeroRc(pDb->pEnv, sizeof(Level), &rc); if( pNew ){ pNew->pNext = pNext; lsmDbSnapshotSetLevel(pDb->pWorker, pNew); } /* Create a cursor to gather the data required by the new segment. The new ** segment contains everything in the tree and pointers to the next segment ** in the database (if any). */ pCsr = multiCursorNew(pDb, &rc); if( pCsr ){ pCsr->pDb = pDb; rc = multiCursorVisitFreelist(pCsr); if( rc==LSM_OK ){ rc = multiCursorAddTree(pCsr, pDb->pWorker, eTree); } if( rc==LSM_OK && pNext && pNext->pMerge==0 ){ if( (pNext->flags & LEVEL_FREELIST_ONLY) ){ pDel = pNext; pCsr->aPtr = lsmMallocZeroRc(pDb->pEnv, sizeof(SegmentPtr), &rc); multiCursorAddOne(pCsr, pNext, &rc); }else if( eTree!=TREE_NONE && pNext->lhs.iRoot ){ pLinked = &pNext->lhs; rc = btreeCursorNew(pDb, pLinked, &pCsr->pBtCsr); } } /* If this will be the only segment in the database, discard any delete ** markers present in the in-memory tree. */ if( pNext==0 ){ multiCursorIgnoreDelete(pCsr); } } if( rc!=LSM_OK ){ lsmMCursorClose(pCsr, 0); }else{ Pgno iLeftPtr = 0; Merge merge; /* Merge object used to create new level */ MergeWorker mergeworker; /* MergeWorker object for the same purpose */ memset(&merge, 0, sizeof(Merge)); memset(&mergeworker, 0, sizeof(MergeWorker)); pNew->pMerge = &merge; pNew->flags |= LEVEL_INCOMPLETE; mergeworker.pDb = pDb; mergeworker.pLevel = pNew; mergeworker.pCsr = pCsr; pCsr->pPrevMergePtr = &iLeftPtr; /* Mark the separators array for the new level as a "phantom". */ mergeworker.bFlush = 1; /* Do the work to create the new merged segment on disk */ if( rc==LSM_OK ) rc = lsmMCursorFirst(pCsr); while( rc==LSM_OK && mergeWorkerDone(&mergeworker)==0 ){ rc = mergeWorkerStep(&mergeworker); } mergeWorkerShutdown(&mergeworker, &rc); assert( rc!=LSM_OK || mergeworker.nWork==0 || pNew->lhs.iFirst ); if( rc==LSM_OK && pNew->lhs.iFirst ){ rc = lsmFsSortedFinish(pDb->pFS, &pNew->lhs); } nWrite = mergeworker.nWork; pNew->flags &= ~LEVEL_INCOMPLETE; if( eTree==TREE_NONE ){ pNew->flags |= LEVEL_FREELIST_ONLY; } pNew->pMerge = 0; } if( rc!=LSM_OK || pNew->lhs.iFirst==0 ){ assert( rc!=LSM_OK || pDb->pWorker->freelist.nEntry==0 ); lsmDbSnapshotSetLevel(pDb->pWorker, pNext); sortedFreeLevel(pDb->pEnv, pNew); }else{ if( pLinked ){ pLinked->iRoot = 0; }else if( pDel ){ assert( pNew->pNext==pDel ); pNew->pNext = pDel->pNext; lsmFsSortedDelete(pDb->pFS, pDb->pWorker, 1, &pDel->lhs); sortedFreeLevel(pDb->pEnv, pDel); } #if LSM_LOG_STRUCTURE lsmSortedDumpStructure(pDb, pDb->pWorker, LSM_LOG_DATA, 0, "new-toplevel"); #endif if( freelist.nEntry ){ Freelist *p = &pDb->pWorker->freelist; lsmFree(pDb->pEnv, p->aEntry); memcpy(p, &freelist, sizeof(freelist)); freelist.aEntry = 0; }else{ pDb->pWorker->freelist.nEntry = 0; } assertBtreeOk(pDb, &pNew->lhs); sortedInvokeWorkHook(pDb); } if( pnWrite ) *pnWrite = nWrite; pDb->pWorker->nWrite += nWrite; pDb->pFreelist = 0; pDb->bUseFreelist = 0; lsmFree(pDb->pEnv, freelist.aEntry); return rc; } /* ** The nMerge levels in the LSM beginning with pLevel consist of a ** left-hand-side segment only. Replace these levels with a single new ** level consisting of a new empty segment on the left-hand-side and the ** nMerge segments from the replaced levels on the right-hand-side. ** ** Also, allocate and populate a Merge object and set Level.pMerge to ** point to it. */ static int sortedMergeSetup( lsm_db *pDb, /* Database handle */ Level *pLevel, /* First level to merge */ int nMerge, /* Merge this many levels together */ Level **ppNew /* New, merged, level */ ){ int rc = LSM_OK; /* Return Code */ Level *pNew; /* New Level object */ int bUseNext = 0; /* True to link in next separators */ Merge *pMerge; /* New Merge object */ int nByte; /* Bytes of space allocated at pMerge */ #ifdef LSM_DEBUG int iLevel; Level *pX = pLevel; for(iLevel=0; iLevelnRight==0 ); pX = pX->pNext; } #endif /* Allocate the new Level object */ pNew = (Level *)lsmMallocZeroRc(pDb->pEnv, sizeof(Level), &rc); if( pNew ){ pNew->aRhs = (Segment *)lsmMallocZeroRc(pDb->pEnv, nMerge * sizeof(Segment), &rc); } /* Populate the new Level object */ if( rc==LSM_OK ){ Level *pNext = 0; /* Level following pNew */ int i; int bFreeOnly = 1; Level *pTopLevel; Level *p = pLevel; Level **pp; pNew->nRight = nMerge; pNew->iAge = pLevel->iAge+1; for(i=0; inRight==0 ); pNext = p->pNext; pNew->aRhs[i] = p->lhs; if( (p->flags & LEVEL_FREELIST_ONLY)==0 ) bFreeOnly = 0; sortedFreeLevel(pDb->pEnv, p); p = pNext; } if( bFreeOnly ) pNew->flags |= LEVEL_FREELIST_ONLY; /* Replace the old levels with the new. */ pTopLevel = lsmDbSnapshotLevel(pDb->pWorker); pNew->pNext = p; for(pp=&pTopLevel; *pp!=pLevel; pp=&((*pp)->pNext)); *pp = pNew; lsmDbSnapshotSetLevel(pDb->pWorker, pTopLevel); /* Determine whether or not the next separators will be linked in */ if( pNext && pNext->pMerge==0 && pNext->lhs.iRoot && pNext && (bFreeOnly==0 || (pNext->flags & LEVEL_FREELIST_ONLY)) ){ bUseNext = 1; } } /* Allocate the merge object */ nByte = sizeof(Merge) + sizeof(MergeInput) * (nMerge + bUseNext); pMerge = (Merge *)lsmMallocZeroRc(pDb->pEnv, nByte, &rc); if( pMerge ){ pMerge->aInput = (MergeInput *)&pMerge[1]; pMerge->nInput = nMerge + bUseNext; pNew->pMerge = pMerge; } *ppNew = pNew; return rc; } static int mergeWorkerInit( lsm_db *pDb, /* Db connection to do merge work */ Level *pLevel, /* Level to work on merging */ MergeWorker *pMW /* Object to initialize */ ){ int rc = LSM_OK; /* Return code */ Merge *pMerge = pLevel->pMerge; /* Persistent part of merge state */ MultiCursor *pCsr = 0; /* Cursor opened for pMW */ Level *pNext = pLevel->pNext; /* Next level in LSM */ assert( pDb->pWorker ); assert( pLevel->pMerge ); assert( pLevel->nRight>0 ); memset(pMW, 0, sizeof(MergeWorker)); pMW->pDb = pDb; pMW->pLevel = pLevel; pMW->aGobble = lsmMallocZeroRc(pDb->pEnv, sizeof(Pgno) * pLevel->nRight, &rc); /* Create a multi-cursor to read the data to write to the new ** segment. The new segment contains: ** ** 1. Records from LHS of each of the nMerge levels being merged. ** 2. Separators from either the last level being merged, or the ** separators attached to the LHS of the following level, or neither. ** ** If the new level is the lowest (oldest) in the db, discard any ** delete keys. Key annihilation. */ pCsr = multiCursorNew(pDb, &rc); if( pCsr ){ pCsr->flags |= CURSOR_NEXT_OK; rc = multiCursorAddRhs(pCsr, pLevel); } if( rc==LSM_OK && pMerge->nInput > pLevel->nRight ){ rc = btreeCursorNew(pDb, &pNext->lhs, &pCsr->pBtCsr); }else if( pNext ){ multiCursorReadSeparators(pCsr); }else{ multiCursorIgnoreDelete(pCsr); } assert( rc!=LSM_OK || pMerge->nInput==(pCsr->nPtr+(pCsr->pBtCsr!=0)) ); pMW->pCsr = pCsr; /* Load the b-tree hierarchy into memory. */ if( rc==LSM_OK ) rc = mergeWorkerLoadHierarchy(pMW); if( rc==LSM_OK && pMW->hier.nHier==0 ){ pMW->aSave[0].iPgno = pLevel->lhs.iFirst; } /* Position the cursor. */ if( rc==LSM_OK ){ pCsr->pPrevMergePtr = &pMerge->iCurrentPtr; if( pLevel->lhs.iFirst==0 ){ /* The output array is still empty. So position the cursor at the very ** start of the input. */ rc = multiCursorEnd(pCsr, 0); }else{ /* The output array is non-empty. Position the cursor based on the ** page/cell data saved in the Merge.aInput[] array. */ int i; for(i=0; rc==LSM_OK && inPtr; i++){ MergeInput *pInput = &pMerge->aInput[i]; if( pInput->iPg ){ SegmentPtr *pPtr; assert( pCsr->aPtr[i].pPg==0 ); pPtr = &pCsr->aPtr[i]; rc = segmentPtrLoadPage(pDb->pFS, pPtr, (int)pInput->iPg); if( rc==LSM_OK && pPtr->nCell>0 ){ rc = segmentPtrLoadCell(pPtr, pInput->iCell); } } } if( rc==LSM_OK && pCsr->pBtCsr ){ int (*xCmp)(void *, int, void *, int) = pCsr->pDb->xCmp; assert( i==pCsr->nPtr ); rc = btreeCursorRestore(pCsr->pBtCsr, xCmp, &pMerge->aInput[i]); } if( rc==LSM_OK ){ rc = multiCursorSetupTree(pCsr, 0); } } pCsr->flags |= CURSOR_NEXT_OK; } return rc; } static int sortedBtreeGobble( lsm_db *pDb, /* Worker connection */ MultiCursor *pCsr, /* Multi-cursor being used for a merge */ int iGobble /* pCsr->aPtr[] entry to operate on */ ){ int rc = LSM_OK; if( rtTopic(pCsr->eType)==0 ){ Segment *pSeg = pCsr->aPtr[iGobble].pSeg; Pgno *aPg; int nPg; /* Seek from the root of the b-tree to the segment leaf that may contain ** a key equal to the one multi-cursor currently points to. Record the ** page number of each b-tree page and the leaf. The segment may be ** gobbled up to (but not including) the first of these page numbers. */ assert( pSeg->iRoot>0 ); aPg = lsmMallocZeroRc(pDb->pEnv, sizeof(Pgno)*32, &rc); if( rc==LSM_OK ){ rc = seekInBtree(pCsr, pSeg, rtTopic(pCsr->eType), pCsr->key.pData, pCsr->key.nData, aPg, 0 ); } if( rc==LSM_OK ){ for(nPg=0; aPg[nPg]; nPg++); lsmFsGobble(pDb, pSeg, aPg, nPg); } lsmFree(pDb->pEnv, aPg); } return rc; } /* ** Argument p points to a level of age N. Return the number of levels in ** the linked list starting at p that have age=N (always at least 1). */ static int sortedCountLevels(Level *p){ int iAge = p->iAge; int nRet = 0; do { nRet++; p = p->pNext; }while( p && p->iAge==iAge ); return nRet; } static int sortedSelectLevel(lsm_db *pDb, int nMerge, Level **ppOut){ Level *pTopLevel = lsmDbSnapshotLevel(pDb->pWorker); int rc = LSM_OK; Level *pLevel = 0; /* Output value */ Level *pBest = 0; /* Best level to work on found so far */ int nBest; /* Number of segments merged at pBest */ Level *pThis = 0; /* First in run of levels with age=iAge */ int nThis = 0; /* Number of levels starting at pThis */ assert( nMerge>=1 ); nBest = LSM_MAX(1, nMerge-1); /* Find the longest contiguous run of levels not currently undergoing a ** merge with the same age in the structure. Or the level being merged ** with the largest number of right-hand segments. Work on it. */ for(pLevel=pTopLevel; pLevel; pLevel=pLevel->pNext){ if( pLevel->nRight==0 && pThis && pLevel->iAge==pThis->iAge ){ nThis++; }else{ if( nThis>nBest ){ if( (pLevel->iAge!=pThis->iAge+1) || (pLevel->nRight==0 && sortedCountLevels(pLevel)<=pDb->nMerge) ){ pBest = pThis; nBest = nThis; } } if( pLevel->nRight ){ if( pLevel->nRight>nBest ){ nBest = pLevel->nRight; pBest = pLevel; } nThis = 0; pThis = 0; }else{ pThis = pLevel; nThis = 1; } } } if( nThis>nBest ){ assert( pThis ); pBest = pThis; nBest = nThis; } if( pBest==0 && nMerge==1 ){ int nFree = 0; int nUsr = 0; for(pLevel=pTopLevel; pLevel; pLevel=pLevel->pNext){ assert( !pLevel->nRight ); if( pLevel->flags & LEVEL_FREELIST_ONLY ){ nFree++; }else{ nUsr++; } } if( nUsr>1 ){ pBest = pTopLevel; nBest = nFree + nUsr; } } if( pBest ){ if( pBest->nRight==0 ){ rc = sortedMergeSetup(pDb, pBest, nBest, ppOut); }else{ *ppOut = pBest; } } return rc; } static int sortedDbIsFull(lsm_db *pDb){ Level *pTop = lsmDbSnapshotLevel(pDb->pWorker); if( lsmDatabaseFull(pDb) ) return 1; if( pTop && pTop->iAge==0 && (pTop->nRight || sortedCountLevels(pTop)>=pDb->nMerge) ){ return 1; } return 0; } typedef struct MoveBlockCtx MoveBlockCtx; struct MoveBlockCtx { int iSeen; /* Previous free block on list */ int iFrom; /* Total number of blocks in file */ }; static int moveBlockCb(void *pCtx, int iBlk, i64 iSnapshot){ MoveBlockCtx *p = (MoveBlockCtx *)pCtx; assert( p->iFrom==0 ); if( iBlk==(p->iSeen-1) ){ p->iSeen = iBlk; return 0; } p->iFrom = p->iSeen-1; return 1; } /* ** This function is called to further compact a database for which all ** of the content has already been merged into a single segment. If ** possible, it moves the contents of a single block from the end of the ** file to a free-block that lies closer to the start of the file (allowing ** the file to be eventually truncated). */ static int sortedMoveBlock(lsm_db *pDb, int *pnWrite){ Snapshot *p = pDb->pWorker; Level *pLvl = lsmDbSnapshotLevel(p); int iFrom; /* Block to move */ int iTo; /* Destination to move block to */ int rc; /* Return code */ MoveBlockCtx sCtx; assert( pLvl->pNext==0 && pLvl->nRight==0 ); assert( p->redirect.n<=LSM_MAX_BLOCK_REDIRECTS ); *pnWrite = 0; /* Check that the redirect array is not already full. If it is, return ** without moving any database content. */ if( p->redirect.n>=LSM_MAX_BLOCK_REDIRECTS ) return LSM_OK; /* Find the last block of content in the database file. Do this by ** traversing the free-list in reverse (descending block number) order. ** The first block not on the free list is the one that will be moved. ** Since the db consists of a single segment, there is no ambiguity as ** to which segment the block belongs to. */ sCtx.iSeen = p->nBlock+1; sCtx.iFrom = 0; rc = lsmWalkFreelist(pDb, 1, moveBlockCb, &sCtx); if( rc!=LSM_OK || sCtx.iFrom==0 ) return rc; iFrom = sCtx.iFrom; /* Find the first free block in the database, ignoring block 1. Block ** 1 is tricky as it is smaller than the other blocks. */ rc = lsmBlockAllocate(pDb, iFrom, &iTo); if( rc!=LSM_OK || iTo==0 ) return rc; assert( iTo!=1 && iTopFS, &pLvl->lhs, iTo, iFrom); if( rc==LSM_OK ){ if( p->redirect.a==0 ){ int nByte = sizeof(struct RedirectEntry) * LSM_MAX_BLOCK_REDIRECTS; p->redirect.a = lsmMallocZeroRc(pDb->pEnv, nByte, &rc); } if( rc==LSM_OK ){ /* Check if the block just moved was already redirected. */ int i; for(i=0; iredirect.n; i++){ if( p->redirect.a[i].iTo==iFrom ) break; } if( i==p->redirect.n ){ /* Block iFrom was not already redirected. Add a new array entry. */ memmove(&p->redirect.a[1], &p->redirect.a[0], sizeof(struct RedirectEntry) * p->redirect.n ); p->redirect.a[0].iFrom = iFrom; p->redirect.a[0].iTo = iTo; p->redirect.n++; }else{ /* Block iFrom was already redirected. Overwrite existing entry. */ p->redirect.a[i].iTo = iTo; } rc = lsmBlockFree(pDb, iFrom); *pnWrite = lsmFsBlockSize(pDb->pFS) / lsmFsPageSize(pDb->pFS); pLvl->lhs.pRedirect = &p->redirect; } } #if LSM_LOG_STRUCTURE if( rc==LSM_OK ){ char aBuf[64]; sprintf(aBuf, "move-block %d/%d", p->redirect.n-1, LSM_MAX_BLOCK_REDIRECTS); lsmSortedDumpStructure(pDb, pDb->pWorker, LSM_LOG_DATA, 0, aBuf); } #endif return rc; } /* */ static int mergeInsertFreelistSegments( lsm_db *pDb, int nFree, MergeWorker *pMW ){ int rc = LSM_OK; if( nFree>0 ){ MultiCursor *pCsr = pMW->pCsr; Level *pLvl = pMW->pLevel; SegmentPtr *aNew1; Segment *aNew2; Level *pIter; Level *pNext; int i = 0; aNew1 = (SegmentPtr *)lsmMallocZeroRc( pDb->pEnv, sizeof(SegmentPtr) * (pCsr->nPtr+nFree), &rc ); if( rc ) return rc; memcpy(&aNew1[nFree], pCsr->aPtr, sizeof(SegmentPtr)*pCsr->nPtr); pCsr->nPtr += nFree; lsmFree(pDb->pEnv, pCsr->aTree); lsmFree(pDb->pEnv, pCsr->aPtr); pCsr->aTree = 0; pCsr->aPtr = aNew1; aNew2 = (Segment *)lsmMallocZeroRc( pDb->pEnv, sizeof(Segment) * (pLvl->nRight+nFree), &rc ); if( rc ) return rc; memcpy(&aNew2[nFree], pLvl->aRhs, sizeof(Segment)*pLvl->nRight); pLvl->nRight += nFree; lsmFree(pDb->pEnv, pLvl->aRhs); pLvl->aRhs = aNew2; for(pIter=pDb->pWorker->pLevel; rc==LSM_OK && pIter!=pLvl; pIter=pNext){ Segment *pSeg = &pLvl->aRhs[i]; memcpy(pSeg, &pIter->lhs, sizeof(Segment)); pCsr->aPtr[i].pSeg = pSeg; pCsr->aPtr[i].pLevel = pLvl; rc = segmentPtrEnd(pCsr, &pCsr->aPtr[i], 0); pDb->pWorker->pLevel = pNext = pIter->pNext; sortedFreeLevel(pDb->pEnv, pIter); i++; } assert( i==nFree ); assert( rc!=LSM_OK || pDb->pWorker->pLevel==pLvl ); for(i=nFree; inPtr; i++){ pCsr->aPtr[i].pSeg = &pLvl->aRhs[i]; } lsmFree(pDb->pEnv, pMW->aGobble); pMW->aGobble = 0; } return rc; } static int sortedWork( lsm_db *pDb, /* Database handle. Must be worker. */ int nWork, /* Number of pages of work to do */ int nMerge, /* Try to merge this many levels at once */ int bFlush, /* Set if call is to make room for a flush */ int *pnWrite /* OUT: Actual number of pages written */ ){ int rc = LSM_OK; /* Return Code */ int nRemaining = nWork; /* Units of work to do before returning */ Snapshot *pWorker = pDb->pWorker; assert( pWorker ); if( lsmDbSnapshotLevel(pWorker)==0 ) return LSM_OK; while( nRemaining>0 ){ Level *pLevel = 0; /* Find a level to work on. */ rc = sortedSelectLevel(pDb, nMerge, &pLevel); assert( rc==LSM_OK || pLevel==0 ); if( pLevel==0 ){ int nDone = 0; Level *pTopLevel = lsmDbSnapshotLevel(pDb->pWorker); if( bFlush==0 && nMerge==1 && pTopLevel && pTopLevel->pNext==0 ){ rc = sortedMoveBlock(pDb, &nDone); } nRemaining -= nDone; /* Could not find any work to do. Finished. */ if( nDone==0 ) break; }else{ int bSave = 0; Freelist freelist = {0, 0, 0}; MergeWorker mergeworker; /* State used to work on the level merge */ assert( pDb->bIncrMerge==0 ); assert( pDb->pFreelist==0 && pDb->bUseFreelist==0 ); pDb->bIncrMerge = 1; rc = mergeWorkerInit(pDb, pLevel, &mergeworker); assert( mergeworker.nWork==0 ); while( rc==LSM_OK && 0==mergeWorkerDone(&mergeworker) && (mergeworker.nWorkbUseFreelist) ){ int eType = rtTopic(mergeworker.pCsr->eType); rc = mergeWorkerStep(&mergeworker); /* If the cursor now points at the first entry past the end of the ** user data (i.e. either to EOF or to the first free-list entry ** that will be added to the run), then check if it is possible to ** merge in any free-list entries that are either in-memory or in ** free-list-only blocks. */ if( rc==LSM_OK && nMerge==1 && eType==0 && (rtTopic(mergeworker.pCsr->eType) || mergeWorkerDone(&mergeworker)) ){ int nFree = 0; /* Number of free-list-only levels to merge */ Level *pLvl; assert( pDb->pFreelist==0 && pDb->bUseFreelist==0 ); /* Now check if all levels containing data newer than this one ** are single-segment free-list only levels. If so, they will be ** merged in now. */ for(pLvl=pDb->pWorker->pLevel; pLvl!=mergeworker.pLevel && (pLvl->flags & LEVEL_FREELIST_ONLY); pLvl=pLvl->pNext ){ assert( pLvl->nRight==0 ); nFree++; } if( pLvl==mergeworker.pLevel ){ rc = mergeInsertFreelistSegments(pDb, nFree, &mergeworker); if( rc==LSM_OK ){ rc = multiCursorVisitFreelist(mergeworker.pCsr); } if( rc==LSM_OK ){ rc = multiCursorSetupTree(mergeworker.pCsr, 0); pDb->pFreelist = &freelist; pDb->bUseFreelist = 1; } } } } nRemaining -= LSM_MAX(mergeworker.nWork, 1); if( rc==LSM_OK ){ /* Check if the merge operation is completely finished. If not, ** gobble up (declare eligible for recycling) any pages from rhs ** segments for which the content has been completely merged into ** the lhs of the level. */ if( mergeWorkerDone(&mergeworker)==0 ){ int i; for(i=0; inRight; i++){ SegmentPtr *pGobble = &mergeworker.pCsr->aPtr[i]; if( pGobble->pSeg->iRoot ){ rc = sortedBtreeGobble(pDb, mergeworker.pCsr, i); }else if( mergeworker.aGobble[i] ){ lsmFsGobble(pDb, pGobble->pSeg, &mergeworker.aGobble[i], 1); } } }else{ int i; int bEmpty; mergeWorkerShutdown(&mergeworker, &rc); bEmpty = (pLevel->lhs.iFirst==0); if( bEmpty==0 && rc==LSM_OK ){ rc = lsmFsSortedFinish(pDb->pFS, &pLevel->lhs); } if( pDb->bUseFreelist ){ Freelist *p = &pDb->pWorker->freelist; lsmFree(pDb->pEnv, p->aEntry); memcpy(p, &freelist, sizeof(freelist)); pDb->bUseFreelist = 0; pDb->pFreelist = 0; bSave = 1; } for(i=0; inRight; i++){ lsmFsSortedDelete(pDb->pFS, pWorker, 1, &pLevel->aRhs[i]); } if( bEmpty ){ /* If the new level is completely empty, remove it from the ** database snapshot. This can only happen if all input keys were ** annihilated. Since keys are only annihilated if the new level ** is the last in the linked list (contains the most ancient of ** database content), this guarantees that pLevel->pNext==0. */ Level *pTop; /* Top level of worker snapshot */ Level **pp; /* Read/write iterator for Level.pNext list */ assert( pLevel->pNext==0 ); /* Remove the level from the worker snapshot. */ pTop = lsmDbSnapshotLevel(pWorker); for(pp=&pTop; *pp!=pLevel; pp=&((*pp)->pNext)); *pp = pLevel->pNext; lsmDbSnapshotSetLevel(pWorker, pTop); /* Free the Level structure. */ sortedFreeLevel(pDb->pEnv, pLevel); }else{ /* Free the separators of the next level, if required. */ if( pLevel->pMerge->nInput > pLevel->nRight ){ assert( pLevel->pNext->lhs.iRoot ); pLevel->pNext->lhs.iRoot = 0; } /* Zero the right-hand-side of pLevel */ lsmFree(pDb->pEnv, pLevel->aRhs); pLevel->nRight = 0; pLevel->aRhs = 0; /* Free the Merge object */ lsmFree(pDb->pEnv, pLevel->pMerge); pLevel->pMerge = 0; } if( bSave && rc==LSM_OK ){ pDb->bIncrMerge = 0; rc = lsmSaveWorker(pDb, 0); } } } /* Clean up the MergeWorker object initialized above. If no error ** has occurred, invoke the work-hook to inform the application that ** the database structure has changed. */ mergeWorkerShutdown(&mergeworker, &rc); pDb->bIncrMerge = 0; if( rc==LSM_OK ) sortedInvokeWorkHook(pDb); #if LSM_LOG_STRUCTURE lsmSortedDumpStructure(pDb, pDb->pWorker, LSM_LOG_DATA, 0, "work"); #endif assertBtreeOk(pDb, &pLevel->lhs); assertRunInOrder(pDb, &pLevel->lhs); /* If bFlush is true and the database is no longer considered "full", ** break out of the loop even if nRemaining is still greater than ** zero. The caller has an in-memory tree to flush to disk. */ if( bFlush && sortedDbIsFull(pDb)==0 ) break; } } if( pnWrite ) *pnWrite = (nWork - nRemaining); pWorker->nWrite += (nWork - nRemaining); #ifdef LSM_LOG_WORK lsmLogMessage(pDb, rc, "sortedWork(): %d pages", (nWork-nRemaining)); #endif return rc; } /* ** The database connection passed as the first argument must be a worker ** connection. This function checks if there exists an "old" in-memory tree ** ready to be flushed to disk. If so, true is returned. Otherwise false. ** ** If an error occurs, *pRc is set to an LSM error code before returning. ** It is assumed that *pRc is set to LSM_OK when this function is called. */ static int sortedTreeHasOld(lsm_db *pDb, int *pRc){ int rc = LSM_OK; int bRet = 0; assert( pDb->pWorker ); if( *pRc==LSM_OK ){ if( rc==LSM_OK && pDb->treehdr.iOldShmid && pDb->treehdr.iOldLog!=pDb->pWorker->iLogOff ){ bRet = 1; }else{ bRet = 0; } *pRc = rc; } assert( *pRc==LSM_OK || bRet==0 ); return bRet; } /* ** Create a new free-list only top-level segment. Return LSM_OK if successful ** or an LSM error code if some error occurs. */ static int sortedNewFreelistOnly(lsm_db *pDb){ return sortedNewToplevel(pDb, TREE_NONE, 0); } int lsmSaveWorker(lsm_db *pDb, int bFlush){ Snapshot *p = pDb->pWorker; if( p->freelist.nEntry>pDb->nMaxFreelist ){ int rc = sortedNewFreelistOnly(pDb); if( rc!=LSM_OK ) return rc; } return lsmCheckpointSaveWorker(pDb, bFlush); } static int doLsmSingleWork( lsm_db *pDb, int bShutdown, int nMerge, /* Minimum segments to merge together */ int nPage, /* Number of pages to write to disk */ int *pnWrite, /* OUT: Pages actually written to disk */ int *pbCkpt /* OUT: True if an auto-checkpoint is req. */ ){ Snapshot *pWorker; /* Worker snapshot */ int rc = LSM_OK; /* Return code */ int bDirty = 0; int nMax = nPage; /* Maximum pages to write to disk */ int nRem = nPage; int bCkpt = 0; assert( nPage>0 ); /* Open the worker 'transaction'. It will be closed before this function ** returns. */ assert( pDb->pWorker==0 ); rc = lsmBeginWork(pDb); if( rc!=LSM_OK ) return rc; pWorker = pDb->pWorker; /* If this connection is doing auto-checkpoints, set nMax (and nRem) so ** that this call stops writing when the auto-checkpoint is due. The ** caller will do the checkpoint, then possibly call this function again. */ if( bShutdown==0 && pDb->nAutockpt ){ u32 nSync; u32 nUnsync; int nPgsz; lsmCheckpointSynced(pDb, 0, 0, &nSync); nUnsync = lsmCheckpointNWrite(pDb->pShmhdr->aSnap1, 0); nPgsz = lsmCheckpointPgsz(pDb->pShmhdr->aSnap1); nMax = (int)LSM_MIN(nMax, (pDb->nAutockpt/nPgsz) - (int)(nUnsync-nSync)); if( nMaxnTransOpen==0 ){ rc = lsmTreeLoadHeader(pDb, 0); } if( sortedTreeHasOld(pDb, &rc) ){ /* sortedDbIsFull() returns non-zero if either (a) there are too many ** levels in total in the db, or (b) there are too many levels with the ** the same age in the db. Either way, call sortedWork() to merge ** existing segments together until this condition is cleared. */ if( sortedDbIsFull(pDb) ){ int nPg = 0; rc = sortedWork(pDb, nRem, nMerge, 1, &nPg); nRem -= nPg; assert( rc!=LSM_OK || nRem<=0 || !sortedDbIsFull(pDb) ); bDirty = 1; } if( rc==LSM_OK && nRem>0 ){ int nPg = 0; rc = sortedNewToplevel(pDb, TREE_OLD, &nPg); nRem -= nPg; if( rc==LSM_OK ){ if( pDb->nTransOpen>0 ){ lsmTreeDiscardOld(pDb); } rc = lsmSaveWorker(pDb, 1); bDirty = 0; } } } /* If nPage is still greater than zero, do some merging. */ if( rc==LSM_OK && nRem>0 && bShutdown==0 ){ int nPg = 0; rc = sortedWork(pDb, nRem, nMerge, 0, &nPg); nRem -= nPg; if( nPg ) bDirty = 1; } /* If the in-memory part of the free-list is too large, write a new ** top-level containing just the in-memory free-list entries to disk. */ if( rc==LSM_OK && pDb->pWorker->freelist.nEntry > pDb->nMaxFreelist ){ int nPg = 0; while( rc==LSM_OK && lsmDatabaseFull(pDb) ){ rc = sortedWork(pDb, 16, nMerge, 1, &nPg); nRem -= nPg; } if( rc==LSM_OK ){ rc = sortedNewFreelistOnly(pDb); } nRem -= nPg; if( nPg ) bDirty = 1; } if( rc==LSM_OK ){ *pnWrite = (nMax - nRem); *pbCkpt = (bCkpt && nRem<=0); if( nMerge==1 && pDb->nAutockpt>0 && *pnWrite>0 && pWorker->pLevel && pWorker->pLevel->nRight==0 && pWorker->pLevel->pNext==0 ){ *pbCkpt = 1; } } if( rc==LSM_OK && bDirty ){ lsmFinishWork(pDb, 0, &rc); }else{ int rcdummy = LSM_BUSY; lsmFinishWork(pDb, 0, &rcdummy); *pnWrite = 0; } assert( pDb->pWorker==0 ); return rc; } static int doLsmWork(lsm_db *pDb, int nMerge, int nPage, int *pnWrite){ int rc = LSM_OK; /* Return code */ int nWrite = 0; /* Number of pages written */ assert( nMerge>=1 ); if( nPage!=0 ){ int bCkpt = 0; do { int nThis = 0; int nReq = (nPage>=0) ? (nPage-nWrite) : ((int)0x7FFFFFFF); bCkpt = 0; rc = doLsmSingleWork(pDb, 0, nMerge, nReq, &nThis, &bCkpt); nWrite += nThis; if( rc==LSM_OK && bCkpt ){ rc = lsm_checkpoint(pDb, 0); } }while( rc==LSM_OK && bCkpt && (nWritenTransOpen || pDb->pCsr ) return LSM_MISUSE_BKPT; if( nMerge<=0 ) nMerge = pDb->nMerge; lsmFsPurgeCache(pDb->pFS); /* Convert from KB to pages */ nPgsz = lsmFsPageSize(pDb->pFS); if( nKB>=0 ){ nPage = ((i64)nKB * 1024 + nPgsz - 1) / nPgsz; }else{ nPage = -1; } rc = doLsmWork(pDb, nMerge, nPage, &nWrite); if( pnWrite ){ /* Convert back from pages to KB */ *pnWrite = (int)(((i64)nWrite * 1024 + nPgsz - 1) / nPgsz); } return rc; } int lsm_flush(lsm_db *db){ int rc; if( db->nTransOpen>0 || db->pCsr ){ rc = LSM_MISUSE_BKPT; }else{ rc = lsmBeginWriteTrans(db); if( rc==LSM_OK ){ lsmFlushTreeToDisk(db); lsmTreeDiscardOld(db); lsmTreeMakeOld(db); lsmTreeDiscardOld(db); } if( rc==LSM_OK ){ rc = lsmFinishWriteTrans(db, 1); }else{ lsmFinishWriteTrans(db, 0); } lsmFinishReadTrans(db); } return rc; } /* ** This function is called in auto-work mode to perform merging work on ** the data structure. It performs enough merging work to prevent the ** height of the tree from growing indefinitely assuming that roughly ** nUnit database pages worth of data have been written to the database ** (i.e. the in-memory tree) since the last call. */ int lsmSortedAutoWork( lsm_db *pDb, /* Database handle */ int nUnit /* Pages of data written to in-memory tree */ ){ int rc = LSM_OK; /* Return code */ int nDepth = 0; /* Current height of tree (longest path) */ Level *pLevel; /* Used to iterate through levels */ int bRestore = 0; assert( pDb->pWorker==0 ); assert( pDb->nTransOpen>0 ); /* Determine how many units of work to do before returning. One unit of ** work is achieved by writing one page (~4KB) of merged data. */ for(pLevel=lsmDbSnapshotLevel(pDb->pClient); pLevel; pLevel=pLevel->pNext){ /* nDepth += LSM_MAX(1, pLevel->nRight); */ nDepth += 1; } if( lsmTreeHasOld(pDb) ){ nDepth += 1; bRestore = 1; rc = lsmSaveCursors(pDb); if( rc!=LSM_OK ) return rc; } if( nDepth>0 ){ int nRemaining; /* Units of work to do before returning */ nRemaining = nUnit * nDepth; #ifdef LSM_LOG_WORK lsmLogMessage(pDb, rc, "lsmSortedAutoWork(): %d*%d = %d pages", nUnit, nDepth, nRemaining); #endif assert( nRemaining>=0 ); rc = doLsmWork(pDb, pDb->nMerge, nRemaining, 0); if( rc==LSM_BUSY ) rc = LSM_OK; if( bRestore && pDb->pCsr ){ lsmMCursorFreeCache(pDb); lsmFreeSnapshot(pDb->pEnv, pDb->pClient); pDb->pClient = 0; if( rc==LSM_OK ){ rc = lsmCheckpointLoad(pDb, 0); } if( rc==LSM_OK ){ rc = lsmCheckpointDeserialize(pDb, 0, pDb->aSnapshot, &pDb->pClient); } if( rc==LSM_OK ){ rc = lsmRestoreCursors(pDb); } } } return rc; } /* ** This function is only called during system shutdown. The contents of ** any in-memory trees present (old or current) are written out to disk. */ int lsmFlushTreeToDisk(lsm_db *pDb){ int rc; rc = lsmBeginWork(pDb); while( rc==LSM_OK && sortedDbIsFull(pDb) ){ rc = sortedWork(pDb, 256, pDb->nMerge, 1, 0); } if( rc==LSM_OK ){ rc = sortedNewToplevel(pDb, TREE_BOTH, 0); } lsmFinishWork(pDb, 1, &rc); return rc; } /* ** Return a string representation of the segment passed as the only argument. ** Space for the returned string is allocated using lsmMalloc(), and should ** be freed by the caller using lsmFree(). */ static char *segToString(lsm_env *pEnv, Segment *pSeg, int nMin){ int nSize = pSeg->nSize; Pgno iRoot = pSeg->iRoot; Pgno iFirst = pSeg->iFirst; Pgno iLast = pSeg->iLastPg; char *z; char *z1; char *z2; int nPad; z1 = lsmMallocPrintf(pEnv, "%d.%d", iFirst, iLast); if( iRoot ){ z2 = lsmMallocPrintf(pEnv, "root=%d", iRoot); }else{ z2 = lsmMallocPrintf(pEnv, "size=%d", nSize); } nPad = nMin - 2 - strlen(z1) - 1 - strlen(z2); nPad = LSM_MAX(0, nPad); if( iRoot ){ z = lsmMallocPrintf(pEnv, "/%s %*s%s\\", z1, nPad, "", z2); }else{ z = lsmMallocPrintf(pEnv, "|%s %*s%s|", z1, nPad, "", z2); } lsmFree(pEnv, z1); lsmFree(pEnv, z2); return z; } static int fileToString( lsm_db *pDb, /* For xMalloc() */ char *aBuf, int nBuf, int nMin, Segment *pSeg ){ int i = 0; if( pSeg ){ char *zSeg; zSeg = segToString(pDb->pEnv, pSeg, nMin); snprintf(&aBuf[i], nBuf-i, "%s", zSeg); i += strlen(&aBuf[i]); lsmFree(pDb->pEnv, zSeg); #ifdef LSM_LOG_FREELIST lsmInfoArrayStructure(pDb, 1, pSeg->iFirst, &zSeg); snprintf(&aBuf[i], nBuf-1, " (%s)", zSeg); i += strlen(&aBuf[i]); lsmFree(pDb->pEnv, zSeg); #endif aBuf[nBuf] = 0; }else{ aBuf[0] = '\0'; } return i; } void sortedDumpPage(lsm_db *pDb, Segment *pRun, Page *pPg, int bVals){ Blob blob = {0, 0, 0}; /* Blob used for keys */ LsmString s; int i; int nRec; int iPtr; int flags; u8 *aData; int nData; aData = fsPageData(pPg, &nData); nRec = pageGetNRec(aData, nData); iPtr = (int)pageGetPtr(aData, nData); flags = pageGetFlags(aData, nData); lsmStringInit(&s, pDb->pEnv); lsmStringAppendf(&s,"nCell=%d iPtr=%d flags=%d {", nRec, iPtr, flags); if( flags&SEGMENT_BTREE_FLAG ) iPtr = 0; for(i=0; ipFS, pRun, iRef, &pRef); aKey = pageGetKey(pRun, pRef, 0, &iTopic, &nKey, &blob); }else{ aCell += lsmVarintGet32(aCell, &nKey); if( rtIsWrite(eType) ) aCell += lsmVarintGet32(aCell, &nVal); sortedReadData(0, pPg, (aCell-aData), nKey+nVal, (void **)&aKey, &blob); aVal = &aKey[nKey]; iTopic = eType; } lsmStringAppendf(&s, "%s%2X:", (i==0?"":" "), iTopic); for(iChar=0; iChar0 && bVals ){ lsmStringAppendf(&s, "##"); for(iChar=0; iCharpFS, pSeg, iRef, &pRef); pageGetKeyCopy(pDb->pEnv, pSeg, pRef, 0, &dummy, pBlob); aKey = (u8 *)pBlob->pData; nKey = pBlob->nData; lsmFsPageRelease(pRef); }else{ aKey = (u8 *)""; nKey = 11; } }else{ aCell += lsmVarintGet32(aCell, &nKey); if( rtIsWrite(eType) ) aCell += lsmVarintGet32(aCell, &nVal); sortedReadData(pSeg, pPg, (aCell-aData), nKey+nVal, (void **)&aKey, pBlob); aVal = &aKey[nKey]; } if( peType ) *peType = eType; if( piPgPtr ) *piPgPtr = iPgPtr; if( paKey ) *paKey = aKey; if( paVal ) *paVal = aVal; if( pnKey ) *pnKey = nKey; if( pnVal ) *pnVal = nVal; } static int infoAppendBlob(LsmString *pStr, int bHex, u8 *z, int n){ int iChar; for(iChar=0; iCharpClient || pDb->pWorker ); pSnap = pDb->pClient; if( pSnap==0 ) pSnap = pDb->pWorker; if( pSnap->redirect.n>0 ){ Level *pLvl; int bUse = 0; for(pLvl=pSnap->pLevel; pLvl->pNext; pLvl=pLvl->pNext); pSeg = (pLvl->nRight==0 ? &pLvl->lhs : &pLvl->aRhs[pLvl->nRight-1]); rc = lsmFsSegmentContainsPg(pDb->pFS, pSeg, iPg, &bUse); if( bUse==0 ){ pSeg = 0; } } /* iPg is a real page number (not subject to redirection). So it is safe ** to pass a NULL in place of the segment pointer as the second argument ** to lsmFsDbPageGet() here. */ if( rc==LSM_OK ){ rc = lsmFsDbPageGet(pDb->pFS, 0, iPg, &pPg); } if( rc==LSM_OK ){ Blob blob = {0, 0, 0, 0}; int nKeyWidth = 0; LsmString str; int nRec; int iPtr; int flags2; int iCell; u8 *aData; int nData; /* Page data and size thereof */ aData = fsPageData(pPg, &nData); nRec = pageGetNRec(aData, nData); iPtr = (int)pageGetPtr(aData, nData); flags2 = pageGetFlags(aData, nData); lsmStringInit(&str, pDb->pEnv); lsmStringAppendf(&str, "Page : %lld (%d bytes)\n", iPg, nData); lsmStringAppendf(&str, "nRec : %d\n", nRec); lsmStringAppendf(&str, "iPtr : %d\n", iPtr); lsmStringAppendf(&str, "flags: %04x\n", flags2); lsmStringAppendf(&str, "\n"); for(iCell=0; iCellnKeyWidth ) nKeyWidth = nKey; } if( bHex ) nKeyWidth = nKeyWidth * 2; for(iCell=0; iCell0 && bValues ){ lsmStringAppendf(&str, "%*s", nKeyWidth - (nKey*(1+bHex)), ""); lsmStringAppendf(&str, " "); infoAppendBlob(&str, bHex, aVal, nVal); } if( rtTopic(eType) ){ int iBlk = (int)~lsmGetU32(aKey); lsmStringAppendf(&str, " (block=%d", iBlk); if( nVal>0 ){ i64 iSnap = lsmGetU64(aVal); lsmStringAppendf(&str, " snapshot=%lld", iSnap); } lsmStringAppendf(&str, ")"); } lsmStringAppendf(&str, "\n"); } if( bData ){ lsmStringAppendf(&str, "\n-------------------" "-------------------------------------------------------------\n"); lsmStringAppendf(&str, "Page %d\n", iPg, (iPg-1)*nData, iPg*nData - 1); for(i=0; inData ){ lsmStringAppendf(&str, " "); }else{ lsmStringAppendf(&str, "%02x ", aData[i+j]); } } lsmStringAppendf(&str, " "); for(j=0; jnData ){ lsmStringAppendf(&str, " "); }else{ lsmStringAppendf(&str,"%c", isprint(aData[i+j]) ? aData[i+j] : '.'); } } lsmStringAppendf(&str,"\n"); } } *pzOut = str.z; sortedBlobFree(&blob); lsmFsPageRelease(pPg); } return rc; } int lsmInfoPageDump( lsm_db *pDb, /* Database handle */ Pgno iPg, /* Page number of page to dump */ int bHex, /* True to output key/value in hex form */ char **pzOut /* OUT: lsmMalloc'd string */ ){ int flags = INFO_PAGE_DUMP_DATA | INFO_PAGE_DUMP_VALUES; if( bHex ) flags |= INFO_PAGE_DUMP_HEX; return infoPageDump(pDb, iPg, flags, pzOut); } void sortedDumpSegment(lsm_db *pDb, Segment *pRun, int bVals){ assert( pDb->xLog ); if( pRun && pRun->iFirst ){ int flags = (bVals ? INFO_PAGE_DUMP_VALUES : 0); char *zSeg; Page *pPg; zSeg = segToString(pDb->pEnv, pRun, 0); lsmLogMessage(pDb, LSM_OK, "Segment: %s", zSeg); lsmFree(pDb->pEnv, zSeg); lsmFsDbPageGet(pDb->pFS, pRun, pRun->iFirst, &pPg); while( pPg ){ Page *pNext; char *z = 0; infoPageDump(pDb, lsmFsPageNumber(pPg), flags, &z); lsmLogMessage(pDb, LSM_OK, "%s", z); lsmFree(pDb->pEnv, z); #if 0 sortedDumpPage(pDb, pRun, pPg, bVals); #endif lsmFsDbPageNext(pRun, pPg, 1, &pNext); lsmFsPageRelease(pPg); pPg = pNext; } } } /* ** Invoke the log callback zero or more times with messages that describe ** the current database structure. */ void lsmSortedDumpStructure( lsm_db *pDb, /* Database handle (used for xLog callback) */ Snapshot *pSnap, /* Snapshot to dump */ int bKeys, /* Output the keys from each segment */ int bVals, /* Output the values from each segment */ const char *zWhy /* Caption to print near top of dump */ ){ Snapshot *pDump = pSnap; Level *pTopLevel; char *zFree = 0; assert( pSnap ); pTopLevel = lsmDbSnapshotLevel(pDump); if( pDb->xLog && pTopLevel ){ static int nCall = 0; Level *pLevel; int iLevel = 0; nCall++; lsmLogMessage(pDb, LSM_OK, "Database structure %d (%s)", nCall, zWhy); #if 0 if( nCall==1031 || nCall==1032 ) bKeys=1; #endif for(pLevel=pTopLevel; pLevel; pLevel=pLevel->pNext){ char zLeft[1024]; char zRight[1024]; int i = 0; Segment *aLeft[24]; Segment *aRight[24]; int nLeft = 0; int nRight = 0; Segment *pSeg = &pLevel->lhs; aLeft[nLeft++] = pSeg; for(i=0; inRight; i++){ aRight[nRight++] = &pLevel->aRhs[i]; } #ifdef LSM_LOG_FREELIST if( nRight ){ memmove(&aRight[1], aRight, sizeof(aRight[0])*nRight); aRight[0] = 0; nRight++; } #endif for(i=0; iiAge, (int)pLevel->flags ); }else{ zLevel[0] = '\0'; } if( nRight==0 ){ iPad = 10; } lsmLogMessage(pDb, LSM_OK, "% 25s % *s% -35s %s", zLevel, iPad, "", zLeft, zRight ); } iLevel++; } if( bKeys ){ for(pLevel=pTopLevel; pLevel; pLevel=pLevel->pNext){ int i; sortedDumpSegment(pDb, &pLevel->lhs, bVals); for(i=0; inRight; i++){ sortedDumpSegment(pDb, &pLevel->aRhs[i], bVals); } } } } lsmInfoFreelist(pDb, &zFree); lsmLogMessage(pDb, LSM_OK, "Freelist: %s", zFree); lsmFree(pDb->pEnv, zFree); assert( lsmFsIntegrityCheck(pDb) ); } void lsmSortedFreeLevel(lsm_env *pEnv, Level *pLevel){ Level *pNext; Level *p; for(p=pLevel; p; p=pNext){ pNext = p->pNext; sortedFreeLevel(pEnv, p); } } void lsmSortedSaveTreeCursors(lsm_db *pDb){ MultiCursor *pCsr; for(pCsr=pDb->pCsr; pCsr; pCsr=pCsr->pNext){ lsmTreeCursorSave(pCsr->apTreeCsr[0]); lsmTreeCursorSave(pCsr->apTreeCsr[1]); } } void lsmSortedExpandBtreePage(Page *pPg, int nOrig){ u8 *aData; int nData; int nEntry; int iHdr; aData = lsmFsPageData(pPg, &nData); nEntry = pageGetNRec(aData, nOrig); iHdr = SEGMENT_EOF(nOrig, nEntry); memmove(&aData[iHdr + (nData-nOrig)], &aData[iHdr], nOrig-iHdr); } #ifdef LSM_DEBUG_EXPENSIVE static void assertRunInOrder(lsm_db *pDb, Segment *pSeg){ Page *pPg = 0; Blob blob1 = {0, 0, 0, 0}; Blob blob2 = {0, 0, 0, 0}; lsmFsDbPageGet(pDb->pFS, pSeg, pSeg->iFirst, &pPg); while( pPg ){ u8 *aData; int nData; Page *pNext; aData = lsmFsPageData(pPg, &nData); if( 0==(pageGetFlags(aData, nData) & SEGMENT_BTREE_FLAG) ){ int i; int nRec = pageGetNRec(aData, nData); for(i=0; ipEnv, pSeg, pPg, i, &iTopic1, &blob1); if( i==0 && blob2.nData ){ assert( sortedKeyCompare( pDb->xCmp, iTopic2, blob2.pData, blob2.nData, iTopic1, blob1.pData, blob1.nData )<0 ); } if( i<(nRec-1) ){ pageGetKeyCopy(pDb->pEnv, pSeg, pPg, i+1, &iTopic2, &blob2); assert( sortedKeyCompare( pDb->xCmp, iTopic1, blob1.pData, blob1.nData, iTopic2, blob2.pData, blob2.nData )<0 ); } } } lsmFsDbPageNext(pSeg, pPg, 1, &pNext); lsmFsPageRelease(pPg); pPg = pNext; } sortedBlobFree(&blob1); sortedBlobFree(&blob2); } #endif #ifdef LSM_DEBUG_EXPENSIVE /* ** This function is only included in the build if LSM_DEBUG_EXPENSIVE is ** defined. Its only purpose is to evaluate various assert() statements to ** verify that the database is well formed in certain respects. ** ** More specifically, it checks that the array pOne contains the required ** pointers to pTwo. Array pTwo must be a main array. pOne may be either a ** separators array or another main array. If pOne does not contain the ** correct set of pointers, an assert() statement fails. */ static int assertPointersOk( lsm_db *pDb, /* Database handle */ Segment *pOne, /* Segment containing pointers */ Segment *pTwo, /* Segment containing pointer targets */ int bRhs /* True if pTwo may have been Gobble()d */ ){ int rc = LSM_OK; /* Error code */ SegmentPtr ptr1; /* Iterates through pOne */ SegmentPtr ptr2; /* Iterates through pTwo */ Pgno iPrev; assert( pOne && pTwo ); memset(&ptr1, 0, sizeof(ptr1)); memset(&ptr2, 0, sizeof(ptr1)); ptr1.pSeg = pOne; ptr2.pSeg = pTwo; segmentPtrEndPage(pDb->pFS, &ptr1, 0, &rc); segmentPtrEndPage(pDb->pFS, &ptr2, 0, &rc); /* Check that the footer pointer of the first page of pOne points to ** the first page of pTwo. */ iPrev = pTwo->iFirst; if( ptr1.iPtr!=iPrev && !bRhs ){ assert( 0 ); } if( rc==LSM_OK && ptr1.nCell>0 ){ rc = segmentPtrLoadCell(&ptr1, 0); } while( rc==LSM_OK && ptr2.pPg ){ Pgno iThis; /* Advance to the next page of segment pTwo that contains at least ** one cell. Break out of the loop if the iterator reaches EOF. */ do{ rc = segmentPtrNextPage(&ptr2, 1); assert( rc==LSM_OK ); }while( rc==LSM_OK && ptr2.pPg && ptr2.nCell==0 ); if( rc!=LSM_OK || ptr2.pPg==0 ) break; iThis = lsmFsPageNumber(ptr2.pPg); if( (ptr2.flags & (PGFTR_SKIP_THIS_FLAG|SEGMENT_BTREE_FLAG))==0 ){ /* Load the first cell in the array pTwo page. */ rc = segmentPtrLoadCell(&ptr2, 0); /* Iterate forwards through pOne, searching for a key that matches the ** key ptr2.pKey/nKey. This key should have a pointer to the page that ** ptr2 currently points to. */ while( rc==LSM_OK ){ int res = rtTopic(ptr1.eType) - rtTopic(ptr2.eType); if( res==0 ){ res = pDb->xCmp(ptr1.pKey, ptr1.nKey, ptr2.pKey, ptr2.nKey); } if( res<0 ){ assert( bRhs || ptr1.iPtr+ptr1.iPgPtr==iPrev ); }else if( res>0 ){ assert( 0 ); }else{ assert( ptr1.iPtr+ptr1.iPgPtr==iThis ); iPrev = iThis; break; } rc = segmentPtrAdvance(0, &ptr1, 0); if( ptr1.pPg==0 ){ assert( 0 ); } } } } segmentPtrReset(&ptr1, 0); segmentPtrReset(&ptr2, 0); return LSM_OK; } /* ** This function is only included in the build if LSM_DEBUG_EXPENSIVE is ** defined. Its only purpose is to evaluate various assert() statements to ** verify that the database is well formed in certain respects. ** ** More specifically, it checks that the b-tree embedded in array pRun ** contains the correct keys. If not, an assert() fails. */ static int assertBtreeOk( lsm_db *pDb, Segment *pSeg ){ int rc = LSM_OK; /* Return code */ if( pSeg->iRoot ){ Blob blob = {0, 0, 0}; /* Buffer used to cache overflow keys */ FileSystem *pFS = pDb->pFS; /* File system to read from */ Page *pPg = 0; /* Main run page */ BtreeCursor *pCsr = 0; /* Btree cursor */ rc = btreeCursorNew(pDb, pSeg, &pCsr); if( rc==LSM_OK ){ rc = btreeCursorFirst(pCsr); } if( rc==LSM_OK ){ rc = lsmFsDbPageGet(pFS, pSeg, pSeg->iFirst, &pPg); } while( rc==LSM_OK ){ Page *pNext; u8 *aData; int nData; int flags; rc = lsmFsDbPageNext(pSeg, pPg, 1, &pNext); lsmFsPageRelease(pPg); pPg = pNext; if( pPg==0 ) break; aData = fsPageData(pPg, &nData); flags = pageGetFlags(aData, nData); if( rc==LSM_OK && 0==((SEGMENT_BTREE_FLAG|PGFTR_SKIP_THIS_FLAG) & flags) && 0!=pageGetNRec(aData, nData) ){ u8 *pKey; int nKey; int iTopic; pKey = pageGetKey(pSeg, pPg, 0, &iTopic, &nKey, &blob); assert( nKey==pCsr->nKey && 0==memcmp(pKey, pCsr->pKey, nKey) ); assert( lsmFsPageNumber(pPg)==pCsr->iPtr ); rc = btreeCursorNext(pCsr); } } assert( rc!=LSM_OK || pCsr->pKey==0 ); if( pPg ) lsmFsPageRelease(pPg); btreeCursorFree(pCsr); sortedBlobFree(&blob); } return rc; } #endif /* ifdef LSM_DEBUG_EXPENSIVE */ ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_str.c ================================================ /* ** 2012-04-27 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** Dynamic string functions. */ #include "lsmInt.h" /* ** Turn bulk and uninitialized memory into an LsmString object */ void lsmStringInit(LsmString *pStr, lsm_env *pEnv){ memset(pStr, 0, sizeof(pStr[0])); pStr->pEnv = pEnv; } /* ** Increase the memory allocated for holding the string. Realloc as needed. ** ** If a memory allocation error occurs, set pStr->n to -1 and free the existing ** allocation. If a prior memory allocation has occurred, this routine is a ** no-op. */ int lsmStringExtend(LsmString *pStr, int nNew){ assert( nNew>0 ); if( pStr->n<0 ) return LSM_NOMEM; if( pStr->n + nNew >= pStr->nAlloc ){ int nAlloc = pStr->n + nNew + 100; char *zNew = lsmRealloc(pStr->pEnv, pStr->z, nAlloc); if( zNew==0 ){ lsmFree(pStr->pEnv, pStr->z); nAlloc = 0; pStr->n = -1; } pStr->nAlloc = nAlloc; pStr->z = zNew; } return (pStr->z ? LSM_OK : LSM_NOMEM_BKPT); } /* ** Clear an LsmString object, releasing any allocated memory that it holds. ** This also clears the error indication (if any). */ void lsmStringClear(LsmString *pStr){ lsmFree(pStr->pEnv, pStr->z); lsmStringInit(pStr, pStr->pEnv); } /* ** Append N bytes of text to the end of an LsmString object. If ** N is negative, append the entire string. ** ** If the string is in an error state, this routine is a no-op. */ int lsmStringAppend(LsmString *pStr, const char *z, int N){ int rc; if( N<0 ) N = (int)strlen(z); rc = lsmStringExtend(pStr, N+1); if( pStr->nAlloc ){ memcpy(pStr->z+pStr->n, z, N+1); pStr->n += N; } return rc; } int lsmStringBinAppend(LsmString *pStr, const u8 *a, int n){ int rc; rc = lsmStringExtend(pStr, n); if( pStr->nAlloc ){ memcpy(pStr->z+pStr->n, a, n); pStr->n += n; } return rc; } /* ** Append printf-formatted content to an LsmString. */ void lsmStringVAppendf( LsmString *pStr, const char *zFormat, va_list ap1, va_list ap2 ){ #if (!defined(__STDC_VERSION__) || (__STDC_VERSION__<199901L)) && \ !defined(__APPLE__) extern int vsnprintf(char *str, size_t size, const char *format, va_list ap) /* Compatibility crutch for C89 compilation mode. sqlite3_vsnprintf() does not work identically and causes test failures if used here. For the time being we are assuming that the target has vsnprintf(), but that is not guaranteed to be the case for pure C89 platforms. */; #endif int nWrite; int nAvail; nAvail = pStr->nAlloc - pStr->n; nWrite = vsnprintf(pStr->z + pStr->n, nAvail, zFormat, ap1); if( nWrite>=nAvail ){ lsmStringExtend(pStr, nWrite+1); if( pStr->nAlloc==0 ) return; nWrite = vsnprintf(pStr->z + pStr->n, nWrite+1, zFormat, ap2); } pStr->n += nWrite; pStr->z[pStr->n] = 0; } void lsmStringAppendf(LsmString *pStr, const char *zFormat, ...){ va_list ap, ap2; va_start(ap, zFormat); va_start(ap2, zFormat); lsmStringVAppendf(pStr, zFormat, ap, ap2); va_end(ap); va_end(ap2); } int lsmStrlen(const char *zName){ int nRet = 0; while( zName[nRet] ) nRet++; return nRet; } /* ** Write into memory obtained from lsm_malloc(). */ char *lsmMallocPrintf(lsm_env *pEnv, const char *zFormat, ...){ LsmString s; va_list ap, ap2; lsmStringInit(&s, pEnv); va_start(ap, zFormat); va_start(ap2, zFormat); lsmStringVAppendf(&s, zFormat, ap, ap2); va_end(ap); va_end(ap2); if( s.n<0 ) return 0; return (char *)lsmReallocOrFree(pEnv, s.z, s.n+1); } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_tree.c ================================================ /* ** 2011-08-18 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** This file contains the implementation of an in-memory tree structure. ** ** Technically the tree is a B-tree of order 4 (in the Knuth sense - each ** node may have up to 4 children). Keys are stored within B-tree nodes by ** reference. This may be slightly slower than a conventional red-black ** tree, but it is simpler. It is also an easier structure to modify to ** create a version that supports nested transaction rollback. ** ** This tree does not currently support a delete operation. One is not ** required. When LSM deletes a key from a database, it inserts a DELETE ** marker into the data structure. As a result, although the value associated ** with a key stored in the in-memory tree structure may be modified, no ** keys are ever removed. */ /* ** MVCC NOTES ** ** The in-memory tree structure supports SQLite-style MVCC. This means ** that while one client is writing to the tree structure, other clients ** may still be querying an older snapshot of the tree. ** ** One way to implement this is to use an append-only b-tree. In this ** case instead of modifying nodes in-place, a copy of the node is made ** and the required modifications made to the copy. The parent of the ** node is then modified (to update the pointer so that it points to ** the new copy), which causes a copy of the parent to be made, and so on. ** This means that each time the tree is written to a new root node is ** created. A snapshot is identified by the root node that it uses. ** ** The problem with the above is that each time the tree is written to, ** a copy of the node structure modified and all of its ancestor nodes ** is made. This may prove excessive with large tree structures. ** ** To reduce this overhead, the data structure used for a tree node is ** designed so that it may be edited in place exactly once without ** affecting existing users. In other words, the node structure is capable ** of storing two separate versions of the node at the same time. ** When a node is to be edited, if the node structure already contains ** two versions, a copy is made as in the append-only approach. Or, if ** it only contains a single version, it is edited in place. ** ** This reduces the overhead so that, roughly, one new node structure ** must be allocated for each write (on top of those allocations that ** would have been required by a non-MVCC tree). Logic: Assume that at ** any time, 50% of nodes in the tree already contain 2 versions. When ** a new entry is written to a node, there is a 50% chance that a copy ** of the node will be required. And a 25% chance that a copy of its ** parent is required. And so on. ** ** ROLLBACK ** ** The in-memory tree also supports transaction and sub-transaction ** rollback. In order to rollback to point in time X, the following is ** necessary: ** ** 1. All memory allocated since X must be freed, and ** 2. All "v2" data adding to nodes that existed at X should be zeroed. ** 3. The root node must be restored to its X value. ** ** The Mempool object used to allocate memory for the tree supports ** operation (1) - see the lsmPoolMark() and lsmPoolRevert() functions. ** ** To support (2), all nodes that have v2 data are part of a singly linked ** list, sorted by the age of the v2 data (nodes that have had data added ** most recently are at the end of the list). So to zero all v2 data added ** since X, the linked list is traversed from the first node added following ** X onwards. ** */ #ifndef _LSM_INT_H # include "lsmInt.h" #endif #include #define MAX_DEPTH 32 typedef struct TreeKey TreeKey; typedef struct TreeNode TreeNode; typedef struct TreeLeaf TreeLeaf; typedef struct NodeVersion NodeVersion; struct TreeOld { u32 iShmid; /* Last shared-memory chunk in use by old */ u32 iRoot; /* Offset of root node in shm file */ u32 nHeight; /* Height of tree structure */ }; #if 0 /* ** assert() that a TreeKey.flags value is sane. Usage: ** ** assert( lsmAssertFlagsOk(pTreeKey->flags) ); */ static int lsmAssertFlagsOk(u8 keyflags){ /* At least one flag must be set. Otherwise, what is this key doing? */ assert( keyflags!=0 ); /* The POINT_DELETE and INSERT flags cannot both be set. */ assert( (keyflags & LSM_POINT_DELETE)==0 || (keyflags & LSM_INSERT)==0 ); /* If both the START_DELETE and END_DELETE flags are set, then the INSERT ** flag must also be set. In other words - the three DELETE flags cannot ** all be set */ assert( (keyflags & LSM_END_DELETE)==0 || (keyflags & LSM_START_DELETE)==0 || (keyflags & LSM_POINT_DELETE)==0 ); return 1; } #endif static int assert_delete_ranges_match(lsm_db *); static int treeCountEntries(lsm_db *db); /* ** Container for a key-value pair. Within the *-shm file, each key/value ** pair is stored in a single allocation (which may not actually be ** contiguous in memory). Layout is the TreeKey structure, followed by ** the nKey bytes of key blob, followed by the nValue bytes of value blob ** (if nValue is non-negative). */ struct TreeKey { int nKey; /* Size of pKey in bytes */ int nValue; /* Size of pValue. Or negative. */ u8 flags; /* Various LSM_XXX flags */ }; #define TKV_KEY(p) ((void *)&(p)[1]) #define TKV_VAL(p) ((void *)(((u8 *)&(p)[1]) + (p)->nKey)) /* ** A single tree node. A node structure may contain up to 3 key/value ** pairs. Internal (non-leaf) nodes have up to 4 children. ** ** TODO: Update the format of this to be more compact. Get it working ** first though... */ struct TreeNode { u32 aiKeyPtr[3]; /* Array of pointers to TreeKey objects */ /* The following fields are present for interior nodes only, not leaves. */ u32 aiChildPtr[4]; /* Array of pointers to child nodes */ /* The extra child pointer slot. */ u32 iV2; /* Transaction number of v2 */ u8 iV2Child; /* apChild[] entry replaced by pV2Ptr */ u32 iV2Ptr; /* Substitute pointer */ }; struct TreeLeaf { u32 aiKeyPtr[3]; /* Array of pointers to TreeKey objects */ }; typedef struct TreeBlob TreeBlob; struct TreeBlob { int n; u8 *a; }; /* ** Cursor for searching a tree structure. ** ** If a cursor does not point to any element (a.k.a. EOF), then the ** TreeCursor.iNode variable is set to a negative value. Otherwise, the ** cursor currently points to key aiCell[iNode] on node apTreeNode[iNode]. ** ** Entries in the apTreeNode[] and aiCell[] arrays contain the node and ** index of the TreeNode.apChild[] pointer followed to descend to the ** current element. Hence apTreeNode[0] always contains the root node of ** the tree. */ struct TreeCursor { lsm_db *pDb; /* Database handle for this cursor */ TreeRoot *pRoot; /* Root node and height of tree to access */ int iNode; /* Cursor points at apTreeNode[iNode] */ TreeNode *apTreeNode[MAX_DEPTH];/* Current position in tree */ u8 aiCell[MAX_DEPTH]; /* Current position in tree */ TreeKey *pSave; /* Saved key */ TreeBlob blob; /* Dynamic storage for a key */ }; /* ** A value guaranteed to be larger than the largest possible transaction ** id (TreeHeader.iTransId). */ #define WORKING_VERSION (1<<30) static int tblobGrow(lsm_db *pDb, TreeBlob *p, int n, int *pRc){ if( n>p->n ){ lsmFree(pDb->pEnv, p->a); p->a = lsmMallocRc(pDb->pEnv, n, pRc); p->n = n; } return (p->a==0); } static void tblobFree(lsm_db *pDb, TreeBlob *p){ lsmFree(pDb->pEnv, p->a); } /*********************************************************************** ** Start of IntArray methods. */ /* ** Append value iVal to the contents of IntArray *p. Return LSM_OK if ** successful, or LSM_NOMEM if an OOM condition is encountered. */ static int intArrayAppend(lsm_env *pEnv, IntArray *p, u32 iVal){ assert( p->nArray<=p->nAlloc ); if( p->nArray>=p->nAlloc ){ u32 *aNew; int nNew = p->nArray ? p->nArray*2 : 128; aNew = lsmRealloc(pEnv, p->aArray, nNew*sizeof(u32)); if( !aNew ) return LSM_NOMEM_BKPT; p->aArray = aNew; p->nAlloc = nNew; } p->aArray[p->nArray++] = iVal; return LSM_OK; } /* ** Zero the IntArray object. */ static void intArrayFree(lsm_env *pEnv, IntArray *p){ p->nArray = 0; } /* ** Return the number of entries currently in the int-array object. */ static int intArraySize(IntArray *p){ return p->nArray; } /* ** Return a copy of the iIdx'th entry in the int-array. */ static u32 intArrayEntry(IntArray *p, int iIdx){ return p->aArray[iIdx]; } /* ** Truncate the int-array so that all but the first nVal values are ** discarded. */ static void intArrayTruncate(IntArray *p, int nVal){ p->nArray = nVal; } /* End of IntArray methods. ***********************************************************************/ static int treeKeycmp(void *p1, int n1, void *p2, int n2){ int res; res = memcmp(p1, p2, LSM_MIN(n1, n2)); if( res==0 ) res = (n1-n2); return res; } /* ** The pointer passed as the first argument points to an interior node, ** not a leaf. This function returns the offset of the iCell'th child ** sub-tree of the node. */ static u32 getChildPtr(TreeNode *p, int iVersion, int iCell){ assert( iVersion>=0 ); assert( iCell>=0 && iCell<=array_size(p->aiChildPtr) ); if( p->iV2 && p->iV2<=(u32)iVersion && iCell==p->iV2Child ) return p->iV2Ptr; return p->aiChildPtr[iCell]; } /* ** Given an offset within the *-shm file, return the associated chunk number. */ static int treeOffsetToChunk(u32 iOff){ assert( LSM_SHM_CHUNK_SIZE==(1<<15) ); return (int)(iOff>>15); } #define treeShmptrUnsafe(pDb, iPtr) \ (&((u8*)((pDb)->apShm[(iPtr)>>15]))[(iPtr) & (LSM_SHM_CHUNK_SIZE-1)]) /* ** Return a pointer to the mapped memory location associated with *-shm ** file offset iPtr. */ static void *treeShmptr(lsm_db *pDb, u32 iPtr){ assert( (iPtr>>15)<(u32)pDb->nShm ); assert( pDb->apShm[iPtr>>15] ); return iPtr ? treeShmptrUnsafe(pDb, iPtr) : 0; } static ShmChunk * treeShmChunk(lsm_db *pDb, int iChunk){ return (ShmChunk *)(pDb->apShm[iChunk]); } static ShmChunk * treeShmChunkRc(lsm_db *pDb, int iChunk, int *pRc){ assert( *pRc==LSM_OK ); if( iChunknShm || LSM_OK==(*pRc = lsmShmCacheChunks(pDb, iChunk+1)) ){ return (ShmChunk *)(pDb->apShm[iChunk]); } return 0; } #ifndef NDEBUG static void assertIsWorkingChild( lsm_db *db, TreeNode *pNode, TreeNode *pParent, int iCell ){ TreeNode *p; u32 iPtr = getChildPtr(pParent, WORKING_VERSION, iCell); p = treeShmptr(db, iPtr); assert( p==pNode ); } #else # define assertIsWorkingChild(w,x,y,z) #endif /* Values for the third argument to treeShmkey(). */ #define TKV_LOADKEY 1 #define TKV_LOADVAL 2 static TreeKey *treeShmkey( lsm_db *pDb, /* Database handle */ u32 iPtr, /* Shmptr to TreeKey struct */ int eLoad, /* Either zero or a TREEKEY_LOADXXX value */ TreeBlob *pBlob, /* Used if dynamic memory is required */ int *pRc /* IN/OUT: Error code */ ){ TreeKey *pRet; assert( eLoad==TKV_LOADKEY || eLoad==TKV_LOADVAL ); pRet = (TreeKey *)treeShmptr(pDb, iPtr); if( pRet ){ int nReq; /* Bytes of space required at pRet */ int nAvail; /* Bytes of space available at pRet */ nReq = sizeof(TreeKey) + pRet->nKey; if( eLoad==TKV_LOADVAL && pRet->nValue>0 ){ nReq += pRet->nValue; } assert( LSM_SHM_CHUNK_SIZE==(1<<15) ); nAvail = LSM_SHM_CHUNK_SIZE - (iPtr & (LSM_SHM_CHUNK_SIZE-1)); if( nAvaila[nLoad], p, n); nLoad += n; if( nLoad==nReq ) break; pChunk = treeShmChunk(pDb, treeOffsetToChunk(iPtr)); assert( pChunk ); iPtr = (pChunk->iNext * LSM_SHM_CHUNK_SIZE) + LSM_SHM_CHUNK_HDR; nAvail = LSM_SHM_CHUNK_SIZE - LSM_SHM_CHUNK_HDR; } } pRet = (TreeKey *)(pBlob->a); } } return pRet; } #if defined(LSM_DEBUG) && defined(LSM_EXPENSIVE_ASSERT) void assert_leaf_looks_ok(TreeNode *pNode){ assert( pNode->apKey[1] ); } void assert_node_looks_ok(TreeNode *pNode, int nHeight){ if( pNode ){ assert( pNode->apKey[1] ); if( nHeight>1 ){ int i; assert( getChildPtr(pNode, WORKING_VERSION, 1) ); assert( getChildPtr(pNode, WORKING_VERSION, 2) ); for(i=0; i<4; i++){ assert_node_looks_ok(getChildPtr(pNode, WORKING_VERSION, i), nHeight-1); } } } } /* ** Run various assert() statements to check that the working-version of the ** tree is correct in the following respects: ** ** * todo... */ void assert_tree_looks_ok(int rc, Tree *pTree){ } #else # define assert_tree_looks_ok(x,y) #endif void lsmFlagsToString(int flags, char *zFlags){ zFlags[0] = (flags & LSM_END_DELETE) ? ']' : '.'; /* Only one of LSM_POINT_DELETE, LSM_INSERT and LSM_SEPARATOR should ever ** be set. If this is not true, write a '?' to the output. */ switch( flags & (LSM_POINT_DELETE|LSM_INSERT|LSM_SEPARATOR) ){ case 0: zFlags[1] = '.'; break; case LSM_POINT_DELETE: zFlags[1] = '-'; break; case LSM_INSERT: zFlags[1] = '+'; break; case LSM_SEPARATOR: zFlags[1] = '^'; break; default: zFlags[1] = '?'; break; } zFlags[2] = (flags & LSM_SYSTEMKEY) ? '*' : '.'; zFlags[3] = (flags & LSM_START_DELETE) ? '[' : '.'; zFlags[4] = '\0'; } #ifdef LSM_DEBUG /* ** Pointer pBlob points to a buffer containing a blob of binary data ** nBlob bytes long. Append the contents of this blob to *pStr, with ** each octet represented by a 2-digit hexadecimal number. For example, ** if the input blob is three bytes in size and contains {0x01, 0x44, 0xFF}, ** then "0144ff" is appended to *pStr. */ static void lsmAppendStrBlob(LsmString *pStr, void *pBlob, int nBlob){ int i; lsmStringExtend(pStr, nBlob*2); if( pStr->nAlloc==0 ) return; for(i=0; i='a' && c<='z' ){ pStr->z[pStr->n++] = c; }else if( c!=0 || nBlob==1 || i!=(nBlob-1) ){ pStr->z[pStr->n++] = "0123456789abcdef"[(c>>4)&0xf]; pStr->z[pStr->n++] = "0123456789abcdef"[c&0xf]; } } pStr->z[pStr->n] = 0; } #if 0 /* NOT USED */ /* ** Append nIndent space (0x20) characters to string *pStr. */ static void lsmAppendIndent(LsmString *pStr, int nIndent){ int i; lsmStringExtend(pStr, nIndent); for(i=0; ipEnv); /* Append each key to string s. */ for(i=0; i<3; i++){ u32 iPtr = pNode->aiKeyPtr[i]; if( iPtr ){ TreeKey *pKey = treeShmkey(pDb, pNode->aiKeyPtr[i],TKV_LOADKEY, &b,&rc); strAppendFlags(&s, pKey->flags); lsmAppendStrBlob(&s, TKV_KEY(pKey), pKey->nKey); lsmStringAppend(&s, " ", -1); } } printf("% 6d %.*sleaf%.*s: %s\n", iNode, nPath, zPath, 20-nPath-4, zSpace, s.z ); lsmStringClear(&s); }else{ for(i=0; i<4 && nHeight>0; i++){ u32 iPtr = getChildPtr(pNode, pDb->treehdr.root.iTransId, i); zPath[nPath] = (char)(i+'0'); zPath[nPath+1] = '/'; if( iPtr ){ dump_node_contents(pDb, iPtr, zPath, nPath+2, nHeight-1); } if( i!=3 && pNode->aiKeyPtr[i] ){ TreeKey *pKey = treeShmkey(pDb, pNode->aiKeyPtr[i], TKV_LOADKEY,&b,&rc); lsmStringInit(&s, pDb->pEnv); strAppendFlags(&s, pKey->flags); lsmAppendStrBlob(&s, TKV_KEY(pKey), pKey->nKey); printf("% 6d %.*s%.*s: %s\n", iNode, nPath+1, zPath, 20-nPath-1, zSpace, s.z); lsmStringClear(&s); } } } tblobFree(pDb, &b); } void dump_tree_contents(lsm_db *pDb, const char *zCaption){ char zPath[64]; TreeRoot *p = &pDb->treehdr.root; printf("\n%s\n", zCaption); zPath[0] = '/'; if( p->iRoot ){ dump_node_contents(pDb, p->iRoot, zPath, 1, p->nHeight-1); } fflush(stdout); } #endif /* ** Initialize a cursor object, the space for which has already been ** allocated. */ static void treeCursorInit(lsm_db *pDb, int bOld, TreeCursor *pCsr){ memset(pCsr, 0, sizeof(TreeCursor)); pCsr->pDb = pDb; if( bOld ){ pCsr->pRoot = &pDb->treehdr.oldroot; }else{ pCsr->pRoot = &pDb->treehdr.root; } pCsr->iNode = -1; } /* ** Return a pointer to the mapping of the TreeKey object that the cursor ** is pointing to. */ static TreeKey *csrGetKey(TreeCursor *pCsr, TreeBlob *pBlob, int *pRc){ TreeKey *pRet; lsm_db *pDb = pCsr->pDb; u32 iPtr = pCsr->apTreeNode[pCsr->iNode]->aiKeyPtr[pCsr->aiCell[pCsr->iNode]]; assert( iPtr ); pRet = (TreeKey*)treeShmptrUnsafe(pDb, iPtr); if( !(pRet->flags & LSM_CONTIGUOUS) ){ pRet = treeShmkey(pDb, iPtr, TKV_LOADVAL, pBlob, pRc); } return pRet; } /* ** Save the current position of tree cursor pCsr. */ int lsmTreeCursorSave(TreeCursor *pCsr){ int rc = LSM_OK; if( pCsr && pCsr->pSave==0 ){ int iNode = pCsr->iNode; if( iNode>=0 ){ pCsr->pSave = csrGetKey(pCsr, &pCsr->blob, &rc); } pCsr->iNode = -1; } return rc; } /* ** Restore the position of a saved tree cursor. */ static int treeCursorRestore(TreeCursor *pCsr, int *pRes){ int rc = LSM_OK; if( pCsr->pSave ){ TreeKey *pKey = pCsr->pSave; pCsr->pSave = 0; if( pRes ){ rc = lsmTreeCursorSeek(pCsr, TKV_KEY(pKey), pKey->nKey, pRes); } } return rc; } /* ** Allocate nByte bytes of space within the *-shm file. If successful, ** return LSM_OK and set *piPtr to the offset within the file at which ** the allocated space is located. */ static u32 treeShmalloc(lsm_db *pDb, int bAlign, int nByte, int *pRc){ u32 iRet = 0; if( *pRc==LSM_OK ){ const static int CHUNK_SIZE = LSM_SHM_CHUNK_SIZE; const static int CHUNK_HDR = LSM_SHM_CHUNK_HDR; u32 iWrite; /* Current write offset */ u32 iEof; /* End of current chunk */ int iChunk; /* Current chunk */ assert( nByte <= (CHUNK_SIZE-CHUNK_HDR) ); /* Check if there is enough space on the current chunk to fit the ** new allocation. If not, link in a new chunk and put the new ** allocation at the start of it. */ iWrite = pDb->treehdr.iWrite; if( bAlign ){ iWrite = (iWrite + 3) & ~0x0003; assert( (iWrite % 4)==0 ); } assert( iWrite ); iChunk = treeOffsetToChunk(iWrite-1); iEof = (iChunk+1) * CHUNK_SIZE; assert( iEof>=iWrite && (iEof-iWrite)<(u32)CHUNK_SIZE ); if( (iWrite+nByte)>iEof ){ ShmChunk *pHdr; /* Header of chunk just finished (iChunk) */ ShmChunk *pFirst; /* Header of chunk treehdr.iFirst */ ShmChunk *pNext; /* Header of new chunk */ int iNext = 0; /* Next chunk */ int rc = LSM_OK; pFirst = treeShmChunk(pDb, pDb->treehdr.iFirst); assert( shm_sequence_ge(pDb->treehdr.iUsedShmid, pFirst->iShmid) ); assert( (pDb->treehdr.iNextShmid+1-pDb->treehdr.nChunk)==pFirst->iShmid ); /* Check if the chunk at the start of the linked list is still in ** use. If not, reuse it. If so, allocate a new chunk by appending ** to the *-shm file. */ if( pDb->treehdr.iUsedShmid!=pFirst->iShmid ){ int bInUse; rc = lsmTreeInUse(pDb, pFirst->iShmid, &bInUse); if( rc!=LSM_OK ){ *pRc = rc; return 0; } if( bInUse==0 ){ iNext = pDb->treehdr.iFirst; pDb->treehdr.iFirst = pFirst->iNext; assert( pDb->treehdr.iFirst ); } } if( iNext==0 ) iNext = pDb->treehdr.nChunk++; /* Set the header values for the new chunk */ pNext = treeShmChunkRc(pDb, iNext, &rc); if( pNext ){ pNext->iNext = 0; pNext->iShmid = (pDb->treehdr.iNextShmid++); }else{ *pRc = rc; return 0; } /* Set the header values for the chunk just finished */ pHdr = (ShmChunk *)treeShmptr(pDb, iChunk*CHUNK_SIZE); pHdr->iNext = iNext; /* Advance to the next chunk */ iWrite = iNext * CHUNK_SIZE + CHUNK_HDR; } /* Allocate space at iWrite. */ iRet = iWrite; pDb->treehdr.iWrite = iWrite + nByte; pDb->treehdr.root.nByte += nByte; } return iRet; } /* ** Allocate and zero nByte bytes of space within the *-shm file. */ static void *treeShmallocZero(lsm_db *pDb, int nByte, u32 *piPtr, int *pRc){ u32 iPtr; void *p; iPtr = treeShmalloc(pDb, 1, nByte, pRc); p = treeShmptr(pDb, iPtr); if( p ){ assert( *pRc==LSM_OK ); memset(p, 0, nByte); *piPtr = iPtr; } return p; } static TreeNode *newTreeNode(lsm_db *pDb, u32 *piPtr, int *pRc){ return treeShmallocZero(pDb, sizeof(TreeNode), piPtr, pRc); } static TreeLeaf *newTreeLeaf(lsm_db *pDb, u32 *piPtr, int *pRc){ return treeShmallocZero(pDb, sizeof(TreeLeaf), piPtr, pRc); } static TreeKey *newTreeKey( lsm_db *pDb, u32 *piPtr, void *pKey, int nKey, /* Key data */ void *pVal, int nVal, /* Value data (or nVal<0 for delete) */ int *pRc ){ TreeKey *p; u32 iPtr; u32 iEnd; int nRem; u8 *a; int n; /* Allocate space for the TreeKey structure itself */ *piPtr = iPtr = treeShmalloc(pDb, 1, sizeof(TreeKey), pRc); p = treeShmptr(pDb, iPtr); if( *pRc ) return 0; p->nKey = nKey; p->nValue = nVal; /* Allocate and populate the space required for the key and value. */ n = nRem = nKey; a = (u8 *)pKey; while( a ){ while( nRem>0 ){ u8 *aAlloc; int nAlloc; u32 iWrite; iWrite = (pDb->treehdr.iWrite & (LSM_SHM_CHUNK_SIZE-1)); iWrite = LSM_MAX(iWrite, LSM_SHM_CHUNK_HDR); nAlloc = LSM_MIN((LSM_SHM_CHUNK_SIZE-iWrite), (u32)nRem); aAlloc = treeShmptr(pDb, treeShmalloc(pDb, 0, nAlloc, pRc)); if( aAlloc==0 ) break; memcpy(aAlloc, &a[n-nRem], nAlloc); nRem -= nAlloc; } a = pVal; n = nRem = nVal; pVal = 0; } iEnd = iPtr + sizeof(TreeKey) + nKey + LSM_MAX(0, nVal); if( (iPtr & ~(LSM_SHM_CHUNK_SIZE-1))!=(iEnd & ~(LSM_SHM_CHUNK_SIZE-1)) ){ p->flags = 0; }else{ p->flags = LSM_CONTIGUOUS; } if( *pRc ) return 0; #if 0 printf("store: %d %s\n", (int)iPtr, (char *)pKey); #endif return p; } static TreeNode *copyTreeNode( lsm_db *pDb, TreeNode *pOld, u32 *piNew, int *pRc ){ TreeNode *pNew; pNew = newTreeNode(pDb, piNew, pRc); if( pNew ){ memcpy(pNew->aiKeyPtr, pOld->aiKeyPtr, sizeof(pNew->aiKeyPtr)); memcpy(pNew->aiChildPtr, pOld->aiChildPtr, sizeof(pNew->aiChildPtr)); if( pOld->iV2 ) pNew->aiChildPtr[pOld->iV2Child] = pOld->iV2Ptr; } return pNew; } static TreeNode *copyTreeLeaf( lsm_db *pDb, TreeLeaf *pOld, u32 *piNew, int *pRc ){ TreeLeaf *pNew; pNew = newTreeLeaf(pDb, piNew, pRc); if( pNew ){ memcpy(pNew, pOld, sizeof(TreeLeaf)); } return (TreeNode *)pNew; } /* ** The tree cursor passed as the second argument currently points to an ** internal node (not a leaf). Specifically, to a sub-tree pointer. This ** function replaces the sub-tree that the cursor currently points to ** with sub-tree pNew. ** ** The sub-tree may be replaced either by writing the "v2 data" on the ** internal node, or by allocating a new TreeNode structure and then ** calling this function on the parent of the internal node. */ static int treeUpdatePtr(lsm_db *pDb, TreeCursor *pCsr, u32 iNew){ int rc = LSM_OK; if( pCsr->iNode<0 ){ /* iNew is the new root node */ pDb->treehdr.root.iRoot = iNew; }else{ /* If this node already has version 2 content, allocate a copy and ** update the copy with the new pointer value. Otherwise, store the ** new pointer as v2 data within the current node structure. */ TreeNode *p; /* The node to be modified */ int iChildPtr; /* apChild[] entry to modify */ p = pCsr->apTreeNode[pCsr->iNode]; iChildPtr = pCsr->aiCell[pCsr->iNode]; if( p->iV2 ){ /* The "allocate new TreeNode" option */ u32 iCopy; TreeNode *pCopy; pCopy = copyTreeNode(pDb, p, &iCopy, &rc); if( pCopy ){ assert( rc==LSM_OK ); pCopy->aiChildPtr[iChildPtr] = iNew; pCsr->iNode--; rc = treeUpdatePtr(pDb, pCsr, iCopy); } }else{ /* The "v2 data" option */ u32 iPtr; assert( pDb->treehdr.root.iTransId>0 ); if( pCsr->iNode ){ iPtr = getChildPtr( pCsr->apTreeNode[pCsr->iNode-1], pDb->treehdr.root.iTransId, pCsr->aiCell[pCsr->iNode-1] ); }else{ iPtr = pDb->treehdr.root.iRoot; } rc = intArrayAppend(pDb->pEnv, &pDb->rollback, iPtr); if( rc==LSM_OK ){ p->iV2 = pDb->treehdr.root.iTransId; p->iV2Child = (u8)iChildPtr; p->iV2Ptr = iNew; } } } return rc; } /* ** Cursor pCsr points at a node that is part of pTree. This function ** inserts a new key and optionally child node pointer into that node. ** ** The position into which the new key and pointer are inserted is ** determined by the iSlot parameter. The new key will be inserted to ** the left of the key currently stored in apKey[iSlot]. Or, if iSlot is ** greater than the index of the rightmost key in the node. ** ** Pointer pLeftPtr points to a child tree that contains keys that are ** smaller than pTreeKey. */ static int treeInsert( lsm_db *pDb, /* Database handle */ TreeCursor *pCsr, /* Cursor indicating path to insert at */ u32 iLeftPtr, /* Left child pointer */ u32 iTreeKey, /* Location of key to insert */ u32 iRightPtr, /* Right child pointer */ int iSlot /* Position to insert key into */ ){ int rc = LSM_OK; TreeNode *pNode = pCsr->apTreeNode[pCsr->iNode]; /* Check if the node is currently full. If so, split pNode in two and ** call this function recursively to add a key to the parent. Otherwise, ** insert the new key directly into pNode. */ assert( pNode->aiKeyPtr[1] ); if( pNode->aiKeyPtr[0] && pNode->aiKeyPtr[2] ){ u32 iLeft; TreeNode *pLeft; /* New left-hand sibling node */ u32 iRight; TreeNode *pRight; /* New right-hand sibling node */ pLeft = newTreeNode(pDb, &iLeft, &rc); pRight = newTreeNode(pDb, &iRight, &rc); if( rc ) return rc; pLeft->aiChildPtr[1] = getChildPtr(pNode, WORKING_VERSION, 0); pLeft->aiKeyPtr[1] = pNode->aiKeyPtr[0]; pLeft->aiChildPtr[2] = getChildPtr(pNode, WORKING_VERSION, 1); pRight->aiChildPtr[1] = getChildPtr(pNode, WORKING_VERSION, 2); pRight->aiKeyPtr[1] = pNode->aiKeyPtr[2]; pRight->aiChildPtr[2] = getChildPtr(pNode, WORKING_VERSION, 3); if( pCsr->iNode==0 ){ /* pNode is the root of the tree. Grow the tree by one level. */ u32 iRoot; TreeNode *pRoot; /* New root node */ pRoot = newTreeNode(pDb, &iRoot, &rc); pRoot->aiKeyPtr[1] = pNode->aiKeyPtr[1]; pRoot->aiChildPtr[1] = iLeft; pRoot->aiChildPtr[2] = iRight; pDb->treehdr.root.iRoot = iRoot; pDb->treehdr.root.nHeight++; }else{ pCsr->iNode--; rc = treeInsert(pDb, pCsr, iLeft, pNode->aiKeyPtr[1], iRight, pCsr->aiCell[pCsr->iNode] ); } assert( pLeft->iV2==0 ); assert( pRight->iV2==0 ); switch( iSlot ){ case 0: pLeft->aiKeyPtr[0] = iTreeKey; pLeft->aiChildPtr[0] = iLeftPtr; if( iRightPtr ) pLeft->aiChildPtr[1] = iRightPtr; break; case 1: pLeft->aiChildPtr[3] = (iRightPtr ? iRightPtr : pLeft->aiChildPtr[2]); pLeft->aiKeyPtr[2] = iTreeKey; pLeft->aiChildPtr[2] = iLeftPtr; break; case 2: pRight->aiKeyPtr[0] = iTreeKey; pRight->aiChildPtr[0] = iLeftPtr; if( iRightPtr ) pRight->aiChildPtr[1] = iRightPtr; break; case 3: pRight->aiChildPtr[3] = (iRightPtr ? iRightPtr : pRight->aiChildPtr[2]); pRight->aiKeyPtr[2] = iTreeKey; pRight->aiChildPtr[2] = iLeftPtr; break; } }else{ TreeNode *pNew; u32 *piKey; u32 *piChild; u32 iStore = 0; u32 iNew = 0; int i; /* Allocate a new version of node pNode. */ pNew = newTreeNode(pDb, &iNew, &rc); if( rc ) return rc; piKey = pNew->aiKeyPtr; piChild = pNew->aiChildPtr; for(i=0; iaiKeyPtr[i] ){ *(piKey++) = pNode->aiKeyPtr[i]; *(piChild++) = getChildPtr(pNode, WORKING_VERSION, i); } } *piKey++ = iTreeKey; *piChild++ = iLeftPtr; iStore = iRightPtr; for(i=iSlot; i<3; i++){ if( pNode->aiKeyPtr[i] ){ *(piKey++) = pNode->aiKeyPtr[i]; *(piChild++) = iStore ? iStore : getChildPtr(pNode, WORKING_VERSION, i); iStore = 0; } } if( iStore ){ *piChild = iStore; }else{ *piChild = getChildPtr(pNode, WORKING_VERSION, (pNode->aiKeyPtr[2] ? 3 : 2) ); } pCsr->iNode--; rc = treeUpdatePtr(pDb, pCsr, iNew); } return rc; } static int treeInsertLeaf( lsm_db *pDb, /* Database handle */ TreeCursor *pCsr, /* Cursor structure */ u32 iTreeKey, /* Key pointer to insert */ int iSlot /* Insert key to the left of this */ ){ int rc = LSM_OK; /* Return code */ TreeNode *pLeaf = pCsr->apTreeNode[pCsr->iNode]; TreeLeaf *pNew; u32 iNew; assert( iSlot>=0 && iSlot<=4 ); assert( pCsr->iNode>0 ); assert( pLeaf->aiKeyPtr[1] ); pCsr->iNode--; pNew = newTreeLeaf(pDb, &iNew, &rc); if( pNew ){ if( pLeaf->aiKeyPtr[0] && pLeaf->aiKeyPtr[2] ){ /* The leaf is full. Split it in two. */ TreeLeaf *pRight; u32 iRight; pRight = newTreeLeaf(pDb, &iRight, &rc); if( pRight ){ assert( rc==LSM_OK ); pNew->aiKeyPtr[1] = pLeaf->aiKeyPtr[0]; pRight->aiKeyPtr[1] = pLeaf->aiKeyPtr[2]; switch( iSlot ){ case 0: pNew->aiKeyPtr[0] = iTreeKey; break; case 1: pNew->aiKeyPtr[2] = iTreeKey; break; case 2: pRight->aiKeyPtr[0] = iTreeKey; break; case 3: pRight->aiKeyPtr[2] = iTreeKey; break; } rc = treeInsert(pDb, pCsr, iNew, pLeaf->aiKeyPtr[1], iRight, pCsr->aiCell[pCsr->iNode] ); } }else{ int iOut = 0; int i; for(i=0; i<4; i++){ if( i==iSlot ) pNew->aiKeyPtr[iOut++] = iTreeKey; if( i<3 && pLeaf->aiKeyPtr[i] ){ pNew->aiKeyPtr[iOut++] = pLeaf->aiKeyPtr[i]; } } rc = treeUpdatePtr(pDb, pCsr, iNew); } } return rc; } void lsmTreeMakeOld(lsm_db *pDb){ /* A write transaction must be open. Otherwise the code below that ** assumes (pDb->pClient->iLogOff) is current may malfunction. ** ** Update: currently this assert fails due to lsm_flush(), which does ** not set nTransOpen. */ assert( /* pDb->nTransOpen>0 && */ pDb->iReader>=0 ); if( pDb->treehdr.iOldShmid==0 ){ pDb->treehdr.iOldLog = (pDb->treehdr.log.aRegion[2].iEnd << 1); pDb->treehdr.iOldLog |= (~(pDb->pClient->iLogOff) & (i64)0x0001); pDb->treehdr.oldcksum0 = pDb->treehdr.log.cksum0; pDb->treehdr.oldcksum1 = pDb->treehdr.log.cksum1; pDb->treehdr.iOldShmid = pDb->treehdr.iNextShmid-1; memcpy(&pDb->treehdr.oldroot, &pDb->treehdr.root, sizeof(TreeRoot)); pDb->treehdr.root.iTransId = 1; pDb->treehdr.root.iRoot = 0; pDb->treehdr.root.nHeight = 0; pDb->treehdr.root.nByte = 0; } } void lsmTreeDiscardOld(lsm_db *pDb){ assert( lsmShmAssertLock(pDb, LSM_LOCK_WRITER, LSM_LOCK_EXCL) || lsmShmAssertLock(pDb, LSM_LOCK_DMS2, LSM_LOCK_EXCL) ); pDb->treehdr.iUsedShmid = pDb->treehdr.iOldShmid; pDb->treehdr.iOldShmid = 0; } int lsmTreeHasOld(lsm_db *pDb){ return pDb->treehdr.iOldShmid!=0; } /* ** This function is called during recovery to initialize the ** tree header. Only the database connections private copy of the tree-header ** is initialized here - it will be copied into shared memory if log file ** recovery is successful. */ int lsmTreeInit(lsm_db *pDb){ ShmChunk *pOne; int rc = LSM_OK; memset(&pDb->treehdr, 0, sizeof(TreeHeader)); pDb->treehdr.root.iTransId = 1; pDb->treehdr.iFirst = 1; pDb->treehdr.nChunk = 2; pDb->treehdr.iWrite = LSM_SHM_CHUNK_SIZE + LSM_SHM_CHUNK_HDR; pDb->treehdr.iNextShmid = 2; pDb->treehdr.iUsedShmid = 1; pOne = treeShmChunkRc(pDb, 1, &rc); if( pOne ){ pOne->iNext = 0; pOne->iShmid = 1; } return rc; } static void treeHeaderChecksum( TreeHeader *pHdr, u32 *aCksum ){ u32 cksum1 = 0x12345678; u32 cksum2 = 0x9ABCDEF0; u32 *a = (u32 *)pHdr; int i; assert( (offsetof(TreeHeader, aCksum) + sizeof(u32)*2)==sizeof(TreeHeader) ); assert( (sizeof(TreeHeader) % (sizeof(u32)*2))==0 ); for(i=0; i<(offsetof(TreeHeader, aCksum) / sizeof(u32)); i+=2){ cksum1 += a[i]; cksum2 += (cksum1 + a[i+1]); } aCksum[0] = cksum1; aCksum[1] = cksum2; } /* ** Return true if the checksum stored in TreeHeader object *pHdr is ** consistent with the contents of its other fields. */ static int treeHeaderChecksumOk(TreeHeader *pHdr){ u32 aCksum[2]; treeHeaderChecksum(pHdr, aCksum); return (0==memcmp(aCksum, pHdr->aCksum, sizeof(aCksum))); } /* ** This type is used by functions lsmTreeRepair() and treeSortByShmid() to ** make relinking the linked list of shared-memory chunks easier. */ typedef struct ShmChunkLoc ShmChunkLoc; struct ShmChunkLoc { ShmChunk *pShm; u32 iLoc; }; /* ** This function checks that the linked list of shared memory chunks ** that starts at chunk db->treehdr.iFirst: ** ** 1) Includes all chunks in the shared-memory region, and ** 2) Links them together in order of ascending shm-id. ** ** If no error occurs and the conditions above are met, LSM_OK is returned. ** ** If either of the conditions are untrue, LSM_CORRUPT is returned. Or, if ** an error is encountered before the checks are completed, another LSM error ** code (i.e. LSM_IOERR or LSM_NOMEM) may be returned. */ static int treeCheckLinkedList(lsm_db *db){ int rc = LSM_OK; int nVisit = 0; ShmChunk *p; p = treeShmChunkRc(db, db->treehdr.iFirst, &rc); while( rc==LSM_OK && p ){ if( p->iNext ){ if( p->iNext>=db->treehdr.nChunk ){ rc = LSM_CORRUPT_BKPT; }else{ ShmChunk *pNext = treeShmChunkRc(db, p->iNext, &rc); if( rc==LSM_OK ){ if( pNext->iShmid!=p->iShmid+1 ){ rc = LSM_CORRUPT_BKPT; } p = pNext; } } }else{ p = 0; } nVisit++; } if( rc==LSM_OK && (u32)nVisit!=db->treehdr.nChunk-1 ){ rc = LSM_CORRUPT_BKPT; } return rc; } /* ** Iterate through the current in-memory tree. If there are any v2-pointers ** with transaction ids larger than db->treehdr.iTransId, zero them. */ static int treeRepairPtrs(lsm_db *db){ int rc = LSM_OK; if( db->treehdr.root.nHeight>1 ){ TreeCursor csr; /* Cursor used to iterate through tree */ u32 iTransId = db->treehdr.root.iTransId; /* Initialize the cursor structure. Also decrement the nHeight variable ** in the tree-header. This will prevent the cursor from visiting any ** leaf nodes. */ db->treehdr.root.nHeight--; treeCursorInit(db, 0, &csr); rc = lsmTreeCursorEnd(&csr, 0); while( rc==LSM_OK && lsmTreeCursorValid(&csr) ){ TreeNode *pNode = csr.apTreeNode[csr.iNode]; if( pNode->iV2>iTransId ){ pNode->iV2Child = 0; pNode->iV2Ptr = 0; pNode->iV2 = 0; } rc = lsmTreeCursorNext(&csr); } tblobFree(csr.pDb, &csr.blob); db->treehdr.root.nHeight++; } return rc; } static int treeRepairList(lsm_db *db){ int rc = LSM_OK; int i; ShmChunk *p; ShmChunk *pMin = 0; u32 iMin = 0; /* Iterate through all shm chunks. Find the smallest shm-id present in ** the shared-memory region. */ for(i=1; rc==LSM_OK && (u32)itreehdr.nChunk; i++){ p = treeShmChunkRc(db, i, &rc); if( p && (pMin==0 || shm_sequence_ge(pMin->iShmid, p->iShmid)) ){ pMin = p; iMin = i; } } /* Fix the shm-id values on any chunks with a shm-id greater than or ** equal to treehdr.iNextShmid. Then do a merge-sort of all chunks to ** fix the ShmChunk.iNext pointers. */ if( rc==LSM_OK ){ int nSort; int nByte; u32 iPrevShmid; ShmChunkLoc *aSort; /* Allocate space for a merge sort. */ nSort = 1; while( (u32)nSort < (db->treehdr.nChunk-1) ) nSort = nSort * 2; nByte = sizeof(ShmChunkLoc) * nSort * 2; aSort = lsmMallocZeroRc(db->pEnv, nByte, &rc); iPrevShmid = pMin->iShmid; /* Fix all shm-ids, if required. */ if( rc==LSM_OK ){ iPrevShmid = pMin->iShmid-1; for(i=1; (u32)itreehdr.nChunk; i++){ p = treeShmChunk(db, i); aSort[i-1].pShm = p; aSort[i-1].iLoc = i; if( (u32)i!=db->treehdr.iFirst ){ if( shm_sequence_ge(p->iShmid, db->treehdr.iNextShmid) ){ p->iShmid = iPrevShmid--; } } } if( iMin!=db->treehdr.iFirst ){ p = treeShmChunk(db, db->treehdr.iFirst); p->iShmid = iPrevShmid; } } if( rc==LSM_OK ){ ShmChunkLoc *aSpace = &aSort[nSort]; for(i=0; iiShmid, iPrevShmid) ); assert( aSpace[aSort[i].pShm->iShmid - iPrevShmid].pShm==0 ); aSpace[aSort[i].pShm->iShmid - iPrevShmid] = aSort[i]; } } if( aSpace[nSort-1].pShm ) aSpace[nSort-1].pShm->iNext = 0; for(i=0; iiNext = aSpace[i+1].iLoc; } } rc = treeCheckLinkedList(db); lsmFree(db->pEnv, aSort); } } return rc; } /* ** This function is called as part of opening a write-transaction if the ** writer-flag is already set - indicating that the previous writer ** failed before ending its transaction. */ int lsmTreeRepair(lsm_db *db){ int rc = LSM_OK; TreeHeader hdr; ShmHeader *pHdr = db->pShmhdr; /* Ensure that the two tree-headers are consistent. Copy one over the other ** if necessary. Prefer the data from a tree-header for which the checksum ** computes. Or, if they both compute, prefer tree-header-1. */ if( memcmp(&pHdr->hdr1, &pHdr->hdr2, sizeof(TreeHeader)) ){ if( treeHeaderChecksumOk(&pHdr->hdr1) ){ memcpy(&pHdr->hdr2, &pHdr->hdr1, sizeof(TreeHeader)); }else{ memcpy(&pHdr->hdr1, &pHdr->hdr2, sizeof(TreeHeader)); } } /* Save the connections current copy of the tree-header. It will be ** restored before returning. */ memcpy(&hdr, &db->treehdr, sizeof(TreeHeader)); /* Walk the tree. Zero any v2 pointers with a transaction-id greater than ** the transaction-id currently in the tree-headers. */ rc = treeRepairPtrs(db); /* Repair the linked list of shared-memory chunks. */ if( rc==LSM_OK ){ rc = treeRepairList(db); } memcpy(&db->treehdr, &hdr, sizeof(TreeHeader)); return rc; } static void treeOverwriteKey(lsm_db *db, TreeCursor *pCsr, u32 iKey, int *pRc){ if( *pRc==LSM_OK ){ TreeRoot *p = &db->treehdr.root; TreeNode *pNew; u32 iNew; TreeNode *pNode = pCsr->apTreeNode[pCsr->iNode]; int iCell = pCsr->aiCell[pCsr->iNode]; /* Create a copy of this node */ if( (pCsr->iNode>0 && (u32)pCsr->iNode==(p->nHeight-1)) ){ pNew = copyTreeLeaf(db, (TreeLeaf *)pNode, &iNew, pRc); }else{ pNew = copyTreeNode(db, pNode, &iNew, pRc); } if( pNew ){ /* Modify the value in the new version */ pNew->aiKeyPtr[iCell] = iKey; /* Change the pointer in the parent (if any) to point at the new ** TreeNode */ pCsr->iNode--; treeUpdatePtr(db, pCsr, iNew); } } } static int treeNextIsEndDelete(lsm_db *db, TreeCursor *pCsr){ int iNode = pCsr->iNode; int iCell = pCsr->aiCell[iNode]+1; /* Cursor currently points to a leaf node. */ assert( (u32)pCsr->iNode==(db->treehdr.root.nHeight-1) ); while( iNode>=0 ){ TreeNode *pNode = pCsr->apTreeNode[iNode]; if( iCell<3 && pNode->aiKeyPtr[iCell] ){ int rc = LSM_OK; TreeKey *pKey = treeShmptr(db, pNode->aiKeyPtr[iCell]); assert( rc==LSM_OK ); return ((pKey->flags & LSM_END_DELETE) ? 1 : 0); } iNode--; iCell = pCsr->aiCell[iNode]; } return 0; } static int treePrevIsStartDelete(lsm_db *db, TreeCursor *pCsr){ int iNode = pCsr->iNode; /* Cursor currently points to a leaf node. */ assert( (u32)pCsr->iNode==(db->treehdr.root.nHeight-1) ); while( iNode>=0 ){ TreeNode *pNode = pCsr->apTreeNode[iNode]; int iCell = pCsr->aiCell[iNode]-1; if( iCell>=0 && pNode->aiKeyPtr[iCell] ){ int rc = LSM_OK; TreeKey *pKey = treeShmptr(db, pNode->aiKeyPtr[iCell]); assert( rc==LSM_OK ); return ((pKey->flags & LSM_START_DELETE) ? 1 : 0); } iNode--; } return 0; } static int treeInsertEntry( lsm_db *pDb, /* Database handle */ int flags, /* Flags associated with entry */ void *pKey, /* Pointer to key data */ int nKey, /* Size of key data in bytes */ void *pVal, /* Pointer to value data (or NULL) */ int nVal /* Bytes in value data (or -ve for delete) */ ){ int rc = LSM_OK; /* Return Code */ TreeKey *pTreeKey; /* New key-value being inserted */ u32 iTreeKey; TreeRoot *p = &pDb->treehdr.root; TreeCursor csr; /* Cursor to seek to pKey/nKey */ int res = 0; /* Result of seek operation on csr */ assert( nVal>=0 || pVal==0 ); assert_tree_looks_ok(LSM_OK, pTree); assert( flags==LSM_INSERT || flags==LSM_POINT_DELETE || flags==LSM_START_DELETE || flags==LSM_END_DELETE ); assert( (flags & LSM_CONTIGUOUS)==0 ); #if 0 dump_tree_contents(pDb, "before"); #endif if( p->iRoot ){ TreeKey *pRes; /* Key at end of seek operation */ treeCursorInit(pDb, 0, &csr); /* Seek to the leaf (or internal node) that the new key belongs on */ rc = lsmTreeCursorSeek(&csr, pKey, nKey, &res); pRes = csrGetKey(&csr, &csr.blob, &rc); if( rc!=LSM_OK ) return rc; assert( pRes ); if( flags==LSM_START_DELETE ){ /* When inserting a start-delete-range entry, if the key that ** occurs immediately before the new entry is already a START_DELETE, ** then the new entry is not required. */ if( (res<=0 && (pRes->flags & LSM_START_DELETE)) || (res>0 && treePrevIsStartDelete(pDb, &csr)) ){ goto insert_entry_out; } }else if( flags==LSM_END_DELETE ){ /* When inserting an start-delete-range entry, if the key that ** occurs immediately after the new entry is already an END_DELETE, ** then the new entry is not required. */ if( (res<0 && treeNextIsEndDelete(pDb, &csr)) || (res>=0 && (pRes->flags & LSM_END_DELETE)) ){ goto insert_entry_out; } } if( res==0 && (flags & (LSM_END_DELETE|LSM_START_DELETE)) ){ if( pRes->flags & LSM_INSERT ){ nVal = pRes->nValue; pVal = TKV_VAL(pRes); } flags = flags | pRes->flags; } if( flags & (LSM_INSERT|LSM_POINT_DELETE) ){ if( (res<0 && (pRes->flags & LSM_START_DELETE)) || (res>0 && (pRes->flags & LSM_END_DELETE)) ){ flags = flags | (LSM_END_DELETE|LSM_START_DELETE); }else if( res==0 ){ flags = flags | (pRes->flags & (LSM_END_DELETE|LSM_START_DELETE)); } } }else{ memset(&csr, 0, sizeof(TreeCursor)); } /* Allocate and populate a new key-value pair structure */ pTreeKey = newTreeKey(pDb, &iTreeKey, pKey, nKey, pVal, nVal, &rc); if( rc!=LSM_OK ) return rc; assert( pTreeKey->flags==0 || pTreeKey->flags==LSM_CONTIGUOUS ); pTreeKey->flags |= flags; if( p->iRoot==0 ){ /* The tree is completely empty. Add a new root node and install ** (pKey/nKey) as the middle entry. Even though it is a leaf at the ** moment, use newTreeNode() to allocate the node (i.e. allocate enough ** space for the fields used by interior nodes). This is because the ** treeInsert() routine may convert this node to an interior node. */ TreeNode *pRoot = newTreeNode(pDb, &p->iRoot, &rc); if( rc==LSM_OK ){ assert( p->nHeight==0 ); pRoot->aiKeyPtr[1] = iTreeKey; p->nHeight = 1; } }else{ if( res==0 ){ /* The search found a match within the tree. */ treeOverwriteKey(pDb, &csr, iTreeKey, &rc); }else{ /* The cursor now points to the leaf node into which the new entry should ** be inserted. There may or may not be a free slot within the leaf for ** the new key-value pair. ** ** iSlot is set to the index of the key within pLeaf that the new key ** should be inserted to the left of (or to a value 1 greater than the ** index of the rightmost key if the new key is larger than all keys ** currently stored in the node). */ int iSlot = csr.aiCell[csr.iNode] + (res<0); if( csr.iNode==0 ){ rc = treeInsert(pDb, &csr, 0, iTreeKey, 0, iSlot); }else{ rc = treeInsertLeaf(pDb, &csr, iTreeKey, iSlot); } } } #if 0 dump_tree_contents(pDb, "after"); #endif insert_entry_out: tblobFree(pDb, &csr.blob); assert_tree_looks_ok(rc, pTree); return rc; } /* ** Insert a new entry into the in-memory tree. ** ** If the value of the 5th parameter, nVal, is negative, then a delete-marker ** is inserted into the tree. In this case the value pointer, pVal, must be ** NULL. */ int lsmTreeInsert( lsm_db *pDb, /* Database handle */ void *pKey, /* Pointer to key data */ int nKey, /* Size of key data in bytes */ void *pVal, /* Pointer to value data (or NULL) */ int nVal /* Bytes in value data (or -ve for delete) */ ){ int flags; if( nVal<0 ){ flags = LSM_POINT_DELETE; }else{ flags = LSM_INSERT; } return treeInsertEntry(pDb, flags, pKey, nKey, pVal, nVal); } static int treeDeleteEntry(lsm_db *db, TreeCursor *pCsr, u32 iNewptr){ TreeRoot *p = &db->treehdr.root; TreeNode *pNode = pCsr->apTreeNode[pCsr->iNode]; int iSlot = pCsr->aiCell[pCsr->iNode]; int bLeaf; int rc = LSM_OK; assert( pNode->aiKeyPtr[1] ); assert( pNode->aiKeyPtr[iSlot] ); assert( iSlot==0 || iSlot==1 || iSlot==2 ); assert( ((u32)pCsr->iNode==(db->treehdr.root.nHeight-1))==(iNewptr==0) ); bLeaf = ((u32)pCsr->iNode==(p->nHeight-1) && p->nHeight>1); if( pNode->aiKeyPtr[0] || pNode->aiKeyPtr[2] ){ /* There are currently at least 2 keys on this node. So just create ** a new copy of the node with one of the keys removed. If the node ** happens to be the root node of the tree, allocate an entire ** TreeNode structure instead of just a TreeLeaf. */ TreeNode *pNew; u32 iNew; if( bLeaf ){ pNew = (TreeNode *)newTreeLeaf(db, &iNew, &rc); }else{ pNew = newTreeNode(db, &iNew, &rc); } if( pNew ){ int i; int iOut = 1; for(i=0; i<4; i++){ if( i==iSlot ){ i++; if( bLeaf==0 ) pNew->aiChildPtr[iOut] = iNewptr; if( i<3 ) pNew->aiKeyPtr[iOut] = pNode->aiKeyPtr[i]; iOut++; }else if( bLeaf || p->nHeight==1 ){ if( i<3 && pNode->aiKeyPtr[i] ){ pNew->aiKeyPtr[iOut++] = pNode->aiKeyPtr[i]; } }else{ if( getChildPtr(pNode, WORKING_VERSION, i) ){ pNew->aiChildPtr[iOut] = getChildPtr(pNode, WORKING_VERSION, i); if( i<3 ) pNew->aiKeyPtr[iOut] = pNode->aiKeyPtr[i]; iOut++; } } } assert( iOut<=4 ); assert( bLeaf || pNew->aiChildPtr[0]==0 ); pCsr->iNode--; rc = treeUpdatePtr(db, pCsr, iNew); } }else if( pCsr->iNode==0 ){ /* Removing the only key in the root node. iNewptr is the new root. */ assert( iSlot==1 ); db->treehdr.root.iRoot = iNewptr; db->treehdr.root.nHeight--; }else{ /* There is only one key on this node and the node is not the root ** node. Find a peer for this node. Then redistribute the contents of ** the peer and the parent cell between the parent and either one or ** two new nodes. */ TreeNode *pParent; /* Parent tree node */ int iPSlot; u32 iPeer; /* Pointer to peer leaf node */ int iDir; TreeNode *pPeer; /* The peer leaf node */ TreeNode *pNew1; u32 iNew1; /* First new leaf node */ assert( iSlot==1 ); pParent = pCsr->apTreeNode[pCsr->iNode-1]; iPSlot = pCsr->aiCell[pCsr->iNode-1]; if( iPSlot>0 && getChildPtr(pParent, WORKING_VERSION, iPSlot-1) ){ iDir = -1; }else{ iDir = +1; } iPeer = getChildPtr(pParent, WORKING_VERSION, iPSlot+iDir); pPeer = (TreeNode *)treeShmptr(db, iPeer); assertIsWorkingChild(db, pNode, pParent, iPSlot); /* Allocate the first new leaf node. This is always required. */ if( bLeaf ){ pNew1 = (TreeNode *)newTreeLeaf(db, &iNew1, &rc); }else{ pNew1 = (TreeNode *)newTreeNode(db, &iNew1, &rc); } if( pPeer->aiKeyPtr[0] && pPeer->aiKeyPtr[2] ){ /* Peer node is completely full. This means that two new leaf nodes ** and a new parent node are required. */ TreeNode *pNew2; u32 iNew2; /* Second new leaf node */ TreeNode *pNewP; u32 iNewP; /* New parent node */ if( bLeaf ){ pNew2 = (TreeNode *)newTreeLeaf(db, &iNew2, &rc); }else{ pNew2 = (TreeNode *)newTreeNode(db, &iNew2, &rc); } pNewP = copyTreeNode(db, pParent, &iNewP, &rc); if( iDir==-1 ){ pNew1->aiKeyPtr[1] = pPeer->aiKeyPtr[0]; if( bLeaf==0 ){ pNew1->aiChildPtr[1] = getChildPtr(pPeer, WORKING_VERSION, 0); pNew1->aiChildPtr[2] = getChildPtr(pPeer, WORKING_VERSION, 1); } pNewP->aiChildPtr[iPSlot-1] = iNew1; pNewP->aiKeyPtr[iPSlot-1] = pPeer->aiKeyPtr[1]; pNewP->aiChildPtr[iPSlot] = iNew2; pNew2->aiKeyPtr[0] = pPeer->aiKeyPtr[2]; pNew2->aiKeyPtr[1] = pParent->aiKeyPtr[iPSlot-1]; if( bLeaf==0 ){ pNew2->aiChildPtr[0] = getChildPtr(pPeer, WORKING_VERSION, 2); pNew2->aiChildPtr[1] = getChildPtr(pPeer, WORKING_VERSION, 3); pNew2->aiChildPtr[2] = iNewptr; } }else{ pNew1->aiKeyPtr[1] = pParent->aiKeyPtr[iPSlot]; if( bLeaf==0 ){ pNew1->aiChildPtr[1] = iNewptr; pNew1->aiChildPtr[2] = getChildPtr(pPeer, WORKING_VERSION, 0); } pNewP->aiChildPtr[iPSlot] = iNew1; pNewP->aiKeyPtr[iPSlot] = pPeer->aiKeyPtr[0]; pNewP->aiChildPtr[iPSlot+1] = iNew2; pNew2->aiKeyPtr[0] = pPeer->aiKeyPtr[1]; pNew2->aiKeyPtr[1] = pPeer->aiKeyPtr[2]; if( bLeaf==0 ){ pNew2->aiChildPtr[0] = getChildPtr(pPeer, WORKING_VERSION, 1); pNew2->aiChildPtr[1] = getChildPtr(pPeer, WORKING_VERSION, 2); pNew2->aiChildPtr[2] = getChildPtr(pPeer, WORKING_VERSION, 3); } } assert( pCsr->iNode>=1 ); pCsr->iNode -= 2; if( rc==LSM_OK ){ assert( pNew1->aiKeyPtr[1] && pNew2->aiKeyPtr[1] ); rc = treeUpdatePtr(db, pCsr, iNewP); } }else{ int iKOut = 0; int iPOut = 0; int i; pCsr->iNode--; if( iDir==1 ){ pNew1->aiKeyPtr[iKOut++] = pParent->aiKeyPtr[iPSlot]; if( bLeaf==0 ) pNew1->aiChildPtr[iPOut++] = iNewptr; } for(i=0; i<3; i++){ if( pPeer->aiKeyPtr[i] ){ pNew1->aiKeyPtr[iKOut++] = pPeer->aiKeyPtr[i]; } } if( bLeaf==0 ){ for(i=0; i<4; i++){ if( getChildPtr(pPeer, WORKING_VERSION, i) ){ pNew1->aiChildPtr[iPOut++] = getChildPtr(pPeer, WORKING_VERSION, i); } } } if( iDir==-1 ){ iPSlot--; pNew1->aiKeyPtr[iKOut++] = pParent->aiKeyPtr[iPSlot]; if( bLeaf==0 ) pNew1->aiChildPtr[iPOut++] = iNewptr; pCsr->aiCell[pCsr->iNode] = (u8)iPSlot; } rc = treeDeleteEntry(db, pCsr, iNew1); } } return rc; } /* ** Delete a range of keys from the tree structure (i.e. the lsm_delete_range() ** function, not lsm_delete()). ** ** This is a two step process: ** ** 1) Remove all entries currently stored in the tree that have keys ** that fall into the deleted range. ** ** TODO: There are surely good ways to optimize this step - removing ** a range of keys from a b-tree. But for now, this function removes ** them one at a time using the usual approach. ** ** 2) Unless the largest key smaller than or equal to (pKey1/nKey1) is ** already marked as START_DELETE, insert a START_DELETE key. ** Similarly, unless the smallest key greater than or equal to ** (pKey2/nKey2) is already START_END, insert a START_END key. */ int lsmTreeDelete( lsm_db *db, void *pKey1, int nKey1, /* Start of range */ void *pKey2, int nKey2 /* End of range */ ){ int rc = LSM_OK; int bDone = 0; TreeRoot *p = &db->treehdr.root; TreeBlob blob = {0, 0}; /* The range must be sensible - that (key1 < key2). */ assert( treeKeycmp(pKey1, nKey1, pKey2, nKey2)<0 ); assert( assert_delete_ranges_match(db) ); #if 0 static int nCall = 0; printf("\n"); nCall++; printf("%d delete %s .. %s\n", nCall, (char *)pKey1, (char *)pKey2); dump_tree_contents(db, "before delete"); #endif /* Step 1. This loop runs until the tree contains no keys within the ** range being deleted. Or until an error occurs. */ while( bDone==0 && rc==LSM_OK ){ int res; TreeCursor csr; /* Cursor to seek to first key in range */ void *pDel; int nDel; /* Key to (possibly) delete this iteration */ #ifndef NDEBUG int nEntry = treeCountEntries(db); #endif /* Seek the cursor to the first entry in the tree greater than pKey1. */ treeCursorInit(db, 0, &csr); lsmTreeCursorSeek(&csr, pKey1, nKey1, &res); if( res<=0 && lsmTreeCursorValid(&csr) ) lsmTreeCursorNext(&csr); /* If there is no such entry, or if it is greater than pKey2, then the ** tree now contains no keys in the range being deleted. In this case ** break out of the loop. */ bDone = 1; if( lsmTreeCursorValid(&csr) ){ lsmTreeCursorKey(&csr, 0, &pDel, &nDel); if( treeKeycmp(pDel, nDel, pKey2, nKey2)<0 ) bDone = 0; } if( bDone==0 ){ if( (u32)csr.iNode==(p->nHeight-1) ){ /* The element to delete already lies on a leaf node */ rc = treeDeleteEntry(db, &csr, 0); }else{ /* 1. Overwrite the current key with a copy of the next key in the ** tree (key N). ** ** 2. Seek to key N (cursor will stop at the internal node copy of ** N). Move to the next key (original copy of N). Delete ** this entry. */ u32 iKey; TreeKey *pKey; int iNode = csr.iNode; lsmTreeCursorNext(&csr); assert( (u32)csr.iNode==(p->nHeight-1) ); iKey = csr.apTreeNode[csr.iNode]->aiKeyPtr[csr.aiCell[csr.iNode]]; lsmTreeCursorPrev(&csr); treeOverwriteKey(db, &csr, iKey, &rc); pKey = treeShmkey(db, iKey, TKV_LOADKEY, &blob, &rc); if( pKey ){ rc = lsmTreeCursorSeek(&csr, TKV_KEY(pKey), pKey->nKey, &res); } if( rc==LSM_OK ){ assert( res==0 && csr.iNode==iNode ); rc = lsmTreeCursorNext(&csr); if( rc==LSM_OK ){ rc = treeDeleteEntry(db, &csr, 0); } } } } /* Clean up any memory allocated by the cursor. */ tblobFree(db, &csr.blob); #if 0 dump_tree_contents(db, "ddd delete"); #endif assert( bDone || treeCountEntries(db)==(nEntry-1) ); } #if 0 dump_tree_contents(db, "during delete"); #endif /* Now insert the START_DELETE and END_DELETE keys. */ if( rc==LSM_OK ){ rc = treeInsertEntry(db, LSM_START_DELETE, pKey1, nKey1, 0, -1); } #if 0 dump_tree_contents(db, "during delete 2"); #endif if( rc==LSM_OK ){ rc = treeInsertEntry(db, LSM_END_DELETE, pKey2, nKey2, 0, -1); } #if 0 dump_tree_contents(db, "after delete"); #endif tblobFree(db, &blob); assert( assert_delete_ranges_match(db) ); return rc; } /* ** Return, in bytes, the amount of memory currently used by the tree ** structure. */ int lsmTreeSize(lsm_db *pDb){ return pDb->treehdr.root.nByte; } /* ** Open a cursor on the in-memory tree pTree. */ int lsmTreeCursorNew(lsm_db *pDb, int bOld, TreeCursor **ppCsr){ TreeCursor *pCsr; *ppCsr = pCsr = lsmMalloc(pDb->pEnv, sizeof(TreeCursor)); if( pCsr ){ treeCursorInit(pDb, bOld, pCsr); return LSM_OK; } return LSM_NOMEM_BKPT; } /* ** Close an in-memory tree cursor. */ void lsmTreeCursorDestroy(TreeCursor *pCsr){ if( pCsr ){ tblobFree(pCsr->pDb, &pCsr->blob); lsmFree(pCsr->pDb->pEnv, pCsr); } } void lsmTreeCursorReset(TreeCursor *pCsr){ if( pCsr ){ pCsr->iNode = -1; pCsr->pSave = 0; } } #ifndef NDEBUG static int treeCsrCompare(TreeCursor *pCsr, void *pKey, int nKey, int *pRc){ TreeKey *p; int cmp = 0; assert( pCsr->iNode>=0 ); p = csrGetKey(pCsr, &pCsr->blob, pRc); if( p ){ cmp = treeKeycmp(TKV_KEY(p), p->nKey, pKey, nKey); } return cmp; } #endif /* ** Attempt to seek the cursor passed as the first argument to key (pKey/nKey) ** in the tree structure. If an exact match for the key is found, leave the ** cursor pointing to it and set *pRes to zero before returning. If an ** exact match cannot be found, do one of the following: ** ** * Leave the cursor pointing to the smallest element in the tree that ** is larger than the key and set *pRes to +1, or ** ** * Leave the cursor pointing to the largest element in the tree that ** is smaller than the key and set *pRes to -1, or ** ** * If the tree is empty, leave the cursor at EOF and set *pRes to -1. */ int lsmTreeCursorSeek(TreeCursor *pCsr, void *pKey, int nKey, int *pRes){ int rc = LSM_OK; /* Return code */ lsm_db *pDb = pCsr->pDb; TreeRoot *pRoot = pCsr->pRoot; u32 iNodePtr; /* Location of current node in search */ /* Discard any saved position data */ treeCursorRestore(pCsr, 0); iNodePtr = pRoot->iRoot; if( iNodePtr==0 ){ /* Either an error occurred or the tree is completely empty. */ assert( rc!=LSM_OK || pRoot->iRoot==0 ); *pRes = -1; pCsr->iNode = -1; }else{ TreeBlob b = {0, 0}; int res = 0; /* Result of comparison function */ int iNode = -1; while( iNodePtr ){ TreeNode *pNode; /* Node at location iNodePtr */ int iTest; /* Index of second key to test (0 or 2) */ u32 iTreeKey; TreeKey *pTreeKey; /* Key to compare against */ pNode = (TreeNode *)treeShmptrUnsafe(pDb, iNodePtr); iNode++; pCsr->apTreeNode[iNode] = pNode; /* Compare (pKey/nKey) with the key in the middle slot of B-tree node ** pNode. The middle slot is never empty. If the comparison is a match, ** then the search is finished. Break out of the loop. */ pTreeKey = (TreeKey*)treeShmptrUnsafe(pDb, pNode->aiKeyPtr[1]); if( !(pTreeKey->flags & LSM_CONTIGUOUS) ){ pTreeKey = treeShmkey(pDb, pNode->aiKeyPtr[1], TKV_LOADKEY, &b, &rc); if( rc!=LSM_OK ) break; } res = treeKeycmp((void *)&pTreeKey[1], pTreeKey->nKey, pKey, nKey); if( res==0 ){ pCsr->aiCell[iNode] = 1; break; } /* Based on the results of the previous comparison, compare (pKey/nKey) ** to either the left or right key of the B-tree node, if such a key ** exists. */ iTest = (res>0 ? 0 : 2); iTreeKey = pNode->aiKeyPtr[iTest]; if( iTreeKey ){ pTreeKey = (TreeKey*)treeShmptrUnsafe(pDb, iTreeKey); if( !(pTreeKey->flags & LSM_CONTIGUOUS) ){ pTreeKey = treeShmkey(pDb, iTreeKey, TKV_LOADKEY, &b, &rc); if( rc ) break; } res = treeKeycmp((void *)&pTreeKey[1], pTreeKey->nKey, pKey, nKey); if( res==0 ){ pCsr->aiCell[iNode] = (u8)iTest; break; } }else{ iTest = 1; } if( (u32)iNode<(pRoot->nHeight-1) ){ iNodePtr = getChildPtr(pNode, pRoot->iTransId, iTest + (res<0)); }else{ iNodePtr = 0; } pCsr->aiCell[iNode] = (u8)(iTest + (iNodePtr && (res<0))); } *pRes = res; pCsr->iNode = iNode; tblobFree(pDb, &b); } /* assert() that *pRes has been set properly */ #ifndef NDEBUG if( rc==LSM_OK && lsmTreeCursorValid(pCsr) ){ int cmp = treeCsrCompare(pCsr, pKey, nKey, &rc); assert( rc!=LSM_OK || *pRes==cmp || (*pRes ^ cmp)>0 ); } #endif return rc; } int lsmTreeCursorNext(TreeCursor *pCsr){ #ifndef NDEBUG TreeKey *pK1; TreeBlob key1 = {0, 0}; #endif lsm_db *pDb = pCsr->pDb; TreeRoot *pRoot = pCsr->pRoot; const int iLeaf = pRoot->nHeight-1; int iCell; int rc = LSM_OK; TreeNode *pNode; /* Restore the cursor position, if required */ int iRestore = 0; treeCursorRestore(pCsr, &iRestore); if( iRestore>0 ) return LSM_OK; /* Save a pointer to the current key. This is used in an assert() at the ** end of this function - to check that the 'next' key really is larger ** than the current key. */ #ifndef NDEBUG pK1 = csrGetKey(pCsr, &key1, &rc); if( rc!=LSM_OK ) return rc; #endif assert( lsmTreeCursorValid(pCsr) ); assert( pCsr->aiCell[pCsr->iNode]<3 ); pNode = pCsr->apTreeNode[pCsr->iNode]; iCell = ++pCsr->aiCell[pCsr->iNode]; /* If the current node is not a leaf, and the current cell has sub-tree ** associated with it, descend to the left-most key on the left-most ** leaf of the sub-tree. */ if( pCsr->iNodeiTransId, iCell) ){ do { u32 iNodePtr; pCsr->iNode++; iNodePtr = getChildPtr(pNode, pRoot->iTransId, iCell); pNode = (TreeNode *)treeShmptr(pDb, iNodePtr); pCsr->apTreeNode[pCsr->iNode] = pNode; iCell = pCsr->aiCell[pCsr->iNode] = (pNode->aiKeyPtr[0]==0); }while( pCsr->iNode < iLeaf ); } /* Otherwise, the next key is found by following pointer up the tree ** until there is a key immediately to the right of the pointer followed ** to reach the sub-tree containing the current key. */ else if( iCell>=3 || pNode->aiKeyPtr[iCell]==0 ){ while( (--pCsr->iNode)>=0 ){ iCell = pCsr->aiCell[pCsr->iNode]; if( iCell<3 && pCsr->apTreeNode[pCsr->iNode]->aiKeyPtr[iCell] ) break; } } #ifndef NDEBUG if( pCsr->iNode>=0 ){ TreeKey *pK2 = csrGetKey(pCsr, &pCsr->blob, &rc); assert( rc||treeKeycmp(TKV_KEY(pK2),pK2->nKey,TKV_KEY(pK1),pK1->nKey)>=0 ); } tblobFree(pDb, &key1); #endif return rc; } int lsmTreeCursorPrev(TreeCursor *pCsr){ #ifndef NDEBUG TreeKey *pK1; TreeBlob key1 = {0, 0}; #endif lsm_db *pDb = pCsr->pDb; TreeRoot *pRoot = pCsr->pRoot; const int iLeaf = pRoot->nHeight-1; int iCell; int rc = LSM_OK; TreeNode *pNode; /* Restore the cursor position, if required */ int iRestore = 0; treeCursorRestore(pCsr, &iRestore); if( iRestore<0 ) return LSM_OK; /* Save a pointer to the current key. This is used in an assert() at the ** end of this function - to check that the 'next' key really is smaller ** than the current key. */ #ifndef NDEBUG pK1 = csrGetKey(pCsr, &key1, &rc); if( rc!=LSM_OK ) return rc; #endif assert( lsmTreeCursorValid(pCsr) ); pNode = pCsr->apTreeNode[pCsr->iNode]; iCell = pCsr->aiCell[pCsr->iNode]; assert( iCell>=0 && iCell<3 ); /* If the current node is not a leaf, and the current cell has sub-tree ** associated with it, descend to the right-most key on the right-most ** leaf of the sub-tree. */ if( pCsr->iNodeiTransId, iCell) ){ do { u32 iNodePtr; pCsr->iNode++; iNodePtr = getChildPtr(pNode, pRoot->iTransId, iCell); pNode = (TreeNode *)treeShmptr(pDb, iNodePtr); if( rc!=LSM_OK ) break; pCsr->apTreeNode[pCsr->iNode] = pNode; iCell = 1 + (pNode->aiKeyPtr[2]!=0) + (pCsr->iNode < iLeaf); pCsr->aiCell[pCsr->iNode] = (u8)iCell; }while( pCsr->iNode < iLeaf ); } /* Otherwise, the next key is found by following pointer up the tree until ** there is a key immediately to the left of the pointer followed to reach ** the sub-tree containing the current key. */ else{ do { iCell = pCsr->aiCell[pCsr->iNode]-1; if( iCell>=0 && pCsr->apTreeNode[pCsr->iNode]->aiKeyPtr[iCell] ) break; }while( (--pCsr->iNode)>=0 ); pCsr->aiCell[pCsr->iNode] = (u8)iCell; } #ifndef NDEBUG if( pCsr->iNode>=0 ){ TreeKey *pK2 = csrGetKey(pCsr, &pCsr->blob, &rc); assert( rc || treeKeycmp(TKV_KEY(pK2),pK2->nKey,TKV_KEY(pK1),pK1->nKey)<0 ); } tblobFree(pDb, &key1); #endif return rc; } /* ** Move the cursor to the first (bLast==0) or last (bLast!=0) entry in the ** in-memory tree. */ int lsmTreeCursorEnd(TreeCursor *pCsr, int bLast){ lsm_db *pDb = pCsr->pDb; TreeRoot *pRoot = pCsr->pRoot; int rc = LSM_OK; u32 iNodePtr; pCsr->iNode = -1; /* Discard any saved position data */ treeCursorRestore(pCsr, 0); iNodePtr = pRoot->iRoot; while( iNodePtr ){ int iCell; TreeNode *pNode; pNode = (TreeNode *)treeShmptr(pDb, iNodePtr); if( rc ) break; if( bLast ){ iCell = ((pNode->aiKeyPtr[2]==0) ? 2 : 3); }else{ iCell = ((pNode->aiKeyPtr[0]==0) ? 1 : 0); } pCsr->iNode++; pCsr->apTreeNode[pCsr->iNode] = pNode; if( (u32)pCsr->iNodenHeight-1 ){ iNodePtr = getChildPtr(pNode, pRoot->iTransId, iCell); }else{ iNodePtr = 0; } pCsr->aiCell[pCsr->iNode] = (u8)(iCell - (iNodePtr==0 && bLast)); } return rc; } int lsmTreeCursorFlags(TreeCursor *pCsr){ int flags = 0; if( pCsr && pCsr->iNode>=0 ){ int rc = LSM_OK; TreeKey *pKey = (TreeKey *)treeShmptrUnsafe(pCsr->pDb, pCsr->apTreeNode[pCsr->iNode]->aiKeyPtr[pCsr->aiCell[pCsr->iNode]] ); assert( rc==LSM_OK ); flags = (pKey->flags & ~LSM_CONTIGUOUS); } return flags; } int lsmTreeCursorKey(TreeCursor *pCsr, int *pFlags, void **ppKey, int *pnKey){ TreeKey *pTreeKey; int rc = LSM_OK; assert( lsmTreeCursorValid(pCsr) ); pTreeKey = pCsr->pSave; if( !pTreeKey ){ pTreeKey = csrGetKey(pCsr, &pCsr->blob, &rc); } if( rc==LSM_OK ){ *pnKey = pTreeKey->nKey; if( pFlags ) *pFlags = pTreeKey->flags; *ppKey = (void *)&pTreeKey[1]; } return rc; } int lsmTreeCursorValue(TreeCursor *pCsr, void **ppVal, int *pnVal){ int res = 0; int rc; rc = treeCursorRestore(pCsr, &res); if( res==0 ){ TreeKey *pTreeKey = csrGetKey(pCsr, &pCsr->blob, &rc); if( rc==LSM_OK ){ if( pTreeKey->flags & LSM_INSERT ){ *pnVal = pTreeKey->nValue; *ppVal = TKV_VAL(pTreeKey); }else{ *ppVal = 0; *pnVal = -1; } } }else{ *ppVal = 0; *pnVal = 0; } return rc; } /* ** Return true if the cursor currently points to a valid entry. */ int lsmTreeCursorValid(TreeCursor *pCsr){ return (pCsr && (pCsr->pSave || pCsr->iNode>=0)); } /* ** Store a mark in *pMark. Later on, a call to lsmTreeRollback() with a ** pointer to the same TreeMark structure may be used to roll the tree ** contents back to their current state. */ void lsmTreeMark(lsm_db *pDb, TreeMark *pMark){ pMark->iRoot = pDb->treehdr.root.iRoot; pMark->nHeight = pDb->treehdr.root.nHeight; pMark->iWrite = pDb->treehdr.iWrite; pMark->nChunk = pDb->treehdr.nChunk; pMark->iNextShmid = pDb->treehdr.iNextShmid; pMark->iRollback = intArraySize(&pDb->rollback); } /* ** Roll back to mark pMark. Structure *pMark should have been previously ** populated by a call to lsmTreeMark(). */ void lsmTreeRollback(lsm_db *pDb, TreeMark *pMark){ int iIdx; int nIdx; u32 iNext; ShmChunk *pChunk; u32 iChunk; u32 iShmid; /* Revert all required v2 pointers. */ nIdx = intArraySize(&pDb->rollback); for(iIdx = pMark->iRollback; iIdxrollback, iIdx)); assert( pNode ); pNode->iV2 = 0; pNode->iV2Child = 0; pNode->iV2Ptr = 0; } intArrayTruncate(&pDb->rollback, pMark->iRollback); /* Restore the free-chunk list. */ assert( pMark->iWrite!=0 ); iChunk = treeOffsetToChunk(pMark->iWrite-1); pChunk = treeShmChunk(pDb, iChunk); iNext = pChunk->iNext; pChunk->iNext = 0; pChunk = treeShmChunk(pDb, pDb->treehdr.iFirst); iShmid = pChunk->iShmid-1; while( iNext ){ u32 iFree = iNext; /* Current chunk being rollback-freed */ ShmChunk *pFree; /* Pointer to chunk iFree */ pFree = treeShmChunk(pDb, iFree); iNext = pFree->iNext; if( iFreenChunk ){ pFree->iNext = pDb->treehdr.iFirst; pFree->iShmid = iShmid--; pDb->treehdr.iFirst = iFree; } } /* Restore the tree-header fields */ pDb->treehdr.root.iRoot = pMark->iRoot; pDb->treehdr.root.nHeight = pMark->nHeight; pDb->treehdr.iWrite = pMark->iWrite; pDb->treehdr.nChunk = pMark->nChunk; pDb->treehdr.iNextShmid = pMark->iNextShmid; } /* ** Load the in-memory tree header from shared-memory into pDb->treehdr. ** If the header cannot be loaded, return LSM_PROTOCOL. ** ** If the header is successfully loaded and parameter piRead is not NULL, ** is is set to 1 if the header was loaded from ShmHeader.hdr1, or 2 if ** the header was loaded from ShmHeader.hdr2. */ int lsmTreeLoadHeader(lsm_db *pDb, int *piRead){ int nRem = LSM_ATTEMPTS_BEFORE_PROTOCOL; while( (nRem--)>0 ){ ShmHeader *pShm = pDb->pShmhdr; memcpy(&pDb->treehdr, &pShm->hdr1, sizeof(TreeHeader)); if( treeHeaderChecksumOk(&pDb->treehdr) ){ if( piRead ) *piRead = 1; return LSM_OK; } memcpy(&pDb->treehdr, &pShm->hdr2, sizeof(TreeHeader)); if( treeHeaderChecksumOk(&pDb->treehdr) ){ if( piRead ) *piRead = 2; return LSM_OK; } lsmShmBarrier(pDb); } return LSM_PROTOCOL_BKPT; } int lsmTreeLoadHeaderOk(lsm_db *pDb, int iRead){ TreeHeader *p = (iRead==1) ? &pDb->pShmhdr->hdr1 : &pDb->pShmhdr->hdr2; assert( iRead==1 || iRead==2 ); return (0==memcmp(pDb->treehdr.aCksum, p->aCksum, sizeof(u32)*2)); } /* ** This function is called to conclude a transaction. If argument bCommit ** is true, the transaction is committed. Otherwise it is rolled back. */ int lsmTreeEndTransaction(lsm_db *pDb, int bCommit){ ShmHeader *pShm = pDb->pShmhdr; treeHeaderChecksum(&pDb->treehdr, pDb->treehdr.aCksum); memcpy(&pShm->hdr2, &pDb->treehdr, sizeof(TreeHeader)); lsmShmBarrier(pDb); memcpy(&pShm->hdr1, &pDb->treehdr, sizeof(TreeHeader)); pShm->bWriter = 0; intArrayFree(pDb->pEnv, &pDb->rollback); return LSM_OK; } #ifndef NDEBUG static int assert_delete_ranges_match(lsm_db *db){ int prev = 0; TreeBlob blob = {0, 0}; TreeCursor csr; /* Cursor used to iterate through tree */ int rc; treeCursorInit(db, 0, &csr); for( rc = lsmTreeCursorEnd(&csr, 0); rc==LSM_OK && lsmTreeCursorValid(&csr); rc = lsmTreeCursorNext(&csr) ){ TreeKey *pKey = csrGetKey(&csr, &blob, &rc); if( rc!=LSM_OK ) break; assert( ((prev&LSM_START_DELETE)==0)==((pKey->flags&LSM_END_DELETE)==0) ); prev = pKey->flags; } tblobFree(csr.pDb, &csr.blob); tblobFree(csr.pDb, &blob); return 1; } static int treeCountEntries(lsm_db *db){ TreeCursor csr; /* Cursor used to iterate through tree */ int rc; int nEntry = 0; treeCursorInit(db, 0, &csr); for( rc = lsmTreeCursorEnd(&csr, 0); rc==LSM_OK && lsmTreeCursorValid(&csr); rc = lsmTreeCursorNext(&csr) ){ nEntry++; } tblobFree(csr.pDb, &csr.blob); return nEntry; } #endif ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_unix.c ================================================ /* ** 2011-12-03 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** Unix-specific run-time environment implementation for LSM. */ #ifndef _WIN32 #if defined(__GNUC__) || defined(__TINYC__) /* workaround for ftruncate() visibility on gcc. */ # ifndef _XOPEN_SOURCE # define _XOPEN_SOURCE 500 # endif #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include "lsmInt.h" /* There is no fdatasync() call on Android */ #ifdef __ANDROID__ # define fdatasync(x) fsync(x) #endif /* ** An open file is an instance of the following object */ typedef struct PosixFile PosixFile; struct PosixFile { lsm_env *pEnv; /* The run-time environment */ const char *zName; /* Full path to file */ int fd; /* The open file descriptor */ int shmfd; /* Shared memory file-descriptor */ void *pMap; /* Pointer to mapping of file fd */ off_t nMap; /* Size of mapping at pMap in bytes */ int nShm; /* Number of entries in array apShm[] */ void **apShm; /* Array of 32K shared memory segments */ }; static char *posixShmFile(PosixFile *p){ char *zShm; int nName = strlen(p->zName); zShm = (char *)lsmMalloc(p->pEnv, nName+4+1); if( zShm ){ memcpy(zShm, p->zName, nName); memcpy(&zShm[nName], "-shm", 5); } return zShm; } static int lsmPosixOsOpen( lsm_env *pEnv, const char *zFile, int flags, lsm_file **ppFile ){ int rc = LSM_OK; PosixFile *p; p = lsm_malloc(pEnv, sizeof(PosixFile)); if( p==0 ){ rc = LSM_NOMEM; }else{ int bReadonly = (flags & LSM_OPEN_READONLY); int oflags = (bReadonly ? O_RDONLY : (O_RDWR|O_CREAT)); memset(p, 0, sizeof(PosixFile)); p->zName = zFile; p->pEnv = pEnv; p->fd = open(zFile, oflags, 0644); if( p->fd<0 ){ lsm_free(pEnv, p); p = 0; if( errno==ENOENT ){ rc = lsmErrorBkpt(LSM_IOERR_NOENT); }else{ rc = LSM_IOERR_BKPT; } } } *ppFile = (lsm_file *)p; return rc; } static int lsmPosixOsWrite( lsm_file *pFile, /* File to write to */ lsm_i64 iOff, /* Offset to write to */ void *pData, /* Write data from this buffer */ int nData /* Bytes of data to write */ ){ int rc = LSM_OK; PosixFile *p = (PosixFile *)pFile; off_t offset; offset = lseek(p->fd, (off_t)iOff, SEEK_SET); if( offset!=iOff ){ rc = LSM_IOERR_BKPT; }else{ ssize_t prc = write(p->fd, pData, (size_t)nData); if( prc<0 ) rc = LSM_IOERR_BKPT; } return rc; } static int lsmPosixOsTruncate( lsm_file *pFile, /* File to write to */ lsm_i64 nSize /* Size to truncate file to */ ){ PosixFile *p = (PosixFile *)pFile; int rc = LSM_OK; /* Return code */ int prc; /* Posix Return Code */ struct stat sStat; /* Result of fstat() invocation */ prc = fstat(p->fd, &sStat); if( prc==0 && sStat.st_size>nSize ){ prc = ftruncate(p->fd, (off_t)nSize); } if( prc<0 ) rc = LSM_IOERR_BKPT; return rc; } static int lsmPosixOsRead( lsm_file *pFile, /* File to read from */ lsm_i64 iOff, /* Offset to read from */ void *pData, /* Read data into this buffer */ int nData /* Bytes of data to read */ ){ int rc = LSM_OK; PosixFile *p = (PosixFile *)pFile; off_t offset; offset = lseek(p->fd, (off_t)iOff, SEEK_SET); if( offset!=iOff ){ rc = LSM_IOERR_BKPT; }else{ ssize_t prc = read(p->fd, pData, (size_t)nData); if( prc<0 ){ rc = LSM_IOERR_BKPT; }else if( prcpMap ){ prc = msync(p->pMap, p->nMap, MS_SYNC); } if( prc==0 ) prc = fdatasync(p->fd); if( prc<0 ) rc = LSM_IOERR_BKPT; #else (void)pFile; #endif return rc; } static int lsmPosixOsSectorSize(lsm_file *pFile){ return 512; } static int lsmPosixOsRemap( lsm_file *pFile, lsm_i64 iMin, void **ppOut, lsm_i64 *pnOut ){ off_t iSz; int prc; PosixFile *p = (PosixFile *)pFile; struct stat buf; /* If the file is between 0 and 2MB in size, extend it in chunks of 256K. ** Thereafter, in chunks of 1MB at a time. */ const int aIncrSz[] = {256*1024, 1024*1024}; int nIncrSz = aIncrSz[iMin>(2*1024*1024)]; if( p->pMap ){ munmap(p->pMap, p->nMap); *ppOut = p->pMap = 0; *pnOut = p->nMap = 0; } if( iMin>=0 ){ memset(&buf, 0, sizeof(buf)); prc = fstat(p->fd, &buf); if( prc!=0 ) return LSM_IOERR_BKPT; iSz = buf.st_size; if( iSzfd, iSz); if( prc!=0 ) return LSM_IOERR_BKPT; } p->pMap = mmap(0, iSz, PROT_READ|PROT_WRITE, MAP_SHARED, p->fd, 0); p->nMap = iSz; } *ppOut = p->pMap; *pnOut = p->nMap; return LSM_OK; } static int lsmPosixOsFullpath( lsm_env *pEnv, const char *zName, char *zOut, int *pnOut ){ int nBuf = *pnOut; int nReq; if( zName[0]!='/' ){ char *z; char *zTmp; int nTmp = 512; zTmp = lsmMalloc(pEnv, nTmp); while( zTmp ){ z = getcwd(zTmp, nTmp); if( z || errno!=ERANGE ) break; nTmp = nTmp*2; zTmp = lsmReallocOrFree(pEnv, zTmp, nTmp); } if( zTmp==0 ) return LSM_NOMEM_BKPT; if( z==0 ) return LSM_IOERR_BKPT; assert( z==zTmp ); nTmp = strlen(zTmp); nReq = nTmp + 1 + strlen(zName) + 1; if( nReq<=nBuf ){ memcpy(zOut, zTmp, nTmp); zOut[nTmp] = '/'; memcpy(&zOut[nTmp+1], zName, strlen(zName)+1); } lsmFree(pEnv, zTmp); }else{ nReq = strlen(zName)+1; if( nReq<=nBuf ){ memcpy(zOut, zName, strlen(zName)+1); } } *pnOut = nReq; return LSM_OK; } static int lsmPosixOsFileid( lsm_file *pFile, void *pBuf, int *pnBuf ){ int prc; int nBuf; int nReq; PosixFile *p = (PosixFile *)pFile; struct stat buf; nBuf = *pnBuf; nReq = (sizeof(buf.st_dev) + sizeof(buf.st_ino)); *pnBuf = nReq; if( nReq>nBuf ) return LSM_OK; memset(&buf, 0, sizeof(buf)); prc = fstat(p->fd, &buf); if( prc!=0 ) return LSM_IOERR_BKPT; memcpy(pBuf, &buf.st_dev, sizeof(buf.st_dev)); memcpy(&(((u8 *)pBuf)[sizeof(buf.st_dev)]), &buf.st_ino, sizeof(buf.st_ino)); return LSM_OK; } static int lsmPosixOsUnlink(lsm_env *pEnv, const char *zFile){ int prc = unlink(zFile); return prc ? LSM_IOERR_BKPT : LSM_OK; } static int lsmPosixOsLock(lsm_file *pFile, int iLock, int eType){ int rc = LSM_OK; PosixFile *p = (PosixFile *)pFile; static const short aType[3] = { F_UNLCK, F_RDLCK, F_WRLCK }; struct flock lock; assert( aType[LSM_LOCK_UNLOCK]==F_UNLCK ); assert( aType[LSM_LOCK_SHARED]==F_RDLCK ); assert( aType[LSM_LOCK_EXCL]==F_WRLCK ); assert( eType>=0 && eType0 && iLock<=32 ); memset(&lock, 0, sizeof(lock)); lock.l_whence = SEEK_SET; lock.l_len = 1; lock.l_type = aType[eType]; lock.l_start = (4096-iLock); if( fcntl(p->fd, F_SETLK, &lock) ){ int e = errno; if( e==EACCES || e==EAGAIN ){ rc = LSM_BUSY; }else{ rc = LSM_IOERR_BKPT; } } return rc; } static int lsmPosixOsTestLock(lsm_file *pFile, int iLock, int nLock, int eType){ int rc = LSM_OK; PosixFile *p = (PosixFile *)pFile; static const short aType[3] = { 0, F_RDLCK, F_WRLCK }; struct flock lock; assert( eType==LSM_LOCK_SHARED || eType==LSM_LOCK_EXCL ); assert( aType[LSM_LOCK_SHARED]==F_RDLCK ); assert( aType[LSM_LOCK_EXCL]==F_WRLCK ); assert( eType>=0 && eType0 && iLock<=32 ); memset(&lock, 0, sizeof(lock)); lock.l_whence = SEEK_SET; lock.l_len = nLock; lock.l_type = aType[eType]; lock.l_start = (4096-iLock-nLock+1); if( fcntl(p->fd, F_GETLK, &lock) ){ rc = LSM_IOERR_BKPT; }else if( lock.l_type!=F_UNLCK ){ rc = LSM_BUSY; } return rc; } static int lsmPosixOsShmMap(lsm_file *pFile, int iChunk, int sz, void **ppShm){ PosixFile *p = (PosixFile *)pFile; *ppShm = 0; assert( sz==LSM_SHM_CHUNK_SIZE ); if( iChunk>=p->nShm ){ int i; void **apNew; int nNew = iChunk+1; off_t nReq = nNew * LSM_SHM_CHUNK_SIZE; struct stat sStat; /* If the shared-memory file has not been opened, open it now. */ if( p->shmfd<=0 ){ char *zShm = posixShmFile(p); if( !zShm ) return LSM_NOMEM_BKPT; p->shmfd = open(zShm, O_RDWR|O_CREAT, 0644); lsmFree(p->pEnv, zShm); if( p->shmfd<0 ){ return LSM_IOERR_BKPT; } } /* If the shared-memory file is not large enough to contain the ** requested chunk, cause it to grow. */ if( fstat(p->shmfd, &sStat) ){ return LSM_IOERR_BKPT; } if( sStat.st_sizeshmfd, nReq) ){ return LSM_IOERR_BKPT; } } apNew = (void **)lsmRealloc(p->pEnv, p->apShm, sizeof(void *) * nNew); if( !apNew ) return LSM_NOMEM_BKPT; for(i=p->nShm; iapShm = apNew; p->nShm = nNew; } if( p->apShm[iChunk]==0 ){ p->apShm[iChunk] = mmap(0, LSM_SHM_CHUNK_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, p->shmfd, iChunk*LSM_SHM_CHUNK_SIZE ); if( p->apShm[iChunk]==0 ) return LSM_IOERR_BKPT; } *ppShm = p->apShm[iChunk]; return LSM_OK; } static void lsmPosixOsShmBarrier(void){ } static int lsmPosixOsShmUnmap(lsm_file *pFile, int bDelete){ PosixFile *p = (PosixFile *)pFile; if( p->shmfd>0 ){ int i; for(i=0; inShm; i++){ if( p->apShm[i] ){ munmap(p->apShm[i], LSM_SHM_CHUNK_SIZE); p->apShm[i] = 0; } } close(p->shmfd); p->shmfd = 0; if( bDelete ){ char *zShm = posixShmFile(p); if( zShm ) unlink(zShm); lsmFree(p->pEnv, zShm); } } return LSM_OK; } static int lsmPosixOsClose(lsm_file *pFile){ PosixFile *p = (PosixFile *)pFile; lsmPosixOsShmUnmap(pFile, 0); if( p->pMap ) munmap(p->pMap, p->nMap); close(p->fd); lsm_free(p->pEnv, p->apShm); lsm_free(p->pEnv, p); return LSM_OK; } static int lsmPosixOsSleep(lsm_env *pEnv, int us){ #if 0 /* Apparently on Android usleep() returns void */ if( usleep(us) ) return LSM_IOERR; #endif usleep(us); return LSM_OK; } /**************************************************************************** ** Memory allocation routines. */ #define BLOCK_HDR_SIZE ROUND8( sizeof(size_t) ) static void *lsmPosixOsMalloc(lsm_env *pEnv, size_t N){ unsigned char * m; N += BLOCK_HDR_SIZE; m = (unsigned char *)malloc(N); *((size_t*)m) = N; return m + BLOCK_HDR_SIZE; } static void lsmPosixOsFree(lsm_env *pEnv, void *p){ if(p){ free( ((unsigned char *)p) - BLOCK_HDR_SIZE ); } } static void *lsmPosixOsRealloc(lsm_env *pEnv, void *p, size_t N){ unsigned char * m = (unsigned char *)p; if(1>N){ lsmPosixOsFree( pEnv, p ); return NULL; }else if(NULL==p){ return lsmPosixOsMalloc(pEnv, N); }else{ void * re = NULL; m -= BLOCK_HDR_SIZE; #if 0 /* arguable: don't shrink */ size_t * sz = (size_t*)m; if(*sz >= (size_t)N){ return p; } #endif re = realloc( m, N + BLOCK_HDR_SIZE ); if(re){ m = (unsigned char *)re; *((size_t*)m) = N; return m + BLOCK_HDR_SIZE; }else{ return NULL; } } } static size_t lsmPosixOsMSize(lsm_env *pEnv, void *p){ unsigned char * m = (unsigned char *)p; return *((size_t*)(m-BLOCK_HDR_SIZE)); } #undef BLOCK_HDR_SIZE #ifdef LSM_MUTEX_PTHREADS /************************************************************************* ** Mutex methods for pthreads based systems. If LSM_MUTEX_PTHREADS is ** missing then a no-op implementation of mutexes found in lsm_mutex.c ** will be used instead. */ #include typedef struct PthreadMutex PthreadMutex; struct PthreadMutex { lsm_env *pEnv; pthread_mutex_t mutex; #ifdef LSM_DEBUG pthread_t owner; #endif }; #ifdef LSM_DEBUG # define LSM_PTHREAD_STATIC_MUTEX { 0, PTHREAD_MUTEX_INITIALIZER, 0 } #else # define LSM_PTHREAD_STATIC_MUTEX { 0, PTHREAD_MUTEX_INITIALIZER } #endif static int lsmPosixOsMutexStatic( lsm_env *pEnv, int iMutex, lsm_mutex **ppStatic ){ static PthreadMutex sMutex[2] = { LSM_PTHREAD_STATIC_MUTEX, LSM_PTHREAD_STATIC_MUTEX }; assert( iMutex==LSM_MUTEX_GLOBAL || iMutex==LSM_MUTEX_HEAP ); assert( LSM_MUTEX_GLOBAL==1 && LSM_MUTEX_HEAP==2 ); *ppStatic = (lsm_mutex *)&sMutex[iMutex-1]; return LSM_OK; } static int lsmPosixOsMutexNew(lsm_env *pEnv, lsm_mutex **ppNew){ PthreadMutex *pMutex; /* Pointer to new mutex */ pthread_mutexattr_t attr; /* Attributes object */ pMutex = (PthreadMutex *)lsmMallocZero(pEnv, sizeof(PthreadMutex)); if( !pMutex ) return LSM_NOMEM_BKPT; pMutex->pEnv = pEnv; pthread_mutexattr_init(&attr); pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); pthread_mutex_init(&pMutex->mutex, &attr); pthread_mutexattr_destroy(&attr); *ppNew = (lsm_mutex *)pMutex; return LSM_OK; } static void lsmPosixOsMutexDel(lsm_mutex *p){ PthreadMutex *pMutex = (PthreadMutex *)p; pthread_mutex_destroy(&pMutex->mutex); lsmFree(pMutex->pEnv, pMutex); } static void lsmPosixOsMutexEnter(lsm_mutex *p){ PthreadMutex *pMutex = (PthreadMutex *)p; pthread_mutex_lock(&pMutex->mutex); #ifdef LSM_DEBUG assert( !pthread_equal(pMutex->owner, pthread_self()) ); pMutex->owner = pthread_self(); assert( pthread_equal(pMutex->owner, pthread_self()) ); #endif } static int lsmPosixOsMutexTry(lsm_mutex *p){ int ret; PthreadMutex *pMutex = (PthreadMutex *)p; ret = pthread_mutex_trylock(&pMutex->mutex); #ifdef LSM_DEBUG if( ret==0 ){ assert( !pthread_equal(pMutex->owner, pthread_self()) ); pMutex->owner = pthread_self(); assert( pthread_equal(pMutex->owner, pthread_self()) ); } #endif return ret; } static void lsmPosixOsMutexLeave(lsm_mutex *p){ PthreadMutex *pMutex = (PthreadMutex *)p; #ifdef LSM_DEBUG assert( pthread_equal(pMutex->owner, pthread_self()) ); pMutex->owner = 0; assert( !pthread_equal(pMutex->owner, pthread_self()) ); #endif pthread_mutex_unlock(&pMutex->mutex); } #ifdef LSM_DEBUG static int lsmPosixOsMutexHeld(lsm_mutex *p){ PthreadMutex *pMutex = (PthreadMutex *)p; return pMutex ? pthread_equal(pMutex->owner, pthread_self()) : 1; } static int lsmPosixOsMutexNotHeld(lsm_mutex *p){ PthreadMutex *pMutex = (PthreadMutex *)p; return pMutex ? !pthread_equal(pMutex->owner, pthread_self()) : 1; } #endif /* ** End of pthreads mutex implementation. *************************************************************************/ #else /************************************************************************* ** Noop mutex implementation */ typedef struct NoopMutex NoopMutex; struct NoopMutex { lsm_env *pEnv; /* Environment handle (for xFree()) */ int bHeld; /* True if mutex is held */ int bStatic; /* True for a static mutex */ }; static NoopMutex aStaticNoopMutex[2] = { {0, 0, 1}, {0, 0, 1}, }; static int lsmPosixOsMutexStatic( lsm_env *pEnv, int iMutex, lsm_mutex **ppStatic ){ assert( iMutex>=1 && iMutex<=(int)array_size(aStaticNoopMutex) ); *ppStatic = (lsm_mutex *)&aStaticNoopMutex[iMutex-1]; return LSM_OK; } static int lsmPosixOsMutexNew(lsm_env *pEnv, lsm_mutex **ppNew){ NoopMutex *p; p = (NoopMutex *)lsmMallocZero(pEnv, sizeof(NoopMutex)); if( p ) p->pEnv = pEnv; *ppNew = (lsm_mutex *)p; return (p ? LSM_OK : LSM_NOMEM_BKPT); } static void lsmPosixOsMutexDel(lsm_mutex *pMutex) { NoopMutex *p = (NoopMutex *)pMutex; assert( p->bStatic==0 && p->pEnv ); lsmFree(p->pEnv, p); } static void lsmPosixOsMutexEnter(lsm_mutex *pMutex){ NoopMutex *p = (NoopMutex *)pMutex; assert( p->bHeld==0 ); p->bHeld = 1; } static int lsmPosixOsMutexTry(lsm_mutex *pMutex){ NoopMutex *p = (NoopMutex *)pMutex; assert( p->bHeld==0 ); p->bHeld = 1; return 0; } static void lsmPosixOsMutexLeave(lsm_mutex *pMutex){ NoopMutex *p = (NoopMutex *)pMutex; assert( p->bHeld==1 ); p->bHeld = 0; } #ifdef LSM_DEBUG static int lsmPosixOsMutexHeld(lsm_mutex *pMutex){ NoopMutex *p = (NoopMutex *)pMutex; return p ? p->bHeld : 1; } static int lsmPosixOsMutexNotHeld(lsm_mutex *pMutex){ NoopMutex *p = (NoopMutex *)pMutex; return p ? !p->bHeld : 1; } #endif /***************************************************************************/ #endif /* else LSM_MUTEX_NONE */ /* Without LSM_DEBUG, the MutexHeld tests are never called */ #ifndef LSM_DEBUG # define lsmPosixOsMutexHeld 0 # define lsmPosixOsMutexNotHeld 0 #endif lsm_env *lsm_default_env(void){ static lsm_env posix_env = { sizeof(lsm_env), /* nByte */ 1, /* iVersion */ /***** file i/o ******************/ 0, /* pVfsCtx */ lsmPosixOsFullpath, /* xFullpath */ lsmPosixOsOpen, /* xOpen */ lsmPosixOsRead, /* xRead */ lsmPosixOsWrite, /* xWrite */ lsmPosixOsTruncate, /* xTruncate */ lsmPosixOsSync, /* xSync */ lsmPosixOsSectorSize, /* xSectorSize */ lsmPosixOsRemap, /* xRemap */ lsmPosixOsFileid, /* xFileid */ lsmPosixOsClose, /* xClose */ lsmPosixOsUnlink, /* xUnlink */ lsmPosixOsLock, /* xLock */ lsmPosixOsTestLock, /* xTestLock */ lsmPosixOsShmMap, /* xShmMap */ lsmPosixOsShmBarrier, /* xShmBarrier */ lsmPosixOsShmUnmap, /* xShmUnmap */ /***** memory allocation *********/ 0, /* pMemCtx */ lsmPosixOsMalloc, /* xMalloc */ lsmPosixOsRealloc, /* xRealloc */ lsmPosixOsFree, /* xFree */ lsmPosixOsMSize, /* xSize */ /***** mutexes *********************/ 0, /* pMutexCtx */ lsmPosixOsMutexStatic, /* xMutexStatic */ lsmPosixOsMutexNew, /* xMutexNew */ lsmPosixOsMutexDel, /* xMutexDel */ lsmPosixOsMutexEnter, /* xMutexEnter */ lsmPosixOsMutexTry, /* xMutexTry */ lsmPosixOsMutexLeave, /* xMutexLeave */ lsmPosixOsMutexHeld, /* xMutexHeld */ lsmPosixOsMutexNotHeld, /* xMutexNotHeld */ /***** other *********************/ lsmPosixOsSleep, /* xSleep */ }; return &posix_env; } #endif ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_varint.c ================================================ /* ** 2012-02-08 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** SQLite4-compatible varint implementation. */ #include "lsmInt.h" /************************************************************************* ** The following is a copy of the varint.c module from SQLite 4. */ /* ** Decode the varint in z[]. Write the integer value into *pResult and ** return the number of bytes in the varint. */ static int lsmSqlite4GetVarint64(const unsigned char *z, u64 *pResult){ unsigned int x; if( z[0]<=240 ){ *pResult = z[0]; return 1; } if( z[0]<=248 ){ *pResult = (z[0]-241)*256 + z[1] + 240; return 2; } if( z[0]==249 ){ *pResult = 2288 + 256*z[1] + z[2]; return 3; } if( z[0]==250 ){ *pResult = (z[1]<<16) + (z[2]<<8) + z[3]; return 4; } x = (z[1]<<24) + (z[2]<<16) + (z[3]<<8) + z[4]; if( z[0]==251 ){ *pResult = x; return 5; } if( z[0]==252 ){ *pResult = (((u64)x)<<8) + z[5]; return 6; } if( z[0]==253 ){ *pResult = (((u64)x)<<16) + (z[5]<<8) + z[6]; return 7; } if( z[0]==254 ){ *pResult = (((u64)x)<<24) + (z[5]<<16) + (z[6]<<8) + z[7]; return 8; } *pResult = (((u64)x)<<32) + (0xffffffff & ((z[5]<<24) + (z[6]<<16) + (z[7]<<8) + z[8])); return 9; } /* ** Write a 32-bit unsigned integer as 4 big-endian bytes. */ static void lsmVarintWrite32(unsigned char *z, unsigned int y){ z[0] = (unsigned char)(y>>24); z[1] = (unsigned char)(y>>16); z[2] = (unsigned char)(y>>8); z[3] = (unsigned char)(y); } /* ** Write a varint into z[]. The buffer z[] must be at least 9 characters ** long to accommodate the largest possible varint. Return the number of ** bytes of z[] used. */ static int lsmSqlite4PutVarint64(unsigned char *z, u64 x){ unsigned int w, y; if( x<=240 ){ z[0] = (unsigned char)x; return 1; } if( x<=2287 ){ y = (unsigned int)(x - 240); z[0] = (unsigned char)(y/256 + 241); z[1] = (unsigned char)(y%256); return 2; } if( x<=67823 ){ y = (unsigned int)(x - 2288); z[0] = 249; z[1] = (unsigned char)(y/256); z[2] = (unsigned char)(y%256); return 3; } y = (unsigned int)x; w = (unsigned int)(x>>32); if( w==0 ){ if( y<=16777215 ){ z[0] = 250; z[1] = (unsigned char)(y>>16); z[2] = (unsigned char)(y>>8); z[3] = (unsigned char)(y); return 4; } z[0] = 251; lsmVarintWrite32(z+1, y); return 5; } if( w<=255 ){ z[0] = 252; z[1] = (unsigned char)w; lsmVarintWrite32(z+2, y); return 6; } if( w<=32767 ){ z[0] = 253; z[1] = (unsigned char)(w>>8); z[2] = (unsigned char)w; lsmVarintWrite32(z+3, y); return 7; } if( w<=16777215 ){ z[0] = 254; z[1] = (unsigned char)(w>>16); z[2] = (unsigned char)(w>>8); z[3] = (unsigned char)w; lsmVarintWrite32(z+4, y); return 8; } z[0] = 255; lsmVarintWrite32(z+1, w); lsmVarintWrite32(z+5, y); return 9; } /* ** End of SQLite 4 code. *************************************************************************/ int lsmVarintPut64(u8 *aData, i64 iVal){ return lsmSqlite4PutVarint64(aData, (u64)iVal); } int lsmVarintGet64(const u8 *aData, i64 *piVal){ return lsmSqlite4GetVarint64(aData, (u64 *)piVal); } int lsmVarintPut32(u8 *aData, int iVal){ return lsmSqlite4PutVarint64(aData, (u64)iVal); } int lsmVarintGet32(u8 *z, int *piVal){ u64 i; int ret; if( z[0]<=240 ){ *piVal = z[0]; return 1; } if( z[0]<=248 ){ *piVal = (z[0]-241)*256 + z[1] + 240; return 2; } if( z[0]==249 ){ *piVal = 2288 + 256*z[1] + z[2]; return 3; } if( z[0]==250 ){ *piVal = (z[1]<<16) + (z[2]<<8) + z[3]; return 4; } ret = lsmSqlite4GetVarint64(z, &i); *piVal = (int)i; return ret; } int lsmVarintLen32(int n){ u8 aData[9]; return lsmVarintPut32(aData, n); } /* ** The argument is the first byte of a varint. This function returns the ** total number of bytes in the entire varint (including the first byte). */ int lsmVarintSize(u8 c){ if( c<241 ) return 1; if( c<249 ) return 2; return (int)(c - 246); } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_vtab.c ================================================ /* ** 2015-11-16 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** This file implements a virtual table for SQLite3 around the LSM ** storage engine from SQLite4. ** ** USAGE ** ** CREATE VIRTUAL TABLE demo USING lsm1(filename,key,keytype,value1,...); ** ** The filename parameter is the name of the LSM database file, which is ** separate and distinct from the SQLite3 database file. ** ** The keytype must be one of: UINT, TEXT, BLOB. All keys must be of that ** one type. "UINT" means unsigned integer. The values may be of any ** SQLite datatype: BLOB, TEXT, INTEGER, FLOAT, or NULL. ** ** The virtual table contains read-only hidden columns: ** ** lsm1_key A BLOB which is the raw LSM key. If the "keytype" ** is BLOB or TEXT then this column is exactly the ** same as the key. For the UINT keytype, this column ** will be a variable-length integer encoding of the key. ** ** lsm1_value A BLOB which is the raw LSM value. All of the value ** columns are packed into this BLOB using the encoding ** described below. ** ** Attempts to write values into the lsm1_key and lsm1_value columns are ** silently ignored. ** ** EXAMPLE ** ** The virtual table declared this way: ** ** CREATE VIRTUAL TABLE demo2 USING lsm1('x.lsm',id,UINT,a,b,c,d); ** ** Results in a new virtual table named "demo2" that acts as if it has ** the following schema: ** ** CREATE TABLE demo2( ** id UINT PRIMARY KEY ON CONFLICT REPLACE, ** a ANY, ** b ANY, ** c ANY, ** d ANY, ** lsm1_key BLOB HIDDEN, ** lsm1_value BLOB HIDDEN ** ) WITHOUT ROWID; ** ** ** ** INTERNALS ** ** The key encoding for BLOB and TEXT is just a copy of the blob or text. ** UTF-8 is used for text. The key encoding for UINT is the variable-length ** integer format at https://sqlite.org/src4/doc/trunk/www/varint.wiki. ** ** The values are encoded as a single blob (since that is what lsm stores as ** its content). There is a "type integer" followed by "content" for each ** value, alternating back and forth. The content might be empty. ** ** TYPE1 CONTENT1 TYPE2 CONTENT2 TYPE3 CONTENT3 .... ** ** Each "type integer" is encoded as a variable-length integer in the ** format of the link above. Let the type integer be T. The actual ** datatype is an integer 0-5 equal to T%6. Values 1 through 5 correspond ** to SQLITE_INTEGER through SQLITE_NULL. The size of the content in bytes ** is T/6. Type value 0 means that the value is an integer whose actual ** values is T/6 and there is no content. The type-value-0 integer format ** only works for integers in the range of 0 through 40. ** ** There is no content for NULL or type-0 integers. For BLOB and TEXT ** values, the content is the blob data or the UTF-8 text data. For ** non-negative integers X, the content is a variable-length integer X*2. ** For negative integers Y, the content is varaible-length integer (1-Y)*2+1. ** For FLOAT values, the content is the IEEE754 floating point value in ** native byte-order. This means that FLOAT values will be corrupted when ** database file is moved between big-endian and little-endian machines. */ #include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 #include "lsm.h" #include #include /* Forward declaration of subclasses of virtual table objects */ typedef struct lsm1_vtab lsm1_vtab; typedef struct lsm1_cursor lsm1_cursor; typedef struct lsm1_vblob lsm1_vblob; /* Primitive types */ typedef unsigned char u8; typedef unsigned int u32; typedef sqlite3_uint64 u64; /* An open connection to an LSM table */ struct lsm1_vtab { sqlite3_vtab base; /* Base class - must be first */ lsm_db *pDb; /* Open connection to the LSM table */ u8 keyType; /* SQLITE_BLOB, _TEXT, or _INTEGER */ u32 nVal; /* Number of value columns */ }; /* lsm1_cursor is a subclass of sqlite3_vtab_cursor which will ** serve as the underlying representation of a cursor that scans ** over rows of the result */ struct lsm1_cursor { sqlite3_vtab_cursor base; /* Base class - must be first */ lsm_cursor *pLsmCur; /* The LSM cursor */ u8 isDesc; /* 0: scan forward. 1: scan reverse */ u8 atEof; /* True if the scan is complete */ u8 bUnique; /* True if no more than one row of output */ u8 *zData; /* Content of the current row */ u32 nData; /* Number of bytes in the current row */ u8 *aeType; /* Types for all column values */ u32 *aiOfst; /* Offsets to the various fields */ u32 *aiLen; /* Length of each field */ u8 *pKey2; /* Loop termination key, or NULL */ u32 nKey2; /* Length of the loop termination key */ }; /* An extensible buffer object. ** ** Content can be appended. Space to hold new content is automatically ** allocated. */ struct lsm1_vblob { u8 *a; /* Space to hold content, from sqlite3_malloc64() */ u64 n; /* Bytes of space used */ u64 nAlloc; /* Bytes of space allocated */ u8 errNoMem; /* True if a memory allocation error has been seen */ }; #if defined(__GNUC__) # define LSM1_NOINLINE __attribute__((noinline)) #elif defined(_MSC_VER) && _MSC_VER>=1310 # define LSM1_NOINLINE __declspec(noinline) #else # define LSM1_NOINLINE #endif /* Increase the available space in the vblob object so that it can hold ** at least N more bytes. Return the number of errors. */ static int lsm1VblobEnlarge(lsm1_vblob *p, u32 N){ if( p->n+N>p->nAlloc ){ if( p->errNoMem ) return 1; p->nAlloc += N + (p->nAlloc ? p->nAlloc : N); p->a = sqlite3_realloc64(p->a, p->nAlloc); if( p->a==0 ){ p->n = 0; p->nAlloc = 0; p->errNoMem = 1; return 1; } p->nAlloc = sqlite3_msize(p->a); } return 0; } /* Append N bytes to a vblob after first enlarging it */ static LSM1_NOINLINE void lsm1VblobEnlargeAndAppend( lsm1_vblob *p, const u8 *pData, u32 N ){ if( p->n+N>p->nAlloc && lsm1VblobEnlarge(p, N) ) return; memcpy(p->a+p->n, pData, N); p->n += N; } /* Append N bytes to a vblob */ static void lsm1VblobAppend(lsm1_vblob *p, const u8 *pData, u32 N){ sqlite3_int64 n = p->n; if( n+N>p->nAlloc ){ lsm1VblobEnlargeAndAppend(p, pData, N); }else{ p->n += N; memcpy(p->a+n, pData, N); } } /* append text to a vblob */ static void lsm1VblobAppendText(lsm1_vblob *p, const char *z){ lsm1VblobAppend(p, (u8*)z, (u32)strlen(z)); } /* Dequote the string */ static void lsm1Dequote(char *z){ int j; char cQuote = z[0]; size_t i, n; if( cQuote!='\'' && cQuote!='"' ) return; n = strlen(z); if( n<2 || z[n-1]!=z[0] ) return; for(i=1, j=0; ikeyType = keyType; rc = lsm_new(0, &pNew->pDb); if( rc ){ *pzErr = sqlite3_mprintf("lsm_new failed with error code %d", rc); rc = SQLITE_ERROR; goto connect_failed; } zFilename = sqlite3_mprintf("%s", argv[3]); lsm1Dequote(zFilename); rc = lsm_open(pNew->pDb, zFilename); sqlite3_free(zFilename); if( rc ){ *pzErr = sqlite3_mprintf("lsm_open failed with %d", rc); rc = SQLITE_ERROR; goto connect_failed; } memset(&sql, 0, sizeof(sql)); lsm1VblobAppendText(&sql, "CREATE TABLE x("); lsm1VblobAppendText(&sql, argv[4]); lsm1VblobAppendText(&sql, " "); lsm1VblobAppendText(&sql, argv[5]); lsm1VblobAppendText(&sql, " PRIMARY KEY"); for(i=6; inVal++; } lsm1VblobAppendText(&sql, ", lsm1_command HIDDEN" ", lsm1_key HIDDEN" ", lsm1_value HIDDEN) WITHOUT ROWID"); lsm1VblobAppend(&sql, (u8*)"", 1); if( sql.errNoMem ){ rc = SQLITE_NOMEM; goto connect_failed; } rc = sqlite3_declare_vtab(db, (const char*)sql.a); sqlite3_free(sql.a); connect_failed: if( rc!=SQLITE_OK ){ if( pNew ){ if( pNew->pDb ) lsm_close(pNew->pDb); sqlite3_free(pNew); } *ppVtab = 0; } return rc; } /* ** This method is the destructor for lsm1_cursor objects. */ static int lsm1Disconnect(sqlite3_vtab *pVtab){ lsm1_vtab *p = (lsm1_vtab*)pVtab; lsm_close(p->pDb); sqlite3_free(p); return SQLITE_OK; } /* ** Constructor for a new lsm1_cursor object. */ static int lsm1Open(sqlite3_vtab *pVtab, sqlite3_vtab_cursor **ppCursor){ lsm1_vtab *p = (lsm1_vtab*)pVtab; lsm1_cursor *pCur; int rc; pCur = sqlite3_malloc64( sizeof(*pCur) + p->nVal*(sizeof(pCur->aiOfst)+sizeof(pCur->aiLen)+1) ); if( pCur==0 ) return SQLITE_NOMEM; memset(pCur, 0, sizeof(*pCur)); pCur->aiOfst = (u32*)&pCur[1]; pCur->aiLen = &pCur->aiOfst[p->nVal]; pCur->aeType = (u8*)&pCur->aiLen[p->nVal]; *ppCursor = &pCur->base; rc = lsm_csr_open(p->pDb, &pCur->pLsmCur); if( rc==LSM_OK ){ rc = SQLITE_OK; }else{ sqlite3_free(pCur); *ppCursor = 0; rc = SQLITE_ERROR; } return rc; } /* ** Destructor for a lsm1_cursor. */ static int lsm1Close(sqlite3_vtab_cursor *cur){ lsm1_cursor *pCur = (lsm1_cursor*)cur; sqlite3_free(pCur->pKey2); lsm_csr_close(pCur->pLsmCur); sqlite3_free(pCur); return SQLITE_OK; } /* ** Advance a lsm1_cursor to its next row of output. */ static int lsm1Next(sqlite3_vtab_cursor *cur){ lsm1_cursor *pCur = (lsm1_cursor*)cur; int rc = LSM_OK; if( pCur->bUnique ){ pCur->atEof = 1; }else{ if( pCur->isDesc ){ rc = lsm_csr_prev(pCur->pLsmCur); }else{ rc = lsm_csr_next(pCur->pLsmCur); } if( rc==LSM_OK && lsm_csr_valid(pCur->pLsmCur)==0 ){ pCur->atEof = 1; } if( pCur->pKey2 && pCur->atEof==0 ){ const u8 *pVal; u32 nVal; assert( pCur->isDesc==0 ); rc = lsm_csr_key(pCur->pLsmCur, (const void**)&pVal, (int*)&nVal); if( rc==LSM_OK ){ u32 len = pCur->nKey2; int c; if( len>nVal ) len = nVal; c = memcmp(pVal, pCur->pKey2, len); if( c==0 ) c = nVal - pCur->nKey2; if( c>0 ) pCur->atEof = 1; } } pCur->zData = 0; } return rc==LSM_OK ? SQLITE_OK : SQLITE_ERROR; } /* ** Return TRUE if the cursor has been moved off of the last ** row of output. */ static int lsm1Eof(sqlite3_vtab_cursor *cur){ lsm1_cursor *pCur = (lsm1_cursor*)cur; return pCur->atEof; } /* ** Rowids are not supported by the underlying virtual table. So always ** return 0 for the rowid. */ static int lsm1Rowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ *pRowid = 0; return SQLITE_OK; } /* ** Type prefixes on LSM keys */ #define LSM1_TYPE_NEGATIVE 0 #define LSM1_TYPE_POSITIVE 1 #define LSM1_TYPE_TEXT 2 #define LSM1_TYPE_BLOB 3 /* ** Write a 32-bit unsigned integer as 4 big-endian bytes. */ static void varintWrite32(unsigned char *z, unsigned int y){ z[0] = (unsigned char)(y>>24); z[1] = (unsigned char)(y>>16); z[2] = (unsigned char)(y>>8); z[3] = (unsigned char)(y); } /* ** Write a varint into z[]. The buffer z[] must be at least 9 characters ** long to accommodate the largest possible varint. Return the number of ** bytes of z[] used. */ static int lsm1PutVarint64(unsigned char *z, sqlite3_uint64 x){ unsigned int w, y; if( x<=240 ){ z[0] = (unsigned char)x; return 1; } if( x<=2287 ){ y = (unsigned int)(x - 240); z[0] = (unsigned char)(y/256 + 241); z[1] = (unsigned char)(y%256); return 2; } if( x<=67823 ){ y = (unsigned int)(x - 2288); z[0] = 249; z[1] = (unsigned char)(y/256); z[2] = (unsigned char)(y%256); return 3; } y = (unsigned int)x; w = (unsigned int)(x>>32); if( w==0 ){ if( y<=16777215 ){ z[0] = 250; z[1] = (unsigned char)(y>>16); z[2] = (unsigned char)(y>>8); z[3] = (unsigned char)(y); return 4; } z[0] = 251; varintWrite32(z+1, y); return 5; } if( w<=255 ){ z[0] = 252; z[1] = (unsigned char)w; varintWrite32(z+2, y); return 6; } if( w<=65535 ){ z[0] = 253; z[1] = (unsigned char)(w>>8); z[2] = (unsigned char)w; varintWrite32(z+3, y); return 7; } if( w<=16777215 ){ z[0] = 254; z[1] = (unsigned char)(w>>16); z[2] = (unsigned char)(w>>8); z[3] = (unsigned char)w; varintWrite32(z+4, y); return 8; } z[0] = 255; varintWrite32(z+1, w); varintWrite32(z+5, y); return 9; } /* Append non-negative integer x as a variable-length integer. */ static void lsm1VblobAppendVarint(lsm1_vblob *p, sqlite3_uint64 x){ sqlite3_int64 n = p->n; if( n+9>p->nAlloc && lsm1VblobEnlarge(p, 9) ) return; p->n += lsm1PutVarint64(p->a+p->n, x); } /* ** Decode the varint in the first n bytes z[]. Write the integer value ** into *pResult and return the number of bytes in the varint. ** ** If the decode fails because there are not enough bytes in z[] then ** return 0; */ static int lsm1GetVarint64( const unsigned char *z, int n, sqlite3_uint64 *pResult ){ unsigned int x; if( n<1 ) return 0; if( z[0]<=240 ){ *pResult = z[0]; return 1; } if( z[0]<=248 ){ if( n<2 ) return 0; *pResult = (z[0]-241)*256 + z[1] + 240; return 2; } if( n=0 ){ u = (sqlite3_uint64)v; return lsm1PutVarint64(z, u*2); }else{ u = (sqlite3_uint64)(-1-v); return lsm1PutVarint64(z, u*2+1); } } /* Decoded a signed varint. */ static int lsm1GetSignedVarint64( const unsigned char *z, int n, sqlite3_int64 *pResult ){ sqlite3_uint64 u = 0; n = lsm1GetVarint64(z, n, &u); if( u&1 ){ *pResult = -1 - (sqlite3_int64)(u>>1); }else{ *pResult = (sqlite3_int64)(u>>1); } return n; } /* ** Read the value part of the key-value pair and decode it into columns. */ static int lsm1DecodeValues(lsm1_cursor *pCur){ lsm1_vtab *pTab = (lsm1_vtab*)(pCur->base.pVtab); int i, n; int rc; u8 eType; sqlite3_uint64 v; if( pCur->zData ) return 1; rc = lsm_csr_value(pCur->pLsmCur, (const void**)&pCur->zData, (int*)&pCur->nData); if( rc ) return 0; for(i=n=0; inVal; i++){ v = 0; n += lsm1GetVarint64(pCur->zData+n, pCur->nData-n, &v); pCur->aeType[i] = eType = (u8)(v%6); if( eType==0 ){ pCur->aiOfst[i] = (u32)(v/6); pCur->aiLen[i] = 0; }else{ pCur->aiOfst[i] = n; n += (pCur->aiLen[i] = (u32)(v/6)); } if( n>pCur->nData ) break; } if( inVal ){ pCur->zData = 0; return 0; } return 1; } /* ** Return values of columns for the row at which the lsm1_cursor ** is currently pointing. */ static int lsm1Column( sqlite3_vtab_cursor *cur, /* The cursor */ sqlite3_context *ctx, /* First argument to sqlite3_result_...() */ int i /* Which column to return */ ){ lsm1_cursor *pCur = (lsm1_cursor*)cur; lsm1_vtab *pTab = (lsm1_vtab*)(cur->pVtab); if( i==0 ){ /* The key column */ const void *pVal; int nVal; if( lsm_csr_key(pCur->pLsmCur, &pVal, &nVal)==LSM_OK ){ if( pTab->keyType==SQLITE_BLOB ){ sqlite3_result_blob(ctx, pVal, nVal, SQLITE_TRANSIENT); }else if( pTab->keyType==SQLITE_TEXT ){ sqlite3_result_text(ctx,(const char*)pVal, nVal, SQLITE_TRANSIENT); }else{ const unsigned char *z = (const unsigned char*)pVal; sqlite3_uint64 v1; lsm1GetVarint64(z, nVal, &v1); sqlite3_result_int64(ctx, (sqlite3_int64)v1); } } }else if( i>pTab->nVal ){ if( i==pTab->nVal+2 ){ /* lsm1_key */ const void *pVal; int nVal; if( lsm_csr_key(pCur->pLsmCur, &pVal, &nVal)==LSM_OK ){ sqlite3_result_blob(ctx, pVal, nVal, SQLITE_TRANSIENT); } }else if( i==pTab->nVal+3 ){ /* lsm1_value */ const void *pVal; int nVal; if( lsm_csr_value(pCur->pLsmCur, &pVal, &nVal)==LSM_OK ){ sqlite3_result_blob(ctx, pVal, nVal, SQLITE_TRANSIENT); } } }else if( lsm1DecodeValues(pCur) ){ /* The i-th value column (where leftmost is 1) */ const u8 *zData; u32 nData; i--; zData = pCur->zData + pCur->aiOfst[i]; nData = pCur->aiLen[i]; switch( pCur->aeType[i] ){ case 0: { /* in-line integer */ sqlite3_result_int(ctx, pCur->aiOfst[i]); break; } case SQLITE_INTEGER: { sqlite3_int64 v; lsm1GetSignedVarint64(zData, nData, &v); sqlite3_result_int64(ctx, v); break; } case SQLITE_FLOAT: { double v; if( nData==sizeof(v) ){ memcpy(&v, zData, sizeof(v)); sqlite3_result_double(ctx, v); } break; } case SQLITE_TEXT: { sqlite3_result_text(ctx, (const char*)zData, nData, SQLITE_TRANSIENT); break; } case SQLITE_BLOB: { sqlite3_result_blob(ctx, zData, nData, SQLITE_TRANSIENT); break; } default: { /* A NULL. Do nothing */ } } } return SQLITE_OK; } /* Parameter "pValue" contains an SQL value that is to be used as ** a key in an LSM table. The type of the key is determined by ** "keyType". Extract the raw bytes used for the key in LSM1. */ static void lsm1KeyFromValue( int keyType, /* The key type */ sqlite3_value *pValue, /* The key value */ u8 *pBuf, /* Storage space for a generated key */ const u8 **ppKey, /* OUT: the bytes of the key */ int *pnKey /* OUT: size of the key */ ){ if( keyType==SQLITE_BLOB ){ *ppKey = (const u8*)sqlite3_value_blob(pValue); *pnKey = sqlite3_value_bytes(pValue); }else if( keyType==SQLITE_TEXT ){ *ppKey = (const u8*)sqlite3_value_text(pValue); *pnKey = sqlite3_value_bytes(pValue); }else{ sqlite3_int64 v = sqlite3_value_int64(pValue); if( v<0 ) v = 0; *pnKey = lsm1PutVarint64(pBuf, v); *ppKey = pBuf; } } /* Move to the first row to return. */ static int lsm1Filter( sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ lsm1_cursor *pCur = (lsm1_cursor *)pVtabCursor; lsm1_vtab *pTab = (lsm1_vtab*)(pCur->base.pVtab); int rc = LSM_OK; int seekType = -1; const u8 *pVal = 0; int nVal; u8 keyType = pTab->keyType; u8 aKey1[16]; pCur->atEof = 1; sqlite3_free(pCur->pKey2); pCur->pKey2 = 0; if( idxNum<99 ){ lsm1KeyFromValue(keyType, argv[0], aKey1, &pVal, &nVal); } switch( idxNum ){ case 0: { /* key==argv[0] */ assert( argc==1 ); seekType = LSM_SEEK_EQ; pCur->isDesc = 0; pCur->bUnique = 1; break; } case 1: { /* key>=argv[0] AND key<=argv[1] */ u8 aKey[12]; seekType = LSM_SEEK_GE; pCur->isDesc = 0; pCur->bUnique = 0; if( keyType==SQLITE_INTEGER ){ sqlite3_int64 v = sqlite3_value_int64(argv[1]); if( v<0 ) v = 0; pCur->nKey2 = lsm1PutVarint64(aKey, (sqlite3_uint64)v); pCur->pKey2 = sqlite3_malloc( pCur->nKey2 ); if( pCur->pKey2==0 ) return SQLITE_NOMEM; memcpy(pCur->pKey2, aKey, pCur->nKey2); }else{ pCur->nKey2 = sqlite3_value_bytes(argv[1]); pCur->pKey2 = sqlite3_malloc( pCur->nKey2 ); if( pCur->pKey2==0 ) return SQLITE_NOMEM; if( keyType==SQLITE_BLOB ){ memcpy(pCur->pKey2, sqlite3_value_blob(argv[1]), pCur->nKey2); }else{ memcpy(pCur->pKey2, sqlite3_value_text(argv[1]), pCur->nKey2); } } break; } case 2: { /* key>=argv[0] */ seekType = LSM_SEEK_GE; pCur->isDesc = 0; pCur->bUnique = 0; break; } case 3: { /* key<=argv[0] */ seekType = LSM_SEEK_LE; pCur->isDesc = 1; pCur->bUnique = 0; break; } default: { /* full table scan */ pCur->isDesc = 0; pCur->bUnique = 0; break; } } if( pVal ){ rc = lsm_csr_seek(pCur->pLsmCur, pVal, nVal, seekType); }else{ rc = lsm_csr_first(pCur->pLsmCur); } if( rc==LSM_OK && lsm_csr_valid(pCur->pLsmCur)!=0 ){ pCur->atEof = 0; } return rc==LSM_OK ? SQLITE_OK : SQLITE_ERROR; } /* ** Only comparisons against the key are allowed. The idxNum defines ** which comparisons are available: ** ** 0 key==?1 ** 1 key>=?1 AND key<=?2 ** 2 key>?1 or key>=?1 ** 3 keyaConstraint; for(i=0; inConstraint && idxNum<16; i++, pConstraint++){ if( pConstraint->usable==0 ) continue; if( pConstraint->iColumn!=0 ) continue; switch( pConstraint->op ){ case SQLITE_INDEX_CONSTRAINT_EQ: { if( idxNum>0 ){ argIdx = i; iIdx2 = -1; idxNum = 0; omit1 = 1; } break; } case SQLITE_INDEX_CONSTRAINT_GE: case SQLITE_INDEX_CONSTRAINT_GT: { if( idxNum==99 ){ argIdx = i; idxNum = 2; omit1 = pConstraint->op==SQLITE_INDEX_CONSTRAINT_GE; }else if( idxNum==3 ){ iIdx2 = idxNum; omit2 = omit1; argIdx = i; idxNum = 1; omit1 = pConstraint->op==SQLITE_INDEX_CONSTRAINT_GE; } break; } case SQLITE_INDEX_CONSTRAINT_LE: case SQLITE_INDEX_CONSTRAINT_LT: { if( idxNum==99 ){ argIdx = i; idxNum = 3; omit1 = pConstraint->op==SQLITE_INDEX_CONSTRAINT_LE; }else if( idxNum==2 ){ iIdx2 = i; idxNum = 1; omit1 = pConstraint->op==SQLITE_INDEX_CONSTRAINT_LE; } break; } } } if( argIdx>=0 ){ pIdxInfo->aConstraintUsage[argIdx].argvIndex = ++nArg; pIdxInfo->aConstraintUsage[argIdx].omit = omit1; } if( iIdx2>=0 ){ pIdxInfo->aConstraintUsage[iIdx2].argvIndex = ++nArg; pIdxInfo->aConstraintUsage[iIdx2].omit = omit2; } if( idxNum==0 ){ pIdxInfo->estimatedCost = (double)1; pIdxInfo->estimatedRows = 1; pIdxInfo->orderByConsumed = 1; }else if( idxNum==1 ){ pIdxInfo->estimatedCost = (double)100; pIdxInfo->estimatedRows = 100; }else if( idxNum<99 ){ pIdxInfo->estimatedCost = (double)5000; pIdxInfo->estimatedRows = 5000; }else{ /* Full table scan */ pIdxInfo->estimatedCost = (double)2147483647; pIdxInfo->estimatedRows = 2147483647; } pIdxInfo->idxNum = idxNum; return SQLITE_OK; } /* ** The xUpdate method is normally used for INSERT, REPLACE, UPDATE, and ** DELETE. But this virtual table only supports INSERT and REPLACE. ** DELETE is accomplished by inserting a record with a value of NULL. ** UPDATE is achieved by using REPLACE. */ int lsm1Update( sqlite3_vtab *pVTab, int argc, sqlite3_value **argv, sqlite_int64 *pRowid ){ lsm1_vtab *p = (lsm1_vtab*)pVTab; int nKey, nKey2; int i; int rc = LSM_OK; const u8 *pKey, *pKey2; unsigned char aKey[16]; unsigned char pSpace[16]; lsm1_vblob val; if( argc==1 ){ /* DELETE the record whose key is argv[0] */ lsm1KeyFromValue(p->keyType, argv[0], aKey, &pKey, &nKey); lsm_delete(p->pDb, pKey, nKey); return SQLITE_OK; } if( sqlite3_value_type(argv[0])!=SQLITE_NULL ){ /* An UPDATE */ lsm1KeyFromValue(p->keyType, argv[0], aKey, &pKey, &nKey); lsm1KeyFromValue(p->keyType, argv[1], pSpace, &pKey2, &nKey2); if( nKey!=nKey2 || memcmp(pKey, pKey2, nKey)!=0 ){ /* The UPDATE changes the PRIMARY KEY value. DELETE the old key */ lsm_delete(p->pDb, pKey, nKey); } /* Fall through into the INSERT case to complete the UPDATE */ } /* "INSERT INTO tab(lsm1_command) VALUES('....')" is used to implement ** special commands. */ if( sqlite3_value_type(argv[3+p->nVal])!=SQLITE_NULL ){ return SQLITE_OK; } lsm1KeyFromValue(p->keyType, argv[2], aKey, &pKey, &nKey); memset(&val, 0, sizeof(val)); for(i=0; inVal; i++){ sqlite3_value *pArg = argv[3+i]; u8 eType = sqlite3_value_type(pArg); switch( eType ){ case SQLITE_NULL: { lsm1VblobAppendVarint(&val, SQLITE_NULL); break; } case SQLITE_INTEGER: { sqlite3_int64 v = sqlite3_value_int64(pArg); if( v>=0 && v<=240/6 ){ lsm1VblobAppendVarint(&val, v*6); }else{ int n = lsm1PutSignedVarint64(pSpace, v); lsm1VblobAppendVarint(&val, SQLITE_INTEGER + n*6); lsm1VblobAppend(&val, pSpace, n); } break; } case SQLITE_FLOAT: { double r = sqlite3_value_double(pArg); lsm1VblobAppendVarint(&val, SQLITE_FLOAT + 8*6); lsm1VblobAppend(&val, (u8*)&r, sizeof(r)); break; } case SQLITE_BLOB: { int n = sqlite3_value_bytes(pArg); lsm1VblobAppendVarint(&val, n*6 + SQLITE_BLOB); lsm1VblobAppend(&val, sqlite3_value_blob(pArg), n); break; } case SQLITE_TEXT: { int n = sqlite3_value_bytes(pArg); lsm1VblobAppendVarint(&val, n*6 + SQLITE_TEXT); lsm1VblobAppend(&val, sqlite3_value_text(pArg), n); break; } } } if( val.errNoMem ){ return SQLITE_NOMEM; } rc = lsm_insert(p->pDb, pKey, nKey, val.a, val.n); sqlite3_free(val.a); return rc==LSM_OK ? SQLITE_OK : SQLITE_ERROR; } /* Begin a transaction */ static int lsm1Begin(sqlite3_vtab *pVtab){ lsm1_vtab *p = (lsm1_vtab*)pVtab; int rc = lsm_begin(p->pDb, 1); return rc==LSM_OK ? SQLITE_OK : SQLITE_ERROR; } /* Phase 1 of a transaction commit. */ static int lsm1Sync(sqlite3_vtab *pVtab){ return SQLITE_OK; } /* Commit a transaction */ static int lsm1Commit(sqlite3_vtab *pVtab){ lsm1_vtab *p = (lsm1_vtab*)pVtab; int rc = lsm_commit(p->pDb, 0); return rc==LSM_OK ? SQLITE_OK : SQLITE_ERROR; } /* Rollback a transaction */ static int lsm1Rollback(sqlite3_vtab *pVtab){ lsm1_vtab *p = (lsm1_vtab*)pVtab; int rc = lsm_rollback(p->pDb, 0); return rc==LSM_OK ? SQLITE_OK : SQLITE_ERROR; } /* ** This following structure defines all the methods for the ** generate_lsm1 virtual table. */ static sqlite3_module lsm1Module = { 0, /* iVersion */ lsm1Connect, /* xCreate */ lsm1Connect, /* xConnect */ lsm1BestIndex, /* xBestIndex */ lsm1Disconnect, /* xDisconnect */ lsm1Disconnect, /* xDestroy */ lsm1Open, /* xOpen - open a cursor */ lsm1Close, /* xClose - close a cursor */ lsm1Filter, /* xFilter - configure scan constraints */ lsm1Next, /* xNext - advance a cursor */ lsm1Eof, /* xEof - check for end of scan */ lsm1Column, /* xColumn - read data */ lsm1Rowid, /* xRowid - read data */ lsm1Update, /* xUpdate */ lsm1Begin, /* xBegin */ lsm1Sync, /* xSync */ lsm1Commit, /* xCommit */ lsm1Rollback, /* xRollback */ 0, /* xFindMethod */ 0, /* xRename */ }; #ifdef _WIN32 __declspec(dllexport) #endif int sqlite3_lsm_init( sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); rc = sqlite3_create_module(db, "lsm1", &lsm1Module, 0); return rc; } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/lsm_win32.c ================================================ /* ** 2011-12-03 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** Win32-specific run-time environment implementation for LSM. */ #ifdef _WIN32 #include #include #include #include #include #include #include "windows.h" #include "lsmInt.h" /* ** An open file is an instance of the following object */ typedef struct Win32File Win32File; struct Win32File { lsm_env *pEnv; /* The run-time environment */ const char *zName; /* Full path to file */ HANDLE hFile; /* Open file handle */ HANDLE hShmFile; /* File handle for *-shm file */ SYSTEM_INFO sysInfo; /* Operating system information */ HANDLE hMap; /* File handle for mapping */ LPVOID pMap; /* Pointer to mapping of file fd */ size_t nMap; /* Size of mapping at pMap in bytes */ int nShm; /* Number of entries in ahShm[]/apShm[] */ LPHANDLE ahShm; /* Array of handles for shared mappings */ LPVOID *apShm; /* Array of 32K shared memory segments */ }; static char *win32ShmFile(Win32File *pWin32File){ char *zShm; int nName = strlen(pWin32File->zName); zShm = (char *)lsmMallocZero(pWin32File->pEnv, nName+4+1); if( zShm ){ memcpy(zShm, pWin32File->zName, nName); memcpy(&zShm[nName], "-shm", 5); } return zShm; } static int win32Sleep(int us){ Sleep((us + 999) / 1000); return LSM_OK; } /* ** The number of times that an I/O operation will be retried following a ** locking error - probably caused by antivirus software. Also the initial ** delay before the first retry. The delay increases linearly with each ** retry. */ #ifndef LSM_WIN32_IOERR_RETRY # define LSM_WIN32_IOERR_RETRY 10 #endif #ifndef LSM_WIN32_IOERR_RETRY_DELAY # define LSM_WIN32_IOERR_RETRY_DELAY 25000 #endif static int win32IoerrRetry = LSM_WIN32_IOERR_RETRY; static int win32IoerrRetryDelay = LSM_WIN32_IOERR_RETRY_DELAY; /* ** The "win32IoerrCanRetry1" macro is used to determine if a particular ** I/O error code obtained via GetLastError() is eligible to be retried. ** It must accept the error code DWORD as its only argument and should ** return non-zero if the error code is transient in nature and the ** operation responsible for generating the original error might succeed ** upon being retried. The argument to this macro should be a variable. ** ** Additionally, a macro named "win32IoerrCanRetry2" may be defined. If ** it is defined, it will be consulted only when the macro ** "win32IoerrCanRetry1" returns zero. The "win32IoerrCanRetry2" macro ** is completely optional and may be used to include additional error ** codes in the set that should result in the failing I/O operation being ** retried by the caller. If defined, the "win32IoerrCanRetry2" macro ** must exhibit external semantics identical to those of the ** "win32IoerrCanRetry1" macro. */ #if !defined(win32IoerrCanRetry1) #define win32IoerrCanRetry1(a) (((a)==ERROR_ACCESS_DENIED) || \ ((a)==ERROR_SHARING_VIOLATION) || \ ((a)==ERROR_LOCK_VIOLATION) || \ ((a)==ERROR_DEV_NOT_EXIST) || \ ((a)==ERROR_NETNAME_DELETED) || \ ((a)==ERROR_SEM_TIMEOUT) || \ ((a)==ERROR_NETWORK_UNREACHABLE)) #endif /* ** If an I/O error occurs, invoke this routine to see if it should be ** retried. Return TRUE to retry. Return FALSE to give up with an ** error. */ static int win32RetryIoerr( lsm_env *pEnv, int *pnRetry ){ DWORD lastErrno; if( *pnRetry>=win32IoerrRetry ){ return 0; } lastErrno = GetLastError(); if( win32IoerrCanRetry1(lastErrno) ){ win32Sleep(win32IoerrRetryDelay*(1+*pnRetry)); ++*pnRetry; return 1; } #if defined(win32IoerrCanRetry2) else if( win32IoerrCanRetry2(lastErrno) ){ win32Sleep(win32IoerrRetryDelay*(1+*pnRetry)); ++*pnRetry; return 1; } #endif return 0; } /* ** Convert a UTF-8 string to Microsoft Unicode. ** ** Space to hold the returned string is obtained from lsmMalloc(). */ static LPWSTR win32Utf8ToUnicode(lsm_env *pEnv, const char *zText){ int nChar; LPWSTR zWideText; nChar = MultiByteToWideChar(CP_UTF8, 0, zText, -1, NULL, 0); if( nChar==0 ){ return 0; } zWideText = lsmMallocZero(pEnv, nChar * sizeof(WCHAR)); if( zWideText==0 ){ return 0; } nChar = MultiByteToWideChar(CP_UTF8, 0, zText, -1, zWideText, nChar); if( nChar==0 ){ lsmFree(pEnv, zWideText); zWideText = 0; } return zWideText; } /* ** Convert a Microsoft Unicode string to UTF-8. ** ** Space to hold the returned string is obtained from lsmMalloc(). */ static char *win32UnicodeToUtf8(lsm_env *pEnv, LPCWSTR zWideText){ int nByte; char *zText; nByte = WideCharToMultiByte(CP_UTF8, 0, zWideText, -1, 0, 0, 0, 0); if( nByte == 0 ){ return 0; } zText = lsmMallocZero(pEnv, nByte); if( zText==0 ){ return 0; } nByte = WideCharToMultiByte(CP_UTF8, 0, zWideText, -1, zText, nByte, 0, 0); if( nByte == 0 ){ lsmFree(pEnv, zText); zText = 0; } return zText; } #if !defined(win32IsNotFound) #define win32IsNotFound(a) (((a)==ERROR_FILE_NOT_FOUND) || \ ((a)==ERROR_PATH_NOT_FOUND)) #endif static int win32Open( lsm_env *pEnv, const char *zFile, int flags, LPHANDLE phFile ){ int rc; LPWSTR zConverted; zConverted = win32Utf8ToUnicode(pEnv, zFile); if( zConverted==0 ){ rc = LSM_NOMEM_BKPT; }else{ int bReadonly = (flags & LSM_OPEN_READONLY); DWORD dwDesiredAccess; DWORD dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; DWORD dwCreationDisposition; DWORD dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL; HANDLE hFile; int nRetry = 0; if( bReadonly ){ dwDesiredAccess = GENERIC_READ; dwCreationDisposition = OPEN_EXISTING; }else{ dwDesiredAccess = GENERIC_READ | GENERIC_WRITE; dwCreationDisposition = OPEN_ALWAYS; } while( (hFile = CreateFileW((LPCWSTR)zConverted, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL))==INVALID_HANDLE_VALUE && win32RetryIoerr(pEnv, &nRetry) ){ /* Noop */ } lsmFree(pEnv, zConverted); if( hFile!=INVALID_HANDLE_VALUE ){ *phFile = hFile; rc = LSM_OK; }else{ if( win32IsNotFound(GetLastError()) ){ rc = lsmErrorBkpt(LSM_IOERR_NOENT); }else{ rc = LSM_IOERR_BKPT; } } } return rc; } static int lsmWin32OsOpen( lsm_env *pEnv, const char *zFile, int flags, lsm_file **ppFile ){ int rc = LSM_OK; Win32File *pWin32File; pWin32File = lsmMallocZero(pEnv, sizeof(Win32File)); if( pWin32File==0 ){ rc = LSM_NOMEM_BKPT; }else{ HANDLE hFile = NULL; rc = win32Open(pEnv, zFile, flags, &hFile); if( rc==LSM_OK ){ memset(&pWin32File->sysInfo, 0, sizeof(SYSTEM_INFO)); GetSystemInfo(&pWin32File->sysInfo); pWin32File->pEnv = pEnv; pWin32File->zName = zFile; pWin32File->hFile = hFile; }else{ lsmFree(pEnv, pWin32File); pWin32File = 0; } } *ppFile = (lsm_file *)pWin32File; return rc; } static int lsmWin32OsWrite( lsm_file *pFile, /* File to write to */ lsm_i64 iOff, /* Offset to write to */ void *pData, /* Write data from this buffer */ int nData /* Bytes of data to write */ ){ Win32File *pWin32File = (Win32File *)pFile; OVERLAPPED overlapped; /* The offset for WriteFile. */ u8 *aRem = (u8 *)pData; /* Data yet to be written */ int nRem = nData; /* Number of bytes yet to be written */ int nRetry = 0; /* Number of retrys */ memset(&overlapped, 0, sizeof(OVERLAPPED)); overlapped.Offset = (LONG)(iOff & 0XFFFFFFFF); overlapped.OffsetHigh = (LONG)((iOff>>32) & 0x7FFFFFFF); while( nRem>0 ){ DWORD nWrite = 0; /* Bytes written using WriteFile */ if( !WriteFile(pWin32File->hFile, aRem, nRem, &nWrite, &overlapped) ){ if( win32RetryIoerr(pWin32File->pEnv, &nRetry) ) continue; break; } assert( nWrite==0 || nWrite<=(DWORD)nRem ); if( nWrite==0 || nWrite>(DWORD)nRem ){ break; } iOff += nWrite; overlapped.Offset = (LONG)(iOff & 0xFFFFFFFF); overlapped.OffsetHigh = (LONG)((iOff>>32) & 0x7FFFFFFF); aRem += nWrite; nRem -= nWrite; } if( nRem!=0 ) return LSM_IOERR_BKPT; return LSM_OK; } static int win32Truncate( HANDLE hFile, lsm_i64 nSize ){ LARGE_INTEGER offset; offset.QuadPart = nSize; if( !SetFilePointerEx(hFile, offset, 0, FILE_BEGIN) ){ return LSM_IOERR_BKPT; } if (!SetEndOfFile(hFile) ){ return LSM_IOERR_BKPT; } return LSM_OK; } static int lsmWin32OsTruncate( lsm_file *pFile, /* File to write to */ lsm_i64 nSize /* Size to truncate file to */ ){ Win32File *pWin32File = (Win32File *)pFile; return win32Truncate(pWin32File->hFile, nSize); } static int lsmWin32OsRead( lsm_file *pFile, /* File to read from */ lsm_i64 iOff, /* Offset to read from */ void *pData, /* Read data into this buffer */ int nData /* Bytes of data to read */ ){ Win32File *pWin32File = (Win32File *)pFile; OVERLAPPED overlapped; /* The offset for ReadFile */ DWORD nRead = 0; /* Bytes read using ReadFile */ int nRetry = 0; /* Number of retrys */ memset(&overlapped, 0, sizeof(OVERLAPPED)); overlapped.Offset = (LONG)(iOff & 0XFFFFFFFF); overlapped.OffsetHigh = (LONG)((iOff>>32) & 0X7FFFFFFF); while( !ReadFile(pWin32File->hFile, pData, nData, &nRead, &overlapped) && GetLastError()!=ERROR_HANDLE_EOF ){ if( win32RetryIoerr(pWin32File->pEnv, &nRetry) ) continue; return LSM_IOERR_BKPT; } if( nRead<(DWORD)nData ){ /* Unread parts of the buffer must be zero-filled */ memset(&((char*)pData)[nRead], 0, nData - nRead); } return LSM_OK; } static int lsmWin32OsSync(lsm_file *pFile){ int rc = LSM_OK; #ifndef LSM_NO_SYNC Win32File *pWin32File = (Win32File *)pFile; if( pWin32File->pMap!=NULL ){ if( !FlushViewOfFile(pWin32File->pMap, 0) ){ rc = LSM_IOERR_BKPT; } } if( rc==LSM_OK && !FlushFileBuffers(pWin32File->hFile) ){ rc = LSM_IOERR_BKPT; } #else unused_parameter(pFile); #endif return rc; } static int lsmWin32OsSectorSize(lsm_file *pFile){ return 512; } static void win32Unmap(Win32File *pWin32File){ if( pWin32File->pMap!=NULL ){ UnmapViewOfFile(pWin32File->pMap); pWin32File->pMap = NULL; pWin32File->nMap = 0; } if( pWin32File->hMap!=NULL ){ CloseHandle(pWin32File->hMap); pWin32File->hMap = NULL; } } static int lsmWin32OsRemap( lsm_file *pFile, lsm_i64 iMin, void **ppOut, lsm_i64 *pnOut ){ Win32File *pWin32File = (Win32File *)pFile; /* If the file is between 0 and 2MB in size, extend it in chunks of 256K. ** Thereafter, in chunks of 1MB at a time. */ const int aIncrSz[] = {256*1024, 1024*1024}; int nIncrSz = aIncrSz[iMin>(2*1024*1024)]; *ppOut = NULL; *pnOut = 0; win32Unmap(pWin32File); if( iMin>=0 ){ LARGE_INTEGER fileSize; DWORD dwSizeHigh; DWORD dwSizeLow; HANDLE hMap; LPVOID pMap; memset(&fileSize, 0, sizeof(LARGE_INTEGER)); if( !GetFileSizeEx(pWin32File->hFile, &fileSize) ){ return LSM_IOERR_BKPT; } assert( fileSize.QuadPart>=0 ); if( fileSize.QuadPart> 32); hMap = CreateFileMappingW(pWin32File->hFile, NULL, PAGE_READWRITE, dwSizeHigh, dwSizeLow, NULL); if( hMap==NULL ){ return LSM_IOERR_BKPT; } pWin32File->hMap = hMap; assert( fileSize.QuadPart<=0xFFFFFFFF ); pMap = MapViewOfFile(hMap, FILE_MAP_WRITE | FILE_MAP_READ, 0, 0, (SIZE_T)fileSize.QuadPart); if( pMap==NULL ){ return LSM_IOERR_BKPT; } pWin32File->pMap = pMap; pWin32File->nMap = (SIZE_T)fileSize.QuadPart; } *ppOut = pWin32File->pMap; *pnOut = pWin32File->nMap; return LSM_OK; } static BOOL win32IsDriveLetterAndColon( const char *zPathname ){ return ( isalpha(zPathname[0]) && zPathname[1]==':' ); } static int lsmWin32OsFullpath( lsm_env *pEnv, const char *zName, char *zOut, int *pnOut ){ DWORD nByte; void *zConverted; LPWSTR zTempWide; char *zTempUtf8; if( zName[0]=='/' && win32IsDriveLetterAndColon(zName+1) ){ zName++; } zConverted = win32Utf8ToUnicode(pEnv, zName); if( zConverted==0 ){ return LSM_NOMEM_BKPT; } nByte = GetFullPathNameW((LPCWSTR)zConverted, 0, 0, 0); if( nByte==0 ){ lsmFree(pEnv, zConverted); return LSM_IOERR_BKPT; } nByte += 3; zTempWide = lsmMallocZero(pEnv, nByte * sizeof(zTempWide[0])); if( zTempWide==0 ){ lsmFree(pEnv, zConverted); return LSM_NOMEM_BKPT; } nByte = GetFullPathNameW((LPCWSTR)zConverted, nByte, zTempWide, 0); if( nByte==0 ){ lsmFree(pEnv, zConverted); lsmFree(pEnv, zTempWide); return LSM_IOERR_BKPT; } lsmFree(pEnv, zConverted); zTempUtf8 = win32UnicodeToUtf8(pEnv, zTempWide); lsmFree(pEnv, zTempWide); if( zTempUtf8 ){ int nOut = *pnOut; int nLen = strlen(zTempUtf8) + 1; if( nLen<=nOut ){ snprintf(zOut, nOut, "%s", zTempUtf8); } lsmFree(pEnv, zTempUtf8); *pnOut = nLen; return LSM_OK; }else{ return LSM_NOMEM_BKPT; } } static int lsmWin32OsFileid( lsm_file *pFile, void *pBuf, int *pnBuf ){ int nBuf; int nReq; u8 *pBuf2 = (u8 *)pBuf; Win32File *pWin32File = (Win32File *)pFile; BY_HANDLE_FILE_INFORMATION fileInfo; nBuf = *pnBuf; nReq = (sizeof(fileInfo.dwVolumeSerialNumber) + sizeof(fileInfo.nFileIndexHigh) + sizeof(fileInfo.nFileIndexLow)); *pnBuf = nReq; if( nReq>nBuf ) return LSM_OK; memset(&fileInfo, 0, sizeof(BY_HANDLE_FILE_INFORMATION)); if( !GetFileInformationByHandle(pWin32File->hFile, &fileInfo) ){ return LSM_IOERR_BKPT; } nReq = sizeof(fileInfo.dwVolumeSerialNumber); memcpy(pBuf2, &fileInfo.dwVolumeSerialNumber, nReq); pBuf2 += nReq; nReq = sizeof(fileInfo.nFileIndexHigh); memcpy(pBuf, &fileInfo.nFileIndexHigh, nReq); pBuf2 += nReq; nReq = sizeof(fileInfo.nFileIndexLow); memcpy(pBuf2, &fileInfo.nFileIndexLow, nReq); return LSM_OK; } static int win32Delete( lsm_env *pEnv, const char *zFile ){ int rc; LPWSTR zConverted; zConverted = win32Utf8ToUnicode(pEnv, zFile); if( zConverted==0 ){ rc = LSM_NOMEM_BKPT; }else{ int nRetry = 0; DWORD attr; do { attr = GetFileAttributesW(zConverted); if ( attr==INVALID_FILE_ATTRIBUTES ){ rc = LSM_IOERR_BKPT; break; } if ( attr&FILE_ATTRIBUTE_DIRECTORY ){ rc = LSM_IOERR_BKPT; /* Files only. */ break; } if ( DeleteFileW(zConverted) ){ rc = LSM_OK; /* Deleted OK. */ break; } if ( !win32RetryIoerr(pEnv, &nRetry) ){ rc = LSM_IOERR_BKPT; /* No more retries. */ break; } }while( 1 ); } lsmFree(pEnv, zConverted); return rc; } static int lsmWin32OsUnlink(lsm_env *pEnv, const char *zFile){ return win32Delete(pEnv, zFile); } #if !defined(win32IsLockBusy) #define win32IsLockBusy(a) (((a)==ERROR_LOCK_VIOLATION) || \ ((a)==ERROR_IO_PENDING)) #endif static int win32LockFile( Win32File *pWin32File, int iLock, int nLock, int eType ){ OVERLAPPED ovlp; assert( LSM_LOCK_UNLOCK==0 ); assert( LSM_LOCK_SHARED==1 ); assert( LSM_LOCK_EXCL==2 ); assert( eType>=LSM_LOCK_UNLOCK && eType<=LSM_LOCK_EXCL ); assert( nLock>=0 ); assert( iLock>0 && iLock<=32 ); memset(&ovlp, 0, sizeof(OVERLAPPED)); ovlp.Offset = (4096-iLock-nLock+1); if( eType>LSM_LOCK_UNLOCK ){ DWORD flags = LOCKFILE_FAIL_IMMEDIATELY; if( eType>=LSM_LOCK_EXCL ) flags |= LOCKFILE_EXCLUSIVE_LOCK; if( !LockFileEx(pWin32File->hFile, flags, 0, (DWORD)nLock, 0, &ovlp) ){ if( win32IsLockBusy(GetLastError()) ){ return LSM_BUSY; }else{ return LSM_IOERR_BKPT; } } }else{ if( !UnlockFileEx(pWin32File->hFile, 0, (DWORD)nLock, 0, &ovlp) ){ return LSM_IOERR_BKPT; } } return LSM_OK; } static int lsmWin32OsLock(lsm_file *pFile, int iLock, int eType){ Win32File *pWin32File = (Win32File *)pFile; return win32LockFile(pWin32File, iLock, 1, eType); } static int lsmWin32OsTestLock(lsm_file *pFile, int iLock, int nLock, int eType){ int rc; Win32File *pWin32File = (Win32File *)pFile; rc = win32LockFile(pWin32File, iLock, nLock, eType); if( rc!=LSM_OK ) return rc; win32LockFile(pWin32File, iLock, nLock, LSM_LOCK_UNLOCK); return LSM_OK; } static int lsmWin32OsShmMap(lsm_file *pFile, int iChunk, int sz, void **ppShm){ int rc; Win32File *pWin32File = (Win32File *)pFile; int iOffset = iChunk * sz; int iOffsetShift = iOffset % pWin32File->sysInfo.dwAllocationGranularity; int nNew = iChunk + 1; lsm_i64 nReq = nNew * sz; *ppShm = NULL; assert( sz>=0 ); assert( sz==LSM_SHM_CHUNK_SIZE ); if( iChunk>=pWin32File->nShm ){ LPHANDLE ahNew; LPVOID *apNew; LARGE_INTEGER fileSize; /* If the shared-memory file has not been opened, open it now. */ if( pWin32File->hShmFile==NULL ){ char *zShm = win32ShmFile(pWin32File); if( !zShm ) return LSM_NOMEM_BKPT; rc = win32Open(pWin32File->pEnv, zShm, 0, &pWin32File->hShmFile); lsmFree(pWin32File->pEnv, zShm); if( rc!=LSM_OK ){ return rc; } } /* If the shared-memory file is not large enough to contain the ** requested chunk, cause it to grow. */ memset(&fileSize, 0, sizeof(LARGE_INTEGER)); if( !GetFileSizeEx(pWin32File->hShmFile, &fileSize) ){ return LSM_IOERR_BKPT; } assert( fileSize.QuadPart>=0 ); if( fileSize.QuadParthShmFile, nReq); if( rc!=LSM_OK ){ return rc; } } ahNew = (LPHANDLE)lsmMallocZero(pWin32File->pEnv, sizeof(HANDLE) * nNew); if( !ahNew ) return LSM_NOMEM_BKPT; apNew = (LPVOID *)lsmMallocZero(pWin32File->pEnv, sizeof(LPVOID) * nNew); if( !apNew ){ lsmFree(pWin32File->pEnv, ahNew); return LSM_NOMEM_BKPT; } memcpy(ahNew, pWin32File->ahShm, sizeof(HANDLE) * pWin32File->nShm); memcpy(apNew, pWin32File->apShm, sizeof(LPVOID) * pWin32File->nShm); lsmFree(pWin32File->pEnv, pWin32File->ahShm); pWin32File->ahShm = ahNew; lsmFree(pWin32File->pEnv, pWin32File->apShm); pWin32File->apShm = apNew; pWin32File->nShm = nNew; } if( pWin32File->ahShm[iChunk]==NULL ){ HANDLE hMap; assert( nReq<=0xFFFFFFFF ); hMap = CreateFileMappingW(pWin32File->hShmFile, NULL, PAGE_READWRITE, 0, (DWORD)nReq, NULL); if( hMap==NULL ){ return LSM_IOERR_BKPT; } pWin32File->ahShm[iChunk] = hMap; } if( pWin32File->apShm[iChunk]==NULL ){ LPVOID pMap; pMap = MapViewOfFile(pWin32File->ahShm[iChunk], FILE_MAP_WRITE | FILE_MAP_READ, 0, iOffset - iOffsetShift, sz + iOffsetShift); if( pMap==NULL ){ return LSM_IOERR_BKPT; } pWin32File->apShm[iChunk] = pMap; } if( iOffsetShift!=0 ){ char *p = (char *)pWin32File->apShm[iChunk]; *ppShm = (void *)&p[iOffsetShift]; }else{ *ppShm = pWin32File->apShm[iChunk]; } return LSM_OK; } static void lsmWin32OsShmBarrier(void){ MemoryBarrier(); } static int lsmWin32OsShmUnmap(lsm_file *pFile, int bDelete){ Win32File *pWin32File = (Win32File *)pFile; if( pWin32File->hShmFile!=NULL ){ int i; for(i=0; inShm; i++){ if( pWin32File->apShm[i]!=NULL ){ UnmapViewOfFile(pWin32File->apShm[i]); pWin32File->apShm[i] = NULL; } if( pWin32File->ahShm[i]!=NULL ){ CloseHandle(pWin32File->ahShm[i]); pWin32File->ahShm[i] = NULL; } } CloseHandle(pWin32File->hShmFile); pWin32File->hShmFile = NULL; if( bDelete ){ char *zShm = win32ShmFile(pWin32File); if( zShm ){ win32Delete(pWin32File->pEnv, zShm); } lsmFree(pWin32File->pEnv, zShm); } } return LSM_OK; } #define MX_CLOSE_ATTEMPT 3 static int lsmWin32OsClose(lsm_file *pFile){ int rc; int nRetry = 0; Win32File *pWin32File = (Win32File *)pFile; lsmWin32OsShmUnmap(pFile, 0); win32Unmap(pWin32File); do{ if( pWin32File->hFile==NULL ){ rc = LSM_IOERR_BKPT; break; } rc = CloseHandle(pWin32File->hFile); if( rc ){ pWin32File->hFile = NULL; rc = LSM_OK; break; } if( ++nRetry>=MX_CLOSE_ATTEMPT ){ rc = LSM_IOERR_BKPT; break; } }while( 1 ); lsmFree(pWin32File->pEnv, pWin32File->ahShm); lsmFree(pWin32File->pEnv, pWin32File->apShm); lsmFree(pWin32File->pEnv, pWin32File); return rc; } static int lsmWin32OsSleep(lsm_env *pEnv, int us){ unused_parameter(pEnv); return win32Sleep(us); } /**************************************************************************** ** Memory allocation routines. */ static void *lsmWin32OsMalloc(lsm_env *pEnv, size_t N){ assert( HeapValidate(GetProcessHeap(), 0, NULL) ); return HeapAlloc(GetProcessHeap(), 0, (SIZE_T)N); } static void lsmWin32OsFree(lsm_env *pEnv, void *p){ assert( HeapValidate(GetProcessHeap(), 0, NULL) ); if( p ){ HeapFree(GetProcessHeap(), 0, p); } } static void *lsmWin32OsRealloc(lsm_env *pEnv, void *p, size_t N){ unsigned char *m = (unsigned char *)p; assert( HeapValidate(GetProcessHeap(), 0, NULL) ); if( 1>N ){ lsmWin32OsFree(pEnv, p); return NULL; }else if( NULL==p ){ return lsmWin32OsMalloc(pEnv, N); }else{ #if 0 /* arguable: don't shrink */ SIZE_T sz = HeapSize(GetProcessHeap(), 0, m); if( sz>=(SIZE_T)N ){ return p; } #endif return HeapReAlloc(GetProcessHeap(), 0, m, N); } } static size_t lsmWin32OsMSize(lsm_env *pEnv, void *p){ assert( HeapValidate(GetProcessHeap(), 0, NULL) ); return (size_t)HeapSize(GetProcessHeap(), 0, p); } #ifdef LSM_MUTEX_WIN32 /************************************************************************* ** Mutex methods for Win32 based systems. If LSM_MUTEX_WIN32 is ** missing then a no-op implementation of mutexes found below will be ** used instead. */ #include "windows.h" typedef struct Win32Mutex Win32Mutex; struct Win32Mutex { lsm_env *pEnv; CRITICAL_SECTION mutex; #ifdef LSM_DEBUG DWORD owner; #endif }; #ifndef WIN32_MUTEX_INITIALIZER # define WIN32_MUTEX_INITIALIZER { 0 } #endif #ifdef LSM_DEBUG # define LSM_WIN32_STATIC_MUTEX { 0, WIN32_MUTEX_INITIALIZER, 0 } #else # define LSM_WIN32_STATIC_MUTEX { 0, WIN32_MUTEX_INITIALIZER } #endif static int lsmWin32OsMutexStatic( lsm_env *pEnv, int iMutex, lsm_mutex **ppStatic ){ static volatile LONG initialized = 0; static Win32Mutex sMutex[2] = { LSM_WIN32_STATIC_MUTEX, LSM_WIN32_STATIC_MUTEX }; assert( iMutex==LSM_MUTEX_GLOBAL || iMutex==LSM_MUTEX_HEAP ); assert( LSM_MUTEX_GLOBAL==1 && LSM_MUTEX_HEAP==2 ); if( InterlockedCompareExchange(&initialized, 1, 0)==0 ){ int i; for(i=0; ipEnv = pEnv; InitializeCriticalSection(&pMutex->mutex); *ppNew = (lsm_mutex *)pMutex; return LSM_OK; } static void lsmWin32OsMutexDel(lsm_mutex *p){ Win32Mutex *pMutex = (Win32Mutex *)p; DeleteCriticalSection(&pMutex->mutex); lsmFree(pMutex->pEnv, pMutex); } static void lsmWin32OsMutexEnter(lsm_mutex *p){ Win32Mutex *pMutex = (Win32Mutex *)p; EnterCriticalSection(&pMutex->mutex); #ifdef LSM_DEBUG assert( pMutex->owner!=GetCurrentThreadId() ); pMutex->owner = GetCurrentThreadId(); assert( pMutex->owner==GetCurrentThreadId() ); #endif } static int lsmWin32OsMutexTry(lsm_mutex *p){ BOOL bRet; Win32Mutex *pMutex = (Win32Mutex *)p; bRet = TryEnterCriticalSection(&pMutex->mutex); #ifdef LSM_DEBUG if( bRet ){ assert( pMutex->owner!=GetCurrentThreadId() ); pMutex->owner = GetCurrentThreadId(); assert( pMutex->owner==GetCurrentThreadId() ); } #endif return !bRet; } static void lsmWin32OsMutexLeave(lsm_mutex *p){ Win32Mutex *pMutex = (Win32Mutex *)p; #ifdef LSM_DEBUG assert( pMutex->owner==GetCurrentThreadId() ); pMutex->owner = 0; assert( pMutex->owner!=GetCurrentThreadId() ); #endif LeaveCriticalSection(&pMutex->mutex); } #ifdef LSM_DEBUG static int lsmWin32OsMutexHeld(lsm_mutex *p){ Win32Mutex *pMutex = (Win32Mutex *)p; return pMutex ? pMutex->owner==GetCurrentThreadId() : 1; } static int lsmWin32OsMutexNotHeld(lsm_mutex *p){ Win32Mutex *pMutex = (Win32Mutex *)p; return pMutex ? pMutex->owner!=GetCurrentThreadId() : 1; } #endif /* ** End of Win32 mutex implementation. *************************************************************************/ #else /************************************************************************* ** Noop mutex implementation */ typedef struct NoopMutex NoopMutex; struct NoopMutex { lsm_env *pEnv; /* Environment handle (for xFree()) */ int bHeld; /* True if mutex is held */ int bStatic; /* True for a static mutex */ }; static NoopMutex aStaticNoopMutex[2] = { {0, 0, 1}, {0, 0, 1}, }; static int lsmWin32OsMutexStatic( lsm_env *pEnv, int iMutex, lsm_mutex **ppStatic ){ assert( iMutex>=1 && iMutex<=(int)array_size(aStaticNoopMutex) ); *ppStatic = (lsm_mutex *)&aStaticNoopMutex[iMutex-1]; return LSM_OK; } static int lsmWin32OsMutexNew(lsm_env *pEnv, lsm_mutex **ppNew){ NoopMutex *p; p = (NoopMutex *)lsmMallocZero(pEnv, sizeof(NoopMutex)); if( p ) p->pEnv = pEnv; *ppNew = (lsm_mutex *)p; return (p ? LSM_OK : LSM_NOMEM_BKPT); } static void lsmWin32OsMutexDel(lsm_mutex *pMutex) { NoopMutex *p = (NoopMutex *)pMutex; assert( p->bStatic==0 && p->pEnv ); lsmFree(p->pEnv, p); } static void lsmWin32OsMutexEnter(lsm_mutex *pMutex){ NoopMutex *p = (NoopMutex *)pMutex; assert( p->bHeld==0 ); p->bHeld = 1; } static int lsmWin32OsMutexTry(lsm_mutex *pMutex){ NoopMutex *p = (NoopMutex *)pMutex; assert( p->bHeld==0 ); p->bHeld = 1; return 0; } static void lsmWin32OsMutexLeave(lsm_mutex *pMutex){ NoopMutex *p = (NoopMutex *)pMutex; assert( p->bHeld==1 ); p->bHeld = 0; } #ifdef LSM_DEBUG static int lsmWin32OsMutexHeld(lsm_mutex *pMutex){ NoopMutex *p = (NoopMutex *)pMutex; return p ? p->bHeld : 1; } static int lsmWin32OsMutexNotHeld(lsm_mutex *pMutex){ NoopMutex *p = (NoopMutex *)pMutex; return p ? !p->bHeld : 1; } #endif /***************************************************************************/ #endif /* else LSM_MUTEX_NONE */ /* Without LSM_DEBUG, the MutexHeld tests are never called */ #ifndef LSM_DEBUG # define lsmWin32OsMutexHeld 0 # define lsmWin32OsMutexNotHeld 0 #endif lsm_env *lsm_default_env(void){ static lsm_env win32_env = { sizeof(lsm_env), /* nByte */ 1, /* iVersion */ /***** file i/o ******************/ 0, /* pVfsCtx */ lsmWin32OsFullpath, /* xFullpath */ lsmWin32OsOpen, /* xOpen */ lsmWin32OsRead, /* xRead */ lsmWin32OsWrite, /* xWrite */ lsmWin32OsTruncate, /* xTruncate */ lsmWin32OsSync, /* xSync */ lsmWin32OsSectorSize, /* xSectorSize */ lsmWin32OsRemap, /* xRemap */ lsmWin32OsFileid, /* xFileid */ lsmWin32OsClose, /* xClose */ lsmWin32OsUnlink, /* xUnlink */ lsmWin32OsLock, /* xLock */ lsmWin32OsTestLock, /* xTestLock */ lsmWin32OsShmMap, /* xShmMap */ lsmWin32OsShmBarrier, /* xShmBarrier */ lsmWin32OsShmUnmap, /* xShmUnmap */ /***** memory allocation *********/ 0, /* pMemCtx */ lsmWin32OsMalloc, /* xMalloc */ lsmWin32OsRealloc, /* xRealloc */ lsmWin32OsFree, /* xFree */ lsmWin32OsMSize, /* xSize */ /***** mutexes *********************/ 0, /* pMutexCtx */ lsmWin32OsMutexStatic, /* xMutexStatic */ lsmWin32OsMutexNew, /* xMutexNew */ lsmWin32OsMutexDel, /* xMutexDel */ lsmWin32OsMutexEnter, /* xMutexEnter */ lsmWin32OsMutexTry, /* xMutexTry */ lsmWin32OsMutexLeave, /* xMutexLeave */ lsmWin32OsMutexHeld, /* xMutexHeld */ lsmWin32OsMutexNotHeld, /* xMutexNotHeld */ /***** other *********************/ lsmWin32OsSleep, /* xSleep */ }; return &win32_env; } #endif ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/test/lsm1_common.tcl ================================================ # 2014 Dec 19 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. .. test] } source $testdir/tester.tcl # Check if the lsm1 extension has been compiled. if {$::tcl_platform(platform) == "windows"} { set lsm1 lsm.dll } else { set lsm1 lsm.so } if {[file exists [file join .. $lsm1]]} { proc return_if_no_lsm1 {} {} } else { proc return_if_no_lsm1 {} { finish_test return -code return } return } proc load_lsm1_vtab {db} { db enable_load_extension 1 db eval {SELECT load_extension('../lsm')} } ================================================ FILE: v2/testdata/_sqlite/ext/lsm1/test/lsm1_simple.test ================================================ # 2017 July 14 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the lsm1 virtual table module. # source [file join [file dirname [info script]] lsm1_common.tcl] set testprefix lsm1_simple return_if_no_lsm1 load_lsm1_vtab db forcedelete testlsm.db do_execsql_test 100 { CREATE VIRTUAL TABLE x1 USING lsm1(testlsm.db,a,UINT,b,c,d); PRAGMA table_info(x1); } { 0 a UINT 1 {} 1 1 b {} 0 {} 0 2 c {} 0 {} 0 3 d {} 0 {} 0 } do_execsql_test 110 { INSERT INTO x1(a,b,c,d) VALUES(15, 11, 22, 33),(8,'banjo',x'333231',NULL), (12,NULL,3.25,-559281390); SELECT a, quote(b), quote(c), quote(d) FROM x1; } {8 'banjo' X'333231' NULL 12 NULL 3.25 -559281390 15 11 22 33} do_execsql_test 111 { SELECT a, quote(lsm1_key), quote(lsm1_value) FROM x1; } {8 X'08' X'2162616E6A6F1633323105' 12 X'0C' X'05320000000000000A401FFB42ABE9DB' 15 X'0F' X'4284C6'} do_execsql_test 120 { UPDATE x1 SET d = d+1.0 WHERE a=15; SELECT a, quote(b), quote(c), quote(d) FROM x1; } {8 'banjo' X'333231' NULL 12 NULL 3.25 -559281390 15 11 22 34.0} do_execsql_test 130 { UPDATE x1 SET a=123456789 WHERE a=12; SELECT a, quote(b), quote(c), quote(d) FROM x1; } {8 'banjo' X'333231' NULL 15 11 22 34.0 123456789 NULL 3.25 -559281390} do_execsql_test 131 { SELECT quote(lsm1_key), printf('0x%x',a) FROM x1 WHERE a > 100000000; } {X'FB075BCD15' 0x75bcd15} do_execsql_test 140 { DELETE FROM x1 WHERE a=15; SELECT a, quote(b), quote(c), quote(d) FROM x1; } {8 'banjo' X'333231' NULL 123456789 NULL 3.25 -559281390} do_test 150 { lsort [glob testlsm.db*] } {testlsm.db testlsm.db-log testlsm.db-shm} db close do_test 160 { lsort [glob testlsm.db*] } {testlsm.db} forcedelete testlsm.db forcedelete test.db sqlite3 db test.db load_lsm1_vtab db do_execsql_test 200 { CREATE VIRTUAL TABLE x1 USING lsm1(testlsm.db,a,TEXT,b,c,d); PRAGMA table_info(x1); } { 0 a TEXT 1 {} 1 1 b {} 0 {} 0 2 c {} 0 {} 0 3 d {} 0 {} 0 } do_execsql_test 210 { INSERT INTO x1(a,b,c,d) VALUES(15, 11, 22, 33),(8,'banjo',x'333231',NULL), (12,NULL,3.25,-559281390); SELECT quote(a), quote(b), quote(c), quote(d), '|' FROM x1; } {'12' NULL 3.25 -559281390 | '15' 11 22 33 | '8' 'banjo' X'333231' NULL |} do_execsql_test 211 { SELECT quote(a), quote(lsm1_key), quote(lsm1_value), '|' FROM x1; } {'12' X'3132' X'05320000000000000A401FFB42ABE9DB' | '15' X'3135' X'4284C6' | '8' X'38' X'2162616E6A6F1633323105' |} finish_test ================================================ FILE: v2/testdata/_sqlite/ext/misc/README.md ================================================ ## Miscellaneous Extensions This folder contains a collection of smaller loadable extensions. See for instructions on how to compile and use loadable extensions. Each extension in this folder is implemented in a single file of C code. Each source file contains a description in its header comment. See the header comments for details about each extension. Additional notes are as follows: * **carray.c** — This module implements the [carray](https://www.sqlite.org/carray.html) table-valued function. It is a good example of how to go about implementing a custom [table-valued function](https://www.sqlite.org/vtab.html#tabfunc2). * **dbdump.c** — This is not actually a loadable extension, but rather a library that implements an approximate equivalent to the ".dump" command of the [command-line shell](https://www.sqlite.org/cli.html). * **memvfs.c** — This file implements a custom [VFS](https://www.sqlite.org/vfs.html) that stores an entire database file in a single block of RAM. It serves as a good example of how to implement a simple custom VFS. * **rot13.c** — This file implements the very simple rot13() substitution function. This file makes a good template for implementing new custom SQL functions for SQLite. * **series.c** — This is an implementation of the "generate_series" [virtual table](https://www.sqlite.org/vtab.html). It can make a good template for new custom virtual table implementations. * **shathree.c** — An implementation of the sha3() and sha3_query() SQL functions. The file is named "shathree.c" instead of "sha3.c" because the default entry point names in SQLite are based on the source filename with digits removed, so if we used the name "sha3.c" then the entry point would conflict with the prior "sha1.c" extension. ================================================ FILE: v2/testdata/_sqlite/ext/misc/amatch.c ================================================ /* ** 2013-03-14 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** This file contains code for a demonstration virtual table that finds ** "approximate matches" - strings from a finite set that are nearly the ** same as a single input string. The virtual table is called "amatch". ** ** A amatch virtual table is created like this: ** ** CREATE VIRTUAL TABLE f USING approximate_match( ** vocabulary_table=, -- V ** vocabulary_word=, -- W ** vocabulary_language=, -- L ** edit_distances= ** ); ** ** When it is created, the new amatch table must be supplied with the ** the name of a table V and columns V.W and V.L such that ** ** SELECT W FROM V WHERE L=$language ** ** returns the allowed vocabulary for the match. If the "vocabulary_language" ** or L columnname is left unspecified or is an empty string, then no ** filtering of the vocabulary by language is performed. ** ** For efficiency, it is essential that the vocabulary table be indexed: ** ** CREATE vocab_index ON V(W) ** ** A separate edit-cost-table provides scoring information that defines ** what it means for one string to be "close" to another. ** ** The edit-cost-table must contain exactly four columns (more precisely, ** the statement "SELECT * FROM " must return records ** that consist of four columns). It does not matter what the columns are ** named. ** ** Each row in the edit-cost-table represents a single character ** transformation going from user input to the vocabulary. The leftmost ** column of the row (column 0) contains an integer identifier of the ** language to which the transformation rule belongs (see "MULTIPLE LANGUAGES" ** below). The second column of the row (column 1) contains the input ** character or characters - the characters of user input. The third ** column contains characters as they appear in the vocabulary table. ** And the fourth column contains the integer cost of making the ** transformation. For example: ** ** CREATE TABLE f_data(iLang, cFrom, cTo, Cost); ** INSERT INTO f_data(iLang, cFrom, cTo, Cost) VALUES(0, '', 'a', 100); ** INSERT INTO f_data(iLang, cFrom, cTo, Cost) VALUES(0, 'b', '', 87); ** INSERT INTO f_data(iLang, cFrom, cTo, Cost) VALUES(0, 'o', 'oe', 38); ** INSERT INTO f_data(iLang, cFrom, cTo, Cost) VALUES(0, 'oe', 'o', 40); ** ** The first row inserted into the edit-cost-table by the SQL script ** above indicates that the cost of having an extra 'a' in the vocabulary ** table that is missing in the user input 100. (All costs are integers. ** Overall cost must not exceed 16777216.) The second INSERT statement ** creates a rule saying that the cost of having a single letter 'b' in ** user input which is missing in the vocabulary table is 87. The third ** INSERT statement mean that the cost of matching an 'o' in user input ** against an 'oe' in the vocabulary table is 38. And so forth. ** ** The following rules are special: ** ** INSERT INTO f_data(iLang, cFrom, cTo, Cost) VALUES(0, '?', '', 97); ** INSERT INTO f_data(iLang, cFrom, cTo, Cost) VALUES(0, '', '?', 98); ** INSERT INTO f_data(iLang, cFrom, cTo, Cost) VALUES(0, '?', '?', 99); ** ** The '?' to '' rule is the cost of having any single character in the input ** that is not found in the vocabular. The '' to '?' rule is the cost of ** having a character in the vocabulary table that is missing from input. ** And the '?' to '?' rule is the cost of doing an arbitrary character ** substitution. These three generic rules apply across all languages. ** In other words, the iLang field is ignored for the generic substitution ** rules. If more than one cost is given for a generic substitution rule, ** then the lowest cost is used. ** ** Once it has been created, the amatch virtual table can be queried ** as follows: ** ** SELECT word, distance FROM f ** WHERE word MATCH 'abcdefg' ** AND distance<200; ** ** This query outputs the strings contained in the T(F) field that ** are close to "abcdefg" and in order of increasing distance. No string ** is output more than once. If there are multiple ways to transform the ** target string ("abcdefg") into a string in the vocabulary table then ** the lowest cost transform is the one that is returned. In this example, ** the search is limited to strings with a total distance of less than 200. ** ** For efficiency, it is important to put tight bounds on the distance. ** The time and memory space needed to perform this query is exponential ** in the maximum distance. A good rule of thumb is to limit the distance ** to no more than 1.5 or 2 times the maximum cost of any rule in the ** edit-cost-table. ** ** The amatch is a read-only table. Any attempt to DELETE, INSERT, or ** UPDATE on a amatch table will throw an error. ** ** It is important to put some kind of a limit on the amatch output. This ** can be either in the form of a LIMIT clause at the end of the query, ** or better, a "distance #include #include #include #include #ifndef SQLITE_OMIT_VIRTUALTABLE /* ** Forward declaration of objects used by this implementation */ typedef struct amatch_vtab amatch_vtab; typedef struct amatch_cursor amatch_cursor; typedef struct amatch_rule amatch_rule; typedef struct amatch_word amatch_word; typedef struct amatch_avl amatch_avl; /***************************************************************************** ** AVL Tree implementation */ /* ** Objects that want to be members of the AVL tree should embedded an ** instance of this structure. */ struct amatch_avl { amatch_word *pWord; /* Points to the object being stored in the tree */ char *zKey; /* Key. zero-terminated string. Must be unique */ amatch_avl *pBefore; /* Other elements less than zKey */ amatch_avl *pAfter; /* Other elements greater than zKey */ amatch_avl *pUp; /* Parent element */ short int height; /* Height of this node. Leaf==1 */ short int imbalance; /* Height difference between pBefore and pAfter */ }; /* Recompute the amatch_avl.height and amatch_avl.imbalance fields for p. ** Assume that the children of p have correct heights. */ static void amatchAvlRecomputeHeight(amatch_avl *p){ short int hBefore = p->pBefore ? p->pBefore->height : 0; short int hAfter = p->pAfter ? p->pAfter->height : 0; p->imbalance = hBefore - hAfter; /* -: pAfter higher. +: pBefore higher */ p->height = (hBefore>hAfter ? hBefore : hAfter)+1; } /* ** P B ** / \ / \ ** B Z ==> X P ** / \ / \ ** X Y Y Z ** */ static amatch_avl *amatchAvlRotateBefore(amatch_avl *pP){ amatch_avl *pB = pP->pBefore; amatch_avl *pY = pB->pAfter; pB->pUp = pP->pUp; pB->pAfter = pP; pP->pUp = pB; pP->pBefore = pY; if( pY ) pY->pUp = pP; amatchAvlRecomputeHeight(pP); amatchAvlRecomputeHeight(pB); return pB; } /* ** P A ** / \ / \ ** X A ==> P Z ** / \ / \ ** Y Z X Y ** */ static amatch_avl *amatchAvlRotateAfter(amatch_avl *pP){ amatch_avl *pA = pP->pAfter; amatch_avl *pY = pA->pBefore; pA->pUp = pP->pUp; pA->pBefore = pP; pP->pUp = pA; pP->pAfter = pY; if( pY ) pY->pUp = pP; amatchAvlRecomputeHeight(pP); amatchAvlRecomputeHeight(pA); return pA; } /* ** Return a pointer to the pBefore or pAfter pointer in the parent ** of p that points to p. Or if p is the root node, return pp. */ static amatch_avl **amatchAvlFromPtr(amatch_avl *p, amatch_avl **pp){ amatch_avl *pUp = p->pUp; if( pUp==0 ) return pp; if( pUp->pAfter==p ) return &pUp->pAfter; return &pUp->pBefore; } /* ** Rebalance all nodes starting with p and working up to the root. ** Return the new root. */ static amatch_avl *amatchAvlBalance(amatch_avl *p){ amatch_avl *pTop = p; amatch_avl **pp; while( p ){ amatchAvlRecomputeHeight(p); if( p->imbalance>=2 ){ amatch_avl *pB = p->pBefore; if( pB->imbalance<0 ) p->pBefore = amatchAvlRotateAfter(pB); pp = amatchAvlFromPtr(p,&p); p = *pp = amatchAvlRotateBefore(p); }else if( p->imbalance<=(-2) ){ amatch_avl *pA = p->pAfter; if( pA->imbalance>0 ) p->pAfter = amatchAvlRotateBefore(pA); pp = amatchAvlFromPtr(p,&p); p = *pp = amatchAvlRotateAfter(p); } pTop = p; p = p->pUp; } return pTop; } /* Search the tree rooted at p for an entry with zKey. Return a pointer ** to the entry or return NULL. */ static amatch_avl *amatchAvlSearch(amatch_avl *p, const char *zKey){ int c; while( p && (c = strcmp(zKey, p->zKey))!=0 ){ p = (c<0) ? p->pBefore : p->pAfter; } return p; } /* Find the first node (the one with the smallest key). */ static amatch_avl *amatchAvlFirst(amatch_avl *p){ if( p ) while( p->pBefore ) p = p->pBefore; return p; } #if 0 /* NOT USED */ /* Return the node with the next larger key after p. */ static amatch_avl *amatchAvlNext(amatch_avl *p){ amatch_avl *pPrev = 0; while( p && p->pAfter==pPrev ){ pPrev = p; p = p->pUp; } if( p && pPrev==0 ){ p = amatchAvlFirst(p->pAfter); } return p; } #endif #if 0 /* NOT USED */ /* Verify AVL tree integrity */ static int amatchAvlIntegrity(amatch_avl *pHead){ amatch_avl *p; if( pHead==0 ) return 1; if( (p = pHead->pBefore)!=0 ){ assert( p->pUp==pHead ); assert( amatchAvlIntegrity(p) ); assert( strcmp(p->zKey, pHead->zKey)<0 ); while( p->pAfter ) p = p->pAfter; assert( strcmp(p->zKey, pHead->zKey)<0 ); } if( (p = pHead->pAfter)!=0 ){ assert( p->pUp==pHead ); assert( amatchAvlIntegrity(p) ); assert( strcmp(p->zKey, pHead->zKey)>0 ); p = amatchAvlFirst(p); assert( strcmp(p->zKey, pHead->zKey)>0 ); } return 1; } static int amatchAvlIntegrity2(amatch_avl *pHead){ amatch_avl *p, *pNext; for(p=amatchAvlFirst(pHead); p; p=pNext){ pNext = amatchAvlNext(p); if( pNext==0 ) break; assert( strcmp(p->zKey, pNext->zKey)<0 ); } return 1; } #endif /* Insert a new node pNew. Return NULL on success. If the key is not ** unique, then do not perform the insert but instead leave pNew unchanged ** and return a pointer to an existing node with the same key. */ static amatch_avl *amatchAvlInsert(amatch_avl **ppHead, amatch_avl *pNew){ int c; amatch_avl *p = *ppHead; if( p==0 ){ p = pNew; pNew->pUp = 0; }else{ while( p ){ c = strcmp(pNew->zKey, p->zKey); if( c<0 ){ if( p->pBefore ){ p = p->pBefore; }else{ p->pBefore = pNew; pNew->pUp = p; break; } }else if( c>0 ){ if( p->pAfter ){ p = p->pAfter; }else{ p->pAfter = pNew; pNew->pUp = p; break; } }else{ return p; } } } pNew->pBefore = 0; pNew->pAfter = 0; pNew->height = 1; pNew->imbalance = 0; *ppHead = amatchAvlBalance(p); /* assert( amatchAvlIntegrity(*ppHead) ); */ /* assert( amatchAvlIntegrity2(*ppHead) ); */ return 0; } /* Remove node pOld from the tree. pOld must be an element of the tree or ** the AVL tree will become corrupt. */ static void amatchAvlRemove(amatch_avl **ppHead, amatch_avl *pOld){ amatch_avl **ppParent; amatch_avl *pBalance = 0; /* assert( amatchAvlSearch(*ppHead, pOld->zKey)==pOld ); */ ppParent = amatchAvlFromPtr(pOld, ppHead); if( pOld->pBefore==0 && pOld->pAfter==0 ){ *ppParent = 0; pBalance = pOld->pUp; }else if( pOld->pBefore && pOld->pAfter ){ amatch_avl *pX, *pY; pX = amatchAvlFirst(pOld->pAfter); *amatchAvlFromPtr(pX, 0) = pX->pAfter; if( pX->pAfter ) pX->pAfter->pUp = pX->pUp; pBalance = pX->pUp; pX->pAfter = pOld->pAfter; if( pX->pAfter ){ pX->pAfter->pUp = pX; }else{ assert( pBalance==pOld ); pBalance = pX; } pX->pBefore = pY = pOld->pBefore; if( pY ) pY->pUp = pX; pX->pUp = pOld->pUp; *ppParent = pX; }else if( pOld->pBefore==0 ){ *ppParent = pBalance = pOld->pAfter; pBalance->pUp = pOld->pUp; }else if( pOld->pAfter==0 ){ *ppParent = pBalance = pOld->pBefore; pBalance->pUp = pOld->pUp; } *ppHead = amatchAvlBalance(pBalance); pOld->pUp = 0; pOld->pBefore = 0; pOld->pAfter = 0; /* assert( amatchAvlIntegrity(*ppHead) ); */ /* assert( amatchAvlIntegrity2(*ppHead) ); */ } /* ** End of the AVL Tree implementation ******************************************************************************/ /* ** Various types. ** ** amatch_cost is the "cost" of an edit operation. ** ** amatch_len is the length of a matching string. ** ** amatch_langid is an ruleset identifier. */ typedef int amatch_cost; typedef signed char amatch_len; typedef int amatch_langid; /* ** Limits */ #define AMATCH_MX_LENGTH 50 /* Maximum length of a rule string */ #define AMATCH_MX_LANGID 2147483647 /* Maximum rule ID */ #define AMATCH_MX_COST 1000 /* Maximum single-rule cost */ /* ** A match or partial match */ struct amatch_word { amatch_word *pNext; /* Next on a list of all amatch_words */ amatch_avl sCost; /* Linkage of this node into the cost tree */ amatch_avl sWord; /* Linkage of this node into the word tree */ amatch_cost rCost; /* Cost of the match so far */ int iSeq; /* Sequence number */ char zCost[10]; /* Cost key (text rendering of rCost) */ short int nMatch; /* Input characters matched */ char zWord[4]; /* Text of the word. Extra space appended as needed */ }; /* ** Each transformation rule is stored as an instance of this object. ** All rules are kept on a linked list sorted by rCost. */ struct amatch_rule { amatch_rule *pNext; /* Next rule in order of increasing rCost */ char *zFrom; /* Transform from (a string from user input) */ amatch_cost rCost; /* Cost of this transformation */ amatch_langid iLang; /* The langauge to which this rule belongs */ amatch_len nFrom, nTo; /* Length of the zFrom and zTo strings */ char zTo[4]; /* Tranform to V.W value (extra space appended) */ }; /* ** A amatch virtual-table object */ struct amatch_vtab { sqlite3_vtab base; /* Base class - must be first */ char *zClassName; /* Name of this class. Default: "amatch" */ char *zDb; /* Name of database. (ex: "main") */ char *zSelf; /* Name of this virtual table */ char *zCostTab; /* Name of edit-cost-table */ char *zVocabTab; /* Name of vocabulary table */ char *zVocabWord; /* Name of vocabulary table word column */ char *zVocabLang; /* Name of vocabulary table language column */ amatch_rule *pRule; /* All active rules in this amatch */ amatch_cost rIns; /* Generic insertion cost '' -> ? */ amatch_cost rDel; /* Generic deletion cost ? -> '' */ amatch_cost rSub; /* Generic substitution cost ? -> ? */ sqlite3 *db; /* The database connection */ sqlite3_stmt *pVCheck; /* Query to check zVocabTab */ int nCursor; /* Number of active cursors */ }; /* A amatch cursor object */ struct amatch_cursor { sqlite3_vtab_cursor base; /* Base class - must be first */ sqlite3_int64 iRowid; /* The rowid of the current word */ amatch_langid iLang; /* Use this language ID */ amatch_cost rLimit; /* Maximum cost of any term */ int nBuf; /* Space allocated for zBuf */ int oomErr; /* True following an OOM error */ int nWord; /* Number of amatch_word objects */ char *zBuf; /* Temp-use buffer space */ char *zInput; /* Input word to match against */ amatch_vtab *pVtab; /* The virtual table this cursor belongs to */ amatch_word *pAllWords; /* List of all amatch_word objects */ amatch_word *pCurrent; /* Most recent solution */ amatch_avl *pCost; /* amatch_word objects keyed by iCost */ amatch_avl *pWord; /* amatch_word objects keyed by zWord */ }; /* ** The two input rule lists are both sorted in order of increasing ** cost. Merge them together into a single list, sorted by cost, and ** return a pointer to the head of that list. */ static amatch_rule *amatchMergeRules(amatch_rule *pA, amatch_rule *pB){ amatch_rule head; amatch_rule *pTail; pTail = &head; while( pA && pB ){ if( pA->rCost<=pB->rCost ){ pTail->pNext = pA; pTail = pA; pA = pA->pNext; }else{ pTail->pNext = pB; pTail = pB; pB = pB->pNext; } } if( pA==0 ){ pTail->pNext = pB; }else{ pTail->pNext = pA; } return head.pNext; } /* ** Statement pStmt currently points to a row in the amatch data table. This ** function allocates and populates a amatch_rule structure according to ** the content of the row. ** ** If successful, *ppRule is set to point to the new object and SQLITE_OK ** is returned. Otherwise, *ppRule is zeroed, *pzErr may be set to point ** to an error message and an SQLite error code returned. */ static int amatchLoadOneRule( amatch_vtab *p, /* Fuzzer virtual table handle */ sqlite3_stmt *pStmt, /* Base rule on statements current row */ amatch_rule **ppRule, /* OUT: New rule object */ char **pzErr /* OUT: Error message */ ){ sqlite3_int64 iLang = sqlite3_column_int64(pStmt, 0); const char *zFrom = (const char *)sqlite3_column_text(pStmt, 1); const char *zTo = (const char *)sqlite3_column_text(pStmt, 2); amatch_cost rCost = sqlite3_column_int(pStmt, 3); int rc = SQLITE_OK; /* Return code */ int nFrom; /* Size of string zFrom, in bytes */ int nTo; /* Size of string zTo, in bytes */ amatch_rule *pRule = 0; /* New rule object to return */ if( zFrom==0 ) zFrom = ""; if( zTo==0 ) zTo = ""; nFrom = (int)strlen(zFrom); nTo = (int)strlen(zTo); /* Silently ignore null transformations */ if( strcmp(zFrom, zTo)==0 ){ if( zFrom[0]=='?' && zFrom[1]==0 ){ if( p->rSub==0 || p->rSub>rCost ) p->rSub = rCost; } *ppRule = 0; return SQLITE_OK; } if( rCost<=0 || rCost>AMATCH_MX_COST ){ *pzErr = sqlite3_mprintf("%s: cost must be between 1 and %d", p->zClassName, AMATCH_MX_COST ); rc = SQLITE_ERROR; }else if( nFrom>AMATCH_MX_LENGTH || nTo>AMATCH_MX_LENGTH ){ *pzErr = sqlite3_mprintf("%s: maximum string length is %d", p->zClassName, AMATCH_MX_LENGTH ); rc = SQLITE_ERROR; }else if( iLang<0 || iLang>AMATCH_MX_LANGID ){ *pzErr = sqlite3_mprintf("%s: iLang must be between 0 and %d", p->zClassName, AMATCH_MX_LANGID ); rc = SQLITE_ERROR; }else if( strcmp(zFrom,"")==0 && strcmp(zTo,"?")==0 ){ if( p->rIns==0 || p->rIns>rCost ) p->rIns = rCost; }else if( strcmp(zFrom,"?")==0 && strcmp(zTo,"")==0 ){ if( p->rDel==0 || p->rDel>rCost ) p->rDel = rCost; }else { pRule = sqlite3_malloc( sizeof(*pRule) + nFrom + nTo ); if( pRule==0 ){ rc = SQLITE_NOMEM; }else{ memset(pRule, 0, sizeof(*pRule)); pRule->zFrom = &pRule->zTo[nTo+1]; pRule->nFrom = (amatch_len)nFrom; memcpy(pRule->zFrom, zFrom, nFrom+1); memcpy(pRule->zTo, zTo, nTo+1); pRule->nTo = (amatch_len)nTo; pRule->rCost = rCost; pRule->iLang = (int)iLang; } } *ppRule = pRule; return rc; } /* ** Free all the content in the edit-cost-table */ static void amatchFreeRules(amatch_vtab *p){ while( p->pRule ){ amatch_rule *pRule = p->pRule; p->pRule = pRule->pNext; sqlite3_free(pRule); } p->pRule = 0; } /* ** Load the content of the amatch data table into memory. */ static int amatchLoadRules( sqlite3 *db, /* Database handle */ amatch_vtab *p, /* Virtual amatch table to configure */ char **pzErr /* OUT: Error message */ ){ int rc = SQLITE_OK; /* Return code */ char *zSql; /* SELECT used to read from rules table */ amatch_rule *pHead = 0; zSql = sqlite3_mprintf("SELECT * FROM %Q.%Q", p->zDb, p->zCostTab); if( zSql==0 ){ rc = SQLITE_NOMEM; }else{ int rc2; /* finalize() return code */ sqlite3_stmt *pStmt = 0; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ *pzErr = sqlite3_mprintf("%s: %s", p->zClassName, sqlite3_errmsg(db)); }else if( sqlite3_column_count(pStmt)!=4 ){ *pzErr = sqlite3_mprintf("%s: %s has %d columns, expected 4", p->zClassName, p->zCostTab, sqlite3_column_count(pStmt) ); rc = SQLITE_ERROR; }else{ while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ amatch_rule *pRule = 0; rc = amatchLoadOneRule(p, pStmt, &pRule, pzErr); if( pRule ){ pRule->pNext = pHead; pHead = pRule; } } } rc2 = sqlite3_finalize(pStmt); if( rc==SQLITE_OK ) rc = rc2; } sqlite3_free(zSql); /* All rules are now in a singly linked list starting at pHead. This ** block sorts them by cost and then sets amatch_vtab.pRule to point to ** point to the head of the sorted list. */ if( rc==SQLITE_OK ){ unsigned int i; amatch_rule *pX; amatch_rule *a[15]; for(i=0; ipNext; pX->pNext = 0; for(i=0; a[i] && ipRule = amatchMergeRules(p->pRule, pX); }else{ /* An error has occurred. Setting p->pRule to point to the head of the ** allocated list ensures that the list will be cleaned up in this case. */ assert( p->pRule==0 ); p->pRule = pHead; } return rc; } /* ** This function converts an SQL quoted string into an unquoted string ** and returns a pointer to a buffer allocated using sqlite3_malloc() ** containing the result. The caller should eventually free this buffer ** using sqlite3_free. ** ** Examples: ** ** "abc" becomes abc ** 'xyz' becomes xyz ** [pqr] becomes pqr ** `mno` becomes mno */ static char *amatchDequote(const char *zIn){ int nIn; /* Size of input string, in bytes */ char *zOut; /* Output (dequoted) string */ nIn = (int)strlen(zIn); zOut = sqlite3_malloc(nIn+1); if( zOut ){ char q = zIn[0]; /* Quote character (if any ) */ if( q!='[' && q!= '\'' && q!='"' && q!='`' ){ memcpy(zOut, zIn, nIn+1); }else{ int iOut = 0; /* Index of next byte to write to output */ int iIn; /* Index of next byte to read from input */ if( q=='[' ) q = ']'; for(iIn=1; iInpVCheck ){ sqlite3_finalize(p->pVCheck); p->pVCheck = 0; } } /* ** Deallocate an amatch_vtab object */ static void amatchFree(amatch_vtab *p){ if( p ){ amatchFreeRules(p); amatchVCheckClear(p); sqlite3_free(p->zClassName); sqlite3_free(p->zDb); sqlite3_free(p->zCostTab); sqlite3_free(p->zVocabTab); sqlite3_free(p->zVocabWord); sqlite3_free(p->zVocabLang); sqlite3_free(p->zSelf); memset(p, 0, sizeof(*p)); sqlite3_free(p); } } /* ** xDisconnect/xDestroy method for the amatch module. */ static int amatchDisconnect(sqlite3_vtab *pVtab){ amatch_vtab *p = (amatch_vtab*)pVtab; assert( p->nCursor==0 ); amatchFree(p); return SQLITE_OK; } /* ** Check to see if the argument is of the form: ** ** KEY = VALUE ** ** If it is, return a pointer to the first character of VALUE. ** If not, return NULL. Spaces around the = are ignored. */ static const char *amatchValueOfKey(const char *zKey, const char *zStr){ int nKey = (int)strlen(zKey); int nStr = (int)strlen(zStr); int i; if( nStr module name ("approximate_match") ** argv[1] -> database name ** argv[2] -> table name ** argv[3...] -> arguments */ static int amatchConnect( sqlite3 *db, void *pAux, int argc, const char *const*argv, sqlite3_vtab **ppVtab, char **pzErr ){ int rc = SQLITE_OK; /* Return code */ amatch_vtab *pNew = 0; /* New virtual table */ const char *zModule = argv[0]; const char *zDb = argv[1]; const char *zVal; int i; (void)pAux; *ppVtab = 0; pNew = sqlite3_malloc( sizeof(*pNew) ); if( pNew==0 ) return SQLITE_NOMEM; rc = SQLITE_NOMEM; memset(pNew, 0, sizeof(*pNew)); pNew->db = db; pNew->zClassName = sqlite3_mprintf("%s", zModule); if( pNew->zClassName==0 ) goto amatchConnectError; pNew->zDb = sqlite3_mprintf("%s", zDb); if( pNew->zDb==0 ) goto amatchConnectError; pNew->zSelf = sqlite3_mprintf("%s", argv[2]); if( pNew->zSelf==0 ) goto amatchConnectError; for(i=3; izVocabTab); pNew->zVocabTab = amatchDequote(zVal); if( pNew->zVocabTab==0 ) goto amatchConnectError; continue; } zVal = amatchValueOfKey("vocabulary_word", argv[i]); if( zVal ){ sqlite3_free(pNew->zVocabWord); pNew->zVocabWord = amatchDequote(zVal); if( pNew->zVocabWord==0 ) goto amatchConnectError; continue; } zVal = amatchValueOfKey("vocabulary_language", argv[i]); if( zVal ){ sqlite3_free(pNew->zVocabLang); pNew->zVocabLang = amatchDequote(zVal); if( pNew->zVocabLang==0 ) goto amatchConnectError; continue; } zVal = amatchValueOfKey("edit_distances", argv[i]); if( zVal ){ sqlite3_free(pNew->zCostTab); pNew->zCostTab = amatchDequote(zVal); if( pNew->zCostTab==0 ) goto amatchConnectError; continue; } *pzErr = sqlite3_mprintf("unrecognized argument: [%s]\n", argv[i]); amatchFree(pNew); *ppVtab = 0; return SQLITE_ERROR; } rc = SQLITE_OK; if( pNew->zCostTab==0 ){ *pzErr = sqlite3_mprintf("no edit_distances table specified"); rc = SQLITE_ERROR; }else{ rc = amatchLoadRules(db, pNew, pzErr); } if( rc==SQLITE_OK ){ rc = sqlite3_declare_vtab(db, "CREATE TABLE x(word,distance,language," "command HIDDEN,nword HIDDEN)" ); #define AMATCH_COL_WORD 0 #define AMATCH_COL_DISTANCE 1 #define AMATCH_COL_LANGUAGE 2 #define AMATCH_COL_COMMAND 3 #define AMATCH_COL_NWORD 4 } if( rc!=SQLITE_OK ){ amatchFree(pNew); } *ppVtab = &pNew->base; return rc; amatchConnectError: amatchFree(pNew); return rc; } /* ** Open a new amatch cursor. */ static int amatchOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ amatch_vtab *p = (amatch_vtab*)pVTab; amatch_cursor *pCur; pCur = sqlite3_malloc( sizeof(*pCur) ); if( pCur==0 ) return SQLITE_NOMEM; memset(pCur, 0, sizeof(*pCur)); pCur->pVtab = p; *ppCursor = &pCur->base; p->nCursor++; return SQLITE_OK; } /* ** Free up all the memory allocated by a cursor. Set it rLimit to 0 ** to indicate that it is at EOF. */ static void amatchClearCursor(amatch_cursor *pCur){ amatch_word *pWord, *pNextWord; for(pWord=pCur->pAllWords; pWord; pWord=pNextWord){ pNextWord = pWord->pNext; sqlite3_free(pWord); } pCur->pAllWords = 0; sqlite3_free(pCur->zInput); pCur->zInput = 0; sqlite3_free(pCur->zBuf); pCur->zBuf = 0; pCur->nBuf = 0; pCur->pCost = 0; pCur->pWord = 0; pCur->pCurrent = 0; pCur->rLimit = 1000000; pCur->iLang = 0; pCur->nWord = 0; } /* ** Close a amatch cursor. */ static int amatchClose(sqlite3_vtab_cursor *cur){ amatch_cursor *pCur = (amatch_cursor *)cur; amatchClearCursor(pCur); pCur->pVtab->nCursor--; sqlite3_free(pCur); return SQLITE_OK; } /* ** Render a 24-bit unsigned integer as a 4-byte base-64 number. */ static void amatchEncodeInt(int x, char *z){ static const char a[] = "0123456789" "ABCDEFGHIJ" "KLMNOPQRST" "UVWXYZ^abc" "defghijklm" "nopqrstuvw" "xyz~"; z[0] = a[(x>>18)&0x3f]; z[1] = a[(x>>12)&0x3f]; z[2] = a[(x>>6)&0x3f]; z[3] = a[x&0x3f]; } /* ** Write the zCost[] field for a amatch_word object */ static void amatchWriteCost(amatch_word *pWord){ amatchEncodeInt(pWord->rCost, pWord->zCost); amatchEncodeInt(pWord->iSeq, pWord->zCost+4); pWord->zCost[8] = 0; } /* Circumvent compiler warnings about the use of strcpy() by supplying ** our own implementation. */ static void amatchStrcpy(char *dest, const char *src){ while( (*(dest++) = *(src++))!=0 ){} } static void amatchStrcat(char *dest, const char *src){ while( *dest ) dest++; amatchStrcpy(dest, src); } /* ** Add a new amatch_word object to the queue. ** ** If a prior amatch_word object with the same zWord, and nMatch ** already exists, update its rCost (if the new rCost is less) but ** otherwise leave it unchanged. Do not add a duplicate. ** ** Do nothing if the cost exceeds threshold. */ static void amatchAddWord( amatch_cursor *pCur, amatch_cost rCost, int nMatch, const char *zWordBase, const char *zWordTail ){ amatch_word *pWord; amatch_avl *pNode; amatch_avl *pOther; int nBase, nTail; char zBuf[4]; if( rCost>pCur->rLimit ){ return; } nBase = (int)strlen(zWordBase); nTail = (int)strlen(zWordTail); if( nBase+nTail+3>pCur->nBuf ){ pCur->nBuf = nBase+nTail+100; pCur->zBuf = sqlite3_realloc(pCur->zBuf, pCur->nBuf); if( pCur->zBuf==0 ){ pCur->nBuf = 0; return; } } amatchEncodeInt(nMatch, zBuf); memcpy(pCur->zBuf, zBuf+2, 2); memcpy(pCur->zBuf+2, zWordBase, nBase); memcpy(pCur->zBuf+2+nBase, zWordTail, nTail+1); pNode = amatchAvlSearch(pCur->pWord, pCur->zBuf); if( pNode ){ pWord = pNode->pWord; if( pWord->rCost>rCost ){ #ifdef AMATCH_TRACE_1 printf("UPDATE [%s][%.*s^%s] %d (\"%s\" \"%s\")\n", pWord->zWord+2, pWord->nMatch, pCur->zInput, pCur->zInput, pWord->rCost, pWord->zWord, pWord->zCost); #endif amatchAvlRemove(&pCur->pCost, &pWord->sCost); pWord->rCost = rCost; amatchWriteCost(pWord); #ifdef AMATCH_TRACE_1 printf(" ---> %d (\"%s\" \"%s\")\n", pWord->rCost, pWord->zWord, pWord->zCost); #endif pOther = amatchAvlInsert(&pCur->pCost, &pWord->sCost); assert( pOther==0 ); (void)pOther; } return; } pWord = sqlite3_malloc( sizeof(*pWord) + nBase + nTail - 1 ); if( pWord==0 ) return; memset(pWord, 0, sizeof(*pWord)); pWord->rCost = rCost; pWord->iSeq = pCur->nWord++; amatchWriteCost(pWord); pWord->nMatch = (short)nMatch; pWord->pNext = pCur->pAllWords; pCur->pAllWords = pWord; pWord->sCost.zKey = pWord->zCost; pWord->sCost.pWord = pWord; pOther = amatchAvlInsert(&pCur->pCost, &pWord->sCost); assert( pOther==0 ); (void)pOther; pWord->sWord.zKey = pWord->zWord; pWord->sWord.pWord = pWord; amatchStrcpy(pWord->zWord, pCur->zBuf); pOther = amatchAvlInsert(&pCur->pWord, &pWord->sWord); assert( pOther==0 ); (void)pOther; #ifdef AMATCH_TRACE_1 printf("INSERT [%s][%.*s^%s] %d (\"%s\" \"%s\")\n", pWord->zWord+2, pWord->nMatch, pCur->zInput, pCur->zInput+pWord->nMatch, rCost, pWord->zWord, pWord->zCost); #endif } /* ** Advance a cursor to its next row of output */ static int amatchNext(sqlite3_vtab_cursor *cur){ amatch_cursor *pCur = (amatch_cursor*)cur; amatch_word *pWord = 0; amatch_avl *pNode; int isMatch = 0; amatch_vtab *p = pCur->pVtab; int nWord; int rc; int i; const char *zW; amatch_rule *pRule; char *zBuf = 0; char nBuf = 0; char zNext[8]; char zNextIn[8]; int nNextIn; if( p->pVCheck==0 ){ char *zSql; if( p->zVocabLang && p->zVocabLang[0] ){ zSql = sqlite3_mprintf( "SELECT \"%w\" FROM \"%w\"", " WHERE \"%w\">=?1 AND \"%w\"=?2" " ORDER BY 1", p->zVocabWord, p->zVocabTab, p->zVocabWord, p->zVocabLang ); }else{ zSql = sqlite3_mprintf( "SELECT \"%w\" FROM \"%w\"" " WHERE \"%w\">=?1" " ORDER BY 1", p->zVocabWord, p->zVocabTab, p->zVocabWord ); } rc = sqlite3_prepare_v2(p->db, zSql, -1, &p->pVCheck, 0); sqlite3_free(zSql); if( rc ) return rc; } sqlite3_bind_int(p->pVCheck, 2, pCur->iLang); do{ pNode = amatchAvlFirst(pCur->pCost); if( pNode==0 ){ pWord = 0; break; } pWord = pNode->pWord; amatchAvlRemove(&pCur->pCost, &pWord->sCost); #ifdef AMATCH_TRACE_1 printf("PROCESS [%s][%.*s^%s] %d (\"%s\" \"%s\")\n", pWord->zWord+2, pWord->nMatch, pCur->zInput, pCur->zInput+pWord->nMatch, pWord->rCost, pWord->zWord, pWord->zCost); #endif nWord = (int)strlen(pWord->zWord+2); if( nWord+20>nBuf ){ nBuf = (char)(nWord+100); zBuf = sqlite3_realloc(zBuf, nBuf); if( zBuf==0 ) return SQLITE_NOMEM; } amatchStrcpy(zBuf, pWord->zWord+2); zNext[0] = 0; zNextIn[0] = pCur->zInput[pWord->nMatch]; if( zNextIn[0] ){ for(i=1; i<=4 && (pCur->zInput[pWord->nMatch+i]&0xc0)==0x80; i++){ zNextIn[i] = pCur->zInput[pWord->nMatch+i]; } zNextIn[i] = 0; nNextIn = i; }else{ nNextIn = 0; } if( zNextIn[0] && zNextIn[0]!='*' ){ sqlite3_reset(p->pVCheck); amatchStrcat(zBuf, zNextIn); sqlite3_bind_text(p->pVCheck, 1, zBuf, nWord+nNextIn, SQLITE_STATIC); rc = sqlite3_step(p->pVCheck); if( rc==SQLITE_ROW ){ zW = (const char*)sqlite3_column_text(p->pVCheck, 0); if( strncmp(zBuf, zW, nWord+nNextIn)==0 ){ amatchAddWord(pCur, pWord->rCost, pWord->nMatch+nNextIn, zBuf, ""); } } zBuf[nWord] = 0; } while( 1 ){ amatchStrcpy(zBuf+nWord, zNext); sqlite3_reset(p->pVCheck); sqlite3_bind_text(p->pVCheck, 1, zBuf, -1, SQLITE_TRANSIENT); rc = sqlite3_step(p->pVCheck); if( rc!=SQLITE_ROW ) break; zW = (const char*)sqlite3_column_text(p->pVCheck, 0); amatchStrcpy(zBuf+nWord, zNext); if( strncmp(zW, zBuf, nWord)!=0 ) break; if( (zNextIn[0]=='*' && zNextIn[1]==0) || (zNextIn[0]==0 && zW[nWord]==0) ){ isMatch = 1; zNextIn[0] = 0; nNextIn = 0; break; } zNext[0] = zW[nWord]; for(i=1; i<=4 && (zW[nWord+i]&0xc0)==0x80; i++){ zNext[i] = zW[nWord+i]; } zNext[i] = 0; zBuf[nWord] = 0; if( p->rIns>0 ){ amatchAddWord(pCur, pWord->rCost+p->rIns, pWord->nMatch, zBuf, zNext); } if( p->rSub>0 ){ amatchAddWord(pCur, pWord->rCost+p->rSub, pWord->nMatch+nNextIn, zBuf, zNext); } if( p->rIns<0 && p->rSub<0 ) break; zNext[i-1]++; /* FIX ME */ } sqlite3_reset(p->pVCheck); if( p->rDel>0 ){ zBuf[nWord] = 0; amatchAddWord(pCur, pWord->rCost+p->rDel, pWord->nMatch+nNextIn, zBuf, ""); } for(pRule=p->pRule; pRule; pRule=pRule->pNext){ if( pRule->iLang!=pCur->iLang ) continue; if( strncmp(pRule->zFrom, pCur->zInput+pWord->nMatch, pRule->nFrom)==0 ){ amatchAddWord(pCur, pWord->rCost+pRule->rCost, pWord->nMatch+pRule->nFrom, pWord->zWord+2, pRule->zTo); } } }while( !isMatch ); pCur->pCurrent = pWord; sqlite3_free(zBuf); return SQLITE_OK; } /* ** Called to "rewind" a cursor back to the beginning so that ** it starts its output over again. Always called at least once ** prior to any amatchColumn, amatchRowid, or amatchEof call. */ static int amatchFilter( sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ amatch_cursor *pCur = (amatch_cursor *)pVtabCursor; const char *zWord = "*"; int idx; amatchClearCursor(pCur); idx = 0; if( idxNum & 1 ){ zWord = (const char*)sqlite3_value_text(argv[0]); idx++; } if( idxNum & 2 ){ pCur->rLimit = (amatch_cost)sqlite3_value_int(argv[idx]); idx++; } if( idxNum & 4 ){ pCur->iLang = (amatch_cost)sqlite3_value_int(argv[idx]); idx++; } pCur->zInput = sqlite3_mprintf("%s", zWord); if( pCur->zInput==0 ) return SQLITE_NOMEM; amatchAddWord(pCur, 0, 0, "", ""); amatchNext(pVtabCursor); return SQLITE_OK; } /* ** Only the word and distance columns have values. All other columns ** return NULL */ static int amatchColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){ amatch_cursor *pCur = (amatch_cursor*)cur; switch( i ){ case AMATCH_COL_WORD: { sqlite3_result_text(ctx, pCur->pCurrent->zWord+2, -1, SQLITE_STATIC); break; } case AMATCH_COL_DISTANCE: { sqlite3_result_int(ctx, pCur->pCurrent->rCost); break; } case AMATCH_COL_LANGUAGE: { sqlite3_result_int(ctx, pCur->iLang); break; } case AMATCH_COL_NWORD: { sqlite3_result_int(ctx, pCur->nWord); break; } default: { sqlite3_result_null(ctx); break; } } return SQLITE_OK; } /* ** The rowid. */ static int amatchRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ amatch_cursor *pCur = (amatch_cursor*)cur; *pRowid = pCur->iRowid; return SQLITE_OK; } /* ** EOF indicator */ static int amatchEof(sqlite3_vtab_cursor *cur){ amatch_cursor *pCur = (amatch_cursor*)cur; return pCur->pCurrent==0; } /* ** Search for terms of these forms: ** ** (A) word MATCH $str ** (B1) distance < $value ** (B2) distance <= $value ** (C) language == $language ** ** The distance< and distance<= are both treated as distance<=. ** The query plan number is a bit vector: ** ** bit 1: Term of the form (A) found ** bit 2: Term like (B1) or (B2) found ** bit 3: Term like (C) found ** ** If bit-1 is set, $str is always in filter.argv[0]. If bit-2 is set ** then $value is in filter.argv[0] if bit-1 is clear and is in ** filter.argv[1] if bit-1 is set. If bit-3 is set, then $ruleid is ** in filter.argv[0] if bit-1 and bit-2 are both zero, is in ** filter.argv[1] if exactly one of bit-1 and bit-2 are set, and is in ** filter.argv[2] if both bit-1 and bit-2 are set. */ static int amatchBestIndex( sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo ){ int iPlan = 0; int iDistTerm = -1; int iLangTerm = -1; int i; const struct sqlite3_index_constraint *pConstraint; (void)tab; pConstraint = pIdxInfo->aConstraint; for(i=0; inConstraint; i++, pConstraint++){ if( pConstraint->usable==0 ) continue; if( (iPlan & 1)==0 && pConstraint->iColumn==0 && pConstraint->op==SQLITE_INDEX_CONSTRAINT_MATCH ){ iPlan |= 1; pIdxInfo->aConstraintUsage[i].argvIndex = 1; pIdxInfo->aConstraintUsage[i].omit = 1; } if( (iPlan & 2)==0 && pConstraint->iColumn==1 && (pConstraint->op==SQLITE_INDEX_CONSTRAINT_LT || pConstraint->op==SQLITE_INDEX_CONSTRAINT_LE) ){ iPlan |= 2; iDistTerm = i; } if( (iPlan & 4)==0 && pConstraint->iColumn==2 && pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){ iPlan |= 4; pIdxInfo->aConstraintUsage[i].omit = 1; iLangTerm = i; } } if( iPlan & 2 ){ pIdxInfo->aConstraintUsage[iDistTerm].argvIndex = 1+((iPlan&1)!=0); } if( iPlan & 4 ){ int idx = 1; if( iPlan & 1 ) idx++; if( iPlan & 2 ) idx++; pIdxInfo->aConstraintUsage[iLangTerm].argvIndex = idx; } pIdxInfo->idxNum = iPlan; if( pIdxInfo->nOrderBy==1 && pIdxInfo->aOrderBy[0].iColumn==1 && pIdxInfo->aOrderBy[0].desc==0 ){ pIdxInfo->orderByConsumed = 1; } pIdxInfo->estimatedCost = (double)10000; return SQLITE_OK; } /* ** The xUpdate() method. ** ** This implementation disallows DELETE and UPDATE. The only thing ** allowed is INSERT into the "command" column. */ static int amatchUpdate( sqlite3_vtab *pVTab, int argc, sqlite3_value **argv, sqlite_int64 *pRowid ){ amatch_vtab *p = (amatch_vtab*)pVTab; const unsigned char *zCmd; (void)pRowid; if( argc==1 ){ pVTab->zErrMsg = sqlite3_mprintf("DELETE from %s is not allowed", p->zSelf); return SQLITE_ERROR; } if( sqlite3_value_type(argv[0])!=SQLITE_NULL ){ pVTab->zErrMsg = sqlite3_mprintf("UPDATE of %s is not allowed", p->zSelf); return SQLITE_ERROR; } if( sqlite3_value_type(argv[2+AMATCH_COL_WORD])!=SQLITE_NULL || sqlite3_value_type(argv[2+AMATCH_COL_DISTANCE])!=SQLITE_NULL || sqlite3_value_type(argv[2+AMATCH_COL_LANGUAGE])!=SQLITE_NULL ){ pVTab->zErrMsg = sqlite3_mprintf( "INSERT INTO %s allowed for column [command] only", p->zSelf); return SQLITE_ERROR; } zCmd = sqlite3_value_text(argv[2+AMATCH_COL_COMMAND]); if( zCmd==0 ) return SQLITE_OK; return SQLITE_OK; } /* ** A virtual table module that implements the "approximate_match". */ static sqlite3_module amatchModule = { 0, /* iVersion */ amatchConnect, /* xCreate */ amatchConnect, /* xConnect */ amatchBestIndex, /* xBestIndex */ amatchDisconnect, /* xDisconnect */ amatchDisconnect, /* xDestroy */ amatchOpen, /* xOpen - open a cursor */ amatchClose, /* xClose - close a cursor */ amatchFilter, /* xFilter - configure scan constraints */ amatchNext, /* xNext - advance a cursor */ amatchEof, /* xEof - check for end of scan */ amatchColumn, /* xColumn - read data */ amatchRowid, /* xRowid - read data */ amatchUpdate, /* xUpdate */ 0, /* xBegin */ 0, /* xSync */ 0, /* xCommit */ 0, /* xRollback */ 0, /* xFindMethod */ 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ 0 /* xRollbackTo */ }; #endif /* SQLITE_OMIT_VIRTUALTABLE */ /* ** Register the amatch virtual table */ #ifdef _WIN32 __declspec(dllexport) #endif int sqlite3_amatch_init( sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Not used */ #ifndef SQLITE_OMIT_VIRTUALTABLE rc = sqlite3_create_module(db, "approximate_match", &amatchModule, 0); #endif /* SQLITE_OMIT_VIRTUALTABLE */ return rc; } ================================================ FILE: v2/testdata/_sqlite/ext/misc/anycollseq.c ================================================ /* ** 2017-04-16 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** This file implements a run-time loadable extension to SQLite that ** registers a sqlite3_collation_needed() callback to register a fake ** collating function for any unknown collating sequence. The fake ** collating function works like BINARY. ** ** This extension can be used to load schemas that contain one or more ** unknown collating sequences. */ #include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 #include static int anyCollFunc( void *NotUsed, int nKey1, const void *pKey1, int nKey2, const void *pKey2 ){ int rc, n; n = nKey1